diff -Nru yt-3.3.3/CONTRIBUTING.rst yt-3.4.0/CONTRIBUTING.rst --- yt-3.3.3/CONTRIBUTING.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/CONTRIBUTING.rst 2017-08-10 18:02:57.000000000 +0000 @@ -22,7 +22,7 @@ You can connect through our web gateway without any special client, at http://yt-project.org/irc.html . *IRC is the first stop for conversation!* - * Many yt developers participate in the yt Slack community. Slack is a free + * Many yt developers participate in the yt Slack community. Slack is a free chat service that many teams use to organize their work. You can get an invite to yt's Slack organization by clicking the "Join us @ Slack" button on this page: http://yt-project.org/community.html @@ -54,18 +54,18 @@ help out. The easiest way to help out is to fork the main yt repository (where the -documentation lives in the ``doc`` directory in the root of the yt mercurial +documentation lives in the ``doc`` directory in the root of the yt git repository) and then make your changes in your own fork. When you are done, issue a pull request through the website for your new fork, and we can comment back and forth and eventually accept your changes. See :ref:`sharing-changes` for -more information about contributing your changes to yt on bitbucket. +more information about contributing your changes to yt on GitHub. Gallery Images and Videos ------------------------- If you have an image or video you'd like to display in the image or video galleries, getting it included it easy! You can either fork the `yt homepage -repository `_ and add it there, or +repository `_ and add it there, or email it to us and we'll add it to the `Gallery `_. @@ -80,20 +80,20 @@ bug fixes, new features, analysis modules, or a new code frontend. See :ref:`creating_frontend` for more details. -The process is pretty simple: fork on BitBucket, make changes, issue a pull +The process is pretty simple: fork on GitHub, make changes, issue a pull request. We can then go back and forth with comments in the pull request, but usually we end up accepting. For more information, see :ref:`contributing-code`, where we spell out how to get up and running with a development environment, how to commit, and how to -use BitBucket. +use GitHub. Online Presence --------------- Some of these fall under the other items, but if you'd like to help out with the website or any of the other ways yt is presented online, please feel free! -Almost everything is kept in hg repositories on BitBucket, and it is very easy +Almost everything is kept in git repositories on GitHub, and it is very easy to fork and contribute back changes. Please feel free to dig in and contribute changes. @@ -210,19 +210,19 @@ yt is a community project! We are very happy to accept patches, features, and bugfixes from any member of -the community! yt is developed using mercurial, primarily because it enables -very easy and straightforward submission of changesets. We're eager to hear +the community! yt is developed using git, primarily because it enables +very easy and straightforward submission of revisions. We're eager to hear from you, and if you are developing yt, we encourage you to subscribe to the `developer mailing list `_. Please feel free to hack around, commit changes, and send them upstream. -.. note:: If you already know how to use the `mercurial version control system - `_ and are comfortable with handling it yourself, - the quickest way to contribute to yt is to `fork us on BitBucket - `_, make your changes, push the +.. note:: If you already know how to use the `git version control system + `_ and are comfortable with handling it yourself, + the quickest way to contribute to yt is to `fork us on GitHub + `_, make your changes, push the changes to your fork and issue a `pull request - `_. The rest of this + `_. The rest of this document is just an explanation of how to do that. See :ref:`code-style-guide` for more information about coding style in yt and @@ -238,8 +238,8 @@ ----------- If you're interested in participating in yt development, take a look at the -`issue tracker on bitbucket -`_. +`issue tracker on GitHub +`_. Issues are marked with a milestone of "easy", "moderate", or "difficult" depending on the estimated level of difficulty for fixing the issue. While we try to triage the issue tracker regularly, it may be the case that issues marked @@ -248,9 +248,8 @@ Here are some predefined issue searches that might be useful: -* Unresolved issues `marked "easy" `_. -* Unresolved issues `marked "easy" or "moderate" `_ -* `All unresolved issues `_ +* Unresolved issues `marked "easy" `_. +* `All unresolved issues `_ Submitting Changes ------------------ @@ -258,7 +257,7 @@ We provide a brief introduction to submitting changes here. yt thrives on the strength of its communities (http://arxiv.org/abs/1301.7064 has further discussion) and we encourage contributions from any user. While we do not -discuss version control, mercurial or the advanced usage of BitBucket in detail +discuss version control, git, or the advanced usage of GitHub in detail here, we do provide an outline of how to submit changes and we are happy to provide further assistance or guidance. @@ -275,48 +274,49 @@ How To Get The Source Code For Editing ++++++++++++++++++++++++++++++++++++++ -yt is hosted on BitBucket, and you can see all of the yt repositories at -http://bitbucket.org/yt_analysis/. With the yt installation script you should have a -copy of Mercurial for checking out pieces of code. Make sure you have followed +yt is hosted on GitHub, and you can see all of the yt repositories at +https://github.com/yt-project/. With the yt installation script you should have a +copy of git for checking out pieces of code. Make sure you have followed the steps above for bootstrapping your development (to assure you have a -bitbucket account, etc.) +GitHub account, etc.) In order to modify the source code for yt, we ask that you make a "fork" of the -main yt repository on bitbucket. A fork is simply an exact copy of the main +main yt repository on GitHub. A fork is simply an exact copy of the main repository (along with its history) that you will now own and can make modifications as you please. You can create a personal fork by visiting the yt -bitbucket webpage at https://bitbucket.org/yt_analysis/yt/ . After logging in, -you should see an option near the top right labeled "fork". Click this option, -and then click the fork repository button on the subsequent page. You now have +GitHub webpage at https://github.com/yt-project/yt/ . After logging in, +you should see an option near the top right labeled "fork". You now have a forked copy of the yt repository for your own personal modification. -This forked copy exists on the bitbucket repository, so in order to access -it locally, follow the instructions at the top of that webpage for that -forked repository, namely run at a local command line: +This forked copy exists on the GitHub repository, so in order to access +it locally you must clone it onto your machine from the command line: .. code-block:: bash - $ hg clone http://bitbucket.org// + $ git clone https://github.com//yt ./yt-git This downloads that new forked repository to your local machine, so that you can access it, read it, make modifications, etc. It will put the repository in a local directory of the same name as the repository in the current working -directory. You should also run the following command, to make sure you are at -the "yt" branch, and not other ones like "stable" (this will be important -later when you want to submit your pull requests): +directory. .. code-block:: bash - $ hg update yt + $ cd yt-git -You can see any past state of the code by using the hg log command. -For example, the following command would show you the last 5 changesets +Verify that you are on the master branch of yt by running: + +.. code-block:: bash + + $ git branch + +You can see any past state of the code by using the git log command. +For example, the following command would show you the last 5 revisions (modifications to the code) that were submitted to that repository. .. code-block:: bash - $ cd - $ hg log -l 5 + $ git log -n 5 Using the revision specifier (the number or hash identifier next to each changeset), you can update the local repository to any past state of the @@ -324,7 +324,7 @@ .. code-block:: bash - $ hg up revision_specifier + $ git checkout revision_specifier Lastly, if you want to use this new downloaded version of your yt repository as the *active* version of yt on your computer (i.e. the one which is executed when @@ -334,8 +334,7 @@ .. code-block:: bash - $ cd - $ python2.7 setup.py develop + $ python setup.py develop This will rebuild all C modules as well. @@ -346,13 +345,13 @@ If you just want to *look* at the source code, you may already have it on your computer. If you build yt using the install script, the source is available at -``$YT_DEST/src/yt-hg``. See :ref:`source-installation` for more details about +``$YT_DEST/src/yt-git``. See :ref:`source-installation` for more details about to obtain the yt source code if you did not build yt using the install script. -The root directory of the yt mercurial repository contains a number of +The root directory of the yt git repository contains a number of subdirectories with different components of the code. Most of the yt source -code is contained in the yt subdirectory. This directory its self contains +code is contained in the yt subdirectory. This directory itself contains the following subdirectories: ``frontends`` @@ -431,49 +430,31 @@ rebuild yt. If your changes have exclusively been to Python modules, you will not need to re-build, but (see below) you may need to re-install. +Note that you will need a functioning compilation environment to build yt. On +linux this typically means installing the package that sets up a basic build +environment (e.g. ``build-essential`` on Debian and Ubuntu). On MacOS this means +installing the XCode command line tools. On Windows this means installing the +version of the Microsoft Visual C++ compiler that is appropriate for your +version of Python. See `the Python wiki +`_ for more details. + If you are running from a clone that is executable in-place (i.e., has been installed via the installation script or you have run ``setup.py develop``) you can rebuild these modules by executing: .. code-block:: bash - $ python2.7 setup.py develop + $ python setup.py develop If you have previously "installed" via ``setup.py install`` you have to re-install: .. code-block:: bash - $ python2.7 setup.py install + $ python setup.py install Only one of these two options is needed. -.. _windows-developing: - -Developing yt on Windows ------------------------- - -If you plan to develop yt on Windows, it is necessary to use the `MinGW -`_ gcc compiler that can be installed using the `Anaconda -Python Distribution `_. The libpython package must be -installed from Anaconda as well. These can both be installed with a single command: - -.. code-block:: bash - - $ conda install libpython mingw - -Additionally, the syntax for the setup command is slightly different; you must type: - -.. code-block:: bash - - $ python2.7 setup.py build --compiler=mingw32 develop - -or - -.. code-block:: bash - - $ python2.7 setup.py build --compiler=mingw32 install - .. _requirements-for-code-submission: Requirements for Code Submission @@ -513,68 +494,61 @@ out with them. In :ref:`code-style-guide` there is a list of handy tips for how to structure and write your code. -.. _mercurial-with-yt: +.. _git-with-yt: -How to Use Mercurial with yt ----------------------------- +How to Use git with yt +---------------------- -If you're new to Mercurial, these three resources are pretty great for learning +If you're new to git, the following resource is pretty great for learning the ins and outs: -* http://hginit.com/ -* http://hgbook.red-bean.com/read/ -* http://mercurial-scm.org/ -* http://mercurial-scm.org/wiki - -The commands that are essential for using mercurial include: - -* ``hg help`` which provides help for any mercurial command. For example, you - can learn more about the ``log`` command by doing ``hg help log``. Other useful - topics to use with ``hg help`` are ``hg help glossary``, ``hg help config``, - ``hg help extensions``, and ``hg help revsets``. -* ``hg commit`` which commits changes in the working directory to the - repository, creating a new "changeset object." -* ``hg add`` which adds a new file to be tracked by mercurial. This does - not change the working directory. -* ``hg pull`` which pulls (from an optional path specifier) changeset - objects from a remote source. The working directory is not modified. -* ``hg push`` which sends (to an optional path specifier) changeset objects - to a remote source. The working directory is not modified. -* ``hg log`` which shows a log of all changeset objects in the current - repository. Use ``-G`` to show a graph of changeset objects and their - relationship. -* ``hg update`` which (with an optional "revision" specifier) updates the - state of the working directory to match a changeset object in the - repository. -* ``hg merge`` which combines two changesets to make a union of their lines - of development. This updates the working directory. +* https://git-scm.com/ + +The commands that are essential for using git include: -We are happy to asnswers questions about mercurial use on our IRC, slack +* ``git --help`` which provides help for any git command. For example, you + can learn more about the ``log`` command by doing ``git log --help``. +* ``git add `` which stages changes to the specified paths for subsequent + committing (see below). +* ``git commit`` which commits staged changes (stage using ``git add`` as above) + in the working directory to the repository, creating a new "revision." +* ``git merge `` which merges the revisions from the specified branch + into the current branch, creating a union of their lines of development. This + updates the working directory. +* ``git pull `` which pulls revisions from the specified branch of the + specified remote repository into the current local branch. Equivalent to ``git + fetch `` and then ``git merge /``. This updates the + working directory. +* ``git push `` which sends revisions on local branches to matching + branches on the specified remote. ``git push `` will only + push changes for the specified branch. +* ``git log`` which shows a log of all revisions on the current branch. There + are many options you can pass to ``git log`` to get additional + information. One example is ``git log --oneline --decorate --graph --all``. + +We are happy to answer questions about git use on our IRC, slack chat or on the mailing list to walk you through any troubles you might have. -Here are some general suggestions for using mercurial with yt: +Here are some general suggestions for using git with yt: -* Named branches are to be avoided. Try using bookmarks (``see hg help - bookmark``) to track work. (`More info about bookmarks is available on the - mercurial wiki `_) -* Make sure you set a username in your ``~/.hgrc`` before you commit any - changes! All of the tutorials above will describe how to do this as one of - the very first steps. +* Although not necessary, a common development work flow is to create a local + named branch other than ``master`` to address a feature request or bugfix. If + the dev work addresses a specific yt GitHub issue, you may include that issue + number in the branch name. For example, if you want to work on issue number X + regarding a cool new slice plot feature, you might name the branch: + ``cool_new_plot_feature_X``. When you're ready to share your work, push your + feature branch to your remote and create a pull request to the ``master`` + branch of the yt-project's repository. * When contributing changes, you might be asked to make a handful of modifications to your source code. We'll work through how to do this with you, and try to make it as painless as possible. * Your test may fail automated style checks. See :ref:`code-style-guide` for more information about automatically verifying your code style. -* Please avoid deleting your yt forks, as that deletes the pull request - discussion from process from BitBucket's website, even if your pull request - is merged. * You should only need one fork. To keep it in sync, you can sync from the - website. See Bitbucket's `Blog Post - `_ - about this. See :ref:`sharing-changes` for a description of the basic workflow + website. See :ref:`sharing-changes` for a description of the basic workflow and :ref:`multiple-PRs` for a discussion about what to do when you want to have multiple open pull requests at the same time. -* If you run into any troubles, stop by IRC (see :ref:`irc`) or the mailing - list. +* If you run into any troubles, stop by IRC (see :ref:`irc`), Slack, or the + mailing list. .. _sharing-changes: @@ -583,30 +557,39 @@ The simplest way to submit changes to yt is to do the following: -* Build yt from the mercurial repository +* Build yt from the git repository * Navigate to the root of the yt repository * Make some changes and commit them -* Fork the `yt repository on BitBucket `_ +* Fork the `yt repository on GitHub `_ * Push the changesets to your fork * Issue a pull request. Here's a more detailed flowchart of how to submit changes. +#. Fork yt on GitHub. (This step only has to be done once.) You can do + this at: https://github.com/yt-project/yt/fork. #. If you have used the installation script, the source code for yt can be - found in ``$YT_DEST/src/yt-hg``. Alternatively see + found in ``$YT_DEST/src/yt-git``. Alternatively see :ref:`source-installation` for instructions on how to build yt from the - mercurial repository. (Below, in :ref:`reading-source`, we describe how to - find items of interest.) + git repository. (Below, in :ref:`reading-source`, we describe how to + find items of interest.) If you have already forked the repository then + you can clone your fork locally:: + + git clone https://github.com//yt ./yt-git + + This will create a local clone of your fork of yt in a folder named + ``yt-git``. #. Edit the source file you are interested in and test your changes. (See :ref:`testing` for more information.) -#. Fork yt on BitBucket. (This step only has to be done once.) You can do - this at: https://bitbucket.org/yt_analysis/yt/fork. Call this repository - yt. -#. Create a bookmark to track your work. For example: ``hg bookmark - my-first-pull-request`` -#. Commit these changes, using ``hg commit``. This can take an argument - which is a series of filenames, if you have some changes you do not want - to commit. +#. Create a uniquely named branch to track your work. For example: ``git + checkout -b my-first-pull-request`` +#. Stage your changes using ``git add ``. This command take an argument + which is a series of filenames whose changes you want to commit. After + staging, execute ``git commit -m ". Addresses Issue + #X"``. Note that supplying an actual GitHub issue # in place of ``X`` will + cause your commit to appear in the issue tracker after pushing to your + remote. This can be very helpful for others who are interested in what work + is being done in connection to that issue. #. Remember that this is a large development effort and to keep the code accessible to everyone, good documentation is a must. Add in source code comments for what you are doing. Add in docstrings @@ -616,132 +599,96 @@ #. If your changes include new functionality or cover an untested area of the code, add a test. (See :ref:`testing` for more information.) Commit these changes as well. -#. Push your changes to your new fork using the command:: +#. Add your remote repository with a unique name identifier. It can be anything + but it is conventional to call it ``origin``. You can see names and URLs of + all the remotes you currently have configured with:: + + git remote -v + + If you already have an ``origin`` remote, you can set it to your fork with:: + + git remote set-url origin https://github.com//yt + + If you do not have an ``origin`` remote you will need to add it:: - hg push -B my-first-pull-request https://bitbucket.org/YourUsername/yt/ + git remote add origin https://github.com//yt - Where you should substitute the name of the bookmark you are working on for - ``my-first-pull-request``. If you end up doing considerable development, you - can set an alias in the file ``.hg/hgrc`` to point to this path. + In addition, it is also useful to add a remote for the main yt repository. + By convention we name this remote ``upstream``:: + + git remote add upstream https://github.com/yt-project/yt + + Note that if you forked the yt repository on GitHub and then cloned from + there you will not need to add the ``origin`` remote. + +#. Push your changes to your remote fork using the unique identifier you just + created and the command:: + + git push origin my-first-pull-request + + Where you should substitute the name of the feature branch you are working on for + ``my-first-pull-request``. .. note:: Note that the above approach uses HTTPS as the transfer protocol - between your machine and BitBucket. If you prefer to use SSH - or + between your machine and GitHub. If you prefer to use SSH - or perhaps you're behind a proxy that doesn't play well with SSL via - HTTPS - you may want to set up an `SSH key`_ on BitBucket. Then, you use - the syntax ``ssh://hg@bitbucket.org/YourUsername/yt``, or equivalent, in - place of ``https://bitbucket.org/YourUsername/yt`` in Mercurial commands. + HTTPS - you may want to set up an `SSH key`_ on GitHub. Then, you use + the syntax ``ssh://git@github.com//yt``, or equivalent, in + place of ``https://github.com//yt`` in git commands. For consistency, all commands we list in this document will use the HTTPS protocol. - .. _SSH key: https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Mercurial - -#. Issue a pull request at - https://bitbucket.org/YourUsername/yt/pull-request/new - A pull request is essentially just asking people to review and accept the + .. _SSH key: https://help.github.com/articles/connecting-to-github-with-ssh/ +#. Issue a pull request at https://github.com/yt-project/yt/pull/new/master A + pull request is essentially just asking people to review and accept the modifications you have made to your personal version of the code. - During the course of your pull request you may be asked to make changes. These -changes may be related to style issues, correctness issues, or even requesting +changes may be related to style issues, correctness issues, or requesting tests. The process for responding to pull request code review is relatively straightforward. #. Make requested changes, or leave a comment indicating why you don't think they should be made. #. Commit those changes to your local repository. -#. Push the changes to your fork: - - hg push https://bitbucket.org/YourUsername/yt/ - +#. Push the changes to your fork:: + git push origin my-first-pull-request #. Your pull request will be automatically updated. -.. _multiple-PRs: - -Working with Multiple BitBucket Pull Requests ---------------------------------------------- - -Once you become active developing for yt, you may be working on -various aspects of the code or bugfixes at the same time. Currently, -BitBucket's *modus operandi* for pull requests automatically updates -your active pull request with every ``hg push`` of commits that are a -descendant of the head of your pull request. In a normal workflow, -this means that if you have an active pull request, make some changes -locally for, say, an unrelated bugfix, then push those changes back to -your fork in the hopes of creating a *new* pull request, you'll -actually end up updating your current pull request! - -There are a few ways around this feature of BitBucket that will allow -for multiple pull requests to coexist; we outline one such method -below. We assume that you have a fork of yt at -``http://bitbucket.org/YourUsername/Your_yt`` (see -:ref:`sharing-changes` for instructions on creating a fork) and that -you have an active pull request to the main repository. - -The main issue with starting another pull request is to make sure that -your push to BitBucket doesn't go to the same head as your -existing pull request and trigger BitBucket's auto-update feature. -Here's how to get your local repository away from your current pull -request head using `revsets `_ -and your ``hgrc`` file: +Once your pull request is merged, sync up with the main yt repository by pulling +from the ``upstream`` remote:: -#. Set up a Mercurial path for the main yt repository (note this is a convenience - step and only needs to be done once). Add the following to your - ``Your_yt/.hg/hgrc``:: + git checkout master + git pull upstream master - [paths] - upstream = https://bitbucket.org/yt_analysis/yt +You might also want to sync your fork of yt on GitHub:: - This will create a path called ``upstream`` that is aliased to the URL of the - main yt repository. -#. Now we'll use revsets_ to update your local repository to the tip of the - ``upstream`` path: + # sync my fork of yt with upstream + git push origin master - .. code-block:: bash +And delete the branch for the merged pull request:: - $ hg pull upstream - $ hg update -r "remote(yt, 'upstream')" + # delete branch for merged pull request + git branch -d my-first-pull-request + git push origin --delete my-first-pull-request -After the above steps, your local repository should be at the current head of -the ``yt`` branch in the main yt repository. If you find yourself doing this a -lot, it may be worth aliasing this task in your ``hgrc`` file by adding -something like:: +These commands are optional but are nice for keeping your branch list +manageable. You can also delete the branch on your fork of yt on GitHub by +clicking the "delete branch" button on the page for the merged pull request on +GitHub. - [alias] - ytupdate = update -r "remote(yt, 'upstream')" - -And then you can just issue ``hg ytupdate`` to get at the current head of the -``yt`` branch on main yt repository. - -Make sure you are on the branch you want to be on, and then you can make changes -and ``hg commit`` them. If you prefer working with `bookmarks -`_, you may want to make a bookmark -before committing your changes, such as ``hg bookmark mybookmark``. - -To push your changes on a bookmark to bitbucket, you can issue the following -command: - -.. code-block:: bash - - $ hg push -B myfeature https://bitbucket.org/YourUsername/Your_yt - -The ``-B`` means "publish my bookmark, the changeset the bookmark is pointing -at, and any ancestors of that changeset that aren't already on the remote -server". - -To push to your fork on BitBucket if you didn't use a bookmark, you issue the -following: - -.. code-block:: bash - - $ hg push -r . -f https://bitbucket.org/YourUsername/Your_yt +.. _multiple-PRs: -The ``-r .`` means "push only the commit I'm standing on and any ancestors." -The ``-f`` is to force Mecurial to do the push since we are creating a new -remote head without a bookmark. +Working with Multiple GitHub Pull Requests +------------------------------------------ -You can then go to the BitBucket interface and issue a new pull request based on -your last changes, as usual. +Dealing with multiple pull requests on GitHub is straightforward. Development on +one feature should be isolated in one named branch, say ``feature_1`` while +development of another feature should be in another named branch, say +``feature_2``. A push to remote ``feature_1`` will automatically update any +active PR for which ``feature_1`` is a pointer to the ``HEAD`` commit. A push to +``feature_1`` *will not* update any pull requests involving ``feature_2``. .. _code-style-guide: @@ -763,11 +710,11 @@ $ pip install flake8 And then navigate to the root of the yt repository and run ``flake8`` on the -``yt`` folder: +``yt`` subdirectory: .. code-block:: bash - $ cd $YT_HG + $ cd yt-git $ flake8 ./yt This will print out any ``flake8`` errors or warnings that your newly added code @@ -775,7 +722,7 @@ cleaned up the rest of the yt codebase of the errors and warnings detected by the `flake8` tool. Note that this will only trigger a subset of the `full flake8 error and warning list -`_, since we explicitly +`_, since we explicitly blacklist a large number of the full list of rules that are checked by ``flake8`` by default. @@ -795,7 +742,7 @@ (something_else))`` should be rewritten as ``if something and something_else``. Python is more forgiving than C. * Avoid copying memory when possible. For example, don't do - ``a = a.reshape(3,4)`` when ``a.shape = (3,4)`` will do, and ``a = a * 3`` + ``a = a.reshape(3, 4)`` when ``a.shape = (3, 4)`` will do, and ``a = a * 3`` should be ``np.multiply(a, 3, a)``. * In general, avoid all double-underscore method names: ``__something`` is usually unnecessary. @@ -941,13 +888,13 @@ use the function. Use the variables 'ds' for the dataset, 'pc' for a plot collection, 'c' for a center, and 'L' for a vector. - >>> a=[1,2,3] - >>> print [x + 3 for x in a] + >>> a = [1, 2, 3] + >>> print([x + 3 for x in a]) [4, 5, 6] - >>> print "a\n\nb" + >>> print("a\n\nb") a - b + b """ Variable Names and Enzo-isms diff -Nru yt-3.3.3/CREDITS yt-3.4.0/CREDITS --- yt-3.3.3/CREDITS 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/CREDITS 2017-08-10 18:02:57.000000000 +0000 @@ -24,6 +24,7 @@ Daniel Fenn (df11c@my.fsu.edu) John Forces (jforbes@ucolick.org) Adam Ginsburg (keflavich@gmail.com) + Austin Gilbert (augilbert4@gmail.com) Sam Geen (samgeen@gmail.com) Nathan Goldbaum (goldbaum@ucolick.org) William Gray (graywilliamj@gmail.com) diff -Nru yt-3.3.3/debian/changelog yt-3.4.0/debian/changelog --- yt-3.3.3/debian/changelog 2017-09-05 08:24:06.000000000 +0000 +++ yt-3.4.0/debian/changelog 2017-10-24 16:11:30.000000000 +0000 @@ -1,20 +1,20 @@ -yt (3.3.3-2build3) artful; urgency=medium +yt (3.4.0-3) unstable; urgency=low - * No-change rebuild to drop _PyFPE support. + * Fix 32 bit FTBF. Closes: #879482 - -- Matthias Klose Tue, 05 Sep 2017 08:24:06 +0000 + -- BW Keller Tue, 24 Oct 2017 16:11:30 +0000 -yt (3.3.3-2build2) artful; urgency=medium +yt (3.4.0-2) unstable; urgency=low - * No-change rebuild to build to drop python3.5. + * Fix build issue with home directory needed for nose tests. - -- Matthias Klose Sat, 05 Aug 2017 18:39:30 +0000 + -- BW Keller Sat, 21 Oct 2017 13:55:11 +0000 -yt (3.3.3-2build1) artful; urgency=medium +yt (3.4.0-1) unstable; urgency=medium - * No change rebuild to add Python 3.6 support. + * Upgrade to upstream version 3.4.0 - -- Michael Hudson-Doyle Wed, 07 Jun 2017 16:25:21 -0700 + -- BW Keller Fri, 22 Sep 2017 17:14:53 +0000 yt (3.3.3-2) unstable; urgency=low diff -Nru yt-3.3.3/debian/control yt-3.4.0/debian/control --- yt-3.3.3/debian/control 2017-01-14 13:59:33.000000000 +0000 +++ yt-3.4.0/debian/control 2017-10-24 16:11:30.000000000 +0000 @@ -13,6 +13,7 @@ python-h5py, python-matplotlib, python-nose, + python-mock, python-numpy, python-setuptools, python-sympy, @@ -40,6 +41,7 @@ python-matplotlib, python-numpy (>= 1:1.6.1), python-numpy-abi9, + python-mock, python-sympy, libjs-jquery Suggests: python-astropy, diff -Nru yt-3.3.3/debian/copyright yt-3.4.0/debian/copyright --- yt-3.3.3/debian/copyright 2017-01-14 13:59:33.000000000 +0000 +++ yt-3.4.0/debian/copyright 2017-10-24 16:11:30.000000000 +0000 @@ -3,6 +3,40 @@ Upstream-Contact: Ben Keller Source: http://yt-project.org/ +Files: * +Copyright: Anne M. Archibald 2008, + (c) Damian Eads, 2007-2008, + (c) 2007-2011 John Tsiombikas , + (c) 2006-2013, Matthew Turk , + (c) 2013-, yt Development Team, + 2015 Kacper Kowalik (Debian files) +License: BSD-3-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + . + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + . + * Neither the name of the Astropy Team nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + Files: yt/pmods.py Copyright: (c) 2011, Lawrence Livermore National Security, LLC. License: LNLL-BSD @@ -116,54 +150,6 @@ Copyright: Copyright (c) 2013 noamraph License: MIT -Files: yt/extern/functools32.py -Copyright: (C) 2006-2010 Python Software Foundation -License: PSF - 1. This LICENSE AGREEMENT is between the Python Software Foundation - ("PSF"), and the Individual or Organization ("Licensee") accessing and - otherwise using this software ("Python") in source or binary form and - its associated documentation. - . - 2. Subject to the terms and conditions of this License Agreement, PSF hereby - grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, - analyze, test, perform and/or display publicly, prepare derivative works, - distribute, and otherwise use Python alone or in any derivative version, - provided, however, that PSF's License Agreement and PSF's notice of copyright, - i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, - 2011, 2012 Python Software Foundation; All Rights Reserved" are retained in Python - alone or in any derivative version prepared by Licensee. - . - 3. In the event Licensee prepares a derivative work that is based on - or incorporates Python or any part thereof, and wants to make - the derivative work available to others as provided herein, then - Licensee hereby agrees to include in any such work a brief summary of - the changes made to Python. - . - 4. PSF is making Python available to Licensee on an "AS IS" - basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR - IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND - DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT - INFRINGE ANY THIRD PARTY RIGHTS. - . - 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON - FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS - A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, - OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - . - 6. This License Agreement will automatically terminate upon a material - breach of its terms and conditions. - . - 7. Nothing in this License Agreement shall be deemed to create any - relationship of agency, partnership, or joint venture between PSF and - Licensee. This License Agreement does not grant permission to use PSF - trademarks or trade name in a trademark sense to endorse or promote - products or services of Licensee, or any third party. - . - 8. By copying, installing or otherwise using Python, Licensee - agrees to be bound by the terms and conditions of this License - Agreement. - Files: yt/visualization/mapserver/html/leaflet/leaflet.js Copyright: Copyright (c) 2010-2011, CloudMade, Vladimir Agafonkin License: BSD-2-Clause @@ -186,37 +172,3 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Files: * -Copyright: Anne M. Archibald 2008, - (c) Damian Eads, 2007-2008, - (c) 2007-2011 John Tsiombikas , - (c) 2006-2013, Matthew Turk , - (c) 2013-, yt Development Team, - 2015 Kacper Kowalik (Debian files) -License: BSD-3-Clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - . - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - . - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - . - * Neither the name of the Astropy Team nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. diff -Nru yt-3.3.3/debian/patches/fix_32bit_ftbfs.patch yt-3.4.0/debian/patches/fix_32bit_ftbfs.patch --- yt-3.3.3/debian/patches/fix_32bit_ftbfs.patch 2017-01-26 19:19:12.000000000 +0000 +++ yt-3.4.0/debian/patches/fix_32bit_ftbfs.patch 2017-10-24 16:11:30.000000000 +0000 @@ -1,42 +1,5 @@ Author: Ben Keller Description: Fix issues with pointer size assumptions on 32-bit systems ---- a/yt/geometry/grid_container.pyx -+++ b/yt/geometry/grid_container.pyx -@@ -63,9 +63,9 @@ - np.ndarray[np.int64_t, ndim=1] num_children): - - cdef int i, j, k -- cdef np.ndarray[np.int64_t, ndim=1] child_ptr -+ cdef np.ndarray[np.int_t, ndim=1] child_ptr - -- child_ptr = np.zeros(num_grids, dtype='int64') -+ child_ptr = np.zeros(num_grids, dtype='int') - - self.num_grids = num_grids - self.num_root_grids = 0 ---- a/yt/geometry/grid_visitors.pxd -+++ b/yt/geometry/grid_visitors.pxd -@@ -37,7 +37,7 @@ - np.float64_t right_edge_x - np.float64_t right_edge_y - np.float64_t right_edge_z -- np.int64_t children_pointers -+ np.int_t children_pointers - np.int64_t start_index_x - np.int64_t start_index_y - np.int64_t start_index_z ---- a/yt/geometry/particle_smooth.pyx -+++ b/yt/geometry/particle_smooth.pyx -@@ -349,8 +349,7 @@ - # Note that what we will be providing to our processing functions will - # actually be indirectly-sorted fields. This preserves memory at the - # expense of additional pointer lookups. -- pind = np.argsort(pdoms) -- pind = np.asarray(pind, dtype='int64', order='C') -+ pind = np.asarray(np.argsort(pdoms), dtype='int64', order='C') - # So what this means is that we now have all the oct-0 particle indices - # in order, then the oct-1, etc etc. - # This now gives us the indices to the particles for each domain. --- a/yt/utilities/lib/alt_ray_tracers.pyx +++ b/yt/utilities/lib/alt_ray_tracers.pyx @@ -101,7 +101,7 @@ @@ -48,14 +11,29 @@ cdef np.ndarray[np.float64_t, ndim=2] xyz, rztheta, ptemp, b1, b2, dsect # set up points ---- a/yt/utilities/lib/pixelization_routines.pyx -+++ b/yt/utilities/lib/pixelization_routines.pyx -@@ -218,7 +218,7 @@ - np.float64_t[:] pdz, - np.float64_t[:] center, - np.float64_t[:,:] inv_mat, -- np.int64_t[:] indices, -+ np.int_t[:] indices, - np.float64_t[:] data, - int cols, int rows, bounds): - cdef np.float64_t x_min, x_max, y_min, y_max +@@ -201,12 +201,12 @@ + tsect, dsect = _cart_intersect(p1cart, p2cart, _cyl2cart(b1), _cyl2cart(b2)) + tmask = np.logical_and(0.0<=tsect, tsect<=1.0) + ret = np.unique(tsect[tmask], return_index=True) +- tsect, tinds = ret[0], ret[1].astype('int64') ++ tsect, tinds = ret[0], ret[1].astype('int') + inds = inds[tmask][tinds] + xyz = dsect[tmask][tinds] + s = np.sqrt(((xyz - p1cart) * (xyz - p1cart)).sum(axis=1)) + ret = np.unique(s, return_index=True) +- s, sinds = ret[0], ret[1].astype('int64') ++ s, sinds = ret[0], ret[1].astype('int') + inds = inds[sinds] + xyz = xyz[sinds] + t = s/np.sqrt((dpcart*dpcart).sum()) +--- a/yt/utilities/lib/misc_utilities.pyx ++++ b/yt/utilities/lib/misc_utilities.pyx +@@ -437,7 +437,7 @@ + cdef np.float64_t z0 + alpha = np.zeros(4) + #the sources must be ordered along z to avoid edges when two overlap +- idx = np.argsort(zs) ++ idx = np.asarray(np.argsort(zs), dtype='int64') + for j in idx: + r = radii[j] + r2 = int((r+0.3)*(r+0.3)) #0.3 to get nicer shape diff -Nru yt-3.3.3/debian/python3-yt.lintian-overrides yt-3.4.0/debian/python3-yt.lintian-overrides --- yt-3.3.3/debian/python3-yt.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/debian/python3-yt.lintian-overrides 2017-10-24 16:11:30.000000000 +0000 @@ -0,0 +1,9 @@ +# iyt and yt are helper scripts, this is primarily a library +python3-yt: library-package-name-for-application +python3-yt: application-in-library-section + +# Don't need to worry about this for our fortran libraries +python3-yt: hardening-no-fortify-functions + +# Leave the leaflet images where they lie +python3-yt: image-file-in-usr-lib diff -Nru yt-3.3.3/debian/python-yt.lintian-overrides yt-3.4.0/debian/python-yt.lintian-overrides --- yt-3.3.3/debian/python-yt.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/debian/python-yt.lintian-overrides 2017-10-24 16:11:30.000000000 +0000 @@ -0,0 +1,9 @@ +# iyt and yt are helper scripts, this is primarily a library +python-yt: library-package-name-for-application +python-yt: application-in-library-section + +# Don't need to worry about this for our fortran libraries +python-yt: hardening-no-fortify-functions + +# Leave the leaflet images where they lie +python-yt: image-file-in-usr-lib diff -Nru yt-3.3.3/debian/rules yt-3.4.0/debian/rules --- yt-3.3.3/debian/rules 2017-01-14 13:59:33.000000000 +0000 +++ yt-3.4.0/debian/rules 2017-10-24 16:11:30.000000000 +0000 @@ -3,6 +3,8 @@ export PYBUILD_NAME=yt export http_proxy=127.0.0.1:9 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export HOME=$(CURDIR)/debian/home %: dh $@ --with python2,python3 --buildsystem=pybuild @@ -19,6 +21,10 @@ rm $(CURDIR)/debian/python3-yt/usr/lib/python*/dist-packages/yt/frontends/artio/artio_headers/LICENSE mv $(CURDIR)/debian/python-yt/usr/bin/yt $(CURDIR)/debian/python-yt/usr/bin/yt2 mv $(CURDIR)/debian/python-yt/usr/bin/iyt $(CURDIR)/debian/python-yt/usr/bin/iyt2 + mkdir -p $(CURDIR)/debian/python-yt/usr/share/doc/python-yt/ + mkdir -p $(CURDIR)/debian/python3-yt/usr/share/doc/python3-yt/ + gzip -9 -c doc/source/reference/changelog.rst > $(CURDIR)/debian/python-yt/usr/share/doc/python-yt/changelog.gz + gzip -9 -c doc/source/reference/changelog.rst > $(CURDIR)/debian/python3-yt/usr/share/doc/python3-yt/changelog.gz override_dh_installman: cp doc/yt.1 doc/yt2.1 @@ -28,5 +34,6 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) override_dh_auto_test: + mkdir -p $(HOME) python setup.py build_ext -i && nosetests endif diff -Nru yt-3.3.3/debian/watch yt-3.4.0/debian/watch --- yt-3.3.3/debian/watch 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/debian/watch 2017-10-24 16:11:30.000000000 +0000 @@ -0,0 +1,3 @@ +version=3 +opts=uversionmangle=s/(rc|a|b|c)/~$1/ \ +https://pypi.debian.net/yt/yt-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) diff -Nru yt-3.3.3/doc/extensions/config_help.py yt-3.4.0/doc/extensions/config_help.py --- yt-3.3.3/doc/extensions/config_help.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/doc/extensions/config_help.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,34 @@ +import re +import subprocess +from docutils import statemachine +from sphinx.util.compat import Directive + +def setup(app): + app.add_directive('config_help', GetConfigHelp) + setup.app = app + setup.config = app.config + setup.confdir = app.confdir + + retdict = dict( + version='1.0', + parallel_read_safe=True, + parallel_write_safe=True + ) + + return retdict + +class GetConfigHelp(Directive): + required_arguments = 1 + optional_arguments = 0 + final_argument_whitespace = True + + def run(self): + rst_file = self.state_machine.document.attributes['source'] + data = subprocess.check_output( + self.arguments[0].split(" ") + ['-h']).decode('utf8').split('\n') + ind = next((i for i, val in enumerate(data) + if re.match('\s{0,3}\{.*\}\s*$', val))) + lines = ['.. code-block:: none', ''] + data[ind + 1:] + self.state_machine.insert_input( + statemachine.string2lines("\n".join(lines)), rst_file) + return [] diff -Nru yt-3.3.3/doc/extensions/pythonscript_sphinxext.py yt-3.4.0/doc/extensions/pythonscript_sphinxext.py --- yt-3.3.3/doc/extensions/pythonscript_sphinxext.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/extensions/pythonscript_sphinxext.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,4 +1,5 @@ import tempfile +import time import os import glob import shutil @@ -37,12 +38,16 @@ f.write(content) # Use sphinx logger? + uid = uuid.uuid4().hex[:8] print("") + print(">> Contents of the script: %s" % uid) print(content) print("") + start = time.time() subprocess.call(['python', 'temp.py']) - + print(">> The execution of the script %s took %f s" % + (uid, time.time() - start)) text = '' for im in sorted(glob.glob("*.png")): text += get_image_tag(im, image_dir, image_rel_dir) diff -Nru yt-3.3.3/doc/extensions/yt_cookbook.py yt-3.4.0/doc/extensions/yt_cookbook.py --- yt-3.3.3/doc/extensions/yt_cookbook.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/extensions/yt_cookbook.py 2017-08-10 18:02:57.000000000 +0000 @@ -23,7 +23,7 @@ return retdict -data_patterns = ["*.h5", "*.out", "*.dat"] +data_patterns = ["*.h5", "*.out", "*.dat", "*.mp4"] class CookbookScript(Directive): required_arguments = 1 diff -Nru yt-3.3.3/doc/extensions/yt_showfields.py yt-3.4.0/doc/extensions/yt_showfields.py --- yt-3.3.3/doc/extensions/yt_showfields.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/doc/extensions/yt_showfields.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,32 @@ +import subprocess +import sys +from sphinx.util.compat import Directive + +def setup(app): + app.add_directive('yt_showfields', ShowFields) + setup.app = app + setup.config = app.config + setup.confdir = app.confdir + + retdict = dict( + version='1.0', + parallel_read_safe=True, + parallel_write_safe=True + ) + + return retdict + +class ShowFields(Directive): + required_arguments = 0 + optional_arguments = 0 + parallel_read_safe = True + parallel_write_safe = True + + def run(self): + rst_file = self.state_machine.document.attributes['source'] + lines = subprocess.check_output( + [sys.executable, './helper_scripts/show_fields.py']) + lines = lines.decode('utf8') + lines = lines.split('\n') + self.state_machine.insert_input(lines, rst_file) + return [] diff -Nru yt-3.3.3/doc/helper_scripts/run_recipes.py yt-3.4.0/doc/helper_scripts/run_recipes.py --- yt-3.3.3/doc/helper_scripts/run_recipes.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/helper_scripts/run_recipes.py 2017-08-10 18:02:57.000000000 +0000 @@ -12,7 +12,7 @@ from multiprocessing import Pool from yt.config import ytcfg -FPATTERNS = ['*.png', '*.txt', '*.h5', '*.dat'] +FPATTERNS = ['*.png', '*.txt', '*.h5', '*.dat', '*.mp4'] DPATTERNS = ['LC*', 'LR', 'DD0046'] BADF = ['cloudy_emissivity.h5', 'apec_emissivity.h5', 'xray_emissivity.h5', 'AMRGridData_Slice_x_density.png'] diff -Nru yt-3.3.3/doc/helper_scripts/show_fields.py yt-3.4.0/doc/helper_scripts/show_fields.py --- yt-3.3.3/doc/helper_scripts/show_fields.py 2016-12-08 23:43:49.000000000 +0000 +++ yt-3.4.0/doc/helper_scripts/show_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,17 +1,14 @@ import inspect -from yt.mods import * -from yt.testing import * +from yt.testing import fake_random_ds import numpy as np from yt.utilities.cosmology import \ Cosmology -from yt.utilities.definitions import \ - mpc_conversion, sec_conversion from yt.frontends.stream.fields import \ StreamFieldInfo from yt.frontends.api import _frontends from yt.fields.derived_field import NullFunc import yt.frontends as frontends_module -from yt.units.yt_array import YTArray, Unit +from yt.units.yt_array import Unit from yt.units import dimensions fields, units = [], [] @@ -35,10 +32,11 @@ return field return field[1] + np.random.seed(int(0x4d3d3d3)) units = [base_ds._get_field_info(*f).units for f in fields] fields = [_strip_ftype(f) for f in fields] -ds = fake_random_ds(16, fields=fields, units=units, particles=True) +ds = fake_random_ds(16, fields=fields, units=units, particles=1) ds.parameters["HydroMethod"] = "streaming" ds.parameters["EOSType"] = 1.0 ds.parameters["EOSSoundSpeed"] = 1.0 @@ -160,6 +158,7 @@ print(" " + line) print() + ds.index print_all_fields(ds.field_info) @@ -172,7 +171,7 @@ u = field[1][0] if len(u) > 0: self.units = ":math:`\mathrm{%s}`" % fix_units(u) - a = ["``%s``" % f for f in field[1][1]] + a = ["``%s``" % f for f in field[1][1] if f] self.aliases = " ".join(a) self.dname = "" if field[1][2] is not None: @@ -183,6 +182,7 @@ self.name = "(%s, '%s')" % (ftype, name) self.ptype = ptype + current_frontends = [f for f in _frontends if f not in ["stream"]] for frontend in current_frontends: @@ -194,7 +194,7 @@ # Drop duplicate entry for GadgetHDF5, add special case for FieldInfo # entry dataset_names = ['GadgetDataset'] - field_info_names = ['SPHFieldInfo'] + field_info_names = ['GadgetFieldInfo'] elif frontend == "boxlib": field_info_names = [] for d in dataset_names: diff -Nru yt-3.3.3/doc/install_script.sh yt-3.4.0/doc/install_script.sh --- yt-3.3.3/doc/install_script.sh 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/install_script.sh 2017-08-10 18:07:20.000000000 +0000 @@ -13,61 +13,23 @@ # If you do not have a working compiler environment, use the following # configuration: -INST_CONDA=1 # Should yt's dependencies be installed using miniconda? INST_YT_SOURCE=0 # Should yt itself be installed from source? -# If you want to install yt's dependencies using conda but want to build yt -# itself from source, use the following configuration: - -# INST_CONDA=1 -# INST_YT_SOURCE=1 - -# If you would like to build yt and all dependencies from source, then -# use the following configuration by uncommenting the lines below. -# NOTE: Building yt's dependencies from source will cause the install script -# to require substantially more time to finish. - -# INST_CONDA=0 -# INST_YT_SOURCE=1 - -BRANCH="yt" # This is the branch to which we will forcibly update. - # What follows are some other options that you may or may not need to change. -# Here's where you put the HDF5 path if you like; otherwise it'll download it -# and install it on its own -#HDF5_DIR= - -# If you've got yt some other place, set this to point to it. The script will -# already check the current directory and the one above it in the tree. +# If you've got a clone of the yt repository some other place, set this to +# point to it. The script will already check the current directory and the one +# above it in the tree. YT_DIR="" # These options can be set to customize the installation. -INST_PY3=0 # Install Python 3 along with Python 2. If this is turned - # on, all Python packages (including yt) will be installed - # in Python 3 (except Mercurial, which requires Python 2). -INST_HG=1 # Install Mercurial or not? If hg is not already - # installed, yt cannot be installed from source. -INST_EMBREE=0 # Install dependencies needed for Embree-accelerated - # ray tracing - -# These options control whether low-level system libraries are installed -# they are necessary for building yt's dependencies from source and are -# ignored when INST_CONDA=1 - -INST_ZLIB=1 # On some systems (Kraken) matplotlib has issues with - # the system zlib, which is compiled statically. - # If need be, you can turn this off. -INST_BZLIB=1 # On some systems, libbzip2 is missing. This can - # lead to broken mercurial installations. -INST_PNG=1 # Install a local libpng? Same things apply as with zlib. -INST_FTYPE=1 # Install FreeType2 locally? -INST_SQLITE3=1 # Install a local version of SQLite3? -INST_0MQ=1 # Install 0mq (for IPython) and affiliated bindings? - -# These variables control whether optional dependencies are installed - +INST_PY3=1 # Install Python 3 instead of Python 2. If this is turned on, + # all Python packages (including yt) will be installed + # in Python 3. +INST_GIT=1 # Install git or not? If git is not already installed, yt + # cannot be installed from source. +INST_EMBREE=0 # Install dependencies needed for Embree-accelerated ray tracing INST_PYX=0 # Install PyX? Sometimes PyX can be problematic without a # working TeX installation. INST_ROCKSTAR=0 # Install the Rockstar halo finder? @@ -76,79 +38,47 @@ INST_ASTROPY=0 # Install astropy? INST_NOSE=1 # Install nose? INST_NETCDF4=1 # Install netcdf4 and its python bindings? +INST_HG=0 # Install Mercurial or not? -# These options allow you to customize the builds of yt dependencies. -# They are only used if INST_CONDA=0. - -# If you need to pass anything to the matplotlib build, do so here. -MPL_SUPP_LDFLAGS="" -MPL_SUPP_CFLAGS="" -MPL_SUPP_CXXFLAGS="" - -# If you need to supply arguments to the NumPy or SciPy build, supply them here -# This one turns on gfortran manually: -#NUMPY_ARGS="--fcompiler=gnu95" -# If you absolutely can't get the fortran to work, try this: -#NUMPY_ARGS="--fcompiler=fake" - -# If you want to spawn multiple Make jobs, here's the place to set the -# arguments. For instance, "-j4" -MAKE_PROCS="" +# This is the branch we will install from for INST_YT_SOURCE=1 +BRANCH="master" -# These variables control which miniconda version and yt recipe are used -# when INST_CONDA=1. +# These variables control which miniconda version is used MINICONDA_URLBASE="http://repo.continuum.io/miniconda" MINICONDA_VERSION="latest" -if [ ${REINST_YT} ] && [ ${REINST_YT} -eq 1 ] && [ -n ${YT_DEST} ] +if [ ! -z "${CONDA_DEFAULT_ENV}" ] then - DEST_DIR=${YT_DEST} - INST_CONDA=0 + echo "Aborting the yt installation because you appear to already" + echo "have a conda environment activated. Either deactivate it with:" + echo + echo " $ source deactivate" + echo + echo "or install yt into your current environment with:" + echo + echo " $ conda install -c conda-forge yt" + echo + exit 1 fi - -if [ $INST_CONDA -ne 0 ] +DEST_SUFFIX="yt-conda" +if [ -n "${PYTHONPATH}" ] then - if [ ! -z "${CONDA_DEFAULT_ENV}" ] - then - echo "Aborting the yt installation because you appear to already" - echo "have a conda environment activated. Either deactivate it with:" - echo - echo " $ source deactivate" - echo - echo "or install yt into your current environment with:" - echo - echo " $ conda install -c conda-forge yt" - echo - exit 1 - fi - DEST_SUFFIX="yt-conda" - if [ -n "${PYTHONPATH}" ] - then - echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING" - echo "*******************************************************" - echo - echo "The PYTHONPATH environment variable is set to:" - echo - echo " $PYTHONPATH" - echo - echo "If dependencies of yt (numpy, scipy, matplotlib) are installed" - echo "to this path, this may cause issues. Exit the install script" - echo "with Ctrl-C and unset PYTHONPATH if you are unsure." - echo "Hit enter to continue." - echo - echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING" - echo "*******************************************************" - read -p "[hit enter]" - fi -else - if [ $INST_YT_SOURCE -eq 0 ] - then - echo "yt must be compiled from source if INST_CONDA is set to 0" - echo "Please set INST_YT_SOURCE to 1 and re-run." - exit 1 - fi - DEST_SUFFIX="yt-`uname -m`" + echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING" + echo "*******************************************************" + echo + echo "The PYTHONPATH environment variable is set to:" + echo + echo " $PYTHONPATH" + echo + echo "If dependencies of yt (numpy, scipy, matplotlib) are installed" + echo "to this path, this may cause issues. Exit the install script" + echo "with Ctrl-C and unset PYTHONPATH if you are unsure." + echo "Hit enter to continue." + echo + echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING" + echo "*******************************************************" + read -p "[hit enter]" fi if [ -z "${DEST_DIR}" ] @@ -199,31 +129,18 @@ function write_config { CONFIG_FILE=${DEST_DIR}/.yt_config - - echo INST_HG=${INST_HG} > ${CONFIG_FILE} - echo INST_ZLIB=${INST_ZLIB} >> ${CONFIG_FILE} - echo INST_BZLIB=${INST_BZLIB} >> ${CONFIG_FILE} - echo INST_PNG=${INST_PNG} >> ${CONFIG_FILE} - echo INST_FTYPE=${INST_FTYPE} >> ${CONFIG_FILE} - echo INST_SQLITE3=${INST_SQLITE3} >> ${CONFIG_FILE} + echo INST_YT_SOURCE=${INST_YT_SOURCE} > ${CONFIG_FILE} + echo INST_GIT=${INST_GIT} >> ${CONFIG_FILE} echo INST_PYX=${INST_PYX} >> ${CONFIG_FILE} - echo INST_0MQ=${INST_0MQ} >> ${CONFIG_FILE} echo INST_PY3=${INST_PY3} >> ${CONFIG_FILE} echo INST_ROCKSTAR=${INST_ROCKSTAR} >> ${CONFIG_FILE} echo INST_SCIPY=${INST_SCIPY} >> ${CONFIG_FILE} + echo INST_EMBREE=${INST_EMBREE} >> ${CONFIG_FILE} + echo INST_H5PY=${INST_H5PY} >> ${CONFIG_FILE} + echo INST_ASTROPY=${INST_ASTROPY} >> ${CONFIG_FILE} + echo INST_NOSE=${INST_NOSE} >> ${CONFIG_FILE} + echo YT_DIR=${YT_DIR} >> ${CONFIG_FILE} - echo MPL_SUPP_LDFLAGS=${MPL_SUPP_LDFLAGS} >> ${CONFIG_FILE} - echo MPL_SUPP_CFLAGS=${MPL_SUPP_CFLAGS} >> ${CONFIG_FILE} - echo MPL_SUPP_CXXFLAGS=${MPL_SUPP_CXXFLAGS} >> ${CONFIG_FILE} - echo MAKE_PROCS=${MAKE_PROCS} >> ${CONFIG_FILE} - if [ ${HDF5_DIR} ] - then - echo ${HDF5_DIR} >> ${CONFIG_FILE} - fi - if [ ${NUMPY_ARGS} ] - then - echo ${NUMPY_ARGS} >> ${CONFIG_FILE} - fi } function get_willwont @@ -241,147 +158,22 @@ MYHOST=`hostname -s` # just give the short one, not FQDN MYHOSTLONG=`hostname` # FQDN, for Ranger MYOS=`uname -s` # A guess at the OS - if [ "${MYHOST##kraken}" != "${MYHOST}" ] - then - echo "Looks like you're on Kraken." - echo - echo " ******************************************" - echo " * It may be better to use the yt module! *" - echo " * *" - echo " * $ module load yt *" - echo " * *" - echo " ******************************************" - echo - echo "IF YOU CHOOSE TO PROCEED:" - echo "YOU MUST BE IN THE GNU PROGRAMMING ENVIRONMENT" - echo " $ module swap PrgEnv-pgi PrgEnv-gnu" - echo - return - fi - if [ "${MYHOST##nautilus}" != "${MYHOST}" ] - then - echo "Looks like you're on Nautilus." - echo - echo " ******************************************" - echo " * It may be better to use the yt module! *" - echo " * *" - echo " * $ module load yt *" - echo " * *" - echo " ******************************************" - echo - echo "NOTE: YOU MUST BE IN THE GNU PROGRAMMING ENVIRONMENT" - echo " $ module swap PE-intel PE-gnu" - echo - echo "Additionally, note that by default, yt will OVERWRITE" - echo "any existing installations from Kraken! You might want" - echo "to adjust the variable DEST_SUFFIX in the install script." - echo - return - fi - if [ "${MYHOST##verne}" != "${MYHOST}" ] - then - echo "Looks like you're on Verne." - echo - echo "NOTE: YOU MUST BE IN THE GNU PROGRAMMING ENVIRONMENT" - echo "This command will take care of that for you:" - echo - echo " $ module swap PE-pgi PE-gnu" - echo - fi - if [ "${MYHOST##steele}" != "${MYHOST}" ] - then - echo "Looks like you're on Steele." - echo - echo "NOTE: YOU MUST BE IN THE GNU PROGRAMMING ENVIRONMENT" - echo "These commands should take care of that for you:" - echo - echo " $ module purge" - echo " $ module load gcc" - echo - fi - if [ "${MYHOST##midway}" != "${MYHOST}" ] - then - echo "Looks like you're on Midway." - echo - echo " ******************************************" - echo " * It may be better to use the yt module! *" - echo " * *" - echo " * $ module load yt *" - echo " * *" - echo " ******************************************" - echo - return - fi if [ "${MYOS##Darwin}" != "${MYOS}" ] then - echo "Looks like you're running on Mac OSX." + echo "Looks like you're running on MacOS." echo echo "NOTE: you must have the Xcode command line tools installed." echo - echo "The instructions for obtaining these tools varies according" - echo "to your exact OS version. On older versions of OS X, you" - echo "must register for an account on the apple developer tools" - echo "website: https://developer.apple.com/downloads to obtain the" - echo "download link." - echo - echo "We have gathered some additional instructions for each" - echo "version of OS X below. If you have trouble installing yt" - echo "after following these instructions, don't hesitate to contact" - echo "the yt user's e-mail list." - echo - echo "You can see which version of OSX you are running by clicking" - echo "'About This Mac' in the apple menu on the left hand side of" - echo "menu bar. We're assuming that you've installed all operating" - echo "system updates; if you have an older version, we suggest" - echo "running software update and installing all available updates." - echo - echo "OS X 10.5.8: search for and download Xcode 3.1.4 from the" - echo "Apple developer tools website." - echo - echo "OS X 10.6.8: search for and download Xcode 3.2 from the Apple" - echo "developer tools website. You can either download the" - echo "Xcode 3.2.2 Developer Tools package (744 MB) and then use" - echo "Software Update to update to XCode 3.2.6 or" - echo "alternatively, you can download the Xcode 3.2.6/iOS SDK" - echo "bundle (4.1 GB)." - echo - echo "OS X 10.7.5: download Xcode 4.2 from the mac app store" - echo "(search for Xcode)." - echo "Alternatively, download the Xcode command line tools from" - echo "the Apple developer tools website." - echo - echo "OS X 10.8.4, 10.9, 10.10, and 10.11:" - echo "download the appropriate version of Xcode from the" - echo "mac app store (search for Xcode)." + echo "Download the appropriate version of Xcode from the" + echo "Mac App Store (search for Xcode)." echo echo "Additionally, you will have to manually install the Xcode" echo "command line tools." echo - echo "For OS X 10.8, see:" - echo "http://stackoverflow.com/questions/9353444" - echo - echo "For OS X 10.9 and newer the command line tools can be installed" + echo "For MacOS 10.10 and newer the command line tools can be installed" echo "with the following command:" echo " xcode-select --install" echo - if [ $INST_CONDA -eq 0 ] - then - echo "For OS X 10.11, you will additionally need to install the" - echo "OpenSSL library using a package manager like homebrew or" - echo "macports." - echo - echo "If your install fails with a message like" - echo " ImportError: cannot import HTTPSHandler" - echo "then you do not have the OpenSSL headers available in a" - echo "location visible to your C compiler. Consider setting" - echo "INST_CONDA=1 instead, as conda's python bundles OpenSSL." - fi - OSX_VERSION=`sw_vers -productVersion` - if [ "${OSX_VERSION##10.8}" != "${OSX_VERSION}" ] - then - MPL_SUPP_CFLAGS="${MPL_SUPP_CFLAGS} -mmacosx-version-min=10.7" - MPL_SUPP_CXXFLAGS="${MPL_SUPP_CXXFLAGS} -mmacosx-version-min=10.7" - fi fi if [ -f /etc/redhat-release ] then @@ -397,9 +189,10 @@ echo " * gcc-{,c++,gfortran}" echo " * make" echo " * patch" + echo " * git" echo echo "You can accomplish this by executing:" - echo "$ sudo yum install gcc gcc-c++ gcc-gfortran make patch zip" + echo "$ sudo yum install gcc gcc-c++ gcc-gfortran make patch zip git" echo "$ sudo yum install ncurses-devel uuid-devel openssl-devel readline-devel" fi if [ -f /etc/SuSE-release ] && [ `grep --count SUSE /etc/SuSE-release` -gt 0 ] @@ -413,11 +206,12 @@ echo " * libuuid-devel" echo " * zip" echo " * gcc-c++" + echo " * git" echo echo "You can accomplish this by executing:" echo echo "$ sudo zypper install -t pattern devel_C_C++" - echo "$ sudo zypper install gcc-c++ libopenssl-devel libuuid-devel zip" + echo "$ sudo zypper install git-core gcc-c++ libopenssl-devel libuuid-devel zip" echo echo "I am also setting special configure arguments to Python to" echo "specify control lib/lib64 issues." @@ -437,10 +231,11 @@ echo " * uuid-dev" echo " * libfreetype6-dev" echo " * tk-dev" + echo " * git" echo echo "You can accomplish this by executing:" echo - echo "$ sudo apt-get install libssl-dev build-essential libncurses5 libncurses5-dev zip uuid-dev libfreetype6-dev tk-dev" + echo "$ sudo apt-get install libssl-dev build-essential libncurses5 libncurses5-dev zip uuid-dev libfreetype6-dev tk-dev git" echo echo echo " Additionally, if you want to put yt's lib dir in your LD_LIBRARY_PATH" @@ -454,31 +249,6 @@ echo " to avoid conflicts with other command-line programs " echo " (like eog and evince, for example)." fi - if [ $INST_SCIPY -eq 1 ] - then - echo - echo "Looks like you've requested that the install script build SciPy." - echo - echo "If the SciPy build fails, please uncomment one of the the lines" - echo "at the top of the install script that sets NUMPY_ARGS, delete" - echo "any broken installation tree, and re-run the install script" - echo "verbatim." - echo - echo "If that doesn't work, don't hesitate to ask for help on the yt" - echo "user's mailing list." - echo - fi - if [ ! -z "${CFLAGS}" ] - then - echo "******************************************" - echo "******************************************" - echo "** **" - echo "** Your CFLAGS is not empty. **" - echo "** This can break h5py compilation. **" - echo "** **" - echo "******************************************" - echo "******************************************" - fi } function log_cmd @@ -498,11 +268,6 @@ echo "Please set INST_YT_SOURCE to 1 and re-run the install script." exit 1 fi - if [ $INST_CONDA -eq 0 ] - then - echo "Embree support has not yet been implemented for INST_CONDA=0." - exit 1 - fi if [ `uname` = "Darwin" ] then EMBREE="embree-2.8.0.x86_64.macosx" @@ -530,17 +295,6 @@ fi fi -if [ $INST_NETCDF4 -ne 0 ] -then - if [ $INST_CONDA -eq 0 ] - then - echo "This script can only install netcdf4 through conda." - echo "Please set INST_CONDA to 1 to install netcdf4" - echo "Setting INST_NETCDF4=0" - INST_NETCDF4=0 - fi -fi - echo echo echo "========================================================================" @@ -554,10 +308,6 @@ echo "the script if you aren't such a fan." echo -printf "%-18s = %s so I " "INST_CONDA" "${INST_CONDA}" -get_willwont ${INST_CONDA} -echo "be installing a conda-based python environment" - printf "%-18s = %s so I " "INST_YT_SOURCE" "${INST_YT_SOURCE}" get_willwont ${INST_YT_SOURCE} echo "be compiling yt from source" @@ -566,37 +316,14 @@ get_willwont ${INST_PY3} echo "be installing Python 3" -printf "%-18s = %s so I " "INST_HG" "${INST_HG}" -get_willwont ${INST_HG} -echo "be installing Mercurial" +printf "%-18s = %s so I " "INST_GIT" "${INST_GIT}" +get_willwont ${INST_GIT} +echo "be installing git" printf "%-18s = %s so I " "INST_EMBREE" "${INST_EMBREE}" get_willwont ${INST_EMBREE} echo "be installing Embree" -if [ $INST_CONDA -eq 0 ] -then - printf "%-18s = %s so I " "INST_ZLIB" "${INST_ZLIB}" - get_willwont ${INST_ZLIB} - echo "be installing zlib" - - printf "%-18s = %s so I " "INST_BZLIB" "${INST_BZLIB}" - get_willwont ${INST_BZLIB} - echo "be installing bzlib" - - printf "%-18s = %s so I " "INST_PNG" "${INST_PNG}" - get_willwont ${INST_PNG} - echo "be installing libpng" - - printf "%-18s = %s so I " "INST_FTYPE" "${INST_FTYPE}" - get_willwont ${INST_FTYPE} - echo "be installing freetype2" - - printf "%-18s = %s so I " "INST_SQLITE3" "${INST_SQLITE3}" - get_willwont ${INST_SQLITE3} - echo "be installing SQLite3" -fi - printf "%-18s = %s so I " "INST_PYX" "${INST_PYX}" get_willwont ${INST_PYX} echo "be installing PyX" @@ -619,16 +346,6 @@ echo -if [ $INST_CONDA -eq 0 ] -then - if [ -z "$HDF5_DIR" ] - then - echo "HDF5_DIR is not set, so I will be installing HDF5" - else - echo "HDF5_DIR=${HDF5_DIR} , so I will not be installing HDF5" - fi -fi - echo echo "Installation will be to" echo " ${DEST_DIR}" @@ -640,25 +357,19 @@ echo "If you'd rather stop, maybe think things over, even grab a sandwich, " echo "hit Ctrl-C." echo + if [ $INST_YT_SOURCE -ne 0 ] then host_specific fi -if [ $INST_CONDA -eq 0 ] -then - if [ ${USED_CONFIG} ] - then - echo "Settings were loaded from ${CONFIG_FILE}." - echo "Remove this file if you wish to return to the default settings." - echo - fi -fi -echo "========================================================================" + echo + if [[ $1 != "--yes" ]] then read -p "[hit enter] " fi + echo echo "Awesome! Here we go." echo @@ -679,59 +390,11 @@ if [ $INST_PY3 -eq 1 ] then - PYTHON_EXEC='python3.5' + PYTHON_EXEC='python3' else PYTHON_EXEC='python2.7' fi -function do_setup_py -{ - [ -e $1/done ] && return - LIB=$1 - shift - if [ -z "$@" ] - then - echo "Installing $LIB" - else - echo "Installing $LIB (arguments: '$@')" - fi - [ ! -e $LIB/extracted ] && tar xfz $LIB.tar.gz - touch $LIB/extracted - BUILD_ARGS="" - if [[ $LIB =~ .*mercurial.* ]] - then - PYEXE="python2.7" - else - PYEXE=${PYTHON_EXEC} - fi - case $LIB in - *h5py*) - pushd $LIB &> /dev/null - ( ${DEST_DIR}/bin/${PYTHON_EXEC} setup.py configure --hdf5=${HDF5_DIR} 2>&1 ) 1>> ${LOG_FILE} || do_exit - popd &> /dev/null - ;; - *numpy*) - if [ -e ${DEST_DIR}/lib/${PYTHON_EXEC}/site-packages/numpy/__init__.py ] - then - VER=$(${DEST_DIR}/bin/${PYTHON_EXEC} -c 'from distutils.version import StrictVersion as SV; \ - import numpy; print SV(numpy.__version__) < SV("1.8.0")') - if [ $VER == "True" ] - then - echo "Removing previous NumPy instance (see issue #889)" - rm -rf ${DEST_DIR}/lib/${PYTHON_EXEC}/site-packages/{numpy*,*.pth} - fi - fi - ;; - *) - ;; - esac - cd $LIB - ( ${DEST_DIR}/bin/${PYEXE} setup.py build ${BUILD_ARGS} $* 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( ${DEST_DIR}/bin/${PYEXE} setup.py install 2>&1 ) 1>> ${LOG_FILE} || do_exit - touch done - cd .. -} - if type -P curl &>/dev/null then echo "Using curl" @@ -741,40 +404,6 @@ export GETFILE="wget -nv" fi -if type -P sha512sum &> /dev/null -then - echo "Using sha512sum" - export SHASUM="sha512sum" -elif type -P shasum &> /dev/null -then - echo "Using shasum -a 512" - export SHASUM="shasum -a 512" -else - echo - echo "I am unable to locate any shasum-like utility." - echo "ALL FILE INTEGRITY IS NOT VERIFIABLE." - echo "THIS IS PROBABLY A BIG DEAL." - echo - echo "(I'll hang out for a minute for you to consider this.)" - sleep 60 -fi - -function get_ytproject -{ - [ -e $1 ] && return - echo "Downloading $1 from yt-project.org" - ${GETFILE} "http://yt-project.org/dependencies/$1" || do_exit - ( ${SHASUM} -c $1.sha512 2>&1 ) 1>> ${LOG_FILE} || do_exit -} - -function get_ytdata -{ - echo "Downloading $1 from yt-project.org" - [ -e $1 ] && return - ${GETFILE} "http://yt-project.org/data/$1" || do_exit - ( ${SHASUM} -c $1.sha512 2>&1 ) 1>> ${LOG_FILE} || do_exit -} - function test_install { echo "Testing that yt can be imported" @@ -783,798 +412,294 @@ ORIG_PWD=`pwd` -if [ -z "${DEST_DIR}" ] -then - echo "Edit this script, set the DEST_DIR parameter and re-run." - exit 1 -fi +MYARCH=`uname -m` +MYOS=`uname -s` -# Set paths to what they should be when yt is activated. -if [ $INST_CONDA -eq 0 ] +if [ $MYOS = "Darwin" ] then - export PATH=${DEST_DIR}/bin:$PATH - export LD_LIBRARY_PATH=${DEST_DIR}/lib:$LD_LIBRARY_PATH - export PYTHONPATH=${DEST_DIR}/lib/${PYTHON_EXEC}/site-packages - - # Write config settings to file. - CONFIG_FILE=${DEST_DIR}/.yt_config - mkdir -p ${DEST_DIR} - if [ -z ${REINST_YT} ] || [ ${REINST_YT} -neq 1 ] + MINICONDA_OS="MacOSX" + MINICONDA_ARCH="x86_64" +elif [ $MYOS = "Linux" ] +then + MINICONDA_OS="Linux" + if [ $MYARCH = "i386" ] then - write_config - elif [ ${REINST_YT} ] && [ ${REINST_YT} -eq 1 ] && [ -f ${CONFIG_FILE} ] + MINICONDA_ARCH="x86" + elif [ $MYARCH = "i686" ] then - USED_CONFIG=1 - source ${CONFIG_FILE} - fi - - # Get supplemental data. - - mkdir -p ${DEST_DIR}/data - cd ${DEST_DIR}/data - echo 'de6d8c6ea849f0206d219303329a0276b3cce7c051eec34377d42aacbe0a4f47ac5145eb08966a338ecddd2b83c8f787ca9956508ad5c39ee2088ad875166410 cloudy_emissivity.h5' > cloudy_emissivity.h5.sha512 - [ ! -e cloudy_emissivity.h5 ] && get_ytdata cloudy_emissivity.h5 - echo '0f714ae2eace0141b1381abf1160dc8f8a521335e886f99919caf3beb31df1fe271d67c7b2a804b1467949eb16b0ef87a3d53abad0e8160fccac1e90d8d9e85f apec_emissivity.h5' > apec_emissivity.h5.sha512 - [ ! -e apec_emissivity.h5 ] && get_ytdata apec_emissivity.h5 - - mkdir -p ${DEST_DIR}/src - cd ${DEST_DIR}/src - - PYTHON2='Python-2.7.11' - PYTHON3='Python-3.5.1' - CYTHON='Cython-0.23.5' - if [ $INST_PY3 -eq 0 ] - then - PYX='PyX-0.12.1' - else - PYX='PyX-0.14.1' - fi - BZLIB='bzip2-1.0.6' - FREETYPE_VER='freetype-2.4.12' - H5PY='h5py-2.5.0' - HDF5='hdf5-1.8.14' - LAPACK='lapack-3.4.2' - PNG='libpng-1.6.3' - MATPLOTLIB='matplotlib-1.5.1' - MERCURIAL='mercurial-3.7.3' - NOSE='nose-1.3.7' - NUMPY='numpy-1.11.0' - PYTHON_HGLIB='python-hglib-2.0' - ROCKSTAR='rockstar-0.99.6' - SCIPY='scipy-0.17.0' - SQLITE='sqlite-autoconf-3071700' - SYMPY='sympy-1.0' - ZLIB='zlib-1.2.8' - SETUPTOOLS='setuptools-20.6.7' - ASTROPY='astropy-1.1.2' - - # Now we dump all our SHA512 files out. - echo '9052d74bbd0c93757fd916939cc3c39eb1aba6c9692b48887ae577256bec64b39b1fd25b6c751e6c8fe723de4c0ddf9a1a207de39f75b0839500dfcdde69f925 Cython-0.23.5.tar.gz' > Cython-0.23.5.tar.gz.sha512 - if [ $INST_PY3 -eq 0 ] + MINICONDA_ARCH="x86" + elif [ $MYARCH = "x86_64" ] then - echo '4941f5aa21aff3743546495fb073c10d2657ff42b2aff401903498638093d0e31e344cce778980f28a7170c6d29eab72ac074277b9d4088376e8692dc71e55c1 PyX-0.12.1.tar.gz' > PyX-0.12.1.tar.gz.sha512 + MINICONDA_ARCH="x86_64" else - echo '16265bbdcaf28ce194189a2987b32952f296c850b829454bcccce0abd23838bfca0276c3e9c8e96b8cbfaf1473bf14669f9b7f2032ee039b61ae59ea3aa45a20 PyX-0.14.1.tar.gz' > PyX-0.14.1.tar.gz.sha512 + echo "Not sure which architecture you are running." + echo "Going with x86_64 architecture." + MINICONDA_OS="Linux-x86_64" fi - echo 'f21df53da87e9e3c14599a34388976e7dd09b951dff3c4b978fe224beeff07e749c0059ffd94f68ca9b75ecaef142b285d579b8dfaad4eab85aca33957114937 Python-2.7.11.tgz' > Python-2.7.11.tgz.sha512 - echo '73f1477f3d3f5bd978c4ea1d1b679467b45e9fd2f443287b88c5c107a9ced580c56e0e8f33acea84e06b11a252e2a4e733120b721a9b6e1bb3d34493a3353bfb Python-3.5.1.tgz' > Python-3.5.1.tgz.sha512 - echo 'b83c4a1415a3eb8c016507705d0d2f22971e4da937bb97953eec08f8f856933d8fa76ce8c536122235b19e7879b16add2e20fd2fee3e488f9b2b4bf1b9f4dbdb astropy-1.1.2.tar.gz' > astropy-1.1.2.tar.gz.sha512 - echo '276bd9c061ec9a27d478b33078a86f93164ee2da72210e12e2c9da71dcffeb64767e4460b93f257302b09328eda8655e93c4b9ae85e74472869afbeae35ca71e blas.tar.gz' > blas.tar.gz.sha512 - echo '00ace5438cfa0c577e5f578d8a808613187eff5217c35164ffe044fbafdfec9e98f4192c02a7d67e01e5a5ccced630583ad1003c37697219b0f147343a3fdd12 bzip2-1.0.6.tar.gz' > bzip2-1.0.6.tar.gz.sha512 - echo '609a68a3675087e0cc95268574f31e104549daa48efe15a25a33b8e269a93b4bd160f4c3e8178dca9c950ef5ca514b039d6fd1b45db6af57f25342464d0429ce freetype-2.4.12.tar.gz' > freetype-2.4.12.tar.gz.sha512 - echo '4a83f9ae1855a7fad90133b327d426201c8ccfd2e7fbe9f39b2d61a2eee2f3ebe2ea02cf80f3d4e1ad659f8e790c173df8cc99b87d0b7ce63d34aa88cfdc7939 h5py-2.5.0.tar.gz' > h5py-2.5.0.tar.gz.sha512 - echo '4073fba510ccadaba41db0939f909613c9cb52ba8fb6c1062fc9118edc601394c75e102310be1af4077d07c9b327e6bbb1a6359939a7268dc140382d0c1e0199 hdf5-1.8.14.tar.gz' > hdf5-1.8.14.tar.gz.sha512 - echo '8770214491e31f0a7a3efaade90eee7b0eb20a8a6ab635c5f854d78263f59a1849133c14ef5123d01023f0110cbb9fc6f818da053c01277914ae81473430a952 lapack-3.4.2.tar.gz' > lapack-3.4.2.tar.gz.sha512 - echo '887582e5a22e4cde338aa8fec7a89f6dd31f2f02b8842735f00f970f64582333fa03401cea6d01704083403c7e8b7ebc26655468ce930165673b33efa4bcd586 libpng-1.6.3.tar.gz' > libpng-1.6.3.tar.gz.sha512 - echo 'a0e78b5027a3a49cf8e77dc0d26f5f380dcd80f7b309b6121199acd5e1d94f48482864a9eee3bd397f7ac6f07fe1d3c21bf517217df3c72e8e3d105b7c2ae58e matplotlib-1.5.1.tar.gz' > matplotlib-1.5.1.tar.gz.sha512 - echo '7f9f97229e40c7092c16ccf227b19a08a9839d8ce19a9d057341fff75876bff32241ee9aa10eab293f779ea3e8a1d97577597187bd96251fb499cbb1075a82cf mercurial-3.7.3.tar.gz' > mercurial-3.7.3.tar.gz.sha512 - echo 'e65c914f621f8da06b9ab11a0ff2763d6e29b82ce2aaed56da0e3773dc899d9deb1f20015789d44c65a5dad7214520f5b659b3f8d7695fb207ad3f78e5cf1b62 nose-1.3.7.tar.gz' > nose-1.3.7.tar.gz.sha512 - echo '92c1889397ad013e25da3a0657fc01e787d528fc19c29cc2acd286c3f07d41b984252583457b1b9259fc303afbe9694565cdcf5752eb4ecb950cc7a99ec1ad8b numpy-1.11.0.tar.gz' > numpy-1.11.0.tar.gz.sha512 - echo '647cc82424783efc3d74540e34976af66acc35fc36d66afba169508946cc62027910c7e41dc9d11ec88c15d6b1e113ce22c2781711ea324de58db3b24d5079c4 python-hglib-2.0.tar.gz' > python-hglib-2.0.tar.gz.sha512 - echo 'de6409d75a3ff3cf1e5391d3b09126f0bc7e1a40a15f9bee244195638fe2f8481fca032896d8534623e6122ff59aaf669664e27ff89cf1b094a5ce7312f220b7 scipy-0.17.0.tar.gz' > scipy-0.17.0.tar.gz.sha512 - echo '96f3e51b46741450bc6b63779c10ebb4a7066860fe544385d64d1eda52592e376a589ef282ace2e1df73df61c10eab1a0d793abbdaf770e60289494d4bf3bcb4 sqlite-autoconf-3071700.tar.gz' > sqlite-autoconf-3071700.tar.gz.sha512 - echo '977db6e9bc6a5918cceb255981a57e85e7060c0922aefd2968b004d25d704e25a5cb5bbe09eb387e8695581e23e2825d9c40310068fe25ece7e9c23037a21f39 sympy-1.0.tar.gz' > sympy-1.0.tar.gz.sha512 - echo 'ece209d4c7ec0cb58ede791444dc754e0d10811cbbdebe3df61c0fd9f9f9867c1c3ccd5f1827f847c005e24eef34fb5bf87b5d3f894d75da04f1797538290e4a zlib-1.2.8.tar.gz' > zlib-1.2.8.tar.gz.sha512 - echo '91a212b5007f9fdfacb4341e06dc0355c5c29897eb8ea407dd4864091f845ba1417bb0d33b5ed6897869d0233e2d0ec6548898d3dbe9eda23f751829bd51a104 setuptools-20.6.7.tar.gz' > setuptools-20.6.7.tar.gz.sha512 - # Individual processes - [ -z "$HDF5_DIR" ] && get_ytproject $HDF5.tar.gz - [ $INST_ZLIB -eq 1 ] && get_ytproject $ZLIB.tar.gz - [ $INST_BZLIB -eq 1 ] && get_ytproject $BZLIB.tar.gz - [ $INST_PNG -eq 1 ] && get_ytproject $PNG.tar.gz - [ $INST_FTYPE -eq 1 ] && get_ytproject $FREETYPE_VER.tar.gz - [ $INST_SQLITE3 -eq 1 ] && get_ytproject $SQLITE.tar.gz - [ $INST_PYX -eq 1 ] && get_ytproject $PYX.tar.gz - [ $INST_SCIPY -eq 1 ] && get_ytproject $SCIPY.tar.gz - [ $INST_SCIPY -eq 1 ] && get_ytproject blas.tar.gz - [ $INST_SCIPY -eq 1 ] && get_ytproject $LAPACK.tar.gz - [ $INST_HG -eq 1 ] && get_ytproject $MERCURIAL.tar.gz - [ $INST_PY3 -eq 1 ] && get_ytproject $PYTHON3.tgz - [ $INST_H5PY -eq 1 ] && get_ytproject $H5PY.tar.gz - [ $INST_NOSE -eq 1 ] && get_ytproject $NOSE.tar.gz - [ $INST_ASTROPY -eq 1 ] && get_ytproject $ASTROPY.tar.gz - get_ytproject $PYTHON2.tgz - get_ytproject $NUMPY.tar.gz - get_ytproject $MATPLOTLIB.tar.gz - get_ytproject $CYTHON.tar.gz - get_ytproject $PYTHON_HGLIB.tar.gz - get_ytproject $SYMPY.tar.gz - get_ytproject $SETUPTOOLS.tar.gz +else + echo "The yt install script is not supported on the ${MYOS}" + echo "operating system." + exit 1 +fi - if [ $INST_BZLIB -eq 1 ] - then - if [ ! -e $BZLIB/done ] - then - [ ! -e $BZLIB ] && tar xfz $BZLIB.tar.gz - echo "Installing BZLIB" - cd $BZLIB - if [ `uname` = "Darwin" ] - then - if [ -z "${CC}" ] - then - sed -i.bak 's/soname/install_name/' Makefile-libbz2_so - else - sed -i.bak -e 's/soname/install_name/' -e "s|CC=gcc|CC=${CC}|" Makefile-libbz2_so - fi - fi - ( make install CFLAGS=-fPIC LDFLAGS=-fPIC PREFIX=${DEST_DIR} 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make -f Makefile-libbz2_so CFLAGS=-fPIC LDFLAGS=-fPIC PREFIX=${DEST_DIR} 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( cp -v libbz2.so.1.0.6 ${DEST_DIR}/lib 2>&1 ) 1>> ${LOG_FILE} || do_exit - touch done - cd .. - fi - BZLIB_DIR=${DEST_DIR} - export LDFLAGS="${LDFLAGS} -L${BZLIB_DIR}/lib/ -L${BZLIB_DIR}/lib64/" - LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BZLIB_DIR}/lib/" - fi +if [ $INST_PY3 -eq 1 ] +then + PY_VERSION='3' +else + PY_VERSION='2' +fi - if [ $INST_ZLIB -eq 1 ] - then - if [ ! -e $ZLIB/done ] - then - [ ! -e $ZLIB ] && tar xfz $ZLIB.tar.gz - echo "Installing ZLIB" - cd $ZLIB - ( ./configure --shared --prefix=${DEST_DIR}/ 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make install 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make clean 2>&1) 1>> ${LOG_FILE} || do_exit - touch done - cd .. - fi - ZLIB_DIR=${DEST_DIR} - export LDFLAGS="${LDFLAGS} -L${ZLIB_DIR}/lib/ -L${ZLIB_DIR}/lib64/" - LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${ZLIB_DIR}/lib/" - fi - - if [ $INST_PNG -eq 1 ] - then - if [ ! -e $PNG/done ] - then - [ ! -e $PNG ] && tar xfz $PNG.tar.gz - echo "Installing PNG" - cd $PNG - ( ./configure CPPFLAGS=-I${DEST_DIR}/include CFLAGS=-I${DEST_DIR}/include --prefix=${DEST_DIR}/ 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make install 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make clean 2>&1) 1>> ${LOG_FILE} || do_exit - touch done - cd .. - fi - PNG_DIR=${DEST_DIR} - export LDFLAGS="${LDFLAGS} -L${PNG_DIR}/lib/ -L${PNG_DIR}/lib64/" - LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${PNG_DIR}/lib/" - fi +MINICONDA_PKG="Miniconda${PY_VERSION}-${MINICONDA_VERSION}-${MINICONDA_OS}-${MINICONDA_ARCH}.sh" - if [ $INST_FTYPE -eq 1 ] - then - if [ ! -e $FREETYPE_VER/done ] - then - [ ! -e $FREETYPE_VER ] && tar xfz $FREETYPE_VER.tar.gz - echo "Installing FreeType2" - cd $FREETYPE_VER - ( ./configure CFLAGS=-I${DEST_DIR}/include --prefix=${DEST_DIR}/ 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make install 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make clean 2>&1) 1>> ${LOG_FILE} || do_exit - touch done - cd .. - fi - FTYPE_DIR=${DEST_DIR} - export LDFLAGS="${LDFLAGS} -L${FTYPE_DIR}/lib/ -L${FTYPE_DIR}/lib64/" - LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${FTYPE_DIR}/lib/" - fi +echo +echo "Downloading ${MINICONDA_URLBASE}/${MINICONDA_PKG}" +echo - if [ -z "$HDF5_DIR" ] - then - if [ ! -e $HDF5/done ] - then - [ ! -e $HDF5 ] && tar xfz $HDF5.tar.gz - echo "Installing HDF5" - cd $HDF5 - ( ./configure --prefix=${DEST_DIR}/ --enable-shared 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make ${MAKE_PROCS} install 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make clean 2>&1) 1>> ${LOG_FILE} || do_exit - touch done - cd .. - fi - export HDF5_DIR=${DEST_DIR} - else - export HDF5_DIR=${HDF5_DIR} - fi - export HDF5_API=16 +if [ -f ${MINICONDA_PKG} ] +then + rm $MINICONDA_PKG +fi - if [ $INST_SQLITE3 -eq 1 ] - then - if [ ! -e $SQLITE/done ] - then - [ ! -e $SQLITE ] && tar xfz $SQLITE.tar.gz - echo "Installing SQLite3" - cd $SQLITE - ( ./configure --prefix=${DEST_DIR}/ 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make ${MAKE_PROCS} install 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make clean 2>&1) 1>> ${LOG_FILE} || do_exit - touch done - cd .. - fi - fi +echo "Installing the Miniconda python environment." - if [ ! -e $PYTHON2/done ] - then - echo "Installing Python 2. This may take a while, but don't worry. yt loves you." - [ ! -e $PYTHON2 ] && tar xfz $PYTHON2.tgz - cd $PYTHON2 - ( ./configure --prefix=${DEST_DIR}/ ${PYCONF_ARGS} 2>&1 ) 1>> ${LOG_FILE} || do_exit - - ( make ${MAKE_PROCS} 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make install 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( ln -sf ${DEST_DIR}/bin/python2.7 ${DEST_DIR}/bin/pyyt 2>&1 ) 1>> ${LOG_FILE} - ( make clean 2>&1) 1>> ${LOG_FILE} || do_exit - touch done - cd .. - fi +if [ -e ${DEST_DIR} ] +then + rm -rf $DEST_DIR/* +else + mkdir $DEST_DIR +fi - ( ${DEST_DIR}/bin/python -c "import _ssl" 2>&1 ) 1>> ${LOG_FILE} - RESULT=$? - if [ $RESULT -ne 0 ] - then - echo "Unable to import the python SSL bindings." - echo "This means that OpenSSL is not installed or your system's OpenSSL" - echo "installation is out of date." - echo "Please install OpenSSL or set INST_CONDA=1" - do_exit - fi +log_cmd ${GETFILE} ${MINICONDA_URLBASE}/${MINICONDA_PKG} || do_exit - if [ $INST_PY3 -eq 1 ] - then - if [ ! -e $PYTHON3/done ] - then - echo "Installing Python 3. Because two Pythons are better than one." - [ ! -e $PYTHON3 ] && tar xfz $PYTHON3.tgz - cd $PYTHON3 - ( ./configure --prefix=${DEST_DIR}/ ${PYCONF_ARGS} 2>&1 ) 1>> ${LOG_FILE} || do_exit - - ( make ${MAKE_PROCS} 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( make install 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( ln -sf ${DEST_DIR}/bin/python3.5 ${DEST_DIR}/bin/pyyt 2>&1 ) 1>> ${LOG_FILE} - ( ln -sf ${DEST_DIR}/bin/python3.5 ${DEST_DIR}/bin/python 2>&1 ) 1>> ${LOG_FILE} - ( ln -sf ${DEST_DIR}/bin/python3-config ${DEST_DIR}/bin/python-config 2>&1 ) 1>> ${LOG_FILE} - ( make clean 2>&1) 1>> ${LOG_FILE} || do_exit - touch done - cd .. - fi - fi +log_cmd bash ./${MINICONDA_PKG} -b -p $DEST_DIR -f + +# Need to set PATH so we use miniconda's python environment +export PATH=${DEST_DIR}/bin:$PATH - export PYTHONPATH=${DEST_DIR}/lib/${PYTHON_EXEC}/site-packages/ +echo "Installing the necessary packages for yt." +echo "This may take a while, but don't worry. yt loves you." - # Install setuptools - do_setup_py $SETUPTOOLS +declare -a YT_DEPS +YT_DEPS+=('python') +YT_DEPS+=('setuptools') +YT_DEPS+=('numpy') +YT_DEPS+=('jupyter') +YT_DEPS+=('ipython') +YT_DEPS+=('sphinx') +if [ ${INST_GIT} -eq 1 ] +then + YT_DEPS+=('git') + YT_DEPS+=('gitpython') +fi +if [ $INST_H5PY -ne 0 ] +then + YT_DEPS+=('h5py') +fi +YT_DEPS+=('matplotlib') +YT_DEPS+=('cython') +if [ $INST_NOSE -ne 0 ] +then + YT_DEPS+=('nose') +fi +if [ $INST_SCIPY -ne 0 ] +then + YT_DEPS+=('scipy') +fi +if [ $INST_ASTROPY -ne 0 ] +then + YT_DEPS+=('astropy') +fi +YT_DEPS+=('conda-build') +if [ $INST_PY3 -eq 0 ] && [ $INST_HG -eq 1 ] +then + YT_DEPS+=('mercurial') +fi +YT_DEPS+=('sympy') - if [ $INST_HG -eq 1 ] +if [ $INST_NETCDF4 -eq 1 ] +then + YT_DEPS+=('netcdf4') +fi + +log_cmd ${DEST_DIR}/bin/conda update --yes conda + +if [ $INST_GIT -eq 1 ] +then + GIT_EXE=${DEST_DIR}/bin/git +else + if type -P git &>/dev/null then - do_setup_py $MERCURIAL - export HG_EXEC=${DEST_DIR}/bin/hg + GIT_EXE="git" else - # We assume that hg can be found in the path. - if type -P hg &>/dev/null + if [ $INST_YT_SOURCE -eq 1 ] then - export HG_EXEC=hg - else - echo "Cannot find mercurial. Please set INST_HG=1." + echo "Cannot find git. Please install git or set INST_GIT=1." do_exit fi fi +fi - if [ -z "$YT_DIR" ] - then - if [ -e $ORIG_PWD/yt/mods.py ] - then - YT_DIR="$ORIG_PWD" - elif [ -e $ORIG_PWD/../yt/mods.py ] - then - YT_DIR=`dirname $ORIG_PWD` - elif [ ! -e yt-hg ] - then - echo "Cloning yt" - YT_DIR="$PWD/yt-hg/" - ( ${HG_EXEC} --debug clone https://bitbucket.org/yt_analysis/yt-supplemental/ 2>&1 ) 1>> ${LOG_FILE} - # Recently the hg server has had some issues with timeouts. In lieu of - # a new webserver, we are now moving to a three-stage process. - # First we clone the repo, but only up to r0. - ( ${HG_EXEC} --debug clone https://bitbucket.org/yt_analysis/yt/ ./yt-hg 2>&1 ) 1>> ${LOG_FILE} - # Now we update to the branch we're interested in. - ( ${HG_EXEC} -R ${YT_DIR} up -C ${BRANCH} 2>&1 ) 1>> ${LOG_FILE} - elif [ -e yt-hg ] - then - YT_DIR="$PWD/yt-hg/" - fi - echo Setting YT_DIR=${YT_DIR} - fi - - # This fixes problems with gfortran linking. - unset LDFLAGS +log_cmd echo "DEPENDENCIES" ${YT_DEPS[@]} +for YT_DEP in "${YT_DEPS[@]}"; do + echo "Installing $YT_DEP" + log_cmd ${DEST_DIR}/bin/conda install -c conda-forge --yes ${YT_DEP} +done - echo "Installing pip" - ( ${GETFILE} https://bootstrap.pypa.io/get-pip.py 2>&1 ) 1>> ${LOG_FILE} || do_exit - ( ${DEST_DIR}/bin/${PYTHON_EXEC} get-pip.py 2>&1 ) 1>> ${LOG_FILE} || do_exit +if [ $INST_PY3 -eq 1 ] && [ $INST_HG -eq 1 ] +then + echo "Installing mercurial" + log_cmd ${DEST_DIR}/bin/conda create -y -n py27 python=2.7 mercurial + log_cmd ln -s ${DEST_DIR}/envs/py27/bin/hg ${DEST_DIR}/bin +fi - if [ $INST_SCIPY -eq 0 ] - then - do_setup_py $NUMPY ${NUMPY_ARGS} - else - if [ ! -e $SCIPY/done ] - then - if [ ! -e BLAS/done ] - then - tar xfz blas.tar.gz - echo "Building BLAS" - cd BLAS - gfortran -O2 -fPIC -fno-second-underscore -c *.f - ( ar r libfblas.a *.o 2>&1 ) 1>> ${LOG_FILE} - ( ranlib libfblas.a 2>&1 ) 1>> ${LOG_FILE} - rm -rf *.o - touch done - cd .. - fi - if [ ! -e $LAPACK/done ] - then - tar xfz $LAPACK.tar.gz - echo "Building LAPACK" - cd $LAPACK/ - cp INSTALL/make.inc.gfortran make.inc - ( make lapacklib OPTS="-fPIC -O2" NOOPT="-fPIC -O0" CFLAGS=-fPIC LDFLAGS=-fPIC 2>&1 ) 1>> ${LOG_FILE} || do_exit - touch done - cd .. - fi - fi - export BLAS=$PWD/BLAS/libfblas.a - export LAPACK=$PWD/$LAPACK/liblapack.a - do_setup_py $NUMPY ${NUMPY_ARGS} - do_setup_py $SCIPY ${NUMPY_ARGS} - fi +if [ $INST_YT_SOURCE -eq 1 ] +then + log_cmd ${GIT_EXE} clone https://github.com/yt-project/yt_conda ${DEST_DIR}/src/yt_conda +fi - if [ -n "${MPL_SUPP_LDFLAGS}" ] - then - OLD_LDFLAGS=${LDFLAGS} - export LDFLAGS="${MPL_SUPP_LDFLAGS}" - echo "Setting LDFLAGS ${LDFLAGS}" - fi - if [ -n "${MPL_SUPP_CXXFLAGS}" ] - then - OLD_CXXFLAGS=${CXXFLAGS} - export CXXFLAGS="${MPL_SUPP_CXXFLAGS}" - echo "Setting CXXFLAGS ${CXXFLAGS}" - fi - if [ -n "${MPL_SUPP_CFLAGS}" ] +if [ $INST_EMBREE -eq 1 ] +then + echo "Installing Embree" + if [ ! -d ${DEST_DIR}/src ] then - OLD_CFLAGS=${CFLAGS} - export CFLAGS="${MPL_SUPP_CFLAGS}" - echo "Setting CFLAGS ${CFLAGS}" + mkdir ${DEST_DIR}/src fi - # Now we set up the basedir for matplotlib: - mkdir -p ${DEST_DIR}/src/$MATPLOTLIB - echo "[directories]" >> ${DEST_DIR}/src/$MATPLOTLIB/setup.cfg - echo "basedirlist = ${DEST_DIR}" >> ${DEST_DIR}/src/$MATPLOTLIB/setup.cfg + cd ${DEST_DIR}/src + ( ${GETFILE} "$EMBREE_URL" 2>&1 ) 1>> ${LOG_FILE} || do_exit + log_cmd tar xfz ${EMBREE}.tar.gz + log_cmd mv ${DEST_DIR}/src/${EMBREE}/include/embree2 ${DEST_DIR}/include + log_cmd mv ${DEST_DIR}/src/${EMBREE}/lib/lib*.* ${DEST_DIR}/lib if [ `uname` = "Darwin" ] then - echo "[gui_support]" >> ${DEST_DIR}/src/$MATPLOTLIB/setup.cfg - echo "macosx = False" >> ${DEST_DIR}/src/$MATPLOTLIB/setup.cfg - fi - - _user_DISPLAY=$DISPLAY - unset DISPLAY # see (yt-user link missing: "Installation failure" 01/29/15) - do_setup_py $MATPLOTLIB - export DISPLAY=${_user_DISPLAY} - if [ -n "${OLD_LDFLAGS}" ] - then - export LDFLAG=${OLD_LDFLAGS} - fi - [ -n "${OLD_LDFLAGS}" ] && export LDFLAGS=${OLD_LDFLAGS} - [ -n "${OLD_CXXFLAGS}" ] && export CXXFLAGS=${OLD_CXXFLAGS} - [ -n "${OLD_CFLAGS}" ] && export CFLAGS=${OLD_CFLAGS} - - echo "Installing Jupyter" - ( ${DEST_DIR}/bin/pip install "jupyter<2.0.0" 2>&1 ) 1>> ${LOG_FILE} - - do_setup_py $CYTHON - if [ $INST_H5PY -eq 1 ] - then - do_setup_py $H5PY - fi - if [ $INST_NOSE -eq 1 ] - then - do_setup_py $NOSE - fi - if [ $INST_ASTROPY -eq 1 ] - then - do_setup_py $ASTROPY - fi - do_setup_py $PYTHON_HGLIB - do_setup_py $SYMPY - [ $INST_PYX -eq 1 ] && do_setup_py $PYX - - ( ${DEST_DIR}/bin/pip install jinja2 2>&1 ) 1>> ${LOG_FILE} - - # Now we build Rockstar and set its environment variable. - if [ $INST_ROCKSTAR -eq 1 ] - then - if [ ! -e rockstar/done ] - then - echo "Building Rockstar" - if [ ! -e rockstar ] - then - ( hg clone http://bitbucket.org/MatthewTurk/rockstar 2>&1 ) 1>> ${LOG_FILE} - fi - cd rockstar - ( hg pull 2>&1 ) 1>> ${LOG_FILE} - ( hg up -C tip 2>&1 ) 1>> ${LOG_FILE} - ( make lib 2>&1 ) 1>> ${LOG_FILE} || do_exit - cp librockstar.so ${DEST_DIR}/lib - ROCKSTAR_DIR=${DEST_DIR}/src/rockstar - echo $ROCKSTAR_DIR > ${YT_DIR}/rockstar.cfg - touch done - cd .. - fi + ln -s ${DEST_DIR}/lib/libembree.2.dylib ${DEST_DIR}/lib/libembree.dylib + install_name_tool -id ${DEST_DIR}/lib/libembree.2.dylib ${DEST_DIR}/lib/libembree.2.dylib + else + ln -s ${DEST_DIR}/lib/libembree.so.2 ${DEST_DIR}/lib/libembree.so fi - echo "Doing yt update, wiping local changes and updating to branch ${BRANCH}" - MY_PWD=`pwd` - cd $YT_DIR - ( ${HG_EXEC} pull 2>1 && ${HG_EXEC} up -C 2>1 ${BRANCH} 2>&1 ) 1>> ${LOG_FILE} - - echo "Installing yt" - [ $INST_PNG -eq 1 ] && echo $PNG_DIR > png.cfg - ( export PATH=$DEST_DIR/bin:$PATH ; ${DEST_DIR}/bin/${PYTHON_EXEC} setup.py develop 2>&1 ) 1>> ${LOG_FILE} || do_exit - touch done - cd $MY_PWD + echo "Installing pyembree from source" + ( ${GETFILE} "$PYEMBREE_URL" 2>&1 ) 1>> ${LOG_FILE} || do_exit + log_cmd unzip ${DEST_DIR}/src/master.zip + pushd ${DEST_DIR}/src/pyembree-master &> /dev/null + log_cmd ${DEST_DIR}/bin/${PYTHON_EXEC} setup.py install build_ext -I${DEST_DIR}/include -L${DEST_DIR}/lib + popd &> /dev/null +fi - if !( ( ${DEST_DIR}/bin/${PYTHON_EXEC} -c "import readline" 2>&1 )>> ${LOG_FILE}) || \ - [[ "${MYOS##Darwin}" != "${MYOS}" && $INST_PY3 -eq 1 ]] - then - if !( ( ${DEST_DIR}/bin/${PYTHON_EXEC} -c "import gnureadline" 2>&1 )>> ${LOG_FILE}) - then - echo "Installing pure-python readline" - ( ${DEST_DIR}/bin/pip install gnureadline 2>&1 ) 1>> ${LOG_FILE} - fi - fi +if [ $INST_ROCKSTAR -eq 1 ] +then + echo "Building Rockstar" + ( ${GIT_EXE} clone https://github.com/yt-project/rockstar ${DEST_DIR}/src/rockstar/ 2>&1 ) 1>> ${LOG_FILE} + ROCKSTAR_PACKAGE=$(${DEST_DIR}/bin/conda build ${DEST_DIR}/src/yt_conda/rockstar --output) + log_cmd ${DEST_DIR}/bin/conda build ${DEST_DIR}/src/yt_conda/rockstar + log_cmd ${DEST_DIR}/bin/conda install $ROCKSTAR_PACKAGE + ROCKSTAR_DIR=${DEST_DIR}/src/rockstar +fi - if [ -e $HOME/.matplotlib/fontList.cache ] && \ - ( grep -q python2.6 $HOME/.matplotlib/fontList.cache ) +# conda doesn't package pyx, so we install manually with pip +if [ $INST_PYX -eq 1 ] +then + if [ $INST_PY3 -eq 1 ] then - echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING" - echo "*******************************************************" - echo - echo " You likely need to remove your old fontList.cache!" - echo " You can do this with this command:" - echo "" - echo " rm $HOME/.matplotlib/fontList.cache" - echo - echo "*******************************************************" + log_cmd ${DEST_DIR}/bin/pip install pyx + else + log_cmd ${DEST_DIR}/bin/pip install pyx==0.12.1 fi - - # Add the environment scripts - ( cp ${YT_DIR}/doc/activate ${DEST_DIR}/bin/activate 2>&1 ) 1>> ${LOG_FILE} - sed -i.bak -e "s,__YT_DIR__,${DEST_DIR}," ${DEST_DIR}/bin/activate - ( cp ${YT_DIR}/doc/activate.csh ${DEST_DIR}/bin/activate.csh 2>&1 ) 1>> ${LOG_FILE} - sed -i.bak -e "s,__YT_DIR__,${DEST_DIR}," ${DEST_DIR}/bin/activate.csh - - test_install - - function print_afterword - { - echo - echo - echo "========================================================================" - echo - echo "yt is now installed in $DEST_DIR ." - echo - echo "To run from this new installation, use the activate script for this " - echo "environment." - echo - echo " $ source $DEST_DIR/bin/activate" - echo - echo "This modifies the environment variables YT_DEST, PATH, PYTHONPATH, and" - echo "LD_LIBRARY_PATH to match your new yt install. If you use csh, just" - echo "append .csh to the above." - echo - echo "To get started with yt, check out the orientation:" - echo - echo " http://yt-project.org/doc/quickstart/" - echo - echo "The source for yt is located at:" - echo " $YT_DIR" - if [ $INST_HG -eq 1 ] - then - echo - echo "Mercurial has also been installed:" - echo - echo "$DEST_DIR/bin/hg" - echo - fi - echo - echo "For support, see the website and join the mailing list:" - echo - echo " http://yt-project.org/" - echo " http://yt-project.org/data/ (Sample data)" - echo " http://yt-project.org/doc/ (Docs)" - echo - echo " http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" - echo - echo "========================================================================" - echo - echo "Oh, look at me, still talking when there's science to do!" - echo "Good luck, and email the user list if you run into any problems." - } - - print_afterword - print_afterword >> ${LOG_FILE} - - echo "yt dependencies were last updated on" > ${DEST_DIR}/.yt_update - date >> ${DEST_DIR}/.yt_update -else # INST_CONDA -eq 1 - MYARCH=`uname -m` # A guess at the OS - MYOS=`uname -s` +fi - if [ $MYOS = "Darwin" ] - then - MINICONDA_OS="MacOSX" - MINICONDA_ARCH="x86_64" - elif [ $MYOS = "Linux" ] +if [ $INST_YT_SOURCE -eq 0 ] +then + echo "Installing yt" + log_cmd ${DEST_DIR}/bin/conda install -c conda-forge --yes yt +else + echo "Building yt from source" + if [ -z "$YT_DIR" ] then - MINICONDA_OS="Linux" - if [ $MYARCH = "i386" ] - then - MINICONDA_ARCH="x86" - elif [ $MYARCH = "i686" ] + if [ -e $ORIG_PWD/yt/mods.py ] then - MINICONDA_ARCH="x86" - elif [ $MYARCH = "x86_64" ] + YT_DIR="$ORIG_PWD" + elif [ -e $ORIG_PWD/../yt/mods.py ] then - MINICONDA_ARCH="x86_64" + YT_DIR=$(dirname $ORIG_PWD) else - echo "Not sure which architecture you are running." - echo "Going with x86_64 architecture." - MINICONDA_OS="Linux-x86_64" + YT_DIR="${DEST_DIR}/src/yt-git" + log_cmd ${GIT_EXE} clone https://github.com/yt-project/yt ${YT_DIR} + log_cmd ${GIT_EXE} -C ${YT_DIR} checkout ${BRANCH} fi - fi - - if [ $INST_PY3 -eq 1 ] - then - PY_VERSION='3' - else - PY_VERSION='2' - fi - - MINICONDA_PKG="Miniconda${PY_VERSION}-${MINICONDA_VERSION}-${MINICONDA_OS}-${MINICONDA_ARCH}.sh" - - echo - echo "Downloading ${MINICONDA_URLBASE}/${MINICONDA_PKG}" - echo - - if [ -f ${MINICONDA_PKG} ] - then - rm $MINICONDA_PKG - fi - - echo "Installing the Miniconda python environment." - - if [ -e ${DEST_DIR} ] - then - rm -rf $DEST_DIR/* + echo Setting YT_DIR=${YT_DIR} else - mkdir $DEST_DIR - fi - - log_cmd ${GETFILE} ${MINICONDA_URLBASE}/${MINICONDA_PKG} || do_exit - - log_cmd bash ./${MINICONDA_PKG} -b -p $DEST_DIR -f - - # Need to set PATH so we use miniconda's python environment - export PATH=${DEST_DIR}/bin:$PATH - - echo "Installing the necessary packages for yt." - echo "This may take a while, but don't worry. yt loves you." - - declare -a YT_DEPS - YT_DEPS+=('python') - YT_DEPS+=('setuptools') - YT_DEPS+=('numpy') - YT_DEPS+=('jupyter') - YT_DEPS+=('ipython') - YT_DEPS+=('sphinx') - if [ $INST_H5PY -ne 0 ] - then - YT_DEPS+=('h5py') - fi - YT_DEPS+=('matplotlib') - YT_DEPS+=('cython') - if [ $INST_NOSE -ne 0 ] - then - YT_DEPS+=('nose') - fi - if [ $INST_SCIPY -ne 0 ] - then - YT_DEPS+=('scipy') - fi - if [ $INST_ASTROPY -ne 0 ] - then - YT_DEPS+=('astropy') - fi - YT_DEPS+=('conda-build') - if [ $INST_PY3 -eq 0 ] - then - YT_DEPS+=('mercurial') - fi - YT_DEPS+=('sympy') - - if [ $INST_NETCDF4 -eq 1 ] - then - YT_DEPS+=('netcdf4') - fi - - log_cmd ${DEST_DIR}/bin/conda update --yes conda - - log_cmd echo "DEPENDENCIES" ${YT_DEPS[@]} - for YT_DEP in "${YT_DEPS[@]}"; do - echo "Installing $YT_DEP" - log_cmd ${DEST_DIR}/bin/conda install --yes ${YT_DEP} - done - - if [ $INST_PY3 -eq 1 ] - then - echo "Installing mercurial" - log_cmd ${DEST_DIR}/bin/conda create -y -n py27 python=2.7 mercurial - log_cmd ln -s ${DEST_DIR}/envs/py27/bin/hg ${DEST_DIR}/bin + if [ ! -e $YT_DIR/.git ] + then + echo "$YT_DIR is not a clone of the yt git repository, exiting" + do_exit + fi fi - - log_cmd ${DEST_DIR}/bin/pip install python-hglib - - log_cmd ${DEST_DIR}/bin/hg clone https://bitbucket.org/yt_analysis/yt_conda ${DEST_DIR}/src/yt_conda - if [ $INST_EMBREE -eq 1 ] then - - echo "Installing Embree" - if [ ! -d ${DEST_DIR}/src ] - then - mkdir ${DEST_DIR}/src - fi - cd ${DEST_DIR}/src - ( ${GETFILE} "$EMBREE_URL" 2>&1 ) 1>> ${LOG_FILE} || do_exit - log_cmd tar xfz ${EMBREE}.tar.gz - log_cmd mv ${DEST_DIR}/src/${EMBREE}/include/embree2 ${DEST_DIR}/include - log_cmd mv ${DEST_DIR}/src/${EMBREE}/lib/lib*.* ${DEST_DIR}/lib - if [ `uname` = "Darwin" ] - then - ln -s ${DEST_DIR}/lib/libembree.2.dylib ${DEST_DIR}/lib/libembree.dylib - install_name_tool -id ${DEST_DIR}/lib/libembree.2.dylib ${DEST_DIR}/lib/libembree.2.dylib - else - ln -s ${DEST_DIR}/lib/libembree.so.2 ${DEST_DIR}/lib/libembree.so - fi - - echo "Installing pyembree from source" - ( ${GETFILE} "$PYEMBREE_URL" 2>&1 ) 1>> ${LOG_FILE} || do_exit - log_cmd unzip ${DEST_DIR}/src/master.zip - pushd ${DEST_DIR}/src/pyembree-master &> /dev/null - log_cmd ${DEST_DIR}/bin/${PYTHON_EXEC} setup.py install build_ext -I${DEST_DIR}/include -L${DEST_DIR}/lib - popd &> /dev/null + echo $DEST_DIR > ${YT_DIR}/embree.cfg fi - if [ $INST_ROCKSTAR -eq 1 ] then - echo "Building Rockstar" - ( ${DEST_DIR}/bin/hg clone http://bitbucket.org/MatthewTurk/rockstar ${DEST_DIR}/src/rockstar/ 2>&1 ) 1>> ${LOG_FILE} - ROCKSTAR_PACKAGE=$(${DEST_DIR}/bin/conda build ${DEST_DIR}/src/yt_conda/rockstar --output) - log_cmd ${DEST_DIR}/bin/conda build ${DEST_DIR}/src/yt_conda/rockstar - log_cmd ${DEST_DIR}/bin/conda install $ROCKSTAR_PACKAGE - ROCKSTAR_DIR=${DEST_DIR}/src/rockstar + echo $ROCKSTAR_DIR > ${YT_DIR}/rockstar.cfg + ROCKSTAR_LIBRARY_PATH=${DEST_DIR}/lib fi + pushd ${YT_DIR} &> /dev/null + ( LIBRARY_PATH=$ROCKSTAR_LIBRARY_PATH ${DEST_DIR}/bin/${PYTHON_EXEC} setup.py develop 2>&1) 1>> ${LOG_FILE} || do_exit + popd &> /dev/null +fi - # conda doesn't package pyx, so we install manually with pip - if [ $INST_PYX -eq 1 ] - then - if [ $INST_PY3 -eq 1 ] - then - log_cmd ${DEST_DIR}/bin/pip install pyx - else - log_cmd ${DEST_DIR}/bin/pip install pyx==0.12.1 - fi - fi +test_install - if [ $INST_YT_SOURCE -eq 0 ] +echo +echo +echo "========================================================================" +echo +echo "yt and the Conda system are now installed in $DEST_DIR" +echo +echo "To get started with yt, check out the orientation:" +echo +echo " http://yt-project.org/doc/orientation/" +echo +echo "For support, see the website and join the mailing list:" +echo +echo " http://yt-project.org/" +echo " http://yt-project.org/data/ (Sample data)" +echo " http://yt-project.org/doc/ (Docs)" +echo +echo " http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" +echo +echo "You must now prepend the following folder to your PATH environment variable:" +echo +echo " $DEST_DIR/bin" +echo +echo "On Bash-style shells you can copy/paste the following command to " +echo "temporarily activate the yt installation:" +echo +echo " export PATH=$DEST_DIR/bin:\$PATH" +echo +echo "and on csh-style shells:" +echo +echo " setenv PATH $DEST_DIR/bin:\$PATH" +echo +echo "You can also update the init file appropriate for your shell" +echo "(e.g. .bashrc, .bash_profile, .cshrc, or .zshrc) to include" +echo "the same command." +echo +if [ $INST_ROCKSTAR -eq 1 ] +then + if [ $MYOS = "Darwin" ] then - echo "Installing yt" - log_cmd ${DEST_DIR}/bin/conda install -c conda-forge --yes yt + LD_NAME="DYLD_LIBRARY_PATH" else - echo "Building yt from source" - YT_DIR="${DEST_DIR}/src/yt-hg" - log_cmd ${DEST_DIR}/bin/hg clone https://bitbucket.org/yt_analysis/yt ${YT_DIR} - log_cmd ${DEST_DIR}/bin/hg -R ${YT_DIR} up -C ${BRANCH} - if [ $INST_EMBREE -eq 1 ] - then - echo $DEST_DIR > ${YT_DIR}/embree.cfg - fi - if [ $INST_ROCKSTAR -eq 1 ] - then - echo $ROCKSTAR_DIR > ${YT_DIR}/rockstar.cfg - ROCKSTAR_LIBRARY_PATH=${DEST_DIR}/lib - fi - pushd ${YT_DIR} &> /dev/null - ( LIBRARY_PATH=$ROCKSTAR_LIBRARY_PATH ${DEST_DIR}/bin/${PYTHON_EXEC} setup.py develop 2>&1) 1>> ${LOG_FILE} || do_exit - popd &> /dev/null + LD_NAME="LD_LIBRARY_PATH" fi - - test_install - - echo - echo - echo "========================================================================" - echo - echo "yt and the Conda system are now installed in $DEST_DIR" - echo - echo "To get started with yt, check out the orientation:" - echo - echo " http://yt-project.org/doc/orientation/" - echo - echo "For support, see the website and join the mailing list:" - echo - echo " http://yt-project.org/" - echo " http://yt-project.org/data/ (Sample data)" - echo " http://yt-project.org/doc/ (Docs)" - echo - echo " http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" - echo - echo "You must now prepend the following folder to your PATH environment variable:" - echo - echo " $DEST_DIR/bin" - echo - echo "On Bash-style shells you can copy/paste the following command to " - echo "temporarily activate the yt installation:" - echo - echo " export PATH=$DEST_DIR/bin:\$PATH" echo - echo "and on csh-style shells:" + echo "For rockstar to work, you must also set $LD_NAME:" echo - echo " setenv PATH $DEST_DIR/bin:\$PATH" + echo " export $LD_NAME=$DEST_DIR/lib:\$$LD_NAME" echo - echo "You can also update the init file appropriate for your shell" - echo "(e.g. .bashrc, .bash_profile, .cshrc, or .zshrc) to include" - echo "the same command." - echo - if [ $INST_ROCKSTAR -eq 1 ] - then - if [ $MYOS = "Darwin" ] - then - LD_NAME="DYLD_LIBRARY_PATH" - else - LD_NAME="LD_LIBRARY_PATH" - fi - echo - echo "For rockstar to work, you must also set $LD_NAME:" - echo - echo " export $LD_NAME=$DEST_DIR/lib:\$$LD_NAME" - echo - echo "or whichever invocation is appropriate for your shell." - fi - echo "========================================================================" - echo - echo "Oh, look at me, still talking when there's science to do!" - echo "Good luck, and email the mailing list if you run into any problems." + echo "or whichever invocation is appropriate for your shell." fi +echo "========================================================================" +echo +echo "Oh, look at me, still talking when there's science to do!" +echo "Good luck, and email the mailing list if you run into any problems." diff -Nru yt-3.3.3/doc/Makefile yt-3.4.0/doc/Makefile --- yt-3.3.3/doc/Makefile 2016-09-22 03:28:40.000000000 +0000 +++ yt-3.4.0/doc/Makefile 2017-08-10 18:02:57.000000000 +0000 @@ -33,20 +33,25 @@ @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " clean to remove the build directory" - @echo " fullclean to remove the build directory and autogenerated api docs" @echo " recipeclean to remove files produced by running the cookbook scripts" clean: -rm -rf $(BUILDDIR)/* + -rm -rf source/reference/api/yt.* + -rm -rf source/reference/api/modules.rst -fullclean: - -rm -rf $(BUILDDIR)/* - -rm -rf source/reference/api/generated +fullclean: clean recipeclean: -rm -rf _temp/*.done source/cookbook/_static/* html: +ifneq ($(READTHEDOCS),True) + SPHINX_APIDOC_OPTIONS=members,undoc-members,inherited-members,show-inheritance sphinx-apidoc \ + -o source/reference/api/ \ + -e ../yt ../yt/extern* $(shell find ../yt -name "*tests*" -type d) ../yt/utilities/voropp* \ + ../yt/analysis_modules/halo_finding/{fof,hop} +endif $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." diff -Nru yt-3.3.3/doc/source/about/index.rst yt-3.4.0/doc/source/about/index.rst --- yt-3.3.3/doc/source/about/index.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/about/index.rst 2017-08-10 17:56:56.000000000 +0000 @@ -16,7 +16,7 @@ it has grown to handle any kind of data represented in a 2D or 3D volume. yt is an Python-based open source project and is open for anyone to use or contribute code. The entire source code and history is available to all -at https://bitbucket.org/yt_analysis/yt . +at http://github.com/yt-project/yt . .. _who-is-yt: @@ -31,7 +31,7 @@ `our members website. `_ For an up-to-date list of everyone who has contributed to the yt codebase, -see the current `CREDITS `_ file. +see the current `CREDITS `_ file. For a more detailed breakup of contributions made by individual users, see out `Open HUB page `_. diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/clump_finding.rst yt-3.4.0/doc/source/analyzing/analysis_modules/clump_finding.rst --- yt-3.3.3/doc/source/analyzing/analysis_modules/clump_finding.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/clump_finding.rst 2017-08-10 18:02:57.000000000 +0000 @@ -13,8 +13,14 @@ the result of user-specified functions, such as checking for gravitational boundedness. A sample recipe can be found in :ref:`cookbook-find_clumps`. +Setting up the Clump Finder +--------------------------- + The clump finder requires a data object (see :ref:`data-objects`) and a field -over which the contouring is to be performed. +over which the contouring is to be performed. The data object is then used +to create the initial +:class:`~yt.analysis_modules.level_sets.clump_handling.Clump` object that +acts as the base for clump finding. .. code:: python @@ -28,11 +34,15 @@ master_clump = Clump(data_source, ("gas", "density")) +Clump Validators +---------------- + At this point, every isolated contour will be considered a clump, whether this is physical or not. Validator functions can be added to determine if an individual contour should be considered a real clump. -These functions are specified with the ``Clump.add_validator`` function. -Current, two validators exist: a minimum number of cells and gravitational +These functions are specified with the +:func:`~yt.analysis_modules.level_sets.clump_handling.Clump.add_validator` +function. Current, two validators exist: a minimum number of cells and gravitational boundedness. .. code:: python @@ -52,7 +62,8 @@ return (clump["gas", "cell_mass"].sum() >= min_mass) add_validator("minimum_gas_mass", _minimum_gas_mass) -The ``add_validator`` function adds the validator to a registry that can +The :func:`~yt.analysis_modules.level_sets.clump_validators.add_validator` +function adds the validator to a registry that can be accessed by the clump finder. Then, the validator can be added to the clump finding just like the others. @@ -60,9 +71,15 @@ master_clump.add_validator("minimum_gas_mass", ds.quan(1.0, "Msun")) -The clump finding algorithm accepts the ``Clump`` object, the initial minimum -and maximum of the contouring field, and the step size. The lower value of the -contour finder will be continually multiplied by the step size. +Running the Clump Finder +------------------------ + +Clump finding then proceeds by calling the +:func:`~yt.analysis_modules.level_sets.clump_handling.find_clumps` function. +This function accepts the +:class:`~yt.analysis_modules.level_sets.clump_handling.Clump` object, the initial +minimum and maximum of the contouring field, and the step size. The lower value +of the contour finder will be continually multiplied by the step size. .. code:: python @@ -71,60 +88,83 @@ step = 2.0 find_clumps(master_clump, c_min, c_max, step) -After the clump finding has finished, the master clump will represent the top -of a hierarchy of clumps. The ``children`` attribute within a ``Clump`` object -contains a list of all sub-clumps. Each sub-clump is also a ``Clump`` object -with its own ``children`` attribute, and so on. +Calculating Clump Quantities +---------------------------- -A number of helper routines exist for examining the clump hierarchy. +By default, a number of quantities will be calculated for each clump when the +clump finding process has finished. The default quantities are: ``total_cells``, +``cell_mass``, ``mass_weighted_jeans_mass``, ``volume_weighted_jeans_mass``, +``max_grid_level``, ``min_number_density``, and ``max_number_density``. +Additional items can be added with the +:func:`~yt.analysis_modules.level_sets.clump_handling.Clump.add_info_item` +function. .. code:: python - # Write a text file of the full hierarchy. - write_clump_index(master_clump, 0, "%s_clump_hierarchy.txt" % ds) + master_clump.add_info_item("total_cells") + +Just like the validators, custom info items can be added by defining functions +that minimally accept a +:class:`~yt.analysis_modules.level_sets.clump_handling.Clump` object and return +a format string to be printed and the value. These are then added to the list +of available info items by calling +:func:`~yt.analysis_modules.level_sets.clump_info_items.add_clump_info`: - # Write a text file of only the leaf nodes. - write_clumps(master_clump,0, "%s_clumps.txt" % ds) +.. code:: python - # Get a list of just the leaf nodes. - leaf_clumps = get_lowest_clumps(master_clump) + def _mass_weighted_jeans_mass(clump): + jeans_mass = clump.data.quantities.weighted_average_quantity( + "jeans_mass", ("gas", "cell_mass")).in_units("Msun") + return "Jeans Mass (mass-weighted): %.6e Msolar." % jeans_mass + add_clump_info("mass_weighted_jeans_mass", _mass_weighted_jeans_mass) -``Clump`` objects can be used like all other data containers. +Then, add it to the list: .. code:: python - print(leaf_clumps[0]["gas", "density"]) - print(leaf_clumps[0].quantities.total_mass()) + master_clump.add_info_item("mass_weighted_jeans_mass") + +Beside the quantities calculated by default, the following are available: +``center_of_mass`` and ``distance_to_main_clump``. -The writing functions will write out a series or properties about each -clump by default. Additional properties can be appended with the -``Clump.add_info_item`` function. +Working with Clumps +------------------- + +After the clump finding has finished, the master clump will represent the top +of a hierarchy of clumps. The ``children`` attribute within a +:class:`~yt.analysis_modules.level_sets.clump_handling.Clump` object +contains a list of all sub-clumps. Each sub-clump is also a +:class:`~yt.analysis_modules.level_sets.clump_handling.Clump` object +with its own ``children`` attribute, and so on. .. code:: python - master_clump.add_info_item("total_cells") + print(master_clump["gas", "density"]) + print(master_clump.children) + print(master_clump.children[0]["gas", "density"]) -Just like the validators, custom info items can be added by defining functions -that minimally accept a ``Clump`` object and return a string to be printed. +The entire clump tree can traversed with a loop syntax: .. code:: python - def _mass_weighted_jeans_mass(clump): - jeans_mass = clump.data.quantities.weighted_average_quantity( - "jeans_mass", ("gas", "cell_mass")).in_units("Msun") - return "Jeans Mass (mass-weighted): %.6e Msolar." % jeans_mass - add_clump_info("mass_weighted_jeans_mass", _mass_weighted_jeans_mass) + for clump in master_clump: + print(clump.clump_id) -Then, add it to the list: +The :func:`~yt.analysis_modules.level_sets.clump_handling.get_lowest_clumps` +function will return a list of the individual clumps that have no children +of their own (the leaf clumps). .. code:: python - master_clump.add_info_item("mass_weighted_jeans_mass") + # Get a list of just the leaf nodes. + leaf_clumps = get_lowest_clumps(master_clump) -By default, the following info items are activated: **total_cells**, -**cell_mass**, **mass_weighted_jeans_mass**, **volume_weighted_jeans_mass**, -**max_grid_level**, **min_number_density**, **max_number_density**, and -**distance_to_main_clump**. + print(leaf_clumps[0]["gas", "density"]) + print(leaf_clumps[0]["all", "particle_mass"]) + print(leaf_clumps[0].quantities.total_mass()) + +Visualizing Clumps +------------------ Clumps can be visualized using the ``annotate_clumps`` callback. @@ -134,3 +174,44 @@ center='c', width=(20,'kpc')) prj.annotate_clumps(leaf_clumps) prj.save('clumps') + +Saving and Reloading Clump Data +------------------------------- + +The clump tree can be saved as a reloadable dataset with the +:func:`~yt.analysis_modules.level_sets.clump_handling.Clump.save_as_dataset` +function. This will save all info items that have been calculated as well as +any field values specified with the *fields* keyword. This function +can be called for any clump in the tree, saving that clump and all those +below it. + +.. code:: python + + fn = master_clump.save_as_dataset(fields=["density", "particle_mass"]) + +The clump tree can then be reloaded as a regular dataset. The ``tree`` attribute +associated with the dataset provides access to the clump tree. The tree can be +iterated over in the same fashion as the original tree. + +.. code:: python + + ds_clumps = yt.load(fn) + for clump ds_clumps.tree: + print(clump.clump_id) + +The ``leaves`` attribute returns a list of all leaf clumps. + +.. code:: python + + print(ds_clumps.leaves) + +Info items for each clump can be accessed with the `clump` field type. Gas +or grid fields should be accessed using the `grid` field type and particle +fields should be access using the specific particle type. + +.. code:: python + + my_clump = ds_clumps.leaves[0] + print(my_clumps["clump", "cell_mass"]) + print(my_clumps["grid", "density"]) + print(my_clumps["all", "particle_mass"]) diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/halo_catalogs.rst yt-3.4.0/doc/source/analyzing/analysis_modules/halo_catalogs.rst --- yt-3.3.3/doc/source/analyzing/analysis_modules/halo_catalogs.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/halo_catalogs.rst 2017-08-10 18:02:57.000000000 +0000 @@ -309,7 +309,7 @@ ^^^^^^^^^^ A quantity is a call back that returns a value or values. The return values -are stored within the halo object in a dictionary called “quantities.” At +are stored within the halo object in a dictionary called "quantities." At the end of the analysis, all of these quantities will be written to disk as the final form of the generated halo catalog. @@ -481,7 +481,9 @@ A :class:`~yt.analysis_modules.halo_analysis.halo_catalog.HaloCatalog` saved to disk can be reloaded as a yt dataset with the -standard call to ``yt.load``. Any side data, such as profiles, can be reloaded +standard call to ``yt.load``. See :ref:`halocatalog` for a demonstration +of loading and working only with the catalog. +Any side data, such as profiles, can be reloaded with a ``load_profiles`` callback and a call to :func:`~yt.analysis_modules.halo_analysis.halo_catalog.HaloCatalog.load`. diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/halo_mass_function.rst yt-3.4.0/doc/source/analyzing/analysis_modules/halo_mass_function.rst --- yt-3.3.3/doc/source/analyzing/analysis_modules/halo_mass_function.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/halo_mass_function.rst 2017-08-10 17:56:56.000000000 +0000 @@ -1,5 +1,12 @@ .. _halo_mass_function: +.. note:: + + This module has been deprecated as it no longer functions correctly and is + unmaintained. The code has been moved to the `yt attic + `__. If you'd like to take it + over, please do! + Halo Mass Function ================== diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/index.rst yt-3.4.0/doc/source/analyzing/analysis_modules/index.rst --- yt-3.3.3/doc/source/analyzing/analysis_modules/index.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/index.rst 2017-08-10 18:02:57.000000000 +0000 @@ -18,4 +18,3 @@ exporting two_point_functions clump_finding - particle_trajectories diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/Particle_Trajectories.ipynb yt-3.4.0/doc/source/analyzing/analysis_modules/Particle_Trajectories.ipynb --- yt-3.3.3/doc/source/analyzing/analysis_modules/Particle_Trajectories.ipynb 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/Particle_Trajectories.ipynb 1970-01-01 00:00:00.000000000 +0000 @@ -1,385 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The `particle_trajectories` analysis module enables the construction of particle trajectories from a time series of datasets for a specified list of particles identified by their unique indices. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "%matplotlib inline\n", - "import yt\n", - "import glob\n", - "from yt.analysis_modules.particle_trajectories.api import ParticleTrajectories\n", - "from yt.config import ytcfg\n", - "path = ytcfg.get(\"yt\", \"test_data_dir\")\n", - "import matplotlib.pyplot as plt" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "First, let's start off with a FLASH dataset containing only two particles in a mutual circular orbit. We can get the list of filenames this way:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "my_fns = glob.glob(path+\"/Orbit/orbit_hdf5_chk_00[0-9][0-9]\")\n", - "my_fns.sort()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "And let's define a list of fields that we want to include in the trajectories. The position fields will be included by default, so let's just ask for the velocity fields:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fields = [\"particle_velocity_x\", \"particle_velocity_y\", \"particle_velocity_z\"]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "There are only two particles, but for consistency's sake let's grab their indices from the dataset itself:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ds = yt.load(my_fns[0])\n", - "dd = ds.all_data()\n", - "indices = dd[\"particle_index\"].astype(\"int\")\n", - "print (indices)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "which is what we expected them to be. Now we're ready to create a `ParticleTrajectories` object:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "trajs = ParticleTrajectories(my_fns, indices, fields=fields)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The `ParticleTrajectories` object `trajs` is essentially a dictionary-like container for the particle fields along the trajectory, and can be accessed as such:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "print (trajs[\"particle_position_x\"])\n", - "print (trajs[\"particle_position_x\"].shape)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Note that each field is a 2D NumPy array with the different particle indices along the first dimension and the times along the second dimension. As such, we can access them individually by indexing the field:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "plt.plot(trajs[\"particle_position_x\"][0].ndarray_view(), trajs[\"particle_position_y\"][0].ndarray_view())\n", - "plt.plot(trajs[\"particle_position_x\"][1].ndarray_view(), trajs[\"particle_position_y\"][1].ndarray_view())" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "And we can plot the velocity fields as well:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "plt.plot(trajs[\"particle_velocity_x\"][0].ndarray_view(), trajs[\"particle_velocity_y\"][0].ndarray_view())\n", - "plt.plot(trajs[\"particle_velocity_x\"][1].ndarray_view(), trajs[\"particle_velocity_y\"][1].ndarray_view())" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "If we want to access the time along the trajectory, we use the key `\"particle_time\"`:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "plt.plot(trajs[\"particle_time\"].ndarray_view(), trajs[\"particle_velocity_x\"][1].ndarray_view())\n", - "plt.plot(trajs[\"particle_time\"].ndarray_view(), trajs[\"particle_velocity_y\"][1].ndarray_view())" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Alternatively, if we know the particle index we'd like to examine, we can get an individual trajectory corresponding to that index:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "particle1 = trajs.trajectory_from_index(1)\n", - "plt.plot(particle1[\"particle_time\"].ndarray_view(), particle1[\"particle_position_x\"].ndarray_view())\n", - "plt.plot(particle1[\"particle_time\"].ndarray_view(), particle1[\"particle_position_y\"].ndarray_view())" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now let's look at a more complicated (and fun!) example. We'll use an Enzo cosmology dataset. First, we'll find the maximum density in the domain, and obtain the indices of the particles within some radius of the center. First, let's have a look at what we're getting:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ds = yt.load(\"enzo_tiny_cosmology/DD0046/DD0046\")\n", - "slc = yt.SlicePlot(ds, \"x\", [\"density\",\"dark_matter_density\"], center=\"max\", width=(3.0, \"Mpc\"))\n", - "slc.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "So far, so good--it looks like we've centered on a galaxy cluster. Let's grab all of the dark matter particles within a sphere of 0.5 Mpc (identified by `\"particle_type == 1\"`):" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "sp = ds.sphere(\"max\", (0.5, \"Mpc\"))\n", - "indices = sp[\"particle_index\"][sp[\"particle_type\"] == 1]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Next we'll get the list of datasets we want, and create trajectories for these particles:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "my_fns = glob.glob(path+\"/enzo_tiny_cosmology/DD*/*.hierarchy\")\n", - "my_fns.sort()\n", - "trajs = ParticleTrajectories(my_fns, indices)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Matplotlib can make 3D plots, so let's pick three particle trajectories at random and look at them in the volume:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import matplotlib.pyplot as plt\n", - "from mpl_toolkits.mplot3d import Axes3D\n", - "fig = plt.figure(figsize=(8.0, 8.0))\n", - "ax = fig.add_subplot(111, projection='3d')\n", - "ax.plot(trajs[\"particle_position_x\"][100].ndarray_view(), trajs[\"particle_position_z\"][100].ndarray_view(), \n", - " trajs[\"particle_position_z\"][100].ndarray_view())\n", - "ax.plot(trajs[\"particle_position_x\"][8].ndarray_view(), trajs[\"particle_position_z\"][8].ndarray_view(), \n", - " trajs[\"particle_position_z\"][8].ndarray_view())\n", - "ax.plot(trajs[\"particle_position_x\"][25].ndarray_view(), trajs[\"particle_position_z\"][25].ndarray_view(), \n", - " trajs[\"particle_position_z\"][25].ndarray_view())" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "It looks like these three different particles fell into the cluster along different filaments. We can also look at their x-positions only as a function of time:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "plt.plot(trajs[\"particle_time\"].ndarray_view(), trajs[\"particle_position_x\"][100].ndarray_view())\n", - "plt.plot(trajs[\"particle_time\"].ndarray_view(), trajs[\"particle_position_x\"][8].ndarray_view())\n", - "plt.plot(trajs[\"particle_time\"].ndarray_view(), trajs[\"particle_position_x\"][25].ndarray_view())" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Suppose we wanted to know the gas density along the particle trajectory, but there wasn't a particle field corresponding to that in our dataset. Never fear! If the field exists as a grid field, yt will interpolate this field to the particle positions and add the interpolated field to the trajectory. To add such a field (or any field, including additional particle fields) we can call the `add_fields` method:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "trajs.add_fields([\"density\"])" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We also could have included `\"density\"` in our original field list. Now, plot up the gas density for each particle as a function of time:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "plt.plot(trajs[\"particle_time\"].ndarray_view(), trajs[\"density\"][100].ndarray_view())\n", - "plt.plot(trajs[\"particle_time\"].ndarray_view(), trajs[\"density\"][8].ndarray_view())\n", - "plt.plot(trajs[\"particle_time\"].ndarray_view(), trajs[\"density\"][25].ndarray_view())\n", - "plt.yscale(\"log\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Finally, the particle trajectories can be written to disk. Two options are provided: ASCII text files with a column for each field and the time, and HDF5 files:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "trajs.write_out(\"halo_trajectories\") # This will write a separate file for each trajectory\n", - "trajs.write_out_h5(\"halo_trajectories.h5\") # This will write all trajectories to a single file" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.5.1" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/particle_trajectories.rst yt-3.4.0/doc/source/analyzing/analysis_modules/particle_trajectories.rst --- yt-3.3.3/doc/source/analyzing/analysis_modules/particle_trajectories.rst 2016-09-22 03:28:40.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/particle_trajectories.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -.. _particle-trajectories: - -Particle Trajectories ---------------------- - -.. notebook:: Particle_Trajectories.ipynb diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/photon_simulator.rst yt-3.4.0/doc/source/analyzing/analysis_modules/photon_simulator.rst --- yt-3.3.3/doc/source/analyzing/analysis_modules/photon_simulator.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/photon_simulator.rst 2017-08-10 18:02:57.000000000 +0000 @@ -3,6 +3,14 @@ Constructing Mock X-ray Observations ------------------------------------ +.. warning:: + + The ``photon_simulator`` analysis module has been deprecated; it is + no longer being updated, and it will be removed in a future version + of yt. Users are encouraged to download and use the + `pyXSIM `_ package + instead. + .. note:: If you just want to create derived fields for X-ray emission, diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/PPVCube.ipynb yt-3.4.0/doc/source/analyzing/analysis_modules/PPVCube.ipynb --- yt-3.3.3/doc/source/analyzing/analysis_modules/PPVCube.ipynb 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/PPVCube.ipynb 2017-08-10 18:02:57.000000000 +0000 @@ -93,14 +93,14 @@ "outputs": [], "source": [ "dens = np.zeros((nx,ny,nz))\n", - "dens[:,:,nz/2-3:nz/2+3] = (r**alpha).reshape(nx,ny,1) # the density profile of the disk\n", + "dens[:,:,nz//2-3:nz//2+3] = (r**alpha).reshape(nx,ny,1) # the density profile of the disk\n", "temp = np.zeros((nx,ny,nz))\n", - "temp[:,:,nz/2-3:nz/2+3] = 1.0e5 # Isothermal\n", + "temp[:,:,nz//2-3:nz//2+3] = 1.0e5 # Isothermal\n", "vel_theta = 100.*r/(1.+(r/r_0)**beta) # the azimuthal velocity profile of the disk\n", "velx = np.zeros((nx,ny,nz))\n", "vely = np.zeros((nx,ny,nz))\n", - "velx[:,:,nz/2-3:nz/2+3] = (-vel_theta*np.sin(theta)).reshape(nx,ny,1) # convert polar to cartesian\n", - "vely[:,:,nz/2-3:nz/2+3] = (vel_theta*np.cos(theta)).reshape(nx,ny,1) # convert polar to cartesian\n", + "velx[:,:,nz//2-3:nz//2+3] = (-vel_theta*np.sin(theta)).reshape(nx,ny,1) # convert polar to cartesian\n", + "vely[:,:,nz//2-3:nz//2+3] = (vel_theta*np.cos(theta)).reshape(nx,ny,1) # convert polar to cartesian\n", "dens[r > R] = 0.0\n", "temp[r > R] = 0.0\n", "velx[r > R] = 0.0\n", diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/star_analysis.rst yt-3.4.0/doc/source/analyzing/analysis_modules/star_analysis.rst --- yt-3.3.3/doc/source/analyzing/analysis_modules/star_analysis.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/star_analysis.rst 2017-08-10 18:08:36.000000000 +0000 @@ -1,3 +1,9 @@ +.. note:: + + This module has been deprecated as it is unmaintained. The code has been + moved to the `yt attic `__. + If you'd like to take it over, please do! + .. _star_analysis: Star Particle Analysis @@ -209,8 +215,8 @@ There are two ways to write out the data once the spectrum has been calculated. The command ``write_out`` outputs two columns of data: - 1. Wavelength :math:`(\text{\AA})` - 2. Flux (Luminosity per unit wavelength :math:`(\mathrm{\rm{L}_\odot} / \text{\AA})` , where + 1. Wavelength (:math:`\text{Angstroms}`) + 2. Flux (Luminosity per unit wavelength :math:`(\mathrm{\rm{L}_\odot} / \text{Angstrom})` , where :math:`\mathrm{\rm{L}_\odot} = 3.826 \cdot 10^{33}\, \mathrm{ergs / s}` ). and can be called simply, specifying the output file: @@ -225,7 +231,7 @@ distribution to. The default is 5200 Angstroms. This command outputs the data in two columns: - 1. Wavelength :math:`(\text{\AA})` + 1. Wavelength :math:`(\text{Angstroms})` 2. Relative flux normalized to the flux at *flux_norm*. .. code-block:: python diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/sunrise_export.rst yt-3.4.0/doc/source/analyzing/analysis_modules/sunrise_export.rst --- yt-3.3.3/doc/source/analyzing/analysis_modules/sunrise_export.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/sunrise_export.rst 2017-08-10 17:56:56.000000000 +0000 @@ -1,5 +1,11 @@ .. _sunrise_export: +.. note:: + + This module has been deprecated as it is unmaintained. The code has been + moved to the `yt attic `__. + If you'd like to take it over, please do! + Exporting to Sunrise ==================== diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/two_point_functions.rst yt-3.4.0/doc/source/analyzing/analysis_modules/two_point_functions.rst --- yt-3.3.3/doc/source/analyzing/analysis_modules/two_point_functions.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/two_point_functions.rst 2017-08-10 18:08:46.000000000 +0000 @@ -1,3 +1,9 @@ +.. note:: + + This module has been deprecated as it is unmaintained. The code has been + moved to the `yt attic `__. + If you'd like to take it over, please do! + .. _two_point_functions: Two Point Functions diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/XrayEmissionFields.ipynb yt-3.4.0/doc/source/analyzing/analysis_modules/XrayEmissionFields.ipynb --- yt-3.3.3/doc/source/analyzing/analysis_modules/XrayEmissionFields.ipynb 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/XrayEmissionFields.ipynb 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,220 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> Note: If you came here trying to figure out how to create simulated X-ray photons and observations,\n", + " you should go [here](analysis_modules/photon_simulator.html) instead." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This functionality provides the ability to create metallicity-dependent X-ray luminosity, emissivity, and photon emissivity fields for a given photon energy range. This works by interpolating from emission tables created from the photoionization code [Cloudy](http://nublado.org/) or the collisional ionization database [AtomDB](http://www.atomdb.org). These can be downloaded from http://yt-project.org/data from the command line like so:\n", + "\n", + "`# Put the data in a directory you specify` \n", + "`yt download cloudy_emissivity_v2.h5 /path/to/data`\n", + "\n", + "`# Put the data in the location set by \"supp_data_dir\"` \n", + "`yt download apec_emissivity_v2.h5 supp_data_dir`\n", + "\n", + "The data path can be a directory on disk, or it can be \"supp_data_dir\", which will download the data to the directory specified by the `\"supp_data_dir\"` yt configuration entry. It is easiest to put these files in the directory from which you will be running yt or `\"supp_data_dir\"`, but see the note below about putting them in alternate locations." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Emission fields can be made for any energy interval between 0.1 keV and 100 keV, and will always be created for luminosity $(\\rm{erg~s^{-1}})$, emissivity $\\rm{(erg~s^{-1}~cm^{-3})}$, and photon emissivity $\\rm{(photons~s^{-1}~cm^{-3})}$. The only required arguments are the\n", + "dataset object, and the minimum and maximum energies of the energy band. However, typically one needs to decide what will be used for the metallicity. This can either be a floating-point value representing a spatially constant metallicity, or a prescription for a metallicity field, e.g. `(\"gas\", \"metallicity\")`. For this first example, where the dataset has no metallicity field, we'll just assume $Z = 0.3~Z_\\odot$ everywhere:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "scrolled": false + }, + "outputs": [], + "source": [ + "import yt\n", + "\n", + "ds = yt.load(\"GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150\")\n", + "\n", + "xray_fields = yt.add_xray_emissivity_field(ds, 0.5, 7.0, table_type='apec', metallicity=0.3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> Note: If you place the HDF5 emissivity tables in a location other than the current working directory or the location \n", + " specified by the \"supp_data_dir\" configuration value, you will need to specify it in the call to \n", + " `add_xray_emissivity_field`: \n", + " `xray_fields = yt.add_xray_emissivity_field(ds, 0.5, 7.0, data_dir=\"/path/to/data\", table_type='apec', metallicity=0.3)`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Having made the fields, one can see which fields were made:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print (xray_fields)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The luminosity field is useful for summing up in regions like this:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "sp = ds.sphere(\"c\", (2.0, \"Mpc\"))\n", + "print (sp.quantities.total_quantity(\"xray_luminosity_0.5_7.0_keV\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Whereas the emissivity fields may be useful in derived fields or for plotting:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "scrolled": false + }, + "outputs": [], + "source": [ + "slc = yt.SlicePlot(ds, 'z', ['xray_emissivity_0.5_7.0_keV','xray_photon_emissivity_0.5_7.0_keV'],\n", + " width=(0.75, \"Mpc\"))\n", + "slc.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The emissivity and the luminosity fields take the values one would see in the frame of the source. However, if one wishes to make projections of the X-ray emission from a cosmologically distant object, the energy band will be redshifted. For this case, one can supply a `redshift` parameter and a `Cosmology` object (either from the dataset or one made on your own) to compute X-ray intensity fields along with the emissivity and luminosity fields.\n", + "\n", + "This example shows how to do that, Where we also use a spatially dependent metallicity field and the Cloudy tables instead of the APEC tables we used previously:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "scrolled": false + }, + "outputs": [], + "source": [ + "ds2 = yt.load(\"D9p_500/10MpcBox_HartGal_csf_a0.500.d\")\n", + "\n", + "# In this case, use the redshift and cosmology from the dataset, \n", + "# but in theory you could put in something different\n", + "xray_fields2 = yt.add_xray_emissivity_field(ds2, 0.5, 2.0, redshift=ds2.current_redshift, cosmology=ds2.cosmology,\n", + " metallicity=(\"gas\", \"metallicity\"), table_type='cloudy')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now, one can see that two new fields have been added, corresponding to X-ray intensity / surface brightness when projected:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print (xray_fields2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note also that the energy range now corresponds to the *observer* frame, whereas in the source frame the energy range is between `emin*(1+redshift)` and `emax*(1+redshift)`. Let's zoom in on a galaxy and make a projection of the intensity fields:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "scrolled": false + }, + "outputs": [], + "source": [ + "prj = yt.ProjectionPlot(ds2, \"x\", [\"xray_intensity_0.5_2.0_keV\", \"xray_photon_intensity_0.5_2.0_keV\"],\n", + " center=\"max\", width=(40, \"kpc\"))\n", + "prj.set_zlim(\"xray_intensity_0.5_2.0_keV\", 1.0e-32, 5.0e-24)\n", + "prj.set_zlim(\"xray_photon_intensity_0.5_2.0_keV\", 1.0e-24, 5.0e-16)\n", + "prj.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> Warning: The X-ray fields depend on the number density of hydrogen atoms, given by the yt field\n", + " `H_nuclei_density`. In the case of the APEC model, this assumes that all of the hydrogen in your\n", + " dataset is ionized, whereas in the Cloudy model the ionization level is taken into account. If \n", + " this field is not defined (either in the dataset or by the user), it will be constructed using\n", + " abundance information from your dataset. Finally, if your dataset contains no abundance information,\n", + " a primordial hydrogen mass fraction (X = 0.76) will be assumed." + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [default]", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff -Nru yt-3.3.3/doc/source/analyzing/analysis_modules/xray_emission_fields.rst yt-3.4.0/doc/source/analyzing/analysis_modules/xray_emission_fields.rst --- yt-3.3.3/doc/source/analyzing/analysis_modules/xray_emission_fields.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/analysis_modules/xray_emission_fields.rst 2017-08-10 18:02:57.000000000 +0000 @@ -2,77 +2,5 @@ X-ray Emission Fields ===================== -.. sectionauthor:: Britton Smith , John ZuHone -.. note:: - - If you came here trying to figure out how to create simulated X-ray photons and observations, - you should go `here `_ instead. - -This functionality provides the ability to create metallicity-dependent -X-ray luminosity, emissivity, and photon emissivity fields for a given -photon energy range. This works by interpolating from emission tables -created from the photoionization code `Cloudy `_ or -the collisional ionization database `AtomDB `_. If -you installed yt with the install script, these data files should be located in -the *data* directory inside the installation directory, or can be downloaded -from ``_. Emission fields can be made for any -interval between 0.1 keV and 100 keV. - -Adding Emission Fields ----------------------- - -Fields will be created for luminosity :math:`{\rm (erg~s^{-1})}`, emissivity :math:`{\rm (erg~s^{-1}~cm^{-3})}`, -and photon emissivity :math:`{\rm (photons~s^{-1}~cm^{-3})}`. The only required arguments are the -dataset object, and the minimum and maximum energies of the energy band. - -.. code-block:: python - - import yt - from yt.analysis_modules.spectral_integrator.api import \ - add_xray_emissivity_field - - xray_fields = add_xray_emissivity_field(ds, 0.5, 7.0) - -Additional keyword arguments are: - - * **filename** (*string*): Path to data file containing emissivity values. If None, - a file called "cloudy_emissivity.h5" is used, for photoionized plasmas. A second - option, for collisionally ionized plasmas, is in the file "apec_emissivity.h5", - available at http://yt-project.org/data. These files contain emissivity tables - for primordial elements and for metals at solar metallicity for the energy range - 0.1 to 100 keV. Default: None. - - * **with_metals** (*bool*): If True, use the metallicity field to add the - contribution from metals. If False, only the emission from H/He is - considered. Default: True. - - * **constant_metallicity** (*float*): If specified, assume a constant - metallicity for the emission from metals. The *with_metals* keyword - must be set to False to use this. It should be given in unit of solar metallicity. - Default: None. - -The resulting fields can be used like all normal fields. The function will return the names of -the created fields in a Python list. - -.. code-block:: python - - import yt - from yt.analysis_modules.spectral_integrator.api import \ - add_xray_emissivity_field - - xray_fields = add_xray_emissivity_field(ds, 0.5, 7.0, filename="apec_emissivity.h5") - - ds = yt.load("enzo_tiny_cosmology/DD0046/DD0046") - plot = yt.SlicePlot(ds, 'x', 'xray_luminosity_0.5_7.0_keV') - plot.save() - plot = yt.ProjectionPlot(ds, 'x', 'xray_emissivity_0.5_7.0_keV') - plot.save() - plot = yt.ProjectionPlot(ds, 'x', 'xray_photon_emissivity_0.5_7.0_keV') - plot.save() - -.. warning:: - - The X-ray fields depend on the number density of hydrogen atoms, in the yt field - ``H_number_density``. If this field is not defined (either in the dataset or by the user), - the primordial hydrogen mass fraction (X = 0.76) will be used to construct it. +.. notebook:: XrayEmissionFields.ipynb diff -Nru yt-3.3.3/doc/source/analyzing/fields.rst yt-3.4.0/doc/source/analyzing/fields.rst --- yt-3.3.3/doc/source/analyzing/fields.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/fields.rst 2017-08-10 18:02:57.000000000 +0000 @@ -64,6 +64,24 @@ You can use this to easily explore available fields, particularly through tab-completion in Jupyter/IPython. +It's also possible to iterate over the list of fields associated with each +field type. For example, to print all of the ``'gas'`` fields, one might do: + +.. code-block:: python + + for field in ds.fields.gas: + print(field) + +You can also check if a given field is associated with a field type using +standard python syntax: + +.. code-block:: python + + # these examples evaluate to True for a dataset that has ('gas', 'density') + 'density' in ds.fields.gas + ('gas', 'density') in ds.fields.gas + ds.fields.gas.density in ds.fields.gas + For a more programmatic method of accessing fields, you can utilize the ``ds.field_list``, ``ds.derived_field_list`` and some accessor methods to gain information about fields. The full list of fields available for a dataset can @@ -448,7 +466,7 @@ * ``mass`` - this field takes the total sum of ``particle_mass`` in each mesh zone. * ``cic`` - this field performs cloud-in-cell interpolation (see `Section 2.2 - `_ for more + `_ for more information) of the density of particles in a given mesh zone. * ``smoothed`` - this is a special deposition type. See discussion below for more information, in :ref:`sph-fields`. diff -Nru yt-3.3.3/doc/source/analyzing/generating_processed_data.rst yt-3.4.0/doc/source/analyzing/generating_processed_data.rst --- yt-3.3.3/doc/source/analyzing/generating_processed_data.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/generating_processed_data.rst 2017-08-10 18:02:57.000000000 +0000 @@ -26,13 +26,16 @@ sizes into a fixed-size array that appears like an image. This process is that of pixelization, which yt handles transparently internally. You can access this functionality by constructing a -:class:`~yt.visualization.fixed_resolution.FixedResolutionBuffer` (or -:class:`~yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer`) and -supplying to it your :class:`~yt.data_objects.data_containers.YTSelectionContainer2D` +:class:`~yt.visualization.fixed_resolution.FixedResolutionBuffer` and supplying +to it your :class:`~yt.data_objects.data_containers.YTSelectionContainer2D` object, as well as some information about how you want the final image to look. You can specify both the bounds of the image (in the appropriate x-y plane) and -the resolution of the output image. You can then have yt pixelize any -field you like. +the resolution of the output image. You can then have yt pixelize any field +you like. + +.. note:: In previous versions of yt, there was a special class of + FixedResolutionBuffer for off-axis slices. This is no longer + necessary. To create :class:`~yt.data_objects.data_containers.YTSelectionContainer2D` objects, you can access them as described in :ref:`data-objects`, specifically the section @@ -90,10 +93,10 @@ Profile objects can be created from any data object (see :ref:`data-objects`, specifically the section :ref:`available-objects` for more information) and are -best thought of as distribution calculations. They can either sum up or -average one quantity with respect to one or more other quantities, and they do -this over all the data contained in their source object. When calculating average -values, the variance will also be calculated. +best thought of as distribution calculations. They can either sum up or average +one quantity with respect to one or more other quantities, and they do this over +all the data contained in their source object. When calculating average values, +the standard deviation will also be calculated. To generate a profile, one need only specify the binning fields and the field to be profiled. The binning fields are given together in a list. The @@ -107,11 +110,10 @@ import yt ds = yt.load("galaxy0030/galaxy0030") source = ds.sphere( "c", (10, "kpc")) - profile = yt.create_profile(source, - [("gas", "density")], # the bin field - [("gas", "temperature"), # profile field - ("gas", "radial_velocity")], # profile field - weight_field=("gas", "cell_mass")) + profile = source.profile([("gas", "density")], # the bin field + [("gas", "temperature"), # profile field + ("gas", "radial_velocity")], # profile field + weight_field=("gas", "cell_mass")) The binning, weight, and profile data can now be access as: @@ -129,24 +131,24 @@ print(profile.used) -If a weight field was given, the profile data will represent the weighted mean of -a field. In this case, the weighted variance will be calculated automatically and -can be access via the ``profile.variance`` attribute. +If a weight field was given, the profile data will represent the weighted mean +of a field. In this case, the weighted standard deviation will be calculated +automatically and can be access via the ``profile.standard_deviation`` +attribute. .. code-block:: python - print(profile.variance["gas", "temperature"]) + print(profile.standard_deviation["gas", "temperature"]) -A two-dimensional profile of the total gas mass in bins of density and temperature -can be created as follows: +A two-dimensional profile of the total gas mass in bins of density and +temperature can be created as follows: .. code-block:: python - profile2d = yt.create_profile(source, - [("gas", "density"), # the x bin field - ("gas", "temperature")], # the y bin field - [("gas", "cell_mass")], # the profile field - weight_field=None) + profile2d = source.profile([("gas", "density"), # the x bin field + ("gas", "temperature")], # the y bin field + [("gas", "cell_mass")], # the profile field + weight_field=None) Accessing the x, y, and profile fields work just as with one-dimensional profiles: @@ -161,7 +163,10 @@ phase plot that shows the distribution of mass in the density-temperature plane, with the average temperature overplotted. The :func:`~matplotlib.pyplot.pcolormesh` function can be used to manually plot -the 2D profile. +the 2D profile. If you want to generate a default profile plot, you can simply +call::: + + profile.plot() Three-dimensional profiles can be generated and accessed following the same procedures. Additional keyword arguments are available to control diff -Nru yt-3.3.3/doc/source/analyzing/index.rst yt-3.4.0/doc/source/analyzing/index.rst --- yt-3.3.3/doc/source/analyzing/index.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/index.rst 2017-08-10 18:02:57.000000000 +0000 @@ -22,4 +22,5 @@ generating_processed_data saving_data time_series_analysis + particle_trajectories parallel_computation diff -Nru yt-3.3.3/doc/source/analyzing/objects.rst yt-3.4.0/doc/source/analyzing/objects.rst --- yt-3.3.3/doc/source/analyzing/objects.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/objects.rst 2017-08-10 18:02:57.000000000 +0000 @@ -64,6 +64,18 @@ print("(%f, %f, %f) %f" % (sp["x"][i], sp["y"][i], sp["z"][i], sp["temperature"][i])) +Data objects can also be cloned; for instance: + +.. code-block:: python + + import yt + ds = yt.load("RedshiftOutput0005") + sp = ds.sphere([0.5, 0.5, 0.5], (1, 'kpc')) + sp_copy = sp.clone() + +This can be useful for when manually chunking data or exploring different field +parameters. + .. _quickly-selecting-data: Slicing Syntax for Selecting Data @@ -185,6 +197,70 @@ (900.1, 'm')] sl.plot() + +Making Image Buffers +^^^^^^^^^^^^^^^^^^^^ + +Using the slicing syntax above for choosing a slice, if you also provide an +imaginary step value you can obtain a +:class:`~yt.visualization.api.FixedResolutionBuffer` of the chosen resolution. + +For instance, to obtain a 1024 by 1024 buffer covering the entire +domain but centered at 0.5 in code units, you can do::: + + frb = ds.r[0.5, ::1024j, ::1024j] + +This `frb` object then can be queried like a normal fixed resolution buffer, +and it will return arrays of shape (1024, 1024). + +Making Rays +^^^^^^^^^^^ + +The slicing syntax can also be used select 1D rays of points, whether along +an axis or off-axis. To create a ray along an axis::: + + ortho_ray = ds.r[(500.0, "kpc"), (200, "kpc"):(300.0, "kpc"), (-2.0, "Mpc")] + +To create a ray off-axis, use a single slice between the start and end points +of the ray::: + + start = [0.1, 0.2, 0.3] # interpreted in code_length + end = [0.4, 0.5, 0.6] # interpreted in code_length + ray = ds.r[start:end] + +As for the other slicing options, combinations of unitful quantities with even +different units can be used. Here's a somewhat convoluted (yet working) example::: + + start = ((500.0, "kpc"), (0.2, "Mpc"), (100.0, "kpc")) + end = ((1.0, "Mpc"), (300.0, "kpc"), (0.0, "kpc")) + ray = ds.r[start:end] + +Making Fixed-Resolution Rays +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Rays can also be constructed to have fixed resolution if an imaginary step value +is provided, similar to the 2 and 3-dimensional cases described above. This +works for rays directed along an axis::: + + ortho_ray = ds.r[(0.1:0.6:500j,0.3,0.2] + +or off-axis rays as well::: + + start = [0.1, 0.2, 0.3] # interpreted in code_length + end = [0.4, 0.5, 0.6] # interpreted in code_length + ray = ds.r[start:end:100j] + +Selecting Points +^^^^^^^^^^^^^^^^ + +Finally, you can quickly select a single point within the domain by providing +a single coordinate for every axis::: + + pt = ds.r[(10.0, 'km'), (200, 'm'), (1.0,'km')] + +Querying this object for fields will give you the value of the field at that +point. + .. _available-objects: Available Objects @@ -312,9 +388,12 @@ | easily lead to empty data for non-intersecting regions. | Usage: ``slice(axis, coord, ds, data_source=sph)`` -**Boolean Regions** - | **Note: not yet implemented in yt 3.0** - | Usage: ``boolean()`` +**Union Regions** + | Usage: ``union()`` + | See :ref:`boolean_data_objects`. + +**Intersection Regions** + | Usage: ``intersection()`` | See :ref:`boolean_data_objects`. **Filter** @@ -614,37 +693,48 @@ Combining Objects: Boolean Data Objects --------------------------------------- -.. note:: Boolean Data Objects have not yet been ported to yt 3.0 from - yt 2.x. If you are interested in aiding in this port, please contact - the yt-dev mailing list. Until it is ported, this functionality below - will not work. - -A special type of data object is the *boolean* data object. -It works only on three-dimensional objects. -It is built by relating already existing data objects with boolean operators. -The boolean logic may be nested using parentheses, and -it supports the standard "AND", "OR", and "NOT" operators: - -* **"AND"** When two data objects are related with an "AND", the combined - data object is the volume of the simulation covered by both objects, and - not by just a single object. -* **"OR"** When two data objects are related with an "OR", the combined - data object is the volume(s) of the simulation covered by either of the - objects. - For example, this may be used to combine disjoint objects into one. -* **"NOT"** When two data objects are related with a "NOT", the combined - data object is the volume of the first object that the second does not - cover. - For example, this may be used to cut out part(s) of the first data object - utilizing the second data object. -* **"(" or ")"** Nested logic is surrounded by parentheses. The order of - operations is such that the boolean logic is evaluated inside the - inner-most parentheses, first, then goes upwards. - The logic is read left-to-right at all levels (crucial for the "NOT" - operator). +A special type of data object is the *boolean* data object, which works with +data selection objects of any dimension. It is built by relating already existing +data objects with the bitwise operators for AND, OR and XOR, as well as the +subtraction operator. These are created by using the operators ``&`` for an +intersection ("AND"), ``|`` for a union ("OR"), ``^`` for an exclusive or +("XOR"), and ``+`` and ``-`` for addition ("OR") and subtraction ("NEG"). +Here are some examples: + +.. code-block:: python + + import yt + ds = yt.load("snapshot_010.hdf5") + + sp1 = ds.sphere("c", (0.1, "unitary")) + sp2 = ds.sphere(sp1.center + 2.0 * sp1.radius, (0.2, "unitary")) + sp3 = ds.sphere("c", (0.05, "unitary")) + + new_obj = sp1 + sp2 + cutout = sp1 - sp3 + sp4 = sp1 ^ sp2 + sp5 = sp1 & sp2 + + +Note that the ``+`` operation and the ``|`` operation are identical. For when +multiple objects are to be combined in an intersection or a union, there are +the data objects ``intersection`` and ``union`` which can be called, and which +will yield slightly higher performance than a sequence of calls to ``+`` or +``&``. For instance: + +.. code-block:: python + + import yt + ds = yt.load("Enzo_64/DD0043/data0043") + sp1 = ds.sphere( (0.1, 0.2, 0.3), (0.05, "unitary")) + sp2 = ds.sphere( (0.2, 0.2, 0.3), (0.10, "unitary")) + sp3 = ds.sphere( (0.3, 0.2, 0.3), (0.15, "unitary")) + + isp = ds.intersection( [sp1, sp2, sp3] ) + usp = ds.union( [sp1, sp2, sp3] ) -Please see the :ref:`cookbook` for some examples of how to use the boolean -data object. +The ``isp`` and ``usp`` objects will act the same as a set of chained ``&`` and +``|`` operations (respectively) but are somewhat easier to construct. .. _extracting-connected-sets: diff -Nru yt-3.3.3/doc/source/analyzing/Particle_Trajectories.ipynb yt-3.4.0/doc/source/analyzing/Particle_Trajectories.ipynb --- yt-3.3.3/doc/source/analyzing/Particle_Trajectories.ipynb 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/Particle_Trajectories.ipynb 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,390 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "One can create particle trajectories from a `DatasetSeries` object for a specified list of particles identified by their unique indices using the `particle_trajectories` method. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline\n", + "import yt\n", + "import glob\n", + "from yt.config import ytcfg\n", + "path = ytcfg.get(\"yt\", \"test_data_dir\")\n", + "import matplotlib.pyplot as plt\n", + "from mpl_toolkits.mplot3d import Axes3D" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "First, let's start off with a FLASH dataset containing only two particles in a mutual circular orbit. We can get the list of filenames this way:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "my_fns = glob.glob(path+\"/Orbit/orbit_hdf5_chk_00[0-9][0-9]\")\n", + "my_fns.sort()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And let's define a list of fields that we want to include in the trajectories. The position fields will be included by default, so let's just ask for the velocity fields:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fields = [\"particle_velocity_x\", \"particle_velocity_y\", \"particle_velocity_z\"]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "There are only two particles, but for consistency's sake let's grab their indices from the dataset itself:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ds = yt.load(my_fns[0])\n", + "dd = ds.all_data()\n", + "indices = dd[\"particle_index\"].astype(\"int\")\n", + "print (indices)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which is what we expected them to be. Now we're ready to create a `DatasetSeries` object and use it to create particle trajectories: " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ts = yt.DatasetSeries(my_fns)\n", + "# suppress_logging=True cuts down on a lot of noise\n", + "trajs = ts.particle_trajectories(indices, fields=fields, suppress_logging=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The `ParticleTrajectories` object `trajs` is essentially a dictionary-like container for the particle fields along the trajectory, and can be accessed as such:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print (trajs[\"particle_position_x\"])\n", + "print (trajs[\"particle_position_x\"].shape)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that each field is a 2D NumPy array with the different particle indices along the first dimension and the times along the second dimension. As such, we can access them individually by indexing the field:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure(figsize=(6, 6))\n", + "plt.plot(trajs[\"particle_position_x\"][0], trajs[\"particle_position_y\"][0])\n", + "plt.plot(trajs[\"particle_position_x\"][1], trajs[\"particle_position_y\"][1])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And we can plot the velocity fields as well:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure(figsize=(6, 6))\n", + "plt.plot(trajs[\"particle_velocity_x\"][0], trajs[\"particle_velocity_y\"][0])\n", + "plt.plot(trajs[\"particle_velocity_x\"][1], trajs[\"particle_velocity_y\"][1])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If we want to access the time along the trajectory, we use the key `\"particle_time\"`:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure(figsize=(6, 6))\n", + "plt.plot(trajs[\"particle_time\"], trajs[\"particle_velocity_x\"][1])\n", + "plt.plot(trajs[\"particle_time\"], trajs[\"particle_velocity_y\"][1])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Alternatively, if we know the particle index we'd like to examine, we can get an individual trajectory corresponding to that index:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "particle1 = trajs.trajectory_from_index(1)\n", + "plt.figure(figsize=(6, 6))\n", + "plt.plot(particle1[\"particle_time\"], particle1[\"particle_position_x\"])\n", + "plt.plot(particle1[\"particle_time\"], particle1[\"particle_position_y\"])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now let's look at a more complicated (and fun!) example. We'll use an Enzo cosmology dataset. First, we'll find the maximum density in the domain, and obtain the indices of the particles within some radius of the center. First, let's have a look at what we're getting:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ds = yt.load(\"enzo_tiny_cosmology/DD0046/DD0046\")\n", + "slc = yt.SlicePlot(ds, \"x\", [\"density\",\"dark_matter_density\"], center=\"max\", width=(3.0, \"Mpc\"))\n", + "slc.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "So far, so good--it looks like we've centered on a galaxy cluster. Let's grab all of the dark matter particles within a sphere of 0.5 Mpc (identified by `\"particle_type == 1\"`):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "sp = ds.sphere(\"max\", (0.5, \"Mpc\"))\n", + "indices = sp[\"particle_index\"][sp[\"particle_type\"] == 1]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next we'll get the list of datasets we want, and create trajectories for these particles:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "my_fns = glob.glob(path+\"/enzo_tiny_cosmology/DD*/*.hierarchy\")\n", + "my_fns.sort()\n", + "ts = yt.DatasetSeries(my_fns)\n", + "trajs = ts.particle_trajectories(indices, fields=fields, suppress_logging=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Matplotlib can make 3D plots, so let's pick three particle trajectories at random and look at them in the volume:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(8.0, 8.0))\n", + "ax = fig.add_subplot(111, projection='3d')\n", + "ax.plot(trajs[\"particle_position_x\"][100], trajs[\"particle_position_y\"][100], trajs[\"particle_position_z\"][100])\n", + "ax.plot(trajs[\"particle_position_x\"][8], trajs[\"particle_position_y\"][8], trajs[\"particle_position_z\"][8])\n", + "ax.plot(trajs[\"particle_position_x\"][25], trajs[\"particle_position_y\"][25], trajs[\"particle_position_z\"][25])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It looks like these three different particles fell into the cluster along different filaments. We can also look at their x-positions only as a function of time:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure(figsize=(6,6))\n", + "plt.plot(trajs[\"particle_time\"], trajs[\"particle_position_x\"][100])\n", + "plt.plot(trajs[\"particle_time\"], trajs[\"particle_position_x\"][8])\n", + "plt.plot(trajs[\"particle_time\"], trajs[\"particle_position_x\"][25])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Suppose we wanted to know the gas density along the particle trajectory, but there wasn't a particle field corresponding to that in our dataset. Never fear! If the field exists as a grid field, yt will interpolate this field to the particle positions and add the interpolated field to the trajectory. To add such a field (or any field, including additional particle fields) we can call the `add_fields` method:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "trajs.add_fields([\"density\"])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We also could have included `\"density\"` in our original field list. Now, plot up the gas density for each particle as a function of time:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure(figsize=(6,6))\n", + "plt.plot(trajs[\"particle_time\"], trajs[\"density\"][100])\n", + "plt.plot(trajs[\"particle_time\"], trajs[\"density\"][8])\n", + "plt.plot(trajs[\"particle_time\"], trajs[\"density\"][25])\n", + "plt.yscale(\"log\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, the particle trajectories can be written to disk. Two options are provided: ASCII text files with a column for each field and the time, and HDF5 files:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "trajs.write_out(\"halo_trajectories\") # This will write a separate file for each trajectory\n", + "trajs.write_out_h5(\"halo_trajectories.h5\") # This will write all trajectories to a single file" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [default]", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff -Nru yt-3.3.3/doc/source/analyzing/particle_trajectories.rst yt-3.4.0/doc/source/analyzing/particle_trajectories.rst --- yt-3.3.3/doc/source/analyzing/particle_trajectories.rst 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/particle_trajectories.rst 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,6 @@ +.. _particle-trajectories: + +Particle Trajectories +--------------------- + +.. notebook:: Particle_Trajectories.ipynb diff -Nru yt-3.3.3/doc/source/analyzing/units/2)_Fields_and_unit_conversion.ipynb yt-3.4.0/doc/source/analyzing/units/2)_Fields_and_unit_conversion.ipynb --- yt-3.3.3/doc/source/analyzing/units/2)_Fields_and_unit_conversion.ipynb 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/units/2)_Fields_and_unit_conversion.ipynb 2017-08-10 18:02:57.000000000 +0000 @@ -161,7 +161,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "`in_base` can even take a dataset as the argument to convert the `YTArray` into the base units of the dataset:" + "`in_base` also takes the `\"code\"` argument to convert the `YTArray` into the base units of the dataset:" ] }, { @@ -170,7 +170,7 @@ "metadata": {}, "outputs": [], "source": [ - "print (dd['pressure'].in_base(ds)) # The IsolatedGalaxy dataset from above" + "print (dd['pressure'].in_base(\"code\")) # The IsolatedGalaxy dataset from above" ] }, { @@ -557,6 +557,100 @@ "print (temp, type(temp))\n", "print (ptemp, type(ptemp))" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Defining New Units" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "yt also provides a way to define your own units. Suppose you wanted to define a new unit for \"miles per hour\", the familiar \"mph\", which is not already in yt. One can do this by calling `yt.define_unit()`:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "yt.define_unit(\"mph\", (1.0, \"mile/hr\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Once this unit is defined, it can be used in the same way as any other unit:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from yt.units import clight\n", + "print (clight.to('mph'))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If you want to define a new unit which is prefixable (like SI units), you can set `prefixable=True` when defining the unit:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from yt import YTQuantity\n", + "yt.define_unit(\"L\", (1000.0, \"cm**3\"), prefixable=True)\n", + "print (YTQuantity(1.0, \"mL\").to(\"cm**3\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "`yt.define_unit()` defines new units for all yt operations. However, new units can be defined for particular datasets only as well using `ds.define_unit()`, which has the same signature:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ds.define_unit(\"M_star\", (2.0e13, \"Msun\"))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "dd = ds.all_data()\n", + "print(dd.quantities.total_mass().to(\"M_star\"))" + ] } ], "metadata": { @@ -580,4 +674,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff -Nru yt-3.3.3/doc/source/analyzing/units/3)_Comoving_units_and_code_units.ipynb yt-3.4.0/doc/source/analyzing/units/3)_Comoving_units_and_code_units.ipynb --- yt-3.3.3/doc/source/analyzing/units/3)_Comoving_units_and_code_units.ipynb 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/units/3)_Comoving_units_and_code_units.ipynb 2017-08-10 18:02:57.000000000 +0000 @@ -171,7 +171,7 @@ "\n", "As an aside, Darren Croton's [research note](http://arxiv.org/abs/1308.4150) on the history, use, and interpretation of $h$ as it appears in the astronomical literature is pretty much required reading for anyone who has to deal with factors of $h$ every now and then.\n", "\n", - "In yt, comoving length unit symbols are named following the pattern “(length symbol)cm”, i.e. `pccm` for comoving parsec or `mcm` for a comoving meter. A comoving length unit is different from the normal length unit by a factor of $(1+z)$:" + "In yt, comoving length unit symbols are named following the pattern `(length symbol)cm`, i.e. `pccm` for comoving parsec or `mcm` for a comoving meter. A comoving length unit is different from the normal length unit by a factor of $(1+z)$:" ] }, { diff -Nru yt-3.3.3/doc/source/analyzing/units/index.rst yt-3.4.0/doc/source/analyzing/units/index.rst --- yt-3.3.3/doc/source/analyzing/units/index.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/analyzing/units/index.rst 2017-08-10 17:56:56.000000000 +0000 @@ -12,8 +12,8 @@ and execute the documentation interactively, you need to download the repository and start the IPython notebook. -You will then need to navigate to :code:`$YT_HG/doc/source/units` (where $YT_HG -is the location of a clone of the yt mercurial repository), and then start an +You will then need to navigate to :code:`$YT_GIT/doc/source/units` (where $YT_GIT +is the location of a clone of the yt git repository), and then start an IPython notebook server: .. code:: bash diff -Nru yt-3.3.3/doc/source/conf.py yt-3.4.0/doc/source/conf.py --- yt-3.3.3/doc/source/conf.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/conf.py 2017-08-10 18:19:54.000000000 +0000 @@ -11,9 +11,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os, glob, re -from sphinx.search import WordCollector -from docutils.nodes import comment, title, Text, SkipNode +import sys +import os +import glob on_rtd = os.environ.get("READTHEDOCS", None) == "True" @@ -30,8 +30,9 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', - 'sphinx.ext.pngmath', 'sphinx.ext.viewcode', - 'sphinx.ext.napoleon', 'yt_cookbook', 'yt_colormaps'] + 'sphinx.ext.mathjax', 'sphinx.ext.viewcode', + 'sphinx.ext.napoleon', 'yt_cookbook', 'yt_colormaps', + 'config_help', 'yt_showfields'] if not on_rtd: extensions.append('sphinx.ext.autosummary') @@ -60,16 +61,16 @@ # General information about the project. project = u'The yt Project' -copyright = u'2013-2016, the yt Project' +copyright = u'2013-2017, the yt Project' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '3.3.3' +version = '3.4.0' # The full version, including alpha/beta/rc tags. -release = '3.3.3' +release = '3.4.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -227,13 +228,6 @@ # If true, show URL addresses after external links. #latex_show_urls = False -# Additional stuff for the LaTeX preamble. -latex_preamble = r""" -\renewcommand{\AA}{\text{\r{A}}} % Allow \AA in math mode -\usepackage[utf8]{inputenc} % Allow unicode symbols in text -\DeclareUnicodeCharacter {212B} {\AA} % Angstrom -""" - # Documents to append as an appendix to all manuals. #latex_appendices = [] @@ -255,7 +249,7 @@ intersphinx_mapping = {'http://docs.python.org/': None, 'http://ipython.org/ipython-doc/stable/': None, 'http://docs.scipy.org/doc/numpy/': None, - 'http://matplotlib.sourceforge.net/': None, + 'http://matplotlib.org/': None, } if not on_rtd: diff -Nru yt-3.3.3/doc/source/cookbook/amrkdtree_downsampling.py yt-3.4.0/doc/source/cookbook/amrkdtree_downsampling.py --- yt-3.3.3/doc/source/cookbook/amrkdtree_downsampling.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/amrkdtree_downsampling.py 2017-08-10 18:02:57.000000000 +0000 @@ -21,7 +21,7 @@ ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030') im, sc = yt.volume_render(ds, 'density', fname='v0.png') sc.camera.set_width(ds.arr(100, 'kpc')) -render_source = sc.get_source(0) +render_source = sc.get_source() kd=render_source.volume # Print out specifics of KD Tree diff -Nru yt-3.3.3/doc/source/cookbook/complex_plots.rst yt-3.4.0/doc/source/cookbook/complex_plots.rst --- yt-3.3.3/doc/source/cookbook/complex_plots.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/complex_plots.rst 2017-08-10 18:02:57.000000000 +0000 @@ -71,6 +71,13 @@ .. yt_cookbook:: multi_plot_3x2_FRB.py +Time Series Movie +~~~~~~~~~~~~~~~~~ + +This shows how to use matplotlib's animation framework with yt plots. + +.. yt_cookbook:: matplotlib-animation.py + .. _cookbook-offaxis_projection: Off-Axis Projection (an alternate method) @@ -268,6 +275,14 @@ .. yt_cookbook:: opaque_rendering.py +Volume Rendering Multiple Fields +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can render multiple fields by adding new ``VolumeSource`` objects to the +scene for each field you want to render. + +.. yt_cookbook:: render_two_fields.py + .. _cookbook-amrkdtree_downsampling: Downsampling Data for Volume Rendering diff -Nru yt-3.3.3/doc/source/cookbook/custom_transfer_function_volume_rendering.py yt-3.4.0/doc/source/cookbook/custom_transfer_function_volume_rendering.py --- yt-3.3.3/doc/source/cookbook/custom_transfer_function_volume_rendering.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/custom_transfer_function_volume_rendering.py 2017-08-10 18:02:57.000000000 +0000 @@ -10,7 +10,7 @@ # Modify the transfer function # First get the render source, in this case the entire domain, with field ('gas','density') -render_source = sc.get_source(0) +render_source = sc.get_source() # Clear the transfer function render_source.transfer_function.clear() diff -Nru yt-3.3.3/doc/source/cookbook/find_clumps.py yt-3.4.0/doc/source/cookbook/find_clumps.py --- yt-3.3.3/doc/source/cookbook/find_clumps.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/find_clumps.py 2017-08-10 18:02:57.000000000 +0000 @@ -27,14 +27,14 @@ # As many validators can be added as you want. master_clump.add_validator("min_cells", 20) +# Calculate center of mass for all clumps. +master_clump.add_info_item("center_of_mass") + # Begin clump finding. find_clumps(master_clump, c_min, c_max, step) -# Write out the full clump hierarchy. -write_clump_index(master_clump, 0, "%s_clump_hierarchy.txt" % ds) - -# Write out only the leaf nodes of the hierarchy. -write_clumps(master_clump,0, "%s_clumps.txt" % ds) +# Save the clump tree as a reloadable dataset +fn = master_clump.save_as_dataset(fields=["density", "particle_mass"]) # We can traverse the clump hierarchy to get a list of all of the 'leaf' clumps leaf_clumps = get_lowest_clumps(master_clump) @@ -46,5 +46,17 @@ # Next we annotate the plot with contours on the borders of the clumps prj.annotate_clumps(leaf_clumps) -# Lastly, we write the plot to disk. +# Save the plot to disk. prj.save('clumps') + +# Reload the clump dataset. +cds = yt.load(fn) + +# Query fields for clumps in the tree. +print (cds.tree["clump", "center_of_mass"]) +print (cds.tree.children[0]["grid", "density"]) +print (cds.tree.children[1]["all", "particle_mass"]) + +# Get all of the leaf clumps. +print (cds.leaves) +print (cds.leaves[0]["clump", "cell_mass"]) diff -Nru yt-3.3.3/doc/source/cookbook/matplotlib-animation.py yt-3.4.0/doc/source/cookbook/matplotlib-animation.py --- yt-3.3.3/doc/source/cookbook/matplotlib-animation.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/matplotlib-animation.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,22 @@ +import yt +from matplotlib.animation import FuncAnimation +from matplotlib import rc_context + +ts = yt.load('GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_*') + +plot = yt.SlicePlot(ts[0], 'z', 'density') +plot.set_zlim('density', 8e-29, 3e-26) + +fig = plot.plots['density'].figure + +# animate must accept an integer frame number. We use the frame number +# to identify which dataset in the time series we want to load +def animate(i): + ds = ts[i] + plot._switch_ds(ds) + +animation = FuncAnimation(fig, animate, frames=len(ts)) + +# Override matplotlib's defaults to get a nicer looking font +with rc_context({'mathtext.fontset': 'stix'}): + animation.save('animation.mp4') diff -Nru yt-3.3.3/doc/source/cookbook/opaque_rendering.py yt-3.4.0/doc/source/cookbook/opaque_rendering.py --- yt-3.3.3/doc/source/cookbook/opaque_rendering.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/opaque_rendering.py 2017-08-10 18:02:57.000000000 +0000 @@ -8,7 +8,7 @@ im, sc = yt.volume_render(ds, field=("gas","density"), fname="v0.png", sigma_clip=6.0) sc.camera.set_width(ds.arr(0.1,'code_length')) -tf = sc.get_source(0).transfer_function +tf = sc.get_source().transfer_function tf.clear() tf.add_layers(4, 0.01, col_bounds = [-27.5,-25.5], alpha=np.logspace(-3,0,4), colormap = 'RdBu_r') @@ -19,7 +19,7 @@ # accentuate the outer regions of the galaxy. Let's start by bringing up the # alpha values for each contour to go between 0.1 and 1.0 -tf = sc.get_source(0).transfer_function +tf = sc.get_source().transfer_function tf.clear() tf.add_layers(4, 0.01, col_bounds = [-27.5,-25.5], alpha=np.logspace(0,0,4), colormap = 'RdBu_r') diff -Nru yt-3.3.3/doc/source/cookbook/power_spectrum_example.py yt-3.4.0/doc/source/cookbook/power_spectrum_example.py --- yt-3.3.3/doc/source/cookbook/power_spectrum_example.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/power_spectrum_example.py 2017-08-10 18:02:57.000000000 +0000 @@ -40,7 +40,7 @@ nindex_rho = 1./3. - Kk = np.zeros( (nx/2+1, ny/2+1, nz/2+1)) + Kk = np.zeros( (nx//2+1, ny//2+1, nz//2+1)) for vel in [("gas", "velocity_x"), ("gas", "velocity_y"), ("gas", "velocity_z")]: @@ -106,7 +106,7 @@ # the first half of the axes -- that's what we keep. Our # normalization has an '8' to account for this clipping to one # octant. - ru = np.fft.fftn(rho**nindex_rho * u)[0:nx/2+1,0:ny/2+1,0:nz/2+1] + ru = np.fft.fftn(rho**nindex_rho * u)[0:nx//2+1,0:ny//2+1,0:nz//2+1] ru = 8.0*ru/(nx*ny*nz) return np.abs(ru)**2 diff -Nru yt-3.3.3/doc/source/cookbook/profile_with_standard_deviation.py yt-3.4.0/doc/source/cookbook/profile_with_standard_deviation.py --- yt-3.3.3/doc/source/cookbook/profile_with_standard_deviation.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/profile_with_standard_deviation.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,34 @@ +import matplotlib.pyplot as plt +import yt + +# Load the dataset. +ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") + +# Create a sphere of radius 1 Mpc centered on the max density location. +sp = ds.sphere("max", (1, "Mpc")) + +# Calculate and store the bulk velocity for the sphere. +bulk_velocity = sp.quantities.bulk_velocity() +sp.set_field_parameter('bulk_velocity', bulk_velocity) + +# Create a 1D profile object for profiles over radius +# and add a velocity profile. +prof = yt.create_profile(sp, 'radius', ('gas', 'velocity_magnitude'), + units = {'radius': 'kpc'}, + extrema = {'radius': ((0.1, 'kpc'), (1000.0, 'kpc'))}, + weight_field='cell_mass') + +# Create arrays to plot. +radius = prof.x +mean = prof['gas', 'velocity_magnitude'] +std = prof.standard_deviation['gas', 'velocity_magnitude'] + +# Plot the average velocity magnitude. +plt.loglog(radius, mean, label='Mean') +# Plot the variance of the velocity magnitude. +plt.loglog(radius, std, label='Standard Deviation') +plt.xlabel('r [kpc]') +plt.ylabel('v [cm/s]') +plt.legend() + +plt.savefig('velocity_profiles.png') diff -Nru yt-3.3.3/doc/source/cookbook/profile_with_variance.py yt-3.4.0/doc/source/cookbook/profile_with_variance.py --- yt-3.3.3/doc/source/cookbook/profile_with_variance.py 2016-10-25 16:08:30.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/profile_with_variance.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -import matplotlib.pyplot as plt -import yt - -# Load the dataset. -ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") - -# Create a sphere of radius 1 Mpc centered on the max density location. -sp = ds.sphere("max", (1, "Mpc")) - -# Calculate and store the bulk velocity for the sphere. -bulk_velocity = sp.quantities.bulk_velocity() -sp.set_field_parameter('bulk_velocity', bulk_velocity) - -# Create a 1D profile object for profiles over radius -# and add a velocity profile. -prof = yt.create_profile(sp, 'radius', ('gas', 'velocity_magnitude'), - units = {'radius': 'kpc'}, - extrema = {'radius': ((0.1, 'kpc'), (1000.0, 'kpc'))}, - weight_field='cell_mass') - -# Create arrays to plot. -radius = prof.x.value -mean = prof['gas', 'velocity_magnitude'].value -variance = prof.variance['gas', 'velocity_magnitude'].value - -# Plot the average velocity magnitude. -plt.loglog(radius, mean, label='Mean') -# Plot the variance of the velocity magnitude. -plt.loglog(radius, variance, label='Standard Deviation') -plt.xlabel('r [kpc]') -plt.ylabel('v [cm/s]') -plt.legend() - -plt.savefig('velocity_profiles.png') diff -Nru yt-3.3.3/doc/source/cookbook/render_two_fields.py yt-3.4.0/doc/source/cookbook/render_two_fields.py --- yt-3.3.3/doc/source/cookbook/render_two_fields.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/render_two_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,27 @@ +import yt +from yt.visualization.volume_rendering.api import Scene, VolumeSource + +filePath = "Sedov_3d/sedov_hdf5_chk_0003" +ds = yt.load(filePath) +ds.periodicity = (True, True, True) + +sc = Scene() + +# set up camera +cam = sc.add_camera(ds, lens_type='perspective') +cam.resolution = [400, 400] + +cam.position = ds.arr([1, 1, 1], 'cm') +cam.switch_orientation() + +# add rendering of density field +dens = VolumeSource(ds, field='dens') +dens.use_ghost_zones = True +sc.add_source(dens) +sc.save('density.png', sigma_clip=6) + +# add rendering of x-velocity field +vel = VolumeSource(ds, field='velx') +vel.use_ghost_zones = True +sc.add_source(vel) +sc.save('density_any_velocity.png', sigma_clip=6) diff -Nru yt-3.3.3/doc/source/cookbook/simple_1d_line_plot.py yt-3.4.0/doc/source/cookbook/simple_1d_line_plot.py --- yt-3.3.3/doc/source/cookbook/simple_1d_line_plot.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/simple_1d_line_plot.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,14 @@ +import yt + +# Load the dataset +ds = yt.load("SecondOrderTris/RZ_p_no_parts_do_nothing_bcs_cone_out.e", step=-1) + +# Create a line plot of the variables 'u' and 'v' with 1000 sampling points evenly spaced +# between the coordinates (0, 0, 0) and (0, 1, 0) +plot = yt.LinePlot(ds, [('all', 'v'), ('all', 'u')], (0, 0, 0), (0, 1, 0), 1000) + +# Add a legend +plot.annotate_legend(('all', 'v')) + +# Save the line plot +plot.save() diff -Nru yt-3.3.3/doc/source/cookbook/simple_plots.rst yt-3.4.0/doc/source/cookbook/simple_plots.rst --- yt-3.3.3/doc/source/cookbook/simple_plots.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/simple_plots.rst 2017-08-10 18:02:57.000000000 +0000 @@ -43,6 +43,14 @@ .. yt_cookbook:: simple_phase.py +Simple 1D Line Plotting +~~~~~~~~~~~~~~~~~~~~~~~ + +This script shows how to make a ``LinePlot`` through a dataset. +See :ref:`how-to-1d-line-plot` for more information. + +.. yt_cookbook:: simple_1d_line_plot.py + Simple Probability Distribution Functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -80,17 +88,17 @@ .. yt_cookbook:: time_series_profiles.py -.. _cookbook-profile-variance: +.. _cookbook-profile-stddev: -Profiles with Variance Values -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Profiles with Standard Deviation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This shows how to plot the variance for a 1D profile. In this example, we -manually create a 1D profile object, which gives us access to the variance -data. -See :ref:`how-to-make-1d-profiles` for more information. +This shows how to plot a 1D profile with error bars indicating the standard +deviation of the field values in each profile bin. In this example, we manually +create a 1D profile object, which gives us access to the standard deviation +data. See :ref:`how-to-make-1d-profiles` for more information. -.. yt_cookbook:: profile_with_variance.py +.. yt_cookbook:: profile_with_standard_deviation.py Making Plots of Multiple Fields Simultaneously ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff -Nru yt-3.3.3/doc/source/cookbook/tests/test_cookbook.py yt-3.4.0/doc/source/cookbook/tests/test_cookbook.py --- yt-3.3.3/doc/source/cookbook/tests/test_cookbook.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/tests/test_cookbook.py 2017-08-10 18:02:57.000000000 +0000 @@ -36,7 +36,7 @@ PARALLEL_TEST = {"rockstar_nest.py": "3"} -BLACKLIST = ["opengl_ipython.py", "opengl_vr.py"] +BLACKLIST = ["opengl_ipython.py", "opengl_vr.py", "matplotlib-animation.py"] if sys.version_info >= (3,0,0): BLACKLIST.append("rockstar_nest.py") diff -Nru yt-3.3.3/doc/source/cookbook/yt_gadget_owls_analysis.ipynb yt-3.4.0/doc/source/cookbook/yt_gadget_owls_analysis.ipynb --- yt-3.3.3/doc/source/cookbook/yt_gadget_owls_analysis.ipynb 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/cookbook/yt_gadget_owls_analysis.ipynb 2017-08-10 18:02:57.000000000 +0000 @@ -20,7 +20,7 @@ "source": [ "The first thing you will need to run these examples is a working installation of yt. The author or these examples followed the instructions under \"Get yt: from source\" at http://yt-project.org/ to install an up to date development version of yt.\n", "\n", - "Next you should set the default ``test_data_dir`` in the ``.yt/config`` file in your home directory. Note that you may have to create the directory and file if it doesn't exist already.\n", + "Next you should set the default ``test_data_dir`` in the ``~/.config/yt/ytrc`` file in your home directory. Note that you may have to create the directory and file if it doesn't exist already.\n", "\n", "> [yt]\n", "\n", diff -Nru yt-3.3.3/doc/source/developing/building_the_docs.rst yt-3.4.0/doc/source/developing/building_the_docs.rst --- yt-3.3.3/doc/source/developing/building_the_docs.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/developing/building_the_docs.rst 2017-08-10 18:02:57.000000000 +0000 @@ -12,16 +12,16 @@ for increasing yt's impact in the community. It is the way in which the world will understand how to use our code, so it needs to be done concisely and understandably. Typically, when a developer submits some piece of code -with new functionality, she should also include documentation on how to use -that functionality (as per :ref:`requirements-for-code-submission`). +with new functionality, the developer should also include documentation on how +to use that functionality (as per :ref:`requirements-for-code-submission`). Depending on the nature of the code addition, this could be a new narrative docs section describing how the new code works and how to use it, it could include a recipe in the cookbook section, or it could simply be adding a note in the relevant docs text somewhere. -The documentation exists in the main mercurial code repository for yt in the -``doc`` directory (i.e. ``$YT_HG/doc/source`` where ``$YT_HG`` is the path of -the yt mercurial repository). It is organized hierarchically into the main +The documentation exists in the main code repository for yt in the +``doc`` directory (i.e. ``$YT_GIT/doc/source`` where ``$YT_GIT`` is the path of +the yt git repository). It is organized hierarchically into the main categories of: * Visualizing @@ -47,7 +47,7 @@ New cookbook recipes (see :ref:`cookbook`) are very helpful for the community as they provide simple annotated recipes on how to use specific functionality. -To add one, create a concise python script which demonstrates some +To add one, create a concise Python script which demonstrates some functionality and pare it down to its minimum. Add some comment lines to describe what it is that you're doing along the way. Place this ``.py`` file in the ``source/cookbook/`` directory, and then link to it explicitly in one @@ -55,7 +55,7 @@ ``cosmological_analysis.rst``, etc.), and add some description of what the script actually does. We recommend that you use one of the `sample data sets `_ in your recipe. When the full -docs are built, each of the cookbook recipes are executed dynamically on +docs are built, each of the cookbook recipes is executed dynamically on a system which has access to all of the sample datasets. Any output images generated by your script will then be attached inline in the built documentation directly following your script. @@ -63,8 +63,8 @@ After you have made your modifications to the docs, you will want to make sure that they render the way you expect them to render. For more information on this, see the section on :ref:`docs_build`. Unless you're contributing cookbook -recipes or notebooks which require a dynamical build, you can probably get -away with just doing a 'quick' docs build. +recipes or notebooks which require a dynamic build, you can probably get away +with just doing a 'quick' docs build. When you have completed your documentation additions, commit your changes to your repository and make a pull request in the same way you would contribute @@ -75,17 +75,17 @@ Building the Documentation -------------------------- -The yt documentation makes heavy use of the sphinx documentation automation -suite. Sphinx, written in python, was originally created for the documentation -of the python project and has many nice capabilities for managing the -documentation of python code. +The yt documentation makes heavy use of the Sphinx documentation automation +suite. Sphinx, written in Python, was originally created for the documentation +of the Python project and has many nice capabilities for managing the +documentation of Python code. While much of the yt documentation is static text, we make heavy use of cross-referencing with API documentation that is automatically generated at -build time by sphinx. We also use sphinx to run code snippets (e.g. the +build time by Sphinx. We also use Sphinx to run code snippets (e.g. the cookbook and the notebooks) and embed resulting images and example data. -You will want to make sure you have both Sphinx and the sphinx bootstrap theme +You will want to make sure you have both Sphinx and the Sphinx Bootstrap Theme installed. This installation is easily performed by running this at the command line: @@ -99,7 +99,7 @@ Building the entire set of yt documentation is a laborious task, since you need to have a large number of packages in order to successfully execute and render all of the notebooks and yt recipes drawing from every corner -of the yt source. As an quick alternative, one can do a ``quick`` build +of the yt source. As a quick alternative, one can do a ``quick`` build of the documentation, which eschews the need for downloading all of these dependencies, but it only produces the static docs. The static docs do not include the cookbook outputs and the notebooks, but this is good @@ -120,9 +120,9 @@ `Bootstrap theme `_, which can be installed via ``pip install sphinx_bootstrap_theme``. -In order to tell sphinx not to do all of the dynamical building, you must -set the ``$READTHEDOCS`` environment variable to be True by typing this at -the command line: +In order to tell Sphinx not to do all of the dynamic building, you must set the +``$READTHEDOCS`` environment variable to be True by typing this at the command +line: .. code-block:: bash @@ -132,16 +132,16 @@ This variable is set for automated builds on the free ReadTheDocs service but can be used by anyone to force a quick, minimal build. -Now all you need to do is execute sphinx on the yt doc source. Go to the +Now all you need to do is execute Sphinx on the yt doc source. Go to the documentation directory and build the docs: .. code-block:: bash - cd $YT_HG/doc + cd $YT_GIT/doc make html This will produce an html version of the documentation locally in the -``$YT_HG/doc/build/html`` directory. You can now go there and open +``$YT_GIT/doc/build/html`` directory. You can now go there and open up ``index.html`` or whatever file you wish in your web browser. Building the Docs (Full) @@ -150,8 +150,8 @@ As alluded to earlier, building the full documentation is a bit more involved than simply building the static documentation. -The full documentation makes heavy use of custom sphinx extensions to transform -recipes, notebooks, and inline code snippets into python scripts, IPython_ +The full documentation makes heavy use of custom Sphinx extensions to transform +recipes, notebooks, and inline code snippets into Python scripts, IPython_ notebooks, or notebook cells that are executed when the docs are built. To do this, we use Jupyter's nbconvert module to transform notebooks into @@ -188,11 +188,11 @@ configuration. Now that you have everything set up properly, go to the documentation directory -and build it using sphinx: +and build it using Sphinx: .. code-block:: bash - cd $YT_HG/doc + cd $YT_GIT/doc make html If all of the dependencies are installed and all of the test data is in the @@ -202,25 +202,23 @@ :ref:`configuration-file`) to suppress large amounts of debug output from yt. -To clean the docs build, use :code:`make clean`. By default, :code:`make clean` -will not delete the autogenerated API docs, so use :code:`make fullclean` to -delete those as well. +To clean the docs build, use :code:`make clean`. Building the Docs (Hybrid) ^^^^^^^^^^^^^^^^^^^^^^^^^^ -It's also possible to create a custom sphinx build that builds a restricted set +It's also possible to create a custom Sphinx build that builds a restricted set of notebooks or scripts. This can be accomplished by editing the Sphinx :code:`conf.py` file included in the :code:`source` directory at the top level of the docs. The extensions included in the build are contained in the :code:`extensions` list. To disable an extension, simply remove it from the -list. Doing so will raise a warning when sphinx encounters the directive in the -docs and will prevent sphinx from evaluating the directive. +list. Doing so will raise a warning when Sphinx encounters the directive in the +docs and will prevent Sphinx from evaluating the directive. As a concrete example, if one wanted to include the :code:`notebook`, and :code:`notebook-cell` directives, but not the :code:`python-script` or :code:`autosummary` directives, one would just need to comment out the lines that append these extensions to the :code:`extensions` list. The resulting docs build will be significantly quicker since it would avoid executing the lengthy -API autodocumentation as well as a large number of python script snippets in +API autodocumentation as well as a large number of Python script snippets in the narrative docs. diff -Nru yt-3.3.3/doc/source/developing/extensions.rst yt-3.4.0/doc/source/developing/extensions.rst --- yt-3.3.3/doc/source/developing/extensions.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/developing/extensions.rst 2017-08-10 17:56:56.000000000 +0000 @@ -40,10 +40,10 @@ A template for starting an extension module (or converting an existing set of code to an extension module) can be found at -https://bitbucket.org/yt_analysis/yt_extension_template . +https://github.com/yt-project/yt_extension_template . To get started, download a zipfile of the template ( -https://bitbucket.org/yt_analysis/yt_extension_template/get/tip.zip ) and +https://github.com/yt-project/yt_extension_template/archive/master.zip ) and follow the directions in ``README.md`` to modify the metadata. Distributing Extensions diff -Nru yt-3.3.3/doc/source/developing/releasing.rst yt-3.4.0/doc/source/developing/releasing.rst --- yt-3.3.3/doc/source/developing/releasing.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/developing/releasing.rst 2017-08-10 17:56:56.000000000 +0000 @@ -12,9 +12,8 @@ once a month. These releases should contain only fixes for bugs discovered in earlier releases and should not contain new features or API changes. Bugfix releases should increment the ``PATCH`` version number. Bugfix releases should - *not* be generated by merging from the ``yt`` branch, instead bugfix pull - requests should be manually backported using the PR backport script, described - below. Version ``3.2.2`` is a bugfix release. + *not* be generated by merging from the ``master`` branch, instead bugfix pull + requests should be manually backported. Version ``3.2.2`` is a bugfix release. * Minor releases @@ -25,7 +24,7 @@ backwards-incompatible changes and should not change APIs. If an API change is deemed to be necessary, the old API should continue to function but might trigger deprecation warnings. Minor releases should happen by merging the - ``yt`` branch into the ``stable`` branch. Minor releases should increment the + ``master`` branch into the ``stable`` branch. Minor releases should increment the ``MINOR`` version number and reset the ``PATCH`` version number to zero. Version ``3.3.0`` is a minor release. @@ -36,7 +35,7 @@ include arbitrary changes to the library. Major version releases should only happen after extensive discussion and vetting among the developer and user community. Like minor releases, a major release should happen by merging the - ``yt`` branch into the ``stable`` branch. Major releases should increment the + ``master`` branch into the ``stable`` branch. Major releases should increment the ``MAJOR`` version number and reset the ``MINOR`` and ``PATCH`` version numbers to zero. If it ever happens, version ``4.0.0`` will be a major release. @@ -49,99 +48,25 @@ As described above, bugfix releases are regularly scheduled updates for minor releases to ensure fixes for bugs make their way out to users in a timely manner. Since bugfix releases should not include new features, we do not issue -bugfix releases by simply merging from the development ``yt`` branch into the -``stable`` branch. Instead, we make use of the ``pr_backport.py`` script to -manually cherry-pick bugfixes from the from ``yt`` branch onto the ``stable`` -branch. - -The backport script issues interactive prompts to backport individual pull -requests to the ``stable`` branch in a temporary clone of the main yt mercurial -repository on bitbucket. The script is written this way to to avoid editing -history in a clone of the repository that a developer uses for day-to-day work -and to avoid mixing work-in-progress changes with changes that have made their -way to the "canonical" yt repository on bitbucket. - -Rather than automatically manipulating the temporary repository by scripting -mercurial commands using ``python-hglib``, the script must be "operated" by a -human who is ready to think carefully about what the script is telling them -to do. Most operations will merely require copy/pasting a suggested mercurial -command. However, some changes will require manual backporting. - -To run the backport script, first open two terminal windows. The first window -will be used to run the backport script. The second terminal will be used to -manipulate a temporary clone of the yt mercurial repository. In the first -window, navigate to the ``scripts`` directory at the root of the yt repository -and run the backport script, - -.. code-block:: bash - - $ cd $YT_HG/scripts - $ python pr_backport.py - -You will then need to wait for about a minute (depending on the speed of your -internet connection and bitbucket's servers) while the script makes a clone of -the main yt repository and then gathers information about pull requests that -have been merged since the last tagged release. Once this step finishes, you -will be prompted to navigate to the temporary folder in a new separate terminal -session. Do so, and then hit the enter key in the original terminal session. - -For each pull request in the set of pull requests that were merged since the -last tagged release that were pointed at the "main" line of development -(e.g. not the ``experimental`` bookmark), you will be prompted by the script -with the PR number, title, description, and a suggested mercurial -command to use to backport the pull request. If the pull request consists of a -single changeset, you will be prompted to use ``hg graft``. If it contains more -than one changeset, you will be prompted to use ``hg rebase``. Note that -``rebase`` is an optional extension for mercurial that is not turned on by -default. To enable it, add a section like the following in your ``.hgrc`` file: - -.. code-block:: none - - [extensions] - rebase= - -Since ``rebase`` is bundled with core mercurial, you do not need to specify a -path to the rebase extension, just say ``rebase=`` and mercurial will find the -version of ``rebase`` bundled with mercurial. Note also that mercurial does not -automatically update to the tip of the rebased head after executing ``hg -rebase`` so you will need to manually issue ``hg update stable`` to move your -working directory to the new head of the stable branch. The backport script -should prompt you with a suggestion to update as well. +bugfix releases by simply merging from the development ``master`` branch into +the ``stable`` branch. Instead, we manually cherry-pick bugfixes from the from +``master`` branch onto the ``stable`` branch. If the pull request contains merge commits, you must take care to *not* backport -commits that merge with the main line of development on the ``yt`` branch. Doing +commits that merge with the main line of development on the ``master`` branch. Doing so may bring unrelated changes, including new features, into a bugfix -release. If the pull request you'd like to backport contains merge commits, the -backport script should warn you to be extra careful. +release. -Once you've finished backporting, the script will let you know that you are done -and warn you to push your work. The temporary repository you have been working -with will be deleted as soon as the script exits, so take care to push your work -on the ``stable`` branch to your fork on bitbucket. Once you've pushed to your -fork, you will be able to issue a pull request containing the backported fixes -just like any other yt pull request. +Once you've finished backporting push your work to Github. Once you've pushed to +your fork, you will be able to issue a pull request containing the backported +fixes just like any other yt pull request. Doing a Minor or Major Release ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is much simpler than a bugfix release. All that needs to happen is the -``yt`` branch must get merged into the ``stable`` branch, and any conflicts that -happen must be resolved, almost certainly in favor of the yt branch. This can -happen either using a merge tool like ``vimdiff`` and ``kdiff3`` or by telling -mercurial to write merge markers. If you prefer merge markers, the following -configuration options should be turned on in your ``hgrc`` to get more detail -during the merge: - -.. code-block:: none - - [ui] - merge = internal:merge3 - mergemarkers = detailed - -The first option tells mercurial to write merge markers that show the state of -the conflicted region of the code on both sides of the merge as well as the -"base" most recent common ancestor changeset. The second option tells mercurial -to add extra information about the code near the merge markers. +``master`` branch must get merged into the ``stable`` branch, and any conflicts +that happen must be resolved. Incrementing Version Numbers and Tagging a Release @@ -174,35 +99,42 @@ .. code-block:: bash - hg tag + git tag Where ```` follows the project's naming scheme for tags -(e.g. ``yt-3.2.1``). Commit the tag, and you should be ready to upload the -release to pypi. +(e.g. ``yt-3.2.1``). Once you are done, you will need to push the +tag to github:: + + git push origin --tags -If you are doing a minor or major version number release, you will also need to -update back to the development branch and update the development version numbers -in the same files. +This assumes that you have configured the remote ``origin`` to point at the main +yt git repository. If you are doing a minor or major version number release, you +will also need to update back to the development branch and update the +development version numbers in the same files. Uploading to PyPI ~~~~~~~~~~~~~~~~~ To actually upload the release to the Python Package Index, you just need to -issue the following command: +issue the following commands: .. code-block:: bash - python setup.py sdist upload -r https://pypi.python.org/pypi + python setup.py sdist + twine upload dist/* You will be prompted for your PyPI credentials and then the package should upload. Note that for this to complete successfully, you will need an account on PyPI and that account will need to be registered as an "owner" of the yt -package. Right now there are three owners: Matt Turk, Britton Smith, and Nathan -Goldbaum. +package. Right now there are five owners: Matt Turk, Britton Smith, Nathan +Goldbaum, John ZuHone, and Kacper Kowalik. In addition, you should attempt to +upload the yt package along with compiled binary wheel packages for various +platforms that we support. You should contact John ZuHone about uploading +binary wheels to PyPI for Windows and OS X users, Kacper Kowalik for Linux +wheels, and contact Nathan Goldbaum about getting the Anaconda packages updated. + After the release is uploaded to PyPI, you should send out an announcement e-mail to the yt mailing lists as well as other possibly interested mailing -lists for all but bugfix releases. In addition, you should contact John ZuHone -about uploading binary wheels to PyPI for Windows and OS X users and contact -Nathan Goldbaum about getting the Anaconda packages updated. +lists for all but bugfix releases. diff -Nru yt-3.3.3/doc/source/developing/testing.rst yt-3.4.0/doc/source/developing/testing.rst --- yt-3.3.3/doc/source/developing/testing.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/developing/testing.rst 2017-08-10 18:02:57.000000000 +0000 @@ -50,19 +50,19 @@ If you are developing new functionality, it is sometimes more convenient to use the Nose command line interface, ``nosetests``. You can run the unit tests -using ``nose`` by navigating to the base directory of the yt mercurial +using ``nose`` by navigating to the base directory of the yt git repository and invoking ``nosetests``: .. code-block:: bash - $ cd $YT_HG + $ cd $YT_GIT $ nosetests -where ``$YT_HG`` is the path to the root of the yt mercurial repository. +where ``$YT_GIT`` is the path to the root of the yt git repository. If you want to specify a specific unit test to run (and not run the entire suite), you can do so by specifying the path of the test relative to the -``$YT_HG/yt`` directory -- note that you strip off one yt more than you +``$YT_GIT/yt`` directory -- note that you strip off one yt more than you normally would! For example, if you want to run the plot_window tests, you'd run: @@ -251,6 +251,7 @@ * ``InteractingJets/jet_000002`` * ``WaveDarkMatter/psiDM_000020`` +* ``Plummer/plummer_000000`` Halo Catalog ~~~~~~~~~~~~ @@ -286,15 +287,12 @@ These datasets are available at http://yt-project.org/data/. -Next, modify the file ``~/.yt/config`` to include a section ``[yt]`` -with the parameter ``test_data_dir``. Set this to point to the -directory with the test data you want to test with. Here is an example -config file: +Next, add the config parameter ``test_data_dir`` pointing to +directory with the test data you want to test with, e.g.: .. code-block:: none - [yt] - test_data_dir = /Users/tomservo/src/yt-data + $ yt config set yt test_data_dir /Users/tomservo/src/yt-data More data will be added over time. To run the answer tests, you must first generate a set of test answers locally on a "known good" revision, then update @@ -308,13 +306,13 @@ .. code-block:: bash - $ cd $YT_HG + $ cd $YT_GIT $ nosetests --with-answer-testing --local --local-dir $HOME/Documents/test --answer-store --answer-name=local-tipsy yt.frontends.tipsy This command will create a set of local answers from the tipsy frontend tests and store them in ``$HOME/Documents/test`` (this can but does not have to be the same directory as the ``test_data_dir`` configuration variable defined in your -``.yt/config`` file) in a file named ``local-tipsy``. To run the tipsy +``~/.config/yt/ytrc`` file) in a file named ``local-tipsy``. To run the tipsy frontend's answer tests using a different yt changeset, update to that changeset, recompile if necessary, and run the tests using the following command: diff -Nru yt-3.3.3/doc/source/examining/loading_data.rst yt-3.4.0/doc/source/examining/loading_data.rst --- yt-3.3.3/doc/source/examining/loading_data.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/examining/loading_data.rst 2017-08-10 18:02:57.000000000 +0000 @@ -98,13 +98,13 @@ ds = load("./A11QR1/s11Qzm1h2_a1.0000.art") -.. _loading_athena_data: +.. _loading-athena-data: Athena Data ----------- -Athena 4.x VTK data is *mostly* supported and cared for by John -ZuHone. Both uniform grid and SMR datasets are supported. +Athena 4.x VTK data is supported and cared for by John ZuHone. Both uniform grid +and SMR datasets are supported. .. note: yt also recognizes Fargo3D data written to VTK files as @@ -138,29 +138,35 @@ which will pick up all of the files in the different ``id*`` directories for the entire dataset. -yt works in cgs ("Gaussian") units by default, but Athena data is not -normally stored in these units. If you would like to convert data to -cgs units, you may supply conversions for length, time, and mass to ``load`` using -the ``units_override`` functionality: +The default unit system in yt is cgs ("Gaussian") units, but Athena data is not +normally stored in these units, so the code unit system is the default unit +system for Athena data. This means that answers to field queries from data +objects and plots of data will be expressed in code units. Note that the default +conversions from these units will still be in terms of cgs units, e.g. 1 +``code_length`` equals 1 cm, and so on. If you would like to provided different +conversions, you may supply conversions for length, time, and mass to ``load`` +using the ``units_override`` functionality: .. code-block:: python import yt - units_override = {"length_unit":(1.0,"Mpc"), - "time_unit"(1.0,"Myr"), - "mass_unit":(1.0e14,"Msun")} + units_override = {"length_unit": (1.0, "Mpc"), + "time_unit": (1.0, "Myr"), + "mass_unit": (1.0e14, "Msun")} ds = yt.load("id0/cluster_merger.0250.vtk", units_override=units_override) -This means that the yt fields, e.g. ``("gas","density")``, ``("gas","x-velocity")``, -``("gas","magnetic_field_x")``, will be in cgs units, but the Athena fields, e.g., -``("athena","density")``, ``("athena","velocity_x")``, ``("athena","cell_centered_B_x")``, will be -in code units. - -Some 3D Athena outputs may have large grids (especially parallel datasets subsequently joined with -the `join_vtk` script), and may benefit from being subdivided into "virtual grids". For this purpose, -one can pass in the `nprocs` parameter: +This means that the yt fields, e.g. ``("gas","density")``, +``("gas","velocity_x")``, ``("gas","magnetic_field_x")``, will be in cgs units +(or whatever unit system was specified), but the Athena fields, e.g., +``("athena","density")``, ``("athena","velocity_x")``, +``("athena","cell_centered_B_x")``, will be in code units. + +Some 3D Athena outputs may have large grids (especially parallel datasets +subsequently joined with the ``join_vtk`` script), and may benefit from being +subdivided into "virtual grids". For this purpose, one can pass in the +``nprocs`` parameter: .. code-block:: python @@ -168,56 +174,115 @@ ds = yt.load("sloshing.0000.vtk", nprocs=8) -which will subdivide each original grid into `nprocs` grids. +which will subdivide each original grid into ``nprocs`` grids. .. note:: Virtual grids are only supported (and really only necessary) for 3D data. -Alternative values for the following simulation parameters may be specified using a ``parameters`` -dict, accepting the following keys: +Alternative values for the following simulation parameters may be specified +using a ``parameters`` dict, accepting the following keys: * ``Gamma``: ratio of specific heats, Type: Float -* ``geometry``: Geometry type, currently accepts ``"cartesian"`` or ``"cylindrical"`` -* ``periodicity``: Is the domain periodic? Type: Tuple of boolean values corresponding to each dimension +* ``geometry``: Geometry type, currently accepts ``"cartesian"`` or + ``"cylindrical"`` +* ``periodicity``: Is the domain periodic? Type: Tuple of boolean values + corresponding to each dimension .. code-block:: python import yt - parameters = {"gamma":4./3., "geometry":"cylindrical", "periodicity":(False,False,False)} + parameters = {"gamma":4./3., "geometry":"cylindrical", + "periodicity":(False,False,False)} ds = yt.load("relativistic_jet_0000.vtk", parameters=parameters) .. rubric:: Caveats -* yt primarily works with primitive variables. If the Athena - dataset contains conservative variables, the yt primitive fields will be generated from the +* yt primarily works with primitive variables. If the Athena dataset contains + conservative variables, the yt primitive fields will be generated from the conserved variables on disk. -* Special relativistic datasets may be loaded, but are not fully supported. In particular, the relationships between - quantities such as pressure and thermal energy will be incorrect, as it is currently assumed that their relationship - is that of an ideal a :math:`\gamma`-law equation of state. +* Special relativistic datasets may be loaded, but at this time not all of + their fields are fully supported. In particular, the relationships between + quantities such as pressure and thermal energy will be incorrect, as it is + currently assumed that their relationship is that of an ideal a + :math:`\gamma`-law equation of state. This will be rectified in a future + release. * Domains may be visualized assuming periodicity. * Particle list data is currently unsupported. .. note:: The old behavior of supplying unit conversions using a ``parameters`` - dict supplied to ``load`` for Athena datasets is still supported, but is being deprecated in - favor of ``units_override``, which provides the same functionality. + dict supplied to ``load`` for Athena datasets is still supported, but is + being deprecated in favor of ``units_override``, which provides the same + functionality. + +.. _loading-athena-pp-data: + +Athena++ Data +------------- + +Athena++ HDF5 data is supported and cared for by John ZuHone. Uniform-grid, SMR, +and AMR datasets in cartesian coordinates are fully supported. Support for +curvilinear coordinates and logarithmic cell sizes exists, but is preliminary. +For the latter type of dataset, the data will be loaded in as a semi-structured +mesh dataset. See :ref:`loading-semi-structured-mesh-data` for more details on +how this works in yt. + +The default unit system in yt is cgs ("Gaussian") units, but Athena++ data is +not normally stored in these units, so the code unit system is the default unit +system for Athena++ data. This means that answers to field queries from data +objects and plots of data will be expressed in code units. Note that the default +conversions from these units will still be in terms of cgs units, e.g. 1 +``code_length`` equals 1 cm, and so on. If you would like to provided different +conversions, you may supply conversions for length, time, and mass to ``load`` +using the ``units_override`` functionality: + +.. code-block:: python + + import yt + + units_override = {"length_unit":(1.0,"Mpc"), + "time_unit"(1.0,"Myr"), + "mass_unit":(1.0e14,"Msun")} + + ds = yt.load("AM06/AM06.out1.00400.athdf", units_override=units_override) + +This means that the yt fields, e.g. ``("gas","density")``, +``("gas","velocity_x")``, ``("gas","magnetic_field_x")``, will be in cgs units +(or whatever unit system was specified), but the Athena fields, e.g., +``("athena_pp","density")``, ``("athena_pp","vel1")``, ``("athena_pp","Bcc1")``, +will be in code units. + +.. rubric:: Caveats + +* yt primarily works with primitive variables. If the Athena++ dataset contains + conservative variables, the yt primitive fields will be generated from the + conserved variables on disk. +* Special relativistic datasets may be loaded, but at this time not all of their + fields are fully supported. In particular, the relationships between + quantities such as pressure and thermal energy will be incorrect, as it is + currently assumed that their relationship is that of an ideal + :math:`\gamma`-law equation of state. This will be rectified in a future + release. +* Domains may be visualized assuming periodicity. .. _loading-orion-data: -BoxLib Data ------------ +AMReX / BoxLib Data +------------------- -yt has been tested with BoxLib data generated by Orion, Nyx, Maestro and -Castro. Currently it is cared for by a combination of Andrew Myers, Chris -Malone, Matthew Turk, and Mike Zingale. +AMReX and BoxLib share a frontend (currently named `boxlib`), since +the file format nearly identical. yt has been tested with AMReX/BoxLib +data generated by Orion, Nyx, Maestro, Castro, IAMR, and +WarpX. Currently it is cared for by a combination of Andrew Myers, +Matthew Turk, and Mike Zingale. -To load a BoxLib dataset, you can use the ``yt.load`` command on +To load an AMReX/BoxLib dataset, you can use the ``yt.load`` command on the plotfile directory name. In general, you must also have the -``inputs`` file in the base directory, but Maestro and Castro will get +``inputs`` file in the base directory, but Maestro, Castro, Nyx, and WarpX will get all the necessary parameter information from the ``job_info`` file in the plotfile directory. For instance, if you were in a directory with the following files: @@ -245,7 +310,7 @@ import yt ds = yt.load("pltgmlcs5600") -For Maestro and Castro, you would not need the ``inputs`` file, and you +For Maestro, Castro, Nyx, and WarpX, you would not need the ``inputs`` file, and you would have a ``job_info`` file in the plotfile directory. .. rubric:: Caveats @@ -253,13 +318,65 @@ * yt does not read the Maestro base state (although you can have Maestro map it to a full Cartesian state variable before writing the plotfile to get around this). E-mail the dev list if you need this support. -* yt does not know about particles in Maestro. +* yt supports AMReX/BoxLib particle data stored in the standard format used + by Nyx and WarpX, and optionally Castro. It currently does not support the ASCII particle + data used by Maestro and Castro. * For Maestro, yt aliases either "tfromp" or "tfromh to" ``temperature`` depending on the value of the ``use_tfromp`` runtime parameter. * For Maestro, some velocity fields like ``velocity_magnitude`` or ``mach_number`` will always use the on-disk value, and not have yt derive it, due to the complex interplay of the base state velocity. +Viewing raw fields in WarpX +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Most AMReX/BoxLib codes output cell-centered data. If the underlying discretization +is not cell-centered, then fields are typically averaged to cell centers before +they are written to plot files for visualization. WarpX, however, has the option +to output the raw (i.e., not averaged to cell centers) data as well. If you +run your WarpX simulation with ``warpx.plot_raw_fields = 1`` in your inputs +file, then you should get an additional ``raw_fields`` subdirectory inside your +plot file. When you load this dataset, yt will have additional on-disk fields +defined, with the "raw" field type: + +.. code-block:: python + + import yt + ds = yt.load("Laser/plt00015/") + print(ds.field_list) + +The raw fields in WarpX are nodal in at least one direction. We define a field +to be "nodal" in a given direction if the field data is defined at the "low" +and "high" sides of the cell in that direction, rather than at the cell center. +Instead of returning one field value per cell selected, nodal fields return a +number of values, depending on their centering. This centering is marked by +a `nodal_flag` that describes whether the fields is nodal in each dimension. +``nodal_flag = [0, 0, 0]`` means that the field is cell-centered, while +``nodal_flag = [0, 0, 1]`` means that the field is nodal in the z direction +and cell centered in the others, i.e. it is defined on the z faces of each cell. +``nodal_flag = [1, 1, 0]`` would mean that the field is centered in the z direction, +but nodal in the other two, i.e. it lives on the four cell edges that are normal +to the z direction. + +.. code-block:: python + + ds.index + ad = ds.all_data() + print(ds.field_info[('raw', 'Ex')].nodal_flag) + print(ad['raw', 'Ex'].shape) + print(ds.field_info[('raw', 'Bx')].nodal_flag) + print(ad['raw', 'Bx'].shape) + print(ds.field_info[('boxlib', 'Bx')].nodal_flag) + print(ad['boxlib', 'Bx'].shape) + +Here, the field ``('raw', 'Ex')`` is nodal in two directions, so four values per cell +are returned, corresponding to the four edges in each cell on which the variable +is defined. ``('raw', 'Bx')`` is nodal in one direction, so two values are returned +per cell. The standard, averaged-to-cell-centers fields are still available. + +Currently, slices and data selection are implemented for nodal fields. Projections, +volume rendering, and many of the analysis modules will not work. + .. _loading-pluto-data: Pluto Data @@ -325,12 +442,83 @@ of length 1.0 in "code length" which may produce strange results for volume quantities. + +Enzo MHDCT data +^^^^^^^^^^^^^^^ + +The electric and magnetic fields for Enzo MHDCT simulations are defined on cell +faces, unlike other Enzo fields which are defined at cell centers. In yt, we +call face-centered fields like this "nodal". We define a field to be nodal in +a given direction if the field data is defined at the "low" and "high" sides of +the cell in that direction, rather than at the cell center. Instead of +returning one field value per cell selected, nodal fields return a number of +values, depending on their centering. This centering is marked by a `nodal_flag` +that describes whether the fields is nodal in each dimension. ``nodal_flag = +[0, 0, 0]`` means that the field is cell-centered, while ``nodal_flag = [0, 0, +1]`` means that the field is nodal in the z direction and cell centered in the +others, i.e. it is defined on the z faces of each cell. ``nodal_flag = [1, 1, +0]`` would mean that the field is centered in the z direction, but nodal in the +other two, i.e. it lives on the four cell edges that are normal to the z +direction. + +.. code-block:: python + + ds.index + ad = ds.all_data() + print(ds.field_info[('enzo', 'Ex')].nodal_flag) + print(ad['raw', 'Ex'].shape) + print(ds.field_info[('enzo', 'BxF')].nodal_flag) + print(ad['raw', 'Bx'].shape) + print(ds.field_info[('enzo', 'Bx')].nodal_flag) + print(ad['boxlib', 'Bx'].shape) + +Here, the field ``('enzo', 'Ex')`` is nodal in two directions, so four values +per cell are returned, corresponding to the four edges in each cell on which the +variable is defined. ``('enzo', 'BxF')`` is nodal in one direction, so two +values are returned per cell. The standard, non-nodal field ``('enzo', 'Bx')`` +is also available. + +Currently, slices and data selection are implemented for nodal +fields. Projections, volume rendering, and many of the analysis modules will not +work. + +.. _loading-enzop-data: + +Enzo-P Data +----------- + +Enzo-P outputs have three types of files. + +.. code-block:: none + + hello-0200/ + hello-0200/hello-0200.block_list + hello-0200/hello-0200.file_list + hello-0200/hello-0200.hello-c0020-p0000.h5 + +To load Enzo-P data into yt, provide the block list file: + +.. code-block:: python + + import yt + ds = yt.load("hello-0200/hello-0200.block_list") + +Mesh fields are fully supported for 1, 2, and 3D datasets. + +.. rubric:: Caveats + +* The Enzo-P output format is still evolving somewhat as the code is being + actively developed. This frontend will be updated as development continues. +* Units are currently assumed to be in CGS. +* Particles are not yet supported. + .. _loading-exodusii-data: Exodus II Data -------------- .. note:: + To load Exodus II data, you need to have the `netcdf4 `_ python interface installed. @@ -834,8 +1022,8 @@ ds = yt.load("snapshot_061.hdf5") Gadget data in raw binary format can also be loaded with the ``load`` command. -This is only supported for snapshots created with the ``SnapFormat`` parameter -set to 1 (the standard for Gadget-2). +This is supported for snapshots created with the ``SnapFormat`` parameter +set to 1 or 2. .. code-block:: python @@ -848,24 +1036,46 @@ ^^^^^^^^^^^^^^^^^^^^^^^^ There are two additional pieces of information that may be needed. If your -simulation is cosmological, yt can often guess the bounding box and the units -of the simulation. However, for isolated simulations and for cosmological -simulations with non-standard units, these must be supplied. For example, if -a length unit of 1.0 corresponds to a kiloparsec, you can supply this in the -constructor. yt can accept units such as ``Mpc``, ``kpc``, ``cm``, ``Mpccm/h`` -and so on. In particular, note that ``Mpc/h`` and ``Mpccm/h`` (``cm`` for -comoving here) are usable unit definitions. +simulation is cosmological, yt can often guess the bounding box and the units of +the simulation. However, for isolated simulations and for cosmological +simulations with non-standard units, these must be supplied by the user. For +example, if a length unit of 1.0 corresponds to a kiloparsec, you can supply +this in the constructor. yt can accept units such as ``Mpc``, ``kpc``, ``cm``, +``Mpccm/h`` and so on. In particular, note that ``Mpc/h`` and ``Mpccm/h`` +(``cm`` for comoving here) are usable unit definitions. yt will attempt to use units for ``mass``, ``length`` and ``time`` as supplied in the argument ``unit_base``. The ``bounding_box`` argument is a list of two-item tuples or lists that describe the left and right extents of the -particles. +particles. In this example we load a dataset with a custom bounding box +and units. + +.. code-block:: python + + + bbox = [[-600.0, 600.0], [-600.0, 600.0], [-600.0, 600.0]] + unit_base = { + 'length': (1.0, 'kpc'), + 'velocity: (1.0, 'km/s'), + 'mass': (1.0, 'Msun') + } + + ds = yt.load("snap_004", unit_base=unit_base, bounding_box=bbox) + +In addition, you can use ``UnitLength_in_cm``, ``UnitVelocity_in_cm_per_s``, +and ``UnitMass_in_g`` as keys for the ``unit_base`` dictionary. These names +come from the names used in the Gadget runtime parameter file. This example +will initialize a dataset with the same units as the example above: .. code-block:: python - ds = GadgetDataset("snap_004", - unit_base = {'length': ('kpc', 1.0)}, - bounding_box = [[-600.0, 600.0], [-600.0, 600.0], [-600.0, 600.0]]) + unit_base = { + 'UnitLength_in_cm': 3.09e21, + 'UnitVelocity_in_cm_per_s': 1e5 + 'UnitMass_in_g': 1.989e33 + } + + ds = yt.load("snap_004", unit_base=unit_base, bounding_box=bbox) .. _particle-indexing-criteria: @@ -895,10 +1105,10 @@ ds = yt.load("snapshot_061.hdf5", index_ptype="PartType0") By default, ``index_ptype`` is set to ``"all"``, which means all the particles. -Currently this feature only works for the Gadget HDF5 and OWLS datasets. To -bring the feature to other frontends, it's recommended to refer to this -`PR `_ -for implementation details. +For Gadget binary outputs, ``index_ptype`` should be set using the particle type +names yt uses internally (e.g. ``'Gas'``, ``'Halo'``, ``'Disk'``, etc). For +Gadget HDF5 outputs the particle type names come from the HDF5 output and so +should be referred to using names like ``'PartType0'``. .. _gadget-field-spec: @@ -1055,8 +1265,8 @@ import yt ds = yt.load("InteractingJets/jet_000002") -Currently GAMER does not assume any unit for non-cosmological simulations. To specify the units for yt, -you need to supply conversions for length, time, and mass to ``load`` using the ``units_override`` functionality: +For simulations without units (i.e., OPT__UNIT = 0), you can supply conversions for +length, time, and mass to ``load`` using the ``units_override`` functionality: .. code-block:: python @@ -1069,6 +1279,8 @@ This means that the yt fields, e.g., ``("gas","density")``, will be in cgs units, but the GAMER fields, e.g., ``("gamer","Dens")``, will be in code units. +Particle data are supported and are always stored in the same file as the grid data. + .. rubric:: Caveats * GAMER data in raw binary format (i.e., OPT__OUTPUT_TOTAL = C-binary) is not supported. @@ -1090,31 +1302,33 @@ import yt grid_data = [ - dict(left_edge = [0.0, 0.0, 0.0], - right_edge = [1.0, 1.0, 1.], - level = 0, - dimensions = [32, 32, 32], - number_of_particles = 0) - dict(left_edge = [0.25, 0.25, 0.25], - right_edge = [0.75, 0.75, 0.75], - level = 1, - dimensions = [32, 32, 32], - number_of_particles = 0) + dict(left_edge=[0.0, 0.0, 0.0], + right_edge=[1.0, 1.0, 1.0], + level=0, + dimensions=[32, 32, 32]) + dict(left_edge=[0.25, 0.25, 0.25], + right_edge=[0.75, 0.75, 0.75], + level=1, + dimensions=[32, 32, 32]) ] for g in grid_data: - g["density"] = np.random.random(g["dimensions"]) * 2**g["level"] + g["density"] = np.random.random(g["dimensions"]) * 2 ** g["level"] ds = yt.load_amr_grids(grid_data, [32, 32, 32], 1.0) -Particle fields are supported by adding 1-dimensional arrays and -setting the ``number_of_particles`` key to each ``grid``'s dict: +.. note:: + + yt only supports a block structure where the grid edges on the ``n``-th + refinement level are aligned with the cell edges on the ``n-1``-th level. + +Particle fields are supported by adding 1-dimensional arrays to each +``grid``'s dict: .. code-block:: python for g in grid_data: - g["number_of_particles"] = 100000 - g["particle_position_x"] = np.random.random((g["number_of_particles"])) + g["particle_position_x"] = np.random.random(size=100000) .. rubric:: Caveats @@ -1153,26 +1367,22 @@ simultaneously divide the domain into 12 chunks, so that you can take advantage of the underlying parallelism. -Particle fields are detected as one-dimensional fields. The number of -particles is set by the ``number_of_particles`` key in -``data``. Particle fields are then added as one-dimensional arrays in -a similar manner as the three-dimensional grid fields: +Particle fields are added as one-dimensional arrays in a similar manner as the +three-dimensional grid fields: .. code-block:: python import yt data = dict(Density = dens, - number_of_particles = 1000000, particle_position_x = posx_arr, - particle_position_y = posy_arr, - particle_position_z = posz_arr) + particle_position_y = posy_arr, + particle_position_z = posz_arr) bbox = np.array([[-1.5, 1.5], [-1.5, 1.5], [1.5, 1.5]]) ds = yt.load_uniform_grid(data, arr.shape, 3.08e24, bbox=bbox, nprocs=12) -where in this example the particle position fields have been assigned. -``number_of_particles`` must be the same size as the particle arrays. If no -particle arrays are supplied then ``number_of_particles`` is assumed to be +where in this example the particle position fields have been assigned. If no +particle fields are supplied, then the number of particles is assumed to be zero. .. rubric:: Caveats @@ -1180,6 +1390,8 @@ * Particles may be difficult to integrate. * Data must already reside in memory. +.. _loading-semi-structured-mesh-data: + Semi-Structured Grid Data ------------------------- @@ -1262,23 +1474,73 @@ .. code-block:: python - import yt - import numpy - from yt.utilities.exodusII_reader import get_data + import yt + import numpy as np + + coords = np.array([[0.0, 0.0], + [1.0, 0.0], + [1.0, 1.0], + [0.0, 1.0]], dtype=np.float64) + + connect = np.array([[0, 1, 3], + [1, 2, 3]], dtype=np.int64) - coords, connectivity, data = get_data("MOOSE_sample_data/out.e-s010") + data = {} + data['connect1', 'test'] = np.array([[0.0, 1.0, 3.0], + [1.0, 2.0, 3.0]], dtype=np.float64) -This uses a publically available `MOOSE ` -dataset along with the get_data function to parse the coords, connectivity, -and data. Then, these can be loaded as an in-memory dataset as follows: +Here, we have made up a simple, 2D unstructured mesh dataset consisting of two +triangles and one node-centered data field. This data can be loaded as an in-memory +dataset as follows: .. code-block:: python - mesh_id = 0 - ds = yt.load_unstructured_mesh(data[mesh_id], connectivity[mesh_id], coords[mesh_id]) + ds = yt.load_unstructured_mesh(connect, coords, data) + +The in-memory dataset can then be visualized as usual, e.g.: + +.. code-block:: python + + sl = yt.SlicePlot(ds, 'z', 'test') + sl.annotate_mesh_lines() + +Note that load_unstructured_mesh can take either a single mesh or a list of meshes. +To load multiple meshes, you can do: + +.. code-block:: python + + import yt + import numpy as np + + coordsMulti = np.array([[0.0, 0.0], + [1.0, 0.0], + [1.0, 1.0], + [0.0, 1.0]], dtype=np.float64) -Note that load_unstructured_mesh can take either a single or a list of meshes. -Here, we have selected only the first mesh to load. + connect1 = np.array([[0, 1, 3], ], dtype=np.int64) + connect2 = np.array([[1, 2, 3], ], dtype=np.int64) + + data1 = {} + data2 = {} + data1['connect1', 'test'] = np.array([[0.0, 1.0, 3.0], ], dtype=np.float64) + data2['connect2', 'test'] = np.array([[1.0, 2.0, 3.0], ], dtype=np.float64) + + connectList = [connect1, connect2] + dataList = [data1, data2] + + ds = yt.load_unstructured_mesh(connectList, coordsMulti, dataList) + + # only plot the first mesh + sl = yt.SlicePlot(ds, 'z', ('connect1', 'test')) + + # only plot the second + sl = yt.SlicePlot(ds, 'z', ('connect2', 'test')) + + # plot both + sl = yt.SlicePlot(ds, 'z', ('all', 'test')) + +Note that you must respect the field naming convention that fields on the first +mesh will have the type 'connect1', fields on the second will have 'connect2', etc... .. rubric:: Caveats @@ -1365,7 +1627,7 @@ Halo Catalog Data ----------------- -yt has support for reading halo catalogs produced by Rockstar and the inline +yt has support for reading halo catalogs produced by AHF, Rockstar and the inline FOF/SUBFIND halo finders of Gadget and OWLS. The halo catalogs are treated as particle datasets where each particle represents a single halo. For example, this means that the `particle_mass` field refers to the mass of the halos. For @@ -1375,7 +1637,51 @@ If you have access to both the halo catalog and the simulation snapshot from the same redshift, additional analysis can be performed for each halo using -:ref:`halo_catalog`. +:ref:`halo_catalog`. The resulting product can be reloaded in a similar manner +to the other halo catalogs shown here. + +.. _ahf: + +AHF +^^^ + +AHF halo catalogs are loaded by providing the path to the .parameter files. +The corresponding .log and .AHF_halos files must exist for data loading to +succeed. The field type for all fields is "halos". Some fields of note avaible +from AHF are: + ++----------------+---------------------------+ +| AHF field | yt field name | ++================+===========================+ +| ID | particle_identifier | ++----------------+---------------------------+ +| Mvir | particle_mass | ++----------------+---------------------------+ +| Rvir | virial_radius | ++----------------+---------------------------+ +| (X,Y,Z)c | particle_position_(x,y,z) | ++----------------+---------------------------+ +| V(X,Y,Z)c | particle_velocity_(x,y,z) | ++----------------+---------------------------+ + +Numerous other AHF fields exist. To see them, check the field list by typing +`ds.field_list` for a dataset loaded as `ds`. Like all other datasets, fields +must be accessed through :ref:`Data-objects`. + +.. code-block:: python + + import yt + ds = yt.load("ahf_halos/snap_N64L16_135.parameter", hubble_constant=0.7) + ad = ds.all_data() + # halo masses + print(ad["halos", "particle_mass"]) + # halo radii + print(ad["halos", "virial_radius"]) + +.. note:: + + Currently the dimensionless Hubble parameter that yt needs is not provided in + AHF outputs. So users need to provide the `hubble_constant` (default to 1.0) while loading datasets, as shown above. .. _rockstar: @@ -1517,6 +1823,90 @@ # The halo mass print(ad["FOF", "particle_mass"]) +.. _halocatalog: + +HaloCatalog +^^^^^^^^^^^ + +These are catalogs produced by the analysis discussed in :ref:`halo_catalog`. +In the case where multiple files were produced, one need only provide the path +to a single one of them. The field type for all fields is "halos". The fields +available here are similar to other catalogs. Any addition +:ref:`halo_catalog_quantities` will also be accessible as fields. + ++-------------------+---------------------------+ +| HaloCatalog field | yt field name | ++===================+===========================+ +| halo id | particle_identifier | ++-------------------+---------------------------+ +| virial mass | particle_mass | ++-------------------+---------------------------+ +| virial radius | virial_radius | ++-------------------+---------------------------+ +| halo position | particle_position_(x,y,z) | ++-------------------+---------------------------+ +| halo velocity | particle_velocity_(x,y,z) | ++-------------------+---------------------------+ + +.. code-block:: python + + import yt + ds = yt.load("catalogs/catalog.0.h5") + ad = ds.all_data() + # The halo mass + print(ad["halos", "particle_mass"]) + +.. _loading-openpmd-data: + +openPMD Data +------------ + +`openPMD `_ is an open source meta-standard and naming +scheme for mesh based data and particle data. It does not actually define a file +format. + +HDF5-containers respecting the minimal set of meta information from +versions 1.0.0 and 1.0.1 of the standard are compatible. +Support for the ED-PIC extension is not available. Mesh data in cartesian coordinates +and particle data can be read by this frontend. + +To load the first in-file iteration of a openPMD datasets using the standard HDF5 +output format: + +.. code-block:: python + + import yt + ds = yt.load('example-3d/hdf5/data00000100.h5') + +If you operate on large files, you may want to modify the virtual chunking behaviour through +``open_pmd_virtual_gridsize``. The supplied value is an estimate of the size of a single read request +for each particle attribute/mesh (in Byte). + +.. code-block:: python + + import yt + ds = yt.load('example-3d/hdf5/data00000100.h5', open_pmd_virtual_gridsize=10e4) + sp = yt.SlicePlot(ds, 'x', 'rho') + sp.show() + +Particle data is fully supported: + +.. code-block:: python + + import yt + ds = yt.load('example-3d/hdf5/data00000100.h5') + ad = f.all_data() + ppp = yt.ParticlePhasePlot(ad, 'particle_position_y', 'particle_momentum_y', 'particle_weighting') + ppp.show() + +.. rubric:: Caveats + +* 1D, 2D and 3D data is compatible, but lower dimensional data might yield + strange results since it gets padded and treated as 3D. Extraneous dimensions are + set to be of length 1.0m and have a width of one cell. +* The frontend has hardcoded logic for renaming the openPMD ``position`` + of particles to ``positionCoarse`` + .. _loading-pyne-data: PyNE Data @@ -1584,8 +1974,26 @@ import yt ds = yt.load("output_00007/info_00007.txt") -yt will attempt to guess the fields in the file. You may also specify a list -of fields by supplying the ``fields`` keyword in your call to ``load``. +yt will attempt to guess the fields in the file. You may also specify +a list of hydro fields by supplying the ``fields`` keyword in your +call to ``load``. It is also possible to provide a list of *extra* +particle fields by supplying the ``extra_particle_fields``: + +.. code-block:: python + + import yt + extra_fields = [('family', 'I'), ('info', 'I')] + ds = yt.load("output_00001/info_00001.txt", extra_particle_fields=extra_fields) + # ('all', 'family') and ('all', 'info') now in ds.field_list + +yt supports outputs made by the mainline ``RAMSES`` code as well as the +``RAMSES-RT`` fork. Files produces by ``RAMSES-RT`` are recognized as such +based on the presence of a ``into_rt_*.txt`` file in the output directory. + +It is possible to force yt to treat the simulation as a cosmological +simulation by providing the ``cosmological=True`` parameter (or +``False`` to force non-cosmology). If left to ``None``, the kind of +the simulation is inferred from the data. .. _loading-sph-data: diff -Nru yt-3.3.3/doc/source/examining/Loading_Generic_Array_Data.ipynb yt-3.4.0/doc/source/examining/Loading_Generic_Array_Data.ipynb --- yt-3.3.3/doc/source/examining/Loading_Generic_Array_Data.ipynb 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/examining/Loading_Generic_Array_Data.ipynb 2017-08-10 18:02:57.000000000 +0000 @@ -139,9 +139,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Particle fields are detected as one-dimensional fields. The number of\n", - "particles is set by the `number_of_particles` key in\n", - "`data`. Particle fields are then added as one-dimensional arrays in\n", + "Particle fields are detected as one-dimensional fields. Particle fields are then added as one-dimensional arrays in\n", "a similar manner as the three-dimensional grid fields:" ] }, @@ -157,21 +155,19 @@ "posy_arr = np.random.uniform(low=-1.5, high=1.5, size=10000)\n", "posz_arr = np.random.uniform(low=-1.5, high=1.5, size=10000)\n", "data = dict(density = (np.random.random(size=(64,64,64)), \"Msun/kpc**3\"), \n", - " number_of_particles = 10000,\n", " particle_position_x = (posx_arr, 'code_length'), \n", " particle_position_y = (posy_arr, 'code_length'),\n", " particle_position_z = (posz_arr, 'code_length'))\n", "bbox = np.array([[-1.5, 1.5], [-1.5, 1.5], [-1.5, 1.5]])\n", "ds = yt.load_uniform_grid(data, data[\"density\"][0].shape, length_unit=(1.0, \"Mpc\"), mass_unit=(1.0,\"Msun\"), \n", - " bbox=bbox, nprocs=4)" + " bbox=bbox, nprocs=4)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "In this example only the particle position fields have been assigned. `number_of_particles` must be the same size as the particle\n", - "arrays. If no particle arrays are supplied then `number_of_particles` is assumed to be zero. Take a slice, and overlay particle positions:" + "In this example only the particle position fields have been assigned. If no particle arrays are supplied, then the number of particles is assumed to be zero. Take a slice, and overlay particle positions:" ] }, { @@ -574,8 +570,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Particle fields are supported by adding 1-dimensional arrays to each `grid` and\n", - "setting the `number_of_particles` key in each `grid`'s dict. If a grid has no particles, set `number_of_particles = 0`, but the particle fields still have to be defined since they are defined elsewhere; set them to empty NumPy arrays:" + "Particle fields are supported by adding 1-dimensional arrays to each `grid`. If a grid has no particles, the particle fields still have to be defined since they are defined elsewhere; set them to empty NumPy arrays:" ] }, { @@ -586,11 +581,9 @@ }, "outputs": [], "source": [ - "grid_data[0][\"number_of_particles\"] = 0 # Set no particles in the top-level grid\n", "grid_data[0][\"particle_position_x\"] = (np.array([]), \"code_length\") # No particles, so set empty arrays\n", "grid_data[0][\"particle_position_y\"] = (np.array([]), \"code_length\")\n", "grid_data[0][\"particle_position_z\"] = (np.array([]), \"code_length\")\n", - "grid_data[1][\"number_of_particles\"] = 1000\n", "grid_data[1][\"particle_position_x\"] = (np.random.uniform(low=0.25, high=0.75, size=1000), \"code_length\")\n", "grid_data[1][\"particle_position_y\"] = (np.random.uniform(low=0.25, high=0.75, size=1000), \"code_length\")\n", "grid_data[1][\"particle_position_z\"] = (np.random.uniform(low=0.25, high=0.75, size=1000), \"code_length\")" @@ -635,6 +628,64 @@ ] }, { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Multiple Particle Types" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For both uniform grid data and AMR data, one can specify particle fields with multiple types if the particle field names are given as field tuples instead of strings (the default particle type is `\"io\"`):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "posxr_arr = np.random.uniform(low=-1.5, high=1.5, size=10000)\n", + "posyr_arr = np.random.uniform(low=-1.5, high=1.5, size=10000)\n", + "poszr_arr = np.random.uniform(low=-1.5, high=1.5, size=10000)\n", + "posxb_arr = np.random.uniform(low=-1.5, high=1.5, size=20000)\n", + "posyb_arr = np.random.uniform(low=-1.5, high=1.5, size=20000)\n", + "poszb_arr = np.random.uniform(low=-1.5, high=1.5, size=20000)\n", + "data = {\"density\": (np.random.random(size=(64,64,64)), \"Msun/kpc**3\"), \n", + " (\"red\", \"particle_position_x\"): (posxr_arr, 'code_length'), \n", + " (\"red\", \"particle_position_y\"): (posyr_arr, 'code_length'),\n", + " (\"red\", \"particle_position_z\"): (poszr_arr, 'code_length'),\n", + " (\"blue\", \"particle_position_x\"): (posxb_arr, 'code_length'), \n", + " (\"blue\", \"particle_position_y\"): (posyb_arr, 'code_length'),\n", + " (\"blue\", \"particle_position_z\"): (poszb_arr, 'code_length')}\n", + "bbox = np.array([[-1.5, 1.5], [-1.5, 1.5], [-1.5, 1.5]])\n", + "ds = yt.load_uniform_grid(data, data[\"density\"][0].shape, length_unit=(1.0, \"Mpc\"), mass_unit=(1.0,\"Msun\"), \n", + " bbox=bbox, nprocs=4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can now see we have multiple particle types:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dd = ds.all_data()\n", + "print (ds.particle_types)\n", + "print (dd[\"red\", \"particle_position_x\"].size)\n", + "print (dd[\"blue\", \"particle_position_x\"].size)\n", + "print (dd[\"all\", \"particle_position_x\"].size)" + ] + }, + { "cell_type": "markdown", "metadata": {}, "source": [ diff -Nru yt-3.3.3/doc/source/examining/Loading_Generic_Particle_Data.ipynb yt-3.4.0/doc/source/examining/Loading_Generic_Particle_Data.ipynb --- yt-3.3.3/doc/source/examining/Loading_Generic_Particle_Data.ipynb 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/examining/Loading_Generic_Particle_Data.ipynb 2017-08-10 18:02:57.000000000 +0000 @@ -19,7 +19,7 @@ "source": [ "import numpy as np\n", "\n", - "n_particles = 5e6\n", + "n_particles = 5000000\n", "\n", "ppx, ppy, ppz = 1e6*np.random.normal(size=[3, n_particles])\n", "\n", @@ -139,12 +139,63 @@ { "cell_type": "code", "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "slc = yt.SlicePlot(ds, 2, ('deposit', 'all_cic'))\n", + "slc.set_width((8, 'Mpc'))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, one can specify multiple particle types in the `data` directory by setting the field names to be field tuples (the default field type for particles is `\"io\"`) if one is not specified:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "n_star_particles = 1000000\n", + "n_dm_particles = 2000000\n", + "\n", + "ppxd, ppyd, ppzd = 1e6*np.random.normal(size=[3, n_dm_particles])\n", + "ppmd = np.ones(n_dm_particles)\n", + "\n", + "ppxs, ppys, ppzs = 5e5*np.random.normal(size=[3, n_star_particles])\n", + "ppms = 0.1*np.ones(n_star_particles)\n", + "\n", + "data2 = {('dm', 'particle_position_x'): ppxd,\n", + " ('dm', 'particle_position_y'): ppyd,\n", + " ('dm', 'particle_position_z'): ppzd,\n", + " ('dm', 'particle_mass'): ppmd,\n", + " ('star', 'particle_position_x'): ppxs,\n", + " ('star', 'particle_position_y'): ppys,\n", + " ('star', 'particle_position_z'): ppzs,\n", + " ('star', 'particle_mass'): ppms}\n", + "\n", + "ds2 = yt.load_particles(data2, length_unit=parsec, mass_unit=1e8*Msun, n_ref=256, bbox=bbox)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We now have separate `\"dm\"` and `\"star\"` particles, as well as their deposited fields:" + ] + }, + { + "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ - "slc = yt.SlicePlot(ds, 2, ('deposit', 'all_cic'))\n", + "slc = yt.SlicePlot(ds2, 2, [('deposit', 'dm_cic'), ('deposit', 'star_cic')])\n", "slc.set_width((8, 'Mpc'))" ] } diff -Nru yt-3.3.3/doc/source/examining/low_level_inspection.rst yt-3.4.0/doc/source/examining/low_level_inspection.rst --- yt-3.3.3/doc/source/examining/low_level_inspection.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/examining/low_level_inspection.rst 2017-08-10 18:02:57.000000000 +0000 @@ -107,22 +107,32 @@ specific point*. While there are several ways to find out the answer to this question, a few helper routines are provided as well. To identify the finest-resolution (i.e., most canonical) data at a given point, use -:meth:`~yt.data_objects.index.AMRHierarchy.find_field_value_at_point`. -This accepts a position (in coordinates of the domain) and returns the field -values for one or multiple fields. - -To identify all the grids that intersect a given point, the function -:meth:`~yt.data_objects.index.AMRHierarchy.find_point` will return indices -and objects that correspond to it. For instance: - -.. code-block:: python - - gs, gi = ds.find_point((0.5, 0.6, 0.9)) - for g in gs: - print(g.Level, g.LeftEdge, g.RightEdge) +the point data object:: -Note that this doesn't just return the canonical output, but also all of the -parent grids that overlap with that point. + from yt.units import kpc + point_obj = ds.point([30, 75, 80]*kpc) + density_at_point = point_obj['gas', 'density'] + +The point data object works just like any other yt data object. It is special +because it is the only zero-dimensional data object: it will only return data at +the exact point specified when creating the point data object. For more +information about yt data objects, see :ref:`Data-objects`. + +If you need to find field values at many points, the +:meth:`~yt.data_objects.static_output.Dataset.find_field_values_at_points` +function may be more efficient. This function returns a nested list of field +values at multiple points in the simulation volume. For example, if one wanted +to find the value of a mesh field at the location of the particles in a +simulation, one could do:: + + ad = ds.all_data() + ppos = ad['all', 'particle_position'] + ppos_den_vel = ds.find_field_values_at_points( + ['density', 'velocity_x'], ppos) + +In this example, ``ppos_den_vel`` will be a list of arrays. The first array will +contain the density values at the particle positions, the second will contain +the x velocity values at the particle positions. .. _examining-grid-data-in-a-fixed-resolution-array: diff -Nru yt-3.3.3/doc/source/faq/index.rst yt-3.4.0/doc/source/faq/index.rst --- yt-3.3.3/doc/source/faq/index.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/faq/index.rst 2017-08-10 18:02:57.000000000 +0000 @@ -28,25 +28,16 @@ $ yt version yt module located at: - /Users/username/src/yt-x86_64/src/yt-hg - The supplemental repositories are located at: - /Users/username/src/yt-x86_64/src/yt-supplemental + /Users/username/src/yt-conda/src/yt-git - The current version and changeset for the code is: + The current version of yt is: --- - Version = 2.7-dev - Changeset = 6bffc737a67a + Version = 3.4-dev + Changeset = 94033fca00e5 --- This installation CAN be automatically updated. - yt dependencies were last updated on - Wed Dec 4 15:47:40 MST 2013 - - To update all dependencies, run "yt update --all". - -If the changeset is displayed followed by a "+", it means you have made -modifications to the code since the last changeset. For more information on this topic, see :ref:`updating-yt`. @@ -75,10 +66,10 @@ .. code-block:: bash - cd $YT_HG - python setup.py develop + cd $YT_GIT + pip install -e . -where ``$YT_HG`` is the path to the yt mercurial repository. +where ``$YT_GIT`` is the path to the yt git repository. This error tends to occur when there are changes in the underlying cython files that need to be rebuilt, like after a major code update or in switching @@ -388,10 +379,10 @@ To make things easier to load these sample datasets, you can add the parent directory to your downloaded sample data to your *yt path*. If you set the option ``test_data_dir``, in the section ``[yt]``, -in ``~/.yt/config``, yt will search this path for them. +in ``~/.config/yt/ytrc``, yt will search this path for them. This means you can download these datasets to ``/big_drive/data_for_yt`` , add -the appropriate item to ``~/.yt/config``, and no matter which directory you are +the appropriate item to ``~/.config/yt/ytrc``, and no matter which directory you are in when running yt, it will also check in *that* directory. @@ -437,12 +428,11 @@ hand, you may want it to output a lot more, since you can't figure out exactly what's going wrong, and you want to output some debugging information. The yt log level can be changed using the :ref:`configuration-file`, either by setting it in the -``$HOME/.yt/config`` file: +``$HOME/.config/yt/ytrc`` file: .. code-block:: bash - [yt] - loglevel = 10 # This sets the log level to "DEBUG" + $ yt config set yt loglevel 10 # This sets the log level to "DEBUG" which would produce debug (as well as info, warning, and error) messages, or at runtime: diff -Nru yt-3.3.3/doc/source/help/index.rst yt-3.4.0/doc/source/help/index.rst --- yt-3.3.3/doc/source/help/index.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/help/index.rst 2017-08-10 18:02:57.000000000 +0000 @@ -36,18 +36,23 @@ Sometimes the pace of development is pretty fast on yt, particularly in the development branch, so a fix to your problem may have already been developed by the time you encounter it. Many users' problems can simply be corrected -by updating to the latest version of the code and/or its dependencies. You -can update yt's source by running: +by updating to the latest version of the code and/or its dependencies. If you +have installed the latest stable release of yt then you should update yt using +the package manager appropriate for your python installation. For example, with +``pip``:: -.. code-block:: bash + $ pip install -U yt - $ yt update +Or with conda:: + + $ conda update yt -or you could update yt's source as well as any software dependencies by running: +If you installed yt from a checkout of the git repository, you can update to +the latest development version by issuing the following command: .. code-block:: bash - $ yt update --all + $ yt update .. _update-errors: @@ -58,13 +63,13 @@ loading yt either from the command line or from within python also fails, it may simply mean you need to rebuild the yt source (some of the c-code in yt needs to be rebuilt after major changes). You can do this by navigating to -the root of the yt mercurial repository. If you installed with the all-in-one -installer script, this is the ``yt-/src/yt-hg`` directory. Then +the root of the yt git repository. If you installed with the all-in-one +installer script, this is the ``yt-/src/yt-git`` directory. Then execute these commands: .. code-block:: bash - $ python setup.py develop + $ pip install -e . Now try running yt again with: @@ -72,8 +77,8 @@ $ yt --help -If you continue to see errors, you should try contacting us via IRC or email -but you may have to reinstall yt (see :ref:`getting-and-installing-yt`). +If you continue to see errors, you should try contacting us via Slack, IRC or +email but you may have to reinstall yt (see :ref:`getting-and-installing-yt`). .. _search-the-documentation: @@ -112,13 +117,14 @@ We've done our best to make the source clean, and it is easily searchable from your computer. -If you have not done so already (see :ref:`source-installation`), clone a copy of the yt mercurial repository and make it the 'active' installation by doing +If you have not done so already (see :ref:`source-installation`), clone a copy +of the yt git repository and make it the 'active' installation by doing .. code-block:: bash - python setup.py develop + $ pip install -e . -in the root directory of the yt mercurial repository. +in the root directory of the yt git repository. .. note:: @@ -126,7 +132,7 @@ script. Building yt from source will not work if you do not have a C compiler installed. -Once inside the yt mercurial repository, you can then search for the class, +Once inside the yt git repository, you can then search for the class, function, or keyword which is giving you problems with ``grep -r *``, which will recursively search throughout the code base. (For a much faster and cleaner experience, we recommend ``grin`` instead of ``grep -r *``. To install ``grin`` @@ -137,7 +143,7 @@ .. code-block:: bash - $ cd $YT-HG/yt + $ cd $YT_GIT/yt $ grep -r SlicePlot * (or $ grin SlicePlot) This will print a number of locations in the yt source tree where ``SlicePlot`` @@ -156,10 +162,11 @@ these steps: * Identify what it is that went wrong, and how you knew it went wrong. -* Put your script, errors, and outputs online: +* Put your script, errors, inputs and outputs online: * ``$ yt pastebin script.py`` - pastes script.py online * ``$ yt upload_image image.png`` - pastes image online + * ``$ yt upload my_input.tar`` - pastes my_input.tar online * Identify which version of the code you’re using. @@ -170,17 +177,24 @@ .. _irc: -Go on IRC to ask a question ---------------------------- +Go on Slack or IRC to ask a question +------------------------------------ + +If you want a fast, interactive experience, you could try jumping into our Slack +or IRC channels to get your questions answered in a chatroom style environment. -If you want a fast, interactive experience, you could try jumping into our IRC -channel to get your questions answered in a chatroom style environment. You -don't even need to have any special IRC client in order to join. We are the -#yt channel on irc.freenode.net, but you can also connect using your web -browser by going to http://yt-project.org/irc.html . There are usually 2-8 -members of the user base and development team online, so you'll probably get -your answers quickly. Remember to bring the information from the -:ref:`last step `. +To join our slack channel you will need to request an invite by going to +http://yt-project.org/development.html, click the "Join as @ Slack!" button, and +fill out the form. You will get an invite as soon as an administrator approves +your request. + +Alternatively you can go to our IRC channel, which does not require an +invite. You don't even need to have any special IRC client in order to join the +IRC channel. We are the #yt channel on irc.freenode.net, but you can also +connect using your web browser by going to http://yt-project.org/irc.html . +There are usually 2-8 members of the user base and development team online, so +you'll probably get your answers quickly. Remember to bring the information +from the :ref:`last step `. .. _mailing-list: @@ -209,13 +223,12 @@ ------------------- If you have gone through all of the above steps, and you're still encountering -problems, then you have found a bug. -To submit a bug report, you can either directly create one through the -BitBucket `web interface `_, -or you can use the command line ``yt bugreport`` to interactively create one. -Alternatively, email the ``yt-users`` mailing list and we will construct a new -ticket in your stead. Remember to include the information -about your problem you identified in :ref:`this step `. +problems, then you have found a bug. To submit a bug report, you can either +directly create one through the GitHub `web interface +`_. Alternatively, email the +``yt-users`` mailing list and we will construct a new ticket in your stead. +Remember to include the information about your problem you identified in +:ref:`this step `. Special Issues -------------- diff -Nru yt-3.3.3/doc/source/index.rst yt-3.4.0/doc/source/index.rst --- yt-3.3.3/doc/source/index.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/index.rst 2017-08-10 18:02:57.000000000 +0000 @@ -133,6 +133,16 @@

+ Sharing Data +

+ + +

The yt Hub

+ + + + +

Reference Materials

@@ -185,6 +195,7 @@ analyzing/analysis_modules/index examining/index developing/index + sharing_data reference/index faq/index Getting Help diff -Nru yt-3.3.3/doc/source/installing.rst yt-3.4.0/doc/source/installing.rst --- yt-3.3.3/doc/source/installing.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/installing.rst 2017-08-10 18:02:57.000000000 +0000 @@ -48,24 +48,23 @@ .. _branches-of-yt: -Branches of yt: ``yt``, ``stable``, and ``yt-2.x`` -++++++++++++++++++++++++++++++++++++++++++++++++++ +Branches of yt: ``master``, ``stable``, and ``yt-2.x`` +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Before you install yt, you must decide which branch (i.e. version) of the code you prefer to use: -* ``yt`` -- The most up-to-date *development* version with the most current - features but sometimes unstable (the development version of the next ``yt-3.x`` - release). +* ``master`` -- The most up-to-date *development* version with the most current + features but sometimes unstable (the development version of the next release). * ``stable`` -- The latest stable release of ``yt-3.x``. * ``yt-2.x`` -- The last stable release of ``yt-2.x``. If this is your first time using the code, we recommend using ``stable``, unless you specifically need some piece of brand-new functionality only available in -``yt`` or need to run an old script developed for ``yt-2.x``. There were major +``master`` or need to run an old script developed for ``yt-2.x``. There were major API and functionality changes made in yt for version 3.0. For a detailed description of the changes between versions 2.x (e.g. branch ``yt-2.x``) and 3.x -(e.g. branches ``yt`` and ``stable``) see :ref:`yt3differences`. Lastly, don't +(e.g. branches ``master`` and ``stable``) see :ref:`yt3differences`. Lastly, don't feel like you're locked into one branch when you install yt, because you can easily change the active branch by following the instructions in :ref:`switching-between-yt-versions`. @@ -78,7 +77,7 @@ Because installation of all of the interlocking parts necessary to install yt itself can be time-consuming, yt provides an all-in-one installation script which downloads and builds a fully-isolated installation of Python that includes -NumPy, Matplotlib, H5py, Mercurial, and yt. +NumPy, Matplotlib, H5py, git, and yt. The install script supports UNIX-like systems, including Linux, OS X, and most supercomputer and cluster environments. It is particularly suited for deployment @@ -99,13 +98,13 @@ .. code-block:: bash - $ wget http://bitbucket.org/yt_analysis/yt/raw/yt/doc/install_script.sh + $ wget https://raw.githubusercontent.com/yt-project/yt/master/doc/install_script.sh If you do not have ``wget``, the following should also work: .. code-block:: bash - $ curl -OL http://bitbucket.org/yt_analysis/yt/raw/yt/doc/install_script.sh + $ curl -OL https://raw.githubusercontent.com/yt-project/yt/master/doc/install_script.sh By default, the bash install script will create a python environment based on the `miniconda python distrubtion `_, @@ -119,13 +118,9 @@ If you would like to build yt from source, you will need to edit the install script and set ``INST_YT_SOURCE=1`` near the top. This will clone a copy of the -yt mercurial repository and build yt form source. The default is +yt git repository and build yt form source. The default is ``INST_YT_SOURCE=0``, which installs yt from a binary conda package. -The install script can also build python and all yt dependencies from source. To -switch to this mode, set ``INST_CONDA=0`` at the top of the install script. If -you choose this mode, you must also set ``INST_YT_SOURCE=1``. - In addition, you can tell the install script to download and install some additional packages --- currently these include `PyX `_, the `Rockstar halo @@ -145,8 +140,8 @@ Because the installer is downloading and building a variety of packages from source, this will likely take a few minutes, especially if you have a slow -internet connection or have ``INST_CONDA=0`` set. You will get updates of its -status at the command prompt throughout. +internet connection. You will get updates of its status at the command prompt +throughout. If you receive errors during this process, the installer will provide you with a large amount of information to assist in debugging your problems. The @@ -156,15 +151,6 @@ potentially figure out what went wrong. If you have problems, though, do not hesitate to :ref:`contact us ` for assistance. -If the install script errors out with a message about being unable to import the -python SSL bindings, this means that the Python built by the install script was -unable to link against the OpenSSL library. This likely means that you installed -with ``INST_CONDA=0`` on a recent version of OSX, or on a cluster that has a -very out of date installation of OpenSSL. In both of these cases you will either -need to install OpenSSL yourself from the system package manager or consider -using ``INST_CONDA=1``, since conda-based installs can install the conda package -for OpenSSL. - .. _activating-yt: Activating Your Installation @@ -173,11 +159,8 @@ Once the installation has completed, there will be instructions on how to set up your shell environment to use yt. -Activating Conda-based installs (``INST_CONDA=1``) -"""""""""""""""""""""""""""""""""""""""""""""""""" - -For conda-based installs, you will need to ensure that the installation's -``yt-conda/bin`` directory is prepended to your ``PATH`` environment variable. +In particular, you will need to ensure that the installation's ``yt-conda/bin`` +directory is prepended to your ``PATH`` environment variable. For Bash-style shells, you can use the following command in a terminal session to temporarily activate the yt installation: @@ -196,31 +179,6 @@ appropriate for your shell and OS (e.g. .bashrc, .bash_profile, .cshrc, .zshrc) to include the same command. -Activating source-based installs (``INST_CONDA=0``) -""""""""""""""""""""""""""""""""""""""""""""""""""" - -For this installation method, you must run an ``activate`` script to activate -the yt environment in a terminal session. You must run this script in order to -have yt properly recognized by your system. You can either add it to your login -script, or you must execute it in each shell session prior to working with yt. - -.. code-block:: bash - - $ source /bin/activate - -If you use csh or tcsh as your shell, activate that version of the script: - -.. code-block:: bash - - $ source /bin/activate.csh - -If you don't like executing outside scripts on your computer, you can set -the shell variables manually. ``YT_DEST`` needs to point to the root of the -directory containing the install. By default, this will be ``yt-``, where -```` is your machine's architecture (usually ``x86_64`` or ``i386``). You -will also need to set ``LD_LIBRARY_PATH`` and ``PYTHONPATH`` to contain -``$YT_DEST/lib`` and ``$YT_DEST/python2.7/site-packages``, respectively. - .. _updating-yt: Updating yt and Its Dependencies @@ -232,21 +190,20 @@ .. code-block:: bash - $ yt update + $ conda update yt -Additionally, if you ran the install script with ``INST_CONDA=0`` and want to -make sure you have the latest dependencies associated with yt and update the -codebase simultaneously, type this: +If you want to update your dependencies, run: .. code-block:: bash - $ yt update --all + $ conda update --all -If you ran the install script with ``INST_CONDA=1`` and want to update your dependencies, run: +If you have installed yt from source, you can use the following command to get +the latest development version of yt: .. code-block:: bash - $ conda update --all + $ yt update .. _removing-yt: @@ -255,10 +212,14 @@ Because yt and its dependencies are installed in an isolated directory when you use the script installer, you can easily remove yt and all of its -dependencies cleanly. Simply remove the install directory and its -subdirectories and you're done. If you *really* had problems with the -code, this is a last defense for solving: remove and then fully -:ref:`re-install ` from the install script again. +dependencies cleanly. Simply remove the install directory and its +subdirectories:: + + $ rm -rf yt-conda + +If you *really* had problems with the installation process, this is a last +defense for solving: remove and then fully :ref:`re-install ` +from the install script again. .. _anaconda-installation: @@ -270,7 +231,7 @@ .. code-block:: bash - $ conda install yt + $ conda install -c conda-forge yt which will install stable branch of yt along with all of its dependencies. @@ -284,7 +245,7 @@ .. code-block:: bash - $ conda install -c http://use.yt/with_conda/ yt + $ conda install -c http://use.yt/with_conda/ -c conda-forge yt New packages for development branch are built after every pull request is merged. In order to make sure you are running latest version, it's recommended @@ -292,7 +253,12 @@ .. code-block:: bash - $ conda update -c http://use.yt/with_conda/ yt + $ conda update -c http://use.yt/with_conda/ -c conda-forge yt + +We recommend trying to install dependencies from conda-forge as indicated above +since focused individual communities stand a better chance of successfully +maintaining build recipes. However, if you wish to use the default anaconda +packages, simply remove ``-c conda-forge`` during conda installation. Location of our channel can be added to ``.condarc`` to avoid retyping it during each *conda* invocation. Please refer to `Conda Manual @@ -309,56 +275,40 @@ .. code-block:: bash - $ conda install cython mercurial sympy ipython matplotlib + $ conda install -c conda-forge cython git sympy ipython matplotlib netCDF4 In addition, you will need a C compiler installed. -.. note:: - - If you are using a python3 environment, ``conda`` will not be able to install - *mercurial*, which works only with python2. You can circumvent this issue by - creating a dedicated python2 environment and symlinking *hg* in your current - environment: - - .. code-block:: bash - - $ export CONDA_DIR=$(python -c 'import sys; print(sys.executable.split("/bin/python")[0])') - $ conda create -y -n py27 python=2.7 mercurial - $ ln -s ${CONDA_DIR}/envs/py27/bin/hg ${CONDA_DIR}/bin - Clone the yt repository with: .. code-block:: bash - $ hg clone https://bitbucket.org/yt_analysis/yt + $ git clone https://github.com/yt-project/yt Once inside the yt directory, update to the appropriate branch and -run ``setup.py develop``. For example, the following commands will allow you +run ``pip install -e .``. For example, the following commands will allow you to see the tip of the development branch. .. code-block:: bash - $ hg pull - $ hg update yt - $ python setup.py develop + $ git checkout master + $ pip install -e . This will make sure you are running a version of yt corresponding to the most up-to-date source code. -.. _rockstar-conda: - -Rockstar Halo Finder for Conda-based installations -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Installing Support for the Rockstar Halo Finder +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The easiest way to set rockstar up in a conda-based python envrionment is to run -the install script with both ``INST_CONDA=1`` and ``INST_ROCKSTAR=1``. +the install script with ``INST_ROCKSTAR=1``. If you want to do this manually, you will need to follow these instructions. First, clone Matt Turk's fork of rockstar and compile it: .. code-block:: bash - $ hg clone https://bitbucket.org/MatthewTurk/rockstar + $ git clone https://github.com/yt-project/rockstar $ cd rockstar $ make lib @@ -369,17 +319,17 @@ $ cp librockstar.so /path/to/anaconda/lib Finally, you will need to recompile yt to enable the rockstar interface. Clone a -copy of the yt mercurial repository (see :ref:`conda-source-build`), or navigate +copy of the yt git repository (see :ref:`conda-source-build`), or navigate to a clone that you have already made, and do the following: .. code-block:: bash - $ cd /path/to/yt-hg + $ cd /path/to/yt-git $ ./clean.sh $ echo /path/to/rockstar > rockstar.cfg - $ python setup.py develop + $ pip install -e . -Here ``/path/to/yt-hg`` is the path to your clone of the yt mercurial repository +Here ``/path/to/yt-git`` is the path to your clone of the yt git repository and ``/path/to/rockstar`` is the path to your clone of Matt Turk's fork of rockstar. @@ -406,13 +356,23 @@ ^^^^^^^^^^^^^^^^^^^^^^^^ Installation on 64-bit Microsoft Windows platforms is supported using Anaconda -(see :ref:`anaconda-installation`). Also see :ref:`windows-developing` for -details on how to build yt from source in Windows. +(see :ref:`anaconda-installation`) and via ``pip``. .. _source-installation: -Installing yt Using ``pip`` or From Source -++++++++++++++++++++++++++++++++++++++++++ +Installing yt Using ``pip`` ++++++++++++++++++++++++++++ + +If you already have a python installation that you manage using ``pip`` you can +install the latest release of yt by doing:: + + $ pip install yt + +If you do not have root access you may need to append ``--user`` to install to a +location in your home folder. + +Installing yt from source ++++++++++++++++++++++++++ .. note:: @@ -423,75 +383,67 @@ installed on your system. Right now, the dependencies to build yt from source include: -- ``mercurial`` +- ``git`` - A C compiler such as ``gcc`` or ``clang`` - ``Python 2.7``, ``Python 3.4``, or ``Python 3.5`` -In addition, building yt from source requires several python packages +In addition, building yt from source requires ``numpy`` and ``cython`` which can be installed with ``pip``: .. code-block:: bash - $ pip install numpy matplotlib cython sympy + $ pip install numpy cython You may also want to install some of yt's optional dependencies, including ``jupyter``, ``h5py`` (which in turn depends on the HDF5 library), ``scipy``, or ``astropy``, -From here, you can use ``pip`` (which comes with ``Python``) to install the -latest stable version of yt: - -.. code-block:: bash - - $ pip install yt - -The source code for yt may be found at the Bitbucket project site and can also -be utilized for installation. If you prefer to install the development version -of yt instead of the latest stable release, you will need ``mercurial`` to clone -the official repo: +The source code for yt may be found on GitHub. If you prefer to install the +development version of yt instead of the latest stable release, you will need +``git`` to clone the official repo: .. code-block:: bash - $ hg clone https://bitbucket.org/yt_analysis/yt + $ git clone https://github.com/yt-project/yt $ cd yt - $ hg update yt - $ python setup.py install --user --prefix= + $ git checkout master + $ pip install . --user --install-option="--prefix=" .. note:: If you maintain your own user-level python installation separate from the - OS-level python installation, you can leave off ``--user --prefix=``, although + OS-level python installation, you can leave off ``--user --install-option="--prefix="``, although you might need ``sudo`` depending on where python is installed. See `This StackOverflow discussion `_ - if you are curious why ``--prefix=`` is neccessary on some systems. + if you are curious why ``--install-option="--prefix="`` is neccessary on some systems. This will install yt into a folder in your home directory (``$HOME/.local/lib64/python2.7/site-packages`` on Linux, ``$HOME/Library/Python/2.7/lib/python/site-packages/`` on OSX) Please refer to the ``setuptools`` documentation for the additional options. -If you are unable to locate the ``yt`` executable (i.e. ``yt version`` failes), -then you likely need to add the ``$HOME/.local/bin`` (or the equivalent on your -OS) to your PATH. Some linux distributions do not include this directory in the -default search path. +If you are unable to locate the ``yt`` executable (i.e. executing ``yt version`` +at the bash command line fails), then you likely need to add the +``$HOME/.local/bin`` (or the equivalent on your OS) to your PATH. Some linux +distributions do not include this directory in the default search path. If you choose this installation method, you do not need to run any activation script since this will install yt into your global python environment. -If you will be modifying yt, you can also make the clone of the yt mercurial +If you will be modifying yt, you can also make the clone of the yt git repository the "active" installed copy: .. code-block:: bash - $ hg clone https://bitbucket.org/yt_analysis/yt + $ git clone https://github.com/yt-project/yt $ cd yt - $ hg update yt - $ python setup.py develop --user --prefix= + $ git checkout master + $ pip install -e . --user --install-option="--prefix=" -As above, you can leave off ``--user --prefix=`` if you want to install yt into the default -package install path. If you do not have write access for this location, you -might need to use ``sudo``. +As above, you can leave off ``--user --install-option="--prefix="`` if you want to install yt into +the default package install path. If you do not have write access for this +location, you might need to use ``sudo``. Build errors with ``setuptools`` or ``distribute`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -513,13 +465,13 @@ or via your preferred method. -Keeping yt Updated via Mercurial -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Keeping yt Updated via Git +^^^^^^^^^^^^^^^^^^^^^^^^^^ If you want to maintain your yt installation via updates straight from the -Bitbucket repository or if you want to do some development on your own, we +GitHub repository or if you want to do some development on your own, we suggest you check out some of the :ref:`development docs `, -especially the sections on :ref:`Mercurial ` and +especially the sections on :ref:`Git ` and :ref:`building yt from source `. You can also make use of the following command to keep yt up to date from the @@ -529,8 +481,8 @@ $ yt update -This will detect that you have installed yt from the mercurial repository, pull -any changes from Bitbucket, and then recompile yt if necessary. +This will detect that you have installed yt from the git repository, pull any +changes from GitHub, and then recompile yt if necessary. .. _testing-installation: @@ -556,8 +508,8 @@ .. _switching-between-yt-versions: -Switching versions of yt: ``yt-2.x``, ``stable``, and ``yt`` branches ---------------------------------------------------------------------- +Switching versions of yt: ``yt-2.x``, ``stable``, and ``master`` branches +------------------------------------------------------------------------- Here we explain how to switch between different development branches of yt. @@ -594,10 +546,10 @@ --- Version = 3.3-dev - Changeset = d8eec89b2c86 (yt) tip + Changeset = d8eec89b2c86 --- -i.e. it refers to a specific changeset in the yt mercurial repository, then +i.e. it refers to a specific changeset in the yt git repository, then you installed using ``INST_YT_SOURCE=1``. Conda-based installs (``INST_YT_SOURCE=0``) @@ -608,16 +560,16 @@ Source-based installs (``INST_YT_SOURCE=1``) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -You already have the mercurial repository, so you simply need to switch -which version you're using. Navigate to the root of the yt mercurial -repository, update to the desired version, and rebuild the source (some of the +You already have the git repository, so you simply need to switch +which version you're using. Navigate to the root of the yt git +repository, check out the desired version, and rebuild the source (some of the C code requires a compilation step for big changes like this): .. code-block:: bash - $ cd yt-/src/yt-hg - $ hg update - $ python setup.py develop + $ cd yt-/src/yt-git + $ git checkout + $ pip install -e . Valid versions to jump to are described in :ref:`branches-of-yt`. @@ -628,23 +580,22 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++ If you have installed python via ``pip``, remove -any extant installations of yt on your system and clone the source mercurial +any extant installations of yt on your system and clone the git repository of yt as described in :ref:`source-installation`. .. code-block:: bash $ pip uninstall yt - $ hg clone https://bitbucket.org/yt_analysis/yt + $ git clone https://github.com/yt-project/yt -Now, to switch between versions, you need to navigate to the root of -the mercurial yt repository. Use mercurial to -update to the appropriate version and recompile. +Now, to switch between versions, you need to navigate to the root of the git yt +repository. Use git to update to the appropriate version and recompile. .. code-block:: bash $ cd yt - $ hg update - $ python setup.py install --user --prefix= + $ git checkout + $ pip install . --user --install-option="--prefix=" Valid versions to jump to are described in :ref:`branches-of-yt`). diff -Nru yt-3.3.3/doc/source/quickstart/6)_Volume_Rendering.ipynb yt-3.4.0/doc/source/quickstart/6)_Volume_Rendering.ipynb --- yt-3.3.3/doc/source/quickstart/6)_Volume_Rendering.ipynb 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/quickstart/6)_Volume_Rendering.ipynb 2017-08-10 18:02:57.000000000 +0000 @@ -93,12 +93,12 @@ "\n", "source = sc.sources['source_00']\n", "\n", - "source.set_fields('density', no_ghost=False)\n", + "source.field = 'density'\n", "\n", "tf = yt.ColorTransferFunction((-28, -25))\n", "tf.add_layers(4, w=0.03)\n", "\n", - "source.set_transfer_function(tf)\n", + "source.transfer_function = tf\n", "\n", "sc.show(sigma_clip=4.0)" ] diff -Nru yt-3.3.3/doc/source/quickstart/index.rst yt-3.4.0/doc/source/quickstart/index.rst --- yt-3.3.3/doc/source/quickstart/index.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/quickstart/index.rst 2017-08-10 17:56:56.000000000 +0000 @@ -25,11 +25,11 @@ If you're running the tutorial from your own system and you do not already have the yt repository, the easiest way to get the repository is to clone it using -mercurial: +git: .. code-block:: bash - hg clone https://bitbucket.org/yt_analysis/yt + git clone https://github.com/yt-project/yt Now start the IPython notebook from within the repository (we presume you have yt installed): diff -Nru yt-3.3.3/doc/source/reference/api/api.rst yt-3.4.0/doc/source/reference/api/api.rst --- yt-3.3.3/doc/source/reference/api/api.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/reference/api/api.rst 2017-08-10 18:02:57.000000000 +0000 @@ -10,7 +10,6 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. autosummary:: - :toctree: generated/ ~yt.visualization.plot_window.SlicePlot ~yt.visualization.plot_window.AxisAlignedSlicePlot @@ -19,12 +18,12 @@ ~yt.visualization.plot_window.OffAxisProjectionPlot ~yt.visualization.plot_window.WindowPlotMPL ~yt.visualization.plot_window.PlotWindow + ~yt.visualization.plot_window.plot_2d ProfilePlot and PhasePlot ^^^^^^^^^^^^^^^^^^^^^^^^^ .. autosummary:: - :toctree: generated/ ~yt.visualization.profile_plotter.ProfilePlot ~yt.visualization.profile_plotter.PhasePlot @@ -34,7 +33,6 @@ ^^^^^^^^^^^^^^ .. autosummary:: - :toctree: generated/ ~yt.visualization.particle_plots.ParticleProjectionPlot ~yt.visualization.particle_plots.ParticlePhasePlot @@ -44,14 +42,23 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. autosummary:: - :toctree: generated/ ~yt.visualization.fixed_resolution.FixedResolutionBuffer ~yt.visualization.fixed_resolution.ParticleImageBuffer ~yt.visualization.fixed_resolution.CylindricalFixedResolutionBuffer - ~yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer ~yt.visualization.fixed_resolution.OffAxisProjectionFixedResolutionBuffer +Writing FITS images +^^^^^^^^^^^^^^^^^^^ + +.. autosummary:: + + ~yt.visualization.fits_image.FITSImageData + ~yt.visualization.fits_image.FITSSlice + ~yt.visualization.fits_image.FITSProjection + ~yt.visualization.fits_image.FITSOffAxisSlice + ~yt.visualization.fits_image.FITSOffAxisProjection + Data Sources ------------ @@ -70,7 +77,6 @@ These will almost never need to be instantiated on their own. .. autosummary:: - :toctree: generated/ ~yt.data_objects.data_containers.YTDataContainer ~yt.data_objects.data_containers.YTSelectionContainer @@ -86,7 +92,6 @@ geometric. .. autosummary:: - :toctree: generated/ ~yt.data_objects.selection_data_containers.YTPoint ~yt.data_objects.selection_data_containers.YTOrthoRay @@ -109,7 +114,6 @@ expensive set of intermediate data. .. autosummary:: - :toctree: generated/ ~yt.data_objects.construction_data_containers.YTStreamline ~yt.data_objects.construction_data_containers.YTQuadTreeProj @@ -125,12 +129,12 @@ datasets. .. autosummary:: - :toctree: generated/ ~yt.data_objects.time_series.DatasetSeries ~yt.data_objects.time_series.DatasetSeriesObject ~yt.data_objects.time_series.TimeSeriesQuantitiesContainer ~yt.data_objects.time_series.AnalysisTaskProxy + ~yt.data_objects.particle_trajectories.ParticleTrajectories Geometry Handlers ----------------- @@ -138,7 +142,6 @@ These objects generate an "index" into multiresolution data. .. autosummary:: - :toctree: generated/ ~yt.geometry.geometry_handler.Index ~yt.geometry.grid_geometry_handler.GridIndex @@ -152,27 +155,32 @@ These classes and functions enable yt's symbolic unit handling system. .. autosummary:: - :toctree: generated/ yt.data_objects.static_output.Dataset.arr yt.data_objects.static_output.Dataset.quan + ~yt.units.unit_object.define_unit ~yt.units.unit_object.Unit ~yt.units.unit_registry.UnitRegistry + ~yt.units.unit_systems.UnitSystem ~yt.units.yt_array.YTArray ~yt.units.yt_array.YTQuantity - + ~yt.units.yt_array.uconcatenate + ~yt.units.yt_array.uintersect1d + ~yt.units.yt_array.uunion1d + ~yt.units.yt_array.unorm + ~yt.units.yt_array.udot + ~yt.units.yt_array.uvstack + ~yt.units.yt_array.uhstack Frontends --------- .. autosummary:: - :toctree: generated/ ARTIO ^^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.artio.data_structures.ARTIOIndex ~yt.frontends.artio.data_structures.ARTIOOctreeSubset @@ -187,7 +195,6 @@ ^^^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.athena.data_structures.AthenaGrid ~yt.frontends.athena.data_structures.AthenaHierarchy @@ -195,11 +202,10 @@ ~yt.frontends.athena.fields.AthenaFieldInfo ~yt.frontends.athena.io.IOHandlerAthena -Boxlib -^^^^^^ +AMReX/Boxlib +^^^^^^^^^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.boxlib.data_structures.BoxlibGrid ~yt.frontends.boxlib.data_structures.BoxlibHierarchy @@ -218,7 +224,6 @@ ^^^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.chombo.data_structures.ChomboGrid ~yt.frontends.chombo.data_structures.ChomboHierarchy @@ -232,7 +237,6 @@ ^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.enzo.answer_testing_support.ShockTubeTest ~yt.frontends.enzo.data_structures.EnzoGrid @@ -257,7 +261,6 @@ ^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.fits.data_structures.FITSGrid ~yt.frontends.fits.data_structures.FITSHierarchy @@ -269,7 +272,6 @@ ^^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.flash.data_structures.FLASHGrid ~yt.frontends.flash.data_structures.FLASHHierarchy @@ -281,7 +283,6 @@ ^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.gdf.data_structures.GDFGrid ~yt.frontends.gdf.data_structures.GDFHierarchy @@ -292,7 +293,6 @@ ^^^^^^^^^^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.halo_catalog.data_structures.HaloCatalogHDF5File ~yt.frontends.halo_catalog.data_structures.HaloCatalogDataset @@ -312,7 +312,6 @@ ^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.moab.data_structures.MoabHex8Hierarchy ~yt.frontends.moab.data_structures.MoabHex8Mesh @@ -323,11 +322,24 @@ ~yt.frontends.moab.io.IOHandlerMoabH5MHex8 ~yt.frontends.moab.io.IOHandlerMoabPyneHex8 +OpenPMD +^^^^^^^ + +.. autosummary:: + + ~yt.frontends.open_pmd.data_structures.OpenPMDGrid + ~yt.frontends.open_pmd.data_structures.OpenPMDHierarchy + ~yt.frontends.open_pmd.data_structures.OpenPMDDataset + ~yt.frontends.open_pmd.fields.OpenPMDFieldInfo + ~yt.frontends.open_pmd.io.IOHandlerOpenPMDHDF5 + ~yt.frontends.open_pmd.misc.parse_unit_dimension + ~yt.frontends.open_pmd.misc.is_const_component + ~yt.frontends.open_pmd.misc.get_component + RAMSES ^^^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.ramses.data_structures.RAMSESDomainFile ~yt.frontends.ramses.data_structures.RAMSESDomainSubset @@ -340,7 +352,6 @@ ^^^^^^^^^^^^^^^^^^^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.gadget.data_structures.GadgetBinaryFile ~yt.frontends.gadget.data_structures.GadgetHDF5Dataset @@ -362,7 +373,6 @@ ^^^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.stream.data_structures.StreamDictFieldHandler ~yt.frontends.stream.data_structures.StreamGrid @@ -388,7 +398,6 @@ ^^^^^^ .. autosummary:: - :toctree: generated/ ~yt.frontends.ytdata.data_structures.YTDataContainerDataset ~yt.frontends.ytdata.data_structures.YTSpatialPlotDataset @@ -399,6 +408,8 @@ ~yt.frontends.ytdata.data_structures.YTNonspatialHierarchy ~yt.frontends.ytdata.data_structures.YTNonspatialGrid ~yt.frontends.ytdata.data_structures.YTProfileDataset + ~yt.frontends.ytdata.data_structures.YTClumpTreeDataset + ~yt.frontends.ytdata.data_structures.YTClumpContainer ~yt.frontends.ytdata.fields.YTDataContainerFieldInfo ~yt.frontends.ytdata.fields.YTGridFieldInfo ~yt.frontends.ytdata.io.IOHandlerYTDataContainerHDF5 @@ -410,7 +421,6 @@ ------------ .. autosummary:: - :toctree: generated/ ~yt.convenience.load ~yt.convenience.simulation @@ -433,7 +443,6 @@ .. autosummary:: - :toctree: generated/ ~yt.data_objects.profiles.ProfileND ~yt.data_objects.profiles.Profile1D @@ -442,6 +451,25 @@ ~yt.data_objects.profiles.ParticleProfile ~yt.data_objects.profiles.create_profile +.. _clump_finding_ref: + +Clump Finding +^^^^^^^^^^^^^ + +The ``Clump`` object and associated functions can be used for identification +of topologically disconnected structures, i.e., clump finding. + +.. autosummary:: + + ~yt.analysis_modules.level_sets.clump_handling.Clump + ~yt.analysis_modules.level_sets.clump_handling.Clump.add_info_item + ~yt.analysis_modules.level_sets.clump_handling.Clump.add_validator + ~yt.analysis_modules.level_sets.clump_handling.Clump.save_as_dataset + ~yt.analysis_modules.level_sets.clump_handling.find_clumps + ~yt.analysis_modules.level_sets.clump_handling.get_lowest_clumps + ~yt.analysis_modules.level_sets.clump_info_items.add_clump_info + ~yt.analysis_modules.level_sets.clump_validators.add_validator + .. _halo_analysis_ref: Halo Analysis @@ -451,7 +479,6 @@ on cosmological halos. It is also the primary interface for halo finding. .. autosummary:: - :toctree: generated/ ~yt.analysis_modules.halo_analysis.halo_catalog.HaloCatalog ~yt.analysis_modules.halo_analysis.halo_finding_methods.HaloFindingMethod @@ -482,7 +509,6 @@ to use the ``HaloCatalog``. .. autosummary:: - :toctree: generated/ ~yt.analysis_modules.halo_finding.halo_objects.FOFHaloFinder ~yt.analysis_modules.halo_finding.halo_objects.HOPHaloFinder @@ -497,7 +523,6 @@ .. autosummary:: - :toctree: generated/ ~yt.analysis_modules.two_point_functions.two_point_functions.TwoPointFunctions ~yt.analysis_modules.two_point_functions.two_point_functions.FcnSet @@ -506,7 +531,6 @@ ----------- .. autosummary:: - :toctree: generated/ ~yt.fields.field_info_container.FieldInfoContainer ~yt.fields.derived_field.DerivedField @@ -520,7 +544,6 @@ --------------- .. autosummary:: - :toctree: generated/ ~yt.fields.field_info_container.FieldInfoContainer.add_field ~yt.data_objects.static_output.Dataset.add_field @@ -530,7 +553,6 @@ ---------------- .. autosummary:: - :toctree: generated/ ~yt.data_objects.particle_filters.add_particle_filter ~yt.data_objects.particle_filters.particle_filter @@ -543,7 +565,6 @@ writing to bitmaps. .. autosummary:: - :toctree: generated/ ~yt.data_objects.image_array.ImageArray @@ -557,7 +578,6 @@ .. autosummary:: - :toctree: generated/ ~yt.analysis_modules.star_analysis.sfr_spectrum.StarFormationRate ~yt.analysis_modules.star_analysis.sfr_spectrum.SpectrumBuilder @@ -567,7 +587,6 @@ .. autosummary:: - :toctree: generated/ ~yt.analysis_modules.cosmological_observation.light_cone.light_cone.LightCone ~yt.analysis_modules.cosmological_observation.light_ray.light_ray.LightRay @@ -575,23 +594,20 @@ Absorption and X-ray spectra and spectral lines: .. autosummary:: - :toctree: generated/ ~yt.analysis_modules.absorption_spectrum.absorption_spectrum.AbsorptionSpectrum - ~yt.analysis_modules.spectral_integrator.spectral_frequency_integrator.EmissivityIntegrator - ~yt.analysis_modules.spectral_integrator.spectral_frequency_integrator.add_xray_emissivity_field + ~yt.fields.xray_emission_fields.XrayEmissivityIntegrator + ~yt.fields.xray_emission_fields.add_xray_emissivity_field Absorption spectra fitting: .. autosummary:: - :toctree: generated/ ~yt.analysis_modules.absorption_spectrum.absorption_spectrum_fit.generate_total_fit Sunrise exporting: .. autosummary:: - :toctree: generated/ ~yt.analysis_modules.sunrise_export.sunrise_exporter.export_to_sunrise ~yt.analysis_modules.sunrise_export.sunrise_exporter.export_to_sunrise_from_halolist @@ -599,7 +615,6 @@ RADMC-3D exporting: .. autosummary:: - :toctree: generated/ ~yt.analysis_modules.radmc3d_export.RadMC3DInterface.RadMC3DLayer ~yt.analysis_modules.radmc3d_export.RadMC3DInterface.RadMC3DWriter @@ -613,7 +628,6 @@ Scene infrastructure: .. autosummary:: - :toctree: generated/ ~yt.visualization.volume_rendering.volume_rendering.volume_render ~yt.visualization.volume_rendering.volume_rendering.create_scene @@ -625,7 +639,6 @@ The different kinds of sources: .. autosummary:: - :toctree: generated/ ~yt.visualization.volume_rendering.render_source.RenderSource ~yt.visualization.volume_rendering.render_source.VolumeSource @@ -639,7 +652,6 @@ The different kinds of transfer functions: .. autosummary:: - :toctree: generated/ ~yt.visualization.volume_rendering.transfer_functions.TransferFunction ~yt.visualization.volume_rendering.transfer_functions.ColorTransferFunction @@ -651,7 +663,6 @@ The different kinds of lenses: .. autosummary:: - :toctree: generated/ ~yt.visualization.volume_rendering.lens.Lens ~yt.visualization.volume_rendering.lens.PlaneParallelLens @@ -668,7 +679,6 @@ .. autosummary:: - :toctree: generated/ ~yt.visualization.streamlines.Streamlines @@ -681,7 +691,6 @@ .. autosummary:: - :toctree: generated/ ~yt.visualization.image_writer.multi_image_composite ~yt.visualization.image_writer.write_bitmap @@ -696,7 +705,6 @@ particularly with complicated layouts. .. autosummary:: - :toctree: generated/ ~yt.visualization.eps_writer.DualEPS ~yt.visualization.eps_writer.single_plot @@ -713,7 +721,6 @@ .. autosummary:: - :toctree: generated/ ~yt.data_objects.derived_quantities.DerivedQuantity ~yt.data_objects.derived_quantities.DerivedQuantityCollection @@ -739,7 +746,6 @@ See also :ref:`callbacks`. .. autosummary:: - :toctree: generated/ ~yt.visualization.plot_window.PWViewerMPL.annotate_clear ~yt.visualization.plot_modifications.ArrowCallback @@ -773,7 +779,6 @@ See also :ref:`colormaps`. .. autosummary:: - :toctree: generated/ ~yt.visualization.color_maps.add_cmap ~yt.visualization.color_maps.make_colormap @@ -784,7 +789,6 @@ .. autosummary:: - :toctree: generated/ ~yt.convenience.load ~yt.frontends.ytdata.utilities.save_as_dataset @@ -820,7 +824,6 @@ .. autosummary:: - :toctree: generated/ ~yt.utilities.math_utils.periodic_position ~yt.utilities.math_utils.periodic_dist @@ -855,7 +858,6 @@ .. autosummary:: - :toctree: generated/ ~yt.config.YTConfigParser ~yt.utilities.parameter_file_storage.ParameterFileStore @@ -869,7 +871,6 @@ -------------------- .. autosummary:: - :toctree: generated/ ~yt.utilities.cosmology.Cosmology ~yt.utilities.cosmology.Cosmology.hubble_distance @@ -886,6 +887,7 @@ ~yt.utilities.cosmology.Cosmology.expansion_factor ~yt.utilities.cosmology.Cosmology.z_from_t ~yt.utilities.cosmology.Cosmology.t_from_z + ~yt.utilities.cosmology.Cosmology.get_dark_factor Testing Infrastructure ---------------------- @@ -893,7 +895,6 @@ The first set of functions are all provided by NumPy. .. autosummary:: - :toctree: generated/ ~yt.testing.assert_array_equal ~yt.testing.assert_almost_equal @@ -909,7 +910,6 @@ These are yt-provided functions: .. autosummary:: - :toctree: generated/ ~yt.testing.assert_rel_equal ~yt.testing.amrspace diff -Nru yt-3.3.3/doc/source/reference/changelog.rst yt-3.4.0/doc/source/reference/changelog.rst --- yt-3.3.3/doc/source/reference/changelog.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/reference/changelog.rst 2017-08-10 18:09:33.000000000 +0000 @@ -11,6 +11,295 @@ The `CREDITS file `_ contains the most up-to-date list of everyone who has contributed to the yt source code. +Version 3.4 +----------- + +Version 3.4 is the first major release of yt since July 2016. It includes 450 +pull requests from 44 contributors including 18 new contributors. + +- yt now supports displaying plots using the interactive matplotlib + backends. To enable this functionality call + ``yt.toggle_interactivity()``. This is currently supported at an + experimental level, please let us know if you come across issues + using it. See `Bitbucket PR + 2294 `__. +- The yt configuration file should now be located in a location + following the XDG\_CONFIG convention (usually ``~/.config/yt/ytrc``) + rather than the old default location (usually ``~/.yt/config``). You + can use ``yt config migrate`` at the bash command line to migrate + your configuration file to the new location. See `Bitbucket PR + 2343 `__. +- Added ``yt.LinePlot``, a new plotting class for creating 1D plots + along lines through a dataset. See `Github PR + 1509 `__ and `Github PR + 1440 `__. +- Added ``yt.define_unit`` to easily define new units in yt's unit + system. See `Bitbucket PR + 2485 `__. +- Added ``yt.plot_2d``, a wrapper around SlicePlot for plotting 2D + datasets. See `Github PR + 1476 `__. +- We have restored support for boolean data objects. Boolean objects + are data objects that are defined in terms of boolean operations on + other data objects. See `Bitbucket PR + 2257 `__. +- Datasets now have a ``fields`` attribute that allows access to fields + via a python object. For example, instead of using a tuple field name + like ``('gas', 'density')``, one can now use + ``ds.fields.gas.density``. See `Bitbucket PR + 2459 `__. +- It is now possible to create a wider variety of data objects via + ``ds.r``, including rays, fixed resolution rays, points, and images. + See `Github PR 1518 `__ + and `Github PR 1393 `__. +- ``add_field`` and ``ds.add_field`` must now be called with a + ``sampling_type`` keyword argument. Possible values are currently + ``cell`` and ``particle``. We have also deprecated the + ``particle_type`` keyword argument in favor of + ``sampling_type='cell'``. For now a ``'cell'`` ``sampling_type`` is + assumed if ``sampling_type`` is not specified but in the future + ``sampling_type`` will always need to be specified. +- Added support for the ``Athena++`` code. See `Bitbucket PR + 2149 `__. +- Added support for the ``Enzo-p`` code. See `Github PR + 1447 `__, `Github PR + 1443 `__ and `Github PR + 1439 `__. +- Added support for the ``AMReX`` code. See `Bitbucket PR + 2530 `__. +- Added support for the ``openPMD`` output format. See `Bitbucket PR + 2376 `__. +- Added support for reading face-centered and vertex-centered fields + for block AMR codes. See `Bitbucket PR + 2575 `__. +- Added support for loading outputs from the Amiga Halo Finder. See + `Github PR 1477 `__. +- Added support for particle fields for Boxlib data. See `Bitbucket PR + 2510 `__ and + `Bitbucket PR + 2497 `__. +- Added support for custom RAMSES particle fields. See `Github PR + 1470 `__. +- Added support for RAMSES-RT data. See `Github PR + 1456 `__ and `Github PR + 1449 `__. +- Added support for Enzo MHDCT fields. See `Github PR + 1438 `__. +- Added support for units and particle fields to the GAMER frontend. + See `Bitbucket PR + 2366 `__ and + `Bitbucket PR + 2408 `__. +- Added support for type 2 Gadget binary outputs. See `Bitbucket PR + 2355 `__. +- Added the ability to detect and read double precision Gadget data. + See `Bitbucket PR + 2537 `__. +- Added the ability to detect and read in big endian Gadget data. See + `Github PR 1353 `__. +- Added support for Nyx datasets that do not contain particles. See + `Bitbucket PR + 2571 `__ +- A number of untested and unmaintained modules have been deprecated + and moved to the `yt attic + repository `__. This includes + the functionality for calculating two point functions, the Sunrise + exporter, the star analysis module, and the functionality for + calculating halo mass functions. If you are interested in working on + restoring the functionality in these modules, we welcome + contributions. Please contact us on the mailing list or by opening an + issue on GitHub if you have questions. +- The particle trajectories functionality has been removed from the + analysis modules API and added as a method of the ``DatasetSeries`` + object. You can now create a ``ParticleTrajectories`` object using + ``ts.particle_trajectories()`` where ``ts`` is a time series of + datasets. +- The ``spectral_integrator`` analysis module is now available via + ``yt.fields.xray_emission_fields``. See `Bitbucket PR + 2465 `__. +- The ``photon_simulator`` analysis module has been deprecated in favor + of the ``pyXSIM`` package, available separately from ``yt``. See + `Bitbucket PR + 2441 `__. +- ``yt.utilities.fits_image`` is now available as + ``yt.visualization.fits_image``. In addition classes that were in the + ``yt.utilities.fits_image`` namespace are now available in the main + ``yt`` namespace. +- The ``profile.variance`` attribute has been deprecated in favor of + ``profile.standard_deviation``. +- The ``number_of_particles`` key no longer needs to be defined when + loading data via the stream frontend. See `Github PR + 1428 `__. +- The install script now only supports installing via miniconda. We + have removed support for compiling python and yt's dependencies from + source. See `Github PR + 1459 `__. +- Added ``plot.set_background_color`` for ``PlotWindow`` and + ``PhasePlot`` plots. This lets users specify a color to fill in the + background of a plot instead of the default color, white. See + `Bitbucket PR + 2513 `__. +- ``PlotWindow`` plots can now optionally use a right-handed coordinate + system. See `Bitbucket PR + 2318 `__. +- The isocontour API has been overhauled to make use of units. See + `Bitbucket PR + 2453 `__. +- ``Dataset`` instances now have a ``checksum`` property, which can be + accessed via ``ds.checksum``. This provides a unique identifier that + is guaranteed to be the same from session to session. See `Bitbucket + PR 2503 `__. +- Added a ``data_source`` keyword argument to + ``OffAxisProjectionPlot``. See `Bitbucket PR + 2490 `__. +- Added a ``yt download`` command-line helper to download test data + from http://yt-project.org/data. For more information see + ``yt download --help`` at the bash command line. See `Bitbucket PR + 2495 `__ and + `Bitbucket PR + 2471 `__. +- Added a ``yt upload`` command-line helper to upload files to the `yt + curldrop `__ at the bash + command line. See `Github PR + 1471 `__. +- If it's installed, colormaps from the `cmocean + package `__ will be made available as + yt colormaps. See `Bitbucket PR + 2439 `__. +- It is now possible to visualize unstructured mesh fields defined on + multiple mesh blocks. See `Bitbucket PR + 2487 `__. +- Add support for second-order interpolation when slicing tetrahedral + unstructured meshes. See `Bitbucket PR + 2550 `__. +- Add support for volume rendering second-order tetrahedral meshes. See + `Bitbucket PR + 2401 `__. +- Add support for QUAD9 mesh elements. See `Bitbucket PR + 2549 `__. +- Add support for second-order triangle mesh elements. See `Bitbucket + PR 2378 `__. +- Added support for dynamical dark energy parameterizations to the + ``Cosmology`` object. See `Bitbucket PR + 2572 `__. +- ``ParticleProfile`` can now handle log-scaled bins and data with + negative values. See `Bitbucket PR + 2564 `__ and + `Github PR 1510 `__. +- Cut region data objects can now be saved as reloadable datasets using + ``save_as_dataset``. See `Bitbucket PR + 2541 `__. +- Clump objects can now be saved as reloadable datasets using + ``save_as_dataset``. See `Bitbucket PR + 2326 `__. +- It is now possible to specify the field to use for the size of the + circles in the ``annotate_halos`` plot modifying function. See + `Bitbucket PR + 2493 `__. +- The ``ds.max_level`` attribute is now a property that is computed on + demand. The more verbose ``ds.index.max_level`` will continue to + work. See `Bitbucket PR + 2461 `__. +- The ``PointSource`` volume rendering source now optionally accepts a + ``radius`` keyword argument to draw spatially extended points. See + `Bitbucket PR + 2404 `__. +- It is now possible to save volume rendering images in eps, ps, and + pdf format. See `Github PR + 1504 `__. + +Minor Enhancements and Bugfixes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Fixed issue selecting and visualizing data at very high AMR levels. + See `Github PR 1521 `__ + and `Github PR 1433 `__. +- Print a more descriptive error message when defining a particle + filter fails with missing fields See `Github PR + 1517 `__. +- Removed grid edge rounding from the FLASH frontend. This fixes a + number of pernicious visualization artifacts for FLASH data. See + `Github PR 1493 `__. +- Parallel projections no longer error if there are less io chunks than + MPI tasks. See `Github PR + 1488 `__. +- A memory leak in the volume renderer has been fixed. See `Github PR + 1485 `__ and `Github PR + 1435 `__. +- The ``force_override`` keyword argument now raises an error when used + with on-disk fields. See `Github PR + 1516 `__. +- Restore support for making plots from reloaded plots. See `Github PR + 1514 `__ +- Don't ever try to read inputs or probin files for Castro and Maestro. + See `Github PR 1445 `__. +- Fixed issue that caused visualization artifacts when creating an + off-axis projection for particle or octree AMR data. See `Github PR + 1434 `__. +- Fix i/o for the Enzo ``'Dark_Matter_Density'`` field. See `Github PR + 1360 `__. +- Create the ``'particle_ones'`` field even if we don't have a particle + mass field. See `Github PR + 1424 `__. +- Fixed issues with minor colorbar ticks with symlog colorbar scaling. + See `Github PR 1423 `__. +- Using the rockstar halo finder is now supported under Python3. See + `Github PR 1414 `__. +- Fixed issues with orientations of volume renderings when compositing + multiple sources. See `Github PR + 1411 `__. +- Added a check for valid AMR structure in ``load_amr_grids``. See + `Github PR 1408 `__. +- Fix bug in handling of periodic boundary conditions in the + ``annotate_halos`` plot modifying function. See `Github PR + 1351 `__. +- Add support for plots with non-unit aspect ratios to the + ``annotate_scale`` plot modifying function. See `Bitbucket PR + 2551 `__. +- Fixed issue with saving light ray datasets. See `Bitbucket PR + 2589 `__. +- Added support for 2D WarpX data. ee `Bitbucket PR + 2583 `__. +- Ensure the ``particle_radius`` field is always accessed with the + correct field type. See `Bitbucket PR + 2562 `__. +- It is now possible to use a covering grid to access particle filter + fields. See `Bitbucket PR + 2569 `__. +- The x limits of a ``ProfilePlot`` will now snap exactly to the limits + specified in calls to ``ProfilePlot.set_xlim``. See `Bitbucket PR + 2546 `__. +- Added a cookbook example showing how to make movies using + matplotlib's animation framework. See `Bitbucket PR + 2544 `__. +- Use a parallel-safe wrapper around mkdir when creating new + directories. See `Bitbucket PR + 2570 `__. +- Removed ``yt.utilities.spatial``. This was a forked version of + ``scipy.spatial`` with support for a periodic KD-tree. Scipy now has + a periodic KD-tree, so we have removed the forked version from yt. + Please use ``scipy.spatial`` if you were relying on + ``yt.utilities.spatial``. See `Bitbucket PR + 2576 `__. +- Improvements for the ``HaloCatalog``. See `Bitbucket PR + 2536 `__ and + `Bitbucket PR + 2535 `__. +- Removed ``'log'`` in colorbar label in annotated volume rendering. + See `Bitbucket PR + 2548 `__ +- Fixed a crash triggered by depositing particle data onto a covering + grid. See `Bitbucket PR + 2545 `__. +- Ensure field type guessing is deterministic on Python3. See + `Bitbucket PR + 2559 `__. +- Removed unused yt.utilities.exodusII\_reader module. See `Bitbucket + PR 2533 `__. +- The ``cell_volume`` field in curvilinear coordinates now uses an + exact rather than an approximate definition. See `Bitbucket PR + 2466 `__. + Version 3.3 ----------- @@ -921,7 +1210,7 @@ * WebGL interface for isocontours and a pannable map widget added to Reason * Performance improvements for volume rendering * Adaptive HEALPix support - * Column density calculations (see :ref:`radial-column-density`) + * Column density calculations * Massive speedup for 1D profiles * Lots more, bug fixes etc. * Substantial improvements to the documentation, including @@ -941,7 +1230,7 @@ * An order of magnitude speed improvement in the RAMSES support * Quad-tree projections, speeding up the process of projecting by up to an order of magnitude and providing better load balancing - * “mapserver” for in-browser, Google Maps-style slice and projection + * "mapserver" for in-browser, Google Maps-style slice and projection visualization (see :ref:`mapserver`) * Many bug fixes and performance improvements * Halo loader @@ -1043,9 +1332,9 @@ ----------- Version 1.6 is a point release, primarily notable for the new parallel halo -finder (see :ref:`halo_finding`) +finder (see :ref:`halo-analysis`) - * (New) Parallel HOP ( http://arxiv.org/abs/1001.3411 , :ref:`halo_finding` ) + * (New) Parallel HOP ( http://arxiv.org/abs/1001.3411 , :ref:`halo-analysis` ) * (Beta) Software ray casting and volume rendering (see :ref:`volume_rendering`) * Rewritten, faster and better contouring engine for clump identification diff -Nru yt-3.3.3/doc/source/reference/code_support.rst yt-3.4.0/doc/source/reference/code_support.rst --- yt-3.3.3/doc/source/reference/code_support.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/reference/code_support.rst 2017-08-10 18:02:57.000000000 +0000 @@ -22,7 +22,7 @@ +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ | Athena | Y | N | Y | Y | Y | Y | Y | Full | +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ -| Castro | Y | N | Partial | Y | Y | Y | N | Full | +| Castro | Y | Y [#f3]_ | Partial | Y | Y | Y | N | Full | +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ | Chombo | Y | Y | Y | Y | Y | Y | Y | Full | +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ @@ -34,7 +34,7 @@ +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ | Gadget | Y | Y | Y | Y | Y [#f2]_ | Y | Y | Full | +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ -| GAMER | Y | N | Y | Y | Y | Y | Y | Full | +| GAMER | Y | Y | Y | Y | Y | Y | Y | Full | +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ | Gasoline | Y | Y | Y | Y | Y [#f2]_ | Y | Y | Full | +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ @@ -46,7 +46,9 @@ +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ | MOAB | Y | N/A | Y | Y | Y | Y | Y | Full | +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ -| Nyx | Y | N | Y | Y | Y | Y | Y | Full | +| Nyx | Y | Y | Y | Y | Y | Y | Y | Full | ++-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ +| openPMD | Y | Y | N | Y | Y | Y | N | Partial | +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ | Orion | Y | Y | Y | Y | Y | Y | Y | Full | +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ @@ -60,11 +62,14 @@ +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ | Tipsy | Y | Y | Y | Y | Y [#f2]_ | Y | Y | Full | +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ +| WarpX | Y | Y | Y | Y | Y | Y | Y | Full | ++-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ .. [#f1] one-dimensional base-state not read in currently. .. [#f2] These handle mesh fields using an in-memory octree that has not been parallelized. Datasets larger than approximately 1024^3 will not scale well. - +.. [#f3] Newer versions of Castro that use BoxLib's standard particle format are supported. + The older ASCII format is not. If you have a dataset that uses an output format not yet supported by yt, you can either input your data following :ref:`loading-numpy-array` or diff -Nru yt-3.3.3/doc/source/reference/command-line.rst yt-3.4.0/doc/source/reference/command-line.rst --- yt-3.3.3/doc/source/reference/command-line.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/reference/command-line.rst 2017-08-10 18:02:57.000000000 +0000 @@ -54,35 +54,7 @@ This will print the list of available subcommands, -.. code-block:: bash - - help Print help message - bootstrap_dev Bootstrap a yt development environment - bugreport Report a bug in yt - hub_register Register a user on the Hub: http://hub.yt-project.org/ - hub_submit Submit a mercurial repository to the yt Hub - (http://hub.yt-project.org/), creating a BitBucket - repo in the process if necessary. - instinfo Get some information about the yt installation - version Get some information about the yt installation (this - is an alias for instinfo). - load Load a single dataset into an IPython instance - mapserver Serve a plot in a GMaps-style interface - pastebin Post a script to an anonymous pastebin - pastebin_grab Print an online pastebin to STDOUT for local use. - upload_notebook Upload an IPython notebook to hub.yt-project.org. - plot Create a set of images - rpdb Connect to a currently running (on localhost) rpd - session. Commands run with --rpdb will trigger an rpdb - session with any uncaught exceptions. - notebook Run the IPython Notebook - stats Print stats and max/min value of a given field (if - requested), for one or more datasets (default field is - Density) - update Update the yt installation to the most recent version - delete_image Delete image from imgur.com. - upload_image Upload an image to imgur.com. Must be PNG. - +.. config_help:: yt To execute any such function, simply run: @@ -102,7 +74,7 @@ First, we'll discuss plotting from the command line, then we will give a brief summary of the functionality provided by each command line subcommand. This example uses the :code:`DD0010/moving7_0010` dataset distributed in the yt -mercurial repository. +git repository. First let's see what our options are for plotting: @@ -204,6 +176,20 @@ yt pastebin_grab 1768 +upload +++++++ + +Upload a file to a public curldrop instance. Curldrop is a simple web +application that allows you to upload and download files straight from your +Terminal with an http client like e.g. curl. It was initially developed by +`Kevin Kennell `_ and later forked and +adjusted for yt’s needs. After a successful upload you will receive a url that +can be used to share the data with other people. + +.. code-block:: bash + + yt upload my_file.tar.gz + plot ++++ @@ -217,13 +203,12 @@ This command will accept the filename of a ``.ipynb`` file (generated from an IPython notebook session) and upload it to the `yt hub -` where others will be able to view it, and +`__ where others will be able to view it, and download it. This is an easy method for recording a sequence of commands, their output, narrative information, and then sharing that with others. These notebooks will be viewable online, and the appropriate URLs will be returned on the command line. - rpdb ++++ @@ -272,3 +257,123 @@ The image uploaded using ``upload_image`` is assigned with a unique hash that can be used to remove it. This subcommand provides an easy way to send a delete request directly to the `imgur.com `_. + +Hub helper +~~~~~~~~~~ + +The :code:`yt hub` command-line tool allows to interact with the `yt hub +`__. The following subcommands are currently available: + +.. config_help:: yt hub + +register +++++++++ + +This subcommand starts an interactive process of creating an account on the `yt +hub `__. Please note that the yt Hub also supports multiple OAuth +providers such as Google, Bitbucket and GitHub for authentication. +See :ref:`hub-APIkey` for more information. + +start ++++++ + +This subcommand launches the Jupyter Notebook on the `yt Hub `__ +with a chosen Hub folder mounted to the ``/data`` directory inside the notebook. +If no path is given all the `example yt datasets +`_ are mounted by default. The appropriate URL +allowing to access the Notebook will be returned on the commandline. + +Example: + +.. code-block:: bash + + $ yt hub start + $ yt hub start /user/xarthisius/Public + +download +~~~~~~~~ + +This subcommand downloads a file from http://yt-project.org/data. Using ``yt download``, +one can download a file to: + +* ``"test_data_dir"``: Save the file to the location specified in + the ``"test_data_dir"`` configuration entry for test data. +* ``"supp_data_dir"``: Save the file to the location specified in + the ``"supp_data_dir"`` configuration entry for supplemental data. +* Any valid path to a location on disk, e.g. ``/home/jzuhone/data``. + +Examples: + +.. code-block:: bash + + $ yt download apec_emissivity_v2.h5 supp_data_dir + +.. code-block:: bash + + $ yt download GasSloshing.tar.gz test_data_dir + +.. code-block:: bash + + $ yt download ZeldovichPancake.tar.gz /Users/jzuhone/workspace + +If the configuration values ``"test_data_dir"`` or ``"supp_data_dir"`` have not +been set by the user, an error will be thrown. + +Config helper +~~~~~~~~~~~~~ + +The :code:`yt config` command-line tool allows you to modify and access yt's +configuration without manually locating and opening the config file in an editor. +To get a quick list of available commands, just type: + +.. code-block:: bash + + yt config -h + +This will print the list of available subcommands: + +.. config_help:: yt config + +Since the yt version 3.3.2, the previous location of the configuration file +(``$HOME/.yt/config``) has been deprecated in favor of a location adhering to the +`XDG Base Directory Specification +`_. +(``$XDG_HOME_CONFIG/yt/ytrc``). In order to perform an automatic migration of +the old config, you are encouraged to run: + +.. code-block:: bash + + yt config migrate + +that will copy your current config file to the new location and store a backup +copy as ``$HOME/.yt/config.bak``. + +Examples +++++++++ + +Listing current content of the config file: + +.. code-block:: bash + + $ yt config list + [yt] + loglevel = 50 + +Obtaining a single config value by name: + +.. code-block:: bash + + $ yt config get yt loglevel + 50 + +Changing a single config value: + +.. code-block:: bash + + $ yt config set yt loglevel 10 + +Removing a single config entry: + +.. code-block:: bash + + $ yt config rm yt loglevel diff -Nru yt-3.3.3/doc/source/reference/configuration.rst yt-3.4.0/doc/source/reference/configuration.rst --- yt-3.3.3/doc/source/reference/configuration.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/reference/configuration.rst 2017-08-10 18:02:57.000000000 +0000 @@ -5,7 +5,7 @@ how much output it displays, loading custom fields, loading custom colormaps, accessing test datasets regardless of where you are in the file system, etc. This customization is done through :ref:`configuration-file` and -:ref:`plugin-file` both of which exist in your ``$HOME/.yt`` directory. +:ref:`plugin-file` both of which exist in your ``$HOME/.config/yt`` directory. .. _configuration-file: @@ -18,9 +18,9 @@ Configuration File Format ^^^^^^^^^^^^^^^^^^^^^^^^^ -yt will look for and recognize the file ``$HOME/.yt/config`` as a configuration +yt will look for and recognize the file ``$HOME/.config/yt/ytrc`` as a configuration file, containing several options that can be modified and adjusted to control -runtime behavior. For example, a sample ``$HOME/.yt/config`` file could look +runtime behavior. For example, a sample ``$HOME/.config/yt/ytrc`` file could look like: .. code-block:: none @@ -31,7 +31,17 @@ This configuration file would set the logging threshold much lower, enabling much more voluminous output from yt. Additionally, it increases the number of -datasets tracked between instantiations of yt. +datasets tracked between instantiations of yt. The configuration file can be +managed using the ``yt config`` helper. It can list, add, modify and remove +options from the configuration file, e.g.: + +.. code-block:: none + + $ yt config -h + $ yt config list + $ yt config set yt loglevel 1 + $ yt config rm yt maximumstoreddatasets + Configuration Options At Runtime ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -81,10 +91,20 @@ * ``test_data_dir`` (default: ``'/does/not/exist'``): The default path the ``load()`` function searches for datasets when it cannot find a dataset in the current directory. +* ``reconstruct_index`` (default: True): If True, grid edges for patch AMR + datasets will be adjusted such that they fall as close as possible to an + integer multiple of the local cell width. If you are working with a dataset + with a large number of grids, setting this to False can speed up loading + your dataset possibly at the cost of grid-aligned artifacts showing up in + slice visualizations. * ``notebook_password`` (default: empty): If set, this will be fed to the IPython notebook created by ``yt notebook``. Note that this should be an sha512 hash, not a plaintext password. Starting ``yt notebook`` with no setting will provide instructions for setting this. +* ``requires_ds_strict`` (default: ``'True'``): If true, answer tests wrapped + with :func:`~yt.utilities.answer_testing.framework.requires_ds` will raise + :class:`~yt.utilities.exceptions.YTOutputNotIdentified` rather than consuming + it if required dataset is not present. * ``serialize`` (default: ``'False'``): If true, perform automatic :ref:`object serialization ` * ``sketchfab_api_key`` (default: empty): API key for https://sketchfab.com/ for @@ -95,6 +115,8 @@ to stdout rather than stderr * ``skip_dataset_cache`` (default: ``'False'``): If true, automatic caching of datasets is turned off. +* ``supp_data_dir`` (default: ``'/does/not/exist'``): The default path certain + submodules of yt look in for supplemental data files. .. _plugin-file: @@ -118,9 +140,10 @@ Plugin File Format ^^^^^^^^^^^^^^^^^^ -yt will look for and recognize the file ``$HOME/.yt/my_plugins.py`` as a plugin -file, which should contain python code. If accessing yt functions and classes -they will not require the ``yt.`` prefix, because of how they are loaded. +yt will look for and recognize the file ``$HOME/.config/yt/my_plugins.py`` as a +plugin file, which should contain python code. If accessing yt functions and +classes they will not require the ``yt.`` prefix, because of how they are +loaded. For example, if I created a plugin file containing: @@ -128,7 +151,8 @@ def _myfunc(field, data): return np.random.random(data["density"].shape) - add_field("random", function=_myfunc, units='auto') + add_field('random', function=_myfunc, + dimensions='dimensionless', units='auto') then all of my data objects would have access to the field ``random``. diff -Nru yt-3.3.3/doc/source/reference/field_list.rst yt-3.4.0/doc/source/reference/field_list.rst --- yt-3.3.3/doc/source/reference/field_list.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/reference/field_list.rst 2017-08-10 18:02:57.000000000 +0000 @@ -1,4864 +1 @@ - -.. _field-list: - -Field List -========== - -This is a list of many of the fields available in yt. We have attempted to -include most of the fields that are accessible through the plugin system, as -well as the fields that are known by the frontends, however it is possible to -generate many more permutations, particularly through vector operations. For -more information about the fields framework, see :ref:`fields`. - -Some fields are recognized by specific frontends only. These are typically -fields like density and temperature that have their own names and units in -the different frontend datasets. Often, these fields are aliased to their -yt-named counterpart fields (typically 'gas' fieldtypes). For example, in -the ``FLASH`` frontend, the ``dens`` field (i.e. ``(flash, dens)``) is aliased -to the gas field density (i.e. ``(gas, density)``), similarly ``(flash, velx)`` -is aliased to ``(gas, velocity_x)``, and so on. In what follows, if a field -is aliased it will be noted. - -Try using the ``ds.field_list`` and ``ds.derived_field_list`` to view the -native and derived fields available for your dataset respectively. For example -to display the native fields in alphabetical order: - -.. notebook-cell:: - - import yt - ds = yt.load("Enzo_64/DD0043/data0043") - for i in sorted(ds.field_list): - print(i) - -To figure out out what all of the field types here mean, see -:ref:`known-field-types`. - -.. contents:: Table of Contents - :depth: 1 - :local: - :backlinks: none - -.. _yt-fields: - -Universal Fields ----------------- - -('all', 'mesh_id') -^^^^^^^^^^^^^^^^^^ - - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def particle_mesh_ids(field, data): - pos = data[ptype, coord_name] - ids = np.zeros(pos.shape[0], dtype="float64") - 1 - # This is float64 in name only. It will be properly cast inside the - # deposit operation. - #_ids = ids.view("float64") - data.deposit(pos, [ids], method = "mesh_id") - return data.apply_units(ids, "") - - -('all', 'particle_angular_momentum') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_angular_momentum(field, data): - return data[ptype, "particle_mass"] \ - * data[ptype, "particle_specific_angular_momentum"] - - -('all', 'particle_angular_momentum_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('all', 'particle_angular_momentum_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_angular_momentum_x(field, data): - return data[ptype, "particle_mass"] * \ - data[ptype, "particle_specific_angular_momentum_x"] - - -('all', 'particle_angular_momentum_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_angular_momentum_y(field, data): - return data[ptype, "particle_mass"] * \ - data[ptype, "particle_specific_angular_momentum_y"] - - -('all', 'particle_angular_momentum_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_angular_momentum_z(field, data): - return data[ptype, "particle_mass"] * \ - data[ptype, "particle_specific_angular_momentum_z"] - - -('all', 'particle_mass') -^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{g}` - * Particle Type: True - -**Field Source** - -No source available. - -('all', 'particle_ones') -^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def particle_ones(field, data): - v = np.ones(data[ptype, mass_name].shape, dtype="float64") - return data.apply_units(v, field.units) - - -('all', 'particle_position') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def particle_vectors(field, data): - v = [data[_ptype, name].in_units(field.units) - for name in names] - c = np.column_stack(v) - return data.apply_units(c, field.units) - - -('all', 'particle_position_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: True - -**Field Source** - -No source available. - -('all', 'particle_position_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: True - -**Field Source** - -No source available. - -('all', 'particle_position_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: True - -**Field Source** - -No source available. - -('all', 'particle_radial_velocity') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_velocity_radius(field, data): - """ - Radial component of the particles' velocity vectors in spherical coords - based on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = spos - pos = YTArray([data[ptype, pos % ax] for ax in "xyz"]) - vel = svel - vel = YTArray([data[ptype, vel % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - vel = vel - np.reshape(bv, (3, 1)) - sphr = get_sph_r_component(vel, theta, phi, normal) - return sphr - - -('all', 'particle_radius') -^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_radius(field, data): - return get_radius(data, "particle_position_") - - -('all', 'particle_specific_angular_momentum') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_specific_angular_momentum(field, data): - """ - Calculate the angular of a particle velocity. Returns a vector for each - particle. - """ - if data.has_field_parameter("bulk_velocity"): - bv = data.get_field_parameter("bulk_velocity") - else: bv = np.zeros(3, dtype=np.float64) - xv = data[ptype, svel % 'x'] - bv[0] - yv = data[ptype, svel % 'y'] - bv[1] - zv = data[ptype, svel % 'z'] - bv[2] - center = data.get_field_parameter('center') - coords = YTArray([data[ptype, spos % 'x'], - data[ptype, spos % 'y'], - data[ptype, spos % 'z']], dtype=np.float64) - new_shape = tuple([3] + [1]*(len(coords.shape)-1)) - r_vec = coords - np.reshape(center,new_shape) - v_vec = YTArray([xv,yv,zv], dtype=np.float64) - return np.cross(r_vec, v_vec, axis=0) - - -('all', 'particle_specific_angular_momentum_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('all', 'particle_specific_angular_momentum_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_specific_angular_momentum_x(field, data): - if data.has_field_parameter("bulk_velocity"): - bv = data.get_field_parameter("bulk_velocity") - else: bv = np.zeros(3, dtype=np.float64) - center = data.get_field_parameter('center') - y = data[ptype, spos % "y"] - center[1] - z = data[ptype, spos % "z"] - center[2] - yv = data[ptype, svel % "y"] - bv[1] - zv = data[ptype, svel % "z"] - bv[2] - return yv*z - zv*y - - -('all', 'particle_specific_angular_momentum_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_specific_angular_momentum_y(field, data): - if data.has_field_parameter("bulk_velocity"): - bv = data.get_field_parameter("bulk_velocity") - else: bv = np.zeros(3, dtype=np.float64) - center = data.get_field_parameter('center') - x = data[ptype, spos % "x"] - center[0] - z = data[ptype, spos % "z"] - center[2] - xv = data[ptype, svel % "x"] - bv[0] - zv = data[ptype, svel % "z"] - bv[2] - return -(xv*z - zv*x) - - -('all', 'particle_specific_angular_momentum_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_specific_angular_momentum_z(field, data): - if data.has_field_parameter("bulk_velocity"): - bv = data.get_field_parameter("bulk_velocity") - else: bv = np.zeros(3, dtype=np.float64) - center = data.get_field_parameter('center') - x = data[ptype, spos % "x"] - center[0] - y = data[ptype, spos % "y"] - center[1] - xv = data[ptype, svel % "x"] - bv[0] - yv = data[ptype, svel % "y"] - bv[1] - return xv*y - yv*x - - -('all', 'particle_spherical_position_phi') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_position_phi(field, data): - """ - Phi component of the particles' position vectors in spherical coords - on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = spos - pos = YTArray([data[ptype, pos % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - sphp = get_sph_phi_component(pos, phi, normal) - return sphp - - -('all', 'particle_spherical_position_radius') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_position_radius(field, data): - """ - Radial component of the particles' position vectors in spherical coords - on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = spos - pos = YTArray([data[ptype, pos % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - sphr = get_sph_r_component(pos, theta, phi, normal) - return sphr - - -('all', 'particle_spherical_position_theta') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_position_theta(field, data): - """ - Theta component of the particles' position vectors in spherical coords - on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = spos - pos = YTArray([data[ptype, pos % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - spht = get_sph_theta_component(pos, theta, phi, normal) - return spht - - -('all', 'particle_spherical_velocity_phi') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_velocity_phi(field, data): - """ - Phi component of the particles' velocity vectors in spherical coords - based on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = YTArray([data[ptype, spos % ax] for ax in "xyz"]) - vel = YTArray([data[ptype, svel % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - vel = vel - np.reshape(bv, (3, 1)) - sphp = get_sph_phi_component(vel, phi, normal) - return sphp - - -('all', 'particle_spherical_velocity_radius') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_velocity_radius(field, data): - """ - Radial component of the particles' velocity vectors in spherical coords - based on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = spos - pos = YTArray([data[ptype, pos % ax] for ax in "xyz"]) - vel = svel - vel = YTArray([data[ptype, vel % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - vel = vel - np.reshape(bv, (3, 1)) - sphr = get_sph_r_component(vel, theta, phi, normal) - return sphr - - -('all', 'particle_spherical_velocity_theta') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_velocity_theta(field, data): - """ - Theta component of the particles' velocity vectors in spherical coords - based on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = spos - pos = YTArray([data[ptype, pos % ax] for ax in "xyz"]) - vel = svel - vel = YTArray([data[ptype, vel % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - vel = vel - np.reshape(bv, (3, 1)) - spht = get_sph_theta_component(vel, theta, phi, normal) - return spht - - -('all', 'particle_velocity') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def particle_vectors(field, data): - v = [data[_ptype, name].in_units(field.units) - for name in names] - c = np.column_stack(v) - return data.apply_units(c, field.units) - - -('all', 'particle_velocity_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_velocity_magnitude(field, data): - """ M{|v|} """ - bulk_velocity = data.get_field_parameter("bulk_velocity") - if bulk_velocity is None: - bulk_velocity = np.zeros(3) - return np.sqrt((data[ptype, svel % 'x'] - bulk_velocity[0])**2 - + (data[ptype, svel % 'y'] - bulk_velocity[1])**2 - + (data[ptype, svel % 'z'] - bulk_velocity[2])**2 ) - - -('all', 'particle_velocity_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -No source available. - -('all', 'particle_velocity_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -No source available. - -('all', 'particle_velocity_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -No source available. - -('deposit', 'all_cic') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def particle_cic(field, data): - pos = data[ptype, coord_name] - d = data.deposit(pos, [data[ptype, mass_name]], method = "cic") - d = data.apply_units(d, data[ptype, mass_name].units) - d /= data["index", "cell_volume"] - return d - - -('deposit', 'all_cic_velocity_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _deposit_field(field, data): - """ - Create a grid field for particle quantities weighted by particle - mass, using cloud-in-cell deposit. - """ - pos = data[ptype, "particle_position"] - # Get back into density - pden = data[ptype, 'particle_mass'] - top = data.deposit(pos, [data[(ptype, fname)]*pden], method=method) - bottom = data.deposit(pos, [pden], method=method) - top[bottom == 0] = 0.0 - bnz = bottom.nonzero() - top[bnz] /= bottom[bnz] - d = data.ds.arr(top, input_units=units) - return d - - -('deposit', 'all_cic_velocity_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _deposit_field(field, data): - """ - Create a grid field for particle quantities weighted by particle - mass, using cloud-in-cell deposit. - """ - pos = data[ptype, "particle_position"] - # Get back into density - pden = data[ptype, 'particle_mass'] - top = data.deposit(pos, [data[(ptype, fname)]*pden], method=method) - bottom = data.deposit(pos, [pden], method=method) - top[bottom == 0] = 0.0 - bnz = bottom.nonzero() - top[bnz] /= bottom[bnz] - d = data.ds.arr(top, input_units=units) - return d - - -('deposit', 'all_cic_velocity_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _deposit_field(field, data): - """ - Create a grid field for particle quantities weighted by particle - mass, using cloud-in-cell deposit. - """ - pos = data[ptype, "particle_position"] - # Get back into density - pden = data[ptype, 'particle_mass'] - top = data.deposit(pos, [data[(ptype, fname)]*pden], method=method) - bottom = data.deposit(pos, [pden], method=method) - top[bottom == 0] = 0.0 - bnz = bottom.nonzero() - top[bnz] /= bottom[bnz] - d = data.ds.arr(top, input_units=units) - return d - - -('deposit', 'all_count') -^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def particle_count(field, data): - pos = data[ptype, coord_name] - d = data.deposit(pos, method = "count") - d = data.ds.arr(d, input_units = "cm**-3") - return data.apply_units(d, field.units) - - -('deposit', 'all_density') -^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def particle_density(field, data): - pos = data[ptype, coord_name] - mass = data[ptype, mass_name] - pos.convert_to_units("code_length") - mass.convert_to_units("code_mass") - d = data.deposit(pos, [data[ptype, mass_name]], method = "sum") - d = data.ds.arr(d, "code_mass") - d /= data["index", "cell_volume"] - return d - - -('deposit', 'all_mass') -^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{g}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def particle_mass(field, data): - pos = data[ptype, coord_name] - pmass = data[ptype, mass_name].in_units(field.units) - d = data.deposit(pos, [pmass], method = "sum") - return data.apply_units(d, field.units) - - -('deposit', 'all_nn_velocity_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _deposit_field(field, data): - """ - Create a grid field for particle quantities weighted by particle - mass, using cloud-in-cell deposit. - """ - pos = data[ptype, "particle_position"] - # Get back into density - pden = data[ptype, 'particle_mass'] - top = data.deposit(pos, [data[(ptype, fname)]*pden], method=method) - bottom = data.deposit(pos, [pden], method=method) - top[bottom == 0] = 0.0 - bnz = bottom.nonzero() - top[bnz] /= bottom[bnz] - d = data.ds.arr(top, input_units=units) - return d - - -('deposit', 'all_nn_velocity_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _deposit_field(field, data): - """ - Create a grid field for particle quantities weighted by particle - mass, using cloud-in-cell deposit. - """ - pos = data[ptype, "particle_position"] - # Get back into density - pden = data[ptype, 'particle_mass'] - top = data.deposit(pos, [data[(ptype, fname)]*pden], method=method) - bottom = data.deposit(pos, [pden], method=method) - top[bottom == 0] = 0.0 - bnz = bottom.nonzero() - top[bnz] /= bottom[bnz] - d = data.ds.arr(top, input_units=units) - return d - - -('deposit', 'all_nn_velocity_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _deposit_field(field, data): - """ - Create a grid field for particle quantities weighted by particle - mass, using cloud-in-cell deposit. - """ - pos = data[ptype, "particle_position"] - # Get back into density - pden = data[ptype, 'particle_mass'] - top = data.deposit(pos, [data[(ptype, fname)]*pden], method=method) - bottom = data.deposit(pos, [pden], method=method) - top[bottom == 0] = 0.0 - bnz = bottom.nonzero() - top[bnz] /= bottom[bnz] - d = data.ds.arr(top, input_units=units) - return d - - -('deposit', 'io_cic') -^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def particle_cic(field, data): - pos = data[ptype, coord_name] - d = data.deposit(pos, [data[ptype, mass_name]], method = "cic") - d = data.apply_units(d, data[ptype, mass_name].units) - d /= data["index", "cell_volume"] - return d - - -('deposit', 'io_cic_velocity_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _deposit_field(field, data): - """ - Create a grid field for particle quantities weighted by particle - mass, using cloud-in-cell deposit. - """ - pos = data[ptype, "particle_position"] - # Get back into density - pden = data[ptype, 'particle_mass'] - top = data.deposit(pos, [data[(ptype, fname)]*pden], method=method) - bottom = data.deposit(pos, [pden], method=method) - top[bottom == 0] = 0.0 - bnz = bottom.nonzero() - top[bnz] /= bottom[bnz] - d = data.ds.arr(top, input_units=units) - return d - - -('deposit', 'io_cic_velocity_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _deposit_field(field, data): - """ - Create a grid field for particle quantities weighted by particle - mass, using cloud-in-cell deposit. - """ - pos = data[ptype, "particle_position"] - # Get back into density - pden = data[ptype, 'particle_mass'] - top = data.deposit(pos, [data[(ptype, fname)]*pden], method=method) - bottom = data.deposit(pos, [pden], method=method) - top[bottom == 0] = 0.0 - bnz = bottom.nonzero() - top[bnz] /= bottom[bnz] - d = data.ds.arr(top, input_units=units) - return d - - -('deposit', 'io_cic_velocity_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _deposit_field(field, data): - """ - Create a grid field for particle quantities weighted by particle - mass, using cloud-in-cell deposit. - """ - pos = data[ptype, "particle_position"] - # Get back into density - pden = data[ptype, 'particle_mass'] - top = data.deposit(pos, [data[(ptype, fname)]*pden], method=method) - bottom = data.deposit(pos, [pden], method=method) - top[bottom == 0] = 0.0 - bnz = bottom.nonzero() - top[bnz] /= bottom[bnz] - d = data.ds.arr(top, input_units=units) - return d - - -('deposit', 'io_count') -^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def particle_count(field, data): - pos = data[ptype, coord_name] - d = data.deposit(pos, method = "count") - d = data.ds.arr(d, input_units = "cm**-3") - return data.apply_units(d, field.units) - - -('deposit', 'io_density') -^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def particle_density(field, data): - pos = data[ptype, coord_name] - mass = data[ptype, mass_name] - pos.convert_to_units("code_length") - mass.convert_to_units("code_mass") - d = data.deposit(pos, [data[ptype, mass_name]], method = "sum") - d = data.ds.arr(d, "code_mass") - d /= data["index", "cell_volume"] - return d - - -('deposit', 'io_mass') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{g}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def particle_mass(field, data): - pos = data[ptype, coord_name] - pmass = data[ptype, mass_name].in_units(field.units) - d = data.deposit(pos, [pmass], method = "sum") - return data.apply_units(d, field.units) - - -('deposit', 'io_nn_velocity_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _deposit_field(field, data): - """ - Create a grid field for particle quantities weighted by particle - mass, using cloud-in-cell deposit. - """ - pos = data[ptype, "particle_position"] - # Get back into density - pden = data[ptype, 'particle_mass'] - top = data.deposit(pos, [data[(ptype, fname)]*pden], method=method) - bottom = data.deposit(pos, [pden], method=method) - top[bottom == 0] = 0.0 - bnz = bottom.nonzero() - top[bnz] /= bottom[bnz] - d = data.ds.arr(top, input_units=units) - return d - - -('deposit', 'io_nn_velocity_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _deposit_field(field, data): - """ - Create a grid field for particle quantities weighted by particle - mass, using cloud-in-cell deposit. - """ - pos = data[ptype, "particle_position"] - # Get back into density - pden = data[ptype, 'particle_mass'] - top = data.deposit(pos, [data[(ptype, fname)]*pden], method=method) - bottom = data.deposit(pos, [pden], method=method) - top[bottom == 0] = 0.0 - bnz = bottom.nonzero() - top[bnz] /= bottom[bnz] - d = data.ds.arr(top, input_units=units) - return d - - -('deposit', 'io_nn_velocity_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _deposit_field(field, data): - """ - Create a grid field for particle quantities weighted by particle - mass, using cloud-in-cell deposit. - """ - pos = data[ptype, "particle_position"] - # Get back into density - pden = data[ptype, 'particle_mass'] - top = data.deposit(pos, [data[(ptype, fname)]*pden], method=method) - bottom = data.deposit(pos, [pden], method=method) - top[bottom == 0] = 0.0 - bnz = bottom.nonzero() - top[bnz] /= bottom[bnz] - d = data.ds.arr(top, input_units=units) - return d - - -('gas', 'H_nuclei_density') -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _default_nuclei_density(field, data): - element = field.name[1][:field.name[1].find("_")] - return data["gas", "density"] * _primordial_mass_fraction[element] / \ - ChemicalFormula(element).weight / amu_cgs - - -('gas', 'He_nuclei_density') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _default_nuclei_density(field, data): - element = field.name[1][:field.name[1].find("_")] - return data["gas", "density"] * _primordial_mass_fraction[element] / \ - ChemicalFormula(element).weight / amu_cgs - - -('gas', 'alfven_speed') -^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _alfven_speed(field,data): - """This assumes that your front end has provided Bx, By, Bz in - units of Gauss. If you use MKS, make sure to write your own - alfven_speed field to deal with non-unitary \mu_0. - """ - return data[ftype,'magnetic_field_strength']/np.sqrt(4.*np.pi*data[ftype,'density']) - - -('gas', 'angular_momentum_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('gas', 'angular_momentum_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _angular_momentum_x(field, data): - return data[ftype, "cell_mass"] \ - * data[ftype, "specific_angular_momentum_x"] - - -('gas', 'angular_momentum_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _angular_momentum_y(field, data): - return data[ftype, "cell_mass"] \ - * data[ftype, "specific_angular_momentum_y"] - - -('gas', 'angular_momentum_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _angular_momentum_z(field, data): - return data[ftype, "cell_mass"] \ - * data[ftype, "specific_angular_momentum_z"] - - -('gas', 'averaged_density') -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _averaged_field(field, data): - nx, ny, nz = data[(ftype, basename)].shape - new_field = data.ds.arr(np.zeros((nx-2, ny-2, nz-2), dtype=np.float64), - (just_one(data[(ftype, basename)]) * - just_one(data[(ftype, weight)])).units) - weight_field = data.ds.arr(np.zeros((nx-2, ny-2, nz-2), dtype=np.float64), - data[(ftype, weight)].units) - i_i, j_i, k_i = np.mgrid[0:3, 0:3, 0:3] - - for i, j, k in zip(i_i.ravel(), j_i.ravel(), k_i.ravel()): - sl = [slice(i, nx-(2-i)), slice(j, ny-(2-j)), slice(k, nz-(2-k))] - new_field += data[(ftype, basename)][sl] * \ - data[(ftype, weight)][sl] - weight_field += data[(ftype, weight)][sl] - - # Now some fancy footwork - new_field2 = data.ds.arr(np.zeros((nx, ny, nz)), - data[(ftype, basename)].units) - new_field2[1:-1, 1:-1, 1:-1] = new_field / weight_field - return new_field2 - - -('gas', 'baroclinic_vorticity_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('gas', 'baroclinic_vorticity_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _baroclinic_vorticity_x(field, data): - rho2 = data[ftype, "density"].astype(np.float64)**2 - return (data[ftype, "pressure_gradient_y"] * - data[ftype, "density_gradient_z"] - - data[ftype, "pressure_gradient_z"] * - data[ftype, "density_gradient_z"]) / rho2 - - -('gas', 'baroclinic_vorticity_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _baroclinic_vorticity_y(field, data): - rho2 = data[ftype, "density"].astype(np.float64)**2 - return (data[ftype, "pressure_gradient_z"] * - data[ftype, "density_gradient_x"] - - data[ftype, "pressure_gradient_x"] * - data[ftype, "density_gradient_z"]) / rho2 - - -('gas', 'baroclinic_vorticity_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _baroclinic_vorticity_z(field, data): - rho2 = data[ftype, "density"].astype(np.float64)**2 - return (data[ftype, "pressure_gradient_x"] * - data[ftype, "density_gradient_y"] - - data[ftype, "pressure_gradient_y"] * - data[ftype, "density_gradient_x"]) / rho2 - - -('gas', 'baryon_overdensity') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _baryon_overdensity(field, data): - if not hasattr(data.ds, "cosmological_simulation") or \ - not data.ds.cosmological_simulation: - raise NeedsConfiguration("cosmological_simulation", 1) - omega_baryon = data.get_field_parameter("omega_baryon") - if omega_baryon is None: - raise NeedsParameter("omega_baryon") - co = data.ds.cosmology - # critical_density(z) ~ omega_lambda + omega_matter * (1 + z)^3 - # mean matter density(z) ~ omega_matter * (1 + z)^3 - return data[ftype, "density"] / omega_baryon / co.critical_density(0.0) / \ - (1.0 + data.ds.current_redshift)**3 - - -('gas', 'cell_mass') -^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{g}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _cell_mass(field, data): - return data[ftype, "density"] * data["index", "cell_volume"] - - -('gas', 'chandra_emissivity') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _chandra_emissivity(field, data): - logT0 = np.log10(data[ftype, "temperature"].to_ndarray().astype(np.float64)) - 7 - # we get rid of the units here since this is a fit and not an - # analytical expression - return data.ds.arr(data[ftype, "number_density"].to_ndarray().astype(np.float64)**2 - * (10**(- 0.0103 * logT0**8 + 0.0417 * logT0**7 - - 0.0636 * logT0**6 + 0.1149 * logT0**5 - - 0.3151 * logT0**4 + 0.6655 * logT0**3 - - 1.1256 * logT0**2 + 1.0026 * logT0**1 - - 0.6984 * logT0) - + data[ftype, "metallicity"].to_ndarray() * - 10**( 0.0305 * logT0**11 - 0.0045 * logT0**10 - - 0.3620 * logT0**9 + 0.0513 * logT0**8 - + 1.6669 * logT0**7 - 0.3854 * logT0**6 - - 3.3604 * logT0**5 + 0.4728 * logT0**4 - + 4.5774 * logT0**3 - 2.3661 * logT0**2 - - 1.6667 * logT0**1 - 0.2193 * logT0)), - "") # add correct units here - - -('gas', 'courant_time_step') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _courant_time_step(field, data): - t1 = data["index", "dx"] / (data[ftype, "sound_speed"] - + np.abs(data[ftype, "velocity_x"])) - t2 = data["index", "dy"] / (data[ftype, "sound_speed"] - + np.abs(data[ftype, "velocity_y"])) - t3 = data["index", "dz"] / (data[ftype, "sound_speed"] - + np.abs(data[ftype, "velocity_z"])) - tr = np.minimum(np.minimum(t1, t2), t3) - return tr - - -('gas', 'cutting_plane_velocity_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _cp_val(field, data): - vec = data.get_field_parameter("cp_%s_vec" % (ax)) - bv = data.get_field_parameter("bulk_%s" % basename) - if bv == None: bv = np.zeros(3) - tr = (data[xn] - bv[0]) * vec[0] - tr += (data[yn] - bv[1]) * vec[1] - tr += (data[zn] - bv[2]) * vec[2] - return tr - - -('gas', 'cutting_plane_velocity_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _cp_val(field, data): - vec = data.get_field_parameter("cp_%s_vec" % (ax)) - bv = data.get_field_parameter("bulk_%s" % basename) - if bv == None: bv = np.zeros(3) - tr = (data[xn] - bv[0]) * vec[0] - tr += (data[yn] - bv[1]) * vec[1] - tr += (data[zn] - bv[2]) * vec[2] - return tr - - -('gas', 'cutting_plane_velocity_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _cp_val(field, data): - vec = data.get_field_parameter("cp_%s_vec" % (ax)) - bv = data.get_field_parameter("bulk_%s" % basename) - if bv == None: bv = np.zeros(3) - tr = (data[xn] - bv[0]) * vec[0] - tr += (data[yn] - bv[1]) * vec[1] - tr += (data[zn] - bv[2]) * vec[2] - return tr - - -('gas', 'cylindrical_radial_velocity') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _cylindrical_radial(field, data): - normal = data.get_field_parameter("normal") - vectors = obtain_rv_vec(data, (xn, yn, zn), - "bulk_%s" % basename) - theta = resize_vector(data["index", 'cylindrical_theta'], vectors) - return get_cyl_r_component(vectors, theta, normal) - - -('gas', 'cylindrical_radial_velocity_absolute') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _cylindrical_radial_absolute(field, data): - return np.abs(_cylindrical_radial(field, data)) - - -('gas', 'cylindrical_tangential_velocity') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _cylindrical_tangential(field, data): - normal = data.get_field_parameter("normal") - vectors = obtain_rv_vec(data, (xn, yn, zn), - "bulk_%s" % basename) - theta = data["index", 'cylindrical_theta'].copy() - theta = np.tile(theta, (3,) + (1,)*len(theta.shape)) - return get_cyl_theta_component(vectors, theta, normal) - - -('gas', 'cylindrical_tangential_velocity_absolute') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _cylindrical_tangential_absolute(field, data): - return np.abs(_cylindrical_tangential(field, data)) - - -('gas', 'dark_matter_density') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'density') -^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'density_gradient_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{4}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('gas', 'density_gradient_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{4}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def func(field, data): - ds = div_fac * data["index", "dx"] - f = data[grad_field][slice_3dr]/ds[slice_3d] - f -= data[grad_field][slice_3dl]/ds[slice_3d] - new_field = data.ds.arr(np.zeros_like(data[grad_field], dtype=np.float64), - f.units) - new_field[slice_3d] = f - return new_field - - -('gas', 'density_gradient_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{4}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def func(field, data): - ds = div_fac * data["index", "dx"] - f = data[grad_field][slice_3dr]/ds[slice_3d] - f -= data[grad_field][slice_3dl]/ds[slice_3d] - new_field = data.ds.arr(np.zeros_like(data[grad_field], dtype=np.float64), - f.units) - new_field[slice_3d] = f - return new_field - - -('gas', 'density_gradient_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{4}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def func(field, data): - ds = div_fac * data["index", "dx"] - f = data[grad_field][slice_3dr]/ds[slice_3d] - f -= data[grad_field][slice_3dl]/ds[slice_3d] - new_field = data.ds.arr(np.zeros_like(data[grad_field], dtype=np.float64), - f.units) - new_field[slice_3d] = f - return new_field - - -('gas', 'di_density') -^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'dii_density') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'dynamical_time') -^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _dynamical_time(field, data): - """ - sqrt(3 pi / (16 G rho)) - """ - return np.sqrt(3.0 * np.pi / (16.0 * G * data[ftype, "density"])) - - -('gas', 'entropy') -^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{keV}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _entropy(field, data): - mw = data.get_field_parameter("mu") - if mw is None: - mw = 1.0 - mw *= mh - gammam1 = 2./3. - tr = data[ftype,"kT"] / ((data[ftype, "density"]/mw)**gammam1) - return data.apply_units(tr, field.units) - - -('gas', 'h2i_density') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'h2ii_density') -^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'h2m_density') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'hdi_density') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'hei_density') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'heii_density') -^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'heiii_density') -^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'hi_density') -^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'hii_density') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'jeans_mass') -^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{g}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _jeans_mass(field, data): - MJ_constant = (((5.0 * kboltz) / (G * mh)) ** (1.5)) * \ - (3.0 / (4.0 * np.pi)) ** (0.5) - u = (MJ_constant * \ - ((data[ftype, "temperature"] / - data[ftype, "mean_molecular_weight"])**(1.5)) * \ - (data[ftype, "density"]**(-0.5))) - return u - - -('gas', 'kT') -^^^^^^^^^^^^^ - - * Units: :math:`\rm{keV}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _kT(field, data): - return (kboltz*data[ftype, "temperature"]).in_units("keV") - - -('gas', 'kinetic_energy') -^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm} \cdot \rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _kin_energy(field, data): - return 0.5*data[ftype, "density"] * ( data[ftype, "velocity_x"]**2.0 - + data[ftype, "velocity_y"]**2.0 - + data[ftype, "velocity_z"]**2.0 ) - - -('gas', 'mach_alfven') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`1` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _mach_alfven(field,data): - return data[ftype,'velocity_magnitude']/data[ftype,'alfven_speed'] - - -('gas', 'mach_number') -^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _mach_number(field, data): - """ M{|v|/c_sound} """ - return data[ftype, "velocity_magnitude"] / data[ftype, "sound_speed"] - - -('gas', 'magnetic_energy') -^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm} \cdot \rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnetic_energy(field,data): - """This assumes that your front end has provided Bx, By, Bz in - units of Gauss. If you use MKS, make sure to write your own - magnetic_energy field to deal with non-unitary \mu_0. - """ - return (data[ftype,"magnetic_field_x"]**2 + - data[ftype,"magnetic_field_y"]**2 + - data[ftype,"magnetic_field_z"]**2)/(8*np.pi) - - -('gas', 'magnetic_field_poloidal') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\sqrt{\rm{g}}}{\sqrt{\rm{cm}} \cdot \rm{s}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnetic_field_poloidal(field,data): - normal = data.get_field_parameter("normal") - d = data[ftype,'magnetic_field_x'] - Bfields = data.ds.arr( - [data[ftype,'magnetic_field_x'], - data[ftype,'magnetic_field_y'], - data[ftype,'magnetic_field_z']], - d.units) - - theta = data["index", 'spherical_theta'] - phi = data["index", 'spherical_phi'] - - return get_sph_theta_component(Bfields, theta, phi, normal) - - -('gas', 'magnetic_field_strength') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\sqrt{\rm{g}}}{\sqrt{\rm{cm}} \cdot \rm{s}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnetic_field_strength(field,data): - """This assumes that your front end has provided Bx, By, Bz in - units of Gauss. If you use MKS, make sure to write your own - PlasmaBeta field to deal with non-unitary \mu_0. - """ - return np.sqrt(8.*np.pi*data[ftype,"magnetic_energy"]) - - -('gas', 'magnetic_field_toroidal') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\sqrt{\rm{g}}}{\sqrt{\rm{cm}} \cdot \rm{s}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnetic_field_toroidal(field,data): - normal = data.get_field_parameter("normal") - d = data[ftype,'magnetic_field_x'] - Bfields = data.ds.arr( - [data[ftype,'magnetic_field_x'], - data[ftype,'magnetic_field_y'], - data[ftype,'magnetic_field_z']], - d.units) - - phi = data["index", 'spherical_phi'] - return get_sph_phi_component(Bfields, phi, normal) - - -('gas', 'magnetic_field_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\sqrt{\rm{g}}}{\sqrt{\rm{cm}} \cdot \rm{s}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'magnetic_field_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\sqrt{\rm{g}}}{\sqrt{\rm{cm}} \cdot \rm{s}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'magnetic_field_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\sqrt{\rm{g}}}{\sqrt{\rm{cm}} \cdot \rm{s}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'magnetic_pressure') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm} \cdot \rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnetic_pressure(field,data): - return data[ftype,'magnetic_energy'] - - -('gas', 'matter_density') -^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _matter_density(field, data): - return data[ftype, "density"] + \ - data[ftype, "dark_matter_density"] - - -('gas', 'matter_mass') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{g}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _matter_mass(field, data): - return data[ftype, "matter_density"] * data["index", "cell_volume"] - - -('gas', 'matter_overdensity') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _matter_overdensity(field, data): - if not hasattr(data.ds, "cosmological_simulation") or \ - not data.ds.cosmological_simulation: - raise NeedsConfiguration("cosmological_simulation", 1) - co = data.ds.cosmology - # critical_density(z) ~ omega_lambda + omega_matter * (1 + z)^3 - # mean density(z) ~ omega_matter * (1 + z)^3 - return data[ftype, "matter_density"] / data.ds.omega_matter / \ - co.critical_density(0.0) / \ - (1.0 + data.ds.current_redshift)**3 - - -('gas', 'mazzotta_weighting') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{s}^{0.5}}{\rm{cm}^{6.5} \cdot \rm{g}^{0.25}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _mazzotta_weighting(field, data): - # Spectroscopic-like weighting field for galaxy clusters - # Only useful as a weight_field for temperature, metallicity, velocity - return data["density"]*data["density"]*data["kT"]**-0.25/mh/mh - - -('gas', 'mean_molecular_weight') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _mean_molecular_weight(field, data): - return (data[ftype, "density"] / (mh * data[ftype, "number_density"])) - - -('gas', 'metal_density') -^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'metal_mass') -^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{g}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _metal_mass(field, data): - return data[ftype, "metal_density"] * data["index", "cell_volume"] - - -('gas', 'metallicity') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{Z}_\odot` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _metallicity(field, data): - tr = data[ftype, "metal_density"] / data[ftype, "density"] - tr /= metallicity_sun - return data.apply_units(tr, "Zsun") - - -('gas', 'number_density') -^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{cm}^{3}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'overdensity') -^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _overdensity(field, data): - if not hasattr(data.ds, "cosmological_simulation") or \ - not data.ds.cosmological_simulation: - raise NeedsConfiguration("cosmological_simulation", 1) - co = data.ds.cosmology - return data[ftype, "matter_density"] / \ - co.critical_density(data.ds.current_redshift) - - -('gas', 'plasma_beta') -^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _plasma_beta(field,data): - """This assumes that your front end has provided Bx, By, Bz in - units of Gauss. If you use MKS, make sure to write your own - plasma_beta field to deal with non-unitary \mu_0. - """ - return data[ftype,'pressure']/data[ftype,'magnetic_energy'] - - -('gas', 'pressure') -^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm} \cdot \rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'pressure_gradient_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('gas', 'pressure_gradient_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def func(field, data): - ds = div_fac * data["index", "dx"] - f = data[grad_field][slice_3dr]/ds[slice_3d] - f -= data[grad_field][slice_3dl]/ds[slice_3d] - new_field = data.ds.arr(np.zeros_like(data[grad_field], dtype=np.float64), - f.units) - new_field[slice_3d] = f - return new_field - - -('gas', 'pressure_gradient_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def func(field, data): - ds = div_fac * data["index", "dx"] - f = data[grad_field][slice_3dr]/ds[slice_3d] - f -= data[grad_field][slice_3dl]/ds[slice_3d] - new_field = data.ds.arr(np.zeros_like(data[grad_field], dtype=np.float64), - f.units) - new_field[slice_3d] = f - return new_field - - -('gas', 'pressure_gradient_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def func(field, data): - ds = div_fac * data["index", "dx"] - f = data[grad_field][slice_3dr]/ds[slice_3d] - f -= data[grad_field][slice_3dl]/ds[slice_3d] - new_field = data.ds.arr(np.zeros_like(data[grad_field], dtype=np.float64), - f.units) - new_field[slice_3d] = f - return new_field - - -('gas', 'radial_mach_number') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _radial_mach_number(field, data): - """ Radial component of M{|v|/c_sound} """ - tr = data[ftype, "radial_velocity"] / data[ftype, "sound_speed"] - return np.abs(tr) - - -('gas', 'radial_velocity') -^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _radial(field, data): - normal = data.get_field_parameter("normal") - vectors = obtain_rv_vec(data, (xn, yn, zn), - "bulk_%s" % basename) - theta = data['index', 'spherical_theta'] - phi = data['index', 'spherical_phi'] - rv = get_sph_r_component(vectors, theta, phi, normal) - # Now, anywhere that radius is in fact zero, we want to zero out our - # return values. - rv[np.isnan(theta)] = 0.0 - return rv - - -('gas', 'radial_velocity_absolute') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _radial_absolute(field, data): - return np.abs(data[ftype, "radial_%s" % basename]) - - -('gas', 'radiation_acceleration_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{cm}}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'radiation_acceleration_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{cm}}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'radiation_acceleration_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{cm}}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'shear') -^^^^^^^^^^^^^^^^ - - * Units: :math:`1 / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _shear(field, data): - """ - Shear is defined as [(dvx/dy + dvy/dx)^2 + (dvz/dy + dvy/dz)^2 + - (dvx/dz + dvz/dx)^2 ]^(0.5) - where dvx/dy = [vx(j-1) - vx(j+1)]/[2dy] - and is in units of s^(-1) - (it's just like vorticity except add the derivative pairs instead - of subtracting them) - """ - - if data.ds.dimensionality > 1: - dvydx = (data[ftype, "velocity_y"][sl_right,sl_center,sl_center] - - data[ftype, "velocity_y"][sl_left,sl_center,sl_center]) \ - / (div_fac*just_one(data["index", "dx"])) - dvxdy = (data[ftype, "velocity_x"][sl_center,sl_right,sl_center] - - data[ftype, "velocity_x"][sl_center,sl_left,sl_center]) \ - / (div_fac*just_one(data["index", "dy"])) - f = (dvydx + dvxdy)**2.0 - del dvydx, dvxdy - if data.ds.dimensionality > 2: - dvzdy = (data[ftype, "velocity_z"][sl_center,sl_right,sl_center] - - data[ftype, "velocity_z"][sl_center,sl_left,sl_center]) \ - / (div_fac*just_one(data["index", "dy"])) - dvydz = (data[ftype, "velocity_y"][sl_center,sl_center,sl_right] - - data[ftype, "velocity_y"][sl_center,sl_center,sl_left]) \ - / (div_fac*just_one(data["index", "dz"])) - f += (dvzdy + dvydz)**2.0 - del dvzdy, dvydz - dvxdz = (data[ftype, "velocity_x"][sl_center,sl_center,sl_right] - - data[ftype, "velocity_x"][sl_center,sl_center,sl_left]) \ - / (div_fac*just_one(data["index", "dz"])) - dvzdx = (data[ftype, "velocity_z"][sl_right,sl_center,sl_center] - - data[ftype, "velocity_z"][sl_left,sl_center,sl_center]) \ - / (div_fac*just_one(data["index", "dx"])) - f += (dvxdz + dvzdx)**2.0 - del dvxdz, dvzdx - np.sqrt(f, out=f) - new_field = data.ds.arr(np.zeros_like(data[ftype, "velocity_x"]), f.units) - new_field[sl_center, sl_center, sl_center] = f - return new_field - - -('gas', 'shear_criterion') -^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`1 / \rm{cm}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _shear_criterion(field, data): - """ - Divide by c_s to leave shear in units of cm**-1, which - can be compared against the inverse of the local cell size (1/dx) - to determine if refinement should occur. - """ - - return data[ftype, "shear"] / data[ftype, "sound_speed"] - - -('gas', 'shear_mach') -^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _shear_mach(field, data): - """ - Dimensionless shear (shear_mach) is defined nearly the same as shear, - except that it is scaled by the local dx/dy/dz and the local sound speed. - So it results in a unitless quantity that is effectively measuring - shear in mach number. - - In order to avoid discontinuities created by multiplying by dx/dy/dz at - grid refinement boundaries, we also multiply by 2**GridLevel. - - Shear (Mach) = [(dvx + dvy)^2 + (dvz + dvy)^2 + - (dvx + dvz)^2 ]^(0.5) / c_sound - """ - - if data.ds.dimensionality > 1: - dvydx = (data[ftype, "velocity_y"][sl_right,sl_center,sl_center] - - data[ftype, "velocity_y"][sl_left,sl_center,sl_center]) \ - / div_fac - dvxdy = (data[ftype, "velocity_x"][sl_center,sl_right,sl_center] - - data[ftype, "velocity_x"][sl_center,sl_left,sl_center]) \ - / div_fac - f = (dvydx + dvxdy)**2.0 - del dvydx, dvxdy - if data.ds.dimensionality > 2: - dvzdy = (data[ftype, "velocity_z"][sl_center,sl_right,sl_center] - - data[ftype, "velocity_z"][sl_center,sl_left,sl_center]) \ - / div_fac - dvydz = (data[ftype, "velocity_y"][sl_center,sl_center,sl_right] - - data[ftype, "velocity_y"][sl_center,sl_center,sl_left]) \ - / div_fac - f += (dvzdy + dvydz)**2.0 - del dvzdy, dvydz - dvxdz = (data[ftype, "velocity_x"][sl_center,sl_center,sl_right] - - data[ftype, "velocity_x"][sl_center,sl_center,sl_left]) \ - / div_fac - dvzdx = (data[ftype, "velocity_z"][sl_right,sl_center,sl_center] - - data[ftype, "velocity_z"][sl_left,sl_center,sl_center]) \ - / div_fac - f += (dvxdz + dvzdx)**2.0 - del dvxdz, dvzdx - f *= (2.0**data["index", "grid_level"][sl_center, sl_center, sl_center] / - data[ftype, "sound_speed"][sl_center, sl_center, sl_center])**2.0 - np.sqrt(f, out=f) - new_field = data.ds.arr(np.zeros_like(data[ftype, "velocity_x"]), f.units) - new_field[sl_center, sl_center, sl_center] = f - return new_field - - -('gas', 'sound_speed') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _sound_speed(field, data): - tr = data.ds.gamma * data[ftype, "pressure"] / data[ftype, "density"] - return np.sqrt(tr) - - -('gas', 'specific_angular_momentum_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('gas', 'specific_angular_momentum_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _specific_angular_momentum_x(field, data): - xv, yv, zv = obtain_velocities(data, ftype) - rv = obtain_rvec(data) - rv = np.rollaxis(rv, 0, len(rv.shape)) - rv = data.ds.arr(rv, input_units = data["index", "x"].units) - return yv * rv[...,2] - zv * rv[...,1] - - -('gas', 'specific_angular_momentum_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _specific_angular_momentum_y(field, data): - xv, yv, zv = obtain_velocities(data, ftype) - rv = obtain_rvec(data) - rv = np.rollaxis(rv, 0, len(rv.shape)) - rv = data.ds.arr(rv, input_units = data["index", "x"].units) - return - (xv * rv[...,2] - zv * rv[...,0]) - - -('gas', 'specific_angular_momentum_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _specific_angular_momentum_z(field, data): - xv, yv, zv = obtain_velocities(data, ftype) - rv = obtain_rvec(data) - rv = np.rollaxis(rv, 0, len(rv.shape)) - rv = data.ds.arr(rv, input_units = data["index", "x"].units) - return xv * rv[...,1] - yv * rv[...,0] - - -('gas', 'sz_kinetic') -^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`1 / \rm{cm}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _sz_kinetic(field, data): - scale = 0.88 * sigma_thompson / mh / clight - vel_axis = data.get_field_parameter("axis") - if vel_axis > 2: - raise NeedsParameter(["axis"]) - vel = data[ftype, "velocity_%s" % ({0: "x", 1: "y", 2: "z"}[vel_axis])] - return scale * vel * data[ftype, "density"] - - -('gas', 'szy') -^^^^^^^^^^^^^^ - - * Units: :math:`1 / \rm{cm}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _szy(field, data): - scale = 0.88 / mh * kboltz / (me * clight*clight) * sigma_thompson - return scale * data[ftype, "density"] * data[ftype, "temperature"] - - -('gas', 'tangential_over_velocity_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _tangential_over_magnitude(field, data): - tr = data[ftype, "tangential_%s" % basename] / \ - data[ftype, "%s_magnitude" % basename] - return np.abs(tr) - - -('gas', 'tangential_velocity') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _tangential(field, data): - return np.sqrt(data[ftype, "%s_magnitude" % basename]**2.0 - - data[ftype, "radial_%s" % basename]**2.0) - - -('gas', 'temperature') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{K}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'thermal_energy') -^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{\rm{cm}^{2}}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'velocity_divergence') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`1 / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _divergence(field, data): - ds = div_fac * just_one(data["index", "dx"]) - f = data[xn][sl_right,1:-1,1:-1]/ds - f -= data[xn][sl_left ,1:-1,1:-1]/ds - ds = div_fac * just_one(data["index", "dy"]) - f += data[yn][1:-1,sl_right,1:-1]/ds - f -= data[yn][1:-1,sl_left ,1:-1]/ds - ds = div_fac * just_one(data["index", "dz"]) - f += data[zn][1:-1,1:-1,sl_right]/ds - f -= data[zn][1:-1,1:-1,sl_left ]/ds - new_field = data.ds.arr(np.zeros(data[xn].shape, dtype=np.float64), - f.units) - new_field[1:-1,1:-1,1:-1] = f - return new_field - - -('gas', 'velocity_divergence_absolute') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`1 / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _divergence_abs(field, data): - return np.abs(data[ftype, "%s_divergence" % basename]) - - -('gas', 'velocity_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('gas', 'velocity_x') -^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'velocity_y') -^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'velocity_z') -^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: False - -**Field Source** - -No source available. - -('gas', 'vorticity_growth_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_growth_magnitude(field, data): - result = np.sqrt(data[ftype, "vorticity_growth_x"]**2 + - data[ftype, "vorticity_growth_y"]**2 + - data[ftype, "vorticity_growth_z"]**2) - dot = data.ds.arr(np.zeros(result.shape), "") - for ax in "xyz": - dot += (data[ftype, "vorticity_%s" % ax] * - data[ftype, "vorticity_growth_%s" % ax]).to_ndarray() - result = np.sign(dot) * result - return result - - -('gas', 'vorticity_growth_magnitude_absolute') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_growth_magnitude_absolute(field, data): - return np.sqrt(data[ftype, "vorticity_growth_x"]**2 + - data[ftype, "vorticity_growth_y"]**2 + - data[ftype, "vorticity_growth_z"]**2) - - -('gas', 'vorticity_growth_timescale') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_growth_timescale(field, data): - domegax_dt = data[ftype, "vorticity_x"] / data[ftype, "vorticity_growth_x"] - domegay_dt = data[ftype, "vorticity_y"] / data[ftype, "vorticity_growth_y"] - domegaz_dt = data[ftype, "vorticity_z"] / data[ftype, "vorticity_growth_z"] - return np.sqrt(domegax_dt**2 + domegay_dt**2 + domegaz_dt**2) - - -('gas', 'vorticity_growth_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_growth_x(field, data): - return -data[ftype, "vorticity_stretching_x"] - \ - data[ftype, "baroclinic_vorticity_x"] - - -('gas', 'vorticity_growth_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_growth_y(field, data): - return -data[ftype, "vorticity_stretching_y"] - \ - data[ftype, "baroclinic_vorticity_y"] - - -('gas', 'vorticity_growth_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_growth_z(field, data): - return -data[ftype, "vorticity_stretching_z"] - \ - data[ftype, "baroclinic_vorticity_z"] - - -('gas', 'vorticity_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`1 / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('gas', 'vorticity_radiation_pressure_growth_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_radiation_pressure_growth_magnitude(field, data): - result = np.sqrt(data[ftype, "vorticity_radiation_pressure_growth_x"]**2 + - data[ftype, "vorticity_radiation_pressure_growth_y"]**2 + - data[ftype, "vorticity_radiation_pressure_growth_z"]**2) - dot = data.ds.arr(np.zeros(result.shape), "") - for ax in "xyz": - dot += (data[ftype, "vorticity_%s" % ax] * - data[ftype, "vorticity_growth_%s" % ax]).to_ndarray() - result = np.sign(dot) * result - return result - - -('gas', 'vorticity_radiation_pressure_growth_magnitude_absolute') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_radiation_pressure_growth_magnitude_absolute(field, data): - return np.sqrt(data[ftype, "vorticity_radiation_pressure_growth_x"]**2 + - data[ftype, "vorticity_radiation_pressure_growth_y"]**2 + - data[ftype, "vorticity_radiation_pressure_growth_z"]**2) - - -('gas', 'vorticity_radiation_pressure_growth_timescale') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_radiation_pressure_growth_timescale(field, data): - domegax_dt = data[ftype, "vorticity_x"] / \ - data[ftype, "vorticity_radiation_pressure_growth_x"] - domegay_dt = data[ftype, "vorticity_y"] / \ - data[ftype, "vorticity_radiation_pressure_growth_y"] - domegaz_dt = data[ftype, "vorticity_z"] / \ - data[ftype, "vorticity_radiation_pressure_growth_z"] - return np.sqrt(domegax_dt**2 + domegay_dt**2 + domegaz_dt**2) - - -('gas', 'vorticity_radiation_pressure_growth_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_radiation_pressure_growth_x(field, data): - return -data[ftype, "vorticity_stretching_x"] - \ - data[ftype, "baroclinic_vorticity_x"] \ - -data[ftype, "vorticity_radiation_pressure_x"] - - -('gas', 'vorticity_radiation_pressure_growth_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_radiation_pressure_growth_y(field, data): - return -data[ftype, "vorticity_stretching_y"] - \ - data[ftype, "baroclinic_vorticity_y"] \ - -data[ftype, "vorticity_radiation_pressure_y"] - - -('gas', 'vorticity_radiation_pressure_growth_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_radiation_pressure_growth_z(field, data): - return -data[ftype, "vorticity_stretching_z"] - \ - data[ftype, "baroclinic_vorticity_z"] \ - -data[ftype, "vorticity_radiation_pressure_z"] - - -('gas', 'vorticity_radiation_pressure_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('gas', 'vorticity_radiation_pressure_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_radiation_pressure_x(field, data): - rho = data[ftype, "density"].astype(np.float64) - return (data[ftype, "radiation_acceleration_y"] * - data[ftype, "density_gradient_z"] - - data[ftype, "radiation_acceleration_z"] * - data[ftype, "density_gradient_y"]) / rho - - -('gas', 'vorticity_radiation_pressure_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_radiation_pressure_y(field, data): - rho = data[ftype, "density"].astype(np.float64) - return (data[ftype, "radiation_acceleration_z"] * - data[ftype, "density_gradient_x"] - - data[ftype, "radiation_acceleration_x"] * - data[ftype, "density_gradient_z"]) / rho - - -('gas', 'vorticity_radiation_pressure_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_radiation_pressure_z(field, data): - rho = data[ftype, "density"].astype(np.float64) - return (data[ftype, "radiation_acceleration_x"] * - data[ftype, "density_gradient_y"] - - data[ftype, "radiation_acceleration_y"] * - data[ftype, "density_gradient_x"]) / rho - - -('gas', 'vorticity_squared') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _squared(field, data): - fn = field_components[0] - squared = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - squared += data[fn] * data[fn] - return squared - - -('gas', 'vorticity_stretching_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('gas', 'vorticity_stretching_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_stretching_x(field, data): - return data[ftype, "velocity_divergence"] * data[ftype, "vorticity_x"] - - -('gas', 'vorticity_stretching_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_stretching_y(field, data): - return data[ftype, "velocity_divergence"] * data[ftype, "vorticity_y"] - - -('gas', 'vorticity_stretching_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\frac{1}{\rm{s}^{2}}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_stretching_z(field, data): - return data[ftype, "velocity_divergence"] * data[ftype, "vorticity_z"] - - -('gas', 'vorticity_x') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`1 / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_x(field, data): - f = (data[ftype, "velocity_z"][sl_center,sl_right,sl_center] - - data[ftype, "velocity_z"][sl_center,sl_left,sl_center]) \ - / (div_fac*just_one(data["index", "dy"])) - f -= (data[ftype, "velocity_y"][sl_center,sl_center,sl_right] - - data[ftype, "velocity_y"][sl_center,sl_center,sl_left]) \ - / (div_fac*just_one(data["index", "dz"])) - new_field = data.ds.arr(np.zeros_like(data[ftype, "velocity_z"], - dtype=np.float64), - f.units) - new_field[sl_center, sl_center, sl_center] = f - return new_field - - -('gas', 'vorticity_y') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`1 / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_y(field, data): - f = (data[ftype, "velocity_x"][sl_center,sl_center,sl_right] - - data[ftype, "velocity_x"][sl_center,sl_center,sl_left]) \ - / (div_fac*just_one(data["index", "dz"])) - f -= (data[ftype, "velocity_z"][sl_right,sl_center,sl_center] - - data[ftype, "velocity_z"][sl_left,sl_center,sl_center]) \ - / (div_fac*just_one(data["index", "dx"])) - new_field = data.ds.arr(np.zeros_like(data[ftype, "velocity_z"], - dtype=np.float64), - f.units) - new_field[sl_center, sl_center, sl_center] = f - return new_field - - -('gas', 'vorticity_z') -^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`1 / \rm{s}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _vorticity_z(field, data): - f = (data[ftype, "velocity_y"][sl_right,sl_center,sl_center] - - data[ftype, "velocity_y"][sl_left,sl_center,sl_center]) \ - / (div_fac*just_one(data["index", "dx"])) - f -= (data[ftype, "velocity_x"][sl_center,sl_right,sl_center] - - data[ftype, "velocity_x"][sl_center,sl_left,sl_center]) \ - / (div_fac*just_one(data["index", "dy"])) - new_field = data.ds.arr(np.zeros_like(data[ftype, "velocity_z"], - dtype=np.float64), - f.units) - new_field[sl_center, sl_center, sl_center] = f - return new_field - - -('gas', 'weak_lensing_convergence') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`1 / \rm{cm}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _weak_lensing_convergence(field, data): - if not hasattr(data.ds, "cosmological_simulation") or \ - not data.ds.cosmological_simulation: - raise NeedsConfiguration("cosmological_simulation", 1) - co = data.ds.cosmology - observer_redshift = data.get_field_parameter('observer_redshift') - source_redshift = data.get_field_parameter('source_redshift') - - # observer to lens - dl = co.angular_diameter_distance(observer_redshift, data.ds.current_redshift) - # observer to source - ds = co.angular_diameter_distance(observer_redshift, source_redshift) - # lens to source - dls = co.angular_diameter_distance(data.ds.current_redshift, source_redshift) - - # removed the factor of 1 / a to account for the fact that we are projecting - # with a proper distance. - return (1.5 * (co.hubble_constant / speed_of_light_cgs)**2 * (dl * dls / ds) * \ - data[ftype, "matter_overdensity"]).in_units("1/cm") - - -('gas', 'xray_emissivity') -^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _xray_emissivity(field, data): - # old scaling coefficient was 2.168e60 - return data.ds.arr(data[ftype, "density"].to_ndarray().astype(np.float64)**2 - * data[ftype, "temperature"].to_ndarray()**0.5, - "") # add correct units here - - -('index', 'cell_volume') -^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}^{3}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _cell_volume(field, data): - rv = data["index", "dx"].copy(order='K') - rv *= data["index", "dy"] - rv *= data["index", "dz"] - return rv - - -('index', 'cylindrical_r') -^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _cylindrical_r(field, data): - normal = data.get_field_parameter("normal") - coords = get_periodic_rvec(data) - return data.ds.arr(get_cyl_r(coords, normal), "code_length").in_base(unit_system.name) - - -('index', 'cylindrical_theta') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _cylindrical_theta(field, data): - normal = data.get_field_parameter("normal") - coords = get_periodic_rvec(data) - return get_cyl_theta(coords, normal) - - -('index', 'cylindrical_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _cylindrical_z(field, data): - normal = data.get_field_parameter("normal") - coords = get_periodic_rvec(data) - return data.ds.arr(get_cyl_z(coords, normal), "code_length").in_base(unit_system.name) - - -('index', 'disk_angle') -^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _disk_angle(field, data): - return data["index", "spherical_theta"] - - -('index', 'dx') -^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _dds(field, data): - rv = data.ds.arr(data.fwidth[...,axi].copy(), units) - return data._reshape_vals(rv) - - -('index', 'dy') -^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _dds(field, data): - rv = data.ds.arr(data.fwidth[...,axi].copy(), units) - return data._reshape_vals(rv) - - -('index', 'dz') -^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _dds(field, data): - rv = data.ds.arr(data.fwidth[...,axi].copy(), units) - return data._reshape_vals(rv) - - -('index', 'grid_indices') -^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _grid_indices(field, data): - return np.ones(data["index", "ones"].shape)*(data.id-data._id_offset) - - -('index', 'grid_level') -^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _grid_level(field, data): - return np.ones(data.ActiveDimensions)*(data.Level) - - -('index', 'height') -^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _height(field, data): - return data["index", "cylindrical_z"] - - -('index', 'ones') -^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _ones(field, data): - arr = np.ones(data.ires.shape, dtype="float64") - if data._spatial: - return data._reshape_vals(arr) - return data.apply_units(arr, field.units) - - -('index', 'ones_over_dx') -^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`1 / \rm{cm}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _ones_over_dx(field, data): - return np.ones(data["index", "ones"].shape, - dtype="float64")/data["index", "dx"] - - -('index', 'radius') -^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _radius(field, data): - return get_radius(data, "") - - -('index', 'spherical_phi') -^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _spherical_phi(field, data): - normal = data.get_field_parameter("normal") - coords = get_periodic_rvec(data) - return get_sph_phi(coords, normal) - - -('index', 'spherical_r') -^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _spherical_r(field, data): - coords = get_periodic_rvec(data) - return data.ds.arr(get_sph_r(coords), "code_length").in_base(unit_system.name) - - -('index', 'spherical_theta') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _spherical_theta(field, data): - normal = data.get_field_parameter("normal") - coords = get_periodic_rvec(data) - return get_sph_theta(coords, normal) - - -('index', 'virial_radius_fraction') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _virial_radius_fraction(field, data): - virial_radius = data.get_field_parameter("virial_radius") - return data["radius"] / virial_radius - - -('index', 'x') -^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _coords(field, data): - rv = data.ds.arr(data.fcoords[...,axi].copy(), units) - return data._reshape_vals(rv) - - -('index', 'y') -^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _coords(field, data): - rv = data.ds.arr(data.fcoords[...,axi].copy(), units) - return data._reshape_vals(rv) - - -('index', 'z') -^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _coords(field, data): - rv = data.ds.arr(data.fcoords[...,axi].copy(), units) - return data._reshape_vals(rv) - - -('index', 'zeros') -^^^^^^^^^^^^^^^^^^ - - * Particle Type: False - -**Field Source** - -.. code-block:: python - - def _zeros(field, data): - arr = np.zeros(data["index", "ones"].shape, dtype='float64') - return data.apply_units(arr, field.units) - - -('io', 'mesh_id') -^^^^^^^^^^^^^^^^^ - - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def particle_mesh_ids(field, data): - pos = data[ptype, coord_name] - ids = np.zeros(pos.shape[0], dtype="float64") - 1 - # This is float64 in name only. It will be properly cast inside the - # deposit operation. - #_ids = ids.view("float64") - data.deposit(pos, [ids], method = "mesh_id") - return data.apply_units(ids, "") - - -('io', 'particle_angular_momentum') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_angular_momentum(field, data): - return data[ptype, "particle_mass"] \ - * data[ptype, "particle_specific_angular_momentum"] - - -('io', 'particle_angular_momentum_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('io', 'particle_angular_momentum_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_angular_momentum_x(field, data): - return data[ptype, "particle_mass"] * \ - data[ptype, "particle_specific_angular_momentum_x"] - - -('io', 'particle_angular_momentum_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_angular_momentum_y(field, data): - return data[ptype, "particle_mass"] * \ - data[ptype, "particle_specific_angular_momentum_y"] - - -('io', 'particle_angular_momentum_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} \cdot \rm{g} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_angular_momentum_z(field, data): - return data[ptype, "particle_mass"] * \ - data[ptype, "particle_specific_angular_momentum_z"] - - -('io', 'particle_mass') -^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{g}` - * Particle Type: True - -**Field Source** - -No source available. - -('io', 'particle_ones') -^^^^^^^^^^^^^^^^^^^^^^^ - - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def particle_ones(field, data): - v = np.ones(data[ptype, mass_name].shape, dtype="float64") - return data.apply_units(v, field.units) - - -('io', 'particle_position') -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def particle_vectors(field, data): - v = [data[_ptype, name].in_units(field.units) - for name in names] - c = np.column_stack(v) - return data.apply_units(c, field.units) - - -('io', 'particle_position_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: True - -**Field Source** - -No source available. - -('io', 'particle_position_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: True - -**Field Source** - -No source available. - -('io', 'particle_position_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{code}~\rm{length}` - * Particle Type: True - -**Field Source** - -No source available. - -('io', 'particle_radial_velocity') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_velocity_radius(field, data): - """ - Radial component of the particles' velocity vectors in spherical coords - based on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = spos - pos = YTArray([data[ptype, pos % ax] for ax in "xyz"]) - vel = svel - vel = YTArray([data[ptype, vel % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - vel = vel - np.reshape(bv, (3, 1)) - sphr = get_sph_r_component(vel, theta, phi, normal) - return sphr - - -('io', 'particle_radius') -^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_radius(field, data): - return get_radius(data, "particle_position_") - - -('io', 'particle_specific_angular_momentum') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_specific_angular_momentum(field, data): - """ - Calculate the angular of a particle velocity. Returns a vector for each - particle. - """ - if data.has_field_parameter("bulk_velocity"): - bv = data.get_field_parameter("bulk_velocity") - else: bv = np.zeros(3, dtype=np.float64) - xv = data[ptype, svel % 'x'] - bv[0] - yv = data[ptype, svel % 'y'] - bv[1] - zv = data[ptype, svel % 'z'] - bv[2] - center = data.get_field_parameter('center') - coords = YTArray([data[ptype, spos % 'x'], - data[ptype, spos % 'y'], - data[ptype, spos % 'z']], dtype=np.float64) - new_shape = tuple([3] + [1]*(len(coords.shape)-1)) - r_vec = coords - np.reshape(center,new_shape) - v_vec = YTArray([xv,yv,zv], dtype=np.float64) - return np.cross(r_vec, v_vec, axis=0) - - -('io', 'particle_specific_angular_momentum_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _magnitude(field, data): - fn = field_components[0] - mag = data[fn] * data[fn] - for idim in range(1, registry.ds.dimensionality): - fn = field_components[idim] - mag += data[fn] * data[fn] - return np.sqrt(mag) - - -('io', 'particle_specific_angular_momentum_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_specific_angular_momentum_x(field, data): - if data.has_field_parameter("bulk_velocity"): - bv = data.get_field_parameter("bulk_velocity") - else: bv = np.zeros(3, dtype=np.float64) - center = data.get_field_parameter('center') - y = data[ptype, spos % "y"] - center[1] - z = data[ptype, spos % "z"] - center[2] - yv = data[ptype, svel % "y"] - bv[1] - zv = data[ptype, svel % "z"] - bv[2] - return yv*z - zv*y - - -('io', 'particle_specific_angular_momentum_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_specific_angular_momentum_y(field, data): - if data.has_field_parameter("bulk_velocity"): - bv = data.get_field_parameter("bulk_velocity") - else: bv = np.zeros(3, dtype=np.float64) - center = data.get_field_parameter('center') - x = data[ptype, spos % "x"] - center[0] - z = data[ptype, spos % "z"] - center[2] - xv = data[ptype, svel % "x"] - bv[0] - zv = data[ptype, svel % "z"] - bv[2] - return -(xv*z - zv*x) - - -('io', 'particle_specific_angular_momentum_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}^{2} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_specific_angular_momentum_z(field, data): - if data.has_field_parameter("bulk_velocity"): - bv = data.get_field_parameter("bulk_velocity") - else: bv = np.zeros(3, dtype=np.float64) - center = data.get_field_parameter('center') - x = data[ptype, spos % "x"] - center[0] - y = data[ptype, spos % "y"] - center[1] - xv = data[ptype, svel % "x"] - bv[0] - yv = data[ptype, svel % "y"] - bv[1] - return xv*y - yv*x - - -('io', 'particle_spherical_position_phi') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_position_phi(field, data): - """ - Phi component of the particles' position vectors in spherical coords - on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = spos - pos = YTArray([data[ptype, pos % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - sphp = get_sph_phi_component(pos, phi, normal) - return sphp - - -('io', 'particle_spherical_position_radius') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_position_radius(field, data): - """ - Radial component of the particles' position vectors in spherical coords - on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = spos - pos = YTArray([data[ptype, pos % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - sphr = get_sph_r_component(pos, theta, phi, normal) - return sphr - - -('io', 'particle_spherical_position_theta') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_position_theta(field, data): - """ - Theta component of the particles' position vectors in spherical coords - on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = spos - pos = YTArray([data[ptype, pos % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - spht = get_sph_theta_component(pos, theta, phi, normal) - return spht - - -('io', 'particle_spherical_velocity_phi') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_velocity_phi(field, data): - """ - Phi component of the particles' velocity vectors in spherical coords - based on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = YTArray([data[ptype, spos % ax] for ax in "xyz"]) - vel = YTArray([data[ptype, svel % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - vel = vel - np.reshape(bv, (3, 1)) - sphp = get_sph_phi_component(vel, phi, normal) - return sphp - - -('io', 'particle_spherical_velocity_radius') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_velocity_radius(field, data): - """ - Radial component of the particles' velocity vectors in spherical coords - based on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = spos - pos = YTArray([data[ptype, pos % ax] for ax in "xyz"]) - vel = svel - vel = YTArray([data[ptype, vel % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - vel = vel - np.reshape(bv, (3, 1)) - sphr = get_sph_r_component(vel, theta, phi, normal) - return sphr - - -('io', 'particle_spherical_velocity_theta') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_spherical_velocity_theta(field, data): - """ - Theta component of the particles' velocity vectors in spherical coords - based on the provided field parameters for 'normal', 'center', and - 'bulk_velocity', - """ - normal = data.get_field_parameter('normal') - center = data.get_field_parameter('center') - bv = data.get_field_parameter("bulk_velocity") - pos = spos - pos = YTArray([data[ptype, pos % ax] for ax in "xyz"]) - vel = svel - vel = YTArray([data[ptype, vel % ax] for ax in "xyz"]) - theta = get_sph_theta(pos, center) - phi = get_sph_phi(pos, center) - pos = pos - np.reshape(center, (3, 1)) - vel = vel - np.reshape(bv, (3, 1)) - spht = get_sph_theta_component(vel, theta, phi, normal) - return spht - - -('io', 'particle_velocity') -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def particle_vectors(field, data): - v = [data[_ptype, name].in_units(field.units) - for name in names] - c = np.column_stack(v) - return data.apply_units(c, field.units) - - -('io', 'particle_velocity_magnitude') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -.. code-block:: python - - def _particle_velocity_magnitude(field, data): - """ M{|v|} """ - bulk_velocity = data.get_field_parameter("bulk_velocity") - if bulk_velocity is None: - bulk_velocity = np.zeros(3) - return np.sqrt((data[ptype, svel % 'x'] - bulk_velocity[0])**2 - + (data[ptype, svel % 'y'] - bulk_velocity[1])**2 - + (data[ptype, svel % 'z'] - bulk_velocity[2])**2 ) - - -('io', 'particle_velocity_x') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -No source available. - -('io', 'particle_velocity_y') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -No source available. - -('io', 'particle_velocity_z') -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - * Units: :math:`\rm{cm} / \rm{s}` - * Particle Type: True - -**Field Source** - -No source available. - -.. _ART_specific_fields: - -ART-Specific Fields -------------------- - -================================ ======================================================================================================== ==================== ========= ============ -field name units aliases particle? display name -================================ ======================================================================================================== ==================== ========= ============ -('art', 'Density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 0 -('art', 'TotalEnergy') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}} \cdot \rm{code}~\rm{velocity}^{2}}` ``total_energy`` 0 -('art', 'XMomentumDensity') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_x`` 0 -('art', 'YMomentumDensity') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_y`` 0 -('art', 'ZMomentumDensity') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_z`` 0 -('art', 'Pressure') ``pressure`` 0 -('art', 'Gamma') ``gamma`` 0 -('art', 'GasEnergy') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}} \cdot \rm{code}~\rm{velocity}^{2}}` ``thermal_energy`` 0 -('art', 'MetalDensitySNII') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``metal_ii_density`` 0 -('art', 'MetalDensitySNIa') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``metal_ia_density`` 0 -('art', 'PotentialNew') ``potential`` 0 -('art', 'PotentialOld') ``gas_potential`` 0 -('io', 'particle_position_x') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_y') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_z') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_velocity_x') :math:`\mathrm{\rm{code}~\rm{velocity}}` 1 -('io', 'particle_velocity_y') :math:`\mathrm{\rm{code}~\rm{velocity}}` 1 -('io', 'particle_velocity_z') :math:`\mathrm{\rm{code}~\rm{velocity}}` 1 -('io', 'particle_mass') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'particle_index') 1 -('io', 'particle_species') ``particle_type`` 1 -('io', 'particle_creation_time') :math:`\mathrm{\rm{code}~\rm{time}}` 1 -('io', 'particle_mass_initial') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'particle_metallicity1') 1 -('io', 'particle_metallicity2') 1 -================================ ======================================================================================================== ==================== ========= ============ - -.. _ARTIO_specific_fields: - -ARTIO-Specific Fields ---------------------- - -================================== ======================================================================================================== ======================= ========= ============ -field name units aliases particle? display name -================================== ======================================================================================================== ======================= ========= ============ -('artio', 'HVAR_GAS_DENSITY') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 0 -('artio', 'HVAR_GAS_ENERGY') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}} \cdot \rm{code}~\rm{velocity}^{2}}` ``total_energy`` 0 -('artio', 'HVAR_INTERNAL_ENERGY') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}} \cdot \rm{code}~\rm{velocity}^{2}}` ``thermal_energy`` 0 -('artio', 'HVAR_PRESSURE') ``pressure`` 0 -('artio', 'HVAR_MOMENTUM_X') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_x`` 0 -('artio', 'HVAR_MOMENTUM_Y') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_y`` 0 -('artio', 'HVAR_MOMENTUM_Z') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_z`` 0 -('artio', 'HVAR_GAMMA') ``gamma`` 0 -('artio', 'HVAR_METAL_DENSITY_Ia') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``metal_ia_density`` 0 -('artio', 'HVAR_METAL_DENSITY_II') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``metal_ii_density`` 0 -('artio', 'VAR_POTENTIAL') ``potential`` 0 -('artio', 'VAR_POTENTIAL_HYDRO') ``gas_potential`` 0 -('io', 'POSITION_X') :math:`\mathrm{\rm{code}~\rm{length}}` ``particle_position_x`` 1 -('io', 'POSITION_Y') :math:`\mathrm{\rm{code}~\rm{length}}` ``particle_position_y`` 1 -('io', 'POSITION_Z') :math:`\mathrm{\rm{code}~\rm{length}}` ``particle_position_z`` 1 -('io', 'VELOCITY_X') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity_x`` 1 -('io', 'VELOCITY_Y') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity_y`` 1 -('io', 'VELOCITY_Z') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity_z`` 1 -('io', 'MASS') :math:`\mathrm{\rm{code}~\rm{mass}}` ``particle_mass`` 1 -('io', 'PID') ``particle_index`` 1 -('io', 'SPECIES') ``particle_type`` 1 -('io', 'BIRTH_TIME') 1 -('io', 'INITIAL_MASS') :math:`\mathrm{\rm{code}~\rm{mass}}` ``initial_mass`` 1 -('io', 'METALLICITY_SNIa') ``metallicity_snia`` 1 -('io', 'METALLICITY_SNII') ``metallicity_snii`` 1 -================================== ======================================================================================================== ======================= ========= ============ - -.. _Athena_specific_fields: - -Athena-Specific Fields ----------------------- - -=============================== ====================================================================== ==================== ========= ============ -field name units aliases particle? display name -=============================== ====================================================================== ==================== ========= ============ -('athena', 'density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 0 -('athena', 'cell_centered_B_x') :math:`\mathrm{\rm{code}~\rm{magnetic}}` ``magnetic_field_x`` 0 -('athena', 'cell_centered_B_y') :math:`\mathrm{\rm{code}~\rm{magnetic}}` ``magnetic_field_y`` 0 -('athena', 'cell_centered_B_z') :math:`\mathrm{\rm{code}~\rm{magnetic}}` ``magnetic_field_z`` 0 -=============================== ====================================================================== ==================== ========= ============ - -.. _Boxlib_specific_fields: - -Boxlib-Specific Fields ----------------------- - -============================= ================================================================================================ ================== ========= ============ -field name units aliases particle? display name -============================= ================================================================================================ ================== ========= ============ -('boxlib', 'density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 0 -('boxlib', 'eden') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length} \cdot \rm{code}~\rm{time}^{2}}}` ``energy_density`` 0 -('boxlib', 'xmom') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_x`` 0 -('boxlib', 'ymom') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_y`` 0 -('boxlib', 'zmom') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_z`` 0 -('boxlib', 'temperature') :math:`\mathrm{\rm{K}}` ``temperature`` 0 -('boxlib', 'Temp') :math:`\mathrm{\rm{K}}` ``temperature`` 0 -('boxlib', 'x_velocity') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_x`` 0 -('boxlib', 'y_velocity') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_y`` 0 -('boxlib', 'z_velocity') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_z`` 0 -('boxlib', 'xvel') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_x`` 0 -('boxlib', 'yvel') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_y`` 0 -('boxlib', 'zvel') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_z`` 0 -('io', 'particle_mass') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'particle_position_x') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_y') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_z') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_momentum_x') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` 1 -('io', 'particle_momentum_y') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` 1 -('io', 'particle_momentum_z') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` 1 -('io', 'particle_angmomen_x') :math:`\mathrm{\rm{code}~\rm{length}^{2} / \rm{code}~\rm{time}}` 1 -('io', 'particle_angmomen_y') :math:`\mathrm{\rm{code}~\rm{length}^{2} / \rm{code}~\rm{time}}` 1 -('io', 'particle_angmomen_z') :math:`\mathrm{\rm{code}~\rm{length}^{2} / \rm{code}~\rm{time}}` 1 -('io', 'particle_id') ``particle_index`` 1 -('io', 'particle_mdot') :math:`\mathrm{\rm{code}~\rm{mass} / \rm{code}~\rm{time}}` 1 -============================= ================================================================================================ ================== ========= ============ - -.. _Castro_specific_fields: - -Castro-Specific Fields ----------------------- - -======================== ======================================================== ======================= ========= ===================================== -field name units aliases particle? display name -======================== ======================================================== ======================= ========= ===================================== -('boxlib', 'density') :math:`\mathrm{\frac{\rm{g}}{\rm{cm}^{3}}}` ``density`` 0 :math:`\rho` -('boxlib', 'xmom') :math:`\mathrm{\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}}}` ``momentum_x`` 0 :math:`\rho u` -('boxlib', 'ymom') :math:`\mathrm{\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}}}` ``momentum_y`` 0 :math:`\rho v` -('boxlib', 'zmom') :math:`\mathrm{\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}}}` ``momentum_z`` 0 :math:`\rho w` -('boxlib', 'x_velocity') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_x`` 0 :math:`u` -('boxlib', 'y_velocity') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_y`` 0 :math:`v` -('boxlib', 'z_velocity') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_z`` 0 :math:`w` -('boxlib', 'rho_E') :math:`\mathrm{\frac{\rm{erg}}{\rm{cm}^{3}}}` ``energy_density`` 0 :math:`\rho E` -('boxlib', 'rho_e') :math:`\mathrm{\frac{\rm{erg}}{\rm{cm}^{3}}}` 0 :math:`\rho e` -('boxlib', 'Temp') :math:`\mathrm{\rm{K}}` ``temperature`` 0 :math:`T` -('boxlib', 'grav_x') :math:`\mathrm{\frac{\rm{cm}}{\rm{s}^{2}}}` 0 :math:`\mathbf{g} \cdot \mathbf{e}_x` -('boxlib', 'grav_y') :math:`\mathrm{\frac{\rm{cm}}{\rm{s}^{2}}}` 0 :math:`\mathbf{g} \cdot \mathbf{e}_y` -('boxlib', 'grav_z') :math:`\mathrm{\frac{\rm{cm}}{\rm{s}^{2}}}` 0 :math:`\mathbf{g} \cdot \mathbf{e}_z` -('boxlib', 'pressure') :math:`\mathrm{\frac{\rm{dyne}}{\rm{cm}^{2}}}` 0 :math:`p` -('boxlib', 'kineng') :math:`\mathrm{\frac{\rm{erg}}{\rm{cm}^{3}}}` ``kinetic_energy`` 0 :math:`\frac{1}{2}\rho|\mathbf{U}|^2` -('boxlib', 'soundspeed') :math:`\mathrm{\rm{cm} / \rm{s}}` ``sound_speed`` 0 :math:`Sound Speed` -('boxlib', 'Machnumber') ``mach_number`` 0 :math:`Mach Number` -('boxlib', 'entropy') :math:`\mathrm{\frac{\rm{erg}}{\rm{K} \cdot \rm{g}}}` ``entropy`` 0 :math:`s` -('boxlib', 'magvort') :math:`\mathrm{1 / \rm{s}}` ``vorticity_magnitude`` 0 :math:`|\nabla \times \mathbf{U}|` -('boxlib', 'divu') :math:`\mathrm{1 / \rm{s}}` ``velocity_divergence`` 0 :math:`\nabla \cdot \mathbf{U}` -('boxlib', 'eint_E') :math:`\mathrm{\rm{erg} / \rm{g}}` 0 :math:`e(E,U)` -('boxlib', 'eint_e') :math:`\mathrm{\rm{erg} / \rm{g}}` 0 :math:`e` -('boxlib', 'magvel') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_magnitude`` 0 :math:`|\mathbf{U}|` -('boxlib', 'radvel') :math:`\mathrm{\rm{cm} / \rm{s}}` ``radial_velocity`` 0 :math:`\mathbf{U} \cdot \mathbf{e}_r` -('boxlib', 'magmom') :math:`\mathrm{\rm{cm} \cdot \rm{g} / \rm{s}}` ``momentum_magnitude`` 0 :math:`\rho |\mathbf{U}|` -('boxlib', 'maggrav') :math:`\mathrm{\frac{\rm{cm}}{\rm{s}^{2}}}` 0 :math:`|\mathbf{g}|` -('boxlib', 'phiGrav') :math:`\mathrm{\rm{erg} / \rm{g}}` 0 :math:`\Phi` -======================== ======================================================== ======================= ========= ===================================== - -.. _Maestro_specific_fields: - -Maestro-Specific Fields ------------------------ - -============================= ===================================================== ======================= ========= =============================================== -field name units aliases particle? display name -============================= ===================================================== ======================= ========= =============================================== -('boxlib', 'density') :math:`\mathrm{\frac{\rm{g}}{\rm{cm}^{3}}}` ``density`` 0 -('boxlib', 'x_vel') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_x`` 0 :math:`\tilde{u}` -('boxlib', 'y_vel') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_y`` 0 :math:`\tilde{v}` -('boxlib', 'z_vel') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_z`` 0 :math:`\tilde{w}` -('boxlib', 'magvel') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_magnitude`` 0 :math:`|\tilde{\mathbf{U}} + w_0 \mathbf{e}_r|` -('boxlib', 'radial_velocity') :math:`\mathrm{\rm{cm} / \rm{s}}` ``radial_velocity`` 0 :math:`\mathbf{U}\cdot \mathbf{e}_r` -('boxlib', 'circum_velocity') :math:`\mathrm{\rm{cm} / \rm{s}}` ``tangential_velocity`` 0 :math:`U - U\cdot e_r` -('boxlib', 'tfromp') :math:`\mathrm{\rm{K}}` 0 :math:`T(\rho,p,X)` -('boxlib', 'tfromh') :math:`\mathrm{\rm{K}}` 0 :math:`T(\rho,h,X)` -('boxlib', 'Machnumber') ``mach_number`` 0 :math:`M` -('boxlib', 'S') :math:`\mathrm{1 / \rm{s}}` 0 -('boxlib', 'ad_excess') 0 :math:`\nabla - \nabla_\mathrm{ad}` -('boxlib', 'deltaT') 0 :math:`[T(\rho,h,X) - T(\rho,p,X)]/T(\rho,h,X)` -('boxlib', 'deltagamma') 0 :math:`\Gamma_1 - \overline{\Gamma_1}` -('boxlib', 'deltap') 0 :math:`[p(\rho,h,X) - p_0] / p_0` -('boxlib', 'divw0') :math:`\mathrm{1 / \rm{s}}` 0 :math:`\nabla \cdot \mathbf{w}_0` -('boxlib', 'entropy') :math:`\mathrm{\frac{\rm{erg}}{\rm{K} \cdot \rm{g}}}` ``entropy`` 0 :math:`s` -('boxlib', 'entropypert') 0 :math:`[s - \overline{s}] / \overline{s}` -('boxlib', 'enucdot') :math:`\mathrm{\frac{\rm{erg}}{\rm{g} \cdot \rm{s}}}` 0 :math:`\dot{\epsilon}_{nuc}` -('boxlib', 'Hext') :math:`\mathrm{\frac{\rm{erg}}{\rm{g} \cdot \rm{s}}}` 0 :math:`H_{ext}` -('boxlib', 'gpi_x') :math:`\mathrm{\frac{\rm{dyne}}{\rm{cm}^{3}}}` 0 :math:`\left(\nabla\pi\right)_x` -('boxlib', 'gpi_y') :math:`\mathrm{\frac{\rm{dyne}}{\rm{cm}^{3}}}` 0 :math:`\left(\nabla\pi\right)_y` -('boxlib', 'gpi_z') :math:`\mathrm{\frac{\rm{dyne}}{\rm{cm}^{3}}}` 0 :math:`\left(\nabla\pi\right)_z` -('boxlib', 'h') :math:`\mathrm{\rm{erg} / \rm{g}}` 0 :math:`h` -('boxlib', 'h0') :math:`\mathrm{\rm{erg} / \rm{g}}` 0 :math:`h_0` -('boxlib', 'momentum') :math:`\mathrm{\rm{cm} \cdot \rm{g} / \rm{s}}` ``momentum_magnitude`` 0 :math:`\rho |\mathbf{U}|` -('boxlib', 'p0') :math:`\mathrm{\frac{\rm{erg}}{\rm{cm}^{3}}}` 0 :math:`p_0` -('boxlib', 'p0pluspi') :math:`\mathrm{\frac{\rm{erg}}{\rm{cm}^{3}}}` 0 :math:`p_0 + \pi` -('boxlib', 'pi') :math:`\mathrm{\frac{\rm{erg}}{\rm{cm}^{3}}}` 0 :math:`\pi` -('boxlib', 'pioverp0') 0 :math:`\pi/p_0` -('boxlib', 'rho0') :math:`\mathrm{\frac{\rm{g}}{\rm{cm}^{3}}}` 0 :math:`\rho_0` -('boxlib', 'rhoh') :math:`\mathrm{\frac{\rm{erg}}{\rm{cm}^{3}}}` ``enthalpy_density`` 0 :math:`(\rho h)` -('boxlib', 'rhoh0') :math:`\mathrm{\frac{\rm{erg}}{\rm{cm}^{3}}}` 0 :math:`(\rho h)_0` -('boxlib', 'rhohpert') :math:`\mathrm{\frac{\rm{erg}}{\rm{cm}^{3}}}` 0 :math:`(\rho h)^\prime` -('boxlib', 'rhopert') :math:`\mathrm{\frac{\rm{g}}{\rm{cm}^{3}}}` 0 :math:`\rho^\prime` -('boxlib', 'soundspeed') :math:`\mathrm{\rm{cm} / \rm{s}}` ``sound_speed`` 0 -('boxlib', 'sponge') 0 -('boxlib', 'tpert') :math:`\mathrm{\rm{K}}` 0 :math:`T - \overline{T}` -('boxlib', 'vort') :math:`\mathrm{1 / \rm{s}}` ``vorticity_magnitude`` 0 :math:`|\nabla\times\tilde{U}|` -('boxlib', 'w0_x') :math:`\mathrm{\rm{cm} / \rm{s}}` 0 :math:`(w_0)_x` -('boxlib', 'w0_y') :math:`\mathrm{\rm{cm} / \rm{s}}` 0 :math:`(w_0)_y` -('boxlib', 'w0_z') :math:`\mathrm{\rm{cm} / \rm{s}}` 0 :math:`(w_0)_z` -============================= ===================================================== ======================= ========= =============================================== - -.. _Orion_specific_fields: - -Orion-Specific Fields ---------------------- - -============================= ================================================================================================ ================== ========= ============ -field name units aliases particle? display name -============================= ================================================================================================ ================== ========= ============ -('boxlib', 'density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 0 -('boxlib', 'eden') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length} \cdot \rm{code}~\rm{time}^{2}}}` ``energy_density`` 0 -('boxlib', 'xmom') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_x`` 0 -('boxlib', 'ymom') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_y`` 0 -('boxlib', 'zmom') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_z`` 0 -('boxlib', 'temperature') :math:`\mathrm{\rm{K}}` ``temperature`` 0 -('boxlib', 'Temp') :math:`\mathrm{\rm{K}}` ``temperature`` 0 -('boxlib', 'x_velocity') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_x`` 0 -('boxlib', 'y_velocity') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_y`` 0 -('boxlib', 'z_velocity') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_z`` 0 -('boxlib', 'xvel') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_x`` 0 -('boxlib', 'yvel') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_y`` 0 -('boxlib', 'zvel') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_z`` 0 -('io', 'particle_mass') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'particle_position_x') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_y') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_z') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_momentum_x') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` 1 -('io', 'particle_momentum_y') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` 1 -('io', 'particle_momentum_z') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` 1 -('io', 'particle_angmomen_x') :math:`\mathrm{\rm{code}~\rm{length}^{2} / \rm{code}~\rm{time}}` 1 -('io', 'particle_angmomen_y') :math:`\mathrm{\rm{code}~\rm{length}^{2} / \rm{code}~\rm{time}}` 1 -('io', 'particle_angmomen_z') :math:`\mathrm{\rm{code}~\rm{length}^{2} / \rm{code}~\rm{time}}` 1 -('io', 'particle_id') ``particle_index`` 1 -('io', 'particle_mdot') :math:`\mathrm{\rm{code}~\rm{mass} / \rm{code}~\rm{time}}` 1 -============================= ================================================================================================ ================== ========= ============ - -.. _ChomboPIC_specific_fields: - -ChomboPIC-Specific Fields -------------------------- - -=================================== ========================================================================== =========================== ========= ============ -field name units aliases particle? display name -=================================== ========================================================================== =========================== ========= ============ -('chombo', 'density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` ``Density`` 0 -('chombo', 'potential') :math:`\mathrm{\frac{\rm{code}~\rm{length}^{2}}{\rm{code}~\rm{time}^{2}}}` ``potential`` ``Potential`` 0 -('chombo', 'gravitational_field_x') :math:`\mathrm{\frac{\rm{code}~\rm{length}}{\rm{code}~\rm{time}^{2}}}` 0 -('chombo', 'gravitational_field_y') :math:`\mathrm{\frac{\rm{code}~\rm{length}}{\rm{code}~\rm{time}^{2}}}` 0 -('chombo', 'gravitational_field_z') :math:`\mathrm{\frac{\rm{code}~\rm{length}}{\rm{code}~\rm{time}^{2}}}` 0 -('io', 'particle_mass') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'particle_position_x') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_y') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_z') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_velocity_x') :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}` 1 -('io', 'particle_velocity_y') :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}` 1 -('io', 'particle_velocity_z') :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}` 1 -=================================== ========================================================================== =========================== ========= ============ - -.. _Orion2_specific_fields: - -Orion2-Specific Fields ----------------------- - -====================================== ================================================================================================ ============================ ========= ============ -field name units aliases particle? display name -====================================== ================================================================================================ ============================ ========= ============ -('chombo', 'density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 0 -('chombo', 'energy-density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length} \cdot \rm{code}~\rm{time}^{2}}}` ``energy_density`` 0 -('chombo', 'radiation-energy-density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length} \cdot \rm{code}~\rm{time}^{2}}}` ``radiation_energy_density`` 0 -('chombo', 'X-momentum') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_x`` 0 -('chombo', 'Y-momentum') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_y`` 0 -('chombo', 'Z-momentum') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` ``momentum_z`` 0 -('chombo', 'temperature') :math:`\mathrm{\rm{K}}` ``temperature`` 0 -('chombo', 'X-magnfield') :math:`\mathrm{\rm{gauss}}` ``magnetic_field_x`` 0 -('chombo', 'Y-magnfield') :math:`\mathrm{\rm{gauss}}` ``magnetic_field_y`` 0 -('chombo', 'Z-magnfield') :math:`\mathrm{\rm{gauss}}` ``magnetic_field_z`` 0 -('io', 'particle_mass') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'particle_position_x') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_y') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_z') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_momentum_x') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` 1 -('io', 'particle_momentum_y') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` 1 -('io', 'particle_momentum_z') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{2} \cdot \rm{code}~\rm{time}}}` 1 -('io', 'particle_angmomen_x') :math:`\mathrm{\rm{code}~\rm{length}^{2} / \rm{code}~\rm{time}}` 1 -('io', 'particle_angmomen_y') :math:`\mathrm{\rm{code}~\rm{length}^{2} / \rm{code}~\rm{time}}` 1 -('io', 'particle_angmomen_z') :math:`\mathrm{\rm{code}~\rm{length}^{2} / \rm{code}~\rm{time}}` 1 -('io', 'particle_mlast') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'particle_r') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_mdeut') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'particle_n') 1 -('io', 'particle_mdot') :math:`\mathrm{\rm{code}~\rm{mass} / \rm{code}~\rm{time}}` 1 -('io', 'particle_burnstate') 1 -('io', 'particle_luminosity') 1 -('io', 'particle_id') ``particle_index`` 1 -====================================== ================================================================================================ ============================ ========= ============ - -.. _Pluto_specific_fields: - -Pluto-Specific Fields ---------------------- - -================= ================================================================================================ ==================== ========= ============ -field name units aliases particle? display name -================= ================================================================================================ ==================== ========= ============ -('chombo', 'rho') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 0 -('chombo', 'prs') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length} \cdot \rm{code}~\rm{time}^{2}}}` ``pressure`` 0 -('chombo', 'vx1') :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}` ``velocity_x`` 0 -('chombo', 'vx2') :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}` ``velocity_y`` 0 -('chombo', 'vx3') :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}` ``velocity_z`` 0 -('chombo', 'bx1') :math:`\mathrm{\rm{code}~\rm{magnetic}}` ``magnetic_field_x`` 0 -('chombo', 'bx2') :math:`\mathrm{\rm{code}~\rm{magnetic}}` ``magnetic_field_y`` 0 -('chombo', 'bx3') :math:`\mathrm{\rm{code}~\rm{magnetic}}` ``magnetic_field_z`` 0 -================= ================================================================================================ ==================== ========= ============ - -.. _Eagle_specific_fields: - -Eagle-Specific Fields ---------------------- - -============================ ====================================================================== ===================== ========= ============ -field name units aliases particle? display name -============================ ====================================================================== ===================== ========= ============ -('io', 'Mass') :math:`\mathrm{\rm{code}~\rm{mass}}` ``particle_mass`` 1 -('io', 'Masses') :math:`\mathrm{\rm{code}~\rm{mass}}` ``particle_mass`` 1 -('io', 'Coordinates') :math:`\mathrm{\rm{code}~\rm{length}}` ``particle_position`` 1 -('io', 'Velocity') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity`` 1 -('io', 'Velocities') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity`` 1 -('io', 'ParticleIDs') ``particle_index`` 1 -('io', 'InternalEnergy') ``thermal_energy`` 1 -('io', 'SmoothingLength') :math:`\mathrm{\rm{code}~\rm{length}}` ``smoothing_length`` 1 -('io', 'Density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 1 -('io', 'MaximumTemperature') :math:`\mathrm{\rm{K}}` 1 -('io', 'Temperature') :math:`\mathrm{\rm{K}}` ``temperature`` 1 -('io', 'Epsilon') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'Metals') :math:`\mathrm{\rm{code}~\rm{metallicity}}` ``metallicity`` 1 -('io', 'Metallicity') :math:`\mathrm{\rm{code}~\rm{metallicity}}` ``metallicity`` 1 -('io', 'Phi') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'FormationTime') :math:`\mathrm{\rm{code}~\rm{time}}` ``creation_time`` 1 -('io', 'Metallicity_00') ``metallicity`` 1 -('io', 'Metallicity_01') ``He_fraction`` 1 -('io', 'Metallicity_02') ``C_fraction`` 1 -('io', 'Metallicity_03') ``N_fraction`` 1 -('io', 'Metallicity_04') ``O_fraction`` 1 -('io', 'Metallicity_05') ``Ne_fraction`` 1 -('io', 'Metallicity_06') ``Mg_fraction`` 1 -('io', 'Metallicity_07') ``Si_fraction`` 1 -('io', 'Metallicity_08') ``S_fraction`` 1 -('io', 'Metallicity_09') ``Ca_fraction`` 1 -('io', 'Metallicity_10') ``Fe_fraction`` 1 -============================ ====================================================================== ===================== ========= ============ - -.. _Enzo_specific_fields: - -Enzo-Specific Fields --------------------- - -================================ ====================================================================== ============================ ========= ============ -field name units aliases particle? display name -================================ ====================================================================== ============================ ========= ============ -('enzo', 'Cooling_Time') :math:`\mathrm{\rm{s}}` ``cooling_time`` 0 -('enzo', 'Dengo_Cooling_Rate') :math:`\mathrm{\frac{\rm{erg}}{\rm{g} \cdot \rm{s}}}` 0 -('enzo', 'Grackle_Cooling_Rate') :math:`\mathrm{\frac{\rm{erg}}{\rm{cm}^{3} \cdot \rm{s}}}` 0 -('enzo', 'HI_kph') :math:`\mathrm{1 / \rm{code}~\rm{time}}` 0 -('enzo', 'HeI_kph') :math:`\mathrm{1 / \rm{code}~\rm{time}}` 0 -('enzo', 'HeII_kph') :math:`\mathrm{1 / \rm{code}~\rm{time}}` 0 -('enzo', 'H2I_kdiss') :math:`\mathrm{1 / \rm{code}~\rm{time}}` 0 -('enzo', 'Bx') :math:`\mathrm{\rm{code}~\rm{magnetic}}` ``magnetic_field_x`` 0 -('enzo', 'By') :math:`\mathrm{\rm{code}~\rm{magnetic}}` ``magnetic_field_y`` 0 -('enzo', 'Bz') :math:`\mathrm{\rm{code}~\rm{magnetic}}` ``magnetic_field_z`` 0 -('enzo', 'RadAccel1') :math:`\mathrm{\frac{\rm{code}~\rm{length}}{\rm{code}~\rm{time}^{2}}}` ``radiation_acceleration_x`` 0 -('enzo', 'RadAccel2') :math:`\mathrm{\frac{\rm{code}~\rm{length}}{\rm{code}~\rm{time}^{2}}}` ``radiation_acceleration_y`` 0 -('enzo', 'RadAccel3') :math:`\mathrm{\frac{\rm{code}~\rm{length}}{\rm{code}~\rm{time}^{2}}}` ``radiation_acceleration_z`` 0 -('enzo', 'Dark_Matter_Density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``dark_matter_density`` 0 -('enzo', 'Temperature') :math:`\mathrm{\rm{K}}` ``temperature`` 0 -('enzo', 'Dust_Temperature') :math:`\mathrm{\rm{K}}` ``dust_temperature`` 0 -('enzo', 'x-velocity') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``velocity_x`` 0 -('enzo', 'y-velocity') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``velocity_y`` 0 -('enzo', 'z-velocity') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``velocity_z`` 0 -('enzo', 'RaySegments') ``ray_segments`` 0 -('enzo', 'PhotoGamma') :math:`\mathrm{\frac{\rm{code}~\rm{length}}{\rm{code}~\rm{time}^{2}}}` ``photo_gamma`` 0 -('enzo', 'PotentialField') :math:`\mathrm{\rm{code}~\rm{velocity}^{2}}` ``gravitational_potential`` 0 -('enzo', 'Density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 0 -('enzo', 'Metal_Density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``metal_density`` 0 -('enzo', 'SN_Colour') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` 0 -('enzo', 'Electron_Density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` 0 -('io', 'particle_position_x') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_y') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_z') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_velocity_x') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity_x`` 1 -('io', 'particle_velocity_y') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity_y`` 1 -('io', 'particle_velocity_z') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity_z`` 1 -('io', 'creation_time') :math:`\mathrm{\rm{code}~\rm{time}}` 1 -('io', 'dynamical_time') :math:`\mathrm{\rm{code}~\rm{time}}` 1 -('io', 'metallicity_fraction') :math:`\mathrm{\rm{code}~\rm{metallicity}}` 1 -('io', 'metallicity') 1 -('io', 'particle_type') 1 -('io', 'particle_index') 1 -('io', 'particle_mass') :math:`\mathrm{\rm{code}~\rm{mass}}` ``particle_mass`` 1 -('io', 'GridID') 1 -('io', 'identifier') ``particle_index`` 1 -('io', 'level') 1 -================================ ====================================================================== ============================ ========= ============ - -.. _FLASH_specific_fields: - -FLASH-Specific Fields ---------------------- - -======================= ==================================================================================================== =========================== ========= =================================================== -field name units aliases particle? display name -======================= ==================================================================================================== =========================== ========= =================================================== -('flash', 'velx') :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}` ``velocity_x`` 0 -('flash', 'vely') :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}` ``velocity_y`` 0 -('flash', 'velz') :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}` ``velocity_z`` 0 -('flash', 'dens') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 0 -('flash', 'temp') :math:`\mathrm{\rm{code}~\rm{temperature}}` ``temperature`` 0 -('flash', 'pres') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length} \cdot \rm{code}~\rm{time}^{2}}}` ``pressure`` 0 -('flash', 'gpot') :math:`\mathrm{\frac{\rm{code}~\rm{length}^{2}}{\rm{code}~\rm{time}^{2}}}` ``gravitational_potential`` 0 -('flash', 'gpol') :math:`\mathrm{\frac{\rm{code}~\rm{length}^{2}}{\rm{code}~\rm{time}^{2}}}` 0 -('flash', 'tion') :math:`\mathrm{\rm{code}~\rm{temperature}}` 0 -('flash', 'tele') :math:`\mathrm{\rm{code}~\rm{temperature}}` 0 -('flash', 'trad') :math:`\mathrm{\rm{code}~\rm{temperature}}` 0 -('flash', 'pion') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length} \cdot \rm{code}~\rm{time}^{2}}}` 0 -('flash', 'pele') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length} \cdot \rm{code}~\rm{time}^{2}}}` 0 :math:`Electron Pressure, P_e` -('flash', 'prad') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length} \cdot \rm{code}~\rm{time}^{2}}}` 0 :math:`Radiation Pressure` -('flash', 'eion') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{time}^{2}} \cdot \rm{code}~\rm{length}^{2}}` 0 :math:`Ion Internal Energy` -('flash', 'eele') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{time}^{2}} \cdot \rm{code}~\rm{length}^{2}}` 0 :math:`Electron Internal Energy` -('flash', 'erad') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{time}^{2}} \cdot \rm{code}~\rm{length}^{2}}` 0 :math:`Radiation Internal Energy` -('flash', 'pden') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` 0 -('flash', 'depo') :math:`\mathrm{\frac{\rm{code}~\rm{length}^{2}}{\rm{code}~\rm{time}^{2}}}` 0 -('flash', 'ye') 0 :math:`Y_e` -('flash', 'magp') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length} \cdot \rm{code}~\rm{time}^{2}}}` 0 -('flash', 'divb') :math:`\mathrm{\rm{code}~\rm{length} \cdot \rm{code}~\rm{magnetic}}` 0 -('flash', 'game') 0 :math:`\gamma_e\/\rm{(ratio\/of\/specific\/heats)}` -('flash', 'gamc') 0 :math:`\gamma_c\/\rm{(ratio\/of\/specific\/heats)}` -('flash', 'flam') 0 -('flash', 'absr') 0 :math:`Absorption Coefficient` -('flash', 'emis') 0 :math:`Emissivity` -('flash', 'cond') 0 :math:`Conductivity` -('flash', 'dfcf') 0 :math:`Diffusion Equation Scalar` -('flash', 'fllm') 0 :math:`Flux Limit` -('flash', 'pipe') 0 :math:`P_i/P_e` -('flash', 'tite') 0 :math:`T_i/T_e` -('flash', 'dbgs') 0 :math:`Debug for Shocks` -('flash', 'cham') 0 :math:`Chamber Material Fraction` -('flash', 'targ') 0 :math:`Target Material Fraction` -('flash', 'sumy') 0 -('flash', 'mgdc') 0 :math:`Emission Minus Absorption Diffusion Terms` -('flash', 'magx') :math:`\mathrm{\rm{code}~\rm{magnetic}}` ``magnetic_field_x`` 0 :math:`B_x` -('flash', 'magy') :math:`\mathrm{\rm{code}~\rm{magnetic}}` ``magnetic_field_y`` 0 :math:`B_y` -('flash', 'magz') :math:`\mathrm{\rm{code}~\rm{magnetic}}` ``magnetic_field_z`` 0 :math:`B_z` -('io', 'particle_posx') :math:`\mathrm{\rm{code}~\rm{length}}` ``particle_position_x`` 1 -('io', 'particle_posy') :math:`\mathrm{\rm{code}~\rm{length}}` ``particle_position_y`` 1 -('io', 'particle_posz') :math:`\mathrm{\rm{code}~\rm{length}}` ``particle_position_z`` 1 -('io', 'particle_velx') :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}` ``particle_velocity_x`` 1 -('io', 'particle_vely') :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}` ``particle_velocity_y`` 1 -('io', 'particle_velz') :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}` ``particle_velocity_z`` 1 -('io', 'particle_tag') ``particle_index`` 1 -('io', 'particle_mass') :math:`\mathrm{\rm{code}~\rm{mass}}` ``particle_mass`` 1 -======================= ==================================================================================================== =========================== ========= =================================================== - -.. _Gadget_specific_fields: - -Gadget-Specific Fields ----------------------- - -============================ ====================================================================== ===================== ========= ============ -field name units aliases particle? display name -============================ ====================================================================== ===================== ========= ============ -('io', 'Mass') :math:`\mathrm{\rm{code}~\rm{mass}}` ``particle_mass`` 1 -('io', 'Masses') :math:`\mathrm{\rm{code}~\rm{mass}}` ``particle_mass`` 1 -('io', 'Coordinates') :math:`\mathrm{\rm{code}~\rm{length}}` ``particle_position`` 1 -('io', 'Velocity') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity`` 1 -('io', 'Velocities') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity`` 1 -('io', 'ParticleIDs') ``particle_index`` 1 -('io', 'InternalEnergy') ``thermal_energy`` 1 -('io', 'SmoothingLength') :math:`\mathrm{\rm{code}~\rm{length}}` ``smoothing_length`` 1 -('io', 'Density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 1 -('io', 'MaximumTemperature') :math:`\mathrm{\rm{K}}` 1 -('io', 'Temperature') :math:`\mathrm{\rm{K}}` ``temperature`` 1 -('io', 'Epsilon') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'Metals') :math:`\mathrm{\rm{code}~\rm{metallicity}}` ``metallicity`` 1 -('io', 'Metallicity') :math:`\mathrm{\rm{code}~\rm{metallicity}}` ``metallicity`` 1 -('io', 'Phi') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'FormationTime') :math:`\mathrm{\rm{code}~\rm{time}}` ``creation_time`` 1 -('io', 'Metallicity_00') ``metallicity`` 1 -('io', 'Metallicity_01') ``He_fraction`` 1 -('io', 'Metallicity_02') ``C_fraction`` 1 -('io', 'Metallicity_03') ``N_fraction`` 1 -('io', 'Metallicity_04') ``O_fraction`` 1 -('io', 'Metallicity_05') ``Ne_fraction`` 1 -('io', 'Metallicity_06') ``Mg_fraction`` 1 -('io', 'Metallicity_07') ``Si_fraction`` 1 -('io', 'Metallicity_08') ``S_fraction`` 1 -('io', 'Metallicity_09') ``Ca_fraction`` 1 -('io', 'Metallicity_10') ``Fe_fraction`` 1 -============================ ====================================================================== ===================== ========= ============ - -.. _GDF_specific_fields: - -GDF-Specific Fields -------------------- - -========================== ============================================= ==================== ========= ============ -field name units aliases particle? display name -========================== ============================================= ==================== ========= ============ -('gdf', 'density') :math:`\mathrm{\frac{\rm{g}}{\rm{cm}^{3}}}` ``density`` 0 -('gdf', 'specific_energy') :math:`\mathrm{\rm{erg} / \rm{g}}` ``thermal_energy`` 0 -('gdf', 'pressure') :math:`\mathrm{\frac{\rm{erg}}{\rm{cm}^{3}}}` ``pressure`` 0 -('gdf', 'temperature') :math:`\mathrm{\rm{K}}` ``temperature`` 0 -('gdf', 'velocity_x') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_x`` 0 -('gdf', 'velocity_y') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_y`` 0 -('gdf', 'velocity_z') :math:`\mathrm{\rm{cm} / \rm{s}}` ``velocity_z`` 0 -('gdf', 'mag_field_x') :math:`\mathrm{\rm{gauss}}` ``magnetic_field_x`` 0 -('gdf', 'mag_field_y') :math:`\mathrm{\rm{gauss}}` ``magnetic_field_y`` 0 -('gdf', 'mag_field_z') :math:`\mathrm{\rm{gauss}}` ``magnetic_field_z`` 0 -========================== ============================================= ==================== ========= ============ - -.. _HaloCatalog_specific_fields: - -HaloCatalog-Specific Fields ---------------------------- - -============================= ================================= ======= ========= ===================== -field name units aliases particle? display name -============================= ================================= ======= ========= ===================== -('io', 'particle_identifier') 1 -('io', 'particle_position_x') :math:`\mathrm{\rm{cm}}` 1 -('io', 'particle_position_y') :math:`\mathrm{\rm{cm}}` 1 -('io', 'particle_position_z') :math:`\mathrm{\rm{cm}}` 1 -('io', 'particle_velocity_x') :math:`\mathrm{\rm{cm} / \rm{s}}` 1 -('io', 'particle_velocity_y') :math:`\mathrm{\rm{cm} / \rm{s}}` 1 -('io', 'particle_velocity_z') :math:`\mathrm{\rm{cm} / \rm{s}}` 1 -('io', 'particle_mass') :math:`\mathrm{\rm{g}}` 1 :math:`Virial Mass` -('io', 'virial_radius') :math:`\mathrm{\rm{cm}}` 1 :math:`Virial Radius` -============================= ================================= ======= ========= ===================== - -.. _OWLS_specific_fields: - -OWLS-Specific Fields --------------------- - -============================ ====================================================================== ===================== ========= ============ -field name units aliases particle? display name -============================ ====================================================================== ===================== ========= ============ -('io', 'Mass') :math:`\mathrm{\rm{code}~\rm{mass}}` ``particle_mass`` 1 -('io', 'Masses') :math:`\mathrm{\rm{code}~\rm{mass}}` ``particle_mass`` 1 -('io', 'Coordinates') :math:`\mathrm{\rm{code}~\rm{length}}` ``particle_position`` 1 -('io', 'Velocity') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity`` 1 -('io', 'Velocities') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity`` 1 -('io', 'ParticleIDs') ``particle_index`` 1 -('io', 'InternalEnergy') ``thermal_energy`` 1 -('io', 'SmoothingLength') :math:`\mathrm{\rm{code}~\rm{length}}` ``smoothing_length`` 1 -('io', 'Density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 1 -('io', 'MaximumTemperature') :math:`\mathrm{\rm{K}}` 1 -('io', 'Temperature') :math:`\mathrm{\rm{K}}` ``temperature`` 1 -('io', 'Epsilon') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'Metals') :math:`\mathrm{\rm{code}~\rm{metallicity}}` ``metallicity`` 1 -('io', 'Metallicity') :math:`\mathrm{\rm{code}~\rm{metallicity}}` ``metallicity`` 1 -('io', 'Phi') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'FormationTime') :math:`\mathrm{\rm{code}~\rm{time}}` ``creation_time`` 1 -('io', 'Metallicity_00') ``metallicity`` 1 -('io', 'Metallicity_01') ``He_fraction`` 1 -('io', 'Metallicity_02') ``C_fraction`` 1 -('io', 'Metallicity_03') ``N_fraction`` 1 -('io', 'Metallicity_04') ``O_fraction`` 1 -('io', 'Metallicity_05') ``Ne_fraction`` 1 -('io', 'Metallicity_06') ``Mg_fraction`` 1 -('io', 'Metallicity_07') ``Si_fraction`` 1 -('io', 'Metallicity_08') ``S_fraction`` 1 -('io', 'Metallicity_09') ``Ca_fraction`` 1 -('io', 'Metallicity_10') ``Fe_fraction`` 1 -============================ ====================================================================== ===================== ========= ============ - -.. _OWLSSubfind_specific_fields: - -OWLSSubfind-Specific Fields ---------------------------- - -================================ ========================================================== ======================= ========= ============ -field name units aliases particle? display name -================================ ========================================================== ======================= ========= ============ -('io', 'CenterOfMass_0') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` ``particle_position_x`` 1 -('io', 'CenterOfMass_1') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` ``particle_position_y`` 1 -('io', 'CenterOfMass_2') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` ``particle_position_z`` 1 -('io', 'CenterOfMassVelocity_0') :math:`\mathrm{100000.0 \cdot \rm{m}/(1+z) / \rm{s}}` ``particle_velocity_x`` 1 -('io', 'CenterOfMassVelocity_1') :math:`\mathrm{100000.0 \cdot \rm{m}/(1+z) / \rm{s}}` ``particle_velocity_y`` 1 -('io', 'CenterOfMassVelocity_2') :math:`\mathrm{100000.0 \cdot \rm{m}/(1+z) / \rm{s}}` ``particle_velocity_z`` 1 -('io', 'Mass') :math:`\mathrm{\rm{code}~\rm{mass}}` ``particle_mass`` 1 -('io', 'Halo_M_Crit200') :math:`\mathrm{\rm{code}~\rm{mass}}` ``Virial Mass`` 1 -('io', 'Halo_M_Crit2500') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'Halo_M_Crit500') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'Halo_M_Mean200') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'Halo_M_Mean2500') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'Halo_M_Mean500') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'Halo_M_TopHat200') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'Halo_R_Crit200') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` ``Virial Radius`` 1 -('io', 'Halo_R_Crit2500') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 -('io', 'Halo_R_Crit500') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 -('io', 'Halo_R_Mean200') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 -('io', 'Halo_R_Mean2500') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 -('io', 'Halo_R_Mean500') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 -('io', 'Halo_R_TopHat200') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 -('io', 'BH_Mass') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'Stars/Mass') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'BH_Mdot') :math:`\mathrm{\rm{code}~\rm{mass} / \rm{code}~\rm{time}}` 1 -('io', 'StarFormationRate') :math:`\mathrm{\rm{code}~\rm{mass} / \rm{code}~\rm{time}}` 1 -================================ ========================================================== ======================= ========= ============ - -.. _RAMSES_specific_fields: - -RAMSES-Specific Fields ----------------------- - -=================================== ======================================== ================== ========= ============ -field name units aliases particle? display name -=================================== ======================================== ================== ========= ============ -('ramses', 'Density') :math:`\mathrm{\rm{code_density}}` ``density`` 0 -('ramses', 'x-velocity') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``velocity_x`` 0 -('ramses', 'y-velocity') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``velocity_y`` 0 -('ramses', 'z-velocity') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``velocity_z`` 0 -('ramses', 'Pressure') :math:`\mathrm{\rm{code_pressure}}` ``pressure`` 0 -('ramses', 'Metallicity') ``metallicity`` 0 -('io', 'particle_position_x') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_y') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_position_z') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'particle_velocity_x') :math:`\mathrm{\rm{code}~\rm{velocity}}` 1 -('io', 'particle_velocity_y') :math:`\mathrm{\rm{code}~\rm{velocity}}` 1 -('io', 'particle_velocity_z') :math:`\mathrm{\rm{code}~\rm{velocity}}` 1 -('io', 'particle_mass') :math:`\mathrm{\rm{code}~\rm{mass}}` 1 -('io', 'particle_identifier') ``particle_index`` 1 -('io', 'particle_refinement_level') 1 -('io', 'particle_age') :math:`\mathrm{\rm{code}~\rm{time}}` 1 -('io', 'particle_metallicity') 1 -=================================== ======================================== ================== ========= ============ - -.. _Rockstar_specific_fields: - -Rockstar-Specific Fields ------------------------- - -============================= ======================================= ======= ========= ================================= -field name units aliases particle? display name -============================= ======================================= ======= ========= ================================= -('io', 'particle_identifier') 1 -('io', 'particle_position_x') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 -('io', 'particle_position_y') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 -('io', 'particle_position_z') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 -('io', 'particle_velocity_x') :math:`\mathrm{\rm{km} / \rm{s}}` 1 -('io', 'particle_velocity_y') :math:`\mathrm{\rm{km} / \rm{s}}` 1 -('io', 'particle_velocity_z') :math:`\mathrm{\rm{km} / \rm{s}}` 1 -('io', 'particle_corevel_x') :math:`\mathrm{\rm{km} / \rm{s}}` 1 -('io', 'particle_corevel_y') :math:`\mathrm{\rm{km} / \rm{s}}` 1 -('io', 'particle_corevel_z') :math:`\mathrm{\rm{km} / \rm{s}}` 1 -('io', 'particle_bulkvel_x') :math:`\mathrm{\rm{km} / \rm{s}}` 1 -('io', 'particle_bulkvel_y') :math:`\mathrm{\rm{km} / \rm{s}}` 1 -('io', 'particle_bulkvel_z') :math:`\mathrm{\rm{km} / \rm{s}}` 1 -('io', 'particle_mass') :math:`\mathrm{\rm{M}_\odot / \rm{h}}` 1 :math:`Mass` -('io', 'virial_radius') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 :math:`Radius` -('io', 'child_r') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 -('io', 'vmax_r') :math:`\mathrm{\rm{km} / \rm{s}}` 1 -('io', 'mgrav') 1 -('io', 'vmax') :math:`\mathrm{\rm{km} / \rm{s}}` 1 :math:`V_{max}` -('io', 'rvmax') :math:`\mathrm{\rm{km} / \rm{s}}` 1 -('io', 'rs') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 :math:`R_s` -('io', 'klypin_rs') :math:`\mathrm{\rm{pc}/(1+z) / \rm{h}}` 1 :math:`Klypin R_s` -('io', 'vrms') :math:`\mathrm{\rm{km} / \rm{s}}` 1 :math:`V_{rms}` -('io', 'Jx') 1 :math:`J_x` -('io', 'Jy') 1 :math:`J_y` -('io', 'Jz') 1 :math:`J_z` -('io', 'energy') 1 -('io', 'spin') 1 :math:`Spin Parameter` -('io', 'alt_m1') :math:`\mathrm{\rm{M}_\odot / \rm{h}}` 1 -('io', 'alt_m2') :math:`\mathrm{\rm{M}_\odot / \rm{h}}` 1 -('io', 'alt_m3') :math:`\mathrm{\rm{M}_\odot / \rm{h}}` 1 -('io', 'alt_m4') :math:`\mathrm{\rm{M}_\odot / \rm{h}}` 1 -('io', 'Xoff') 1 -('io', 'Voff') 1 -('io', 'b_to_a') 1 :math:`Ellipsoidal b to a` -('io', 'c_to_a') 1 :math:`Ellipsoidal c to a` -('io', 'Ax') 1 :math:`A_x` -('io', 'Ay') 1 :math:`A_y` -('io', 'Az') 1 :math:`A_z` -('io', 'b_to_a2') 1 -('io', 'c_to_a2') 1 -('io', 'A2x') 1 :math:`A2_x` -('io', 'A2y') 1 :math:`A2_y` -('io', 'A2z') 1 :math:`A2_z` -('io', 'bullock_spin') 1 :math:`Bullock Spin Parameter` -('io', 'kin_to_pot') 1 :math:`Kinetic to Potential` -('io', 'm_pe_b') 1 -('io', 'm_pe_d') 1 -('io', 'num_p') 1 :math:`Number of Particles` -('io', 'num_child_particles') 1 :math:`Number of Child Particles` -('io', 'p_start') 1 -('io', 'desc') 1 -('io', 'flags') 1 -('io', 'n_core') 1 -('io', 'min_pos_err') 1 -('io', 'min_vel_err') 1 -('io', 'min_bulkvel_err') 1 -============================= ======================================= ======= ========= ================================= - -.. _Tipsy_specific_fields: - -Tipsy-Specific Fields ---------------------- - -============================ ====================================================================== ===================== ========= ============ -field name units aliases particle? display name -============================ ====================================================================== ===================== ========= ============ -('io', 'Mass') :math:`\mathrm{\rm{code}~\rm{mass}}` ``particle_mass`` 1 -('io', 'Masses') :math:`\mathrm{\rm{code}~\rm{mass}}` ``particle_mass`` 1 -('io', 'Coordinates') :math:`\mathrm{\rm{code}~\rm{length}}` ``particle_position`` 1 -('io', 'Velocity') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity`` 1 -('io', 'Velocities') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``particle_velocity`` 1 -('io', 'ParticleIDs') ``particle_index`` 1 -('io', 'InternalEnergy') ``thermal_energy`` 1 -('io', 'SmoothingLength') :math:`\mathrm{\rm{code}~\rm{length}}` ``smoothing_length`` 1 -('io', 'Density') :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}` ``density`` 1 -('io', 'MaximumTemperature') :math:`\mathrm{\rm{K}}` 1 -('io', 'Temperature') :math:`\mathrm{\rm{K}}` ``temperature`` 1 -('io', 'Epsilon') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'Metals') :math:`\mathrm{\rm{code}~\rm{metallicity}}` ``metallicity`` 1 -('io', 'Metallicity') :math:`\mathrm{\rm{code}~\rm{metallicity}}` ``metallicity`` 1 -('io', 'Phi') :math:`\mathrm{\rm{code}~\rm{length}}` 1 -('io', 'FormationTime') :math:`\mathrm{\rm{code}~\rm{time}}` ``creation_time`` 1 -('io', 'Metallicity_00') ``metallicity`` 1 -('io', 'Metallicity_01') ``He_fraction`` 1 -('io', 'Metallicity_02') ``C_fraction`` 1 -('io', 'Metallicity_03') ``N_fraction`` 1 -('io', 'Metallicity_04') ``O_fraction`` 1 -('io', 'Metallicity_05') ``Ne_fraction`` 1 -('io', 'Metallicity_06') ``Mg_fraction`` 1 -('io', 'Metallicity_07') ``Si_fraction`` 1 -('io', 'Metallicity_08') ``S_fraction`` 1 -('io', 'Metallicity_09') ``Ca_fraction`` 1 -('io', 'Metallicity_10') ``Fe_fraction`` 1 -('io', 'uDotFB') :math:`\mathrm{\rm{code}~\rm{mass} \cdot \rm{code}~\rm{velocity}^{2}}` ``uDotFB`` 1 -('io', 'acc') :math:`\mathrm{\rm{code}~\rm{velocity} / \rm{code}~\rm{time}}` ``acc`` 1 -('io', 'c') :math:`\mathrm{\rm{code}~\rm{velocity}}` ``c`` 1 -('io', 'uDotDiff') :math:`\mathrm{\rm{code}~\rm{mass} \cdot \rm{code}~\rm{velocity}^{2}}` ``uDotDiff`` 1 -('io', 'FeMassFrac') :math:`\mathrm{}` ``FeMassFrac`` 1 -('io', 'timeform') :math:`\mathrm{\rm{code}~\rm{time}}` ``timeform`` 1 -('io', 'uDot') :math:`\mathrm{\rm{code}~\rm{mass} \cdot \rm{code}~\rm{velocity}^{2}}` ``uDot`` 1 -('io', 'accg') :math:`\mathrm{\rm{code}~\rm{velocity} / \rm{code}~\rm{time}}` ``accg`` 1 -('io', 'uDotHydro') :math:`\mathrm{\rm{code}~\rm{mass} \cdot \rm{code}~\rm{velocity}^{2}}` ``uDotHydro`` 1 -('io', 'uDotPdV') :math:`\mathrm{\rm{code}~\rm{mass} \cdot \rm{code}~\rm{velocity}^{2}}` ``uDotPdV`` 1 -('io', 'uDotAV') :math:`\mathrm{\rm{code}~\rm{mass} \cdot \rm{code}~\rm{velocity}^{2}}` ``uDotAV`` 1 -('io', 'HI') :math:`\mathrm{}` ``HI`` 1 -('io', 'coolontime') :math:`\mathrm{\rm{code}~\rm{time}}` ``coolontime`` 1 -('io', 'HeII') :math:`\mathrm{}` ``HeII`` 1 -('io', 'HII') :math:`\mathrm{}` ``HII`` 1 -('io', 'massform') :math:`\mathrm{\rm{code}~\rm{mass}}` ``massform`` 1 -('io', 'OxMassFrac') :math:`\mathrm{}` ``OxMassFrac`` 1 -('io', 'HeI') :math:`\mathrm{}` ``HeI`` 1 -============================ ====================================================================== ===================== ========= ============ - - - -Index of Fields ---------------- - -.. contents:: - :depth: 3 - :backlinks: none - - +.. yt_showfields:: diff -Nru yt-3.3.3/doc/source/sharing_data.rst yt-3.4.0/doc/source/sharing_data.rst --- yt-3.3.3/doc/source/sharing_data.rst 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/doc/source/sharing_data.rst 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,117 @@ +.. _sharing-data: + +The yt Hub +========== + +.. contents:: + :depth: 2 + :local: + :backlinks: none + +What is the yt Hub? +------------------- + +The yt data Hub is a mechanism by which images, data objects and projects can be +shared with other people. For instance, one can upload a dataset and allow other +people to remotely analyze it with a jupyter notebook or upload notebooks and +view them from any web browser. + +.. note:: All items posted on the hub are public! + +Over time, more widgets will be added, and more datatypes will be able to be +uploaded. If you are interested in adding more ways of sharing data, please +email the developers' list. We would like to add support for 3D widgets such +as isocontours as well as interactive binning and rebinning of data from yt +data objects, to be displayed as phase plots and profiles. + +.. note:: Working with the Hub requires additional dependencies to be installed. + You can obtain them by running: ``pip install yt[hub]``. + +.. _hub-APIkey: + +Obtaining an API key +-------------------- + +In order to interact with the yt Hub, you need to obtain API key, which is +available only for authenticated users. You can `log into +`_ the Hub using your Google, GitHub or +Bitbucket account. After you log in, an API key can be generated under the *My +account* page, which can be accessed through the dropdown menu in the upper +right corner. + +.. image:: _static/apiKey01.jpg + :width: 50 % + +Select the *API keys* tab and press *Create new key* button: + +.. image:: _static/apiKey02.jpg + :width: 50 % + +By convention, the *Name* field of API keys can be used to specify what +application is making use of the key in a human-readable way e.g. ``yt +command``, although you may name your key however you want. + +.. image:: _static/apiKey03.jpg + :width: 50 % + +After the API Key is created you can obtain it by clicking *show* link: + +.. image:: _static/apiKey04.jpg + :width: 50 % + +For more information about API keys please see `this document +`__. + +After you have gotten your API key, update your config file: + +.. code-block:: none + + $ yt config set yt hub_api_key 3fd1de56c2114c13a2de4dd51g10974b + +Replace ``3fd1de56c2114c13a2de4dd51g10974b`` with your API key. + +Registering a User +^^^^^^^^^^^^^^^^^^ + +If you do not wish to use OAuth authentication, you can create a Hub account +using ``yt`` command. To register a user: + +.. code-block:: bash + + $ yt hub register + +This will walk you through the process of registering. You will need to supply +a name, a username, a password and an email address. Apart from creating a new +user account, it will also generate an API key and append it to the yt's config +file. At this point, you're ready to go! + +What Can Be Uploaded +-------------------- + +Currently, the yt hub can accept these types of data: + + * Raw data files, scripts. + * IPython notebooks: these are stored on the hub and are made available for + download and via the IPython `nbviewer `_ + service. + +How to Upload Data +------------------ + +Uploading data can be performed using the ``girder-cli`` command tool or +directly via the web interface. Please refer to ``girder-cli`` `documentation page +`_ for additional +information. + +Uploading Notebooks +^^^^^^^^^^^^^^^^^^^ + +Notebooks can be uploaded from the bash command line: + +.. code-block:: bash + + yt upload_notebook notebook_file.ipynb + +After the notebook is finished uploading, yt will print a link to the raw +notebook as well as an nbviewer link to the same notebook. Your notebooks will +be stored under your hub Public directory. Binary files /tmp/tmpmsi3bH/clcsyIdwDh/yt-3.3.3/doc/source/_static/apiKey01.jpg and /tmp/tmpmsi3bH/4RkxFBdwN8/yt-3.4.0/doc/source/_static/apiKey01.jpg differ Binary files /tmp/tmpmsi3bH/clcsyIdwDh/yt-3.3.3/doc/source/_static/apiKey02.jpg and /tmp/tmpmsi3bH/4RkxFBdwN8/yt-3.4.0/doc/source/_static/apiKey02.jpg differ Binary files /tmp/tmpmsi3bH/clcsyIdwDh/yt-3.3.3/doc/source/_static/apiKey03.jpg and /tmp/tmpmsi3bH/4RkxFBdwN8/yt-3.4.0/doc/source/_static/apiKey03.jpg differ Binary files /tmp/tmpmsi3bH/clcsyIdwDh/yt-3.3.3/doc/source/_static/apiKey04.jpg and /tmp/tmpmsi3bH/4RkxFBdwN8/yt-3.4.0/doc/source/_static/apiKey04.jpg differ Binary files /tmp/tmpmsi3bH/clcsyIdwDh/yt-3.3.3/doc/source/_static/yt_logo.png and /tmp/tmpmsi3bH/4RkxFBdwN8/yt-3.4.0/doc/source/_static/yt_logo.png differ diff -Nru yt-3.3.3/doc/source/_static/yt_logo.svg yt-3.4.0/doc/source/_static/yt_logo.svg --- yt-3.3.3/doc/source/_static/yt_logo.svg 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/doc/source/_static/yt_logo.svg 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + diff -Nru yt-3.3.3/doc/source/visualizing/callbacks.rst yt-3.4.0/doc/source/visualizing/callbacks.rst --- yt-3.3.3/doc/source/visualizing/callbacks.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/visualizing/callbacks.rst 2017-08-10 18:02:57.000000000 +0000 @@ -304,8 +304,10 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~ .. function:: annotate_halos(self, halo_catalog, circle_args=None, \ - width=None, annotate_field=None, text_args=None, \ - factor=1.0) + width=None, annotate_field=None, \ + radius_field='virial_radius', \ + center_field_prefix="particle_position", \ + text_args=None, factor=1.0) (This is a proxy for :class:`~yt.visualization.plot_modifications.HaloCatalogCallback`.) @@ -321,11 +323,22 @@ with the annotate_field, which accepts a field contained in the halo catalog to add text to the plot near the halo (example: ``annotate_field= 'particle_mass'`` will write the halo mass next to each halo, whereas - ``'particle_identifier'`` shows the halo number). font_kwargs contains the - arguments controlling the text appearance of the annotated field. - Factor is the number the virial radius is multiplied by for plotting the - circles. Ex: ``factor=2.0`` will plot circles with twice the radius of each - halo virial radius. + ``'particle_identifier'`` shows the halo number). The size of the circles is + found from the field ``radius_field`` which is ``'virial_radius'`` by + default. If another radius has been found as part of your halo analysis + workflow, you can save that field and use it as the ``radius_field`` to + change the size of the halos. The position of each halo is determined using + ``center_field_prefix`` in the following way. If ``'particle_position'`` + is the value of ``center_field_prefix`` as is the default, the x value of + the halo position is stored in the field ``'particle_position_x'``, y is + ``'particle_position_y'``, and z is ``'particle_position_z'``. If you have + stored another set of coordinates for each halo as part of your halo + analysis as fields such as ``'halo_position_x'``, you can use these fields + to determine halo position by passing ``'halo_position'`` to + ``center_field_prefix``. font_kwargs contains the arguments controlling the + text appearance of the annotated field. Factor is the number the virial + radius is multiplied by for plotting the circles. Ex: ``factor=2.0`` will + plot circles with twice the radius of each halo virial radius. .. python-script:: @@ -420,7 +433,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. function:: annotate_particles(self, width, p_size=1.0, col='k', marker='o',\ - stride=1.0, ptype=None, minimum_mass=None, \ + stride=1, ptype='all', minimum_mass=None, \ alpha=1.0) (This is a proxy for diff -Nru yt-3.3.3/doc/source/visualizing/colormaps/index.rst yt-3.4.0/doc/source/visualizing/colormaps/index.rst --- yt-3.3.3/doc/source/visualizing/colormaps/index.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/visualizing/colormaps/index.rst 2017-08-10 18:02:57.000000000 +0000 @@ -50,6 +50,25 @@ colorblind/printer/grayscale-friendly plots. For more information, visit `http://colorbrewer2.org `_. +.. _cmocean-cmaps: + +Colormaps from cmocean +~~~~~~~~~~~~~~~~~~~~~~ + +In addition to ``palettable``, yt will also import colormaps defined in the +`cmocean `_ package. These colormaps are +`perceptually uniform `_ and were originally +designed for oceanography applications, but can be used for any kind of plots. + +Since ``cmocean`` is not installed as a dependency of yt by default, it must be +installed separately to access the ``cmocean`` colormaps with yt. The easiest +way to install ``cmocean`` is via ``pip``: ``pip install cmocean``. To access +the colormaps in yt, simply specify the name of the ``cmocean`` colormap in any +context where you would specify a colormap. One caveat is the ``cmocean`` +colormap ``algae``. Since yt already defines a colormap named ``algae``, the +``cmocean`` version of ``algae`` must be specified with the name +``algae_cmocean``. + .. _custom-colormaps: Making and Viewing Custom Colormaps diff -Nru yt-3.3.3/doc/source/visualizing/FITSImageData.ipynb yt-3.4.0/doc/source/visualizing/FITSImageData.ipynb --- yt-3.3.3/doc/source/visualizing/FITSImageData.ipynb 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/visualizing/FITSImageData.ipynb 2017-08-10 18:02:57.000000000 +0000 @@ -15,8 +15,7 @@ }, "outputs": [], "source": [ - "import yt\n", - "from yt.utilities.fits_image import FITSImageData, FITSProjection" + "import yt" ] }, { @@ -27,9 +26,9 @@ }, "outputs": [], "source": [ - "ds = yt.load(\"MHDSloshing/virgo_low_res.0054.vtk\", parameters={\"length_unit\":(1.0,\"Mpc\"),\n", - " \"mass_unit\":(1.0e14,\"Msun\"),\n", - " \"time_unit\":(1.0,\"Myr\")})" + "ds = yt.load(\"MHDSloshing/virgo_low_res.0054.vtk\", units_override={\"length_unit\":(1.0,\"Mpc\"),\n", + " \"mass_unit\":(1.0e14,\"Msun\"),\n", + " \"time_unit\":(1.0,\"Myr\")})" ] }, { @@ -54,7 +53,7 @@ }, "outputs": [], "source": [ - "prj = yt.ProjectionPlot(ds, \"z\", [\"temperature\"], weight_field=\"density\", width=(500.,\"kpc\"))\n", + "prj = yt.ProjectionPlot(ds, \"z\", [\"temperature\"], weight_field=\"density\", width=(500., \"kpc\"))\n", "prj.show()" ] }, @@ -73,7 +72,7 @@ }, "outputs": [], "source": [ - "prj_fits = FITSProjection(ds, \"z\", [\"temperature\"], weight_field=\"density\")" + "prj_fits = yt.FITSProjection(ds, \"z\", [\"temperature\"], weight_field=\"density\")" ] }, { @@ -123,7 +122,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "where we can see that the temperature units are in Kelvin and the cell widths are in kiloparsecs. If we want the raw image data with units, we can call `get_data`:" + "where we can see that the temperature units are in Kelvin and the cell widths are in kiloparsecs. If we want the raw image data with units, we can use the `data` attribute of this field:" ] }, { @@ -134,7 +133,7 @@ }, "outputs": [], "source": [ - "prj_fits.get_data(\"temperature\")" + "prj_fits[\"temperature\"].data" ] }, { @@ -153,7 +152,7 @@ "outputs": [], "source": [ "prj_fits.set_unit(\"temperature\",\"R\")\n", - "prj_fits.get_data(\"temperature\")" + "prj_fits[\"temperature\"].data" ] }, { @@ -236,7 +235,7 @@ "source": [ "slc3 = ds.slice(0, 0.0)\n", "frb = slc3.to_frb((500.,\"kpc\"), 800)\n", - "fid_frb = FITSImageData(frb, fields=[\"density\",\"temperature\"], units=\"pc\")" + "fid_frb = yt.FITSImageData(frb, fields=[\"density\",\"temperature\"], units=\"pc\")" ] }, { @@ -255,7 +254,7 @@ "outputs": [], "source": [ "cvg = ds.covering_grid(ds.index.max_level, [-0.5,-0.5,-0.5], [64, 64, 64], fields=[\"density\",\"temperature\"])\n", - "fid_cvg = FITSImageData(cvg, fields=[\"density\",\"temperature\"], units=\"Mpc\")" + "fid_cvg = yt.FITSImageData(cvg, fields=[\"density\",\"temperature\"], units=\"Mpc\")" ] }, { @@ -280,7 +279,7 @@ }, "outputs": [], "source": [ - "fid = FITSImageData.from_file(\"sloshing.fits\")\n", + "fid = yt.FITSImageData.from_file(\"sloshing.fits\")\n", "fid.info()" ] }, @@ -299,8 +298,8 @@ }, "outputs": [], "source": [ - "prj_fits2 = FITSProjection(ds, \"z\", [\"density\"])\n", - "prj_fits3 = FITSImageData.from_images([prj_fits, prj_fits2])\n", + "prj_fits2 = yt.FITSProjection(ds, \"z\", [\"density\"])\n", + "prj_fits3 = yt.FITSImageData.from_images([prj_fits, prj_fits2])\n", "prj_fits3.info()" ] }, @@ -308,7 +307,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Alternatively, individual fields can be popped as well:" + "Alternatively, individual fields can be popped as well to produce new instances of `FITSImageData`:" ] }, { @@ -323,6 +322,13 @@ ] }, { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "So this new instance would only have the `\"density\"` field:" + ] + }, + { "cell_type": "code", "execution_count": null, "metadata": { @@ -334,6 +340,13 @@ ] }, { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and the old one has the `\"density\"` field removed:" + ] + }, + { "cell_type": "code", "execution_count": null, "metadata": { @@ -348,7 +361,27 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "So far, the FITS images we have shown have linear spatial coordinates. One may want to take a projection of an object and make a crude mock observation out of it, with celestial coordinates. For this, we can use the `create_sky_wcs` method. Specify a center (RA, Dec) coordinate in degrees, as well as a linear scale in terms of angle per distance:" + "So far, the FITS images we have shown have linear spatial coordinates. We can see this by looking at the header for one of the fields, and examining the `CTYPE1` and `CTYPE2` keywords:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "prj_fits[\"temperature\"].header" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The `WCSNAME` keyword is set to `\"yt\"` by default. \n", + "\n", + "However, one may want to take a projection of an object and make a crude mock observation out of it, with celestial coordinates. For this, we can use the `create_sky_wcs` method. Specify a center (RA, Dec) coordinate in degrees, as well as a linear scale in terms of angle per distance:" ] }, { @@ -368,7 +401,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "By the default, a tangent RA/Dec projection is used, but one could also use another projection using the `ctype` keyword. We can now look at the header and see it has the appropriate WCS:" + "By default, a tangent RA/Dec projection is used, but one could also use another projection using the `ctype` keyword. We can now look at the header and see it has the appropriate WCS:" ] }, { @@ -386,6 +419,49 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "and now the `WCSNAME` has been set to `\"celestial\"`. If you don't want to override the default WCS but to add another one, then you can make the call to `create_sky_wcs` and set `replace_old_wcs=False`:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "prj_fits3.create_sky_wcs(sky_center, sky_scale, ctype=[\"RA---TAN\",\"DEC--TAN\"], replace_old_wcs=False)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We now can see that there are two WCSes in the header, with the celestial WCS keywords having the \"A\" designation:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "prj_fits3[\"temperature\"].header" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Any further WCSes that are added will have \"B\", \"C\", etc." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ "Finally, we can add header keywords to a single field or for all fields in the FITS image using `update_header`:" ] }, @@ -415,22 +491,11 @@ } ], "metadata": { + "anaconda-cloud": {}, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python [default]", "language": "python", "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.5.1" } }, "nbformat": 4, diff -Nru yt-3.3.3/doc/source/visualizing/plots.rst yt-3.4.0/doc/source/visualizing/plots.rst --- yt-3.3.3/doc/source/visualizing/plots.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/visualizing/plots.rst 2017-08-10 18:02:57.000000000 +0000 @@ -14,8 +14,26 @@ The :class:`~yt.visualization.plot_window.PlotWindow` interface is useful for taking a quick look at simulation outputs. Simple mechanisms exist for making -plots of slices, projections, 1D profiles, and 2D profiles (phase plots), all of -which are described below. +plots of slices, projections, 1D spatial line plots, 1D profiles, and 2D +profiles (phase plots), all of which are described below. + +.. _viewing-plots: + +Viewing Plots +------------- + +YT uses an environment neutral plotting mechanism that detects the appropriate +matplotlib configuration for a given environment, however it defaults to a basic +renderer. To utilize interactive plots in matplotlib supported +environments (Qt, GTK, WX, etc.) simply call the ``toggle_interactivity()`` function. Below is an +example in a jupyter notebook environment, but the same command should work +in other environments as well: + +.. code-block:: python + + %matplotlib notebook + import yt + yt.toggle_interactivity() .. _simple-inspection: @@ -185,6 +203,30 @@ See :class:`~yt.visualization.plot_window.AxisAlignedSlicePlot` for the full class description. +.. _plot-2d: + +Plots of 2D Datasets +~~~~~~~~~~~~~~~~~~~~ + +If you have a two-dimensional cartesian, cylindrical, or polar dataset, +:func:`~yt.visualization.plot_window.plot_2d` is a way to make a plot +within the dataset's plane without having to specify the axis, which +in this case is redundant. Otherwise, ``plot_2d`` accepts the same +arguments as ``SlicePlot``. The one other difference is that the +``center`` keyword argument can be a two-dimensional coordinate instead +of a three-dimensional one: + +.. python-script:: + + import yt + ds = yt.load("WindTunnel/windtunnel_4lev_hdf5_plt_cnt_0030") + p = yt.plot_2d(ds, "density", center=[1.0, 0.4]) + p.set_log("density", False) + p.save() + +See :func:`~yt.visualization.plot_window.plot_2d` for the full description +of the function and its keywords. + .. _off-axis-slices: Off Axis Slices @@ -423,7 +465,7 @@ sl = yt.SlicePlot(ds, 2, ('connect2', 'diffused')) sl.save() -Finally, slices can also be used to examine 2D unstructured mesh datasets, but the +Slices can also be used to examine 2D unstructured mesh datasets, but the slices must be taken to be normal to the ``'z'`` axis, or you'll get an error. Here is an example using another MOOSE dataset that uses triangular mesh elements: @@ -434,6 +476,17 @@ sl = yt.SlicePlot(ds, 2, ('connect1', 'nodal_aux')) sl.save() +You may run into situations where you have a variable you want to visualize that +exists on multiple mesh blocks. To view the variable on ``all`` mesh blocks, +simply pass ``all`` as the first argument of the field tuple: + +.. python-script:: + + import yt + ds = yt.load("MultiRegion/two_region_example_out.e", step=-1) + sl = yt.SlicePlot(ds, 'z', ('all', 'diffused')) + sl.save() + Plot Customization: Recentering, Resizing, Colormaps, and More -------------------------------------------------------------- @@ -504,6 +557,33 @@ The same result could have been accomplished by explicitly setting the ``width`` to ``(.01, 'Mpc')``. +Set image units +~~~~~~~~~~~~~~~ + +:meth:`~yt.visualization.plot_window.AxisAlignedSlicePlot.set_axes_unit` allows +the customization of the units used for the image and colorbar. + +.. python-script:: + + import yt + ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") + slc = yt.SlicePlot(ds, 'z', 'density', width=(10,'kpc')) + slc.set_unit('density', 'Msun/pc**3') + slc.save() + +If the unit you would like to convert to needs an equivalency, this can be +specified via the ``equivalency`` keyword argument of ``set_unit``. For +example, let's make a plot of the temperature field, but present it using +an energy unit instead of a temperature unit: + +.. python-script:: + + import yt + ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") + slc = yt.SlicePlot(ds, 'z', 'temperature', width=(10,'kpc')) + slc.set_unit('temperature', 'keV', equivalency='thermal') + slc.save() + Set the plot center ~~~~~~~~~~~~~~~~~~~ @@ -519,6 +599,27 @@ slc.set_center((0.5, 0.503)) slc.save() +Flipping the plot view axes +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +By default, all :class:`~yt.visualization.plot_window.PlotWindow` objects plot +with the assumption that the eastern direction on the plot forms a right handed +coordinate system with the ``normal`` and ``north_vector`` for the system, whether +explicitly or implicitly defined. This setting can be toggled or explicitly defined +by the user at initialization: + +.. python-script:: + + import yt + ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") + #slicing with non right-handed coordinates + slc = yt.SlicePlot(ds, 'x', 'velocity_x', right_handed=False) + slc.annotate_title('Not Right Handed') + slc.save("NotRightHanded.png") + + #switching to right-handed coordinates + slc.toggle_right_handed() + slc.annotate_title('Right Handed') + slc.save("Standard.png") .. _hiding-colorbar-and-axes: @@ -604,6 +705,21 @@ slc.set_log('x-velocity', True, linthresh=1.e1) slc.save() +The :meth:`~yt.visualization.plot_container.ImagePlotContainer.set_background_color` +function accepts a field name and a color (optional). If color is given, the function +will set the plot's background color to that. If not, it will set it to the bottom +value of the color map. + +.. python-script:: + + import yt + ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") + slc = yt.SlicePlot(ds, 'z', 'density', width=(1.5, 'Mpc')) + slc.set_background_color('density') + slc.save('bottom_colormap_background') + slc.set_background_color('density', color='black') + slc.save('black_background') + Lastly, the :meth:`~yt.visualization.plot_window.AxisAlignedSlicePlot.set_zlim` function makes it possible to set a custom colormap range. @@ -686,6 +802,7 @@ slc.set_cbar_minorticks('all', 'off') slc.save() + .. _matplotlib-customization: Further customization via matplotlib @@ -850,6 +967,7 @@ # Save the image. plot.save() + Customizing axis limits ~~~~~~~~~~~~~~~~~~~~~~~ @@ -961,6 +1079,88 @@ # change only the first line plot.set_line_property("linestyle", "--", 0) +.. _how-to-1d-unstructured-mesh: + +1D Line Sampling +---------------- + +YT has the ability to sample datasets along arbitrary lines +and plot the result. You must supply five arguments to the ``LinePlot`` +class. They are enumerated below: + +1. Dataset +2. A list of fields or a single field you wish to plot +3. The starting point of the sampling line. This should be an n-element list, tuple, + ndarray, or YTArray with the elements corresponding to the coordinates of the + starting point. (n should equal the dimension of the dataset) +4. The ending point of the sampling line. This should also be an n-element list, tuple, + ndarray, or YTArray with the elements corresponding to the coordinates of the + ending point. +5. The number of sampling points along the line, e.g. if 1000 is specified, then + data will be sampled at 1000 points evenly spaced between the starting and + ending points. + +The below code snippet illustrates how this is done: + +.. code-block:: python + + ds = yt.load("SecondOrderTris/RZ_p_no_parts_do_nothing_bcs_cone_out.e", step=-1) + plot = yt.LinePlot(ds, [('all', 'v'), ('all', 'u')], (0, 0, 0), (0, 1, 0), 1000) + plot.save() + +If working in a Jupyter Notebook, ``LinePlot`` also has the ``show()`` method. + +You can can add a legend to a 1D sampling plot. The legend process takes two steps: + +1. When instantiating the ``LinePlot``, pass a dictionary of + labels with keys corresponding to the field names +2. Call the ``LinePlot`` ``annotate_legend`` method + +X- and Y- axis units can be set with ``set_x_unit`` and ``set_unit`` methods +respectively. The below code snippet combines all the features we've discussed: + +.. python-script:: + + import yt + + ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030') + + plot = yt.LinePlot(ds, 'density', [0, 0, 0], [1, 1, 1], 512) + plot.annotate_legend('density') + plot.set_x_unit('cm') + plot.set_unit('density', 'kg/cm**3') + plot.save() + +If a list of fields is passed to ``LinePlot``, yt will create a number of +individual figures equal to the number of different dimensional +quantities. E.g. if ``LinePlot`` receives two fields with units of "length/time" +and a field with units of "temperature", two different figures will be created, +one with plots of the "length/time" fields and another with the plot of the +"temperature" field. It is only necessary to call ``annotate_legend`` +for one field of a multi-field plot to produce a legend containing all the +labels passed in the initial construction of the ``LinePlot`` instance. Example: + +.. python-script:: + + import yt + + ds = yt.load("SecondOrderTris/RZ_p_no_parts_do_nothing_bcs_cone_out.e", step=-1) + plot = yt.LinePlot(ds, [('all', 'v'), ('all', 'u')], [0, 0, 0], [0, 1, 0], + 100, field_labels={('all', 'u') : r"v$_x$", + ('all', 'v') : r"v$_y$"}) + plot.annotate_legend(('all', 'u')) + plot.save() + +``LinePlot`` is a bit different from yt ray objects which are data +containers. ``LinePlot`` is a plotting class that may use yt ray objects to +supply field plotting information. However, perhaps the most important +difference to highlight between rays and ``LinePlot`` is that rays return data +elements that intersect with the ray and make no guarantee about the spacing +between data elements. ``LinePlot`` sampling points are guaranteed to be evenly +spaced. In the case of cell data where multiple points fall within the same +cell, the ``LinePlot`` object will show the same field value for each sampling +point that falls within the same cell. + .. _how-to-make-2d-profiles: 2D Phase Plots diff -Nru yt-3.3.3/doc/source/visualizing/sketchfab.rst yt-3.4.0/doc/source/visualizing/sketchfab.rst --- yt-3.3.3/doc/source/visualizing/sketchfab.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/visualizing/sketchfab.rst 2017-08-10 18:02:57.000000000 +0000 @@ -105,7 +105,7 @@ but it requires that you get an API key first. You can get this API key by creating an account and then going to your "dashboard," where it will be listed on the right hand side. Once you've obtained it, put it into your -``~/.yt/config`` file under the heading ``[yt]`` as the variable +``~/.config/yt/ytrc`` file under the heading ``[yt]`` as the variable ``sketchfab_api_key``. If you don't want to do this, you can also supply it as an argument to the function ``export_sketchfab``. diff -Nru yt-3.3.3/doc/source/visualizing/TransferFunctionHelper_Tutorial.ipynb yt-3.4.0/doc/source/visualizing/TransferFunctionHelper_Tutorial.ipynb --- yt-3.3.3/doc/source/visualizing/TransferFunctionHelper_Tutorial.ipynb 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/visualizing/TransferFunctionHelper_Tutorial.ipynb 2017-08-10 18:02:57.000000000 +0000 @@ -155,7 +155,7 @@ "source": [ "im, sc = yt.volume_render(ds, ['temperature'])\n", "\n", - "source = sc.get_source(0)\n", + "source = sc.get_source()\n", "source.set_transfer_function(tfh.tf)\n", "im2 = sc.render()\n", "\n", diff -Nru yt-3.3.3/doc/source/visualizing/unstructured_mesh_rendering.rst yt-3.4.0/doc/source/visualizing/unstructured_mesh_rendering.rst --- yt-3.3.3/doc/source/visualizing/unstructured_mesh_rendering.rst 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/visualizing/unstructured_mesh_rendering.rst 2017-08-10 18:02:57.000000000 +0000 @@ -22,14 +22,14 @@ conda install -c http://use.yt/with_conda/ yt -Alternatively, you can install yt from source using the ``install_script.sh`` -script. Be sure to set the INST_CONDA, INST_YT_SOURCE, INST_EMBREE, -and INST_NETCDF4 flags to 1 at the top of the script. The ``install_script.sh`` +Alternatively, you can install yt from source using the ``install_script.sh`` +script. Be sure to set the ``INST_YT_SOURCE``, ``INST_EMBREE``, and +``INST_NETCDF4`` flags to 1 at the top of the script. The ``install_script.sh`` script can be downloaded by doing: .. code-block:: bash - wget http://bitbucket.org/yt_analysis/yt/raw/yt/doc/install_script.sh + wget https://raw.githubusercontent.com/yt-project/yt/master/doc/install_script.sh and then run like so: @@ -64,7 +64,7 @@ the unstructured mesh rendering capability. Once again, if embree is installed in a location that is not part of your default search path, you must tell yt where to find it. There are a number of ways to do this. One way is to again manually pass in the flags -when running the setup script in the yt-hg directory: +when running the setup script in the yt-git directory: .. code-block:: bash @@ -77,7 +77,7 @@ python setup.py develop -as usual. Finally, if you create a file called embree.cfg in the yt-hg directory with +as usual. Finally, if you create a file called embree.cfg in the yt-git directory with the location of the embree installation, the setup script will find this and use it, provided EMBREE_DIR is not set. An example embree.cfg file could like this: @@ -105,7 +105,7 @@ sc = yt.create_scene(ds) # override the default colormap - ms = sc.get_source(0) + ms = sc.get_source() ms.cmap = 'Eos A' # adjust the camera position and orientation @@ -133,7 +133,7 @@ sc = yt.create_scene(ds) # override the default colormap - ms = sc.get_source(0) + ms = sc.get_source() ms.cmap = 'Eos A' # adjust the camera position and orientation @@ -165,7 +165,7 @@ sc = yt.create_scene(ds, ('connect2', 'diffused')) # override the default colormap - ms = sc.get_source(0) + ms = sc.get_source() ms.cmap = 'Eos A' # adjust the camera position and orientation @@ -196,7 +196,7 @@ sc = yt.create_scene(ds, ("connect1", "u")) # override the default colormap - ms = sc.get_source(0) + ms = sc.get_source() ms.cmap = 'Eos A' # adjust the camera position and orientation @@ -224,7 +224,7 @@ sc = yt.create_scene(ds, ('connect2', 'diffused')) # override the default colormap - ms = sc.get_source(0) + ms = sc.get_source() ms.cmap = 'Eos A' # adjust the camera position and orientation @@ -250,7 +250,7 @@ # override the default colormap. This time we also override # the default color bounds - ms = sc.get_source(0) + ms = sc.get_source() ms.cmap = 'hot' ms.color_bounds = (500.0, 1700.0) @@ -287,7 +287,7 @@ # override the default colormap. This time we also override # the default color bounds - ms = sc.get_source(0) + ms = sc.get_source() ms.cmap = 'hot' ms.color_bounds = (500.0, 1700.0) @@ -320,7 +320,7 @@ sc = yt.create_scene(ds, ("connect2", "diffused")) # override the default colormap - ms = sc.get_source(0) + ms = sc.get_source() ms.cmap = 'Eos A' # Create a perspective Camera @@ -392,7 +392,7 @@ sc = yt.create_scene(ds) # override the default colormap - ms = sc.get_source(0) + ms = sc.get_source() ms.cmap = 'Eos A' # adjust the camera position and orientation diff -Nru yt-3.3.3/doc/source/visualizing/Volume_Rendering_Tutorial.ipynb yt-3.4.0/doc/source/visualizing/Volume_Rendering_Tutorial.ipynb --- yt-3.3.3/doc/source/visualizing/Volume_Rendering_Tutorial.ipynb 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/doc/source/visualizing/Volume_Rendering_Tutorial.ipynb 2017-08-10 18:02:57.000000000 +0000 @@ -57,7 +57,7 @@ }, "outputs": [], "source": [ - "print (sc.get_source(0))" + "print (sc.get_source())" ] }, { @@ -177,7 +177,7 @@ "tfh.tf.add_layers(10, colormap='gist_rainbow')\n", "\n", "# Grab the first render source and set it to use the new transfer function\n", - "render_source = sc.get_source(0)\n", + "render_source = sc.get_source()\n", "render_source.transfer_function = tfh.tf\n", "\n", "sc.render()\n", diff -Nru yt-3.3.3/doc/source/yt3differences.rst yt-3.4.0/doc/source/yt3differences.rst --- yt-3.3.3/doc/source/yt3differences.rst 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/doc/source/yt3differences.rst 2017-08-10 18:02:57.000000000 +0000 @@ -24,7 +24,7 @@ .. code-block:: bash - $ yt update --all + $ yt update This will update yt to the most recent version and rebuild the source base. If you installed using the installer script, it will assure you have all of the diff -Nru yt-3.3.3/MANIFEST.in yt-3.4.0/MANIFEST.in --- yt-3.3.3/MANIFEST.in 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/MANIFEST.in 2017-08-10 18:02:57.000000000 +0000 @@ -3,6 +3,7 @@ include yt/visualization/mapserver/html/leaflet/*.css include yt/visualization/mapserver/html/leaflet/*.js include yt/visualization/mapserver/html/leaflet/images/*.png +include yt/utilities/mesh_types.yaml exclude scripts/pr_backport.py recursive-include yt *.py *.pyx *.pxd *.h README* *.txt LICENSE* *.cu recursive-include doc *.rst *.txt *.py *.ipynb *.png *.jpg *.css *.html diff -Nru yt-3.3.3/PKG-INFO yt-3.4.0/PKG-INFO --- yt-3.3.3/PKG-INFO 2016-12-12 01:42:09.000000000 +0000 +++ yt-3.4.0/PKG-INFO 2017-08-10 18:21:03.000000000 +0000 @@ -1,12 +1,174 @@ Metadata-Version: 1.1 Name: yt -Version: 3.3.3 -Summary: An analysis and visualization toolkit for Astrophysical simulations, focusing on Adaptive Mesh Refinement data from Enzo, Orion, FLASH, and others. +Version: 3.4.0 +Summary: An analysis and visualization toolkit for volumetric data Home-page: http://yt-project.org/ Author: The yt project Author-email: yt-dev@lists.spacepope.org -License: BSD -Description: UNKNOWN +License: BSD 3-Clause +Description: The yt Project + ============== + + |Users' Mailing List| |Devel Mailing List| |Build Status| |Latest + Documentation| |Data Hub| |Powered by NumFOCUS| + + yt is an open-source, permissively-licensed python package for analyzing + and visualizing volumetric data. + + yt supports structured, variable-resolution meshes, unstructured meshes, + and discrete or sampled data such as particles. Focused on driving + physically-meaningful inquiry, yt has been applied in domains such as + astrophysics, seismology, nuclear engineering, molecular dynamics, and + oceanography. Composed of a friendly community of users and developers, + we want to make it easy to use and develop - we'd love it if you got + involved! + + We've written a `method + paper `__ you may be + interested in; if you use yt in the preparation of a publication, please + consider citing it. + + Installation + ------------ + + If you're using conda with + `conda-forge `__, you can install the + most recent stable version by running: + + :: + + conda install -c conda-forge yt + + or by doing: + + :: + + pip install yt + + If you want the latest nightly build, you can manually install from our + repository: + + :: + + conda install -c http://use.yt/with_conda yt + + To get set up with a development version, you can clone this repository + and install like this: + + :: + + git clone https://github.com/yt-project/yt yt-git + cd yt-git + pip install -e . + + To set up yt in a virtualenv (and there are `many good + reasons `__ + to do so!) you can follow this prescription: + + :: + + # Assuming you have cd'd into yt-git + # It is conventional to create virtualenvs at ~/.virtualenv/ + $ mkdir -p ~/.virtualenv + # Assuming your version of Python 3 is 3.4 or higher, + # create a virtualenv named yt + $ python3 -m venv ~/.virtualenv/yt + # Activate it + $ source ~/.virtualenv/yt/bin/activate + # Make sure you run the latest version of pip + $ pip install --upgrade pip + $ pip install -e . + # Output installed packages + $ pip freeze + + Getting Started + --------------- + + yt is designed to provide meaningful analysis of data. We have some + Quickstart example notebooks in the repository: + + - `Introduction `__ + - `Data Inspection `__ + - `Simple + Visualization `__ + - `Data Objects and Time + Series `__ + - `Derived Fields and + Profiles `__ + - `Volume + Rendering `__ + + If you'd like to try these online, you can visit our `yt + Hub `__ and run a notebook next to some of our example + data. + + Contributing + ------------ + + We love contributions! yt is open source, built on open source, and we'd + love to have you hang out in our community. + + We have developed some `guidelines `__ for + contributing to yt. + + **Imposter syndrome disclaimer**: We want your help. No, really. + + There may be a little voice inside your head that is telling you that + you're not ready to be an open source contributor; that your skills + aren't nearly good enough to contribute. What could you possibly offer a + project like this one? + + We assure you - the little voice in your head is wrong. If you can write + code at all, you can contribute code to open source. Contributing to + open source projects is a fantastic way to advance one's coding skills. + Writing perfect code isn't the measure of a good developer (that would + disqualify all of us!); it's trying to create something, making + mistakes, and learning from those mistakes. That's how we all improve, + and we are happy to help others learn. + + Being an open source contributor doesn't just mean writing code, either. + You can help out by writing documentation, tests, or even giving + feedback about the project (and yes - that includes giving feedback + about the contribution process). Some of these contributions may be the + most valuable to the project as a whole, because you're coming to the + project with fresh eyes, so you can see the errors and assumptions that + seasoned contributors have glossed over. + + (This disclaimer was originally written by `Adrienne + Lowe `__ for a `PyCon + talk `__, and was adapted + by yt based on its use in the README file for the `MetPy + project `__) + + Resources + --------- + + We have some community and documentation resources available. + + - Our latest documentation is always at http://yt-project.org/docs/dev/ + and it includes recipes, tutorials, and API documentation + - The `discussion mailing + list `__ + should be your first stop for general questions + - The `development mailing + list `__ + is better suited for more development issues + - You can also join us on Slack at yt-project.slack.com (`request an + invite `__) + + .. |Users' Mailing List| image:: https://img.shields.io/badge/Users-List-lightgrey.svg + :target: http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org/ + .. |Devel Mailing List| image:: https://img.shields.io/badge/Devel-List-lightgrey.svg + :target: http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org/ + .. |Build Status| image:: https://img.shields.io/travis/yt-project/yt.svg?branch=master + :target: https://travis-ci.org/yt-project/yt + .. |Latest Documentation| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg + :target: http://yt-project.org/docs/dev/ + .. |Data Hub| image:: https://img.shields.io/badge/data-hub-orange.svg + :target: https://hub.yt/ + .. |Powered by NumFOCUS| image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A + :target: http://numfocus.org + Keywords: astronomy astrophysics visualization amr adaptivemeshrefinement Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable diff -Nru yt-3.3.3/README yt-3.4.0/README --- yt-3.3.3/README 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -Hi there! You've just downloaded yt, an analysis tool for scientific -datasets, generated on a variety of data platforms. It's written in -python and heavily leverages NumPy, Matplotlib, SymPy and Cython for a variety -of tasks. - -Full documentation and a user community can be found at: - -http://yt-project.org/ - -http://yt-project.org/doc/ - -If you have used Python before, and are comfortable with installing packages, -you should find the setup.py script fairly straightforward: simply execute -"python setup.py install". - -If you would rather a more automated installation, you can use the script -doc/install_script.sh . You will have to set the destination directory, and -there are options available, but it should be straightforward. - -For more information on installation, what to do if you run into problems, or -ways to help development, please visit our website. - -Enjoy! - diff -Nru yt-3.3.3/README.md yt-3.4.0/README.md --- yt-3.3.3/README.md 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/README.md 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,139 @@ +# The yt Project + +[![Users' Mailing List](https://img.shields.io/badge/Users-List-lightgrey.svg)](http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org/) +[![Devel Mailing List](https://img.shields.io/badge/Devel-List-lightgrey.svg)](http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org/) +[![Build Status](https://img.shields.io/travis/yt-project/yt.svg?branch=master)](https://travis-ci.org/yt-project/yt) +[![Latest Documentation](https://img.shields.io/badge/docs-latest-brightgreen.svg)](http://yt-project.org/docs/dev/) +[![Data Hub](https://img.shields.io/badge/data-hub-orange.svg)](https://hub.yt/) +[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](http://numfocus.org) + + + +yt is an open-source, permissively-licensed python package for analyzing and +visualizing volumetric data. + +yt supports structured, variable-resolution meshes, unstructured meshes, and +discrete or sampled data such as particles. Focused on driving +physically-meaningful inquiry, yt has been applied in domains such as +astrophysics, seismology, nuclear engineering, molecular dynamics, and +oceanography. Composed of a friendly community of users and developers, we want +to make it easy to use and develop - we'd love it if you got involved! + +We've written a [method +paper](http://adsabs.harvard.edu/abs/2011ApJS..192....9T) you may be interested +in; if you use yt in the preparation of a publication, please consider citing +it. + +## Installation + +If you're using conda with [conda-forge](http://conda-forge.github.io/), you +can install the most recent stable version by running: + +``` +conda install -c conda-forge yt +``` + +or by doing: + +``` +pip install yt +``` + +If you want the latest nightly build, you can manually install from our +repository: + +``` +conda install -c http://use.yt/with_conda yt +``` + +To get set up with a development version, you can clone this repository and +install like this: + +``` +git clone https://github.com/yt-project/yt yt-git +cd yt-git +pip install -e . +``` + +To set up yt in a virtualenv (and there are [many good +reasons](https://packaging.python.org/installing/#creating-virtual-environments) +to do so!) you can follow this prescription: + +``` +# Assuming you have cd'd into yt-git +# It is conventional to create virtualenvs at ~/.virtualenv/ +$ mkdir -p ~/.virtualenv +# Assuming your version of Python 3 is 3.4 or higher, +# create a virtualenv named yt +$ python3 -m venv ~/.virtualenv/yt +# Activate it +$ source ~/.virtualenv/yt/bin/activate +# Make sure you run the latest version of pip +$ pip install --upgrade pip +$ pip install -e . +# Output installed packages +$ pip freeze +``` + +## Getting Started + +yt is designed to provide meaningful analysis of data. We have some Quickstart +example notebooks in the repository: + + * [Introduction](doc/source/quickstart/1\)_Introduction.ipynb) + * [Data Inspection](doc/source/quickstart/2\)_Data_Inspection.ipynb) + * [Simple Visualization](doc/source/quickstart/3\)_Simple_Visualization.ipynb) + * [Data Objects and Time Series](doc/source/quickstart/4\)_Data_Objects_and_Time_Series.ipynb) + * [Derived Fields and Profiles](doc/source/quickstart/5\)_Derived_Fields_and_Profiles.ipynb) + * [Volume Rendering](doc/source/quickstart/6\)_Volume_Rendering.ipynb) + +If you'd like to try these online, you can visit our [yt Hub](https://hub.yt/) +and run a notebook next to some of our example data. + +## Contributing + +We love contributions! yt is open source, built on open source, and we'd love +to have you hang out in our community. + +We have developed some [guidelines](CONTRIBUTING.rst) for contributing to yt. + +**Imposter syndrome disclaimer**: We want your help. No, really. + +There may be a little voice inside your head that is telling you that you're not +ready to be an open source contributor; that your skills aren't nearly good +enough to contribute. What could you possibly offer a project like this one? + +We assure you - the little voice in your head is wrong. If you can write code at +all, you can contribute code to open source. Contributing to open source +projects is a fantastic way to advance one's coding skills. Writing perfect code +isn't the measure of a good developer (that would disqualify all of us!); it's +trying to create something, making mistakes, and learning from those +mistakes. That's how we all improve, and we are happy to help others learn. + +Being an open source contributor doesn't just mean writing code, either. You can +help out by writing documentation, tests, or even giving feedback about the +project (and yes - that includes giving feedback about the contribution +process). Some of these contributions may be the most valuable to the project as +a whole, because you're coming to the project with fresh eyes, so you can see +the errors and assumptions that seasoned contributors have glossed over. + +(This disclaimer was originally written by +[Adrienne Lowe](https://github.com/adriennefriend) for a +[PyCon talk](https://www.youtube.com/watch?v=6Uj746j9Heo), and was adapted by yt +based on its use in the README file for the +[MetPy project](https://github.com/Unidata/MetPy)) + +## Resources + +We have some community and documentation resources available. + + * Our latest documentation is always at http://yt-project.org/docs/dev/ and it + includes recipes, tutorials, and API documentation + * The [discussion mailing + list](http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org/) + should be your first stop for general questions + * The [development mailing + list](http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org/) is + better suited for more development issues + * You can also join us on Slack at yt-project.slack.com ([request an + invite](http://yt-project.org/slack.html)) diff -Nru yt-3.3.3/scripts/iyt yt-3.4.0/scripts/iyt --- yt-3.3.3/scripts/iyt 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/scripts/iyt 2017-08-10 18:02:57.000000000 +0000 @@ -2,7 +2,6 @@ from __future__ import print_function import os import re -from distutils.version import LooseVersion from yt.mods import * from yt.data_objects.data_containers import YTDataContainer namespace = locals().copy() @@ -25,38 +24,11 @@ code.interact(doc, None, namespace) sys.exit() -if LooseVersion(IPython.__version__) <= LooseVersion('0.10'): - api_version = '0.10' -elif LooseVersion(IPython.__version__) <= LooseVersion('1.0'): - api_version = '0.11' -else: - api_version = '1.0' - -if api_version == "0.10" and "DISPLAY" in os.environ: - from matplotlib import rcParams - ipbackends = dict(Qt4 = IPython.Shell.IPShellMatplotlibQt4, - WX = IPython.Shell.IPShellMatplotlibWX, - GTK = IPython.Shell.IPShellMatplotlibGTK, - Qt = IPython.Shell.IPShellMatplotlibQt) - bend = (rcParams["backend"]).rstrip('Agg') - - try: - ip_shell = ipbackends[bend](user_ns=namespace) - except KeyError: - ip_shell = IPython.Shell.IPShellMatplotlib(user_ns=namespace) -elif api_version == "0.10": - ip_shell = IPython.Shell.IPShellMatplotlib(user_ns=namespace) -else: - if api_version == "0.11": - from IPython.frontend.terminal.interactiveshell import \ - TerminalInteractiveShell - elif api_version == "1.0": - from IPython.terminal.interactiveshell import TerminalInteractiveShell - else: - raise RuntimeError - ip_shell = TerminalInteractiveShell(user_ns=namespace, banner1 = doc, - display_banner = True) - if "DISPLAY" in os.environ: ip_shell.enable_pylab(import_all=False) +from IPython.terminal.interactiveshell import TerminalInteractiveShell +ip_shell = TerminalInteractiveShell(user_ns=namespace, banner1 = doc, + display_banner = True) +if "DISPLAY" in os.environ: + ip_shell.enable_pylab(import_all=False) # The rest is a modified version of the IPython default profile code @@ -82,14 +54,9 @@ # Most of your config files and extensions will probably start with this import #import IPython.ipapi -if api_version == "0.10": - ip = ip_shell.IP.getapi() - try_next = IPython.ipapi.TryNext - kwargs = dict(sys_exit=1, banner=doc) -elif api_version in ("0.11", "1.0"): - ip = ip_shell - try_next = IPython.core.error.TryNext - kwargs = dict() +ip = ip_shell +try_next = IPython.core.error.TryNext +kwargs = dict() ip.ex("from yt.mods import *") ip.ex("import yt") diff -Nru yt-3.3.3/setup.cfg yt-3.4.0/setup.cfg --- yt-3.3.3/setup.cfg 2016-12-12 01:42:09.000000000 +0000 +++ yt-3.4.0/setup.cfg 2017-08-10 18:21:03.000000000 +0000 @@ -1,7 +1,6 @@ [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 [nosetests] detailed-errors = 1 @@ -9,7 +8,7 @@ with-xunit = 1 [flake8] -exclude = doc,benchmarks,*/api.py,*/__init__.py,*/__config__.py,yt/visualization/_mpl_imports.py,yt/utilities/lodgeit.py,yt/utilities/lru_cache.py,yt/utilities/poster/*,yt/extern/*,yt/mods.py +exclude = doc,benchmarks,*/api.py,*/__init__.py,*/__config__.py,yt/visualization/_mpl_imports.py,yt/utilities/lodgeit.py,yt/utilities/lru_cache.py,yt/utilities/poster/*,yt/extern/*,yt/mods.py,yt/utilities/fits_image.py max-line-length = 999 -ignore = E111,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E201,E202,E211,E221,E222,E227,E228,E241,E301,E203,E225,E226,E231,E251,E261,E262,E265,E266,E302,E303,E402,E502,E701,E703,E731,W291,W292,W293,W391,W503 +ignore = E111,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E201,E202,E211,E221,E222,E227,E228,E241,E301,E203,E225,E226,E231,E251,E261,E262,E265,E266,E302,E303,E305,E306,E402,E502,E701,E703,E731,W291,W292,W293,W391,W503 diff -Nru yt-3.3.3/setupext.py yt-3.4.0/setupext.py --- yt-3.3.3/setupext.py 2016-12-06 20:17:37.000000000 +0000 +++ yt-3.4.0/setupext.py 2017-08-10 18:02:57.000000000 +0000 @@ -142,20 +142,3 @@ shutil.rmtree(tmpdir) return rd - - -def get_mercurial_changeset_id(target_dir): - ''' - Returns changeset and branch using hglib - ''' - try: - import hglib - except ImportError: - return None - try: - with hglib.open(target_dir) as repo: - changeset = repo.identify( - id=True, branch=True).strip().decode('utf8') - except hglib.error.ServerError: - return None - return changeset diff -Nru yt-3.3.3/setup.py yt-3.4.0/setup.py --- yt-3.3.3/setup.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/setup.py 2017-08-10 18:19:54.000000000 +0000 @@ -6,17 +6,19 @@ from setuptools.extension import Extension from setuptools.command.build_ext import build_ext as _build_ext from setuptools.command.sdist import sdist as _sdist -from setuptools.command.build_py import build_py as _build_py from setupext import \ - check_for_openmp, check_for_pyembree, read_embree_location, \ - get_mercurial_changeset_id, in_conda_env + check_for_openmp, \ + check_for_pyembree, \ + read_embree_location, \ + in_conda_env from distutils.version import LooseVersion import pkg_resources -if sys.version_info < (2, 7): - print("yt currently requires Python version 2.7") - print("certain features may fail unexpectedly and silently with older versions.") +if sys.version_info < (2, 7) or (3, 0) < sys.version_info < (3, 3): + print("yt currently supports Python 2.7 or versions newer than Python 3.4") + print("certain features may fail unexpectedly and silently with older " + "versions.") sys.exit(1) try: @@ -32,11 +34,17 @@ except pkg_resources.DistributionNotFound: pass # yay! -VERSION = "3.3.3" +VERSION = "3.4.0" if os.path.exists('MANIFEST'): os.remove('MANIFEST') +try: + import pypandoc + long_description = pypandoc.convert_file('README.md', 'rst') +except (ImportError, IOError): + with open('README.md') as file: + long_description = file.read() if check_for_openmp() is True: omp_args = ['-fopenmp'] @@ -92,10 +100,9 @@ ["yt/geometry/fake_octree.pyx"], include_dirs=["yt/utilities/lib/"], libraries=std_libs), - Extension("yt.utilities.spatial.ckdtree", - ["yt/utilities/spatial/ckdtree.pyx"], - include_dirs=["yt/utilities/lib/"], - libraries=std_libs), + Extension("yt.utilities.lib.autogenerated_element_samplers", + ["yt/utilities/lib/autogenerated_element_samplers.pyx"], + include_dirs=["yt/utilities/lib/"]), Extension("yt.utilities.lib.bitarray", ["yt/utilities/lib/bitarray.pyx"], libraries=std_libs), @@ -111,6 +118,10 @@ include_dirs=["yt/utilities/lib/", "yt/geometry/"], libraries=std_libs), + Extension("yt.utilities.lib.fnv_hash", + ["yt/utilities/lib/fnv_hash.pyx"], + include_dirs=["yt/utilities/lib/"], + libraries=std_libs), Extension("yt.utilities.lib.geometry_utils", ["yt/utilities/lib/geometry_utils.pyx"], extra_compile_args=omp_args, @@ -143,14 +154,10 @@ depends=["yt/utilities/lib/origami_tags.h"]), Extension("yt.utilities.lib.grid_traversal", ["yt/utilities/lib/grid_traversal.pyx", - "yt/utilities/lib/fixed_interpolator.c", - "yt/utilities/lib/kdtree.c"], + "yt/utilities/lib/fixed_interpolator.c"], include_dirs=["yt/utilities/lib/"], libraries=std_libs, - extra_compile_args=omp_args, - extra_link_args=omp_args, - depends=["yt/utilities/lib/kdtree.h", - "yt/utilities/lib/fixed_interpolator.h"]), + depends=["yt/utilities/lib/fixed_interpolator.h"]), Extension("yt.utilities.lib.image_samplers", ["yt/utilities/lib/image_samplers.pyx", "yt/utilities/lib/fixed_interpolator.c"], @@ -176,8 +183,8 @@ lib_exts = [ "particle_mesh_operations", "depth_first_octree", "fortran_reader", "interpolators", "misc_utilities", "basic_octree", "image_utilities", - "points_in_volume", "quad_tree", "ray_integrators", "mesh_utilities", - "amr_kdtools", "lenses", + "points_in_volume", "quad_tree", "mesh_utilities", + "amr_kdtools", "lenses", "distance_queue", "allocation_container" ] for ext_name in lib_exts: cython_extensions.append( @@ -205,8 +212,6 @@ "yt/geometry/", "yt/utilities/lib/"], depends=glob.glob("yt/frontends/artio/artio_headers/*.c")), - Extension("yt.utilities.spatial._distance_wrap", - glob.glob("yt/utilities/spatial/src/*.c")), ] # EMBREE @@ -283,37 +288,64 @@ library_dirs=[ldir], include_dirs=[idir])) -class build_py(_build_py): - def run(self): - # honor the --dry-run flag - if not self.dry_run: - target_dir = os.path.join(self.build_lib, 'yt') - src_dir = os.getcwd() - changeset = get_mercurial_changeset_id(src_dir) - self.mkpath(target_dir) - with open(os.path.join(target_dir, '__hg_version__.py'), 'w') as fobj: - fobj.write("hg_version = '%s'\n" % changeset) - _build_py.run(self) - class build_ext(_build_ext): # subclass setuptools extension builder to avoid importing cython and numpy # at top level in setup.py. See http://stackoverflow.com/a/21621689/1382869 def finalize_options(self): + try: + import cython + import numpy + except ImportError: + raise ImportError( +"""Could not import cython or numpy. Building yt from source requires +cython and numpy to be installed. Please install these packages using +the appropriate package manager for your python environment.""") + if LooseVersion(cython.__version__) < LooseVersion('0.24'): + raise RuntimeError( +"""Building yt from source requires Cython 0.24 or newer but +Cython %s is installed. Please update Cython using the appropriate +package manager for your python environment.""" % + cython.__version__) + if LooseVersion(numpy.__version__) < LooseVersion('1.10.4'): + raise RuntimeError( +"""Building yt from source requires NumPy 1.10.4 or newer but +NumPy %s is installed. Please update NumPy using the appropriate +package manager for your python environment.""" % + numpy.__version__) from Cython.Build import cythonize self.distribution.ext_modules[:] = cythonize( self.distribution.ext_modules) _build_ext.finalize_options(self) # Prevent numpy from thinking it is still in its setup process # see http://stackoverflow.com/a/21621493/1382869 - __builtins__.__NUMPY_SETUP__ = False - import numpy + if isinstance(__builtins__, dict): + # sometimes this is a dict so we need to check for that + # https://docs.python.org/3/library/builtins.html + __builtins__["__NUMPY_SETUP__"] = False + else: + __builtins__.__NUMPY_SETUP__ = False self.include_dirs.append(numpy.get_include()) class sdist(_sdist): # subclass setuptools source distribution builder to ensure cython # generated C files are included in source distribution. # See http://stackoverflow.com/a/18418524/1382869 + # subclass setuptools source distribution builder to ensure cython + # generated C files are included in source distribution and readme + # is converted from markdown to restructured text. See + # http://stackoverflow.com/a/18418524/1382869 def run(self): + # Make sure the compiled Cython files in the distribution are + # up-to-date + + try: + import pypandoc + except ImportError: + raise RuntimeError( + 'Trying to create a source distribution without pypandoc. ' + 'The readme will not render correctly on pypi without ' + 'pypandoc so we are exiting.' + ) # Make sure the compiled Cython files in the distribution are up-to-date from Cython.Build import cythonize cythonize(cython_extensions) @@ -322,9 +354,8 @@ setup( name="yt", version=VERSION, - description="An analysis and visualization toolkit for Astrophysical " - + "simulations, focusing on Adaptive Mesh Refinement data " - "from Enzo, Orion, FLASH, and others.", + description="An analysis and visualization toolkit for volumetric data", + long_description = long_description, classifiers=["Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Science/Research", @@ -352,34 +383,22 @@ }, packages=find_packages(), include_package_data = True, - setup_requires=[ - 'numpy', - 'cython>=0.24', - ], install_requires=[ - 'matplotlib', + 'matplotlib>=1.5.3', 'setuptools>=19.6', - 'sympy', - 'numpy', - 'IPython', - 'cython', + 'sympy>=1.0', + 'numpy>=1.10.4', + 'IPython>=1.0', ], - cmdclass={'sdist': sdist, 'build_ext': build_ext, 'build_py': build_py}, + extras_require = { + 'hub': ["girder_client"] + }, + cmdclass={'sdist': sdist, 'build_ext': build_ext}, author="The yt project", author_email="yt-dev@lists.spacepope.org", url="http://yt-project.org/", - license="BSD", + license="BSD 3-Clause", zip_safe=False, scripts=["scripts/iyt"], ext_modules=cython_extensions + extensions, ) - -# This info about 'ckdtree' should be incorporated somehow... -# setup(maintainer="SciPy Developers", -# author="Anne Archibald", -# maintainer_email="scipy-dev@scipy.org", -# description="Spatial algorithms and data structures", -# url="http://www.scipy.org", -# license="SciPy License (BSD Style)", -# **configuration(top_path='').todict() -# ) diff -Nru yt-3.3.3/yt/analysis_modules/absorption_spectrum/absorption_spectrum.py yt-3.4.0/yt/analysis_modules/absorption_spectrum/absorption_spectrum.py --- yt-3.3.3/yt/analysis_modules/absorption_spectrum/absorption_spectrum.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/absorption_spectrum/absorption_spectrum.py 2017-08-10 18:02:57.000000000 +0000 @@ -365,7 +365,7 @@ this_wavelength[lixel]), \ continuum['index']) * \ (column_density[lixel] / continuum['normalization']) - self.tau_field[left_index[lixel]:right_index[lixel]] += cont_tau + self.tau_field[left_index[lixel]:right_index[lixel]] += cont_tau.d pbar.update(i) pbar.finish() @@ -495,8 +495,8 @@ window_width_in_bins = 2 while True: - left_index = (center_index[i] - window_width_in_bins/2) - right_index = (center_index[i] + window_width_in_bins/2) + left_index = (center_index[i] - window_width_in_bins//2) + right_index = (center_index[i] + window_width_in_bins//2) n_vbins = (right_index - left_index) * n_vbins_per_bin[i] # the array of virtual bins in lambda space diff -Nru yt-3.3.3/yt/analysis_modules/absorption_spectrum/tests/test_absorption_spectrum.py yt-3.4.0/yt/analysis_modules/absorption_spectrum/tests/test_absorption_spectrum.py --- yt-3.3.3/yt/analysis_modules/absorption_spectrum/tests/test_absorption_spectrum.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/absorption_spectrum/tests/test_absorption_spectrum.py 2017-08-10 18:02:57.000000000 +0000 @@ -301,7 +301,7 @@ def test_voigt_profiles(): a = 1.7e-4 x = np.linspace(5.0, -3.6, 60) - yield assert_allclose_units, voigt_old(a, x), voigt_scipy(a, x), 1e-8 + assert_allclose_units(voigt_old(a, x), voigt_scipy(a, x), 1e-8) @requires_file(GIZMO_PLUS) @requires_answer_testing() diff -Nru yt-3.3.3/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py yt-3.4.0/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py --- yt-3.3.3/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py 2017-08-10 18:02:57.000000000 +0000 @@ -20,6 +20,7 @@ from yt.config import \ ytcfg from yt.funcs import \ + ensure_dir, \ mylog, \ only_on_root from yt.analysis_modules.cosmological_observation.cosmology_splice import \ @@ -112,8 +113,7 @@ self.output_prefix = output_prefix # Create output directory. - if not os.path.exists(self.output_dir): - only_on_root(os.mkdir, self.output_dir) + ensure_dir(self.output_dir) # Calculate light cone solution. CosmologySplice.__init__(self, parameter_filename, simulation_type, @@ -298,7 +298,7 @@ "or a tuple of type (float, str).") # Calculate number of pixels on a side. - pixels = (field_of_view / image_resolution).in_units("") + pixels = int((field_of_view / image_resolution).in_units("")) # Clear projection stack. projection_stack = [] diff -Nru yt-3.3.3/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py yt-3.4.0/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py --- yt-3.3.3/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py 2017-08-10 18:02:57.000000000 +0000 @@ -53,7 +53,7 @@ Parameters ---------- - parameter_filename : string or :class:`yt.data_objects.static_output.Dataset` + parameter_filename : string or :class:`~yt.data_objects.static_output.Dataset` For simple rays, one may pass either a loaded dataset object or the filename of a dataset. For compound rays, one must pass the filename of the simulation @@ -655,33 +655,32 @@ Write light ray data to hdf5 file. """ + + extra_attrs = {"data_type": "yt_light_ray"} if self.simulation_type is None: ds = self.ds else: ds = {} - ds["dimensionality"] = self.simulation.dimensionality - ds["domain_left_edge"] = self.simulation.domain_left_edge - ds["domain_right_edge"] = self.simulation.domain_right_edge - ds["cosmological_simulation"] = self.simulation.cosmological_simulation ds["periodicity"] = (True, True, True) ds["current_redshift"] = self.near_redshift - for attr in ["omega_lambda", "omega_matter", "hubble_constant"]: - ds[attr] = getattr(self.cosmology, attr) + for attr in ["dimensionality", "cosmological_simulation", + "domain_left_edge", "domain_right_edge", + "length_unit", "time_unit"]: + ds[attr] = getattr(self.simulation, attr) + if self.simulation.cosmological_simulation: + for attr in ["omega_lambda", "omega_matter", + "hubble_constant"]: + ds[attr] = getattr(self.cosmology, attr) ds["current_time"] = \ self.cosmology.t_from_z(ds["current_redshift"]) if isinstance(ds["hubble_constant"], YTArray): ds["hubble_constant"] = \ ds["hubble_constant"].to("100*km/(Mpc*s)").d - extra_attrs = {"data_type": "yt_light_ray"} + extra_attrs["unit_registry_json"] = \ + self.simulation.unit_registry.to_json() # save the light ray solution if len(self.light_ray_solution) > 0: - # Convert everything to base unit system now to avoid - # problems with different units for each ds. - for s in self.light_ray_solution: - for f in s: - if isinstance(s[f], YTArray): - s[f].convert_to_base() for key in self.light_ray_solution[0]: if key in ["next", "previous", "index"]: continue @@ -690,7 +689,12 @@ to_arr = YTArray else: to_arr = np.array - extra_attrs["light_ray_solution_%s" % key] = to_arr(lrsa) + arr = to_arr(lrsa) + # If we somehow create an object array, convert it to a string + # to avoid errors later + if arr.dtype == 'O': + arr = arr.astype(str) + extra_attrs["light_ray_solution_%s" % key] = arr field_types = dict([(field, "grid") for field in data.keys()]) diff -Nru yt-3.3.3/yt/analysis_modules/halo_analysis/enzofof_merger_tree.py yt-3.4.0/yt/analysis_modules/halo_analysis/enzofof_merger_tree.py --- yt-3.3.3/yt/analysis_modules/halo_analysis/enzofof_merger_tree.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_analysis/enzofof_merger_tree.py 2017-08-10 18:02:57.000000000 +0000 @@ -713,8 +713,8 @@ The filename to which you saved the hdf5 data from save_halo_evolution halo_id : int The halo in 'filename' that you want to follow - x_quantity, y_quantity : str, optional - The quantity that you want to plot as the x_coord (or y_coords). + x_quantity : str, optional + The quantity that you want to plot as the x_coord. Valid options are: * cycle @@ -732,8 +732,12 @@ * COM_vy * COM_vz - x_log, y_log : bool, optional - Do you want the x(y)-axis to be in log or linear? + y_quantity : str, optional + The quantity that you want to plot as the y_coord. + x_log : bool, optional + Do you want the x-axis to be in log or linear? + y_log : bool, optional + Do you want the y-axis to be in log or linear? FOF_directory : str, optional Directory where FOF files (and hdf file) are located diff -Nru yt-3.3.3/yt/analysis_modules/halo_analysis/halo_callbacks.py yt-3.4.0/yt/analysis_modules/halo_analysis/halo_callbacks.py --- yt-3.3.3/yt/analysis_modules/halo_analysis/halo_callbacks.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_analysis/halo_callbacks.py 2017-08-10 18:02:57.000000000 +0000 @@ -246,9 +246,9 @@ setattr(halo, storage, halo_store) halo_store.update(prof_store) - if hasattr(my_profile, "variance"): - variance_store = dict([(field, my_profile.variance[field]) \ - for field in my_profile.variance]) + if my_profile.standard_deviation is not None: + variance_store = dict([(field, my_profile.standard_deviation[field]) \ + for field in my_profile.standard_deviation]) variance_storage = "%s_variance" % storage if hasattr(halo, variance_storage): halo_variance_store = getattr(halo, variance_storage) diff -Nru yt-3.3.3/yt/analysis_modules/halo_analysis/halo_catalog.py yt-3.4.0/yt/analysis_modules/halo_analysis/halo_catalog.py --- yt-3.3.3/yt/analysis_modules/halo_analysis/halo_catalog.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_analysis/halo_catalog.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,10 +13,11 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -from yt.utilities.on_demand_imports import _h5py as h5py import numpy as np import os +from yt.frontends.ytdata.utilities import \ + save_as_dataset from yt.funcs import \ ensure_dir, \ mylog @@ -71,11 +72,11 @@ -------- >>> # create profiles or overdensity vs. radius for each halo and save to disk - >>> from yt.mods import * + >>> import yt >>> from yt.analysis_modules.halo_analysis.api import * - >>> data_ds = load("DD0064/DD0064") - >>> halos_ds = load("rockstar_halos/halos_64.0.bin", - ... output_dir="halo_catalogs/catalog_0064") + >>> data_ds = yt.load("DD0064/DD0064") + >>> halos_ds = yt.load("rockstar_halos/halos_64.0.bin", + ... output_dir="halo_catalogs/catalog_0064") >>> hc = HaloCatalog(data_ds=data_ds, halos_ds=halos_ds) >>> # filter out halos with mass < 1e13 Msun >>> hc.add_filter("quantity_value", "particle_mass", ">", 1e13, "Msun") @@ -90,7 +91,7 @@ >>> hc.create() >>> # load in the saved halo catalog and all the profile data - >>> halos_ds = load("halo_catalogs/catalog_0064/catalog_0064.0.h5") + >>> halos_ds = yt.load("halo_catalogs/catalog_0064/catalog_0064.0.h5") >>> hc = HaloCatalog(halos_ds=halos_ds, output_dir="halo_catalogs/catalog_0064") >>> hc.add_callback("load_profiles", output_dir="profiles") @@ -431,13 +432,16 @@ key, quantity = action if quantity in self.halos_ds.field_info: new_halo.quantities[key] = \ - self.data_source[quantity][int(i)].in_cgs() + self.data_source[quantity][int(i)] elif callable(quantity): new_halo.quantities[key] = quantity(new_halo) else: - raise RuntimeError("Action must be a callback, filter, or quantity.") + raise RuntimeError( + "Action must be a callback, filter, or quantity.") if halo_filter: + for quantity in new_halo.quantities.values(): + quantity.convert_to_base() self.catalog.append(new_halo.quantities) if save_halos and halo_filter: @@ -458,33 +462,28 @@ mylog.info("Saving halo catalog (%d halos) to %s." % (n_halos, os.path.join(self.output_dir, self.output_prefix))) - out_file = h5py.File(filename, 'w') - for attr in ["current_redshift", "current_time", - "domain_dimensions", - "cosmological_simulation", "omega_lambda", - "omega_matter", "hubble_constant"]: - out_file.attrs[attr] = getattr(self.halos_ds, attr) - for attr in ["domain_left_edge", "domain_right_edge"]: - out_file.attrs[attr] = getattr(self.halos_ds, attr).in_cgs() - out_file.attrs["data_type"] = "halo_catalog" - out_file.attrs["num_halos"] = n_halos + extra_attrs = {"data_type": "halo_catalog", + "num_halos": n_halos} + data = {} + ftypes = {} if n_halos > 0: - field_data = np.empty(n_halos) for key in self.quantities: - units = "" - if hasattr(self.catalog[0][key], "units"): - units = str(self.catalog[0][key].units) - for i in range(n_halos): - field_data[i] = self.catalog[i][key] - dataset = out_file.create_dataset(str(key), data=field_data) - dataset.attrs["units"] = units - out_file.close() + # This sets each field to be saved in the root hdf5 group, + # as per the HaloCatalog format. + ftypes[key] = "." + data[key] = self.halos_ds.arr( + [halo[key] for halo in self.catalog]) - def add_default_quantities(self, field_type='halos'): - self.add_quantity("particle_identifier", field_type=field_type,prepend=True) - self.add_quantity("particle_mass", field_type=field_type,prepend=True) - self.add_quantity("particle_position_x", field_type=field_type,prepend=True) - self.add_quantity("particle_position_y", field_type=field_type,prepend=True) - self.add_quantity("particle_position_z", field_type=field_type,prepend=True) - self.add_quantity("virial_radius", field_type=field_type,prepend=True) + save_as_dataset(self.halos_ds, filename, data, + field_types=ftypes, extra_attrs=extra_attrs) + def add_default_quantities(self, field_type='halos'): + for field in ["particle_identifier", "particle_mass", + "particle_position_x", "particle_position_y", + "particle_position_z", "virial_radius"]: + field_name = (field_type, field) + if field_name not in self.halos_ds.field_list: + mylog.warn("Halo dataset %s has no field %s." % + (self.halos_ds, str(field_name))) + continue + self.add_quantity(field, field_type=field_type, prepend=True) diff -Nru yt-3.3.3/yt/analysis_modules/halo_analysis/halo_filters.py yt-3.4.0/yt/analysis_modules/halo_analysis/halo_filters.py --- yt-3.3.3/yt/analysis_modules/halo_analysis/halo_filters.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_analysis/halo_filters.py 2017-08-10 18:02:57.000000000 +0000 @@ -16,8 +16,9 @@ import numpy as np from yt.utilities.operator_registry import \ - OperatorRegistry -from yt.utilities.spatial import KDTree + OperatorRegistry +from yt.utilities.on_demand_imports import \ + _scipy as scipy from .halo_callbacks import HaloCallback @@ -95,7 +96,8 @@ rad = data_source[ptype, "virial_radius"].in_units("Mpc").to_ndarray() ids = data_source[ptype, "particle_identifier"].to_ndarray().astype("int") parents = -1 * np.ones_like(ids, dtype="int") - my_tree = KDTree(pos) + boxsize = data_source.ds.domain_width.in_units('Mpc') + my_tree = scipy.spatial.cKDTree(pos, boxsize=boxsize) for i in range(ids.size): neighbors = np.array( diff -Nru yt-3.3.3/yt/analysis_modules/halo_analysis/halo_finding_methods.py yt-3.4.0/yt/analysis_modules/halo_analysis/halo_finding_methods.py --- yt-3.3.3/yt/analysis_modules/halo_analysis/halo_finding_methods.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_analysis/halo_finding_methods.py 2017-08-10 18:02:57.000000000 +0000 @@ -75,8 +75,13 @@ rh = RockstarHaloFinder(ds, **finder_kwargs) rh.run() + + if 'outbase' in finder_kwargs: + outbase = finder_kwargs['outbase'] + else: + outbase = "rockstar_halos" - halos_ds = RockstarDataset("rockstar_halos/halos_0.0.bin") + halos_ds = RockstarDataset(outbase + "/halos_0.0.bin") try: halos_ds.create_field_info() except ValueError: diff -Nru yt-3.3.3/yt/analysis_modules/halo_analysis/tests/test_halo_finders.py yt-3.4.0/yt/analysis_modules/halo_analysis/tests/test_halo_finders.py --- yt-3.3.3/yt/analysis_modules/halo_analysis/tests/test_halo_finders.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_analysis/tests/test_halo_finders.py 2017-08-10 18:02:57.000000000 +0000 @@ -2,6 +2,8 @@ import sys from yt.convenience import load +from yt.frontends.halo_catalog.data_structures import \ + HaloCatalogDataset from yt.utilities.answer_testing.framework import \ FieldValuesTest, \ requires_ds @@ -30,6 +32,7 @@ "halo_catalogs", method, "%s.0.h5" % method) ds = load(fn) + assert isinstance(ds, HaloCatalogDataset) for field in _fields: yield FieldValuesTest(ds, field, particle_type=True, decimals=decimals[method]) diff -Nru yt-3.3.3/yt/analysis_modules/halo_finding/halo_objects.py yt-3.4.0/yt/analysis_modules/halo_finding/halo_objects.py --- yt-3.3.3/yt/analysis_modules/halo_finding/halo_objects.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_finding/halo_objects.py 2017-08-10 18:02:57.000000000 +0000 @@ -708,12 +708,12 @@ ------- tuple : (cm, mag_A, mag_B, mag_C, e0_vector, tilt) The 6-tuple has in order: - #. The center of mass as an array. - #. mag_A as a float. - #. mag_B as a float. - #. mag_C as a float. - #. e0_vector as an array. - #. tilt as a float. + #. The center of mass as an array. + #. mag_A as a float. + #. mag_B as a float. + #. mag_C as a float. + #. e0_vector as an array. + #. tilt as a float. Examples -------- @@ -1281,7 +1281,7 @@ def haloCmp(h1, h2): def cmp(a, b): - return (a > b) - (a < b) + return (a > b) ^ (a < b) c = cmp(h1.total_mass(), h2.total_mass()) if c != 0: return -1 * c diff -Nru yt-3.3.3/yt/analysis_modules/halo_finding/hop/EnzoHop.c yt-3.4.0/yt/analysis_modules/halo_finding/hop/EnzoHop.c --- yt-3.3.3/yt/analysis_modules/halo_finding/hop/EnzoHop.c 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_finding/hop/EnzoHop.c 2017-08-10 17:56:56.000000000 +0000 @@ -27,6 +27,9 @@ #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) #endif +void PrepareKD(KD kd); +int kdMedianJst(KD kd, int d, int l, int u); +void kdUpPass(KD kd, int iCell); void initgrouplist(Grouplist *g); void hop_main(KD kd, HC *my_comm, float densthres); void regroup_main(float dens_outer, HC *my_comm); diff -Nru yt-3.3.3/yt/analysis_modules/halo_finding/rockstar/rockstar_groupies.pyx yt-3.4.0/yt/analysis_modules/halo_finding/rockstar/rockstar_groupies.pyx --- yt-3.3.3/yt/analysis_modules/halo_finding/rockstar/rockstar_groupies.pyx 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_finding/rockstar/rockstar_groupies.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -2,14 +2,11 @@ import os, sys cimport numpy as np cimport cython +from cython cimport floating #from cpython.mem cimport PyMem_Malloc from libc.stdlib cimport malloc, free import sys -ctypedef fused anyfloat: - np.float32_t - np.float64_t - # Importing relevant rockstar data types particle, fof halo, halo cdef import from "particle.h": @@ -366,8 +363,8 @@ @cython.wraparound(False) def make_rockstar_fof(self, np.ndarray[np.int64_t, ndim=1] pind, np.ndarray[np.int64_t, ndim=1] fof_tags, - np.ndarray[anyfloat, ndim=2] pos, - np.ndarray[anyfloat, ndim=2] vel): + np.ndarray[floating, ndim=2] pos, + np.ndarray[floating, ndim=2] vel): verbose = False # Define fof object diff -Nru yt-3.3.3/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx yt-3.4.0/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx --- yt-3.3.3/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -296,7 +296,7 @@ SCALE_NOW = 1.0/(tds.current_redshift+1.0) if callbacks is None: callbacks = [] self.callbacks = callbacks - if not outbase =='None'.decode('UTF-8'): + if not outbase == 'None'.encode('UTF-8'): #output directory. since we can't change the output filenames #workaround is to make a new directory OUTBASE = outbase diff -Nru yt-3.3.3/yt/analysis_modules/halo_finding/rockstar/rockstar.py yt-3.4.0/yt/analysis_modules/halo_finding/rockstar/rockstar.py --- yt-3.3.3/yt/analysis_modules/halo_finding/rockstar/rockstar.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_finding/rockstar/rockstar.py 2017-08-10 18:02:57.000000000 +0000 @@ -17,6 +17,8 @@ from yt.config import ytcfg from yt.data_objects.time_series import \ DatasetSeries +from yt.extern import \ + six from yt.funcs import \ is_root, mylog from yt.utilities.parallel_tools.parallel_analysis_interface import \ @@ -114,29 +116,29 @@ Parameters ---------- - ts: DatasetSeries, Dataset + ts : DatasetSeries, ~yt.data_objects.static_output.Dataset This is the data source containing the DM particles. Because halo IDs may change from one snapshot to the next, the only way to keep a consistent halo ID across time is to feed Rockstar a set of snapshots, ie, via DatasetSeries. - num_readers: int + num_readers : int The number of reader can be increased from the default of 1 in the event that a single snapshot is split among many files. This can help in cases where performance is IO-limited. Default is 1. If run inline, it is equal to the number of MPI threads. - num_writers: int + num_writers : int The number of writers determines the number of processing threads as well as the number of threads writing output data. The default is set to comm.size-num_readers-1. If run inline, the default is equal to the number of MPI threads. - outbase: str + outbase : str This is where the out*list files that Rockstar makes should be placed. Default is 'rockstar_halos'. - particle_type: str + particle_type : str This is the "particle type" that can be found in the data. This can be a filtered particle or an inherent type. - force_res: float + force_res : float This parameter specifies the force resolution that Rockstar uses in units of Mpc/h. If no value is provided, this parameter is automatically set to @@ -325,7 +327,9 @@ self.ts._pre_outputs = self.ts._pre_outputs[restart_num:] else: restart_num = 0 - self.handler.setup_rockstar(self.server_address, self.port, + self.handler.setup_rockstar( + six.b(self.server_address), + six.b(self.port), num_outputs, self.total_particles, self.particle_type, particle_mass = self.particle_mass, @@ -334,7 +338,7 @@ num_writers = self.num_writers, writing_port = -1, block_ratio = block_ratio, - outbase = self.outbase, + outbase = six.b(self.outbase), force_res = self.force_res, callbacks = callbacks, restart_num = restart_num, diff -Nru yt-3.3.3/yt/analysis_modules/halo_mass_function/api.py yt-3.4.0/yt/analysis_modules/halo_mass_function/api.py --- yt-3.3.3/yt/analysis_modules/halo_mass_function/api.py 2016-10-25 16:08:30.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_mass_function/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,6 +13,14 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +from yt.funcs import issue_deprecation_warning + +issue_deprecation_warning( + "The halo_mass_function module does not function correctly and has been " + "deprecated. This code has been moved to the yt attic " + "(https://bitbucket.org/yt_analysis/yt_attic) and will be removed in a " + "future release.") + from .halo_mass_function import \ HaloMassFcn, \ TransferFunction, \ diff -Nru yt-3.3.3/yt/analysis_modules/halo_mass_function/halo_mass_function.py yt-3.4.0/yt/analysis_modules/halo_mass_function/halo_mass_function.py --- yt-3.3.3/yt/analysis_modules/halo_mass_function/halo_mass_function.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/halo_mass_function/halo_mass_function.py 2017-08-10 18:02:57.000000000 +0000 @@ -327,22 +327,22 @@ def sigmaM(self): """ - Written by BWO, 2006 (updated 25 January 2007). - Converted to Python by Stephen Skory December 2009. + Written by BWO, 2006 (updated 25 January 2007). + Converted to Python by Stephen Skory December 2009. - This routine takes in cosmological parameters and creates a file (array) with - sigma(M) in it, which is necessary for various press-schechter type - stuff. In principle one can calculate it ahead of time, but it's far, - far faster in the long run to calculate your sigma(M) ahead of time. - - Inputs: cosmology, user must set parameters - - Outputs: four columns of data containing the following information: - - 1) mass (Msolar/h) - 2) sigma (normalized) using Msun/h as the input - - The arrays output are used later. + This routine takes in cosmological parameters and creates a file (array) with + sigma(M) in it, which is necessary for various press-schechter type + stuff. In principle one can calculate it ahead of time, but it's far, + far faster in the long run to calculate your sigma(M) ahead of time. + + Inputs: cosmology, user must set parameters + + Outputs: four columns of data containing the following information: + + 1) mass (Msolar/h) + 2) sigma (normalized) using Msun/h as the input + + The arrays output are used later. """ # Set up the transfer function object. @@ -446,13 +446,12 @@ def sigma_squared_of_R(self, R): """ - /* calculates sigma^2(R). This is the routine where the magic happens (or - whatever it is that we do here). Integrates the sigma_squared_integrand - parameter from R to infinity. Calls GSL (gnu scientific library) to do - the actual integration. + calculates sigma^2(R). This is the routine where the magic happens (or + whatever it is that we do here). Integrates the sigma_squared_integrand + parameter from R to infinity. Calls GSL (gnu scientific library) to do + the actual integration. - Note that R is in h^-1 Mpc (comoving) - */ + Note that R is in h^-1 Mpc (comoving) """ self.R = R result = integrate_inf(self.sigma_squared_integrand) @@ -463,7 +462,7 @@ def sigma_squared_integrand(self, k): """ - /* integrand for integral to get sigma^2(R). */ + integrand for integral to get sigma^2(R). """ Rcom = self.R; # this is R in comoving Mpc/h @@ -474,7 +473,7 @@ def PofK(self, k): """ - /* returns power spectrum as a function of wavenumber k */ + returns power spectrum as a function of wavenumber k """ thisPofK = np.power(k, self.primordial_index) * np.power( self.TofK(k), 2.0); @@ -483,7 +482,7 @@ def TofK(self, k): """ - /* returns transfer function as a function of wavenumber k. */ + returns transfer function as a function of wavenumber k. """ thisTofK = self.TF.TFmdm_onek_hmpc(k); @@ -503,9 +502,9 @@ def multiplicityfunction(self, sigma): """ - /* Multiplicity function - this is where the various fitting functions/analytic + Multiplicity function - this is where the various fitting functions/analytic theories are different. The various places where I found these fitting functions - are listed below. */ + are listed below. """ nu = self.delta_c0 / sigma; @@ -552,7 +551,7 @@ def sigmaof_M_z(self, sigmabin, redshift): """ - /* sigma(M, z) */ + sigma(M, z) """ thissigma = self.Dofz(redshift) * self.sigmaarray[sigmabin]; @@ -561,7 +560,7 @@ def Dofz(self, redshift): """ - /* Growth function */ + Growth function """ thisDofz = self.gofz(redshift) / self.gofz(0.0) / (1.0+redshift); @@ -571,7 +570,7 @@ def gofz(self, redshift): """ - /* g(z) - I don't think this has any other name*/ + g(z) - I don't think this has any other name """ thisgofz = 2.5 * self.omega_matter_of_z(redshift) / \ @@ -585,7 +584,7 @@ def omega_matter_of_z(self,redshift): """ - /* Omega matter as a function of redshift */ + Omega matter as a function of redshift """ thisomofz = self.omega_matter0 * math.pow( 1.0+redshift, 3.0) / \ @@ -595,7 +594,7 @@ def omega_lambda_of_z(self,redshift): """ - /* Omega lambda as a function of redshift */ + Omega lambda as a function of redshift """ thisolofz = self.omega_lambda0 / math.pow( self.Eofz(redshift), 2.0 ) @@ -604,7 +603,7 @@ def Eofz(self, redshift): """ - /* E(z) - I don't think this has any other name */ + E(z) - I don't think this has any other name """ thiseofz = math.sqrt( self.omega_lambda0 \ + (1.0 - self.omega_lambda0 - self.omega_matter0)*math.pow( 1.0+redshift, 2.0) \ @@ -614,15 +613,15 @@ """ -/* Fitting Formulae for CDM + Baryon + Massive Neutrino (MDM) cosmologies. */ -/* Daniel J. Eisenstein & Wayne Hu, Institute for Advanced Study */ +Fitting Formulae for CDM + Baryon + Massive Neutrino (MDM) cosmologies. +Daniel J. Eisenstein & Wayne Hu, Institute for Advanced Study -/* There are two primary routines here, one to set the cosmology, the +There are two primary routines here, one to set the cosmology, the other to construct the transfer function for a single wavenumber k. You should call the former once (per cosmology) and the latter as -many times as you want. */ +many times as you want. -/* TFmdm_set_cosm() -- User passes all the cosmological parameters as + TFmdm_set_cosm() -- User passes all the cosmological parameters as arguments; the routine sets up all of the scalar quantites needed computation of the fitting formula. The input parameters are: 1) omega_matter -- Density of CDM, baryons, and massive neutrinos, @@ -634,7 +633,7 @@ 6) hubble -- Hubble constant, in units of 100 km/s/Mpc 7) redshift -- The redshift at which to evaluate */ -/* TFmdm_onek_mpc() -- User passes a single wavenumber, in units of Mpc^-1. + TFmdm_onek_mpc() -- User passes a single wavenumber, in units of Mpc^-1. Routine returns the transfer function from the Eisenstein & Hu fitting formula, based on the cosmology currently held in the internal variables. The routine returns T_cb (the CDM+Baryon @@ -642,29 +641,40 @@ Baryon+Neutrino density-weighted transfer function) is stored in the global variable tf_cbnu. */ -/* We also supply TFmdm_onek_hmpc(), which is identical to the previous - routine, but takes the wavenumber in units of h Mpc^-1. */ +We also supply TFmdm_onek_hmpc(), which is identical to the previous +routine, but takes the wavenumber in units of h Mpc^-1. -/* We hold the internal scalar quantities in global variables, so that -the user may access them in an external program, via "extern" declarations. */ +We hold the internal scalar quantities in global variables, so that +the user may access them in an external program, via "extern" declarations. -/* Please note that all internal length scales are in Mpc, not h^-1 Mpc! */ +Please note that all internal length scales are in Mpc, not h^-1 Mpc! """ class TransferFunction(object): """ - /* This routine takes cosmological parameters and a redshift and sets up - all the internal scalar quantities needed to compute the transfer function. */ - /* INPUT: omega_matter -- Density of CDM, baryons, and massive neutrinos, - in units of the critical density. */ - /* omega_baryon -- Density of baryons, in units of critical. */ - /* omega_hdm -- Density of massive neutrinos, in units of critical */ - /* degen_hdm -- (Int) Number of degenerate massive neutrino species */ - /* omega_lambda -- Cosmological constant */ - /* hubble -- Hubble constant, in units of 100 km/s/Mpc */ - /* redshift -- The redshift at which to evaluate */ - /* OUTPUT: Returns 0 if all is well, 1 if a warning was issued. Otherwise, - sets many global variables for use in TFmdm_onek_mpc() */ + This routine takes cosmological parameters and a redshift and sets up + all the internal scalar quantities needed to compute the transfer function. + + Parameters + ---------- + omega_matter : float + Density of CDM, baryons, and massive neutrinos, in units + of the critical density. + omega_baryon : float + Density of baryons, in units of critical. + omega_hdm : float + Density of massive neutrinos, in units of critical + degen_hdm : integer + Number of degenerate massive neutrino species + omega_lambda : float + Cosmological constant + hubble : float + Hubble constant, in units of 100 km/s/Mpc + redshift : float + The redshift at which to evaluate + + Returns 0 if all is well, 1 if a warning was issued. Otherwise, + sets many global variables for use in TFmdm_onek_mpc() """ def __init__(self, omega_matter, omega_baryon, omega_hdm, degen_hdm, omega_lambda, hubble, redshift): @@ -751,15 +761,23 @@ def TFmdm_onek_mpc(self, kk): """ - /* Given a wavenumber in Mpc^-1, return the transfer function for the - cosmology held in the global variables. */ - /* Input: kk -- Wavenumber in Mpc^-1 */ - /* Output: The following are set as global variables: - growth_cb -- the transfer function for density-weighted - CDM + Baryon perturbations. - growth_cbnu -- the transfer function for density-weighted - CDM + Baryon + Massive Neutrino perturbations. */ - /* The function returns growth_cb */ + Given a wavenumber in Mpc^-1, return the transfer function for the + cosmology held in the global variables. + + Parameters + ---------- + kk : float + Wavenumber in Mpc^-1 + + Returns + ------- + growth_cb : float + the transfer function for density-weighted + CDM + Baryon perturbations. (returned and set as a global var) + growth_cbnu : float + the transfer function for density-weighted + CDM + Baryon + Massive Neutrino perturbations. + (set as a global var) """ self.qq = kk/self.omhh*SQR(self.theta_cmb); @@ -794,15 +812,22 @@ def TFmdm_onek_hmpc(self, kk): """ - /* Given a wavenumber in h Mpc^-1, return the transfer function for the - cosmology held in the global variables. */ - /* Input: kk -- Wavenumber in h Mpc^-1 */ - /* Output: The following are set as global variables: - growth_cb -- the transfer function for density-weighted - CDM + Baryon perturbations. - growth_cbnu -- the transfer function for density-weighted - CDM + Baryon + Massive Neutrino perturbations. */ - /* The function returns growth_cb */ + Given a wavenumber in h Mpc^-1, return the transfer function for the + cosmology held in the global variables. + + Parameters + ---------- + kk : float + Wavenumber in h Mpc^-1 + + Returns + ------- + growth_cb : float + the transfer function for density-weighted + CDM + Baryon perturbations. (return and set as a global var) + growth_cbnu : float + the transfer function for density-weighted + CDM + Baryon + Massive Neutrino perturbations. """ return self.TFmdm_onek_mpc(kk*self.hhubble); diff -Nru yt-3.3.3/yt/analysis_modules/level_sets/clump_handling.py yt-3.4.0/yt/analysis_modules/level_sets/clump_handling.py --- yt-3.3.3/yt/analysis_modules/level_sets/clump_handling.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/level_sets/clump_handling.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,14 +13,22 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -import copy import numpy as np import uuid from yt.fields.derived_field import \ ValidateSpatial -from yt.funcs import mylog, iterable -from yt.extern.six import string_types +from yt.frontends.ytdata.utilities import \ + save_as_dataset +from yt.funcs import \ + deprecate, \ + get_output_filename, \ + iterable, \ + mylog +from yt.extern.six import \ + string_types +from yt.utilities.tree_container import \ + TreeContainer from .clump_info_items import \ clump_info_registry @@ -44,30 +52,43 @@ validators=[ValidateSpatial(0)], take_log=False, display_field=False, + sampling_type='cell', units='') -class Clump(object): +class Clump(TreeContainer): children = None def __init__(self, data, field, parent=None, - clump_info=None, validators=None): + clump_info=None, validators=None, + base=None, contour_key=None, + contour_id=None): self.data = data self.field = field self.parent = parent self.quantities = data.quantities self.min_val = self.data[field].min() self.max_val = self.data[field].max() + self.info = {} + + # is this the parent clump? + if base is None: + base = self + self.total_clumps = 0 + if clump_info is None: + self.set_default_clump_info() + else: + self.clump_info = clump_info + + self.base = base + self.clump_id = self.base.total_clumps + self.base.total_clumps += 1 + self.contour_key = contour_key + self.contour_id = contour_id if parent is not None: self.data.parent = self.parent.data - # List containing characteristics about clumps that are to be written - # out by the write routines. - if clump_info is None: - self.set_default_clump_info() - else: - # Clump info will act the same if add_info_item is called - # before or after clump finding. - self.clump_info = copy.deepcopy(clump_info) + if parent is not None: + self.data.parent = self.parent.data if validators is None: validators = [] @@ -85,7 +106,7 @@ if self.children is None: return for child in self.children: child.add_validator(validator) - + def add_info_item(self, info_item, *args, **kwargs): "Adds an entry to clump_info list and tells children to do the same." @@ -125,10 +146,11 @@ for child in self.children: child.clear_clump_info() + @deprecate("Clump.save_as_dataset") def write_info(self, level, f_ptr): "Writes information for clump using the list of items in clump_info." - for item in self.clump_info: + for item in self.base.clump_info: value = item(self) f_ptr.write("%s%s\n" % ('\t'*level, value)) @@ -159,8 +181,190 @@ # Using "ones" here will speed things up. continue self.children.append(Clump(new_clump, self.field, parent=self, - clump_info=self.clump_info, - validators=self.validators)) + validators=self.validators, + base=self.base, + contour_key=contour_key, + contour_id=cid)) + + def __iter__(self): + yield self + if self.children is None: + return + for child in self.children: + for a_node in child: + yield a_node + + def save_as_dataset(self, filename=None, fields=None): + r"""Export clump tree to a reloadable yt dataset. + + This function will take a clump object and output a dataset + containing the fields given in the ``fields`` list and all info + items. The resulting dataset can be reloaded as a yt dataset. + + Parameters + ---------- + filename : str, optional + The name of the file to be written. If None, the name + will be a combination of the original dataset and the clump + index. + fields : list of strings or tuples, optional + If this is supplied, it is the list of fields to be saved to + disk. + + Returns + ------- + filename : str + The name of the file that has been created. + + Examples + -------- + + >>> import yt + >>> from yt.analysis_modules.level_sets.api import \ + ... Clump, find_clumps + >>> ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") + >>> data_source = ds.disk([0.5, 0.5, 0.5], [0., 0., 1.], + ... (8, 'kpc'), (1, 'kpc')) + >>> field = ("gas", "density") + >>> step = 2.0 + >>> c_min = 10**np.floor(np.log10(data_source[field]).min() ) + >>> c_max = 10**np.floor(np.log10(data_source[field]).max()+1) + >>> master_clump = Clump(data_source, field) + >>> master_clump.add_info_item("center_of_mass") + >>> master_clump.add_validator("min_cells", 20) + >>> find_clumps(master_clump, c_min, c_max, step) + >>> fn = master_clump.save_as_dataset(fields=["density", "particle_mass"]) + >>> new_ds = yt.load(fn) + >>> print (ds.tree["clump", "cell_mass"]) + 1296926163.91 Msun + >>> print ds.tree["grid", "density"] + [ 2.54398434e-26 2.46620353e-26 2.25120154e-26 ..., 1.12879234e-25 + 1.59561490e-25 1.09824903e-24] g/cm**3 + >>> print ds.tree["all", "particle_mass"] + [ 4.25472446e+38 4.25472446e+38 4.25472446e+38 ..., 2.04238266e+38 + 2.04523901e+38 2.04770938e+38] g + >>> print ds.tree.children[0]["clump", "cell_mass"] + 909636495.312 Msun + >>> print ds.leaves[0]["clump", "cell_mass"] + 3756566.99809 Msun + >>> print ds.leaves[0]["grid", "density"] + [ 6.97820274e-24 6.58117370e-24 7.32046082e-24 6.76202430e-24 + 7.41184837e-24 6.76981480e-24 6.94287213e-24 6.56149658e-24 + 6.76584569e-24 6.94073710e-24 7.06713082e-24 7.22556526e-24 + 7.08338898e-24 6.78684331e-24 7.40647040e-24 7.03050456e-24 + 7.12438678e-24 6.56310217e-24 7.23201662e-24 7.17314333e-24] g/cm**3 + + """ + + ds = self.data.ds + keyword = "%s_clump_%d" % (str(ds), self.clump_id) + filename = get_output_filename(filename, keyword, ".h5") + + # collect clump info fields + clump_info = dict([(ci.name, []) for ci in self.base.clump_info]) + clump_info.update( + dict([(field, []) for field in ["clump_id", "parent_id", + "contour_key", "contour_id"]])) + for clump in self: + clump_info["clump_id"].append(clump.clump_id) + if clump.parent is None: + parent_id = -1 + else: + parent_id = clump.parent.clump_id + clump_info["parent_id"].append(parent_id) + + contour_key = clump.contour_key + if contour_key is None: contour_key = -1 + clump_info["contour_key"].append(contour_key) + contour_id = clump.contour_id + if contour_id is None: contour_id = -1 + clump_info["contour_id"].append(contour_id) + + for ci in self.base.clump_info: + ci(clump) + clump_info[ci.name].append(clump.info[ci.name][1]) + for ci in clump_info: + if hasattr(clump_info[ci][0], "units"): + clump_info[ci] = ds.arr(clump_info[ci]) + else: + clump_info[ci] = np.array(clump_info[ci]) + + ftypes = dict([(ci, "clump") for ci in clump_info]) + + # collect data fields + if fields is not None: + contour_fields = \ + [("index", "contours_%s" % ckey) + for ckey in np.unique(clump_info["contour_key"]) \ + if str(ckey) != "-1"] + + ptypes = [] + field_data = {} + need_grid_positions = False + for f in self.base.data._determine_fields(fields) + contour_fields: + field_data[f] = self.base[f] + if ds.field_info[f].particle_type: + if f[0] not in ptypes: + ptypes.append(f[0]) + ftypes[f] = f[0] + else: + need_grid_positions = True + ftypes[f] = "grid" + + if len(ptypes) > 0: + for ax in "xyz": + for ptype in ptypes: + p_field = (ptype, "particle_position_%s" % ax) + if p_field in ds.field_info and \ + p_field not in field_data: + ftypes[p_field] = p_field[0] + field_data[p_field] = self.base[p_field] + + for clump in self: + if clump.contour_key is None: + continue + for ptype in ptypes: + cfield = (ptype, "contours_%s" % clump.contour_key) + if cfield not in field_data: + field_data[cfield] = \ + clump.data._part_ind(ptype).astype(np.int64) + ftypes[cfield] = ptype + field_data[cfield][clump.data._part_ind(ptype)] = \ + clump.contour_id + + if need_grid_positions: + for ax in "xyz": + g_field = ("index", ax) + if g_field in ds.field_info and \ + g_field not in field_data: + field_data[g_field] = self.base[g_field] + ftypes[g_field] = "grid" + g_field = ("index", "d" + ax) + if g_field in ds.field_info and \ + g_field not in field_data: + ftypes[g_field] = "grid" + field_data[g_field] = self.base[g_field] + + if self.contour_key is not None: + cfilters = {} + for field in field_data: + if ftypes[field] == "grid": + ftype = "index" + else: + ftype = field[0] + cfield = (ftype, "contours_%s" % self.contour_key) + if cfield not in cfilters: + cfilters[cfield] = field_data[cfield] == self.contour_id + field_data[field] = field_data[field][cfilters[cfield]] + + clump_info.update(field_data) + extra_attrs = {"data_type": "yt_clump_tree", + "container_type": "yt_clump_tree"} + save_as_dataset(ds, filename, clump_info, + field_types=ftypes, + extra_attrs=extra_attrs) + + return filename def pass_down(self,operation): """ @@ -270,6 +474,7 @@ return clump_list +@deprecate("Clump.save_as_dataset") def write_clump_index(clump, level, fh): top = False if isinstance(fh, string_types): @@ -287,6 +492,7 @@ if top: fh.close() +@deprecate("Clump.save_as_dataset") def write_clumps(clump, level, fh): top = False if isinstance(fh, string_types): diff -Nru yt-3.3.3/yt/analysis_modules/level_sets/clump_info_items.py yt-3.4.0/yt/analysis_modules/level_sets/clump_info_items.py --- yt-3.3.3/yt/analysis_modules/level_sets/clump_info_items.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/level_sets/clump_info_items.py 2017-08-10 18:02:57.000000000 +0000 @@ -21,14 +21,15 @@ clump_info_registry = OperatorRegistry() def add_clump_info(name, function): - clump_info_registry[name] = ClumpInfoCallback(function) + clump_info_registry[name] = ClumpInfoCallback(name, function) class ClumpInfoCallback(object): r""" A ClumpInfoCallback is a function that takes a clump, computes a quantity, and returns a string to be printed out for writing clump info. """ - def __init__(self, function, args=None, kwargs=None): + def __init__(self, name, function, args=None, kwargs=None): + self.name = name self.function = function self.args = args if self.args is None: self.args = [] @@ -36,43 +37,51 @@ if self.kwargs is None: self.kwargs = {} def __call__(self, clump): - return self.function(clump, *self.args, **self.kwargs) - + if self.name not in clump.info: + clump.info[self.name] = self.function(clump, *self.args, **self.kwargs) + rv = clump.info[self.name] + return rv[0] % rv[1] + +def _center_of_mass(clump, units="code_length", **kwargs): + p = clump.quantities.center_of_mass(**kwargs) + return "Center of mass: %s.", p.to(units) +add_clump_info("center_of_mass", _center_of_mass) + def _total_cells(clump): n_cells = clump.data["index", "ones"].size - return "Cells: %d." % n_cells + return "Cells: %d.", n_cells add_clump_info("total_cells", _total_cells) def _cell_mass(clump): cell_mass = clump.data["gas", "cell_mass"].sum().in_units("Msun") - return "Mass: %e Msun." % cell_mass + return "Mass: %e Msun.", cell_mass add_clump_info("cell_mass", _cell_mass) def _mass_weighted_jeans_mass(clump): jeans_mass = clump.data.quantities.weighted_average_quantity( "jeans_mass", ("gas", "cell_mass")).in_units("Msun") - return "Jeans Mass (mass-weighted): %.6e Msolar." % jeans_mass + return "Jeans Mass (mass-weighted): %.6e Msolar.", jeans_mass add_clump_info("mass_weighted_jeans_mass", _mass_weighted_jeans_mass) def _volume_weighted_jeans_mass(clump): jeans_mass = clump.data.quantities.weighted_average_quantity( "jeans_mass", ("index", "cell_volume")).in_units("Msun") - return "Jeans Mass (volume-weighted): %.6e Msolar." % jeans_mass + return "Jeans Mass (volume-weighted): %.6e Msolar.", jeans_mass add_clump_info("volume_weighted_jeans_mass", _volume_weighted_jeans_mass) def _max_grid_level(clump): max_level = clump.data["index", "grid_level"].max() - return "Max grid level: %d." % max_level + return "Max grid level: %d.", max_level add_clump_info("max_grid_level", _max_grid_level) def _min_number_density(clump): min_n = clump.data["gas", "number_density"].min().in_units("cm**-3") - return "Min number density: %.6e cm^-3." % min_n + return "Min number density: %.6e cm^-3.", min_n add_clump_info("min_number_density", _min_number_density) def _max_number_density(clump): max_n = clump.data["gas", "number_density"].max().in_units("cm**-3") - return "Max number density: %.6e cm^-3." % max_n + return "Max number density: %.6e cm^-3.", max_n add_clump_info("max_number_density", _max_number_density) def _distance_to_main_clump(clump, units="pc"): @@ -82,6 +91,7 @@ master_com = clump.data.ds.arr(master.data.quantities.center_of_mass()) my_com = clump.data.ds.arr(clump.data.quantities.center_of_mass()) distance = np.sqrt(((master_com - my_com)**2).sum()) - return "Distance from master center of mass: %.6e %s." % \ - (distance.in_units(units), units) + distance.convert_to_units("pc") + return "Distance from master center of mass: %%.6e %s." % units, \ + distance.in_units(units) add_clump_info("distance_to_main_clump", _distance_to_main_clump) diff -Nru yt-3.3.3/yt/analysis_modules/level_sets/clump_validators.py yt-3.4.0/yt/analysis_modules/level_sets/clump_validators.py --- yt-3.3.3/yt/analysis_modules/level_sets/clump_validators.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/level_sets/clump_validators.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,6 +13,8 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +import numpy as np + from yt.utilities.lib.misc_utilities import \ gravitational_binding_energy from yt.utilities.operator_registry import \ @@ -64,28 +66,30 @@ (bulk_velocity[1] - clump["all", "particle_velocity_y"])**2 + (bulk_velocity[2] - clump["all", "particle_velocity_z"])**2)).sum() + if use_particles: + m = np.concatenate([clump["gas", "cell_mass"].in_cgs(), + clump["all", "particle_mass"].in_cgs()]) + px = np.concatenate([clump["index", "x"].in_cgs(), + clump["all", "particle_position_x"].in_cgs()]) + py = np.concatenate([clump["index", "y"].in_cgs(), + clump["all", "particle_position_y"].in_cgs()]) + pz = np.concatenate([clump["index", "z"].in_cgs(), + clump["all", "particle_position_z"].in_cgs()]) + else: + m = clump["gas", "cell_mass"].in_cgs() + px = clump["index", "x"].in_cgs() + py = clump["index", "y"].in_cgs() + pz = clump["index", "z"].in_cgs() + potential = clump.data.ds.quan(G * gravitational_binding_energy( - clump["gas", "cell_mass"].in_cgs(), - clump["index", "x"].in_cgs(), - clump["index", "y"].in_cgs(), - clump["index", "z"].in_cgs(), + m, px, py, pz, truncate, (kinetic / G).in_cgs()), - kinetic.in_cgs().units) - + kinetic.in_cgs().units) + if truncate and potential >= kinetic: return True - if use_particles: - potential += clump.data.ds.quan(G * - gravitational_binding_energy( - clump["all", "particle_mass"].in_cgs(), - clump["all", "particle_position_x"].in_cgs(), - clump["all", "particle_position_y"].in_cgs(), - clump["all", "particle_position_z"].in_cgs(), - truncate, ((kinetic - potential) / G).in_cgs()), - kinetic.in_cgs().units) - return potential >= kinetic add_validator("gravitationally_bound", _gravitationally_bound) diff -Nru yt-3.3.3/yt/analysis_modules/level_sets/tests/test_clump_finding.py yt-3.4.0/yt/analysis_modules/level_sets/tests/test_clump_finding.py --- yt-3.3.3/yt/analysis_modules/level_sets/tests/test_clump_finding.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/level_sets/tests/test_clump_finding.py 2017-08-10 18:02:57.000000000 +0000 @@ -15,16 +15,25 @@ #----------------------------------------------------------------------------- import numpy as np +import os +import shutil +import tempfile + from yt.analysis_modules.level_sets.api import \ Clump, \ find_clumps, \ get_lowest_clumps +from yt.convenience import \ + load from yt.frontends.stream.api import \ load_uniform_grid from yt.testing import \ assert_array_equal, \ - assert_equal + assert_equal, \ + requires_file +from yt.utilities.answer_testing.framework import \ + data_dir_load def test_clump_finding(): n_c = 8 @@ -63,7 +72,6 @@ # two leaf clumps assert_equal(len(leaf_clumps), 2) - # check some clump fields assert_equal(master_clump.children[0]["density"][0].size, 1) assert_equal(master_clump.children[0]["density"][0], ad["density"].max()) @@ -72,3 +80,58 @@ assert_equal(master_clump.children[1]["density"][0].size, 1) assert_equal(master_clump.children[1]["density"][0], ad["density"].max()) assert_equal(master_clump.children[1]["particle_mass"].size, 0) + +i30 = "IsolatedGalaxy/galaxy0030/galaxy0030" +@requires_file(i30) +def test_clump_tree_save(): + tmpdir = tempfile.mkdtemp() + curdir = os.getcwd() + os.chdir(tmpdir) + + ds = data_dir_load(i30) + data_source = ds.disk([0.5, 0.5, 0.5], [0., 0., 1.], + (8, 'kpc'), (1, 'kpc')) + + field = ("gas", "density") + step = 2.0 + c_min = 10**np.floor(np.log10(data_source[field]).min() ) + c_max = 10**np.floor(np.log10(data_source[field]).max()+1) + + master_clump = Clump(data_source, field) + master_clump.add_info_item("center_of_mass") + master_clump.add_validator("min_cells", 20) + + find_clumps(master_clump, c_min, c_max, step) + leaf_clumps = get_lowest_clumps(master_clump) + + fn = master_clump.save_as_dataset(fields=["density", "particle_mass"]) + ds2 = load(fn) + + # compare clumps in the tree + t1 = [c for c in master_clump] + t2 = [c for c in ds2.tree] + mt1 = ds.arr([c.info["cell_mass"][1] for c in t1]) + mt2 = ds2.arr([c["clump", "cell_mass"] for c in t2]) + it1 = np.argsort(mt1).d.astype(int) + it2 = np.argsort(mt2).d.astype(int) + assert_array_equal(mt1[it1], mt2[it2]) + + for i1, i2 in zip(it1, it2): + ct1 = t1[i1] + ct2 = t2[i2] + assert_array_equal(ct1["gas", "density"], + ct2["grid", "density"]) + assert_array_equal(ct1["all", "particle_mass"], + ct2["all", "particle_mass"]) + + # compare leaf clumps + c1 = [c for c in leaf_clumps] + c2 = [c for c in ds2.leaves] + mc1 = ds.arr([c.info["cell_mass"][1] for c in c1]) + mc2 = ds2.arr([c["clump", "cell_mass"] for c in c2]) + ic1 = np.argsort(mc1).d.astype(int) + ic2 = np.argsort(mc2).d.astype(int) + assert_array_equal(mc1[ic1], mc2[ic2]) + + os.chdir(curdir) + shutil.rmtree(tmpdir) diff -Nru yt-3.3.3/yt/analysis_modules/particle_trajectories/api.py yt-3.4.0/yt/analysis_modules/particle_trajectories/api.py --- yt-3.3.3/yt/analysis_modules/particle_trajectories/api.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/particle_trajectories/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,13 +1,6 @@ -""" -API for particle_trajectories -""" -from __future__ import absolute_import -#----------------------------------------------------------------------------- -# Copyright (c) 2013, yt Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- +from yt.funcs import issue_deprecation_warning -from .particle_trajectories import ParticleTrajectories +issue_deprecation_warning("Particle trajectories are now available from DatasetSeries " + "objects as ts.particle_trajectories. The ParticleTrajectories " + "analysis module is deprecated.") +from yt.data_objects.particle_trajectories import ParticleTrajectories \ No newline at end of file diff -Nru yt-3.3.3/yt/analysis_modules/particle_trajectories/particle_trajectories.py yt-3.4.0/yt/analysis_modules/particle_trajectories/particle_trajectories.py --- yt-3.3.3/yt/analysis_modules/particle_trajectories/particle_trajectories.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/particle_trajectories/particle_trajectories.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,384 +0,0 @@ -""" -Particle trajectories -""" -from __future__ import print_function - -#----------------------------------------------------------------------------- -# Copyright (c) 2013, yt Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- - -from yt.data_objects.data_containers import YTFieldData -from yt.data_objects.time_series import DatasetSeries -from yt.utilities.lib.particle_mesh_operations import CICSample_3 -from yt.utilities.parallel_tools.parallel_analysis_interface import \ - parallel_root_only -from yt.funcs import mylog, get_pbar -from yt.units.yt_array import array_like_field -from yt.config import ytcfg -from collections import OrderedDict - -import numpy as np -from yt.utilities.on_demand_imports import _h5py as h5py - -class ParticleTrajectories(object): - r"""A collection of particle trajectories in time over a series of - datasets. - - The ParticleTrajectories object contains a collection of - particle trajectories for a specified set of particle indices. - - Parameters - ---------- - outputs : `yt.data_objects.time_series.DatasetSeries` or list of strings - DatasetSeries object, or a time-sorted list of filenames to - construct a new DatasetSeries object. - indices : array_like - An integer array of particle indices whose trajectories we - want to track. If they are not sorted they will be sorted. - fields : list of strings, optional - A set of fields that is retrieved when the trajectory - collection is instantiated. - Default : None (will default to the fields 'particle_position_x', - 'particle_position_y', 'particle_position_z') - suppress_logging : boolean - Suppress yt's logging when iterating over the simulation time - series. - Default : False - - Examples - ________ - >>> from yt.mods import * - >>> my_fns = glob.glob("orbit_hdf5_chk_00[0-9][0-9]") - >>> my_fns.sort() - >>> fields = ["particle_position_x", "particle_position_y", - >>> "particle_position_z", "particle_velocity_x", - >>> "particle_velocity_y", "particle_velocity_z"] - >>> ds = load(my_fns[0]) - >>> init_sphere = ds.sphere(ds.domain_center, (.5, "unitary")) - >>> indices = init_sphere["particle_index"].astype("int") - >>> trajs = ParticleTrajectories(my_fns, indices, fields=fields) - >>> for t in trajs : - >>> print t["particle_velocity_x"].max(), t["particle_velocity_x"].min() - """ - def __init__(self, outputs, indices, fields=None, suppress_logging=False): - - indices.sort() # Just in case the caller wasn't careful - self.field_data = YTFieldData() - if isinstance(outputs, DatasetSeries): - self.data_series = outputs - else: - self.data_series = DatasetSeries(outputs) - self.masks = [] - self.sorts = [] - self.array_indices = [] - self.indices = indices - self.num_indices = len(indices) - self.num_steps = len(outputs) - self.times = [] - self.suppress_logging = suppress_logging - - if fields is None: fields = [] - fields = list(OrderedDict.fromkeys(fields)) - - if self.suppress_logging: - old_level = int(ytcfg.get("yt","loglevel")) - mylog.setLevel(40) - - fds = {} - ds_first = self.data_series[0] - dd_first = ds_first.all_data() - idx_field = dd_first._determine_fields("particle_index")[0] - for field in ("particle_position_%s" % ax for ax in "xyz"): - fds[field] = dd_first._determine_fields(field)[0] - - my_storage = {} - pbar = get_pbar("Constructing trajectory information", len(self.data_series)) - for i, (sto, ds) in enumerate(self.data_series.piter(storage=my_storage)): - dd = ds.all_data() - newtags = dd[idx_field].ndarray_view().astype("int64") - mask = np.in1d(newtags, indices, assume_unique=True) - sort = np.argsort(newtags[mask]) - array_indices = np.where(np.in1d(indices, newtags, assume_unique=True))[0] - self.array_indices.append(array_indices) - self.masks.append(mask) - self.sorts.append(sort) - - pfields = {} - for field in ("particle_position_%s" % ax for ax in "xyz"): - pfields[field] = dd[fds[field]].ndarray_view()[mask][sort] - - sto.result_id = ds.parameter_filename - sto.result = (ds.current_time, array_indices, pfields) - pbar.update(i) - pbar.finish() - - if self.suppress_logging: - mylog.setLevel(old_level) - - times = [] - for fn, (time, indices, pfields) in sorted(my_storage.items()): - times.append(time) - self.times = self.data_series[0].arr([time for time in times], times[0].units) - - self.particle_fields = [] - output_field = np.empty((self.num_indices, self.num_steps)) - output_field.fill(np.nan) - for field in ("particle_position_%s" % ax for ax in "xyz"): - for i, (fn, (time, indices, pfields)) in enumerate(sorted(my_storage.items())): - output_field[indices, i] = pfields[field] - self.field_data[field] = array_like_field( - dd_first, output_field.copy(), fds[field]) - self.particle_fields.append(field) - - # Instantiate fields the caller requested - self._get_data(fields) - - def has_key(self, key): - return (key in self.field_data) - - def keys(self): - return self.field_data.keys() - - def __getitem__(self, key): - """ - Get the field associated with key. - """ - if key == "particle_time": - return self.times - if key not in self.field_data: - self._get_data([key]) - return self.field_data[key] - - def __setitem__(self, key, val): - """ - Sets a field to be some other value. - """ - self.field_data[key] = val - - def __delitem__(self, key): - """ - Delete the field from the trajectory - """ - del self.field_data[key] - - def __iter__(self): - """ - This iterates over the trajectories for - the different particles, returning dicts - of fields for each trajectory - """ - for idx in range(self.num_indices): - traj = {} - traj["particle_index"] = self.indices[idx] - traj["particle_time"] = self.times - for field in self.field_data.keys(): - traj[field] = self[field][idx,:] - yield traj - - def __len__(self): - """ - The number of individual trajectories - """ - return self.num_indices - - def add_fields(self, fields): - """ - Add a list of fields to an existing trajectory - - Parameters - ---------- - fields : list of strings - A list of fields to be added to the current trajectory - collection. - - Examples - ________ - >>> from yt.mods import * - >>> trajs = ParticleTrajectories(my_fns, indices) - >>> trajs.add_fields(["particle_mass", "particle_gpot"]) - """ - self._get_data(fields) - - def _get_data(self, fields): - """ - Get a list of fields to include in the trajectory collection. - The trajectory collection itself is a dict of 2D numpy arrays, - with shape (num_indices, num_steps) - """ - - missing_fields = [field for field in fields - if field not in self.field_data] - if not missing_fields: - return - - if self.suppress_logging: - old_level = int(ytcfg.get("yt","loglevel")) - mylog.setLevel(40) - ds_first = self.data_series[0] - dd_first = ds_first.all_data() - - fds = {} - new_particle_fields = [] - for field in missing_fields: - fds[field] = dd_first._determine_fields(field)[0] - if field not in self.particle_fields: - if self.data_series[0]._get_field_info(*fds[field]).particle_type: - self.particle_fields.append(field) - new_particle_fields.append(field) - - - grid_fields = [field for field in missing_fields - if field not in self.particle_fields] - step = int(0) - pbar = get_pbar("Generating [%s] fields in trajectories." % - ", ".join(missing_fields), self.num_steps) - my_storage = {} - - for i, (sto, ds) in enumerate(self.data_series.piter(storage=my_storage)): - mask = self.masks[i] - sort = self.sorts[i] - pfield = {} - - if new_particle_fields: # there's at least one particle field - dd = ds.all_data() - for field in new_particle_fields: - # This is easy... just get the particle fields - pfield[field] = dd[fds[field]].ndarray_view()[mask][sort] - - if grid_fields: - # This is hard... must loop over grids - for field in grid_fields: - pfield[field] = np.zeros((self.num_indices)) - x = self["particle_position_x"][:,step].ndarray_view() - y = self["particle_position_y"][:,step].ndarray_view() - z = self["particle_position_z"][:,step].ndarray_view() - particle_grids, particle_grid_inds = ds.index._find_points(x,y,z) - - # This will fail for non-grid index objects - for grid in particle_grids: - cube = grid.retrieve_ghost_zones(1, grid_fields) - for field in grid_fields: - CICSample_3(x, y, z, pfield[field], - self.num_indices, - cube[fds[field]], - np.array(grid.LeftEdge).astype(np.float64), - np.array(grid.ActiveDimensions).astype(np.int32), - grid.dds[0]) - sto.result_id = ds.parameter_filename - sto.result = (self.array_indices[i], pfield) - pbar.update(step) - step += 1 - pbar.finish() - - output_field = np.empty((self.num_indices,self.num_steps)) - output_field.fill(np.nan) - for field in missing_fields: - fd = fds[field] - for i, (fn, (indices, pfield)) in enumerate(sorted(my_storage.items())): - output_field[indices, i] = pfield[field] - self.field_data[field] = array_like_field(dd_first, output_field.copy(), fd) - - if self.suppress_logging: - mylog.setLevel(old_level) - - def trajectory_from_index(self, index): - """ - Retrieve a single trajectory corresponding to a specific particle - index - - Parameters - ---------- - index : int - This defines which particle trajectory from the - ParticleTrajectories object will be returned. - - Returns - ------- - A dictionary corresponding to the particle's trajectory and the - fields along that trajectory - - Examples - -------- - >>> from yt.mods import * - >>> import matplotlib.pylab as pl - >>> trajs = ParticleTrajectories(my_fns, indices) - >>> traj = trajs.trajectory_from_index(indices[0]) - >>> pl.plot(traj["particle_time"], traj["particle_position_x"], "-x") - >>> pl.savefig("orbit") - """ - mask = np.in1d(self.indices, (index,), assume_unique=True) - if not np.any(mask): - print("The particle index %d is not in the list!" % (index)) - raise IndexError - fields = [field for field in sorted(self.field_data.keys())] - traj = {} - traj["particle_time"] = self.times - traj["particle_index"] = index - for field in fields: - traj[field] = self[field][mask,:][0] - return traj - - @parallel_root_only - def write_out(self, filename_base): - """ - Write out particle trajectories to tab-separated ASCII files (one - for each trajectory) with the field names in the file header. Each - file is named with a basename and the index number. - - Parameters - ---------- - filename_base : string - The prefix for the outputted ASCII files. - - Examples - -------- - >>> from yt.mods import * - >>> trajs = ParticleTrajectories(my_fns, indices) - >>> trajs.write_out("orbit_trajectory") - """ - fields = [field for field in sorted(self.field_data.keys())] - num_fields = len(fields) - first_str = "# particle_time\t" + "\t".join(fields)+"\n" - template_str = "%g\t"*num_fields+"%g\n" - for ix in range(self.num_indices): - outlines = [first_str] - for it in range(self.num_steps): - outlines.append(template_str % - tuple([self.times[it]]+[self[field][ix,it] for field in fields])) - fid = open(filename_base + "_%d.dat" % self.indices[ix], "w") - fid.writelines(outlines) - fid.close() - del fid - - @parallel_root_only - def write_out_h5(self, filename): - """ - Write out all the particle trajectories to a single HDF5 file - that contains the indices, the times, and the 2D array for each - field individually - - Parameters - ---------- - - filename : string - The output filename for the HDF5 file - - Examples - -------- - - >>> from yt.mods import * - >>> trajs = ParticleTrajectories(my_fns, indices) - >>> trajs.write_out_h5("orbit_trajectories") - """ - fid = h5py.File(filename, "w") - fields = [field for field in sorted(self.field_data.keys())] - fid.create_dataset("particle_indices", dtype=np.int64, - data=self.indices) - fid.create_dataset("particle_time", data=self.times) - for field in fields: - fid.create_dataset("%s" % field, data=self[field]) - fid.close() diff -Nru yt-3.3.3/yt/analysis_modules/photon_simulator/api.py yt-3.4.0/yt/analysis_modules/photon_simulator/api.py --- yt-3.3.3/yt/analysis_modules/photon_simulator/api.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/photon_simulator/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -10,6 +10,11 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +from yt.funcs import issue_deprecation_warning + +issue_deprecation_warning("The photon_simulator module is deprecated. Please use pyXSIM " + "(http://hea-www.cfa.harvard.edu/~jzuhone/pyxsim) instead.") + from .photon_models import \ PhotonModel, \ ThermalPhotonModel diff -Nru yt-3.3.3/yt/analysis_modules/photon_simulator/photon_models.py yt-3.4.0/yt/analysis_modules/photon_simulator/photon_models.py --- yt-3.3.3/yt/analysis_modules/photon_simulator/photon_models.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/photon_simulator/photon_models.py 2017-08-10 18:02:57.000000000 +0000 @@ -224,7 +224,7 @@ tot_spec *= norm_factor eidxs = self.prng.choice(nchan, size=cn, p=tot_spec) cell_e = emid[eidxs] - energies[ei:ei+cn] = cell_e + energies[int(ei):int(ei + cn)] = cell_e cell_counter += 1 pbar.update(cell_counter) ei += cn diff -Nru yt-3.3.3/yt/analysis_modules/photon_simulator/photon_simulator.py yt-3.4.0/yt/analysis_modules/photon_simulator/photon_simulator.py --- yt-3.3.3/yt/analysis_modules/photon_simulator/photon_simulator.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/photon_simulator/photon_simulator.py 2017-08-10 18:02:57.000000000 +0000 @@ -31,7 +31,7 @@ from yt.utilities.physical_constants import clight from yt.utilities.cosmology import Cosmology from yt.utilities.orientation import Orientation -from yt.utilities.fits_image import assert_same_wcs +from yt.visualization.fits_image import assert_same_wcs from yt.utilities.parallel_tools.parallel_analysis_interface import \ communication_system, parallel_root_only, get_mpi_type, \ parallel_capable @@ -678,9 +678,9 @@ x *= delta y *= delta z *= delta - x += self.photons["x"][obs_cells] - y += self.photons["y"][obs_cells] - z += self.photons["z"][obs_cells] + x += self.photons["x"][obs_cells].d + y += self.photons["y"][obs_cells].d + z += self.photons["z"][obs_cells].d xsky = x*x_hat[0] + y*x_hat[1] + z*x_hat[2] ysky = x*y_hat[0] + y*y_hat[1] + z*y_hat[2] diff -Nru yt-3.3.3/yt/analysis_modules/photon_simulator/tests/test_beta_model.py yt-3.4.0/yt/analysis_modules/photon_simulator/tests/test_beta_model.py --- yt-3.3.3/yt/analysis_modules/photon_simulator/tests/test_beta_model.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/photon_simulator/tests/test_beta_model.py 2017-08-10 18:02:57.000000000 +0000 @@ -10,9 +10,13 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -from yt.analysis_modules.photon_simulator.api import \ - XSpecThermalModel, XSpecAbsorbModel, \ - ThermalPhotonModel, PhotonList +import warnings + +with warnings.catch_warnings(): + warnings.simplefilter("ignore") + from yt.analysis_modules.photon_simulator.api import \ + XSpecThermalModel, XSpecAbsorbModel, \ + ThermalPhotonModel, PhotonList from yt.config import ytcfg from yt.testing import requires_file, requires_module import numpy as np diff -Nru yt-3.3.3/yt/analysis_modules/photon_simulator/utils.c yt-3.4.0/yt/analysis_modules/photon_simulator/utils.c --- yt-3.3.3/yt/analysis_modules/photon_simulator/utils.c 2016-12-12 01:41:19.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/photon_simulator/utils.c 2017-08-10 18:20:03.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -8,6 +8,10 @@ ], "include_dirs": [ "yt/utilities/lib" + ], + "name": "yt.analysis_modules.photon_simulator.utils", + "sources": [ + "yt/analysis_modules/photon_simulator/utils.pyx" ] }, "module_name": "yt.analysis_modules.photon_simulator.utils" @@ -21,7 +25,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -43,6 +47,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -195,16 +200,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -331,6 +340,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -385,6 +400,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -493,8 +537,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -507,8 +551,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -630,10 +677,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1064,7 +1113,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); @@ -1196,6 +1245,9 @@ /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1441,27 +1493,28 @@ static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_broaden_lines[] = "broaden_lines"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/analysis_modules/photon_simulator/utils.pyx"; 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"; static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_analysis_modules_photon_simul[] = "yt.analysis_modules.photon_simulator.utils"; +static const char __pyx_k_yt_analysis_modules_photon_simul[] = "yt/analysis_modules/photon_simulator/utils.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_analysis_modules_photon_simul_2[] = "yt.analysis_modules.photon_simulator.utils"; static PyObject *__pyx_n_s_E0; 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_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_amp; static PyObject *__pyx_n_s_broaden_lines; static PyObject *__pyx_n_s_cdf; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_ebins; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_import; @@ -1482,7 +1535,8 @@ static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; static PyObject *__pyx_n_s_vec; static PyObject *__pyx_n_s_x; -static PyObject *__pyx_n_s_yt_analysis_modules_photon_simul; +static PyObject *__pyx_kp_s_yt_analysis_modules_photon_simul; +static PyObject *__pyx_n_s_yt_analysis_modules_photon_simul_2; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_2yt_16analysis_modules_16photon_simulator_5utils_broaden_lines(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_E0, PyArrayObject *__pyx_v_sigma, PyArrayObject *__pyx_v_amp, PyArrayObject *__pyx_v_ebins); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ @@ -1526,9 +1580,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -1537,16 +1595,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_E0)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sigma)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("broaden_lines", 1, 4, 4, 1); __PYX_ERR(0, 11, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_amp)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("broaden_lines", 1, 4, 4, 2); __PYX_ERR(0, 11, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebins)) != 0)) kw_args--; else { @@ -4181,7 +4242,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -4229,7 +4290,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -4312,7 +4373,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -4360,7 +4421,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -4443,7 +4504,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -4488,7 +4549,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -4543,11 +4604,11 @@ {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_amp, __pyx_k_amp, sizeof(__pyx_k_amp), 0, 0, 1, 1}, {&__pyx_n_s_broaden_lines, __pyx_k_broaden_lines, sizeof(__pyx_k_broaden_lines), 0, 0, 1, 1}, {&__pyx_n_s_cdf, __pyx_k_cdf, sizeof(__pyx_k_cdf), 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_ebins, __pyx_k_ebins, sizeof(__pyx_k_ebins), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, @@ -4568,7 +4629,8 @@ {&__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_vec, __pyx_k_vec, sizeof(__pyx_k_vec), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, - {&__pyx_n_s_yt_analysis_modules_photon_simul, __pyx_k_yt_analysis_modules_photon_simul, sizeof(__pyx_k_yt_analysis_modules_photon_simul), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_analysis_modules_photon_simul, __pyx_k_yt_analysis_modules_photon_simul, sizeof(__pyx_k_yt_analysis_modules_photon_simul), 0, 0, 1, 0}, + {&__pyx_n_s_yt_analysis_modules_photon_simul_2, __pyx_k_yt_analysis_modules_photon_simul_2, sizeof(__pyx_k_yt_analysis_modules_photon_simul_2), 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} }; @@ -4693,7 +4755,7 @@ __pyx_tuple__10 = PyTuple_Pack(12, __pyx_n_s_E0, __pyx_n_s_sigma, __pyx_n_s_amp, __pyx_n_s_ebins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_x, __pyx_n_s_isigma, __pyx_n_s_cdf, __pyx_n_s_vec); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_broaden_lines, 11, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_analysis_modules_photon_simul, __pyx_n_s_broaden_lines, 11, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -4764,6 +4826,7 @@ __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 @@ -4829,7 +4892,7 @@ * np.ndarray[np.float64_t, ndim=1] sigma, * np.ndarray[np.float64_t, ndim=1] amp, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_16analysis_modules_16photon_simulator_5utils_1broaden_lines, NULL, __pyx_n_s_yt_analysis_modules_photon_simul); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_16analysis_modules_16photon_simulator_5utils_1broaden_lines, NULL, __pyx_n_s_yt_analysis_modules_photon_simul_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_broaden_lines, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4859,7 +4922,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.analysis_modules.photon_simulator.utils", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.analysis_modules.photon_simulator.utils", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -5649,17 +5712,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -5778,8 +5846,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON @@ -5839,11 +5907,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -5866,7 +5930,7 @@ #endif /* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -5879,13 +5943,13 @@ } /* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { + static void __Pyx_RaiseBufferFallbackError(void) { PyErr_SetString(PyExc_ValueError, "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); } /* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE + #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; @@ -5909,7 +5973,7 @@ #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -6072,25 +6136,25 @@ #endif /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -6114,7 +6178,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -6124,7 +6188,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -6185,7 +6249,7 @@ } /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -6258,8 +6322,42 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -6339,7 +6437,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -6398,12 +6496,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -6440,8 +6541,8 @@ #endif - /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + /* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -6472,7 +6573,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -6503,7 +6604,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -6525,7 +6626,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -6545,7 +6646,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -6680,7 +6781,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -6700,7 +6801,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -6835,7 +6936,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -6866,7 +6967,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -7055,7 +7156,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -7244,7 +7345,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -7260,7 +7361,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -7278,7 +7379,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -7343,7 +7444,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -7368,6 +7469,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -7376,11 +7479,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/analysis_modules/ppv_cube/ppv_cube.py yt-3.4.0/yt/analysis_modules/ppv_cube/ppv_cube.py --- yt-3.3.3/yt/analysis_modules/ppv_cube/ppv_cube.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/ppv_cube/ppv_cube.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,7 +13,7 @@ import numpy as np from yt.utilities.on_demand_imports import _astropy from yt.utilities.orientation import Orientation -from yt.utilities.fits_image import FITSImageData, sanitize_fits_unit +from yt.visualization.fits_image import FITSImageData, sanitize_fits_unit from yt.visualization.volume_rendering.off_axis_projection import off_axis_projection from yt.funcs import get_pbar from yt.utilities.physical_constants import clight, mh @@ -172,10 +172,12 @@ self.current_v = 0.0 _vlos = create_vlos(normal, self.no_shifting) - self.ds.add_field(("gas","v_los"), function=_vlos, units="cm/s") + self.ds.add_field(("gas","v_los"), function=_vlos, units="cm/s", + sampling_type='cell') _intensity = self._create_intensity() - self.ds.add_field(("gas","intensity"), function=_intensity, units=self.field_units) + self.ds.add_field(("gas","intensity"), function=_intensity, + units=self.field_units, sampling_type='cell') if method == "integrate" and weight_field is None: self.proj_units = str(ds.quan(1.0, self.field_units+"*cm").units) diff -Nru yt-3.3.3/yt/analysis_modules/ppv_cube/ppv_utils.c yt-3.4.0/yt/analysis_modules/ppv_cube/ppv_utils.c --- yt-3.3.3/yt/analysis_modules/ppv_cube/ppv_utils.c 2016-12-12 01:41:20.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/ppv_cube/ppv_utils.c 2017-08-10 18:20:03.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,6 +6,10 @@ "depends": [], "libraries": [ "m" + ], + "name": "yt.analysis_modules.ppv_cube.ppv_utils", + "sources": [ + "yt/analysis_modules/ppv_cube/ppv_utils.pyx" ] }, "module_name": "yt.analysis_modules.ppv_cube.ppv_utils" @@ -19,7 +23,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -41,6 +45,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -193,16 +198,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -329,6 +338,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -383,6 +398,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -491,8 +535,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -505,8 +549,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -628,10 +675,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1062,7 +1111,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); @@ -1197,6 +1246,9 @@ /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1449,8 +1501,8 @@ static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_thermal_broad[] = "thermal_broad"; static const char __pyx_k_compute_weight[] = "compute_weight"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/analysis_modules/ppv_cube/ppv_utils.pyx"; 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_yt_utilities_physical_constants[] = "yt.utilities.physical_constants"; @@ -1458,16 +1510,17 @@ static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_analysis_modules_ppv_cube_ppv[] = "yt.analysis_modules.ppv_cube.ppv_utils"; +static const char __pyx_k_yt_analysis_modules_ppv_cube_ppv[] = "yt/analysis_modules/ppv_cube/ppv_utils.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_analysis_modules_ppv_cube_ppv_2[] = "yt.analysis_modules.ppv_cube.ppv_utils"; 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_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_T; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_compute_weight; static PyObject *__pyx_n_s_dv; static PyObject *__pyx_n_s_i; @@ -1491,7 +1544,8 @@ static PyObject *__pyx_n_s_v2_th; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_x; -static PyObject *__pyx_n_s_yt_analysis_modules_ppv_cube_ppv; +static PyObject *__pyx_kp_s_yt_analysis_modules_ppv_cube_ppv; +static PyObject *__pyx_n_s_yt_analysis_modules_ppv_cube_ppv_2; static PyObject *__pyx_n_s_yt_utilities_physical_constants; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_2yt_16analysis_modules_8ppv_cube_9ppv_utils_compute_weight(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_uint8_t __pyx_v_thermal_broad, double __pyx_v_dv, double __pyx_v_m_part, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_T); /* proto */ @@ -1537,10 +1591,15 @@ 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; } @@ -1549,21 +1608,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thermal_broad)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dv)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("compute_weight", 1, 5, 5, 1); __PYX_ERR(0, 13, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m_part)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("compute_weight", 1, 5, 5, 2); __PYX_ERR(0, 13, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("compute_weight", 1, 5, 5, 3); __PYX_ERR(0, 13, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_T)) != 0)) kw_args--; else { @@ -4101,7 +4164,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -4149,7 +4212,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -4232,7 +4295,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -4280,7 +4343,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -4363,7 +4426,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -4408,7 +4471,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -4463,8 +4526,8 @@ {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 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_compute_weight, __pyx_k_compute_weight, sizeof(__pyx_k_compute_weight), 0, 0, 1, 1}, {&__pyx_n_s_dv, __pyx_k_dv, sizeof(__pyx_k_dv), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, @@ -4488,7 +4551,8 @@ {&__pyx_n_s_v2_th, __pyx_k_v2_th, sizeof(__pyx_k_v2_th), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, - {&__pyx_n_s_yt_analysis_modules_ppv_cube_ppv, __pyx_k_yt_analysis_modules_ppv_cube_ppv, sizeof(__pyx_k_yt_analysis_modules_ppv_cube_ppv), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_analysis_modules_ppv_cube_ppv, __pyx_k_yt_analysis_modules_ppv_cube_ppv, sizeof(__pyx_k_yt_analysis_modules_ppv_cube_ppv), 0, 0, 1, 0}, + {&__pyx_n_s_yt_analysis_modules_ppv_cube_ppv_2, __pyx_k_yt_analysis_modules_ppv_cube_ppv_2, sizeof(__pyx_k_yt_analysis_modules_ppv_cube_ppv_2), 0, 0, 1, 1}, {&__pyx_n_s_yt_utilities_physical_constants, __pyx_k_yt_utilities_physical_constants, sizeof(__pyx_k_yt_utilities_physical_constants), 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} @@ -4614,7 +4678,7 @@ __pyx_tuple__10 = PyTuple_Pack(10, __pyx_n_s_thermal_broad, __pyx_n_s_dv, __pyx_n_s_m_part, __pyx_n_s_v, __pyx_n_s_T, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_v2_th, __pyx_n_s_x, __pyx_n_s_w); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_compute_weight, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_analysis_modules_ppv_cube_ppv, __pyx_n_s_compute_weight, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -4687,6 +4751,7 @@ __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 @@ -4805,7 +4870,7 @@ * double dv, * double m_part, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_16analysis_modules_8ppv_cube_9ppv_utils_1compute_weight, NULL, __pyx_n_s_yt_analysis_modules_ppv_cube_ppv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_16analysis_modules_8ppv_cube_9ppv_utils_1compute_weight, NULL, __pyx_n_s_yt_analysis_modules_ppv_cube_ppv_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_compute_weight, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4836,7 +4901,7 @@ __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.analysis_modules.ppv_cube.ppv_utils", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.analysis_modules.ppv_cube.ppv_utils", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -5626,17 +5691,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -5755,8 +5825,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON @@ -5816,11 +5886,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -5843,7 +5909,7 @@ #endif /* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -5856,13 +5922,13 @@ } /* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { + static void __Pyx_RaiseBufferFallbackError(void) { PyErr_SetString(PyExc_ValueError, "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); } /* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE + #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; @@ -5886,7 +5952,7 @@ #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -6049,25 +6115,25 @@ #endif /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -6091,7 +6157,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -6101,7 +6167,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -6162,7 +6228,7 @@ } /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -6236,7 +6302,7 @@ } /* ImportFrom */ - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + 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, @@ -6249,8 +6315,42 @@ return value; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -6330,7 +6430,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -6389,12 +6489,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -6431,8 +6534,8 @@ #endif - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + /* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -6454,7 +6557,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -6485,7 +6588,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -6505,7 +6608,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -6640,7 +6743,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -6660,7 +6763,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -6795,7 +6898,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -6826,7 +6929,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { + static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -7015,7 +7118,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -7204,7 +7307,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -7235,7 +7338,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -7424,7 +7527,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -7440,7 +7543,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -7458,7 +7561,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -7523,7 +7626,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -7548,6 +7651,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -7556,11 +7661,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/analysis_modules/ppv_cube/tests/test_ppv.py yt-3.4.0/yt/analysis_modules/ppv_cube/tests/test_ppv.py --- yt-3.3.3/yt/analysis_modules/ppv_cube/tests/test_ppv.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/ppv_cube/tests/test_ppv.py 2017-08-10 18:02:57.000000000 +0000 @@ -26,7 +26,7 @@ np.random.seed(seed=0x4d3d3d3) - dims = (8,8,1024) + dims = (8, 8, 128) v_shift = 1.0e7*u.cm/u.s sigma_v = 2.0e7*u.cm/u.s T_0 = 1.0e8*u.Kelvin @@ -46,7 +46,7 @@ a = cube.data.mean(axis=(0,1)).v b = dv*np.exp(-((cube.vmid+v_shift)/v_th)**2)/(np.sqrt(np.pi)*v_th) - yield assert_allclose_units, a, b, 1.0e-2 + assert_allclose_units(a, b, 1.0e-2) E_0 = 6.8*u.keV @@ -58,4 +58,4 @@ c = dE*np.exp(-((cube.vmid-E_shift)/delta_E)**2)/(np.sqrt(np.pi)*delta_E) - yield assert_allclose_units, a, c, 1.0e-2 + assert_allclose_units(a, c, 1.0e-2) diff -Nru yt-3.3.3/yt/analysis_modules/spectral_integrator/api.py yt-3.4.0/yt/analysis_modules/spectral_integrator/api.py --- yt-3.3.3/yt/analysis_modules/spectral_integrator/api.py 2016-10-25 16:08:30.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/spectral_integrator/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,18 +1,8 @@ -""" -API for spectral_integrator +from yt.funcs import issue_deprecation_warning +issue_deprecation_warning("The spectral_integrator module is deprecated. " + "'add_xray_emissivity_field' can now be imported " + "from the yt module.") - -""" - -#----------------------------------------------------------------------------- -# Copyright (c) 2013, yt Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- - -from .spectral_frequency_integrator import \ - EmissivityIntegrator, \ +from yt.fields.xray_emission_fields import \ add_xray_emissivity_field \ No newline at end of file diff -Nru yt-3.3.3/yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py yt-3.4.0/yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py --- yt-3.3.3/yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,279 +0,0 @@ -""" -Integrator classes to deal with interpolation and integration of input spectral -bins. Currently only supports Cloudy and APEC-style data. - - - -""" - -#----------------------------------------------------------------------------- -# Copyright (c) 2013, yt Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- - -from yt.utilities.on_demand_imports import _h5py as h5py -import numpy as np -import os - -from yt.funcs import \ - download_file, \ - mylog, \ - only_on_root - -from yt.utilities.exceptions import YTFieldNotFound -from yt.utilities.exceptions import YTException -from yt.utilities.linear_interpolators import \ - UnilinearFieldInterpolator, BilinearFieldInterpolator -from yt.utilities.physical_constants import \ - hcgs, mp -from yt.units.yt_array import YTArray, YTQuantity -from yt.utilities.physical_ratios import \ - primordial_H_mass_fraction, erg_per_keV - -xray_data_version = 1 - -def _get_data_file(data_file=None): - if data_file is None: - data_file = "cloudy_emissivity.h5" - data_url = "http://yt-project.org/data" - if "YT_DEST" in os.environ and \ - os.path.isdir(os.path.join(os.environ["YT_DEST"], "data")): - data_dir = os.path.join(os.environ["YT_DEST"], "data") - else: - data_dir = "." - data_path = os.path.join(data_dir, data_file) - if not os.path.exists(data_path): - mylog.info("Attempting to download supplementary data from %s to %s." % - (data_url, data_dir)) - fn = download_file(os.path.join(data_url, data_file), data_path) - if fn != data_path: - raise RuntimeError("Failed to download supplementary data.") - return data_path - -class EnergyBoundsException(YTException): - def __init__(self, lower, upper): - self.lower = lower - self.upper = upper - - def __str__(self): - return "Energy bounds are %e to %e keV." % \ - (self.lower, self.upper) - -class ObsoleteDataException(YTException): - def __str__(self): - return "X-ray emissivity data is out of date.\n" + \ - "Download the latest data from http://yt-project.org/data/cloudy_emissivity.h5 and move it to %s." % \ - os.path.join(os.environ["YT_DEST"], "data", "cloudy_emissivity.h5") - -class EmissivityIntegrator(object): - r"""Class for making X-ray emissivity fields with hdf5 data tables - from Cloudy. - - Initialize an EmissivityIntegrator object. - - Parameters - ---------- - filename: string, default None - Path to data file containing emissivity values. If None, - a file called "cloudy_emissivity.h5" is used, for photoionized - plasmas. A second option, for collisionally ionized plasmas, is - in the file "apec_emissivity.h5", available at http://yt-project.org/data. - These files contain emissivity tables for primordial elements and - for metals at solar metallicity for the energy range 0.1 to 100 keV. - Default: None. - - """ - def __init__(self, filename=None): - - default_filename = False - if filename is None: - filename = _get_data_file() - default_filename = True - - if not os.path.exists(filename): - mylog.warning("File %s does not exist, will attempt to find it." % filename) - filename = _get_data_file(data_file=filename) - only_on_root(mylog.info, "Loading emissivity data from %s." % filename) - in_file = h5py.File(filename, "r") - if "info" in in_file.attrs: - only_on_root(mylog.info, in_file.attrs["info"]) - if default_filename and \ - in_file.attrs["version"] < xray_data_version: - raise ObsoleteDataException() - else: - only_on_root(mylog.info, "X-ray emissivity data version: %s." % \ - in_file.attrs["version"]) - - for field in ["emissivity_primordial", "emissivity_metals", - "log_nH", "log_T", "log_E"]: - if field in in_file: - setattr(self, field, in_file[field][:]) - in_file.close() - - E_diff = np.diff(self.log_E) - self.E_bins = \ - YTArray(np.power(10, np.concatenate([self.log_E[:-1] - 0.5 * E_diff, - [self.log_E[-1] - 0.5 * E_diff[-1], - self.log_E[-1] + 0.5 * E_diff[-1]]])), - "keV") - self.dnu = (np.diff(self.E_bins)/hcgs).in_units("Hz") - - def get_interpolator(self, data, e_min, e_max): - e_min = YTQuantity(e_min, "keV") - e_max = YTQuantity(e_max, "keV") - if (e_min - self.E_bins[0]) / e_min < -1e-3 or \ - (e_max - self.E_bins[-1]) / e_max > 1e-3: - raise EnergyBoundsException(self.E_bins[0], self.E_bins[-1]) - e_is, e_ie = np.digitize([e_min, e_max], self.E_bins) - e_is = np.clip(e_is - 1, 0, self.E_bins.size - 1) - e_ie = np.clip(e_ie, 0, self.E_bins.size - 1) - - my_dnu = self.dnu[e_is: e_ie].copy() - # clip edge bins if the requested range is smaller - my_dnu[0] -= ((e_min - self.E_bins[e_is])/hcgs).in_units("Hz") - my_dnu[-1] -= ((self.E_bins[e_ie] - e_max)/hcgs).in_units("Hz") - - interp_data = (data[..., e_is:e_ie] * my_dnu).sum(axis=-1) - if len(data.shape) == 2: - emiss = UnilinearFieldInterpolator(np.log10(interp_data), - [self.log_T[0], self.log_T[-1]], - "log_T", truncate=True) - else: - emiss = BilinearFieldInterpolator(np.log10(interp_data), - [self.log_nH[0], self.log_nH[-1], - self.log_T[0], self.log_T[-1]], - ["log_nH", "log_T"], truncate=True) - - return emiss - -def add_xray_emissivity_field(ds, e_min, e_max, - filename=None, - with_metals=True, - constant_metallicity=None): - r"""Create X-ray emissivity fields for a given energy range. - - Parameters - ---------- - e_min: float - the minimum energy in keV for the energy band. - e_min: float - the maximum energy in keV for the energy band. - filename: string, optional - Path to data file containing emissivity values. If None, - a file called "cloudy_emissivity.h5" is used, for photoionized - plasmas. A second option, for collisionally ionized plasmas, is - in the file "apec_emissivity.h5", available at http://yt-project.org/data. - These files contain emissivity tables for primordial elements and - for metals at solar metallicity for the energy range 0.1 to 100 keV. - Default: None. - with_metals: bool, optional - If True, use the metallicity field to add the contribution from - metals. If False, only the emission from H/He is considered. - Default: True. - constant_metallicity: float, optional - If specified, assume a constant metallicity for the emission - from metals. The *with_metals* keyword must be set to False - to use this. It should be given in unit of solar metallicity. - Default: None. - - This will create three fields: - - "xray_emissivity_{e_min}_{e_max}_keV" (erg s^-1 cm^-3) - "xray_luminosity_{e_min}_{e_max}_keV" (erg s^-1) - "xray_photon_emissivity_{e_min}_{e_max}_keV" (photons s^-1 cm^-3) - - Examples - -------- - - >>> from yt.mods import * - >>> from yt.analysis_modules.spectral_integrator.api import * - >>> ds = load(dataset) - >>> add_xray_emissivity_field(ds, 0.5, 2) - >>> p = ProjectionPlot(ds, 'x', "xray_emissivity_0.5_2_keV") - >>> p.save() - - """ - - if with_metals: - try: - ds._get_field_info("metal_density") - except YTFieldNotFound: - raise RuntimeError("Your dataset does not have a \"metal_density\" field! " + - "Perhaps you should specify a constant metallicity?") - - my_si = EmissivityIntegrator(filename=filename) - - em_0 = my_si.get_interpolator(my_si.emissivity_primordial, e_min, e_max) - em_Z = None - if with_metals or constant_metallicity is not None: - em_Z = my_si.get_interpolator(my_si.emissivity_metals, e_min, e_max) - - energy_erg = np.power(10, my_si.log_E) * erg_per_keV - emp_0 = my_si.get_interpolator((my_si.emissivity_primordial[..., :] / energy_erg), - e_min, e_max) - emp_Z = None - if with_metals or constant_metallicity is not None: - emp_Z = my_si.get_interpolator((my_si.emissivity_metals[..., :] / energy_erg), - e_min, e_max) - - try: - ds._get_field_info("H_number_density") - except YTFieldNotFound: - mylog.warning("Could not find a field for \"H_number_density\". Assuming primordial H " + - "mass fraction.") - def _nh(field, data): - return primordial_H_mass_fraction*data["gas","density"]/mp - ds.add_field(("gas", "H_number_density"), function=_nh, units="cm**-3") - - def _emissivity_field(field, data): - dd = {"log_nH" : np.log10(data["gas","H_number_density"]), - "log_T" : np.log10(data["gas","temperature"])} - - my_emissivity = np.power(10, em_0(dd)) - if em_Z is not None: - if with_metals: - my_Z = data["gas","metallicity"] - elif constant_metallicity is not None: - my_Z = constant_metallicity - my_emissivity += my_Z * np.power(10, em_Z(dd)) - - return data["gas","H_number_density"]**2 * \ - YTArray(my_emissivity, "erg*cm**3/s") - - emiss_name = "xray_emissivity_%s_%s_keV" % (e_min, e_max) - ds.add_field(("gas", emiss_name), function=_emissivity_field, - display_name=r"\epsilon_{X} (%s-%s keV)" % (e_min, e_max), - units="erg/cm**3/s") - - def _luminosity_field(field, data): - return data[emiss_name] * data["cell_volume"] - - lum_name = "xray_luminosity_%s_%s_keV" % (e_min, e_max) - ds.add_field(("gas", lum_name), function=_luminosity_field, - display_name=r"\rm{L}_{X} (%s-%s keV)" % (e_min, e_max), - units="erg/s") - - def _photon_emissivity_field(field, data): - dd = {"log_nH" : np.log10(data["gas","H_number_density"]), - "log_T" : np.log10(data["gas","temperature"])} - - my_emissivity = np.power(10, emp_0(dd)) - if emp_Z is not None: - if with_metals: - my_Z = data["gas","metallicity"] - elif constant_metallicity is not None: - my_Z = constant_metallicity - my_emissivity += my_Z * np.power(10, emp_Z(dd)) - - return data["gas","H_number_density"]**2 * \ - YTArray(my_emissivity, "photons*cm**3/s") - - phot_name = "xray_photon_emissivity_%s_%s_keV" % (e_min, e_max) - ds.add_field(("gas", phot_name), function=_photon_emissivity_field, - display_name=r"\epsilon_{X} (%s-%s keV)" % (e_min, e_max), - units="photons/cm**3/s") - - return emiss_name, lum_name, phot_name diff -Nru yt-3.3.3/yt/analysis_modules/star_analysis/api.py yt-3.4.0/yt/analysis_modules/star_analysis/api.py --- yt-3.3.3/yt/analysis_modules/star_analysis/api.py 2016-10-25 16:08:30.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/star_analysis/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,6 +13,13 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +from yt.funcs import issue_deprecation_warning + +issue_deprecation_warning( + "The star_analysis module has been deprecated. This code has been moved " + "to the yt attic (https://bitbucket.org/yt_analysis/yt_attic) and will " + "be removed in a future release.") + from .sfr_spectrum import \ StarFormationRate, \ SpectrumBuilder, \ diff -Nru yt-3.3.3/yt/analysis_modules/sunrise_export/api.py yt-3.4.0/yt/analysis_modules/sunrise_export/api.py --- yt-3.3.3/yt/analysis_modules/sunrise_export/api.py 2016-10-25 16:08:30.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/sunrise_export/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,5 +13,12 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +from yt.funcs import issue_deprecation_warning + +issue_deprecation_warning( + "The sunrise_exporter module has been deprecated. This code has been " + "moved to the yt attic (https://bitbucket.org/yt_analysis/yt_attic) and " + "will be removed in a future release.") + from .sunrise_exporter import \ export_to_sunrise diff -Nru yt-3.3.3/yt/analysis_modules/sunyaev_zeldovich/projection.py yt-3.4.0/yt/analysis_modules/sunyaev_zeldovich/projection.py --- yt-3.3.3/yt/analysis_modules/sunyaev_zeldovich/projection.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/sunyaev_zeldovich/projection.py 2017-08-10 18:02:57.000000000 +0000 @@ -78,7 +78,7 @@ Parameters ---------- - ds : Dataset + ds : ~yt.data_objects.static_output.Dataset The dataset freqs : array_like The frequencies (in GHz) at which to compute the SZ spectral distortion. @@ -375,7 +375,7 @@ >>> sky_center = (30., 45., "deg") >>> szprj.write_fits("SZbullet.fits", sky_center=sky_center, sky_scale=sky_scale) """ - from yt.utilities.fits_image import FITSImageData + from yt.visualization.fits_image import FITSImageData dx = self.dx.in_units("kpc") dy = dx diff -Nru yt-3.3.3/yt/analysis_modules/sunyaev_zeldovich/tests/test_projection.py yt-3.4.0/yt/analysis_modules/sunyaev_zeldovich/tests/test_projection.py --- yt-3.3.3/yt/analysis_modules/sunyaev_zeldovich/tests/test_projection.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/sunyaev_zeldovich/tests/test_projection.py 2017-08-10 18:02:57.000000000 +0000 @@ -113,7 +113,8 @@ deltaI = np.zeros((3,nx,ny)) for i in range(3): deltaI[i,:,:] = full_szpack3d(ds, xinit[i]) - yield assert_almost_equal, deltaI[i,:,:], np.array(szprj["%d_GHz" % int(freqs[i])]), 6 + assert_almost_equal( + deltaI[i,:,:], np.array(szprj["%d_GHz" % int(freqs[i])]), 6) M7 = "DD0010/moving7_0010" @requires_module("SZpack") diff -Nru yt-3.3.3/yt/analysis_modules/two_point_functions/api.py yt-3.4.0/yt/analysis_modules/two_point_functions/api.py --- yt-3.3.3/yt/analysis_modules/two_point_functions/api.py 2016-10-25 16:08:30.000000000 +0000 +++ yt-3.4.0/yt/analysis_modules/two_point_functions/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,6 +13,14 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- + +from yt.funcs import issue_deprecation_warning + +issue_deprecation_warning( + "The two_point_functions module has been deprecated. This code has been " + "moved to the yt attic (https://bitbucket.org/yt_analysis/yt_attic) and " + "will be removed in a future release.") + from .two_point_functions import \ TwoPointFunctions, \ FcnSet diff -Nru yt-3.3.3/yt/config.py yt-3.4.0/yt/config.py --- yt-3.3.3/yt/config.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/config.py 2017-08-10 18:02:57.000000000 +0000 @@ -16,6 +16,7 @@ #----------------------------------------------------------------------------- import os +import warnings from yt.extern.six.moves import configparser ytcfg_defaults = dict( @@ -44,12 +45,14 @@ pluginfilename = 'my_plugins.py', parallel_traceback = 'False', pasteboard_repo = '', - reconstruct_index = 'False', + reconstruct_index = 'True', test_storage_dir = '/does/not/exist', test_data_dir = '/does/not/exist', + requires_ds_strict = 'False', enzo_db = '', - hub_url = 'https://hub.yt-project.org/upload', + hub_url = 'https://girder.hub.yt/api/v1', hub_api_key = '', + hub_sandbox = '/collection/yt_sandbox/data', notebook_password = '', answer_testing_tolerance = '3', answer_testing_bitwise = 'False', @@ -60,27 +63,40 @@ imagebin_api_key = 'e1977d9195fe39e', imagebin_upload_url = 'https://api.imgur.com/3/upload', imagebin_delete_url = 'https://api.imgur.com/3/image/{delete_hash}', + curldrop_upload_url = 'http://use.yt/upload', thread_field_detection = 'False', ignore_invalid_unit_operation_errors = 'False', chunk_size = '1000', xray_data_dir = '/does/not/exist', + supp_data_dir = '/does/not/exist', default_colormap = 'arbre', ray_tracing_engine = 'embree', ) + +CONFIG_DIR = os.environ.get( + 'XDG_CONFIG_HOME', os.path.join(os.path.expanduser('~'), '.config', 'yt')) +if not os.path.exists(CONFIG_DIR): + try: + os.makedirs(CONFIG_DIR) + except OSError: + warnings.warn("unable to create yt config directory") + +CURRENT_CONFIG_FILE = os.path.join(CONFIG_DIR, 'ytrc') +_OLD_CONFIG_FILE = os.path.join(os.path.expanduser('~'), '.yt', 'config') + # Here is the upgrade. We're actually going to parse the file in its entirety # here. Then, if it has any of the Forbidden Sections, it will be rewritten # without them. -__fn = os.path.expanduser("~/.yt/config") -if os.path.exists(__fn): - f = open(__fn).read() +if os.path.exists(_OLD_CONFIG_FILE): + f = open(_OLD_CONFIG_FILE).read() if any(header in f for header in ["[lagos]","[raven]","[fido]","[enki]"]): print("***********************************************************") print("* Upgrading configuration file to new format; saving old. *") print("***********************************************************") # This is of the old format cp = configparser.ConfigParser() - cp.read(__fn) + cp.read(_OLD_CONFIG_FILE) # NOTE: To avoid having the 'DEFAULT' section here, # we are not passing in ytcfg_defaults to the constructor. new_cp = configparser.ConfigParser() @@ -91,29 +107,38 @@ if option.lower() in ytcfg_defaults: new_cp.set("yt", option, cp.get(section, option)) print("Setting %s to %s" % (option, cp.get(section, option))) - open(__fn + ".old", "w").write(f) - new_cp.write(open(__fn, "w")) -# Pathological check for Kraken -#elif os.path.exists("~/"): -# if not os.path.exists("~/.yt"): -# print "yt is creating a new directory, ~/.yt ." -# os.mkdir(os.path.exists("~/.yt/")) -# # Now we can read in and write out ... -# new_cp = configparser.ConfigParser(ytcfg_defaults) -# new_cp.write(__fn) + open(_OLD_CONFIG_FILE + ".old", "w").write(f) + new_cp.write(open(_OLD_CONFIG_FILE, "w")) + + msg = ( + "The configuration file {} is deprecated. " + "Please migrate your config to {} by running: " + "'yt config migrate'" + ) + warnings.warn(msg.format(_OLD_CONFIG_FILE, CURRENT_CONFIG_FILE)) + +if not os.path.exists(CURRENT_CONFIG_FILE): + cp = configparser.ConfigParser() + cp.add_section("yt") + try: + with open(CURRENT_CONFIG_FILE, 'w') as new_cfg: + cp.write(new_cfg) + except IOError: + warnings.warn("unable to write new config file") -class YTConfigParser(configparser.ConfigParser): +class YTConfigParser(configparser.ConfigParser, object): def __setitem__(self, key, val): self.set(key[0], key[1], val) + def __getitem__(self, key): self.get(key[0], key[1]) -if os.path.exists(os.path.expanduser("~/.yt/config")): - ytcfg = YTConfigParser(ytcfg_defaults) - ytcfg.read(['yt.cfg', os.path.expanduser('~/.yt/config')]) -else: - ytcfg = YTConfigParser(ytcfg_defaults) - ytcfg.read(['yt.cfg']) + def get(self, section, option, *args, **kwargs): + val = super(YTConfigParser, self).get(section, option, *args, **kwargs) + return os.path.expanduser(os.path.expandvars(val)) + +ytcfg = YTConfigParser(ytcfg_defaults) +ytcfg.read([_OLD_CONFIG_FILE, CURRENT_CONFIG_FILE, 'yt.cfg']) if not ytcfg.has_section("yt"): ytcfg.add_section("yt") diff -Nru yt-3.3.3/yt/convenience.py yt-3.4.0/yt/convenience.py --- yt-3.3.3/yt/convenience.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/convenience.py 2017-08-10 18:02:57.000000000 +0000 @@ -32,9 +32,9 @@ """ This function attempts to determine the base data type of a filename or other set of arguments by calling - :meth:`yt.data_objects.api.Dataset._is_valid` until it finds a + :meth:`yt.data_objects.static_output.Dataset._is_valid` until it finds a match, at which point it returns an instance of the appropriate - :class:`yt.data_objects.api.Dataset` subclass. + :class:`yt.data_objects.static_output.Dataset` subclass. """ candidates = [] args = [os.path.expanduser(arg) if isinstance(arg, string_types) @@ -127,4 +127,3 @@ return simulation_time_series_registry[simulation_type](parameter_filename, find_outputs=find_outputs) - diff -Nru yt-3.3.3/yt/data_objects/construction_data_containers.py yt-3.4.0/yt/data_objects/construction_data_containers.py --- yt-3.3.3/yt/data_objects/construction_data_containers.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/data_objects/construction_data_containers.py 2017-08-10 18:02:57.000000000 +0000 @@ -28,7 +28,8 @@ from yt.data_objects.data_containers import \ YTSelectionContainer1D, \ YTSelectionContainer2D, \ - YTSelectionContainer3D, \ + YTSelectionContainer3D +from yt.data_objects.field_data import \ YTFieldData from yt.funcs import \ ensure_list, \ @@ -55,11 +56,13 @@ from yt.utilities.parallel_tools.parallel_analysis_interface import \ parallel_objects, parallel_root_only, communication_system from yt.units.unit_object import Unit +from yt.units.yt_array import uconcatenate import yt.geometry.particle_deposit as particle_deposit from yt.utilities.grid_data_format.writer import write_to_gdf from yt.fields.field_exceptions import \ NeedsOriginalGrid from yt.frontends.stream.api import load_uniform_grid +from yt.units.yt_array import YTArray import yt.extern.six as six class YTStreamline(YTSelectionContainer1D): @@ -258,6 +261,11 @@ field = field or [] field = self._determine_fields(ensure_list(field)) + for f in field: + nodal_flag = self.ds._get_field_info(f).nodal_flag + if any(nodal_flag): + raise RuntimeError("Nodal fields are currently not supported for projections.") + if not self.deserialize(field): self.get_data(field) self.serialize() @@ -334,6 +342,10 @@ self._initialize_projected_units(fields, chunk) _units_initialized = True self._handle_chunk(chunk, fields, tree) + # if there's less than nprocs chunks, units won't be initialized + # on all processors, so sync with _projected_units on rank 0 + projected_units = self.comm.mpi_bcast(self._projected_units) + self._projected_units = projected_units # Note that this will briefly double RAM usage if self.method == "mip": merge_style = -1 @@ -346,8 +358,8 @@ # TODO: Add the combine operation xax = self.ds.coordinates.x_axis[self.axis] yax = self.ds.coordinates.y_axis[self.axis] - ox = self.ds.domain_left_edge[xax] - oy = self.ds.domain_left_edge[yax] + ox = self.ds.domain_left_edge[xax].v + oy = self.ds.domain_left_edge[yax].v px, py, pdx, pdy, nvals, nwvals = tree.get_all(False, merge_style) nvals = self.comm.mpi_allreduce(nvals, op=op) nwvals = self.comm.mpi_allreduce(nwvals, op=op) @@ -628,9 +640,23 @@ if len(part) > 0: self._fill_particles(part) if len(fill) > 0: self._fill_fields(fill) for a, f in sorted(alias.items()): - self[a] = f(self) + if f.particle_type: + self[a] = self._data_source[f] + else: + self[a] = f(self) self.field_data[a].convert_to_units(f.output_units) - if len(gen) > 0: self._generate_fields(gen) + if len(gen) > 0: + part_gen = [] + cell_gen = [] + for field in gen: + finfo = self.ds.field_info[field] + if finfo.particle_type: + part_gen.append(field) + else: + cell_gen.append(field) + self._generate_fields(cell_gen) + for p in part_gen: + self[p] = self._data_source[p] def _split_fields(self, fields_to_get): fill, gen = self.index._split_fields(fields_to_get) @@ -664,13 +690,17 @@ for field in fields] domain_dims = self.ds.domain_dimensions.astype("int64") \ * self.ds.relative_refinement(0, self.level) + refine_by = self.ds.refine_by + if not iterable(self.ds.refine_by): + refine_by = [refine_by, refine_by, refine_by] + refine_by = np.array(refine_by, dtype="i8") for chunk in self._data_source.chunks(fields, "io"): input_fields = [chunk[field] for field in fields] # NOTE: This usage of "refine_by" is actually *okay*, because it's # being used with respect to iref, which is *already* scaled! fill_region(input_fields, output_fields, self.level, self.global_startindex, chunk.icoords, chunk.ires, - domain_dims, self.ds.refine_by) + domain_dims, refine_by) for name, v in zip(fields, output_fields): fi = self.ds._get_field_info(*name) self[name] = self.ds.arr(v, fi.units) @@ -716,12 +746,15 @@ cls = getattr(particle_deposit, "deposit_%s" % method, None) if cls is None: raise YTParticleDepositionNotImplemented(method) - # We allocate number of zones, not number of octs - op = cls(self.ActiveDimensions, kernel_name) + # We allocate number of zones, not number of octs. Everything inside + # this is fortran ordered because of the ordering in the octree deposit + # routines, so we reverse it here to match the convention there + op = cls(tuple(self.ActiveDimensions)[::-1], kernel_name) op.initialize() op.process_grid(self, positions, fields) vals = op.finalize() - return vals.copy(order="C") + # Fortran-ordered, so transpose. + return vals.transpose() def write_to_gdf(self, gdf_path, fields, nprocs=1, field_units=None, **kwargs): @@ -815,16 +848,17 @@ def _fill_fields(self, fields): fields = [f for f in fields if f not in self.field_data] if len(fields) == 0: return - assert(len(fields) == 1) - field = fields[0] - dest = np.zeros(self.ActiveDimensions, dtype="float64") - for chunk in self._data_source.chunks(fields, "io"): - fill_region_float(chunk.fcoords, chunk.fwidth, chunk[field], - self.left_edge, self.right_edge, dest, 1, - self.ds.domain_width, - int(any(self.ds.periodicity))) - fi = self.ds._get_field_info(field) - self[field] = self.ds.arr(dest, fi.units) + # It may be faster to adapt fill_region_float to fill multiple fields + # instead of looping here + for field in fields: + dest = np.zeros(self.ActiveDimensions, dtype="float64") + for chunk in self._data_source.chunks(fields, "io"): + fill_region_float(chunk.fcoords, chunk.fwidth, chunk[field], + self.left_edge, self.right_edge, dest, 1, + self.ds.domain_width, + int(any(self.ds.periodicity))) + fi = self.ds._get_field_info(field) + self[field] = self.ds.arr(dest, fi.units) class LevelState(object): @@ -938,6 +972,12 @@ if len(fields) == 0: return ls = self._initialize_level_state(fields) min_level = self._compute_minimum_level() + # NOTE: This usage of "refine_by" is actually *okay*, because it's + # being used with respect to iref, which is *already* scaled! + refine_by = self.ds.refine_by + if not iterable(self.ds.refine_by): + refine_by = [refine_by, refine_by, refine_by] + refine_by = np.array(refine_by, dtype="i8") for level in range(self.level + 1): if level < min_level: self._update_level_state(ls) @@ -952,11 +992,9 @@ for chunk in ls.data_source.chunks(fields, "io"): chunk[fields[0]] input_fields = [chunk[field] for field in fields] - # NOTE: This usage of "refine_by" is actually *okay*, because it's - # being used with respect to iref, which is *already* scaled! tot -= fill_region(input_fields, ls.fields, ls.current_level, ls.global_startindex, chunk.icoords, - chunk.ires, domain_dims, self.ds.refine_by) + chunk.ires, domain_dims, refine_by) if level == 0 and tot != 0: raise RuntimeError self._update_level_state(ls) @@ -1060,7 +1098,7 @@ surface_field : string Any field that can be obtained in a data object. This is the field which will be isocontoured. - field_value : float + field_value : float, YTQuantity, or unit tuple The value at which the isocontour should be calculated. Examples @@ -1085,14 +1123,21 @@ ("index", "x"), ("index", "y"), ("index", "z")) - vertices = None def __init__(self, data_source, surface_field, field_value, ds=None): self.data_source = data_source - self.surface_field = surface_field - self.field_value = field_value + self.surface_field = data_source._determine_fields(surface_field)[0] + finfo = data_source.ds.field_info[self.surface_field] + try: + self.field_value = field_value.to(finfo.units) + except AttributeError: + if isinstance(field_value, tuple): + self.field_value = data_source.ds.quan(*field_value) + self.field_value = self.field_value.to(finfo.units) + else: + self.field_value = data_source.ds.quan(field_value, finfo.units) self.vertex_samples = YTFieldData() center = data_source.get_field_parameter("center") - super(YTSurface, self).__init__(center = center, ds=ds) + super(YTSurface, self).__init__(center=center, ds=ds) def _generate_container_field(self, field): self.get_data(field) @@ -1105,7 +1150,8 @@ elif isinstance(fields, list): fields = fields[0] # Now we have a "fields" value that is either a string or None - mylog.info("Extracting (sampling: %s)" % (fields,)) + if fields is not None: + mylog.info("Extracting (sampling: %s)" % (fields,)) verts = [] samples = [] for io_chunk in parallel_objects(self.data_source.chunks([], "io")): @@ -1119,9 +1165,11 @@ verts.append(my_verts) verts = np.concatenate(verts).transpose() verts = self.comm.par_combine_object(verts, op='cat', datatype='array') - self.vertices = verts + # verts is an ndarray here and will always be in code units, so we + # expose it in the public API as a YTArray + self._vertices = self.ds.arr(verts, 'code_length') if fields is not None: - samples = np.concatenate(samples) + samples = uconcatenate(samples) samples = self.comm.par_combine_object(samples, op='cat', datatype='array') if sample_type == "face": @@ -1223,22 +1271,50 @@ ff = np.ones_like(vc_data[self.surface_field], dtype="float64") else: ff = vc_data[fluxing_field] + surf_vals = vc_data[self.surface_field] + field_x_vals = vc_data[field_x] + field_y_vals = vc_data[field_y] + field_z_vals = vc_data[field_z] + ret = march_cubes_grid_flux( + self.field_value, surf_vals, field_x_vals, field_y_vals, field_z_vals, + ff, mask, grid.LeftEdge, grid.dds) + # assumes all the fluxing fields have the same units + ret_units = field_x_vals.units * ff.units * grid.dds.units**2 + ret = self.ds.arr(ret, ret_units) + ret.convert_to_units(self.ds.unit_system[ret_units.dimensions]) + return ret - return march_cubes_grid_flux( - self.field_value, vc_data[self.surface_field], vc_data[field_x], - vc_data[field_y], vc_data[field_z], ff, mask, grid.LeftEdge, - grid.dds) + _vertices = None + @property + def vertices(self): + if self._vertices is None: + self.get_data() + return self._vertices @property def triangles(self): - if self.vertices is None: - self.get_data() - vv = np.empty((self.vertices.shape[1]/3, 3, 3), dtype="float64") + vv = np.empty((self.vertices.shape[1]//3, 3, 3), dtype="float64") + vv = self.ds.arr(vv, self.vertices.units) for i in range(3): for j in range(3): vv[:,i,j] = self.vertices[j,i::3] return vv + _surface_area = None + @property + def surface_area(self): + if self._surface_area is not None: + return self._surface_area + tris = self.triangles + x = tris[:, 1, :] - tris[:, 0, :] + y = tris[:, 2, :] - tris[:, 0, :] + areas = (x[:, 1]*y[:, 2] - x[:, 2]*y[:, 1])**2 + np.add(areas, (x[:, 2]*y[:, 0] - x[:, 0]*y[:, 2])**2, out=areas) + np.add(areas, (x[:, 0]*y[:, 1] - x[:, 1]*y[:, 0])**2, out=areas) + np.sqrt(areas, out=areas) + self._surface_area = 0.5*areas.sum() + return self._surface_area + def export_obj(self, filename, transparency = 1.0, dist_fac = None, color_field = None, emit_field = None, color_map = None, color_log = True, emit_log = True, plot_index = None, @@ -1292,36 +1368,34 @@ >>> sp = ds.sphere("max", (10, "kpc")) >>> trans = 1.0 - >>> distf = 3.1e18*1e3 # distances into kpc >>> surf = ds.surface(sp, "density", 5e-27) - >>> surf.export_obj("my_galaxy", transparency=trans, dist_fac = distf) + >>> surf.export_obj("my_galaxy", transparency=trans) >>> sp = ds.sphere("max", (10, "kpc")) - >>> mi, ma = sp.quantities.extrema('temperature')[0] + >>> mi, ma = sp.quantities.extrema('temperature') >>> rhos = [1e-24, 1e-25] >>> trans = [0.5, 1.0] - >>> distf = 3.1e18*1e3 # distances into kpc >>> for i, r in enumerate(rhos): ... surf = ds.surface(sp,'density',r) ... surf.export_obj("my_galaxy", transparency=trans[i], - ... color_field='temperature', dist_fac = distf, + ... color_field='temperature' ... plot_index = i, color_field_max = ma, ... color_field_min = mi) >>> sp = ds.sphere("max", (10, "kpc")) >>> rhos = [1e-24, 1e-25] >>> trans = [0.5, 1.0] - >>> distf = 3.1e18*1e3 # distances into kpc >>> def _Emissivity(field, data): ... return (data['density']*data['density'] * ... np.sqrt(data['temperature'])) - >>> ds.add_field("emissivity", function=_Emissivity, units=r"g*K/cm**6") + >>> ds.add_field("emissivity", function=_Emissivity, + ... sampling_type='cell', units=r"g**2*sqrt(K)/cm**6") >>> for i, r in enumerate(rhos): ... surf = ds.surface(sp,'density',r) ... surf.export_obj("my_galaxy", transparency=trans[i], ... color_field='temperature', ... emit_field='emissivity', - ... dist_fac = distf, plot_index = i) + ... plot_index = i) """ if color_map is None: @@ -1430,22 +1504,22 @@ vtype = [("x","float"),("y","float"), ("z","float")] if plot_index == 0: fobj.write("# yt OBJ file\n") - fobj.write("# www.yt-project.com\n") + fobj.write("# www.yt-project.org\n") fobj.write("mtllib " + filename + '.mtl\n\n') # use this material file for the faces fmtl.write("# yt MLT file\n") - fmtl.write("# www.yt-project.com\n\n") + fmtl.write("# www.yt-project.org\n\n") #(0) formulate vertices nv = self.vertices.shape[1] # number of groups of vertices - f = np.empty(nv/self.vertices.shape[0], dtype=ftype) # store sets of face colors + f = np.empty(nv//self.vertices.shape[0], dtype=ftype) # store sets of face colors v = np.empty(nv, dtype=vtype) # stores vertices if color_field is not None: cs = self[color_field] else: - cs = np.empty(self.vertices.shape[1]/self.vertices.shape[0]) + cs = np.empty(self.vertices.shape[1]//self.vertices.shape[0]) if emit_field is not None: em = self[emit_field] else: - em = np.empty(self.vertices.shape[1]/self.vertices.shape[0]) + em = np.empty(self.vertices.shape[1]//self.vertices.shape[0]) self._color_samples_obj(cs, em, color_log, emit_log, color_map, f, color_field_max, color_field_min, color_field, emit_field_max, emit_field_min, emit_field) # map color values to color scheme @@ -1546,26 +1620,23 @@ >>> sp = ds.sphere("max", (10, "kpc")) >>> trans = 1.0 - >>> distf = 3.1e18*1e3 # distances into kpc >>> surf = ds.surface(sp, "density", 5e-27) - >>> surf.export_obj("my_galaxy", transparency=trans, dist_fac = distf) + >>> surf.export_obj("my_galaxy", transparency=trans) >>> sp = ds.sphere("max", (10, "kpc")) >>> mi, ma = sp.quantities.extrema('temperature')[0] >>> rhos = [1e-24, 1e-25] >>> trans = [0.5, 1.0] - >>> distf = 3.1e18*1e3 # distances into kpc >>> for i, r in enumerate(rhos): ... surf = ds.surface(sp,'density',r) ... surf.export_obj("my_galaxy", transparency=trans[i], - ... color_field='temperature', dist_fac = distf, + ... color_field='temperature', ... plot_index = i, color_field_max = ma, ... color_field_min = mi) >>> sp = ds.sphere("max", (10, "kpc")) >>> rhos = [1e-24, 1e-25] >>> trans = [0.5, 1.0] - >>> distf = 3.1e18*1e3 # distances into kpc >>> def _Emissivity(field, data): ... return (data['density']*data['density']*np.sqrt(data['temperature'])) >>> ds.add_field("emissivity", function=_Emissivity, units="g / cm**6") @@ -1573,7 +1644,7 @@ ... surf = ds.surface(sp,'density',r) ... surf.export_obj("my_galaxy", transparency=trans[i], ... color_field='temperature', emit_field = 'emissivity', - ... dist_fac = distf, plot_index = i) + ... plot_index = i) """ if color_map is None: @@ -1716,6 +1787,11 @@ DLE = self.ds.domain_left_edge DRE = self.ds.domain_right_edge bounds = [(DLE[i], DRE[i]) for i in range(3)] + elif any([not all([isinstance(be, YTArray) for be in b]) + for b in bounds]): + bounds = [tuple(be if isinstance(be, YTArray) else + self.ds.quan(be, 'code_length') for be in b) + for b in bounds] nv = self.vertices.shape[1] vs = [("x", "]. + + >>> ds = load("DD0046/DD0046") + >>> ad = ds.all_data() + >>> profile = ad.profile(ad, [("gas", "density")], + ... [("gas", "temperature"), + ... ("gas", "velocity_x")]) + >>> print (profile.x) + >>> print (profile["gas", "temperature"]) + >>> plot = profile.plot() + """ + p = create_profile(self, bin_fields, fields, n_bins, + extrema, logs, units, weight_field, accumulation, + fractional, deposition) + return p - def mean(self, field, axis=None, weight='ones'): + def mean(self, field, axis=None, weight=None): r"""Compute the mean of a field, optionally along an axis, with a weight. This will, in a parallel-aware fashion, compute the mean of the given field. If an axis is supplied, it will return a projection, - where the weight is also supplied. By default the weight is "ones", - resulting in a strict average. + where the weight is also supplied. By default the weight field will be + "ones" or "particle_ones", depending on the field being averaged, + resulting in an unweighted average. Parameters ---------- - field : string or tuple of strings + field : string or tuple field name The field to average. axis : string, optional If supplied, the axis to compute the mean along (i.e., to project @@ -847,13 +944,12 @@ >>> avg_rho = reg.mean("density", weight="cell_volume") >>> rho_weighted_T = reg.mean("temperature", axis="y", weight="density") """ + weight_field = sanitize_weight_field(self.ds, field, weight) if axis in self.ds.coordinates.axis_name: - r = self.ds.proj(field, axis, data_source=self, weight_field=weight) + r = self.ds.proj(field, axis, data_source=self, + weight_field=weight_field) elif axis is None: - if weight is None: - r = self.quantities.total_quantity(field) - else: - r = self.quantities.weighted_average_quantity(field, weight) + r = self.quantities.weighted_average_quantity(field, weight_field) else: raise NotImplementedError("Unknown axis %s" % axis) return r @@ -868,7 +964,7 @@ Parameters ---------- - field : string or tuple of strings + field : string or tuple field name The field to sum. axis : string, optional If supplied, the axis to sum along. @@ -895,15 +991,17 @@ raise NotImplementedError("Unknown axis %s" % axis) return r - def integrate(self, field, axis=None): + def integrate(self, field, weight=None, axis=None): r"""Compute the integral (projection) of a field along an axis. This projects a field along an axis. Parameters ---------- - field : string or tuple of strings + field : string or tuple field name The field to project. + weight: string or tuple field name + The field to weight the projection by axis : string The axis to project along. @@ -916,8 +1014,13 @@ >>> column_density = reg.integrate("density", axis="z") """ + if weight is not None: + weight_field = sanitize_weight_field(self.ds, field, weight) + else: + weight_field = None if axis in self.ds.coordinates.axis_name: - r = self.ds.proj(field, axis, data_source=self) + r = self.ds.proj(field, axis, data_source=self, + weight_field=weight_field) else: raise NotImplementedError("Unknown axis %s" % axis) return r @@ -937,6 +1040,35 @@ [self.field_parameters]) return (_reconstruct_object, args) + def clone(self): + r"""Clone a data object. + + This will make a duplicate of a data object; note that the + `field_parameters` may not necessarily be deeply-copied. If you modify + the field parameters in-place, it may or may not be shared between the + objects, depending on the type of object that that particular field + parameter is. + + Notes + ----- + One use case for this is to have multiple identical data objects that + are being chunked over in different orders. + + Examples + -------- + + >>> ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") + >>> sp = ds.sphere("c", 0.1) + >>> sp_clone = sp.clone() + >>> sp["density"] + >>> print sp.field_data.keys() + [("gas", "density")] + >>> print sp_clone.field_data.keys() + [] + """ + args = self.__reduce__() + return args[0](self.ds, *args[1][1:])[1] + def __repr__(self): # We'll do this the slow way to be clear what's going on s = "%s (%s): " % (self.__class__.__name__, self.ds) @@ -1034,9 +1166,12 @@ # For grids this will be a grid object, and for octrees it will # be an OctreeSubset. Note that we delegate to the sub-object. o = self._current_chunk.objs[0] + cache_fp = o.field_parameters.copy() + o.field_parameters.update(self.field_parameters) for b, m in o.select_blocks(self.selector): if m is None: continue yield b, m + o.field_parameters = cache_fp class GenerationInProgress(Exception): def __init__(self, fields): @@ -1086,7 +1221,16 @@ # This is an iterator that will yield the necessary chunks. self.get_data() # Ensure we have built ourselves if fields is None: fields = [] - for chunk in self.index._chunk(self, chunking_style, **kwargs): + # chunk_ind can be supplied in the keyword arguments. If it's a + # scalar, that'll be the only chunk that gets returned; if it's a list, + # those are the ones that will be. + chunk_ind = kwargs.pop("chunk_ind", None) + if chunk_ind is not None: + chunk_ind = ensure_list(chunk_ind) + for ci, chunk in enumerate(self.index._chunk(self, chunking_style, + **kwargs)): + if chunk_ind is not None and ci not in chunk_ind: + continue with self._chunked_read(chunk): self.get_data(fields) # NOTE: we yield before releasing the context @@ -1249,6 +1393,43 @@ if f not in fields_to_generate: fields_to_generate.append(f) + def __or__(self, other): + if not isinstance(other, YTSelectionContainer): + raise YTBooleanObjectError(other) + if self.ds is not other.ds: + raise YTBooleanObjectsWrongDataset() + # Should maybe do something with field parameters here + return YTBooleanContainer("OR", self, other, ds = self.ds) + + def __invert__(self): + # ~obj + asel = yt.geometry.selection_routines.AlwaysSelector(self.ds) + return YTBooleanContainer("NOT", self, asel, ds = self.ds) + + def __xor__(self, other): + if not isinstance(other, YTSelectionContainer): + raise YTBooleanObjectError(other) + if self.ds is not other.ds: + raise YTBooleanObjectsWrongDataset() + return YTBooleanContainer("XOR", self, other, ds = self.ds) + + def __and__(self, other): + if not isinstance(other, YTSelectionContainer): + raise YTBooleanObjectError(other) + if self.ds is not other.ds: + raise YTBooleanObjectsWrongDataset() + return YTBooleanContainer("AND", self, other, ds = self.ds) + + def __add__(self, other): + return self.__or__(other) + + def __sub__(self, other): + if not isinstance(other, YTSelectionContainer): + raise YTBooleanObjectError(other) + if self.ds is not other.ds: + raise YTBooleanObjectsWrongDataset() + return YTBooleanContainer("NEG", self, other, ds = self.ds) + @contextmanager def _field_lock(self): self._locked = True @@ -1316,7 +1497,6 @@ self.index._identify_base_chunk(self) return self._current_chunk.fcoords_vertex - class YTSelectionContainer0D(YTSelectionContainer): _spatial = False _dimensionality = 0 @@ -1451,6 +1631,8 @@ elif iterable(height): h, u = height height = self.ds.quan(h, input_units = u) + elif not isinstance(height, YTArray): + height = self.ds.quan(height, 'code_length') if not iterable(resolution): resolution = (resolution, resolution) from yt.visualization.fixed_resolution import FixedResolutionBuffer @@ -1680,7 +1862,7 @@ def _calculate_flux_in_grid(self, grid, mask, field, value, field_x, field_y, field_z, fluxing_field = None): - + vc_fields = [field, field_x, field_y, field_z] if fluxing_field is not None: vc_fields.append(fluxing_field) @@ -1773,6 +1955,50 @@ """ return self.quantities.total_quantity(("index", "cell_volume")) + +class YTBooleanContainer(YTSelectionContainer3D): + """ + This is a boolean operation, accepting AND, OR, XOR, and NOT for combining + multiple data objects. + + This object is not designed to be created directly; it is designed to be + created implicitly by using one of the bitwise operations (&, \|, ^, \~) on + one or two other data objects. These correspond to the appropriate boolean + operations, and the resultant object can be nested. + + Parameters + ---------- + op : string + Can be AND, OR, XOR, NOT or NEG. + dobj1 : YTSelectionContainer + The first selection object + dobj2 : YTSelectionContainer + The second object + + Examples + -------- + + >>> import yt + >>> ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") + >>> sp = ds.sphere("c", 0.1) + >>> dd = ds.r[:,:,:] + >>> new_obj = sp ^ dd + >>> print(new_obj.sum("cell_volume"), dd.sum("cell_volume") - + ... sp.sum("cell_volume")) + """ + _type_name = "bool" + _con_args = ("op", "dobj1", "dobj2") + def __init__(self, op, dobj1, dobj2, ds = None, field_parameters = None, + data_source = None): + YTSelectionContainer3D.__init__(self, None, ds, field_parameters, + data_source) + self.op = op.upper() + self.dobj1 = dobj1 + self.dobj2 = dobj2 + name = "Boolean%sSelector" % (self.op,) + sel_cls = getattr(yt.geometry.selection_routines, name) + self._selector = sel_cls(self) + # Many of these items are set up specifically to ensure that # we are not breaking old pickle files. This means we must only call the # _reconstruct_object and that we cannot mandate any additional arguments to @@ -1796,6 +2022,9 @@ return narg def _get_ds_by_hash(hash): + from yt.data_objects.static_output import Dataset + if isinstance(hash, Dataset): + return hash from yt.data_objects.static_output import _cached_datasets for ds in _cached_datasets.values(): if ds._hash() == hash: return ds diff -Nru yt-3.3.3/yt/data_objects/derived_quantities.py yt-3.4.0/yt/data_objects/derived_quantities.py --- yt-3.3.3/yt/data_objects/derived_quantities.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/derived_quantities.py 2017-08-10 18:02:57.000000000 +0000 @@ -156,8 +156,8 @@ Parameters ---------- - fields : field or list of fields - The field to be summed. + fields + The field or list of fields to be summed. Examples -------- @@ -487,8 +487,9 @@ Parameters ---------- - fields : field or list of fields - The field over which the extrema are to be calculated. + fields + The field or list of fields over which the extrema are to be + calculated. non_zero : bool If True, only positive values are considered in the calculation. Default: False diff -Nru yt-3.3.3/yt/data_objects/field_data.py yt-3.4.0/yt/data_objects/field_data.py --- yt-3.3.3/yt/data_objects/field_data.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/data_objects/field_data.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,20 @@ +""" +The YTFieldData object. + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2016, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +class YTFieldData(dict): + """ + A Container object for field data, instead of just having it be a dict. + """ + pass diff -Nru yt-3.3.3/yt/data_objects/grid_patch.py yt-3.4.0/yt/data_objects/grid_patch.py --- yt-3.3.3/yt/data_objects/grid_patch.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/data_objects/grid_patch.py 2017-08-10 18:02:57.000000000 +0000 @@ -18,16 +18,26 @@ import numpy as np from six import string_types +from yt.config import ytcfg from yt.data_objects.data_containers import \ - YTFieldData, \ YTSelectionContainer +from yt.data_objects.field_data import \ + YTFieldData +from yt.funcs import iterable from yt.geometry.selection_routines import convert_mask_to_indices import yt.geometry.particle_deposit as particle_deposit +from yt.units.yt_array import YTArray from yt.utilities.exceptions import \ YTFieldTypeNotFound, \ YTParticleDepositionNotImplemented from yt.utilities.lib.interpolators import \ ghost_zone_interpolate +from yt.utilities.lib.mesh_utilities import \ + clamp_edges +from yt.utilities.nodal_data_utils import \ + get_nodal_slices + +RECONSTRUCT_INDEX = bool(ytcfg.get('yt', 'reconstruct_index')) class AMRGridPatch(YTSelectionContainer): _spatial = True @@ -89,7 +99,9 @@ return tr finfo = self.ds._get_field_info(*fields[0]) if not finfo.particle_type: - return tr.reshape(self.ActiveDimensions) + num_nodes = 2**sum(finfo.nodal_flag) + new_shape = list(self.ActiveDimensions) + [num_nodes] + return np.squeeze(tr.reshape(new_shape)) return tr def convert(self, datatype): @@ -129,19 +141,22 @@ # So first we figure out what the index is. We don't assume # that dx=dy=dz, at least here. We probably do elsewhere. id = self.id - self._id_offset + ds = self.ds + index = self.index if self.Parent is not None: if not hasattr(self.Parent, 'dds'): self.Parent._setup_dx() - self.dds = self.Parent.dds.ndarray_view() / self.ds.refine_by + self.dds = self.Parent.dds.d / self.ds.refine_by else: - LE, RE = self.index.grid_left_edge[id,:], \ - self.index.grid_right_edge[id,:] + LE, RE = (index.grid_left_edge[id, :].d, + index.grid_right_edge[id, :].d) self.dds = (RE - LE) / self.ActiveDimensions - if self.ds.dimensionality < 2: - self.dds[1] = self.ds.domain_right_edge[1] - self.ds.domain_left_edge[1] if self.ds.dimensionality < 3: - self.dds[2] = self.ds.domain_right_edge[2] - self.ds.domain_left_edge[2] - self.dds = self.ds.arr(self.dds, "code_length") + self.dds[2] = ds.domain_right_edge[2] - ds.domain_left_edge[2] + elif self.ds.dimensionality < 2: + self.dds[1] = ds.domain_right_edge[1] - ds.domain_left_edge[1] + self.dds = self.dds.view(YTArray) + self.dds.units = self.index.grid_left_edge.units def __repr__(self): return "AMRGridPatch_%04i" % (self.id) @@ -168,6 +183,18 @@ self.ActiveDimensions = h.grid_dimensions[my_ind] self.LeftEdge = h.grid_left_edge[my_ind] self.RightEdge = h.grid_right_edge[my_ind] + # This can be expensive so we allow people to disable this behavior + # via a config option + if RECONSTRUCT_INDEX: + if iterable(self.Parent) and len(self.Parent) > 0: + p = self.Parent[0] + else: + p = self.Parent + if p is not None and p != []: + # clamp grid edges to an integer multiple of the parent cell + # width + clamp_edges(self.LeftEdge, p.LeftEdge, p.dds) + clamp_edges(self.RightEdge, p.RightEdge, p.dds) h.grid_levels[my_ind, 0] = self.Level # This might be needed for streaming formats #self.Time = h.gridTimes[my_ind,0] @@ -267,8 +294,9 @@ fields = list(set(fields)) new_fields = {} for field in fields: - new_fields[field] = np.zeros(self.ActiveDimensions + 1, dtype='float64') - + finfo = self.ds._get_field_info(field) + new_fields[field] = self.ds.arr( + np.zeros(self.ActiveDimensions + 1), finfo.output_units) if no_ghost: for field in fields: # Ensure we have the native endianness in this array. Avoid making @@ -345,14 +373,16 @@ cls = getattr(particle_deposit, "deposit_%s" % method, None) if cls is None: raise YTParticleDepositionNotImplemented(method) - # We allocate number of zones, not number of octs - # Everything inside this is fortran ordered, so we reverse it here. - op = cls(tuple(self.ActiveDimensions)[::-1], kernel_name) + # We allocate number of zones, not number of octs. Everything inside + # this is Fortran ordered because of the ordering in the octree deposit + # routines, so we reverse it here to match the convention there + op = cls(tuple(self.ActiveDimensions[::-1]), kernel_name) op.initialize() op.process_grid(self, positions, fields) vals = op.finalize() if vals is None: return - return vals.transpose() # Fortran-ordered, so transpose. + # Fortran-ordered, so transpose. + return vals.transpose() def select_blocks(self, selector): mask = self._get_selector_mask(selector) @@ -376,7 +406,13 @@ mask = self._get_selector_mask(selector) count = self.count(selector) if count == 0: return 0 - dest[offset:offset+count] = source[mask] + nodal_flag = source.shape - self.ActiveDimensions + if sum(nodal_flag) == 0: + dest[offset:offset+count] = source[mask] + else: + slices = get_nodal_slices(source.shape, nodal_flag) + for i , sl in enumerate(slices): + dest[offset:offset+count, i] = source[sl][mask] return count def count(self, selector): diff -Nru yt-3.3.3/yt/data_objects/octree_subset.py yt-3.4.0/yt/data_objects/octree_subset.py --- yt-3.3.3/yt/data_objects/octree_subset.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/data_objects/octree_subset.py 2017-08-10 18:02:57.000000000 +0000 @@ -17,8 +17,9 @@ import numpy as np from yt.data_objects.data_containers import \ - YTFieldData, \ YTSelectionContainer +from yt.data_objects.field_data import \ + YTFieldData import yt.geometry.particle_deposit as particle_deposit import yt.geometry.particle_smooth as particle_smooth @@ -189,7 +190,7 @@ dtype="float64") # We should not need the following if we know in advance all our fields # need no casting. - fields = [np.asarray(f, dtype="float64") for f in fields] + fields = [np.ascontiguousarray(f, dtype="float64") for f in fields] op.process_octree(self.oct_handler, self.domain_ind, pos, fields, self.domain_id, self._domain_offset) vals = op.finalize() @@ -444,7 +445,7 @@ def __getitem__(self, key): bs = self.block_slice - rv = bs.octree_subset[key][:,:,:,self.ind] + rv = bs.octree_subset[key][:,:,:,self.ind].T if bs.octree_subset._block_reorder: rv = rv.copy(order=bs.octree_subset._block_reorder) return rv diff -Nru yt-3.3.3/yt/data_objects/particle_filters.py yt-3.4.0/yt/data_objects/particle_filters.py --- yt-3.3.3/yt/data_objects/particle_filters.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/particle_filters.py 2017-08-10 18:02:57.000000000 +0000 @@ -69,9 +69,13 @@ # fields are implicitly "all" or something. return all((self.filtered_type, field) in field_list for field in self.requires) + def missing(self, field_list): + return list((self.filtered_type, field) for field in self.requires if + (self.filtered_type, field) not in field_list) + def wrap_func(self, field_name, old_fi): new_fi = copy.copy(old_fi) - new_fi.name = (self.filtered_type, field_name[1]) + new_fi.name = (self.name, field_name[1]) if old_fi._function == NullFunc: new_fi._function = TranslationFunc(old_fi.name) return new_fi diff -Nru yt-3.3.3/yt/data_objects/particle_io.py yt-3.4.0/yt/data_objects/particle_io.py --- yt-3.3.3/yt/data_objects/particle_io.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/data_objects/particle_io.py 2017-08-10 18:02:57.000000000 +0000 @@ -21,11 +21,12 @@ ensure_list, \ mylog from yt.extern.six import add_metaclass +from yt.data_objects.field_data import \ + YTFieldData particle_handler_registry = defaultdict() def particle_converter(func): - from .data_containers import YTFieldData def save_state(grid): old_params = grid.field_parameters old_keys = grid.field_data.keys() diff -Nru yt-3.3.3/yt/data_objects/particle_trajectories.py yt-3.4.0/yt/data_objects/particle_trajectories.py --- yt-3.3.3/yt/data_objects/particle_trajectories.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/data_objects/particle_trajectories.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,371 @@ +""" +Particle trajectories +""" +from __future__ import print_function + +#----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from yt.data_objects.field_data import YTFieldData +from yt.utilities.lib.particle_mesh_operations import CICSample_3 +from yt.utilities.parallel_tools.parallel_analysis_interface import \ + parallel_root_only +from yt.funcs import mylog, get_pbar +from yt.units.yt_array import array_like_field +from yt.config import ytcfg +from collections import OrderedDict + +import numpy as np +from yt.utilities.on_demand_imports import _h5py as h5py + +class ParticleTrajectories(object): + r"""A collection of particle trajectories in time over a series of + datasets. + + Parameters + ---------- + outputs : ~yt.data_objects.time_series.DatasetSeries + DatasetSeries object from which to draw the particles. + indices : array_like + An integer array of particle indices whose trajectories we + want to track. If they are not sorted they will be sorted. + fields : list of strings, optional + A set of fields that is retrieved when the trajectory + collection is instantiated. Default: None (will default + to the fields 'particle_position_x', 'particle_position_y', + 'particle_position_z') + suppress_logging : boolean + Suppress yt's logging when iterating over the simulation time + series. Default: False + + Examples + -------- + >>> my_fns = glob.glob("orbit_hdf5_chk_00[0-9][0-9]") + >>> my_fns.sort() + >>> fields = ["particle_position_x", "particle_position_y", + >>> "particle_position_z", "particle_velocity_x", + >>> "particle_velocity_y", "particle_velocity_z"] + >>> ds = load(my_fns[0]) + >>> init_sphere = ds.sphere(ds.domain_center, (.5, "unitary")) + >>> indices = init_sphere["particle_index"].astype("int") + >>> ts = DatasetSeries(my_fns) + >>> trajs = ts.particle_trajectories(indices, fields=fields) + >>> for t in trajs : + >>> print t["particle_velocity_x"].max(), t["particle_velocity_x"].min() + """ + def __init__(self, outputs, indices, fields=None, suppress_logging=False): + + indices.sort() # Just in case the caller wasn't careful + self.field_data = YTFieldData() + self.data_series = outputs + self.masks = [] + self.sorts = [] + self.array_indices = [] + self.indices = indices + self.num_indices = len(indices) + self.num_steps = len(outputs) + self.times = [] + self.suppress_logging = suppress_logging + + if fields is None: fields = [] + fields = list(OrderedDict.fromkeys(fields)) + + if self.suppress_logging: + old_level = int(ytcfg.get("yt","loglevel")) + mylog.setLevel(40) + + fds = {} + ds_first = self.data_series[0] + dd_first = ds_first.all_data() + idx_field = dd_first._determine_fields("particle_index")[0] + for field in ("particle_position_%s" % ax for ax in "xyz"): + fds[field] = dd_first._determine_fields(field)[0] + + my_storage = {} + pbar = get_pbar("Constructing trajectory information", len(self.data_series)) + for i, (sto, ds) in enumerate(self.data_series.piter(storage=my_storage)): + dd = ds.all_data() + newtags = dd[idx_field].d.astype("int64") + mask = np.in1d(newtags, indices, assume_unique=True) + sort = np.argsort(newtags[mask]) + array_indices = np.where(np.in1d(indices, newtags, assume_unique=True))[0] + self.array_indices.append(array_indices) + self.masks.append(mask) + self.sorts.append(sort) + + pfields = {} + for field in ("particle_position_%s" % ax for ax in "xyz"): + pfields[field] = dd[fds[field]].ndarray_view()[mask][sort] + + sto.result_id = ds.parameter_filename + sto.result = (ds.current_time, array_indices, pfields) + pbar.update(i) + pbar.finish() + + if self.suppress_logging: + mylog.setLevel(old_level) + + times = [] + for fn, (time, indices, pfields) in sorted(my_storage.items()): + times.append(time) + self.times = self.data_series[0].arr([time for time in times], times[0].units) + + self.particle_fields = [] + output_field = np.empty((self.num_indices, self.num_steps)) + output_field.fill(np.nan) + for field in ("particle_position_%s" % ax for ax in "xyz"): + for i, (fn, (time, indices, pfields)) in enumerate(sorted(my_storage.items())): + output_field[indices, i] = pfields[field] + self.field_data[field] = array_like_field( + dd_first, output_field.copy(), fds[field]) + self.particle_fields.append(field) + + # Instantiate fields the caller requested + self._get_data(fields) + + def has_key(self, key): + return (key in self.field_data) + + def keys(self): + return self.field_data.keys() + + def __getitem__(self, key): + """ + Get the field associated with key. + """ + if key == "particle_time": + return self.times + if key not in self.field_data: + self._get_data([key]) + return self.field_data[key] + + def __setitem__(self, key, val): + """ + Sets a field to be some other value. + """ + self.field_data[key] = val + + def __delitem__(self, key): + """ + Delete the field from the trajectory + """ + del self.field_data[key] + + def __iter__(self): + """ + This iterates over the trajectories for + the different particles, returning dicts + of fields for each trajectory + """ + for idx in range(self.num_indices): + traj = {} + traj["particle_index"] = self.indices[idx] + traj["particle_time"] = self.times + for field in self.field_data.keys(): + traj[field] = self[field][idx,:] + yield traj + + def __len__(self): + """ + The number of individual trajectories + """ + return self.num_indices + + def add_fields(self, fields): + """ + Add a list of fields to an existing trajectory + + Parameters + ---------- + fields : list of strings + A list of fields to be added to the current trajectory + collection. + + Examples + ________ + >>> trajs = ParticleTrajectories(my_fns, indices) + >>> trajs.add_fields(["particle_mass", "particle_gpot"]) + """ + self._get_data(fields) + + def _get_data(self, fields): + """ + Get a list of fields to include in the trajectory collection. + The trajectory collection itself is a dict of 2D numpy arrays, + with shape (num_indices, num_steps) + """ + + missing_fields = [field for field in fields + if field not in self.field_data] + if not missing_fields: + return + + if self.suppress_logging: + old_level = int(ytcfg.get("yt","loglevel")) + mylog.setLevel(40) + ds_first = self.data_series[0] + dd_first = ds_first.all_data() + + fds = {} + new_particle_fields = [] + for field in missing_fields: + fds[field] = dd_first._determine_fields(field)[0] + if field not in self.particle_fields: + if self.data_series[0]._get_field_info(*fds[field]).particle_type: + self.particle_fields.append(field) + new_particle_fields.append(field) + + + grid_fields = [field for field in missing_fields + if field not in self.particle_fields] + step = int(0) + pbar = get_pbar("Generating [%s] fields in trajectories" % + ", ".join(missing_fields), self.num_steps) + my_storage = {} + + for i, (sto, ds) in enumerate(self.data_series.piter(storage=my_storage)): + mask = self.masks[i] + sort = self.sorts[i] + pfield = {} + + if new_particle_fields: # there's at least one particle field + dd = ds.all_data() + for field in new_particle_fields: + # This is easy... just get the particle fields + pfield[field] = dd[fds[field]].d[mask][sort] + + if grid_fields: + # This is hard... must loop over grids + for field in grid_fields: + pfield[field] = np.zeros(self.num_indices) + x = self["particle_position_x"][:,step].d + y = self["particle_position_y"][:,step].d + z = self["particle_position_z"][:,step].d + particle_grids, particle_grid_inds = ds.index._find_points(x,y,z) + + # This will fail for non-grid index objects + for grid in particle_grids: + cube = grid.retrieve_ghost_zones(1, grid_fields) + for field in grid_fields: + CICSample_3(x, y, z, pfield[field], + self.num_indices, + cube[fds[field]], + np.array(grid.LeftEdge).astype(np.float64), + np.array(grid.ActiveDimensions).astype(np.int32), + grid.dds[0]) + sto.result_id = ds.parameter_filename + sto.result = (self.array_indices[i], pfield) + pbar.update(step) + step += 1 + pbar.finish() + + output_field = np.empty((self.num_indices,self.num_steps)) + output_field.fill(np.nan) + for field in missing_fields: + fd = fds[field] + for i, (fn, (indices, pfield)) in enumerate(sorted(my_storage.items())): + output_field[indices, i] = pfield[field] + self.field_data[field] = array_like_field(dd_first, output_field.copy(), fd) + + if self.suppress_logging: + mylog.setLevel(old_level) + + def trajectory_from_index(self, index): + """ + Retrieve a single trajectory corresponding to a specific particle + index + + Parameters + ---------- + index : int + This defines which particle trajectory from the + ParticleTrajectories object will be returned. + + Returns + ------- + A dictionary corresponding to the particle's trajectory and the + fields along that trajectory + + Examples + -------- + >>> from yt.mods import * + >>> import matplotlib.pylab as pl + >>> trajs = ParticleTrajectories(my_fns, indices) + >>> traj = trajs.trajectory_from_index(indices[0]) + >>> pl.plot(traj["particle_time"], traj["particle_position_x"], "-x") + >>> pl.savefig("orbit") + """ + mask = np.in1d(self.indices, (index,), assume_unique=True) + if not np.any(mask): + print("The particle index %d is not in the list!" % (index)) + raise IndexError + fields = [field for field in sorted(self.field_data.keys())] + traj = {} + traj["particle_time"] = self.times + traj["particle_index"] = index + for field in fields: + traj[field] = self[field][mask,:][0] + return traj + + @parallel_root_only + def write_out(self, filename_base): + """ + Write out particle trajectories to tab-separated ASCII files (one + for each trajectory) with the field names in the file header. Each + file is named with a basename and the index number. + + Parameters + ---------- + filename_base : string + The prefix for the outputted ASCII files. + + Examples + -------- + >>> trajs = ParticleTrajectories(my_fns, indices) + >>> trajs.write_out("orbit_trajectory") + """ + fields = [field for field in sorted(self.field_data.keys())] + num_fields = len(fields) + first_str = "# particle_time\t" + "\t".join(fields)+"\n" + template_str = "%g\t"*num_fields+"%g\n" + for ix in range(self.num_indices): + outlines = [first_str] + for it in range(self.num_steps): + outlines.append(template_str % + tuple([self.times[it]]+[self[field][ix,it] for field in fields])) + fid = open(filename_base + "_%d.dat" % self.indices[ix], "w") + fid.writelines(outlines) + fid.close() + del fid + + @parallel_root_only + def write_out_h5(self, filename): + """ + Write out all the particle trajectories to a single HDF5 file + that contains the indices, the times, and the 2D array for each + field individually + + Parameters + ---------- + + filename : string + The output filename for the HDF5 file + + Examples + -------- + >>> trajs = ParticleTrajectories(my_fns, indices) + >>> trajs.write_out_h5("orbit_trajectories") + """ + fid = h5py.File(filename, "w") + fid.create_dataset("particle_indices", dtype=np.int64, + data=self.indices) + fid.close() + self.times.write_hdf5(filename, dataset_name="particle_times") + fields = [field for field in sorted(self.field_data.keys())] + for field in fields: + self[field].write_hdf5(filename, dataset_name="%s" % field) diff -Nru yt-3.3.3/yt/data_objects/particle_unions.py yt-3.4.0/yt/data_objects/particle_unions.py --- yt-3.3.3/yt/data_objects/particle_unions.py 2016-10-25 16:08:30.000000000 +0000 +++ yt-3.4.0/yt/data_objects/particle_unions.py 2017-08-10 18:02:57.000000000 +0000 @@ -15,13 +15,8 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -from yt.funcs import ensure_list +from .unions import Union -class ParticleUnion(object): +class ParticleUnion(Union): def __init__(self, name, sub_types): - self.name = name - self.sub_types = ensure_list(sub_types) - - def __iter__(self): - for st in self.sub_types: - yield st + super(ParticleUnion, self).__init__(name, sub_types) diff -Nru yt-3.3.3/yt/data_objects/profiles.py yt-3.4.0/yt/data_objects/profiles.py --- yt-3.3.3/yt/data_objects/profiles.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/data_objects/profiles.py 2017-08-10 18:02:57.000000000 +0000 @@ -21,12 +21,14 @@ from yt.funcs import \ get_output_filename, \ ensure_list, \ - iterable + iterable, \ + issue_deprecation_warning, \ + mylog from yt.units.yt_array import \ array_like_field, \ YTQuantity from yt.units.unit_object import Unit -from yt.data_objects.data_containers import YTFieldData +from yt.data_objects.field_data import YTFieldData from yt.utilities.exceptions import \ YTIllDefinedProfile from yt.utilities.lib.misc_utilities import \ @@ -91,12 +93,22 @@ self.field_info = {} self.field_data = YTFieldData() if weight_field is not None: - self.variance = YTFieldData() + self.standard_deviation = YTFieldData() weight_field = self.data_source._determine_fields(weight_field)[0] + else: + self.standard_deviation = None self.weight_field = weight_field self.field_units = {} ParallelAnalysisInterface.__init__(self, comm=data_source.comm) + @property + def variance(self): + issue_deprecation_warning(""" +profile.variance incorrectly returns the profile standard deviation and has +been deprecated, use profile.standard_deviation instead.""" + ) + return self.standard_deviation + def add_fields(self, fields): """Add fields to profile @@ -153,13 +165,13 @@ all_val = np.zeros_like(temp_storage.values) all_mean = np.zeros_like(temp_storage.mvalues) - all_var = np.zeros_like(temp_storage.qvalues) + all_std = np.zeros_like(temp_storage.qvalues) all_weight = np.zeros_like(temp_storage.weight_values) all_used = np.zeros_like(temp_storage.used, dtype="bool") - # Combine the weighted mean and variance from each processor. - # For two samples with total weight, mean, and variance - # given by w, m, and s, their combined mean and variance are: + # Combine the weighted mean and standard deviation from each processor. + # For two samples with total weight, mean, and standard deviation + # given by w, m, and s, their combined mean and standard deviation are: # m12 = (m1 * w1 + m2 * w2) / (w1 + w2) # s12 = (m1 * (s1**2 + (m1 - m12)**2) + # m2 * (s2**2 + (m2 - m12)**2)) / (w1 + w2) @@ -180,8 +192,8 @@ all_store[p].weight_values)[all_store[p].used] / \ all_weight[all_store[p].used] - all_var[..., i][all_store[p].used] = \ - (old_weight * (all_var[..., i] + + all_std[..., i][all_store[p].used] = \ + (old_weight * (all_std[..., i] + (old_mean[..., i] - all_mean[..., i])**2) + all_store[p].weight_values * (all_store[p].qvalues[..., i] + @@ -189,7 +201,7 @@ all_mean[..., i])**2))[all_store[p].used] / \ all_weight[all_store[p].used] - all_var = np.sqrt(all_var) + all_std = np.sqrt(all_std) del all_store self.used = all_used blank = ~all_used @@ -206,10 +218,10 @@ self.field_data[field] = \ array_like_field(self.data_source, all_mean[...,i], field) - self.variance[field] = \ + self.standard_deviation[field] = \ array_like_field(self.data_source, - all_var[...,i], field) - self.variance[field][blank] = 0.0 + all_std[...,i], field) + self.standard_deviation[field][blank] = 0.0 self.field_data[field][blank] = 0.0 self.field_units[field] = self.field_data[field].units if isinstance(field, tuple): @@ -245,7 +257,7 @@ units = chunk.ds.field_info[self.weight_field].output_units weight_data = chunk[self.weight_field].in_units(units) else: - weight_data = np.ones(filter.size, dtype="float64") + weight_data = np.ones(filter.shape, dtype="float64") weight_data = weight_data[filter] # So that we can pass these into return arr, weight_data, bin_fields @@ -335,7 +347,8 @@ extra_attrs = {"data_type": "yt_profile", "profile_dimensions": self.size, "weight_field": self.weight_field, - "fractional": self.fractional} + "fractional": self.fractional, + "accumulation": self.accumulation} data = {} data.update(self.field_data) data["weight"] = self.weight @@ -374,6 +387,7 @@ def __init__(self, ds): ProfileND.__init__(self, ds.data, ds.parameters["weight_field"]) self.fractional = ds.parameters["fractional"] + self.accumulation = ds.parameters["accumulation"] exclude_fields = ["used", "weight"] for ax in "xyz"[:ds.dimensionality]: setattr(self, ax, ds.data[ax]) @@ -463,6 +477,14 @@ def bounds(self): return ((self.x_bins[0], self.x_bins[-1]),) + def plot(self): + r""" + This returns a :class:~yt.visualization.profile_plotter.ProfilePlot + with the fields that have been added to this object. + """ + from yt.visualization.profile_plotter import ProfilePlot + return ProfilePlot.from_profiles(self) + class Profile1DFromDataset(ProfileNDFromDataset, Profile1D): """ A 1D profile object loaded from a ytdata dataset. @@ -582,6 +604,14 @@ return ((self.x_bins[0], self.x_bins[-1]), (self.y_bins[0], self.y_bins[-1])) + def plot(self): + r""" + This returns a :class:~yt.visualization.profile_plotter.PhasePlot with + the fields that have been added to this object. + """ + from yt.visualization.profile_plotter import PhasePlot + return PhasePlot.from_profile(self) + class Profile2DFromDataset(ProfileNDFromDataset, Profile2D): """ A 2D profile object loaded from a ytdata dataset. @@ -634,33 +664,31 @@ fractional = False def __init__(self, data_source, - x_field, x_n, x_min, x_max, - y_field, y_n, y_min, y_max, + x_field, x_n, x_min, x_max, x_log, + y_field, y_n, y_min, y_max, y_log, weight_field=None, deposition="ngp"): x_field = data_source._determine_fields(x_field)[0] y_field = data_source._determine_fields(y_field)[0] + if deposition not in ['ngp', 'cic']: + raise NotImplementedError(deposition) + elif (x_log or y_log) and deposition != 'ngp': + mylog.warning('cic deposition is only supported for linear axis ' + 'scales, falling back to ngp deposition') + deposition = 'ngp' + + self.deposition = deposition + # set the log parameters to False (since that doesn't make much sense # for deposited data) and also turn off the weight field. super(ParticleProfile, self).__init__(data_source, x_field, - x_n, x_min, x_max, False, + x_n, x_min, x_max, x_log, y_field, - y_n, y_min, y_max, False, + y_n, y_min, y_max, y_log, weight_field=weight_field) - self.LeftEdge = [self.x_bins[0], self.y_bins[0]] - self.dx = (self.x_bins[-1] - self.x_bins[0]) / x_n - self.dy = (self.y_bins[-1] - self.y_bins[0]) / y_n - self.CellSize = [self.dx, self.dy] - self.CellVolume = np.product(self.CellSize) - self.GridDimensions = np.array([x_n, y_n], dtype=np.int32) - self.known_styles = ["ngp", "cic"] - if deposition not in self.known_styles: - raise NotImplementedError(deposition) - self.deposition = deposition - # Either stick the particle field in the nearest bin, # or spread it out using the 2D CIC deposition function def _bin_chunk(self, chunk, fields, storage): @@ -669,42 +697,31 @@ fdata, wdata, (bf_x, bf_y) = rv # make sure everything has the same units before deposition. # the units will be scaled to the correct values later. - LE = np.array([self.LeftEdge[0].in_units(bf_x.units), - self.LeftEdge[1].in_units(bf_y.units)]) - cell_size = np.array([self.CellSize[0].in_units(bf_x.units), - self.CellSize[1].in_units(bf_y.units)]) - for fi, field in enumerate(fields): - Np = fdata[:, fi].size - if self.deposition == "ngp": - func = NGPDeposit_2 - elif self.deposition == 'cic': - func = CICDeposit_2 + if self.deposition == "ngp": + func = NGPDeposit_2 + elif self.deposition == "cic": + func = CICDeposit_2 + for fi, field in enumerate(fields): if self.weight_field is None: deposit_vals = fdata[:, fi] else: deposit_vals = wdata*fdata[:, fi] - func(bf_x, bf_y, deposit_vals, Np, - storage.values[:, :, fi], - LE, - self.GridDimensions, - cell_size) + func(bf_x, bf_y, deposit_vals, fdata[:, fi].size, + storage.values[:, :, fi], self.x_bins, self.y_bins) - locs = storage.values[:, :, fi] > 0.0 + locs = storage.values[:, :, fi] != 0.0 storage.used[locs] = True if self.weight_field is not None: - func(bf_x, bf_y, wdata, Np, - storage.weight_values, - LE, - self.GridDimensions, - cell_size) + func(bf_x, bf_y, wdata, fdata[:, fi].size, + storage.weight_values, self.x_bins, self.y_bins) else: storage.weight_values[locs] = 1.0 - storage.mvalues[locs, fi] = storage.values[locs, fi] \ - / storage.weight_values[locs] + storage.mvalues[locs, fi] = \ + storage.values[locs, fi] / storage.weight_values[locs] # We've binned it! @@ -923,10 +940,12 @@ to n. If the profile is 2D or 3D, a list of values can be given to control the summation in each dimension independently. Default: False. - fractional : If True the profile values are divided by the sum of all + fractional : bool + If True the profile values are divided by the sum of all the profile data such that the profile represents a probability distribution function. - deposition : Controls the type of deposition used for ParticlePhasePlots. + deposition : strings + Controls the type of deposition used for ParticlePhasePlots. Valid choices are 'ngp' and 'cic'. Default is 'ngp'. This parameter is ignored the if the input fields are not of particle type. @@ -938,7 +957,7 @@ data from profile[]. >>> ds = load("DD0046/DD0046") - >>> ad = ds.h.all_data() + >>> ad = ds.all_data() >>> profile = create_profile(ad, [("gas", "density")], ... [("gas", "temperature"), ... ("gas", "velocity_x")]) @@ -956,18 +975,36 @@ is_pfield.append(wf.particle_type) wf = wf.name + if len(bin_fields) > 1 and isinstance(accumulation, bool): + accumulation = [accumulation for _ in range(len(bin_fields))] + + bin_fields = data_source._determine_fields(bin_fields) + fields = data_source._determine_fields(fields) + units = sanitize_field_tuple_keys(units, data_source) + extrema = sanitize_field_tuple_keys(extrema, data_source) + logs = sanitize_field_tuple_keys(logs, data_source) + if any(is_pfield) and not all(is_pfield): raise YTIllDefinedProfile( bin_fields, data_source._determine_fields(fields), wf, is_pfield) elif len(bin_fields) == 1: cls = Profile1D elif len(bin_fields) == 2 and all(is_pfield): - # log bin_fields set to False for Particle Profiles. - # doesn't make much sense for CIC deposition. - # accumulation and fractional set to False as well. - logs = {bin_fields[0]: False, bin_fields[1]: False} - accumulation = False - fractional = False + if deposition == 'cic': + if logs is not None: + if ((bin_fields[0] in logs and logs[bin_fields[0]]) or + (bin_fields[1] in logs and logs[bin_fields[1]])): + raise RuntimeError( + "CIC deposition is only implemented for linear-scaled " + "axes") + else: + logs = {bin_fields[0]: False, bin_fields[1]: False} + if any(accumulation) or fractional: + raise RuntimeError( + 'The accumulation and fractional keyword arguments must be ' + 'False for CIC deposition') + elif logs is None: + logs = {bin_fields[0]: False, bin_fields[1]: False} cls = ParticleProfile elif len(bin_fields) == 2: cls = Profile2D @@ -975,11 +1012,6 @@ cls = Profile3D else: raise NotImplementedError - bin_fields = data_source._determine_fields(bin_fields) - fields = data_source._determine_fields(fields) - units = sanitize_field_tuple_keys(units, data_source) - extrema = sanitize_field_tuple_keys(extrema, data_source) - logs = sanitize_field_tuple_keys(logs, data_source) if weight_field is not None and cls == ParticleProfile: weight_field, = data_source._determine_fields([weight_field]) if not data_source.ds._get_field_info(weight_field).particle_type: @@ -1013,12 +1045,36 @@ field_ex = list(extrema[bin_field[-1]]) except KeyError: field_ex = list(extrema[bin_field]) + if isinstance(field_ex[0], tuple): + field_ex = [data_source.ds.quan(*f) for f in field_ex] + if any([exi is None for exi in field_ex]): + try: + ds_extrema = data_source.quantities.extrema(bin_field) + except AttributeError: + # ytdata profile datasets don't have data_source.quantities + bf_vals = data_source[bin_field] + ds_extrema = data_source.ds.arr( + [bf_vals.min(), bf_vals.max()]) + for i, exi in enumerate(field_ex): + if exi is None: + field_ex[i] = ds_extrema[i] + # pad extrema by epsilon so cells at bin edges are + # not excluded + field_ex[i] -= (-1)**i*np.spacing(field_ex[i]) if units is not None and bin_field in units: - if isinstance(field_ex[0], tuple): - field_ex = [data_source.ds.quan(*f) for f in field_ex] - fe = data_source.ds.arr(field_ex, units[bin_field]) - fe.convert_to_units(bf_units) - field_ex = [fe[0].v, fe[1].v] + for i, exi in enumerate(field_ex): + if hasattr(exi, 'units'): + field_ex[i] = exi.to(units[bin_field]) + else: + field_ex[i] = data_source.ds.quan(exi, units[bin_field]) + fe = data_source.ds.arr(field_ex) + else: + if hasattr(field_ex, 'units'): + fe = field_ex.to(bf_units) + else: + fe = data_source.ds.arr(field_ex, bf_units) + fe.convert_to_units(bf_units) + field_ex = [fe[0].v, fe[1].v] if iterable(field_ex[0]): field_ex[0] = data_source.ds.quan(field_ex[0][0], field_ex[0][1]) field_ex[0] = field_ex[0].in_units(bf_units) @@ -1026,18 +1082,15 @@ field_ex[1] = data_source.ds.quan(field_ex[1][0], field_ex[1][1]) field_ex[1] = field_ex[1].in_units(bf_units) ex.append(field_ex) + args = [data_source] + for f, n, (mi, ma), l in zip(bin_fields, n_bins, ex, logs): + args += [f, n, mi, ma, l] + kwargs = dict(weight_field=weight_field) if cls is ParticleProfile: - args = [data_source] - for f, n, (mi, ma) in zip(bin_fields, n_bins, ex): - args += [f, n, mi, ma] - obj = cls(*args, weight_field=weight_field, deposition=deposition) - else: - args = [data_source] - for f, n, (mi, ma), l in zip(bin_fields, n_bins, ex, logs): - args += [f, n, mi, ma, l] - obj = cls(*args, weight_field = weight_field) - setattr(obj, "accumulation", accumulation) - setattr(obj, "fractional", fractional) + kwargs['deposition'] = deposition + obj = cls(*args, **kwargs) + setattr(obj, "accumulation", accumulation) + setattr(obj, "fractional", fractional) if fields is not None: obj.add_fields([field for field in fields]) for field in fields: diff -Nru yt-3.3.3/yt/data_objects/region_expression.py yt-3.4.0/yt/data_objects/region_expression.py --- yt-3.3.3/yt/data_objects/region_expression.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/region_expression.py 2017-08-10 18:02:57.000000000 +0000 @@ -14,7 +14,10 @@ import weakref from yt.extern.six import string_types +from yt.funcs import obj_length +from yt.units.yt_array import YTQuantity from yt.utilities.exceptions import YTDimensionalityError +from yt.visualization.line_plot import LineBuffer class RegionExpression(object): _all_data = None @@ -38,10 +41,22 @@ if isinstance(item, tuple) and isinstance(item[1], string_types): return self.all_data[item] if isinstance(item, slice): - item = (item, item, item) + if obj_length(item.start) == 3 and obj_length(item.stop) == 3: + # This is for a ray that is not orthogonal to an axis. + # it's straightforward to do this, so we create a ray + # and drop out here. + return self._create_ray(item) + else: + # This is for the case where we give a slice as an index; one + # possible use case of this would be where we supply something + # like ds.r[::256j] . This would be expanded, implicitly into + # ds.r[::256j, ::256j, ::256j]. Other cases would be if we do + # ds.r[0.1:0.9] where it will be expanded along three dimensions. + item = (item, item, item) if len(item) != self.ds.dimensionality: # Not the right specification, and we don't want to do anything - # implicitly. + # implicitly. Note that this happens *after* the implicit expansion + # of a single slice. raise YTDimensionalityError(len(item), self.ds.dimensionality) if self.ds.dimensionality != 3: # We'll pass on this for the time being. @@ -49,23 +64,32 @@ # OK, now we need to look at our slices. How many are a specific # coordinate? - - if not all(isinstance(v, slice) for v in item): + + nslices = sum(isinstance(v, slice) for v in item) + if nslices == 0: + return self._create_point(item) + elif nslices == 1: + return self._create_ortho_ray(item) + elif nslices == 2: return self._create_slice(item) else: if all(s.start is s.stop is s.step is None for s in item): return self.all_data return self._create_region(item) - - def _spec_to_value(self, input_tuple): - if not isinstance(input_tuple, tuple): - # We now assume that it's in code_length - return self.ds.quan(input_tuple, 'code_length') - v, u = input_tuple - value = self.ds.quan(v, u) - return value + + def _spec_to_value(self, input): + if isinstance(input, tuple): + v = self.ds.quan(input[0], input[1]).to("code_length") + elif isinstance(input, YTQuantity): + v = self.ds.quan(input).to('code_length') + else: + v = self.ds.quan(input, "code_length") + return v def _create_slice(self, slice_tuple): + # This is somewhat more complex because we want to allow for slicing + # in one dimension but also *not* using the entire domain; for instance + # this means we allow something like ds.r[0.5, 0.1:0.4, 0.1:0.4]. axis = None new_slice = [] for ax, v in enumerate(slice_tuple): @@ -79,6 +103,23 @@ # This new slice doesn't need to be a tuple source = self._create_region(new_slice) sl = self.ds.slice(axis, coord, data_source = source) + # Now, there's the possibility that what we're also seeing here + # includes some steps, which would be for getting back a fixed + # resolution buffer. We check for that by checking if we have + # exactly two imaginary steps. + xax = self.ds.coordinates.x_axis[axis] + yax = self.ds.coordinates.y_axis[axis] + if getattr(new_slice[xax].step, "imag", 0.0) != 0.0 and \ + getattr(new_slice[yax].step, "imag", 0.0) != 0.0: + # We now need to convert to a fixed res buffer. + # We'll do this by getting the x/y axes, and then using that. + width = source.right_edge[xax] - source.left_edge[xax] + height = source.right_edge[yax] - source.left_edge[yax] + # Make a resolution tuple with + resolution = (int(new_slice[xax].step.imag), + int(new_slice[yax].step.imag)) + sl = sl.to_frb(width = width, resolution = resolution, + height = height) return sl def _slice_to_edges(self, ax, val): @@ -107,3 +148,51 @@ if all(d is not None for d in dims): return self.ds.arbitrary_grid(left_edge, right_edge, dims) return self.ds.region(center, left_edge, right_edge) + + def _create_point(self, point_tuple): + coord = [self._spec_to_value(p) for p in point_tuple] + return self.ds.point(coord) + + def _create_ray(self, ray_slice): + start_point = [self._spec_to_value(v) for v in ray_slice.start] + end_point = [self._spec_to_value(v) for v in ray_slice.stop] + if getattr(ray_slice.step, "imag", 0.0) != 0.0: + return LineBuffer(self.ds, start_point, end_point, + int(ray_slice.step.imag)) + else: + return self.ds.ray(start_point, end_point) + + def _create_ortho_ray(self, ray_tuple): + axis = None + new_slice = [] + coord = [] + npoints = 0 + start_point = [] + end_point = [] + for ax, v in enumerate(ray_tuple): + if not isinstance(v, slice): + val = self._spec_to_value(v) + coord.append(val) + new_slice.append(slice(None, None, None)) + start_point.append(val) + end_point.append(val) + else: + if axis is not None: raise RuntimeError + if getattr(v.step, "imag", 0.0) != 0.0: + npoints = int(v.step.imag) + xi = self._spec_to_value(v.start) + xf = self._spec_to_value(v.stop) + dx = (xf-xi)/npoints + start_point.append(xi+0.5*dx) + end_point.append(xf-0.5*dx) + else: + axis = ax + new_slice.append(v) + if npoints > 0: + ray = LineBuffer(self.ds, start_point, end_point, npoints) + else: + if axis == 1: + coord = [coord[1], coord[0]] + source = self._create_region(new_slice) + ray = self.ds.ortho_ray(axis, coord, data_source=source) + return ray \ No newline at end of file diff -Nru yt-3.3.3/yt/data_objects/selection_data_containers.py yt-3.4.0/yt/data_objects/selection_data_containers.py --- yt-3.3.3/yt/data_objects/selection_data_containers.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/data_objects/selection_data_containers.py 2017-08-10 18:02:57.000000000 +0000 @@ -23,11 +23,13 @@ ensure_list, \ iterable, \ validate_width_tuple, \ - fix_length + fix_length, \ + fix_axis from yt.geometry.selection_routines import \ points_in_cells from yt.units.yt_array import \ - YTArray + YTArray, \ + YTQuantity from yt.utilities.exceptions import \ YTSphereTooSmall, \ YTIllDefinedCutRegion, \ @@ -49,7 +51,7 @@ periodic its position will be corrected to lie inside the range [DLE,DRE) to ensure one and only one cell may match that point - ds: Dataset, optional + ds: ~yt.data_objects.static_output.Dataset, optional An optional dataset to use rather than self.ds field_parameters : dictionary A dictionary of field parameters than can be accessed by derived @@ -88,14 +90,14 @@ Parameters ---------- - axis : int - The axis along which to cast the ray. Can be 0, 1, or 2 for x, y, z. + axis : int or char + The axis along which to slice. Can be 0, 1, or 2 for x, y, z. coords : tuple of floats The (plane_x, plane_y) coordinates at which to cast the ray. Note that this is in the plane coordinates: so if you are casting along x, this will be (y, z). If you are casting along y, this will be (z, x). If you are casting along z, this will be (x, y). - ds: Dataset, optional + ds: ~yt.data_objects.static_output.Dataset, optional An optional dataset to use rather than self.ds field_parameters : dictionary A dictionary of field parameters than can be accessed by derived @@ -129,7 +131,7 @@ def __init__(self, axis, coords, ds=None, field_parameters=None, data_source=None): super(YTOrthoRay, self).__init__(ds, field_parameters, data_source) - self.axis = axis + self.axis = fix_axis(axis, self.ds) xax = self.ds.coordinates.x_axis[self.axis] yax = self.ds.coordinates.y_axis[self.axis] self.px_ax = xax @@ -137,7 +139,15 @@ # Even though we may not be using x,y,z we use them here. self.px_dx = 'd%s'%('xyz'[self.px_ax]) self.py_dx = 'd%s'%('xyz'[self.py_ax]) - self.px, self.py = coords + # Convert coordinates to code length. + if isinstance(coords[0], YTQuantity): + self.px = self.ds.quan(coords[0]).to("code_length") + else: + self.px = self.ds.quan(coords[0], "code_length") + if isinstance(coords[1], YTQuantity): + self.py = self.ds.quan(coords[1]).to("code_length") + else: + self.py = self.ds.quan(coords[1], "code_length") self.sort_by = 'xyz'[self.axis] @property @@ -162,7 +172,7 @@ The place where the ray starts. end_point : array-like set of 3 floats The place where the ray ends. - ds: Dataset, optional + ds: ~yt.data_objects.static_output.Dataset, optional An optional dataset to use rather than self.ds field_parameters : dictionary A dictionary of field parameters than can be accessed by derived @@ -248,7 +258,7 @@ center : array_like, optional The 'center' supplied to fields that use it. Note that this does not have to have `coord` as one value. optional. - ds: Dataset, optional + ds: ~yt.data_objects.static_output.Dataset, optional An optional dataset to use rather than self.ds field_parameters : dictionary A dictionary of field parameters than can be accessed by derived @@ -268,7 +278,7 @@ _top_node = "/Slices" _type_name = "slice" _con_args = ('axis', 'coord') - _container_fields = ("px", "py", "pdx", "pdy") + _container_fields = ("px", "py", "pz", "pdx", "pdy", "pdz") def __init__(self, axis, coord, center=None, ds=None, field_parameters=None, data_source=None): YTSelectionContainer2D.__init__(self, axis, ds, @@ -285,10 +295,14 @@ return self._current_chunk.fcoords[:,xax] elif field == "py": return self._current_chunk.fcoords[:,yax] + elif field == "pz": + return self._current_chunk.fcoords[:,self.axis] elif field == "pdx": return self._current_chunk.fwidth[:,xax] * 0.5 elif field == "pdy": return self._current_chunk.fwidth[:,yax] * 0.5 + elif field == "pdz": + return self._current_chunk.fwidth[:,self.axis] * 0.5 else: raise KeyError(field) @@ -351,7 +365,7 @@ north_vector: array_like, optional An optional vector to describe the north-facing direction in the resulting plane. - ds: Dataset, optional + ds: ~yt.data_objects.static_output.Dataset, optional An optional dataset to use rather than self.ds field_parameters : dictionary A dictionary of field parameters than can be accessed by derived @@ -463,12 +477,12 @@ self.fields = ensure_list(fields) + [k for k in self.field_data.keys() if k not in self._key_fields] from yt.visualization.plot_window import get_oblique_window_parameters, PWViewerMPL - from yt.visualization.fixed_resolution import ObliqueFixedResolutionBuffer + from yt.visualization.fixed_resolution import FixedResolutionBuffer (bounds, center_rot) = get_oblique_window_parameters(normal, center, width, self.ds) pw = PWViewerMPL( self, bounds, fields=self.fields, origin='center-window', periodic=False, oblique=True, - frb_generator=ObliqueFixedResolutionBuffer, + frb_generator=FixedResolutionBuffer, plot_type='OffAxisSlice') if axes_unit is not None: pw.set_axes_unit(axes_unit) @@ -476,8 +490,8 @@ return pw def to_frb(self, width, resolution, height=None, periodic=False): - r"""This function returns an ObliqueFixedResolutionBuffer generated - from this object. + r"""This function returns a FixedResolutionBuffer generated from this + object. An ObliqueFixedResolutionBuffer is an object that accepts a variable-resolution 2D object and transforms it into an NxM bitmap that @@ -526,9 +540,9 @@ height = self.ds.quan(height[0], height[1]) if not iterable(resolution): resolution = (resolution, resolution) - from yt.visualization.fixed_resolution import ObliqueFixedResolutionBuffer + from yt.visualization.fixed_resolution import FixedResolutionBuffer bounds = (-width/2.0, width/2.0, -height/2.0, height/2.0) - frb = ObliqueFixedResolutionBuffer(self, bounds, resolution, + frb = FixedResolutionBuffer(self, bounds, resolution, periodic=periodic) return frb @@ -552,7 +566,7 @@ bottom planes fields : array of fields, optional any fields to be pre-loaded in the cylinder object - ds: Dataset, optional + ds: ~yt.data_objects.static_output.Dataset, optional An optional dataset to use rather than self.ds field_parameters : dictionary A dictionary of field parameters than can be accessed by derived @@ -609,11 +623,13 @@ if not isinstance(left_edge, YTArray): self.left_edge = self.ds.arr(left_edge, 'code_length') else: - self.left_edge = left_edge + # need to assign this dataset's unit registry to the YTArray + self.left_edge = self.ds.arr(left_edge.copy()) if not isinstance(right_edge, YTArray): self.right_edge = self.ds.arr(right_edge, 'code_length') else: - self.right_edge = right_edge + # need to assign this dataset's unit registry to the YTArray + self.right_edge = self.ds.arr(right_edge.copy()) class YTDataCollection(YTSelectionContainer3D): """ @@ -783,6 +799,7 @@ self.conditionals = ensure_list(conditionals) self.base_object = data_source self._selector = None + self._particle_mask = {} # Need to interpose for __getitem__, fwidth, fcoords, icoords, iwidth, # ires and get_data @@ -805,7 +822,8 @@ f = self.base_object[field] if f.shape != ind.shape: parent = getattr(self, "parent", self.base_object) - self.field_data[field] = parent[field][self._part_ind] + self.field_data[field] = \ + parent[field][self._part_ind(field[0])] else: self.field_data[field] = self.base_object[field][ind] @@ -835,21 +853,22 @@ np.logical_and(res, ind, ind) return ind - _particle_mask = None - @property - def _part_ind(self): - if self._particle_mask is None: + def _part_ind(self, ptype): + if self._particle_mask.get(ptype) is None: parent = getattr(self, "parent", self.base_object) units = "code_length" mask = points_in_cells( - self["x"].to(units), self["y"].to(units), - self["z"].to(units), self["dx"].to(units), - self["dy"].to(units), self["dz"].to(units), - parent["particle_position_x"].to(units), - parent["particle_position_y"].to(units), - parent["particle_position_z"].to(units)) - self._particle_mask = mask - return self._particle_mask + self[("index", "x")].to(units), + self[("index", "y")].to(units), + self[("index", "z")].to(units), + self[("index", "dx")].to(units), + self[("index", "dy")].to(units), + self[("index", "dz")].to(units), + parent[(ptype, "particle_position_x")].to(units), + parent[(ptype, "particle_position_y")].to(units), + parent[(ptype, "particle_position_z")].to(units)) + self._particle_mask[ptype] = mask + return self._particle_mask[ptype] @property def icoords(self): @@ -866,3 +885,75 @@ @property def fwidth(self): return self.base_object.fwidth[self._cond_ind,:] + +class YTIntersectionContainer3D(YTSelectionContainer3D): + """ + This is a more efficient method of selecting the intersection of multiple + data selection objects. + + Creating one of these objects returns the intersection of all of the + sub-objects; it is designed to be a faster method than chaining & ("and") + operations to create a single, large intersection. + + Parameters + ---------- + data_objects : Iterable of YTSelectionContainer3D + The data objects to intersect + + Examples + -------- + + >>> import yt + >>> ds = yt.load("RedshiftOutput0005") + >>> sp1 = ds.sphere((0.4, 0.5, 0.6), 0.15) + >>> sp2 = ds.sphere((0.38, 0.51, 0.55), 0.1) + >>> sp3 = ds.sphere((0.35, 0.5, 0.6), 0.15) + >>> new_obj = ds.intersection((sp1, sp2, sp3)) + >>> print(new_obj.sum("cell_volume")) + """ + _type_name = "intersection" + _con_args = ("data_objects",) + def __init__(self, data_objects, ds = None, field_parameters = None, + data_source = None): + YTSelectionContainer3D.__init__(self, None, ds, field_parameters, + data_source) + # ensure_list doesn't check for tuples + if isinstance(data_objects, tuple): + data_objects = list(data_objects) + self.data_objects = ensure_list(data_objects) + +class YTDataObjectUnion(YTSelectionContainer3D): + """ + This is a more efficient method of selecting the union of multiple + data selection objects. + + Creating one of these objects returns the union of all of the sub-objects; + it is designed to be a faster method than chaining | (or) operations to + create a single, large union. + + Parameters + ---------- + data_objects : Iterable of YTSelectionContainer3D + The data objects to union + + Examples + -------- + + >>> import yt + >>> ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") + >>> sp1 = ds.sphere((0.4, 0.5, 0.6), 0.1) + >>> sp2 = ds.sphere((0.3, 0.5, 0.15), 0.1) + >>> sp3 = ds.sphere((0.5, 0.5, 0.9), 0.1) + >>> new_obj = ds.union((sp1, sp2, sp3)) + >>> print(new_obj.sum("cell_volume")) + """ + _type_name = "union" + _con_args = ("data_objects",) + def __init__(self, data_objects, ds = None, field_parameters = None, + data_source = None): + YTSelectionContainer3D.__init__(self, None, ds, field_parameters, + data_source) + # ensure_list doesn't check for tuples + if isinstance(data_objects, tuple): + data_objects = list(data_objects) + self.data_objects = ensure_list(data_objects) diff -Nru yt-3.3.3/yt/data_objects/static_output.py yt-3.4.0/yt/data_objects/static_output.py --- yt-3.3.3/yt/data_objects/static_output.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/data_objects/static_output.py 2017-08-10 18:02:57.000000000 +0000 @@ -20,6 +20,7 @@ import os import time import weakref +import warnings from collections import defaultdict from yt.extern.six import add_metaclass, string_types @@ -36,7 +37,8 @@ from yt.utilities.exceptions import \ YTObjectNotImplemented, \ YTFieldNotFound, \ - YTGeometryNotSupported + YTGeometryNotSupported, \ + YTIllDefinedParticleFilter from yt.utilities.parallel_tools.parallel_analysis_interface import \ parallel_root_only from yt.utilities.parameter_file_storage import \ @@ -44,7 +46,8 @@ NoParameterShelf, \ output_type_registry from yt.units.dimensions import current_mks -from yt.units.unit_object import Unit, unit_system_registry +from yt.units.unit_object import Unit, unit_system_registry, \ + _define_unit from yt.units.unit_registry import UnitRegistry from yt.fields.derived_field import \ ValidateSpatial @@ -105,8 +108,32 @@ return self.__getattribute__(attr) return fnc + _field_types = None + @property + def field_types(self): + if self._field_types is None: + self._field_types = set(t for t, n in self.ds.field_info) + return self._field_types + def __dir__(self): - return list(set(t for t, n in self.ds.field_info)) + return list(self.field_types) + + def __iter__(self): + for ft in self.field_types: + fnc = FieldNameContainer(self.ds, ft) + if len(dir(fnc)) == 0: + yield self.__getattribute__(ft) + else: + yield fnc + + def __contains__(self, obj): + ob = None + if isinstance(obj, FieldNameContainer): + ob = obj.field_type + elif isinstance(obj, string_types): + ob = obj + + return ob in self.field_types class FieldNameContainer(object): def __init__(self, ds, field_type): @@ -124,6 +151,26 @@ return [n for t, n in self.ds.field_info if t == self.field_type] + def __iter__(self): + for t, n in self.ds.field_info: + if t == self.field_type: + yield self.ds.field_info[t, n] + + def __contains__(self, obj): + if isinstance(obj, DerivedField): + if self.field_type == obj.name[0] and obj.name in self.ds.field_info: + # e.g. from a completely different dataset + if self.ds.field_info[obj.name] is not obj: + return False + return True + elif isinstance(obj, tuple): + if self.field_type == obj[0] and obj in self.ds.field_info: + return True + elif isinstance(obj, string_types): + if (self.field_type, obj) in self.ds.field_info: + return True + return False + class IndexProxy(object): # This is a simple proxy for Index objects. It enables backwards # compatibility so that operations like .h.sphere, .h.print_stats and @@ -148,6 +195,8 @@ self.data = weakref.WeakKeyDictionary() def __get__(self, instance, owner): + if not instance: + return None ret = self.data.get(instance, None) try: ret = ret.copy() @@ -182,7 +231,6 @@ particle_types_raw = ("io",) geometry = "cartesian" coordinates = None - max_level = 99 storage_filename = None particle_unions = None known_filters = None @@ -214,7 +262,7 @@ obj = _cached_datasets[apath] return obj - def __init__(self, filename, dataset_type=None, file_style=None, + def __init__(self, filename, dataset_type=None, file_style=None, units_override=None, unit_system="cgs"): """ Base class for generating new output types. Principally consists of @@ -255,16 +303,9 @@ self._create_unit_registry() - create_code_unit_system(self) - if unit_system == "code": - unit_system = str(self) - else: - unit_system = str(unit_system).lower() - - self.unit_system = unit_system_registry[unit_system] - self._parse_parameter_file() self.set_units() + self._assign_unit_system(unit_system) self._setup_coordinate_handler() # Because we need an instantiated class to check the ds's existence in @@ -291,8 +332,9 @@ for attr in ("center", "width", "left_edge", "right_edge"): n = "domain_%s" % attr v = getattr(self, n) - v = self.arr(v, "code_length") - setattr(self, n, v) + if not isinstance(v, YTArray): + v = self.arr(v, "code_length") + setattr(self, n, v) def __reduce__(self): args = (self._hash(),) @@ -309,6 +351,49 @@ return hashlib.md5(s.encode('utf-8')).hexdigest() except ImportError: return s.replace(";", "*") + + _checksum = None + @property + def checksum(self): + ''' + Computes md5 sum of a dataset. + + Note: Currently this property is unable to determine a complete set of + files that are a part of a given dataset. As a first approximation, the + checksum of :py:attr:`~parameter_file` is calculated. In case + :py:attr:`~parameter_file` is a directory, checksum of all files inside + the directory is calculated. + ''' + if self._checksum is None: + try: + import hashlib + except ImportError: + self._checksum = 'nohashlib' + return self._checksum + + def generate_file_md5(m, filename, blocksize=2**20): + with open(filename , "rb") as f: + while True: + buf = f.read(blocksize) + if not buf: + break + m.update(buf) + + m = hashlib.md5() + if os.path.isdir(self.parameter_filename): + for root, _, files in os.walk(self.parameter_filename): + for fname in files: + fname = os.path.join(root, fname) + generate_file_md5(m, fname) + elif os.path.isfile(self.parameter_filename): + generate_file_md5(m, self.parameter_filename) + else: + m = 'notafile' + + if hasattr(m, 'hexdigest'): + m = m.hexdigest() + self._checksum = m + return self._checksum domain_left_edge = MutableAttribute() domain_right_edge = MutableAttribute() @@ -338,7 +423,7 @@ in that directory, and a list of subdirectories. It should return a list of filenames (defined relative to the supplied directory) and a boolean as to whether or not further directories should be recursed. - + This function doesn't need to catch all possibilities, nor does it need to filter possibilities. """ @@ -483,6 +568,7 @@ self.field_dependencies.update(deps) self.fields = FieldTypeContainer(self) self.index.field_list = sorted(self.field_list) + self._last_freq = (None, None) def setup_deprecated_fields(self): from yt.fields.field_aliases import _field_name_aliases @@ -590,7 +676,8 @@ def _setup_filtered_type(self, filter): if not filter.available(self.derived_field_list): - return False + raise YTIllDefinedParticleFilter( + filter, filter.missing(self.derived_field_list)) fi = self.field_info fd = self.field_dependencies available = False @@ -678,7 +765,7 @@ cname = cls.__name__ if cname.endswith("Base"): cname = cname[:-4] self._add_object_class(name, cls) - if self.refine_by != 2 and hasattr(self, 'proj') and \ + if not np.all(self.refine_by == 2) and hasattr(self, 'proj') and \ hasattr(self, 'overlap_proj'): mylog.warning("Refine by something other than two: reverting to" + " overlap_proj") @@ -785,9 +872,9 @@ # list or other non-array iterable before calculating # the center if not isinstance(left_edge, np.ndarray): - left_edge = np.array(left_edge) + left_edge = np.array(left_edge, dtype='float64') if not isinstance(right_edge, np.ndarray): - right_edge = np.array(right_edge) + right_edge = np.array(right_edge, dtype='float64') c = (left_edge + right_edge)/2.0 return self.region(c, left_edge, right_edge, **kwargs) @@ -835,6 +922,29 @@ def relative_refinement(self, l0, l1): return self.refine_by**(l1-l0) + def _assign_unit_system(self, unit_system): + current_mks_unit = None + magnetic_unit = getattr(self, 'magnetic_unit', None) + if magnetic_unit is not None: + # if the magnetic unit is in T, we need to create the code unit + # system as an MKS-like system + if current_mks in self.magnetic_unit.units.dimensions.free_symbols: + if unit_system == "code": + current_mks_unit = 'A' + elif unit_system == 'mks': + pass + else: + self.magnetic_unit = \ + self.magnetic_unit.to_equivalent('gauss', 'CGS') + self.unit_registry.modify("code_magnetic", self.magnetic_unit) + create_code_unit_system(self.unit_registry, + current_mks_unit=current_mks_unit) + if unit_system == "code": + unit_system = self.unit_registry.unit_system_id + else: + unit_system = str(unit_system).lower() + self.unit_system = unit_system_registry[unit_system] + def _create_unit_registry(self): self.unit_registry = UnitRegistry() import yt.units.dimensions as dimensions @@ -871,10 +981,18 @@ if getattr(self, "cosmological_simulation", False): # this dataset is cosmological, add a cosmology object + + # Set dynamical dark energy parameters + use_dark_factor = getattr(self, 'use_dark_factor', False) + w_0 = getattr(self, 'w_0', -1.0) + w_a = getattr(self, 'w_a', 0.0) + self.cosmology = \ Cosmology(hubble_constant=self.hubble_constant, omega_matter=self.omega_matter, - omega_lambda=self.omega_lambda) + omega_lambda=self.omega_lambda, + use_dark_factor = use_dark_factor, + w_0 = w_0, w_a = w_a) self.critical_density = \ self.cosmology.critical_density(self.current_redshift) self.scale_factor = 1.0 / (1.0 + self.current_redshift) @@ -903,21 +1021,6 @@ self.unit_registry.modify("code_length", self.length_unit) self.unit_registry.modify("code_mass", self.mass_unit) self.unit_registry.modify("code_time", self.time_unit) - if hasattr(self, 'magnetic_unit'): - # if the magnetic unit is in T, we need to recreate the code unit - # system as an MKS-like system - if current_mks in self.magnetic_unit.units.dimensions.free_symbols: - - if self.unit_system == unit_system_registry[str(self)]: - unit_system_registry.pop(str(self)) - create_code_unit_system(self, current_mks_unit='A') - self.unit_system = unit_system_registry[str(self)] - elif str(self.unit_system) == 'mks': - pass - else: - self.magnetic_unit = \ - self.magnetic_unit.to_equivalent('gauss', 'CGS') - self.unit_registry.modify("code_magnetic", self.magnetic_unit) vel_unit = getattr( self, "velocity_unit", self.length_unit / self.time_unit) pressure_unit = getattr( @@ -940,11 +1043,10 @@ if len(self.units_override) == 0: return mylog.warning( - "Overriding code units. This is an experimental and potentially " - "dangerous option that may yield inconsistent results, and must be " - "used very carefully, and only if you know what you want from it.") + "Overriding code units: Use this option only if you know that the " + "dataset doesn't define the units correctly or at all.") for unit, cgs in [("length", "cm"), ("time", "s"), ("mass", "g"), - ("velocity","cm/s"), ("magnetic","gauss"), + ("velocity","cm/s"), ("magnetic","gauss"), ("temperature","K")]: val = self.units_override.get("%s_unit" % unit, None) if val is not None: @@ -966,7 +1068,7 @@ Parameters ---------- - input_array : iterable + input_array : Iterable A tuple, list, or array to attach units to input_units : String unit specification, unit symbol or astropy object The units of the array. Powers must be specified using python syntax @@ -1047,7 +1149,7 @@ self._quan = functools.partial(YTQuantity, registry=self.unit_registry) return self._quan - def add_field(self, name, function=None, **kwargs): + def add_field(self, name, function=None, sampling_type=None, **kwargs): """ Dataset-specific call to add_field @@ -1077,15 +1179,32 @@ Describes the dimensionality of the field. Currently unused. display_name : str A name used in the plots + force_override : bool + Whether to override an existing derived field. Does not work with + on-disk fields. """ self.index override = kwargs.get("force_override", False) + if override and name in self.index.field_list: + raise RuntimeError("force_override is only meant to be used with " + "derived fields, not on-disk fields.") # Handle the case where the field has already been added. if not override and name in self.field_info: mylog.warning("Field %s already exists. To override use " + "force_override=True.", name) - self.field_info.add_field(name, function=function, **kwargs) + if kwargs.setdefault('particle_type', False): + if sampling_type is not None and sampling_type != "particle": + raise RuntimeError("Clashing definition of 'sampling_type' and " + "'particle_type'. Note that 'particle_type' is " + "deprecated. Please just use 'sampling_type'.") + else: + sampling_type = "particle" + if sampling_type is None: + warnings.warn("Because 'sampling_type' not specified, yt will " + "assume a cell 'sampling_type'", stacklevel=2) + sampling_type = "cell" + self.field_info.add_field(name, sampling_type, function=function, **kwargs) self.field_info._show_field_errors.append(name) deps, _ = self.field_info.check_derived_fields([name]) self.field_dependencies.update(deps) @@ -1148,28 +1267,29 @@ Create a grid field for particle quantities using given method. """ pos = data[ptype, "particle_position"] + fields = [data[ptype, deposit_field]] + if method == 'weighted_mean': + fields.append(data[ptype, weight_field]) + fields = [np.ascontiguousarray(f) for f in fields] + d = data.deposit(pos, fields, method=method, + kernel_name=kernel_name) + d = data.ds.arr(d, input_units=units) if method == 'weighted_mean': - d = data.ds.arr(data.deposit(pos, [data[ptype, deposit_field], - data[ptype, weight_field]], - method=method, kernel_name=kernel_name), - input_units=units) d[np.isnan(d)] = 0.0 - else: - d = data.ds.arr(data.deposit(pos, [data[ptype, deposit_field]], - method=method, kernel_name=kernel_name), - input_units=units) return d self.add_field( ("deposit", field_name), function=_deposit_field, + sampling_type="cell", units=units, take_log=take_log, validators=[ValidateSpatial()]) return ("deposit", field_name) - def add_smoothed_particle_field(self, smooth_field, method="volume_weighted", - nneighbors=64, kernel_name="cubic"): + def add_smoothed_particle_field(self, smooth_field, + method="volume_weighted", nneighbors=64, + kernel_name="cubic"): """Add a new smoothed particle field Creates a new smoothed field based on the particle *smooth_field*. @@ -1186,7 +1306,7 @@ for now. nneighbors : int, default 64 The number of neighbors to examine during the process. - kernel_name : string, default 'cubic' + kernel_name : string, default `cubic` This is the name of the smoothing kernel to use. Current supported kernel names include `cubic`, `quartic`, `quintic`, `wendland2`, `wendland4`, and `wendland6`. @@ -1196,7 +1316,10 @@ The field name tuple for the newly created field. """ + # The magical step self.index + + # Parse arguments if isinstance(smooth_field, tuple): ptype, smooth_field = smooth_field[0], smooth_field[1] else: @@ -1205,6 +1328,7 @@ if method != "volume_weighted": raise NotImplementedError("method must be 'volume_weighted'") + # Prepare field names and registry to be used later coord_name = "particle_position" mass_name = "particle_mass" smoothing_length_name = "smoothing_length" @@ -1214,6 +1338,7 @@ density_name = "density" registry = self.field_info + # Do the actual work return add_volume_weighted_smoothed_field(ptype, coord_name, mass_name, smoothing_length_name, density_name, smooth_field, registry, nneighbors=nneighbors, kernel_name=kernel_name)[0] @@ -1262,6 +1387,46 @@ self.field_dependencies.update(deps) return grad_fields + _max_level = None + @property + def max_level(self): + if self._max_level is None: + self._max_level = self.index.max_level + + return self._max_level + + @max_level.setter + def max_level(self, value): + self._max_level = value + + def define_unit(self, symbol, value, tex_repr=None, offset=None, prefixable=False): + """ + Define a new unit and add it to the dataset's unit registry. + + Parameters + ---------- + symbol : string + The symbol for the new unit. + value : tuple or ~yt.units.yt_array.YTQuantity + The definition of the new unit in terms of some other units. For example, + one would define a new "mph" unit with (1.0, "mile/hr") + tex_repr : string, optional + The LaTeX representation of the new unit. If one is not supplied, it will + be generated automatically based on the symbol string. + offset : float, optional + The default offset for the unit. If not set, an offset of 0 is assumed. + prefixable : bool, optional + Whether or not the new unit can use SI prefixes. Default: False + + Examples + -------- + >>> ds.define_unit("mph", (1.0, "mile/hr")) + >>> two_weeks = YTQuantity(14.0, "days") + >>> ds.define_unit("fortnight", two_weeks) + """ + _define_unit(self.unit_registry, symbol, value, tex_repr=tex_repr, + offset=offset, prefixable=prefixable) + def _reconstruct_ds(*args, **kwargs): datasets = ParameterFileStore() ds = datasets.get_ds_hash(*args) @@ -1286,3 +1451,17 @@ def __lt__(self, other): return self.filename < other.filename + + +class ParticleDataset(Dataset): + _unit_base = None + filter_bbox = False + + def __init__(self, filename, dataset_type=None, file_style=None, + units_override=None, unit_system="cgs", + n_ref=64, over_refine_factor=1): + self.n_ref = n_ref + self.over_refine_factor = over_refine_factor + super(ParticleDataset, self).__init__( + filename, dataset_type=dataset_type, file_style=file_style, + units_override=units_override, unit_system=unit_system) diff -Nru yt-3.3.3/yt/data_objects/tests/test_boolean_regions.py yt-3.4.0/yt/data_objects/tests/test_boolean_regions.py --- yt-3.3.3/yt/data_objects/tests/test_boolean_regions.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_boolean_regions.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,807 @@ +from yt.testing import \ + fake_amr_ds, \ + assert_array_equal +import numpy as np + +# We use morton indices in this test because they are single floating point +# values that uniquely identify each cell. That's a convenient way to compare +# inclusion in set operations, since there are no duplicates. + +def test_boolean_spheres_no_overlap(): + r"""Test to make sure that boolean objects (spheres, no overlap) + behave the way we expect. + + Test non-overlapping spheres. This also checks that the original spheres + don't change as part of constructing the booleans. + """ + ds = fake_amr_ds() + sp1 = ds.sphere([0.25, 0.25, 0.25], 0.15) + sp2 = ds.sphere([0.75, 0.75, 0.75], 0.15) + # Store the original indices + i1 = sp1["index","morton_index"] + i1.sort() + i2 = sp2["index","morton_index"] + i2.sort() + ii = np.concatenate((i1, i2)) + ii.sort() + # Make some booleans + bo1 = sp1 & sp2 + bo2 = sp1 - sp2 + bo3 = sp1 | sp2 # also works with + + bo4 = ds.union([sp1, sp2]) + bo5 = ds.intersection([sp1, sp2]) + # This makes sure the original containers didn't change. + new_i1 = sp1["index","morton_index"] + new_i1.sort() + new_i2 = sp2["index","morton_index"] + new_i2.sort() + assert_array_equal(new_i1, i1) + assert_array_equal(new_i2, i2) + # Now make sure the indices also behave as we expect. + empty = np.array([]) + assert_array_equal(bo1["index","morton_index"], empty) + assert_array_equal(bo5["index","morton_index"], empty) + b2 = bo2["index","morton_index"] + b2.sort() + assert_array_equal(b2, i1) + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b3, ii) + b4 = bo4["index","morton_index"] + b4.sort() + assert_array_equal(b4, ii) + bo6 = sp1 ^ sp2 + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_spheres_overlap(): + r"""Test to make sure that boolean objects (spheres, overlap) + behave the way we expect. + + Test overlapping spheres. + """ + ds = fake_amr_ds() + sp1 = ds.sphere([0.45, 0.45, 0.45], 0.15) + sp2 = ds.sphere([0.55, 0.55, 0.55], 0.15) + # Get indices of both. + i1 = sp1["index","morton_index"] + i2 = sp2["index","morton_index"] + # Make some booleans + bo1 = sp1 & sp2 + bo2 = sp1 - sp2 + bo3 = sp1 | sp2 + bo4 = ds.union([sp1, sp2]) + bo5 = ds.intersection([sp1, sp2]) + # Now make sure the indices also behave as we expect. + lens = np.intersect1d(i1, i2) + apple = np.setdiff1d(i1, i2) + both = np.union1d(i1, i2) + b1 = bo1["index","morton_index"] + b1.sort() + b2 = bo2["index","morton_index"] + b2.sort() + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b1, lens) + assert_array_equal(b2, apple) + assert_array_equal(b3, both) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + assert_array_equal(b1, b5) + bo6 = sp1 ^ sp2 + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_regions_no_overlap(): + r"""Test to make sure that boolean objects (regions, no overlap) + behave the way we expect. + + Test non-overlapping regions. This also checks that the original regions + don't change as part of constructing the booleans. + """ + ds = fake_amr_ds() + re1 = ds.region([0.25]*3, [0.2]*3, [0.3]*3) + re2 = ds.region([0.65]*3, [0.6]*3, [0.7]*3) + # Store the original indices + i1 = re1["index","morton_index"] + i1.sort() + i2 = re2["index","morton_index"] + i2.sort() + ii = np.concatenate((i1, i2)) + ii.sort() + # Make some booleans + bo1 = re1 & re2 + bo2 = re1 - re2 + bo3 = re1 | re2 + bo4 = ds.union([re1, re2]) + bo5 = ds.intersection([re1, re2]) + # This makes sure the original containers didn't change. + new_i1 = re1["index","morton_index"] + new_i1.sort() + new_i2 = re2["index","morton_index"] + new_i2.sort() + assert_array_equal(new_i1, i1) + assert_array_equal(new_i2, i2) + # Now make sure the indices also behave as we expect. + empty = np.array([]) + assert_array_equal(bo1["index","morton_index"], empty) + assert_array_equal(bo5["index","morton_index"], empty) + b2 = bo2["index","morton_index"] + b2.sort() + assert_array_equal(b2, i1 ) + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b3, ii) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + bo6 = re1 ^ re2 + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_regions_overlap(): + r"""Test to make sure that boolean objects (regions, overlap) + behave the way we expect. + + Test overlapping regions. + """ + ds = fake_amr_ds() + re1 = ds.region([0.55]*3, [0.5]*3, [0.6]*3) + re2 = ds.region([0.6]*3, [0.55]*3, [0.65]*3) + # Get indices of both. + i1 = re1["index","morton_index"] + i2 = re2["index","morton_index"] + # Make some booleans + bo1 = re1 & re2 + bo2 = re1 - re2 + bo3 = re1 | re2 + bo4 = ds.union([re1, re2]) + bo5 = ds.intersection([re1, re2]) + # Now make sure the indices also behave as we expect. + cube = np.intersect1d(i1, i2) + bite_cube = np.setdiff1d(i1, i2) + both = np.union1d(i1, i2) + b1 = bo1["index","morton_index"] + b1.sort() + b2 = bo2["index","morton_index"] + b2.sort() + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b1, cube) + assert_array_equal(b2, bite_cube) + assert_array_equal(b3, both) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + assert_array_equal(b1, b5) + bo6 = re1 ^ re2 + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_cylinders_no_overlap(): + r"""Test to make sure that boolean objects (cylinders, no overlap) + behave the way we expect. + + Test non-overlapping cylinders. This also checks that the original cylinders + don't change as part of constructing the booleans. + """ + ds = fake_amr_ds() + cyl1 = ds.disk([0.25]*3, [1, 0, 0], 0.1, 0.1) + cyl2 = ds.disk([0.75]*3, [1, 0, 0], 0.1, 0.1) + # Store the original indices + i1 = cyl1["index","morton_index"] + i1.sort() + i2 = cyl2["index","morton_index"] + i2.sort() + ii = np.concatenate((i1, i2)) + ii.sort() + # Make some booleans + bo1 = cyl1 & cyl2 + bo2 = cyl1 - cyl2 + bo3 = cyl1 | cyl2 + bo4 = ds.union([cyl1, cyl2]) + bo5 = ds.intersection([cyl1, cyl2]) + # This makes sure the original containers didn't change. + new_i1 = cyl1["index","morton_index"] + new_i1.sort() + new_i2 = cyl2["index","morton_index"] + new_i2.sort() + assert_array_equal(new_i1, i1) + assert_array_equal(new_i2, i2) + # Now make sure the indices also behave as we expect. + empty = np.array([]) + assert_array_equal(bo1["index","morton_index"], empty) + assert_array_equal(bo5["index","morton_index"], empty) + b2 = bo2["index","morton_index"] + b2.sort() + assert_array_equal(b2, i1) + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b3, ii) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + bo6 = cyl1 ^ cyl2 + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_cylinders_overlap(): + r"""Test to make sure that boolean objects (cylinders, overlap) + behave the way we expect. + + Test overlapping cylinders. + """ + ds = fake_amr_ds() + cyl1 = ds.disk([0.45]*3, [1, 0, 0], 0.2, 0.2) + cyl2 = ds.disk([0.55]*3, [1, 0, 0], 0.2, 0.2) + # Get indices of both. + i1 = cyl1["index","morton_index"] + i2 = cyl2["index","morton_index"] + # Make some booleans + bo1 = cyl1 & cyl2 + bo2 = cyl1 - cyl2 + bo3 = cyl1 | cyl2 + bo4 = ds.union([cyl1, cyl2]) + bo5 = ds.intersection([cyl1, cyl2]) + # Now make sure the indices also behave as we expect. + vlens = np.intersect1d(i1, i2) + bite_disk = np.setdiff1d(i1, i2) + both = np.union1d(i1, i2) + b1 = bo1["index","morton_index"] + b1.sort() + b2 = bo2["index","morton_index"] + b2.sort() + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b1, vlens) + assert_array_equal(b2, bite_disk) + assert_array_equal(b3, both) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + assert_array_equal(b1, b5) + bo6 = cyl1 ^ cyl2 + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + del ds + +def test_boolean_ellipsoids_no_overlap(): + r"""Test to make sure that boolean objects (ellipsoids, no overlap) + behave the way we expect. + + Test non-overlapping ellipsoids. This also checks that the original + ellipsoids don't change as part of constructing the booleans. + """ + ds = fake_amr_ds() + ell1 = ds.ellipsoid([0.25]*3, 0.05, 0.05, 0.05, np.array([0.1]*3), 0.1) + ell2 = ds.ellipsoid([0.75]*3, 0.05, 0.05, 0.05, np.array([0.1]*3), 0.1) + # Store the original indices + i1 = ell1["index","morton_index"] + i1.sort() + i2 = ell2["index","morton_index"] + i2.sort() + ii = np.concatenate((i1, i2)) + ii.sort() + # Make some booleans + bo1 = ell1 & ell2 + bo2 = ell1 - ell2 + bo3 = ell1 | ell2 + bo4 = ds.union([ell1, ell2]) + bo5 = ds.intersection([ell1, ell2]) + # This makes sure the original containers didn't change. + new_i1 = ell1["index","morton_index"] + new_i1.sort() + new_i2 = ell2["index","morton_index"] + new_i2.sort() + assert_array_equal(new_i1, i1 ) + assert_array_equal(new_i2, i2) + # Now make sure the indices also behave as we expect. + empty = np.array([]) + assert_array_equal(bo1["index","morton_index"], empty) + assert_array_equal(bo5["index","morton_index"], empty) + b2 = bo2["index","morton_index"] + b2.sort() + assert_array_equal(b2, i1) + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b3, ii) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + bo6 = ell1 ^ ell2 + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_ellipsoids_overlap(): + r"""Test to make sure that boolean objects (ellipsoids, overlap) + behave the way we expect. + + Test overlapping ellipsoids. + """ + ds = fake_amr_ds() + ell1 = ds.ellipsoid([0.45]*3, 0.05, 0.05, 0.05, np.array([0.1]*3), 0.1) + ell2 = ds.ellipsoid([0.55]*3, 0.05, 0.05, 0.05, np.array([0.1]*3), 0.1) + # Get indices of both. + i1 = ell1["index","morton_index"] + i2 = ell2["index","morton_index"] + # Make some booleans + bo1 = ell1 & ell2 + bo2 = ell1 - ell2 + bo3 = ell1 | ell2 + bo4 = ds.union([ell1, ell2]) + bo5 = ds.intersection([ell1, ell2]) + # Now make sure the indices also behave as we expect. + overlap = np.intersect1d(i1, i2) + diff = np.setdiff1d(i1, i2) + both = np.union1d(i1, i2) + b1 = bo1["index","morton_index"] + b1.sort() + b2 = bo2["index","morton_index"] + b2.sort() + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b1, overlap) + assert_array_equal(b2, diff) + assert_array_equal(b3, both) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + assert_array_equal(b1, b5) + bo6 = ell1 ^ ell2 + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_mix_periodicity(): + r"""Test that a hybrid boolean region behaves as we expect. + + This also tests nested logic and that periodicity works. + """ + ds = fake_amr_ds() + re = ds.region([0.5]*3, [0.0]*3, [1]*3) # whole thing + sp = ds.sphere([0.95]*3, 0.3) # wraps around + cyl = ds.disk([0.05]*3, [1,1,1], 0.1, 0.4) # wraps around + # Get original indices + rei = re["index","morton_index"] + spi = sp["index","morton_index"] + cyli = cyl["index","morton_index"] + # Make some booleans + # whole box minux spherical bites at corners + bo1 = re - sp + # sphere plus cylinder + bo2 = sp | cyl + # a jumble, the region minus the sp+cyl + bo3 = re - (sp | cyl) + # Now make sure the indices also behave as we expect. + bo4 = ds.union([re, sp, cyl]) + bo5 = ds.intersection([re, sp, cyl]) + expect = np.setdiff1d(rei, spi) + ii = bo1["index","morton_index"] + ii.sort() + assert_array_equal(expect, ii) + # + expect = np.union1d(spi, cyli) + ii = bo2["index","morton_index"] + ii.sort() + assert_array_equal(expect, ii) + # + expect = np.union1d(spi, cyli) + expect = np.setdiff1d(rei, expect) + ii = bo3["index","morton_index"] + ii.sort() + assert_array_equal(expect, ii) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + ii = np.union1d(np.union1d(rei, cyli), spi) + ii.sort() + assert_array_equal(ii, b4) + ii = np.intersect1d(np.intersect1d(rei, cyli), spi) + ii.sort() + assert_array_equal(ii, b5) + + bo6 = (re ^ sp) ^ cyl + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(np.setxor1d(rei, spi), cyli)) + +def test_boolean_ray_region_no_overlap(): + r"""Test to make sure that boolean objects (ray, region, no overlap) + behave the way we expect. + + Test non-overlapping ray and region. This also checks that the original + objects don't change as part of constructing the booleans. + """ + ds = fake_amr_ds() + re = ds.box([0.25]*3, [0.75]*3) + ra = ds.ray([0.1]*3, [0.1, 0.1, 0.9]) + # Store the original indices + i1 = re["index","morton_index"] + i1.sort() + i2 = ra["index","morton_index"] + i2.sort() + ii = np.concatenate((i1, i2)) + ii.sort() + # Make some booleans + bo1 = re & ra + bo2 = re - ra + bo3 = re | ra + bo4 = ds.union([re, ra]) + bo5 = ds.intersection([re, ra]) + # This makes sure the original containers didn't change. + new_i1 = re["index","morton_index"] + new_i1.sort() + new_i2 = ra["index","morton_index"] + new_i2.sort() + assert_array_equal(new_i1, i1) + assert_array_equal(new_i2, i2) + # Now make sure the indices also behave as we expect. + empty = np.array([]) + assert_array_equal(bo1["index","morton_index"], empty) + assert_array_equal(bo5["index","morton_index"], empty) + b2 = bo2["index","morton_index"] + b2.sort() + assert_array_equal(b2, i1 ) + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b3, ii) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + bo6 = re ^ ra + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_ray_region_overlap(): + r"""Test to make sure that boolean objects (ray, region, overlap) + behave the way we expect. + + Test overlapping ray and region. This also checks that the original + objects don't change as part of constructing the booleans. + """ + ds = fake_amr_ds() + re = ds.box([0.25]*3, [0.75]*3) + ra = ds.ray([0]*3, [1]*3) + # Get indices of both. + i1 = re["index","morton_index"] + i2 = ra["index","morton_index"] + # Make some booleans + bo1 = re & ra + bo2 = re - ra + bo3 = re | ra + bo4 = ds.union([re, ra]) + bo5 = ds.intersection([re, ra]) + # Now make sure the indices also behave as we expect. + short_line = np.intersect1d(i1, i2) + cube_minus_line = np.setdiff1d(i1, i2) + both = np.union1d(i1, i2) + b1 = bo1["index","morton_index"] + b1.sort() + b2 = bo2["index","morton_index"] + b2.sort() + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b1, short_line) + assert_array_equal(b2, cube_minus_line) + assert_array_equal(b3, both) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + assert_array_equal(b1, b5) + bo6 = re ^ ra + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_rays_no_overlap(): + r"""Test to make sure that boolean objects (rays, no overlap) + behave the way we expect. + + Test non-overlapping rays. + """ + ds = fake_amr_ds() + ra1 = ds.ray([0, 0, 0], [0, 0, 1]) + ra2 = ds.ray([1, 0, 0], [1, 0, 1]) + # Store the original indices + i1 = ra1["index","morton_index"] + i1.sort() + i2 = ra2["index","morton_index"] + i2.sort() + ii = np.concatenate((i1, i2)) + ii.sort() + # Make some booleans + bo1 = ra1 & ra2 + bo2 = ra1 - ra2 + bo3 = ra1 | ra2 + bo4 = ds.union([ra1, ra2]) + bo5 = ds.intersection([ra1, ra2]) + # This makes sure the original containers didn't change. + new_i1 = ra1["index","morton_index"] + new_i1.sort() + new_i2 = ra2["index","morton_index"] + new_i2.sort() + assert_array_equal(new_i1, i1) + assert_array_equal(new_i2, i2) + # Now make sure the indices also behave as we expect. + empty = np.array([]) + assert_array_equal(bo1["index","morton_index"], empty) + assert_array_equal(bo5["index","morton_index"], empty) + b2 = bo2["index","morton_index"] + b2.sort() + assert_array_equal(b2, i1 ) + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b3, ii) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + bo6 = ra1 ^ ra2 + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_rays_overlap(): + r"""Test to make sure that boolean objects (rays, overlap) + behave the way we expect. + + Test non-overlapping rays. + """ + ds = fake_amr_ds() + ra1 = ds.ray([0]*3, [1]*3) + ra2 = ds.ray([0]*3, [0.5]*3) + # Get indices of both. + i1 = ra1["index","morton_index"] + i1.sort() + i2 = ra2["index","morton_index"] + i2.sort() + ii = np.concatenate((i1, i2)) + ii.sort() + # Make some booleans + bo1 = ra1 & ra2 + bo2 = ra1 - ra2 + bo3 = ra1 | ra2 + bo4 = ds.union([ra1, ra2]) + bo5 = ds.intersection([ra1, ra2]) + # Now make sure the indices also behave as we expect. + short_line = np.intersect1d(i1, i2) + short_line_b = np.setdiff1d(i1, i2) + full_line = np.union1d(i1, i2) + b1 = bo1["index","morton_index"] + b1.sort() + b2 = bo2["index","morton_index"] + b2.sort() + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b1, short_line) + assert_array_equal(b2, short_line_b) + assert_array_equal(b3, full_line) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, i1) + assert_array_equal(b3, b4) + assert_array_equal(b1, b5) + bo6 = ra1 ^ ra2 + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_slices_no_overlap(): + r"""Test to make sure that boolean objects (slices, no overlap) + behave the way we expect. + + Test non-overlapping slices. This also checks that the original regions + don't change as part of constructing the booleans. + """ + ds = fake_amr_ds() + sl1 = ds.r[:,:,0.25] + sl2 = ds.r[:,:,0.75] + # Store the original indices + i1 = sl1["index","morton_index"] + i1.sort() + i2 = sl2["index","morton_index"] + i2.sort() + ii = np.concatenate((i1, i2)) + ii.sort() + # Make some booleans + bo1 = sl1 & sl2 + bo2 = sl1 - sl2 + bo3 = sl1 | sl2 + bo4 = ds.union([sl1, sl2]) + bo5 = ds.intersection([sl1, sl2]) + # This makes sure the original containers didn't change. + new_i1 = sl1["index","morton_index"] + new_i1.sort() + new_i2 = sl2["index","morton_index"] + new_i2.sort() + assert_array_equal(new_i1, i1) + assert_array_equal(new_i2, i2) + # Now make sure the indices also behave as we expect. + empty = np.array([]) + assert_array_equal(bo1["index","morton_index"], empty) + assert_array_equal(bo5["index","morton_index"], empty) + b2 = bo2["index","morton_index"] + b2.sort() + assert_array_equal(b2, i1 ) + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b3, ii) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + bo6 = sl1 ^ sl2 + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_slices_overlap(): + r"""Test to make sure that boolean objects (slices, overlap) + behave the way we expect. + + Test overlapping slices. + """ + ds = fake_amr_ds() + sl1 = ds.r[:,:,0.25] + sl2 = ds.r[:,0.75,:] + # Get indices of both. + i1 = sl1["index","morton_index"] + i2 = sl2["index","morton_index"] + # Make some booleans + bo1 = sl1 & sl2 + bo2 = sl1 - sl2 + bo3 = sl1 | sl2 + bo4 = ds.union([sl1, sl2]) + bo5 = ds.intersection([sl1, sl2]) + # Now make sure the indices also behave as we expect. + line = np.intersect1d(i1, i2) + orig = np.setdiff1d(i1, i2) + both = np.union1d(i1, i2) + b1 = bo1["index","morton_index"] + b1.sort() + b2 = bo2["index","morton_index"] + b2.sort() + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b1, line) + assert_array_equal(b2, orig) + assert_array_equal(b3, both) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + assert_array_equal(b1, b5) + bo6 = sl1 ^ sl2 + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_ray_slice_no_overlap(): + r"""Test to make sure that boolean objects (ray, slice, no overlap) + behave the way we expect. + + Test non-overlapping ray and slice. This also checks that the original + regions don't change as part of constructing the booleans. + """ + ds = fake_amr_ds() + sl = ds.r[:,:,0.25] + ra = ds.ray([0]*3, [0, 1, 0]) + # Store the original indices + i1 = sl["index","morton_index"] + i1.sort() + i2 = ra["index","morton_index"] + i2.sort() + ii = np.concatenate((i1, i2)) + ii.sort() + # Make some booleans + bo1 = sl & ra + bo2 = sl - ra + bo3 = sl | ra + bo4 = ds.union([sl, ra]) + bo5 = ds.intersection([sl, ra]) + # This makes sure the original containers didn't change. + new_i1 = sl["index","morton_index"] + new_i1.sort() + new_i2 = ra["index","morton_index"] + new_i2.sort() + assert_array_equal(new_i1, i1) + assert_array_equal(new_i2, i2) + # Now make sure the indices also behave as we expect. + empty = np.array([]) + assert_array_equal(bo1["index","morton_index"], empty) + assert_array_equal(bo5["index","morton_index"], empty) + b2 = bo2["index","morton_index"] + b2.sort() + assert_array_equal(b2, i1 ) + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b3, ii) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, b4) + bo6 = sl ^ ra + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) + +def test_boolean_ray_slice_overlap(): + r"""Test to make sure that boolean objects (rays and slices, overlap) + behave the way we expect. + + Test overlapping rays and slices. + """ + ds = fake_amr_ds() + sl = ds.r[:,:,0.25] + ra = ds.ray([0, 0, 0.25], [0, 1, 0.25]) + # Get indices of both. + i1 = sl["index","morton_index"] + i1.sort() + i2 = ra["index","morton_index"] + i1.sort() + ii = np.concatenate((i1, i2)) + ii.sort() + # Make some booleans + bo1 = sl & ra + bo2 = sl - ra + bo3 = sl | ra + bo4 = ds.union([sl, ra]) + bo5 = ds.intersection([sl, ra]) + # Now make sure the indices also behave as we expect. + line = np.intersect1d(i1, i2) + sheet_minus_line = np.setdiff1d(i1, i2) + sheet = np.union1d(i1, i2) + b1 = bo1["index","morton_index"] + b1.sort() + b2 = bo2["index","morton_index"] + b2.sort() + b3 = bo3["index","morton_index"] + b3.sort() + assert_array_equal(b1, line) + assert_array_equal(b2, sheet_minus_line) + assert_array_equal(b3, sheet) + b4 = bo4["index","morton_index"] + b4.sort() + b5 = bo5["index","morton_index"] + b5.sort() + assert_array_equal(b3, i1) + assert_array_equal(b3, b4) + assert_array_equal(b1, b5) + bo6 = sl ^ ra + b6 = bo6["index", "morton_index"] + b6.sort() + assert_array_equal(b6, np.setxor1d(i1, i2)) diff -Nru yt-3.3.3/yt/data_objects/tests/test_chunking.py yt-3.4.0/yt/data_objects/tests/test_chunking.py --- yt-3.3.3/yt/data_objects/tests/test_chunking.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_chunking.py 2017-08-10 18:02:57.000000000 +0000 @@ -34,7 +34,7 @@ coords['i'][t] = uconcatenate(coords['i'][t]) coords['f'][t].sort() coords['i'][t].sort() - yield assert_equal, coords['f']['io'], coords['f']['all'] - yield assert_equal, coords['f']['io'], coords['f']['spatial'] - yield assert_equal, coords['i']['io'], coords['i']['all'] - yield assert_equal, coords['i']['io'], coords['i']['spatial'] + assert_equal(coords['f']['io'], coords['f']['all']) + assert_equal(coords['f']['io'], coords['f']['spatial']) + assert_equal(coords['i']['io'], coords['i']['all']) + assert_equal(coords['i']['io'], coords['i']['spatial']) diff -Nru yt-3.3.3/yt/data_objects/tests/test_clone.py yt-3.4.0/yt/data_objects/tests/test_clone.py --- yt-3.3.3/yt/data_objects/tests/test_clone.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_clone.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,24 @@ +from yt.testing import \ + fake_random_ds, \ + assert_equal, \ + assert_array_equal + +def test_clone_sphere(): + # Now we test that we can get different radial velocities based on field + # parameters. + + # Get the first sphere + ds = fake_random_ds(16, fields = ("density", + "velocity_x", "velocity_y", "velocity_z")) + sp0 = ds.sphere(ds.domain_center, 0.25) + + assert_equal(list(sp0.keys()), []) + + sp1 = sp0.clone() + sp0["density"] + assert_equal(list(sp0.keys()), (("gas","density"),)) + assert_equal(list(sp1.keys()), []) + + sp1["density"] + + assert_array_equal(sp0["density"], sp1["density"]) diff -Nru yt-3.3.3/yt/data_objects/tests/test_compose.py yt-3.4.0/yt/data_objects/tests/test_compose.py --- yt-3.3.3/yt/data_objects/tests/test_compose.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_compose.py 2017-08-10 18:02:57.000000000 +0000 @@ -34,7 +34,7 @@ empty = np.array([]) for n in [1, 2, 4, 8]: ds = fake_random_ds(64, nprocs=n) - ds.add_field(("index", "ID"), function=_IDFIELD) + ds.add_field(("index", "ID"), sampling_type='cell', function=_IDFIELD) # position parameters for initial region center = [0.25]*3 @@ -56,24 +56,24 @@ # subselect non-overlapping 0, 1, 2, 3D regions for data1 in sources: data2 = ds.sphere(center, radius, data_source=data1) - yield assert_array_equal, data2['index', 'ID'], empty + assert_array_equal(data2['index', 'ID'], empty) data2 = ds.region(center, left_edge, right_edge, data_source=data1) - yield assert_array_equal, data2['index', 'ID'], empty + assert_array_equal(data2['index', 'ID'], empty ) data2 = ds.disk(center, normal, radius, height, data_source=data1) - yield assert_array_equal, data2['index', 'ID'], empty + assert_array_equal(data2['index', 'ID'], empty) for d in range(3): data2 = ds.slice(d, center[d], data_source=data1) - yield assert_array_equal, data2['index', 'ID'], empty + assert_array_equal(data2['index', 'ID'], empty) for d in range(3): data2 = ds.ortho_ray(d, center[0:d] + center[d+1:], data_source=data1) - yield assert_array_equal, data2['index', 'ID'], empty + assert_array_equal(data2['index', 'ID'], empty) data2 = ds.point(center, data_source=data1) - yield assert_array_equal, data2['index', 'ID'], empty + assert_array_equal(data2['index', 'ID'], empty) def test_compose_overlap(): r"""Test to make sure that composed data objects that do @@ -81,7 +81,7 @@ """ for n in [1, 2, 4, 8]: ds = fake_random_ds(64, nprocs=n) - ds.add_field(("index", "ID"), function=_IDFIELD) + ds.add_field(("index", "ID"), sampling_type='cell', function=_IDFIELD) # position parameters for initial region center = [0.4, 0.5, 0.5] @@ -109,21 +109,21 @@ id2 = data2['index', 'ID'] id3 = data3['index', 'ID'] id3.sort() - yield assert_array_equal, uintersect1d(id1, id2), id3 + assert_array_equal(uintersect1d(id1, id2), id3) data2 = ds.region(center, left_edge, right_edge) data3 = ds.region(center, left_edge, right_edge, data_source=data1) id2 = data2['index', 'ID'] id3 = data3['index', 'ID'] id3.sort() - yield assert_array_equal, uintersect1d(id1, id2), id3 + assert_array_equal(uintersect1d(id1, id2), id3) data2 = ds.disk(center, normal, radius, height) data3 = ds.disk(center, normal, radius, height, data_source=data1) id2 = data2['index', 'ID'] id3 = data3['index', 'ID'] id3.sort() - yield assert_array_equal, uintersect1d(id1, id2), id3 + assert_array_equal(uintersect1d(id1, id2), id3) for d in range(3): data2 = ds.slice(d, center[d]) @@ -131,7 +131,7 @@ id2 = data2['index', 'ID'] id3 = data3['index', 'ID'] id3.sort() - yield assert_array_equal, uintersect1d(id1, id2), id3 + assert_array_equal(uintersect1d(id1, id2), id3) for d in range(3): data2 = ds.ortho_ray(d, center[0:d] + center[d+1:]) @@ -139,11 +139,11 @@ id2 = data2['index', 'ID'] id3 = data3['index', 'ID'] id3.sort() - yield assert_array_equal, uintersect1d(id1, id2), id3 + assert_array_equal(uintersect1d(id1, id2), id3) data2 = ds.point(center) data3 = ds.point(center, data_source=data1) id2 = data2['index', 'ID'] id3 = data3['index', 'ID'] id3.sort() - yield assert_array_equal, uintersect1d(id1, id2), id3 + assert_array_equal(uintersect1d(id1, id2), id3) diff -Nru yt-3.3.3/yt/data_objects/tests/test_covering_grid.py yt-3.4.0/yt/data_objects/tests/test_covering_grid.py --- yt-3.3.3/yt/data_objects/tests/test_covering_grid.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_covering_grid.py 2017-08-10 18:02:57.000000000 +0000 @@ -22,42 +22,42 @@ cg = ds.covering_grid(level, [0.0, 0.0, 0.0], dn * ds.domain_dimensions) # Test coordinate generation - yield assert_equal, np.unique(cg["dx"]).size, 1 + assert_equal(np.unique(cg["dx"]).size, 1) xmi = cg["x"].min() xma = cg["x"].max() dx = cg["dx"].flat[0:1] edges = ds.arr([[0,1],[0,1],[0,1]], 'code_length') - yield assert_equal, xmi, edges[0,0] + dx/2.0 - yield assert_equal, xmi, cg["x"][0,0,0] - yield assert_equal, xmi, cg["x"][0,1,1] - yield assert_equal, xma, edges[0,1] - dx/2.0 - yield assert_equal, xma, cg["x"][-1,0,0] - yield assert_equal, xma, cg["x"][-1,1,1] - yield assert_equal, np.unique(cg["dy"]).size, 1 + assert_equal(xmi, edges[0,0] + dx/2.0) + assert_equal(xmi, cg["x"][0,0,0]) + assert_equal(xmi, cg["x"][0,1,1]) + assert_equal(xma, edges[0,1] - dx/2.0) + assert_equal(xma, cg["x"][-1,0,0]) + assert_equal(xma, cg["x"][-1,1,1]) + assert_equal(np.unique(cg["dy"]).size, 1) ymi = cg["y"].min() yma = cg["y"].max() dy = cg["dy"][0] - yield assert_equal, ymi, edges[1,0] + dy/2.0 - yield assert_equal, ymi, cg["y"][0,0,0] - yield assert_equal, ymi, cg["y"][1,0,1] - yield assert_equal, yma, edges[1,1] - dy/2.0 - yield assert_equal, yma, cg["y"][0,-1,0] - yield assert_equal, yma, cg["y"][1,-1,1] - yield assert_equal, np.unique(cg["dz"]).size, 1 + assert_equal(ymi, edges[1,0] + dy/2.0) + assert_equal(ymi, cg["y"][0,0,0]) + assert_equal(ymi, cg["y"][1,0,1]) + assert_equal(yma, edges[1,1] - dy/2.0) + assert_equal(yma, cg["y"][0,-1,0]) + assert_equal(yma, cg["y"][1,-1,1]) + assert_equal(np.unique(cg["dz"]).size, 1) zmi = cg["z"].min() zma = cg["z"].max() dz = cg["dz"][0] - yield assert_equal, zmi, edges[2,0] + dz/2.0 - yield assert_equal, zmi, cg["z"][0,0,0] - yield assert_equal, zmi, cg["z"][1,1,0] - yield assert_equal, zma, edges[2,1] - dz/2.0 - yield assert_equal, zma, cg["z"][0,0,-1] - yield assert_equal, zma, cg["z"][1,1,-1] + assert_equal(zmi, edges[2,0] + dz/2.0) + assert_equal(zmi, cg["z"][0,0,0]) + assert_equal(zmi, cg["z"][1,1,0]) + assert_equal(zma, edges[2,1] - dz/2.0) + assert_equal(zma, cg["z"][0,0,-1]) + assert_equal(zma, cg["z"][1,1,-1]) # Now we test other attributes - yield assert_equal, cg["ones"].max(), 1.0 - yield assert_equal, cg["ones"].min(), 1.0 - yield assert_equal, cg["grid_level"], level - yield assert_equal, cg["cell_volume"].sum(), ds.domain_width.prod() + assert_equal(cg["ones"].max(), 1.0) + assert_equal(cg["ones"].min(), 1.0) + assert_equal(cg["grid_level"], level) + assert_equal(cg["cell_volume"].sum(), ds.domain_width.prod()) for g in ds.index.grids: di = g.get_global_startindex() dd = g.ActiveDimensions @@ -65,7 +65,7 @@ f = cg["density"][dn*di[0]+i:dn*(di[0]+dd[0])+i:dn, dn*di[1]+i:dn*(di[1]+dd[1])+i:dn, dn*di[2]+i:dn*(di[2]+dd[2])+i:dn] - yield assert_equal, f, g["density"] + assert_equal(f, g["density"]) def test_smoothed_covering_grid(): # We decompose in different ways @@ -75,9 +75,9 @@ dn = ds.refine_by**level cg = ds.smoothed_covering_grid(level, [0.0, 0.0, 0.0], dn * ds.domain_dimensions) - yield assert_equal, cg["ones"].max(), 1.0 - yield assert_equal, cg["ones"].min(), 1.0 - yield assert_equal, cg["cell_volume"].sum(), ds.domain_width.prod() + assert_equal(cg["ones"].max(), 1.0) + assert_equal(cg["ones"].min(), 1.0) + assert_equal(cg["cell_volume"].sum(), ds.domain_width.prod()) for g in ds.index.grids: if level != g.Level: continue di = g.get_global_startindex() @@ -86,11 +86,11 @@ f = cg["density"][dn*di[0]+i:dn*(di[0]+dd[0])+i:dn, dn*di[1]+i:dn*(di[1]+dd[1])+i:dn, dn*di[2]+i:dn*(di[2]+dd[2])+i:dn] - yield assert_equal, f, g["density"] + assert_equal(f, g["density"]) def test_arbitrary_grid(): - for ncells in [64, 128, 256]: + for ncells in [32, 64]: for px in [0.125, 0.25, 0.55519]: particle_data = { @@ -101,17 +101,27 @@ ds = load_particles(particle_data) - LE = np.array([0.05, 0.05, 0.05]) - RE = np.array([0.95, 0.95, 0.95]) - dims = np.array([ncells, ncells, ncells]) + for dims in ([ncells]*3, [ncells, ncells/2, ncells/4]): + LE = np.array([0.05, 0.05, 0.05]) + RE = np.array([0.95, 0.95, 0.95]) + dims = np.array(dims) - dds = (RE - LE) / dims - volume = ds.quan(np.product(dds), 'cm**3') + dds = (RE - LE) / dims + volume = ds.quan(np.product(dds), 'cm**3') - obj = ds.arbitrary_grid(LE, RE, dims) - deposited_mass = obj["deposit", "all_density"].sum() * volume + obj = ds.arbitrary_grid(LE, RE, dims) + deposited_mass = obj["deposit", "all_density"].sum() * volume - yield assert_equal, deposited_mass, ds.quan(1.0, 'g') + assert_equal(deposited_mass, ds.quan(1.0, 'g')) + + LE = np.array([0.00, 0.00, 0.00]) + RE = np.array([0.05, 0.05, 0.05]) + + obj = ds.arbitrary_grid(LE, RE, dims) + + deposited_mass = obj["deposit", "all_density"].sum() + + assert_equal(deposited_mass, 0) # Test that we get identical results to the covering grid for unigrid data. # Testing AMR data is much harder. @@ -122,7 +132,7 @@ 2**ref_level * ds.domain_dimensions) ag = ds.arbitrary_grid([0.0, 0.0, 0.0], [1.0, 1.0, 1.0], 2**ref_level * ds.domain_dimensions) - yield assert_almost_equal, cg["density"], ag["density"] + assert_almost_equal(cg["density"], ag["density"]) output_00080 = "output_00080/info_00080.txt" @requires_file(output_00080) @@ -139,3 +149,18 @@ ds.periodicity = (True, True, True) scg = ds.smoothed_covering_grid(1, [0, 0, 0], [128, 128, 1]) assert_equal(scg['density'].shape, [128, 128, 1]) + +isogal = "IsolatedGalaxy/galaxy0030/galaxy0030" +@requires_file(isogal) +def test_arbitrary_grid_derived_field(): + def _tracerf(field, data): + return data['Metal_Density']/data['gas', 'density'] + + ds = load(isogal) + + ds.add_field(("gas", "tracerf"), function=_tracerf, units="dimensionless", + take_log=False) + + galgas = ds.arbitrary_grid([0.4, 0.4, 0.4], [0.99, 0.99, 0.99], + dims=[32, 32, 32]) + galgas['tracerf'] diff -Nru yt-3.3.3/yt/data_objects/tests/test_cutting_plane.py yt-3.4.0/yt/data_objects/tests/test_cutting_plane.py --- yt-3.3.3/yt/data_objects/tests/test_cutting_plane.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_cutting_plane.py 2017-08-10 18:02:57.000000000 +0000 @@ -26,9 +26,9 @@ center = [0.5, 0.5, 0.5] normal = [1, 1, 1] cut = ds.cutting(normal, center) - yield assert_equal, cut["ones"].sum(), cut["ones"].size - yield assert_equal, cut["ones"].min(), 1.0 - yield assert_equal, cut["ones"].max(), 1.0 + assert_equal(cut["ones"].sum(), cut["ones"].size) + assert_equal(cut["ones"].min(), 1.0) + assert_equal(cut["ones"].max(), 1.0) pw = cut.to_pw(fields='density') for p in pw.plots.values(): tmpfd, tmpname = tempfile.mkstemp(suffix='.png') @@ -39,20 +39,14 @@ frb = cut.to_frb(width, 64) for cut_field in ['ones', 'density']: fi = ds._get_field_info("unknown", cut_field) - yield assert_equal, frb[cut_field].info['data_source'], \ - cut.__str__() - yield assert_equal, frb[cut_field].info['axis'], \ - 4 - yield assert_equal, frb[cut_field].info['field'], \ - cut_field - yield assert_equal, frb[cut_field].units, \ - Unit(fi.units) - yield assert_equal, frb[cut_field].info['xlim'], \ - frb.bounds[:2] - yield assert_equal, frb[cut_field].info['ylim'], \ - frb.bounds[2:] - yield assert_equal, frb[cut_field].info['length_to_cm'], \ - ds.length_unit.in_cgs() - yield assert_equal, frb[cut_field].info['center'], \ - cut.center + assert_equal(frb[cut_field].info['data_source'], + cut.__str__()) + assert_equal(frb[cut_field].info['axis'], 4) + assert_equal(frb[cut_field].info['field'], cut_field) + assert_equal(frb[cut_field].units, Unit(fi.units)) + assert_equal(frb[cut_field].info['xlim'], frb.bounds[:2]) + assert_equal(frb[cut_field].info['ylim'], frb.bounds[2:]) + assert_equal(frb[cut_field].info['length_to_cm'], + ds.length_unit.in_cgs()) + assert_equal(frb[cut_field].info['center'], cut.center) teardown_func(fns) diff -Nru yt-3.3.3/yt/data_objects/tests/test_data_collection.py yt-3.4.0/yt/data_objects/tests/test_data_collection.py --- yt-3.3.3/yt/data_objects/tests/test_data_collection.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_data_collection.py 2017-08-10 18:02:57.000000000 +0000 @@ -17,14 +17,14 @@ crho = coll["density"].sum(dtype="float64").to_ndarray() grho = np.sum([g["density"].sum(dtype="float64") for g in ds.index.grids], dtype="float64") - yield assert_rel_equal, np.array([crho]), np.array([grho]), 12 - yield assert_equal, coll.size, ds.domain_dimensions.prod() + assert_rel_equal(np.array([crho]), np.array([grho]), 12) + assert_equal(coll.size, ds.domain_dimensions.prod()) for gi in range(ds.index.num_grids): grids = ds.index.grids[:gi+1] coll = ds.data_collection(grids) crho = coll["density"].sum(dtype="float64") grho = np.sum([g["density"].sum(dtype="float64") for g in grids], dtype="float64") - yield assert_rel_equal, np.array([crho]), np.array([grho]), 12 - yield assert_equal, coll.size, \ - sum(g.ActiveDimensions.prod() for g in grids) + assert_rel_equal(np.array([crho]), np.array([grho]), 12) + assert_equal(coll.size, + sum(g.ActiveDimensions.prod() for g in grids)) diff -Nru yt-3.3.3/yt/data_objects/tests/test_dataset_access.py yt-3.4.0/yt/data_objects/tests/test_dataset_access.py --- yt-3.3.3/yt/data_objects/tests/test_dataset_access.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_dataset_access.py 2017-08-10 18:02:57.000000000 +0000 @@ -4,7 +4,12 @@ assert_equal, \ fake_amr_ds, \ fake_particle_ds, \ - fake_random_ds + fake_random_ds, \ + requires_file +from yt.utilities.answer_testing.framework import \ + data_dir_load +from yt.visualization.line_plot import \ + LineBuffer # This will test the "dataset access" method. @@ -34,34 +39,105 @@ # First, no string units reg1 = ds.r[0.2:0.3,0.4:0.6,:] reg2 = ds.region([0.25, 0.5, 0.5], [0.2, 0.4, 0.0], [0.3, 0.6, 1.0]) - yield assert_equal, reg1["density"], reg2["density"] + assert_equal(reg1["density"], reg2["density"]) # Now, string units in some -- 1.0 == cm reg1 = ds.r[(0.1, 'cm'):(0.5, 'cm'), :, (0.25, 'cm'): (0.35, 'cm')] reg2 = ds.region([0.3, 0.5, 0.3], [0.1, 0.0, 0.25], [0.5, 1.0, 0.35]) - yield assert_equal, reg1["density"], reg2["density"] + assert_equal(reg1["density"], reg2["density"]) # Now, string units in some -- 1.0 == cm reg1 = ds.r[(0.1, 'cm'):(0.5, 'cm'), :, 0.25:0.35] reg2 = ds.region([0.3, 0.5, 0.3], [0.1, 0.0, 0.25], [0.5, 1.0, 0.35]) - yield assert_equal, reg1["density"], reg2["density"] + assert_equal(reg1["density"], reg2["density"]) # And, lots of : usage! reg1 = ds.r[:, :, :] reg2 = ds.all_data() - yield assert_equal, reg1["density"], reg2["density"] + assert_equal(reg1["density"], reg2["density"]) def test_accessing_all_data(): # This will test first that we can access all_data, and next that we can # access it multiple times and get the *same object*. ds = fake_amr_ds(fields=["density"]) dd = ds.all_data() - yield assert_equal, ds.r["density"], dd["density"] + assert_equal(ds.r["density"], dd["density"]) # Now let's assert that it's the same object rho = ds.r["density"] rho *= 2.0 - yield assert_equal, dd["density"]*2.0, ds.r["density"] - yield assert_equal, dd["gas", "density"]*2.0, ds.r["gas", "density"] + assert_equal(dd["density"]*2.0, ds.r["density"]) + assert_equal(dd["gas", "density"]*2.0, ds.r["gas", "density"]) + +def test_slice_from_r(): + ds = fake_amr_ds(fields = ["density"]) + sl1 = ds.r[0.5, :, :] + sl2 = ds.slice("x", 0.5) + assert_equal(sl1["density"], sl2["density"]) + + frb1 = sl1.to_frb(width = 1.0, height = 1.0, resolution = (1024, 512)) + frb2 = ds.r[0.5, ::1024j, ::512j] + assert_equal(frb1["density"], frb2["density"]) + + # Test slice which doesn't cover the whole domain + box = ds.box([0.0, 0.25, 0.25], [1.0, 0.75, 0.75]) + + sl3 = ds.r[0.5, 0.25:0.75, 0.25:0.75] + sl4 = ds.slice("x", 0.5, data_source=box) + assert_equal(sl3["density"], sl4["density"]) + + frb3 = sl3.to_frb(width = 0.5, height = 0.5, resolution = (1024, 512)) + frb4 = ds.r[0.5, 0.25:0.75:1024j, 0.25:0.75:512j] + assert_equal(frb3["density"], frb4["density"]) + +def test_point_from_r(): + ds = fake_amr_ds(fields = ["density"]) + pt1 = ds.r[0.5,0.3,0.1] + pt2 = ds.point([0.5,0.3,0.1]) + assert_equal(pt1["density"], pt2["density"]) + +def test_ray_from_r(): + ds = fake_amr_ds(fields = ["density"]) + ray1 = ds.r[(0.1,0.2,0.3):(0.4,0.5,0.6)] + ray2 = ds.ray((0.1,0.2,0.3), (0.4,0.5,0.6)) + assert_equal(ray1["density"], ray2["density"]) + + ray3 = ds.r[0.5*ds.domain_left_edge:0.5*ds.domain_right_edge] + ray4 = ds.ray(0.5*ds.domain_left_edge, 0.5*ds.domain_right_edge) + assert_equal(ray3["density"], ray4["density"]) + + start = [(0.1,"cm"), 0.2, (0.3,"cm")] + end = [(0.5,"cm"), (0.4,"cm"), 0.6] + ray5 = ds.r[start:end] + start_arr = [ds.quan(0.1,"cm"), 0.2, ds.quan(0.3,"cm")] + end_arr = [ds.quan(0.5,"cm"), ds.quan(0.4,"cm"), 0.6] + ray6 = ds.ray(start_arr, end_arr) + assert_equal(ray5["density"], ray6["density"]) + + ray7 = ds.r[start:end:500j] + ray8 = LineBuffer(ds, [0.1, 0.2, 0.3], [0.5, 0.4, 0.6], 500) + assert_equal(ray7["density"], ray8["density"]) + +def test_ortho_ray_from_r(): + ds = fake_amr_ds(fields = ["density"]) + ray1 = ds.r[:,0.3,0.2] + ray2 = ds.ortho_ray("x",[0.3, 0.2]) + assert_equal(ray1["density"], ray2["density"]) + + # the y-coord is funny so test it too + ray3 = ds.r[0.3,:,0.2] + ray4 = ds.ortho_ray("y", [0.2, 0.3]) + assert_equal(ray3["density"], ray4["density"]) + + # Test ray which doesn't cover the whole domain + box = ds.box([0.25, 0.0, 0.0], [0.75, 1.0, 1.0]) + ray5 = ds.r[0.25:0.75,0.3,0.2] + ray6 = ds.ortho_ray("x", [0.3, 0.2], data_source=box) + assert_equal(ray5["density"], ray6["density"]) + + # Test fixed-resolution rays + ray7 = ds.r[0.25:0.75:100j,0.3,0.2] + ray8 = LineBuffer(ds, [0.2525,0.3,0.2], [0.7475,0.3,0.2], 100) + assert_equal(ray7["density"], ray8["density"]) def test_particle_counts(): ds = fake_random_ds(16, particles=100) @@ -69,3 +145,10 @@ pds = fake_particle_ds(npart=128) assert pds.particle_type_counts == {'io': 128} + + +g30 = "IsolatedGalaxy/galaxy0030/galaxy0030" +@requires_file(g30) +def test_checksum(): + assert fake_random_ds(16).checksum == 'notafile' + assert data_dir_load(g30).checksum == '6169536e4b9f737ce3d3ad440df44c58' diff -Nru yt-3.3.3/yt/data_objects/tests/test_derived_quantities.py yt-3.4.0/yt/data_objects/tests/test_derived_quantities.py --- yt-3.3.3/yt/data_objects/tests/test_derived_quantities.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_derived_quantities.py 2017-08-10 18:02:57.000000000 +0000 @@ -15,17 +15,17 @@ "velocity_x", "velocity_y", "velocity_z")) for sp in [ds.sphere("c", (0.25, 'unitary')), ds.r[0.5,:,:]]: mi, ma = sp.quantities["Extrema"]("density") - yield assert_equal, mi, np.nanmin(sp["density"]) - yield assert_equal, ma, np.nanmax(sp["density"]) + assert_equal(mi, np.nanmin(sp["density"])) + assert_equal(ma, np.nanmax(sp["density"])) dd = ds.all_data() mi, ma = dd.quantities["Extrema"]("density") - yield assert_equal, mi, np.nanmin(dd["density"]) - yield assert_equal, ma, np.nanmax(dd["density"]) + assert_equal(mi, np.nanmin(dd["density"])) + assert_equal(ma, np.nanmax(dd["density"])) sp = ds.sphere("max", (0.25, 'unitary')) - yield assert_equal, np.any(np.isnan(sp["radial_velocity"])), False + assert_equal(np.any(np.isnan(sp["radial_velocity"])), False) mi, ma = dd.quantities["Extrema"]("radial_velocity") - yield assert_equal, mi, np.nanmin(dd["radial_velocity"]) - yield assert_equal, ma, np.nanmax(dd["radial_velocity"]) + assert_equal(mi, np.nanmin(dd["radial_velocity"])) + assert_equal(ma, np.nanmax(dd["radial_velocity"])) def test_average(): for nprocs in [1, 2, 4, 8]: @@ -33,11 +33,11 @@ for ad in [ds.all_data(), ds.r[0.5, :, :]]: my_mean = ad.quantities["WeightedAverageQuantity"]("density", "ones") - yield assert_rel_equal, my_mean, ad["density"].mean(), 12 + assert_rel_equal(my_mean, ad["density"].mean(), 12) my_mean = ad.quantities["WeightedAverageQuantity"]("density", "cell_mass") a_mean = (ad["density"] * ad["cell_mass"]).sum() / ad["cell_mass"].sum() - yield assert_rel_equal, my_mean, a_mean, 12 + assert_rel_equal(my_mean, a_mean, 12) def test_variance(): for nprocs in [1, 2, 4, 8]: @@ -45,15 +45,15 @@ for ad in [ds.all_data(), ds.r[0.5, :, :]]: my_std, my_mean = ad.quantities["WeightedVariance"]("density", "ones") - yield assert_rel_equal, my_mean, ad["density"].mean(), 12 - yield assert_rel_equal, my_std, ad["density"].std(), 12 + assert_rel_equal(my_mean, ad["density"].mean(), 12) + assert_rel_equal(my_std, ad["density"].std(), 12) my_std, my_mean = ad.quantities["WeightedVariance"]("density", "cell_mass") a_mean = (ad["density"] * ad["cell_mass"]).sum() / ad["cell_mass"].sum() - yield assert_rel_equal, my_mean, a_mean, 12 + assert_rel_equal(my_mean, a_mean, 12) a_std = np.sqrt((ad["cell_mass"] * (ad["density"] - a_mean)**2).sum() / ad["cell_mass"].sum()) - yield assert_rel_equal, my_std, a_std, 12 + assert_rel_equal(my_std, a_std, 12) def test_max_location(): for nprocs in [1, 2, 4, 8]: @@ -62,13 +62,13 @@ mv, x, y, z = ad.quantities.max_location(("gas", "density")) - yield assert_equal, mv, ad["density"].max() + assert_equal(mv, ad["density"].max()) mi = np.argmax(ad["density"]) - yield assert_equal, ad["x"][mi], x - yield assert_equal, ad["y"][mi], y - yield assert_equal, ad["z"][mi], z + assert_equal(ad["x"][mi], x) + assert_equal(ad["y"][mi], y) + assert_equal(ad["z"][mi], z) def test_min_location(): for nprocs in [1, 2, 4, 8]: @@ -77,13 +77,13 @@ mv, x, y, z = ad.quantities.min_location(("gas", "density")) - yield assert_equal, mv, ad["density"].min() + assert_equal(mv, ad["density"].min()) mi = np.argmin(ad["density"]) - yield assert_equal, ad["x"][mi], x - yield assert_equal, ad["y"][mi], y - yield assert_equal, ad["z"][mi], z + assert_equal(ad["x"][mi], x) + assert_equal(ad["y"][mi], y) + assert_equal(ad["z"][mi], z) def test_sample_at_min_field_values(): for nprocs in [1, 2, 4, 8]: @@ -94,12 +94,12 @@ mv, temp, vm = ad.quantities.sample_at_min_field_values( "density", ["temperature", "velocity_x"]) - yield assert_equal, mv, ad["density"].min() + assert_equal(mv, ad["density"].min()) mi = np.argmin(ad["density"]) - yield assert_equal, ad["temperature"][mi], temp - yield assert_equal, ad["velocity_x"][mi], vm + assert_equal(ad["temperature"][mi], temp) + assert_equal(ad["velocity_x"][mi], vm) def test_sample_at_max_field_values(): for nprocs in [1, 2, 4, 8]: @@ -110,13 +110,9 @@ mv, temp, vm = ad.quantities.sample_at_max_field_values( "density", ["temperature", "velocity_x"]) - yield assert_equal, mv, ad["density"].max() + assert_equal(mv, ad["density"].max()) mi = np.argmax(ad["density"]) - yield assert_equal, ad["temperature"][mi], temp - yield assert_equal, ad["velocity_x"][mi], vm - -if __name__ == "__main__": - for i in test_extrema(): - i[0](*i[1:]) + assert_equal(ad["temperature"][mi], temp) + assert_equal(ad["velocity_x"][mi], vm) diff -Nru yt-3.3.3/yt/data_objects/tests/test_ellipsoid.py yt-3.4.0/yt/data_objects/tests/test_ellipsoid.py --- yt-3.3.3/yt/data_objects/tests/test_ellipsoid.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_ellipsoid.py 2017-08-10 18:02:57.000000000 +0000 @@ -40,7 +40,7 @@ e0 = e0s[:,i] tilt = tilts[i] ell = ds.ellipsoid(c, A, B, C, e0, tilt) - yield assert_array_less, ell["radius"], A + assert_array_less(ell["radius"], A) p = np.array([ell[ax] for ax in 'xyz']) dot_evec = [np.zeros_like(ell["radius"]) for i in range(3)] vecs = [ell._e0, ell._e1, ell._e2] @@ -55,4 +55,4 @@ dist = 0 for ax_i in range(3): dist += dot_evec[ax_i]**2.0 / mags[ax_i]**2.0 - yield assert_array_less, dist, 1.0 + assert_array_less(dist, 1.0) diff -Nru yt-3.3.3/yt/data_objects/tests/test_extract_regions.py yt-3.4.0/yt/data_objects/tests/test_extract_regions.py --- yt-3.3.3/yt/data_objects/tests/test_extract_regions.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_extract_regions.py 2017-08-10 18:02:57.000000000 +0000 @@ -23,17 +23,15 @@ t = ( (dd["temperature"] > 0.5 ) & (dd["density"] < 0.75 ) & (dd["velocity_x"] > 0.25 ) ) - yield assert_equal, np.all(r["temperature"] > 0.5), True - yield assert_equal, np.all(r["density"] < 0.75), True - yield assert_equal, np.all(r["velocity_x"] > 0.25), True - yield assert_equal, np.sort(dd["density"][t]), np.sort(r["density"]) - yield assert_equal, np.sort(dd["x"][t]), np.sort(r["x"]) - # We are disabling these, as cutting cut regions does not presently - # work - #r2 = r.cut_region( [ "obj['temperature'] < 0.75" ] ) - #t2 = (r["temperature"] < 0.75) - #yield assert_equal, np.sort(r2["temperature"]), np.sort(r["temperature"][t2]) - #yield assert_equal, np.all(r2["temperature"] < 0.75), True + assert_equal(np.all(r["temperature"] > 0.5), True) + assert_equal(np.all(r["density"] < 0.75), True) + assert_equal(np.all(r["velocity_x"] > 0.25), True) + assert_equal(np.sort(dd["density"][t]), np.sort(r["density"])) + assert_equal(np.sort(dd["x"][t]), np.sort(r["x"])) + r2 = r.cut_region( [ "obj['temperature'] < 0.75" ] ) + t2 = (r["temperature"] < 0.75) + assert_equal(np.sort(r2["temperature"]), np.sort(r["temperature"][t2])) + assert_equal(np.all(r2["temperature"] < 0.75), True) # Now we can test some projections dd = ds.all_data() @@ -42,9 +40,9 @@ p1 = ds.proj("density", 0, data_source=dd, weight_field=weight) p2 = ds.proj("density", 0, data_source=cr, weight_field=weight) for f in p1.field_data: - yield assert_almost_equal, p1[f], p2[f] + assert_almost_equal(p1[f], p2[f]) cr = dd.cut_region(["obj['density'] > 0.25"]) p2 = ds.proj("density", 2, data_source=cr) - yield assert_equal, p2["density"].max() > 0.25, True + assert_equal(p2["density"].max() > 0.25, True) p2 = ds.proj("density", 2, data_source=cr, weight_field = "density") - yield assert_equal, p2["density"].max() > 0.25, True + assert_equal(p2["density"].max() > 0.25, True) diff -Nru yt-3.3.3/yt/data_objects/tests/test_fluxes.py yt-3.4.0/yt/data_objects/tests/test_fluxes.py --- yt-3.3.3/yt/data_objects/tests/test_fluxes.py 2016-12-05 20:10:54.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_fluxes.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,7 +1,19 @@ +import os +import shutil +import tempfile + +import numpy as np + +from unittest import TestCase + from yt.testing import \ fake_random_ds, \ assert_almost_equal, \ - assert_equal + assert_equal, \ + requires_file + +from yt.convenience import \ + load def setup(): from yt.config import ytcfg @@ -11,9 +23,10 @@ ds = fake_random_ds(64, nprocs = 4) dd = ds.all_data() surf = ds.surface(dd, "x", 0.51) - yield assert_equal, surf["x"], 0.51 + assert_equal(surf["x"], 0.51) flux = surf.calculate_flux("ones", "zeros", "zeros", "ones") - yield assert_almost_equal, flux, 1.0, 12 + assert_almost_equal(flux.value, 1.0, 12) + assert_equal(str(flux.units), 'cm**2') def test_sampling(): ds = fake_random_ds(64, nprocs = 4) @@ -21,4 +34,98 @@ for i, ax in enumerate('xyz'): surf = ds.surface(dd, ax, 0.51) surf.get_data(ax, "vertex") - yield assert_equal, surf.vertex_samples[ax], surf.vertices[i,:] + assert_equal(surf.vertex_samples[ax], surf.vertices[i,:]) + assert_equal(str(surf.vertices.units), 'code_length') + dens = surf['density'] + vert_shape = surf.vertices.shape + assert_equal(dens.shape[0], vert_shape[1]//vert_shape[0]) + assert_equal(str(dens.units), 'g/cm**3') + +ISOGAL = 'IsolatedGalaxy/galaxy0030/galaxy0030' + +class ExporterTests(TestCase): + + def setUp(self): + self.curdir = os.getcwd() + self.tmpdir = tempfile.mkdtemp() + os.chdir(self.tmpdir) + + def tearDown(self): + os.chdir(self.curdir) + shutil.rmtree(self.tmpdir) + + def test_export_ply(self): + ds = fake_random_ds(64, nprocs = 4) + dd = ds.all_data() + surf = ds.surface(dd, 'x', 0.51) + surf.export_ply('my_ply.ply', bounds=[(0, 1), (0, 1), (0, 1)]) + assert os.path.exists('my_ply.ply') + + @requires_file(ISOGAL) + def test_export_obj(self): + ds = load(ISOGAL) + sp = ds.sphere("max", (10, "kpc")) + trans = 1.0 + distf = 3.1e18*1e3 # distances into kpc + surf = ds.surface(sp, "density", 5e-27) + surf.export_obj("my_galaxy", transparency=trans, dist_fac = distf) + assert os.path.exists('my_galaxy.obj') + assert os.path.exists('my_galaxy.mtl') + + mi, ma = sp.quantities.extrema('temperature') + rhos = [1e-24, 1e-25] + trans = [0.5, 1.0] + for i, r in enumerate(rhos): + surf = ds.surface(sp,'density',r) + surf.export_obj("my_galaxy_color".format(i), + transparency=trans[i], + color_field='temperature', dist_fac = distf, + plot_index = i, color_field_max = ma, + color_field_min = mi) + + assert os.path.exists('my_galaxy_color.obj') + assert os.path.exists('my_galaxy_color.mtl') + + def _Emissivity(field, data): + return (data['density']*data['density'] * + np.sqrt(data['temperature'])) + ds.add_field("emissivity", sampling_type='cell', function=_Emissivity, + units=r"g**2*sqrt(K)/cm**6") + for i, r in enumerate(rhos): + surf = ds.surface(sp,'density',r) + surf.export_obj("my_galaxy_emis".format(i), + transparency=trans[i], + color_field='temperature', + emit_field='emissivity', + dist_fac = distf, plot_index = i) + + assert os.path.exists('my_galaxy_emis.obj') + assert os.path.exists('my_galaxy_emis.mtl') + +@requires_file(ISOGAL) +def test_correct_output_unit(): + # see issue #1368 + ds = load(ISOGAL) + x = y = z = .5 + sp1 = ds.sphere((x,y,z), (300, 'kpc')) + Nmax = sp1.max('HI_Density') + sur = ds.surface(sp1,"HI_Density", .5*Nmax) + sur['x'][0] + +@requires_file(ISOGAL) +def test_radius_surface(): + # see #1407 + ds = load(ISOGAL) + reg = ds.all_data() + sp = ds.sphere(ds.domain_center, (0.5, 'code_length')) + for obj in [reg, sp]: + for rad in [0.05, .1, .4]: + surface = ds.surface(obj, 'radius', (rad, 'code_length')) + assert_almost_equal( + surface.surface_area.v, 4*np.pi*rad**2, decimal=2) + verts = surface.vertices + for i in range(3): + assert_almost_equal( + verts[i, :].min().v, 0.5-rad, decimal=2) + assert_almost_equal( + verts[i, :].max().v, 0.5+rad, decimal=2) diff -Nru yt-3.3.3/yt/data_objects/tests/test_image_array.py yt-3.4.0/yt/data_objects/tests/test_image_array.py --- yt-3.3.3/yt/data_objects/tests/test_image_array.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_image_array.py 2017-08-10 18:02:57.000000000 +0000 @@ -5,7 +5,8 @@ import unittest from yt.data_objects.image_array import ImageArray from yt.testing import \ - assert_equal + assert_equal, \ + requires_module def setup(): @@ -26,14 +27,14 @@ im_arr = ImageArray(dummy_image(10.0, 4)) new_im = im_arr.rescale(inline=False) - yield assert_equal, im_arr[:, :, :3].max(), 2 * 10. - yield assert_equal, im_arr[:, :, 3].max(), 3 * 10. - yield assert_equal, new_im[:, :, :3].sum(axis=2).max(), 1.0 - yield assert_equal, new_im[:, :, 3].max(), 1.0 + assert_equal(im_arr[:, :, :3].max(), 2 * 10.) + assert_equal(im_arr[:, :, 3].max(), 3 * 10.) + assert_equal(new_im[:, :, :3].sum(axis=2).max(), 1.0) + assert_equal(new_im[:, :, 3].max(), 1.0) im_arr.rescale() - yield assert_equal, im_arr[:, :, :3].sum(axis=2).max(), 1.0 - yield assert_equal, im_arr[:, :, 3].max(), 1.0 + assert_equal(im_arr[:, :, :3].sum(axis=2).max(), 1.0) + assert_equal(im_arr[:, :, 3].max(), 1.0) class TestImageArray(unittest.TestCase): @@ -55,6 +56,7 @@ assert str(new_im.units) == 'km' + @requires_module('h5py') def test_image_array_hdf5(self): myinfo = {'field': 'dinosaurs', 'east_vector': np.array([1., 0., 0.]), 'north_vector': np.array([0., 0., 1.]), diff -Nru yt-3.3.3/yt/data_objects/tests/test_numpy_ops.py yt-3.4.0/yt/data_objects/tests/test_numpy_ops.py --- yt-3.3.3/yt/data_objects/tests/test_numpy_ops.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_numpy_ops.py 2017-08-10 18:02:57.000000000 +0000 @@ -10,9 +10,10 @@ def test_mean_sum_integrate(): for nprocs in [-1, 1, 2, 16]: if nprocs == -1: - ds = fake_amr_ds(fields=("density",)) + ds = fake_amr_ds(fields=("density",), particles=20) else: - ds = fake_random_ds(32, nprocs=nprocs, fields=("density",)) + ds = fake_random_ds(32, nprocs=nprocs, fields=("density",), + particles=20) ad = ds.all_data() # Sums @@ -20,80 +21,109 @@ q1 = ad.quantities.total_quantity('density') - yield assert_equal, q, q1 + assert_equal(q, q1) + + q = ad.sum('particle_ones') + + q1 = ad.quantities.total_quantity('particle_ones') + + assert_equal(q, q1) # Weighted Averages w = ad.mean("density") w1 = ad.quantities.weighted_average_quantity('density', 'ones') - yield assert_equal, w, w1 + assert_equal(w, w1) w = ad.mean("density", weight="density") w1 = ad.quantities.weighted_average_quantity('density', 'density') - yield assert_equal, w, w1 + assert_equal(w, w1) + + w = ad.mean('particle_mass') + + w1 = ad.quantities.weighted_average_quantity( + 'particle_mass', 'particle_ones') + + assert_equal(w, w1) + + w = ad.mean('particle_mass', weight='particle_mass') + + w1 = ad.quantities.weighted_average_quantity( + 'particle_mass', 'particle_mass') + + assert_equal(w, w1) # Projections p = ad.sum('density', axis=0) p1 = ds.proj('density', 0, data_source=ad, method="sum") - yield assert_equal, p['density'], p1['density'] + assert_equal(p['density'], p1['density']) # Check by axis-name p = ad.sum('density', axis='x') - yield assert_equal, p['density'], p1['density'] + assert_equal(p['density'], p1['density']) # Now we check proper projections p = ad.integrate("density", axis=0) p1 = ds.proj("density", 0, data_source=ad) - yield assert_equal, p['density'], p1['density'] + assert_equal(p['density'], p1['density']) # Check by axis-name p = ad.integrate('density', axis='x') - yield assert_equal, p['density'], p1['density'] + assert_equal(p['density'], p1['density']) def test_min_max(): for nprocs in [-1, 1, 2, 16]: if nprocs == -1: - ds = fake_amr_ds(fields=("density","temperature")) + ds = fake_amr_ds(fields=("density","temperature"), particles=20) else: ds = fake_random_ds(32, nprocs=nprocs, - fields=("density","temperature")) + fields=("density","temperature"), particles=20) ad = ds.all_data() q = ad.min("density").v - yield assert_equal, q, ad["density"].min() + assert_equal(q, ad["density"].min()) q = ad.max("density").v - yield assert_equal, q, ad["density"].max() + assert_equal(q, ad["density"].max()) + + q = ad.min('particle_mass').v + assert_equal(q, ad['particle_mass'].min()) + + q = ad.max('particle_mass').v + assert_equal(q, ad['particle_mass'].max()) ptp = ad.ptp("density").v - yield assert_equal, ptp, ad["density"].max() - ad["density"].min() + assert_equal(ptp, ad["density"].max() - ad["density"].min()) + + ptp = ad.ptp("particle_mass").v + assert_equal(ptp, ad["particle_mass"].max() - ad["particle_mass"].min()) p = ad.max("density", axis=1) p1 = ds.proj("density", 1, data_source=ad, method="mip") - yield assert_equal, p["density"], p1["density"] + assert_equal(p["density"], p1["density"]) p = ad.max("density", axis="y") p1 = ds.proj("density", 1, data_source=ad, method="mip") - yield assert_equal, p["density"], p1["density"] + assert_equal(p["density"], p1["density"]) # Test that we can get multiple in a single pass qrho, qtemp = ad.max(["density", "temperature"]) - yield assert_equal, qrho, ad["density"].max() - yield assert_equal, qtemp, ad["temperature"].max() + assert_equal(qrho, ad["density"].max()) + assert_equal(qtemp, ad["temperature"].max()) qrho, qtemp = ad.min(["density", "temperature"]) - yield assert_equal, qrho, ad["density"].min() - yield assert_equal, qtemp, ad["temperature"].min() + assert_equal(qrho, ad["density"].min()) + assert_equal(qtemp, ad["temperature"].min()) def test_argmin(): for nprocs in [-1, 1, 2, 16]: @@ -106,18 +136,18 @@ ad = ds.all_data() q = ad.argmin("density", axis=["density"]) - yield assert_equal, q, ad["density"].min() + assert_equal(q, ad["density"].min()) q1, q2 = ad.argmin("density", axis=["density", "temperature"]) mi = np.argmin(ad["density"]) - yield assert_equal, q1, ad["density"].min() - yield assert_equal, q2, ad["temperature"][mi] + assert_equal(q1, ad["density"].min()) + assert_equal(q2, ad["temperature"][mi]) pos = ad.argmin("density") mi = np.argmin(ad["density"]) - yield assert_equal, pos[0], ad["x"][mi] - yield assert_equal, pos[1], ad["y"][mi] - yield assert_equal, pos[2], ad["z"][mi] + assert_equal(pos[0], ad["x"][mi]) + assert_equal(pos[1], ad["y"][mi]) + assert_equal(pos[2], ad["z"][mi]) def test_argmax(): for nprocs in [-1, 1, 2, 16]: @@ -130,15 +160,15 @@ ad = ds.all_data() q = ad.argmax("density", axis=["density"]) - yield assert_equal, q, ad["density"].max() + assert_equal(q, ad["density"].max()) q1, q2 = ad.argmax("density", axis=["density", "temperature"]) mi = np.argmax(ad["density"]) - yield assert_equal, q1, ad["density"].max() - yield assert_equal, q2, ad["temperature"][mi] + assert_equal(q1, ad["density"].max()) + assert_equal(q2, ad["temperature"][mi]) pos = ad.argmax("density") mi = np.argmax(ad["density"]) - yield assert_equal, pos[0], ad["x"][mi] - yield assert_equal, pos[1], ad["y"][mi] - yield assert_equal, pos[2], ad["z"][mi] + assert_equal(pos[0], ad["x"][mi]) + assert_equal(pos[1], ad["y"][mi]) + assert_equal(pos[2], ad["z"][mi]) diff -Nru yt-3.3.3/yt/data_objects/tests/test_ortho_rays.py yt-3.4.0/yt/data_objects/tests/test_ortho_rays.py --- yt-3.3.3/yt/data_objects/tests/test_ortho_rays.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_ortho_rays.py 2017-08-10 18:02:57.000000000 +0000 @@ -25,5 +25,5 @@ (np.abs(my_all[axes[my_axes[1]]] - ocoord[1]) <= 0.5 * dx[my_axes[1]]) - yield assert_equal, my_oray['density'].sum(), \ - my_all['density'][my_cells].sum() + assert_equal(my_oray['density'].sum(), + my_all['density'][my_cells].sum()) diff -Nru yt-3.3.3/yt/data_objects/tests/test_particle_filter.py yt-3.4.0/yt/data_objects/tests/test_particle_filter.py --- yt-3.3.3/yt/data_objects/tests/test_particle_filter.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_particle_filter.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,6 +1,8 @@ from __future__ import print_function import yt -from yt.testing import requires_file +from yt.testing import \ + assert_equal, \ + requires_file from yt.data_objects.particle_filters import \ add_particle_filter, particle_filter @@ -45,3 +47,22 @@ ad = ds.all_data() ad['deposit', 'stars_cic'] assert True + +@requires_file(iso_galaxy) +def test_covering_grid_particle_filter(): + @particle_filter(requires=["particle_type"], filtered_type='all') + def stars(pfilter, data): + filter = data[(pfilter.filtered_type, "particle_type")] == 2 + return filter + + ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030') + + ds.add_particle_filter('stars') + + for grid in ds.index.grids[20:31]: + cg = ds.covering_grid(grid.Level, grid.LeftEdge, grid.ActiveDimensions) + + assert_equal(cg['stars', 'particle_ones'].shape[0], + grid['stars', 'particle_ones'].shape[0]) + assert_equal(cg['stars', 'particle_mass'].shape[0], + grid['stars', 'particle_mass'].shape[0]) diff -Nru yt-3.3.3/yt/data_objects/tests/test_particle_trajectories.py yt-3.4.0/yt/data_objects/tests/test_particle_trajectories.py --- yt-3.3.3/yt/data_objects/tests/test_particle_trajectories.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_particle_trajectories.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,45 @@ +import glob +import os + +from yt.config import ytcfg +from yt.data_objects.time_series import DatasetSeries +from yt.utilities.answer_testing.framework import \ + requires_ds, \ + GenericArrayTest + +def setup(): + ytcfg["yt","__withintesting"] = "True" + +data_path = ytcfg.get("yt", "test_data_dir") + +pfields = ["particle_position_x", "particle_position_y", "particle_position_z"] +vfields = ["particle_velocity_x", "particle_velocity_y", "particle_velocity_z"] + +@requires_ds("Orbit/orbit_hdf5_chk_0000") +def test_orbit_traj(): + fields = ["particle_velocity_x", "particle_velocity_y", "particle_velocity_z"] + my_fns = glob.glob(os.path.join(data_path, "Orbit/orbit_hdf5_chk_00[0-9][0-9]")) + my_fns.sort() + ts = DatasetSeries(my_fns) + ds = ts[0] + traj = ts.particle_trajectories([1, 2], fields=fields, suppress_logging=True) + for field in pfields+vfields: + def field_func(name): + return traj[field] + yield GenericArrayTest(ds, field_func, args=[field]) + +@requires_ds("enzo_tiny_cosmology/DD0000/DD0000") +def test_etc_traj(): + fields = ["particle_velocity_x", "particle_velocity_y", "particle_velocity_z"] + my_fns = glob.glob(os.path.join(data_path, "enzo_tiny_cosmology/DD000[0-9]/*.hierarchy")) + my_fns.sort() + ts = DatasetSeries(my_fns) + ds = ts[0] + sp = ds.sphere("max", (0.5, "Mpc")) + indices = sp["particle_index"][sp["particle_type"] == 1][:5] + traj = ts.particle_trajectories(indices, fields=fields, suppress_logging=True) + traj.add_fields(["density"]) + for field in pfields+vfields+["density"]: + def field_func(name): + return traj[field] + yield GenericArrayTest(ds, field_func, args=[field]) diff -Nru yt-3.3.3/yt/data_objects/tests/test_pickle.py yt-3.4.0/yt/data_objects/tests/test_pickle.py --- yt-3.3.3/yt/data_objects/tests/test_pickle.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_pickle.py 2017-08-10 18:02:57.000000000 +0000 @@ -52,9 +52,9 @@ assert_equal.description = \ "%s: File was pickle-loaded succesfully" % __name__ - yield assert_equal, test_load is not None, True + assert_equal(test_load is not None, True) assert_equal.description = \ "%s: Length of pickle-loaded connected set object" % __name__ - yield assert_equal, len(contours[1][0]), len(test_load) + assert_equal(len(contours[1][0]), len(test_load)) os.remove(cpklfile.name) diff -Nru yt-3.3.3/yt/data_objects/tests/test_profiles.py yt-3.4.0/yt/data_objects/tests/test_profiles.py --- yt-3.3.3/yt/data_objects/tests/test_profiles.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_profiles.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,3 +1,4 @@ +import yt import numpy as np from yt.data_objects.profiles import \ @@ -54,9 +55,8 @@ for p1d in [direct_profile, indirect_profile_s, indirect_profile_t]: - yield assert_equal, p1d["index", "ones"].sum(), nv - yield assert_rel_equal, tt, \ - p1d["gas", "temperature"].sum(), 7 + assert_equal(p1d["index", "ones"].sum(), nv) + assert_rel_equal(tt, p1d["gas", "temperature"].sum(), 7) p2d = Profile2D( dd, @@ -64,8 +64,8 @@ "temperature", nb, tmi*e1, tma*e2, lf, weight_field=None) p2d.add_fields(["ones", "temperature"]) - yield assert_equal, p2d["ones"].sum(), nv - yield assert_rel_equal, tt, p2d["temperature"].sum(), 7 + assert_equal(p2d["ones"].sum(), nv) + assert_rel_equal(tt, p2d["temperature"].sum(), 7) p3d = Profile3D( dd, @@ -74,39 +74,39 @@ "dinosaurs", nb, dmi*e1, dma*e2, lf, weight_field=None) p3d.add_fields(["ones", "temperature"]) - yield assert_equal, p3d["ones"].sum(), nv - yield assert_rel_equal, tt, p3d["temperature"].sum(), 7 + assert_equal(p3d["ones"].sum(), nv) + assert_rel_equal(tt, p3d["temperature"].sum(), 7) p1d = Profile1D(dd, "x", nb, 0.0, 1.0, False, weight_field = None) p1d.add_fields("ones") av = nv / nb - yield assert_equal, p1d["ones"], np.ones(nb)*av + assert_equal(p1d["ones"], np.ones(nb)*av) # We re-bin ones with a weight now p1d = Profile1D(dd, "x", nb, 0.0, 1.0, False, weight_field = "temperature") p1d.add_fields(["ones"]) - yield assert_equal, p1d["ones"], np.ones(nb) + assert_equal(p1d["ones"], np.ones(nb)) # Verify we can access "ones" after adding a new field # See issue 988 p1d.add_fields(["density"]) - yield assert_equal, p1d["ones"], np.ones(nb) + assert_equal(p1d["ones"], np.ones(nb)) p2d = Profile2D(dd, "x", nb, 0.0, 1.0, False, "y", nb, 0.0, 1.0, False, weight_field = None) p2d.add_fields("ones") av = nv / nb**2 - yield assert_equal, p2d["ones"], np.ones((nb, nb))*av + assert_equal(p2d["ones"], np.ones((nb, nb))*av) # We re-bin ones with a weight now p2d = Profile2D(dd, "x", nb, 0.0, 1.0, False, "y", nb, 0.0, 1.0, False, weight_field = "temperature") p2d.add_fields(["ones"]) - yield assert_equal, p2d["ones"], np.ones((nb, nb)) + assert_equal(p2d["ones"], np.ones((nb, nb))) p3d = Profile3D(dd, "x", nb, 0.0, 1.0, False, "y", nb, 0.0, 1.0, False, @@ -114,7 +114,7 @@ weight_field = None) p3d.add_fields("ones") av = nv / nb**3 - yield assert_equal, p3d["ones"], np.ones((nb, nb, nb))*av + assert_equal(p3d["ones"], np.ones((nb, nb, nb))*av) # We re-bin ones with a weight now p3d = Profile3D(dd, "x", nb, 0.0, 1.0, False, @@ -122,7 +122,20 @@ "z", nb, 0.0, 1.0, False, weight_field = "temperature") p3d.add_fields(["ones"]) - yield assert_equal, p3d["ones"], np.ones((nb,nb,nb)) + assert_equal(p3d["ones"], np.ones((nb,nb,nb))) + + p2d = create_profile(dd, ('gas', 'density'), ('gas', 'temperature'), + weight_field=('gas', 'cell_mass'), + extrema={'density': (None, rma*e2)}) + assert_equal(p2d.x_bins[0], rmi - np.spacing(rmi)) + assert_equal(p2d.x_bins[-1], rma*e2) + + p2d = create_profile(dd, ('gas', 'density'), ('gas', 'temperature'), + weight_field=('gas', 'cell_mass'), + extrema={'density': (rmi*e2, None)}) + assert_equal(p2d.x_bins[0], rmi*e2) + assert_equal(p2d.x_bins[-1], rma + np.spacing(rma)) + extrema_s = {'particle_position_x': (0, 1)} logs_s = {'particle_position_x': False} @@ -138,32 +151,32 @@ p1d = Profile1D(dd, "particle_position_x", 128, 0.0, 1.0, False, weight_field = None) p1d.add_fields(["particle_ones"]) - yield assert_equal, p1d["particle_ones"].sum(), 32**3 + assert_equal(p1d["particle_ones"].sum(), 32**3) p1d = create_profile(dd, ["particle_position_x"], ["particle_ones"], weight_field=None, n_bins=128, extrema=extrema_s, logs=logs_s) - yield assert_equal, p1d["particle_ones"].sum(), 32**3 + assert_equal(p1d["particle_ones"].sum(), 32**3) p1d = create_profile(dd, [("all", "particle_position_x")], [("all", "particle_ones")], weight_field=None, n_bins=128, extrema=extrema_t, logs=logs_t) - yield assert_equal, p1d["particle_ones"].sum(), 32**3 + assert_equal(p1d["particle_ones"].sum(), 32**3) p2d = Profile2D(dd, "particle_position_x", 128, 0.0, 1.0, False, "particle_position_y", 128, 0.0, 1.0, False, weight_field = None) p2d.add_fields(["particle_ones"]) - yield assert_equal, p2d["particle_ones"].sum(), 32**3 + assert_equal(p2d["particle_ones"].sum(), 32**3) p3d = Profile3D(dd, "particle_position_x", 128, 0.0, 1.0, False, "particle_position_y", 128, 0.0, 1.0, False, "particle_position_z", 128, 0.0, 1.0, False, weight_field = None) p3d.add_fields(["particle_ones"]) - yield assert_equal, p3d["particle_ones"].sum(), 32**3 + assert_equal(p3d["particle_ones"].sum(), 32**3) def test_mixed_particle_mesh_profiles(): ds = fake_random_ds(32, particles=10) @@ -195,3 +208,65 @@ assert_raises( YTIllDefinedProfile, PhasePlot, ad, 'particle_radius', 'particle_mass', 'particle_ones') + +def test_particle_profile_negative_field(): + # see Issue #1340 + n_particles = int(1e4) + + ppx, ppy, ppz = np.random.normal(size=[3, n_particles]) + pvx, pvy, pvz = - np.ones((3, n_particles)) + + data = {'particle_position_x': ppx, + 'particle_position_y': ppy, + 'particle_position_z': ppz, + 'particle_velocity_x': pvx, + 'particle_velocity_y': pvy, + 'particle_velocity_z': pvz} + + bbox = 1.1*np.array([[min(ppx), max(ppx)], [min(ppy), max(ppy)], [min(ppz), max(ppz)]]) + ds = yt.load_particles(data, bbox=bbox) + ad = ds.all_data() + + profile = yt.create_profile( + ad, + ["particle_position_x", "particle_position_y"], + "particle_velocity_x", + logs = {'particle_position_x': True, + 'particle_position_y': True, + 'particle_position_z': True}, + weight_field=None) + assert profile['particle_velocity_x'].min() < 0 + assert profile.x_bins.min() > 0 + assert profile.y_bins.min() > 0 + + profile = yt.create_profile( + ad, + ["particle_position_x", "particle_position_y"], + "particle_velocity_x", + weight_field=None) + assert profile['particle_velocity_x'].min() < 0 + assert profile.x_bins.min() < 0 + assert profile.y_bins.min() < 0 + + # can't use CIC deposition with log-scaled bin fields + with assert_raises(RuntimeError): + yt.create_profile( + ad, + ["particle_position_x", "particle_position_y"], + "particle_velocity_x", + logs = {'particle_position_x': True, + 'particle_position_y': False, + 'particle_position_z': False}, + weight_field=None, deposition='cic') + + # can't use CIC deposition with accumulation or fractional + with assert_raises(RuntimeError): + yt.create_profile( + ad, + ["particle_position_x", "particle_position_y"], + "particle_velocity_x", + logs = {'particle_position_x': False, + 'particle_position_y': False, + 'particle_position_z': False}, + weight_field=None, deposition='cic', + accumulation=True, fractional=True) diff -Nru yt-3.3.3/yt/data_objects/tests/test_projection.py yt-3.4.0/yt/data_objects/tests/test_projection.py --- yt-3.3.3/yt/data_objects/tests/test_projection.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_projection.py 2017-08-10 18:02:57.000000000 +0000 @@ -44,8 +44,8 @@ # test if projections inherit the field parameters of their data sources dd.set_field_parameter("bulk_velocity", np.array([0,1,2])) proj = ds.proj("density", 0, data_source=dd) - yield assert_equal, dd.field_parameters["bulk_velocity"], \ - proj.field_parameters["bulk_velocity"] + assert_equal(dd.field_parameters["bulk_velocity"], + proj.field_parameters["bulk_velocity"]) # Some simple projection tests with single grids for ax, an in enumerate("xyz"): @@ -54,17 +54,18 @@ for wf in ['density', ("gas", "density"), None]: proj = ds.proj(["ones", "density"], ax, weight_field=wf) if wf is None: - yield assert_equal, proj["ones"].sum(), LENGTH_UNIT*proj["ones"].size - yield assert_equal, proj["ones"].min(), LENGTH_UNIT - yield assert_equal, proj["ones"].max(), LENGTH_UNIT + assert_equal(proj["ones"].sum(), + LENGTH_UNIT*proj["ones"].size) + assert_equal(proj["ones"].min(), LENGTH_UNIT) + assert_equal(proj["ones"].max(), LENGTH_UNIT) else: - yield assert_equal, proj["ones"].sum(), proj["ones"].size - yield assert_equal, proj["ones"].min(), 1.0 - yield assert_equal, proj["ones"].max(), 1.0 - yield assert_equal, np.unique(proj["px"]), uc[xax] - yield assert_equal, np.unique(proj["py"]), uc[yax] - yield assert_equal, np.unique(proj["pdx"]), 1.0/(dims[xax]*2.0) - yield assert_equal, np.unique(proj["pdy"]), 1.0/(dims[yax]*2.0) + assert_equal(proj["ones"].sum(), proj["ones"].size) + assert_equal(proj["ones"].min(), 1.0) + assert_equal(proj["ones"].max(), 1.0) + assert_equal(np.unique(proj["px"]), uc[xax]) + assert_equal(np.unique(proj["py"]), uc[yax]) + assert_equal(np.unique(proj["pdx"]), 1.0/(dims[xax]*2.0)) + assert_equal(np.unique(proj["pdy"]), 1.0/(dims[yax]*2.0)) plots = [proj.to_pw(fields='density'), proj.to_pw()] for pw in plots: for p in pw.plots.values(): @@ -75,16 +76,15 @@ frb = proj.to_frb((1.0, 'unitary'), 64) for proj_field in ['ones', 'density', 'temperature']: fi = ds._get_field_info(proj_field) - yield assert_equal, frb[proj_field].info['data_source'], \ - proj.__str__() - yield assert_equal, frb[proj_field].info['axis'], \ - ax - yield assert_equal, frb[proj_field].info['field'], \ - proj_field + assert_equal(frb[proj_field].info['data_source'], + proj.__str__()) + assert_equal(frb[proj_field].info['axis'], ax) + assert_equal(frb[proj_field].info['field'], proj_field) field_unit = Unit(fi.units) if wf is not None: - yield assert_equal, frb[proj_field].units, \ - Unit(field_unit, registry=ds.unit_registry) + assert_equal( + frb[proj_field].units, + Unit(field_unit, registry=ds.unit_registry)) else: if frb[proj_field].units.is_code_unit: proj_unit = "code_length" @@ -93,26 +93,23 @@ if field_unit != '' and field_unit != Unit(): proj_unit = \ "({0}) * {1}".format(field_unit, proj_unit) - yield assert_equal, frb[proj_field].units, \ - Unit(proj_unit, registry=ds.unit_registry) - yield assert_equal, frb[proj_field].info['xlim'], \ - frb.bounds[:2] - yield assert_equal, frb[proj_field].info['ylim'], \ - frb.bounds[2:] - yield assert_equal, frb[proj_field].info['center'], \ - proj.center + assert_equal( + frb[proj_field].units, + Unit(proj_unit, registry=ds.unit_registry)) + assert_equal(frb[proj_field].info['xlim'], frb.bounds[:2]) + assert_equal(frb[proj_field].info['ylim'], frb.bounds[2:]) + assert_equal(frb[proj_field].info['center'], proj.center) if wf is None: - yield assert_equal, \ - frb[proj_field].info['weight_field'], wf + assert_equal(frb[proj_field].info['weight_field'], wf) else: - yield assert_equal, \ - frb[proj_field].info['weight_field'], \ - proj.data_source._determine_fields(wf)[0] + assert_equal( + frb[proj_field].info['weight_field'], + proj.data_source._determine_fields(wf)[0]) # wf == None - yield assert_equal, wf, None + assert_equal(wf, None) v1 = proj["density"].sum() v2 = (LENGTH_UNIT * dd["density"] * dd["d%s" % an]).sum() - yield assert_rel_equal, v1, v2, 10 + assert_rel_equal(v1, v2, 10) teardown_func(fns) diff -Nru yt-3.3.3/yt/data_objects/tests/test_rays.py yt-3.4.0/yt/data_objects/tests/test_rays.py --- yt-3.3.3/yt/data_objects/tests/test_rays.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_rays.py 2017-08-10 18:02:57.000000000 +0000 @@ -30,7 +30,7 @@ p2 = ds.arr(pp2[:,i] + 1e-8 * np.random.random(3), 'code_length') my_ray = ds.ray(p1, p2) - yield assert_rel_equal, my_ray['dts'].sum(), unitary, 14 + assert_rel_equal(my_ray['dts'].sum(), unitary, 14) ray_cells = my_ray['dts'] > 0 # find cells intersected by the ray @@ -47,10 +47,10 @@ tout = tout.min(axis=0) my_cells = (tin < tout) & (tin < 1) & (tout > 0) - yield assert_equal, ray_cells.sum(), my_cells.sum() - yield assert_rel_equal, my_ray['density'][ray_cells].sum(), \ - my_all['density'][my_cells].sum(), 14 - yield assert_rel_equal, my_ray['dts'].sum(), unitary, 14 + assert_equal(ray_cells.sum(), my_cells.sum()) + assert_rel_equal(my_ray['density'][ray_cells].sum(), + my_all['density'][my_cells].sum(), 14) + assert_rel_equal(my_ray['dts'].sum(), unitary, 14) @requires_file('GadgetDiskGalaxy/snapshot_200.hdf5') def test_ray_in_particle_octree(): diff -Nru yt-3.3.3/yt/data_objects/tests/test_refinement.py yt-3.4.0/yt/data_objects/tests/test_refinement.py --- yt-3.3.3/yt/data_objects/tests/test_refinement.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_refinement.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,49 @@ +from yt.testing import \ + assert_array_equal, \ + assert_equal +import yt +import numpy as np + +def setup_fake_refby(): + refine_by=np.array([5, 1, 1]) + top_grid_dim = [100, 10, 2] + n1=100 + n2=10 + n3=2 + + grid_data = [ + dict(left_edge = [0.0, 0.0, 0.0], + right_edge = [1.0, np.pi, np.pi*2.], + level = 0, + dimensions = np.array([n1, n2, n3])), + dict(left_edge = [0., 0., 0.], + right_edge = [0.5, np.pi, np.pi*2.], + level = 1, + dimensions = refine_by*[n1/2.0, n2, n3]), + ] + + for g in grid_data: + g["density"] = (np.random.random(g["dimensions"].astype("i8")), + "g/cm**3") + bbox = np.array([[0.0, 1.0], [0.0, np.pi], [0.0, np.pi*2]]) + + ds = yt.load_amr_grids(grid_data, top_grid_dim, + bbox = bbox, geometry='spherical', + refine_by=refine_by, length_unit='kpc') + return ds + +def test_refine_by(): + ds = setup_fake_refby() + dd = ds.all_data() + # This checks that we always refine_by 1 in dimensions 2 and 3 + dims = ds.domain_dimensions*ds.refine_by**ds.max_level + for i in range(1, 3): + # Check the refine_by == 1 + ncoords = np.unique(dd.icoords[:,i]).size + assert_equal(ncoords, dims[i]) + for g in ds.index.grids: + dims = ds.domain_dimensions*ds.refine_by**g.Level + # Now we can check converting back to the reference space + v = ((g.icoords + 1) / dims.astype("f8")).max(axis=0) + v *= ds.domain_width + assert_array_equal(v, g.RightEdge.d) diff -Nru yt-3.3.3/yt/data_objects/tests/test_regions.py yt-3.4.0/yt/data_objects/tests/test_regions.py --- yt-3.3.3/yt/data_objects/tests/test_regions.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_regions.py 2017-08-10 17:56:56.000000000 +0000 @@ -0,0 +1,17 @@ +from yt.testing import \ + assert_array_equal, \ + fake_random_ds +from yt.units import cm + +def test_box_creation(): + + # test that creating a region with left and right edge + # with units works + ds = fake_random_ds(32, length_unit=2) + reg = ds.box([0, 0, 0]*cm, [2, 2, 2]*cm) + dens_units = reg['density'] + + reg = ds.box([0, 0, 0], [1, 1, 1]) + dens_no_units = reg['density'] + + assert_array_equal(dens_units, dens_no_units) diff -Nru yt-3.3.3/yt/data_objects/tests/test_slice.py yt-3.4.0/yt/data_objects/tests/test_slice.py --- yt-3.3.3/yt/data_objects/tests/test_slice.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_slice.py 2017-08-10 18:02:57.000000000 +0000 @@ -54,13 +54,13 @@ for wf in ["density", None]: slc = ds.slice(ax, slc_pos) shifted_slc = ds.slice(ax, slc_pos + grid_eps) - yield assert_equal, slc["ones"].sum(), slc["ones"].size - yield assert_equal, slc["ones"].min(), 1.0 - yield assert_equal, slc["ones"].max(), 1.0 - yield assert_equal, np.unique(slc["px"]), uc[xax] - yield assert_equal, np.unique(slc["py"]), uc[yax] - yield assert_equal, np.unique(slc["pdx"]), 0.5 / dims[xax] - yield assert_equal, np.unique(slc["pdy"]), 0.5 / dims[yax] + assert_equal(slc["ones"].sum(), slc["ones"].size) + assert_equal(slc["ones"].min(), 1.0) + assert_equal(slc["ones"].max(), 1.0) + assert_equal(np.unique(slc["px"]), uc[xax]) + assert_equal(np.unique(slc["py"]), uc[yax]) + assert_equal(np.unique(slc["pdx"]), 0.5 / dims[xax]) + assert_equal(np.unique(slc["pdy"]), 0.5 / dims[yax]) pw = slc.to_pw(fields='density') for p in pw.plots.values(): tmpfd, tmpname = tempfile.mkstemp(suffix='.png') @@ -72,25 +72,19 @@ shifted_frb = shifted_slc.to_frb((1.0, 'unitary'), 64) for slc_field in ['ones', 'density']: fi = ds._get_field_info(slc_field) - yield assert_equal, frb[slc_field].info['data_source'], \ - slc.__str__() - yield assert_equal, frb[slc_field].info['axis'], \ - ax - yield assert_equal, frb[slc_field].info['field'], \ - slc_field - yield assert_equal, frb[slc_field].units, \ - Unit(fi.units) - yield assert_equal, frb[slc_field].info['xlim'], \ - frb.bounds[:2] - yield assert_equal, frb[slc_field].info['ylim'], \ - frb.bounds[2:] - yield assert_equal, frb[slc_field].info['center'], \ - slc.center - yield assert_equal, frb[slc_field].info['coord'], \ - slc_pos - yield assert_equal, frb[slc_field], \ - shifted_frb[slc_field] - yield assert_equal, wf, None + assert_equal(frb[slc_field].info['data_source'], + slc.__str__()) + assert_equal(frb[slc_field].info['axis'], ax) + assert_equal(frb[slc_field].info['field'], slc_field) + assert_equal(frb[slc_field].units, Unit(fi.units)) + assert_equal(frb[slc_field].info['xlim'], + frb.bounds[:2]) + assert_equal(frb[slc_field].info['ylim'], + frb.bounds[2:]) + assert_equal(frb[slc_field].info['center'], slc.center) + assert_equal(frb[slc_field].info['coord'], slc_pos) + assert_equal(frb[slc_field], shifted_frb[slc_field]) + assert_equal(wf, None) teardown_func(fns) @@ -106,4 +100,4 @@ ds = fake_random_ds(64, nprocs=8, fields=["density"], negative=[False]) slc = ds.slice(2, 1.0) slc["density"] - yield assert_equal, slc["density"].size, 0 + assert_equal(slc["density"].size, 0) diff -Nru yt-3.3.3/yt/data_objects/tests/test_spheres.py yt-3.4.0/yt/data_objects/tests/test_spheres.py --- yt-3.3.3/yt/data_objects/tests/test_spheres.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_spheres.py 2017-08-10 18:02:57.000000000 +0000 @@ -32,8 +32,8 @@ # Set the bulk velocity field parameter sp1.set_field_parameter("bulk_velocity", bulk_vel) - yield assert_equal, np.any(sp0["radial_velocity"] == - sp1["radial_velocity"]), False + assert_equal(np.any(sp0["radial_velocity"] == sp1["radial_velocity"]), + False) # Radial profile without correction # Note we set n_bins = 8 here. @@ -50,12 +50,12 @@ logs = {'radius': False}, n_bins = 8) - yield assert_equal, rp0.x_bins, rp1.x_bins - yield assert_equal, rp0.used, rp1.used - yield assert_equal, rp0.used.sum() > rp0.used.size/2.0, True - yield assert_equal, np.any(rp0["radial_velocity"][rp0.used] == - rp1["radial_velocity"][rp1.used]), \ - False + assert_equal(rp0.x_bins, rp1.x_bins) + assert_equal(rp0.used, rp1.used) + assert_equal(rp0.used.sum() > rp0.used.size/2.0, True) + assert_equal(np.any(rp0["radial_velocity"][rp0.used] == + rp1["radial_velocity"][rp1.used]), + False) ref_sp = ds.sphere("c", 0.25) for f in _fields_to_compare: @@ -64,4 +64,4 @@ sp = ds.sphere(center, 0.25) for f in _fields_to_compare: sp[f].sort() - yield assert_equal, sp[f], ref_sp[f] + assert_equal(sp[f], ref_sp[f]) diff -Nru yt-3.3.3/yt/data_objects/tests/test_streamlines.py yt-3.4.0/yt/data_objects/tests/test_streamlines.py --- yt-3.3.3/yt/data_objects/tests/test_streamlines.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/tests/test_streamlines.py 2017-08-10 18:02:57.000000000 +0000 @@ -23,6 +23,6 @@ streams = Streamlines(ds, cs, length=length) streams.integrate_through_volume() for path in (streams.path(i) for i in range(8)): - yield assert_rel_equal, path['dts'].sum(), 1.0, 14 - yield assert_equal, np.all(path['t'] <= (1.0 + 1e-10)), True + assert_rel_equal(path['dts'].sum(), 1.0, 14) + assert_equal(np.all(path['t'] <= (1.0 + 1e-10)), True) path["density"] diff -Nru yt-3.3.3/yt/data_objects/time_series.py yt-3.4.0/yt/data_objects/time_series.py --- yt-3.3.3/yt/data_objects/time_series.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/data_objects/time_series.py 2017-08-10 18:02:57.000000000 +0000 @@ -32,6 +32,8 @@ create_quantity_proxy, \ analysis_task_registry, \ AnalysisTask +from yt.data_objects.particle_trajectories import \ + ParticleTrajectories from yt.funcs import \ iterable, \ ensure_list, \ @@ -399,6 +401,41 @@ self._dataset_cls = ds.__class__ return ds + def particle_trajectories(self, indices, fields=None, suppress_logging=False): + r"""Create a collection of particle trajectories in time over a series of + datasets. + + Parameters + ---------- + indices : array_like + An integer array of particle indices whose trajectories we + want to track. If they are not sorted they will be sorted. + fields : list of strings, optional + A set of fields that is retrieved when the trajectory + collection is instantiated. Default: None (will default + to the fields 'particle_position_x', 'particle_position_y', + 'particle_position_z') + suppress_logging : boolean + Suppress yt's logging when iterating over the simulation time + series. Default: False + + Examples + -------- + >>> my_fns = glob.glob("orbit_hdf5_chk_00[0-9][0-9]") + >>> my_fns.sort() + >>> fields = ["particle_position_x", "particle_position_y", + >>> "particle_position_z", "particle_velocity_x", + >>> "particle_velocity_y", "particle_velocity_z"] + >>> ds = load(my_fns[0]) + >>> init_sphere = ds.sphere(ds.domain_center, (.5, "unitary")) + >>> indices = init_sphere["particle_index"].astype("int") + >>> ts = DatasetSeries(my_fns) + >>> trajs = ts.particle_trajectories(indices, fields=fields) + >>> for t in trajs : + >>> print t["particle_velocity_x"].max(), t["particle_velocity_x"].min() + """ + return ParticleTrajectories(self, indices, fields=fields, suppress_logging=suppress_logging) + class TimeSeriesQuantitiesContainer(object): def __init__(self, data_object, quantities): self.data_object = data_object diff -Nru yt-3.3.3/yt/data_objects/unions.py yt-3.4.0/yt/data_objects/unions.py --- yt-3.3.3/yt/data_objects/unions.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/data_objects/unions.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,31 @@ +""" +Union structures which can be used to form unions of particles, meshes, +etc. Union is the base class from which trivial named union classes +can be derived + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2016, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from yt.funcs import ensure_list + +class Union(object): + def __init__(self, name, sub_types): + self.name = name + self.sub_types = ensure_list(sub_types) + + def __iter__(self): + for st in self.sub_types: + yield st + +class MeshUnion(Union): + def __init__(self, name, sub_types): + super(MeshUnion, self).__init__(name, sub_types) diff -Nru yt-3.3.3/yt/data_objects/unstructured_mesh.py yt-3.4.0/yt/data_objects/unstructured_mesh.py --- yt-3.3.3/yt/data_objects/unstructured_mesh.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/data_objects/unstructured_mesh.py 2017-08-10 18:02:57.000000000 +0000 @@ -22,8 +22,9 @@ fill_fcoords, fill_fwidths from yt.data_objects.data_containers import \ - YTFieldData, \ YTSelectionContainer +from yt.data_objects.field_data import \ + YTFieldData import yt.geometry.particle_deposit as particle_deposit class UnstructuredMesh(YTSelectionContainer): diff -Nru yt-3.3.3/yt/extern/pydot.py yt-3.4.0/yt/extern/pydot.py --- yt-3.3.3/yt/extern/pydot.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/extern/pydot.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,39 +1,49 @@ -# -*- coding: Latin-1 -*- """Graphviz's dot language Python interface. -This module provides with a full interface to create handle modify -and process graphs in Graphviz's dot language. +This module provides with a full interface to +create handle modify and process graphs in +Graphviz's dot language. References: -pydot Homepage: http://code.google.com/p/pydot/ +pydot Homepage: https://github.com/erocarrera/pydot Graphviz: http://www.graphviz.org/ DOT Language: http://www.graphviz.org/doc/info/lang.html -Programmed and tested with Graphviz 2.26.3 and Python 2.6 on OSX 10.6.4 -by Ero Carrera (c) 2004-2010 [ero@dkbza.org] +Copyright (c) 2005-2011 Ero Carrera -Distributed under MIT license [http://opensource.org/licenses/mit-license.html]. +Distributed under MIT license +[http://opensource.org/licenses/mit-license.html]. """ +from __future__ import division from __future__ import print_function - -__author__ = 'Ero Carrera' -__version__ = '1.0.4' -__license__ = 'MIT' - +import copy +import io import os import re import subprocess +import sys import tempfile -import copy -from yt.extern.six import string_types -# Commenting out this import as we are not including this -# functionality. -# try: -# import dot_parser -# except Exception, e: -# print "Couldn't import dot_parser, loading of dot files will not be possible." - +import warnings + +try: + import dot_parser +except Exception as e: + warnings.warn( + "Couldn't import dot_parser, " + "loading of dot files will not be possible.") + + +__author__ = 'Ero Carrera' +__version__ = '1.2.3' +__license__ = 'MIT' + + +PY3 = sys.version_info >= (3, 0, 0) +if PY3: + str_type = str +else: + str_type = basestring GRAPH_ATTRIBUTES = set( ['Damping', 'K', 'URL', 'aspect', 'bb', 'bgcolor', @@ -48,9 +58,9 @@ 'overlap_scaling', 'pack', 'packmode', 'pad', 'page', 'pagedir', 'quadtree', 'quantum', 'rankdir', 'ranksep', 'ratio', 'remincross', 'repulsiveforce', 'resolution', 'root', 'rotate', 'searchsize', 'sep', - 'showboxes', 'size', 'smoothing', 'sortv', 'splines', 'start', + 'showboxes', 'size', 'smoothing', 'sortv', 'splines', 'start', 'stylesheet', 'target', 'truecolor', 'viewport', 'voro_margin', - # for subgraphs + # for subgraphs 'rank' ] ) @@ -83,7 +93,7 @@ 'fillcolor', 'fontcolor', 'fontname', 'fontsize', 'label', 'labeljust', 'labelloc', 'lheight', 'lp', 'lwidth', 'nojustify', 'pencolor', 'penwidth', 'peripheries', 'sortv', 'style', 'target', 'tooltip'] ) - + # # Extented version of ASPN's Python Cookbook Recipe: @@ -94,7 +104,7 @@ # class frozendict(dict): def _blocked_attribute(obj): - raise AttributeError("A frozendict cannot be modified.") + raise AttributeError('A frozendict cannot be modified.') _blocked_attribute = property(_blocked_attribute) __delitem__ = __setitem__ = clear = _blocked_attribute @@ -107,8 +117,11 @@ for arg in args: if isinstance(arg, dict): arg = copy.copy(arg) - for k, v in arg.iteritems(): - if isinstance(v, dict): + for k in arg: + v = arg[k] + if isinstance(v, frozendict): + arg[k] = v + elif isinstance(v, dict): arg[k] = frozendict(v) elif isinstance(v, list): v_ = list() @@ -132,7 +145,7 @@ try: return self._cached_hash except AttributeError: - h = self._cached_hash = hash(tuple(sorted(self.iteritems()))) + h = self._cached_hash = hash(tuple(sorted(self.items()))) return h def __repr__(self): @@ -141,31 +154,42 @@ dot_keywords = ['graph', 'subgraph', 'digraph', 'node', 'edge', 'strict'] -id_re_alpha_nums = re.compile('^[_a-zA-Z][a-zA-Z0-9_:,]*$') -id_re_num = re.compile('^[0-9,]+$') -id_re_with_port = re.compile('^([^:]*):([^:]*)$') -id_re_dbl_quoted = re.compile('^\".*\"$', re.S) -id_re_html = re.compile('^<.*>$', re.S) +id_re_alpha_nums = re.compile('^[_a-zA-Z][a-zA-Z0-9_,]*$', re.UNICODE) +id_re_alpha_nums_with_ports = re.compile( + '^[_a-zA-Z][a-zA-Z0-9_,:\"]*[a-zA-Z0-9_,\"]+$', re.UNICODE) +id_re_num = re.compile('^[0-9,]+$', re.UNICODE) +id_re_with_port = re.compile('^([^:]*):([^:]*)$', re.UNICODE) +id_re_dbl_quoted = re.compile('^\".*\"$', re.S|re.UNICODE) +id_re_html = re.compile('^<.*>$', re.S|re.UNICODE) def needs_quotes( s ): """Checks whether a string is a dot language ID. - + It will check whether the string is solely composed by the characters allowed in an ID or not. If the string is one of the reserved keywords it will - need quotes too. + need quotes too but the user will need to add them + manually. """ - + + # If the name is a reserved keyword it will need quotes but pydot + # can't tell when it's being used as a keyword or when it's simply + # a name. Hence the user needs to supply the quotes when an element + # would use a reserved keyword as name. This function will return + # false indicating that a keyword string, if provided as-is, won't + # need quotes. if s in dot_keywords: return False chars = [ord(c) for c in s if ord(c)>0x7f or ord(c)==0] - if chars and not id_re_dbl_quoted.match(s): + if chars and not id_re_dbl_quoted.match(s) and not id_re_html.match(s): return True - - for test in [id_re_alpha_nums, id_re_num, id_re_dbl_quoted, id_re_html]: - if test.match(s): + + for test_re in [id_re_alpha_nums, id_re_num, + id_re_dbl_quoted, id_re_html, + id_re_alpha_nums_with_ports]: + if test_re.match(s): return False m = id_re_with_port.match(s) @@ -176,13 +200,16 @@ def quote_if_necessary(s): - + """Enclode attribute value in quotes, if needed.""" if isinstance(s, bool): if s is True: return 'True' return 'False' - if not isinstance( s, string_types ): + if not isinstance( s, str_type): + return s + + if not s: return s if needs_quotes(s): @@ -193,62 +220,65 @@ s = s.replace(a, b) return '"' + s + '"' - - return s + + return s -def graph_from_dot_data(data): - """Load graph as defined by data in DOT format. - +def graph_from_dot_data(s): + """Load graphs from DOT description in (unicode) string `s`. + The data is assumed to be in DOT format. It will - be parsed and a Dot class will be returned, + be parsed and a Dot class will be returned, representing the graph. """ - - return dot_parser.parse_dot_data(data) + return dot_parser.parse_dot_data(s) + +def graph_from_dot_file(path, encoding=None): + """Load graphs as defined by a DOT file. -def graph_from_dot_file(path): - """Load graph as defined by a DOT file. - The file is assumed to be in DOT format. It will - be loaded, parsed and a Dot class will be returned, + be loaded, parsed and a Dot class will be returned, representing the graph. + + @param path: to dot file + @param encoding: passed to `io.open`. + For example, `'utf-8'`. """ - - fd = file(path, 'rb') - data = fd.read() - fd.close() - - return graph_from_dot_data(data) + with io.open(path, 'rt', encoding=encoding) as f: + s = f.read() + if not PY3: + s = unicode(s) + graphs = graph_from_dot_data(s) + return graphs def graph_from_edges(edge_list, node_prefix='', directed=False): """Creates a basic graph out of an edge list. - + The edge list has to be a list of tuples representing the nodes connected by the edge. The values can be anything: bool, int, float, str. - + If the graph is undirected by default, it is only calculated from one of the symmetric halves of the matrix. """ - + if directed: graph = Dot(graph_type='digraph') - + else: graph = Dot(graph_type='graph') - + for edge in edge_list: - + if isinstance(edge[0], str): src = node_prefix + edge[0] else: src = node_prefix + str(edge[0]) - + if isinstance(edge[1], str): dst = node_prefix + edge[1] else: @@ -256,26 +286,26 @@ e = Edge( src, dst ) graph.add_edge(e) - + return graph def graph_from_adjacency_matrix(matrix, node_prefix= u'', directed=False): """Creates a basic graph out of an adjacency matrix. - + The matrix has to be a list of rows of values representing an adjacency matrix. The values can be anything: bool, int, float, as long as they can evaluate to True or False. """ - + node_orig = 1 - + if directed: graph = Dot(graph_type='digraph') else: graph = Dot(graph_type='graph') - + for row in matrix: if not directed: skip = matrix.index(row) @@ -284,48 +314,48 @@ skip = 0 r = row node_dest = skip+1 - + for e in r: if e: graph.add_edge( - Edge( node_prefix + node_orig, + Edge( node_prefix + node_orig, node_prefix + node_dest) ) node_dest += 1 node_orig += 1 - + return graph def graph_from_incidence_matrix(matrix, node_prefix='', directed=False): """Creates a basic graph out of an incidence matrix. - + The matrix has to be a list of rows of values representing an incidence matrix. The values can be anything: bool, int, float, as long as they can evaluate to True or False. """ - + node_orig = 1 - + if directed: graph = Dot(graph_type='digraph') else: graph = Dot(graph_type='graph') - + for row in matrix: nodes = [] c = 1 - + for node in row: if node: nodes.append(c*node) c += 1 nodes.sort() - + if len(nodes) == 2: - graph.add_edge( - Edge( node_prefix + abs(nodes[0]), + graph.add_edge( + Edge( node_prefix + abs(nodes[0]), node_prefix + nodes[1] )) if not directed: @@ -333,266 +363,47 @@ return graph - - - -def __find_executables(path): - """Used by find_graphviz - - path - single directory as a string - - If any of the executables are found, it will return a dictionary - containing the program names as keys and their paths as values. - - Otherwise returns None - """ - - success = False - progs = {'dot': '', 'twopi': '', 'neato': '', 'circo': '', 'fdp': '', 'sfdp': ''} - - was_quoted = False - path = path.strip() - if path.startswith('"') and path.endswith('"'): - path = path[1:-1] - was_quoted = True - - if os.path.isdir(path) : - - for prg in progs.iterkeys(): - - if progs[prg]: - continue - - if os.path.exists( os.path.join(path, prg) ): - - if was_quoted: - progs[prg] = '"' + os.path.join(path, prg) + '"' - else: - progs[prg] = os.path.join(path, prg) - - success = True - - elif os.path.exists( os.path.join(path, prg + '.exe') ): - - if was_quoted: - progs[prg] = '"' + os.path.join(path, prg + '.exe') + '"' - else: - progs[prg] = os.path.join(path, prg + '.exe') - - success = True - - if success: - - return progs - - else: - - return None - - - -# The multi-platform version of this 'find_graphviz' function was -# contributed by Peter Cock -# -def find_graphviz(): - """Locate Graphviz's executables in the system. - - Tries three methods: - - First: Windows Registry (Windows only) - This requires Mark Hammond's pywin32 is installed. - - Secondly: Search the path - It will look for 'dot', 'twopi' and 'neato' in all the directories - specified in the PATH environment variable. - - Thirdly: Default install location (Windows only) - It will look for 'dot', 'twopi' and 'neato' in the default install - location under the "Program Files" directory. - - It will return a dictionary containing the program names as keys - and their paths as values. - - If this fails, it returns None. - """ - - # Method 1 (Windows only) - # - if os.sys.platform == 'win32': - - HKEY_LOCAL_MACHINE = 0x80000002 - KEY_QUERY_VALUE = 0x0001 - - RegOpenKeyEx = None - RegQueryValueEx = None - RegCloseKey = None - - try: - import win32api, win32con - RegOpenKeyEx = win32api.RegOpenKeyEx - RegQueryValueEx = win32api.RegQueryValueEx - RegCloseKey = win32api.RegCloseKey - - except ImportError: - # Print a messaged suggesting they install these? - # - pass - - try: - import ctypes - - def RegOpenKeyEx(key, subkey, opt, sam): - result = ctypes.c_uint(0) - ctypes.windll.advapi32.RegOpenKeyExA(key, subkey, opt, sam, ctypes.byref(result)) - return result.value - - def RegQueryValueEx( hkey, valuename ): - data_type = ctypes.c_uint(0) - data_len = ctypes.c_uint(1024) - data = ctypes.create_string_buffer( 1024 ) - - res = ctypes.windll.advapi32.RegQueryValueExA(hkey, valuename, 0, - ctypes.byref(data_type), data, ctypes.byref(data_len)) - - return data.value - - RegCloseKey = ctypes.windll.advapi32.RegCloseKey - - except ImportError: - # Print a messaged suggesting they install these? - # - pass - - if RegOpenKeyEx is not None: - - # Get the GraphViz install path from the registry - # - hkey = None - potentialKeys = [ - "SOFTWARE\\ATT\\Graphviz", - "SOFTWARE\\AT&T Research Labs\\Graphviz", - ] - for potentialKey in potentialKeys: - - try: - hkey = RegOpenKeyEx( HKEY_LOCAL_MACHINE, - potentialKey, 0, KEY_QUERY_VALUE ) - - if hkey is not None: - path = RegQueryValueEx( hkey, "InstallPath" ) - RegCloseKey( hkey ) - - # The regitry variable might exist, left by old installations - # but with no value, in those cases we keep searching... - if not path: - continue - - # Now append the "bin" subdirectory: - # - path = os.path.join(path, "bin") - progs = __find_executables(path) - if progs is not None : - #print "Used Windows registry" - return progs - - except Exception as excp: - #raise excp - pass - else: - break - - - - # Method 2 (Linux, Windows etc) - # - if 'PATH' in os.environ: - - for path in os.environ['PATH'].split(os.pathsep): - progs = __find_executables(path) - if progs is not None : - #print "Used path" - return progs - - # Method 3 (Windows only) - # - if os.sys.platform == 'win32': - - # Try and work out the equivalent of "C:\Program Files" on this - # machine (might be on drive D:, or in a different language) - # - - if 'PROGRAMFILES' in os.environ: - - # Note, we could also use the win32api to get this - # information, but win32api may not be installed. - - path = os.path.join(os.environ['PROGRAMFILES'], 'ATT', 'GraphViz', 'bin') - - else: - - #Just in case, try the default... - path = r"C:\Program Files\att\Graphviz\bin" - - progs = __find_executables(path) - - if progs is not None : - - #print "Used default install location" - return progs - - - for path in ( - '/usr/bin', '/usr/local/bin', - '/opt/local/bin', - '/opt/bin', '/sw/bin', '/usr/share', - '/Applications/Graphviz.app/Contents/MacOS/' ): - - progs = __find_executables(path) - if progs is not None : - #print "Used path" - return progs - # Failed to find GraphViz - # - return None - - -class Common: +class Common(object): """Common information to several classes. - + Should not be directly used, several classes are derived from this one. """ - + def __getstate__(self): dict = copy.copy(self.obj_dict) - + return dict - + def __setstate__(self, state): - + self.obj_dict = state def __get_attribute__(self, attr): """Look for default attributes for this node""" - + attr_val = self.obj_dict['attributes'].get(attr, None) - + if attr_val is None: # get the defaults for nodes/edges - + default_node_name = self.obj_dict['type'] - + # The defaults for graphs are set on a node named 'graph' if default_node_name in ('subgraph', 'digraph', 'cluster'): default_node_name = 'graph' - - defaults = self.get_parent_graph().get_node( default_node_name ) - + + g = self.get_parent_graph() + if g is not None: + defaults = g.get_node( default_node_name ) + else: + return None + # Multiple defaults could be set by having repeated 'graph [...]' # 'node [...]', 'edge [...]' statements. In such case, if the # same attribute is set in different statements, only the first @@ -603,35 +414,35 @@ # if not isinstance(defaults, (list, tuple)): defaults = [defaults] - + for default in defaults: attr_val = default.obj_dict['attributes'].get(attr, None) if attr_val: return attr_val else: return attr_val - + return None - + def set_parent_graph(self, parent_graph): - + self.obj_dict['parent_graph'] = parent_graph - + def get_parent_graph(self): - + return self.obj_dict.get('parent_graph', None) def set(self, name, value): """Set an attribute value by name. - + Given an attribute 'name' it will set its value to 'value'. There's always the possibility of using the methods: - + set_'name'(value) - + which are defined for all the existing attributes. """ @@ -640,46 +451,50 @@ def get(self, name): """Get an attribute value by name. - + Given an attribute 'name' it will get its value. There's always the possibility of using the methods: - + get_'name'() - + which are defined for all the existing attributes. """ return self.obj_dict['attributes'].get(name, None) - + def get_attributes(self): """""" - + return self.obj_dict['attributes'] - + def set_sequence(self, seq): - + self.obj_dict['sequence'] = seq def get_sequence(self): - + return self.obj_dict['sequence'] - - + + def create_attribute_methods(self, obj_attributes): - + #for attr in self.obj_dict['attributes']: for attr in obj_attributes: - + # Generate all the Setter methods. # - self.__setattr__( 'set_'+attr, lambda x, a=attr : self.obj_dict['attributes'].__setitem__(a, x) ) - + self.__setattr__( + 'set_'+attr, + lambda x, a=attr : + self.obj_dict['attributes'].__setitem__(a, x) ) + # Generate all the Getter methods. # - self.__setattr__('get_'+attr, lambda a=attr : self.__get_attribute__(a)) + self.__setattr__( + 'get_'+attr, lambda a=attr : self.__get_attribute__(a)) @@ -693,7 +508,7 @@ class InvocationException(Exception): - """To indicate that a ploblem occurred while running any of the GraphViz executables. + """Indicate ploblem while running any GraphViz executable. """ def __init__(self, value): self.value = value @@ -702,34 +517,36 @@ -class Node(object, Common): +class Node(Common): """A graph node. - + This class represents a graph's node with all its attributes. - + node(name, attribute=value, ...) - + name: node's name - + All the attributes defined in the Graphviz dot language should be supported. """ def __init__(self, name = '', obj_dict = None, **attrs): - + # - # Nodes will take attributes of all other types because the defaults - # for any GraphViz object are dealt with as if they were Node definitions + # Nodes will take attributes of + # all other types because the defaults + # for any GraphViz object are dealt with + # as if they were Node definitions # - + if obj_dict is not None: - + self.obj_dict = obj_dict - + else: - + self.obj_dict = dict() - + # Copy the attributes # self.obj_dict[ 'attributes' ] = dict( attrs ) @@ -737,79 +554,83 @@ self.obj_dict[ 'parent_graph' ] = None self.obj_dict[ 'parent_node_list' ] = None self.obj_dict[ 'sequence' ] = None - + # Remove the compass point # port = None - if isinstance(name, string_types) and not name.startswith('"'): + if isinstance(name, str_type) and not name.startswith('"'): idx = name.find(':') - if idx > 0: + if idx > 0 and idx+1 < len(name): name, port = name[:idx], name[idx:] - if isinstance(name, (long, int)): + if isinstance(name, int): name = str(name) - - self.obj_dict['name'] = quote_if_necessary( name ) + + self.obj_dict['name'] = quote_if_necessary(name) self.obj_dict['port'] = port - + self.create_attribute_methods(NODE_ATTRIBUTES) - - - + + + def set_name(self, node_name): """Set the node's name.""" - + self.obj_dict['name'] = node_name - - + + def get_name(self): """Get the node's name.""" - + return self.obj_dict['name'] - + def get_port(self): """Get the node's port.""" - + return self.obj_dict['port'] def add_style(self, style): - + styles = self.obj_dict['attributes'].get('style', None) if not styles and style: styles = [ style ] else: styles = styles.split(',') styles.append( style ) - + self.obj_dict['attributes']['style'] = ','.join( styles ) - + def to_string(self): """Returns a string representation of the node in dot language. """ - - + + # RMF: special case defaults for node, edge and graph properties. # node = quote_if_necessary(self.obj_dict['name']) node_attr = list() - for attr, value in self.obj_dict['attributes'].iteritems(): + for attr in self.obj_dict['attributes']: + value = self.obj_dict['attributes'][attr] + if value == '': + value = '""' if value is not None: - node_attr.append( '%s=%s' % (attr, quote_if_necessary(value) ) ) + node_attr.append( + '%s=%s' % (attr, quote_if_necessary(value) ) ) else: node_attr.append( attr ) - - + + # No point in having nodes setting any defaults if the don't set # any attributes... # if node in ('graph', 'node', 'edge') and len(node_attr) == 0: return '' - + node_attr = ', '.join(node_attr) if node_attr: @@ -819,47 +640,47 @@ -class Edge(object, Common ): +class Edge(Common): """A graph edge. - + This class represents a graph's edge with all its attributes. - + edge(src, dst, attribute=value, ...) - + src: source node's name dst: destination node's name - + All the attributes defined in the Graphviz dot language should be supported. - + Attributes can be set through the dynamically generated methods: - + set_[attribute name], i.e. set_label, set_fontname - + or directly by using the instance's special dictionary: - - Edge.obj_dict['attributes'][attribute name], i.e. - + + Edge.obj_dict['attributes'][attribute name], i.e. + edge_instance.obj_dict['attributes']['label'] edge_instance.obj_dict['attributes']['fontname'] - + """ - + def __init__(self, src='', dst='', obj_dict=None, **attrs): - + if isinstance(src, (list, tuple)) and dst == '': src, dst = src - + if obj_dict is not None: - + self.obj_dict = obj_dict - + else: - + self.obj_dict = dict() - + # Copy the attributes # self.obj_dict[ 'attributes' ] = dict( attrs ) @@ -870,83 +691,90 @@ if isinstance(src, Node): src = src.get_name() - + if isinstance(dst, Node): dst = dst.get_name() - - points = ( quote_if_necessary( src) , quote_if_necessary( dst) ) - + + points = ( quote_if_necessary( src) , + quote_if_necessary( dst) ) + self.obj_dict['points'] = points - + self.create_attribute_methods(EDGE_ATTRIBUTES) def get_source(self): """Get the edges source node name.""" - + return self.obj_dict['points'][0] - - + + def get_destination(self): """Get the edge's destination node name.""" - + return self.obj_dict['points'][1] - - + + def __hash__(self): - - return hash( hash(self.get_source()) + hash(self.get_destination()) ) - - + + return hash( hash(self.get_source()) + + hash(self.get_destination()) ) + + def __eq__(self, edge): """Compare two edges. - + If the parent graph is directed, arcs linking node A to B are considered equal and A->B != B->A - + If the parent graph is undirected, any edge connecting two nodes is equal to any other edge connecting the same nodes, A->B == B->A """ - + if not isinstance(edge, Edge): - raise Error("Can't compare and edge to a non-edge object.") - + raise Error('Can not compare and ' + 'edge to a non-edge object.') + if self.get_parent_graph().get_top_graph_type() == 'graph': - + # If the graph is undirected, the edge has neither # source nor destination. # - if ( ( self.get_source() == edge.get_source() and self.get_destination() == edge.get_destination() ) or - ( edge.get_source() == self.get_destination() and edge.get_destination() == self.get_source() ) ): + if ( ( self.get_source() == edge.get_source() and + self.get_destination() == edge.get_destination() ) or + ( edge.get_source() == self.get_destination() and + edge.get_destination() == self.get_source() ) ): return True - + else: - - if self.get_source()==edge.get_source() and self.get_destination()==edge.get_destination() : + + if (self.get_source()==edge.get_source() and + self.get_destination()==edge.get_destination()): return True - + return False - - + + def parse_node_ref(self, node_str): - + if not isinstance(node_str, str): return node_str - + if node_str.startswith('"') and node_str.endswith('"'): - + return node_str - + node_port_idx = node_str.rfind(':') - - if node_port_idx>0 and node_str[0]=='"' and node_str[node_port_idx-1]=='"': - + + if (node_port_idx>0 and node_str[0]=='"' and + node_str[node_port_idx-1]=='"'): + return node_str - + if node_port_idx>0: - + a = node_str[:node_port_idx] b = node_str[node_port_idx+1:] @@ -955,70 +783,73 @@ node += ':'+quote_if_necessary(b) return node - + return node_str - - + + def to_string(self): """Returns a string representation of the edge in dot language. """ src = self.parse_node_ref( self.get_source() ) dst = self.parse_node_ref( self.get_destination() ) - + if isinstance(src, frozendict): edge = [ Subgraph(obj_dict=src).to_string() ] - elif isinstance(src, (int, long)): + elif isinstance(src, int): edge = [ str(src) ] else: edge = [ src ] - + if (self.get_parent_graph() and self.get_parent_graph().get_top_graph_type() and self.get_parent_graph().get_top_graph_type() == 'digraph' ): edge.append( '->' ) - + else: edge.append( '--' ) - + if isinstance(dst, frozendict): edge.append( Subgraph(obj_dict=dst).to_string() ) - elif isinstance(dst, (int, long)): + elif isinstance(dst, int): edge.append( str(dst) ) else: edge.append( dst ) edge_attr = list() - - for attr, value in self.obj_dict['attributes'].iteritems(): - + + for attr in self.obj_dict['attributes']: + value = self.obj_dict['attributes'][attr] + if value == '': + value = '""' if value is not None: - edge_attr.append( '%s=%s' % (attr, quote_if_necessary(value) ) ) + edge_attr.append( + '%s=%s' % (attr, quote_if_necessary(value) ) ) else: edge_attr.append( attr ) edge_attr = ', '.join(edge_attr) - + if edge_attr: edge.append( ' [' + edge_attr + ']' ) return ' '.join(edge) + ';' - - - - - -class Graph(object, Common): + + + + + +class Graph(Common): """Class representing a graph in Graphviz's dot language. This class implements the methods to work on a representation of a graph in Graphviz's dot language. - + graph( graph_name='G', graph_type='digraph', strict=False, suppress_disconnected=False, attribute=value, ...) - + graph_name: the graph's name graph_type: @@ -1030,73 +861,77 @@ if True it will avoid displaying equal edges, i.e. only one edge between two nodes. removing the duplicated ones. - + All the attributes defined in the Graphviz dot language should be supported. - + Attributes can be set through the dynamically generated methods: - + set_[attribute name], i.e. set_size, set_fontname - + or using the instance's attributes: - - Graph.obj_dict['attributes'][attribute name], i.e. - + + Graph.obj_dict['attributes'][attribute name], i.e. + graph_instance.obj_dict['attributes']['label'] graph_instance.obj_dict['attributes']['fontname'] """ - - def __init__(self, graph_name='G', obj_dict=None, graph_type='digraph', strict=False, - suppress_disconnected=False, simplify=False, **attrs): + + def __init__(self, graph_name='G', obj_dict=None, + graph_type='digraph', strict=False, + suppress_disconnected=False, simplify=False, **attrs): if obj_dict is not None: self.obj_dict = obj_dict - + else: self.obj_dict = dict() - + self.obj_dict['attributes'] = dict(attrs) - + if graph_type not in ['graph', 'digraph']: - raise Error('Invalid type "%s". Accepted graph types are: graph, digraph, subgraph' % graph_type) - - - self.obj_dict['name'] = graph_name + raise Error(( + 'Invalid type "{t}". ' + 'Accepted graph types are: ' + 'graph, digraph').format(t=graph_type)) + + + self.obj_dict['name'] = quote_if_necessary(graph_name) self.obj_dict['type'] = graph_type - + self.obj_dict['strict'] = strict self.obj_dict['suppress_disconnected'] = suppress_disconnected self.obj_dict['simplify'] = simplify - + self.obj_dict['current_child_sequence'] = 1 self.obj_dict['nodes'] = dict() self.obj_dict['edges'] = dict() self.obj_dict['subgraphs'] = dict() self.set_parent_graph(self) - + self.create_attribute_methods(GRAPH_ATTRIBUTES) def get_graph_type(self): - + return self.obj_dict['type'] def get_top_graph_type(self): - + parent = self while True: parent_ = parent.get_parent_graph() if parent_ == parent: break parent = parent_ - + return parent.obj_dict['type'] - + def set_graph_defaults(self, **attrs): @@ -1104,15 +939,15 @@ def get_graph_defaults(self, **attrs): - + graph_nodes = self.get_node('graph') - + if isinstance( graph_nodes, (list, tuple)): return [ node.get_attributes() for node in graph_nodes ] - - return graph_nodes.get_attributes() - - + + return graph_nodes.get_attributes() + + def set_node_defaults(self, **attrs): @@ -1120,15 +955,15 @@ def get_node_defaults(self, **attrs): - - + + graph_nodes = self.get_node('node') if isinstance( graph_nodes, (list, tuple)): return [ node.get_attributes() for node in graph_nodes ] - - return graph_nodes.get_attributes() - + + return graph_nodes.get_attributes() + def set_edge_defaults(self, **attrs): @@ -1137,44 +972,44 @@ def get_edge_defaults(self, **attrs): - + graph_nodes = self.get_node('edge') if isinstance( graph_nodes, (list, tuple)): return [ node.get_attributes() for node in graph_nodes ] - - return graph_nodes.get_attributes() - + return graph_nodes.get_attributes() + + def set_simplify(self, simplify): """Set whether to simplify or not. - + If True it will avoid displaying equal edges, i.e. only one edge between two nodes. removing the duplicated ones. """ - + self.obj_dict['simplify'] = simplify def get_simplify(self): """Get whether to simplify or not. - + Refer to set_simplify for more information. """ - + return self.obj_dict['simplify'] - + def set_type(self, graph_type): """Set the graph's type, 'graph' or 'digraph'.""" self.obj_dict['type'] = graph_type - + def get_type(self): """Get the graph's type, 'graph' or 'digraph'.""" @@ -1184,67 +1019,69 @@ def set_name(self, graph_name): """Set the graph's name.""" - + self.obj_dict['name'] = graph_name def get_name(self): """Get the graph's name.""" - + return self.obj_dict['name'] - + def set_strict(self, val): """Set graph to 'strict' mode. - + This option is only valid for top level graphs. """ - + self.obj_dict['strict'] = val def get_strict(self, val): """Get graph's 'strict' mode (True, False). - + This option is only valid for top level graphs. """ - + return self.obj_dict['strict'] - + def set_suppress_disconnected(self, val): """Suppress disconnected nodes in the output graph. - - This option will skip nodes in the graph with no incoming or outgoing - edges. This option works also for subgraphs and has effect only in the + + This option will skip nodes in + the graph with no incoming or outgoing + edges. This option works also + for subgraphs and has effect only in the current graph/subgraph. """ - + self.obj_dict['suppress_disconnected'] = val - + def get_suppress_disconnected(self, val): """Get if suppress disconnected is set. - + Refer to set_suppress_disconnected for more information. """ - + return self.obj_dict['suppress_disconnected'] - + def get_next_sequence_number(self): - + seq = self.obj_dict['current_child_sequence'] - + self.obj_dict['current_child_sequence'] += 1 - + return seq - + def add_node(self, graph_node): @@ -1253,23 +1090,27 @@ It takes a node object as its only argument and returns None. """ - + if not isinstance(graph_node, Node): - raise TypeError('add_node() received a non node class object') + raise TypeError( + 'add_node() received ' + + 'a non node class object: ' + str(graph_node)) + - node = self.get_node(graph_node.get_name()) - + if not node: - self.obj_dict['nodes'][graph_node.get_name()] = [ graph_node.obj_dict ] - + self.obj_dict['nodes'][graph_node.get_name()] = [ + graph_node.obj_dict ] + #self.node_dict[graph_node.get_name()] = graph_node.attributes graph_node.set_parent_graph(self.get_parent_graph()) - + else: - - self.obj_dict['nodes'][graph_node.get_name()].append( graph_node.obj_dict ) + + self.obj_dict['nodes'][graph_node.get_name()].append( + graph_node.obj_dict ) graph_node.set_sequence(self.get_next_sequence_number()) @@ -1277,154 +1118,164 @@ def del_node(self, name, index=None): """Delete a node from the graph. - + Given a node's name all node(s) with that same name will be deleted if 'index' is not specified or set to None. If there are several nodes with that same name and 'index' is given, only the node in that position will be deleted. - - 'index' should be an integer specifying the position + + 'index' should be an integer specifying the position of the node to delete. If index is larger than the number of nodes with that name, no action is taken. - + If nodes are deleted it returns True. If no action is taken it returns False. """ - + if isinstance(name, Node): name = name.get_name() - + if name in self.obj_dict['nodes']: - - if index is not None and index < len(self.obj_dict['nodes'][name]): + + if (index is not None and + index < len(self.obj_dict['nodes'][name])): del self.obj_dict['nodes'][name][index] return True else: del self.obj_dict['nodes'][name] return True - + return False - + def get_node(self, name): """Retrieve a node from the graph. - + Given a node's name the corresponding Node instance will be returned. - + If one or more nodes exist with that name a list of Node instances is returned. An empty list is returned otherwise. """ - + match = list() - + if name in self.obj_dict['nodes']: - - match.extend( [ Node( obj_dict = obj_dict ) for obj_dict in self.obj_dict['nodes'][name] ]) - + + match.extend( + [Node(obj_dict=obj_dict) + for obj_dict in self.obj_dict['nodes'][name]]) + return match def get_nodes(self): """Get the list of Node instances.""" - + return self.get_node_list() - - + + def get_node_list(self): """Get the list of Node instances. - + This method returns the list of Node instances composing the graph. """ - + node_objs = list() - - for node, obj_dict_list in self.obj_dict['nodes'].iteritems(): - node_objs.extend( [ Node( obj_dict = obj_d ) for obj_d in obj_dict_list ] ) - + + for node in self.obj_dict['nodes']: + obj_dict_list = self.obj_dict['nodes'][node] + node_objs.extend( [ Node( obj_dict = obj_d ) + for obj_d in obj_dict_list ] ) + return node_objs def add_edge(self, graph_edge): """Adds an edge object to the graph. - + It takes a edge object as its only argument and returns None. """ if not isinstance(graph_edge, Edge): - raise TypeError('add_edge() received a non edge class object') - - edge_points = ( graph_edge.get_source(), graph_edge.get_destination() ) + raise TypeError( + 'add_edge() received a non edge class object: ' + + str(graph_edge)) + + edge_points = ( graph_edge.get_source(), + graph_edge.get_destination() ) if edge_points in self.obj_dict['edges']: - + edge_list = self.obj_dict['edges'][edge_points] edge_list.append(graph_edge.obj_dict) - + else: - + self.obj_dict['edges'][edge_points] = [ graph_edge.obj_dict ] - + + graph_edge.set_sequence( self.get_next_sequence_number() ) - + graph_edge.set_parent_graph( self.get_parent_graph() ) - + def del_edge(self, src_or_list, dst=None, index=None): """Delete an edge from the graph. - + Given an edge's (source, destination) node names all matching edges(s) will be deleted if 'index' is not specified or set to None. If there are several matching edges and 'index' is given, only the edge in that position will be deleted. - - 'index' should be an integer specifying the position + + 'index' should be an integer specifying the position of the edge to delete. If index is larger than the number of matching edges, no action is taken. - + If edges are deleted it returns True. If no action is taken it returns False. """ if isinstance( src_or_list, (list, tuple)): - if dst is not None and isinstance(dst, (int, long)): + if dst is not None and isinstance(dst, int): index = dst src, dst = src_or_list else: src, dst = src_or_list, dst - + if isinstance(src, Node): src = src.get_name() if isinstance(dst, Node): dst = dst.get_name() - + if (src, dst) in self.obj_dict['edges']: - - if index is not None and index < len(self.obj_dict['edges'][(src, dst)]): + + if (index is not None and + index < len(self.obj_dict['edges'][(src, dst)])): del self.obj_dict['edges'][(src, dst)][index] return True else: del self.obj_dict['edges'][(src, dst)] return True - + return False - + def get_edge(self, src_or_list, dst=None): """Retrieved an edge from the graph. - + Given an edge's source and destination the corresponding Edge instance(s) will be returned. - + If one or more edges exist with that source and destination a list of Edge instances is returned. An empty list is returned otherwise. @@ -1438,123 +1289,141 @@ edge_points_reverse = (dst, src_or_list) match = list() - + if edge_points in self.obj_dict['edges'] or ( - self.get_top_graph_type() == 'graph' and edge_points_reverse in self.obj_dict['edges']): - + self.get_top_graph_type() == 'graph' and + edge_points_reverse in self.obj_dict['edges']): + edges_obj_dict = self.obj_dict['edges'].get( edge_points, self.obj_dict['edges'].get( edge_points_reverse, None )) - + for edge_obj_dict in edges_obj_dict: - match.append( Edge( edge_points[0], edge_points[1], obj_dict = edge_obj_dict ) ) + match.append( + Edge(edge_points[0], + edge_points[1], + obj_dict=edge_obj_dict)) return match def get_edges(self): return self.get_edge_list() - - + + def get_edge_list(self): """Get the list of Edge instances. - + This method returns the list of Edge instances composing the graph. """ - + edge_objs = list() - - for edge, obj_dict_list in self.obj_dict['edges'].iteritems(): - edge_objs.extend( [ Edge( obj_dict = obj_d ) for obj_d in obj_dict_list ] ) - + + for edge in self.obj_dict['edges']: + obj_dict_list = self.obj_dict['edges'][edge] + edge_objs.extend( + [Edge(obj_dict=obj_d) + for obj_d in obj_dict_list]) + return edge_objs - + def add_subgraph(self, sgraph): """Adds an subgraph object to the graph. - + It takes a subgraph object as its only argument and returns None. """ - if not isinstance(sgraph, Subgraph) and not isinstance(sgraph, Cluster): - raise TypeError('add_subgraph() received a non subgraph class object') - + if (not isinstance(sgraph, Subgraph) and + not isinstance(sgraph, Cluster)): + raise TypeError( + 'add_subgraph() received a non subgraph class object:' + + str(sgraph)) + if sgraph.get_name() in self.obj_dict['subgraphs']: - + sgraph_list = self.obj_dict['subgraphs'][ sgraph.get_name() ] sgraph_list.append( sgraph.obj_dict ) - + else: - self.obj_dict['subgraphs'][ sgraph.get_name() ] = [ sgraph.obj_dict ] - + self.obj_dict['subgraphs'][sgraph.get_name()] = [ + sgraph.obj_dict] + sgraph.set_sequence( self.get_next_sequence_number() ) - + sgraph.set_parent_graph( self.get_parent_graph() ) - + def get_subgraph(self, name): """Retrieved a subgraph from the graph. - + Given a subgraph's name the corresponding Subgraph instance will be returned. - + If one or more subgraphs exist with the same name, a list of Subgraph instances is returned. An empty list is returned otherwise. """ - + match = list() - + if name in self.obj_dict['subgraphs']: - + sgraphs_obj_dict = self.obj_dict['subgraphs'].get( name ) - + for obj_dict_list in sgraphs_obj_dict: - #match.extend( Subgraph( obj_dict = obj_d ) for obj_d in obj_dict_list ) + #match.extend( Subgraph( obj_dict = obj_d ) + # for obj_d in obj_dict_list ) match.append( Subgraph( obj_dict = obj_dict_list ) ) - + return match def get_subgraphs(self): - + return self.get_subgraph_list() - - + + def get_subgraph_list(self): """Get the list of Subgraph instances. - + This method returns the list of Subgraph instances in the graph. """ - + sgraph_objs = list() - - for sgraph, obj_dict_list in self.obj_dict['subgraphs'].iteritems(): - sgraph_objs.extend( [ Subgraph( obj_dict = obj_d ) for obj_d in obj_dict_list ] ) - + + for sgraph in self.obj_dict['subgraphs']: + obj_dict_list = self.obj_dict['subgraphs'][sgraph] + sgraph_objs.extend( + [Subgraph(obj_dict=obj_d) + for obj_d in obj_dict_list]) + return sgraph_objs - + def set_parent_graph(self, parent_graph): - + self.obj_dict['parent_graph'] = parent_graph - - for obj_list in self.obj_dict['nodes'].itervalues(): + + for k in self.obj_dict['nodes']: + obj_list = self.obj_dict['nodes'][k] for obj in obj_list: obj['parent_graph'] = parent_graph - for obj_list in self.obj_dict['edges'].itervalues(): + for k in self.obj_dict['edges']: + obj_list = self.obj_dict['edges'][k] for obj in obj_list: obj['parent_graph'] = parent_graph - for obj_list in self.obj_dict['subgraphs'].itervalues(): + for k in self.obj_dict['subgraphs']: + obj_list = self.obj_dict['subgraphs'][k] for obj in obj_list: Graph(obj_dict=obj).set_parent_graph(parent_graph) @@ -1562,98 +1431,106 @@ def to_string(self): """Returns a string representation of the graph in dot language. - + It will return the graph and all its subelements in string from. """ - - + + graph = list() - + if self.obj_dict.get('strict', None) is not None: - - if self==self.get_parent_graph() and self.obj_dict['strict']: - + + if (self == self.get_parent_graph() and + self.obj_dict['strict']): + graph.append('strict ') - - if self.obj_dict['name'] == '': - if 'show_keyword' in self.obj_dict and self.obj_dict['show_keyword']: - graph.append( 'subgraph {\n' ) - else: - graph.append( '{\n' ) - else: - graph.append( '%s %s {\n' % (self.obj_dict['type'], self.obj_dict['name']) ) + graph_type = self.obj_dict['type'] + if (graph_type == 'subgraph' and + not self.obj_dict.get('show_keyword', True)): + graph_type = '' + s = '{type} {name} {{\n'.format( + type=graph_type, + name=self.obj_dict['name']) + graph.append(s) + + for attr in self.obj_dict['attributes']: - for attr in self.obj_dict['attributes'].iterkeys(): - if self.obj_dict['attributes'].get(attr, None) is not None: - + val = self.obj_dict['attributes'].get(attr) + if val == '': + val = '""' if val is not None: - graph.append( '%s=%s' % (attr, quote_if_necessary(val)) ) + graph.append('%s=%s' % + (attr, quote_if_necessary(val))) else: graph.append( attr ) - + graph.append( ';\n' ) edges_done = set() - + edge_obj_dicts = list() - for e in self.obj_dict['edges'].itervalues(): - edge_obj_dicts.extend(e) - + for k in self.obj_dict['edges']: + edge_obj_dicts.extend(self.obj_dict['edges'][k]) + if edge_obj_dicts: - edge_src_set, edge_dst_set = zip( *[obj['points'] for obj in edge_obj_dicts] ) + edge_src_set, edge_dst_set = list(zip( + *[obj['points'] for obj in edge_obj_dicts])) edge_src_set, edge_dst_set = set(edge_src_set), set(edge_dst_set) else: edge_src_set, edge_dst_set = set(), set() - + node_obj_dicts = list() - for e in self.obj_dict['nodes'].itervalues(): - node_obj_dicts.extend(e) + for k in self.obj_dict['nodes']: + node_obj_dicts.extend(self.obj_dict['nodes'][k]) sgraph_obj_dicts = list() - for sg in self.obj_dict['subgraphs'].itervalues(): - sgraph_obj_dicts.extend(sg) + for k in self.obj_dict['subgraphs']: + sgraph_obj_dicts.extend(self.obj_dict['subgraphs'][k]) + - - obj_list = [ (obj['sequence'], obj) for obj in (edge_obj_dicts + node_obj_dicts + sgraph_obj_dicts) ] + obj_list = [(obj['sequence'], obj) + for obj in (edge_obj_dicts + + node_obj_dicts + sgraph_obj_dicts) ] obj_list.sort() - + for idx, obj in obj_list: - + if obj['type'] == 'node': node = Node(obj_dict=obj) - + if self.obj_dict.get('suppress_disconnected', False): - + if (node.get_name() not in edge_src_set and node.get_name() not in edge_dst_set): - + continue - + graph.append( node.to_string()+'\n' ) elif obj['type'] == 'edge': edge = Edge(obj_dict=obj) - - if self.obj_dict.get('simplify', False) and edge in edges_done: + + if (self.obj_dict.get('simplify', False) and + edge in edges_done): continue - + graph.append( edge.to_string() + '\n' ) edges_done.add(edge) - + else: - + sgraph = Subgraph(obj_dict=obj) - + graph.append( sgraph.to_string()+'\n' ) graph.append( '}\n' ) - + return ''.join(graph) @@ -1664,9 +1541,12 @@ This class implements the methods to work on a representation of a subgraph in Graphviz's dot language. - - subgraph(graph_name='subG', suppress_disconnected=False, attribute=value, ...) - + + subgraph(graph_name='subG', + suppress_disconnected=False, + attribute=value, + ...) + graph_name: the subgraph's name suppress_disconnected: @@ -1674,29 +1554,33 @@ subgraph any disconnected nodes. All the attributes defined in the Graphviz dot language should be supported. - + Attributes can be set through the dynamically generated methods: - + set_[attribute name], i.e. set_size, set_fontname - + or using the instance's attributes: - - Subgraph.obj_dict['attributes'][attribute name], i.e. - + + Subgraph.obj_dict['attributes'][attribute name], i.e. + subgraph_instance.obj_dict['attributes']['label'] subgraph_instance.obj_dict['attributes']['fontname'] """ - - - # RMF: subgraph should have all the attributes of graph so it can be passed + + + # RMF: subgraph should have all the + # attributes of graph so it can be passed # as a graph to all methods # - def __init__(self, graph_name='', obj_dict=None, suppress_disconnected=False, - simplify=False, **attrs): - + def __init__(self, graph_name='', + obj_dict=None, suppress_disconnected=False, + simplify=False, **attrs): + - Graph.__init__(self, graph_name=graph_name, obj_dict=obj_dict, - suppress_disconnected=suppress_disconnected, simplify=simplify, **attrs) + Graph.__init__( + self, graph_name=graph_name, obj_dict=obj_dict, + suppress_disconnected=suppress_disconnected, + simplify=simplify, **attrs) if obj_dict is None: @@ -1711,35 +1595,42 @@ This class implements the methods to work on a representation of a cluster in Graphviz's dot language. - - cluster(graph_name='subG', suppress_disconnected=False, attribute=value, ...) - + + cluster(graph_name='subG', + suppress_disconnected=False, + attribute=value, + ...) + graph_name: - the cluster's name (the string 'cluster' will be always prepended) + the cluster's name + (the string 'cluster' will be always prepended) suppress_disconnected: defaults to false, which will remove from the cluster any disconnected nodes. All the attributes defined in the Graphviz dot language should be supported. - + Attributes can be set through the dynamically generated methods: - + set_[attribute name], i.e. set_color, set_fontname - + or using the instance's attributes: - - Cluster.obj_dict['attributes'][attribute name], i.e. - + + Cluster.obj_dict['attributes'][attribute name], i.e. + cluster_instance.obj_dict['attributes']['label'] cluster_instance.obj_dict['attributes']['fontname'] """ - - def __init__(self, graph_name='subG', obj_dict=None, suppress_disconnected=False, - simplify=False, **attrs): - Graph.__init__(self, graph_name=graph_name, obj_dict=obj_dict, - suppress_disconnected=suppress_disconnected, simplify=simplify, **attrs) + def __init__(self, graph_name='subG', + obj_dict=None, suppress_disconnected=False, + simplify=False, **attrs): + + Graph.__init__( + self, graph_name=graph_name, obj_dict=obj_dict, + suppress_disconnected=suppress_disconnected, + simplify=simplify, **attrs) if obj_dict is None: @@ -1750,7 +1641,7 @@ - + class Dot(Graph): @@ -1760,95 +1651,95 @@ a dot language file. It is a derived class of the base class 'Graph'. """ - - - + + + def __init__(self, *argsl, **argsd): Graph.__init__(self, *argsl, **argsd) self.shape_files = list() - - self.progs = None - - self.formats = ['canon', 'cmap', 'cmapx', 'cmapx_np', 'dia', 'dot', - 'fig', 'gd', 'gd2', 'gif', 'hpgl', 'imap', 'imap_np', 'ismap', - 'jpe', 'jpeg', 'jpg', 'mif', 'mp', 'pcl', 'pdf', 'pic', 'plain', - 'plain-ext', 'png', 'ps', 'ps2', 'svg', 'svgz', 'vml', 'vmlz', - 'vrml', 'vtx', 'wbmp', 'xdot', 'xlib' ] + self.formats = [ + 'canon', 'cmap', 'cmapx', + 'cmapx_np', 'dia', 'dot', + 'fig', 'gd', 'gd2', 'gif', + 'hpgl', 'imap', 'imap_np', 'ismap', + 'jpe', 'jpeg', 'jpg', 'mif', + 'mp', 'pcl', 'pdf', 'pic', 'plain', + 'plain-ext', 'png', 'ps', 'ps2', + 'svg', 'svgz', 'vml', 'vmlz', + 'vrml', 'vtx', 'wbmp', 'xdot', 'xlib'] self.prog = 'dot' - - # Automatically creates all the methods enabling the creation + + # Automatically creates all + # the methods enabling the creation # of output in any of the supported formats. for frmt in self.formats: self.__setattr__( 'create_'+frmt, - lambda f=frmt, prog=self.prog : self.create(format=f, prog=prog)) + lambda f=frmt, prog=self.prog: + self.create(format=f, prog=prog)) f = self.__dict__['create_'+frmt] - f.__doc__ = '''Refer to the docstring accompanying the 'create' method for more information.''' - + f.__doc__ = ( + "Refer to the docstring accompanying " + "the 'create' method for more information.") + for frmt in self.formats+['raw']: self.__setattr__( 'write_'+frmt, - lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog)) - + lambda path, f=frmt, prog=self.prog: + self.write(path, format=f, prog=prog)) + f = self.__dict__['write_'+frmt] - f.__doc__ = '''Refer to the docstring accompanying the 'write' method for more information.''' - - - + f.__doc__ = ( + "Refer to the docstring accompanying the " + "'write' method for more information.") + + + def __getstate__(self): - + dict = copy.copy(self.obj_dict) - + return dict - + def __setstate__(self, state): - + self.obj_dict = state - - + + def set_shape_files(self, file_paths): """Add the paths of the required image files. - - If the graph needs graphic objects to be used as shapes or otherwise - those need to be in the same folder as the graph is going to be rendered - from. Alternatively the absolute path to the files can be specified when + + If the graph needs graphic objects to + be used as shapes or otherwise + those need to be in the same folder as + the graph is going to be rendered + from. Alternatively the absolute path to + the files can be specified when including the graphics in the graph. - - The files in the location pointed to by the path(s) specified as arguments - to this method will be copied to the same temporary location where the + + The files in the location pointed to by + the path(s) specified as arguments + to this method will be copied to + the same temporary location where the graph is going to be rendered. """ - - if isinstance( file_paths, string_types ): + + if isinstance( file_paths, str_type): self.shape_files.append( file_paths ) - + if isinstance( file_paths, (list, tuple) ): self.shape_files.extend( file_paths ) - - + + def set_prog(self, prog): """Sets the default program. - + Sets the default program in charge of processing the dot file into a graph. """ self.prog = prog - - - def set_graphviz_executables(self, paths): - """This method allows to manually specify the location of the GraphViz executables. - - The argument to this method should be a dictionary where the keys are as follows: - - {'dot': '', 'twopi': '', 'neato': '', 'circo': '', 'fdp': ''} - - and the values are the paths to the corresponding executable, including the name - of the executable itself. - """ - - self.progs = paths def write(self, path, prog=None, format='raw'): @@ -1864,134 +1755,147 @@ in 'prog', which defaults to 'dot' Returns True or False according to the success of the write operation. - + There's also the preferred possibility of using: - + write_'format'(path, prog='program') - + which are automatically defined for all the supported formats. [write_ps(), write_gif(), write_dia(), ...] """ - if prog is None: prog = self.prog - - dot_fd = file(path, "w+b") if format == 'raw': - dot_fd.write(self.to_string()) - else: - dot_fd.write(self.create(prog, format)) - dot_fd.close() - + s = self.to_string() + mode = 'wt' + if not PY3: + s = unicode(s) + else: + s = self.create(prog, format) + mode = 'wb' + with io.open(path, mode=mode) as f: + f.write(s) return True - def create(self, prog=None, format='ps'): - """Creates and returns a Postscript representation of the graph. + """Creates and returns a binary image for the graph. create will write the graph to a temporary dot file and process it with the program given by 'prog' (which defaults to 'twopi'), - reading the Postscript output and returning it as a string is the - operation is successful. - On failure None is returned. - + reading the binary image output and return it as: + + - `str` of bytes in Python 2 + - `bytes` in Python 3 + There's also the preferred possibility of using: - + create_'format'(prog='program') - - which are automatically defined for all the supported formats. - [create_ps(), create_gif(), create_dia(), ...] + + which are automatically defined for all the supported formats, + for example: + + - `create_ps()` + - `create_gif()` + - `create_dia()` + + If 'prog' is a list, instead of a string, + then the fist item is expected to be the program name, + followed by any optional command-line arguments for it: + + [ 'twopi', '-Tdot', '-s10' ] + + + @param prog: either: + + - name of GraphViz executable that + can be found in the `$PATH`, or + + - absolute path to GraphViz executable. + + If you have added GraphViz to the `$PATH` and + use its executables as installed + (without renaming any of them) + then their names are: + + - `'dot'` + - `'twopi'` + - `'neato'` + - `'circo'` + - `'fdp'` + - `'sfdp'` + + On Windows, these have the notorious ".exe" extension that, + only for the above strings, will be added automatically. + + The `$PATH` is inherited from `os.env['PATH']` and + passed to `subprocess.Popen` using the `env` argument. + + If you haven't added GraphViz to your `$PATH` on Windows, + then you may want to give the absolute path to the + executable (for example, to `dot.exe`) in `prog`. """ - + default_names = set([ + 'dot', 'twopi', 'neato', + 'circo', 'fdp', 'sfdp']) if prog is None: prog = self.prog - - if self.progs is None: - self.progs = find_graphviz() - if self.progs is None: - raise InvocationException( - 'GraphViz\'s executables not found' ) - - if prog not in self.progs: - raise InvocationException( - 'GraphViz\'s executable "%s" not found' % prog ) - - if not os.path.exists( self.progs[prog] ) or not os.path.isfile( self.progs[prog] ): - raise InvocationException( - 'GraphViz\'s executable "%s" is not a file or doesn\'t exist' % self.progs[prog] ) - - + assert prog is not None + if isinstance(prog, (list, tuple)): + prog, args = prog[0], prog[1:] + else: + args = [] + if os.name == 'nt' and prog in default_names: + if not prog.endswith('.exe'): + prog += '.exe' + # temp file tmp_fd, tmp_name = tempfile.mkstemp() os.close(tmp_fd) self.write(tmp_name) - tmp_dir = os.path.dirname(tmp_name ) - + tmp_dir = os.path.dirname(tmp_name) # For each of the image files... - # for img in self.shape_files: - # Get its data - # - f = file(img, 'rb') + f = open(img, 'rb') f_data = f.read() f.close() - - # And copy it under a file with the same name in the temporary directory - # - f = file( os.path.join( tmp_dir, os.path.basename(img) ), 'wb' ) + # And copy it under a file with the same name in + # the temporary directory + f = open(os.path.join(tmp_dir, os.path.basename(img)), 'wb') f.write(f_data) f.close() - - p = subprocess.Popen( - (self.progs[prog], '-T'+format, tmp_name), - cwd=tmp_dir, - stderr=subprocess.PIPE, stdout=subprocess.PIPE) - - stderr = p.stderr - stdout = p.stdout - - stdout_output = list() - while True: - data = stdout.read() - if not data: - break - stdout_output.append(data) - stdout.close() - - stdout_output = ''.join(stdout_output) - - if not stderr.closed: - stderr_output = list() - while True: - data = stderr.read() - if not data: - break - stderr_output.append(data) - stderr.close() - - if stderr_output: - stderr_output = ''.join(stderr_output) - - #pid, status = os.waitpid(p.pid, 0) - status = p.wait() - - if status != 0 : - raise InvocationException( - 'Program terminated with status: %d. stderr follows: %s' % ( - status, stderr_output) ) - elif stderr_output: - print(stderr_output) - - # For each of the image files... - # + # explicitly inherit `$PATH`, on Windows too, + # with `shell=False` + env = dict() + env['PATH'] = os.environ['PATH'] + cmdline = [prog, '-T' + format] + args + [tmp_name] + try: + p = subprocess.Popen( + cmdline, + env=env, + cwd=tmp_dir, + shell=False, + stderr=subprocess.PIPE, stdout=subprocess.PIPE) + except OSError as e: + if e.errno == os.errno.ENOENT: + raise Exception( + '"{prog}" not found in path.'.format( + prog=prog)) + else: + raise + stdout_data, stderr_data = p.communicate() + # clean file litter for img in self.shape_files: - - # remove it - # - os.unlink( os.path.join( tmp_dir, os.path.basename(img) ) ) - + os.unlink(os.path.join(tmp_dir, os.path.basename(img))) os.unlink(tmp_name) - - return stdout_output - + # print(stdout_data) + if p.returncode != 0: + print( + ('{cmdline} return code: {c}\n\n' + 'stdout, stderr:\n {out}\n{err}\n').format( + cmdline=cmdline, + c=p.returncode, + out=stdout_data, + err=stderr_data)) + assert p.returncode == 0, p.returncode + return stdout_data diff -Nru yt-3.3.3/yt/extern/tqdm/_tqdm.py yt-3.4.0/yt/extern/tqdm/_tqdm.py --- yt-3.3.3/yt/extern/tqdm/_tqdm.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/extern/tqdm/_tqdm.py 2017-08-10 18:02:57.000000000 +0000 @@ -217,7 +217,7 @@ """ Parameters ---------- - iterable : iterable, optional + iterable : :obj:`!iterable`, optional Iterable to decorate with a progressbar. Leave blank [default: None] to manually manage the updates. desc : str, optional diff -Nru yt-3.3.3/yt/fields/angular_momentum.py yt-3.4.0/yt/fields/angular_momentum.py --- yt-3.3.3/yt/fields/angular_momentum.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/angular_momentum.py 2017-08-10 18:02:57.000000000 +0000 @@ -59,15 +59,15 @@ rv = data.ds.arr(rv, input_units = data["index", "x"].units) return xv * rv[...,1] - yv * rv[...,0] - registry.add_field((ftype, "specific_angular_momentum_x"), + registry.add_field((ftype, "specific_angular_momentum_x"), sampling_type="cell", function=_specific_angular_momentum_x, units=unit_system["specific_angular_momentum"], validators=[ValidateParameter("center")]) - registry.add_field((ftype, "specific_angular_momentum_y"), + registry.add_field((ftype, "specific_angular_momentum_y"), sampling_type="cell", function=_specific_angular_momentum_y, units=unit_system["specific_angular_momentum"], validators=[ValidateParameter("center")]) - registry.add_field((ftype, "specific_angular_momentum_z"), + registry.add_field((ftype, "specific_angular_momentum_z"), sampling_type="cell", function=_specific_angular_momentum_z, units=unit_system["specific_angular_momentum"], validators=[ValidateParameter("center")]) @@ -78,7 +78,7 @@ def _angular_momentum_x(field, data): return data[ftype, "cell_mass"] \ * data[ftype, "specific_angular_momentum_x"] - registry.add_field((ftype, "angular_momentum_x"), + registry.add_field((ftype, "angular_momentum_x"), sampling_type="cell", function=_angular_momentum_x, units=unit_system["angular_momentum"], validators=[ValidateParameter('center')]) @@ -86,7 +86,7 @@ def _angular_momentum_y(field, data): return data[ftype, "cell_mass"] \ * data[ftype, "specific_angular_momentum_y"] - registry.add_field((ftype, "angular_momentum_y"), + registry.add_field((ftype, "angular_momentum_y"), sampling_type="cell", function=_angular_momentum_y, units=unit_system["angular_momentum"], validators=[ValidateParameter('center')]) @@ -94,7 +94,7 @@ def _angular_momentum_z(field, data): return data[ftype, "cell_mass"] \ * data[ftype, "specific_angular_momentum_z"] - registry.add_field((ftype, "angular_momentum_z"), + registry.add_field((ftype, "angular_momentum_z"), sampling_type="cell", function=_angular_momentum_z, units=unit_system["angular_momentum"], validators=[ValidateParameter('center')]) diff -Nru yt-3.3.3/yt/fields/api.py yt-3.4.0/yt/fields/api.py --- yt-3.3.3/yt/fields/api.py 2016-10-25 16:08:30.000000000 +0000 +++ yt-3.4.0/yt/fields/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -43,3 +43,5 @@ FieldDetector from .field_info_container import \ FieldInfoContainer +from .xray_emission_fields import \ + add_xray_emissivity_field \ No newline at end of file diff -Nru yt-3.3.3/yt/fields/astro_fields.py yt-3.4.0/yt/fields/astro_fields.py --- yt-3.3.3/yt/fields/astro_fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/astro_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -52,7 +52,7 @@ """ return np.sqrt(3.0 * np.pi / (16.0 * G * data[ftype, "density"])) - registry.add_field((ftype, "dynamical_time"), + registry.add_field((ftype, "dynamical_time"), sampling_type="cell", function=_dynamical_time, units=unit_system["time"]) @@ -65,7 +65,7 @@ (data[ftype, "density"]**(-0.5))) return u - registry.add_field((ftype, "jeans_mass"), + registry.add_field((ftype, "jeans_mass"), sampling_type="cell", function=_jeans_mass, units=unit_system["mass"]) @@ -88,7 +88,7 @@ - 1.6667 * logT0**1 - 0.2193 * logT0)), "") # add correct units here - registry.add_field((ftype, "chandra_emissivity"), + registry.add_field((ftype, "chandra_emissivity"), sampling_type="cell", function=_chandra_emissivity, units="") # add correct units here @@ -97,12 +97,12 @@ X_H = data.get_field_parameter("X_H") else: X_H = 0.76 - nenh = data["density"]*data["density"] - nenh /= mh*mh + nenh = data["density"]/mh + nenh *= nenh nenh *= 0.5*(1.+X_H)*X_H*data["cell_volume"] return nenh - registry.add_field((ftype, "emission_measure"), + registry.add_field((ftype, "emission_measure"), sampling_type="cell", function=_emission_measure, units=unit_system["number_density"]) @@ -112,16 +112,18 @@ * data[ftype, "temperature"].to_ndarray()**0.5, "") # add correct units here - registry.add_field((ftype, "xray_emissivity"), + registry.add_field((ftype, "xray_emissivity"), sampling_type="cell", function=_xray_emissivity, units="") # add correct units here def _mazzotta_weighting(field, data): # Spectroscopic-like weighting field for galaxy clusters # Only useful as a weight_field for temperature, metallicity, velocity - return data["density"]*data["density"]*data["kT"]**-0.25/mh/mh + ret = data["density"]/mh + ret *= ret*data["kT"]**-0.25 + return ret - registry.add_field((ftype,"mazzotta_weighting"), + registry.add_field((ftype,"mazzotta_weighting"), sampling_type="cell", function=_mazzotta_weighting, units="keV**-0.25*cm**-6") @@ -135,7 +137,7 @@ # See issue #1225 return -scale * vel * data[ftype, "density"] - registry.add_field((ftype, "sz_kinetic"), + registry.add_field((ftype, "sz_kinetic"), sampling_type="cell", function=_sz_kinetic, units=unit_system["length"]**-1, validators=[ @@ -145,6 +147,6 @@ scale = 0.88 / mh * kboltz / (me * clight*clight) * sigma_thompson return scale * data[ftype, "density"] * data[ftype, "temperature"] - registry.add_field((ftype, "szy"), + registry.add_field((ftype, "szy"), sampling_type="cell", function=_szy, units=unit_system["length"]**-1) diff -Nru yt-3.3.3/yt/fields/cosmology_fields.py yt-3.4.0/yt/fields/cosmology_fields.py --- yt-3.3.3/yt/fields/cosmology_fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/cosmology_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -45,14 +45,14 @@ return data[ftype, "density"] + \ data[ftype, "dark_matter_density"] - registry.add_field((ftype, "matter_density"), + registry.add_field((ftype, "matter_density"), sampling_type="cell", function=_matter_density, units=unit_system["density"]) def _matter_mass(field, data): return data[ftype, "matter_density"] * data["index", "cell_volume"] - registry.add_field((ftype, "matter_mass"), + registry.add_field((ftype, "matter_mass"), sampling_type="cell", function=_matter_mass, units=unit_system["mass"]) @@ -65,7 +65,7 @@ return data[ftype, "matter_density"] / \ co.critical_density(data.ds.current_redshift) - registry.add_field((ftype, "overdensity"), + registry.add_field((ftype, "overdensity"), sampling_type="cell", function=_overdensity, units="") @@ -83,7 +83,7 @@ return data[ftype, "density"] / omega_baryon / co.critical_density(0.0) / \ (1.0 + data.ds.current_redshift)**3 - registry.add_field((ftype, "baryon_overdensity"), + registry.add_field((ftype, "baryon_overdensity"), sampling_type="cell", function=_baryon_overdensity, units="", validators=[ValidateParameter("omega_baryon")]) @@ -100,16 +100,20 @@ co.critical_density(0.0) / \ (1.0 + data.ds.current_redshift)**3 - registry.add_field((ftype, "matter_overdensity"), + registry.add_field((ftype, "matter_overdensity"), sampling_type="cell", function=_matter_overdensity, units="") # r / r_vir def _virial_radius_fraction(field, data): virial_radius = data.get_field_parameter("virial_radius") - return data["radius"] / virial_radius + if virial_radius == 0.0: + ret = 0.0 + else: + ret = data["radius"] / virial_radius + return ret - registry.add_field(("index", "virial_radius_fraction"), + registry.add_field(("index", "virial_radius_fraction"), sampling_type="cell", function=_virial_radius_fraction, validators=[ValidateParameter("virial_radius")], units="") @@ -137,7 +141,7 @@ return (1.5 * (co.hubble_constant / speed_of_light_cgs)**2 * (dl * dls / ds) * \ data[ftype, "matter_overdensity"]).in_units("1/cm") - registry.add_field((ftype, "weak_lensing_convergence"), + registry.add_field((ftype, "weak_lensing_convergence"), sampling_type="cell", function=_weak_lensing_convergence, units=unit_system["length"]**-1, validators=[ValidateParameter("observer_redshift"), diff -Nru yt-3.3.3/yt/fields/derived_field.py yt-3.4.0/yt/fields/derived_field.py --- yt-3.3.3/yt/fields/derived_field.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/derived_field.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,6 +13,8 @@ import contextlib import inspect +import re +import warnings from yt.extern.six import string_types, PY2 from yt.funcs import \ @@ -66,8 +68,14 @@ Describes whether the field should be logged validators : list A list of :class:`FieldValidator` objects + sampling_type : string, default = "cell" + How is the field sampled? This can be one of the following options at + present: "cell" (cell-centered), "discrete" (or "particle") for + discretely sampled data. particle_type : bool - Is this a particle (1D) field? + (Deprecated) Is this a particle (1D) field? This is deprecated. Use + sampling_type = "discrete" or sampling_type = "particle". This will + *override* sampling_type. vector_field : bool Describes the dimensionality of the field. Currently unused. display_field : bool @@ -83,21 +91,40 @@ dimensions : str or object from yt.units.dimensions The dimensions of the field, only needed if units="auto" and only used for error checking. + nodal_flag : array-like with three components + This describes how the field is centered within a cell. If nodal_flag + is [0, 0, 0], then the field is cell-centered. If any of the components + of nodal_flag are 1, then the field is nodal in that direction, meaning + it is defined at the lo and hi sides of the cell rather than at the center. + For example, a field with nodal_flag = [1, 0, 0] would be defined at the + middle of the 2 x-faces of each cell. nodal_flag = [0, 1, 1] would mean the + that the field defined at the centers of the 4 edges that are normal to the + x axis, while nodal_flag = [1, 1, 1] would be defined at the 8 cell corners. """ - def __init__(self, name, function, units=None, + def __init__(self, name, sampling_type, function, units=None, take_log=True, validators=None, - particle_type=False, vector_field=False, display_field=True, + particle_type=None, vector_field=False, display_field=True, not_in_all=False, display_name=None, output_units=None, - dimensions=None, ds=None): + dimensions=None, ds=None, nodal_flag=None): self.name = name self.take_log = take_log self.display_name = display_name self.not_in_all = not_in_all self.display_field = display_field - self.particle_type = particle_type + if particle_type is True: + warnings.warn("particle_type for derived fields " + "has been replaced with sampling_type = 'particle'", + DeprecationWarning) + sampling_type = "particle" + self.sampling_type = sampling_type self.vector_field = vector_field self.ds = ds + if nodal_flag is None: + self.nodal_flag = [0, 0, 0] + else: + self.nodal_flag = nodal_flag + self._function = function if validators: @@ -118,6 +145,8 @@ self.units = units elif isinstance(units, Unit): self.units = str(units) + elif isinstance(units, bytes): + self.units = units.decode("utf-8") else: raise FieldUnitsError("Cannot handle units '%s' (type %s)." \ "Please provide a string or Unit " \ @@ -136,13 +165,17 @@ dd['units'] = self.units dd['take_log'] = self.take_log dd['validators'] = list(self.validators) - dd['particle_type'] = self.particle_type + dd['sampling_type'] = self.sampling_type dd['vector_field'] = self.vector_field dd['display_field'] = True dd['not_in_all'] = self.not_in_all dd['display_name'] = self.display_name return dd + @property + def particle_type(self): + return self.sampling_type in ("discrete", "particle") + def get_units(self): if self.ds is not None: u = Unit(self.units, registry=self.ds.unit_registry) @@ -262,6 +295,51 @@ s += ")" return s + def _is_ion(self): + p = re.compile("_p[0-9]+_") + result = False + if p.search(self.name[1]) is not None: + result = True + return result + + def _ion_to_label(self): + pnum2rom = { + "0":"I", "1":"II", "2":"III", "3":"IV", "4":"V", + "5":"VI", "6":"VII", "7":"VIII", "8":"IX", "9":"X", + "10":"XI", "11":"XII", "12":"XIII", "13":"XIV", "14":"XV", + "15":"XVI", "16":"XVII", "17":"XVIII", "18":"XIX", "19":"XX"} + + p = re.compile("_p[0-9]+_") + m = p.search(self.name[1]) + if m is not None: + pstr = m.string[m.start()+1:m.end()-1] + segments = self.name[1].split("_") + for i,s in enumerate(segments): + segments[i] = s.capitalize() + if s == pstr: + ipstr = i + element = segments[ipstr-1] + roman = pnum2rom[pstr[1:]] + label = element + '\ ' + roman + '\ ' + \ + '\ '.join(segments[ipstr+1:]) + else: + label = self.name[1] + return label + + def get_latex_display_name(self): + label = self.display_name + if label is None: + if self._is_ion(): + fname = self._ion_to_label() + label = r'$\rm{'+fname.replace('_','\ ')+r'}$' + else: + label = r'$\rm{'+self.name[1].replace('_','\ ').title()+r'}$' + elif label.find('$') == -1: + label = label.replace(' ','\ ') + label = r'$\rm{'+label+r'}$' + return label + + class FieldValidator(object): pass @@ -331,6 +409,7 @@ FieldValidator.__init__(self) self.ghost_zones = ghost_zones self.fields = fields + def __call__(self, data): # When we say spatial information, we really mean # that it has a three-dimensional data structure diff -Nru yt-3.3.3/yt/fields/field_detector.py yt-3.4.0/yt/fields/field_detector.py --- yt-3.3.3/yt/fields/field_detector.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/field_detector.py 2017-08-10 18:02:57.000000000 +0000 @@ -193,6 +193,7 @@ fp_units = { 'bulk_velocity' : 'cm/s', + 'bulk_magnetic_field': 'G', 'center' : 'cm', 'normal' : '', 'cp_x_vec': '', @@ -207,8 +208,9 @@ if self.field_parameters and param in self.field_parameters: return self.field_parameters[param] self.requested_parameters.append(param) - if param in ['bulk_velocity', 'center', 'normal']: - return self.ds.arr(np.random.random(3) * 1e-2, self.fp_units[param]) + if param in ['center', 'normal'] or param.startswith('bulk'): + return self.ds.arr( + np.random.random(3) * 1e-2, self.fp_units[param]) elif param in ['surface_height']: return self.ds.quan(0.0, 'code_length') elif param in ['axis']: diff -Nru yt-3.3.3/yt/fields/field_functions.py yt-3.4.0/yt/fields/field_functions.py --- yt-3.3.3/yt/fields/field_functions.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/fields/field_functions.py 2017-08-10 18:02:57.000000000 +0000 @@ -18,12 +18,12 @@ from yt.utilities.lib.geometry_utils import \ obtain_rvec -def get_radius(data, field_prefix): +def get_radius(data, field_prefix, ftype): unit_system = data.ds.unit_system center = data.get_field_parameter("center").in_base(unit_system.name) DW = (data.ds.domain_right_edge - data.ds.domain_left_edge).in_base(unit_system.name) # This is in cm**2 so it can be the destination for our r later. - radius2 = data.ds.arr(np.zeros(data[field_prefix+"x"].shape, + radius2 = data.ds.arr(np.zeros(data[ftype, field_prefix+"x"].shape, dtype='float64'), 'cm**2') r = radius2.copy() if any(data.ds.periodicity): @@ -31,7 +31,7 @@ for i, ax in enumerate('xyz'): # This will coerce the units, so we don't need to worry that we copied # it from a cm**2 array. - np.subtract(data["%s%s" % (field_prefix, ax)].in_base(unit_system.name), + np.subtract(data[ftype, "%s%s" % (field_prefix, ax)].in_base(unit_system.name), center[i], r) if data.ds.periodicity[i] is True: np.abs(r, r) diff -Nru yt-3.3.3/yt/fields/field_info_container.py yt-3.4.0/yt/fields/field_info_container.py --- yt-3.3.3/yt/fields/field_info_container.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/field_info_container.py 2017-08-10 18:02:57.000000000 +0000 @@ -21,6 +21,7 @@ from yt.extern.six import string_types from yt.funcs import mylog, only_on_root from yt.units.unit_object import Unit +from yt.units.dimensions import dimensionless from .derived_field import \ DerivedField, \ NullFunc, \ @@ -86,20 +87,20 @@ self[(ftype, f)].units = self["index", f].units def setup_particle_fields(self, ptype, ftype='gas', num_neighbors=64 ): - skip_output_units = ("code_length",) + skip_output_units = ("code_length") for f, (units, aliases, dn) in sorted(self.known_particle_fields): units = self.ds.field_units.get((ptype, f), units) + output_units = units if (f in aliases or ptype not in self.ds.particle_types_raw) and \ units not in skip_output_units: u = Unit(units, registry = self.ds.unit_registry) - output_units = str(self.ds.unit_system[u.dimensions]) - else: - output_units = units + if u.dimensions is not dimensionless: + output_units = str(self.ds.unit_system[u.dimensions]) if (ptype, f) not in self.field_list: continue - self.add_output_field((ptype, f), - units = units, particle_type = True, - display_name = dn, output_units = output_units) + self.add_output_field((ptype, f), sampling_type="particle", + units = units, display_name = dn, + output_units = output_units) for alias in aliases: self.alias((ptype, alias), (ptype, f), units = output_units) @@ -134,9 +135,8 @@ raise RuntimeError if field[0] not in self.ds.particle_types: continue - self.add_output_field(field, - units = self.ds.field_units.get(field, ""), - particle_type = True) + self.add_output_field(field, sampling_type="particle", + units = self.ds.field_units.get(field, "")) self.setup_smoothed_fields(ptype, num_neighbors=num_neighbors, ftype=ftype) @@ -196,12 +196,12 @@ units = "" elif units == 1.0: units = "" - self.add_output_field(field, units = units, + self.add_output_field(field, sampling_type="cell", units = units, display_name = display_name) for alias in aliases: self.alias(("gas", alias), field) - def add_field(self, name, function=None, **kwargs): + def add_field(self, name, sampling_type, function=None, **kwargs): """ Add a new field, along with supplemental metadata, to the list of available fields. This respects a number of arguments, all of which @@ -250,25 +250,26 @@ kwargs.setdefault('ds', self.ds) if function is None: def create_function(f): - self[name] = DerivedField(name, f, **kwargs) + self[name] = DerivedField(name, sampling_type, f, **kwargs) return f return create_function if isinstance(name, tuple): - self[name] = DerivedField(name, function, **kwargs) + self[name] = DerivedField(name, sampling_type, function, **kwargs) return - if kwargs.get("particle_type", False): + if sampling_type == 'particle': ftype = 'all' else: ftype = self.ds.default_fluid_type if (ftype, name) not in self: tuple_name = (ftype, name) - self[tuple_name] = DerivedField(tuple_name, function, **kwargs) + self[tuple_name] = DerivedField(tuple_name, sampling_type, function, + **kwargs) self.alias(name, tuple_name) else: - self[name] = DerivedField(name, function, **kwargs) + self[name] = DerivedField(name, sampling_type, function, **kwargs) def load_all_plugins(self, ftype="gas"): loaded = [] @@ -296,9 +297,9 @@ self.ds.derived_field_list = list(sorted(dfl, key=tupleize)) return loaded, unavailable - def add_output_field(self, name, **kwargs): + def add_output_field(self, name, sampling_type, **kwargs): kwargs.setdefault('ds', self.ds) - self[name] = DerivedField(name, NullFunc, **kwargs) + self[name] = DerivedField(name, sampling_type, NullFunc, **kwargs) def alias(self, alias_name, original_name, units = None): if original_name not in self: return @@ -307,11 +308,14 @@ # as well. u = Unit(self[original_name].units, registry = self.ds.unit_registry) - units = str(self.ds.unit_system[u.dimensions]) + if u.dimensions is not dimensionless: + units = str(self.ds.unit_system[u.dimensions]) + else: + units = self[original_name].units self.field_aliases[alias_name] = original_name self.add_field(alias_name, function = TranslationFunc(original_name), - particle_type = self[original_name].particle_type, + sampling_type = self[original_name].sampling_type, display_name = self[original_name].display_name, units = units) @@ -364,6 +368,10 @@ if field in self._show_field_errors: raise if type(e) != YTFieldNotFound: + # if we're doing field tests, raise an error + # see yt.fields.tests.test_fields + if hasattr(self.ds, '_field_test_dataset'): + raise mylog.debug("Raises %s during field %s detection.", str(type(e)), field) self.pop(field) diff -Nru yt-3.3.3/yt/fields/fluid_fields.py yt-3.4.0/yt/fields/fluid_fields.py --- yt-3.3.3/yt/fields/fluid_fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/fluid_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -59,14 +59,14 @@ def _cell_mass(field, data): return data[ftype, "density"] * data[ftype, "cell_volume"] - registry.add_field((ftype, "cell_mass"), + registry.add_field((ftype, "cell_mass"), sampling_type="cell", function=_cell_mass, units=unit_system["mass"]) def _sound_speed(field, data): tr = data.ds.gamma * data[ftype, "pressure"] / data[ftype, "density"] return np.sqrt(tr) - registry.add_field((ftype, "sound_speed"), + registry.add_field((ftype, "sound_speed"), sampling_type="cell", function=_sound_speed, units=unit_system["velocity"]) @@ -74,7 +74,7 @@ """ Radial component of M{|v|/c_sound} """ tr = data[ftype, "radial_velocity"] / data[ftype, "sound_speed"] return np.abs(tr) - registry.add_field((ftype, "radial_mach_number"), + registry.add_field((ftype, "radial_mach_number"), sampling_type="cell", function=_radial_mach_number, units = "") @@ -82,14 +82,14 @@ return 0.5*data[ftype, "density"] * ( data[ftype, "velocity_x"]**2.0 + data[ftype, "velocity_y"]**2.0 + data[ftype, "velocity_z"]**2.0 ) - registry.add_field((ftype, "kinetic_energy"), + registry.add_field((ftype, "kinetic_energy"), sampling_type="cell", function = _kin_energy, units = unit_system["pressure"]) def _mach_number(field, data): """ M{|v|/c_sound} """ return data[ftype, "velocity_magnitude"] / data[ftype, "sound_speed"] - registry.add_field((ftype, "mach_number"), + registry.add_field((ftype, "mach_number"), sampling_type="cell", function=_mach_number, units = "") @@ -103,7 +103,7 @@ tr = np.minimum(np.minimum(t1, t2), t3) return tr - registry.add_field((ftype, "courant_time_step"), + registry.add_field((ftype, "courant_time_step"), sampling_type="cell", function=_courant_time_step, units=unit_system["time"]) @@ -113,13 +113,13 @@ * (data[ftype, "density"] * data[ftype, "thermal_energy"]) return tr - registry.add_field((ftype, "pressure"), + registry.add_field((ftype, "pressure"), sampling_type="cell", function=_pressure, units=unit_system["pressure"]) def _kT(field, data): return (kboltz*data[ftype, "temperature"]).in_units("keV") - registry.add_field((ftype, "kT"), + registry.add_field((ftype, "kT"), sampling_type="cell", function=_kT, units="keV", display_name="Temperature") @@ -132,7 +132,7 @@ gammam1 = 2./3. tr = data[ftype,"kT"] / ((data[ftype, "density"]/mw)**gammam1) return data.apply_units(tr, field.units) - registry.add_field((ftype, "entropy"), + registry.add_field((ftype, "entropy"), sampling_type="cell", units="keV*cm**2", function=_entropy) @@ -140,13 +140,13 @@ tr = data[ftype, "metal_density"] / data[ftype, "density"] tr /= metallicity_sun return data.apply_units(tr, "Zsun") - registry.add_field((ftype, "metallicity"), + registry.add_field((ftype, "metallicity"), sampling_type="cell", function=_metallicity, units="Zsun") def _metal_mass(field, data): return data[ftype, "metal_density"] * data[ftype, "cell_volume"] - registry.add_field((ftype, "metal_mass"), + registry.add_field((ftype, "metal_mass"), sampling_type="cell", function=_metal_mass, units=unit_system["mass"]) @@ -156,13 +156,13 @@ for species in data.ds.field_info.species_names: field_data += data["gas", "%s_number_density" % species] return field_data - registry.add_field((ftype, "number_density"), + registry.add_field((ftype, "number_density"), sampling_type="cell", function = _number_density, units=unit_system["number_density"]) def _mean_molecular_weight(field, data): return (data[ftype, "density"] / (mh * data[ftype, "number_density"])) - registry.add_field((ftype, "mean_molecular_weight"), + registry.add_field((ftype, "mean_molecular_weight"), sampling_type="cell", function=_mean_molecular_weight, units="") @@ -207,7 +207,7 @@ for axi, ax in enumerate('xyz'): f = grad_func(axi, ax) - registry.add_field((ftype, "%s_gradient_%s" % (fname, ax)), + registry.add_field((ftype, "%s_gradient_%s" % (fname, ax)), sampling_type="cell", function = f, validators = [ValidateSpatial(1, [grad_field])], units = grad_units) diff -Nru yt-3.3.3/yt/fields/fluid_vector_fields.py yt-3.4.0/yt/fields/fluid_vector_fields.py --- yt-3.3.3/yt/fields/fluid_vector_fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/fluid_vector_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -67,7 +67,7 @@ bv_validators = [ValidateSpatial(1, [(ftype, "density"), (ftype, "pressure")])] for ax in 'xyz': n = "baroclinic_vorticity_%s" % ax - registry.add_field((ftype, n), function=eval("_%s" % n), + registry.add_field((ftype, n), sampling_type="cell", function=eval("_%s" % n), validators=bv_validators, units=unit_system["frequency"]**2) @@ -119,7 +119,7 @@ (ftype, "velocity_z")])] for ax in 'xyz': n = "vorticity_%s" % ax - registry.add_field((ftype, n), + registry.add_field((ftype, n), sampling_type="cell", function=eval("_%s" % n), units=unit_system["frequency"], validators=vort_validators) @@ -138,7 +138,7 @@ return data[ftype, "velocity_divergence"] * data[ftype, "vorticity_z"] for ax in 'xyz': n = "vorticity_stretching_%s" % ax - registry.add_field((ftype, n), + registry.add_field((ftype, n), sampling_type="cell", function=eval("_%s" % n), units = unit_system["frequency"]**2, validators=vort_validators) @@ -159,7 +159,7 @@ data[ftype, "baroclinic_vorticity_z"] for ax in 'xyz': n = "vorticity_growth_%s" % ax - registry.add_field((ftype, n), + registry.add_field((ftype, n), sampling_type="cell", function=eval("_%s" % n), units=unit_system["frequency"]**2, validators=vort_validators) @@ -175,7 +175,7 @@ result = np.sign(dot) * result return result - registry.add_field((ftype, "vorticity_growth_magnitude"), + registry.add_field((ftype, "vorticity_growth_magnitude"), sampling_type="cell", function=_vorticity_growth_magnitude, units=unit_system["frequency"]**2, validators=vort_validators, @@ -186,7 +186,7 @@ data[ftype, "vorticity_growth_y"]**2 + data[ftype, "vorticity_growth_z"]**2) - registry.add_field((ftype, "vorticity_growth_magnitude_absolute"), + registry.add_field((ftype, "vorticity_growth_magnitude_absolute"), sampling_type="cell", function=_vorticity_growth_magnitude_absolute, units=unit_system["frequency"]**2, validators=vort_validators) @@ -197,7 +197,7 @@ domegaz_dt = data[ftype, "vorticity_z"] / data[ftype, "vorticity_growth_z"] return np.sqrt(domegax_dt**2 + domegay_dt**2 + domegaz_dt**2) - registry.add_field((ftype, "vorticity_growth_timescale"), + registry.add_field((ftype, "vorticity_growth_timescale"), sampling_type="cell", function=_vorticity_growth_timescale, units=unit_system["time"], validators=vort_validators) @@ -232,7 +232,7 @@ (ftype, "radiation_acceleration_z")])] for ax in 'xyz': n = "vorticity_radiation_pressure_%s" % ax - registry.add_field((ftype, n), + registry.add_field((ftype, n), sampling_type="cell", function=eval("_%s" % n), units=unit_system["frequency"]**2, validators=vrp_validators) @@ -257,7 +257,7 @@ for ax in 'xyz': n = "vorticity_radiation_pressure_growth_%s" % ax - registry.add_field((ftype, n), + registry.add_field((ftype, n), sampling_type="cell", function=eval("_%s" % n), units=unit_system["frequency"]**2, validators=vrp_validators) @@ -273,7 +273,7 @@ result = np.sign(dot) * result return result - registry.add_field((ftype, "vorticity_radiation_pressure_growth_magnitude"), + registry.add_field((ftype, "vorticity_radiation_pressure_growth_magnitude"), sampling_type="cell", function=_vorticity_radiation_pressure_growth_magnitude, units=unit_system["frequency"]**2, validators=vrp_validators, @@ -284,7 +284,7 @@ data[ftype, "vorticity_radiation_pressure_growth_y"]**2 + data[ftype, "vorticity_radiation_pressure_growth_z"]**2) - registry.add_field((ftype, "vorticity_radiation_pressure_growth_magnitude_absolute"), + registry.add_field((ftype, "vorticity_radiation_pressure_growth_magnitude_absolute"), sampling_type="cell", function=_vorticity_radiation_pressure_growth_magnitude_absolute, units="s**(-2)", validators=vrp_validators) @@ -298,7 +298,7 @@ data[ftype, "vorticity_radiation_pressure_growth_z"] return np.sqrt(domegax_dt**2 + domegay_dt**2 + domegaz_dt**2) - registry.add_field((ftype, "vorticity_radiation_pressure_growth_timescale"), + registry.add_field((ftype, "vorticity_radiation_pressure_growth_timescale"), sampling_type="cell", function=_vorticity_radiation_pressure_growth_timescale, units=unit_system["time"], validators=vrp_validators) @@ -344,7 +344,7 @@ new_field[sl_center, sl_center, sl_center] = f return new_field - registry.add_field((ftype, "shear"), + registry.add_field((ftype, "shear"), sampling_type="cell", function=_shear, validators=[ValidateSpatial(1, [(ftype, "velocity_x"), @@ -361,7 +361,7 @@ return data[ftype, "shear"] / data[ftype, "sound_speed"] - registry.add_field((ftype, "shear_criterion"), + registry.add_field((ftype, "shear_criterion"), sampling_type="cell", function=_shear_criterion, units=unit_system["length"]**-1, validators=[ValidateSpatial(1, @@ -417,7 +417,7 @@ new_field[sl_center, sl_center, sl_center] = f return new_field - registry.add_field((ftype, "shear_mach"), + registry.add_field((ftype, "shear_mach"), sampling_type="cell", function=_shear_mach, units="", validators=[ValidateSpatial(1, diff -Nru yt-3.3.3/yt/fields/geometric_fields.py yt-3.4.0/yt/fields/geometric_fields.py --- yt-3.3.3/yt/fields/geometric_fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/geometric_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -44,9 +44,9 @@ Relative to the coordinate system defined by the *center* field parameter. """ - return get_radius(data, "") + return get_radius(data, "", field.name[0]) - registry.add_field(("index", "radius"), + registry.add_field(("index", "radius"), sampling_type="cell", function=_radius, validators=[ValidateParameter("center")], units=unit_system["length"]) @@ -59,7 +59,7 @@ return data._reshape_vals(arr) return arr - registry.add_field(("index", "grid_level"), + registry.add_field(("index", "grid_level"), sampling_type="cell", function=_grid_level, units="", validators=[ValidateSpatial(0)]) @@ -76,7 +76,7 @@ return data._reshape_vals(arr) return arr - registry.add_field(("index", "grid_indices"), + registry.add_field(("index", "grid_indices"), sampling_type="cell", function=_grid_indices, units="", validators=[ValidateSpatial(0)], @@ -87,7 +87,7 @@ return np.ones(data["index", "ones"].shape, dtype="float64")/data["index", "dx"] - registry.add_field(("index", "ones_over_dx"), + registry.add_field(("index", "ones_over_dx"), sampling_type="cell", function=_ones_over_dx, units=unit_system["length"]**-1, display_field=False) @@ -97,7 +97,7 @@ arr = np.zeros(data["index", "ones"].shape, dtype='float64') return data.apply_units(arr, field.units) - registry.add_field(("index", "zeros"), + registry.add_field(("index", "zeros"), sampling_type="cell", function=_zeros, units="", display_field=False) @@ -109,7 +109,7 @@ return data._reshape_vals(arr) return data.apply_units(arr, field.units) - registry.add_field(("index", "ones"), + registry.add_field(("index", "ones"), sampling_type="cell", function=_ones, units="", display_field=False) @@ -132,7 +132,7 @@ data["index", "z"].ravel(), LE, RE) morton.shape = data["index", "x"].shape return morton.view("f8") - registry.add_field(("index", "morton_index"), function=_morton_index, + registry.add_field(("index", "morton_index"), sampling_type="cell", function=_morton_index, units = "") def _spherical_radius(field, data): @@ -144,7 +144,7 @@ coords = get_periodic_rvec(data) return data.ds.arr(get_sph_r(coords), "code_length").in_base(unit_system.name) - registry.add_field(("index", "spherical_radius"), + registry.add_field(("index", "spherical_radius"), sampling_type="cell", function=_spherical_radius, validators=[ValidateParameter("center")], units=unit_system["length"]) @@ -153,7 +153,7 @@ """This field is deprecated and will be removed in a future release""" return data['index', 'spherical_radius'] - registry.add_field(("index", "spherical_r"), + registry.add_field(("index", "spherical_r"), sampling_type="cell", function=_spherical_r, validators=[ValidateParameter("center")], units=unit_system["length"]) @@ -171,7 +171,7 @@ coords = get_periodic_rvec(data) return get_sph_theta(coords, normal) - registry.add_field(("index", "spherical_theta"), + registry.add_field(("index", "spherical_theta"), sampling_type="cell", function=_spherical_theta, validators=[ValidateParameter("center"), ValidateParameter("normal")], @@ -190,7 +190,7 @@ coords = get_periodic_rvec(data) return get_sph_phi(coords, normal) - registry.add_field(("index", "spherical_phi"), + registry.add_field(("index", "spherical_phi"), sampling_type="cell", function=_spherical_phi, validators=[ValidateParameter("center"), ValidateParameter("normal")], @@ -206,7 +206,7 @@ coords = get_periodic_rvec(data) return data.ds.arr(get_cyl_r(coords, normal), "code_length").in_base(unit_system.name) - registry.add_field(("index", "cylindrical_radius"), + registry.add_field(("index", "cylindrical_radius"), sampling_type="cell", function=_cylindrical_radius, validators=[ValidateParameter("center"), ValidateParameter("normal")], @@ -216,7 +216,7 @@ """This field is deprecated and will be removed in a future release""" return data['index', 'cylindrical_radius'] - registry.add_field(("index", "cylindrical_r"), + registry.add_field(("index", "cylindrical_r"), sampling_type="cell", function=_cylindrical_r, validators=[ValidateParameter("center")], units=unit_system["length"]) @@ -231,7 +231,7 @@ coords = get_periodic_rvec(data) return data.ds.arr(get_cyl_z(coords, normal), "code_length").in_base(unit_system.name) - registry.add_field(("index", "cylindrical_z"), + registry.add_field(("index", "cylindrical_z"), sampling_type="cell", function=_cylindrical_z, validators=[ValidateParameter("center"), ValidateParameter("normal")], @@ -250,7 +250,7 @@ coords = get_periodic_rvec(data) return get_cyl_theta(coords, normal) - registry.add_field(("index", "cylindrical_theta"), + registry.add_field(("index", "cylindrical_theta"), sampling_type="cell", function=_cylindrical_theta, validators=[ValidateParameter("center"), ValidateParameter("normal")], @@ -260,7 +260,7 @@ """This field is dprecated and will be removed in a future release""" return data["index", "spherical_theta"] - registry.add_field(("index", "disk_angle"), + registry.add_field(("index", "disk_angle"), sampling_type="cell", function=_disk_angle, take_log=False, display_field=False, @@ -272,7 +272,7 @@ """This field is deprecated and will be removed in a future release""" return data["index", "cylindrical_z"] - registry.add_field(("index", "height"), + registry.add_field(("index", "height"), sampling_type="cell", function=_height, validators=[ValidateParameter("center"), ValidateParameter("normal")], diff -Nru yt-3.3.3/yt/fields/local_fields.py yt-3.4.0/yt/fields/local_fields.py --- yt-3.3.3/yt/fields/local_fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/local_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -12,6 +12,7 @@ # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +import warnings from yt.utilities.logger import \ ytLogger as mylog @@ -23,7 +24,7 @@ FieldInfoContainer class LocalFieldInfoContainer(FieldInfoContainer): - def add_field(self, name, function=None, **kwargs): + def add_field(self, name, function=None, sampling_type=None, **kwargs): if not isinstance(name, tuple): if kwargs.setdefault('particle_type', False): name = ('all', name) @@ -34,8 +35,19 @@ if not override and name in self: mylog.warning("Field %s already exists. To override use " + "force_override=True.", name) + if kwargs.setdefault('particle_type', False): + if sampling_type is not None and sampling_type != "particle": + raise RuntimeError("Clashing definition of 'sampling_type' and " + "'particle_type'. Note that 'particle_type' is " + "deprecated. Please just use 'sampling_type'.") + else: + sampling_type = "particle" + if sampling_type is None: + warnings.warn("Because 'sampling_type' not specified, yt will " + "assume a cell 'sampling_type'") + sampling_type = "cell" return super(LocalFieldInfoContainer, - self).add_field(name, function, **kwargs) + self).add_field(name, sampling_type, function, **kwargs) # Empty FieldInfoContainer local_fields = LocalFieldInfoContainer(None, [], None) diff -Nru yt-3.3.3/yt/fields/magnetic_field.py yt-3.4.0/yt/fields/magnetic_field.py --- yt-3.3.3/yt/fields/magnetic_field.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/magnetic_field.py 2017-08-10 18:02:57.000000000 +0000 @@ -36,82 +36,110 @@ def setup_magnetic_field_fields(registry, ftype = "gas", slice_info = None): unit_system = registry.ds.unit_system - if (ftype,"magnetic_field_x") not in registry: + axis_names = registry.ds.coordinates.axis_order + + if (ftype,"magnetic_field_%s" % axis_names[0]) not in registry: return - u = registry[ftype,"magnetic_field_x"].units + u = registry[ftype,"magnetic_field_%s" % axis_names[0]].units def _magnetic_field_strength(field,data): - B2 = (data[ftype,"magnetic_field_x"]**2 + - data[ftype,"magnetic_field_y"]**2 + - data[ftype,"magnetic_field_z"]**2) + B2 = (data[ftype,"magnetic_field_%s" % axis_names[0]]**2 + + data[ftype,"magnetic_field_%s" % axis_names[1]]**2 + + data[ftype,"magnetic_field_%s" % axis_names[2]]**2) return np.sqrt(B2) - registry.add_field((ftype,"magnetic_field_strength"), + registry.add_field((ftype,"magnetic_field_strength"), sampling_type="cell", function=_magnetic_field_strength, units=u) def _magnetic_energy(field, data): B = data[ftype,"magnetic_field_strength"] return 0.5*B*B/mag_factors[B.units.dimensions] - registry.add_field((ftype, "magnetic_energy"), + registry.add_field((ftype, "magnetic_energy"), sampling_type="cell", function=_magnetic_energy, units=unit_system["pressure"]) def _plasma_beta(field,data): return data[ftype,'pressure']/data[ftype,'magnetic_energy'] - registry.add_field((ftype, "plasma_beta"), + registry.add_field((ftype, "plasma_beta"), sampling_type="cell", function=_plasma_beta, units="") def _magnetic_pressure(field,data): return data[ftype,'magnetic_energy'] - registry.add_field((ftype, "magnetic_pressure"), + registry.add_field((ftype, "magnetic_pressure"), sampling_type="cell", function=_magnetic_pressure, units=unit_system["pressure"]) - def _magnetic_field_poloidal(field,data): - normal = data.get_field_parameter("normal") - d = data[ftype,'magnetic_field_x'] - Bfields = data.ds.arr( - [data[ftype,'magnetic_field_x'], - data[ftype,'magnetic_field_y'], - data[ftype,'magnetic_field_z']], - d.units) + if registry.ds.geometry == "cartesian": + def _magnetic_field_poloidal(field,data): + normal = data.get_field_parameter("normal") + d = data[ftype,'magnetic_field_x'] + Bfields = data.ds.arr( + [data[ftype,'magnetic_field_x'], + data[ftype,'magnetic_field_y'], + data[ftype,'magnetic_field_z']], + d.units) + + theta = data["index", 'spherical_theta'] + phi = data["index", 'spherical_phi'] + + return get_sph_theta_component(Bfields, theta, phi, normal) + + def _magnetic_field_toroidal(field,data): + normal = data.get_field_parameter("normal") + d = data[ftype,'magnetic_field_x'] + Bfields = data.ds.arr( + [data[ftype,'magnetic_field_x'], + data[ftype,'magnetic_field_y'], + data[ftype,'magnetic_field_z']], + d.units) + + phi = data["index", 'spherical_phi'] + return get_sph_phi_component(Bfields, phi, normal) + + elif registry.ds.geometry == "cylindrical": + def _magnetic_field_poloidal(field, data): + r = data["index", "r"] + z = data["index", "z"] + d = np.sqrt(r*r+z*z) + return (data[ftype, "magnetic_field_r"]*(r/d) + + data[ftype, "magnetic_field_z"]*(z/d)) + + def _magnetic_field_toroidal(field, data): + return data[ftype,"magnetic_field_theta"] + + elif registry.ds.geometry == "spherical": + def _magnetic_field_poloidal(field, data): + return data[ftype,"magnetic_field_theta"] + + def _magnetic_field_toroidal(field, data): + return data[ftype,"magnetic_field_phi"] - theta = data["index", 'spherical_theta'] - phi = data["index", 'spherical_phi'] + else: - return get_sph_theta_component(Bfields, theta, phi, normal) + # Unidentified geometry--set to None - registry.add_field((ftype, "magnetic_field_poloidal"), + _magnetic_field_toroidal = None + _magnetic_field_poloidal = None + + registry.add_field((ftype, "magnetic_field_poloidal"), sampling_type="cell", function=_magnetic_field_poloidal, units=u, validators=[ValidateParameter("normal")]) - def _magnetic_field_toroidal(field,data): - normal = data.get_field_parameter("normal") - d = data[ftype,'magnetic_field_x'] - Bfields = data.ds.arr( - [data[ftype,'magnetic_field_x'], - data[ftype,'magnetic_field_y'], - data[ftype,'magnetic_field_z']], - d.units) - - phi = data["index", 'spherical_phi'] - return get_sph_phi_component(Bfields, phi, normal) - - registry.add_field((ftype, "magnetic_field_toroidal"), + registry.add_field((ftype, "magnetic_field_toroidal"), sampling_type="cell", function=_magnetic_field_toroidal, units=u, validators=[ValidateParameter("normal")]) def _alfven_speed(field,data): B = data[ftype,'magnetic_field_strength'] return B/np.sqrt(mag_factors[B.units.dimensions]*data[ftype,'density']) - registry.add_field((ftype, "alfven_speed"), function=_alfven_speed, + registry.add_field((ftype, "alfven_speed"), sampling_type="cell", function=_alfven_speed, units=unit_system["velocity"]) def _mach_alfven(field,data): return data[ftype,'velocity_magnitude']/data[ftype,'alfven_speed'] - registry.add_field((ftype, "mach_alfven"), function=_mach_alfven, + registry.add_field((ftype, "mach_alfven"), sampling_type="cell", function=_mach_alfven, units="dimensionless") def setup_magnetic_field_aliases(registry, ds_ftype, ds_fields, ftype="gas"): @@ -160,7 +188,7 @@ def _mag_field(field, data): return convert(data[fd]) return _mag_field - for ax, fd in zip("xyz", ds_fields): - registry.add_field((ftype,"magnetic_field_%s" % ax), + for ax, fd in zip(registry.ds.coordinates.axis_order, ds_fields): + registry.add_field((ftype,"magnetic_field_%s" % ax), sampling_type="cell", function=mag_field(fd), - units=unit_system[to_units.dimensions]) \ No newline at end of file + units=unit_system[to_units.dimensions]) diff -Nru yt-3.3.3/yt/fields/my_plugin_fields.py yt-3.4.0/yt/fields/my_plugin_fields.py --- yt-3.3.3/yt/fields/my_plugin_fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/my_plugin_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -16,11 +16,11 @@ from .field_plugin_registry import \ register_field_plugin -from .field_info_container import \ - FieldInfoContainer +from .local_fields import \ + LocalFieldInfoContainer # Empty FieldInfoContainer -my_plugins_fields = FieldInfoContainer(None, [], None) +my_plugins_fields = LocalFieldInfoContainer(None, [], None) @register_field_plugin def setup_my_plugins_fields(registry, ftype="gas", slice_info=None): diff -Nru yt-3.3.3/yt/fields/particle_fields.py yt-3.4.0/yt/fields/particle_fields.py --- yt-3.3.3/yt/fields/particle_fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/particle_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -103,6 +103,7 @@ return data.apply_units(d, field.units) registry.add_field(("deposit", "%s_count" % ptype), + sampling_type="cell", function = particle_count, validators = [ValidateSpatial()], units = '', @@ -116,6 +117,7 @@ return data.apply_units(d, field.units) registry.add_field(("deposit", "%s_mass" % ptype), + sampling_type="cell", function = particle_mass, validators = [ValidateSpatial()], display_name = r"\mathrm{%s Mass}" % ptype_dn, @@ -130,6 +132,7 @@ return d registry.add_field(("deposit", "%s_density" % ptype), + sampling_type="cell", function = particle_density, validators = [ValidateSpatial()], display_name = r"\mathrm{%s Density}" % ptype_dn, @@ -143,6 +146,7 @@ return d registry.add_field(("deposit", "%s_cic" % ptype), + sampling_type="cell", function = particle_cic, validators = [ValidateSpatial()], display_name = r"\mathrm{%s CIC Density}" % ptype_dn, @@ -171,7 +175,7 @@ function = _get_density_weighted_deposit_field( "particle_velocity_%s" % ax, "cm/s", method) registry.add_field( - ("deposit", ("%s_"+name+"_velocity_%s") % (ptype, ax)), + ("deposit", ("%s_"+name+"_velocity_%s") % (ptype, ax)), sampling_type="cell", function=function, units=unit_system["velocity"], take_log=False, validators=[ValidateSpatial(0)]) @@ -179,19 +183,19 @@ function = _get_density_weighted_deposit_field( "age", "s", method) registry.add_field( - ("deposit", ("%s_"+name+"_age") % (ptype)), + ("deposit", ("%s_"+name+"_age") % (ptype)), sampling_type="cell", function=function, units=unit_system["time"], take_log=False, validators=[ValidateSpatial(0)]) # Now some translation functions. def particle_ones(field, data): - v = np.ones(data[ptype, mass_name].shape, dtype="float64") + v = np.ones(data[ptype, coord_name].shape[0], dtype="float64") return data.apply_units(v, field.units) registry.add_field((ptype, "particle_ones"), + sampling_type="particle", function = particle_ones, - particle_type = True, units = "", display_name = r"Particle Count") @@ -204,10 +208,10 @@ data.deposit(pos, [ids], method = "mesh_id") return data.apply_units(ids, "") registry.add_field((ptype, "mesh_id"), + sampling_type="particle", function = particle_mesh_ids, validators = [ValidateSpatial()], - units = '', - particle_type = True) + units = '') return list(set(registry.keys()).difference(orig)) @@ -228,16 +232,14 @@ for axi, ax in enumerate("xyz"): v, p = _get_coord_funcs(axi, ptype) registry.add_field((ptype, "particle_velocity_%s" % ax), - particle_type = True, function = v, - units = "code_velocity") + sampling_type="particle", function = v, units = "code_velocity") registry.add_field((ptype, "particle_position_%s" % ax), - particle_type = True, function = p, - units = "code_length") + sampling_type="particle", function = p, units = "code_length") def particle_vector_functions(ptype, coord_names, vel_names, registry): unit_system = registry.ds.unit_system - + # This will column_stack a set of scalars to create vector fields. def _get_vec_func(_ptype, names): @@ -248,13 +250,13 @@ return data.apply_units(c, field.units) return particle_vectors registry.add_field((ptype, "particle_position"), + sampling_type="particle", function=_get_vec_func(ptype, coord_names), - units = "code_length", - particle_type=True) + units = "code_length") registry.add_field((ptype, "particle_velocity"), + sampling_type="particle", function=_get_vec_func(ptype, vel_names), - units = unit_system["velocity"], - particle_type=True) + units = unit_system["velocity"]) def get_angular_momentum_components(ptype, data, spos, svel): if data.has_field_parameter("normal"): @@ -282,8 +284,8 @@ + (data[ptype, svel % 'z'] - bulk_velocity[2])**2 ) registry.add_field((ptype, "particle_velocity_magnitude"), + sampling_type="particle", function=_particle_velocity_magnitude, - particle_type=True, take_log=False, units=unit_system["velocity"]) @@ -301,8 +303,8 @@ registry.add_field((ptype, "particle_specific_angular_momentum"), + sampling_type="particle", function=_particle_specific_angular_momentum, - particle_type=True, units=unit_system["specific_angular_momentum"], validators=[ValidateParameter("center")]) @@ -318,11 +320,11 @@ f, v = _get_spec_ang_mom_comp(axi, ax, ptype) registry.add_field( (ptype, "particle_specific_angular_momentum_%s" % ax), - particle_type = True, function=f, units=unit_system["specific_angular_momentum"], + sampling_type="particle", function=f, units=unit_system["specific_angular_momentum"], validators=[ValidateParameter("center")] ) registry.add_field((ptype, "particle_angular_momentum_%s" % ax), - function=v, units=unit_system["angular_momentum"], particle_type=True, + sampling_type="particle", function=v, units=unit_system["angular_momentum"], validators=[ValidateParameter('center')]) def _particle_angular_momentum(field, data): @@ -330,13 +332,13 @@ return am.T registry.add_field((ptype, "particle_angular_momentum"), + sampling_type="particle", function=_particle_angular_momentum, - particle_type=True, units=unit_system["angular_momentum"], validators=[ValidateParameter("center")]) create_magnitude_field(registry, "particle_angular_momentum", - unit_system["angular_momentum"], + unit_system["angular_momentum"], ftype=ptype, particle_type=True) def _particle_radius(field, data): @@ -345,13 +347,13 @@ Relative to the coordinate system defined by the *normal* vector, and *center* field parameters. """ - return get_radius(data, "particle_position_") + return get_radius(data, "particle_position_", field.name[0]) registry.add_field( (ptype, "particle_radius"), + sampling_type="particle", function=_particle_radius, units=unit_system["length"], - particle_type=True, validators=[ValidateParameter("center")]) def _particle_position_relative(field, data): @@ -370,8 +372,8 @@ registry.add_field( (ptype, "particle_position_relative"), + sampling_type="particle", function=_particle_position_relative, - particle_type=True, units=unit_system["length"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -391,8 +393,9 @@ return vel registry.add_field((ptype, "particle_velocity_relative"), + sampling_type="particle", function=_particle_velocity_relative, - particle_type=True, units=unit_system["velocity"], + units=unit_system["velocity"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -406,18 +409,17 @@ for axi, ax in enumerate("xyz"): v, p = _get_coord_funcs_relative(axi, ptype) registry.add_field((ptype, "particle_velocity_relative_%s" % ax), - particle_type = True, function = v, - units = "code_velocity") + sampling_type="particle", function = v, units = "code_velocity") registry.add_field((ptype, "particle_position_relative_%s" % ax), - particle_type = True, function = p, - units = "code_length") + sampling_type="particle", function = p, units = "code_length") # this is just particle radius but we add it with an alias for the sake of # consistent naming registry.add_field((ptype, "particle_position_spherical_radius"), + sampling_type="particle", function=_particle_radius, - particle_type=True, units=unit_system["length"], + units=unit_system["length"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -426,8 +428,9 @@ return data[ptype, 'particle_position_spherical_radius'] registry.add_field((ptype, "particle_spherical_position_radius"), + sampling_type="particle", function=_particle_spherical_position_radius, - particle_type=True, units=unit_system["length"], + units=unit_system["length"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -445,8 +448,8 @@ registry.add_field( (ptype, "particle_position_spherical_theta"), + sampling_type="particle", function=_particle_position_spherical_theta, - particle_type=True, units="", validators=[ValidateParameter("center"), ValidateParameter("normal")]) @@ -455,8 +458,9 @@ return data[ptype, 'particle_position_spherical_theta'] registry.add_field((ptype, "particle_spherical_position_theta"), + sampling_type="particle", function=_particle_spherical_position_theta, - particle_type=True, units="", + units="", validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -474,8 +478,8 @@ registry.add_field( (ptype, "particle_position_spherical_phi"), + sampling_type="particle", function=_particle_position_spherical_phi, - particle_type=True, units="", validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -484,8 +488,9 @@ return data[ptype, 'particle_position_spherical_phi'] registry.add_field((ptype, "particle_spherical_position_phi"), + sampling_type="particle", function=_particle_spherical_position_phi, - particle_type=True, units="", + units="", validators=[ValidateParameter("center"), ValidateParameter("normal")]) @@ -509,8 +514,9 @@ return sphr registry.add_field((ptype, "particle_velocity_spherical_radius"), + sampling_type="particle", function=_particle_velocity_spherical_radius, - particle_type=True, units=unit_system["velocity"], + units=unit_system["velocity"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -519,16 +525,18 @@ return data[ptype, 'particle_velocity_spherical_radius'] registry.add_field((ptype, "particle_spherical_velocity_radius"), + sampling_type="particle", function=_particle_spherical_velocity_radius, - particle_type=True, units=unit_system["velocity"], + units=unit_system["velocity"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) # particel_velocity_spherical_radius is simply aliased to # "particle_radial_velocity" for convenience registry.add_field((ptype, "particle_radial_velocity"), + sampling_type="particle", function=_particle_spherical_velocity_radius, - particle_type=True, units=unit_system["velocity"], + units=unit_system["velocity"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -553,8 +561,8 @@ registry.add_field( (ptype, "particle_velocity_spherical_theta"), + sampling_type="particle", function=_particle_velocity_spherical_theta, - particle_type=True, units=unit_system["velocity"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -563,8 +571,9 @@ return data[ptype, 'particle_velocity_spherical_theta'] registry.add_field((ptype, "particle_spherical_velocity_theta"), + sampling_type="particle", function=_particle_spherical_velocity_theta, - particle_type=True, units=unit_system["velocity"], + units=unit_system["velocity"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -587,8 +596,8 @@ registry.add_field( (ptype, "particle_velocity_spherical_phi"), + sampling_type="particle", function=_particle_velocity_spherical_phi, - particle_type=True, units=unit_system["velocity"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -597,8 +606,9 @@ return data[ptype, 'particle_spherical_velocity_theta'] registry.add_field((ptype, "particle_spherical_velocity_phi"), + sampling_type="particle", function=_particle_spherical_velocity_phi, - particle_type=True, units=unit_system["velocity"], + units=unit_system["velocity"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -617,9 +627,9 @@ registry.add_field( (ptype, "particle_position_cylindrical_radius"), + sampling_type="particle", function=_particle_position_cylindrical_radius, units=unit_system["length"], - particle_type=True, validators=[ValidateParameter("normal"), ValidateParameter("center")]) def _particle_position_cylindrical_theta(field,data): @@ -636,8 +646,8 @@ registry.add_field( (ptype, "particle_position_cylindrical_theta"), + sampling_type="particle", function=_particle_position_cylindrical_theta, - particle_type=True, units="", validators=[ValidateParameter("center"), ValidateParameter("normal")]) @@ -656,9 +666,9 @@ registry.add_field( (ptype, "particle_position_cylindrical_z"), + sampling_type="particle", function=_particle_position_cylindrical_z, units=unit_system["length"], - particle_type=True, validators=[ValidateParameter("normal"), ValidateParameter("center")]) def _particle_velocity_cylindrical_radius(field, data): @@ -680,8 +690,8 @@ registry.add_field( (ptype, "particle_velocity_cylindrical_radius"), + sampling_type="particle", function=_particle_velocity_cylindrical_radius, - particle_type=True, units=unit_system["velocity"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -704,8 +714,8 @@ registry.add_field( (ptype, "particle_velocity_cylindrical_theta"), + sampling_type="particle", function=_particle_velocity_cylindrical_theta, - particle_type=True, units=unit_system["velocity"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -714,8 +724,9 @@ return data[ptype, 'particle_velocity_cylindrical_theta'] registry.add_field((ptype, "particle_cylindrical_velocity_theta"), + sampling_type="particle", function=_particle_cylindrical_velocity_theta, - particle_type=True, units="cm/s", + units="cm/s", validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -737,8 +748,8 @@ registry.add_field( (ptype, "particle_velocity_cylindrical_z"), + sampling_type="particle", function=_particle_velocity_cylindrical_z, - particle_type=True, units=unit_system["velocity"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -747,8 +758,9 @@ return data[ptype, "particle_velocity_cylindrical_z"] registry.add_field((ptype, "particle_cylindrical_velocity_z"), + sampling_type="particle", function=_particle_cylindrical_velocity_z, - particle_type=True, units=unit_system["velocity"], + units=unit_system["velocity"], validators=[ValidateParameter("normal"), ValidateParameter("center")]) @@ -769,9 +781,8 @@ v[np.isnan(v)] = 0.0 return v fn = ("deposit", "%s_avg_%s" % (ptype, field_name)) - registry.add_field(fn, function=_pfunc_avg, + registry.add_field(fn, sampling_type="cell", function=_pfunc_avg, validators = [ValidateSpatial(0)], - particle_type = False, units = field_units) return fn @@ -816,7 +827,7 @@ rv /= hsml.uq**3 / hsml.uq.in_base(unit_system.name).uq**3 rv = data.apply_units(rv, field_units) return rv - registry.add_field(field_name, function = _vol_weight, + registry.add_field(field_name, sampling_type="cell", function = _vol_weight, validators = [ValidateSpatial(0)], units = field_units) registry.find_dependencies((field_name,)) @@ -833,9 +844,8 @@ nneighbors = nneighbors) # Now some quick unit conversions. return distances - registry.add_field(field_name, function = _nth_neighbor, + registry.add_field(field_name, sampling_type="particle", function = _nth_neighbor, validators = [ValidateSpatial(0)], - particle_type = True, units = "code_length") return [field_name] @@ -850,6 +860,6 @@ for dep_type in data.ds.particle_types_raw]) registry.add_field((ptype, field_name), + sampling_type="particle", function=_cat_field, - particle_type=True, units=units) diff -Nru yt-3.3.3/yt/fields/species_fields.py yt-3.4.0/yt/fields/species_fields.py --- yt-3.3.3/yt/fields/species_fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/species_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -75,17 +75,17 @@ """ unit_system = registry.ds.unit_system - registry.add_field((ftype, "%s_fraction" % species), + registry.add_field((ftype, "%s_fraction" % species), sampling_type="cell", function = _create_fraction_func(ftype, species), particle_type = particle_type, units = "") - registry.add_field((ftype, "%s_mass" % species), + registry.add_field((ftype, "%s_mass" % species), sampling_type="cell", function = _create_mass_func(ftype, species), particle_type = particle_type, units = unit_system["mass"]) - registry.add_field((ftype, "%s_number_density" % species), + registry.add_field((ftype, "%s_number_density" % species), sampling_type="cell", function = _create_number_density_func(ftype, species), particle_type = particle_type, units = unit_system["number_density"]) @@ -103,17 +103,17 @@ """ unit_system = registry.ds.unit_system - registry.add_field((ftype, "%s_density" % species), + registry.add_field((ftype, "%s_density" % species), sampling_type="cell", function = _create_density_func(ftype, species), particle_type = particle_type, units = unit_system["density"]) - registry.add_field((ftype, "%s_mass" % species), + registry.add_field((ftype, "%s_mass" % species), sampling_type="cell", function = _create_mass_func(ftype, species), particle_type = particle_type, units = unit_system["mass"]) - registry.add_field((ftype, "%s_number_density" % species), + registry.add_field((ftype, "%s_number_density" % species), sampling_type="cell", function = _create_number_density_func(ftype, species), particle_type = particle_type, units = unit_system["number_density"]) @@ -126,8 +126,8 @@ """ This takes a field registry, a fluid type, and two species names. The first species name is one you wish to alias to an existing species - name. For instance you might alias all "H_p0" fields to "H_" fields - to indicate that "H_" fields are really just neutral hydrogen fields. + name. For instance you might alias all "H_p0" fields to "H\_" fields + to indicate that "H\_" fields are really just neutral hydrogen fields. This function registers field aliases for the density, number_density, mass, and fraction fields between the two species given in the arguments. """ @@ -146,6 +146,7 @@ elements = _get_all_elements(registry.species_names) for element in elements: registry.add_field((ftype, "%s_nuclei_density" % element), + sampling_type="cell", function = _nuclei_density, particle_type = particle_type, units = unit_system["number_density"]) @@ -154,6 +155,7 @@ if element in elements: continue registry.add_field((ftype, "%s_nuclei_density" % element), + sampling_type="cell", function = _default_nuclei_density, particle_type = particle_type, units = unit_system["number_density"]) diff -Nru yt-3.3.3/yt/fields/tests/test_field_name_container.py yt-3.4.0/yt/fields/tests/test_field_name_container.py --- yt-3.3.3/yt/fields/tests/test_field_name_container.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/tests/test_field_name_container.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,13 +1,28 @@ -from yt.utilities.answer_testing.framework import \ - requires_ds, \ - data_dir_load +from yt import \ + load +from yt.testing import \ + requires_file + +def do_field_type(ft): + for field_name in dir(ft): + f = getattr(ft, field_name) + assert ((ft.field_type, field_name) == f.name) + for field in ft: + f = getattr(ft, field.name[1]) + assert (f == field) + assert (f in ft) + assert (f.name in ft) + assert (f.name[1] in ft) + enzotiny = "enzo_tiny_cosmology/DD0046/DD0046" -@requires_ds(enzotiny) -def test_simulated_halo_mass_function(): - ds = data_dir_load(enzotiny) +@requires_file(enzotiny) +def test_field_name_container(): + ds = load(enzotiny) for field_type in dir(ds.fields): + assert (field_type in ds.fields) ft = getattr(ds.fields, field_type) - for field_name in dir(ft): - f = getattr(ft, field_name) - assert ((field_type, field_name) == f.name) + do_field_type(ft) + for field_type in ds.fields: + assert (field_type in ds.fields) + do_field_type(field_type) diff -Nru yt-3.3.3/yt/fields/tests/test_fields_plugins.py yt-3.4.0/yt/fields/tests/test_fields_plugins.py --- yt-3.3.3/yt/fields/tests/test_fields_plugins.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/fields/tests/test_fields_plugins.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,69 @@ +# -*- coding: UTF-8 -*- +#----------------------------------------------------------------------------- +# Copyright (c) 2016, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import os +import sys +import unittest +import yt +from yt.config import ytcfg, CONFIG_DIR +from yt.testing import fake_random_ds + +TEST_PLUGIN_FILE = '''def _myfunc(field, data): + return np.random.random(data['density'].shape) +add_field('random', dimensions='dimensionless', + function=_myfunc, units='auto')''' + + +def setUpModule(): + my_plugin_name = ytcfg.get('yt', 'pluginfilename') + # In the following order if pluginfilename is: an absolute path, located in + # the CONFIG_DIR, located in an obsolete config dir. + old_config_dir = os.path.join(os.path.expanduser('~'), '.yt') + for base_prefix in ('', CONFIG_DIR, old_config_dir): + potential_plugin_file = os.path.join(base_prefix, my_plugin_name) + if os.path.isfile(potential_plugin_file): + os.rename(potential_plugin_file, + potential_plugin_file + '.bak_test') + + plugin_file = os.path.join(CONFIG_DIR, my_plugin_name) + with open(plugin_file, 'w') as fh: + fh.write(TEST_PLUGIN_FILE) + + +def tearDownModule(): + my_plugin_name = ytcfg.get('yt', 'pluginfilename') + plugin_file = os.path.join(CONFIG_DIR, my_plugin_name) + os.remove(plugin_file) + + old_config_dir = os.path.join(os.path.expanduser('~'), '.yt') + for base_prefix in ('', CONFIG_DIR, old_config_dir): + potential_plugin_file = os.path.join(base_prefix, my_plugin_name) + if os.path.isfile(potential_plugin_file + '.bak_test'): + os.rename(potential_plugin_file + '.bak_test', + potential_plugin_file) + + +class TestPluginFile(unittest.TestCase): + + def testCustomField(self): + plugin_file = os.path.join( + CONFIG_DIR, ytcfg.get('yt', 'pluginfilename')) + msg = 'INFO:yt:Loading plugins from %s' % plugin_file + + if sys.version_info >= (3, 4, 0): + with self.assertLogs('yt', level='INFO') as cm: + yt.enable_plugins() + self.assertEqual(cm.output, [msg]) + else: + yt.enable_plugins() + + ds = fake_random_ds(16) + dd = ds.all_data() + self.assertEqual(str(dd['random'].units), 'dimensionless') + self.assertEqual(dd['random'].shape, dd['density'].shape) diff -Nru yt-3.3.3/yt/fields/tests/test_fields.py yt-3.4.0/yt/fields/tests/test_fields.py --- yt-3.3.3/yt/fields/tests/test_fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/tests/test_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -11,6 +11,7 @@ assert_array_almost_equal_nulp, \ assert_array_equal, \ assert_raises, \ + assert_allclose_units, \ requires_file from yt.utilities.cosmology import \ Cosmology @@ -24,27 +25,6 @@ YTFieldUnitParseError, \ YTDimensionalityError -base_ds = None - - -def setup(): - global base_ds - # Make this super teeny tiny - fields, units = [], [] - - for fname, (code_units, aliases, dn) in StreamFieldInfo.known_other_fields: - fields.append(("gas", fname)) - units.append(code_units) - - base_ds = fake_random_ds(4, fields=fields, units=units, particles=20) - - base_ds.index - base_ds.cosmological_simulation = 1 - base_ds.cosmology = Cosmology() - from yt.config import ytcfg - ytcfg["yt","__withintesting"] = "True" - np.seterr(all = 'ignore') - def get_params(ds): return dict( axis = 0, @@ -52,6 +32,8 @@ registry = ds.unit_registry), bulk_velocity = YTArray((0.0, 0.0, 0.0), "cm/s", registry = ds.unit_registry), + bulk_magnetic_field = YTArray((0.0, 0.0, 0.0), + "G", registry = ds.unit_registry), normal = YTArray((0.0, 0.0, 1.0), "", registry = ds.unit_registry), cp_x_vec = YTArray((1.0, 0.0, 0.0), @@ -71,35 +53,6 @@ ("gas", "velocity_y"), ("gas", "velocity_z")) -def realistic_ds(fields, particle_fields, nprocs): - np.random.seed(int(0x4d3d3d3)) - global base_ds - units = [base_ds._get_field_info(*f).units for f in fields] - punits = [base_ds._get_field_info('io', f).units for f in particle_fields] - fields = [_strip_ftype(f) for f in fields] - - ds = fake_random_ds(16, fields=fields, units=units, nprocs=nprocs, - particle_fields=particle_fields, - particle_field_units=punits, - particles=base_ds.stream_handler.particle_count[0][0]) - - ds.parameters["HydroMethod"] = "streaming" - ds.parameters["EOSType"] = 1.0 - ds.parameters["EOSSoundSpeed"] = 1.0 - ds.conversion_factors["Time"] = 1.0 - ds.conversion_factors.update( dict((f, 1.0) for f in fields) ) - ds.gamma = 5.0/3.0 - ds.current_redshift = 0.0001 - ds.cosmological_simulation = 1 - ds.hubble_constant = 0.7 - ds.omega_matter = 0.27 - ds.omega_lambda = 0.73 - ds.cosmology = Cosmology(hubble_constant=ds.hubble_constant, - omega_matter=ds.omega_matter, - omega_lambda=ds.omega_lambda, - unit_registry=ds.unit_registry) - return ds - def _strip_ftype(field): if not isinstance(field, tuple): return field @@ -111,41 +64,24 @@ class TestFieldAccess(object): description = None - def __init__(self, field_name, nproc): + def __init__(self, field_name, ds, nprocs): # Note this should be a field name self.field_name = field_name - self.description = "Accessing_%s_%s" % (field_name, nproc) - self.nproc = nproc + self.description = "Accessing_%s_%s" % (field_name, nprocs) + self.nprocs = nprocs + self.ds = ds def __call__(self): - global base_ds - field = base_ds._get_field_info(*self.field_name) - deps = field.get_dependencies(ds = base_ds) - requested = deps.requested - particle_fields = \ - ['particle_position_x', 'particle_position_y', 'particle_position_z', - 'particle_velocity_x', 'particle_velocity_y', 'particle_velocity_z', - 'particle_mass'] - fields = list(_base_fields) - - for rf in requested: - if rf[0] == 'io' or rf[0] == 'all': - if rf not in particle_fields or rf[1] not in particle_fields: - particle_fields.append(rf[1]) - else: - fields.append(rf) - + field = self.ds._get_field_info(*self.field_name) skip_grids = False needs_spatial = False for v in field.validators: - f = getattr(v, "fields", None) - if f: fields += f if getattr(v, "ghost_zones", 0) > 0: skip_grids = True if hasattr(v, "ghost_zones"): needs_spatial = True - ds = realistic_ds(fields, particle_fields, self.nproc) + ds = self.ds # This gives unequal sized grids as well as subgrids dd1 = ds.all_data() @@ -153,53 +89,89 @@ sp = get_params(ds) dd1.field_parameters.update(sp) dd2.field_parameters.update(sp) - v1 = dd1[self.field_name] - # No more conversion checking - assert_equal(v1, dd1[self.field_name]) - if not needs_spatial: - with field.unit_registry(dd2): - res = field._function(field, dd2) - res = dd2.apply_units(res, field.units) - assert_array_almost_equal_nulp(v1, res, 4) - if not skip_grids: - for g in ds.index.grids: - g.field_parameters.update(sp) - v1 = g[self.field_name] - g.clear_data() - g.field_parameters.update(sp) - r1 = field._function(field, g) - if field.particle_type: - assert_equal(v1.shape[0], g.NumberOfParticles) - else: - assert_array_equal(r1.shape, v1.shape) - for ax in 'xyz': - assert_array_equal(g[ax].shape, v1.shape) - with field.unit_registry(g): - res = field._function(field, g) - assert_array_equal(v1.shape, res.shape) - res = g.apply_units(res, field.units) + with np.errstate(all='ignore'): + v1 = dd1[self.field_name] + # No more conversion checking + assert_equal(v1, dd1[self.field_name]) + if not needs_spatial: + with field.unit_registry(dd2): + res = field._function(field, dd2) + res = dd2.apply_units(res, field.units) assert_array_almost_equal_nulp(v1, res, 4) + if not skip_grids: + for g in ds.index.grids: + g.field_parameters.update(sp) + v1 = g[self.field_name] + g.clear_data() + g.field_parameters.update(sp) + r1 = field._function(field, g) + if field.particle_type: + assert_equal(v1.shape[0], g.NumberOfParticles) + else: + assert_array_equal(r1.shape, v1.shape) + for ax in 'xyz': + assert_array_equal(g[ax].shape, v1.shape) + with field.unit_registry(g): + res = field._function(field, g) + assert_array_equal(v1.shape, res.shape) + res = g.apply_units(res, field.units) + assert_array_almost_equal_nulp(v1, res, 4) +def get_base_ds(nprocs): + fields, units = [], [] + + for fname, (code_units, aliases, dn) in StreamFieldInfo.known_other_fields: + fields.append(("gas", fname)) + units.append(code_units) + + ds = fake_random_ds( + 4, fields=fields, units=units, particles=20, nprocs=nprocs) + ds.parameters["HydroMethod"] = "streaming" + ds.parameters["EOSType"] = 1.0 + ds.parameters["EOSSoundSpeed"] = 1.0 + ds.conversion_factors["Time"] = 1.0 + ds.conversion_factors.update( dict((f, 1.0) for f in fields) ) + ds.gamma = 5.0/3.0 + ds.current_redshift = 0.0001 + ds.cosmological_simulation = 1 + ds.hubble_constant = 0.7 + ds.omega_matter = 0.27 + ds.omega_lambda = 0.73 + ds.cosmology = Cosmology(hubble_constant=ds.hubble_constant, + omega_matter=ds.omega_matter, + omega_lambda=ds.omega_lambda, + unit_registry=ds.unit_registry) + # ensures field errors are raised during testing + # see FieldInfoContainer.check_derived_fields + ds._field_test_dataset = True + ds.index + return ds + def test_all_fields(): - global base_ds - for field in sorted(base_ds.field_info): + datasets = {} + + for nprocs in [1, 4, 8]: + ds = get_base_ds(nprocs) + datasets[nprocs] = ds + + for field in sorted(ds.field_info): if field[1].find("beta_p") > -1: continue if field[1].find("vertex") > -1: # don't test the vertex fields for now continue - if field in base_ds.field_list: + if field in ds.field_list: # Don't know how to test this. We need some way of having fields # that are fallbacks be tested, but we don't have that now. continue - for nproc in [1, 4, 8]: - test_all_fields.__name__ = "%s_%s" % (field, nproc) - yield TestFieldAccess(field, nproc) + for nprocs in [1, 4, 8]: + test_all_fields.__name__ = "%s_%s" % (field, nprocs) + yield TestFieldAccess(field, datasets[nprocs], nprocs) def test_add_deposited_particle_field(): # NOT tested: "std", "mesh_id", "nearest" and "simple_smooth" - global base_ds + base_ds = get_base_ds(1) ad = base_ds.all_data() # Test "count", "sum" and "cic" method @@ -231,9 +203,9 @@ assert_almost_equal(ret.sum(), 638.5652315154682) def test_add_gradient_fields(): - global base_ds - gfields = base_ds.add_gradient_fields(("gas","density")) - gfields += base_ds.add_gradient_fields(("index", "ones")) + ds = get_base_ds(1) + gfields = ds.add_gradient_fields(("gas","density")) + gfields += ds.add_gradient_fields(("index", "ones")) field_list = [('gas', 'density_gradient_x'), ('gas', 'density_gradient_y'), ('gas', 'density_gradient_z'), @@ -243,7 +215,7 @@ ('index', 'ones_gradient_z'), ('index', 'ones_gradient_magnitude')] assert_equal(gfields, field_list) - ad = base_ds.all_data() + ad = ds.all_data() for field in field_list: ret = ad[field] if field[0] == 'gas': @@ -267,15 +239,23 @@ def unitless_data(field, data): return np.ones(data['density'].shape) - ds.add_field(('gas','density_alias_no_units'), function=density_alias) - ds.add_field(('gas','density_alias_auto'), function=density_alias, - units='auto', dimensions='density') - ds.add_field(('gas','density_alias_wrong_units'), function=density_alias, + ds.add_field(('gas','density_alias_no_units'), sampling_type='cell', + function=density_alias) + ds.add_field(('gas','density_alias_auto'), sampling_type='cell', + function=density_alias, units='auto', dimensions='density') + ds.add_field(('gas','density_alias_wrong_units'), + function=density_alias, + sampling_type='cell', units='m/s') - ds.add_field(('gas','density_alias_unparseable_units'), function=density_alias, + ds.add_field(('gas','density_alias_unparseable_units'), + sampling_type='cell', + function=density_alias, units='dragons') - ds.add_field(('gas','density_alias_auto_wrong_dims'), function=density_alias, - units='auto', dimensions="temperature") + ds.add_field(('gas','density_alias_auto_wrong_dims'), + function=density_alias, + sampling_type='cell', + units='auto', + dimensions="temperature") assert_raises(YTFieldUnitError, get_data, ds, 'density_alias_no_units') assert_raises(YTFieldUnitError, get_data, ds, 'density_alias_wrong_units') assert_raises(YTFieldUnitParseError, get_data, ds, @@ -285,11 +265,22 @@ dens = ad['density_alias_auto'] assert_equal(str(dens.units), 'g/cm**3') - ds.add_field(('gas','dimensionless'), function=unitless_data) - ds.add_field(('gas','dimensionless_auto'), function=unitless_data, - units='auto', dimensions='dimensionless') - ds.add_field(('gas','dimensionless_explicit'), function=unitless_data, units='') - ds.add_field(('gas','dimensionful'), function=unitless_data, units='g/cm**3') + ds.add_field(('gas','dimensionless'), + sampling_type='cell', + function=unitless_data) + ds.add_field(('gas','dimensionless_auto'), + function=unitless_data, + sampling_type='cell', + units='auto', + dimensions='dimensionless') + ds.add_field(('gas','dimensionless_explicit'), + function=unitless_data, + sampling_type='cell', + units='') + ds.add_field(('gas','dimensionful'), + sampling_type='cell', + function=unitless_data, + units='g/cm**3') assert_equal(str(ad['dimensionless'].units), 'dimensionless') assert_equal(str(ad['dimensionless_auto'].units), 'dimensionless') @@ -310,7 +301,8 @@ def density_alias(field, data): return data['density'] - ds.add_field('density_alias', function=density_alias, units='g/cm**3') + ds.add_field('density_alias', sampling_type='cell', + function=density_alias, units='g/cm**3') ad['density_alias'] assert ds.derived_field_list[0] == 'density_alias' @@ -321,7 +313,8 @@ def density_alias(field, data): return data['density'] - ds.add_field('density_alias', function=density_alias, units='g/cm**3') + ds.add_field('density_alias', sampling_type='cell', + function=density_alias, units='g/cm**3') ds.field_info['density_alias'] ds.field_info['gas', 'density_alias'] @@ -331,8 +324,9 @@ def pmass_alias(field, data): return data['particle_mass'] - ds.add_field('particle_mass_alias', function=pmass_alias, - units='g', particle_type=True) + ds.add_field('particle_mass_alias', function=pmass_alias, + sampling_type='particle', + units='g') ds.field_info['particle_mass_alias'] ds.field_info['all', 'particle_mass_alias'] @@ -347,11 +341,20 @@ a2 = np.argsort(mi2) assert_array_equal(a1, a2) -if __name__ == "__main__": - setup() - for t in test_all_fields(): - t() - test_add_deposited_particle_field() - test_add_field_unit_semantics() - test_array_like_field() - test_add_field_string() + +def test_field_inference(): + ds = fake_random_ds(16) + ds.index + # If this is not true this means the result of field inference depends + # on the order we did field detection, which is random in Python3 + assert_equal(ds._last_freq, (None, None)) + +ISOGAL = 'IsolatedGalaxy/galaxy0030/galaxy0030' + +@requires_file(ISOGAL) +def test_deposit_amr(): + ds = load(ISOGAL) + for i, g in enumerate(ds.index.grids): + gpm = g['particle_mass'].sum() + dpm = g['deposit', 'all_mass'].sum() + assert_allclose_units(gpm, dpm) diff -Nru yt-3.3.3/yt/fields/tests/test_magnetic_fields.py yt-3.4.0/yt/fields/tests/test_magnetic_fields.py --- yt-3.3.3/yt/fields/tests/test_magnetic_fields.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/fields/tests/test_magnetic_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -43,10 +43,10 @@ dd2["magnetic_field_z"]**2)/(2.0*mu_0) emag2.convert_to_units("Pa") - yield assert_almost_equal, emag1, dd1["magnetic_energy"] - yield assert_almost_equal, emag2, dd2["magnetic_energy"] + assert_almost_equal(emag1, dd1["magnetic_energy"]) + assert_almost_equal(emag2, dd2["magnetic_energy"]) assert str(emag1.units) == str(dd1["magnetic_energy"].units) assert str(emag2.units) == str(dd2["magnetic_energy"].units) - yield assert_almost_equal, emag1.in_cgs(), emag2.in_cgs() + assert_almost_equal(emag1.in_cgs(), emag2.in_cgs()) diff -Nru yt-3.3.3/yt/fields/tests/test_xray_fields.py yt-3.4.0/yt/fields/tests/test_xray_fields.py --- yt-3.3.3/yt/fields/tests/test_xray_fields.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/fields/tests/test_xray_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,40 @@ +from yt.fields.xray_emission_fields import \ + add_xray_emissivity_field +from yt.utilities.answer_testing.framework import \ + requires_ds, can_run_ds, data_dir_load, \ + ProjectionValuesTest, FieldValuesTest + +def setup(): + from yt.config import ytcfg + ytcfg["yt","__withintesting"] = "True" + +def check_xray_fields(ds_fn, fields): + if not can_run_ds(ds_fn): return + dso = [ None, ("sphere", ("m", (0.1, 'unitary')))] + for field in fields: + for axis in [0, 1, 2]: + for dobj_name in dso: + yield ProjectionValuesTest(ds_fn, axis, field, + None, dobj_name) + yield FieldValuesTest(ds_fn, field, dobj_name) + +sloshing = "GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0300" +@requires_ds(sloshing, big_data=True) +def test_sloshing_apec(): + ds = data_dir_load(sloshing) + fields = add_xray_emissivity_field(ds, 0.5, 7.0, table_type="apec", + metallicity=0.3) + for test in check_xray_fields(ds, fields): + test_sloshing_apec.__name__ = test.description + yield test + +d9p = "D9p_500/10MpcBox_HartGal_csf_a0.500.d" +@requires_ds(d9p, big_data=True) +def test_d9p_cloudy(): + ds = data_dir_load(d9p) + fields = add_xray_emissivity_field(ds, 0.5, 2.0, redshift=ds.current_redshift, + table_type="cloudy", cosmology=ds.cosmology, + metallicity=("gas", "metallicity")) + for test in check_xray_fields(ds, fields): + test_d9p_cloudy.__name__ = test.description + yield test diff -Nru yt-3.3.3/yt/fields/vector_operations.py yt-3.4.0/yt/fields/vector_operations.py --- yt-3.3.3/yt/fields/vector_operations.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/fields/vector_operations.py 2017-08-10 18:02:57.000000000 +0000 @@ -44,7 +44,7 @@ mag += data[fn] * data[fn] return np.sqrt(mag) - registry.add_field((ftype, "%s_magnitude" % basename), + registry.add_field((ftype, "%s_magnitude" % basename), sampling_type="cell", function=_magnitude, units=field_units, validators=validators, particle_type=particle_type) @@ -62,7 +62,7 @@ squared += data[fn] * data[fn] return squared - registry.add_field((ftype, "%s_squared" % basename), + registry.add_field((ftype, "%s_squared" % basename), sampling_type="cell", function=_squared, units=field_units, validators=validators, particle_type=particle_type) @@ -110,7 +110,7 @@ rv[np.isnan(theta)] = 0.0 return rv - registry.add_field((ftype, "%s_spherical_radius" % basename), + registry.add_field((ftype, "%s_spherical_radius" % basename), sampling_type="cell", function=_spherical_radius_component, units=field_units, validators=[ValidateParameter("normal"), @@ -127,17 +127,17 @@ return np.sqrt(data[ftype, "%s_magnitude" % basename]**2.0 - data[ftype, "%s_spherical_radius" % basename]**2.0) - registry.add_field((ftype, "radial_%s" % basename), + registry.add_field((ftype, "radial_%s" % basename), sampling_type="cell", function=_radial, units=field_units, validators=[ValidateParameter("normal"), ValidateParameter("center")]) - registry.add_field((ftype, "radial_%s_absolute" % basename), + registry.add_field((ftype, "radial_%s_absolute" % basename), sampling_type="cell", function=_radial_absolute, units=field_units) - registry.add_field((ftype, "tangential_%s" % basename), + registry.add_field((ftype, "tangential_%s" % basename), sampling_type="cell", function=_tangential, units=field_units) @@ -154,7 +154,7 @@ phi = resize_vector(data["index", "spherical_phi"], vectors) return get_sph_theta_component(vectors, theta, phi, normal) - registry.add_field((ftype, "%s_spherical_theta" % basename), + registry.add_field((ftype, "%s_spherical_theta" % basename), sampling_type="cell", function=_spherical_theta_component, units=field_units, validators=[ValidateParameter("normal"), @@ -173,7 +173,7 @@ phi = resize_vector(data["index", "spherical_phi"], vectors) return get_sph_phi_component(vectors, phi, normal) - registry.add_field((ftype, "%s_spherical_phi" % basename), + registry.add_field((ftype, "%s_spherical_phi" % basename), sampling_type="cell", function=_spherical_phi_component, units=field_units, validators=[ValidateParameter("normal"), @@ -192,13 +192,13 @@ return tr return _cp_val - registry.add_field((ftype, "cutting_plane_%s_x" % basename), + registry.add_field((ftype, "cutting_plane_%s_x" % basename), sampling_type="cell", function=_cp_vectors('x'), units=field_units) - registry.add_field((ftype, "cutting_plane_%s_y" % basename), + registry.add_field((ftype, "cutting_plane_%s_y" % basename), sampling_type="cell", function=_cp_vectors('y'), units=field_units) - registry.add_field((ftype, "cutting_plane_%s_z" % basename), + registry.add_field((ftype, "cutting_plane_%s_z" % basename), sampling_type="cell", function=_cp_vectors('z'), units=field_units) @@ -223,12 +223,12 @@ field_units = Unit(field_units, registry=registry.ds.unit_registry) div_units = field_units / registry.ds.unit_system["length"] - registry.add_field((ftype, "%s_divergence" % basename), + registry.add_field((ftype, "%s_divergence" % basename), sampling_type="cell", function=_divergence, units=div_units, validators=[ValidateSpatial(1)]) - registry.add_field((ftype, "%s_divergence_absolute" % basename), + registry.add_field((ftype, "%s_divergence_absolute" % basename), sampling_type="cell", function=_divergence_abs, units=div_units) @@ -236,7 +236,7 @@ tr = data[ftype, "tangential_%s" % basename] / \ data[ftype, "%s_magnitude" % basename] return np.abs(tr) - registry.add_field((ftype, "tangential_over_%s_magnitude" % basename), + registry.add_field((ftype, "tangential_over_%s_magnitude" % basename), sampling_type="cell", function=_tangential_over_magnitude, take_log=False) @@ -252,7 +252,7 @@ theta = resize_vector(data["index", 'cylindrical_theta'], vectors) return get_cyl_r_component(vectors, theta, normal) - registry.add_field((ftype, "%s_cylindrical_radius" % basename), + registry.add_field((ftype, "%s_cylindrical_radius" % basename), sampling_type="cell", function=_cylindrical_radius_component, units=field_units, validators=[ValidateParameter("normal")]) @@ -261,7 +261,7 @@ """This field is deprecated and will be removed in a future version""" return data[ftype, '%s_cylindrical_radius' % basename] - registry.add_field((ftype, "cylindrical_radial_%s" % basename), + registry.add_field((ftype, "cylindrical_radial_%s" % basename), sampling_type="cell", function=_cylindrical_radial, units=field_units) @@ -269,7 +269,7 @@ """This field is deprecated and will be removed in a future version""" return np.abs(data[ftype, '%s_cylindrical_radius' % basename]) - registry.add_field((ftype, "cylindrical_radial_%s_absolute" % basename), + registry.add_field((ftype, "cylindrical_radial_%s_absolute" % basename), sampling_type="cell", function=_cylindrical_radial_absolute, units=field_units, validators=[ValidateParameter("normal")]) @@ -287,7 +287,7 @@ theta = np.tile(theta, (3,) + (1,)*len(theta.shape)) return get_cyl_theta_component(vectors, theta, normal) - registry.add_field((ftype, "%s_cylindrical_theta" % basename), + registry.add_field((ftype, "%s_cylindrical_theta" % basename), sampling_type="cell", function=_cylindrical_theta_component, units=field_units, validators=[ValidateParameter("normal"), @@ -302,11 +302,11 @@ """This field is deprecated and will be removed in a future release""" return np.abs(data['cylindrical_tangential_%s' % basename]) - registry.add_field((ftype, "cylindrical_tangential_%s" % basename), + registry.add_field((ftype, "cylindrical_tangential_%s" % basename), sampling_type="cell", function=_cylindrical_tangential, units=field_units) - registry.add_field((ftype, "cylindrical_tangential_%s_absolute" % basename), + registry.add_field((ftype, "cylindrical_tangential_%s_absolute" % basename), sampling_type="cell", function=_cylindrical_tangential_absolute, units=field_units) @@ -320,7 +320,7 @@ vectors = obtain_rv_vec(data, (xn, yn, zn), "bulk_%s" % basename) return get_cyl_z_component(vectors, normal) - registry.add_field((ftype, "%s_cylindrical_z" % basename), + registry.add_field((ftype, "%s_cylindrical_z" % basename), sampling_type="cell", function=_cylindrical_z_component, units=field_units, validators=[ValidateParameter("normal"), @@ -356,7 +356,7 @@ new_field2[1:-1, 1:-1, 1:-1] = new_field / weight_field return new_field2 - registry.add_field((ftype, "averaged_%s" % basename), + registry.add_field((ftype, "averaged_%s" % basename), sampling_type="cell", function=_averaged_field, units=field_units, validators=validators) diff -Nru yt-3.3.3/yt/fields/xray_emission_fields.py yt-3.4.0/yt/fields/xray_emission_fields.py --- yt-3.3.3/yt/fields/xray_emission_fields.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/fields/xray_emission_fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,308 @@ +""" +Integrator classes to deal with interpolation and integration of input spectral +bins. Currently only supports Cloudy and APEC-style data. + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from yt.utilities.on_demand_imports import _h5py as h5py +import numpy as np +import os + +from yt.config import ytcfg +from yt.fields.derived_field import DerivedField +from yt.funcs import \ + mylog, \ + only_on_root, \ + issue_deprecation_warning, \ + parse_h5_attr +from yt.utilities.exceptions import YTFieldNotFound +from yt.utilities.exceptions import YTException +from yt.utilities.linear_interpolators import \ + UnilinearFieldInterpolator, BilinearFieldInterpolator +from yt.units.yt_array import YTArray, YTQuantity +from yt.utilities.cosmology import Cosmology + +data_version = {"cloudy": 2, + "apec": 2} + +data_url = "http://yt-project.org/data" + +def _get_data_file(table_type, data_dir=None): + data_file = "%s_emissivity_v%d.h5" % (table_type, data_version[table_type]) + if data_dir is None: + supp_data_dir = ytcfg.get("yt", "supp_data_dir") + data_dir = supp_data_dir if os.path.exists(supp_data_dir) else "." + data_path = os.path.join(data_dir, data_file) + if not os.path.exists(data_path): + msg = "Failed to find emissivity data file %s! " % data_file + \ + "Please download from http://yt-project.org/data!" + mylog.error(msg) + raise IOError(msg) + return data_path + +class EnergyBoundsException(YTException): + def __init__(self, lower, upper): + self.lower = lower + self.upper = upper + + def __str__(self): + return "Energy bounds are %e to %e keV." % \ + (self.lower, self.upper) + +class ObsoleteDataException(YTException): + def __init__(self, table_type): + data_file = "%s_emissivity_v%d.h5" % (table_type, data_version[table_type]) + self.msg = "X-ray emissivity data is out of date.\n" + self.msg += "Download the latest data from %s/%s." % (data_url, data_file) + + def __str__(self): + return self.msg + +class XrayEmissivityIntegrator(object): + r"""Class for making X-ray emissivity fields. Uses hdf5 data tables + generated from Cloudy and AtomDB/APEC. + + Initialize an XrayEmissivityIntegrator object. + + Parameters + ---------- + table_type : string + The type of data to use when computing the emissivity values. If "cloudy", + a file called "cloudy_emissivity.h5" is used, for photoionized + plasmas. If, "apec", a file called "apec_emissivity.h5" is used for + collisionally ionized plasmas. These files contain emissivity tables + for primordial elements and for metals at solar metallicity for the + energy range 0.1 to 100 keV. + redshift : float, optional + The cosmological redshift of the source of the field. Default: 0.0. + data_dir : string, optional + The location to look for the data table in. If not supplied, the file + will be looked for in the location of the YT_DEST environment variable + or in the current working directory. + use_metals : boolean, optional + If set to True, the emissivity will include contributions from metals. + Default: True + """ + def __init__(self, table_type, redshift=0.0, data_dir=None, use_metals=True): + + filename = _get_data_file(table_type, data_dir=data_dir) + only_on_root(mylog.info, "Loading emissivity data from %s." % filename) + in_file = h5py.File(filename, "r") + if "info" in in_file.attrs: + only_on_root(mylog.info, parse_h5_attr(in_file, "info")) + if parse_h5_attr(in_file, "version") != data_version[table_type]: + raise ObsoleteDataException(table_type) + else: + only_on_root(mylog.info, "X-ray '%s' emissivity data version: %s." % \ + (table_type, parse_h5_attr(in_file, "version"))) + + self.log_T = in_file["log_T"][:] + self.emissivity_primordial = in_file["emissivity_primordial"][:] + if "log_nH" in in_file: + self.log_nH = in_file["log_nH"][:] + if use_metals: + self.emissivity_metals = in_file["emissivity_metals"][:] + self.ebin = YTArray(in_file["E"], "keV") + in_file.close() + self.dE = np.diff(self.ebin) + self.emid = 0.5*(self.ebin[1:]+self.ebin[:-1]).to("erg") + self.redshift = redshift + + def get_interpolator(self, data_type, e_min, e_max, energy=True): + data = getattr(self, "emissivity_%s" % data_type) + if not energy: + data = data[..., :] / self.emid.v + e_min = YTQuantity(e_min, "keV")*(1.0+self.redshift) + e_max = YTQuantity(e_max, "keV")*(1.0+self.redshift) + if (e_min - self.ebin[0]) / e_min < -1e-3 or \ + (e_max - self.ebin[-1]) / e_max > 1e-3: + raise EnergyBoundsException(self.ebin[0], self.ebin[-1]) + e_is, e_ie = np.digitize([e_min, e_max], self.ebin) + e_is = np.clip(e_is - 1, 0, self.ebin.size - 1) + e_ie = np.clip(e_ie, 0, self.ebin.size - 1) + + my_dE = self.dE[e_is: e_ie].copy() + # clip edge bins if the requested range is smaller + my_dE[0] -= e_min - self.ebin[e_is] + my_dE[-1] -= self.ebin[e_ie] - e_max + + interp_data = (data[..., e_is:e_ie]*my_dE).sum(axis=-1) + if data.ndim == 2: + emiss = UnilinearFieldInterpolator(np.log10(interp_data), + [self.log_T[0], self.log_T[-1]], + "log_T", truncate=True) + else: + emiss = BilinearFieldInterpolator(np.log10(interp_data), + [self.log_nH[0], self.log_nH[-1], + self.log_T[0], self.log_T[-1]], + ["log_nH", "log_T"], truncate=True) + + return emiss + +def add_xray_emissivity_field(ds, e_min, e_max, redshift=0.0, + metallicity=("gas", "metallicity"), + table_type="cloudy", data_dir=None, + cosmology=None, **kwargs): + r"""Create X-ray emissivity fields for a given energy range. + + Parameters + ---------- + e_min : float + The minimum energy in keV for the energy band. + e_min : float + The maximum energy in keV for the energy band. + redshift : float, optional + The cosmological redshift of the source of the field. Default: 0.0. + metallicity : str or tuple of str or float, optional + Either the name of a metallicity field or a single floating-point + number specifying a spatially constant metallicity. Must be in + solar units. If set to None, no metals will be assumed. Default: + ("gas", "metallicity") + table_type : string, optional + The type of emissivity table to be used when creating the fields. + Options are "cloudy" or "apec". Default: "cloudy" + data_dir : string, optional + The location to look for the data table in. If not supplied, the file + will be looked for in the location of the YT_DEST environment variable + or in the current working directory. + cosmology : :class:`~yt.utilities.cosmology.Cosmology`, optional + If set and redshift > 0.0, this cosmology will be used when computing the + cosmological dependence of the emission fields. If not set, yt's default + LCDM cosmology will be used. + + This will create three fields: + + "xray_emissivity_{e_min}_{e_max}_keV" (erg s^-1 cm^-3) + "xray_luminosity_{e_min}_{e_max}_keV" (erg s^-1) + "xray_photon_emissivity_{e_min}_{e_max}_keV" (photons s^-1 cm^-3) + + Examples + -------- + + >>> import yt + >>> ds = yt.load("sloshing_nomag2_hdf5_plt_cnt_0100") + >>> yt.add_xray_emissivity_field(ds, 0.5, 2) + >>> p = yt.ProjectionPlot(ds, 'x', "xray_emissivity_0.5_2_keV") + >>> p.save() + """ + # The next several if constructs are for backwards-compatibility + if "constant_metallicity" in kwargs: + issue_deprecation_warning("The \"constant_metallicity\" parameter is deprecated. Set " + "the \"metallicity\" parameter to a constant float value instead.") + metallicity = kwargs["constant_metallicity"] + if "with_metals" in kwargs: + issue_deprecation_warning("The \"with_metals\" parameter is deprecated. Use the " + "\"metallicity\" parameter to choose a constant or " + "spatially varying metallicity.") + if kwargs["with_metals"] and isinstance(metallicity, float): + raise RuntimeError("\"with_metals=True\", but you specified a constant metallicity!") + if not kwargs["with_metals"] and not isinstance(metallicity, float): + raise RuntimeError("\"with_metals=False\", but you didn't specify a constant metallicity!") + if not isinstance(metallicity, float) and metallicity is not None: + try: + metallicity = ds._get_field_info(*metallicity) + except YTFieldNotFound: + raise RuntimeError("Your dataset does not have a {} field! ".format(metallicity) + + "Perhaps you should specify a constant metallicity instead?") + + my_si = XrayEmissivityIntegrator(table_type, data_dir=data_dir, redshift=redshift) + + em_0 = my_si.get_interpolator("primordial", e_min, e_max) + emp_0 = my_si.get_interpolator("primordial", e_min, e_max, energy=False) + if metallicity is not None: + em_Z = my_si.get_interpolator("metals", e_min, e_max) + emp_Z = my_si.get_interpolator("metals", e_min, e_max, energy=False) + + def _emissivity_field(field, data): + dd = {"log_nH": np.log10(data["gas", "H_nuclei_density"]), + "log_T": np.log10(data["gas", "temperature"])} + + my_emissivity = np.power(10, em_0(dd)) + if metallicity is not None: + if isinstance(metallicity, DerivedField): + my_Z = data[metallicity.name] + else: + my_Z = metallicity + my_emissivity += my_Z * np.power(10, em_Z(dd)) + + return data["gas","H_nuclei_density"]**2 * \ + YTArray(my_emissivity, "erg*cm**3/s") + + emiss_name = "xray_emissivity_%s_%s_keV" % (e_min, e_max) + ds.add_field(("gas", emiss_name), function=_emissivity_field, + display_name=r"\epsilon_{X} (%s-%s keV)" % (e_min, e_max), + sampling_type="cell", units="erg/cm**3/s") + + def _luminosity_field(field, data): + return data[emiss_name] * data["cell_volume"] + + lum_name = "xray_luminosity_%s_%s_keV" % (e_min, e_max) + ds.add_field(("gas", lum_name), function=_luminosity_field, + display_name=r"\rm{L}_{X} (%s-%s keV)" % (e_min, e_max), + sampling_type="cell", units="erg/s") + + def _photon_emissivity_field(field, data): + dd = {"log_nH": np.log10(data["gas", "H_nuclei_density"]), + "log_T": np.log10(data["gas", "temperature"])} + + my_emissivity = np.power(10, emp_0(dd)) + if metallicity is not None: + if isinstance(metallicity, DerivedField): + my_Z = data[metallicity.name] + else: + my_Z = metallicity + my_emissivity += my_Z * np.power(10, emp_Z(dd)) + + return data["gas", "H_nuclei_density"]**2 * \ + YTArray(my_emissivity, "photons*cm**3/s") + + phot_name = "xray_photon_emissivity_%s_%s_keV" % (e_min, e_max) + ds.add_field(("gas", phot_name), function=_photon_emissivity_field, + display_name=r"\epsilon_{X} (%s-%s keV)" % (e_min, e_max), + sampling_type="cell", units="photons/cm**3/s") + + fields = [emiss_name, lum_name, phot_name] + + if redshift > 0.0: + + if cosmology is None: + if hasattr(ds, "cosmology"): + cosmology = ds.cosmology + else: + cosmology = Cosmology() + + D_L = cosmology.luminosity_distance(0.0, redshift) + angular_scale = 1.0/cosmology.angular_scale(0.0, redshift) + dist_fac = 1.0/(4.0*np.pi*D_L*D_L*angular_scale*angular_scale) + + ei_name = "xray_intensity_%s_%s_keV" % (e_min, e_max) + def _intensity_field(field, data): + I = dist_fac*data[emiss_name] + return I.in_units("erg/cm**3/s/arcsec**2") + ds.add_field(("gas", ei_name), function=_intensity_field, + display_name=r"I_{X} (%s-%s keV)" % (e_min, e_max), + sampling_type="cell", units="erg/cm**3/s/arcsec**2") + + i_name = "xray_photon_intensity_%s_%s_keV" % (e_min, e_max) + def _photon_intensity_field(field, data): + I = (1.0+redshift)*dist_fac*data[phot_name] + return I.in_units("photons/cm**3/s/arcsec**2") + ds.add_field(("gas", i_name), function=_photon_intensity_field, + display_name=r"I_{X} (%s-%s keV)" % (e_min, e_max), + sampling_type="cell", units="photons/cm**3/s/arcsec**2") + + fields += [ei_name, i_name] + + [mylog.info("Adding %s field." % field) for field in fields] + + return fields diff -Nru yt-3.3.3/yt/frontends/ahf/api.py yt-3.4.0/yt/frontends/ahf/api.py --- yt-3.3.3/yt/frontends/ahf/api.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/ahf/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,23 @@ +""" +API for yt.frontends.ahf + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from .data_structures import \ + AHFHalosDataset + +from .fields import \ + AHFHalosFieldInfo + +from .io import \ + IOHandlerAHFHalos diff -Nru yt-3.3.3/yt/frontends/ahf/data_structures.py yt-3.4.0/yt/frontends/ahf/data_structures.py --- yt-3.3.3/yt/frontends/ahf/data_structures.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/ahf/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,162 @@ +""" +AHF data structures + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import glob +import os +import stat + +import numpy as np + +from yt.data_objects.static_output import \ + Dataset, \ + ParticleFile +from yt.funcs import \ + setdefaultattr +from yt.geometry.particle_geometry_handler import \ + ParticleIndex +from yt.utilities.cosmology import \ + Cosmology + +from .fields import AHFHalosFieldInfo + + +class AHFHalosFile(ParticleFile): + def __init__(self, ds, io, filename, file_id): + root, _ = os.path.splitext(filename) + candidates = glob.glob(root + '*.AHF_halos') + if len(candidates) == 1: + filename = candidates[0] + else: + raise ValueError('Too many AHF_halos files.') + self.col_names = self._read_column_names(filename) + super(AHFHalosFile, self).__init__(ds, io, filename, file_id) + + def read_data(self, usecols=None): + return np.genfromtxt(self.filename, names=self.col_names, + usecols=usecols) + + def _read_column_names(self, filename): + with open(filename) as f: + line = f.readline() + # Remove leading '#' + line = line[1:] + names = line.split() + # Remove trailing '()' + names = [name.split('(')[0] for name in names] + return names + + +class AHFHalosDataset(Dataset): + _index_class = ParticleIndex + _file_class = AHFHalosFile + _field_info_class = AHFHalosFieldInfo + + def __init__(self, filename, dataset_type='ahf', + n_ref=16, over_refine_factor=1, + units_override=None, unit_system='cgs', + hubble_constant=1.0): + root, _ = os.path.splitext(filename) + self.log_filename = root + '.log' + self.hubble_constant = hubble_constant + + self.n_ref = n_ref + self.over_refine_factor = over_refine_factor + super(AHFHalosDataset, self).__init__( + filename, dataset_type=dataset_type, + units_override=units_override, unit_system=unit_system + ) + + def _set_code_unit_attributes(self): + setdefaultattr(self, 'length_unit', self.quan(1.0, 'kpccm/h')) + setdefaultattr(self, 'mass_unit', self.quan(1.0, 'Msun/h')) + setdefaultattr(self, 'time_unit', self.quan(1.0, 's')) + setdefaultattr(self, 'velocity_unit', self.quan(1.0, 'km/s')) + + def _parse_parameter_file(self): + # Read all parameters. + simu = self._read_log_simu() + param = self._read_parameter() + + # Set up general information. + self.filename_template = self.parameter_filename + self.file_count = 1 + self.parameters.update(param) + self.particle_types = ('halos') + self.particle_types_raw = ('halos') + self.unique_identifier = \ + int(os.stat(self.parameter_filename)[stat.ST_CTIME]) + + # Set up geometrical information. + self.refine_by = 2 + self.dimensionality = 3 + nz = 1 << self.over_refine_factor + self.domain_dimensions = np.ones(self.dimensionality, "int32") * nz + self.domain_left_edge = np.array([0.0, 0.0, 0.0]) + # Note that boxsize is in Mpc but particle positions are in kpc. + self.domain_right_edge = np.array([simu['boxsize']] * 3) * 1000 + self.periodicity = (True, True, True) + + # Set up cosmological information. + self.cosmological_simulation = 1 + self.current_redshift = param['z'] + self.omega_lambda = simu['lambda0'] + self.omega_matter = simu['omega0'] + cosmo = Cosmology(self.hubble_constant, + self.omega_matter, self.omega_lambda) + self.current_time = cosmo.hubble_time(param['z']).in_units('s') + + @classmethod + def _is_valid(self, *args, **kwargs): + filename = args[0] + if not filename.endswith('.parameter'): + return False + with open(filename, 'r') as f: + if f.readlines()[11].startswith('AHF'): + return True + return False + + # Helper methods + + def _read_log_simu(self): + simu = {} + with open(self.log_filename) as f: + for l in f: + if l.startswith('simu.'): + name, val = l.split(':') + key = name.strip().split('.')[1] + try: + val = float(val) + except: + val = float.fromhex(val) + simu[key] = val + return simu + + def _read_parameter(self): + param = {} + with open(self.parameter_filename) as f: + for l in f: + words = l.split() + if len(words) == 2: + key, val = words + try: + val = float(val) + param[key] = val + except: + pass + return param + + @property + def _skip_cache(self): + return True diff -Nru yt-3.3.3/yt/frontends/ahf/fields.py yt-3.4.0/yt/frontends/ahf/fields.py --- yt-3.3.3/yt/frontends/ahf/fields.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/ahf/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,74 @@ +''' +AHF-specific fields + + + +''' + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from yt.fields.field_info_container import \ + FieldInfoContainer + +m_units = 'Msun/h' +p_units = 'kpccm/h' +r_units = 'kpccm/h' +v_units = 'km/s' + + +class AHFHalosFieldInfo(FieldInfoContainer): + known_other_fields = () + + # See http://popia.ft.uam.es/AHF/files/AHF.pdf + # and search for '*.AHF_halos'. + known_particle_fields = ( + ('ID', ('', ['particle_identifier'], None)), + ('hostHalo', ('', [], None)), + ('numSubStruct', ('', [], None)), + ('Mvir', (m_units, ['particle_mass'], 'Virial Mass')), + ('npart', ('', [], None)), + ('Xc', (p_units, ['particle_position_x'], None)), + ('Yc', (p_units, ['particle_position_y'], None)), + ('Zc', (p_units, ['particle_position_z'], None)), + ('VXc', (v_units, ['particle_velocity_x'], None)), + ('VYc', (v_units, ['particle_velocity_y'], None)), + ('VZc', (v_units, ['particle_velocity_z'], None)), + ('Rvir', (r_units, ['virial_radius'], 'Virial Radius')), + ('Rmax', (r_units, [], None)), + ('r2', (r_units, [], None)), + ('mbp_offset', (r_units, [], None)), + ('com_offset', (r_units, [], None)), + ('Vmax', (v_units, [], None)), + ('v_sec', (v_units, [], None)), + ('sigV', (v_units, [], None)), + ('lambda', ('', [], None)), + ('lambdaE', ('', [], None)), + ('Lx', ('', [], None)), + ('Ly', ('', [], None)), + ('Lz', ('', [], None)), + ('b', ('', [], None)), + ('c', ('', [], None)), + ('Eax', ('', [], None)), + ('Eay', ('', [], None)), + ('Eaz', ('', [], None)), + ('Ebx', ('', [], None)), + ('Eby', ('', [], None)), + ('Ebz', ('', [], None)), + ('Ecx', ('', [], None)), + ('Ecy', ('', [], None)), + ('Ecz', ('', [], None)), + ('ovdens', ('', [], None)), + ('nbins', ('', [], None)), + ('fMhires', ('', [], None)), + ('Ekin', ('Msun/h*(km/s)**2', [], None)), + ('Epot', ('Msun/h*(km/s)**2', [], None)), + ('SurfP', ('Msun/h*(km/s)**2', [], None)), + ('Phi0', ('(km/s)**2', [], None)), + ('cNFW', ('', [], None)) + ) diff -Nru yt-3.3.3/yt/frontends/ahf/__init__.py yt-3.4.0/yt/frontends/ahf/__init__.py --- yt-3.3.3/yt/frontends/ahf/__init__.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/ahf/__init__.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,14 @@ +""" +API for yt.frontends.ahf + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- diff -Nru yt-3.3.3/yt/frontends/ahf/io.py yt-3.4.0/yt/frontends/ahf/io.py --- yt-3.3.3/yt/frontends/ahf/io.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/ahf/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,124 @@ +""" +AHF-specific IO functions + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from operator import attrgetter + +import numpy as np + +from yt.funcs import \ + mylog +from yt.utilities.exceptions import \ + YTDomainOverflow +from yt.utilities.io_handler import \ + BaseIOHandler +from yt.utilities.lib.geometry_utils import \ + compute_morton + + +class IOHandlerAHFHalos(BaseIOHandler): + _particle_reader = False + _dataset_type = 'ahf' + + def _read_fluid_selection(self, chunks, selector, fields, size): + raise NotImplementedError + + def _read_particle_coords(self, chunks, ptf): + # This needs to *yield* a series of tuples of (ptype, (x, y, z)). + # chunks is a list of chunks, and ptf is a dict where the keys are + # ptypes and the values are lists of fields. + for data_file in self._get_data_files(chunks, ptf): + halos = data_file.read_data(usecols=['Xc', 'Yc', 'Zc']) + x = halos['Xc'].astype('float64') + y = halos['Yc'].astype('float64') + z = halos['Zc'].astype('float64') + yield 'halos', (x, y, z) + + def _read_particle_fields(self, chunks, ptf, selector): + # This gets called after the arrays have been allocated. It needs to + # yield ((ptype, field), data) where data is the masked results of + # reading ptype, field and applying the selector to the data read in. + # Selector objects have a .select_points(x,y,z) that returns a mask, so + # you need to do your masking here. + for data_file in self._get_data_files(chunks, ptf): + cols = ['Xc', 'Yc', 'Zc'] + for field_list in ptf.values(): + cols.extend(field_list) + cols = list(set(cols)) + halos = data_file.read_data(usecols=cols) + x = halos['Xc'].astype('float64') + y = halos['Yc'].astype('float64') + z = halos['Zc'].astype('float64') + mask = selector.select_points(x, y, z, 0.0) + del x, y, z + if mask is None: continue + for ptype, field_list in sorted(ptf.items()): + for field in field_list: + data = halos[field][mask].astype('float64') + yield (ptype, field), data + + def _initialize_index(self, data_file, regions): + halos = data_file.read_data(usecols=['ID', 'Xc', 'Yc', 'Zc']) + pcount = len(halos['ID']) + morton = np.empty(pcount, dtype='uint64') + mylog.debug('Initializing index % 5i (% 7i particles)', + data_file.file_id, pcount) + if pcount == 0: + return morton + ind = 0 + pos = np.empty((pcount, 3), dtype='float64') + pos = data_file.ds.arr(pos, 'code_length') + dx = np.finfo(halos['Xc'].dtype).eps + dx = 2.0 * self.ds.quan(dx, 'code_length') + pos[:, 0] = halos['Xc'] + pos[:, 1] = halos['Yc'] + pos[:, 2] = halos['Zc'] + dle = self.ds.domain_left_edge + dre = self.ds.domain_right_edge + # These are 32 bit numbers, so we give a little lee-way. + # Otherwise, for big sets of particles, we often will bump into the + # domain edges. This helps alleviate that. + np.clip(pos, dle + dx, dre - dx, pos) + if np.any(pos.min(axis=0) < dle) or np.any(pos.max(axis=0) > dre): + raise YTDomainOverflow(pos.min(axis=0), + pos.max(axis=0), + dle, dre) + regions.add_data_file(pos, data_file.file_id) + morton[ind:ind+pos.shape[0]] = compute_morton( + pos[:, 0], pos[:, 1], pos[:, 2], dle, dre) + return morton + + def _count_particles(self, data_file): + halos = data_file.read_data(usecols=['ID']) + return {'halos': len(halos['ID'])} + + def _identify_fields(self, data_file): + fields = [('halos', f) for f in data_file.col_names] + return fields, {} + + # Helper methods + + def _get_data_files(self, chunks, ptf): + # Only support halo reading for now. + assert len(ptf) == 1 + assert list(ptf.keys())[0] == 'halos' + # Get data_files + chunks = list(chunks) + data_files = set([]) + for chunk in chunks: + for obj in chunk.objs: + data_files.update(obj.data_files) + data_files = sorted(data_files, key=attrgetter('filename')) + for data_file in data_files: + yield data_file diff -Nru yt-3.3.3/yt/frontends/ahf/tests/test_outputs.py yt-3.4.0/yt/frontends/ahf/tests/test_outputs.py --- yt-3.3.3/yt/frontends/ahf/tests/test_outputs.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/ahf/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,46 @@ +""" +AHF frontend tests using ahf_halos dataset + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import os.path +from yt.testing import \ + assert_equal, \ + requires_file +from yt.utilities.answer_testing.framework import \ + FieldValuesTest, \ + requires_ds, \ + data_dir_load +from yt.frontends.ahf.api import AHFHalosDataset + +_fields = ('particle_position_x', 'particle_position_y', + 'particle_position_z', 'particle_mass') + +ahf_halos = 'ahf_halos/snap_N64L16_135.parameter' + + +def load(filename): + return data_dir_load(filename, kwargs={'hubble_constant': 0.7}) + + +@requires_ds(ahf_halos) +def test_fields_ahf_halos(): + ds = load(ahf_halos) + assert_equal(str(ds), os.path.basename(ahf_halos)) + for field in _fields: + yield FieldValuesTest(ds, field, particle_type=True) + + +@requires_file(ahf_halos) +def test_AHFHalosDataset(): + assert isinstance(load(ahf_halos), AHFHalosDataset) diff -Nru yt-3.3.3/yt/frontends/api.py yt-3.4.0/yt/frontends/api.py --- yt-3.3.3/yt/frontends/api.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -17,13 +17,16 @@ from yt.extern.six.moves import cPickle as pickle _frontends = [ + 'ahf', 'art', 'artio', 'athena', + 'athena_pp', 'boxlib', 'chombo', 'eagle', 'enzo', + 'enzo_p', 'exodus_ii', 'fits', 'flash', @@ -35,6 +38,7 @@ 'halo_catalog', 'http_stream', 'moab', + 'open_pmd', 'owls', 'owls_subfind', 'ramses', diff -Nru yt-3.3.3/yt/frontends/art/data_structures.py yt-3.4.0/yt/frontends/art/data_structures.py --- yt-3.3.3/yt/frontends/art/data_structures.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/art/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -277,7 +277,7 @@ # domain dimensions is the number of root *cells* self.domain_dimensions = np.ones(3, dtype='int64')*est self.root_grid_mask_offset = f.tell() - self.root_nocts = self.domain_dimensions.prod()/8 + self.root_nocts = self.domain_dimensions.prod() // 8 self.root_ncells = self.root_nocts*8 mylog.debug("Estimating %i cells on a root grid side," + "%i root octs", est, self.root_nocts) @@ -705,7 +705,7 @@ tr[field] = np.zeros(cell_count, 'float64') data = _read_root_level(content, self.domain.level_child_offsets, self.domain.level_count) - ns = (self.domain.ds.domain_dimensions.prod() / 8, 8) + ns = (self.domain.ds.domain_dimensions.prod() // 8, 8) for field, fi in zip(fields, field_idxs): source[field] = np.empty(ns, dtype="float64", order="C") dt = data[fi,:].reshape(self.domain.ds.domain_dimensions, @@ -781,7 +781,7 @@ self._count_art_octs(f, self.ds.child_grid_offset, self.ds.min_level, self.ds.max_level) # remember that the root grid is by itself; manually add it back in - inoll[0] = self.ds.domain_dimensions.prod()/8 + inoll[0] = self.ds.domain_dimensions.prod() // 8 _level_child_offsets[0] = self.ds.root_grid_offset self.nhydrovars = nhydrovars self.inoll = inoll # number of octs diff -Nru yt-3.3.3/yt/frontends/art/fields.py yt-3.4.0/yt/frontends/art/fields.py --- yt-3.3.3/yt/frontends/art/fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/art/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -65,7 +65,7 @@ tr *= (data.ds.parameters['gamma'] - 1.) tr /= data.ds.parameters['aexpn']**2 return tr * data['art', 'GasEnergy'] / data['art', 'Density'] - self.add_field(('gas', 'temperature'), + self.add_field(('gas', 'temperature'), sampling_type="cell", function=_temperature, units=unit_system["temperature"]) @@ -75,7 +75,7 @@ data[('gas','density')]) return velocity for ax in 'xyz': - self.add_field(('gas','velocity_%s' % ax), + self.add_field(('gas','velocity_%s' % ax), sampling_type="cell", function = _get_vel(ax), units=unit_system["velocity"]) @@ -85,7 +85,7 @@ data['gas','momentum_z']**2)**0.5 tr *= data['index','cell_volume'].in_units('cm**3') return tr - self.add_field(('gas', 'momentum_magnitude'), + self.add_field(('gas', 'momentum_magnitude'), sampling_type="cell", function=_momentum_magnitude, units=unit_system["momentum"]) @@ -93,7 +93,7 @@ tr = data['gas','momentum_magnitude'] tr /= data['gas','cell_mass'] return tr - self.add_field(('gas', 'velocity_magnitude'), + self.add_field(('gas', 'velocity_magnitude'), sampling_type="cell", function=_velocity_magnitude, units=unit_system["velocity"]) @@ -101,7 +101,7 @@ tr = data['gas','metal_ia_density'] tr += data['gas','metal_ii_density'] return tr - self.add_field(('gas','metal_density'), + self.add_field(('gas','metal_density'), sampling_type="cell", function=_metal_density, units=unit_system["density"]) @@ -109,7 +109,7 @@ tr = data['gas','metal_density'] tr /= data['gas','density'] return tr - self.add_field(('gas', 'metal_mass_fraction'), + self.add_field(('gas', 'metal_mass_fraction'), sampling_type="cell", function=_metal_mass_fraction, units='') @@ -117,7 +117,7 @@ tr = (1. - data.ds.parameters['Y_p'] - data['gas', 'metal_mass_fraction']) return tr - self.add_field(('gas', 'H_mass_fraction'), + self.add_field(('gas', 'H_mass_fraction'), sampling_type="cell", function=_H_mass_fraction, units='') @@ -125,6 +125,6 @@ tr = data['gas','metal_mass_fraction'] tr /= data['gas','H_mass_fraction'] return tr - self.add_field(('gas', 'metallicity'), + self.add_field(('gas', 'metallicity'), sampling_type="cell", function=_metallicity, units='') diff -Nru yt-3.3.3/yt/frontends/art/tests/test_outputs.py yt-3.4.0/yt/frontends/art/tests/test_outputs.py --- yt-3.3.3/yt/frontends/art/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/art/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -41,7 +41,7 @@ def test_d9p(): ds = data_dir_load(d9p) ds.index - yield assert_equal, str(ds), "10MpcBox_HartGal_csf_a0.500.d" + assert_equal(str(ds), "10MpcBox_HartGal_csf_a0.500.d") dso = [None, ("sphere", ("max", (0.1, 'unitary')))] for field in _fields: for axis in [0, 1, 2]: @@ -56,18 +56,18 @@ ad = ds.all_data() # 'Ana' variable values output from the ART Fortran 'ANA' analysis code AnaNStars = 6255 - yield assert_equal, ad[('stars', 'particle_type')].size, AnaNStars - yield assert_equal, ad[('specie4', 'particle_type')].size, AnaNStars + assert_equal(ad[('stars', 'particle_type')].size, AnaNStars) + assert_equal(ad[('specie4', 'particle_type')].size, AnaNStars) # The *real* asnwer is 2833405, but yt misses one particle since it lives # on a domain boundary. See issue 814. When that is fixed, this test # will need to be updated AnaNDM = 2833404 - yield assert_equal, ad[('darkmatter', 'particle_type')].size, AnaNDM - yield assert_equal, (ad[('specie0', 'particle_type')].size + - ad[('specie1', 'particle_type')].size + - ad[('specie2', 'particle_type')].size + - ad[('specie3', 'particle_type')].size), AnaNDM + assert_equal(ad[('darkmatter', 'particle_type')].size, AnaNDM) + assert_equal((ad[('specie0', 'particle_type')].size + + ad[('specie1', 'particle_type')].size + + ad[('specie2', 'particle_type')].size + + ad[('specie3', 'particle_type')].size), AnaNDM) for spnum in range(5): npart_read = ad['specie%s' % spnum, 'particle_type'].size @@ -81,34 +81,33 @@ AnaVolume = YTQuantity(364.640074656, 'Mpc**3') Volume = 1 for i in ds.domain_width.in_units('Mpc'): - yield assert_almost_equal, i, AnaBoxSize + assert_almost_equal(i, AnaBoxSize) Volume *= i - yield assert_almost_equal, Volume, AnaVolume + assert_almost_equal(Volume, AnaVolume) AnaNCells = 4087490 - yield assert_equal, len(ad[('index', 'cell_volume')]), AnaNCells + assert_equal(len(ad[('index', 'cell_volume')]), AnaNCells) AnaTotDMMass = YTQuantity(1.01191786808255e+14, 'Msun') - yield (assert_almost_equal, - ad[('darkmatter', 'particle_mass')].sum().in_units('Msun'), - AnaTotDMMass) + assert_almost_equal( + ad[('darkmatter', 'particle_mass')].sum().in_units('Msun'), + AnaTotDMMass) AnaTotStarMass = YTQuantity(1776701.3990607238, 'Msun') - yield (assert_almost_equal, - ad[('stars', 'particle_mass')].sum().in_units('Msun'), - AnaTotStarMass) + assert_almost_equal(ad[('stars', 'particle_mass')].sum().in_units('Msun'), + AnaTotStarMass) AnaTotStarMassInitial = YTQuantity(2423468.2801332865, 'Msun') - yield (assert_almost_equal, - ad[('stars', 'particle_mass_initial')].sum().in_units('Msun'), - AnaTotStarMassInitial) + assert_almost_equal( + ad[('stars', 'particle_mass_initial')].sum().in_units('Msun'), + AnaTotStarMassInitial) AnaTotGasMass = YTQuantity(1.7826982029216785e+13, 'Msun') - yield (assert_almost_equal, ad[('gas', 'cell_mass')].sum().in_units('Msun'), - AnaTotGasMass) + assert_almost_equal(ad[('gas', 'cell_mass')].sum().in_units('Msun'), + AnaTotGasMass) AnaTotTemp = YTQuantity(150219844793.39072, 'K') # just leaves - yield assert_equal, ad[('gas', 'temperature')].sum(), AnaTotTemp + assert_equal(ad[('gas', 'temperature')].sum(), AnaTotTemp) @requires_file(d9p) @@ -117,5 +116,4 @@ @requires_file(d9p) def test_units_override(): - for test in units_override_check(d9p): - yield test + units_override_check(d9p) diff -Nru yt-3.3.3/yt/frontends/artio/_artio_caller.c yt-3.4.0/yt/frontends/artio/_artio_caller.c --- yt-3.3.3/yt/frontends/artio/_artio_caller.c 2016-12-12 01:42:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/artio/_artio_caller.c 2017-08-10 18:21:02.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -25,6 +25,21 @@ "yt/frontends/artio/artio_headers/", "yt/geometry/", "yt/utilities/lib/" + ], + "name": "yt.frontends.artio._artio_caller", + "sources": [ + "yt/frontends/artio/_artio_caller.pyx", + "yt/frontends/artio/artio_headers/artio.c", + "yt/frontends/artio/artio_headers/artio_endian.c", + "yt/frontends/artio/artio_headers/artio_file.c", + "yt/frontends/artio/artio_headers/artio_grid.c", + "yt/frontends/artio/artio_headers/artio_mpi.c", + "yt/frontends/artio/artio_headers/artio_parameter.c", + "yt/frontends/artio/artio_headers/artio_particle.c", + "yt/frontends/artio/artio_headers/artio_posix.c", + "yt/frontends/artio/artio_headers/artio_selector.c", + "yt/frontends/artio/artio_headers/artio_sfc.c", + "yt/frontends/artio/artio_headers/cosmology.c" ] }, "module_name": "yt.frontends.artio._artio_caller" @@ -38,7 +53,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -60,6 +75,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -212,16 +228,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -348,6 +368,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -402,6 +428,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -517,8 +572,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -531,8 +586,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -654,10 +712,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -691,12 +751,13 @@ static const char *__pyx_f[] = { "yt/frontends/artio/_artio_caller.pyx", + "stringsource", + "yt/geometry/particle_deposit.pxd", "__init__.pxd", "yt/geometry/selection_routines.pxd", - "yt/geometry/particle_deposit.pxd", - "stringsource", "type.pxd", "yt/geometry/oct_visitors.pxd", + "yt/utilities/lib/allocation_container.pxd", "yt/geometry/oct_container.pxd", }; /* BufferFormatStructs.proto */ @@ -1031,6 +1092,9 @@ struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject; struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector; +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool; +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool; struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer; @@ -1150,7 +1214,7 @@ __pyx_t_5numpy_float64_t right_edge_x; __pyx_t_5numpy_float64_t right_edge_y; __pyx_t_5numpy_float64_t right_edge_z; - __pyx_t_5numpy_int64_t children_pointers; + __pyx_t_5numpy_int_t children_pointers; __pyx_t_5numpy_int64_t start_index_x; __pyx_t_5numpy_int64_t start_index_y; __pyx_t_5numpy_int64_t start_index_z; @@ -1192,7 +1256,7 @@ struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid; struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells; -/* "yt/geometry/selection_routines.pxd":42 +/* "yt/geometry/selection_routines.pxd":38 * cdef np.int64_t _hash * * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -1204,7 +1268,7 @@ int visit_covered; }; -/* "yt/geometry/selection_routines.pxd":50 +/* "yt/geometry/selection_routines.pxd":46 * np.float64_t spos[3], np.float64_t sdds[3], * OctVisitor visitor, int i, int j, int k) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1216,7 +1280,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "yt/geometry/selection_routines.pxd":65 +/* "yt/geometry/selection_routines.pxd":61 * np.ndarray[np.uint8_t, ndim=3] mask, * int level) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -1227,14 +1291,43 @@ int __pyx_n; __pyx_t_5numpy_uint8_t *cached_mask; }; +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer; +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs; + +/* "yt/utilities/lib/allocation_container.pxd":19 + * from libc.stdlib cimport malloc, free, realloc + * + * cdef struct AllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + void *my_objs; +}; + +/* "yt/utilities/lib/allocation_container.pxd":30 + * cdef np.uint64_t n_con + * cdef AllocationContainer* containers + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except * # <<<<<<<<<<<<<< + * cdef void setup_objs(self, void *obj, np.uint64_t count, + * np.uint64_t offset, np.int64_t con_id) + */ +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs { + int __pyx_n; + __pyx_t_5numpy_int64_t con_id; +}; struct __pyx_t_2yt_8geometry_13oct_container_OctKey; struct __pyx_t_2yt_8geometry_13oct_container_OctInfo; -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_t_2yt_8geometry_13oct_container_OctList; +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs; -/* "yt/geometry/oct_container.pxd":28 +/* "yt/geometry/oct_container.pxd":30 * cdef int ORDER_MAX * * cdef struct OctKey: # <<<<<<<<<<<<<< @@ -1246,7 +1339,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node; }; -/* "yt/geometry/oct_container.pxd":32 +/* "yt/geometry/oct_container.pxd":34 * Oct *node * * cdef struct OctInfo: # <<<<<<<<<<<<<< @@ -1260,25 +1353,9 @@ __pyx_t_5numpy_int32_t level; }; -/* "yt/geometry/oct_container.pxd":38 +/* "yt/geometry/oct_container.pxd":40 * np.int32_t level * - * cdef struct OctAllocationContainer # <<<<<<<<<<<<<< - * cdef struct OctAllocationContainer: - * np.int64_t n - */ -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { - __pyx_t_5numpy_int64_t n; - __pyx_t_5numpy_int64_t n_assigned; - __pyx_t_5numpy_int64_t offset; - __pyx_t_5numpy_int64_t con_id; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *next; - struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_octs; -}; - -/* "yt/geometry/oct_container.pxd":47 - * Oct *my_octs - * * cdef struct OctList # <<<<<<<<<<<<<< * * cdef struct OctList: @@ -1288,7 +1365,22 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "yt/geometry/oct_container.pxd":69 +/* "yt/geometry/oct_container.pxd":48 + * # NOTE: This object *has* to be the same size as the AllocationContainer + * # object. There's an assert in the __cinit__ function. + * cdef struct OctAllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs; +}; + +/* "yt/geometry/oct_container.pxd":74 * cdef public np.int64_t nocts * cdef public int num_domains * cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?, # <<<<<<<<<<<<<< @@ -1301,8 +1393,8 @@ int max_level; }; -/* "yt/geometry/oct_container.pxd":78 - * # OctAllocationContainer.offset if such a thing exists. +/* "yt/geometry/oct_container.pxd":83 + * # AllocationContainer.offset if such a thing exists. * cdef np.int64_t get_domain_offset(self, int domain_id) * cdef void visit_all_octs(self, # <<<<<<<<<<<<<< * selection_routines.SelectorObject selector, @@ -1630,12 +1722,12 @@ struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base; __Pyx_memviewslice ref_mask; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs; - __pyx_t_5numpy_int64_t *nocts; - __pyx_t_5numpy_int64_t *nfinest; + __pyx_t_5numpy_uint64_t *nocts; + __pyx_t_5numpy_uint64_t *nfinest; }; -/* "yt/geometry/selection_routines.pxd":33 +/* "yt/geometry/selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1655,7 +1747,7 @@ }; -/* "yt/geometry/selection_routines.pxd":71 +/* "yt/geometry/selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1667,7 +1759,7 @@ }; -/* "yt/geometry/selection_routines.pxd":74 +/* "yt/geometry/selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1681,18 +1773,59 @@ }; -/* "yt/geometry/oct_container.pxd":57 +/* "yt/geometry/selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2; +}; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool { + PyObject_HEAD + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab; + __pyx_t_5numpy_uint64_t itemsize; + __pyx_t_5numpy_uint64_t n_con; + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers; +}; + + +/* "yt/geometry/oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; +}; + + +/* "yt/geometry/oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer { PyObject_HEAD struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *cont; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer **domains; + struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh; int partial_coverage; int level_offset; @@ -1706,7 +1839,7 @@ }; -/* "yt/geometry/oct_container.pxd":89 +/* "yt/geometry/oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -1722,7 +1855,7 @@ }; -/* "yt/geometry/oct_container.pxd":97 +/* "yt/geometry/oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -2220,7 +2353,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree; -/* "yt/geometry/selection_routines.pxd":33 +/* "yt/geometry/selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -2243,7 +2376,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; -/* "yt/geometry/selection_routines.pxd":71 +/* "yt/geometry/selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2257,7 +2390,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; -/* "yt/geometry/selection_routines.pxd":74 +/* "yt/geometry/selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2271,12 +2404,58 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; -/* "yt/geometry/oct_container.pxd":57 +/* "yt/geometry/selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool { + void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args); + void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); + void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + + +/* "yt/geometry/oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ + +struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); +}; +static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool; +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); + + +/* "yt/geometry/oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer { @@ -2293,7 +2472,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer; -/* "yt/geometry/oct_container.pxd":89 +/* "yt/geometry/oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -2309,7 +2488,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer; -/* "yt/geometry/oct_container.pxd":97 +/* "yt/geometry/oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -2332,7 +2511,7 @@ */ struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation { - void (*process)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t); + int (*process)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t); }; static struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation; @@ -2711,6 +2890,20 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); +/* 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, @@ -2728,7 +2921,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); @@ -2736,6 +2929,13 @@ /* BufferFallbackError.proto */ static void __Pyx_RaiseBufferFallbackError(void); +/* 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() + #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); @@ -2831,6 +3031,15 @@ static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); @@ -2843,9 +3052,6 @@ 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 *); - /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) @@ -2885,12 +3091,18 @@ /* CallNextTpClear.proto */ static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -2950,6 +3162,12 @@ static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); /* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); + +/* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ @@ -2962,9 +3180,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); - -/* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value); /* CIntToPy.proto */ @@ -3079,21 +3294,24 @@ int dtype_is_object); /* CIntFromPy.proto */ -static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); +static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntFromPy.proto */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); /* TypeInfoCompare.proto */ @@ -3154,6 +3372,7 @@ static int __pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_grid(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_grid *__pyx_optional_args); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* 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*/ @@ -3227,15 +3446,20 @@ static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0; /* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ /* Module declarations from 'libc.math' */ +/* Module declarations from 'yt.utilities.lib.allocation_container' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0; + /* Module declarations from 'yt.geometry.oct_container' */ +static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0; @@ -3270,6 +3494,13 @@ static PyThread_type_lock __pyx_memoryview_thread_locks[8]; static void __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(int, struct __pyx_opt_args_2yt_9frontends_5artio_13_artio_caller_check_artio_status *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_2yt_9frontends_5artio_13_artio_caller_read_sfc_particles(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, int, PyObject *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t **); /*proto*/ +static PyObject *__pyx_f_2yt_9frontends_5artio_13_artio_caller___pyx_unpickle_SFCRangeSelector__set_state(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_carray_to_py___pyx_t_5numpy_float64_t(__pyx_t_5numpy_float64_t *, Py_ssize_t); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple___pyx_t_5numpy_float64_t(__pyx_t_5numpy_float64_t *, Py_ssize_t); /*proto*/ +static int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(PyObject *, __pyx_t_5numpy_float64_t *, Py_ssize_t); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_carray_to_py_int(int *, Py_ssize_t); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_int(int *, Py_ssize_t); /*proto*/ +static int __Pyx_carray_from_py_int(PyObject *, int *, Py_ssize_t); /*proto*/ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ static void *__pyx_align_pointer(void *, size_t); /*proto*/ static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ @@ -3302,6 +3533,7 @@ 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_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 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 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; @@ -3318,13 +3550,14 @@ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_max; static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_super; -static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_OverflowError; +static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_Ellipsis; -static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_id; -static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_3[] = "3"; static const char __pyx_k_C[] = "C"; static const char __pyx_k_O[] = "O"; @@ -3338,6 +3571,7 @@ static const char __pyx_k_get[] = "get"; static const char __pyx_k_int[] = "int"; static const char __pyx_k_max[] = "max"; +static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_sum[] = "sum"; static const char __pyx_k_sys[] = "sys"; @@ -3346,6 +3580,7 @@ static const char __pyx_k_base[] = "base"; static const char __pyx_k_bool[] = "bool"; static const char __pyx_k_dest[] = "dest"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_dims[] = "dims"; static const char __pyx_k_dobj[] = "dobj"; static const char __pyx_k_init[] = "__init__"; @@ -3397,10 +3632,13 @@ static const char __pyx_k_levels[] = "levels"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_offset[] = "offset"; +static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_resize[] = "resize"; +static const char __pyx_k_result[] = "result"; static const char __pyx_k_source[] = "source"; 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_DeltaDC[] = "DeltaDC"; static const char __pyx_k_SPECIES[] = "SPECIES"; static const char __pyx_k_co_name[] = "co_name"; @@ -3417,6 +3655,7 @@ static const char __pyx_k_getframe[] = "_getframe"; static const char __pyx_k_itemsize[] = "itemsize"; static const char __pyx_k_pdeposit[] = "pdeposit"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_selector[] = "selector"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_cell_inds[] = "cell_inds"; @@ -3425,6 +3664,7 @@ static const char __pyx_k_file_inds[] = "file_inds"; static const char __pyx_k_num_cells[] = "num_cells"; static const char __pyx_k_positions[] = "positions"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_sfc_start[] = "sfc_start"; static const char __pyx_k_time_unit[] = "time_unit"; static const char __pyx_k_traceback[] = "traceback"; @@ -3442,6 +3682,7 @@ 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_code_length[] = "code_length"; static const char __pyx_k_dest_fields[] = "dest_fields"; static const char __pyx_k_file_prefix[] = "file_prefix"; @@ -3453,25 +3694,33 @@ static const char __pyx_k_OnceIndirect[] = "OnceIndirect"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_artio_handle[] = "artio_handle"; +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_base_selector[] = "base_selector"; static const char __pyx_k_domain_counts[] = "domain_counts"; static const char __pyx_k_field_indices[] = "field_indices"; static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; static const char __pyx_k_range_handler[] = "range_handler"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_artio_is_valid[] = "artio_is_valid"; static const char __pyx_k_grid_max_level[] = "grid_max_level"; static const char __pyx_k_max_range_size[] = "max_range_size"; static const char __pyx_k_num_root_cells[] = "num_root_cells"; +static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; static const char __pyx_k_cache_root_mesh[] = "cache_root_mesh"; static const char __pyx_k_data_structures[] = "data_structures"; static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; static const char __pyx_k_read_parameters[] = "read_parameters"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_allocate_domains[] = "allocate_domains"; static const char __pyx_k_convert_to_units[] = "convert_to_units"; static const char __pyx_k_domain_left_edge[] = "domain_left_edge"; static const char __pyx_k_domain_dimensions[] = "domain_dimensions"; static const char __pyx_k_domain_right_edge[] = "domain_right_edge"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_num_grid_variables[] = "num_grid_variables"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; @@ -3492,10 +3741,11 @@ 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_pyx_unpickle_SFCRangeSelector[] = "__pyx_unpickle_SFCRangeSelector"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/frontends/artio/_artio_caller.pyx"; 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_self_handle_cannot_be_converted[] = "self.handle cannot be converted to a Python object for pickling"; static const char __pyx_k_species__02u_secondary_variable[] = "species_%02u_secondary_variable_labels"; static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; static const char __pyx_k_yt_utilities_lib_misc_utilities[] = "yt.utilities.lib.misc_utilities"; @@ -3505,6 +3755,8 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xde[] = "Incompatible checksums (%s vs 0xde40fc3 = (_hash, _hash_initialized, base_selector, domain_width, max_level, mesh_container, min_level, overlap_cells, periodicity, range_handler, sfc_end, sfc_start))"; 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_Invalid_species_provided_to_read[] = "Invalid species provided to read_particle_chunk"; @@ -3523,7 +3775,11 @@ 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_invalid_field_name_provided_to_r[] = "invalid field name provided to read_particle_chunk"; 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_cosmology_self_grid_variabl[] = "self.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling"; +static const char __pyx_k_self_doct_count_self_handle_self[] = "self.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling"; +static const char __pyx_k_self_root_mesh_self_root_nodes_s[] = "self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling"; static const char __pyx_k_species__02d_primary_variable_la[] = "species_%02d_primary_variable_labels"; static const char __pyx_k_species__02u_primary_variable_la[] = "species_%02u_primary_variable_labels"; static const char __pyx_k_tcode_from_abox_called_for_non_c[] = "tcode_from_abox called for non-cosmological ARTIO fileset!"; @@ -3531,8 +3787,9 @@ static const char __pyx_k_tphys_from_abox_called_for_non_c[] = "tphys_from_abox called for non-cosmological ARTIO fileset!"; static const char __pyx_k_tphys_from_auni_called_for_non_c[] = "tphys_from_auni called for non-cosmological ARTIO fileset!"; static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; -static const char __pyx_k_yt_frontends_artio__artio_caller[] = "yt.frontends.artio._artio_caller"; +static const char __pyx_k_yt_frontends_artio__artio_caller[] = "yt/frontends/artio/_artio_caller.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_frontends_artio__artio_caller_2[] = "yt.frontends.artio._artio_caller"; static PyObject *__pyx_kp_s_3; static PyObject *__pyx_kp_s_ARTIO_file_corruption_detected_i; static PyObject *__pyx_n_s_ASCII; @@ -3548,6 +3805,8 @@ 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_kp_s_Incompatible_checksums_s_vs_0xde; 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; @@ -3565,10 +3824,12 @@ static PyObject *__pyx_n_s_OmegaM; static PyObject *__pyx_n_s_OnceIndirect; static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_n_s_OverflowError; static PyObject *__pyx_n_s_PID; static PyObject *__pyx_n_s_POSITION_X; static PyObject *__pyx_n_s_POSITION_Y; static PyObject *__pyx_n_s_POSITION_Z; +static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_SPECIES; static PyObject *__pyx_n_s_TypeError; @@ -3576,8 +3837,8 @@ static PyObject *__pyx_kp_s_Unable_to_locate_particle_header; static PyObject *__pyx_kp_s_Unable_to_locate_position_inform; static PyObject *__pyx_kp_s_Unable_to_locate_variable_labels; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_n_s_abox; static PyObject *__pyx_kp_s_abox_from_auni_called_for_non_co; static PyObject *__pyx_kp_s_abox_from_tcode_called_for_non_c; @@ -3600,6 +3861,7 @@ static PyObject *__pyx_n_s_cache_root_mesh; static PyObject *__pyx_n_s_cell_inds; static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_co_name; static PyObject *__pyx_n_s_code_length; static PyObject *__pyx_kp_s_contiguous_and_direct; @@ -3611,6 +3873,7 @@ static PyObject *__pyx_n_s_decode; static PyObject *__pyx_n_s_dest; static PyObject *__pyx_n_s_dest_fields; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dims; static PyObject *__pyx_n_s_dobj; static PyObject *__pyx_n_s_domain_counts; @@ -3672,6 +3935,8 @@ 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_num_cells; static PyObject *__pyx_n_s_num_grid_variables; @@ -3690,19 +3955,32 @@ static PyObject *__pyx_n_s_particle_species_mass; static PyObject *__pyx_n_s_pdeposit; static PyObject *__pyx_n_s_pi; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_positions; static PyObject *__pyx_n_s_print_stack; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_SFCRangeSelector; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_quartic; static PyObject *__pyx_n_s_quintic; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_range_handler; static PyObject *__pyx_n_s_read_parameters; +static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_resize; +static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_right_edges; static PyObject *__pyx_n_s_s; static PyObject *__pyx_n_s_selector; +static PyObject *__pyx_kp_s_self_cosmology_self_grid_variabl; +static PyObject *__pyx_kp_s_self_doct_count_self_handle_self; +static PyObject *__pyx_kp_s_self_handle_cannot_be_converted; +static PyObject *__pyx_kp_s_self_root_mesh_self_root_nodes_s; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_sfc_end; static PyObject *__pyx_n_s_sfc_start; static PyObject *__pyx_n_s_sfc_subset_selector; @@ -3718,6 +3996,7 @@ 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_sum; static PyObject *__pyx_n_s_super; @@ -3735,12 +4014,14 @@ static PyObject *__pyx_n_s_units; 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_kp_s_utf_8; static PyObject *__pyx_n_s_version; static PyObject *__pyx_n_s_wendland2; static PyObject *__pyx_n_s_wendland4; static PyObject *__pyx_n_s_wendland6; -static PyObject *__pyx_n_s_yt_frontends_artio__artio_caller; +static PyObject *__pyx_kp_s_yt_frontends_artio__artio_caller; +static PyObject *__pyx_n_s_yt_frontends_artio__artio_caller_2; static PyObject *__pyx_n_s_yt_utilities_lib_misc_utilities; static PyObject *__pyx_n_s_zeros; static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, char *__pyx_v_file_prefix); /* proto */ @@ -3779,6 +4060,8 @@ static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_38__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_40__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_artio_is_valid(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_file_prefix); /* proto */ static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_domain_dimensions, PyObject *__pyx_v_domain_left_edge, PyObject *__pyx_v_domain_right_edge, struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_artio_handle, PyObject *__pyx_v_sfc_start, PyObject *__pyx_v_sfc_end, int __pyx_v_cache_root_mesh); /* proto */ static void __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_2__dealloc__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */ @@ -3802,6 +4085,8 @@ static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_2get_coords(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_handle, __pyx_t_5numpy_int64_t __pyx_v_s); /* proto */ static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_range_handler); /* proto */ static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_2fill_sfc(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, PyArrayObject *__pyx_v_levels, PyArrayObject *__pyx_v_cell_inds, PyArrayObject *__pyx_v_file_inds, PyArrayObject *__pyx_v_domain_counts, PyObject *__pyx_v_field_indices, PyObject *__pyx_v_dest_fields); /* proto */ @@ -3809,6 +4094,8 @@ static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_range_handler); /* proto */ static void __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_2__dealloc__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_4icoords(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, CYTHON_UNUSED int __pyx_v_domain_id); /* proto */ @@ -3828,9 +4115,14 @@ static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_2select_grids(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_left_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_right_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_4_hash_vals(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_6__reduce_cython__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_8__setstate_cython__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_4__pyx_unpickle_SFCRangeSelector(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 */ @@ -3840,8 +4132,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -3863,8 +4159,13 @@ 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_2yt_9frontends_5artio_13_artio_caller_artio_fileset(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3879,6 +4180,8 @@ static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_8; +static PyObject *__pyx_int_184977713; +static PyObject *__pyx_int_233050051; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; @@ -3889,11 +4192,11 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__29; -static PyObject *__pyx_slice__31; -static PyObject *__pyx_slice__52; -static PyObject *__pyx_slice__53; -static PyObject *__pyx_slice__54; +static PyObject *__pyx_slice__33; +static PyObject *__pyx_slice__37; +static PyObject *__pyx_slice__64; +static PyObject *__pyx_slice__65; +static PyObject *__pyx_slice__66; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -3913,13 +4216,13 @@ static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; -static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; -static PyObject *__pyx_tuple__37; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__39; static PyObject *__pyx_tuple__40; @@ -3934,16 +4237,34 @@ static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__54; static PyObject *__pyx_tuple__55; static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__57; static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; static PyObject *__pyx_tuple__60; static PyObject *__pyx_tuple__61; static PyObject *__pyx_tuple__62; static PyObject *__pyx_tuple__63; -static PyObject *__pyx_tuple__64; -static PyObject *__pyx_codeobj__57; -static PyObject *__pyx_codeobj__59; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__74; +static PyObject *__pyx_tuple__76; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_codeobj__71; +static PyObject *__pyx_codeobj__73; +static PyObject *__pyx_codeobj__75; +static PyObject *__pyx_codeobj__82; /* "yt/frontends/artio/_artio_caller.pyx":152 * void artio_sfc_coords( artio_fileset_handle *handle, int64_t index, int coords[3] ) nogil @@ -4160,7 +4481,7 @@ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("yt.frontends.artio._artio_caller.check_artio_status", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.frontends.artio._artio_caller.check_artio_status", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF(__pyx_v_traceback); __Pyx_XDECREF(__pyx_v_callername); @@ -4191,6 +4512,7 @@ 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; } @@ -4208,7 +4530,7 @@ } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } - __pyx_v_file_prefix = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_file_prefix) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L3_error) + __pyx_v_file_prefix = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_file_prefix) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; @@ -6812,6 +7134,7 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { @@ -6849,6 +7172,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; @@ -7698,6 +8022,7 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { @@ -7735,6 +8060,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; @@ -7843,9 +8169,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -7854,16 +8184,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sfc_start)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_particle_chunk", 1, 4, 4, 1); __PYX_ERR(0, 438, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sfc_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_particle_chunk", 1, 4, 4, 2); __PYX_ERR(0, 438, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else { @@ -9941,9 +10274,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -9952,16 +10289,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sfc_start)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_grid_chunk", 1, 4, 4, 1); __PYX_ERR(0, 543, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sfc_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_grid_chunk", 1, 4, 4, 2); __PYX_ERR(0, 543, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else { @@ -11270,6 +11610,7 @@ 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; } @@ -11287,6 +11628,7 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } @@ -11485,7 +11827,9 @@ 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; } @@ -11494,6 +11838,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_range_size); @@ -11506,6 +11851,7 @@ } 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; @@ -12444,6 +12790,113 @@ return __pyx_r; } +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_39__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_39__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_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_38__reduce_cython__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_38__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__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.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, 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.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables 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("yt.frontends.artio._artio_caller.artio_fileset.__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.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_41__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_41__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_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_40__setstate_cython__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_40__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__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.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, 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.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/frontends/artio/_artio_caller.pyx":696 * * ################################################### @@ -12461,7 +12914,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("artio_is_valid (wrapper)", 0); assert(__pyx_arg_file_prefix); { - __pyx_v_file_prefix = __Pyx_PyObject_AsString(__pyx_arg_file_prefix); if (unlikely((!__pyx_v_file_prefix) && PyErr_Occurred())) __PYX_ERR(0, 696, __pyx_L3_error) + __pyx_v_file_prefix = __Pyx_PyObject_AsWritableString(__pyx_arg_file_prefix); if (unlikely((!__pyx_v_file_prefix) && PyErr_Occurred())) __PYX_ERR(0, 696, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12590,12 +13043,19 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -12604,31 +13064,37 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_dimensions)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_left_edge)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 1); __PYX_ERR(0, 724, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_right_edge)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 2); __PYX_ERR(0, 724, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_artio_handle)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 3); __PYX_ERR(0, 724, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sfc_start)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 4); __PYX_ERR(0, 724, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sfc_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 5); __PYX_ERR(0, 724, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cache_root_mesh); @@ -12641,6 +13107,7 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -14608,6 +15075,113 @@ return __pyx_r; } +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9__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_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_8__reduce_cython__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__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.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, 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.doct_count,self.handle,self.pcount,self.root_mesh_data 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("yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler.__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.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_11__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_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10__setstate_cython__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__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.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, 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.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/frontends/artio/_artio_caller.pyx":868 * self.oct_count = None * @@ -14633,7 +15207,9 @@ 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; } @@ -14642,6 +15218,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--; else { @@ -14773,6 +15350,7 @@ 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; } @@ -15040,7 +15618,7 @@ * super(ARTIOOctreeContainer, self).__init__(dims, DLE, DRE) * self.artio_handle = range_handler.artio_handle # <<<<<<<<<<<<<< * self.level_offset = 1 - * self.domains = NULL + * self.domains = OctObjectPool() */ __pyx_t_4 = ((PyObject *)__pyx_v_range_handler->artio_handle); __Pyx_INCREF(__pyx_t_4); @@ -15054,7 +15632,7 @@ * super(ARTIOOctreeContainer, self).__init__(dims, DLE, DRE) * self.artio_handle = range_handler.artio_handle * self.level_offset = 1 # <<<<<<<<<<<<<< - * self.domains = NULL + * self.domains = OctObjectPool() * self.root_nodes = NULL */ __pyx_v_self->__pyx_base.__pyx_base.level_offset = 1; @@ -15062,15 +15640,21 @@ /* "yt/frontends/artio/_artio_caller.pyx":926 * self.artio_handle = range_handler.artio_handle * self.level_offset = 1 - * self.domains = NULL # <<<<<<<<<<<<<< + * self.domains = OctObjectPool() # <<<<<<<<<<<<<< * self.root_nodes = NULL * */ - __pyx_v_self->__pyx_base.__pyx_base.domains = NULL; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx_base.domains); + __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.domains)); + __pyx_v_self->__pyx_base.__pyx_base.domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_t_4); + __pyx_t_4 = 0; /* "yt/frontends/artio/_artio_caller.pyx":927 * self.level_offset = 1 - * self.domains = NULL + * self.domains = OctObjectPool() * self.root_nodes = NULL # <<<<<<<<<<<<<< * * @cython.boundscheck(False) @@ -15175,7 +15759,7 @@ * * # We only allow one root oct. * self.append_domain(oct_count) # <<<<<<<<<<<<<< - * self.domains[self.num_domains - 1].con_id = sfc + * self.domains.containers[self.num_domains - 1].con_id = sfc * */ ((struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.append_domain(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_oct_count); @@ -15183,14 +15767,14 @@ /* "yt/frontends/artio/_artio_caller.pyx":952 * # We only allow one root oct. * self.append_domain(oct_count) - * self.domains[self.num_domains - 1].con_id = sfc # <<<<<<<<<<<<<< + * self.domains.containers[self.num_domains - 1].con_id = sfc # <<<<<<<<<<<<<< * * oct_ind = -1 */ - (__pyx_v_self->__pyx_base.__pyx_base.domains[(__pyx_v_self->__pyx_base.__pyx_base.num_domains - 1)])->con_id = __pyx_v_sfc; + (__pyx_v_self->__pyx_base.__pyx_base.domains->__pyx_base.containers[(__pyx_v_self->__pyx_base.__pyx_base.num_domains - 1)]).con_id = __pyx_v_sfc; /* "yt/frontends/artio/_artio_caller.pyx":954 - * self.domains[self.num_domains - 1].con_id = sfc + * self.domains.containers[self.num_domains - 1].con_id = sfc * * oct_ind = -1 # <<<<<<<<<<<<<< * ipos = 0 @@ -15433,9 +16017,9 @@ __Pyx_GOTREF(__pyx_t_17); __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); - __Pyx_INCREF(__pyx_slice__29); - __Pyx_GIVEREF(__pyx_slice__29); - PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_slice__29); + __Pyx_INCREF(__pyx_slice__33); + __Pyx_GIVEREF(__pyx_slice__33); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_slice__33); __pyx_t_18 = 0; __pyx_t_18 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_17); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); @@ -15552,7 +16136,7 @@ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.frontends.artio._artio_caller.ARTIOOctreeContainer.initialize_local_mesh", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.frontends.artio._artio_caller.ARTIOOctreeContainer.initialize_local_mesh", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); @@ -15589,11 +16173,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -15602,26 +16192,31 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cell_inds)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fill_sfc", 1, 6, 6, 1); __PYX_ERR(0, 982, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_inds)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fill_sfc", 1, 6, 6, 2); __PYX_ERR(0, 982, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_counts)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fill_sfc", 1, 6, 6, 3); __PYX_ERR(0, 982, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_indices)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fill_sfc", 1, 6, 6, 4); __PYX_ERR(0, 982, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest_fields)) != 0)) kw_args--; else { @@ -15881,7 +16476,7 @@ * source_arrays = [] * ipos = -1 # <<<<<<<<<<<<<< * for i in range(self.num_domains): - * ipos = imax(ipos, self.domains[i].n) + * ipos = imax(ipos, self.domains.containers[i].n) */ __pyx_v_ipos = -1LL; @@ -15889,7 +16484,7 @@ * source_arrays = [] * ipos = -1 * for i in range(self.num_domains): # <<<<<<<<<<<<<< - * ipos = imax(ipos, self.domains[i].n) + * ipos = imax(ipos, self.domains.containers[i].n) * for i in range(nf): */ __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.num_domains; @@ -15899,16 +16494,16 @@ /* "yt/frontends/artio/_artio_caller.pyx":1012 * ipos = -1 * for i in range(self.num_domains): - * ipos = imax(ipos, self.domains[i].n) # <<<<<<<<<<<<<< + * ipos = imax(ipos, self.domains.containers[i].n) # <<<<<<<<<<<<<< * for i in range(nf): * field_ind[i] = field_indices[i] */ - __pyx_v_ipos = __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_v_ipos, (__pyx_v_self->__pyx_base.__pyx_base.domains[__pyx_v_i])->n); + __pyx_v_ipos = __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_v_ipos, (__pyx_v_self->__pyx_base.__pyx_base.domains->__pyx_base.containers[__pyx_v_i]).n); } /* "yt/frontends/artio/_artio_caller.pyx":1013 * for i in range(self.num_domains): - * ipos = imax(ipos, self.domains[i].n) + * ipos = imax(ipos, self.domains.containers[i].n) * for i in range(nf): # <<<<<<<<<<<<<< * field_ind[i] = field_indices[i] * # Note that we subtract one, because we're not using the root mesh. @@ -15918,7 +16513,7 @@ __pyx_v_i = __pyx_t_5; /* "yt/frontends/artio/_artio_caller.pyx":1014 - * ipos = imax(ipos, self.domains[i].n) + * ipos = imax(ipos, self.domains.containers[i].n) * for i in range(nf): * field_ind[i] = field_indices[i] # <<<<<<<<<<<<<< * # Note that we subtract one, because we're not using the root mesh. @@ -16009,26 +16604,26 @@ /* "yt/frontends/artio/_artio_caller.pyx":1032 * # The cons should be in order * cdef np.int64_t sfc_start, sfc_end - * sfc_start = self.domains[0].con_id # <<<<<<<<<<<<<< - * sfc_end = self.domains[self.num_domains - 1].con_id + * sfc_start = self.domains.containers[0].con_id # <<<<<<<<<<<<<< + * sfc_end = self.domains.containers[self.num_domains - 1].con_id * status = artio_grid_cache_sfc_range(handle, sfc_start, sfc_end) */ - __pyx_t_15 = (__pyx_v_self->__pyx_base.__pyx_base.domains[0])->con_id; + __pyx_t_15 = (__pyx_v_self->__pyx_base.__pyx_base.domains->__pyx_base.containers[0]).con_id; __pyx_v_sfc_start = __pyx_t_15; /* "yt/frontends/artio/_artio_caller.pyx":1033 * cdef np.int64_t sfc_start, sfc_end - * sfc_start = self.domains[0].con_id - * sfc_end = self.domains[self.num_domains - 1].con_id # <<<<<<<<<<<<<< + * sfc_start = self.domains.containers[0].con_id + * sfc_end = self.domains.containers[self.num_domains - 1].con_id # <<<<<<<<<<<<<< * status = artio_grid_cache_sfc_range(handle, sfc_start, sfc_end) * check_artio_status(status) */ - __pyx_t_15 = (__pyx_v_self->__pyx_base.__pyx_base.domains[(__pyx_v_self->__pyx_base.__pyx_base.num_domains - 1)])->con_id; + __pyx_t_15 = (__pyx_v_self->__pyx_base.__pyx_base.domains->__pyx_base.containers[(__pyx_v_self->__pyx_base.__pyx_base.num_domains - 1)]).con_id; __pyx_v_sfc_end = __pyx_t_15; /* "yt/frontends/artio/_artio_caller.pyx":1034 - * sfc_start = self.domains[0].con_id - * sfc_end = self.domains[self.num_domains - 1].con_id + * sfc_start = self.domains.containers[0].con_id + * sfc_end = self.domains.containers[self.num_domains - 1].con_id * status = artio_grid_cache_sfc_range(handle, sfc_start, sfc_end) # <<<<<<<<<<<<<< * check_artio_status(status) * cdef np.int64_t offset = 0 @@ -16036,7 +16631,7 @@ __pyx_v_status = artio_grid_cache_sfc_range(__pyx_v_handle, __pyx_v_sfc_start, __pyx_v_sfc_end); /* "yt/frontends/artio/_artio_caller.pyx":1035 - * sfc_end = self.domains[self.num_domains - 1].con_id + * sfc_end = self.domains.containers[self.num_domains - 1].con_id * status = artio_grid_cache_sfc_range(handle, sfc_start, sfc_end) * check_artio_status(status) # <<<<<<<<<<<<<< * cdef np.int64_t offset = 0 @@ -16049,7 +16644,7 @@ * check_artio_status(status) * cdef np.int64_t offset = 0 # <<<<<<<<<<<<<< * for si in range(self.num_domains): - * sfc = self.domains[si].con_id + * sfc = self.domains.containers[si].con_id */ __pyx_v_offset = 0; @@ -16057,7 +16652,7 @@ * check_artio_status(status) * cdef np.int64_t offset = 0 * for si in range(self.num_domains): # <<<<<<<<<<<<<< - * sfc = self.domains[si].con_id + * sfc = self.domains.containers[si].con_id * status = artio_grid_read_root_cell_begin( handle, sfc, */ __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.num_domains; @@ -16067,16 +16662,16 @@ /* "yt/frontends/artio/_artio_caller.pyx":1038 * cdef np.int64_t offset = 0 * for si in range(self.num_domains): - * sfc = self.domains[si].con_id # <<<<<<<<<<<<<< + * sfc = self.domains.containers[si].con_id # <<<<<<<<<<<<<< * status = artio_grid_read_root_cell_begin( handle, sfc, * dpos, NULL, &num_oct_levels, num_octs_per_level) */ - __pyx_t_15 = (__pyx_v_self->__pyx_base.__pyx_base.domains[__pyx_v_si])->con_id; + __pyx_t_15 = (__pyx_v_self->__pyx_base.__pyx_base.domains->__pyx_base.containers[__pyx_v_si]).con_id; __pyx_v_sfc = __pyx_t_15; /* "yt/frontends/artio/_artio_caller.pyx":1039 * for si in range(self.num_domains): - * sfc = self.domains[si].con_id + * sfc = self.domains.containers[si].con_id * status = artio_grid_read_root_cell_begin( handle, sfc, # <<<<<<<<<<<<<< * dpos, NULL, &num_oct_levels, num_octs_per_level) * check_artio_status(status) @@ -16666,6 +17261,113 @@ return __pyx_r; } +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_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_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_6__reduce_cython__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__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.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, 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.root_mesh,self.root_nodes,self.tree_root 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("yt.frontends.artio._artio_caller.ARTIOOctreeContainer.__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.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_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_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_8__setstate_cython__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__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.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, 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.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOOctreeContainer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/frontends/artio/_artio_caller.pyx":1087 * @cython.wraparound(False) * @cython.cdivision(True) @@ -16853,7 +17555,7 @@ * * # Now we set up our field pointers */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __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; @@ -18767,6 +19469,7 @@ 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; } @@ -19339,7 +20042,7 @@ __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_WriteUnraisable("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.count_cells", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.count_cells", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -19371,8 +20074,11 @@ 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; } @@ -19381,11 +20087,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells); if (value) { values[1] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -19398,7 +20106,9 @@ } 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); + CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -19794,8 +20504,11 @@ 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; } @@ -19804,11 +20517,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells); if (value) { values[1] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -19821,7 +20536,9 @@ } 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); + CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -20217,8 +20934,11 @@ 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; } @@ -20227,11 +20947,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells); if (value) { values[1] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -20244,7 +20966,9 @@ } 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); + CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -20477,9 +21201,9 @@ __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_slice__31); - __Pyx_GIVEREF(__pyx_slice__31); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__31); + __Pyx_INCREF(__pyx_slice__37); + __Pyx_GIVEREF(__pyx_slice__37); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__37); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __pyx_t_4 = 0; @@ -20560,8 +21284,11 @@ 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; } @@ -20570,11 +21297,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells); if (value) { values[1] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -20587,7 +21316,9 @@ } 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); + CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -20872,11 +21603,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -20885,26 +21622,31 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("selector_fill", 0, 2, 6, 1); __PYX_ERR(0, 1422, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest); if (value) { values[2] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dims); if (value) { values[4] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -20917,9 +21659,13 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; @@ -21494,8 +22240,11 @@ 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; } @@ -21504,11 +22253,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells); if (value) { values[1] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -21521,7 +22272,9 @@ } 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); + CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -21770,7 +22523,7 @@ */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1489, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_3); @@ -21942,7 +22695,9 @@ 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; } @@ -21951,6 +22706,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_indices)) != 0)) kw_args--; else { @@ -22700,9 +23456,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -22711,16 +23471,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdeposit)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("deposit", 1, 4, 4, 1); __PYX_ERR(0, 1576, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("deposit", 1, 4, 4, 2); __PYX_ERR(0, 1576, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else { @@ -23425,7 +24188,7 @@ * offset, pos, field_vals, sfc) * if pdeposit.update_values == 1: */ - ((struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *)__pyx_v_pdeposit->__pyx_vtab)->process(__pyx_v_pdeposit, __pyx_v_dims, __pyx_v_left_edge, __pyx_v_self->dds, __pyx_v_offset, __pyx_v_pos, __pyx_v_field_vals, __pyx_v_sfc); + __pyx_t_21 = ((struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *)__pyx_v_pdeposit->__pyx_vtab)->process(__pyx_v_pdeposit, __pyx_v_dims, __pyx_v_left_edge, __pyx_v_self->dds, __pyx_v_offset, __pyx_v_pos, __pyx_v_field_vals, __pyx_v_sfc); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 1624, __pyx_L1_error) /* "yt/frontends/artio/_artio_caller.pyx":1626 * pdeposit.process(dims, left_edge, self.dds, @@ -23825,6 +24588,113 @@ return __pyx_r; } +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.handle cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_23__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_23__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_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_22__reduce_cython__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__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.handle cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.handle cannot be converted to a Python object for pickling") + */ + __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("self.handle 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("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.__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.handle cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.handle cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_25__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_25__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_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_24__setstate_cython__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__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.handle cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.handle cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __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("self.handle cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.handle cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/frontends/artio/_artio_caller.pyx":1637 * cdef np.int64_t sfc_start, sfc_end * @@ -23848,6 +24718,7 @@ 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; } @@ -24001,8 +24872,11 @@ 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; } @@ -24011,11 +24885,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 1647, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else { @@ -24458,102 +25334,2109 @@ return __pyx_r; } -/* "oct_visitors.pxd":51 - * cdef void visit(self, Oct*, np.uint8_t selected) - * - * cdef inline int oind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self._hash, self._hash_initialized, self.base_selector, self.domain_width, self.max_level, self.mesh_container, self.min_level, self.overlap_cells, self.periodicity, self.range_handler, self.sfc_end, self.sfc_start) */ -static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { - int __pyx_v_d; - int __pyx_r; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("oind", 0); - - /* "oct_visitors.pxd":52 - * - * cdef inline int oind(self): - * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - * - */ - __pyx_v_d = (1 << __pyx_v_self->oref); - - /* "oct_visitors.pxd":53 - * cdef inline int oind(self): - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) # <<<<<<<<<<<<<< - * - * cdef inline int rind(self): - */ - __pyx_r = (((((__pyx_v_self->ind[0]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[2])); - goto __pyx_L0; - - /* "oct_visitors.pxd":51 - * cdef void visit(self, Oct*, np.uint8_t selected) - * - * cdef inline int oind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - */ + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_6__reduce_cython__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)__pyx_v_self)); /* function exit code */ - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "oct_visitors.pxd":55 - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - * - * cdef inline int rind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_6__reduce_cython__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__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; + int __pyx_t_13; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self._hash, self._hash_initialized, self.base_selector, self.domain_width, self.max_level, self.mesh_container, self.min_level, self.overlap_cells, self.periodicity, self.range_handler, self.sfc_end, self.sfc_start) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base._hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base._hash_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_carray_to_py___pyx_t_5numpy_float64_t(__pyx_v_self->__pyx_base.domain_width, 3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.max_level); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.min_level); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.overlap_cells); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_carray_to_py_int(__pyx_v_self->__pyx_base.periodicity, 3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->sfc_end); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->sfc_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(12); 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_INCREF(((PyObject *)__pyx_v_self->base_selector)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->base_selector)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_self->base_selector)); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_self->mesh_container)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->mesh_container)); + PyTuple_SET_ITEM(__pyx_t_10, 5, ((PyObject *)__pyx_v_self->mesh_container)); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_7); + __Pyx_INCREF(((PyObject *)__pyx_v_self->range_handler)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->range_handler)); + PyTuple_SET_ITEM(__pyx_t_10, 9, ((PyObject *)__pyx_v_self->range_handler)); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 10, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 11, __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; -static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { - int __pyx_v_d; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rind", 0); + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self._hash, self._hash_initialized, self.base_selector, self.domain_width, self.max_level, self.mesh_container, self.min_level, self.overlap_cells, self.periodicity, self.range_handler, self.sfc_end, self.sfc_start) + * _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; - /* "oct_visitors.pxd":56 - * - * cdef inline int rind(self): - * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) - * + /* "(tree fragment)":5 + * state = (self._hash, self._hash_initialized, self.base_selector, self.domain_width, self.max_level, self.mesh_container, self.min_level, self.overlap_cells, self.periodicity, self.range_handler, self.sfc_end, self.sfc_start) + * _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_v_d = (1 << __pyx_v_self->oref); + __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; - /* "oct_visitors.pxd":57 - * cdef inline int rind(self): - * cdef int d = (1 << self.oref) - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) # <<<<<<<<<<<<<< - * - * cdef class CountTotalOcts(OctVisitor): + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.base_selector is not None or self.mesh_container is not None or self.range_handler is not None + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":5 + * state = (self._hash, self._hash_initialized, self.base_selector, self.domain_width, self.max_level, self.mesh_container, self.min_level, self.overlap_cells, self.periodicity, self.range_handler, self.sfc_end, self.sfc_start) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - __pyx_r = (((((__pyx_v_self->ind[2]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[0])); - goto __pyx_L0; + goto __pyx_L3; + } - /* "oct_visitors.pxd":55 - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - * - * cdef inline int rind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = self.base_selector is not None or self.mesh_container is not None or self.range_handler is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_SFCRangeSelector, (type(self), 0xde40fc3, None), state */ + /*else*/ { + __pyx_t_11 = (((PyObject *)__pyx_v_self->base_selector) != Py_None); + __pyx_t_13 = (__pyx_t_11 != 0); + if (!__pyx_t_13) { + } else { + __pyx_t_12 = __pyx_t_13; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_13 = (((PyObject *)__pyx_v_self->mesh_container) != Py_None); + __pyx_t_11 = (__pyx_t_13 != 0); + if (!__pyx_t_11) { + } else { + __pyx_t_12 = __pyx_t_11; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_11 = (((PyObject *)__pyx_v_self->range_handler) != Py_None); + __pyx_t_13 = (__pyx_t_11 != 0); + __pyx_t_12 = __pyx_t_13; + __pyx_L4_bool_binop_done:; + __pyx_v_use_setstate = __pyx_t_12; + } + __pyx_L3:; - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; + /* "(tree fragment)":10 + * else: + * use_setstate = self.base_selector is not None or self.mesh_container is not None or self.range_handler is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_SFCRangeSelector, (type(self), 0xde40fc3, None), state + * else: + */ + __pyx_t_12 = (__pyx_v_use_setstate != 0); + if (__pyx_t_12) { + + /* "(tree fragment)":11 + * use_setstate = self.base_selector is not None or self.mesh_container is not None or self.range_handler is not None + * if use_setstate: + * return __pyx_unpickle_SFCRangeSelector, (type(self), 0xde40fc3, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_SFCRangeSelector, (type(self), 0xde40fc3, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_SFCRangeSelector); 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_233050051); + __Pyx_GIVEREF(__pyx_int_233050051); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_233050051); + __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 = self.base_selector is not None or self.mesh_container is not None or self.range_handler is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_SFCRangeSelector, (type(self), 0xde40fc3, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_SFCRangeSelector, (type(self), 0xde40fc3, None), state + * else: + * return __pyx_unpickle_SFCRangeSelector, (type(self), 0xde40fc3, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_SFCRangeSelector__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_SFCRangeSelector); 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_233050051); + __Pyx_GIVEREF(__pyx_int_233050051); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_233050051); + __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._hash, self._hash_initialized, self.base_selector, self.domain_width, self.max_level, self.mesh_container, self.min_level, self.overlap_cells, self.periodicity, self.range_handler, self.sfc_end, self.sfc_start) + */ + + /* 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("yt.frontends.artio._artio_caller.SFCRangeSelector.__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_SFCRangeSelector, (type(self), 0xde40fc3, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_SFCRangeSelector__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_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_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_8__setstate_cython__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_8__setstate_cython__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__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_SFCRangeSelector, (type(self), 0xde40fc3, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_SFCRangeSelector__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_2yt_9frontends_5artio_13_artio_caller___pyx_unpickle_SFCRangeSelector__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_SFCRangeSelector, (type(self), 0xde40fc3, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_SFCRangeSelector__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("yt.frontends.artio._artio_caller.SFCRangeSelector.__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_SFCRangeSelector(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xde40fc3: + * from pickle import PickleError + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_5__pyx_unpickle_SFCRangeSelector(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9frontends_5artio_13_artio_caller_5__pyx_unpickle_SFCRangeSelector = {"__pyx_unpickle_SFCRangeSelector", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_5__pyx_unpickle_SFCRangeSelector, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_5__pyx_unpickle_SFCRangeSelector(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_SFCRangeSelector (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SFCRangeSelector", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SFCRangeSelector", 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_SFCRangeSelector") < 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_SFCRangeSelector", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.frontends.artio._artio_caller.__pyx_unpickle_SFCRangeSelector", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_4__pyx_unpickle_SFCRangeSelector(__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_2yt_9frontends_5artio_13_artio_caller_4__pyx_unpickle_SFCRangeSelector(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_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_SFCRangeSelector", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_SFCRangeSelector(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xde40fc3: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xde40fc3 = (_hash, _hash_initialized, base_selector, domain_width, max_level, mesh_container, min_level, overlap_cells, periodicity, range_handler, sfc_end, sfc_start))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xde40fc3) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_SFCRangeSelector(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xde40fc3: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xde40fc3 = (_hash, _hash_initialized, base_selector, domain_width, max_level, mesh_container, min_level, overlap_cells, periodicity, range_handler, sfc_end, sfc_start))" % __pyx_checksum) + * result = SFCRangeSelector.__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_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 != 0xde40fc3: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xde40fc3 = (_hash, _hash_initialized, base_selector, domain_width, max_level, mesh_container, min_level, overlap_cells, periodicity, range_handler, sfc_end, sfc_start))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = SFCRangeSelector.__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_0xde, __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_PickleError); + __pyx_t_2 = __pyx_v_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_SFCRangeSelector(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xde40fc3: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xde40fc3 = (_hash, _hash_initialized, base_selector, domain_width, max_level, mesh_container, min_level, overlap_cells, periodicity, range_handler, sfc_end, sfc_start))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xde40fc3 = (_hash, _hash_initialized, base_selector, domain_width, max_level, mesh_container, min_level, overlap_cells, periodicity, range_handler, sfc_end, sfc_start))" % __pyx_checksum) + * result = SFCRangeSelector.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_SFCRangeSelector__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector), __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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xde40fc3 = (_hash, _hash_initialized, base_selector, domain_width, max_level, mesh_container, min_level, overlap_cells, periodicity, range_handler, sfc_end, sfc_start))" % __pyx_checksum) + * result = SFCRangeSelector.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_SFCRangeSelector__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = SFCRangeSelector.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_SFCRangeSelector__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_SFCRangeSelector__set_state(SFCRangeSelector 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_2yt_9frontends_5artio_13_artio_caller___pyx_unpickle_SFCRangeSelector__set_state(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)__pyx_v_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 PickleError("Incompatible checksums (%s vs 0xde40fc3 = (_hash, _hash_initialized, base_selector, domain_width, max_level, mesh_container, min_level, overlap_cells, periodicity, range_handler, sfc_end, sfc_start))" % __pyx_checksum) + * result = SFCRangeSelector.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_SFCRangeSelector__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_SFCRangeSelector__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_SFCRangeSelector__set_state(SFCRangeSelector result, tuple __pyx_state): + * result._hash = __pyx_state[0]; result._hash_initialized = __pyx_state[1]; result.base_selector = __pyx_state[2]; result.domain_width = __pyx_state[3]; result.max_level = __pyx_state[4]; result.mesh_container = __pyx_state[5]; result.min_level = __pyx_state[6]; result.overlap_cells = __pyx_state[7]; result.periodicity = __pyx_state[8]; result.range_handler = __pyx_state[9]; result.sfc_end = __pyx_state[10]; result.sfc_start = __pyx_state[11] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_SFCRangeSelector(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xde40fc3: + * from pickle import 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("yt.frontends.artio._artio_caller.__pyx_unpickle_SFCRangeSelector", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_SFCRangeSelector__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_SFCRangeSelector__set_state(SFCRangeSelector result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result._hash = __pyx_state[0]; result._hash_initialized = __pyx_state[1]; result.base_selector = __pyx_state[2]; result.domain_width = __pyx_state[3]; result.max_level = __pyx_state[4]; result.mesh_container = __pyx_state[5]; result.min_level = __pyx_state[6]; result.overlap_cells = __pyx_state[7]; result.periodicity = __pyx_state[8]; result.range_handler = __pyx_state[9]; result.sfc_end = __pyx_state[10]; result.sfc_start = __pyx_state[11] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_f_2yt_9frontends_5artio_13_artio_caller___pyx_unpickle_SFCRangeSelector__set_state(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_2; + int __pyx_t_3; + __pyx_t_5numpy_float64_t __pyx_t_4[3]; + __pyx_t_5numpy_int32_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7[3]; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_SFCRangeSelector__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_SFCRangeSelector__set_state(SFCRangeSelector result, tuple __pyx_state): + * result._hash = __pyx_state[0]; result._hash_initialized = __pyx_state[1]; result.base_selector = __pyx_state[2]; result.domain_width = __pyx_state[3]; result.max_level = __pyx_state[4]; result.mesh_container = __pyx_state[5]; result.min_level = __pyx_state[6]; result.overlap_cells = __pyx_state[7]; result.periodicity = __pyx_state[8]; result.range_handler = __pyx_state[9]; result.sfc_end = __pyx_state[10]; result.sfc_start = __pyx_state[11] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[12]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base._hash = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base._hash_initialized = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_result->base_selector); + __Pyx_DECREF(((PyObject *)__pyx_v_result->base_selector)); + __pyx_v_result->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_float64_t(__pyx_t_1, __pyx_t_4, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.domain_width[0]), __pyx_t_4, sizeof(__pyx_v_result->__pyx_base.domain_width[0]) * (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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_5 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.max_level = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer))))) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_result->mesh_container); + __Pyx_DECREF(((PyObject *)__pyx_v_result->mesh_container)); + __pyx_v_result->mesh_container = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_5 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.min_level = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.overlap_cells = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py_int(__pyx_t_1, __pyx_t_7, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.periodicity[0]), __pyx_t_7, sizeof(__pyx_v_result->__pyx_base.periodicity[0]) * (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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler))))) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_result->range_handler); + __Pyx_DECREF(((PyObject *)__pyx_v_result->range_handler)); + __pyx_v_result->range_handler = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->sfc_end = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->sfc_start = __pyx_t_2; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_SFCRangeSelector__set_state(SFCRangeSelector result, tuple __pyx_state): + * result._hash = __pyx_state[0]; result._hash_initialized = __pyx_state[1]; result.base_selector = __pyx_state[2]; result.domain_width = __pyx_state[3]; result.max_level = __pyx_state[4]; result.mesh_container = __pyx_state[5]; result.min_level = __pyx_state[6]; result.overlap_cells = __pyx_state[7]; result.periodicity = __pyx_state[8]; result.range_handler = __pyx_state[9]; result.sfc_end = __pyx_state[10]; result.sfc_start = __pyx_state[11] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[12]) + */ + __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_3 != 0); + if (__pyx_t_8) { + + /* "(tree fragment)":12 + * result._hash = __pyx_state[0]; result._hash_initialized = __pyx_state[1]; result.base_selector = __pyx_state[2]; result.domain_width = __pyx_state[3]; result.max_level = __pyx_state[4]; result.mesh_container = __pyx_state[5]; result.min_level = __pyx_state[6]; result.overlap_cells = __pyx_state[7]; result.periodicity = __pyx_state[8]; result.range_handler = __pyx_state[9]; result.sfc_end = __pyx_state[10]; result.sfc_start = __pyx_state[11] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[12]) # <<<<<<<<<<<<<< + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_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 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + } + } + if (!__pyx_t_11) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_10)) { + PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_9}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { + PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_9}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else + #endif + { + __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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_SFCRangeSelector__set_state(SFCRangeSelector result, tuple __pyx_state): + * result._hash = __pyx_state[0]; result._hash_initialized = __pyx_state[1]; result.base_selector = __pyx_state[2]; result.domain_width = __pyx_state[3]; result.max_level = __pyx_state[4]; result.mesh_container = __pyx_state[5]; result.min_level = __pyx_state[6]; result.overlap_cells = __pyx_state[7]; result.periodicity = __pyx_state[8]; result.range_handler = __pyx_state[9]; result.sfc_end = __pyx_state[10]; result.sfc_start = __pyx_state[11] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[12]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_SFCRangeSelector__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_SFCRangeSelector__set_state(SFCRangeSelector result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result._hash = __pyx_state[0]; result._hash_initialized = __pyx_state[1]; result.base_selector = __pyx_state[2]; result.domain_width = __pyx_state[3]; result.max_level = __pyx_state[4]; result.mesh_container = __pyx_state[5]; result.min_level = __pyx_state[6]; result.overlap_cells = __pyx_state[7]; result.periodicity = __pyx_state[8]; result.range_handler = __pyx_state[9]; result.sfc_end = __pyx_state[10]; result.sfc_start = __pyx_state[11] + * if hasattr(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_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("yt.frontends.artio._artio_caller.__pyx_unpickle_SFCRangeSelector__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pxd":29 + * void *alloca(int) + * + * cdef inline int gind(int i, int j, int k, int dims[3]): # <<<<<<<<<<<<<< + * # The ordering is such that we want i to vary the slowest in this instance, + * # even though in other instances it varies the fastest. To see this in + */ + +static CYTHON_INLINE int __pyx_f_2yt_8geometry_16particle_deposit_gind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dims) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("gind", 0); + + /* "yt/geometry/particle_deposit.pxd":34 + * # action, try looking at the results of an n_ref=256 particle CIC plot, + * # which shows it the most clearly. + * return ((i*dims[1])+j)*dims[2]+k # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((((__pyx_v_i * (__pyx_v_dims[1])) + __pyx_v_j) * (__pyx_v_dims[2])) + __pyx_v_k); + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":29 + * void *alloca(int) + * + * cdef inline int gind(int i, int j, int k, int dims[3]): # <<<<<<<<<<<<<< + * # The ordering is such that we want i to vary the slowest in this instance, + * # even though in other instances it varies the fastest. To see this in + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pxd":41 + * #################################################### + * + * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + + /* "yt/geometry/particle_deposit.pxd":43 + * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 # <<<<<<<<<<<<<< + * if x <= 0.5: + * kernel = 1.-6.*x*x*(1.-x) + */ + __pyx_v_C = 2.5464790894703255; + + /* "yt/geometry/particle_deposit.pxd":44 + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 + * if x <= 0.5: # <<<<<<<<<<<<<< + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: + */ + __pyx_t_1 = ((__pyx_v_x <= 0.5) != 0); + if (__pyx_t_1) { + + /* "yt/geometry/particle_deposit.pxd":45 + * cdef np.float64_t C = 2.5464790894703255 + * if x <= 0.5: + * kernel = 1.-6.*x*x*(1.-x) # <<<<<<<<<<<<<< + * elif x>0.5 and x<=1.0: + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) + */ + __pyx_v_kernel = (1. - (((6. * __pyx_v_x) * __pyx_v_x) * (1. - __pyx_v_x))); + + /* "yt/geometry/particle_deposit.pxd":44 + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 + * if x <= 0.5: # <<<<<<<<<<<<<< + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: + */ + goto __pyx_L3; + } + + /* "yt/geometry/particle_deposit.pxd":46 + * if x <= 0.5: + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: # <<<<<<<<<<<<<< + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) + * else: + */ + __pyx_t_2 = ((__pyx_v_x > 0.5) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_x <= 1.0) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "yt/geometry/particle_deposit.pxd":47 + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) # <<<<<<<<<<<<<< + * else: + * kernel = 0. + */ + __pyx_v_kernel = (((2. * (1. - __pyx_v_x)) * (1. - __pyx_v_x)) * (1. - __pyx_v_x)); + + /* "yt/geometry/particle_deposit.pxd":46 + * if x <= 0.5: + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: # <<<<<<<<<<<<<< + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) + * else: + */ + goto __pyx_L3; + } + + /* "yt/geometry/particle_deposit.pxd":49 + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C + * + */ + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; + + /* "yt/geometry/particle_deposit.pxd":50 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< + * + * ######################################################## + */ + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":41 + * #################################################### + * + * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pxd":57 + * + * # quartic spline + * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_quartic", 0); + + /* "yt/geometry/particle_deposit.pxd":59 + * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**4 + */ + __pyx_t_1 = PyFloat_FromDouble((pow(5., 6.0) / 512.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(2, 59, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; + + /* "yt/geometry/particle_deposit.pxd":60 + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**4 + * if x < 3./5: + */ + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":61 + * cdef np.float64_t C = 5.**6/512/np.pi + * if x < 1: + * kernel = (1.-x)**4 # <<<<<<<<<<<<<< + * if x < 3./5: + * kernel -= 5*(3./5-x)**4 + */ + __pyx_v_kernel = pow((1. - __pyx_v_x), 4.0); + + /* "yt/geometry/particle_deposit.pxd":62 + * if x < 1: + * kernel = (1.-x)**4 + * if x < 3./5: # <<<<<<<<<<<<<< + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: + */ + __pyx_t_5 = ((__pyx_v_x < (3. / 5.0)) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":63 + * kernel = (1.-x)**4 + * if x < 3./5: + * kernel -= 5*(3./5-x)**4 # <<<<<<<<<<<<<< + * if x < 1./5: + * kernel += 10*(1./5-x)**4 + */ + __pyx_v_kernel = (__pyx_v_kernel - (5.0 * pow(((3. / 5.0) - __pyx_v_x), 4.0))); + + /* "yt/geometry/particle_deposit.pxd":64 + * if x < 3./5: + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: # <<<<<<<<<<<<<< + * kernel += 10*(1./5-x)**4 + * else: + */ + __pyx_t_5 = ((__pyx_v_x < (1. / 5.0)) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":65 + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: + * kernel += 10*(1./5-x)**4 # <<<<<<<<<<<<<< + * else: + * kernel = 0. + */ + __pyx_v_kernel = (__pyx_v_kernel + (10.0 * pow(((1. / 5.0) - __pyx_v_x), 4.0))); + + /* "yt/geometry/particle_deposit.pxd":64 + * if x < 3./5: + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: # <<<<<<<<<<<<<< + * kernel += 10*(1./5-x)**4 + * else: + */ + } + + /* "yt/geometry/particle_deposit.pxd":62 + * if x < 1: + * kernel = (1.-x)**4 + * if x < 3./5: # <<<<<<<<<<<<<< + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: + */ + } + + /* "yt/geometry/particle_deposit.pxd":60 + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**4 + * if x < 3./5: + */ + goto __pyx_L3; + } + + /* "yt/geometry/particle_deposit.pxd":67 + * kernel += 10*(1./5-x)**4 + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C + * + */ + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; + + /* "yt/geometry/particle_deposit.pxd":68 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< + * + * # quintic spline + */ + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":57 + * + * # quartic spline + * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quartic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pxd":71 + * + * # quintic spline + * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_quintic", 0); + + /* "yt/geometry/particle_deposit.pxd":73 + * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**5 + */ + __pyx_t_1 = PyFloat_FromDouble((pow(3., 7.0) / 40.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(2, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; + + /* "yt/geometry/particle_deposit.pxd":74 + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**5 + * if x < 2./3: + */ + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":75 + * cdef np.float64_t C = 3.**7/40/np.pi + * if x < 1: + * kernel = (1.-x)**5 # <<<<<<<<<<<<<< + * if x < 2./3: + * kernel -= 6*(2./3-x)**5 + */ + __pyx_v_kernel = pow((1. - __pyx_v_x), 5.0); + + /* "yt/geometry/particle_deposit.pxd":76 + * if x < 1: + * kernel = (1.-x)**5 + * if x < 2./3: # <<<<<<<<<<<<<< + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: + */ + __pyx_t_5 = ((__pyx_v_x < (2. / 3.0)) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":77 + * kernel = (1.-x)**5 + * if x < 2./3: + * kernel -= 6*(2./3-x)**5 # <<<<<<<<<<<<<< + * if x < 1./3: + * kernel += 15*(1./3-x)**5 + */ + __pyx_v_kernel = (__pyx_v_kernel - (6.0 * pow(((2. / 3.0) - __pyx_v_x), 5.0))); + + /* "yt/geometry/particle_deposit.pxd":78 + * if x < 2./3: + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: # <<<<<<<<<<<<<< + * kernel += 15*(1./3-x)**5 + * else: + */ + __pyx_t_5 = ((__pyx_v_x < (1. / 3.0)) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":79 + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: + * kernel += 15*(1./3-x)**5 # <<<<<<<<<<<<<< + * else: + * kernel = 0. + */ + __pyx_v_kernel = (__pyx_v_kernel + (15.0 * pow(((1. / 3.0) - __pyx_v_x), 5.0))); + + /* "yt/geometry/particle_deposit.pxd":78 + * if x < 2./3: + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: # <<<<<<<<<<<<<< + * kernel += 15*(1./3-x)**5 + * else: + */ + } + + /* "yt/geometry/particle_deposit.pxd":76 + * if x < 1: + * kernel = (1.-x)**5 + * if x < 2./3: # <<<<<<<<<<<<<< + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: + */ + } + + /* "yt/geometry/particle_deposit.pxd":74 + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**5 + * if x < 2./3: + */ + goto __pyx_L3; + } + + /* "yt/geometry/particle_deposit.pxd":81 + * kernel += 15*(1./3-x)**5 + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C + * + */ + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; + + /* "yt/geometry/particle_deposit.pxd":82 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< + * + * # Wendland C2 + */ + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":71 + * + * # quintic spline + * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quintic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pxd":85 + * + * # Wendland C2 + * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_wendland2", 0); + + /* "yt/geometry/particle_deposit.pxd":87 + * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**4 * (1+4*x) + */ + __pyx_t_1 = PyFloat_FromDouble((21. / 2.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(2, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; + + /* "yt/geometry/particle_deposit.pxd":88 + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**4 * (1+4*x) + * else: + */ + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":89 + * cdef np.float64_t C = 21./2/np.pi + * if x < 1: + * kernel = (1.-x)**4 * (1+4*x) # <<<<<<<<<<<<<< + * else: + * kernel = 0. + */ + __pyx_v_kernel = (pow((1. - __pyx_v_x), 4.0) * (1.0 + (4.0 * __pyx_v_x))); + + /* "yt/geometry/particle_deposit.pxd":88 + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**4 * (1+4*x) + * else: + */ + goto __pyx_L3; + } + + /* "yt/geometry/particle_deposit.pxd":91 + * kernel = (1.-x)**4 * (1+4*x) + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C + * + */ + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; + + /* "yt/geometry/particle_deposit.pxd":92 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< + * + * # Wendland C4 + */ + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":85 + * + * # Wendland C2 + * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland2", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pxd":95 + * + * # Wendland C4 + * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_wendland4", 0); + + /* "yt/geometry/particle_deposit.pxd":97 + * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) + */ + __pyx_t_1 = PyFloat_FromDouble((495. / 32.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(2, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; + + /* "yt/geometry/particle_deposit.pxd":98 + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) + * else: + */ + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":99 + * cdef np.float64_t C = 495./32/np.pi + * if x < 1: + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) # <<<<<<<<<<<<<< + * else: + * kernel = 0. + */ + __pyx_v_kernel = (pow((1. - __pyx_v_x), 6.0) * ((1.0 + (6.0 * __pyx_v_x)) + ((35. / 3.0) * pow(__pyx_v_x, 2.0)))); + + /* "yt/geometry/particle_deposit.pxd":98 + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) + * else: + */ + goto __pyx_L3; + } + + /* "yt/geometry/particle_deposit.pxd":101 + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C + * + */ + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; + + /* "yt/geometry/particle_deposit.pxd":102 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< + * + * # Wendland C6 + */ + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":95 + * + * # Wendland C4 + * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland4", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pxd":105 + * + * # Wendland C6 + * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_wendland6", 0); + + /* "yt/geometry/particle_deposit.pxd":107 + * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + */ + __pyx_t_1 = PyFloat_FromDouble((1365. / 64.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(2, 107, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; + + /* "yt/geometry/particle_deposit.pxd":108 + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + * else: + */ + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":109 + * cdef np.float64_t C = 1365./64/np.pi + * if x < 1: + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) # <<<<<<<<<<<<<< + * else: + * kernel = 0. + */ + __pyx_v_kernel = (pow((1. - __pyx_v_x), 8.0) * (((1.0 + (8.0 * __pyx_v_x)) + (25.0 * pow(__pyx_v_x, 2.0))) + (32.0 * pow(__pyx_v_x, 3.0)))); + + /* "yt/geometry/particle_deposit.pxd":108 + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + * else: + */ + goto __pyx_L3; + } + + /* "yt/geometry/particle_deposit.pxd":111 + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C + * + */ + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; + + /* "yt/geometry/particle_deposit.pxd":112 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< + * + * # I don't know the way to use a dict in a cdef class. + */ + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":105 + * + * # Wendland C6 + * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland6", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pxd":118 + * # I manually created a function to lookup the kernel functions. + * ctypedef np.float64_t (*kernel_func) (np.float64_t) + * cdef inline kernel_func get_kernel_func(str kernel_name): # <<<<<<<<<<<<<< + * if kernel_name == 'cubic': + * return sph_kernel_cubic + */ + +static CYTHON_INLINE __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(PyObject *__pyx_v_kernel_name) { + __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("get_kernel_func", 0); + + /* "yt/geometry/particle_deposit.pxd":119 + * ctypedef np.float64_t (*kernel_func) (np.float64_t) + * cdef inline kernel_func get_kernel_func(str kernel_name): + * if kernel_name == 'cubic': # <<<<<<<<<<<<<< + * return sph_kernel_cubic + * elif kernel_name == 'quartic': + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_cubic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 119, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "yt/geometry/particle_deposit.pxd":120 + * cdef inline kernel_func get_kernel_func(str kernel_name): + * if kernel_name == 'cubic': + * return sph_kernel_cubic # <<<<<<<<<<<<<< + * elif kernel_name == 'quartic': + * return sph_kernel_quartic + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":119 + * ctypedef np.float64_t (*kernel_func) (np.float64_t) + * cdef inline kernel_func get_kernel_func(str kernel_name): + * if kernel_name == 'cubic': # <<<<<<<<<<<<<< + * return sph_kernel_cubic + * elif kernel_name == 'quartic': + */ + } + + /* "yt/geometry/particle_deposit.pxd":121 + * if kernel_name == 'cubic': + * return sph_kernel_cubic + * elif kernel_name == 'quartic': # <<<<<<<<<<<<<< + * return sph_kernel_quartic + * elif kernel_name == 'quintic': + */ + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quartic, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 121, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "yt/geometry/particle_deposit.pxd":122 + * return sph_kernel_cubic + * elif kernel_name == 'quartic': + * return sph_kernel_quartic # <<<<<<<<<<<<<< + * elif kernel_name == 'quintic': + * return sph_kernel_quintic + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":121 + * if kernel_name == 'cubic': + * return sph_kernel_cubic + * elif kernel_name == 'quartic': # <<<<<<<<<<<<<< + * return sph_kernel_quartic + * elif kernel_name == 'quintic': + */ + } + + /* "yt/geometry/particle_deposit.pxd":123 + * elif kernel_name == 'quartic': + * return sph_kernel_quartic + * elif kernel_name == 'quintic': # <<<<<<<<<<<<<< + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quintic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 123, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "yt/geometry/particle_deposit.pxd":124 + * return sph_kernel_quartic + * elif kernel_name == 'quintic': + * return sph_kernel_quintic # <<<<<<<<<<<<<< + * elif kernel_name == 'wendland2': + * return sph_kernel_wendland2 + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":123 + * elif kernel_name == 'quartic': + * return sph_kernel_quartic + * elif kernel_name == 'quintic': # <<<<<<<<<<<<<< + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': + */ + } + + /* "yt/geometry/particle_deposit.pxd":125 + * elif kernel_name == 'quintic': + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': # <<<<<<<<<<<<<< + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': + */ + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 125, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "yt/geometry/particle_deposit.pxd":126 + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': + * return sph_kernel_wendland2 # <<<<<<<<<<<<<< + * elif kernel_name == 'wendland4': + * return sph_kernel_wendland4 + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":125 + * elif kernel_name == 'quintic': + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': # <<<<<<<<<<<<<< + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': + */ + } + + /* "yt/geometry/particle_deposit.pxd":127 + * elif kernel_name == 'wendland2': + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': # <<<<<<<<<<<<<< + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 127, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "yt/geometry/particle_deposit.pxd":128 + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': + * return sph_kernel_wendland4 # <<<<<<<<<<<<<< + * elif kernel_name == 'wendland6': + * return sph_kernel_wendland6 + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":127 + * elif kernel_name == 'wendland2': + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': # <<<<<<<<<<<<<< + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': + */ + } + + /* "yt/geometry/particle_deposit.pxd":129 + * elif kernel_name == 'wendland4': + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': # <<<<<<<<<<<<<< + * return sph_kernel_wendland6 + * else: + */ + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland6, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 129, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "yt/geometry/particle_deposit.pxd":130 + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': + * return sph_kernel_wendland6 # <<<<<<<<<<<<<< + * else: + * raise NotImplementedError + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":129 + * elif kernel_name == 'wendland4': + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': # <<<<<<<<<<<<<< + * return sph_kernel_wendland6 + * else: + */ + } + + /* "yt/geometry/particle_deposit.pxd":132 + * return sph_kernel_wendland6 + * else: + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * cdef class ParticleDepositOperation: + */ + /*else*/ { + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + __PYX_ERR(2, 132, __pyx_L1_error) + } + + /* "yt/geometry/particle_deposit.pxd":118 + * # I manually created a function to lookup the kernel functions. + * ctypedef np.float64_t (*kernel_func) (np.float64_t) + * cdef inline kernel_func get_kernel_func(str kernel_name): # <<<<<<<<<<<<<< + * if kernel_name == 'cubic': + * return sph_kernel_cubic + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.get_kernel_func", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oct_visitors.pxd":51 + * cdef void visit(self, Oct*, np.uint8_t selected) + * + * cdef inline int oind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) + */ + +static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { + int __pyx_v_d; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("oind", 0); + + /* "oct_visitors.pxd":52 + * + * cdef inline int oind(self): + * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) + * + */ + __pyx_v_d = (1 << __pyx_v_self->oref); + + /* "oct_visitors.pxd":53 + * cdef inline int oind(self): + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) # <<<<<<<<<<<<<< + * + * cdef inline int rind(self): + */ + __pyx_r = (((((__pyx_v_self->ind[0]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[2])); + goto __pyx_L0; + + /* "oct_visitors.pxd":51 + * cdef void visit(self, Oct*, np.uint8_t selected) + * + * cdef inline int oind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oct_visitors.pxd":55 + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) + * + * cdef inline int rind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) + */ + +static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { + int __pyx_v_d; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rind", 0); + + /* "oct_visitors.pxd":56 + * + * cdef inline int rind(self): + * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) + * + */ + __pyx_v_d = (1 << __pyx_v_self->oref); + + /* "oct_visitors.pxd":57 + * cdef inline int rind(self): + * cdef int d = (1 << self.oref) + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) # <<<<<<<<<<<<<< + * + * cdef class CountTotalOcts(OctVisitor): + */ + __pyx_r = (((((__pyx_v_self->ind[2]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[0])); + goto __pyx_L0; + + /* "oct_visitors.pxd":55 + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) + * + * cdef inline int rind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; } /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -24575,7 +27458,7 @@ goto __pyx_L0; /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -24591,18 +27474,18 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":20 * - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -24614,7 +27497,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -24626,7 +27509,7 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ @@ -24666,7 +27549,7 @@ * if f0 > f1: return f0 * return f1 # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ __pyx_r = __pyx_v_f1; goto __pyx_L0; @@ -24687,18 +27570,18 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":28 * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -24710,7 +27593,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -24722,7 +27605,7 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ @@ -24810,7 +27693,7 @@ * if f0 < 0.0: return -f0 * return f0 # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_f0; goto __pyx_L0; @@ -24831,18 +27714,18 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":40 * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -24854,7 +27737,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -24871,7 +27754,7 @@ * if i > b: return b * return i # <<<<<<<<<<<<<< * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_i; goto __pyx_L0; @@ -24879,7 +27762,7 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -24892,18 +27775,18 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -24915,7 +27798,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -24940,7 +27823,7 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -25248,11 +28131,11 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + __PYX_ERR(3, 218, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 @@ -25304,11 +28187,11 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + __PYX_ERR(3, 222, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") @@ -25613,11 +28496,11 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + __PYX_ERR(3, 259, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: @@ -25824,22 +28707,22 @@ * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) + __PYX_ERR(3, 278, __pyx_L1_error) break; } @@ -25906,7 +28789,7 @@ * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 @@ -26065,7 +28948,7 @@ * 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, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26112,7 +28995,7 @@ * 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, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26159,7 +29042,7 @@ * 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, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26206,7 +29089,7 @@ * 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, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26253,7 +29136,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26334,15 +29217,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) + __PYX_ERR(3, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + __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(3, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -26357,11 +29240,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) + __PYX_ERR(3, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -26382,7 +29265,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __pyx_L1_error) + __PYX_ERR(3, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -26390,15 +29273,15 @@ __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, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -26411,12 +29294,12 @@ * 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, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -26428,11 +29311,11 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) + __PYX_ERR(3, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -26496,11 +29379,11 @@ * # 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__37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __PYX_ERR(3, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -26519,11 +29402,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -26583,7 +29466,7 @@ * 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, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -26605,11 +29488,11 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __PYX_ERR(3, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -26627,11 +29510,11 @@ * 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, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -26645,11 +29528,11 @@ * 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, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -26663,11 +29546,11 @@ * 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, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -26681,11 +29564,11 @@ * 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, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -26699,11 +29582,11 @@ * 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, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -26717,11 +29600,11 @@ * 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, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -26735,11 +29618,11 @@ * 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, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -26753,11 +29636,11 @@ * 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, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -26771,11 +29654,11 @@ * 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, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -26789,11 +29672,11 @@ * 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, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -26807,11 +29690,11 @@ * 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, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -26825,11 +29708,11 @@ * 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, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -26843,11 +29726,11 @@ * 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, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -26861,11 +29744,11 @@ * 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, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -26881,11 +29764,11 @@ * 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, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -26901,11 +29784,11 @@ * 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, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -26921,11 +29804,11 @@ * 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, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -26940,19 +29823,19 @@ * 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, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) + __PYX_ERR(3, 844, __pyx_L1_error) } __pyx_L15:; @@ -26983,7 +29866,7 @@ * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(3, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; @@ -27247,7 +30130,7 @@ * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 987, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 * # Cython code. @@ -27260,7 +30143,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -27274,7 +30157,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 988, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -27286,11 +30169,11 @@ * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) + __PYX_ERR(3, 989, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -27308,7 +30191,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -27378,7 +30261,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 993, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * @@ -27391,7 +30274,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -27405,7 +30288,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 994, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -27417,11 +30300,11 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) + __PYX_ERR(3, 995, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -27439,7 +30322,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -27509,7 +30392,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 999, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * @@ -27522,7 +30405,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -27535,7 +30418,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -27545,11 +30428,11 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) + __PYX_ERR(3, 1001, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -27567,7 +30450,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -27593,8 +30476,8 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pxd":26 - * np.float64_t +/* "yt/geometry/selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< * if hasattr(arr, "units"): @@ -27610,39 +30493,39 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_ensure_code", 0); - /* "yt/geometry/selection_routines.pxd":27 + /* "yt/geometry/selection_routines.pxd":23 * * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): # <<<<<<<<<<<<<< * if "code_length" == str(arr.units): * return arr */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(4, 23, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pxd":28 + /* "yt/geometry/selection_routines.pxd":24 * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< * return arr * arr.convert_to_units("code_length") */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 24, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pxd":29 + /* "yt/geometry/selection_routines.pxd":25 * if hasattr(arr, "units"): * if "code_length" == str(arr.units): * return arr # <<<<<<<<<<<<<< @@ -27654,7 +30537,7 @@ __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "yt/geometry/selection_routines.pxd":28 + /* "yt/geometry/selection_routines.pxd":24 * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< @@ -27663,21 +30546,21 @@ */ } - /* "yt/geometry/selection_routines.pxd":30 + /* "yt/geometry/selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 30, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 30, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pxd":27 + /* "yt/geometry/selection_routines.pxd":23 * * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): # <<<<<<<<<<<<<< @@ -27686,7 +30569,7 @@ */ } - /* "yt/geometry/selection_routines.pxd":31 + /* "yt/geometry/selection_routines.pxd":27 * return arr * arr.convert_to_units("code_length") * return arr # <<<<<<<<<<<<<< @@ -27698,8 +30581,8 @@ __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "yt/geometry/selection_routines.pxd":26 - * np.float64_t + /* "yt/geometry/selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< * if hasattr(arr, "units"): @@ -27719,7 +30602,7 @@ } /* "yt/geometry/selection_routines.pxd":78 - * cdef public np.int64_t domain_id + * cdef public SelectorObject sel2 * * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< * np.float64_t dw, bint periodic) nogil: @@ -27819,7 +30702,7 @@ goto __pyx_L0; /* "yt/geometry/selection_routines.pxd":78 - * cdef public np.int64_t domain_id + * cdef public SelectorObject sel2 * * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< * np.float64_t dw, bint periodic) nogil: @@ -27831,1065 +30714,1114 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pxd":29 - * void *alloca(int) - * - * cdef inline int gind(int i, int j, int k, int dims[3]): # <<<<<<<<<<<<<< - * # The ordering is such that we want i to vary the slowest in this instance, - * # even though in other instances it varies the fastest. To see this in - */ - -static CYTHON_INLINE int __pyx_f_2yt_8geometry_16particle_deposit_gind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dims) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("gind", 0); - - /* "yt/geometry/particle_deposit.pxd":34 - * # action, try looking at the results of an n_ref=256 particle CIC plot, - * # which shows it the most clearly. - * return ((i*dims[1])+j)*dims[2]+k # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = ((((__pyx_v_i * (__pyx_v_dims[1])) + __pyx_v_j) * (__pyx_v_dims[2])) + __pyx_v_k); - goto __pyx_L0; - - /* "yt/geometry/particle_deposit.pxd":29 - * void *alloca(int) - * - * cdef inline int gind(int i, int j, int k, int dims[3]): # <<<<<<<<<<<<<< - * # The ordering is such that we want i to vary the slowest in this instance, - * # even though in other instances it varies the fastest. To see this in - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/geometry/particle_deposit.pxd":41 - * #################################################### - * - * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - - /* "yt/geometry/particle_deposit.pxd":43 - * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 # <<<<<<<<<<<<<< - * if x <= 0.5: - * kernel = 1.-6.*x*x*(1.-x) - */ - __pyx_v_C = 2.5464790894703255; - - /* "yt/geometry/particle_deposit.pxd":44 - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 - * if x <= 0.5: # <<<<<<<<<<<<<< - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: - */ - __pyx_t_1 = ((__pyx_v_x <= 0.5) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/particle_deposit.pxd":45 - * cdef np.float64_t C = 2.5464790894703255 - * if x <= 0.5: - * kernel = 1.-6.*x*x*(1.-x) # <<<<<<<<<<<<<< - * elif x>0.5 and x<=1.0: - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) - */ - __pyx_v_kernel = (1. - (((6. * __pyx_v_x) * __pyx_v_x) * (1. - __pyx_v_x))); - - /* "yt/geometry/particle_deposit.pxd":44 - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 - * if x <= 0.5: # <<<<<<<<<<<<<< - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: - */ - goto __pyx_L3; - } - - /* "yt/geometry/particle_deposit.pxd":46 - * if x <= 0.5: - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: # <<<<<<<<<<<<<< - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) - * else: - */ - __pyx_t_2 = ((__pyx_v_x > 0.5) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = ((__pyx_v_x <= 1.0) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; - if (__pyx_t_1) { - - /* "yt/geometry/particle_deposit.pxd":47 - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) # <<<<<<<<<<<<<< - * else: - * kernel = 0. - */ - __pyx_v_kernel = (((2. * (1. - __pyx_v_x)) * (1. - __pyx_v_x)) * (1. - __pyx_v_x)); - - /* "yt/geometry/particle_deposit.pxd":46 - * if x <= 0.5: - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: # <<<<<<<<<<<<<< - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) - * else: - */ - goto __pyx_L3; - } - - /* "yt/geometry/particle_deposit.pxd":49 - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C - * - */ - /*else*/ { - __pyx_v_kernel = 0.; - } - __pyx_L3:; - - /* "yt/geometry/particle_deposit.pxd":50 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< - * - * ######################################################## - */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); - goto __pyx_L0; - - /* "yt/geometry/particle_deposit.pxd":41 - * #################################################### +/* "yt/geometry/oct_container.pxd":56 * - * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/geometry/particle_deposit.pxd":57 + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) * - * # quartic spline - * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) { + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_quartic", 0); - - /* "yt/geometry/particle_deposit.pxd":59 - * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**4 - */ - __pyx_t_1 = PyFloat_FromDouble((pow(5., 6.0) / 512.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(3, 59, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; - - /* "yt/geometry/particle_deposit.pxd":60 - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**4 - * if x < 3./5: - */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { - - /* "yt/geometry/particle_deposit.pxd":61 - * cdef np.float64_t C = 5.**6/512/np.pi - * if x < 1: - * kernel = (1.-x)**4 # <<<<<<<<<<<<<< - * if x < 3./5: - * kernel -= 5*(3./5-x)**4 - */ - __pyx_v_kernel = pow((1. - __pyx_v_x), 4.0); - - /* "yt/geometry/particle_deposit.pxd":62 - * if x < 1: - * kernel = (1.-x)**4 - * if x < 3./5: # <<<<<<<<<<<<<< - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: - */ - __pyx_t_5 = ((__pyx_v_x < (3. / 5.0)) != 0); - if (__pyx_t_5) { - - /* "yt/geometry/particle_deposit.pxd":63 - * kernel = (1.-x)**4 - * if x < 3./5: - * kernel -= 5*(3./5-x)**4 # <<<<<<<<<<<<<< - * if x < 1./5: - * kernel += 10*(1./5-x)**4 - */ - __pyx_v_kernel = (__pyx_v_kernel - (5.0 * pow(((3. / 5.0) - __pyx_v_x), 4.0))); - - /* "yt/geometry/particle_deposit.pxd":64 - * if x < 3./5: - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: # <<<<<<<<<<<<<< - * kernel += 10*(1./5-x)**4 - * else: - */ - __pyx_t_5 = ((__pyx_v_x < (1. / 5.0)) != 0); - if (__pyx_t_5) { - - /* "yt/geometry/particle_deposit.pxd":65 - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: - * kernel += 10*(1./5-x)**4 # <<<<<<<<<<<<<< - * else: - * kernel = 0. - */ - __pyx_v_kernel = (__pyx_v_kernel + (10.0 * pow(((1. / 5.0) - __pyx_v_x), 4.0))); - - /* "yt/geometry/particle_deposit.pxd":64 - * if x < 3./5: - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: # <<<<<<<<<<<<<< - * kernel += 10*(1./5-x)**4 - * else: - */ - } - - /* "yt/geometry/particle_deposit.pxd":62 - * if x < 1: - * kernel = (1.-x)**4 - * if x < 3./5: # <<<<<<<<<<<<<< - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: - */ - } - - /* "yt/geometry/particle_deposit.pxd":60 - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**4 - * if x < 3./5: - */ - goto __pyx_L3; - } + __Pyx_RefNannySetupContext("get_cont", 0); - /* "yt/geometry/particle_deposit.pxd":67 - * kernel += 10*(1./5-x)**4 - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C - * - */ - /*else*/ { - __pyx_v_kernel = 0.; - } - __pyx_L3:; - - /* "yt/geometry/particle_deposit.pxd":68 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< + /* "yt/geometry/oct_container.pxd":57 + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) # <<<<<<<<<<<<<< * - * # quintic spline + * cdef OctList *OctList_append(OctList *list, Oct *o) */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); + __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i]))); goto __pyx_L0; - /* "yt/geometry/particle_deposit.pxd":57 + /* "yt/geometry/oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) * - * # quartic spline - * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quartic", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/particle_deposit.pxd":71 +/* "carray.to_py":112 * - * # quintic spline - * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi + * @cname("__Pyx_carray_to_py___pyx_t_5numpy_float64_t") + * cdef inline list __Pyx_carray_to_py___pyx_t_5numpy_float64_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; +static CYTHON_INLINE PyObject *__Pyx_carray_to_py___pyx_t_5numpy_float64_t(__pyx_t_5numpy_float64_t *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_l = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_quintic", 0); - - /* "yt/geometry/particle_deposit.pxd":73 - * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**5 + size_t __pyx_t_2; + size_t __pyx_t_3; + __Pyx_RefNannySetupContext("__Pyx_carray_to_py___pyx_t_5numpy_float64_t", 0); + + /* "carray.to_py":115 + * cdef size_t i + * cdef object value + * l = PyList_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] */ - __pyx_t_1 = PyFloat_FromDouble((pow(3., 7.0) / 40.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 73, __pyx_L1_error) + __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(3, 73, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; + __pyx_v_l = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pxd":74 - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**5 - * if x < 2./3: + /* "carray.to_py":116 + * cdef object value + * l = PyList_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { + __pyx_t_2 = ((size_t)__pyx_v_length); + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; - /* "yt/geometry/particle_deposit.pxd":75 - * cdef np.float64_t C = 3.**7/40/np.pi - * if x < 1: - * kernel = (1.-x)**5 # <<<<<<<<<<<<<< - * if x < 2./3: - * kernel -= 6*(2./3-x)**5 + /* "carray.to_py":117 + * l = PyList_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) */ - __pyx_v_kernel = pow((1. - __pyx_v_x), 5.0); + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pxd":76 - * if x < 1: - * kernel = (1.-x)**5 - * if x < 2./3: # <<<<<<<<<<<<<< - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: + /* "carray.to_py":118 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyList_SET_ITEM(l, i, value) + * return l */ - __pyx_t_5 = ((__pyx_v_x < (2. / 3.0)) != 0); - if (__pyx_t_5) { + Py_INCREF(__pyx_v_value); - /* "yt/geometry/particle_deposit.pxd":77 - * kernel = (1.-x)**5 - * if x < 2./3: - * kernel -= 6*(2./3-x)**5 # <<<<<<<<<<<<<< - * if x < 1./3: - * kernel += 15*(1./3-x)**5 + /* "carray.to_py":119 + * value = v[i] + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) # <<<<<<<<<<<<<< + * return l + * */ - __pyx_v_kernel = (__pyx_v_kernel - (6.0 * pow(((2. / 3.0) - __pyx_v_x), 5.0))); + PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value); + } - /* "yt/geometry/particle_deposit.pxd":78 - * if x < 2./3: - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: # <<<<<<<<<<<<<< - * kernel += 15*(1./3-x)**5 - * else: + /* "carray.to_py":120 + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) + * return l # <<<<<<<<<<<<<< + * + * */ - __pyx_t_5 = ((__pyx_v_x < (1. / 3.0)) != 0); - if (__pyx_t_5) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_l); + __pyx_r = __pyx_v_l; + goto __pyx_L0; - /* "yt/geometry/particle_deposit.pxd":79 - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: - * kernel += 15*(1./3-x)**5 # <<<<<<<<<<<<<< - * else: - * kernel = 0. + /* "carray.to_py":112 + * + * @cname("__Pyx_carray_to_py___pyx_t_5numpy_float64_t") + * cdef inline list __Pyx_carray_to_py___pyx_t_5numpy_float64_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ - __pyx_v_kernel = (__pyx_v_kernel + (15.0 * pow(((1. / 3.0) - __pyx_v_x), 5.0))); - /* "yt/geometry/particle_deposit.pxd":78 - * if x < 2./3: - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: # <<<<<<<<<<<<<< - * kernel += 15*(1./3-x)**5 - * else: + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py___pyx_t_5numpy_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_l); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "carray.to_py":124 + * + * @cname("__Pyx_carray_to_tuple___pyx_t_5numpy_float64_t") + * cdef inline tuple __Pyx_carray_to_tuple___pyx_t_5numpy_float64_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ - } - /* "yt/geometry/particle_deposit.pxd":76 - * if x < 1: - * kernel = (1.-x)**5 - * if x < 2./3: # <<<<<<<<<<<<<< - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple___pyx_t_5numpy_float64_t(__pyx_t_5numpy_float64_t *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple___pyx_t_5numpy_float64_t", 0); + + /* "carray.to_py":127 + * cdef size_t i + * cdef object value + * t = PyTuple_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] */ - } + __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_t = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pxd":74 - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**5 - * if x < 2./3: + /* "carray.to_py":128 + * cdef object value + * t = PyTuple_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) */ - goto __pyx_L3; - } + __pyx_t_2 = ((size_t)__pyx_v_length); + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; - /* "yt/geometry/particle_deposit.pxd":81 - * kernel += 15*(1./3-x)**5 - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C - * + /* "carray.to_py":129 + * t = PyTuple_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) */ - /*else*/ { - __pyx_v_kernel = 0.; - } - __pyx_L3:; + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pxd":82 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< - * - * # Wendland C2 + /* "carray.to_py":130 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(t, i, value) + * return t + */ + Py_INCREF(__pyx_v_value); + + /* "carray.to_py":131 + * value = v[i] + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) # <<<<<<<<<<<<<< + * return t + */ + PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value); + } + + /* "carray.to_py":132 + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) + * return t # <<<<<<<<<<<<<< */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_t); + __pyx_r = __pyx_v_t; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pxd":71 + /* "carray.to_py":124 * - * # quintic spline - * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi + * @cname("__Pyx_carray_to_tuple___pyx_t_5numpy_float64_t") + * cdef inline tuple __Pyx_carray_to_tuple___pyx_t_5numpy_float64_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quintic", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple___pyx_t_5numpy_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/particle_deposit.pxd":85 +/* "carray.from_py":77 * - * # Wendland C2 - * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_float64_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; +static int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(PyObject *__pyx_v_o, __pyx_t_5numpy_float64_t *__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; - __pyx_t_5numpy_float64_t __pyx_t_4; + Py_ssize_t __pyx_t_4; int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_wendland2", 0); + 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; + __pyx_t_5numpy_float64_t __pyx_t_11; + char const *__pyx_t_12; + __Pyx_RefNannySetupContext("__Pyx_carray_from_py___pyx_t_5numpy_float64_t", 0); + + /* "carray.from_py":78 + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_float64_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(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; - /* "yt/geometry/particle_deposit.pxd":87 - * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**4 * (1+4*x) + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(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_t_1 = PyFloat_FromDouble((21. / 2.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(3, 87, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; + { + __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:*/ { - /* "yt/geometry/particle_deposit.pxd":88 - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**4 * (1+4*x) - * else: + /* "carray.from_py":80 + * cdef Py_ssize_t i = length + * try: + * i = len(o) # <<<<<<<<<<<<<< + * except (TypeError, OverflowError): + * pass */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { + __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 80, __pyx_L3_error) + __pyx_v_i = __pyx_t_4; - /* "yt/geometry/particle_deposit.pxd":89 - * cdef np.float64_t C = 21./2/np.pi - * if x < 1: - * kernel = (1.-x)**4 * (1+4*x) # <<<<<<<<<<<<<< - * else: - * kernel = 0. + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(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_v_kernel = (pow((1. - __pyx_v_x), 4.0) * (1.0 + (4.0 * __pyx_v_x))); + } + __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:; + __Pyx_PyThreadState_assign - /* "yt/geometry/particle_deposit.pxd":88 - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**4 * (1+4*x) - * else: + /* "carray.from_py":81 + * try: + * i = len(o) + * except (TypeError, OverflowError): # <<<<<<<<<<<<<< + * pass + * if i == length: */ - goto __pyx_L3; + __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___pyx_t_5numpy_float64_t(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_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; } - /* "yt/geometry/particle_deposit.pxd":91 - * kernel = (1.-x)**4 * (1+4*x) - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C + /* "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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 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_AsDouble(__pyx_v_item); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 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 * */ - /*else*/ { - __pyx_v_kernel = 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: + */ } - __pyx_L3:; - /* "yt/geometry/particle_deposit.pxd":92 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< + /* "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 * - * # Wendland C4 + * PyErr_Format( # <<<<<<<<<<<<<< + * IndexError, + * ("too many values found during array assignment, expected %zd" */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); - goto __pyx_L0; + __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/particle_deposit.pxd":85 + /* "carray.from_py":77 * - * # Wendland C2 - * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_float64_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland2", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __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___pyx_t_5numpy_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/particle_deposit.pxd":95 +/* "carray.to_py":112 * - * # Wendland C4 - * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi + * @cname("__Pyx_carray_to_py_int") + * cdef inline list __Pyx_carray_to_py_int(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; +static CYTHON_INLINE PyObject *__Pyx_carray_to_py_int(int *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_l = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_wendland4", 0); - - /* "yt/geometry/particle_deposit.pxd":97 - * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) + size_t __pyx_t_2; + size_t __pyx_t_3; + __Pyx_RefNannySetupContext("__Pyx_carray_to_py_int", 0); + + /* "carray.to_py":115 + * cdef size_t i + * cdef object value + * l = PyList_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] */ - __pyx_t_1 = PyFloat_FromDouble((495. / 32.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 97, __pyx_L1_error) + __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(3, 97, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; + __pyx_v_l = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pxd":98 - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) - * else: + /* "carray.to_py":116 + * cdef object value + * l = PyList_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { + __pyx_t_2 = ((size_t)__pyx_v_length); + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; - /* "yt/geometry/particle_deposit.pxd":99 - * cdef np.float64_t C = 495./32/np.pi - * if x < 1: - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) # <<<<<<<<<<<<<< - * else: - * kernel = 0. + /* "carray.to_py":117 + * l = PyList_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) */ - __pyx_v_kernel = (pow((1. - __pyx_v_x), 6.0) * ((1.0 + (6.0 * __pyx_v_x)) + ((35. / 3.0) * pow(__pyx_v_x, 2.0)))); + __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pxd":98 - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) - * else: + /* "carray.to_py":118 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyList_SET_ITEM(l, i, value) + * return l */ - goto __pyx_L3; - } + Py_INCREF(__pyx_v_value); - /* "yt/geometry/particle_deposit.pxd":101 - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C + /* "carray.to_py":119 + * value = v[i] + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) # <<<<<<<<<<<<<< + * return l * */ - /*else*/ { - __pyx_v_kernel = 0.; + PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value); } - __pyx_L3:; - /* "yt/geometry/particle_deposit.pxd":102 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< + /* "carray.to_py":120 + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) + * return l # <<<<<<<<<<<<<< + * * - * # Wendland C6 */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_l); + __pyx_r = __pyx_v_l; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pxd":95 + /* "carray.to_py":112 * - * # Wendland C4 - * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi + * @cname("__Pyx_carray_to_py_int") + * cdef inline list __Pyx_carray_to_py_int(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland4", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_l); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/particle_deposit.pxd":105 +/* "carray.to_py":124 * - * # Wendland C6 - * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi + * @cname("__Pyx_carray_to_tuple_int") + * cdef inline tuple __Pyx_carray_to_tuple_int(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_int(int *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_wendland6", 0); - - /* "yt/geometry/particle_deposit.pxd":107 - * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) - */ - __pyx_t_1 = PyFloat_FromDouble((1365. / 64.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(3, 107, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; - - /* "yt/geometry/particle_deposit.pxd":108 - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) - * else: - */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { - - /* "yt/geometry/particle_deposit.pxd":109 - * cdef np.float64_t C = 1365./64/np.pi - * if x < 1: - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) # <<<<<<<<<<<<<< - * else: - * kernel = 0. - */ - __pyx_v_kernel = (pow((1. - __pyx_v_x), 8.0) * (((1.0 + (8.0 * __pyx_v_x)) + (25.0 * pow(__pyx_v_x, 2.0))) + (32.0 * pow(__pyx_v_x, 3.0)))); - - /* "yt/geometry/particle_deposit.pxd":108 - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) - * else: + size_t __pyx_t_2; + size_t __pyx_t_3; + __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_int", 0); + + /* "carray.to_py":127 + * cdef size_t i + * cdef object value + * t = PyTuple_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] */ - goto __pyx_L3; - } + __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_t = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pxd":111 - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C - * + /* "carray.to_py":128 + * cdef object value + * t = PyTuple_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) */ - /*else*/ { - __pyx_v_kernel = 0.; - } - __pyx_L3:; + __pyx_t_2 = ((size_t)__pyx_v_length); + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; - /* "yt/geometry/particle_deposit.pxd":112 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< - * - * # I don't know the way to use a dict in a cdef class. + /* "carray.to_py":129 + * t = PyTuple_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); + __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "carray.to_py":130 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(t, i, value) + * return t + */ + Py_INCREF(__pyx_v_value); + + /* "carray.to_py":131 + * value = v[i] + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) # <<<<<<<<<<<<<< + * return t + */ + PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value); + } + + /* "carray.to_py":132 + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) + * return t # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_t); + __pyx_r = __pyx_v_t; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pxd":105 + /* "carray.to_py":124 * - * # Wendland C6 - * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi + * @cname("__Pyx_carray_to_tuple_int") + * cdef inline tuple __Pyx_carray_to_tuple_int(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland6", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_int", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/particle_deposit.pxd":118 - * # I manually created a function to lookup the kernel functions. - * ctypedef np.float64_t (*kernel_func) (np.float64_t) - * cdef inline kernel_func get_kernel_func(str kernel_name): # <<<<<<<<<<<<<< - * if kernel_name == 'cubic': - * return sph_kernel_cubic +/* "carray.from_py":77 + * + * @cname("__Pyx_carray_from_py_int") + * cdef int __Pyx_carray_from_py_int(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: */ -static CYTHON_INLINE __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(PyObject *__pyx_v_kernel_name) { - __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_r; +static int __Pyx_carray_from_py_int(PyObject *__pyx_v_o, int *__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 - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("get_kernel_func", 0); + 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; + char const *__pyx_t_11; + __Pyx_RefNannySetupContext("__Pyx_carray_from_py_int", 0); - /* "yt/geometry/particle_deposit.pxd":119 - * ctypedef np.float64_t (*kernel_func) (np.float64_t) - * cdef inline kernel_func get_kernel_func(str kernel_name): - * if kernel_name == 'cubic': # <<<<<<<<<<<<<< - * return sph_kernel_cubic - * elif kernel_name == 'quartic': + /* "carray.from_py":78 + * @cname("__Pyx_carray_from_py_int") + * cdef int __Pyx_carray_from_py_int(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length # <<<<<<<<<<<<<< + * try: + * i = len(o) */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_cubic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 119, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_v_i = __pyx_v_length; - /* "yt/geometry/particle_deposit.pxd":120 - * cdef inline kernel_func get_kernel_func(str kernel_name): - * if kernel_name == 'cubic': - * return sph_kernel_cubic # <<<<<<<<<<<<<< - * elif kernel_name == 'quartic': - * return sph_kernel_quartic + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_int(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_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic; - goto __pyx_L0; + { + __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:*/ { - /* "yt/geometry/particle_deposit.pxd":119 - * ctypedef np.float64_t (*kernel_func) (np.float64_t) - * cdef inline kernel_func get_kernel_func(str kernel_name): - * if kernel_name == 'cubic': # <<<<<<<<<<<<<< - * return sph_kernel_cubic - * elif kernel_name == 'quartic': + /* "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 == -1)) __PYX_ERR(1, 80, __pyx_L3_error) + __pyx_v_i = __pyx_t_4; - /* "yt/geometry/particle_deposit.pxd":121 - * if kernel_name == 'cubic': - * return sph_kernel_cubic - * elif kernel_name == 'quartic': # <<<<<<<<<<<<<< - * return sph_kernel_quartic - * elif kernel_name == 'quintic': + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_int(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_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quartic, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 121, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { + } + __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:; + __Pyx_PyThreadState_assign - /* "yt/geometry/particle_deposit.pxd":122 - * return sph_kernel_cubic - * elif kernel_name == 'quartic': - * return sph_kernel_quartic # <<<<<<<<<<<<<< - * elif kernel_name == 'quintic': - * return sph_kernel_quintic + /* "carray.from_py":81 + * try: + * i = len(o) + * except (TypeError, OverflowError): # <<<<<<<<<<<<<< + * pass + * if i == length: */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic; - goto __pyx_L0; + __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:; - /* "yt/geometry/particle_deposit.pxd":121 - * if kernel_name == 'cubic': - * return sph_kernel_cubic - * elif kernel_name == 'quartic': # <<<<<<<<<<<<<< - * return sph_kernel_quartic - * elif kernel_name == 'quintic': + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_int(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_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; } - /* "yt/geometry/particle_deposit.pxd":123 - * elif kernel_name == 'quartic': - * return sph_kernel_quartic - * elif kernel_name == 'quintic': # <<<<<<<<<<<<<< - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quintic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 123, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { - /* "yt/geometry/particle_deposit.pxd":124 - * return sph_kernel_quartic - * elif kernel_name == 'quintic': - * return sph_kernel_quintic # <<<<<<<<<<<<<< - * elif kernel_name == 'wendland2': - * return sph_kernel_wendland2 + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic; - goto __pyx_L0; + __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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 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); - /* "yt/geometry/particle_deposit.pxd":123 - * elif kernel_name == 'quartic': - * return sph_kernel_quartic - * elif kernel_name == 'quintic': # <<<<<<<<<<<<<< - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': + /* "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) { - /* "yt/geometry/particle_deposit.pxd":125 - * elif kernel_name == 'quintic': - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': # <<<<<<<<<<<<<< - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': + /* "carray.from_py":86 + * for i, item in enumerate(o): + * if i >= length: + * break # <<<<<<<<<<<<<< + * v[i] = item + * else: */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 125, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { + goto __pyx_L11_break; - /* "yt/geometry/particle_deposit.pxd":126 - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': - * return sph_kernel_wendland2 # <<<<<<<<<<<<<< - * elif kernel_name == 'wendland4': - * return sph_kernel_wendland4 + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2; - goto __pyx_L0; + } - /* "yt/geometry/particle_deposit.pxd":125 - * elif kernel_name == 'quintic': - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': # <<<<<<<<<<<<<< - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': + /* "carray.from_py":87 + * if i >= length: + * break + * v[i] = item # <<<<<<<<<<<<<< + * else: + * i += 1 # convert index to length */ - } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_item); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 87, __pyx_L1_error) + (__pyx_v_v[__pyx_v_i]) = __pyx_t_6; - /* "yt/geometry/particle_deposit.pxd":127 - * elif kernel_name == 'wendland2': - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': # <<<<<<<<<<<<<< - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 127, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + } + /*else*/ { - /* "yt/geometry/particle_deposit.pxd":128 - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': - * return sph_kernel_wendland4 # <<<<<<<<<<<<<< - * elif kernel_name == 'wendland6': - * return sph_kernel_wendland6 + /* "carray.from_py":89 + * v[i] = item + * else: + * i += 1 # convert index to length # <<<<<<<<<<<<<< + * if i == length: + * return 0 */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4; - goto __pyx_L0; + __pyx_v_i = (__pyx_v_i + 1); - /* "yt/geometry/particle_deposit.pxd":127 - * elif kernel_name == 'wendland2': - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': # <<<<<<<<<<<<<< - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': + /* "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) { - /* "yt/geometry/particle_deposit.pxd":129 - * elif kernel_name == 'wendland4': - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': # <<<<<<<<<<<<<< - * return sph_kernel_wendland6 - * else: + /* "carray.from_py":91 + * i += 1 # convert index to length + * if i == length: + * return 0 # <<<<<<<<<<<<<< + * + * PyErr_Format( */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland6, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 129, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L0; - /* "yt/geometry/particle_deposit.pxd":130 - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': - * return sph_kernel_wendland6 # <<<<<<<<<<<<<< - * else: - * raise NotImplementedError + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 + * */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6; - goto __pyx_L0; + } + } - /* "yt/geometry/particle_deposit.pxd":129 - * elif kernel_name == 'wendland4': - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': # <<<<<<<<<<<<<< - * return sph_kernel_wendland6 - * else: + /* "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: */ } - /* "yt/geometry/particle_deposit.pxd":132 - * return sph_kernel_wendland6 - * else: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * cdef class ParticleDepositOperation: + /* "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) */ - /*else*/ { - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(3, 132, __pyx_L1_error) + if (((__pyx_v_i >= __pyx_v_length) != 0)) { + __pyx_t_11 = ((char const *)"too many values found during array assignment, expected %zd"); + } else { + __pyx_t_11 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd"); } - /* "yt/geometry/particle_deposit.pxd":118 - * # I manually created a function to lookup the kernel functions. - * ctypedef np.float64_t (*kernel_func) (np.float64_t) - * cdef inline kernel_func get_kernel_func(str kernel_name): # <<<<<<<<<<<<<< - * if kernel_name == 'cubic': - * return sph_kernel_cubic + /* "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_11, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 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_int") + * cdef int __Pyx_carray_from_py_int(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: */ /* function exit code */ - __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.get_kernel_func", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __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_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -28922,10 +31854,15 @@ 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; } @@ -28934,21 +31871,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(4, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(4, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -28956,12 +31897,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -28970,11 +31913,11 @@ } } __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(4, 120, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 121, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) } else { /* "View.MemoryView":121 @@ -28989,15 +31932,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(4, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(4, 120, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __pyx_L1_error) } __pyx_r = __pyx_array___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); @@ -29048,9 +31991,9 @@ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(4, 127, __pyx_L1_error) + __PYX_ERR(1, 127, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(4, 127, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 @@ -29079,11 +32022,11 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 131, __pyx_L1_error) + __PYX_ERR(1, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize @@ -29111,11 +32054,11 @@ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 134, __pyx_L1_error) + __PYX_ERR(1, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") @@ -29144,9 +32087,9 @@ * 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(4, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -29168,7 +32111,7 @@ * 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(4, 138, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) __pyx_t_5 = __pyx_v_format; __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -29184,7 +32127,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(4, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -29222,11 +32165,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 146, __pyx_L1_error) + __PYX_ERR(1, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim @@ -29249,12 +32192,12 @@ 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(4, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 149, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dim = __pyx_t_8; __pyx_v_idx = __pyx_t_7; @@ -29277,11 +32220,11 @@ * self._shape[idx] = dim * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); @@ -29289,20 +32232,20 @@ 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(4, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 151, __pyx_L1_error) + __PYX_ERR(1, 151, __pyx_L1_error) /* "View.MemoryView":150 * @@ -29339,7 +32282,7 @@ * 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(4, 155, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":156 @@ -29381,7 +32324,7 @@ * 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(4, 158, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":159 @@ -29424,19 +32367,19 @@ * 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(4, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 162, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 162, __pyx_L1_error) + __PYX_ERR(1, 162, __pyx_L1_error) } __pyx_L10:; @@ -29465,8 +32408,8 @@ * if allocate_buffer: * */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 168, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; @@ -29506,11 +32449,11 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 174, __pyx_L1_error) + __PYX_ERR(1, 174, __pyx_L1_error) /* "View.MemoryView":173 * @@ -29549,11 +32492,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(4, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __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(4, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { @@ -29674,7 +32617,7 @@ * 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(4, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -29704,7 +32647,7 @@ * 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(4, 187, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { @@ -29744,11 +32687,11 @@ * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 190, __pyx_L1_error) + __PYX_ERR(1, 190, __pyx_L1_error) /* "View.MemoryView":189 * elif self.mode == u"fortran": @@ -30088,7 +33031,7 @@ * @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(4, 221, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -30147,11 +33090,11 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -30162,7 +33105,7 @@ 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(4, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -30226,9 +33169,9 @@ * 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(4, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -30291,9 +33234,9 @@ * 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(4, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 233, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -30354,9 +33297,9 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(4, 236, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":235 @@ -30379,6 +33322,113 @@ 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__57, 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__58, 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":240 * * @cname("__pyx_array_new") @@ -30415,13 +33465,13 @@ * 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(4, 245, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 245, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -30435,7 +33485,7 @@ __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(4, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -30459,13 +33509,13 @@ * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -30487,9 +33537,9 @@ * result.data = buf * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 248, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(4, 248, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) /* "View.MemoryView":247 * result = array(shape, itemsize, format, mode.decode('ASCII')) @@ -30498,7 +33548,7 @@ * 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(4, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -30574,6 +33624,7 @@ 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; } @@ -30584,7 +33635,7 @@ 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(4, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -30593,100 +33644,387 @@ } __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(4, 277, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___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":278 + * 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":277 + * 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":279 + * 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":280 + * 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":279 + * 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; + } - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "(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:; -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); + /* "(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) { - /* "View.MemoryView":278 - * cdef object name - * def __init__(self, name): - * self.name = name # <<<<<<<<<<<<<< - * def __repr__(self): - * return self.name + /* "(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_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; + __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; - /* "View.MemoryView":277 - * cdef class Enum(object): - * cdef object name - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * def __repr__(self): + /* "(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_r = 0; + __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; } -/* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * +/* "(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_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { +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("__repr__ (wrapper)", 0); - __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + __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_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { +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 - __Pyx_RefNannySetupContext("__repr__", 0); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "View.MemoryView":280 - * self.name = name - * def __repr__(self): - * return self.name # <<<<<<<<<<<<<< - * - * cdef generic = Enum("") + /* "(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) # <<<<<<<<<<<<<< */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->name); - __pyx_r = __pyx_v_self->name; - goto __pyx_L0; + 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; - /* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * + /* "(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(); @@ -30801,8 +34139,11 @@ 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; } @@ -30811,11 +34152,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(4, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -30823,11 +34166,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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; @@ -30835,16 +34179,16 @@ } } __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(4, 341, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 341, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -30915,7 +34259,7 @@ * 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 == -1)) __PYX_ERR(4, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) /* "View.MemoryView":346 * if type(self) is memoryview or obj is not None: @@ -31036,7 +34380,7 @@ * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(4, 357, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) /* "View.MemoryView":356 * if self.lock is NULL: @@ -31377,26 +34721,26 @@ __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(4, 389, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 389, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(4, 389, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(4, 389, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -31406,7 +34750,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(4, 389, __pyx_L1_error) + else __PYX_ERR(1, 389, __pyx_L1_error) } break; } @@ -31424,8 +34768,8 @@ * * 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(4, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(4, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":389 @@ -31542,7 +34886,7 @@ * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 399, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -31554,7 +34898,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(4, 399, __pyx_L1_error) + __PYX_ERR(1, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -31562,14 +34906,14 @@ __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(4, 399, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 399, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 399, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; @@ -31583,7 +34927,7 @@ * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":403 @@ -31594,7 +34938,7 @@ * 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(4, 403, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -31617,7 +34961,7 @@ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(4, 405, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":406 @@ -31628,7 +34972,7 @@ * 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(4, 406, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -31698,7 +35042,7 @@ * * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 409, __pyx_L1_error) + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; @@ -31710,7 +35054,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(4, 409, __pyx_L1_error) + __PYX_ERR(1, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); @@ -31718,14 +35062,14 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 409, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 409, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 409, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; @@ -31739,7 +35083,7 @@ * obj = self.is_slice(value) * if obj: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":412 @@ -31749,7 +35093,7 @@ * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 412, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; @@ -31761,7 +35105,7 @@ * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":414 @@ -31771,9 +35115,9 @@ * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 414, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -31796,10 +35140,10 @@ * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 416, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -31824,7 +35168,7 @@ * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 418, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -31912,7 +35256,7 @@ * 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(4, 423, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":424 @@ -31922,7 +35266,7 @@ * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 424, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":423 @@ -31932,7 +35276,7 @@ * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 423, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -31943,7 +35287,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(4, 423, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -31960,7 +35304,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -31977,7 +35321,7 @@ __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(4, 425, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); @@ -32020,7 +35364,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -32092,7 +35436,7 @@ * 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(4, 434, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":435 * @@ -32101,7 +35445,7 @@ * 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(4, 435, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) /* "View.MemoryView":436 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], @@ -32110,13 +35454,13 @@ * * 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(4, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":434 @@ -32126,7 +35470,7 @@ * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 434, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":430 * return obj @@ -32232,7 +35576,7 @@ * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(4, 450, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) /* "View.MemoryView":449 * if self.view.itemsize > sizeof(array): @@ -32320,7 +35664,7 @@ * */ /*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(4, 459, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 459, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -32343,7 +35687,7 @@ * 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(4, 464, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -32458,7 +35802,7 @@ * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(4, 471, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":472 @@ -32468,7 +35812,7 @@ * * 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(4, 472, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -32527,7 +35871,7 @@ * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -32539,7 +35883,7 @@ * 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(4, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -32567,9 +35911,9 @@ * 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(4, 482, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 482, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -32586,7 +35930,7 @@ #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(4, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -32595,14 +35939,14 @@ #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(4, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 482, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -32613,7 +35957,7 @@ __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(4, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -32650,7 +35994,7 @@ * */ __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(4, 487, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -32692,13 +36036,13 @@ * raise ValueError("Unable to convert item to object") * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 483, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(4, 483, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); @@ -32710,11 +36054,11 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(4, 484, __pyx_L5_except_error) + __PYX_ERR(1, 484, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -32805,7 +36149,7 @@ * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -32828,26 +36172,26 @@ * 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(4, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(4, 499, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -32869,9 +36213,9 @@ * 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(4, 501, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -32888,7 +36232,7 @@ #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(4, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -32897,14 +36241,14 @@ #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(4, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 501, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -32915,12 +36259,12 @@ __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(4, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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(4, 501, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 501, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } @@ -32936,7 +36280,7 @@ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(4, 503, __pyx_L1_error) + __PYX_ERR(1, 503, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -33323,9 +36667,9 @@ * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 540, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(4, 540, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; @@ -33336,7 +36680,7 @@ * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(4, 541, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) /* "View.MemoryView":542 * cdef _memoryviewslice result = memoryview_copy(self) @@ -33463,18 +36807,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 550, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_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(4, 550, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(4, 550, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 550, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; @@ -33551,11 +36895,11 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(4, 556, __pyx_L1_error) + __PYX_ERR(1, 556, __pyx_L1_error) /* "View.MemoryView":554 * @property @@ -33574,18 +36918,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 558, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_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(4, 558, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 558, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 558, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; @@ -33663,9 +37007,9 @@ * 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(4, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__51, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__61, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -33689,18 +37033,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 565, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 565, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(4, 565, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 565, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -33762,7 +37106,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -33822,7 +37166,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -33884,11 +37228,11 @@ * @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(4, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 577, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -33982,7 +37326,7 @@ __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(4, 584, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; @@ -33994,7 +37338,7 @@ * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 585, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; @@ -34172,12 +37516,12 @@ * */ __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(4, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -34188,12 +37532,12 @@ * * def __str__(self): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 599, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -34204,7 +37548,7 @@ * id(self)) * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -34212,7 +37556,7 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -34276,20 +37620,20 @@ * */ __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(4, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 602, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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(4, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -34362,7 +37706,7 @@ * 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(4, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -34433,7 +37777,7 @@ * 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(4, 615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -34513,7 +37857,7 @@ * 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(4, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":627 @@ -34524,7 +37868,7 @@ * 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(4, 627, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -34605,7 +37949,7 @@ * 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(4, 634, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":639 @@ -34616,7 +37960,7 @@ * */ __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(4, 639, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -34641,6 +37985,113 @@ 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__62, 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__63, 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":643 * * @cname('__pyx_memoryview_new') @@ -34665,11 +38116,11 @@ * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 644, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -34680,7 +38131,7 @@ 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(4, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); @@ -34817,7 +38268,7 @@ * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -34855,7 +38306,7 @@ * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 662, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -34891,26 +38342,26 @@ __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(4, 665, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 665, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(4, 665, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(4, 665, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -34920,7 +38371,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(4, 665, __pyx_L1_error) + else __PYX_ERR(1, 665, __pyx_L1_error) } break; } @@ -34930,7 +38381,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(4, 665, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -34964,17 +38415,17 @@ * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(4, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 668, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__52); - __Pyx_GIVEREF(__pyx_slice__52); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__52); + __Pyx_INCREF(__pyx_slice__64); + __Pyx_GIVEREF(__pyx_slice__64); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__64); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 668, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":669 @@ -35004,7 +38455,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__53); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__65); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) } __pyx_L7:; @@ -35054,19 +38505,19 @@ * * 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(4, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 675, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(4, 675, __pyx_L1_error) + __PYX_ERR(1, 675, __pyx_L1_error) /* "View.MemoryView":674 * have_slices = True @@ -35103,7 +38554,7 @@ * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 678, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) } __pyx_L6:; @@ -35125,7 +38576,7 @@ * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(4, 680, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":681 @@ -35145,16 +38596,16 @@ * * 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(4, 682, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__54); - __Pyx_GIVEREF(__pyx_slice__54); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__54); + __Pyx_INCREF(__pyx_slice__66); + __Pyx_GIVEREF(__pyx_slice__66); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__66); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":681 @@ -35176,20 +38627,20 @@ __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(4, 684, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 684, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 684, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 684, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -35275,11 +38726,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 689, __pyx_L1_error) + __PYX_ERR(1, 689, __pyx_L1_error) /* "View.MemoryView":688 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): @@ -35383,7 +38834,7 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(4, 708, __pyx_L1_error) + __PYX_ERR(1, 708, __pyx_L1_error) } } #endif @@ -35406,7 +38857,7 @@ * 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(4, 711, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -35502,26 +38953,26 @@ __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(4, 732, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 732, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(4, 732, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(4, 732, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -35531,7 +38982,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(4, 732, __pyx_L1_error) + else __PYX_ERR(1, 732, __pyx_L1_error) } break; } @@ -35559,7 +39010,7 @@ * 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(4, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) /* "View.MemoryView":734 * for dim, index in enumerate(indices): @@ -35568,7 +39019,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(4, 734, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) /* "View.MemoryView":733 * @@ -35645,13 +39096,13 @@ * 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(4, 746, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 746, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -35667,13 +39118,13 @@ * 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(4, 747, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 747, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -35689,13 +39140,13 @@ * * 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(4, 748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 748, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -35711,7 +39162,7 @@ * 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(4, 750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -35724,7 +39175,7 @@ * 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(4, 751, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -35737,7 +39188,7 @@ * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 752, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -35750,7 +39201,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(4, 754, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) /* "View.MemoryView":760 * have_start, have_stop, have_step, @@ -35800,7 +39251,7 @@ * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(4, 764, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } /* "View.MemoryView":765 * return memoryview_fromslice(dst, new_ndim, @@ -35809,7 +39260,7 @@ * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(4, 765, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } /* "View.MemoryView":763 * @@ -35818,9 +39269,9 @@ * 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(4, 763, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 763, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -35851,7 +39302,7 @@ * * */ - __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(4, 768, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":768 @@ -35861,7 +39312,7 @@ * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -35964,7 +39415,7 @@ * 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 == -1)) __PYX_ERR(4, 818, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: @@ -36029,7 +39480,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(4, 824, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) /* "View.MemoryView":823 * negative_step = have_step != 0 and step < 0 @@ -36601,7 +40052,7 @@ * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(4, 885, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) } __pyx_L26:; @@ -36658,11 +40109,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -36730,11 +40181,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(4, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __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(4, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); @@ -36842,22 +40293,22 @@ * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(4, 914, __pyx_L1_error) + __PYX_ERR(1, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: @@ -36894,22 +40345,22 @@ * * resultp = bufp + index * stride */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 917, __pyx_L1_error) + __PYX_ERR(1, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) @@ -37109,7 +40560,7 @@ * * return 1 */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(4, 943, __pyx_L1_error) + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] @@ -37143,11 +40594,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -37232,7 +40683,7 @@ * 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(4, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -37256,7 +40707,7 @@ */ /*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(4, 969, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -37315,7 +40766,7 @@ * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(4, 973, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) /* "View.MemoryView":972 * @@ -37335,7 +40786,7 @@ * @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(4, 975, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -37415,6 +40866,113 @@ 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__68, 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__69, 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":985 * * @cname('__pyx_memoryview_fromslice') @@ -37478,9 +41036,9 @@ * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 999, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -37491,7 +41049,7 @@ __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(4, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -37522,7 +41080,7 @@ * 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(4, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -37693,7 +41251,7 @@ __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(4, 1026, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; @@ -37705,12 +41263,12 @@ * * 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(4, 1027, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1027, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1027, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } @@ -37802,7 +41360,7 @@ * 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(4, 1039, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -37859,7 +41417,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -38023,7 +41581,7 @@ * @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(4, 1067, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -38146,7 +41704,7 @@ * * */ - __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(4, 1084, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; @@ -38944,7 +42502,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(4, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) /* "View.MemoryView":1207 * @@ -39116,11 +42674,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -39144,7 +42702,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -39155,13 +42713,13 @@ * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -39180,20 +42738,20 @@ * (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(4, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1237, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 1237, __pyx_L1_error) + __PYX_ERR(1, 1237, __pyx_L1_error) /* "View.MemoryView":1235 * @@ -39213,7 +42771,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -39235,7 +42793,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -39247,11 +42805,11 @@ * * @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(4, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -39267,14 +42825,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #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(4, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -39283,20 +42841,20 @@ #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(4, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -39304,7 +42862,7 @@ __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(4, 1242, __pyx_L1_error) + __PYX_ERR(1, 1242, __pyx_L1_error) /* "View.MemoryView":1241 * @@ -39326,7 +42884,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -39349,7 +42907,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -39371,7 +42929,7 @@ * 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(4, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -39385,14 +42943,14 @@ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #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(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -39401,20 +42959,20 @@ #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(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -39422,7 +42980,7 @@ __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(4, 1247, __pyx_L1_error) + __PYX_ERR(1, 1247, __pyx_L1_error) /* "View.MemoryView":1246 * @cname('__pyx_memoryview_err') @@ -39442,7 +43000,7 @@ */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(4, 1249, __pyx_L1_error) + __PYX_ERR(1, 1249, __pyx_L1_error) } /* "View.MemoryView":1245 @@ -39465,7 +43023,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -39683,7 +43241,7 @@ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 1281, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) } __pyx_L7:; @@ -39713,7 +43271,7 @@ * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 1284, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) /* "View.MemoryView":1283 * _err_extents(i, dst.shape[i], src.shape[i]) @@ -39770,7 +43328,7 @@ * src = tmp * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(4, 1291, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1292 @@ -39954,7 +43512,7 @@ * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(4, 1313, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) /* "View.MemoryView":1314 * @@ -39963,7 +43521,7 @@ * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(4, 1314, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) /* "View.MemoryView":1310 * return 0 @@ -40032,11 +43590,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -40216,7 +43774,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -40240,7 +43798,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -40527,27 +44085,490 @@ */ __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":1406 - * _slice_assign_scalar(data, shape + 1, strides + 1, - * ndim - 1, itemsize, item) - * data += stride # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":1406 + * _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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) */ - __pyx_v_data = (__pyx_v_data + __pyx_v_stride); - } } - __pyx_L3:; - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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 PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_artio_fileset(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { @@ -40567,7 +44588,7 @@ static void __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_artio_fileset(PyObject *o) { struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -40731,6 +44752,8 @@ {"read_grid_chunk", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_33read_grid_chunk, METH_VARARGS|METH_KEYWORDS, 0}, {"root_sfc_ranges_all", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_35root_sfc_ranges_all, METH_VARARGS|METH_KEYWORDS, 0}, {"root_sfc_ranges", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_37root_sfc_ranges, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_39__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_41__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -40824,7 +44847,7 @@ static void __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler(PyObject *o) { struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -40848,7 +44871,7 @@ int e; struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)o; if (p->artio_handle) { - e = (*v)(((PyObject*)p->artio_handle), a); if (e) return e; + e = (*v)(((PyObject *)p->artio_handle), a); if (e) return e; } if (p->root_mesh_handler) { e = (*v)(p->root_mesh_handler, a); if (e) return e; @@ -40977,6 +45000,8 @@ static PyMethodDef __pyx_methods_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler[] = { {"construct_mesh", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_5construct_mesh, METH_NOARGS, 0}, {"free_mesh", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7free_mesh, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_11__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -41064,7 +45089,7 @@ static void __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer(PyObject *o) { struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -41080,10 +45105,10 @@ struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)o; e = ((likely(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) ? ((__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_traverse) ? __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer)); if (e) return e; if (p->artio_handle) { - e = (*v)(((PyObject*)p->artio_handle), a); if (e) return e; + e = (*v)(((PyObject *)p->artio_handle), a); if (e) return e; } if (p->range_handler) { - e = (*v)(((PyObject*)p->range_handler), a); if (e) return e; + e = (*v)(((PyObject *)p->range_handler), a); if (e) return e; } return 0; } @@ -41117,6 +45142,8 @@ static PyMethodDef __pyx_methods_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer[] = { {"fill_sfc", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_3fill_sfc, METH_VARARGS|METH_KEYWORDS, 0}, {"fill_sfc_particles", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_5fill_sfc_particles, METH_O, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_9__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -41204,7 +45231,7 @@ static void __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer(PyObject *o) { struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -41227,13 +45254,13 @@ int e; struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)o; if (p->artio_handle) { - e = (*v)(((PyObject*)p->artio_handle), a); if (e) return e; + e = (*v)(((PyObject *)p->artio_handle), a); if (e) return e; } if (p->_last_mask) { e = (*v)(p->_last_mask, a); if (e) return e; } if (p->range_handler) { - e = (*v)(((PyObject*)p->range_handler), a); if (e) return e; + e = (*v)(((PyObject *)p->range_handler), a); if (e) return e; } return 0; } @@ -41303,6 +45330,8 @@ {"fill_sfc_particles", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17fill_sfc_particles, METH_O, 0}, {"fill_sfc", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_19fill_sfc, METH_VARARGS|METH_KEYWORDS, 0}, {"deposit", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_21deposit, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_23__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_25__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -41387,7 +45416,7 @@ static void __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector(PyObject *o) { struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -41407,13 +45436,13 @@ struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)o; e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector)); if (e) return e; if (p->base_selector) { - e = (*v)(((PyObject*)p->base_selector), a); if (e) return e; + e = (*v)(((PyObject *)p->base_selector), a); if (e) return e; } if (p->range_handler) { - e = (*v)(((PyObject*)p->range_handler), a); if (e) return e; + e = (*v)(((PyObject *)p->range_handler), a); if (e) return e; } if (p->mesh_container) { - e = (*v)(((PyObject*)p->mesh_container), a); if (e) return e; + e = (*v)(((PyObject *)p->mesh_container), a); if (e) return e; } return 0; } @@ -41437,6 +45466,8 @@ static PyMethodDef __pyx_methods_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector[] = { {"select_grids", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, {"_hash_vals", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_5_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_9__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -41522,7 +45553,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -41572,6 +45603,8 @@ 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} }; @@ -41691,7 +45724,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -41719,6 +45752,8 @@ } 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} }; @@ -41806,7 +45841,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -41918,6 +45953,8 @@ {"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} }; @@ -42043,7 +46080,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -42087,6 +46124,8 @@ } 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} }; @@ -42199,6 +46238,8 @@ {&__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_kp_s_Incompatible_checksums_s_vs_0xde, __pyx_k_Incompatible_checksums_s_vs_0xde, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xde), 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}, @@ -42216,10 +46257,12 @@ {&__pyx_n_s_OmegaM, __pyx_k_OmegaM, sizeof(__pyx_k_OmegaM), 0, 0, 1, 1}, {&__pyx_n_s_OnceIndirect, __pyx_k_OnceIndirect, sizeof(__pyx_k_OnceIndirect), 0, 0, 1, 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_PID, __pyx_k_PID, sizeof(__pyx_k_PID), 0, 0, 1, 1}, {&__pyx_n_s_POSITION_X, __pyx_k_POSITION_X, sizeof(__pyx_k_POSITION_X), 0, 0, 1, 1}, {&__pyx_n_s_POSITION_Y, __pyx_k_POSITION_Y, sizeof(__pyx_k_POSITION_Y), 0, 0, 1, 1}, {&__pyx_n_s_POSITION_Z, __pyx_k_POSITION_Z, sizeof(__pyx_k_POSITION_Z), 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_SPECIES, __pyx_k_SPECIES, sizeof(__pyx_k_SPECIES), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, @@ -42227,8 +46270,8 @@ {&__pyx_kp_s_Unable_to_locate_particle_header, __pyx_k_Unable_to_locate_particle_header, sizeof(__pyx_k_Unable_to_locate_particle_header), 0, 0, 1, 0}, {&__pyx_kp_s_Unable_to_locate_position_inform, __pyx_k_Unable_to_locate_position_inform, sizeof(__pyx_k_Unable_to_locate_position_inform), 0, 0, 1, 0}, {&__pyx_kp_s_Unable_to_locate_variable_labels, __pyx_k_Unable_to_locate_variable_labels, sizeof(__pyx_k_Unable_to_locate_variable_labels), 0, 0, 1, 0}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 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_abox, __pyx_k_abox, sizeof(__pyx_k_abox), 0, 0, 1, 1}, {&__pyx_kp_s_abox_from_auni_called_for_non_co, __pyx_k_abox_from_auni_called_for_non_co, sizeof(__pyx_k_abox_from_auni_called_for_non_co), 0, 0, 1, 0}, {&__pyx_kp_s_abox_from_tcode_called_for_non_c, __pyx_k_abox_from_tcode_called_for_non_c, sizeof(__pyx_k_abox_from_tcode_called_for_non_c), 0, 0, 1, 0}, @@ -42251,6 +46294,7 @@ {&__pyx_n_s_cache_root_mesh, __pyx_k_cache_root_mesh, sizeof(__pyx_k_cache_root_mesh), 0, 0, 1, 1}, {&__pyx_n_s_cell_inds, __pyx_k_cell_inds, sizeof(__pyx_k_cell_inds), 0, 0, 1, 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_n_s_co_name, __pyx_k_co_name, sizeof(__pyx_k_co_name), 0, 0, 1, 1}, {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 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}, @@ -42262,6 +46306,7 @@ {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_dest_fields, __pyx_k_dest_fields, sizeof(__pyx_k_dest_fields), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1}, {&__pyx_n_s_dobj, __pyx_k_dobj, sizeof(__pyx_k_dobj), 0, 0, 1, 1}, {&__pyx_n_s_domain_counts, __pyx_k_domain_counts, sizeof(__pyx_k_domain_counts), 0, 0, 1, 1}, @@ -42323,6 +46368,8 @@ {&__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_num_cells, __pyx_k_num_cells, sizeof(__pyx_k_num_cells), 0, 0, 1, 1}, {&__pyx_n_s_num_grid_variables, __pyx_k_num_grid_variables, sizeof(__pyx_k_num_grid_variables), 0, 0, 1, 1}, @@ -42341,19 +46388,32 @@ {&__pyx_n_s_particle_species_mass, __pyx_k_particle_species_mass, sizeof(__pyx_k_particle_species_mass), 0, 0, 1, 1}, {&__pyx_n_s_pdeposit, __pyx_k_pdeposit, sizeof(__pyx_k_pdeposit), 0, 0, 1, 1}, {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 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_print_stack, __pyx_k_print_stack, sizeof(__pyx_k_print_stack), 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_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_SFCRangeSelector, __pyx_k_pyx_unpickle_SFCRangeSelector, sizeof(__pyx_k_pyx_unpickle_SFCRangeSelector), 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_quartic, __pyx_k_quartic, sizeof(__pyx_k_quartic), 0, 0, 1, 1}, {&__pyx_n_s_quintic, __pyx_k_quintic, sizeof(__pyx_k_quintic), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_range_handler, __pyx_k_range_handler, sizeof(__pyx_k_range_handler), 0, 0, 1, 1}, {&__pyx_n_s_read_parameters, __pyx_k_read_parameters, sizeof(__pyx_k_read_parameters), 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_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_right_edges, __pyx_k_right_edges, sizeof(__pyx_k_right_edges), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_n_s_selector, __pyx_k_selector, sizeof(__pyx_k_selector), 0, 0, 1, 1}, + {&__pyx_kp_s_self_cosmology_self_grid_variabl, __pyx_k_self_cosmology_self_grid_variabl, sizeof(__pyx_k_self_cosmology_self_grid_variabl), 0, 0, 1, 0}, + {&__pyx_kp_s_self_doct_count_self_handle_self, __pyx_k_self_doct_count_self_handle_self, sizeof(__pyx_k_self_doct_count_self_handle_self), 0, 0, 1, 0}, + {&__pyx_kp_s_self_handle_cannot_be_converted, __pyx_k_self_handle_cannot_be_converted, sizeof(__pyx_k_self_handle_cannot_be_converted), 0, 0, 1, 0}, + {&__pyx_kp_s_self_root_mesh_self_root_nodes_s, __pyx_k_self_root_mesh_self_root_nodes_s, sizeof(__pyx_k_self_root_mesh_self_root_nodes_s), 0, 0, 1, 0}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_sfc_end, __pyx_k_sfc_end, sizeof(__pyx_k_sfc_end), 0, 0, 1, 1}, {&__pyx_n_s_sfc_start, __pyx_k_sfc_start, sizeof(__pyx_k_sfc_start), 0, 0, 1, 1}, {&__pyx_n_s_sfc_subset_selector, __pyx_k_sfc_subset_selector, sizeof(__pyx_k_sfc_subset_selector), 0, 0, 1, 1}, @@ -42369,6 +46429,7 @@ {&__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_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, @@ -42386,12 +46447,14 @@ {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 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_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, {&__pyx_n_s_wendland2, __pyx_k_wendland2, sizeof(__pyx_k_wendland2), 0, 0, 1, 1}, {&__pyx_n_s_wendland4, __pyx_k_wendland4, sizeof(__pyx_k_wendland4), 0, 0, 1, 1}, {&__pyx_n_s_wendland6, __pyx_k_wendland6, sizeof(__pyx_k_wendland6), 0, 0, 1, 1}, - {&__pyx_n_s_yt_frontends_artio__artio_caller, __pyx_k_yt_frontends_artio__artio_caller, sizeof(__pyx_k_yt_frontends_artio__artio_caller), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_frontends_artio__artio_caller, __pyx_k_yt_frontends_artio__artio_caller, sizeof(__pyx_k_yt_frontends_artio__artio_caller), 0, 0, 1, 0}, + {&__pyx_n_s_yt_frontends_artio__artio_caller_2, __pyx_k_yt_frontends_artio__artio_caller_2, sizeof(__pyx_k_yt_frontends_artio__artio_caller_2), 0, 0, 1, 1}, {&__pyx_n_s_yt_utilities_lib_misc_utilities, __pyx_k_yt_utilities_lib_misc_utilities, sizeof(__pyx_k_yt_utilities_lib_misc_utilities), 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} @@ -42403,13 +46466,14 @@ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 262, __pyx_L1_error) __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 266, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 562, __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_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 923, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(3, 132, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(4, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(4, 425, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(4, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(4, 818, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(2, 132, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 989, __pyx_L1_error) + __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(1, 81, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 94, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -42719,6 +46783,44 @@ __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_self_cosmology_self_grid_variabl); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "(tree fragment)":4 + * raise TypeError("self.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.cosmology,self.grid_variables,self.handle,self.num_octs_per_level,self.num_particles_per_species,self.particle_position_index,self.primary_variables,self.secondary_variables cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_self_cosmology_self_grid_variabl); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_self_doct_count_self_handle_self); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "(tree fragment)":4 + * raise TypeError("self.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.doct_count,self.handle,self.pcount,self.root_mesh_data cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_self_doct_count_self_handle_self); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + /* "yt/frontends/artio/_artio_caller.pyx":975 * status = artio_grid_read_level_end(handle) * check_artio_status(status) @@ -42726,9 +46828,28 @@ * if nadded != num_octs_per_level[level]: * raise RuntimeError */ - __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(0, 975, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__29); - __Pyx_GIVEREF(__pyx_slice__29); + __pyx_slice__33 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) __PYX_ERR(0, 975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__33); + __Pyx_GIVEREF(__pyx_slice__33); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_self_root_nodes_s); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "(tree fragment)":4 + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_self_root_nodes_s); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); /* "yt/frontends/artio/_artio_caller.pyx":1118 * @@ -42737,9 +46858,9 @@ * * # Now we set up our field pointers */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_read_non_existent_p); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_read_non_existent_p); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 1118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); /* "yt/frontends/artio/_artio_caller.pyx":1404 * width = np.zeros((num_cells, 3), dtype="float64") @@ -42748,9 +46869,9 @@ * return width * */ - __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(0, 1404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__31); - __Pyx_GIVEREF(__pyx_slice__31); + __pyx_slice__37 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__37)) __PYX_ERR(0, 1404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__37); + __Pyx_GIVEREF(__pyx_slice__37); /* "yt/frontends/artio/_artio_caller.pyx":1489 * mask[sfci] = 1 @@ -42759,9 +46880,28 @@ * self._last_selector_id = hash(selector) * return self._last_mask */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.handle cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.handle cannot be converted to a Python object for pickling") + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_self_handle_cannot_be_converted); 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("self.handle cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.handle cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_self_handle_cannot_be_converted); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -42770,9 +46910,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -42781,9 +46921,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -42792,9 +46932,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -42803,9 +46943,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -42814,9 +46954,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -42825,9 +46965,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -42836,9 +46976,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(3, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -42847,29 +46987,29 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(3, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(3, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); - /* "yt/geometry/selection_routines.pxd":30 + /* "yt/geometry/selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(4, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); /* "View.MemoryView":131 * @@ -42878,9 +47018,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(4, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); /* "View.MemoryView":134 * @@ -42889,9 +47029,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(4, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); /* "View.MemoryView":137 * @@ -42900,9 +47040,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(4, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); /* "View.MemoryView":146 * @@ -42911,9 +47051,9 @@ * * */ - __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(4, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -42922,9 +47062,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(4, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -42933,9 +47073,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(4, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + + /* "(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__57 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + + /* "(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__58 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -42944,9 +47103,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(4, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -42955,9 +47114,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(4, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); /* "View.MemoryView":563 * def suboffsets(self): @@ -42966,12 +47125,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__51 = PyTuple_New(1); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(4, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); + __pyx_tuple__61 = PyTuple_New(1); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__51, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__51); + PyTuple_SET_ITEM(__pyx_tuple__61, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__61); + + /* "(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__62 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + + /* "(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__63 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); /* "View.MemoryView":668 * if item is Ellipsis: @@ -42980,9 +47158,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__52 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__52)) __PYX_ERR(4, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__52); - __Pyx_GIVEREF(__pyx_slice__52); + __pyx_slice__64 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__64)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__64); + __Pyx_GIVEREF(__pyx_slice__64); /* "View.MemoryView":671 * seen_ellipsis = True @@ -42991,9 +47169,9 @@ * have_slices = True * else: */ - __pyx_slice__53 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__53)) __PYX_ERR(4, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__53); - __Pyx_GIVEREF(__pyx_slice__53); + __pyx_slice__65 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__65)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__65); + __Pyx_GIVEREF(__pyx_slice__65); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -43002,9 +47180,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__54 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__54)) __PYX_ERR(4, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__54); - __Pyx_GIVEREF(__pyx_slice__54); + __pyx_slice__66 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__66)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__66); + __Pyx_GIVEREF(__pyx_slice__66); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -43013,9 +47191,28 @@ * * */ - __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(4, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + + /* "(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__68 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + + /* "(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__69 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); /* "yt/frontends/artio/_artio_caller.pyx":696 * @@ -43024,10 +47221,10 @@ * cdef artio_fileset_handle *handle = artio_fileset_open( file_prefix, * ARTIO_OPEN_HEADER, artio_context_global ) */ - __pyx_tuple__56 = PyTuple_Pack(3, __pyx_n_s_file_prefix, __pyx_n_s_file_prefix, __pyx_n_s_handle); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); - __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_artio_is_valid, 696, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_tuple__70 = PyTuple_Pack(3, __pyx_n_s_file_prefix, __pyx_n_s_file_prefix, __pyx_n_s_handle); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_frontends_artio__artio_caller, __pyx_n_s_artio_is_valid, 696, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 696, __pyx_L1_error) /* "yt/frontends/artio/_artio_caller.pyx":868 * self.oct_count = None @@ -43036,10 +47233,20 @@ * cdef int coords[3] * artio_sfc_coords(handle.handle, s, coords) */ - __pyx_tuple__58 = PyTuple_Pack(3, __pyx_n_s_handle, __pyx_n_s_s, __pyx_n_s_coords); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 868, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_get_coords, 868, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_tuple__72 = PyTuple_Pack(3, __pyx_n_s_handle, __pyx_n_s_s, __pyx_n_s_coords); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 868, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_frontends_artio__artio_caller, __pyx_n_s_get_coords, 868, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 868, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __pyx_unpickle_SFCRangeSelector(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xde40fc3: + * from pickle import PickleError + */ + __pyx_tuple__74 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SFCRangeSelector, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(1, 1, __pyx_L1_error) /* "View.MemoryView":282 * return self.name @@ -43048,9 +47255,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(4, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__60); - __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); /* "View.MemoryView":283 * @@ -43059,9 +47266,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(4, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -43070,9 +47277,9 @@ * * */ - __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(4, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__62); - __Pyx_GIVEREF(__pyx_tuple__62); + __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); /* "View.MemoryView":287 * @@ -43081,9 +47288,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(4, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__63); - __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); /* "View.MemoryView":288 * @@ -43092,9 +47299,19 @@ * * */ - __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(4, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__64); - __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__81 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -43109,6 +47326,8 @@ __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_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __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_233050051 = PyInt_FromLong(233050051L); if (unlikely(!__pyx_int_233050051)) __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:; @@ -43175,6 +47394,7 @@ __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 @@ -43211,10 +47431,12 @@ if (PyType_Ready(&__pyx_type_2yt_9frontends_5artio_13_artio_caller_artio_fileset) < 0) __PYX_ERR(0, 160, __pyx_L1_error) __pyx_type_2yt_9frontends_5artio_13_artio_caller_artio_fileset.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "artio_fileset", (PyObject *)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_artio_fileset) < 0) __PYX_ERR(0, 160, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_artio_fileset) < 0) __PYX_ERR(0, 160, __pyx_L1_error) __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_artio_fileset = &__pyx_type_2yt_9frontends_5artio_13_artio_caller_artio_fileset; if (PyType_Ready(&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler) < 0) __PYX_ERR(0, 705, __pyx_L1_error) __pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "ARTIOSFCRangeHandler", (PyObject *)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler) < 0) __PYX_ERR(0, 705, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler) < 0) __PYX_ERR(0, 705, __pyx_L1_error) __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler = &__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler; __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -43226,6 +47448,7 @@ __pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer.tp_dict, __pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer) < 0) __PYX_ERR(0, 893, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "ARTIOOctreeContainer", (PyObject *)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer) < 0) __PYX_ERR(0, 893, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer) < 0) __PYX_ERR(0, 893, __pyx_L1_error) __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer = &__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer; __pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer = &__pyx_vtable_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer; __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer.pos_to_sfc = (__pyx_t_5numpy_int64_t (*)(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_pos_to_sfc; @@ -43235,6 +47458,7 @@ __pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer.tp_dict, __pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer) < 0) __PYX_ERR(0, 1258, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "ARTIORootMeshContainer", (PyObject *)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer) < 0) __PYX_ERR(0, 1258, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer) < 0) __PYX_ERR(0, 1258, __pyx_L1_error) __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer = &__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer; __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -43250,15 +47474,18 @@ __pyx_type_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector.tp_dict, __pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector) < 0) __PYX_ERR(0, 1630, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "SFCRangeSelector", (PyObject *)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector) < 0) __PYX_ERR(0, 1630, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector) < 0) __PYX_ERR(0, 1630, __pyx_L1_error) __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector = &__pyx_type_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector; __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(4, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(4, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(4, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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; @@ -43268,18 +47495,20 @@ __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(4, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(4, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(4, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(4, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -43289,11 +47518,11 @@ sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(5, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 861, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = __Pyx_ImportType("yt.geometry.oct_visitors", "OctVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(6, 33, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(6, 33, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = __Pyx_ImportType("yt.geometry.oct_visitors", "CountTotalOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts)) __PYX_ERR(6, 59, __pyx_L1_error) @@ -43332,16 +47561,22 @@ __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(6, 114, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType("yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(6, 117, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(6, 117, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 71, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 71, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 74, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 74, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(7, 57, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(7, 57, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(7, 97, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(7, 97, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation = __Pyx_ImportType("yt.geometry.particle_deposit", "ParticleDepositOperation", sizeof(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation)) __PYX_ERR(3, 134, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation = (struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation)) __PYX_ERR(3, 134, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(4, 67, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(4, 67, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(4, 70, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(4, 70, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType("yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(4, 74, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(4, 74, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = __Pyx_ImportType("yt.utilities.lib.allocation_container", "ObjectPool", sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(7, 26, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(7, 26, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = __Pyx_ImportType("yt.geometry.oct_container", "OctObjectPool", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(8, 55, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(8, 55, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(8, 63, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(8, 63, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(8, 102, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(8, 102, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation = __Pyx_ImportType("yt.geometry.particle_deposit", "ParticleDepositOperation", sizeof(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation)) __PYX_ERR(2, 134, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation = (struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation)) __PYX_ERR(2, 134, __pyx_L1_error) /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportVoidPtr(__pyx_t_1, "ORDER_MAX", (void **)&__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -43418,7 +47653,7 @@ * cdef artio_fileset_handle *handle = artio_fileset_open( file_prefix, * ARTIO_OPEN_HEADER, artio_context_global ) */ - __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_2yt_9frontends_5artio_13_artio_caller_1artio_is_valid, NULL, __pyx_n_s_yt_frontends_artio__artio_caller); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_2yt_9frontends_5artio_13_artio_caller_1artio_is_valid, NULL, __pyx_n_s_yt_frontends_artio__artio_caller_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_artio_is_valid, __pyx_t_4) < 0) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -43430,7 +47665,7 @@ * cdef int coords[3] * artio_sfc_coords(handle.handle, s, coords) */ - __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_2yt_9frontends_5artio_13_artio_caller_3get_coords, NULL, __pyx_n_s_yt_frontends_artio__artio_caller); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_2yt_9frontends_5artio_13_artio_caller_3get_coords, NULL, __pyx_n_s_yt_frontends_artio__artio_caller_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_coords, __pyx_t_4) < 0) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -43444,6 +47679,16 @@ */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sfc_subset_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) < 0) __PYX_ERR(0, 1696, __pyx_L1_error) + /* "(tree fragment)":1 + * def __pyx_unpickle_SFCRangeSelector(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xde40fc3: + * from pickle import PickleError + */ + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_2yt_9frontends_5artio_13_artio_caller_5__pyx_unpickle_SFCRangeSelector, NULL, __pyx_n_s_yt_frontends_artio__artio_caller_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SFCRangeSelector, __pyx_t_4) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* "yt/frontends/artio/_artio_caller.pyx":1 * cimport cython # <<<<<<<<<<<<<< * import numpy as np @@ -43461,9 +47706,9 @@ * * def __dealloc__(array self): */ - __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 207, __pyx_L1_error) + __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(4, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_array_type); @@ -43474,7 +47719,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 282, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_4); @@ -43488,7 +47733,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 283, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_4); @@ -43502,7 +47747,7 @@ * * */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 284, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_4); @@ -43516,7 +47761,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 287, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_4); @@ -43530,7 +47775,7 @@ * * */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 288, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_4); @@ -43570,9 +47815,9 @@ * * */ - __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 535, __pyx_L1_error) + __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(4, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_memoryview_type); @@ -43583,18 +47828,28 @@ * * */ - __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 981, __pyx_L1_error) + __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(4, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_4) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -43607,7 +47862,7 @@ __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.frontends.artio._artio_caller", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.frontends.artio._artio_caller", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -43734,17 +47989,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -43863,8 +48123,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON @@ -43924,11 +48184,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -43951,7 +48207,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -43972,7 +48228,7 @@ #endif /* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); @@ -43990,7 +48246,7 @@ } /* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE + #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; @@ -44014,7 +48270,7 @@ #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -44177,7 +48433,7 @@ #endif /* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + 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; @@ -44219,7 +48475,7 @@ } /* RaiseDoubleKeywords */ - static void __Pyx_RaiseDoubleKeywordsError( + static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { @@ -44233,7 +48489,7 @@ } /* ParseKeywords */ - static int __Pyx_ParseOptionalKeywords( + static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, @@ -44335,7 +48591,7 @@ } /* RaiseArgTupleInvalid */ - static void __Pyx_RaiseArgtupleInvalid( + static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, @@ -44361,7 +48617,7 @@ } /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -44372,9 +48628,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -44387,9 +48646,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -44442,7 +48704,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -44558,7 +48820,7 @@ #endif /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -44582,7 +48844,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -44592,7 +48854,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -44653,7 +48915,7 @@ } /* ImportFrom */ - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + 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, @@ -44667,7 +48929,7 @@ } /* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -44685,7 +48947,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -44705,7 +48976,7 @@ } /* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -44745,6 +49016,21 @@ 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; @@ -44789,7 +49075,7 @@ } /* SetItemInt */ - static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); @@ -44837,7 +49123,7 @@ } /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -44870,7 +49156,7 @@ } /* ArgTypeTest */ - static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); @@ -44897,7 +49183,7 @@ } /* BufferFormatCheck */ - static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; } @@ -45447,7 +49733,7 @@ } /* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -45460,26 +49746,26 @@ } /* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { + static void __Pyx_RaiseBufferFallbackError(void) { PyErr_SetString(PyExc_ValueError, "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); } /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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"); } /* IterFinish */ - static CYTHON_INLINE int __Pyx_IterFinish(void) { + static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; @@ -45514,7 +49800,7 @@ } /* UnpackItemEndCheck */ - static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); @@ -45526,7 +49812,7 @@ } /* PyObjectCallMethod1 */ - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto done; @@ -45572,7 +49858,7 @@ } /* append */ - static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { @@ -45585,7 +49871,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { @@ -45701,12 +49987,12 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* MemviewSliceInit */ - static int + static int __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, @@ -45840,21 +50126,8 @@ } } -/* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -/* 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) { + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) @@ -45866,8 +50139,54 @@ return PyObject_GetAttr(o, n); } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +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; + } +} + +/* RaiseNoneIterError */ + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* 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; +} + /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -45892,7 +50211,7 @@ #endif /* None */ - static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + 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)); @@ -45900,7 +50219,7 @@ } /* CallNextTpDealloc */ - static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { PyTypeObject* type = Py_TYPE(obj); while (type && type->tp_dealloc != current_tp_dealloc) type = type->tp_base; @@ -45911,7 +50230,7 @@ } /* CallNextTpTraverse */ - static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { PyTypeObject* type = Py_TYPE(obj); while (type && type->tp_traverse != current_tp_traverse) type = type->tp_base; @@ -45923,7 +50242,7 @@ } /* CallNextTpClear */ - static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { PyTypeObject* type = Py_TYPE(obj); while (type && type->tp_clear != current_tp_clear) type = type->tp_base; @@ -45933,8 +50252,73 @@ type->tp_clear(obj); } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -45954,7 +50338,7 @@ } /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -45971,8 +50355,42 @@ return -1; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -46052,7 +50470,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -46111,12 +50529,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -46155,8 +50576,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -46179,7 +50600,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -46215,7 +50636,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -46227,8 +50648,39 @@ return cobj; } +/* 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)\ + #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) @@ -46250,7 +50702,38 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(npy_int32) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int32) <= 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_int32), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -46281,7 +50764,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -46312,7 +50795,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -46343,7 +50826,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -46374,38 +50857,7 @@ } /* 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); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -46436,7 +50888,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -46467,7 +50919,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -46487,7 +50939,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -46622,7 +51074,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -46642,7 +51094,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -46777,7 +51229,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -46808,7 +51260,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -46845,49 +51297,238 @@ 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; + 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 int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { - const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; + static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if (sizeof(int64_t) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (int64_t) val; + return (npy_int32) val; } } else #endif @@ -46896,32 +51537,32 @@ #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { - case 0: return (int64_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0]) + case 0: return (npy_int32) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0]) case 2: - if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) { - return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) { + return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); } } break; case 3: - if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) { - return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) { + return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); } } break; case 4: - if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_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(int64_t) >= 4 * PyLong_SHIFT) { - return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) { + return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); } } break; @@ -46935,86 +51576,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (int64_t) -1; + return (npy_int32) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif - if (sizeof(int64_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { - case 0: return (int64_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, +digits[0]) + case 0: return (npy_int32) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0]) case -2: - if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { - return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); + __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { + return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case 2: - if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { - return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { + return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case -3: - if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { - return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); + __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { + return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case 3: - if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { - return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { + return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case -4: - if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_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(int64_t) - 1 > 4 * PyLong_SHIFT) { - return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); + __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { + return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case 4: - if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_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(int64_t) - 1 > 4 * PyLong_SHIFT) { - return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { + return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; } #endif - if (sizeof(int64_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -47023,7 +51664,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - int64_t val; + npy_int32 val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -47043,28 +51684,28 @@ return val; } #endif - return (int64_t) -1; + return (npy_int32) -1; } } else { - int64_t val; + npy_int32 val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int64_t) -1; - val = __Pyx_PyInt_As_int64_t(tmp); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int64_t"); - return (int64_t) -1; + "value too large to convert to npy_int32"); + return (npy_int32) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int64_t"); - return (int64_t) -1; + "can't convert negative value to npy_int32"); + return (npy_int32) -1; } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -47253,19 +51894,19 @@ } /* 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; + static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { + const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 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)) + if (sizeof(int64_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int64_t, 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; + return (int64_t) val; } } else #endif @@ -47274,32 +51915,32 @@ #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 0: return (int64_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0]) case 2: - if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(int64_t) > 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])); + __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) { + return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 3: - if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(int64_t) > 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])); + __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) { + return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 4: - if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(int64_t) > 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])); + __PYX_VERIFY_RETURN_INT(int64_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(int64_t) >= 4 * PyLong_SHIFT) { + return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; @@ -47313,86 +51954,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (npy_int64) -1; + return (int64_t) -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)) + if (sizeof(int64_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int64_t, 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)) + } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int64_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 (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 0: return (int64_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, +digits[0]) case -2: - if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(int64_t) - 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]))); + __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { + return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 2: - if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(int64_t) > 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]))); + __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { + return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -3: - if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(int64_t) - 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]))); + __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { + return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 3: - if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(int64_t) > 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]))); + __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { + return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -4: - if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(int64_t) - 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]))); + __PYX_VERIFY_RETURN_INT(int64_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(int64_t) - 1 > 4 * PyLong_SHIFT) { + return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 4: - if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(int64_t) > 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]))); + __PYX_VERIFY_RETURN_INT(int64_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(int64_t) - 1 > 4 * PyLong_SHIFT) { + return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; } #endif - if (sizeof(npy_int64) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x)) + if (sizeof(int64_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int64_t, 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)) + } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -47401,7 +52042,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - npy_int64 val; + int64_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -47421,40 +52062,40 @@ return val; } #endif - return (npy_int64) -1; + return (int64_t) -1; } } else { - npy_int64 val; + int64_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (npy_int64) -1; - val = __Pyx_PyInt_As_npy_int64(tmp); + if (!tmp) return (int64_t) -1; + val = __Pyx_PyInt_As_int64_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to npy_int64"); - return (npy_int64) -1; + "value too large to convert to int64_t"); + return (int64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to npy_int64"); - return (npy_int64) -1; + "can't convert negative value to int64_t"); + return (int64_t) -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; + 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(size_t) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (size_t) val; + return (long) val; } } else #endif @@ -47463,32 +52104,32 @@ #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 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: - if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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; @@ -47502,86 +52143,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (size_t) -1; + return (long) -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)) + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } 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 (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 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(size_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(size_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(size_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(size_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -47590,7 +52231,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - size_t val; + long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -47610,40 +52251,40 @@ return val; } #endif - return (size_t) -1; + return (long) -1; } } else { - size_t val; + long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (size_t) -1; - val = __Pyx_PyInt_As_size_t(tmp); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t) -1; + "value too large to convert to long"); + return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to size_t"); - return (size_t) -1; + "can't convert negative value to long"); + return (long) -1; } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; + 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(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(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 (long) val; + return (size_t) val; } } else #endif @@ -47652,32 +52293,32 @@ #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 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(size_t) > 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])); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(size_t) > 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])); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(size_t) > 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])); + __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; @@ -47691,86 +52332,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (long) -1; + return (size_t) -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)) + 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(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } 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 (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 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(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(size_t) - 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]))); + __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(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(size_t) > 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]))); + __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(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(size_t) - 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]))); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(size_t) > 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]))); + __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(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(size_t) - 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]))); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(size_t) > 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]))); + __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(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, 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)) + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -47779,7 +52420,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - long val; + size_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -47799,28 +52440,28 @@ return val; } #endif - return (long) -1; + return (size_t) -1; } } else { - long val; + size_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + 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 long"); - return (long) -1; + "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 long"); - return (long) -1; + "can't convert negative value to size_t"); + return (size_t) -1; } /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + 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 @@ -48009,7 +52650,7 @@ } /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -48050,7 +52691,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -48232,7 +52873,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_psdc_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_psdc_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_PTR | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) }; @@ -48255,7 +52896,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -48278,7 +52919,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -48294,7 +52935,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -48312,7 +52953,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -48377,7 +53018,7 @@ #endif /* VoidPtrImport */ - #ifndef __PYX_HAVE_RT_ImportVoidPtr + #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; @@ -48426,7 +53067,7 @@ #endif /* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction + #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; @@ -48480,7 +53121,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -48505,6 +53146,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -48513,11 +53156,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/frontends/artio/_artio_caller.pyx yt-3.4.0/yt/frontends/artio/_artio_caller.pyx --- yt-3.3.3/yt/frontends/artio/_artio_caller.pyx 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/artio/_artio_caller.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -7,7 +7,7 @@ SelectorObject, AlwaysSelector, OctreeSubsetSelector from yt.utilities.lib.fp_utils cimport imax from yt.geometry.oct_container cimport \ - SparseOctreeContainer + SparseOctreeContainer, OctObjectPool from yt.geometry.oct_visitors cimport Oct from yt.geometry.particle_deposit cimport \ ParticleDepositOperation @@ -923,7 +923,7 @@ super(ARTIOOctreeContainer, self).__init__(dims, DLE, DRE) self.artio_handle = range_handler.artio_handle self.level_offset = 1 - self.domains = NULL + self.domains = OctObjectPool() self.root_nodes = NULL @cython.boundscheck(False) @@ -949,7 +949,7 @@ # We only allow one root oct. self.append_domain(oct_count) - self.domains[self.num_domains - 1].con_id = sfc + self.domains.containers[self.num_domains - 1].con_id = sfc oct_ind = -1 ipos = 0 @@ -1009,7 +1009,7 @@ source_arrays = [] ipos = -1 for i in range(self.num_domains): - ipos = imax(ipos, self.domains[i].n) + ipos = imax(ipos, self.domains.containers[i].n) for i in range(nf): field_ind[i] = field_indices[i] # Note that we subtract one, because we're not using the root mesh. @@ -1029,13 +1029,13 @@ # double-loop to calculate domain_counts # The cons should be in order cdef np.int64_t sfc_start, sfc_end - sfc_start = self.domains[0].con_id - sfc_end = self.domains[self.num_domains - 1].con_id + sfc_start = self.domains.containers[0].con_id + sfc_end = self.domains.containers[self.num_domains - 1].con_id status = artio_grid_cache_sfc_range(handle, sfc_start, sfc_end) check_artio_status(status) cdef np.int64_t offset = 0 for si in range(self.num_domains): - sfc = self.domains[si].con_id + sfc = self.domains.containers[si].con_id status = artio_grid_read_root_cell_begin( handle, sfc, dpos, NULL, &num_oct_levels, num_octs_per_level) check_artio_status(status) diff -Nru yt-3.3.3/yt/frontends/artio/data_structures.py yt-3.4.0/yt/frontends/artio/data_structures.py --- yt-3.3.3/yt/frontends/artio/data_structures.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/artio/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -40,7 +40,7 @@ Dataset from yt.data_objects.octree_subset import \ OctreeSubset -from yt.data_objects.data_containers import \ +from yt.data_objects.field_data import \ YTFieldData from yt.utilities.exceptions import \ YTParticleDepositionNotImplemented diff -Nru yt-3.3.3/yt/frontends/artio/fields.py yt-3.4.0/yt/frontends/artio/fields.py --- yt-3.3.3/yt/frontends/artio/fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/artio/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -59,8 +59,8 @@ ("MASS", ("code_mass", ["particle_mass"], None)), ("PID", ("", ["particle_index"], None)), ("SPECIES", ("", ["particle_type"], None)), - ("BIRTH_TIME", ("", [], None)), # code-units defined as dimensionless to - # avoid incorrect conversion + ("BIRTH_TIME", ("", [], None)), # code-units defined as dimensionless to + # avoid incorrect conversion ("INITIAL_MASS", ("code_mass", ["initial_mass"], None)), ("METALLICITY_SNIa", ("", ["metallicity_snia"], None)), ("METALLICITY_SNII", ("", ["metallicity_snii"], None)), @@ -73,7 +73,7 @@ return data["momentum_%s" % axis]/data["density"] return velocity for ax in 'xyz': - self.add_field(("gas", "velocity_%s" % ax), + self.add_field(("gas", "velocity_%s" % ax), sampling_type="cell", function = _get_vel(ax), units = unit_system["velocity"]) @@ -97,10 +97,10 @@ # TODO: The conversion factor here needs to be addressed, as previously # it was set as: # unit_T = unit_v**2.0*mb / constants.k - self.add_field(("gas", "temperature"), function = _temperature, + self.add_field(("gas", "temperature"), sampling_type="cell", function = _temperature, units = unit_system["temperature"]) - # Create a metal_density field as sum of existing metal fields. + # Create a metal_density field as sum of existing metal fields. flag1 = ("artio", "HVAR_METAL_DENSITY_Ia") in self.field_list flag2 = ("artio", "HVAR_METAL_DENSITY_II") in self.field_list if flag1 or flag2: @@ -117,7 +117,7 @@ def _metal_density(field, data): tr = data["metal_ii_density"] return tr - self.add_field(("gas","metal_density"), + self.add_field(("gas","metal_density"), sampling_type="cell", function=_metal_density, units=unit_system["density"], take_log=True) @@ -125,7 +125,7 @@ def setup_particle_fields(self, ptype): if ptype == "STAR": def _creation_time(field,data): - # this test is necessary to avoid passing invalid tcode values + # this test is necessary to avoid passing invalid tcode values # to the function tphys_from_tcode during field detection # (1.0 is not a valid tcode value) if isinstance(data, FieldDetector): @@ -137,21 +137,18 @@ return data["STAR","creation_time"] return data.ds.current_time - data["STAR","creation_time"] - self.add_field((ptype, "creation_time"), function=_creation_time, units="yr", - particle_type=True) - self.add_field((ptype, "age"), function=_age, units="yr", - particle_type=True) + self.add_field((ptype, "creation_time"), sampling_type="particle", function=_creation_time, units="yr") + self.add_field((ptype, "age"), sampling_type="particle", function=_age, units="yr") if self.ds.cosmological_simulation: def _creation_redshift(field,data): - # this test is necessary to avoid passing invalid tcode values + # this test is necessary to avoid passing invalid tcode values # to the function auni_from_tcode during field detection # (1.0 is not a valid tcode value) if isinstance(data, FieldDetector): return data["STAR","BIRTH_TIME"] return 1.0/data.ds._handle.auni_from_tcode_array(data["STAR","BIRTH_TIME"]) - 1.0 - self.add_field((ptype, "creation_redshift"), function=_creation_redshift, - particle_type=True) + self.add_field((ptype, "creation_redshift"), sampling_type="particle", function=_creation_redshift) super(ARTIOFieldInfo, self).setup_particle_fields(ptype) diff -Nru yt-3.3.3/yt/frontends/artio/tests/test_outputs.py yt-3.4.0/yt/frontends/artio/tests/test_outputs.py --- yt-3.3.3/yt/frontends/artio/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/artio/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -34,7 +34,7 @@ def test_sizmbhloz(): ds = data_dir_load(sizmbhloz) ds.max_range = 1024*1024 - yield assert_equal, str(ds), "sizmbhloz-clref04SNth-rs9_a0.9011.art" + assert_equal(str(ds), "sizmbhloz-clref04SNth-rs9_a0.9011.art") dso = [ None, ("sphere", ("max", (0.1, 'unitary')))] for dobj_name in dso: for field in _fields: @@ -47,7 +47,7 @@ dobj = create_obj(ds, dobj_name) s1 = dobj["ones"].sum() s2 = sum(mask.sum() for block, mask in dobj.blocks) - yield assert_equal, s1, s2 + assert_equal(s1, s2) assert_equal(ds.particle_type_counts, {'N-BODY': 100000, 'STAR': 110650}) @@ -57,5 +57,4 @@ @requires_file(sizmbhloz) def test_units_override(): - for test in units_override_check(sizmbhloz): - yield test + units_override_check(sizmbhloz) diff -Nru yt-3.3.3/yt/frontends/athena/fields.py yt-3.4.0/yt/frontends/athena/fields.py --- yt-3.3.3/yt/frontends/athena/fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/athena/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -51,82 +51,64 @@ vel_field = ("athena", "velocity_%s" % comp) mom_field = ("athena", "momentum_%s" % comp) if vel_field in self.field_list: - self.add_output_field(vel_field, units="code_length/code_time") + self.add_output_field(vel_field, sampling_type="cell", units="code_length/code_time") self.alias(("gas","velocity_%s" % comp), vel_field, units=unit_system["velocity"]) elif mom_field in self.field_list: - self.add_output_field(mom_field, + self.add_output_field(mom_field, sampling_type="cell", units="code_mass/code_time/code_length**2") - self.add_field(("gas","velocity_%s" % comp), + self.add_field(("gas","velocity_%s" % comp), sampling_type="cell", function=velocity_field(comp), units = unit_system["velocity"]) # Add pressure, energy, and temperature fields - def ekin1(data): - return 0.5*(data["athena","momentum_x"]**2 + - data["athena","momentum_y"]**2 + - data["athena","momentum_z"]**2)/data["athena","density"] - def ekin2(data): - return 0.5*(data["athena","velocity_x"]**2 + - data["athena","velocity_y"]**2 + - data["athena","velocity_z"]**2)*data["athena","density"] - def emag(data): - return 0.5*(data["cell_centered_B_x"]**2 + - data["cell_centered_B_y"]**2 + - data["cell_centered_B_z"]**2) def eint_from_etot(data): eint = data["athena","total_energy"] - eint -= ekin1(data) + eint -= data["gas","kinetic_energy"] if ("athena","cell_centered_B_x") in self.field_list: - eint -= emag(data) + eint -= data["gas","magnetic_energy"] return eint def etot_from_pres(data): etot = data["athena","pressure"]/(data.ds.gamma-1.) - etot += ekin2(data) + etot += data["gas", "kinetic_energy"] if ("athena","cell_centered_B_x") in self.field_list: - etot += emag(data) + etot += data["gas", "magnetic_energy"] return etot if ("athena","pressure") in self.field_list: - self.add_output_field(("athena","pressure"), + self.add_output_field(("athena","pressure"), sampling_type="cell", units=pres_units) self.alias(("gas","pressure"),("athena","pressure"), units=unit_system["pressure"]) def _thermal_energy(field, data): return data["athena","pressure"] / \ (data.ds.gamma-1.)/data["athena","density"] - self.add_field(("gas","thermal_energy"), + self.add_field(("gas","thermal_energy"), sampling_type="cell", function=_thermal_energy, units=unit_system["specific_energy"]) def _total_energy(field, data): return etot_from_pres(data)/data["athena","density"] - self.add_field(("gas","total_energy"), + self.add_field(("gas","total_energy"), sampling_type="cell", function=_total_energy, units=unit_system["specific_energy"]) elif ("athena","total_energy") in self.field_list: - self.add_output_field(("athena","total_energy"), + self.add_output_field(("athena","total_energy"), sampling_type="cell", units=pres_units) - def _pressure(field, data): - return eint_from_etot(data)*(data.ds.gamma-1.0) - self.add_field(("gas","pressure"), function=_pressure, - units=unit_system["pressure"]) def _thermal_energy(field, data): return eint_from_etot(data)/data["athena","density"] - self.add_field(("gas","thermal_energy"), + self.add_field(("gas","thermal_energy"), sampling_type="cell", function=_thermal_energy, units=unit_system["specific_energy"]) def _total_energy(field, data): return data["athena","total_energy"]/data["athena","density"] - self.add_field(("gas","total_energy"), + self.add_field(("gas","total_energy"), sampling_type="cell", function=_total_energy, units=unit_system["specific_energy"]) - + # Add temperature field def _temperature(field, data): if data.has_field_parameter("mu"): mu = data.get_field_parameter("mu") else: mu = 0.6 return mu*mh*data["gas","pressure"]/data["gas","density"]/kboltz - self.add_field(("gas","temperature"), function=_temperature, + self.add_field(("gas","temperature"), sampling_type="cell", function=_temperature, units=unit_system["temperature"]) setup_magnetic_field_aliases(self, "athena", ["cell_centered_B_%s" % ax for ax in "xyz"]) - - diff -Nru yt-3.3.3/yt/frontends/athena/tests/test_outputs.py yt-3.4.0/yt/frontends/athena/tests/test_outputs.py --- yt-3.3.3/yt/frontends/athena/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/athena/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -33,7 +33,7 @@ @requires_ds(cloud) def test_cloud(): ds = data_dir_load(cloud) - yield assert_equal, str(ds), "Cloud.0050" + assert_equal(str(ds), "Cloud.0050") for test in small_patch_amr(ds, _fields_cloud): test_cloud.__name__ = test.description yield test @@ -44,7 +44,7 @@ @requires_ds(blast) def test_blast(): ds = data_dir_load(blast) - yield assert_equal, str(ds), "Blast.0100" + assert_equal(str(ds), "Blast.0100") for test in small_patch_amr(ds, _fields_blast): test_blast.__name__ = test.description yield test @@ -73,7 +73,7 @@ @requires_ds(stripping, big_data=True) def test_stripping(): ds = data_dir_load(stripping, kwargs={"units_override":uo_stripping}) - yield assert_equal, str(ds), "rps.0062" + assert_equal(str(ds), "rps.0062") for test in small_patch_amr(ds, _fields_stripping): test_stripping.__name__ = test.description yield test @@ -100,12 +100,16 @@ assert_equal(ds3.time_unit, u.Myr) assert_equal(ds3.mass_unit, 1e14*u.Msun) - yield assert_equal, sp1.quantities.extrema("pressure"), sp2.quantities.extrema("pressure") - yield assert_allclose_units, sp1.quantities.total_quantity("pressure"), sp2.quantities.total_quantity("pressure") + assert_equal(sp1.quantities.extrema("pressure"), + sp2.quantities.extrema("pressure")) + assert_allclose_units(sp1.quantities.total_quantity("pressure"), + sp2.quantities.total_quantity("pressure")) for ax in "xyz": - yield assert_equal, sp1.quantities.extrema("velocity_%s" % ax), sp2.quantities.extrema("velocity_%s" % ax) - yield assert_allclose_units, sp1.quantities.bulk_velocity(), sp2.quantities.bulk_velocity() - yield assert_equal, prj1["density"], prj2["density"] + assert_equal(sp1.quantities.extrema("velocity_%s" % ax), + sp2.quantities.extrema("velocity_%s" % ax)) + assert_allclose_units(sp1.quantities.bulk_velocity(), + sp2.quantities.bulk_velocity()) + assert_equal(prj1["density"], prj2["density"]) ytcfg["yt","skip_dataset_cache"] = "False" diff -Nru yt-3.3.3/yt/frontends/athena_pp/api.py yt-3.4.0/yt/frontends/athena_pp/api.py --- yt-3.3.3/yt/frontends/athena_pp/api.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/athena_pp/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,26 @@ +""" +API for yt.frontends.athena++ + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- +from .data_structures import \ + AthenaPPGrid, \ + AthenaPPHierarchy, \ + AthenaPPDataset + +from .fields import \ + AthenaPPFieldInfo + +from .io import \ + IOHandlerAthenaPP + +from . import tests diff -Nru yt-3.3.3/yt/frontends/athena_pp/data_structures.py yt-3.4.0/yt/frontends/athena_pp/data_structures.py --- yt-3.3.3/yt/frontends/athena_pp/data_structures.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/athena_pp/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,353 @@ +""" +Data structures for Athena. + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import numpy as np +import os +import weakref + +from yt.funcs import \ + mylog, get_pbar, \ + ensure_tuple +from yt.data_objects.grid_patch import \ + AMRGridPatch +from yt.geometry.grid_geometry_handler import \ + GridIndex +from yt.data_objects.static_output import \ + Dataset +from yt.geometry.geometry_handler import \ + YTDataChunk +from yt.utilities.file_handler import \ + HDF5FileHandler +from yt.geometry.unstructured_mesh_handler import \ + UnstructuredIndex +from yt.data_objects.unstructured_mesh import \ + SemiStructuredMesh +from itertools import chain, product +from .fields import AthenaPPFieldInfo + +geom_map = {"cartesian": "cartesian", + "cylindrical": "cylindrical", + "spherical_polar": "spherical", + "minkowski": "cartesian", + "tilted": "cartesian", + "sinusoidal": "cartesian", + "schwarzschild": "spherical", + "kerr-schild": "spherical"} + +_cis = np.fromiter(chain.from_iterable(product([0,1], [0,1], [0,1])), + dtype=np.int64, count = 8*3) +_cis.shape = (8, 3) + +class AthenaPPLogarithmicMesh(SemiStructuredMesh): + _index_offset = 0 + + def __init__(self, mesh_id, filename, connectivity_indices, + connectivity_coords, index, blocks, dims): + super(AthenaPPLogarithmicMesh, self).__init__(mesh_id, filename, + connectivity_indices, + connectivity_coords, index) + self.mesh_blocks = blocks + self.mesh_dims = dims + +class AthenaPPLogarithmicIndex(UnstructuredIndex): + def __init__(self, ds, dataset_type = 'athena_pp'): + self._handle = ds._handle + super(AthenaPPLogarithmicIndex, self).__init__(ds, dataset_type) + self.index_filename = self.dataset.filename + self.directory = os.path.dirname(self.dataset.filename) + self.dataset_type = dataset_type + + def _initialize_mesh(self): + mylog.debug("Setting up meshes.") + num_blocks = self._handle.attrs["NumMeshBlocks"] + log_loc = self._handle['LogicalLocations'] + levels = self._handle["Levels"] + x1f = self._handle["x1f"] + x2f = self._handle["x2f"] + x3f = self._handle["x3f"] + nbx, nby, nbz = tuple(np.max(log_loc, axis=0)+1) + nlevel = self._handle.attrs["MaxLevel"]+1 + + nb = np.array([nbx, nby, nbz], dtype='int') + self.mesh_factors = np.ones(3, dtype='int')*((nb > 1).astype("int")+1) + + block_grid = -np.ones((nbx,nby,nbz,nlevel), dtype=np.int) + block_grid[log_loc[:,0],log_loc[:,1],log_loc[:,2],levels[:]] = np.arange(num_blocks) + + block_list = np.arange(num_blocks, dtype='int64') + bc = [] + for i in range(num_blocks): + if block_list[i] >= 0: + ii, jj, kk = log_loc[i] + neigh = block_grid[ii:ii+2,jj:jj+2,kk:kk+2,levels[i]] + if np.all(neigh > -1): + loc_ids = neigh.transpose().flatten() + bc.append(loc_ids) + block_list[loc_ids] = -1 + else: + bc.append(np.array(i)) + block_list[i] = -1 + + num_meshes = len(bc) + + self.meshes = [] + pbar = get_pbar("Constructing meshes", num_meshes) + for i in range(num_meshes): + ob = bc[i][0] + x = x1f[ob,:] + y = x2f[ob,:] + z = x3f[ob,:] + if nbx > 1: + x = np.concatenate([x, x1f[bc[i][1],1:]]) + if nby > 1: + y = np.concatenate([y, x2f[bc[i][2],1:]]) + if nbz > 1: + z = np.concatenate([z, x3f[bc[i][4],1:]]) + nxm = x.size + nym = y.size + nzm = z.size + coords = np.zeros((nxm, nym, nzm, 3), dtype="float64", order="C") + coords[:,:,:,0] = x[:,None,None] + coords[:,:,:,1] = y[None,:,None] + coords[:,:,:,2] = z[None,None,:] + coords.shape = (nxm * nym * nzm, 3) + cycle = np.rollaxis(np.indices((nxm-1,nym-1,nzm-1)), 0, 4) + cycle.shape = ((nxm-1)*(nym-1)*(nzm-1), 3) + off = _cis + cycle[:, np.newaxis] + connectivity = ((off[:,:,0] * nym) + off[:,:,1]) * nzm + off[:,:,2] + mesh = AthenaPPLogarithmicMesh(i, self.index_filename, connectivity, + coords, self, bc[i], + np.array([nxm-1, nym-1, nzm-1])) + self.meshes.append(mesh) + pbar.update(i) + pbar.finish() + mylog.debug("Done setting up meshes.") + + def _detect_output_fields(self): + self.field_list = [("athena_pp", k) for k in self.ds._field_map] + + def _chunk_io(self, dobj, cache = True, local_only = False): + gobjs = getattr(dobj._current_chunk, "objs", dobj._chunk_info) + for subset in gobjs: + yield YTDataChunk(dobj, "io", [subset], + self._count_selection(dobj, [subset]), + cache = cache) + +class AthenaPPGrid(AMRGridPatch): + _id_offset = 0 + + def __init__(self, id, index, level): + AMRGridPatch.__init__(self, id, filename = index.index_filename, + index = index) + self.Parent = None + self.Children = [] + self.Level = level + + def _setup_dx(self): + # So first we figure out what the index is. We don't assume + # that dx=dy=dz , at least here. We probably do elsewhere. + id = self.id - self._id_offset + LE, RE = self.index.grid_left_edge[id,:], \ + self.index.grid_right_edge[id,:] + self.dds = self.ds.arr((RE-LE)/self.ActiveDimensions, "code_length") + if self.ds.dimensionality < 2: self.dds[1] = 1.0 + if self.ds.dimensionality < 3: self.dds[2] = 1.0 + self.field_data['dx'], self.field_data['dy'], self.field_data['dz'] = self.dds + + def __repr__(self): + return "AthenaPPGrid_%04i (%s)" % (self.id, self.ActiveDimensions) + +class AthenaPPHierarchy(GridIndex): + + grid = AthenaPPGrid + _dataset_type='athena_pp' + _data_file = None + + def __init__(self, ds, dataset_type='athena_pp'): + self.dataset = weakref.proxy(ds) + self.directory = os.path.dirname(self.dataset.filename) + self.dataset_type = dataset_type + # for now, the index file is the dataset! + self.index_filename = self.dataset.filename + self._handle = ds._handle + GridIndex.__init__(self, ds, dataset_type) + + def _detect_output_fields(self): + self.field_list = [("athena_pp", k) for k in self.dataset._field_map] + + def _count_grids(self): + self.num_grids = self._handle.attrs["NumMeshBlocks"] + + def _parse_index(self): + num_grids = self._handle.attrs["NumMeshBlocks"] + + self.grid_left_edge = np.zeros((num_grids, 3), dtype='float64') + self.grid_right_edge = np.zeros((num_grids, 3), dtype='float64') + self.grid_dimensions = np.zeros((num_grids, 3), dtype='int32') + + for i in range(num_grids): + x = self._handle["x1f"][i,:] + y = self._handle["x2f"][i,:] + z = self._handle["x3f"][i,:] + self.grid_left_edge[i] = np.array([x[0], y[0], z[0]], dtype='float64') + self.grid_right_edge[i] = np.array([x[-1], y[-1], z[-1]], dtype='float64') + self.grid_dimensions[i] = self._handle.attrs["MeshBlockSize"] + levels = self._handle["Levels"][:] + + self.grid_left_edge = self.ds.arr(self.grid_left_edge, "code_length") + self.grid_right_edge = self.ds.arr(self.grid_right_edge, "code_length") + + self.grids = np.empty(self.num_grids, dtype='object') + for i in range(num_grids): + self.grids[i] = self.grid(i, self, levels[i]) + + if self.dataset.dimensionality <= 2: + self.grid_right_edge[:,2] = self.dataset.domain_right_edge[2] + if self.dataset.dimensionality == 1: + self.grid_right_edge[:,1:] = self.dataset.domain_right_edge[1:] + self.grid_particle_count = np.zeros([self.num_grids, 1], dtype='int64') + + def _populate_grid_objects(self): + for g in self.grids: + g._prepare_grid() + g._setup_dx() + self.max_level = self._handle.attrs["MaxLevel"] + + def _chunk_io(self, dobj, cache = True, local_only = False): + gobjs = getattr(dobj._current_chunk, "objs", dobj._chunk_info) + for subset in gobjs: + yield YTDataChunk(dobj, "io", [subset], + self._count_selection(dobj, [subset]), + cache = cache) + +class AthenaPPDataset(Dataset): + _field_info_class = AthenaPPFieldInfo + _dataset_type = "athena_pp" + + def __init__(self, filename, dataset_type='athena_pp', + storage_filename=None, parameters=None, + units_override=None, unit_system="code"): + self.fluid_types += ("athena_pp",) + if parameters is None: + parameters = {} + self.specified_parameters = parameters + if units_override is None: + units_override = {} + self._handle = HDF5FileHandler(filename) + xrat = self._handle.attrs["RootGridX1"][2] + yrat = self._handle.attrs["RootGridX2"][2] + zrat = self._handle.attrs["RootGridX3"][2] + if xrat != 1.0 or yrat != 1.0 or zrat != 1.0: + self._index_class = AthenaPPLogarithmicIndex + self.logarithmic = True + else: + self._index_class = AthenaPPHierarchy + self.logarithmic = False + Dataset.__init__(self, filename, dataset_type, units_override=units_override, + unit_system=unit_system) + self.filename = filename + if storage_filename is None: + storage_filename = '%s.yt' % filename.split('/')[-1] + self.storage_filename = storage_filename + self.backup_filename = self.filename[:-4] + "_backup.gdf" + + def _set_code_unit_attributes(self): + """ + Generates the conversion to various physical _units based on the + parameter file + """ + if "length_unit" not in self.units_override: + self.no_cgs_equiv_length = True + for unit, cgs in [("length", "cm"), ("time", "s"), ("mass", "g"), + ("temperature", "K")]: + # We set these to cgs for now, but they may have been overriden + if getattr(self, unit+'_unit', None) is not None: + continue + mylog.warning("Assuming 1.0 = 1.0 %s", cgs) + setattr(self, "%s_unit" % unit, self.quan(1.0, cgs)) + + self.magnetic_unit = np.sqrt(4*np.pi * self.mass_unit / + (self.time_unit**2 * self.length_unit)) + self.magnetic_unit.convert_to_units("gauss") + self.velocity_unit = self.length_unit / self.time_unit + + def _parse_parameter_file(self): + + xmin, xmax = self._handle.attrs["RootGridX1"][:2] + ymin, ymax = self._handle.attrs["RootGridX2"][:2] + zmin, zmax = self._handle.attrs["RootGridX3"][:2] + + self.domain_left_edge = np.array([xmin, ymin, zmin], dtype='float64') + self.domain_right_edge = np.array([xmax, ymax, zmax], dtype='float64') + + self.geometry = geom_map[self._handle.attrs["Coordinates"].decode('utf-8')] + self.domain_width = self.domain_right_edge-self.domain_left_edge + self.domain_dimensions = self._handle.attrs["RootGridSize"] + + self._field_map = {} + k = 0 + for (i, dname), num_var in zip(enumerate(self._handle.attrs["DatasetNames"]), + self._handle.attrs["NumVariables"]): + for j in range(num_var): + fname = self._handle.attrs["VariableNames"][k].decode("ascii","ignore") + self._field_map[fname] = (dname.decode("ascii","ignore"), j) + k += 1 + + self.refine_by = 2 + dimensionality = 3 + if self.domain_dimensions[2] == 1: + dimensionality = 2 + if self.domain_dimensions[1] == 1: + dimensionality = 1 + self.dimensionality = dimensionality + self.current_time = self._handle.attrs["Time"] + self.unique_identifier = self.parameter_filename.__hash__() + self.cosmological_simulation = False + self.num_ghost_zones = 0 + self.field_ordering = 'fortran' + self.boundary_conditions = [1]*6 + if 'periodicity' in self.specified_parameters: + self.periodicity = ensure_tuple(self.specified_parameters['periodicity']) + else: + self.periodicity = (True,True,True,) + if 'gamma' in self.specified_parameters: + self.gamma = float(self.specified_parameters['gamma']) + else: + self.gamma = 5./3. + + self.current_redshift = self.omega_lambda = self.omega_matter = \ + self.hubble_constant = self.cosmological_simulation = 0.0 + self.parameters['Time'] = self.current_time # Hardcode time conversion for now. + self.parameters["HydroMethod"] = 0 # Hardcode for now until field staggering is supported. + if "gamma" in self.specified_parameters: + self.parameters["Gamma"] = self.specified_parameters["gamma"] + else: + self.parameters["Gamma"] = 5./3. + + @classmethod + def _is_valid(self, *args, **kwargs): + try: + if args[0].endswith('athdf'): + return True + except: + pass + return False + + @property + def _skip_cache(self): + return True + + def __repr__(self): + return self.basename.rsplit(".", 1)[0] diff -Nru yt-3.3.3/yt/frontends/athena_pp/definitions.py yt-3.4.0/yt/frontends/athena_pp/definitions.py --- yt-3.3.3/yt/frontends/athena_pp/definitions.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/athena_pp/definitions.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,14 @@ +""" +Various definitions for various other modules and routines + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- diff -Nru yt-3.3.3/yt/frontends/athena_pp/fields.py yt-3.4.0/yt/frontends/athena_pp/fields.py --- yt-3.3.3/yt/frontends/athena_pp/fields.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/athena_pp/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,91 @@ +""" +Athena++-specific fields + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from yt.fields.field_info_container import \ + FieldInfoContainer +from yt.utilities.physical_constants import \ + kboltz, mh + +b_units = "code_magnetic" +pres_units = "code_mass/(code_length*code_time**2)" +rho_units = "code_mass / code_length**3" +vel_units = "code_length / code_time" + +def velocity_field(j): + def _velocity(field, data): + return data["athena_pp", "mom%d" % j]/data["athena_pp","dens"] + return _velocity + +class AthenaPPFieldInfo(FieldInfoContainer): + known_other_fields = ( + ("rho", (rho_units, ["density"], None)), + ("dens", (rho_units, ["density"], None)), + ("Bcc1", (b_units, [], None)), + ("Bcc2", (b_units, [], None)), + ("Bcc3", (b_units, [], None)), + ) + + def setup_fluid_fields(self): + from yt.fields.magnetic_field import \ + setup_magnetic_field_aliases + unit_system = self.ds.unit_system + # Add velocity fields + vel_prefix = "velocity" + for i, comp in enumerate(self.ds.coordinates.axis_order): + vel_field = ("athena_pp", "vel%d" % (i+1)) + mom_field = ("athena_pp", "mom%d" % (i+1)) + if vel_field in self.field_list: + self.add_output_field(vel_field, sampling_type="cell", units="code_length/code_time") + self.alias(("gas","%s_%s" % (vel_prefix, comp)), vel_field, + units=unit_system["velocity"]) + elif mom_field in self.field_list: + self.add_output_field(mom_field, sampling_type="cell", + units="code_mass/code_time/code_length**2") + self.add_field(("gas","%s_%s" % (vel_prefix, comp)), sampling_type="cell", + function=velocity_field(i+1), units=unit_system["velocity"]) + # Figure out thermal energy field + if ("athena_pp","press") in self.field_list: + self.add_output_field(("athena_pp","press"), sampling_type="cell", + units=pres_units) + self.alias(("gas","pressure"),("athena_pp","press"), + units=unit_system["pressure"]) + def _thermal_energy(field, data): + return data["athena_pp","press"] / \ + (data.ds.gamma-1.)/data["athena_pp","rho"] + self.add_field(("gas","thermal_energy"), sampling_type="cell", + function=_thermal_energy, + units=unit_system["specific_energy"]) + elif ("athena_pp","Etot") in self.field_list: + self.add_output_field(("athena_pp","Etot"), sampling_type="cell", + units=pres_units) + def _thermal_energy(field, data): + eint = data["athena_pp", "Etot"] - data["gas","kinetic_energy"] + if ("athena_pp", "B1") in self.field_list: + eint -= data["gas","magnetic_energy"] + return eint/data["athena_pp","dens"] + self.add_field(("gas","thermal_energy"), sampling_type="cell", + function=_thermal_energy, + units=unit_system["specific_energy"]) + # Add temperature field + def _temperature(field, data): + if data.has_field_parameter("mu"): + mu = data.get_field_parameter("mu") + else: + mu = 0.6 + return (data["gas","pressure"]/data["gas","density"])*mu*mh/kboltz + self.add_field(("gas", "temperature"), sampling_type="cell", function=_temperature, + units=unit_system["temperature"]) + + setup_magnetic_field_aliases(self, "athena_pp", ["Bcc%d" % ax for ax in (1,2,3)]) diff -Nru yt-3.3.3/yt/frontends/athena_pp/io.py yt-3.4.0/yt/frontends/athena_pp/io.py --- yt-3.3.3/yt/frontends/athena_pp/io.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/athena_pp/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,100 @@ +""" +Athena++-specific IO functions + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import numpy as np +from itertools import groupby + +from yt.utilities.io_handler import \ + BaseIOHandler +from yt.utilities.logger import ytLogger as mylog + +# http://stackoverflow.com/questions/2361945/detecting-consecutive-integers-in-a-list +def grid_sequences(grids): + g_iter = sorted(grids, key = lambda g: g.id) + for k, g in groupby(enumerate(g_iter), lambda i_x1:i_x1[0]-i_x1[1].id): + seq = list(v[1] for v in g) + yield seq + +ii = [0, 1, 0, 1, 0, 1, 0, 1] +jj = [0, 0, 1, 1, 0, 0, 1, 1] +kk = [0, 0, 0, 0, 1, 1, 1, 1] + +class IOHandlerAthenaPP(BaseIOHandler): + _particle_reader = False + _dataset_type = "athena_pp" + + def __init__(self, ds): + super(IOHandlerAthenaPP, self).__init__(ds) + self._handle = ds._handle + + def _read_particles(self, fields_to_read, type, args, grid_list, + count_list, conv_factors): + pass + + def _read_fluid_selection(self, chunks, selector, fields, size): + chunks = list(chunks) + if any((ftype != "athena_pp" for ftype, fname in fields)): + raise NotImplementedError + f = self._handle + rv = {} + for field in fields: + # Always use *native* 64-bit float. + rv[field] = np.empty(size, dtype="=f8") + ng = sum(len(c.objs) for c in chunks) + mylog.debug("Reading %s cells of %s fields in %s blocks", + size, [f2 for f1, f2 in fields], ng) + for field in fields: + ftype, fname = field + dname, fdi = self.ds._field_map[fname] + ds = f["/%s" % dname] + ind = 0 + for chunk in chunks: + if self.ds.logarithmic: + for mesh in chunk.objs: + nx, ny, nz = mesh.mesh_dims // self.ds.index.mesh_factors + data = np.empty(mesh.mesh_dims, dtype="=f8") + for n, id in enumerate(mesh.mesh_blocks): + data[ii[n]*nx:(ii[n]+1)*nx,jj[n]*ny:(jj[n]+1)*ny,kk[n]*nz:(kk[n]+1)*nz] = \ + ds[fdi,id,:,:,:].transpose() + ind += mesh.select(selector, data, rv[field], ind) # caches + else: + for gs in grid_sequences(chunk.objs): + start = gs[0].id - gs[0]._id_offset + end = gs[-1].id - gs[-1]._id_offset + 1 + data = ds[fdi,start:end,:,:,:].transpose() + for i, g in enumerate(gs): + ind += g.select(selector, data[...,i], rv[field], ind) + return rv + + def _read_chunk_data(self, chunk, fields): + if self.ds.logarithmic: + pass + f = self._handle + rv = {} + for g in chunk.objs: + rv[g.id] = {} + if len(fields) == 0: + return rv + for field in fields: + ftype, fname = field + dname, fdi = self.ds._field_map[fname] + ds = f["/%s" % dname] + for gs in grid_sequences(chunk.objs): + start = gs[0].id - gs[0]._id_offset + end = gs[-1].id - gs[-1]._id_offset + 1 + data = ds[fdi,start:end,:,:,:].transpose() + for i, g in enumerate(gs): + rv[g.id][field] = np.asarray(data[...,i], "=f8") + return rv \ No newline at end of file diff -Nru yt-3.3.3/yt/frontends/athena_pp/tests/test_outputs.py yt-3.4.0/yt/frontends/athena_pp/tests/test_outputs.py --- yt-3.3.3/yt/frontends/athena_pp/tests/test_outputs.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/athena_pp/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,78 @@ +""" +Athena++ frontend tests + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import numpy as np +from yt.testing import \ + assert_equal, \ + requires_file, \ + units_override_check, \ + assert_allclose +from yt.utilities.answer_testing.framework import \ + requires_ds, \ + small_patch_amr, \ + data_dir_load, \ + GenericArrayTest +from yt.frontends.athena_pp.api import AthenaPPDataset +from yt.convenience import load + +_fields_disk = ("density", "velocity_r") + +disk = "KeplerianDisk/disk.out1.00000.athdf" +@requires_ds(disk) +def test_disk(): + ds = data_dir_load(disk) + assert_equal(str(ds), "disk.out1.00000") + dd = ds.all_data() + vol = (ds.domain_right_edge[0]**3-ds.domain_left_edge[0]**3)/3.0 + vol *= np.cos(ds.domain_left_edge[1])-np.cos(ds.domain_right_edge[1]) + vol *= ds.domain_right_edge[2].v-ds.domain_left_edge[2].v + assert_allclose(dd.quantities.total_quantity("cell_volume"), vol) + for field in _fields_disk: + def field_func(name): + return dd[field] + yield GenericArrayTest(ds, field_func, args=[field]) + +_fields_AM06 = ("temperature", "density", "velocity_magnitude", "magnetic_field_x") + +AM06 = "AM06/AM06.out1.00400.athdf" +@requires_ds(AM06) +def test_AM06(): + ds = data_dir_load(AM06) + assert_equal(str(ds), "AM06.out1.00400") + for test in small_patch_amr(ds, _fields_AM06): + test_AM06.__name__ = test.description + yield test + +uo_AM06 = { + 'length_unit': (1.0, 'kpc'), + 'mass_unit': (1.0, 'Msun'), + 'time_unit': (1.0, 'Myr'), +} + +@requires_file(AM06) +def test_AM06_override(): + # verify that overriding units causes derived unit values to be updated. + # see issue #1259 + ds = load(AM06, units_override=uo_AM06) + assert_equal(float(ds.magnetic_unit.in_units('gauss')), + 9.01735778342523e-08) + +@requires_file(AM06) +def test_units_override(): + units_override_check(AM06) + +@requires_file(AM06) +def test_AthenaPPDataset(): + assert isinstance(data_dir_load(AM06), AthenaPPDataset) diff -Nru yt-3.3.3/yt/frontends/boxlib/api.py yt-3.4.0/yt/frontends/boxlib/api.py --- yt-3.3.3/yt/frontends/boxlib/api.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/boxlib/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -20,12 +20,18 @@ OrionHierarchy, \ OrionDataset, \ CastroDataset, \ - MaestroDataset + MaestroDataset, \ + NyxDataset, \ + NyxHierarchy, \ + WarpXDataset, \ + WarpXHierarchy from .fields import \ BoxlibFieldInfo, \ MaestroFieldInfo, \ - CastroFieldInfo + CastroFieldInfo, \ + NyxFieldInfo, \ + WarpXFieldInfo from .io import \ IOHandlerBoxlib diff -Nru yt-3.3.3/yt/frontends/boxlib/data_structures.py yt-3.4.0/yt/frontends/boxlib/data_structures.py --- yt-3.3.3/yt/frontends/boxlib/data_structures.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/boxlib/data_structures.py 2017-08-10 18:10:20.000000000 +0000 @@ -16,17 +16,18 @@ import inspect import os import re +from collections import namedtuple from stat import ST_CTIME import numpy as np +import glob from yt.funcs import \ ensure_tuple, \ mylog, \ setdefaultattr from yt.data_objects.grid_patch import AMRGridPatch -from yt.extern.six.moves import zip as izip from yt.geometry.grid_geometry_handler import GridIndex from yt.data_objects.static_output import Dataset @@ -39,9 +40,10 @@ from .fields import \ BoxlibFieldInfo, \ + NyxFieldInfo, \ MaestroFieldInfo, \ - CastroFieldInfo - + CastroFieldInfo, \ + WarpXFieldInfo # This is what we use to find scientific notation that might include d's # instead of e's. @@ -74,6 +76,7 @@ self._base_offset = offset self._parent_id = [] self._children_ids = [] + self._pdata = {} def _prepare_grid(self): super(BoxlibGrid, self)._prepare_grid() @@ -135,13 +138,200 @@ startIndex[2]:endIndex[2]] = tofill +class BoxLibParticleHeader(object): + + def __init__(self, ds, directory_name, is_checkpoint, + extra_field_names=None): + + self.particle_type = directory_name + header_filename = ds.output_dir + "/" + directory_name + "/Header" + with open(header_filename, "r") as f: + self.version_string = f.readline().strip() + + particle_real_type = self.version_string.split('_')[-1] + particle_real_type = self.version_string.split('_')[-1] + if particle_real_type == 'double': + self.real_type = np.float64 + elif particle_real_type == 'single': + self.real_type = np.float32 + else: + raise RuntimeError("yt did not recognize particle real type.") + self.int_type = np.int32 + + self.dim = int(f.readline().strip()) + self.num_int_base = 2 + self.dim + self.num_real_base = self.dim + self.num_int_extra = 0 # this should be written by Boxlib, but isn't + self.num_real_extra = int(f.readline().strip()) + self.num_int = self.num_int_base + self.num_int_extra + self.num_real = self.num_real_base + self.num_real_extra + self.num_particles = int(f.readline().strip()) + self.max_next_id = int(f.readline().strip()) + self.finest_level = int(f.readline().strip()) + self.num_levels = self.finest_level + 1 + + # Boxlib particles can be written in checkpoint or plotfile mode + # The base integer fields are only there for checkpoints, but some + # codes use the checkpoint format for plotting + if not is_checkpoint: + self.num_int_base = 0 + self.num_int_extra = 0 + self.num_int = 0 + + self.grids_per_level = np.zeros(self.num_levels, dtype='int64') + self.data_map = {} + for level_num in range(self.num_levels): + self.grids_per_level[level_num] = int(f.readline().strip()) + self.data_map[level_num] = {} + + pfd = namedtuple("ParticleFileDescriptor", + ["file_number", "num_particles", "offset"]) + + for level_num in range(self.num_levels): + for grid_num in range(self.grids_per_level[level_num]): + entry = [int(val) for val in f.readline().strip().split()] + self.data_map[level_num][grid_num] = pfd(*entry) + + self._generate_particle_fields(extra_field_names) + + def _generate_particle_fields(self, extra_field_names): + + # these are the 'base' integer fields + self.known_int_fields = [(self.particle_type, "particle_id"), + (self.particle_type, "particle_cpu"), + (self.particle_type, "particle_cell_x"), + (self.particle_type, "particle_cell_y"), + (self.particle_type, "particle_cell_z")] + self.known_int_fields = self.known_int_fields[0:self.num_int_base] + + # these are extra integer fields + extra_int_fields = ["particle_int_comp%d" % i + for i in range(self.num_int_extra)] + self.known_int_fields.extend([(self.particle_type, field) + for field in extra_int_fields]) + + # these are the base real fields + self.known_real_fields = [(self.particle_type, "particle_position_x"), + (self.particle_type, "particle_position_y"), + (self.particle_type, "particle_position_z")] + self.known_real_fields = self.known_real_fields[0:self.num_real_base] + + # these are the extras + if extra_field_names is not None: + assert(len(extra_field_names) == self.num_real_extra) + else: + extra_field_names = ["particle_real_comp%d" % i + for i in range(self.num_real_extra)] + + self.known_real_fields.extend([(self.particle_type, field) + for field in extra_field_names]) + + self.known_fields = self.known_int_fields + self.known_real_fields + + self.particle_int_dtype = np.dtype([(t[1], self.int_type) + for t in self.known_int_fields]) + + self.particle_real_dtype = np.dtype([(t[1], self.real_type) + for t in self.known_real_fields]) + + +class AMReXParticleHeader(object): + + def __init__(self, ds, directory_name, is_checkpoint, + extra_field_names=None): + + self.particle_type = directory_name + header_filename = ds.output_dir + "/" + directory_name + "/Header" + self.real_component_names = [] + self.int_component_names = [] + with open(header_filename, "r") as f: + self.version_string = f.readline().strip() + + particle_real_type = self.version_string.split('_')[-1] + particle_real_type = self.version_string.split('_')[-1] + if particle_real_type == 'double': + self.real_type = np.float64 + elif particle_real_type == 'single': + self.real_type = np.float32 + else: + raise RuntimeError("yt did not recognize particle real type.") + self.int_type = np.int32 + + self.dim = int(f.readline().strip()) + self.num_int_base = 2 + self.num_real_base = self.dim + self.num_real_extra = int(f.readline().strip()) + for i in range(self.num_real_extra): + self.real_component_names.append(f.readline().strip()) + self.num_int_extra = int(f.readline().strip()) + for i in range(self.num_int_extra): + self.int_component_names.append(f.readline().strip()) + self.num_int = self.num_int_base + self.num_int_extra + self.num_real = self.num_real_base + self.num_real_extra + self.is_checkpoint = bool(int(f.readline().strip())) + self.num_particles = int(f.readline().strip()) + self.max_next_id = int(f.readline().strip()) + self.finest_level = int(f.readline().strip()) + self.num_levels = self.finest_level + 1 + + if not self.is_checkpoint: + self.num_int_base = 0 + self.num_int_extra = 0 + self.num_int = 0 + + self.grids_per_level = np.zeros(self.num_levels, dtype='int64') + self.data_map = {} + for level_num in range(self.num_levels): + self.grids_per_level[level_num] = int(f.readline().strip()) + self.data_map[level_num] = {} + + pfd = namedtuple("ParticleFileDescriptor", + ["file_number", "num_particles", "offset"]) + + for level_num in range(self.num_levels): + for grid_num in range(self.grids_per_level[level_num]): + entry = [int(val) for val in f.readline().strip().split()] + self.data_map[level_num][grid_num] = pfd(*entry) + + self._generate_particle_fields() + + def _generate_particle_fields(self): + + # these are the 'base' integer fields + self.known_int_fields = [(self.particle_type, "particle_id"), + (self.particle_type, "particle_cpu")] + self.known_int_fields = self.known_int_fields[0:self.num_int_base] + + self.known_int_fields.extend([(self.particle_type, "particle_" + field) + for field in self.int_component_names]) + + # these are the base real fields + self.known_real_fields = [(self.particle_type, "particle_position_x"), + (self.particle_type, "particle_position_y"), + (self.particle_type, "particle_position_z")] + self.known_real_fields = self.known_real_fields[0:self.num_real_base] + + self.known_real_fields.extend([(self.particle_type, "particle_" + field) + for field in self.real_component_names]) + + self.known_fields = self.known_int_fields + self.known_real_fields + + self.particle_int_dtype = np.dtype([(t[1], self.int_type) + for t in self.known_int_fields]) + + self.particle_real_dtype = np.dtype([(t[1], self.real_type) + for t in self.known_real_fields]) + + class BoxlibHierarchy(GridIndex): + grid = BoxlibGrid def __init__(self, ds, dataset_type='boxlib_native'): self.dataset_type = dataset_type self.header_filename = os.path.join(ds.output_dir, 'Header') self.directory = ds.output_dir + self.particle_headers = {} GridIndex.__init__(self, ds, dataset_type) self._cache_endianness(self.grids[-1]) @@ -360,6 +550,41 @@ def _setup_data_io(self): self.io = io_registry[self.dataset_type](self.dataset) + def _determine_particle_output_type(self, directory_name): + header_filename = self.ds.output_dir + "/" + directory_name + "/Header" + with open(header_filename, "r") as f: + version_string = f.readline().strip() + if version_string.startswith("Version_Two"): + return AMReXParticleHeader + else: + return BoxLibParticleHeader + + def _read_particles(self, directory_name, is_checkpoint, extra_field_names=None): + pheader = self._determine_particle_output_type(directory_name) + self.particle_headers[directory_name] = pheader(self.ds, + directory_name, + is_checkpoint, + extra_field_names) + + base_particle_fn = self.ds.output_dir + '/' + directory_name + "/Level_%d/DATA_%.4d" + + gid = 0 + for lev, data in self.particle_headers[directory_name].data_map.items(): + for pdf in data.values(): + pdict = self.grids[gid]._pdata + pdict[directory_name] = {} + pdict[directory_name]["particle_filename"] = base_particle_fn % \ + (lev, pdf.file_number) + pdict[directory_name]["offset"] = pdf.offset + pdict[directory_name]["NumberOfParticles"] = pdf.num_particles + self.grid_particle_count[gid] += pdf.num_particles + self.grids[gid].NumberOfParticles += pdf.num_particles + gid += 1 + + # add particle fields to field_list + pfield_list = self.particle_headers[directory_name].known_fields + self.field_list.extend(pfield_list) + class BoxlibDataset(Dataset): """ @@ -374,8 +599,8 @@ periodicity = (True, True, True) def __init__(self, output_dir, - cparam_filename="inputs", - fparam_filename="probin", + cparam_filename=None, + fparam_filename=None, dataset_type='boxlib_native', storage_filename=None, units_override=None, @@ -406,6 +631,8 @@ "materials.gamma", 1.6667) def _localize_check(self, fn): + if fn is None: + return None # If the file exists, use it. If not, set it to None. root_dir = os.path.dirname(self.output_dir) full_fn = os.path.join(root_dir, fn) @@ -426,6 +653,8 @@ return False args = inspect.getcallargs(cls.__init__, args, kwargs) # This might need to be localized somehow + if args['cparam_filename'] is None: + return True # Treat as generic boxlib data inputs_filename = os.path.join( os.path.dirname(os.path.abspath(output_dir)), args['cparam_filename']) @@ -635,7 +864,9 @@ self.domain_right_edge = \ np.concatenate([self.domain_right_edge, [1.0]]) if self.geometry == "cylindrical": - self.domain_right_edge[2] = 2.0 * np.pi + dre = self.domain_right_edge + dre[2] = 2.0 * np.pi + self.domain_right_edge = dre tmp = self.domain_dimensions.tolist() tmp.append(1) self.domain_dimensions = np.array(tmp) @@ -690,7 +921,7 @@ def _read_particles(self): """ - reads in particles and assigns them to grids. Will search for + Reads in particles and assigns them to grids. Will search for Star particles, then sink particles if no star particle file is found, and finally will simply note that no particles are found if neither works. To add a new Orion particle type, @@ -778,18 +1009,57 @@ if os.path.exists(jobinfo_filename): return False # Now we check for all the others + warpx_jobinfo_filename = os.path.join(output_dir, "warpx_job_info") + if os.path.exists(warpx_jobinfo_filename): + return False lines = open(inputs_filename).readlines() if any(("castro." in line for line in lines)): return False if any(("nyx." in line for line in lines)): return False if any(("maestro" in line.lower() for line in lines)): return False - if any(("geometry.prob_lo" in line for line in lines)): return True + if any(("hyp." in line for line in lines)): return True return False +class CastroHierarchy(BoxlibHierarchy): + + def __init__(self, ds, dataset_type='castro_native'): + super(CastroHierarchy, self).__init__(ds, dataset_type) + + if ("particles" in self.ds.parameters): + + # extra beyond the base real fields that all Boxlib + # particles have, i.e. the xyz positions + castro_extra_real_fields = ['particle_velocity_x', + 'particle_velocity_y', + 'particle_velocity_z'] + + is_checkpoint = True + + self._read_particles("Tracer", is_checkpoint, + castro_extra_real_fields[0:self.ds.dimensionality]) + + class CastroDataset(BoxlibDataset): + _index_class = CastroHierarchy _field_info_class = CastroFieldInfo + def __init__(self, output_dir, + cparam_filename=None, + fparam_filename=None, + dataset_type='boxlib_native', + storage_filename=None, + units_override=None, + unit_system="cgs"): + + super(CastroDataset, self).__init__(output_dir, + cparam_filename, + fparam_filename, + dataset_type, + storage_filename, + units_override, + unit_system) + @classmethod def _is_valid(cls, *args, **kwargs): # fill our args @@ -846,12 +1116,34 @@ if not self.parameters['-z'] == "interior": periodicity[2] = False self.periodicity = ensure_tuple(periodicity) - + if os.path.isdir(os.path.join(self.output_dir, "Tracer")): + # we have particles + self.parameters["particles"] = 1 + self.particle_types = ("Tracer",) + self.particle_types_raw = self.particle_types + + class MaestroDataset(BoxlibDataset): _field_info_class = MaestroFieldInfo + def __init__(self, output_dir, + cparam_filename=None, + fparam_filename=None, + dataset_type='boxlib_native', + storage_filename=None, + units_override=None, + unit_system="cgs"): + + super(MaestroDataset, self).__init__(output_dir, + cparam_filename, + fparam_filename, + dataset_type, + storage_filename, + units_override, + unit_system) + @classmethod def _is_valid(cls, *args, **kwargs): # fill our args @@ -910,47 +1202,41 @@ def __init__(self, ds, dataset_type='nyx_native'): super(NyxHierarchy, self).__init__(ds, dataset_type) - self._read_particle_header() - def _read_particle_header(self): - if not self.ds.parameters["particles"]: - self.pgrid_info = np.zeros((self.num_grids, 3), dtype='int64') - return - for fn in ['particle_position_%s' % ax for ax in 'xyz'] + \ - ['particle_mass'] + \ - ['particle_velocity_%s' % ax for ax in 'xyz']: - self.field_list.append(("io", fn)) - header = open(os.path.join(self.ds.output_dir, "DM", "Header")) - version = header.readline() # NOQA - ndim = header.readline() # NOQA - nfields = header.readline() # NOQA - ntotalpart = int(header.readline()) # NOQA - nextid = header.readline() # NOQA - maxlevel = int(header.readline()) # NOQA - - # Skip over how many grids on each level; this is degenerate - for i in range(maxlevel + 1): - header.readline() - - grid_info = np.fromiter((int(i) for line in header.readlines() - for i in line.split()), - dtype='int64', - count=3*self.num_grids).reshape((self.num_grids, 3)) - # we need grid_info in `populate_grid_objects`, so save it to self - - for g, pg in izip(self.grids, grid_info): - g.particle_filename = os.path.join(self.ds.output_dir, "DM", - "Level_%s" % (g.Level), - "DATA_%04i" % pg[0]) - g.NumberOfParticles = pg[1] - g._particle_offset = pg[2] + if ("particles" in self.ds.parameters): + # extra beyond the base real fields that all Boxlib + # particles have, i.e. the xyz positions + nyx_extra_real_fields = ['particle_mass', + 'particle_velocity_x', + 'particle_velocity_y', + 'particle_velocity_z'] + + is_checkpoint = False - self.grid_particle_count[:, 0] = grid_info[:, 1] + self._read_particles("DM", is_checkpoint, + nyx_extra_real_fields[0:self.ds.dimensionality+1]) class NyxDataset(BoxlibDataset): _index_class = NyxHierarchy + _field_info_class = NyxFieldInfo + + def __init__(self, output_dir, + cparam_filename=None, + fparam_filename=None, + dataset_type='boxlib_native', + storage_filename=None, + units_override=None, + unit_system="cgs"): + + super(NyxDataset, self).__init__(output_dir, + cparam_filename, + fparam_filename, + dataset_type, + storage_filename, + units_override, + unit_system) @classmethod def _is_valid(cls, *args, **kwargs): @@ -1013,7 +1299,7 @@ if os.path.isdir(os.path.join(self.output_dir, "DM")): # we have particles self.parameters["particles"] = 1 - self.particle_types = ("io",) + self.particle_types = ("DM",) self.particle_types_raw = self.particle_types def _set_code_unit_attributes(self): @@ -1044,3 +1330,273 @@ if len(vals) == 1: vals = vals[0] return vals + + +def _read_raw_field_names(raw_file): + header_files = glob.glob(raw_file + "*_H") + return [hf.split("/")[-1][:-2] for hf in header_files] + + +def _string_to_numpy_array(s): + return np.array([int(v) for v in s[1:-1].split(",")], dtype=np.int64) + + +def _line_to_numpy_arrays(line): + lo_corner = _string_to_numpy_array(line[0][1:]) + hi_corner = _string_to_numpy_array(line[1][:]) + node_type = _string_to_numpy_array(line[2][:-1]) + return lo_corner, hi_corner, node_type + + +def _get_active_dimensions(box): + return box[1] - box[2] - box[0] + 1 + + +def _read_header(raw_file, field): + level_files = glob.glob(raw_file + 'Level_*') + level_files.sort() + + all_boxes = [] + all_file_names = [] + all_offsets = [] + + for level_file in level_files: + header_file = level_file + "/" + field + "_H" + with open(header_file, "r") as f: + + # skip the first five lines + for _ in range(5): + f.readline() + + # read boxes + boxes = [] + for line in f: + clean_line = line.strip().split() + if clean_line == [')']: + break + lo_corner, hi_corner, node_type = _line_to_numpy_arrays(clean_line) + boxes.append((lo_corner, hi_corner, node_type)) + + # read the file and offset position for the corresponding box + file_names = [] + offsets = [] + for line in f: + if line.startswith("FabOnDisk:"): + clean_line = line.strip().split() + file_names.append(clean_line[1]) + offsets.append(int(clean_line[2])) + + all_boxes += boxes + all_file_names += file_names + all_offsets += offsets + + return all_boxes, all_file_names, all_offsets + + +class WarpXHeader(object): + def __init__(self, header_fn): + self.data = {} + with open(header_fn, "r") as f: + self.data["Checkpoint_version"] = int(f.readline().strip().split()[-1]) + + self.data["num_levels"] = int(f.readline().strip().split()[-1]) + self.data["istep"] = [int(num) for num in f.readline().strip().split()] + self.data["nsubsteps"] = [int(num) for num in f.readline().strip().split()] + + self.data["t_new"] = [float(num) for num in f.readline().strip().split()] + self.data["t_old"] = [float(num) for num in f.readline().strip().split()] + self.data["dt"] = [float(num) for num in f.readline().strip().split()] + + self.data["moving_window_x"] = float(f.readline().strip().split()[-1]) + + # not all datasets will have is_synchronized + line = f.readline().strip().split() + if (len(line) == 1): + self.data["is_synchronized"] = bool(line[-1]) + self.data["prob_lo"] = [float(num) for num in f.readline().strip().split()] + else: + self.data["is_synchronized"] = True + self.data["prob_lo"] = [float(num) for num in line] + + self.data["prob_hi"] = [float(num) for num in f.readline().strip().split()] + + for _ in range(self.data["num_levels"]): + num_boxes = int(f.readline().strip().split()[0][1:]) + for __ in range(num_boxes): + f.readline() + f.readline() + + i = 0 + line = f.readline() + while line: + line = line.strip().split() + self.data["species_%d" % i] = [float(val) for val in line] + i = i + 1 + line = f.readline() + + +class WarpXHierarchy(BoxlibHierarchy): + + def __init__(self, ds, dataset_type="boxlib_native"): + super(WarpXHierarchy, self).__init__(ds, dataset_type) + + is_checkpoint = True + for ptype in self.ds.particle_types: + self._read_particles(ptype, is_checkpoint) + + # Additional WarpX particle information (used to set up species) + self.warpx_header = WarpXHeader(self.ds.output_dir + "/WarpXHeader") + + i = 0 + for key, val in self.warpx_header.data.items(): + if key.startswith("species_"): + charge_name = 'particle%.1d_charge' % i + mass_name = 'particle%.1d_mass' % i + self.parameters[charge_name] = val[0] + self.parameters[mass_name] = val[1] + i = i + 1 + + def _detect_output_fields(self): + super(WarpXHierarchy, self)._detect_output_fields() + + # now detect the optional, non-cell-centered fields + self.raw_file = self.ds.output_dir + "/raw_fields/" + self.ds.fluid_types += ("raw",) + self.raw_fields = _read_raw_field_names(self.raw_file + 'Level_0/') + self.field_list += [('raw', f) for f in self.raw_fields] + self.raw_field_map = {} + self.ds.nodal_flags = {} + for field_name in self.raw_fields: + boxes, file_names, offsets = _read_header(self.raw_file, field_name) + self.raw_field_map[field_name] = (boxes, file_names, offsets) + self.ds.nodal_flags[field_name] = np.array(boxes[0][2]) + + +def _skip_line(line): + if len(line) == 0: + return True + if line[0] == '\n': + return True + if line[0] == "=": + return True + if line[0] == ' ': + return True + + +class WarpXDataset(BoxlibDataset): + + _index_class = WarpXHierarchy + _field_info_class = WarpXFieldInfo + + def __init__(self, output_dir, + cparam_filename=None, + fparam_filename=None, + dataset_type='boxlib_native', + storage_filename=None, + units_override=None, + unit_system="mks"): + + super(WarpXDataset, self).__init__(output_dir, + cparam_filename, + fparam_filename, + dataset_type, + storage_filename, + units_override, + unit_system) + + @classmethod + def _is_valid(cls, *args, **kwargs): + # fill our args + output_dir = args[0] + # boxlib datasets are always directories + if not os.path.isdir(output_dir): return False + header_filename = os.path.join(output_dir, "Header") + jobinfo_filename = os.path.join(output_dir, "warpx_job_info") + if not os.path.exists(header_filename): + # We *know* it's not boxlib if Header doesn't exist. + return False + if os.path.exists(jobinfo_filename): + return True + return False + + def _parse_parameter_file(self): + super(WarpXDataset, self)._parse_parameter_file() + jobinfo_filename = os.path.join(self.output_dir, "warpx_job_info") + with open(jobinfo_filename, "r") as f: + for line in f.readlines(): + if _skip_line(line): + continue + l = line.strip().split(":") + if len(l) == 2: + self.parameters[l[0].strip()] = l[1].strip() + l = line.strip().split("=") + if len(l) == 2: + self.parameters[l[0].strip()] = l[1].strip() + + # set the periodicity based on the integer BC runtime parameters + is_periodic = self.parameters['geometry.is_periodic'].split() + periodicity = [bool(val) for val in is_periodic] + for _ in range(self.dimensionality, 3): + periodicity += [True] # pad to 3D + self.periodicity = ensure_tuple(periodicity) + + + + species_list = [] + species_dirs = glob.glob(self.output_dir + "/particle*") + for species in species_dirs: + species_list.append(species[len(self.output_dir)+1:]) + self.particle_types = tuple(species_list) + self.particle_types_raw = self.particle_types + + + def _set_code_unit_attributes(self): + setdefaultattr(self, 'length_unit', self.quan(1.0, "m")) + setdefaultattr(self, 'mass_unit', self.quan(1.0, "kg")) + setdefaultattr(self, 'time_unit', self.quan(1.0, "s")) + setdefaultattr(self, 'velocity_unit', self.quan(1.0, "m/s")) + + +class AMReXHierarchy(BoxlibHierarchy): + + def __init__(self, ds, dataset_type="boxlib_native"): + super(AMReXHierarchy, self).__init__(ds, dataset_type) + + if ("particles" in self.ds.parameters): + is_checkpoint = True + for ptype in self.ds.particle_types: + self._read_particles(ptype, is_checkpoint) + + +class AMReXDataset(BoxlibDataset): + + _index_class = AMReXHierarchy + + def __init__(self, output_dir, + cparam_filename=None, + fparam_filename=None, + dataset_type='boxlib_native', + storage_filename=None, + units_override=None, + unit_system="cgs"): + + super(AMReXDataset, self).__init__(output_dir, + cparam_filename, + fparam_filename, + dataset_type, + storage_filename, + units_override, + unit_system) + + def _parse_parameter_file(self): + super(AMReXDataset, self)._parse_parameter_file() + particle_types = glob.glob(self.output_dir + "/*/Header") + particle_types = [cpt.split("/")[-2] for cpt in particle_types] + if len(particle_types) > 0: + self.parameters["particles"] = 1 + self.particle_types = tuple(particle_types) + self.particle_types_raw = self.particle_types + + @classmethod + def _is_valid(cls, *args, **kwargs): + return False diff -Nru yt-3.3.3/yt/frontends/boxlib/fields.py yt-3.4.0/yt/frontends/boxlib/fields.py --- yt-3.3.3/yt/frontends/boxlib/fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/boxlib/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -18,6 +18,7 @@ boltzmann_constant_cgs, amu_cgs from yt.fields.field_info_container import \ FieldInfoContainer +from yt.units import YTQuantity rho_units = "code_mass / code_length**3" mom_units = "code_mass / (code_time * code_length**2)" @@ -51,6 +52,74 @@ return tr +class WarpXFieldInfo(FieldInfoContainer): + + known_other_fields = ( + ("Bx", ("T", ["magnetic_field_x"], None)), + ("By", ("T", ["magnetic_field_y"], None)), + ("Bz", ("T", ["magnetic_field_z"], None)), + ("Ex", ("V/m", ["electric_field_x"], None)), + ("Ey", ("V/m", ["electric_field_y"], None)), + ("Ex", ("V/m", ["electric_field_z"], None)), + ("jx", ("A", ["current_x"], None)), + ("jy", ("A", ["current_y"], None)), + ("jz", ("A", ["current_z"], None)), + ) + + known_particle_fields = ( + ("particle_weight", ("", [], None)), + ("particle_position_x", ("m", [], None)), + ("particle_position_y", ("m", [], None)), + ("particle_position_z", ("m", [], None)), + ("particle_velocity_x", ("m/s", [], None)), + ("particle_velocity_y", ("m/s", [], None)), + ("particle_velocity_z", ("m/s", [], None)), + ) + + extra_union_fields = ( + ("kg", "particle_mass"), + ("C", "particle_charge"), + ("", "particle_ones"), + ) + + def __init__(self, ds, field_list): + super(WarpXFieldInfo, self).__init__(ds, field_list) + + # setup nodal flag information + for field in ds.index.raw_fields: + finfo = self.__getitem__(('raw', field)) + finfo.nodal_flag = ds.nodal_flags[field] + + def setup_particle_fields(self, ptype): + + def get_mass(field, data): + species_mass = data.ds.index.parameters[ptype + '_mass'] + return data["particle_weight"]*YTQuantity(species_mass, 'kg') + + self.add_field((ptype, "particle_mass"), sampling_type="particle", + function=get_mass, + units="kg") + + def get_charge(field, data): + species_charge = data.ds.index.parameters[ptype + '_charge'] + return data["particle_weight"]*YTQuantity(species_charge, 'C') + + self.add_field((ptype, "particle_charge"), sampling_type="particle", + function=get_charge, + units="C") + + super(WarpXFieldInfo, self).setup_particle_fields(ptype) + + +class NyxFieldInfo(FieldInfoContainer): + known_other_fields = () + known_particle_fields = ( + ("particle_position_x", ("code_length", [], None)), + ("particle_position_y", ("code_length", [], None)), + ("particle_position_z", ("code_length", [], None)), + ) + + class BoxlibFieldInfo(FieldInfoContainer): known_other_fields = ( ("density", (rho_units, ["density"], None)), @@ -98,9 +167,8 @@ return velocity for ax in 'xyz': - self.add_field((ptype, "particle_velocity_%s" % ax), + self.add_field((ptype, "particle_velocity_%s" % ax), sampling_type="particle", function=_get_vel(ax), - particle_type=True, units="code_length/code_time") super(BoxlibFieldInfo, self).setup_particle_fields(ptype) @@ -112,14 +180,14 @@ self.setup_momentum_to_velocity() elif any(f[1] == "xvel" for f in self.field_list): self.setup_velocity_to_momentum() - self.add_field(("gas", "thermal_energy"), + self.add_field(("gas", "thermal_energy"), sampling_type="cell", function=_thermal_energy, units=unit_system["specific_energy"]) - self.add_field(("gas", "thermal_energy_density"), + self.add_field(("gas", "thermal_energy_density"), sampling_type="cell", function=_thermal_energy_density, units=unit_system["pressure"]) if ("gas", "temperature") not in self.field_aliases: - self.add_field(("gas", "temperature"), + self.add_field(("gas", "temperature"), sampling_type="cell", function=_temperature, units=unit_system["temperature"]) @@ -129,7 +197,7 @@ return data["%smom" % axis]/data["density"] return velocity for ax in 'xyz': - self.add_field(("gas", "velocity_%s" % ax), + self.add_field(("gas", "velocity_%s" % ax), sampling_type="cell", function=_get_vel(ax), units=self.ds.unit_system["velocity"]) @@ -139,7 +207,7 @@ return data["%svel" % axis]*data["density"] return momentum for ax in 'xyz': - self.add_field(("gas", "momentum_%s" % ax), + self.add_field(("gas", "momentum_%s" % ax), sampling_type="cell", function=_get_mom(ax), units=mom_units) @@ -192,6 +260,12 @@ ("rot_z", ("cm/s**2", [], r"\mathbf{f}_{\rm{rot}} \cdot \mathbf{e}_z")), ) + known_particle_fields = ( + ("particle_position_x", ("code_length", [], None)), + ("particle_position_y", ("code_length", [], None)), + ("particle_position_z", ("code_length", [], None)), + ) + def setup_fluid_fields(self): # add X's for _, field in self.ds.field_list: @@ -203,6 +277,7 @@ units="") func = _create_density_func(("gas", "%s_fraction" % nice_name)) self.add_field(name=("gas", "%s_density" % nice_name), + sampling_type="cell", function = func, units = self.ds.unit_system["density"]) # We know this will either have one letter, or two. @@ -287,7 +362,7 @@ # We have a mass fraction nice_name, tex_label = _nice_species_name(field) # Overwrite field to use nicer tex_label display_name - self.add_output_field(("boxlib", field), + self.add_output_field(("boxlib", field), sampling_type="cell", units="", display_name=tex_label) self.alias(("gas", "%s_fraction" % nice_name), @@ -295,6 +370,7 @@ units="") func = _create_density_func(("gas", "%s_fraction" % nice_name)) self.add_field(name=("gas", "%s_density" % nice_name), + sampling_type="cell", function=func, units=unit_system["density"], display_name=r'\rho %s' % tex_label) @@ -317,7 +393,7 @@ nice_name, tex_label = _nice_species_name(field) display_name = r'\dot{\omega}\left[%s\right]' % tex_label # Overwrite field to use nicer tex_label'ed display_name - self.add_output_field(("boxlib", field), units=unit_system["frequency"], + self.add_output_field(("boxlib", field), sampling_type="cell", units=unit_system["frequency"], display_name=display_name) self.alias(("gas", "%s_creation_rate" % nice_name), ("boxlib", field), units=unit_system["frequency"]) diff -Nru yt-3.3.3/yt/frontends/boxlib/io.py yt-3.4.0/yt/frontends/boxlib/io.py --- yt-3.3.3/yt/frontends/boxlib/io.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/boxlib/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,5 +1,5 @@ """ -Orion data-file handling functions +AMReX/Boxlib data-file handling functions @@ -21,6 +21,13 @@ BaseIOHandler from yt.funcs import mylog from yt.frontends.chombo.io import parse_orion_sinks +from yt.geometry.selection_routines import GridSelector + +def _remove_raw(all_fields, raw_fields): + centered_fields = set(all_fields) + for raw in raw_fields: + centered_fields.discard(raw) + return list(centered_fields) class IOHandlerBoxlib(BaseIOHandler): @@ -31,25 +38,59 @@ def _read_fluid_selection(self, chunks, selector, fields, size): chunks = list(chunks) - if any((ftype != "boxlib" for ftype, fname in fields)): + if any(( not (ftype == "boxlib" or ftype == 'raw') for ftype, fname in fields)): raise NotImplementedError rv = {} + raw_fields = [] for field in fields: - rv[field] = np.empty(size, dtype="float64") + if field[0] == "raw": + nodal_flag = self.ds.nodal_flags[field[1]] + num_nodes = 2**sum(nodal_flag) + rv[field] = np.empty((size, num_nodes), dtype="float64") + raw_fields.append(field) + else: + rv[field] = np.empty(size, dtype="float64") + centered_fields = _remove_raw(fields, raw_fields) ng = sum(len(c.objs) for c in chunks) mylog.debug("Reading %s cells of %s fields in %s grids", size, [f2 for f1, f2 in fields], ng) ind = 0 for chunk in chunks: - data = self._read_chunk_data(chunk, fields) + data = self._read_chunk_data(chunk, centered_fields) for g in chunk.objs: for field in fields: - ds = data[g.id].pop(field) + if field in centered_fields: + ds = data[g.id].pop(field) + else: + ds = self._read_raw_field(g, field) nd = g.select(selector, ds, rv[field], ind) # caches ind += nd data.pop(g.id) return rv + def _read_raw_field(self, grid, field): + field_name = field[1] + base_dir = self.ds.index.raw_file + + box_list = self.ds.index.raw_field_map[field_name][0] + fn_list = self.ds.index.raw_field_map[field_name][1] + offset_list = self.ds.index.raw_field_map[field_name][2] + + lev = grid.Level + filename = base_dir + "Level_%d/" % lev + fn_list[grid.id] + offset = offset_list[grid.id] + box = box_list[grid.id] + + lo = box[0] + hi = box[1] + shape = hi - lo + 1 + with open(filename, "rb") as f: + f.seek(offset) + f.readline() # always skip the first line + arr = np.fromfile(f, 'float64', np.product(shape)) + arr = arr.reshape(shape, order='F') + return arr + def _read_chunk_data(self, chunk, fields): data = {} grids_by_file = defaultdict(list) @@ -81,6 +122,93 @@ local_offset += size return data + def _read_particle_selection(self, chunks, selector, fields): + rv = {} + chunks = list(chunks) + unions = self.ds.particle_unions + + rv = {f: np.array([]) for f in fields} + for chunk in chunks: + for grid in chunk.objs: + for ftype, fname in fields: + if ftype in unions: + for subtype in unions[ftype]: + data = self._read_particles(grid, selector, + subtype, fname) + rv[ftype, fname] = np.concatenate((data, + rv[ftype, fname])) + else: + data = self._read_particles(grid, selector, + ftype, fname) + rv[ftype, fname] = np.concatenate((data, + rv[ftype, fname])) + return rv + + def _read_particles(self, grid, selector, ftype, name): + + npart = grid._pdata[ftype]["NumberOfParticles"] + if npart == 0: + return np.array([]) + + fn = grid._pdata[ftype]["particle_filename"] + offset = grid._pdata[ftype]["offset"] + pheader = self.ds.index.particle_headers[ftype] + + # handle the case that this is an integer field + int_fnames = [fname for _, fname in pheader.known_int_fields] + if name in int_fnames: + ind = int_fnames.index(name) + fn = grid._pdata[ftype]["particle_filename"] + with open(fn, "rb") as f: + + # read in the position fields for selection + f.seek(offset + + pheader.particle_int_dtype.itemsize * npart) + rdata = np.fromfile(f, pheader.real_type, pheader.num_real * npart) + x = np.asarray(rdata[0::pheader.num_real], dtype=np.float64) + y = np.asarray(rdata[1::pheader.num_real], dtype=np.float64) + if (grid.ds.dimensionality == 2): + z = np.ones_like(y) + z *= 0.5*(grid.LeftEdge[2] + grid.RightEdge[2]) + else: + z = np.asarray(rdata[2::pheader.num_real], dtype=np.float64) + mask = selector.select_points(x, y, z, 0.0) + + if mask is None: + return np.array([]) + + # read in the data we want + f.seek(offset) + idata = np.fromfile(f, pheader.int_type, pheader.num_int * npart) + data = np.asarray(idata[ind::pheader.num_int], dtype=np.float64) + return data[mask].flatten() + + # handle case that this is a real field + real_fnames = [fname for _, fname in pheader.known_real_fields] + if name in real_fnames: + ind = real_fnames.index(name) + with open(fn, "rb") as f: + + # read in the position fields for selection + f.seek(offset + + pheader.particle_int_dtype.itemsize * npart) + rdata = np.fromfile(f, pheader.real_type, pheader.num_real * npart) + x = np.asarray(rdata[0::pheader.num_real], dtype=np.float64) + y = np.asarray(rdata[1::pheader.num_real], dtype=np.float64) + if (grid.ds.dimensionality == 2): + z = np.ones_like(y) + z *= 0.5*(grid.LeftEdge[2] + grid.RightEdge[2]) + else: + z = np.asarray(rdata[2::pheader.num_real], dtype=np.float64) + mask = selector.select_points(x, y, z, 0.0) + + if mask is None: + return np.array([]) + + data = np.asarray(rdata[ind::pheader.num_real], dtype=np.float64) + return data[mask].flatten() + + class IOHandlerOrion(IOHandlerBoxlib): _dataset_type = "orion_native" @@ -106,7 +234,7 @@ rv = {} chunks = list(chunks) - if selector.__class__.__name__ == "GridSelector": + if isinstance(selector, GridSelector): if not (len(chunks) == len(chunks[0].objs) == 1): raise RuntimeError diff -Nru yt-3.3.3/yt/frontends/boxlib/tests/test_orion.py yt-3.4.0/yt/frontends/boxlib/tests/test_orion.py --- yt-3.3.3/yt/frontends/boxlib/tests/test_orion.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/boxlib/tests/test_orion.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -""" -Orion frontend tests - - - -""" - -#----------------------------------------------------------------------------- -# Copyright (c) 2013, yt Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- - -from yt.testing import \ - assert_equal, \ - requires_file, \ - units_override_check -from yt.utilities.answer_testing.framework import \ - requires_ds, \ - small_patch_amr, \ - data_dir_load -from yt.frontends.boxlib.api import OrionDataset - -# We don't do anything needing ghost zone generation right now, because these -# are non-periodic datasets. -_fields = ("temperature", "density", "velocity_magnitude") - -radadvect = "RadAdvect/plt00000" -@requires_ds(radadvect) -def test_radadvect(): - ds = data_dir_load(radadvect) - yield assert_equal, str(ds), "plt00000" - for test in small_patch_amr(ds, _fields): - test_radadvect.__name__ = test.description - yield test - -rt = "RadTube/plt00500" -@requires_ds(rt) -def test_radtube(): - ds = data_dir_load(rt) - yield assert_equal, str(ds), "plt00500" - for test in small_patch_amr(ds, _fields): - test_radtube.__name__ = test.description - yield test - -star = "StarParticles/plrd01000" -@requires_ds(star) -def test_star(): - ds = data_dir_load(star) - yield assert_equal, str(ds), "plrd01000" - for test in small_patch_amr(ds, _fields): - test_star.__name__ = test.description - yield test - -@requires_file(rt) -def test_OrionDataset(): - assert isinstance(data_dir_load(rt), OrionDataset) - -@requires_file(rt) -def test_units_override(): - for test in units_override_check(rt): - yield test - diff -Nru yt-3.3.3/yt/frontends/boxlib/tests/test_outputs.py yt-3.4.0/yt/frontends/boxlib/tests/test_outputs.py --- yt-3.3.3/yt/frontends/boxlib/tests/test_outputs.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/boxlib/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,271 @@ +""" +Boxlib frontend tests + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from yt.testing import \ + assert_equal, \ + requires_file, \ + units_override_check +from yt.utilities.answer_testing.framework import \ + requires_ds, \ + small_patch_amr, \ + data_dir_load, \ + GridValuesTest +from yt.frontends.boxlib.api import \ + OrionDataset, \ + NyxDataset, \ + WarpXDataset, \ + CastroDataset +import numpy as np + +# We don't do anything needing ghost zone generation right now, because these +# are non-periodic datasets. +_orion_fields = ("temperature", "density", "velocity_magnitude") +_nyx_fields = ("Ne", "Temp", "particle_mass_density") +_warpx_fields = ("Ex", "By", "jz") +_castro_fields = ("Temp", "density", "particle_count") + +radadvect = "RadAdvect/plt00000" +@requires_ds(radadvect) +def test_radadvect(): + ds = data_dir_load(radadvect) + assert_equal(str(ds), "plt00000") + for test in small_patch_amr(ds, _orion_fields): + test_radadvect.__name__ = test.description + yield test + +rt = "RadTube/plt00500" +@requires_ds(rt) +def test_radtube(): + ds = data_dir_load(rt) + assert_equal(str(ds), "plt00500") + for test in small_patch_amr(ds, _orion_fields): + test_radtube.__name__ = test.description + yield test + +star = "StarParticles/plrd01000" +@requires_ds(star) +def test_star(): + ds = data_dir_load(star) + assert_equal(str(ds), "plrd01000") + for test in small_patch_amr(ds, _orion_fields): + test_star.__name__ = test.description + yield test + +LyA = "Nyx_LyA/plt00000" +@requires_ds(LyA) +def test_LyA(): + ds = data_dir_load(LyA) + assert_equal(str(ds), "plt00000") + for test in small_patch_amr(ds, _nyx_fields, + input_center="c", + input_weight="Ne"): + test_LyA.__name__ = test.description + yield test + +@requires_file(LyA) +def test_nyx_particle_io(): + ds = data_dir_load(LyA) + + grid = ds.index.grids[0] + npart_grid_0 = 7908 # read directly from the header + assert_equal(grid['particle_position_x'].size, npart_grid_0) + assert_equal(grid['DM', 'particle_position_y'].size, npart_grid_0) + assert_equal(grid['all', 'particle_position_z'].size, npart_grid_0) + + ad = ds.all_data() + npart = 32768 # read directly from the header + assert_equal(ad['particle_velocity_x'].size, npart) + assert_equal(ad['DM', 'particle_velocity_y'].size, npart) + assert_equal(ad['all', 'particle_velocity_z'].size, npart) + + assert(np.all(ad['particle_mass'] == ad['particle_mass'][0])) + + left_edge = ds.arr([0.0, 0.0, 0.0], 'code_length') + right_edge = ds.arr([4.0, 4.0, 4.0], 'code_length') + center = 0.5*(left_edge + right_edge) + + reg = ds.region(center, left_edge, right_edge) + + assert(np.all(np.logical_and(reg['particle_position_x'] <= right_edge[0], + reg['particle_position_x'] >= left_edge[0]))) + + assert(np.all(np.logical_and(reg['particle_position_y'] <= right_edge[1], + reg['particle_position_y'] >= left_edge[1]))) + + assert(np.all(np.logical_and(reg['particle_position_z'] <= right_edge[2], + reg['particle_position_z'] >= left_edge[2]))) + +RT_particles = "RT_particles/plt00050" +@requires_ds(RT_particles) +def test_RT_particles(): + ds = data_dir_load(RT_particles) + assert_equal(str(ds), "plt00050") + for test in small_patch_amr(ds, _castro_fields): + test_RT_particles.__name__ = test.description + yield test + + +@requires_file(RT_particles) +def test_castro_particle_io(): + ds = data_dir_load(RT_particles) + + grid = ds.index.grids[2] + npart_grid_2 = 49 # read directly from the header + assert_equal(grid['particle_position_x'].size, npart_grid_2) + assert_equal(grid['Tracer', 'particle_position_y'].size, npart_grid_2) + assert_equal(grid['all', 'particle_position_y'].size, npart_grid_2) + + ad = ds.all_data() + npart = 49 # read directly from the header + assert_equal(ad['particle_velocity_x'].size, npart) + assert_equal(ad['Tracer', 'particle_velocity_y'].size, npart) + assert_equal(ad['all', 'particle_velocity_y'].size, npart) + + left_edge = ds.arr([0.0, 0.0, 0.0], 'code_length') + right_edge = ds.arr([0.25, 1.0, 1.0], 'code_length') + center = 0.5*(left_edge + right_edge) + + reg = ds.region(center, left_edge, right_edge) + + assert(np.all(np.logical_and(reg['particle_position_x'] <= right_edge[0], + reg['particle_position_x'] >= left_edge[0]))) + + assert(np.all(np.logical_and(reg['particle_position_y'] <= right_edge[1], + reg['particle_position_y'] >= left_edge[1]))) + +langmuir = "LangmuirWave/plt00020_v2" +@requires_ds(langmuir) +def test_langmuir(): + ds = data_dir_load(langmuir) + assert_equal(str(ds), "plt00020_v2") + for test in small_patch_amr(ds, _warpx_fields, + input_center="c", + input_weight="Ex"): + test_langmuir.__name__ = test.description + yield test + +plasma = "PlasmaAcceleration/plt00030_v2" +@requires_ds(plasma) +def test_plasma(): + ds = data_dir_load(plasma) + assert_equal(str(ds), "plt00030_v2") + for test in small_patch_amr(ds, _warpx_fields, + input_center="c", + input_weight="Ex"): + test_plasma.__name__ = test.description + yield test + +beam = "GaussianBeam/plt03008" +@requires_ds(beam) +def test_beam(): + ds = data_dir_load(beam) + assert_equal(str(ds), "plt03008") + for test in small_patch_amr(ds, _warpx_fields, + input_center="c", + input_weight="Ex"): + test_beam.__name__ = test.description + yield test + +@requires_file(plasma) +def test_warpx_particle_io(): + ds = data_dir_load(plasma) + grid = ds.index.grids[0] + + # read directly from the header + npart0_grid_0 = 344 + npart1_grid_0 = 69632 + + assert_equal(grid['particle0', 'particle_position_x'].size, npart0_grid_0) + assert_equal(grid['particle1', 'particle_position_y'].size, npart1_grid_0) + assert_equal(grid['all', 'particle_position_z'].size, npart0_grid_0 + npart1_grid_0) + + # read directly from the header + npart0 = 1360 + npart1 = 802816 + ad = ds.all_data() + assert_equal(ad['particle0', 'particle_velocity_x'].size, npart0) + assert_equal(ad['particle1', 'particle_velocity_y'].size, npart1) + assert_equal(ad['all', 'particle_velocity_z'].size, npart0 + npart1) + + np.all(ad['particle1', 'particle_mass'] == ad['particle1', 'particle_mass'][0]) + np.all(ad['particle0', 'particle_mass'] == ad['particle0', 'particle_mass'][0]) + + left_edge = ds.arr([-7.5e-5, -7.5e-5, -7.5e-5], 'code_length') + right_edge = ds.arr([2.5e-5, 2.5e-5, 2.5e-5], 'code_length') + center = 0.5*(left_edge + right_edge) + + reg = ds.region(center, left_edge, right_edge) + + assert(np.all(np.logical_and(reg['particle_position_x'] <= right_edge[0], + reg['particle_position_x'] >= left_edge[0]))) + + assert(np.all(np.logical_and(reg['particle_position_y'] <= right_edge[1], + reg['particle_position_y'] >= left_edge[1]))) + + assert(np.all(np.logical_and(reg['particle_position_z'] <= right_edge[2], + reg['particle_position_z'] >= left_edge[2]))) + + +_raw_fields = [('raw', 'Bx'), ('raw', 'Ey'), ('raw', 'jz')] + +raw_fields = "Laser/plt00015" +@requires_ds(raw_fields) +def test_raw_fields(): + ds_fn = raw_fields + for field in _raw_fields: + yield GridValuesTest(ds_fn, field) + + +@requires_file(rt) +def test_OrionDataset(): + assert isinstance(data_dir_load(rt), OrionDataset) + +@requires_file(LyA) +def test_NyxDataset(): + assert isinstance(data_dir_load(LyA), NyxDataset) + +@requires_file(RT_particles) +def test_CastroDataset(): + assert isinstance(data_dir_load(RT_particles), CastroDataset) + +@requires_file(LyA) +def test_WarpXDataset(): + assert isinstance(data_dir_load(plasma), WarpXDataset) + +@requires_file(rt) +def test_units_override(): + units_override_check(rt) + +nyx_no_particles = "nyx_sedov_plt00086" +@requires_file(nyx_no_particles) +def test_nyx_no_part(): + assert isinstance(data_dir_load(nyx_no_particles), NyxDataset) + + fields = sorted( + [('boxlib', 'H'), ('boxlib', 'He'), ('boxlib', 'MachNumber'), + ('boxlib', 'Ne'), ('boxlib', 'Rank'), ('boxlib', 'StateErr'), + ('boxlib', 'Temp'), ('boxlib', 'X(H)'), ('boxlib', 'X(He)'), + ('boxlib', 'density'), ('boxlib', 'divu'), ('boxlib', 'eint_E'), + ('boxlib', 'eint_e'), ('boxlib', 'entropy'), ('boxlib', 'forcex'), + ('boxlib', 'forcey'), ('boxlib', 'forcez'), ('boxlib', 'kineng'), + ('boxlib', 'logden'), ('boxlib', 'magmom'), ('boxlib', 'magvel'), + ('boxlib', 'magvort'), ('boxlib', 'pressure'), ('boxlib', 'rho_E'), + ('boxlib', 'rho_H'), ('boxlib', 'rho_He'), ('boxlib', 'rho_e'), + ('boxlib', 'soundspeed'), ('boxlib', 'x_velocity'), ('boxlib', 'xmom'), + ('boxlib', 'y_velocity'), ('boxlib', 'ymom'), ('boxlib', 'z_velocity'), + ('boxlib', 'zmom')]) + + ds = data_dir_load(nyx_no_particles) + assert_equal(sorted(ds.field_list), fields) diff -Nru yt-3.3.3/yt/frontends/chombo/data_structures.py yt-3.4.0/yt/frontends/chombo/data_structures.py --- yt-3.3.3/yt/frontends/chombo/data_structures.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/chombo/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -34,7 +34,8 @@ from yt.data_objects.static_output import \ Dataset from yt.utilities.file_handler import \ - HDF5FileHandler + HDF5FileHandler, \ + warn_h5py from yt.utilities.parallel_tools.parallel_analysis_interface import \ parallel_root_only from yt.utilities.lib.misc_utilities import \ @@ -730,6 +731,8 @@ @classmethod def _is_valid(self, *args, **kwargs): + warn_h5py(args[0]) + if not is_chombo_hdf5(args[0]): return False diff -Nru yt-3.3.3/yt/frontends/chombo/fields.py yt-3.4.0/yt/frontends/chombo/fields.py --- yt-3.3.3/yt/frontends/chombo/fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/chombo/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -86,9 +86,9 @@ return velocity for ax in 'xyz': - self.add_field((ptype, "particle_velocity_%s" % ax), + self.add_field((ptype, "particle_velocity_%s" % ax), + sampling_type="particle", function=_get_vel(ax), - particle_type=True, units="code_length/code_time") super(Orion2FieldInfo, self).setup_particle_fields(ptype) @@ -130,7 +130,7 @@ return data['kinetic_energy']/data['density'] def _temperature(field, data): - c_v = data.ds.quan(data.ds.parameters['radiation.const_cv'], + c_v = data.ds.quan(data.ds.parameters['radiation.const_cv'], 'erg/g/K') return (data["thermal_energy"]/c_v) @@ -140,27 +140,28 @@ return velocity for ax in 'xyz': - self.add_field(("gas", "velocity_%s" % ax), function = _get_vel(ax), + self.add_field(("gas", "velocity_%s" % ax), sampling_type="cell", + function = _get_vel(ax), units = unit_system["velocity"]) - self.add_field(("gas", "thermal_energy"), + self.add_field(("gas", "thermal_energy"), sampling_type="cell", function = _thermal_energy, units = unit_system["specific_energy"]) - self.add_field(("gas", "thermal_energy_density"), + self.add_field(("gas", "thermal_energy_density"), sampling_type="cell", function = _thermal_energy_density, units = unit_system["pressure"]) - self.add_field(("gas", "kinetic_energy"), + self.add_field(("gas", "kinetic_energy"), sampling_type="cell", function = _kinetic_energy, units = unit_system["pressure"]) - self.add_field(("gas", "specific_kinetic_energy"), + self.add_field(("gas", "specific_kinetic_energy"), sampling_type="cell", function = _specific_kinetic_energy, units = unit_system["specific_energy"]) - self.add_field(("gas", "magnetic_energy"), + self.add_field(("gas", "magnetic_energy"), sampling_type="cell", function = _magnetic_energy, units = unit_system["pressure"]) - self.add_field(("gas", "specific_magnetic_energy"), + self.add_field(("gas", "specific_magnetic_energy"), sampling_type="cell", function = _specific_magnetic_energy, units = unit_system["specific_energy"]) - self.add_field(("gas", "temperature"), function=_temperature, + self.add_field(("gas", "temperature"), sampling_type="cell", function=_temperature, units=unit_system["temperature"]) setup_magnetic_field_aliases(self, "chombo", ["%s-magnfield" % ax for ax in "XYZ"]) @@ -199,8 +200,8 @@ output_units = units if (ptype, f) not in self.field_list: continue - self.add_output_field((ptype, f), - units = units, particle_type = True, + self.add_output_field((ptype, f), sampling_type="particle", + units = units, display_name = dn, output_units = output_units, take_log=False) for alias in aliases: self.alias((ptype, alias), (ptype, f), units = output_units) @@ -219,9 +220,8 @@ raise RuntimeError if field[0] not in self.ds.particle_types: continue - self.add_output_field(field, - units = self.ds.field_units.get(field, ""), - particle_type = True) + self.add_output_field(field, sampling_type="particle", + units = self.ds.field_units.get(field, "")) self.setup_smoothed_fields(ptype, num_neighbors=num_neighbors, ftype=ftype) @@ -261,16 +261,17 @@ super(ChomboPICFieldInfo2D, self).__init__(ds, field_list) for ftype in fluid_field_types: - self.add_field((ftype, 'gravitational_field_z'), function = _dummy_field, + self.add_field((ftype, 'gravitational_field_z'), sampling_type="cell", + function = _dummy_field, units = "code_length / code_time**2") - for ptype in particle_field_types: - self.add_field((ptype, "particle_position_z"), function = _dummy_position, - particle_type = True, + for ptype in particle_field_types: + self.add_field((ptype, "particle_position_z"), sampling_type="particle", + function = _dummy_position, units = "code_length") - self.add_field((ptype, "particle_velocity_z"), function = _dummy_velocity, - particle_type = True, + self.add_field((ptype, "particle_velocity_z"), sampling_type="particle", + function = _dummy_velocity, units = "code_length / code_time") @@ -290,24 +291,26 @@ super(ChomboPICFieldInfo1D, self).__init__(ds, field_list) for ftype in fluid_field_types: - self.add_field((ftype, 'gravitational_field_y'), function = _dummy_field, + self.add_field((ftype, 'gravitational_field_y'), sampling_type="cell", + function = _dummy_field, units = "code_length / code_time**2") - self.add_field((ftype, 'gravitational_field_z'), function = _dummy_field, - units = "code_length / code_time**2") + self.add_field((ftype, 'gravitational_field_z'), sampling_type="cell", + function = _dummy_field, + units = "code_length / code_time**2") for ptype in particle_field_types: - self.add_field((ptype, "particle_position_y"), function = _dummy_position, - particle_type = True, + self.add_field((ptype, "particle_position_y"), sampling_type="particle", + function = _dummy_position, units = "code_length") - self.add_field((ptype, "particle_position_z"), function = _dummy_position, - particle_type = True, + self.add_field((ptype, "particle_position_z"), sampling_type="particle", + function = _dummy_position, units = "code_length") - self.add_field((ptype, "particle_velocity_y"), function = _dummy_velocity, - particle_type = True, + self.add_field((ptype, "particle_velocity_y"), sampling_type="particle", + function = _dummy_velocity, units = "code_length / code_time") - self.add_field((ptype, "particle_velocity_z"), function = _dummy_velocity, - particle_type = True, + self.add_field((ptype, "particle_velocity_z"), sampling_type="particle", + function = _dummy_velocity, units = "code_length / code_time") @@ -329,4 +332,3 @@ from yt.fields.magnetic_field import \ setup_magnetic_field_aliases setup_magnetic_field_aliases(self, "chombo", ["bx%s" % ax for ax in [1,2,3]]) - diff -Nru yt-3.3.3/yt/frontends/chombo/io.py yt-3.4.0/yt/frontends/chombo/io.py --- yt-3.3.3/yt/frontends/chombo/io.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/chombo/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -15,8 +15,10 @@ import re import numpy as np -from yt.utilities.logger import ytLogger as mylog - +from yt.geometry.selection_routines import \ + GridSelector +from yt.utilities.logger import \ + ytLogger as mylog from yt.utilities.io_handler import \ BaseIOHandler @@ -116,7 +118,7 @@ rv = {} chunks = list(chunks) fields.sort(key=lambda a: self.field_dict[a[1]]) - if selector.__class__.__name__ == "GridSelector": + if isinstance(selector, GridSelector): if not (len(chunks) == len(chunks[0].objs) == 1): raise RuntimeError grid = chunks[0].objs[0] @@ -149,7 +151,7 @@ rv = {} chunks = list(chunks) - if selector.__class__.__name__ == "GridSelector": + if isinstance(selector, GridSelector): if not (len(chunks) == len(chunks[0].objs) == 1): raise RuntimeError @@ -199,11 +201,9 @@ def parse_orion_sinks(fn): ''' - Orion sink particles are stored in text files. This function is for figuring what particle fields are present based on the - number of entries per line in the *.sink file. - + number of entries per line in the \*.sink file. ''' # Figure out the format of the particle file diff -Nru yt-3.3.3/yt/frontends/chombo/tests/test_outputs.py yt-3.4.0/yt/frontends/chombo/tests/test_outputs.py --- yt-3.3.3/yt/frontends/chombo/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/chombo/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -33,7 +33,7 @@ @requires_ds(gc) def test_gc(): ds = data_dir_load(gc) - yield assert_equal, str(ds), "data.0077.3d.hdf5" + assert_equal(str(ds), "data.0077.3d.hdf5") for test in small_patch_amr(ds, _fields): test_gc.__name__ = test.description yield test @@ -42,7 +42,7 @@ @requires_ds(tb) def test_tb(): ds = data_dir_load(tb) - yield assert_equal, str(ds), "data.0005.3d.hdf5" + assert_equal(str(ds), "data.0005.3d.hdf5") for test in small_patch_amr(ds, _fields): test_tb.__name__ = test.description yield test @@ -51,7 +51,7 @@ @requires_ds(iso) def test_iso(): ds = data_dir_load(iso) - yield assert_equal, str(ds), "data.0000.3d.hdf5" + assert_equal(str(ds), "data.0000.3d.hdf5") for test in small_patch_amr(ds, _fields): test_iso.__name__ = test.description yield test @@ -61,7 +61,7 @@ @requires_ds(zp) def test_zp(): ds = data_dir_load(zp) - yield assert_equal, str(ds), "plt32.2d.hdf5" + assert_equal(str(ds), "plt32.2d.hdf5") for test in small_patch_amr(ds, _zp_fields, input_center="c", input_weight="rhs"): test_zp.__name__ = test.description @@ -71,7 +71,7 @@ @requires_ds(kho) def test_kho(): ds = data_dir_load(kho) - yield assert_equal, str(ds), "data.0004.hdf5" + assert_equal(str(ds), "data.0004.hdf5") for test in small_patch_amr(ds, _fields): test_kho.__name__ = test.description yield test @@ -92,15 +92,12 @@ @requires_file(zp) def test_units_override_zp(): - for test in units_override_check(zp): - yield test + units_override_check(zp) @requires_file(gc) def test_units_override_gc(): - for test in units_override_check(gc): - yield test + units_override_check(gc) @requires_file(kho) def test_units_override_kho(): - for test in units_override_check(kho): - yield test + units_override_check(kho) diff -Nru yt-3.3.3/yt/frontends/enzo/answer_testing_support.py yt-3.4.0/yt/frontends/enzo/answer_testing_support.py --- yt-3.3.3/yt/frontends/enzo/answer_testing_support.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/enzo/answer_testing_support.py 2017-08-10 18:02:57.000000000 +0000 @@ -27,8 +27,23 @@ FieldValuesTest, \ GridValuesTest, \ ProjectionValuesTest, \ - temp_cwd, \ - AssertWrapper + temp_cwd + + +class AssertWrapper(object): + """ + Used to wrap a numpy testing assertion, in order to provide a useful name + for a given assertion test. + """ + def __init__(self, description, *args): + # The key here is to add a description attribute, which nose will pick + # up. + self.args = args + self.description = description + + def __call__(self): + self.args[0](*self.args[1:]) + def requires_outputlog(path = ".", prefix = ""): def ffalse(func): diff -Nru yt-3.3.3/yt/frontends/enzo/data_structures.py yt-3.4.0/yt/frontends/enzo/data_structures.py --- yt-3.3.3/yt/frontends/enzo/data_structures.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/enzo/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -30,7 +30,6 @@ ensure_tuple, \ get_pbar, \ setdefaultattr -from yt.config import ytcfg from yt.data_objects.grid_patch import \ AMRGridPatch from yt.geometry.grid_geometry_handler import \ @@ -66,28 +65,6 @@ self._parent_id = -1 self.Level = -1 - def _guess_properties_from_parent(self): - """ - We know that our grid boundary occurs on the cell boundary of our - parent. This can be a very expensive process, but it is necessary - in some indexs, where yt is unable to generate a completely - space-filling tiling of grids, possibly due to the finite accuracy in a - standard Enzo index file. - """ - rf = self.ds.refine_by - my_ind = self.id - self._id_offset - self.dds = self.Parent.dds/rf - ParentLeftIndex = np.rint((self.LeftEdge-self.Parent.LeftEdge)/self.Parent.dds) - self.start_index = rf*(ParentLeftIndex + self.Parent.get_global_startindex()).astype('int64') - self.LeftEdge = self.Parent.LeftEdge + self.Parent.dds * ParentLeftIndex - self.RightEdge = self.LeftEdge + self.ActiveDimensions*self.dds - self.index.grid_left_edge[my_ind,:] = self.LeftEdge - self.index.grid_right_edge[my_ind,:] = self.RightEdge - self._child_mask = None - self._child_index_mask = None - self._child_indices = None - self._setup_dx() - def set_filename(self, filename): """ Intelligently set the filename. @@ -276,7 +253,7 @@ version = float(params["Internal"]["Provenance"]["VersionNumber"]) if version >= 3.0: active_particles = True - nap = dict((ap_type, []) for ap_type in + nap = dict((ap_type, []) for ap_type in params["Physics"]["ActiveParticles"]["ActiveParticlesEnabled"]) else: if "AppendActiveParticleType" in self.parameters: @@ -380,13 +357,10 @@ mylog.info("Finished rebuilding") def _populate_grid_objects(self): - reconstruct = ytcfg.getboolean("yt","reconstruct_index") for g,f in izip(self.grids, self.filenames): g._prepare_grid() g._setup_dx() g.set_filename(f[0]) - if reconstruct: - if g.Parent is not None: g._guess_properties_from_parent() del self.filenames # No longer needed. self.max_level = self.grid_levels.max() @@ -425,7 +399,7 @@ for apt in aps: dd = field._copy_def() dd.pop("name") - self.ds.field_info.add_field((apt, fname), **dd) + self.ds.field_info.add_field((apt, fname), sampling_type="cell", **dd) def _detect_output_fields(self): self.field_list = [] @@ -761,7 +735,7 @@ """ # Let's read the file with open(self.parameter_filename, "r") as f: - line = f.readline().strip() + line = f.readline().strip() f.seek(0) if line == "Internal:": self._parse_enzo3_parameter_file(f) @@ -852,7 +826,7 @@ self.unique_identifier = self.parameters["CurrentTimeIdentifier"] else: self.unique_identifier = \ - int(os.stat(self.parameter_filename)[stat.ST_CTIME]) + str(int(os.stat(self.parameter_filename)[stat.ST_CTIME])) if self.dimensionality > 1: self.domain_dimensions = self.parameters["TopGridDimensions"] if len(self.domain_dimensions) < 3: @@ -873,11 +847,6 @@ self.periodicity += (False, False) self.gamma = self.parameters["Gamma"] - # To be enabled when we can break old pickles: - #if "MetaDataSimulationUUID" in self.parameters: - # self.unique_identifier = self.parameters["MetaDataSimulationUUID"] - self.unique_identifier = self.parameters.get("MetaDataDatasetUUID", - self.parameters.get("CurrentTimeIdentifier", None)) if self.parameters["ComovingCoordinates"]: self.cosmological_simulation = 1 self.current_redshift = self.parameters["CosmologyCurrentRedshift"] @@ -1099,4 +1068,3 @@ for line in lines: yield line yield buf # First line. - diff -Nru yt-3.3.3/yt/frontends/enzo/fields.py yt-3.4.0/yt/frontends/enzo/fields.py --- yt-3.3.3/yt/frontends/enzo/fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/enzo/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,6 +13,7 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +import numpy as np from yt.fields.field_info_container import \ FieldInfoContainer from yt.utilities.physical_constants import \ @@ -20,6 +21,7 @@ mp b_units = "code_magnetic" +e_units = "code_magnetic/c" ra_units = "code_length / code_time**2" rho_units = "code_mass / code_length**3" vel_units = "code_velocity" @@ -49,6 +51,18 @@ 'OIX' : 'O_p8', } +NODAL_FLAGS = { + 'BxF': [1, 0, 0], + 'ByF': [0, 1, 0], + 'BzF': [0, 0, 1], + 'Ex': [0, 1, 1], + 'Ey': [1, 0, 1], + 'Ez': [1, 1, 0], + 'AvgElec0': [0, 1, 1], + 'AvgElec1': [1, 0, 1], + 'AvgElec2': [1, 1, 0], +} + class EnzoFieldInfo(FieldInfoContainer): known_other_fields = ( ("Cooling_Time", ("s", ["cooling_time"], None)), @@ -63,6 +77,15 @@ ("Bx", (b_units, [], None)), ("By", (b_units, [], None)), ("Bz", (b_units, [], None)), + ("BxF", (b_units, [], None)), + ("ByF", (b_units, [], None)), + ("BzF", (b_units, [], None)), + ("Ex", (e_units, [], None)), + ("Ey", (e_units, [], None)), + ("Ez", (e_units, [], None)), + ("AvgElec0", (e_units, [], None)), + ("AvgElec1", (e_units, [], None)), + ("AvgElec2", (e_units, [], None)), ("RadAccel1", (ra_units, ["radiation_acceleration_x"], None)), ("RadAccel2", (ra_units, ["radiation_acceleration_y"], None)), ("RadAccel3", (ra_units, ["radiation_acceleration_z"], None)), @@ -116,6 +139,12 @@ slice_info = (sl_left, sl_right, div_fac) super(EnzoFieldInfo, self).__init__(ds, field_list, slice_info) + # setup nodal flag information + for field in NODAL_FLAGS: + if ('enzo', field) in self: + finfo = self['enzo', field] + finfo.nodal_flag = np.array(NODAL_FLAGS[field]) + def add_species_field(self, species): # This is currently specific to Enzo. Hopefully in the future we will # have deeper integration with other systems, such as Dengo, to provide @@ -125,7 +154,7 @@ # off, we add the species field itself. Then we'll add a few more # items... # - self.add_output_field(("enzo", "%s_Density" % species), + self.add_output_field(("enzo", "%s_Density" % species), sampling_type="cell", take_log=True, units="code_mass/code_length**3") yt_name = known_species_names[species] @@ -141,7 +170,7 @@ if sp in known_species_names] def _electron_density(field, data): return data["Electron_Density"] * (me/mp) - self.add_field(("gas", "El_density"), + self.add_field(("gas", "El_density"), sampling_type="cell", function = _electron_density, units = self.ds.unit_system["density"]) for sp in species_names: @@ -188,13 +217,30 @@ te_name = "TotalEnergy" if hydro_method == 2: - self.add_output_field(("enzo", te_name), + self.add_output_field(("enzo", te_name), sampling_type="cell", units="code_velocity**2") self.alias(("gas", "thermal_energy"), ("enzo", te_name)) - + def _ge_plus_kin(field, data): + ret = data[te_name] + 0.5*data["velocity_x"]**2.0 + if data.ds.dimensionality > 1: + ret += 0.5*data["velocity_y"]**2.0 + if data.ds.dimensionality > 2: + ret += 0.5*data["velocity_z"]**2.0 + return ret + self.add_field( + ("gas", "total_energy"), sampling_type="cell", + function = _ge_plus_kin, + units = unit_system["specific_energy"]) elif dual_energy == 1: self.add_output_field( - ("enzo", ge_name), + ("enzo", te_name), sampling_type="cell", + units = "code_velocity**2") + self.alias( + ("gas", "total_energy"), + ("enzo", te_name), + units = unit_system["specific_energy"]) + self.add_output_field( + ("enzo", ge_name), sampling_type="cell", units="code_velocity**2") self.alias( ("gas", "thermal_energy"), @@ -202,7 +248,7 @@ units = unit_system["specific_energy"]) elif hydro_method in (4, 6): self.add_output_field( - ("enzo", te_name), + ("enzo", te_name), sampling_type="cell", units="code_velocity**2") # Subtract off B-field energy def _sub_b(field, data): @@ -214,13 +260,16 @@ ret -= data["magnetic_energy"]/data["density"] return ret self.add_field( - ("gas", "thermal_energy"), + ("gas", "thermal_energy"), sampling_type="cell", function=_sub_b, units = unit_system["specific_energy"]) else: # Otherwise, we assume TotalEnergy is kinetic+thermal self.add_output_field( - ("enzo", te_name), + ("enzo", te_name), sampling_type="cell", units = "code_velocity**2") - self.alias(("gas", "total_energy"), ("enzo", te_name)) + self.alias( + ("gas", "total_energy"), + ("enzo", te_name), + units = unit_system["specific_energy"]) def _tot_minus_kin(field, data): ret = data[te_name] - 0.5*data["velocity_x"]**2.0 if data.ds.dimensionality > 1: @@ -229,14 +278,14 @@ ret -= 0.5*data["velocity_z"]**2.0 return ret self.add_field( - ("gas", "thermal_energy"), + ("gas", "thermal_energy"), sampling_type="cell", function = _tot_minus_kin, units = unit_system["specific_energy"]) if multi_species == 0 and 'Mu' in params: def _number_density(field, data): return data['gas', 'density']/(mp*params['Mu']) self.add_field( - ("gas", "number_density"), + ("gas", "number_density"), sampling_type="cell", function = _number_density, units=unit_system["number_density"]) @@ -244,8 +293,7 @@ def _age(field, data): return data.ds.current_time - data["creation_time"] - self.add_field((ptype, "age"), function = _age, - particle_type = True, + self.add_field((ptype, "age"), sampling_type="particle", function = _age, units = "yr") super(EnzoFieldInfo, self).setup_particle_fields(ptype) diff -Nru yt-3.3.3/yt/frontends/enzo/io.py yt-3.4.0/yt/frontends/enzo/io.py --- yt-3.3.3/yt/frontends/enzo/io.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/enzo/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,16 +13,12 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -import random -from contextlib import contextmanager - from yt.utilities.io_handler import \ BaseIOHandler from yt.utilities.logger import ytLogger as mylog -from yt.geometry.selection_routines import AlwaysSelector -from yt.extern.six import u, b, iteritems +from yt.extern.six import b, iteritems from yt.utilities.on_demand_imports import _h5py as h5py - +from yt.geometry.selection_routines import GridSelector import numpy as np @@ -77,33 +73,8 @@ return (KeyError,) def _read_particle_coords(self, chunks, ptf): - chunks = list(chunks) - for chunk in chunks: # These should be organized by grid filename - f = None - for g in chunk.objs: - if g.filename is None: continue - if f is None: - #print "Opening (count) %s" % g.filename - f = h5py.File(g.filename, "r") - nap = sum(g.NumberOfActiveParticles.values()) - if g.NumberOfParticles == 0 and nap == 0: - continue - ds = f.get("/Grid%08i" % g.id) - for ptype, field_list in sorted(ptf.items()): - if ptype != "io": - if g.NumberOfActiveParticles[ptype] == 0: continue - pds = ds.get("Particles/%s" % ptype) - else: - pds = ds - pn = _particle_position_names.get(ptype, - r"particle_position_%s") - x, y, z = (np.asarray(pds.get(pn % ax).value, dtype="=f8") - for ax in 'xyz') - for field in field_list: - if np.asarray(pds[field]).ndim > 1: - self._array_fields[field] = pds[field].shape - yield ptype, (x, y, z) - if f: f.close() + for rv in self._read_particle_fields(chunks, ptf, None): + yield rv def _read_particle_fields(self, chunks, ptf, selector): chunks = list(chunks) @@ -128,6 +99,11 @@ r"particle_position_%s") x, y, z = (np.asarray(pds.get(pn % ax).value, dtype="=f8") for ax in 'xyz') + if selector is None: + # This only ever happens if the call is made from + # _read_particle_coords. + yield ptype, (x, y, z) + continue mask = selector.select_points(x, y, z, 0.0) if mask is None: continue for field in field_list: @@ -137,168 +113,58 @@ yield (ptype, field), data[mask] if f: f.close() - def _read_fluid_selection(self, chunks, selector, fields, size): - rv = {} - # Now we have to do something unpleasant - chunks = list(chunks) - if selector.__class__.__name__ == "GridSelector": - if not (len(chunks) == len(chunks[0].objs) == 1): - raise RuntimeError - g = chunks[0].objs[0] - f = h5py.File(u(g.filename), 'r') - if g.id in self._cached_fields: - gf = self._cached_fields[g.id] - rv.update(gf) - if len(rv) == len(fields): return rv - gds = f.get("/Grid%08i" % g.id) - for field in fields: - if field in rv: - self._hits += 1 - continue - self._misses += 1 - ftype, fname = field - if fname in gds: - rv[(ftype, fname)] = gds.get(fname).value.swapaxes(0, -1) - else: - rv[(ftype, fname)] = np.zeros(g.ActiveDimensions) - if self._cache_on: - for gid in rv: - self._cached_fields.setdefault(gid, {}) - self._cached_fields[gid].update(rv[gid]) - f.close() - return rv - if size is None: - size = sum((g.count(selector) for chunk in chunks - for g in chunk.objs)) - for field in fields: - ftype, fname = field - fsize = size - rv[field] = np.empty(fsize, dtype="float64") - ng = sum(len(c.objs) for c in chunks) - mylog.debug("Reading %s cells of %s fields in %s grids", - size, [f2 for f1, f2 in fields], ng) - ind = 0 - h5_type = self._field_dtype + def io_iter(self, chunks, fields): + h5_dtype = self._field_dtype for chunk in chunks: fid = None - for g in chunk.objs: - if g.filename is None: continue - if fid is None: - fid = h5py.h5f.open(b(g.filename), h5py.h5f.ACC_RDONLY) - gf = self._cached_fields.get(g.id, {}) - data = np.empty(g.ActiveDimensions[::-1], dtype=h5_type) - data_view = data.swapaxes(0, -1) - nd = 0 + filename = -1 + for obj in chunk.objs: + if obj.filename is None: continue + if obj.filename != filename: + # Note one really important thing here: even if we do + # implement LRU caching in the _read_obj_field function, + # we'll still be doing file opening and whatnot. This is a + # problem, but one we can return to. + if fid is not None: + fid.close() + fid = h5py.h5f.open(b(obj.filename), h5py.h5f.ACC_RDONLY) + filename = obj.filename for field in fields: - if field in gf: - nd = g.select(selector, gf[field], rv[field], ind) - self._hits += 1 - continue - self._misses += 1 - ftype, fname = field - try: - node = "/Grid%08i/%s" % (g.id, fname) - dg = h5py.h5d.open(fid, b(node)) - except KeyError: - if fname == "Dark_Matter_Density": continue - raise - dg.read(h5py.h5s.ALL, h5py.h5s.ALL, data) - if self._cache_on: - self._cached_fields.setdefault(g.id, {}) - # Copy because it's a view into an empty temp array - self._cached_fields[g.id][field] = data_view.copy() - nd = g.select(selector, data_view, rv[field], ind) # caches - ind += nd - if fid: fid.close() - return rv - - @contextmanager - def preload(self, chunk, fields, max_size): - if len(fields) == 0: - yield self - return - old_cache_on = self._cache_on - old_cached_fields = self._cached_fields - self._cached_fields = cf = {} - self._cache_on = True - for gid in old_cached_fields: - # Will not copy numpy arrays, which is good! - cf[gid] = old_cached_fields[gid].copy() - self._hits = self._misses = 0 - self._cached_fields = self._read_chunk_data(chunk, fields) - mylog.debug("(1st) Hits = % 10i Misses = % 10i", - self._hits, self._misses) - self._hits = self._misses = 0 - yield self - mylog.debug("(2nd) Hits = % 10i Misses = % 10i", - self._hits, self._misses) - self._cached_fields = old_cached_fields - self._cache_on = old_cache_on - # Randomly remove some grids from the cache. Note that we're doing - # this on a grid basis, not a field basis. Performance will be - # slightly non-deterministic as a result of this, but it should roughly - # be statistically alright, assuming (as we do) that this will get - # called during largely unbalanced stuff. - if len(self._cached_fields) > max_size: - to_remove = random.sample(self._cached_fields.keys(), - len(self._cached_fields) - max_size) - mylog.debug("Purging from cache %s", len(to_remove)) - for k in to_remove: - self._cached_fields.pop(k) + nodal_flag = self.ds.field_info[field].nodal_flag + dims = obj.ActiveDimensions[::-1] + nodal_flag[::-1] + data = np.empty(dims, dtype=h5_dtype) + yield field, obj, self._read_obj_field( + obj, field, (fid, data)) + if fid is not None: + fid.close() + + def _read_obj_field(self, obj, field, fid_data): + if fid_data is None: fid_data = (None, None) + fid, data = fid_data + if fid is None: + close = True + fid = h5py.h5f.open(b(obj.filename), h5py.h5f.ACC_RDONLY) else: - mylog.warning("Cache size % 10i (max % 10i)", - len(self._cached_fields), max_size) - - def _read_chunk_data(self, chunk, fields): - fid = fn = None - rv = {} - mylog.debug("Preloading fields %s", fields) - # Split into particles and non-particles - fluid_fields, particle_fields = [], [] - for ftype, fname in fields: - if ftype in self.ds.particle_types: - particle_fields.append((ftype, fname)) - else: - fluid_fields.append((ftype, fname)) - if len(particle_fields) > 0: - selector = AlwaysSelector(self.ds) - rv.update(self._read_particle_selection( - [chunk], selector, particle_fields)) - if len(fluid_fields) == 0: return rv - h5_type = self._field_dtype - for g in chunk.objs: - rv[g.id] = gf = {} - if g.id in self._cached_fields: - rv[g.id].update(self._cached_fields[g.id]) - if g.filename is None: continue - elif g.filename != fn: - if fid is not None: fid.close() - fid = None - if fid is None: - fid = h5py.h5f.open(b(g.filename), h5py.h5f.ACC_RDONLY) - fn = g.filename - data = np.empty(g.ActiveDimensions[::-1], dtype=h5_type) - data_view = data.swapaxes(0, -1) - for field in fluid_fields: - if field in gf: - self._hits += 1 - continue - self._misses += 1 - ftype, fname = field - try: - node = "/Grid%08i/%s" % (g.id, fname) - dg = h5py.h5d.open(fid, b(node)) - except KeyError: - if fname == "Dark_Matter_Density": continue - raise - dg.read(h5py.h5s.ALL, h5py.h5s.ALL, data) - gf[field] = data_view.copy() - if fid: fid.close() - if self._cache_on: - for gid in rv: - self._cached_fields.setdefault(gid, {}) - self._cached_fields[gid].update(rv[gid]) - return rv + close = False + if data is None: + data = np.empty(obj.ActiveDimensions[::-1], + dtype=self._field_dtype) + ftype, fname = field + try: + node = "/Grid%08i/%s" % (obj.id, fname) + dg = h5py.h5d.open(fid, b(node)) + except KeyError: + if fname == "Dark_Matter_Density": + data[:] = 0 + return data.T + raise + dg.read(h5py.h5s.ALL, h5py.h5s.ALL, data) + # I don't know why, but on some installations of h5py this works, but + # on others, nope. Doesn't seem to be a version thing. + #dg.close() + if close: + fid.close() + return data.T class IOHandlerPackedHDF5GhostZones(IOHandlerPackedHDF5): _dataset_type = "enzo_packed_3d_gz" @@ -310,11 +176,9 @@ slice(NGZ, -NGZ), slice(NGZ, -NGZ)) - def _read_raw_data_set(self, grid, field): - f = h5py.File(grid.filename, "r") - ds = f["/Grid%08i/%s" % (grid.id, field)][:].swapaxes(0,2) - f.close() - return ds + def _read_obj_field(self, *args, **kwargs): + return super(IOHandlerPackedHDF5GhostZones, self)._read_obj_field( + *args, **kwargs)[self._base] class IOHandlerInMemory(BaseIOHandler): @@ -351,7 +215,7 @@ rv = {} # Now we have to do something unpleasant chunks = list(chunks) - if selector.__class__.__name__ == "GridSelector": + if isinstance(selector, GridSelector): if not (len(chunks) == len(chunks[0].objs) == 1): raise RuntimeError g = chunks[0].objs[0] @@ -433,7 +297,7 @@ rv = {} # Now we have to do something unpleasant chunks = list(chunks) - if selector.__class__.__name__ == "GridSelector": + if isinstance(selector, GridSelector): if not (len(chunks) == len(chunks[0].objs) == 1): raise RuntimeError g = chunks[0].objs[0] diff -Nru yt-3.3.3/yt/frontends/enzo/tests/test_outputs.py yt-3.4.0/yt/frontends/enzo/tests/test_outputs.py --- yt-3.3.3/yt/frontends/enzo/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/enzo/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -20,7 +20,8 @@ assert_equal, \ requires_file, \ units_override_check, \ - assert_array_equal + assert_array_equal, \ + assert_allclose_units from yt.utilities.answer_testing.framework import \ requires_ds, \ small_patch_amr, \ @@ -28,7 +29,10 @@ data_dir_load, \ AnalyticHaloMassFunctionTest, \ SimulatedHaloMassFunctionTest +from yt.visualization.plot_window import \ + SlicePlot from yt.frontends.enzo.api import EnzoDataset +from yt.frontends.enzo.fields import NODAL_FLAGS _fields = ("temperature", "density", "velocity_magnitude", "velocity_divergence") @@ -40,6 +44,8 @@ enzotiny = "enzo_tiny_cosmology/DD0046/DD0046" toro1d = "ToroShockTube/DD0001/data0001" kh2d = "EnzoKelvinHelmholtz/DD0011/DD0011" +mhdctot = "MHDCTOrszagTang/DD0004/data0004" +dnz = "DeeplyNestedZoom/DD0025/data0025" def check_color_conservation(ds): species_names = ds.field_info.species_names @@ -71,7 +77,7 @@ @requires_ds(m7) def test_moving7(): ds = data_dir_load(m7) - yield assert_equal, str(ds), "moving7_0010" + assert_equal(str(ds), "moving7_0010") for test in small_patch_amr(m7, _fields): test_moving7.__name__ = test.description yield test @@ -80,7 +86,7 @@ def test_galaxy0030(): ds = data_dir_load(g30) yield check_color_conservation(ds) - yield assert_equal, str(ds), "galaxy0030" + assert_equal(str(ds), "galaxy0030") for test in big_patch_amr(ds, _fields): test_galaxy0030.__name__ = test.description yield test @@ -122,18 +128,17 @@ @requires_file(enzotiny) def test_units_override(): - for test in units_override_check(enzotiny): - yield test + units_override_check(enzotiny) @requires_ds(ecp, big_data=True) def test_nuclei_density_fields(): ds = data_dir_load(ecp) ad = ds.all_data() - yield assert_array_equal, ad["H_nuclei_density"], \ - (ad["H_number_density"] + ad["H_p1_number_density"]) - yield assert_array_equal, ad["He_nuclei_density"], \ - (ad["He_number_density"] + ad["He_p1_number_density"] + - ad["He_p2_number_density"]) + assert_array_equal(ad["H_nuclei_density"], + (ad["H_number_density"] + ad["H_p1_number_density"])) + assert_array_equal(ad["He_nuclei_density"], + (ad["He_number_density"] + + ad["He_p1_number_density"] + ad["He_p2_number_density"])) @requires_file(enzotiny) def test_EnzoDataset(): @@ -173,3 +178,44 @@ assert_equal(apcos.particle_type_counts, {'CenOstriker': 899755, 'DarkMatter': 32768}) + +@requires_file(mhdctot) +def test_face_centered_mhdct_fields(): + ds = data_dir_load(mhdctot) + + ad = ds.all_data() + grid = ds.index.grids[0] + + for field, flag in NODAL_FLAGS.items(): + dims = ds.domain_dimensions + assert_equal(ad[field].shape, (dims.prod(), 2*sum(flag))) + assert_equal(grid[field].shape, tuple(dims) + (2*sum(flag),)) + + # Average of face-centered fields should be the same as cell-centered field + assert (ad['BxF'].sum(axis=-1)/2 == ad['Bx']).all() + assert (ad['ByF'].sum(axis=-1)/2 == ad['By']).all() + assert (ad['BzF'].sum(axis=-1)/2 == ad['Bz']).all() + +@requires_file(dnz) +def test_deeply_nested_zoom(): + ds = data_dir_load(dnz) + + # carefully chosen to just barely miss a grid in the middle of the image + center = [0.4915073260199302, 0.5052605316800006, 0.4905805557500548] + + plot = SlicePlot(ds, 'z', 'density', width=(0.001, 'pc'), + center=center) + + image = plot.frb['density'] + + assert (image > 0).all() + + v, c = ds.find_max('density') + + assert_allclose_units(v, ds.quan(0.005879315652144976, 'g/cm**3')) + + c_actual = [0.49150732540021, 0.505260532936791, 0.49058055816398] + c_actual = ds.arr(c_actual, 'code_length') + assert_allclose_units(c, c_actual) + + assert_equal(max([g['density'].max() for g in ds.index.grids]), v) diff -Nru yt-3.3.3/yt/frontends/enzo_p/api.py yt-3.4.0/yt/frontends/enzo_p/api.py --- yt-3.3.3/yt/frontends/enzo_p/api.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/enzo_p/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,28 @@ +""" +API for yt.frontends.enzo_p + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from .data_structures import \ + EnzoPGrid, \ + EnzoPHierarchy, \ + EnzoPDataset + +from .fields import \ + EnzoPFieldInfo +add_enzop_field = EnzoPFieldInfo.add_field + +from .io import \ + EnzoPIOHandler + +from . import tests diff -Nru yt-3.3.3/yt/frontends/enzo_p/data_structures.py yt-3.4.0/yt/frontends/enzo_p/data_structures.py --- yt-3.3.3/yt/frontends/enzo_p/data_structures.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/enzo_p/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,351 @@ +""" +Data structures for Enzo-P + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from yt.utilities.on_demand_imports import \ + _h5py as h5py +import numpy as np +import os +import stat + +from yt.data_objects.grid_patch import \ + AMRGridPatch +from yt.data_objects.static_output import \ + Dataset +from yt.fields.field_info_container import \ + NullFunc +from yt.funcs import \ + ensure_tuple, \ + get_pbar, \ + setdefaultattr +from yt.geometry.grid_geometry_handler import \ + GridIndex +from yt.utilities.logger import \ + ytLogger as mylog + +from yt.frontends.enzo_p.fields import \ + EnzoPFieldInfo +from yt.frontends.enzo_p.misc import \ + get_block_info, \ + get_child_index, \ + get_root_blocks, \ + get_root_block_id, \ + is_parent + +class EnzoPGrid(AMRGridPatch): + """ + Class representing a single EnzoP Grid instance. + """ + + _id_offset = 0 + _refine_by = 2 + + def __init__(self, id, index, block_name, filename = None): + """ + Returns an instance of EnzoPGrid with *id*, associated with + *filename* and *index*. + """ + # All of the field parameters will be passed to us as needed. + AMRGridPatch.__init__(self, id, filename=filename, index=index) + self.block_name = block_name + self._children_ids = None + self._parent_id = -1 + self.Level = -1 + + def __repr__(self): + return "EnzoPGrid_%04d" % self.id + + def get_parent_id(self, desc_block_name): + if self.block_name == desc_block_name: + raise RuntimeError("Child and parent are the same!") + dim = self.ds.dimensionality + d_block = desc_block_name[1:].replace(":", "") + parent = self + + while True: + a_block = parent.block_name[1:].replace(":", "") + gengap = (len(d_block) - len(a_block)) / dim + if gengap <= 1: + return parent.id + cid = get_child_index(a_block, d_block) + parent = self.index.grids[parent._children_ids[cid]] + + def add_child(self, child): + if self._children_ids is None: + self._children_ids = \ + -1*np.ones(self._refine_by**self.ds.dimensionality, + dtype=np.int64) + + a_block = self.block_name[1:].replace(":", "") + d_block = child.block_name[1:].replace(":", "") + cid = get_child_index(a_block, d_block) + self._children_ids[cid] = child.id + + @property + def Parent(self): + if self._parent_id == -1: return None + return self.index.grids[self._parent_id] + + @property + def Children(self): + if self._children_ids is None: + return [] + return [self.index.grids[cid] + for cid in self._children_ids] + +class EnzoPHierarchy(GridIndex): + + _strip_path = False + grid = EnzoPGrid + _preload_implemented = True + + def __init__(self, ds, dataset_type): + + self.dataset_type = dataset_type + self.directory = os.path.dirname(ds.parameter_filename) + self.index_filename = ds.parameter_filename + if os.path.getsize(self.index_filename) == 0: + raise IOError(-1,"File empty", self.index_filename) + + GridIndex.__init__(self, ds, dataset_type) + self.dataset.dataset_type = self.dataset_type + + def _count_grids(self): + fblock_size = 32768 + f = open(self.ds.parameter_filename, "r") + f.seek(0, 2) + file_size = f.tell() + nblocks = np.ceil(float(file_size) / + fblock_size).astype(np.int64) + f.seek(0) + offset = f.tell() + ngrids = 0 + for ib in range(nblocks): + my_block = min(fblock_size, file_size - offset) + buff = f.read(my_block) + ngrids += buff.count("\n") + offset += my_block + f.close() + self.num_grids = ngrids + self.dataset_type = "enzo_p" + + def _parse_index(self): + self.grids = np.empty(self.num_grids, dtype='object') + + pbar = get_pbar("Parsing Hierarchy ", self.num_grids) + f = open(self.ds.parameter_filename, "r") + fblock_size = 32768 + f.seek(0, 2) + file_size = f.tell() + nblocks = np.ceil(float(file_size) / + fblock_size).astype(np.int64) + f.seek(0) + offset = f.tell() + lstr = "" + # place child blocks after the root blocks + rbdim = self.ds.root_block_dimensions + nroot_blocks = rbdim.prod() + child_id = nroot_blocks + + last_pid = None + for ib in range(nblocks): + fblock = min(fblock_size, file_size - offset) + buff = lstr + f.read(fblock) + bnl = 0 + for inl in range(buff.count("\n")): + nnl = buff.find("\n", bnl) + line = buff[bnl:nnl] + block_name, block_file = line.split() + level, left, right = get_block_info(block_name) + + rbindex = get_root_block_id(block_name) + rbid = rbindex[0] * rbdim[1:].prod() + \ + rbindex[1] * rbdim[2:].prod() + rbindex[2] + if level == 0: + grid_id = rbid + parent_id = -1 + else: + grid_id = child_id + # Try the last parent_id first + if last_pid is not None and \ + is_parent(self.grids[last_pid].block_name, block_name): + parent_id = last_pid + else: + parent_id = self.grids[rbid].get_parent_id(block_name) + last_pid = parent_id + child_id += 1 + + my_grid = self.grid( + grid_id, self, block_name, + filename=os.path.join(self.directory, block_file)) + my_grid.Level = level + my_grid._parent_id = parent_id + + self.grids[grid_id] = my_grid + self.grid_levels[grid_id] = level + self.grid_left_edge[grid_id] = left + self.grid_right_edge[grid_id] = right + self.grid_dimensions[grid_id] = self.ds.active_grid_dimensions + + if level > 0: + self.grids[parent_id].add_child(my_grid) + + bnl = nnl + 1 + pbar.update(1) + lstr = buff[bnl:] + offset += fblock + + f.close() + pbar.finish() + + slope = self.ds.domain_width / \ + self.ds.arr(np.ones(3), "code_length") + self.grid_left_edge = self.grid_left_edge * slope + \ + self.ds.domain_left_edge + self.grid_right_edge = self.grid_right_edge * slope + \ + self.ds.domain_left_edge + + def _populate_grid_objects(self): + for g in self.grids: + g._prepare_grid() + g._setup_dx() + self.max_level = self.grid_levels.max() + + def _setup_derived_fields(self): + super(EnzoPHierarchy, self)._setup_derived_fields() + for fname, field in self.ds.field_info.items(): + if not field.particle_type: continue + if isinstance(fname, tuple): continue + if field._function is NullFunc: continue + + def _detect_output_fields(self): + self.field_list = [] + # Do this only on the root processor to save disk work. + if self.comm.rank in (0, None): + # Just check the first grid. + grid = self.grids[0] + field_list = self.io._read_field_names(grid) + mylog.debug("Grid %s has: %s", grid.id, field_list) + ptypes = self.dataset.particle_types + ptypes_raw = self.dataset.particle_types_raw + else: + field_list = None + ptypes = None + ptypes_raw = None + self.field_list = list(self.comm.mpi_bcast(field_list)) + self.dataset.particle_types = list(self.comm.mpi_bcast(ptypes)) + self.dataset.particle_types_raw = list(self.comm.mpi_bcast(ptypes_raw)) + +class EnzoPDataset(Dataset): + """ + Enzo-P-specific output, set at a fixed time. + """ + _index_class = EnzoPHierarchy + _field_info_class = EnzoPFieldInfo + + def __init__(self, filename, dataset_type=None, + file_style = None, + parameter_override = None, + conversion_override = None, + storage_filename = None, + units_override=None, + unit_system="cgs"): + """ + This class is a stripped down class that simply reads and parses + *filename* without looking at the index. *dataset_type* gets passed + to the index to pre-determine the style of data-output. However, + it is not strictly necessary. Optionally you may specify a + *parameter_override* dictionary that will override anything in the + paarmeter file and a *conversion_override* dictionary that consists + of {fieldname : conversion_to_cgs} that will override the #DataCGS. + """ + self.fluid_types += ("enzop",) + if parameter_override is None: parameter_override = {} + self._parameter_override = parameter_override + if conversion_override is None: conversion_override = {} + self._conversion_override = conversion_override + self.storage_filename = storage_filename + Dataset.__init__(self, filename, dataset_type, file_style=file_style, + units_override=units_override, unit_system=unit_system) + + def _parse_parameter_file(self): + """ + Parses the parameter file and establishes the various + dictionaries. + """ + + f = open(self.parameter_filename, "r") + # get dimension from first block name + b0, fn0 = f.readline().strip().split() + level0, left0, right0 = get_block_info(b0, min_dim=0) + root_blocks = get_root_blocks(b0) + f.close() + self.dimensionality = left0.size + self.periodicity = \ + ensure_tuple(np.ones(self.dimensionality, dtype=bool)) + + fh = h5py.File(os.path.join(self.directory, fn0), "r") + self.domain_left_edge = fh.attrs["lower"] + self.domain_right_edge = fh.attrs["upper"] + + # all blocks are the same size + ablock = fh[list(fh.keys())[0]] + self.current_time = ablock.attrs["time"][0] + gsi = ablock.attrs["enzo_GridStartIndex"] + gei = ablock.attrs["enzo_GridEndIndex"] + self.ghost_zones = gsi[0] + self.root_block_dimensions = root_blocks + self.active_grid_dimensions = gei - gsi + 1 + self.grid_dimensions = ablock.attrs["enzo_GridDimension"] + self.domain_dimensions = root_blocks * self.active_grid_dimensions + fh.close() + + self.periodicity += (False, ) * (3 - self.dimensionality) + + # WIP hard-coded for now + self.refine_by = 2 + self.cosmological_simulation = 0 + self.gamma = 5. / 3. + self.particle_types = () + self.particle_types_raw = self.particle_types + self.unique_identifier = \ + str(int(os.stat(self.parameter_filename)[stat.ST_CTIME])) + + def _set_code_unit_attributes(self): + setdefaultattr(self, 'length_unit', self.quan(1, "cm")) + setdefaultattr(self, 'mass_unit', self.quan(1, "g")) + setdefaultattr(self, 'time_unit', self.quan(1, "s")) + setdefaultattr(self, 'velocity_unit', + self.length_unit / self.time_unit) + magnetic_unit = np.sqrt(4*np.pi * self.mass_unit / + (self.time_unit**2 * self.length_unit)) + magnetic_unit = np.float64(magnetic_unit.in_cgs()) + setdefaultattr(self, 'magnetic_unit', + self.quan(magnetic_unit, "gauss")) + + @classmethod + def _is_valid(cls, *args, **kwargs): + fn = args[0] + ddir = os.path.dirname(fn) + if not fn.endswith(".block_list"): + return False + try: + with open(fn, "r") as f: + block, block_file = f.readline().strip().split() + get_block_info(block) + if not os.path.exists(os.path.join(ddir, block_file)): + return False + except Exception: + return False + return True diff -Nru yt-3.3.3/yt/frontends/enzo_p/definitions.py yt-3.4.0/yt/frontends/enzo_p/definitions.py --- yt-3.3.3/yt/frontends/enzo_p/definitions.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/enzo_p/definitions.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,15 @@ +""" +Definitions specific to Enzo-P + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + diff -Nru yt-3.3.3/yt/frontends/enzo_p/fields.py yt-3.4.0/yt/frontends/enzo_p/fields.py --- yt-3.3.3/yt/frontends/enzo_p/fields.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/enzo_p/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,52 @@ +""" +Fields specific to Enzo-P + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from yt.fields.field_info_container import \ + FieldInfoContainer + +rho_units = "code_mass / code_length**3" +vel_units = "code_velocity" +acc_units = "code_velocity / code_time" +energy_units = "code_velocity**2" + +known_species_names = { +} + +class EnzoPFieldInfo(FieldInfoContainer): + known_other_fields = ( + ("velocity_x", (vel_units, ["velocity_x"], None)), + ("velocity_y", (vel_units, ["velocity_y"], None)), + ("velocity_z", (vel_units, ["velocity_z"], None)), + ("acceleration_x", (acc_units, ["acceleration_x"], None)), + ("acceleration_y", (acc_units, ["acceleration_y"], None)), + ("acceleration_z", (acc_units, ["acceleration_z"], None)), + ("density", (rho_units, ["density"], None)), + ("total_density", (rho_units, ["total_density"], None)), + ("total_energy", (energy_units, ["total_energy"], None)), + ("internal_energy", (energy_units, ["internal_energy"], None)), + ) + + known_particle_fields = ( + ("x", ("code_length", [], None)), + ("y", ("code_length", [], None)), + ("z", ("code_length", [], None)), + ("vx", (vel_units, [], None)), + ("vy", (vel_units, [], None)), + ("vz", (vel_units, [], None)), + ("ax", (acc_units, [], None)), + ("ay", (acc_units, [], None)), + ("az", (acc_units, [], None)), + ("mass", ("code_mass", [], None)), + ) diff -Nru yt-3.3.3/yt/frontends/enzo_p/io.py yt-3.4.0/yt/frontends/enzo_p/io.py --- yt-3.3.3/yt/frontends/enzo_p/io.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/enzo_p/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,158 @@ +""" +Enzo-P-specific IO functions + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from yt.utilities.exceptions import \ + YTException +from yt.utilities.io_handler import \ + BaseIOHandler +from yt.extern.six import b, iteritems +from yt.utilities.on_demand_imports import _h5py as h5py +import numpy as np + + +_convert_mass = ("particle_mass","mass") + +_particle_position_names = {} + +class EnzoPIOHandler(BaseIOHandler): + + _dataset_type = "enzo_p" + _base = slice(None) + _field_dtype = "float64" + + def __init__(self, *args, **kwargs): + super(EnzoPIOHandler, self).__init__(*args, **kwargs) + self._base = self.ds.dimensionality * \ + (slice(self.ds.ghost_zones, + -self.ds.ghost_zones),) + + def _read_field_names(self, grid): + if grid.filename is None: return [] + f = h5py.File(grid.filename, "r") + try: + group = f[grid.block_name] + except KeyError: + raise YTException( + message="Grid %s is missing from data file %s." % + (grid.block_name, grid.filename), ds=self.ds) + fields = [] + dtypes = set([]) + for name, v in iteritems(group): + if not hasattr(v, "shape") or v.dtype == "O": + continue + # mesh fields are "field " + if name.startswith("field"): + dummy, fname = name.split(" ", 1) + fields.append(("enzop", fname)) + dtypes.add(v.dtype) + # particle fields are "particle " + else: + dummy, ftype, fname = name.split(" ", 2) + fields.append((ftype, fname)) + + if len(dtypes) == 1: + # Now, if everything we saw was the same dtype, we can go ahead and + # set it here. We do this because it is a HUGE savings for 32 bit + # floats, since our numpy copying/casting is way faster than + # h5py's, for some reason I don't understand. This does *not* need + # to be correct -- it will get fixed later -- it just needs to be + # okay for now. + self._field_dtype = list(dtypes)[0] + f.close() + return fields + + def _read_particle_coords(self, chunks, ptf): + for rv in self._read_particle_fields(chunks, ptf, None): + yield rv + + def _read_particle_fields(self, chunks, ptf, selector): + chunks = list(chunks) + for chunk in chunks: # These should be organized by grid filename + f = None + for g in chunk.objs: + if g.filename is None: continue + if f is None: + f = h5py.File(g.filename, "r") + nap = sum(g.NumberOfActiveParticles.values()) + if g.NumberOfParticles == 0 and nap == 0: + continue + ds = f.get(g.block_name) + for ptype, field_list in sorted(ptf.items()): + if ptype != "io": + if g.NumberOfActiveParticles[ptype] == 0: continue + pds = ds.get("Particles/%s" % ptype) + else: + pds = ds + pn = _particle_position_names.get(ptype, + r"particle_position_%s") + x, y, z = (np.asarray(pds.get(pn % ax).value, dtype="=f8") + for ax in 'xyz') + if selector is None: + # This only ever happens if the call is made from + # _read_particle_coords. + yield ptype, (x, y, z) + continue + mask = selector.select_points(x, y, z, 0.0) + if mask is None: continue + for field in field_list: + data = np.asarray(pds.get(field).value, "=f8") + if field in _convert_mass: + data *= g.dds.prod(dtype="f8") + yield (ptype, field), data[mask] + if f: f.close() + + def io_iter(self, chunks, fields): + for chunk in chunks: + fid = None + filename = -1 + for obj in chunk.objs: + if obj.filename is None: continue + if obj.filename != filename: + # Note one really important thing here: even if we do + # implement LRU caching in the _read_obj_field function, + # we'll still be doing file opening and whatnot. This is a + # problem, but one we can return to. + if fid is not None: + fid.close() + fid = h5py.h5f.open(b(obj.filename), h5py.h5f.ACC_RDONLY) + filename = obj.filename + for field in fields: + data = None + yield field, obj, self._read_obj_field( + obj, field, (fid, data)) + if fid is not None: + fid.close() + + def _read_obj_field(self, obj, field, fid_data): + if fid_data is None: fid_data = (None, None) + fid, data = fid_data + if fid is None: + close = True + fid = h5py.h5f.open(b(obj.filename), h5py.h5f.ACC_RDONLY) + else: + close = False + ftype, fname = field + node = "/%s/field %s" % (obj.block_name, fname) + dg = h5py.h5d.open(fid, b(node)) + rdata = np.empty(self.ds.grid_dimensions[:self.ds.dimensionality], + dtype=self._field_dtype) + dg.read(h5py.h5s.ALL, h5py.h5s.ALL, rdata) + if close: + fid.close() + data = rdata[self._base].T + if self.ds.dimensionality < 3: + nshape = data.shape + (1,)*(3 - self.ds.dimensionality) + data = np.reshape(data, nshape) + return data diff -Nru yt-3.3.3/yt/frontends/enzo_p/misc.py yt-3.4.0/yt/frontends/enzo_p/misc.py --- yt-3.3.3/yt/frontends/enzo_p/misc.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/enzo_p/misc.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,77 @@ +""" +Miscellaneous functions that are Enzo-P-specific + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import numpy as np + +def bdecode(block): + if ":" in block: + level = len(block) - block.find(":") - 1 + else: + level = 0 + bst = block.replace(":", "") + d = float(2**len(bst)) + left = int(bst, 2) + right = left + 1 + left /= d + right /= d + return level, left, right + +def get_block_info(block, min_dim=3): + mybs = block[1:].split("_") + dim = max(len(mybs), min_dim) + left = np.zeros(dim) + right = np.ones(dim) + for i, myb in enumerate(mybs): + level, left[i], right[i] = bdecode(myb) + return level, left, right + +def get_root_blocks(block, min_dim=3): + mybs = block[1:].split("_") + dim = max(len(mybs), min_dim) + nb = np.ones(dim, dtype=int) + for i, myb in enumerate(mybs): + if ":" in myb: + s = myb.find(":") + else: + s = len(myb) + nb[i] = 2**s + return nb + +def get_root_block_id(block, min_dim=3): + mybs = block[1:].split("_") + dim = max(len(mybs), min_dim) + rbid = np.zeros(dim, dtype=int) + for i, myb in enumerate(mybs): + if ":" in myb: + s = myb.find(":") + else: + s = len(myb) + rbid[i] = int(myb[:s], 2) + return rbid + +def get_child_index(anc_id, desc_id): + cid = "" + for aind, dind in zip( anc_id.split("_"), + desc_id.split("_")): + cid += dind[len(aind)] + cid = int(cid, 2) + return cid + +def is_parent(anc_block, desc_block): + for aind, dind in zip( anc_block.split("_"), + desc_block.split("_")): + if not dind.startswith(aind): + return False + return True diff -Nru yt-3.3.3/yt/frontends/enzo_p/tests/test_outputs.py yt-3.4.0/yt/frontends/enzo_p/tests/test_outputs.py --- yt-3.3.3/yt/frontends/enzo_p/tests/test_outputs.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/enzo_p/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,75 @@ +""" +Enzo-P frontend tests + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from yt.utilities.on_demand_imports import \ + _h5py as h5py + +from yt.testing import \ + assert_equal, \ + requires_file, \ + assert_array_equal +from yt.utilities.answer_testing.framework import \ + create_obj, \ + data_dir_load, \ + requires_ds, \ + PixelizedProjectionValuesTest, \ + FieldValuesTest +from yt.frontends.enzo_p.api import EnzoPDataset + +_fields = ("density", "total_energy", + "velocity_x", "velocity_y") + +hello_world = "hello-0200/hello-0200.block_list" + + +@requires_file(hello_world) +def test_EnzoPDataset(): + assert isinstance(data_dir_load(hello_world), EnzoPDataset) + +@requires_ds(hello_world) +def test_hello_world(): + ds = data_dir_load(hello_world) + + dso = [ None, ("sphere", ("max", (0.25, 'unitary')))] + for dobj_name in dso: + for field in _fields: + for axis in [0, 1, 2]: + for weight_field in [None, "density"]: + yield PixelizedProjectionValuesTest( + hello_world, axis, field, weight_field, + dobj_name) + yield FieldValuesTest(hello_world, field, dobj_name) + dobj = create_obj(ds, dobj_name) + s1 = dobj["ones"].sum() + s2 = sum(mask.sum() for block, mask in dobj.blocks) + assert_equal(s1, s2) + +@requires_file(hello_world) +def test_hierarchy(): + ds = data_dir_load(hello_world) + + fh = h5py.File(ds.index.grids[0].filename, "r") + for grid in ds.index.grids: + assert_array_equal( + grid.LeftEdge.d, fh[grid.block_name].attrs["enzo_GridLeftEdge"]) + assert_array_equal( + ds.index.grid_left_edge[grid.id], grid.LeftEdge) + assert_array_equal( + ds.index.grid_right_edge[grid.id], grid.RightEdge) + for child in grid.Children: + assert (child.LeftEdge >= grid.LeftEdge).all() + assert (child.RightEdge <= grid.RightEdge).all() + assert_equal(child.Parent.id, grid.id) + fh.close() diff -Nru yt-3.3.3/yt/frontends/exodus_ii/data_structures.py yt-3.4.0/yt/frontends/exodus_ii/data_structures.py --- yt-3.3.3/yt/frontends/exodus_ii/data_structures.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/exodus_ii/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -22,13 +22,17 @@ UnstructuredMesh from yt.data_objects.static_output import \ Dataset -from .io import \ - NetCDF4FileHandler +from yt.data_objects.unions import MeshUnion +from yt.utilities.file_handler import \ + NetCDF4FileHandler, \ + warn_netcdf from yt.utilities.logger import ytLogger as mylog from .fields import \ ExodusIIFieldInfo from .util import \ - load_info_records, sanitize_string + load_info_records, \ + sanitize_string, \ + get_num_pseudo_dims class ExodusIIUnstructuredMesh(UnstructuredMesh): @@ -48,12 +52,13 @@ self.meshes = [] for mesh_id, conn_ind in enumerate(connectivity): displaced_coords = self.ds._apply_displacement(coords, mesh_id) - mesh = ExodusIIUnstructuredMesh(mesh_id, + mesh = ExodusIIUnstructuredMesh(mesh_id, self.index_filename, - conn_ind, - displaced_coords, + conn_ind, + displaced_coords, self) self.meshes.append(mesh) + self.mesh_union = MeshUnion("mesh_union", self.meshes) def _detect_output_fields(self): elem_names = self.dataset.parameters['elem_names'] @@ -62,6 +67,7 @@ self.field_list = [] for i in range(1, len(self.meshes)+1): self.field_list += [('connect%d' % i, fname) for fname in fnames] + self.field_list += [('all', fname) for fname in fnames] class ExodusIIDataset(Dataset): @@ -77,7 +83,7 @@ units_override=None): """ - A class used to represent an on-disk ExodusII dataset. The initializer takes + A class used to represent an on-disk ExodusII dataset. The initializer takes two extra optional parameters, "step" and "displacements." Parameters @@ -86,25 +92,25 @@ step : integer The step tells which time index to slice at. It throws an Error if the index is larger than the number of time outputs in the ExodusII - file. Passing step=-1 picks out the last dataframe. + file. Passing step=-1 picks out the last dataframe. Default is 0. displacements : dictionary of tuples This is a dictionary that controls whether or not displacement fields will be used with the meshes in this dataset. The keys of the - displacements dictionary should the names of meshes in the file - (e.g., "connect1", "connect2", etc... ), while the values should be + displacements dictionary should the names of meshes in the file + (e.g., "connect1", "connect2", etc... ), while the values should be tuples of the form (scale, offset), where "scale" is a floating point value and "offset" is an array-like with one component for each spatial dimension in the dataset. When the displacements for a given mesh are turned on, the coordinates of the vertices in that mesh get transformed - as: + as: vertex_x = vertex_x + disp_x*scale + offset_x vertex_y = vertex_y + disp_y*scale + offset_y vertex_z = vertex_z + disp_z*scale + offset_z - If no displacement + If no displacement fields (assumed to be named 'disp_x', 'disp_y', etc... ) are detected in the output file, then this dictionary is ignored. @@ -121,7 +127,7 @@ >>> import yt >>> ds = yt.load("MOOSE_sample_data/mps_out.e", step=-1) - This will load the Dataset at index 10, turning on displacement fields for + This will load the Dataset at index 10, turning on displacement fields for the 2nd mesh without applying any scale or offset: >>> import yt @@ -134,9 +140,9 @@ >>> import yt >>> ds = yt.load("MOOSE_sample_data/mps_out.e", step=10, displacements={'connect2': (1.0, [0.0, 0.0, 0.0])}) - + This will load the Dataset at index 10, scaling the displacements for - the 2nd mesh by a factor of 5.0 and shifting all the vertices in + the 2nd mesh by a factor of 5.0 and shifting all the vertices in the first mesh by 1.0 unit in the z direction. >>> import yt @@ -156,7 +162,7 @@ units_override=units_override) self.index_filename = filename self.storage_filename = storage_filename - self.default_field = [f for f in self.field_list + self.default_field = [f for f in self.field_list if f[0] == 'connect1'][-1] def _set_code_unit_attributes(self): @@ -175,24 +181,18 @@ def _parse_parameter_file(self): self._handle = NetCDF4FileHandler(self.parameter_filename) - self._vars = self._handle.dataset.variables - self._read_glo_var() - self.dimensionality = self._vars['coor_names'].shape[0] - self.parameters['info_records'] = self._load_info_records() - self.unique_identifier = self._get_unique_identifier() - self.num_steps = len(self._vars['time_whole']) - self.current_time = self._get_current_time() - self.parameters['num_meshes'] = self._vars['eb_status'].shape[0] - self.parameters['elem_names'] = self._get_elem_names() - self.parameters['nod_names'] = self._get_nod_names() - self.domain_left_edge, self.domain_right_edge = self._load_domain_edge() - - # set up psuedo-3D for lodim datasets here - if self.dimensionality == 2: - self.domain_left_edge = np.append(self.domain_left_edge, 0.0) - self.domain_right_edge = np.append(self.domain_right_edge, 1.0) - - self.periodicity = (False, False, False) + with self._handle.open_ds() as ds: + self._read_glo_var() + self.dimensionality = ds.variables['coor_names'].shape[0] + self.parameters['info_records'] = self._load_info_records() + self.unique_identifier = self._get_unique_identifier() + self.num_steps = len(ds.variables['time_whole']) + self.current_time = self._get_current_time() + self.parameters['num_meshes'] = ds.variables['eb_status'].shape[0] + self.parameters['elem_names'] = self._get_elem_names() + self.parameters['nod_names'] = self._get_nod_names() + self.domain_left_edge, self.domain_right_edge = self._load_domain_edge() + self.periodicity = (False, False, False) # These attributes don't really make sense for unstructured # mesh data, but yt warns if they are not present, so we set @@ -206,17 +206,18 @@ self.refine_by = 0 def _get_fluid_types(self): - handle = NetCDF4FileHandler(self.parameter_filename).dataset - fluid_types = () - i = 1 - while True: - ftype = 'connect%d' % i - if ftype in handle.variables: - fluid_types += (ftype,) - i += 1 - else: - break - return fluid_types + with NetCDF4FileHandler(self.parameter_filename).open_ds() as ds: + fluid_types = () + i = 1 + while True: + ftype = 'connect%d' % i + if ftype in ds.variables: + fluid_types += (ftype,) + i += 1 + else: + break + fluid_types += ('all',) + return fluid_types def _read_glo_var(self): """ @@ -226,31 +227,34 @@ names = self._get_glo_names() if not names: return - values = self._vars['vals_glo_var'][:].transpose() - for name, value in zip(names, values): - self.parameters[name] = value + with self._handle.open_ds() as ds: + values = ds.variables['vals_glo_var'][:].transpose() + for name, value in zip(names, values): + self.parameters[name] = value def _load_info_records(self): """ Returns parsed version of the info_records. """ - try: - return load_info_records(self._vars['info_records']) - except (KeyError, TypeError): - mylog.warning("No info_records found") - return [] + with self._handle.open_ds() as ds: + try: + return load_info_records(ds.variables['info_records']) + except (KeyError, TypeError): + mylog.warning("No info_records found") + return [] def _get_unique_identifier(self): return self.parameter_filename def _get_current_time(self): - try: - return self._vars['time_whole'][self.step] - except IndexError: - raise RuntimeError("Invalid step number, max is %d" \ - % (self.num_steps - 1)) - except (KeyError, TypeError): - return 0.0 + with self._handle.open_ds() as ds: + try: + return ds.variables['time_whole'][self.step] + except IndexError: + raise RuntimeError("Invalid step number, max is %d" \ + % (self.num_steps - 1)) + except (KeyError, TypeError): + return 0.0 def _get_glo_names(self): """ @@ -259,13 +263,14 @@ """ - if "name_glo_var" not in self._vars: - mylog.warning("name_glo_var not found") - return [] - else: - return [sanitize_string(v.tostring()) for v in - self._vars["name_glo_var"]] - + with self._handle.open_ds() as ds: + if "name_glo_var" not in ds.variables: + mylog.warning("name_glo_var not found") + return [] + else: + return [sanitize_string(v.tostring()) for v in + ds.variables["name_glo_var"]] + def _get_elem_names(self): """ @@ -273,12 +278,13 @@ """ - if "name_elem_var" not in self._vars: - mylog.warning("name_elem_var not found") - return [] - else: - return [sanitize_string(v.tostring()) for v in - self._vars["name_elem_var"]] + with self._handle.open_ds() as ds: + if "name_elem_var" not in ds.variables: + mylog.warning("name_elem_var not found") + return [] + else: + return [sanitize_string(v.tostring()) for v in + ds.variables["name_elem_var"]] def _get_nod_names(self): """ @@ -287,12 +293,13 @@ """ - if "name_nod_var" not in self._vars: - mylog.warning("name_nod_var not found") - return [] - else: - return [sanitize_string(v.tostring()) for v in - self._vars["name_nod_var"]] + with self._handle.open_ds() as ds: + if "name_nod_var" not in ds.variables: + mylog.warning("name_nod_var not found") + return [] + else: + return [sanitize_string(v.tostring()) for v in + ds.variables["name_nod_var"]] def _read_coordinates(self): """ @@ -300,20 +307,21 @@ Loads the coordinates for the mesh """ - + coord_axes = 'xyz'[:self.dimensionality] mylog.info("Loading coordinates") - if "coord" not in self._vars: - coords = np.array([self._vars["coord%s" % ax][:] - for ax in coord_axes]).transpose().copy() - else: - coords = np.array([coord for coord in - self._vars["coord"][:]]).transpose().copy() - return coords + with self._handle.open_ds() as ds: + if "coord" not in ds.variables: + coords = np.array([ds.variables["coord%s" % ax][:] + for ax in coord_axes]).transpose().copy() + else: + coords = np.array([coord for coord in + ds.variables["coord"][:]]).transpose().copy() + return coords def _apply_displacement(self, coords, mesh_id): - + mesh_name = "connect%d" % (mesh_id + 1) if mesh_name not in self.displacements: new_coords = coords.copy() @@ -324,30 +332,32 @@ offset = self.displacements[mesh_name][1] coord_axes = 'xyz'[:self.dimensionality] - for i, ax in enumerate(coord_axes): - if "disp_%s" % ax in self.parameters['nod_names']: - ind = self.parameters['nod_names'].index("disp_%s" % ax) - disp = self._vars['vals_nod_var%d' % (ind + 1)][self.step] - new_coords[:, i] = coords[:, i] + fac*disp + offset[i] + with self._handle.open_ds() as ds: + for i, ax in enumerate(coord_axes): + if "disp_%s" % ax in self.parameters['nod_names']: + ind = self.parameters['nod_names'].index("disp_%s" % ax) + disp = ds.variables['vals_nod_var%d' % (ind + 1)][self.step] + new_coords[:, i] = coords[:, i] + fac*disp + offset[i] + + return new_coords - return new_coords - def _read_connectivity(self): """ Loads the connectivity data for the mesh """ mylog.info("Loading connectivity") connectivity = [] - for i in range(self.parameters['num_meshes']): - connectivity.append(self._vars["connect%d" % (i+1)][:].astype("i8")) - return connectivity + with self._handle.open_ds() as ds: + for i in range(self.parameters['num_meshes']): + connectivity.append(ds.variables["connect%d" % (i+1)][:].astype("i8")) + return connectivity def _load_domain_edge(self): """ Loads the boundaries for the domain edge """ - + coords = self._read_coordinates() connectivity = self._read_connectivity() @@ -362,10 +372,23 @@ width = ma - mi mi -= 0.1 * width ma += 0.1 * width + + # set up pseudo-3D for lodim datasets here + for _ in range(self.dimensionality, 3): + mi = np.append(mi, 0.0) + ma = np.append(ma, 1.0) + + num_pseudo_dims = get_num_pseudo_dims(coords) + self.dimensionality -= num_pseudo_dims + for i in range(self.dimensionality, 3): + mi[i] = 0.0 + ma[i] = 1.0 + return mi, ma @classmethod def _is_valid(self, *args, **kwargs): + warn_netcdf(args[0]) try: from netCDF4 import Dataset filename = args[0] diff -Nru yt-3.3.3/yt/frontends/exodus_ii/fields.py yt-3.4.0/yt/frontends/exodus_ii/fields.py --- yt-3.3.3/yt/frontends/exodus_ii/fields.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/exodus_ii/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -33,6 +33,8 @@ def __init__(self, ds, field_list): super(ExodusIIFieldInfo, self).__init__(ds, field_list) + for name in self: + self[name].take_log = False # If you want, you can check self.field_list def setup_fluid_fields(self): diff -Nru yt-3.3.3/yt/frontends/exodus_ii/io.py yt-3.4.0/yt/frontends/exodus_ii/io.py --- yt-3.3.3/yt/frontends/exodus_ii/io.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/exodus_ii/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -28,7 +28,7 @@ def __init__(self, ds): self.filename = ds.index_filename exodus_ii_handler = NetCDF4FileHandler(self.filename) - self.handler = exodus_ii_handler.dataset + self.handler = exodus_ii_handler super(IOHandlerExodusII, self).__init__(ds) self.node_fields = ds._get_nod_names() self.elem_fields = ds._get_elem_names() @@ -46,37 +46,47 @@ # dict gets returned at the end and it should be flat, with selected # data. Note that if you're reading grid data, you might need to # special-case a grid selector object. - chunks = list(chunks) - rv = {} - for field in fields: - ftype, fname = field - ci = self.handler.variables[ftype][:] - self._INDEX_OFFSET - num_elem = ci.shape[0] - if fname in self.node_fields: - nodes_per_element = ci.shape[1] - rv[field] = np.empty((num_elem, nodes_per_element), dtype="float64") - elif fname in self.elem_fields: - rv[field] = np.empty(num_elem, dtype="float64") - for field in fields: - ind = 0 - ftype, fname = field - mesh_id = int(ftype[-1]) - chunk = chunks[mesh_id - 1] - ci = self.handler.variables[ftype][:] - self._INDEX_OFFSET - if fname in self.node_fields: - field_ind = self.node_fields.index(fname) - fdata = self.handler.variables['vals_nod_var%d' % (field_ind + 1)] - data = fdata[self.ds.step][ci] - for g in chunk.objs: - ind += g.select(selector, data, rv[field], ind) # caches - if fname in self.elem_fields: - field_ind = self.elem_fields.index(fname) - fdata = self.handler.variables['vals_elem_var%deb%s' % - (field_ind + 1, mesh_id)][:] - data = fdata[self.ds.step, :] - for g in chunk.objs: - ind += g.select(selector, data, rv[field], ind) # caches - return rv + with self.handler.open_ds() as ds: + chunks = list(chunks) + rv = {} + for field in fields: + ftype, fname = field + if ftype == "all": + ci = np.concatenate([mesh.connectivity_indices - self._INDEX_OFFSET \ + for mesh in self.ds.index.mesh_union]) + else: + ci = ds.variables[ftype][:] - self._INDEX_OFFSET + num_elem = ci.shape[0] + if fname in self.node_fields: + nodes_per_element = ci.shape[1] + rv[field] = np.zeros((num_elem, nodes_per_element), dtype="float64") + elif fname in self.elem_fields: + rv[field] = np.zeros(num_elem, dtype="float64") + for field in fields: + ind = 0 + ftype, fname = field + if ftype == "all": + mesh_ids = [mesh.mesh_id + 1 for mesh in self.ds.index.mesh_union] + objs = [mesh for mesh in self.ds.index.mesh_union] + else: + mesh_ids = [int(ftype[-1])] + chunk = chunks[mesh_ids[0] - 1] + objs = chunk.objs + if fname in self.node_fields: + field_ind = self.node_fields.index(fname) + fdata = ds.variables['vals_nod_var%d' % (field_ind + 1)] + for g in objs: + ci = g.connectivity_indices - self._INDEX_OFFSET + data = fdata[self.ds.step][ci] + ind += g.select(selector, data, rv[field], ind) # caches + if fname in self.elem_fields: + field_ind = self.elem_fields.index(fname) + for g, mesh_id in zip(objs, mesh_ids): + fdata = ds.variables['vals_elem_var%deb%s' % + (field_ind + 1, mesh_id)][:] + data = fdata[self.ds.step, :] + ind += g.select(selector, data, rv[field], ind) # caches + return rv def _read_chunk_data(self, chunk, fields): # This reads the data from a single chunk, and is only used for diff -Nru yt-3.3.3/yt/frontends/exodus_ii/simulation_handling.py yt-3.4.0/yt/frontends/exodus_ii/simulation_handling.py --- yt-3.3.3/yt/frontends/exodus_ii/simulation_handling.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/exodus_ii/simulation_handling.py 2017-08-10 18:02:57.000000000 +0000 @@ -14,7 +14,6 @@ from yt.data_objects.time_series import \ DatasetSeries, \ RegisteredSimulationTimeSeries -from yt.frontends.exodus_ii.api import ExodusIIDataset @add_metaclass(RegisteredSimulationTimeSeries) @@ -45,6 +44,25 @@ self.all_outputs = self._check_for_outputs(potential_outputs) self.all_outputs.sort(key=lambda obj: obj["filename"]) + def __iter__(self): + for o in self._pre_outputs: + fn, step = o + ds = load(fn, step=step) + self._setup_function(ds) + yield ds + + def __getitem__(self, key): + if isinstance(key, slice): + if isinstance(key.start, float): + return self.get_range(key.start, key.stop) + # This will return a sliced up object! + return DatasetSeries(self._pre_outputs[key], self.parallel) + o = self._pre_outputs[key] + fn, step = o + o = load(fn, step=step) + self._setup_function(o) + return o + def get_time_series(self, parallel=False, setup_function=None): r""" Instantiate a DatasetSeries object for a set of outputs. @@ -55,15 +73,14 @@ Fine-level filtering is currently not implemented. """ - + all_outputs = self.all_outputs ds_list = [] for output in all_outputs: num_steps = output['num_steps'] fn = output['filename'] for step in range(num_steps): - ds = ExodusIIDataset(fn, step=step) - ds_list.append(ds) + ds_list.append((fn, step)) super(ExodusIISimulation, self).__init__(ds_list, parallel=parallel, setup_function=setup_function) diff -Nru yt-3.3.3/yt/frontends/exodus_ii/tests/test_outputs.py yt-3.4.0/yt/frontends/exodus_ii/tests/test_outputs.py --- yt-3.3.3/yt/frontends/exodus_ii/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/exodus_ii/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -29,7 +29,11 @@ @requires_file(out) def test_out(): ds = data_dir_load(out) - field_list = [('connect1', 'conv_indicator'), + field_list = [('all', 'conv_indicator'), + ('all', 'conv_marker'), + ('all', 'convected'), + ('all', 'diffused'), + ('connect1', 'conv_indicator'), ('connect1', 'conv_marker'), ('connect1', 'convected'), ('connect1', 'diffused'), @@ -37,12 +41,12 @@ ('connect2', 'conv_marker'), ('connect2', 'convected'), ('connect2', 'diffused')] - yield assert_equal, str(ds), "out.e" - yield assert_equal, ds.dimensionality, 3 - yield assert_equal, ds.current_time, 0.0 - yield assert_array_equal, ds.parameters['nod_names'], ['convected', 'diffused'] - yield assert_equal, ds.parameters['num_meshes'], 2 - yield assert_array_equal, ds.field_list, field_list + assert_equal(str(ds), "out.e") + assert_equal(ds.dimensionality, 3) + assert_equal(ds.current_time, 0.0) + assert_array_equal(ds.parameters['nod_names'], ['convected', 'diffused']) + assert_equal(ds.parameters['num_meshes'], 2) + assert_array_equal(ds.field_list, field_list) out_s002 = "ExodusII/out.e-s002" @@ -50,7 +54,11 @@ @requires_file(out_s002) def test_out002(): ds = data_dir_load(out_s002) - field_list = [('connect1', 'conv_indicator'), + field_list = [('all', 'conv_indicator'), + ('all', 'conv_marker'), + ('all', 'convected'), + ('all', 'diffused'), + ('connect1', 'conv_indicator'), ('connect1', 'conv_marker'), ('connect1', 'convected'), ('connect1', 'diffused'), @@ -58,10 +66,10 @@ ('connect2', 'conv_marker'), ('connect2', 'convected'), ('connect2', 'diffused')] - yield assert_equal, str(ds), "out.e-s002" - yield assert_equal, ds.dimensionality, 3 - yield assert_equal, ds.current_time, 2.0 - yield assert_array_equal, ds.field_list, field_list + assert_equal(str(ds), "out.e-s002") + assert_equal(ds.dimensionality, 3) + assert_equal(ds.current_time, 2.0) + assert_array_equal(ds.field_list, field_list) gold = "ExodusII/gold.e" @@ -69,9 +77,9 @@ @requires_file(gold) def test_gold(): ds = data_dir_load(gold) - field_list = [('connect1', 'forced')] - yield assert_equal, str(ds), "gold.e" - yield assert_array_equal, ds.field_list, field_list + field_list = [('all', 'forced'), ('connect1', 'forced')] + assert_equal(str(ds), "gold.e") + assert_array_equal(ds.field_list, field_list) big_data = "MOOSE_sample_data/mps_out.e" @@ -79,7 +87,7 @@ @requires_ds(big_data) def test_displacement_fields(): displacement_dicts =[{'connect2': (5.0, [0.0, 0.0, 0.0])}, - {'connect1': (1.0, [1.0, 2.0, 3.0]), + {'connect1': (1.0, [1.0, 2.0, 3.0]), 'connect2': (0.0, [0.0, 0.0, 0.0])}] for disp in displacement_dicts: ds = data_dir_load(big_data, displacements=disp) diff -Nru yt-3.3.3/yt/frontends/exodus_ii/util.py yt-3.4.0/yt/frontends/exodus_ii/util.py --- yt-3.3.3/yt/frontends/exodus_ii/util.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/exodus_ii/util.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,3 +1,4 @@ +import numpy as np import sys import string from itertools import takewhile @@ -6,6 +7,10 @@ _printable = set([ord(_) for _ in string.printable]) +def get_num_pseudo_dims(coords): + D = coords.shape[1] + return sum([np.all(coords[:, dim] == 0.0) for dim in range(D)]) + def sanitize_string(s): if sys.version_info > (3, ): return "".join([chr(_) for _ in takewhile(lambda a: a in _printable, s)]) diff -Nru yt-3.3.3/yt/frontends/fits/data_structures.py yt-3.4.0/yt/frontends/fits/data_structures.py --- yt-3.3.3/yt/frontends/fits/data_structures.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/fits/data_structures.py 2017-08-10 17:56:56.000000000 +0000 @@ -489,12 +489,15 @@ self.domain_dimensions = np.append(self.domain_dimensions, [int(1)]) - self.domain_left_edge = np.array([0.5]*3) - self.domain_right_edge = np.array([float(dim)+0.5 for dim in self.domain_dimensions]) + domain_left_edge = np.array([0.5]*3) + domain_right_edge = np.array([float(dim)+0.5 for dim in self.domain_dimensions]) if self.dimensionality == 2: - self.domain_left_edge[-1] = 0.5 - self.domain_right_edge[-1] = 1.5 + domain_left_edge[-1] = 0.5 + domain_right_edge[-1] = 1.5 + + self.domain_left_edge = domain_left_edge + self.domain_right_edge = domain_right_edge # Get the simulation time try: @@ -611,8 +614,10 @@ self.spectral_factor /= self.domain_dimensions[self.spec_axis] mylog.info("Setting the spectral factor to %f" % (self.spectral_factor)) Dz = self.domain_right_edge[self.spec_axis]-self.domain_left_edge[self.spec_axis] - self.domain_right_edge[self.spec_axis] = self.domain_left_edge[self.spec_axis] + \ - self.spectral_factor*Dz + dre = self.domain_right_edge + dre[self.spec_axis] = (self.domain_left_edge[self.spec_axis] + + self.spectral_factor*Dz) + self.domain_right_edge = dre self._dz /= self.spectral_factor self._p0 = (self._p0-0.5)*self.spectral_factor + 0.5 diff -Nru yt-3.3.3/yt/frontends/fits/fields.py yt-3.4.0/yt/frontends/fits/fields.py --- yt-3.3.3/yt/frontends/fits/fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/fits/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -37,14 +37,14 @@ unit = str(self.ds.wcs_2d.wcs.cunit[i]) if unit.lower() == "deg": unit = "degree" if unit.lower() == "rad": unit = "radian" - self.add_field(("fits",name), function=world_f(axis, unit), units=unit) + self.add_field(("fits",name), sampling_type="cell", function=world_f(axis, unit), units=unit) if self.ds.dimensionality == 3: def _spec(field, data): axis = "xyz"[data.ds.spec_axis] sp = (data[axis].ndarray_view()-self.ds._p0)*self.ds._dz + self.ds._z0 return data.ds.arr(sp, data.ds.spec_unit) - self.add_field(("fits","spectral"), function=_spec, + self.add_field(("fits","spectral"), sampling_type="cell", function=_spec, units=self.ds.spec_unit, display_name=self.ds.spec_name) def setup_fluid_fields(self): @@ -52,6 +52,6 @@ if self.ds.spec_cube: def _pixel(field, data): return data.ds.arr(data["ones"], "pixel") - self.add_field(("fits","pixel"), function=_pixel, units="pixel") + self.add_field(("fits","pixel"), sampling_type="cell", function=_pixel, units="pixel") self._setup_spec_cube_fields() return diff -Nru yt-3.3.3/yt/frontends/fits/misc.py yt-3.4.0/yt/frontends/fits/misc.py --- yt-3.3.3/yt/frontends/fits/misc.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/fits/misc.py 2017-08-10 18:02:57.000000000 +0000 @@ -17,7 +17,6 @@ from yt.funcs import mylog from yt.utilities.on_demand_imports import _astropy from yt.units.yt_array import YTQuantity, YTArray -from yt.utilities.fits_image import FITSImageData if PY3: from io import BytesIO as IO else: @@ -50,7 +49,7 @@ Parameters ---------- - ds : Dataset + ds : ~yt.data_objects.static_output.Dataset The FITS events file dataset to add the counts fields to. ebounds : list of tuples A list of tuples, one for each field, with (emin, emax) as the @@ -68,7 +67,7 @@ cfunc = _make_counts(emin, emax) fname = "counts_%s-%s" % (emin, emax) mylog.info("Creating counts field %s." % fname) - ds.add_field((ftype,fname), function=cfunc, + ds.add_field((ftype,fname), sampling_type="cell", function=cfunc, units="counts/pixel", validators = [ValidateSpatial()], display_name="Counts (%s-%s keV)" % (emin, emax)) @@ -109,6 +108,7 @@ ... nan_mask=0.0) """ from spectral_cube import SpectralCube + from yt.visualization.fits_image import FITSImageData from yt.frontends.fits.api import FITSDataset cube = SpectralCube.read(filename) if not isinstance(slab_width, YTQuantity): @@ -171,14 +171,18 @@ nx = ds.domain_dimensions[ds.lon_axis] ny = ds.domain_dimensions[ds.lat_axis] mask = filter.mask((ny,nx)).transpose() + if ds.events_data: + prefix = "event_" + else: + prefix = "" def _reg_field(field, data): - i = data["xyz"[ds.lon_axis]].ndarray_view().astype("int")-1 - j = data["xyz"[ds.lat_axis]].ndarray_view().astype("int")-1 + i = data[prefix+"xyz"[ds.lon_axis]].d.astype("int")-1 + j = data[prefix+"xyz"[ds.lat_axis]].d.astype("int")-1 new_mask = mask[i,j] - ret = data["zeros"].copy() + ret = np.zeros(data[prefix+"x"].shape) ret[new_mask] = 1. return ret - ds.add_field(("gas",reg_name), function=_reg_field) + ds.add_field(("gas", reg_name), sampling_type="cell", function=_reg_field) if obj is None: obj = ds.all_data() if field_parameters is not None: diff -Nru yt-3.3.3/yt/frontends/fits/tests/test_outputs.py yt-3.4.0/yt/frontends/fits/tests/test_outputs.py --- yt-3.3.3/yt/frontends/fits/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/fits/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -29,7 +29,7 @@ @requires_ds(grs) def test_grs(): ds = data_dir_load(grs, cls=FITSDataset, kwargs={"nan_mask":0.0}) - yield assert_equal, str(ds), "grs-50-cube.fits" + assert_equal(str(ds), "grs-50-cube.fits") for test in small_patch_amr(ds, _fields_grs, input_center="c", input_weight="ones"): test_grs.__name__ = test.description yield test @@ -40,15 +40,14 @@ @requires_ds(vf) def test_velocity_field(): ds = data_dir_load(vf, cls=FITSDataset) - yield assert_equal, str(ds), "velocity_field_20.fits" + assert_equal(str(ds), "velocity_field_20.fits") for test in small_patch_amr(ds, _fields_vels, input_center="c", input_weight="ones"): test_velocity_field.__name__ = test.description yield test @requires_file(vf) def test_units_override(): - for test in units_override_check(vf): - yield test + units_override_check(vf) @requires_file(grs) def test_FITSDataset(): diff -Nru yt-3.3.3/yt/frontends/flash/data_structures.py yt-3.4.0/yt/frontends/flash/data_structures.py --- yt-3.3.3/yt/frontends/flash/data_structures.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/flash/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -30,7 +30,8 @@ from yt.geometry.particle_geometry_handler import \ ParticleIndex from yt.utilities.file_handler import \ - HDF5FileHandler + HDF5FileHandler, \ + warn_h5py from yt.utilities.physical_ratios import cm_per_mpc from .fields import FLASHFieldInfo @@ -152,12 +153,6 @@ gre[:,2] = 2.0 * np.pi return - # Now, for cartesian data. - for i in range(self.num_grids): - dx = dxs[self.grid_levels[i],:] - gle[i][:ND] = np.rint(gle[i][:ND]/dx[0][:ND])*dx[0][:ND] - gre[i][:ND] = np.rint(gre[i][:ND]/dx[0][:ND])*dx[0][:ND] - def _populate_grid_objects(self): ii = np.argsort(self.grid_levels.flat) gid = self._handle["/gid"][:] @@ -377,28 +372,32 @@ if self.dimensionality == 1: nblocky = 1 # Determine domain boundaries - self.domain_left_edge = np.array( + dle = np.array( [self.parameters["%smin" % ax] for ax in 'xyz']).astype("float64") - self.domain_right_edge = np.array( + dre = np.array( [self.parameters["%smax" % ax] for ax in 'xyz']).astype("float64") if self.dimensionality < 3: for d in [dimensionality]+list(range(3-dimensionality)): - if self.domain_left_edge[d] == self.domain_right_edge[d]: - mylog.warning('Identical domain left edge and right edges ' - 'along dummy dimension (%i), attempting to read anyway' % d) - self.domain_right_edge[d] = self.domain_left_edge[d]+1.0 + if dle[d] == dre[d]: + mylog.warning( + 'Identical domain left edge and right edges ' + 'along dummy dimension (%i), attempting to read anyway' + % d) + dre[d] = dle[d]+1.0 if self.dimensionality < 3 and self.geometry == "cylindrical": mylog.warning("Extending theta dimension to 2PI + left edge.") - self.domain_right_edge[2] = self.domain_left_edge[2] + 2*np.pi + dre[2] = dle[2] + 2*np.pi elif self.dimensionality < 3 and self.geometry == "polar": mylog.warning("Extending theta dimension to 2PI + left edge.") - self.domain_right_edge[1] = self.domain_left_edge[1] + 2*np.pi + dre[1] = dle[1] + 2*np.pi elif self.dimensionality < 3 and self.geometry == "spherical": mylog.warning("Extending phi dimension to 2PI + left edge.") - self.domain_right_edge[2] = self.domain_left_edge[2] + 2*np.pi + dre[2] = dle[2] + 2*np.pi if self.dimensionality == 1 and self.geometry == "spherical": mylog.warning("Extending theta dimension to PI + left edge.") - self.domain_right_edge[1] = self.domain_left_edge[1] + np.pi + dre[1] = dle[1] + np.pi + self.domain_left_edge = dle + self.domain_right_edge = dre self.domain_dimensions = \ np.array([nblockx*nxb,nblocky*nyb,nblockz*nzb]) @@ -435,7 +434,7 @@ fileh = HDF5FileHandler(args[0]) if "bounding box" in fileh["/"].keys(): return True - except: + except (IOError, OSError, ImportError): pass return False @@ -485,12 +484,13 @@ @classmethod def _is_valid(self, *args, **kwargs): + warn_h5py(args[0]) try: fileh = HDF5FileHandler(args[0]) if "bounding box" not in fileh["/"].keys() \ and "localnp" in fileh["/"].keys(): return True - except IOError: + except (IOError, OSError, ImportError): pass return False diff -Nru yt-3.3.3/yt/frontends/flash/fields.py yt-3.4.0/yt/frontends/flash/fields.py --- yt-3.3.3/yt/frontends/flash/fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/flash/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -100,7 +100,7 @@ setup_magnetic_field_aliases unit_system = self.ds.unit_system for i in range(1, 1000): - self.add_output_field(("flash", "r{0:03}".format(i)), + self.add_output_field(("flash", "r{0:03}".format(i)), sampling_type="cell", units = "", display_name="Energy Group {0}".format(i)) # Add energy fields @@ -112,7 +112,7 @@ ek += data["flash","velz"]**2 return 0.5*ek if ("flash","ener") in self.field_list: - self.add_output_field(("flash","ener"), + self.add_output_field(("flash","ener"), sampling_type="cell", units="code_length**2/code_time**2") self.alias(("gas","total_energy"),("flash","ener"), units=unit_system["specific_energy"]) @@ -124,10 +124,10 @@ except: pass return ener - self.add_field(("gas","total_energy"), function=_ener, + self.add_field(("gas","total_energy"), sampling_type="cell", function=_ener, units=unit_system["specific_energy"]) if ("flash","eint") in self.field_list: - self.add_output_field(("flash","eint"), + self.add_output_field(("flash","eint"), sampling_type="cell", units="code_length**2/code_time**2") self.alias(("gas","thermal_energy"),("flash","eint"), units=unit_system["specific_energy"]) @@ -139,31 +139,29 @@ except: pass return eint - self.add_field(("gas","thermal_energy"), function=_eint, + self.add_field(("gas","thermal_energy"), sampling_type="cell", function=_eint, units=unit_system["specific_energy"]) ## Derived FLASH Fields def _nele(field, data): Na_code = data.ds.quan(Na, '1/code_mass') return data["flash","dens"]*data["flash","ye"]*Na_code - self.add_field(('flash','nele'), function=_nele, units="code_length**-3") - self.add_field(('flash','edens'), function=_nele, units="code_length**-3") + self.add_field(('flash','nele'), sampling_type="cell", function=_nele, units="code_length**-3") + self.add_field(('flash','edens'), sampling_type="cell", function=_nele, units="code_length**-3") def _nion(field, data): Na_code = data.ds.quan(Na, '1/code_mass') return data["flash","dens"]*data["flash","sumy"]*Na_code - self.add_field(('flash','nion'), function=_nion, units="code_length**-3") - + self.add_field(('flash','nion'), sampling_type="cell", function=_nion, units="code_length**-3") + if ("flash", "abar") in self.field_list: - self.add_output_field(("flash", "abar"), units="1") + self.add_output_field(("flash", "abar"), sampling_type="cell", units="1") else: def _abar(field, data): return 1.0 / data["flash","sumy"] - self.add_field(("flash","abar"), function=_abar, units="1") + self.add_field(("flash","abar"), sampling_type="cell", function=_abar, units="1") def _number_density(fields,data): return (data["nele"]+data["nion"]) - self.add_field(("gas","number_density"), function=_number_density, + self.add_field(("gas","number_density"), sampling_type="cell", function=_number_density, units=unit_system["number_density"]) setup_magnetic_field_aliases(self, "flash", ["mag%s" % ax for ax in "xyz"]) - - diff -Nru yt-3.3.3/yt/frontends/flash/io.py yt-3.4.0/yt/frontends/flash/io.py --- yt-3.3.3/yt/frontends/flash/io.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/flash/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -18,7 +18,6 @@ from yt.utilities.io_handler import \ BaseIOHandler -from yt.utilities.logger import ytLogger as mylog from yt.geometry.selection_routines import AlwaysSelector from yt.utilities.lib.geometry_utils import \ compute_morton @@ -61,6 +60,22 @@ count_list, conv_factors): pass + def io_iter(self, chunks, fields): + f = self._handle + for chunk in chunks: + for field in fields: + # Note that we *prefer* to iterate over the fields on the + # outside; here, though, we're iterating over them on the + # inside because we may exhaust our chunks. + ftype, fname = field + ds = f["/%s" % fname] + for gs in grid_sequences(chunk.objs): + start = gs[0].id - gs[0]._id_offset + end = gs[-1].id - gs[-1]._id_offset + 1 + data = ds[start:end,:,:,:] + for i, g in enumerate(gs): + yield field, g, self._read_obj_field(g, field, (data, i)) + def _read_particle_coords(self, chunks, ptf): chunks = list(chunks) f_part = self._particle_handle @@ -104,31 +119,18 @@ data = p_fields[start:end, fi] yield (ptype, field), data[mask] - def _read_fluid_selection(self, chunks, selector, fields, size): - chunks = list(chunks) - if any((ftype != "flash" for ftype, fname in fields)): - raise NotImplementedError - f = self._handle - rv = {} - for field in fields: - ftype, fname = field - # Always use *native* 64-bit float. - rv[field] = np.empty(size, dtype="=f8") - ng = sum(len(c.objs) for c in chunks) - mylog.debug("Reading %s cells of %s fields in %s blocks", - size, [f2 for f1, f2 in fields], ng) - for field in fields: - ftype, fname = field - ds = f["/%s" % fname] - ind = 0 - for chunk in chunks: - for gs in grid_sequences(chunk.objs): - start = gs[0].id - gs[0]._id_offset - end = gs[-1].id - gs[-1]._id_offset + 1 - data = ds[start:end,:,:,:].transpose() - for i, g in enumerate(gs): - ind += g.select(selector, data[...,i], rv[field], ind) - return rv + def _read_obj_field(self, obj, field, ds_offset = None): + if ds_offset is None: ds_offset = (None, -1) + ds, offset = ds_offset + # our context here includes datasets and whatnot that are opened in the + # hdf5 file + if ds is None: + ds = self._handle["/%s" % field[1]] + if offset == -1: + data = ds[obj.id - obj._id_offset, :,:,:].transpose() + else: + data = ds[offset, :,:,:].transpose() + return data def _read_chunk_data(self, chunk, fields): f = self._handle diff -Nru yt-3.3.3/yt/frontends/flash/tests/test_outputs.py yt-3.4.0/yt/frontends/flash/tests/test_outputs.py --- yt-3.3.3/yt/frontends/flash/tests/test_outputs.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/flash/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -33,7 +33,7 @@ @requires_ds(sloshing, big_data=True) def test_sloshing(): ds = data_dir_load(sloshing) - yield assert_equal, str(ds), "sloshing_low_res_hdf5_plt_cnt_0300" + assert_equal(str(ds), "sloshing_low_res_hdf5_plt_cnt_0300") for test in small_patch_amr(ds, _fields): test_sloshing.__name__ = test.description yield test @@ -44,7 +44,7 @@ @requires_ds(wt) def test_wind_tunnel(): ds = data_dir_load(wt) - yield assert_equal, str(ds), "windtunnel_4lev_hdf5_plt_cnt_0030" + assert_equal(str(ds), "windtunnel_4lev_hdf5_plt_cnt_0030") for test in small_patch_amr(ds, _fields_2d): test_wind_tunnel.__name__ = test.description yield test @@ -55,8 +55,7 @@ @requires_file(sloshing) def test_units_override(): - for test in units_override_check(sloshing): - yield test + units_override_check(sloshing) fid_1to3_b1 = "fiducial_1to3_b1/fiducial_1to3_b1_hdf5_part_0080" diff -Nru yt-3.3.3/yt/frontends/gadget/data_structures.py yt-3.4.0/yt/frontends/gadget/data_structures.py --- yt-3.3.3/yt/frontends/gadget/data_structures.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/gadget/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -26,7 +26,7 @@ from yt.data_objects.static_output import \ ParticleFile from yt.frontends.sph.data_structures import \ - ParticleDataset + SPHDataset from yt.geometry.particle_geometry_handler import \ ParticleIndex from yt.utilities.cosmology import \ @@ -37,20 +37,45 @@ from .definitions import \ gadget_header_specs, \ gadget_field_specs, \ - gadget_ptype_specs + gadget_ptype_specs, \ + SNAP_FORMAT_2_OFFSET from .fields import \ GadgetFieldInfo + def _fix_unit_ordering(unit): if isinstance(unit[0], string_types): unit = unit[1], unit[0] return unit + +def _get_gadget_format(filename): + # check and return gadget binary format with file endianness + ff = open(filename, 'rb') + (rhead,) = struct.unpack('' + elif (rhead == 8): + return 2, '<' + elif (rhead == 65536): + return 1, '>' + elif (rhead == 256): + return 1, '<' + else: + raise RuntimeError("Incorrect Gadget format %s!" % str(rhead)) + + class GadgetBinaryFile(ParticleFile): def __init__(self, ds, io, filename, file_id): + gformat = _get_gadget_format(filename) with open(filename, "rb") as f: - self.header = read_record(f, ds._header_spec) + if gformat[0] == 2: + f.seek(f.tell() + SNAP_FORMAT_2_OFFSET) + self.header = read_record(f, ds._header_spec, endian=gformat[1]) + if gformat[0] == 2: + f.seek(f.tell() + SNAP_FORMAT_2_OFFSET) self._position_offset = f.tell() f.seek(0, os.SEEK_END) self._file_size = f.tell() @@ -62,7 +87,8 @@ field_list, self.total_particles, self._position_offset, self._file_size) -class GadgetDataset(ParticleDataset): + +class GadgetDataset(SPHDataset): _index_class = ParticleIndex _file_class = GadgetBinaryFile _field_info_class = GadgetFieldInfo @@ -75,22 +101,25 @@ additional_fields=(), unit_base=None, n_ref=64, over_refine_factor=1, + kernel_name=None, index_ptype="all", - bounding_box = None, - header_spec = "default", - field_spec = "default", - ptype_spec = "default", + bounding_box=None, + header_spec="default", + field_spec="default", + ptype_spec="default", units_override=None, - unit_system="cgs"): - if self._instantiated: return + unit_system="cgs", + use_dark_factor = False, + w_0 = -1.0, + w_a = 0.0): + if self._instantiated: + return self._header_spec = self._setup_binary_spec( header_spec, gadget_header_specs) self._field_spec = self._setup_binary_spec( field_spec, gadget_field_specs) self._ptype_spec = self._setup_binary_spec( ptype_spec, gadget_ptype_specs) - self.n_ref = n_ref - self.over_refine_factor = over_refine_factor self.index_ptype = index_ptype self.storage_filename = None if unit_base is not None and "UnitLength_in_cm" in unit_base: @@ -102,14 +131,23 @@ bbox = np.array(bounding_box, dtype="float64") if bbox.shape == (2, 3): bbox = bbox.transpose() - self.domain_left_edge = bbox[:,0] - self.domain_right_edge = bbox[:,1] + self.domain_left_edge = bbox[:, 0] + self.domain_right_edge = bbox[:, 1] else: self.domain_left_edge = self.domain_right_edge = None if units_override is not None: - raise RuntimeError("units_override is not supported for GadgetDataset. "+ + raise RuntimeError("units_override is not supported for GadgetDataset. " + "Use unit_base instead.") - super(GadgetDataset, self).__init__(filename, dataset_type, unit_system=unit_system) + + # Set dark energy parameters before cosmology object is created + self.use_dark_factor = use_dark_factor + self.w_0 = w_0 + self.w_a = w_a + + super(GadgetDataset, self).__init__( + filename, dataset_type=dataset_type, unit_system=unit_system, + n_ref=n_ref, over_refine_factor=over_refine_factor, + kernel_name=kernel_name) if self.cosmological_simulation: self.time_unit.convert_to_units('s/h') self.length_unit.convert_to_units('kpccm/h') @@ -133,9 +171,11 @@ def _get_hvals(self): # The entries in this header are capitalized and named to match Table 4 # in the GADGET-2 user guide. - + gformat = _get_gadget_format(self.parameter_filename) f = open(self.parameter_filename, 'rb') - hvals = read_record(f, self._header_spec) + if gformat[0] == 2: + f.seek(f.tell() + SNAP_FORMAT_2_OFFSET) + hvals = read_record(f, self._header_spec, endian=gformat[1]) for i in hvals: if len(hvals[i]) == 1: hvals[i] = hvals[i][0] @@ -173,7 +213,8 @@ # It may be possible to deduce whether ComovingIntegration is on # somehow, but opinions on this vary. if self.omega_lambda == 0.0: - only_on_root(mylog.info, "Omega Lambda is 0.0, so we are turning off Cosmology.") + only_on_root( + mylog.info, "Omega Lambda is 0.0, so we are turning off Cosmology.") self.hubble_constant = 1.0 # So that scaling comes out correct self.cosmological_simulation = 0 self.current_redshift = 0.0 @@ -203,14 +244,17 @@ self.file_count = hvals["NumFiles"] def _set_code_unit_attributes(self): - # If no units passed in by user, set a sane default (Gadget-2 users guide). + # If no units passed in by user, set a sane default (Gadget-2 users + # guide). if self._unit_base is None: if self.cosmological_simulation == 1: - only_on_root(mylog.info, "Assuming length units are in kpc/h (comoving)") - self._unit_base = dict(length = (1.0, "kpccm/h")) + only_on_root( + mylog.info, "Assuming length units are in kpc/h (comoving)") + self._unit_base = dict(length=(1.0, "kpccm/h")) else: - only_on_root(mylog.info, "Assuming length units are in kpc (physical)") - self._unit_base = dict(length = (1.0, "kpc")) + only_on_root( + mylog.info, "Assuming length units are in kpc (physical)") + self._unit_base = dict(length=(1.0, "kpc")) # If units passed in by user, decide what to do about # co-moving and factors of h @@ -281,26 +325,26 @@ @staticmethod def _validate_header(filename): ''' - This method automatically detects whether the Gadget file is big/little endian - and is not corrupt/invalid using the first 4 bytes in the file. It returns a - tuple of (Valid, endianswap) where Valid is a boolean that is true if the file - is a Gadget binary file, and endianswap is the endianness character '>' or '<'. + This method automatically detects whether the Gadget file is big/little endian + and is not corrupt/invalid using the first 4 bytes in the file. It returns a + tuple of (Valid, endianswap) where Valid is a boolean that is true if the file + is a Gadget binary file, and endianswap is the endianness character '>' or '<'. ''' try: - f = open(filename,'rb') + f = open(filename, 'rb') except IOError: try: - f = open(filename+".0") + f = open(filename + ".0") except IOError: return False, 1 - + # First int32 is 256 for a Gadget2 binary file with SnapFormat=1, - # 8 for a Gadget2 binary file with SnapFormat=2 file, + # 8 for a Gadget2 binary file with SnapFormat=2 file, # or the byte swapped equivalents (65536 and 134217728). # The int32 following the header (first 4+256 bytes) must equal this # number. try: - (rhead,) = struct.unpack('' + elif rhead in (8, 134217728): + # This is only true for snapshot format 2 + # we do not currently support double precision + # snap format 2 data + f.close() + return True, 'f4' else: f.close() return False, 1 # Read in particle number from header - np0 = sum(struct.unpack(endianswap+'IIIIII',f.read(6*4))) - # Read in size of position block. It should be 4 bytes per float, + np0 = sum(struct.unpack(endianswap + 'IIIIII', f.read(6 * 4))) + # Read in size of position block. It should be 4 bytes per float, # with 3 coordinates (x,y,z) per particle. (12 bytes per particle) - f.seek(4+256+4,0) - np1 = struct.unpack(endianswap+'I',f.read(4))[0]/(4*3) + f.seek(4 + 256 + 4, 0) + np1 = struct.unpack(endianswap + 'I', f.read(4))[0] / (4 * 3) f.close() # Compare if np0 == np1: - return True, endianswap + return True, 'f4' + elif np1 == 2*np0: + return True, 'f8' else: return False, 1 @@ -336,6 +382,7 @@ # First 4 bytes used to check load return GadgetDataset._validate_header(args[0])[0] + class GadgetHDF5Dataset(GadgetDataset): _file_class = ParticleFile _field_info_class = GadgetFieldInfo @@ -343,21 +390,23 @@ _suffix = ".hdf5" def __init__(self, filename, dataset_type="gadget_hdf5", - unit_base = None, n_ref=64, + unit_base=None, n_ref=64, over_refine_factor=1, + kernel_name=None, index_ptype="all", - bounding_box = None, + bounding_box=None, units_override=None, unit_system="cgs"): self.storage_filename = None filename = os.path.abspath(filename) if units_override is not None: - raise RuntimeError("units_override is not supported for GadgetHDF5Dataset. "+ + raise RuntimeError("units_override is not supported for GadgetHDF5Dataset. " + "Use unit_base instead.") super(GadgetHDF5Dataset, self).__init__( filename, dataset_type, unit_base=unit_base, n_ref=n_ref, over_refine_factor=over_refine_factor, index_ptype=index_ptype, - bounding_box = bounding_box, unit_system=unit_system) + kernel_name=kernel_name, bounding_box=bounding_box, + unit_system=unit_system) def _get_hvals(self): handle = h5py.File(self.parameter_filename, mode="r") @@ -376,8 +425,6 @@ handle.close() return uvals - - def _set_owls_eagle(self): self.dimensionality = 3 @@ -396,7 +443,8 @@ if self.domain_left_edge is None: self.domain_left_edge = np.zeros(3, "float64") - self.domain_right_edge = np.ones(3, "float64") * self.parameters["BoxSize"] + self.domain_right_edge = np.ones( + 3, "float64") * self.parameters["BoxSize"] nz = 1 << self.over_refine_factor self.domain_dimensions = np.ones(3, "int32") * nz @@ -420,9 +468,11 @@ # note the contents of the HDF5 Units group are in _unit_base # note the velocity stored on disk is sqrt(a) dx/dt - self.length_unit = self.quan(self._unit_base["UnitLength_in_cm"], 'cmcm/h') + self.length_unit = self.quan( + self._unit_base["UnitLength_in_cm"], 'cmcm/h') self.mass_unit = self.quan(self._unit_base["UnitMass_in_g"], 'g/h') - self.velocity_unit = self.quan(self._unit_base["UnitVelocity_in_cm_per_s"], 'cm/s') + self.velocity_unit = self.quan( + self._unit_base["UnitVelocity_in_cm_per_s"], 'cm/s') self.time_unit = self.quan(self._unit_base["UnitTime_in_s"], 's/h') @classmethod @@ -433,7 +483,7 @@ try: fh = h5py.File(args[0], mode='r') valid = all(ng in fh["/"] for ng in need_groups) and \ - not any(vg in fh["/"] for vg in veto_groups) + not any(vg in fh["/"] for vg in veto_groups) fh.close() except: valid = False diff -Nru yt-3.3.3/yt/frontends/gadget/definitions.py yt-3.4.0/yt/frontends/gadget/definitions.py --- yt-3.3.3/yt/frontends/gadget/definitions.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/gadget/definitions.py 2017-08-10 18:02:57.000000000 +0000 @@ -84,3 +84,14 @@ ("StellarAge", "Stars") ), ) + +gadget_hdf5_ptypes = ( + "PartType0", + "PartType1", + "PartType2", + "PartType3", + "PartType4", + "PartType5" +) + +SNAP_FORMAT_2_OFFSET = 16 diff -Nru yt-3.3.3/yt/frontends/gadget/fields.py yt-3.4.0/yt/frontends/gadget/fields.py --- yt-3.3.3/yt/frontends/gadget/fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/gadget/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -35,8 +35,8 @@ def _setup_four_metal_fractions(self, ptype): """ - This function breaks the FourMetalFractions field (if present) - into its four component metal fraction fields and adds + This function breaks the FourMetalFractions field (if present) + into its four component metal fraction fields and adds corresponding metal density fields which will later get smoothed This gets used with the Gadget group0000 format @@ -52,8 +52,8 @@ return _Fraction self.add_field( (ptype, metal_name+"_fraction"), - function=_Fraction_wrap(i), - particle_type=True, + sampling_type="particle", + function=_Fraction_wrap(i), units="") # add the metal density fields @@ -64,8 +64,8 @@ return _Metal_density self.add_field( (ptype, metal_name+"_density"), - function=_Density_wrap(i), - particle_type=True, + sampling_type="particle", + function=_Density_wrap(i), units=self.ds.unit_system["density"]) def setup_gas_particle_fields(self, ptype): @@ -83,15 +83,18 @@ # Assume cosmic abundances x_H = 0.76 gamma = 5.0/3.0 - # Assume zero ionization - mu = 4.0 / (3.0 * x_H + 1.0) + if data.has_field_parameter("mean_molecular_weight"): + mu = data.get_field_parameter("mean_molecular_weight") + else: + # Assume zero ionization + mu = 4.0 / (3.0 * x_H + 1.0) ret = data[ptype, "InternalEnergy"]*(gamma-1)*mu*mp/kb return ret.in_units(self.ds.unit_system["temperature"]) self.add_field( (ptype, "Temperature"), + sampling_type="particle", function=_temperature, - particle_type=True, units=self.ds.unit_system["temperature"]) self.alias((ptype, 'temperature'), (ptype, 'Temperature')) diff -Nru yt-3.3.3/yt/frontends/gadget/io.py yt-3.4.0/yt/frontends/gadget/io.py --- yt-3.3.3/yt/frontends/gadget/io.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/gadget/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -19,19 +19,198 @@ import os from yt.extern.six import string_types -from yt.frontends.owls.io import \ - IOHandlerOWLS from yt.utilities.io_handler import \ BaseIOHandler from yt.utilities.lib.geometry_utils import \ compute_morton from yt.utilities.logger import ytLogger as mylog +from yt.utilities.on_demand_imports import _h5py as h5py -class IOHandlerGadgetHDF5(IOHandlerOWLS): +from .data_structures import \ + _get_gadget_format + +from .definitions import \ + gadget_hdf5_ptypes, \ + SNAP_FORMAT_2_OFFSET + + +class IOHandlerGadgetHDF5(BaseIOHandler): _dataset_type = "gadget_hdf5" + _vector_fields = ("Coordinates", "Velocity", "Velocities") + _known_ptypes = gadget_hdf5_ptypes + _var_mass = None + _element_names = ('Hydrogen', 'Helium', 'Carbon', 'Nitrogen', 'Oxygen', + 'Neon', 'Magnesium', 'Silicon', 'Iron') + + @property + def var_mass(self): + if self._var_mass is None: + vm = [] + for i, v in enumerate(self.ds["Massarr"]): + if v == 0: + vm.append(self._known_ptypes[i]) + self._var_mass = tuple(vm) + return self._var_mass + + def _read_fluid_selection(self, chunks, selector, fields, size): + raise NotImplementedError + + def _read_particle_coords(self, chunks, ptf): + # This will read chunks and yield the results. + chunks = list(chunks) + data_files = set([]) + for chunk in chunks: + for obj in chunk.objs: + data_files.update(obj.data_files) + for data_file in sorted(data_files, key=lambda x: x.filename): + f = h5py.File(data_file.filename, "r") + # This double-reads + for ptype, field_list in sorted(ptf.items()): + if data_file.total_particles[ptype] == 0: + continue + x = f["/%s/Coordinates" % ptype][:, 0].astype("float64") + y = f["/%s/Coordinates" % ptype][:, 1].astype("float64") + z = f["/%s/Coordinates" % ptype][:, 2].astype("float64") + yield ptype, (x, y, z) + f.close() + + def _read_particle_fields(self, chunks, ptf, selector): + # Now we have all the sizes, and we can allocate + data_files = set([]) + for chunk in chunks: + for obj in chunk.objs: + data_files.update(obj.data_files) + for data_file in sorted(data_files, key=lambda x: x.filename): + f = h5py.File(data_file.filename, "r") + for ptype, field_list in sorted(ptf.items()): + if data_file.total_particles[ptype] == 0: + continue + g = f["/%s" % ptype] + coords = g["Coordinates"][:].astype("float64") + mask = selector.select_points( + coords[:, 0], coords[:, 1], coords[:, 2], 0.0) + del coords + if mask is None: + continue + for field in field_list: + + if field in ("Mass", "Masses") and \ + ptype not in self.var_mass: + data = np.empty(mask.sum(), dtype="float64") + ind = self._known_ptypes.index(ptype) + data[:] = self.ds["Massarr"][ind] + + elif field in self._element_names: + rfield = 'ElementAbundance/' + field + data = g[rfield][:][mask, ...] + elif field.startswith("Metallicity_"): + col = int(field.rsplit("_", 1)[-1]) + data = g["Metallicity"][:, col][mask] + elif field.startswith("Chemistry_"): + col = int(field.rsplit("_", 1)[-1]) + data = g["ChemistryAbundances"][:, col][mask] + else: + data = g[field][:][mask, ...] + + yield (ptype, field), data + f.close() + + def _initialize_index(self, data_file, regions): + index_ptype = self.index_ptype + f = h5py.File(data_file.filename, "r") + if index_ptype == "all": + pcount = f["/Header"].attrs["NumPart_ThisFile"][:].sum() + keys = f.keys() + else: + pt = int(index_ptype[-1]) + pcount = f["/Header"].attrs["NumPart_ThisFile"][pt] + keys = [index_ptype] + morton = np.empty(pcount, dtype='uint64') + ind = 0 + for key in keys: + if not key.startswith("PartType"): + continue + if "Coordinates" not in f[key]: + continue + ds = f[key]["Coordinates"] + dt = ds.dtype.newbyteorder("N") # Native + pos = np.empty(ds.shape, dtype=dt) + pos[:] = ds + regions.add_data_file(pos, data_file.file_id, + data_file.ds.filter_bbox) + morton[ind:ind + pos.shape[0]] = compute_morton( + pos[:, 0], pos[:, 1], pos[:, 2], + data_file.ds.domain_left_edge, + data_file.ds.domain_right_edge, + data_file.ds.filter_bbox) + ind += pos.shape[0] + f.close() + return morton + + def _count_particles(self, data_file): + f = h5py.File(data_file.filename, "r") + pcount = f["/Header"].attrs["NumPart_ThisFile"][:] + f.close() + npart = dict(("PartType%s" % (i), v) for i, v in enumerate(pcount)) + return npart + + def _identify_fields(self, data_file): + f = h5py.File(data_file.filename, "r") + fields = [] + cname = self.ds._particle_coordinates_name # Coordinates + mname = self.ds._particle_mass_name # Mass + + # loop over all keys in OWLS hdf5 file + #-------------------------------------------------- + for key in f.keys(): + + # only want particle data + #-------------------------------------- + if not key.startswith("PartType"): + continue + + # particle data group + #-------------------------------------- + g = f[key] + if cname not in g: + continue + + # note str => not unicode! + ptype = str(key) + if ptype not in self.var_mass: + fields.append((ptype, mname)) + + # loop over all keys in PartTypeX group + #---------------------------------------- + for k in g.keys(): + + if k == 'ElementAbundance': + gp = g[k] + for j in gp.keys(): + kk = j + fields.append((ptype, str(kk))) + elif k == 'Metallicity' and len(g[k].shape) > 1: + # Vector of metallicity + for i in range(g[k].shape[1]): + fields.append((ptype, "Metallicity_%02i" % i)) + elif k == "ChemistryAbundances" and len(g[k].shape) > 1: + for i in range(g[k].shape[1]): + fields.append((ptype, "Chemistry_%03i" % i)) + else: + kk = k + if not hasattr(g[kk], "shape"): + continue + if len(g[kk].shape) > 1: + self._vector_fields[kk] = g[kk].shape[1] + fields.append((ptype, str(kk))) + + f.close() + return fields, {} + ZeroMass = object() - + + class IOHandlerGadgetBinary(BaseIOHandler): _dataset_type = "gadget_binary" _vector_fields = (("Coordinates", 3), @@ -56,11 +235,17 @@ # TSTP (only if enabled in makefile) _var_mass = None + _format = None def __init__(self, ds, *args, **kwargs): self._vector_fields = dict(self._vector_fields) self._fields = ds._field_spec self._ptypes = ds._ptype_spec + self.data_files = set([]) + gformat = _get_gadget_format(ds.parameter_filename) + # gadget format 1 original, 2 with block name + self._format = gformat[0] + self._endian = gformat[1] super(IOHandlerGadgetBinary, self).__init__(ds, *args, **kwargs) @property @@ -89,8 +274,8 @@ # This is where we could implement sub-chunking f.seek(poff[ptype, "Coordinates"], os.SEEK_SET) pos = self._read_field_from_file(f, - tp[ptype], "Coordinates") - yield ptype, (pos[:,0], pos[:,1], pos[:,2]) + tp[ptype], "Coordinates") + yield ptype, (pos[:, 0], pos[:, 1], pos[:, 2]) f.close() def _read_particle_fields(self, chunks, ptf, selector): @@ -105,11 +290,12 @@ for ptype, field_list in sorted(ptf.items()): f.seek(poff[ptype, "Coordinates"], os.SEEK_SET) pos = self._read_field_from_file(f, - tp[ptype], "Coordinates") + tp[ptype], "Coordinates") mask = selector.select_points( - pos[:,0], pos[:,1], pos[:,2], 0.0) + pos[:, 0], pos[:, 1], pos[:, 2], 0.0) del pos - if mask is None: continue + if mask is None: + continue for field in field_list: if field == "Mass" and ptype not in self.var_mass: data = np.empty(mask.sum(), dtype="float64") @@ -120,60 +306,90 @@ continue f.seek(poff[ptype, field], os.SEEK_SET) data = self._read_field_from_file(f, tp[ptype], field) - data = data[mask,...] + data = data[mask, ...] yield (ptype, field), data f.close() def _read_field_from_file(self, f, count, name): - if count == 0: return + if count == 0: + return if name == "ParticleIDs": - dt = "uint32" + dt = self._endian + "u4" else: - dt = "float32" + dt = self._endian + self._float_type if name in self._vector_fields: count *= self._vector_fields[name] - arr = np.fromfile(f, dtype=dt, count = count) + arr = np.fromfile(f, dtype=dt, count=count) if name in self._vector_fields: factor = self._vector_fields[name] - arr = arr.reshape((count//factor, factor), order="C") - return arr.astype("float64") + arr = arr.reshape((count // factor, factor), order="C") + return arr.astype(self._float_type) - def _initialize_index(self, data_file, regions): - count = sum(data_file.total_particles.values()) - DLE = data_file.ds.domain_left_edge - DRE = data_file.ds.domain_right_edge + def _get_morton_from_position(self, data_file, count, offset_count, + regions, DLE, DRE): with open(data_file.filename, "rb") as f: # We add on an additionally 4 for the first record. - f.seek(data_file._position_offset + 4) + f.seek(data_file._position_offset + 4 + offset_count * 12) # The first total_particles * 3 values are positions - pp = np.fromfile(f, dtype = 'float32', count = count*3) + pp = np.fromfile(f, dtype=self._endian + self._float_type, + count=count * 3) pp.shape = (count, 3) - regions.add_data_file(pp, data_file.file_id, data_file.ds.filter_bbox) - morton = compute_morton(pp[:,0], pp[:,1], pp[:,2], DLE, DRE, + pp = pp.astype(self._float_type) + regions.add_data_file(pp, data_file.file_id, + data_file.ds.filter_bbox) + morton = compute_morton(pp[:, 0], pp[:, 1], pp[:, 2], DLE, DRE, data_file.ds.filter_bbox) return morton + def _initialize_index(self, data_file, regions): + DLE = data_file.ds.domain_left_edge + DRE = data_file.ds.domain_right_edge + self._float_type = data_file.ds._validate_header(data_file.filename)[1] + if self.index_ptype == "all": + count = sum(data_file.total_particles.values()) + return self._get_morton_from_position( + data_file, count, 0, regions, DLE, DRE) + else: + idpos = self._ptypes.index(self.index_ptype) + count = data_file.total_particles.get(self.index_ptype) + account = [0] + [data_file.total_particles.get(ptype) + for ptype in self._ptypes] + account = np.cumsum(account) + return self._get_morton_from_position( + data_file, account, account[idpos], regions, DLE, DRE) + def _count_particles(self, data_file): npart = dict((self._ptypes[i], v) - for i, v in enumerate(data_file.header["Npart"])) + for i, v in enumerate(data_file.header["Npart"])) return npart # header is 256, but we have 4 at beginning and end for ints _field_size = 4 def _calculate_field_offsets(self, field_list, pcount, - offset, file_size = None): + offset, file_size=None): # field_list is (ftype, fname) but the blocks are ordered # (fname, ftype) in the file. - pos = offset + if self._format == 2: + # Need to subtract offset due to extra header block + pos = offset - SNAP_FORMAT_2_OFFSET + else: + pos = offset fs = self._field_size offsets = {} + for field in self._fields: if not isinstance(field, string_types): field = field[0] - if not any( (ptype, field) in field_list - for ptype in self._ptypes): + if not any((ptype, field) in field_list + for ptype in self._ptypes): continue - pos += 4 + if self._format == 2: + pos += 20 # skip block header + elif self._format == 1: + pos += 4 + else: + raise RuntimeError( + "incorrect Gadget format %s!" % str(self._format)) any_ptypes = False for ptype in self._ptypes: if field == "Mass" and ptype not in self.var_mass: @@ -187,9 +403,10 @@ else: pos += pcount[ptype] * fs pos += 4 - if not any_ptypes: pos -= 8 + if not any_ptypes: + pos -= 8 if file_size is not None: - if file_size != pos: + if (file_size != pos) & (self._format == 1): # ignore the rest of format 2 mylog.warning("Your Gadget-2 file may have extra " + "columns or different precision!" + " (%s file vs %s computed)", @@ -202,13 +419,15 @@ tp = domain.total_particles for i, ptype in enumerate(self._ptypes): count = tp[ptype] - if count == 0: continue + if count == 0: + continue m = domain.header["Massarr"][i] for field in self._fields: if isinstance(field, tuple): field, req = field if req is ZeroMass: - if m > 0.0 : continue + if m > 0.0: + continue elif isinstance(req, tuple) and ptype in req: pass elif req != ptype: diff -Nru yt-3.3.3/yt/frontends/gadget/tests/test_outputs.py yt-3.4.0/yt/frontends/gadget/tests/test_outputs.py --- yt-3.3.3/yt/frontends/gadget/tests/test_outputs.py 2016-12-08 21:22:28.000000000 +0000 +++ yt-3.4.0/yt/frontends/gadget/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -25,6 +25,8 @@ isothermal_h5 = "IsothermalCollapse/snap_505.hdf5" isothermal_bin = "IsothermalCollapse/snap_505" +BE_Gadget = "BigEndianGadgetBinary/BigEndianGadgetBinary" +LE_SnapFormat2 = "Gadget3-snap-format2/Gadget3-snap-format2" # This maps from field names to weight field names to use for projections iso_fields = OrderedDict( @@ -41,13 +43,18 @@ ) iso_kwargs = dict(bounding_box=[[-3, 3], [-3, 3], [-3, 3]]) + @requires_file(isothermal_h5) @requires_file(isothermal_bin) +@requires_file(BE_Gadget) +@requires_file(LE_SnapFormat2) def test_GadgetDataset(): assert isinstance(data_dir_load(isothermal_h5, kwargs=iso_kwargs), GadgetHDF5Dataset) assert isinstance(data_dir_load(isothermal_bin, kwargs=iso_kwargs), GadgetDataset) + assert isinstance(data_dir_load(BE_Gadget), GadgetDataset) + assert isinstance(data_dir_load(LE_SnapFormat2), GadgetDataset) @requires_ds(isothermal_h5) diff -Nru yt-3.3.3/yt/frontends/gadget_fof/data_structures.py yt-3.4.0/yt/frontends/gadget_fof/data_structures.py --- yt-3.3.3/yt/frontends/gadget_fof/data_structures.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/gadget_fof/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -138,10 +138,11 @@ _field_info_class = GadgetFOFFieldInfo def __init__(self, filename, dataset_type="gadget_fof_hdf5", - n_ref=16, over_refine_factor=1, + n_ref=16, over_refine_factor=1, index_ptype="all", unit_base=None, units_override=None, unit_system="cgs"): self.n_ref = n_ref self.over_refine_factor = over_refine_factor + self.index_ptype = index_ptype if unit_base is not None and "UnitLength_in_cm" in unit_base: # We assume this is comoving, because in the absence of comoving # integration the redshift will be zero. @@ -461,8 +462,8 @@ class GagdetFOFHaloContainer(YTSelectionContainer): """ Create a data container to get member particles and individual - values from halos and subhalos. Halo mass, position, and - velocity are set as attributes. Halo IDs are accessible + values from halos and subhalos. Halo mass, position, and + velocity are set as attributes. Halo IDs are accessible through the field, "member_ids". Other fields that are one value per halo are accessible as normal. The field list for halo objects can be seen in `ds.halos_field_list`. @@ -472,13 +473,13 @@ ptype : string The type of halo, either "Group" for the main halo or "Subhalo" for subhalos. - particle_identifier : int or tuple of (int, int) + particle_identifier : int or tuple of ints The halo or subhalo id. If requesting a subhalo, the id can also be given as a tuple of the main halo id and subgroup id, such as (1, 4) for subgroup 4 of halo 1. - Halo Container Attributes - ------------------------- + Attributes + ---------- particle_identifier : int The id of the halo or subhalo. group_identifier : int @@ -495,14 +496,13 @@ velocity : array of floats Halo velocity. - Relevant Fields - --------------- - particle_number : - number of particles - subhalo_number : - number of subhalos - group_identifier : - id of parent group for subhalos + Note + ---- + Relevant Fields: + + * particle_number - number of particles + * subhalo_number - number of subhalos + * group_identifier - id of parent group for subhalos Examples -------- diff -Nru yt-3.3.3/yt/frontends/gadget_fof/io.py yt-3.4.0/yt/frontends/gadget_fof/io.py --- yt-3.3.3/yt/frontends/gadget_fof/io.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/gadget_fof/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -113,7 +113,12 @@ yield (ptype, field), data def _initialize_index(self, data_file, regions): - pcount = sum(data_file.total_particles.values()) + if self.index_ptype == "all": + ptypes = self.ds.particle_types_raw + pcount = sum(data_file.total_particles.values()) + else: + ptypes = [self.index_ptype] + pcount = data_file.total_particles[self.index_ptype] morton = np.empty(pcount, dtype='uint64') if pcount == 0: return morton mylog.debug("Initializing index % 5i (% 7i particles)", @@ -124,12 +129,12 @@ dx = np.finfo(f["Group"]["GroupPos"].dtype).eps dx = 2.0*self.ds.quan(dx, "code_length") - for ptype in data_file.ds.particle_types_raw: + for ptype in ptypes: if data_file.total_particles[ptype] == 0: continue pos = f[ptype]["%sPos" % ptype].value.astype("float64") pos = np.resize(pos, (data_file.total_particles[ptype], 3)) pos = data_file.ds.arr(pos, "code_length") - + # These are 32 bit numbers, so we give a little lee-way. # Otherwise, for big sets of particles, we often will bump into the # domain edges. This helps alleviate that. diff -Nru yt-3.3.3/yt/frontends/gadget_fof/tests/test_outputs.py yt-3.4.0/yt/frontends/gadget_fof/tests/test_outputs.py --- yt-3.3.3/yt/frontends/gadget_fof/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/gadget_fof/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -69,7 +69,7 @@ # Test that all subhalo particles are contained within # their parent group. - yield assert_equal, total_sub, total_int + assert_equal(total_sub, total_int) @requires_file(g298) def test_halo_masses(): @@ -85,7 +85,7 @@ # Check that masses from halo containers are the same # as the array of all masses. This will test getting # scalar fields for halos correctly. - yield assert_array_equal, ad[ptype, "particle_mass"], mass + assert_array_equal(ad[ptype, "particle_mass"], mass) # fof/subhalo catalog with no member ids in first file g56 = "gadget_halos/data/groups_056/fof_subhalo_tab_056.0.hdf5" diff -Nru yt-3.3.3/yt/frontends/gamer/data_structures.py yt-3.4.0/yt/frontends/gamer/data_structures.py --- yt-3.3.3/yt/frontends/gamer/data_structures.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/gamer/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -52,33 +52,39 @@ class GAMERHierarchy(GridIndex): grid = GAMERGrid _preload_implemented = True # since gamer defines "_read_chunk_data" in io.py - + def __init__(self, ds, dataset_type = 'gamer'): self.dataset_type = dataset_type self.dataset = weakref.proxy(ds) self.index_filename = self.dataset.parameter_filename self.directory = os.path.dirname(self.index_filename) self._handle = ds._handle + self._group_grid = ds._group_grid + self._group_particle = ds._group_particle self.float_type = 'float64' # fixed even when FLOAT8 is off self._particle_handle = ds._particle_handle GridIndex.__init__(self, ds, dataset_type) def _detect_output_fields(self): # find all field names in the current dataset - self.field_list = [ ('gamer', v) for v in self._handle['Data'].keys() ] - + # grid fields + self.field_list = [ ('gamer', v) for v in self._group_grid.keys() ] + + # particle fields + if self._group_particle is not None: + self.field_list += [ ('io', v) for v in self._group_particle.keys() ] + def _count_grids(self): - # count the total number of patches at all levels + # count the total number of patches at all levels self.num_grids = self.dataset.parameters['NPatch'].sum() - + def _parse_index(self): parameters = self.dataset.parameters gid0 = 0 grid_corner = self._handle['Tree/Corner'].value convert2physical = self._handle['Tree/Corner'].attrs['Cvt2Phy'] - self.grid_dimensions [:] = parameters['PatchSize'] - self.grid_particle_count[:] = 0 + self.grid_dimensions[:] = parameters['PatchSize'] for lv in range(0, parameters['NLevel']): num_grids_level = parameters['NPatch'][lv] @@ -103,17 +109,29 @@ # maximum level with patches (which can be lower than MAX_LEVEL) self.max_level = self.grid_levels.max() - + + # number of particles in each grid + try: + self.grid_particle_count[:] = self._handle['Tree/NPar'].value[:,None] + except KeyError: + self.grid_particle_count[:] = 0.0 + + # calculate the starting particle indices for each grid (starting from 0) + # --> note that the last element must store the total number of particles + # (see _read_particle_coords and _read_particle_fields in io.py) + self._particle_indices = np.zeros(self.num_grids + 1, dtype='int64') + np.add.accumulate(self.grid_particle_count.squeeze(), out=self._particle_indices[1:]) + def _populate_grid_objects(self): son_list = self._handle["Tree/Son"].value for gid in range(self.num_grids): - grid = self.grids.flat[gid] + grid = self.grids[gid] son_gid0 = son_list[gid] # set up the parent-children relationship if son_gid0 >= 0: - grid.Children = [ self.grids.flat[son_gid0+s] for s in range(8) ] + grid.Children = [ self.grids[son_gid0+s] for s in range(8) ] for son_grid in grid.Children: son_grid.Parent = grid @@ -144,7 +162,7 @@ 'Grid %d, Children %d, Children->Parent %d' % \ (grid.id, c.id, c.Parent.id) - # all refinement grids should have parent + # all refinement grids should have parent if grid.Level > 0: assert grid.Parent is not None and grid.Parent.id >= 0, \ 'Grid %d, Level %d, Parent %d' % \ @@ -163,18 +181,20 @@ assert_equal(grid.LeftEdge, grid.Children[0].LeftEdge ) assert_equal(grid.RightEdge, grid.Children[7].RightEdge) mylog.info('Check passed') - + class GAMERDataset(Dataset): _index_class = GAMERHierarchy _field_info_class = GAMERFieldInfo _handle = None + _group_grid = None + _group_particle = None _debug = False # debug mode for the GAMER frontend - + def __init__(self, filename, dataset_type = 'gamer', storage_filename = None, - particle_filename = None, + particle_filename = None, units_override = None, unit_system = "cgs"): @@ -184,6 +204,15 @@ self._handle = HDF5FileHandler(filename) self.particle_filename = particle_filename + # to catch both the new and old data formats for the grid data + try: + self._group_grid = self._handle['GridData'] + except KeyError: + self._group_grid = self._handle['Data'] + + if 'Particle' in self._handle: + self._group_particle = self._handle['Particle'] + if self.particle_filename is None: self._particle_handle = self._handle else: @@ -199,47 +228,66 @@ units_override = units_override, unit_system = unit_system) self.storage_filename = storage_filename - - def _set_code_unit_attributes(self): - # GAMER does not assume any unit yet ... - if len(self.units_override) == 0: - mylog.warning("GAMER does not assume any unit ==> " + - "Use units_override to specify the units") - for unit, cgs in [("length", "cm"), ("time", "s"), ("mass", "g")]: - setdefaultattr(self, "%s_unit"%unit, self.quan(1.0, cgs)) + def _set_code_unit_attributes(self): + if self.parameters['Opt__Unit']: + # GAMER units are always in CGS + setdefaultattr( self, 'length_unit', self.quan(self.parameters['Unit_L'], 'cm') ) + setdefaultattr( self, 'mass_unit', self.quan(self.parameters['Unit_M'], 'g' ) ) + setdefaultattr( self, 'time_unit', self.quan(self.parameters['Unit_T'], 's' ) ) + else: if len(self.units_override) == 0: - mylog.warning("Assuming 1.0 = 1.0 %s", cgs) - + mylog.warning("Cannot determine code units ==> " + + "Use units_override to specify the units") + + for unit, cgs in [("length", "cm"), ("time", "s"), ("mass", "g")]: + setdefaultattr(self, "%s_unit"%unit, self.quan(1.0, cgs)) + + if len(self.units_override) == 0: + mylog.warning("Assuming %s unit = 1.0 %s", unit, cgs) + def _parse_parameter_file(self): self.unique_identifier = \ int(os.stat(self.parameter_filename)[stat.ST_CTIME]) - # shortcuts for different simulation information - KeyInfo = self._handle['Info']['KeyInfo'] - InputPara = self._handle['Info']['InputPara'] - Makefile = self._handle['Info']['Makefile'] - SymConst = self._handle['Info']['SymConst'] + # code-specific parameters + for t in self._handle['Info']: + info_category = self._handle['Info'][t] + for v in info_category.dtype.names: self.parameters[v] = info_category[v] + + # shortcut for self.parameters + parameters = self.parameters + + # reset 'Model' to be more readable + if parameters['Model'] == 1: + parameters['Model'] = 'Hydro' + elif parameters['Model'] == 2: + parameters['Model'] = 'MHD' + elif parameters['Model'] == 3: + parameters['Model'] = 'ELBDM' + else: + parameters['Model'] = 'Unknown' # simulation time and domain - self.current_time = KeyInfo['Time'][0] + self.current_time = parameters['Time'][0] self.dimensionality = 3 # always 3D self.domain_left_edge = np.array([0.,0.,0.], dtype='float64') - self.domain_right_edge = KeyInfo['BoxSize'].astype('float64') - self.domain_dimensions = KeyInfo['NX0'].astype('int64') + self.domain_right_edge = parameters['BoxSize'].astype('float64') + self.domain_dimensions = parameters['NX0'].astype('int64') # periodicity - periodic = InputPara['Opt__BC_Flu'][0] == 0 + periodic = parameters['Opt__BC_Flu'][0] == 0 self.periodicity = (periodic,periodic,periodic) # cosmological parameters - if Makefile['Comoving']: + if parameters['Comoving']: self.cosmological_simulation = 1 self.current_redshift = 1.0/self.current_time - 1.0 - self.omega_matter = InputPara['OmegaM0'] + self.omega_matter = parameters['OmegaM0'] self.omega_lambda = 1.0 - self.omega_matter - self.hubble_constant = 0.6955 # H0 is not set in GAMER + # default to 0.7 for old data format + self.hubble_constant = parameters.get('Hubble0', 0.7) else: self.cosmological_simulation = 0 self.current_redshift = 0.0 @@ -247,25 +295,14 @@ self.omega_lambda = 0.0 self.hubble_constant = 0.0 - # code-specific parameters - for t in KeyInfo, InputPara, Makefile, SymConst: - for v in t.dtype.names: self.parameters[v] = t[v] - - # reset 'Model' to be more readable - if KeyInfo['Model'] == 1: - self.parameters['Model'] = 'Hydro' - elif KeyInfo['Model'] == 2: - self.parameters['Model'] = 'MHD' - elif KeyInfo['Model'] == 3: - self.parameters['Model'] = 'ELBDM' - else: - self.parameters['Model'] = 'Unknown' - # make aliases to some frequently used variables - if self.parameters['Model'] == 'Hydro' or \ - self.parameters['Model'] == 'MHD': - self.gamma = self.parameters["Gamma"] - self.mu = self.parameters.get("mu",0.6) # mean molecular weight + if parameters['Model'] == 'Hydro' or parameters['Model'] == 'MHD': + self.gamma = parameters["Gamma"] + # default to 0.6 for old data format + self.mu = parameters.get('MolecularWeight', 0.6) + + # old data format (version < 2210) does not contain any information of code units + self.parameters.setdefault('Opt__Unit', 0) @classmethod def _is_valid(self, *args, **kwargs): diff -Nru yt-3.3.3/yt/frontends/gamer/fields.py yt-3.4.0/yt/frontends/gamer/fields.py --- yt-3.3.3/yt/frontends/gamer/fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/gamer/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -30,19 +30,30 @@ class GAMERFieldInfo(FieldInfoContainer): known_other_fields = ( # hydro fields on disk (GAMER outputs conservative variables) - ( "Dens", (rho_units, ["density"], r"\rho") ), - ( "MomX", (mom_units, ["momentum_x"], None ) ), - ( "MomY", (mom_units, ["momentum_y"], None ) ), - ( "MomZ", (mom_units, ["momentum_z"], None ) ), - ( "Engy", (erg_units, ["total_energy_per_volume"], None ) ), - ( "Pote", (pot_units, ["gravitational_potential"], None ) ), + ( "Dens", (rho_units, ["density"], r"\rho") ), + ( "MomX", (mom_units, ["momentum_x"], None ) ), + ( "MomY", (mom_units, ["momentum_y"], None ) ), + ( "MomZ", (mom_units, ["momentum_z"], None ) ), + ( "Engy", (erg_units, ["total_energy_per_volume"], None ) ), + ( "Pote", (pot_units, ["gravitational_potential"], None ) ), # psiDM fields on disk - ( "Real", (psi_units, ["psidm_real_part"], None ) ), - ( "Imag", (psi_units, ["psidm_imaginary_part"], None ) ), + ( "Real", (psi_units, ["psidm_real_part"], None ) ), + ( "Imag", (psi_units, ["psidm_imaginary_part"], None ) ), + + # particle fields on disk (deposited onto grids) + ("ParDens", (rho_units, ["particle_density_on_grid"], None ) ), + ("TotalDens", (rho_units, ["total_density_on_grid"], None ) ), ) known_particle_fields = ( + ( "ParMass", ("code_mass", ["particle_mass"], None) ), + ( "ParPosX", ("code_length", ["particle_position_x"], None) ), + ( "ParPosY", ("code_length", ["particle_position_y"], None) ), + ( "ParPosZ", ("code_length", ["particle_position_z"], None) ), + ( "ParVelX", ("code_velocity", ["particle_velocity_x"], None) ), + ( "ParVelY", ("code_velocity", ["particle_velocity_y"], None) ), + ( "ParVelZ", ("code_velocity", ["particle_velocity_z"], None) ), ) def __init__(self, ds, field_list): @@ -58,7 +69,8 @@ return data["gas", "momentum_%s"%v] / data["gas","density"] return _velocity for v in "xyz": - self.add_field( ("gas","velocity_%s"%v), function = velocity_xyz(v), + self.add_field( ("gas","velocity_%s"%v), sampling_type="cell", + function = velocity_xyz(v), units = unit_system["velocity"] ) # ============================================================================ @@ -83,28 +95,31 @@ # thermal energy per mass (i.e., specific) def _thermal_energy(field, data): return et(data) / data["gamer","Dens"] - self.add_field( ("gas","thermal_energy"), function = _thermal_energy, + self.add_field( ("gas","thermal_energy"), sampling_type="cell", + function = _thermal_energy, units = unit_system["specific_energy"] ) # total energy per mass def _total_energy(field, data): return data["gamer","Engy"] / data["gamer","Dens"] - self.add_field( ("gas","total_energy"), function = _total_energy, + self.add_field( ("gas","total_energy"), sampling_type="cell", + function = _total_energy, units = unit_system["specific_energy"] ) # pressure def _pressure(field, data): return et(data)*(data.ds.gamma-1.0) - self.add_field( ("gas","pressure"), function = _pressure, + self.add_field( ("gas","pressure"), sampling_type="cell", + function = _pressure, units = unit_system["pressure"] ) # temperature def _temperature(field, data): return data.ds.mu*mh*data["gas","pressure"] / \ (data["gas","density"]*boltzmann_constant_cgs) - self.add_field( ("gas","temperature"), function = _temperature, + self.add_field( ("gas","temperature"), sampling_type="cell", + function = _temperature, units = unit_system["temperature"] ) def setup_particle_fields(self, ptype): - # This will get called for every particle type. - pass + super(GAMERFieldInfo, self).setup_particle_fields(ptype) diff -Nru yt-3.3.3/yt/frontends/gamer/io.py yt-3.4.0/yt/frontends/gamer/io.py --- yt-3.3.3/yt/frontends/gamer/io.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/gamer/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -19,6 +19,7 @@ from yt.utilities.io_handler import \ BaseIOHandler from yt.utilities.logger import ytLogger as mylog +from yt.geometry.selection_routines import AlwaysSelector #----------------------------------------------------------------------------- @@ -27,25 +28,79 @@ # group grids with consecutive indices together to improve the I/O performance +# --> grids are assumed to be sorted into ascending numerical order already def grid_sequences(grids): - for k, g in groupby( enumerate(grids), lambda i_x1:i_x1[0]-i_x1[1].id ): + for k, g in groupby( enumerate(grids), lambda i_x:i_x[0]-i_x[1].id ): seq = list(v[1] for v in g) yield seq +def particle_sequences(grids): + for k, g in groupby( enumerate(grids), lambda i_x:i_x[0]-i_x[1].id ): + seq = list(v[1] for v in g) + yield seq[0], seq[-1] + class IOHandlerGAMER(BaseIOHandler): _particle_reader = False _dataset_type = "gamer" def __init__(self, ds): super(IOHandlerGAMER, self).__init__(ds) - self._handle = ds._handle - self._field_dtype = "float64" # fixed even when FLOAT8 is off + self._handle = ds._handle + self._group_grid = ds._group_grid + self._group_particle = ds._group_particle + self._field_dtype = "float64" # fixed even when FLOAT8 is off + self._particle_handle = ds._particle_handle def _read_particle_coords(self, chunks, ptf): - pass + chunks = list(chunks) # generator --> list + p_idx = self.ds.index._particle_indices + + # shortcuts + par_posx = self._group_particle["ParPosX"] + par_posy = self._group_particle["ParPosY"] + par_posz = self._group_particle["ParPosZ"] + + # currently GAMER does not support multiple particle types + assert( len(ptf) == 1 ) + ptype = list( ptf.keys() )[0] + + for chunk in chunks: + for g1, g2 in particle_sequences(chunk.objs): + start = p_idx[g1.id ] + end = p_idx[g2.id + 1] + x = np.asarray( par_posx[start:end], dtype=self._field_dtype ) + y = np.asarray( par_posy[start:end], dtype=self._field_dtype ) + z = np.asarray( par_posz[start:end], dtype=self._field_dtype ) + yield ptype, (x, y, z) def _read_particle_fields(self, chunks, ptf, selector): - pass + chunks = list(chunks) # generator --> list + p_idx = self.ds.index._particle_indices + + # shortcuts + par_posx = self._group_particle["ParPosX"] + par_posy = self._group_particle["ParPosY"] + par_posz = self._group_particle["ParPosZ"] + + # currently GAMER does not support multiple particle types + assert( len(ptf) == 1 ) + ptype = list( ptf.keys() )[0] + pfields = ptf[ptype] + + for chunk in chunks: + for g1, g2 in particle_sequences(chunk.objs): + start = p_idx[g1.id ] + end = p_idx[g2.id + 1] + x = np.asarray( par_posx[start:end], dtype=self._field_dtype ) + y = np.asarray( par_posy[start:end], dtype=self._field_dtype ) + z = np.asarray( par_posz[start:end], dtype=self._field_dtype ) + + mask = selector.select_points(x, y, z, 0.0) + if mask is None: continue + + for field in pfields: + data = self._group_particle[field][start:end] + yield (ptype, field), data[mask] def _read_fluid_selection(self, chunks, selector, fields, size): chunks = list(chunks) # generator --> list @@ -61,7 +116,7 @@ size, [f2 for f1, f2 in fields], ng ) for field in fields: - ds = self._handle[ "/Data/%s" % field[1] ] + ds = self._group_grid[ field[1] ] offset = 0 for chunk in chunks: for gs in grid_sequences(chunk.objs): @@ -74,12 +129,29 @@ def _read_chunk_data(self, chunk, fields): rv = {} - if len(chunk.objs) == 0: return rv + if len(chunk.objs) == 0: return rv for g in chunk.objs: rv[g.id] = {} - for field in fields: - ds = self._handle[ "/Data/%s" % field[1] ] + # Split into particles and non-particles + fluid_fields, particle_fields = [], [] + for ftype, fname in fields: + if ftype in self.ds.particle_types: + particle_fields.append( (ftype, fname) ) + else: + fluid_fields.append( (ftype, fname) ) + + # particles + if len(particle_fields) > 0: + selector = AlwaysSelector(self.ds) + rv.update( self._read_particle_selection( + [chunk], selector, particle_fields) ) + + # fluid + if len(fluid_fields) == 0: return rv + + for field in fluid_fields: + ds = self._group_grid[ field[1] ] for gs in grid_sequences(chunk.objs): start = gs[ 0].id diff -Nru yt-3.3.3/yt/frontends/gamer/tests/test_outputs.py yt-3.4.0/yt/frontends/gamer/tests/test_outputs.py --- yt-3.3.3/yt/frontends/gamer/tests/test_outputs.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/gamer/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -34,7 +34,7 @@ @requires_ds(jet, big_data=True) def test_jet(): ds = data_dir_load(jet, kwargs={"units_override":jet_units}) - yield assert_equal, str(ds), "jet_000002" + assert_equal(str(ds), "jet_000002") for test in small_patch_amr(ds, _fields_jet): test_jet.__name__ = test.description yield test @@ -46,12 +46,24 @@ @requires_ds(psiDM, big_data=True) def test_psiDM(): ds = data_dir_load(psiDM) - yield assert_equal, str(ds), "psiDM_000020" + assert_equal(str(ds), "psiDM_000020") for test in small_patch_amr(ds, _fields_psiDM): test_psiDM.__name__ = test.description yield test +plummer = "Plummer/plummer_000000" +_fields_plummer = ( ("gamer","ParDens"), ("deposit","io_cic") ) + +@requires_ds(plummer, big_data=True) +def test_plummer(): + ds = data_dir_load(plummer) + assert_equal(str(ds), "plummer_000000") + for test in small_patch_amr(ds, _fields_plummer): + test_plummer.__name__ = test.description + yield test + + @requires_file(psiDM) def test_GAMERDataset(): assert isinstance(data_dir_load(psiDM), GAMERDataset) @@ -59,5 +71,4 @@ @requires_file(jet) def test_units_override(): - for test in units_override_check(jet): - yield test + units_override_check(jet) diff -Nru yt-3.3.3/yt/frontends/gdf/data_structures.py yt-3.4.0/yt/frontends/gdf/data_structures.py --- yt-3.3.3/yt/frontends/gdf/data_structures.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/gdf/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -32,6 +32,8 @@ dimensionless as sympy_one from yt.units.unit_object import \ Unit +from yt.units.unit_systems import \ + unit_system_registry from yt.utilities.exceptions import \ YTGDFUnknownGeometry from yt.utilities.lib.misc_utilities import \ @@ -222,9 +224,12 @@ # comparisons are insufficient unit = Unit(unit, registry=self.unit_registry) if unit_name.endswith('_unit') and unit.dimensions is sympy_one: + # Catch code units and if they are dimensionless, + # assign CGS units. setdefaultattr will catch code units + # which have already been set via units_override. un = unit_name[:-5] un = un.replace('magnetic', 'magnetic_field', 1) - unit = self.unit_system[un] + unit = unit_system_registry["cgs"][un] setdefaultattr(self, unit_name, self.quan(value, unit)) setdefaultattr(self, unit_name, self.quan(value, unit)) if unit_name in h5f["/field_types"]: diff -Nru yt-3.3.3/yt/frontends/gdf/io.py yt-3.4.0/yt/frontends/gdf/io.py --- yt-3.3.3/yt/frontends/gdf/io.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/gdf/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -17,6 +17,7 @@ from yt.utilities.on_demand_imports import _h5py as h5py from yt.funcs import \ mylog +from yt.geometry.selection_routines import GridSelector from yt.utilities.io_handler import \ BaseIOHandler @@ -40,7 +41,7 @@ rv = {} chunks = list(chunks) - if selector.__class__.__name__ == "GridSelector": + if isinstance(selector, GridSelector): if not (len(chunks) == len(chunks[0].objs) == 1): raise RuntimeError grid = chunks[0].objs[0] diff -Nru yt-3.3.3/yt/frontends/gdf/tests/test_outputs.py yt-3.4.0/yt/frontends/gdf/tests/test_outputs.py --- yt-3.3.3/yt/frontends/gdf/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/gdf/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -30,7 +30,7 @@ @requires_ds(sedov) def test_sedov_tunnel(): ds = data_dir_load(sedov) - yield assert_equal, str(ds), "sedov_tst_0004" + assert_equal(str(ds), "sedov_tst_0004") for test in small_patch_amr(ds, _fields): test_sedov_tunnel.__name__ = test.description yield test @@ -43,5 +43,4 @@ @requires_file(sedov) def test_units_override(): - for test in units_override_check(sedov): - yield test + units_override_check(sedov) diff -Nru yt-3.3.3/yt/frontends/gizmo/fields.py yt-3.4.0/yt/frontends/gizmo/fields.py --- yt-3.3.3/yt/frontends/gizmo/fields.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/gizmo/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -84,8 +84,8 @@ self.add_field( (ptype, "H_density"), + sampling_type="particle", function=_h_density, - particle_type=True, units=self.ds.unit_system["density"]) add_species_field_by_density(self, ptype, "H", particle_type=True) for suffix in ["density", "fraction", "mass", "number_density"]: @@ -99,8 +99,8 @@ self.add_field( (ptype, "H_p1_density"), + sampling_type="particle", function=_h_p1_density, - particle_type=True, units=self.ds.unit_system["density"]) add_species_field_by_density(self, ptype, "H_p1", particle_type=True) @@ -122,8 +122,8 @@ for species in self.nuclei_names: self.add_field( (ptype, "%s_nuclei_mass_density" % species), + sampling_type="particle", function=_nuclei_mass_density_field, - particle_type=True, units=self.ds.unit_system["density"]) for suf in ["_nuclei_mass_density", "_metallicity"]: diff -Nru yt-3.3.3/yt/frontends/halo_catalog/data_structures.py yt-3.4.0/yt/frontends/halo_catalog/data_structures.py --- yt-3.3.3/yt/frontends/halo_catalog/data_structures.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/halo_catalog/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -16,34 +16,51 @@ from yt.utilities.on_demand_imports import _h5py as h5py import numpy as np -import stat import glob -import os from .fields import \ HaloCatalogFieldInfo +from yt.frontends.ytdata.data_structures import \ + SavedDataset from yt.funcs import \ - setdefaultattr + parse_h5_attr from yt.geometry.particle_geometry_handler import \ ParticleIndex from yt.data_objects.static_output import \ - Dataset, \ ParticleFile - + +class HaloCatalogParticleIndex(ParticleIndex): + def _setup_filenames(self): + template = self.dataset.filename_template + ndoms = self.dataset.file_count + cls = self.dataset._file_class + if ndoms > 1: + self.data_files = \ + [cls(self.dataset, self.io, template % {'num':i}, i) + for i in range(ndoms)] + else: + self.data_files = \ + [cls(self.dataset, self.io, + self.dataset.parameter_filename, 0)] + class HaloCatalogHDF5File(ParticleFile): def __init__(self, ds, io, filename, file_id): with h5py.File(filename, "r") as f: - self.header = dict((field, f.attrs[field]) \ + self.header = dict((field, parse_h5_attr(f, field)) \ for field in f.attrs.keys()) super(HaloCatalogHDF5File, self).__init__(ds, io, filename, file_id) -class HaloCatalogDataset(Dataset): +class HaloCatalogDataset(SavedDataset): _index_class = ParticleIndex _file_class = HaloCatalogHDF5File _field_info_class = HaloCatalogFieldInfo _suffix = ".h5" + _con_attrs = ("cosmological_simulation", + "current_time", "current_redshift", + "hubble_constant", "omega_matter", "omega_lambda", + "domain_left_edge", "domain_right_edge") def __init__(self, filename, dataset_type="halocatalog_hdf5", n_ref = 16, over_refine_factor = 1, units_override=None, @@ -55,39 +72,23 @@ unit_system=unit_system) def _parse_parameter_file(self): - with h5py.File(self.parameter_filename, "r") as f: - hvals = dict((key, f.attrs[key]) for key in f.attrs.keys()) - self.dimensionality = 3 self.refine_by = 2 - self.unique_identifier = \ - int(os.stat(self.parameter_filename)[stat.ST_CTIME]) + self.dimensionality = 3 + nz = 1 << self.over_refine_factor + self.domain_dimensions = np.ones(self.dimensionality, "int32") * nz + self.periodicity = (True, True, True) prefix = ".".join(self.parameter_filename.rsplit(".", 2)[:-2]) self.filename_template = "%s.%%(num)s%s" % (prefix, self._suffix) self.file_count = len(glob.glob(prefix + "*" + self._suffix)) - - for attr in ["cosmological_simulation", "current_time", "current_redshift", - "hubble_constant", "omega_matter", "omega_lambda", - "domain_left_edge", "domain_right_edge"]: - setattr(self, attr, hvals[attr]) - self.periodicity = (True, True, True) self.particle_types = ("halos") self.particle_types_raw = ("halos") - - nz = 1 << self.over_refine_factor - self.domain_dimensions = np.ones(3, "int32") * nz - self.parameters.update(hvals) - - def _set_code_unit_attributes(self): - setdefaultattr(self, 'length_unit', self.quan(1.0, "cm")) - setdefaultattr(self, 'mass_unit', self.quan(1.0, "g")) - setdefaultattr(self, 'velocity_unit', self.quan(1.0, "cm / s")) - setdefaultattr(self, 'time_unit', self.quan(1.0, "s")) + super(HaloCatalogDataset, self)._parse_parameter_file() @classmethod def _is_valid(self, *args, **kwargs): if not args[0].endswith(".h5"): return False with h5py.File(args[0], "r") as f: if "data_type" in f.attrs and \ - f.attrs["data_type"] == "halo_catalog": + parse_h5_attr(f, "data_type") == "halo_catalog": return True return False diff -Nru yt-3.3.3/yt/frontends/halo_catalog/io.py yt-3.4.0/yt/frontends/halo_catalog/io.py --- yt-3.3.3/yt/frontends/halo_catalog/io.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/frontends/halo_catalog/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -18,7 +18,9 @@ import numpy as np from yt.utilities.exceptions import YTDomainOverflow -from yt.funcs import mylog +from yt.funcs import \ + mylog, \ + parse_h5_attr from yt.utilities.io_handler import \ BaseIOHandler @@ -42,11 +44,13 @@ for chunk in chunks: for obj in chunk.objs: data_files.update(obj.data_files) + pn = "particle_position_%s" for data_file in sorted(data_files): with h5py.File(data_file.filename, "r") as f: - x = f['particle_position_x'].value.astype("float64") - y = f['particle_position_y'].value.astype("float64") - z = f['particle_position_z'].value.astype("float64") + units = parse_h5_attr(f[pn % "x"], "units") + x, y, z = \ + (self.ds.arr(f[pn % ax].value.astype("float64"), units) + for ax in "xyz") yield "halos", (x, y, z) def _read_particle_fields(self, chunks, ptf, selector): @@ -59,12 +63,14 @@ for chunk in chunks: for obj in chunk.objs: data_files.update(obj.data_files) + pn = "particle_position_%s" for data_file in sorted(data_files): with h5py.File(data_file.filename, "r") as f: for ptype, field_list in sorted(ptf.items()): - x = f['particle_position_x'].value.astype("float64") - y = f['particle_position_y'].value.astype("float64") - z = f['particle_position_z'].value.astype("float64") + units = parse_h5_attr(f[pn % "x"], "units") + x, y, z = \ + (self.ds.arr(f[pn % ax].value.astype("float64"), units) + for ax in "xyz") mask = selector.select_points(x, y, z, 0.0) del x, y, z if mask is None: continue @@ -78,31 +84,31 @@ mylog.debug("Initializing index % 5i (% 7i particles)", data_file.file_id, pcount) ind = 0 + if pcount == 0: return None with h5py.File(data_file.filename, "r") as f: if not f.keys(): return None pos = np.empty((pcount, 3), dtype="float64") - pos = data_file.ds.arr(pos, "code_length") + units = parse_h5_attr(f["particle_position_x"], "units") dx = np.finfo(f['particle_position_x'].dtype).eps - dx = 2.0*self.ds.quan(dx, "code_length") + dx = 2.0 * self.ds.quan(dx, units).to("code_length") pos[:,0] = f["particle_position_x"].value pos[:,1] = f["particle_position_y"].value pos[:,2] = f["particle_position_z"].value + pos = data_file.ds.arr(pos, units). to("code_length") + dle = self.ds.domain_left_edge.to("code_length") + dre = self.ds.domain_right_edge.to("code_length") # These are 32 bit numbers, so we give a little lee-way. # Otherwise, for big sets of particles, we often will bump into the # domain edges. This helps alleviate that. - np.clip(pos, self.ds.domain_left_edge + dx, - self.ds.domain_right_edge - dx, pos) - if np.any(pos.min(axis=0) < self.ds.domain_left_edge) or \ - np.any(pos.max(axis=0) > self.ds.domain_right_edge): + np.clip(pos, dle + dx, dre - dx, pos) + if np.any(pos.min(axis=0) < dle) or \ + np.any(pos.max(axis=0) > dre): raise YTDomainOverflow(pos.min(axis=0), pos.max(axis=0), - self.ds.domain_left_edge, - self.ds.domain_right_edge) + dle, dre) regions.add_data_file(pos, data_file.file_id) morton[ind:ind+pos.shape[0]] = compute_morton( - pos[:,0], pos[:,1], pos[:,2], - data_file.ds.domain_left_edge, - data_file.ds.domain_right_edge) + pos[:,0], pos[:,1], pos[:,2], dle, dre) return morton def _count_particles(self, data_file): @@ -111,6 +117,7 @@ def _identify_fields(self, data_file): with h5py.File(data_file.filename, "r") as f: fields = [("halos", field) for field in f] - units = dict([(("halos", field), - f[field].attrs["units"]) for field in f]) + units = dict([(("halos", field), + parse_h5_attr(f[field], "units")) + for field in f]) return fields, units diff -Nru yt-3.3.3/yt/frontends/http_stream/data_structures.py yt-3.4.0/yt/frontends/http_stream/data_structures.py --- yt-3.3.3/yt/frontends/http_stream/data_structures.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/http_stream/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -20,9 +20,8 @@ import time from yt.data_objects.static_output import \ + ParticleDataset, \ ParticleFile -from yt.frontends.sph.data_structures import \ - ParticleDataset from yt.frontends.sph.fields import \ SPHFieldInfo from yt.funcs import \ @@ -43,17 +42,15 @@ filename_template = "" def __init__(self, base_url, - dataset_type = "http_particle_stream", - n_ref = 64, over_refine_factor=1, - unit_system="cgs"): + dataset_type="http_particle_stream", unit_system="cgs", + n_ref=64, over_refine_factor=1): if get_requests() is None: raise ImportError( "This functionality depends on the requests package") self.base_url = base_url - self.n_ref = n_ref - self.over_refine_factor = over_refine_factor - super(HTTPStreamDataset, self).__init__("", dataset_type, - unit_system=unit_system) + super(HTTPStreamDataset, self).__init__( + "", dataset_type=dataset_type, unit_system=unit_system, + n_ref=n_ref, over_refine_factor=over_refine_factor) def __repr__(self): return self.base_url diff -Nru yt-3.3.3/yt/frontends/moab/tests/test_c5.py yt-3.4.0/yt/frontends/moab/tests/test_c5.py --- yt-3.3.3/yt/frontends/moab/tests/test_c5.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/moab/tests/test_c5.py 2017-08-10 18:02:57.000000000 +0000 @@ -35,26 +35,26 @@ def test_cantor_5(): np.random.seed(0x4d3d3d3) ds = data_dir_load(c5) - yield assert_equal, str(ds), "c5" + assert_equal(str(ds), "c5") dso = [ None, ("sphere", ("c", (0.1, 'unitary'))), ("sphere", ("c", (0.2, 'unitary')))] dd = ds.all_data() - yield assert_almost_equal, ds.index.get_smallest_dx(), 0.00411522633744843, 10 - yield assert_equal, dd["x"].shape[0], 63*63*63 - yield assert_almost_equal, \ - dd["cell_volume"].in_units("code_length**3").sum(dtype="float64").d, \ - 1.0, 10 + assert_almost_equal(ds.index.get_smallest_dx(), 0.00411522633744843, 10) + assert_equal(dd["x"].shape[0], 63*63*63) + assert_almost_equal( + dd["cell_volume"].in_units("code_length**3").sum(dtype="float64").d, + 1.0, 10) for offset_1 in [1e-9, 1e-4, 0.1]: for offset_2 in [1e-9, 1e-4, 0.1]: DLE = ds.domain_left_edge DRE = ds.domain_right_edge ray = ds.ray(DLE + offset_1 * DLE.uq, DRE - offset_2 * DRE.uq) - yield assert_almost_equal, ray["dts"].sum(dtype="float64"), 1.0, 8 + assert_almost_equal(ray["dts"].sum(dtype="float64"), 1.0, 8) for i, p1 in enumerate(np.random.random((5, 3))): for j, p2 in enumerate(np.random.random((5, 3))): ray = ds.ray(p1, p2) - yield assert_almost_equal, ray["dts"].sum(dtype="float64"), 1.0, 8 + assert_almost_equal(ray["dts"].sum(dtype="float64"), 1.0, 8) for field in _fields: for dobj_name in dso: yield FieldValuesTest(c5, field, dobj_name) @@ -66,5 +66,4 @@ @requires_file(c5) def test_units_override(): - for test in units_override_check(c5): - yield test + units_override_check(c5) diff -Nru yt-3.3.3/yt/frontends/open_pmd/api.py yt-3.4.0/yt/frontends/open_pmd/api.py --- yt-3.3.3/yt/frontends/open_pmd/api.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/open_pmd/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,29 @@ +""" +API for yt.frontends.open_pmd + + + +""" + +# ----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# Copyright (c) 2015, Daniel Grassinger (HZDR) +# Copyright (c) 2016, Fabian Koller (HZDR) +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +# ----------------------------------------------------------------------------- + +from .data_structures import \ + OpenPMDDataset, \ + OpenPMDGrid, \ + OpenPMDHierarchy + +from .fields import \ + OpenPMDFieldInfo + +from .io import \ + IOHandlerOpenPMDHDF5 + +from . import \ + tests diff -Nru yt-3.3.3/yt/frontends/open_pmd/data_structures.py yt-3.4.0/yt/frontends/open_pmd/data_structures.py --- yt-3.3.3/yt/frontends/open_pmd/data_structures.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/open_pmd/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,519 @@ +""" +openPMD data structures + + +""" + +# ----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# Copyright (c) 2015, Daniel Grassinger (HZDR) +# Copyright (c) 2016, Fabian Koller (HZDR) +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +# ----------------------------------------------------------------------------- + +from distutils.version import StrictVersion +from functools import reduce +from operator import mul +from os import \ + path, \ + listdir +from re import match + +import numpy as np +from yt.data_objects.grid_patch import AMRGridPatch +from yt.data_objects.static_output import Dataset +from yt.frontends.open_pmd.fields import OpenPMDFieldInfo +from yt.frontends.open_pmd.misc import \ + is_const_component, \ + get_component +from yt.funcs import setdefaultattr +from yt.geometry.grid_geometry_handler import GridIndex +from yt.utilities.file_handler import HDF5FileHandler, \ + warn_h5py +from yt.utilities.logger import ytLogger as mylog +from yt.utilities.on_demand_imports import _h5py as h5 + + +class OpenPMDGrid(AMRGridPatch): + """Represents chunk of data on-disk. + + This defines the index and offset for every mesh and particle type. + It also defines parents and children grids. Since openPMD does not have multiple levels of refinement, + there are no parents or children for any grid. + """ + _id_offset = 0 + __slots__ = ["_level_id"] + # Every particle species and mesh might have different hdf5-indices and offsets + ftypes=[] + ptypes=[] + findex = 0 + foffset = 0 + pindex = 0 + poffset = 0 + + def __init__(self, gid, index, level=-1, fi=0, fo=0, pi=0, po=0, ft=[], pt=[]): + AMRGridPatch.__init__(self, gid, filename=index.index_filename, + index=index) + self.findex = fi + self.foffset = fo + self.pindex = pi + self.poffset = po + self.ftypes = ft + self.ptypes = pt + self.Parent = None + self.Children = [] + self.Level = level + + def __repr__(self): + return "OpenPMDGrid_%04i (%s)" % (self.id, self.ActiveDimensions) + + +class OpenPMDHierarchy(GridIndex): + """Defines which fields and particles are created and read from disk. + + Furthermore it defines the characteristics of the grids. + """ + grid = OpenPMDGrid + + def __init__(self, ds, dataset_type="openPMD"): + self.dataset_type = dataset_type + self.dataset = ds + self.index_filename = ds.parameter_filename + self.directory = path.dirname(self.index_filename) + GridIndex.__init__(self, ds, dataset_type) + + def _get_particle_type_counts(self): + """Reads the active number of particles for every species. + + Returns + ------- + dict + keys are ptypes + values are integer counts of the ptype + """ + result = {} + f = self.dataset._handle + bp = self.dataset.base_path + pp = self.dataset.particles_path + for ptype in self.ds.particle_types_raw: + if str(ptype) == "io": + spec = list(f[bp + pp].keys())[0] + else: + spec = ptype + axis = list(f[bp + pp + "/" + spec + "/position"].keys())[0] + pos = f[bp + pp + "/" + spec + "/position/" + axis] + if is_const_component(pos): + result[ptype] = pos.attrs["shape"] + else: + result[ptype] = pos.len() + return result + + def _detect_output_fields(self): + """Populates ``self.field_list`` with native fields (mesh and particle) on disk. + + Each entry is a tuple of two strings. The first element is the on-disk fluid type or particle type. + The second element is the name of the field in yt. This string is later used for accessing the data. + Convention suggests that the on-disk fluid type should be "openPMD", + the on-disk particle type (for a single species of particles) is "io" + or (for multiple species of particles) the particle name on-disk. + """ + f = self.dataset._handle + bp = self.dataset.base_path + mp = self.dataset.meshes_path + pp = self.dataset.particles_path + + mesh_fields = [] + try: + for field in f[bp + mp].keys(): + try: + for axis in f[bp + mp + field].keys(): + mesh_fields.append(field.replace("_", "-") + + "_" + axis) + except AttributeError: + # This is a h5.Dataset (i.e. no axes) + mesh_fields.append(field.replace("_", "-")) + except KeyError: + # There are no mesh fields + pass + self.field_list = [("openPMD", str(field)) for field in mesh_fields] + + particle_fields = [] + try: + for species in f[bp + pp].keys(): + for record in f[bp + pp + species].keys(): + if is_const_component(f[bp + pp + species + "/" + record]): + # Record itself (e.g. particle_mass) is constant + particle_fields.append(species.replace("_", "-") + + "_" + record.replace("_", "-")) + elif "particlePatches" not in record: + try: + # Create a field for every axis (x,y,z) of every property (position) + # of every species (electrons) + axes = list(f[bp + pp + species + "/" + record].keys()) + if str(record) == "position": + record = "positionCoarse" + for axis in axes: + particle_fields.append(species.replace("_", "-") + + "_" + record.replace("_", "-") + + "_" + axis) + except AttributeError: + # Record is a dataset, does not have axes (e.g. weighting) + particle_fields.append(species.replace("_", "-") + + "_" + record.replace("_", "-")) + pass + else: + pass + if len(list(f[bp + pp].keys())) > 1: + # There is more than one particle species, use the specific names as field types + self.field_list.extend( + [(str(field).split("_")[0], + ("particle_" + "_".join(str(field).split("_")[1:]))) for field in particle_fields]) + else: + # Only one particle species, fall back to "io" + self.field_list.extend( + [("io", + ("particle_" + "_".join(str(field).split("_")[1:]))) for field in particle_fields]) + except KeyError: + # There are no particle fields + pass + + def _count_grids(self): + """Sets ``self.num_grids`` to be the total number of grids in the simulation. + + The number of grids is determined by their respective memory footprint. + """ + f = self.dataset._handle + bp = self.dataset.base_path + mp = self.dataset.meshes_path + pp = self.dataset.particles_path + + self.meshshapes = {} + self.numparts = {} + + self.num_grids = 0 + + for mesh in f[bp + mp].keys(): + if type(f[bp + mp + mesh]) is h5.Group: + shape = f[bp + mp + mesh + "/" + list(f[bp + mp + mesh].keys())[0]].shape + else: + shape = f[bp + mp + mesh].shape + spacing = tuple(f[bp + mp + mesh].attrs["gridSpacing"]) + offset = tuple(f[bp + mp + mesh].attrs["gridGlobalOffset"]) + unit_si = f[bp + mp + mesh].attrs["gridUnitSI"] + self.meshshapes[mesh] = (shape, spacing, offset, unit_si) + for species in f[bp + pp].keys(): + if "particlePatches" in f[bp + pp + "/" + species].keys(): + for (patch, size) in enumerate(f[bp + pp + "/" + species + "/particlePatches/numParticles"]): + self.numparts[species + "#" + str(patch)] = size + else: + axis = list(f[bp + pp + species + "/position"].keys())[0] + if is_const_component(f[bp + pp + species + "/position/" + axis]): + self.numparts[species] = f[bp + pp + species + "/position/" + axis].attrs["shape"] + else: + self.numparts[species] = f[bp + pp + species + "/position/" + axis].len() + + # Limit values per grid by resulting memory footprint + self.vpg = int(self.dataset.gridsize / 4) # 4Byte per value (f32) + + # Meshes of the same size do not need separate chunks + for (shape, spacing, offset, unit_si) in set(self.meshshapes.values()): + self.num_grids += min(shape[0], int(np.ceil(reduce(mul, shape) * self.vpg**-1))) + + # Same goes for particle chunks if they are not inside particlePatches + patches = {} + no_patches = {} + for (k, v) in self.numparts.items(): + if "#" in k: + patches[k] = v + else: + no_patches[k] = v + for size in set(no_patches.values()): + self.num_grids += int(np.ceil(size * self.vpg ** -1)) + for size in patches.values(): + self.num_grids += int(np.ceil(size * self.vpg ** -1)) + + def _parse_index(self): + """Fills each grid with appropriate properties (extent, dimensions, ...) + + This calculates the properties of every OpenPMDGrid based on the total number of grids in the simulation. + The domain is divided into ``self.num_grids`` (roughly) equally sized chunks along the x-axis. + ``grid_levels`` is always equal to 0 since we only have one level of refinement in openPMD. + + Notes + ----- + ``self.grid_dimensions`` is rounded to the nearest integer. Grid edges are calculated from this dimension. + Grids with dimensions [0, 0, 0] are particle only. The others do not have any particles affiliated with them. + """ + f = self.dataset._handle + bp = self.dataset.base_path + pp = self.dataset.particles_path + + self.grid_levels.flat[:] = 0 + self.grids = np.empty(self.num_grids, dtype="object") + + grid_index_total = 0 + + # Mesh grids + for mesh in set(self.meshshapes.values()): + (shape, spacing, offset, unit_si) = mesh + shape = np.asarray(shape) + spacing = np.asarray(spacing) + offset = np.asarray(offset) + # Total dimension of this grid + domain_dimension = np.asarray(shape, dtype=np.int32) + domain_dimension = np.append(domain_dimension, np.ones(3 - len(domain_dimension))) + # Number of grids of this shape + num_grids = min(shape[0], int(np.ceil(reduce(mul, shape) * self.vpg ** -1))) + gle = offset * unit_si # self.dataset.domain_left_edge + gre = domain_dimension[:spacing.size] * unit_si * spacing + gle # self.dataset.domain_right_edge + gle = np.append(gle, np.zeros(3 - len(gle))) + gre = np.append(gre, np.ones(3 - len(gre))) + grid_dim_offset = np.linspace(0, domain_dimension[0], num_grids + 1, dtype=np.int32) + grid_edge_offset = grid_dim_offset * np.float(domain_dimension[0]) ** -1 * (gre[0] - gle[0]) + gle[0] + mesh_names = [] + for (mname, mdata) in self.meshshapes.items(): + if mesh == mdata: + mesh_names.append(str(mname)) + prev = 0 + for grid in np.arange(num_grids): + self.grid_dimensions[grid_index_total] = domain_dimension + self.grid_dimensions[grid_index_total][0] = grid_dim_offset[grid + 1] - grid_dim_offset[grid] + self.grid_left_edge[grid_index_total] = gle + self.grid_left_edge[grid_index_total][0] = grid_edge_offset[grid] + self.grid_right_edge[grid_index_total] = gre + self.grid_right_edge[grid_index_total][0] = grid_edge_offset[grid + 1] + self.grid_particle_count[grid_index_total] = 0 + self.grids[grid_index_total] = self.grid(grid_index_total, self, 0, + fi=prev, + fo=self.grid_dimensions[grid_index_total][0], + ft=mesh_names) + prev += self.grid_dimensions[grid_index_total][0] + grid_index_total += 1 + + handled_ptypes = [] + + # Particle grids + for (species, count) in self.numparts.items(): + if "#" in species: + # This is a particlePatch + spec = species.split("#") + patch = f[bp + pp + "/" + spec[0] + "/particlePatches"] + num_grids = int(np.ceil(count * self.vpg ** -1)) + gle = [] + for axis in patch["offset"].keys(): + gle.append(get_component(patch, "offset/" + axis, int(spec[1]), 1)[0]) + gle = np.asarray(gle) + gle = np.append(gle, np.zeros(3 - len(gle))) + gre = [] + for axis in patch["extent"].keys(): + gre.append(get_component(patch, "extent/" + axis, int(spec[1]), 1)[0]) + gre = np.asarray(gre) + gre = np.append(gre, np.ones(3 - len(gre))) + np.add(gle, gre, gre) + npo = patch["numParticlesOffset"].value.item(int(spec[1])) + particle_count = np.linspace(npo, npo + count, num_grids + 1, + dtype=np.int32) + particle_names = [str(spec[0])] + elif str(species) not in handled_ptypes: + num_grids = int(np.ceil(count * self.vpg ** -1)) + gle = self.dataset.domain_left_edge + gre = self.dataset.domain_right_edge + particle_count = np.linspace(0, count, num_grids + 1, dtype=np.int32) + particle_names = [] + for (pname, size) in self.numparts.items(): + if size == count: + # Since this is not part of a particlePatch, we can include multiple same-sized ptypes + particle_names.append(str(pname)) + handled_ptypes.append(str(pname)) + else: + # A grid with this exact particle count has already been created + continue + for grid in np.arange(num_grids): + self.grid_dimensions[grid_index_total] = [0, 0, 0] # Counted as mesh-size, thus no dimensional extent + self.grid_left_edge[grid_index_total] = gle + self.grid_right_edge[grid_index_total] = gre + self.grid_particle_count[grid_index_total] = (particle_count[grid + 1] - particle_count[grid]) * len( + particle_names) + self.grids[grid_index_total] = self.grid(grid_index_total, self, 0, + pi=particle_count[grid], + po=particle_count[grid + 1] - particle_count[grid], + pt=particle_names) + grid_index_total += 1 + + def _populate_grid_objects(self): + """This initializes all grids. + + Additionally, it should set up Children and Parent lists on each grid object. + openPMD is not adaptive and thus there are no Children and Parents for any grid. + """ + for i in np.arange(self.num_grids): + self.grids[i]._prepare_grid() + self.grids[i]._setup_dx() + self.max_level = 0 + + +class OpenPMDDataset(Dataset): + """Contains all the required information of a single iteration of the simulation. + + Notes + ----- + It is assumed that all meshes cover the same region. Their resolution can be different. + It is assumed that all particles reside in this same region exclusively. + It is assumed that the particle and mesh positions are *absolute* with respect to the simulation origin. + """ + _index_class = OpenPMDHierarchy + _field_info_class = OpenPMDFieldInfo + + def __init__(self, + filename, + dataset_type="openPMD", + storage_filename=None, + units_override=None, + unit_system="mks", + **kwargs): + self._handle = HDF5FileHandler(filename) + self.gridsize = kwargs.pop("open_pmd_virtual_gridsize", 10**9) + self._set_paths(self._handle, path.dirname(filename)) + Dataset.__init__(self, + filename, + dataset_type, + units_override=units_override, + unit_system=unit_system) + self.storage_filename = storage_filename + self.fluid_types += ("openPMD",) + particles = tuple(str(c) for c in self._handle[self.base_path + self.particles_path].keys()) + if len(particles) > 1: + # Only use on-disk particle names if there is more than one species + self.particle_types = particles + mylog.debug("open_pmd - self.particle_types: {}".format(self.particle_types)) + self.particle_types_raw = self.particle_types + self.particle_types = tuple(self.particle_types) + + def _set_paths(self, handle, path): + """Parses relevant hdf5-paths out of ``handle``. + + Parameters + ---------- + handle : h5py.File + path : str + (absolute) filepath for current hdf5 container + """ + iterations = [] + encoding = handle.attrs["iterationEncoding"].decode() + if "groupBased" in encoding: + iterations = list(handle["/data"].keys()) + mylog.info("open_pmd - found {} iterations in file".format(len(iterations))) + elif "fileBased" in encoding: + itformat = handle.attrs["iterationFormat"].decode().split("/")[-1] + regex = "^" + itformat.replace("%T", "[0-9]+") + "$" + if path is "": + mylog.warning("open_pmd - For file based iterations, please use absolute file paths!") + pass + for filename in listdir(path): + if match(regex, filename): + iterations.append(filename) + mylog.info("open_pmd - found {} iterations in directory".format(len(iterations))) + + if len(iterations) == 0: + mylog.warning("open_pmd - no iterations found!") + if "groupBased" in encoding and len(iterations) > 1: + mylog.warning("open_pmd - only choose to load one iteration ({})".format(list(handle["/data"].keys())[0])) + + self.base_path = "/data/{}/".format(list(handle["/data"].keys())[0]) + self.meshes_path = self._handle["/"].attrs["meshesPath"].decode() + self.particles_path = self._handle["/"].attrs["particlesPath"].decode() + + def _set_code_unit_attributes(self): + """Handle conversion between different physical units and the code units. + + Every dataset in openPMD can have different code <-> physical scaling. + The individual factor is obtained by multiplying with "unitSI" reading getting data from disk. + """ + setdefaultattr(self, "length_unit", self.quan(1.0, "m")) + setdefaultattr(self, "mass_unit", self.quan(1.0, "kg")) + setdefaultattr(self, "time_unit", self.quan(1.0, "s")) + setdefaultattr(self, "velocity_unit", self.quan(1.0, "m/s")) + setdefaultattr(self, "magnetic_unit", self.quan(1.0, "T")) + + def _parse_parameter_file(self): + """Read in metadata describing the overall data on-disk. + """ + f = self._handle + bp = self.base_path + mp = self.meshes_path + + self.unique_identifier = 0 + self.parameters = 0 + self.periodicity = np.zeros(3, dtype=np.bool) + self.refine_by = 1 + self.cosmological_simulation = 0 + + try: + shapes = {} + left_edges = {} + right_edges = {} + for mesh in f[bp + mp].keys(): + if type(f[bp + mp + mesh]) is h5.Group: + shape = np.asarray(f[bp + mp + mesh + "/" + list(f[bp + mp + mesh].keys())[0]].shape) + else: + shapes[mesh] = np.asarray(f[bp + mp + mesh].shape) + spacing = np.asarray(f[bp + mp + mesh].attrs["gridSpacing"]) + offset = np.asarray(f[bp + mp + mesh].attrs["gridGlobalOffset"]) + unit_si = np.asarray(f[bp + mp + mesh].attrs["gridUnitSI"]) + le = offset * unit_si + re = le + shape * unit_si * spacing + shapes[mesh] = shape + left_edges[mesh] = le + right_edges[mesh] = re + lowest_dim = np.min([len(i) for i in shapes.values()]) + shapes = np.asarray([i[:lowest_dim] for i in shapes.values()]) + left_edges = np.asarray([i[:lowest_dim] for i in left_edges.values()]) + right_edges = np.asarray([i[:lowest_dim] for i in right_edges.values()]) + fs = [] + dle = [] + dre = [] + for i in np.arange(lowest_dim): + fs.append(np.max(shapes.transpose()[i])) + dle.append(np.min(left_edges.transpose()[i])) + dre.append(np.min(right_edges.transpose()[i])) + self.dimensionality = len(fs) + self.domain_dimensions = np.append(fs, np.ones(3 - self.dimensionality)) + self.domain_left_edge = np.append(dle, np.zeros(3 - len(dle))) + self.domain_right_edge = np.append(dre, np.ones(3 - len(dre))) + except ValueError: + mylog.warning("open_pmd - It seems your data does not contain meshes. Assuming domain extent of 1m^3!") + self.dimensionality = 3 + self.domain_dimensions = np.ones(3, dtype=np.float64) + self.domain_left_edge = np.zeros(3, dtype=np.float64) + self.domain_right_edge = np.ones(3, dtype=np.float64) + + self.current_time = f[bp].attrs["time"] * f[bp].attrs["timeUnitSI"] + + @classmethod + def _is_valid(self, *args, **kwargs): + """Checks whether the supplied file can be read by this frontend. + """ + warn_h5py(args[0]) + try: + f = h5.File(args[0], "r") + except (IOError, OSError, ImportError): + return False + + requirements = ["openPMD", "basePath", "meshesPath", "particlesPath"] + attrs = list(f["/"].attrs.keys()) + for i in requirements: + if i not in attrs: + f.close() + return False + + known_versions = [StrictVersion("1.0.0"), + StrictVersion("1.0.1")] + if StrictVersion(f.attrs["openPMD"].decode()) in known_versions: + f.close() + return True + else: + f.close() + return False diff -Nru yt-3.3.3/yt/frontends/open_pmd/fields.py yt-3.4.0/yt/frontends/open_pmd/fields.py --- yt-3.3.3/yt/frontends/open_pmd/fields.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/open_pmd/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,216 @@ +""" +openPMD-specific fields + + + +""" + +# ----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# Copyright (c) 2015, Daniel Grassinger (HZDR) +# Copyright (c) 2016, Fabian Koller (HZDR) +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +# ----------------------------------------------------------------------------- + +import numpy as np + +from yt.fields.field_info_container import FieldInfoContainer +from yt.fields.magnetic_field import setup_magnetic_field_aliases +from yt.frontends.open_pmd.misc import \ + parse_unit_dimension, \ + is_const_component +from yt.units.yt_array import YTQuantity +from yt.utilities.logger import ytLogger as mylog +from yt.utilities.on_demand_imports import _h5py as h5 +from yt.utilities.physical_constants import \ + speed_of_light, \ + mu_0 + + +def setup_poynting_vector(self): + def _get_poyn(axis): + def poynting(field, data): + u = mu_0**-1 + if axis in "x": + return u * (data["E_y"] * data["magnetic_field_z"] - data["E_z"] * data["magnetic_field_y"]) + elif axis in "y": + return u * (data["E_z"] * data["magnetic_field_x"] - data["E_x"] * data["magnetic_field_z"]) + elif axis in "z": + return u * (data["E_x"] * data["magnetic_field_y"] - data["E_y"] * data["magnetic_field_x"]) + + return poynting + + for ax in "xyz": + self.add_field(("openPMD", "poynting_vector_%s" % ax), sampling_type="cell", + function=_get_poyn(ax), + units="W/m**2") + + +def setup_kinetic_energy(self, ptype): + def _kin_en(field, data): + p2 = (data[ptype, "particle_momentum_x"] ** 2 + + data[ptype, "particle_momentum_y"] ** 2 + + data[ptype, "particle_momentum_z"] ** 2) + mass = data[ptype, "particle_mass"] * data[ptype, "particle_weighting"] + return speed_of_light * np.sqrt(p2 + mass ** 2 * speed_of_light ** 2) - mass * speed_of_light ** 2 + + self.add_field((ptype, "particle_kinetic_energy"), sampling_type="particle", + function=_kin_en, + units="kg*m**2/s**2") + +def setup_velocity(self, ptype): + def _get_vel(axis): + def velocity(field, data): + c = speed_of_light + momentum = data[ptype, "particle_momentum_{}".format(axis)] + mass = data[ptype, "particle_mass"] + weighting = data[ptype, "particle_weighting"] + return momentum / np.sqrt( + (mass * weighting) ** 2 + + (momentum ** 2) / (c ** 2) + ) + + return velocity + + for ax in "xyz": + self.add_field((ptype, "particle_velocity_%s" % ax), sampling_type="particle", + function=_get_vel(ax), + units="m/s") + + +def setup_absolute_positions(self, ptype): + def _abs_pos(axis): + def ap(field, data): + return np.add(data[ptype, "particle_positionCoarse_{}".format(axis)], + data[ptype, "particle_positionOffset_{}".format(axis)]) + + return ap + + for ax in "xyz": + self.add_field((ptype, "particle_position_%s" % ax), sampling_type="particle", + function=_abs_pos(ax), + units="m") + + +class OpenPMDFieldInfo(FieldInfoContainer): + """Specifies which fields from the dataset yt should know about. + + ``self.known_other_fields`` and ``self.known_particle_fields`` must be + populated. Entries for both of these lists must be tuples of the form + ``("name", ("units", ["fields", "to", "alias"], "display_name"))``. These + fields will be represented and handled in yt in the way you define them + here. The fields defined in both ``self.known_other_fields`` and + ``self.known_particle_fields`` will only be added to a dataset (with units, + aliases, etc), if they match any entry in the ``OpenPMDHierarchy``'s + ``self.field_list``. + + Notes + ----- + + Contrary to many other frontends, we dynamically obtain the known fields + from the simulation output. The openPMD markup is extremely flexible - + names, dimensions and the number of individual datasets can (and very likely + will) vary. + + openPMD states that names of records and their components are only allowed + to contain the characters ``a-Z``, the numbers ``0-9`` and the underscore + ``_`` (equivalently, the regex ``\w``). Since yt widely uses the underscore + in field names, openPMD's underscores (``_``) are replaced by hyphen + (``-``). + + Derived fields will automatically be set up, if names and units of your + known on-disk (or manually derived) fields match the ones in the list of + yt "universal" fields. + + References + ---------- + * http://yt-project.org/docs/dev/analyzing/fields.html + * http://yt-project.org/docs/dev/developing/creating_frontend.html#data-meaning-structures + * https://github.com/openPMD/openPMD-standard/blob/latest/STANDARD.md + + """ + _mag_fields = [] + + def __init__(self, ds, field_list): + f = ds._handle + bp = ds.base_path + mp = ds.meshes_path + pp = ds.particles_path + fields = f[bp + mp] + + for fname in fields.keys(): + field = fields[fname] + if type(field) is h5.Dataset or is_const_component(field): + # Don't consider axes. This appears to be a vector field of single dimensionality + ytname = str("_".join([fname.replace("_", "-")])) + parsed = parse_unit_dimension(np.asarray(field.attrs["unitDimension"], dtype=np.int)) + unit = str(YTQuantity(1, parsed).units) + aliases = [] + # Save a list of magnetic fields for aliasing later on + # We can not reasonably infer field type/unit by name in openPMD + if unit == "T" or unit == "kg/(A*s**2)": + self._mag_fields.append(ytname) + self.known_other_fields += ((ytname, (unit, aliases, None)),) + else: + for axis in field.keys(): + ytname = str("_".join([fname.replace("_", "-"), axis])) + parsed = parse_unit_dimension(np.asarray(field.attrs["unitDimension"], dtype=np.int)) + unit = str(YTQuantity(1, parsed).units) + aliases = [] + # Save a list of magnetic fields for aliasing later on + # We can not reasonably infer field type by name in openPMD + if unit == "T" or unit == "kg/(A*s**2)": + self._mag_fields.append(ytname) + self.known_other_fields += ((ytname, (unit, aliases, None)),) + for i in self.known_other_fields: + mylog.debug("open_pmd - known_other_fields - {}".format(i)) + particles = f[bp + pp] + for species in particles.keys(): + for record in particles[species].keys(): + try: + pds = particles[species + "/" + record] + parsed = parse_unit_dimension(pds.attrs["unitDimension"]) + unit = str(YTQuantity(1, parsed).units) + ytattrib = str(record).replace("_", "-") + if ytattrib == "position": + # Symbolically rename position to preserve yt's interpretation of the pfield + # particle_position is later derived in setup_absolute_positions in the way yt expects it + ytattrib = "positionCoarse" + if type(pds) is h5.Dataset or is_const_component(pds): + name = ["particle", ytattrib] + self.known_particle_fields += ((str("_".join(name)), (unit, [], None)),) + else: + for axis in pds.keys(): + aliases = [] + name = ["particle", ytattrib, axis] + ytname = str("_".join(name)) + self.known_particle_fields += ((ytname, (unit, aliases, None)),) + except KeyError: + mylog.info("open_pmd - {}_{} does not seem to have unitDimension".format(species, record)) + for i in self.known_particle_fields: + mylog.debug("open_pmd - known_particle_fields - {}".format(i)) + super(OpenPMDFieldInfo, self).__init__(ds, field_list) + + def setup_fluid_fields(self): + """Defines which derived mesh fields to create. + + If a field can not be calculated, it will simply be skipped. + """ + # Set up aliases first so the setup for poynting can use them + if len(self._mag_fields) > 0: + setup_magnetic_field_aliases(self, "openPMD", self._mag_fields) + setup_poynting_vector(self) + + def setup_particle_fields(self, ptype): + """Defines which derived particle fields to create. + + This will be called for every entry in `OpenPMDDataset``'s ``self.particle_types``. + If a field can not be calculated, it will simply be skipped. + """ + setup_absolute_positions(self, ptype) + setup_kinetic_energy(self, ptype) + setup_velocity(self, ptype) + super(OpenPMDFieldInfo, self).setup_particle_fields(ptype) diff -Nru yt-3.3.3/yt/frontends/open_pmd/__init__.py yt-3.4.0/yt/frontends/open_pmd/__init__.py --- yt-3.3.3/yt/frontends/open_pmd/__init__.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/open_pmd/__init__.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,15 @@ +""" +API for yt.frontends.open_pmd + + + +""" + +# ----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# Copyright (c) 2015, Daniel Grassinger (HZDR) +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +# ----------------------------------------------------------------------------- diff -Nru yt-3.3.3/yt/frontends/open_pmd/io.py yt-3.4.0/yt/frontends/open_pmd/io.py --- yt-3.3.3/yt/frontends/open_pmd/io.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/open_pmd/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,214 @@ +""" +openPMD-specific IO functions + + + +""" + +# ----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# Copyright (c) 2015, Daniel Grassinger (HZDR) +# Copyright (c) 2016, Fabian Koller (HZDR) +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +# ----------------------------------------------------------------------------- + +from collections import defaultdict + +import numpy as np + +from yt.frontends.open_pmd.misc import \ + is_const_component, \ + get_component +from yt.geometry.selection_routines import GridSelector +from yt.utilities.io_handler import BaseIOHandler + + +class IOHandlerOpenPMDHDF5(BaseIOHandler): + _field_dtype = "float32" + _dataset_type = "openPMD" + + def __init__(self, ds, *args, **kwargs): + self.ds = ds + self._handle = ds._handle + self.base_path = ds.base_path + self.meshes_path = ds.meshes_path + self.particles_path = ds.particles_path + self._array_fields = {} + self._cached_ptype = "" + + def _fill_cache(self, ptype, index=0, offset=None): + """Fills the particle position cache for the ``ptype``. + + Parameters + ---------- + ptype : str + The on-disk name of the particle species + index : int, optional + offset : int, optional + """ + if str((ptype, index, offset)) not in self._cached_ptype: + self._cached_ptype = str((ptype, index, offset)) + pds = self._handle[self.base_path + self.particles_path + "/" + ptype] + axes = list(pds["position"].keys()) + if offset is None: + if is_const_component(pds["position/" + axes[0]]): + offset = pds["position/" + axes[0]].attrs["shape"] + else: + offset = pds["position/" + axes[0]].len() + self.cache = np.empty((3, offset), dtype=np.float64) + for i in np.arange(3): + ax = "xyz"[i] + if ax in axes: + np.add(get_component(pds, "position/" + ax, index, offset), + get_component(pds, "positionOffset/" + ax, index, offset), + self.cache[i]) + else: + # Pad accordingly with zeros to make 1D/2D datasets compatible + # These have to be the same shape as the existing axes since that equals the number of particles + self.cache[i] = np.zeros(offset) + + def _read_particle_selection(self, chunks, selector, fields): + """Reads given particle fields for given particle species masked by a given selection. + + Parameters + ---------- + chunks + A list of chunks + A chunk is a list of grids + selector + A region (inside your domain) specifying which parts of the field you want to read + See [1] and [2] + fields : array_like + Tuples (ptype, pfield) representing a field + + Returns + ------- + dict + keys are tuples (ptype, pfield) representing a field + values are (N,) ndarrays with data from that field + """ + f = self._handle + bp = self.base_path + pp = self.particles_path + ds = f[bp + pp] + unions = self.ds.particle_unions + chunks = list(chunks) # chunks is a generator + + rv = {} + ind = {} + particle_count = {} + ptf = defaultdict(list) # ParticleTypes&Fields + rfm = defaultdict(list) # RequestFieldMapping + + for (ptype, pname) in fields: + pfield = (ptype, pname) + # Overestimate the size of all pfields so they include all particles, shrink it later + particle_count[pfield] = 0 + if ptype in unions: + for pt in unions[ptype]: + particle_count[pfield] += self.ds.particle_type_counts[pt] + ptf[pt].append(pname) + rfm[pt, pname].append(pfield) + else: + particle_count[pfield] = self.ds.particle_type_counts[ptype] + ptf[ptype].append(pname) + rfm[pfield].append(pfield) + rv[pfield] = np.empty((particle_count[pfield],), dtype=np.float64) + ind[pfield] = 0 + + for ptype in ptf: + for chunk in chunks: + for grid in chunk.objs: + if str(ptype) == "io": + species = list(ds.keys())[0] + else: + species = ptype + if species not in grid.ptypes: + continue + # read particle coords into cache + self._fill_cache(species, grid.pindex, grid.poffset) + mask = selector.select_points(self.cache[0], self.cache[1], self.cache[2], 0.0) + if mask is None: + continue + pds = ds[species] + for field in ptf[ptype]: + component = "/".join(field.split("_")[1:]) + component = component.replace("positionCoarse", "position") + component = component.replace("-", "_") + data = get_component(pds, component, grid.pindex, grid.poffset)[mask] + for request_field in rfm[(ptype, field)]: + rv[request_field][ind[request_field]:ind[request_field] + data.shape[0]] = data + ind[request_field] += data.shape[0] + + for field in fields: + rv[field] = rv[field][:ind[field]] + + return rv + + def _read_fluid_selection(self, chunks, selector, fields, size): + """Reads given fields masked by a given selection. + + Parameters + ---------- + chunks + A list of chunks + A chunk is a list of grids + selector + A region (inside your domain) specifying which parts of the field you want to read + See [1] and [2] + fields : array_like + Tuples (fname, ftype) representing a field + size : int + Size of the data to read + + Returns + ------- + dict + keys are tuples (ftype, fname) representing a field + values are flat (``size``,) ndarrays with data from that field + """ + f = self._handle + bp = self.base_path + mp = self.meshes_path + ds = f[bp + mp] + chunks = list(chunks) + + rv = {} + ind = {} + + if isinstance(selector, GridSelector): + if not (len(chunks) == len(chunks[0].objs) == 1): + raise RuntimeError + + if size is None: + size = sum((g.count(selector) for chunk in chunks + for g in chunk.objs)) + for field in fields: + rv[field] = np.empty(size, dtype=np.float64) + ind[field] = 0 + + for (ftype, fname) in fields: + field = (ftype, fname) + for chunk in chunks: + for grid in chunk.objs: + component = fname.replace("_", "/").replace("-", "_") + if component.split("/")[0] not in grid.ftypes: + continue + mask = grid._get_selector_mask(selector) + if mask is None: + continue + data = get_component(ds, component, grid.findex, grid.foffset) + # The following is a modified AMRGridPatch.select(...) + data.shape = mask.shape # Workaround - casts a 2D (x,y) array to 3D (x,y,1) + count = grid.count(selector) + rv[field][ind[field]:ind[field] + count] = data[mask] + ind[field] += count + + for field in fields: + rv[field] = rv[field][:ind[field]] + rv[field].flatten() + + return rv diff -Nru yt-3.3.3/yt/frontends/open_pmd/misc.py yt-3.4.0/yt/frontends/open_pmd/misc.py --- yt-3.3.3/yt/frontends/open_pmd/misc.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/open_pmd/misc.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,125 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2016, Fabian Koller (HZDR) +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +# ----------------------------------------------------------------------------- + +import numpy as np + +from yt.utilities.logger import ytLogger as mylog + + +def parse_unit_dimension(unit_dimension): + """Transforms an openPMD unitDimension into a string. + + Parameters + ---------- + unit_dimension : array_like + integer array of length 7 with one entry for the dimensional component of every SI unit + + [0] length L, + [1] mass M, + [2] time T, + [3] electric current I, + [4] thermodynamic temperature theta, + [5] amount of substance N, + [6] luminous intensity J + + References + ---------- + .. https://github.com/openPMD/openPMD-standard/blob/latest/STANDARD.md#unit-systems-and-dimensionality + + Returns + ------- + str + + Examples + -------- + >>> velocity = [1., 0., -1., 0., 0., 0., 0.] + >>> print parse_unit_dimension(velocity) + 'm**1*s**-1' + + >>> magnetic_field = [0., 1., -2., -1., 0., 0., 0.] + >>> print parse_unit_dimension(magnetic_field) + 'kg**1*s**-2*A**-1' + """ + if len(unit_dimension) is not 7: + mylog.error("open_pmd - SI must have 7 base dimensions!") + unit_dimension = np.asarray(unit_dimension, dtype=np.int) + dim = [] + si = ["m", + "kg", + "s", + "A", + "C", + "mol", + "cd"] + for i in np.arange(7): + if unit_dimension[i] != 0: + dim.append("{}**{}".format(si[i], unit_dimension[i])) + return "*".join(dim) + + +def is_const_component(record_component): + """Determines whether a group or dataset in the HDF5 file is constant. + + Parameters + ---------- + record_component : h5py.Group or h5py.Dataset + + Returns + ------- + bool + True if constant, False otherwise + + References + ---------- + .. https://github.com/openPMD/openPMD-standard/blob/latest/STANDARD.md, + section 'Constant Record Components' + """ + return "value" in record_component.attrs.keys() + + +def get_component(group, component_name, index=0, offset=None): + """Grabs a dataset component from a group as a whole or sliced. + + Parameters + ---------- + group : h5py.Group + component_name : str + relative path of the component in the group + index : int, optional + first entry along the first axis to read + offset : int, optional + number of entries to read + if not supplied, every entry after index is returned + + Notes + ----- + This scales every entry of the component with the respective "unitSI". + + Returns + ------- + ndarray + (N,) 1D in case of particle data + (O,P,Q) 1D/2D/3D in case of mesh data + """ + record_component = group[component_name] + unit_si = record_component.attrs["unitSI"] + if is_const_component(record_component): + shape = np.asarray(record_component.attrs["shape"]) + if offset is None: + shape[0] -= index + else: + shape[0] = offset + # component is constant, craft an array by hand + # mylog.debug("open_pmd - get_component: {}/{} [const {}]".format(group.name, component_name, shape)) + return np.full(shape, record_component.attrs["value"] * unit_si) + else: + if offset is not None: + offset += index + # component is a dataset, return it (possibly masked) + # mylog.debug("open_pmd - get_component: {}/{}[{}:{}]".format(group.name, component_name, index, offset)) + return np.multiply(record_component[index:offset], unit_si) diff -Nru yt-3.3.3/yt/frontends/open_pmd/tests/test_outputs.py yt-3.4.0/yt/frontends/open_pmd/tests/test_outputs.py --- yt-3.3.3/yt/frontends/open_pmd/tests/test_outputs.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/open_pmd/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,141 @@ +""" +openPMD frontend tests + + + +""" + +# ----------------------------------------------------------------------------- +# Copyright (c) 2016, Fabian Koller (HZDR). +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +# ----------------------------------------------------------------------------- + +from yt.frontends.open_pmd.data_structures import \ + OpenPMDDataset +from yt.testing import \ + assert_almost_equal, \ + assert_equal, \ + assert_array_equal, \ + requires_file +from yt.utilities.answer_testing.framework import \ + data_dir_load + +import numpy as np + +twoD = "example-2d/hdf5/data00000100.h5" +threeD = "example-3d/hdf5/data00000100.h5" + + +@requires_file(threeD) +def test_3d_out(): + ds = data_dir_load(threeD) + field_list = [('all', 'particle_charge'), + ('all', 'particle_mass'), + ('all', 'particle_momentum_x'), + ('all', 'particle_momentum_y'), + ('all', 'particle_momentum_z'), + ('all', 'particle_positionCoarse_x'), + ('all', 'particle_positionCoarse_y'), + ('all', 'particle_positionCoarse_z'), + ('all', 'particle_positionOffset_x'), + ('all', 'particle_positionOffset_y'), + ('all', 'particle_positionOffset_z'), + ('all', 'particle_weighting'), + ('io', 'particle_charge'), + ('io', 'particle_mass'), + ('io', 'particle_momentum_x'), + ('io', 'particle_momentum_y'), + ('io', 'particle_momentum_z'), + ('io', 'particle_positionCoarse_x'), + ('io', 'particle_positionCoarse_y'), + ('io', 'particle_positionCoarse_z'), + ('io', 'particle_positionOffset_x'), + ('io', 'particle_positionOffset_y'), + ('io', 'particle_positionOffset_z'), + ('io', 'particle_weighting'), + ('openPMD', 'E_x'), + ('openPMD', 'E_y'), + ('openPMD', 'E_z'), + ('openPMD', 'rho')] + domain_dimensions = [26, 26, 201] * np.ones_like(ds.domain_dimensions) + domain_width = [2.08e-05, 2.08e-05, 2.01e-05] * np.ones_like(ds.domain_left_edge) + + assert isinstance(ds, OpenPMDDataset) + assert_equal(str(ds), "data00000100.h5") + assert_equal(ds.dimensionality, 3) + assert_equal(ds.particle_types_raw, ('io',)) + assert "all" in ds.particle_unions + assert_array_equal(ds.field_list, field_list) + assert_array_equal(ds.domain_dimensions, domain_dimensions) + assert_almost_equal(ds.current_time, + 3.28471214521e-14 * np.ones_like(ds.current_time)) + assert_almost_equal(ds.domain_right_edge - ds.domain_left_edge, + domain_width) + + +@requires_file(twoD) +def test_2d_out(): + ds = data_dir_load(twoD) + field_list = [('Hydrogen1+', 'particle_charge'), + ('Hydrogen1+', 'particle_mass'), + ('Hydrogen1+', 'particle_momentum_x'), + ('Hydrogen1+', 'particle_momentum_y'), + ('Hydrogen1+', 'particle_momentum_z'), + ('Hydrogen1+', 'particle_positionCoarse_x'), + ('Hydrogen1+', 'particle_positionCoarse_y'), + ('Hydrogen1+', 'particle_positionCoarse_z'), + ('Hydrogen1+', 'particle_positionOffset_x'), + ('Hydrogen1+', 'particle_positionOffset_y'), + ('Hydrogen1+', 'particle_positionOffset_z'), + ('Hydrogen1+', 'particle_weighting'), + ('all', 'particle_charge'), + ('all', 'particle_mass'), + ('all', 'particle_momentum_x'), + ('all', 'particle_momentum_y'), + ('all', 'particle_momentum_z'), + ('all', 'particle_positionCoarse_x'), + ('all', 'particle_positionCoarse_y'), + ('all', 'particle_positionCoarse_z'), + ('all', 'particle_positionOffset_x'), + ('all', 'particle_positionOffset_y'), + ('all', 'particle_positionOffset_z'), + ('all', 'particle_weighting'), + ('electrons', 'particle_charge'), + ('electrons', 'particle_mass'), + ('electrons', 'particle_momentum_x'), + ('electrons', 'particle_momentum_y'), + ('electrons', 'particle_momentum_z'), + ('electrons', 'particle_positionCoarse_x'), + ('electrons', 'particle_positionCoarse_y'), + ('electrons', 'particle_positionCoarse_z'), + ('electrons', 'particle_positionOffset_x'), + ('electrons', 'particle_positionOffset_y'), + ('electrons', 'particle_positionOffset_z'), + ('electrons', 'particle_weighting'), + ('openPMD', 'B_x'), + ('openPMD', 'B_y'), + ('openPMD', 'B_z'), + ('openPMD', 'E_x'), + ('openPMD', 'E_y'), + ('openPMD', 'E_z'), + ('openPMD', 'J_x'), + ('openPMD', 'J_y'), + ('openPMD', 'J_z'), + ('openPMD', 'rho')] + domain_dimensions = [51, 201, 1] * np.ones_like(ds.domain_dimensions) + domain_width = [3.06e-05, 2.01e-05, 1e+0] * np.ones_like(ds.domain_left_edge) + + assert isinstance(ds, OpenPMDDataset) + assert_equal(str(ds), "data00000100.h5") + assert_equal(ds.dimensionality, 2) + assert_equal(ds.particle_types_raw, ('Hydrogen1+', 'electrons')) + assert "all" in ds.particle_unions + assert_array_equal(ds.field_list, field_list) + assert_array_equal(ds.domain_dimensions, domain_dimensions) + assert_almost_equal(ds.current_time, + 3.29025596712e-14 * np.ones_like(ds.current_time)) + assert_almost_equal(ds.domain_right_edge - ds.domain_left_edge, + domain_width) diff -Nru yt-3.3.3/yt/frontends/owls/definitions.py yt-3.4.0/yt/frontends/owls/definitions.py --- yt-3.3.3/yt/frontends/owls/definitions.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/owls/definitions.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,6 +13,3 @@ # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- - -ghdf5_ptypes = ("PartType0", "PartType1", "PartType2", "PartType3", - "PartType4", "PartType5") diff -Nru yt-3.3.3/yt/frontends/owls/fields.py yt-3.4.0/yt/frontends/owls/fields.py --- yt-3.3.3/yt/frontends/owls/fields.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/owls/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -35,8 +35,8 @@ class OWLSFieldInfo(SPHFieldInfo): _ions = ("c1", "c2", "c3", "c4", "c5", "c6", - "fe2", "fe17", "h1", "he1", "he2", "mg1", "mg2", "n2", - "n3", "n4", "n5", "n6", "n7", "ne8", "ne9", "ne10", "o1", + "fe2", "fe17", "h1", "he1", "he2", "mg1", "mg2", "n2", + "n3", "n4", "n5", "n6", "n7", "ne8", "ne9", "ne10", "o1", "o6", "o7", "o8", "si2", "si3", "si4", "si13") _elements = ("H", "He", "C", "N", "O", "Ne", "Mg", "Si", "Fe") @@ -49,7 +49,7 @@ def __init__(self, *args, **kwargs): - + new_particle_fields = ( ("Hydrogen", ("", ["H_fraction"], None)), ("Helium", ("", ["He_fraction"], None)), @@ -72,7 +72,7 @@ def setup_particle_fields(self, ptype): """ additional particle fields derived from those in snapshot. we also need to add the smoothed fields here b/c setup_fluid_fields - is called before setup_particle_fields. """ + is called before setup_particle_fields. """ smoothed_suffixes = ("_number_density", "_density", "_mass") @@ -90,9 +90,9 @@ add_species_field_by_fraction(self, ptype, s, particle_type=True) - # this needs to be called after the call to + # this needs to be called after the call to # add_species_field_by_fraction for some reason ... - # not sure why yet. + # not sure why yet. #------------------------------------------------------- if ptype == 'PartType0': ftype='gas' @@ -108,7 +108,7 @@ ftype='BH' elif ptype == 'all': ftype='all' - + super(OWLSFieldInfo,self).setup_particle_fields( ptype, num_neighbors=self._num_neighbors, ftype=ftype) @@ -117,11 +117,11 @@ #----------------------------------------------------- if ptype == 'PartType0': - # we only add ion fields for gas. this takes some + # we only add ion fields for gas. this takes some # time as the ion abundances have to be interpolated # from cloudy tables (optically thin) #----------------------------------------------------- - + # this defines the ion density on particles # X_density for all items in self._ions @@ -176,7 +176,7 @@ loaded = [] for sfx in smoothed_suffixes: fname = yt_ion + sfx - fn = add_volume_weighted_smoothed_field( + fn = add_volume_weighted_smoothed_field( ptype, "particle_position", "particle_mass", "smoothing_length", "density", fname, self, self._num_neighbors) @@ -190,7 +190,7 @@ def setup_gas_ion_density_particle_fields( self, ptype ): - """ Sets up particle fields for gas ion densities. """ + """ Sets up particle fields for gas ion densities. """ # loop over all ions and make fields #---------------------------------------------- @@ -217,22 +217,22 @@ fname = yt_ion + '_density' dens_func = self._create_ion_density_func( ftype, ion ) self.add_field( (ftype, fname), - function = dens_func, - units=self.ds.unit_system["density"], - particle_type=True ) + sampling_type="particle", + function = dens_func, + units=self.ds.unit_system["density"]) self._show_field_errors.append( (ftype,fname) ) - + def _create_ion_density_func( self, ftype, ion ): - """ returns a function that calculates the ion density of a particle. - """ + """ returns a function that calculates the ion density of a particle. + """ def get_owls_ion_density_field(ion, ftype, itab): def _func(field, data): - # get element symbol from ion string. ion string will + # get element symbol from ion string. ion string will # be a member of the tuple _ions (i.e. si13) #-------------------------------------------------------- if ion[0:2].isalpha(): @@ -256,9 +256,9 @@ # find ion balance using log nH and log T #-------------------------------------------------------- i_frac = itab.interp( log_nH, log_T ) - return data[ftype,"Density"] * m_frac * i_frac + return data[ftype,"Density"] * m_frac * i_frac return _func - + ion_path = self._get_owls_ion_data_dir() fname = os.path.join( ion_path, ion+".hdf5" ) itab = oit.IonTableOWLS( fname ) @@ -295,7 +295,7 @@ if tdir == "/does/not/exist": data_dir = "./" else: - data_dir = tdir + data_dir = tdir # check for owls_ion_data directory in data_dir diff -Nru yt-3.3.3/yt/frontends/owls/io.py yt-3.4.0/yt/frontends/owls/io.py --- yt-3.3.3/yt/frontends/owls/io.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/owls/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -15,198 +15,8 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -from yt.utilities.on_demand_imports import _h5py as h5py -import numpy as np -import os +from yt.frontends.gadget.io import \ + IOHandlerGadgetHDF5 -from yt.utilities.io_handler import \ - BaseIOHandler -from yt.utilities.lib.geometry_utils import \ - compute_morton - -from .definitions import \ - ghdf5_ptypes - -CHUNKSIZE = 10000000 - -def _get_h5_handle(fn): - try: - f = h5py.File(fn, "r") - except IOError: - print("ERROR OPENING %s" % (fn)) - if os.path.exists(fn): - print("FILENAME EXISTS") - else: - print("FILENAME DOES NOT EXIST") - raise - return f - -class IOHandlerOWLS(BaseIOHandler): +class IOHandlerOWLS(IOHandlerGadgetHDF5): _dataset_type = "OWLS" - _vector_fields = ("Coordinates", "Velocity", "Velocities") - _known_ptypes = ghdf5_ptypes - _var_mass = None - _element_names = ('Hydrogen', 'Helium', 'Carbon', 'Nitrogen', 'Oxygen', - 'Neon', 'Magnesium', 'Silicon', 'Iron' ) - - - @property - def var_mass(self): - if self._var_mass is None: - vm = [] - for i, v in enumerate(self.ds["Massarr"]): - if v == 0: - vm.append(self._known_ptypes[i]) - self._var_mass = tuple(vm) - return self._var_mass - - def _read_fluid_selection(self, chunks, selector, fields, size): - raise NotImplementedError - - def _read_particle_coords(self, chunks, ptf): - # This will read chunks and yield the results. - chunks = list(chunks) - data_files = set([]) - for chunk in chunks: - for obj in chunk.objs: - data_files.update(obj.data_files) - for data_file in sorted(data_files, key=lambda x: x.filename): - f = _get_h5_handle(data_file.filename) - # This double-reads - for ptype, field_list in sorted(ptf.items()): - if data_file.total_particles[ptype] == 0: - continue - x = f["/%s/Coordinates" % ptype][:,0].astype("float64") - y = f["/%s/Coordinates" % ptype][:,1].astype("float64") - z = f["/%s/Coordinates" % ptype][:,2].astype("float64") - yield ptype, (x, y, z) - f.close() - - def _read_particle_fields(self, chunks, ptf, selector): - # Now we have all the sizes, and we can allocate - data_files = set([]) - for chunk in chunks: - for obj in chunk.objs: - data_files.update(obj.data_files) - for data_file in sorted(data_files, key=lambda x: x.filename): - f = _get_h5_handle(data_file.filename) - for ptype, field_list in sorted(ptf.items()): - if data_file.total_particles[ptype] == 0: - continue - g = f["/%s" % ptype] - coords = g["Coordinates"][:].astype("float64") - mask = selector.select_points( - coords[:,0], coords[:,1], coords[:,2], 0.0) - del coords - if mask is None: continue - for field in field_list: - - if field in ("Mass", "Masses") and \ - ptype not in self.var_mass: - data = np.empty(mask.sum(), dtype="float64") - ind = self._known_ptypes.index(ptype) - data[:] = self.ds["Massarr"][ind] - - elif field in self._element_names: - rfield = 'ElementAbundance/' + field - data = g[rfield][:][mask,...] - elif field.startswith("Metallicity_"): - col = int(field.rsplit("_", 1)[-1]) - data = g["Metallicity"][:,col][mask] - elif field.startswith("Chemistry_"): - col = int(field.rsplit("_", 1)[-1]) - data = g["ChemistryAbundances"][:,col][mask] - else: - data = g[field][:][mask,...] - - yield (ptype, field), data - f.close() - - def _initialize_index(self, data_file, regions): - index_ptype = self.index_ptype - f = _get_h5_handle(data_file.filename) - if index_ptype == "all": - pcount = f["/Header"].attrs["NumPart_ThisFile"][:].sum() - keys = f.keys() - else: - pt = int(index_ptype[-1]) - pcount = f["/Header"].attrs["NumPart_ThisFile"][pt] - keys = [index_ptype] - morton = np.empty(pcount, dtype='uint64') - ind = 0 - for key in keys: - if not key.startswith("PartType"): continue - if "Coordinates" not in f[key]: continue - ds = f[key]["Coordinates"] - dt = ds.dtype.newbyteorder("N") # Native - pos = np.empty(ds.shape, dtype=dt) - pos[:] = ds - regions.add_data_file(pos, data_file.file_id, - data_file.ds.filter_bbox) - morton[ind:ind+pos.shape[0]] = compute_morton( - pos[:,0], pos[:,1], pos[:,2], - data_file.ds.domain_left_edge, - data_file.ds.domain_right_edge, - data_file.ds.filter_bbox) - ind += pos.shape[0] - f.close() - return morton - - def _count_particles(self, data_file): - f = _get_h5_handle(data_file.filename) - pcount = f["/Header"].attrs["NumPart_ThisFile"][:] - f.close() - npart = dict(("PartType%s" % (i), v) for i, v in enumerate(pcount)) - return npart - - - def _identify_fields(self, data_file): - f = _get_h5_handle(data_file.filename) - fields = [] - cname = self.ds._particle_coordinates_name # Coordinates - mname = self.ds._particle_mass_name # Mass - - # loop over all keys in OWLS hdf5 file - #-------------------------------------------------- - for key in f.keys(): - - # only want particle data - #-------------------------------------- - if not key.startswith("PartType"): continue - - # particle data group - #-------------------------------------- - g = f[key] - if cname not in g: continue - - # note str => not unicode! - - #ptype = int(key[8:]) - ptype = str(key) - if ptype not in self.var_mass: - fields.append((ptype, mname)) - - # loop over all keys in PartTypeX group - #---------------------------------------- - for k in g.keys(): - - if k == 'ElementAbundance': - gp = g[k] - for j in gp.keys(): - kk = j - fields.append((ptype, str(kk))) - elif k == 'Metallicity' and len(g[k].shape) > 1: - # Vector of metallicity - for i in range(g[k].shape[1]): - fields.append((ptype, "Metallicity_%02i" % i)) - elif k == "ChemistryAbundances" and len(g[k].shape)>1: - for i in range(g[k].shape[1]): - fields.append((ptype, "Chemistry_%03i" % i)) - else: - kk = k - if not hasattr(g[kk], "shape"): continue - fields.append((ptype, str(kk))) - - - f.close() - return fields, {} diff -Nru yt-3.3.3/yt/frontends/owls_subfind/io.py yt-3.4.0/yt/frontends/owls_subfind/io.py --- yt-3.3.3/yt/frontends/owls_subfind/io.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/owls_subfind/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -105,7 +105,7 @@ field_data = f[ptype][fname].value.astype("float64") my_div = field_data.size / pcount if my_div > 1: - field_data = np.resize(field_data, (pcount, my_div)) + field_data = np.resize(field_data, (int(pcount), int(my_div))) findex = int(field[field.rfind("_") + 1:]) field_data = field_data[:, findex] data = field_data[mask] diff -Nru yt-3.3.3/yt/frontends/owls_subfind/tests/test_outputs.py yt-3.4.0/yt/frontends/owls_subfind/tests/test_outputs.py --- yt-3.3.3/yt/frontends/owls_subfind/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/owls_subfind/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -34,7 +34,7 @@ @requires_ds(g8) def test_fields_g8(): ds = data_dir_load(g8) - yield assert_equal, str(ds), os.path.basename(g8) + assert_equal(str(ds), os.path.basename(g8)) for field in _fields: yield FieldValuesTest(g8, field, particle_type=True) @@ -42,7 +42,7 @@ @requires_ds(g1) def test_fields_g1(): ds = data_dir_load(g1) - yield assert_equal, str(ds), os.path.basename(g1) + assert_equal(str(ds), os.path.basename(g1)) for field in _fields: yield FieldValuesTest(g1, field, particle_type=True) diff -Nru yt-3.3.3/yt/frontends/ramses/data_structures.py yt-3.4.0/yt/frontends/ramses/data_structures.py --- yt-3.3.3/yt/frontends/ramses/data_structures.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/ramses/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -15,6 +15,7 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +import glob import os import numpy as np import stat @@ -54,6 +55,7 @@ self.ds = ds self.domain_id = domain_id self.nvar = 0 # Set this later! + num = os.path.basename(ds.parameter_filename).split("." )[0].split("_")[1] basename = "%s/%%s_%s.out%05i" % ( @@ -154,6 +156,7 @@ hvals.update(fpu.read_attrs(f, attrs)) self.particle_header = hvals self.local_particle_count = hvals['npart'] + particle_fields = [ ("particle_position_x", "d"), ("particle_position_y", "d"), @@ -162,11 +165,13 @@ ("particle_velocity_y", "d"), ("particle_velocity_z", "d"), ("particle_mass", "d"), - ("particle_identifier", "I"), + ("particle_identifier", "i"), ("particle_refinement_level", "I")] if hvals["nstar_tot"] > 0: particle_fields += [("particle_age", "d"), ("particle_metallicity", "d")] + if self.ds._extra_particle_fields is not None: + particle_fields += self.ds._extra_particle_fields field_offsets = {} _pfields = {} @@ -374,10 +379,6 @@ ''' If no fluid fields are set, the code tries to set up a fluids array by hand ''' - # TODO: SUPPORT RT - THIS REQUIRES IMPLEMENTING A NEW FILE READER! - # Find nvar - - # TODO: copy/pasted from DomainFile; needs refactoring! num = os.path.basename(self.dataset.parameter_filename).split("." )[0].split("_")[1] @@ -404,32 +405,43 @@ self.ds.gamma = hvals['gamma'] nvar = hvals['nvar'] # OK, we got NVAR, now set up the arrays depending on what NVAR is + # but first check for radiative transfer! + foldername = os.path.abspath(os.path.dirname(self.ds.parameter_filename)) + rt_flag = any(glob.glob(os.sep.join([foldername, 'info_rt_*.txt']))) + if rt_flag: # rt run + if nvar < 10: + mylog.info('Detected RAMSES-RT file WITHOUT IR trapping.') + fields = ["Density", "x-velocity", "y-velocity", "z-velocity", "Pressure", "Metallicity", "HII", "HeII", "HeIII"] + else: + mylog.info('Detected RAMSES-RT file WITH IR trapping.') + fields = ["Density", "x-velocity", "y-velocity", "z-velocity", "Pres_IR", "Pressure", "Metallicity", "HII", "HeII", "HeIII"] + else: + if nvar < 5: + mylog.debug("nvar=%s is too small! YT doesn't currently support 1D/2D runs in RAMSES %s") + raise ValueError + # Basic hydro runs + if nvar == 5: + fields = ["Density", + "x-velocity", "y-velocity", "z-velocity", + "Pressure"] + if nvar > 5 and nvar < 11: + fields = ["Density", + "x-velocity", "y-velocity", "z-velocity", + "Pressure", "Metallicity"] + # MHD runs - NOTE: THE MHD MODULE WILL SILENTLY ADD 3 TO THE NVAR IN THE MAKEFILE + if nvar == 11: + fields = ["Density", + "x-velocity", "y-velocity", "z-velocity", + "x-Bfield-left", "y-Bfield-left", "z-Bfield-left", + "x-Bfield-right", "y-Bfield-right", "z-Bfield-right", + "Pressure"] + if nvar > 11: + fields = ["Density", + "x-velocity", "y-velocity", "z-velocity", + "x-Bfield-left", "y-Bfield-left", "z-Bfield-left", + "x-Bfield-right", "y-Bfield-right", "z-Bfield-right", + "Pressure","Metallicity"] # Allow some wiggle room for users to add too many variables - if nvar < 5: - mylog.debug("nvar=%s is too small! YT doesn't currently support 1D/2D runs in RAMSES %s") - raise ValueError - # Basic hydro runs - if nvar == 5: - fields = ["Density", - "x-velocity", "y-velocity", "z-velocity", - "Pressure"] - if nvar > 5 and nvar < 11: - fields = ["Density", - "x-velocity", "y-velocity", "z-velocity", - "Pressure", "Metallicity"] - # MHD runs - NOTE: THE MHD MODULE WILL SILENTLY ADD 3 TO THE NVAR IN THE MAKEFILE - if nvar == 11: - fields = ["Density", - "x-velocity", "y-velocity", "z-velocity", - "x-Bfield-left", "y-Bfield-left", "z-Bfield-left", - "x-Bfield-right", "y-Bfield-right", "z-Bfield-right", - "Pressure"] - if nvar > 11: - fields = ["Density", - "x-velocity", "y-velocity", "z-velocity", - "x-Bfield-left", "y-Bfield-left", "z-Bfield-left", - "x-Bfield-right", "y-Bfield-right", "z-Bfield-right", - "Pressure","Metallicity"] while len(fields) < nvar: fields.append("var"+str(len(fields))) mylog.debug("No fields specified by user; automatically setting fields array to %s", str(fields)) @@ -530,21 +542,28 @@ gamma = 1.4 # This will get replaced on hydro_fn open def __init__(self, filename, dataset_type='ramses', - fields = None, storage_filename = None, - units_override=None, unit_system="cgs"): + fields=None, storage_filename=None, + units_override=None, unit_system="cgs", + extra_particle_fields=None, cosmological=None): # Here we want to initiate a traceback, if the reader is not built. if isinstance(fields, string_types): fields = field_aliases[fields] ''' fields: An array of hydro variable fields in order of position in the hydro_XXXXX.outYYYYY file If set to None, will try a default set of fields + extra_particle_fields: An array of extra particle variables in order of position in the particle_XXXXX.outYYYYY file. + cosmological: If set to None, automatically detect cosmological simulation. If a boolean, force + its value. ''' self.fluid_types += ("ramses",) self._fields_in_file = fields + self._extra_particle_fields = extra_particle_fields + self.force_cosmological = cosmological Dataset.__init__(self, filename, dataset_type, units_override=units_override, unit_system=unit_system) self.storage_filename = storage_filename + def __repr__(self): return self.basename.rsplit(".", 1)[0] @@ -629,8 +648,16 @@ self.domain_right_edge = np.ones(3, dtype='float64') # This is likely not true, but it's not clear how to determine the boundary conditions self.periodicity = (True, True, True) - # These conditions seem to always be true for non-cosmological datasets - if rheader["time"] > 0 and rheader["H0"] == 1 and rheader["aexp"] == 1: + + if self.force_cosmological is not None: + is_cosmological = self.force_cosmological + else: + # These conditions seem to always be true for non-cosmological datasets + is_cosmological = not (rheader["time"] >= 0 and + rheader["H0"] == 1 and + rheader["aexp"] == 1) + + if not is_cosmological: self.cosmological_simulation = 0 self.current_redshift = 0 self.hubble_constant = 0 diff -Nru yt-3.3.3/yt/frontends/ramses/fields.py yt-3.4.0/yt/frontends/ramses/fields.py --- yt-3.3.3/yt/frontends/ramses/fields.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/ramses/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,6 +13,7 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +import glob import os import numpy as np @@ -67,8 +68,12 @@ ("x-velocity", (vel_units, ["velocity_x"], None)), ("y-velocity", (vel_units, ["velocity_y"], None)), ("z-velocity", (vel_units, ["velocity_z"], None)), + ("Pres_IR", (pressure_units, ["pres_IR"], None)), ("Pressure", (pressure_units, ["pressure"], None)), ("Metallicity", ("", ["metallicity"], None)), + ("HII", ("", ["H_p1_fraction"], None)), + ("HeII", ("", ["He_p1_fraction"], None)), + ("HeIII",("", ["He_p2_fraction"], None)), ) known_particle_fields = ( ("particle_position_x", ("code_length", [], None)), @@ -89,9 +94,36 @@ rv = data["gas", "pressure"]/data["gas", "density"] rv *= mass_hydrogen_cgs/boltzmann_constant_cgs return rv - self.add_field(("gas", "temperature"), function=_temperature, + self.add_field(("gas", "temperature"), sampling_type="cell", function=_temperature, units=self.ds.unit_system["temperature"]) self.create_cooling_fields() + # See if we need to load the rt fields + foldername = os.path.abspath(os.path.dirname(self.ds.parameter_filename)) + rt_flag = any(glob.glob(os.sep.join([foldername, 'info_rt_*.txt']))) + if rt_flag: # rt run + self.setup_rt_fields() + + def setup_rt_fields(self): + def _temp_IR(field, data): + rv = data["gas", "pres_IR"]/data["gas", "density"] + rv *= mass_hydrogen_cgs/boltzmann_constant_cgs + return rv + self.add_field(("gas", "temp_IR"), sampling_type="cell", + function=_temp_IR, + units=self.ds.unit_system["temperature"]) + for species in ['H_p1', 'He_p1', 'He_p2']: + def _species_density(field, data): + return data['gas', species+'_fraction']*data['gas', 'density'] + self.add_field(('gas', species+'_density'), sampling_type='cell', + function=_species_density, + units=self.ds.unit_system['density']) + def _species_mass(field, data): + return (data['gas', species+'_density']* + data['index', 'cell_volume']) + self.add_field(('gas', species+'_mass'), sampling_type='cell', + function=_species_mass, + units=self.ds.unit_system['mass']) + def create_cooling_fields(self): num = os.path.basename(self.ds.parameter_filename).split("." @@ -106,8 +138,9 @@ d = {'lognH': np.log10(_X*data["density"]/mh).ravel(), 'logT' : np.log10(data["temperature"]).ravel()} rv = 10**interp_object(d).reshape(shape) - return rv - self.add_field(name = name, function=_func, + # Return array in unit 'per volume' consistently with line below + return data.ds.arr(rv, 'code_length**-3') + self.add_field(name = name, sampling_type="cell", function=_func, units = "code_length**-3") avals = {} tvals = {} @@ -121,10 +154,10 @@ if var.size == n1*n2: tvals[tname] = var.reshape((n1, n2), order='F') else: - var = var.reshape((n1, n2, var.size / (n1*n2)), order='F') + var = var.reshape((n1, n2, var.size // (n1*n2)), order='F') for i in range(var.shape[-1]): tvals[_cool_species[i]] = var[:,:,i] - + for n in tvals: interp = BilinearFieldInterpolator(tvals[n], (avals["lognH"], avals["logT"]), diff -Nru yt-3.3.3/yt/frontends/ramses/tests/test_outputs.py yt-3.4.0/yt/frontends/ramses/tests/test_outputs.py --- yt-3.3.3/yt/frontends/ramses/tests/test_outputs.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/ramses/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -35,7 +35,7 @@ @requires_ds(output_00080) def test_output_00080(): ds = data_dir_load(output_00080) - yield assert_equal, str(ds), "info_00080" + assert_equal(str(ds), "info_00080") dso = [ None, ("sphere", ("max", (0.1, 'unitary')))] for dobj_name in dso: for field in _fields: @@ -48,7 +48,7 @@ dobj = create_obj(ds, dobj_name) s1 = dobj["ones"].sum() s2 = sum(mask.sum() for block, mask in dobj.blocks) - yield assert_equal, s1, s2 + assert_equal(s1, s2) assert_equal(ds.particle_type_counts, {'io': 1090895}) @requires_file(output_00080) @@ -57,17 +57,100 @@ @requires_file(output_00080) def test_units_override(): - for test in units_override_check(output_00080): - yield test + units_override_check(output_00080) ramsesNonCosmo = 'DICEGalaxyDisk_nonCosmological/output_00002' @requires_file(ramsesNonCosmo) +def test_non_cosmo_detection(): + path = os.path.join(ramsesNonCosmo, 'info_00002.txt') + ds = yt.load(path, cosmological=False) + assert_equal(ds.cosmological_simulation, 0) + + ds = yt.load(path, cosmological=None) + assert_equal(ds.cosmological_simulation, 0) + + ds = yt.load(path) + assert_equal(ds.cosmological_simulation, 0) + + +@requires_file(ramsesNonCosmo) def test_unit_non_cosmo(): - ds = yt.load(os.path.join(ramsesNonCosmo, 'info_00002.txt')) + for force_cosmo in [False, None]: + ds = yt.load(os.path.join(ramsesNonCosmo, 'info_00002.txt'), cosmological=force_cosmo) + + expected_raw_time = 0.0299468077820411 # in ramses unit + assert_equal(ds.current_time.value, expected_raw_time) + + expected_time = 14087886140997.336 # in seconds + assert_equal(ds.current_time.in_units('s').value, expected_time) + + +ramsesCosmo = 'output_00080/info_00080.txt' +@requires_file(ramsesCosmo) +def test_cosmo_detection(): + ds = yt.load(ramsesCosmo, cosmological=True) + assert_equal(ds.cosmological_simulation, 1) + + ds = yt.load(ramsesCosmo, cosmological=None) + assert_equal(ds.cosmological_simulation, 1) + + ds = yt.load(ramsesCosmo) + assert_equal(ds.cosmological_simulation, 1) + + +@requires_file(ramsesCosmo) +def test_unit_cosmo(): + for force_cosmo in [True, None]: + ds = yt.load(ramsesCosmo, cosmological=force_cosmo) + + expected_raw_time = 1.119216564055017 # in ramses unit + assert_equal(ds.current_time.value, expected_raw_time) + + expected_time = 3.756241729312462e+17 # in seconds + assert_equal(ds.current_time.in_units('s').value, expected_time) + + +ramsesExtraFieldsSmall = 'ramses_extra_fields_small/output_00001' +@requires_file(ramsesExtraFieldsSmall) +def test_extra_fields(): + extra_fields = [('family', 'I'), ('pointer', 'I')] + ds = yt.load(os.path.join(ramsesExtraFieldsSmall, 'info_00001.txt'), + extra_particle_fields=extra_fields) + + # the dataset should contain the fields + for field, _ in extra_fields: + assert ('all', field) in ds.field_list + + # Check the family (they should equal 100, for tracer particles) + dd = ds.all_data() + families = dd[('all', 'family')] + assert all(families == 100) + +ramses_rt = "ramses_rt_00088/output_00088/info_00088.txt" +@requires_file(ramses_rt) +def test_ramses_rt(): + ds = yt.load(ramses_rt) + ad = ds.all_data() + + expected_fields = ["Density", "x-velocity", "y-velocity", "z-velocity", + "Pres_IR", "Pressure", "Metallicity", "HII", "HeII", + "HeIII"] + + for field in expected_fields: + assert(('ramses', field) in ds.field_list) + + # test that field access works + ad['ramses', field] - expected_raw_time = 0.0299468077820411 # in ramses unit - yield assert_equal, ds.current_time.value, expected_raw_time + # test that special derived fields for RT datasets work + special_fields = [('gas', 'temp_IR')] + species = ['H_p1', 'He_p1', 'He_p2'] + for specie in species: + special_fields.extend( + [('gas', specie+'_fraction'), ('gas', specie+'_density'), + ('gas', specie+'_mass')]) - expected_time = 14087886140997.336 # in seconds - assert_equal(ds.current_time.in_units('s').value, expected_time) + for field in special_fields: + assert(field in ds.derived_field_list) + ad[field] diff -Nru yt-3.3.3/yt/frontends/rockstar/tests/test_outputs.py yt-3.4.0/yt/frontends/rockstar/tests/test_outputs.py --- yt-3.3.3/yt/frontends/rockstar/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/rockstar/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -31,7 +31,7 @@ @requires_ds(r1) def test_fields_r1(): ds = data_dir_load(r1) - yield assert_equal, str(ds), os.path.basename(r1) + assert_equal(str(ds), os.path.basename(r1)) for field in _fields: yield FieldValuesTest(r1, field, particle_type=True) diff -Nru yt-3.3.3/yt/frontends/sdf/data_structures.py yt-3.4.0/yt/frontends/sdf/data_structures.py --- yt-3.3.3/yt/frontends/sdf/data_structures.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/sdf/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -26,7 +26,8 @@ from yt.geometry.particle_geometry_handler import \ ParticleIndex from yt.data_objects.static_output import \ - Dataset, ParticleFile + ParticleDataset, \ + ParticleFile from yt.funcs import \ get_requests, \ setdefaultattr @@ -53,7 +54,7 @@ class SDFFile(ParticleFile): pass -class SDFDataset(Dataset): +class SDFDataset(ParticleDataset): _index_class = ParticleIndex _file_class = SDFFile _field_info_class = SDFFieldInfo @@ -65,21 +66,19 @@ _subspace = False - def __init__(self, filename, dataset_type = "sdf_particles", - n_ref = 64, over_refine_factor = 1, - bounding_box = None, - sdf_header = None, - midx_filename = None, - midx_header = None, - midx_level = None, - field_map = None, + def __init__(self, filename, dataset_type="sdf_particles", + n_ref=64, over_refine_factor=1, + bounding_box=None, + sdf_header=None, + midx_filename=None, + midx_header=None, + midx_level=None, + field_map=None, units_override=None, unit_system="cgs"): - self.n_ref = n_ref - self.over_refine_factor = over_refine_factor if bounding_box is not None: self._subspace = True - bbox = np.array(bounding_box, dtype="float32") + bbox = np.array(bounding_box, dtype="float64") if bbox.shape == (2, 3): bbox = bbox.transpose() self.domain_left_edge = bbox[:,0] @@ -99,9 +98,10 @@ if filename.startswith("http"): prefix += 'http_' dataset_type = prefix + 'sdf_particles' - super(SDFDataset, self).__init__(filename, dataset_type, - units_override=units_override, - unit_system=unit_system) + super(SDFDataset, self).__init__( + filename, dataset_type=dataset_type, + units_override=units_override, unit_system=unit_system, + n_ref=n_ref, over_refine_factor=over_refine_factor) def _parse_parameter_file(self): if self.parameter_filename.startswith("http"): @@ -121,8 +121,7 @@ except: self.unique_identifier = time.time() - - if None in (self.domain_left_edge, self.domain_right_edge): + if self.domain_left_edge is None or self.domain_right_edge is None: R0 = self.parameters['R0'] if 'offset_center' in self.parameters and self.parameters['offset_center']: self.domain_left_edge = np.array([0, 0, 0], dtype=np.float64) diff -Nru yt-3.3.3/yt/frontends/sdf/tests/test_outputs.py yt-3.4.0/yt/frontends/sdf/tests/test_outputs.py --- yt-3.3.3/yt/frontends/sdf/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/sdf/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -41,7 +41,7 @@ if not internet_on(): return ds = SDFDataset(scivis_data) - yield assert_equal, str(ds), "ds14_scivis_0128_e4_dt04_1.0000" + assert_equal(str(ds), "ds14_scivis_0128_e4_dt04_1.0000") ad = ds.all_data() assert np.unique(ad['particle_position_x']).size > 1 ProjectionPlot(ds, "z", _fields) diff -Nru yt-3.3.3/yt/frontends/sph/data_structures.py yt-3.4.0/yt/frontends/sph/data_structures.py --- yt-3.3.3/yt/frontends/sph/data_structures.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/sph/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -16,9 +16,59 @@ #----------------------------------------------------------------------------- from yt.data_objects.static_output import \ - Dataset + ParticleDataset -class ParticleDataset(Dataset): - _unit_base = None - over_refine_factor = 1 - filter_bbox = False + +class SPHDataset(ParticleDataset): + default_kernel_name = "cubic" + + def __init__(self, filename, dataset_type=None, file_style=None, + units_override=None, unit_system="cgs", + n_ref=64, over_refine_factor=1, + kernel_name=None): + if kernel_name is None: + self.kernel_name = self.default_kernel_name + else: + self.kernel_name = kernel_name + super(SPHDataset, self).__init__( + filename, dataset_type=dataset_type, file_style=file_style, + units_override=units_override, unit_system=unit_system, + n_ref=n_ref, over_refine_factor=over_refine_factor) + + def add_smoothed_particle_field(self, smooth_field, + method="volume_weighted", nneighbors=64, + kernel_name=None): + """Add a new smoothed particle field + + Creates a new smoothed field based on the particle *smooth_field*. + + Parameters + ---------- + + smooth_field : tuple + The field name tuple of the particle field the smoothed field will + be created from. This must be a field name tuple so yt can + appropriately infer the correct particle type. + method : string, default 'volume_weighted' + The particle smoothing method to use. Can only be 'volume_weighted' + for now. + nneighbors : int, default 64 + The number of neighbors to examine during the process. + kernel_name : string or None, default None + This is the name of the smoothing kernel to use. Current supported + kernel names include `cubic`, `quartic`, `quintic`, `wendland2`, + `wendland4`, and `wendland6`. If left as None, + :attr:`~yt.frontends.sph.data_structures.SPHDataset.kernel_name` + will be used. + + Returns + ------- + + The field name tuple for the newly created field. + """ + if kernel_name is None: + kernel_name = self.kernel_name + return super(SPHDataset, self).add_smoothed_particle_field( + smooth_field=smooth_field, method=method, nneighbors=nneighbors, + kernel_name=kernel_name + ) diff -Nru yt-3.3.3/yt/frontends/stream/data_structures.py yt-3.4.0/yt/frontends/stream/data_structures.py --- yt-3.3.3/yt/frontends/stream/data_structures.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/stream/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -18,15 +18,20 @@ import weakref import numpy as np import uuid -from itertools import chain, product +from itertools import \ + chain, \ + product, \ + repeat +from collections import defaultdict from numbers import Number as numeric_type from yt.funcs import \ iterable, \ - ensure_list + ensure_list, \ + issue_deprecation_warning from yt.utilities.io_handler import io_registry -from yt.data_objects.data_containers import \ +from yt.data_objects.field_data import \ YTFieldData from yt.data_objects.particle_unions import \ ParticleUnion @@ -58,6 +63,11 @@ MatchPointsToGrids from yt.utilities.decompose import \ decompose_array, get_psize +from yt.utilities.exceptions import \ + YTIllDefinedAMR, \ + YTInconsistentGridFieldShape, \ + YTInconsistentParticleFieldShape, \ + YTInconsistentGridFieldShapeGridDims from yt.units.yt_array import \ YTQuantity, \ uconcatenate @@ -69,6 +79,10 @@ from yt.extern.six import string_types from .fields import \ StreamFieldInfo +from yt.frontends.exodus_ii.util import \ + get_num_pseudo_dims +from yt.data_objects.unions import MeshUnion + class StreamGrid(AMRGridPatch): """ @@ -88,21 +102,6 @@ self._parent_id = -1 self.Level = -1 - def _guess_properties_from_parent(self): - rf = self.ds.refine_by - my_ind = self.id - self._id_offset - self.dds = self.Parent.dds/rf - ParentLeftIndex = np.rint((self.LeftEdge-self.Parent.LeftEdge)/self.Parent.dds) - self.start_index = rf*(ParentLeftIndex + self.Parent.get_global_startindex()).astype('int64') - self.LeftEdge = self.Parent.LeftEdge + self.Parent.dds * ParentLeftIndex - self.RightEdge = self.LeftEdge + self.ActiveDimensions*self.dds - self.index.grid_left_edge[my_ind,:] = self.LeftEdge - self.index.grid_right_edge[my_ind,:] = self.RightEdge - self._child_mask = None - self._child_index_mask = None - self._child_indices = None - self._setup_dx() - def set_filename(self, filename): pass @@ -143,11 +142,11 @@ def get_fields(self): return self.fields.all_fields - def get_particle_type(self, field) : + def get_particle_type(self, field): - if field in self.particle_types : + if field in self.particle_types: return self.particle_types[field] - else : + else: return False class StreamHierarchy(GridIndex): @@ -197,6 +196,7 @@ if (i%1e4) == 0: mylog.debug("Prepared % 7i / % 7i grids", i, self.num_grids) grid.filename = None grid._prepare_grid() + grid._setup_dx() grid.proc_num = self.grid_procs[i] temp_grids[i] = grid self.grids = temp_grids @@ -245,35 +245,37 @@ else: self.io = io_registry[self.dataset_type](self.ds) - def update_data(self, data, units = None): + def _reset_particle_count(self): + self.grid_particle_count[:] = self.stream_handler.particle_count + for i, grid in enumerate(self.grids): + grid.NumberOfParticles = self.grid_particle_count[i, 0] + def update_data(self, data): """ Update the stream data with a new data dict. If fields already exist, they will be replaced, but if they do not, they will be added. Fields already in the stream but not part of the data dict will be left - alone. + alone. """ - [update_field_names(d) for d in data] - if units is not None: - self.stream_handler.field_units.update(units) particle_types = set_particle_types(data[0]) - ftype = "io" - for key in data[0].keys() : - if key is "number_of_particles": continue - self.stream_handler.particle_types[key] = particle_types[key] - - for i, grid in enumerate(self.grids) : - if "number_of_particles" in data[i] : - grid.NumberOfParticles = data[i].pop("number_of_particles") - for fname in data[i]: - if fname in grid.field_data: - grid.field_data.pop(fname, None) - elif (ftype, fname) in grid.field_data: - grid.field_data.pop( ("io", fname) ) - self.stream_handler.fields[grid.id][fname] = data[i][fname] - + self.stream_handler.particle_types.update(particle_types) + self.ds._find_particle_types() + + for i, grid in enumerate(self.grids): + field_units, gdata, number_of_particles = process_data(data[i]) + self.stream_handler.particle_count[i] = number_of_particles + self.stream_handler.field_units.update(field_units) + for field in gdata: + if field in grid.field_data: + grid.field_data.pop(field, None) + self.stream_handler.fields[grid.id][field] = gdata[field] + + self._reset_particle_count() # We only want to create a superset of fields here. + for field in self.ds.field_list: + if field[0] == "all": + self.ds.field_list.remove(field) self._detect_output_fields() self.ds.create_field_info() mylog.debug("Creating Particle Union 'all'") @@ -289,14 +291,11 @@ def __init__(self, stream_handler, storage_filename=None, geometry="cartesian", unit_system="cgs"): - #if parameter_override is None: parameter_override = {} - #self._parameter_override = parameter_override - #if conversion_override is None: conversion_override = {} - #self._conversion_override = conversion_override self.fluid_types += ("stream",) self.geometry = geometry self.stream_handler = stream_handler - name = "InMemoryParameterFile_%s" % (uuid.uuid4().hex) + self._find_particle_types() + name = "InMemoryParameterFile_%s" % uuid.uuid4().hex from yt.data_objects.static_output import _cached_datasets _cached_datasets[name] = self Dataset.__init__(self, name, self._dataset_type, @@ -356,6 +355,14 @@ def _skip_cache(self): return True + def _find_particle_types(self): + particle_types = set([]) + for k, v in self.stream_handler.particle_types.items(): + if v: + particle_types.add(k[0]) + self.particle_types = tuple(particle_types) + self.particle_types_raw = self.particle_types + class StreamDictFieldHandler(dict): _additional_fields = () @@ -367,22 +374,6 @@ fields = list(set(fields)) return fields -def update_field_names(data): - orig_names = list(data.keys()) - for k in orig_names: - if isinstance(k, tuple): - continue - s = getattr(data[k], "shape", ()) - if len(s) == 1: - field = ("io", k) - elif len(s) == 3: - field = ("stream", k) - elif len(s) == 0: - continue - else: - raise NotImplementedError - data[field] = data.pop(k) - def set_particle_types(data): particle_types = {} for key in data.keys(): @@ -401,6 +392,21 @@ will overwrite any existing particle data, so be careful! """ + for ptype in ds.particle_types_raw: + check_fields = [(ptype, "particle_position_x"), + (ptype, "particle_position")] + if all(f not in pdata for f in check_fields): + pdata_ftype = {} + for f in [k for k in sorted(pdata)]: + if not hasattr(pdata[f], "shape"): + continue + if f == 'number_of_particles': + continue + mylog.debug("Reassigning '%s' to ('%s','%s')", f, ptype, f) + pdata_ftype[ptype, f] = pdata.pop(f) + pdata_ftype.update(pdata) + pdata = pdata_ftype + # Note: what we need to do here is a bit tricky. Because occasionally this # gets called before we property handle the field detection, we cannot use # any information about the index. Fortunately for us, we can generate @@ -408,14 +414,7 @@ # stream handler. if len(ds.stream_handler.fields) > 1: - - if ("io", "particle_position_x") in pdata: - x, y, z = (pdata["io", "particle_position_%s" % ax] for ax in 'xyz') - elif ("io", "particle_position") in pdata: - x, y, z = pdata["io", "particle_position"].T - else: - raise KeyError( - "Cannot decompose particle data without position fields!") + pdata.pop("number_of_particles", None) num_grids = len(ds.stream_handler.fields) parent_ids = ds.stream_handler.parent_ids num_children = np.zeros(num_grids, dtype='int64') @@ -432,38 +431,48 @@ ds.stream_handler.parent_ids, levels, num_children) - pts = MatchPointsToGrids(grid_tree, len(x), x, y, z) - particle_grid_inds = pts.find_points_in_tree() - idxs = np.argsort(particle_grid_inds) - particle_grid_count = np.bincount(particle_grid_inds.astype("intp"), - minlength=num_grids) - particle_indices = np.zeros(num_grids + 1, dtype='int64') - if num_grids > 1 : - np.add.accumulate(particle_grid_count.squeeze(), - out=particle_indices[1:]) - else : - particle_indices[1] = particle_grid_count.squeeze() - - pdata.pop("number_of_particles", None) grid_pdata = [] - for i, pcount in enumerate(particle_grid_count): - grid = {} - grid["number_of_particles"] = pcount - start = particle_indices[i] - end = particle_indices[i+1] - for key in pdata.keys() : - grid[key] = pdata[key][idxs][start:end] + for i in range(num_grids): + grid = {"number_of_particles": 0} grid_pdata.append(grid) - else : + for ptype in ds.particle_types_raw: + if (ptype, "particle_position_x") in pdata: + x, y, z = (pdata[ptype, "particle_position_%s" % ax] for ax in 'xyz') + elif (ptype, "particle_position") in pdata: + x, y, z = pdata[ptype, "particle_position"].T + else: + raise KeyError( + "Cannot decompose particle data without position fields!") + pts = MatchPointsToGrids(grid_tree, len(x), x, y, z) + particle_grid_inds = pts.find_points_in_tree() + idxs = np.argsort(particle_grid_inds) + particle_grid_count = np.bincount(particle_grid_inds.astype("intp"), + minlength=num_grids) + particle_indices = np.zeros(num_grids + 1, dtype='int64') + if num_grids > 1: + np.add.accumulate(particle_grid_count.squeeze(), + out=particle_indices[1:]) + else: + particle_indices[1] = particle_grid_count.squeeze() + for i, pcount in enumerate(particle_grid_count): + grid_pdata[i]["number_of_particles"] += pcount + start = particle_indices[i] + end = particle_indices[i+1] + for key in pdata.keys(): + if key[0] == ptype: + grid_pdata[i][key] = pdata[key][idxs][start:end] + + else: grid_pdata = [pdata] for pd, gi in zip(grid_pdata, sorted(ds.stream_handler.fields)): ds.stream_handler.fields[gi].update(pd) + ds.stream_handler.particle_types.update(set_particle_types(pd)) npart = ds.stream_handler.fields[gi].pop("number_of_particles", 0) ds.stream_handler.particle_count[gi] = npart -def unitify_data(data): +def process_data(data, grid_dims=None): new_data, field_units = {}, {} for field, val in data.items(): # val is a data array @@ -507,11 +516,12 @@ # At this point, we have arrays for all our fields new_data = {} for field in data: + n_shape = len(data[field].shape) if isinstance(field, tuple): new_field = field - elif len(data[field].shape) in (1, 2): + elif n_shape in (1, 2): new_field = ("io", field) - elif len(data[field].shape) == 3: + elif n_shape == 3: new_field = ("stream", field) else: raise RuntimeError @@ -523,9 +533,37 @@ # overridden here. if any(f[0] == new_field[1] for f in known_fields) and \ field_units[new_field] == "": - field_units.pop(new_field) + field_units.pop(new_field) data = new_data - return field_units, data + # Sanity checking that all fields have the same dimensions. + g_shapes = [] + p_shapes = defaultdict(list) + for field in data: + f_shape = data[field].shape + n_shape = len(f_shape) + if n_shape in (1, 2): + p_shapes[field[0]].append((field[1], f_shape[0])) + elif n_shape == 3: + g_shapes.append((field, f_shape)) + if len(g_shapes) > 0: + g_s = np.array([s[1] for s in g_shapes]) + if not np.all(g_s == g_s[0]): + raise YTInconsistentGridFieldShape(g_shapes) + if grid_dims is not None: + if not np.all(g_s == grid_dims): + raise YTInconsistentGridFieldShapeGridDims(g_shapes, grid_dims) + if len(p_shapes) > 0: + for ptype, p_shape in p_shapes.items(): + p_s = np.array([s[1] for s in p_shape]) + if not np.all(p_s == p_s[0]): + raise YTInconsistentParticleFieldShape(ptype, p_shape) + # Now that we know the particle fields are consistent, determine the number + # of particles. + if len(p_shapes) > 0: + number_of_particles = np.sum([s[0][1] for s in p_shapes.values()]) + else: + number_of_particles = 0 + return field_units, data, number_of_particles def load_uniform_grid(data, domain_dimensions, length_unit=None, bbox=None, @@ -545,8 +583,7 @@ disappointing or non-existent in most cases. * Particles may be difficult to integrate. - Particle fields are detected as one-dimensional fields. The number of - particles is set by the "number_of_particles" key in data. + Particle fields are detected as one-dimensional fields. Parameters ---------- @@ -615,26 +652,25 @@ domain_left_edge = np.array(bbox[:, 0], 'float64') domain_right_edge = np.array(bbox[:, 1], 'float64') grid_levels = np.zeros(nprocs, dtype='int32').reshape((nprocs,1)) - number_of_particles = data.pop("number_of_particles", 0) - # First we fix our field names - field_units, data = unitify_data(data) - - for field_name in data: - fshape = data[field_name].shape - dshape = tuple(domain_dimensions) - pshape = (number_of_particles, ) - if fshape != dshape and fshape != pshape: - msg = ("Input data shape %s for field %s does not match provided " - "domain_dimensions %s or number of particles %s") - msg = msg % (fshape, field_name, dshape, pshape) - raise RuntimeError(msg) + # If someone included this throw it away--old API + if "number_of_particles" in data: + issue_deprecation_warning("It is no longer necessary to include " + "the number of particles in the data " + "dict. The number of particles is " + "determined from the sizes of the " + "particle fields.") + data.pop("number_of_particles") + # First we fix our field names, apply units to data + # and check for consistency of field shapes + field_units, data, number_of_particles = process_data( + data, grid_dims=tuple(domain_dimensions)) sfh = StreamDictFieldHandler() if number_of_particles > 0: particle_types = set_particle_types(data) - pdata = {} # Used much further below. - pdata["number_of_particles"] = number_of_particles + # Used much further below. + pdata = {"number_of_particles": number_of_particles} for key in list(data.keys()): if len(data[key].shape) == 1 or key[0] == 'io': if not isinstance(key, tuple): @@ -646,7 +682,6 @@ pdata[field] = data.pop(key) else: particle_types = {} - update_field_names(data) if nprocs > 1: temp = {} @@ -668,7 +703,7 @@ sfh.update({0:data}) grid_left_edges = domain_left_edge grid_right_edges = domain_right_edge - grid_dimensions = domain_dimensions.reshape(nprocs,3).astype("int32") + grid_dimensions = domain_dimensions.reshape(nprocs, 3).astype("int32") if length_unit is None: length_unit = 'code_length' @@ -700,28 +735,21 @@ handler.domain_left_edge = domain_left_edge handler.domain_right_edge = domain_right_edge handler.refine_by = 2 - handler.dimensionality = 3 + if np.all(domain_dimensions[1:] == 1): + dimensionality = 1 + elif domain_dimensions[2] == 1: + dimensionality = 2 + else: + dimensionality = 3 + handler.dimensionality = dimensionality handler.domain_dimensions = domain_dimensions handler.simulation_time = sim_time handler.cosmology_simulation = 0 sds = StreamDataset(handler, geometry=geometry, unit_system=unit_system) - check_fields = [("io", "particle_position_x"), ("io", "particle_position")] - # Now figure out where the particles go if number_of_particles > 0: - if all(f not in pdata for f in check_fields): - pdata_ftype = {} - for f in [k for k in sorted(pdata)]: - if not hasattr(pdata[f], "shape"): - continue - if f == 'number_of_particles': - continue - mylog.debug("Reassigning '%s' to ('io','%s')", f, f) - pdata_ftype["io",f] = pdata.pop(f) - pdata_ftype.update(pdata) - pdata = pdata_ftype # This will update the stream handler too assign_particle_data(sds, pdata) @@ -784,8 +812,12 @@ be z, x, y, this would be: ("cartesian", ("z", "x", "y")). The same can be done for other coordinates, for instance: ("spherical", ("theta", "phi", "r")). - refine_by : integer - Specifies the refinement ratio between levels. Defaults to 2. + refine_by : integer or list/array of integers. + Specifies the refinement ratio between levels. Defaults to 2. This + can be an array, in which case it specifies for each dimension. For + instance, this can be used to say that some datasets have refinement of + 1 in one dimension, indicating that they span the full range in that + dimension. Examples -------- @@ -795,7 +827,7 @@ ... right_edge = [1.0, 1.0, 1.], ... level = 0, ... dimensions = [32, 32, 32], - ... number_of_particles = 0) + ... number_of_particles = 0), ... dict(left_edge = [0.25, 0.25, 0.25], ... right_edge = [0.75, 0.75, 0.75], ... level = 1, @@ -827,10 +859,17 @@ grid_right_edges[i,:] = g.pop("right_edge") grid_dimensions[i,:] = g.pop("dimensions") grid_levels[i,:] = g.pop("level") + # If someone included this throw it away--old API if "number_of_particles" in g: - number_of_particles[i,:] = g.pop("number_of_particles") - field_units, data = unitify_data(g) - update_field_names(data) + issue_deprecation_warning("It is no longer necessary to include " + "the number of particles in the data " + "dict. The number of particles is " + "determined from the sizes of the " + "particle fields.") + g.pop("number_of_particles") + field_units, data, n_particles = process_data( + g, grid_dims=tuple(grid_dimensions[i,:])) + number_of_particles[i, :] = n_particles sfh[i] = data # We now reconstruct our parent ids, so that our particle assignment can @@ -846,6 +885,17 @@ for ci in ids: parent_ids[ci] = gi + # Check if the grid structure is properly aligned (bug #1295) + for lvl in range(grid_levels.min() + 1, grid_levels.max() + 1): + idx = grid_levels.flatten() == lvl + dims = domain_dimensions * refine_by ** (lvl - 1) + for iax, ax in enumerate('xyz'): + cell_edges = np.linspace(domain_left_edge[iax], + domain_right_edge[iax], + dims[iax], endpoint=False) + if set(grid_left_edges[idx, iax]) - set(cell_edges): + raise YTIllDefinedAMR(lvl, ax) + if length_unit is None: length_unit = 'code_length' if mass_unit is None: @@ -881,7 +931,13 @@ handler.domain_left_edge = domain_left_edge handler.domain_right_edge = domain_right_edge handler.refine_by = refine_by - handler.dimensionality = 3 + if np.all(domain_dimensions[1:] == 1): + dimensionality = 1 + elif domain_dimensions[2] == 1: + dimensionality = 2 + else: + dimensionality = 3 + handler.dimensionality = dimensionality handler.domain_dimensions = domain_dimensions handler.simulation_time = sim_time handler.cosmology_simulation = 0 @@ -897,7 +953,7 @@ Parameters ---------- - base_ds : Dataset + base_ds : ~yt.data_objects.static_output.Dataset This is any static output. It can also be a stream static output, for instance as returned by load_uniform_data. refinement_critera : list of :class:`~yt.utilities.flagging_methods.FlaggingMethod` @@ -933,9 +989,9 @@ if not isinstance(field, tuple): field = ("unknown", field) fi = base_ds._get_field_info(*field) - if fi.particle_type : + if fi.particle_type and field[0] in base_ds.particle_types_raw: pdata[field] = uconcatenate([grid[field] - for grid in base_ds.index.grids]) + for grid in base_ds.index.grids]) pdata["number_of_particles"] = number_of_particles last_gc = base_ds.index.num_grids @@ -951,15 +1007,15 @@ if callback is not None: callback(ds) grid_data = [] for g in ds.index.grids: - gd = dict( left_edge = g.LeftEdge, - right_edge = g.RightEdge, - level = g.Level, - dimensions = g.ActiveDimensions ) + gd = dict(left_edge=g.LeftEdge, + right_edge=g.RightEdge, + level=g.Level, + dimensions=g.ActiveDimensions) for field in ds.field_list: if not isinstance(field, tuple): field = ("unknown", field) fi = ds._get_field_info(*field) - if not fi.particle_type : + if not fi.particle_type: gd[field] = g[field] grid_data.append(gd) if g.Level < ds.index.max_level: continue @@ -969,36 +1025,32 @@ LE = sg.left_index * g.dds + ds.domain_left_edge dims = sg.dimensions * ds.refine_by grid = ds.smoothed_covering_grid(g.Level + 1, LE, dims) - gd = dict(left_edge = LE, right_edge = grid.right_edge, - level = g.Level + 1, dimensions = dims) + gd = dict(left_edge=LE, right_edge=grid.right_edge, + level=g.Level + 1, dimensions=dims) for field in ds.field_list: if not isinstance(field, tuple): field = ("unknown", field) fi = ds._get_field_info(*field) - if not fi.particle_type : + if not fi.particle_type: gd[field] = grid[field] grid_data.append(gd) ds = load_amr_grids(grid_data, ds.domain_dimensions, bbox=bbox) + ds.particle_types_raw = base_ds.particle_types_raw + ds.particle_types = ds.particle_types_raw + + # Now figure out where the particles go if number_of_particles > 0: - if ("io", "particle_position_x") not in pdata: - pdata_ftype = {} - for f in [k for k in sorted(pdata)]: - if not hasattr(pdata[f], "shape"): continue - mylog.debug("Reassigning '%s' to ('io','%s')", f, f) - pdata_ftype["io",f] = pdata.pop(f) - pdata_ftype.update(pdata) - pdata = pdata_ftype + # This will update the stream handler too assign_particle_data(ds, pdata) - # We need to reassign the field list here. + cur_gc = ds.index.num_grids return ds class StreamParticleIndex(ParticleIndex): - def __init__(self, ds, dataset_type = None): self.stream_handler = ds.stream_handler super(StreamParticleIndex, self).__init__(ds, dataset_type) @@ -1034,10 +1086,9 @@ This should allow a collection of particle data to be loaded directly into yt and analyzed as would any others. This comes with several caveats: - * Units will be incorrect unless the data has already been converted to - cgs. - * Some functions may behave oddly, and parallelism will be - disappointing or non-existent in most cases. + * There must be sufficient space in memory to contain both the particle + data and the octree used to index the particles. + * Parallelism will be disappointing or non-existent in most cases. This will initialize an Octree of data. Note that fluid fields will not work yet, or possibly ever. @@ -1045,9 +1096,9 @@ Parameters ---------- data : dict - This is a dict of numpy arrays, where the keys are the field names. - Particles positions must be named "particle_position_x", - "particle_position_y", "particle_position_z". + This is a dict of numpy arrays or (numpy array, unit name) tuples, + where the keys are the field names. Particles positions must be named + "particle_position_x", "particle_position_y", and "particle_position_z". length_unit : float Conversion factor from simulation length units to centimeters mass_unit : float @@ -1085,11 +1136,13 @@ nprocs = 1 if bbox is None: bbox = np.array([[0.0, 1.0], [0.0, 1.0], [0.0, 1.0]], 'float64') + else: + bbox = np.array(bbox) domain_left_edge = np.array(bbox[:, 0], 'float64') domain_right_edge = np.array(bbox[:, 1], 'float64') grid_levels = np.zeros(nprocs, dtype='int32').reshape((nprocs,1)) - field_units, data = unitify_data(data) + field_units, data, _ = process_data(data) sfh = StreamDictFieldHandler() pdata = {} @@ -1102,9 +1155,7 @@ pdata[field] = data[key] sfh._additional_fields += (field,) data = pdata # Drop reference count - update_field_names(data) particle_types = set_particle_types(data) - sfh.update({'stream_file':data}) grid_left_edges = domain_left_edge grid_right_edges = domain_right_edge @@ -1160,7 +1211,7 @@ r"""Define the cell coordinates and cell neighbors of a hexahedral mesh for a semistructured grid. Used to specify the connectivity and coordinates parameters used in - :function:`~yt.frontends.stream.data_structures.load_hexahedral_mesh`. + :func:`~yt.frontends.stream.data_structures.load_hexahedral_mesh`. Parameters ---------- @@ -1316,7 +1367,7 @@ domain_right_edge = np.array(bbox[:, 1], 'float64') grid_levels = np.zeros(nprocs, dtype='int32').reshape((nprocs,1)) - field_units, data = unitify_data(data) + field_units, data, _ = process_data(data) sfh = StreamDictFieldHandler() particle_types = set_particle_types(data) @@ -1562,9 +1613,8 @@ domain_left_edge = np.array(bbox[:, 0], 'float64') domain_right_edge = np.array(bbox[:, 1], 'float64') grid_levels = np.zeros(nprocs, dtype='int32').reshape((nprocs,1)) - update_field_names(data) - field_units, data = unitify_data(data) + field_units, data, _ = process_data(data) sfh = StreamDictFieldHandler() particle_types = set_particle_types(data) @@ -1635,8 +1685,9 @@ coords = ensure_list(self.stream_handler.fields.pop("coordinates")) connec = ensure_list(self.stream_handler.fields.pop("connectivity")) self.meshes = [StreamUnstructuredMesh( - i, self.index_filename, c1, c2, self) - for i, (c1, c2) in enumerate(zip(connec, coords))] + i, self.index_filename, c1, c2, self) + for i, (c1, c2) in enumerate(zip(connec, repeat(coords[0])))] + self.mesh_union = MeshUnion("mesh_union", self.meshes) def _setup_data_io(self): if self.stream_handler.io is not None: @@ -1646,12 +1697,17 @@ def _detect_output_fields(self): self.field_list = list(set(self.stream_handler.get_fields())) + fnames = list(set([fn for ft, fn in self.field_list])) + self.field_list += [('all', fname) for fname in fnames] class StreamUnstructuredMeshDataset(StreamDataset): _index_class = StreamUnstructuredIndex _field_info_class = StreamFieldInfo _dataset_type = "stream_unstructured" + def _find_particle_types(self): + pass + def load_unstructured_mesh(connectivity, coordinates, node_data=None, elem_data=None, length_unit=None, bbox=None, sim_time=0.0, mass_unit=None, time_unit=None, @@ -1683,9 +1739,11 @@ connectivity length and should be of shape (N,M) where N is the number of elements and M is the number of vertices per element. coordinates : array_like - The 3D coordinates of mesh vertices. This should be of size (L,3) where - L is the number of vertices. When loading more than one mesh, the data - for each mesh should be concatenated into a single coordinates array. + The 3D coordinates of mesh vertices. This should be of size (L, D) where + L is the number of vertices and D is the number of coordinates per vertex + (the spatial dimensions of the dataset). Currently this must be either 2 or 3. + When loading more than one mesh, the data for each mesh should be concatenated + into a single coordinates array. node_data : dict or list of dicts For a single mesh, a dict mapping field names to 2D numpy arrays, representing data defined at element vertices. For multiple meshes, @@ -1744,6 +1802,7 @@ """ + dimensionality = coordinates.shape[1] domain_dimensions = np.ones(3, "int32") * 2 nprocs = 1 @@ -1774,9 +1833,23 @@ data = ensure_list(data) if bbox is None: - bbox = np.array([[coordinates[:,i].min() - 0.1 * abs(coordinates[:,i].min()), - coordinates[:,i].max() + 0.1 * abs(coordinates[:,i].max())] - for i in range(3)], "float64") + bbox = [[coordinates[:,i].min() - 0.1 * abs(coordinates[:,i].min()), + coordinates[:,i].max() + 0.1 * abs(coordinates[:,i].max())] + for i in range(dimensionality)] + + if dimensionality < 3: + bbox.append([0.0, 1.0]) + if dimensionality < 2: + bbox.append([0.0, 1.0]) + + # handle pseudo-dims here + num_pseudo_dims = get_num_pseudo_dims(coordinates) + dimensionality -= num_pseudo_dims + for i in range(dimensionality, 3): + bbox[i][0] = 0.0 + bbox[i][1] = 1.0 + + bbox = np.array(bbox, dtype=np.float64) domain_left_edge = np.array(bbox[:, 0], 'float64') domain_right_edge = np.array(bbox[:, 1], 'float64') grid_levels = np.zeros(nprocs, dtype='int32').reshape((nprocs,1)) @@ -1788,7 +1861,7 @@ sfh.update({'connectivity': connectivity, 'coordinates': coordinates}) for i, d in enumerate(data): - _f_unit, _data = unitify_data(d) + _f_unit, _data, _ = process_data(d) field_units.update(_f_unit) sfh[i] = _data particle_types.update(set_particle_types(d)) @@ -1802,7 +1875,7 @@ raise RuntimeError grid_left_edges = domain_left_edge grid_right_edges = domain_right_edge - grid_dimensions = domain_dimensions.reshape(nprocs,3).astype("int32") + grid_dimensions = domain_dimensions.reshape(nprocs, 3).astype("int32") if length_unit is None: length_unit = 'code_length' @@ -1835,7 +1908,7 @@ handler.domain_left_edge = domain_left_edge handler.domain_right_edge = domain_right_edge handler.refine_by = 2 - handler.dimensionality = 3 + handler.dimensionality = dimensionality handler.domain_dimensions = domain_dimensions handler.simulation_time = sim_time handler.cosmology_simulation = 0 @@ -1843,13 +1916,16 @@ sds = StreamUnstructuredMeshDataset(handler, geometry=geometry, unit_system=unit_system) - fluid_types = () + fluid_types = ['all'] for i in range(1, num_meshes + 1): - fluid_types += ('connect%d' % i,) - sds.fluid_types = fluid_types + fluid_types += ['connect%d' % i] + sds.fluid_types = tuple(fluid_types) + + def flatten(l): + return [item for sublist in l for item in sublist] - sds._node_fields = node_data[0].keys() - sds._elem_fields = elem_data[0].keys() + sds._node_fields = flatten([[f[1] for f in m] for m in node_data if m]) + sds._elem_fields = flatten([[f[1] for f in m] for m in elem_data if m]) sds.default_field = [f for f in sds.field_list if f[0] == 'connect1'][-1] diff -Nru yt-3.3.3/yt/frontends/stream/fields.py yt-3.4.0/yt/frontends/stream/fields.py --- yt-3.3.3/yt/frontends/stream/fields.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/stream/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -74,11 +74,14 @@ from yt.fields.magnetic_field import \ setup_magnetic_field_aliases for field in self.ds.stream_handler.field_units: + if field[0] in self.ds.particle_types: + continue units = self.ds.stream_handler.field_units[field] - if units != '': self.add_output_field(field, units=units) + if units != '': + self.add_output_field(field, sampling_type="cell", units=units) setup_magnetic_field_aliases(self, "stream", ["magnetic_field_%s" % ax for ax in "xyz"]) - def add_output_field(self, name, **kwargs): + def add_output_field(self, name, sampling_type, **kwargs): if name in self.ds.stream_handler.field_units: kwargs['units'] = self.ds.stream_handler.field_units[name] - super(StreamFieldInfo, self).add_output_field(name, **kwargs) + super(StreamFieldInfo, self).add_output_field(name, sampling_type, **kwargs) diff -Nru yt-3.3.3/yt/frontends/stream/io.py yt-3.4.0/yt/frontends/stream/io.py --- yt-3.3.3/yt/frontends/stream/io.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/stream/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -49,6 +49,7 @@ rv = {} for field in fields: rv[field] = self.ds.arr(np.empty(size, dtype="float64")) + ng = sum(len(c.objs) for c in chunks) mylog.debug("Reading %s cells of %s fields in %s blocks", size, [f2 for f1, f2 in fields], ng) @@ -262,26 +263,36 @@ def _read_fluid_selection(self, chunks, selector, fields, size): chunks = list(chunks) - chunk = chunks[0] - mesh_id = chunk.objs[0].mesh_id rv = {} for field in fields: - if field in self.ds._node_fields: - nodes_per_element = self.fields[mesh_id][field].shape[1] - rv[field] = np.empty((size, nodes_per_element), dtype="float64") + ftype, fname = field + if ftype == "all": + ci = np.concatenate([mesh.connectivity_indices + for mesh in self.ds.index.mesh_union]) else: - rv[field] = np.empty(size, dtype="float64") - ngrids = sum(len(chunk.objs) for chunk in chunks) - mylog.debug("Reading %s cells of %s fields in %s blocks", - size, [fname for ftype, fname in fields], ngrids) + mesh_id = int(ftype[-1]) - 1 + m = self.ds.index.meshes[mesh_id] + ci = m.connectivity_indices + num_elem = ci.shape[0] + if fname in self.ds._node_fields: + nodes_per_element = ci.shape[1] + rv[field] = np.empty((num_elem, nodes_per_element), dtype="float64") + else: + rv[field] = np.empty(num_elem, dtype="float64") for field in fields: ind = 0 ftype, fname = field - for chunk in chunks: - for g in chunk.objs: - ds = self.fields[g.mesh_id].get(field, None) - if ds is None: - ds = self.fields[g.mesh_id][fname] - ind += g.select(selector, ds, rv[field], ind) # caches + if ftype == "all": + objs = [mesh for mesh in self.ds.index.mesh_union] + else: + mesh_ids = [int(ftype[-1])] + chunk = chunks[mesh_ids[0] - 1] + objs = chunk.objs + for g in objs: + ds = self.fields[g.mesh_id].get(field, None) + if ds is None: + f = ('connect%d' % (g.mesh_id + 1), fname) + ds = self.fields[g.mesh_id][f] + ind += g.select(selector, ds, rv[field], ind) # caches return rv diff -Nru yt-3.3.3/yt/frontends/stream/sample_data/hexahedral_mesh.py yt-3.4.0/yt/frontends/stream/sample_data/hexahedral_mesh.py --- yt-3.3.3/yt/frontends/stream/sample_data/hexahedral_mesh.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/stream/sample_data/hexahedral_mesh.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,900 +1,6200 @@ import numpy as np +# This mesh can be found at +# https://github.com/idaholab/moose/tree/master/test/tests/bcs/nodal_normals/cylinder-hexes.e + _coordinates = np.array([ - [0.0000000000000000 , -0.8125000000000001, 2.0833333333333339 ], - [0.0000000000000000 , -0.5416666666666667, 2.0833333333333330 ], - [-0.2437923510437428, -0.5072607006117749, 2.0833333333333330 ], - [-0.2483606206966718, -0.7628865901385861, 2.0833333333333330 ], - [0.0000000000000000 , -0.7500000000000000, 2.5000000000000000 ], - [0.0000000000000000 , -0.5000000000000000, 2.5000000000000000 ], - [-0.2250390932711473, -0.4682406467185613, 2.5000000000000000 ], - [-0.2292559575661586, -0.7042030062817715, 2.5000000000000000 ], - [0.0000000000000000 , -0.2708333333333335, 2.0833333333333326 ], - [-0.2531938042456175, -0.2531328741007527, 2.0833333333333335 ], - [0.0000000000000000 , -0.2500000000000000, 2.5000000000000000 ], - [-0.2337173577651854, -0.2336611145545408, 2.5000000000000000 ], - [0.0000000000000000 , 0.0000000000000000 , 2.0833333333333339 ], - [-0.2708333333333334, 0.0000000000000000 , 2.0833333333333335 ], - [0.0000000000000000 , 0.0000000000000000 , 2.5000000000000000 ], - [-0.2500000000000000, 0.0000000000000000 , 2.5000000000000000 ], - [-0.4773231602441076, -0.4771907365673795, 2.0833333333333330 ], - [-0.4721542164906790, -0.6988705512160990, 2.0833333333333326 ], - [-0.4406059940714839, -0.4404837568314270, 2.5000000000000000 ], - [-0.4358346613760113, -0.6451112780456295, 2.5000000000000000 ], - [-0.5073162115235609, -0.2437128017198579, 2.0833333333333330 ], - [-0.4682918875602099, -0.2249656631260225, 2.5000000000000000 ], - [-0.5416666666666667, 0.0000000000000000 , 2.0833333333333339 ], - [-0.5000000000000000, 0.0000000000000000 , 2.5000000000000000 ], - [-0.6991364731483094, -0.4721669375744591, 2.0833333333333326 ], - [-0.6427180081426563, -0.6425814381092382, 2.0833333333333326 ], - [-0.6453567444445931, -0.4358464039148850, 2.5000000000000000 ], - [-0.5932781613624519, -0.5931520967162195, 2.5000000000000000 ], - [-0.7630779380224706, -0.2484234078998417, 2.0833333333333330 ], - [-0.7043796350976650, -0.2293139149844690, 2.5000000000000000 ], - [-0.8125000000000001, 0.0000000000000000 , 2.0833333333333330 ], - [-0.7500000000000000, 0.0000000000000000 , 2.5000000000000000 ], - [-1.0833333333333335, 0.0000000000000000 , 2.0833333333333326 ], - [-1.0464196451464907, -0.2803872988610649, 2.0833333333333313 ], - [-1.0000000000000000, 0.0000000000000000 , 2.5000000000000000 ], - [-0.9659258262890682, -0.2588190451025207, 2.5000000000000000 ], - [-0.9381941874331419, -0.5416666666666671, 2.0833333333333317 ], - [-0.8660254037844388, -0.4999999999999998, 2.5000000000000000 ], - [-0.7660323462854266, -0.7660323462854266, 2.0833333333333317 ], - [-0.7071067811865477, -0.7071067811865475, 2.5000000000000000 ], - [-0.5416666666666669, -0.9381941874331422, 2.0833333333333313 ], - [-0.5000000000000004, -0.8660254037844384, 2.5000000000000000 ], - [-0.2803872988610638, -1.0464196451464911, 2.0833333333333313 ], - [-0.2588190451025206, -0.9659258262890682, 2.5000000000000000 ], - [0.0000000000000000 , -1.0833333333333335, 2.0833333333333326 ], - [0.0000000000000000 , -1.0000000000000000, 2.5000000000000000 ], - [0.0000000000000000 , -0.8750000000000000, 1.6666666666666661 ], - [0.0000000000000000 , -0.5833333333333334, 1.6666666666666670 ], - [-0.2625456088163383, -0.5462807545049883, 1.6666666666666663 ], - [-0.2674652838271848, -0.8215701739954002, 1.6666666666666665 ], - [0.0000000000000000 , -0.2916666666666667, 1.6666666666666663 ], - [-0.2726702507260495, -0.2726046336469644, 1.6666666666666667 ], - [0.0000000000000000 , 0.0000000000000000 , 1.6666666666666670 ], - [-0.2916666666666669, 0.0000000000000000 , 1.6666666666666672 ], - [-0.5140403264167310, -0.5138977163033317, 1.6666666666666665 ], - [-0.5084737716053463, -0.7526298243865681, 1.6666666666666663 ], - [-0.5463405354869115, -0.2624599403136930, 1.6666666666666665 ], - [-0.5833333333333335, 0.0000000000000000 , 1.6666666666666667 ], - [-0.7529162018520253, -0.5084874712340327, 1.6666666666666663 ], - [-0.6921578549228604, -0.6920107795022563, 1.6666666666666663 ], - [-0.8217762409472759, -0.2675329008152139, 1.6666666666666667 ], - [-0.8750000000000001, 0.0000000000000000 , 1.6666666666666667 ], - [-1.1666666666666667, 0.0000000000000000 , 1.6666666666666665 ], - [-1.1269134640039129, -0.3019555526196073, 1.6666666666666663 ], - [-1.0103629710818449, -0.5833333333333336, 1.6666666666666663 ], - [-0.8249579113843054, -0.8249579113843054, 1.6666666666666665 ], - [-0.5833333333333334, -1.0103629710818451, 1.6666666666666661 ], - [-0.3019555526196072, -1.1269134640039133, 1.6666666666666656 ], - [0.0000000000000000 , -1.1666666666666667, 1.6666666666666665 ], - [0.0000000000000000 , -0.9375000000000000, 1.2499999999999993 ], - [0.0000000000000000 , -0.6250000000000000, 1.2500000000000000 ], - [-0.2812988665889337, -0.5853008083982015, 1.2499999999999998 ], - [-0.2865699469576979, -0.8802537578522143, 1.2500000000000002 ], - [0.0000000000000000 , -0.3125000000000000, 1.2500000000000000 ], - [-0.2921466972064814, -0.2920763931931761, 1.2500000000000002 ], - [0.0000000000000000 , 0.0000000000000000 , 1.2500000000000000 ], - [-0.3125000000000000, 0.0000000000000000 , 1.2500000000000000 ], - [-0.5507574925893547, -0.5506046960392839, 1.2500000000000000 ], - [-0.5447933267200140, -0.8063890975570370, 1.2499999999999998 ], - [-0.5853648594502623, -0.2812070789075282, 1.2500000000000000 ], - [-0.6250000000000000, 0.0000000000000000 , 1.2500000000000000 ], - [-0.8066959305557415, -0.5448080048936064, 1.2499999999999998 ], - [-0.7415977017030648, -0.7414401208952744, 1.2499999999999998 ], - [-0.8804745438720813, -0.2866423937305864, 1.2500000000000002 ], - [-0.9375000000000000, 0.0000000000000000 , 1.2500000000000000 ], - [-1.2500000000000000, 0.0000000000000000 , 1.2499999999999998 ], - [-1.2074072828613354, -0.3235238063781507, 1.2499999999999991 ], - [-1.0825317547305480, -0.6250000000000003, 1.2499999999999998 ], - [-0.8838834764831843, -0.8838834764831843, 1.2499999999999998 ], - [-0.6250000000000000, -1.0825317547305484, 1.2499999999999998 ], - [-0.3235238063781505, -1.2074072828613354, 1.2500000000000002 ], - [0.0000000000000000 , -1.2500000000000000, 1.2499999999999998 ], - [0.0000000000000000 , -1.0000000000000000, 0.8333333333333335 ], - [0.0000000000000000 , -0.6666666666666666, 0.8333333333333335 ], - [-0.3000521243615294, -0.6243208622914150, 0.8333333333333333 ], - [-0.3056746100882112, -0.9389373417090288, 0.8333333333333336 ], - [0.0000000000000000 , -0.3333333333333333, 0.8333333333333341 ], - [-0.3116231436869136, -0.3115481527393878, 0.8333333333333337 ], - [0.0000000000000000 , 0.0000000000000000 , 0.8333333333333335 ], - [-0.3333333333333331, 0.0000000000000000 , 0.8333333333333337 ], - [-0.5874746587619785, -0.5873116757752362, 0.8333333333333334 ], - [-0.5811128818346817, -0.8601483707275063, 0.8333333333333331 ], - [-0.6243891834136132, -0.2999542175013634, 0.8333333333333334 ], - [-0.6666666666666665, 0.0000000000000000 , 0.8333333333333335 ], - [-0.8604756592594576, -0.5811285385531803, 0.8333333333333331 ], - [-0.7910375484832691, -0.7908694622882930, 0.8333333333333330 ], - [-0.9391728467968867, -0.3057518866459589, 0.8333333333333335 ], - [-1.0000000000000000, 0.0000000000000000 , 0.8333333333333334 ], - [-1.3333333333333333, 0.0000000000000000 , 0.8333333333333333 ], - [-1.2879011017187574, -0.3450920601366952, 0.8333333333333330 ], - [-1.1547005383792512, -0.6666666666666670, 0.8333333333333328 ], - [-0.9428090415820632, -0.9428090415820632, 0.8333333333333333 ], - [-0.6666666666666667, -1.1547005383792517, 0.8333333333333330 ], - [-0.3450920601366939, -1.2879011017187578, 0.8333333333333335 ], - [0.0000000000000000 , -1.3333333333333333, 0.8333333333333333 ], - [0.0000000000000000 , -1.0625000000000000, 0.4166666666666665 ], - [0.0000000000000000 , -0.7083333333333334, 0.4166666666666670 ], - [-0.3188053821341250, -0.6633409161846285, 0.4166666666666667 ], - [-0.3247792732187244, -0.9976209255658430, 0.4166666666666670 ], - [0.0000000000000000 , -0.3541666666666667, 0.4166666666666671 ], - [-0.3310995901673457, -0.3310199122855996, 0.4166666666666672 ], - [0.0000000000000000 , 0.0000000000000000 , 0.4166666666666670 ], - [-0.3541666666666669, 0.0000000000000000 , 0.4166666666666672 ], - [-0.6241918249346020, -0.6240186555111885, 0.4166666666666669 ], - [-0.6174324369493491, -0.9139076438979755, 0.4166666666666667 ], - [-0.6634135073769639, -0.3187013560951987, 0.4166666666666669 ], - [-0.7083333333333335, 0.0000000000000000 , 0.4166666666666670 ], - [-0.9142553879631736, -0.6174490722127540, 0.4166666666666667 ], - [-0.8404773952634734, -0.8402988036813114, 0.4166666666666665 ], - [-0.9978711497216920, -0.3248613795613314, 0.4166666666666670 ], - [-1.0625000000000000, 0.0000000000000000 , 0.4166666666666670 ], - [-1.4166666666666667, 0.0000000000000000 , 0.4166666666666667 ], - [-1.3683949205761798, -0.3666603138952387, 0.4166666666666663 ], - [-1.2268693220279543, -0.7083333333333337, 0.4166666666666665 ], - [-1.0017346066809423, -1.0017346066809423, 0.4166666666666666 ], - [-0.7083333333333334, -1.2268693220279547, 0.4166666666666667 ], - [-0.3666603138952378, -1.3683949205761798, 0.4166666666666668 ], - [0.0000000000000000 , -1.4166666666666667, 0.4166666666666667 ], - [0.0000000000000000 , -1.1250000000000000, 0.0000000000000000 ], - [0.0000000000000000 , -0.7500000000000000, 0.0000000000000000 ], - [-0.3375586399067205, -0.7023609700778420, -0.0000000000000001], - [-0.3438839363492374, -1.0563045094226573, 0.0000000000000002 ], - [0.0000000000000000 , -0.3750000000000000, 0.0000000000000000 ], - [-0.3505760366477777, -0.3504916718318113, 0.0000000000000003 ], - [0.0000000000000000 , 0.0000000000000000 , 0.0000000000000000 ], - [-0.3750000000000000, 0.0000000000000000 , 0.0000000000000000 ], - [-0.6609089911072255, -0.6607256352471409, -0.0000000000000000], - [-0.6537519920640165, -0.9676669170684447, -0.0000000000000001], - [-0.7024378313403146, -0.3374484946890339, -0.0000000000000000], - [-0.7500000000000000, 0.0000000000000000 , 0.0000000000000000 ], - [-0.9680351166668895, -0.6537696058723279, -0.0000000000000001], - [-0.8899172420436775, -0.8897281450743297, -0.0000000000000003], - [-1.0565694526464973, -0.3439708724767039, 0.0000000000000000 ], - [-1.1250000000000000, 0.0000000000000000 , 0.0000000000000000 ], - [-1.5000000000000000, 0.0000000000000000 , 0.0000000000000000 ], - [-1.4488887394336021, -0.3882285676537821, -0.0000000000000003], - [-1.2990381056766576, -0.7500000000000003, -0.0000000000000000], - [-1.0606601717798212, -1.0606601717798212, 0.0000000000000000 ], - [-0.7499999999999990, -1.2990381056766584, -0.0000000000000001], - [-0.3882285676537806, -1.4488887394336025, 0.0000000000000001 ], - [0.0000000000000000 , -1.5000000000000000, 0.0000000000000000 ], - [0.0000000000000000 , -1.1875000000000000, -0.4166666666666665], - [0.0000000000000000 , -0.7916666666666666, -0.4166666666666665], - [-0.3563118976793160, -0.7413810239710554, -0.4166666666666664], - [-0.3629885994797506, -1.1149880932794718, -0.4166666666666661], - [0.0000000000000000 , -0.3958333333333333, -0.4166666666666665], - [-0.3700524831282098, -0.3699634313780231, -0.4166666666666661], - [0.0000000000000000 , 0.0000000000000000 , -0.4166666666666665], - [-0.3958333333333331, 0.0000000000000000 , -0.4166666666666663], - [-0.6976261572798490, -0.6974326149830932, -0.4166666666666662], - [-0.6900715471786840, -1.0214261902389137, -0.4166666666666663], - [-0.7414621553036653, -0.3561956332828691, -0.4166666666666663], - [-0.7916666666666666, 0.0000000000000000 , -0.4166666666666665], - [-1.0218148453706055, -0.6900901395319018, -0.4166666666666662], - [-0.9393570888238817, -0.9391574864673480, -0.4166666666666664], - [-1.1152677555713026, -0.3630803653920763, -0.4166666666666662], - [-1.1875000000000000, 0.0000000000000000 , -0.4166666666666661], - [-1.5833333333333333, 0.0000000000000000 , -0.4166666666666663], - [-1.5293825582910243, -0.4097968214123255, -0.4166666666666661], - [-1.3712068893253606, -0.7916666666666670, -0.4166666666666663], - [-1.1195857368787001, -1.1195857368787001, -0.4166666666666657], - [-0.7916666666666655, -1.3712068893253615, -0.4166666666666660], - [-0.4097968214123239, -1.5293825582910248, -0.4166666666666657], - [0.0000000000000000 , -1.5833333333333333, -0.4166666666666663], - [0.0000000000000000 , -1.2499999999999998, -0.8333333333333329], - [0.0000000000000000 , -0.8333333333333333, -0.8333333333333330], - [-0.3750651554519118, -0.7804010778642688, -0.8333333333333330], - [-0.3820932626102639, -1.1736716771362858, -0.8333333333333328], - [0.0000000000000000 , -0.4166666666666666, -0.8333333333333333], - [-0.3895289296086420, -0.3894351909242348, -0.8333333333333327], - [0.0000000000000000 , 0.0000000000000000 , -0.8333333333333333], - [-0.4166666666666666, 0.0000000000000000 , -0.8333333333333329], - [-0.7343433234524727, -0.7341395947190453, -0.8333333333333329], - [-0.7263911022933516, -1.0751854634093825, -0.8333333333333329], - [-0.7804864792670162, -0.3749427718767044, -0.8333333333333329], - [-0.8333333333333333, 0.0000000000000000 , -0.8333333333333335], - [-1.0755945740743216, -0.7264106731914756, -0.8333333333333329], - [-0.9887969356040860, -0.9885868278603661, -0.8333333333333331], - [-1.1739660584961080, -0.3821898583074488, -0.8333333333333329], - [-1.2500000000000000, 0.0000000000000000 , -0.8333333333333330], - [-1.6666666666666665, 0.0000000000000000 , -0.8333333333333330], - [-1.6098763771484466, -0.4313650751708690, -0.8333333333333327], - [-1.4433756729740639, -0.8333333333333337, -0.8333333333333329], - [-1.1785113019775790, -1.1785113019775790, -0.8333333333333330], - [-0.8333333333333321, -1.4433756729740648, -0.8333333333333328], - [-0.4313650751708673, -1.6098763771484472, -0.8333333333333328], - [0.0000000000000000 , -1.6666666666666665, -0.8333333333333330], - [0.0000000000000000 , -1.3125000000000000, -1.2500000000000000], - [0.0000000000000000 , -0.8750000000000000, -1.2500000000000000], - [-0.3938184132245074, -0.8194211317574822, -1.2500000000000000], - [-0.4011979257407772, -1.2323552609931001, -1.2500000000000000], - [0.0000000000000000 , -0.4375000000000000, -1.2500000000000000], - [-0.4090053760890742, -0.4089069504704466, -1.2499999999999998], - [0.0000000000000000 , 0.0000000000000000 , -1.2500000000000000], - [-0.4375000000000000, 0.0000000000000000 , -1.2500000000000000], - [-0.7710604896250963, -0.7708465744549975, -1.2500000000000000], - [-0.7627106574080192, -1.1289447365798515, -1.2500000000000000], - [-0.8195108032303671, -0.3936899104705396, -1.2500000000000000], - [-0.8750000000000000, 0.0000000000000000 , -1.2500000000000000], - [-1.1293743027780376, -0.7627312068510492, -1.2500000000000000], - [-1.0382367823842904, -1.0380161692533845, -1.2500000000000002], - [-1.2326643614209134, -0.4012993512228211, -1.2500000000000000], - [-1.3125000000000000, 0.0000000000000000 , -1.2500000000000000], - [-1.7500000000000000, 0.0000000000000000 , -1.2499999999999998], - [-1.6903701960058690, -0.4529333289294124, -1.2499999999999993], - [-1.5155444566227672, -0.8750000000000003, -1.2499999999999998], - [-1.2374368670764579, -1.2374368670764579, -1.2499999999999996], - [-0.8749999999999989, -1.5155444566227683, -1.2500000000000000], - [-0.4529333289294107, -1.6903701960058697, -1.2500000000000000], - [0.0000000000000000 , -1.7500000000000000, -1.2499999999999998], - [0.0000000000000000 , -1.3750000000000000, -1.6666666666666661], - [0.0000000000000000 , -0.9166666666666666, -1.6666666666666661], - [-0.4125716709971030, -0.8584411856506958, -1.6666666666666654], - [-0.4203025888712904, -1.2910388448499144, -1.6666666666666654], - [0.0000000000000000 , -0.4583333333333333, -1.6666666666666661], - [-0.4284818225695063, -0.4283787100166584, -1.6666666666666652], - [0.0000000000000000 , 0.0000000000000000 , -1.6666666666666665], - [-0.4583333333333333, 0.0000000000000000 , -1.6666666666666659], - [-0.8077776557977200, -0.8075535541909499, -1.6666666666666654], - [-0.7990302125226868, -1.1827040097503210, -1.6666666666666654], - [-0.8585351271937178, -0.4124370490643749, -1.6666666666666654], - [-0.9166666666666666, 0.0000000000000000 , -1.6666666666666665], - [-1.1831540314817535, -0.7990517405106230, -1.6666666666666654], - [-1.0876766291644946, -1.0874455106464027, -1.6666666666666656], - [-1.2913626643457188, -0.4204088441381936, -1.6666666666666654], - [-1.3750000000000000, 0.0000000000000000 , -1.6666666666666652], - [-1.8333333333333333, 0.0000000000000000 , -1.6666666666666661], - [-1.7708640148632913, -0.4745015826879559, -1.6666666666666661], - [-1.5877132402714702, -0.9166666666666670, -1.6666666666666661], - [-1.2963624321753369, -1.2963624321753369, -1.6666666666666656], - [-0.9166666666666653, -1.5877132402714711, -1.6666666666666652], - [-0.4745015826879540, -1.7708640148632917, -1.6666666666666654], - [0.0000000000000000 , -1.8333333333333333, -1.6666666666666661], - [0.0000000000000000 , -1.4375000000000000, -2.0833333333333326], - [0.0000000000000000 , -0.9583333333333333, -2.0833333333333339], - [-0.4313249287696987, -0.8974612395439092, -2.0833333333333326], - [-0.4394072520018036, -1.3497224287067286, -2.0833333333333326], - [0.0000000000000000 , -0.4791666666666666, -2.0833333333333339], - [-0.4479582690499386, -0.4478504695628701, -2.0833333333333326], - [0.0000000000000000 , 0.0000000000000000 , -2.0833333333333335], - [-0.4791666666666666, 0.0000000000000000 , -2.0833333333333326], - [-0.8444948219703436, -0.8442605339269020, -2.0833333333333326], - [-0.8353497676373542, -1.2364632829207900, -2.0833333333333326], - [-0.8975594511570687, -0.4311841876582101, -2.0833333333333326], - [-0.9583333333333333, 0.0000000000000000 , -2.0833333333333339], - [-1.2369337601854695, -0.8353722741701967, -2.0833333333333326], - [-1.1371164759446988, -1.1368748520394210, -2.0833333333333326], - [-1.3500609672705242, -0.4395183370535659, -2.0833333333333326], - [-1.4374999999999998, 0.0000000000000000 , -2.0833333333333326], - [-1.9166666666666665, 0.0000000000000000 , -2.0833333333333326], - [-1.8513578337207135, -0.4960698364464993, -2.0833333333333321], - [-1.6598820239201735, -0.9583333333333337, -2.0833333333333326], - [-1.3552879972742158, -1.3552879972742158, -2.0833333333333321], - [-0.9583333333333320, -1.6598820239201746, -2.0833333333333326], - [-0.4960698364464974, -1.8513578337207142, -2.0833333333333326], - [0.0000000000000000 , -1.9166666666666665, -2.0833333333333326], - [0.0000000000000000 , -1.5000000000000000, -2.5000000000000000], - [0.0000000000000000 , -1.0000000000000000, -2.5000000000000000], - [-0.4499952725655263, -0.9363929461871566, -2.5000000000000000], - [-0.4597430868643299, -1.4094379316218288, -2.5000000000000000], - [0.0000000000000000 , -0.5000000000000000, -2.5000000000000000], - [-0.4700632574288765, -0.4699949138353878, -2.5000000000000000], - [0.0000000000000000 , 0.0000000000000000 , -2.5000000000000000], - [-0.5000000000000000, 0.0000000000000000 , -2.5000000000000000], - [-0.8831884830467643, -0.8829937102417594, -2.5000000000000000], - [-0.8764233639116027, -1.2931017228121302, -2.5000000000000000], - [-0.9377140255218310, -0.4511488942288137, -2.5000000000000000], - [-1.0000000000000000, 0.0000000000000000 , -2.5000000000000000], - [-1.2930592322990337, -0.8760156748234377, -2.5000000000000000], - [-1.1945653861945771, -1.1944436533362210, -2.5000000000000000], - [-1.4106293911627636, -0.4612457753357052, -2.5000000000000000], - [-1.5000000000000000, 0.0000000000000000 , -2.5000000000000000], - [-2.0000000000000000, 0.0000000000000000 , -2.5000000000000000], - [-1.9318516525781364, -0.5176380902050419, -2.5000000000000000], - [-1.7320508075688767, -1.0000000000000004, -2.5000000000000000], - [-1.4142135623730949, -1.4142135623730949, -2.5000000000000000], - [-0.9999999999999996, -1.7320508075688776, -2.5000000000000000], - [-0.5176380902050413, -1.9318516525781364, -2.5000000000000000], - [0.0000000000000000 , -2.0000000000000000, -2.5000000000000000], - [-0.5087563136074349, 0.2268882076224485 , 2.0612337179924927 ], - [-0.7908606549185963, 0.2190370136903196 , 2.0689547334037925 ], - [-0.4681964730935784, 0.2249976362827636 , 2.5000000000000000 ], - [-0.7047189658109145, 0.2298715434321653 , 2.5000000000000000 ], - [-1.9318516525781368, 0.5176380902050406 , -2.5000000000000000], - [-1.4103530069617918, 0.4610552819862479 , -2.5000000000000000], - [-1.8492793702846055, 0.4955102902636760 , -2.0725710197384020], - [-1.3924009180040913, 0.4009249093833847 , -2.1027777319517842], - [-1.7320508075688781, 0.9999999999999987 , -2.5000000000000000], - [-1.2962399142648739, 0.8792626331817522 , -2.5000000000000000], - [-1.6580312253714848, 0.9572620528158249 , -2.0726409392445548], - [-1.2815317931577912, 0.7763388176794573 , -2.1004125809106795], - [-1.4142135623730954, 1.4142135623730949 , -2.5000000000000000], - [-1.1954897171538026, 1.1955118092846264 , -2.5000000000000000], - [-1.3538083587140601, 1.3538055746264397 , -2.0728608655063008], - [-1.1369354288744815, 1.1363477954511445 , -2.0892787990354504], - [-0.8806615034078615, 1.2972884914022200 , -2.5000000000000000], - [-1.0000000000000009, 1.7320508075688767 , -2.5000000000000000], - [-0.7773558053168029, 1.2813523674981009 , -2.1006952265382823], - [-0.9573573767373534, 1.6581892163892253 , -2.0735633702176695], - [-0.4629575009441164, 1.4122817012207858 , -2.5000000000000000], - [-0.5176380902050413, 1.9318516525781364 , -2.5000000000000000], - [-0.4017881791519607, 1.3923915867887620 , -2.1040588814917336], - [-0.4956820533903363, 1.8499106076528067 , -2.0758419399544668], - [0.0000000000000000 , 1.5000000000000000 , -2.5000000000000000], - [0.0000000000000000 , 2.0000000000000000 , -2.5000000000000000], - [0.0000000000000000 , 1.4348487253369477 , -2.0833333333333321], - [0.0000000000000000 , 1.9166666666666663 , -2.0833333333333308], - [-0.4530812351073932, 0.9394138753128835 , -2.5000000000000000], - [0.0000000000000000 , 1.0000000000000000 , -2.5000000000000000], - [-0.4058404881945516, 0.9007424732784391 , -2.1110139750933641], - [0.0000000000000000 , 0.9566643273317994 , -2.0833333333333330], - [-0.8867769891244202, 0.8867282890697518 , -2.5000000000000000], - [-0.8248229371434042, 0.8243341094555647 , -2.1103345393084991], - [-0.4708031049643656, 0.4708841947006877 , -2.5000000000000000], - [0.0000000000000000 , 0.5000000000000000 , -2.5000000000000000], - [-0.4375594030043002, 0.4373460608151643 , -2.1091708349432459], - [0.0000000000000000 , 0.4784373941414404 , -2.0833333333333335], - [-0.9380930935011094, 0.4518521860975548 , -2.5000000000000000], - [-0.9007625095272865, 0.4051497431859366 , -2.1104108689404204], - [-1.7687748031161150, 0.4739379889422843 , -1.6558472047936514], - [-1.3430413375176267, 0.3698890674545526 , -1.6924448301874839], - [-1.5858547491958461, 0.9155897546739690 , -1.6559268842796020], - [-1.2346580372801814, 0.7221267439307706 , -1.6945433422170488], - [-1.2948798669120698, 1.2948759336111315 , -1.6561694408463177], - [-1.0819535692436177, 1.0814011856838630 , -1.6868153040936846], - [-0.7228942376917821, 1.2344805643324639 , -1.6951093790600207], - [-0.9156931194211932, 1.5860237906457513 , -1.6569172670850785], - [-0.3704549924311417, 1.3429274977042596 , -1.6943703101549139], - [-0.4741178579431262, 1.7694319346194729 , -1.6592536738423580], - [0.0000000000000000 , 1.3723257865990590 , -1.6666666666666652], - [0.0000000000000000 , 1.8333333333333328 , -1.6666666666666643], - [-0.3842871797570181, 0.8627032979598898 , -1.7042727378370004], - [0.0000000000000000 , 0.9149994798810045 , -1.6666666666666663], - [-0.7844808889536157, 0.7841470487496771 , -1.7062612504779193], - [-0.4173875881187736, 0.4171898110008932 , -1.7006882457079289], - [0.0000000000000000 , 0.4576120208335123 , -1.6666666666666661], - [-0.8627810857752332, 0.3838373437458883 , -1.7033872612536931], - [-1.6882776909937163, 0.4523686767215352 , -1.2391632631303258], - [-1.2848922740626108, 0.3491730368956531 , -1.2768081618593699], - [-1.5136846285106156, 0.8739221585732162 , -1.2392521044918219], - [-1.1810718849078901, 0.6834936534060752 , -1.2812749364497302], - [-1.2359560698060699, 1.2359520190586664 , -1.2395148605424027], - [-1.0309349473236804, 1.0304179345422206 , -1.2760839596932647], - [-0.6841807227591051, 1.1809463788875210 , -1.2820081993359911], - [-0.8740315182153650, 1.5138637356989606 , -1.2403010604587708], - [-0.3496641457914858, 1.2847813373483934 , -1.2790316394103189], - [-0.4525545443223145, 1.6889565526070613 , -1.2426824433080992], - [0.0000000000000000 , 1.3098423797139938 , -1.2499999999999991], - [0.0000000000000000 , 1.7499999999999998 , -1.2499999999999984], - [-0.3670728216095483, 0.8239209974800036 , -1.2895821043540887], - [0.0000000000000000 , 0.8733477981786192 , -1.2499999999999996], - [-0.7487046359223130, 0.7484692666730011 , -1.2925270205331039], - [-0.3987931188405800, 0.3985885605480327 , -1.2856862541311964], - [0.0000000000000000 , 0.4367883277483562 , -1.2499999999999998], - [-0.8240043859465117, 0.3666892929648430 , -1.2885431014597528], - [-1.6077854690677562, 0.4308006916711537 , -0.8225046567871757], - [-1.2245140189416404, 0.3311362716401529 , -0.8595567699223255], - [-1.4415189835514604, 0.8322571659183856 , -0.8226032137813386], - [-1.1256888654973083, 0.6490518605332189 , -0.8647371481116660], - [-1.1770359864161799, 1.1770318396099244 , -0.8228866157935747], - [-0.9811769873206115, 0.9806662700682290 , -0.8605330956332187], - [-0.6497083571681678, 1.1255759332213748 , -0.8655366834996984], - [-0.8323724313523453, 1.4417080539393032 , -0.8237100761452347], - [-0.3316089281746233, 1.2243981198529044 , -0.8619258138434784], - [-0.4309921800107481, 1.6084847134649858 , -0.8261295520201859], - [0.0000000000000000 , 1.2473659902587673 , -0.8333333333333327], - [0.0000000000000000 , 1.6666666666666663 , -0.8333333333333317], - [-0.3497808230476433, 0.7847520780047578 , -0.8724229423233856], - [0.0000000000000000 , 0.8317004061542943 , -0.8333333333333331], - [-0.7131828695176058, 0.7129725000556401 , -0.8753876766548238], - [-0.3799179232124918, 0.3797023445451780 , -0.8685914320584559], - [0.0000000000000000 , 0.4159664408797548 , -0.8333333333333333], - [-0.7848455844877009, 0.3494152666538205 , -0.8713010854320646], - [-1.5272988977014423, 0.4092342415157330 , -0.4058753268518568], - [-1.1637109087170832, 0.3137546190934256 , -0.4420252890373023], - [-1.3693584707210382, 0.7905951597839990 , -0.4059840121412903], - [-1.0698100443514993, 0.6155756953722210 , -0.4472771236967264], - [-1.1181201021624219, 1.1181158848687212 , -0.4062881538296284], - [-0.9317186787160956, 0.9312199479952485 , -0.4434490818565913], - [-0.6162063768119382, 1.0696871794783702 , -0.4481072685627839], - [-0.7907161245360407, 1.3695572087558971 , -0.4071469849379623], - [-0.3142066019691312, 1.1635880890004502 , -0.4444722451328103], - [-0.4094308338211157, 1.5280166740056957 , -0.4095963293376780], - [0.0000000000000000 , 1.1848971617808668 , -0.4166666666666661], - [0.0000000000000000 , 1.5833333333333330 , -0.4166666666666654], - [-0.3322202985224518, 0.7455492101056215 , -0.4547056015387685], - [0.0000000000000000 , 0.7900576920495735 , -0.4166666666666665], - [-0.6775228099602193, 0.6773102563886931 , -0.4575795452812983], - [-0.3609296800396136, 0.3607110910616980 , -0.4509663911546791], - [0.0000000000000000 , 0.3951464882649461 , -0.4166666666666664], - [-0.7456569405379907, 0.3318600601410603 , -0.4535294490938133], - [-1.4468189380493510, 0.3876695948641339 , 0.0107197370502057 ], - [-1.1028105255181273, 0.2965691775775705 , -0.0244360781909185], - [-1.2972038972419384, 0.7489366162124811 , 0.0106008149460427 ], - [-1.0137902020768275, 0.5823673271322193 , -0.0296287667638818], - [-1.0592089907997595, 1.0592047365443320 , 0.0102764401665113 ], - [-0.8823288740722924, 0.8818525412747448 , -0.0259812235075911], - [-0.5829638843864172, 1.0136573148570829 , -0.0304788717029761], - [-0.7490628962829231, 1.2974117214973484 , 0.0093852093661990 ], - [-0.2969961006922026, 1.1026875917652652 , -0.0269393580176984], - [-0.3878705784229783, 1.4475527054356860 , 0.0069158208713049 ], - [0.0000000000000000 , 1.1224367054307549 , 0.0000000000000004 ], - [0.0000000000000000 , 1.4999999999999998 , 0.0000000000000009 ], - [-0.3146040689819207, 0.7063809945350663 , -0.0368602370007621], - [0.0000000000000000 , 0.7484200840217462 , 0.0000000000000001 ], - [-0.6417986477103146, 0.6415771850209346 , -0.0396088659925477], - [-0.3419352496322885, 0.3417201567103875 , -0.0331802304045948], - [0.0000000000000000 , 0.3743286056735840 , 0.0000000000000002 ], - [-0.7064961032895870, 0.3142494906984797 , -0.0356483247398952], - [-1.3663471113792711, 0.3661071808847245 , 0.4272726323754016 ], - [-1.0418527988628083, 0.2794983222850476 , 0.3931871369105635 ], - [-1.2250565051233548, 0.7072822715210783 , 0.4271440486302410 ], - [-0.9577037892264485, 0.5492924498345317 , 0.3881042819474429 ], - [-1.0003034961693291, 1.0002992536894866 , 0.4268011455559814 ], - [-0.8329880057115915, 0.8325396948983864 , 0.3915823648432925 ], - [-0.5498505501591340, 0.9575676611754067 , 0.3872428148848466 ], - [-0.7074131579093395, 1.2252723129519267 , 0.4258823573716483 ], - [-0.2798990334118631, 1.0417372971251340 , 0.3906559590640665 ], - [-0.3663115059346153, 1.3670931515450544 , 0.4234051190182663 ], - [0.0000000000000000 , 1.0599857463605293 , 0.4166666666666669 ], - [0.0000000000000000 , 1.4166666666666665 , 0.4166666666666671 ], - [-0.2969904345338411, 0.6672172304242660 , 0.3810929400452597 ], - [0.0000000000000000 , 0.7067881637494100 , 0.4166666666666669 ], - [-0.6060615041923354, 0.6058386487180543 , 0.3784616468972456 ], - [-0.3229435992142974, 0.3227390666156772 , 0.3846940024511810 ], - [0.0000000000000000 , 0.3535129700670242 , 0.4166666666666669 ], - [-0.6673286125901519, 0.2966433957094217 , 0.3823204926592328 ], - [-1.2858869119265766, 0.3445479868276194 , 0.8437652056680101 ], - [-0.9808356816934677, 0.2625387180260380 , 0.8108467101681837 ], - [-1.1529191291176444, 0.6656338089555111 , 0.8436292059598844 ], - [-0.9015516670879257, 0.5163498584528600 , 0.8058443987322939 ], - [-0.9414055173187796, 0.9414013738444755 , 0.8432723979523831 ], - [-0.7837052985454361, 0.7832897188404579 , 0.8091191624388268 ], - [-0.5168622173892475, 0.9014233676998828 , 0.8050035132203444 ], - [-0.6657678114991065, 1.1531405687254459 , 0.8423353379943446 ], - [-0.2629109689112263, 0.9807350968530036 , 0.8083509002848082 ], - [-0.3447538118743282, 1.2866387420180374 , 0.8398677879796602 ], - [0.0000000000000000 , 0.9975467384389844 , 0.8333333333333335 ], - [0.0000000000000000 , 1.3333333333333333 , 0.8333333333333335 ], - [-0.2793641900300403, 0.6280501584961379 , 0.7991748336544573 ], - [0.0000000000000000 , 0.6651632129932541 , 0.8333333333333336 ], - [-0.5702913053190216, 0.5700837793786234 , 0.7965910715588786 ], - [-0.3039449034885330, 0.3037602646788310 , 0.8026757325044800 ], - [0.0000000000000000 , 0.3326999737821667 , 0.8333333333333336 ], - [-0.6281394651681612, 0.2790333655014443 , 0.8003777583042667 ], - [-1.2054495290188061, 0.3229951418401394 , 1.2601393672134122 ], - [-0.9196608919152640, 0.2458029958468366 , 1.2286442295459581 ], - [-1.0808010553224119, 0.6239967145138258 , 1.2600023619594038 ], - [-0.8452075323768412, 0.4836747286835012 , 1.2234196649334999 ], - [-0.8825215017704083, 0.8825176546760507 , 1.2596442170698032 ], - [-0.7345257963485047, 0.7341589193562843 , 1.2263544378604430 ], - [-0.4841244849483802, 0.8450998893432821 , 1.2226630006469095 ], - [-0.6241300910724658, 1.0810221645230664 , 1.2587114896596465 ], - [-0.2461352676847247, 0.9195867145594803 , 1.2263003939014845 ], - [-0.3231982605740386, 1.2061923293801986 , 1.2562890619966360 ], - [0.0000000000000000 , 0.9351283018668495 , 1.2500000000000000 ], - [0.0000000000000000 , 1.2500000000000000 , 1.2499999999999998 ], - [-0.2616546440845550, 0.5888507777020076 , 1.2175019412222623 ], - [0.0000000000000000 , 0.6235499280583741 , 1.2500000000000000 ], - [-0.5343695855928116, 0.5342047385921520 , 1.2146906982805641 ], - [-0.2849179713929059, 0.2847697387555991 , 1.2209534391757477 ], - [0.0000000000000000 , 0.3118911578192316 , 1.2500000000000002 ], - [-0.5889001114772119, 0.2613537011460357 , 1.2186046339322367 ], - [-1.1250781997420751, 0.3014605424336493 , 1.6761709027065808 ], - [-0.8575868468240363, 0.2300339563746745 , 1.6471533230714266 ], - [-1.0087393327049350, 0.5823926880347337 , 1.6760488403011142 ], - [-0.7879190346381857, 0.4521334167756405 , 1.6409434682700348 ], - [-0.8236786569630595, 0.8236755980247377 , 1.6757231763980367 ], - [-0.6857150239985879, 0.6854189568352724 , 1.6428057069855015 ], - [-0.4524890569011949, 0.7878489724738010 , 1.6403359513844162 ], - [-0.5825149757581213, 1.0089432692167328 , 1.6748600500068818 ], - [-0.2303178160341241, 0.8575415911299373 , 1.6451578270678369 ], - [-0.3016489548854137, 1.1257692256824194 , 1.6725896800614397 ], - [0.0000000000000000 , 0.8727697226237852 , 1.6666666666666663 ], - [0.0000000000000000 , 1.1666666666666667 , 1.6666666666666663 ], - [-0.2438167606288846, 0.5493657719044777 , 1.6368778877204373 ], - [0.0000000000000000 , 0.5819707401847061 , 1.6666666666666670 ], - [-0.4980624746203575, 0.4979370064654267 , 1.6329431819564686 ], - [-0.2658706527702173, 0.2657666240152671 , 1.6403574747276906 ], - [0.0000000000000000 , 0.2910945663396219 , 1.6666666666666672 ], - [-0.5493607093044651, 0.2435615749250701 , 1.6377714803682704 ], - [-1.0449575838687135, 0.2799941046718945 , 2.0909033777909021 ], - [-0.9368966883937991, 0.5409161386486854 , 2.0908279890220913 ], - [-0.7267183129188175, 0.4268493291585560 , 2.0611466961584863 ], - [-0.7650033332345098, 0.7650020307565828 , 2.0906141593485725 ], - [-0.6387605710947312, 0.6385779440826370 , 2.0602853708382387 ], - [-0.4270891100859278, 0.7266694161745655 , 2.0607447306503701 ], - [-0.5409996872255282, 0.9370380579755180 , 2.0900069693375536 ], - [-0.2193044068003241, 0.7909009233797164 , 2.0676284068904875 ], - [-0.2801313034948701, 1.0454642574333539 , 2.0882787840456682 ], - [0.0000000000000000 , 0.8106744522079262 , 2.0833333333333330 ], - [0.0000000000000000 , 1.0833333333333335 , 2.0833333333333321 ], - [-0.2271362855928971, 0.5088339675396980 , 2.0607012776606943 ], - [0.0000000000000000 , 0.5405471009212576 , 2.0833333333333335 ], - [-0.4619477599524173, 0.4618441131422999 , 2.0550057277668667 ], - [-0.2473224583310550, 0.2472828520619909 , 2.0641307890538854 ], - [0.0000000000000000 , 0.2703581871345030 , 2.0833333333333339 ], - [-0.9659258262890682, 0.2588190451025210 , 2.5000000000000000 ], - [-0.8660254037844384, 0.5000000000000002 , 2.5000000000000000 ], - [-0.6465508614060651, 0.4382116819558021 , 2.5000000000000000 ], - [-0.7071067811865475, 0.7071067811865475 , 2.5000000000000000 ], - [-0.5972218266681103, 0.5972826930972890 , 2.5000000000000000 ], - [-0.4380078374117186, 0.6465296161495175 , 2.5000000000000000 ], - [-0.4999999999999998, 0.8660254037844388 , 2.5000000000000000 ], - [-0.2306228876678524, 0.7053146955813823 , 2.5000000000000000 ], - [-0.2588190451025206, 0.9659258262890682 , 2.5000000000000000 ], - [0.0000000000000000 , 0.7500000000000000 , 2.5000000000000000 ], - [0.0000000000000000 , 1.0000000000000000 , 2.5000000000000000 ], - [-0.2255744471144068, 0.4688570127609161 , 2.5000000000000000 ], - [0.0000000000000000 , 0.5000000000000000 , 2.5000000000000000 ], - [-0.4414968551208797, 0.4415942415233830 , 2.5000000000000000 ], - [-0.2349974569176939, 0.2350316287144386 , 2.5000000000000000 ], - [0.0000000000000000 , 0.2500000000000000 , 2.5000000000000000 ] - ]) + [ 1.00000000e+00, 0.00000000e+00, 3.57142857e-01], + [ 9.86361303e-01, 1.64594590e-01, 3.57142857e-01], + [ 9.04164528e-01, 1.50878374e-01, 3.57142857e-01], + [ 9.16666667e-01, 2.24432411e-17, 3.57142857e-01], + [ 1.00000000e+00, 0.00000000e+00, 5.00000000e-01], + [ 9.86361303e-01, 1.64594590e-01, 5.00000000e-01], + [ 9.04164528e-01, 1.50878374e-01, 5.00000000e-01], + [ 9.16666667e-01, -4.50419429e-18, 5.00000000e-01], + [ 9.45817242e-01, 3.24699469e-01, 3.57142857e-01], + [ 8.66999138e-01, 2.97641180e-01, 3.57142857e-01], + [ 9.45817242e-01, 3.24699469e-01, 5.00000000e-01], + [ 8.66999138e-01, 2.97641180e-01, 5.00000000e-01], + [ 8.79473751e-01, 4.75947393e-01, 3.57142857e-01], + [ 8.06184272e-01, 4.36285110e-01, 3.57142857e-01], + [ 8.79473751e-01, 4.75947393e-01, 5.00000000e-01], + [ 8.06184272e-01, 4.36285110e-01, 5.00000000e-01], + [ 7.89140509e-01, 6.14212713e-01, 3.57142857e-01], + [ 7.23378800e-01, 5.63028320e-01, 3.57142857e-01], + [ 7.89140509e-01, 6.14212713e-01, 5.00000000e-01], + [ 7.23378800e-01, 5.63028320e-01, 5.00000000e-01], + [ 6.77281572e-01, 7.35723911e-01, 3.57142857e-01], + [ 6.20841441e-01, 6.74413585e-01, 3.57142857e-01], + [ 6.77281572e-01, 7.35723911e-01, 5.00000000e-01], + [ 6.20841441e-01, 6.74413585e-01, 5.00000000e-01], + [ 5.46948158e-01, 8.37166478e-01, 3.57142857e-01], + [ 5.01369145e-01, 7.67402605e-01, 3.57142857e-01], + [ 5.46948158e-01, 8.37166478e-01, 5.00000000e-01], + [ 5.01369145e-01, 7.67402605e-01, 5.00000000e-01], + [ 4.01695425e-01, 9.15773327e-01, 3.57142857e-01], + [ 3.68220806e-01, 8.39458883e-01, 3.57142857e-01], + [ 4.01695425e-01, 9.15773327e-01, 5.00000000e-01], + [ 3.68220806e-01, 8.39458883e-01, 5.00000000e-01], + [ 8.21967753e-01, 1.37162159e-01, 3.57142857e-01], + [ 8.33333333e-01, 3.56043101e-17, 3.57142857e-01], + [ 8.21967753e-01, 1.37162159e-01, 5.00000000e-01], + [ 8.33333333e-01, -9.00838858e-18, 5.00000000e-01], + [ 7.88181035e-01, 2.70582891e-01, 3.57142857e-01], + [ 7.88181035e-01, 2.70582891e-01, 5.00000000e-01], + [ 7.32894793e-01, 3.96622828e-01, 3.57142857e-01], + [ 7.32894793e-01, 3.96622828e-01, 5.00000000e-01], + [ 6.57617091e-01, 5.11843927e-01, 3.57142857e-01], + [ 6.57617091e-01, 5.11843927e-01, 5.00000000e-01], + [ 5.64401310e-01, 6.13103259e-01, 3.57142857e-01], + [ 5.64401310e-01, 6.13103259e-01, 5.00000000e-01], + [ 4.55790132e-01, 6.97638732e-01, 3.57142857e-01], + [ 4.55790132e-01, 6.97638732e-01, 5.00000000e-01], + [ 3.34746187e-01, 7.63144439e-01, 3.57142857e-01], + [ 3.34746187e-01, 7.63144439e-01, 5.00000000e-01], + [ 7.39770978e-01, 1.23445943e-01, 3.57142857e-01], + [ 7.50000000e-01, 3.32197375e-17, 3.57142857e-01], + [ 7.39770978e-01, 1.23445943e-01, 5.00000000e-01], + [ 7.50000000e-01, -1.35125829e-17, 5.00000000e-01], + [ 7.09362931e-01, 2.43524602e-01, 3.57142857e-01], + [ 7.09362931e-01, 2.43524602e-01, 5.00000000e-01], + [ 6.59605313e-01, 3.56960545e-01, 3.57142857e-01], + [ 6.59605313e-01, 3.56960545e-01, 5.00000000e-01], + [ 5.91855382e-01, 4.60659535e-01, 3.57142857e-01], + [ 5.91855382e-01, 4.60659535e-01, 5.00000000e-01], + [ 5.07961179e-01, 5.51792933e-01, 3.57142857e-01], + [ 5.07961179e-01, 5.51792933e-01, 5.00000000e-01], + [ 4.10211119e-01, 6.27874859e-01, 3.57142857e-01], + [ 4.10211119e-01, 6.27874859e-01, 5.00000000e-01], + [ 3.01271568e-01, 6.86829995e-01, 3.57142857e-01], + [ 3.01271568e-01, 6.86829995e-01, 5.00000000e-01], + [ 6.57574202e-01, 1.09729727e-01, 3.57142857e-01], + [ 6.66666667e-01, 2.67569398e-17, 3.57142857e-01], + [ 6.57574202e-01, 1.09729727e-01, 5.00000000e-01], + [ 6.66666667e-01, -1.80167772e-17, 5.00000000e-01], + [ 6.30544828e-01, 2.16466313e-01, 3.57142857e-01], + [ 6.30544828e-01, 2.16466313e-01, 5.00000000e-01], + [ 5.86315834e-01, 3.17298262e-01, 3.57142857e-01], + [ 5.86315834e-01, 3.17298262e-01, 5.00000000e-01], + [ 5.26093673e-01, 4.09475142e-01, 3.57142857e-01], + [ 5.26093673e-01, 4.09475142e-01, 5.00000000e-01], + [ 4.51521048e-01, 4.90482607e-01, 3.57142857e-01], + [ 4.51521048e-01, 4.90482607e-01, 5.00000000e-01], + [ 3.64632105e-01, 5.58110986e-01, 3.57142857e-01], + [ 3.64632105e-01, 5.58110986e-01, 5.00000000e-01], + [ 2.67796950e-01, 6.10515551e-01, 3.57142857e-01], + [ 2.67796950e-01, 6.10515551e-01, 5.00000000e-01], + [ 5.75377427e-01, 9.60135110e-02, 3.57142857e-01], + [ 5.83333333e-01, 1.89153508e-17, 3.57142857e-01], + [ 5.75377427e-01, 9.60135110e-02, 5.00000000e-01], + [ 5.83333333e-01, -2.25209714e-17, 5.00000000e-01], + [ 5.51726724e-01, 1.89408024e-01, 3.57142857e-01], + [ 5.51726724e-01, 1.89408024e-01, 5.00000000e-01], + [ 5.13026355e-01, 2.77635979e-01, 3.57142857e-01], + [ 5.13026355e-01, 2.77635979e-01, 5.00000000e-01], + [ 4.60331964e-01, 3.58290749e-01, 3.57142857e-01], + [ 4.60331964e-01, 3.58290749e-01, 5.00000000e-01], + [ 3.95080917e-01, 4.29172281e-01, 3.57142857e-01], + [ 3.95080917e-01, 4.29172281e-01, 5.00000000e-01], + [ 3.19053092e-01, 4.88347112e-01, 3.57142857e-01], + [ 3.19053092e-01, 4.88347112e-01, 5.00000000e-01], + [ 2.34322331e-01, 5.34201107e-01, 3.57142857e-01], + [ 2.34322331e-01, 5.34201107e-01, 5.00000000e-01], + [ 4.93180652e-01, 8.22972951e-02, 3.57142857e-01], + [ 5.00000000e-01, 1.04459875e-17, 3.57142857e-01], + [ 4.93180652e-01, 8.22972951e-02, 5.00000000e-01], + [ 5.00000000e-01, -2.70251657e-17, 5.00000000e-01], + [ 4.72908621e-01, 1.62349735e-01, 3.57142857e-01], + [ 4.72908621e-01, 1.62349735e-01, 5.00000000e-01], + [ 4.39736876e-01, 2.37973697e-01, 3.57142857e-01], + [ 4.39736876e-01, 2.37973697e-01, 5.00000000e-01], + [ 3.94570255e-01, 3.07106356e-01, 3.57142857e-01], + [ 3.94570255e-01, 3.07106356e-01, 5.00000000e-01], + [ 3.38640786e-01, 3.67861955e-01, 3.57142857e-01], + [ 3.38640786e-01, 3.67861955e-01, 5.00000000e-01], + [ 2.73474079e-01, 4.18583239e-01, 3.57142857e-01], + [ 2.73474079e-01, 4.18583239e-01, 5.00000000e-01], + [ 2.00847712e-01, 4.57886663e-01, 3.57142857e-01], + [ 2.00847712e-01, 4.57886663e-01, 5.00000000e-01], + [ 2.92606991e-01, 3.16445261e-01, 3.57142857e-01], + [ 3.44188184e-01, 2.67935253e-01, 3.57142857e-01], + [ 2.92606991e-01, 3.16445261e-01, 5.00000000e-01], + [ 3.44188184e-01, 2.67935253e-01, 5.00000000e-01], + [ 2.34867640e-01, 3.58265725e-01, 3.57142857e-01], + [ 2.34867640e-01, 3.58265725e-01, 5.00000000e-01], + [ 1.72155182e-01, 3.92474283e-01, 3.57142857e-01], + [ 1.72155182e-01, 3.92474283e-01, 5.00000000e-01], + [ 2.46573197e-01, 2.65028567e-01, 3.57142857e-01], + [ 2.93806114e-01, 2.28764151e-01, 3.57142857e-01], + [ 2.46573197e-01, 2.65028567e-01, 5.00000000e-01], + [ 2.93806114e-01, 2.28764151e-01, 5.00000000e-01], + [ 1.96261201e-01, 2.97948211e-01, 3.57142857e-01], + [ 1.96261201e-01, 2.97948211e-01, 5.00000000e-01], + [ 1.43462652e-01, 3.27061902e-01, 3.57142857e-01], + [ 1.43462652e-01, 3.27061902e-01, 5.00000000e-01], + [ 2.00539403e-01, 2.13611872e-01, 3.57142857e-01], + [ 2.43424043e-01, 1.89593048e-01, 3.57142857e-01], + [ 2.00539403e-01, 2.13611872e-01, 5.00000000e-01], + [ 2.43424043e-01, 1.89593048e-01, 5.00000000e-01], + [ 1.57654762e-01, 2.37630697e-01, 3.57142857e-01], + [ 1.57654762e-01, 2.37630697e-01, 5.00000000e-01], + [ 1.14770121e-01, 2.61649522e-01, 3.57142857e-01], + [ 1.14770121e-01, 2.61649522e-01, 5.00000000e-01], + [ 8.60775910e-02, 1.96237141e-01, 3.57142857e-01], + [ 1.39074405e-01, 1.78223023e-01, 3.57142857e-01], + [ 8.60775910e-02, 1.96237141e-01, 5.00000000e-01], + [ 1.39074405e-01, 1.78223023e-01, 5.00000000e-01], + [ 5.73850607e-02, 1.30824761e-01, 3.57142857e-01], + [ 1.20494048e-01, 1.18815349e-01, 3.57142857e-01], + [ 5.73850607e-02, 1.30824761e-01, 5.00000000e-01], + [ 1.20494048e-01, 1.18815349e-01, 5.00000000e-01], + [ 2.86925303e-02, 6.54123805e-02, 3.57142857e-01], + [ 1.01913690e-01, 5.94076743e-02, 3.57142857e-01], + [ 2.86925303e-02, 6.54123805e-02, 5.00000000e-01], + [ 1.01913690e-01, 5.94076743e-02, 5.00000000e-01], + [ -1.23126238e-17, -4.32625932e-17, 3.57142857e-01], + [ 8.33333333e-02, -3.43565351e-17, 3.57142857e-01], + [ -5.84327908e-18, -5.40503315e-17, 5.00000000e-01], + [ 8.33333333e-02, -4.95461372e-17, 5.00000000e-01], + [ 1.92071219e-01, 1.60208904e-01, 3.57142857e-01], + [ 1.92071219e-01, 1.60208904e-01, 5.00000000e-01], + [ 1.83603035e-01, 1.06805936e-01, 3.57142857e-01], + [ 1.83603035e-01, 1.06805936e-01, 5.00000000e-01], + [ 1.75134851e-01, 5.34029681e-02, 3.57142857e-01], + [ 1.75134851e-01, 5.34029681e-02, 5.00000000e-01], + [ 1.66666667e-01, -2.53770275e-17, 3.57142857e-01], + [ 1.66666667e-01, -4.50419429e-17, 5.00000000e-01], + [ 2.45068032e-01, 1.42194786e-01, 3.57142857e-01], + [ 2.45068032e-01, 1.42194786e-01, 5.00000000e-01], + [ 2.46712022e-01, 9.47965238e-02, 3.57142857e-01], + [ 2.46712022e-01, 9.47965238e-02, 5.00000000e-01], + [ 2.48356011e-01, 4.73982619e-02, 3.57142857e-01], + [ 2.48356011e-01, 4.73982619e-02, 5.00000000e-01], + [ 2.50000000e-01, -1.63501274e-17, 3.57142857e-01], + [ 2.50000000e-01, -4.05377486e-17, 5.00000000e-01], + [ 3.33333333e-01, -7.31934467e-18, 3.57142857e-01], + [ 3.29964224e-01, 5.90312730e-02, 3.57142857e-01], + [ 3.33333333e-01, -3.60335543e-17, 5.00000000e-01], + [ 3.29964224e-01, 5.90312730e-02, 5.00000000e-01], + [ 4.16666667e-01, 1.64710272e-18, 3.57142857e-01], + [ 4.11572438e-01, 7.06642841e-02, 3.57142857e-01], + [ 4.16666667e-01, -3.15293600e-17, 5.00000000e-01], + [ 4.11572438e-01, 7.06642841e-02, 5.00000000e-01], + [ 3.22110888e-01, 1.17314261e-01, 3.57142857e-01], + [ 3.22110888e-01, 1.17314261e-01, 5.00000000e-01], + [ 3.97509754e-01, 1.39831998e-01, 3.57142857e-01], + [ 3.97509754e-01, 1.39831998e-01, 5.00000000e-01], + [ 3.09957647e-01, 1.74121089e-01, 3.57142857e-01], + [ 3.09957647e-01, 1.74121089e-01, 5.00000000e-01], + [ 3.74847261e-01, 2.06047393e-01, 3.57142857e-01], + [ 3.74847261e-01, 2.06047393e-01, 5.00000000e-01], + [ 2.45485487e-01, 9.69400266e-01, 3.57142857e-01], + [ 2.25028363e-01, 8.88616910e-01, 3.57142857e-01], + [ 2.45485487e-01, 9.69400266e-01, 5.00000000e-01], + [ 2.25028363e-01, 8.88616910e-01, 5.00000000e-01], + [ 8.25793455e-02, 9.96584493e-01, 3.57142857e-01], + [ 7.56977333e-02, 9.13535785e-01, 3.57142857e-01], + [ 8.25793455e-02, 9.96584493e-01, 5.00000000e-01], + [ 7.56977333e-02, 9.13535785e-01, 5.00000000e-01], + [ -8.25793455e-02, 9.96584493e-01, 3.57142857e-01], + [ -7.56977333e-02, 9.13535785e-01, 3.57142857e-01], + [ -8.25793455e-02, 9.96584493e-01, 5.00000000e-01], + [ -7.56977333e-02, 9.13535785e-01, 5.00000000e-01], + [ -2.45485487e-01, 9.69400266e-01, 3.57142857e-01], + [ -2.25028363e-01, 8.88616910e-01, 3.57142857e-01], + [ -2.45485487e-01, 9.69400266e-01, 5.00000000e-01], + [ -2.25028363e-01, 8.88616910e-01, 5.00000000e-01], + [ -4.01695425e-01, 9.15773327e-01, 3.57142857e-01], + [ -3.68220806e-01, 8.39458883e-01, 3.57142857e-01], + [ -4.01695425e-01, 9.15773327e-01, 5.00000000e-01], + [ -3.68220806e-01, 8.39458883e-01, 5.00000000e-01], + [ -5.46948158e-01, 8.37166478e-01, 3.57142857e-01], + [ -5.01369145e-01, 7.67402605e-01, 3.57142857e-01], + [ -5.46948158e-01, 8.37166478e-01, 5.00000000e-01], + [ -5.01369145e-01, 7.67402605e-01, 5.00000000e-01], + [ -6.77281572e-01, 7.35723911e-01, 3.57142857e-01], + [ -6.20841441e-01, 6.74413585e-01, 3.57142857e-01], + [ -6.77281572e-01, 7.35723911e-01, 5.00000000e-01], + [ -6.20841441e-01, 6.74413585e-01, 5.00000000e-01], + [ 2.04571239e-01, 8.07833555e-01, 3.57142857e-01], + [ 2.04571239e-01, 8.07833555e-01, 5.00000000e-01], + [ 6.88161212e-02, 8.30487078e-01, 3.57142857e-01], + [ 6.88161212e-02, 8.30487078e-01, 5.00000000e-01], + [ -6.88161212e-02, 8.30487078e-01, 3.57142857e-01], + [ -6.88161212e-02, 8.30487078e-01, 5.00000000e-01], + [ -2.04571239e-01, 8.07833555e-01, 3.57142857e-01], + [ -2.04571239e-01, 8.07833555e-01, 5.00000000e-01], + [ -3.34746187e-01, 7.63144439e-01, 3.57142857e-01], + [ -3.34746187e-01, 7.63144439e-01, 5.00000000e-01], + [ -4.55790132e-01, 6.97638732e-01, 3.57142857e-01], + [ -4.55790132e-01, 6.97638732e-01, 5.00000000e-01], + [ -5.64401310e-01, 6.13103259e-01, 3.57142857e-01], + [ -5.64401310e-01, 6.13103259e-01, 5.00000000e-01], + [ 1.84114115e-01, 7.27050199e-01, 3.57142857e-01], + [ 1.84114115e-01, 7.27050199e-01, 5.00000000e-01], + [ 6.19345091e-02, 7.47438370e-01, 3.57142857e-01], + [ 6.19345091e-02, 7.47438370e-01, 5.00000000e-01], + [ -6.19345091e-02, 7.47438370e-01, 3.57142857e-01], + [ -6.19345091e-02, 7.47438370e-01, 5.00000000e-01], + [ -1.84114115e-01, 7.27050199e-01, 3.57142857e-01], + [ -1.84114115e-01, 7.27050199e-01, 5.00000000e-01], + [ -3.01271568e-01, 6.86829995e-01, 3.57142857e-01], + [ -3.01271568e-01, 6.86829995e-01, 5.00000000e-01], + [ -4.10211119e-01, 6.27874859e-01, 3.57142857e-01], + [ -4.10211119e-01, 6.27874859e-01, 5.00000000e-01], + [ -5.07961179e-01, 5.51792933e-01, 3.57142857e-01], + [ -5.07961179e-01, 5.51792933e-01, 5.00000000e-01], + [ 1.63656991e-01, 6.46266844e-01, 3.57142857e-01], + [ 1.63656991e-01, 6.46266844e-01, 5.00000000e-01], + [ 5.50528970e-02, 6.64389662e-01, 3.57142857e-01], + [ 5.50528970e-02, 6.64389662e-01, 5.00000000e-01], + [ -5.50528970e-02, 6.64389662e-01, 3.57142857e-01], + [ -5.50528970e-02, 6.64389662e-01, 5.00000000e-01], + [ -1.63656991e-01, 6.46266844e-01, 3.57142857e-01], + [ -1.63656991e-01, 6.46266844e-01, 5.00000000e-01], + [ -2.67796950e-01, 6.10515551e-01, 3.57142857e-01], + [ -2.67796950e-01, 6.10515551e-01, 5.00000000e-01], + [ -3.64632105e-01, 5.58110986e-01, 3.57142857e-01], + [ -3.64632105e-01, 5.58110986e-01, 5.00000000e-01], + [ -4.51521048e-01, 4.90482607e-01, 3.57142857e-01], + [ -4.51521048e-01, 4.90482607e-01, 5.00000000e-01], + [ 1.43199867e-01, 5.65483488e-01, 3.57142857e-01], + [ 1.43199867e-01, 5.65483488e-01, 5.00000000e-01], + [ 4.81712849e-02, 5.81340954e-01, 3.57142857e-01], + [ 4.81712849e-02, 5.81340954e-01, 5.00000000e-01], + [ -4.81712849e-02, 5.81340954e-01, 3.57142857e-01], + [ -4.81712849e-02, 5.81340954e-01, 5.00000000e-01], + [ -1.43199867e-01, 5.65483488e-01, 3.57142857e-01], + [ -1.43199867e-01, 5.65483488e-01, 5.00000000e-01], + [ -2.34322331e-01, 5.34201107e-01, 3.57142857e-01], + [ -2.34322331e-01, 5.34201107e-01, 5.00000000e-01], + [ -3.19053092e-01, 4.88347112e-01, 3.57142857e-01], + [ -3.19053092e-01, 4.88347112e-01, 5.00000000e-01], + [ -3.95080917e-01, 4.29172281e-01, 3.57142857e-01], + [ -3.95080917e-01, 4.29172281e-01, 5.00000000e-01], + [ 1.22742744e-01, 4.84700133e-01, 3.57142857e-01], + [ 1.22742744e-01, 4.84700133e-01, 5.00000000e-01], + [ 4.12896727e-02, 4.98292247e-01, 3.57142857e-01], + [ 4.12896727e-02, 4.98292247e-01, 5.00000000e-01], + [ -4.12896727e-02, 4.98292247e-01, 3.57142857e-01], + [ -4.12896727e-02, 4.98292247e-01, 5.00000000e-01], + [ -1.22742744e-01, 4.84700133e-01, 3.57142857e-01], + [ -1.22742744e-01, 4.84700133e-01, 5.00000000e-01], + [ -2.00847712e-01, 4.57886663e-01, 3.57142857e-01], + [ -2.00847712e-01, 4.57886663e-01, 5.00000000e-01], + [ -2.73474079e-01, 4.18583239e-01, 3.57142857e-01], + [ -2.73474079e-01, 4.18583239e-01, 5.00000000e-01], + [ -3.38640786e-01, 3.67861955e-01, 3.57142857e-01], + [ -3.38640786e-01, 3.67861955e-01, 5.00000000e-01], + [ -1.02283149e-01, 4.15336195e-01, 3.57142857e-01], + [ -3.59859419e-02, 4.34695086e-01, 3.57142857e-01], + [ -1.02283149e-01, 4.15336195e-01, 5.00000000e-01], + [ -3.59859419e-02, 4.34695086e-01, 5.00000000e-01], + [ -1.66348287e-01, 3.87163066e-01, 3.57142857e-01], + [ -1.66348287e-01, 3.87163066e-01, 5.00000000e-01], + [ -2.26761024e-01, 3.50663301e-01, 3.57142857e-01], + [ -2.26761024e-01, 3.50663301e-01, 5.00000000e-01], + [ -2.82200655e-01, 3.06551629e-01, 3.57142857e-01], + [ -2.82200655e-01, 3.06551629e-01, 5.00000000e-01], + [ -8.18235534e-02, 3.45972257e-01, 3.57142857e-01], + [ -3.06822110e-02, 3.71097926e-01, 3.57142857e-01], + [ -8.18235534e-02, 3.45972257e-01, 5.00000000e-01], + [ -3.06822110e-02, 3.71097926e-01, 5.00000000e-01], + [ -1.31848862e-01, 3.16439469e-01, 3.57142857e-01], + [ -1.31848862e-01, 3.16439469e-01, 5.00000000e-01], + [ -1.80047970e-01, 2.82743363e-01, 3.57142857e-01], + [ -1.80047970e-01, 2.82743363e-01, 5.00000000e-01], + [ -2.25760524e-01, 2.45241304e-01, 3.57142857e-01], + [ -2.25760524e-01, 2.45241304e-01, 5.00000000e-01], + [ -6.13639584e-02, 2.76608319e-01, 3.57142857e-01], + [ -2.53784802e-02, 3.07500766e-01, 3.57142857e-01], + [ -6.13639584e-02, 2.76608319e-01, 5.00000000e-01], + [ -2.53784802e-02, 3.07500766e-01, 5.00000000e-01], + [ -9.73494365e-02, 2.45715872e-01, 3.57142857e-01], + [ -9.73494365e-02, 2.45715872e-01, 5.00000000e-01], + [ -1.33334915e-01, 2.14823425e-01, 3.57142857e-01], + [ -1.33334915e-01, 2.14823425e-01, 5.00000000e-01], + [ -1.69320393e-01, 1.83930978e-01, 3.57142857e-01], + [ -1.69320393e-01, 1.83930978e-01, 5.00000000e-01], + [ -1.12880262e-01, 1.22620652e-01, 3.57142857e-01], + [ -7.93257664e-02, 1.65019743e-01, 3.57142857e-01], + [ -1.12880262e-01, 1.22620652e-01, 5.00000000e-01], + [ -7.93257664e-02, 1.65019743e-01, 5.00000000e-01], + [ -5.64401310e-02, 6.13103259e-02, 3.57142857e-01], + [ -2.53166180e-02, 1.15216062e-01, 3.57142857e-01], + [ -5.64401310e-02, 6.13103259e-02, 5.00000000e-01], + [ -2.53166180e-02, 1.15216062e-01, 5.00000000e-01], + [ -4.57712708e-02, 2.07418835e-01, 3.57142857e-01], + [ -4.57712708e-02, 2.07418835e-01, 5.00000000e-01], + [ 5.80689493e-03, 1.69121798e-01, 3.57142857e-01], + [ 5.80689493e-03, 1.69121798e-01, 5.00000000e-01], + [ -1.22167752e-02, 2.49817927e-01, 3.57142857e-01], + [ -1.22167752e-02, 2.49817927e-01, 5.00000000e-01], + [ 3.69304079e-02, 2.23027534e-01, 3.57142857e-01], + [ 3.69304079e-02, 2.23027534e-01, 5.00000000e-01], + [ 2.13377203e-02, 2.92217018e-01, 3.57142857e-01], + [ 2.13377203e-02, 2.92217018e-01, 5.00000000e-01], + [ 6.80539208e-02, 2.76933270e-01, 3.57142857e-01], + [ 6.80539208e-02, 2.76933270e-01, 5.00000000e-01], + [ 8.62835284e-02, 3.46188891e-01, 3.57142857e-01], + [ 8.62835284e-02, 3.46188891e-01, 5.00000000e-01], + [ 1.04513136e-01, 4.15444512e-01, 3.57142857e-01], + [ 1.04513136e-01, 4.15444512e-01, 5.00000000e-01], + [ 2.79883711e-02, 3.60908761e-01, 3.57142857e-01], + [ 2.79883711e-02, 3.60908761e-01, 5.00000000e-01], + [ 3.46390219e-02, 4.29600504e-01, 3.57142857e-01], + [ 3.46390219e-02, 4.29600504e-01, 5.00000000e-01], + [ -7.89140509e-01, 6.14212713e-01, 3.57142857e-01], + [ -7.23378800e-01, 5.63028320e-01, 3.57142857e-01], + [ -7.89140509e-01, 6.14212713e-01, 5.00000000e-01], + [ -7.23378800e-01, 5.63028320e-01, 5.00000000e-01], + [ -8.79473751e-01, 4.75947393e-01, 3.57142857e-01], + [ -8.06184272e-01, 4.36285110e-01, 3.57142857e-01], + [ -8.79473751e-01, 4.75947393e-01, 5.00000000e-01], + [ -8.06184272e-01, 4.36285110e-01, 5.00000000e-01], + [ -9.45817242e-01, 3.24699469e-01, 3.57142857e-01], + [ -8.66999138e-01, 2.97641180e-01, 3.57142857e-01], + [ -9.45817242e-01, 3.24699469e-01, 5.00000000e-01], + [ -8.66999138e-01, 2.97641180e-01, 5.00000000e-01], + [ -9.86361303e-01, 1.64594590e-01, 3.57142857e-01], + [ -9.04164528e-01, 1.50878374e-01, 3.57142857e-01], + [ -9.86361303e-01, 1.64594590e-01, 5.00000000e-01], + [ -9.04164528e-01, 1.50878374e-01, 5.00000000e-01], + [ -1.00000000e+00, 8.74747714e-17, 3.57142857e-01], + [ -9.16666667e-01, 7.64102399e-17, 3.57142857e-01], + [ -1.00000000e+00, 1.22464680e-16, 5.00000000e-01], + [ -9.16666667e-01, 1.07755096e-16, 5.00000000e-01], + [ -9.86361303e-01, -1.64594590e-01, 3.57142857e-01], + [ -9.04164528e-01, -1.50878374e-01, 3.57142857e-01], + [ -9.86361303e-01, -1.64594590e-01, 5.00000000e-01], + [ -9.04164528e-01, -1.50878374e-01, 5.00000000e-01], + [ -6.57617091e-01, 5.11843927e-01, 3.57142857e-01], + [ -6.57617091e-01, 5.11843927e-01, 5.00000000e-01], + [ -7.32894793e-01, 3.96622828e-01, 3.57142857e-01], + [ -7.32894793e-01, 3.96622828e-01, 5.00000000e-01], + [ -7.88181035e-01, 2.70582891e-01, 3.57142857e-01], + [ -7.88181035e-01, 2.70582891e-01, 5.00000000e-01], + [ -8.21967753e-01, 1.37162159e-01, 3.57142857e-01], + [ -8.21967753e-01, 1.37162159e-01, 5.00000000e-01], + [ -8.33333333e-01, 6.54603924e-17, 3.57142857e-01], + [ -8.33333333e-01, 9.30455114e-17, 5.00000000e-01], + [ -8.21967753e-01, -1.37162159e-01, 3.57142857e-01], + [ -8.21967753e-01, -1.37162159e-01, 5.00000000e-01], + [ -5.91855382e-01, 4.60659535e-01, 3.57142857e-01], + [ -5.91855382e-01, 4.60659535e-01, 5.00000000e-01], + [ -6.59605313e-01, 3.56960545e-01, 3.57142857e-01], + [ -6.59605313e-01, 3.56960545e-01, 5.00000000e-01], + [ -7.09362931e-01, 2.43524602e-01, 3.57142857e-01], + [ -7.09362931e-01, 2.43524602e-01, 5.00000000e-01], + [ -7.39770978e-01, 1.23445943e-01, 3.57142857e-01], + [ -7.39770978e-01, 1.23445943e-01, 5.00000000e-01], + [ -7.50000000e-01, 5.42913931e-17, 3.57142857e-01], + [ -7.50000000e-01, 7.83359271e-17, 5.00000000e-01], + [ -7.39770978e-01, -1.23445943e-01, 3.57142857e-01], + [ -7.39770978e-01, -1.23445943e-01, 5.00000000e-01], + [ -5.26093673e-01, 4.09475142e-01, 3.57142857e-01], + [ -5.26093673e-01, 4.09475142e-01, 5.00000000e-01], + [ -5.86315834e-01, 3.17298262e-01, 3.57142857e-01], + [ -5.86315834e-01, 3.17298262e-01, 5.00000000e-01], + [ -6.30544828e-01, 2.16466313e-01, 3.57142857e-01], + [ -6.30544828e-01, 2.16466313e-01, 5.00000000e-01], + [ -6.57574202e-01, 1.09729727e-01, 3.57142857e-01], + [ -6.57574202e-01, 1.09729727e-01, 5.00000000e-01], + [ -6.66666667e-01, 4.30651628e-17, 3.57142857e-01], + [ -6.66666667e-01, 6.36263428e-17, 5.00000000e-01], + [ -6.57574202e-01, -1.09729727e-01, 3.57142857e-01], + [ -6.57574202e-01, -1.09729727e-01, 5.00000000e-01], + [ -4.60331964e-01, 3.58290749e-01, 3.57142857e-01], + [ -4.60331964e-01, 3.58290749e-01, 5.00000000e-01], + [ -5.13026355e-01, 2.77635979e-01, 3.57142857e-01], + [ -5.13026355e-01, 2.77635979e-01, 5.00000000e-01], + [ -5.51726724e-01, 1.89408024e-01, 3.57142857e-01], + [ -5.51726724e-01, 1.89408024e-01, 5.00000000e-01], + [ -5.75377427e-01, 9.60135110e-02, 3.57142857e-01], + [ -5.75377427e-01, 9.60135110e-02, 5.00000000e-01], + [ -5.83333333e-01, 3.18758200e-17, 3.57142857e-01], + [ -5.83333333e-01, 4.89167585e-17, 5.00000000e-01], + [ -5.75377427e-01, -9.60135110e-02, 3.57142857e-01], + [ -5.75377427e-01, -9.60135110e-02, 5.00000000e-01], + [ -3.94570255e-01, 3.07106356e-01, 3.57142857e-01], + [ -3.94570255e-01, 3.07106356e-01, 5.00000000e-01], + [ -4.39736876e-01, 2.37973697e-01, 3.57142857e-01], + [ -4.39736876e-01, 2.37973697e-01, 5.00000000e-01], + [ -4.72908621e-01, 1.62349735e-01, 3.57142857e-01], + [ -4.72908621e-01, 1.62349735e-01, 5.00000000e-01], + [ -4.93180652e-01, 8.22972951e-02, 3.57142857e-01], + [ -4.93180652e-01, 8.22972951e-02, 5.00000000e-01], + [ -5.00000000e-01, 2.07780968e-17, 3.57142857e-01], + [ -5.00000000e-01, 3.42071742e-17, 5.00000000e-01], + [ -4.93180652e-01, -8.22972951e-02, 3.57142857e-01], + [ -4.93180652e-01, -8.22972951e-02, 5.00000000e-01], + [ -4.20156583e-01, 7.22539112e-02, 3.57142857e-01], + [ -4.11228248e-01, 1.41174836e-01, 3.57142857e-01], + [ -4.20156583e-01, 7.22539112e-02, 5.00000000e-01], + [ -4.11228248e-01, 1.41174836e-01, 5.00000000e-01], + [ -4.20116462e-01, 1.83641595e-03, 3.57142857e-01], + [ -4.20116462e-01, 1.83641595e-03, 5.00000000e-01], + [ -4.10983876e-01, -6.85810793e-02, 3.57142857e-01], + [ -4.10983876e-01, -6.85810793e-02, 5.00000000e-01], + [ -3.47132513e-01, 6.22105272e-02, 3.57142857e-01], + [ -3.49547876e-01, 1.19999937e-01, 3.57142857e-01], + [ -3.47132513e-01, 6.22105272e-02, 5.00000000e-01], + [ -3.49547876e-01, 1.19999937e-01, 5.00000000e-01], + [ -3.40232923e-01, 3.67283191e-03, 3.57142857e-01], + [ -3.40232923e-01, 3.67283191e-03, 5.00000000e-01], + [ -3.28787101e-01, -5.48648634e-02, 3.57142857e-01], + [ -3.28787101e-01, -5.48648634e-02, 5.00000000e-01], + [ -2.74108444e-01, 5.21671433e-02, 3.57142857e-01], + [ -2.87867503e-01, 9.88250387e-02, 3.57142857e-01], + [ -2.74108444e-01, 5.21671433e-02, 5.00000000e-01], + [ -2.87867503e-01, 9.88250387e-02, 5.00000000e-01], + [ -2.60349385e-01, 5.50924786e-03, 3.57142857e-01], + [ -2.60349385e-01, 5.50924786e-03, 5.00000000e-01], + [ -2.46590326e-01, -4.11486476e-02, 3.57142857e-01], + [ -2.46590326e-01, -4.11486476e-02, 5.00000000e-01], + [ -1.64393551e-01, -2.74324317e-02, 3.57142857e-01], + [ -1.92379634e-01, 2.41096072e-02, 3.57142857e-01], + [ -1.64393551e-01, -2.74324317e-02, 5.00000000e-01], + [ -1.92379634e-01, 2.41096072e-02, 5.00000000e-01], + [ -8.21967753e-02, -1.37162159e-02, 3.57142857e-01], + [ -1.24409882e-01, 4.27099665e-02, 3.57142857e-01], + [ -8.21967753e-02, -1.37162159e-02, 5.00000000e-01], + [ -1.24409882e-01, 4.27099665e-02, 5.00000000e-01], + [ -2.20365717e-01, 7.56516461e-02, 3.57142857e-01], + [ -2.20365717e-01, 7.56516461e-02, 5.00000000e-01], + [ -1.66622989e-01, 9.91361489e-02, 3.57142857e-01], + [ -1.66622989e-01, 9.91361489e-02, 5.00000000e-01], + [ -2.48351800e-01, 1.27193685e-01, 3.57142857e-01], + [ -2.48351800e-01, 1.27193685e-01, 5.00000000e-01], + [ -2.08836096e-01, 1.55562331e-01, 3.57142857e-01], + [ -2.08836096e-01, 1.55562331e-01, 5.00000000e-01], + [ -2.70747482e-01, 2.06077006e-01, 3.57142857e-01], + [ -2.70747482e-01, 2.06077006e-01, 5.00000000e-01], + [ -3.32658869e-01, 2.56591681e-01, 3.57142857e-01], + [ -3.32658869e-01, 2.56591681e-01, 5.00000000e-01], + [ -3.12146825e-01, 1.64120356e-01, 3.57142857e-01], + [ -3.12146825e-01, 1.64120356e-01, 5.00000000e-01], + [ -3.75941850e-01, 2.01047026e-01, 3.57142857e-01], + [ -3.75941850e-01, 2.01047026e-01, 5.00000000e-01], + [ -9.45817242e-01, -3.24699469e-01, 3.57142857e-01], + [ -8.66999138e-01, -2.97641180e-01, 3.57142857e-01], + [ -9.45817242e-01, -3.24699469e-01, 5.00000000e-01], + [ -8.66999138e-01, -2.97641180e-01, 5.00000000e-01], + [ -8.79473751e-01, -4.75947393e-01, 3.57142857e-01], + [ -8.06184272e-01, -4.36285110e-01, 3.57142857e-01], + [ -8.79473751e-01, -4.75947393e-01, 5.00000000e-01], + [ -8.06184272e-01, -4.36285110e-01, 5.00000000e-01], + [ -7.89140509e-01, -6.14212713e-01, 3.57142857e-01], + [ -7.23378800e-01, -5.63028320e-01, 3.57142857e-01], + [ -7.89140509e-01, -6.14212713e-01, 5.00000000e-01], + [ -7.23378800e-01, -5.63028320e-01, 5.00000000e-01], + [ -6.77281572e-01, -7.35723911e-01, 3.57142857e-01], + [ -6.20841441e-01, -6.74413585e-01, 3.57142857e-01], + [ -6.77281572e-01, -7.35723911e-01, 5.00000000e-01], + [ -6.20841441e-01, -6.74413585e-01, 5.00000000e-01], + [ -5.46948158e-01, -8.37166478e-01, 3.57142857e-01], + [ -5.01369145e-01, -7.67402605e-01, 3.57142857e-01], + [ -5.46948158e-01, -8.37166478e-01, 5.00000000e-01], + [ -5.01369145e-01, -7.67402605e-01, 5.00000000e-01], + [ -4.01695425e-01, -9.15773327e-01, 3.57142857e-01], + [ -3.68220806e-01, -8.39458883e-01, 3.57142857e-01], + [ -4.01695425e-01, -9.15773327e-01, 5.00000000e-01], + [ -3.68220806e-01, -8.39458883e-01, 5.00000000e-01], + [ -7.88181035e-01, -2.70582891e-01, 3.57142857e-01], + [ -7.88181035e-01, -2.70582891e-01, 5.00000000e-01], + [ -7.32894793e-01, -3.96622828e-01, 3.57142857e-01], + [ -7.32894793e-01, -3.96622828e-01, 5.00000000e-01], + [ -6.57617091e-01, -5.11843927e-01, 3.57142857e-01], + [ -6.57617091e-01, -5.11843927e-01, 5.00000000e-01], + [ -5.64401310e-01, -6.13103259e-01, 3.57142857e-01], + [ -5.64401310e-01, -6.13103259e-01, 5.00000000e-01], + [ -4.55790132e-01, -6.97638732e-01, 3.57142857e-01], + [ -4.55790132e-01, -6.97638732e-01, 5.00000000e-01], + [ -3.34746187e-01, -7.63144439e-01, 3.57142857e-01], + [ -3.34746187e-01, -7.63144439e-01, 5.00000000e-01], + [ -7.09362931e-01, -2.43524602e-01, 3.57142857e-01], + [ -7.09362931e-01, -2.43524602e-01, 5.00000000e-01], + [ -6.59605313e-01, -3.56960545e-01, 3.57142857e-01], + [ -6.59605313e-01, -3.56960545e-01, 5.00000000e-01], + [ -5.91855382e-01, -4.60659535e-01, 3.57142857e-01], + [ -5.91855382e-01, -4.60659535e-01, 5.00000000e-01], + [ -5.07961179e-01, -5.51792933e-01, 3.57142857e-01], + [ -5.07961179e-01, -5.51792933e-01, 5.00000000e-01], + [ -4.10211119e-01, -6.27874859e-01, 3.57142857e-01], + [ -4.10211119e-01, -6.27874859e-01, 5.00000000e-01], + [ -3.01271568e-01, -6.86829995e-01, 3.57142857e-01], + [ -3.01271568e-01, -6.86829995e-01, 5.00000000e-01], + [ -6.30544828e-01, -2.16466313e-01, 3.57142857e-01], + [ -6.30544828e-01, -2.16466313e-01, 5.00000000e-01], + [ -5.86315834e-01, -3.17298262e-01, 3.57142857e-01], + [ -5.86315834e-01, -3.17298262e-01, 5.00000000e-01], + [ -5.26093673e-01, -4.09475142e-01, 3.57142857e-01], + [ -5.26093673e-01, -4.09475142e-01, 5.00000000e-01], + [ -4.51521048e-01, -4.90482607e-01, 3.57142857e-01], + [ -4.51521048e-01, -4.90482607e-01, 5.00000000e-01], + [ -3.64632105e-01, -5.58110986e-01, 3.57142857e-01], + [ -3.64632105e-01, -5.58110986e-01, 5.00000000e-01], + [ -2.67796950e-01, -6.10515551e-01, 3.57142857e-01], + [ -2.67796950e-01, -6.10515551e-01, 5.00000000e-01], + [ -5.51726724e-01, -1.89408024e-01, 3.57142857e-01], + [ -5.51726724e-01, -1.89408024e-01, 5.00000000e-01], + [ -5.13026355e-01, -2.77635979e-01, 3.57142857e-01], + [ -5.13026355e-01, -2.77635979e-01, 5.00000000e-01], + [ -4.60331964e-01, -3.58290749e-01, 3.57142857e-01], + [ -4.60331964e-01, -3.58290749e-01, 5.00000000e-01], + [ -3.95080917e-01, -4.29172281e-01, 3.57142857e-01], + [ -3.95080917e-01, -4.29172281e-01, 5.00000000e-01], + [ -3.19053092e-01, -4.88347112e-01, 3.57142857e-01], + [ -3.19053092e-01, -4.88347112e-01, 5.00000000e-01], + [ -2.34322331e-01, -5.34201107e-01, 3.57142857e-01], + [ -2.34322331e-01, -5.34201107e-01, 5.00000000e-01], + [ -4.72908621e-01, -1.62349735e-01, 3.57142857e-01], + [ -4.72908621e-01, -1.62349735e-01, 5.00000000e-01], + [ -4.39736876e-01, -2.37973697e-01, 3.57142857e-01], + [ -4.39736876e-01, -2.37973697e-01, 5.00000000e-01], + [ -3.94570255e-01, -3.07106356e-01, 3.57142857e-01], + [ -3.94570255e-01, -3.07106356e-01, 5.00000000e-01], + [ -3.38640786e-01, -3.67861955e-01, 3.57142857e-01], + [ -3.38640786e-01, -3.67861955e-01, 5.00000000e-01], + [ -2.73474079e-01, -4.18583239e-01, 3.57142857e-01], + [ -2.73474079e-01, -4.18583239e-01, 5.00000000e-01], + [ -2.00847712e-01, -4.57886663e-01, 3.57142857e-01], + [ -2.00847712e-01, -4.57886663e-01, 5.00000000e-01], + [ -2.90292421e-01, -3.12221863e-01, 3.57142857e-01], + [ -3.43107373e-01, -2.67051188e-01, 3.57142857e-01], + [ -2.90292421e-01, -3.12221863e-01, 5.00000000e-01], + [ -3.43107373e-01, -2.67051188e-01, 5.00000000e-01], + [ -2.31319311e-01, -3.50702994e-01, 3.57142857e-01], + [ -2.31319311e-01, -3.50702994e-01, 5.00000000e-01], + [ -1.67373094e-01, -3.81572219e-01, 3.57142857e-01], + [ -1.67373094e-01, -3.81572219e-01, 5.00000000e-01], + [ -2.41944057e-01, -2.56581770e-01, 3.57142857e-01], + [ -2.91644492e-01, -2.26996019e-01, 3.57142857e-01], + [ -2.41944057e-01, -2.56581770e-01, 5.00000000e-01], + [ -2.91644492e-01, -2.26996019e-01, 5.00000000e-01], + [ -1.89164543e-01, -2.82822750e-01, 3.57142857e-01], + [ -1.89164543e-01, -2.82822750e-01, 5.00000000e-01], + [ -1.33898475e-01, -3.05257776e-01, 3.57142857e-01], + [ -1.33898475e-01, -3.05257776e-01, 5.00000000e-01], + [ -1.93595692e-01, -2.00941678e-01, 3.57142857e-01], + [ -2.40181610e-01, -1.86940851e-01, 3.57142857e-01], + [ -1.93595692e-01, -2.00941678e-01, 5.00000000e-01], + [ -2.40181610e-01, -1.86940851e-01, 5.00000000e-01], + [ -1.47009774e-01, -2.14942505e-01, 3.57142857e-01], + [ -1.47009774e-01, -2.14942505e-01, 5.00000000e-01], + [ -1.00423856e-01, -2.28943332e-01, 3.57142857e-01], + [ -1.00423856e-01, -2.28943332e-01, 5.00000000e-01], + [ -6.69492374e-02, -1.52628888e-01, 3.57142857e-01], + [ -1.25405441e-01, -1.47867075e-01, 3.57142857e-01], + [ -6.69492374e-02, -1.52628888e-01, 5.00000000e-01], + [ -1.25405441e-01, -1.47867075e-01, 5.00000000e-01], + [ -3.34746187e-02, -7.63144439e-02, 3.57142857e-01], + [ -1.03801108e-01, -8.07916455e-02, 3.57142857e-01], + [ -3.34746187e-02, -7.63144439e-02, 5.00000000e-01], + [ -1.03801108e-01, -8.07916455e-02, 5.00000000e-01], + [ -1.83861645e-01, -1.43105263e-01, 3.57142857e-01], + [ -1.83861645e-01, -1.43105263e-01, 5.00000000e-01], + [ -1.74127598e-01, -8.52688471e-02, 3.57142857e-01], + [ -1.74127598e-01, -8.52688471e-02, 5.00000000e-01], + [ -2.42317849e-01, -1.38343450e-01, 3.57142857e-01], + [ -2.42317849e-01, -1.38343450e-01, 5.00000000e-01], + [ -2.44454087e-01, -8.97460487e-02, 3.57142857e-01], + [ -2.44454087e-01, -8.97460487e-02, 5.00000000e-01], + [ -3.20605599e-01, -1.13947277e-01, 3.57142857e-01], + [ -3.20605599e-01, -1.13947277e-01, 5.00000000e-01], + [ -3.96757110e-01, -1.38148506e-01, 3.57142857e-01], + [ -3.96757110e-01, -1.38148506e-01, 5.00000000e-01], + [ -3.08124191e-01, -1.71553532e-01, 3.57142857e-01], + [ -3.08124191e-01, -1.71553532e-01, 5.00000000e-01], + [ -3.73930533e-01, -2.04763614e-01, 3.57142857e-01], + [ -3.73930533e-01, -2.04763614e-01, 5.00000000e-01], + [ -2.45485487e-01, -9.69400266e-01, 3.57142857e-01], + [ -2.25028363e-01, -8.88616910e-01, 3.57142857e-01], + [ -2.45485487e-01, -9.69400266e-01, 5.00000000e-01], + [ -2.25028363e-01, -8.88616910e-01, 5.00000000e-01], + [ -8.25793455e-02, -9.96584493e-01, 3.57142857e-01], + [ -7.56977333e-02, -9.13535785e-01, 3.57142857e-01], + [ -8.25793455e-02, -9.96584493e-01, 5.00000000e-01], + [ -7.56977333e-02, -9.13535785e-01, 5.00000000e-01], + [ 8.25793455e-02, -9.96584493e-01, 3.57142857e-01], + [ 7.56977333e-02, -9.13535785e-01, 3.57142857e-01], + [ 8.25793455e-02, -9.96584493e-01, 5.00000000e-01], + [ 7.56977333e-02, -9.13535785e-01, 5.00000000e-01], + [ 2.45485487e-01, -9.69400266e-01, 3.57142857e-01], + [ 2.25028363e-01, -8.88616910e-01, 3.57142857e-01], + [ 2.45485487e-01, -9.69400266e-01, 5.00000000e-01], + [ 2.25028363e-01, -8.88616910e-01, 5.00000000e-01], + [ 4.01695425e-01, -9.15773327e-01, 3.57142857e-01], + [ 3.68220806e-01, -8.39458883e-01, 3.57142857e-01], + [ 4.01695425e-01, -9.15773327e-01, 5.00000000e-01], + [ 3.68220806e-01, -8.39458883e-01, 5.00000000e-01], + [ 5.46948158e-01, -8.37166478e-01, 3.57142857e-01], + [ 5.01369145e-01, -7.67402605e-01, 3.57142857e-01], + [ 5.46948158e-01, -8.37166478e-01, 5.00000000e-01], + [ 5.01369145e-01, -7.67402605e-01, 5.00000000e-01], + [ -2.04571239e-01, -8.07833555e-01, 3.57142857e-01], + [ -2.04571239e-01, -8.07833555e-01, 5.00000000e-01], + [ -6.88161212e-02, -8.30487078e-01, 3.57142857e-01], + [ -6.88161212e-02, -8.30487078e-01, 5.00000000e-01], + [ 6.88161212e-02, -8.30487078e-01, 3.57142857e-01], + [ 6.88161212e-02, -8.30487078e-01, 5.00000000e-01], + [ 2.04571239e-01, -8.07833555e-01, 3.57142857e-01], + [ 2.04571239e-01, -8.07833555e-01, 5.00000000e-01], + [ 3.34746187e-01, -7.63144439e-01, 3.57142857e-01], + [ 3.34746187e-01, -7.63144439e-01, 5.00000000e-01], + [ 4.55790132e-01, -6.97638732e-01, 3.57142857e-01], + [ 4.55790132e-01, -6.97638732e-01, 5.00000000e-01], + [ -1.84114115e-01, -7.27050199e-01, 3.57142857e-01], + [ -1.84114115e-01, -7.27050199e-01, 5.00000000e-01], + [ -6.19345091e-02, -7.47438370e-01, 3.57142857e-01], + [ -6.19345091e-02, -7.47438370e-01, 5.00000000e-01], + [ 6.19345091e-02, -7.47438370e-01, 3.57142857e-01], + [ 6.19345091e-02, -7.47438370e-01, 5.00000000e-01], + [ 1.84114115e-01, -7.27050199e-01, 3.57142857e-01], + [ 1.84114115e-01, -7.27050199e-01, 5.00000000e-01], + [ 3.01271568e-01, -6.86829995e-01, 3.57142857e-01], + [ 3.01271568e-01, -6.86829995e-01, 5.00000000e-01], + [ 4.10211119e-01, -6.27874859e-01, 3.57142857e-01], + [ 4.10211119e-01, -6.27874859e-01, 5.00000000e-01], + [ -1.63656991e-01, -6.46266844e-01, 3.57142857e-01], + [ -1.63656991e-01, -6.46266844e-01, 5.00000000e-01], + [ -5.50528970e-02, -6.64389662e-01, 3.57142857e-01], + [ -5.50528970e-02, -6.64389662e-01, 5.00000000e-01], + [ 5.50528970e-02, -6.64389662e-01, 3.57142857e-01], + [ 5.50528970e-02, -6.64389662e-01, 5.00000000e-01], + [ 1.63656991e-01, -6.46266844e-01, 3.57142857e-01], + [ 1.63656991e-01, -6.46266844e-01, 5.00000000e-01], + [ 2.67796950e-01, -6.10515551e-01, 3.57142857e-01], + [ 2.67796950e-01, -6.10515551e-01, 5.00000000e-01], + [ 3.64632105e-01, -5.58110986e-01, 3.57142857e-01], + [ 3.64632105e-01, -5.58110986e-01, 5.00000000e-01], + [ -1.43199867e-01, -5.65483488e-01, 3.57142857e-01], + [ -1.43199867e-01, -5.65483488e-01, 5.00000000e-01], + [ -4.81712849e-02, -5.81340954e-01, 3.57142857e-01], + [ -4.81712849e-02, -5.81340954e-01, 5.00000000e-01], + [ 4.81712849e-02, -5.81340954e-01, 3.57142857e-01], + [ 4.81712849e-02, -5.81340954e-01, 5.00000000e-01], + [ 1.43199867e-01, -5.65483488e-01, 3.57142857e-01], + [ 1.43199867e-01, -5.65483488e-01, 5.00000000e-01], + [ 2.34322331e-01, -5.34201107e-01, 3.57142857e-01], + [ 2.34322331e-01, -5.34201107e-01, 5.00000000e-01], + [ 3.19053092e-01, -4.88347112e-01, 3.57142857e-01], + [ 3.19053092e-01, -4.88347112e-01, 5.00000000e-01], + [ -1.22742744e-01, -4.84700133e-01, 3.57142857e-01], + [ -1.22742744e-01, -4.84700133e-01, 5.00000000e-01], + [ -4.12896727e-02, -4.98292247e-01, 3.57142857e-01], + [ -4.12896727e-02, -4.98292247e-01, 5.00000000e-01], + [ 4.12896727e-02, -4.98292247e-01, 3.57142857e-01], + [ 4.12896727e-02, -4.98292247e-01, 5.00000000e-01], + [ 1.22742744e-01, -4.84700133e-01, 3.57142857e-01], + [ 1.22742744e-01, -4.84700133e-01, 5.00000000e-01], + [ 2.00847712e-01, -4.57886663e-01, 3.57142857e-01], + [ 2.00847712e-01, -4.57886663e-01, 5.00000000e-01], + [ 2.73474079e-01, -4.18583239e-01, 3.57142857e-01], + [ 2.73474079e-01, -4.18583239e-01, 5.00000000e-01], + [ 1.02606772e-01, -4.13792257e-01, 3.57142857e-01], + [ 3.59043567e-02, -4.33301147e-01, 3.57142857e-01], + [ 1.02606772e-01, -4.13792257e-01, 5.00000000e-01], + [ 3.59043567e-02, -4.33301147e-01, 5.00000000e-01], + [ 1.67077120e-01, -3.85469130e-01, 3.57142857e-01], + [ 1.67077120e-01, -3.85469130e-01, 5.00000000e-01], + [ 2.27895066e-01, -3.48819366e-01, 3.57142857e-01], + [ 2.27895066e-01, -3.48819366e-01, 5.00000000e-01], + [ 8.24708009e-02, -3.42884381e-01, 3.57142857e-01], + [ 3.05190406e-02, -3.68310047e-01, 3.57142857e-01], + [ 8.24708009e-02, -3.42884381e-01, 5.00000000e-01], + [ 3.05190406e-02, -3.68310047e-01, 5.00000000e-01], + [ 1.33306527e-01, -3.13051596e-01, 3.57142857e-01], + [ 1.33306527e-01, -3.13051596e-01, 5.00000000e-01], + [ 1.82316053e-01, -2.79055493e-01, 3.57142857e-01], + [ 1.82316053e-01, -2.79055493e-01, 5.00000000e-01], + [ 6.23348295e-02, -2.71976505e-01, 3.57142857e-01], + [ 2.51337245e-02, -3.03318947e-01, 3.57142857e-01], + [ 6.23348295e-02, -2.71976505e-01, 5.00000000e-01], + [ 2.51337245e-02, -3.03318947e-01, 5.00000000e-01], + [ 9.95359345e-02, -2.40634062e-01, 3.57142857e-01], + [ 9.95359345e-02, -2.40634062e-01, 5.00000000e-01], + [ 1.36737040e-01, -2.09291620e-01, 3.57142857e-01], + [ 1.36737040e-01, -2.09291620e-01, 5.00000000e-01], + [ 9.11580264e-02, -1.39527746e-01, 3.57142857e-01], + [ 5.51990834e-02, -1.85860856e-01, 3.57142857e-01], + [ 9.11580264e-02, -1.39527746e-01, 5.00000000e-01], + [ 5.51990834e-02, -1.85860856e-01, 5.00000000e-01], + [ 4.55790132e-02, -6.97638732e-02, 3.57142857e-01], + [ 1.08622324e-02, -1.31087650e-01, 3.57142857e-01], + [ 4.55790132e-02, -6.97638732e-02, 5.00000000e-01], + [ 1.08622324e-02, -1.31087650e-01, 5.00000000e-01], + [ 1.92401405e-02, -2.32193966e-01, 3.57142857e-01], + [ 1.92401405e-02, -2.32193966e-01, 5.00000000e-01], + [ -2.38545485e-02, -1.92411427e-01, 3.57142857e-01], + [ -2.38545485e-02, -1.92411427e-01, 5.00000000e-01], + [ -1.67188024e-02, -2.78527075e-01, 3.57142857e-01], + [ -1.67188024e-02, -2.78527075e-01, 5.00000000e-01], + [ -5.85713293e-02, -2.53735203e-01, 3.57142857e-01], + [ -5.85713293e-02, -2.53735203e-01, 5.00000000e-01], + [ -7.99618007e-02, -3.30723513e-01, 3.57142857e-01], + [ -7.99618007e-02, -3.30723513e-01, 5.00000000e-01], + [ -1.01352272e-01, -4.07711823e-01, 3.57142857e-01], + [ -1.01352272e-01, -4.07711823e-01, 5.00000000e-01], + [ -2.49090925e-02, -3.51782132e-01, 3.57142857e-01], + [ -2.49090925e-02, -3.51782132e-01, 5.00000000e-01], + [ -3.30993826e-02, -4.25037189e-01, 3.57142857e-01], + [ -3.30993826e-02, -4.25037189e-01, 5.00000000e-01], + [ 6.77281572e-01, -7.35723911e-01, 3.57142857e-01], + [ 6.20841441e-01, -6.74413585e-01, 3.57142857e-01], + [ 6.77281572e-01, -7.35723911e-01, 5.00000000e-01], + [ 6.20841441e-01, -6.74413585e-01, 5.00000000e-01], + [ 7.89140509e-01, -6.14212713e-01, 3.57142857e-01], + [ 7.23378800e-01, -5.63028320e-01, 3.57142857e-01], + [ 7.89140509e-01, -6.14212713e-01, 5.00000000e-01], + [ 7.23378800e-01, -5.63028320e-01, 5.00000000e-01], + [ 8.79473751e-01, -4.75947393e-01, 3.57142857e-01], + [ 8.06184272e-01, -4.36285110e-01, 3.57142857e-01], + [ 8.79473751e-01, -4.75947393e-01, 5.00000000e-01], + [ 8.06184272e-01, -4.36285110e-01, 5.00000000e-01], + [ 9.45817242e-01, -3.24699469e-01, 3.57142857e-01], + [ 8.66999138e-01, -2.97641180e-01, 3.57142857e-01], + [ 9.45817242e-01, -3.24699469e-01, 5.00000000e-01], + [ 8.66999138e-01, -2.97641180e-01, 5.00000000e-01], + [ 9.86361303e-01, -1.64594590e-01, 3.57142857e-01], + [ 9.04164528e-01, -1.50878374e-01, 3.57142857e-01], + [ 9.86361303e-01, -1.64594590e-01, 5.00000000e-01], + [ 9.04164528e-01, -1.50878374e-01, 5.00000000e-01], + [ 5.64401310e-01, -6.13103259e-01, 3.57142857e-01], + [ 5.64401310e-01, -6.13103259e-01, 5.00000000e-01], + [ 6.57617091e-01, -5.11843927e-01, 3.57142857e-01], + [ 6.57617091e-01, -5.11843927e-01, 5.00000000e-01], + [ 7.32894793e-01, -3.96622828e-01, 3.57142857e-01], + [ 7.32894793e-01, -3.96622828e-01, 5.00000000e-01], + [ 7.88181035e-01, -2.70582891e-01, 3.57142857e-01], + [ 7.88181035e-01, -2.70582891e-01, 5.00000000e-01], + [ 8.21967753e-01, -1.37162159e-01, 3.57142857e-01], + [ 8.21967753e-01, -1.37162159e-01, 5.00000000e-01], + [ 5.07961179e-01, -5.51792933e-01, 3.57142857e-01], + [ 5.07961179e-01, -5.51792933e-01, 5.00000000e-01], + [ 5.91855382e-01, -4.60659535e-01, 3.57142857e-01], + [ 5.91855382e-01, -4.60659535e-01, 5.00000000e-01], + [ 6.59605313e-01, -3.56960545e-01, 3.57142857e-01], + [ 6.59605313e-01, -3.56960545e-01, 5.00000000e-01], + [ 7.09362931e-01, -2.43524602e-01, 3.57142857e-01], + [ 7.09362931e-01, -2.43524602e-01, 5.00000000e-01], + [ 7.39770978e-01, -1.23445943e-01, 3.57142857e-01], + [ 7.39770978e-01, -1.23445943e-01, 5.00000000e-01], + [ 4.51521048e-01, -4.90482607e-01, 3.57142857e-01], + [ 4.51521048e-01, -4.90482607e-01, 5.00000000e-01], + [ 5.26093673e-01, -4.09475142e-01, 3.57142857e-01], + [ 5.26093673e-01, -4.09475142e-01, 5.00000000e-01], + [ 5.86315834e-01, -3.17298262e-01, 3.57142857e-01], + [ 5.86315834e-01, -3.17298262e-01, 5.00000000e-01], + [ 6.30544828e-01, -2.16466313e-01, 3.57142857e-01], + [ 6.30544828e-01, -2.16466313e-01, 5.00000000e-01], + [ 6.57574202e-01, -1.09729727e-01, 3.57142857e-01], + [ 6.57574202e-01, -1.09729727e-01, 5.00000000e-01], + [ 3.95080917e-01, -4.29172281e-01, 3.57142857e-01], + [ 3.95080917e-01, -4.29172281e-01, 5.00000000e-01], + [ 4.60331964e-01, -3.58290749e-01, 3.57142857e-01], + [ 4.60331964e-01, -3.58290749e-01, 5.00000000e-01], + [ 5.13026355e-01, -2.77635979e-01, 3.57142857e-01], + [ 5.13026355e-01, -2.77635979e-01, 5.00000000e-01], + [ 5.51726724e-01, -1.89408024e-01, 3.57142857e-01], + [ 5.51726724e-01, -1.89408024e-01, 5.00000000e-01], + [ 5.75377427e-01, -9.60135110e-02, 3.57142857e-01], + [ 5.75377427e-01, -9.60135110e-02, 5.00000000e-01], + [ 3.38640786e-01, -3.67861955e-01, 3.57142857e-01], + [ 3.38640786e-01, -3.67861955e-01, 5.00000000e-01], + [ 3.94570255e-01, -3.07106356e-01, 3.57142857e-01], + [ 3.94570255e-01, -3.07106356e-01, 5.00000000e-01], + [ 4.39736876e-01, -2.37973697e-01, 3.57142857e-01], + [ 4.39736876e-01, -2.37973697e-01, 5.00000000e-01], + [ 4.72908621e-01, -1.62349735e-01, 3.57142857e-01], + [ 4.72908621e-01, -1.62349735e-01, 5.00000000e-01], + [ 4.93180652e-01, -8.22972951e-02, 3.57142857e-01], + [ 4.93180652e-01, -8.22972951e-02, 5.00000000e-01], + [ 4.02533591e-01, -1.40423963e-01, 3.57142857e-01], + [ 3.82383017e-01, -2.06935340e-01, 3.57142857e-01], + [ 4.02533591e-01, -1.40423963e-01, 5.00000000e-01], + [ 3.82383017e-01, -2.06935340e-01, 5.00000000e-01], + [ 4.14084357e-01, -7.09602665e-02, 3.57142857e-01], + [ 4.14084357e-01, -7.09602665e-02, 5.00000000e-01], + [ 3.32158562e-01, -1.18498191e-01, 3.57142857e-01], + [ 3.25029158e-01, -1.75896984e-01, 3.57142857e-01], + [ 3.32158562e-01, -1.18498191e-01, 5.00000000e-01], + [ 3.25029158e-01, -1.75896984e-01, 5.00000000e-01], + [ 3.34988061e-01, -5.96232379e-02, 3.57142857e-01], + [ 3.34988061e-01, -5.96232379e-02, 5.00000000e-01], + [ 2.61783533e-01, -9.65724185e-02, 3.57142857e-01], + [ 2.67675299e-01, -1.44858628e-01, 3.57142857e-01], + [ 2.61783533e-01, -9.65724185e-02, 5.00000000e-01], + [ 2.67675299e-01, -1.44858628e-01, 5.00000000e-01], + [ 2.55891766e-01, -4.82862093e-02, 3.57142857e-01], + [ 2.55891766e-01, -4.82862093e-02, 5.00000000e-01], + [ 1.85787515e-01, -5.54454306e-02, 3.57142857e-01], + [ 1.85787515e-01, -5.54454306e-02, 5.00000000e-01], + [ 1.15683264e-01, -6.26046519e-02, 3.57142857e-01], + [ 1.15683264e-01, -6.26046519e-02, 5.00000000e-01], + [ 2.04908364e-01, -1.10890861e-01, 3.57142857e-01], + [ 2.04908364e-01, -1.10890861e-01, 5.00000000e-01], + [ 1.48033195e-01, -1.25209304e-01, 3.57142857e-01], + [ 1.48033195e-01, -1.25209304e-01, 5.00000000e-01], + [ 2.24029213e-01, -1.66336292e-01, 3.57142857e-01], + [ 2.24029213e-01, -1.66336292e-01, 5.00000000e-01], + [ 1.80383126e-01, -1.87813956e-01, 3.57142857e-01], + [ 1.80383126e-01, -1.87813956e-01, 5.00000000e-01], + [ 2.33135679e-01, -2.47829956e-01, 3.57142857e-01], + [ 2.33135679e-01, -2.47829956e-01, 5.00000000e-01], + [ 2.85888233e-01, -3.07845955e-01, 3.57142857e-01], + [ 2.85888233e-01, -3.07845955e-01, 5.00000000e-01], + [ 2.80876227e-01, -2.13259647e-01, 3.57142857e-01], + [ 2.80876227e-01, -2.13259647e-01, 5.00000000e-01], + [ 3.37723241e-01, -2.60183001e-01, 3.57142857e-01], + [ 3.37723241e-01, -2.60183001e-01, 5.00000000e-01], + [ 1.00000000e+00, 0.00000000e+00, 2.14285714e-01], + [ 9.86361303e-01, 1.64594590e-01, 2.14285714e-01], + [ 9.04164528e-01, 1.50878374e-01, 2.14285714e-01], + [ 9.16666667e-01, 7.92157468e-17, 2.14285714e-01], + [ 9.45817242e-01, 3.24699469e-01, 2.14285714e-01], + [ 8.66999138e-01, 2.97641180e-01, 2.14285714e-01], + [ 8.79473751e-01, 4.75947393e-01, 2.14285714e-01], + [ 8.06184272e-01, 4.36285110e-01, 2.14285714e-01], + [ 7.89140509e-01, 6.14212713e-01, 2.14285714e-01], + [ 7.23378800e-01, 5.63028320e-01, 2.14285714e-01], + [ 6.77281572e-01, 7.35723911e-01, 2.14285714e-01], + [ 6.20841441e-01, 6.74413585e-01, 2.14285714e-01], + [ 5.46948158e-01, 8.37166478e-01, 2.14285714e-01], + [ 5.01369145e-01, 7.67402605e-01, 2.14285714e-01], + [ 4.01695425e-01, 9.15773327e-01, 2.14285714e-01], + [ 3.68220806e-01, 8.39458883e-01, 2.14285714e-01], + [ 8.21967753e-01, 1.37162159e-01, 2.14285714e-01], + [ 8.33333333e-01, 1.09189934e-16, 2.14285714e-01], + [ 7.88181035e-01, 2.70582891e-01, 2.14285714e-01], + [ 7.32894793e-01, 3.96622828e-01, 2.14285714e-01], + [ 6.57617091e-01, 5.11843927e-01, 2.14285714e-01], + [ 5.64401310e-01, 6.13103259e-01, 2.14285714e-01], + [ 4.55790132e-01, 6.97638732e-01, 2.14285714e-01], + [ 3.34746187e-01, 7.63144439e-01, 2.14285714e-01], + [ 7.39770978e-01, 1.23445943e-01, 2.14285714e-01], + [ 7.50000000e-01, 1.08072838e-16, 2.14285714e-01], + [ 7.09362931e-01, 2.43524602e-01, 2.14285714e-01], + [ 6.59605313e-01, 3.56960545e-01, 2.14285714e-01], + [ 5.91855382e-01, 4.60659535e-01, 2.14285714e-01], + [ 5.07961179e-01, 5.51792933e-01, 2.14285714e-01], + [ 4.10211119e-01, 6.27874859e-01, 2.14285714e-01], + [ 3.01271568e-01, 6.86829995e-01, 2.14285714e-01], + [ 6.57574202e-01, 1.09729727e-01, 2.14285714e-01], + [ 6.66666667e-01, 9.87992924e-17, 2.14285714e-01], + [ 6.30544828e-01, 2.16466313e-01, 2.14285714e-01], + [ 5.86315834e-01, 3.17298262e-01, 2.14285714e-01], + [ 5.26093673e-01, 4.09475142e-01, 2.14285714e-01], + [ 4.51521048e-01, 4.90482607e-01, 2.14285714e-01], + [ 3.64632105e-01, 5.58110986e-01, 2.14285714e-01], + [ 2.67796950e-01, 6.10515551e-01, 2.14285714e-01], + [ 5.75377427e-01, 9.60135110e-02, 2.14285714e-01], + [ 5.83333333e-01, 8.67681639e-17, 2.14285714e-01], + [ 5.51726724e-01, 1.89408024e-01, 2.14285714e-01], + [ 5.13026355e-01, 2.77635979e-01, 2.14285714e-01], + [ 4.60331964e-01, 3.58290749e-01, 2.14285714e-01], + [ 3.95080917e-01, 4.29172281e-01, 2.14285714e-01], + [ 3.19053092e-01, 4.88347112e-01, 2.14285714e-01], + [ 2.34322331e-01, 5.34201107e-01, 2.14285714e-01], + [ 4.93180652e-01, 8.22972951e-02, 2.14285714e-01], + [ 5.00000000e-01, 7.34814867e-17, 2.14285714e-01], + [ 4.72908621e-01, 1.62349735e-01, 2.14285714e-01], + [ 4.39736876e-01, 2.37973697e-01, 2.14285714e-01], + [ 3.94570255e-01, 3.07106356e-01, 2.14285714e-01], + [ 3.38640786e-01, 3.67861955e-01, 2.14285714e-01], + [ 2.73474079e-01, 4.18583239e-01, 2.14285714e-01], + [ 2.00847712e-01, 4.57886663e-01, 2.14285714e-01], + [ 2.92606991e-01, 3.16445261e-01, 2.14285714e-01], + [ 3.44188184e-01, 2.67935253e-01, 2.14285714e-01], + [ 2.34867640e-01, 3.58265725e-01, 2.14285714e-01], + [ 1.72155182e-01, 3.92474283e-01, 2.14285714e-01], + [ 2.46573197e-01, 2.65028567e-01, 2.14285714e-01], + [ 2.93806114e-01, 2.28764151e-01, 2.14285714e-01], + [ 1.96261201e-01, 2.97948211e-01, 2.14285714e-01], + [ 1.43462652e-01, 3.27061902e-01, 2.14285714e-01], + [ 2.00539403e-01, 2.13611872e-01, 2.14285714e-01], + [ 2.43424043e-01, 1.89593048e-01, 2.14285714e-01], + [ 1.57654762e-01, 2.37630697e-01, 2.14285714e-01], + [ 1.14770121e-01, 2.61649522e-01, 2.14285714e-01], + [ 8.60775910e-02, 1.96237141e-01, 2.14285714e-01], + [ 1.39074405e-01, 1.78223023e-01, 2.14285714e-01], + [ 5.73850607e-02, 1.30824761e-01, 2.14285714e-01], + [ 1.20494048e-01, 1.18815349e-01, 2.14285714e-01], + [ 2.86925303e-02, 6.54123805e-02, 2.14285714e-01], + [ 1.01913690e-01, 5.94076743e-02, 2.14285714e-01], + [ -2.17036080e-17, -1.20233781e-17, 2.14285714e-01], + [ 8.33333333e-02, 2.13668869e-18, 2.14285714e-01], + [ 1.92071219e-01, 1.60208904e-01, 2.14285714e-01], + [ 1.83603035e-01, 1.06805936e-01, 2.14285714e-01], + [ 1.75134851e-01, 5.34029681e-02, 2.14285714e-01], + [ 1.66666667e-01, 1.64436543e-17, 2.14285714e-01], + [ 2.45068032e-01, 1.42194786e-01, 2.14285714e-01], + [ 2.46712022e-01, 9.47965238e-02, 2.14285714e-01], + [ 2.48356011e-01, 4.73982619e-02, 2.14285714e-01], + [ 2.50000000e-01, 3.08454053e-17, 2.14285714e-01], + [ 3.33333333e-01, 4.52549212e-17, 2.14285714e-01], + [ 3.29964224e-01, 5.90312730e-02, 2.14285714e-01], + [ 4.16666667e-01, 5.95357666e-17, 2.14285714e-01], + [ 4.11572438e-01, 7.06642841e-02, 2.14285714e-01], + [ 3.22110888e-01, 1.17314261e-01, 2.14285714e-01], + [ 3.97509754e-01, 1.39831998e-01, 2.14285714e-01], + [ 3.09957647e-01, 1.74121089e-01, 2.14285714e-01], + [ 3.74847261e-01, 2.06047393e-01, 2.14285714e-01], + [ 2.45485487e-01, 9.69400266e-01, 2.14285714e-01], + [ 2.25028363e-01, 8.88616910e-01, 2.14285714e-01], + [ 8.25793455e-02, 9.96584493e-01, 2.14285714e-01], + [ 7.56977333e-02, 9.13535785e-01, 2.14285714e-01], + [ -8.25793455e-02, 9.96584493e-01, 2.14285714e-01], + [ -7.56977333e-02, 9.13535785e-01, 2.14285714e-01], + [ -2.45485487e-01, 9.69400266e-01, 2.14285714e-01], + [ -2.25028363e-01, 8.88616910e-01, 2.14285714e-01], + [ -4.01695425e-01, 9.15773327e-01, 2.14285714e-01], + [ -3.68220806e-01, 8.39458883e-01, 2.14285714e-01], + [ -5.46948158e-01, 8.37166478e-01, 2.14285714e-01], + [ -5.01369145e-01, 7.67402605e-01, 2.14285714e-01], + [ -6.77281572e-01, 7.35723911e-01, 2.14285714e-01], + [ -6.20841441e-01, 6.74413585e-01, 2.14285714e-01], + [ 2.04571239e-01, 8.07833555e-01, 2.14285714e-01], + [ 6.88161212e-02, 8.30487078e-01, 2.14285714e-01], + [ -6.88161212e-02, 8.30487078e-01, 2.14285714e-01], + [ -2.04571239e-01, 8.07833555e-01, 2.14285714e-01], + [ -3.34746187e-01, 7.63144439e-01, 2.14285714e-01], + [ -4.55790132e-01, 6.97638732e-01, 2.14285714e-01], + [ -5.64401310e-01, 6.13103259e-01, 2.14285714e-01], + [ 1.84114115e-01, 7.27050199e-01, 2.14285714e-01], + [ 6.19345091e-02, 7.47438370e-01, 2.14285714e-01], + [ -6.19345091e-02, 7.47438370e-01, 2.14285714e-01], + [ -1.84114115e-01, 7.27050199e-01, 2.14285714e-01], + [ -3.01271568e-01, 6.86829995e-01, 2.14285714e-01], + [ -4.10211119e-01, 6.27874859e-01, 2.14285714e-01], + [ -5.07961179e-01, 5.51792933e-01, 2.14285714e-01], + [ 1.63656991e-01, 6.46266844e-01, 2.14285714e-01], + [ 5.50528970e-02, 6.64389662e-01, 2.14285714e-01], + [ -5.50528970e-02, 6.64389662e-01, 2.14285714e-01], + [ -1.63656991e-01, 6.46266844e-01, 2.14285714e-01], + [ -2.67796950e-01, 6.10515551e-01, 2.14285714e-01], + [ -3.64632105e-01, 5.58110986e-01, 2.14285714e-01], + [ -4.51521048e-01, 4.90482607e-01, 2.14285714e-01], + [ 1.43199867e-01, 5.65483488e-01, 2.14285714e-01], + [ 4.81712849e-02, 5.81340954e-01, 2.14285714e-01], + [ -4.81712849e-02, 5.81340954e-01, 2.14285714e-01], + [ -1.43199867e-01, 5.65483488e-01, 2.14285714e-01], + [ -2.34322331e-01, 5.34201107e-01, 2.14285714e-01], + [ -3.19053092e-01, 4.88347112e-01, 2.14285714e-01], + [ -3.95080917e-01, 4.29172281e-01, 2.14285714e-01], + [ 1.22742744e-01, 4.84700133e-01, 2.14285714e-01], + [ 4.12896727e-02, 4.98292247e-01, 2.14285714e-01], + [ -4.12896727e-02, 4.98292247e-01, 2.14285714e-01], + [ -1.22742744e-01, 4.84700133e-01, 2.14285714e-01], + [ -2.00847712e-01, 4.57886663e-01, 2.14285714e-01], + [ -2.73474079e-01, 4.18583239e-01, 2.14285714e-01], + [ -3.38640786e-01, 3.67861955e-01, 2.14285714e-01], + [ -1.02283149e-01, 4.15336195e-01, 2.14285714e-01], + [ -3.59859419e-02, 4.34695086e-01, 2.14285714e-01], + [ -1.66348287e-01, 3.87163066e-01, 2.14285714e-01], + [ -2.26761024e-01, 3.50663301e-01, 2.14285714e-01], + [ -2.82200655e-01, 3.06551629e-01, 2.14285714e-01], + [ -8.18235534e-02, 3.45972257e-01, 2.14285714e-01], + [ -3.06822110e-02, 3.71097926e-01, 2.14285714e-01], + [ -1.31848862e-01, 3.16439469e-01, 2.14285714e-01], + [ -1.80047970e-01, 2.82743363e-01, 2.14285714e-01], + [ -2.25760524e-01, 2.45241304e-01, 2.14285714e-01], + [ -6.13639584e-02, 2.76608319e-01, 2.14285714e-01], + [ -2.53784802e-02, 3.07500766e-01, 2.14285714e-01], + [ -9.73494365e-02, 2.45715872e-01, 2.14285714e-01], + [ -1.33334915e-01, 2.14823425e-01, 2.14285714e-01], + [ -1.69320393e-01, 1.83930978e-01, 2.14285714e-01], + [ -1.12880262e-01, 1.22620652e-01, 2.14285714e-01], + [ -7.93257664e-02, 1.65019743e-01, 2.14285714e-01], + [ -5.64401310e-02, 6.13103259e-02, 2.14285714e-01], + [ -2.53166180e-02, 1.15216062e-01, 2.14285714e-01], + [ -4.57712708e-02, 2.07418835e-01, 2.14285714e-01], + [ 5.80689493e-03, 1.69121798e-01, 2.14285714e-01], + [ -1.22167752e-02, 2.49817927e-01, 2.14285714e-01], + [ 3.69304079e-02, 2.23027534e-01, 2.14285714e-01], + [ 2.13377203e-02, 2.92217018e-01, 2.14285714e-01], + [ 6.80539208e-02, 2.76933270e-01, 2.14285714e-01], + [ 8.62835284e-02, 3.46188891e-01, 2.14285714e-01], + [ 1.04513136e-01, 4.15444512e-01, 2.14285714e-01], + [ 2.79883711e-02, 3.60908761e-01, 2.14285714e-01], + [ 3.46390219e-02, 4.29600504e-01, 2.14285714e-01], + [ -7.89140509e-01, 6.14212713e-01, 2.14285714e-01], + [ -7.23378800e-01, 5.63028320e-01, 2.14285714e-01], + [ -8.79473751e-01, 4.75947393e-01, 2.14285714e-01], + [ -8.06184272e-01, 4.36285110e-01, 2.14285714e-01], + [ -9.45817242e-01, 3.24699469e-01, 2.14285714e-01], + [ -8.66999138e-01, 2.97641180e-01, 2.14285714e-01], + [ -9.86361303e-01, 1.64594590e-01, 2.14285714e-01], + [ -9.04164528e-01, 1.50878374e-01, 2.14285714e-01], + [ -1.00000000e+00, 5.24848628e-17, 2.14285714e-01], + [ -9.16666667e-01, 5.61432674e-17, 2.14285714e-01], + [ -9.86361303e-01, -1.64594590e-01, 2.14285714e-01], + [ -9.04164528e-01, -1.50878374e-01, 2.14285714e-01], + [ -6.57617091e-01, 5.11843927e-01, 2.14285714e-01], + [ -7.32894793e-01, 3.96622828e-01, 2.14285714e-01], + [ -7.88181035e-01, 2.70582891e-01, 2.14285714e-01], + [ -8.21967753e-01, 1.37162159e-01, 2.14285714e-01], + [ -8.33333333e-01, 4.98053016e-17, 2.14285714e-01], + [ -8.21967753e-01, -1.37162159e-01, 2.14285714e-01], + [ -5.91855382e-01, 4.60659535e-01, 2.14285714e-01], + [ -6.59605313e-01, 3.56960545e-01, 2.14285714e-01], + [ -7.09362931e-01, 2.43524602e-01, 2.14285714e-01], + [ -7.39770978e-01, 1.23445943e-01, 2.14285714e-01], + [ -7.50000000e-01, 4.30290320e-17, 2.14285714e-01], + [ -7.39770978e-01, -1.23445943e-01, 2.14285714e-01], + [ -5.26093673e-01, 4.09475142e-01, 2.14285714e-01], + [ -5.86315834e-01, 3.17298262e-01, 2.14285714e-01], + [ -6.30544828e-01, 2.16466313e-01, 2.14285714e-01], + [ -6.57574202e-01, 1.09729727e-01, 2.14285714e-01], + [ -6.66666667e-01, 3.61383006e-17, 2.14285714e-01], + [ -6.57574202e-01, -1.09729727e-01, 2.14285714e-01], + [ -4.60331964e-01, 3.58290749e-01, 2.14285714e-01], + [ -5.13026355e-01, 2.77635979e-01, 2.14285714e-01], + [ -5.51726724e-01, 1.89408024e-01, 2.14285714e-01], + [ -5.75377427e-01, 9.60135110e-02, 2.14285714e-01], + [ -5.83333333e-01, 2.93213442e-17, 2.14285714e-01], + [ -5.75377427e-01, -9.60135110e-02, 2.14285714e-01], + [ -3.94570255e-01, 3.07106356e-01, 2.14285714e-01], + [ -4.39736876e-01, 2.37973697e-01, 2.14285714e-01], + [ -4.72908621e-01, 1.62349735e-01, 2.14285714e-01], + [ -4.93180652e-01, 8.22972951e-02, 2.14285714e-01], + [ -5.00000000e-01, 2.26876270e-17, 2.14285714e-01], + [ -4.93180652e-01, -8.22972951e-02, 2.14285714e-01], + [ -4.20156583e-01, 7.22539112e-02, 2.14285714e-01], + [ -4.11228248e-01, 1.41174836e-01, 2.14285714e-01], + [ -4.20116462e-01, 1.83641595e-03, 2.14285714e-01], + [ -4.10983876e-01, -6.85810793e-02, 2.14285714e-01], + [ -3.47132513e-01, 6.22105272e-02, 2.14285714e-01], + [ -3.49547876e-01, 1.19999937e-01, 2.14285714e-01], + [ -3.40232923e-01, 3.67283191e-03, 2.14285714e-01], + [ -3.28787101e-01, -5.48648634e-02, 2.14285714e-01], + [ -2.74108444e-01, 5.21671433e-02, 2.14285714e-01], + [ -2.87867503e-01, 9.88250387e-02, 2.14285714e-01], + [ -2.60349385e-01, 5.50924786e-03, 2.14285714e-01], + [ -2.46590326e-01, -4.11486476e-02, 2.14285714e-01], + [ -1.64393551e-01, -2.74324317e-02, 2.14285714e-01], + [ -1.92379634e-01, 2.41096072e-02, 2.14285714e-01], + [ -8.21967753e-02, -1.37162159e-02, 2.14285714e-01], + [ -1.24409882e-01, 4.27099665e-02, 2.14285714e-01], + [ -2.20365717e-01, 7.56516461e-02, 2.14285714e-01], + [ -1.66622989e-01, 9.91361489e-02, 2.14285714e-01], + [ -2.48351800e-01, 1.27193685e-01, 2.14285714e-01], + [ -2.08836096e-01, 1.55562331e-01, 2.14285714e-01], + [ -2.70747482e-01, 2.06077006e-01, 2.14285714e-01], + [ -3.32658869e-01, 2.56591681e-01, 2.14285714e-01], + [ -3.12146825e-01, 1.64120356e-01, 2.14285714e-01], + [ -3.75941850e-01, 2.01047026e-01, 2.14285714e-01], + [ -9.45817242e-01, -3.24699469e-01, 2.14285714e-01], + [ -8.66999138e-01, -2.97641180e-01, 2.14285714e-01], + [ -8.79473751e-01, -4.75947393e-01, 2.14285714e-01], + [ -8.06184272e-01, -4.36285110e-01, 2.14285714e-01], + [ -7.89140509e-01, -6.14212713e-01, 2.14285714e-01], + [ -7.23378800e-01, -5.63028320e-01, 2.14285714e-01], + [ -6.77281572e-01, -7.35723911e-01, 2.14285714e-01], + [ -6.20841441e-01, -6.74413585e-01, 2.14285714e-01], + [ -5.46948158e-01, -8.37166478e-01, 2.14285714e-01], + [ -5.01369145e-01, -7.67402605e-01, 2.14285714e-01], + [ -4.01695425e-01, -9.15773327e-01, 2.14285714e-01], + [ -3.68220806e-01, -8.39458883e-01, 2.14285714e-01], + [ -7.88181035e-01, -2.70582891e-01, 2.14285714e-01], + [ -7.32894793e-01, -3.96622828e-01, 2.14285714e-01], + [ -6.57617091e-01, -5.11843927e-01, 2.14285714e-01], + [ -5.64401310e-01, -6.13103259e-01, 2.14285714e-01], + [ -4.55790132e-01, -6.97638732e-01, 2.14285714e-01], + [ -3.34746187e-01, -7.63144439e-01, 2.14285714e-01], + [ -7.09362931e-01, -2.43524602e-01, 2.14285714e-01], + [ -6.59605313e-01, -3.56960545e-01, 2.14285714e-01], + [ -5.91855382e-01, -4.60659535e-01, 2.14285714e-01], + [ -5.07961179e-01, -5.51792933e-01, 2.14285714e-01], + [ -4.10211119e-01, -6.27874859e-01, 2.14285714e-01], + [ -3.01271568e-01, -6.86829995e-01, 2.14285714e-01], + [ -6.30544828e-01, -2.16466313e-01, 2.14285714e-01], + [ -5.86315834e-01, -3.17298262e-01, 2.14285714e-01], + [ -5.26093673e-01, -4.09475142e-01, 2.14285714e-01], + [ -4.51521048e-01, -4.90482607e-01, 2.14285714e-01], + [ -3.64632105e-01, -5.58110986e-01, 2.14285714e-01], + [ -2.67796950e-01, -6.10515551e-01, 2.14285714e-01], + [ -5.51726724e-01, -1.89408024e-01, 2.14285714e-01], + [ -5.13026355e-01, -2.77635979e-01, 2.14285714e-01], + [ -4.60331964e-01, -3.58290749e-01, 2.14285714e-01], + [ -3.95080917e-01, -4.29172281e-01, 2.14285714e-01], + [ -3.19053092e-01, -4.88347112e-01, 2.14285714e-01], + [ -2.34322331e-01, -5.34201107e-01, 2.14285714e-01], + [ -4.72908621e-01, -1.62349735e-01, 2.14285714e-01], + [ -4.39736876e-01, -2.37973697e-01, 2.14285714e-01], + [ -3.94570255e-01, -3.07106356e-01, 2.14285714e-01], + [ -3.38640786e-01, -3.67861955e-01, 2.14285714e-01], + [ -2.73474079e-01, -4.18583239e-01, 2.14285714e-01], + [ -2.00847712e-01, -4.57886663e-01, 2.14285714e-01], + [ -2.90292421e-01, -3.12221863e-01, 2.14285714e-01], + [ -3.43107373e-01, -2.67051188e-01, 2.14285714e-01], + [ -2.31319311e-01, -3.50702994e-01, 2.14285714e-01], + [ -1.67373094e-01, -3.81572219e-01, 2.14285714e-01], + [ -2.41944057e-01, -2.56581770e-01, 2.14285714e-01], + [ -2.91644492e-01, -2.26996019e-01, 2.14285714e-01], + [ -1.89164543e-01, -2.82822750e-01, 2.14285714e-01], + [ -1.33898475e-01, -3.05257776e-01, 2.14285714e-01], + [ -1.93595692e-01, -2.00941678e-01, 2.14285714e-01], + [ -2.40181610e-01, -1.86940851e-01, 2.14285714e-01], + [ -1.47009774e-01, -2.14942505e-01, 2.14285714e-01], + [ -1.00423856e-01, -2.28943332e-01, 2.14285714e-01], + [ -6.69492374e-02, -1.52628888e-01, 2.14285714e-01], + [ -1.25405441e-01, -1.47867075e-01, 2.14285714e-01], + [ -3.34746187e-02, -7.63144439e-02, 2.14285714e-01], + [ -1.03801108e-01, -8.07916455e-02, 2.14285714e-01], + [ -1.83861645e-01, -1.43105263e-01, 2.14285714e-01], + [ -1.74127598e-01, -8.52688471e-02, 2.14285714e-01], + [ -2.42317849e-01, -1.38343450e-01, 2.14285714e-01], + [ -2.44454087e-01, -8.97460487e-02, 2.14285714e-01], + [ -3.20605599e-01, -1.13947277e-01, 2.14285714e-01], + [ -3.96757110e-01, -1.38148506e-01, 2.14285714e-01], + [ -3.08124191e-01, -1.71553532e-01, 2.14285714e-01], + [ -3.73930533e-01, -2.04763614e-01, 2.14285714e-01], + [ -2.45485487e-01, -9.69400266e-01, 2.14285714e-01], + [ -2.25028363e-01, -8.88616910e-01, 2.14285714e-01], + [ -8.25793455e-02, -9.96584493e-01, 2.14285714e-01], + [ -7.56977333e-02, -9.13535785e-01, 2.14285714e-01], + [ 8.25793455e-02, -9.96584493e-01, 2.14285714e-01], + [ 7.56977333e-02, -9.13535785e-01, 2.14285714e-01], + [ 2.45485487e-01, -9.69400266e-01, 2.14285714e-01], + [ 2.25028363e-01, -8.88616910e-01, 2.14285714e-01], + [ 4.01695425e-01, -9.15773327e-01, 2.14285714e-01], + [ 3.68220806e-01, -8.39458883e-01, 2.14285714e-01], + [ 5.46948158e-01, -8.37166478e-01, 2.14285714e-01], + [ 5.01369145e-01, -7.67402605e-01, 2.14285714e-01], + [ -2.04571239e-01, -8.07833555e-01, 2.14285714e-01], + [ -6.88161212e-02, -8.30487078e-01, 2.14285714e-01], + [ 6.88161212e-02, -8.30487078e-01, 2.14285714e-01], + [ 2.04571239e-01, -8.07833555e-01, 2.14285714e-01], + [ 3.34746187e-01, -7.63144439e-01, 2.14285714e-01], + [ 4.55790132e-01, -6.97638732e-01, 2.14285714e-01], + [ -1.84114115e-01, -7.27050199e-01, 2.14285714e-01], + [ -6.19345091e-02, -7.47438370e-01, 2.14285714e-01], + [ 6.19345091e-02, -7.47438370e-01, 2.14285714e-01], + [ 1.84114115e-01, -7.27050199e-01, 2.14285714e-01], + [ 3.01271568e-01, -6.86829995e-01, 2.14285714e-01], + [ 4.10211119e-01, -6.27874859e-01, 2.14285714e-01], + [ -1.63656991e-01, -6.46266844e-01, 2.14285714e-01], + [ -5.50528970e-02, -6.64389662e-01, 2.14285714e-01], + [ 5.50528970e-02, -6.64389662e-01, 2.14285714e-01], + [ 1.63656991e-01, -6.46266844e-01, 2.14285714e-01], + [ 2.67796950e-01, -6.10515551e-01, 2.14285714e-01], + [ 3.64632105e-01, -5.58110986e-01, 2.14285714e-01], + [ -1.43199867e-01, -5.65483488e-01, 2.14285714e-01], + [ -4.81712849e-02, -5.81340954e-01, 2.14285714e-01], + [ 4.81712849e-02, -5.81340954e-01, 2.14285714e-01], + [ 1.43199867e-01, -5.65483488e-01, 2.14285714e-01], + [ 2.34322331e-01, -5.34201107e-01, 2.14285714e-01], + [ 3.19053092e-01, -4.88347112e-01, 2.14285714e-01], + [ -1.22742744e-01, -4.84700133e-01, 2.14285714e-01], + [ -4.12896727e-02, -4.98292247e-01, 2.14285714e-01], + [ 4.12896727e-02, -4.98292247e-01, 2.14285714e-01], + [ 1.22742744e-01, -4.84700133e-01, 2.14285714e-01], + [ 2.00847712e-01, -4.57886663e-01, 2.14285714e-01], + [ 2.73474079e-01, -4.18583239e-01, 2.14285714e-01], + [ 1.02606772e-01, -4.13792257e-01, 2.14285714e-01], + [ 3.59043567e-02, -4.33301147e-01, 2.14285714e-01], + [ 1.67077120e-01, -3.85469130e-01, 2.14285714e-01], + [ 2.27895066e-01, -3.48819366e-01, 2.14285714e-01], + [ 8.24708009e-02, -3.42884381e-01, 2.14285714e-01], + [ 3.05190406e-02, -3.68310047e-01, 2.14285714e-01], + [ 1.33306527e-01, -3.13051596e-01, 2.14285714e-01], + [ 1.82316053e-01, -2.79055493e-01, 2.14285714e-01], + [ 6.23348295e-02, -2.71976505e-01, 2.14285714e-01], + [ 2.51337245e-02, -3.03318947e-01, 2.14285714e-01], + [ 9.95359345e-02, -2.40634062e-01, 2.14285714e-01], + [ 1.36737040e-01, -2.09291620e-01, 2.14285714e-01], + [ 9.11580264e-02, -1.39527746e-01, 2.14285714e-01], + [ 5.51990834e-02, -1.85860856e-01, 2.14285714e-01], + [ 4.55790132e-02, -6.97638732e-02, 2.14285714e-01], + [ 1.08622324e-02, -1.31087650e-01, 2.14285714e-01], + [ 1.92401405e-02, -2.32193966e-01, 2.14285714e-01], + [ -2.38545485e-02, -1.92411427e-01, 2.14285714e-01], + [ -1.67188024e-02, -2.78527075e-01, 2.14285714e-01], + [ -5.85713293e-02, -2.53735203e-01, 2.14285714e-01], + [ -7.99618007e-02, -3.30723513e-01, 2.14285714e-01], + [ -1.01352272e-01, -4.07711823e-01, 2.14285714e-01], + [ -2.49090925e-02, -3.51782132e-01, 2.14285714e-01], + [ -3.30993826e-02, -4.25037189e-01, 2.14285714e-01], + [ 6.77281572e-01, -7.35723911e-01, 2.14285714e-01], + [ 6.20841441e-01, -6.74413585e-01, 2.14285714e-01], + [ 7.89140509e-01, -6.14212713e-01, 2.14285714e-01], + [ 7.23378800e-01, -5.63028320e-01, 2.14285714e-01], + [ 8.79473751e-01, -4.75947393e-01, 2.14285714e-01], + [ 8.06184272e-01, -4.36285110e-01, 2.14285714e-01], + [ 9.45817242e-01, -3.24699469e-01, 2.14285714e-01], + [ 8.66999138e-01, -2.97641180e-01, 2.14285714e-01], + [ 9.86361303e-01, -1.64594590e-01, 2.14285714e-01], + [ 9.04164528e-01, -1.50878374e-01, 2.14285714e-01], + [ 5.64401310e-01, -6.13103259e-01, 2.14285714e-01], + [ 6.57617091e-01, -5.11843927e-01, 2.14285714e-01], + [ 7.32894793e-01, -3.96622828e-01, 2.14285714e-01], + [ 7.88181035e-01, -2.70582891e-01, 2.14285714e-01], + [ 8.21967753e-01, -1.37162159e-01, 2.14285714e-01], + [ 5.07961179e-01, -5.51792933e-01, 2.14285714e-01], + [ 5.91855382e-01, -4.60659535e-01, 2.14285714e-01], + [ 6.59605313e-01, -3.56960545e-01, 2.14285714e-01], + [ 7.09362931e-01, -2.43524602e-01, 2.14285714e-01], + [ 7.39770978e-01, -1.23445943e-01, 2.14285714e-01], + [ 4.51521048e-01, -4.90482607e-01, 2.14285714e-01], + [ 5.26093673e-01, -4.09475142e-01, 2.14285714e-01], + [ 5.86315834e-01, -3.17298262e-01, 2.14285714e-01], + [ 6.30544828e-01, -2.16466313e-01, 2.14285714e-01], + [ 6.57574202e-01, -1.09729727e-01, 2.14285714e-01], + [ 3.95080917e-01, -4.29172281e-01, 2.14285714e-01], + [ 4.60331964e-01, -3.58290749e-01, 2.14285714e-01], + [ 5.13026355e-01, -2.77635979e-01, 2.14285714e-01], + [ 5.51726724e-01, -1.89408024e-01, 2.14285714e-01], + [ 5.75377427e-01, -9.60135110e-02, 2.14285714e-01], + [ 3.38640786e-01, -3.67861955e-01, 2.14285714e-01], + [ 3.94570255e-01, -3.07106356e-01, 2.14285714e-01], + [ 4.39736876e-01, -2.37973697e-01, 2.14285714e-01], + [ 4.72908621e-01, -1.62349735e-01, 2.14285714e-01], + [ 4.93180652e-01, -8.22972951e-02, 2.14285714e-01], + [ 4.02533591e-01, -1.40423963e-01, 2.14285714e-01], + [ 3.82383017e-01, -2.06935340e-01, 2.14285714e-01], + [ 4.14084357e-01, -7.09602665e-02, 2.14285714e-01], + [ 3.32158562e-01, -1.18498191e-01, 2.14285714e-01], + [ 3.25029158e-01, -1.75896984e-01, 2.14285714e-01], + [ 3.34988061e-01, -5.96232379e-02, 2.14285714e-01], + [ 2.61783533e-01, -9.65724185e-02, 2.14285714e-01], + [ 2.67675299e-01, -1.44858628e-01, 2.14285714e-01], + [ 2.55891766e-01, -4.82862093e-02, 2.14285714e-01], + [ 1.85787515e-01, -5.54454306e-02, 2.14285714e-01], + [ 1.15683264e-01, -6.26046519e-02, 2.14285714e-01], + [ 2.04908364e-01, -1.10890861e-01, 2.14285714e-01], + [ 1.48033195e-01, -1.25209304e-01, 2.14285714e-01], + [ 2.24029213e-01, -1.66336292e-01, 2.14285714e-01], + [ 1.80383126e-01, -1.87813956e-01, 2.14285714e-01], + [ 2.33135679e-01, -2.47829956e-01, 2.14285714e-01], + [ 2.85888233e-01, -3.07845955e-01, 2.14285714e-01], + [ 2.80876227e-01, -2.13259647e-01, 2.14285714e-01], + [ 3.37723241e-01, -2.60183001e-01, 2.14285714e-01], + [ 1.00000000e+00, 0.00000000e+00, 7.14285714e-02], + [ 9.86361303e-01, 1.64594590e-01, 7.14285714e-02], + [ 9.04164528e-01, 1.50878374e-01, 7.14285714e-02], + [ 9.16666667e-01, 6.89122780e-17, 7.14285714e-02], + [ 9.45817242e-01, 3.24699469e-01, 7.14285714e-02], + [ 8.66999138e-01, 2.97641180e-01, 7.14285714e-02], + [ 8.79473751e-01, 4.75947393e-01, 7.14285714e-02], + [ 8.06184272e-01, 4.36285110e-01, 7.14285714e-02], + [ 7.89140509e-01, 6.14212713e-01, 7.14285714e-02], + [ 7.23378800e-01, 5.63028320e-01, 7.14285714e-02], + [ 6.77281572e-01, 7.35723911e-01, 7.14285714e-02], + [ 6.20841441e-01, 6.74413585e-01, 7.14285714e-02], + [ 5.46948158e-01, 8.37166478e-01, 7.14285714e-02], + [ 5.01369145e-01, 7.67402605e-01, 7.14285714e-02], + [ 4.01695425e-01, 9.15773327e-01, 7.14285714e-02], + [ 3.68220806e-01, 8.39458883e-01, 7.14285714e-02], + [ 8.21967753e-01, 1.37162159e-01, 7.14285714e-02], + [ 8.33333333e-01, 1.18742958e-16, 7.14285714e-02], + [ 7.88181035e-01, 2.70582891e-01, 7.14285714e-02], + [ 7.32894793e-01, 3.96622828e-01, 7.14285714e-02], + [ 6.57617091e-01, 5.11843927e-01, 7.14285714e-02], + [ 5.64401310e-01, 6.13103259e-01, 7.14285714e-02], + [ 4.55790132e-01, 6.97638732e-01, 7.14285714e-02], + [ 3.34746187e-01, 7.63144439e-01, 7.14285714e-02], + [ 7.39770978e-01, 1.23445943e-01, 7.14285714e-02], + [ 7.50000000e-01, 1.21936714e-16, 7.14285714e-02], + [ 7.09362931e-01, 2.43524602e-01, 7.14285714e-02], + [ 6.59605313e-01, 3.56960545e-01, 7.14285714e-02], + [ 5.91855382e-01, 4.60659535e-01, 7.14285714e-02], + [ 5.07961179e-01, 5.51792933e-01, 7.14285714e-02], + [ 4.10211119e-01, 6.27874859e-01, 7.14285714e-02], + [ 3.01271568e-01, 6.86829995e-01, 7.14285714e-02], + [ 6.57574202e-01, 1.09729727e-01, 7.14285714e-02], + [ 6.66666667e-01, 1.12895794e-16, 7.14285714e-02], + [ 6.30544828e-01, 2.16466313e-01, 7.14285714e-02], + [ 5.86315834e-01, 3.17298262e-01, 7.14285714e-02], + [ 5.26093673e-01, 4.09475142e-01, 7.14285714e-02], + [ 4.51521048e-01, 4.90482607e-01, 7.14285714e-02], + [ 3.64632105e-01, 5.58110986e-01, 7.14285714e-02], + [ 2.67796950e-01, 6.10515551e-01, 7.14285714e-02], + [ 5.75377427e-01, 9.60135110e-02, 7.14285714e-02], + [ 5.83333333e-01, 9.97185006e-17, 7.14285714e-02], + [ 5.51726724e-01, 1.89408024e-01, 7.14285714e-02], + [ 5.13026355e-01, 2.77635979e-01, 7.14285714e-02], + [ 4.60331964e-01, 3.58290749e-01, 7.14285714e-02], + [ 3.95080917e-01, 4.29172281e-01, 7.14285714e-02], + [ 3.19053092e-01, 4.88347112e-01, 7.14285714e-02], + [ 2.34322331e-01, 5.34201107e-01, 7.14285714e-02], + [ 4.93180652e-01, 8.22972951e-02, 7.14285714e-02], + [ 5.00000000e-01, 8.46578841e-17, 7.14285714e-02], + [ 4.72908621e-01, 1.62349735e-01, 7.14285714e-02], + [ 4.39736876e-01, 2.37973697e-01, 7.14285714e-02], + [ 3.94570255e-01, 3.07106356e-01, 7.14285714e-02], + [ 3.38640786e-01, 3.67861955e-01, 7.14285714e-02], + [ 2.73474079e-01, 4.18583239e-01, 7.14285714e-02], + [ 2.00847712e-01, 4.57886663e-01, 7.14285714e-02], + [ 2.92606991e-01, 3.16445261e-01, 7.14285714e-02], + [ 3.44188184e-01, 2.67935253e-01, 7.14285714e-02], + [ 2.34867640e-01, 3.58265725e-01, 7.14285714e-02], + [ 1.72155182e-01, 3.92474283e-01, 7.14285714e-02], + [ 2.46573197e-01, 2.65028567e-01, 7.14285714e-02], + [ 2.93806114e-01, 2.28764151e-01, 7.14285714e-02], + [ 1.96261201e-01, 2.97948211e-01, 7.14285714e-02], + [ 1.43462652e-01, 3.27061902e-01, 7.14285714e-02], + [ 2.00539403e-01, 2.13611872e-01, 7.14285714e-02], + [ 2.43424043e-01, 1.89593048e-01, 7.14285714e-02], + [ 1.57654762e-01, 2.37630697e-01, 7.14285714e-02], + [ 1.14770121e-01, 2.61649522e-01, 7.14285714e-02], + [ 8.60775910e-02, 1.96237141e-01, 7.14285714e-02], + [ 1.39074405e-01, 1.78223023e-01, 7.14285714e-02], + [ 5.73850607e-02, 1.30824761e-01, 7.14285714e-02], + [ 1.20494048e-01, 1.18815349e-01, 7.14285714e-02], + [ 2.86925303e-02, 6.54123805e-02, 7.14285714e-02], + [ 1.01913690e-01, 5.94076743e-02, 7.14285714e-02], + [ -1.35647550e-17, -1.43830177e-17, 7.14285714e-02], + [ 8.33333333e-02, 1.98768323e-18, 7.14285714e-02], + [ 1.92071219e-01, 1.60208904e-01, 7.14285714e-02], + [ 1.83603035e-01, 1.06805936e-01, 7.14285714e-02], + [ 1.75134851e-01, 5.34029681e-02, 7.14285714e-02], + [ 1.66666667e-01, 1.85787325e-17, 7.14285714e-02], + [ 2.45068032e-01, 1.42194786e-01, 7.14285714e-02], + [ 2.46712022e-01, 9.47965238e-02, 7.14285714e-02], + [ 2.48356011e-01, 4.73982619e-02, 7.14285714e-02], + [ 2.50000000e-01, 3.53119596e-17, 7.14285714e-02], + [ 3.33333333e-01, 5.20568343e-17, 7.14285714e-02], + [ 3.29964224e-01, 5.90312730e-02, 7.14285714e-02], + [ 4.16666667e-01, 6.86087031e-17, 7.14285714e-02], + [ 4.11572438e-01, 7.06642841e-02, 7.14285714e-02], + [ 3.22110888e-01, 1.17314261e-01, 7.14285714e-02], + [ 3.97509754e-01, 1.39831998e-01, 7.14285714e-02], + [ 3.09957647e-01, 1.74121089e-01, 7.14285714e-02], + [ 3.74847261e-01, 2.06047393e-01, 7.14285714e-02], + [ 2.45485487e-01, 9.69400266e-01, 7.14285714e-02], + [ 2.25028363e-01, 8.88616910e-01, 7.14285714e-02], + [ 8.25793455e-02, 9.96584493e-01, 7.14285714e-02], + [ 7.56977333e-02, 9.13535785e-01, 7.14285714e-02], + [ -8.25793455e-02, 9.96584493e-01, 7.14285714e-02], + [ -7.56977333e-02, 9.13535785e-01, 7.14285714e-02], + [ -2.45485487e-01, 9.69400266e-01, 7.14285714e-02], + [ -2.25028363e-01, 8.88616910e-01, 7.14285714e-02], + [ -4.01695425e-01, 9.15773327e-01, 7.14285714e-02], + [ -3.68220806e-01, 8.39458883e-01, 7.14285714e-02], + [ -5.46948158e-01, 8.37166478e-01, 7.14285714e-02], + [ -5.01369145e-01, 7.67402605e-01, 7.14285714e-02], + [ -6.77281572e-01, 7.35723911e-01, 7.14285714e-02], + [ -6.20841441e-01, 6.74413585e-01, 7.14285714e-02], + [ 2.04571239e-01, 8.07833555e-01, 7.14285714e-02], + [ 6.88161212e-02, 8.30487078e-01, 7.14285714e-02], + [ -6.88161212e-02, 8.30487078e-01, 7.14285714e-02], + [ -2.04571239e-01, 8.07833555e-01, 7.14285714e-02], + [ -3.34746187e-01, 7.63144439e-01, 7.14285714e-02], + [ -4.55790132e-01, 6.97638732e-01, 7.14285714e-02], + [ -5.64401310e-01, 6.13103259e-01, 7.14285714e-02], + [ 1.84114115e-01, 7.27050199e-01, 7.14285714e-02], + [ 6.19345091e-02, 7.47438370e-01, 7.14285714e-02], + [ -6.19345091e-02, 7.47438370e-01, 7.14285714e-02], + [ -1.84114115e-01, 7.27050199e-01, 7.14285714e-02], + [ -3.01271568e-01, 6.86829995e-01, 7.14285714e-02], + [ -4.10211119e-01, 6.27874859e-01, 7.14285714e-02], + [ -5.07961179e-01, 5.51792933e-01, 7.14285714e-02], + [ 1.63656991e-01, 6.46266844e-01, 7.14285714e-02], + [ 5.50528970e-02, 6.64389662e-01, 7.14285714e-02], + [ -5.50528970e-02, 6.64389662e-01, 7.14285714e-02], + [ -1.63656991e-01, 6.46266844e-01, 7.14285714e-02], + [ -2.67796950e-01, 6.10515551e-01, 7.14285714e-02], + [ -3.64632105e-01, 5.58110986e-01, 7.14285714e-02], + [ -4.51521048e-01, 4.90482607e-01, 7.14285714e-02], + [ 1.43199867e-01, 5.65483488e-01, 7.14285714e-02], + [ 4.81712849e-02, 5.81340954e-01, 7.14285714e-02], + [ -4.81712849e-02, 5.81340954e-01, 7.14285714e-02], + [ -1.43199867e-01, 5.65483488e-01, 7.14285714e-02], + [ -2.34322331e-01, 5.34201107e-01, 7.14285714e-02], + [ -3.19053092e-01, 4.88347112e-01, 7.14285714e-02], + [ -3.95080917e-01, 4.29172281e-01, 7.14285714e-02], + [ 1.22742744e-01, 4.84700133e-01, 7.14285714e-02], + [ 4.12896727e-02, 4.98292247e-01, 7.14285714e-02], + [ -4.12896727e-02, 4.98292247e-01, 7.14285714e-02], + [ -1.22742744e-01, 4.84700133e-01, 7.14285714e-02], + [ -2.00847712e-01, 4.57886663e-01, 7.14285714e-02], + [ -2.73474079e-01, 4.18583239e-01, 7.14285714e-02], + [ -3.38640786e-01, 3.67861955e-01, 7.14285714e-02], + [ -1.02283149e-01, 4.15336195e-01, 7.14285714e-02], + [ -3.59859419e-02, 4.34695086e-01, 7.14285714e-02], + [ -1.66348287e-01, 3.87163066e-01, 7.14285714e-02], + [ -2.26761024e-01, 3.50663301e-01, 7.14285714e-02], + [ -2.82200655e-01, 3.06551629e-01, 7.14285714e-02], + [ -8.18235534e-02, 3.45972257e-01, 7.14285714e-02], + [ -3.06822110e-02, 3.71097926e-01, 7.14285714e-02], + [ -1.31848862e-01, 3.16439469e-01, 7.14285714e-02], + [ -1.80047970e-01, 2.82743363e-01, 7.14285714e-02], + [ -2.25760524e-01, 2.45241304e-01, 7.14285714e-02], + [ -6.13639584e-02, 2.76608319e-01, 7.14285714e-02], + [ -2.53784802e-02, 3.07500766e-01, 7.14285714e-02], + [ -9.73494365e-02, 2.45715872e-01, 7.14285714e-02], + [ -1.33334915e-01, 2.14823425e-01, 7.14285714e-02], + [ -1.69320393e-01, 1.83930978e-01, 7.14285714e-02], + [ -1.12880262e-01, 1.22620652e-01, 7.14285714e-02], + [ -7.93257664e-02, 1.65019743e-01, 7.14285714e-02], + [ -5.64401310e-02, 6.13103259e-02, 7.14285714e-02], + [ -2.53166180e-02, 1.15216062e-01, 7.14285714e-02], + [ -4.57712708e-02, 2.07418835e-01, 7.14285714e-02], + [ 5.80689493e-03, 1.69121798e-01, 7.14285714e-02], + [ -1.22167752e-02, 2.49817927e-01, 7.14285714e-02], + [ 3.69304079e-02, 2.23027534e-01, 7.14285714e-02], + [ 2.13377203e-02, 2.92217018e-01, 7.14285714e-02], + [ 6.80539208e-02, 2.76933270e-01, 7.14285714e-02], + [ 8.62835284e-02, 3.46188891e-01, 7.14285714e-02], + [ 1.04513136e-01, 4.15444512e-01, 7.14285714e-02], + [ 2.79883711e-02, 3.60908761e-01, 7.14285714e-02], + [ 3.46390219e-02, 4.29600504e-01, 7.14285714e-02], + [ -7.89140509e-01, 6.14212713e-01, 7.14285714e-02], + [ -7.23378800e-01, 5.63028320e-01, 7.14285714e-02], + [ -8.79473751e-01, 4.75947393e-01, 7.14285714e-02], + [ -8.06184272e-01, 4.36285110e-01, 7.14285714e-02], + [ -9.45817242e-01, 3.24699469e-01, 7.14285714e-02], + [ -8.66999138e-01, 2.97641180e-01, 7.14285714e-02], + [ -9.86361303e-01, 1.64594590e-01, 7.14285714e-02], + [ -9.04164528e-01, 1.50878374e-01, 7.14285714e-02], + [ -1.00000000e+00, 1.74949543e-17, 7.14285714e-02], + [ -9.16666667e-01, 3.57545599e-17, 7.14285714e-02], + [ -9.86361303e-01, -1.64594590e-01, 7.14285714e-02], + [ -9.04164528e-01, -1.50878374e-01, 7.14285714e-02], + [ -6.57617091e-01, 5.11843927e-01, 7.14285714e-02], + [ -7.32894793e-01, 3.96622828e-01, 7.14285714e-02], + [ -7.88181035e-01, 2.70582891e-01, 7.14285714e-02], + [ -8.21967753e-01, 1.37162159e-01, 7.14285714e-02], + [ -8.33333333e-01, 3.09851013e-17, 7.14285714e-02], + [ -8.21967753e-01, -1.37162159e-01, 7.14285714e-02], + [ -5.91855382e-01, 4.60659535e-01, 7.14285714e-02], + [ -6.59605313e-01, 3.56960545e-01, 7.14285714e-02], + [ -7.09362931e-01, 2.43524602e-01, 7.14285714e-02], + [ -7.39770978e-01, 1.23445943e-01, 7.14285714e-02], + [ -7.50000000e-01, 2.55581870e-17, 7.14285714e-02], + [ -7.39770978e-01, -1.23445943e-01, 7.14285714e-02], + [ -5.26093673e-01, 4.09475142e-01, 7.14285714e-02], + [ -5.86315834e-01, 3.17298262e-01, 7.14285714e-02], + [ -6.30544828e-01, 2.16466313e-01, 7.14285714e-02], + [ -6.57574202e-01, 1.09729727e-01, 7.14285714e-02], + [ -6.66666667e-01, 1.99595799e-17, 7.14285714e-02], + [ -6.57574202e-01, -1.09729727e-01, 7.14285714e-02], + [ -4.60331964e-01, 3.58290749e-01, 7.14285714e-02], + [ -5.13026355e-01, 2.77635979e-01, 7.14285714e-02], + [ -5.51726724e-01, 1.89408024e-01, 7.14285714e-02], + [ -5.75377427e-01, 9.60135110e-02, 7.14285714e-02], + [ -5.83333333e-01, 1.44716353e-17, 7.14285714e-02], + [ -5.75377427e-01, -9.60135110e-02, 7.14285714e-02], + [ -3.94570255e-01, 3.07106356e-01, 7.14285714e-02], + [ -4.39736876e-01, 2.37973697e-01, 7.14285714e-02], + [ -4.72908621e-01, 1.62349735e-01, 7.14285714e-02], + [ -4.93180652e-01, 8.22972951e-02, 7.14285714e-02], + [ -5.00000000e-01, 9.25854954e-18, 7.14285714e-02], + [ -4.93180652e-01, -8.22972951e-02, 7.14285714e-02], + [ -4.20156583e-01, 7.22539112e-02, 7.14285714e-02], + [ -4.11228248e-01, 1.41174836e-01, 7.14285714e-02], + [ -4.20116462e-01, 1.83641595e-03, 7.14285714e-02], + [ -4.10983876e-01, -6.85810793e-02, 7.14285714e-02], + [ -3.47132513e-01, 6.22105272e-02, 7.14285714e-02], + [ -3.49547876e-01, 1.19999937e-01, 7.14285714e-02], + [ -3.40232923e-01, 3.67283191e-03, 7.14285714e-02], + [ -3.28787101e-01, -5.48648634e-02, 7.14285714e-02], + [ -2.74108444e-01, 5.21671433e-02, 7.14285714e-02], + [ -2.87867503e-01, 9.88250387e-02, 7.14285714e-02], + [ -2.60349385e-01, 5.50924786e-03, 7.14285714e-02], + [ -2.46590326e-01, -4.11486476e-02, 7.14285714e-02], + [ -1.64393551e-01, -2.74324317e-02, 7.14285714e-02], + [ -1.92379634e-01, 2.41096072e-02, 7.14285714e-02], + [ -8.21967753e-02, -1.37162159e-02, 7.14285714e-02], + [ -1.24409882e-01, 4.27099665e-02, 7.14285714e-02], + [ -2.20365717e-01, 7.56516461e-02, 7.14285714e-02], + [ -1.66622989e-01, 9.91361489e-02, 7.14285714e-02], + [ -2.48351800e-01, 1.27193685e-01, 7.14285714e-02], + [ -2.08836096e-01, 1.55562331e-01, 7.14285714e-02], + [ -2.70747482e-01, 2.06077006e-01, 7.14285714e-02], + [ -3.32658869e-01, 2.56591681e-01, 7.14285714e-02], + [ -3.12146825e-01, 1.64120356e-01, 7.14285714e-02], + [ -3.75941850e-01, 2.01047026e-01, 7.14285714e-02], + [ -9.45817242e-01, -3.24699469e-01, 7.14285714e-02], + [ -8.66999138e-01, -2.97641180e-01, 7.14285714e-02], + [ -8.79473751e-01, -4.75947393e-01, 7.14285714e-02], + [ -8.06184272e-01, -4.36285110e-01, 7.14285714e-02], + [ -7.89140509e-01, -6.14212713e-01, 7.14285714e-02], + [ -7.23378800e-01, -5.63028320e-01, 7.14285714e-02], + [ -6.77281572e-01, -7.35723911e-01, 7.14285714e-02], + [ -6.20841441e-01, -6.74413585e-01, 7.14285714e-02], + [ -5.46948158e-01, -8.37166478e-01, 7.14285714e-02], + [ -5.01369145e-01, -7.67402605e-01, 7.14285714e-02], + [ -4.01695425e-01, -9.15773327e-01, 7.14285714e-02], + [ -3.68220806e-01, -8.39458883e-01, 7.14285714e-02], + [ -7.88181035e-01, -2.70582891e-01, 7.14285714e-02], + [ -7.32894793e-01, -3.96622828e-01, 7.14285714e-02], + [ -6.57617091e-01, -5.11843927e-01, 7.14285714e-02], + [ -5.64401310e-01, -6.13103259e-01, 7.14285714e-02], + [ -4.55790132e-01, -6.97638732e-01, 7.14285714e-02], + [ -3.34746187e-01, -7.63144439e-01, 7.14285714e-02], + [ -7.09362931e-01, -2.43524602e-01, 7.14285714e-02], + [ -6.59605313e-01, -3.56960545e-01, 7.14285714e-02], + [ -5.91855382e-01, -4.60659535e-01, 7.14285714e-02], + [ -5.07961179e-01, -5.51792933e-01, 7.14285714e-02], + [ -4.10211119e-01, -6.27874859e-01, 7.14285714e-02], + [ -3.01271568e-01, -6.86829995e-01, 7.14285714e-02], + [ -6.30544828e-01, -2.16466313e-01, 7.14285714e-02], + [ -5.86315834e-01, -3.17298262e-01, 7.14285714e-02], + [ -5.26093673e-01, -4.09475142e-01, 7.14285714e-02], + [ -4.51521048e-01, -4.90482607e-01, 7.14285714e-02], + [ -3.64632105e-01, -5.58110986e-01, 7.14285714e-02], + [ -2.67796950e-01, -6.10515551e-01, 7.14285714e-02], + [ -5.51726724e-01, -1.89408024e-01, 7.14285714e-02], + [ -5.13026355e-01, -2.77635979e-01, 7.14285714e-02], + [ -4.60331964e-01, -3.58290749e-01, 7.14285714e-02], + [ -3.95080917e-01, -4.29172281e-01, 7.14285714e-02], + [ -3.19053092e-01, -4.88347112e-01, 7.14285714e-02], + [ -2.34322331e-01, -5.34201107e-01, 7.14285714e-02], + [ -4.72908621e-01, -1.62349735e-01, 7.14285714e-02], + [ -4.39736876e-01, -2.37973697e-01, 7.14285714e-02], + [ -3.94570255e-01, -3.07106356e-01, 7.14285714e-02], + [ -3.38640786e-01, -3.67861955e-01, 7.14285714e-02], + [ -2.73474079e-01, -4.18583239e-01, 7.14285714e-02], + [ -2.00847712e-01, -4.57886663e-01, 7.14285714e-02], + [ -2.90292421e-01, -3.12221863e-01, 7.14285714e-02], + [ -3.43107373e-01, -2.67051188e-01, 7.14285714e-02], + [ -2.31319311e-01, -3.50702994e-01, 7.14285714e-02], + [ -1.67373094e-01, -3.81572219e-01, 7.14285714e-02], + [ -2.41944057e-01, -2.56581770e-01, 7.14285714e-02], + [ -2.91644492e-01, -2.26996019e-01, 7.14285714e-02], + [ -1.89164543e-01, -2.82822750e-01, 7.14285714e-02], + [ -1.33898475e-01, -3.05257776e-01, 7.14285714e-02], + [ -1.93595692e-01, -2.00941678e-01, 7.14285714e-02], + [ -2.40181610e-01, -1.86940851e-01, 7.14285714e-02], + [ -1.47009774e-01, -2.14942505e-01, 7.14285714e-02], + [ -1.00423856e-01, -2.28943332e-01, 7.14285714e-02], + [ -6.69492374e-02, -1.52628888e-01, 7.14285714e-02], + [ -1.25405441e-01, -1.47867075e-01, 7.14285714e-02], + [ -3.34746187e-02, -7.63144439e-02, 7.14285714e-02], + [ -1.03801108e-01, -8.07916455e-02, 7.14285714e-02], + [ -1.83861645e-01, -1.43105263e-01, 7.14285714e-02], + [ -1.74127598e-01, -8.52688471e-02, 7.14285714e-02], + [ -2.42317849e-01, -1.38343450e-01, 7.14285714e-02], + [ -2.44454087e-01, -8.97460487e-02, 7.14285714e-02], + [ -3.20605599e-01, -1.13947277e-01, 7.14285714e-02], + [ -3.96757110e-01, -1.38148506e-01, 7.14285714e-02], + [ -3.08124191e-01, -1.71553532e-01, 7.14285714e-02], + [ -3.73930533e-01, -2.04763614e-01, 7.14285714e-02], + [ -2.45485487e-01, -9.69400266e-01, 7.14285714e-02], + [ -2.25028363e-01, -8.88616910e-01, 7.14285714e-02], + [ -8.25793455e-02, -9.96584493e-01, 7.14285714e-02], + [ -7.56977333e-02, -9.13535785e-01, 7.14285714e-02], + [ 8.25793455e-02, -9.96584493e-01, 7.14285714e-02], + [ 7.56977333e-02, -9.13535785e-01, 7.14285714e-02], + [ 2.45485487e-01, -9.69400266e-01, 7.14285714e-02], + [ 2.25028363e-01, -8.88616910e-01, 7.14285714e-02], + [ 4.01695425e-01, -9.15773327e-01, 7.14285714e-02], + [ 3.68220806e-01, -8.39458883e-01, 7.14285714e-02], + [ 5.46948158e-01, -8.37166478e-01, 7.14285714e-02], + [ 5.01369145e-01, -7.67402605e-01, 7.14285714e-02], + [ -2.04571239e-01, -8.07833555e-01, 7.14285714e-02], + [ -6.88161212e-02, -8.30487078e-01, 7.14285714e-02], + [ 6.88161212e-02, -8.30487078e-01, 7.14285714e-02], + [ 2.04571239e-01, -8.07833555e-01, 7.14285714e-02], + [ 3.34746187e-01, -7.63144439e-01, 7.14285714e-02], + [ 4.55790132e-01, -6.97638732e-01, 7.14285714e-02], + [ -1.84114115e-01, -7.27050199e-01, 7.14285714e-02], + [ -6.19345091e-02, -7.47438370e-01, 7.14285714e-02], + [ 6.19345091e-02, -7.47438370e-01, 7.14285714e-02], + [ 1.84114115e-01, -7.27050199e-01, 7.14285714e-02], + [ 3.01271568e-01, -6.86829995e-01, 7.14285714e-02], + [ 4.10211119e-01, -6.27874859e-01, 7.14285714e-02], + [ -1.63656991e-01, -6.46266844e-01, 7.14285714e-02], + [ -5.50528970e-02, -6.64389662e-01, 7.14285714e-02], + [ 5.50528970e-02, -6.64389662e-01, 7.14285714e-02], + [ 1.63656991e-01, -6.46266844e-01, 7.14285714e-02], + [ 2.67796950e-01, -6.10515551e-01, 7.14285714e-02], + [ 3.64632105e-01, -5.58110986e-01, 7.14285714e-02], + [ -1.43199867e-01, -5.65483488e-01, 7.14285714e-02], + [ -4.81712849e-02, -5.81340954e-01, 7.14285714e-02], + [ 4.81712849e-02, -5.81340954e-01, 7.14285714e-02], + [ 1.43199867e-01, -5.65483488e-01, 7.14285714e-02], + [ 2.34322331e-01, -5.34201107e-01, 7.14285714e-02], + [ 3.19053092e-01, -4.88347112e-01, 7.14285714e-02], + [ -1.22742744e-01, -4.84700133e-01, 7.14285714e-02], + [ -4.12896727e-02, -4.98292247e-01, 7.14285714e-02], + [ 4.12896727e-02, -4.98292247e-01, 7.14285714e-02], + [ 1.22742744e-01, -4.84700133e-01, 7.14285714e-02], + [ 2.00847712e-01, -4.57886663e-01, 7.14285714e-02], + [ 2.73474079e-01, -4.18583239e-01, 7.14285714e-02], + [ 1.02606772e-01, -4.13792257e-01, 7.14285714e-02], + [ 3.59043567e-02, -4.33301147e-01, 7.14285714e-02], + [ 1.67077120e-01, -3.85469130e-01, 7.14285714e-02], + [ 2.27895066e-01, -3.48819366e-01, 7.14285714e-02], + [ 8.24708009e-02, -3.42884381e-01, 7.14285714e-02], + [ 3.05190406e-02, -3.68310047e-01, 7.14285714e-02], + [ 1.33306527e-01, -3.13051596e-01, 7.14285714e-02], + [ 1.82316053e-01, -2.79055493e-01, 7.14285714e-02], + [ 6.23348295e-02, -2.71976505e-01, 7.14285714e-02], + [ 2.51337245e-02, -3.03318947e-01, 7.14285714e-02], + [ 9.95359345e-02, -2.40634062e-01, 7.14285714e-02], + [ 1.36737040e-01, -2.09291620e-01, 7.14285714e-02], + [ 9.11580264e-02, -1.39527746e-01, 7.14285714e-02], + [ 5.51990834e-02, -1.85860856e-01, 7.14285714e-02], + [ 4.55790132e-02, -6.97638732e-02, 7.14285714e-02], + [ 1.08622324e-02, -1.31087650e-01, 7.14285714e-02], + [ 1.92401405e-02, -2.32193966e-01, 7.14285714e-02], + [ -2.38545485e-02, -1.92411427e-01, 7.14285714e-02], + [ -1.67188024e-02, -2.78527075e-01, 7.14285714e-02], + [ -5.85713293e-02, -2.53735203e-01, 7.14285714e-02], + [ -7.99618007e-02, -3.30723513e-01, 7.14285714e-02], + [ -1.01352272e-01, -4.07711823e-01, 7.14285714e-02], + [ -2.49090925e-02, -3.51782132e-01, 7.14285714e-02], + [ -3.30993826e-02, -4.25037189e-01, 7.14285714e-02], + [ 6.77281572e-01, -7.35723911e-01, 7.14285714e-02], + [ 6.20841441e-01, -6.74413585e-01, 7.14285714e-02], + [ 7.89140509e-01, -6.14212713e-01, 7.14285714e-02], + [ 7.23378800e-01, -5.63028320e-01, 7.14285714e-02], + [ 8.79473751e-01, -4.75947393e-01, 7.14285714e-02], + [ 8.06184272e-01, -4.36285110e-01, 7.14285714e-02], + [ 9.45817242e-01, -3.24699469e-01, 7.14285714e-02], + [ 8.66999138e-01, -2.97641180e-01, 7.14285714e-02], + [ 9.86361303e-01, -1.64594590e-01, 7.14285714e-02], + [ 9.04164528e-01, -1.50878374e-01, 7.14285714e-02], + [ 5.64401310e-01, -6.13103259e-01, 7.14285714e-02], + [ 6.57617091e-01, -5.11843927e-01, 7.14285714e-02], + [ 7.32894793e-01, -3.96622828e-01, 7.14285714e-02], + [ 7.88181035e-01, -2.70582891e-01, 7.14285714e-02], + [ 8.21967753e-01, -1.37162159e-01, 7.14285714e-02], + [ 5.07961179e-01, -5.51792933e-01, 7.14285714e-02], + [ 5.91855382e-01, -4.60659535e-01, 7.14285714e-02], + [ 6.59605313e-01, -3.56960545e-01, 7.14285714e-02], + [ 7.09362931e-01, -2.43524602e-01, 7.14285714e-02], + [ 7.39770978e-01, -1.23445943e-01, 7.14285714e-02], + [ 4.51521048e-01, -4.90482607e-01, 7.14285714e-02], + [ 5.26093673e-01, -4.09475142e-01, 7.14285714e-02], + [ 5.86315834e-01, -3.17298262e-01, 7.14285714e-02], + [ 6.30544828e-01, -2.16466313e-01, 7.14285714e-02], + [ 6.57574202e-01, -1.09729727e-01, 7.14285714e-02], + [ 3.95080917e-01, -4.29172281e-01, 7.14285714e-02], + [ 4.60331964e-01, -3.58290749e-01, 7.14285714e-02], + [ 5.13026355e-01, -2.77635979e-01, 7.14285714e-02], + [ 5.51726724e-01, -1.89408024e-01, 7.14285714e-02], + [ 5.75377427e-01, -9.60135110e-02, 7.14285714e-02], + [ 3.38640786e-01, -3.67861955e-01, 7.14285714e-02], + [ 3.94570255e-01, -3.07106356e-01, 7.14285714e-02], + [ 4.39736876e-01, -2.37973697e-01, 7.14285714e-02], + [ 4.72908621e-01, -1.62349735e-01, 7.14285714e-02], + [ 4.93180652e-01, -8.22972951e-02, 7.14285714e-02], + [ 4.02533591e-01, -1.40423963e-01, 7.14285714e-02], + [ 3.82383017e-01, -2.06935340e-01, 7.14285714e-02], + [ 4.14084357e-01, -7.09602665e-02, 7.14285714e-02], + [ 3.32158562e-01, -1.18498191e-01, 7.14285714e-02], + [ 3.25029158e-01, -1.75896984e-01, 7.14285714e-02], + [ 3.34988061e-01, -5.96232379e-02, 7.14285714e-02], + [ 2.61783533e-01, -9.65724185e-02, 7.14285714e-02], + [ 2.67675299e-01, -1.44858628e-01, 7.14285714e-02], + [ 2.55891766e-01, -4.82862093e-02, 7.14285714e-02], + [ 1.85787515e-01, -5.54454306e-02, 7.14285714e-02], + [ 1.15683264e-01, -6.26046519e-02, 7.14285714e-02], + [ 2.04908364e-01, -1.10890861e-01, 7.14285714e-02], + [ 1.48033195e-01, -1.25209304e-01, 7.14285714e-02], + [ 2.24029213e-01, -1.66336292e-01, 7.14285714e-02], + [ 1.80383126e-01, -1.87813956e-01, 7.14285714e-02], + [ 2.33135679e-01, -2.47829956e-01, 7.14285714e-02], + [ 2.85888233e-01, -3.07845955e-01, 7.14285714e-02], + [ 2.80876227e-01, -2.13259647e-01, 7.14285714e-02], + [ 3.37723241e-01, -2.60183001e-01, 7.14285714e-02], + [ 1.00000000e+00, 0.00000000e+00, -7.14285714e-02], + [ 9.86361303e-01, 1.64594590e-01, -7.14285714e-02], + [ 9.04164528e-01, 1.50878374e-01, -7.14285714e-02], + [ 9.16666667e-01, 1.66466002e-16, -7.14285714e-02], + [ 9.45817242e-01, 3.24699469e-01, -7.14285714e-02], + [ 8.66999138e-01, 2.97641180e-01, -7.14285714e-02], + [ 8.79473751e-01, 4.75947393e-01, -7.14285714e-02], + [ 8.06184272e-01, 4.36285110e-01, -7.14285714e-02], + [ 7.89140509e-01, 6.14212713e-01, -7.14285714e-02], + [ 7.23378800e-01, 5.63028320e-01, -7.14285714e-02], + [ 6.77281572e-01, 7.35723911e-01, -7.14285714e-02], + [ 6.20841441e-01, 6.74413585e-01, -7.14285714e-02], + [ 5.46948158e-01, 8.37166478e-01, -7.14285714e-02], + [ 5.01369145e-01, 7.67402605e-01, -7.14285714e-02], + [ 4.01695425e-01, 9.15773327e-01, -7.14285714e-02], + [ 3.68220806e-01, 8.39458883e-01, -7.14285714e-02], + [ 8.21967753e-01, 1.37162159e-01, -7.14285714e-02], + [ 8.33333333e-01, 2.29336017e-16, -7.14285714e-02], + [ 7.88181035e-01, 2.70582891e-01, -7.14285714e-02], + [ 7.32894793e-01, 3.96622828e-01, -7.14285714e-02], + [ 6.57617091e-01, 5.11843927e-01, -7.14285714e-02], + [ 5.64401310e-01, 6.13103259e-01, -7.14285714e-02], + [ 4.55790132e-01, 6.97638732e-01, -7.14285714e-02], + [ 3.34746187e-01, 7.63144439e-01, -7.14285714e-02], + [ 7.39770978e-01, 1.23445943e-01, -7.14285714e-02], + [ 7.50000000e-01, 2.30023465e-16, -7.14285714e-02], + [ 7.09362931e-01, 2.43524602e-01, -7.14285714e-02], + [ 6.59605313e-01, 3.56960545e-01, -7.14285714e-02], + [ 5.91855382e-01, 4.60659535e-01, -7.14285714e-02], + [ 5.07961179e-01, 5.51792933e-01, -7.14285714e-02], + [ 4.10211119e-01, 6.27874859e-01, -7.14285714e-02], + [ 3.01271568e-01, 6.86829995e-01, -7.14285714e-02], + [ 6.57574202e-01, 1.09729727e-01, -7.14285714e-02], + [ 6.66666667e-01, 2.14398012e-16, -7.14285714e-02], + [ 6.30544828e-01, 2.16466313e-01, -7.14285714e-02], + [ 5.86315834e-01, 3.17298262e-01, -7.14285714e-02], + [ 5.26093673e-01, 4.09475142e-01, -7.14285714e-02], + [ 4.51521048e-01, 4.90482607e-01, -7.14285714e-02], + [ 3.64632105e-01, 5.58110986e-01, -7.14285714e-02], + [ 2.67796950e-01, 6.10515551e-01, -7.14285714e-02], + [ 5.75377427e-01, 9.60135110e-02, -7.14285714e-02], + [ 5.83333333e-01, 1.93257395e-16, -7.14285714e-02], + [ 5.51726724e-01, 1.89408024e-01, -7.14285714e-02], + [ 5.13026355e-01, 2.77635979e-01, -7.14285714e-02], + [ 4.60331964e-01, 3.58290749e-01, -7.14285714e-02], + [ 3.95080917e-01, 4.29172281e-01, -7.14285714e-02], + [ 3.19053092e-01, 4.88347112e-01, -7.14285714e-02], + [ 2.34322331e-01, 5.34201107e-01, -7.14285714e-02], + [ 4.93180652e-01, 8.22972951e-02, -7.14285714e-02], + [ 5.00000000e-01, 1.69605680e-16, -7.14285714e-02], + [ 4.72908621e-01, 1.62349735e-01, -7.14285714e-02], + [ 4.39736876e-01, 2.37973697e-01, -7.14285714e-02], + [ 3.94570255e-01, 3.07106356e-01, -7.14285714e-02], + [ 3.38640786e-01, 3.67861955e-01, -7.14285714e-02], + [ 2.73474079e-01, 4.18583239e-01, -7.14285714e-02], + [ 2.00847712e-01, 4.57886663e-01, -7.14285714e-02], + [ 2.92606991e-01, 3.16445261e-01, -7.14285714e-02], + [ 3.44188184e-01, 2.67935253e-01, -7.14285714e-02], + [ 2.34867640e-01, 3.58265725e-01, -7.14285714e-02], + [ 1.72155182e-01, 3.92474283e-01, -7.14285714e-02], + [ 2.46573197e-01, 2.65028567e-01, -7.14285714e-02], + [ 2.93806114e-01, 2.28764151e-01, -7.14285714e-02], + [ 1.96261201e-01, 2.97948211e-01, -7.14285714e-02], + [ 1.43462652e-01, 3.27061902e-01, -7.14285714e-02], + [ 2.00539403e-01, 2.13611872e-01, -7.14285714e-02], + [ 2.43424043e-01, 1.89593048e-01, -7.14285714e-02], + [ 1.57654762e-01, 2.37630697e-01, -7.14285714e-02], + [ 1.14770121e-01, 2.61649522e-01, -7.14285714e-02], + [ 8.60775910e-02, 1.96237141e-01, -7.14285714e-02], + [ 1.39074405e-01, 1.78223023e-01, -7.14285714e-02], + [ 5.73850607e-02, 1.30824761e-01, -7.14285714e-02], + [ 1.20494048e-01, 1.18815349e-01, -7.14285714e-02], + [ 2.86925303e-02, 6.54123805e-02, -7.14285714e-02], + [ 1.01913690e-01, 5.94076743e-02, -7.14285714e-02], + [ -7.26236114e-17, 1.61257875e-17, -7.14285714e-02], + [ 8.33333333e-02, 4.15242815e-17, -7.14285714e-02], + [ 1.92071219e-01, 1.60208904e-01, -7.14285714e-02], + [ 1.83603035e-01, 1.06805936e-01, -7.14285714e-02], + [ 1.75134851e-01, 5.34029681e-02, -7.14285714e-02], + [ 1.66666667e-01, 6.72165733e-17, -7.14285714e-02], + [ 2.45068032e-01, 1.42194786e-01, -7.14285714e-02], + [ 2.46712022e-01, 9.47965238e-02, -7.14285714e-02], + [ 2.48356011e-01, 4.73982619e-02, -7.14285714e-02], + [ 2.50000000e-01, 9.30984356e-17, -7.14285714e-02], + [ 3.33333333e-01, 1.18995828e-16, -7.14285714e-02], + [ 3.29964224e-01, 5.90312730e-02, -7.14285714e-02], + [ 4.16666667e-01, 1.44635879e-16, -7.14285714e-02], + [ 4.11572438e-01, 7.06642841e-02, -7.14285714e-02], + [ 3.22110888e-01, 1.17314261e-01, -7.14285714e-02], + [ 3.97509754e-01, 1.39831998e-01, -7.14285714e-02], + [ 3.09957647e-01, 1.74121089e-01, -7.14285714e-02], + [ 3.74847261e-01, 2.06047393e-01, -7.14285714e-02], + [ 2.45485487e-01, 9.69400266e-01, -7.14285714e-02], + [ 2.25028363e-01, 8.88616910e-01, -7.14285714e-02], + [ 8.25793455e-02, 9.96584493e-01, -7.14285714e-02], + [ 7.56977333e-02, 9.13535785e-01, -7.14285714e-02], + [ -8.25793455e-02, 9.96584493e-01, -7.14285714e-02], + [ -7.56977333e-02, 9.13535785e-01, -7.14285714e-02], + [ -2.45485487e-01, 9.69400266e-01, -7.14285714e-02], + [ -2.25028363e-01, 8.88616910e-01, -7.14285714e-02], + [ -4.01695425e-01, 9.15773327e-01, -7.14285714e-02], + [ -3.68220806e-01, 8.39458883e-01, -7.14285714e-02], + [ -5.46948158e-01, 8.37166478e-01, -7.14285714e-02], + [ -5.01369145e-01, 7.67402605e-01, -7.14285714e-02], + [ -6.77281572e-01, 7.35723911e-01, -7.14285714e-02], + [ -6.20841441e-01, 6.74413585e-01, -7.14285714e-02], + [ 2.04571239e-01, 8.07833555e-01, -7.14285714e-02], + [ 6.88161212e-02, 8.30487078e-01, -7.14285714e-02], + [ -6.88161212e-02, 8.30487078e-01, -7.14285714e-02], + [ -2.04571239e-01, 8.07833555e-01, -7.14285714e-02], + [ -3.34746187e-01, 7.63144439e-01, -7.14285714e-02], + [ -4.55790132e-01, 6.97638732e-01, -7.14285714e-02], + [ -5.64401310e-01, 6.13103259e-01, -7.14285714e-02], + [ 1.84114115e-01, 7.27050199e-01, -7.14285714e-02], + [ 6.19345091e-02, 7.47438370e-01, -7.14285714e-02], + [ -6.19345091e-02, 7.47438370e-01, -7.14285714e-02], + [ -1.84114115e-01, 7.27050199e-01, -7.14285714e-02], + [ -3.01271568e-01, 6.86829995e-01, -7.14285714e-02], + [ -4.10211119e-01, 6.27874859e-01, -7.14285714e-02], + [ -5.07961179e-01, 5.51792933e-01, -7.14285714e-02], + [ 1.63656991e-01, 6.46266844e-01, -7.14285714e-02], + [ 5.50528970e-02, 6.64389662e-01, -7.14285714e-02], + [ -5.50528970e-02, 6.64389662e-01, -7.14285714e-02], + [ -1.63656991e-01, 6.46266844e-01, -7.14285714e-02], + [ -2.67796950e-01, 6.10515551e-01, -7.14285714e-02], + [ -3.64632105e-01, 5.58110986e-01, -7.14285714e-02], + [ -4.51521048e-01, 4.90482607e-01, -7.14285714e-02], + [ 1.43199867e-01, 5.65483488e-01, -7.14285714e-02], + [ 4.81712849e-02, 5.81340954e-01, -7.14285714e-02], + [ -4.81712849e-02, 5.81340954e-01, -7.14285714e-02], + [ -1.43199867e-01, 5.65483488e-01, -7.14285714e-02], + [ -2.34322331e-01, 5.34201107e-01, -7.14285714e-02], + [ -3.19053092e-01, 4.88347112e-01, -7.14285714e-02], + [ -3.95080917e-01, 4.29172281e-01, -7.14285714e-02], + [ 1.22742744e-01, 4.84700133e-01, -7.14285714e-02], + [ 4.12896727e-02, 4.98292247e-01, -7.14285714e-02], + [ -4.12896727e-02, 4.98292247e-01, -7.14285714e-02], + [ -1.22742744e-01, 4.84700133e-01, -7.14285714e-02], + [ -2.00847712e-01, 4.57886663e-01, -7.14285714e-02], + [ -2.73474079e-01, 4.18583239e-01, -7.14285714e-02], + [ -3.38640786e-01, 3.67861955e-01, -7.14285714e-02], + [ -1.02283149e-01, 4.15336195e-01, -7.14285714e-02], + [ -3.59859419e-02, 4.34695086e-01, -7.14285714e-02], + [ -1.66348287e-01, 3.87163066e-01, -7.14285714e-02], + [ -2.26761024e-01, 3.50663301e-01, -7.14285714e-02], + [ -2.82200655e-01, 3.06551629e-01, -7.14285714e-02], + [ -8.18235534e-02, 3.45972257e-01, -7.14285714e-02], + [ -3.06822110e-02, 3.71097926e-01, -7.14285714e-02], + [ -1.31848862e-01, 3.16439469e-01, -7.14285714e-02], + [ -1.80047970e-01, 2.82743363e-01, -7.14285714e-02], + [ -2.25760524e-01, 2.45241304e-01, -7.14285714e-02], + [ -6.13639584e-02, 2.76608319e-01, -7.14285714e-02], + [ -2.53784802e-02, 3.07500766e-01, -7.14285714e-02], + [ -9.73494365e-02, 2.45715872e-01, -7.14285714e-02], + [ -1.33334915e-01, 2.14823425e-01, -7.14285714e-02], + [ -1.69320393e-01, 1.83930978e-01, -7.14285714e-02], + [ -1.12880262e-01, 1.22620652e-01, -7.14285714e-02], + [ -7.93257664e-02, 1.65019743e-01, -7.14285714e-02], + [ -5.64401310e-02, 6.13103259e-02, -7.14285714e-02], + [ -2.53166180e-02, 1.15216062e-01, -7.14285714e-02], + [ -4.57712708e-02, 2.07418835e-01, -7.14285714e-02], + [ 5.80689493e-03, 1.69121798e-01, -7.14285714e-02], + [ -1.22167752e-02, 2.49817927e-01, -7.14285714e-02], + [ 3.69304079e-02, 2.23027534e-01, -7.14285714e-02], + [ 2.13377203e-02, 2.92217018e-01, -7.14285714e-02], + [ 6.80539208e-02, 2.76933270e-01, -7.14285714e-02], + [ 8.62835284e-02, 3.46188891e-01, -7.14285714e-02], + [ 1.04513136e-01, 4.15444512e-01, -7.14285714e-02], + [ 2.79883711e-02, 3.60908761e-01, -7.14285714e-02], + [ 3.46390219e-02, 4.29600504e-01, -7.14285714e-02], + [ -7.89140509e-01, 6.14212713e-01, -7.14285714e-02], + [ -7.23378800e-01, 5.63028320e-01, -7.14285714e-02], + [ -8.79473751e-01, 4.75947393e-01, -7.14285714e-02], + [ -8.06184272e-01, 4.36285110e-01, -7.14285714e-02], + [ -9.45817242e-01, 3.24699469e-01, -7.14285714e-02], + [ -8.66999138e-01, 2.97641180e-01, -7.14285714e-02], + [ -9.86361303e-01, 1.64594590e-01, -7.14285714e-02], + [ -9.04164528e-01, 1.50878374e-01, -7.14285714e-02], + [ -1.00000000e+00, -1.74949543e-17, -7.14285714e-02], + [ -9.16666667e-01, -2.67544510e-17, -7.14285714e-02], + [ -9.86361303e-01, -1.64594590e-01, -7.14285714e-02], + [ -9.04164528e-01, -1.50878374e-01, -7.14285714e-02], + [ -6.57617091e-01, 5.11843927e-01, -7.14285714e-02], + [ -7.32894793e-01, 3.96622828e-01, -7.14285714e-02], + [ -7.88181035e-01, 2.70582891e-01, -7.14285714e-02], + [ -8.21967753e-01, 1.37162159e-01, -7.14285714e-02], + [ -8.33333333e-01, -2.31382435e-17, -7.14285714e-02], + [ -8.21967753e-01, -1.37162159e-01, -7.14285714e-02], + [ -5.91855382e-01, 4.60659535e-01, -7.14285714e-02], + [ -6.59605313e-01, 3.56960545e-01, -7.14285714e-02], + [ -7.09362931e-01, 2.43524602e-01, -7.14285714e-02], + [ -7.39770978e-01, 1.23445943e-01, -7.14285714e-02], + [ -7.50000000e-01, -2.03986436e-17, -7.14285714e-02], + [ -7.39770978e-01, -1.23445943e-01, -7.14285714e-02], + [ -5.26093673e-01, 4.09475142e-01, -7.14285714e-02], + [ -5.86315834e-01, 3.17298262e-01, -7.14285714e-02], + [ -6.30544828e-01, 2.16466313e-01, -7.14285714e-02], + [ -6.57574202e-01, 1.09729727e-01, -7.14285714e-02], + [ -6.66666667e-01, -1.78879673e-17, -7.14285714e-02], + [ -6.57574202e-01, -1.09729727e-01, -7.14285714e-02], + [ -4.60331964e-01, 3.58290749e-01, -7.14285714e-02], + [ -5.13026355e-01, 2.77635979e-01, -7.14285714e-02], + [ -5.51726724e-01, 1.89408024e-01, -7.14285714e-02], + [ -5.75377427e-01, 9.60135110e-02, -7.14285714e-02], + [ -5.83333333e-01, -1.52297412e-17, -7.14285714e-02], + [ -5.75377427e-01, -9.60135110e-02, -7.14285714e-02], + [ -3.94570255e-01, 3.07106356e-01, -7.14285714e-02], + [ -4.39736876e-01, 2.37973697e-01, -7.14285714e-02], + [ -4.72908621e-01, 1.62349735e-01, -7.14285714e-02], + [ -4.93180652e-01, 8.22972951e-02, -7.14285714e-02], + [ -5.00000000e-01, -1.22050366e-17, -7.14285714e-02], + [ -4.93180652e-01, -8.22972951e-02, -7.14285714e-02], + [ -4.20156583e-01, 7.22539112e-02, -7.14285714e-02], + [ -4.11228248e-01, 1.41174836e-01, -7.14285714e-02], + [ -4.20116462e-01, 1.83641595e-03, -7.14285714e-02], + [ -4.10983876e-01, -6.85810793e-02, -7.14285714e-02], + [ -3.47132513e-01, 6.22105272e-02, -7.14285714e-02], + [ -3.49547876e-01, 1.19999937e-01, -7.14285714e-02], + [ -3.40232923e-01, 3.67283191e-03, -7.14285714e-02], + [ -3.28787101e-01, -5.48648634e-02, -7.14285714e-02], + [ -2.74108444e-01, 5.21671433e-02, -7.14285714e-02], + [ -2.87867503e-01, 9.88250387e-02, -7.14285714e-02], + [ -2.60349385e-01, 5.50924786e-03, -7.14285714e-02], + [ -2.46590326e-01, -4.11486476e-02, -7.14285714e-02], + [ -1.64393551e-01, -2.74324317e-02, -7.14285714e-02], + [ -1.92379634e-01, 2.41096072e-02, -7.14285714e-02], + [ -8.21967753e-02, -1.37162159e-02, -7.14285714e-02], + [ -1.24409882e-01, 4.27099665e-02, -7.14285714e-02], + [ -2.20365717e-01, 7.56516461e-02, -7.14285714e-02], + [ -1.66622989e-01, 9.91361489e-02, -7.14285714e-02], + [ -2.48351800e-01, 1.27193685e-01, -7.14285714e-02], + [ -2.08836096e-01, 1.55562331e-01, -7.14285714e-02], + [ -2.70747482e-01, 2.06077006e-01, -7.14285714e-02], + [ -3.32658869e-01, 2.56591681e-01, -7.14285714e-02], + [ -3.12146825e-01, 1.64120356e-01, -7.14285714e-02], + [ -3.75941850e-01, 2.01047026e-01, -7.14285714e-02], + [ -9.45817242e-01, -3.24699469e-01, -7.14285714e-02], + [ -8.66999138e-01, -2.97641180e-01, -7.14285714e-02], + [ -8.79473751e-01, -4.75947393e-01, -7.14285714e-02], + [ -8.06184272e-01, -4.36285110e-01, -7.14285714e-02], + [ -7.89140509e-01, -6.14212713e-01, -7.14285714e-02], + [ -7.23378800e-01, -5.63028320e-01, -7.14285714e-02], + [ -6.77281572e-01, -7.35723911e-01, -7.14285714e-02], + [ -6.20841441e-01, -6.74413585e-01, -7.14285714e-02], + [ -5.46948158e-01, -8.37166478e-01, -7.14285714e-02], + [ -5.01369145e-01, -7.67402605e-01, -7.14285714e-02], + [ -4.01695425e-01, -9.15773327e-01, -7.14285714e-02], + [ -3.68220806e-01, -8.39458883e-01, -7.14285714e-02], + [ -7.88181035e-01, -2.70582891e-01, -7.14285714e-02], + [ -7.32894793e-01, -3.96622828e-01, -7.14285714e-02], + [ -6.57617091e-01, -5.11843927e-01, -7.14285714e-02], + [ -5.64401310e-01, -6.13103259e-01, -7.14285714e-02], + [ -4.55790132e-01, -6.97638732e-01, -7.14285714e-02], + [ -3.34746187e-01, -7.63144439e-01, -7.14285714e-02], + [ -7.09362931e-01, -2.43524602e-01, -7.14285714e-02], + [ -6.59605313e-01, -3.56960545e-01, -7.14285714e-02], + [ -5.91855382e-01, -4.60659535e-01, -7.14285714e-02], + [ -5.07961179e-01, -5.51792933e-01, -7.14285714e-02], + [ -4.10211119e-01, -6.27874859e-01, -7.14285714e-02], + [ -3.01271568e-01, -6.86829995e-01, -7.14285714e-02], + [ -6.30544828e-01, -2.16466313e-01, -7.14285714e-02], + [ -5.86315834e-01, -3.17298262e-01, -7.14285714e-02], + [ -5.26093673e-01, -4.09475142e-01, -7.14285714e-02], + [ -4.51521048e-01, -4.90482607e-01, -7.14285714e-02], + [ -3.64632105e-01, -5.58110986e-01, -7.14285714e-02], + [ -2.67796950e-01, -6.10515551e-01, -7.14285714e-02], + [ -5.51726724e-01, -1.89408024e-01, -7.14285714e-02], + [ -5.13026355e-01, -2.77635979e-01, -7.14285714e-02], + [ -4.60331964e-01, -3.58290749e-01, -7.14285714e-02], + [ -3.95080917e-01, -4.29172281e-01, -7.14285714e-02], + [ -3.19053092e-01, -4.88347112e-01, -7.14285714e-02], + [ -2.34322331e-01, -5.34201107e-01, -7.14285714e-02], + [ -4.72908621e-01, -1.62349735e-01, -7.14285714e-02], + [ -4.39736876e-01, -2.37973697e-01, -7.14285714e-02], + [ -3.94570255e-01, -3.07106356e-01, -7.14285714e-02], + [ -3.38640786e-01, -3.67861955e-01, -7.14285714e-02], + [ -2.73474079e-01, -4.18583239e-01, -7.14285714e-02], + [ -2.00847712e-01, -4.57886663e-01, -7.14285714e-02], + [ -2.90292421e-01, -3.12221863e-01, -7.14285714e-02], + [ -3.43107373e-01, -2.67051188e-01, -7.14285714e-02], + [ -2.31319311e-01, -3.50702994e-01, -7.14285714e-02], + [ -1.67373094e-01, -3.81572219e-01, -7.14285714e-02], + [ -2.41944057e-01, -2.56581770e-01, -7.14285714e-02], + [ -2.91644492e-01, -2.26996019e-01, -7.14285714e-02], + [ -1.89164543e-01, -2.82822750e-01, -7.14285714e-02], + [ -1.33898475e-01, -3.05257776e-01, -7.14285714e-02], + [ -1.93595692e-01, -2.00941678e-01, -7.14285714e-02], + [ -2.40181610e-01, -1.86940851e-01, -7.14285714e-02], + [ -1.47009774e-01, -2.14942505e-01, -7.14285714e-02], + [ -1.00423856e-01, -2.28943332e-01, -7.14285714e-02], + [ -6.69492374e-02, -1.52628888e-01, -7.14285714e-02], + [ -1.25405441e-01, -1.47867075e-01, -7.14285714e-02], + [ -3.34746187e-02, -7.63144439e-02, -7.14285714e-02], + [ -1.03801108e-01, -8.07916455e-02, -7.14285714e-02], + [ -1.83861645e-01, -1.43105263e-01, -7.14285714e-02], + [ -1.74127598e-01, -8.52688471e-02, -7.14285714e-02], + [ -2.42317849e-01, -1.38343450e-01, -7.14285714e-02], + [ -2.44454087e-01, -8.97460487e-02, -7.14285714e-02], + [ -3.20605599e-01, -1.13947277e-01, -7.14285714e-02], + [ -3.96757110e-01, -1.38148506e-01, -7.14285714e-02], + [ -3.08124191e-01, -1.71553532e-01, -7.14285714e-02], + [ -3.73930533e-01, -2.04763614e-01, -7.14285714e-02], + [ -2.45485487e-01, -9.69400266e-01, -7.14285714e-02], + [ -2.25028363e-01, -8.88616910e-01, -7.14285714e-02], + [ -8.25793455e-02, -9.96584493e-01, -7.14285714e-02], + [ -7.56977333e-02, -9.13535785e-01, -7.14285714e-02], + [ 8.25793455e-02, -9.96584493e-01, -7.14285714e-02], + [ 7.56977333e-02, -9.13535785e-01, -7.14285714e-02], + [ 2.45485487e-01, -9.69400266e-01, -7.14285714e-02], + [ 2.25028363e-01, -8.88616910e-01, -7.14285714e-02], + [ 4.01695425e-01, -9.15773327e-01, -7.14285714e-02], + [ 3.68220806e-01, -8.39458883e-01, -7.14285714e-02], + [ 5.46948158e-01, -8.37166478e-01, -7.14285714e-02], + [ 5.01369145e-01, -7.67402605e-01, -7.14285714e-02], + [ -2.04571239e-01, -8.07833555e-01, -7.14285714e-02], + [ -6.88161212e-02, -8.30487078e-01, -7.14285714e-02], + [ 6.88161212e-02, -8.30487078e-01, -7.14285714e-02], + [ 2.04571239e-01, -8.07833555e-01, -7.14285714e-02], + [ 3.34746187e-01, -7.63144439e-01, -7.14285714e-02], + [ 4.55790132e-01, -6.97638732e-01, -7.14285714e-02], + [ -1.84114115e-01, -7.27050199e-01, -7.14285714e-02], + [ -6.19345091e-02, -7.47438370e-01, -7.14285714e-02], + [ 6.19345091e-02, -7.47438370e-01, -7.14285714e-02], + [ 1.84114115e-01, -7.27050199e-01, -7.14285714e-02], + [ 3.01271568e-01, -6.86829995e-01, -7.14285714e-02], + [ 4.10211119e-01, -6.27874859e-01, -7.14285714e-02], + [ -1.63656991e-01, -6.46266844e-01, -7.14285714e-02], + [ -5.50528970e-02, -6.64389662e-01, -7.14285714e-02], + [ 5.50528970e-02, -6.64389662e-01, -7.14285714e-02], + [ 1.63656991e-01, -6.46266844e-01, -7.14285714e-02], + [ 2.67796950e-01, -6.10515551e-01, -7.14285714e-02], + [ 3.64632105e-01, -5.58110986e-01, -7.14285714e-02], + [ -1.43199867e-01, -5.65483488e-01, -7.14285714e-02], + [ -4.81712849e-02, -5.81340954e-01, -7.14285714e-02], + [ 4.81712849e-02, -5.81340954e-01, -7.14285714e-02], + [ 1.43199867e-01, -5.65483488e-01, -7.14285714e-02], + [ 2.34322331e-01, -5.34201107e-01, -7.14285714e-02], + [ 3.19053092e-01, -4.88347112e-01, -7.14285714e-02], + [ -1.22742744e-01, -4.84700133e-01, -7.14285714e-02], + [ -4.12896727e-02, -4.98292247e-01, -7.14285714e-02], + [ 4.12896727e-02, -4.98292247e-01, -7.14285714e-02], + [ 1.22742744e-01, -4.84700133e-01, -7.14285714e-02], + [ 2.00847712e-01, -4.57886663e-01, -7.14285714e-02], + [ 2.73474079e-01, -4.18583239e-01, -7.14285714e-02], + [ 1.02606772e-01, -4.13792257e-01, -7.14285714e-02], + [ 3.59043567e-02, -4.33301147e-01, -7.14285714e-02], + [ 1.67077120e-01, -3.85469130e-01, -7.14285714e-02], + [ 2.27895066e-01, -3.48819366e-01, -7.14285714e-02], + [ 8.24708009e-02, -3.42884381e-01, -7.14285714e-02], + [ 3.05190406e-02, -3.68310047e-01, -7.14285714e-02], + [ 1.33306527e-01, -3.13051596e-01, -7.14285714e-02], + [ 1.82316053e-01, -2.79055493e-01, -7.14285714e-02], + [ 6.23348295e-02, -2.71976505e-01, -7.14285714e-02], + [ 2.51337245e-02, -3.03318947e-01, -7.14285714e-02], + [ 9.95359345e-02, -2.40634062e-01, -7.14285714e-02], + [ 1.36737040e-01, -2.09291620e-01, -7.14285714e-02], + [ 9.11580264e-02, -1.39527746e-01, -7.14285714e-02], + [ 5.51990834e-02, -1.85860856e-01, -7.14285714e-02], + [ 4.55790132e-02, -6.97638732e-02, -7.14285714e-02], + [ 1.08622324e-02, -1.31087650e-01, -7.14285714e-02], + [ 1.92401405e-02, -2.32193966e-01, -7.14285714e-02], + [ -2.38545485e-02, -1.92411427e-01, -7.14285714e-02], + [ -1.67188024e-02, -2.78527075e-01, -7.14285714e-02], + [ -5.85713293e-02, -2.53735203e-01, -7.14285714e-02], + [ -7.99618007e-02, -3.30723513e-01, -7.14285714e-02], + [ -1.01352272e-01, -4.07711823e-01, -7.14285714e-02], + [ -2.49090925e-02, -3.51782132e-01, -7.14285714e-02], + [ -3.30993826e-02, -4.25037189e-01, -7.14285714e-02], + [ 6.77281572e-01, -7.35723911e-01, -7.14285714e-02], + [ 6.20841441e-01, -6.74413585e-01, -7.14285714e-02], + [ 7.89140509e-01, -6.14212713e-01, -7.14285714e-02], + [ 7.23378800e-01, -5.63028320e-01, -7.14285714e-02], + [ 8.79473751e-01, -4.75947393e-01, -7.14285714e-02], + [ 8.06184272e-01, -4.36285110e-01, -7.14285714e-02], + [ 9.45817242e-01, -3.24699469e-01, -7.14285714e-02], + [ 8.66999138e-01, -2.97641180e-01, -7.14285714e-02], + [ 9.86361303e-01, -1.64594590e-01, -7.14285714e-02], + [ 9.04164528e-01, -1.50878374e-01, -7.14285714e-02], + [ 5.64401310e-01, -6.13103259e-01, -7.14285714e-02], + [ 6.57617091e-01, -5.11843927e-01, -7.14285714e-02], + [ 7.32894793e-01, -3.96622828e-01, -7.14285714e-02], + [ 7.88181035e-01, -2.70582891e-01, -7.14285714e-02], + [ 8.21967753e-01, -1.37162159e-01, -7.14285714e-02], + [ 5.07961179e-01, -5.51792933e-01, -7.14285714e-02], + [ 5.91855382e-01, -4.60659535e-01, -7.14285714e-02], + [ 6.59605313e-01, -3.56960545e-01, -7.14285714e-02], + [ 7.09362931e-01, -2.43524602e-01, -7.14285714e-02], + [ 7.39770978e-01, -1.23445943e-01, -7.14285714e-02], + [ 4.51521048e-01, -4.90482607e-01, -7.14285714e-02], + [ 5.26093673e-01, -4.09475142e-01, -7.14285714e-02], + [ 5.86315834e-01, -3.17298262e-01, -7.14285714e-02], + [ 6.30544828e-01, -2.16466313e-01, -7.14285714e-02], + [ 6.57574202e-01, -1.09729727e-01, -7.14285714e-02], + [ 3.95080917e-01, -4.29172281e-01, -7.14285714e-02], + [ 4.60331964e-01, -3.58290749e-01, -7.14285714e-02], + [ 5.13026355e-01, -2.77635979e-01, -7.14285714e-02], + [ 5.51726724e-01, -1.89408024e-01, -7.14285714e-02], + [ 5.75377427e-01, -9.60135110e-02, -7.14285714e-02], + [ 3.38640786e-01, -3.67861955e-01, -7.14285714e-02], + [ 3.94570255e-01, -3.07106356e-01, -7.14285714e-02], + [ 4.39736876e-01, -2.37973697e-01, -7.14285714e-02], + [ 4.72908621e-01, -1.62349735e-01, -7.14285714e-02], + [ 4.93180652e-01, -8.22972951e-02, -7.14285714e-02], + [ 4.02533591e-01, -1.40423963e-01, -7.14285714e-02], + [ 3.82383017e-01, -2.06935340e-01, -7.14285714e-02], + [ 4.14084357e-01, -7.09602665e-02, -7.14285714e-02], + [ 3.32158562e-01, -1.18498191e-01, -7.14285714e-02], + [ 3.25029158e-01, -1.75896984e-01, -7.14285714e-02], + [ 3.34988061e-01, -5.96232379e-02, -7.14285714e-02], + [ 2.61783533e-01, -9.65724185e-02, -7.14285714e-02], + [ 2.67675299e-01, -1.44858628e-01, -7.14285714e-02], + [ 2.55891766e-01, -4.82862093e-02, -7.14285714e-02], + [ 1.85787515e-01, -5.54454306e-02, -7.14285714e-02], + [ 1.15683264e-01, -6.26046519e-02, -7.14285714e-02], + [ 2.04908364e-01, -1.10890861e-01, -7.14285714e-02], + [ 1.48033195e-01, -1.25209304e-01, -7.14285714e-02], + [ 2.24029213e-01, -1.66336292e-01, -7.14285714e-02], + [ 1.80383126e-01, -1.87813956e-01, -7.14285714e-02], + [ 2.33135679e-01, -2.47829956e-01, -7.14285714e-02], + [ 2.85888233e-01, -3.07845955e-01, -7.14285714e-02], + [ 2.80876227e-01, -2.13259647e-01, -7.14285714e-02], + [ 3.37723241e-01, -2.60183001e-01, -7.14285714e-02], + [ 1.00000000e+00, 0.00000000e+00, -2.14285714e-01], + [ 9.86361303e-01, 1.64594590e-01, -2.14285714e-01], + [ 9.04164528e-01, 1.50878374e-01, -2.14285714e-01], + [ 9.16666667e-01, 1.69309911e-16, -2.14285714e-01], + [ 9.45817242e-01, 3.24699469e-01, -2.14285714e-01], + [ 8.66999138e-01, 2.97641180e-01, -2.14285714e-01], + [ 8.79473751e-01, 4.75947393e-01, -2.14285714e-01], + [ 8.06184272e-01, 4.36285110e-01, -2.14285714e-01], + [ 7.89140509e-01, 6.14212713e-01, -2.14285714e-01], + [ 7.23378800e-01, 5.63028320e-01, -2.14285714e-01], + [ 6.77281572e-01, 7.35723911e-01, -2.14285714e-01], + [ 6.20841441e-01, 6.74413585e-01, -2.14285714e-01], + [ 5.46948158e-01, 8.37166478e-01, -2.14285714e-01], + [ 5.01369145e-01, 7.67402605e-01, -2.14285714e-01], + [ 4.01695425e-01, 9.15773327e-01, -2.14285714e-01], + [ 3.68220806e-01, 8.39458883e-01, -2.14285714e-01], + [ 8.21967753e-01, 1.37162159e-01, -2.14285714e-01], + [ 8.33333333e-01, 2.52036419e-16, -2.14285714e-01], + [ 7.88181035e-01, 2.70582891e-01, -2.14285714e-01], + [ 7.32894793e-01, 3.96622828e-01, -2.14285714e-01], + [ 6.57617091e-01, 5.11843927e-01, -2.14285714e-01], + [ 5.64401310e-01, 6.13103259e-01, -2.14285714e-01], + [ 4.55790132e-01, 6.97638732e-01, -2.14285714e-01], + [ 3.34746187e-01, 7.63144439e-01, -2.14285714e-01], + [ 7.39770978e-01, 1.23445943e-01, -2.14285714e-01], + [ 7.50000000e-01, 2.57034718e-16, -2.14285714e-01], + [ 7.09362931e-01, 2.43524602e-01, -2.14285714e-01], + [ 6.59605313e-01, 3.56960545e-01, -2.14285714e-01], + [ 5.91855382e-01, 4.60659535e-01, -2.14285714e-01], + [ 5.07961179e-01, 5.51792933e-01, -2.14285714e-01], + [ 4.10211119e-01, 6.27874859e-01, -2.14285714e-01], + [ 3.01271568e-01, 6.86829995e-01, -2.14285714e-01], + [ 6.57574202e-01, 1.09729727e-01, -2.14285714e-01], + [ 6.66666667e-01, 2.41641892e-16, -2.14285714e-01], + [ 6.30544828e-01, 2.16466313e-01, -2.14285714e-01], + [ 5.86315834e-01, 3.17298262e-01, -2.14285714e-01], + [ 5.26093673e-01, 4.09475142e-01, -2.14285714e-01], + [ 4.51521048e-01, 4.90482607e-01, -2.14285714e-01], + [ 3.64632105e-01, 5.58110986e-01, -2.14285714e-01], + [ 2.67796950e-01, 6.10515551e-01, -2.14285714e-01], + [ 5.75377427e-01, 9.60135110e-02, -2.14285714e-01], + [ 5.83333333e-01, 2.19355109e-16, -2.14285714e-01], + [ 5.51726724e-01, 1.89408024e-01, -2.14285714e-01], + [ 5.13026355e-01, 2.77635979e-01, -2.14285714e-01], + [ 4.60331964e-01, 3.58290749e-01, -2.14285714e-01], + [ 3.95080917e-01, 4.29172281e-01, -2.14285714e-01], + [ 3.19053092e-01, 4.88347112e-01, -2.14285714e-01], + [ 2.34322331e-01, 5.34201107e-01, -2.14285714e-01], + [ 4.93180652e-01, 8.22972951e-02, -2.14285714e-01], + [ 5.00000000e-01, 1.93929455e-16, -2.14285714e-01], + [ 4.72908621e-01, 1.62349735e-01, -2.14285714e-01], + [ 4.39736876e-01, 2.37973697e-01, -2.14285714e-01], + [ 3.94570255e-01, 3.07106356e-01, -2.14285714e-01], + [ 3.38640786e-01, 3.67861955e-01, -2.14285714e-01], + [ 2.73474079e-01, 4.18583239e-01, -2.14285714e-01], + [ 2.00847712e-01, 4.57886663e-01, -2.14285714e-01], + [ 2.92606991e-01, 3.16445261e-01, -2.14285714e-01], + [ 3.44188184e-01, 2.67935253e-01, -2.14285714e-01], + [ 2.34867640e-01, 3.58265725e-01, -2.14285714e-01], + [ 1.72155182e-01, 3.92474283e-01, -2.14285714e-01], + [ 2.46573197e-01, 2.65028567e-01, -2.14285714e-01], + [ 2.93806114e-01, 2.28764151e-01, -2.14285714e-01], + [ 1.96261201e-01, 2.97948211e-01, -2.14285714e-01], + [ 1.43462652e-01, 3.27061902e-01, -2.14285714e-01], + [ 2.00539403e-01, 2.13611872e-01, -2.14285714e-01], + [ 2.43424043e-01, 1.89593048e-01, -2.14285714e-01], + [ 1.57654762e-01, 2.37630697e-01, -2.14285714e-01], + [ 1.14770121e-01, 2.61649522e-01, -2.14285714e-01], + [ 8.60775910e-02, 1.96237141e-01, -2.14285714e-01], + [ 1.39074405e-01, 1.78223023e-01, -2.14285714e-01], + [ 5.73850607e-02, 1.30824761e-01, -2.14285714e-01], + [ 1.20494048e-01, 1.18815349e-01, -2.14285714e-01], + [ 2.86925303e-02, 6.54123805e-02, -2.14285714e-01], + [ 1.01913690e-01, 5.94076743e-02, -2.14285714e-01], + [ 1.14778696e-17, 2.69135258e-17, -2.14285714e-01], + [ 8.33333333e-02, 5.45226540e-17, -2.14285714e-01], + [ 1.92071219e-01, 1.60208904e-01, -2.14285714e-01], + [ 1.83603035e-01, 1.06805936e-01, -2.14285714e-01], + [ 1.75134851e-01, 5.34029681e-02, -2.14285714e-01], + [ 1.66666667e-01, 8.24990293e-17, -2.14285714e-01], + [ 2.45068032e-01, 1.42194786e-01, -2.14285714e-01], + [ 2.46712022e-01, 9.47965238e-02, -2.14285714e-01], + [ 2.48356011e-01, 4.73982619e-02, -2.14285714e-01], + [ 2.50000000e-01, 1.10712368e-16, -2.14285714e-01], + [ 3.33333333e-01, 1.38945119e-16, -2.14285714e-01], + [ 3.29964224e-01, 5.90312730e-02, -2.14285714e-01], + [ 4.16666667e-01, 1.66856194e-16, -2.14285714e-01], + [ 4.11572438e-01, 7.06642841e-02, -2.14285714e-01], + [ 3.22110888e-01, 1.17314261e-01, -2.14285714e-01], + [ 3.97509754e-01, 1.39831998e-01, -2.14285714e-01], + [ 3.09957647e-01, 1.74121089e-01, -2.14285714e-01], + [ 3.74847261e-01, 2.06047393e-01, -2.14285714e-01], + [ 2.45485487e-01, 9.69400266e-01, -2.14285714e-01], + [ 2.25028363e-01, 8.88616910e-01, -2.14285714e-01], + [ 8.25793455e-02, 9.96584493e-01, -2.14285714e-01], + [ 7.56977333e-02, 9.13535785e-01, -2.14285714e-01], + [ -8.25793455e-02, 9.96584493e-01, -2.14285714e-01], + [ -7.56977333e-02, 9.13535785e-01, -2.14285714e-01], + [ -2.45485487e-01, 9.69400266e-01, -2.14285714e-01], + [ -2.25028363e-01, 8.88616910e-01, -2.14285714e-01], + [ -4.01695425e-01, 9.15773327e-01, -2.14285714e-01], + [ -3.68220806e-01, 8.39458883e-01, -2.14285714e-01], + [ -5.46948158e-01, 8.37166478e-01, -2.14285714e-01], + [ -5.01369145e-01, 7.67402605e-01, -2.14285714e-01], + [ -6.77281572e-01, 7.35723911e-01, -2.14285714e-01], + [ -6.20841441e-01, 6.74413585e-01, -2.14285714e-01], + [ 2.04571239e-01, 8.07833555e-01, -2.14285714e-01], + [ 6.88161212e-02, 8.30487078e-01, -2.14285714e-01], + [ -6.88161212e-02, 8.30487078e-01, -2.14285714e-01], + [ -2.04571239e-01, 8.07833555e-01, -2.14285714e-01], + [ -3.34746187e-01, 7.63144439e-01, -2.14285714e-01], + [ -4.55790132e-01, 6.97638732e-01, -2.14285714e-01], + [ -5.64401310e-01, 6.13103259e-01, -2.14285714e-01], + [ 1.84114115e-01, 7.27050199e-01, -2.14285714e-01], + [ 6.19345091e-02, 7.47438370e-01, -2.14285714e-01], + [ -6.19345091e-02, 7.47438370e-01, -2.14285714e-01], + [ -1.84114115e-01, 7.27050199e-01, -2.14285714e-01], + [ -3.01271568e-01, 6.86829995e-01, -2.14285714e-01], + [ -4.10211119e-01, 6.27874859e-01, -2.14285714e-01], + [ -5.07961179e-01, 5.51792933e-01, -2.14285714e-01], + [ 1.63656991e-01, 6.46266844e-01, -2.14285714e-01], + [ 5.50528970e-02, 6.64389662e-01, -2.14285714e-01], + [ -5.50528970e-02, 6.64389662e-01, -2.14285714e-01], + [ -1.63656991e-01, 6.46266844e-01, -2.14285714e-01], + [ -2.67796950e-01, 6.10515551e-01, -2.14285714e-01], + [ -3.64632105e-01, 5.58110986e-01, -2.14285714e-01], + [ -4.51521048e-01, 4.90482607e-01, -2.14285714e-01], + [ 1.43199867e-01, 5.65483488e-01, -2.14285714e-01], + [ 4.81712849e-02, 5.81340954e-01, -2.14285714e-01], + [ -4.81712849e-02, 5.81340954e-01, -2.14285714e-01], + [ -1.43199867e-01, 5.65483488e-01, -2.14285714e-01], + [ -2.34322331e-01, 5.34201107e-01, -2.14285714e-01], + [ -3.19053092e-01, 4.88347112e-01, -2.14285714e-01], + [ -3.95080917e-01, 4.29172281e-01, -2.14285714e-01], + [ 1.22742744e-01, 4.84700133e-01, -2.14285714e-01], + [ 4.12896727e-02, 4.98292247e-01, -2.14285714e-01], + [ -4.12896727e-02, 4.98292247e-01, -2.14285714e-01], + [ -1.22742744e-01, 4.84700133e-01, -2.14285714e-01], + [ -2.00847712e-01, 4.57886663e-01, -2.14285714e-01], + [ -2.73474079e-01, 4.18583239e-01, -2.14285714e-01], + [ -3.38640786e-01, 3.67861955e-01, -2.14285714e-01], + [ -1.02283149e-01, 4.15336195e-01, -2.14285714e-01], + [ -3.59859419e-02, 4.34695086e-01, -2.14285714e-01], + [ -1.66348287e-01, 3.87163066e-01, -2.14285714e-01], + [ -2.26761024e-01, 3.50663301e-01, -2.14285714e-01], + [ -2.82200655e-01, 3.06551629e-01, -2.14285714e-01], + [ -8.18235534e-02, 3.45972257e-01, -2.14285714e-01], + [ -3.06822110e-02, 3.71097926e-01, -2.14285714e-01], + [ -1.31848862e-01, 3.16439469e-01, -2.14285714e-01], + [ -1.80047970e-01, 2.82743363e-01, -2.14285714e-01], + [ -2.25760524e-01, 2.45241304e-01, -2.14285714e-01], + [ -6.13639584e-02, 2.76608319e-01, -2.14285714e-01], + [ -2.53784802e-02, 3.07500766e-01, -2.14285714e-01], + [ -9.73494365e-02, 2.45715872e-01, -2.14285714e-01], + [ -1.33334915e-01, 2.14823425e-01, -2.14285714e-01], + [ -1.69320393e-01, 1.83930978e-01, -2.14285714e-01], + [ -1.12880262e-01, 1.22620652e-01, -2.14285714e-01], + [ -7.93257664e-02, 1.65019743e-01, -2.14285714e-01], + [ -5.64401310e-02, 6.13103259e-02, -2.14285714e-01], + [ -2.53166180e-02, 1.15216062e-01, -2.14285714e-01], + [ -4.57712708e-02, 2.07418835e-01, -2.14285714e-01], + [ 5.80689493e-03, 1.69121798e-01, -2.14285714e-01], + [ -1.22167752e-02, 2.49817927e-01, -2.14285714e-01], + [ 3.69304079e-02, 2.23027534e-01, -2.14285714e-01], + [ 2.13377203e-02, 2.92217018e-01, -2.14285714e-01], + [ 6.80539208e-02, 2.76933270e-01, -2.14285714e-01], + [ 8.62835284e-02, 3.46188891e-01, -2.14285714e-01], + [ 1.04513136e-01, 4.15444512e-01, -2.14285714e-01], + [ 2.79883711e-02, 3.60908761e-01, -2.14285714e-01], + [ 3.46390219e-02, 4.29600504e-01, -2.14285714e-01], + [ -7.89140509e-01, 6.14212713e-01, -2.14285714e-01], + [ -7.23378800e-01, 5.63028320e-01, -2.14285714e-01], + [ -8.79473751e-01, 4.75947393e-01, -2.14285714e-01], + [ -8.06184272e-01, 4.36285110e-01, -2.14285714e-01], + [ -9.45817242e-01, 3.24699469e-01, -2.14285714e-01], + [ -8.66999138e-01, 2.97641180e-01, -2.14285714e-01], + [ -9.86361303e-01, 1.64594590e-01, -2.14285714e-01], + [ -9.04164528e-01, 1.50878374e-01, -2.14285714e-01], + [ -1.00000000e+00, -5.24848628e-17, -2.14285714e-01], + [ -9.16666667e-01, -3.39957805e-17, -2.14285714e-01], + [ -9.86361303e-01, -1.64594590e-01, -2.14285714e-01], + [ -9.04164528e-01, -1.50878374e-01, -2.14285714e-01], + [ -6.57617091e-01, 5.11843927e-01, -2.14285714e-01], + [ -7.32894793e-01, 3.96622828e-01, -2.14285714e-01], + [ -7.88181035e-01, 2.70582891e-01, -2.14285714e-01], + [ -8.21967753e-01, 1.37162159e-01, -2.14285714e-01], + [ -8.33333333e-01, -2.88110659e-17, -2.14285714e-01], + [ -8.21967753e-01, -1.37162159e-01, -2.14285714e-01], + [ -5.91855382e-01, 4.60659535e-01, -2.14285714e-01], + [ -6.59605313e-01, 3.56960545e-01, -2.14285714e-01], + [ -7.09362931e-01, 2.43524602e-01, -2.14285714e-01], + [ -7.39770978e-01, 1.23445943e-01, -2.14285714e-01], + [ -7.50000000e-01, -2.47221107e-17, -2.14285714e-01], + [ -7.39770978e-01, -1.23445943e-01, -2.14285714e-01], + [ -5.26093673e-01, 4.09475142e-01, -2.14285714e-01], + [ -5.86315834e-01, 3.17298262e-01, -2.14285714e-01], + [ -6.30544828e-01, 2.16466313e-01, -2.14285714e-01], + [ -6.57574202e-01, 1.09729727e-01, -2.14285714e-01], + [ -6.66666667e-01, -2.09193101e-17, -2.14285714e-01], + [ -6.57574202e-01, -1.09729727e-01, -2.14285714e-01], + [ -4.60331964e-01, 3.58290749e-01, -2.14285714e-01], + [ -5.13026355e-01, 2.77635979e-01, -2.14285714e-01], + [ -5.51726724e-01, 1.89408024e-01, -2.14285714e-01], + [ -5.75377427e-01, 9.60135110e-02, -2.14285714e-01], + [ -5.83333333e-01, -1.69320721e-17, -2.14285714e-01], + [ -5.75377427e-01, -9.60135110e-02, -2.14285714e-01], + [ -3.94570255e-01, 3.07106356e-01, -2.14285714e-01], + [ -4.39736876e-01, 2.37973697e-01, -2.14285714e-01], + [ -4.72908621e-01, 1.62349735e-01, -2.14285714e-01], + [ -4.93180652e-01, 8.22972951e-02, -2.14285714e-01], + [ -5.00000000e-01, -1.24867361e-17, -2.14285714e-01], + [ -4.93180652e-01, -8.22972951e-02, -2.14285714e-01], + [ -4.20156583e-01, 7.22539112e-02, -2.14285714e-01], + [ -4.11228248e-01, 1.41174836e-01, -2.14285714e-01], + [ -4.20116462e-01, 1.83641595e-03, -2.14285714e-01], + [ -4.10983876e-01, -6.85810793e-02, -2.14285714e-01], + [ -3.47132513e-01, 6.22105272e-02, -2.14285714e-01], + [ -3.49547876e-01, 1.19999937e-01, -2.14285714e-01], + [ -3.40232923e-01, 3.67283191e-03, -2.14285714e-01], + [ -3.28787101e-01, -5.48648634e-02, -2.14285714e-01], + [ -2.74108444e-01, 5.21671433e-02, -2.14285714e-01], + [ -2.87867503e-01, 9.88250387e-02, -2.14285714e-01], + [ -2.60349385e-01, 5.50924786e-03, -2.14285714e-01], + [ -2.46590326e-01, -4.11486476e-02, -2.14285714e-01], + [ -1.64393551e-01, -2.74324317e-02, -2.14285714e-01], + [ -1.92379634e-01, 2.41096072e-02, -2.14285714e-01], + [ -8.21967753e-02, -1.37162159e-02, -2.14285714e-01], + [ -1.24409882e-01, 4.27099665e-02, -2.14285714e-01], + [ -2.20365717e-01, 7.56516461e-02, -2.14285714e-01], + [ -1.66622989e-01, 9.91361489e-02, -2.14285714e-01], + [ -2.48351800e-01, 1.27193685e-01, -2.14285714e-01], + [ -2.08836096e-01, 1.55562331e-01, -2.14285714e-01], + [ -2.70747482e-01, 2.06077006e-01, -2.14285714e-01], + [ -3.32658869e-01, 2.56591681e-01, -2.14285714e-01], + [ -3.12146825e-01, 1.64120356e-01, -2.14285714e-01], + [ -3.75941850e-01, 2.01047026e-01, -2.14285714e-01], + [ -9.45817242e-01, -3.24699469e-01, -2.14285714e-01], + [ -8.66999138e-01, -2.97641180e-01, -2.14285714e-01], + [ -8.79473751e-01, -4.75947393e-01, -2.14285714e-01], + [ -8.06184272e-01, -4.36285110e-01, -2.14285714e-01], + [ -7.89140509e-01, -6.14212713e-01, -2.14285714e-01], + [ -7.23378800e-01, -5.63028320e-01, -2.14285714e-01], + [ -6.77281572e-01, -7.35723911e-01, -2.14285714e-01], + [ -6.20841441e-01, -6.74413585e-01, -2.14285714e-01], + [ -5.46948158e-01, -8.37166478e-01, -2.14285714e-01], + [ -5.01369145e-01, -7.67402605e-01, -2.14285714e-01], + [ -4.01695425e-01, -9.15773327e-01, -2.14285714e-01], + [ -3.68220806e-01, -8.39458883e-01, -2.14285714e-01], + [ -7.88181035e-01, -2.70582891e-01, -2.14285714e-01], + [ -7.32894793e-01, -3.96622828e-01, -2.14285714e-01], + [ -6.57617091e-01, -5.11843927e-01, -2.14285714e-01], + [ -5.64401310e-01, -6.13103259e-01, -2.14285714e-01], + [ -4.55790132e-01, -6.97638732e-01, -2.14285714e-01], + [ -3.34746187e-01, -7.63144439e-01, -2.14285714e-01], + [ -7.09362931e-01, -2.43524602e-01, -2.14285714e-01], + [ -6.59605313e-01, -3.56960545e-01, -2.14285714e-01], + [ -5.91855382e-01, -4.60659535e-01, -2.14285714e-01], + [ -5.07961179e-01, -5.51792933e-01, -2.14285714e-01], + [ -4.10211119e-01, -6.27874859e-01, -2.14285714e-01], + [ -3.01271568e-01, -6.86829995e-01, -2.14285714e-01], + [ -6.30544828e-01, -2.16466313e-01, -2.14285714e-01], + [ -5.86315834e-01, -3.17298262e-01, -2.14285714e-01], + [ -5.26093673e-01, -4.09475142e-01, -2.14285714e-01], + [ -4.51521048e-01, -4.90482607e-01, -2.14285714e-01], + [ -3.64632105e-01, -5.58110986e-01, -2.14285714e-01], + [ -2.67796950e-01, -6.10515551e-01, -2.14285714e-01], + [ -5.51726724e-01, -1.89408024e-01, -2.14285714e-01], + [ -5.13026355e-01, -2.77635979e-01, -2.14285714e-01], + [ -4.60331964e-01, -3.58290749e-01, -2.14285714e-01], + [ -3.95080917e-01, -4.29172281e-01, -2.14285714e-01], + [ -3.19053092e-01, -4.88347112e-01, -2.14285714e-01], + [ -2.34322331e-01, -5.34201107e-01, -2.14285714e-01], + [ -4.72908621e-01, -1.62349735e-01, -2.14285714e-01], + [ -4.39736876e-01, -2.37973697e-01, -2.14285714e-01], + [ -3.94570255e-01, -3.07106356e-01, -2.14285714e-01], + [ -3.38640786e-01, -3.67861955e-01, -2.14285714e-01], + [ -2.73474079e-01, -4.18583239e-01, -2.14285714e-01], + [ -2.00847712e-01, -4.57886663e-01, -2.14285714e-01], + [ -2.90292421e-01, -3.12221863e-01, -2.14285714e-01], + [ -3.43107373e-01, -2.67051188e-01, -2.14285714e-01], + [ -2.31319311e-01, -3.50702994e-01, -2.14285714e-01], + [ -1.67373094e-01, -3.81572219e-01, -2.14285714e-01], + [ -2.41944057e-01, -2.56581770e-01, -2.14285714e-01], + [ -2.91644492e-01, -2.26996019e-01, -2.14285714e-01], + [ -1.89164543e-01, -2.82822750e-01, -2.14285714e-01], + [ -1.33898475e-01, -3.05257776e-01, -2.14285714e-01], + [ -1.93595692e-01, -2.00941678e-01, -2.14285714e-01], + [ -2.40181610e-01, -1.86940851e-01, -2.14285714e-01], + [ -1.47009774e-01, -2.14942505e-01, -2.14285714e-01], + [ -1.00423856e-01, -2.28943332e-01, -2.14285714e-01], + [ -6.69492374e-02, -1.52628888e-01, -2.14285714e-01], + [ -1.25405441e-01, -1.47867075e-01, -2.14285714e-01], + [ -3.34746187e-02, -7.63144439e-02, -2.14285714e-01], + [ -1.03801108e-01, -8.07916455e-02, -2.14285714e-01], + [ -1.83861645e-01, -1.43105263e-01, -2.14285714e-01], + [ -1.74127598e-01, -8.52688471e-02, -2.14285714e-01], + [ -2.42317849e-01, -1.38343450e-01, -2.14285714e-01], + [ -2.44454087e-01, -8.97460487e-02, -2.14285714e-01], + [ -3.20605599e-01, -1.13947277e-01, -2.14285714e-01], + [ -3.96757110e-01, -1.38148506e-01, -2.14285714e-01], + [ -3.08124191e-01, -1.71553532e-01, -2.14285714e-01], + [ -3.73930533e-01, -2.04763614e-01, -2.14285714e-01], + [ -2.45485487e-01, -9.69400266e-01, -2.14285714e-01], + [ -2.25028363e-01, -8.88616910e-01, -2.14285714e-01], + [ -8.25793455e-02, -9.96584493e-01, -2.14285714e-01], + [ -7.56977333e-02, -9.13535785e-01, -2.14285714e-01], + [ 8.25793455e-02, -9.96584493e-01, -2.14285714e-01], + [ 7.56977333e-02, -9.13535785e-01, -2.14285714e-01], + [ 2.45485487e-01, -9.69400266e-01, -2.14285714e-01], + [ 2.25028363e-01, -8.88616910e-01, -2.14285714e-01], + [ 4.01695425e-01, -9.15773327e-01, -2.14285714e-01], + [ 3.68220806e-01, -8.39458883e-01, -2.14285714e-01], + [ 5.46948158e-01, -8.37166478e-01, -2.14285714e-01], + [ 5.01369145e-01, -7.67402605e-01, -2.14285714e-01], + [ -2.04571239e-01, -8.07833555e-01, -2.14285714e-01], + [ -6.88161212e-02, -8.30487078e-01, -2.14285714e-01], + [ 6.88161212e-02, -8.30487078e-01, -2.14285714e-01], + [ 2.04571239e-01, -8.07833555e-01, -2.14285714e-01], + [ 3.34746187e-01, -7.63144439e-01, -2.14285714e-01], + [ 4.55790132e-01, -6.97638732e-01, -2.14285714e-01], + [ -1.84114115e-01, -7.27050199e-01, -2.14285714e-01], + [ -6.19345091e-02, -7.47438370e-01, -2.14285714e-01], + [ 6.19345091e-02, -7.47438370e-01, -2.14285714e-01], + [ 1.84114115e-01, -7.27050199e-01, -2.14285714e-01], + [ 3.01271568e-01, -6.86829995e-01, -2.14285714e-01], + [ 4.10211119e-01, -6.27874859e-01, -2.14285714e-01], + [ -1.63656991e-01, -6.46266844e-01, -2.14285714e-01], + [ -5.50528970e-02, -6.64389662e-01, -2.14285714e-01], + [ 5.50528970e-02, -6.64389662e-01, -2.14285714e-01], + [ 1.63656991e-01, -6.46266844e-01, -2.14285714e-01], + [ 2.67796950e-01, -6.10515551e-01, -2.14285714e-01], + [ 3.64632105e-01, -5.58110986e-01, -2.14285714e-01], + [ -1.43199867e-01, -5.65483488e-01, -2.14285714e-01], + [ -4.81712849e-02, -5.81340954e-01, -2.14285714e-01], + [ 4.81712849e-02, -5.81340954e-01, -2.14285714e-01], + [ 1.43199867e-01, -5.65483488e-01, -2.14285714e-01], + [ 2.34322331e-01, -5.34201107e-01, -2.14285714e-01], + [ 3.19053092e-01, -4.88347112e-01, -2.14285714e-01], + [ -1.22742744e-01, -4.84700133e-01, -2.14285714e-01], + [ -4.12896727e-02, -4.98292247e-01, -2.14285714e-01], + [ 4.12896727e-02, -4.98292247e-01, -2.14285714e-01], + [ 1.22742744e-01, -4.84700133e-01, -2.14285714e-01], + [ 2.00847712e-01, -4.57886663e-01, -2.14285714e-01], + [ 2.73474079e-01, -4.18583239e-01, -2.14285714e-01], + [ 1.02606772e-01, -4.13792257e-01, -2.14285714e-01], + [ 3.59043567e-02, -4.33301147e-01, -2.14285714e-01], + [ 1.67077120e-01, -3.85469130e-01, -2.14285714e-01], + [ 2.27895066e-01, -3.48819366e-01, -2.14285714e-01], + [ 8.24708009e-02, -3.42884381e-01, -2.14285714e-01], + [ 3.05190406e-02, -3.68310047e-01, -2.14285714e-01], + [ 1.33306527e-01, -3.13051596e-01, -2.14285714e-01], + [ 1.82316053e-01, -2.79055493e-01, -2.14285714e-01], + [ 6.23348295e-02, -2.71976505e-01, -2.14285714e-01], + [ 2.51337245e-02, -3.03318947e-01, -2.14285714e-01], + [ 9.95359345e-02, -2.40634062e-01, -2.14285714e-01], + [ 1.36737040e-01, -2.09291620e-01, -2.14285714e-01], + [ 9.11580264e-02, -1.39527746e-01, -2.14285714e-01], + [ 5.51990834e-02, -1.85860856e-01, -2.14285714e-01], + [ 4.55790132e-02, -6.97638732e-02, -2.14285714e-01], + [ 1.08622324e-02, -1.31087650e-01, -2.14285714e-01], + [ 1.92401405e-02, -2.32193966e-01, -2.14285714e-01], + [ -2.38545485e-02, -1.92411427e-01, -2.14285714e-01], + [ -1.67188024e-02, -2.78527075e-01, -2.14285714e-01], + [ -5.85713293e-02, -2.53735203e-01, -2.14285714e-01], + [ -7.99618007e-02, -3.30723513e-01, -2.14285714e-01], + [ -1.01352272e-01, -4.07711823e-01, -2.14285714e-01], + [ -2.49090925e-02, -3.51782132e-01, -2.14285714e-01], + [ -3.30993826e-02, -4.25037189e-01, -2.14285714e-01], + [ 6.77281572e-01, -7.35723911e-01, -2.14285714e-01], + [ 6.20841441e-01, -6.74413585e-01, -2.14285714e-01], + [ 7.89140509e-01, -6.14212713e-01, -2.14285714e-01], + [ 7.23378800e-01, -5.63028320e-01, -2.14285714e-01], + [ 8.79473751e-01, -4.75947393e-01, -2.14285714e-01], + [ 8.06184272e-01, -4.36285110e-01, -2.14285714e-01], + [ 9.45817242e-01, -3.24699469e-01, -2.14285714e-01], + [ 8.66999138e-01, -2.97641180e-01, -2.14285714e-01], + [ 9.86361303e-01, -1.64594590e-01, -2.14285714e-01], + [ 9.04164528e-01, -1.50878374e-01, -2.14285714e-01], + [ 5.64401310e-01, -6.13103259e-01, -2.14285714e-01], + [ 6.57617091e-01, -5.11843927e-01, -2.14285714e-01], + [ 7.32894793e-01, -3.96622828e-01, -2.14285714e-01], + [ 7.88181035e-01, -2.70582891e-01, -2.14285714e-01], + [ 8.21967753e-01, -1.37162159e-01, -2.14285714e-01], + [ 5.07961179e-01, -5.51792933e-01, -2.14285714e-01], + [ 5.91855382e-01, -4.60659535e-01, -2.14285714e-01], + [ 6.59605313e-01, -3.56960545e-01, -2.14285714e-01], + [ 7.09362931e-01, -2.43524602e-01, -2.14285714e-01], + [ 7.39770978e-01, -1.23445943e-01, -2.14285714e-01], + [ 4.51521048e-01, -4.90482607e-01, -2.14285714e-01], + [ 5.26093673e-01, -4.09475142e-01, -2.14285714e-01], + [ 5.86315834e-01, -3.17298262e-01, -2.14285714e-01], + [ 6.30544828e-01, -2.16466313e-01, -2.14285714e-01], + [ 6.57574202e-01, -1.09729727e-01, -2.14285714e-01], + [ 3.95080917e-01, -4.29172281e-01, -2.14285714e-01], + [ 4.60331964e-01, -3.58290749e-01, -2.14285714e-01], + [ 5.13026355e-01, -2.77635979e-01, -2.14285714e-01], + [ 5.51726724e-01, -1.89408024e-01, -2.14285714e-01], + [ 5.75377427e-01, -9.60135110e-02, -2.14285714e-01], + [ 3.38640786e-01, -3.67861955e-01, -2.14285714e-01], + [ 3.94570255e-01, -3.07106356e-01, -2.14285714e-01], + [ 4.39736876e-01, -2.37973697e-01, -2.14285714e-01], + [ 4.72908621e-01, -1.62349735e-01, -2.14285714e-01], + [ 4.93180652e-01, -8.22972951e-02, -2.14285714e-01], + [ 4.02533591e-01, -1.40423963e-01, -2.14285714e-01], + [ 3.82383017e-01, -2.06935340e-01, -2.14285714e-01], + [ 4.14084357e-01, -7.09602665e-02, -2.14285714e-01], + [ 3.32158562e-01, -1.18498191e-01, -2.14285714e-01], + [ 3.25029158e-01, -1.75896984e-01, -2.14285714e-01], + [ 3.34988061e-01, -5.96232379e-02, -2.14285714e-01], + [ 2.61783533e-01, -9.65724185e-02, -2.14285714e-01], + [ 2.67675299e-01, -1.44858628e-01, -2.14285714e-01], + [ 2.55891766e-01, -4.82862093e-02, -2.14285714e-01], + [ 1.85787515e-01, -5.54454306e-02, -2.14285714e-01], + [ 1.15683264e-01, -6.26046519e-02, -2.14285714e-01], + [ 2.04908364e-01, -1.10890861e-01, -2.14285714e-01], + [ 1.48033195e-01, -1.25209304e-01, -2.14285714e-01], + [ 2.24029213e-01, -1.66336292e-01, -2.14285714e-01], + [ 1.80383126e-01, -1.87813956e-01, -2.14285714e-01], + [ 2.33135679e-01, -2.47829956e-01, -2.14285714e-01], + [ 2.85888233e-01, -3.07845955e-01, -2.14285714e-01], + [ 2.80876227e-01, -2.13259647e-01, -2.14285714e-01], + [ 3.37723241e-01, -2.60183001e-01, -2.14285714e-01], + [ 1.00000000e+00, 0.00000000e+00, -3.57142857e-01], + [ 9.86361303e-01, 1.64594590e-01, -3.57142857e-01], + [ 9.04164528e-01, 1.50878374e-01, -3.57142857e-01], + [ 9.16666667e-01, 1.88101103e-16, -3.57142857e-01], + [ 9.45817242e-01, 3.24699469e-01, -3.57142857e-01], + [ 8.66999138e-01, 2.97641180e-01, -3.57142857e-01], + [ 8.79473751e-01, 4.75947393e-01, -3.57142857e-01], + [ 8.06184272e-01, 4.36285110e-01, -3.57142857e-01], + [ 7.89140509e-01, 6.14212713e-01, -3.57142857e-01], + [ 7.23378800e-01, 5.63028320e-01, -3.57142857e-01], + [ 6.77281572e-01, 7.35723911e-01, -3.57142857e-01], + [ 6.20841441e-01, 6.74413585e-01, -3.57142857e-01], + [ 5.46948158e-01, 8.37166478e-01, -3.57142857e-01], + [ 5.01369145e-01, 7.67402605e-01, -3.57142857e-01], + [ 4.01695425e-01, 9.15773327e-01, -3.57142857e-01], + [ 3.68220806e-01, 8.39458883e-01, -3.57142857e-01], + [ 8.21967753e-01, 1.37162159e-01, -3.57142857e-01], + [ 8.33333333e-01, 2.89101549e-16, -3.57142857e-01], + [ 7.88181035e-01, 2.70582891e-01, -3.57142857e-01], + [ 7.32894793e-01, 3.96622828e-01, -3.57142857e-01], + [ 6.57617091e-01, 5.11843927e-01, -3.57142857e-01], + [ 5.64401310e-01, 6.13103259e-01, -3.57142857e-01], + [ 4.55790132e-01, 6.97638732e-01, -3.57142857e-01], + [ 3.34746187e-01, 7.63144439e-01, -3.57142857e-01], + [ 7.39770978e-01, 1.23445943e-01, -3.57142857e-01], + [ 7.50000000e-01, 2.96828145e-16, -3.57142857e-01], + [ 7.09362931e-01, 2.43524602e-01, -3.57142857e-01], + [ 6.59605313e-01, 3.56960545e-01, -3.57142857e-01], + [ 5.91855382e-01, 4.60659535e-01, -3.57142857e-01], + [ 5.07961179e-01, 5.51792933e-01, -3.57142857e-01], + [ 4.10211119e-01, 6.27874859e-01, -3.57142857e-01], + [ 3.01271568e-01, 6.86829995e-01, -3.57142857e-01], + [ 6.57574202e-01, 1.09729727e-01, -3.57142857e-01], + [ 6.66666667e-01, 2.80085390e-16, -3.57142857e-01], + [ 6.30544828e-01, 2.16466313e-01, -3.57142857e-01], + [ 5.86315834e-01, 3.17298262e-01, -3.57142857e-01], + [ 5.26093673e-01, 4.09475142e-01, -3.57142857e-01], + [ 4.51521048e-01, 4.90482607e-01, -3.57142857e-01], + [ 3.64632105e-01, 5.58110986e-01, -3.57142857e-01], + [ 2.67796950e-01, 6.10515551e-01, -3.57142857e-01], + [ 5.75377427e-01, 9.60135110e-02, -3.57142857e-01], + [ 5.83333333e-01, 2.55069887e-16, -3.57142857e-01], + [ 5.51726724e-01, 1.89408024e-01, -3.57142857e-01], + [ 5.13026355e-01, 2.77635979e-01, -3.57142857e-01], + [ 4.60331964e-01, 3.58290749e-01, -3.57142857e-01], + [ 3.95080917e-01, 4.29172281e-01, -3.57142857e-01], + [ 3.19053092e-01, 4.88347112e-01, -3.57142857e-01], + [ 2.34322331e-01, 5.34201107e-01, -3.57142857e-01], + [ 4.93180652e-01, 8.22972951e-02, -3.57142857e-01], + [ 5.00000000e-01, 2.26287739e-16, -3.57142857e-01], + [ 4.72908621e-01, 1.62349735e-01, -3.57142857e-01], + [ 4.39736876e-01, 2.37973697e-01, -3.57142857e-01], + [ 3.94570255e-01, 3.07106356e-01, -3.57142857e-01], + [ 3.38640786e-01, 3.67861955e-01, -3.57142857e-01], + [ 2.73474079e-01, 4.18583239e-01, -3.57142857e-01], + [ 2.00847712e-01, 4.57886663e-01, -3.57142857e-01], + [ 2.92606991e-01, 3.16445261e-01, -3.57142857e-01], + [ 3.44188184e-01, 2.67935253e-01, -3.57142857e-01], + [ 2.34867640e-01, 3.58265725e-01, -3.57142857e-01], + [ 1.72155182e-01, 3.92474283e-01, -3.57142857e-01], + [ 2.46573197e-01, 2.65028567e-01, -3.57142857e-01], + [ 2.93806114e-01, 2.28764151e-01, -3.57142857e-01], + [ 1.96261201e-01, 2.97948211e-01, -3.57142857e-01], + [ 1.43462652e-01, 3.27061902e-01, -3.57142857e-01], + [ 2.00539403e-01, 2.13611872e-01, -3.57142857e-01], + [ 2.43424043e-01, 1.89593048e-01, -3.57142857e-01], + [ 1.57654762e-01, 2.37630697e-01, -3.57142857e-01], + [ 1.14770121e-01, 2.61649522e-01, -3.57142857e-01], + [ 8.60775910e-02, 1.96237141e-01, -3.57142857e-01], + [ 1.39074405e-01, 1.78223023e-01, -3.57142857e-01], + [ 5.73850607e-02, 1.30824761e-01, -3.57142857e-01], + [ 1.20494048e-01, 1.18815349e-01, -3.57142857e-01], + [ 2.86925303e-02, 6.54123805e-02, -3.57142857e-01], + [ 1.01913690e-01, 5.94076743e-02, -3.57142857e-01], + [ -6.67803323e-18, 3.62404443e-17, -3.57142857e-01], + [ 8.33333333e-02, 6.76427614e-17, -3.57142857e-01], + [ 1.92071219e-01, 1.60208904e-01, -3.57142857e-01], + [ 1.83603035e-01, 1.06805936e-01, -3.57142857e-01], + [ 1.75134851e-01, 5.34029681e-02, -3.57142857e-01], + [ 1.66666667e-01, 9.94857751e-17, -3.57142857e-01], + [ 2.45068032e-01, 1.42194786e-01, -3.57142857e-01], + [ 2.46712022e-01, 9.47965238e-02, -3.57142857e-01], + [ 2.48356011e-01, 4.73982619e-02, -3.57142857e-01], + [ 2.50000000e-01, 1.31613145e-16, -3.57142857e-01], + [ 3.33333333e-01, 1.63763809e-16, -3.57142857e-01], + [ 3.29964224e-01, 5.90312730e-02, -3.57142857e-01], + [ 4.16666667e-01, 1.95528462e-16, -3.57142857e-01], + [ 4.11572438e-01, 7.06642841e-02, -3.57142857e-01], + [ 3.22110888e-01, 1.17314261e-01, -3.57142857e-01], + [ 3.97509754e-01, 1.39831998e-01, -3.57142857e-01], + [ 3.09957647e-01, 1.74121089e-01, -3.57142857e-01], + [ 3.74847261e-01, 2.06047393e-01, -3.57142857e-01], + [ 2.45485487e-01, 9.69400266e-01, -3.57142857e-01], + [ 2.25028363e-01, 8.88616910e-01, -3.57142857e-01], + [ 8.25793455e-02, 9.96584493e-01, -3.57142857e-01], + [ 7.56977333e-02, 9.13535785e-01, -3.57142857e-01], + [ -8.25793455e-02, 9.96584493e-01, -3.57142857e-01], + [ -7.56977333e-02, 9.13535785e-01, -3.57142857e-01], + [ -2.45485487e-01, 9.69400266e-01, -3.57142857e-01], + [ -2.25028363e-01, 8.88616910e-01, -3.57142857e-01], + [ -4.01695425e-01, 9.15773327e-01, -3.57142857e-01], + [ -3.68220806e-01, 8.39458883e-01, -3.57142857e-01], + [ -5.46948158e-01, 8.37166478e-01, -3.57142857e-01], + [ -5.01369145e-01, 7.67402605e-01, -3.57142857e-01], + [ -6.77281572e-01, 7.35723911e-01, -3.57142857e-01], + [ -6.20841441e-01, 6.74413585e-01, -3.57142857e-01], + [ 2.04571239e-01, 8.07833555e-01, -3.57142857e-01], + [ 6.88161212e-02, 8.30487078e-01, -3.57142857e-01], + [ -6.88161212e-02, 8.30487078e-01, -3.57142857e-01], + [ -2.04571239e-01, 8.07833555e-01, -3.57142857e-01], + [ -3.34746187e-01, 7.63144439e-01, -3.57142857e-01], + [ -4.55790132e-01, 6.97638732e-01, -3.57142857e-01], + [ -5.64401310e-01, 6.13103259e-01, -3.57142857e-01], + [ 1.84114115e-01, 7.27050199e-01, -3.57142857e-01], + [ 6.19345091e-02, 7.47438370e-01, -3.57142857e-01], + [ -6.19345091e-02, 7.47438370e-01, -3.57142857e-01], + [ -1.84114115e-01, 7.27050199e-01, -3.57142857e-01], + [ -3.01271568e-01, 6.86829995e-01, -3.57142857e-01], + [ -4.10211119e-01, 6.27874859e-01, -3.57142857e-01], + [ -5.07961179e-01, 5.51792933e-01, -3.57142857e-01], + [ 1.63656991e-01, 6.46266844e-01, -3.57142857e-01], + [ 5.50528970e-02, 6.64389662e-01, -3.57142857e-01], + [ -5.50528970e-02, 6.64389662e-01, -3.57142857e-01], + [ -1.63656991e-01, 6.46266844e-01, -3.57142857e-01], + [ -2.67796950e-01, 6.10515551e-01, -3.57142857e-01], + [ -3.64632105e-01, 5.58110986e-01, -3.57142857e-01], + [ -4.51521048e-01, 4.90482607e-01, -3.57142857e-01], + [ 1.43199867e-01, 5.65483488e-01, -3.57142857e-01], + [ 4.81712849e-02, 5.81340954e-01, -3.57142857e-01], + [ -4.81712849e-02, 5.81340954e-01, -3.57142857e-01], + [ -1.43199867e-01, 5.65483488e-01, -3.57142857e-01], + [ -2.34322331e-01, 5.34201107e-01, -3.57142857e-01], + [ -3.19053092e-01, 4.88347112e-01, -3.57142857e-01], + [ -3.95080917e-01, 4.29172281e-01, -3.57142857e-01], + [ 1.22742744e-01, 4.84700133e-01, -3.57142857e-01], + [ 4.12896727e-02, 4.98292247e-01, -3.57142857e-01], + [ -4.12896727e-02, 4.98292247e-01, -3.57142857e-01], + [ -1.22742744e-01, 4.84700133e-01, -3.57142857e-01], + [ -2.00847712e-01, 4.57886663e-01, -3.57142857e-01], + [ -2.73474079e-01, 4.18583239e-01, -3.57142857e-01], + [ -3.38640786e-01, 3.67861955e-01, -3.57142857e-01], + [ -1.02283149e-01, 4.15336195e-01, -3.57142857e-01], + [ -3.59859419e-02, 4.34695086e-01, -3.57142857e-01], + [ -1.66348287e-01, 3.87163066e-01, -3.57142857e-01], + [ -2.26761024e-01, 3.50663301e-01, -3.57142857e-01], + [ -2.82200655e-01, 3.06551629e-01, -3.57142857e-01], + [ -8.18235534e-02, 3.45972257e-01, -3.57142857e-01], + [ -3.06822110e-02, 3.71097926e-01, -3.57142857e-01], + [ -1.31848862e-01, 3.16439469e-01, -3.57142857e-01], + [ -1.80047970e-01, 2.82743363e-01, -3.57142857e-01], + [ -2.25760524e-01, 2.45241304e-01, -3.57142857e-01], + [ -6.13639584e-02, 2.76608319e-01, -3.57142857e-01], + [ -2.53784802e-02, 3.07500766e-01, -3.57142857e-01], + [ -9.73494365e-02, 2.45715872e-01, -3.57142857e-01], + [ -1.33334915e-01, 2.14823425e-01, -3.57142857e-01], + [ -1.69320393e-01, 1.83930978e-01, -3.57142857e-01], + [ -1.12880262e-01, 1.22620652e-01, -3.57142857e-01], + [ -7.93257664e-02, 1.65019743e-01, -3.57142857e-01], + [ -5.64401310e-02, 6.13103259e-02, -3.57142857e-01], + [ -2.53166180e-02, 1.15216062e-01, -3.57142857e-01], + [ -4.57712708e-02, 2.07418835e-01, -3.57142857e-01], + [ 5.80689493e-03, 1.69121798e-01, -3.57142857e-01], + [ -1.22167752e-02, 2.49817927e-01, -3.57142857e-01], + [ 3.69304079e-02, 2.23027534e-01, -3.57142857e-01], + [ 2.13377203e-02, 2.92217018e-01, -3.57142857e-01], + [ 6.80539208e-02, 2.76933270e-01, -3.57142857e-01], + [ 8.62835284e-02, 3.46188891e-01, -3.57142857e-01], + [ 1.04513136e-01, 4.15444512e-01, -3.57142857e-01], + [ 2.79883711e-02, 3.60908761e-01, -3.57142857e-01], + [ 3.46390219e-02, 4.29600504e-01, -3.57142857e-01], + [ -7.89140509e-01, 6.14212713e-01, -3.57142857e-01], + [ -7.23378800e-01, 5.63028320e-01, -3.57142857e-01], + [ -8.79473751e-01, 4.75947393e-01, -3.57142857e-01], + [ -8.06184272e-01, 4.36285110e-01, -3.57142857e-01], + [ -9.45817242e-01, 3.24699469e-01, -3.57142857e-01], + [ -8.66999138e-01, 2.97641180e-01, -3.57142857e-01], + [ -9.86361303e-01, 1.64594590e-01, -3.57142857e-01], + [ -9.04164528e-01, 1.50878374e-01, -3.57142857e-01], + [ -1.00000000e+00, -8.74747714e-17, -3.57142857e-01], + [ -9.16666667e-01, -6.01060321e-17, -3.57142857e-01], + [ -9.86361303e-01, -1.64594590e-01, -3.57142857e-01], + [ -9.04164528e-01, -1.50878374e-01, -3.57142857e-01], + [ -6.57617091e-01, 5.11843927e-01, -3.57142857e-01], + [ -7.32894793e-01, 3.96622828e-01, -3.57142857e-01], + [ -7.88181035e-01, 2.70582891e-01, -3.57142857e-01], + [ -8.21967753e-01, 1.37162159e-01, -3.57142857e-01], + [ -8.33333333e-01, -5.17702556e-17, -3.57142857e-01], + [ -8.21967753e-01, -1.37162159e-01, -3.57142857e-01], + [ -5.91855382e-01, 4.60659535e-01, -3.57142857e-01], + [ -6.59605313e-01, 3.56960545e-01, -3.57142857e-01], + [ -7.09362931e-01, 2.43524602e-01, -3.57142857e-01], + [ -7.39770978e-01, 1.23445943e-01, -3.57142857e-01], + [ -7.50000000e-01, -4.47493904e-17, -3.57142857e-01], + [ -7.39770978e-01, -1.23445943e-01, -3.57142857e-01], + [ -5.26093673e-01, 4.09475142e-01, -3.57142857e-01], + [ -5.86315834e-01, 3.17298262e-01, -3.57142857e-01], + [ -6.30544828e-01, 2.16466313e-01, -3.57142857e-01], + [ -6.57574202e-01, 1.09729727e-01, -3.57142857e-01], + [ -6.66666667e-01, -3.80719106e-17, -3.57142857e-01], + [ -6.57574202e-01, -1.09729727e-01, -3.57142857e-01], + [ -4.60331964e-01, 3.58290749e-01, -3.57142857e-01], + [ -5.13026355e-01, 2.77635979e-01, -3.57142857e-01], + [ -5.51726724e-01, 1.89408024e-01, -3.57142857e-01], + [ -5.75377427e-01, 9.60135110e-02, -3.57142857e-01], + [ -5.83333333e-01, -3.11731060e-17, -3.57142857e-01], + [ -5.75377427e-01, -9.60135110e-02, -3.57142857e-01], + [ -3.94570255e-01, 3.07106356e-01, -3.57142857e-01], + [ -4.39736876e-01, 2.37973697e-01, -3.57142857e-01], + [ -4.72908621e-01, 1.62349735e-01, -3.57142857e-01], + [ -4.93180652e-01, 8.22972951e-02, -3.57142857e-01], + [ -5.00000000e-01, -2.37245839e-17, -3.57142857e-01], + [ -4.93180652e-01, -8.22972951e-02, -3.57142857e-01], + [ -4.20156583e-01, 7.22539112e-02, -3.57142857e-01], + [ -4.11228248e-01, 1.41174836e-01, -3.57142857e-01], + [ -4.20116462e-01, 1.83641595e-03, -3.57142857e-01], + [ -4.10983876e-01, -6.85810793e-02, -3.57142857e-01], + [ -3.47132513e-01, 6.22105272e-02, -3.57142857e-01], + [ -3.49547876e-01, 1.19999937e-01, -3.57142857e-01], + [ -3.40232923e-01, 3.67283191e-03, -3.57142857e-01], + [ -3.28787101e-01, -5.48648634e-02, -3.57142857e-01], + [ -2.74108444e-01, 5.21671433e-02, -3.57142857e-01], + [ -2.87867503e-01, 9.88250387e-02, -3.57142857e-01], + [ -2.60349385e-01, 5.50924786e-03, -3.57142857e-01], + [ -2.46590326e-01, -4.11486476e-02, -3.57142857e-01], + [ -1.64393551e-01, -2.74324317e-02, -3.57142857e-01], + [ -1.92379634e-01, 2.41096072e-02, -3.57142857e-01], + [ -8.21967753e-02, -1.37162159e-02, -3.57142857e-01], + [ -1.24409882e-01, 4.27099665e-02, -3.57142857e-01], + [ -2.20365717e-01, 7.56516461e-02, -3.57142857e-01], + [ -1.66622989e-01, 9.91361489e-02, -3.57142857e-01], + [ -2.48351800e-01, 1.27193685e-01, -3.57142857e-01], + [ -2.08836096e-01, 1.55562331e-01, -3.57142857e-01], + [ -2.70747482e-01, 2.06077006e-01, -3.57142857e-01], + [ -3.32658869e-01, 2.56591681e-01, -3.57142857e-01], + [ -3.12146825e-01, 1.64120356e-01, -3.57142857e-01], + [ -3.75941850e-01, 2.01047026e-01, -3.57142857e-01], + [ -9.45817242e-01, -3.24699469e-01, -3.57142857e-01], + [ -8.66999138e-01, -2.97641180e-01, -3.57142857e-01], + [ -8.79473751e-01, -4.75947393e-01, -3.57142857e-01], + [ -8.06184272e-01, -4.36285110e-01, -3.57142857e-01], + [ -7.89140509e-01, -6.14212713e-01, -3.57142857e-01], + [ -7.23378800e-01, -5.63028320e-01, -3.57142857e-01], + [ -6.77281572e-01, -7.35723911e-01, -3.57142857e-01], + [ -6.20841441e-01, -6.74413585e-01, -3.57142857e-01], + [ -5.46948158e-01, -8.37166478e-01, -3.57142857e-01], + [ -5.01369145e-01, -7.67402605e-01, -3.57142857e-01], + [ -4.01695425e-01, -9.15773327e-01, -3.57142857e-01], + [ -3.68220806e-01, -8.39458883e-01, -3.57142857e-01], + [ -7.88181035e-01, -2.70582891e-01, -3.57142857e-01], + [ -7.32894793e-01, -3.96622828e-01, -3.57142857e-01], + [ -6.57617091e-01, -5.11843927e-01, -3.57142857e-01], + [ -5.64401310e-01, -6.13103259e-01, -3.57142857e-01], + [ -4.55790132e-01, -6.97638732e-01, -3.57142857e-01], + [ -3.34746187e-01, -7.63144439e-01, -3.57142857e-01], + [ -7.09362931e-01, -2.43524602e-01, -3.57142857e-01], + [ -6.59605313e-01, -3.56960545e-01, -3.57142857e-01], + [ -5.91855382e-01, -4.60659535e-01, -3.57142857e-01], + [ -5.07961179e-01, -5.51792933e-01, -3.57142857e-01], + [ -4.10211119e-01, -6.27874859e-01, -3.57142857e-01], + [ -3.01271568e-01, -6.86829995e-01, -3.57142857e-01], + [ -6.30544828e-01, -2.16466313e-01, -3.57142857e-01], + [ -5.86315834e-01, -3.17298262e-01, -3.57142857e-01], + [ -5.26093673e-01, -4.09475142e-01, -3.57142857e-01], + [ -4.51521048e-01, -4.90482607e-01, -3.57142857e-01], + [ -3.64632105e-01, -5.58110986e-01, -3.57142857e-01], + [ -2.67796950e-01, -6.10515551e-01, -3.57142857e-01], + [ -5.51726724e-01, -1.89408024e-01, -3.57142857e-01], + [ -5.13026355e-01, -2.77635979e-01, -3.57142857e-01], + [ -4.60331964e-01, -3.58290749e-01, -3.57142857e-01], + [ -3.95080917e-01, -4.29172281e-01, -3.57142857e-01], + [ -3.19053092e-01, -4.88347112e-01, -3.57142857e-01], + [ -2.34322331e-01, -5.34201107e-01, -3.57142857e-01], + [ -4.72908621e-01, -1.62349735e-01, -3.57142857e-01], + [ -4.39736876e-01, -2.37973697e-01, -3.57142857e-01], + [ -3.94570255e-01, -3.07106356e-01, -3.57142857e-01], + [ -3.38640786e-01, -3.67861955e-01, -3.57142857e-01], + [ -2.73474079e-01, -4.18583239e-01, -3.57142857e-01], + [ -2.00847712e-01, -4.57886663e-01, -3.57142857e-01], + [ -2.90292421e-01, -3.12221863e-01, -3.57142857e-01], + [ -3.43107373e-01, -2.67051188e-01, -3.57142857e-01], + [ -2.31319311e-01, -3.50702994e-01, -3.57142857e-01], + [ -1.67373094e-01, -3.81572219e-01, -3.57142857e-01], + [ -2.41944057e-01, -2.56581770e-01, -3.57142857e-01], + [ -2.91644492e-01, -2.26996019e-01, -3.57142857e-01], + [ -1.89164543e-01, -2.82822750e-01, -3.57142857e-01], + [ -1.33898475e-01, -3.05257776e-01, -3.57142857e-01], + [ -1.93595692e-01, -2.00941678e-01, -3.57142857e-01], + [ -2.40181610e-01, -1.86940851e-01, -3.57142857e-01], + [ -1.47009774e-01, -2.14942505e-01, -3.57142857e-01], + [ -1.00423856e-01, -2.28943332e-01, -3.57142857e-01], + [ -6.69492374e-02, -1.52628888e-01, -3.57142857e-01], + [ -1.25405441e-01, -1.47867075e-01, -3.57142857e-01], + [ -3.34746187e-02, -7.63144439e-02, -3.57142857e-01], + [ -1.03801108e-01, -8.07916455e-02, -3.57142857e-01], + [ -1.83861645e-01, -1.43105263e-01, -3.57142857e-01], + [ -1.74127598e-01, -8.52688471e-02, -3.57142857e-01], + [ -2.42317849e-01, -1.38343450e-01, -3.57142857e-01], + [ -2.44454087e-01, -8.97460487e-02, -3.57142857e-01], + [ -3.20605599e-01, -1.13947277e-01, -3.57142857e-01], + [ -3.96757110e-01, -1.38148506e-01, -3.57142857e-01], + [ -3.08124191e-01, -1.71553532e-01, -3.57142857e-01], + [ -3.73930533e-01, -2.04763614e-01, -3.57142857e-01], + [ -2.45485487e-01, -9.69400266e-01, -3.57142857e-01], + [ -2.25028363e-01, -8.88616910e-01, -3.57142857e-01], + [ -8.25793455e-02, -9.96584493e-01, -3.57142857e-01], + [ -7.56977333e-02, -9.13535785e-01, -3.57142857e-01], + [ 8.25793455e-02, -9.96584493e-01, -3.57142857e-01], + [ 7.56977333e-02, -9.13535785e-01, -3.57142857e-01], + [ 2.45485487e-01, -9.69400266e-01, -3.57142857e-01], + [ 2.25028363e-01, -8.88616910e-01, -3.57142857e-01], + [ 4.01695425e-01, -9.15773327e-01, -3.57142857e-01], + [ 3.68220806e-01, -8.39458883e-01, -3.57142857e-01], + [ 5.46948158e-01, -8.37166478e-01, -3.57142857e-01], + [ 5.01369145e-01, -7.67402605e-01, -3.57142857e-01], + [ -2.04571239e-01, -8.07833555e-01, -3.57142857e-01], + [ -6.88161212e-02, -8.30487078e-01, -3.57142857e-01], + [ 6.88161212e-02, -8.30487078e-01, -3.57142857e-01], + [ 2.04571239e-01, -8.07833555e-01, -3.57142857e-01], + [ 3.34746187e-01, -7.63144439e-01, -3.57142857e-01], + [ 4.55790132e-01, -6.97638732e-01, -3.57142857e-01], + [ -1.84114115e-01, -7.27050199e-01, -3.57142857e-01], + [ -6.19345091e-02, -7.47438370e-01, -3.57142857e-01], + [ 6.19345091e-02, -7.47438370e-01, -3.57142857e-01], + [ 1.84114115e-01, -7.27050199e-01, -3.57142857e-01], + [ 3.01271568e-01, -6.86829995e-01, -3.57142857e-01], + [ 4.10211119e-01, -6.27874859e-01, -3.57142857e-01], + [ -1.63656991e-01, -6.46266844e-01, -3.57142857e-01], + [ -5.50528970e-02, -6.64389662e-01, -3.57142857e-01], + [ 5.50528970e-02, -6.64389662e-01, -3.57142857e-01], + [ 1.63656991e-01, -6.46266844e-01, -3.57142857e-01], + [ 2.67796950e-01, -6.10515551e-01, -3.57142857e-01], + [ 3.64632105e-01, -5.58110986e-01, -3.57142857e-01], + [ -1.43199867e-01, -5.65483488e-01, -3.57142857e-01], + [ -4.81712849e-02, -5.81340954e-01, -3.57142857e-01], + [ 4.81712849e-02, -5.81340954e-01, -3.57142857e-01], + [ 1.43199867e-01, -5.65483488e-01, -3.57142857e-01], + [ 2.34322331e-01, -5.34201107e-01, -3.57142857e-01], + [ 3.19053092e-01, -4.88347112e-01, -3.57142857e-01], + [ -1.22742744e-01, -4.84700133e-01, -3.57142857e-01], + [ -4.12896727e-02, -4.98292247e-01, -3.57142857e-01], + [ 4.12896727e-02, -4.98292247e-01, -3.57142857e-01], + [ 1.22742744e-01, -4.84700133e-01, -3.57142857e-01], + [ 2.00847712e-01, -4.57886663e-01, -3.57142857e-01], + [ 2.73474079e-01, -4.18583239e-01, -3.57142857e-01], + [ 1.02606772e-01, -4.13792257e-01, -3.57142857e-01], + [ 3.59043567e-02, -4.33301147e-01, -3.57142857e-01], + [ 1.67077120e-01, -3.85469130e-01, -3.57142857e-01], + [ 2.27895066e-01, -3.48819366e-01, -3.57142857e-01], + [ 8.24708009e-02, -3.42884381e-01, -3.57142857e-01], + [ 3.05190406e-02, -3.68310047e-01, -3.57142857e-01], + [ 1.33306527e-01, -3.13051596e-01, -3.57142857e-01], + [ 1.82316053e-01, -2.79055493e-01, -3.57142857e-01], + [ 6.23348295e-02, -2.71976505e-01, -3.57142857e-01], + [ 2.51337245e-02, -3.03318947e-01, -3.57142857e-01], + [ 9.95359345e-02, -2.40634062e-01, -3.57142857e-01], + [ 1.36737040e-01, -2.09291620e-01, -3.57142857e-01], + [ 9.11580264e-02, -1.39527746e-01, -3.57142857e-01], + [ 5.51990834e-02, -1.85860856e-01, -3.57142857e-01], + [ 4.55790132e-02, -6.97638732e-02, -3.57142857e-01], + [ 1.08622324e-02, -1.31087650e-01, -3.57142857e-01], + [ 1.92401405e-02, -2.32193966e-01, -3.57142857e-01], + [ -2.38545485e-02, -1.92411427e-01, -3.57142857e-01], + [ -1.67188024e-02, -2.78527075e-01, -3.57142857e-01], + [ -5.85713293e-02, -2.53735203e-01, -3.57142857e-01], + [ -7.99618007e-02, -3.30723513e-01, -3.57142857e-01], + [ -1.01352272e-01, -4.07711823e-01, -3.57142857e-01], + [ -2.49090925e-02, -3.51782132e-01, -3.57142857e-01], + [ -3.30993826e-02, -4.25037189e-01, -3.57142857e-01], + [ 6.77281572e-01, -7.35723911e-01, -3.57142857e-01], + [ 6.20841441e-01, -6.74413585e-01, -3.57142857e-01], + [ 7.89140509e-01, -6.14212713e-01, -3.57142857e-01], + [ 7.23378800e-01, -5.63028320e-01, -3.57142857e-01], + [ 8.79473751e-01, -4.75947393e-01, -3.57142857e-01], + [ 8.06184272e-01, -4.36285110e-01, -3.57142857e-01], + [ 9.45817242e-01, -3.24699469e-01, -3.57142857e-01], + [ 8.66999138e-01, -2.97641180e-01, -3.57142857e-01], + [ 9.86361303e-01, -1.64594590e-01, -3.57142857e-01], + [ 9.04164528e-01, -1.50878374e-01, -3.57142857e-01], + [ 5.64401310e-01, -6.13103259e-01, -3.57142857e-01], + [ 6.57617091e-01, -5.11843927e-01, -3.57142857e-01], + [ 7.32894793e-01, -3.96622828e-01, -3.57142857e-01], + [ 7.88181035e-01, -2.70582891e-01, -3.57142857e-01], + [ 8.21967753e-01, -1.37162159e-01, -3.57142857e-01], + [ 5.07961179e-01, -5.51792933e-01, -3.57142857e-01], + [ 5.91855382e-01, -4.60659535e-01, -3.57142857e-01], + [ 6.59605313e-01, -3.56960545e-01, -3.57142857e-01], + [ 7.09362931e-01, -2.43524602e-01, -3.57142857e-01], + [ 7.39770978e-01, -1.23445943e-01, -3.57142857e-01], + [ 4.51521048e-01, -4.90482607e-01, -3.57142857e-01], + [ 5.26093673e-01, -4.09475142e-01, -3.57142857e-01], + [ 5.86315834e-01, -3.17298262e-01, -3.57142857e-01], + [ 6.30544828e-01, -2.16466313e-01, -3.57142857e-01], + [ 6.57574202e-01, -1.09729727e-01, -3.57142857e-01], + [ 3.95080917e-01, -4.29172281e-01, -3.57142857e-01], + [ 4.60331964e-01, -3.58290749e-01, -3.57142857e-01], + [ 5.13026355e-01, -2.77635979e-01, -3.57142857e-01], + [ 5.51726724e-01, -1.89408024e-01, -3.57142857e-01], + [ 5.75377427e-01, -9.60135110e-02, -3.57142857e-01], + [ 3.38640786e-01, -3.67861955e-01, -3.57142857e-01], + [ 3.94570255e-01, -3.07106356e-01, -3.57142857e-01], + [ 4.39736876e-01, -2.37973697e-01, -3.57142857e-01], + [ 4.72908621e-01, -1.62349735e-01, -3.57142857e-01], + [ 4.93180652e-01, -8.22972951e-02, -3.57142857e-01], + [ 4.02533591e-01, -1.40423963e-01, -3.57142857e-01], + [ 3.82383017e-01, -2.06935340e-01, -3.57142857e-01], + [ 4.14084357e-01, -7.09602665e-02, -3.57142857e-01], + [ 3.32158562e-01, -1.18498191e-01, -3.57142857e-01], + [ 3.25029158e-01, -1.75896984e-01, -3.57142857e-01], + [ 3.34988061e-01, -5.96232379e-02, -3.57142857e-01], + [ 2.61783533e-01, -9.65724185e-02, -3.57142857e-01], + [ 2.67675299e-01, -1.44858628e-01, -3.57142857e-01], + [ 2.55891766e-01, -4.82862093e-02, -3.57142857e-01], + [ 1.85787515e-01, -5.54454306e-02, -3.57142857e-01], + [ 1.15683264e-01, -6.26046519e-02, -3.57142857e-01], + [ 2.04908364e-01, -1.10890861e-01, -3.57142857e-01], + [ 1.48033195e-01, -1.25209304e-01, -3.57142857e-01], + [ 2.24029213e-01, -1.66336292e-01, -3.57142857e-01], + [ 1.80383126e-01, -1.87813956e-01, -3.57142857e-01], + [ 2.33135679e-01, -2.47829956e-01, -3.57142857e-01], + [ 2.85888233e-01, -3.07845955e-01, -3.57142857e-01], + [ 2.80876227e-01, -2.13259647e-01, -3.57142857e-01], + [ 3.37723241e-01, -2.60183001e-01, -3.57142857e-01], + [ 1.00000000e+00, 0.00000000e+00, -5.00000000e-01], + [ 9.86361303e-01, 1.64594590e-01, -5.00000000e-01], + [ 8.85385799e-01, 1.47859195e-01, -5.00000000e-01], + [ 8.98367845e-01, 5.09955106e-05, -5.00000000e-01], + [ 9.45817242e-01, 3.24699469e-01, -5.00000000e-01], + [ 8.50003984e-01, 2.91939989e-01, -5.00000000e-01], + [ 8.79473751e-01, 4.75947393e-01, -5.00000000e-01], + [ 7.90244661e-01, 4.27798478e-01, -5.00000000e-01], + [ 7.89140509e-01, 6.14212713e-01, -5.00000000e-01], + [ 7.09163527e-01, 5.52078099e-01, -5.00000000e-01], + [ 6.77281572e-01, 7.35723911e-01, -5.00000000e-01], + [ 6.10767838e-01, 6.63497160e-01, -5.00000000e-01], + [ 5.46948158e-01, 8.37166478e-01, -5.00000000e-01], + [ 4.93229607e-01, 7.54957609e-01, -5.00000000e-01], + [ 4.01695425e-01, 9.15773327e-01, -5.00000000e-01], + [ 3.62235106e-01, 8.25828858e-01, -5.00000000e-01], + [ 7.94125993e-01, 1.32740732e-01, -5.00000000e-01], + [ 8.00800813e-01, 1.88651800e-04, -5.00000000e-01], + [ 7.57532995e-01, 2.60531900e-01, -5.00000000e-01], + [ 7.05311522e-01, 3.82151873e-01, -5.00000000e-01], + [ 6.33176967e-01, 4.93188206e-01, -5.00000000e-01], + [ 5.44359740e-01, 5.91554707e-01, -5.00000000e-01], + [ 4.39850704e-01, 6.73367897e-01, -5.00000000e-01], + [ 3.23078188e-01, 7.36661594e-01, -5.00000000e-01], + [ 7.01128052e-01, 1.17677998e-01, -5.00000000e-01], + [ 7.11649572e-01, 3.33951524e-04, -5.00000000e-01], + [ 6.72966890e-01, 2.31894729e-01, -5.00000000e-01], + [ 6.25669634e-01, 3.39513212e-01, -5.00000000e-01], + [ 5.64027416e-01, 4.39616287e-01, -5.00000000e-01], + [ 4.84508482e-01, 5.26668700e-01, -5.00000000e-01], + [ 3.91560912e-01, 5.99504467e-01, -5.00000000e-01], + [ 2.87602059e-01, 6.55840087e-01, -5.00000000e-01], + [ 6.17706136e-01, 1.04228490e-01, -5.00000000e-01], + [ 6.24422079e-01, 6.32285718e-04, -5.00000000e-01], + [ 5.91740630e-01, 2.04740807e-01, -5.00000000e-01], + [ 5.53662436e-01, 3.01062778e-01, -5.00000000e-01], + [ 4.96990333e-01, 3.87922085e-01, -5.00000000e-01], + [ 4.26905739e-01, 4.64324206e-01, -5.00000000e-01], + [ 3.44867105e-01, 5.28103963e-01, -5.00000000e-01], + [ 2.53361833e-01, 5.77868140e-01, -5.00000000e-01], + [ 5.38389125e-01, 9.17206205e-02, -5.00000000e-01], + [ 5.45454368e-01, 8.70266955e-04, -5.00000000e-01], + [ 5.17997560e-01, 1.80324497e-01, -5.00000000e-01], + [ 4.84931719e-01, 2.64732797e-01, -5.00000000e-01], + [ 4.36383812e-01, 3.41220989e-01, -5.00000000e-01], + [ 3.74978458e-01, 4.07950157e-01, -5.00000000e-01], + [ 3.02772277e-01, 4.63502415e-01, -5.00000000e-01], + [ 2.22468936e-01, 5.07437291e-01, -5.00000000e-01], + [ 4.64471094e-01, 8.04373661e-02, -5.00000000e-01], + [ 4.73417894e-01, 1.03377535e-03, -5.00000000e-01], + [ 4.49550108e-01, 1.58190845e-01, -5.00000000e-01], + [ 4.20123744e-01, 2.31037319e-01, -5.00000000e-01], + [ 3.77857876e-01, 2.96451484e-01, -5.00000000e-01], + [ 3.26056063e-01, 3.54556465e-01, -5.00000000e-01], + [ 2.63231766e-01, 4.02405818e-01, -5.00000000e-01], + [ 1.93502599e-01, 4.41318122e-01, -5.00000000e-01], + [ 2.80697996e-01, 3.04138803e-01, -5.00000000e-01], + [ 3.26828978e-01, 2.57477836e-01, -5.00000000e-01], + [ 2.27278087e-01, 3.45852853e-01, -5.00000000e-01], + [ 1.66385745e-01, 3.79356622e-01, -5.00000000e-01], + [ 2.41953376e-01, 2.58408137e-01, -5.00000000e-01], + [ 2.80636530e-01, 2.22682050e-01, -5.00000000e-01], + [ 1.94021253e-01, 2.91186055e-01, -5.00000000e-01], + [ 1.39733872e-01, 3.17911899e-01, -5.00000000e-01], + [ 2.12482604e-01, 2.15267429e-01, -5.00000000e-01], + [ 2.47964916e-01, 2.00029985e-01, -5.00000000e-01], + [ 1.65163116e-01, 2.36189539e-01, -5.00000000e-01], + [ 1.14601980e-01, 2.59689793e-01, -5.00000000e-01], + [ 8.97246141e-02, 2.03521438e-01, -5.00000000e-01], + [ 1.45294294e-01, 1.83523348e-01, -5.00000000e-01], + [ 6.53411100e-02, 1.48104882e-01, -5.00000000e-01], + [ 1.29690654e-01, 1.28069210e-01, -5.00000000e-01], + [ 3.66825649e-02, 8.40224902e-02, -5.00000000e-01], + [ 1.15178059e-01, 6.50962363e-02, -5.00000000e-01], + [ -6.90931371e-03, -1.43821650e-02, -5.00000000e-01], + [ 1.13891956e-01, -7.46169753e-03, -5.00000000e-01], + [ 2.00104806e-01, 1.68875989e-01, -5.00000000e-01], + [ 1.92634871e-01, 1.16656531e-01, -5.00000000e-01], + [ 1.88903990e-01, 5.89872913e-02, -5.00000000e-01], + [ 1.90411041e-01, -2.07447445e-03, -5.00000000e-01], + [ 2.50775614e-01, 1.62140475e-01, -5.00000000e-01], + [ 2.53396140e-01, 1.13391119e-01, -5.00000000e-01], + [ 2.55727085e-01, 5.80397186e-02, -5.00000000e-01], + [ 2.60266073e-01, 6.10581640e-04, -5.00000000e-01], + [ 3.30524944e-01, 1.08041301e-03, -5.00000000e-01], + [ 3.24967172e-01, 6.21259202e-02, -5.00000000e-01], + [ 4.00230719e-01, 1.27521573e-03, -5.00000000e-01], + [ 3.95498789e-01, 7.04582546e-02, -5.00000000e-01], + [ 3.15952931e-01, 1.20992370e-01, -5.00000000e-01], + [ 3.81156850e-01, 1.37671789e-01, -5.00000000e-01], + [ 3.01812446e-01, 1.76311672e-01, -5.00000000e-01], + [ 3.60992327e-01, 2.01144550e-01, -5.00000000e-01], + [ 2.45485487e-01, 9.69400266e-01, -5.00000000e-01], + [ 2.21362099e-01, 8.74184899e-01, -5.00000000e-01], + [ 8.25793455e-02, 9.96584493e-01, -5.00000000e-01], + [ 7.44564944e-02, 8.98711097e-01, -5.00000000e-01], + [ -8.25793455e-02, 9.96584493e-01, -5.00000000e-01], + [ -7.44723590e-02, 8.98720257e-01, -5.00000000e-01], + [ -2.45485487e-01, 9.69400266e-01, -5.00000000e-01], + [ -2.20691802e-01, 8.71719923e-01, -5.00000000e-01], + [ -4.01695425e-01, 9.15773327e-01, -5.00000000e-01], + [ -3.60903765e-01, 8.22973696e-01, -5.00000000e-01], + [ -5.46948158e-01, 8.37166478e-01, -5.00000000e-01], + [ -4.91337090e-01, 7.52168583e-01, -5.00000000e-01], + [ -6.77281572e-01, 7.35723911e-01, -5.00000000e-01], + [ -6.08422426e-01, 6.60965795e-01, -5.00000000e-01], + [ 1.97440834e-01, 7.79839076e-01, -5.00000000e-01], + [ 6.64059355e-02, 8.01246618e-01, -5.00000000e-01], + [ -6.62645469e-02, 8.01029588e-01, -5.00000000e-01], + [ -1.96854349e-01, 7.78286921e-01, -5.00000000e-01], + [ -3.21946321e-01, 7.34659580e-01, -5.00000000e-01], + [ -4.36798391e-01, 6.69120390e-01, -5.00000000e-01], + [ -5.40612618e-01, 5.87506757e-01, -5.00000000e-01], + [ 1.75775694e-01, 6.94385920e-01, -5.00000000e-01], + [ 5.91673686e-02, 7.13777718e-01, -5.00000000e-01], + [ -5.88119880e-02, 7.12616793e-01, -5.00000000e-01], + [ -1.74101170e-01, 6.89878982e-01, -5.00000000e-01], + [ -2.84169826e-01, 6.49644503e-01, -5.00000000e-01], + [ -3.86858078e-01, 5.93199666e-01, -5.00000000e-01], + [ -4.79144350e-01, 5.20924297e-01, -5.00000000e-01], + [ 1.54837478e-01, 6.11910244e-01, -5.00000000e-01], + [ 5.21907761e-02, 6.29193467e-01, -5.00000000e-01], + [ -5.12184367e-02, 6.25994011e-01, -5.00000000e-01], + [ -1.53060733e-01, 6.08704209e-01, -5.00000000e-01], + [ -2.50417746e-01, 5.73884869e-01, -5.00000000e-01], + [ -3.39314709e-01, 5.21301649e-01, -5.00000000e-01], + [ -4.20125339e-01, 4.57152827e-01, -5.00000000e-01], + [ 1.35887547e-01, 5.37522969e-01, -5.00000000e-01], + [ 4.57175793e-02, 5.49353160e-01, -5.00000000e-01], + [ -4.41750548e-02, 5.47282691e-01, -5.00000000e-01], + [ -1.32346943e-01, 5.31088099e-01, -5.00000000e-01], + [ -2.17069383e-01, 5.00276789e-01, -5.00000000e-01], + [ -2.95441098e-01, 4.55297464e-01, -5.00000000e-01], + [ -3.66529630e-01, 3.99203743e-01, -5.00000000e-01], + [ 1.17538501e-01, 4.65928006e-01, -5.00000000e-01], + [ 3.96664619e-02, 4.79172226e-01, -5.00000000e-01], + [ -3.75472975e-02, 4.75808900e-01, -5.00000000e-01], + [ -1.13238534e-01, 4.61485351e-01, -5.00000000e-01], + [ -1.87421164e-01, 4.35519238e-01, -5.00000000e-01], + [ -2.54075366e-01, 3.93685438e-01, -5.00000000e-01], + [ -3.15875504e-01, 3.44415828e-01, -5.00000000e-01], + [ -9.42722138e-02, 3.97659750e-01, -5.00000000e-01], + [ -3.16082042e-02, 4.12808353e-01, -5.00000000e-01], + [ -1.57313402e-01, 3.72682840e-01, -5.00000000e-01], + [ -2.13902082e-01, 3.35146284e-01, -5.00000000e-01], + [ -2.67798778e-01, 2.92234617e-01, -5.00000000e-01], + [ -7.38121164e-02, 3.40587375e-01, -5.00000000e-01], + [ -2.54537279e-02, 3.56949863e-01, -5.00000000e-01], + [ -1.23885635e-01, 3.12926202e-01, -5.00000000e-01], + [ -1.73736614e-01, 2.79179204e-01, -5.00000000e-01], + [ -2.22166180e-01, 2.41993646e-01, -5.00000000e-01], + [ -4.95025577e-02, 2.94314076e-01, -5.00000000e-01], + [ -1.98454920e-02, 3.18279461e-01, -5.00000000e-01], + [ -8.72841201e-02, 2.62569352e-01, -5.00000000e-01], + [ -1.29852384e-01, 2.26256159e-01, -5.00000000e-01], + [ -1.74652198e-01, 1.90687531e-01, -5.00000000e-01], + [ -1.29778666e-01, 1.38814436e-01, -5.00000000e-01], + [ -8.36228415e-02, 1.77780710e-01, -5.00000000e-01], + [ -8.16435423e-02, 7.97110013e-02, -5.00000000e-01], + [ -3.02608410e-02, 1.29131270e-01, -5.00000000e-01], + [ -4.40670309e-02, 2.18498201e-01, -5.00000000e-01], + [ 7.24710626e-03, 1.80262002e-01, -5.00000000e-01], + [ -1.03471103e-02, 2.62032046e-01, -5.00000000e-01], + [ 3.73861516e-02, 2.31491239e-01, -5.00000000e-01], + [ 1.54198095e-02, 3.03574443e-01, -5.00000000e-01], + [ 6.32129499e-02, 2.82903258e-01, -5.00000000e-01], + [ 8.26525900e-02, 3.39405613e-01, -5.00000000e-01], + [ 1.00909910e-01, 4.03015805e-01, -5.00000000e-01], + [ 2.64893934e-02, 3.53483382e-01, -5.00000000e-01], + [ 3.36435314e-02, 4.12308571e-01, -5.00000000e-01], + [ -7.89140509e-01, 6.14212713e-01, -5.00000000e-01], + [ -7.08964474e-01, 5.51797869e-01, -5.00000000e-01], + [ -8.79473751e-01, 4.75947393e-01, -5.00000000e-01], + [ -7.90197698e-01, 4.27606295e-01, -5.00000000e-01], + [ -9.45817242e-01, 3.24699469e-01, -5.00000000e-01], + [ -8.49856882e-01, 2.91743625e-01, -5.00000000e-01], + [ -9.86361303e-01, 1.64594590e-01, -5.00000000e-01], + [ -8.86275569e-01, 1.47901385e-01, -5.00000000e-01], + [ -1.00000000e+00, -1.22464680e-16, -5.00000000e-01], + [ -8.98473805e-01, 1.15381832e-05, -5.00000000e-01], + [ -9.86361303e-01, -1.64594590e-01, -5.00000000e-01], + [ -8.86174824e-01, -1.47883246e-01, -5.00000000e-01], + [ -6.30001456e-01, 4.90383785e-01, -5.00000000e-01], + [ -7.02273443e-01, 3.80015358e-01, -5.00000000e-01], + [ -7.55313724e-01, 2.59296912e-01, -5.00000000e-01], + [ -7.87658470e-01, 1.31485016e-01, -5.00000000e-01], + [ -7.98470908e-01, 4.55107425e-05, -5.00000000e-01], + [ -7.87494160e-01, -1.31426735e-01, -5.00000000e-01], + [ -5.58627682e-01, 4.34835928e-01, -5.00000000e-01], + [ -6.22870183e-01, 3.37003542e-01, -5.00000000e-01], + [ -6.69946331e-01, 2.29998633e-01, -5.00000000e-01], + [ -6.98601469e-01, 1.16688217e-01, -5.00000000e-01], + [ -7.08116470e-01, 1.05809214e-04, -5.00000000e-01], + [ -6.98261773e-01, -1.16539499e-01, -5.00000000e-01], + [ -4.90039236e-01, 3.81447281e-01, -5.00000000e-01], + [ -5.46674699e-01, 2.95688707e-01, -5.00000000e-01], + [ -5.88083370e-01, 2.01927138e-01, -5.00000000e-01], + [ -6.13127891e-01, 1.02579208e-01, -5.00000000e-01], + [ -6.21326911e-01, 2.49679885e-04, -5.00000000e-01], + [ -6.12659159e-01, -1.02238675e-01, -5.00000000e-01], + [ -4.28201630e-01, 3.33102542e-01, -5.00000000e-01], + [ -4.78292897e-01, 2.58422199e-01, -5.00000000e-01], + [ -5.14588632e-01, 1.76707278e-01, -5.00000000e-01], + [ -5.36209382e-01, 9.00148497e-02, -5.00000000e-01], + [ -5.43295990e-01, 5.06463641e-04, -5.00000000e-01], + [ -5.35354600e-01, -8.93132854e-02, -5.00000000e-01], + [ -3.70108778e-01, 2.87293073e-01, -5.00000000e-01], + [ -4.14823967e-01, 2.23456652e-01, -5.00000000e-01], + [ -4.46176995e-01, 1.53226227e-01, -5.00000000e-01], + [ -4.64366203e-01, 7.86053306e-02, -5.00000000e-01], + [ -4.70979406e-01, 1.02297782e-03, -5.00000000e-01], + [ -4.62590465e-01, -7.71173269e-02, -5.00000000e-01], + [ -3.98997832e-01, 6.89882561e-02, -5.00000000e-01], + [ -3.84007718e-01, 1.31869003e-01, -5.00000000e-01], + [ -4.02767806e-01, 2.14475434e-03, -5.00000000e-01], + [ -3.93927304e-01, -6.55498719e-02, -5.00000000e-01], + [ -3.37106322e-01, 6.21262340e-02, -5.00000000e-01], + [ -3.30209654e-01, 1.13360219e-01, -5.00000000e-01], + [ -3.35031657e-01, 5.42266022e-03, -5.00000000e-01], + [ -3.27721161e-01, -5.42580733e-02, -5.00000000e-01], + [ -2.83447084e-01, 6.21745720e-02, -5.00000000e-01], + [ -2.92001062e-01, 1.00268454e-01, -5.00000000e-01], + [ -2.73720464e-01, 1.23812993e-02, -5.00000000e-01], + [ -2.63751777e-01, -4.33840760e-02, -5.00000000e-01], + [ -1.98646355e-01, -3.27574407e-02, -5.00000000e-01], + [ -2.13311244e-01, 2.71005688e-02, -5.00000000e-01], + [ -1.25363626e-01, -2.31240997e-02, -5.00000000e-01], + [ -1.50402001e-01, 4.80422198e-02, -5.00000000e-01], + [ -2.35376990e-01, 8.01922238e-02, -5.00000000e-01], + [ -1.81647343e-01, 1.06212482e-01, -5.00000000e-01], + [ -2.61648693e-01, 1.25022130e-01, -5.00000000e-01], + [ -2.20441300e-01, 1.56334892e-01, -5.00000000e-01], + [ -2.65822474e-01, 2.01206908e-01, -5.00000000e-01], + [ -3.15933525e-01, 2.43651325e-01, -5.00000000e-01], + [ -3.03727391e-01, 1.58021732e-01, -5.00000000e-01], + [ -3.58146942e-01, 1.91331513e-01, -5.00000000e-01], + [ -9.45817242e-01, -3.24699469e-01, -5.00000000e-01], + [ -8.49758028e-01, -2.91753303e-01, -5.00000000e-01], + [ -8.79473751e-01, -4.75947393e-01, -5.00000000e-01], + [ -7.90200242e-01, -4.27674318e-01, -5.00000000e-01], + [ -7.89140509e-01, -6.14212713e-01, -5.00000000e-01], + [ -7.09077565e-01, -5.51918815e-01, -5.00000000e-01], + [ -6.77281572e-01, -7.35723911e-01, -5.00000000e-01], + [ -6.08569412e-01, -6.61074211e-01, -5.00000000e-01], + [ -5.46948158e-01, -8.37166478e-01, -5.00000000e-01], + [ -4.91428805e-01, -7.52168929e-01, -5.00000000e-01], + [ -4.01695425e-01, -9.15773327e-01, -5.00000000e-01], + [ -3.60888838e-01, -8.22761670e-01, -5.00000000e-01], + [ -7.55188846e-01, -2.59345642e-01, -5.00000000e-01], + [ -7.02337606e-01, -3.80192065e-01, -5.00000000e-01], + [ -6.32857312e-01, -4.92618433e-01, -5.00000000e-01], + [ -5.43151014e-01, -5.89986003e-01, -5.00000000e-01], + [ -4.37118826e-01, -6.68993686e-01, -5.00000000e-01], + [ -3.20766354e-01, -7.31326287e-01, -5.00000000e-01], + [ -6.69734997e-01, -2.30080512e-01, -5.00000000e-01], + [ -6.22993936e-01, -3.37335567e-01, -5.00000000e-01], + [ -5.59194551e-01, -4.35298937e-01, -5.00000000e-01], + [ -4.79828309e-01, -5.21111684e-01, -5.00000000e-01], + [ -3.87501919e-01, -5.92949943e-01, -5.00000000e-01], + [ -2.84426825e-01, -6.48495027e-01, -5.00000000e-01], + [ -5.87684351e-01, -2.02039854e-01, -5.00000000e-01], + [ -5.46979032e-01, -2.96347299e-01, -5.00000000e-01], + [ -4.93900401e-01, -3.84490387e-01, -5.00000000e-01], + [ -4.23918729e-01, -4.60219985e-01, -5.00000000e-01], + [ -3.40561104e-01, -5.20838061e-01, -5.00000000e-01], + [ -2.49643040e-01, -5.69140160e-01, -5.00000000e-01], + [ -5.13658677e-01, -1.76864123e-01, -5.00000000e-01], + [ -4.78660176e-01, -2.59652919e-01, -5.00000000e-01], + [ -4.29973501e-01, -3.34721367e-01, -5.00000000e-01], + [ -3.69196403e-01, -4.00374180e-01, -5.00000000e-01], + [ -2.97634891e-01, -4.54622635e-01, -5.00000000e-01], + [ -2.18156550e-01, -4.97266712e-01, -5.00000000e-01], + [ -4.43955972e-01, -1.53433052e-01, -5.00000000e-01], + [ -4.14976040e-01, -2.25780487e-01, -5.00000000e-01], + [ -3.73212995e-01, -2.90523705e-01, -5.00000000e-01], + [ -3.21264722e-01, -3.47542486e-01, -5.00000000e-01], + [ -2.57973317e-01, -3.92813300e-01, -5.00000000e-01], + [ -1.88659023e-01, -4.29830508e-01, -5.00000000e-01], + [ -2.76959851e-01, -2.97681175e-01, -5.00000000e-01], + [ -3.22068080e-01, -2.50675254e-01, -5.00000000e-01], + [ -2.21359240e-01, -3.34292006e-01, -5.00000000e-01], + [ -1.61403511e-01, -3.67396927e-01, -5.00000000e-01], + [ -2.36755182e-01, -2.48291400e-01, -5.00000000e-01], + [ -2.76170203e-01, -2.14736566e-01, -5.00000000e-01], + [ -1.88145259e-01, -2.77458362e-01, -5.00000000e-01], + [ -1.33977883e-01, -3.03968290e-01, -5.00000000e-01], + [ -2.07536544e-01, -2.03087349e-01, -5.00000000e-01], + [ -2.44322863e-01, -1.89623778e-01, -5.00000000e-01], + [ -1.60891409e-01, -2.22173809e-01, -5.00000000e-01], + [ -1.08132613e-01, -2.43259688e-01, -5.00000000e-01], + [ -8.28302097e-02, -1.83773619e-01, -5.00000000e-01], + [ -1.41840587e-01, -1.63689740e-01, -5.00000000e-01], + [ -5.28309761e-02, -1.16741673e-01, -5.00000000e-01], + [ -1.27483869e-01, -9.76683493e-02, -5.00000000e-01], + [ -1.97979852e-01, -1.52716684e-01, -5.00000000e-01], + [ -1.94512087e-01, -9.49401261e-02, -5.00000000e-01], + [ -2.49063661e-01, -1.50709568e-01, -5.00000000e-01], + [ -2.55937772e-01, -1.00112636e-01, -5.00000000e-01], + [ -3.15961679e-01, -1.13123573e-01, -5.00000000e-01], + [ -3.78395823e-01, -1.32030107e-01, -5.00000000e-01], + [ -2.99920321e-01, -1.68386817e-01, -5.00000000e-01], + [ -3.56808685e-01, -1.95651482e-01, -5.00000000e-01], + [ -2.45485487e-01, -9.69400266e-01, -5.00000000e-01], + [ -2.20527452e-01, -8.70963424e-01, -5.00000000e-01], + [ -8.25793455e-02, -9.96584493e-01, -5.00000000e-01], + [ -7.41639184e-02, -8.95445060e-01, -5.00000000e-01], + [ 8.25793455e-02, -9.96584493e-01, -5.00000000e-01], + [ 7.42192906e-02, -8.95487034e-01, -5.00000000e-01], + [ 2.45485487e-01, -9.69400266e-01, -5.00000000e-01], + [ 2.20573235e-01, -8.71047175e-01, -5.00000000e-01], + [ 4.01695425e-01, -9.15773327e-01, -5.00000000e-01], + [ 3.60903494e-01, -8.22802941e-01, -5.00000000e-01], + [ 5.46948158e-01, -8.37166478e-01, -5.00000000e-01], + [ 4.91381119e-01, -7.52102570e-01, -5.00000000e-01], + [ -1.95947086e-01, -7.74127277e-01, -5.00000000e-01], + [ -6.58591700e-02, -7.95934883e-01, -5.00000000e-01], + [ 6.59950160e-02, -7.96009686e-01, -5.00000000e-01], + [ 1.96033858e-01, -7.74239363e-01, -5.00000000e-01], + [ 3.20688739e-01, -7.31187985e-01, -5.00000000e-01], + [ 4.36565689e-01, -6.68176192e-01, -5.00000000e-01], + [ -1.73710483e-01, -6.86594431e-01, -5.00000000e-01], + [ -5.83403733e-02, -7.06068825e-01, -5.00000000e-01], + [ 5.85663516e-02, -7.06222728e-01, -5.00000000e-01], + [ 1.73845433e-01, -6.86833114e-01, -5.00000000e-01], + [ 2.84310702e-01, -6.48392566e-01, -5.00000000e-01], + [ 3.87077327e-01, -5.92417398e-01, -5.00000000e-01], + [ -1.52324550e-01, -6.02613585e-01, -5.00000000e-01], + [ -5.10827736e-02, -6.20032612e-01, -5.00000000e-01], + [ 5.14407375e-02, -6.20224621e-01, -5.00000000e-01], + [ 1.52492169e-01, -6.03046508e-01, -5.00000000e-01], + [ 2.49356849e-01, -5.69065471e-01, -5.00000000e-01], + [ 3.39522909e-01, -5.19665127e-01, -5.00000000e-01], + [ -1.32913591e-01, -5.26851074e-01, -5.00000000e-01], + [ -4.44373752e-02, -5.42756409e-01, -5.00000000e-01], + [ 4.50390459e-02, -5.43028575e-01, -5.00000000e-01], + [ 1.33228954e-01, -5.27995406e-01, -5.00000000e-01], + [ 2.17713616e-01, -4.97612407e-01, -5.00000000e-01], + [ 2.96632422e-01, -4.54081308e-01, -5.00000000e-01], + [ -1.14420539e-01, -4.55704117e-01, -5.00000000e-01], + [ -3.79657707e-02, -4.70906926e-01, -5.00000000e-01], + [ 3.90798645e-02, -4.71331248e-01, -5.00000000e-01], + [ 1.15221008e-01, -4.58994868e-01, -5.00000000e-01], + [ 1.87693599e-01, -4.30660195e-01, -5.00000000e-01], + [ 2.56191789e-01, -3.92327216e-01, -5.00000000e-01], + [ 9.77205966e-02, -3.94673911e-01, -5.00000000e-01], + [ 3.36893742e-02, -4.06727121e-01, -5.00000000e-01], + [ 1.58803158e-01, -3.68132920e-01, -5.00000000e-01], + [ 2.17966632e-01, -3.34109450e-01, -5.00000000e-01], + [ 7.83407097e-02, -3.33990665e-01, -5.00000000e-01], + [ 2.86928174e-02, -3.48638215e-01, -5.00000000e-01], + [ 1.29463668e-01, -3.09306875e-01, -5.00000000e-01], + [ 1.81227986e-01, -2.78393827e-01, -5.00000000e-01], + [ 5.64523840e-02, -2.84774155e-01, -5.00000000e-01], + [ 2.50675824e-02, -3.08228657e-01, -5.00000000e-01], + [ 9.81604613e-02, -2.56263578e-01, -5.00000000e-01], + [ 1.45747568e-01, -2.24725813e-01, -5.00000000e-01], + [ 1.08776353e-01, -1.69704406e-01, -5.00000000e-01], + [ 5.96672230e-02, -2.08411981e-01, -5.00000000e-01], + [ 6.52344214e-02, -1.07234898e-01, -5.00000000e-01], + [ 1.12299685e-02, -1.59491418e-01, -5.00000000e-01], + [ 1.94489428e-02, -2.49212860e-01, -5.00000000e-01], + [ -2.75711446e-02, -2.14453527e-01, -5.00000000e-01], + [ -1.01419274e-02, -2.90912747e-01, -5.00000000e-01], + [ -5.63990856e-02, -2.68644868e-01, -5.00000000e-01], + [ -7.81326349e-02, -3.26377817e-01, -5.00000000e-01], + [ -9.65225590e-02, -3.89249328e-01, -5.00000000e-01], + [ -2.31032455e-02, -3.43177165e-01, -5.00000000e-01], + [ -3.13773433e-02, -4.05719997e-01, -5.00000000e-01], + [ 6.77281572e-01, -7.35723911e-01, -5.00000000e-01], + [ 6.08411375e-01, -6.60869436e-01, -5.00000000e-01], + [ 7.89140509e-01, -6.14212713e-01, -5.00000000e-01], + [ 7.08543237e-01, -5.51440045e-01, -5.00000000e-01], + [ 8.79473751e-01, -4.75947393e-01, -5.00000000e-01], + [ 7.88509514e-01, -4.26698136e-01, -5.00000000e-01], + [ 9.45817242e-01, -3.24699469e-01, -5.00000000e-01], + [ 8.49108858e-01, -2.91497351e-01, -5.00000000e-01], + [ 9.86361303e-01, -1.64594590e-01, -5.00000000e-01], + [ 8.85646606e-01, -1.47773471e-01, -5.00000000e-01], + [ 5.40399291e-01, -5.86902930e-01, -5.00000000e-01], + [ 6.31661212e-01, -4.91529504e-01, -5.00000000e-01], + [ 7.06154712e-01, -3.82110644e-01, -5.00000000e-01], + [ 7.57207596e-01, -2.59933027e-01, -5.00000000e-01], + [ 7.90560453e-01, -1.31868883e-01, -5.00000000e-01], + [ 4.79134872e-01, -5.20246274e-01, -5.00000000e-01], + [ 5.57358575e-01, -4.33573270e-01, -5.00000000e-01], + [ 6.22649467e-01, -3.36858332e-01, -5.00000000e-01], + [ 6.70334308e-01, -2.30102238e-01, -5.00000000e-01], + [ 7.00296083e-01, -1.16745852e-01, -5.00000000e-01], + [ 4.20218711e-01, -4.56063930e-01, -5.00000000e-01], + [ 4.90701218e-01, -3.81516225e-01, -5.00000000e-01], + [ 5.48809022e-01, -2.96865907e-01, -5.00000000e-01], + [ 5.88345346e-01, -2.02001938e-01, -5.00000000e-01], + [ 6.14676740e-01, -1.02418815e-01, -5.00000000e-01], + [ 3.67922567e-01, -3.98927381e-01, -5.00000000e-01], + [ 4.28983572e-01, -3.33156683e-01, -5.00000000e-01], + [ 4.78469364e-01, -2.58774492e-01, -5.00000000e-01], + [ 5.14798664e-01, -1.76976670e-01, -5.00000000e-01], + [ 5.37552876e-01, -8.96851608e-02, -5.00000000e-01], + [ 3.18991616e-01, -3.45088841e-01, -5.00000000e-01], + [ 3.72496945e-01, -2.88521239e-01, -5.00000000e-01], + [ 4.17437712e-01, -2.25772747e-01, -5.00000000e-01], + [ 4.46270753e-01, -1.54015799e-01, -5.00000000e-01], + [ 4.65793651e-01, -7.81566215e-02, -5.00000000e-01], + [ 3.83645678e-01, -1.33842084e-01, -5.00000000e-01], + [ 3.57498091e-01, -1.93408546e-01, -5.00000000e-01], + [ 3.94991079e-01, -6.75531524e-02, -5.00000000e-01], + [ 3.23108985e-01, -1.16767010e-01, -5.00000000e-01], + [ 3.07405476e-01, -1.66484070e-01, -5.00000000e-01], + [ 3.28629393e-01, -5.96308040e-02, -5.00000000e-01], + [ 2.69488721e-01, -1.08491179e-01, -5.00000000e-01], + [ 2.71915330e-01, -1.47551966e-01, -5.00000000e-01], + [ 2.65001259e-01, -5.64391238e-02, -5.00000000e-01], + [ 2.02706372e-01, -6.38527005e-02, -5.00000000e-01], + [ 1.35742212e-01, -7.83273135e-02, -5.00000000e-01], + [ 2.18918251e-01, -1.20081827e-01, -5.00000000e-01], + [ 1.63747295e-01, -1.39842812e-01, -5.00000000e-01], + [ 2.38577514e-01, -1.67677403e-01, -5.00000000e-01], + [ 1.94295104e-01, -1.94156801e-01, -5.00000000e-01], + [ 2.30940050e-01, -2.44114153e-01, -5.00000000e-01], + [ 2.74443311e-01, -2.95203178e-01, -5.00000000e-01], + [ 2.74528072e-01, -2.06666991e-01, -5.00000000e-01], + [ 3.20977283e-01, -2.46876061e-01, -5.00000000e-01] + ]) _connectivity = np.array([ - [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ], - [2 , 9 , 10, 3 , 6 , 11, 12, 7 ], - [9 , 13, 14, 10, 11, 15, 16, 12], - [4 , 3 , 17, 18, 8 , 7 , 19, 20], - [3 , 10, 21, 17, 7 , 12, 22, 19], - [10, 14, 23, 21, 12, 16, 24, 22], - [18, 17, 25, 26, 20, 19, 27, 28], - [17, 21, 29, 25, 19, 22, 30, 27], - [21, 23, 31, 29, 22, 24, 32, 30], - [31, 33, 34, 29, 32, 35, 36, 30], - [29, 34, 37, 25, 30, 36, 38, 27], - [25, 37, 39, 26, 27, 38, 40, 28], - [39, 41, 18, 26, 40, 42, 20, 28], - [41, 43, 4 , 18, 42, 44, 8 , 20], - [43, 45, 1 , 4 , 44, 46, 5 , 8 ], - [47, 48, 49, 50, 1 , 2 , 3 , 4 ], - [48, 51, 52, 49, 2 , 9 , 10, 3 ], - [51, 53, 54, 52, 9 , 13, 14, 10], - [50, 49, 55, 56, 4 , 3 , 17, 18], - [49, 52, 57, 55, 3 , 10, 21, 17], - [52, 54, 58, 57, 10, 14, 23, 21], - [56, 55, 59, 60, 18, 17, 25, 26], - [55, 57, 61, 59, 17, 21, 29, 25], - [57, 58, 62, 61, 21, 23, 31, 29], - [62, 63, 64, 61, 31, 33, 34, 29], - [61, 64, 65, 59, 29, 34, 37, 25], - [59, 65, 66, 60, 25, 37, 39, 26], - [66, 67, 56, 60, 39, 41, 18, 26], - [67, 68, 50, 56, 41, 43, 4 , 18], - [68, 69, 47, 50, 43, 45, 1 , 4 ], - [70, 71, 72, 73, 47, 48, 49, 50], - [71, 74, 75, 72, 48, 51, 52, 49], - [74, 76, 77, 75, 51, 53, 54, 52], - [73, 72, 78, 79, 50, 49, 55, 56], - [72, 75, 80, 78, 49, 52, 57, 55], - [75, 77, 81, 80, 52, 54, 58, 57], - [79, 78, 82, 83, 56, 55, 59, 60], - [78, 80, 84, 82, 55, 57, 61, 59], - [80, 81, 85, 84, 57, 58, 62, 61], - [85, 86, 87, 84, 62, 63, 64, 61], - [84, 87, 88, 82, 61, 64, 65, 59], - [82, 88, 89, 83, 59, 65, 66, 60], - [89, 90, 79, 83, 66, 67, 56, 60], - [90, 91, 73, 79, 67, 68, 50, 56], - [91, 92, 70, 73, 68, 69, 47, 50], - [93, 94, 95, 96, 70, 71, 72, 73], - [94, 97, 98, 95, 71, 74, 75, 72], - [97, 99, 100, 98, 74, 76, 77, 75], - [96, 95, 101, 102, 73, 72, 78, 79], - [95, 98, 103, 101, 72, 75, 80, 78], - [98, 100, 104, 103, 75, 77, 81, 80], - [102, 101, 105, 106, 79, 78, 82, 83], - [101, 103, 107, 105, 78, 80, 84, 82], - [103, 104, 108, 107, 80, 81, 85, 84], - [108, 109, 110, 107, 85, 86, 87, 84], - [107, 110, 111, 105, 84, 87, 88, 82], - [105, 111, 112, 106, 82, 88, 89, 83], - [112, 113, 102, 106, 89, 90, 79, 83], - [113, 114, 96, 102, 90, 91, 73, 79], - [114, 115, 93, 96, 91, 92, 70, 73], - [116, 117, 118, 119, 93, 94, 95, 96], - [117, 120, 121, 118, 94, 97, 98, 95], - [120, 122, 123, 121, 97, 99, 100, 98], - [119, 118, 124, 125, 96, 95, 101, 102], - [118, 121, 126, 124, 95, 98, 103, 101], - [121, 123, 127, 126, 98, 100, 104, 103], - [125, 124, 128, 129, 102, 101, 105, 106], - [124, 126, 130, 128, 101, 103, 107, 105], - [126, 127, 131, 130, 103, 104, 108, 107], - [131, 132, 133, 130, 108, 109, 110, 107], - [130, 133, 134, 128, 107, 110, 111, 105], - [128, 134, 135, 129, 105, 111, 112, 106], - [135, 136, 125, 129, 112, 113, 102, 106], - [136, 137, 119, 125, 113, 114, 96, 102], - [137, 138, 116, 119, 114, 115, 93, 96], - [139, 140, 141, 142, 116, 117, 118, 119], - [140, 143, 144, 141, 117, 120, 121, 118], - [143, 145, 146, 144, 120, 122, 123, 121], - [142, 141, 147, 148, 119, 118, 124, 125], - [141, 144, 149, 147, 118, 121, 126, 124], - [144, 146, 150, 149, 121, 123, 127, 126], - [148, 147, 151, 152, 125, 124, 128, 129], - [147, 149, 153, 151, 124, 126, 130, 128], - [149, 150, 154, 153, 126, 127, 131, 130], - [154, 155, 156, 153, 131, 132, 133, 130], - [153, 156, 157, 151, 130, 133, 134, 128], - [151, 157, 158, 152, 128, 134, 135, 129], - [158, 159, 148, 152, 135, 136, 125, 129], - [159, 160, 142, 148, 136, 137, 119, 125], - [160, 161, 139, 142, 137, 138, 116, 119], - [162, 163, 164, 165, 139, 140, 141, 142], - [163, 166, 167, 164, 140, 143, 144, 141], - [166, 168, 169, 167, 143, 145, 146, 144], - [165, 164, 170, 171, 142, 141, 147, 148], - [164, 167, 172, 170, 141, 144, 149, 147], - [167, 169, 173, 172, 144, 146, 150, 149], - [171, 170, 174, 175, 148, 147, 151, 152], - [170, 172, 176, 174, 147, 149, 153, 151], - [172, 173, 177, 176, 149, 150, 154, 153], - [177, 178, 179, 176, 154, 155, 156, 153], - [176, 179, 180, 174, 153, 156, 157, 151], - [174, 180, 181, 175, 151, 157, 158, 152], - [181, 182, 171, 175, 158, 159, 148, 152], - [182, 183, 165, 171, 159, 160, 142, 148], - [183, 184, 162, 165, 160, 161, 139, 142], - [185, 186, 187, 188, 162, 163, 164, 165], - [186, 189, 190, 187, 163, 166, 167, 164], - [189, 191, 192, 190, 166, 168, 169, 167], - [188, 187, 193, 194, 165, 164, 170, 171], - [187, 190, 195, 193, 164, 167, 172, 170], - [190, 192, 196, 195, 167, 169, 173, 172], - [194, 193, 197, 198, 171, 170, 174, 175], - [193, 195, 199, 197, 170, 172, 176, 174], - [195, 196, 200, 199, 172, 173, 177, 176], - [200, 201, 202, 199, 177, 178, 179, 176], - [199, 202, 203, 197, 176, 179, 180, 174], - [197, 203, 204, 198, 174, 180, 181, 175], - [204, 205, 194, 198, 181, 182, 171, 175], - [205, 206, 188, 194, 182, 183, 165, 171], - [206, 207, 185, 188, 183, 184, 162, 165], - [208, 209, 210, 211, 185, 186, 187, 188], - [209, 212, 213, 210, 186, 189, 190, 187], - [212, 214, 215, 213, 189, 191, 192, 190], - [211, 210, 216, 217, 188, 187, 193, 194], - [210, 213, 218, 216, 187, 190, 195, 193], - [213, 215, 219, 218, 190, 192, 196, 195], - [217, 216, 220, 221, 194, 193, 197, 198], - [216, 218, 222, 220, 193, 195, 199, 197], - [218, 219, 223, 222, 195, 196, 200, 199], - [223, 224, 225, 222, 200, 201, 202, 199], - [222, 225, 226, 220, 199, 202, 203, 197], - [220, 226, 227, 221, 197, 203, 204, 198], - [227, 228, 217, 221, 204, 205, 194, 198], - [228, 229, 211, 217, 205, 206, 188, 194], - [229, 230, 208, 211, 206, 207, 185, 188], - [231, 232, 233, 234, 208, 209, 210, 211], - [232, 235, 236, 233, 209, 212, 213, 210], - [235, 237, 238, 236, 212, 214, 215, 213], - [234, 233, 239, 240, 211, 210, 216, 217], - [233, 236, 241, 239, 210, 213, 218, 216], - [236, 238, 242, 241, 213, 215, 219, 218], - [240, 239, 243, 244, 217, 216, 220, 221], - [239, 241, 245, 243, 216, 218, 222, 220], - [241, 242, 246, 245, 218, 219, 223, 222], - [246, 247, 248, 245, 223, 224, 225, 222], - [245, 248, 249, 243, 222, 225, 226, 220], - [243, 249, 250, 244, 220, 226, 227, 221], - [250, 251, 240, 244, 227, 228, 217, 221], - [251, 252, 234, 240, 228, 229, 211, 217], - [252, 253, 231, 234, 229, 230, 208, 211], - [254, 255, 256, 257, 231, 232, 233, 234], - [255, 258, 259, 256, 232, 235, 236, 233], - [258, 260, 261, 259, 235, 237, 238, 236], - [257, 256, 262, 263, 234, 233, 239, 240], - [256, 259, 264, 262, 233, 236, 241, 239], - [259, 261, 265, 264, 236, 238, 242, 241], - [263, 262, 266, 267, 240, 239, 243, 244], - [262, 264, 268, 266, 239, 241, 245, 243], - [264, 265, 269, 268, 241, 242, 246, 245], - [269, 270, 271, 268, 246, 247, 248, 245], - [268, 271, 272, 266, 245, 248, 249, 243], - [266, 272, 273, 267, 243, 249, 250, 244], - [273, 274, 263, 267, 250, 251, 240, 244], - [274, 275, 257, 263, 251, 252, 234, 240], - [275, 276, 254, 257, 252, 253, 231, 234], - [277, 278, 279, 280, 254, 255, 256, 257], - [278, 281, 282, 279, 255, 258, 259, 256], - [281, 283, 284, 282, 258, 260, 261, 259], - [280, 279, 285, 286, 257, 256, 262, 263], - [279, 282, 287, 285, 256, 259, 264, 262], - [282, 284, 288, 287, 259, 261, 265, 264], - [286, 285, 289, 290, 263, 262, 266, 267], - [285, 287, 291, 289, 262, 264, 268, 266], - [287, 288, 292, 291, 264, 265, 269, 268], - [292, 293, 294, 291, 269, 270, 271, 268], - [291, 294, 295, 289, 268, 271, 272, 266], - [289, 295, 296, 290, 266, 272, 273, 267], - [296, 297, 286, 290, 273, 274, 263, 267], - [297, 298, 280, 286, 274, 275, 257, 263], - [298, 299, 277, 280, 275, 276, 254, 257], - [31, 23, 300, 301, 32, 24, 302, 303], - [304, 293, 292, 305, 306, 270, 269, 307], - [308, 304, 305, 309, 310, 306, 307, 311], - [312, 308, 309, 313, 314, 310, 311, 315], - [316, 317, 312, 313, 318, 319, 314, 315], - [320, 321, 317, 316, 322, 323, 319, 318], - [324, 325, 321, 320, 326, 327, 323, 322], - [328, 329, 324, 320, 330, 331, 326, 322], - [332, 328, 320, 316, 333, 330, 322, 318], - [309, 332, 316, 313, 311, 333, 318, 315], - [334, 335, 329, 328, 336, 337, 331, 330], - [338, 334, 328, 332, 339, 336, 330, 333], - [305, 338, 332, 309, 307, 339, 333, 311], - [284, 283, 335, 334, 261, 260, 337, 336], - [288, 284, 334, 338, 265, 261, 336, 339], - [292, 288, 338, 305, 269, 265, 339, 307], - [306, 270, 269, 307, 340, 247, 246, 341], - [310, 306, 307, 311, 342, 340, 341, 343], - [314, 310, 311, 315, 344, 342, 343, 345], - [318, 319, 314, 315, 346, 347, 344, 345], - [322, 323, 319, 318, 348, 349, 347, 346], - [326, 327, 323, 322, 350, 351, 349, 348], - [330, 331, 326, 322, 352, 353, 350, 348], - [333, 330, 322, 318, 354, 352, 348, 346], - [311, 333, 318, 315, 343, 354, 346, 345], - [336, 337, 331, 330, 355, 356, 353, 352], - [339, 336, 330, 333, 357, 355, 352, 354], - [307, 339, 333, 311, 341, 357, 354, 343], - [261, 260, 337, 336, 238, 237, 356, 355], - [265, 261, 336, 339, 242, 238, 355, 357], - [269, 265, 339, 307, 246, 242, 357, 341], - [340, 247, 246, 341, 358, 224, 223, 359], - [342, 340, 341, 343, 360, 358, 359, 361], - [344, 342, 343, 345, 362, 360, 361, 363], - [346, 347, 344, 345, 364, 365, 362, 363], - [348, 349, 347, 346, 366, 367, 365, 364], - [350, 351, 349, 348, 368, 369, 367, 366], - [352, 353, 350, 348, 370, 371, 368, 366], - [354, 352, 348, 346, 372, 370, 366, 364], - [343, 354, 346, 345, 361, 372, 364, 363], - [355, 356, 353, 352, 373, 374, 371, 370], - [357, 355, 352, 354, 375, 373, 370, 372], - [341, 357, 354, 343, 359, 375, 372, 361], - [238, 237, 356, 355, 215, 214, 374, 373], - [242, 238, 355, 357, 219, 215, 373, 375], - [246, 242, 357, 341, 223, 219, 375, 359], - [358, 224, 223, 359, 376, 201, 200, 377], - [360, 358, 359, 361, 378, 376, 377, 379], - [362, 360, 361, 363, 380, 378, 379, 381], - [364, 365, 362, 363, 382, 383, 380, 381], - [366, 367, 365, 364, 384, 385, 383, 382], - [368, 369, 367, 366, 386, 387, 385, 384], - [370, 371, 368, 366, 388, 389, 386, 384], - [372, 370, 366, 364, 390, 388, 384, 382], - [361, 372, 364, 363, 379, 390, 382, 381], - [373, 374, 371, 370, 391, 392, 389, 388], - [375, 373, 370, 372, 393, 391, 388, 390], - [359, 375, 372, 361, 377, 393, 390, 379], - [215, 214, 374, 373, 192, 191, 392, 391], - [219, 215, 373, 375, 196, 192, 391, 393], - [223, 219, 375, 359, 200, 196, 393, 377], - [376, 201, 200, 377, 394, 178, 177, 395], - [378, 376, 377, 379, 396, 394, 395, 397], - [380, 378, 379, 381, 398, 396, 397, 399], - [382, 383, 380, 381, 400, 401, 398, 399], - [384, 385, 383, 382, 402, 403, 401, 400], - [386, 387, 385, 384, 404, 405, 403, 402], - [388, 389, 386, 384, 406, 407, 404, 402], - [390, 388, 384, 382, 408, 406, 402, 400], - [379, 390, 382, 381, 397, 408, 400, 399], - [391, 392, 389, 388, 409, 410, 407, 406], - [393, 391, 388, 390, 411, 409, 406, 408], - [377, 393, 390, 379, 395, 411, 408, 397], - [192, 191, 392, 391, 169, 168, 410, 409], - [196, 192, 391, 393, 173, 169, 409, 411], - [200, 196, 393, 377, 177, 173, 411, 395], - [394, 178, 177, 395, 412, 155, 154, 413], - [396, 394, 395, 397, 414, 412, 413, 415], - [398, 396, 397, 399, 416, 414, 415, 417], - [400, 401, 398, 399, 418, 419, 416, 417], - [402, 403, 401, 400, 420, 421, 419, 418], - [404, 405, 403, 402, 422, 423, 421, 420], - [406, 407, 404, 402, 424, 425, 422, 420], - [408, 406, 402, 400, 426, 424, 420, 418], - [397, 408, 400, 399, 415, 426, 418, 417], - [409, 410, 407, 406, 427, 428, 425, 424], - [411, 409, 406, 408, 429, 427, 424, 426], - [395, 411, 408, 397, 413, 429, 426, 415], - [169, 168, 410, 409, 146, 145, 428, 427], - [173, 169, 409, 411, 150, 146, 427, 429], - [177, 173, 411, 395, 154, 150, 429, 413], - [412, 155, 154, 413, 430, 132, 131, 431], - [414, 412, 413, 415, 432, 430, 431, 433], - [416, 414, 415, 417, 434, 432, 433, 435], - [418, 419, 416, 417, 436, 437, 434, 435], - [420, 421, 419, 418, 438, 439, 437, 436], - [422, 423, 421, 420, 440, 441, 439, 438], - [424, 425, 422, 420, 442, 443, 440, 438], - [426, 424, 420, 418, 444, 442, 438, 436], - [415, 426, 418, 417, 433, 444, 436, 435], - [427, 428, 425, 424, 445, 446, 443, 442], - [429, 427, 424, 426, 447, 445, 442, 444], - [413, 429, 426, 415, 431, 447, 444, 433], - [146, 145, 428, 427, 123, 122, 446, 445], - [150, 146, 427, 429, 127, 123, 445, 447], - [154, 150, 429, 413, 131, 127, 447, 431], - [430, 132, 131, 431, 448, 109, 108, 449], - [432, 430, 431, 433, 450, 448, 449, 451], - [434, 432, 433, 435, 452, 450, 451, 453], - [436, 437, 434, 435, 454, 455, 452, 453], - [438, 439, 437, 436, 456, 457, 455, 454], - [440, 441, 439, 438, 458, 459, 457, 456], - [442, 443, 440, 438, 460, 461, 458, 456], - [444, 442, 438, 436, 462, 460, 456, 454], - [433, 444, 436, 435, 451, 462, 454, 453], - [445, 446, 443, 442, 463, 464, 461, 460], - [447, 445, 442, 444, 465, 463, 460, 462], - [431, 447, 444, 433, 449, 465, 462, 451], - [123, 122, 446, 445, 100, 99, 464, 463], - [127, 123, 445, 447, 104, 100, 463, 465], - [131, 127, 447, 431, 108, 104, 465, 449], - [448, 109, 108, 449, 466, 86, 85, 467], - [450, 448, 449, 451, 468, 466, 467, 469], - [452, 450, 451, 453, 470, 468, 469, 471], - [454, 455, 452, 453, 472, 473, 470, 471], - [456, 457, 455, 454, 474, 475, 473, 472], - [458, 459, 457, 456, 476, 477, 475, 474], - [460, 461, 458, 456, 478, 479, 476, 474], - [462, 460, 456, 454, 480, 478, 474, 472], - [451, 462, 454, 453, 469, 480, 472, 471], - [463, 464, 461, 460, 481, 482, 479, 478], - [465, 463, 460, 462, 483, 481, 478, 480], - [449, 465, 462, 451, 467, 483, 480, 469], - [100, 99, 464, 463, 77, 76, 482, 481], - [104, 100, 463, 465, 81, 77, 481, 483], - [108, 104, 465, 449, 85, 81, 483, 467], - [466, 86, 85, 467, 484, 63, 62, 485], - [468, 466, 467, 469, 486, 484, 485, 487], - [470, 468, 469, 471, 488, 486, 487, 489], - [472, 473, 470, 471, 490, 491, 488, 489], - [474, 475, 473, 472, 492, 493, 491, 490], - [476, 477, 475, 474, 494, 495, 493, 492], - [478, 479, 476, 474, 496, 497, 494, 492], - [480, 478, 474, 472, 498, 496, 492, 490], - [469, 480, 472, 471, 487, 498, 490, 489], - [481, 482, 479, 478, 499, 500, 497, 496], - [483, 481, 478, 480, 501, 499, 496, 498], - [467, 483, 480, 469, 485, 501, 498, 487], - [77, 76, 482, 481, 54, 53, 500, 499], - [81, 77, 481, 483, 58, 54, 499, 501], - [85, 81, 483, 467, 62, 58, 501, 485], - [484, 63, 62, 485, 502, 33, 31, 301], - [486, 484, 485, 487, 503, 502, 301, 504], - [488, 486, 487, 489, 505, 503, 504, 506], - [490, 491, 488, 489, 507, 508, 505, 506], - [492, 493, 491, 490, 509, 510, 508, 507], - [494, 495, 493, 492, 511, 512, 510, 509], - [496, 497, 494, 492, 513, 514, 511, 509], - [498, 496, 492, 490, 515, 513, 509, 507], - [487, 498, 490, 489, 504, 515, 507, 506], - [499, 500, 497, 496, 516, 517, 514, 513], - [501, 499, 496, 498, 300, 516, 513, 515], - [485, 501, 498, 487, 301, 300, 515, 504], - [54, 53, 500, 499, 14, 13, 517, 516], - [58, 54, 499, 501, 23, 14, 516, 300], - [62, 58, 501, 485, 31, 23, 300, 301], - [502, 33, 31, 301, 518, 35, 32, 303], - [503, 502, 301, 504, 519, 518, 303, 520], - [505, 503, 504, 506, 521, 519, 520, 522], - [507, 508, 505, 506, 523, 524, 521, 522], - [509, 510, 508, 507, 525, 526, 524, 523], - [511, 512, 510, 509, 527, 528, 526, 525], - [513, 514, 511, 509, 529, 530, 527, 525], - [515, 513, 509, 507, 531, 529, 525, 523], - [504, 515, 507, 506, 520, 531, 523, 522], - [516, 517, 514, 513, 532, 533, 530, 529], - [300, 516, 513, 515, 302, 532, 529, 531], - [301, 300, 515, 504, 303, 302, 531, 520], - [14, 13, 517, 516, 16, 15, 533, 532], - [23, 14, 516, 300, 24, 16, 532, 302] - ], dtype='int64') + [ 1, 2, 3, 4, 5, 6, 7, 8], + [ 2, 9, 10, 3, 6, 11, 12, 7], + [ 9, 13, 14, 10, 11, 15, 16, 12], + [ 13, 17, 18, 14, 15, 19, 20, 16], + [ 17, 21, 22, 18, 19, 23, 24, 20], + [ 21, 25, 26, 22, 23, 27, 28, 24], + [ 25, 29, 30, 26, 27, 31, 32, 28], + [ 4, 3, 33, 34, 8, 7, 35, 36], + [ 3, 10, 37, 33, 7, 12, 38, 35], + [ 10, 14, 39, 37, 12, 16, 40, 38], + [ 14, 18, 41, 39, 16, 20, 42, 40], + [ 18, 22, 43, 41, 20, 24, 44, 42], + [ 22, 26, 45, 43, 24, 28, 46, 44], + [ 26, 30, 47, 45, 28, 32, 48, 46], + [ 34, 33, 49, 50, 36, 35, 51, 52], + [ 33, 37, 53, 49, 35, 38, 54, 51], + [ 37, 39, 55, 53, 38, 40, 56, 54], + [ 39, 41, 57, 55, 40, 42, 58, 56], + [ 41, 43, 59, 57, 42, 44, 60, 58], + [ 43, 45, 61, 59, 44, 46, 62, 60], + [ 45, 47, 63, 61, 46, 48, 64, 62], + [ 50, 49, 65, 66, 52, 51, 67, 68], + [ 49, 53, 69, 65, 51, 54, 70, 67], + [ 53, 55, 71, 69, 54, 56, 72, 70], + [ 55, 57, 73, 71, 56, 58, 74, 72], + [ 57, 59, 75, 73, 58, 60, 76, 74], + [ 59, 61, 77, 75, 60, 62, 78, 76], + [ 61, 63, 79, 77, 62, 64, 80, 78], + [ 66, 65, 81, 82, 68, 67, 83, 84], + [ 65, 69, 85, 81, 67, 70, 86, 83], + [ 69, 71, 87, 85, 70, 72, 88, 86], + [ 71, 73, 89, 87, 72, 74, 90, 88], + [ 73, 75, 91, 89, 74, 76, 92, 90], + [ 75, 77, 93, 91, 76, 78, 94, 92], + [ 77, 79, 95, 93, 78, 80, 96, 94], + [ 82, 81, 97, 98, 84, 83, 99, 100], + [ 81, 85, 101, 97, 83, 86, 102, 99], + [ 85, 87, 103, 101, 86, 88, 104, 102], + [ 87, 89, 105, 103, 88, 90, 106, 104], + [ 89, 91, 107, 105, 90, 92, 108, 106], + [ 91, 93, 109, 107, 92, 94, 110, 108], + [ 93, 95, 111, 109, 94, 96, 112, 110], + [ 105, 107, 113, 114, 106, 108, 115, 116], + [ 107, 109, 117, 113, 108, 110, 118, 115], + [ 109, 111, 119, 117, 110, 112, 120, 118], + [ 114, 113, 121, 122, 116, 115, 123, 124], + [ 113, 117, 125, 121, 115, 118, 126, 123], + [ 117, 119, 127, 125, 118, 120, 128, 126], + [ 122, 121, 129, 130, 124, 123, 131, 132], + [ 121, 125, 133, 129, 123, 126, 134, 131], + [ 125, 127, 135, 133, 126, 128, 136, 134], + [ 135, 137, 138, 133, 136, 139, 140, 134], + [ 137, 141, 142, 138, 139, 143, 144, 140], + [ 141, 145, 146, 142, 143, 147, 148, 144], + [ 145, 149, 150, 146, 147, 151, 152, 148], + [ 133, 138, 153, 129, 134, 140, 154, 131], + [ 138, 142, 155, 153, 140, 144, 156, 154], + [ 142, 146, 157, 155, 144, 148, 158, 156], + [ 146, 150, 159, 157, 148, 152, 160, 158], + [ 129, 153, 161, 130, 131, 154, 162, 132], + [ 153, 155, 163, 161, 154, 156, 164, 162], + [ 155, 157, 165, 163, 156, 158, 166, 164], + [ 157, 159, 167, 165, 158, 160, 168, 166], + [ 167, 169, 170, 165, 168, 171, 172, 166], + [ 169, 173, 174, 170, 171, 175, 176, 172], + [ 173, 98, 97, 174, 175, 100, 99, 176], + [ 165, 170, 177, 163, 166, 172, 178, 164], + [ 170, 174, 179, 177, 172, 176, 180, 178], + [ 174, 97, 101, 179, 176, 99, 102, 180], + [ 163, 177, 181, 161, 164, 178, 182, 162], + [ 177, 179, 183, 181, 178, 180, 184, 182], + [ 179, 101, 103, 183, 180, 102, 104, 184], + [ 161, 181, 122, 130, 162, 182, 124, 132], + [ 181, 183, 114, 122, 182, 184, 116, 124], + [ 183, 103, 105, 114, 184, 104, 106, 116], + [ 29, 185, 186, 30, 31, 187, 188, 32], + [ 185, 189, 190, 186, 187, 191, 192, 188], + [ 189, 193, 194, 190, 191, 195, 196, 192], + [ 193, 197, 198, 194, 195, 199, 200, 196], + [ 197, 201, 202, 198, 199, 203, 204, 200], + [ 201, 205, 206, 202, 203, 207, 208, 204], + [ 205, 209, 210, 206, 207, 211, 212, 208], + [ 30, 186, 213, 47, 32, 188, 214, 48], + [ 186, 190, 215, 213, 188, 192, 216, 214], + [ 190, 194, 217, 215, 192, 196, 218, 216], + [ 194, 198, 219, 217, 196, 200, 220, 218], + [ 198, 202, 221, 219, 200, 204, 222, 220], + [ 202, 206, 223, 221, 204, 208, 224, 222], + [ 206, 210, 225, 223, 208, 212, 226, 224], + [ 47, 213, 227, 63, 48, 214, 228, 64], + [ 213, 215, 229, 227, 214, 216, 230, 228], + [ 215, 217, 231, 229, 216, 218, 232, 230], + [ 217, 219, 233, 231, 218, 220, 234, 232], + [ 219, 221, 235, 233, 220, 222, 236, 234], + [ 221, 223, 237, 235, 222, 224, 238, 236], + [ 223, 225, 239, 237, 224, 226, 240, 238], + [ 63, 227, 241, 79, 64, 228, 242, 80], + [ 227, 229, 243, 241, 228, 230, 244, 242], + [ 229, 231, 245, 243, 230, 232, 246, 244], + [ 231, 233, 247, 245, 232, 234, 248, 246], + [ 233, 235, 249, 247, 234, 236, 250, 248], + [ 235, 237, 251, 249, 236, 238, 252, 250], + [ 237, 239, 253, 251, 238, 240, 254, 252], + [ 79, 241, 255, 95, 80, 242, 256, 96], + [ 241, 243, 257, 255, 242, 244, 258, 256], + [ 243, 245, 259, 257, 244, 246, 260, 258], + [ 245, 247, 261, 259, 246, 248, 262, 260], + [ 247, 249, 263, 261, 248, 250, 264, 262], + [ 249, 251, 265, 263, 250, 252, 266, 264], + [ 251, 253, 267, 265, 252, 254, 268, 266], + [ 95, 255, 269, 111, 96, 256, 270, 112], + [ 255, 257, 271, 269, 256, 258, 272, 270], + [ 257, 259, 273, 271, 258, 260, 274, 272], + [ 259, 261, 275, 273, 260, 262, 276, 274], + [ 261, 263, 277, 275, 262, 264, 278, 276], + [ 263, 265, 279, 277, 264, 266, 280, 278], + [ 265, 267, 281, 279, 266, 268, 282, 280], + [ 273, 275, 283, 284, 274, 276, 285, 286], + [ 275, 277, 287, 283, 276, 278, 288, 285], + [ 277, 279, 289, 287, 278, 280, 290, 288], + [ 279, 281, 291, 289, 280, 282, 292, 290], + [ 284, 283, 293, 294, 286, 285, 295, 296], + [ 283, 287, 297, 293, 285, 288, 298, 295], + [ 287, 289, 299, 297, 288, 290, 300, 298], + [ 289, 291, 301, 299, 290, 292, 302, 300], + [ 294, 293, 303, 304, 296, 295, 305, 306], + [ 293, 297, 307, 303, 295, 298, 308, 305], + [ 297, 299, 309, 307, 298, 300, 310, 308], + [ 299, 301, 311, 309, 300, 302, 312, 310], + [ 311, 313, 314, 309, 312, 315, 316, 310], + [ 313, 317, 318, 314, 315, 319, 320, 316], + [ 317, 149, 145, 318, 319, 151, 147, 320], + [ 309, 314, 321, 307, 310, 316, 322, 308], + [ 314, 318, 323, 321, 316, 320, 324, 322], + [ 318, 145, 141, 323, 320, 147, 143, 324], + [ 307, 321, 325, 303, 308, 322, 326, 305], + [ 321, 323, 327, 325, 322, 324, 328, 326], + [ 323, 141, 137, 327, 324, 143, 139, 328], + [ 303, 325, 329, 304, 305, 326, 330, 306], + [ 325, 327, 331, 329, 326, 328, 332, 330], + [ 327, 137, 135, 331, 328, 139, 136, 332], + [ 135, 127, 333, 331, 136, 128, 334, 332], + [ 127, 119, 335, 333, 128, 120, 336, 334], + [ 119, 111, 269, 335, 120, 112, 270, 336], + [ 331, 333, 337, 329, 332, 334, 338, 330], + [ 333, 335, 339, 337, 334, 336, 340, 338], + [ 335, 269, 271, 339, 336, 270, 272, 340], + [ 329, 337, 294, 304, 330, 338, 296, 306], + [ 337, 339, 284, 294, 338, 340, 286, 296], + [ 339, 271, 273, 284, 340, 272, 274, 286], + [ 209, 341, 342, 210, 211, 343, 344, 212], + [ 341, 345, 346, 342, 343, 347, 348, 344], + [ 345, 349, 350, 346, 347, 351, 352, 348], + [ 349, 353, 354, 350, 351, 355, 356, 352], + [ 353, 357, 358, 354, 355, 359, 360, 356], + [ 357, 361, 362, 358, 359, 363, 364, 360], + [ 210, 342, 365, 225, 212, 344, 366, 226], + [ 342, 346, 367, 365, 344, 348, 368, 366], + [ 346, 350, 369, 367, 348, 352, 370, 368], + [ 350, 354, 371, 369, 352, 356, 372, 370], + [ 354, 358, 373, 371, 356, 360, 374, 372], + [ 358, 362, 375, 373, 360, 364, 376, 374], + [ 225, 365, 377, 239, 226, 366, 378, 240], + [ 365, 367, 379, 377, 366, 368, 380, 378], + [ 367, 369, 381, 379, 368, 370, 382, 380], + [ 369, 371, 383, 381, 370, 372, 384, 382], + [ 371, 373, 385, 383, 372, 374, 386, 384], + [ 373, 375, 387, 385, 374, 376, 388, 386], + [ 239, 377, 389, 253, 240, 378, 390, 254], + [ 377, 379, 391, 389, 378, 380, 392, 390], + [ 379, 381, 393, 391, 380, 382, 394, 392], + [ 381, 383, 395, 393, 382, 384, 396, 394], + [ 383, 385, 397, 395, 384, 386, 398, 396], + [ 385, 387, 399, 397, 386, 388, 400, 398], + [ 253, 389, 401, 267, 254, 390, 402, 268], + [ 389, 391, 403, 401, 390, 392, 404, 402], + [ 391, 393, 405, 403, 392, 394, 406, 404], + [ 393, 395, 407, 405, 394, 396, 408, 406], + [ 395, 397, 409, 407, 396, 398, 410, 408], + [ 397, 399, 411, 409, 398, 400, 412, 410], + [ 267, 401, 413, 281, 268, 402, 414, 282], + [ 401, 403, 415, 413, 402, 404, 416, 414], + [ 403, 405, 417, 415, 404, 406, 418, 416], + [ 405, 407, 419, 417, 406, 408, 420, 418], + [ 407, 409, 421, 419, 408, 410, 422, 420], + [ 409, 411, 423, 421, 410, 412, 424, 422], + [ 417, 419, 425, 426, 418, 420, 427, 428], + [ 419, 421, 429, 425, 420, 422, 430, 427], + [ 421, 423, 431, 429, 422, 424, 432, 430], + [ 426, 425, 433, 434, 428, 427, 435, 436], + [ 425, 429, 437, 433, 427, 430, 438, 435], + [ 429, 431, 439, 437, 430, 432, 440, 438], + [ 434, 433, 441, 442, 436, 435, 443, 444], + [ 433, 437, 445, 441, 435, 438, 446, 443], + [ 437, 439, 447, 445, 438, 440, 448, 446], + [ 447, 449, 450, 445, 448, 451, 452, 446], + [ 449, 453, 454, 450, 451, 455, 456, 452], + [ 453, 149, 317, 454, 455, 151, 319, 456], + [ 445, 450, 457, 441, 446, 452, 458, 443], + [ 450, 454, 459, 457, 452, 456, 460, 458], + [ 454, 317, 313, 459, 456, 319, 315, 460], + [ 441, 457, 461, 442, 443, 458, 462, 444], + [ 457, 459, 463, 461, 458, 460, 464, 462], + [ 459, 313, 311, 463, 460, 315, 312, 464], + [ 311, 301, 465, 463, 312, 302, 466, 464], + [ 301, 291, 467, 465, 302, 292, 468, 466], + [ 291, 281, 413, 467, 292, 282, 414, 468], + [ 463, 465, 469, 461, 464, 466, 470, 462], + [ 465, 467, 471, 469, 466, 468, 472, 470], + [ 467, 413, 415, 471, 468, 414, 416, 472], + [ 461, 469, 434, 442, 462, 470, 436, 444], + [ 469, 471, 426, 434, 470, 472, 428, 436], + [ 471, 415, 417, 426, 472, 416, 418, 428], + [ 361, 473, 474, 362, 363, 475, 476, 364], + [ 473, 477, 478, 474, 475, 479, 480, 476], + [ 477, 481, 482, 478, 479, 483, 484, 480], + [ 481, 485, 486, 482, 483, 487, 488, 484], + [ 485, 489, 490, 486, 487, 491, 492, 488], + [ 489, 493, 494, 490, 491, 495, 496, 492], + [ 362, 474, 497, 375, 364, 476, 498, 376], + [ 474, 478, 499, 497, 476, 480, 500, 498], + [ 478, 482, 501, 499, 480, 484, 502, 500], + [ 482, 486, 503, 501, 484, 488, 504, 502], + [ 486, 490, 505, 503, 488, 492, 506, 504], + [ 490, 494, 507, 505, 492, 496, 508, 506], + [ 375, 497, 509, 387, 376, 498, 510, 388], + [ 497, 499, 511, 509, 498, 500, 512, 510], + [ 499, 501, 513, 511, 500, 502, 514, 512], + [ 501, 503, 515, 513, 502, 504, 516, 514], + [ 503, 505, 517, 515, 504, 506, 518, 516], + [ 505, 507, 519, 517, 506, 508, 520, 518], + [ 387, 509, 521, 399, 388, 510, 522, 400], + [ 509, 511, 523, 521, 510, 512, 524, 522], + [ 511, 513, 525, 523, 512, 514, 526, 524], + [ 513, 515, 527, 525, 514, 516, 528, 526], + [ 515, 517, 529, 527, 516, 518, 530, 528], + [ 517, 519, 531, 529, 518, 520, 532, 530], + [ 399, 521, 533, 411, 400, 522, 534, 412], + [ 521, 523, 535, 533, 522, 524, 536, 534], + [ 523, 525, 537, 535, 524, 526, 538, 536], + [ 525, 527, 539, 537, 526, 528, 540, 538], + [ 527, 529, 541, 539, 528, 530, 542, 540], + [ 529, 531, 543, 541, 530, 532, 544, 542], + [ 411, 533, 545, 423, 412, 534, 546, 424], + [ 533, 535, 547, 545, 534, 536, 548, 546], + [ 535, 537, 549, 547, 536, 538, 550, 548], + [ 537, 539, 551, 549, 538, 540, 552, 550], + [ 539, 541, 553, 551, 540, 542, 554, 552], + [ 541, 543, 555, 553, 542, 544, 556, 554], + [ 549, 551, 557, 558, 550, 552, 559, 560], + [ 551, 553, 561, 557, 552, 554, 562, 559], + [ 553, 555, 563, 561, 554, 556, 564, 562], + [ 558, 557, 565, 566, 560, 559, 567, 568], + [ 557, 561, 569, 565, 559, 562, 570, 567], + [ 561, 563, 571, 569, 562, 564, 572, 570], + [ 566, 565, 573, 574, 568, 567, 575, 576], + [ 565, 569, 577, 573, 567, 570, 578, 575], + [ 569, 571, 579, 577, 570, 572, 580, 578], + [ 579, 581, 582, 577, 580, 583, 584, 578], + [ 581, 585, 586, 582, 583, 587, 588, 584], + [ 585, 149, 453, 586, 587, 151, 455, 588], + [ 577, 582, 589, 573, 578, 584, 590, 575], + [ 582, 586, 591, 589, 584, 588, 592, 590], + [ 586, 453, 449, 591, 588, 455, 451, 592], + [ 573, 589, 593, 574, 575, 590, 594, 576], + [ 589, 591, 595, 593, 590, 592, 596, 594], + [ 591, 449, 447, 595, 592, 451, 448, 596], + [ 447, 439, 597, 595, 448, 440, 598, 596], + [ 439, 431, 599, 597, 440, 432, 600, 598], + [ 431, 423, 545, 599, 432, 424, 546, 600], + [ 595, 597, 601, 593, 596, 598, 602, 594], + [ 597, 599, 603, 601, 598, 600, 604, 602], + [ 599, 545, 547, 603, 600, 546, 548, 604], + [ 593, 601, 566, 574, 594, 602, 568, 576], + [ 601, 603, 558, 566, 602, 604, 560, 568], + [ 603, 547, 549, 558, 604, 548, 550, 560], + [ 493, 605, 606, 494, 495, 607, 608, 496], + [ 605, 609, 610, 606, 607, 611, 612, 608], + [ 609, 613, 614, 610, 611, 615, 616, 612], + [ 613, 617, 618, 614, 615, 619, 620, 616], + [ 617, 621, 622, 618, 619, 623, 624, 620], + [ 621, 625, 626, 622, 623, 627, 628, 624], + [ 494, 606, 629, 507, 496, 608, 630, 508], + [ 606, 610, 631, 629, 608, 612, 632, 630], + [ 610, 614, 633, 631, 612, 616, 634, 632], + [ 614, 618, 635, 633, 616, 620, 636, 634], + [ 618, 622, 637, 635, 620, 624, 638, 636], + [ 622, 626, 639, 637, 624, 628, 640, 638], + [ 507, 629, 641, 519, 508, 630, 642, 520], + [ 629, 631, 643, 641, 630, 632, 644, 642], + [ 631, 633, 645, 643, 632, 634, 646, 644], + [ 633, 635, 647, 645, 634, 636, 648, 646], + [ 635, 637, 649, 647, 636, 638, 650, 648], + [ 637, 639, 651, 649, 638, 640, 652, 650], + [ 519, 641, 653, 531, 520, 642, 654, 532], + [ 641, 643, 655, 653, 642, 644, 656, 654], + [ 643, 645, 657, 655, 644, 646, 658, 656], + [ 645, 647, 659, 657, 646, 648, 660, 658], + [ 647, 649, 661, 659, 648, 650, 662, 660], + [ 649, 651, 663, 661, 650, 652, 664, 662], + [ 531, 653, 665, 543, 532, 654, 666, 544], + [ 653, 655, 667, 665, 654, 656, 668, 666], + [ 655, 657, 669, 667, 656, 658, 670, 668], + [ 657, 659, 671, 669, 658, 660, 672, 670], + [ 659, 661, 673, 671, 660, 662, 674, 672], + [ 661, 663, 675, 673, 662, 664, 676, 674], + [ 543, 665, 677, 555, 544, 666, 678, 556], + [ 665, 667, 679, 677, 666, 668, 680, 678], + [ 667, 669, 681, 679, 668, 670, 682, 680], + [ 669, 671, 683, 681, 670, 672, 684, 682], + [ 671, 673, 685, 683, 672, 674, 686, 684], + [ 673, 675, 687, 685, 674, 676, 688, 686], + [ 681, 683, 689, 690, 682, 684, 691, 692], + [ 683, 685, 693, 689, 684, 686, 694, 691], + [ 685, 687, 695, 693, 686, 688, 696, 694], + [ 690, 689, 697, 698, 692, 691, 699, 700], + [ 689, 693, 701, 697, 691, 694, 702, 699], + [ 693, 695, 703, 701, 694, 696, 704, 702], + [ 698, 697, 705, 706, 700, 699, 707, 708], + [ 697, 701, 709, 705, 699, 702, 710, 707], + [ 701, 703, 711, 709, 702, 704, 712, 710], + [ 711, 713, 714, 709, 712, 715, 716, 710], + [ 713, 717, 718, 714, 715, 719, 720, 716], + [ 717, 149, 585, 718, 719, 151, 587, 720], + [ 709, 714, 721, 705, 710, 716, 722, 707], + [ 714, 718, 723, 721, 716, 720, 724, 722], + [ 718, 585, 581, 723, 720, 587, 583, 724], + [ 705, 721, 725, 706, 707, 722, 726, 708], + [ 721, 723, 727, 725, 722, 724, 728, 726], + [ 723, 581, 579, 727, 724, 583, 580, 728], + [ 579, 571, 729, 727, 580, 572, 730, 728], + [ 571, 563, 731, 729, 572, 564, 732, 730], + [ 563, 555, 677, 731, 564, 556, 678, 732], + [ 727, 729, 733, 725, 728, 730, 734, 726], + [ 729, 731, 735, 733, 730, 732, 736, 734], + [ 731, 677, 679, 735, 732, 678, 680, 736], + [ 725, 733, 698, 706, 726, 734, 700, 708], + [ 733, 735, 690, 698, 734, 736, 692, 700], + [ 735, 679, 681, 690, 736, 680, 682, 692], + [ 625, 737, 738, 626, 627, 739, 740, 628], + [ 737, 741, 742, 738, 739, 743, 744, 740], + [ 741, 745, 746, 742, 743, 747, 748, 744], + [ 745, 749, 750, 746, 747, 751, 752, 748], + [ 749, 753, 754, 750, 751, 755, 756, 752], + [ 753, 1, 4, 754, 755, 5, 8, 756], + [ 626, 738, 757, 639, 628, 740, 758, 640], + [ 738, 742, 759, 757, 740, 744, 760, 758], + [ 742, 746, 761, 759, 744, 748, 762, 760], + [ 746, 750, 763, 761, 748, 752, 764, 762], + [ 750, 754, 765, 763, 752, 756, 766, 764], + [ 754, 4, 34, 765, 756, 8, 36, 766], + [ 639, 757, 767, 651, 640, 758, 768, 652], + [ 757, 759, 769, 767, 758, 760, 770, 768], + [ 759, 761, 771, 769, 760, 762, 772, 770], + [ 761, 763, 773, 771, 762, 764, 774, 772], + [ 763, 765, 775, 773, 764, 766, 776, 774], + [ 765, 34, 50, 775, 766, 36, 52, 776], + [ 651, 767, 777, 663, 652, 768, 778, 664], + [ 767, 769, 779, 777, 768, 770, 780, 778], + [ 769, 771, 781, 779, 770, 772, 782, 780], + [ 771, 773, 783, 781, 772, 774, 784, 782], + [ 773, 775, 785, 783, 774, 776, 786, 784], + [ 775, 50, 66, 785, 776, 52, 68, 786], + [ 663, 777, 787, 675, 664, 778, 788, 676], + [ 777, 779, 789, 787, 778, 780, 790, 788], + [ 779, 781, 791, 789, 780, 782, 792, 790], + [ 781, 783, 793, 791, 782, 784, 794, 792], + [ 783, 785, 795, 793, 784, 786, 796, 794], + [ 785, 66, 82, 795, 786, 68, 84, 796], + [ 675, 787, 797, 687, 676, 788, 798, 688], + [ 787, 789, 799, 797, 788, 790, 800, 798], + [ 789, 791, 801, 799, 790, 792, 802, 800], + [ 791, 793, 803, 801, 792, 794, 804, 802], + [ 793, 795, 805, 803, 794, 796, 806, 804], + [ 795, 82, 98, 805, 796, 84, 100, 806], + [ 801, 803, 807, 808, 802, 804, 809, 810], + [ 803, 805, 811, 807, 804, 806, 812, 809], + [ 805, 98, 173, 811, 806, 100, 175, 812], + [ 808, 807, 813, 814, 810, 809, 815, 816], + [ 807, 811, 817, 813, 809, 812, 818, 815], + [ 811, 173, 169, 817, 812, 175, 171, 818], + [ 814, 813, 819, 820, 816, 815, 821, 822], + [ 813, 817, 823, 819, 815, 818, 824, 821], + [ 817, 169, 167, 823, 818, 171, 168, 824], + [ 167, 159, 825, 823, 168, 160, 826, 824], + [ 159, 150, 827, 825, 160, 152, 828, 826], + [ 150, 149, 717, 827, 152, 151, 719, 828], + [ 823, 825, 829, 819, 824, 826, 830, 821], + [ 825, 827, 831, 829, 826, 828, 832, 830], + [ 827, 717, 713, 831, 828, 719, 715, 832], + [ 819, 829, 833, 820, 821, 830, 834, 822], + [ 829, 831, 835, 833, 830, 832, 836, 834], + [ 831, 713, 711, 835, 832, 715, 712, 836], + [ 711, 703, 837, 835, 712, 704, 838, 836], + [ 703, 695, 839, 837, 704, 696, 840, 838], + [ 695, 687, 797, 839, 696, 688, 798, 840], + [ 835, 837, 841, 833, 836, 838, 842, 834], + [ 837, 839, 843, 841, 838, 840, 844, 842], + [ 839, 797, 799, 843, 840, 798, 800, 844], + [ 833, 841, 814, 820, 834, 842, 816, 822], + [ 841, 843, 808, 814, 842, 844, 810, 816], + [ 843, 799, 801, 808, 844, 800, 802, 810], + [ 845, 846, 847, 848, 1, 2, 3, 4], + [ 846, 849, 850, 847, 2, 9, 10, 3], + [ 849, 851, 852, 850, 9, 13, 14, 10], + [ 851, 853, 854, 852, 13, 17, 18, 14], + [ 853, 855, 856, 854, 17, 21, 22, 18], + [ 855, 857, 858, 856, 21, 25, 26, 22], + [ 857, 859, 860, 858, 25, 29, 30, 26], + [ 848, 847, 861, 862, 4, 3, 33, 34], + [ 847, 850, 863, 861, 3, 10, 37, 33], + [ 850, 852, 864, 863, 10, 14, 39, 37], + [ 852, 854, 865, 864, 14, 18, 41, 39], + [ 854, 856, 866, 865, 18, 22, 43, 41], + [ 856, 858, 867, 866, 22, 26, 45, 43], + [ 858, 860, 868, 867, 26, 30, 47, 45], + [ 862, 861, 869, 870, 34, 33, 49, 50], + [ 861, 863, 871, 869, 33, 37, 53, 49], + [ 863, 864, 872, 871, 37, 39, 55, 53], + [ 864, 865, 873, 872, 39, 41, 57, 55], + [ 865, 866, 874, 873, 41, 43, 59, 57], + [ 866, 867, 875, 874, 43, 45, 61, 59], + [ 867, 868, 876, 875, 45, 47, 63, 61], + [ 870, 869, 877, 878, 50, 49, 65, 66], + [ 869, 871, 879, 877, 49, 53, 69, 65], + [ 871, 872, 880, 879, 53, 55, 71, 69], + [ 872, 873, 881, 880, 55, 57, 73, 71], + [ 873, 874, 882, 881, 57, 59, 75, 73], + [ 874, 875, 883, 882, 59, 61, 77, 75], + [ 875, 876, 884, 883, 61, 63, 79, 77], + [ 878, 877, 885, 886, 66, 65, 81, 82], + [ 877, 879, 887, 885, 65, 69, 85, 81], + [ 879, 880, 888, 887, 69, 71, 87, 85], + [ 880, 881, 889, 888, 71, 73, 89, 87], + [ 881, 882, 890, 889, 73, 75, 91, 89], + [ 882, 883, 891, 890, 75, 77, 93, 91], + [ 883, 884, 892, 891, 77, 79, 95, 93], + [ 886, 885, 893, 894, 82, 81, 97, 98], + [ 885, 887, 895, 893, 81, 85, 101, 97], + [ 887, 888, 896, 895, 85, 87, 103, 101], + [ 888, 889, 897, 896, 87, 89, 105, 103], + [ 889, 890, 898, 897, 89, 91, 107, 105], + [ 890, 891, 899, 898, 91, 93, 109, 107], + [ 891, 892, 900, 899, 93, 95, 111, 109], + [ 897, 898, 901, 902, 105, 107, 113, 114], + [ 898, 899, 903, 901, 107, 109, 117, 113], + [ 899, 900, 904, 903, 109, 111, 119, 117], + [ 902, 901, 905, 906, 114, 113, 121, 122], + [ 901, 903, 907, 905, 113, 117, 125, 121], + [ 903, 904, 908, 907, 117, 119, 127, 125], + [ 906, 905, 909, 910, 122, 121, 129, 130], + [ 905, 907, 911, 909, 121, 125, 133, 129], + [ 907, 908, 912, 911, 125, 127, 135, 133], + [ 912, 913, 914, 911, 135, 137, 138, 133], + [ 913, 915, 916, 914, 137, 141, 142, 138], + [ 915, 917, 918, 916, 141, 145, 146, 142], + [ 917, 919, 920, 918, 145, 149, 150, 146], + [ 911, 914, 921, 909, 133, 138, 153, 129], + [ 914, 916, 922, 921, 138, 142, 155, 153], + [ 916, 918, 923, 922, 142, 146, 157, 155], + [ 918, 920, 924, 923, 146, 150, 159, 157], + [ 909, 921, 925, 910, 129, 153, 161, 130], + [ 921, 922, 926, 925, 153, 155, 163, 161], + [ 922, 923, 927, 926, 155, 157, 165, 163], + [ 923, 924, 928, 927, 157, 159, 167, 165], + [ 928, 929, 930, 927, 167, 169, 170, 165], + [ 929, 931, 932, 930, 169, 173, 174, 170], + [ 931, 894, 893, 932, 173, 98, 97, 174], + [ 927, 930, 933, 926, 165, 170, 177, 163], + [ 930, 932, 934, 933, 170, 174, 179, 177], + [ 932, 893, 895, 934, 174, 97, 101, 179], + [ 926, 933, 935, 925, 163, 177, 181, 161], + [ 933, 934, 936, 935, 177, 179, 183, 181], + [ 934, 895, 896, 936, 179, 101, 103, 183], + [ 925, 935, 906, 910, 161, 181, 122, 130], + [ 935, 936, 902, 906, 181, 183, 114, 122], + [ 936, 896, 897, 902, 183, 103, 105, 114], + [ 859, 937, 938, 860, 29, 185, 186, 30], + [ 937, 939, 940, 938, 185, 189, 190, 186], + [ 939, 941, 942, 940, 189, 193, 194, 190], + [ 941, 943, 944, 942, 193, 197, 198, 194], + [ 943, 945, 946, 944, 197, 201, 202, 198], + [ 945, 947, 948, 946, 201, 205, 206, 202], + [ 947, 949, 950, 948, 205, 209, 210, 206], + [ 860, 938, 951, 868, 30, 186, 213, 47], + [ 938, 940, 952, 951, 186, 190, 215, 213], + [ 940, 942, 953, 952, 190, 194, 217, 215], + [ 942, 944, 954, 953, 194, 198, 219, 217], + [ 944, 946, 955, 954, 198, 202, 221, 219], + [ 946, 948, 956, 955, 202, 206, 223, 221], + [ 948, 950, 957, 956, 206, 210, 225, 223], + [ 868, 951, 958, 876, 47, 213, 227, 63], + [ 951, 952, 959, 958, 213, 215, 229, 227], + [ 952, 953, 960, 959, 215, 217, 231, 229], + [ 953, 954, 961, 960, 217, 219, 233, 231], + [ 954, 955, 962, 961, 219, 221, 235, 233], + [ 955, 956, 963, 962, 221, 223, 237, 235], + [ 956, 957, 964, 963, 223, 225, 239, 237], + [ 876, 958, 965, 884, 63, 227, 241, 79], + [ 958, 959, 966, 965, 227, 229, 243, 241], + [ 959, 960, 967, 966, 229, 231, 245, 243], + [ 960, 961, 968, 967, 231, 233, 247, 245], + [ 961, 962, 969, 968, 233, 235, 249, 247], + [ 962, 963, 970, 969, 235, 237, 251, 249], + [ 963, 964, 971, 970, 237, 239, 253, 251], + [ 884, 965, 972, 892, 79, 241, 255, 95], + [ 965, 966, 973, 972, 241, 243, 257, 255], + [ 966, 967, 974, 973, 243, 245, 259, 257], + [ 967, 968, 975, 974, 245, 247, 261, 259], + [ 968, 969, 976, 975, 247, 249, 263, 261], + [ 969, 970, 977, 976, 249, 251, 265, 263], + [ 970, 971, 978, 977, 251, 253, 267, 265], + [ 892, 972, 979, 900, 95, 255, 269, 111], + [ 972, 973, 980, 979, 255, 257, 271, 269], + [ 973, 974, 981, 980, 257, 259, 273, 271], + [ 974, 975, 982, 981, 259, 261, 275, 273], + [ 975, 976, 983, 982, 261, 263, 277, 275], + [ 976, 977, 984, 983, 263, 265, 279, 277], + [ 977, 978, 985, 984, 265, 267, 281, 279], + [ 981, 982, 986, 987, 273, 275, 283, 284], + [ 982, 983, 988, 986, 275, 277, 287, 283], + [ 983, 984, 989, 988, 277, 279, 289, 287], + [ 984, 985, 990, 989, 279, 281, 291, 289], + [ 987, 986, 991, 992, 284, 283, 293, 294], + [ 986, 988, 993, 991, 283, 287, 297, 293], + [ 988, 989, 994, 993, 287, 289, 299, 297], + [ 989, 990, 995, 994, 289, 291, 301, 299], + [ 992, 991, 996, 997, 294, 293, 303, 304], + [ 991, 993, 998, 996, 293, 297, 307, 303], + [ 993, 994, 999, 998, 297, 299, 309, 307], + [ 994, 995, 1000, 999, 299, 301, 311, 309], + [1000, 1001, 1002, 999, 311, 313, 314, 309], + [1001, 1003, 1004, 1002, 313, 317, 318, 314], + [1003, 919, 917, 1004, 317, 149, 145, 318], + [ 999, 1002, 1005, 998, 309, 314, 321, 307], + [1002, 1004, 1006, 1005, 314, 318, 323, 321], + [1004, 917, 915, 1006, 318, 145, 141, 323], + [ 998, 1005, 1007, 996, 307, 321, 325, 303], + [1005, 1006, 1008, 1007, 321, 323, 327, 325], + [1006, 915, 913, 1008, 323, 141, 137, 327], + [ 996, 1007, 1009, 997, 303, 325, 329, 304], + [1007, 1008, 1010, 1009, 325, 327, 331, 329], + [1008, 913, 912, 1010, 327, 137, 135, 331], + [ 912, 908, 1011, 1010, 135, 127, 333, 331], + [ 908, 904, 1012, 1011, 127, 119, 335, 333], + [ 904, 900, 979, 1012, 119, 111, 269, 335], + [1010, 1011, 1013, 1009, 331, 333, 337, 329], + [1011, 1012, 1014, 1013, 333, 335, 339, 337], + [1012, 979, 980, 1014, 335, 269, 271, 339], + [1009, 1013, 992, 997, 329, 337, 294, 304], + [1013, 1014, 987, 992, 337, 339, 284, 294], + [1014, 980, 981, 987, 339, 271, 273, 284], + [ 949, 1015, 1016, 950, 209, 341, 342, 210], + [1015, 1017, 1018, 1016, 341, 345, 346, 342], + [1017, 1019, 1020, 1018, 345, 349, 350, 346], + [1019, 1021, 1022, 1020, 349, 353, 354, 350], + [1021, 1023, 1024, 1022, 353, 357, 358, 354], + [1023, 1025, 1026, 1024, 357, 361, 362, 358], + [ 950, 1016, 1027, 957, 210, 342, 365, 225], + [1016, 1018, 1028, 1027, 342, 346, 367, 365], + [1018, 1020, 1029, 1028, 346, 350, 369, 367], + [1020, 1022, 1030, 1029, 350, 354, 371, 369], + [1022, 1024, 1031, 1030, 354, 358, 373, 371], + [1024, 1026, 1032, 1031, 358, 362, 375, 373], + [ 957, 1027, 1033, 964, 225, 365, 377, 239], + [1027, 1028, 1034, 1033, 365, 367, 379, 377], + [1028, 1029, 1035, 1034, 367, 369, 381, 379], + [1029, 1030, 1036, 1035, 369, 371, 383, 381], + [1030, 1031, 1037, 1036, 371, 373, 385, 383], + [1031, 1032, 1038, 1037, 373, 375, 387, 385], + [ 964, 1033, 1039, 971, 239, 377, 389, 253], + [1033, 1034, 1040, 1039, 377, 379, 391, 389], + [1034, 1035, 1041, 1040, 379, 381, 393, 391], + [1035, 1036, 1042, 1041, 381, 383, 395, 393], + [1036, 1037, 1043, 1042, 383, 385, 397, 395], + [1037, 1038, 1044, 1043, 385, 387, 399, 397], + [ 971, 1039, 1045, 978, 253, 389, 401, 267], + [1039, 1040, 1046, 1045, 389, 391, 403, 401], + [1040, 1041, 1047, 1046, 391, 393, 405, 403], + [1041, 1042, 1048, 1047, 393, 395, 407, 405], + [1042, 1043, 1049, 1048, 395, 397, 409, 407], + [1043, 1044, 1050, 1049, 397, 399, 411, 409], + [ 978, 1045, 1051, 985, 267, 401, 413, 281], + [1045, 1046, 1052, 1051, 401, 403, 415, 413], + [1046, 1047, 1053, 1052, 403, 405, 417, 415], + [1047, 1048, 1054, 1053, 405, 407, 419, 417], + [1048, 1049, 1055, 1054, 407, 409, 421, 419], + [1049, 1050, 1056, 1055, 409, 411, 423, 421], + [1053, 1054, 1057, 1058, 417, 419, 425, 426], + [1054, 1055, 1059, 1057, 419, 421, 429, 425], + [1055, 1056, 1060, 1059, 421, 423, 431, 429], + [1058, 1057, 1061, 1062, 426, 425, 433, 434], + [1057, 1059, 1063, 1061, 425, 429, 437, 433], + [1059, 1060, 1064, 1063, 429, 431, 439, 437], + [1062, 1061, 1065, 1066, 434, 433, 441, 442], + [1061, 1063, 1067, 1065, 433, 437, 445, 441], + [1063, 1064, 1068, 1067, 437, 439, 447, 445], + [1068, 1069, 1070, 1067, 447, 449, 450, 445], + [1069, 1071, 1072, 1070, 449, 453, 454, 450], + [1071, 919, 1003, 1072, 453, 149, 317, 454], + [1067, 1070, 1073, 1065, 445, 450, 457, 441], + [1070, 1072, 1074, 1073, 450, 454, 459, 457], + [1072, 1003, 1001, 1074, 454, 317, 313, 459], + [1065, 1073, 1075, 1066, 441, 457, 461, 442], + [1073, 1074, 1076, 1075, 457, 459, 463, 461], + [1074, 1001, 1000, 1076, 459, 313, 311, 463], + [1000, 995, 1077, 1076, 311, 301, 465, 463], + [ 995, 990, 1078, 1077, 301, 291, 467, 465], + [ 990, 985, 1051, 1078, 291, 281, 413, 467], + [1076, 1077, 1079, 1075, 463, 465, 469, 461], + [1077, 1078, 1080, 1079, 465, 467, 471, 469], + [1078, 1051, 1052, 1080, 467, 413, 415, 471], + [1075, 1079, 1062, 1066, 461, 469, 434, 442], + [1079, 1080, 1058, 1062, 469, 471, 426, 434], + [1080, 1052, 1053, 1058, 471, 415, 417, 426], + [1025, 1081, 1082, 1026, 361, 473, 474, 362], + [1081, 1083, 1084, 1082, 473, 477, 478, 474], + [1083, 1085, 1086, 1084, 477, 481, 482, 478], + [1085, 1087, 1088, 1086, 481, 485, 486, 482], + [1087, 1089, 1090, 1088, 485, 489, 490, 486], + [1089, 1091, 1092, 1090, 489, 493, 494, 490], + [1026, 1082, 1093, 1032, 362, 474, 497, 375], + [1082, 1084, 1094, 1093, 474, 478, 499, 497], + [1084, 1086, 1095, 1094, 478, 482, 501, 499], + [1086, 1088, 1096, 1095, 482, 486, 503, 501], + [1088, 1090, 1097, 1096, 486, 490, 505, 503], + [1090, 1092, 1098, 1097, 490, 494, 507, 505], + [1032, 1093, 1099, 1038, 375, 497, 509, 387], + [1093, 1094, 1100, 1099, 497, 499, 511, 509], + [1094, 1095, 1101, 1100, 499, 501, 513, 511], + [1095, 1096, 1102, 1101, 501, 503, 515, 513], + [1096, 1097, 1103, 1102, 503, 505, 517, 515], + [1097, 1098, 1104, 1103, 505, 507, 519, 517], + [1038, 1099, 1105, 1044, 387, 509, 521, 399], + [1099, 1100, 1106, 1105, 509, 511, 523, 521], + [1100, 1101, 1107, 1106, 511, 513, 525, 523], + [1101, 1102, 1108, 1107, 513, 515, 527, 525], + [1102, 1103, 1109, 1108, 515, 517, 529, 527], + [1103, 1104, 1110, 1109, 517, 519, 531, 529], + [1044, 1105, 1111, 1050, 399, 521, 533, 411], + [1105, 1106, 1112, 1111, 521, 523, 535, 533], + [1106, 1107, 1113, 1112, 523, 525, 537, 535], + [1107, 1108, 1114, 1113, 525, 527, 539, 537], + [1108, 1109, 1115, 1114, 527, 529, 541, 539], + [1109, 1110, 1116, 1115, 529, 531, 543, 541], + [1050, 1111, 1117, 1056, 411, 533, 545, 423], + [1111, 1112, 1118, 1117, 533, 535, 547, 545], + [1112, 1113, 1119, 1118, 535, 537, 549, 547], + [1113, 1114, 1120, 1119, 537, 539, 551, 549], + [1114, 1115, 1121, 1120, 539, 541, 553, 551], + [1115, 1116, 1122, 1121, 541, 543, 555, 553], + [1119, 1120, 1123, 1124, 549, 551, 557, 558], + [1120, 1121, 1125, 1123, 551, 553, 561, 557], + [1121, 1122, 1126, 1125, 553, 555, 563, 561], + [1124, 1123, 1127, 1128, 558, 557, 565, 566], + [1123, 1125, 1129, 1127, 557, 561, 569, 565], + [1125, 1126, 1130, 1129, 561, 563, 571, 569], + [1128, 1127, 1131, 1132, 566, 565, 573, 574], + [1127, 1129, 1133, 1131, 565, 569, 577, 573], + [1129, 1130, 1134, 1133, 569, 571, 579, 577], + [1134, 1135, 1136, 1133, 579, 581, 582, 577], + [1135, 1137, 1138, 1136, 581, 585, 586, 582], + [1137, 919, 1071, 1138, 585, 149, 453, 586], + [1133, 1136, 1139, 1131, 577, 582, 589, 573], + [1136, 1138, 1140, 1139, 582, 586, 591, 589], + [1138, 1071, 1069, 1140, 586, 453, 449, 591], + [1131, 1139, 1141, 1132, 573, 589, 593, 574], + [1139, 1140, 1142, 1141, 589, 591, 595, 593], + [1140, 1069, 1068, 1142, 591, 449, 447, 595], + [1068, 1064, 1143, 1142, 447, 439, 597, 595], + [1064, 1060, 1144, 1143, 439, 431, 599, 597], + [1060, 1056, 1117, 1144, 431, 423, 545, 599], + [1142, 1143, 1145, 1141, 595, 597, 601, 593], + [1143, 1144, 1146, 1145, 597, 599, 603, 601], + [1144, 1117, 1118, 1146, 599, 545, 547, 603], + [1141, 1145, 1128, 1132, 593, 601, 566, 574], + [1145, 1146, 1124, 1128, 601, 603, 558, 566], + [1146, 1118, 1119, 1124, 603, 547, 549, 558], + [1091, 1147, 1148, 1092, 493, 605, 606, 494], + [1147, 1149, 1150, 1148, 605, 609, 610, 606], + [1149, 1151, 1152, 1150, 609, 613, 614, 610], + [1151, 1153, 1154, 1152, 613, 617, 618, 614], + [1153, 1155, 1156, 1154, 617, 621, 622, 618], + [1155, 1157, 1158, 1156, 621, 625, 626, 622], + [1092, 1148, 1159, 1098, 494, 606, 629, 507], + [1148, 1150, 1160, 1159, 606, 610, 631, 629], + [1150, 1152, 1161, 1160, 610, 614, 633, 631], + [1152, 1154, 1162, 1161, 614, 618, 635, 633], + [1154, 1156, 1163, 1162, 618, 622, 637, 635], + [1156, 1158, 1164, 1163, 622, 626, 639, 637], + [1098, 1159, 1165, 1104, 507, 629, 641, 519], + [1159, 1160, 1166, 1165, 629, 631, 643, 641], + [1160, 1161, 1167, 1166, 631, 633, 645, 643], + [1161, 1162, 1168, 1167, 633, 635, 647, 645], + [1162, 1163, 1169, 1168, 635, 637, 649, 647], + [1163, 1164, 1170, 1169, 637, 639, 651, 649], + [1104, 1165, 1171, 1110, 519, 641, 653, 531], + [1165, 1166, 1172, 1171, 641, 643, 655, 653], + [1166, 1167, 1173, 1172, 643, 645, 657, 655], + [1167, 1168, 1174, 1173, 645, 647, 659, 657], + [1168, 1169, 1175, 1174, 647, 649, 661, 659], + [1169, 1170, 1176, 1175, 649, 651, 663, 661], + [1110, 1171, 1177, 1116, 531, 653, 665, 543], + [1171, 1172, 1178, 1177, 653, 655, 667, 665], + [1172, 1173, 1179, 1178, 655, 657, 669, 667], + [1173, 1174, 1180, 1179, 657, 659, 671, 669], + [1174, 1175, 1181, 1180, 659, 661, 673, 671], + [1175, 1176, 1182, 1181, 661, 663, 675, 673], + [1116, 1177, 1183, 1122, 543, 665, 677, 555], + [1177, 1178, 1184, 1183, 665, 667, 679, 677], + [1178, 1179, 1185, 1184, 667, 669, 681, 679], + [1179, 1180, 1186, 1185, 669, 671, 683, 681], + [1180, 1181, 1187, 1186, 671, 673, 685, 683], + [1181, 1182, 1188, 1187, 673, 675, 687, 685], + [1185, 1186, 1189, 1190, 681, 683, 689, 690], + [1186, 1187, 1191, 1189, 683, 685, 693, 689], + [1187, 1188, 1192, 1191, 685, 687, 695, 693], + [1190, 1189, 1193, 1194, 690, 689, 697, 698], + [1189, 1191, 1195, 1193, 689, 693, 701, 697], + [1191, 1192, 1196, 1195, 693, 695, 703, 701], + [1194, 1193, 1197, 1198, 698, 697, 705, 706], + [1193, 1195, 1199, 1197, 697, 701, 709, 705], + [1195, 1196, 1200, 1199, 701, 703, 711, 709], + [1200, 1201, 1202, 1199, 711, 713, 714, 709], + [1201, 1203, 1204, 1202, 713, 717, 718, 714], + [1203, 919, 1137, 1204, 717, 149, 585, 718], + [1199, 1202, 1205, 1197, 709, 714, 721, 705], + [1202, 1204, 1206, 1205, 714, 718, 723, 721], + [1204, 1137, 1135, 1206, 718, 585, 581, 723], + [1197, 1205, 1207, 1198, 705, 721, 725, 706], + [1205, 1206, 1208, 1207, 721, 723, 727, 725], + [1206, 1135, 1134, 1208, 723, 581, 579, 727], + [1134, 1130, 1209, 1208, 579, 571, 729, 727], + [1130, 1126, 1210, 1209, 571, 563, 731, 729], + [1126, 1122, 1183, 1210, 563, 555, 677, 731], + [1208, 1209, 1211, 1207, 727, 729, 733, 725], + [1209, 1210, 1212, 1211, 729, 731, 735, 733], + [1210, 1183, 1184, 1212, 731, 677, 679, 735], + [1207, 1211, 1194, 1198, 725, 733, 698, 706], + [1211, 1212, 1190, 1194, 733, 735, 690, 698], + [1212, 1184, 1185, 1190, 735, 679, 681, 690], + [1157, 1213, 1214, 1158, 625, 737, 738, 626], + [1213, 1215, 1216, 1214, 737, 741, 742, 738], + [1215, 1217, 1218, 1216, 741, 745, 746, 742], + [1217, 1219, 1220, 1218, 745, 749, 750, 746], + [1219, 1221, 1222, 1220, 749, 753, 754, 750], + [1221, 845, 848, 1222, 753, 1, 4, 754], + [1158, 1214, 1223, 1164, 626, 738, 757, 639], + [1214, 1216, 1224, 1223, 738, 742, 759, 757], + [1216, 1218, 1225, 1224, 742, 746, 761, 759], + [1218, 1220, 1226, 1225, 746, 750, 763, 761], + [1220, 1222, 1227, 1226, 750, 754, 765, 763], + [1222, 848, 862, 1227, 754, 4, 34, 765], + [1164, 1223, 1228, 1170, 639, 757, 767, 651], + [1223, 1224, 1229, 1228, 757, 759, 769, 767], + [1224, 1225, 1230, 1229, 759, 761, 771, 769], + [1225, 1226, 1231, 1230, 761, 763, 773, 771], + [1226, 1227, 1232, 1231, 763, 765, 775, 773], + [1227, 862, 870, 1232, 765, 34, 50, 775], + [1170, 1228, 1233, 1176, 651, 767, 777, 663], + [1228, 1229, 1234, 1233, 767, 769, 779, 777], + [1229, 1230, 1235, 1234, 769, 771, 781, 779], + [1230, 1231, 1236, 1235, 771, 773, 783, 781], + [1231, 1232, 1237, 1236, 773, 775, 785, 783], + [1232, 870, 878, 1237, 775, 50, 66, 785], + [1176, 1233, 1238, 1182, 663, 777, 787, 675], + [1233, 1234, 1239, 1238, 777, 779, 789, 787], + [1234, 1235, 1240, 1239, 779, 781, 791, 789], + [1235, 1236, 1241, 1240, 781, 783, 793, 791], + [1236, 1237, 1242, 1241, 783, 785, 795, 793], + [1237, 878, 886, 1242, 785, 66, 82, 795], + [1182, 1238, 1243, 1188, 675, 787, 797, 687], + [1238, 1239, 1244, 1243, 787, 789, 799, 797], + [1239, 1240, 1245, 1244, 789, 791, 801, 799], + [1240, 1241, 1246, 1245, 791, 793, 803, 801], + [1241, 1242, 1247, 1246, 793, 795, 805, 803], + [1242, 886, 894, 1247, 795, 82, 98, 805], + [1245, 1246, 1248, 1249, 801, 803, 807, 808], + [1246, 1247, 1250, 1248, 803, 805, 811, 807], + [1247, 894, 931, 1250, 805, 98, 173, 811], + [1249, 1248, 1251, 1252, 808, 807, 813, 814], + [1248, 1250, 1253, 1251, 807, 811, 817, 813], + [1250, 931, 929, 1253, 811, 173, 169, 817], + [1252, 1251, 1254, 1255, 814, 813, 819, 820], + [1251, 1253, 1256, 1254, 813, 817, 823, 819], + [1253, 929, 928, 1256, 817, 169, 167, 823], + [ 928, 924, 1257, 1256, 167, 159, 825, 823], + [ 924, 920, 1258, 1257, 159, 150, 827, 825], + [ 920, 919, 1203, 1258, 150, 149, 717, 827], + [1256, 1257, 1259, 1254, 823, 825, 829, 819], + [1257, 1258, 1260, 1259, 825, 827, 831, 829], + [1258, 1203, 1201, 1260, 827, 717, 713, 831], + [1254, 1259, 1261, 1255, 819, 829, 833, 820], + [1259, 1260, 1262, 1261, 829, 831, 835, 833], + [1260, 1201, 1200, 1262, 831, 713, 711, 835], + [1200, 1196, 1263, 1262, 711, 703, 837, 835], + [1196, 1192, 1264, 1263, 703, 695, 839, 837], + [1192, 1188, 1243, 1264, 695, 687, 797, 839], + [1262, 1263, 1265, 1261, 835, 837, 841, 833], + [1263, 1264, 1266, 1265, 837, 839, 843, 841], + [1264, 1243, 1244, 1266, 839, 797, 799, 843], + [1261, 1265, 1252, 1255, 833, 841, 814, 820], + [1265, 1266, 1249, 1252, 841, 843, 808, 814], + [1266, 1244, 1245, 1249, 843, 799, 801, 808], + [1267, 1268, 1269, 1270, 845, 846, 847, 848], + [1268, 1271, 1272, 1269, 846, 849, 850, 847], + [1271, 1273, 1274, 1272, 849, 851, 852, 850], + [1273, 1275, 1276, 1274, 851, 853, 854, 852], + [1275, 1277, 1278, 1276, 853, 855, 856, 854], + [1277, 1279, 1280, 1278, 855, 857, 858, 856], + [1279, 1281, 1282, 1280, 857, 859, 860, 858], + [1270, 1269, 1283, 1284, 848, 847, 861, 862], + [1269, 1272, 1285, 1283, 847, 850, 863, 861], + [1272, 1274, 1286, 1285, 850, 852, 864, 863], + [1274, 1276, 1287, 1286, 852, 854, 865, 864], + [1276, 1278, 1288, 1287, 854, 856, 866, 865], + [1278, 1280, 1289, 1288, 856, 858, 867, 866], + [1280, 1282, 1290, 1289, 858, 860, 868, 867], + [1284, 1283, 1291, 1292, 862, 861, 869, 870], + [1283, 1285, 1293, 1291, 861, 863, 871, 869], + [1285, 1286, 1294, 1293, 863, 864, 872, 871], + [1286, 1287, 1295, 1294, 864, 865, 873, 872], + [1287, 1288, 1296, 1295, 865, 866, 874, 873], + [1288, 1289, 1297, 1296, 866, 867, 875, 874], + [1289, 1290, 1298, 1297, 867, 868, 876, 875], + [1292, 1291, 1299, 1300, 870, 869, 877, 878], + [1291, 1293, 1301, 1299, 869, 871, 879, 877], + [1293, 1294, 1302, 1301, 871, 872, 880, 879], + [1294, 1295, 1303, 1302, 872, 873, 881, 880], + [1295, 1296, 1304, 1303, 873, 874, 882, 881], + [1296, 1297, 1305, 1304, 874, 875, 883, 882], + [1297, 1298, 1306, 1305, 875, 876, 884, 883], + [1300, 1299, 1307, 1308, 878, 877, 885, 886], + [1299, 1301, 1309, 1307, 877, 879, 887, 885], + [1301, 1302, 1310, 1309, 879, 880, 888, 887], + [1302, 1303, 1311, 1310, 880, 881, 889, 888], + [1303, 1304, 1312, 1311, 881, 882, 890, 889], + [1304, 1305, 1313, 1312, 882, 883, 891, 890], + [1305, 1306, 1314, 1313, 883, 884, 892, 891], + [1308, 1307, 1315, 1316, 886, 885, 893, 894], + [1307, 1309, 1317, 1315, 885, 887, 895, 893], + [1309, 1310, 1318, 1317, 887, 888, 896, 895], + [1310, 1311, 1319, 1318, 888, 889, 897, 896], + [1311, 1312, 1320, 1319, 889, 890, 898, 897], + [1312, 1313, 1321, 1320, 890, 891, 899, 898], + [1313, 1314, 1322, 1321, 891, 892, 900, 899], + [1319, 1320, 1323, 1324, 897, 898, 901, 902], + [1320, 1321, 1325, 1323, 898, 899, 903, 901], + [1321, 1322, 1326, 1325, 899, 900, 904, 903], + [1324, 1323, 1327, 1328, 902, 901, 905, 906], + [1323, 1325, 1329, 1327, 901, 903, 907, 905], + [1325, 1326, 1330, 1329, 903, 904, 908, 907], + [1328, 1327, 1331, 1332, 906, 905, 909, 910], + [1327, 1329, 1333, 1331, 905, 907, 911, 909], + [1329, 1330, 1334, 1333, 907, 908, 912, 911], + [1334, 1335, 1336, 1333, 912, 913, 914, 911], + [1335, 1337, 1338, 1336, 913, 915, 916, 914], + [1337, 1339, 1340, 1338, 915, 917, 918, 916], + [1339, 1341, 1342, 1340, 917, 919, 920, 918], + [1333, 1336, 1343, 1331, 911, 914, 921, 909], + [1336, 1338, 1344, 1343, 914, 916, 922, 921], + [1338, 1340, 1345, 1344, 916, 918, 923, 922], + [1340, 1342, 1346, 1345, 918, 920, 924, 923], + [1331, 1343, 1347, 1332, 909, 921, 925, 910], + [1343, 1344, 1348, 1347, 921, 922, 926, 925], + [1344, 1345, 1349, 1348, 922, 923, 927, 926], + [1345, 1346, 1350, 1349, 923, 924, 928, 927], + [1350, 1351, 1352, 1349, 928, 929, 930, 927], + [1351, 1353, 1354, 1352, 929, 931, 932, 930], + [1353, 1316, 1315, 1354, 931, 894, 893, 932], + [1349, 1352, 1355, 1348, 927, 930, 933, 926], + [1352, 1354, 1356, 1355, 930, 932, 934, 933], + [1354, 1315, 1317, 1356, 932, 893, 895, 934], + [1348, 1355, 1357, 1347, 926, 933, 935, 925], + [1355, 1356, 1358, 1357, 933, 934, 936, 935], + [1356, 1317, 1318, 1358, 934, 895, 896, 936], + [1347, 1357, 1328, 1332, 925, 935, 906, 910], + [1357, 1358, 1324, 1328, 935, 936, 902, 906], + [1358, 1318, 1319, 1324, 936, 896, 897, 902], + [1281, 1359, 1360, 1282, 859, 937, 938, 860], + [1359, 1361, 1362, 1360, 937, 939, 940, 938], + [1361, 1363, 1364, 1362, 939, 941, 942, 940], + [1363, 1365, 1366, 1364, 941, 943, 944, 942], + [1365, 1367, 1368, 1366, 943, 945, 946, 944], + [1367, 1369, 1370, 1368, 945, 947, 948, 946], + [1369, 1371, 1372, 1370, 947, 949, 950, 948], + [1282, 1360, 1373, 1290, 860, 938, 951, 868], + [1360, 1362, 1374, 1373, 938, 940, 952, 951], + [1362, 1364, 1375, 1374, 940, 942, 953, 952], + [1364, 1366, 1376, 1375, 942, 944, 954, 953], + [1366, 1368, 1377, 1376, 944, 946, 955, 954], + [1368, 1370, 1378, 1377, 946, 948, 956, 955], + [1370, 1372, 1379, 1378, 948, 950, 957, 956], + [1290, 1373, 1380, 1298, 868, 951, 958, 876], + [1373, 1374, 1381, 1380, 951, 952, 959, 958], + [1374, 1375, 1382, 1381, 952, 953, 960, 959], + [1375, 1376, 1383, 1382, 953, 954, 961, 960], + [1376, 1377, 1384, 1383, 954, 955, 962, 961], + [1377, 1378, 1385, 1384, 955, 956, 963, 962], + [1378, 1379, 1386, 1385, 956, 957, 964, 963], + [1298, 1380, 1387, 1306, 876, 958, 965, 884], + [1380, 1381, 1388, 1387, 958, 959, 966, 965], + [1381, 1382, 1389, 1388, 959, 960, 967, 966], + [1382, 1383, 1390, 1389, 960, 961, 968, 967], + [1383, 1384, 1391, 1390, 961, 962, 969, 968], + [1384, 1385, 1392, 1391, 962, 963, 970, 969], + [1385, 1386, 1393, 1392, 963, 964, 971, 970], + [1306, 1387, 1394, 1314, 884, 965, 972, 892], + [1387, 1388, 1395, 1394, 965, 966, 973, 972], + [1388, 1389, 1396, 1395, 966, 967, 974, 973], + [1389, 1390, 1397, 1396, 967, 968, 975, 974], + [1390, 1391, 1398, 1397, 968, 969, 976, 975], + [1391, 1392, 1399, 1398, 969, 970, 977, 976], + [1392, 1393, 1400, 1399, 970, 971, 978, 977], + [1314, 1394, 1401, 1322, 892, 972, 979, 900], + [1394, 1395, 1402, 1401, 972, 973, 980, 979], + [1395, 1396, 1403, 1402, 973, 974, 981, 980], + [1396, 1397, 1404, 1403, 974, 975, 982, 981], + [1397, 1398, 1405, 1404, 975, 976, 983, 982], + [1398, 1399, 1406, 1405, 976, 977, 984, 983], + [1399, 1400, 1407, 1406, 977, 978, 985, 984], + [1403, 1404, 1408, 1409, 981, 982, 986, 987], + [1404, 1405, 1410, 1408, 982, 983, 988, 986], + [1405, 1406, 1411, 1410, 983, 984, 989, 988], + [1406, 1407, 1412, 1411, 984, 985, 990, 989], + [1409, 1408, 1413, 1414, 987, 986, 991, 992], + [1408, 1410, 1415, 1413, 986, 988, 993, 991], + [1410, 1411, 1416, 1415, 988, 989, 994, 993], + [1411, 1412, 1417, 1416, 989, 990, 995, 994], + [1414, 1413, 1418, 1419, 992, 991, 996, 997], + [1413, 1415, 1420, 1418, 991, 993, 998, 996], + [1415, 1416, 1421, 1420, 993, 994, 999, 998], + [1416, 1417, 1422, 1421, 994, 995, 1000, 999], + [1422, 1423, 1424, 1421, 1000, 1001, 1002, 999], + [1423, 1425, 1426, 1424, 1001, 1003, 1004, 1002], + [1425, 1341, 1339, 1426, 1003, 919, 917, 1004], + [1421, 1424, 1427, 1420, 999, 1002, 1005, 998], + [1424, 1426, 1428, 1427, 1002, 1004, 1006, 1005], + [1426, 1339, 1337, 1428, 1004, 917, 915, 1006], + [1420, 1427, 1429, 1418, 998, 1005, 1007, 996], + [1427, 1428, 1430, 1429, 1005, 1006, 1008, 1007], + [1428, 1337, 1335, 1430, 1006, 915, 913, 1008], + [1418, 1429, 1431, 1419, 996, 1007, 1009, 997], + [1429, 1430, 1432, 1431, 1007, 1008, 1010, 1009], + [1430, 1335, 1334, 1432, 1008, 913, 912, 1010], + [1334, 1330, 1433, 1432, 912, 908, 1011, 1010], + [1330, 1326, 1434, 1433, 908, 904, 1012, 1011], + [1326, 1322, 1401, 1434, 904, 900, 979, 1012], + [1432, 1433, 1435, 1431, 1010, 1011, 1013, 1009], + [1433, 1434, 1436, 1435, 1011, 1012, 1014, 1013], + [1434, 1401, 1402, 1436, 1012, 979, 980, 1014], + [1431, 1435, 1414, 1419, 1009, 1013, 992, 997], + [1435, 1436, 1409, 1414, 1013, 1014, 987, 992], + [1436, 1402, 1403, 1409, 1014, 980, 981, 987], + [1371, 1437, 1438, 1372, 949, 1015, 1016, 950], + [1437, 1439, 1440, 1438, 1015, 1017, 1018, 1016], + [1439, 1441, 1442, 1440, 1017, 1019, 1020, 1018], + [1441, 1443, 1444, 1442, 1019, 1021, 1022, 1020], + [1443, 1445, 1446, 1444, 1021, 1023, 1024, 1022], + [1445, 1447, 1448, 1446, 1023, 1025, 1026, 1024], + [1372, 1438, 1449, 1379, 950, 1016, 1027, 957], + [1438, 1440, 1450, 1449, 1016, 1018, 1028, 1027], + [1440, 1442, 1451, 1450, 1018, 1020, 1029, 1028], + [1442, 1444, 1452, 1451, 1020, 1022, 1030, 1029], + [1444, 1446, 1453, 1452, 1022, 1024, 1031, 1030], + [1446, 1448, 1454, 1453, 1024, 1026, 1032, 1031], + [1379, 1449, 1455, 1386, 957, 1027, 1033, 964], + [1449, 1450, 1456, 1455, 1027, 1028, 1034, 1033], + [1450, 1451, 1457, 1456, 1028, 1029, 1035, 1034], + [1451, 1452, 1458, 1457, 1029, 1030, 1036, 1035], + [1452, 1453, 1459, 1458, 1030, 1031, 1037, 1036], + [1453, 1454, 1460, 1459, 1031, 1032, 1038, 1037], + [1386, 1455, 1461, 1393, 964, 1033, 1039, 971], + [1455, 1456, 1462, 1461, 1033, 1034, 1040, 1039], + [1456, 1457, 1463, 1462, 1034, 1035, 1041, 1040], + [1457, 1458, 1464, 1463, 1035, 1036, 1042, 1041], + [1458, 1459, 1465, 1464, 1036, 1037, 1043, 1042], + [1459, 1460, 1466, 1465, 1037, 1038, 1044, 1043], + [1393, 1461, 1467, 1400, 971, 1039, 1045, 978], + [1461, 1462, 1468, 1467, 1039, 1040, 1046, 1045], + [1462, 1463, 1469, 1468, 1040, 1041, 1047, 1046], + [1463, 1464, 1470, 1469, 1041, 1042, 1048, 1047], + [1464, 1465, 1471, 1470, 1042, 1043, 1049, 1048], + [1465, 1466, 1472, 1471, 1043, 1044, 1050, 1049], + [1400, 1467, 1473, 1407, 978, 1045, 1051, 985], + [1467, 1468, 1474, 1473, 1045, 1046, 1052, 1051], + [1468, 1469, 1475, 1474, 1046, 1047, 1053, 1052], + [1469, 1470, 1476, 1475, 1047, 1048, 1054, 1053], + [1470, 1471, 1477, 1476, 1048, 1049, 1055, 1054], + [1471, 1472, 1478, 1477, 1049, 1050, 1056, 1055], + [1475, 1476, 1479, 1480, 1053, 1054, 1057, 1058], + [1476, 1477, 1481, 1479, 1054, 1055, 1059, 1057], + [1477, 1478, 1482, 1481, 1055, 1056, 1060, 1059], + [1480, 1479, 1483, 1484, 1058, 1057, 1061, 1062], + [1479, 1481, 1485, 1483, 1057, 1059, 1063, 1061], + [1481, 1482, 1486, 1485, 1059, 1060, 1064, 1063], + [1484, 1483, 1487, 1488, 1062, 1061, 1065, 1066], + [1483, 1485, 1489, 1487, 1061, 1063, 1067, 1065], + [1485, 1486, 1490, 1489, 1063, 1064, 1068, 1067], + [1490, 1491, 1492, 1489, 1068, 1069, 1070, 1067], + [1491, 1493, 1494, 1492, 1069, 1071, 1072, 1070], + [1493, 1341, 1425, 1494, 1071, 919, 1003, 1072], + [1489, 1492, 1495, 1487, 1067, 1070, 1073, 1065], + [1492, 1494, 1496, 1495, 1070, 1072, 1074, 1073], + [1494, 1425, 1423, 1496, 1072, 1003, 1001, 1074], + [1487, 1495, 1497, 1488, 1065, 1073, 1075, 1066], + [1495, 1496, 1498, 1497, 1073, 1074, 1076, 1075], + [1496, 1423, 1422, 1498, 1074, 1001, 1000, 1076], + [1422, 1417, 1499, 1498, 1000, 995, 1077, 1076], + [1417, 1412, 1500, 1499, 995, 990, 1078, 1077], + [1412, 1407, 1473, 1500, 990, 985, 1051, 1078], + [1498, 1499, 1501, 1497, 1076, 1077, 1079, 1075], + [1499, 1500, 1502, 1501, 1077, 1078, 1080, 1079], + [1500, 1473, 1474, 1502, 1078, 1051, 1052, 1080], + [1497, 1501, 1484, 1488, 1075, 1079, 1062, 1066], + [1501, 1502, 1480, 1484, 1079, 1080, 1058, 1062], + [1502, 1474, 1475, 1480, 1080, 1052, 1053, 1058], + [1447, 1503, 1504, 1448, 1025, 1081, 1082, 1026], + [1503, 1505, 1506, 1504, 1081, 1083, 1084, 1082], + [1505, 1507, 1508, 1506, 1083, 1085, 1086, 1084], + [1507, 1509, 1510, 1508, 1085, 1087, 1088, 1086], + [1509, 1511, 1512, 1510, 1087, 1089, 1090, 1088], + [1511, 1513, 1514, 1512, 1089, 1091, 1092, 1090], + [1448, 1504, 1515, 1454, 1026, 1082, 1093, 1032], + [1504, 1506, 1516, 1515, 1082, 1084, 1094, 1093], + [1506, 1508, 1517, 1516, 1084, 1086, 1095, 1094], + [1508, 1510, 1518, 1517, 1086, 1088, 1096, 1095], + [1510, 1512, 1519, 1518, 1088, 1090, 1097, 1096], + [1512, 1514, 1520, 1519, 1090, 1092, 1098, 1097], + [1454, 1515, 1521, 1460, 1032, 1093, 1099, 1038], + [1515, 1516, 1522, 1521, 1093, 1094, 1100, 1099], + [1516, 1517, 1523, 1522, 1094, 1095, 1101, 1100], + [1517, 1518, 1524, 1523, 1095, 1096, 1102, 1101], + [1518, 1519, 1525, 1524, 1096, 1097, 1103, 1102], + [1519, 1520, 1526, 1525, 1097, 1098, 1104, 1103], + [1460, 1521, 1527, 1466, 1038, 1099, 1105, 1044], + [1521, 1522, 1528, 1527, 1099, 1100, 1106, 1105], + [1522, 1523, 1529, 1528, 1100, 1101, 1107, 1106], + [1523, 1524, 1530, 1529, 1101, 1102, 1108, 1107], + [1524, 1525, 1531, 1530, 1102, 1103, 1109, 1108], + [1525, 1526, 1532, 1531, 1103, 1104, 1110, 1109], + [1466, 1527, 1533, 1472, 1044, 1105, 1111, 1050], + [1527, 1528, 1534, 1533, 1105, 1106, 1112, 1111], + [1528, 1529, 1535, 1534, 1106, 1107, 1113, 1112], + [1529, 1530, 1536, 1535, 1107, 1108, 1114, 1113], + [1530, 1531, 1537, 1536, 1108, 1109, 1115, 1114], + [1531, 1532, 1538, 1537, 1109, 1110, 1116, 1115], + [1472, 1533, 1539, 1478, 1050, 1111, 1117, 1056], + [1533, 1534, 1540, 1539, 1111, 1112, 1118, 1117], + [1534, 1535, 1541, 1540, 1112, 1113, 1119, 1118], + [1535, 1536, 1542, 1541, 1113, 1114, 1120, 1119], + [1536, 1537, 1543, 1542, 1114, 1115, 1121, 1120], + [1537, 1538, 1544, 1543, 1115, 1116, 1122, 1121], + [1541, 1542, 1545, 1546, 1119, 1120, 1123, 1124], + [1542, 1543, 1547, 1545, 1120, 1121, 1125, 1123], + [1543, 1544, 1548, 1547, 1121, 1122, 1126, 1125], + [1546, 1545, 1549, 1550, 1124, 1123, 1127, 1128], + [1545, 1547, 1551, 1549, 1123, 1125, 1129, 1127], + [1547, 1548, 1552, 1551, 1125, 1126, 1130, 1129], + [1550, 1549, 1553, 1554, 1128, 1127, 1131, 1132], + [1549, 1551, 1555, 1553, 1127, 1129, 1133, 1131], + [1551, 1552, 1556, 1555, 1129, 1130, 1134, 1133], + [1556, 1557, 1558, 1555, 1134, 1135, 1136, 1133], + [1557, 1559, 1560, 1558, 1135, 1137, 1138, 1136], + [1559, 1341, 1493, 1560, 1137, 919, 1071, 1138], + [1555, 1558, 1561, 1553, 1133, 1136, 1139, 1131], + [1558, 1560, 1562, 1561, 1136, 1138, 1140, 1139], + [1560, 1493, 1491, 1562, 1138, 1071, 1069, 1140], + [1553, 1561, 1563, 1554, 1131, 1139, 1141, 1132], + [1561, 1562, 1564, 1563, 1139, 1140, 1142, 1141], + [1562, 1491, 1490, 1564, 1140, 1069, 1068, 1142], + [1490, 1486, 1565, 1564, 1068, 1064, 1143, 1142], + [1486, 1482, 1566, 1565, 1064, 1060, 1144, 1143], + [1482, 1478, 1539, 1566, 1060, 1056, 1117, 1144], + [1564, 1565, 1567, 1563, 1142, 1143, 1145, 1141], + [1565, 1566, 1568, 1567, 1143, 1144, 1146, 1145], + [1566, 1539, 1540, 1568, 1144, 1117, 1118, 1146], + [1563, 1567, 1550, 1554, 1141, 1145, 1128, 1132], + [1567, 1568, 1546, 1550, 1145, 1146, 1124, 1128], + [1568, 1540, 1541, 1546, 1146, 1118, 1119, 1124], + [1513, 1569, 1570, 1514, 1091, 1147, 1148, 1092], + [1569, 1571, 1572, 1570, 1147, 1149, 1150, 1148], + [1571, 1573, 1574, 1572, 1149, 1151, 1152, 1150], + [1573, 1575, 1576, 1574, 1151, 1153, 1154, 1152], + [1575, 1577, 1578, 1576, 1153, 1155, 1156, 1154], + [1577, 1579, 1580, 1578, 1155, 1157, 1158, 1156], + [1514, 1570, 1581, 1520, 1092, 1148, 1159, 1098], + [1570, 1572, 1582, 1581, 1148, 1150, 1160, 1159], + [1572, 1574, 1583, 1582, 1150, 1152, 1161, 1160], + [1574, 1576, 1584, 1583, 1152, 1154, 1162, 1161], + [1576, 1578, 1585, 1584, 1154, 1156, 1163, 1162], + [1578, 1580, 1586, 1585, 1156, 1158, 1164, 1163], + [1520, 1581, 1587, 1526, 1098, 1159, 1165, 1104], + [1581, 1582, 1588, 1587, 1159, 1160, 1166, 1165], + [1582, 1583, 1589, 1588, 1160, 1161, 1167, 1166], + [1583, 1584, 1590, 1589, 1161, 1162, 1168, 1167], + [1584, 1585, 1591, 1590, 1162, 1163, 1169, 1168], + [1585, 1586, 1592, 1591, 1163, 1164, 1170, 1169], + [1526, 1587, 1593, 1532, 1104, 1165, 1171, 1110], + [1587, 1588, 1594, 1593, 1165, 1166, 1172, 1171], + [1588, 1589, 1595, 1594, 1166, 1167, 1173, 1172], + [1589, 1590, 1596, 1595, 1167, 1168, 1174, 1173], + [1590, 1591, 1597, 1596, 1168, 1169, 1175, 1174], + [1591, 1592, 1598, 1597, 1169, 1170, 1176, 1175], + [1532, 1593, 1599, 1538, 1110, 1171, 1177, 1116], + [1593, 1594, 1600, 1599, 1171, 1172, 1178, 1177], + [1594, 1595, 1601, 1600, 1172, 1173, 1179, 1178], + [1595, 1596, 1602, 1601, 1173, 1174, 1180, 1179], + [1596, 1597, 1603, 1602, 1174, 1175, 1181, 1180], + [1597, 1598, 1604, 1603, 1175, 1176, 1182, 1181], + [1538, 1599, 1605, 1544, 1116, 1177, 1183, 1122], + [1599, 1600, 1606, 1605, 1177, 1178, 1184, 1183], + [1600, 1601, 1607, 1606, 1178, 1179, 1185, 1184], + [1601, 1602, 1608, 1607, 1179, 1180, 1186, 1185], + [1602, 1603, 1609, 1608, 1180, 1181, 1187, 1186], + [1603, 1604, 1610, 1609, 1181, 1182, 1188, 1187], + [1607, 1608, 1611, 1612, 1185, 1186, 1189, 1190], + [1608, 1609, 1613, 1611, 1186, 1187, 1191, 1189], + [1609, 1610, 1614, 1613, 1187, 1188, 1192, 1191], + [1612, 1611, 1615, 1616, 1190, 1189, 1193, 1194], + [1611, 1613, 1617, 1615, 1189, 1191, 1195, 1193], + [1613, 1614, 1618, 1617, 1191, 1192, 1196, 1195], + [1616, 1615, 1619, 1620, 1194, 1193, 1197, 1198], + [1615, 1617, 1621, 1619, 1193, 1195, 1199, 1197], + [1617, 1618, 1622, 1621, 1195, 1196, 1200, 1199], + [1622, 1623, 1624, 1621, 1200, 1201, 1202, 1199], + [1623, 1625, 1626, 1624, 1201, 1203, 1204, 1202], + [1625, 1341, 1559, 1626, 1203, 919, 1137, 1204], + [1621, 1624, 1627, 1619, 1199, 1202, 1205, 1197], + [1624, 1626, 1628, 1627, 1202, 1204, 1206, 1205], + [1626, 1559, 1557, 1628, 1204, 1137, 1135, 1206], + [1619, 1627, 1629, 1620, 1197, 1205, 1207, 1198], + [1627, 1628, 1630, 1629, 1205, 1206, 1208, 1207], + [1628, 1557, 1556, 1630, 1206, 1135, 1134, 1208], + [1556, 1552, 1631, 1630, 1134, 1130, 1209, 1208], + [1552, 1548, 1632, 1631, 1130, 1126, 1210, 1209], + [1548, 1544, 1605, 1632, 1126, 1122, 1183, 1210], + [1630, 1631, 1633, 1629, 1208, 1209, 1211, 1207], + [1631, 1632, 1634, 1633, 1209, 1210, 1212, 1211], + [1632, 1605, 1606, 1634, 1210, 1183, 1184, 1212], + [1629, 1633, 1616, 1620, 1207, 1211, 1194, 1198], + [1633, 1634, 1612, 1616, 1211, 1212, 1190, 1194], + [1634, 1606, 1607, 1612, 1212, 1184, 1185, 1190], + [1579, 1635, 1636, 1580, 1157, 1213, 1214, 1158], + [1635, 1637, 1638, 1636, 1213, 1215, 1216, 1214], + [1637, 1639, 1640, 1638, 1215, 1217, 1218, 1216], + [1639, 1641, 1642, 1640, 1217, 1219, 1220, 1218], + [1641, 1643, 1644, 1642, 1219, 1221, 1222, 1220], + [1643, 1267, 1270, 1644, 1221, 845, 848, 1222], + [1580, 1636, 1645, 1586, 1158, 1214, 1223, 1164], + [1636, 1638, 1646, 1645, 1214, 1216, 1224, 1223], + [1638, 1640, 1647, 1646, 1216, 1218, 1225, 1224], + [1640, 1642, 1648, 1647, 1218, 1220, 1226, 1225], + [1642, 1644, 1649, 1648, 1220, 1222, 1227, 1226], + [1644, 1270, 1284, 1649, 1222, 848, 862, 1227], + [1586, 1645, 1650, 1592, 1164, 1223, 1228, 1170], + [1645, 1646, 1651, 1650, 1223, 1224, 1229, 1228], + [1646, 1647, 1652, 1651, 1224, 1225, 1230, 1229], + [1647, 1648, 1653, 1652, 1225, 1226, 1231, 1230], + [1648, 1649, 1654, 1653, 1226, 1227, 1232, 1231], + [1649, 1284, 1292, 1654, 1227, 862, 870, 1232], + [1592, 1650, 1655, 1598, 1170, 1228, 1233, 1176], + [1650, 1651, 1656, 1655, 1228, 1229, 1234, 1233], + [1651, 1652, 1657, 1656, 1229, 1230, 1235, 1234], + [1652, 1653, 1658, 1657, 1230, 1231, 1236, 1235], + [1653, 1654, 1659, 1658, 1231, 1232, 1237, 1236], + [1654, 1292, 1300, 1659, 1232, 870, 878, 1237], + [1598, 1655, 1660, 1604, 1176, 1233, 1238, 1182], + [1655, 1656, 1661, 1660, 1233, 1234, 1239, 1238], + [1656, 1657, 1662, 1661, 1234, 1235, 1240, 1239], + [1657, 1658, 1663, 1662, 1235, 1236, 1241, 1240], + [1658, 1659, 1664, 1663, 1236, 1237, 1242, 1241], + [1659, 1300, 1308, 1664, 1237, 878, 886, 1242], + [1604, 1660, 1665, 1610, 1182, 1238, 1243, 1188], + [1660, 1661, 1666, 1665, 1238, 1239, 1244, 1243], + [1661, 1662, 1667, 1666, 1239, 1240, 1245, 1244], + [1662, 1663, 1668, 1667, 1240, 1241, 1246, 1245], + [1663, 1664, 1669, 1668, 1241, 1242, 1247, 1246], + [1664, 1308, 1316, 1669, 1242, 886, 894, 1247], + [1667, 1668, 1670, 1671, 1245, 1246, 1248, 1249], + [1668, 1669, 1672, 1670, 1246, 1247, 1250, 1248], + [1669, 1316, 1353, 1672, 1247, 894, 931, 1250], + [1671, 1670, 1673, 1674, 1249, 1248, 1251, 1252], + [1670, 1672, 1675, 1673, 1248, 1250, 1253, 1251], + [1672, 1353, 1351, 1675, 1250, 931, 929, 1253], + [1674, 1673, 1676, 1677, 1252, 1251, 1254, 1255], + [1673, 1675, 1678, 1676, 1251, 1253, 1256, 1254], + [1675, 1351, 1350, 1678, 1253, 929, 928, 1256], + [1350, 1346, 1679, 1678, 928, 924, 1257, 1256], + [1346, 1342, 1680, 1679, 924, 920, 1258, 1257], + [1342, 1341, 1625, 1680, 920, 919, 1203, 1258], + [1678, 1679, 1681, 1676, 1256, 1257, 1259, 1254], + [1679, 1680, 1682, 1681, 1257, 1258, 1260, 1259], + [1680, 1625, 1623, 1682, 1258, 1203, 1201, 1260], + [1676, 1681, 1683, 1677, 1254, 1259, 1261, 1255], + [1681, 1682, 1684, 1683, 1259, 1260, 1262, 1261], + [1682, 1623, 1622, 1684, 1260, 1201, 1200, 1262], + [1622, 1618, 1685, 1684, 1200, 1196, 1263, 1262], + [1618, 1614, 1686, 1685, 1196, 1192, 1264, 1263], + [1614, 1610, 1665, 1686, 1192, 1188, 1243, 1264], + [1684, 1685, 1687, 1683, 1262, 1263, 1265, 1261], + [1685, 1686, 1688, 1687, 1263, 1264, 1266, 1265], + [1686, 1665, 1666, 1688, 1264, 1243, 1244, 1266], + [1683, 1687, 1674, 1677, 1261, 1265, 1252, 1255], + [1687, 1688, 1671, 1674, 1265, 1266, 1249, 1252], + [1688, 1666, 1667, 1671, 1266, 1244, 1245, 1249], + [1689, 1690, 1691, 1692, 1267, 1268, 1269, 1270], + [1690, 1693, 1694, 1691, 1268, 1271, 1272, 1269], + [1693, 1695, 1696, 1694, 1271, 1273, 1274, 1272], + [1695, 1697, 1698, 1696, 1273, 1275, 1276, 1274], + [1697, 1699, 1700, 1698, 1275, 1277, 1278, 1276], + [1699, 1701, 1702, 1700, 1277, 1279, 1280, 1278], + [1701, 1703, 1704, 1702, 1279, 1281, 1282, 1280], + [1692, 1691, 1705, 1706, 1270, 1269, 1283, 1284], + [1691, 1694, 1707, 1705, 1269, 1272, 1285, 1283], + [1694, 1696, 1708, 1707, 1272, 1274, 1286, 1285], + [1696, 1698, 1709, 1708, 1274, 1276, 1287, 1286], + [1698, 1700, 1710, 1709, 1276, 1278, 1288, 1287], + [1700, 1702, 1711, 1710, 1278, 1280, 1289, 1288], + [1702, 1704, 1712, 1711, 1280, 1282, 1290, 1289], + [1706, 1705, 1713, 1714, 1284, 1283, 1291, 1292], + [1705, 1707, 1715, 1713, 1283, 1285, 1293, 1291], + [1707, 1708, 1716, 1715, 1285, 1286, 1294, 1293], + [1708, 1709, 1717, 1716, 1286, 1287, 1295, 1294], + [1709, 1710, 1718, 1717, 1287, 1288, 1296, 1295], + [1710, 1711, 1719, 1718, 1288, 1289, 1297, 1296], + [1711, 1712, 1720, 1719, 1289, 1290, 1298, 1297], + [1714, 1713, 1721, 1722, 1292, 1291, 1299, 1300], + [1713, 1715, 1723, 1721, 1291, 1293, 1301, 1299], + [1715, 1716, 1724, 1723, 1293, 1294, 1302, 1301], + [1716, 1717, 1725, 1724, 1294, 1295, 1303, 1302], + [1717, 1718, 1726, 1725, 1295, 1296, 1304, 1303], + [1718, 1719, 1727, 1726, 1296, 1297, 1305, 1304], + [1719, 1720, 1728, 1727, 1297, 1298, 1306, 1305], + [1722, 1721, 1729, 1730, 1300, 1299, 1307, 1308], + [1721, 1723, 1731, 1729, 1299, 1301, 1309, 1307], + [1723, 1724, 1732, 1731, 1301, 1302, 1310, 1309], + [1724, 1725, 1733, 1732, 1302, 1303, 1311, 1310], + [1725, 1726, 1734, 1733, 1303, 1304, 1312, 1311], + [1726, 1727, 1735, 1734, 1304, 1305, 1313, 1312], + [1727, 1728, 1736, 1735, 1305, 1306, 1314, 1313], + [1730, 1729, 1737, 1738, 1308, 1307, 1315, 1316], + [1729, 1731, 1739, 1737, 1307, 1309, 1317, 1315], + [1731, 1732, 1740, 1739, 1309, 1310, 1318, 1317], + [1732, 1733, 1741, 1740, 1310, 1311, 1319, 1318], + [1733, 1734, 1742, 1741, 1311, 1312, 1320, 1319], + [1734, 1735, 1743, 1742, 1312, 1313, 1321, 1320], + [1735, 1736, 1744, 1743, 1313, 1314, 1322, 1321], + [1741, 1742, 1745, 1746, 1319, 1320, 1323, 1324], + [1742, 1743, 1747, 1745, 1320, 1321, 1325, 1323], + [1743, 1744, 1748, 1747, 1321, 1322, 1326, 1325], + [1746, 1745, 1749, 1750, 1324, 1323, 1327, 1328], + [1745, 1747, 1751, 1749, 1323, 1325, 1329, 1327], + [1747, 1748, 1752, 1751, 1325, 1326, 1330, 1329], + [1750, 1749, 1753, 1754, 1328, 1327, 1331, 1332], + [1749, 1751, 1755, 1753, 1327, 1329, 1333, 1331], + [1751, 1752, 1756, 1755, 1329, 1330, 1334, 1333], + [1756, 1757, 1758, 1755, 1334, 1335, 1336, 1333], + [1757, 1759, 1760, 1758, 1335, 1337, 1338, 1336], + [1759, 1761, 1762, 1760, 1337, 1339, 1340, 1338], + [1761, 1763, 1764, 1762, 1339, 1341, 1342, 1340], + [1755, 1758, 1765, 1753, 1333, 1336, 1343, 1331], + [1758, 1760, 1766, 1765, 1336, 1338, 1344, 1343], + [1760, 1762, 1767, 1766, 1338, 1340, 1345, 1344], + [1762, 1764, 1768, 1767, 1340, 1342, 1346, 1345], + [1753, 1765, 1769, 1754, 1331, 1343, 1347, 1332], + [1765, 1766, 1770, 1769, 1343, 1344, 1348, 1347], + [1766, 1767, 1771, 1770, 1344, 1345, 1349, 1348], + [1767, 1768, 1772, 1771, 1345, 1346, 1350, 1349], + [1772, 1773, 1774, 1771, 1350, 1351, 1352, 1349], + [1773, 1775, 1776, 1774, 1351, 1353, 1354, 1352], + [1775, 1738, 1737, 1776, 1353, 1316, 1315, 1354], + [1771, 1774, 1777, 1770, 1349, 1352, 1355, 1348], + [1774, 1776, 1778, 1777, 1352, 1354, 1356, 1355], + [1776, 1737, 1739, 1778, 1354, 1315, 1317, 1356], + [1770, 1777, 1779, 1769, 1348, 1355, 1357, 1347], + [1777, 1778, 1780, 1779, 1355, 1356, 1358, 1357], + [1778, 1739, 1740, 1780, 1356, 1317, 1318, 1358], + [1769, 1779, 1750, 1754, 1347, 1357, 1328, 1332], + [1779, 1780, 1746, 1750, 1357, 1358, 1324, 1328], + [1780, 1740, 1741, 1746, 1358, 1318, 1319, 1324], + [1703, 1781, 1782, 1704, 1281, 1359, 1360, 1282], + [1781, 1783, 1784, 1782, 1359, 1361, 1362, 1360], + [1783, 1785, 1786, 1784, 1361, 1363, 1364, 1362], + [1785, 1787, 1788, 1786, 1363, 1365, 1366, 1364], + [1787, 1789, 1790, 1788, 1365, 1367, 1368, 1366], + [1789, 1791, 1792, 1790, 1367, 1369, 1370, 1368], + [1791, 1793, 1794, 1792, 1369, 1371, 1372, 1370], + [1704, 1782, 1795, 1712, 1282, 1360, 1373, 1290], + [1782, 1784, 1796, 1795, 1360, 1362, 1374, 1373], + [1784, 1786, 1797, 1796, 1362, 1364, 1375, 1374], + [1786, 1788, 1798, 1797, 1364, 1366, 1376, 1375], + [1788, 1790, 1799, 1798, 1366, 1368, 1377, 1376], + [1790, 1792, 1800, 1799, 1368, 1370, 1378, 1377], + [1792, 1794, 1801, 1800, 1370, 1372, 1379, 1378], + [1712, 1795, 1802, 1720, 1290, 1373, 1380, 1298], + [1795, 1796, 1803, 1802, 1373, 1374, 1381, 1380], + [1796, 1797, 1804, 1803, 1374, 1375, 1382, 1381], + [1797, 1798, 1805, 1804, 1375, 1376, 1383, 1382], + [1798, 1799, 1806, 1805, 1376, 1377, 1384, 1383], + [1799, 1800, 1807, 1806, 1377, 1378, 1385, 1384], + [1800, 1801, 1808, 1807, 1378, 1379, 1386, 1385], + [1720, 1802, 1809, 1728, 1298, 1380, 1387, 1306], + [1802, 1803, 1810, 1809, 1380, 1381, 1388, 1387], + [1803, 1804, 1811, 1810, 1381, 1382, 1389, 1388], + [1804, 1805, 1812, 1811, 1382, 1383, 1390, 1389], + [1805, 1806, 1813, 1812, 1383, 1384, 1391, 1390], + [1806, 1807, 1814, 1813, 1384, 1385, 1392, 1391], + [1807, 1808, 1815, 1814, 1385, 1386, 1393, 1392], + [1728, 1809, 1816, 1736, 1306, 1387, 1394, 1314], + [1809, 1810, 1817, 1816, 1387, 1388, 1395, 1394], + [1810, 1811, 1818, 1817, 1388, 1389, 1396, 1395], + [1811, 1812, 1819, 1818, 1389, 1390, 1397, 1396], + [1812, 1813, 1820, 1819, 1390, 1391, 1398, 1397], + [1813, 1814, 1821, 1820, 1391, 1392, 1399, 1398], + [1814, 1815, 1822, 1821, 1392, 1393, 1400, 1399], + [1736, 1816, 1823, 1744, 1314, 1394, 1401, 1322], + [1816, 1817, 1824, 1823, 1394, 1395, 1402, 1401], + [1817, 1818, 1825, 1824, 1395, 1396, 1403, 1402], + [1818, 1819, 1826, 1825, 1396, 1397, 1404, 1403], + [1819, 1820, 1827, 1826, 1397, 1398, 1405, 1404], + [1820, 1821, 1828, 1827, 1398, 1399, 1406, 1405], + [1821, 1822, 1829, 1828, 1399, 1400, 1407, 1406], + [1825, 1826, 1830, 1831, 1403, 1404, 1408, 1409], + [1826, 1827, 1832, 1830, 1404, 1405, 1410, 1408], + [1827, 1828, 1833, 1832, 1405, 1406, 1411, 1410], + [1828, 1829, 1834, 1833, 1406, 1407, 1412, 1411], + [1831, 1830, 1835, 1836, 1409, 1408, 1413, 1414], + [1830, 1832, 1837, 1835, 1408, 1410, 1415, 1413], + [1832, 1833, 1838, 1837, 1410, 1411, 1416, 1415], + [1833, 1834, 1839, 1838, 1411, 1412, 1417, 1416], + [1836, 1835, 1840, 1841, 1414, 1413, 1418, 1419], + [1835, 1837, 1842, 1840, 1413, 1415, 1420, 1418], + [1837, 1838, 1843, 1842, 1415, 1416, 1421, 1420], + [1838, 1839, 1844, 1843, 1416, 1417, 1422, 1421], + [1844, 1845, 1846, 1843, 1422, 1423, 1424, 1421], + [1845, 1847, 1848, 1846, 1423, 1425, 1426, 1424], + [1847, 1763, 1761, 1848, 1425, 1341, 1339, 1426], + [1843, 1846, 1849, 1842, 1421, 1424, 1427, 1420], + [1846, 1848, 1850, 1849, 1424, 1426, 1428, 1427], + [1848, 1761, 1759, 1850, 1426, 1339, 1337, 1428], + [1842, 1849, 1851, 1840, 1420, 1427, 1429, 1418], + [1849, 1850, 1852, 1851, 1427, 1428, 1430, 1429], + [1850, 1759, 1757, 1852, 1428, 1337, 1335, 1430], + [1840, 1851, 1853, 1841, 1418, 1429, 1431, 1419], + [1851, 1852, 1854, 1853, 1429, 1430, 1432, 1431], + [1852, 1757, 1756, 1854, 1430, 1335, 1334, 1432], + [1756, 1752, 1855, 1854, 1334, 1330, 1433, 1432], + [1752, 1748, 1856, 1855, 1330, 1326, 1434, 1433], + [1748, 1744, 1823, 1856, 1326, 1322, 1401, 1434], + [1854, 1855, 1857, 1853, 1432, 1433, 1435, 1431], + [1855, 1856, 1858, 1857, 1433, 1434, 1436, 1435], + [1856, 1823, 1824, 1858, 1434, 1401, 1402, 1436], + [1853, 1857, 1836, 1841, 1431, 1435, 1414, 1419], + [1857, 1858, 1831, 1836, 1435, 1436, 1409, 1414], + [1858, 1824, 1825, 1831, 1436, 1402, 1403, 1409], + [1793, 1859, 1860, 1794, 1371, 1437, 1438, 1372], + [1859, 1861, 1862, 1860, 1437, 1439, 1440, 1438], + [1861, 1863, 1864, 1862, 1439, 1441, 1442, 1440], + [1863, 1865, 1866, 1864, 1441, 1443, 1444, 1442], + [1865, 1867, 1868, 1866, 1443, 1445, 1446, 1444], + [1867, 1869, 1870, 1868, 1445, 1447, 1448, 1446], + [1794, 1860, 1871, 1801, 1372, 1438, 1449, 1379], + [1860, 1862, 1872, 1871, 1438, 1440, 1450, 1449], + [1862, 1864, 1873, 1872, 1440, 1442, 1451, 1450], + [1864, 1866, 1874, 1873, 1442, 1444, 1452, 1451], + [1866, 1868, 1875, 1874, 1444, 1446, 1453, 1452], + [1868, 1870, 1876, 1875, 1446, 1448, 1454, 1453], + [1801, 1871, 1877, 1808, 1379, 1449, 1455, 1386], + [1871, 1872, 1878, 1877, 1449, 1450, 1456, 1455], + [1872, 1873, 1879, 1878, 1450, 1451, 1457, 1456], + [1873, 1874, 1880, 1879, 1451, 1452, 1458, 1457], + [1874, 1875, 1881, 1880, 1452, 1453, 1459, 1458], + [1875, 1876, 1882, 1881, 1453, 1454, 1460, 1459], + [1808, 1877, 1883, 1815, 1386, 1455, 1461, 1393], + [1877, 1878, 1884, 1883, 1455, 1456, 1462, 1461], + [1878, 1879, 1885, 1884, 1456, 1457, 1463, 1462], + [1879, 1880, 1886, 1885, 1457, 1458, 1464, 1463], + [1880, 1881, 1887, 1886, 1458, 1459, 1465, 1464], + [1881, 1882, 1888, 1887, 1459, 1460, 1466, 1465], + [1815, 1883, 1889, 1822, 1393, 1461, 1467, 1400], + [1883, 1884, 1890, 1889, 1461, 1462, 1468, 1467], + [1884, 1885, 1891, 1890, 1462, 1463, 1469, 1468], + [1885, 1886, 1892, 1891, 1463, 1464, 1470, 1469], + [1886, 1887, 1893, 1892, 1464, 1465, 1471, 1470], + [1887, 1888, 1894, 1893, 1465, 1466, 1472, 1471], + [1822, 1889, 1895, 1829, 1400, 1467, 1473, 1407], + [1889, 1890, 1896, 1895, 1467, 1468, 1474, 1473], + [1890, 1891, 1897, 1896, 1468, 1469, 1475, 1474], + [1891, 1892, 1898, 1897, 1469, 1470, 1476, 1475], + [1892, 1893, 1899, 1898, 1470, 1471, 1477, 1476], + [1893, 1894, 1900, 1899, 1471, 1472, 1478, 1477], + [1897, 1898, 1901, 1902, 1475, 1476, 1479, 1480], + [1898, 1899, 1903, 1901, 1476, 1477, 1481, 1479], + [1899, 1900, 1904, 1903, 1477, 1478, 1482, 1481], + [1902, 1901, 1905, 1906, 1480, 1479, 1483, 1484], + [1901, 1903, 1907, 1905, 1479, 1481, 1485, 1483], + [1903, 1904, 1908, 1907, 1481, 1482, 1486, 1485], + [1906, 1905, 1909, 1910, 1484, 1483, 1487, 1488], + [1905, 1907, 1911, 1909, 1483, 1485, 1489, 1487], + [1907, 1908, 1912, 1911, 1485, 1486, 1490, 1489], + [1912, 1913, 1914, 1911, 1490, 1491, 1492, 1489], + [1913, 1915, 1916, 1914, 1491, 1493, 1494, 1492], + [1915, 1763, 1847, 1916, 1493, 1341, 1425, 1494], + [1911, 1914, 1917, 1909, 1489, 1492, 1495, 1487], + [1914, 1916, 1918, 1917, 1492, 1494, 1496, 1495], + [1916, 1847, 1845, 1918, 1494, 1425, 1423, 1496], + [1909, 1917, 1919, 1910, 1487, 1495, 1497, 1488], + [1917, 1918, 1920, 1919, 1495, 1496, 1498, 1497], + [1918, 1845, 1844, 1920, 1496, 1423, 1422, 1498], + [1844, 1839, 1921, 1920, 1422, 1417, 1499, 1498], + [1839, 1834, 1922, 1921, 1417, 1412, 1500, 1499], + [1834, 1829, 1895, 1922, 1412, 1407, 1473, 1500], + [1920, 1921, 1923, 1919, 1498, 1499, 1501, 1497], + [1921, 1922, 1924, 1923, 1499, 1500, 1502, 1501], + [1922, 1895, 1896, 1924, 1500, 1473, 1474, 1502], + [1919, 1923, 1906, 1910, 1497, 1501, 1484, 1488], + [1923, 1924, 1902, 1906, 1501, 1502, 1480, 1484], + [1924, 1896, 1897, 1902, 1502, 1474, 1475, 1480], + [1869, 1925, 1926, 1870, 1447, 1503, 1504, 1448], + [1925, 1927, 1928, 1926, 1503, 1505, 1506, 1504], + [1927, 1929, 1930, 1928, 1505, 1507, 1508, 1506], + [1929, 1931, 1932, 1930, 1507, 1509, 1510, 1508], + [1931, 1933, 1934, 1932, 1509, 1511, 1512, 1510], + [1933, 1935, 1936, 1934, 1511, 1513, 1514, 1512], + [1870, 1926, 1937, 1876, 1448, 1504, 1515, 1454], + [1926, 1928, 1938, 1937, 1504, 1506, 1516, 1515], + [1928, 1930, 1939, 1938, 1506, 1508, 1517, 1516], + [1930, 1932, 1940, 1939, 1508, 1510, 1518, 1517], + [1932, 1934, 1941, 1940, 1510, 1512, 1519, 1518], + [1934, 1936, 1942, 1941, 1512, 1514, 1520, 1519], + [1876, 1937, 1943, 1882, 1454, 1515, 1521, 1460], + [1937, 1938, 1944, 1943, 1515, 1516, 1522, 1521], + [1938, 1939, 1945, 1944, 1516, 1517, 1523, 1522], + [1939, 1940, 1946, 1945, 1517, 1518, 1524, 1523], + [1940, 1941, 1947, 1946, 1518, 1519, 1525, 1524], + [1941, 1942, 1948, 1947, 1519, 1520, 1526, 1525], + [1882, 1943, 1949, 1888, 1460, 1521, 1527, 1466], + [1943, 1944, 1950, 1949, 1521, 1522, 1528, 1527], + [1944, 1945, 1951, 1950, 1522, 1523, 1529, 1528], + [1945, 1946, 1952, 1951, 1523, 1524, 1530, 1529], + [1946, 1947, 1953, 1952, 1524, 1525, 1531, 1530], + [1947, 1948, 1954, 1953, 1525, 1526, 1532, 1531], + [1888, 1949, 1955, 1894, 1466, 1527, 1533, 1472], + [1949, 1950, 1956, 1955, 1527, 1528, 1534, 1533], + [1950, 1951, 1957, 1956, 1528, 1529, 1535, 1534], + [1951, 1952, 1958, 1957, 1529, 1530, 1536, 1535], + [1952, 1953, 1959, 1958, 1530, 1531, 1537, 1536], + [1953, 1954, 1960, 1959, 1531, 1532, 1538, 1537], + [1894, 1955, 1961, 1900, 1472, 1533, 1539, 1478], + [1955, 1956, 1962, 1961, 1533, 1534, 1540, 1539], + [1956, 1957, 1963, 1962, 1534, 1535, 1541, 1540], + [1957, 1958, 1964, 1963, 1535, 1536, 1542, 1541], + [1958, 1959, 1965, 1964, 1536, 1537, 1543, 1542], + [1959, 1960, 1966, 1965, 1537, 1538, 1544, 1543], + [1963, 1964, 1967, 1968, 1541, 1542, 1545, 1546], + [1964, 1965, 1969, 1967, 1542, 1543, 1547, 1545], + [1965, 1966, 1970, 1969, 1543, 1544, 1548, 1547], + [1968, 1967, 1971, 1972, 1546, 1545, 1549, 1550], + [1967, 1969, 1973, 1971, 1545, 1547, 1551, 1549], + [1969, 1970, 1974, 1973, 1547, 1548, 1552, 1551], + [1972, 1971, 1975, 1976, 1550, 1549, 1553, 1554], + [1971, 1973, 1977, 1975, 1549, 1551, 1555, 1553], + [1973, 1974, 1978, 1977, 1551, 1552, 1556, 1555], + [1978, 1979, 1980, 1977, 1556, 1557, 1558, 1555], + [1979, 1981, 1982, 1980, 1557, 1559, 1560, 1558], + [1981, 1763, 1915, 1982, 1559, 1341, 1493, 1560], + [1977, 1980, 1983, 1975, 1555, 1558, 1561, 1553], + [1980, 1982, 1984, 1983, 1558, 1560, 1562, 1561], + [1982, 1915, 1913, 1984, 1560, 1493, 1491, 1562], + [1975, 1983, 1985, 1976, 1553, 1561, 1563, 1554], + [1983, 1984, 1986, 1985, 1561, 1562, 1564, 1563], + [1984, 1913, 1912, 1986, 1562, 1491, 1490, 1564], + [1912, 1908, 1987, 1986, 1490, 1486, 1565, 1564], + [1908, 1904, 1988, 1987, 1486, 1482, 1566, 1565], + [1904, 1900, 1961, 1988, 1482, 1478, 1539, 1566], + [1986, 1987, 1989, 1985, 1564, 1565, 1567, 1563], + [1987, 1988, 1990, 1989, 1565, 1566, 1568, 1567], + [1988, 1961, 1962, 1990, 1566, 1539, 1540, 1568], + [1985, 1989, 1972, 1976, 1563, 1567, 1550, 1554], + [1989, 1990, 1968, 1972, 1567, 1568, 1546, 1550], + [1990, 1962, 1963, 1968, 1568, 1540, 1541, 1546], + [1935, 1991, 1992, 1936, 1513, 1569, 1570, 1514], + [1991, 1993, 1994, 1992, 1569, 1571, 1572, 1570], + [1993, 1995, 1996, 1994, 1571, 1573, 1574, 1572], + [1995, 1997, 1998, 1996, 1573, 1575, 1576, 1574], + [1997, 1999, 2000, 1998, 1575, 1577, 1578, 1576], + [1999, 2001, 2002, 2000, 1577, 1579, 1580, 1578], + [1936, 1992, 2003, 1942, 1514, 1570, 1581, 1520], + [1992, 1994, 2004, 2003, 1570, 1572, 1582, 1581], + [1994, 1996, 2005, 2004, 1572, 1574, 1583, 1582], + [1996, 1998, 2006, 2005, 1574, 1576, 1584, 1583], + [1998, 2000, 2007, 2006, 1576, 1578, 1585, 1584], + [2000, 2002, 2008, 2007, 1578, 1580, 1586, 1585], + [1942, 2003, 2009, 1948, 1520, 1581, 1587, 1526], + [2003, 2004, 2010, 2009, 1581, 1582, 1588, 1587], + [2004, 2005, 2011, 2010, 1582, 1583, 1589, 1588], + [2005, 2006, 2012, 2011, 1583, 1584, 1590, 1589], + [2006, 2007, 2013, 2012, 1584, 1585, 1591, 1590], + [2007, 2008, 2014, 2013, 1585, 1586, 1592, 1591], + [1948, 2009, 2015, 1954, 1526, 1587, 1593, 1532], + [2009, 2010, 2016, 2015, 1587, 1588, 1594, 1593], + [2010, 2011, 2017, 2016, 1588, 1589, 1595, 1594], + [2011, 2012, 2018, 2017, 1589, 1590, 1596, 1595], + [2012, 2013, 2019, 2018, 1590, 1591, 1597, 1596], + [2013, 2014, 2020, 2019, 1591, 1592, 1598, 1597], + [1954, 2015, 2021, 1960, 1532, 1593, 1599, 1538], + [2015, 2016, 2022, 2021, 1593, 1594, 1600, 1599], + [2016, 2017, 2023, 2022, 1594, 1595, 1601, 1600], + [2017, 2018, 2024, 2023, 1595, 1596, 1602, 1601], + [2018, 2019, 2025, 2024, 1596, 1597, 1603, 1602], + [2019, 2020, 2026, 2025, 1597, 1598, 1604, 1603], + [1960, 2021, 2027, 1966, 1538, 1599, 1605, 1544], + [2021, 2022, 2028, 2027, 1599, 1600, 1606, 1605], + [2022, 2023, 2029, 2028, 1600, 1601, 1607, 1606], + [2023, 2024, 2030, 2029, 1601, 1602, 1608, 1607], + [2024, 2025, 2031, 2030, 1602, 1603, 1609, 1608], + [2025, 2026, 2032, 2031, 1603, 1604, 1610, 1609], + [2029, 2030, 2033, 2034, 1607, 1608, 1611, 1612], + [2030, 2031, 2035, 2033, 1608, 1609, 1613, 1611], + [2031, 2032, 2036, 2035, 1609, 1610, 1614, 1613], + [2034, 2033, 2037, 2038, 1612, 1611, 1615, 1616], + [2033, 2035, 2039, 2037, 1611, 1613, 1617, 1615], + [2035, 2036, 2040, 2039, 1613, 1614, 1618, 1617], + [2038, 2037, 2041, 2042, 1616, 1615, 1619, 1620], + [2037, 2039, 2043, 2041, 1615, 1617, 1621, 1619], + [2039, 2040, 2044, 2043, 1617, 1618, 1622, 1621], + [2044, 2045, 2046, 2043, 1622, 1623, 1624, 1621], + [2045, 2047, 2048, 2046, 1623, 1625, 1626, 1624], + [2047, 1763, 1981, 2048, 1625, 1341, 1559, 1626], + [2043, 2046, 2049, 2041, 1621, 1624, 1627, 1619], + [2046, 2048, 2050, 2049, 1624, 1626, 1628, 1627], + [2048, 1981, 1979, 2050, 1626, 1559, 1557, 1628], + [2041, 2049, 2051, 2042, 1619, 1627, 1629, 1620], + [2049, 2050, 2052, 2051, 1627, 1628, 1630, 1629], + [2050, 1979, 1978, 2052, 1628, 1557, 1556, 1630], + [1978, 1974, 2053, 2052, 1556, 1552, 1631, 1630], + [1974, 1970, 2054, 2053, 1552, 1548, 1632, 1631], + [1970, 1966, 2027, 2054, 1548, 1544, 1605, 1632], + [2052, 2053, 2055, 2051, 1630, 1631, 1633, 1629], + [2053, 2054, 2056, 2055, 1631, 1632, 1634, 1633], + [2054, 2027, 2028, 2056, 1632, 1605, 1606, 1634], + [2051, 2055, 2038, 2042, 1629, 1633, 1616, 1620], + [2055, 2056, 2034, 2038, 1633, 1634, 1612, 1616], + [2056, 2028, 2029, 2034, 1634, 1606, 1607, 1612], + [2001, 2057, 2058, 2002, 1579, 1635, 1636, 1580], + [2057, 2059, 2060, 2058, 1635, 1637, 1638, 1636], + [2059, 2061, 2062, 2060, 1637, 1639, 1640, 1638], + [2061, 2063, 2064, 2062, 1639, 1641, 1642, 1640], + [2063, 2065, 2066, 2064, 1641, 1643, 1644, 1642], + [2065, 1689, 1692, 2066, 1643, 1267, 1270, 1644], + [2002, 2058, 2067, 2008, 1580, 1636, 1645, 1586], + [2058, 2060, 2068, 2067, 1636, 1638, 1646, 1645], + [2060, 2062, 2069, 2068, 1638, 1640, 1647, 1646], + [2062, 2064, 2070, 2069, 1640, 1642, 1648, 1647], + [2064, 2066, 2071, 2070, 1642, 1644, 1649, 1648], + [2066, 1692, 1706, 2071, 1644, 1270, 1284, 1649], + [2008, 2067, 2072, 2014, 1586, 1645, 1650, 1592], + [2067, 2068, 2073, 2072, 1645, 1646, 1651, 1650], + [2068, 2069, 2074, 2073, 1646, 1647, 1652, 1651], + [2069, 2070, 2075, 2074, 1647, 1648, 1653, 1652], + [2070, 2071, 2076, 2075, 1648, 1649, 1654, 1653], + [2071, 1706, 1714, 2076, 1649, 1284, 1292, 1654], + [2014, 2072, 2077, 2020, 1592, 1650, 1655, 1598], + [2072, 2073, 2078, 2077, 1650, 1651, 1656, 1655], + [2073, 2074, 2079, 2078, 1651, 1652, 1657, 1656], + [2074, 2075, 2080, 2079, 1652, 1653, 1658, 1657], + [2075, 2076, 2081, 2080, 1653, 1654, 1659, 1658], + [2076, 1714, 1722, 2081, 1654, 1292, 1300, 1659], + [2020, 2077, 2082, 2026, 1598, 1655, 1660, 1604], + [2077, 2078, 2083, 2082, 1655, 1656, 1661, 1660], + [2078, 2079, 2084, 2083, 1656, 1657, 1662, 1661], + [2079, 2080, 2085, 2084, 1657, 1658, 1663, 1662], + [2080, 2081, 2086, 2085, 1658, 1659, 1664, 1663], + [2081, 1722, 1730, 2086, 1659, 1300, 1308, 1664], + [2026, 2082, 2087, 2032, 1604, 1660, 1665, 1610], + [2082, 2083, 2088, 2087, 1660, 1661, 1666, 1665], + [2083, 2084, 2089, 2088, 1661, 1662, 1667, 1666], + [2084, 2085, 2090, 2089, 1662, 1663, 1668, 1667], + [2085, 2086, 2091, 2090, 1663, 1664, 1669, 1668], + [2086, 1730, 1738, 2091, 1664, 1308, 1316, 1669], + [2089, 2090, 2092, 2093, 1667, 1668, 1670, 1671], + [2090, 2091, 2094, 2092, 1668, 1669, 1672, 1670], + [2091, 1738, 1775, 2094, 1669, 1316, 1353, 1672], + [2093, 2092, 2095, 2096, 1671, 1670, 1673, 1674], + [2092, 2094, 2097, 2095, 1670, 1672, 1675, 1673], + [2094, 1775, 1773, 2097, 1672, 1353, 1351, 1675], + [2096, 2095, 2098, 2099, 1674, 1673, 1676, 1677], + [2095, 2097, 2100, 2098, 1673, 1675, 1678, 1676], + [2097, 1773, 1772, 2100, 1675, 1351, 1350, 1678], + [1772, 1768, 2101, 2100, 1350, 1346, 1679, 1678], + [1768, 1764, 2102, 2101, 1346, 1342, 1680, 1679], + [1764, 1763, 2047, 2102, 1342, 1341, 1625, 1680], + [2100, 2101, 2103, 2098, 1678, 1679, 1681, 1676], + [2101, 2102, 2104, 2103, 1679, 1680, 1682, 1681], + [2102, 2047, 2045, 2104, 1680, 1625, 1623, 1682], + [2098, 2103, 2105, 2099, 1676, 1681, 1683, 1677], + [2103, 2104, 2106, 2105, 1681, 1682, 1684, 1683], + [2104, 2045, 2044, 2106, 1682, 1623, 1622, 1684], + [2044, 2040, 2107, 2106, 1622, 1618, 1685, 1684], + [2040, 2036, 2108, 2107, 1618, 1614, 1686, 1685], + [2036, 2032, 2087, 2108, 1614, 1610, 1665, 1686], + [2106, 2107, 2109, 2105, 1684, 1685, 1687, 1683], + [2107, 2108, 2110, 2109, 1685, 1686, 1688, 1687], + [2108, 2087, 2088, 2110, 1686, 1665, 1666, 1688], + [2105, 2109, 2096, 2099, 1683, 1687, 1674, 1677], + [2109, 2110, 2093, 2096, 1687, 1688, 1671, 1674], + [2110, 2088, 2089, 2093, 1688, 1666, 1667, 1671], + [2111, 2112, 2113, 2114, 1689, 1690, 1691, 1692], + [2112, 2115, 2116, 2113, 1690, 1693, 1694, 1691], + [2115, 2117, 2118, 2116, 1693, 1695, 1696, 1694], + [2117, 2119, 2120, 2118, 1695, 1697, 1698, 1696], + [2119, 2121, 2122, 2120, 1697, 1699, 1700, 1698], + [2121, 2123, 2124, 2122, 1699, 1701, 1702, 1700], + [2123, 2125, 2126, 2124, 1701, 1703, 1704, 1702], + [2114, 2113, 2127, 2128, 1692, 1691, 1705, 1706], + [2113, 2116, 2129, 2127, 1691, 1694, 1707, 1705], + [2116, 2118, 2130, 2129, 1694, 1696, 1708, 1707], + [2118, 2120, 2131, 2130, 1696, 1698, 1709, 1708], + [2120, 2122, 2132, 2131, 1698, 1700, 1710, 1709], + [2122, 2124, 2133, 2132, 1700, 1702, 1711, 1710], + [2124, 2126, 2134, 2133, 1702, 1704, 1712, 1711], + [2128, 2127, 2135, 2136, 1706, 1705, 1713, 1714], + [2127, 2129, 2137, 2135, 1705, 1707, 1715, 1713], + [2129, 2130, 2138, 2137, 1707, 1708, 1716, 1715], + [2130, 2131, 2139, 2138, 1708, 1709, 1717, 1716], + [2131, 2132, 2140, 2139, 1709, 1710, 1718, 1717], + [2132, 2133, 2141, 2140, 1710, 1711, 1719, 1718], + [2133, 2134, 2142, 2141, 1711, 1712, 1720, 1719], + [2136, 2135, 2143, 2144, 1714, 1713, 1721, 1722], + [2135, 2137, 2145, 2143, 1713, 1715, 1723, 1721], + [2137, 2138, 2146, 2145, 1715, 1716, 1724, 1723], + [2138, 2139, 2147, 2146, 1716, 1717, 1725, 1724], + [2139, 2140, 2148, 2147, 1717, 1718, 1726, 1725], + [2140, 2141, 2149, 2148, 1718, 1719, 1727, 1726], + [2141, 2142, 2150, 2149, 1719, 1720, 1728, 1727], + [2144, 2143, 2151, 2152, 1722, 1721, 1729, 1730], + [2143, 2145, 2153, 2151, 1721, 1723, 1731, 1729], + [2145, 2146, 2154, 2153, 1723, 1724, 1732, 1731], + [2146, 2147, 2155, 2154, 1724, 1725, 1733, 1732], + [2147, 2148, 2156, 2155, 1725, 1726, 1734, 1733], + [2148, 2149, 2157, 2156, 1726, 1727, 1735, 1734], + [2149, 2150, 2158, 2157, 1727, 1728, 1736, 1735], + [2152, 2151, 2159, 2160, 1730, 1729, 1737, 1738], + [2151, 2153, 2161, 2159, 1729, 1731, 1739, 1737], + [2153, 2154, 2162, 2161, 1731, 1732, 1740, 1739], + [2154, 2155, 2163, 2162, 1732, 1733, 1741, 1740], + [2155, 2156, 2164, 2163, 1733, 1734, 1742, 1741], + [2156, 2157, 2165, 2164, 1734, 1735, 1743, 1742], + [2157, 2158, 2166, 2165, 1735, 1736, 1744, 1743], + [2163, 2164, 2167, 2168, 1741, 1742, 1745, 1746], + [2164, 2165, 2169, 2167, 1742, 1743, 1747, 1745], + [2165, 2166, 2170, 2169, 1743, 1744, 1748, 1747], + [2168, 2167, 2171, 2172, 1746, 1745, 1749, 1750], + [2167, 2169, 2173, 2171, 1745, 1747, 1751, 1749], + [2169, 2170, 2174, 2173, 1747, 1748, 1752, 1751], + [2172, 2171, 2175, 2176, 1750, 1749, 1753, 1754], + [2171, 2173, 2177, 2175, 1749, 1751, 1755, 1753], + [2173, 2174, 2178, 2177, 1751, 1752, 1756, 1755], + [2178, 2179, 2180, 2177, 1756, 1757, 1758, 1755], + [2179, 2181, 2182, 2180, 1757, 1759, 1760, 1758], + [2181, 2183, 2184, 2182, 1759, 1761, 1762, 1760], + [2183, 2185, 2186, 2184, 1761, 1763, 1764, 1762], + [2177, 2180, 2187, 2175, 1755, 1758, 1765, 1753], + [2180, 2182, 2188, 2187, 1758, 1760, 1766, 1765], + [2182, 2184, 2189, 2188, 1760, 1762, 1767, 1766], + [2184, 2186, 2190, 2189, 1762, 1764, 1768, 1767], + [2175, 2187, 2191, 2176, 1753, 1765, 1769, 1754], + [2187, 2188, 2192, 2191, 1765, 1766, 1770, 1769], + [2188, 2189, 2193, 2192, 1766, 1767, 1771, 1770], + [2189, 2190, 2194, 2193, 1767, 1768, 1772, 1771], + [2194, 2195, 2196, 2193, 1772, 1773, 1774, 1771], + [2195, 2197, 2198, 2196, 1773, 1775, 1776, 1774], + [2197, 2160, 2159, 2198, 1775, 1738, 1737, 1776], + [2193, 2196, 2199, 2192, 1771, 1774, 1777, 1770], + [2196, 2198, 2200, 2199, 1774, 1776, 1778, 1777], + [2198, 2159, 2161, 2200, 1776, 1737, 1739, 1778], + [2192, 2199, 2201, 2191, 1770, 1777, 1779, 1769], + [2199, 2200, 2202, 2201, 1777, 1778, 1780, 1779], + [2200, 2161, 2162, 2202, 1778, 1739, 1740, 1780], + [2191, 2201, 2172, 2176, 1769, 1779, 1750, 1754], + [2201, 2202, 2168, 2172, 1779, 1780, 1746, 1750], + [2202, 2162, 2163, 2168, 1780, 1740, 1741, 1746], + [2125, 2203, 2204, 2126, 1703, 1781, 1782, 1704], + [2203, 2205, 2206, 2204, 1781, 1783, 1784, 1782], + [2205, 2207, 2208, 2206, 1783, 1785, 1786, 1784], + [2207, 2209, 2210, 2208, 1785, 1787, 1788, 1786], + [2209, 2211, 2212, 2210, 1787, 1789, 1790, 1788], + [2211, 2213, 2214, 2212, 1789, 1791, 1792, 1790], + [2213, 2215, 2216, 2214, 1791, 1793, 1794, 1792], + [2126, 2204, 2217, 2134, 1704, 1782, 1795, 1712], + [2204, 2206, 2218, 2217, 1782, 1784, 1796, 1795], + [2206, 2208, 2219, 2218, 1784, 1786, 1797, 1796], + [2208, 2210, 2220, 2219, 1786, 1788, 1798, 1797], + [2210, 2212, 2221, 2220, 1788, 1790, 1799, 1798], + [2212, 2214, 2222, 2221, 1790, 1792, 1800, 1799], + [2214, 2216, 2223, 2222, 1792, 1794, 1801, 1800], + [2134, 2217, 2224, 2142, 1712, 1795, 1802, 1720], + [2217, 2218, 2225, 2224, 1795, 1796, 1803, 1802], + [2218, 2219, 2226, 2225, 1796, 1797, 1804, 1803], + [2219, 2220, 2227, 2226, 1797, 1798, 1805, 1804], + [2220, 2221, 2228, 2227, 1798, 1799, 1806, 1805], + [2221, 2222, 2229, 2228, 1799, 1800, 1807, 1806], + [2222, 2223, 2230, 2229, 1800, 1801, 1808, 1807], + [2142, 2224, 2231, 2150, 1720, 1802, 1809, 1728], + [2224, 2225, 2232, 2231, 1802, 1803, 1810, 1809], + [2225, 2226, 2233, 2232, 1803, 1804, 1811, 1810], + [2226, 2227, 2234, 2233, 1804, 1805, 1812, 1811], + [2227, 2228, 2235, 2234, 1805, 1806, 1813, 1812], + [2228, 2229, 2236, 2235, 1806, 1807, 1814, 1813], + [2229, 2230, 2237, 2236, 1807, 1808, 1815, 1814], + [2150, 2231, 2238, 2158, 1728, 1809, 1816, 1736], + [2231, 2232, 2239, 2238, 1809, 1810, 1817, 1816], + [2232, 2233, 2240, 2239, 1810, 1811, 1818, 1817], + [2233, 2234, 2241, 2240, 1811, 1812, 1819, 1818], + [2234, 2235, 2242, 2241, 1812, 1813, 1820, 1819], + [2235, 2236, 2243, 2242, 1813, 1814, 1821, 1820], + [2236, 2237, 2244, 2243, 1814, 1815, 1822, 1821], + [2158, 2238, 2245, 2166, 1736, 1816, 1823, 1744], + [2238, 2239, 2246, 2245, 1816, 1817, 1824, 1823], + [2239, 2240, 2247, 2246, 1817, 1818, 1825, 1824], + [2240, 2241, 2248, 2247, 1818, 1819, 1826, 1825], + [2241, 2242, 2249, 2248, 1819, 1820, 1827, 1826], + [2242, 2243, 2250, 2249, 1820, 1821, 1828, 1827], + [2243, 2244, 2251, 2250, 1821, 1822, 1829, 1828], + [2247, 2248, 2252, 2253, 1825, 1826, 1830, 1831], + [2248, 2249, 2254, 2252, 1826, 1827, 1832, 1830], + [2249, 2250, 2255, 2254, 1827, 1828, 1833, 1832], + [2250, 2251, 2256, 2255, 1828, 1829, 1834, 1833], + [2253, 2252, 2257, 2258, 1831, 1830, 1835, 1836], + [2252, 2254, 2259, 2257, 1830, 1832, 1837, 1835], + [2254, 2255, 2260, 2259, 1832, 1833, 1838, 1837], + [2255, 2256, 2261, 2260, 1833, 1834, 1839, 1838], + [2258, 2257, 2262, 2263, 1836, 1835, 1840, 1841], + [2257, 2259, 2264, 2262, 1835, 1837, 1842, 1840], + [2259, 2260, 2265, 2264, 1837, 1838, 1843, 1842], + [2260, 2261, 2266, 2265, 1838, 1839, 1844, 1843], + [2266, 2267, 2268, 2265, 1844, 1845, 1846, 1843], + [2267, 2269, 2270, 2268, 1845, 1847, 1848, 1846], + [2269, 2185, 2183, 2270, 1847, 1763, 1761, 1848], + [2265, 2268, 2271, 2264, 1843, 1846, 1849, 1842], + [2268, 2270, 2272, 2271, 1846, 1848, 1850, 1849], + [2270, 2183, 2181, 2272, 1848, 1761, 1759, 1850], + [2264, 2271, 2273, 2262, 1842, 1849, 1851, 1840], + [2271, 2272, 2274, 2273, 1849, 1850, 1852, 1851], + [2272, 2181, 2179, 2274, 1850, 1759, 1757, 1852], + [2262, 2273, 2275, 2263, 1840, 1851, 1853, 1841], + [2273, 2274, 2276, 2275, 1851, 1852, 1854, 1853], + [2274, 2179, 2178, 2276, 1852, 1757, 1756, 1854], + [2178, 2174, 2277, 2276, 1756, 1752, 1855, 1854], + [2174, 2170, 2278, 2277, 1752, 1748, 1856, 1855], + [2170, 2166, 2245, 2278, 1748, 1744, 1823, 1856], + [2276, 2277, 2279, 2275, 1854, 1855, 1857, 1853], + [2277, 2278, 2280, 2279, 1855, 1856, 1858, 1857], + [2278, 2245, 2246, 2280, 1856, 1823, 1824, 1858], + [2275, 2279, 2258, 2263, 1853, 1857, 1836, 1841], + [2279, 2280, 2253, 2258, 1857, 1858, 1831, 1836], + [2280, 2246, 2247, 2253, 1858, 1824, 1825, 1831], + [2215, 2281, 2282, 2216, 1793, 1859, 1860, 1794], + [2281, 2283, 2284, 2282, 1859, 1861, 1862, 1860], + [2283, 2285, 2286, 2284, 1861, 1863, 1864, 1862], + [2285, 2287, 2288, 2286, 1863, 1865, 1866, 1864], + [2287, 2289, 2290, 2288, 1865, 1867, 1868, 1866], + [2289, 2291, 2292, 2290, 1867, 1869, 1870, 1868], + [2216, 2282, 2293, 2223, 1794, 1860, 1871, 1801], + [2282, 2284, 2294, 2293, 1860, 1862, 1872, 1871], + [2284, 2286, 2295, 2294, 1862, 1864, 1873, 1872], + [2286, 2288, 2296, 2295, 1864, 1866, 1874, 1873], + [2288, 2290, 2297, 2296, 1866, 1868, 1875, 1874], + [2290, 2292, 2298, 2297, 1868, 1870, 1876, 1875], + [2223, 2293, 2299, 2230, 1801, 1871, 1877, 1808], + [2293, 2294, 2300, 2299, 1871, 1872, 1878, 1877], + [2294, 2295, 2301, 2300, 1872, 1873, 1879, 1878], + [2295, 2296, 2302, 2301, 1873, 1874, 1880, 1879], + [2296, 2297, 2303, 2302, 1874, 1875, 1881, 1880], + [2297, 2298, 2304, 2303, 1875, 1876, 1882, 1881], + [2230, 2299, 2305, 2237, 1808, 1877, 1883, 1815], + [2299, 2300, 2306, 2305, 1877, 1878, 1884, 1883], + [2300, 2301, 2307, 2306, 1878, 1879, 1885, 1884], + [2301, 2302, 2308, 2307, 1879, 1880, 1886, 1885], + [2302, 2303, 2309, 2308, 1880, 1881, 1887, 1886], + [2303, 2304, 2310, 2309, 1881, 1882, 1888, 1887], + [2237, 2305, 2311, 2244, 1815, 1883, 1889, 1822], + [2305, 2306, 2312, 2311, 1883, 1884, 1890, 1889], + [2306, 2307, 2313, 2312, 1884, 1885, 1891, 1890], + [2307, 2308, 2314, 2313, 1885, 1886, 1892, 1891], + [2308, 2309, 2315, 2314, 1886, 1887, 1893, 1892], + [2309, 2310, 2316, 2315, 1887, 1888, 1894, 1893], + [2244, 2311, 2317, 2251, 1822, 1889, 1895, 1829], + [2311, 2312, 2318, 2317, 1889, 1890, 1896, 1895], + [2312, 2313, 2319, 2318, 1890, 1891, 1897, 1896], + [2313, 2314, 2320, 2319, 1891, 1892, 1898, 1897], + [2314, 2315, 2321, 2320, 1892, 1893, 1899, 1898], + [2315, 2316, 2322, 2321, 1893, 1894, 1900, 1899], + [2319, 2320, 2323, 2324, 1897, 1898, 1901, 1902], + [2320, 2321, 2325, 2323, 1898, 1899, 1903, 1901], + [2321, 2322, 2326, 2325, 1899, 1900, 1904, 1903], + [2324, 2323, 2327, 2328, 1902, 1901, 1905, 1906], + [2323, 2325, 2329, 2327, 1901, 1903, 1907, 1905], + [2325, 2326, 2330, 2329, 1903, 1904, 1908, 1907], + [2328, 2327, 2331, 2332, 1906, 1905, 1909, 1910], + [2327, 2329, 2333, 2331, 1905, 1907, 1911, 1909], + [2329, 2330, 2334, 2333, 1907, 1908, 1912, 1911], + [2334, 2335, 2336, 2333, 1912, 1913, 1914, 1911], + [2335, 2337, 2338, 2336, 1913, 1915, 1916, 1914], + [2337, 2185, 2269, 2338, 1915, 1763, 1847, 1916], + [2333, 2336, 2339, 2331, 1911, 1914, 1917, 1909], + [2336, 2338, 2340, 2339, 1914, 1916, 1918, 1917], + [2338, 2269, 2267, 2340, 1916, 1847, 1845, 1918], + [2331, 2339, 2341, 2332, 1909, 1917, 1919, 1910], + [2339, 2340, 2342, 2341, 1917, 1918, 1920, 1919], + [2340, 2267, 2266, 2342, 1918, 1845, 1844, 1920], + [2266, 2261, 2343, 2342, 1844, 1839, 1921, 1920], + [2261, 2256, 2344, 2343, 1839, 1834, 1922, 1921], + [2256, 2251, 2317, 2344, 1834, 1829, 1895, 1922], + [2342, 2343, 2345, 2341, 1920, 1921, 1923, 1919], + [2343, 2344, 2346, 2345, 1921, 1922, 1924, 1923], + [2344, 2317, 2318, 2346, 1922, 1895, 1896, 1924], + [2341, 2345, 2328, 2332, 1919, 1923, 1906, 1910], + [2345, 2346, 2324, 2328, 1923, 1924, 1902, 1906], + [2346, 2318, 2319, 2324, 1924, 1896, 1897, 1902], + [2291, 2347, 2348, 2292, 1869, 1925, 1926, 1870], + [2347, 2349, 2350, 2348, 1925, 1927, 1928, 1926], + [2349, 2351, 2352, 2350, 1927, 1929, 1930, 1928], + [2351, 2353, 2354, 2352, 1929, 1931, 1932, 1930], + [2353, 2355, 2356, 2354, 1931, 1933, 1934, 1932], + [2355, 2357, 2358, 2356, 1933, 1935, 1936, 1934], + [2292, 2348, 2359, 2298, 1870, 1926, 1937, 1876], + [2348, 2350, 2360, 2359, 1926, 1928, 1938, 1937], + [2350, 2352, 2361, 2360, 1928, 1930, 1939, 1938], + [2352, 2354, 2362, 2361, 1930, 1932, 1940, 1939], + [2354, 2356, 2363, 2362, 1932, 1934, 1941, 1940], + [2356, 2358, 2364, 2363, 1934, 1936, 1942, 1941], + [2298, 2359, 2365, 2304, 1876, 1937, 1943, 1882], + [2359, 2360, 2366, 2365, 1937, 1938, 1944, 1943], + [2360, 2361, 2367, 2366, 1938, 1939, 1945, 1944], + [2361, 2362, 2368, 2367, 1939, 1940, 1946, 1945], + [2362, 2363, 2369, 2368, 1940, 1941, 1947, 1946], + [2363, 2364, 2370, 2369, 1941, 1942, 1948, 1947], + [2304, 2365, 2371, 2310, 1882, 1943, 1949, 1888], + [2365, 2366, 2372, 2371, 1943, 1944, 1950, 1949], + [2366, 2367, 2373, 2372, 1944, 1945, 1951, 1950], + [2367, 2368, 2374, 2373, 1945, 1946, 1952, 1951], + [2368, 2369, 2375, 2374, 1946, 1947, 1953, 1952], + [2369, 2370, 2376, 2375, 1947, 1948, 1954, 1953], + [2310, 2371, 2377, 2316, 1888, 1949, 1955, 1894], + [2371, 2372, 2378, 2377, 1949, 1950, 1956, 1955], + [2372, 2373, 2379, 2378, 1950, 1951, 1957, 1956], + [2373, 2374, 2380, 2379, 1951, 1952, 1958, 1957], + [2374, 2375, 2381, 2380, 1952, 1953, 1959, 1958], + [2375, 2376, 2382, 2381, 1953, 1954, 1960, 1959], + [2316, 2377, 2383, 2322, 1894, 1955, 1961, 1900], + [2377, 2378, 2384, 2383, 1955, 1956, 1962, 1961], + [2378, 2379, 2385, 2384, 1956, 1957, 1963, 1962], + [2379, 2380, 2386, 2385, 1957, 1958, 1964, 1963], + [2380, 2381, 2387, 2386, 1958, 1959, 1965, 1964], + [2381, 2382, 2388, 2387, 1959, 1960, 1966, 1965], + [2385, 2386, 2389, 2390, 1963, 1964, 1967, 1968], + [2386, 2387, 2391, 2389, 1964, 1965, 1969, 1967], + [2387, 2388, 2392, 2391, 1965, 1966, 1970, 1969], + [2390, 2389, 2393, 2394, 1968, 1967, 1971, 1972], + [2389, 2391, 2395, 2393, 1967, 1969, 1973, 1971], + [2391, 2392, 2396, 2395, 1969, 1970, 1974, 1973], + [2394, 2393, 2397, 2398, 1972, 1971, 1975, 1976], + [2393, 2395, 2399, 2397, 1971, 1973, 1977, 1975], + [2395, 2396, 2400, 2399, 1973, 1974, 1978, 1977], + [2400, 2401, 2402, 2399, 1978, 1979, 1980, 1977], + [2401, 2403, 2404, 2402, 1979, 1981, 1982, 1980], + [2403, 2185, 2337, 2404, 1981, 1763, 1915, 1982], + [2399, 2402, 2405, 2397, 1977, 1980, 1983, 1975], + [2402, 2404, 2406, 2405, 1980, 1982, 1984, 1983], + [2404, 2337, 2335, 2406, 1982, 1915, 1913, 1984], + [2397, 2405, 2407, 2398, 1975, 1983, 1985, 1976], + [2405, 2406, 2408, 2407, 1983, 1984, 1986, 1985], + [2406, 2335, 2334, 2408, 1984, 1913, 1912, 1986], + [2334, 2330, 2409, 2408, 1912, 1908, 1987, 1986], + [2330, 2326, 2410, 2409, 1908, 1904, 1988, 1987], + [2326, 2322, 2383, 2410, 1904, 1900, 1961, 1988], + [2408, 2409, 2411, 2407, 1986, 1987, 1989, 1985], + [2409, 2410, 2412, 2411, 1987, 1988, 1990, 1989], + [2410, 2383, 2384, 2412, 1988, 1961, 1962, 1990], + [2407, 2411, 2394, 2398, 1985, 1989, 1972, 1976], + [2411, 2412, 2390, 2394, 1989, 1990, 1968, 1972], + [2412, 2384, 2385, 2390, 1990, 1962, 1963, 1968], + [2357, 2413, 2414, 2358, 1935, 1991, 1992, 1936], + [2413, 2415, 2416, 2414, 1991, 1993, 1994, 1992], + [2415, 2417, 2418, 2416, 1993, 1995, 1996, 1994], + [2417, 2419, 2420, 2418, 1995, 1997, 1998, 1996], + [2419, 2421, 2422, 2420, 1997, 1999, 2000, 1998], + [2421, 2423, 2424, 2422, 1999, 2001, 2002, 2000], + [2358, 2414, 2425, 2364, 1936, 1992, 2003, 1942], + [2414, 2416, 2426, 2425, 1992, 1994, 2004, 2003], + [2416, 2418, 2427, 2426, 1994, 1996, 2005, 2004], + [2418, 2420, 2428, 2427, 1996, 1998, 2006, 2005], + [2420, 2422, 2429, 2428, 1998, 2000, 2007, 2006], + [2422, 2424, 2430, 2429, 2000, 2002, 2008, 2007], + [2364, 2425, 2431, 2370, 1942, 2003, 2009, 1948], + [2425, 2426, 2432, 2431, 2003, 2004, 2010, 2009], + [2426, 2427, 2433, 2432, 2004, 2005, 2011, 2010], + [2427, 2428, 2434, 2433, 2005, 2006, 2012, 2011], + [2428, 2429, 2435, 2434, 2006, 2007, 2013, 2012], + [2429, 2430, 2436, 2435, 2007, 2008, 2014, 2013], + [2370, 2431, 2437, 2376, 1948, 2009, 2015, 1954], + [2431, 2432, 2438, 2437, 2009, 2010, 2016, 2015], + [2432, 2433, 2439, 2438, 2010, 2011, 2017, 2016], + [2433, 2434, 2440, 2439, 2011, 2012, 2018, 2017], + [2434, 2435, 2441, 2440, 2012, 2013, 2019, 2018], + [2435, 2436, 2442, 2441, 2013, 2014, 2020, 2019], + [2376, 2437, 2443, 2382, 1954, 2015, 2021, 1960], + [2437, 2438, 2444, 2443, 2015, 2016, 2022, 2021], + [2438, 2439, 2445, 2444, 2016, 2017, 2023, 2022], + [2439, 2440, 2446, 2445, 2017, 2018, 2024, 2023], + [2440, 2441, 2447, 2446, 2018, 2019, 2025, 2024], + [2441, 2442, 2448, 2447, 2019, 2020, 2026, 2025], + [2382, 2443, 2449, 2388, 1960, 2021, 2027, 1966], + [2443, 2444, 2450, 2449, 2021, 2022, 2028, 2027], + [2444, 2445, 2451, 2450, 2022, 2023, 2029, 2028], + [2445, 2446, 2452, 2451, 2023, 2024, 2030, 2029], + [2446, 2447, 2453, 2452, 2024, 2025, 2031, 2030], + [2447, 2448, 2454, 2453, 2025, 2026, 2032, 2031], + [2451, 2452, 2455, 2456, 2029, 2030, 2033, 2034], + [2452, 2453, 2457, 2455, 2030, 2031, 2035, 2033], + [2453, 2454, 2458, 2457, 2031, 2032, 2036, 2035], + [2456, 2455, 2459, 2460, 2034, 2033, 2037, 2038], + [2455, 2457, 2461, 2459, 2033, 2035, 2039, 2037], + [2457, 2458, 2462, 2461, 2035, 2036, 2040, 2039], + [2460, 2459, 2463, 2464, 2038, 2037, 2041, 2042], + [2459, 2461, 2465, 2463, 2037, 2039, 2043, 2041], + [2461, 2462, 2466, 2465, 2039, 2040, 2044, 2043], + [2466, 2467, 2468, 2465, 2044, 2045, 2046, 2043], + [2467, 2469, 2470, 2468, 2045, 2047, 2048, 2046], + [2469, 2185, 2403, 2470, 2047, 1763, 1981, 2048], + [2465, 2468, 2471, 2463, 2043, 2046, 2049, 2041], + [2468, 2470, 2472, 2471, 2046, 2048, 2050, 2049], + [2470, 2403, 2401, 2472, 2048, 1981, 1979, 2050], + [2463, 2471, 2473, 2464, 2041, 2049, 2051, 2042], + [2471, 2472, 2474, 2473, 2049, 2050, 2052, 2051], + [2472, 2401, 2400, 2474, 2050, 1979, 1978, 2052], + [2400, 2396, 2475, 2474, 1978, 1974, 2053, 2052], + [2396, 2392, 2476, 2475, 1974, 1970, 2054, 2053], + [2392, 2388, 2449, 2476, 1970, 1966, 2027, 2054], + [2474, 2475, 2477, 2473, 2052, 2053, 2055, 2051], + [2475, 2476, 2478, 2477, 2053, 2054, 2056, 2055], + [2476, 2449, 2450, 2478, 2054, 2027, 2028, 2056], + [2473, 2477, 2460, 2464, 2051, 2055, 2038, 2042], + [2477, 2478, 2456, 2460, 2055, 2056, 2034, 2038], + [2478, 2450, 2451, 2456, 2056, 2028, 2029, 2034], + [2423, 2479, 2480, 2424, 2001, 2057, 2058, 2002], + [2479, 2481, 2482, 2480, 2057, 2059, 2060, 2058], + [2481, 2483, 2484, 2482, 2059, 2061, 2062, 2060], + [2483, 2485, 2486, 2484, 2061, 2063, 2064, 2062], + [2485, 2487, 2488, 2486, 2063, 2065, 2066, 2064], + [2487, 2111, 2114, 2488, 2065, 1689, 1692, 2066], + [2424, 2480, 2489, 2430, 2002, 2058, 2067, 2008], + [2480, 2482, 2490, 2489, 2058, 2060, 2068, 2067], + [2482, 2484, 2491, 2490, 2060, 2062, 2069, 2068], + [2484, 2486, 2492, 2491, 2062, 2064, 2070, 2069], + [2486, 2488, 2493, 2492, 2064, 2066, 2071, 2070], + [2488, 2114, 2128, 2493, 2066, 1692, 1706, 2071], + [2430, 2489, 2494, 2436, 2008, 2067, 2072, 2014], + [2489, 2490, 2495, 2494, 2067, 2068, 2073, 2072], + [2490, 2491, 2496, 2495, 2068, 2069, 2074, 2073], + [2491, 2492, 2497, 2496, 2069, 2070, 2075, 2074], + [2492, 2493, 2498, 2497, 2070, 2071, 2076, 2075], + [2493, 2128, 2136, 2498, 2071, 1706, 1714, 2076], + [2436, 2494, 2499, 2442, 2014, 2072, 2077, 2020], + [2494, 2495, 2500, 2499, 2072, 2073, 2078, 2077], + [2495, 2496, 2501, 2500, 2073, 2074, 2079, 2078], + [2496, 2497, 2502, 2501, 2074, 2075, 2080, 2079], + [2497, 2498, 2503, 2502, 2075, 2076, 2081, 2080], + [2498, 2136, 2144, 2503, 2076, 1714, 1722, 2081], + [2442, 2499, 2504, 2448, 2020, 2077, 2082, 2026], + [2499, 2500, 2505, 2504, 2077, 2078, 2083, 2082], + [2500, 2501, 2506, 2505, 2078, 2079, 2084, 2083], + [2501, 2502, 2507, 2506, 2079, 2080, 2085, 2084], + [2502, 2503, 2508, 2507, 2080, 2081, 2086, 2085], + [2503, 2144, 2152, 2508, 2081, 1722, 1730, 2086], + [2448, 2504, 2509, 2454, 2026, 2082, 2087, 2032], + [2504, 2505, 2510, 2509, 2082, 2083, 2088, 2087], + [2505, 2506, 2511, 2510, 2083, 2084, 2089, 2088], + [2506, 2507, 2512, 2511, 2084, 2085, 2090, 2089], + [2507, 2508, 2513, 2512, 2085, 2086, 2091, 2090], + [2508, 2152, 2160, 2513, 2086, 1730, 1738, 2091], + [2511, 2512, 2514, 2515, 2089, 2090, 2092, 2093], + [2512, 2513, 2516, 2514, 2090, 2091, 2094, 2092], + [2513, 2160, 2197, 2516, 2091, 1738, 1775, 2094], + [2515, 2514, 2517, 2518, 2093, 2092, 2095, 2096], + [2514, 2516, 2519, 2517, 2092, 2094, 2097, 2095], + [2516, 2197, 2195, 2519, 2094, 1775, 1773, 2097], + [2518, 2517, 2520, 2521, 2096, 2095, 2098, 2099], + [2517, 2519, 2522, 2520, 2095, 2097, 2100, 2098], + [2519, 2195, 2194, 2522, 2097, 1773, 1772, 2100], + [2194, 2190, 2523, 2522, 1772, 1768, 2101, 2100], + [2190, 2186, 2524, 2523, 1768, 1764, 2102, 2101], + [2186, 2185, 2469, 2524, 1764, 1763, 2047, 2102], + [2522, 2523, 2525, 2520, 2100, 2101, 2103, 2098], + [2523, 2524, 2526, 2525, 2101, 2102, 2104, 2103], + [2524, 2469, 2467, 2526, 2102, 2047, 2045, 2104], + [2520, 2525, 2527, 2521, 2098, 2103, 2105, 2099], + [2525, 2526, 2528, 2527, 2103, 2104, 2106, 2105], + [2526, 2467, 2466, 2528, 2104, 2045, 2044, 2106], + [2466, 2462, 2529, 2528, 2044, 2040, 2107, 2106], + [2462, 2458, 2530, 2529, 2040, 2036, 2108, 2107], + [2458, 2454, 2509, 2530, 2036, 2032, 2087, 2108], + [2528, 2529, 2531, 2527, 2106, 2107, 2109, 2105], + [2529, 2530, 2532, 2531, 2107, 2108, 2110, 2109], + [2530, 2509, 2510, 2532, 2108, 2087, 2088, 2110], + [2527, 2531, 2518, 2521, 2105, 2109, 2096, 2099], + [2531, 2532, 2515, 2518, 2109, 2110, 2093, 2096], + [2532, 2510, 2511, 2515, 2110, 2088, 2089, 2093], + [2533, 2534, 2535, 2536, 2111, 2112, 2113, 2114], + [2534, 2537, 2538, 2535, 2112, 2115, 2116, 2113], + [2537, 2539, 2540, 2538, 2115, 2117, 2118, 2116], + [2539, 2541, 2542, 2540, 2117, 2119, 2120, 2118], + [2541, 2543, 2544, 2542, 2119, 2121, 2122, 2120], + [2543, 2545, 2546, 2544, 2121, 2123, 2124, 2122], + [2545, 2547, 2548, 2546, 2123, 2125, 2126, 2124], + [2536, 2535, 2549, 2550, 2114, 2113, 2127, 2128], + [2535, 2538, 2551, 2549, 2113, 2116, 2129, 2127], + [2538, 2540, 2552, 2551, 2116, 2118, 2130, 2129], + [2540, 2542, 2553, 2552, 2118, 2120, 2131, 2130], + [2542, 2544, 2554, 2553, 2120, 2122, 2132, 2131], + [2544, 2546, 2555, 2554, 2122, 2124, 2133, 2132], + [2546, 2548, 2556, 2555, 2124, 2126, 2134, 2133], + [2550, 2549, 2557, 2558, 2128, 2127, 2135, 2136], + [2549, 2551, 2559, 2557, 2127, 2129, 2137, 2135], + [2551, 2552, 2560, 2559, 2129, 2130, 2138, 2137], + [2552, 2553, 2561, 2560, 2130, 2131, 2139, 2138], + [2553, 2554, 2562, 2561, 2131, 2132, 2140, 2139], + [2554, 2555, 2563, 2562, 2132, 2133, 2141, 2140], + [2555, 2556, 2564, 2563, 2133, 2134, 2142, 2141], + [2558, 2557, 2565, 2566, 2136, 2135, 2143, 2144], + [2557, 2559, 2567, 2565, 2135, 2137, 2145, 2143], + [2559, 2560, 2568, 2567, 2137, 2138, 2146, 2145], + [2560, 2561, 2569, 2568, 2138, 2139, 2147, 2146], + [2561, 2562, 2570, 2569, 2139, 2140, 2148, 2147], + [2562, 2563, 2571, 2570, 2140, 2141, 2149, 2148], + [2563, 2564, 2572, 2571, 2141, 2142, 2150, 2149], + [2566, 2565, 2573, 2574, 2144, 2143, 2151, 2152], + [2565, 2567, 2575, 2573, 2143, 2145, 2153, 2151], + [2567, 2568, 2576, 2575, 2145, 2146, 2154, 2153], + [2568, 2569, 2577, 2576, 2146, 2147, 2155, 2154], + [2569, 2570, 2578, 2577, 2147, 2148, 2156, 2155], + [2570, 2571, 2579, 2578, 2148, 2149, 2157, 2156], + [2571, 2572, 2580, 2579, 2149, 2150, 2158, 2157], + [2574, 2573, 2581, 2582, 2152, 2151, 2159, 2160], + [2573, 2575, 2583, 2581, 2151, 2153, 2161, 2159], + [2575, 2576, 2584, 2583, 2153, 2154, 2162, 2161], + [2576, 2577, 2585, 2584, 2154, 2155, 2163, 2162], + [2577, 2578, 2586, 2585, 2155, 2156, 2164, 2163], + [2578, 2579, 2587, 2586, 2156, 2157, 2165, 2164], + [2579, 2580, 2588, 2587, 2157, 2158, 2166, 2165], + [2585, 2586, 2589, 2590, 2163, 2164, 2167, 2168], + [2586, 2587, 2591, 2589, 2164, 2165, 2169, 2167], + [2587, 2588, 2592, 2591, 2165, 2166, 2170, 2169], + [2590, 2589, 2593, 2594, 2168, 2167, 2171, 2172], + [2589, 2591, 2595, 2593, 2167, 2169, 2173, 2171], + [2591, 2592, 2596, 2595, 2169, 2170, 2174, 2173], + [2594, 2593, 2597, 2598, 2172, 2171, 2175, 2176], + [2593, 2595, 2599, 2597, 2171, 2173, 2177, 2175], + [2595, 2596, 2600, 2599, 2173, 2174, 2178, 2177], + [2600, 2601, 2602, 2599, 2178, 2179, 2180, 2177], + [2601, 2603, 2604, 2602, 2179, 2181, 2182, 2180], + [2603, 2605, 2606, 2604, 2181, 2183, 2184, 2182], + [2605, 2607, 2608, 2606, 2183, 2185, 2186, 2184], + [2599, 2602, 2609, 2597, 2177, 2180, 2187, 2175], + [2602, 2604, 2610, 2609, 2180, 2182, 2188, 2187], + [2604, 2606, 2611, 2610, 2182, 2184, 2189, 2188], + [2606, 2608, 2612, 2611, 2184, 2186, 2190, 2189], + [2597, 2609, 2613, 2598, 2175, 2187, 2191, 2176], + [2609, 2610, 2614, 2613, 2187, 2188, 2192, 2191], + [2610, 2611, 2615, 2614, 2188, 2189, 2193, 2192], + [2611, 2612, 2616, 2615, 2189, 2190, 2194, 2193], + [2616, 2617, 2618, 2615, 2194, 2195, 2196, 2193], + [2617, 2619, 2620, 2618, 2195, 2197, 2198, 2196], + [2619, 2582, 2581, 2620, 2197, 2160, 2159, 2198], + [2615, 2618, 2621, 2614, 2193, 2196, 2199, 2192], + [2618, 2620, 2622, 2621, 2196, 2198, 2200, 2199], + [2620, 2581, 2583, 2622, 2198, 2159, 2161, 2200], + [2614, 2621, 2623, 2613, 2192, 2199, 2201, 2191], + [2621, 2622, 2624, 2623, 2199, 2200, 2202, 2201], + [2622, 2583, 2584, 2624, 2200, 2161, 2162, 2202], + [2613, 2623, 2594, 2598, 2191, 2201, 2172, 2176], + [2623, 2624, 2590, 2594, 2201, 2202, 2168, 2172], + [2624, 2584, 2585, 2590, 2202, 2162, 2163, 2168], + [2547, 2625, 2626, 2548, 2125, 2203, 2204, 2126], + [2625, 2627, 2628, 2626, 2203, 2205, 2206, 2204], + [2627, 2629, 2630, 2628, 2205, 2207, 2208, 2206], + [2629, 2631, 2632, 2630, 2207, 2209, 2210, 2208], + [2631, 2633, 2634, 2632, 2209, 2211, 2212, 2210], + [2633, 2635, 2636, 2634, 2211, 2213, 2214, 2212], + [2635, 2637, 2638, 2636, 2213, 2215, 2216, 2214], + [2548, 2626, 2639, 2556, 2126, 2204, 2217, 2134], + [2626, 2628, 2640, 2639, 2204, 2206, 2218, 2217], + [2628, 2630, 2641, 2640, 2206, 2208, 2219, 2218], + [2630, 2632, 2642, 2641, 2208, 2210, 2220, 2219], + [2632, 2634, 2643, 2642, 2210, 2212, 2221, 2220], + [2634, 2636, 2644, 2643, 2212, 2214, 2222, 2221], + [2636, 2638, 2645, 2644, 2214, 2216, 2223, 2222], + [2556, 2639, 2646, 2564, 2134, 2217, 2224, 2142], + [2639, 2640, 2647, 2646, 2217, 2218, 2225, 2224], + [2640, 2641, 2648, 2647, 2218, 2219, 2226, 2225], + [2641, 2642, 2649, 2648, 2219, 2220, 2227, 2226], + [2642, 2643, 2650, 2649, 2220, 2221, 2228, 2227], + [2643, 2644, 2651, 2650, 2221, 2222, 2229, 2228], + [2644, 2645, 2652, 2651, 2222, 2223, 2230, 2229], + [2564, 2646, 2653, 2572, 2142, 2224, 2231, 2150], + [2646, 2647, 2654, 2653, 2224, 2225, 2232, 2231], + [2647, 2648, 2655, 2654, 2225, 2226, 2233, 2232], + [2648, 2649, 2656, 2655, 2226, 2227, 2234, 2233], + [2649, 2650, 2657, 2656, 2227, 2228, 2235, 2234], + [2650, 2651, 2658, 2657, 2228, 2229, 2236, 2235], + [2651, 2652, 2659, 2658, 2229, 2230, 2237, 2236], + [2572, 2653, 2660, 2580, 2150, 2231, 2238, 2158], + [2653, 2654, 2661, 2660, 2231, 2232, 2239, 2238], + [2654, 2655, 2662, 2661, 2232, 2233, 2240, 2239], + [2655, 2656, 2663, 2662, 2233, 2234, 2241, 2240], + [2656, 2657, 2664, 2663, 2234, 2235, 2242, 2241], + [2657, 2658, 2665, 2664, 2235, 2236, 2243, 2242], + [2658, 2659, 2666, 2665, 2236, 2237, 2244, 2243], + [2580, 2660, 2667, 2588, 2158, 2238, 2245, 2166], + [2660, 2661, 2668, 2667, 2238, 2239, 2246, 2245], + [2661, 2662, 2669, 2668, 2239, 2240, 2247, 2246], + [2662, 2663, 2670, 2669, 2240, 2241, 2248, 2247], + [2663, 2664, 2671, 2670, 2241, 2242, 2249, 2248], + [2664, 2665, 2672, 2671, 2242, 2243, 2250, 2249], + [2665, 2666, 2673, 2672, 2243, 2244, 2251, 2250], + [2669, 2670, 2674, 2675, 2247, 2248, 2252, 2253], + [2670, 2671, 2676, 2674, 2248, 2249, 2254, 2252], + [2671, 2672, 2677, 2676, 2249, 2250, 2255, 2254], + [2672, 2673, 2678, 2677, 2250, 2251, 2256, 2255], + [2675, 2674, 2679, 2680, 2253, 2252, 2257, 2258], + [2674, 2676, 2681, 2679, 2252, 2254, 2259, 2257], + [2676, 2677, 2682, 2681, 2254, 2255, 2260, 2259], + [2677, 2678, 2683, 2682, 2255, 2256, 2261, 2260], + [2680, 2679, 2684, 2685, 2258, 2257, 2262, 2263], + [2679, 2681, 2686, 2684, 2257, 2259, 2264, 2262], + [2681, 2682, 2687, 2686, 2259, 2260, 2265, 2264], + [2682, 2683, 2688, 2687, 2260, 2261, 2266, 2265], + [2688, 2689, 2690, 2687, 2266, 2267, 2268, 2265], + [2689, 2691, 2692, 2690, 2267, 2269, 2270, 2268], + [2691, 2607, 2605, 2692, 2269, 2185, 2183, 2270], + [2687, 2690, 2693, 2686, 2265, 2268, 2271, 2264], + [2690, 2692, 2694, 2693, 2268, 2270, 2272, 2271], + [2692, 2605, 2603, 2694, 2270, 2183, 2181, 2272], + [2686, 2693, 2695, 2684, 2264, 2271, 2273, 2262], + [2693, 2694, 2696, 2695, 2271, 2272, 2274, 2273], + [2694, 2603, 2601, 2696, 2272, 2181, 2179, 2274], + [2684, 2695, 2697, 2685, 2262, 2273, 2275, 2263], + [2695, 2696, 2698, 2697, 2273, 2274, 2276, 2275], + [2696, 2601, 2600, 2698, 2274, 2179, 2178, 2276], + [2600, 2596, 2699, 2698, 2178, 2174, 2277, 2276], + [2596, 2592, 2700, 2699, 2174, 2170, 2278, 2277], + [2592, 2588, 2667, 2700, 2170, 2166, 2245, 2278], + [2698, 2699, 2701, 2697, 2276, 2277, 2279, 2275], + [2699, 2700, 2702, 2701, 2277, 2278, 2280, 2279], + [2700, 2667, 2668, 2702, 2278, 2245, 2246, 2280], + [2697, 2701, 2680, 2685, 2275, 2279, 2258, 2263], + [2701, 2702, 2675, 2680, 2279, 2280, 2253, 2258], + [2702, 2668, 2669, 2675, 2280, 2246, 2247, 2253], + [2637, 2703, 2704, 2638, 2215, 2281, 2282, 2216], + [2703, 2705, 2706, 2704, 2281, 2283, 2284, 2282], + [2705, 2707, 2708, 2706, 2283, 2285, 2286, 2284], + [2707, 2709, 2710, 2708, 2285, 2287, 2288, 2286], + [2709, 2711, 2712, 2710, 2287, 2289, 2290, 2288], + [2711, 2713, 2714, 2712, 2289, 2291, 2292, 2290], + [2638, 2704, 2715, 2645, 2216, 2282, 2293, 2223], + [2704, 2706, 2716, 2715, 2282, 2284, 2294, 2293], + [2706, 2708, 2717, 2716, 2284, 2286, 2295, 2294], + [2708, 2710, 2718, 2717, 2286, 2288, 2296, 2295], + [2710, 2712, 2719, 2718, 2288, 2290, 2297, 2296], + [2712, 2714, 2720, 2719, 2290, 2292, 2298, 2297], + [2645, 2715, 2721, 2652, 2223, 2293, 2299, 2230], + [2715, 2716, 2722, 2721, 2293, 2294, 2300, 2299], + [2716, 2717, 2723, 2722, 2294, 2295, 2301, 2300], + [2717, 2718, 2724, 2723, 2295, 2296, 2302, 2301], + [2718, 2719, 2725, 2724, 2296, 2297, 2303, 2302], + [2719, 2720, 2726, 2725, 2297, 2298, 2304, 2303], + [2652, 2721, 2727, 2659, 2230, 2299, 2305, 2237], + [2721, 2722, 2728, 2727, 2299, 2300, 2306, 2305], + [2722, 2723, 2729, 2728, 2300, 2301, 2307, 2306], + [2723, 2724, 2730, 2729, 2301, 2302, 2308, 2307], + [2724, 2725, 2731, 2730, 2302, 2303, 2309, 2308], + [2725, 2726, 2732, 2731, 2303, 2304, 2310, 2309], + [2659, 2727, 2733, 2666, 2237, 2305, 2311, 2244], + [2727, 2728, 2734, 2733, 2305, 2306, 2312, 2311], + [2728, 2729, 2735, 2734, 2306, 2307, 2313, 2312], + [2729, 2730, 2736, 2735, 2307, 2308, 2314, 2313], + [2730, 2731, 2737, 2736, 2308, 2309, 2315, 2314], + [2731, 2732, 2738, 2737, 2309, 2310, 2316, 2315], + [2666, 2733, 2739, 2673, 2244, 2311, 2317, 2251], + [2733, 2734, 2740, 2739, 2311, 2312, 2318, 2317], + [2734, 2735, 2741, 2740, 2312, 2313, 2319, 2318], + [2735, 2736, 2742, 2741, 2313, 2314, 2320, 2319], + [2736, 2737, 2743, 2742, 2314, 2315, 2321, 2320], + [2737, 2738, 2744, 2743, 2315, 2316, 2322, 2321], + [2741, 2742, 2745, 2746, 2319, 2320, 2323, 2324], + [2742, 2743, 2747, 2745, 2320, 2321, 2325, 2323], + [2743, 2744, 2748, 2747, 2321, 2322, 2326, 2325], + [2746, 2745, 2749, 2750, 2324, 2323, 2327, 2328], + [2745, 2747, 2751, 2749, 2323, 2325, 2329, 2327], + [2747, 2748, 2752, 2751, 2325, 2326, 2330, 2329], + [2750, 2749, 2753, 2754, 2328, 2327, 2331, 2332], + [2749, 2751, 2755, 2753, 2327, 2329, 2333, 2331], + [2751, 2752, 2756, 2755, 2329, 2330, 2334, 2333], + [2756, 2757, 2758, 2755, 2334, 2335, 2336, 2333], + [2757, 2759, 2760, 2758, 2335, 2337, 2338, 2336], + [2759, 2607, 2691, 2760, 2337, 2185, 2269, 2338], + [2755, 2758, 2761, 2753, 2333, 2336, 2339, 2331], + [2758, 2760, 2762, 2761, 2336, 2338, 2340, 2339], + [2760, 2691, 2689, 2762, 2338, 2269, 2267, 2340], + [2753, 2761, 2763, 2754, 2331, 2339, 2341, 2332], + [2761, 2762, 2764, 2763, 2339, 2340, 2342, 2341], + [2762, 2689, 2688, 2764, 2340, 2267, 2266, 2342], + [2688, 2683, 2765, 2764, 2266, 2261, 2343, 2342], + [2683, 2678, 2766, 2765, 2261, 2256, 2344, 2343], + [2678, 2673, 2739, 2766, 2256, 2251, 2317, 2344], + [2764, 2765, 2767, 2763, 2342, 2343, 2345, 2341], + [2765, 2766, 2768, 2767, 2343, 2344, 2346, 2345], + [2766, 2739, 2740, 2768, 2344, 2317, 2318, 2346], + [2763, 2767, 2750, 2754, 2341, 2345, 2328, 2332], + [2767, 2768, 2746, 2750, 2345, 2346, 2324, 2328], + [2768, 2740, 2741, 2746, 2346, 2318, 2319, 2324], + [2713, 2769, 2770, 2714, 2291, 2347, 2348, 2292], + [2769, 2771, 2772, 2770, 2347, 2349, 2350, 2348], + [2771, 2773, 2774, 2772, 2349, 2351, 2352, 2350], + [2773, 2775, 2776, 2774, 2351, 2353, 2354, 2352], + [2775, 2777, 2778, 2776, 2353, 2355, 2356, 2354], + [2777, 2779, 2780, 2778, 2355, 2357, 2358, 2356], + [2714, 2770, 2781, 2720, 2292, 2348, 2359, 2298], + [2770, 2772, 2782, 2781, 2348, 2350, 2360, 2359], + [2772, 2774, 2783, 2782, 2350, 2352, 2361, 2360], + [2774, 2776, 2784, 2783, 2352, 2354, 2362, 2361], + [2776, 2778, 2785, 2784, 2354, 2356, 2363, 2362], + [2778, 2780, 2786, 2785, 2356, 2358, 2364, 2363], + [2720, 2781, 2787, 2726, 2298, 2359, 2365, 2304], + [2781, 2782, 2788, 2787, 2359, 2360, 2366, 2365], + [2782, 2783, 2789, 2788, 2360, 2361, 2367, 2366], + [2783, 2784, 2790, 2789, 2361, 2362, 2368, 2367], + [2784, 2785, 2791, 2790, 2362, 2363, 2369, 2368], + [2785, 2786, 2792, 2791, 2363, 2364, 2370, 2369], + [2726, 2787, 2793, 2732, 2304, 2365, 2371, 2310], + [2787, 2788, 2794, 2793, 2365, 2366, 2372, 2371], + [2788, 2789, 2795, 2794, 2366, 2367, 2373, 2372], + [2789, 2790, 2796, 2795, 2367, 2368, 2374, 2373], + [2790, 2791, 2797, 2796, 2368, 2369, 2375, 2374], + [2791, 2792, 2798, 2797, 2369, 2370, 2376, 2375], + [2732, 2793, 2799, 2738, 2310, 2371, 2377, 2316], + [2793, 2794, 2800, 2799, 2371, 2372, 2378, 2377], + [2794, 2795, 2801, 2800, 2372, 2373, 2379, 2378], + [2795, 2796, 2802, 2801, 2373, 2374, 2380, 2379], + [2796, 2797, 2803, 2802, 2374, 2375, 2381, 2380], + [2797, 2798, 2804, 2803, 2375, 2376, 2382, 2381], + [2738, 2799, 2805, 2744, 2316, 2377, 2383, 2322], + [2799, 2800, 2806, 2805, 2377, 2378, 2384, 2383], + [2800, 2801, 2807, 2806, 2378, 2379, 2385, 2384], + [2801, 2802, 2808, 2807, 2379, 2380, 2386, 2385], + [2802, 2803, 2809, 2808, 2380, 2381, 2387, 2386], + [2803, 2804, 2810, 2809, 2381, 2382, 2388, 2387], + [2807, 2808, 2811, 2812, 2385, 2386, 2389, 2390], + [2808, 2809, 2813, 2811, 2386, 2387, 2391, 2389], + [2809, 2810, 2814, 2813, 2387, 2388, 2392, 2391], + [2812, 2811, 2815, 2816, 2390, 2389, 2393, 2394], + [2811, 2813, 2817, 2815, 2389, 2391, 2395, 2393], + [2813, 2814, 2818, 2817, 2391, 2392, 2396, 2395], + [2816, 2815, 2819, 2820, 2394, 2393, 2397, 2398], + [2815, 2817, 2821, 2819, 2393, 2395, 2399, 2397], + [2817, 2818, 2822, 2821, 2395, 2396, 2400, 2399], + [2822, 2823, 2824, 2821, 2400, 2401, 2402, 2399], + [2823, 2825, 2826, 2824, 2401, 2403, 2404, 2402], + [2825, 2607, 2759, 2826, 2403, 2185, 2337, 2404], + [2821, 2824, 2827, 2819, 2399, 2402, 2405, 2397], + [2824, 2826, 2828, 2827, 2402, 2404, 2406, 2405], + [2826, 2759, 2757, 2828, 2404, 2337, 2335, 2406], + [2819, 2827, 2829, 2820, 2397, 2405, 2407, 2398], + [2827, 2828, 2830, 2829, 2405, 2406, 2408, 2407], + [2828, 2757, 2756, 2830, 2406, 2335, 2334, 2408], + [2756, 2752, 2831, 2830, 2334, 2330, 2409, 2408], + [2752, 2748, 2832, 2831, 2330, 2326, 2410, 2409], + [2748, 2744, 2805, 2832, 2326, 2322, 2383, 2410], + [2830, 2831, 2833, 2829, 2408, 2409, 2411, 2407], + [2831, 2832, 2834, 2833, 2409, 2410, 2412, 2411], + [2832, 2805, 2806, 2834, 2410, 2383, 2384, 2412], + [2829, 2833, 2816, 2820, 2407, 2411, 2394, 2398], + [2833, 2834, 2812, 2816, 2411, 2412, 2390, 2394], + [2834, 2806, 2807, 2812, 2412, 2384, 2385, 2390], + [2779, 2835, 2836, 2780, 2357, 2413, 2414, 2358], + [2835, 2837, 2838, 2836, 2413, 2415, 2416, 2414], + [2837, 2839, 2840, 2838, 2415, 2417, 2418, 2416], + [2839, 2841, 2842, 2840, 2417, 2419, 2420, 2418], + [2841, 2843, 2844, 2842, 2419, 2421, 2422, 2420], + [2843, 2845, 2846, 2844, 2421, 2423, 2424, 2422], + [2780, 2836, 2847, 2786, 2358, 2414, 2425, 2364], + [2836, 2838, 2848, 2847, 2414, 2416, 2426, 2425], + [2838, 2840, 2849, 2848, 2416, 2418, 2427, 2426], + [2840, 2842, 2850, 2849, 2418, 2420, 2428, 2427], + [2842, 2844, 2851, 2850, 2420, 2422, 2429, 2428], + [2844, 2846, 2852, 2851, 2422, 2424, 2430, 2429], + [2786, 2847, 2853, 2792, 2364, 2425, 2431, 2370], + [2847, 2848, 2854, 2853, 2425, 2426, 2432, 2431], + [2848, 2849, 2855, 2854, 2426, 2427, 2433, 2432], + [2849, 2850, 2856, 2855, 2427, 2428, 2434, 2433], + [2850, 2851, 2857, 2856, 2428, 2429, 2435, 2434], + [2851, 2852, 2858, 2857, 2429, 2430, 2436, 2435], + [2792, 2853, 2859, 2798, 2370, 2431, 2437, 2376], + [2853, 2854, 2860, 2859, 2431, 2432, 2438, 2437], + [2854, 2855, 2861, 2860, 2432, 2433, 2439, 2438], + [2855, 2856, 2862, 2861, 2433, 2434, 2440, 2439], + [2856, 2857, 2863, 2862, 2434, 2435, 2441, 2440], + [2857, 2858, 2864, 2863, 2435, 2436, 2442, 2441], + [2798, 2859, 2865, 2804, 2376, 2437, 2443, 2382], + [2859, 2860, 2866, 2865, 2437, 2438, 2444, 2443], + [2860, 2861, 2867, 2866, 2438, 2439, 2445, 2444], + [2861, 2862, 2868, 2867, 2439, 2440, 2446, 2445], + [2862, 2863, 2869, 2868, 2440, 2441, 2447, 2446], + [2863, 2864, 2870, 2869, 2441, 2442, 2448, 2447], + [2804, 2865, 2871, 2810, 2382, 2443, 2449, 2388], + [2865, 2866, 2872, 2871, 2443, 2444, 2450, 2449], + [2866, 2867, 2873, 2872, 2444, 2445, 2451, 2450], + [2867, 2868, 2874, 2873, 2445, 2446, 2452, 2451], + [2868, 2869, 2875, 2874, 2446, 2447, 2453, 2452], + [2869, 2870, 2876, 2875, 2447, 2448, 2454, 2453], + [2873, 2874, 2877, 2878, 2451, 2452, 2455, 2456], + [2874, 2875, 2879, 2877, 2452, 2453, 2457, 2455], + [2875, 2876, 2880, 2879, 2453, 2454, 2458, 2457], + [2878, 2877, 2881, 2882, 2456, 2455, 2459, 2460], + [2877, 2879, 2883, 2881, 2455, 2457, 2461, 2459], + [2879, 2880, 2884, 2883, 2457, 2458, 2462, 2461], + [2882, 2881, 2885, 2886, 2460, 2459, 2463, 2464], + [2881, 2883, 2887, 2885, 2459, 2461, 2465, 2463], + [2883, 2884, 2888, 2887, 2461, 2462, 2466, 2465], + [2888, 2889, 2890, 2887, 2466, 2467, 2468, 2465], + [2889, 2891, 2892, 2890, 2467, 2469, 2470, 2468], + [2891, 2607, 2825, 2892, 2469, 2185, 2403, 2470], + [2887, 2890, 2893, 2885, 2465, 2468, 2471, 2463], + [2890, 2892, 2894, 2893, 2468, 2470, 2472, 2471], + [2892, 2825, 2823, 2894, 2470, 2403, 2401, 2472], + [2885, 2893, 2895, 2886, 2463, 2471, 2473, 2464], + [2893, 2894, 2896, 2895, 2471, 2472, 2474, 2473], + [2894, 2823, 2822, 2896, 2472, 2401, 2400, 2474], + [2822, 2818, 2897, 2896, 2400, 2396, 2475, 2474], + [2818, 2814, 2898, 2897, 2396, 2392, 2476, 2475], + [2814, 2810, 2871, 2898, 2392, 2388, 2449, 2476], + [2896, 2897, 2899, 2895, 2474, 2475, 2477, 2473], + [2897, 2898, 2900, 2899, 2475, 2476, 2478, 2477], + [2898, 2871, 2872, 2900, 2476, 2449, 2450, 2478], + [2895, 2899, 2882, 2886, 2473, 2477, 2460, 2464], + [2899, 2900, 2878, 2882, 2477, 2478, 2456, 2460], + [2900, 2872, 2873, 2878, 2478, 2450, 2451, 2456], + [2845, 2901, 2902, 2846, 2423, 2479, 2480, 2424], + [2901, 2903, 2904, 2902, 2479, 2481, 2482, 2480], + [2903, 2905, 2906, 2904, 2481, 2483, 2484, 2482], + [2905, 2907, 2908, 2906, 2483, 2485, 2486, 2484], + [2907, 2909, 2910, 2908, 2485, 2487, 2488, 2486], + [2909, 2533, 2536, 2910, 2487, 2111, 2114, 2488], + [2846, 2902, 2911, 2852, 2424, 2480, 2489, 2430], + [2902, 2904, 2912, 2911, 2480, 2482, 2490, 2489], + [2904, 2906, 2913, 2912, 2482, 2484, 2491, 2490], + [2906, 2908, 2914, 2913, 2484, 2486, 2492, 2491], + [2908, 2910, 2915, 2914, 2486, 2488, 2493, 2492], + [2910, 2536, 2550, 2915, 2488, 2114, 2128, 2493], + [2852, 2911, 2916, 2858, 2430, 2489, 2494, 2436], + [2911, 2912, 2917, 2916, 2489, 2490, 2495, 2494], + [2912, 2913, 2918, 2917, 2490, 2491, 2496, 2495], + [2913, 2914, 2919, 2918, 2491, 2492, 2497, 2496], + [2914, 2915, 2920, 2919, 2492, 2493, 2498, 2497], + [2915, 2550, 2558, 2920, 2493, 2128, 2136, 2498], + [2858, 2916, 2921, 2864, 2436, 2494, 2499, 2442], + [2916, 2917, 2922, 2921, 2494, 2495, 2500, 2499], + [2917, 2918, 2923, 2922, 2495, 2496, 2501, 2500], + [2918, 2919, 2924, 2923, 2496, 2497, 2502, 2501], + [2919, 2920, 2925, 2924, 2497, 2498, 2503, 2502], + [2920, 2558, 2566, 2925, 2498, 2136, 2144, 2503], + [2864, 2921, 2926, 2870, 2442, 2499, 2504, 2448], + [2921, 2922, 2927, 2926, 2499, 2500, 2505, 2504], + [2922, 2923, 2928, 2927, 2500, 2501, 2506, 2505], + [2923, 2924, 2929, 2928, 2501, 2502, 2507, 2506], + [2924, 2925, 2930, 2929, 2502, 2503, 2508, 2507], + [2925, 2566, 2574, 2930, 2503, 2144, 2152, 2508], + [2870, 2926, 2931, 2876, 2448, 2504, 2509, 2454], + [2926, 2927, 2932, 2931, 2504, 2505, 2510, 2509], + [2927, 2928, 2933, 2932, 2505, 2506, 2511, 2510], + [2928, 2929, 2934, 2933, 2506, 2507, 2512, 2511], + [2929, 2930, 2935, 2934, 2507, 2508, 2513, 2512], + [2930, 2574, 2582, 2935, 2508, 2152, 2160, 2513], + [2933, 2934, 2936, 2937, 2511, 2512, 2514, 2515], + [2934, 2935, 2938, 2936, 2512, 2513, 2516, 2514], + [2935, 2582, 2619, 2938, 2513, 2160, 2197, 2516], + [2937, 2936, 2939, 2940, 2515, 2514, 2517, 2518], + [2936, 2938, 2941, 2939, 2514, 2516, 2519, 2517], + [2938, 2619, 2617, 2941, 2516, 2197, 2195, 2519], + [2940, 2939, 2942, 2943, 2518, 2517, 2520, 2521], + [2939, 2941, 2944, 2942, 2517, 2519, 2522, 2520], + [2941, 2617, 2616, 2944, 2519, 2195, 2194, 2522], + [2616, 2612, 2945, 2944, 2194, 2190, 2523, 2522], + [2612, 2608, 2946, 2945, 2190, 2186, 2524, 2523], + [2608, 2607, 2891, 2946, 2186, 2185, 2469, 2524], + [2944, 2945, 2947, 2942, 2522, 2523, 2525, 2520], + [2945, 2946, 2948, 2947, 2523, 2524, 2526, 2525], + [2946, 2891, 2889, 2948, 2524, 2469, 2467, 2526], + [2942, 2947, 2949, 2943, 2520, 2525, 2527, 2521], + [2947, 2948, 2950, 2949, 2525, 2526, 2528, 2527], + [2948, 2889, 2888, 2950, 2526, 2467, 2466, 2528], + [2888, 2884, 2951, 2950, 2466, 2462, 2529, 2528], + [2884, 2880, 2952, 2951, 2462, 2458, 2530, 2529], + [2880, 2876, 2931, 2952, 2458, 2454, 2509, 2530], + [2950, 2951, 2953, 2949, 2528, 2529, 2531, 2527], + [2951, 2952, 2954, 2953, 2529, 2530, 2532, 2531], + [2952, 2931, 2932, 2954, 2530, 2509, 2510, 2532], + [2949, 2953, 2940, 2943, 2527, 2531, 2518, 2521], + [2953, 2954, 2937, 2940, 2531, 2532, 2515, 2518], + [2954, 2932, 2933, 2937, 2532, 2510, 2511, 2515], + [2955, 2956, 2957, 2958, 2533, 2534, 2535, 2536], + [2956, 2959, 2960, 2957, 2534, 2537, 2538, 2535], + [2959, 2961, 2962, 2960, 2537, 2539, 2540, 2538], + [2961, 2963, 2964, 2962, 2539, 2541, 2542, 2540], + [2963, 2965, 2966, 2964, 2541, 2543, 2544, 2542], + [2965, 2967, 2968, 2966, 2543, 2545, 2546, 2544], + [2967, 2969, 2970, 2968, 2545, 2547, 2548, 2546], + [2958, 2957, 2971, 2972, 2536, 2535, 2549, 2550], + [2957, 2960, 2973, 2971, 2535, 2538, 2551, 2549], + [2960, 2962, 2974, 2973, 2538, 2540, 2552, 2551], + [2962, 2964, 2975, 2974, 2540, 2542, 2553, 2552], + [2964, 2966, 2976, 2975, 2542, 2544, 2554, 2553], + [2966, 2968, 2977, 2976, 2544, 2546, 2555, 2554], + [2968, 2970, 2978, 2977, 2546, 2548, 2556, 2555], + [2972, 2971, 2979, 2980, 2550, 2549, 2557, 2558], + [2971, 2973, 2981, 2979, 2549, 2551, 2559, 2557], + [2973, 2974, 2982, 2981, 2551, 2552, 2560, 2559], + [2974, 2975, 2983, 2982, 2552, 2553, 2561, 2560], + [2975, 2976, 2984, 2983, 2553, 2554, 2562, 2561], + [2976, 2977, 2985, 2984, 2554, 2555, 2563, 2562], + [2977, 2978, 2986, 2985, 2555, 2556, 2564, 2563], + [2980, 2979, 2987, 2988, 2558, 2557, 2565, 2566], + [2979, 2981, 2989, 2987, 2557, 2559, 2567, 2565], + [2981, 2982, 2990, 2989, 2559, 2560, 2568, 2567], + [2982, 2983, 2991, 2990, 2560, 2561, 2569, 2568], + [2983, 2984, 2992, 2991, 2561, 2562, 2570, 2569], + [2984, 2985, 2993, 2992, 2562, 2563, 2571, 2570], + [2985, 2986, 2994, 2993, 2563, 2564, 2572, 2571], + [2988, 2987, 2995, 2996, 2566, 2565, 2573, 2574], + [2987, 2989, 2997, 2995, 2565, 2567, 2575, 2573], + [2989, 2990, 2998, 2997, 2567, 2568, 2576, 2575], + [2990, 2991, 2999, 2998, 2568, 2569, 2577, 2576], + [2991, 2992, 3000, 2999, 2569, 2570, 2578, 2577], + [2992, 2993, 3001, 3000, 2570, 2571, 2579, 2578], + [2993, 2994, 3002, 3001, 2571, 2572, 2580, 2579], + [2996, 2995, 3003, 3004, 2574, 2573, 2581, 2582], + [2995, 2997, 3005, 3003, 2573, 2575, 2583, 2581], + [2997, 2998, 3006, 3005, 2575, 2576, 2584, 2583], + [2998, 2999, 3007, 3006, 2576, 2577, 2585, 2584], + [2999, 3000, 3008, 3007, 2577, 2578, 2586, 2585], + [3000, 3001, 3009, 3008, 2578, 2579, 2587, 2586], + [3001, 3002, 3010, 3009, 2579, 2580, 2588, 2587], + [3007, 3008, 3011, 3012, 2585, 2586, 2589, 2590], + [3008, 3009, 3013, 3011, 2586, 2587, 2591, 2589], + [3009, 3010, 3014, 3013, 2587, 2588, 2592, 2591], + [3012, 3011, 3015, 3016, 2590, 2589, 2593, 2594], + [3011, 3013, 3017, 3015, 2589, 2591, 2595, 2593], + [3013, 3014, 3018, 3017, 2591, 2592, 2596, 2595], + [3016, 3015, 3019, 3020, 2594, 2593, 2597, 2598], + [3015, 3017, 3021, 3019, 2593, 2595, 2599, 2597], + [3017, 3018, 3022, 3021, 2595, 2596, 2600, 2599], + [3022, 3023, 3024, 3021, 2600, 2601, 2602, 2599], + [3023, 3025, 3026, 3024, 2601, 2603, 2604, 2602], + [3025, 3027, 3028, 3026, 2603, 2605, 2606, 2604], + [3027, 3029, 3030, 3028, 2605, 2607, 2608, 2606], + [3021, 3024, 3031, 3019, 2599, 2602, 2609, 2597], + [3024, 3026, 3032, 3031, 2602, 2604, 2610, 2609], + [3026, 3028, 3033, 3032, 2604, 2606, 2611, 2610], + [3028, 3030, 3034, 3033, 2606, 2608, 2612, 2611], + [3019, 3031, 3035, 3020, 2597, 2609, 2613, 2598], + [3031, 3032, 3036, 3035, 2609, 2610, 2614, 2613], + [3032, 3033, 3037, 3036, 2610, 2611, 2615, 2614], + [3033, 3034, 3038, 3037, 2611, 2612, 2616, 2615], + [3038, 3039, 3040, 3037, 2616, 2617, 2618, 2615], + [3039, 3041, 3042, 3040, 2617, 2619, 2620, 2618], + [3041, 3004, 3003, 3042, 2619, 2582, 2581, 2620], + [3037, 3040, 3043, 3036, 2615, 2618, 2621, 2614], + [3040, 3042, 3044, 3043, 2618, 2620, 2622, 2621], + [3042, 3003, 3005, 3044, 2620, 2581, 2583, 2622], + [3036, 3043, 3045, 3035, 2614, 2621, 2623, 2613], + [3043, 3044, 3046, 3045, 2621, 2622, 2624, 2623], + [3044, 3005, 3006, 3046, 2622, 2583, 2584, 2624], + [3035, 3045, 3016, 3020, 2613, 2623, 2594, 2598], + [3045, 3046, 3012, 3016, 2623, 2624, 2590, 2594], + [3046, 3006, 3007, 3012, 2624, 2584, 2585, 2590], + [2969, 3047, 3048, 2970, 2547, 2625, 2626, 2548], + [3047, 3049, 3050, 3048, 2625, 2627, 2628, 2626], + [3049, 3051, 3052, 3050, 2627, 2629, 2630, 2628], + [3051, 3053, 3054, 3052, 2629, 2631, 2632, 2630], + [3053, 3055, 3056, 3054, 2631, 2633, 2634, 2632], + [3055, 3057, 3058, 3056, 2633, 2635, 2636, 2634], + [3057, 3059, 3060, 3058, 2635, 2637, 2638, 2636], + [2970, 3048, 3061, 2978, 2548, 2626, 2639, 2556], + [3048, 3050, 3062, 3061, 2626, 2628, 2640, 2639], + [3050, 3052, 3063, 3062, 2628, 2630, 2641, 2640], + [3052, 3054, 3064, 3063, 2630, 2632, 2642, 2641], + [3054, 3056, 3065, 3064, 2632, 2634, 2643, 2642], + [3056, 3058, 3066, 3065, 2634, 2636, 2644, 2643], + [3058, 3060, 3067, 3066, 2636, 2638, 2645, 2644], + [2978, 3061, 3068, 2986, 2556, 2639, 2646, 2564], + [3061, 3062, 3069, 3068, 2639, 2640, 2647, 2646], + [3062, 3063, 3070, 3069, 2640, 2641, 2648, 2647], + [3063, 3064, 3071, 3070, 2641, 2642, 2649, 2648], + [3064, 3065, 3072, 3071, 2642, 2643, 2650, 2649], + [3065, 3066, 3073, 3072, 2643, 2644, 2651, 2650], + [3066, 3067, 3074, 3073, 2644, 2645, 2652, 2651], + [2986, 3068, 3075, 2994, 2564, 2646, 2653, 2572], + [3068, 3069, 3076, 3075, 2646, 2647, 2654, 2653], + [3069, 3070, 3077, 3076, 2647, 2648, 2655, 2654], + [3070, 3071, 3078, 3077, 2648, 2649, 2656, 2655], + [3071, 3072, 3079, 3078, 2649, 2650, 2657, 2656], + [3072, 3073, 3080, 3079, 2650, 2651, 2658, 2657], + [3073, 3074, 3081, 3080, 2651, 2652, 2659, 2658], + [2994, 3075, 3082, 3002, 2572, 2653, 2660, 2580], + [3075, 3076, 3083, 3082, 2653, 2654, 2661, 2660], + [3076, 3077, 3084, 3083, 2654, 2655, 2662, 2661], + [3077, 3078, 3085, 3084, 2655, 2656, 2663, 2662], + [3078, 3079, 3086, 3085, 2656, 2657, 2664, 2663], + [3079, 3080, 3087, 3086, 2657, 2658, 2665, 2664], + [3080, 3081, 3088, 3087, 2658, 2659, 2666, 2665], + [3002, 3082, 3089, 3010, 2580, 2660, 2667, 2588], + [3082, 3083, 3090, 3089, 2660, 2661, 2668, 2667], + [3083, 3084, 3091, 3090, 2661, 2662, 2669, 2668], + [3084, 3085, 3092, 3091, 2662, 2663, 2670, 2669], + [3085, 3086, 3093, 3092, 2663, 2664, 2671, 2670], + [3086, 3087, 3094, 3093, 2664, 2665, 2672, 2671], + [3087, 3088, 3095, 3094, 2665, 2666, 2673, 2672], + [3091, 3092, 3096, 3097, 2669, 2670, 2674, 2675], + [3092, 3093, 3098, 3096, 2670, 2671, 2676, 2674], + [3093, 3094, 3099, 3098, 2671, 2672, 2677, 2676], + [3094, 3095, 3100, 3099, 2672, 2673, 2678, 2677], + [3097, 3096, 3101, 3102, 2675, 2674, 2679, 2680], + [3096, 3098, 3103, 3101, 2674, 2676, 2681, 2679], + [3098, 3099, 3104, 3103, 2676, 2677, 2682, 2681], + [3099, 3100, 3105, 3104, 2677, 2678, 2683, 2682], + [3102, 3101, 3106, 3107, 2680, 2679, 2684, 2685], + [3101, 3103, 3108, 3106, 2679, 2681, 2686, 2684], + [3103, 3104, 3109, 3108, 2681, 2682, 2687, 2686], + [3104, 3105, 3110, 3109, 2682, 2683, 2688, 2687], + [3110, 3111, 3112, 3109, 2688, 2689, 2690, 2687], + [3111, 3113, 3114, 3112, 2689, 2691, 2692, 2690], + [3113, 3029, 3027, 3114, 2691, 2607, 2605, 2692], + [3109, 3112, 3115, 3108, 2687, 2690, 2693, 2686], + [3112, 3114, 3116, 3115, 2690, 2692, 2694, 2693], + [3114, 3027, 3025, 3116, 2692, 2605, 2603, 2694], + [3108, 3115, 3117, 3106, 2686, 2693, 2695, 2684], + [3115, 3116, 3118, 3117, 2693, 2694, 2696, 2695], + [3116, 3025, 3023, 3118, 2694, 2603, 2601, 2696], + [3106, 3117, 3119, 3107, 2684, 2695, 2697, 2685], + [3117, 3118, 3120, 3119, 2695, 2696, 2698, 2697], + [3118, 3023, 3022, 3120, 2696, 2601, 2600, 2698], + [3022, 3018, 3121, 3120, 2600, 2596, 2699, 2698], + [3018, 3014, 3122, 3121, 2596, 2592, 2700, 2699], + [3014, 3010, 3089, 3122, 2592, 2588, 2667, 2700], + [3120, 3121, 3123, 3119, 2698, 2699, 2701, 2697], + [3121, 3122, 3124, 3123, 2699, 2700, 2702, 2701], + [3122, 3089, 3090, 3124, 2700, 2667, 2668, 2702], + [3119, 3123, 3102, 3107, 2697, 2701, 2680, 2685], + [3123, 3124, 3097, 3102, 2701, 2702, 2675, 2680], + [3124, 3090, 3091, 3097, 2702, 2668, 2669, 2675], + [3059, 3125, 3126, 3060, 2637, 2703, 2704, 2638], + [3125, 3127, 3128, 3126, 2703, 2705, 2706, 2704], + [3127, 3129, 3130, 3128, 2705, 2707, 2708, 2706], + [3129, 3131, 3132, 3130, 2707, 2709, 2710, 2708], + [3131, 3133, 3134, 3132, 2709, 2711, 2712, 2710], + [3133, 3135, 3136, 3134, 2711, 2713, 2714, 2712], + [3060, 3126, 3137, 3067, 2638, 2704, 2715, 2645], + [3126, 3128, 3138, 3137, 2704, 2706, 2716, 2715], + [3128, 3130, 3139, 3138, 2706, 2708, 2717, 2716], + [3130, 3132, 3140, 3139, 2708, 2710, 2718, 2717], + [3132, 3134, 3141, 3140, 2710, 2712, 2719, 2718], + [3134, 3136, 3142, 3141, 2712, 2714, 2720, 2719], + [3067, 3137, 3143, 3074, 2645, 2715, 2721, 2652], + [3137, 3138, 3144, 3143, 2715, 2716, 2722, 2721], + [3138, 3139, 3145, 3144, 2716, 2717, 2723, 2722], + [3139, 3140, 3146, 3145, 2717, 2718, 2724, 2723], + [3140, 3141, 3147, 3146, 2718, 2719, 2725, 2724], + [3141, 3142, 3148, 3147, 2719, 2720, 2726, 2725], + [3074, 3143, 3149, 3081, 2652, 2721, 2727, 2659], + [3143, 3144, 3150, 3149, 2721, 2722, 2728, 2727], + [3144, 3145, 3151, 3150, 2722, 2723, 2729, 2728], + [3145, 3146, 3152, 3151, 2723, 2724, 2730, 2729], + [3146, 3147, 3153, 3152, 2724, 2725, 2731, 2730], + [3147, 3148, 3154, 3153, 2725, 2726, 2732, 2731], + [3081, 3149, 3155, 3088, 2659, 2727, 2733, 2666], + [3149, 3150, 3156, 3155, 2727, 2728, 2734, 2733], + [3150, 3151, 3157, 3156, 2728, 2729, 2735, 2734], + [3151, 3152, 3158, 3157, 2729, 2730, 2736, 2735], + [3152, 3153, 3159, 3158, 2730, 2731, 2737, 2736], + [3153, 3154, 3160, 3159, 2731, 2732, 2738, 2737], + [3088, 3155, 3161, 3095, 2666, 2733, 2739, 2673], + [3155, 3156, 3162, 3161, 2733, 2734, 2740, 2739], + [3156, 3157, 3163, 3162, 2734, 2735, 2741, 2740], + [3157, 3158, 3164, 3163, 2735, 2736, 2742, 2741], + [3158, 3159, 3165, 3164, 2736, 2737, 2743, 2742], + [3159, 3160, 3166, 3165, 2737, 2738, 2744, 2743], + [3163, 3164, 3167, 3168, 2741, 2742, 2745, 2746], + [3164, 3165, 3169, 3167, 2742, 2743, 2747, 2745], + [3165, 3166, 3170, 3169, 2743, 2744, 2748, 2747], + [3168, 3167, 3171, 3172, 2746, 2745, 2749, 2750], + [3167, 3169, 3173, 3171, 2745, 2747, 2751, 2749], + [3169, 3170, 3174, 3173, 2747, 2748, 2752, 2751], + [3172, 3171, 3175, 3176, 2750, 2749, 2753, 2754], + [3171, 3173, 3177, 3175, 2749, 2751, 2755, 2753], + [3173, 3174, 3178, 3177, 2751, 2752, 2756, 2755], + [3178, 3179, 3180, 3177, 2756, 2757, 2758, 2755], + [3179, 3181, 3182, 3180, 2757, 2759, 2760, 2758], + [3181, 3029, 3113, 3182, 2759, 2607, 2691, 2760], + [3177, 3180, 3183, 3175, 2755, 2758, 2761, 2753], + [3180, 3182, 3184, 3183, 2758, 2760, 2762, 2761], + [3182, 3113, 3111, 3184, 2760, 2691, 2689, 2762], + [3175, 3183, 3185, 3176, 2753, 2761, 2763, 2754], + [3183, 3184, 3186, 3185, 2761, 2762, 2764, 2763], + [3184, 3111, 3110, 3186, 2762, 2689, 2688, 2764], + [3110, 3105, 3187, 3186, 2688, 2683, 2765, 2764], + [3105, 3100, 3188, 3187, 2683, 2678, 2766, 2765], + [3100, 3095, 3161, 3188, 2678, 2673, 2739, 2766], + [3186, 3187, 3189, 3185, 2764, 2765, 2767, 2763], + [3187, 3188, 3190, 3189, 2765, 2766, 2768, 2767], + [3188, 3161, 3162, 3190, 2766, 2739, 2740, 2768], + [3185, 3189, 3172, 3176, 2763, 2767, 2750, 2754], + [3189, 3190, 3168, 3172, 2767, 2768, 2746, 2750], + [3190, 3162, 3163, 3168, 2768, 2740, 2741, 2746], + [3135, 3191, 3192, 3136, 2713, 2769, 2770, 2714], + [3191, 3193, 3194, 3192, 2769, 2771, 2772, 2770], + [3193, 3195, 3196, 3194, 2771, 2773, 2774, 2772], + [3195, 3197, 3198, 3196, 2773, 2775, 2776, 2774], + [3197, 3199, 3200, 3198, 2775, 2777, 2778, 2776], + [3199, 3201, 3202, 3200, 2777, 2779, 2780, 2778], + [3136, 3192, 3203, 3142, 2714, 2770, 2781, 2720], + [3192, 3194, 3204, 3203, 2770, 2772, 2782, 2781], + [3194, 3196, 3205, 3204, 2772, 2774, 2783, 2782], + [3196, 3198, 3206, 3205, 2774, 2776, 2784, 2783], + [3198, 3200, 3207, 3206, 2776, 2778, 2785, 2784], + [3200, 3202, 3208, 3207, 2778, 2780, 2786, 2785], + [3142, 3203, 3209, 3148, 2720, 2781, 2787, 2726], + [3203, 3204, 3210, 3209, 2781, 2782, 2788, 2787], + [3204, 3205, 3211, 3210, 2782, 2783, 2789, 2788], + [3205, 3206, 3212, 3211, 2783, 2784, 2790, 2789], + [3206, 3207, 3213, 3212, 2784, 2785, 2791, 2790], + [3207, 3208, 3214, 3213, 2785, 2786, 2792, 2791], + [3148, 3209, 3215, 3154, 2726, 2787, 2793, 2732], + [3209, 3210, 3216, 3215, 2787, 2788, 2794, 2793], + [3210, 3211, 3217, 3216, 2788, 2789, 2795, 2794], + [3211, 3212, 3218, 3217, 2789, 2790, 2796, 2795], + [3212, 3213, 3219, 3218, 2790, 2791, 2797, 2796], + [3213, 3214, 3220, 3219, 2791, 2792, 2798, 2797], + [3154, 3215, 3221, 3160, 2732, 2793, 2799, 2738], + [3215, 3216, 3222, 3221, 2793, 2794, 2800, 2799], + [3216, 3217, 3223, 3222, 2794, 2795, 2801, 2800], + [3217, 3218, 3224, 3223, 2795, 2796, 2802, 2801], + [3218, 3219, 3225, 3224, 2796, 2797, 2803, 2802], + [3219, 3220, 3226, 3225, 2797, 2798, 2804, 2803], + [3160, 3221, 3227, 3166, 2738, 2799, 2805, 2744], + [3221, 3222, 3228, 3227, 2799, 2800, 2806, 2805], + [3222, 3223, 3229, 3228, 2800, 2801, 2807, 2806], + [3223, 3224, 3230, 3229, 2801, 2802, 2808, 2807], + [3224, 3225, 3231, 3230, 2802, 2803, 2809, 2808], + [3225, 3226, 3232, 3231, 2803, 2804, 2810, 2809], + [3229, 3230, 3233, 3234, 2807, 2808, 2811, 2812], + [3230, 3231, 3235, 3233, 2808, 2809, 2813, 2811], + [3231, 3232, 3236, 3235, 2809, 2810, 2814, 2813], + [3234, 3233, 3237, 3238, 2812, 2811, 2815, 2816], + [3233, 3235, 3239, 3237, 2811, 2813, 2817, 2815], + [3235, 3236, 3240, 3239, 2813, 2814, 2818, 2817], + [3238, 3237, 3241, 3242, 2816, 2815, 2819, 2820], + [3237, 3239, 3243, 3241, 2815, 2817, 2821, 2819], + [3239, 3240, 3244, 3243, 2817, 2818, 2822, 2821], + [3244, 3245, 3246, 3243, 2822, 2823, 2824, 2821], + [3245, 3247, 3248, 3246, 2823, 2825, 2826, 2824], + [3247, 3029, 3181, 3248, 2825, 2607, 2759, 2826], + [3243, 3246, 3249, 3241, 2821, 2824, 2827, 2819], + [3246, 3248, 3250, 3249, 2824, 2826, 2828, 2827], + [3248, 3181, 3179, 3250, 2826, 2759, 2757, 2828], + [3241, 3249, 3251, 3242, 2819, 2827, 2829, 2820], + [3249, 3250, 3252, 3251, 2827, 2828, 2830, 2829], + [3250, 3179, 3178, 3252, 2828, 2757, 2756, 2830], + [3178, 3174, 3253, 3252, 2756, 2752, 2831, 2830], + [3174, 3170, 3254, 3253, 2752, 2748, 2832, 2831], + [3170, 3166, 3227, 3254, 2748, 2744, 2805, 2832], + [3252, 3253, 3255, 3251, 2830, 2831, 2833, 2829], + [3253, 3254, 3256, 3255, 2831, 2832, 2834, 2833], + [3254, 3227, 3228, 3256, 2832, 2805, 2806, 2834], + [3251, 3255, 3238, 3242, 2829, 2833, 2816, 2820], + [3255, 3256, 3234, 3238, 2833, 2834, 2812, 2816], + [3256, 3228, 3229, 3234, 2834, 2806, 2807, 2812], + [3201, 3257, 3258, 3202, 2779, 2835, 2836, 2780], + [3257, 3259, 3260, 3258, 2835, 2837, 2838, 2836], + [3259, 3261, 3262, 3260, 2837, 2839, 2840, 2838], + [3261, 3263, 3264, 3262, 2839, 2841, 2842, 2840], + [3263, 3265, 3266, 3264, 2841, 2843, 2844, 2842], + [3265, 3267, 3268, 3266, 2843, 2845, 2846, 2844], + [3202, 3258, 3269, 3208, 2780, 2836, 2847, 2786], + [3258, 3260, 3270, 3269, 2836, 2838, 2848, 2847], + [3260, 3262, 3271, 3270, 2838, 2840, 2849, 2848], + [3262, 3264, 3272, 3271, 2840, 2842, 2850, 2849], + [3264, 3266, 3273, 3272, 2842, 2844, 2851, 2850], + [3266, 3268, 3274, 3273, 2844, 2846, 2852, 2851], + [3208, 3269, 3275, 3214, 2786, 2847, 2853, 2792], + [3269, 3270, 3276, 3275, 2847, 2848, 2854, 2853], + [3270, 3271, 3277, 3276, 2848, 2849, 2855, 2854], + [3271, 3272, 3278, 3277, 2849, 2850, 2856, 2855], + [3272, 3273, 3279, 3278, 2850, 2851, 2857, 2856], + [3273, 3274, 3280, 3279, 2851, 2852, 2858, 2857], + [3214, 3275, 3281, 3220, 2792, 2853, 2859, 2798], + [3275, 3276, 3282, 3281, 2853, 2854, 2860, 2859], + [3276, 3277, 3283, 3282, 2854, 2855, 2861, 2860], + [3277, 3278, 3284, 3283, 2855, 2856, 2862, 2861], + [3278, 3279, 3285, 3284, 2856, 2857, 2863, 2862], + [3279, 3280, 3286, 3285, 2857, 2858, 2864, 2863], + [3220, 3281, 3287, 3226, 2798, 2859, 2865, 2804], + [3281, 3282, 3288, 3287, 2859, 2860, 2866, 2865], + [3282, 3283, 3289, 3288, 2860, 2861, 2867, 2866], + [3283, 3284, 3290, 3289, 2861, 2862, 2868, 2867], + [3284, 3285, 3291, 3290, 2862, 2863, 2869, 2868], + [3285, 3286, 3292, 3291, 2863, 2864, 2870, 2869], + [3226, 3287, 3293, 3232, 2804, 2865, 2871, 2810], + [3287, 3288, 3294, 3293, 2865, 2866, 2872, 2871], + [3288, 3289, 3295, 3294, 2866, 2867, 2873, 2872], + [3289, 3290, 3296, 3295, 2867, 2868, 2874, 2873], + [3290, 3291, 3297, 3296, 2868, 2869, 2875, 2874], + [3291, 3292, 3298, 3297, 2869, 2870, 2876, 2875], + [3295, 3296, 3299, 3300, 2873, 2874, 2877, 2878], + [3296, 3297, 3301, 3299, 2874, 2875, 2879, 2877], + [3297, 3298, 3302, 3301, 2875, 2876, 2880, 2879], + [3300, 3299, 3303, 3304, 2878, 2877, 2881, 2882], + [3299, 3301, 3305, 3303, 2877, 2879, 2883, 2881], + [3301, 3302, 3306, 3305, 2879, 2880, 2884, 2883], + [3304, 3303, 3307, 3308, 2882, 2881, 2885, 2886], + [3303, 3305, 3309, 3307, 2881, 2883, 2887, 2885], + [3305, 3306, 3310, 3309, 2883, 2884, 2888, 2887], + [3310, 3311, 3312, 3309, 2888, 2889, 2890, 2887], + [3311, 3313, 3314, 3312, 2889, 2891, 2892, 2890], + [3313, 3029, 3247, 3314, 2891, 2607, 2825, 2892], + [3309, 3312, 3315, 3307, 2887, 2890, 2893, 2885], + [3312, 3314, 3316, 3315, 2890, 2892, 2894, 2893], + [3314, 3247, 3245, 3316, 2892, 2825, 2823, 2894], + [3307, 3315, 3317, 3308, 2885, 2893, 2895, 2886], + [3315, 3316, 3318, 3317, 2893, 2894, 2896, 2895], + [3316, 3245, 3244, 3318, 2894, 2823, 2822, 2896], + [3244, 3240, 3319, 3318, 2822, 2818, 2897, 2896], + [3240, 3236, 3320, 3319, 2818, 2814, 2898, 2897], + [3236, 3232, 3293, 3320, 2814, 2810, 2871, 2898], + [3318, 3319, 3321, 3317, 2896, 2897, 2899, 2895], + [3319, 3320, 3322, 3321, 2897, 2898, 2900, 2899], + [3320, 3293, 3294, 3322, 2898, 2871, 2872, 2900], + [3317, 3321, 3304, 3308, 2895, 2899, 2882, 2886], + [3321, 3322, 3300, 3304, 2899, 2900, 2878, 2882], + [3322, 3294, 3295, 3300, 2900, 2872, 2873, 2878], + [3267, 3323, 3324, 3268, 2845, 2901, 2902, 2846], + [3323, 3325, 3326, 3324, 2901, 2903, 2904, 2902], + [3325, 3327, 3328, 3326, 2903, 2905, 2906, 2904], + [3327, 3329, 3330, 3328, 2905, 2907, 2908, 2906], + [3329, 3331, 3332, 3330, 2907, 2909, 2910, 2908], + [3331, 2955, 2958, 3332, 2909, 2533, 2536, 2910], + [3268, 3324, 3333, 3274, 2846, 2902, 2911, 2852], + [3324, 3326, 3334, 3333, 2902, 2904, 2912, 2911], + [3326, 3328, 3335, 3334, 2904, 2906, 2913, 2912], + [3328, 3330, 3336, 3335, 2906, 2908, 2914, 2913], + [3330, 3332, 3337, 3336, 2908, 2910, 2915, 2914], + [3332, 2958, 2972, 3337, 2910, 2536, 2550, 2915], + [3274, 3333, 3338, 3280, 2852, 2911, 2916, 2858], + [3333, 3334, 3339, 3338, 2911, 2912, 2917, 2916], + [3334, 3335, 3340, 3339, 2912, 2913, 2918, 2917], + [3335, 3336, 3341, 3340, 2913, 2914, 2919, 2918], + [3336, 3337, 3342, 3341, 2914, 2915, 2920, 2919], + [3337, 2972, 2980, 3342, 2915, 2550, 2558, 2920], + [3280, 3338, 3343, 3286, 2858, 2916, 2921, 2864], + [3338, 3339, 3344, 3343, 2916, 2917, 2922, 2921], + [3339, 3340, 3345, 3344, 2917, 2918, 2923, 2922], + [3340, 3341, 3346, 3345, 2918, 2919, 2924, 2923], + [3341, 3342, 3347, 3346, 2919, 2920, 2925, 2924], + [3342, 2980, 2988, 3347, 2920, 2558, 2566, 2925], + [3286, 3343, 3348, 3292, 2864, 2921, 2926, 2870], + [3343, 3344, 3349, 3348, 2921, 2922, 2927, 2926], + [3344, 3345, 3350, 3349, 2922, 2923, 2928, 2927], + [3345, 3346, 3351, 3350, 2923, 2924, 2929, 2928], + [3346, 3347, 3352, 3351, 2924, 2925, 2930, 2929], + [3347, 2988, 2996, 3352, 2925, 2566, 2574, 2930], + [3292, 3348, 3353, 3298, 2870, 2926, 2931, 2876], + [3348, 3349, 3354, 3353, 2926, 2927, 2932, 2931], + [3349, 3350, 3355, 3354, 2927, 2928, 2933, 2932], + [3350, 3351, 3356, 3355, 2928, 2929, 2934, 2933], + [3351, 3352, 3357, 3356, 2929, 2930, 2935, 2934], + [3352, 2996, 3004, 3357, 2930, 2574, 2582, 2935], + [3355, 3356, 3358, 3359, 2933, 2934, 2936, 2937], + [3356, 3357, 3360, 3358, 2934, 2935, 2938, 2936], + [3357, 3004, 3041, 3360, 2935, 2582, 2619, 2938], + [3359, 3358, 3361, 3362, 2937, 2936, 2939, 2940], + [3358, 3360, 3363, 3361, 2936, 2938, 2941, 2939], + [3360, 3041, 3039, 3363, 2938, 2619, 2617, 2941], + [3362, 3361, 3364, 3365, 2940, 2939, 2942, 2943], + [3361, 3363, 3366, 3364, 2939, 2941, 2944, 2942], + [3363, 3039, 3038, 3366, 2941, 2617, 2616, 2944], + [3038, 3034, 3367, 3366, 2616, 2612, 2945, 2944], + [3034, 3030, 3368, 3367, 2612, 2608, 2946, 2945], + [3030, 3029, 3313, 3368, 2608, 2607, 2891, 2946], + [3366, 3367, 3369, 3364, 2944, 2945, 2947, 2942], + [3367, 3368, 3370, 3369, 2945, 2946, 2948, 2947], + [3368, 3313, 3311, 3370, 2946, 2891, 2889, 2948], + [3364, 3369, 3371, 3365, 2942, 2947, 2949, 2943], + [3369, 3370, 3372, 3371, 2947, 2948, 2950, 2949], + [3370, 3311, 3310, 3372, 2948, 2889, 2888, 2950], + [3310, 3306, 3373, 3372, 2888, 2884, 2951, 2950], + [3306, 3302, 3374, 3373, 2884, 2880, 2952, 2951], + [3302, 3298, 3353, 3374, 2880, 2876, 2931, 2952], + [3372, 3373, 3375, 3371, 2950, 2951, 2953, 2949], + [3373, 3374, 3376, 3375, 2951, 2952, 2954, 2953], + [3374, 3353, 3354, 3376, 2952, 2931, 2932, 2954], + [3371, 3375, 3362, 3365, 2949, 2953, 2940, 2943], + [3375, 3376, 3359, 3362, 2953, 2954, 2937, 2940], + [3376, 3354, 3355, 3359, 2954, 2932, 2933, 2937] + ], dtype='int64') diff -Nru yt-3.3.3/yt/frontends/stream/tests/test_outputs.py yt-3.4.0/yt/frontends/stream/tests/test_outputs.py --- yt-3.3.3/yt/frontends/stream/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/stream/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,14 +13,23 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +import numpy as np import os import shutil import tempfile import unittest -from yt.testing import assert_raises +from yt.frontends.stream.data_structures import load_uniform_grid, \ + load_particles +from yt.testing import \ + assert_equal, \ + assert_raises from yt.convenience import load -from yt.utilities.exceptions import YTOutputNotIdentified +from yt.utilities.exceptions import \ + YTOutputNotIdentified, \ + YTInconsistentGridFieldShape, \ + YTInconsistentParticleFieldShape, \ + YTInconsistentGridFieldShapeGridDims class TestEmptyLoad(unittest.TestCase): @@ -43,3 +52,47 @@ assert_raises(YTOutputNotIdentified, load, "not_a_file") assert_raises(YTOutputNotIdentified, load, "empty_file") assert_raises(YTOutputNotIdentified, load, "empty_directory") + +def test_dimensionless_field_units(): + Z = np.random.uniform(size=(32,32,32)) + d = np.random.uniform(size=(32,32,32)) + + data = {"density": d, "metallicity": Z} + + ds = load_uniform_grid(data, (32,32,32)) + + dd = ds.all_data() + + assert_equal(Z.max(), dd["metallicity"].max()) + +def test_inconsistent_field_shape(): + + def load_field_field_mismatch(): + d = np.random.uniform(size=(32, 32, 32)) + t = np.random.uniform(size=(32, 64, 32)) + data = {"density": d, "temperature": t} + load_uniform_grid(data, (32,32,32)) + + assert_raises(YTInconsistentGridFieldShape, + load_field_field_mismatch) + + def load_field_grid_mismatch(): + d = np.random.uniform(size=(32, 32, 32)) + t = np.random.uniform(size=(32, 32, 32)) + data = {"density": d, "temperature": t} + load_uniform_grid(data, (32,64,32)) + + assert_raises(YTInconsistentGridFieldShapeGridDims, + load_field_grid_mismatch) + + def load_particle_fields_mismatch(): + x = np.random.uniform(size=100) + y = np.random.uniform(size=100) + z = np.random.uniform(size=200) + data = {"particle_position_x": x, + "particle_position_y": y, + "particle_position_z": z} + load_particles(data) + + assert_raises(YTInconsistentParticleFieldShape, + load_particle_fields_mismatch) \ No newline at end of file diff -Nru yt-3.3.3/yt/frontends/stream/tests/test_stream_amrgrids.py yt-3.4.0/yt/frontends/stream/tests/test_stream_amrgrids.py --- yt-3.3.3/yt/frontends/stream/tests/test_stream_amrgrids.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/stream/tests/test_stream_amrgrids.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,5 +1,7 @@ import numpy as np -from yt.utilities.exceptions import YTIntDomainOverflow +from yt.utilities.exceptions import \ + YTIllDefinedAMR, \ + YTIntDomainOverflow from yt import load_amr_grids, ProjectionPlot @@ -26,7 +28,7 @@ def make_proj(): p = ProjectionPlot(spf, 'x', ["density"], center='c', origin='native') return p - yield assert_raises, YTIntDomainOverflow, make_proj + assert_raises(YTIntDomainOverflow, make_proj) def test_refine_by(): grid_data = [] @@ -49,3 +51,21 @@ domain_dimensions = np.array([8, 8, 8]) load_amr_grids(grid_data, domain_dimensions, refine_by=ref_by) + +def test_validation(): + dims = np.array([4, 2, 4]) + grid_data = [ + dict(left_edge = [0.0, 0.0, 0.0], + right_edge = [1.0, 1.0, 1.0], + level = 0, + dimensions = dims), + dict(left_edge = [0.25, 0.25, 0.25], + right_edge = [0.75, 0.75, 0.75], + level = 1, + dimensions = dims), + ] + bbox = np.array([[0, 1], [0, 1], [0, 1]]) + def load_grids(): + load_amr_grids(grid_data, dims, bbox=bbox, periodicity=(0, 0, 0), + length_unit=1.0, refine_by=2) + assert_raises(YTIllDefinedAMR, load_grids) diff -Nru yt-3.3.3/yt/frontends/stream/tests/test_stream_hexahedral.py yt-3.4.0/yt/frontends/stream/tests/test_stream_hexahedral.py --- yt-3.3.3/yt/frontends/stream/tests/test_stream_hexahedral.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/stream/tests/test_stream_hexahedral.py 2017-08-10 18:02:57.000000000 +0000 @@ -36,8 +36,8 @@ ds = load_hexahedral_mesh(data, conn, coords, bbox=bbox) dd = ds.all_data() #raise RuntimeError - yield assert_almost_equal, float(dd["cell_volume"].sum(dtype="float64")), 1.0 - yield assert_equal, dd["ones"].size, Nx * Ny * Nz + assert_almost_equal(float(dd["cell_volume"].sum(dtype="float64")), 1.0) + assert_equal(dd["ones"].size, Nx * Ny * Nz) # Now we try it with a standard mesh cell_x = np.linspace(0.0, 1.0, Nx+1) cell_y = np.linspace(0.0, 1.0, Ny+1) @@ -47,11 +47,11 @@ bbox = np.array([ [0.0, 1.0], [0.0, 1.0], [0.0, 1.0] ]) ds = load_hexahedral_mesh(data, conn, coords, bbox=bbox) dd = ds.all_data() - yield assert_almost_equal, float(dd["cell_volume"].sum(dtype="float64")), 1.0 - yield assert_equal, dd["ones"].size, Nx * Ny * Nz - yield assert_almost_equal, dd["dx"].to_ndarray(), 1.0/Nx - yield assert_almost_equal, dd["dy"].to_ndarray(), 1.0/Ny - yield assert_almost_equal, dd["dz"].to_ndarray(), 1.0/Nz + assert_almost_equal(float(dd["cell_volume"].sum(dtype="float64")), 1.0) + assert_equal(dd["ones"].size, Nx * Ny * Nz) + assert_almost_equal(dd["dx"].to_ndarray(), 1.0/Nx) + assert_almost_equal(dd["dy"].to_ndarray(), 1.0/Ny) + assert_almost_equal(dd["dz"].to_ndarray(), 1.0/Nz) s = SlicePlot(ds, "x", "random_field") s._setup_plots() diff -Nru yt-3.3.3/yt/frontends/stream/tests/test_stream_particles.py yt-3.4.0/yt/frontends/stream/tests/test_stream_particles.py --- yt-3.3.3/yt/frontends/stream/tests/test_stream_particles.py 2016-12-08 23:43:49.000000000 +0000 +++ yt-3.4.0/yt/frontends/stream/tests/test_stream_particles.py 2017-08-10 18:02:57.000000000 +0000 @@ -2,7 +2,10 @@ from yt.testing import \ assert_equal -from yt.frontends.stream.api import load_uniform_grid, refine_amr, load_amr_grids +from yt.frontends.stream.api import load_uniform_grid, \ + refine_amr, \ + load_amr_grids, \ + load_particles import yt.utilities.initial_conditions as ic import yt.utilities.flagging_methods as fm @@ -15,7 +18,7 @@ x = np.random.uniform(size=num_particles) y = np.random.uniform(size=num_particles) z = np.random.uniform(size=num_particles) - m = np.ones((num_particles)) + m = np.ones(num_particles) # Field operators and cell flagging methods @@ -31,13 +34,12 @@ grid_data = [] - for grid in amr0.index.grids : + for grid in amr0.index.grids: - data = dict(left_edge = grid.LeftEdge, - right_edge = grid.RightEdge, - level = grid.Level, - dimensions = grid.ActiveDimensions, - number_of_particles = grid.NumberOfParticles) + data = dict(left_edge=grid.LeftEdge, + right_edge=grid.RightEdge, + level=grid.Level, + dimensions=grid.ActiveDimensions) for field in amr0.field_list: data[field] = grid[field] @@ -51,8 +53,7 @@ "particle_position_x": x, "particle_position_y": y, "particle_position_z": z, - "particle_mass": m, - "number_of_particles": num_particles} + "particle_mass": m} fields2 = fields1.copy() @@ -64,8 +65,14 @@ number_of_particles1 = np.sum([grid.NumberOfParticles for grid in ug1.index.grids]) number_of_particles2 = np.sum([grid.NumberOfParticles for grid in ug2.index.grids]) - yield assert_equal, number_of_particles1, num_particles - yield assert_equal, number_of_particles1, number_of_particles2 + assert_equal(number_of_particles1, num_particles) + assert_equal(number_of_particles1, number_of_particles2) + + for grid in ug2.index.grids: + tot_parts = grid["io","particle_position_x"].size + tot_all_parts = grid["all","particle_position_x"].size + assert tot_parts == grid.NumberOfParticles + assert tot_all_parts == grid.NumberOfParticles # Check to make sure the fields have been defined correctly @@ -87,21 +94,20 @@ amr1 = refine_amr(ug1, rc, fo, 3) for field in sorted(ug1.field_list): - yield assert_equal, (field in amr1.field_list), True + assert field in amr1.field_list grid_data = [] for grid in amr1.index.grids: - data = dict(left_edge = grid.LeftEdge, - right_edge = grid.RightEdge, - level = grid.Level, - dimensions = grid.ActiveDimensions, - number_of_particles = grid.NumberOfParticles) + data = dict(left_edge=grid.LeftEdge, + right_edge=grid.RightEdge, + level=grid.Level, + dimensions=grid.ActiveDimensions) for field in amr1.field_list: - - data[field] = grid[field] + if field[0] != "all": + data[field] = grid[field] grid_data.append(data) @@ -112,8 +118,20 @@ number_of_particles1 = [grid.NumberOfParticles for grid in amr1.index.grids] number_of_particles2 = [grid.NumberOfParticles for grid in amr2.index.grids] - yield assert_equal, np.sum(number_of_particles1), num_particles - yield assert_equal, number_of_particles1, number_of_particles2 + assert_equal(np.sum(number_of_particles1), num_particles) + assert_equal(number_of_particles1, number_of_particles2) + + for grid in amr1.index.grids: + tot_parts = grid["io", "particle_position_x"].size + tot_all_parts = grid["all", "particle_position_x"].size + assert tot_parts == grid.NumberOfParticles + assert tot_all_parts == grid.NumberOfParticles + + for grid in amr2.index.grids: + tot_parts = grid["io", "particle_position_x"].size + tot_all_parts = grid["all", "particle_position_x"].size + assert tot_parts == grid.NumberOfParticles + assert tot_all_parts == grid.NumberOfParticles assert amr1._get_field_info("all", "particle_position_x").particle_type assert amr1._get_field_info("all", "particle_position_y").particle_type @@ -126,3 +144,163 @@ assert amr2._get_field_info("all", "particle_position_z").particle_type assert amr2._get_field_info("all", "particle_mass").particle_type assert not amr2._get_field_info("gas", "density").particle_type + + # Now perform similar checks, but with multiple particle types + + num_dm_particles = 30000 + xd = np.random.uniform(size=num_dm_particles) + yd = np.random.uniform(size=num_dm_particles) + zd = np.random.uniform(size=num_dm_particles) + md = np.ones(num_dm_particles) + + num_star_particles = 20000 + xs = np.random.uniform(size=num_star_particles) + ys = np.random.uniform(size=num_star_particles) + zs = np.random.uniform(size=num_star_particles) + ms = 2.0*np.ones(num_star_particles) + + dens = np.random.random(domain_dims) + + fields3 = {"density": dens, + ("dm", "particle_position_x"): xd, + ("dm", "particle_position_y"): yd, + ("dm", "particle_position_z"): zd, + ("dm", "particle_mass"): md, + ("star", "particle_position_x"): xs, + ("star", "particle_position_y"): ys, + ("star", "particle_position_z"): zs, + ("star", "particle_mass"): ms} + + fields4 = fields3.copy() + + ug3 = load_uniform_grid(fields3, domain_dims, 1.0) + ug4 = load_uniform_grid(fields4, domain_dims, 1.0, nprocs=8) + + # Check to make sure the number of particles is the same + + number_of_particles3 = np.sum([grid.NumberOfParticles for grid in ug3.index.grids]) + number_of_particles4 = np.sum([grid.NumberOfParticles for grid in ug4.index.grids]) + + assert_equal(number_of_particles3, num_dm_particles+num_star_particles) + assert_equal(number_of_particles3, number_of_particles4) + + for grid in ug4.index.grids: + tot_parts = grid["dm", "particle_position_x"].size + tot_parts += grid["star", "particle_position_x"].size + tot_all_parts = grid["all", "particle_position_x"].size + assert tot_parts == grid.NumberOfParticles + assert tot_all_parts == grid.NumberOfParticles + + # Check to make sure the fields have been defined correctly + + for ptype in ("dm", "star"): + assert ug3._get_field_info(ptype, "particle_position_x").particle_type + assert ug3._get_field_info(ptype, "particle_position_y").particle_type + assert ug3._get_field_info(ptype, "particle_position_z").particle_type + assert ug3._get_field_info(ptype, "particle_mass").particle_type + assert ug4._get_field_info(ptype, "particle_position_x").particle_type + assert ug4._get_field_info(ptype, "particle_position_y").particle_type + assert ug4._get_field_info(ptype, "particle_position_z").particle_type + assert ug4._get_field_info(ptype, "particle_mass").particle_type + + # Now refine this + + amr3 = refine_amr(ug3, rc, fo, 3) + for field in sorted(ug3.field_list): + assert field in amr3.field_list + + grid_data = [] + + for grid in amr3.index.grids: + + data = dict(left_edge=grid.LeftEdge, + right_edge=grid.RightEdge, + level=grid.Level, + dimensions=grid.ActiveDimensions) + + for field in amr3.field_list: + if field[0] != "all": + data[field] = grid[field] + + grid_data.append(data) + + amr4 = load_amr_grids(grid_data, domain_dims) + + # Check everything again + + number_of_particles3 = [grid.NumberOfParticles for grid in amr3.index.grids] + number_of_particles4 = [grid.NumberOfParticles for grid in amr4.index.grids] + + assert_equal(np.sum(number_of_particles3), num_star_particles+num_dm_particles) + assert_equal(number_of_particles3, number_of_particles4) + + for ptype in ("dm", "star"): + assert amr3._get_field_info(ptype, "particle_position_x").particle_type + assert amr3._get_field_info(ptype, "particle_position_y").particle_type + assert amr3._get_field_info(ptype, "particle_position_z").particle_type + assert amr3._get_field_info(ptype, "particle_mass").particle_type + assert amr4._get_field_info(ptype, "particle_position_x").particle_type + assert amr4._get_field_info(ptype, "particle_position_y").particle_type + assert amr4._get_field_info(ptype, "particle_position_z").particle_type + assert amr4._get_field_info(ptype, "particle_mass").particle_type + + for grid in amr3.index.grids: + tot_parts = grid["dm", "particle_position_x"].size + tot_parts += grid["star", "particle_position_x"].size + tot_all_parts = grid["all", "particle_position_x"].size + assert tot_parts == grid.NumberOfParticles + assert tot_all_parts == grid.NumberOfParticles + + for grid in amr4.index.grids: + tot_parts = grid["dm", "particle_position_x"].size + tot_parts += grid["star", "particle_position_x"].size + tot_all_parts = grid["all", "particle_position_x"].size + assert tot_parts == grid.NumberOfParticles + assert tot_all_parts == grid.NumberOfParticles + +def test_load_particles_types(): + + num_particles = 10000 + + data1 = {"particle_position_x": np.random.random(size=num_particles), + "particle_position_y": np.random.random(size=num_particles), + "particle_position_z": np.random.random(size=num_particles), + "particle_mass": np.ones(num_particles)} + + ds1 = load_particles(data1) + ds1.index + + assert set(ds1.particle_types) == {"all", "io"} + + dd = ds1.all_data() + + for ax in "xyz": + assert dd["io", "particle_position_%s" % ax].size == num_particles + assert dd["all", "particle_position_%s" % ax].size == num_particles + + num_dm_particles = 10000 + num_star_particles = 50000 + num_tot_particles = num_dm_particles + num_star_particles + + data2 = {("dm", "particle_position_x"): np.random.random(size=num_dm_particles), + ("dm", "particle_position_y"): np.random.random(size=num_dm_particles), + ("dm", "particle_position_z"): np.random.random(size=num_dm_particles), + ("dm", "particle_mass"): np.ones(num_dm_particles), + ("star", "particle_position_x"): np.random.random(size=num_star_particles), + ("star", "particle_position_y"): np.random.random(size=num_star_particles), + ("star", "particle_position_z"): np.random.random(size=num_star_particles), + ("star", "particle_mass"): 2.0*np.ones(num_star_particles)} + + ds2 = load_particles(data2) + ds2.index + + assert set(ds2.particle_types) == {"all", "star", "dm"} + + dd = ds2.all_data() + + for ax in "xyz": + npart = 0 + for ptype in ds2.particle_types_raw: + npart += dd[ptype, "particle_position_%s" % ax].size + assert npart == num_tot_particles + assert dd["all", "particle_position_%s" % ax].size == num_tot_particles diff -Nru yt-3.3.3/yt/frontends/stream/tests/test_stream_unstructured.py yt-3.4.0/yt/frontends/stream/tests/test_stream_unstructured.py --- yt-3.3.3/yt/frontends/stream/tests/test_stream_unstructured.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/frontends/stream/tests/test_stream_unstructured.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,50 @@ +import numpy as np + +from yt import load_unstructured_mesh, SlicePlot + +def test_multi_mesh(): + coordsMulti = np.array([[0.0, 0.0], + [1.0, 0.0], + [1.0, 1.0], + [0.0, 1.0]], dtype=np.float64) + + connect1 = np.array([[0, 1, 3], ], dtype=np.int64) + connect2 = np.array([[1, 2, 3], ], dtype=np.int64) + + data1 = {} + data2 = {} + data1['connect1', 'test'] = np.array([[0.0, 1.0, 3.0], ], dtype=np.float64) + data2['connect2', 'test'] = np.array([[1.0, 2.0, 3.0], ], dtype=np.float64) + + connectList = [connect1, connect2] + dataList = [data1, data2] + + ds = load_unstructured_mesh(connectList, coordsMulti, dataList) + + sl = SlicePlot(ds, 'z', ('connect1', 'test')) + sl = SlicePlot(ds, 'z', ('connect2', 'test')) + sl = SlicePlot(ds, 'z', ('all', 'test')) + sl.annotate_mesh_lines() + +def test_multi_field(): + coords = np.array([[0.0, 0.0], + [1.0, 0.0], + [1.0, 1.0], + [0.0, 1.0]], dtype=np.float64) + + connect = np.array([[0, 1, 3], + [1, 2, 3]], dtype=np.int64) + + data = {} + data['connect1', 'test'] = np.array([[0.0, 1.0, 3.0], + [1.0, 2.0, 3.0]], dtype=np.float64) + data['connect1', 'testAgain'] = np.array([[0.0, 1.0, 3.0], + [1.0, 2.0, 3.0]], dtype=np.float64) + + ds = load_unstructured_mesh(connect, coords, data) + + sl = SlicePlot(ds, 'z', 'test') + sl.annotate_mesh_lines() + + sl = SlicePlot(ds, 'z', 'testAgain') + sl.annotate_mesh_lines() diff -Nru yt-3.3.3/yt/frontends/stream/tests/test_update_data.py yt-3.4.0/yt/frontends/stream/tests/test_update_data.py --- yt-3.3.3/yt/frontends/stream/tests/test_update_data.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/stream/tests/test_update_data.py 2017-08-10 18:02:57.000000000 +0000 @@ -2,15 +2,15 @@ from yt.data_objects.profiles import create_profile from numpy.random import uniform -def test_update_data() : +def test_update_data(): ds = fake_random_ds(64, nprocs=8) ds.index dims = (32,32,32) - grid_data = [{"temperature":uniform(size=dims)} + grid_data = [{"temperature": uniform(size=dims)} for i in range(ds.index.num_grids)] - ds.index.update_data(grid_data, {('gas', 'temperature'):'K'}) + ds.index.update_data(grid_data) prj = ds.proj("temperature", 2) prj["temperature"] dd = ds.all_data() profile = create_profile(dd, "density", "temperature", 10) - profile["temperature"] + profile["temperature"] diff -Nru yt-3.3.3/yt/frontends/tipsy/data_structures.py yt-3.4.0/yt/frontends/tipsy/data_structures.py --- yt-3.3.3/yt/frontends/tipsy/data_structures.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/tipsy/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -22,7 +22,7 @@ import os from yt.frontends.sph.data_structures import \ - ParticleDataset + SPHDataset from yt.funcs import deprecate from yt.geometry.particle_geometry_handler import \ ParticleIndex @@ -54,7 +54,7 @@ def _calculate_offsets(self, field_list): self.field_offsets = self.io._calculate_particle_offsets(self) -class TipsyDataset(ParticleDataset): +class TipsyDataset(SPHDataset): _index_class = ParticleIndex _file_class = TipsyFile _field_info_class = TipsyFieldInfo @@ -74,6 +74,7 @@ parameter_file=None, cosmology_parameters=None, n_ref=64, over_refine_factor=1, + kernel_name=None, bounding_box=None, units_override=None, unit_system="cgs"): @@ -82,8 +83,6 @@ # and domain_right_edge self.bounding_box = bounding_box self.filter_bbox = (bounding_box is not None) - self.n_ref = n_ref - self.over_refine_factor = over_refine_factor if field_dtypes is None: field_dtypes = {} success, self.endian = self._validate_header(filename) @@ -113,8 +112,10 @@ if units_override is not None: raise RuntimeError("units_override is not supported for TipsyDataset. "+ "Use unit_base instead.") - super(TipsyDataset, self).__init__(filename, dataset_type, - unit_system=unit_system) + super(TipsyDataset, self).__init__( + filename, dataset_type=dataset_type, unit_system=unit_system, + n_ref=n_ref, over_refine_factor=over_refine_factor, + kernel_name=kernel_name) def __repr__(self): return os.path.basename(self.parameter_filename) diff -Nru yt-3.3.3/yt/frontends/tipsy/fields.py yt-3.4.0/yt/frontends/tipsy/fields.py --- yt-3.3.3/yt/frontends/tipsy/fields.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/tipsy/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -73,6 +73,6 @@ self.add_field( (ptype, "smoothing_length"), + sampling_type="particle", function=_func(), - particle_type=True, units="code_length") diff -Nru yt-3.3.3/yt/frontends/tipsy/tests/test_outputs.py yt-3.4.0/yt/frontends/tipsy/tests/test_outputs.py --- yt-3.3.3/yt/frontends/tipsy/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/tipsy/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -45,13 +45,13 @@ unit_base = {'length': (60.0, "Mpccm/h")}, n_ref = 64) ds = data_dir_load(pkdgrav, TipsyDataset, (), kwargs) - yield assert_equal, str(ds), "halo1e11_run1.00400" + assert_equal(str(ds), "halo1e11_run1.00400") dso = [ None, ("sphere", ("c", (0.3, 'unitary')))] dd = ds.all_data() - yield assert_equal, dd["Coordinates"].shape, (26847360, 3) + assert_equal(dd["Coordinates"].shape, (26847360, 3)) tot = sum(dd[ptype,"Coordinates"].shape[0] for ptype in ds.particle_types if ptype != "all") - yield assert_equal, tot, 26847360 + assert_equal(tot, 26847360) for dobj_name in dso: for field in _fields: for axis in [0, 1, 2]: @@ -63,7 +63,7 @@ dobj = create_obj(ds, dobj_name) s1 = dobj["ones"].sum() s2 = sum(mask.sum() for block, mask in dobj.blocks) - yield assert_equal, s1, s2 + assert_equal(s1, s2) gasoline_dmonly = "agora_1e11.00400/agora_1e11.00400" @requires_ds(gasoline_dmonly, big_data = True, file_check = True) @@ -76,13 +76,13 @@ unit_base = {'length': (60.0, "Mpccm/h")}, n_ref = 64) ds = data_dir_load(gasoline_dmonly, TipsyDataset, (), kwargs) - yield assert_equal, str(ds), "agora_1e11.00400" + assert_equal(str(ds), "agora_1e11.00400") dso = [ None, ("sphere", ("c", (0.3, 'unitary')))] dd = ds.all_data() - yield assert_equal, dd["Coordinates"].shape, (10550576, 3) + assert_equal(dd["Coordinates"].shape, (10550576, 3)) tot = sum(dd[ptype,"Coordinates"].shape[0] for ptype in ds.particle_types if ptype != "all") - yield assert_equal, tot, 10550576 + assert_equal(tot, 10550576) for dobj_name in dso: for field in _fields: for axis in [0, 1, 2]: @@ -94,7 +94,7 @@ dobj = create_obj(ds, dobj_name) s1 = dobj["ones"].sum() s2 = sum(mask.sum() for block, mask in dobj.blocks) - yield assert_equal, s1, s2 + assert_equal(s1, s2) tg_fields = OrderedDict( [ diff -Nru yt-3.3.3/yt/frontends/ytdata/api.py yt-3.4.0/yt/frontends/ytdata/api.py --- yt-3.3.3/yt/frontends/ytdata/api.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/ytdata/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -23,7 +23,9 @@ YTNonspatialDataset, \ YTNonspatialHierarchy, \ YTNonspatialGrid, \ - YTProfileDataset + YTProfileDataset, \ + YTClumpContainer, \ + YTClumpTreeDataset from .io import \ IOHandlerYTDataContainerHDF5, \ diff -Nru yt-3.3.3/yt/frontends/ytdata/data_structures.py yt-3.4.0/yt/frontends/ytdata/data_structures.py --- yt-3.3.3/yt/frontends/ytdata/data_structures.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/ytdata/data_structures.py 2017-08-10 18:02:57.000000000 +0000 @@ -41,11 +41,16 @@ from yt.extern.six import \ string_types from yt.funcs import \ - is_root + is_root, \ + parse_h5_attr from yt.geometry.grid_geometry_handler import \ GridIndex from yt.geometry.particle_geometry_handler import \ ParticleIndex +from yt.units import \ + dimensions +from yt.units.unit_registry import \ + UnitRegistry from yt.units.yt_array import \ YTQuantity from yt.utilities.logger import \ @@ -56,6 +61,8 @@ _h5py as h5py from yt.utilities.parallel_tools.parallel_analysis_interface import \ parallel_root_only +from yt.utilities.tree_container import \ + TreeContainer from yt.fields.field_exceptions import \ NeedsGridType from yt.data_objects.data_containers import \ @@ -65,15 +72,12 @@ "covering_grid", "smoothed_covering_grid"] -def parse_h5_attr(f, attr): - val = f.attrs.get(attr, None) - if isinstance(val, bytes): - return val.decode('utf8') - else: - return val +class SavedDataset(Dataset): + """ + Base dataset class for products of calling save_as_dataset. + """ + _con_attrs = () -class YTDataset(Dataset): - """Base dataset class for all ytdata datasets.""" def _parse_parameter_file(self): self.refine_by = 2 with h5py.File(self.parameter_filename, "r") as f: @@ -82,18 +86,109 @@ if key == "con_args": v = v.astype("str") self.parameters[key] = v - self.num_particles = \ - dict([(group, parse_h5_attr(f[group], "num_elements")) - for group in f if group != self.default_fluid_type]) - for attr in ["cosmological_simulation", "current_time", "current_redshift", - "hubble_constant", "omega_matter", "omega_lambda", - "dimensionality", "domain_dimensions", "periodicity", - "domain_left_edge", "domain_right_edge", - "container_type", "data_type"]: + self._with_parameter_file_open(f) + + # if saved, restore unit registry from the json string + if "unit_registry_json" in self.parameters: + self.unit_registry = UnitRegistry.from_json( + self.parameters["unit_registry_json"]) + # reset self.arr and self.quan to use new unit_registry + self._arr = None + self._quan = None + for dim in ["length", "mass", "pressure", + "temperature", "time", "velocity"]: + cu = "code_" + dim + if cu not in self.unit_registry: + self.unit_registry.add( + cu, 1.0, getattr(dimensions, dim)) + if "code_magnetic" not in self.unit_registry: + self.unit_registry.add("code_magnetic", 1.0, + dimensions.magnetic_field) + + # if saved, set unit system + if "unit_system_name" in self.parameters: + unit_system = self.parameters["unit_system_name"] + del self.parameters["unit_system_name"] + else: + unit_system = "cgs" + # reset unit system since we may have a new unit registry + self._assign_unit_system(unit_system) + + # assign units to parameters that have associated unit string + del_pars = [] + for par in self.parameters: + ustr = "%s_units" % par + if ustr in self.parameters: + if isinstance(self.parameters[par], np.ndarray): + to_u = self.arr + else: + to_u = self.quan + self.parameters[par] = to_u( + self.parameters[par], self.parameters[ustr]) + del_pars.append(ustr) + for par in del_pars: + del self.parameters[par] + + for attr in self._con_attrs: setattr(self, attr, self.parameters.get(attr)) self.unique_identifier = \ int(os.stat(self.parameter_filename)[stat.ST_CTIME]) + def _with_parameter_file_open(self, f): + # This allows subclasses to access the parameter file + # while it's still open to get additional information. + pass + + def set_units(self): + if "unit_registry_json" in self.parameters: + self._set_code_unit_attributes() + del self.parameters["unit_registry_json"] + else: + super(SavedDataset, self).set_units() + + def _set_code_unit_attributes(self): + attrs = ('length_unit', 'mass_unit', 'time_unit', + 'velocity_unit', 'magnetic_unit') + cgs_units = ('cm', 'g', 's', 'cm/s', 'gauss') + base_units = np.ones(len(attrs)) + for unit, attr, cgs_unit in zip(base_units, attrs, cgs_units): + if attr in self.parameters and \ + isinstance(self.parameters[attr], YTQuantity): + uq = self.parameters[attr] + elif attr in self.parameters and \ + "%s_units" % attr in self.parameters: + uq = self.quan(self.parameters[attr], + self.parameters["%s_units" % attr]) + del self.parameters[attr] + del self.parameters["%s_units" % attr] + elif isinstance(unit, string_types): + uq = self.quan(1.0, unit) + elif isinstance(unit, numeric_type): + uq = self.quan(unit, cgs_unit) + elif isinstance(unit, YTQuantity): + uq = unit + elif isinstance(unit, tuple): + uq = self.quan(unit[0], unit[1]) + else: + raise RuntimeError("%s (%s) is invalid." % (attr, unit)) + setattr(self, attr, uq) + +class YTDataset(SavedDataset): + """Base dataset class for all ytdata datasets.""" + + _con_attrs = ("cosmological_simulation", "current_time", + "current_redshift", "hubble_constant", + "omega_matter", "omega_lambda", + "dimensionality", "domain_dimensions", + "periodicity", + "domain_left_edge", "domain_right_edge", + "container_type", "data_type") + + def _with_parameter_file_open(self, f): + self.num_particles = \ + dict([(group, parse_h5_attr(f[group], "num_elements")) + for group in f if group != self.default_fluid_type]) + def create_field_info(self): self.field_dependencies = {} self.derived_field_list = [] @@ -123,24 +218,6 @@ def _setup_override_fields(self): pass - def _set_code_unit_attributes(self): - attrs = ('length_unit', 'mass_unit', 'time_unit', - 'velocity_unit', 'magnetic_unit') - cgs_units = ('cm', 'g', 's', 'cm/s', 'gauss') - base_units = np.ones(len(attrs)) - for unit, attr, cgs_unit in zip(base_units, attrs, cgs_units): - if isinstance(unit, string_types): - uq = self.quan(1.0, unit) - elif isinstance(unit, numeric_type): - uq = self.quan(unit, cgs_unit) - elif isinstance(unit, YTQuantity): - uq = unit - elif isinstance(unit, tuple): - uq = self.quan(unit[0], unit[1]) - else: - raise RuntimeError("%s (%s) is invalid." % (attr, unit)) - setattr(self, attr, uq) - class YTDataHDF5File(ParticleFile): def __init__(self, ds, io, filename, file_id): with h5py.File(filename, "r") as f: @@ -185,6 +262,7 @@ # cover the field_list. self.field_info.alias(("gas", "cell_volume"), ("grid", "cell_volume")) + _data_obj = None @property def data(self): """ @@ -192,27 +270,21 @@ create this dataset. """ - # Some data containers can't be recontructed in the same way - # since this is now particle-like data. - data_type = self.parameters["data_type"] - container_type = self.parameters["container_type"] - ex_container_type = ["cutting", "proj", "ray", "slice"] - if data_type == "yt_light_ray" or container_type in ex_container_type: - mylog.info("Returning an all_data data container.") - return self.all_data() - - my_obj = getattr(self, self.parameters["container_type"]) - my_args = [] - for con_arg in self.parameters["con_args"]: - my_arg = self.parameters[con_arg] - my_units = self.parameters.get("%s_units" % con_arg) - if my_units is not None: - if isinstance(my_arg, np.ndarray): - my_arg = self.arr(my_arg, my_units) - else: - my_arg = self.quan(my_arg, my_units) - my_args.append(my_arg) - return my_obj(*my_args) + if self._data_obj is None: + # Some data containers can't be recontructed in the same way + # since this is now particle-like data. + data_type = self.parameters.get("data_type") + container_type = self.parameters.get("container_type") + ex_container_type = ["cutting", "proj", "ray", "slice", "cut_region"] + if data_type == "yt_light_ray" or container_type in ex_container_type: + mylog.info("Returning an all_data data container.") + return self.all_data() + + my_obj = getattr(self, self.parameters["container_type"]) + my_args = [self.parameters[con_arg] + for con_arg in self.parameters["con_args"]] + self._data_obj = my_obj(*my_args) + return self._data_obj @classmethod def _is_valid(self, *args, **kwargs): @@ -255,15 +327,8 @@ for field in lrs_fields: field_name = field[len(key)+1:] for i in range(self.parameters[field].shape[0]): - self.light_ray_solution[i][field_name] = self.parameters[field][i] - if "%s_units" % field in self.parameters: - if len(self.parameters[field].shape) > 1: - to_val = self.arr - else: - to_val = self.quan - self.light_ray_solution[i][field_name] = \ - to_val(self.light_ray_solution[i][field_name], - self.parameters["%s_units" % field]) + self.light_ray_solution[i][field_name] = \ + self.parameters[field][i] @classmethod def _is_valid(self, *args, **kwargs): @@ -525,20 +590,37 @@ particles.append((ftype, fname)) elif (ftype, fname) not in fluids: fluids.append((ftype, fname)) + # The _read method will figure out which fields it needs to get from # disk, and return a dict of those fields along with the fields that # need to be generated. read_fluids, gen_fluids = self.index._read_fluid_fields( fluids, self, self._current_chunk) for f, v in read_fluids.items(): - self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units) - self.field_data[f].convert_to_units(finfos[f].output_units) + convert = True + if v.dtype != np.float64: + if finfos[f].units == "": + self.field_data[f] = v + convert = False + else: + v = v.astype(np.float64) + if convert: + self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units) + self.field_data[f].convert_to_units(finfos[f].output_units) - read_particles, gen_particles = self.index._read_particle_fields( + read_particles, gen_particles = self.index._read_fluid_fields( particles, self, self._current_chunk) for f, v in read_particles.items(): - self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units) - self.field_data[f].convert_to_units(finfos[f].output_units) + convert = True + if v.dtype != np.float64: + if finfos[f].units == "": + self.field_data[f] = v + convert = False + else: + v = v.astype(np.float64) + if convert: + self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units) + self.field_data[f].convert_to_units(finfos[f].output_units) fields_to_generate += gen_fluids + gen_particles self._generate_fields(fields_to_generate) @@ -607,7 +689,7 @@ def _setup_classes(self): # We don't allow geometric selection for non-spatial datasets - pass + self.objects = [] @parallel_root_only def print_key_parameters(self): @@ -668,21 +750,20 @@ self.base_domain_right_edge = self.domain_right_edge self.base_domain_dimensions = self.domain_dimensions - self.domain_dimensions = np.ones(3, dtype="int") - self.domain_dimensions[:self.dimensionality] = \ + domain_dimensions = np.ones(3, dtype="int") + domain_dimensions[:self.dimensionality] = \ self.profile_dimensions - self.domain_left_edge = np.zeros(3) - self.domain_right_edge = np.ones(3) + self.domain_dimensions = domain_dimensions + domain_left_edge = np.zeros(3) + domain_right_edge = np.ones(3) for i, ax in enumerate("xyz"[:self.dimensionality]): range_name = "%s_range" % ax my_range = self.parameters[range_name] if getattr(self, "%s_log" % ax, False): my_range = np.log10(my_range) - self.domain_left_edge[i] = my_range[0] - self.domain_right_edge[i] = my_range[1] - setattr(self, range_name, - self.arr(self.parameters[range_name], - self.parameters[range_name+"_units"])) + domain_left_edge[i] = my_range[0] + domain_right_edge[i] = my_range[1] + setattr(self, range_name, self.parameters[range_name]) bin_field = "%s_field" % ax if isinstance(self.parameters[bin_field], string_types) and \ @@ -692,6 +773,8 @@ self.parameters[bin_field] = \ tuple(self.parameters[bin_field].astype(str)) setattr(self, bin_field, self.parameters[bin_field]) + self.domain_left_edge = domain_left_edge + self.domain_right_edge = domain_right_edge def _setup_gas_alias(self): "Alias the grid type to gas with a field alias." @@ -730,3 +813,78 @@ if data_type == "yt_profile": return True return False + +class YTClumpContainer(TreeContainer): + def __init__(self, clump_id, global_id, parent_id, + contour_key, contour_id, ds=None): + self.clump_id = clump_id + self.global_id = global_id + self.parent_id = parent_id + self.contour_key = contour_key + self.contour_id = contour_id + self.parent = None + self.ds = ds + TreeContainer.__init__(self) + + def add_child(self, child): + if self.children is None: + self.children = [] + self.children.append(child) + child.parent = self + + def __repr__(self): + return "Clump[%d]" % self.clump_id + + def __getitem__(self, field): + g = self.ds.data + f = g._determine_fields(field)[0] + if f[0] == "clump": + return g[f][self.global_id] + if self.contour_id == -1: + return g[f] + cfield = (f[0], "contours_%s" % self.contour_key.decode('utf-8')) + if f[0] == "grid": + return g[f][g[cfield] == self.contour_id] + return self.parent[f][g[cfield] == self.contour_id] + +class YTClumpTreeDataset(YTNonspatialDataset): + """Dataset for saved clump-finder data.""" + def __init__(self, filename, unit_system="cgs"): + super(YTClumpTreeDataset, self).__init__(filename, + unit_system=unit_system) + self._load_tree() + + def _load_tree(self): + my_tree = {} + for i, clump_id in enumerate(self.data[("clump", "clump_id")]): + my_tree[clump_id] = YTClumpContainer( + clump_id, i, self.data["clump", "parent_id"][i], + self.data["clump", "contour_key"][i], + self.data["clump", "contour_id"][i], self) + for clump in my_tree.values(): + if clump.parent_id == -1: + self.tree = clump + else: + parent = my_tree[clump.parent_id] + parent.add_child(clump) + + _leaves = None + @property + def leaves(self): + if self._leaves is None: + self._leaves = [] + for clump in self.tree: + if clump.children is None: + self._leaves.append(clump) + return self._leaves + + @classmethod + def _is_valid(self, *args, **kwargs): + if not args[0].endswith(".h5"): return False + with h5py.File(args[0], "r") as f: + data_type = parse_h5_attr(f, "data_type") + if data_type is None: + return False + if data_type == "yt_clump_tree": + return True + return False diff -Nru yt-3.3.3/yt/frontends/ytdata/fields.py yt-3.4.0/yt/frontends/ytdata/fields.py --- yt-3.3.3/yt/frontends/ytdata/fields.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/ytdata/fields.py 2017-08-10 18:02:57.000000000 +0000 @@ -48,8 +48,8 @@ return data["grid", "dx"] * \ data["grid", "dy"] * \ data["grid", "dz"] - self.add_field(("grid", "cell_volume"), function=_cell_volume, - units="cm**3", particle_type=True) + self.add_field(("grid", "cell_volume"), sampling_type="particle", function=_cell_volume, + units="cm**3") class YTGridFieldInfo(FieldInfoContainer): known_other_fields = ( diff -Nru yt-3.3.3/yt/frontends/ytdata/io.py yt-3.4.0/yt/frontends/ytdata/io.py --- yt-3.3.3/yt/frontends/ytdata/io.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/ytdata/io.py 2017-08-10 18:02:57.000000000 +0000 @@ -19,7 +19,10 @@ from yt.extern.six import \ u from yt.funcs import \ - mylog + mylog, \ + parse_h5_attr +from yt.geometry.selection_routines import \ + GridSelector from yt.utilities.exceptions import \ YTDomainOverflow from yt.utilities.io_handler import \ @@ -36,20 +39,19 @@ def _read_fluid_selection(self, g, selector, fields): rv = {} - if selector.__class__.__name__ == "GridSelector": + if isinstance(selector, GridSelector): if g.id in self._cached_fields: gf = self._cached_fields[g.id] rv.update(gf) if len(rv) == len(fields): return rv f = h5py.File(u(g.filename), "r") - gds = f["data"] for field in fields: if field in rv: self._hits += 1 continue self._misses += 1 ftype, fname = field - rv[(ftype, fname)] = gds[fname].value + rv[(ftype, fname)] = f[ftype][fname].value if self._cache_on: for gid in rv: self._cached_fields.setdefault(gid, {}) @@ -69,7 +71,7 @@ rv = {} # Now we have to do something unpleasant chunks = list(chunks) - if selector.__class__.__name__ == "GridSelector": + if isinstance(selector, GridSelector): if not (len(chunks) == len(chunks[0].objs) == 1): raise RuntimeError g = chunks[0].objs[0] @@ -131,6 +133,7 @@ return rv def _read_particle_coords(self, chunks, ptf): + pn = "particle_position_%s" chunks = list(chunks) for chunk in chunks: f = None @@ -141,9 +144,10 @@ if g.NumberOfParticles == 0: continue for ptype, field_list in sorted(ptf.items()): - pn = "particle_position_%s" - x, y, z = (np.asarray(f[ptype][pn % ax].value, dtype="=f8") - for ax in 'xyz') + units = parse_h5_attr(f[ptype][pn % "x"], "units") + x, y, z = \ + (self.ds.arr(f[ptype][pn % ax].value.astype("float64"), units) + for ax in "xyz") for field in field_list: if np.asarray(f[ptype][field]).ndim > 1: self._array_fields[field] = f[ptype][field].shape @@ -151,6 +155,7 @@ if f: f.close() def _read_particle_fields(self, chunks, ptf, selector): + pn = "particle_position_%s" chunks = list(chunks) for chunk in chunks: # These should be organized by grid filename f = None @@ -161,9 +166,10 @@ if g.NumberOfParticles == 0: continue for ptype, field_list in sorted(ptf.items()): - pn = "particle_position_%s" - x, y, z = (np.asarray(f[ptype][pn % ax].value, dtype="=f8") - for ax in 'xyz') + units = parse_h5_attr(f[ptype][pn % "x"], "units") + x, y, z = \ + (self.ds.arr(f[ptype][pn % ax].value.astype("float64"), units) + for ax in "xyz") mask = selector.select_points(x, y, z, 0.0) if mask is None: continue for field in field_list: @@ -189,9 +195,10 @@ for ptype, field_list in sorted(ptf.items()): pcount = data_file.total_particles[ptype] if pcount == 0: continue - x = _get_position_array(ptype, f, "x") - y = _get_position_array(ptype, f, "y") - z = _get_position_array(ptype, f, "z") + units = _get_position_array_units(ptype, f, "x") + x, y, z = \ + (self.ds.arr(_get_position_array(ptype, f, ax), units) + for ax in "xyz") yield ptype, (x, y, z) def _read_particle_fields(self, chunks, ptf, selector): @@ -204,9 +211,10 @@ for data_file in sorted(data_files): with h5py.File(data_file.filename, "r") as f: for ptype, field_list in sorted(ptf.items()): - x = _get_position_array(ptype, f, "x") - y = _get_position_array(ptype, f, "y") - z = _get_position_array(ptype, f, "z") + units = _get_position_array_units(ptype, f, "x") + x, y, z = \ + (self.ds.arr(_get_position_array(ptype, f, ax), units) + for ax in "xyz") mask = selector.select_points(x, y, z, 0.0) del x, y, z if mask is None: continue @@ -225,31 +233,33 @@ for ptype in all_count: if ptype not in f or all_count[ptype] == 0: continue pos = np.empty((all_count[ptype], 3), dtype="float64") - pos = data_file.ds.arr(pos, "code_length") + units = _get_position_array_units(ptype, f, "x") if ptype == "grid": dx = f["grid"]["dx"].value.min() + dx = self.ds.quan( + dx, parse_h5_attr(f["grid"]["dx"], "units")).to("code_length") else: dx = 2. * np.finfo(f[ptype]["particle_position_x"].dtype).eps - dx = self.ds.quan(dx, "code_length") + dx = self.ds.quan(dx, units).to("code_length") pos[:,0] = _get_position_array(ptype, f, "x") pos[:,1] = _get_position_array(ptype, f, "y") pos[:,2] = _get_position_array(ptype, f, "z") + pos = self.ds.arr(pos, units).to("code_length") + dle = self.ds.domain_left_edge.to("code_length") + dre = self.ds.domain_right_edge.to("code_length") + # These are 32 bit numbers, so we give a little lee-way. # Otherwise, for big sets of particles, we often will bump into the # domain edges. This helps alleviate that. - np.clip(pos, self.ds.domain_left_edge + dx, - self.ds.domain_right_edge - dx, pos) - if np.any(pos.min(axis=0) < self.ds.domain_left_edge) or \ - np.any(pos.max(axis=0) > self.ds.domain_right_edge): + np.clip(pos, dle + dx, dre - dx, pos) + if np.any(pos.min(axis=0) < dle) or \ + np.any(pos.max(axis=0) > dre): raise YTDomainOverflow(pos.min(axis=0), pos.max(axis=0), - self.ds.domain_left_edge, - self.ds.domain_right_edge) + dle, dre) regions.add_data_file(pos, data_file.file_id) morton[ind:ind+pos.shape[0]] = compute_morton( - pos[:,0], pos[:,1], pos[:,2], - data_file.ds.domain_left_edge, - data_file.ds.domain_right_edge) + pos[:,0], pos[:,1], pos[:,2], dle, dre) ind += pos.shape[0] return morton @@ -263,7 +273,7 @@ for ptype in f: fields.extend([(ptype, str(field)) for field in f[ptype]]) units.update(dict([((ptype, str(field)), - f[ptype][field].attrs["units"]) + parse_h5_attr(f[ptype][field], "units")) for field in f[ptype]])) return fields, units @@ -285,7 +295,7 @@ x = _get_position_array(ptype, f, "px") y = _get_position_array(ptype, f, "py") z = np.zeros(x.size, dtype="float64") + \ - self.ds.domain_left_edge[2].in_cgs().d + self.ds.domain_left_edge[2].to("code_length").d yield ptype, (x, y, z) def _read_particle_fields(self, chunks, ptf, selector): @@ -302,7 +312,7 @@ x = _get_position_array(ptype, f, "px") y = _get_position_array(ptype, f, "py") z = np.zeros(all_count[ptype], dtype="float64") + \ - self.ds.domain_left_edge[2].in_cgs().d + self.ds.domain_left_edge[2].to("code_length").d mask = selector.select_points(x, y, z, 0.0) del x, y, z if mask is None: continue @@ -321,32 +331,32 @@ for ptype in all_count: if ptype not in f or all_count[ptype] == 0: continue pos = np.empty((all_count[ptype], 3), dtype="float64") - pos = data_file.ds.arr(pos, "code_length") + pos = self.ds.arr(pos, "code_length") if ptype == "grid": dx = f["grid"]["pdx"].value.min() + dx = self.ds.quan( + dx, parse_h5_attr(f["grid"]["pdx"], "units")).to("code_length") else: raise NotImplementedError - dx = self.ds.quan(dx, "code_length") pos[:,0] = _get_position_array(ptype, f, "px") pos[:,1] = _get_position_array(ptype, f, "py") pos[:,2] = np.zeros(all_count[ptype], dtype="float64") + \ - self.ds.domain_left_edge[2].in_cgs().d + self.ds.domain_left_edge[2].to("code_length").d + dle = self.ds.domain_left_edge.to("code_length") + dre = self.ds.domain_right_edge.to("code_length") + # These are 32 bit numbers, so we give a little lee-way. # Otherwise, for big sets of particles, we often will bump into the # domain edges. This helps alleviate that. - np.clip(pos, self.ds.domain_left_edge + dx, - self.ds.domain_right_edge - dx, pos) - if np.any(pos.min(axis=0) < self.ds.domain_left_edge) or \ - np.any(pos.max(axis=0) > self.ds.domain_right_edge): + np.clip(pos, dle + dx, dre - dx, pos) + if np.any(pos.min(axis=0) < dle) or \ + np.any(pos.max(axis=0) > dre): raise YTDomainOverflow(pos.min(axis=0), pos.max(axis=0), - self.ds.domain_left_edge, - self.ds.domain_right_edge) + dre, dle) regions.add_data_file(pos, data_file.file_id) morton[ind:ind+pos.shape[0]] = compute_morton( - pos[:,0], pos[:,1], pos[:,2], - data_file.ds.domain_left_edge, - data_file.ds.domain_right_edge) + pos[:,0], pos[:,1], pos[:,2], dle, dre) ind += pos.shape[0] return morton @@ -356,3 +366,10 @@ else: pos_name = "particle_position_" return f[ptype][pos_name + ax].value.astype("float64") + +def _get_position_array_units(ptype, f, ax): + if ptype == "grid": + pos_name = "" + else: + pos_name = "particle_position_" + return parse_h5_attr(f[ptype][pos_name + ax], "units") diff -Nru yt-3.3.3/yt/frontends/ytdata/tests/test_outputs.py yt-3.4.0/yt/frontends/ytdata/tests/test_outputs.py --- yt-3.3.3/yt/frontends/ytdata/tests/test_outputs.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/frontends/ytdata/tests/test_outputs.py 2017-08-10 18:02:57.000000000 +0000 @@ -26,7 +26,9 @@ save_as_dataset from yt.testing import \ assert_allclose_units, \ - assert_equal + assert_equal, \ + assert_fname, \ + fake_random_ds from yt.utilities.answer_testing.framework import \ requires_ds, \ data_dir_load, \ @@ -34,6 +36,9 @@ from yt.units.yt_array import \ YTArray, \ YTQuantity +from yt.visualization.plot_window import \ + SlicePlot, \ + ProjectionPlot from yt.visualization.profile_plotter import \ ProfilePlot, \ PhasePlot @@ -42,6 +47,14 @@ import os import shutil +def compare_unit_attributes(ds1, ds2): + attrs = ('length_unit', 'mass_unit', 'time_unit', + 'velocity_unit', 'magnetic_unit') + for attr in attrs: + u1 = getattr(ds1, attr, None) + u2 = getattr(ds2, attr, None) + assert u1 == u2 + class YTDataFieldTest(AnswerTestingTest): _type_name = "YTDataTest" _attrs = ("field_name", ) @@ -88,9 +101,16 @@ fn = sphere.save_as_dataset(fields=["density", "particle_mass"]) full_fn = os.path.join(tmpdir, fn) sphere_ds = load(full_fn) + compare_unit_attributes(ds, sphere_ds) assert isinstance(sphere_ds, YTDataContainerDataset) yield YTDataFieldTest(full_fn, ("grid", "density")) yield YTDataFieldTest(full_fn, ("all", "particle_mass")) + cr = ds.cut_region(sphere, ['obj["temperature"] > 1e4']) + fn = cr.save_as_dataset(fields=["temperature"]) + full_fn = os.path.join(tmpdir, fn) + cr_ds = load(full_fn) + assert isinstance(cr_ds, YTDataContainerDataset) + assert (cr["temperature"] == cr_ds.data["temperature"]).all() os.chdir(curdir) shutil.rmtree(tmpdir) @@ -104,6 +124,7 @@ fn = cg.save_as_dataset(fields=["density", "particle_mass"]) full_fn = os.path.join(tmpdir, fn) cg_ds = load(full_fn) + compare_unit_attributes(ds, cg_ds) assert isinstance(cg_ds, YTGridDataset) yield YTDataFieldTest(full_fn, ("grid", "density")) @@ -112,6 +133,7 @@ frb = my_proj.to_frb(1.0, (800, 800)) fn = frb.save_as_dataset(fields=["density"]) frb_ds = load(fn) + compare_unit_attributes(ds, frb_ds) assert isinstance(frb_ds, YTGridDataset) yield YTDataFieldTest(full_fn, "density", geometric=False) os.chdir(curdir) @@ -127,6 +149,7 @@ fn = proj.save_as_dataset() full_fn = os.path.join(tmpdir, fn) proj_ds = load(full_fn) + compare_unit_attributes(ds, proj_ds) assert isinstance(proj_ds, YTSpatialPlotDataset) yield YTDataFieldTest(full_fn, ("grid", "density"), geometric=False) os.chdir(curdir) @@ -144,6 +167,7 @@ fn = profile_1d.save_as_dataset() full_fn = os.path.join(tmpdir, fn) prof_1d_ds = load(full_fn) + compare_unit_attributes(ds, prof_1d_ds) assert isinstance(prof_1d_ds, YTProfileDataset) p1 = ProfilePlot(prof_1d_ds.data, "density", "temperature", @@ -159,6 +183,7 @@ fn = profile_2d.save_as_dataset() full_fn = os.path.join(tmpdir, fn) prof_2d_ds = load(full_fn) + compare_unit_attributes(ds, prof_2d_ds) assert isinstance(prof_2d_ds, YTProfileDataset) p2 = PhasePlot(prof_2d_ds.data, "density", "temperature", @@ -188,6 +213,7 @@ save_as_dataset(ds, fn, my_data) full_fn = os.path.join(tmpdir, fn) array_ds = load(full_fn) + compare_unit_attributes(ds, array_ds) assert isinstance(array_ds, YTNonspatialDataset) yield YTDataFieldTest(full_fn, "region_density", geometric=False) yield YTDataFieldTest(full_fn, "sphere_density", geometric=False) @@ -202,3 +228,33 @@ yield YTDataFieldTest(full_fn, "density", geometric=False) os.chdir(curdir) shutil.rmtree(tmpdir) + +def test_plot_data(): + tmpdir = tempfile.mkdtemp() + curdir = os.getcwd() + os.chdir(tmpdir) + ds = fake_random_ds(16) + + plot = SlicePlot(ds, 'z', 'density') + plot.data_source.save_as_dataset('slice.h5') + ds_slice = load('slice.h5') + p = SlicePlot(ds_slice, 'z', 'density') + fn = p.save() + assert_fname(fn[0]) + + plot = ProjectionPlot(ds, 'z', 'density') + plot.data_source.save_as_dataset('proj.h5') + ds_proj = load('slice.h5') + p = ProjectionPlot(ds_proj, 'z', 'density') + fn = p.save() + assert_fname(fn[0]) + + plot = SlicePlot(ds, [1, 1, 1], 'density') + plot.data_source.save_as_dataset('oas.h5') + ds_oas = load('oas.h5') + p = SlicePlot(ds_oas, [1, 1, 1], 'density') + fn = p.save() + assert_fname(fn[0]) + + os.chdir(curdir) + shutil.rmtree(tmpdir) diff -Nru yt-3.3.3/yt/frontends/ytdata/utilities.py yt-3.4.0/yt/frontends/ytdata/utilities.py --- yt-3.3.3/yt/frontends/ytdata/utilities.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/frontends/ytdata/utilities.py 2017-08-10 18:02:57.000000000 +0000 @@ -95,7 +95,9 @@ "current_redshift", "current_time", "domain_dimensions", "periodicity", "cosmological_simulation", "omega_lambda", - "omega_matter", "hubble_constant"] + "omega_matter", "hubble_constant", + "length_unit", "mass_unit", "time_unit", + "velocity_unit", "magnetic_unit"] fh = h5py.File(filename, "w") if ds is None: ds = {} @@ -104,6 +106,14 @@ for attr, val in ds.parameters.items(): _yt_array_hdf5_attr(fh, attr, val) + if hasattr(ds, "unit_registry"): + _yt_array_hdf5_attr(fh, "unit_registry_json", + ds.unit_registry.to_json()) + + if hasattr(ds, "unit_system"): + _yt_array_hdf5_attr(fh, "unit_system_name", + ds.unit_system.name) + for attr in base_attrs: if isinstance(ds, dict): my_val = ds.get(attr, None) @@ -126,16 +136,16 @@ field_type = field_types[field] if field_type not in fh: fh.create_group(field_type) - # for now, let's avoid writing "code" units - if hasattr(data[field], "units"): - for atom in data[field].units.expr.atoms(): - if str(atom).startswith("code"): - data[field].convert_to_base() - break + if isinstance(field, tuple): field_name = field[1] else: field_name = field + + # for python3 + if data[field].dtype.kind == 'U': + data[field] = data[field].astype('|S') + _yt_array_hdf5(fh[field_type], field_name, data[field]) if "num_elements" not in fh[field_type].attrs: fh[field_type].attrs["num_elements"] = data[field].size @@ -222,7 +232,6 @@ if val is None: val = "None" if hasattr(val, "units"): - val = val.in_base() fh.attrs["%s_units" % attr] = str(val.units) # The following is a crappy workaround for getting # Unicode strings into HDF5 attributes in Python 3 @@ -230,4 +239,9 @@ val = np.array(val) if val.dtype.kind == 'U': val = val.astype('|S') - fh.attrs[str(attr)] = val + try: + fh.attrs[str(attr)] = val + # This is raised if no HDF5 equivalent exists. + # In that case, save its string representation. + except TypeError: + fh.attrs[str(attr)] = str(val) diff -Nru yt-3.3.3/yt/funcs.py yt-3.4.0/yt/funcs.py --- yt-3.3.3/yt/funcs.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/funcs.py 2017-08-10 18:02:57.000000000 +0000 @@ -16,7 +16,7 @@ import errno from yt.extern.six import string_types -from yt.extern.six.moves import input +from yt.extern.six.moves import input, builtins import time import inspect import traceback @@ -34,7 +34,6 @@ import numpy import matplotlib import getpass -from distutils.version import LooseVersion from math import floor, ceil from numbers import Number as numeric_type @@ -286,17 +285,6 @@ %(filename)s:%(lineno)s """ -def get_ipython_api_version(): - import IPython - if LooseVersion(IPython.__version__) <= LooseVersion('0.10'): - api_version = '0.10' - elif LooseVersion(IPython.__version__) <= LooseVersion('1.0'): - api_version = '0.11' - else: - api_version = '1.0' - - return api_version - def insert_ipython(num_up=1): """ Placed inside a function, this will insert an IPython interpreter at that @@ -306,31 +294,22 @@ defaults to 1 so that this function itself is stripped off. """ import IPython - api_version = get_ipython_api_version() + from IPython.terminal.embed import InteractiveShellEmbed + try: + from traitlets.config.loader import Config + except ImportError: + from IPython.config.loader import Config frame = inspect.stack()[num_up] loc = frame[0].f_locals.copy() glo = frame[0].f_globals dd = dict(fname = frame[3], filename = frame[1], lineno = frame[2]) - if api_version == '0.10': - ipshell = IPython.Shell.IPShellEmbed() - ipshell(header = __header % dd, - local_ns = loc, global_ns = glo) - else: - try: - from traitlets.config.loader import Config - except ImportError: - from IPython.config.loader import Config - cfg = Config() - cfg.InteractiveShellEmbed.local_ns = loc - cfg.InteractiveShellEmbed.global_ns = glo - IPython.embed(config=cfg, banner2 = __header % dd) - if api_version == '0.11': - from IPython.frontend.terminal.embed import InteractiveShellEmbed - else: - from IPython.terminal.embed import InteractiveShellEmbed - ipshell = InteractiveShellEmbed(config=cfg) + cfg = Config() + cfg.InteractiveShellEmbed.local_ns = loc + cfg.InteractiveShellEmbed.global_ns = glo + IPython.embed(config=cfg, banner2 = __header % dd) + ipshell = InteractiveShellEmbed(config=cfg) del ipshell @@ -400,7 +379,8 @@ maxval = max(maxval, 1) from yt.config import ytcfg if ytcfg.getboolean("yt", "suppressStreamLogging") or \ - ytcfg.getboolean("yt", "__withintesting"): + ytcfg.getboolean("yt", "__withintesting") or \ + maxval == 1: \ return DummyProgressBar() elif ytcfg.getboolean("yt", "__parallel"): # If parallel is True, update progress on root only. @@ -511,7 +491,65 @@ class YTEmptyClass(object): pass -def update_hg(path, skip_rebuild = False): +def update_hg_or_git(path): + if os.path.exists(os.sep.join([path, '.hg'])): + update_hg(path) + elif os.path.exists(os.sep.join([path, '.git'])): + update_git(path) + +def update_git(path): + try: + import git + except ImportError: + print("Updating and precise version information requires ") + print("gitpython to be installed.") + print("Try: pip install gitpython") + return -1 + with open(os.path.join(path, "yt_updater.log"), "a") as f: + repo = git.Repo(path) + if repo.is_dirty(untracked_files=True): + print("Changes have been made to the yt source code so I won't ") + print("update the code. You will have to do this yourself.") + print("Here's a set of sample commands:") + print("") + print(" $ cd %s" % (path)) + print(" $ git stash") + print(" $ git checkout master") + print(" $ git pull") + print(" $ git stash pop") + print(" $ %s setup.py develop" % (sys.executable)) + print("") + return 1 + if repo.active_branch.name != 'master': + print("yt repository is not tracking the master branch so I won't ") + print("update the code. You will have to do this yourself.") + print("Here's a set of sample commands:") + print("") + print(" $ cd %s" % (path)) + print(" $ git checkout master") + print(" $ git pull") + print(" $ %s setup.py develop" % (sys.executable)) + print("") + return 1 + print("Updating the repository") + f.write("Updating the repository\n\n") + old_version = repo.git.rev_parse('HEAD', short=12) + try: + remote = repo.remotes.yt_upstream + except AttributeError: + remote = repo.create_remote( + 'yt_upstream', url='https://github.com/yt-project/yt') + remote.fetch() + master = repo.heads.master + master.set_tracking_branch(remote.refs.master) + master.checkout() + remote.pull() + new_version = repo.git.rev_parse('HEAD', short=12) + f.write('Updated from %s to %s\n\n' % (old_version, new_version)) + rebuild_modules(path, f) + print('Updated successfully') + +def update_hg(path): try: import hglib except ImportError: @@ -520,33 +558,65 @@ return -1 f = open(os.path.join(path, "yt_updater.log"), "a") with hglib.open(path) as repo: - repo.pull() + repo.pull(b'https://bitbucket.org/yt_analysis/yt') ident = repo.identify().decode("utf-8") if "+" in ident: - print("Can't rebuild modules by myself.") - print("You will have to do this yourself. Here's a sample commands:") + print("Changes have been made to the yt source code so I won't ") + print("update the code. You will have to do this yourself.") + print("Here's a set of sample commands:") print("") print(" $ cd %s" % (path)) - print(" $ hg up") + print(" $ hg up -C yt # This will delete any unsaved changes") print(" $ %s setup.py develop" % (sys.executable)) + print("") return 1 print("Updating the repository") f.write("Updating the repository\n\n") - repo.update(check=True) + books = repo.bookmarks()[0] + books = [b[0].decode('utf8') for b in books] + if 'master' in books: + repo.update('master', check=True) + else: + repo.update('yt', check=True) f.write("Updated from %s to %s\n\n" % (ident, repo.identify())) - if skip_rebuild: return - f.write("Rebuilding modules\n\n") - p = subprocess.Popen([sys.executable, "setup.py", "build_ext", "-i"], - cwd=path, stdout = subprocess.PIPE, - stderr = subprocess.STDOUT) - stdout, stderr = p.communicate() - f.write(stdout.decode('utf-8')) - f.write("\n\n") - if p.returncode: - print("BROKEN: See %s" % (os.path.join(path, "yt_updater.log"))) - sys.exit(1) - f.write("Successful!\n") - print("Updated successfully.") + rebuild_modules(path, f) + print("Updated successfully.") + +def rebuild_modules(path, f): + f.write("Rebuilding modules\n\n") + p = subprocess.Popen([sys.executable, "setup.py", "build_ext", "-i"], + cwd=path, stdout = subprocess.PIPE, + stderr = subprocess.STDOUT) + stdout, stderr = p.communicate() + f.write(stdout.decode('utf-8')) + f.write("\n\n") + if p.returncode: + print("BROKEN: See %s" % (os.path.join(path, "yt_updater.log"))) + sys.exit(1) + f.write("Successful!\n") + + +def get_hg_or_git_version(path): + if os.path.exists(os.sep.join([path, '.hg'])): + return get_hg_version(path) + elif os.path.exists(os.sep.join([path, '.git'])): + return get_git_version(path) + return None + +def get_git_version(path): + try: + import git + except ImportError: + print("Updating and precise version information requires ") + print("gitpython to be installed.") + print("Try: pip install gitpython") + return None + try: + repo = git.Repo(path) + return repo.git.rev_parse('HEAD', short=12) + except git.InvalidGitRepositoryError: + # path is not a git repository + return None def get_hg_version(path): try: @@ -558,7 +628,7 @@ return None try: with hglib.open(path) as repo: - return repo.identify() + return repo.identify().decode('utf-8') except hglib.error.ServerError: # path is not an hg repository return None @@ -597,6 +667,35 @@ return contents def download_file(url, filename): + requests = get_requests() + if requests is None: + return simple_download_file(url, filename) + else: + return fancy_download_file(url, filename, requests) + +def fancy_download_file(url, filename, requests=None): + response = requests.get(url, stream=True) + total_length = response.headers.get('content-length') + + with open(filename, 'wb') as fh: + if total_length is None: + fh.write(response.content) + else: + blocksize = 4 * 1024 ** 2 + iterations = int(float(total_length)/float(blocksize)) + + pbar = get_pbar( + 'Downloading %s to %s ' % os.path.split(filename)[::-1], + iterations) + iteration = 0 + for chunk in response.iter_content(chunk_size=blocksize): + fh.write(chunk) + iteration += 1 + pbar.update(iteration) + pbar.finish() + return filename + +def simple_download_file(url, filename): class MyURLopener(urllib.request.FancyURLopener): def http_error_default(self, url, fp, errcode, errmsg, headers): raise RuntimeError("Attempt to download file from %s failed with error %s: %s." % \ @@ -717,6 +816,7 @@ With a name provided by the user, this will decide how to appropriately name the output file by the following rules: + 1. if name is None, the filename will be the keyword plus the suffix. 2. if name ends with "/", assume name is a directory and @@ -750,13 +850,7 @@ name = keyword name = os.path.expanduser(name) if name[-1] == os.sep and not os.path.isdir(name): - try: - os.mkdir(name) - except OSError as e: - if e.errno == errno.EEXIST: - pass - else: - raise + ensure_dir(name) if os.path.isdir(name): name = os.path.join(name, keyword) if not name.endswith(suffix): @@ -766,15 +860,20 @@ def ensure_dir_exists(path): r"""Create all directories in path recursively in a parallel safe manner""" my_dir = os.path.dirname(path) - if not my_dir: - return - if not os.path.exists(my_dir): - only_on_root(os.makedirs, my_dir) + ensure_dir(my_dir) def ensure_dir(path): r"""Parallel safe directory maker.""" - if not os.path.exists(path): - only_on_root(os.makedirs, path) + if os.path.exists(path): + return path + + try: + os.makedirs(path) + except OSError as e: + if e.errno == errno.EEXIST: + pass + else: + raise return path def validate_width_tuple(width): @@ -855,21 +954,32 @@ data objects, colormaps, and other code classes and objects to be used in yt scripts without modifying the yt source directly. - The file must be located at ``$HOME/.yt/my_plugins.py``. + The file must be located at ``$HOME/.config/yt/my_plugins.py``. Warning: when you use this function, your script will only be reproducible if you also provide the ``my_plugins.py`` file. """ import yt from yt.fields.my_plugin_fields import my_plugins_fields - from yt.config import ytcfg - my_plugin_name = ytcfg.get("yt","pluginfilename") - # We assume that it is with respect to the $HOME/.yt directory - if os.path.isfile(my_plugin_name): - _fn = my_plugin_name - else: - _fn = os.path.expanduser("~/.yt/%s" % my_plugin_name) - if os.path.isfile(_fn): + from yt.config import ytcfg, CONFIG_DIR + my_plugin_name = ytcfg.get("yt", "pluginfilename") + + # In the following order if pluginfilename is: an absolute path, located in + # the CONFIG_DIR, located in an obsolete config dir. + _fn = None + old_config_dir = os.path.join(os.path.expanduser('~'), '.yt') + for base_prefix in ('', CONFIG_DIR, old_config_dir): + if os.path.isfile(os.path.join(base_prefix, my_plugin_name)): + _fn = os.path.join(base_prefix, my_plugin_name) + break + + if _fn is not None and os.path.isfile(_fn): + if _fn.startswith(old_config_dir): + mylog.warn( + 'Your plugin file is located in a deprecated directory. ' + 'Please move it from %s to %s', + os.path.join(old_config_dir, my_plugin_name), + os.path.join(CONFIG_DIR, my_plugin_name)) mylog.info("Loading plugins from %s", _fn) execdict = yt.__dict__.copy() execdict['add_field'] = my_plugins_fields.add_field @@ -969,7 +1079,7 @@ def dummy_context_manager(*args, **kwargs): yield -def matplotlib_style_context(style_name=None, after_reset=True): +def matplotlib_style_context(style_name=None, after_reset=False): """Returns a context manager for controlling matplotlib style. Arguments are passed to matplotlib.style.context() if specified. Defaults @@ -979,15 +1089,35 @@ available, returns a dummy context manager. """ if style_name is None: - style_name = 'classic' + style_name = { + 'mathtext.fontset': 'cm', + 'mathtext.fallback_to_cm': True, + } try: import matplotlib.style - if style_name in matplotlib.style.available: - return matplotlib.style.context(style_name, after_reset=after_reset) + return matplotlib.style.context(style_name, after_reset=after_reset) except ImportError: pass return dummy_context_manager() +interactivity = False + +"""Sets the condition that interactive backends can be used.""" +def toggle_interactivity(): + global interactivity + interactivity = not interactivity + if interactivity is True: + if '__IPYTHON__' in dir(builtins): + import IPython + shell = IPython.get_ipython() + shell.magic('matplotlib') + else: + import matplotlib + matplotlib.interactive(True) + +def get_interactivity(): + return interactivity + def setdefaultattr(obj, name, value): """Set attribute with *name* on *obj* with *value* if it doesn't exist yet @@ -996,3 +1126,26 @@ if not hasattr(obj, name): setattr(obj, name, value) return getattr(obj, name) + +def parse_h5_attr(f, attr): + """A Python3-safe function for getting hdf5 attributes. + + If an attribute is supposed to be a string, this will return it as such. + """ + val = f.attrs.get(attr, None) + if isinstance(val, bytes): + return val.decode('utf8') + else: + return val + +def issue_deprecation_warning(msg): + from numpy import VisibleDeprecationWarning + warnings.warn(msg, VisibleDeprecationWarning, stacklevel=3) + +def obj_length(v): + if iterable(v): + return len(v) + else: + # If something isn't iterable, we return 0 + # to signify zero length (aka a scalar). + return 0 diff -Nru yt-3.3.3/yt/geometry/coordinates/cartesian_coordinates.py yt-3.4.0/yt/geometry/coordinates/cartesian_coordinates.py --- yt-3.3.3/yt/geometry/coordinates/cartesian_coordinates.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/coordinates/cartesian_coordinates.py 2017-08-10 18:02:57.000000000 +0000 @@ -22,11 +22,48 @@ cartesian_to_cylindrical, \ cylindrical_to_cartesian from yt.funcs import mylog +from yt.units.yt_array import uvstack, YTArray from yt.utilities.lib.pixelization_routines import \ pixelize_element_mesh, pixelize_off_axis_cartesian, \ - pixelize_cartesian + pixelize_cartesian, pixelize_cartesian_nodal, \ + pixelize_element_mesh_line from yt.data_objects.unstructured_mesh import SemiStructuredMesh +from yt.utilities.nodal_data_utils import get_nodal_data +def _sample_ray(ray, npoints, field): + """ + Private function that uses a ray object for calculating the field values + that will be the y-axis values in a LinePlot object. + + Parameters + ---------- + ray : YTOrthoRay, YTRay, or LightRay + Ray object from which to sample field values + npoints : int + The number of points to sample + field : str or field tuple + The name of the field to sample + """ + start_point = ray.start_point + end_point = ray.end_point + sample_dr = (end_point - start_point)/(npoints-1) + sample_points = [np.arange(npoints)*sample_dr[i] for i in range(3)] + sample_points = uvstack(sample_points).T + start_point + ray_coordinates = uvstack([ray[d] for d in 'xyz']).T + ray_dds = uvstack([ray['d'+d] for d in 'xyz']).T + ray_field = ray[field] + field_values = ray.ds.arr(np.zeros(npoints), ray_field.units) + for i, sample_point in enumerate(sample_points): + ray_contains = ((sample_point >= (ray_coordinates - ray_dds/2)) & + (sample_point <= (ray_coordinates + ray_dds/2))) + ray_contains = ray_contains.all(axis=-1) + # use argmax to find the first nonzero index, sometimes there + # are two indices if the sampling point happens to fall exactly at + # a cell boundary + field_values[i] = ray_field[np.argmax(ray_contains)] + dr = np.sqrt((sample_dr**2).sum()) + x = np.arange(npoints)/(npoints-1)*(dr*npoints) + return x, field_values class CartesianCoordinateHandler(CoordinateHandler): name = "cartesian" @@ -37,17 +74,17 @@ def setup_fields(self, registry): for axi, ax in enumerate(self.axis_order): f1, f2 = _get_coord_fields(axi) - registry.add_field(("index", "d%s" % ax), function = f1, + registry.add_field(("index", "d%s" % ax), sampling_type="cell", function = f1, display_field = False, units = "code_length") - registry.add_field(("index", "path_element_%s" % ax), function = f1, + registry.add_field(("index", "path_element_%s" % ax), sampling_type="cell", function = f1, display_field = False, units = "code_length") - registry.add_field(("index", "%s" % ax), function = f2, + registry.add_field(("index", "%s" % ax), sampling_type="cell", function = f2, display_field = False, units = "code_length") f3 = _get_vert_fields(axi) - registry.add_field(("index", "vertex_%s" % ax), function = f3, + registry.add_field(("index", "vertex_%s" % ax), sampling_type="cell", function = f3, display_field = False, units = "code_length") def _cell_volume(field, data): @@ -55,7 +92,7 @@ rv *= data["index", "dy"] rv *= data["index", "dz"] return rv - registry.add_field(("index", "cell_volume"), function=_cell_volume, + registry.add_field(("index", "cell_volume"), sampling_type="cell", function=_cell_volume, display_field=False, units = "code_length**3") registry.check_derived_fields( [("index", "dx"), ("index", "dy"), ("index", "dz"), @@ -64,15 +101,24 @@ def pixelize(self, dimension, data_source, field, bounds, size, antialias = True, periodic = True): + """ + Method for pixelizing datasets in preparation for + two-dimensional image plots. Relies on several sampling + routines written in cython + """ index = data_source.ds.index if (hasattr(index, 'meshes') and not isinstance(index.meshes[0], SemiStructuredMesh)): ftype, fname = field - mesh_id = int(ftype[-1]) - 1 - mesh = index.meshes[mesh_id] - coords = mesh.connectivity_coords - indices = mesh.connectivity_indices - offset = mesh._index_offset + if ftype == "all": + mesh_id = 0 + indices = np.concatenate([mesh.connectivity_indices for mesh in index.mesh_union]) + else: + mesh_id = int(ftype[-1]) - 1 + indices = index.meshes[mesh_id].connectivity_indices + + coords = index.meshes[mesh_id].connectivity_coords + offset = index.meshes[mesh_id]._index_offset ad = data_source.ds.all_data() field_data = ad[field] buff_size = size[0:dimension] + (1,) + size[dimension:] @@ -98,12 +144,6 @@ "dropping to 1st order.") field_data = field_data[:, 0:8] indices = indices[:, 0:8] - elif field_data.shape[1] == 10: - # tetrahedral - mylog.warning("High order elements not yet supported, " + - "dropping to 1st order.") - field_data = field_data[:,0:4] - indices = indices[:, 0:4] img = pixelize_element_mesh(coords, indices, @@ -113,13 +153,64 @@ # re-order the array and squeeze out the dummy dim return np.squeeze(np.transpose(img, (yax, xax, ax))) - elif dimension < 3: + elif self.axis_id.get(dimension, dimension) < 3: return self._ortho_pixelize(data_source, field, bounds, size, antialias, dimension, periodic) else: return self._oblique_pixelize(data_source, field, bounds, size, antialias) + + def pixelize_line(self, field, start_point, end_point, npoints): + """ + Method for sampling datasets along a line in preparation for + one-dimensional line plots. For UnstructuredMesh, relies on a + sampling routine written in cython + """ + if npoints < 2: + raise ValueError("Must have at least two sample points in order " + "to draw a line plot.") + index = self.ds.index + if (hasattr(index, 'meshes') and + not isinstance(index.meshes[0], SemiStructuredMesh)): + ftype, fname = field + if ftype == "all": + mesh_id = 0 + indices = np.concatenate([mesh.connectivity_indices for mesh in index.mesh_union]) + else: + mesh_id = int(ftype[-1]) - 1 + indices = index.meshes[mesh_id].connectivity_indices + + coords = index.meshes[mesh_id].connectivity_coords + if coords.shape[1] != end_point.size != start_point.size: + raise ValueError("The coordinate dimension doesn't match the " + "start and end point dimensions.") + + + offset = index.meshes[mesh_id]._index_offset + ad = self.ds.all_data() + field_data = ad[field] + if field_data.shape[1] == 27: + # hexahedral + mylog.warning("High order elements not yet supported, " + + "dropping to 1st order.") + field_data = field_data[:, 0:8] + indices = indices[:, 0:8] + + arc_length, plot_values = pixelize_element_mesh_line(coords, indices, + start_point, + end_point, + npoints, field_data, + index_offset=offset) + arc_length = YTArray(arc_length, start_point.units) + plot_values = YTArray(plot_values, field_data.units) + else: + ray = self.ds.ray(start_point, end_point) + arc_length, plot_values = _sample_ray(ray, npoints, field) + return arc_length, plot_values + + + def _ortho_pixelize(self, data_source, field, bounds, size, antialias, dim, periodic): # We should be using fcoords @@ -128,22 +219,37 @@ period[1] = self.period[self.y_axis[dim]] if hasattr(period, 'in_units'): period = period.in_units("code_length").d - buff = pixelize_cartesian(data_source['px'], data_source['py'], - data_source['pdx'], data_source['pdy'], - data_source[field], size[0], size[1], - bounds, int(antialias), - period, int(periodic)).transpose() + + buff = np.zeros((size[1], size[0]), dtype="f8") + + finfo = self.ds._get_field_info(field) + nodal_flag = finfo.nodal_flag + if np.any(nodal_flag): + nodal_data = get_nodal_data(data_source, field) + coord = data_source.coord.d + pixelize_cartesian_nodal(buff, + data_source['px'], data_source['py'], data_source['pz'], + data_source['pdx'], data_source['pdy'], data_source['pdz'], + nodal_data, coord, bounds, int(antialias), + period, int(periodic)) + else: + pixelize_cartesian(buff, data_source['px'], data_source['py'], + data_source['pdx'], data_source['pdy'], + data_source[field], + bounds, int(antialias), + period, int(periodic)) return buff def _oblique_pixelize(self, data_source, field, bounds, size, antialias): - indices = np.argsort(data_source['dx'])[::-1] - buff = pixelize_off_axis_cartesian( + indices = np.argsort(data_source['pdx'])[::-1].astype(np.int_) + buff = np.zeros((size[1], size[0]), dtype="f8") + pixelize_off_axis_cartesian(buff, data_source['x'], data_source['y'], data_source['z'], data_source['px'], data_source['py'], data_source['pdx'], data_source['pdy'], data_source['pdz'], data_source.center, data_source._inv_mat, indices, - data_source[field], size[0], size[1], bounds).transpose() + data_source[field], bounds) return buff def convert_from_cartesian(self, coord): @@ -172,4 +278,3 @@ @property def period(self): return self.ds.domain_width - diff -Nru yt-3.3.3/yt/geometry/coordinates/coordinate_handler.py yt-3.4.0/yt/geometry/coordinates/coordinate_handler.py --- yt-3.3.3/yt/geometry/coordinates/coordinate_handler.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/geometry/coordinates/coordinate_handler.py 2017-08-10 18:02:57.000000000 +0000 @@ -72,7 +72,7 @@ class CoordinateHandler(object): name = None - + def __init__(self, ds, ordering): self.ds = weakref.proxy(ds) self.axis_order = ordering @@ -86,6 +86,9 @@ # pixelizer raise NotImplementedError + def pixelize_line(self, field, start_point, end_point, npoints): + raise NotImplementedError + def distance(self, start, end): p1 = self.convert_to_cartesian(start) p2 = self.convert_to_cartesian(end) @@ -265,4 +268,3 @@ c2[...,1] = np.sin(coord[...,0]) * coord[...,1] + center[1] c2[...,2] = coord[...,2] return c2 - diff -Nru yt-3.3.3/yt/geometry/coordinates/cylindrical_coordinates.py yt-3.4.0/yt/geometry/coordinates/cylindrical_coordinates.py --- yt-3.3.3/yt/geometry/coordinates/cylindrical_coordinates.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/coordinates/cylindrical_coordinates.py 2017-08-10 18:02:57.000000000 +0000 @@ -39,57 +39,59 @@ def setup_fields(self, registry): # return the fields for r, z, theta - registry.add_field(("index", "dx"), function=_unknown_coord) - registry.add_field(("index", "dy"), function=_unknown_coord) - registry.add_field(("index", "x"), function=_unknown_coord) - registry.add_field(("index", "y"), function=_unknown_coord) + registry.add_field(("index", "dx"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "dy"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "x"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "y"), sampling_type="cell", function=_unknown_coord) f1, f2 = _get_coord_fields(self.axis_id['r']) - registry.add_field(("index", "dr"), function = f1, + registry.add_field(("index", "dr"), sampling_type="cell", function = f1, display_field = False, units = "code_length") - registry.add_field(("index", "r"), function = f2, + registry.add_field(("index", "r"), sampling_type="cell", function = f2, display_field = False, units = "code_length") f1, f2 = _get_coord_fields(self.axis_id['z']) - registry.add_field(("index", "dz"), function = f1, + registry.add_field(("index", "dz"), sampling_type="cell", function = f1, display_field = False, units = "code_length") - registry.add_field(("index", "z"), function = f2, + registry.add_field(("index", "z"), sampling_type="cell", function = f2, display_field = False, units = "code_length") f1, f2 = _get_coord_fields(self.axis_id['theta'], "") - registry.add_field(("index", "dtheta"), function = f1, + registry.add_field(("index", "dtheta"), sampling_type="cell", function = f1, display_field = False, units = "") - registry.add_field(("index", "theta"), function = f2, + registry.add_field(("index", "theta"), sampling_type="cell", function = f2, display_field = False, units = "") def _CylindricalVolume(field, data): - return data["index", "dtheta"] \ - * data["index", "r"] \ - * data["index", "dr"] \ - * data["index", "dz"] - registry.add_field(("index", "cell_volume"), + r = data["index", "r"] + dr = data["index", "dr"] + vol = 0.5*((r+0.5*dr)**2-(r-0.5*dr)**2) + vol *= data["index", "dtheta"] + vol *= data["index", "dz"] + return vol + registry.add_field(("index", "cell_volume"), sampling_type="cell", function=_CylindricalVolume, units = "code_length**3") def _path_r(field, data): return data["index", "dr"] - registry.add_field(("index", "path_element_r"), + registry.add_field(("index", "path_element_r"), sampling_type="cell", function = _path_r, units = "code_length") def _path_theta(field, data): # Note: this already assumes cell-centered return data["index", "r"] * data["index", "dtheta"] - registry.add_field(("index", "path_element_theta"), + registry.add_field(("index", "path_element_theta"), sampling_type="cell", function = _path_theta, units = "code_length") def _path_z(field, data): return data["index", "dz"] - registry.add_field(("index", "path_element_z"), + registry.add_field(("index", "path_element_z"), sampling_type="cell", function = _path_z, units = "code_length") @@ -113,19 +115,22 @@ period[1] = self.period[self.y_axis[dim]] if hasattr(period, 'in_units'): period = period.in_units("code_length").d - buff = pixelize_cartesian(data_source['px'], data_source['py'], + buff = np.zeros(size, dtype="f8") + pixelize_cartesian(buff, data_source['px'], data_source['py'], data_source['pdx'], data_source['pdy'], - data_source[field], size[0], size[1], + data_source[field], bounds, int(antialias), - period, int(periodic)).transpose() + period, int(periodic)) return buff def _cyl_pixelize(self, data_source, field, bounds, size, antialias): - buff = pixelize_cylinder(data_source['px'], - data_source['pdx'], - data_source['py'], - data_source['pdy'], - size, data_source[field], bounds) + buff = np.zeros((size[1], size[0]), dtype="f8") + pixelize_cylinder(buff, + data_source['px'], + data_source['pdx'], + data_source['py'], + data_source['pdy'], + data_source[field], bounds) return buff _x_pairs = (('r', 'theta'), ('z', 'r'), ('theta', 'r')) diff -Nru yt-3.3.3/yt/geometry/coordinates/geographic_coordinates.py yt-3.4.0/yt/geometry/coordinates/geographic_coordinates.py --- yt-3.3.3/yt/geometry/coordinates/geographic_coordinates.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/coordinates/geographic_coordinates.py 2017-08-10 18:02:57.000000000 +0000 @@ -37,59 +37,61 @@ def setup_fields(self, registry): # return the fields for r, z, theta - registry.add_field(("index", "dx"), function=_unknown_coord) - registry.add_field(("index", "dy"), function=_unknown_coord) - registry.add_field(("index", "dz"), function=_unknown_coord) - registry.add_field(("index", "x"), function=_unknown_coord) - registry.add_field(("index", "y"), function=_unknown_coord) - registry.add_field(("index", "z"), function=_unknown_coord) + registry.add_field(("index", "dx"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "dy"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "dz"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "x"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "y"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "z"), sampling_type="cell", function=_unknown_coord) f1, f2 = _get_coord_fields(self.axis_id['latitude'], "") - registry.add_field(("index", "dlatitude"), function = f1, + registry.add_field(("index", "dlatitude"), sampling_type="cell", function = f1, display_field = False, units = "") - registry.add_field(("index", "latitude"), function = f2, + registry.add_field(("index", "latitude"), sampling_type="cell", function = f2, display_field = False, units = "") f1, f2 = _get_coord_fields(self.axis_id['longitude'], "") - registry.add_field(("index", "dlongitude"), function = f1, + registry.add_field(("index", "dlongitude"), sampling_type="cell", function = f1, display_field = False, units = "") - registry.add_field(("index", "longitude"), function = f2, + registry.add_field(("index", "longitude"), sampling_type="cell", function = f2, display_field = False, units = "") f1, f2 = _get_coord_fields(self.axis_id[self.radial_axis]) - registry.add_field(("index", "d%s" % (self.radial_axis,)), function = f1, + registry.add_field(("index", "d%s" % (self.radial_axis,)), sampling_type="cell", function = f1, display_field = False, units = "code_length") - registry.add_field(("index", self.radial_axis), function = f2, + registry.add_field(("index", self.radial_axis), sampling_type="cell", function = f2, display_field = False, units = "code_length") def _SphericalVolume(field, data): - # r**2 sin theta dr dtheta dphi # We can use the transformed coordinates here. - vol = data["index", "r"]**2.0 - vol *= data["index", "dr"] - vol *= np.sin(data["index", "theta"]) - vol *= data["index", "dtheta"] + # Here we compute the spherical volume element exactly + r = data["index", "r"] + dr = data["index", "dr"] + theta = data["index", "theta"] + dtheta = data["index", "dtheta"] + vol = ((r+0.5*dr)**3-(r-0.5*dr)**3) / 3.0 + vol *= np.cos(theta-0.5*dtheta)-np.cos(theta+0.5*dtheta) vol *= data["index", "dphi"] return vol - registry.add_field(("index", "cell_volume"), + registry.add_field(("index", "cell_volume"), sampling_type="cell", function=_SphericalVolume, units = "code_length**3") def _path_radial_axis(field, data): return data["index", "d%s" % self.radial_axis] - registry.add_field(("index", "path_element_%s" % self.radial_axis), + registry.add_field(("index", "path_element_%s" % self.radial_axis), sampling_type="cell", function = _path_radial_axis, units = "code_length") def _path_latitude(field, data): # We use r here explicitly return data["index", "r"] * \ data["index", "dlatitude"] * np.pi/180.0 - registry.add_field(("index", "path_element_latitude"), + registry.add_field(("index", "path_element_latitude"), sampling_type="cell", function = _path_latitude, units = "code_length") def _path_longitude(field, data): @@ -97,31 +99,31 @@ return data["index", "r"] \ * data["index", "dlongitude"] * np.pi/180.0 \ * np.sin((data["index", "latitude"] + 90.0) * np.pi/180.0) - registry.add_field(("index", "path_element_longitude"), + registry.add_field(("index", "path_element_longitude"), sampling_type="cell", function = _path_longitude, units = "code_length") def _latitude_to_theta(field, data): # latitude runs from -90 to 90 return (data["latitude"] + 90) * np.pi/180.0 - registry.add_field(("index", "theta"), + registry.add_field(("index", "theta"), sampling_type="cell", function = _latitude_to_theta, units = "") def _dlatitude_to_dtheta(field, data): return data["dlatitude"] * np.pi/180.0 - registry.add_field(("index", "dtheta"), + registry.add_field(("index", "dtheta"), sampling_type="cell", function = _dlatitude_to_dtheta, units = "") def _longitude_to_phi(field, data): # longitude runs from -180 to 180 return (data["longitude"] + 180) * np.pi/180.0 - registry.add_field(("index", "phi"), + registry.add_field(("index", "phi"), sampling_type="cell", function = _longitude_to_phi, units = "") def _dlongitude_to_dphi(field, data): return data["dlongitude"] * np.pi/180.0 - registry.add_field(("index", "dphi"), + registry.add_field(("index", "dphi"), sampling_type="cell", function = _dlongitude_to_dphi, units = "") @@ -138,7 +140,7 @@ else: surface_height = data.ds.quan(0.0, "code_length") return data["altitude"] + surface_height - registry.add_field(("index", "r"), + registry.add_field(("index", "r"), sampling_type="cell", function=_altitude_to_radius, units = "code_length") registry.alias(("index", "dr"), ("index", "daltitude")) @@ -203,9 +205,9 @@ else: # We should never get here! raise NotImplementedError - buff = pixelize_cylinder(r, data_source['pdy'], - px, pdx, - size, data_source[field], bounds) + buff = np.zeros((size[1], size[0]), dtype="f8") + pixelize_cylinder(buff, r, data_source['pdy'], + px, pdx, data_source[field], bounds) if do_transpose: buff = buff.transpose() return buff @@ -341,7 +343,7 @@ rax = self.axis_id[self.radial_axis] outer_radius = data.ds.domain_right_edge[rax] return -1.0 * data["depth"] + outer_radius - registry.add_field(("index", "r"), + registry.add_field(("index", "r"), sampling_type="cell", function=_depth_to_radius, units = "code_length") registry.alias(("index", "dr"), ("index", "ddepth")) diff -Nru yt-3.3.3/yt/geometry/coordinates/spec_cube_coordinates.py yt-3.4.0/yt/geometry/coordinates/spec_cube_coordinates.py --- yt-3.3.3/yt/geometry/coordinates/spec_cube_coordinates.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/coordinates/spec_cube_coordinates.py 2017-08-10 18:02:57.000000000 +0000 @@ -67,14 +67,14 @@ rv[:] = 1.0 return rv return _length_func - registry.add_field(("index", "d%s" % ax), function = f1, + registry.add_field(("index", "d%s" % ax), sampling_type="cell", function = f1, display_field = False, units = "code_length") - registry.add_field(("index", "path_element_%s" % ax), + registry.add_field(("index", "path_element_%s" % ax), sampling_type="cell", function = _get_length_func(), display_field = False, units = "") - registry.add_field(("index", "%s" % ax), function = f2, + registry.add_field(("index", "%s" % ax), sampling_type="cell", function = f2, display_field = False, units = "code_length") def _cell_volume(field, data): @@ -82,7 +82,7 @@ rv *= data["index", "dy"] rv *= data["index", "dz"] return rv - registry.add_field(("index", "cell_volume"), function=_cell_volume, + registry.add_field(("index", "cell_volume"), sampling_type="cell", function=_cell_volume, display_field=False, units = "code_length**3") registry.check_derived_fields( [("index", "dx"), ("index", "dy"), ("index", "dz"), diff -Nru yt-3.3.3/yt/geometry/coordinates/spherical_coordinates.py yt-3.4.0/yt/geometry/coordinates/spherical_coordinates.py --- yt-3.3.3/yt/geometry/coordinates/spherical_coordinates.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/coordinates/spherical_coordinates.py 2017-08-10 18:02:57.000000000 +0000 @@ -35,57 +35,59 @@ def setup_fields(self, registry): # return the fields for r, z, theta - registry.add_field(("index", "dx"), function=_unknown_coord) - registry.add_field(("index", "dy"), function=_unknown_coord) - registry.add_field(("index", "dz"), function=_unknown_coord) - registry.add_field(("index", "x"), function=_unknown_coord) - registry.add_field(("index", "y"), function=_unknown_coord) - registry.add_field(("index", "z"), function=_unknown_coord) + registry.add_field(("index", "dx"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "dy"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "dz"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "x"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "y"), sampling_type="cell", function=_unknown_coord) + registry.add_field(("index", "z"), sampling_type="cell", function=_unknown_coord) f1, f2 = _get_coord_fields(self.axis_id['r']) - registry.add_field(("index", "dr"), function = f1, + registry.add_field(("index", "dr"), sampling_type="cell", function = f1, display_field = False, units = "code_length") - registry.add_field(("index", "r"), function = f2, + registry.add_field(("index", "r"), sampling_type="cell", function = f2, display_field = False, units = "code_length") f1, f2 = _get_coord_fields(self.axis_id['theta'], "") - registry.add_field(("index", "dtheta"), function = f1, + registry.add_field(("index", "dtheta"), sampling_type="cell", function = f1, display_field = False, units = "") - registry.add_field(("index", "theta"), function = f2, + registry.add_field(("index", "theta"), sampling_type="cell", function = f2, display_field = False, units = "") f1, f2 = _get_coord_fields(self.axis_id['phi'], "") - registry.add_field(("index", "dphi"), function = f1, + registry.add_field(("index", "dphi"), sampling_type="cell", function = f1, display_field = False, units = "") - registry.add_field(("index", "phi"), function = f2, + registry.add_field(("index", "phi"), sampling_type="cell", function = f2, display_field = False, units = "") def _SphericalVolume(field, data): - # r**2 sin theta dr dtheta dphi - vol = data["index", "r"]**2.0 - vol *= data["index", "dr"] - vol *= np.sin(data["index", "theta"]) - vol *= data["index", "dtheta"] + # Here we compute the spherical volume element exactly + r = data["index", "r"] + dr = data["index", "dr"] + theta = data["index", "theta"] + dtheta = data["index", "dtheta"] + vol = ((r+0.5*dr)**3-(r-0.5*dr)**3)/3.0 + vol *= np.cos(theta-0.5*dtheta)-np.cos(theta+0.5*dtheta) vol *= data["index", "dphi"] return vol - registry.add_field(("index", "cell_volume"), + registry.add_field(("index", "cell_volume"), sampling_type="cell", function=_SphericalVolume, units = "code_length**3") def _path_r(field, data): return data["index", "dr"] - registry.add_field(("index", "path_element_r"), + registry.add_field(("index", "path_element_r"), sampling_type="cell", function = _path_r, units = "code_length") def _path_theta(field, data): # Note: this already assumes cell-centered return data["index", "r"] * data["index", "dtheta"] - registry.add_field(("index", "path_element_theta"), + registry.add_field(("index", "path_element_theta"), sampling_type="cell", function = _path_theta, units = "code_length") def _path_phi(field, data): @@ -93,7 +95,7 @@ return data["index", "r"] \ * data["index", "dphi"] \ * np.sin(data["index", "theta"]) - registry.add_field(("index", "path_element_phi"), + registry.add_field(("index", "path_element_phi"), sampling_type="cell", function = _path_phi, units = "code_length") @@ -123,19 +125,22 @@ def _cyl_pixelize(self, data_source, field, bounds, size, antialias, dimension): name = self.axis_name[dimension] + buff = np.zeros((size[1], size[0]), dtype="f8") if name == 'theta': - buff = pixelize_cylinder(data_source['px'], - data_source['pdx'], - data_source['py'], - data_source['pdy'], - size, data_source[field], bounds) + pixelize_cylinder(buff, + data_source['px'], + data_source['pdx'], + data_source['py'], + data_source['pdy'], + data_source[field], bounds) elif name == 'phi': - buff = pixelize_cylinder(data_source['px'], - data_source['pdx'], - data_source['py'], - data_source['pdy'], - size, data_source[field], bounds) - buff = buff.transpose() + # Note that we feed in buff.T here + pixelize_cylinder(buff.T, + data_source['px'], + data_source['pdx'], + data_source['py'], + data_source['pdy'], + data_source[field], bounds) else: raise RuntimeError return buff diff -Nru yt-3.3.3/yt/geometry/coordinates/tests/test_axial_pixelization.py yt-3.4.0/yt/geometry/coordinates/tests/test_axial_pixelization.py --- yt-3.3.3/yt/geometry/coordinates/tests/test_axial_pixelization.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/geometry/coordinates/tests/test_axial_pixelization.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,9 @@ +from yt.testing import \ + fake_amr_ds, _geom_transforms +from yt.utilities.answer_testing.framework import \ + AxialPixelizationTest + +def test_axial_pixelization(): + for geom in sorted(_geom_transforms): + ds = fake_amr_ds(geometry=geom) + yield AxialPixelizationTest(ds) diff -Nru yt-3.3.3/yt/geometry/coordinates/tests/test_cartesian_coordinates.py yt-3.4.0/yt/geometry/coordinates/tests/test_cartesian_coordinates.py --- yt-3.3.3/yt/geometry/coordinates/tests/test_cartesian_coordinates.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/coordinates/tests/test_cartesian_coordinates.py 2017-08-10 18:02:57.000000000 +0000 @@ -21,11 +21,10 @@ fd = ("index", "d%s" % axis) fp = ("index", "path_element_%s" % axis) ma = np.argmax(dd[fi]) - yield assert_equal, dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i] + assert_equal(dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i]) mi = np.argmin(dd[fi]) - yield assert_equal, dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i] - yield assert_equal, dd[fd].min(), ds.index.get_smallest_dx() - yield assert_equal, dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i] - yield assert_equal, dd[fd], dd[fp] - yield assert_equal, dd["cell_volume"].sum(dtype="float64"), \ - ds.domain_width.prod() + assert_equal(dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i]) + assert_equal(dd[fd].min(), ds.index.get_smallest_dx()) + assert_equal(dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i]) + assert_equal(dd[fd], dd[fp]) + assert_equal(dd["cell_volume"].sum(dtype="float64"), ds.domain_width.prod()) diff -Nru yt-3.3.3/yt/geometry/coordinates/tests/test_cylindrical_coordinates.py yt-3.4.0/yt/geometry/coordinates/tests/test_cylindrical_coordinates.py --- yt-3.3.3/yt/geometry/coordinates/tests/test_cylindrical_coordinates.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/coordinates/tests/test_cylindrical_coordinates.py 2017-08-10 18:02:57.000000000 +0000 @@ -20,13 +20,13 @@ fi = ("index", axis) fd = ("index", "d%s" % axis) ma = np.argmax(dd[fi]) - yield assert_equal, dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i].d + assert_equal(dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i].d) mi = np.argmin(dd[fi]) - yield assert_equal, dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i].d - yield assert_equal, dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i].d - yield assert_almost_equal, dd["cell_volume"].sum(dtype="float64"), \ - np.pi*ds.domain_width[0]**2 * ds.domain_width[1] - yield assert_equal, dd["index", "path_element_r"], dd["index", "dr"] - yield assert_equal, dd["index", "path_element_z"], dd["index", "dz"] - yield assert_equal, dd["index", "path_element_theta"], \ - dd["index", "r"] * dd["index", "dtheta"] + assert_equal(dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i].d) + assert_equal(dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i].d) + assert_almost_equal(dd["cell_volume"].sum(dtype="float64"), + np.pi*ds.domain_width[0]**2 * ds.domain_width[1]) + assert_equal(dd["index", "path_element_r"], dd["index", "dr"]) + assert_equal(dd["index", "path_element_z"], dd["index", "dz"]) + assert_equal(dd["index", "path_element_theta"], + dd["index", "r"] * dd["index", "dtheta"]) diff -Nru yt-3.3.3/yt/geometry/coordinates/tests/test_geographic_coordinates.py yt-3.4.0/yt/geometry/coordinates/tests/test_geographic_coordinates.py --- yt-3.3.3/yt/geometry/coordinates/tests/test_geographic_coordinates.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/coordinates/tests/test_geographic_coordinates.py 2017-08-10 18:02:57.000000000 +0000 @@ -25,35 +25,27 @@ fi = ("index", axis) fd = ("index", "d%s" % axis) ma = np.argmax(dd[fi]) - yield assert_equal, dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i].d + assert_equal(dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i].d) mi = np.argmin(dd[fi]) - yield assert_equal, dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i].d - yield assert_equal, dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i].d + assert_equal(dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i].d) + assert_equal(dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i].d) inner_r = ds.surface_height outer_r = ds.surface_height + ds.domain_width[2] - yield assert_equal, dd["index","dtheta"], \ - dd["index","dlatitude"]*np.pi/180.0 - yield assert_equal, dd["index","dphi"], \ - dd["index","dlongitude"]*np.pi/180.0 + assert_equal(dd["index","dtheta"], dd["index","dlatitude"]*np.pi/180.0) + assert_equal(dd["index","dphi"], dd["index","dlongitude"]*np.pi/180.0) # Note our terrible agreement here. - yield assert_rel_equal, dd["cell_volume"].sum(dtype="float64"), \ - (4.0/3.0) * np.pi * (outer_r**3 - inner_r**3), \ - 3 - yield assert_equal, dd["index", "path_element_altitude"], \ - dd["index", "daltitude"] - yield assert_equal, dd["index", "path_element_altitude"], \ - dd["index", "dr"] + assert_rel_equal(dd["cell_volume"].sum(dtype="float64"), + (4.0/3.0) * np.pi * (outer_r**3 - inner_r**3), 3) + assert_equal(dd["index", "path_element_altitude"], dd["index", "daltitude"]) + assert_equal(dd["index", "path_element_altitude"], dd["index", "dr"]) # Note that latitude corresponds to theta, longitude to phi - yield assert_equal, dd["index", "path_element_latitude"], \ - dd["index", "r"] * \ - dd["index", "dlatitude"] * np.pi/180.0 - yield assert_equal, dd["index", "path_element_longitude"], \ - dd["index", "r"] * \ - dd["index", "dlongitude"] * np.pi/180.0 * \ - np.sin((dd["index", "latitude"] + 90.0) * np.pi/180.0) + assert_equal(dd["index", "path_element_latitude"], + dd["index", "r"] * dd["index", "dlatitude"] * np.pi/180.0) + assert_equal(dd["index", "path_element_longitude"], + (dd["index", "r"] * dd["index", "dlongitude"] * np.pi/180.0 * + np.sin((dd["index", "latitude"] + 90.0) * np.pi/180.0))) # We also want to check that our radius is correct - yield assert_equal, dd["index","r"], \ - dd["index","altitude"] + ds.surface_height + assert_equal(dd["index","r"], dd["index","altitude"] + ds.surface_height) def test_internal_geographic_coordinates(): # We're going to load up a simple AMR grid and check its volume @@ -70,32 +62,23 @@ fi = ("index", axis) fd = ("index", "d%s" % axis) ma = np.argmax(dd[fi]) - yield assert_equal, dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i].d + assert_equal(dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i].d) mi = np.argmin(dd[fi]) - yield assert_equal, dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i].d - yield assert_equal, dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i].d + assert_equal(dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i].d) + assert_equal(dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i].d) inner_r = ds.outer_radius - ds.domain_right_edge[2] outer_r = ds.outer_radius - yield assert_equal, dd["index","dtheta"], \ - dd["index","dlatitude"]*np.pi/180.0 - yield assert_equal, dd["index","dphi"], \ - dd["index","dlongitude"]*np.pi/180.0 - # Note our terrible agreement here. - yield assert_rel_equal, dd["cell_volume"].sum(dtype="float64"), \ - (4.0/3.0) * np.pi * (outer_r**3 - inner_r**3), \ - 3 - yield assert_equal, dd["index", "path_element_depth"], \ - dd["index", "ddepth"] - yield assert_equal, dd["index", "path_element_depth"], \ - dd["index", "dr"] + assert_equal(dd["index","dtheta"], dd["index","dlatitude"]*np.pi/180.0) + assert_equal(dd["index","dphi"], dd["index","dlongitude"]*np.pi/180.0) + assert_rel_equal(dd["cell_volume"].sum(dtype="float64"), + (4.0/3.0) * np.pi * (outer_r**3 - inner_r**3), 10) + assert_equal(dd["index", "path_element_depth"], dd["index", "ddepth"]) + assert_equal(dd["index", "path_element_depth"], dd["index", "dr"]) # Note that latitude corresponds to theta, longitude to phi - yield assert_equal, dd["index", "path_element_latitude"], \ - dd["index", "r"] * \ - dd["index", "dlatitude"] * np.pi/180.0 - yield assert_equal, dd["index", "path_element_longitude"], \ - dd["index", "r"] * \ - dd["index", "dlongitude"] * np.pi/180.0 * \ - np.sin((dd["index", "latitude"] + 90.0) * np.pi/180.0) + assert_equal(dd["index", "path_element_latitude"], + dd["index", "r"] * dd["index", "dlatitude"] * np.pi/180.0) + assert_equal(dd["index", "path_element_longitude"], + (dd["index", "r"] * dd["index", "dlongitude"] * np.pi/180.0 * + np.sin((dd["index", "latitude"] + 90.0) * np.pi/180.0))) # We also want to check that our radius is correct - yield assert_equal, dd["index","r"], \ - -1.0*dd["index","depth"] + ds.outer_radius + assert_equal(dd["index","r"], -1.0*dd["index","depth"] + ds.outer_radius) diff -Nru yt-3.3.3/yt/geometry/coordinates/tests/test_polar_coordinates.py yt-3.4.0/yt/geometry/coordinates/tests/test_polar_coordinates.py --- yt-3.3.3/yt/geometry/coordinates/tests/test_polar_coordinates.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/coordinates/tests/test_polar_coordinates.py 2017-08-10 18:02:57.000000000 +0000 @@ -21,13 +21,13 @@ fi = ("index", axis) fd = ("index", "d%s" % axis) ma = np.argmax(dd[fi]) - yield assert_equal, dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i].d + assert_equal(dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i].d) mi = np.argmin(dd[fi]) - yield assert_equal, dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i].d - yield assert_equal, dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i].d - yield assert_almost_equal, dd["cell_volume"].sum(dtype="float64"), \ - np.pi*ds.domain_width[0]**2 * ds.domain_width[2] - yield assert_equal, dd["index", "path_element_r"], dd["index", "dr"] - yield assert_equal, dd["index", "path_element_z"], dd["index", "dz"] - yield assert_equal, dd["index", "path_element_theta"], \ - dd["index", "r"] * dd["index", "dtheta"] + assert_equal(dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i].d) + assert_equal(dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i].d) + assert_almost_equal(dd["cell_volume"].sum(dtype="float64"), + np.pi*ds.domain_width[0]**2 * ds.domain_width[2]) + assert_equal(dd["index", "path_element_r"], dd["index", "dr"]) + assert_equal(dd["index", "path_element_z"], dd["index", "dz"]) + assert_equal(dd["index", "path_element_theta"], + dd["index", "r"] * dd["index", "dtheta"]) diff -Nru yt-3.3.3/yt/geometry/coordinates/tests/test_spherical_coordinates.py yt-3.4.0/yt/geometry/coordinates/tests/test_spherical_coordinates.py --- yt-3.3.3/yt/geometry/coordinates/tests/test_spherical_coordinates.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/coordinates/tests/test_spherical_coordinates.py 2017-08-10 18:02:57.000000000 +0000 @@ -20,20 +20,19 @@ fi = ("index", axis) fd = ("index", "d%s" % axis) ma = np.argmax(dd[fi]) - yield assert_equal, dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i].d + assert_equal(dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i].d) mi = np.argmin(dd[fi]) - yield assert_equal, dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i].d - yield assert_equal, dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i].d + assert_equal(dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i].d) + assert_equal(dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i].d) # Note that we're using a lot of funny transforms to get to this, so we do # not expect to get actual agreement. This is a bit of a shame, but I # don't think it is avoidable as of right now. Real datasets will almost # certainly be correct, if this is correct to 3 decimel places. - yield assert_almost_equal, dd["cell_volume"].sum(dtype="float64"), \ - (4.0/3.0) * np.pi*ds.domain_width[0]**3, \ - 3 # Allow for GENEROUS error on the volume ... - yield assert_equal, dd["index", "path_element_r"], dd["index", "dr"] - yield assert_equal, dd["index", "path_element_theta"], \ - dd["index", "r"] * dd["index", "dtheta"] - yield assert_equal, dd["index", "path_element_phi"], \ - dd["index", "r"] * dd["index", "dphi"] * \ - np.sin(dd["index","theta"]) + assert_almost_equal(dd["cell_volume"].sum(dtype="float64"), + (4.0/3.0) * np.pi*ds.domain_width[0]**3) + assert_equal(dd["index", "path_element_r"], dd["index", "dr"]) + assert_equal(dd["index", "path_element_theta"], + dd["index", "r"] * dd["index", "dtheta"]) + assert_equal(dd["index", "path_element_phi"], + (dd["index", "r"] * dd["index", "dphi"] * + np.sin(dd["index","theta"]))) diff -Nru yt-3.3.3/yt/geometry/fake_octree.c yt-3.4.0/yt/geometry/fake_octree.c --- yt-3.3.3/yt/geometry/fake_octree.c 2016-12-12 01:41:21.000000000 +0000 +++ yt-3.4.0/yt/geometry/fake_octree.c 2017-08-10 18:20:05.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -11,6 +11,10 @@ ], "libraries": [ "m" + ], + "name": "yt.geometry.fake_octree", + "sources": [ + "yt/geometry/fake_octree.pyx" ] }, "module_name": "yt.geometry.fake_octree" @@ -24,7 +28,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -46,6 +50,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -198,16 +203,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -334,6 +343,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -388,6 +403,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -499,8 +543,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -513,8 +557,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -636,10 +683,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -678,6 +727,7 @@ "stringsource", "type.pxd", "yt/geometry/oct_visitors.pxd", + "yt/utilities/lib/allocation_container.pxd", "yt/geometry/oct_container.pxd", }; /* BufferFormatStructs.proto */ @@ -1012,6 +1062,9 @@ struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject; struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector; +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool; +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool; struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer; @@ -1125,7 +1178,7 @@ __pyx_t_5numpy_float64_t right_edge_x; __pyx_t_5numpy_float64_t right_edge_y; __pyx_t_5numpy_float64_t right_edge_z; - __pyx_t_5numpy_int64_t children_pointers; + __pyx_t_5numpy_int_t children_pointers; __pyx_t_5numpy_int64_t start_index_x; __pyx_t_5numpy_int64_t start_index_y; __pyx_t_5numpy_int64_t start_index_z; @@ -1167,7 +1220,7 @@ struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid; struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells; -/* "selection_routines.pxd":42 +/* "selection_routines.pxd":38 * cdef np.int64_t _hash * * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -1179,7 +1232,7 @@ int visit_covered; }; -/* "selection_routines.pxd":50 +/* "selection_routines.pxd":46 * np.float64_t spos[3], np.float64_t sdds[3], * OctVisitor visitor, int i, int j, int k) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1191,7 +1244,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "selection_routines.pxd":65 +/* "selection_routines.pxd":61 * np.ndarray[np.uint8_t, ndim=3] mask, * int level) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -1202,14 +1255,43 @@ int __pyx_n; __pyx_t_5numpy_uint8_t *cached_mask; }; +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer; +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs; + +/* "yt/utilities/lib/allocation_container.pxd":19 + * from libc.stdlib cimport malloc, free, realloc + * + * cdef struct AllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + void *my_objs; +}; + +/* "yt/utilities/lib/allocation_container.pxd":30 + * cdef np.uint64_t n_con + * cdef AllocationContainer* containers + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except * # <<<<<<<<<<<<<< + * cdef void setup_objs(self, void *obj, np.uint64_t count, + * np.uint64_t offset, np.int64_t con_id) + */ +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs { + int __pyx_n; + __pyx_t_5numpy_int64_t con_id; +}; struct __pyx_t_2yt_8geometry_13oct_container_OctKey; struct __pyx_t_2yt_8geometry_13oct_container_OctInfo; -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_t_2yt_8geometry_13oct_container_OctList; +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs; -/* "oct_container.pxd":28 +/* "oct_container.pxd":30 * cdef int ORDER_MAX * * cdef struct OctKey: # <<<<<<<<<<<<<< @@ -1221,7 +1303,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node; }; -/* "oct_container.pxd":32 +/* "oct_container.pxd":34 * Oct *node * * cdef struct OctInfo: # <<<<<<<<<<<<<< @@ -1235,25 +1317,9 @@ __pyx_t_5numpy_int32_t level; }; -/* "oct_container.pxd":38 +/* "oct_container.pxd":40 * np.int32_t level * - * cdef struct OctAllocationContainer # <<<<<<<<<<<<<< - * cdef struct OctAllocationContainer: - * np.int64_t n - */ -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { - __pyx_t_5numpy_int64_t n; - __pyx_t_5numpy_int64_t n_assigned; - __pyx_t_5numpy_int64_t offset; - __pyx_t_5numpy_int64_t con_id; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *next; - struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_octs; -}; - -/* "oct_container.pxd":47 - * Oct *my_octs - * * cdef struct OctList # <<<<<<<<<<<<<< * * cdef struct OctList: @@ -1263,7 +1329,22 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "oct_container.pxd":69 +/* "oct_container.pxd":48 + * # NOTE: This object *has* to be the same size as the AllocationContainer + * # object. There's an assert in the __cinit__ function. + * cdef struct OctAllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs; +}; + +/* "oct_container.pxd":74 * cdef public np.int64_t nocts * cdef public int num_domains * cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?, # <<<<<<<<<<<<<< @@ -1276,8 +1357,8 @@ int max_level; }; -/* "oct_container.pxd":78 - * # OctAllocationContainer.offset if such a thing exists. +/* "oct_container.pxd":83 + * # AllocationContainer.offset if such a thing exists. * cdef np.int64_t get_domain_offset(self, int domain_id) * cdef void visit_all_octs(self, # <<<<<<<<<<<<<< * selection_routines.SelectorObject selector, @@ -1546,12 +1627,12 @@ struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base; __Pyx_memviewslice ref_mask; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs; - __pyx_t_5numpy_int64_t *nocts; - __pyx_t_5numpy_int64_t *nfinest; + __pyx_t_5numpy_uint64_t *nocts; + __pyx_t_5numpy_uint64_t *nfinest; }; -/* "selection_routines.pxd":33 +/* "selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1571,7 +1652,7 @@ }; -/* "selection_routines.pxd":71 +/* "selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1583,7 +1664,7 @@ }; -/* "selection_routines.pxd":74 +/* "selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1597,18 +1678,59 @@ }; -/* "oct_container.pxd":57 +/* "selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2; +}; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool { + PyObject_HEAD + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab; + __pyx_t_5numpy_uint64_t itemsize; + __pyx_t_5numpy_uint64_t n_con; + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers; +}; + + +/* "oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; +}; + + +/* "oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer { PyObject_HEAD struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *cont; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer **domains; + struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh; int partial_coverage; int level_offset; @@ -1622,7 +1744,7 @@ }; -/* "oct_container.pxd":89 +/* "oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -1638,7 +1760,7 @@ }; -/* "oct_container.pxd":97 +/* "oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -1998,7 +2120,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree; -/* "selection_routines.pxd":33 +/* "selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -2021,7 +2143,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; -/* "selection_routines.pxd":71 +/* "selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2035,7 +2157,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; -/* "selection_routines.pxd":74 +/* "selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2049,12 +2171,58 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; -/* "oct_container.pxd":57 +/* "selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool { + void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args); + void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); + void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + + +/* "oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ + +struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); +}; +static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool; +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); + + +/* "oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer { @@ -2071,7 +2239,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer; -/* "oct_container.pxd":89 +/* "oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -2087,7 +2255,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer; -/* "oct_container.pxd":97 +/* "oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -2254,7 +2422,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* BufferIndexError.proto */ static void __Pyx_RaiseBufferIndexError(int axis); @@ -2302,6 +2470,28 @@ /* BufferFallbackError.proto */ static void __Pyx_RaiseBufferFallbackError(void); +/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; @@ -2331,6 +2521,12 @@ int lineno, const char *filename, int full_traceback, int nogil); +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* IncludeStringH.proto */ #include @@ -2416,8 +2612,19 @@ 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 *); +/* 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( @@ -2425,6 +2632,9 @@ 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) @@ -2436,28 +2646,6 @@ /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); -/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS @@ -2522,15 +2710,31 @@ #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() + /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -2580,9 +2784,6 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); - /* Print.proto */ static int __Pyx_Print(PyObject*, PyObject *, int); #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 @@ -2591,6 +2792,9 @@ #endif /* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +/* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* MemviewSliceIsContig.proto */ @@ -2775,6 +2979,7 @@ /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ @@ -2854,10 +3059,15 @@ static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0; /* Module declarations from 'libc.math' */ +/* Module declarations from 'yt.utilities.lib.allocation_container' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0; + /* Module declarations from 'yt.geometry.oct_container' */ +static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0; @@ -2909,6 +3119,7 @@ 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_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; @@ -2922,8 +3133,8 @@ static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; -static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_O[] = "O"; @@ -2937,8 +3148,10 @@ static const char __pyx_k_end[] = "end"; static const char __pyx_k_ind[] = "ind"; static const char __pyx_k_ndd[] = "ndd"; +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_file[] = "file"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mask[] = "mask"; @@ -2969,32 +3182,46 @@ static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_parent[] = "parent"; +static const char __pyx_k_pickle[] = "pickle"; +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_fortran[] = "fortran"; static const char __pyx_k_memview[] = "memview"; static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_cur_leaf[] = "cur_leaf"; static const char __pyx_k_itemsize[] = "itemsize"; static const char __pyx_k_max_noct[] = "max_noct"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_max_level[] = "max_level"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_fsubdivide[] = "fsubdivide"; +static const char __pyx_k_n_assigned[] = "n_assigned"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_root_nocts[] = "root: nocts "; 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_code_length[] = "code_length"; static const char __pyx_k_oct_handler[] = "oct_handler"; 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_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_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_allocate_domains[] = "allocate_domains"; static const char __pyx_k_convert_to_units[] = "convert_to_units"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_create_fake_octree[] = "create_fake_octree"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_strided_and_indirect[] = ""; @@ -3007,8 +3234,8 @@ 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_yt_geometry_fake_octree_pyx[] = "yt/geometry/fake_octree.pyx"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/geometry/fake_octree.pyx"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_Make_a_fake_octree_deposit_part[] = "\nMake a fake octree, deposit particle at every leaf\n\n\n\n\n"; static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; @@ -3017,6 +3244,7 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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"; @@ -3024,6 +3252,7 @@ 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."; @@ -3036,6 +3265,7 @@ 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; @@ -3046,11 +3276,12 @@ 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_n_s_RuntimeError; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_allocate_domains; static PyObject *__pyx_n_s_base; @@ -3058,6 +3289,7 @@ static PyObject *__pyx_n_u_c; static PyObject *__pyx_n_s_child; static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_code_length; static PyObject *__pyx_kp_s_contiguous_and_direct; static PyObject *__pyx_kp_s_contiguous_and_indirect; @@ -3065,6 +3297,7 @@ static PyObject *__pyx_n_s_create_fake_octree; static PyObject *__pyx_n_s_cur_leaf; static PyObject *__pyx_n_s_dd; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dle; static PyObject *__pyx_n_s_dre; static PyObject *__pyx_n_s_dtype; @@ -3092,12 +3325,15 @@ static PyObject *__pyx_n_s_max_noct; static PyObject *__pyx_n_s_memview; static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_n_assigned; 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_ndd; 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; @@ -3107,11 +3343,19 @@ static PyObject *__pyx_n_s_ones; static PyObject *__pyx_n_s_pack; static PyObject *__pyx_n_s_parent; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_cython; +static PyObject *__pyx_n_s_result; static PyObject *__pyx_kp_s_root_nocts; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_start; @@ -3120,6 +3364,7 @@ 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_uint8; @@ -3128,7 +3373,9 @@ static PyObject *__pyx_n_s_units; 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_yt_geometry_fake_octree; +static PyObject *__pyx_kp_s_yt_geometry_fake_octree_pyx; static PyObject *__pyx_pf_2yt_8geometry_11fake_octree_create_fake_octree(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_v_oct_handler, long __pyx_v_max_noct, long __pyx_v_max_level, PyArrayObject *__pyx_v_ndd, CYTHON_UNUSED PyArrayObject *__pyx_v_dle, CYTHON_UNUSED PyArrayObject *__pyx_v_dre, float __pyx_v_fsubdivide); /* 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 */ @@ -3139,8 +3386,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -3162,8 +3413,13 @@ 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*/ @@ -3171,6 +3427,7 @@ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_8; +static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; @@ -3181,9 +3438,9 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__20; -static PyObject *__pyx_slice__21; -static PyObject *__pyx_slice__22; +static PyObject *__pyx_slice__24; +static PyObject *__pyx_slice__25; +static PyObject *__pyx_slice__26; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -3194,14 +3451,22 @@ 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__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; -static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_codeobj__31; +static PyObject *__pyx_codeobj__38; /* "yt/geometry/fake_octree.pyx":27 * # Create a balanced octree by a random walk that recursively @@ -3233,12 +3498,19 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -3247,31 +3519,37 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oct_handler)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_noct)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("create_fake_octree", 1, 7, 7, 1); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_level)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("create_fake_octree", 1, 7, 7, 2); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ndd)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("create_fake_octree", 1, 7, 7, 3); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dle)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("create_fake_octree", 1, 7, 7, 4); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dre)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("create_fake_octree", 1, 7, 7, 5); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fsubdivide)) != 0)) kw_args--; else { @@ -3590,7 +3868,18 @@ * cur_leaf = subdivide(oct_handler, parent, ind, dd, cur_leaf, 0, */ while (1) { - __pyx_t_13 = (((__pyx_v_oct_handler->__pyx_base.__pyx_base.domains[0])->n_assigned < __pyx_v_max_noct) != 0); + __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_oct_handler->__pyx_base.__pyx_base.domains), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_n_assigned); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_max_noct); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_13) break; /* "yt/geometry/fake_octree.pyx":48 @@ -3600,18 +3889,21 @@ * cur_leaf = subdivide(oct_handler, parent, ind, dd, cur_leaf, 0, * max_noct, max_level, fsubdivide, mask) */ - __pyx_t_7 = __Pyx_PyInt_From_npy_int64((__pyx_v_oct_handler->__pyx_base.__pyx_base.domains[0])->n_assigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_oct_handler->__pyx_base.__pyx_base.domains), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_n_assigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_root_nocts); __Pyx_GIVEREF(__pyx_kp_s_root_nocts); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_s_root_nocts); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_root_nocts); __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_Print(0, __pyx_t_8, 1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_Print(0, __pyx_t_4, 1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "yt/geometry/fake_octree.pyx":49 * while oct_handler.domains[0].n_assigned < max_noct: @@ -3631,10 +3923,10 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_cur_leaf); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_cur_leaf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; /* "yt/geometry/fake_octree.pyx":27 @@ -3796,7 +4088,18 @@ * return cur_leaf * for i in range(3): */ - __pyx_t_8 = (((__pyx_v_oct_handler->__pyx_base.__pyx_base.domains[0])->n_assigned >= __pyx_v_max_noct) != 0); + __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_oct_handler->__pyx_base.__pyx_base.domains), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_n_assigned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_max_noct); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_8) { /* "yt/geometry/fake_octree.pyx":68 @@ -3980,7 +4283,7 @@ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.geometry.fake_octree.subdivide", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.fake_octree.subdivide", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; goto __pyx_L2; __pyx_L0:; @@ -3990,6 +4293,43 @@ return __pyx_r; } +/* "oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) + * + */ + +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) { + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_cont", 0); + + /* "oct_container.pxd":57 + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) # <<<<<<<<<<<<<< + * + * cdef OctList *OctList_append(OctList *list, Oct *o) + */ + __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i]))); + goto __pyx_L0; + + /* "oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "oct_visitors.pxd":51 * cdef void visit(self, Oct*, np.uint8_t selected) * @@ -4085,7 +4425,7 @@ } /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -4107,7 +4447,7 @@ goto __pyx_L0; /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -4120,8 +4460,8 @@ return __pyx_r; } -/* "selection_routines.pxd":26 - * np.float64_t +/* "selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< * if hasattr(arr, "units"): @@ -4137,39 +4477,39 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_ensure_code", 0); - /* "selection_routines.pxd":27 + /* "selection_routines.pxd":23 * * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): # <<<<<<<<<<<<<< * if "code_length" == str(arr.units): * return arr */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 23, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "selection_routines.pxd":28 + /* "selection_routines.pxd":24 * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< * return arr * arr.convert_to_units("code_length") */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 28, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 24, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 28, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "selection_routines.pxd":29 + /* "selection_routines.pxd":25 * if hasattr(arr, "units"): * if "code_length" == str(arr.units): * return arr # <<<<<<<<<<<<<< @@ -4181,7 +4521,7 @@ __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "selection_routines.pxd":28 + /* "selection_routines.pxd":24 * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< @@ -4190,21 +4530,21 @@ */ } - /* "selection_routines.pxd":30 + /* "selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 30, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 30, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "selection_routines.pxd":27 + /* "selection_routines.pxd":23 * * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): # <<<<<<<<<<<<<< @@ -4213,7 +4553,7 @@ */ } - /* "selection_routines.pxd":31 + /* "selection_routines.pxd":27 * return arr * arr.convert_to_units("code_length") * return arr # <<<<<<<<<<<<<< @@ -4225,8 +4565,8 @@ __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "selection_routines.pxd":26 - * np.float64_t + /* "selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< * if hasattr(arr, "units"): @@ -4246,7 +4586,7 @@ } /* "selection_routines.pxd":78 - * cdef public np.int64_t domain_id + * cdef public SelectorObject sel2 * * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< * np.float64_t dw, bint periodic) nogil: @@ -4346,7 +4686,7 @@ goto __pyx_L0; /* "selection_routines.pxd":78 - * cdef public np.int64_t domain_id + * cdef public SelectorObject sel2 * * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< * np.float64_t dw, bint periodic) nogil: @@ -4361,18 +4701,18 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":20 * - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -4384,7 +4724,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -4396,7 +4736,7 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ @@ -4436,7 +4776,7 @@ * if f0 > f1: return f0 * return f1 # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ __pyx_r = __pyx_v_f1; goto __pyx_L0; @@ -4457,18 +4797,18 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":28 * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -4480,7 +4820,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -4492,7 +4832,7 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ @@ -4580,7 +4920,7 @@ * if f0 < 0.0: return -f0 * return f0 # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_f0; goto __pyx_L0; @@ -4601,18 +4941,18 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":40 * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -4624,7 +4964,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -4641,7 +4981,7 @@ * if i > b: return b * return i # <<<<<<<<<<<<<< * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_i; goto __pyx_L0; @@ -4649,7 +4989,7 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -4662,18 +5002,18 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -4685,7 +5025,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -4710,7 +5050,7 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -7030,7 +7370,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7078,7 +7418,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -7161,7 +7501,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7209,7 +7549,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -7292,7 +7632,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7337,7 +7677,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -7391,10 +7731,15 @@ 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; } @@ -7403,21 +7748,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(3, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(3, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -7430,7 +7779,9 @@ } 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); @@ -7653,7 +8004,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -8848,54 +9199,161 @@ return __pyx_r; } -/* "View.MemoryView":240 - * - * @cname("__pyx_array_new") - * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< - * char *mode, char *buf): - * cdef array result +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -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; +/* 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 - 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); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self)); - /* "View.MemoryView":244 - * cdef array result - * - * if buf == NULL: # <<<<<<<<<<<<<< - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: + /* 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_v_buf == NULL) != 0); - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 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(3, 2, __pyx_L1_error) - /* "View.MemoryView":245 - * - * if buf == NULL: - * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< - * else: - * result = array(shape, itemsize, format, mode.decode('ASCII'), + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 245, __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); + + /* 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__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 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(3, 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":240 + * + * @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":244 + * 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":245 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 245, __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); @@ -9043,6 +9501,7 @@ 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; } @@ -9162,6 +9621,293 @@ 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(3, 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(3, 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(3, 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(3, 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(3, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 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(3, 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(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 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(3, 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(3, 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(3, 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":294 * * @cname('__pyx_align_pointer') @@ -9270,8 +10016,11 @@ 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; } @@ -9280,11 +10029,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(3, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -9297,6 +10048,7 @@ } 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; @@ -10429,7 +11181,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -10489,7 +11241,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -11179,7 +11931,7 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -12020,7 +12772,7 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12134,7 +12886,7 @@ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__19, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__21, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -13110,31 +13862,138 @@ return __pyx_r; } -/* "View.MemoryView":643 - * - * @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 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -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; +/* 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; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "View.MemoryView":644 - * @cname('__pyx_memoryview_new') - * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): - * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< - * result.typeinfo = typeinfo - * return result + /* "(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_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 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(3, 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__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 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(3, 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":643 + * + * @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":644 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -13438,9 +14297,9 @@ __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__20); - __Pyx_GIVEREF(__pyx_slice__20); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__20); + __Pyx_INCREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__24); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) @@ -13473,7 +14332,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__21); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__25); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 671, __pyx_L1_error) } __pyx_L7:; @@ -13618,9 +14477,9 @@ __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__22); - __Pyx_GIVEREF(__pyx_slice__22); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__22); + __Pyx_INCREF(__pyx_slice__26); + __Pyx_GIVEREF(__pyx_slice__26); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__26); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 682, __pyx_L1_error) @@ -13744,7 +14603,7 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -15127,11 +15986,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -15612,11 +16471,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -15884,6 +16743,113 @@ 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__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 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(3, 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__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 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(3, 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":985 * * @cname('__pyx_memoryview_fromslice') @@ -16328,7 +17294,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -17585,11 +18551,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -17613,7 +18579,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -17682,7 +18648,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -17704,7 +18670,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -17795,7 +18761,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -17818,7 +18784,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -17934,7 +18900,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -18501,11 +19467,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -18685,7 +19651,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -18709,7 +19675,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -19018,83 +19984,548 @@ /* function exit code */ } -static struct __pyx_vtabstruct_array __pyx_vtable_array; -static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_array_obj *p; - 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; -} +/* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ -static void __pyx_tp_dealloc_array(PyObject *o) { - struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif +/* 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); { - 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_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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(3, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(3, 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(3, 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(3, 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(3, 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); -static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { - PyObject *v = PyObject_GenericGetAttr(o, n); - if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - v = __pyx_array___getattr__(o, n); - } - return v; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -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 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_PickleError = NULL; + PyObject *__pyx_v_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); -static PyMethodDef __pyx_methods_array[] = { - {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, - {0, 0, 0, 0} -}; + /* "(tree fragment)":2 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 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(3, 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(3, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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(3, 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(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_PickleError); + __pyx_t_2 = __pyx_v_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(3, 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(3, 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(3, 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(3, 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(3, 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(3, 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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 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(3, 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(3, 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(3, 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(3, 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(3, 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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(3, 7, __pyx_L1_error) + __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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(3, 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(3, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(3, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(3, 12, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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 PY_VERSION_HEX >= 0x030400a1 + 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 = 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}, @@ -19212,7 +20643,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -19240,6 +20671,8 @@ } 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} }; @@ -19327,7 +20760,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -19439,6 +20872,8 @@ {"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} }; @@ -19564,7 +20999,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -19608,6 +21043,8 @@ } 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} }; @@ -19714,6 +21151,7 @@ {&__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}, @@ -19724,11 +21162,12 @@ {&__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_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_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 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_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_allocate_domains, __pyx_k_allocate_domains, sizeof(__pyx_k_allocate_domains), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, @@ -19736,6 +21175,7 @@ {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, {&__pyx_n_s_child, __pyx_k_child, sizeof(__pyx_k_child), 0, 0, 1, 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_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 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}, @@ -19743,6 +21183,7 @@ {&__pyx_n_s_create_fake_octree, __pyx_k_create_fake_octree, sizeof(__pyx_k_create_fake_octree), 0, 0, 1, 1}, {&__pyx_n_s_cur_leaf, __pyx_k_cur_leaf, sizeof(__pyx_k_cur_leaf), 0, 0, 1, 1}, {&__pyx_n_s_dd, __pyx_k_dd, sizeof(__pyx_k_dd), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dle, __pyx_k_dle, sizeof(__pyx_k_dle), 0, 0, 1, 1}, {&__pyx_n_s_dre, __pyx_k_dre, sizeof(__pyx_k_dre), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, @@ -19770,12 +21211,15 @@ {&__pyx_n_s_max_noct, __pyx_k_max_noct, sizeof(__pyx_k_max_noct), 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_assigned, __pyx_k_n_assigned, sizeof(__pyx_k_n_assigned), 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_ndd, __pyx_k_ndd, sizeof(__pyx_k_ndd), 0, 0, 1, 1}, {&__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}, @@ -19785,11 +21229,19 @@ {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 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_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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_kp_s_root_nocts, __pyx_k_root_nocts, sizeof(__pyx_k_root_nocts), 0, 0, 1, 0}, + {&__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_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, @@ -19798,6 +21250,7 @@ {&__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_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, @@ -19806,7 +21259,9 @@ {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 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_yt_geometry_fake_octree, __pyx_k_yt_geometry_fake_octree, sizeof(__pyx_k_yt_geometry_fake_octree), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_geometry_fake_octree_pyx, __pyx_k_yt_geometry_fake_octree_pyx, sizeof(__pyx_k_yt_geometry_fake_octree_pyx), 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { @@ -19816,8 +21271,8 @@ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 146, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(3, 149, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(3, 2, __pyx_L1_error) __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(3, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(3, 425, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(3, 599, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(3, 818, __pyx_L1_error) return 0; @@ -19829,14 +21284,14 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "selection_routines.pxd":30 + /* "selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 30, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); @@ -20003,6 +21458,25 @@ __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); + /* "(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__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "(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__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: @@ -20010,9 +21484,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -20021,9 +21495,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "View.MemoryView":563 * def suboffsets(self): @@ -20032,12 +21506,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__19 = PyTuple_New(1); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); + __pyx_tuple__21 = PyTuple_New(1); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(3, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__19, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__19); + PyTuple_SET_ITEM(__pyx_tuple__21, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "(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__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "(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__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "View.MemoryView":668 * if item is Ellipsis: @@ -20046,9 +21539,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__20 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(3, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); + __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(3, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); /* "View.MemoryView":671 * seen_ellipsis = True @@ -20057,9 +21550,9 @@ * have_slices = True * else: */ - __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(3, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__21); - __Pyx_GIVEREF(__pyx_slice__21); + __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(3, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -20068,9 +21561,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(3, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__22); - __Pyx_GIVEREF(__pyx_slice__22); + __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(3, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__26); + __Pyx_GIVEREF(__pyx_slice__26); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -20079,9 +21572,28 @@ * * */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __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(3, 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(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "yt/geometry/fake_octree.pyx":27 * # Create a balanced octree by a random walk that recursively @@ -20090,10 +21602,10 @@ * long max_noct, * long max_level, */ - __pyx_tuple__24 = PyTuple_Pack(13, __pyx_n_s_oct_handler, __pyx_n_s_max_noct, __pyx_n_s_max_level, __pyx_n_s_ndd, __pyx_n_s_dle, __pyx_n_s_dre, __pyx_n_s_fsubdivide, __pyx_n_s_dd, __pyx_n_s_ind, __pyx_n_s_i, __pyx_n_s_cur_leaf, __pyx_n_s_mask, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 27, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(7, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_create_fake_octree, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_tuple__30 = PyTuple_Pack(13, __pyx_n_s_oct_handler, __pyx_n_s_max_noct, __pyx_n_s_max_level, __pyx_n_s_ndd, __pyx_n_s_dle, __pyx_n_s_dre, __pyx_n_s_fsubdivide, __pyx_n_s_dd, __pyx_n_s_ind, __pyx_n_s_i, __pyx_n_s_cur_leaf, __pyx_n_s_mask, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(7, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_geometry_fake_octree_pyx, __pyx_n_s_create_fake_octree, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 27, __pyx_L1_error) /* "View.MemoryView":282 * return self.name @@ -20102,9 +21614,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(3, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(3, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); /* "View.MemoryView":283 * @@ -20113,9 +21625,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(3, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -20124,9 +21636,9 @@ * * */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(3, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); /* "View.MemoryView":287 * @@ -20135,9 +21647,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(3, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(3, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); /* "View.MemoryView":288 * @@ -20146,9 +21658,19 @@ * * */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(3, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(3, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(3, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -20161,6 +21683,7 @@ __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_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __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:; @@ -20226,6 +21749,7 @@ __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 @@ -20264,9 +21788,11 @@ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(3, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(3, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(3, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(3, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(3, 275, __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; @@ -20279,6 +21805,7 @@ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(3, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(3, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(3, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; @@ -20288,6 +21815,7 @@ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -20340,18 +21868,24 @@ __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(5, 114, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType("yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(5, 117, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(5, 117, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(1, 33, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(1, 33, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(1, 71, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(1, 71, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(1, 74, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(1, 74, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(6, 57, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(6, 57, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(6, 89, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(6, 89, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(6, 97, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(6, 97, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(1, 29, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(1, 29, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(1, 67, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(1, 67, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(1, 70, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(1, 70, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType("yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(1, 74, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(1, 74, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = __Pyx_ImportType("yt.utilities.lib.allocation_container", "ObjectPool", sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(6, 26, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(6, 26, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = __Pyx_ImportType("yt.geometry.oct_container", "OctObjectPool", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(7, 55, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(7, 55, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(7, 63, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(7, 63, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(7, 94, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(7, 94, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(7, 102, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(7, 102, __pyx_L1_error) /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportVoidPtr(__pyx_t_1, "ORDER_MAX", (void **)&__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -20408,7 +21942,7 @@ */ __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(3, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(3, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_array_type); @@ -20419,7 +21953,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_3); @@ -20433,7 +21967,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 283, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_3); @@ -20447,7 +21981,7 @@ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 284, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_3); @@ -20461,7 +21995,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 287, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_3); @@ -20475,7 +22009,7 @@ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 288, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_3); @@ -20517,7 +22051,7 @@ */ __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(3, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(3, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_memoryview_type); @@ -20530,16 +22064,26 @@ */ __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(3, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(3, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_3) < 0) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -20551,7 +22095,7 @@ __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.geometry.fake_octree", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.geometry.fake_octree", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -21329,17 +22873,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -21458,8 +23007,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON @@ -21519,11 +23068,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -21546,7 +23091,7 @@ #endif /* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); @@ -21560,30 +23105,117 @@ #endif result = __Pyx_GetBuiltinName(name); } - return result; -} - -/* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; + return result; +} + +/* 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(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* BufferFallbackError */ + static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +/* GetItemInt */ + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + 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); } - if (likely(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -/* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { - PyErr_SetString(PyExc_ValueError, - "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE + #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; @@ -21607,7 +23239,7 @@ #endif /* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + 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; @@ -21648,8 +23280,39 @@ #endif } +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* 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; + } +} + /* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -21667,7 +23330,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -21687,7 +23359,7 @@ } /* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -21727,6 +23399,21 @@ 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; @@ -21771,7 +23458,7 @@ } /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -21934,25 +23621,25 @@ #endif /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -21976,7 +23663,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -21986,7 +23673,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -22047,28 +23734,15 @@ } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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_COMPILING_IN_CPYTHON -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); -} - /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -22100,8 +23774,23 @@ } } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -22126,7 +23815,7 @@ #endif /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -22199,89 +23888,8 @@ return module; } -/* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return m->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -22397,20 +24005,34 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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; } +/* 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; +} + /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -22427,8 +24049,73 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -22447,8 +24134,42 @@ return NULL; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -22528,7 +24249,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -22587,12 +24308,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -22631,8 +24355,8 @@ #endif - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + /* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -22654,7 +24378,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -22684,39 +24408,8 @@ } } -/* 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); - } -} - /* Print */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); if (!f) { @@ -22822,7 +24515,38 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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); + } +} + +/* 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) { @@ -22853,7 +24577,7 @@ } /* MemviewSliceIsContig */ - static int + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -22876,7 +24600,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -22912,7 +24636,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -22925,7 +24649,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -22945,7 +24669,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -23080,7 +24804,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -23100,7 +24824,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -23235,7 +24959,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -23266,7 +24990,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -23455,7 +25179,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -23522,7 +25246,7 @@ } /* MemviewSliceInit */ - static int + static int __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, @@ -23657,7 +25381,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -23846,7 +25570,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + 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 @@ -24035,7 +25759,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -24051,7 +25775,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -24069,7 +25793,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -24134,7 +25858,7 @@ #endif /* VoidPtrImport */ - #ifndef __PYX_HAVE_RT_ImportVoidPtr + #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; @@ -24183,7 +25907,7 @@ #endif /* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction + #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; @@ -24237,7 +25961,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -24262,6 +25986,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -24270,11 +25996,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/geometry/geometry_handler.py yt-3.4.0/yt/geometry/geometry_handler.py --- yt-3.3.3/yt/geometry/geometry_handler.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/geometry_handler.py 2017-08-10 18:02:57.000000000 +0000 @@ -270,7 +270,7 @@ else: tr = func(self) if self._cache: - + setattr(self, n, tr) return tr return property(cached_func) @@ -397,7 +397,9 @@ @cached_property def fcoords_vertex(self): - ci = np.empty((self.data_size, 8, 3), dtype='float64') + nodes_per_elem = self.dobj.index.meshes[0].connectivity_indices.shape[1] + dim = self.dobj.ds.dimensionality + ci = np.empty((self.data_size, nodes_per_elem, dim), dtype='float64') ci = YTArray(ci, input_units = "code_length", registry = self.dobj.ds.unit_registry) if self.data_size == 0: return ci @@ -426,10 +428,10 @@ def __iter__(self): return self - + def __next__(self): return self.next() - + def next(self): if len(self.queue) == 0: for i in range(self.max_length): @@ -445,4 +447,3 @@ g = self.queue.pop(0) g._initialize_cache(self.cache.pop(g.id, {})) return g - diff -Nru yt-3.3.3/yt/geometry/grid_container.c yt-3.4.0/yt/geometry/grid_container.c --- yt-3.3.3/yt/geometry/grid_container.c 2016-12-12 01:41:23.000000000 +0000 +++ yt-3.4.0/yt/geometry/grid_container.c 2017-08-10 18:20:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -11,6 +11,10 @@ ], "libraries": [ "m" + ], + "name": "yt.geometry.grid_container", + "sources": [ + "yt/geometry/grid_container.pyx" ] }, "module_name": "yt.geometry.grid_container" @@ -24,7 +28,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -46,6 +50,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -198,16 +203,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -334,6 +343,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -388,6 +403,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -452,7 +496,6 @@ #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include "platform_dep.h" -#include #include "pythread.h" #include "pystate.h" #ifdef _OPENMP @@ -499,8 +542,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -513,8 +556,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -636,10 +682,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -673,10 +721,10 @@ static const char *__pyx_f[] = { "yt/geometry/grid_container.pyx", + "stringsource", "yt/geometry/grid_container.pxd", "__init__.pxd", "yt/geometry/selection_routines.pxd", - "stringsource", "type.pxd", "yt/geometry/oct_visitors.pxd", "yt/utilities/lib/bitarray.pxd", @@ -1013,6 +1061,7 @@ struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject; struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector; struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray; struct __pyx_obj_2yt_8geometry_14grid_container_GridTree; struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids; @@ -1127,7 +1176,7 @@ __pyx_t_5numpy_float64_t right_edge_x; __pyx_t_5numpy_float64_t right_edge_y; __pyx_t_5numpy_float64_t right_edge_z; - __pyx_t_5numpy_int64_t children_pointers; + __pyx_t_5numpy_int_t children_pointers; __pyx_t_5numpy_int64_t start_index_x; __pyx_t_5numpy_int64_t start_index_y; __pyx_t_5numpy_int64_t start_index_z; @@ -1169,7 +1218,7 @@ struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid; struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells; -/* "yt/geometry/selection_routines.pxd":42 +/* "yt/geometry/selection_routines.pxd":38 * cdef np.int64_t _hash * * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -1181,7 +1230,7 @@ int visit_covered; }; -/* "yt/geometry/selection_routines.pxd":50 +/* "yt/geometry/selection_routines.pxd":46 * np.float64_t spos[3], np.float64_t sdds[3], * OctVisitor visitor, int i, int j, int k) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1193,7 +1242,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "yt/geometry/selection_routines.pxd":65 +/* "yt/geometry/selection_routines.pxd":61 * np.ndarray[np.uint8_t, ndim=3] mask, * int level) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -1476,12 +1525,12 @@ struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base; __Pyx_memviewslice ref_mask; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs; - __pyx_t_5numpy_int64_t *nocts; - __pyx_t_5numpy_int64_t *nfinest; + __pyx_t_5numpy_uint64_t *nocts; + __pyx_t_5numpy_uint64_t *nfinest; }; -/* "yt/geometry/selection_routines.pxd":33 +/* "yt/geometry/selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1501,7 +1550,7 @@ }; -/* "yt/geometry/selection_routines.pxd":71 +/* "yt/geometry/selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1513,7 +1562,7 @@ }; -/* "yt/geometry/selection_routines.pxd":74 +/* "yt/geometry/selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1527,6 +1576,20 @@ }; +/* "yt/geometry/selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2; +}; + + /* "yt/utilities/lib/bitarray.pxd":30 * return 1 * @@ -1582,7 +1645,7 @@ }; -/* "yt/geometry/grid_container.pyx":105 +/* "yt/geometry/grid_container.pyx":104 * self.mask = None * * def __iter__(self): # <<<<<<<<<<<<<< @@ -1943,7 +2006,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree; -/* "yt/geometry/selection_routines.pxd":33 +/* "yt/geometry/selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1966,7 +2029,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; -/* "yt/geometry/selection_routines.pxd":71 +/* "yt/geometry/selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1980,7 +2043,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; -/* "yt/geometry/selection_routines.pxd":74 +/* "yt/geometry/selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1994,6 +2057,20 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +/* "yt/geometry/selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + + /* "yt/utilities/lib/bitarray.pxd":30 * return 1 * @@ -2009,7 +2086,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray; -/* "yt/geometry/grid_container.pyx":52 +/* "yt/geometry/grid_container.pyx":51 * return node * * cdef class GridTree: # <<<<<<<<<<<<<< @@ -2025,7 +2102,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *__pyx_vtabptr_2yt_8geometry_14grid_container_GridTree; -/* "yt/geometry/grid_container.pyx":272 +/* "yt/geometry/grid_container.pyx":271 * return fwidth * * cdef class MatchPointsToGrids: # <<<<<<<<<<<<<< @@ -2177,7 +2254,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) /* PyThreadStateGet.proto */ @@ -2385,6 +2462,12 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* IncludeStringH.proto */ #include @@ -2410,8 +2493,19 @@ 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 *); +/* 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( @@ -2419,6 +2513,9 @@ 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) @@ -2499,9 +2596,19 @@ #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() + /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join @@ -2523,9 +2630,15 @@ /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -2593,6 +2706,9 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_long(npy_long value); + struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded; static PyObject* __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded s); /* MemviewDtypeToObject.proto */ @@ -2728,15 +2844,18 @@ /* CIntFromPy.proto */ static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(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 *); -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); @@ -2915,18 +3034,17 @@ static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0; static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *); /*proto*/ /* Module declarations from 'yt.utilities.lib.fp_utils' */ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ /* Module declarations from 'yt.utilities.lib.bitarray' */ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray = 0; -/* Module declarations from 'libc.math' */ - /* Module declarations from 'yt.geometry.grid_container' */ static PyTypeObject *__pyx_ptype_2yt_8geometry_14grid_container_GridTree = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_14grid_container_MatchPointsToGrids = 0; @@ -2976,10 +3094,12 @@ 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 PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 }; static __Pyx_StructField __Pyx_StructFields_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded[] = { {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, "num_children", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, num_children)}, {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, "level", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, level)}, @@ -2990,7 +3110,7 @@ {&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, "right_edge_x", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, right_edge_x)}, {&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, "right_edge_y", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, right_edge_y)}, {&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, "right_edge_z", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, right_edge_z)}, - {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "children_pointers", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, children_pointers)}, + {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, "children_pointers", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, children_pointers)}, {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "start_index_x", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, start_index_x)}, {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "start_index_y", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, start_index_y)}, {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "start_index_z", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, start_index_z)}, @@ -3009,9 +3129,9 @@ /* Implementation of 'yt.geometry.grid_container' */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_ImportError; -static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; @@ -3027,11 +3147,13 @@ static const char __pyx_k_z[] = "_z"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_np[] = "np"; - static const char __pyx_k__50[] = "^"; - static const char __pyx_k__51[] = ""; - static const char __pyx_k__52[] = ":"; -static const char __pyx_k__53[] = "}"; -static const char __pyx_k__54[] = ","; + static const char __pyx_k__60[] = "^"; + static const char __pyx_k__61[] = ""; + static const char __pyx_k__62[] = ":"; +static const char __pyx_k__63[] = "}"; +static const char __pyx_k__64[] = ","; +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_x_2[] = "x"; static const char __pyx_k_y_2[] = "y"; @@ -3039,6 +3161,7 @@ static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_char[] = "char"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_iter[] = "__iter__"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_main[] = "__main__"; @@ -3082,8 +3205,11 @@ 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_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_asarray[] = "asarray"; static const char __pyx_k_float64[] = "float64"; static const char __pyx_k_fortran[] = "fortran"; @@ -3092,11 +3218,13 @@ static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_endswith[] = "endswith"; static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_selector[] = "selector"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_left_edge[] = "left_edge"; static const char __pyx_k_num_grids[] = "num_grids"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_dimensions[] = "dimensions"; @@ -3106,24 +3234,32 @@ static const char __pyx_k_right_edge[] = "right_edge"; 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_code_length[] = "code_length"; static const char __pyx_k_left_edge_x[] = "left_edge_x"; static const char __pyx_k_left_edge_y[] = "left_edge_y"; static const char __pyx_k_left_edge_z[] = "left_edge_z"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_num_children[] = "num_children"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_right_edge_x[] = "right_edge_x"; static const char __pyx_k_right_edge_y[] = "right_edge_y"; static const char __pyx_k_right_edge_z[] = "right_edge_z"; +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_start_index_x[] = "start_index_x"; static const char __pyx_k_start_index_y[] = "start_index_y"; static const char __pyx_k_start_index_z[] = "start_index_z"; static const char __pyx_k_GridTree___iter[] = "GridTree.__iter__"; +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_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_convert_to_units[] = "convert_to_units"; static const char __pyx_k_children_pointers[] = "children_pointers"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +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_contiguous_and_direct[] = ""; @@ -3144,6 +3280,7 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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_No_value_specified_for_struct_at[] = "No value specified for struct attribute 'num_children'"; @@ -3152,6 +3289,7 @@ 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."; @@ -3183,6 +3321,7 @@ static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; static PyObject *__pyx_n_s_GridTree___iter; 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; @@ -3213,16 +3352,18 @@ 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_n_s_RuntimeError; static PyObject *__pyx_kp_b_T; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_kp_b__50; -static PyObject *__pyx_kp_b__51; -static PyObject *__pyx_kp_b__52; -static PyObject *__pyx_kp_b__53; -static PyObject *__pyx_kp_u__54; +static PyObject *__pyx_n_s_View_MemoryView; +static PyObject *__pyx_kp_b__60; +static PyObject *__pyx_kp_b__61; +static PyObject *__pyx_kp_b__62; +static PyObject *__pyx_kp_b__63; +static PyObject *__pyx_kp_u__64; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_s_asarray; @@ -3232,6 +3373,7 @@ static PyObject *__pyx_n_s_char; static PyObject *__pyx_n_s_children_pointers; static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_s_code_length; static PyObject *__pyx_kp_s_contiguous_and_direct; @@ -3240,6 +3382,7 @@ static PyObject *__pyx_n_s_dds_x; static PyObject *__pyx_n_s_dds_y; static PyObject *__pyx_n_s_dds_z; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dimensions; static PyObject *__pyx_n_s_dims_x; static PyObject *__pyx_n_s_dims_y; @@ -3261,6 +3404,7 @@ static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_index; +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; @@ -3280,6 +3424,8 @@ 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_num_children; static PyObject *__pyx_n_s_num_grids; @@ -3290,9 +3436,16 @@ static PyObject *__pyx_n_s_obj; static PyObject *__pyx_n_s_pack; static PyObject *__pyx_n_s_parent_ind; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_cython; +static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_right_edge; static PyObject *__pyx_n_s_right_edge_x; static PyObject *__pyx_n_s_right_edge_y; @@ -3300,6 +3453,7 @@ static PyObject *__pyx_kp_u_s; static PyObject *__pyx_n_s_selector; static PyObject *__pyx_n_s_send; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_start; @@ -3311,6 +3465,7 @@ 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_throw; @@ -3320,6 +3475,7 @@ static PyObject *__pyx_n_s_units; 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_view; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_x_2; @@ -3342,8 +3498,12 @@ static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask___get__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask_2__set__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask_4__del__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_19__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_21__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids___cinit__(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self, struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_tree, int __pyx_v_num_points, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_z); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_2find_points_in_tree(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self, CYTHON_UNUSED 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 */ @@ -3353,8 +3513,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -3376,8 +3540,13 @@ 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_2yt_8geometry_14grid_container_GridTree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_14grid_container_MatchPointsToGrids(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_14grid_container___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3388,6 +3557,7 @@ 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_int_neg_2; static PyObject *__pyx_slice_; @@ -3399,9 +3569,9 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__46; -static PyObject *__pyx_slice__47; -static PyObject *__pyx_slice__48; +static PyObject *__pyx_slice__54; +static PyObject *__pyx_slice__55; +static PyObject *__pyx_slice__56; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -3438,14 +3608,26 @@ static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; static PyObject *__pyx_tuple__49; -static PyObject *__pyx_tuple__55; -static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__53; static PyObject *__pyx_tuple__57; static PyObject *__pyx_tuple__58; static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_codeobj__71; -/* "yt/geometry/grid_container.pyx":25 +/* "yt/geometry/grid_container.pyx":24 * @cython.wraparound(False) * @cython.cdivision(True) * cdef GridTreeNode Grid_initialize(np.ndarray[np.float64_t, ndim=1] le, # <<<<<<<<<<<<<< @@ -3489,21 +3671,21 @@ __pyx_pybuffernd_dims.rcbuffer = &__pyx_pybuffer_dims; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_le.rcbuffer->pybuffer, (PyObject*)__pyx_v_le, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 25, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_le.rcbuffer->pybuffer, (PyObject*)__pyx_v_le, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 24, __pyx_L1_error) } __pyx_pybuffernd_le.diminfo[0].strides = __pyx_pybuffernd_le.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_le.diminfo[0].shape = __pyx_pybuffernd_le.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_re.rcbuffer->pybuffer, (PyObject*)__pyx_v_re, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 25, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_re.rcbuffer->pybuffer, (PyObject*)__pyx_v_re, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 24, __pyx_L1_error) } __pyx_pybuffernd_re.diminfo[0].strides = __pyx_pybuffernd_re.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_re.diminfo[0].shape = __pyx_pybuffernd_re.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dims.rcbuffer->pybuffer, (PyObject*)__pyx_v_dims, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 25, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dims.rcbuffer->pybuffer, (PyObject*)__pyx_v_dims, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 24, __pyx_L1_error) } __pyx_pybuffernd_dims.diminfo[0].strides = __pyx_pybuffernd_dims.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dims.diminfo[0].shape = __pyx_pybuffernd_dims.rcbuffer->pybuffer.shape[0]; - /* "yt/geometry/grid_container.pyx":33 + /* "yt/geometry/grid_container.pyx":32 * cdef int i * * node.index = index # <<<<<<<<<<<<<< @@ -3512,7 +3694,7 @@ */ __pyx_v_node.index = __pyx_v_index; - /* "yt/geometry/grid_container.pyx":34 + /* "yt/geometry/grid_container.pyx":33 * * node.index = index * node.level = level # <<<<<<<<<<<<<< @@ -3521,7 +3703,7 @@ */ __pyx_v_node.level = __pyx_v_level; - /* "yt/geometry/grid_container.pyx":35 + /* "yt/geometry/grid_container.pyx":34 * node.index = index * node.level = level * for i in range(3): # <<<<<<<<<<<<<< @@ -3531,7 +3713,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/grid_container.pyx":36 + /* "yt/geometry/grid_container.pyx":35 * node.level = level * for i in range(3): * node.left_edge[i] = le[i] # <<<<<<<<<<<<<< @@ -3541,7 +3723,7 @@ __pyx_t_2 = __pyx_v_i; (__pyx_v_node.left_edge[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_le.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_le.diminfo[0].strides)); - /* "yt/geometry/grid_container.pyx":37 + /* "yt/geometry/grid_container.pyx":36 * for i in range(3): * node.left_edge[i] = le[i] * node.right_edge[i] = re[i] # <<<<<<<<<<<<<< @@ -3551,7 +3733,7 @@ __pyx_t_3 = __pyx_v_i; (__pyx_v_node.right_edge[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_re.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_re.diminfo[0].strides)); - /* "yt/geometry/grid_container.pyx":38 + /* "yt/geometry/grid_container.pyx":37 * node.left_edge[i] = le[i] * node.right_edge[i] = re[i] * node.dims[i] = dims[i] # <<<<<<<<<<<<<< @@ -3561,7 +3743,7 @@ __pyx_t_4 = __pyx_v_i; (__pyx_v_node.dims[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_dims.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_dims.diminfo[0].strides)); - /* "yt/geometry/grid_container.pyx":39 + /* "yt/geometry/grid_container.pyx":38 * node.right_edge[i] = re[i] * node.dims[i] = dims[i] * node.dds[i] = (re[i] - le[i])/dims[i] # <<<<<<<<<<<<<< @@ -3573,7 +3755,7 @@ __pyx_t_7 = __pyx_v_i; (__pyx_v_node.dds[__pyx_v_i]) = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_re.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_re.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_le.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_le.diminfo[0].strides))) / (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_dims.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dims.diminfo[0].strides))); - /* "yt/geometry/grid_container.pyx":40 + /* "yt/geometry/grid_container.pyx":39 * node.dims[i] = dims[i] * node.dds[i] = (re[i] - le[i])/dims[i] * node.start_index[i] = rint(le[i] / node.dds[i]) # <<<<<<<<<<<<<< @@ -3584,7 +3766,7 @@ (__pyx_v_node.start_index[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t)rint(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_le.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_le.diminfo[0].strides)) / (__pyx_v_node.dds[__pyx_v_i])))); } - /* "yt/geometry/grid_container.pyx":41 + /* "yt/geometry/grid_container.pyx":40 * node.dds[i] = (re[i] - le[i])/dims[i] * node.start_index[i] = rint(le[i] / node.dds[i]) * node.num_children = num_children # <<<<<<<<<<<<<< @@ -3593,7 +3775,7 @@ */ __pyx_v_node.num_children = __pyx_v_num_children; - /* "yt/geometry/grid_container.pyx":42 + /* "yt/geometry/grid_container.pyx":41 * node.start_index[i] = rint(le[i] / node.dds[i]) * node.num_children = num_children * if num_children <= 0: # <<<<<<<<<<<<<< @@ -3603,7 +3785,7 @@ __pyx_t_9 = ((__pyx_v_num_children <= 0) != 0); if (__pyx_t_9) { - /* "yt/geometry/grid_container.pyx":43 + /* "yt/geometry/grid_container.pyx":42 * node.num_children = num_children * if num_children <= 0: * node.children = NULL # <<<<<<<<<<<<<< @@ -3612,7 +3794,7 @@ */ __pyx_v_node.children = NULL; - /* "yt/geometry/grid_container.pyx":44 + /* "yt/geometry/grid_container.pyx":43 * if num_children <= 0: * node.children = NULL * return node # <<<<<<<<<<<<<< @@ -3622,7 +3804,7 @@ __pyx_r = __pyx_v_node; goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":42 + /* "yt/geometry/grid_container.pyx":41 * node.start_index[i] = rint(le[i] / node.dds[i]) * node.num_children = num_children * if num_children <= 0: # <<<<<<<<<<<<<< @@ -3631,7 +3813,7 @@ */ } - /* "yt/geometry/grid_container.pyx":45 + /* "yt/geometry/grid_container.pyx":44 * node.children = NULL * return node * node.children = malloc( # <<<<<<<<<<<<<< @@ -3640,7 +3822,7 @@ */ __pyx_v_node.children = ((struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode **)malloc(((sizeof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *)) * __pyx_v_num_children))); - /* "yt/geometry/grid_container.pyx":47 + /* "yt/geometry/grid_container.pyx":46 * node.children = malloc( * sizeof(GridTreeNode *) * num_children) * for i in range(num_children): # <<<<<<<<<<<<<< @@ -3651,7 +3833,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "yt/geometry/grid_container.pyx":48 + /* "yt/geometry/grid_container.pyx":47 * sizeof(GridTreeNode *) * num_children) * for i in range(num_children): * node.children[i] = NULL # <<<<<<<<<<<<<< @@ -3661,7 +3843,7 @@ (__pyx_v_node.children[__pyx_v_i]) = NULL; } - /* "yt/geometry/grid_container.pyx":50 + /* "yt/geometry/grid_container.pyx":49 * node.children[i] = NULL * * return node # <<<<<<<<<<<<<< @@ -3671,7 +3853,7 @@ __pyx_r = __pyx_v_node; goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":25 + /* "yt/geometry/grid_container.pyx":24 * @cython.wraparound(False) * @cython.cdivision(True) * cdef GridTreeNode Grid_initialize(np.ndarray[np.float64_t, ndim=1] le, # <<<<<<<<<<<<<< @@ -3689,7 +3871,8 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_le.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_re.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.geometry.grid_container.Grid_initialize", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.grid_container.Grid_initialize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __Pyx_pretend_to_initialize(&__pyx_r); goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dims.rcbuffer->pybuffer); @@ -3700,7 +3883,7 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":57 +/* "yt/geometry/grid_container.pyx":56 * @cython.wraparound(False) * @cython.cdivision(True) * def __cinit__(self, int num_grids, # <<<<<<<<<<<<<< @@ -3729,12 +3912,19 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -3743,39 +3933,45 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_grids)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 1); __PYX_ERR(0, 57, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 1); __PYX_ERR(0, 56, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 2); __PYX_ERR(0, 57, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 2); __PYX_ERR(0, 56, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dimensions)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 3); __PYX_ERR(0, 57, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 3); __PYX_ERR(0, 56, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parent_ind)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 4); __PYX_ERR(0, 57, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 4); __PYX_ERR(0, 56, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 5); __PYX_ERR(0, 57, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 5); __PYX_ERR(0, 56, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_children)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 6); __PYX_ERR(0, 57, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 6); __PYX_ERR(0, 56, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 57, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 56, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; @@ -3788,7 +3984,7 @@ values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } - __pyx_v_num_grids = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_num_grids == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) + __pyx_v_num_grids = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_num_grids == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) __pyx_v_left_edge = ((PyArrayObject *)values[1]); __pyx_v_right_edge = ((PyArrayObject *)values[2]); __pyx_v_dimensions = ((PyArrayObject *)values[3]); @@ -3798,18 +3994,18 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 57, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 58, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 59, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dimensions), __pyx_ptype_5numpy_ndarray, 1, "dimensions", 0))) __PYX_ERR(0, 60, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_ind), __pyx_ptype_5numpy_ndarray, 1, "parent_ind", 0))) __PYX_ERR(0, 61, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_level), __pyx_ptype_5numpy_ndarray, 1, "level", 0))) __PYX_ERR(0, 62, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_num_children), __pyx_ptype_5numpy_ndarray, 1, "num_children", 0))) __PYX_ERR(0, 63, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 58, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dimensions), __pyx_ptype_5numpy_ndarray, 1, "dimensions", 0))) __PYX_ERR(0, 59, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_ind), __pyx_ptype_5numpy_ndarray, 1, "parent_ind", 0))) __PYX_ERR(0, 60, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_level), __pyx_ptype_5numpy_ndarray, 1, "level", 0))) __PYX_ERR(0, 61, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_num_children), __pyx_ptype_5numpy_ndarray, 1, "num_children", 0))) __PYX_ERR(0, 62, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree___cinit__(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), __pyx_v_num_grids, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_dimensions, __pyx_v_parent_ind, __pyx_v_level, __pyx_v_num_children); /* function exit code */ @@ -3891,71 +4087,71 @@ __pyx_pybuffernd_num_children.rcbuffer = &__pyx_pybuffer_num_children; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error) } __pyx_pybuffernd_left_edge.diminfo[0].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edge.diminfo[0].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edge.diminfo[1].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edge.diminfo[1].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error) } __pyx_pybuffernd_right_edge.diminfo[0].strides = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edge.diminfo[0].shape = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edge.diminfo[1].strides = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edge.diminfo[1].shape = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer, (PyObject*)__pyx_v_dimensions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer, (PyObject*)__pyx_v_dimensions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error) } __pyx_pybuffernd_dimensions.diminfo[0].strides = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dimensions.diminfo[0].shape = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dimensions.diminfo[1].strides = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dimensions.diminfo[1].shape = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error) } __pyx_pybuffernd_parent_ind.diminfo[0].strides = __pyx_pybuffernd_parent_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_ind.diminfo[0].shape = __pyx_pybuffernd_parent_ind.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_level.rcbuffer->pybuffer, (PyObject*)__pyx_v_level, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_level.rcbuffer->pybuffer, (PyObject*)__pyx_v_level, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error) } __pyx_pybuffernd_level.diminfo[0].strides = __pyx_pybuffernd_level.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_level.diminfo[0].shape = __pyx_pybuffernd_level.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_num_children.rcbuffer->pybuffer, (PyObject*)__pyx_v_num_children, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_num_children.rcbuffer->pybuffer, (PyObject*)__pyx_v_num_children, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error) } __pyx_pybuffernd_num_children.diminfo[0].strides = __pyx_pybuffernd_num_children.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_num_children.diminfo[0].shape = __pyx_pybuffernd_num_children.rcbuffer->pybuffer.shape[0]; - /* "yt/geometry/grid_container.pyx":68 - * cdef np.ndarray[np.int64_t, ndim=1] child_ptr + /* "yt/geometry/grid_container.pyx":67 + * cdef np.ndarray[np.int_t, ndim=1] child_ptr * - * child_ptr = np.zeros(num_grids, dtype='int64') # <<<<<<<<<<<<<< + * child_ptr = np.zeros(num_grids, dtype='int') # <<<<<<<<<<<<<< * * self.num_grids = num_grids */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __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, 68, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __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_num_grids); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_num_grids); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 68, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __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_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, 68, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_ptr.rcbuffer->pybuffer); - __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_ptr.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_ptr.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); if (unlikely(__pyx_t_6 < 0)) { PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_ptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_child_ptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_ptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_child_ptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); __Pyx_RaiseBufferFallbackError(); } else { @@ -3963,14 +4159,14 @@ } } __pyx_pybuffernd_child_ptr.diminfo[0].strides = __pyx_pybuffernd_child_ptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_ptr.diminfo[0].shape = __pyx_pybuffernd_child_ptr.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 68, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 67, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_child_ptr = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/grid_container.pyx":70 - * child_ptr = np.zeros(num_grids, dtype='int64') + /* "yt/geometry/grid_container.pyx":69 + * child_ptr = np.zeros(num_grids, dtype='int') * * self.num_grids = num_grids # <<<<<<<<<<<<<< * self.num_root_grids = 0 @@ -3978,7 +4174,7 @@ */ __pyx_v_self->num_grids = __pyx_v_num_grids; - /* "yt/geometry/grid_container.pyx":71 + /* "yt/geometry/grid_container.pyx":70 * * self.num_grids = num_grids * self.num_root_grids = 0 # <<<<<<<<<<<<<< @@ -3987,7 +4183,7 @@ */ __pyx_v_self->num_root_grids = 0; - /* "yt/geometry/grid_container.pyx":72 + /* "yt/geometry/grid_container.pyx":71 * self.num_grids = num_grids * self.num_root_grids = 0 * self.num_leaf_grids = 0 # <<<<<<<<<<<<<< @@ -3996,7 +4192,7 @@ */ __pyx_v_self->num_leaf_grids = 0; - /* "yt/geometry/grid_container.pyx":74 + /* "yt/geometry/grid_container.pyx":73 * self.num_leaf_grids = 0 * * self.grids = malloc( # <<<<<<<<<<<<<< @@ -4005,7 +4201,7 @@ */ __pyx_v_self->grids = ((struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *)malloc(((sizeof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode)) * __pyx_v_num_grids))); - /* "yt/geometry/grid_container.pyx":77 + /* "yt/geometry/grid_container.pyx":76 * sizeof(GridTreeNode) * num_grids) * * for i in range(num_grids): # <<<<<<<<<<<<<< @@ -4016,16 +4212,16 @@ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_6; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "yt/geometry/grid_container.pyx":78 + /* "yt/geometry/grid_container.pyx":77 * * for i in range(num_grids): * self.grids[i] = Grid_initialize(left_edge[i,:], # <<<<<<<<<<<<<< * right_edge[i,:], * dimensions[i,:], */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); @@ -4033,21 +4229,21 @@ __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice_); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_left_edge), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_left_edge), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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, 78, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 77, __pyx_L1_error) - /* "yt/geometry/grid_container.pyx":79 + /* "yt/geometry/grid_container.pyx":78 * for i in range(num_grids): * self.grids[i] = Grid_initialize(left_edge[i,:], * right_edge[i,:], # <<<<<<<<<<<<<< * dimensions[i,:], * num_children[i], */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -4055,21 +4251,21 @@ __Pyx_GIVEREF(__pyx_slice__2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__2); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_right_edge), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_right_edge), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 79, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 78, __pyx_L1_error) - /* "yt/geometry/grid_container.pyx":80 + /* "yt/geometry/grid_container.pyx":79 * self.grids[i] = Grid_initialize(left_edge[i,:], * right_edge[i,:], * dimensions[i,:], # <<<<<<<<<<<<<< * num_children[i], * level[i], i) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); @@ -4077,12 +4273,12 @@ __Pyx_GIVEREF(__pyx_slice__3); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_dimensions), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_dimensions), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 80, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 79, __pyx_L1_error) - /* "yt/geometry/grid_container.pyx":81 + /* "yt/geometry/grid_container.pyx":80 * right_edge[i,:], * dimensions[i,:], * num_children[i], # <<<<<<<<<<<<<< @@ -4091,7 +4287,7 @@ */ __pyx_t_11 = __pyx_v_i; - /* "yt/geometry/grid_container.pyx":82 + /* "yt/geometry/grid_container.pyx":81 * dimensions[i,:], * num_children[i], * level[i], i) # <<<<<<<<<<<<<< @@ -4100,7 +4296,7 @@ */ __pyx_t_12 = __pyx_v_i; - /* "yt/geometry/grid_container.pyx":78 + /* "yt/geometry/grid_container.pyx":77 * * for i in range(num_grids): * self.grids[i] = Grid_initialize(left_edge[i,:], # <<<<<<<<<<<<<< @@ -4112,7 +4308,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/grid_container.pyx":83 + /* "yt/geometry/grid_container.pyx":82 * num_children[i], * level[i], i) * if level[i] == 0: # <<<<<<<<<<<<<< @@ -4123,7 +4319,7 @@ __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_level.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_level.diminfo[0].strides)) == 0) != 0); if (__pyx_t_14) { - /* "yt/geometry/grid_container.pyx":84 + /* "yt/geometry/grid_container.pyx":83 * level[i], i) * if level[i] == 0: * self.num_root_grids += 1 # <<<<<<<<<<<<<< @@ -4132,7 +4328,7 @@ */ __pyx_v_self->num_root_grids = (__pyx_v_self->num_root_grids + 1); - /* "yt/geometry/grid_container.pyx":83 + /* "yt/geometry/grid_container.pyx":82 * num_children[i], * level[i], i) * if level[i] == 0: # <<<<<<<<<<<<<< @@ -4141,7 +4337,7 @@ */ } - /* "yt/geometry/grid_container.pyx":85 + /* "yt/geometry/grid_container.pyx":84 * if level[i] == 0: * self.num_root_grids += 1 * if num_children[i] == 0: # <<<<<<<<<<<<<< @@ -4152,7 +4348,7 @@ __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_num_children.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_num_children.diminfo[0].strides)) == 0) != 0); if (__pyx_t_14) { - /* "yt/geometry/grid_container.pyx":86 + /* "yt/geometry/grid_container.pyx":85 * self.num_root_grids += 1 * if num_children[i] == 0: * self.num_leaf_grids += 1 # <<<<<<<<<<<<<< @@ -4161,7 +4357,7 @@ */ __pyx_v_self->num_leaf_grids = (__pyx_v_self->num_leaf_grids + 1); - /* "yt/geometry/grid_container.pyx":85 + /* "yt/geometry/grid_container.pyx":84 * if level[i] == 0: * self.num_root_grids += 1 * if num_children[i] == 0: # <<<<<<<<<<<<<< @@ -4171,7 +4367,7 @@ } } - /* "yt/geometry/grid_container.pyx":88 + /* "yt/geometry/grid_container.pyx":87 * self.num_leaf_grids += 1 * * self.root_grids = malloc( # <<<<<<<<<<<<<< @@ -4180,7 +4376,7 @@ */ __pyx_v_self->root_grids = ((struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *)malloc(((sizeof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode)) * __pyx_v_self->num_root_grids))); - /* "yt/geometry/grid_container.pyx":90 + /* "yt/geometry/grid_container.pyx":89 * self.root_grids = malloc( * sizeof(GridTreeNode) * self.num_root_grids) * k = 0 # <<<<<<<<<<<<<< @@ -4189,7 +4385,7 @@ */ __pyx_v_k = 0; - /* "yt/geometry/grid_container.pyx":91 + /* "yt/geometry/grid_container.pyx":90 * sizeof(GridTreeNode) * self.num_root_grids) * k = 0 * for i in range(num_grids): # <<<<<<<<<<<<<< @@ -4200,7 +4396,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_6; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "yt/geometry/grid_container.pyx":92 + /* "yt/geometry/grid_container.pyx":91 * k = 0 * for i in range(num_grids): * j = parent_ind[i] # <<<<<<<<<<<<<< @@ -4210,7 +4406,7 @@ __pyx_t_16 = __pyx_v_i; __pyx_v_j = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_parent_ind.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_parent_ind.diminfo[0].strides)); - /* "yt/geometry/grid_container.pyx":93 + /* "yt/geometry/grid_container.pyx":92 * for i in range(num_grids): * j = parent_ind[i] * if j >= 0: # <<<<<<<<<<<<<< @@ -4220,7 +4416,7 @@ __pyx_t_14 = ((__pyx_v_j >= 0) != 0); if (__pyx_t_14) { - /* "yt/geometry/grid_container.pyx":94 + /* "yt/geometry/grid_container.pyx":93 * j = parent_ind[i] * if j >= 0: * self.grids[j].children[child_ptr[j]] = &self.grids[i] # <<<<<<<<<<<<<< @@ -4228,9 +4424,9 @@ * else: */ __pyx_t_17 = __pyx_v_j; - ((__pyx_v_self->grids[__pyx_v_j]).children[(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_child_ptr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_child_ptr.diminfo[0].strides))]) = (&(__pyx_v_self->grids[__pyx_v_i])); + ((__pyx_v_self->grids[__pyx_v_j]).children[(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_child_ptr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_child_ptr.diminfo[0].strides))]) = (&(__pyx_v_self->grids[__pyx_v_i])); - /* "yt/geometry/grid_container.pyx":95 + /* "yt/geometry/grid_container.pyx":94 * if j >= 0: * self.grids[j].children[child_ptr[j]] = &self.grids[i] * child_ptr[j] += 1 # <<<<<<<<<<<<<< @@ -4238,9 +4434,9 @@ * if k >= self.num_root_grids: */ __pyx_t_18 = __pyx_v_j; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_child_ptr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_child_ptr.diminfo[0].strides) += 1; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_child_ptr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_child_ptr.diminfo[0].strides) += 1; - /* "yt/geometry/grid_container.pyx":93 + /* "yt/geometry/grid_container.pyx":92 * for i in range(num_grids): * j = parent_ind[i] * if j >= 0: # <<<<<<<<<<<<<< @@ -4250,7 +4446,7 @@ goto __pyx_L9; } - /* "yt/geometry/grid_container.pyx":97 + /* "yt/geometry/grid_container.pyx":96 * child_ptr[j] += 1 * else: * if k >= self.num_root_grids: # <<<<<<<<<<<<<< @@ -4261,7 +4457,7 @@ __pyx_t_14 = ((__pyx_v_k >= __pyx_v_self->num_root_grids) != 0); if (__pyx_t_14) { - /* "yt/geometry/grid_container.pyx":98 + /* "yt/geometry/grid_container.pyx":97 * else: * if k >= self.num_root_grids: * raise RuntimeError # <<<<<<<<<<<<<< @@ -4269,9 +4465,9 @@ * k = k + 1 */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 98, __pyx_L1_error) + __PYX_ERR(0, 97, __pyx_L1_error) - /* "yt/geometry/grid_container.pyx":97 + /* "yt/geometry/grid_container.pyx":96 * child_ptr[j] += 1 * else: * if k >= self.num_root_grids: # <<<<<<<<<<<<<< @@ -4280,7 +4476,7 @@ */ } - /* "yt/geometry/grid_container.pyx":99 + /* "yt/geometry/grid_container.pyx":98 * if k >= self.num_root_grids: * raise RuntimeError * self.root_grids[k] = self.grids[i] # <<<<<<<<<<<<<< @@ -4289,7 +4485,7 @@ */ (__pyx_v_self->root_grids[__pyx_v_k]) = (__pyx_v_self->grids[__pyx_v_i]); - /* "yt/geometry/grid_container.pyx":100 + /* "yt/geometry/grid_container.pyx":99 * raise RuntimeError * self.root_grids[k] = self.grids[i] * k = k + 1 # <<<<<<<<<<<<<< @@ -4301,7 +4497,7 @@ __pyx_L9:; } - /* "yt/geometry/grid_container.pyx":57 + /* "yt/geometry/grid_container.pyx":56 * @cython.wraparound(False) * @cython.cdivision(True) * def __cinit__(self, int num_grids, # <<<<<<<<<<<<<< @@ -4346,7 +4542,7 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":102 +/* "yt/geometry/grid_container.pyx":101 * k = k + 1 * * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< @@ -4379,7 +4575,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/grid_container.pyx":103 + /* "yt/geometry/grid_container.pyx":102 * * def __init__(self, *args, **kwargs): * self.mask = None # <<<<<<<<<<<<<< @@ -4392,7 +4588,7 @@ __Pyx_DECREF(((PyObject *)__pyx_v_self->mask)); __pyx_v_self->mask = ((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)Py_None); - /* "yt/geometry/grid_container.pyx":102 + /* "yt/geometry/grid_container.pyx":101 * k = k + 1 * * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< @@ -4407,7 +4603,7 @@ } static PyObject *__pyx_gb_2yt_8geometry_14grid_container_8GridTree_6generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "yt/geometry/grid_container.pyx":105 +/* "yt/geometry/grid_container.pyx":104 * self.mask = None * * def __iter__(self): # <<<<<<<<<<<<<< @@ -4437,7 +4633,7 @@ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 105, __pyx_L1_error) + __PYX_ERR(0, 104, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -4445,7 +4641,7 @@ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_2yt_8geometry_14grid_container_8GridTree_6generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_GridTree___iter, __pyx_n_s_yt_geometry_grid_container); if (unlikely(!gen)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_2yt_8geometry_14grid_container_8GridTree_6generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_GridTree___iter, __pyx_n_s_yt_geometry_grid_container); if (unlikely(!gen)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -4475,9 +4671,9 @@ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 104, __pyx_L1_error) - /* "yt/geometry/grid_container.pyx":106 + /* "yt/geometry/grid_container.pyx":105 * * def __iter__(self): * yield self # <<<<<<<<<<<<<< @@ -4492,10 +4688,10 @@ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L4_resume_from_yield:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 106, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 105, __pyx_L1_error) CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "yt/geometry/grid_container.pyx":105 + /* "yt/geometry/grid_container.pyx":104 * self.mask = None * * def __iter__(self): # <<<<<<<<<<<<<< @@ -4516,7 +4712,7 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":111 +/* "yt/geometry/grid_container.pyx":110 * @cython.wraparound(False) * @cython.cdivision(True) * def return_tree_info(self): # <<<<<<<<<<<<<< @@ -4555,55 +4751,55 @@ int __pyx_t_6; __Pyx_RefNannySetupContext("return_tree_info", 0); - /* "yt/geometry/grid_container.pyx":113 + /* "yt/geometry/grid_container.pyx":112 * def return_tree_info(self): * cdef int i, j * levels = [] # <<<<<<<<<<<<<< * indices = [] * nchild = [] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_levels = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/grid_container.pyx":114 + /* "yt/geometry/grid_container.pyx":113 * cdef int i, j * levels = [] * indices = [] # <<<<<<<<<<<<<< * nchild = [] * children = [] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_indices = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/grid_container.pyx":115 + /* "yt/geometry/grid_container.pyx":114 * levels = [] * indices = [] * nchild = [] # <<<<<<<<<<<<<< * children = [] * for i in range(self.num_grids): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_nchild = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/grid_container.pyx":116 + /* "yt/geometry/grid_container.pyx":115 * indices = [] * nchild = [] * children = [] # <<<<<<<<<<<<<< * for i in range(self.num_grids): * childs = [] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_children = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/grid_container.pyx":117 + /* "yt/geometry/grid_container.pyx":116 * nchild = [] * children = [] * for i in range(self.num_grids): # <<<<<<<<<<<<<< @@ -4614,55 +4810,55 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/geometry/grid_container.pyx":118 + /* "yt/geometry/grid_container.pyx":117 * children = [] * for i in range(self.num_grids): * childs = [] # <<<<<<<<<<<<<< * levels.append(self.grids[i].level) * indices.append(self.grids[i].index) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_childs, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "yt/geometry/grid_container.pyx":119 + /* "yt/geometry/grid_container.pyx":118 * for i in range(self.num_grids): * childs = [] * levels.append(self.grids[i].level) # <<<<<<<<<<<<<< * indices.append(self.grids[i].index) * nchild.append(self.grids[i].num_children) */ - __pyx_t_1 = __Pyx_PyInt_From_npy_int32((__pyx_v_self->grids[__pyx_v_i]).level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int32((__pyx_v_self->grids[__pyx_v_i]).level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_levels, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_levels, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/grid_container.pyx":120 + /* "yt/geometry/grid_container.pyx":119 * childs = [] * levels.append(self.grids[i].level) * indices.append(self.grids[i].index) # <<<<<<<<<<<<<< * nchild.append(self.grids[i].num_children) * for j in range(self.grids[i].num_children): */ - __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_self->grids[__pyx_v_i]).index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_self->grids[__pyx_v_i]).index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_indices, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_indices, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/grid_container.pyx":121 + /* "yt/geometry/grid_container.pyx":120 * levels.append(self.grids[i].level) * indices.append(self.grids[i].index) * nchild.append(self.grids[i].num_children) # <<<<<<<<<<<<<< * for j in range(self.grids[i].num_children): * childs.append(self.grids[i].children[j].index) */ - __pyx_t_1 = __Pyx_PyInt_From_npy_int32((__pyx_v_self->grids[__pyx_v_i]).num_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int32((__pyx_v_self->grids[__pyx_v_i]).num_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_nchild, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_nchild, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/grid_container.pyx":122 + /* "yt/geometry/grid_container.pyx":121 * indices.append(self.grids[i].index) * nchild.append(self.grids[i].num_children) * for j in range(self.grids[i].num_children): # <<<<<<<<<<<<<< @@ -4673,30 +4869,30 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "yt/geometry/grid_container.pyx":123 + /* "yt/geometry/grid_container.pyx":122 * nchild.append(self.grids[i].num_children) * for j in range(self.grids[i].num_children): * childs.append(self.grids[i].children[j].index) # <<<<<<<<<<<<<< * children.append(childs) * return indices, levels, nchild, children */ - __pyx_t_1 = __Pyx_PyInt_From_npy_int64(((__pyx_v_self->grids[__pyx_v_i]).children[__pyx_v_j])->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(((__pyx_v_self->grids[__pyx_v_i]).children[__pyx_v_j])->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_childs, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_childs, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "yt/geometry/grid_container.pyx":124 + /* "yt/geometry/grid_container.pyx":123 * for j in range(self.grids[i].num_children): * childs.append(self.grids[i].children[j].index) * children.append(childs) # <<<<<<<<<<<<<< * return indices, levels, nchild, children * */ - __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_children, __pyx_v_childs); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_children, __pyx_v_childs); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 123, __pyx_L1_error) } - /* "yt/geometry/grid_container.pyx":125 + /* "yt/geometry/grid_container.pyx":124 * childs.append(self.grids[i].children[j].index) * children.append(childs) * return indices, levels, nchild, children # <<<<<<<<<<<<<< @@ -4704,7 +4900,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_indices); __Pyx_GIVEREF(__pyx_v_indices); @@ -4722,7 +4918,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":111 + /* "yt/geometry/grid_container.pyx":110 * @cython.wraparound(False) * @cython.cdivision(True) * def return_tree_info(self): # <<<<<<<<<<<<<< @@ -4746,7 +4942,7 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":128 +/* "yt/geometry/grid_container.pyx":127 * * @property * def grid_arrays(self): # <<<<<<<<<<<<<< @@ -4794,7 +4990,7 @@ int __pyx_t_13; __Pyx_RefNannySetupContext("__get__", 0); - /* "yt/geometry/grid_container.pyx":131 + /* "yt/geometry/grid_container.pyx":130 * cdef GridTreeNodePadded[:] grids * grids = \ * ( self.grids) # <<<<<<<<<<<<<< @@ -4803,7 +4999,7 @@ */ __pyx_t_1 = ((struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded *)__pyx_v_self->grids); - /* "yt/geometry/grid_container.pyx":130 + /* "yt/geometry/grid_container.pyx":129 * def grid_arrays(self): * cdef GridTreeNodePadded[:] grids * grids = \ # <<<<<<<<<<<<<< @@ -4812,38 +5008,38 @@ */ if (!__pyx_t_1) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 131, __pyx_L1_error) + __PYX_ERR(0, 130, __pyx_L1_error) } __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded); __pyx_t_3 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->num_grids)); - if (unlikely(!__pyx_t_4 || !__pyx_t_3 || !PyBytes_AsString(__pyx_t_4))) __PYX_ERR(0, 130, __pyx_L1_error) + if (unlikely(!__pyx_t_4 || !__pyx_t_3 || !PyBytes_AsString(__pyx_t_4))) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_array_new(__pyx_t_3, sizeof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_t_1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __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_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(((PyObject *)__pyx_t_2)); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 130, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_grids = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/geometry/grid_container.pyx":132 + /* "yt/geometry/grid_container.pyx":131 * grids = \ * ( self.grids) * grids_basic = np.asarray(grids) # <<<<<<<<<<<<<< * # This next bit is necessary because as of 0.23.4, Cython can't make * # nested dtypes automatically where you have a property that is */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_grids, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_grids, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -4856,14 +5052,14 @@ } } if (!__pyx_t_7) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4872,20 +5068,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 131, __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_3); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -4894,46 +5090,46 @@ __pyx_v_grids_basic = __pyx_t_4; __pyx_t_4 = 0; - /* "yt/geometry/grid_container.pyx":137 + /* "yt/geometry/grid_container.pyx":136 * # something like float[3]. So we unroll all of those, then re-roll * # them in a new dtype. * dtn = {} # <<<<<<<<<<<<<< * dt = grids_basic.dtype * for name in dt.names: */ - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_dtn = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/grid_container.pyx":138 + /* "yt/geometry/grid_container.pyx":137 * # them in a new dtype. * dtn = {} * dt = grids_basic.dtype # <<<<<<<<<<<<<< * for name in dt.names: * d, o = dt.fields[name] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_grids_basic, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_grids_basic, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_dt = __pyx_t_4; __pyx_t_4 = 0; - /* "yt/geometry/grid_container.pyx":139 + /* "yt/geometry/grid_container.pyx":138 * dtn = {} * dt = grids_basic.dtype * for name in dt.names: # <<<<<<<<<<<<<< * d, o = dt.fields[name] * n = name */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 138, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -4941,17 +5137,17 @@ if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 138, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 138, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -4961,7 +5157,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 139, __pyx_L1_error) + else __PYX_ERR(0, 138, __pyx_L1_error) } break; } @@ -4970,16 +5166,16 @@ __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/grid_container.pyx":140 + /* "yt/geometry/grid_container.pyx":139 * dt = grids_basic.dtype * for name in dt.names: * d, o = dt.fields[name] # <<<<<<<<<<<<<< * n = name * if name.endswith("_x"): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyObject_GetItem(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_8 = PyObject_GetItem(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { @@ -4992,7 +5188,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 140, __pyx_L1_error) + __PYX_ERR(0, 139, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -5005,15 +5201,15 @@ __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -5021,7 +5217,7 @@ __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_7), 2) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_7), 2) < 0) __PYX_ERR(0, 139, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; @@ -5029,7 +5225,7 @@ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 140, __pyx_L1_error) + __PYX_ERR(0, 139, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_4); @@ -5037,7 +5233,7 @@ __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/grid_container.pyx":141 + /* "yt/geometry/grid_container.pyx":140 * for name in dt.names: * d, o = dt.fields[name] * n = name # <<<<<<<<<<<<<< @@ -5047,32 +5243,32 @@ __Pyx_INCREF(__pyx_v_name); __Pyx_XDECREF_SET(__pyx_v_n, __pyx_v_name); - /* "yt/geometry/grid_container.pyx":142 + /* "yt/geometry/grid_container.pyx":141 * d, o = dt.fields[name] * n = name * if name.endswith("_x"): # <<<<<<<<<<<<<< * f = (d.char, 3) * n = name[:-2] */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_12) { - /* "yt/geometry/grid_container.pyx":143 + /* "yt/geometry/grid_container.pyx":142 * n = name * if name.endswith("_x"): * f = (d.char, 3) # <<<<<<<<<<<<<< * n = name[:-2] * elif name.endswith("_y") or name.endswith("_z"): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_char); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_char); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); @@ -5083,19 +5279,19 @@ __Pyx_XDECREF_SET(__pyx_v_f, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; - /* "yt/geometry/grid_container.pyx":144 + /* "yt/geometry/grid_container.pyx":143 * if name.endswith("_x"): * f = (d.char, 3) * n = name[:-2] # <<<<<<<<<<<<<< * elif name.endswith("_y") or name.endswith("_z"): * continue */ - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_name, 0, -2L, NULL, NULL, &__pyx_slice__5, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_name, 0, -2L, NULL, NULL, &__pyx_slice__5, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/grid_container.pyx":142 + /* "yt/geometry/grid_container.pyx":141 * d, o = dt.fields[name] * n = name * if name.endswith("_x"): # <<<<<<<<<<<<<< @@ -5105,37 +5301,37 @@ goto __pyx_L7; } - /* "yt/geometry/grid_container.pyx":145 + /* "yt/geometry/grid_container.pyx":144 * f = (d.char, 3) * n = name[:-2] * elif name.endswith("_y") or name.endswith("_z"): # <<<<<<<<<<<<<< * continue * else: */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L8_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = __pyx_t_13; __pyx_L8_bool_binop_done:; if (__pyx_t_12) { - /* "yt/geometry/grid_container.pyx":146 + /* "yt/geometry/grid_container.pyx":145 * n = name[:-2] * elif name.endswith("_y") or name.endswith("_z"): * continue # <<<<<<<<<<<<<< @@ -5144,7 +5340,7 @@ */ goto __pyx_L3_continue; - /* "yt/geometry/grid_container.pyx":145 + /* "yt/geometry/grid_container.pyx":144 * f = (d.char, 3) * n = name[:-2] * elif name.endswith("_y") or name.endswith("_z"): # <<<<<<<<<<<<<< @@ -5153,7 +5349,7 @@ */ } - /* "yt/geometry/grid_container.pyx":148 + /* "yt/geometry/grid_container.pyx":147 * continue * else: * f = (d.char, 1) # <<<<<<<<<<<<<< @@ -5161,9 +5357,9 @@ * return grids_basic.view(dtype=np.dtype(dtn)) */ /*else*/ { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_char); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_char); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); @@ -5176,14 +5372,14 @@ } __pyx_L7:; - /* "yt/geometry/grid_container.pyx":149 + /* "yt/geometry/grid_container.pyx":148 * else: * f = (d.char, 1) * dtn[n] = (f, o) # <<<<<<<<<<<<<< * return grids_basic.view(dtype=np.dtype(dtn)) * */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_f); __Pyx_GIVEREF(__pyx_v_f); @@ -5191,10 +5387,10 @@ __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_o); - if (unlikely(PyDict_SetItem(__pyx_v_dtn, __pyx_v_n, __pyx_t_3) < 0)) __PYX_ERR(0, 149, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_dtn, __pyx_v_n, __pyx_t_3) < 0)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/grid_container.pyx":139 + /* "yt/geometry/grid_container.pyx":138 * dtn = {} * dt = grids_basic.dtype * for name in dt.names: # <<<<<<<<<<<<<< @@ -5205,7 +5401,7 @@ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "yt/geometry/grid_container.pyx":150 + /* "yt/geometry/grid_container.pyx":149 * f = (d.char, 1) * dtn[n] = (f, o) * return grids_basic.view(dtype=np.dtype(dtn)) # <<<<<<<<<<<<<< @@ -5213,21 +5409,21 @@ * cdef void setup_data(self, GridVisitorData *data): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grids_basic, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grids_basic, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_dtn); __Pyx_GIVEREF(__pyx_v_dtn); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_dtn); - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5235,7 +5431,7 @@ __pyx_t_4 = 0; goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":128 + /* "yt/geometry/grid_container.pyx":127 * * @property * def grid_arrays(self): # <<<<<<<<<<<<<< @@ -5269,7 +5465,7 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":152 +/* "yt/geometry/grid_container.pyx":151 * return grids_basic.view(dtype=np.dtype(dtn)) * * cdef void setup_data(self, GridVisitorData *data): # <<<<<<<<<<<<<< @@ -5281,7 +5477,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setup_data", 0); - /* "yt/geometry/grid_container.pyx":154 + /* "yt/geometry/grid_container.pyx":153 * cdef void setup_data(self, GridVisitorData *data): * # Being handed a new GVD object, we initialize it to sane defaults. * data.index = 0 # <<<<<<<<<<<<<< @@ -5290,7 +5486,7 @@ */ __pyx_v_data->index = 0; - /* "yt/geometry/grid_container.pyx":155 + /* "yt/geometry/grid_container.pyx":154 * # Being handed a new GVD object, we initialize it to sane defaults. * data.index = 0 * data.global_index = 0 # <<<<<<<<<<<<<< @@ -5299,7 +5495,7 @@ */ __pyx_v_data->global_index = 0; - /* "yt/geometry/grid_container.pyx":156 + /* "yt/geometry/grid_container.pyx":155 * data.index = 0 * data.global_index = 0 * data.n_tuples = 0 # <<<<<<<<<<<<<< @@ -5308,7 +5504,7 @@ */ __pyx_v_data->n_tuples = 0; - /* "yt/geometry/grid_container.pyx":157 + /* "yt/geometry/grid_container.pyx":156 * data.global_index = 0 * data.n_tuples = 0 * data.child_tuples = NULL # <<<<<<<<<<<<<< @@ -5317,7 +5513,7 @@ */ __pyx_v_data->child_tuples = NULL; - /* "yt/geometry/grid_container.pyx":158 + /* "yt/geometry/grid_container.pyx":157 * data.n_tuples = 0 * data.child_tuples = NULL * data.array = NULL # <<<<<<<<<<<<<< @@ -5326,7 +5522,7 @@ */ __pyx_v_data->array = NULL; - /* "yt/geometry/grid_container.pyx":159 + /* "yt/geometry/grid_container.pyx":158 * data.child_tuples = NULL * data.array = NULL * data.ref_factor = 2 #### FIX THIS # <<<<<<<<<<<<<< @@ -5335,7 +5531,7 @@ */ __pyx_v_data->ref_factor = 2; - /* "yt/geometry/grid_container.pyx":152 + /* "yt/geometry/grid_container.pyx":151 * return grids_basic.view(dtype=np.dtype(dtn)) * * cdef void setup_data(self, GridVisitorData *data): # <<<<<<<<<<<<<< @@ -5347,7 +5543,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/grid_container.pyx":161 +/* "yt/geometry/grid_container.pyx":160 * data.ref_factor = 2 #### FIX THIS * * cdef void visit_grids(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -5368,7 +5564,7 @@ struct __pyx_opt_args_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid __pyx_t_6; __Pyx_RefNannySetupContext("visit_grids", 0); - /* "yt/geometry/grid_container.pyx":170 + /* "yt/geometry/grid_container.pyx":169 * # going to do this the stupid way for now. * cdef GridTreeNode *grid * cdef np.uint8_t *buf = NULL # <<<<<<<<<<<<<< @@ -5377,7 +5573,7 @@ */ __pyx_v_buf = NULL; - /* "yt/geometry/grid_container.pyx":171 + /* "yt/geometry/grid_container.pyx":170 * cdef GridTreeNode *grid * cdef np.uint8_t *buf = NULL * if self.mask is not None: # <<<<<<<<<<<<<< @@ -5388,7 +5584,7 @@ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "yt/geometry/grid_container.pyx":172 + /* "yt/geometry/grid_container.pyx":171 * cdef np.uint8_t *buf = NULL * if self.mask is not None: * buf = self.mask.buf # <<<<<<<<<<<<<< @@ -5398,7 +5594,7 @@ __pyx_t_3 = __pyx_v_self->mask->buf; __pyx_v_buf = __pyx_t_3; - /* "yt/geometry/grid_container.pyx":171 + /* "yt/geometry/grid_container.pyx":170 * cdef GridTreeNode *grid * cdef np.uint8_t *buf = NULL * if self.mask is not None: # <<<<<<<<<<<<<< @@ -5407,7 +5603,7 @@ */ } - /* "yt/geometry/grid_container.pyx":173 + /* "yt/geometry/grid_container.pyx":172 * if self.mask is not None: * buf = self.mask.buf * for i in range(self.num_root_grids): # <<<<<<<<<<<<<< @@ -5418,7 +5614,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "yt/geometry/grid_container.pyx":174 + /* "yt/geometry/grid_container.pyx":173 * buf = self.mask.buf * for i in range(self.num_root_grids): * grid = &self.root_grids[i] # <<<<<<<<<<<<<< @@ -5427,7 +5623,7 @@ */ __pyx_v_grid = (&(__pyx_v_self->root_grids[__pyx_v_i])); - /* "yt/geometry/grid_container.pyx":175 + /* "yt/geometry/grid_container.pyx":174 * for i in range(self.num_root_grids): * grid = &self.root_grids[i] * self.recursively_visit_grid(data, func, selector, grid, buf) # <<<<<<<<<<<<<< @@ -5439,7 +5635,7 @@ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->recursively_visit_grid(__pyx_v_self, __pyx_v_data, __pyx_v_func, __pyx_v_selector, __pyx_v_grid, &__pyx_t_6); } - /* "yt/geometry/grid_container.pyx":176 + /* "yt/geometry/grid_container.pyx":175 * grid = &self.root_grids[i] * self.recursively_visit_grid(data, func, selector, grid, buf) * grid_visitors.free_tuples(data) # <<<<<<<<<<<<<< @@ -5448,7 +5644,7 @@ */ __pyx_f_2yt_8geometry_13grid_visitors_free_tuples(__pyx_v_data); - /* "yt/geometry/grid_container.pyx":161 + /* "yt/geometry/grid_container.pyx":160 * data.ref_factor = 2 #### FIX THIS * * cdef void visit_grids(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -5460,7 +5656,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/grid_container.pyx":178 +/* "yt/geometry/grid_container.pyx":177 * grid_visitors.free_tuples(data) * * cdef void recursively_visit_grid(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -5470,7 +5666,7 @@ static void __pyx_f_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *__pyx_v_func, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *__pyx_v_grid, struct __pyx_opt_args_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid *__pyx_optional_args) { - /* "yt/geometry/grid_container.pyx":182 + /* "yt/geometry/grid_container.pyx":181 * SelectorObject selector, * GridTreeNode *grid, * np.uint8_t *buf = NULL): # <<<<<<<<<<<<<< @@ -5492,7 +5688,7 @@ } } - /* "yt/geometry/grid_container.pyx":186 + /* "yt/geometry/grid_container.pyx":185 * # function. We early terminate if we are not selected by the selector. * cdef int i * data.grid = grid # <<<<<<<<<<<<<< @@ -5501,7 +5697,7 @@ */ __pyx_v_data->grid = __pyx_v_grid; - /* "yt/geometry/grid_container.pyx":187 + /* "yt/geometry/grid_container.pyx":186 * cdef int i * data.grid = grid * if selector.select_bbox(grid.left_edge, grid.right_edge) == 0: # <<<<<<<<<<<<<< @@ -5511,7 +5707,7 @@ __pyx_t_1 = ((((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->select_bbox(__pyx_v_selector, __pyx_v_grid->left_edge, __pyx_v_grid->right_edge) == 0) != 0); if (__pyx_t_1) { - /* "yt/geometry/grid_container.pyx":189 + /* "yt/geometry/grid_container.pyx":188 * if selector.select_bbox(grid.left_edge, grid.right_edge) == 0: * # Note that this does not increment the global_index. * return # <<<<<<<<<<<<<< @@ -5520,7 +5716,7 @@ */ goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":187 + /* "yt/geometry/grid_container.pyx":186 * cdef int i * data.grid = grid * if selector.select_bbox(grid.left_edge, grid.right_edge) == 0: # <<<<<<<<<<<<<< @@ -5529,7 +5725,7 @@ */ } - /* "yt/geometry/grid_container.pyx":190 + /* "yt/geometry/grid_container.pyx":189 * # Note that this does not increment the global_index. * return * grid_visitors.setup_tuples(data) # <<<<<<<<<<<<<< @@ -5538,7 +5734,7 @@ */ __pyx_f_2yt_8geometry_13grid_visitors_setup_tuples(__pyx_v_data); - /* "yt/geometry/grid_container.pyx":191 + /* "yt/geometry/grid_container.pyx":190 * return * grid_visitors.setup_tuples(data) * selector.visit_grid_cells(data, func, buf) # <<<<<<<<<<<<<< @@ -5549,7 +5745,7 @@ __pyx_t_2.cached_mask = __pyx_v_buf; ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->visit_grid_cells(__pyx_v_selector, __pyx_v_data, __pyx_v_func, &__pyx_t_2); - /* "yt/geometry/grid_container.pyx":192 + /* "yt/geometry/grid_container.pyx":191 * grid_visitors.setup_tuples(data) * selector.visit_grid_cells(data, func, buf) * for i in range(grid.num_children): # <<<<<<<<<<<<<< @@ -5560,7 +5756,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/grid_container.pyx":193 + /* "yt/geometry/grid_container.pyx":192 * selector.visit_grid_cells(data, func, buf) * for i in range(grid.num_children): * self.recursively_visit_grid(data, func, selector, grid.children[i], # <<<<<<<<<<<<<< @@ -5572,7 +5768,7 @@ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->recursively_visit_grid(__pyx_v_self, __pyx_v_data, __pyx_v_func, __pyx_v_selector, (__pyx_v_grid->children[__pyx_v_i]), &__pyx_t_5); } - /* "yt/geometry/grid_container.pyx":178 + /* "yt/geometry/grid_container.pyx":177 * grid_visitors.free_tuples(data) * * cdef void recursively_visit_grid(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -5585,7 +5781,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/grid_container.pyx":196 +/* "yt/geometry/grid_container.pyx":195 * buf) * * def count(self, SelectorObject selector): # <<<<<<<<<<<<<< @@ -5599,7 +5795,7 @@ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("count (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 196, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 195, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_9count(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector)); /* function exit code */ @@ -5624,7 +5820,7 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("count", 0); - /* "yt/geometry/grid_container.pyx":199 + /* "yt/geometry/grid_container.pyx":198 * # Use the counting grid visitor * cdef GridVisitorData data * self.setup_data(&data) # <<<<<<<<<<<<<< @@ -5633,7 +5829,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->setup_data(__pyx_v_self, (&__pyx_v_data)); - /* "yt/geometry/grid_container.pyx":200 + /* "yt/geometry/grid_container.pyx":199 * cdef GridVisitorData data * self.setup_data(&data) * cdef np.uint64_t size = 0 # <<<<<<<<<<<<<< @@ -5642,7 +5838,7 @@ */ __pyx_v_size = 0; - /* "yt/geometry/grid_container.pyx":202 + /* "yt/geometry/grid_container.pyx":201 * cdef np.uint64_t size = 0 * cdef int i * for i in range(self.num_grids): # <<<<<<<<<<<<<< @@ -5653,7 +5849,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/grid_container.pyx":203 + /* "yt/geometry/grid_container.pyx":202 * cdef int i * for i in range(self.num_grids): * size += (self.grids[i].dims[0] * # <<<<<<<<<<<<<< @@ -5663,27 +5859,27 @@ __pyx_v_size = (__pyx_v_size + ((((__pyx_v_self->grids[__pyx_v_i]).dims[0]) * ((__pyx_v_self->grids[__pyx_v_i]).dims[1])) * ((__pyx_v_self->grids[__pyx_v_i]).dims[2]))); } - /* "yt/geometry/grid_container.pyx":206 + /* "yt/geometry/grid_container.pyx":205 * self.grids[i].dims[1] * * self.grids[i].dims[2]) * cdef bitarray mask = bitarray(size) # <<<<<<<<<<<<<< * data.array = mask.buf * self.visit_grids(&data, grid_visitors.mask_cells, selector) */ - __pyx_t_3 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_mask = ((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/grid_container.pyx":207 + /* "yt/geometry/grid_container.pyx":206 * self.grids[i].dims[2]) * cdef bitarray mask = bitarray(size) * data.array = mask.buf # <<<<<<<<<<<<<< @@ -5692,7 +5888,7 @@ */ __pyx_v_data.array = ((void *)__pyx_v_mask->buf); - /* "yt/geometry/grid_container.pyx":208 + /* "yt/geometry/grid_container.pyx":207 * cdef bitarray mask = bitarray(size) * data.array = mask.buf * self.visit_grids(&data, grid_visitors.mask_cells, selector) # <<<<<<<<<<<<<< @@ -5701,7 +5897,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_mask_cells, __pyx_v_selector); - /* "yt/geometry/grid_container.pyx":209 + /* "yt/geometry/grid_container.pyx":208 * data.array = mask.buf * self.visit_grids(&data, grid_visitors.mask_cells, selector) * self.mask = mask # <<<<<<<<<<<<<< @@ -5714,7 +5910,7 @@ __Pyx_DECREF(((PyObject *)__pyx_v_self->mask)); __pyx_v_self->mask = __pyx_v_mask; - /* "yt/geometry/grid_container.pyx":210 + /* "yt/geometry/grid_container.pyx":209 * self.visit_grids(&data, grid_visitors.mask_cells, selector) * self.mask = mask * size = 0 # <<<<<<<<<<<<<< @@ -5723,7 +5919,7 @@ */ __pyx_v_size = 0; - /* "yt/geometry/grid_container.pyx":211 + /* "yt/geometry/grid_container.pyx":210 * self.mask = mask * size = 0 * self.setup_data(&data) # <<<<<<<<<<<<<< @@ -5732,7 +5928,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->setup_data(__pyx_v_self, (&__pyx_v_data)); - /* "yt/geometry/grid_container.pyx":212 + /* "yt/geometry/grid_container.pyx":211 * size = 0 * self.setup_data(&data) * data.array = (&size) # <<<<<<<<<<<<<< @@ -5741,7 +5937,7 @@ */ __pyx_v_data.array = ((void *)(&__pyx_v_size)); - /* "yt/geometry/grid_container.pyx":213 + /* "yt/geometry/grid_container.pyx":212 * self.setup_data(&data) * data.array = (&size) * self.visit_grids(&data, grid_visitors.count_cells, selector) # <<<<<<<<<<<<<< @@ -5750,7 +5946,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_count_cells, __pyx_v_selector); - /* "yt/geometry/grid_container.pyx":214 + /* "yt/geometry/grid_container.pyx":213 * data.array = (&size) * self.visit_grids(&data, grid_visitors.count_cells, selector) * return size # <<<<<<<<<<<<<< @@ -5758,13 +5954,13 @@ * def select_icoords(self, SelectorObject selector, np.uint64_t size = -1): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":196 + /* "yt/geometry/grid_container.pyx":195 * buf) * * def count(self, SelectorObject selector): # <<<<<<<<<<<<<< @@ -5785,7 +5981,7 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":216 +/* "yt/geometry/grid_container.pyx":215 * return size * * def select_icoords(self, SelectorObject selector, np.uint64_t size = -1): # <<<<<<<<<<<<<< @@ -5809,7 +6005,9 @@ 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; } @@ -5818,6 +6016,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); @@ -5825,11 +6024,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_icoords") < 0)) __PYX_ERR(0, 216, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_icoords") < 0)) __PYX_ERR(0, 215, __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; @@ -5837,20 +6037,20 @@ } __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]); if (values[1]) { - __pyx_v_size = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_size == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_size == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) } else { __pyx_v_size = ((__pyx_t_5numpy_uint64_t)-1LL); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_icoords", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 216, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_icoords", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 215, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.select_icoords", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 216, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 215, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_11select_icoords(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), __pyx_v_selector, __pyx_v_size); /* function exit code */ @@ -5886,7 +6086,7 @@ __pyx_pybuffernd_icoords.data = NULL; __pyx_pybuffernd_icoords.rcbuffer = &__pyx_pybuffer_icoords; - /* "yt/geometry/grid_container.pyx":219 + /* "yt/geometry/grid_container.pyx":218 * # Fill icoords with a selector * cdef GridVisitorData data * self.setup_data(&data) # <<<<<<<<<<<<<< @@ -5895,7 +6095,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->setup_data(__pyx_v_self, (&__pyx_v_data)); - /* "yt/geometry/grid_container.pyx":220 + /* "yt/geometry/grid_container.pyx":219 * cdef GridVisitorData data * self.setup_data(&data) * if size == -1: # <<<<<<<<<<<<<< @@ -5905,7 +6105,7 @@ __pyx_t_1 = ((__pyx_v_size == -1LL) != 0); if (__pyx_t_1) { - /* "yt/geometry/grid_container.pyx":221 + /* "yt/geometry/grid_container.pyx":220 * self.setup_data(&data) * if size == -1: * size = 0 # <<<<<<<<<<<<<< @@ -5914,7 +6114,7 @@ */ __pyx_v_size = 0; - /* "yt/geometry/grid_container.pyx":222 + /* "yt/geometry/grid_container.pyx":221 * if size == -1: * size = 0 * data.array = (&size) # <<<<<<<<<<<<<< @@ -5923,7 +6123,7 @@ */ __pyx_v_data.array = ((void *)(&__pyx_v_size)); - /* "yt/geometry/grid_container.pyx":223 + /* "yt/geometry/grid_container.pyx":222 * size = 0 * data.array = (&size) * self.visit_grids(&data, grid_visitors.count_cells, selector) # <<<<<<<<<<<<<< @@ -5932,7 +6132,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_count_cells, __pyx_v_selector); - /* "yt/geometry/grid_container.pyx":220 + /* "yt/geometry/grid_container.pyx":219 * cdef GridVisitorData data * self.setup_data(&data) * if size == -1: # <<<<<<<<<<<<<< @@ -5941,21 +6141,21 @@ */ } - /* "yt/geometry/grid_container.pyx":225 + /* "yt/geometry/grid_container.pyx":224 * self.visit_grids(&data, grid_visitors.count_cells, selector) * cdef np.ndarray[np.int64_t, ndim=2] icoords * icoords = np.empty((size, 3), dtype="int64") # <<<<<<<<<<<<<< * data.array = icoords.data * self.visit_grids(&data, grid_visitors.icoords_cells, selector) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -5963,20 +6163,20 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_3); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __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 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 225, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 225, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 224, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5992,13 +6192,13 @@ } } __pyx_pybuffernd_icoords.diminfo[0].strides = __pyx_pybuffernd_icoords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_icoords.diminfo[0].shape = __pyx_pybuffernd_icoords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_icoords.diminfo[1].strides = __pyx_pybuffernd_icoords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_icoords.diminfo[1].shape = __pyx_pybuffernd_icoords.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 225, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 224, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_icoords = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/grid_container.pyx":226 + /* "yt/geometry/grid_container.pyx":225 * cdef np.ndarray[np.int64_t, ndim=2] icoords * icoords = np.empty((size, 3), dtype="int64") * data.array = icoords.data # <<<<<<<<<<<<<< @@ -6008,7 +6208,7 @@ __pyx_t_11 = __pyx_v_icoords->data; __pyx_v_data.array = __pyx_t_11; - /* "yt/geometry/grid_container.pyx":227 + /* "yt/geometry/grid_container.pyx":226 * icoords = np.empty((size, 3), dtype="int64") * data.array = icoords.data * self.visit_grids(&data, grid_visitors.icoords_cells, selector) # <<<<<<<<<<<<<< @@ -6017,7 +6217,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_icoords_cells, __pyx_v_selector); - /* "yt/geometry/grid_container.pyx":228 + /* "yt/geometry/grid_container.pyx":227 * data.array = icoords.data * self.visit_grids(&data, grid_visitors.icoords_cells, selector) * return icoords # <<<<<<<<<<<<<< @@ -6029,7 +6229,7 @@ __pyx_r = ((PyObject *)__pyx_v_icoords); goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":216 + /* "yt/geometry/grid_container.pyx":215 * return size * * def select_icoords(self, SelectorObject selector, np.uint64_t size = -1): # <<<<<<<<<<<<<< @@ -6061,7 +6261,7 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":230 +/* "yt/geometry/grid_container.pyx":229 * return icoords * * def select_ires(self, SelectorObject selector, np.uint64_t size = -1): # <<<<<<<<<<<<<< @@ -6085,7 +6285,9 @@ 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; } @@ -6094,6 +6296,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); @@ -6101,11 +6304,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_ires") < 0)) __PYX_ERR(0, 230, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_ires") < 0)) __PYX_ERR(0, 229, __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; @@ -6113,20 +6317,20 @@ } __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]); if (values[1]) { - __pyx_v_size = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_size == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_size == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L3_error) } else { __pyx_v_size = ((__pyx_t_5numpy_uint64_t)-1LL); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_ires", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 230, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_ires", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 229, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.select_ires", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 230, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 229, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_13select_ires(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), __pyx_v_selector, __pyx_v_size); /* function exit code */ @@ -6162,7 +6366,7 @@ __pyx_pybuffernd_ires.data = NULL; __pyx_pybuffernd_ires.rcbuffer = &__pyx_pybuffer_ires; - /* "yt/geometry/grid_container.pyx":233 + /* "yt/geometry/grid_container.pyx":232 * # Fill ires with a selector * cdef GridVisitorData data * self.setup_data(&data) # <<<<<<<<<<<<<< @@ -6171,7 +6375,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->setup_data(__pyx_v_self, (&__pyx_v_data)); - /* "yt/geometry/grid_container.pyx":234 + /* "yt/geometry/grid_container.pyx":233 * cdef GridVisitorData data * self.setup_data(&data) * if size == -1: # <<<<<<<<<<<<<< @@ -6181,7 +6385,7 @@ __pyx_t_1 = ((__pyx_v_size == -1LL) != 0); if (__pyx_t_1) { - /* "yt/geometry/grid_container.pyx":235 + /* "yt/geometry/grid_container.pyx":234 * self.setup_data(&data) * if size == -1: * size = 0 # <<<<<<<<<<<<<< @@ -6190,7 +6394,7 @@ */ __pyx_v_size = 0; - /* "yt/geometry/grid_container.pyx":236 + /* "yt/geometry/grid_container.pyx":235 * if size == -1: * size = 0 * data.array = (&size) # <<<<<<<<<<<<<< @@ -6199,7 +6403,7 @@ */ __pyx_v_data.array = ((void *)(&__pyx_v_size)); - /* "yt/geometry/grid_container.pyx":237 + /* "yt/geometry/grid_container.pyx":236 * size = 0 * data.array = (&size) * self.visit_grids(&data, grid_visitors.count_cells, selector) # <<<<<<<<<<<<<< @@ -6208,7 +6412,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_count_cells, __pyx_v_selector); - /* "yt/geometry/grid_container.pyx":234 + /* "yt/geometry/grid_container.pyx":233 * cdef GridVisitorData data * self.setup_data(&data) * if size == -1: # <<<<<<<<<<<<<< @@ -6217,34 +6421,34 @@ */ } - /* "yt/geometry/grid_container.pyx":239 + /* "yt/geometry/grid_container.pyx":238 * self.visit_grids(&data, grid_visitors.count_cells, selector) * cdef np.ndarray[np.int64_t, ndim=1] ires * ires = np.empty(size, dtype="int64") # <<<<<<<<<<<<<< * data.array = ires.data * self.visit_grids(&data, grid_visitors.ires_cells, selector) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 239, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_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, 239, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6260,13 +6464,13 @@ } } __pyx_pybuffernd_ires.diminfo[0].strides = __pyx_pybuffernd_ires.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ires.diminfo[0].shape = __pyx_pybuffernd_ires.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 239, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 238, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_ires = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/grid_container.pyx":240 + /* "yt/geometry/grid_container.pyx":239 * cdef np.ndarray[np.int64_t, ndim=1] ires * ires = np.empty(size, dtype="int64") * data.array = ires.data # <<<<<<<<<<<<<< @@ -6276,7 +6480,7 @@ __pyx_t_11 = __pyx_v_ires->data; __pyx_v_data.array = __pyx_t_11; - /* "yt/geometry/grid_container.pyx":241 + /* "yt/geometry/grid_container.pyx":240 * ires = np.empty(size, dtype="int64") * data.array = ires.data * self.visit_grids(&data, grid_visitors.ires_cells, selector) # <<<<<<<<<<<<<< @@ -6285,7 +6489,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_ires_cells, __pyx_v_selector); - /* "yt/geometry/grid_container.pyx":242 + /* "yt/geometry/grid_container.pyx":241 * data.array = ires.data * self.visit_grids(&data, grid_visitors.ires_cells, selector) * return ires # <<<<<<<<<<<<<< @@ -6297,7 +6501,7 @@ __pyx_r = ((PyObject *)__pyx_v_ires); goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":230 + /* "yt/geometry/grid_container.pyx":229 * return icoords * * def select_ires(self, SelectorObject selector, np.uint64_t size = -1): # <<<<<<<<<<<<<< @@ -6329,7 +6533,7 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":244 +/* "yt/geometry/grid_container.pyx":243 * return ires * * def select_fcoords(self, SelectorObject selector, np.uint64_t size = -1): # <<<<<<<<<<<<<< @@ -6353,7 +6557,9 @@ 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; } @@ -6362,6 +6568,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); @@ -6369,11 +6576,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_fcoords") < 0)) __PYX_ERR(0, 244, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_fcoords") < 0)) __PYX_ERR(0, 243, __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; @@ -6381,20 +6589,20 @@ } __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]); if (values[1]) { - __pyx_v_size = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_size == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_size == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 243, __pyx_L3_error) } else { __pyx_v_size = ((__pyx_t_5numpy_uint64_t)-1LL); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_fcoords", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 244, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_fcoords", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 243, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.select_fcoords", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 244, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_15select_fcoords(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), __pyx_v_selector, __pyx_v_size); /* function exit code */ @@ -6430,7 +6638,7 @@ __pyx_pybuffernd_fcoords.data = NULL; __pyx_pybuffernd_fcoords.rcbuffer = &__pyx_pybuffer_fcoords; - /* "yt/geometry/grid_container.pyx":247 + /* "yt/geometry/grid_container.pyx":246 * # Fill fcoords with a selector * cdef GridVisitorData data * self.setup_data(&data) # <<<<<<<<<<<<<< @@ -6439,7 +6647,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->setup_data(__pyx_v_self, (&__pyx_v_data)); - /* "yt/geometry/grid_container.pyx":248 + /* "yt/geometry/grid_container.pyx":247 * cdef GridVisitorData data * self.setup_data(&data) * if size == -1: # <<<<<<<<<<<<<< @@ -6449,7 +6657,7 @@ __pyx_t_1 = ((__pyx_v_size == -1LL) != 0); if (__pyx_t_1) { - /* "yt/geometry/grid_container.pyx":249 + /* "yt/geometry/grid_container.pyx":248 * self.setup_data(&data) * if size == -1: * size = 0 # <<<<<<<<<<<<<< @@ -6458,7 +6666,7 @@ */ __pyx_v_size = 0; - /* "yt/geometry/grid_container.pyx":250 + /* "yt/geometry/grid_container.pyx":249 * if size == -1: * size = 0 * data.array = (&size) # <<<<<<<<<<<<<< @@ -6467,7 +6675,7 @@ */ __pyx_v_data.array = ((void *)(&__pyx_v_size)); - /* "yt/geometry/grid_container.pyx":251 + /* "yt/geometry/grid_container.pyx":250 * size = 0 * data.array = (&size) * self.visit_grids(&data, grid_visitors.count_cells, selector) # <<<<<<<<<<<<<< @@ -6476,7 +6684,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_count_cells, __pyx_v_selector); - /* "yt/geometry/grid_container.pyx":248 + /* "yt/geometry/grid_container.pyx":247 * cdef GridVisitorData data * self.setup_data(&data) * if size == -1: # <<<<<<<<<<<<<< @@ -6485,21 +6693,21 @@ */ } - /* "yt/geometry/grid_container.pyx":253 + /* "yt/geometry/grid_container.pyx":252 * self.visit_grids(&data, grid_visitors.count_cells, selector) * cdef np.ndarray[np.float64_t, ndim=2] fcoords * fcoords = np.empty((size, 3), dtype="float64") # <<<<<<<<<<<<<< * data.array = fcoords.data * self.visit_grids(&data, grid_visitors.fcoords_cells, selector) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -6507,20 +6715,20 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_3); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __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 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 253, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 253, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 252, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6536,13 +6744,13 @@ } } __pyx_pybuffernd_fcoords.diminfo[0].strides = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fcoords.diminfo[0].shape = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fcoords.diminfo[1].strides = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fcoords.diminfo[1].shape = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 252, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_fcoords = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/grid_container.pyx":254 + /* "yt/geometry/grid_container.pyx":253 * cdef np.ndarray[np.float64_t, ndim=2] fcoords * fcoords = np.empty((size, 3), dtype="float64") * data.array = fcoords.data # <<<<<<<<<<<<<< @@ -6552,7 +6760,7 @@ __pyx_t_11 = __pyx_v_fcoords->data; __pyx_v_data.array = __pyx_t_11; - /* "yt/geometry/grid_container.pyx":255 + /* "yt/geometry/grid_container.pyx":254 * fcoords = np.empty((size, 3), dtype="float64") * data.array = fcoords.data * self.visit_grids(&data, grid_visitors.fcoords_cells, selector) # <<<<<<<<<<<<<< @@ -6561,7 +6769,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_fcoords_cells, __pyx_v_selector); - /* "yt/geometry/grid_container.pyx":256 + /* "yt/geometry/grid_container.pyx":255 * data.array = fcoords.data * self.visit_grids(&data, grid_visitors.fcoords_cells, selector) * return fcoords # <<<<<<<<<<<<<< @@ -6573,7 +6781,7 @@ __pyx_r = ((PyObject *)__pyx_v_fcoords); goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":244 + /* "yt/geometry/grid_container.pyx":243 * return ires * * def select_fcoords(self, SelectorObject selector, np.uint64_t size = -1): # <<<<<<<<<<<<<< @@ -6605,7 +6813,7 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":258 +/* "yt/geometry/grid_container.pyx":257 * return fcoords * * def select_fwidth(self, SelectorObject selector, np.uint64_t size = -1): # <<<<<<<<<<<<<< @@ -6629,7 +6837,9 @@ 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; } @@ -6638,6 +6848,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); @@ -6645,11 +6856,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_fwidth") < 0)) __PYX_ERR(0, 258, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_fwidth") < 0)) __PYX_ERR(0, 257, __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; @@ -6657,20 +6869,20 @@ } __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]); if (values[1]) { - __pyx_v_size = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_size == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 258, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_size == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 257, __pyx_L3_error) } else { __pyx_v_size = ((__pyx_t_5numpy_uint64_t)-1LL); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_fwidth", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 258, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_fwidth", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 257, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.select_fwidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 258, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 257, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_17select_fwidth(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), __pyx_v_selector, __pyx_v_size); /* function exit code */ @@ -6706,7 +6918,7 @@ __pyx_pybuffernd_fwidth.data = NULL; __pyx_pybuffernd_fwidth.rcbuffer = &__pyx_pybuffer_fwidth; - /* "yt/geometry/grid_container.pyx":261 + /* "yt/geometry/grid_container.pyx":260 * # Fill fwidth with a selector * cdef GridVisitorData data * self.setup_data(&data) # <<<<<<<<<<<<<< @@ -6715,7 +6927,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->setup_data(__pyx_v_self, (&__pyx_v_data)); - /* "yt/geometry/grid_container.pyx":262 + /* "yt/geometry/grid_container.pyx":261 * cdef GridVisitorData data * self.setup_data(&data) * if size == -1: # <<<<<<<<<<<<<< @@ -6725,7 +6937,7 @@ __pyx_t_1 = ((__pyx_v_size == -1LL) != 0); if (__pyx_t_1) { - /* "yt/geometry/grid_container.pyx":263 + /* "yt/geometry/grid_container.pyx":262 * self.setup_data(&data) * if size == -1: * size = 0 # <<<<<<<<<<<<<< @@ -6734,7 +6946,7 @@ */ __pyx_v_size = 0; - /* "yt/geometry/grid_container.pyx":264 + /* "yt/geometry/grid_container.pyx":263 * if size == -1: * size = 0 * data.array = (&size) # <<<<<<<<<<<<<< @@ -6743,7 +6955,7 @@ */ __pyx_v_data.array = ((void *)(&__pyx_v_size)); - /* "yt/geometry/grid_container.pyx":265 + /* "yt/geometry/grid_container.pyx":264 * size = 0 * data.array = (&size) * self.visit_grids(&data, grid_visitors.count_cells, selector) # <<<<<<<<<<<<<< @@ -6752,7 +6964,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_count_cells, __pyx_v_selector); - /* "yt/geometry/grid_container.pyx":262 + /* "yt/geometry/grid_container.pyx":261 * cdef GridVisitorData data * self.setup_data(&data) * if size == -1: # <<<<<<<<<<<<<< @@ -6761,21 +6973,21 @@ */ } - /* "yt/geometry/grid_container.pyx":267 + /* "yt/geometry/grid_container.pyx":266 * self.visit_grids(&data, grid_visitors.count_cells, selector) * cdef np.ndarray[np.float64_t, ndim=2] fwidth * fwidth = np.empty((size, 3), dtype="float64") # <<<<<<<<<<<<<< * data.array = fwidth.data * self.visit_grids(&data, grid_visitors.fwidth_cells, selector) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -6783,20 +6995,20 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_3); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __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 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 267, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 267, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 266, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6812,13 +7024,13 @@ } } __pyx_pybuffernd_fwidth.diminfo[0].strides = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fwidth.diminfo[0].shape = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fwidth.diminfo[1].strides = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fwidth.diminfo[1].shape = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 266, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_fwidth = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/grid_container.pyx":268 + /* "yt/geometry/grid_container.pyx":267 * cdef np.ndarray[np.float64_t, ndim=2] fwidth * fwidth = np.empty((size, 3), dtype="float64") * data.array = fwidth.data # <<<<<<<<<<<<<< @@ -6828,7 +7040,7 @@ __pyx_t_11 = __pyx_v_fwidth->data; __pyx_v_data.array = __pyx_t_11; - /* "yt/geometry/grid_container.pyx":269 + /* "yt/geometry/grid_container.pyx":268 * fwidth = np.empty((size, 3), dtype="float64") * data.array = fwidth.data * self.visit_grids(&data, grid_visitors.fwidth_cells, selector) # <<<<<<<<<<<<<< @@ -6837,7 +7049,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_fwidth_cells, __pyx_v_selector); - /* "yt/geometry/grid_container.pyx":270 + /* "yt/geometry/grid_container.pyx":269 * data.array = fwidth.data * self.visit_grids(&data, grid_visitors.fwidth_cells, selector) * return fwidth # <<<<<<<<<<<<<< @@ -6849,7 +7061,7 @@ __pyx_r = ((PyObject *)__pyx_v_fwidth); goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":258 + /* "yt/geometry/grid_container.pyx":257 * return fcoords * * def select_fwidth(self, SelectorObject selector, np.uint64_t size = -1): # <<<<<<<<<<<<<< @@ -6936,7 +7148,7 @@ __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray))))) __PYX_ERR(1, 34, __pyx_L1_error) + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray))))) __PYX_ERR(2, 34, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -6986,7 +7198,114 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":277 +/* "(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_2yt_8geometry_14grid_container_8GridTree_20__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_20__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_2yt_8geometry_14grid_container_8GridTree_19__reduce_cython__(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_19__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__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__8, 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("yt.geometry.grid_container.GridTree.__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_2yt_8geometry_14grid_container_8GridTree_22__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_22__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_2yt_8geometry_14grid_container_8GridTree_21__setstate_cython__(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_21__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__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__9, 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("yt.geometry.grid_container.GridTree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/grid_container.pyx":276 * @cython.wraparound(False) * @cython.cdivision(True) * def __cinit__(self, GridTree tree, # <<<<<<<<<<<<<< @@ -7013,10 +7332,15 @@ 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; } @@ -7025,29 +7349,33 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tree)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_points)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); __PYX_ERR(0, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); __PYX_ERR(0, 276, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); __PYX_ERR(0, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); __PYX_ERR(0, 276, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); __PYX_ERR(0, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); __PYX_ERR(0, 276, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z_2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); __PYX_ERR(0, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); __PYX_ERR(0, 276, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 276, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -7059,23 +7387,23 @@ values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_tree = ((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)values[0]); - __pyx_v_num_points = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_points == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L3_error) + __pyx_v_num_points = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_points == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 277, __pyx_L3_error) __pyx_v_x = ((PyArrayObject *)values[2]); __pyx_v_y = ((PyArrayObject *)values[3]); __pyx_v_z = ((PyArrayObject *)values[4]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 276, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.grid_container.MatchPointsToGrids.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_2yt_8geometry_14grid_container_GridTree, 1, "tree", 0))) __PYX_ERR(0, 277, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 279, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 280, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 281, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_2yt_8geometry_14grid_container_GridTree, 1, "tree", 0))) __PYX_ERR(0, 276, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 278, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 280, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids___cinit__(((struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self), __pyx_v_tree, __pyx_v_num_points, __pyx_v_x, __pyx_v_y, __pyx_v_z); /* function exit code */ @@ -7117,21 +7445,21 @@ __pyx_pybuffernd_z.rcbuffer = &__pyx_pybuffer_z; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 276, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 276, __pyx_L1_error) } __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 276, __pyx_L1_error) } __pyx_pybuffernd_z.diminfo[0].strides = __pyx_pybuffernd_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z.diminfo[0].shape = __pyx_pybuffernd_z.rcbuffer->pybuffer.shape[0]; - /* "yt/geometry/grid_container.pyx":285 + /* "yt/geometry/grid_container.pyx":284 * cdef int i * * self.num_points = num_points # <<<<<<<<<<<<<< @@ -7140,7 +7468,7 @@ */ __pyx_v_self->num_points = __pyx_v_num_points; - /* "yt/geometry/grid_container.pyx":286 + /* "yt/geometry/grid_container.pyx":285 * * self.num_points = num_points * self.xp = malloc( # <<<<<<<<<<<<<< @@ -7149,7 +7477,7 @@ */ __pyx_v_self->xp = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_num_points))); - /* "yt/geometry/grid_container.pyx":288 + /* "yt/geometry/grid_container.pyx":287 * self.xp = malloc( * sizeof(np.float64_t) * num_points) * self.yp = malloc( # <<<<<<<<<<<<<< @@ -7158,7 +7486,7 @@ */ __pyx_v_self->yp = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_num_points))); - /* "yt/geometry/grid_container.pyx":290 + /* "yt/geometry/grid_container.pyx":289 * self.yp = malloc( * sizeof(np.float64_t) * num_points) * self.zp = malloc( # <<<<<<<<<<<<<< @@ -7167,7 +7495,7 @@ */ __pyx_v_self->zp = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_num_points))); - /* "yt/geometry/grid_container.pyx":292 + /* "yt/geometry/grid_container.pyx":291 * self.zp = malloc( * sizeof(np.float64_t) * num_points) * self.point_grids = malloc( # <<<<<<<<<<<<<< @@ -7176,7 +7504,7 @@ */ __pyx_v_self->point_grids = ((__pyx_t_5numpy_int64_t *)malloc(((sizeof(__pyx_t_5numpy_int64_t)) * __pyx_v_num_points))); - /* "yt/geometry/grid_container.pyx":294 + /* "yt/geometry/grid_container.pyx":293 * self.point_grids = malloc( * sizeof(np.int64_t) * num_points) * for i in range(num_points): # <<<<<<<<<<<<<< @@ -7187,7 +7515,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/grid_container.pyx":295 + /* "yt/geometry/grid_container.pyx":294 * sizeof(np.int64_t) * num_points) * for i in range(num_points): * self.xp[i] = x[i] # <<<<<<<<<<<<<< @@ -7197,7 +7525,7 @@ __pyx_t_3 = __pyx_v_i; (__pyx_v_self->xp[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_x.diminfo[0].strides)); - /* "yt/geometry/grid_container.pyx":296 + /* "yt/geometry/grid_container.pyx":295 * for i in range(num_points): * self.xp[i] = x[i] * self.yp[i] = y[i] # <<<<<<<<<<<<<< @@ -7207,7 +7535,7 @@ __pyx_t_4 = __pyx_v_i; (__pyx_v_self->yp[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_y.diminfo[0].strides)); - /* "yt/geometry/grid_container.pyx":297 + /* "yt/geometry/grid_container.pyx":296 * self.xp[i] = x[i] * self.yp[i] = y[i] * self.zp[i] = z[i] # <<<<<<<<<<<<<< @@ -7217,7 +7545,7 @@ __pyx_t_5 = __pyx_v_i; (__pyx_v_self->zp[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_z.diminfo[0].strides)); - /* "yt/geometry/grid_container.pyx":298 + /* "yt/geometry/grid_container.pyx":297 * self.yp[i] = y[i] * self.zp[i] = z[i] * self.point_grids[i] = -1 # <<<<<<<<<<<<<< @@ -7227,7 +7555,7 @@ (__pyx_v_self->point_grids[__pyx_v_i]) = -1LL; } - /* "yt/geometry/grid_container.pyx":299 + /* "yt/geometry/grid_container.pyx":298 * self.zp[i] = z[i] * self.point_grids[i] = -1 * self.tree = tree # <<<<<<<<<<<<<< @@ -7240,7 +7568,7 @@ __Pyx_DECREF(((PyObject *)__pyx_v_self->tree)); __pyx_v_self->tree = __pyx_v_tree; - /* "yt/geometry/grid_container.pyx":277 + /* "yt/geometry/grid_container.pyx":276 * @cython.wraparound(False) * @cython.cdivision(True) * def __cinit__(self, GridTree tree, # <<<<<<<<<<<<<< @@ -7272,7 +7600,7 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":303 +/* "yt/geometry/grid_container.pyx":302 * @cython.boundscheck(False) * @cython.wraparound(False) * def find_points_in_tree(self): # <<<<<<<<<<<<<< @@ -7322,34 +7650,34 @@ __pyx_pybuffernd_pt_grids.data = NULL; __pyx_pybuffernd_pt_grids.rcbuffer = &__pyx_pybuffer_pt_grids; - /* "yt/geometry/grid_container.pyx":307 + /* "yt/geometry/grid_container.pyx":306 * cdef int i, j * cdef np.uint8_t in_grid * pt_grids = np.zeros(self.num_points, dtype='int64') # <<<<<<<<<<<<<< * for i in range(self.num_points): * in_grid = 0 */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __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, 307, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __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_self->num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 307, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __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_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, 307, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 306, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7365,13 +7693,13 @@ } } __pyx_pybuffernd_pt_grids.diminfo[0].strides = __pyx_pybuffernd_pt_grids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pt_grids.diminfo[0].shape = __pyx_pybuffernd_pt_grids.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 307, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 306, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_pt_grids = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/grid_container.pyx":308 + /* "yt/geometry/grid_container.pyx":307 * cdef np.uint8_t in_grid * pt_grids = np.zeros(self.num_points, dtype='int64') * for i in range(self.num_points): # <<<<<<<<<<<<<< @@ -7382,7 +7710,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_6; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "yt/geometry/grid_container.pyx":309 + /* "yt/geometry/grid_container.pyx":308 * pt_grids = np.zeros(self.num_points, dtype='int64') * for i in range(self.num_points): * in_grid = 0 # <<<<<<<<<<<<<< @@ -7391,7 +7719,7 @@ */ __pyx_v_in_grid = 0; - /* "yt/geometry/grid_container.pyx":310 + /* "yt/geometry/grid_container.pyx":309 * for i in range(self.num_points): * in_grid = 0 * for j in range(self.tree.num_root_grids): # <<<<<<<<<<<<<< @@ -7402,7 +7730,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_j = __pyx_t_12; - /* "yt/geometry/grid_container.pyx":311 + /* "yt/geometry/grid_container.pyx":310 * in_grid = 0 * for j in range(self.tree.num_root_grids): * if not in_grid: # <<<<<<<<<<<<<< @@ -7412,7 +7740,7 @@ __pyx_t_13 = ((!(__pyx_v_in_grid != 0)) != 0); if (__pyx_t_13) { - /* "yt/geometry/grid_container.pyx":312 + /* "yt/geometry/grid_container.pyx":311 * for j in range(self.tree.num_root_grids): * if not in_grid: * in_grid = self.check_position(i, self.xp[i], self.yp[i], self.zp[i], # <<<<<<<<<<<<<< @@ -7421,7 +7749,7 @@ */ __pyx_v_in_grid = ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self->__pyx_vtab)->check_position(__pyx_v_self, __pyx_v_i, (__pyx_v_self->xp[__pyx_v_i]), (__pyx_v_self->yp[__pyx_v_i]), (__pyx_v_self->zp[__pyx_v_i]), (&(__pyx_v_self->tree->root_grids[__pyx_v_j]))); - /* "yt/geometry/grid_container.pyx":311 + /* "yt/geometry/grid_container.pyx":310 * in_grid = 0 * for j in range(self.tree.num_root_grids): * if not in_grid: # <<<<<<<<<<<<<< @@ -7432,7 +7760,7 @@ } } - /* "yt/geometry/grid_container.pyx":314 + /* "yt/geometry/grid_container.pyx":313 * in_grid = self.check_position(i, self.xp[i], self.yp[i], self.zp[i], * &self.tree.root_grids[j]) * for i in range(self.num_points): # <<<<<<<<<<<<<< @@ -7443,7 +7771,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_6; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "yt/geometry/grid_container.pyx":315 + /* "yt/geometry/grid_container.pyx":314 * &self.tree.root_grids[j]) * for i in range(self.num_points): * pt_grids[i] = self.point_grids[i] # <<<<<<<<<<<<<< @@ -7454,7 +7782,7 @@ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_pt_grids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_pt_grids.diminfo[0].strides) = (__pyx_v_self->point_grids[__pyx_v_i]); } - /* "yt/geometry/grid_container.pyx":316 + /* "yt/geometry/grid_container.pyx":315 * for i in range(self.num_points): * pt_grids[i] = self.point_grids[i] * return pt_grids # <<<<<<<<<<<<<< @@ -7466,7 +7794,7 @@ __pyx_r = ((PyObject *)__pyx_v_pt_grids); goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":303 + /* "yt/geometry/grid_container.pyx":302 * @cython.boundscheck(False) * @cython.wraparound(False) * def find_points_in_tree(self): # <<<<<<<<<<<<<< @@ -7498,7 +7826,7 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":320 +/* "yt/geometry/grid_container.pyx":319 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.uint8_t check_position(self, # <<<<<<<<<<<<<< @@ -7517,7 +7845,7 @@ __pyx_t_5numpy_int64_t __pyx_t_4; __Pyx_RefNannySetupContext("check_position", 0); - /* "yt/geometry/grid_container.pyx":328 + /* "yt/geometry/grid_container.pyx":327 * cdef int i * cdef np.uint8_t in_grid * in_grid = self.is_in_grid(x, y, z, grid) # <<<<<<<<<<<<<< @@ -7526,7 +7854,7 @@ */ __pyx_v_in_grid = ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self->__pyx_vtab)->is_in_grid(__pyx_v_self, __pyx_v_x, __pyx_v_y, __pyx_v_z, __pyx_v_grid); - /* "yt/geometry/grid_container.pyx":329 + /* "yt/geometry/grid_container.pyx":328 * cdef np.uint8_t in_grid * in_grid = self.is_in_grid(x, y, z, grid) * if in_grid: # <<<<<<<<<<<<<< @@ -7536,7 +7864,7 @@ __pyx_t_1 = (__pyx_v_in_grid != 0); if (__pyx_t_1) { - /* "yt/geometry/grid_container.pyx":330 + /* "yt/geometry/grid_container.pyx":329 * in_grid = self.is_in_grid(x, y, z, grid) * if in_grid: * if grid.num_children > 0: # <<<<<<<<<<<<<< @@ -7546,7 +7874,7 @@ __pyx_t_1 = ((__pyx_v_grid->num_children > 0) != 0); if (__pyx_t_1) { - /* "yt/geometry/grid_container.pyx":331 + /* "yt/geometry/grid_container.pyx":330 * if in_grid: * if grid.num_children > 0: * in_grid = 0 # <<<<<<<<<<<<<< @@ -7555,7 +7883,7 @@ */ __pyx_v_in_grid = 0; - /* "yt/geometry/grid_container.pyx":332 + /* "yt/geometry/grid_container.pyx":331 * if grid.num_children > 0: * in_grid = 0 * for i in range(grid.num_children): # <<<<<<<<<<<<<< @@ -7566,7 +7894,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/geometry/grid_container.pyx":333 + /* "yt/geometry/grid_container.pyx":332 * in_grid = 0 * for i in range(grid.num_children): * if not in_grid: # <<<<<<<<<<<<<< @@ -7576,7 +7904,7 @@ __pyx_t_1 = ((!(__pyx_v_in_grid != 0)) != 0); if (__pyx_t_1) { - /* "yt/geometry/grid_container.pyx":334 + /* "yt/geometry/grid_container.pyx":333 * for i in range(grid.num_children): * if not in_grid: * in_grid = self.check_position(pt_index, x, y, z, grid.children[i]) # <<<<<<<<<<<<<< @@ -7585,7 +7913,7 @@ */ __pyx_v_in_grid = ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self->__pyx_vtab)->check_position(__pyx_v_self, __pyx_v_pt_index, __pyx_v_x, __pyx_v_y, __pyx_v_z, (__pyx_v_grid->children[__pyx_v_i])); - /* "yt/geometry/grid_container.pyx":333 + /* "yt/geometry/grid_container.pyx":332 * in_grid = 0 * for i in range(grid.num_children): * if not in_grid: # <<<<<<<<<<<<<< @@ -7595,7 +7923,7 @@ } } - /* "yt/geometry/grid_container.pyx":335 + /* "yt/geometry/grid_container.pyx":334 * if not in_grid: * in_grid = self.check_position(pt_index, x, y, z, grid.children[i]) * if not in_grid: # <<<<<<<<<<<<<< @@ -7605,7 +7933,7 @@ __pyx_t_1 = ((!(__pyx_v_in_grid != 0)) != 0); if (__pyx_t_1) { - /* "yt/geometry/grid_container.pyx":336 + /* "yt/geometry/grid_container.pyx":335 * in_grid = self.check_position(pt_index, x, y, z, grid.children[i]) * if not in_grid: * self.point_grids[pt_index] = grid.index # <<<<<<<<<<<<<< @@ -7615,7 +7943,7 @@ __pyx_t_4 = __pyx_v_grid->index; (__pyx_v_self->point_grids[__pyx_v_pt_index]) = __pyx_t_4; - /* "yt/geometry/grid_container.pyx":337 + /* "yt/geometry/grid_container.pyx":336 * if not in_grid: * self.point_grids[pt_index] = grid.index * in_grid = 1 # <<<<<<<<<<<<<< @@ -7624,7 +7952,7 @@ */ __pyx_v_in_grid = 1; - /* "yt/geometry/grid_container.pyx":335 + /* "yt/geometry/grid_container.pyx":334 * if not in_grid: * in_grid = self.check_position(pt_index, x, y, z, grid.children[i]) * if not in_grid: # <<<<<<<<<<<<<< @@ -7633,7 +7961,7 @@ */ } - /* "yt/geometry/grid_container.pyx":330 + /* "yt/geometry/grid_container.pyx":329 * in_grid = self.is_in_grid(x, y, z, grid) * if in_grid: * if grid.num_children > 0: # <<<<<<<<<<<<<< @@ -7643,7 +7971,7 @@ goto __pyx_L4; } - /* "yt/geometry/grid_container.pyx":339 + /* "yt/geometry/grid_container.pyx":338 * in_grid = 1 * else: * self.point_grids[pt_index] = grid.index # <<<<<<<<<<<<<< @@ -7654,7 +7982,7 @@ __pyx_t_4 = __pyx_v_grid->index; (__pyx_v_self->point_grids[__pyx_v_pt_index]) = __pyx_t_4; - /* "yt/geometry/grid_container.pyx":340 + /* "yt/geometry/grid_container.pyx":339 * else: * self.point_grids[pt_index] = grid.index * in_grid = 1 # <<<<<<<<<<<<<< @@ -7665,7 +7993,7 @@ } __pyx_L4:; - /* "yt/geometry/grid_container.pyx":329 + /* "yt/geometry/grid_container.pyx":328 * cdef np.uint8_t in_grid * in_grid = self.is_in_grid(x, y, z, grid) * if in_grid: # <<<<<<<<<<<<<< @@ -7674,7 +8002,7 @@ */ } - /* "yt/geometry/grid_container.pyx":341 + /* "yt/geometry/grid_container.pyx":340 * self.point_grids[pt_index] = grid.index * in_grid = 1 * return in_grid # <<<<<<<<<<<<<< @@ -7684,7 +8012,7 @@ __pyx_r = __pyx_v_in_grid; goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":320 + /* "yt/geometry/grid_container.pyx":319 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.uint8_t check_position(self, # <<<<<<<<<<<<<< @@ -7698,7 +8026,7 @@ return __pyx_r; } -/* "yt/geometry/grid_container.pyx":346 +/* "yt/geometry/grid_container.pyx":345 * @cython.wraparound(False) * @cython.cdivision(True) * cdef np.uint8_t is_in_grid(self, # <<<<<<<<<<<<<< @@ -7712,7 +8040,7 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("is_in_grid", 0); - /* "yt/geometry/grid_container.pyx":351 + /* "yt/geometry/grid_container.pyx":350 * np.float64_t z, * GridTreeNode * grid): * if x >= grid.right_edge[0]: return 0 # <<<<<<<<<<<<<< @@ -7725,7 +8053,7 @@ goto __pyx_L0; } - /* "yt/geometry/grid_container.pyx":352 + /* "yt/geometry/grid_container.pyx":351 * GridTreeNode * grid): * if x >= grid.right_edge[0]: return 0 * if y >= grid.right_edge[1]: return 0 # <<<<<<<<<<<<<< @@ -7738,7 +8066,7 @@ goto __pyx_L0; } - /* "yt/geometry/grid_container.pyx":353 + /* "yt/geometry/grid_container.pyx":352 * if x >= grid.right_edge[0]: return 0 * if y >= grid.right_edge[1]: return 0 * if z >= grid.right_edge[2]: return 0 # <<<<<<<<<<<<<< @@ -7751,7 +8079,7 @@ goto __pyx_L0; } - /* "yt/geometry/grid_container.pyx":354 + /* "yt/geometry/grid_container.pyx":353 * if y >= grid.right_edge[1]: return 0 * if z >= grid.right_edge[2]: return 0 * if x < grid.left_edge[0]: return 0 # <<<<<<<<<<<<<< @@ -7764,7 +8092,7 @@ goto __pyx_L0; } - /* "yt/geometry/grid_container.pyx":355 + /* "yt/geometry/grid_container.pyx":354 * if z >= grid.right_edge[2]: return 0 * if x < grid.left_edge[0]: return 0 * if y < grid.left_edge[1]: return 0 # <<<<<<<<<<<<<< @@ -7777,7 +8105,7 @@ goto __pyx_L0; } - /* "yt/geometry/grid_container.pyx":356 + /* "yt/geometry/grid_container.pyx":355 * if x < grid.left_edge[0]: return 0 * if y < grid.left_edge[1]: return 0 * if z < grid.left_edge[2]: return 0 # <<<<<<<<<<<<<< @@ -7790,7 +8118,7 @@ goto __pyx_L0; } - /* "yt/geometry/grid_container.pyx":357 + /* "yt/geometry/grid_container.pyx":356 * if y < grid.left_edge[1]: return 0 * if z < grid.left_edge[2]: return 0 * return 1 # <<<<<<<<<<<<<< @@ -7799,7 +8127,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/grid_container.pyx":346 + /* "yt/geometry/grid_container.pyx":345 * @cython.wraparound(False) * @cython.cdivision(True) * cdef np.uint8_t is_in_grid(self, # <<<<<<<<<<<<<< @@ -7813,6 +8141,113 @@ 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_2yt_8geometry_14grid_container_18MatchPointsToGrids_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_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_2yt_8geometry_14grid_container_18MatchPointsToGrids_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__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__10, 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("yt.geometry.grid_container.MatchPointsToGrids.__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_2yt_8geometry_14grid_container_18MatchPointsToGrids_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_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_2yt_8geometry_14grid_container_18MatchPointsToGrids_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__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__11, 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("yt.geometry.grid_container.MatchPointsToGrids.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "oct_visitors.pxd":51 * cdef void visit(self, Oct*, np.uint8_t selected) * @@ -7908,7 +8343,7 @@ } /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -7930,7 +8365,7 @@ goto __pyx_L0; /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -7946,18 +8381,18 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":20 * - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -7969,7 +8404,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -7981,7 +8416,7 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ @@ -8021,7 +8456,7 @@ * if f0 > f1: return f0 * return f1 # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ __pyx_r = __pyx_v_f1; goto __pyx_L0; @@ -8042,18 +8477,18 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":28 * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -8065,7 +8500,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -8077,7 +8512,7 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ @@ -8165,7 +8600,7 @@ * if f0 < 0.0: return -f0 * return f0 # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_f0; goto __pyx_L0; @@ -8186,18 +8621,18 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":40 * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -8209,7 +8644,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -8226,7 +8661,7 @@ * if i > b: return b * return i # <<<<<<<<<<<<<< * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_i; goto __pyx_L0; @@ -8234,7 +8669,7 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -8247,18 +8682,18 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -8270,7 +8705,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -8295,7 +8730,7 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -8434,74 +8869,177 @@ return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. +/* "yt/utilities/lib/bitarray.pxd":20 + * cimport cython + * + * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, # <<<<<<<<<<<<<< + * np.uint8_t val) nogil: + * if val > 0: val = 1 */ -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_8bitarray_ba_set_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind, __pyx_t_5numpy_uint8_t __pyx_v_val) { int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } + __pyx_t_5numpy_uint64_t __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< + /* "yt/utilities/lib/bitarray.pxd":22 + * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, + * np.uint8_t val) nogil: + * if val > 0: val = 1 # <<<<<<<<<<<<<< + * buf[ind >> 3] |= (val << (ind & 7)) * - * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + __pyx_t_1 = ((__pyx_v_val > 0) != 0); if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; + __pyx_v_val = 1; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) + /* "yt/utilities/lib/bitarray.pxd":23 + * np.uint8_t val) nogil: + * if val > 0: val = 1 + * buf[ind >> 3] |= (val << (ind & 7)) # <<<<<<<<<<<<<< * + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: */ - __pyx_v_endian_detector = 1; + __pyx_t_2 = (__pyx_v_ind >> 3); + (__pyx_v_buf[__pyx_t_2]) = ((__pyx_v_buf[__pyx_t_2]) | (__pyx_v_val << (__pyx_v_ind & 7))); + + /* "yt/utilities/lib/bitarray.pxd":20 + * cimport cython + * + * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, # <<<<<<<<<<<<<< + * np.uint8_t val) nogil: + * if val > 0: val = 1 + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/bitarray.pxd":25 + * buf[ind >> 3] |= (val << (ind & 7)) + * + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 + */ + +static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_9utilities_3lib_8bitarray_ba_get_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind) { + __pyx_t_5numpy_uint8_t __pyx_v_rv; + __pyx_t_5numpy_uint8_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/bitarray.pxd":26 + * + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) # <<<<<<<<<<<<<< + * if rv == 0: return 0 + * return 1 + */ + __pyx_v_rv = ((__pyx_v_buf[(__pyx_v_ind >> 3)]) & (1 << (__pyx_v_ind & 7))); + + /* "yt/utilities/lib/bitarray.pxd":27 + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 # <<<<<<<<<<<<<< + * return 1 + * + */ + __pyx_t_1 = ((__pyx_v_rv == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "yt/utilities/lib/bitarray.pxd":28 + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 + * return 1 # <<<<<<<<<<<<<< + * + * cdef class bitarray: + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/bitarray.pxd":25 + * buf[ind >> 3] |= (val << (ind & 7)) + * + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 * cdef int copy_shape, i, ndim @@ -8603,11 +9141,11 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 218, __pyx_L1_error) + __PYX_ERR(3, 218, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 @@ -8659,11 +9197,11 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 222, __pyx_L1_error) + __PYX_ERR(3, 222, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") @@ -8968,11 +9506,11 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 259, __pyx_L1_error) + __PYX_ERR(3, 259, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: @@ -9179,22 +9717,22 @@ * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 278, __pyx_L1_error) + __PYX_ERR(3, 278, __pyx_L1_error) break; } @@ -9261,7 +9799,7 @@ * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 @@ -9420,7 +9958,7 @@ * 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, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9467,7 +10005,7 @@ * 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, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9514,7 +10052,7 @@ * 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, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9561,7 +10099,7 @@ * 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, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9608,7 +10146,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9689,15 +10227,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(2, 794, __pyx_L1_error) + __PYX_ERR(3, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_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, 794, __pyx_L1_error) + __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(3, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -9712,11 +10250,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 795, __pyx_L1_error) + __PYX_ERR(3, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -9737,7 +10275,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 796, __pyx_L1_error) + __PYX_ERR(3, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -9745,15 +10283,15 @@ __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, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -9766,12 +10304,12 @@ * 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, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -9783,11 +10321,11 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 799, __pyx_L1_error) + __PYX_ERR(3, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -9851,11 +10389,11 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 803, __pyx_L1_error) + __PYX_ERR(3, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -9874,11 +10412,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -9938,7 +10476,7 @@ * 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, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -9960,11 +10498,11 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 823, __pyx_L1_error) + __PYX_ERR(3, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -9982,11 +10520,11 @@ * 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, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -10000,11 +10538,11 @@ * 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, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -10018,11 +10556,11 @@ * 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, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -10036,11 +10574,11 @@ * 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, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -10054,11 +10592,11 @@ * 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, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -10072,11 +10610,11 @@ * 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, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -10090,11 +10628,11 @@ * 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, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -10108,11 +10646,11 @@ * 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, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -10126,11 +10664,11 @@ * 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, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -10144,11 +10682,11 @@ * 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, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -10162,11 +10700,11 @@ * 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, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -10180,11 +10718,11 @@ * 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, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -10198,11 +10736,11 @@ * 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, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -10216,11 +10754,11 @@ * 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, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -10236,11 +10774,11 @@ * 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, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -10256,11 +10794,11 @@ * 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, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -10276,11 +10814,11 @@ * 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, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -10295,19 +10833,19 @@ * 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, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 844, __pyx_L1_error) + __PYX_ERR(3, 844, __pyx_L1_error) } __pyx_L15:; @@ -10338,7 +10876,7 @@ * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(3, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; @@ -10602,7 +11140,7 @@ * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 987, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 * # Cython code. @@ -10615,7 +11153,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -10629,7 +11167,7 @@ __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, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 988, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -10641,11 +11179,11 @@ * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 989, __pyx_L5_except_error) + __PYX_ERR(3, 989, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -10663,7 +11201,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -10733,7 +11271,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 993, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * @@ -10746,7 +11284,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -10760,7 +11298,7 @@ __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, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 994, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -10772,11 +11310,11 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 995, __pyx_L5_except_error) + __PYX_ERR(3, 995, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -10794,7 +11332,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -10864,7 +11402,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 999, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * @@ -10877,7 +11415,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -10890,7 +11428,7 @@ __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, 1000, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -10900,11 +11438,11 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 1001, __pyx_L5_except_error) + __PYX_ERR(3, 1001, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -10922,7 +11460,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -10948,111 +11486,8 @@ return __pyx_r; } -/* "yt/utilities/lib/bitarray.pxd":20 - * cimport cython - * - * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, # <<<<<<<<<<<<<< - * np.uint8_t val) nogil: - * if val > 0: val = 1 - */ - -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_8bitarray_ba_set_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind, __pyx_t_5numpy_uint8_t __pyx_v_val) { - int __pyx_t_1; - __pyx_t_5numpy_uint64_t __pyx_t_2; - - /* "yt/utilities/lib/bitarray.pxd":22 - * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, - * np.uint8_t val) nogil: - * if val > 0: val = 1 # <<<<<<<<<<<<<< - * buf[ind >> 3] |= (val << (ind & 7)) - * - */ - __pyx_t_1 = ((__pyx_v_val > 0) != 0); - if (__pyx_t_1) { - __pyx_v_val = 1; - } - - /* "yt/utilities/lib/bitarray.pxd":23 - * np.uint8_t val) nogil: - * if val > 0: val = 1 - * buf[ind >> 3] |= (val << (ind & 7)) # <<<<<<<<<<<<<< - * - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: - */ - __pyx_t_2 = (__pyx_v_ind >> 3); - (__pyx_v_buf[__pyx_t_2]) = ((__pyx_v_buf[__pyx_t_2]) | (__pyx_v_val << (__pyx_v_ind & 7))); - - /* "yt/utilities/lib/bitarray.pxd":20 - * cimport cython - * - * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, # <<<<<<<<<<<<<< - * np.uint8_t val) nogil: - * if val > 0: val = 1 - */ - - /* function exit code */ -} - -/* "yt/utilities/lib/bitarray.pxd":25 - * buf[ind >> 3] |= (val << (ind & 7)) - * - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) - * if rv == 0: return 0 - */ - -static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_9utilities_3lib_8bitarray_ba_get_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind) { - __pyx_t_5numpy_uint8_t __pyx_v_rv; - __pyx_t_5numpy_uint8_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/bitarray.pxd":26 - * - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) # <<<<<<<<<<<<<< - * if rv == 0: return 0 - * return 1 - */ - __pyx_v_rv = ((__pyx_v_buf[(__pyx_v_ind >> 3)]) & (1 << (__pyx_v_ind & 7))); - - /* "yt/utilities/lib/bitarray.pxd":27 - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) - * if rv == 0: return 0 # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_t_1 = ((__pyx_v_rv == 0) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/bitarray.pxd":28 - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) - * if rv == 0: return 0 - * return 1 # <<<<<<<<<<<<<< - * - * cdef class bitarray: - */ - __pyx_r = 1; - goto __pyx_L0; - - /* "yt/utilities/lib/bitarray.pxd":25 - * buf[ind >> 3] |= (val << (ind & 7)) - * - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) - * if rv == 0: return 0 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/geometry/selection_routines.pxd":26 - * np.float64_t +/* "yt/geometry/selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< * if hasattr(arr, "units"): @@ -11068,39 +11503,39 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_ensure_code", 0); - /* "yt/geometry/selection_routines.pxd":27 + /* "yt/geometry/selection_routines.pxd":23 * * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): # <<<<<<<<<<<<<< * if "code_length" == str(arr.units): * return arr */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(4, 23, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pxd":28 + /* "yt/geometry/selection_routines.pxd":24 * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< * return arr * arr.convert_to_units("code_length") */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 28, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 24, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 28, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pxd":29 + /* "yt/geometry/selection_routines.pxd":25 * if hasattr(arr, "units"): * if "code_length" == str(arr.units): * return arr # <<<<<<<<<<<<<< @@ -11112,7 +11547,7 @@ __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "yt/geometry/selection_routines.pxd":28 + /* "yt/geometry/selection_routines.pxd":24 * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< @@ -11121,21 +11556,21 @@ */ } - /* "yt/geometry/selection_routines.pxd":30 + /* "yt/geometry/selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 30, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 30, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pxd":27 + /* "yt/geometry/selection_routines.pxd":23 * * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): # <<<<<<<<<<<<<< @@ -11144,7 +11579,7 @@ */ } - /* "yt/geometry/selection_routines.pxd":31 + /* "yt/geometry/selection_routines.pxd":27 * return arr * arr.convert_to_units("code_length") * return arr # <<<<<<<<<<<<<< @@ -11156,8 +11591,8 @@ __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "yt/geometry/selection_routines.pxd":26 - * np.float64_t + /* "yt/geometry/selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< * if hasattr(arr, "units"): @@ -11177,7 +11612,7 @@ } /* "yt/geometry/selection_routines.pxd":78 - * cdef public np.int64_t domain_id + * cdef public SelectorObject sel2 * * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< * np.float64_t dw, bint periodic) nogil: @@ -11277,7 +11712,7 @@ goto __pyx_L0; /* "yt/geometry/selection_routines.pxd":78 - * cdef public np.int64_t domain_id + * cdef public SelectorObject sel2 * * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< * np.float64_t dw, bint periodic) nogil: @@ -11292,8 +11727,8 @@ /* "FromPyStructUtility":11 * * @cname("__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded") - * cdef GridTreeNodePadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj) except *: # <<<<<<<<<<<<<< - * cdef GridTreeNodePadded result + * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj) except *: # <<<<<<<<<<<<<< + * cdef struct_type result * if not PyMapping_Check(obj): */ @@ -11314,11 +11749,12 @@ __pyx_t_5numpy_int32_t __pyx_t_10; __pyx_t_5numpy_int64_t __pyx_t_11; __pyx_t_5numpy_float64_t __pyx_t_12; + __pyx_t_5numpy_int_t __pyx_t_13; __Pyx_RefNannySetupContext("__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", 0); /* "FromPyStructUtility":13 - * cdef GridTreeNodePadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj) except *: - * cdef GridTreeNodePadded result + * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj) except *: + * cdef struct_type result * if not PyMapping_Check(obj): # <<<<<<<<<<<<<< * PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name) * @@ -11327,19 +11763,19 @@ if (__pyx_t_1) { /* "FromPyStructUtility":14 - * cdef GridTreeNodePadded result + * cdef struct_type result * if not PyMapping_Check(obj): * PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name) # <<<<<<<<<<<<<< * * try: */ - __pyx_t_2 = PyErr_Format(__pyx_builtin_TypeError, ((char const *)"Expected %.16s, got %.200s"), ((char *)"a mapping"), Py_TYPE(__pyx_v_obj)->tp_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 14, __pyx_L1_error) + __pyx_t_2 = PyErr_Format(__pyx_builtin_TypeError, ((char const *)"Expected %.16s, got %.200s"), ((char *)"a mapping"), Py_TYPE(__pyx_v_obj)->tp_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "FromPyStructUtility":13 - * cdef GridTreeNodePadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj) except *: - * cdef GridTreeNodePadded result + * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj) except *: + * cdef struct_type result * if not PyMapping_Check(obj): # <<<<<<<<<<<<<< * PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name) * @@ -11369,7 +11805,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'num_children'") */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_num_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 17, __pyx_L4_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_num_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_value = __pyx_t_2; __pyx_t_2 = 0; @@ -11385,7 +11821,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11400,7 +11836,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 18, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 18, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -11412,11 +11848,11 @@ * result.num_children = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 19, __pyx_L6_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 19, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 19, __pyx_L6_except_error) + __PYX_ERR(1, 19, __pyx_L6_except_error) } goto __pyx_L6_except_error; __pyx_L6_except_error:; @@ -11434,7 +11870,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "FromPyStructUtility":20 @@ -11444,7 +11880,7 @@ * try: * value = obj['level'] */ - __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(4, 20, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 20, __pyx_L1_error) __pyx_v_result.num_children = __pyx_t_10; /* "FromPyStructUtility":21 @@ -11470,7 +11906,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'level'") */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_level); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 22, __pyx_L14_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_level); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 22, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; @@ -11486,8 +11922,8 @@ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L21_try_end; - __pyx_L14_error:; + goto __pyx_L17_try_end; + __pyx_L12_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11504,7 +11940,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(4, 23, __pyx_L16_except_error) + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 23, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); @@ -11516,14 +11952,14 @@ * result.level = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 24, __pyx_L16_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 24, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 24, __pyx_L16_except_error) + __PYX_ERR(1, 24, __pyx_L14_except_error) } - goto __pyx_L16_except_error; - __pyx_L16_except_error:; + goto __pyx_L14_except_error; + __pyx_L14_except_error:; /* "FromPyStructUtility":21 * raise ValueError("No value specified for struct attribute 'num_children'") @@ -11538,7 +11974,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; - __pyx_L21_try_end:; + __pyx_L17_try_end:; } /* "FromPyStructUtility":25 @@ -11548,7 +11984,7 @@ * try: * value = obj['index'] */ - __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(4, 25, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 25, __pyx_L1_error) __pyx_v_result.level = __pyx_t_10; /* "FromPyStructUtility":26 @@ -11574,7 +12010,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'index'") */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 27, __pyx_L24_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 27, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; @@ -11590,8 +12026,8 @@ __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_L31_try_end; - __pyx_L24_error:; + goto __pyx_L25_try_end; + __pyx_L20_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -11608,7 +12044,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 28, __pyx_L26_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 28, __pyx_L22_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -11620,14 +12056,14 @@ * result.index = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 29, __pyx_L26_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 29, __pyx_L22_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 29, __pyx_L26_except_error) + __PYX_ERR(1, 29, __pyx_L22_except_error) } - goto __pyx_L26_except_error; - __pyx_L26_except_error:; + goto __pyx_L22_except_error; + __pyx_L22_except_error:; /* "FromPyStructUtility":26 * raise ValueError("No value specified for struct attribute 'level'") @@ -11642,7 +12078,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L31_try_end:; + __pyx_L25_try_end:; } /* "FromPyStructUtility":30 @@ -11652,7 +12088,7 @@ * try: * value = obj['left_edge_x'] */ - __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 30, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_result.index = __pyx_t_11; /* "FromPyStructUtility":31 @@ -11678,7 +12114,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'left_edge_x'") */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_left_edge_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 32, __pyx_L34_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_left_edge_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 32, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; @@ -11694,8 +12130,8 @@ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L41_try_end; - __pyx_L34_error:; + goto __pyx_L33_try_end; + __pyx_L28_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11712,7 +12148,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(4, 33, __pyx_L36_except_error) + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 33, __pyx_L30_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); @@ -11724,14 +12160,14 @@ * result.left_edge_x = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 34, __pyx_L36_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 34, __pyx_L30_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 34, __pyx_L36_except_error) + __PYX_ERR(1, 34, __pyx_L30_except_error) } - goto __pyx_L36_except_error; - __pyx_L36_except_error:; + goto __pyx_L30_except_error; + __pyx_L30_except_error:; /* "FromPyStructUtility":31 * raise ValueError("No value specified for struct attribute 'index'") @@ -11746,7 +12182,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; - __pyx_L41_try_end:; + __pyx_L33_try_end:; } /* "FromPyStructUtility":35 @@ -11756,7 +12192,7 @@ * try: * value = obj['left_edge_y'] */ - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 35, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 35, __pyx_L1_error) __pyx_v_result.left_edge_x = __pyx_t_12; /* "FromPyStructUtility":36 @@ -11782,7 +12218,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'left_edge_y'") */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_left_edge_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 37, __pyx_L44_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_left_edge_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; @@ -11798,8 +12234,8 @@ __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_L51_try_end; - __pyx_L44_error:; + goto __pyx_L41_try_end; + __pyx_L36_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -11816,7 +12252,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 38, __pyx_L46_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 38, __pyx_L38_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -11828,14 +12264,14 @@ * result.left_edge_y = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 39, __pyx_L46_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 39, __pyx_L38_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 39, __pyx_L46_except_error) + __PYX_ERR(1, 39, __pyx_L38_except_error) } - goto __pyx_L46_except_error; - __pyx_L46_except_error:; + goto __pyx_L38_except_error; + __pyx_L38_except_error:; /* "FromPyStructUtility":36 * raise ValueError("No value specified for struct attribute 'left_edge_x'") @@ -11850,7 +12286,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L51_try_end:; + __pyx_L41_try_end:; } /* "FromPyStructUtility":40 @@ -11860,7 +12296,7 @@ * try: * value = obj['left_edge_z'] */ - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 40, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 40, __pyx_L1_error) __pyx_v_result.left_edge_y = __pyx_t_12; /* "FromPyStructUtility":41 @@ -11886,7 +12322,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'left_edge_z'") */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_left_edge_z); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 42, __pyx_L54_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_left_edge_z); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 42, __pyx_L44_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; @@ -11902,8 +12338,8 @@ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L61_try_end; - __pyx_L54_error:; + goto __pyx_L49_try_end; + __pyx_L44_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11920,7 +12356,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(4, 43, __pyx_L56_except_error) + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 43, __pyx_L46_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); @@ -11932,14 +12368,14 @@ * result.left_edge_z = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 44, __pyx_L56_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 44, __pyx_L46_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 44, __pyx_L56_except_error) + __PYX_ERR(1, 44, __pyx_L46_except_error) } - goto __pyx_L56_except_error; - __pyx_L56_except_error:; + goto __pyx_L46_except_error; + __pyx_L46_except_error:; /* "FromPyStructUtility":41 * raise ValueError("No value specified for struct attribute 'left_edge_y'") @@ -11954,7 +12390,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; - __pyx_L61_try_end:; + __pyx_L49_try_end:; } /* "FromPyStructUtility":45 @@ -11964,7 +12400,7 @@ * try: * value = obj['right_edge_x'] */ - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 45, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 45, __pyx_L1_error) __pyx_v_result.left_edge_z = __pyx_t_12; /* "FromPyStructUtility":46 @@ -11990,7 +12426,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'right_edge_x'") */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_right_edge_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 47, __pyx_L64_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_right_edge_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L52_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; @@ -12006,8 +12442,8 @@ __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_L71_try_end; - __pyx_L64_error:; + goto __pyx_L57_try_end; + __pyx_L52_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -12024,7 +12460,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 48, __pyx_L66_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 48, __pyx_L54_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -12036,14 +12472,14 @@ * result.right_edge_x = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 49, __pyx_L66_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 49, __pyx_L54_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 49, __pyx_L66_except_error) + __PYX_ERR(1, 49, __pyx_L54_except_error) } - goto __pyx_L66_except_error; - __pyx_L66_except_error:; + goto __pyx_L54_except_error; + __pyx_L54_except_error:; /* "FromPyStructUtility":46 * raise ValueError("No value specified for struct attribute 'left_edge_z'") @@ -12058,7 +12494,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L71_try_end:; + __pyx_L57_try_end:; } /* "FromPyStructUtility":50 @@ -12068,7 +12504,7 @@ * try: * value = obj['right_edge_y'] */ - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 50, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 50, __pyx_L1_error) __pyx_v_result.right_edge_x = __pyx_t_12; /* "FromPyStructUtility":51 @@ -12094,7 +12530,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'right_edge_y'") */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_right_edge_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 52, __pyx_L74_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_right_edge_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 52, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; @@ -12110,8 +12546,8 @@ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L81_try_end; - __pyx_L74_error:; + goto __pyx_L65_try_end; + __pyx_L60_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12128,7 +12564,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(4, 53, __pyx_L76_except_error) + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 53, __pyx_L62_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); @@ -12140,14 +12576,14 @@ * result.right_edge_y = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 54, __pyx_L76_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 54, __pyx_L62_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 54, __pyx_L76_except_error) + __PYX_ERR(1, 54, __pyx_L62_except_error) } - goto __pyx_L76_except_error; - __pyx_L76_except_error:; + goto __pyx_L62_except_error; + __pyx_L62_except_error:; /* "FromPyStructUtility":51 * raise ValueError("No value specified for struct attribute 'right_edge_x'") @@ -12162,7 +12598,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; - __pyx_L81_try_end:; + __pyx_L65_try_end:; } /* "FromPyStructUtility":55 @@ -12172,7 +12608,7 @@ * try: * value = obj['right_edge_z'] */ - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 55, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L1_error) __pyx_v_result.right_edge_y = __pyx_t_12; /* "FromPyStructUtility":56 @@ -12198,7 +12634,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'right_edge_z'") */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_right_edge_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 57, __pyx_L84_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_right_edge_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 57, __pyx_L68_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; @@ -12214,8 +12650,8 @@ __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_L91_try_end; - __pyx_L84_error:; + goto __pyx_L73_try_end; + __pyx_L68_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -12232,7 +12668,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 58, __pyx_L86_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 58, __pyx_L70_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -12244,14 +12680,14 @@ * result.right_edge_z = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 59, __pyx_L86_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 59, __pyx_L70_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 59, __pyx_L86_except_error) + __PYX_ERR(1, 59, __pyx_L70_except_error) } - goto __pyx_L86_except_error; - __pyx_L86_except_error:; + goto __pyx_L70_except_error; + __pyx_L70_except_error:; /* "FromPyStructUtility":56 * raise ValueError("No value specified for struct attribute 'right_edge_y'") @@ -12266,7 +12702,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L91_try_end:; + __pyx_L73_try_end:; } /* "FromPyStructUtility":60 @@ -12276,7 +12712,7 @@ * try: * value = obj['children_pointers'] */ - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 60, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 60, __pyx_L1_error) __pyx_v_result.right_edge_z = __pyx_t_12; /* "FromPyStructUtility":61 @@ -12302,7 +12738,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'children_pointers'") */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_children_pointers); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 62, __pyx_L94_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_children_pointers); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 62, __pyx_L76_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; @@ -12318,8 +12754,8 @@ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L101_try_end; - __pyx_L94_error:; + goto __pyx_L81_try_end; + __pyx_L76_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12336,7 +12772,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(4, 63, __pyx_L96_except_error) + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 63, __pyx_L78_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); @@ -12348,14 +12784,14 @@ * result.children_pointers = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 64, __pyx_L96_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 64, __pyx_L78_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 64, __pyx_L96_except_error) + __PYX_ERR(1, 64, __pyx_L78_except_error) } - goto __pyx_L96_except_error; - __pyx_L96_except_error:; + goto __pyx_L78_except_error; + __pyx_L78_except_error:; /* "FromPyStructUtility":61 * raise ValueError("No value specified for struct attribute 'right_edge_z'") @@ -12370,7 +12806,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; - __pyx_L101_try_end:; + __pyx_L81_try_end:; } /* "FromPyStructUtility":65 @@ -12380,8 +12816,8 @@ * try: * value = obj['start_index_x'] */ - __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 65, __pyx_L1_error) - __pyx_v_result.children_pointers = __pyx_t_11; + __pyx_t_13 = __Pyx_PyInt_As_npy_long(__pyx_v_value); if (unlikely((__pyx_t_13 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_v_result.children_pointers = __pyx_t_13; /* "FromPyStructUtility":66 * raise ValueError("No value specified for struct attribute 'children_pointers'") @@ -12406,7 +12842,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'start_index_x'") */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_start_index_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 67, __pyx_L104_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_start_index_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 67, __pyx_L84_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; @@ -12422,8 +12858,8 @@ __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_L111_try_end; - __pyx_L104_error:; + goto __pyx_L89_try_end; + __pyx_L84_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -12440,7 +12876,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 68, __pyx_L106_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 68, __pyx_L86_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -12452,14 +12888,14 @@ * result.start_index_x = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 69, __pyx_L106_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 69, __pyx_L86_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 69, __pyx_L106_except_error) + __PYX_ERR(1, 69, __pyx_L86_except_error) } - goto __pyx_L106_except_error; - __pyx_L106_except_error:; + goto __pyx_L86_except_error; + __pyx_L86_except_error:; /* "FromPyStructUtility":66 * raise ValueError("No value specified for struct attribute 'children_pointers'") @@ -12474,7 +12910,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L111_try_end:; + __pyx_L89_try_end:; } /* "FromPyStructUtility":70 @@ -12484,7 +12920,7 @@ * try: * value = obj['start_index_y'] */ - __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 70, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 70, __pyx_L1_error) __pyx_v_result.start_index_x = __pyx_t_11; /* "FromPyStructUtility":71 @@ -12510,7 +12946,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'start_index_y'") */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_start_index_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 72, __pyx_L114_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_start_index_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 72, __pyx_L92_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; @@ -12526,8 +12962,8 @@ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L121_try_end; - __pyx_L114_error:; + goto __pyx_L97_try_end; + __pyx_L92_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12544,7 +12980,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(4, 73, __pyx_L116_except_error) + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 73, __pyx_L94_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); @@ -12556,14 +12992,14 @@ * result.start_index_y = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 74, __pyx_L116_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 74, __pyx_L94_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 74, __pyx_L116_except_error) + __PYX_ERR(1, 74, __pyx_L94_except_error) } - goto __pyx_L116_except_error; - __pyx_L116_except_error:; + goto __pyx_L94_except_error; + __pyx_L94_except_error:; /* "FromPyStructUtility":71 * raise ValueError("No value specified for struct attribute 'start_index_x'") @@ -12578,7 +13014,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; - __pyx_L121_try_end:; + __pyx_L97_try_end:; } /* "FromPyStructUtility":75 @@ -12588,7 +13024,7 @@ * try: * value = obj['start_index_z'] */ - __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 75, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 75, __pyx_L1_error) __pyx_v_result.start_index_y = __pyx_t_11; /* "FromPyStructUtility":76 @@ -12614,7 +13050,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'start_index_z'") */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_start_index_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 77, __pyx_L124_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_start_index_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 77, __pyx_L100_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; @@ -12630,8 +13066,8 @@ __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_L131_try_end; - __pyx_L124_error:; + goto __pyx_L105_try_end; + __pyx_L100_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -12648,7 +13084,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 78, __pyx_L126_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 78, __pyx_L102_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -12660,14 +13096,14 @@ * result.start_index_z = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 79, __pyx_L126_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 79, __pyx_L102_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 79, __pyx_L126_except_error) + __PYX_ERR(1, 79, __pyx_L102_except_error) } - goto __pyx_L126_except_error; - __pyx_L126_except_error:; + goto __pyx_L102_except_error; + __pyx_L102_except_error:; /* "FromPyStructUtility":76 * raise ValueError("No value specified for struct attribute 'start_index_y'") @@ -12682,7 +13118,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L131_try_end:; + __pyx_L105_try_end:; } /* "FromPyStructUtility":80 @@ -12692,7 +13128,7 @@ * try: * value = obj['dims_x'] */ - __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 80, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 80, __pyx_L1_error) __pyx_v_result.start_index_z = __pyx_t_11; /* "FromPyStructUtility":81 @@ -12718,7 +13154,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'dims_x'") */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dims_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 82, __pyx_L134_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dims_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 82, __pyx_L108_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; @@ -12734,8 +13170,8 @@ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L141_try_end; - __pyx_L134_error:; + goto __pyx_L113_try_end; + __pyx_L108_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12752,7 +13188,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(4, 83, __pyx_L136_except_error) + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 83, __pyx_L110_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); @@ -12764,14 +13200,14 @@ * result.dims_x = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 84, __pyx_L136_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 84, __pyx_L110_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 84, __pyx_L136_except_error) + __PYX_ERR(1, 84, __pyx_L110_except_error) } - goto __pyx_L136_except_error; - __pyx_L136_except_error:; + goto __pyx_L110_except_error; + __pyx_L110_except_error:; /* "FromPyStructUtility":81 * raise ValueError("No value specified for struct attribute 'start_index_z'") @@ -12786,7 +13222,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; - __pyx_L141_try_end:; + __pyx_L113_try_end:; } /* "FromPyStructUtility":85 @@ -12796,7 +13232,7 @@ * try: * value = obj['dims_y'] */ - __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(4, 85, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 85, __pyx_L1_error) __pyx_v_result.dims_x = __pyx_t_10; /* "FromPyStructUtility":86 @@ -12822,7 +13258,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'dims_y'") */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dims_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 87, __pyx_L144_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dims_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; @@ -12838,8 +13274,8 @@ __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_L151_try_end; - __pyx_L144_error:; + goto __pyx_L121_try_end; + __pyx_L116_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -12856,7 +13292,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 88, __pyx_L146_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 88, __pyx_L118_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -12868,14 +13304,14 @@ * result.dims_y = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 89, __pyx_L146_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 89, __pyx_L118_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 89, __pyx_L146_except_error) + __PYX_ERR(1, 89, __pyx_L118_except_error) } - goto __pyx_L146_except_error; - __pyx_L146_except_error:; + goto __pyx_L118_except_error; + __pyx_L118_except_error:; /* "FromPyStructUtility":86 * raise ValueError("No value specified for struct attribute 'dims_x'") @@ -12890,7 +13326,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L151_try_end:; + __pyx_L121_try_end:; } /* "FromPyStructUtility":90 @@ -12900,7 +13336,7 @@ * try: * value = obj['dims_z'] */ - __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(4, 90, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 90, __pyx_L1_error) __pyx_v_result.dims_y = __pyx_t_10; /* "FromPyStructUtility":91 @@ -12926,7 +13362,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'dims_z'") */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dims_z); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 92, __pyx_L154_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dims_z); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 92, __pyx_L124_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; @@ -12942,8 +13378,8 @@ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L161_try_end; - __pyx_L154_error:; + goto __pyx_L129_try_end; + __pyx_L124_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12960,7 +13396,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(4, 93, __pyx_L156_except_error) + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 93, __pyx_L126_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); @@ -12972,14 +13408,14 @@ * result.dims_z = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 94, __pyx_L156_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 94, __pyx_L126_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 94, __pyx_L156_except_error) + __PYX_ERR(1, 94, __pyx_L126_except_error) } - goto __pyx_L156_except_error; - __pyx_L156_except_error:; + goto __pyx_L126_except_error; + __pyx_L126_except_error:; /* "FromPyStructUtility":91 * raise ValueError("No value specified for struct attribute 'dims_y'") @@ -12994,7 +13430,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; - __pyx_L161_try_end:; + __pyx_L129_try_end:; } /* "FromPyStructUtility":95 @@ -13004,7 +13440,7 @@ * try: * value = obj['dds_x'] */ - __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(4, 95, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 95, __pyx_L1_error) __pyx_v_result.dims_z = __pyx_t_10; /* "FromPyStructUtility":96 @@ -13030,7 +13466,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'dds_x'") */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dds_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 97, __pyx_L164_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dds_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 97, __pyx_L132_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; @@ -13046,8 +13482,8 @@ __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_L171_try_end; - __pyx_L164_error:; + goto __pyx_L137_try_end; + __pyx_L132_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -13064,7 +13500,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 98, __pyx_L166_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 98, __pyx_L134_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -13076,14 +13512,14 @@ * result.dds_x = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 99, __pyx_L166_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 99, __pyx_L134_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 99, __pyx_L166_except_error) + __PYX_ERR(1, 99, __pyx_L134_except_error) } - goto __pyx_L166_except_error; - __pyx_L166_except_error:; + goto __pyx_L134_except_error; + __pyx_L134_except_error:; /* "FromPyStructUtility":96 * raise ValueError("No value specified for struct attribute 'dims_z'") @@ -13098,7 +13534,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L171_try_end:; + __pyx_L137_try_end:; } /* "FromPyStructUtility":100 @@ -13108,7 +13544,7 @@ * try: * value = obj['dds_y'] */ - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 100, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L1_error) __pyx_v_result.dds_x = __pyx_t_12; /* "FromPyStructUtility":101 @@ -13134,7 +13570,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'dds_y'") */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dds_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 102, __pyx_L174_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dds_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 102, __pyx_L140_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; @@ -13150,8 +13586,8 @@ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L181_try_end; - __pyx_L174_error:; + goto __pyx_L145_try_end; + __pyx_L140_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -13168,7 +13604,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(4, 103, __pyx_L176_except_error) + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 103, __pyx_L142_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); @@ -13180,14 +13616,14 @@ * result.dds_y = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 104, __pyx_L176_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 104, __pyx_L142_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 104, __pyx_L176_except_error) + __PYX_ERR(1, 104, __pyx_L142_except_error) } - goto __pyx_L176_except_error; - __pyx_L176_except_error:; + goto __pyx_L142_except_error; + __pyx_L142_except_error:; /* "FromPyStructUtility":101 * raise ValueError("No value specified for struct attribute 'dds_x'") @@ -13202,7 +13638,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; - __pyx_L181_try_end:; + __pyx_L145_try_end:; } /* "FromPyStructUtility":105 @@ -13212,7 +13648,7 @@ * try: * value = obj['dds_z'] */ - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 105, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 105, __pyx_L1_error) __pyx_v_result.dds_y = __pyx_t_12; /* "FromPyStructUtility":106 @@ -13238,7 +13674,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'dds_z'") */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dds_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 107, __pyx_L184_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dds_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 107, __pyx_L148_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; @@ -13254,8 +13690,8 @@ __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_L191_try_end; - __pyx_L184_error:; + goto __pyx_L153_try_end; + __pyx_L148_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -13272,7 +13708,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 108, __pyx_L186_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 108, __pyx_L150_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -13284,14 +13720,14 @@ * result.dds_z = value * return result */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 109, __pyx_L186_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 109, __pyx_L150_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 109, __pyx_L186_except_error) + __PYX_ERR(1, 109, __pyx_L150_except_error) } - goto __pyx_L186_except_error; - __pyx_L186_except_error:; + goto __pyx_L150_except_error; + __pyx_L150_except_error:; /* "FromPyStructUtility":106 * raise ValueError("No value specified for struct attribute 'dds_y'") @@ -13306,7 +13742,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L191_try_end:; + __pyx_L153_try_end:; } /* "FromPyStructUtility":110 @@ -13316,7 +13752,7 @@ * return result * */ - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 110, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 110, __pyx_L1_error) __pyx_v_result.dds_z = __pyx_t_12; /* "FromPyStructUtility":111 @@ -13332,8 +13768,8 @@ /* "FromPyStructUtility":11 * * @cname("__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded") - * cdef GridTreeNodePadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj) except *: # <<<<<<<<<<<<<< - * cdef GridTreeNodePadded result + * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj) except *: # <<<<<<<<<<<<<< + * cdef struct_type result * if not PyMapping_Check(obj): */ @@ -13344,6 +13780,7 @@ __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); __pyx_L0:; __Pyx_XDECREF(__pyx_v_value); __Pyx_RefNannyFinishContext(); @@ -13378,10 +13815,15 @@ 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; } @@ -13390,21 +13832,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(4, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(4, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -13412,12 +13858,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -13426,11 +13874,11 @@ } } __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(4, 120, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 121, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) } else { /* "View.MemoryView":121 @@ -13445,15 +13893,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(4, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(4, 120, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __pyx_L1_error) } __pyx_r = __pyx_array___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); @@ -13504,9 +13952,9 @@ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(4, 127, __pyx_L1_error) + __PYX_ERR(1, 127, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(4, 127, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 @@ -13535,11 +13983,11 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 131, __pyx_L1_error) + __PYX_ERR(1, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize @@ -13567,11 +14015,11 @@ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 134, __pyx_L1_error) + __PYX_ERR(1, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") @@ -13600,9 +14048,9 @@ * 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(4, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -13624,7 +14072,7 @@ * 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(4, 138, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) __pyx_t_5 = __pyx_v_format; __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -13640,7 +14088,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(4, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -13678,11 +14126,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 146, __pyx_L1_error) + __PYX_ERR(1, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim @@ -13705,12 +14153,12 @@ 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(4, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 149, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dim = __pyx_t_8; __pyx_v_idx = __pyx_t_7; @@ -13733,11 +14181,11 @@ * self._shape[idx] = dim * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); @@ -13745,20 +14193,20 @@ 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(4, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 151, __pyx_L1_error) + __PYX_ERR(1, 151, __pyx_L1_error) /* "View.MemoryView":150 * @@ -13795,7 +14243,7 @@ * 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(4, 155, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":156 @@ -13837,7 +14285,7 @@ * 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(4, 158, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":159 @@ -13880,19 +14328,19 @@ * 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(4, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 162, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 162, __pyx_L1_error) + __PYX_ERR(1, 162, __pyx_L1_error) } __pyx_L10:; @@ -13921,8 +14369,8 @@ * if allocate_buffer: * */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 168, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; @@ -13962,11 +14410,11 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 174, __pyx_L1_error) + __PYX_ERR(1, 174, __pyx_L1_error) /* "View.MemoryView":173 * @@ -14005,11 +14453,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(4, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __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(4, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { @@ -14130,7 +14578,7 @@ * 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(4, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -14160,7 +14608,7 @@ * 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(4, 187, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { @@ -14200,11 +14648,11 @@ * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 190, __pyx_L1_error) + __PYX_ERR(1, 190, __pyx_L1_error) /* "View.MemoryView":189 * elif self.mode == u"fortran": @@ -14544,7 +14992,7 @@ * @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(4, 221, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14603,11 +15051,11 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -14618,7 +15066,7 @@ 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(4, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -14682,9 +15130,9 @@ * 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(4, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -14747,9 +15195,9 @@ * 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(4, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 233, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -14810,9 +15258,9 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(4, 236, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":235 @@ -14835,6 +15283,113 @@ 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__47, 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__48, 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":240 * * @cname("__pyx_array_new") @@ -14871,13 +15426,13 @@ * 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(4, 245, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 245, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -14891,7 +15446,7 @@ __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(4, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -14915,13 +15470,13 @@ * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -14943,9 +15498,9 @@ * result.data = buf * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 248, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(4, 248, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) /* "View.MemoryView":247 * result = array(shape, itemsize, format, mode.decode('ASCII')) @@ -14954,7 +15509,7 @@ * 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(4, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -15030,6 +15585,7 @@ 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; } @@ -15040,7 +15596,7 @@ 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(4, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -15051,7 +15607,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -15149,6 +15705,293 @@ 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":294 * * @cname('__pyx_align_pointer') @@ -15257,8 +16100,11 @@ 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; } @@ -15267,11 +16113,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(4, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -15279,11 +16127,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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; @@ -15291,16 +16140,16 @@ } } __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(4, 341, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 341, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -15371,7 +16220,7 @@ * 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 == -1)) __PYX_ERR(4, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) /* "View.MemoryView":346 * if type(self) is memoryview or obj is not None: @@ -15492,7 +16341,7 @@ * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(4, 357, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) /* "View.MemoryView":356 * if self.lock is NULL: @@ -15833,26 +16682,26 @@ __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(4, 389, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 389, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(4, 389, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(4, 389, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -15862,7 +16711,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(4, 389, __pyx_L1_error) + else __PYX_ERR(1, 389, __pyx_L1_error) } break; } @@ -15880,8 +16729,8 @@ * * 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(4, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(4, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":389 @@ -15998,7 +16847,7 @@ * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 399, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -16010,7 +16859,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(4, 399, __pyx_L1_error) + __PYX_ERR(1, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -16018,14 +16867,14 @@ __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(4, 399, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 399, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 399, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; @@ -16039,7 +16888,7 @@ * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":403 @@ -16050,7 +16899,7 @@ * 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(4, 403, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -16073,7 +16922,7 @@ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(4, 405, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":406 @@ -16084,7 +16933,7 @@ * 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(4, 406, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -16154,7 +17003,7 @@ * * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 409, __pyx_L1_error) + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; @@ -16166,7 +17015,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(4, 409, __pyx_L1_error) + __PYX_ERR(1, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); @@ -16174,14 +17023,14 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 409, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 409, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 409, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; @@ -16195,7 +17044,7 @@ * obj = self.is_slice(value) * if obj: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":412 @@ -16205,7 +17054,7 @@ * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 412, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; @@ -16217,7 +17066,7 @@ * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":414 @@ -16227,9 +17076,9 @@ * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 414, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -16252,10 +17101,10 @@ * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 416, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -16280,7 +17129,7 @@ * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 418, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -16368,7 +17217,7 @@ * 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(4, 423, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":424 @@ -16378,7 +17227,7 @@ * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 424, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":423 @@ -16388,7 +17237,7 @@ * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 423, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -16399,7 +17248,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(4, 423, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -16416,7 +17265,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -16433,7 +17282,7 @@ __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(4, 425, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); @@ -16476,7 +17325,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -16548,7 +17397,7 @@ * 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(4, 434, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":435 * @@ -16557,7 +17406,7 @@ * 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(4, 435, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) /* "View.MemoryView":436 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], @@ -16566,13 +17415,13 @@ * * 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(4, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":434 @@ -16582,7 +17431,7 @@ * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 434, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":430 * return obj @@ -16688,7 +17537,7 @@ * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(4, 450, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) /* "View.MemoryView":449 * if self.view.itemsize > sizeof(array): @@ -16776,7 +17625,7 @@ * */ /*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(4, 459, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 459, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -16799,7 +17648,7 @@ * 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(4, 464, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -16914,7 +17763,7 @@ * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(4, 471, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":472 @@ -16924,7 +17773,7 @@ * * 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(4, 472, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -16983,7 +17832,7 @@ * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -16995,7 +17844,7 @@ * 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(4, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -17023,9 +17872,9 @@ * 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(4, 482, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 482, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -17042,7 +17891,7 @@ #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(4, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -17051,14 +17900,14 @@ #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(4, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 482, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -17069,7 +17918,7 @@ __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(4, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -17106,7 +17955,7 @@ * */ __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(4, 487, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -17148,13 +17997,13 @@ * raise ValueError("Unable to convert item to object") * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 483, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(4, 483, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); @@ -17166,11 +18015,11 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(4, 484, __pyx_L5_except_error) + __PYX_ERR(1, 484, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -17261,7 +18110,7 @@ * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -17284,26 +18133,26 @@ * 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(4, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(4, 499, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -17325,9 +18174,9 @@ * 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(4, 501, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -17344,7 +18193,7 @@ #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(4, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -17353,14 +18202,14 @@ #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(4, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 501, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -17371,12 +18220,12 @@ __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(4, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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(4, 501, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 501, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } @@ -17392,7 +18241,7 @@ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(4, 503, __pyx_L1_error) + __PYX_ERR(1, 503, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -17779,9 +18628,9 @@ * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 540, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(4, 540, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; @@ -17792,7 +18641,7 @@ * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(4, 541, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) /* "View.MemoryView":542 * cdef _memoryviewslice result = memoryview_copy(self) @@ -17919,18 +18768,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 550, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_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(4, 550, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(4, 550, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 550, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; @@ -18007,11 +18856,11 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(4, 556, __pyx_L1_error) + __PYX_ERR(1, 556, __pyx_L1_error) /* "View.MemoryView":554 * @property @@ -18030,18 +18879,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 558, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_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(4, 558, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 558, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 558, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; @@ -18119,9 +18968,9 @@ * 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(4, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__45, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__51, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -18145,18 +18994,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 565, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 565, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(4, 565, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 565, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -18218,7 +19067,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18278,7 +19127,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18340,11 +19189,11 @@ * @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(4, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 577, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -18438,7 +19287,7 @@ __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(4, 584, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; @@ -18450,7 +19299,7 @@ * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 585, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; @@ -18628,12 +19477,12 @@ * */ __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(4, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -18644,12 +19493,12 @@ * * def __str__(self): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 599, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -18660,7 +19509,7 @@ * id(self)) * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -18668,7 +19517,7 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -18732,20 +19581,20 @@ * */ __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(4, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 602, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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(4, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -18818,7 +19667,7 @@ * 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(4, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18889,7 +19738,7 @@ * 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(4, 615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18969,7 +19818,7 @@ * 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(4, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":627 @@ -18980,7 +19829,7 @@ * 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(4, 627, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -19061,7 +19910,7 @@ * 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(4, 634, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":639 @@ -19072,7 +19921,7 @@ * */ __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(4, 639, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -19097,38 +19946,145 @@ return __pyx_r; } -/* "View.MemoryView":643 - * - * @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 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -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; +/* 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; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "View.MemoryView":644 - * @cname('__pyx_memoryview_new') - * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): - * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< - * result.typeinfo = typeinfo - * return result + /* "(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_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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(4, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_o); - __Pyx_GIVEREF(__pyx_v_o); + __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__53, 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":643 + * + * @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":644 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __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); @@ -19136,7 +20092,7 @@ 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(4, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); @@ -19273,7 +20229,7 @@ * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -19311,7 +20267,7 @@ * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 662, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -19347,26 +20303,26 @@ __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(4, 665, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 665, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(4, 665, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(4, 665, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -19376,7 +20332,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(4, 665, __pyx_L1_error) + else __PYX_ERR(1, 665, __pyx_L1_error) } break; } @@ -19386,7 +20342,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(4, 665, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -19420,17 +20376,17 @@ * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(4, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 668, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__46); - __Pyx_GIVEREF(__pyx_slice__46); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__46); + __Pyx_INCREF(__pyx_slice__54); + __Pyx_GIVEREF(__pyx_slice__54); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__54); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 668, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":669 @@ -19460,7 +20416,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__47); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__55); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) } __pyx_L7:; @@ -19510,19 +20466,19 @@ * * 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(4, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 675, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(4, 675, __pyx_L1_error) + __PYX_ERR(1, 675, __pyx_L1_error) /* "View.MemoryView":674 * have_slices = True @@ -19559,7 +20515,7 @@ * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 678, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) } __pyx_L6:; @@ -19581,7 +20537,7 @@ * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(4, 680, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":681 @@ -19601,16 +20557,16 @@ * * 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(4, 682, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__48); - __Pyx_GIVEREF(__pyx_slice__48); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__48); + __Pyx_INCREF(__pyx_slice__56); + __Pyx_GIVEREF(__pyx_slice__56); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__56); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":681 @@ -19632,20 +20588,20 @@ __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(4, 684, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 684, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 684, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 684, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -19731,11 +20687,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 689, __pyx_L1_error) + __PYX_ERR(1, 689, __pyx_L1_error) /* "View.MemoryView":688 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): @@ -19839,7 +20795,7 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(4, 708, __pyx_L1_error) + __PYX_ERR(1, 708, __pyx_L1_error) } } #endif @@ -19862,7 +20818,7 @@ * 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(4, 711, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -19958,26 +20914,26 @@ __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(4, 732, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 732, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(4, 732, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(4, 732, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -19987,7 +20943,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(4, 732, __pyx_L1_error) + else __PYX_ERR(1, 732, __pyx_L1_error) } break; } @@ -20015,7 +20971,7 @@ * 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(4, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) /* "View.MemoryView":734 * for dim, index in enumerate(indices): @@ -20024,7 +20980,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(4, 734, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) /* "View.MemoryView":733 * @@ -20101,13 +21057,13 @@ * 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(4, 746, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 746, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -20123,13 +21079,13 @@ * 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(4, 747, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 747, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -20145,13 +21101,13 @@ * * 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(4, 748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 748, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -20167,7 +21123,7 @@ * 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(4, 750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -20180,7 +21136,7 @@ * 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(4, 751, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -20193,7 +21149,7 @@ * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 752, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -20206,7 +21162,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(4, 754, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) /* "View.MemoryView":760 * have_start, have_stop, have_step, @@ -20256,7 +21212,7 @@ * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(4, 764, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } /* "View.MemoryView":765 * return memoryview_fromslice(dst, new_ndim, @@ -20265,7 +21221,7 @@ * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(4, 765, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } /* "View.MemoryView":763 * @@ -20274,9 +21230,9 @@ * 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(4, 763, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 763, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -20307,7 +21263,7 @@ * * */ - __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(4, 768, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":768 @@ -20317,7 +21273,7 @@ * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -20420,7 +21376,7 @@ * 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 == -1)) __PYX_ERR(4, 818, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: @@ -20485,7 +21441,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(4, 824, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) /* "View.MemoryView":823 * negative_step = have_step != 0 and step < 0 @@ -21057,7 +22013,7 @@ * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(4, 885, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) } __pyx_L26:; @@ -21114,11 +22070,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -21186,11 +22142,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(4, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __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(4, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); @@ -21298,22 +22254,22 @@ * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(4, 914, __pyx_L1_error) + __PYX_ERR(1, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: @@ -21350,22 +22306,22 @@ * * resultp = bufp + index * stride */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 917, __pyx_L1_error) + __PYX_ERR(1, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) @@ -21565,7 +22521,7 @@ * * return 1 */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(4, 943, __pyx_L1_error) + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] @@ -21599,11 +22555,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -21688,7 +22644,7 @@ * 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(4, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -21712,7 +22668,7 @@ */ /*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(4, 969, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -21771,7 +22727,7 @@ * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(4, 973, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) /* "View.MemoryView":972 * @@ -21791,7 +22747,7 @@ * @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(4, 975, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -21871,6 +22827,113 @@ 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__58, 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__59, 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":985 * * @cname('__pyx_memoryview_fromslice') @@ -21934,9 +22997,9 @@ * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 999, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -21947,7 +23010,7 @@ __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(4, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -21978,7 +23041,7 @@ * 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(4, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -22149,7 +23212,7 @@ __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(4, 1026, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; @@ -22161,12 +23224,12 @@ * * 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(4, 1027, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1027, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1027, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } @@ -22258,7 +23321,7 @@ * 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(4, 1039, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -22315,7 +23378,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -22479,7 +23542,7 @@ * @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(4, 1067, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22602,7 +23665,7 @@ * * */ - __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(4, 1084, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; @@ -23400,7 +24463,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(4, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) /* "View.MemoryView":1207 * @@ -23572,11 +24635,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -23600,7 +24663,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -23611,13 +24674,13 @@ * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -23636,20 +24699,20 @@ * (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(4, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1237, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 1237, __pyx_L1_error) + __PYX_ERR(1, 1237, __pyx_L1_error) /* "View.MemoryView":1235 * @@ -23669,7 +24732,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -23691,7 +24754,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -23703,11 +24766,11 @@ * * @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(4, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -23723,14 +24786,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #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(4, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -23739,20 +24802,20 @@ #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(4, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -23760,7 +24823,7 @@ __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(4, 1242, __pyx_L1_error) + __PYX_ERR(1, 1242, __pyx_L1_error) /* "View.MemoryView":1241 * @@ -23782,7 +24845,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -23805,7 +24868,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -23827,7 +24890,7 @@ * 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(4, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -23841,14 +24904,14 @@ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #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(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -23857,20 +24920,20 @@ #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(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -23878,7 +24941,7 @@ __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(4, 1247, __pyx_L1_error) + __PYX_ERR(1, 1247, __pyx_L1_error) /* "View.MemoryView":1246 * @cname('__pyx_memoryview_err') @@ -23898,7 +24961,7 @@ */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(4, 1249, __pyx_L1_error) + __PYX_ERR(1, 1249, __pyx_L1_error) } /* "View.MemoryView":1245 @@ -23921,7 +24984,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -24139,7 +25202,7 @@ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 1281, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) } __pyx_L7:; @@ -24169,7 +25232,7 @@ * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 1284, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) /* "View.MemoryView":1283 * _err_extents(i, dst.shape[i], src.shape[i]) @@ -24226,7 +25289,7 @@ * src = tmp * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(4, 1291, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1292 @@ -24410,7 +25473,7 @@ * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(4, 1313, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) /* "View.MemoryView":1314 * @@ -24419,7 +25482,7 @@ * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(4, 1314, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) /* "View.MemoryView":1310 * return 0 @@ -24488,11 +25551,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -24672,7 +25735,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -24696,7 +25759,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -25006,548 +26069,1015 @@ /* function exit code */ } -/* "BufferFormatFromTypeInfo":1447 - * - * @cname('__pyx_format_from_typeinfo') - * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< - * cdef __Pyx_StructField *field - * cdef __pyx_typeinfo_string fmt +/* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError */ -static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) { - __Pyx_StructField *__pyx_v_field; - struct __pyx_typeinfo_string __pyx_v_fmt; - PyObject *__pyx_v_part = 0; - PyObject *__pyx_v_result = 0; - PyObject *__pyx_v_alignment = NULL; - PyObject *__pyx_v_parts = NULL; - PyObject *__pyx_v_extents = NULL; - int __pyx_v_i; +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - __Pyx_StructField *__pyx_t_4; + 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("format_from_typeinfo", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0); - /* "BufferFormatFromTypeInfo":1452 - * cdef bytes part, result - * - * if type.typegroup == 'S': # <<<<<<<<<<<<<< - * assert type.fields != NULL and type.fields.type != NULL - * + /* "(tree fragment)":2 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) */ - __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0); + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); if (__pyx_t_1) { - /* "BufferFormatFromTypeInfo":1453 - * - * if type.typegroup == 'S': - * assert type.fields != NULL and type.fields.type != NULL # <<<<<<<<<<<<<< - * - * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: + /* "(tree fragment)":3 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_2 = ((__pyx_v_type->fields != NULL) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = ((__pyx_v_type->fields->type != NULL) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; - if (unlikely(!__pyx_t_1)) { - PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(4, 1453, __pyx_L1_error) - } - } - #endif + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "BufferFormatFromTypeInfo":1455 - * assert type.fields != NULL and type.fields.type != NULL - * - * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<< - * alignment = b'^' - * else: + /* "(tree fragment)":4 + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: */ - __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0); - if (__pyx_t_1) { - - /* "BufferFormatFromTypeInfo":1456 - * - * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: - * alignment = b'^' # <<<<<<<<<<<<<< - * else: - * alignment = b'' - */ - __Pyx_INCREF(__pyx_kp_b__50); - __pyx_v_alignment = __pyx_kp_b__50; - - /* "BufferFormatFromTypeInfo":1455 - * assert type.fields != NULL and type.fields.type != NULL - * - * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<< - * alignment = b'^' - * else: - */ - goto __pyx_L6; + __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_PickleError); + __pyx_t_2 = __pyx_v_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); + } } - - /* "BufferFormatFromTypeInfo":1458 - * alignment = b'^' - * else: - * alignment = b'' # <<<<<<<<<<<<<< - * - * parts = [b"T{"] - */ - /*else*/ { - __Pyx_INCREF(__pyx_kp_b__51); - __pyx_v_alignment = __pyx_kp_b__51; + 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_L6:; - - /* "BufferFormatFromTypeInfo":1460 - * alignment = b'' - * - * parts = [b"T{"] # <<<<<<<<<<<<<< - * field = type.fields - * - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1460, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_kp_b_T); - __Pyx_GIVEREF(__pyx_kp_b_T); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_b_T); - __pyx_v_parts = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "BufferFormatFromTypeInfo":1461 - * - * parts = [b"T{"] - * field = type.fields # <<<<<<<<<<<<<< - * - * while field.type: - */ - __pyx_t_4 = __pyx_v_type->fields; - __pyx_v_field = __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(1, 4, __pyx_L1_error) - /* "BufferFormatFromTypeInfo":1463 - * field = type.fields - * - * while field.type: # <<<<<<<<<<<<<< - * part = format_from_typeinfo(field.type) - * parts.append(part + b':' + field.name + b':') + /* "(tree fragment)":2 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) */ - while (1) { - __pyx_t_1 = (__pyx_v_field->type != 0); - if (!__pyx_t_1) break; + } - /* "BufferFormatFromTypeInfo":1464 - * - * while field.type: - * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<< - * parts.append(part + b':' + field.name + b':') - * field += 1 + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) */ - __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1464, __pyx_L1_error) + __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); - __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "BufferFormatFromTypeInfo":1465 - * while field.type: - * part = format_from_typeinfo(field.type) - * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<< - * field += 1 - * - */ - __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__52); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1465, __pyx_L1_error) + } 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); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__52); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(4, 1465, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "BufferFormatFromTypeInfo":1466 - * part = format_from_typeinfo(field.type) - * parts.append(part + b':' + field.name + b':') - * field += 1 # <<<<<<<<<<<<<< - * - * result = alignment.join(parts) + b'}' - */ - __pyx_v_field = (__pyx_v_field + 1); + } 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; } - - /* "BufferFormatFromTypeInfo":1468 - * field += 1 - * - * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<< - * else: - * fmt = __Pyx_TypeInfoToFormat(type) - */ - __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__53); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(4, 1468, __pyx_L1_error) - __pyx_v_result = ((PyObject*)__pyx_t_6); - __pyx_t_6 = 0; - - /* "BufferFormatFromTypeInfo":1452 - * cdef bytes part, result - * - * if type.typegroup == 'S': # <<<<<<<<<<<<<< - * assert type.fields != NULL and type.fields.type != NULL - * - */ - goto __pyx_L3; } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "BufferFormatFromTypeInfo":1470 - * result = alignment.join(parts) + b'}' - * else: - * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<< - * if type.arraysize[0]: - * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] - */ - /*else*/ { - __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type); - - /* "BufferFormatFromTypeInfo":1471 - * else: - * fmt = __Pyx_TypeInfoToFormat(type) - * if type.arraysize[0]: # <<<<<<<<<<<<<< - * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] - * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string - */ - __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0); - if (__pyx_t_1) { - - /* "BufferFormatFromTypeInfo":1472 - * fmt = __Pyx_TypeInfoToFormat(type) - * if type.arraysize[0]: - * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<< - * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string - * else: - */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __pyx_v_type->ndim; - for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { - __pyx_v_i = __pyx_t_9; - __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1472, __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 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_5))) __PYX_ERR(4, 1472, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_v_extents = ((PyObject*)__pyx_t_6); - __pyx_t_6 = 0; - - /* "BufferFormatFromTypeInfo":1473 - * if type.arraysize[0]: - * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] - * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<< - * else: - * result = fmt.string + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result */ - __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__54, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(4, 1473, __pyx_L1_error) - __pyx_v_result = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "BufferFormatFromTypeInfo":1471 - * else: - * fmt = __Pyx_TypeInfoToFormat(type) - * if type.arraysize[0]: # <<<<<<<<<<<<<< - * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] - * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): */ - goto __pyx_L9; - } + 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_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; - /* "BufferFormatFromTypeInfo":1475 - * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string - * else: - * result = fmt.string # <<<<<<<<<<<<<< - * + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) * return result */ - /*else*/ { - __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_result = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L9:; } - __pyx_L3:; - /* "BufferFormatFromTypeInfo":1477 - * result = fmt.string - * + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "BufferFormatFromTypeInfo":1447 - * - * @cname('__pyx_format_from_typeinfo') - * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< - * cdef __Pyx_StructField *field - * cdef __pyx_typeinfo_string fmt + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import 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("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_part); + __Pyx_XDECREF(__pyx_v_PickleError); __Pyx_XDECREF(__pyx_v_result); - __Pyx_XDECREF(__pyx_v_alignment); - __Pyx_XDECREF(__pyx_v_parts); - __Pyx_XDECREF(__pyx_v_extents); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree __pyx_vtable_2yt_8geometry_14grid_container_GridTree; -static PyObject *__pyx_tp_new_2yt_8geometry_14grid_container_GridTree(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *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_2yt_8geometry_14grid_container_GridTree *)o); - p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_14grid_container_GridTree; - p->mask = ((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_2yt_8geometry_14grid_container_8GridTree_1__cinit__(o, a, k) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; - return NULL; -} +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ -static void __pyx_tp_dealloc_2yt_8geometry_14grid_container_GridTree(PyObject *o) { - struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *p = (struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->mask); - (*Py_TYPE(o)->tp_free)(o); -} +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); -static int __pyx_tp_traverse_2yt_8geometry_14grid_container_GridTree(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *p = (struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)o; - if (p->mask) { - e = (*v)(((PyObject*)p->mask), a); if (e) return e; + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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) } - return 0; -} - -static int __pyx_tp_clear_2yt_8geometry_14grid_container_GridTree(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *p = (struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)o; - tmp = ((PyObject*)p->mask); - p->mask = ((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} + __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(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; -static PyObject *__pyx_getprop_2yt_8geometry_14grid_container_8GridTree_grid_arrays(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_8geometry_14grid_container_8GridTree_11grid_arrays_1__get__(o); -} + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { -static PyObject *__pyx_getprop_2yt_8geometry_14grid_container_8GridTree_mask(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_1__get__(o); -} + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -static int __pyx_setprop_2yt_8geometry_14grid_container_8GridTree_mask(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_3__set__(o, v); - } - else { - return __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_5__del__(o); + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ } -} - -static PyMethodDef __pyx_methods_2yt_8geometry_14grid_container_GridTree[] = { - {"return_tree_info", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_8return_tree_info, METH_NOARGS, 0}, - {"count", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_10count, METH_O, 0}, - {"select_icoords", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_12select_icoords, METH_VARARGS|METH_KEYWORDS, 0}, - {"select_ires", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_14select_ires, METH_VARARGS|METH_KEYWORDS, 0}, - {"select_fcoords", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_16select_fcoords, METH_VARARGS|METH_KEYWORDS, 0}, - {"select_fwidth", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_18select_fwidth, METH_VARARGS|METH_KEYWORDS, 0}, - {0, 0, 0, 0} -}; -static struct PyGetSetDef __pyx_getsets_2yt_8geometry_14grid_container_GridTree[] = { - {(char *)"grid_arrays", __pyx_getprop_2yt_8geometry_14grid_container_8GridTree_grid_arrays, 0, (char *)0, 0}, - {(char *)"mask", __pyx_getprop_2yt_8geometry_14grid_container_8GridTree_mask, __pyx_setprop_2yt_8geometry_14grid_container_8GridTree_mask, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_2yt_8geometry_14grid_container_GridTree = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.grid_container.GridTree", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_14grid_container_GridTree, /*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*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_2yt_8geometry_14grid_container_GridTree, /*tp_traverse*/ - __pyx_tp_clear_2yt_8geometry_14grid_container_GridTree, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - __pyx_pw_2yt_8geometry_14grid_container_8GridTree_5__iter__, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_14grid_container_GridTree, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_2yt_8geometry_14grid_container_GridTree, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_14grid_container_8GridTree_3__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_14grid_container_GridTree, /*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_2yt_8geometry_14grid_container_MatchPointsToGrids __pyx_vtable_2yt_8geometry_14grid_container_MatchPointsToGrids; - -static PyObject *__pyx_tp_new_2yt_8geometry_14grid_container_MatchPointsToGrids(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *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_2yt_8geometry_14grid_container_MatchPointsToGrids *)o); - p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_14grid_container_MatchPointsToGrids; - p->tree = ((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_1__cinit__(o, a, k) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; - return NULL; -} + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ -static void __pyx_tp_dealloc_2yt_8geometry_14grid_container_MatchPointsToGrids(PyObject *o) { - struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *p = (struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->tree); - (*Py_TYPE(o)->tp_free)(o); + /* 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_7); + __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 int __pyx_tp_traverse_2yt_8geometry_14grid_container_MatchPointsToGrids(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *p = (struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)o; - if (p->tree) { - e = (*v)(((PyObject*)p->tree), a); if (e) return e; - } - return 0; -} +/* "BufferFormatFromTypeInfo":1447 + * + * @cname('__pyx_format_from_typeinfo') + * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< + * cdef __Pyx_StructField *field + * cdef __pyx_typeinfo_string fmt + */ -static int __pyx_tp_clear_2yt_8geometry_14grid_container_MatchPointsToGrids(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *p = (struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)o; - tmp = ((PyObject*)p->tree); - p->tree = ((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); +static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) { + __Pyx_StructField *__pyx_v_field; + struct __pyx_typeinfo_string __pyx_v_fmt; + PyObject *__pyx_v_part = 0; + PyObject *__pyx_v_result = 0; + PyObject *__pyx_v_alignment = NULL; + PyObject *__pyx_v_parts = NULL; + PyObject *__pyx_v_extents = NULL; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_StructField *__pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("format_from_typeinfo", 0); + + /* "BufferFormatFromTypeInfo":1452 + * cdef bytes part, result + * + * if type.typegroup == 'S': # <<<<<<<<<<<<<< + * assert type.fields != NULL and type.fields.type != NULL + * + */ + __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0); + if (__pyx_t_1) { + + /* "BufferFormatFromTypeInfo":1453 + * + * if type.typegroup == 'S': + * assert type.fields != NULL and type.fields.type != NULL # <<<<<<<<<<<<<< + * + * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_2 = ((__pyx_v_type->fields != NULL) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_type->fields->type != NULL) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(!__pyx_t_1)) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 1453, __pyx_L1_error) + } + } + #endif + + /* "BufferFormatFromTypeInfo":1455 + * assert type.fields != NULL and type.fields.type != NULL + * + * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<< + * alignment = b'^' + * else: + */ + __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0); + if (__pyx_t_1) { + + /* "BufferFormatFromTypeInfo":1456 + * + * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: + * alignment = b'^' # <<<<<<<<<<<<<< + * else: + * alignment = b'' + */ + __Pyx_INCREF(__pyx_kp_b__60); + __pyx_v_alignment = __pyx_kp_b__60; + + /* "BufferFormatFromTypeInfo":1455 + * assert type.fields != NULL and type.fields.type != NULL + * + * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<< + * alignment = b'^' + * else: + */ + goto __pyx_L6; + } + + /* "BufferFormatFromTypeInfo":1458 + * alignment = b'^' + * else: + * alignment = b'' # <<<<<<<<<<<<<< + * + * parts = [b"T{"] + */ + /*else*/ { + __Pyx_INCREF(__pyx_kp_b__61); + __pyx_v_alignment = __pyx_kp_b__61; + } + __pyx_L6:; + + /* "BufferFormatFromTypeInfo":1460 + * alignment = b'' + * + * parts = [b"T{"] # <<<<<<<<<<<<<< + * field = type.fields + * + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_kp_b_T); + __Pyx_GIVEREF(__pyx_kp_b_T); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_b_T); + __pyx_v_parts = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "BufferFormatFromTypeInfo":1461 + * + * parts = [b"T{"] + * field = type.fields # <<<<<<<<<<<<<< + * + * while field.type: + */ + __pyx_t_4 = __pyx_v_type->fields; + __pyx_v_field = __pyx_t_4; + + /* "BufferFormatFromTypeInfo":1463 + * field = type.fields + * + * while field.type: # <<<<<<<<<<<<<< + * part = format_from_typeinfo(field.type) + * parts.append(part + b':' + field.name + b':') + */ + while (1) { + __pyx_t_1 = (__pyx_v_field->type != 0); + if (!__pyx_t_1) break; + + /* "BufferFormatFromTypeInfo":1464 + * + * while field.type: + * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<< + * parts.append(part + b':' + field.name + b':') + * field += 1 + */ + __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "BufferFormatFromTypeInfo":1465 + * while field.type: + * part = format_from_typeinfo(field.type) + * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<< + * field += 1 + * + */ + __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__62); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__62); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 1465, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "BufferFormatFromTypeInfo":1466 + * part = format_from_typeinfo(field.type) + * parts.append(part + b':' + field.name + b':') + * field += 1 # <<<<<<<<<<<<<< + * + * result = alignment.join(parts) + b'}' + */ + __pyx_v_field = (__pyx_v_field + 1); + } + + /* "BufferFormatFromTypeInfo":1468 + * field += 1 + * + * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<< + * else: + * fmt = __Pyx_TypeInfoToFormat(type) + */ + __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__63); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(1, 1468, __pyx_L1_error) + __pyx_v_result = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "BufferFormatFromTypeInfo":1452 + * cdef bytes part, result + * + * if type.typegroup == 'S': # <<<<<<<<<<<<<< + * assert type.fields != NULL and type.fields.type != NULL + * + */ + goto __pyx_L3; + } + + /* "BufferFormatFromTypeInfo":1470 + * result = alignment.join(parts) + b'}' + * else: + * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<< + * if type.arraysize[0]: + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] + */ + /*else*/ { + __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type); + + /* "BufferFormatFromTypeInfo":1471 + * else: + * fmt = __Pyx_TypeInfoToFormat(type) + * if type.arraysize[0]: # <<<<<<<<<<<<<< + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + */ + __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0); + if (__pyx_t_1) { + + /* "BufferFormatFromTypeInfo":1472 + * fmt = __Pyx_TypeInfoToFormat(type) + * if type.arraysize[0]: + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<< + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + * else: + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __pyx_v_type->ndim; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1472, __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 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 1472, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_v_extents = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "BufferFormatFromTypeInfo":1473 + * if type.arraysize[0]: + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<< + * else: + * result = fmt.string + */ + __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__64, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 1473, __pyx_L1_error) + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "BufferFormatFromTypeInfo":1471 + * else: + * fmt = __Pyx_TypeInfoToFormat(type) + * if type.arraysize[0]: # <<<<<<<<<<<<<< + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + */ + goto __pyx_L9; + } + + /* "BufferFormatFromTypeInfo":1475 + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + * else: + * result = fmt.string # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L9:; + } + __pyx_L3:; + + /* "BufferFormatFromTypeInfo":1477 + * result = fmt.string + * + * return result # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "BufferFormatFromTypeInfo":1447 + * + * @cname('__pyx_format_from_typeinfo') + * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< + * cdef __Pyx_StructField *field + * cdef __pyx_typeinfo_string fmt + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_part); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_alignment); + __Pyx_XDECREF(__pyx_v_parts); + __Pyx_XDECREF(__pyx_v_extents); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree __pyx_vtable_2yt_8geometry_14grid_container_GridTree; + +static PyObject *__pyx_tp_new_2yt_8geometry_14grid_container_GridTree(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *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_2yt_8geometry_14grid_container_GridTree *)o); + p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_14grid_container_GridTree; + p->mask = ((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_2yt_8geometry_14grid_container_8GridTree_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_2yt_8geometry_14grid_container_GridTree(PyObject *o) { + struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *p = (struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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->mask); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_2yt_8geometry_14grid_container_GridTree(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *p = (struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)o; + if (p->mask) { + e = (*v)(((PyObject *)p->mask), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_2yt_8geometry_14grid_container_GridTree(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *p = (struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)o; + tmp = ((PyObject*)p->mask); + p->mask = ((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_2yt_8geometry_14grid_container_8GridTree_grid_arrays(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_2yt_8geometry_14grid_container_8GridTree_11grid_arrays_1__get__(o); +} + +static PyObject *__pyx_getprop_2yt_8geometry_14grid_container_8GridTree_mask(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_1__get__(o); +} + +static int __pyx_setprop_2yt_8geometry_14grid_container_8GridTree_mask(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_3__set__(o, v); + } + else { + return __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_2yt_8geometry_14grid_container_GridTree[] = { + {"return_tree_info", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_8return_tree_info, METH_NOARGS, 0}, + {"count", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_10count, METH_O, 0}, + {"select_icoords", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_12select_icoords, METH_VARARGS|METH_KEYWORDS, 0}, + {"select_ires", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_14select_ires, METH_VARARGS|METH_KEYWORDS, 0}, + {"select_fcoords", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_16select_fcoords, METH_VARARGS|METH_KEYWORDS, 0}, + {"select_fwidth", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_18select_fwidth, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_20__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_22__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_2yt_8geometry_14grid_container_GridTree[] = { + {(char *)"grid_arrays", __pyx_getprop_2yt_8geometry_14grid_container_8GridTree_grid_arrays, 0, (char *)0, 0}, + {(char *)"mask", __pyx_getprop_2yt_8geometry_14grid_container_8GridTree_mask, __pyx_setprop_2yt_8geometry_14grid_container_8GridTree_mask, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_14grid_container_GridTree = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.grid_container.GridTree", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_14grid_container_GridTree, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_2yt_8geometry_14grid_container_GridTree, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_14grid_container_GridTree, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_2yt_8geometry_14grid_container_8GridTree_5__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_14grid_container_GridTree, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_2yt_8geometry_14grid_container_GridTree, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_2yt_8geometry_14grid_container_8GridTree_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_14grid_container_GridTree, /*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_2yt_8geometry_14grid_container_MatchPointsToGrids __pyx_vtable_2yt_8geometry_14grid_container_MatchPointsToGrids; + +static PyObject *__pyx_tp_new_2yt_8geometry_14grid_container_MatchPointsToGrids(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *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_2yt_8geometry_14grid_container_MatchPointsToGrids *)o); + p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_14grid_container_MatchPointsToGrids; + p->tree = ((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_2yt_8geometry_14grid_container_MatchPointsToGrids(PyObject *o) { + struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *p = (struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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->tree); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_2yt_8geometry_14grid_container_MatchPointsToGrids(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *p = (struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)o; + if (p->tree) { + e = (*v)(((PyObject *)p->tree), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_2yt_8geometry_14grid_container_MatchPointsToGrids(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *p = (struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)o; + tmp = ((PyObject*)p->tree); + p->tree = ((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_2yt_8geometry_14grid_container_MatchPointsToGrids[] = { {"find_points_in_tree", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_3find_points_in_tree, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -25641,7 +27171,7 @@ int e; struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *p = (struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *)o; if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } return 0; } @@ -25737,7 +27267,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -25787,6 +27317,8 @@ 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} }; @@ -25906,7 +27438,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -25934,6 +27466,8 @@ } 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} }; @@ -26021,7 +27555,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -26133,6 +27667,8 @@ {"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} }; @@ -26258,7 +27794,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -26302,6 +27838,8 @@ } 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} }; @@ -26409,6 +27947,7 @@ {&__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_GridTree___iter, __pyx_k_GridTree___iter, sizeof(__pyx_k_GridTree___iter), 0, 0, 1, 1}, {&__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}, @@ -26439,16 +27978,18 @@ {&__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_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_b__50, __pyx_k__50, sizeof(__pyx_k__50), 0, 0, 0, 0}, - {&__pyx_kp_b__51, __pyx_k__51, sizeof(__pyx_k__51), 0, 0, 0, 0}, - {&__pyx_kp_b__52, __pyx_k__52, sizeof(__pyx_k__52), 0, 0, 0, 0}, - {&__pyx_kp_b__53, __pyx_k__53, sizeof(__pyx_k__53), 0, 0, 0, 0}, - {&__pyx_kp_u__54, __pyx_k__54, sizeof(__pyx_k__54), 0, 1, 0, 0}, + {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, + {&__pyx_kp_b__60, __pyx_k__60, sizeof(__pyx_k__60), 0, 0, 0, 0}, + {&__pyx_kp_b__61, __pyx_k__61, sizeof(__pyx_k__61), 0, 0, 0, 0}, + {&__pyx_kp_b__62, __pyx_k__62, sizeof(__pyx_k__62), 0, 0, 0, 0}, + {&__pyx_kp_b__63, __pyx_k__63, sizeof(__pyx_k__63), 0, 0, 0, 0}, + {&__pyx_kp_u__64, __pyx_k__64, sizeof(__pyx_k__64), 0, 1, 0, 0}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1}, @@ -26458,6 +27999,7 @@ {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1}, {&__pyx_n_s_children_pointers, __pyx_k_children_pointers, sizeof(__pyx_k_children_pointers), 0, 0, 1, 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_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 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}, @@ -26466,6 +28008,7 @@ {&__pyx_n_s_dds_x, __pyx_k_dds_x, sizeof(__pyx_k_dds_x), 0, 0, 1, 1}, {&__pyx_n_s_dds_y, __pyx_k_dds_y, sizeof(__pyx_k_dds_y), 0, 0, 1, 1}, {&__pyx_n_s_dds_z, __pyx_k_dds_z, sizeof(__pyx_k_dds_z), 0, 0, 1, 1}, + {&__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_dims_x, __pyx_k_dims_x, sizeof(__pyx_k_dims_x), 0, 0, 1, 1}, {&__pyx_n_s_dims_y, __pyx_k_dims_y, sizeof(__pyx_k_dims_y), 0, 0, 1, 1}, @@ -26487,6 +28030,7 @@ {&__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_index, __pyx_k_index, sizeof(__pyx_k_index), 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}, @@ -26506,6 +28050,8 @@ {&__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_num_children, __pyx_k_num_children, sizeof(__pyx_k_num_children), 0, 0, 1, 1}, {&__pyx_n_s_num_grids, __pyx_k_num_grids, sizeof(__pyx_k_num_grids), 0, 0, 1, 1}, @@ -26516,9 +28062,16 @@ {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_parent_ind, __pyx_k_parent_ind, sizeof(__pyx_k_parent_ind), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 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_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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 0, 0, 1, 1}, {&__pyx_n_s_right_edge_x, __pyx_k_right_edge_x, sizeof(__pyx_k_right_edge_x), 0, 0, 1, 1}, {&__pyx_n_s_right_edge_y, __pyx_k_right_edge_y, sizeof(__pyx_k_right_edge_y), 0, 0, 1, 1}, @@ -26526,6 +28079,7 @@ {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0}, {&__pyx_n_s_selector, __pyx_k_selector, sizeof(__pyx_k_selector), 0, 0, 1, 1}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 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_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, @@ -26537,6 +28091,7 @@ {&__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_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, @@ -26546,6 +28101,7 @@ {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 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_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_x_2, __pyx_k_x_2, sizeof(__pyx_k_x_2), 0, 0, 1, 1}, @@ -26558,17 +28114,17 @@ {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, 35, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 98, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(4, 14, __pyx_L1_error) - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(4, 18, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(4, 146, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(4, 149, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(4, 396, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(4, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(4, 818, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 97, __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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 218, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 989, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(1, 18, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -26578,75 +28134,113 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "yt/geometry/grid_container.pyx":78 + /* "yt/geometry/grid_container.pyx":77 * * for i in range(num_grids): * self.grids[i] = Grid_initialize(left_edge[i,:], # <<<<<<<<<<<<<< * right_edge[i,:], * dimensions[i,:], */ - __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); - /* "yt/geometry/grid_container.pyx":79 + /* "yt/geometry/grid_container.pyx":78 * for i in range(num_grids): * self.grids[i] = Grid_initialize(left_edge[i,:], * right_edge[i,:], # <<<<<<<<<<<<<< * dimensions[i,:], * num_children[i], */ - __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__2); __Pyx_GIVEREF(__pyx_slice__2); - /* "yt/geometry/grid_container.pyx":80 + /* "yt/geometry/grid_container.pyx":79 * self.grids[i] = Grid_initialize(left_edge[i,:], * right_edge[i,:], * dimensions[i,:], # <<<<<<<<<<<<<< * num_children[i], * level[i], i) */ - __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__3); __Pyx_GIVEREF(__pyx_slice__3); - /* "yt/geometry/grid_container.pyx":142 + /* "yt/geometry/grid_container.pyx":141 * d, o = dt.fields[name] * n = name * if name.endswith("_x"): # <<<<<<<<<<<<<< * f = (d.char, 3) * n = name[:-2] */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "yt/geometry/grid_container.pyx":144 + /* "yt/geometry/grid_container.pyx":143 * if name.endswith("_x"): * f = (d.char, 3) * n = name[:-2] # <<<<<<<<<<<<<< * elif name.endswith("_y") or name.endswith("_z"): * continue */ - __pyx_slice__5 = PySlice_New(Py_None, __pyx_int_neg_2, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_slice__5 = PySlice_New(Py_None, __pyx_int_neg_2, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__5); __Pyx_GIVEREF(__pyx_slice__5); - /* "yt/geometry/grid_container.pyx":145 + /* "yt/geometry/grid_container.pyx":144 * f = (d.char, 3) * n = name[:-2] * elif name.endswith("_y") or name.endswith("_z"): # <<<<<<<<<<<<<< * continue * else: */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_y); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_y); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_z); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_z); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); + /* "(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__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "(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__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "(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__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "(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__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): @@ -26654,9 +28248,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -26665,9 +28259,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -26676,9 +28270,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -26687,9 +28281,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -26698,9 +28292,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -26709,9 +28303,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -26720,9 +28314,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -26731,29 +28325,29 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); - /* "yt/geometry/selection_routines.pxd":30 + /* "yt/geometry/selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(4, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "FromPyStructUtility":19 * value = obj['num_children'] @@ -26762,9 +28356,9 @@ * result.num_children = value * try: */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(4, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "FromPyStructUtility":24 * value = obj['level'] @@ -26773,9 +28367,9 @@ * result.level = value * try: */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_2); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(4, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_2); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "FromPyStructUtility":29 * value = obj['index'] @@ -26784,9 +28378,9 @@ * result.index = value * try: */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_3); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(4, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_3); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "FromPyStructUtility":34 * value = obj['left_edge_x'] @@ -26795,9 +28389,9 @@ * result.left_edge_x = value * try: */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_4); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(4, 34, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_4); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "FromPyStructUtility":39 * value = obj['left_edge_y'] @@ -26806,9 +28400,9 @@ * result.left_edge_y = value * try: */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_5); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(4, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_5); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "FromPyStructUtility":44 * value = obj['left_edge_z'] @@ -26817,9 +28411,9 @@ * result.left_edge_z = value * try: */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_6); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(4, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_6); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); /* "FromPyStructUtility":49 * value = obj['right_edge_x'] @@ -26828,9 +28422,9 @@ * result.right_edge_x = value * try: */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_7); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(4, 49, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_7); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "FromPyStructUtility":54 * value = obj['right_edge_y'] @@ -26839,9 +28433,9 @@ * result.right_edge_y = value * try: */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_8); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(4, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_8); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "FromPyStructUtility":59 * value = obj['right_edge_z'] @@ -26850,9 +28444,9 @@ * result.right_edge_z = value * try: */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_9); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(4, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_9); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); /* "FromPyStructUtility":64 * value = obj['children_pointers'] @@ -26861,9 +28455,9 @@ * result.children_pointers = value * try: */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_10); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(4, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_10); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); /* "FromPyStructUtility":69 * value = obj['start_index_x'] @@ -26872,9 +28466,9 @@ * result.start_index_x = value * try: */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_11); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(4, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_11); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); /* "FromPyStructUtility":74 * value = obj['start_index_y'] @@ -26883,9 +28477,9 @@ * result.start_index_y = value * try: */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_12); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(4, 74, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_12); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); /* "FromPyStructUtility":79 * value = obj['start_index_z'] @@ -26894,9 +28488,9 @@ * result.start_index_z = value * try: */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_13); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(4, 79, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_13); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); /* "FromPyStructUtility":84 * value = obj['dims_x'] @@ -26905,9 +28499,9 @@ * result.dims_x = value * try: */ - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_14); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(4, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_14); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); /* "FromPyStructUtility":89 * value = obj['dims_y'] @@ -26916,9 +28510,9 @@ * result.dims_y = value * try: */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_15); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(4, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_15); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); /* "FromPyStructUtility":94 * value = obj['dims_z'] @@ -26927,9 +28521,9 @@ * result.dims_z = value * try: */ - __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_16); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(4, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_16); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); /* "FromPyStructUtility":99 * value = obj['dds_x'] @@ -26938,9 +28532,9 @@ * result.dds_x = value * try: */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_17); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(4, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_17); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); /* "FromPyStructUtility":104 * value = obj['dds_y'] @@ -26949,9 +28543,9 @@ * result.dds_y = value * try: */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_18); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(4, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_18); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); /* "FromPyStructUtility":109 * value = obj['dds_z'] @@ -26960,9 +28554,9 @@ * result.dds_z = value * return result */ - __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_19); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(4, 109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_19); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); /* "View.MemoryView":131 * @@ -26971,9 +28565,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(4, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); /* "View.MemoryView":134 * @@ -26982,9 +28576,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(4, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); /* "View.MemoryView":137 * @@ -26993,9 +28587,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(4, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); /* "View.MemoryView":146 * @@ -27004,9 +28598,9 @@ * * */ - __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(4, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -27015,9 +28609,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(4, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -27026,9 +28620,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(4, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + + /* "(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__47 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + + /* "(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__48 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -27037,9 +28650,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(4, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -27048,9 +28661,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(4, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); /* "View.MemoryView":563 * def suboffsets(self): @@ -27059,12 +28672,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__45 = PyTuple_New(1); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(4, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); + __pyx_tuple__51 = PyTuple_New(1); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__45, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__45); + PyTuple_SET_ITEM(__pyx_tuple__51, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__51); + + /* "(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__52 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + + /* "(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__53 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); /* "View.MemoryView":668 * if item is Ellipsis: @@ -27073,9 +28705,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__46 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__46)) __PYX_ERR(4, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__46); - __Pyx_GIVEREF(__pyx_slice__46); + __pyx_slice__54 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__54)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__54); + __Pyx_GIVEREF(__pyx_slice__54); /* "View.MemoryView":671 * seen_ellipsis = True @@ -27084,9 +28716,9 @@ * have_slices = True * else: */ - __pyx_slice__47 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__47)) __PYX_ERR(4, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__47); - __Pyx_GIVEREF(__pyx_slice__47); + __pyx_slice__55 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__55)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__55); + __Pyx_GIVEREF(__pyx_slice__55); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -27095,9 +28727,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__48 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__48)) __PYX_ERR(4, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__48); - __Pyx_GIVEREF(__pyx_slice__48); + __pyx_slice__56 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__56)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__56); + __Pyx_GIVEREF(__pyx_slice__56); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -27106,9 +28738,28 @@ * * */ - __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(4, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + + /* "(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__58 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + + /* "(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__59 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); /* "View.MemoryView":282 * return self.name @@ -27117,9 +28768,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(4, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); /* "View.MemoryView":283 * @@ -27128,9 +28779,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(4, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -27139,9 +28790,9 @@ * * */ - __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(4, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__57); - __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); /* "View.MemoryView":287 * @@ -27150,9 +28801,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(4, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); /* "View.MemoryView":288 * @@ -27161,9 +28812,19 @@ * * */ - __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(4, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__59); - __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__70 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -27176,6 +28837,7 @@ __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) __pyx_int_neg_2 = PyInt_FromLong(-2); if (unlikely(!__pyx_int_neg_2)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; @@ -27241,6 +28903,7 @@ __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 @@ -27278,30 +28941,34 @@ __pyx_vtable_2yt_8geometry_14grid_container_GridTree.setup_data = (void (*)(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *))__pyx_f_2yt_8geometry_14grid_container_8GridTree_setup_data; __pyx_vtable_2yt_8geometry_14grid_container_GridTree.visit_grids = (void (*)(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *))__pyx_f_2yt_8geometry_14grid_container_8GridTree_visit_grids; __pyx_vtable_2yt_8geometry_14grid_container_GridTree.recursively_visit_grid = (void (*)(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *, struct __pyx_opt_args_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid *__pyx_optional_args))__pyx_f_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid; - if (PyType_Ready(&__pyx_type_2yt_8geometry_14grid_container_GridTree) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_14grid_container_GridTree) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_type_2yt_8geometry_14grid_container_GridTree.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_14grid_container_GridTree.tp_dict, __pyx_vtabptr_2yt_8geometry_14grid_container_GridTree) < 0) __PYX_ERR(0, 52, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "GridTree", (PyObject *)&__pyx_type_2yt_8geometry_14grid_container_GridTree) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_14grid_container_GridTree.tp_dict, __pyx_vtabptr_2yt_8geometry_14grid_container_GridTree) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "GridTree", (PyObject *)&__pyx_type_2yt_8geometry_14grid_container_GridTree) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_14grid_container_GridTree) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_ptype_2yt_8geometry_14grid_container_GridTree = &__pyx_type_2yt_8geometry_14grid_container_GridTree; __pyx_vtabptr_2yt_8geometry_14grid_container_MatchPointsToGrids = &__pyx_vtable_2yt_8geometry_14grid_container_MatchPointsToGrids; __pyx_vtable_2yt_8geometry_14grid_container_MatchPointsToGrids.check_position = (__pyx_t_5numpy_uint8_t (*)(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *))__pyx_f_2yt_8geometry_14grid_container_18MatchPointsToGrids_check_position; __pyx_vtable_2yt_8geometry_14grid_container_MatchPointsToGrids.is_in_grid = (__pyx_t_5numpy_uint8_t (*)(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *))__pyx_f_2yt_8geometry_14grid_container_18MatchPointsToGrids_is_in_grid; - if (PyType_Ready(&__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids) < 0) __PYX_ERR(0, 272, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids) < 0) __PYX_ERR(0, 271, __pyx_L1_error) __pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids.tp_dict, __pyx_vtabptr_2yt_8geometry_14grid_container_MatchPointsToGrids) < 0) __PYX_ERR(0, 272, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "MatchPointsToGrids", (PyObject *)&__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids) < 0) __PYX_ERR(0, 272, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids.tp_dict, __pyx_vtabptr_2yt_8geometry_14grid_container_MatchPointsToGrids) < 0) __PYX_ERR(0, 271, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "MatchPointsToGrids", (PyObject *)&__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids) < 0) __PYX_ERR(0, 271, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids) < 0) __PYX_ERR(0, 271, __pyx_L1_error) __pyx_ptype_2yt_8geometry_14grid_container_MatchPointsToGrids = &__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids; - if (PyType_Ready(&__pyx_type_2yt_8geometry_14grid_container___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 105, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_14grid_container___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 104, __pyx_L1_error) __pyx_type_2yt_8geometry_14grid_container___pyx_scope_struct____iter__.tp_print = 0; __pyx_ptype_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ = &__pyx_type_2yt_8geometry_14grid_container___pyx_scope_struct____iter__; __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(4, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(4, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(4, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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; @@ -27311,18 +28978,20 @@ __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(4, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(4, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(4, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(4, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -27332,11 +29001,11 @@ sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(5, 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, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 861, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = __Pyx_ImportType("yt.geometry.oct_visitors", "OctVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(6, 33, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(6, 33, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = __Pyx_ImportType("yt.geometry.oct_visitors", "CountTotalOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts)) __PYX_ERR(6, 59, __pyx_L1_error) @@ -27375,12 +29044,14 @@ __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(6, 114, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType("yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(6, 117, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(6, 117, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(3, 33, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(3, 33, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(3, 71, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(3, 71, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(3, 74, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(3, 74, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(4, 29, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(4, 29, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(4, 67, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(4, 67, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(4, 70, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(4, 70, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType("yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(4, 74, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(4, 74, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray = __Pyx_ImportType("yt.utilities.lib.bitarray", "bitarray", sizeof(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray)) __PYX_ERR(7, 30, __pyx_L1_error) __pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray = (struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray)) __PYX_ERR(7, 30, __pyx_L1_error) /*--- Variable import code ---*/ @@ -27430,9 +29101,9 @@ * * 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(4, 207, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(4, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_array_type); @@ -27443,7 +29114,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 282, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_2); @@ -27457,7 +29128,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 283, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_2); @@ -27471,7 +29142,7 @@ * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 284, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_2); @@ -27485,7 +29156,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 287, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_2); @@ -27499,7 +29170,7 @@ * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); @@ -27539,9 +29210,9 @@ * * */ - __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 535, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(4, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_memoryview_type); @@ -27552,12 +29223,22 @@ * * */ - __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 981, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(4, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_memoryviewslice_type); + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import 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(1, 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(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "BufferFormatFromTypeInfo":1447 * * @cname('__pyx_format_from_typeinfo') @@ -27574,7 +29255,7 @@ __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.geometry.grid_container", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.geometry.grid_container", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -28672,17 +30353,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -28801,8 +30487,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON @@ -28842,11 +30528,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -28869,20 +30551,20 @@ #endif /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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"); } /* IterFinish */ - static CYTHON_INLINE int __Pyx_IterFinish(void) { + static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; @@ -28917,7 +30599,7 @@ } /* UnpackItemEndCheck */ - static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); @@ -28929,7 +30611,7 @@ } /* SliceObject */ - static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, + 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) { @@ -29026,7 +30708,7 @@ } /* MemviewSliceInit */ - static int + static int __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, @@ -29161,12 +30843,12 @@ } /* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -29190,7 +30872,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -29200,7 +30882,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -29260,8 +30942,39 @@ return -1; } +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* 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; + } +} + /* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -29279,7 +30992,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -29299,7 +31021,7 @@ } /* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -29339,6 +31061,21 @@ 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; @@ -29383,28 +31120,15 @@ } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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_COMPILING_IN_CPYTHON -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); -} - /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -29436,8 +31160,23 @@ } } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -29462,7 +31201,7 @@ #endif /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -29536,7 +31275,7 @@ } /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -29547,9 +31286,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -29562,9 +31304,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -29617,7 +31362,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -29733,27 +31478,41 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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; } +/* 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; +} + /* StringJoin */ - #if !CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); } #endif /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -29770,8 +31529,73 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -29790,8 +31614,42 @@ return NULL; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -29871,7 +31729,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -29930,12 +31788,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -29974,8 +31835,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -29998,7 +31859,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -30034,7 +31895,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -30047,7 +31908,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -30069,7 +31930,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -30100,7 +31961,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -30131,7 +31992,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + 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) { @@ -30161,75 +32022,106 @@ } } +/* 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); + } +} + static PyObject* __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded s) { - PyObject* res; - PyObject* member; - res = PyDict_New(); if (unlikely(!res)) return NULL; - member = __Pyx_PyInt_From_npy_int32(s.num_children); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_num_children, member) < 0)) goto bad; - Py_DECREF(member); - member = __Pyx_PyInt_From_npy_int32(s.level); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_level, member) < 0)) goto bad; - Py_DECREF(member); - member = __Pyx_PyInt_From_npy_int64(s.index); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_index, member) < 0)) goto bad; - Py_DECREF(member); - member = PyFloat_FromDouble(s.left_edge_x); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_left_edge_x, member) < 0)) goto bad; - Py_DECREF(member); - member = PyFloat_FromDouble(s.left_edge_y); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_left_edge_y, member) < 0)) goto bad; - Py_DECREF(member); - member = PyFloat_FromDouble(s.left_edge_z); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_left_edge_z, member) < 0)) goto bad; - Py_DECREF(member); - member = PyFloat_FromDouble(s.right_edge_x); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_right_edge_x, member) < 0)) goto bad; - Py_DECREF(member); - member = PyFloat_FromDouble(s.right_edge_y); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_right_edge_y, member) < 0)) goto bad; - Py_DECREF(member); - member = PyFloat_FromDouble(s.right_edge_z); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_right_edge_z, member) < 0)) goto bad; - Py_DECREF(member); - member = __Pyx_PyInt_From_npy_int64(s.children_pointers); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_children_pointers, member) < 0)) goto bad; - Py_DECREF(member); - member = __Pyx_PyInt_From_npy_int64(s.start_index_x); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_start_index_x, member) < 0)) goto bad; - Py_DECREF(member); - member = __Pyx_PyInt_From_npy_int64(s.start_index_y); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_start_index_y, member) < 0)) goto bad; - Py_DECREF(member); - member = __Pyx_PyInt_From_npy_int64(s.start_index_z); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_start_index_z, member) < 0)) goto bad; - Py_DECREF(member); - member = __Pyx_PyInt_From_npy_int32(s.dims_x); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_dims_x, member) < 0)) goto bad; - Py_DECREF(member); - member = __Pyx_PyInt_From_npy_int32(s.dims_y); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_dims_y, member) < 0)) goto bad; - Py_DECREF(member); - member = __Pyx_PyInt_From_npy_int32(s.dims_z); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_dims_z, member) < 0)) goto bad; - Py_DECREF(member); - member = PyFloat_FromDouble(s.dds_x); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_dds_x, member) < 0)) goto bad; - Py_DECREF(member); - member = PyFloat_FromDouble(s.dds_y); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_dds_y, member) < 0)) goto bad; - Py_DECREF(member); - member = PyFloat_FromDouble(s.dds_z); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_dds_z, member) < 0)) goto bad; - Py_DECREF(member); - return res; - bad: - Py_XDECREF(member); - Py_DECREF(res); - return NULL; - } - /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(const char *itemp) { + PyObject* res; + PyObject* member; + res = PyDict_New(); if (unlikely(!res)) return NULL; + member = __Pyx_PyInt_From_npy_int32(s.num_children); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_num_children, member) < 0)) goto bad; + Py_DECREF(member); + member = __Pyx_PyInt_From_npy_int32(s.level); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_level, member) < 0)) goto bad; + Py_DECREF(member); + member = __Pyx_PyInt_From_npy_int64(s.index); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_index, member) < 0)) goto bad; + Py_DECREF(member); + member = PyFloat_FromDouble(s.left_edge_x); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_left_edge_x, member) < 0)) goto bad; + Py_DECREF(member); + member = PyFloat_FromDouble(s.left_edge_y); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_left_edge_y, member) < 0)) goto bad; + Py_DECREF(member); + member = PyFloat_FromDouble(s.left_edge_z); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_left_edge_z, member) < 0)) goto bad; + Py_DECREF(member); + member = PyFloat_FromDouble(s.right_edge_x); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_right_edge_x, member) < 0)) goto bad; + Py_DECREF(member); + member = PyFloat_FromDouble(s.right_edge_y); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_right_edge_y, member) < 0)) goto bad; + Py_DECREF(member); + member = PyFloat_FromDouble(s.right_edge_z); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_right_edge_z, member) < 0)) goto bad; + Py_DECREF(member); + member = __Pyx_PyInt_From_npy_long(s.children_pointers); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_children_pointers, member) < 0)) goto bad; + Py_DECREF(member); + member = __Pyx_PyInt_From_npy_int64(s.start_index_x); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_start_index_x, member) < 0)) goto bad; + Py_DECREF(member); + member = __Pyx_PyInt_From_npy_int64(s.start_index_y); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_start_index_y, member) < 0)) goto bad; + Py_DECREF(member); + member = __Pyx_PyInt_From_npy_int64(s.start_index_z); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_start_index_z, member) < 0)) goto bad; + Py_DECREF(member); + member = __Pyx_PyInt_From_npy_int32(s.dims_x); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_dims_x, member) < 0)) goto bad; + Py_DECREF(member); + member = __Pyx_PyInt_From_npy_int32(s.dims_y); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_dims_y, member) < 0)) goto bad; + Py_DECREF(member); + member = __Pyx_PyInt_From_npy_int32(s.dims_z); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_dims_z, member) < 0)) goto bad; + Py_DECREF(member); + member = PyFloat_FromDouble(s.dds_x); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_dds_x, member) < 0)) goto bad; + Py_DECREF(member); + member = PyFloat_FromDouble(s.dds_y); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_dds_y, member) < 0)) goto bad; + Py_DECREF(member); + member = PyFloat_FromDouble(s.dds_z); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_dds_z, member) < 0)) goto bad; + Py_DECREF(member); + return res; + bad: + Py_XDECREF(member); + Py_DECREF(res); + return NULL; + } + /* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(const char *itemp) { return (PyObject *) __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(*(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded *) itemp); } static CYTHON_INLINE int __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(const char *itemp, PyObject *obj) { @@ -30241,7 +32133,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -30272,7 +32164,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -30292,7 +32184,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -30427,7 +32319,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -30447,7 +32339,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -30582,7 +32474,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -30591,108 +32483,530 @@ } 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); + } 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 + } } - } 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); + { +#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; } - { - 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); +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; +} + +/* TypeInfoToFormat */ + static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) { + struct __pyx_typeinfo_string result = { {0} }; + char *buf = (char *) result.string; + size_t size = type->size; + switch (type->typegroup) { + case 'H': + *buf = 'c'; + break; + case 'I': + case 'U': + if (size == 1) + *buf = (type->is_unsigned) ? 'B' : 'b'; + else if (size == 2) + *buf = (type->is_unsigned) ? 'H' : 'h'; + else if (size == 4) + *buf = (type->is_unsigned) ? 'I' : 'i'; + else if (size == 8) + *buf = (type->is_unsigned) ? 'Q' : 'q'; + break; + case 'P': + *buf = 'P'; + break; + case 'C': + { + __Pyx_TypeInfo complex_type = *type; + complex_type.typegroup = 'R'; + complex_type.size /= 2; + *buf++ = 'Z'; + *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0]; + break; + } + case 'R': + if (size == 4) + *buf = 'f'; + else if (size == 8) + *buf = 'd'; + else + *buf = 'g'; + break; } + return result; } -/* 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; +/* CIntFromPy */ + static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { + const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (npy_uint64) 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_uint64) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, digits[0]) + case 2: + if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) >= 2 * PyLong_SHIFT) { + return (npy_uint64) (((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) >= 3 * PyLong_SHIFT) { + return (npy_uint64) (((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) >= 4 * PyLong_SHIFT) { + return (npy_uint64) (((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)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_uint64) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, 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_uint64) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_uint64, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, +digits[0]) + case -2: + if (8 * sizeof(npy_uint64) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint64) ((((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint64) ((((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint64) ((((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + } +#endif + if (sizeof(npy_uint64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } } - } - 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; + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint64 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_uint64) -1; } + } else { + npy_uint64 val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_uint64) -1; + val = __Pyx_PyInt_As_npy_uint64(tmp); + Py_DECREF(tmp); + return val; } - 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; +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to npy_uint64"); + return (npy_uint64) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint64"); + return (npy_uint64) -1; } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; + static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (int) val; + return (npy_int32) val; } } else #endif @@ -30701,32 +33015,32 @@ #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 0: return (npy_int32) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0]) case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 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])); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) { + return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); } } break; case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 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])); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) { + return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); } } break; case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 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])); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) { + return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); } } break; @@ -30740,86 +33054,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (int) -1; + return (npy_int32) -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)) + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { - case 0: return (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 0: return (npy_int32) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0]) case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) - 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]))); + __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { + return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 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]))); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { + return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) - 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]))); + __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { + return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 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]))); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { + return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) - 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]))); + __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { + return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 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]))); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { + return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; } #endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, 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)) + } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -30828,7 +33142,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - int val; + npy_int32 val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -30848,84 +33162,40 @@ return val; } #endif - return (int) -1; + return (npy_int32) -1; } } else { - int val; + npy_int32 val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); Py_DECREF(tmp); return val; } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* TypeInfoToFormat */ - static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) { - struct __pyx_typeinfo_string result = { {0} }; - char *buf = (char *) result.string; - size_t size = type->size; - switch (type->typegroup) { - case 'H': - *buf = 'c'; - break; - case 'I': - case 'U': - if (size == 1) - *buf = (type->is_unsigned) ? 'B' : 'b'; - else if (size == 2) - *buf = (type->is_unsigned) ? 'H' : 'h'; - else if (size == 4) - *buf = (type->is_unsigned) ? 'I' : 'i'; - else if (size == 8) - *buf = (type->is_unsigned) ? 'Q' : 'q'; - break; - case 'P': - *buf = 'P'; - break; - case 'C': - { - __Pyx_TypeInfo complex_type = *type; - complex_type.typegroup = 'R'; - complex_type.size /= 2; - *buf++ = 'Z'; - *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0]; - break; - } - case 'R': - if (size == 4) - *buf = 'f'; - else if (size == 8) - *buf = 'd'; - else - *buf = 'g'; - break; - } - return result; +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to npy_int32"); + return (npy_int32) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; } /* CIntFromPy */ - static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { - const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; + 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_uint64) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG(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_uint64) val; + return (npy_int64) val; } } else #endif @@ -30934,32 +33204,32 @@ #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { - case 0: return (npy_uint64) 0; - case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, digits[0]) + case 0: return (npy_int64) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0]) case 2: - if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_uint64) >= 2 * PyLong_SHIFT) { - return (npy_uint64) (((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + __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_uint64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_uint64) >= 3 * PyLong_SHIFT) { - return (npy_uint64) (((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + __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_uint64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) >= 4 * PyLong_SHIFT) { - return (npy_uint64) (((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + __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; @@ -30973,86 +33243,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (npy_uint64) -1; + return (npy_int64) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif - if (sizeof(npy_uint64) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned long, PyLong_AsUnsignedLong(x)) + 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_uint64) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } 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_uint64) 0; - case -1: __PYX_VERIFY_RETURN_INT(npy_uint64, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, +digits[0]) + 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_uint64) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { - return (npy_uint64) (((npy_uint64)-1)*(((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + __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_uint64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { - return (npy_uint64) ((((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + __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_uint64) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { - return (npy_uint64) (((npy_uint64)-1)*(((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + __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_uint64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { - return (npy_uint64) ((((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + __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_uint64) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { - return (npy_uint64) (((npy_uint64)-1)*(((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + __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_uint64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { - return (npy_uint64) ((((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + __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_uint64) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, long, PyLong_AsLong(x)) + 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_uint64) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -31061,7 +33331,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - npy_uint64 val; + npy_int64 val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -31081,40 +33351,40 @@ return val; } #endif - return (npy_uint64) -1; + return (npy_int64) -1; } } else { - npy_uint64 val; + npy_int64 val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (npy_uint64) -1; - val = __Pyx_PyInt_As_npy_uint64(tmp); + 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_uint64"); - return (npy_uint64) -1; + "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_uint64"); - return (npy_uint64) -1; + "can't convert negative value to npy_int64"); + return (npy_int64) -1; } /* CIntFromPy */ - static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { - const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; + 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_int32) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(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_int32) val; + return (npy_long) val; } } else #endif @@ -31123,32 +33393,32 @@ #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { - case 0: return (npy_int32) 0; - case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0]) + case 0: return (npy_long) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_long, digit, digits[0]) case 2: - if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) { - return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); + __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_int32) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) { - return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); + __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_int32) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) { - return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); + __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; @@ -31162,86 +33432,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (npy_int32) -1; + return (npy_long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif - if (sizeof(npy_int32) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x)) + 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_int32) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } 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_int32) 0; - case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0]) + case 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_int32) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { - return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + __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_int32) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { - return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + __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_int32) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { - return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + __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_int32) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { - return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + __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_int32) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { - return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + __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_int32) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { - return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + __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_int32) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x)) + 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_int32) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if (sizeof(npy_long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -31250,7 +33520,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - npy_int32 val; + npy_long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -31270,40 +33540,40 @@ return val; } #endif - return (npy_int32) -1; + return (npy_long) -1; } } else { - npy_int32 val; + npy_long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (npy_int32) -1; - val = __Pyx_PyInt_As_npy_int32(tmp); + 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_int32"); - return (npy_int32) -1; + "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_int32"); - return (npy_int32) -1; + "can't convert negative value to npy_long"); + return (npy_long) -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; + 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(npy_int64) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x)) + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (npy_int64) val; + return (long) val; } } else #endif @@ -31312,32 +33582,32 @@ #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 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: - if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(npy_int64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(npy_int64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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; @@ -31351,86 +33621,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (npy_int64) -1; + return (long) -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)) + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } 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 (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 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(npy_int64) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(npy_int64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(npy_int64) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(npy_int64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(npy_int64) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(npy_int64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(npy_int64) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x)) + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -31439,7 +33709,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - npy_int64 val; + long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -31459,28 +33729,28 @@ return val; } #endif - return (npy_int64) -1; + return (long) -1; } } else { - npy_int64 val; + long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (npy_int64) -1; - val = __Pyx_PyInt_As_npy_int64(tmp); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to npy_int64"); - return (npy_int64) -1; + "value too large to convert to long"); + return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to npy_int64"); - return (npy_int64) -1; + "can't convert negative value to long"); + return (long) -1; } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -31511,7 +33781,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + 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 @@ -31699,197 +33969,8 @@ return (char) -1; } -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - 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; -} - /* FetchCommonType */ - static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); @@ -31928,7 +34009,7 @@ } /* PyObjectCallMethod1 */ - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto done; @@ -31974,7 +34055,7 @@ } /* CoroutineBase */ - #include + #include #include static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); @@ -32507,7 +34588,7 @@ } /* PatchModuleWithCoroutine */ - static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { + static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; @@ -32547,7 +34628,7 @@ } /* PatchGeneratorABC */ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( @@ -32601,7 +34682,7 @@ } /* Generator */ - static PyMethodDef __pyx_Generator_methods[] = { + static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, @@ -32690,7 +34771,7 @@ } /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -32731,7 +34812,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -32913,7 +34994,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[2]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -32936,7 +35017,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -32952,7 +35033,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -32970,7 +35051,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -33035,7 +35116,7 @@ #endif /* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction + #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; @@ -33089,7 +35170,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -33114,6 +35195,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -33122,11 +35205,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/geometry/grid_container.pyx yt-3.4.0/yt/geometry/grid_container.pyx --- yt-3.3.3/yt/geometry/grid_container.pyx 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/geometry/grid_container.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -16,7 +16,6 @@ import numpy as np cimport numpy as np cimport cython -from libc.math cimport rint from yt.utilities.lib.bitarray cimport bitarray @cython.boundscheck(False) @@ -63,9 +62,9 @@ np.ndarray[np.int64_t, ndim=1] num_children): cdef int i, j, k - cdef np.ndarray[np.int64_t, ndim=1] child_ptr + cdef np.ndarray[np.int_t, ndim=1] child_ptr - child_ptr = np.zeros(num_grids, dtype='int64') + child_ptr = np.zeros(num_grids, dtype='int') self.num_grids = num_grids self.num_root_grids = 0 diff -Nru yt-3.3.3/yt/geometry/grid_visitors.c yt-3.4.0/yt/geometry/grid_visitors.c --- yt-3.3.3/yt/geometry/grid_visitors.c 2016-12-12 01:41:23.000000000 +0000 +++ yt-3.4.0/yt/geometry/grid_visitors.c 2017-08-10 18:20:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -9,6 +9,10 @@ ], "libraries": [ "m" + ], + "name": "yt.geometry.grid_visitors", + "sources": [ + "yt/geometry/grid_visitors.pyx" ] }, "module_name": "yt.geometry.grid_visitors" @@ -22,7 +26,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -44,6 +48,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -196,16 +201,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -332,6 +341,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -386,6 +401,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -493,8 +537,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -507,8 +551,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -630,10 +677,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -963,7 +1012,7 @@ __pyx_t_5numpy_float64_t right_edge_x; __pyx_t_5numpy_float64_t right_edge_y; __pyx_t_5numpy_float64_t right_edge_z; - __pyx_t_5numpy_int64_t children_pointers; + __pyx_t_5numpy_int_t children_pointers; __pyx_t_5numpy_int64_t start_index_x; __pyx_t_5numpy_int64_t start_index_y; __pyx_t_5numpy_int64_t start_index_z; @@ -1206,6 +1255,9 @@ /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1400,7 +1452,7 @@ /* Module declarations from 'yt.utilities.lib.fp_utils' */ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ /* Module declarations from 'yt.utilities.lib.bitarray' */ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray = 0; @@ -1424,6 +1476,7 @@ static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Grid_visitor_functions[] = "\nGrid visitor functions\n\n\n\n\n"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; @@ -1439,6 +1492,7 @@ static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_main; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; @@ -2236,3008 +2290,3008 @@ __pyx_L0:; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "yt/utilities/lib/fp_utils.pxd":20 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * if info == NULL: return # <<<<<<<<<<<<<< * + * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; + __pyx_r = 0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_v_endian_detector = 1; - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + * ndim = PyArray_NDIM(self) */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":24 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * - * cdef inline int imin(int i0, int i1) nogil: + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_v_copy_shape = 1; - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; } - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * 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, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 218, __pyx_L1_error) -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * 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_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + * 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") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * info.buf = PyArray_DATA(self) */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 222, __pyx_L1_error) - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * 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") */ + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":40 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_v_info->ndim = __pyx_v_ndim; - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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]); - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; + goto __pyx_L11; } - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fclip(np.float64_t f, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + /*else*/ { + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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; -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; - - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * cdef int t */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ + __pyx_v_f = NULL; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ + __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; -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":54 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< * + * if not hasfields and not copy_shape: */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + goto __pyx_L14; + } -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * + * if not hasfields: */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); } + __pyx_L14:; - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; -/* 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)); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (__pyx_t_1) { -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 259, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_endian_detector = 1; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - __pyx_v_copy_shape = 1; + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ - goto __pyx_L4; - } + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - if (__pyx_t_1) { + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ - } + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ - } + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - __pyx_v_info->ndim = __pyx_v_ndim; + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 278, __pyx_L1_error) + break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return * else: */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + __pyx_v_info->format = __pyx_v_f; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< * else: - * info.strides = PyArray_STRIDES(self) + * info.format = stdlib.malloc(_buffer_format_string_len) */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - goto __pyx_L11; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; + (__pyx_v_info->format[0]) = '^'; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ - __pyx_v_info->suboffsets = NULL; + __pyx_v_offset = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< * - * cdef int t + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + (__pyx_v_f[0]) = '\x00'; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - __pyx_v_f = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * 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; + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * if not hasfields and not copy_shape: + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; + free(__pyx_v_info->format); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - goto __pyx_L14; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block * - * if not hasfields: */ - /*else*/ { - __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); + free(__pyx_v_info->strides); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ } - __pyx_L14:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; + __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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; + __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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * 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): */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; + __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, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) + * */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; + __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, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) + * */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ - __pyx_v_info->format = __pyx_v_f; + __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * */ - __pyx_r = 0; - goto __pyx_L0; + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * 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, 794, __pyx_L1_error) } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) */ + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * 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_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 799, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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") + * */ - free(__pyx_v_info->format); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - } + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + __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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - free(__pyx_v_info->strides); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply */ - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 803, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + } - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 * */ + __pyx_v_f = (__pyx_v_f + 1); - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< * + * offset[0] += child.itemsize */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * offset[0] += child.itemsize # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew3(a, b, c): + * if not PyDataType_HASFIELDS(child): */ - __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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * 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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * + * # Until ticket #99 is fixed, use integers to avoid warnings */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 823, __pyx_L1_error) - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * */ + } -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * # 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_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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" */ - __Pyx_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, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_v_endian_detector = 1; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - if (unlikely(__pyx_v_descr->fields == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; } - #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, 796, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + /*else*/ { + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 844, __pyx_L1_error) + } + __pyx_L15:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + goto __pyx_L13; } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] * child, new_offset = fields + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< * - * 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, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { + __pyx_r = __pyx_v_f; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * - * if ((child.byteorder == c'>' and little_endian) or + * 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. */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - __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:; + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! */ - __pyx_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:; + __pyx_v_baseptr = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - if (__pyx_t_6) { + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + /*else*/ { + Py_INCREF(__pyx_v_base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") */ - } + Py_XDECREF(__pyx_v_arr->base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 + * cdef inline object get_array_base(ndarray arr): */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; + __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base */ - __pyx_v_f = (__pyx_v_f + 1); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * - * offset[0] += child.itemsize + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< * - * 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); + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") * - * # 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, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } + } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_v_f = (__pyx_v_f + 1); + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - goto __pyx_L13; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f + /* 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; +} + +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields */ + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_r = __pyx_v_f; + __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * 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. + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "yt/utilities/lib/fp_utils.pxd":24 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 + * */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_v_baseptr = NULL; + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - goto __pyx_L3; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * 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); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * */ - Py_XDECREF(__pyx_v_arr->base); + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* function exit code */ - __Pyx_RefNannyFinishContext(); + __pyx_L0:; + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 * - * 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); + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":36 * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 * */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + if (__pyx_t_1) { + __pyx_r = (-__pyx_v_f0); goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + */ + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_array", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":40 * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * - * 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, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - { - __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:*/ { + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.float64_t fclip(np.float64_t f, */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + __pyx_r = __pyx_v_i; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_ufunc() except -1: + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * 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:*/ { + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":58 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* 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; } @@ -5373,6 +5427,7 @@ {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, @@ -5564,6 +5619,7 @@ __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 @@ -5648,7 +5704,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.geometry.grid_visitors", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.geometry.grid_visitors", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -6048,6 +6104,40 @@ return NULL; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; @@ -6188,12 +6278,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -7205,6 +7298,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -7213,11 +7308,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/geometry/grid_visitors.pxd yt-3.4.0/yt/geometry/grid_visitors.pxd --- yt-3.3.3/yt/geometry/grid_visitors.pxd 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/geometry/grid_visitors.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -37,7 +37,7 @@ np.float64_t right_edge_x np.float64_t right_edge_y np.float64_t right_edge_z - np.int64_t children_pointers + np.int_t children_pointers np.int64_t start_index_x np.int64_t start_index_y np.int64_t start_index_z diff -Nru yt-3.3.3/yt/geometry/oct_container.c yt-3.4.0/yt/geometry/oct_container.c --- yt-3.3.3/yt/geometry/oct_container.c 2016-12-12 01:41:25.000000000 +0000 +++ yt-3.4.0/yt/geometry/oct_container.c 2017-08-10 18:20:09.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -11,6 +11,11 @@ ], "libraries": [ "m" + ], + "name": "yt.geometry.oct_container", + "sources": [ + "yt/geometry/oct_container.pyx", + "yt/utilities/lib/tsearch.c" ] }, "module_name": "yt.geometry.oct_container" @@ -24,7 +29,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -46,6 +51,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -198,16 +204,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -334,6 +344,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -388,6 +404,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -500,8 +545,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -514,8 +559,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -637,10 +685,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -674,23 +724,13 @@ static const char *__pyx_f[] = { "yt/geometry/oct_container.pyx", + "stringsource", "yt/geometry/oct_container.pxd", "yt/geometry/selection_routines.pxd", "__init__.pxd", - "stringsource", "type.pxd", "yt/geometry/oct_visitors.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; - /* BufferFormatStructs.proto */ #define IS_UNSIGNED(type) (((type) -1) > 0) struct __Pyx_StructField_; @@ -727,6 +767,16 @@ char is_valid_array; } __Pyx_BufFmt_Context; +/* 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; + /* Atomics.proto */ #include #ifndef CYTHON_ATOMICS @@ -1013,11 +1063,13 @@ struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject; struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector; +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool; +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool; struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer; -struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__; struct __pyx_array_obj; struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; @@ -1128,7 +1180,7 @@ __pyx_t_5numpy_float64_t right_edge_x; __pyx_t_5numpy_float64_t right_edge_y; __pyx_t_5numpy_float64_t right_edge_z; - __pyx_t_5numpy_int64_t children_pointers; + __pyx_t_5numpy_int_t children_pointers; __pyx_t_5numpy_int64_t start_index_x; __pyx_t_5numpy_int64_t start_index_y; __pyx_t_5numpy_int64_t start_index_z; @@ -1170,7 +1222,7 @@ struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid; struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells; -/* "selection_routines.pxd":42 +/* "selection_routines.pxd":38 * cdef np.int64_t _hash * * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -1182,7 +1234,7 @@ int visit_covered; }; -/* "selection_routines.pxd":50 +/* "selection_routines.pxd":46 * np.float64_t spos[3], np.float64_t sdds[3], * OctVisitor visitor, int i, int j, int k) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1194,7 +1246,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "selection_routines.pxd":65 +/* "selection_routines.pxd":61 * np.ndarray[np.uint8_t, ndim=3] mask, * int level) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -1205,15 +1257,44 @@ int __pyx_n; __pyx_t_5numpy_uint8_t *cached_mask; }; +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer; +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs; + +/* "yt/utilities/lib/allocation_container.pxd":19 + * from libc.stdlib cimport malloc, free, realloc + * + * cdef struct AllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + void *my_objs; +}; + +/* "yt/utilities/lib/allocation_container.pxd":30 + * cdef np.uint64_t n_con + * cdef AllocationContainer* containers + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except * # <<<<<<<<<<<<<< + * cdef void setup_objs(self, void *obj, np.uint64_t count, + * np.uint64_t offset, np.int64_t con_id) + */ +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs { + int __pyx_n; + __pyx_t_5numpy_int64_t con_id; +}; struct __pyx_t_2yt_8geometry_13oct_container_OctKey; struct __pyx_t_2yt_8geometry_13oct_container_OctInfo; -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_t_2yt_8geometry_13oct_container_OctList; +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs; struct __pyx_opt_args_2yt_8geometry_13oct_container_21SparseOctreeContainer_visit_all_octs; -/* "yt/geometry/oct_container.pxd":28 +/* "yt/geometry/oct_container.pxd":30 * cdef int ORDER_MAX * * cdef struct OctKey: # <<<<<<<<<<<<<< @@ -1225,7 +1306,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node; }; -/* "yt/geometry/oct_container.pxd":32 +/* "yt/geometry/oct_container.pxd":34 * Oct *node * * cdef struct OctInfo: # <<<<<<<<<<<<<< @@ -1239,25 +1320,9 @@ __pyx_t_5numpy_int32_t level; }; -/* "yt/geometry/oct_container.pxd":38 +/* "yt/geometry/oct_container.pxd":40 * np.int32_t level * - * cdef struct OctAllocationContainer # <<<<<<<<<<<<<< - * cdef struct OctAllocationContainer: - * np.int64_t n - */ -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { - __pyx_t_5numpy_int64_t n; - __pyx_t_5numpy_int64_t n_assigned; - __pyx_t_5numpy_int64_t offset; - __pyx_t_5numpy_int64_t con_id; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *next; - struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_octs; -}; - -/* "yt/geometry/oct_container.pxd":47 - * Oct *my_octs - * * cdef struct OctList # <<<<<<<<<<<<<< * * cdef struct OctList: @@ -1267,7 +1332,22 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "yt/geometry/oct_container.pxd":69 +/* "yt/geometry/oct_container.pxd":48 + * # NOTE: This object *has* to be the same size as the AllocationContainer + * # object. There's an assert in the __cinit__ function. + * cdef struct OctAllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs; +}; + +/* "yt/geometry/oct_container.pxd":74 * cdef public np.int64_t nocts * cdef public int num_domains * cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?, # <<<<<<<<<<<<<< @@ -1280,8 +1360,8 @@ int max_level; }; -/* "yt/geometry/oct_container.pxd":78 - * # OctAllocationContainer.offset if such a thing exists. +/* "yt/geometry/oct_container.pxd":83 + * # AllocationContainer.offset if such a thing exists. * cdef np.int64_t get_domain_offset(self, int domain_id) * cdef void visit_all_octs(self, # <<<<<<<<<<<<<< * selection_routines.SelectorObject selector, @@ -1292,7 +1372,7 @@ int vc; }; -/* "yt/geometry/oct_container.pyx":901 +/* "yt/geometry/oct_container.pyx":825 * * @cython.cdivision(True) * cdef void visit_all_octs(self, SelectorObject selector, # <<<<<<<<<<<<<< @@ -1562,12 +1642,12 @@ struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base; __Pyx_memviewslice ref_mask; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs; - __pyx_t_5numpy_int64_t *nocts; - __pyx_t_5numpy_int64_t *nfinest; + __pyx_t_5numpy_uint64_t *nocts; + __pyx_t_5numpy_uint64_t *nfinest; }; -/* "selection_routines.pxd":33 +/* "selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1587,7 +1667,7 @@ }; -/* "selection_routines.pxd":71 +/* "selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1599,7 +1679,7 @@ }; -/* "selection_routines.pxd":74 +/* "selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1613,18 +1693,59 @@ }; -/* "yt/geometry/oct_container.pxd":57 +/* "selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2; +}; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool { + PyObject_HEAD + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab; + __pyx_t_5numpy_uint64_t itemsize; + __pyx_t_5numpy_uint64_t n_con; + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers; +}; + + +/* "yt/geometry/oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; +}; + + +/* "yt/geometry/oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer { PyObject_HEAD struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *cont; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer **domains; + struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh; int partial_coverage; int level_offset; @@ -1638,7 +1759,7 @@ }; -/* "yt/geometry/oct_container.pxd":89 +/* "yt/geometry/oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -1654,7 +1775,7 @@ }; -/* "yt/geometry/oct_container.pxd":97 +/* "yt/geometry/oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -1666,7 +1787,7 @@ }; -/* "yt/geometry/oct_container.pyx":971 +/* "yt/geometry/oct_container.pyx":894 * pass * * cdef class ARTOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -1678,24 +1799,6 @@ }; -/* "yt/geometry/oct_container.pyx":199 - * free(self.root_mesh) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * #Get the next oct, will traverse domains - * #Note that oct containers can be sorted - */ -struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ { - PyObject_HEAD - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_cur; - int __pyx_v_i; - struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self; - struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_this; - __pyx_t_5numpy_int64_t __pyx_t_0; - int __pyx_t_1; -}; - - /* "View.MemoryView":103 * * @cname("__pyx_array") @@ -2044,7 +2147,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree; -/* "selection_routines.pxd":33 +/* "selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -2067,7 +2170,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; -/* "selection_routines.pxd":71 +/* "selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2081,7 +2184,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; -/* "selection_routines.pxd":74 +/* "selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2095,8 +2198,54 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; -/* "yt/geometry/oct_container.pyx":81 - * # those octs that live inside a given allocator. +/* "selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool { + void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args); + void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); + void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + + +/* "yt/geometry/oct_container.pyx":976 + * this = next + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * # This is an inherited version of the ObjectPool that provides setup and + * # teardown functions for the individually allocated objects. These allow + */ + +struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); +}; +static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool; +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); + + +/* "yt/geometry/oct_container.pyx":43 + * # given allocator. * * cdef class OctreeContainer: # <<<<<<<<<<<<<< * @@ -2117,7 +2266,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer; -/* "yt/geometry/oct_container.pyx":836 +/* "yt/geometry/oct_container.pyx":759 * return 1 * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -2133,8 +2282,8 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer; -/* "yt/geometry/oct_container.pyx":968 - * if self.domains != NULL: free(self.domains) +/* "yt/geometry/oct_container.pyx":891 + * if self.root_nodes != NULL: free(self.root_nodes) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< * pass @@ -2147,7 +2296,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer; -/* "yt/geometry/oct_container.pyx":971 +/* "yt/geometry/oct_container.pyx":894 * pass * * cdef class ARTOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -2291,35 +2440,6 @@ /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* WriteUnraisableException.proto */ -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename, - int full_traceback, int nogil); - /* 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); @@ -2354,6 +2474,13 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); +/* 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 + /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); @@ -2372,13 +2499,6 @@ #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); @@ -2394,6 +2514,9 @@ #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + /* BufferFormatCheck.proto */ static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); @@ -2401,7 +2524,17 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); + +/* BufferFallbackError.proto */ +static void __Pyx_RaiseBufferFallbackError(void); + +/* None.proto */ +static CYTHON_INLINE __pyx_t_5numpy_int32_t __Pyx_div___pyx_t_5numpy_int32_t(__pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); + +/* UnaryNegOverflows.proto */ +#define UNARY_NEG_WOULD_OVERFLOW(x)\ + (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) /* MemviewSliceInit.proto */ #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d @@ -2429,6 +2562,49 @@ 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 = PyThreadState_GET(); +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* 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); + +/* BufferIndexError.proto */ +static void __Pyx_RaiseBufferIndexError(int axis); + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +/* ArgTypeTest.proto */ +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); + /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { @@ -2446,33 +2622,6 @@ #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif -/* GetModuleGlobalName.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -/* BufferFallbackError.proto */ -static void __Pyx_RaiseBufferFallbackError(void); - -/* None.proto */ -static CYTHON_INLINE __pyx_t_5numpy_int32_t __Pyx_div___pyx_t_5numpy_int32_t(__pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); - -/* UnaryNegOverflows.proto */ -#define UNARY_NEG_WOULD_OVERFLOW(x)\ - (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* BufferIndexError.proto */ -static void __Pyx_RaiseBufferIndexError(int axis); - -#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) -/* ArgTypeTest.proto */ -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); - /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace); @@ -2482,6 +2631,12 @@ #endif #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* append.proto */ +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); + /* IncludeStringH.proto */ #include @@ -2498,6 +2653,15 @@ #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif +/* KeywordStringCheck.proto */ +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { @@ -2560,8 +2724,19 @@ 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 *); +/* 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( @@ -2569,6 +2744,9 @@ 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) @@ -2627,9 +2805,19 @@ #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() + /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join @@ -2648,12 +2836,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); #endif -/* SetVTable.proto */ -static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetNameInClass.proto */ static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name); @@ -2661,6 +2855,9 @@ #include "descrobject.h" static PyObject* __Pyx_Method_ClassMethod(PyObject *method); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -2740,16 +2937,10 @@ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *); /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); - -struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded; -static PyObject* __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded s); -/* MemviewDtypeToObject.proto */ -static CYTHON_INLINE PyObject *__pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char *itemp); -static CYTHON_INLINE int __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char *itemp, PyObject *obj); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value); @@ -2774,6 +2965,12 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value); +struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded; +static PyObject* __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded s); +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char *itemp, PyObject *obj); + /* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -2900,6 +3097,9 @@ /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *); + /* PrintOne.proto */ static int __Pyx_PrintOne(PyObject* stream, PyObject *o); @@ -2907,60 +3107,8 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); /* ObjectToMemviewSlice.proto */ -static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(PyObject *); - -/* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *); -/* FetchCommonType.proto */ -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); - -/* PyObjectCallMethod1.proto */ -static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); - -/* CoroutineBase.proto */ -typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *); -typedef struct { - PyObject_HEAD - __pyx_coroutine_body_t body; - PyObject *closure; - PyObject *exc_type; - PyObject *exc_value; - PyObject *exc_traceback; - PyObject *gi_weakreflist; - PyObject *classobj; - PyObject *yieldfrom; - PyObject *gi_name; - PyObject *gi_qualname; - PyObject *gi_modulename; - int resume_label; - char is_running; -} __pyx_CoroutineObject; -static __pyx_CoroutineObject *__Pyx__Coroutine_New( - PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure, - PyObject *name, PyObject *qualname, PyObject *module_name); -static int __Pyx_Coroutine_clear(PyObject *self); -#if 1 || PY_VERSION_HEX < 0x030300B0 -static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue); -#else -#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue) -#endif - -/* PatchModuleWithCoroutine.proto */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); - -/* PatchGeneratorABC.proto */ -static int __Pyx_patch_abc(void); - -/* Generator.proto */ -#define __Pyx_Generator_USED -static PyTypeObject *__pyx_GeneratorType = 0; -#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) -#define __Pyx_Generator_New(body, closure, name, qualname, module_name)\ - __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname, module_name) -static PyObject *__Pyx_Generator_Next(PyObject *self); -static int __pyx_Generator_init(void); - /* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_uint8_t(PyObject *); @@ -2976,6 +3124,9 @@ /* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsds_nn___pyx_t_5numpy_float64_t(PyObject *); +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(PyObject *); + /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); @@ -3039,8 +3190,11 @@ static void __pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_visit_all_octs(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_visitor, struct __pyx_opt_args_2yt_8geometry_13oct_container_21SparseOctreeContainer_visit_all_octs *__pyx_optional_args); /* proto*/ static __pyx_t_5numpy_int64_t __pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_get_domain_offset(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, CYTHON_UNUSED int __pyx_v_domain_id); /* proto*/ static struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_next_root(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, int __pyx_v_domain_id, int *__pyx_v_ind); /* proto*/ +static void __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_setup_objs(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, void *__pyx_v_obj, __pyx_t_5numpy_uint64_t __pyx_v_n, __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id); /* proto*/ +static void __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_teardown_objs(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, void *__pyx_v_obj, __pyx_t_5numpy_uint64_t __pyx_v_n, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* 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*/ @@ -3119,15 +3273,19 @@ static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0; /* Module declarations from 'libc.math' */ +/* Module declarations from 'yt.utilities.lib.allocation_container' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0; + /* Module declarations from 'yt.geometry.oct_container' */ +static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_ARTOctreeContainer = 0; -static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ = 0; static PyTypeObject *__pyx_array_type = 0; static PyTypeObject *__pyx_MemviewEnum_type = 0; static PyTypeObject *__pyx_memoryview_type = 0; @@ -3143,9 +3301,7 @@ static struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_f_2yt_8geometry_13oct_container_OctList_append(struct __pyx_t_2yt_8geometry_13oct_container_OctList *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *); /*proto*/ static int __pyx_f_2yt_8geometry_13oct_container_OctList_count(struct __pyx_t_2yt_8geometry_13oct_container_OctList *); /*proto*/ static void __pyx_f_2yt_8geometry_13oct_container_OctList_delete(struct __pyx_t_2yt_8geometry_13oct_container_OctList *); /*proto*/ -static struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_allocate_octs(int, struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *); /*proto*/ -static void __pyx_f_2yt_8geometry_13oct_container_free_octs(struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *); /*proto*/ -static int __pyx_f_2yt_8geometry_13oct_container_root_node_compare(void *, void *); /*proto*/ +static int __pyx_f_2yt_8geometry_13oct_container_root_node_compare(void const *, void const *); /*proto*/ static struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_f_2yt_8geometry_13oct_container_OctList_subneighbor_find(struct __pyx_t_2yt_8geometry_13oct_container_OctList *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, int, int, int); /*proto*/ static struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(PyObject *); /*proto*/ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ @@ -3180,8 +3336,11 @@ 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 PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; static __Pyx_StructField __Pyx_StructFields_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded[] = { {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "file_ind", offsetof(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded, file_ind)}, {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "domain_ind", offsetof(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded, domain_ind)}, @@ -3190,21 +3349,19 @@ {NULL, NULL, 0} }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded = { "OctPadded", __Pyx_StructFields_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded, sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded), { 0 }, 0, 'S', 0, 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; #define __Pyx_MODULE_NAME "yt.geometry.oct_container" int __pyx_module_is_main_yt__geometry__oct_container = 0; /* Implementation of 'yt.geometry.oct_container' */ -static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_ImportError; -static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; @@ -3217,23 +3374,23 @@ static const char __pyx_k_s[] = "(%s)"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_np[] = "np"; - static const char __pyx_k__37[] = "^"; - static const char __pyx_k__38[] = ""; - static const char __pyx_k__39[] = ":"; -static const char __pyx_k__40[] = "}"; -static const char __pyx_k__41[] = ","; + static const char __pyx_k__53[] = "^"; + static const char __pyx_k__54[] = ""; + static const char __pyx_k__55[] = ":"; +static const char __pyx_k__56[] = "}"; +static const char __pyx_k__57[] = ","; 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_pos[] = "pos"; -static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_bool[] = "bool"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_dest[] = "dest"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_dims[] = "dims"; static const char __pyx_k_file[] = "file"; static const char __pyx_k_init[] = "__init__"; -static const char __pyx_k_iter[] = "__iter__"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; @@ -3241,14 +3398,12 @@ static const char __pyx_k_ndim[] = "ndim"; static const char __pyx_k_ones[] = "ones"; static const char __pyx_k_pack[] = "pack"; -static const char __pyx_k_send[] = "send"; 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_close[] = "close"; static const char __pyx_k_dtype[] = "dtype"; static const char __pyx_k_empty[] = "empty"; static const char __pyx_k_error[] = "error"; @@ -3261,10 +3416,10 @@ 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_throw[] = "throw"; static const char __pyx_k_uint8[] = "uint8"; static const char __pyx_k_units[] = "units"; static const char __pyx_k_zeros[] = "zeros"; +static const char __pyx_k_append[] = "append"; static const char __pyx_k_astype[] = "astype"; static const char __pyx_k_curdom[] = "curdom"; static const char __pyx_k_domain[] = "domain"; @@ -3275,9 +3430,12 @@ static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_octree[] = "octree"; static const char __pyx_k_offset[] = "offset"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_result[] = "result"; static const char __pyx_k_source[] = "source"; 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_float64[] = "float64"; static const char __pyx_k_fortran[] = "fortran"; @@ -3290,6 +3448,7 @@ static const char __pyx_k_file_ind[] = "file_ind"; static const char __pyx_k_itemsize[] = "itemsize"; static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_selector[] = "selector"; static const char __pyx_k_ORDER_MAX[] = "ORDER_MAX"; static const char __pyx_k_TypeError[] = "TypeError"; @@ -3299,6 +3458,8 @@ static const char __pyx_k_file_inds[] = "file_inds"; static const char __pyx_k_left_edge[] = "left_edge"; static const char __pyx_k_num_cells[] = "num_cells"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_to_arrays[] = "to_arrays"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_count_octs[] = "count_octs"; @@ -3309,21 +3470,27 @@ static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_ORDER_MAX_2[] = "_ORDER_MAX"; +static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_code_length[] = "code_length"; static const char __pyx_k_dest_fields[] = "dest_fields"; static const char __pyx_k_load_octree[] = "load_octree"; static const char __pyx_k_over_refine[] = "over_refine"; 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_Oct_container[] = "\nOct container\n\n\n\n\n"; static const char __pyx_k_domain_counts[] = "domain_counts"; static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_skip_boundary[] = "skip_boundary"; static const char __pyx_k_source_fields[] = "source_fields"; static const char __pyx_k_Too_many_roots[] = "Too many roots."; static const char __pyx_k_count_boundary[] = "count_boundary"; +static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; static const char __pyx_k_count_oct_cells[] = "count_oct_cells"; static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_allocate_domains[] = "allocate_domains"; static const char __pyx_k_convert_to_units[] = "convert_to_units"; static const char __pyx_k_domain_left_edge[] = "domain_left_edge"; @@ -3331,6 +3498,8 @@ static const char __pyx_k_Too_many_assigned[] = "Too many assigned."; static const char __pyx_k_domain_dimensions[] = "domain_dimensions"; static const char __pyx_k_domain_right_edge[] = "domain_right_edge"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_DEST_INDEX_RAN_AHEAD[] = "DEST INDEX RAN AHEAD."; @@ -3340,12 +3509,10 @@ static const char __pyx_k_oct_domain_dimensions[] = "oct_domain_dimensions"; static const char __pyx_k_GLOBAL_INDEX_RAN_AHEAD[] = "GLOBAL INDEX RAN AHEAD."; static const char __pyx_k_MemoryView_of_r_object[] = ""; -static const char __pyx_k_OctreeContainer___iter[] = "OctreeContainer.__iter__"; 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_yt_geometry_oct_container[] = "yt.geometry.oct_container"; 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."; @@ -3356,6 +3523,7 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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_No_value_specified_for_struct_at[] = "No value specified for struct attribute 'file_ind'"; @@ -3364,7 +3532,10 @@ 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_root_mesh_cannot_be_convert[] = "self.root_mesh cannot be converted to a Python object for pickling"; +static const char __pyx_k_self_root_mesh_self_root_nodes_s[] = "self.root_mesh,self.root_nodes,self.tree_root 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_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static const char __pyx_k_No_value_specified_for_struct_at_2[] = "No value specified for struct attribute 'domain_ind'"; @@ -3382,6 +3553,7 @@ static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; static PyObject *__pyx_kp_s_GLOBAL_INDEX_RAN_AHEAD; 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; @@ -3399,8 +3571,8 @@ static PyObject *__pyx_n_b_O; static PyObject *__pyx_n_s_ORDER_MAX; static PyObject *__pyx_n_s_ORDER_MAX_2; -static PyObject *__pyx_n_s_OctreeContainer___iter; static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_kp_b_T; static PyObject *__pyx_kp_s_Too_many_assigned; @@ -3408,14 +3580,15 @@ static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_kp_b__37; -static PyObject *__pyx_kp_b__38; -static PyObject *__pyx_kp_b__39; -static PyObject *__pyx_kp_b__40; -static PyObject *__pyx_kp_u__41; +static PyObject *__pyx_n_s_View_MemoryView; +static PyObject *__pyx_kp_b__53; +static PyObject *__pyx_kp_b__54; +static PyObject *__pyx_kp_b__55; +static PyObject *__pyx_kp_b__56; +static PyObject *__pyx_kp_u__57; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_allocate_domains; -static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_asarray; static PyObject *__pyx_n_s_astype; static PyObject *__pyx_n_s_base; @@ -3424,7 +3597,7 @@ static PyObject *__pyx_n_u_c; static PyObject *__pyx_n_s_cell_inds; static PyObject *__pyx_n_s_class; -static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_code_length; static PyObject *__pyx_kp_s_contiguous_and_direct; static PyObject *__pyx_kp_s_contiguous_and_indirect; @@ -3437,6 +3610,7 @@ static PyObject *__pyx_n_s_curlevel; static PyObject *__pyx_n_s_dest; static PyObject *__pyx_n_s_dest_fields; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dims; static PyObject *__pyx_n_s_domain; static PyObject *__pyx_n_s_domain_counts; @@ -3468,7 +3642,6 @@ 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_iter; static PyObject *__pyx_n_s_join; static PyObject *__pyx_n_s_left_edge; static PyObject *__pyx_n_s_level; @@ -3482,6 +3655,8 @@ 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_num_cells; static PyObject *__pyx_n_s_numpy; @@ -3498,19 +3673,28 @@ static PyObject *__pyx_n_s_pack; static PyObject *__pyx_n_s_padding; static PyObject *__pyx_n_s_partial_coverage; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_print; static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_reduce_cython; static PyObject *__pyx_n_s_reshape; +static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_right_edge; static PyObject *__pyx_n_s_root_nodes; static PyObject *__pyx_kp_u_s; static PyObject *__pyx_n_s_selector; -static PyObject *__pyx_n_s_send; +static PyObject *__pyx_kp_s_self_root_mesh_cannot_be_convert; +static PyObject *__pyx_kp_s_self_root_mesh_self_root_nodes_s; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_skip_boundary; @@ -3522,39 +3706,42 @@ 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_throw; +static PyObject *__pyx_n_s_to_arrays; static PyObject *__pyx_n_s_uint8; static PyObject *__pyx_kp_s_unable_to_allocate_array_data; static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; static PyObject *__pyx_n_s_units; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; static PyObject *__pyx_n_s_unpack; -static PyObject *__pyx_n_s_yt_geometry_oct_container; +static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_zeros; static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer___init__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_oct_domain_dimensions, PyObject *__pyx_v_domain_left_edge, PyObject *__pyx_v_domain_right_edge, PyObject *__pyx_v_partial_coverage, PyObject *__pyx_v_over_refine); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_2_initialize_root_mesh(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10oct_arrays___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_4load_octree(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_header); /* proto */ static void __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_6__dealloc__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_8__iter__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_11locate_positions(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_positions); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_13domain_identify(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_15mask(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_17icoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_19ires(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_21fwidth(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_23fcoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_25save_octree(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_27selector_fill(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, PyArrayObject *__pyx_v_source, PyArrayObject *__pyx_v_dest, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_dims, int __pyx_v_domain_id); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_29domain_ind(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_selector, int __pyx_v_domain_id); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_31add(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_curdom, int __pyx_v_curlevel, PyArrayObject *__pyx_v_pos, int __pyx_v_skip_boundary, int __pyx_v_count_boundary); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_33allocate_domains(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_domain_counts); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_35file_index_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_domain_id, PyObject *__pyx_v_num_cells); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_37domain_count(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_39fill_level(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_level, PyArrayObject *__pyx_v_levels, PyArrayObject *__pyx_v_cell_inds, PyArrayObject *__pyx_v_file_inds, PyObject *__pyx_v_dest_fields, PyObject *__pyx_v_source_fields, __pyx_t_5numpy_int64_t __pyx_v_offset); /* proto */ -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_41finalize(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_8locate_positions(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_positions); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10domain_identify(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_12mask(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_14icoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_16ires(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_18fwidth(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_20fcoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_22save_octree(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_24selector_fill(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, PyArrayObject *__pyx_v_source, PyArrayObject *__pyx_v_dest, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_dims, int __pyx_v_domain_id); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_26domain_ind(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_selector, int __pyx_v_domain_id); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_28add(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_curdom, int __pyx_v_curlevel, PyArrayObject *__pyx_v_pos, int __pyx_v_skip_boundary, int __pyx_v_count_boundary); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_30allocate_domains(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_domain_counts); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_32file_index_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_domain_id, PyObject *__pyx_v_num_cells); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_34domain_count(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_36fill_level(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_level, PyArrayObject *__pyx_v_levels, PyArrayObject *__pyx_v_cell_inds, PyArrayObject *__pyx_v_file_inds, PyObject *__pyx_v_dest_fields, PyObject *__pyx_v_source_fields, __pyx_t_5numpy_int64_t __pyx_v_offset); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_38finalize(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ +static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_4__del__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_5nocts___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ @@ -3562,12 +3749,24 @@ static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_4__del__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_40__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_42__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer___init__(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, PyObject *__pyx_v_domain_dimensions, PyObject *__pyx_v_domain_left_edge, PyObject *__pyx_v_domain_right_edge, PyObject *__pyx_v_over_refine); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_2load_octree(CYTHON_UNUSED PyTypeObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_header); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_4save_octree(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_6allocate_domains(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, PyObject *__pyx_v_domain_counts, int __pyx_v_root_nodes); /* proto */ static void __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_8__dealloc__(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21RAMSESOctreeContainer___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21RAMSESOctreeContainer_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer___init__(struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *__pyx_v_self, PyObject *__pyx_v_oct_domain_dimensions, PyObject *__pyx_v_domain_left_edge, PyObject *__pyx_v_domain_right_edge, PyObject *__pyx_v_partial_coverage, PyObject *__pyx_v_over_refine); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool___cinit__(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_2_con_to_array(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, CYTHON_UNUSED 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 */ @@ -3577,8 +3776,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -3600,13 +3803,18 @@ 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_2yt_8geometry_13oct_container_OctObjectPool(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_OctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_SparseOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_RAMSESOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_ARTOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container___pyx_scope_struct____iter__(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*/ @@ -3614,6 +3822,7 @@ 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_slice__3; @@ -3624,9 +3833,9 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__33; -static PyObject *__pyx_slice__34; -static PyObject *__pyx_slice__35; +static PyObject *__pyx_slice__47; +static PyObject *__pyx_slice__48; +static PyObject *__pyx_slice__49; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -3650,379 +3859,32 @@ static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_codeobj__64; -/* "yt/geometry/oct_container.pyx":32 - * void *alloca(int) - * - * cdef OctAllocationContainer *allocate_octs( # <<<<<<<<<<<<<< - * int n_octs, OctAllocationContainer *prev): - * cdef OctAllocationContainer *n_cont - */ - -static struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_allocate_octs(int __pyx_v_n_octs, struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_prev) { - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_n_cont; - struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_oct; - int __pyx_v_n; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - __Pyx_RefNannySetupContext("allocate_octs", 0); - - /* "yt/geometry/oct_container.pyx":37 - * cdef Oct *oct - * cdef int n, i, j, k - * n_cont = malloc( # <<<<<<<<<<<<<< - * sizeof(OctAllocationContainer)) - * if prev == NULL: - */ - __pyx_v_n_cont = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)malloc((sizeof(struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer)))); - - /* "yt/geometry/oct_container.pyx":39 - * n_cont = malloc( - * sizeof(OctAllocationContainer)) - * if prev == NULL: # <<<<<<<<<<<<<< - * n_cont.offset = 0 - * else: - */ - __pyx_t_1 = ((__pyx_v_prev == NULL) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/oct_container.pyx":40 - * sizeof(OctAllocationContainer)) - * if prev == NULL: - * n_cont.offset = 0 # <<<<<<<<<<<<<< - * else: - * n_cont.offset = prev.offset + prev.n - */ - __pyx_v_n_cont->offset = 0; - - /* "yt/geometry/oct_container.pyx":39 - * n_cont = malloc( - * sizeof(OctAllocationContainer)) - * if prev == NULL: # <<<<<<<<<<<<<< - * n_cont.offset = 0 - * else: - */ - goto __pyx_L3; - } - - /* "yt/geometry/oct_container.pyx":42 - * n_cont.offset = 0 - * else: - * n_cont.offset = prev.offset + prev.n # <<<<<<<<<<<<<< - * n_cont.my_octs = malloc(sizeof(Oct) * n_octs) - * if n_cont.my_octs == NULL: - */ - /*else*/ { - __pyx_v_n_cont->offset = (__pyx_v_prev->offset + __pyx_v_prev->n); - } - __pyx_L3:; - - /* "yt/geometry/oct_container.pyx":43 - * else: - * n_cont.offset = prev.offset + prev.n - * n_cont.my_octs = malloc(sizeof(Oct) * n_octs) # <<<<<<<<<<<<<< - * if n_cont.my_octs == NULL: - * raise MemoryError - */ - __pyx_v_n_cont->my_octs = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)malloc(((sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct)) * __pyx_v_n_octs))); - - /* "yt/geometry/oct_container.pyx":44 - * n_cont.offset = prev.offset + prev.n - * n_cont.my_octs = malloc(sizeof(Oct) * n_octs) - * if n_cont.my_octs == NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * n_cont.n = n_octs - */ - __pyx_t_1 = ((__pyx_v_n_cont->my_octs == NULL) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/oct_container.pyx":45 - * n_cont.my_octs = malloc(sizeof(Oct) * n_octs) - * if n_cont.my_octs == NULL: - * raise MemoryError # <<<<<<<<<<<<<< - * n_cont.n = n_octs - * n_cont.n_assigned = 0 - */ - PyErr_NoMemory(); __PYX_ERR(0, 45, __pyx_L1_error) - - /* "yt/geometry/oct_container.pyx":44 - * n_cont.offset = prev.offset + prev.n - * n_cont.my_octs = malloc(sizeof(Oct) * n_octs) - * if n_cont.my_octs == NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * n_cont.n = n_octs - */ - } - - /* "yt/geometry/oct_container.pyx":46 - * if n_cont.my_octs == NULL: - * raise MemoryError - * n_cont.n = n_octs # <<<<<<<<<<<<<< - * n_cont.n_assigned = 0 - * n_cont.con_id = -1 - */ - __pyx_v_n_cont->n = __pyx_v_n_octs; - - /* "yt/geometry/oct_container.pyx":47 - * raise MemoryError - * n_cont.n = n_octs - * n_cont.n_assigned = 0 # <<<<<<<<<<<<<< - * n_cont.con_id = -1 - * for n in range(n_octs): - */ - __pyx_v_n_cont->n_assigned = 0; - - /* "yt/geometry/oct_container.pyx":48 - * n_cont.n = n_octs - * n_cont.n_assigned = 0 - * n_cont.con_id = -1 # <<<<<<<<<<<<<< - * for n in range(n_octs): - * oct = &n_cont.my_octs[n] - */ - __pyx_v_n_cont->con_id = -1LL; - - /* "yt/geometry/oct_container.pyx":49 - * n_cont.n_assigned = 0 - * n_cont.con_id = -1 - * for n in range(n_octs): # <<<<<<<<<<<<<< - * oct = &n_cont.my_octs[n] - * oct.file_ind = oct.domain = -1 - */ - __pyx_t_2 = __pyx_v_n_octs; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_n = __pyx_t_3; - - /* "yt/geometry/oct_container.pyx":50 - * n_cont.con_id = -1 - * for n in range(n_octs): - * oct = &n_cont.my_octs[n] # <<<<<<<<<<<<<< - * oct.file_ind = oct.domain = -1 - * oct.domain_ind = n + n_cont.offset - */ - __pyx_v_oct = (&(__pyx_v_n_cont->my_octs[__pyx_v_n])); - - /* "yt/geometry/oct_container.pyx":51 - * for n in range(n_octs): - * oct = &n_cont.my_octs[n] - * oct.file_ind = oct.domain = -1 # <<<<<<<<<<<<<< - * oct.domain_ind = n + n_cont.offset - * oct.children = NULL - */ - __pyx_v_oct->file_ind = -1LL; - __pyx_v_oct->domain = -1LL; - - /* "yt/geometry/oct_container.pyx":52 - * oct = &n_cont.my_octs[n] - * oct.file_ind = oct.domain = -1 - * oct.domain_ind = n + n_cont.offset # <<<<<<<<<<<<<< - * oct.children = NULL - * if prev != NULL: - */ - __pyx_v_oct->domain_ind = (__pyx_v_n + __pyx_v_n_cont->offset); - - /* "yt/geometry/oct_container.pyx":53 - * oct.file_ind = oct.domain = -1 - * oct.domain_ind = n + n_cont.offset - * oct.children = NULL # <<<<<<<<<<<<<< - * if prev != NULL: - * prev.next = n_cont - */ - __pyx_v_oct->children = NULL; - } - - /* "yt/geometry/oct_container.pyx":54 - * oct.domain_ind = n + n_cont.offset - * oct.children = NULL - * if prev != NULL: # <<<<<<<<<<<<<< - * prev.next = n_cont - * n_cont.next = NULL - */ - __pyx_t_1 = ((__pyx_v_prev != NULL) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/oct_container.pyx":55 - * oct.children = NULL - * if prev != NULL: - * prev.next = n_cont # <<<<<<<<<<<<<< - * n_cont.next = NULL - * return n_cont - */ - __pyx_v_prev->next = __pyx_v_n_cont; - - /* "yt/geometry/oct_container.pyx":54 - * oct.domain_ind = n + n_cont.offset - * oct.children = NULL - * if prev != NULL: # <<<<<<<<<<<<<< - * prev.next = n_cont - * n_cont.next = NULL - */ - } - - /* "yt/geometry/oct_container.pyx":56 - * if prev != NULL: - * prev.next = n_cont - * n_cont.next = NULL # <<<<<<<<<<<<<< - * return n_cont - * - */ - __pyx_v_n_cont->next = NULL; - - /* "yt/geometry/oct_container.pyx":57 - * prev.next = n_cont - * n_cont.next = NULL - * return n_cont # <<<<<<<<<<<<<< - * - * cdef void free_octs( - */ - __pyx_r = __pyx_v_n_cont; - goto __pyx_L0; - - /* "yt/geometry/oct_container.pyx":32 - * void *alloca(int) - * - * cdef OctAllocationContainer *allocate_octs( # <<<<<<<<<<<<<< - * int n_octs, OctAllocationContainer *prev): - * cdef OctAllocationContainer *n_cont - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.oct_container.allocate_octs", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/geometry/oct_container.pyx":59 - * return n_cont - * - * cdef void free_octs( # <<<<<<<<<<<<<< - * OctAllocationContainer *first): - * cdef OctAllocationContainer *cur - */ - -static void __pyx_f_2yt_8geometry_13oct_container_free_octs(struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_first) { - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_cur; - __pyx_t_5numpy_int64_t __pyx_v_i; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __pyx_t_5numpy_int64_t __pyx_t_2; - __pyx_t_5numpy_int64_t __pyx_t_3; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_t_4; - __Pyx_RefNannySetupContext("free_octs", 0); - - /* "yt/geometry/oct_container.pyx":62 - * OctAllocationContainer *first): - * cdef OctAllocationContainer *cur - * while first != NULL: # <<<<<<<<<<<<<< - * cur = first - * for i in range(cur.n): - */ - while (1) { - __pyx_t_1 = ((__pyx_v_first != NULL) != 0); - if (!__pyx_t_1) break; - - /* "yt/geometry/oct_container.pyx":63 - * cdef OctAllocationContainer *cur - * while first != NULL: - * cur = first # <<<<<<<<<<<<<< - * for i in range(cur.n): - * if cur.my_octs[i].children != NULL: - */ - __pyx_v_cur = __pyx_v_first; - - /* "yt/geometry/oct_container.pyx":64 - * while first != NULL: - * cur = first - * for i in range(cur.n): # <<<<<<<<<<<<<< - * if cur.my_octs[i].children != NULL: - * free(cur.my_octs[i].children) - */ - __pyx_t_2 = __pyx_v_cur->n; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - - /* "yt/geometry/oct_container.pyx":65 - * cur = first - * for i in range(cur.n): - * if cur.my_octs[i].children != NULL: # <<<<<<<<<<<<<< - * free(cur.my_octs[i].children) - * free(first.my_octs) - */ - __pyx_t_1 = (((__pyx_v_cur->my_octs[__pyx_v_i]).children != NULL) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/oct_container.pyx":66 - * for i in range(cur.n): - * if cur.my_octs[i].children != NULL: - * free(cur.my_octs[i].children) # <<<<<<<<<<<<<< - * free(first.my_octs) - * first = cur.next - */ - free((__pyx_v_cur->my_octs[__pyx_v_i]).children); - - /* "yt/geometry/oct_container.pyx":65 - * cur = first - * for i in range(cur.n): - * if cur.my_octs[i].children != NULL: # <<<<<<<<<<<<<< - * free(cur.my_octs[i].children) - * free(first.my_octs) - */ - } - } - - /* "yt/geometry/oct_container.pyx":67 - * if cur.my_octs[i].children != NULL: - * free(cur.my_octs[i].children) - * free(first.my_octs) # <<<<<<<<<<<<<< - * first = cur.next - * free(cur) - */ - free(__pyx_v_first->my_octs); - - /* "yt/geometry/oct_container.pyx":68 - * free(cur.my_octs[i].children) - * free(first.my_octs) - * first = cur.next # <<<<<<<<<<<<<< - * free(cur) - * - */ - __pyx_t_4 = __pyx_v_cur->next; - __pyx_v_first = __pyx_t_4; - - /* "yt/geometry/oct_container.pyx":69 - * free(first.my_octs) - * first = cur.next - * free(cur) # <<<<<<<<<<<<<< - * - * # Here is the strategy for RAMSES containers: - */ - free(__pyx_v_cur); - } - - /* "yt/geometry/oct_container.pyx":59 - * return n_cont - * - * cdef void free_octs( # <<<<<<<<<<<<<< - * OctAllocationContainer *first): - * cdef OctAllocationContainer *cur - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "yt/geometry/oct_container.pyx":83 +/* "yt/geometry/oct_container.pyx":45 * cdef class OctreeContainer: * * def __init__(self, oct_domain_dimensions, domain_left_edge, # <<<<<<<<<<<<<< @@ -4051,10 +3913,15 @@ 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; } @@ -4063,21 +3930,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oct_domain_dimensions)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_left_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 83, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 45, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_right_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 83, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 45, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_partial_coverage); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_over_refine); @@ -4085,12 +3956,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 83, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 45, __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); @@ -4106,7 +3979,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 83, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 45, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4133,37 +4006,28 @@ PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/oct_container.pyx":87 + /* "yt/geometry/oct_container.pyx":49 * over_refine = 1): * # This will just initialize the root mesh octs * self.oref = over_refine # <<<<<<<<<<<<<< * self.partial_coverage = partial_coverage - * self.cont = NULL + * cdef int i, j, k, p */ - __pyx_t_1 = __Pyx_PyInt_As_npy_uint8(__pyx_v_over_refine); if (unlikely((__pyx_t_1 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_npy_uint8(__pyx_v_over_refine); if (unlikely((__pyx_t_1 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L1_error) __pyx_v_self->oref = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":88 + /* "yt/geometry/oct_container.pyx":50 * # This will just initialize the root mesh octs * self.oref = over_refine * self.partial_coverage = partial_coverage # <<<<<<<<<<<<<< - * self.cont = NULL * cdef int i, j, k, p + * for i in range(3): */ - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_partial_coverage); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_partial_coverage); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 50, __pyx_L1_error) __pyx_v_self->partial_coverage = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":89 - * self.oref = over_refine + /* "yt/geometry/oct_container.pyx":52 * self.partial_coverage = partial_coverage - * self.cont = NULL # <<<<<<<<<<<<<< - * cdef int i, j, k, p - * for i in range(3): - */ - __pyx_v_self->cont = NULL; - - /* "yt/geometry/oct_container.pyx":91 - * self.cont = NULL * cdef int i, j, k, p * for i in range(3): # <<<<<<<<<<<<<< * self.nn[i] = oct_domain_dimensions[i] @@ -4172,58 +4036,64 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":92 + /* "yt/geometry/oct_container.pyx":53 * cdef int i, j, k, p * for i in range(3): * self.nn[i] = oct_domain_dimensions[i] # <<<<<<<<<<<<<< * self.num_domains = 0 * self.level_offset = 0 */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_oct_domain_dimensions, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_oct_domain_dimensions, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->nn[__pyx_v_i]) = __pyx_t_4; } - /* "yt/geometry/oct_container.pyx":93 + /* "yt/geometry/oct_container.pyx":54 * for i in range(3): * self.nn[i] = oct_domain_dimensions[i] * self.num_domains = 0 # <<<<<<<<<<<<<< * self.level_offset = 0 - * self.domains = NULL + * self.domains = OctObjectPool() */ __pyx_v_self->num_domains = 0; - /* "yt/geometry/oct_container.pyx":94 + /* "yt/geometry/oct_container.pyx":55 * self.nn[i] = oct_domain_dimensions[i] * self.num_domains = 0 * self.level_offset = 0 # <<<<<<<<<<<<<< - * self.domains = NULL + * self.domains = OctObjectPool() * p = 0 */ __pyx_v_self->level_offset = 0; - /* "yt/geometry/oct_container.pyx":95 + /* "yt/geometry/oct_container.pyx":56 * self.num_domains = 0 * self.level_offset = 0 - * self.domains = NULL # <<<<<<<<<<<<<< + * self.domains = OctObjectPool() # <<<<<<<<<<<<<< * p = 0 * self.nocts = 0 # Increment when initialized */ - __pyx_v_self->domains = NULL; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->domains); + __Pyx_DECREF(((PyObject *)__pyx_v_self->domains)); + __pyx_v_self->domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_t_3); + __pyx_t_3 = 0; - /* "yt/geometry/oct_container.pyx":96 + /* "yt/geometry/oct_container.pyx":57 * self.level_offset = 0 - * self.domains = NULL + * self.domains = OctObjectPool() * p = 0 # <<<<<<<<<<<<<< * self.nocts = 0 # Increment when initialized * for i in range(3): */ __pyx_v_p = 0; - /* "yt/geometry/oct_container.pyx":97 - * self.domains = NULL + /* "yt/geometry/oct_container.pyx":58 + * self.domains = OctObjectPool() * p = 0 * self.nocts = 0 # Increment when initialized # <<<<<<<<<<<<<< * for i in range(3): @@ -4231,7 +4101,7 @@ */ __pyx_v_self->nocts = 0; - /* "yt/geometry/oct_container.pyx":98 + /* "yt/geometry/oct_container.pyx":59 * p = 0 * self.nocts = 0 # Increment when initialized * for i in range(3): # <<<<<<<<<<<<<< @@ -4241,41 +4111,41 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":99 + /* "yt/geometry/oct_container.pyx":60 * self.nocts = 0 # Increment when initialized * for i in range(3): * self.DLE[i] = domain_left_edge[i] #0 # <<<<<<<<<<<<<< * self.DRE[i] = domain_right_edge[i] #num_grid * self._initialize_root_mesh() */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->DLE[__pyx_v_i]) = __pyx_t_5; - /* "yt/geometry/oct_container.pyx":100 + /* "yt/geometry/oct_container.pyx":61 * for i in range(3): * self.DLE[i] = domain_left_edge[i] #0 * self.DRE[i] = domain_right_edge[i] #num_grid # <<<<<<<<<<<<<< * self._initialize_root_mesh() * self.fill_style = "o" */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->DRE[__pyx_v_i]) = __pyx_t_5; } - /* "yt/geometry/oct_container.pyx":101 + /* "yt/geometry/oct_container.pyx":62 * self.DLE[i] = domain_left_edge[i] #0 * self.DRE[i] = domain_right_edge[i] #num_grid * self._initialize_root_mesh() # <<<<<<<<<<<<<< * self.fill_style = "o" * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_initialize_root_mesh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_initialize_root_mesh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -4288,16 +4158,16 @@ } } if (__pyx_t_7) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/oct_container.pyx":102 + /* "yt/geometry/oct_container.pyx":63 * self.DRE[i] = domain_right_edge[i] #num_grid * self._initialize_root_mesh() * self.fill_style = "o" # <<<<<<<<<<<<<< @@ -4310,7 +4180,7 @@ __Pyx_DECREF(__pyx_v_self->fill_style); __pyx_v_self->fill_style = __pyx_n_s_o; - /* "yt/geometry/oct_container.pyx":83 + /* "yt/geometry/oct_container.pyx":45 * cdef class OctreeContainer: * * def __init__(self, oct_domain_dimensions, domain_left_edge, # <<<<<<<<<<<<<< @@ -4332,7 +4202,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":104 +/* "yt/geometry/oct_container.pyx":65 * self.fill_style = "o" * * def _initialize_root_mesh(self): # <<<<<<<<<<<<<< @@ -4367,7 +4237,7 @@ int __pyx_t_6; __Pyx_RefNannySetupContext("_initialize_root_mesh", 0); - /* "yt/geometry/oct_container.pyx":105 + /* "yt/geometry/oct_container.pyx":66 * * def _initialize_root_mesh(self): * self.root_mesh = malloc(sizeof(void*) * self.nn[0]) # <<<<<<<<<<<<<< @@ -4376,7 +4246,7 @@ */ __pyx_v_self->root_mesh = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****)malloc(((sizeof(void *)) * (__pyx_v_self->nn[0])))); - /* "yt/geometry/oct_container.pyx":106 + /* "yt/geometry/oct_container.pyx":67 * def _initialize_root_mesh(self): * self.root_mesh = malloc(sizeof(void*) * self.nn[0]) * for i in range(self.nn[0]): # <<<<<<<<<<<<<< @@ -4387,7 +4257,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":107 + /* "yt/geometry/oct_container.pyx":68 * self.root_mesh = malloc(sizeof(void*) * self.nn[0]) * for i in range(self.nn[0]): * self.root_mesh[i] = malloc(sizeof(void*) * self.nn[1]) # <<<<<<<<<<<<<< @@ -4396,7 +4266,7 @@ */ (__pyx_v_self->root_mesh[__pyx_v_i]) = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ***)malloc(((sizeof(void *)) * (__pyx_v_self->nn[1])))); - /* "yt/geometry/oct_container.pyx":108 + /* "yt/geometry/oct_container.pyx":69 * for i in range(self.nn[0]): * self.root_mesh[i] = malloc(sizeof(void*) * self.nn[1]) * for j in range(self.nn[1]): # <<<<<<<<<<<<<< @@ -4407,7 +4277,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/geometry/oct_container.pyx":109 + /* "yt/geometry/oct_container.pyx":70 * self.root_mesh[i] = malloc(sizeof(void*) * self.nn[1]) * for j in range(self.nn[1]): * self.root_mesh[i][j] = malloc(sizeof(void*) * self.nn[2]) # <<<<<<<<<<<<<< @@ -4416,7 +4286,7 @@ */ ((__pyx_v_self->root_mesh[__pyx_v_i])[__pyx_v_j]) = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **)malloc(((sizeof(void *)) * (__pyx_v_self->nn[2])))); - /* "yt/geometry/oct_container.pyx":110 + /* "yt/geometry/oct_container.pyx":71 * for j in range(self.nn[1]): * self.root_mesh[i][j] = malloc(sizeof(void*) * self.nn[2]) * for k in range(self.nn[2]): # <<<<<<<<<<<<<< @@ -4427,7 +4297,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "yt/geometry/oct_container.pyx":111 + /* "yt/geometry/oct_container.pyx":72 * self.root_mesh[i][j] = malloc(sizeof(void*) * self.nn[2]) * for k in range(self.nn[2]): * self.root_mesh[i][j][k] = NULL # <<<<<<<<<<<<<< @@ -4439,7 +4309,7 @@ } } - /* "yt/geometry/oct_container.pyx":104 + /* "yt/geometry/oct_container.pyx":65 * self.fill_style = "o" * * def _initialize_root_mesh(self): # <<<<<<<<<<<<<< @@ -4454,12 +4324,12 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":114 +/* "yt/geometry/oct_container.pyx":75 * * @property * def oct_arrays(self): # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cur = self.cont - * cdef Oct *this + * return self.domains.to_arrays() + * */ /* Python wrapper */ @@ -4476,201 +4346,67 @@ } static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10oct_arrays___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) { - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_cur; - __Pyx_memviewslice __pyx_v_mm = { 0, 0, { 0 }, { 0 }, { 0 } }; - PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_t_1; + PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded *__pyx_t_4; - struct __pyx_array_obj *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; + PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "yt/geometry/oct_container.pyx":115 + /* "yt/geometry/oct_container.pyx":76 * @property * def oct_arrays(self): - * cdef OctAllocationContainer *cur = self.cont # <<<<<<<<<<<<<< - * cdef Oct *this - * cdef int i - */ - __pyx_t_1 = __pyx_v_self->cont; - __pyx_v_cur = __pyx_t_1; - - /* "yt/geometry/oct_container.pyx":119 - * cdef int i - * cdef OctPadded[:] mm - * rv = [] # <<<<<<<<<<<<<< - * while cur != NULL: - * mm = ( cur.my_octs) + * return self.domains.to_arrays() # <<<<<<<<<<<<<< + * + * @classmethod */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->domains), __pyx_n_s_to_arrays); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_v_rv = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __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; - /* "yt/geometry/oct_container.pyx":120 - * cdef OctPadded[:] mm - * rv = [] - * while cur != NULL: # <<<<<<<<<<<<<< - * mm = ( cur.my_octs) - * rv.append(np.asarray(mm)) - */ - while (1) { - __pyx_t_3 = ((__pyx_v_cur != NULL) != 0); - if (!__pyx_t_3) break; - - /* "yt/geometry/oct_container.pyx":121 - * rv = [] - * while cur != NULL: - * mm = ( cur.my_octs) # <<<<<<<<<<<<<< - * rv.append(np.asarray(mm)) - * cur = cur.next - */ - __pyx_t_4 = ((struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded *)__pyx_v_cur->my_octs); - if (!__pyx_t_4) { - PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 121, __pyx_L1_error) - } - __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded); - __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cur->n_assigned)); - if (unlikely(!__pyx_t_6 || !__pyx_t_2 || !PyBytes_AsString(__pyx_t_6))) __PYX_ERR(0, 121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_array_new(__pyx_t_2, sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_t_4); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __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_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(((PyObject *)__pyx_t_5)); - if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 121, __pyx_L1_error) - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __PYX_XDEC_MEMVIEW(&__pyx_v_mm, 1); - __pyx_v_mm = __pyx_t_7; - __pyx_t_7.memview = NULL; - __pyx_t_7.data = NULL; - - /* "yt/geometry/oct_container.pyx":122 - * while cur != NULL: - * mm = ( cur.my_octs) - * rv.append(np.asarray(mm)) # <<<<<<<<<<<<<< - * cur = cur.next - * return rv - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_mm, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - } - } - if (!__pyx_t_9) { - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __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_8)) { - PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_2}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_8)) { - PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_2}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_6); - __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, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_6); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "yt/geometry/oct_container.pyx":123 - * mm = ( cur.my_octs) - * rv.append(np.asarray(mm)) - * cur = cur.next # <<<<<<<<<<<<<< - * return rv - * - */ - __pyx_t_1 = __pyx_v_cur->next; - __pyx_v_cur = __pyx_t_1; - } - - /* "yt/geometry/oct_container.pyx":124 - * rv.append(np.asarray(mm)) - * cur = cur.next - * return rv # <<<<<<<<<<<<<< - * - * @classmethod - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_rv); - __pyx_r = __pyx_v_rv; - goto __pyx_L0; - - /* "yt/geometry/oct_container.pyx":114 - * - * @property - * def oct_arrays(self): # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cur = self.cont - * cdef Oct *this + /* "yt/geometry/oct_container.pyx":75 + * + * @property + * def oct_arrays(self): # <<<<<<<<<<<<<< + * return self.domains.to_arrays() + * */ /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(((PyObject *)__pyx_t_5)); - __Pyx_XDECREF(__pyx_t_6); - __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.oct_arrays.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __PYX_XDEC_MEMVIEW(&__pyx_v_mm, 1); - __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/oct_container.pyx":127 +/* "yt/geometry/oct_container.pyx":79 * * @classmethod * def load_octree(cls, header): # <<<<<<<<<<<<<< @@ -4703,7 +4439,7 @@ __pyx_t_5numpy_float64_t __pyx_v_dds[3]; struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_cur; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o; - __pyx_t_5numpy_int64_t __pyx_v_nfinest; + __pyx_t_5numpy_uint64_t __pyx_v_nfinest; __Pyx_LocalBuf_ND __pyx_pybuffernd_ref_mask; __Pyx_Buffer __pyx_pybuffer_ref_mask; PyObject *__pyx_r = NULL; @@ -4729,23 +4465,23 @@ int __pyx_t_19; struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs __pyx_t_20; long __pyx_t_21; - __pyx_t_5numpy_int64_t __pyx_t_22; + __pyx_t_5numpy_uint64_t __pyx_t_22; __Pyx_RefNannySetupContext("load_octree", 0); __pyx_pybuffer_ref_mask.pybuffer.buf = NULL; __pyx_pybuffer_ref_mask.refcount = 0; __pyx_pybuffernd_ref_mask.data = NULL; __pyx_pybuffernd_ref_mask.rcbuffer = &__pyx_pybuffer_ref_mask; - /* "yt/geometry/oct_container.pyx":129 + /* "yt/geometry/oct_container.pyx":81 * def load_octree(cls, header): * cdef np.ndarray[np.uint8_t, ndim=1] ref_mask * ref_mask = header['octree'] # <<<<<<<<<<<<<< * cdef OctreeContainer obj = cls(header['dims'], header['left_edge'], * header['right_edge'], over_refine = header['over_refine'], */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_header, __pyx_n_s_octree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_header, __pyx_n_s_octree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 129, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 81, __pyx_L1_error) __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4761,42 +4497,42 @@ } } __pyx_pybuffernd_ref_mask.diminfo[0].strides = __pyx_pybuffernd_ref_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ref_mask.diminfo[0].shape = __pyx_pybuffernd_ref_mask.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 129, __pyx_L1_error) + if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 81, __pyx_L1_error) } __pyx_t_2 = 0; __pyx_v_ref_mask = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":130 + /* "yt/geometry/oct_container.pyx":82 * cdef np.ndarray[np.uint8_t, ndim=1] ref_mask * ref_mask = header['octree'] * cdef OctreeContainer obj = cls(header['dims'], header['left_edge'], # <<<<<<<<<<<<<< * header['right_edge'], over_refine = header['over_refine'], * partial_coverage = header['partial_coverage']) */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_header, __pyx_n_s_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_header, __pyx_n_s_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_GetItem(__pyx_v_header, __pyx_n_s_left_edge); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_7 = PyObject_GetItem(__pyx_v_header, __pyx_n_s_left_edge); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "yt/geometry/oct_container.pyx":131 + /* "yt/geometry/oct_container.pyx":83 * ref_mask = header['octree'] * cdef OctreeContainer obj = cls(header['dims'], header['left_edge'], * header['right_edge'], over_refine = header['over_refine'], # <<<<<<<<<<<<<< * partial_coverage = header['partial_coverage']) * # NOTE: We do not allow domain/file indices to be specified. */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_header, __pyx_n_s_right_edge); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_header, __pyx_n_s_right_edge); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - /* "yt/geometry/oct_container.pyx":130 + /* "yt/geometry/oct_container.pyx":82 * cdef np.ndarray[np.uint8_t, ndim=1] ref_mask * ref_mask = header['octree'] * cdef OctreeContainer obj = cls(header['dims'], header['left_edge'], # <<<<<<<<<<<<<< * header['right_edge'], over_refine = header['over_refine'], * partial_coverage = header['partial_coverage']) */ - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); @@ -4808,67 +4544,67 @@ __pyx_t_7 = 0; __pyx_t_8 = 0; - /* "yt/geometry/oct_container.pyx":131 + /* "yt/geometry/oct_container.pyx":83 * ref_mask = header['octree'] * cdef OctreeContainer obj = cls(header['dims'], header['left_edge'], * header['right_edge'], over_refine = header['over_refine'], # <<<<<<<<<<<<<< * partial_coverage = header['partial_coverage']) * # NOTE: We do not allow domain/file indices to be specified. */ - __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyObject_GetItem(__pyx_v_header, __pyx_n_s_over_refine); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_7 = PyObject_GetItem(__pyx_v_header, __pyx_n_s_over_refine); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_over_refine, __pyx_t_7) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_over_refine, __pyx_t_7) < 0) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/oct_container.pyx":132 + /* "yt/geometry/oct_container.pyx":84 * cdef OctreeContainer obj = cls(header['dims'], header['left_edge'], * header['right_edge'], over_refine = header['over_refine'], * partial_coverage = header['partial_coverage']) # <<<<<<<<<<<<<< * # NOTE: We do not allow domain/file indices to be specified. * cdef SelectorObject selector = selection_routines.AlwaysSelector(None) */ - __pyx_t_7 = PyObject_GetItem(__pyx_v_header, __pyx_n_s_partial_coverage); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_7 = PyObject_GetItem(__pyx_v_header, __pyx_n_s_partial_coverage); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_partial_coverage, __pyx_t_7) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_partial_coverage, __pyx_t_7) < 0) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/oct_container.pyx":130 + /* "yt/geometry/oct_container.pyx":82 * cdef np.ndarray[np.uint8_t, ndim=1] ref_mask * ref_mask = header['octree'] * cdef OctreeContainer obj = cls(header['dims'], header['left_edge'], # <<<<<<<<<<<<<< * header['right_edge'], over_refine = header['over_refine'], * partial_coverage = header['partial_coverage']) */ - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer))))) __PYX_ERR(0, 130, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer))))) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_v_obj = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/oct_container.pyx":134 + /* "yt/geometry/oct_container.pyx":86 * partial_coverage = header['partial_coverage']) * # NOTE: We do not allow domain/file indices to be specified. * cdef SelectorObject selector = selection_routines.AlwaysSelector(None) # <<<<<<<<<<<<<< * cdef oct_visitors.LoadOctree visitor * visitor = oct_visitors.LoadOctree(obj, -1) */ - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/oct_container.pyx":136 + /* "yt/geometry/oct_container.pyx":88 * cdef SelectorObject selector = selection_routines.AlwaysSelector(None) * cdef oct_visitors.LoadOctree visitor * visitor = oct_visitors.LoadOctree(obj, -1) # <<<<<<<<<<<<<< * cdef int i, j, k, n * visitor.global_index = -1 */ - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_v_obj)); __Pyx_GIVEREF(((PyObject *)__pyx_v_obj)); @@ -4876,13 +4612,13 @@ __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_neg_1); - __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree), __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree), __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *)__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/oct_container.pyx":138 + /* "yt/geometry/oct_container.pyx":90 * visitor = oct_visitors.LoadOctree(obj, -1) * cdef int i, j, k, n * visitor.global_index = -1 # <<<<<<<<<<<<<< @@ -4891,7 +4627,7 @@ */ __pyx_v_visitor->__pyx_base.global_index = -1LL; - /* "yt/geometry/oct_container.pyx":139 + /* "yt/geometry/oct_container.pyx":91 * cdef int i, j, k, n * visitor.global_index = -1 * visitor.level = 0 # <<<<<<<<<<<<<< @@ -4900,7 +4636,7 @@ */ __pyx_v_visitor->__pyx_base.level = 0; - /* "yt/geometry/oct_container.pyx":140 + /* "yt/geometry/oct_container.pyx":92 * visitor.global_index = -1 * visitor.level = 0 * visitor.oref = 0 # <<<<<<<<<<<<<< @@ -4909,7 +4645,7 @@ */ __pyx_v_visitor->__pyx_base.oref = 0; - /* "yt/geometry/oct_container.pyx":141 + /* "yt/geometry/oct_container.pyx":93 * visitor.level = 0 * visitor.oref = 0 * visitor.nz = 1 # <<<<<<<<<<<<<< @@ -4918,7 +4654,7 @@ */ __pyx_v_visitor->__pyx_base.nz = 1; - /* "yt/geometry/oct_container.pyx":142 + /* "yt/geometry/oct_container.pyx":94 * visitor.oref = 0 * visitor.nz = 1 * assert(ref_mask.shape[0] / float(visitor.nz) == # <<<<<<<<<<<<<< @@ -4929,10 +4665,10 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(((double)__pyx_v_visitor->__pyx_base.nz) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 142, __pyx_L1_error) + __PYX_ERR(0, 94, __pyx_L1_error) } - /* "yt/geometry/oct_container.pyx":143 + /* "yt/geometry/oct_container.pyx":95 * visitor.nz = 1 * assert(ref_mask.shape[0] / float(visitor.nz) == * (ref_mask.shape[0]/float(visitor.nz))) # <<<<<<<<<<<<<< @@ -4941,10 +4677,10 @@ */ if (unlikely(((double)__pyx_v_visitor->__pyx_base.nz) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 143, __pyx_L1_error) + __PYX_ERR(0, 95, __pyx_L1_error) } - /* "yt/geometry/oct_container.pyx":142 + /* "yt/geometry/oct_container.pyx":94 * visitor.oref = 0 * visitor.nz = 1 * assert(ref_mask.shape[0] / float(visitor.nz) == # <<<<<<<<<<<<<< @@ -4953,31 +4689,31 @@ */ if (unlikely(!((((__pyx_v_ref_mask->dimensions[0]) / ((double)__pyx_v_visitor->__pyx_base.nz)) == ((int)((__pyx_v_ref_mask->dimensions[0]) / ((double)__pyx_v_visitor->__pyx_base.nz)))) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 142, __pyx_L1_error) + __PYX_ERR(0, 94, __pyx_L1_error) } } #endif - /* "yt/geometry/oct_container.pyx":144 + /* "yt/geometry/oct_container.pyx":96 * assert(ref_mask.shape[0] / float(visitor.nz) == * (ref_mask.shape[0]/float(visitor.nz))) * obj.allocate_domains([ref_mask.shape[0] / visitor.nz]) # <<<<<<<<<<<<<< * cdef np.float64_t pos[3] * cdef np.float64_t dds[3] */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_obj), __pyx_n_s_allocate_domains); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_obj), __pyx_n_s_allocate_domains); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_v_visitor->__pyx_base.nz == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 144, __pyx_L1_error) + __PYX_ERR(0, 96, __pyx_L1_error) } else if (sizeof(__pyx_t_5numpy_int32_t) == sizeof(long) && (!(((__pyx_t_5numpy_int32_t)-1) > 0)) && unlikely(__pyx_v_visitor->__pyx_base.nz == (__pyx_t_5numpy_int32_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW((__pyx_v_ref_mask->dimensions[0])))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(0, 144, __pyx_L1_error) + __PYX_ERR(0, 96, __pyx_L1_error) } - __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__Pyx_div___pyx_t_5numpy_int32_t((__pyx_v_ref_mask->dimensions[0]), __pyx_v_visitor->__pyx_base.nz)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__Pyx_div___pyx_t_5numpy_int32_t((__pyx_v_ref_mask->dimensions[0]), __pyx_v_visitor->__pyx_base.nz)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_9); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); @@ -4993,14 +4729,14 @@ } } if (!__pyx_t_9) { - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_1}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5009,20 +4745,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_1}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -5030,7 +4766,7 @@ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/oct_container.pyx":148 + /* "yt/geometry/oct_container.pyx":100 * cdef np.float64_t dds[3] * # This dds is the oct-width * for i in range(3): # <<<<<<<<<<<<<< @@ -5040,74 +4776,74 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/geometry/oct_container.pyx":149 + /* "yt/geometry/oct_container.pyx":101 * # This dds is the oct-width * for i in range(3): * dds[i] = (obj.DRE[i] - obj.DLE[i]) / obj.nn[i] # <<<<<<<<<<<<<< * # Pos is the center of the octs - * cdef OctAllocationContainer *cur = obj.domains[0] + * cdef OctAllocationContainer *cur = obj.domains.get_cont(0) */ __pyx_t_11 = ((__pyx_v_obj->DRE[__pyx_v_i]) - (__pyx_v_obj->DLE[__pyx_v_i])); if (unlikely((__pyx_v_obj->nn[__pyx_v_i]) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 149, __pyx_L1_error) + __PYX_ERR(0, 101, __pyx_L1_error) } (__pyx_v_dds[__pyx_v_i]) = (__pyx_t_11 / (__pyx_v_obj->nn[__pyx_v_i])); } - /* "yt/geometry/oct_container.pyx":151 + /* "yt/geometry/oct_container.pyx":103 * dds[i] = (obj.DRE[i] - obj.DLE[i]) / obj.nn[i] * # Pos is the center of the octs - * cdef OctAllocationContainer *cur = obj.domains[0] # <<<<<<<<<<<<<< + * cdef OctAllocationContainer *cur = obj.domains.get_cont(0) # <<<<<<<<<<<<<< * cdef Oct *o - * cdef np.int64_t nfinest = 0 + * cdef np.uint64_t nfinest = 0 */ - __pyx_v_cur = (__pyx_v_obj->domains[0]); + __pyx_v_cur = __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(__pyx_v_obj->domains, 0); - /* "yt/geometry/oct_container.pyx":153 - * cdef OctAllocationContainer *cur = obj.domains[0] + /* "yt/geometry/oct_container.pyx":105 + * cdef OctAllocationContainer *cur = obj.domains.get_cont(0) * cdef Oct *o - * cdef np.int64_t nfinest = 0 # <<<<<<<<<<<<<< + * cdef np.uint64_t nfinest = 0 # <<<<<<<<<<<<<< * visitor.ref_mask = ref_mask - * visitor.octs = cur.my_octs + * visitor.octs = cur.my_objs */ __pyx_v_nfinest = 0; - /* "yt/geometry/oct_container.pyx":154 + /* "yt/geometry/oct_container.pyx":106 * cdef Oct *o - * cdef np.int64_t nfinest = 0 + * cdef np.uint64_t nfinest = 0 * visitor.ref_mask = ref_mask # <<<<<<<<<<<<<< - * visitor.octs = cur.my_octs + * visitor.octs = cur.my_objs * visitor.nocts = &cur.n_assigned */ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_ref_mask)); - if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 154, __pyx_L1_error) + if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 106, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->ref_mask, 0); __pyx_v_visitor->ref_mask = __pyx_t_12; __pyx_t_12.memview = NULL; __pyx_t_12.data = NULL; - /* "yt/geometry/oct_container.pyx":155 - * cdef np.int64_t nfinest = 0 + /* "yt/geometry/oct_container.pyx":107 + * cdef np.uint64_t nfinest = 0 * visitor.ref_mask = ref_mask - * visitor.octs = cur.my_octs # <<<<<<<<<<<<<< + * visitor.octs = cur.my_objs # <<<<<<<<<<<<<< * visitor.nocts = &cur.n_assigned * visitor.nfinest = &nfinest */ - __pyx_t_13 = __pyx_v_cur->my_octs; + __pyx_t_13 = __pyx_v_cur->my_objs; __pyx_v_visitor->octs = __pyx_t_13; - /* "yt/geometry/oct_container.pyx":156 + /* "yt/geometry/oct_container.pyx":108 * visitor.ref_mask = ref_mask - * visitor.octs = cur.my_octs + * visitor.octs = cur.my_objs * visitor.nocts = &cur.n_assigned # <<<<<<<<<<<<<< * visitor.nfinest = &nfinest * pos[0] = obj.DLE[0] + dds[0]/2.0 */ __pyx_v_visitor->nocts = (&__pyx_v_cur->n_assigned); - /* "yt/geometry/oct_container.pyx":157 - * visitor.octs = cur.my_octs + /* "yt/geometry/oct_container.pyx":109 + * visitor.octs = cur.my_objs * visitor.nocts = &cur.n_assigned * visitor.nfinest = &nfinest # <<<<<<<<<<<<<< * pos[0] = obj.DLE[0] + dds[0]/2.0 @@ -5115,7 +4851,7 @@ */ __pyx_v_visitor->nfinest = (&__pyx_v_nfinest); - /* "yt/geometry/oct_container.pyx":158 + /* "yt/geometry/oct_container.pyx":110 * visitor.nocts = &cur.n_assigned * visitor.nfinest = &nfinest * pos[0] = obj.DLE[0] + dds[0]/2.0 # <<<<<<<<<<<<<< @@ -5124,7 +4860,7 @@ */ (__pyx_v_pos[0]) = ((__pyx_v_obj->DLE[0]) + ((__pyx_v_dds[0]) / 2.0)); - /* "yt/geometry/oct_container.pyx":159 + /* "yt/geometry/oct_container.pyx":111 * visitor.nfinest = &nfinest * pos[0] = obj.DLE[0] + dds[0]/2.0 * for i in range(obj.nn[0]): # <<<<<<<<<<<<<< @@ -5135,7 +4871,7 @@ for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_3; __pyx_t_14+=1) { __pyx_v_i = __pyx_t_14; - /* "yt/geometry/oct_container.pyx":160 + /* "yt/geometry/oct_container.pyx":112 * pos[0] = obj.DLE[0] + dds[0]/2.0 * for i in range(obj.nn[0]): * pos[1] = obj.DLE[1] + dds[1]/2.0 # <<<<<<<<<<<<<< @@ -5144,7 +4880,7 @@ */ (__pyx_v_pos[1]) = ((__pyx_v_obj->DLE[1]) + ((__pyx_v_dds[1]) / 2.0)); - /* "yt/geometry/oct_container.pyx":161 + /* "yt/geometry/oct_container.pyx":113 * for i in range(obj.nn[0]): * pos[1] = obj.DLE[1] + dds[1]/2.0 * for j in range(obj.nn[1]): # <<<<<<<<<<<<<< @@ -5155,7 +4891,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_j = __pyx_t_16; - /* "yt/geometry/oct_container.pyx":162 + /* "yt/geometry/oct_container.pyx":114 * pos[1] = obj.DLE[1] + dds[1]/2.0 * for j in range(obj.nn[1]): * pos[2] = obj.DLE[2] + dds[2]/2.0 # <<<<<<<<<<<<<< @@ -5164,7 +4900,7 @@ */ (__pyx_v_pos[2]) = ((__pyx_v_obj->DLE[2]) + ((__pyx_v_dds[2]) / 2.0)); - /* "yt/geometry/oct_container.pyx":163 + /* "yt/geometry/oct_container.pyx":115 * for j in range(obj.nn[1]): * pos[2] = obj.DLE[2] + dds[2]/2.0 * for k in range(obj.nn[2]): # <<<<<<<<<<<<<< @@ -5175,47 +4911,47 @@ for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { __pyx_v_k = __pyx_t_18; - /* "yt/geometry/oct_container.pyx":164 + /* "yt/geometry/oct_container.pyx":116 * pos[2] = obj.DLE[2] + dds[2]/2.0 * for k in range(obj.nn[2]): * if obj.root_mesh[i][j][k] != NULL: # <<<<<<<<<<<<<< * raise RuntimeError - * o = &cur.my_octs[cur.n_assigned] + * o = &cur.my_objs[cur.n_assigned] */ __pyx_t_19 = (((((__pyx_v_obj->root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]) != NULL) != 0); if (__pyx_t_19) { - /* "yt/geometry/oct_container.pyx":165 + /* "yt/geometry/oct_container.pyx":117 * for k in range(obj.nn[2]): * if obj.root_mesh[i][j][k] != NULL: * raise RuntimeError # <<<<<<<<<<<<<< - * o = &cur.my_octs[cur.n_assigned] + * o = &cur.my_objs[cur.n_assigned] * o.domain_ind = o.file_ind = 0 */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 165, __pyx_L1_error) + __PYX_ERR(0, 117, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":164 + /* "yt/geometry/oct_container.pyx":116 * pos[2] = obj.DLE[2] + dds[2]/2.0 * for k in range(obj.nn[2]): * if obj.root_mesh[i][j][k] != NULL: # <<<<<<<<<<<<<< * raise RuntimeError - * o = &cur.my_octs[cur.n_assigned] + * o = &cur.my_objs[cur.n_assigned] */ } - /* "yt/geometry/oct_container.pyx":166 + /* "yt/geometry/oct_container.pyx":118 * if obj.root_mesh[i][j][k] != NULL: * raise RuntimeError - * o = &cur.my_octs[cur.n_assigned] # <<<<<<<<<<<<<< + * o = &cur.my_objs[cur.n_assigned] # <<<<<<<<<<<<<< * o.domain_ind = o.file_ind = 0 * o.domain = 1 */ - __pyx_v_o = (&(__pyx_v_cur->my_octs[__pyx_v_cur->n_assigned])); + __pyx_v_o = (&(__pyx_v_cur->my_objs[__pyx_v_cur->n_assigned])); - /* "yt/geometry/oct_container.pyx":167 + /* "yt/geometry/oct_container.pyx":119 * raise RuntimeError - * o = &cur.my_octs[cur.n_assigned] + * o = &cur.my_objs[cur.n_assigned] * o.domain_ind = o.file_ind = 0 # <<<<<<<<<<<<<< * o.domain = 1 * obj.root_mesh[i][j][k] = o @@ -5223,8 +4959,8 @@ __pyx_v_o->domain_ind = 0; __pyx_v_o->file_ind = 0; - /* "yt/geometry/oct_container.pyx":168 - * o = &cur.my_octs[cur.n_assigned] + /* "yt/geometry/oct_container.pyx":120 + * o = &cur.my_objs[cur.n_assigned] * o.domain_ind = o.file_ind = 0 * o.domain = 1 # <<<<<<<<<<<<<< * obj.root_mesh[i][j][k] = o @@ -5232,7 +4968,7 @@ */ __pyx_v_o->domain = 1; - /* "yt/geometry/oct_container.pyx":169 + /* "yt/geometry/oct_container.pyx":121 * o.domain_ind = o.file_ind = 0 * o.domain = 1 * obj.root_mesh[i][j][k] = o # <<<<<<<<<<<<<< @@ -5241,7 +4977,7 @@ */ (((__pyx_v_obj->root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]) = __pyx_v_o; - /* "yt/geometry/oct_container.pyx":170 + /* "yt/geometry/oct_container.pyx":122 * o.domain = 1 * obj.root_mesh[i][j][k] = o * cur.n_assigned += 1 # <<<<<<<<<<<<<< @@ -5250,7 +4986,7 @@ */ __pyx_v_cur->n_assigned = (__pyx_v_cur->n_assigned + 1); - /* "yt/geometry/oct_container.pyx":171 + /* "yt/geometry/oct_container.pyx":123 * obj.root_mesh[i][j][k] = o * cur.n_assigned += 1 * visitor.pos[0] = i # <<<<<<<<<<<<<< @@ -5259,7 +4995,7 @@ */ (__pyx_v_visitor->__pyx_base.pos[0]) = __pyx_v_i; - /* "yt/geometry/oct_container.pyx":172 + /* "yt/geometry/oct_container.pyx":124 * cur.n_assigned += 1 * visitor.pos[0] = i * visitor.pos[1] = j # <<<<<<<<<<<<<< @@ -5268,7 +5004,7 @@ */ (__pyx_v_visitor->__pyx_base.pos[1]) = __pyx_v_j; - /* "yt/geometry/oct_container.pyx":173 + /* "yt/geometry/oct_container.pyx":125 * visitor.pos[0] = i * visitor.pos[1] = j * visitor.pos[2] = k # <<<<<<<<<<<<<< @@ -5277,7 +5013,7 @@ */ (__pyx_v_visitor->__pyx_base.pos[2]) = __pyx_v_k; - /* "yt/geometry/oct_container.pyx":175 + /* "yt/geometry/oct_container.pyx":127 * visitor.pos[2] = k * # Always visit covered * selector.recursively_visit_octs( # <<<<<<<<<<<<<< @@ -5288,7 +5024,7 @@ __pyx_t_20.visit_covered = 1; ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->recursively_visit_octs(__pyx_v_selector, (((__pyx_v_obj->root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]), __pyx_v_pos, __pyx_v_dds, 0, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), &__pyx_t_20); - /* "yt/geometry/oct_container.pyx":178 + /* "yt/geometry/oct_container.pyx":130 * obj.root_mesh[i][j][k], * pos, dds, 0, visitor, 1) * pos[2] += dds[2] # <<<<<<<<<<<<<< @@ -5299,7 +5035,7 @@ (__pyx_v_pos[__pyx_t_21]) = ((__pyx_v_pos[__pyx_t_21]) + (__pyx_v_dds[2])); } - /* "yt/geometry/oct_container.pyx":179 + /* "yt/geometry/oct_container.pyx":131 * pos, dds, 0, visitor, 1) * pos[2] += dds[2] * pos[1] += dds[1] # <<<<<<<<<<<<<< @@ -5310,7 +5046,7 @@ (__pyx_v_pos[__pyx_t_21]) = ((__pyx_v_pos[__pyx_t_21]) + (__pyx_v_dds[1])); } - /* "yt/geometry/oct_container.pyx":180 + /* "yt/geometry/oct_container.pyx":132 * pos[2] += dds[2] * pos[1] += dds[1] * pos[0] += dds[0] # <<<<<<<<<<<<<< @@ -5321,7 +5057,7 @@ (__pyx_v_pos[__pyx_t_21]) = ((__pyx_v_pos[__pyx_t_21]) + (__pyx_v_dds[0])); } - /* "yt/geometry/oct_container.pyx":181 + /* "yt/geometry/oct_container.pyx":133 * pos[1] += dds[1] * pos[0] += dds[0] * obj.nocts = cur.n_assigned # <<<<<<<<<<<<<< @@ -5331,56 +5067,56 @@ __pyx_t_22 = __pyx_v_cur->n_assigned; __pyx_v_obj->nocts = __pyx_t_22; - /* "yt/geometry/oct_container.pyx":182 + /* "yt/geometry/oct_container.pyx":134 * pos[0] += dds[0] * obj.nocts = cur.n_assigned * if obj.nocts * visitor.nz != ref_mask.size: # <<<<<<<<<<<<<< * raise KeyError(ref_mask.size, obj.nocts, obj.oref, * obj.partial_coverage) */ - __pyx_t_8 = __Pyx_PyInt_From_npy_int64((__pyx_v_obj->nocts * __pyx_v_visitor->__pyx_base.nz)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_npy_int64((__pyx_v_obj->nocts * __pyx_v_visitor->__pyx_base.nz)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ref_mask), __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ref_mask), __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = PyObject_RichCompare(__pyx_t_8, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_t_8, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_19) { - /* "yt/geometry/oct_container.pyx":183 + /* "yt/geometry/oct_container.pyx":135 * obj.nocts = cur.n_assigned * if obj.nocts * visitor.nz != ref_mask.size: * raise KeyError(ref_mask.size, obj.nocts, obj.oref, # <<<<<<<<<<<<<< * obj.partial_coverage) * return obj */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ref_mask), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ref_mask), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->nocts); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->nocts); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyInt_From_npy_uint8(__pyx_v_obj->oref); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_npy_uint8(__pyx_v_obj->oref); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - /* "yt/geometry/oct_container.pyx":184 + /* "yt/geometry/oct_container.pyx":136 * if obj.nocts * visitor.nz != ref_mask.size: * raise KeyError(ref_mask.size, obj.nocts, obj.oref, * obj.partial_coverage) # <<<<<<<<<<<<<< * return obj * */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_obj->partial_coverage); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_obj->partial_coverage); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "yt/geometry/oct_container.pyx":183 + /* "yt/geometry/oct_container.pyx":135 * obj.nocts = cur.n_assigned * if obj.nocts * visitor.nz != ref_mask.size: * raise KeyError(ref_mask.size, obj.nocts, obj.oref, # <<<<<<<<<<<<<< * obj.partial_coverage) * return obj */ - __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); @@ -5394,14 +5130,14 @@ __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 183, __pyx_L1_error) + __PYX_ERR(0, 135, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":182 + /* "yt/geometry/oct_container.pyx":134 * pos[0] += dds[0] * obj.nocts = cur.n_assigned * if obj.nocts * visitor.nz != ref_mask.size: # <<<<<<<<<<<<<< @@ -5410,7 +5146,7 @@ */ } - /* "yt/geometry/oct_container.pyx":185 + /* "yt/geometry/oct_container.pyx":137 * raise KeyError(ref_mask.size, obj.nocts, obj.oref, * obj.partial_coverage) * return obj # <<<<<<<<<<<<<< @@ -5422,7 +5158,7 @@ __pyx_r = ((PyObject *)__pyx_v_obj); goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":127 + /* "yt/geometry/oct_container.pyx":79 * * @classmethod * def load_octree(cls, header): # <<<<<<<<<<<<<< @@ -5459,12 +5195,12 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":187 +/* "yt/geometry/oct_container.pyx":139 * return obj * * def __dealloc__(self): # <<<<<<<<<<<<<< - * free_octs(self.cont) * if self.root_mesh == NULL: return + * for i in range(self.nn[0]): */ /* Python wrapper */ @@ -5489,18 +5225,9 @@ int __pyx_t_5; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "yt/geometry/oct_container.pyx":188 + /* "yt/geometry/oct_container.pyx":140 * * def __dealloc__(self): - * free_octs(self.cont) # <<<<<<<<<<<<<< - * if self.root_mesh == NULL: return - * for i in range(self.nn[0]): - */ - __pyx_f_2yt_8geometry_13oct_container_free_octs(__pyx_v_self->cont); - - /* "yt/geometry/oct_container.pyx":189 - * def __dealloc__(self): - * free_octs(self.cont) * if self.root_mesh == NULL: return # <<<<<<<<<<<<<< * for i in range(self.nn[0]): * if self.root_mesh[i] == NULL: continue @@ -5510,8 +5237,8 @@ goto __pyx_L0; } - /* "yt/geometry/oct_container.pyx":190 - * free_octs(self.cont) + /* "yt/geometry/oct_container.pyx":141 + * def __dealloc__(self): * if self.root_mesh == NULL: return * for i in range(self.nn[0]): # <<<<<<<<<<<<<< * if self.root_mesh[i] == NULL: continue @@ -5521,7 +5248,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/geometry/oct_container.pyx":191 + /* "yt/geometry/oct_container.pyx":142 * if self.root_mesh == NULL: return * for i in range(self.nn[0]): * if self.root_mesh[i] == NULL: continue # <<<<<<<<<<<<<< @@ -5533,7 +5260,7 @@ goto __pyx_L4_continue; } - /* "yt/geometry/oct_container.pyx":192 + /* "yt/geometry/oct_container.pyx":143 * for i in range(self.nn[0]): * if self.root_mesh[i] == NULL: continue * for j in range(self.nn[1]): # <<<<<<<<<<<<<< @@ -5544,7 +5271,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_j = __pyx_t_5; - /* "yt/geometry/oct_container.pyx":193 + /* "yt/geometry/oct_container.pyx":144 * if self.root_mesh[i] == NULL: continue * for j in range(self.nn[1]): * if self.root_mesh[i][j] == NULL: continue # <<<<<<<<<<<<<< @@ -5556,7 +5283,7 @@ goto __pyx_L7_continue; } - /* "yt/geometry/oct_container.pyx":194 + /* "yt/geometry/oct_container.pyx":145 * for j in range(self.nn[1]): * if self.root_mesh[i][j] == NULL: continue * free(self.root_mesh[i][j]) # <<<<<<<<<<<<<< @@ -5567,7 +5294,7 @@ __pyx_L7_continue:; } - /* "yt/geometry/oct_container.pyx":195 + /* "yt/geometry/oct_container.pyx":146 * if self.root_mesh[i][j] == NULL: continue * free(self.root_mesh[i][j]) * if self.root_mesh[i] == NULL: continue # <<<<<<<<<<<<<< @@ -5579,7 +5306,7 @@ goto __pyx_L4_continue; } - /* "yt/geometry/oct_container.pyx":196 + /* "yt/geometry/oct_container.pyx":147 * free(self.root_mesh[i][j]) * if self.root_mesh[i] == NULL: continue * free(self.root_mesh[i]) # <<<<<<<<<<<<<< @@ -5590,225 +5317,29 @@ __pyx_L4_continue:; } - /* "yt/geometry/oct_container.pyx":197 + /* "yt/geometry/oct_container.pyx":148 * if self.root_mesh[i] == NULL: continue * free(self.root_mesh[i]) * free(self.root_mesh) # <<<<<<<<<<<<<< * - * def __iter__(self): + * @cython.cdivision(True) */ free(__pyx_v_self->root_mesh); - /* "yt/geometry/oct_container.pyx":187 + /* "yt/geometry/oct_container.pyx":139 * return obj * * def __dealloc__(self): # <<<<<<<<<<<<<< - * free_octs(self.cont) * if self.root_mesh == NULL: return + * for i in range(self.nn[0]): */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); } -static PyObject *__pyx_gb_2yt_8geometry_13oct_container_15OctreeContainer_10generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ - -/* "yt/geometry/oct_container.pyx":199 - * free(self.root_mesh) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * #Get the next oct, will traverse domains - * #Note that oct containers can be sorted - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9__iter__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_8__iter__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_8__iter__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) { - struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__", 0); - __pyx_cur_scope = (struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *)__pyx_tp_new_2yt_8geometry_13oct_container___pyx_scope_struct____iter__(__pyx_ptype_2yt_8geometry_13oct_container___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 199, __pyx_L1_error) - } else { - __Pyx_GOTREF(__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_v_self = __pyx_v_self; - __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_2yt_8geometry_13oct_container_15OctreeContainer_10generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_OctreeContainer___iter, __pyx_n_s_yt_geometry_oct_container); if (unlikely(!gen)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_2yt_8geometry_13oct_container_15OctreeContainer_10generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *__pyx_cur_scope = ((struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_t_1; - int __pyx_t_2; - __pyx_t_5numpy_int64_t __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; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("None", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L8_resume_from_yield; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 199, __pyx_L1_error) - - /* "yt/geometry/oct_container.pyx":203 - * #Note that oct containers can be sorted - * #so that consecutive octs are on the same domain - * cdef OctAllocationContainer *cur = self.cont # <<<<<<<<<<<<<< - * cdef Oct *this - * cdef int i - */ - __pyx_t_1 = __pyx_cur_scope->__pyx_v_self->cont; - __pyx_cur_scope->__pyx_v_cur = __pyx_t_1; - - /* "yt/geometry/oct_container.pyx":206 - * cdef Oct *this - * cdef int i - * while cur != NULL: # <<<<<<<<<<<<<< - * for i in range(cur.n_assigned): - * this = &cur.my_octs[i] - */ - while (1) { - __pyx_t_2 = ((__pyx_cur_scope->__pyx_v_cur != NULL) != 0); - if (!__pyx_t_2) break; - - /* "yt/geometry/oct_container.pyx":207 - * cdef int i - * while cur != NULL: - * for i in range(cur.n_assigned): # <<<<<<<<<<<<<< - * this = &cur.my_octs[i] - * yield (this.file_ind, this.domain_ind, this.domain) - */ - __pyx_t_3 = __pyx_cur_scope->__pyx_v_cur->n_assigned; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_cur_scope->__pyx_v_i = __pyx_t_4; - - /* "yt/geometry/oct_container.pyx":208 - * while cur != NULL: - * for i in range(cur.n_assigned): - * this = &cur.my_octs[i] # <<<<<<<<<<<<<< - * yield (this.file_ind, this.domain_ind, this.domain) - * cur = cur.next - */ - __pyx_cur_scope->__pyx_v_this = (&(__pyx_cur_scope->__pyx_v_cur->my_octs[__pyx_cur_scope->__pyx_v_i])); - - /* "yt/geometry/oct_container.pyx":209 - * for i in range(cur.n_assigned): - * this = &cur.my_octs[i] - * yield (this.file_ind, this.domain_ind, this.domain) # <<<<<<<<<<<<<< - * cur = cur.next - * - */ - __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_this->file_ind); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_this->domain_ind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_this->domain); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); - __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_5 = 0; - __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; - __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; - __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - /* return from generator, yielding value */ - __pyx_generator->resume_label = 1; - return __pyx_r; - __pyx_L8_resume_from_yield:; - __pyx_t_3 = __pyx_cur_scope->__pyx_t_0; - __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 209, __pyx_L1_error) - } - - /* "yt/geometry/oct_container.pyx":210 - * this = &cur.my_octs[i] - * yield (this.file_ind, this.domain_ind, this.domain) - * cur = cur.next # <<<<<<<<<<<<<< - * - * @cython.cdivision(True) - */ - __pyx_t_1 = __pyx_cur_scope->__pyx_v_cur->next; - __pyx_cur_scope->__pyx_v_cur = __pyx_t_1; - } - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - - /* "yt/geometry/oct_container.pyx":199 - * free(self.root_mesh) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * #Get the next oct, will traverse domains - * #Note that oct containers can be sorted - */ - - /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); - 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("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -/* "yt/geometry/oct_container.pyx":213 +/* "yt/geometry/oct_container.pyx":151 * * @cython.cdivision(True) * cdef void visit_all_octs(self, SelectorObject selector, # <<<<<<<<<<<<<< @@ -5840,7 +5371,7 @@ } } - /* "yt/geometry/oct_container.pyx":216 + /* "yt/geometry/oct_container.pyx":154 * OctVisitor visitor, int vc = -1): * cdef int i, j, k, n * if vc == -1: # <<<<<<<<<<<<<< @@ -5850,7 +5381,7 @@ __pyx_t_1 = ((__pyx_v_vc == -1L) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":217 + /* "yt/geometry/oct_container.pyx":155 * cdef int i, j, k, n * if vc == -1: * vc = self.partial_coverage # <<<<<<<<<<<<<< @@ -5860,7 +5391,7 @@ __pyx_t_2 = __pyx_v_self->partial_coverage; __pyx_v_vc = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":216 + /* "yt/geometry/oct_container.pyx":154 * OctVisitor visitor, int vc = -1): * cdef int i, j, k, n * if vc == -1: # <<<<<<<<<<<<<< @@ -5869,7 +5400,7 @@ */ } - /* "yt/geometry/oct_container.pyx":218 + /* "yt/geometry/oct_container.pyx":156 * if vc == -1: * vc = self.partial_coverage * visitor.global_index = -1 # <<<<<<<<<<<<<< @@ -5878,7 +5409,7 @@ */ __pyx_v_visitor->global_index = -1LL; - /* "yt/geometry/oct_container.pyx":219 + /* "yt/geometry/oct_container.pyx":157 * vc = self.partial_coverage * visitor.global_index = -1 * visitor.level = 0 # <<<<<<<<<<<<<< @@ -5887,7 +5418,7 @@ */ __pyx_v_visitor->level = 0; - /* "yt/geometry/oct_container.pyx":223 + /* "yt/geometry/oct_container.pyx":161 * cdef np.float64_t dds[3] * # This dds is the oct-width * for i in range(3): # <<<<<<<<<<<<<< @@ -5897,7 +5428,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":224 + /* "yt/geometry/oct_container.pyx":162 * # This dds is the oct-width * for i in range(3): * dds[i] = (self.DRE[i] - self.DLE[i]) / self.nn[i] # <<<<<<<<<<<<<< @@ -5907,7 +5438,7 @@ (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_self->nn[__pyx_v_i])); } - /* "yt/geometry/oct_container.pyx":226 + /* "yt/geometry/oct_container.pyx":164 * dds[i] = (self.DRE[i] - self.DLE[i]) / self.nn[i] * # Pos is the center of the octs * pos[0] = self.DLE[0] + dds[0]/2.0 # <<<<<<<<<<<<<< @@ -5916,7 +5447,7 @@ */ (__pyx_v_pos[0]) = ((__pyx_v_self->DLE[0]) + ((__pyx_v_dds[0]) / 2.0)); - /* "yt/geometry/oct_container.pyx":227 + /* "yt/geometry/oct_container.pyx":165 * # Pos is the center of the octs * pos[0] = self.DLE[0] + dds[0]/2.0 * for i in range(self.nn[0]): # <<<<<<<<<<<<<< @@ -5927,7 +5458,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/geometry/oct_container.pyx":228 + /* "yt/geometry/oct_container.pyx":166 * pos[0] = self.DLE[0] + dds[0]/2.0 * for i in range(self.nn[0]): * pos[1] = self.DLE[1] + dds[1]/2.0 # <<<<<<<<<<<<<< @@ -5936,7 +5467,7 @@ */ (__pyx_v_pos[1]) = ((__pyx_v_self->DLE[1]) + ((__pyx_v_dds[1]) / 2.0)); - /* "yt/geometry/oct_container.pyx":229 + /* "yt/geometry/oct_container.pyx":167 * for i in range(self.nn[0]): * pos[1] = self.DLE[1] + dds[1]/2.0 * for j in range(self.nn[1]): # <<<<<<<<<<<<<< @@ -5947,7 +5478,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_j = __pyx_t_5; - /* "yt/geometry/oct_container.pyx":230 + /* "yt/geometry/oct_container.pyx":168 * pos[1] = self.DLE[1] + dds[1]/2.0 * for j in range(self.nn[1]): * pos[2] = self.DLE[2] + dds[2]/2.0 # <<<<<<<<<<<<<< @@ -5956,7 +5487,7 @@ */ (__pyx_v_pos[2]) = ((__pyx_v_self->DLE[2]) + ((__pyx_v_dds[2]) / 2.0)); - /* "yt/geometry/oct_container.pyx":231 + /* "yt/geometry/oct_container.pyx":169 * for j in range(self.nn[1]): * pos[2] = self.DLE[2] + dds[2]/2.0 * for k in range(self.nn[2]): # <<<<<<<<<<<<<< @@ -5967,7 +5498,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_k = __pyx_t_7; - /* "yt/geometry/oct_container.pyx":232 + /* "yt/geometry/oct_container.pyx":170 * pos[2] = self.DLE[2] + dds[2]/2.0 * for k in range(self.nn[2]): * if self.root_mesh[i][j][k] == NULL: # <<<<<<<<<<<<<< @@ -5977,7 +5508,7 @@ __pyx_t_1 = (((((__pyx_v_self->root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]) == NULL) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":233 + /* "yt/geometry/oct_container.pyx":171 * for k in range(self.nn[2]): * if self.root_mesh[i][j][k] == NULL: * raise RuntimeError # <<<<<<<<<<<<<< @@ -5985,9 +5516,9 @@ * visitor.pos[1] = j */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 233, __pyx_L1_error) + __PYX_ERR(0, 171, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":232 + /* "yt/geometry/oct_container.pyx":170 * pos[2] = self.DLE[2] + dds[2]/2.0 * for k in range(self.nn[2]): * if self.root_mesh[i][j][k] == NULL: # <<<<<<<<<<<<<< @@ -5996,7 +5527,7 @@ */ } - /* "yt/geometry/oct_container.pyx":234 + /* "yt/geometry/oct_container.pyx":172 * if self.root_mesh[i][j][k] == NULL: * raise RuntimeError * visitor.pos[0] = i # <<<<<<<<<<<<<< @@ -6005,7 +5536,7 @@ */ (__pyx_v_visitor->pos[0]) = __pyx_v_i; - /* "yt/geometry/oct_container.pyx":235 + /* "yt/geometry/oct_container.pyx":173 * raise RuntimeError * visitor.pos[0] = i * visitor.pos[1] = j # <<<<<<<<<<<<<< @@ -6014,7 +5545,7 @@ */ (__pyx_v_visitor->pos[1]) = __pyx_v_j; - /* "yt/geometry/oct_container.pyx":236 + /* "yt/geometry/oct_container.pyx":174 * visitor.pos[0] = i * visitor.pos[1] = j * visitor.pos[2] = k # <<<<<<<<<<<<<< @@ -6023,7 +5554,7 @@ */ (__pyx_v_visitor->pos[2]) = __pyx_v_k; - /* "yt/geometry/oct_container.pyx":237 + /* "yt/geometry/oct_container.pyx":175 * visitor.pos[1] = j * visitor.pos[2] = k * selector.recursively_visit_octs( # <<<<<<<<<<<<<< @@ -6034,7 +5565,7 @@ __pyx_t_8.visit_covered = __pyx_v_vc; ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->recursively_visit_octs(__pyx_v_selector, (((__pyx_v_self->root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]), __pyx_v_pos, __pyx_v_dds, 0, __pyx_v_visitor, &__pyx_t_8); - /* "yt/geometry/oct_container.pyx":240 + /* "yt/geometry/oct_container.pyx":178 * self.root_mesh[i][j][k], * pos, dds, 0, visitor, vc) * pos[2] += dds[2] # <<<<<<<<<<<<<< @@ -6045,7 +5576,7 @@ (__pyx_v_pos[__pyx_t_9]) = ((__pyx_v_pos[__pyx_t_9]) + (__pyx_v_dds[2])); } - /* "yt/geometry/oct_container.pyx":241 + /* "yt/geometry/oct_container.pyx":179 * pos, dds, 0, visitor, vc) * pos[2] += dds[2] * pos[1] += dds[1] # <<<<<<<<<<<<<< @@ -6056,7 +5587,7 @@ (__pyx_v_pos[__pyx_t_9]) = ((__pyx_v_pos[__pyx_t_9]) + (__pyx_v_dds[1])); } - /* "yt/geometry/oct_container.pyx":242 + /* "yt/geometry/oct_container.pyx":180 * pos[2] += dds[2] * pos[1] += dds[1] * pos[0] += dds[0] # <<<<<<<<<<<<<< @@ -6067,7 +5598,7 @@ (__pyx_v_pos[__pyx_t_9]) = ((__pyx_v_pos[__pyx_t_9]) + (__pyx_v_dds[0])); } - /* "yt/geometry/oct_container.pyx":213 + /* "yt/geometry/oct_container.pyx":151 * * @cython.cdivision(True) * cdef void visit_all_octs(self, SelectorObject selector, # <<<<<<<<<<<<<< @@ -6078,12 +5609,12 @@ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.oct_container.OctreeContainer.visit_all_octs", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.oct_container.OctreeContainer.visit_all_octs", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/oct_container.pyx":244 +/* "yt/geometry/oct_container.pyx":182 * pos[0] += dds[0] * * cdef void oct_bounds(self, Oct *o, np.float64_t *corner, np.float64_t *size): # <<<<<<<<<<<<<< @@ -6099,7 +5630,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/oct_container.pyx":250 +/* "yt/geometry/oct_container.pyx":188 * # corner[i] = o.pos[i] * size[i] + self.DLE[i] * * cdef np.int64_t get_domain_offset(self, int domain_id): # <<<<<<<<<<<<<< @@ -6112,7 +5643,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_domain_offset", 0); - /* "yt/geometry/oct_container.pyx":251 + /* "yt/geometry/oct_container.pyx":189 * * cdef np.int64_t get_domain_offset(self, int domain_id): * return 0 # <<<<<<<<<<<<<< @@ -6122,7 +5653,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":250 + /* "yt/geometry/oct_container.pyx":188 * # corner[i] = o.pos[i] * size[i] + self.DLE[i] * * cdef np.int64_t get_domain_offset(self, int domain_id): # <<<<<<<<<<<<<< @@ -6136,7 +5667,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":253 +/* "yt/geometry/oct_container.pyx":191 * return 0 * * cdef int get_root(self, int ind[3], Oct **o): # <<<<<<<<<<<<<< @@ -6153,7 +5684,7 @@ int __pyx_t_3; __Pyx_RefNannySetupContext("get_root", 0); - /* "yt/geometry/oct_container.pyx":255 + /* "yt/geometry/oct_container.pyx":193 * cdef int get_root(self, int ind[3], Oct **o): * cdef int i * for i in range(3): # <<<<<<<<<<<<<< @@ -6163,7 +5694,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":256 + /* "yt/geometry/oct_container.pyx":194 * cdef int i * for i in range(3): * if ind[i] < 0 or ind[i] >= self.nn[i]: # <<<<<<<<<<<<<< @@ -6181,7 +5712,7 @@ __pyx_L6_bool_binop_done:; if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":257 + /* "yt/geometry/oct_container.pyx":195 * for i in range(3): * if ind[i] < 0 or ind[i] >= self.nn[i]: * o[0] = NULL # <<<<<<<<<<<<<< @@ -6190,7 +5721,7 @@ */ (__pyx_v_o[0]) = NULL; - /* "yt/geometry/oct_container.pyx":258 + /* "yt/geometry/oct_container.pyx":196 * if ind[i] < 0 or ind[i] >= self.nn[i]: * o[0] = NULL * return 1 # <<<<<<<<<<<<<< @@ -6200,7 +5731,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":256 + /* "yt/geometry/oct_container.pyx":194 * cdef int i * for i in range(3): * if ind[i] < 0 or ind[i] >= self.nn[i]: # <<<<<<<<<<<<<< @@ -6210,7 +5741,7 @@ } } - /* "yt/geometry/oct_container.pyx":259 + /* "yt/geometry/oct_container.pyx":197 * o[0] = NULL * return 1 * o[0] = self.root_mesh[ind[0]][ind[1]][ind[2]] # <<<<<<<<<<<<<< @@ -6219,7 +5750,7 @@ */ (__pyx_v_o[0]) = (((__pyx_v_self->root_mesh[(__pyx_v_ind[0])])[(__pyx_v_ind[1])])[(__pyx_v_ind[2])]); - /* "yt/geometry/oct_container.pyx":260 + /* "yt/geometry/oct_container.pyx":198 * return 1 * o[0] = self.root_mesh[ind[0]][ind[1]][ind[2]] * return 0 # <<<<<<<<<<<<<< @@ -6229,7 +5760,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":253 + /* "yt/geometry/oct_container.pyx":191 * return 0 * * cdef int get_root(self, int ind[3], Oct **o): # <<<<<<<<<<<<<< @@ -6243,7 +5774,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":265 +/* "yt/geometry/oct_container.pyx":203 * @cython.wraparound(False) * @cython.cdivision(True) * cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = NULL, # <<<<<<<<<<<<<< @@ -6281,7 +5812,7 @@ } } - /* "yt/geometry/oct_container.pyx":277 + /* "yt/geometry/oct_container.pyx":215 * cdef Oct *next * cdef int i * cur = next = NULL # <<<<<<<<<<<<<< @@ -6291,7 +5822,7 @@ __pyx_v_cur = NULL; __pyx_v_next = NULL; - /* "yt/geometry/oct_container.pyx":279 + /* "yt/geometry/oct_container.pyx":217 * cur = next = NULL * cdef np.int64_t ind[3] * cdef np.int64_t level = -1 # <<<<<<<<<<<<<< @@ -6300,7 +5831,7 @@ */ __pyx_v_level = -1LL; - /* "yt/geometry/oct_container.pyx":280 + /* "yt/geometry/oct_container.pyx":218 * cdef np.int64_t ind[3] * cdef np.int64_t level = -1 * for i in range(3): # <<<<<<<<<<<<<< @@ -6310,7 +5841,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":281 + /* "yt/geometry/oct_container.pyx":219 * cdef np.int64_t level = -1 * for i in range(3): * dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i] # <<<<<<<<<<<<<< @@ -6319,7 +5850,7 @@ */ (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_self->nn[__pyx_v_i])); - /* "yt/geometry/oct_container.pyx":282 + /* "yt/geometry/oct_container.pyx":220 * for i in range(3): * dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i] * ind[i] = (floor((ppos[i] - self.DLE[i])/dds[i])) # <<<<<<<<<<<<<< @@ -6328,7 +5859,7 @@ */ (__pyx_v_ind[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t)floor((((__pyx_v_ppos[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i])))); - /* "yt/geometry/oct_container.pyx":283 + /* "yt/geometry/oct_container.pyx":221 * dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i] * ind[i] = (floor((ppos[i] - self.DLE[i])/dds[i])) * cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i] # <<<<<<<<<<<<<< @@ -6337,7 +5868,7 @@ */ (__pyx_v_cp[__pyx_v_i]) = ((((__pyx_v_ind[__pyx_v_i]) + 0.5) * (__pyx_v_dds[__pyx_v_i])) + (__pyx_v_self->DLE[__pyx_v_i])); - /* "yt/geometry/oct_container.pyx":284 + /* "yt/geometry/oct_container.pyx":222 * ind[i] = (floor((ppos[i] - self.DLE[i])/dds[i])) * cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i] * ipos[i] = 0 # We add this to ind later, so it should be zero. # <<<<<<<<<<<<<< @@ -6346,7 +5877,7 @@ */ (__pyx_v_ipos[__pyx_v_i]) = 0; - /* "yt/geometry/oct_container.pyx":285 + /* "yt/geometry/oct_container.pyx":223 * cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i] * ipos[i] = 0 # We add this to ind later, so it should be zero. * ind32[i] = ind[i] # <<<<<<<<<<<<<< @@ -6356,7 +5887,7 @@ (__pyx_v_ind32[__pyx_v_i]) = (__pyx_v_ind[__pyx_v_i]); } - /* "yt/geometry/oct_container.pyx":286 + /* "yt/geometry/oct_container.pyx":224 * ipos[i] = 0 # We add this to ind later, so it should be zero. * ind32[i] = ind[i] * self.get_root(ind32, &next) # <<<<<<<<<<<<<< @@ -6365,7 +5896,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->get_root(__pyx_v_self, __pyx_v_ind32, (&__pyx_v_next)); - /* "yt/geometry/oct_container.pyx":288 + /* "yt/geometry/oct_container.pyx":226 * self.get_root(ind32, &next) * # We want to stop recursing when there's nowhere else to go * while next != NULL and level <= max_level: # <<<<<<<<<<<<<< @@ -6384,7 +5915,7 @@ __pyx_L7_bool_binop_done:; if (!__pyx_t_2) break; - /* "yt/geometry/oct_container.pyx":289 + /* "yt/geometry/oct_container.pyx":227 * # We want to stop recursing when there's nowhere else to go * while next != NULL and level <= max_level: * level += 1 # <<<<<<<<<<<<<< @@ -6393,7 +5924,7 @@ */ __pyx_v_level = (__pyx_v_level + 1); - /* "yt/geometry/oct_container.pyx":290 + /* "yt/geometry/oct_container.pyx":228 * while next != NULL and level <= max_level: * level += 1 * for i in range(3): # <<<<<<<<<<<<<< @@ -6403,7 +5934,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":291 + /* "yt/geometry/oct_container.pyx":229 * level += 1 * for i in range(3): * ipos[i] = (ipos[i] << 1) + ind[i] # <<<<<<<<<<<<<< @@ -6413,7 +5944,7 @@ (__pyx_v_ipos[__pyx_v_i]) = (((__pyx_v_ipos[__pyx_v_i]) << 1) + (__pyx_v_ind[__pyx_v_i])); } - /* "yt/geometry/oct_container.pyx":292 + /* "yt/geometry/oct_container.pyx":230 * for i in range(3): * ipos[i] = (ipos[i] << 1) + ind[i] * cur = next # <<<<<<<<<<<<<< @@ -6422,7 +5953,7 @@ */ __pyx_v_cur = __pyx_v_next; - /* "yt/geometry/oct_container.pyx":293 + /* "yt/geometry/oct_container.pyx":231 * ipos[i] = (ipos[i] << 1) + ind[i] * cur = next * for i in range(3): # <<<<<<<<<<<<<< @@ -6432,7 +5963,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":294 + /* "yt/geometry/oct_container.pyx":232 * cur = next * for i in range(3): * dds[i] = dds[i] / 2.0 # <<<<<<<<<<<<<< @@ -6441,7 +5972,7 @@ */ (__pyx_v_dds[__pyx_v_i]) = ((__pyx_v_dds[__pyx_v_i]) / 2.0); - /* "yt/geometry/oct_container.pyx":295 + /* "yt/geometry/oct_container.pyx":233 * for i in range(3): * dds[i] = dds[i] / 2.0 * if cp[i] > ppos[i]: # <<<<<<<<<<<<<< @@ -6451,7 +5982,7 @@ __pyx_t_2 = (((__pyx_v_cp[__pyx_v_i]) > (__pyx_v_ppos[__pyx_v_i])) != 0); if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":296 + /* "yt/geometry/oct_container.pyx":234 * dds[i] = dds[i] / 2.0 * if cp[i] > ppos[i]: * ind[i] = 0 # <<<<<<<<<<<<<< @@ -6460,7 +5991,7 @@ */ (__pyx_v_ind[__pyx_v_i]) = 0; - /* "yt/geometry/oct_container.pyx":297 + /* "yt/geometry/oct_container.pyx":235 * if cp[i] > ppos[i]: * ind[i] = 0 * cp[i] -= dds[i] / 2.0 # <<<<<<<<<<<<<< @@ -6470,7 +6001,7 @@ __pyx_t_4 = __pyx_v_i; (__pyx_v_cp[__pyx_t_4]) = ((__pyx_v_cp[__pyx_t_4]) - ((__pyx_v_dds[__pyx_v_i]) / 2.0)); - /* "yt/geometry/oct_container.pyx":295 + /* "yt/geometry/oct_container.pyx":233 * for i in range(3): * dds[i] = dds[i] / 2.0 * if cp[i] > ppos[i]: # <<<<<<<<<<<<<< @@ -6480,7 +6011,7 @@ goto __pyx_L13; } - /* "yt/geometry/oct_container.pyx":299 + /* "yt/geometry/oct_container.pyx":237 * cp[i] -= dds[i] / 2.0 * else: * ind[i] = 1 # <<<<<<<<<<<<<< @@ -6490,7 +6021,7 @@ /*else*/ { (__pyx_v_ind[__pyx_v_i]) = 1; - /* "yt/geometry/oct_container.pyx":300 + /* "yt/geometry/oct_container.pyx":238 * else: * ind[i] = 1 * cp[i] += dds[i]/2.0 # <<<<<<<<<<<<<< @@ -6503,7 +6034,7 @@ __pyx_L13:; } - /* "yt/geometry/oct_container.pyx":301 + /* "yt/geometry/oct_container.pyx":239 * ind[i] = 1 * cp[i] += dds[i]/2.0 * if cur.children != NULL: # <<<<<<<<<<<<<< @@ -6513,7 +6044,7 @@ __pyx_t_2 = ((__pyx_v_cur->children != NULL) != 0); if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":302 + /* "yt/geometry/oct_container.pyx":240 * cp[i] += dds[i]/2.0 * if cur.children != NULL: * next = cur.children[cind(ind[0],ind[1],ind[2])] # <<<<<<<<<<<<<< @@ -6522,7 +6053,7 @@ */ __pyx_v_next = (__pyx_v_cur->children[__pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_ind[0]), (__pyx_v_ind[1]), (__pyx_v_ind[2]))]); - /* "yt/geometry/oct_container.pyx":301 + /* "yt/geometry/oct_container.pyx":239 * ind[i] = 1 * cp[i] += dds[i]/2.0 * if cur.children != NULL: # <<<<<<<<<<<<<< @@ -6532,7 +6063,7 @@ goto __pyx_L14; } - /* "yt/geometry/oct_container.pyx":304 + /* "yt/geometry/oct_container.pyx":242 * next = cur.children[cind(ind[0],ind[1],ind[2])] * else: * next = NULL # <<<<<<<<<<<<<< @@ -6545,7 +6076,7 @@ __pyx_L14:; } - /* "yt/geometry/oct_container.pyx":305 + /* "yt/geometry/oct_container.pyx":243 * else: * next = NULL * if oinfo == NULL: return cur # <<<<<<<<<<<<<< @@ -6558,7 +6089,7 @@ goto __pyx_L0; } - /* "yt/geometry/oct_container.pyx":306 + /* "yt/geometry/oct_container.pyx":244 * next = NULL * if oinfo == NULL: return cur * cdef int ncells = (1 << self.oref) # <<<<<<<<<<<<<< @@ -6567,7 +6098,7 @@ */ __pyx_v_ncells = (1 << __pyx_v_self->oref); - /* "yt/geometry/oct_container.pyx":307 + /* "yt/geometry/oct_container.pyx":245 * if oinfo == NULL: return cur * cdef int ncells = (1 << self.oref) * cdef np.float64_t factor = 1.0 / (1 << (self.oref-1)) # <<<<<<<<<<<<<< @@ -6576,7 +6107,7 @@ */ __pyx_v_factor = (1.0 / (1 << (__pyx_v_self->oref - 1))); - /* "yt/geometry/oct_container.pyx":308 + /* "yt/geometry/oct_container.pyx":246 * cdef int ncells = (1 << self.oref) * cdef np.float64_t factor = 1.0 / (1 << (self.oref-1)) * if self.oref == 0: factor = 2.0 # <<<<<<<<<<<<<< @@ -6588,7 +6119,7 @@ __pyx_v_factor = 2.0; } - /* "yt/geometry/oct_container.pyx":309 + /* "yt/geometry/oct_container.pyx":247 * cdef np.float64_t factor = 1.0 / (1 << (self.oref-1)) * if self.oref == 0: factor = 2.0 * for i in range(3): # <<<<<<<<<<<<<< @@ -6598,7 +6129,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":314 + /* "yt/geometry/oct_container.pyx":252 * # But, since not everything has the cell width equal to have the * # width of the oct, we need to apply "factor". * oinfo.dds[i] = dds[i] * factor # Cell width # <<<<<<<<<<<<<< @@ -6607,7 +6138,7 @@ */ (__pyx_v_oinfo->dds[__pyx_v_i]) = ((__pyx_v_dds[__pyx_v_i]) * __pyx_v_factor); - /* "yt/geometry/oct_container.pyx":315 + /* "yt/geometry/oct_container.pyx":253 * # width of the oct, we need to apply "factor". * oinfo.dds[i] = dds[i] * factor # Cell width * oinfo.ipos[i] = ipos[i] # <<<<<<<<<<<<<< @@ -6616,7 +6147,7 @@ */ (__pyx_v_oinfo->ipos[__pyx_v_i]) = (__pyx_v_ipos[__pyx_v_i]); - /* "yt/geometry/oct_container.pyx":316 + /* "yt/geometry/oct_container.pyx":254 * oinfo.dds[i] = dds[i] * factor # Cell width * oinfo.ipos[i] = ipos[i] * oinfo.left_edge[i] = oinfo.ipos[i] * (oinfo.dds[i] * ncells) + self.DLE[i] # <<<<<<<<<<<<<< @@ -6626,7 +6157,7 @@ (__pyx_v_oinfo->left_edge[__pyx_v_i]) = (((__pyx_v_oinfo->ipos[__pyx_v_i]) * ((__pyx_v_oinfo->dds[__pyx_v_i]) * __pyx_v_ncells)) + (__pyx_v_self->DLE[__pyx_v_i])); } - /* "yt/geometry/oct_container.pyx":317 + /* "yt/geometry/oct_container.pyx":255 * oinfo.ipos[i] = ipos[i] * oinfo.left_edge[i] = oinfo.ipos[i] * (oinfo.dds[i] * ncells) + self.DLE[i] * oinfo.level = level # <<<<<<<<<<<<<< @@ -6635,7 +6166,7 @@ */ __pyx_v_oinfo->level = __pyx_v_level; - /* "yt/geometry/oct_container.pyx":318 + /* "yt/geometry/oct_container.pyx":256 * oinfo.left_edge[i] = oinfo.ipos[i] * (oinfo.dds[i] * ncells) + self.DLE[i] * oinfo.level = level * return cur # <<<<<<<<<<<<<< @@ -6645,7 +6176,7 @@ __pyx_r = __pyx_v_cur; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":265 + /* "yt/geometry/oct_container.pyx":203 * @cython.wraparound(False) * @cython.cdivision(True) * cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = NULL, # <<<<<<<<<<<<<< @@ -6659,7 +6190,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":320 +/* "yt/geometry/oct_container.pyx":258 * return cur * * def locate_positions(self, np.float64_t[:,:] positions): # <<<<<<<<<<<<<< @@ -6668,15 +6199,15 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_12locate_positions(PyObject *__pyx_v_self, PyObject *__pyx_arg_positions); /*proto*/ -static char __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_11locate_positions[] = "\n This routine, meant to be called by other internal routines, returns a\n list of oct IDs and a dictionary of Oct info for all the positions\n supplied. Positions must be in code_length.\n "; -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_12locate_positions(PyObject *__pyx_v_self, PyObject *__pyx_arg_positions) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9locate_positions(PyObject *__pyx_v_self, PyObject *__pyx_arg_positions); /*proto*/ +static char __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_8locate_positions[] = "\n This routine, meant to be called by other internal routines, returns a\n list of oct IDs and a dictionary of Oct info for all the positions\n supplied. Positions must be in code_length.\n "; +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9locate_positions(PyObject *__pyx_v_self, PyObject *__pyx_arg_positions) { __Pyx_memviewslice __pyx_v_positions = { 0, 0, { 0 }, { 0 }, { 0 } }; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("locate_positions (wrapper)", 0); assert(__pyx_arg_positions); { - __pyx_v_positions = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_arg_positions); if (unlikely(!__pyx_v_positions.memview)) __PYX_ERR(0, 320, __pyx_L3_error) + __pyx_v_positions = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_arg_positions); if (unlikely(!__pyx_v_positions.memview)) __PYX_ERR(0, 258, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6684,14 +6215,14 @@ __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_11locate_positions(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_positions); + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_8locate_positions(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_positions); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_11locate_positions(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_positions) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_8locate_positions(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_positions) { __pyx_t_5numpy_float64_t __pyx_v_factor; PyObject *__pyx_v_all_octs = 0; struct __pyx_t_2yt_8geometry_13oct_container_OctInfo __pyx_v_oi; @@ -6744,7 +6275,7 @@ __pyx_pybuffernd_oct_id.data = NULL; __pyx_pybuffernd_oct_id.rcbuffer = &__pyx_pybuffer_oct_id; - /* "yt/geometry/oct_container.pyx":326 + /* "yt/geometry/oct_container.pyx":264 * supplied. Positions must be in code_length. * """ * cdef np.float64_t factor = (1 << self.oref) # <<<<<<<<<<<<<< @@ -6753,19 +6284,19 @@ */ __pyx_v_factor = (1 << __pyx_v_self->oref); - /* "yt/geometry/oct_container.pyx":327 + /* "yt/geometry/oct_container.pyx":265 * """ * cdef np.float64_t factor = (1 << self.oref) * cdef dict all_octs = {} # <<<<<<<<<<<<<< * cdef OctInfo oi * cdef Oct* o = NULL */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_all_octs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":329 + /* "yt/geometry/oct_container.pyx":267 * cdef dict all_octs = {} * cdef OctInfo oi * cdef Oct* o = NULL # <<<<<<<<<<<<<< @@ -6774,37 +6305,37 @@ */ __pyx_v_o = NULL; - /* "yt/geometry/oct_container.pyx":333 + /* "yt/geometry/oct_container.pyx":271 * cdef np.ndarray[np.uint8_t, ndim=1] recorded * cdef np.ndarray[np.int64_t, ndim=1] oct_id * oct_id = np.ones(positions.shape[0], dtype="int64") * -1 # <<<<<<<<<<<<<< * recorded = np.zeros(self.nocts, dtype="uint8") * cdef np.int64_t i, j, k */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_positions.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_positions.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 333, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_int_neg_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_int_neg_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 333, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 271, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6820,40 +6351,40 @@ } } __pyx_pybuffernd_oct_id.diminfo[0].strides = __pyx_pybuffernd_oct_id.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_oct_id.diminfo[0].shape = __pyx_pybuffernd_oct_id.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 271, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_oct_id = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":334 + /* "yt/geometry/oct_container.pyx":272 * cdef np.ndarray[np.int64_t, ndim=1] oct_id * oct_id = np.ones(positions.shape[0], dtype="int64") * -1 * recorded = np.zeros(self.nocts, dtype="uint8") # <<<<<<<<<<<<<< * cdef np.int64_t i, j, k * for i in range(positions.shape[0]): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nocts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nocts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 334, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 334, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 272, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6869,13 +6400,13 @@ } } __pyx_pybuffernd_recorded.diminfo[0].strides = __pyx_pybuffernd_recorded.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_recorded.diminfo[0].shape = __pyx_pybuffernd_recorded.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 334, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 272, __pyx_L1_error) } __pyx_t_10 = 0; __pyx_v_recorded = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":336 + /* "yt/geometry/oct_container.pyx":274 * recorded = np.zeros(self.nocts, dtype="uint8") * cdef np.int64_t i, j, k * for i in range(positions.shape[0]): # <<<<<<<<<<<<<< @@ -6886,7 +6417,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "yt/geometry/oct_container.pyx":337 + /* "yt/geometry/oct_container.pyx":275 * cdef np.int64_t i, j, k * for i in range(positions.shape[0]): * for j in range(3): # <<<<<<<<<<<<<< @@ -6896,7 +6427,7 @@ for (__pyx_t_13 = 0; __pyx_t_13 < 3; __pyx_t_13+=1) { __pyx_v_j = __pyx_t_13; - /* "yt/geometry/oct_container.pyx":338 + /* "yt/geometry/oct_container.pyx":276 * for i in range(positions.shape[0]): * for j in range(3): * pos[j] = positions[i,j] # <<<<<<<<<<<<<< @@ -6916,12 +6447,12 @@ } else if (unlikely(__pyx_t_15 >= __pyx_v_positions.shape[1])) __pyx_t_6 = 1; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 338, __pyx_L1_error) + __PYX_ERR(0, 276, __pyx_L1_error) } (__pyx_v_pos[__pyx_v_j]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_positions.data + __pyx_t_14 * __pyx_v_positions.strides[0]) ) + __pyx_t_15 * __pyx_v_positions.strides[1]) ))); } - /* "yt/geometry/oct_container.pyx":339 + /* "yt/geometry/oct_container.pyx":277 * for j in range(3): * pos[j] = positions[i,j] * o = self.get(pos, &oi) # <<<<<<<<<<<<<< @@ -6933,7 +6464,7 @@ __pyx_t_16 = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, __pyx_v_pos, &__pyx_t_17); __pyx_v_o = __pyx_t_16; - /* "yt/geometry/oct_container.pyx":340 + /* "yt/geometry/oct_container.pyx":278 * pos[j] = positions[i,j] * o = self.get(pos, &oi) * if o == NULL: # <<<<<<<<<<<<<< @@ -6943,7 +6474,7 @@ __pyx_t_18 = ((__pyx_v_o == NULL) != 0); if (__pyx_t_18) { - /* "yt/geometry/oct_container.pyx":341 + /* "yt/geometry/oct_container.pyx":279 * o = self.get(pos, &oi) * if o == NULL: * raise RuntimeError # <<<<<<<<<<<<<< @@ -6951,9 +6482,9 @@ * left_edge = np.asarray(oi.left_edge).copy() */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 341, __pyx_L1_error) + __PYX_ERR(0, 279, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":340 + /* "yt/geometry/oct_container.pyx":278 * pos[j] = positions[i,j] * o = self.get(pos, &oi) * if o == NULL: # <<<<<<<<<<<<<< @@ -6962,7 +6493,7 @@ */ } - /* "yt/geometry/oct_container.pyx":342 + /* "yt/geometry/oct_container.pyx":280 * if o == NULL: * raise RuntimeError * if recorded[o.domain_ind] == 0: # <<<<<<<<<<<<<< @@ -6977,35 +6508,35 @@ } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_recorded.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 342, __pyx_L1_error) + __PYX_ERR(0, 280, __pyx_L1_error) } __pyx_t_18 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_recorded.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_recorded.diminfo[0].strides)) == 0) != 0); if (__pyx_t_18) { - /* "yt/geometry/oct_container.pyx":343 + /* "yt/geometry/oct_container.pyx":281 * raise RuntimeError * if recorded[o.domain_ind] == 0: * left_edge = np.asarray(oi.left_edge).copy() # <<<<<<<<<<<<<< * dds = np.asarray(oi.dds).copy() * right_edge = left_edge + dds*factor */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_19 = __pyx_v_oi.left_edge; if (!__pyx_t_19) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 343, __pyx_L1_error) + __PYX_ERR(0, 281, __pyx_L1_error) } __pyx_t_21 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t); __pyx_t_3 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)3)); - if (unlikely(!__pyx_t_21 || !__pyx_t_3 || !PyBytes_AsString(__pyx_t_21))) __PYX_ERR(0, 343, __pyx_L1_error) + if (unlikely(!__pyx_t_21 || !__pyx_t_3 || !PyBytes_AsString(__pyx_t_21))) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_GOTREF(__pyx_t_3); __pyx_t_20 = __pyx_array_new(__pyx_t_3, sizeof(__pyx_t_5numpy_float64_t), PyBytes_AS_STRING(__pyx_t_21), (char *) "c", (char *) __pyx_t_19); - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 343, __pyx_L1_error) + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; @@ -7020,14 +6551,14 @@ } } if (!__pyx_t_21) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_21, ((PyObject *)__pyx_t_20)}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; @@ -7036,26 +6567,26 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_21, ((PyObject *)__pyx_t_20)}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_21); __pyx_t_21 = NULL; __Pyx_GIVEREF(((PyObject *)__pyx_t_20)); PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -7069,40 +6600,40 @@ } } if (__pyx_t_1) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_left_edge, __pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":344 + /* "yt/geometry/oct_container.pyx":282 * if recorded[o.domain_ind] == 0: * left_edge = np.asarray(oi.left_edge).copy() * dds = np.asarray(oi.dds).copy() # <<<<<<<<<<<<<< * right_edge = left_edge + dds*factor * all_octs[o.domain_ind] = dict( */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_19 = __pyx_v_oi.dds; if (!__pyx_t_19) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 344, __pyx_L1_error) + __PYX_ERR(0, 282, __pyx_L1_error) } __pyx_t_21 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t); __pyx_t_1 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)3)); - if (unlikely(!__pyx_t_21 || !__pyx_t_1 || !PyBytes_AsString(__pyx_t_21))) __PYX_ERR(0, 344, __pyx_L1_error) + if (unlikely(!__pyx_t_21 || !__pyx_t_1 || !PyBytes_AsString(__pyx_t_21))) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_GOTREF(__pyx_t_1); __pyx_t_20 = __pyx_array_new(__pyx_t_1, sizeof(__pyx_t_5numpy_float64_t), PyBytes_AS_STRING(__pyx_t_21), (char *) "c", (char *) __pyx_t_19); - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 344, __pyx_L1_error) + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; @@ -7117,14 +6648,14 @@ } } if (!__pyx_t_21) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_20)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_20)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_21, ((PyObject *)__pyx_t_20)}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; @@ -7133,26 +6664,26 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_21, ((PyObject *)__pyx_t_20)}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; } else #endif { - __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_21); __pyx_t_21 = NULL; __Pyx_GIVEREF(((PyObject *)__pyx_t_20)); PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -7166,80 +6697,80 @@ } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_dds, __pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":345 + /* "yt/geometry/oct_container.pyx":283 * left_edge = np.asarray(oi.left_edge).copy() * dds = np.asarray(oi.dds).copy() * right_edge = left_edge + dds*factor # <<<<<<<<<<<<<< * all_octs[o.domain_ind] = dict( * left_edge = left_edge, */ - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_dds, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_dds, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_v_left_edge, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_left_edge, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_right_edge, __pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":347 + /* "yt/geometry/oct_container.pyx":285 * right_edge = left_edge + dds*factor * all_octs[o.domain_ind] = dict( * left_edge = left_edge, # <<<<<<<<<<<<<< * right_edge = right_edge, * level = oi.level */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_left_edge, __pyx_v_left_edge) < 0) __PYX_ERR(0, 347, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_left_edge, __pyx_v_left_edge) < 0) __PYX_ERR(0, 285, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":348 + /* "yt/geometry/oct_container.pyx":286 * all_octs[o.domain_ind] = dict( * left_edge = left_edge, * right_edge = right_edge, # <<<<<<<<<<<<<< * level = oi.level * ) */ - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_right_edge, __pyx_v_right_edge) < 0) __PYX_ERR(0, 347, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_right_edge, __pyx_v_right_edge) < 0) __PYX_ERR(0, 285, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":349 + /* "yt/geometry/oct_container.pyx":287 * left_edge = left_edge, * right_edge = right_edge, * level = oi.level # <<<<<<<<<<<<<< * ) * recorded[o.domain_ind] = 1 */ - __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_oi.level); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_oi.level); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_t_3) < 0) __PYX_ERR(0, 347, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_t_3) < 0) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/oct_container.pyx":346 + /* "yt/geometry/oct_container.pyx":284 * dds = np.asarray(oi.dds).copy() * right_edge = left_edge + dds*factor * all_octs[o.domain_ind] = dict( # <<<<<<<<<<<<<< * left_edge = left_edge, * right_edge = right_edge, */ - __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_o->domain_ind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_o->domain_ind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_v_all_octs, __pyx_t_3, __pyx_t_2) < 0)) __PYX_ERR(0, 346, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_all_octs, __pyx_t_3, __pyx_t_2) < 0)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":351 + /* "yt/geometry/oct_container.pyx":289 * level = oi.level * ) * recorded[o.domain_ind] = 1 # <<<<<<<<<<<<<< @@ -7254,11 +6785,11 @@ } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_recorded.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 351, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_recorded.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_recorded.diminfo[0].strides) = 1; - /* "yt/geometry/oct_container.pyx":342 + /* "yt/geometry/oct_container.pyx":280 * if o == NULL: * raise RuntimeError * if recorded[o.domain_ind] == 0: # <<<<<<<<<<<<<< @@ -7267,7 +6798,7 @@ */ } - /* "yt/geometry/oct_container.pyx":352 + /* "yt/geometry/oct_container.pyx":290 * ) * recorded[o.domain_ind] = 1 * oct_id[i] = o.domain_ind # <<<<<<<<<<<<<< @@ -7283,12 +6814,12 @@ } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_oct_id.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 352, __pyx_L1_error) + __PYX_ERR(0, 290, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_oct_id.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_oct_id.diminfo[0].strides) = __pyx_t_23; } - /* "yt/geometry/oct_container.pyx":353 + /* "yt/geometry/oct_container.pyx":291 * recorded[o.domain_ind] = 1 * oct_id[i] = o.domain_ind * return oct_id, all_octs # <<<<<<<<<<<<<< @@ -7296,7 +6827,7 @@ * def domain_identify(self, SelectorObject selector): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_oct_id)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oct_id)); @@ -7308,7 +6839,7 @@ __pyx_t_2 = 0; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":320 + /* "yt/geometry/oct_container.pyx":258 * return cur * * def locate_positions(self, np.float64_t[:,:] positions): # <<<<<<<<<<<<<< @@ -7350,7 +6881,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":355 +/* "yt/geometry/oct_container.pyx":293 * return oct_id, all_octs * * def domain_identify(self, SelectorObject selector): # <<<<<<<<<<<<<< @@ -7359,13 +6890,13 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_14domain_identify(PyObject *__pyx_v_self, PyObject *__pyx_v_selector); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_14domain_identify(PyObject *__pyx_v_self, PyObject *__pyx_v_selector) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11domain_identify(PyObject *__pyx_v_self, PyObject *__pyx_v_selector); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11domain_identify(PyObject *__pyx_v_self, PyObject *__pyx_v_selector) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("domain_identify (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 355, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_13domain_identify(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector)); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10domain_identify(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector)); /* function exit code */ goto __pyx_L0; @@ -7376,7 +6907,7 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_13domain_identify(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10domain_identify(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector) { PyArrayObject *__pyx_v_domain_mask = 0; struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *__pyx_v_visitor = 0; int __pyx_v_i; @@ -7406,34 +6937,34 @@ __pyx_pybuffernd_domain_mask.data = NULL; __pyx_pybuffernd_domain_mask.rcbuffer = &__pyx_pybuffer_domain_mask; - /* "yt/geometry/oct_container.pyx":357 + /* "yt/geometry/oct_container.pyx":295 * def domain_identify(self, SelectorObject selector): * cdef np.ndarray[np.uint8_t, ndim=1] domain_mask * domain_mask = np.zeros(self.num_domains, dtype="uint8") # <<<<<<<<<<<<<< * cdef oct_visitors.IdentifyOcts visitor * visitor = oct_visitors.IdentifyOcts(self) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __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, 357, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __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_self->num_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 357, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __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_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, 357, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 295, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7449,31 +6980,31 @@ } } __pyx_pybuffernd_domain_mask.diminfo[0].strides = __pyx_pybuffernd_domain_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_mask.diminfo[0].shape = __pyx_pybuffernd_domain_mask.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 295, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_domain_mask = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/oct_container.pyx":359 + /* "yt/geometry/oct_container.pyx":297 * domain_mask = np.zeros(self.num_domains, dtype="uint8") * cdef oct_visitors.IdentifyOcts visitor * visitor = oct_visitors.IdentifyOcts(self) # <<<<<<<<<<<<<< * visitor.domain_mask = domain_mask * self.visit_all_octs(selector, visitor) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":360 + /* "yt/geometry/oct_container.pyx":298 * cdef oct_visitors.IdentifyOcts visitor * visitor = oct_visitors.IdentifyOcts(self) * visitor.domain_mask = domain_mask # <<<<<<<<<<<<<< @@ -7481,13 +7012,13 @@ * cdef int i */ __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_domain_mask)); - if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 360, __pyx_L1_error) + if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 298, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->domain_mask, 0); __pyx_v_visitor->domain_mask = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; - /* "yt/geometry/oct_container.pyx":361 + /* "yt/geometry/oct_container.pyx":299 * visitor = oct_visitors.IdentifyOcts(self) * visitor.domain_mask = domain_mask * self.visit_all_octs(selector, visitor) # <<<<<<<<<<<<<< @@ -7496,19 +7027,19 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL); - /* "yt/geometry/oct_container.pyx":363 + /* "yt/geometry/oct_container.pyx":301 * self.visit_all_octs(selector, visitor) * cdef int i * domain_ids = [] # <<<<<<<<<<<<<< * for i in range(self.num_domains): * if domain_mask[i] == 1: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_domain_ids = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":364 + /* "yt/geometry/oct_container.pyx":302 * cdef int i * domain_ids = [] * for i in range(self.num_domains): # <<<<<<<<<<<<<< @@ -7519,7 +7050,7 @@ for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_6; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "yt/geometry/oct_container.pyx":365 + /* "yt/geometry/oct_container.pyx":303 * domain_ids = [] * for i in range(self.num_domains): * if domain_mask[i] == 1: # <<<<<<<<<<<<<< @@ -7534,24 +7065,24 @@ } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_domain_mask.diminfo[0].shape)) __pyx_t_13 = 0; if (unlikely(__pyx_t_13 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_13); - __PYX_ERR(0, 365, __pyx_L1_error) + __PYX_ERR(0, 303, __pyx_L1_error) } __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_domain_mask.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_domain_mask.diminfo[0].strides)) == 1) != 0); if (__pyx_t_14) { - /* "yt/geometry/oct_container.pyx":366 + /* "yt/geometry/oct_container.pyx":304 * for i in range(self.num_domains): * if domain_mask[i] == 1: * domain_ids.append(i+1) # <<<<<<<<<<<<<< * return domain_ids * */ - __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_i + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_i + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_domain_ids, __pyx_t_1); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_domain_ids, __pyx_t_1); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":365 + /* "yt/geometry/oct_container.pyx":303 * domain_ids = [] * for i in range(self.num_domains): * if domain_mask[i] == 1: # <<<<<<<<<<<<<< @@ -7561,7 +7092,7 @@ } } - /* "yt/geometry/oct_container.pyx":367 + /* "yt/geometry/oct_container.pyx":305 * if domain_mask[i] == 1: * domain_ids.append(i+1) * return domain_ids # <<<<<<<<<<<<<< @@ -7573,7 +7104,7 @@ __pyx_r = __pyx_v_domain_ids; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":355 + /* "yt/geometry/oct_container.pyx":293 * return oct_id, all_octs * * def domain_identify(self, SelectorObject selector): # <<<<<<<<<<<<<< @@ -7608,7 +7139,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":372 +/* "yt/geometry/oct_container.pyx":310 * @cython.wraparound(False) * @cython.cdivision(True) * cdef Oct** neighbors(self, OctInfo *oi, np.int64_t *nneighbors, Oct *o, # <<<<<<<<<<<<<< @@ -7650,7 +7181,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_t_12; __Pyx_RefNannySetupContext("neighbors", 0); - /* "yt/geometry/oct_container.pyx":375 + /* "yt/geometry/oct_container.pyx":313 * bint periodicity[3]): * cdef Oct* candidate * nn = 0 # <<<<<<<<<<<<<< @@ -7659,7 +7190,7 @@ */ __pyx_v_nn = 0; - /* "yt/geometry/oct_container.pyx":382 + /* "yt/geometry/oct_container.pyx":320 * # Note that in the first iteration, we will just find the up-to-27 * # neighbors, including the main oct. * cdef np.int64_t i, j, k, n, level, ii, nfound = 0, dlevel # <<<<<<<<<<<<<< @@ -7668,7 +7199,7 @@ */ __pyx_v_nfound = 0; - /* "yt/geometry/oct_container.pyx":386 + /* "yt/geometry/oct_container.pyx":324 * cdef OctList *olist * cdef OctList *my_list * my_list = olist = NULL # <<<<<<<<<<<<<< @@ -7678,7 +7209,7 @@ __pyx_v_my_list = NULL; __pyx_v_olist = NULL; - /* "yt/geometry/oct_container.pyx":393 + /* "yt/geometry/oct_container.pyx":331 * # if need be. * # ndim is the oct dimensions of the level, not the cell dimensions. * for i in range(3): # <<<<<<<<<<<<<< @@ -7688,7 +7219,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":394 + /* "yt/geometry/oct_container.pyx":332 * # ndim is the oct dimensions of the level, not the cell dimensions. * for i in range(3): * ndim[i] = ((self.DRE[i] - self.DLE[i]) / oi.dds[i]) # <<<<<<<<<<<<<< @@ -7697,7 +7228,7 @@ */ (__pyx_v_ndim[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t)(((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_oi->dds[__pyx_v_i]))); - /* "yt/geometry/oct_container.pyx":396 + /* "yt/geometry/oct_container.pyx":334 * ndim[i] = ((self.DRE[i] - self.DLE[i]) / oi.dds[i]) * # Here we adjust for oi.dds meaning *cell* width. * ndim[i] = (ndim[i] >> self.oref) # <<<<<<<<<<<<<< @@ -7707,7 +7238,7 @@ (__pyx_v_ndim[__pyx_v_i]) = ((__pyx_v_ndim[__pyx_v_i]) >> __pyx_v_self->oref); } - /* "yt/geometry/oct_container.pyx":397 + /* "yt/geometry/oct_container.pyx":335 * # Here we adjust for oi.dds meaning *cell* width. * ndim[i] = (ndim[i] >> self.oref) * my_list = olist = OctList_append(NULL, o) # <<<<<<<<<<<<<< @@ -7718,7 +7249,7 @@ __pyx_v_my_list = __pyx_t_2; __pyx_v_olist = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":398 + /* "yt/geometry/oct_container.pyx":336 * ndim[i] = (ndim[i] >> self.oref) * my_list = olist = OctList_append(NULL, o) * for i in range(3): # <<<<<<<<<<<<<< @@ -7728,7 +7259,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":399 + /* "yt/geometry/oct_container.pyx":337 * my_list = olist = OctList_append(NULL, o) * for i in range(3): * npos[0] = (oi.ipos[0] + (1 - i)) # <<<<<<<<<<<<<< @@ -7737,7 +7268,7 @@ */ (__pyx_v_npos[0]) = ((__pyx_v_oi->ipos[0]) + (1 - __pyx_v_i)); - /* "yt/geometry/oct_container.pyx":400 + /* "yt/geometry/oct_container.pyx":338 * for i in range(3): * npos[0] = (oi.ipos[0] + (1 - i)) * if not periodicity[0] and not \ # <<<<<<<<<<<<<< @@ -7751,7 +7282,7 @@ goto __pyx_L8_bool_binop_done; } - /* "yt/geometry/oct_container.pyx":401 + /* "yt/geometry/oct_container.pyx":339 * npos[0] = (oi.ipos[0] + (1 - i)) * if not periodicity[0] and not \ * (0 <= npos[0] < ndim[0]): # <<<<<<<<<<<<<< @@ -7763,7 +7294,7 @@ __pyx_t_4 = ((__pyx_v_npos[0]) < (__pyx_v_ndim[0])); } - /* "yt/geometry/oct_container.pyx":400 + /* "yt/geometry/oct_container.pyx":338 * for i in range(3): * npos[0] = (oi.ipos[0] + (1 - i)) * if not periodicity[0] and not \ # <<<<<<<<<<<<<< @@ -7775,7 +7306,7 @@ __pyx_L8_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/oct_container.pyx":402 + /* "yt/geometry/oct_container.pyx":340 * if not periodicity[0] and not \ * (0 <= npos[0] < ndim[0]): * continue # <<<<<<<<<<<<<< @@ -7784,7 +7315,7 @@ */ goto __pyx_L5_continue; - /* "yt/geometry/oct_container.pyx":400 + /* "yt/geometry/oct_container.pyx":338 * for i in range(3): * npos[0] = (oi.ipos[0] + (1 - i)) * if not periodicity[0] and not \ # <<<<<<<<<<<<<< @@ -7793,7 +7324,7 @@ */ } - /* "yt/geometry/oct_container.pyx":403 + /* "yt/geometry/oct_container.pyx":341 * (0 <= npos[0] < ndim[0]): * continue * elif npos[0] < 0: npos[0] += ndim[0] # <<<<<<<<<<<<<< @@ -7807,7 +7338,7 @@ goto __pyx_L7; } - /* "yt/geometry/oct_container.pyx":404 + /* "yt/geometry/oct_container.pyx":342 * continue * elif npos[0] < 0: npos[0] += ndim[0] * elif npos[0] >= ndim[0]: npos[0] -= ndim[0] # <<<<<<<<<<<<<< @@ -7821,7 +7352,7 @@ } __pyx_L7:; - /* "yt/geometry/oct_container.pyx":405 + /* "yt/geometry/oct_container.pyx":343 * elif npos[0] < 0: npos[0] += ndim[0] * elif npos[0] >= ndim[0]: npos[0] -= ndim[0] * for j in range(3): # <<<<<<<<<<<<<< @@ -7831,7 +7362,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) { __pyx_v_j = __pyx_t_7; - /* "yt/geometry/oct_container.pyx":406 + /* "yt/geometry/oct_container.pyx":344 * elif npos[0] >= ndim[0]: npos[0] -= ndim[0] * for j in range(3): * npos[1] = (oi.ipos[1] + (1 - j)) # <<<<<<<<<<<<<< @@ -7840,7 +7371,7 @@ */ (__pyx_v_npos[1]) = ((__pyx_v_oi->ipos[1]) + (1 - __pyx_v_j)); - /* "yt/geometry/oct_container.pyx":407 + /* "yt/geometry/oct_container.pyx":345 * for j in range(3): * npos[1] = (oi.ipos[1] + (1 - j)) * if not periodicity[1] and not \ # <<<<<<<<<<<<<< @@ -7854,7 +7385,7 @@ goto __pyx_L13_bool_binop_done; } - /* "yt/geometry/oct_container.pyx":408 + /* "yt/geometry/oct_container.pyx":346 * npos[1] = (oi.ipos[1] + (1 - j)) * if not periodicity[1] and not \ * (0 <= npos[1] < ndim[1]): # <<<<<<<<<<<<<< @@ -7866,7 +7397,7 @@ __pyx_t_5 = ((__pyx_v_npos[1]) < (__pyx_v_ndim[1])); } - /* "yt/geometry/oct_container.pyx":407 + /* "yt/geometry/oct_container.pyx":345 * for j in range(3): * npos[1] = (oi.ipos[1] + (1 - j)) * if not periodicity[1] and not \ # <<<<<<<<<<<<<< @@ -7878,7 +7409,7 @@ __pyx_L13_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/oct_container.pyx":409 + /* "yt/geometry/oct_container.pyx":347 * if not periodicity[1] and not \ * (0 <= npos[1] < ndim[1]): * continue # <<<<<<<<<<<<<< @@ -7887,7 +7418,7 @@ */ goto __pyx_L10_continue; - /* "yt/geometry/oct_container.pyx":407 + /* "yt/geometry/oct_container.pyx":345 * for j in range(3): * npos[1] = (oi.ipos[1] + (1 - j)) * if not periodicity[1] and not \ # <<<<<<<<<<<<<< @@ -7896,7 +7427,7 @@ */ } - /* "yt/geometry/oct_container.pyx":410 + /* "yt/geometry/oct_container.pyx":348 * (0 <= npos[1] < ndim[1]): * continue * elif npos[1] < 0: npos[1] += ndim[1] # <<<<<<<<<<<<<< @@ -7910,7 +7441,7 @@ goto __pyx_L12; } - /* "yt/geometry/oct_container.pyx":411 + /* "yt/geometry/oct_container.pyx":349 * continue * elif npos[1] < 0: npos[1] += ndim[1] * elif npos[1] >= ndim[1]: npos[1] -= ndim[1] # <<<<<<<<<<<<<< @@ -7924,7 +7455,7 @@ } __pyx_L12:; - /* "yt/geometry/oct_container.pyx":412 + /* "yt/geometry/oct_container.pyx":350 * elif npos[1] < 0: npos[1] += ndim[1] * elif npos[1] >= ndim[1]: npos[1] -= ndim[1] * for k in range(3): # <<<<<<<<<<<<<< @@ -7934,7 +7465,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < 3; __pyx_t_8+=1) { __pyx_v_k = __pyx_t_8; - /* "yt/geometry/oct_container.pyx":413 + /* "yt/geometry/oct_container.pyx":351 * elif npos[1] >= ndim[1]: npos[1] -= ndim[1] * for k in range(3): * npos[2] = (oi.ipos[2] + (1 - k)) # <<<<<<<<<<<<<< @@ -7943,7 +7474,7 @@ */ (__pyx_v_npos[2]) = ((__pyx_v_oi->ipos[2]) + (1 - __pyx_v_k)); - /* "yt/geometry/oct_container.pyx":414 + /* "yt/geometry/oct_container.pyx":352 * for k in range(3): * npos[2] = (oi.ipos[2] + (1 - k)) * if not periodicity[2] and not \ # <<<<<<<<<<<<<< @@ -7957,7 +7488,7 @@ goto __pyx_L18_bool_binop_done; } - /* "yt/geometry/oct_container.pyx":415 + /* "yt/geometry/oct_container.pyx":353 * npos[2] = (oi.ipos[2] + (1 - k)) * if not periodicity[2] and not \ * (0 <= npos[2] < ndim[2]): # <<<<<<<<<<<<<< @@ -7969,7 +7500,7 @@ __pyx_t_4 = ((__pyx_v_npos[2]) < (__pyx_v_ndim[2])); } - /* "yt/geometry/oct_container.pyx":414 + /* "yt/geometry/oct_container.pyx":352 * for k in range(3): * npos[2] = (oi.ipos[2] + (1 - k)) * if not periodicity[2] and not \ # <<<<<<<<<<<<<< @@ -7981,7 +7512,7 @@ __pyx_L18_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/oct_container.pyx":416 + /* "yt/geometry/oct_container.pyx":354 * if not periodicity[2] and not \ * (0 <= npos[2] < ndim[2]): * continue # <<<<<<<<<<<<<< @@ -7990,7 +7521,7 @@ */ goto __pyx_L15_continue; - /* "yt/geometry/oct_container.pyx":414 + /* "yt/geometry/oct_container.pyx":352 * for k in range(3): * npos[2] = (oi.ipos[2] + (1 - k)) * if not periodicity[2] and not \ # <<<<<<<<<<<<<< @@ -7999,7 +7530,7 @@ */ } - /* "yt/geometry/oct_container.pyx":417 + /* "yt/geometry/oct_container.pyx":355 * (0 <= npos[2] < ndim[2]): * continue * if npos[2] < 0: npos[2] += ndim[2] # <<<<<<<<<<<<<< @@ -8012,7 +7543,7 @@ (__pyx_v_npos[__pyx_t_6]) = ((__pyx_v_npos[__pyx_t_6]) + (__pyx_v_ndim[2])); } - /* "yt/geometry/oct_container.pyx":418 + /* "yt/geometry/oct_container.pyx":356 * continue * if npos[2] < 0: npos[2] += ndim[2] * if npos[2] >= ndim[2]: npos[2] -= ndim[2] # <<<<<<<<<<<<<< @@ -8025,7 +7556,7 @@ (__pyx_v_npos[__pyx_t_6]) = ((__pyx_v_npos[__pyx_t_6]) - (__pyx_v_ndim[2])); } - /* "yt/geometry/oct_container.pyx":421 + /* "yt/geometry/oct_container.pyx":359 * # Now we have our npos, which we just need to find. * # Level 0 gets bootstrapped * for n in range(3): # <<<<<<<<<<<<<< @@ -8035,7 +7566,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < 3; __pyx_t_9+=1) { __pyx_v_n = __pyx_t_9; - /* "yt/geometry/oct_container.pyx":422 + /* "yt/geometry/oct_container.pyx":360 * # Level 0 gets bootstrapped * for n in range(3): * ind[n] = ((npos[n] >> (oi.level)) & 1) # <<<<<<<<<<<<<< @@ -8045,7 +7576,7 @@ (__pyx_v_ind[__pyx_v_n]) = (((__pyx_v_npos[__pyx_v_n]) >> __pyx_v_oi->level) & 1); } - /* "yt/geometry/oct_container.pyx":423 + /* "yt/geometry/oct_container.pyx":361 * for n in range(3): * ind[n] = ((npos[n] >> (oi.level)) & 1) * cand = NULL # <<<<<<<<<<<<<< @@ -8054,7 +7585,7 @@ */ __pyx_v_cand = NULL; - /* "yt/geometry/oct_container.pyx":424 + /* "yt/geometry/oct_container.pyx":362 * ind[n] = ((npos[n] >> (oi.level)) & 1) * cand = NULL * self.get_root(ind, &cand) # <<<<<<<<<<<<<< @@ -8063,7 +7594,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->get_root(__pyx_v_self, __pyx_v_ind, (&__pyx_v_cand)); - /* "yt/geometry/oct_container.pyx":427 + /* "yt/geometry/oct_container.pyx":365 * # We should not get a NULL if we handle periodicity * # correctly, but we might. * if cand == NULL: continue # <<<<<<<<<<<<<< @@ -8075,7 +7606,7 @@ goto __pyx_L15_continue; } - /* "yt/geometry/oct_container.pyx":428 + /* "yt/geometry/oct_container.pyx":366 * # correctly, but we might. * if cand == NULL: continue * for level in range(1, oi.level+1): # <<<<<<<<<<<<<< @@ -8086,7 +7617,7 @@ for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) { __pyx_v_level = __pyx_t_9; - /* "yt/geometry/oct_container.pyx":429 + /* "yt/geometry/oct_container.pyx":367 * if cand == NULL: continue * for level in range(1, oi.level+1): * dlevel = oi.level - level # <<<<<<<<<<<<<< @@ -8095,7 +7626,7 @@ */ __pyx_v_dlevel = (__pyx_v_oi->level - __pyx_v_level); - /* "yt/geometry/oct_container.pyx":430 + /* "yt/geometry/oct_container.pyx":368 * for level in range(1, oi.level+1): * dlevel = oi.level - level * if cand.children == NULL: break # <<<<<<<<<<<<<< @@ -8107,7 +7638,7 @@ goto __pyx_L26_break; } - /* "yt/geometry/oct_container.pyx":431 + /* "yt/geometry/oct_container.pyx":369 * dlevel = oi.level - level * if cand.children == NULL: break * for n in range(3): # <<<<<<<<<<<<<< @@ -8117,7 +7648,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { __pyx_v_n = __pyx_t_10; - /* "yt/geometry/oct_container.pyx":432 + /* "yt/geometry/oct_container.pyx":370 * if cand.children == NULL: break * for n in range(3): * ind[n] = (npos[n] >> dlevel) & 1 # <<<<<<<<<<<<<< @@ -8127,7 +7658,7 @@ (__pyx_v_ind[__pyx_v_n]) = (((__pyx_v_npos[__pyx_v_n]) >> __pyx_v_dlevel) & 1); } - /* "yt/geometry/oct_container.pyx":433 + /* "yt/geometry/oct_container.pyx":371 * for n in range(3): * ind[n] = (npos[n] >> dlevel) & 1 * ii = cind(ind[0],ind[1],ind[2]) # <<<<<<<<<<<<<< @@ -8136,7 +7667,7 @@ */ __pyx_v_ii = __pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_ind[0]), (__pyx_v_ind[1]), (__pyx_v_ind[2])); - /* "yt/geometry/oct_container.pyx":434 + /* "yt/geometry/oct_container.pyx":372 * ind[n] = (npos[n] >> dlevel) & 1 * ii = cind(ind[0],ind[1],ind[2]) * if cand.children[ii] == NULL: break # <<<<<<<<<<<<<< @@ -8148,7 +7679,7 @@ goto __pyx_L26_break; } - /* "yt/geometry/oct_container.pyx":435 + /* "yt/geometry/oct_container.pyx":373 * ii = cind(ind[0],ind[1],ind[2]) * if cand.children[ii] == NULL: break * cand = cand.children[ii] # <<<<<<<<<<<<<< @@ -8159,7 +7690,7 @@ } __pyx_L26_break:; - /* "yt/geometry/oct_container.pyx":436 + /* "yt/geometry/oct_container.pyx":374 * if cand.children[ii] == NULL: break * cand = cand.children[ii] * if cand.children != NULL: # <<<<<<<<<<<<<< @@ -8169,7 +7700,7 @@ __pyx_t_3 = ((__pyx_v_cand->children != NULL) != 0); if (__pyx_t_3) { - /* "yt/geometry/oct_container.pyx":437 + /* "yt/geometry/oct_container.pyx":375 * cand = cand.children[ii] * if cand.children != NULL: * olist = OctList_subneighbor_find( # <<<<<<<<<<<<<< @@ -8178,7 +7709,7 @@ */ __pyx_v_olist = __pyx_f_2yt_8geometry_13oct_container_OctList_subneighbor_find(__pyx_v_olist, __pyx_v_cand, __pyx_v_i, __pyx_v_j, __pyx_v_k); - /* "yt/geometry/oct_container.pyx":436 + /* "yt/geometry/oct_container.pyx":374 * if cand.children[ii] == NULL: break * cand = cand.children[ii] * if cand.children != NULL: # <<<<<<<<<<<<<< @@ -8188,7 +7719,7 @@ goto __pyx_L31; } - /* "yt/geometry/oct_container.pyx":440 + /* "yt/geometry/oct_container.pyx":378 * olist, cand, i, j, k) * else: * olist = OctList_append(olist, cand) # <<<<<<<<<<<<<< @@ -8206,7 +7737,7 @@ __pyx_L5_continue:; } - /* "yt/geometry/oct_container.pyx":441 + /* "yt/geometry/oct_container.pyx":379 * else: * olist = OctList_append(olist, cand) * olist = my_list # <<<<<<<<<<<<<< @@ -8215,7 +7746,7 @@ */ __pyx_v_olist = __pyx_v_my_list; - /* "yt/geometry/oct_container.pyx":442 + /* "yt/geometry/oct_container.pyx":380 * olist = OctList_append(olist, cand) * olist = my_list * cdef int noct = OctList_count(olist) # <<<<<<<<<<<<<< @@ -8224,7 +7755,7 @@ */ __pyx_v_noct = __pyx_f_2yt_8geometry_13oct_container_OctList_count(__pyx_v_olist); - /* "yt/geometry/oct_container.pyx":444 + /* "yt/geometry/oct_container.pyx":382 * cdef int noct = OctList_count(olist) * cdef Oct **neighbors * neighbors = malloc(sizeof(Oct*)*noct) # <<<<<<<<<<<<<< @@ -8233,7 +7764,7 @@ */ __pyx_v_neighbors = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **)malloc(((sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)) * __pyx_v_noct))); - /* "yt/geometry/oct_container.pyx":445 + /* "yt/geometry/oct_container.pyx":383 * cdef Oct **neighbors * neighbors = malloc(sizeof(Oct*)*noct) * for i in range(noct): # <<<<<<<<<<<<<< @@ -8244,7 +7775,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_11; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":446 + /* "yt/geometry/oct_container.pyx":384 * neighbors = malloc(sizeof(Oct*)*noct) * for i in range(noct): * neighbors[i] = olist.o # <<<<<<<<<<<<<< @@ -8254,7 +7785,7 @@ __pyx_t_12 = __pyx_v_olist->o; (__pyx_v_neighbors[__pyx_v_i]) = __pyx_t_12; - /* "yt/geometry/oct_container.pyx":447 + /* "yt/geometry/oct_container.pyx":385 * for i in range(noct): * neighbors[i] = olist.o * olist = olist.next # <<<<<<<<<<<<<< @@ -8265,7 +7796,7 @@ __pyx_v_olist = __pyx_t_2; } - /* "yt/geometry/oct_container.pyx":448 + /* "yt/geometry/oct_container.pyx":386 * neighbors[i] = olist.o * olist = olist.next * OctList_delete(my_list) # <<<<<<<<<<<<<< @@ -8274,7 +7805,7 @@ */ __pyx_f_2yt_8geometry_13oct_container_OctList_delete(__pyx_v_my_list); - /* "yt/geometry/oct_container.pyx":449 + /* "yt/geometry/oct_container.pyx":387 * olist = olist.next * OctList_delete(my_list) * nneighbors[0] = noct # <<<<<<<<<<<<<< @@ -8283,7 +7814,7 @@ */ (__pyx_v_nneighbors[0]) = __pyx_v_noct; - /* "yt/geometry/oct_container.pyx":450 + /* "yt/geometry/oct_container.pyx":388 * OctList_delete(my_list) * nneighbors[0] = noct * return neighbors # <<<<<<<<<<<<<< @@ -8293,7 +7824,7 @@ __pyx_r = __pyx_v_neighbors; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":372 + /* "yt/geometry/oct_container.pyx":310 * @cython.wraparound(False) * @cython.cdivision(True) * cdef Oct** neighbors(self, OctInfo *oi, np.int64_t *nneighbors, Oct *o, # <<<<<<<<<<<<<< @@ -8307,7 +7838,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":455 +/* "yt/geometry/oct_container.pyx":393 * @cython.wraparound(False) * @cython.cdivision(True) * def mask(self, SelectorObject selector, np.int64_t num_cells = -1, # <<<<<<<<<<<<<< @@ -8316,8 +7847,8 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_16mask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_16mask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_13mask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_13mask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0; __pyx_t_5numpy_int64_t __pyx_v_num_cells; int __pyx_v_domain_id; @@ -8332,8 +7863,11 @@ 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; } @@ -8342,11 +7876,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells); if (value) { values[1] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -8354,12 +7890,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mask") < 0)) __PYX_ERR(0, 455, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mask") < 0)) __PYX_ERR(0, 393, __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); + CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -8367,26 +7905,26 @@ } __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]); if (values[1]) { - __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L3_error) + __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L3_error) } else { __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1LL); } if (values[2]) { - __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error) + __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L3_error) } else { __pyx_v_domain_id = ((int)-1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("mask", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 455, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mask", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 393, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.mask", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_15mask(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_12mask(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id); /* function exit code */ goto __pyx_L0; @@ -8397,7 +7935,7 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_15mask(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_12mask(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) { PyArrayObject *__pyx_v_mask = 0; struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_v_visitor = 0; int __pyx_v_ns; @@ -8425,7 +7963,7 @@ __pyx_pybuffernd_mask.data = NULL; __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; - /* "yt/geometry/oct_container.pyx":457 + /* "yt/geometry/oct_container.pyx":395 * def mask(self, SelectorObject selector, np.int64_t num_cells = -1, * int domain_id = -1): * if num_cells == -1: # <<<<<<<<<<<<<< @@ -8435,16 +7973,16 @@ __pyx_t_1 = ((__pyx_v_num_cells == -1LL) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":458 + /* "yt/geometry/oct_container.pyx":396 * int domain_id = -1): * if num_cells == -1: * num_cells = selector.count_octs(self, domain_id) # <<<<<<<<<<<<<< * cdef np.ndarray[np.uint8_t, ndim=4] mask * cdef oct_visitors.MaskOcts visitor */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_octs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_octs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -8461,7 +7999,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4}; - __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, 458, __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, 396, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -8470,14 +8008,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4}; - __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, 458, __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, 396, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -8488,16 +8026,16 @@ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __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; - __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_num_cells = __pyx_t_8; - /* "yt/geometry/oct_container.pyx":457 + /* "yt/geometry/oct_container.pyx":395 * def mask(self, SelectorObject selector, np.int64_t num_cells = -1, * int domain_id = -1): * if num_cells == -1: # <<<<<<<<<<<<<< @@ -8506,16 +8044,16 @@ */ } - /* "yt/geometry/oct_container.pyx":461 + /* "yt/geometry/oct_container.pyx":399 * cdef np.ndarray[np.uint8_t, ndim=4] mask * cdef oct_visitors.MaskOcts visitor * visitor = oct_visitors.MaskOcts(self, domain_id) # <<<<<<<<<<<<<< * cdef int ns = 1 << self.oref * mask = np.zeros((num_cells, ns, ns, ns), dtype="uint8") */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -8523,13 +8061,13 @@ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":462 + /* "yt/geometry/oct_container.pyx":400 * cdef oct_visitors.MaskOcts visitor * visitor = oct_visitors.MaskOcts(self, domain_id) * cdef int ns = 1 << self.oref # <<<<<<<<<<<<<< @@ -8538,27 +8076,27 @@ */ __pyx_v_ns = (1 << __pyx_v_self->oref); - /* "yt/geometry/oct_container.pyx":463 + /* "yt/geometry/oct_container.pyx":401 * visitor = oct_visitors.MaskOcts(self, domain_id) * cdef int ns = 1 << self.oref * mask = np.zeros((num_cells, ns, ns, ns), dtype="uint8") # <<<<<<<<<<<<<< * visitor.mask = mask * self.visit_all_octs(selector, visitor) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); @@ -8572,20 +8110,20 @@ __pyx_t_7 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 463, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __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_9); __pyx_t_9 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 463, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 401, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -8601,13 +8139,13 @@ } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_mask.diminfo[3].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_mask.diminfo[3].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[3]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 463, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 401, __pyx_L1_error) } __pyx_t_10 = 0; __pyx_v_mask = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/oct_container.pyx":464 + /* "yt/geometry/oct_container.pyx":402 * cdef int ns = 1 << self.oref * mask = np.zeros((num_cells, ns, ns, ns), dtype="uint8") * visitor.mask = mask # <<<<<<<<<<<<<< @@ -8615,13 +8153,13 @@ * return mask.astype("bool") */ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_mask)); - if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 464, __pyx_L1_error) + if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 402, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->mask, 0); __pyx_v_visitor->mask = __pyx_t_14; __pyx_t_14.memview = NULL; __pyx_t_14.data = NULL; - /* "yt/geometry/oct_container.pyx":465 + /* "yt/geometry/oct_container.pyx":403 * mask = np.zeros((num_cells, ns, ns, ns), dtype="uint8") * visitor.mask = mask * self.visit_all_octs(selector, visitor) # <<<<<<<<<<<<<< @@ -8630,7 +8168,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL); - /* "yt/geometry/oct_container.pyx":466 + /* "yt/geometry/oct_container.pyx":404 * visitor.mask = mask * self.visit_all_octs(selector, visitor) * return mask.astype("bool") # <<<<<<<<<<<<<< @@ -8638,16 +8176,16 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":455 + /* "yt/geometry/oct_container.pyx":393 * @cython.wraparound(False) * @cython.cdivision(True) * def mask(self, SelectorObject selector, np.int64_t num_cells = -1, # <<<<<<<<<<<<<< @@ -8683,7 +8221,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":471 +/* "yt/geometry/oct_container.pyx":409 * @cython.wraparound(False) * @cython.cdivision(True) * def icoords(self, SelectorObject selector, np.int64_t num_cells = -1, # <<<<<<<<<<<<<< @@ -8692,8 +8230,8 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_18icoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_18icoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_15icoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_15icoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0; __pyx_t_5numpy_int64_t __pyx_v_num_cells; int __pyx_v_domain_id; @@ -8708,8 +8246,11 @@ 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; } @@ -8718,11 +8259,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells); if (value) { values[1] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -8730,12 +8273,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "icoords") < 0)) __PYX_ERR(0, 471, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "icoords") < 0)) __PYX_ERR(0, 409, __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); + CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -8743,26 +8288,26 @@ } __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]); if (values[1]) { - __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L3_error) + __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L3_error) } else { __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1LL); } if (values[2]) { - __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L3_error) + __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L3_error) } else { __pyx_v_domain_id = ((int)-1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("icoords", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 471, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("icoords", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 409, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.icoords", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 471, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_17icoords(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 409, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_14icoords(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id); /* function exit code */ goto __pyx_L0; @@ -8773,7 +8318,7 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_17icoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_14icoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) { struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *__pyx_v_visitor = 0; PyArrayObject *__pyx_v_coords = 0; __Pyx_LocalBuf_ND __pyx_pybuffernd_coords; @@ -8799,7 +8344,7 @@ __pyx_pybuffernd_coords.data = NULL; __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords; - /* "yt/geometry/oct_container.pyx":473 + /* "yt/geometry/oct_container.pyx":411 * def icoords(self, SelectorObject selector, np.int64_t num_cells = -1, * int domain_id = -1): * if num_cells == -1: # <<<<<<<<<<<<<< @@ -8809,16 +8354,16 @@ __pyx_t_1 = ((__pyx_v_num_cells == -1LL) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":474 + /* "yt/geometry/oct_container.pyx":412 * int domain_id = -1): * if num_cells == -1: * num_cells = selector.count_oct_cells(self, domain_id) # <<<<<<<<<<<<<< * cdef oct_visitors.ICoordsOcts visitor * visitor = oct_visitors.ICoordsOcts(self, domain_id) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -8835,7 +8380,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4}; - __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, 474, __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, 412, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -8844,14 +8389,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4}; - __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, 474, __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, 412, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -8862,16 +8407,16 @@ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __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; - __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_num_cells = __pyx_t_8; - /* "yt/geometry/oct_container.pyx":473 + /* "yt/geometry/oct_container.pyx":411 * def icoords(self, SelectorObject selector, np.int64_t num_cells = -1, * int domain_id = -1): * if num_cells == -1: # <<<<<<<<<<<<<< @@ -8880,16 +8425,16 @@ */ } - /* "yt/geometry/oct_container.pyx":476 + /* "yt/geometry/oct_container.pyx":414 * num_cells = selector.count_oct_cells(self, domain_id) * cdef oct_visitors.ICoordsOcts visitor * visitor = oct_visitors.ICoordsOcts(self, domain_id) # <<<<<<<<<<<<<< * cdef np.ndarray[np.int64_t, ndim=2] coords * coords = np.empty((num_cells, 3), dtype="int64") */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -8897,27 +8442,27 @@ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":478 + /* "yt/geometry/oct_container.pyx":416 * visitor = oct_visitors.ICoordsOcts(self, domain_id) * cdef np.ndarray[np.int64_t, ndim=2] coords * coords = np.empty((num_cells, 3), dtype="int64") # <<<<<<<<<<<<<< * visitor.icoords = coords * self.visit_all_octs(selector, visitor) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); @@ -8925,20 +8470,20 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_3); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __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 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 478, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __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_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 478, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 416, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -8954,13 +8499,13 @@ } } __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 478, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 416, __pyx_L1_error) } __pyx_t_9 = 0; __pyx_v_coords = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/oct_container.pyx":479 + /* "yt/geometry/oct_container.pyx":417 * cdef np.ndarray[np.int64_t, ndim=2] coords * coords = np.empty((num_cells, 3), dtype="int64") * visitor.icoords = coords # <<<<<<<<<<<<<< @@ -8968,13 +8513,13 @@ * return coords */ __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_coords)); - if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 479, __pyx_L1_error) + if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 417, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->icoords, 0); __pyx_v_visitor->icoords = __pyx_t_13; __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; - /* "yt/geometry/oct_container.pyx":480 + /* "yt/geometry/oct_container.pyx":418 * coords = np.empty((num_cells, 3), dtype="int64") * visitor.icoords = coords * self.visit_all_octs(selector, visitor) # <<<<<<<<<<<<<< @@ -8983,7 +8528,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL); - /* "yt/geometry/oct_container.pyx":481 + /* "yt/geometry/oct_container.pyx":419 * visitor.icoords = coords * self.visit_all_octs(selector, visitor) * return coords # <<<<<<<<<<<<<< @@ -8995,7 +8540,7 @@ __pyx_r = ((PyObject *)__pyx_v_coords); goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":471 + /* "yt/geometry/oct_container.pyx":409 * @cython.wraparound(False) * @cython.cdivision(True) * def icoords(self, SelectorObject selector, np.int64_t num_cells = -1, # <<<<<<<<<<<<<< @@ -9030,7 +8575,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":486 +/* "yt/geometry/oct_container.pyx":424 * @cython.wraparound(False) * @cython.cdivision(True) * def ires(self, SelectorObject selector, np.int64_t num_cells = -1, # <<<<<<<<<<<<<< @@ -9039,8 +8584,8 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_20ires(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_20ires(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_17ires(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_17ires(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0; __pyx_t_5numpy_int64_t __pyx_v_num_cells; int __pyx_v_domain_id; @@ -9055,8 +8600,11 @@ 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; } @@ -9065,11 +8613,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells); if (value) { values[1] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -9077,12 +8627,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ires") < 0)) __PYX_ERR(0, 486, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ires") < 0)) __PYX_ERR(0, 424, __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); + CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -9090,26 +8642,26 @@ } __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]); if (values[1]) { - __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L3_error) } else { __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1LL); } if (values[2]) { - __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L3_error) + __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) } else { __pyx_v_domain_id = ((int)-1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ires", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 486, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("ires", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 424, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.ires", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 486, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_19ires(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_16ires(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id); /* function exit code */ goto __pyx_L0; @@ -9120,7 +8672,7 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_19ires(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_16ires(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) { int __pyx_v_i; struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *__pyx_v_visitor = 0; PyArrayObject *__pyx_v_res = 0; @@ -9148,7 +8700,7 @@ __pyx_pybuffernd_res.data = NULL; __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res; - /* "yt/geometry/oct_container.pyx":489 + /* "yt/geometry/oct_container.pyx":427 * int domain_id = -1): * cdef int i * if num_cells == -1: # <<<<<<<<<<<<<< @@ -9158,16 +8710,16 @@ __pyx_t_1 = ((__pyx_v_num_cells == -1LL) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":490 + /* "yt/geometry/oct_container.pyx":428 * cdef int i * if num_cells == -1: * num_cells = selector.count_oct_cells(self, domain_id) # <<<<<<<<<<<<<< * cdef oct_visitors.IResOcts visitor * visitor = oct_visitors.IResOcts(self, domain_id) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -9184,7 +8736,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4}; - __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, 490, __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, 428, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -9193,14 +8745,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4}; - __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, 490, __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, 428, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -9211,16 +8763,16 @@ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __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; - __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_num_cells = __pyx_t_8; - /* "yt/geometry/oct_container.pyx":489 + /* "yt/geometry/oct_container.pyx":427 * int domain_id = -1): * cdef int i * if num_cells == -1: # <<<<<<<<<<<<<< @@ -9229,16 +8781,16 @@ */ } - /* "yt/geometry/oct_container.pyx":492 + /* "yt/geometry/oct_container.pyx":430 * num_cells = selector.count_oct_cells(self, domain_id) * cdef oct_visitors.IResOcts visitor * visitor = oct_visitors.IResOcts(self, domain_id) # <<<<<<<<<<<<<< * #Return the 'resolution' of each cell; ie the level * cdef np.ndarray[np.int64_t, ndim=1] res */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -9246,40 +8798,40 @@ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":495 + /* "yt/geometry/oct_container.pyx":433 * #Return the 'resolution' of each cell; ie the level * cdef np.ndarray[np.int64_t, ndim=1] res * res = np.empty(num_cells, dtype="int64") # <<<<<<<<<<<<<< * visitor.ires = res * self.visit_all_octs(selector, visitor) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 495, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 495, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 433, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -9295,13 +8847,13 @@ } } __pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 495, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 433, __pyx_L1_error) } __pyx_t_9 = 0; __pyx_v_res = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/oct_container.pyx":496 + /* "yt/geometry/oct_container.pyx":434 * cdef np.ndarray[np.int64_t, ndim=1] res * res = np.empty(num_cells, dtype="int64") * visitor.ires = res # <<<<<<<<<<<<<< @@ -9309,13 +8861,13 @@ * if self.level_offset > 0: */ __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_res)); - if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 496, __pyx_L1_error) + if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 434, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->ires, 0); __pyx_v_visitor->ires = __pyx_t_13; __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; - /* "yt/geometry/oct_container.pyx":497 + /* "yt/geometry/oct_container.pyx":435 * res = np.empty(num_cells, dtype="int64") * visitor.ires = res * self.visit_all_octs(selector, visitor) # <<<<<<<<<<<<<< @@ -9324,7 +8876,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL); - /* "yt/geometry/oct_container.pyx":498 + /* "yt/geometry/oct_container.pyx":436 * visitor.ires = res * self.visit_all_octs(selector, visitor) * if self.level_offset > 0: # <<<<<<<<<<<<<< @@ -9334,7 +8886,7 @@ __pyx_t_1 = ((__pyx_v_self->level_offset > 0) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":499 + /* "yt/geometry/oct_container.pyx":437 * self.visit_all_octs(selector, visitor) * if self.level_offset > 0: * for i in range(num_cells): # <<<<<<<<<<<<<< @@ -9345,7 +8897,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/oct_container.pyx":500 + /* "yt/geometry/oct_container.pyx":438 * if self.level_offset > 0: * for i in range(num_cells): * res[i] += self.level_offset # <<<<<<<<<<<<<< @@ -9356,7 +8908,7 @@ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_res.diminfo[0].strides) += __pyx_v_self->level_offset; } - /* "yt/geometry/oct_container.pyx":498 + /* "yt/geometry/oct_container.pyx":436 * visitor.ires = res * self.visit_all_octs(selector, visitor) * if self.level_offset > 0: # <<<<<<<<<<<<<< @@ -9365,7 +8917,7 @@ */ } - /* "yt/geometry/oct_container.pyx":501 + /* "yt/geometry/oct_container.pyx":439 * for i in range(num_cells): * res[i] += self.level_offset * return res # <<<<<<<<<<<<<< @@ -9377,7 +8929,7 @@ __pyx_r = ((PyObject *)__pyx_v_res); goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":486 + /* "yt/geometry/oct_container.pyx":424 * @cython.wraparound(False) * @cython.cdivision(True) * def ires(self, SelectorObject selector, np.int64_t num_cells = -1, # <<<<<<<<<<<<<< @@ -9412,7 +8964,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":506 +/* "yt/geometry/oct_container.pyx":444 * @cython.wraparound(False) * @cython.cdivision(True) * def fwidth(self, SelectorObject selector, np.int64_t num_cells = -1, # <<<<<<<<<<<<<< @@ -9421,8 +8973,8 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_22fwidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_22fwidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_19fwidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_19fwidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0; __pyx_t_5numpy_int64_t __pyx_v_num_cells; int __pyx_v_domain_id; @@ -9437,8 +8989,11 @@ 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; } @@ -9447,11 +9002,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells); if (value) { values[1] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -9459,12 +9016,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fwidth") < 0)) __PYX_ERR(0, 506, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fwidth") < 0)) __PYX_ERR(0, 444, __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); + CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -9472,26 +9031,26 @@ } __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]); if (values[1]) { - __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) + __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) } else { __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1LL); } if (values[2]) { - __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L3_error) + __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error) } else { __pyx_v_domain_id = ((int)-1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fwidth", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 506, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fwidth", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 444, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fwidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 506, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_21fwidth(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_18fwidth(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id); /* function exit code */ goto __pyx_L0; @@ -9502,7 +9061,7 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_21fwidth(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_18fwidth(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) { struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *__pyx_v_visitor = 0; PyArrayObject *__pyx_v_fwidth = 0; __pyx_t_5numpy_float64_t __pyx_v_base_dx; @@ -9531,7 +9090,7 @@ __pyx_pybuffernd_fwidth.data = NULL; __pyx_pybuffernd_fwidth.rcbuffer = &__pyx_pybuffer_fwidth; - /* "yt/geometry/oct_container.pyx":508 + /* "yt/geometry/oct_container.pyx":446 * def fwidth(self, SelectorObject selector, np.int64_t num_cells = -1, * int domain_id = -1): * if num_cells == -1: # <<<<<<<<<<<<<< @@ -9541,16 +9100,16 @@ __pyx_t_1 = ((__pyx_v_num_cells == -1LL) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":509 + /* "yt/geometry/oct_container.pyx":447 * int domain_id = -1): * if num_cells == -1: * num_cells = selector.count_oct_cells(self, domain_id) # <<<<<<<<<<<<<< * cdef oct_visitors.FWidthOcts visitor * visitor = oct_visitors.FWidthOcts(self, domain_id) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -9567,7 +9126,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4}; - __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, 509, __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, 447, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -9576,14 +9135,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4}; - __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, 509, __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, 447, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -9594,16 +9153,16 @@ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __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; - __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_num_cells = __pyx_t_8; - /* "yt/geometry/oct_container.pyx":508 + /* "yt/geometry/oct_container.pyx":446 * def fwidth(self, SelectorObject selector, np.int64_t num_cells = -1, * int domain_id = -1): * if num_cells == -1: # <<<<<<<<<<<<<< @@ -9612,16 +9171,16 @@ */ } - /* "yt/geometry/oct_container.pyx":511 + /* "yt/geometry/oct_container.pyx":449 * num_cells = selector.count_oct_cells(self, domain_id) * cdef oct_visitors.FWidthOcts visitor * visitor = oct_visitors.FWidthOcts(self, domain_id) # <<<<<<<<<<<<<< * cdef np.ndarray[np.float64_t, ndim=2] fwidth * fwidth = np.empty((num_cells, 3), dtype="float64") */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -9629,27 +9188,27 @@ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":513 + /* "yt/geometry/oct_container.pyx":451 * visitor = oct_visitors.FWidthOcts(self, domain_id) * cdef np.ndarray[np.float64_t, ndim=2] fwidth * fwidth = np.empty((num_cells, 3), dtype="float64") # <<<<<<<<<<<<<< * visitor.fwidth = fwidth * self.visit_all_octs(selector, visitor) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); @@ -9657,20 +9216,20 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_3); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __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 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __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_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 513, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 451, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -9686,13 +9245,13 @@ } } __pyx_pybuffernd_fwidth.diminfo[0].strides = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fwidth.diminfo[0].shape = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fwidth.diminfo[1].strides = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fwidth.diminfo[1].shape = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 513, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 451, __pyx_L1_error) } __pyx_t_9 = 0; __pyx_v_fwidth = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/oct_container.pyx":514 + /* "yt/geometry/oct_container.pyx":452 * cdef np.ndarray[np.float64_t, ndim=2] fwidth * fwidth = np.empty((num_cells, 3), dtype="float64") * visitor.fwidth = fwidth # <<<<<<<<<<<<<< @@ -9700,13 +9259,13 @@ * cdef np.float64_t base_dx */ __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_fwidth)); - if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 452, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->fwidth, 0); __pyx_v_visitor->fwidth = __pyx_t_13; __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; - /* "yt/geometry/oct_container.pyx":515 + /* "yt/geometry/oct_container.pyx":453 * fwidth = np.empty((num_cells, 3), dtype="float64") * visitor.fwidth = fwidth * self.visit_all_octs(selector, visitor) # <<<<<<<<<<<<<< @@ -9715,7 +9274,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL); - /* "yt/geometry/oct_container.pyx":517 + /* "yt/geometry/oct_container.pyx":455 * self.visit_all_octs(selector, visitor) * cdef np.float64_t base_dx * for i in range(3): # <<<<<<<<<<<<<< @@ -9725,7 +9284,7 @@ for (__pyx_t_14 = 0; __pyx_t_14 < 3; __pyx_t_14+=1) { __pyx_v_i = __pyx_t_14; - /* "yt/geometry/oct_container.pyx":518 + /* "yt/geometry/oct_container.pyx":456 * cdef np.float64_t base_dx * for i in range(3): * base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i] # <<<<<<<<<<<<<< @@ -9734,16 +9293,16 @@ */ __pyx_v_base_dx = (((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_self->nn[__pyx_v_i])); - /* "yt/geometry/oct_container.pyx":519 + /* "yt/geometry/oct_container.pyx":457 * for i in range(3): * base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i] * fwidth[:,i] *= base_dx # <<<<<<<<<<<<<< * return fwidth * */ - __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_slice__3); __Pyx_GIVEREF(__pyx_slice__3); @@ -9751,20 +9310,20 @@ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_fwidth), __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_fwidth), __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_base_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_base_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __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; - if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_fwidth), __pyx_t_7, __pyx_t_3) < 0)) __PYX_ERR(0, 519, __pyx_L1_error) + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_fwidth), __pyx_t_7, __pyx_t_3) < 0)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - /* "yt/geometry/oct_container.pyx":520 + /* "yt/geometry/oct_container.pyx":458 * base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i] * fwidth[:,i] *= base_dx * return fwidth # <<<<<<<<<<<<<< @@ -9776,7 +9335,7 @@ __pyx_r = ((PyObject *)__pyx_v_fwidth); goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":506 + /* "yt/geometry/oct_container.pyx":444 * @cython.wraparound(False) * @cython.cdivision(True) * def fwidth(self, SelectorObject selector, np.int64_t num_cells = -1, # <<<<<<<<<<<<<< @@ -9811,7 +9370,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":525 +/* "yt/geometry/oct_container.pyx":463 * @cython.wraparound(False) * @cython.cdivision(True) * def fcoords(self, SelectorObject selector, np.int64_t num_cells = -1, # <<<<<<<<<<<<<< @@ -9820,8 +9379,8 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_24fcoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_24fcoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_21fcoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_21fcoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0; __pyx_t_5numpy_int64_t __pyx_v_num_cells; int __pyx_v_domain_id; @@ -9836,8 +9395,11 @@ 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; } @@ -9846,11 +9408,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells); if (value) { values[1] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -9858,12 +9422,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fcoords") < 0)) __PYX_ERR(0, 525, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fcoords") < 0)) __PYX_ERR(0, 463, __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); + CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -9871,26 +9437,26 @@ } __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]); if (values[1]) { - __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 525, __pyx_L3_error) + __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) } else { __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1LL); } if (values[2]) { - __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 526, __pyx_L3_error) + __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 464, __pyx_L3_error) } else { __pyx_v_domain_id = ((int)-1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fcoords", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 525, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fcoords", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 463, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fcoords", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 525, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_23fcoords(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_20fcoords(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id); /* function exit code */ goto __pyx_L0; @@ -9901,7 +9467,7 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_23fcoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_20fcoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) { struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_v_visitor = 0; PyArrayObject *__pyx_v_coords = 0; int __pyx_v_i; @@ -9929,7 +9495,7 @@ __pyx_pybuffernd_coords.data = NULL; __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords; - /* "yt/geometry/oct_container.pyx":527 + /* "yt/geometry/oct_container.pyx":465 * def fcoords(self, SelectorObject selector, np.int64_t num_cells = -1, * int domain_id = -1): * if num_cells == -1: # <<<<<<<<<<<<<< @@ -9939,16 +9505,16 @@ __pyx_t_1 = ((__pyx_v_num_cells == -1LL) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":528 + /* "yt/geometry/oct_container.pyx":466 * int domain_id = -1): * if num_cells == -1: * num_cells = selector.count_oct_cells(self, domain_id) # <<<<<<<<<<<<<< * cdef oct_visitors.FCoordsOcts visitor * visitor = oct_visitors.FCoordsOcts(self, domain_id) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -9965,7 +9531,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4}; - __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, 528, __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, 466, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -9974,14 +9540,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4}; - __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, 528, __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, 466, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -9992,16 +9558,16 @@ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __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; - __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_num_cells = __pyx_t_8; - /* "yt/geometry/oct_container.pyx":527 + /* "yt/geometry/oct_container.pyx":465 * def fcoords(self, SelectorObject selector, np.int64_t num_cells = -1, * int domain_id = -1): * if num_cells == -1: # <<<<<<<<<<<<<< @@ -10010,16 +9576,16 @@ */ } - /* "yt/geometry/oct_container.pyx":530 + /* "yt/geometry/oct_container.pyx":468 * num_cells = selector.count_oct_cells(self, domain_id) * cdef oct_visitors.FCoordsOcts visitor * visitor = oct_visitors.FCoordsOcts(self, domain_id) # <<<<<<<<<<<<<< * #Return the floating point unitary position of every cell * cdef np.ndarray[np.float64_t, ndim=2] coords */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -10027,27 +9593,27 @@ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":533 + /* "yt/geometry/oct_container.pyx":471 * #Return the floating point unitary position of every cell * cdef np.ndarray[np.float64_t, ndim=2] coords * coords = np.empty((num_cells, 3), dtype="float64") # <<<<<<<<<<<<<< * visitor.fcoords = coords * self.visit_all_octs(selector, visitor) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); @@ -10055,20 +9621,20 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_3); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __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 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 533, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __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_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 533, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 471, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -10084,13 +9650,13 @@ } } __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 533, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 471, __pyx_L1_error) } __pyx_t_9 = 0; __pyx_v_coords = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/oct_container.pyx":534 + /* "yt/geometry/oct_container.pyx":472 * cdef np.ndarray[np.float64_t, ndim=2] coords * coords = np.empty((num_cells, 3), dtype="float64") * visitor.fcoords = coords # <<<<<<<<<<<<<< @@ -10098,13 +9664,13 @@ * cdef int i */ __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_coords)); - if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 534, __pyx_L1_error) + if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 472, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->fcoords, 0); __pyx_v_visitor->fcoords = __pyx_t_13; __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; - /* "yt/geometry/oct_container.pyx":535 + /* "yt/geometry/oct_container.pyx":473 * coords = np.empty((num_cells, 3), dtype="float64") * visitor.fcoords = coords * self.visit_all_octs(selector, visitor) # <<<<<<<<<<<<<< @@ -10113,7 +9679,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL); - /* "yt/geometry/oct_container.pyx":538 + /* "yt/geometry/oct_container.pyx":476 * cdef int i * cdef np.float64_t base_dx * for i in range(3): # <<<<<<<<<<<<<< @@ -10123,7 +9689,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/oct_container.pyx":539 + /* "yt/geometry/oct_container.pyx":477 * cdef np.float64_t base_dx * for i in range(3): * base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i] # <<<<<<<<<<<<<< @@ -10132,16 +9698,16 @@ */ __pyx_v_base_dx = (((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_self->nn[__pyx_v_i])); - /* "yt/geometry/oct_container.pyx":540 + /* "yt/geometry/oct_container.pyx":478 * for i in range(3): * base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i] * coords[:,i] *= base_dx # <<<<<<<<<<<<<< * coords[:,i] += self.DLE[i] * return coords */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_slice__4); __Pyx_GIVEREF(__pyx_slice__4); @@ -10149,28 +9715,28 @@ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_base_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_base_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __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; - if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_coords), __pyx_t_7, __pyx_t_3) < 0)) __PYX_ERR(0, 540, __pyx_L1_error) + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_coords), __pyx_t_7, __pyx_t_3) < 0)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/oct_container.pyx":541 + /* "yt/geometry/oct_container.pyx":479 * base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i] * coords[:,i] *= base_dx * coords[:,i] += self.DLE[i] # <<<<<<<<<<<<<< * return coords * */ - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_slice__5); __Pyx_GIVEREF(__pyx_slice__5); @@ -10178,20 +9744,20 @@ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->DLE[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->DLE[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_coords), __pyx_t_3, __pyx_t_4) < 0)) __PYX_ERR(0, 541, __pyx_L1_error) + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_coords), __pyx_t_3, __pyx_t_4) < 0)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "yt/geometry/oct_container.pyx":542 + /* "yt/geometry/oct_container.pyx":480 * coords[:,i] *= base_dx * coords[:,i] += self.DLE[i] * return coords # <<<<<<<<<<<<<< @@ -10203,7 +9769,7 @@ __pyx_r = ((PyObject *)__pyx_v_coords); goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":525 + /* "yt/geometry/oct_container.pyx":463 * @cython.wraparound(False) * @cython.cdivision(True) * def fcoords(self, SelectorObject selector, np.int64_t num_cells = -1, # <<<<<<<<<<<<<< @@ -10238,7 +9804,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":544 +/* "yt/geometry/oct_container.pyx":482 * return coords * * def save_octree(self): # <<<<<<<<<<<<<< @@ -10247,19 +9813,19 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_26save_octree(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_26save_octree(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_23save_octree(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_23save_octree(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("save_octree (wrapper)", 0); - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_25save_octree(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self)); + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_22save_octree(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_25save_octree(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_22save_octree(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) { PyObject *__pyx_v_header = NULL; struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0; struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_v_visitor = 0; @@ -10286,22 +9852,22 @@ __pyx_pybuffernd_ref_mask.data = NULL; __pyx_pybuffernd_ref_mask.rcbuffer = &__pyx_pybuffer_ref_mask; - /* "yt/geometry/oct_container.pyx":546 + /* "yt/geometry/oct_container.pyx":484 * def save_octree(self): * # Get the header * header = dict(dims = (self.nn[0], self.nn[1], self.nn[2]), # <<<<<<<<<<<<<< * left_edge = (self.DLE[0], self.DLE[1], self.DLE[2]), * right_edge = (self.DRE[0], self.DRE[1], self.DRE[2]), */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->nn[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->nn[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->nn[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->nn[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->nn[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->nn[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); @@ -10312,23 +9878,23 @@ __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dims, __pyx_t_5) < 0) __PYX_ERR(0, 546, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dims, __pyx_t_5) < 0) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/oct_container.pyx":547 + /* "yt/geometry/oct_container.pyx":485 * # Get the header * header = dict(dims = (self.nn[0], self.nn[1], self.nn[2]), * left_edge = (self.DLE[0], self.DLE[1], self.DLE[2]), # <<<<<<<<<<<<<< * right_edge = (self.DRE[0], self.DRE[1], self.DRE[2]), * over_refine = self.oref, */ - __pyx_t_5 = PyFloat_FromDouble((__pyx_v_self->DLE[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble((__pyx_v_self->DLE[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyFloat_FromDouble((__pyx_v_self->DLE[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble((__pyx_v_self->DLE[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyFloat_FromDouble((__pyx_v_self->DLE[2])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble((__pyx_v_self->DLE[2])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); @@ -10339,23 +9905,23 @@ __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_left_edge, __pyx_t_2) < 0) __PYX_ERR(0, 546, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_left_edge, __pyx_t_2) < 0) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":548 + /* "yt/geometry/oct_container.pyx":486 * header = dict(dims = (self.nn[0], self.nn[1], self.nn[2]), * left_edge = (self.DLE[0], self.DLE[1], self.DLE[2]), * right_edge = (self.DRE[0], self.DRE[1], self.DRE[2]), # <<<<<<<<<<<<<< * over_refine = self.oref, * partial_coverage = self.partial_coverage) */ - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->DRE[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->DRE[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble((__pyx_v_self->DRE[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble((__pyx_v_self->DRE[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble((__pyx_v_self->DRE[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble((__pyx_v_self->DRE[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); @@ -10366,55 +9932,55 @@ __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_right_edge, __pyx_t_5) < 0) __PYX_ERR(0, 546, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_right_edge, __pyx_t_5) < 0) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/oct_container.pyx":549 + /* "yt/geometry/oct_container.pyx":487 * left_edge = (self.DLE[0], self.DLE[1], self.DLE[2]), * right_edge = (self.DRE[0], self.DRE[1], self.DRE[2]), * over_refine = self.oref, # <<<<<<<<<<<<<< * partial_coverage = self.partial_coverage) * cdef SelectorObject selector = selection_routines.AlwaysSelector(None) */ - __pyx_t_5 = __Pyx_PyInt_From_npy_uint8(__pyx_v_self->oref); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_npy_uint8(__pyx_v_self->oref); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_over_refine, __pyx_t_5) < 0) __PYX_ERR(0, 546, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_over_refine, __pyx_t_5) < 0) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/oct_container.pyx":550 + /* "yt/geometry/oct_container.pyx":488 * right_edge = (self.DRE[0], self.DRE[1], self.DRE[2]), * over_refine = self.oref, * partial_coverage = self.partial_coverage) # <<<<<<<<<<<<<< * cdef SelectorObject selector = selection_routines.AlwaysSelector(None) * # domain_id = -1 here, because we want *every* oct */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->partial_coverage); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->partial_coverage); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_partial_coverage, __pyx_t_5) < 0) __PYX_ERR(0, 546, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_partial_coverage, __pyx_t_5) < 0) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_header = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":551 + /* "yt/geometry/oct_container.pyx":489 * over_refine = self.oref, * partial_coverage = self.partial_coverage) * cdef SelectorObject selector = selection_routines.AlwaysSelector(None) # <<<<<<<<<<<<<< * # domain_id = -1 here, because we want *every* oct * cdef oct_visitors.StoreOctree visitor */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":554 + /* "yt/geometry/oct_container.pyx":492 * # domain_id = -1 here, because we want *every* oct * cdef oct_visitors.StoreOctree visitor * visitor = oct_visitors.StoreOctree(self, -1) # <<<<<<<<<<<<<< * visitor.oref = 0 * visitor.nz = 1 */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -10422,13 +9988,13 @@ __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_neg_1); - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/oct_container.pyx":555 + /* "yt/geometry/oct_container.pyx":493 * cdef oct_visitors.StoreOctree visitor * visitor = oct_visitors.StoreOctree(self, -1) * visitor.oref = 0 # <<<<<<<<<<<<<< @@ -10437,7 +10003,7 @@ */ __pyx_v_visitor->__pyx_base.oref = 0; - /* "yt/geometry/oct_container.pyx":556 + /* "yt/geometry/oct_container.pyx":494 * visitor = oct_visitors.StoreOctree(self, -1) * visitor.oref = 0 * visitor.nz = 1 # <<<<<<<<<<<<<< @@ -10446,37 +10012,37 @@ */ __pyx_v_visitor->__pyx_base.nz = 1; - /* "yt/geometry/oct_container.pyx":558 + /* "yt/geometry/oct_container.pyx":496 * visitor.nz = 1 * cdef np.ndarray[np.uint8_t, ndim=1] ref_mask * ref_mask = np.zeros(self.nocts * visitor.nz, dtype="uint8") - 1 # <<<<<<<<<<<<<< * visitor.ref_mask = ref_mask * # Enforce partial_coverage here */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_npy_int64((__pyx_v_self->nocts * __pyx_v_visitor->__pyx_base.nz)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((__pyx_v_self->nocts * __pyx_v_visitor->__pyx_base.nz)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 558, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 496, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 558, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 496, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -10492,13 +10058,13 @@ } } __pyx_pybuffernd_ref_mask.diminfo[0].strides = __pyx_pybuffernd_ref_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ref_mask.diminfo[0].shape = __pyx_pybuffernd_ref_mask.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 558, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 496, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_ref_mask = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/oct_container.pyx":559 + /* "yt/geometry/oct_container.pyx":497 * cdef np.ndarray[np.uint8_t, ndim=1] ref_mask * ref_mask = np.zeros(self.nocts * visitor.nz, dtype="uint8") - 1 * visitor.ref_mask = ref_mask # <<<<<<<<<<<<<< @@ -10506,13 +10072,13 @@ * self.visit_all_octs(selector, visitor, 1) */ __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_ref_mask)); - if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 559, __pyx_L1_error) + if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 497, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->ref_mask, 0); __pyx_v_visitor->ref_mask = __pyx_t_11; __pyx_t_11.memview = NULL; __pyx_t_11.data = NULL; - /* "yt/geometry/oct_container.pyx":561 + /* "yt/geometry/oct_container.pyx":499 * visitor.ref_mask = ref_mask * # Enforce partial_coverage here * self.visit_all_octs(selector, visitor, 1) # <<<<<<<<<<<<<< @@ -10523,16 +10089,16 @@ __pyx_t_12.vc = 1; ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), &__pyx_t_12); - /* "yt/geometry/oct_container.pyx":562 + /* "yt/geometry/oct_container.pyx":500 * # Enforce partial_coverage here * self.visit_all_octs(selector, visitor, 1) * header['octree'] = ref_mask # <<<<<<<<<<<<<< * return header * */ - if (unlikely(PyDict_SetItem(__pyx_v_header, __pyx_n_s_octree, ((PyObject *)__pyx_v_ref_mask)) < 0)) __PYX_ERR(0, 562, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_header, __pyx_n_s_octree, ((PyObject *)__pyx_v_ref_mask)) < 0)) __PYX_ERR(0, 500, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":563 + /* "yt/geometry/oct_container.pyx":501 * self.visit_all_octs(selector, visitor, 1) * header['octree'] = ref_mask * return header # <<<<<<<<<<<<<< @@ -10544,7 +10110,7 @@ __pyx_r = __pyx_v_header; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":544 + /* "yt/geometry/oct_container.pyx":482 * return coords * * def save_octree(self): # <<<<<<<<<<<<<< @@ -10581,7 +10147,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":565 +/* "yt/geometry/oct_container.pyx":503 * return header * * def selector_fill(self, SelectorObject selector, # <<<<<<<<<<<<<< @@ -10590,8 +10156,8 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_28selector_fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_28selector_fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_25selector_fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_25selector_fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0; PyArrayObject *__pyx_v_source = 0; PyArrayObject *__pyx_v_dest = 0; @@ -10605,7 +10171,7 @@ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_source,&__pyx_n_s_dest,&__pyx_n_s_offset,&__pyx_n_s_dims,&__pyx_n_s_domain_id,0}; PyObject* values[6] = {0,0,0,0,0,0}; - /* "yt/geometry/oct_container.pyx":567 + /* "yt/geometry/oct_container.pyx":505 * def selector_fill(self, SelectorObject selector, * np.ndarray source, * np.ndarray dest = None, # <<<<<<<<<<<<<< @@ -10618,11 +10184,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -10631,26 +10203,31 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("selector_fill", 0, 2, 6, 1); __PYX_ERR(0, 565, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("selector_fill", 0, 2, 6, 1); __PYX_ERR(0, 503, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest); if (value) { values[2] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dims); if (value) { values[4] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -10658,14 +10235,18 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "selector_fill") < 0)) __PYX_ERR(0, 565, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "selector_fill") < 0)) __PYX_ERR(0, 503, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; @@ -10676,35 +10257,35 @@ __pyx_v_source = ((PyArrayObject *)values[1]); __pyx_v_dest = ((PyArrayObject *)values[2]); if (values[3]) { - __pyx_v_offset = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_offset == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_offset == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) } else { __pyx_v_offset = ((__pyx_t_5numpy_int64_t)0); } if (values[4]) { - __pyx_v_dims = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) + __pyx_v_dims = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) } else { __pyx_v_dims = ((int)1); } if (values[5]) { - __pyx_v_domain_id = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L3_error) + __pyx_v_domain_id = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L3_error) } else { __pyx_v_domain_id = ((int)-1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("selector_fill", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 565, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("selector_fill", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 503, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.selector_fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 565, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_5numpy_ndarray, 1, "source", 0))) __PYX_ERR(0, 566, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest), __pyx_ptype_5numpy_ndarray, 1, "dest", 0))) __PYX_ERR(0, 567, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_27selector_fill(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_source, __pyx_v_dest, __pyx_v_offset, __pyx_v_dims, __pyx_v_domain_id); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 503, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_5numpy_ndarray, 1, "source", 0))) __PYX_ERR(0, 504, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest), __pyx_ptype_5numpy_ndarray, 1, "dest", 0))) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_24selector_fill(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_source, __pyx_v_dest, __pyx_v_offset, __pyx_v_dims, __pyx_v_domain_id); - /* "yt/geometry/oct_container.pyx":565 + /* "yt/geometry/oct_container.pyx":503 * return header * * def selector_fill(self, SelectorObject selector, # <<<<<<<<<<<<<< @@ -10721,7 +10302,7 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_27selector_fill(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, PyArrayObject *__pyx_v_source, PyArrayObject *__pyx_v_dest, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_dims, int __pyx_v_domain_id) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_24selector_fill(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, PyArrayObject *__pyx_v_source, PyArrayObject *__pyx_v_dest, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_dims, int __pyx_v_domain_id) { __pyx_t_5numpy_int64_t __pyx_v_num_cells; struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_visitor = 0; struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *__pyx_v_visitor_i64 = 0; @@ -10748,7 +10329,7 @@ __Pyx_INCREF((PyObject *)__pyx_v_source); __Pyx_INCREF((PyObject *)__pyx_v_dest); - /* "yt/geometry/oct_container.pyx":573 + /* "yt/geometry/oct_container.pyx":511 * # iterate the same way visit_all_octs does, but we need to track the * # number of octs total visited. * cdef np.int64_t num_cells = -1 # <<<<<<<<<<<<<< @@ -10757,7 +10338,7 @@ */ __pyx_v_num_cells = -1LL; - /* "yt/geometry/oct_container.pyx":574 + /* "yt/geometry/oct_container.pyx":512 * # number of octs total visited. * cdef np.int64_t num_cells = -1 * if dest is None: # <<<<<<<<<<<<<< @@ -10768,16 +10349,16 @@ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":578 + /* "yt/geometry/oct_container.pyx":516 * # means we actually do want the number of Octs, not the number of * # cells. * num_cells = selector.count_oct_cells(self, domain_id) # <<<<<<<<<<<<<< * dest = np.zeros((num_cells, dims), dtype=source.dtype, * order='C') */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -10794,7 +10375,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_t_5}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __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; @@ -10803,14 +10384,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_t_5}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 516, __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; @@ -10821,32 +10402,32 @@ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_9 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_9 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_num_cells = __pyx_t_9; - /* "yt/geometry/oct_container.pyx":579 + /* "yt/geometry/oct_container.pyx":517 * # cells. * num_cells = selector.count_oct_cells(self, domain_id) * dest = np.zeros((num_cells, dims), dtype=source.dtype, # <<<<<<<<<<<<<< * order='C') * if dims != 1: */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); @@ -10854,28 +10435,28 @@ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8); __pyx_t_3 = 0; __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 517, __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 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 579, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 579, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 579, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "yt/geometry/oct_container.pyx":574 + /* "yt/geometry/oct_container.pyx":512 * # number of octs total visited. * cdef np.int64_t num_cells = -1 * if dest is None: # <<<<<<<<<<<<<< @@ -10884,7 +10465,7 @@ */ } - /* "yt/geometry/oct_container.pyx":581 + /* "yt/geometry/oct_container.pyx":519 * dest = np.zeros((num_cells, dims), dtype=source.dtype, * order='C') * if dims != 1: # <<<<<<<<<<<<<< @@ -10894,7 +10475,7 @@ __pyx_t_2 = ((__pyx_v_dims != 1) != 0); if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":582 + /* "yt/geometry/oct_container.pyx":520 * order='C') * if dims != 1: * raise RuntimeError # <<<<<<<<<<<<<< @@ -10902,9 +10483,9 @@ * # duplicate memory. Since we're in Cython, we want to avoid modifying */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 520, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":581 + /* "yt/geometry/oct_container.pyx":519 * dest = np.zeros((num_cells, dims), dtype=source.dtype, * order='C') * if dims != 1: # <<<<<<<<<<<<<< @@ -10913,18 +10494,18 @@ */ } - /* "yt/geometry/oct_container.pyx":586 + /* "yt/geometry/oct_container.pyx":524 * # duplicate memory. Since we're in Cython, we want to avoid modifying * # the .shape attributes directly. * dest = dest.reshape((num_cells, 1)) # <<<<<<<<<<<<<< * source = source.reshape((source.shape[0], source.shape[1], * source.shape[2], source.shape[3], dims)) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); @@ -10943,14 +10524,14 @@ } } if (!__pyx_t_8) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __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_5)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -10959,65 +10540,65 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 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(0, 586, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = 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_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 586, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "yt/geometry/oct_container.pyx":587 + /* "yt/geometry/oct_container.pyx":525 * # the .shape attributes directly. * dest = dest.reshape((num_cells, 1)) * source = source.reshape((source.shape[0], source.shape[1], # <<<<<<<<<<<<<< * source.shape[2], source.shape[3], dims)) * cdef OctVisitor visitor */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_source->dimensions[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_source->dimensions[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_source->dimensions[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_source->dimensions[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "yt/geometry/oct_container.pyx":588 + /* "yt/geometry/oct_container.pyx":526 * dest = dest.reshape((num_cells, 1)) * source = source.reshape((source.shape[0], source.shape[1], * source.shape[2], source.shape[3], dims)) # <<<<<<<<<<<<<< * cdef OctVisitor visitor * cdef oct_visitors.CopyArrayI64 visitor_i64 */ - __pyx_t_8 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_source->dimensions[2])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_source->dimensions[2])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_source->dimensions[3])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_source->dimensions[3])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - /* "yt/geometry/oct_container.pyx":587 + /* "yt/geometry/oct_container.pyx":525 * # the .shape attributes directly. * dest = dest.reshape((num_cells, 1)) * source = source.reshape((source.shape[0], source.shape[1], # <<<<<<<<<<<<<< * source.shape[2], source.shape[3], dims)) * cdef OctVisitor visitor */ - __pyx_t_12 = PyTuple_New(5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); @@ -11045,14 +10626,14 @@ } } if (!__pyx_t_11) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_12}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -11061,48 +10642,48 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_12}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL; __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_12); __pyx_t_12 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 587, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_source, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "yt/geometry/oct_container.pyx":592 + /* "yt/geometry/oct_container.pyx":530 * cdef oct_visitors.CopyArrayI64 visitor_i64 * cdef oct_visitors.CopyArrayF64 visitor_f64 * if source.dtype != dest.dtype: # <<<<<<<<<<<<<< * raise RuntimeError * if source.dtype == np.int64: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":593 + /* "yt/geometry/oct_container.pyx":531 * cdef oct_visitors.CopyArrayF64 visitor_f64 * if source.dtype != dest.dtype: * raise RuntimeError # <<<<<<<<<<<<<< @@ -11110,9 +10691,9 @@ * visitor_i64 = oct_visitors.CopyArrayI64(self, domain_id) */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 531, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":592 + /* "yt/geometry/oct_container.pyx":530 * cdef oct_visitors.CopyArrayI64 visitor_i64 * cdef oct_visitors.CopyArrayF64 visitor_f64 * if source.dtype != dest.dtype: # <<<<<<<<<<<<<< @@ -11121,37 +10702,37 @@ */ } - /* "yt/geometry/oct_container.pyx":594 + /* "yt/geometry/oct_container.pyx":532 * if source.dtype != dest.dtype: * raise RuntimeError * if source.dtype == np.int64: # <<<<<<<<<<<<<< * visitor_i64 = oct_visitors.CopyArrayI64(self, domain_id) * visitor_i64.source = source */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_10, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_10, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":595 + /* "yt/geometry/oct_container.pyx":533 * raise RuntimeError * if source.dtype == np.int64: * visitor_i64 = oct_visitors.CopyArrayI64(self, domain_id) # <<<<<<<<<<<<<< * visitor_i64.source = source * visitor_i64.dest = dest */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -11159,13 +10740,13 @@ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_visitor_i64 = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/oct_container.pyx":596 + /* "yt/geometry/oct_container.pyx":534 * if source.dtype == np.int64: * visitor_i64 = oct_visitors.CopyArrayI64(self, domain_id) * visitor_i64.source = source # <<<<<<<<<<<<<< @@ -11173,13 +10754,13 @@ * visitor = visitor_i64 */ __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsdsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_source)); - if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 596, __pyx_L1_error) + if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 534, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_i64->source, 0); __pyx_v_visitor_i64->source = __pyx_t_13; __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; - /* "yt/geometry/oct_container.pyx":597 + /* "yt/geometry/oct_container.pyx":535 * visitor_i64 = oct_visitors.CopyArrayI64(self, domain_id) * visitor_i64.source = source * visitor_i64.dest = dest # <<<<<<<<<<<<<< @@ -11187,13 +10768,13 @@ * elif source.dtype == np.float64: */ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_dest)); - if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 597, __pyx_L1_error) + if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 535, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_i64->dest, 0); __pyx_v_visitor_i64->dest = __pyx_t_14; __pyx_t_14.memview = NULL; __pyx_t_14.data = NULL; - /* "yt/geometry/oct_container.pyx":598 + /* "yt/geometry/oct_container.pyx":536 * visitor_i64.source = source * visitor_i64.dest = dest * visitor = visitor_i64 # <<<<<<<<<<<<<< @@ -11203,7 +10784,7 @@ __Pyx_INCREF(((PyObject *)__pyx_v_visitor_i64)); __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor_i64); - /* "yt/geometry/oct_container.pyx":594 + /* "yt/geometry/oct_container.pyx":532 * if source.dtype != dest.dtype: * raise RuntimeError * if source.dtype == np.int64: # <<<<<<<<<<<<<< @@ -11213,37 +10794,37 @@ goto __pyx_L6; } - /* "yt/geometry/oct_container.pyx":599 + /* "yt/geometry/oct_container.pyx":537 * visitor_i64.dest = dest * visitor = visitor_i64 * elif source.dtype == np.float64: # <<<<<<<<<<<<<< * visitor_f64 = oct_visitors.CopyArrayF64(self, domain_id) * visitor_f64.source = source */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":600 + /* "yt/geometry/oct_container.pyx":538 * visitor = visitor_i64 * elif source.dtype == np.float64: * visitor_f64 = oct_visitors.CopyArrayF64(self, domain_id) # <<<<<<<<<<<<<< * visitor_f64.source = source * visitor_f64.dest = dest */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -11251,13 +10832,13 @@ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64), __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64), __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_visitor_f64 = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/oct_container.pyx":601 + /* "yt/geometry/oct_container.pyx":539 * elif source.dtype == np.float64: * visitor_f64 = oct_visitors.CopyArrayF64(self, domain_id) * visitor_f64.source = source # <<<<<<<<<<<<<< @@ -11265,13 +10846,13 @@ * visitor = visitor_f64 */ __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_source)); - if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 601, __pyx_L1_error) + if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 539, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_f64->source, 0); __pyx_v_visitor_f64->source = __pyx_t_15; __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL; - /* "yt/geometry/oct_container.pyx":602 + /* "yt/geometry/oct_container.pyx":540 * visitor_f64 = oct_visitors.CopyArrayF64(self, domain_id) * visitor_f64.source = source * visitor_f64.dest = dest # <<<<<<<<<<<<<< @@ -11279,13 +10860,13 @@ * else: */ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_dest)); - if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 602, __pyx_L1_error) + if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 540, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_f64->dest, 0); __pyx_v_visitor_f64->dest = __pyx_t_16; __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL; - /* "yt/geometry/oct_container.pyx":603 + /* "yt/geometry/oct_container.pyx":541 * visitor_f64.source = source * visitor_f64.dest = dest * visitor = visitor_f64 # <<<<<<<<<<<<<< @@ -11295,7 +10876,7 @@ __Pyx_INCREF(((PyObject *)__pyx_v_visitor_f64)); __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor_f64); - /* "yt/geometry/oct_container.pyx":599 + /* "yt/geometry/oct_container.pyx":537 * visitor_i64.dest = dest * visitor = visitor_i64 * elif source.dtype == np.float64: # <<<<<<<<<<<<<< @@ -11305,7 +10886,7 @@ goto __pyx_L6; } - /* "yt/geometry/oct_container.pyx":605 + /* "yt/geometry/oct_container.pyx":543 * visitor = visitor_f64 * else: * raise NotImplementedError # <<<<<<<<<<<<<< @@ -11314,11 +10895,11 @@ */ /*else*/ { __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 605, __pyx_L1_error) + __PYX_ERR(0, 543, __pyx_L1_error) } __pyx_L6:; - /* "yt/geometry/oct_container.pyx":606 + /* "yt/geometry/oct_container.pyx":544 * else: * raise NotImplementedError * visitor.index = offset # <<<<<<<<<<<<<< @@ -11327,7 +10908,7 @@ */ __pyx_v_visitor->index = __pyx_v_offset; - /* "yt/geometry/oct_container.pyx":608 + /* "yt/geometry/oct_container.pyx":546 * visitor.index = offset * # We only need this so we can continue calculating the offset * visitor.dims = dims # <<<<<<<<<<<<<< @@ -11336,7 +10917,7 @@ */ __pyx_v_visitor->dims = __pyx_v_dims; - /* "yt/geometry/oct_container.pyx":609 + /* "yt/geometry/oct_container.pyx":547 * # We only need this so we can continue calculating the offset * visitor.dims = dims * self.visit_all_octs(selector, visitor) # <<<<<<<<<<<<<< @@ -11345,65 +10926,65 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, __pyx_v_visitor, NULL); - /* "yt/geometry/oct_container.pyx":610 + /* "yt/geometry/oct_container.pyx":548 * visitor.dims = dims * self.visit_all_octs(selector, visitor) * if (visitor.global_index + 1) * visitor.nz * visitor.dims > source.size: # <<<<<<<<<<<<<< * print "GLOBAL INDEX RAN AHEAD.", * print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size */ - __pyx_t_3 = __Pyx_PyInt_From_npy_int64((((__pyx_v_visitor->global_index + 1) * __pyx_v_visitor->nz) * __pyx_v_visitor->dims)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_int64((((__pyx_v_visitor->global_index + 1) * __pyx_v_visitor->nz) * __pyx_v_visitor->dims)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_10, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_10, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":611 + /* "yt/geometry/oct_container.pyx":549 * self.visit_all_octs(selector, visitor) * if (visitor.global_index + 1) * visitor.nz * visitor.dims > source.size: * print "GLOBAL INDEX RAN AHEAD.", # <<<<<<<<<<<<<< * print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size * print dest.size, source.size, num_cells */ - if (__Pyx_Print(0, __pyx_tuple__7, 0) < 0) __PYX_ERR(0, 611, __pyx_L1_error) + if (__Pyx_Print(0, __pyx_tuple__7, 0) < 0) __PYX_ERR(0, 549, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":612 + /* "yt/geometry/oct_container.pyx":550 * if (visitor.global_index + 1) * visitor.nz * visitor.dims > source.size: * print "GLOBAL INDEX RAN AHEAD.", * print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size # <<<<<<<<<<<<<< * print dest.size, source.size, num_cells * raise RuntimeError */ - __pyx_t_5 = __Pyx_PyInt_From_npy_int64((((__pyx_v_visitor->global_index + 1) * __pyx_v_visitor->nz) * __pyx_v_visitor->dims)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((((__pyx_v_visitor->global_index + 1) * __pyx_v_visitor->nz) * __pyx_v_visitor->dims)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 612, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 612, __pyx_L1_error) + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/oct_container.pyx":613 + /* "yt/geometry/oct_container.pyx":551 * print "GLOBAL INDEX RAN AHEAD.", * print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size * print dest.size, source.size, num_cells # <<<<<<<<<<<<<< * raise RuntimeError * if visitor.index > dest.size: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3); @@ -11414,10 +10995,10 @@ __pyx_t_3 = 0; __pyx_t_10 = 0; __pyx_t_5 = 0; - if (__Pyx_Print(0, __pyx_t_12, 1) < 0) __PYX_ERR(0, 613, __pyx_L1_error) + if (__Pyx_Print(0, __pyx_t_12, 1) < 0) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "yt/geometry/oct_container.pyx":614 + /* "yt/geometry/oct_container.pyx":552 * print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size * print dest.size, source.size, num_cells * raise RuntimeError # <<<<<<<<<<<<<< @@ -11425,9 +11006,9 @@ * print "DEST INDEX RAN AHEAD.", */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 614, __pyx_L1_error) + __PYX_ERR(0, 552, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":610 + /* "yt/geometry/oct_container.pyx":548 * visitor.dims = dims * self.visit_all_octs(selector, visitor) * if (visitor.global_index + 1) * visitor.nz * visitor.dims > source.size: # <<<<<<<<<<<<<< @@ -11436,63 +11017,63 @@ */ } - /* "yt/geometry/oct_container.pyx":615 + /* "yt/geometry/oct_container.pyx":553 * print dest.size, source.size, num_cells * raise RuntimeError * if visitor.index > dest.size: # <<<<<<<<<<<<<< * print "DEST INDEX RAN AHEAD.", * print visitor.index - dest.size */ - __pyx_t_12 = __Pyx_PyInt_From_npy_uint64(__pyx_v_visitor->index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_From_npy_uint64(__pyx_v_visitor->index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyObject_RichCompare(__pyx_t_12, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_t_12, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":616 + /* "yt/geometry/oct_container.pyx":554 * raise RuntimeError * if visitor.index > dest.size: * print "DEST INDEX RAN AHEAD.", # <<<<<<<<<<<<<< * print visitor.index - dest.size * print (visitor.global_index + 1) * visitor.nz * visitor.dims, source.size */ - if (__Pyx_Print(0, __pyx_tuple__8, 0) < 0) __PYX_ERR(0, 616, __pyx_L1_error) + if (__Pyx_Print(0, __pyx_tuple__8, 0) < 0) __PYX_ERR(0, 554, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":617 + /* "yt/geometry/oct_container.pyx":555 * if visitor.index > dest.size: * print "DEST INDEX RAN AHEAD.", * print visitor.index - dest.size # <<<<<<<<<<<<<< * print (visitor.global_index + 1) * visitor.nz * visitor.dims, source.size * print num_cells */ - __pyx_t_10 = __Pyx_PyInt_From_npy_uint64(__pyx_v_visitor->index); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 617, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_From_npy_uint64(__pyx_v_visitor->index); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = PyNumber_Subtract(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 617, __pyx_L1_error) + __pyx_t_12 = PyNumber_Subtract(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_PrintOne(0, __pyx_t_12) < 0) __PYX_ERR(0, 617, __pyx_L1_error) + if (__Pyx_PrintOne(0, __pyx_t_12) < 0) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "yt/geometry/oct_container.pyx":618 + /* "yt/geometry/oct_container.pyx":556 * print "DEST INDEX RAN AHEAD.", * print visitor.index - dest.size * print (visitor.global_index + 1) * visitor.nz * visitor.dims, source.size # <<<<<<<<<<<<<< * print num_cells * raise RuntimeError */ - __pyx_t_12 = __Pyx_PyInt_From_npy_int64((((__pyx_v_visitor->global_index + 1) * __pyx_v_visitor->nz) * __pyx_v_visitor->dims)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_From_npy_int64((((__pyx_v_visitor->global_index + 1) * __pyx_v_visitor->nz) * __pyx_v_visitor->dims)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); @@ -11500,22 +11081,22 @@ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5); __pyx_t_12 = 0; __pyx_t_5 = 0; - if (__Pyx_Print(0, __pyx_t_10, 1) < 0) __PYX_ERR(0, 618, __pyx_L1_error) + if (__Pyx_Print(0, __pyx_t_10, 1) < 0) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "yt/geometry/oct_container.pyx":619 + /* "yt/geometry/oct_container.pyx":557 * print visitor.index - dest.size * print (visitor.global_index + 1) * visitor.nz * visitor.dims, source.size * print num_cells # <<<<<<<<<<<<<< * raise RuntimeError * if num_cells >= 0: */ - __pyx_t_10 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 619, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_PrintOne(0, __pyx_t_10) < 0) __PYX_ERR(0, 619, __pyx_L1_error) + if (__Pyx_PrintOne(0, __pyx_t_10) < 0) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "yt/geometry/oct_container.pyx":620 + /* "yt/geometry/oct_container.pyx":558 * print (visitor.global_index + 1) * visitor.nz * visitor.dims, source.size * print num_cells * raise RuntimeError # <<<<<<<<<<<<<< @@ -11523,9 +11104,9 @@ * return dest */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 620, __pyx_L1_error) + __PYX_ERR(0, 558, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":615 + /* "yt/geometry/oct_container.pyx":553 * print dest.size, source.size, num_cells * raise RuntimeError * if visitor.index > dest.size: # <<<<<<<<<<<<<< @@ -11534,7 +11115,7 @@ */ } - /* "yt/geometry/oct_container.pyx":621 + /* "yt/geometry/oct_container.pyx":559 * print num_cells * raise RuntimeError * if num_cells >= 0: # <<<<<<<<<<<<<< @@ -11544,7 +11125,7 @@ __pyx_t_2 = ((__pyx_v_num_cells >= 0) != 0); if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":622 + /* "yt/geometry/oct_container.pyx":560 * raise RuntimeError * if num_cells >= 0: * return dest # <<<<<<<<<<<<<< @@ -11556,7 +11137,7 @@ __pyx_r = ((PyObject *)__pyx_v_dest); goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":621 + /* "yt/geometry/oct_container.pyx":559 * print num_cells * raise RuntimeError * if num_cells >= 0: # <<<<<<<<<<<<<< @@ -11565,7 +11146,7 @@ */ } - /* "yt/geometry/oct_container.pyx":623 + /* "yt/geometry/oct_container.pyx":561 * if num_cells >= 0: * return dest * return visitor.index - offset # <<<<<<<<<<<<<< @@ -11573,13 +11154,13 @@ * def domain_ind(self, selector, int domain_id = -1): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_10 = __Pyx_PyInt_From_npy_uint64((__pyx_v_visitor->index - __pyx_v_offset)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_From_npy_uint64((__pyx_v_visitor->index - __pyx_v_offset)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":565 + /* "yt/geometry/oct_container.pyx":503 * return header * * def selector_fill(self, SelectorObject selector, # <<<<<<<<<<<<<< @@ -11614,7 +11195,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":625 +/* "yt/geometry/oct_container.pyx":563 * return visitor.index - offset * * def domain_ind(self, selector, int domain_id = -1): # <<<<<<<<<<<<<< @@ -11623,8 +11204,8 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_30domain_ind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_30domain_ind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_27domain_ind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_27domain_ind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_selector = 0; int __pyx_v_domain_id; PyObject *__pyx_r = 0; @@ -11638,7 +11219,9 @@ 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; } @@ -11647,6 +11230,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -11654,11 +11238,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "domain_ind") < 0)) __PYX_ERR(0, 625, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "domain_ind") < 0)) __PYX_ERR(0, 563, __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; @@ -11666,27 +11251,27 @@ } __pyx_v_selector = values[0]; if (values[1]) { - __pyx_v_domain_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L3_error) + __pyx_v_domain_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 563, __pyx_L3_error) } else { __pyx_v_domain_id = ((int)-1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("domain_ind", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 625, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("domain_ind", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.domain_ind", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_29domain_ind(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_domain_id); + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_26domain_ind(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_domain_id); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_29domain_ind(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_selector, int __pyx_v_domain_id) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_26domain_ind(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_selector, int __pyx_v_domain_id) { PyArrayObject *__pyx_v_ind = 0; struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *__pyx_v_visitor = 0; __Pyx_LocalBuf_ND __pyx_pybuffernd_ind; @@ -11710,19 +11295,19 @@ __pyx_pybuffernd_ind.data = NULL; __pyx_pybuffernd_ind.rcbuffer = &__pyx_pybuffer_ind; - /* "yt/geometry/oct_container.pyx":628 + /* "yt/geometry/oct_container.pyx":566 * cdef np.ndarray[np.int64_t, ndim=1] ind * # Here's where we grab the masked items. * ind = np.zeros(self.nocts, 'int64') - 1 # <<<<<<<<<<<<<< * cdef oct_visitors.IndexOcts visitor * visitor = oct_visitors.IndexOcts(self, domain_id) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nocts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nocts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -11739,7 +11324,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_n_s_int64}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __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; @@ -11748,14 +11333,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_n_s_int64}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -11766,15 +11351,15 @@ __Pyx_GIVEREF(__pyx_n_s_int64); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_n_s_int64); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 628, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 566, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -11790,22 +11375,22 @@ } } __pyx_pybuffernd_ind.diminfo[0].strides = __pyx_pybuffernd_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ind.diminfo[0].shape = __pyx_pybuffernd_ind.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 628, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 566, __pyx_L1_error) } __pyx_t_7 = 0; __pyx_v_ind = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/oct_container.pyx":630 + /* "yt/geometry/oct_container.pyx":568 * ind = np.zeros(self.nocts, 'int64') - 1 * cdef oct_visitors.IndexOcts visitor * visitor = oct_visitors.IndexOcts(self, domain_id) # <<<<<<<<<<<<<< * visitor.oct_index = ind * self.visit_all_octs(selector, visitor) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -11813,13 +11398,13 @@ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/oct_container.pyx":631 + /* "yt/geometry/oct_container.pyx":569 * cdef oct_visitors.IndexOcts visitor * visitor = oct_visitors.IndexOcts(self, domain_id) * visitor.oct_index = ind # <<<<<<<<<<<<<< @@ -11827,23 +11412,23 @@ * return ind */ __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_ind)); - if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 631, __pyx_L1_error) + if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 569, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->oct_index, 0); __pyx_v_visitor->oct_index = __pyx_t_11; __pyx_t_11.memview = NULL; __pyx_t_11.data = NULL; - /* "yt/geometry/oct_container.pyx":632 + /* "yt/geometry/oct_container.pyx":570 * visitor = oct_visitors.IndexOcts(self, domain_id) * visitor.oct_index = ind * self.visit_all_octs(selector, visitor) # <<<<<<<<<<<<<< * return ind * */ - if (!(likely(((__pyx_v_selector) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_selector, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 632, __pyx_L1_error) + if (!(likely(((__pyx_v_selector) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_selector, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 570, __pyx_L1_error) ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector), ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL); - /* "yt/geometry/oct_container.pyx":633 + /* "yt/geometry/oct_container.pyx":571 * visitor.oct_index = ind * self.visit_all_octs(selector, visitor) * return ind # <<<<<<<<<<<<<< @@ -11855,7 +11440,7 @@ __pyx_r = ((PyObject *)__pyx_v_ind); goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":625 + /* "yt/geometry/oct_container.pyx":563 * return visitor.index - offset * * def domain_ind(self, selector, int domain_id = -1): # <<<<<<<<<<<<<< @@ -11890,7 +11475,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":638 +/* "yt/geometry/oct_container.pyx":576 * @cython.wraparound(False) * @cython.cdivision(True) * def add(self, int curdom, int curlevel, # <<<<<<<<<<<<<< @@ -11899,8 +11484,8 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_32add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_32add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_29add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_29add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_curdom; int __pyx_v_curlevel; PyArrayObject *__pyx_v_pos = 0; @@ -11917,10 +11502,15 @@ 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; } @@ -11929,21 +11519,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_curdom)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_curlevel)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add", 0, 3, 5, 1); __PYX_ERR(0, 638, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 0, 3, 5, 1); __PYX_ERR(0, 576, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add", 0, 3, 5, 2); __PYX_ERR(0, 638, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 0, 3, 5, 2); __PYX_ERR(0, 576, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip_boundary); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_count_boundary); @@ -11951,12 +11545,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 638, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 576, __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); @@ -11964,30 +11560,30 @@ default: goto __pyx_L5_argtuple_error; } } - __pyx_v_curdom = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_curdom == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 638, __pyx_L3_error) - __pyx_v_curlevel = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_curlevel == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 638, __pyx_L3_error) + __pyx_v_curdom = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_curdom == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 576, __pyx_L3_error) + __pyx_v_curlevel = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_curlevel == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 576, __pyx_L3_error) __pyx_v_pos = ((PyArrayObject *)values[2]); if (values[3]) { - __pyx_v_skip_boundary = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_skip_boundary == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L3_error) + __pyx_v_skip_boundary = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_skip_boundary == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L3_error) } else { __pyx_v_skip_boundary = ((int)1); } if (values[4]) { - __pyx_v_count_boundary = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_count_boundary == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error) + __pyx_v_count_boundary = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_count_boundary == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L3_error) } else { __pyx_v_count_boundary = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 638, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 576, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos), __pyx_ptype_5numpy_ndarray, 1, "pos", 0))) __PYX_ERR(0, 639, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_31add(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_curdom, __pyx_v_curlevel, __pyx_v_pos, __pyx_v_skip_boundary, __pyx_v_count_boundary); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos), __pyx_ptype_5numpy_ndarray, 1, "pos", 0))) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_28add(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_curdom, __pyx_v_curlevel, __pyx_v_pos, __pyx_v_skip_boundary, __pyx_v_count_boundary); /* function exit code */ goto __pyx_L0; @@ -11998,7 +11594,7 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_31add(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_curdom, int __pyx_v_curlevel, PyArrayObject *__pyx_v_pos, int __pyx_v_skip_boundary, int __pyx_v_count_boundary) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_28add(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_curdom, int __pyx_v_curlevel, PyArrayObject *__pyx_v_pos, int __pyx_v_skip_boundary, int __pyx_v_count_boundary) { CYTHON_UNUSED int __pyx_v_level; int __pyx_v_no; int __pyx_v_p; @@ -12018,7 +11614,7 @@ PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; - __pyx_t_5numpy_int64_t __pyx_t_2; + __pyx_t_5numpy_uint64_t __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; @@ -12036,11 +11632,11 @@ __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 576, __pyx_L1_error) } __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_pos.diminfo[1].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_pos.diminfo[1].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[1]; - /* "yt/geometry/oct_container.pyx":644 + /* "yt/geometry/oct_container.pyx":582 * cdef int level, no, p, i, j, k * cdef int ind[3] * cdef int nb = 0 # <<<<<<<<<<<<<< @@ -12049,7 +11645,7 @@ */ __pyx_v_nb = 0; - /* "yt/geometry/oct_container.pyx":646 + /* "yt/geometry/oct_container.pyx":584 * cdef int nb = 0 * cdef Oct *cur * cdef Oct *next = NULL # <<<<<<<<<<<<<< @@ -12058,20 +11654,20 @@ */ __pyx_v_next = NULL; - /* "yt/geometry/oct_container.pyx":650 + /* "yt/geometry/oct_container.pyx":588 * cdef np.float64_t cp[3] * cdef np.float64_t dds[3] * no = pos.shape[0] #number of octs # <<<<<<<<<<<<<< * if curdom > self.num_domains: return 0 - * cdef OctAllocationContainer *cont = self.domains[curdom - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(curdom - 1) */ __pyx_v_no = (__pyx_v_pos->dimensions[0]); - /* "yt/geometry/oct_container.pyx":651 + /* "yt/geometry/oct_container.pyx":589 * cdef np.float64_t dds[3] * no = pos.shape[0] #number of octs * if curdom > self.num_domains: return 0 # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont = self.domains[curdom - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(curdom - 1) * cdef int initial = cont.n_assigned */ __pyx_t_1 = ((__pyx_v_curdom > __pyx_v_self->num_domains) != 0); @@ -12082,18 +11678,18 @@ goto __pyx_L0; } - /* "yt/geometry/oct_container.pyx":652 + /* "yt/geometry/oct_container.pyx":590 * no = pos.shape[0] #number of octs * if curdom > self.num_domains: return 0 - * cdef OctAllocationContainer *cont = self.domains[curdom - 1] # <<<<<<<<<<<<<< + * cdef OctAllocationContainer *cont = self.domains.get_cont(curdom - 1) # <<<<<<<<<<<<<< * cdef int initial = cont.n_assigned * cdef int in_boundary = 0 */ - __pyx_v_cont = (__pyx_v_self->domains[(__pyx_v_curdom - 1)]); + __pyx_v_cont = __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(__pyx_v_self->domains, (__pyx_v_curdom - 1)); - /* "yt/geometry/oct_container.pyx":653 + /* "yt/geometry/oct_container.pyx":591 * if curdom > self.num_domains: return 0 - * cdef OctAllocationContainer *cont = self.domains[curdom - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(curdom - 1) * cdef int initial = cont.n_assigned # <<<<<<<<<<<<<< * cdef int in_boundary = 0 * # How do we bootstrap ourselves? @@ -12101,8 +11697,8 @@ __pyx_t_2 = __pyx_v_cont->n_assigned; __pyx_v_initial = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":654 - * cdef OctAllocationContainer *cont = self.domains[curdom - 1] + /* "yt/geometry/oct_container.pyx":592 + * cdef OctAllocationContainer *cont = self.domains.get_cont(curdom - 1) * cdef int initial = cont.n_assigned * cdef int in_boundary = 0 # <<<<<<<<<<<<<< * # How do we bootstrap ourselves? @@ -12110,7 +11706,7 @@ */ __pyx_v_in_boundary = 0; - /* "yt/geometry/oct_container.pyx":656 + /* "yt/geometry/oct_container.pyx":594 * cdef int in_boundary = 0 * # How do we bootstrap ourselves? * for p in range(no): # <<<<<<<<<<<<<< @@ -12121,7 +11717,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_p = __pyx_t_4; - /* "yt/geometry/oct_container.pyx":659 + /* "yt/geometry/oct_container.pyx":597 * #for every oct we're trying to add find the * #floating point unitary position on this level * in_boundary = 0 # <<<<<<<<<<<<<< @@ -12130,7 +11726,7 @@ */ __pyx_v_in_boundary = 0; - /* "yt/geometry/oct_container.pyx":660 + /* "yt/geometry/oct_container.pyx":598 * #floating point unitary position on this level * in_boundary = 0 * for i in range(3): # <<<<<<<<<<<<<< @@ -12140,7 +11736,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < 3; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "yt/geometry/oct_container.pyx":661 + /* "yt/geometry/oct_container.pyx":599 * in_boundary = 0 * for i in range(3): * pp[i] = pos[p, i] # <<<<<<<<<<<<<< @@ -12151,7 +11747,7 @@ __pyx_t_7 = __pyx_v_i; (__pyx_v_pp[__pyx_v_i]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_pos.diminfo[1].strides)); - /* "yt/geometry/oct_container.pyx":662 + /* "yt/geometry/oct_container.pyx":600 * for i in range(3): * pp[i] = pos[p, i] * dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i] # <<<<<<<<<<<<<< @@ -12160,7 +11756,7 @@ */ (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_self->nn[__pyx_v_i])); - /* "yt/geometry/oct_container.pyx":663 + /* "yt/geometry/oct_container.pyx":601 * pp[i] = pos[p, i] * dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i] * ind[i] = ((pp[i] - self.DLE[i])/dds[i]) # <<<<<<<<<<<<<< @@ -12169,7 +11765,7 @@ */ (__pyx_v_ind[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t)(((__pyx_v_pp[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))); - /* "yt/geometry/oct_container.pyx":664 + /* "yt/geometry/oct_container.pyx":602 * dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i] * ind[i] = ((pp[i] - self.DLE[i])/dds[i]) * cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i] # <<<<<<<<<<<<<< @@ -12178,7 +11774,7 @@ */ (__pyx_v_cp[__pyx_v_i]) = ((((__pyx_v_ind[__pyx_v_i]) + 0.5) * (__pyx_v_dds[__pyx_v_i])) + (__pyx_v_self->DLE[__pyx_v_i])); - /* "yt/geometry/oct_container.pyx":665 + /* "yt/geometry/oct_container.pyx":603 * ind[i] = ((pp[i] - self.DLE[i])/dds[i]) * cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i] * if ind[i] < 0 or ind[i] >= self.nn[i]: # <<<<<<<<<<<<<< @@ -12196,7 +11792,7 @@ __pyx_L9_bool_binop_done:; if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":666 + /* "yt/geometry/oct_container.pyx":604 * cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i] * if ind[i] < 0 or ind[i] >= self.nn[i]: * in_boundary = 1 # <<<<<<<<<<<<<< @@ -12205,7 +11801,7 @@ */ __pyx_v_in_boundary = 1; - /* "yt/geometry/oct_container.pyx":665 + /* "yt/geometry/oct_container.pyx":603 * ind[i] = ((pp[i] - self.DLE[i])/dds[i]) * cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i] * if ind[i] < 0 or ind[i] >= self.nn[i]: # <<<<<<<<<<<<<< @@ -12215,7 +11811,7 @@ } } - /* "yt/geometry/oct_container.pyx":667 + /* "yt/geometry/oct_container.pyx":605 * if ind[i] < 0 or ind[i] >= self.nn[i]: * in_boundary = 1 * if skip_boundary == in_boundary == 1: # <<<<<<<<<<<<<< @@ -12229,7 +11825,7 @@ __pyx_t_8 = (__pyx_t_1 != 0); if (__pyx_t_8) { - /* "yt/geometry/oct_container.pyx":668 + /* "yt/geometry/oct_container.pyx":606 * in_boundary = 1 * if skip_boundary == in_boundary == 1: * nb += count_boundary # <<<<<<<<<<<<<< @@ -12238,7 +11834,7 @@ */ __pyx_v_nb = (__pyx_v_nb + __pyx_v_count_boundary); - /* "yt/geometry/oct_container.pyx":669 + /* "yt/geometry/oct_container.pyx":607 * if skip_boundary == in_boundary == 1: * nb += count_boundary * continue # <<<<<<<<<<<<<< @@ -12247,7 +11843,7 @@ */ goto __pyx_L4_continue; - /* "yt/geometry/oct_container.pyx":667 + /* "yt/geometry/oct_container.pyx":605 * if ind[i] < 0 or ind[i] >= self.nn[i]: * in_boundary = 1 * if skip_boundary == in_boundary == 1: # <<<<<<<<<<<<<< @@ -12256,7 +11852,7 @@ */ } - /* "yt/geometry/oct_container.pyx":670 + /* "yt/geometry/oct_container.pyx":608 * nb += count_boundary * continue * cur = self.next_root(curdom, ind) # <<<<<<<<<<<<<< @@ -12265,7 +11861,7 @@ */ __pyx_v_cur = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->next_root(__pyx_v_self, __pyx_v_curdom, __pyx_v_ind); - /* "yt/geometry/oct_container.pyx":671 + /* "yt/geometry/oct_container.pyx":609 * continue * cur = self.next_root(curdom, ind) * if cur == NULL: raise RuntimeError # <<<<<<<<<<<<<< @@ -12275,10 +11871,10 @@ __pyx_t_8 = ((__pyx_v_cur == NULL) != 0); if (__pyx_t_8) { __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 671, __pyx_L1_error) + __PYX_ERR(0, 609, __pyx_L1_error) } - /* "yt/geometry/oct_container.pyx":674 + /* "yt/geometry/oct_container.pyx":612 * # Now we find the location we want * # Note that RAMSES I think 1-findiceses levels, but we don't. * for level in range(curlevel): # <<<<<<<<<<<<<< @@ -12289,7 +11885,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_5; __pyx_t_9+=1) { __pyx_v_level = __pyx_t_9; - /* "yt/geometry/oct_container.pyx":677 + /* "yt/geometry/oct_container.pyx":615 * # At every level, find the cell this oct * # lives inside * for i in range(3): # <<<<<<<<<<<<<< @@ -12299,7 +11895,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "yt/geometry/oct_container.pyx":679 + /* "yt/geometry/oct_container.pyx":617 * for i in range(3): * #as we get deeper, oct size halves * dds[i] = dds[i] / 2.0 # <<<<<<<<<<<<<< @@ -12308,7 +11904,7 @@ */ (__pyx_v_dds[__pyx_v_i]) = ((__pyx_v_dds[__pyx_v_i]) / 2.0); - /* "yt/geometry/oct_container.pyx":680 + /* "yt/geometry/oct_container.pyx":618 * #as we get deeper, oct size halves * dds[i] = dds[i] / 2.0 * if cp[i] > pp[i]: # <<<<<<<<<<<<<< @@ -12318,7 +11914,7 @@ __pyx_t_8 = (((__pyx_v_cp[__pyx_v_i]) > (__pyx_v_pp[__pyx_v_i])) != 0); if (__pyx_t_8) { - /* "yt/geometry/oct_container.pyx":681 + /* "yt/geometry/oct_container.pyx":619 * dds[i] = dds[i] / 2.0 * if cp[i] > pp[i]: * ind[i] = 0 # <<<<<<<<<<<<<< @@ -12327,7 +11923,7 @@ */ (__pyx_v_ind[__pyx_v_i]) = 0; - /* "yt/geometry/oct_container.pyx":682 + /* "yt/geometry/oct_container.pyx":620 * if cp[i] > pp[i]: * ind[i] = 0 * cp[i] -= dds[i]/2.0 # <<<<<<<<<<<<<< @@ -12337,7 +11933,7 @@ __pyx_t_11 = __pyx_v_i; (__pyx_v_cp[__pyx_t_11]) = ((__pyx_v_cp[__pyx_t_11]) - ((__pyx_v_dds[__pyx_v_i]) / 2.0)); - /* "yt/geometry/oct_container.pyx":680 + /* "yt/geometry/oct_container.pyx":618 * #as we get deeper, oct size halves * dds[i] = dds[i] / 2.0 * if cp[i] > pp[i]: # <<<<<<<<<<<<<< @@ -12347,7 +11943,7 @@ goto __pyx_L17; } - /* "yt/geometry/oct_container.pyx":684 + /* "yt/geometry/oct_container.pyx":622 * cp[i] -= dds[i]/2.0 * else: * ind[i] = 1 # <<<<<<<<<<<<<< @@ -12357,7 +11953,7 @@ /*else*/ { (__pyx_v_ind[__pyx_v_i]) = 1; - /* "yt/geometry/oct_container.pyx":685 + /* "yt/geometry/oct_container.pyx":623 * else: * ind[i] = 1 * cp[i] += dds[i]/2.0 # <<<<<<<<<<<<<< @@ -12370,7 +11966,7 @@ __pyx_L17:; } - /* "yt/geometry/oct_container.pyx":687 + /* "yt/geometry/oct_container.pyx":625 * cp[i] += dds[i]/2.0 * # Check if it has not been allocated * cur = self.next_child(curdom, ind, cur) # <<<<<<<<<<<<<< @@ -12380,7 +11976,7 @@ __pyx_v_cur = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->next_child(__pyx_v_self, __pyx_v_curdom, __pyx_v_ind, __pyx_v_cur); } - /* "yt/geometry/oct_container.pyx":689 + /* "yt/geometry/oct_container.pyx":627 * cur = self.next_child(curdom, ind, cur) * # Now we should be at the right level * cur.domain = curdom # <<<<<<<<<<<<<< @@ -12389,7 +11985,7 @@ */ __pyx_v_cur->domain = __pyx_v_curdom; - /* "yt/geometry/oct_container.pyx":690 + /* "yt/geometry/oct_container.pyx":628 * # Now we should be at the right level * cur.domain = curdom * cur.file_ind = p # <<<<<<<<<<<<<< @@ -12400,7 +11996,7 @@ __pyx_L4_continue:; } - /* "yt/geometry/oct_container.pyx":691 + /* "yt/geometry/oct_container.pyx":629 * cur.domain = curdom * cur.file_ind = p * return cont.n_assigned - initial + nb # <<<<<<<<<<<<<< @@ -12408,13 +12004,13 @@ * def allocate_domains(self, domain_counts): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = __Pyx_PyInt_From_npy_int64(((__pyx_v_cont->n_assigned - __pyx_v_initial) + __pyx_v_nb)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_From_npy_uint64(((__pyx_v_cont->n_assigned - __pyx_v_initial) + __pyx_v_nb)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_r = __pyx_t_12; __pyx_t_12 = 0; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":638 + /* "yt/geometry/oct_container.pyx":576 * @cython.wraparound(False) * @cython.cdivision(True) * def add(self, int curdom, int curlevel, # <<<<<<<<<<<<<< @@ -12442,204 +12038,140 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":693 +/* "yt/geometry/oct_container.pyx":631 * return cont.n_assigned - initial + nb * * def allocate_domains(self, domain_counts): # <<<<<<<<<<<<<< * cdef int count, i - * cdef OctAllocationContainer *cur = self.cont + * self.num_domains = len(domain_counts) # 1-indexed */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_34allocate_domains(PyObject *__pyx_v_self, PyObject *__pyx_v_domain_counts); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_34allocate_domains(PyObject *__pyx_v_self, PyObject *__pyx_v_domain_counts) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_31allocate_domains(PyObject *__pyx_v_self, PyObject *__pyx_v_domain_counts); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_31allocate_domains(PyObject *__pyx_v_self, PyObject *__pyx_v_domain_counts) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("allocate_domains (wrapper)", 0); - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_33allocate_domains(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v_domain_counts)); + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_30allocate_domains(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v_domain_counts)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_33allocate_domains(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_domain_counts) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_30allocate_domains(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_domain_counts) { int __pyx_v_count; - int __pyx_v_i; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_cur; + CYTHON_UNUSED int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *(*__pyx_t_5)(PyObject *); - PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; int __pyx_t_7; - int __pyx_t_8; __Pyx_RefNannySetupContext("allocate_domains", 0); - /* "yt/geometry/oct_container.pyx":695 + /* "yt/geometry/oct_container.pyx":633 * def allocate_domains(self, domain_counts): * cdef int count, i - * cdef OctAllocationContainer *cur = self.cont # <<<<<<<<<<<<<< - * assert(cur == NULL) - * self.num_domains = len(domain_counts) # 1-indexed - */ - __pyx_t_1 = __pyx_v_self->cont; - __pyx_v_cur = __pyx_t_1; - - /* "yt/geometry/oct_container.pyx":696 - * cdef int count, i - * cdef OctAllocationContainer *cur = self.cont - * assert(cur == NULL) # <<<<<<<<<<<<<< - * self.num_domains = len(domain_counts) # 1-indexed - * self.domains = malloc( - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!Py_OptimizeFlag)) { - if (unlikely(!((__pyx_v_cur == NULL) != 0))) { - PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 696, __pyx_L1_error) - } - } - #endif - - /* "yt/geometry/oct_container.pyx":697 - * cdef OctAllocationContainer *cur = self.cont - * assert(cur == NULL) * self.num_domains = len(domain_counts) # 1-indexed # <<<<<<<<<<<<<< - * self.domains = malloc( - * sizeof(OctAllocationContainer *) * len(domain_counts)) - */ - __pyx_t_2 = PyObject_Length(__pyx_v_domain_counts); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 697, __pyx_L1_error) - __pyx_v_self->num_domains = __pyx_t_2; - - /* "yt/geometry/oct_container.pyx":699 - * self.num_domains = len(domain_counts) # 1-indexed - * self.domains = malloc( - * sizeof(OctAllocationContainer *) * len(domain_counts)) # <<<<<<<<<<<<<< * for i, count in enumerate(domain_counts): - * cur = allocate_octs(count, cur) + * self.domains.append(count) */ - __pyx_t_2 = PyObject_Length(__pyx_v_domain_counts); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_1 = PyObject_Length(__pyx_v_domain_counts); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_v_self->num_domains = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":698 - * assert(cur == NULL) + /* "yt/geometry/oct_container.pyx":634 + * cdef int count, i * self.num_domains = len(domain_counts) # 1-indexed - * self.domains = malloc( # <<<<<<<<<<<<<< - * sizeof(OctAllocationContainer *) * len(domain_counts)) - * for i, count in enumerate(domain_counts): - */ - __pyx_v_self->domains = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer **)malloc(((sizeof(struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)) * __pyx_t_2))); - - /* "yt/geometry/oct_container.pyx":700 - * self.domains = malloc( - * sizeof(OctAllocationContainer *) * len(domain_counts)) * for i, count in enumerate(domain_counts): # <<<<<<<<<<<<<< - * cur = allocate_octs(count, cur) - * if self.cont == NULL: self.cont = cur + * self.domains.append(count) + * */ - __pyx_t_3 = 0; + __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_v_domain_counts)) || PyTuple_CheckExact(__pyx_v_domain_counts)) { - __pyx_t_4 = __pyx_v_domain_counts; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0; - __pyx_t_5 = NULL; + __pyx_t_3 = __pyx_v_domain_counts; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + __pyx_t_4 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_domain_counts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_domain_counts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); #endif } else { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); #endif } } else { - __pyx_t_6 = __pyx_t_5(__pyx_t_4); - if (unlikely(!__pyx_t_6)) { + __pyx_t_5 = __pyx_t_4(__pyx_t_3); + if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 700, __pyx_L1_error) + else __PYX_ERR(0, 634, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_count = __pyx_t_7; - __pyx_v_i = __pyx_t_3; - __pyx_t_3 = (__pyx_t_3 + 1); - - /* "yt/geometry/oct_container.pyx":701 - * sizeof(OctAllocationContainer *) * len(domain_counts)) - * for i, count in enumerate(domain_counts): - * cur = allocate_octs(count, cur) # <<<<<<<<<<<<<< - * if self.cont == NULL: self.cont = cur - * self.domains[i] = cur - */ - __pyx_v_cur = __pyx_f_2yt_8geometry_13oct_container_allocate_octs(__pyx_v_count, __pyx_v_cur); + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_count = __pyx_t_6; + __pyx_v_i = __pyx_t_2; + __pyx_t_2 = (__pyx_t_2 + 1); - /* "yt/geometry/oct_container.pyx":702 + /* "yt/geometry/oct_container.pyx":635 + * self.num_domains = len(domain_counts) # 1-indexed * for i, count in enumerate(domain_counts): - * cur = allocate_octs(count, cur) - * if self.cont == NULL: self.cont = cur # <<<<<<<<<<<<<< - * self.domains[i] = cur - * - */ - __pyx_t_8 = ((__pyx_v_self->cont == NULL) != 0); - if (__pyx_t_8) { - __pyx_v_self->cont = __pyx_v_cur; - } - - /* "yt/geometry/oct_container.pyx":703 - * cur = allocate_octs(count, cur) - * if self.cont == NULL: self.cont = cur - * self.domains[i] = cur # <<<<<<<<<<<<<< + * self.domains.append(count) # <<<<<<<<<<<<<< * * cdef void append_domain(self, np.int64_t domain_count): */ - (__pyx_v_self->domains[__pyx_v_i]) = __pyx_v_cur; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->domains), __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 635, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/oct_container.pyx":700 - * self.domains = malloc( - * sizeof(OctAllocationContainer *) * len(domain_counts)) + /* "yt/geometry/oct_container.pyx":634 + * cdef int count, i + * self.num_domains = len(domain_counts) # 1-indexed * for i, count in enumerate(domain_counts): # <<<<<<<<<<<<<< - * cur = allocate_octs(count, cur) - * if self.cont == NULL: self.cont = cur + * self.domains.append(count) + * */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/oct_container.pyx":693 + /* "yt/geometry/oct_container.pyx":631 * return cont.n_assigned - initial + nb * * def allocate_domains(self, domain_counts): # <<<<<<<<<<<<<< * cdef int count, i - * cdef OctAllocationContainer *cur = self.cont + * self.num_domains = len(domain_counts) # 1-indexed */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.allocate_domains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -12648,145 +12180,60 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":705 - * self.domains[i] = cur +/* "yt/geometry/oct_container.pyx":637 + * self.domains.append(count) * * cdef void append_domain(self, np.int64_t domain_count): # <<<<<<<<<<<<<< * self.num_domains += 1 - * self.domains = realloc(self.domains, + * self.domains.append(domain_count) */ static void __pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_append_domain(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_domain_count) { - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_cur; __Pyx_RefNannyDeclarations - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; __Pyx_RefNannySetupContext("append_domain", 0); - /* "yt/geometry/oct_container.pyx":706 + /* "yt/geometry/oct_container.pyx":638 * * cdef void append_domain(self, np.int64_t domain_count): * self.num_domains += 1 # <<<<<<<<<<<<<< - * self.domains = realloc(self.domains, - * sizeof(OctAllocationContainer *) * self.num_domains) + * self.domains.append(domain_count) + * */ __pyx_v_self->num_domains = (__pyx_v_self->num_domains + 1); - /* "yt/geometry/oct_container.pyx":707 + /* "yt/geometry/oct_container.pyx":639 * cdef void append_domain(self, np.int64_t domain_count): * self.num_domains += 1 - * self.domains = realloc(self.domains, # <<<<<<<<<<<<<< - * sizeof(OctAllocationContainer *) * self.num_domains) - * if self.domains == NULL: raise RuntimeError - */ - __pyx_v_self->domains = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer **)realloc(__pyx_v_self->domains, ((sizeof(struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)) * __pyx_v_self->num_domains))); - - /* "yt/geometry/oct_container.pyx":709 - * self.domains = realloc(self.domains, - * sizeof(OctAllocationContainer *) * self.num_domains) - * if self.domains == NULL: raise RuntimeError # <<<<<<<<<<<<<< - * self.domains[self.num_domains - 1] = NULL - * cdef OctAllocationContainer *cur = NULL - */ - __pyx_t_1 = ((__pyx_v_self->domains == NULL) != 0); - if (__pyx_t_1) { - __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 709, __pyx_L1_error) - } - - /* "yt/geometry/oct_container.pyx":710 - * sizeof(OctAllocationContainer *) * self.num_domains) - * if self.domains == NULL: raise RuntimeError - * self.domains[self.num_domains - 1] = NULL # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cur = NULL - * if self.num_domains > 1: - */ - (__pyx_v_self->domains[(__pyx_v_self->num_domains - 1)]) = NULL; - - /* "yt/geometry/oct_container.pyx":711 - * if self.domains == NULL: raise RuntimeError - * self.domains[self.num_domains - 1] = NULL - * cdef OctAllocationContainer *cur = NULL # <<<<<<<<<<<<<< - * if self.num_domains > 1: - * cur = self.domains[self.num_domains - 2] - */ - __pyx_v_cur = NULL; - - /* "yt/geometry/oct_container.pyx":712 - * self.domains[self.num_domains - 1] = NULL - * cdef OctAllocationContainer *cur = NULL - * if self.num_domains > 1: # <<<<<<<<<<<<<< - * cur = self.domains[self.num_domains - 2] - * cur = allocate_octs(domain_count, cur) - */ - __pyx_t_1 = ((__pyx_v_self->num_domains > 1) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/oct_container.pyx":713 - * cdef OctAllocationContainer *cur = NULL - * if self.num_domains > 1: - * cur = self.domains[self.num_domains - 2] # <<<<<<<<<<<<<< - * cur = allocate_octs(domain_count, cur) - * if self.cont == NULL: self.cont = cur - */ - __pyx_v_cur = (__pyx_v_self->domains[(__pyx_v_self->num_domains - 2)]); - - /* "yt/geometry/oct_container.pyx":712 - * self.domains[self.num_domains - 1] = NULL - * cdef OctAllocationContainer *cur = NULL - * if self.num_domains > 1: # <<<<<<<<<<<<<< - * cur = self.domains[self.num_domains - 2] - * cur = allocate_octs(domain_count, cur) - */ - } - - /* "yt/geometry/oct_container.pyx":714 - * if self.num_domains > 1: - * cur = self.domains[self.num_domains - 2] - * cur = allocate_octs(domain_count, cur) # <<<<<<<<<<<<<< - * if self.cont == NULL: self.cont = cur - * self.domains[self.num_domains - 1] = cur - */ - __pyx_v_cur = __pyx_f_2yt_8geometry_13oct_container_allocate_octs(__pyx_v_domain_count, __pyx_v_cur); - - /* "yt/geometry/oct_container.pyx":715 - * cur = self.domains[self.num_domains - 2] - * cur = allocate_octs(domain_count, cur) - * if self.cont == NULL: self.cont = cur # <<<<<<<<<<<<<< - * self.domains[self.num_domains - 1] = cur - * - */ - __pyx_t_1 = ((__pyx_v_self->cont == NULL) != 0); - if (__pyx_t_1) { - __pyx_v_self->cont = __pyx_v_cur; - } - - /* "yt/geometry/oct_container.pyx":716 - * cur = allocate_octs(domain_count, cur) - * if self.cont == NULL: self.cont = cur - * self.domains[self.num_domains - 1] = cur # <<<<<<<<<<<<<< + * self.domains.append(domain_count) # <<<<<<<<<<<<<< * * cdef Oct* next_root(self, int domain_id, int ind[3]): */ - (__pyx_v_self->domains[(__pyx_v_self->num_domains - 1)]) = __pyx_v_cur; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_domain_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->domains), __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":705 - * self.domains[i] = cur + /* "yt/geometry/oct_container.pyx":637 + * self.domains.append(count) * * cdef void append_domain(self, np.int64_t domain_count): # <<<<<<<<<<<<<< * self.num_domains += 1 - * self.domains = realloc(self.domains, + * self.domains.append(domain_count) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.oct_container.OctreeContainer.append_domain", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("yt.geometry.oct_container.OctreeContainer.append_domain", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/oct_container.pyx":718 - * self.domains[self.num_domains - 1] = cur +/* "yt/geometry/oct_container.pyx":641 + * self.domains.append(domain_count) * * cdef Oct* next_root(self, int domain_id, int ind[3]): # <<<<<<<<<<<<<< * cdef Oct *next = self.root_mesh[ind[0]][ind[1]][ind[2]] @@ -12801,20 +12248,20 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("next_root", 0); - /* "yt/geometry/oct_container.pyx":719 + /* "yt/geometry/oct_container.pyx":642 * * cdef Oct* next_root(self, int domain_id, int ind[3]): * cdef Oct *next = self.root_mesh[ind[0]][ind[1]][ind[2]] # <<<<<<<<<<<<<< * if next != NULL: return next - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) */ __pyx_v_next = (((__pyx_v_self->root_mesh[(__pyx_v_ind[0])])[(__pyx_v_ind[1])])[(__pyx_v_ind[2])]); - /* "yt/geometry/oct_container.pyx":720 + /* "yt/geometry/oct_container.pyx":643 * cdef Oct* next_root(self, int domain_id, int ind[3]): * cdef Oct *next = self.root_mesh[ind[0]][ind[1]][ind[2]] * if next != NULL: return next # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) * if cont.n_assigned >= cont.n: raise RuntimeError */ __pyx_t_1 = ((__pyx_v_next != NULL) != 0); @@ -12823,48 +12270,48 @@ goto __pyx_L0; } - /* "yt/geometry/oct_container.pyx":721 + /* "yt/geometry/oct_container.pyx":644 * cdef Oct *next = self.root_mesh[ind[0]][ind[1]][ind[2]] * if next != NULL: return next - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] # <<<<<<<<<<<<<< + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) # <<<<<<<<<<<<<< * if cont.n_assigned >= cont.n: raise RuntimeError - * next = &cont.my_octs[cont.n_assigned] + * next = &cont.my_objs[cont.n_assigned] */ - __pyx_v_cont = (__pyx_v_self->domains[(__pyx_v_domain_id - 1)]); + __pyx_v_cont = __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(__pyx_v_self->domains, (__pyx_v_domain_id - 1)); - /* "yt/geometry/oct_container.pyx":722 + /* "yt/geometry/oct_container.pyx":645 * if next != NULL: return next - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) * if cont.n_assigned >= cont.n: raise RuntimeError # <<<<<<<<<<<<<< - * next = &cont.my_octs[cont.n_assigned] + * next = &cont.my_objs[cont.n_assigned] * cont.n_assigned += 1 */ __pyx_t_1 = ((__pyx_v_cont->n_assigned >= __pyx_v_cont->n) != 0); if (__pyx_t_1) { __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 722, __pyx_L1_error) + __PYX_ERR(0, 645, __pyx_L1_error) } - /* "yt/geometry/oct_container.pyx":723 - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + /* "yt/geometry/oct_container.pyx":646 + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) * if cont.n_assigned >= cont.n: raise RuntimeError - * next = &cont.my_octs[cont.n_assigned] # <<<<<<<<<<<<<< + * next = &cont.my_objs[cont.n_assigned] # <<<<<<<<<<<<<< * cont.n_assigned += 1 * self.root_mesh[ind[0]][ind[1]][ind[2]] = next */ - __pyx_v_next = (&(__pyx_v_cont->my_octs[__pyx_v_cont->n_assigned])); + __pyx_v_next = (&(__pyx_v_cont->my_objs[__pyx_v_cont->n_assigned])); - /* "yt/geometry/oct_container.pyx":724 + /* "yt/geometry/oct_container.pyx":647 * if cont.n_assigned >= cont.n: raise RuntimeError - * next = &cont.my_octs[cont.n_assigned] + * next = &cont.my_objs[cont.n_assigned] * cont.n_assigned += 1 # <<<<<<<<<<<<<< * self.root_mesh[ind[0]][ind[1]][ind[2]] = next * self.nocts += 1 */ __pyx_v_cont->n_assigned = (__pyx_v_cont->n_assigned + 1); - /* "yt/geometry/oct_container.pyx":725 - * next = &cont.my_octs[cont.n_assigned] + /* "yt/geometry/oct_container.pyx":648 + * next = &cont.my_objs[cont.n_assigned] * cont.n_assigned += 1 * self.root_mesh[ind[0]][ind[1]][ind[2]] = next # <<<<<<<<<<<<<< * self.nocts += 1 @@ -12872,7 +12319,7 @@ */ (((__pyx_v_self->root_mesh[(__pyx_v_ind[0])])[(__pyx_v_ind[1])])[(__pyx_v_ind[2])]) = __pyx_v_next; - /* "yt/geometry/oct_container.pyx":726 + /* "yt/geometry/oct_container.pyx":649 * cont.n_assigned += 1 * self.root_mesh[ind[0]][ind[1]][ind[2]] = next * self.nocts += 1 # <<<<<<<<<<<<<< @@ -12881,7 +12328,7 @@ */ __pyx_v_self->nocts = (__pyx_v_self->nocts + 1); - /* "yt/geometry/oct_container.pyx":727 + /* "yt/geometry/oct_container.pyx":650 * self.root_mesh[ind[0]][ind[1]][ind[2]] = next * self.nocts += 1 * return next # <<<<<<<<<<<<<< @@ -12891,8 +12338,8 @@ __pyx_r = __pyx_v_next; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":718 - * self.domains[self.num_domains - 1] = cur + /* "yt/geometry/oct_container.pyx":641 + * self.domains.append(domain_count) * * cdef Oct* next_root(self, int domain_id, int ind[3]): # <<<<<<<<<<<<<< * cdef Oct *next = self.root_mesh[ind[0]][ind[1]][ind[2]] @@ -12901,14 +12348,14 @@ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.oct_container.OctreeContainer.next_root", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.oct_container.OctreeContainer.next_root", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/oct_container.pyx":729 +/* "yt/geometry/oct_container.pyx":652 * return next * * cdef Oct* next_child(self, int domain_id, int ind[3], Oct *parent): # <<<<<<<<<<<<<< @@ -12926,7 +12373,7 @@ int __pyx_t_2; __Pyx_RefNannySetupContext("next_child", 0); - /* "yt/geometry/oct_container.pyx":731 + /* "yt/geometry/oct_container.pyx":654 * cdef Oct* next_child(self, int domain_id, int ind[3], Oct *parent): * cdef int i * cdef Oct *next = NULL # <<<<<<<<<<<<<< @@ -12935,7 +12382,7 @@ */ __pyx_v_next = NULL; - /* "yt/geometry/oct_container.pyx":732 + /* "yt/geometry/oct_container.pyx":655 * cdef int i * cdef Oct *next = NULL * if parent.children != NULL: # <<<<<<<<<<<<<< @@ -12945,7 +12392,7 @@ __pyx_t_1 = ((__pyx_v_parent->children != NULL) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":733 + /* "yt/geometry/oct_container.pyx":656 * cdef Oct *next = NULL * if parent.children != NULL: * next = parent.children[cind(ind[0],ind[1],ind[2])] # <<<<<<<<<<<<<< @@ -12954,7 +12401,7 @@ */ __pyx_v_next = (__pyx_v_parent->children[__pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_ind[0]), (__pyx_v_ind[1]), (__pyx_v_ind[2]))]); - /* "yt/geometry/oct_container.pyx":732 + /* "yt/geometry/oct_container.pyx":655 * cdef int i * cdef Oct *next = NULL * if parent.children != NULL: # <<<<<<<<<<<<<< @@ -12964,7 +12411,7 @@ goto __pyx_L3; } - /* "yt/geometry/oct_container.pyx":736 + /* "yt/geometry/oct_container.pyx":659 * else: * # This *8 does NOT need to be made generic. * parent.children = malloc(sizeof(Oct *) * 8) # <<<<<<<<<<<<<< @@ -12974,7 +12421,7 @@ /*else*/ { __pyx_v_parent->children = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **)malloc(((sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)) * 8))); - /* "yt/geometry/oct_container.pyx":737 + /* "yt/geometry/oct_container.pyx":660 * # This *8 does NOT need to be made generic. * parent.children = malloc(sizeof(Oct *) * 8) * for i in range(8): # <<<<<<<<<<<<<< @@ -12984,23 +12431,23 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 8; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":738 + /* "yt/geometry/oct_container.pyx":661 * parent.children = malloc(sizeof(Oct *) * 8) * for i in range(8): * parent.children[i] = NULL # <<<<<<<<<<<<<< * if next != NULL: return next - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) */ (__pyx_v_parent->children[__pyx_v_i]) = NULL; } } __pyx_L3:; - /* "yt/geometry/oct_container.pyx":739 + /* "yt/geometry/oct_container.pyx":662 * for i in range(8): * parent.children[i] = NULL * if next != NULL: return next # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) * if cont.n_assigned >= cont.n: raise RuntimeError */ __pyx_t_1 = ((__pyx_v_next != NULL) != 0); @@ -13009,48 +12456,48 @@ goto __pyx_L0; } - /* "yt/geometry/oct_container.pyx":740 + /* "yt/geometry/oct_container.pyx":663 * parent.children[i] = NULL * if next != NULL: return next - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] # <<<<<<<<<<<<<< + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) # <<<<<<<<<<<<<< * if cont.n_assigned >= cont.n: raise RuntimeError - * next = &cont.my_octs[cont.n_assigned] + * next = &cont.my_objs[cont.n_assigned] */ - __pyx_v_cont = (__pyx_v_self->domains[(__pyx_v_domain_id - 1)]); + __pyx_v_cont = __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(__pyx_v_self->domains, (__pyx_v_domain_id - 1)); - /* "yt/geometry/oct_container.pyx":741 + /* "yt/geometry/oct_container.pyx":664 * if next != NULL: return next - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) * if cont.n_assigned >= cont.n: raise RuntimeError # <<<<<<<<<<<<<< - * next = &cont.my_octs[cont.n_assigned] + * next = &cont.my_objs[cont.n_assigned] * cont.n_assigned += 1 */ __pyx_t_1 = ((__pyx_v_cont->n_assigned >= __pyx_v_cont->n) != 0); if (__pyx_t_1) { __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 741, __pyx_L1_error) + __PYX_ERR(0, 664, __pyx_L1_error) } - /* "yt/geometry/oct_container.pyx":742 - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + /* "yt/geometry/oct_container.pyx":665 + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) * if cont.n_assigned >= cont.n: raise RuntimeError - * next = &cont.my_octs[cont.n_assigned] # <<<<<<<<<<<<<< + * next = &cont.my_objs[cont.n_assigned] # <<<<<<<<<<<<<< * cont.n_assigned += 1 * parent.children[cind(ind[0],ind[1],ind[2])] = next */ - __pyx_v_next = (&(__pyx_v_cont->my_octs[__pyx_v_cont->n_assigned])); + __pyx_v_next = (&(__pyx_v_cont->my_objs[__pyx_v_cont->n_assigned])); - /* "yt/geometry/oct_container.pyx":743 + /* "yt/geometry/oct_container.pyx":666 * if cont.n_assigned >= cont.n: raise RuntimeError - * next = &cont.my_octs[cont.n_assigned] + * next = &cont.my_objs[cont.n_assigned] * cont.n_assigned += 1 # <<<<<<<<<<<<<< * parent.children[cind(ind[0],ind[1],ind[2])] = next * self.nocts += 1 */ __pyx_v_cont->n_assigned = (__pyx_v_cont->n_assigned + 1); - /* "yt/geometry/oct_container.pyx":744 - * next = &cont.my_octs[cont.n_assigned] + /* "yt/geometry/oct_container.pyx":667 + * next = &cont.my_objs[cont.n_assigned] * cont.n_assigned += 1 * parent.children[cind(ind[0],ind[1],ind[2])] = next # <<<<<<<<<<<<<< * self.nocts += 1 @@ -13058,7 +12505,7 @@ */ (__pyx_v_parent->children[__pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_ind[0]), (__pyx_v_ind[1]), (__pyx_v_ind[2]))]) = __pyx_v_next; - /* "yt/geometry/oct_container.pyx":745 + /* "yt/geometry/oct_container.pyx":668 * cont.n_assigned += 1 * parent.children[cind(ind[0],ind[1],ind[2])] = next * self.nocts += 1 # <<<<<<<<<<<<<< @@ -13067,7 +12514,7 @@ */ __pyx_v_self->nocts = (__pyx_v_self->nocts + 1); - /* "yt/geometry/oct_container.pyx":746 + /* "yt/geometry/oct_container.pyx":669 * parent.children[cind(ind[0],ind[1],ind[2])] = next * self.nocts += 1 * return next # <<<<<<<<<<<<<< @@ -13077,7 +12524,7 @@ __pyx_r = __pyx_v_next; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":729 + /* "yt/geometry/oct_container.pyx":652 * return next * * cdef Oct* next_child(self, int domain_id, int ind[3], Oct *parent): # <<<<<<<<<<<<<< @@ -13087,14 +12534,14 @@ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.oct_container.OctreeContainer.next_child", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.oct_container.OctreeContainer.next_child", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/oct_container.pyx":748 +/* "yt/geometry/oct_container.pyx":671 * return next * * def file_index_octs(self, SelectorObject selector, int domain_id, # <<<<<<<<<<<<<< @@ -13103,8 +12550,8 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_36file_index_octs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_36file_index_octs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_33file_index_octs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_33file_index_octs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0; int __pyx_v_domain_id; PyObject *__pyx_v_num_cells = 0; @@ -13120,8 +12567,11 @@ 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; } @@ -13130,11 +12580,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("file_index_octs", 0, 2, 3, 1); __PYX_ERR(0, 748, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("file_index_octs", 0, 2, 3, 1); __PYX_ERR(0, 671, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells); @@ -13142,11 +12594,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "file_index_octs") < 0)) __PYX_ERR(0, 748, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "file_index_octs") < 0)) __PYX_ERR(0, 671, __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; @@ -13154,19 +12607,19 @@ } } __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]); - __pyx_v_domain_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L3_error) + __pyx_v_domain_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 671, __pyx_L3_error) __pyx_v_num_cells = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("file_index_octs", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 748, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("file_index_octs", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 671, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.file_index_octs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 748, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_35file_index_octs(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_domain_id, __pyx_v_num_cells); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 671, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_32file_index_octs(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_domain_id, __pyx_v_num_cells); /* function exit code */ goto __pyx_L0; @@ -13177,7 +12630,7 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_35file_index_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_domain_id, PyObject *__pyx_v_num_cells) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_32file_index_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_domain_id, PyObject *__pyx_v_num_cells) { __pyx_t_5numpy_int64_t __pyx_v_i; PyArrayObject *__pyx_v_levels = 0; PyArrayObject *__pyx_v_cell_inds = 0; @@ -13228,28 +12681,28 @@ __pyx_pybuffernd_file_inds.data = NULL; __pyx_pybuffernd_file_inds.rcbuffer = &__pyx_pybuffer_file_inds; - /* "yt/geometry/oct_container.pyx":755 + /* "yt/geometry/oct_container.pyx":678 * cdef np.ndarray[np.uint8_t, ndim=1] cell_inds * cdef np.ndarray[np.int64_t, ndim=1] file_inds * if num_cells < 0: # <<<<<<<<<<<<<< * num_cells = selector.count_oct_cells(self, domain_id) * levels = np.zeros(num_cells, dtype="uint8") */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_num_cells, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 755, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_num_cells, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":756 + /* "yt/geometry/oct_container.pyx":679 * cdef np.ndarray[np.int64_t, ndim=1] file_inds * if num_cells < 0: * num_cells = selector.count_oct_cells(self, domain_id) # <<<<<<<<<<<<<< * levels = np.zeros(num_cells, dtype="uint8") * file_inds = np.zeros(num_cells, dtype="int64") */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -13266,7 +12719,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -13275,14 +12728,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -13293,7 +12746,7 @@ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -13301,7 +12754,7 @@ __Pyx_DECREF_SET(__pyx_v_num_cells, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":755 + /* "yt/geometry/oct_container.pyx":678 * cdef np.ndarray[np.uint8_t, ndim=1] cell_inds * cdef np.ndarray[np.int64_t, ndim=1] file_inds * if num_cells < 0: # <<<<<<<<<<<<<< @@ -13310,32 +12763,32 @@ */ } - /* "yt/geometry/oct_container.pyx":757 + /* "yt/geometry/oct_container.pyx":680 * if num_cells < 0: * num_cells = selector.count_oct_cells(self, domain_id) * levels = np.zeros(num_cells, dtype="uint8") # <<<<<<<<<<<<<< * file_inds = np.zeros(num_cells, dtype="int64") * cell_inds = np.zeros(num_cells, dtype="uint8") */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_num_cells); __Pyx_GIVEREF(__pyx_v_num_cells); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_num_cells); - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 757, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 757, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 680, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -13351,38 +12804,38 @@ } } __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 757, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 680, __pyx_L1_error) } __pyx_t_8 = 0; __pyx_v_levels = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/oct_container.pyx":758 + /* "yt/geometry/oct_container.pyx":681 * num_cells = selector.count_oct_cells(self, domain_id) * levels = np.zeros(num_cells, dtype="uint8") * file_inds = np.zeros(num_cells, dtype="int64") # <<<<<<<<<<<<<< * cell_inds = np.zeros(num_cells, dtype="uint8") * for i in range(num_cells): */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_num_cells); __Pyx_GIVEREF(__pyx_v_num_cells); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_num_cells); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 758, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 758, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 681, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -13398,38 +12851,38 @@ } } __pyx_pybuffernd_file_inds.diminfo[0].strides = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_file_inds.diminfo[0].shape = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 758, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 681, __pyx_L1_error) } __pyx_t_12 = 0; __pyx_v_file_inds = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/oct_container.pyx":759 + /* "yt/geometry/oct_container.pyx":682 * levels = np.zeros(num_cells, dtype="uint8") * file_inds = np.zeros(num_cells, dtype="int64") * cell_inds = np.zeros(num_cells, dtype="uint8") # <<<<<<<<<<<<<< * for i in range(num_cells): * levels[i] = 100 */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_num_cells); __Pyx_GIVEREF(__pyx_v_num_cells); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_num_cells); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 759, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 759, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 759, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 682, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -13445,24 +12898,24 @@ } } __pyx_pybuffernd_cell_inds.diminfo[0].strides = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cell_inds.diminfo[0].shape = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 759, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 682, __pyx_L1_error) } __pyx_t_13 = 0; __pyx_v_cell_inds = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/oct_container.pyx":760 + /* "yt/geometry/oct_container.pyx":683 * file_inds = np.zeros(num_cells, dtype="int64") * cell_inds = np.zeros(num_cells, dtype="uint8") * for i in range(num_cells): # <<<<<<<<<<<<<< * levels[i] = 100 * file_inds[i] = -1 */ - __pyx_t_14 = __Pyx_PyInt_As_long(__pyx_v_num_cells); if (unlikely((__pyx_t_14 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_As_long(__pyx_v_num_cells); if (unlikely((__pyx_t_14 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error) for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { __pyx_v_i = __pyx_t_15; - /* "yt/geometry/oct_container.pyx":761 + /* "yt/geometry/oct_container.pyx":684 * cell_inds = np.zeros(num_cells, dtype="uint8") * for i in range(num_cells): * levels[i] = 100 # <<<<<<<<<<<<<< @@ -13477,11 +12930,11 @@ } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_levels.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 761, __pyx_L1_error) + __PYX_ERR(0, 684, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_levels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_levels.diminfo[0].strides) = 0x64; - /* "yt/geometry/oct_container.pyx":762 + /* "yt/geometry/oct_container.pyx":685 * for i in range(num_cells): * levels[i] = 100 * file_inds[i] = -1 # <<<<<<<<<<<<<< @@ -13496,11 +12949,11 @@ } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_file_inds.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 762, __pyx_L1_error) + __PYX_ERR(0, 685, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_file_inds.diminfo[0].strides) = -1LL; - /* "yt/geometry/oct_container.pyx":763 + /* "yt/geometry/oct_container.pyx":686 * levels[i] = 100 * file_inds[i] = -1 * cell_inds[i] = 9 # <<<<<<<<<<<<<< @@ -13515,31 +12968,31 @@ } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_cell_inds.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 763, __pyx_L1_error) + __PYX_ERR(0, 686, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_cell_inds.diminfo[0].strides) = 9; } - /* "yt/geometry/oct_container.pyx":766 + /* "yt/geometry/oct_container.pyx":689 * cdef oct_visitors.FillFileIndicesO visitor_o * cdef oct_visitors.FillFileIndicesR visitor_r * if self.fill_style == "r": # <<<<<<<<<<<<<< * visitor_r = oct_visitors.FillFileIndicesR(self, domain_id) * visitor_r.levels = levels */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->fill_style, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 766, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->fill_style, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 689, __pyx_L1_error) if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":767 + /* "yt/geometry/oct_container.pyx":690 * cdef oct_visitors.FillFileIndicesR visitor_r * if self.fill_style == "r": * visitor_r = oct_visitors.FillFileIndicesR(self, domain_id) # <<<<<<<<<<<<<< * visitor_r.levels = levels * visitor_r.file_inds = file_inds */ - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -13547,13 +13000,13 @@ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_visitor_r = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *)__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/oct_container.pyx":768 + /* "yt/geometry/oct_container.pyx":691 * if self.fill_style == "r": * visitor_r = oct_visitors.FillFileIndicesR(self, domain_id) * visitor_r.levels = levels # <<<<<<<<<<<<<< @@ -13561,13 +13014,13 @@ * visitor_r.cell_inds = cell_inds */ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_levels)); - if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 768, __pyx_L1_error) + if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 691, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_r->levels, 0); __pyx_v_visitor_r->levels = __pyx_t_19; __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL; - /* "yt/geometry/oct_container.pyx":769 + /* "yt/geometry/oct_container.pyx":692 * visitor_r = oct_visitors.FillFileIndicesR(self, domain_id) * visitor_r.levels = levels * visitor_r.file_inds = file_inds # <<<<<<<<<<<<<< @@ -13575,13 +13028,13 @@ * visitor = visitor_r */ __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_file_inds)); - if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 769, __pyx_L1_error) + if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 692, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_r->file_inds, 0); __pyx_v_visitor_r->file_inds = __pyx_t_20; __pyx_t_20.memview = NULL; __pyx_t_20.data = NULL; - /* "yt/geometry/oct_container.pyx":770 + /* "yt/geometry/oct_container.pyx":693 * visitor_r.levels = levels * visitor_r.file_inds = file_inds * visitor_r.cell_inds = cell_inds # <<<<<<<<<<<<<< @@ -13589,13 +13042,13 @@ * elif self.fill_style == "o": */ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_cell_inds)); - if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 770, __pyx_L1_error) + if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 693, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_r->cell_inds, 0); __pyx_v_visitor_r->cell_inds = __pyx_t_19; __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL; - /* "yt/geometry/oct_container.pyx":771 + /* "yt/geometry/oct_container.pyx":694 * visitor_r.file_inds = file_inds * visitor_r.cell_inds = cell_inds * visitor = visitor_r # <<<<<<<<<<<<<< @@ -13605,7 +13058,7 @@ __Pyx_INCREF(((PyObject *)__pyx_v_visitor_r)); __pyx_v_visitor = ((PyObject *)__pyx_v_visitor_r); - /* "yt/geometry/oct_container.pyx":766 + /* "yt/geometry/oct_container.pyx":689 * cdef oct_visitors.FillFileIndicesO visitor_o * cdef oct_visitors.FillFileIndicesR visitor_r * if self.fill_style == "r": # <<<<<<<<<<<<<< @@ -13615,26 +13068,26 @@ goto __pyx_L6; } - /* "yt/geometry/oct_container.pyx":772 + /* "yt/geometry/oct_container.pyx":695 * visitor_r.cell_inds = cell_inds * visitor = visitor_r * elif self.fill_style == "o": # <<<<<<<<<<<<<< * visitor_o = oct_visitors.FillFileIndicesO(self, domain_id) * visitor_o.levels = levels */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->fill_style, __pyx_n_s_o, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 772, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->fill_style, __pyx_n_s_o, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 695, __pyx_L1_error) if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":773 + /* "yt/geometry/oct_container.pyx":696 * visitor = visitor_r * elif self.fill_style == "o": * visitor_o = oct_visitors.FillFileIndicesO(self, domain_id) # <<<<<<<<<<<<<< * visitor_o.levels = levels * visitor_o.file_inds = file_inds */ - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -13642,13 +13095,13 @@ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_visitor_o = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *)__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/oct_container.pyx":774 + /* "yt/geometry/oct_container.pyx":697 * elif self.fill_style == "o": * visitor_o = oct_visitors.FillFileIndicesO(self, domain_id) * visitor_o.levels = levels # <<<<<<<<<<<<<< @@ -13656,13 +13109,13 @@ * visitor_o.cell_inds = cell_inds */ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_levels)); - if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 774, __pyx_L1_error) + if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 697, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_o->levels, 0); __pyx_v_visitor_o->levels = __pyx_t_19; __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL; - /* "yt/geometry/oct_container.pyx":775 + /* "yt/geometry/oct_container.pyx":698 * visitor_o = oct_visitors.FillFileIndicesO(self, domain_id) * visitor_o.levels = levels * visitor_o.file_inds = file_inds # <<<<<<<<<<<<<< @@ -13670,13 +13123,13 @@ * visitor = visitor_o */ __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_file_inds)); - if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 775, __pyx_L1_error) + if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 698, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_o->file_inds, 0); __pyx_v_visitor_o->file_inds = __pyx_t_20; __pyx_t_20.memview = NULL; __pyx_t_20.data = NULL; - /* "yt/geometry/oct_container.pyx":776 + /* "yt/geometry/oct_container.pyx":699 * visitor_o.levels = levels * visitor_o.file_inds = file_inds * visitor_o.cell_inds = cell_inds # <<<<<<<<<<<<<< @@ -13684,13 +13137,13 @@ * else: */ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_cell_inds)); - if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 776, __pyx_L1_error) + if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 699, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_o->cell_inds, 0); __pyx_v_visitor_o->cell_inds = __pyx_t_19; __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL; - /* "yt/geometry/oct_container.pyx":777 + /* "yt/geometry/oct_container.pyx":700 * visitor_o.file_inds = file_inds * visitor_o.cell_inds = cell_inds * visitor = visitor_o # <<<<<<<<<<<<<< @@ -13700,7 +13153,7 @@ __Pyx_INCREF(((PyObject *)__pyx_v_visitor_o)); __pyx_v_visitor = ((PyObject *)__pyx_v_visitor_o); - /* "yt/geometry/oct_container.pyx":772 + /* "yt/geometry/oct_container.pyx":695 * visitor_r.cell_inds = cell_inds * visitor = visitor_r * elif self.fill_style == "o": # <<<<<<<<<<<<<< @@ -13710,7 +13163,7 @@ goto __pyx_L6; } - /* "yt/geometry/oct_container.pyx":779 + /* "yt/geometry/oct_container.pyx":702 * visitor = visitor_o * else: * raise RuntimeError # <<<<<<<<<<<<<< @@ -13719,21 +13172,21 @@ */ /*else*/ { __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 779, __pyx_L1_error) + __PYX_ERR(0, 702, __pyx_L1_error) } __pyx_L6:; - /* "yt/geometry/oct_container.pyx":780 + /* "yt/geometry/oct_container.pyx":703 * else: * raise RuntimeError * self.visit_all_octs(selector, visitor) # <<<<<<<<<<<<<< * return levels, cell_inds, file_inds * */ - if (!(likely(__Pyx_TypeTest(__pyx_v_visitor, __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor)))) __PYX_ERR(0, 780, __pyx_L1_error) + if (!(likely(__Pyx_TypeTest(__pyx_v_visitor, __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor)))) __PYX_ERR(0, 703, __pyx_L1_error) ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL); - /* "yt/geometry/oct_container.pyx":781 + /* "yt/geometry/oct_container.pyx":704 * raise RuntimeError * self.visit_all_octs(selector, visitor) * return levels, cell_inds, file_inds # <<<<<<<<<<<<<< @@ -13741,7 +13194,7 @@ * def domain_count(self, SelectorObject selector): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_v_levels)); __Pyx_GIVEREF(((PyObject *)__pyx_v_levels)); @@ -13756,7 +13209,7 @@ __pyx_t_7 = 0; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":748 + /* "yt/geometry/oct_container.pyx":671 * return next * * def file_index_octs(self, SelectorObject selector, int domain_id, # <<<<<<<<<<<<<< @@ -13801,7 +13254,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":783 +/* "yt/geometry/oct_container.pyx":706 * return levels, cell_inds, file_inds * * def domain_count(self, SelectorObject selector): # <<<<<<<<<<<<<< @@ -13810,13 +13263,13 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_38domain_count(PyObject *__pyx_v_self, PyObject *__pyx_v_selector); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_38domain_count(PyObject *__pyx_v_self, PyObject *__pyx_v_selector) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_35domain_count(PyObject *__pyx_v_self, PyObject *__pyx_v_selector); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_35domain_count(PyObject *__pyx_v_self, PyObject *__pyx_v_selector) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("domain_count (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 783, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_37domain_count(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector)); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_34domain_count(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector)); /* function exit code */ goto __pyx_L0; @@ -13827,7 +13280,7 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_37domain_count(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_34domain_count(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector) { PyArrayObject *__pyx_v_domain_counts = 0; struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_v_visitor = 0; __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_counts; @@ -13850,34 +13303,34 @@ __pyx_pybuffernd_domain_counts.data = NULL; __pyx_pybuffernd_domain_counts.rcbuffer = &__pyx_pybuffer_domain_counts; - /* "yt/geometry/oct_container.pyx":787 + /* "yt/geometry/oct_container.pyx":710 * cdef np.int64_t i, num_octs * cdef np.ndarray[np.int64_t, ndim=1] domain_counts * domain_counts = np.zeros(self.num_domains, dtype="int64") # <<<<<<<<<<<<<< * cdef oct_visitors.CountByDomain visitor * visitor = oct_visitors.CountByDomain(self, -1) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __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, 787, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __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_self->num_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 787, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 787, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 710, __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_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, 787, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 710, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -13893,20 +13346,20 @@ } } __pyx_pybuffernd_domain_counts.diminfo[0].strides = __pyx_pybuffernd_domain_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_counts.diminfo[0].shape = __pyx_pybuffernd_domain_counts.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 787, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 710, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_domain_counts = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/oct_container.pyx":789 + /* "yt/geometry/oct_container.pyx":712 * domain_counts = np.zeros(self.num_domains, dtype="int64") * cdef oct_visitors.CountByDomain visitor * visitor = oct_visitors.CountByDomain(self, -1) # <<<<<<<<<<<<<< * visitor.domain_counts = domain_counts * self.visit_all_octs(selector, visitor) */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -13914,13 +13367,13 @@ __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1); - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":790 + /* "yt/geometry/oct_container.pyx":713 * cdef oct_visitors.CountByDomain visitor * visitor = oct_visitors.CountByDomain(self, -1) * visitor.domain_counts = domain_counts # <<<<<<<<<<<<<< @@ -13928,13 +13381,13 @@ * return domain_counts */ __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_domain_counts)); - if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 790, __pyx_L1_error) + if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 713, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->domain_counts, 0); __pyx_v_visitor->domain_counts = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; - /* "yt/geometry/oct_container.pyx":791 + /* "yt/geometry/oct_container.pyx":714 * visitor = oct_visitors.CountByDomain(self, -1) * visitor.domain_counts = domain_counts * self.visit_all_octs(selector, visitor) # <<<<<<<<<<<<<< @@ -13943,7 +13396,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL); - /* "yt/geometry/oct_container.pyx":792 + /* "yt/geometry/oct_container.pyx":715 * visitor.domain_counts = domain_counts * self.visit_all_octs(selector, visitor) * return domain_counts # <<<<<<<<<<<<<< @@ -13955,7 +13408,7 @@ __pyx_r = ((PyObject *)__pyx_v_domain_counts); goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":783 + /* "yt/geometry/oct_container.pyx":706 * return levels, cell_inds, file_inds * * def domain_count(self, SelectorObject selector): # <<<<<<<<<<<<<< @@ -13989,7 +13442,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":797 +/* "yt/geometry/oct_container.pyx":720 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_level(self, int level, # <<<<<<<<<<<<<< @@ -13998,8 +13451,8 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_40fill_level(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_40fill_level(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_37fill_level(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_37fill_level(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_level; PyArrayObject *__pyx_v_levels = 0; PyArrayObject *__pyx_v_cell_inds = 0; @@ -14018,12 +13471,19 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -14032,31 +13492,37 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 1); __PYX_ERR(0, 797, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 1); __PYX_ERR(0, 720, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cell_inds)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 2); __PYX_ERR(0, 797, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 2); __PYX_ERR(0, 720, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_inds)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 3); __PYX_ERR(0, 797, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 3); __PYX_ERR(0, 720, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest_fields)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 4); __PYX_ERR(0, 797, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 4); __PYX_ERR(0, 720, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source_fields)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 5); __PYX_ERR(0, 797, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 5); __PYX_ERR(0, 720, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); @@ -14064,11 +13530,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_level") < 0)) __PYX_ERR(0, 797, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_level") < 0)) __PYX_ERR(0, 720, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -14079,30 +13546,30 @@ default: goto __pyx_L5_argtuple_error; } } - __pyx_v_level = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 797, __pyx_L3_error) + __pyx_v_level = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 720, __pyx_L3_error) __pyx_v_levels = ((PyArrayObject *)values[1]); __pyx_v_cell_inds = ((PyArrayObject *)values[2]); __pyx_v_file_inds = ((PyArrayObject *)values[3]); __pyx_v_dest_fields = values[4]; __pyx_v_source_fields = values[5]; if (values[6]) { - __pyx_v_offset = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_offset == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 802, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_offset == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 725, __pyx_L3_error) } else { __pyx_v_offset = ((__pyx_t_5numpy_int64_t)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 797, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 720, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fill_level", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 798, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cell_inds), __pyx_ptype_5numpy_ndarray, 1, "cell_inds", 0))) __PYX_ERR(0, 799, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_inds), __pyx_ptype_5numpy_ndarray, 1, "file_inds", 0))) __PYX_ERR(0, 800, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_39fill_level(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_level, __pyx_v_levels, __pyx_v_cell_inds, __pyx_v_file_inds, __pyx_v_dest_fields, __pyx_v_source_fields, __pyx_v_offset); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cell_inds), __pyx_ptype_5numpy_ndarray, 1, "cell_inds", 0))) __PYX_ERR(0, 722, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_inds), __pyx_ptype_5numpy_ndarray, 1, "file_inds", 0))) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_36fill_level(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_level, __pyx_v_levels, __pyx_v_cell_inds, __pyx_v_file_inds, __pyx_v_dest_fields, __pyx_v_source_fields, __pyx_v_offset); /* function exit code */ goto __pyx_L0; @@ -14113,7 +13580,7 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_39fill_level(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_level, PyArrayObject *__pyx_v_levels, PyArrayObject *__pyx_v_cell_inds, PyArrayObject *__pyx_v_file_inds, PyObject *__pyx_v_dest_fields, PyObject *__pyx_v_source_fields, __pyx_t_5numpy_int64_t __pyx_v_offset) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_36fill_level(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_level, PyArrayObject *__pyx_v_levels, PyArrayObject *__pyx_v_cell_inds, PyArrayObject *__pyx_v_file_inds, PyObject *__pyx_v_dest_fields, PyObject *__pyx_v_source_fields, __pyx_t_5numpy_int64_t __pyx_v_offset) { PyArrayObject *__pyx_v_source = 0; PyArrayObject *__pyx_v_dest = 0; int __pyx_v_i; @@ -14172,21 +13639,21 @@ __pyx_pybuffernd_file_inds.rcbuffer = &__pyx_pybuffer_file_inds; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 797, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 720, __pyx_L1_error) } __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_cell_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 797, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_cell_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 720, __pyx_L1_error) } __pyx_pybuffernd_cell_inds.diminfo[0].strides = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cell_inds.diminfo[0].shape = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_file_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 797, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_file_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 720, __pyx_L1_error) } __pyx_pybuffernd_file_inds.diminfo[0].strides = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_file_inds.diminfo[0].shape = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.shape[0]; - /* "yt/geometry/oct_container.pyx":807 + /* "yt/geometry/oct_container.pyx":730 * cdef int n * cdef int i, di * cdef np.int64_t local_pos, local_filled = 0 # <<<<<<<<<<<<<< @@ -14195,7 +13662,7 @@ */ __pyx_v_local_filled = 0; - /* "yt/geometry/oct_container.pyx":809 + /* "yt/geometry/oct_container.pyx":732 * cdef np.int64_t local_pos, local_filled = 0 * cdef np.float64_t val * for key in dest_fields: # <<<<<<<<<<<<<< @@ -14206,26 +13673,26 @@ __pyx_t_1 = __pyx_v_dest_fields; __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_dest_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dest_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __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, 809, __pyx_L1_error) + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __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, 809, __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, 732, __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, 809, __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, 732, __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, 809, __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, 732, __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, 809, __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, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -14235,7 +13702,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 809, __pyx_L1_error) + else __PYX_ERR(0, 732, __pyx_L1_error) } break; } @@ -14244,16 +13711,16 @@ __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/oct_container.pyx":810 + /* "yt/geometry/oct_container.pyx":733 * cdef np.float64_t val * for key in dest_fields: * dest = dest_fields[key] # <<<<<<<<<<<<<< * source = source_fields[key] * for i in range(levels.shape[0]): */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_dest_fields, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error) + __pyx_t_4 = PyObject_GetItem(__pyx_v_dest_fields, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 810, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 733, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -14269,22 +13736,22 @@ } } __pyx_pybuffernd_dest.diminfo[0].strides = __pyx_pybuffernd_dest.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dest.diminfo[0].shape = __pyx_pybuffernd_dest.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 810, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 733, __pyx_L1_error) } __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "yt/geometry/oct_container.pyx":811 + /* "yt/geometry/oct_container.pyx":734 * for key in dest_fields: * dest = dest_fields[key] * source = source_fields[key] # <<<<<<<<<<<<<< * for i in range(levels.shape[0]): * if levels[i] != level: continue */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_source_fields, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_4 = PyObject_GetItem(__pyx_v_source_fields, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 811, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 734, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -14300,13 +13767,13 @@ } } __pyx_pybuffernd_source.diminfo[0].strides = __pyx_pybuffernd_source.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_source.diminfo[0].shape = __pyx_pybuffernd_source.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_source.diminfo[1].strides = __pyx_pybuffernd_source.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_source.diminfo[1].shape = __pyx_pybuffernd_source.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 734, __pyx_L1_error) } __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_v_source, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "yt/geometry/oct_container.pyx":812 + /* "yt/geometry/oct_container.pyx":735 * dest = dest_fields[key] * source = source_fields[key] * for i in range(levels.shape[0]): # <<<<<<<<<<<<<< @@ -14317,7 +13784,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_11; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/oct_container.pyx":813 + /* "yt/geometry/oct_container.pyx":736 * source = source_fields[key] * for i in range(levels.shape[0]): * if levels[i] != level: continue # <<<<<<<<<<<<<< @@ -14330,7 +13797,7 @@ goto __pyx_L5_continue; } - /* "yt/geometry/oct_container.pyx":814 + /* "yt/geometry/oct_container.pyx":737 * for i in range(levels.shape[0]): * if levels[i] != level: continue * dest[i + offset] = source[file_inds[i], cell_inds[i]] # <<<<<<<<<<<<<< @@ -14344,7 +13811,7 @@ __pyx_t_18 = (__pyx_v_i + __pyx_v_offset); *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dest.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dest.diminfo[0].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_source.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_source.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_source.diminfo[1].strides)); - /* "yt/geometry/oct_container.pyx":815 + /* "yt/geometry/oct_container.pyx":738 * if levels[i] != level: continue * dest[i + offset] = source[file_inds[i], cell_inds[i]] * local_filled += 1 # <<<<<<<<<<<<<< @@ -14355,7 +13822,7 @@ __pyx_L5_continue:; } - /* "yt/geometry/oct_container.pyx":809 + /* "yt/geometry/oct_container.pyx":732 * cdef np.int64_t local_pos, local_filled = 0 * cdef np.float64_t val * for key in dest_fields: # <<<<<<<<<<<<<< @@ -14365,7 +13832,7 @@ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":797 + /* "yt/geometry/oct_container.pyx":720 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_level(self, int level, # <<<<<<<<<<<<<< @@ -14407,7 +13874,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":817 +/* "yt/geometry/oct_container.pyx":740 * local_filled += 1 * * def finalize(self): # <<<<<<<<<<<<<< @@ -14416,19 +13883,19 @@ */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_42finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_42finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_39finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_39finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("finalize (wrapper)", 0); - __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_41finalize(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self)); + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_38finalize(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_41finalize(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) { +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_38finalize(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) { struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0; struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *__pyx_v_visitor = 0; PyObject *__pyx_r = NULL; @@ -14437,26 +13904,26 @@ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/oct_container.pyx":818 + /* "yt/geometry/oct_container.pyx":741 * * def finalize(self): * cdef SelectorObject selector = selection_routines.AlwaysSelector(None) # <<<<<<<<<<<<<< * cdef oct_visitors.AssignDomainInd visitor * visitor = oct_visitors.AssignDomainInd(self, 1) */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector), __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector), __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/oct_container.pyx":820 + /* "yt/geometry/oct_container.pyx":743 * cdef SelectorObject selector = selection_routines.AlwaysSelector(None) * cdef oct_visitors.AssignDomainInd visitor * visitor = oct_visitors.AssignDomainInd(self, 1) # <<<<<<<<<<<<<< * self.visit_all_octs(selector, visitor) * assert ((visitor.global_index+1)*visitor.nz == visitor.index) */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -14464,13 +13931,13 @@ __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_1); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":821 + /* "yt/geometry/oct_container.pyx":744 * cdef oct_visitors.AssignDomainInd visitor * visitor = oct_visitors.AssignDomainInd(self, 1) * self.visit_all_octs(selector, visitor) # <<<<<<<<<<<<<< @@ -14479,23 +13946,23 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL); - /* "yt/geometry/oct_container.pyx":822 + /* "yt/geometry/oct_container.pyx":745 * visitor = oct_visitors.AssignDomainInd(self, 1) * self.visit_all_octs(selector, visitor) * assert ((visitor.global_index+1)*visitor.nz == visitor.index) # <<<<<<<<<<<<<< * - * cdef int root_node_compare(void *a, void *b) nogil: + * cdef int root_node_compare(const void *a, const void *b) nogil: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((((__pyx_v_visitor->__pyx_base.global_index + 1) * __pyx_v_visitor->__pyx_base.nz) == __pyx_v_visitor->__pyx_base.index) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 822, __pyx_L1_error) + __PYX_ERR(0, 745, __pyx_L1_error) } } #endif - /* "yt/geometry/oct_container.pyx":817 + /* "yt/geometry/oct_container.pyx":740 * local_filled += 1 * * def finalize(self): # <<<<<<<<<<<<<< @@ -14519,7 +13986,112 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pxd":67 +/* "yt/geometry/oct_container.pxd":64 + * + * cdef class OctreeContainer: + * cdef public OctObjectPool domains # <<<<<<<<<<<<<< + * cdef Oct ****root_mesh + * cdef int partial_coverage + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains___get__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->domains)); + __pyx_r = ((PyObject *)__pyx_v_self->domains); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_2__set__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool))))) __PYX_ERR(2, 64, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->domains); + __Pyx_DECREF(((PyObject *)__pyx_v_self->domains)); + __pyx_v_self->domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.domains.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_4__del__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_4__del__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->domains); + __Pyx_DECREF(((PyObject *)__pyx_v_self->domains)); + __pyx_v_self->domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_container.pxd":72 * cdef np.float64_t DLE[3] * cdef np.float64_t DRE[3] * cdef public np.int64_t nocts # <<<<<<<<<<<<<< @@ -14546,7 +14118,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nocts); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nocts); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14581,7 +14153,7 @@ __Pyx_RefNannyDeclarations __pyx_t_5numpy_int64_t __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(2, 72, __pyx_L1_error) __pyx_v_self->nocts = __pyx_t_1; /* function exit code */ @@ -14595,7 +14167,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pxd":68 +/* "yt/geometry/oct_container.pxd":73 * cdef np.float64_t DRE[3] * cdef public np.int64_t nocts * cdef public int num_domains # <<<<<<<<<<<<<< @@ -14622,7 +14194,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14657,7 +14229,7 @@ __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 68, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 73, __pyx_L1_error) __pyx_v_self->num_domains = __pyx_t_1; /* function exit code */ @@ -14671,7 +14243,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pxd":87 +/* "yt/geometry/oct_container.pxd":92 * # The fill_style is the ordering, C or F, of the octs in the file. "o" * # corresponds to C, and "r" is for Fortran. * cdef public object fill_style # <<<<<<<<<<<<<< @@ -14766,21 +14338,128 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":824 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_41__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_41__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_2yt_8geometry_13oct_container_15OctreeContainer_40__reduce_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_40__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__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.root_mesh cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, 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.root_mesh 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("yt.geometry.oct_container.OctreeContainer.__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.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_43__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_43__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_2yt_8geometry_13oct_container_15OctreeContainer_42__setstate_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_42__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__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.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, 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.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_container.pyx":747 * assert ((visitor.global_index+1)*visitor.nz == visitor.index) * - * cdef int root_node_compare(void *a, void *b) nogil: # <<<<<<<<<<<<<< + * cdef int root_node_compare(const void *a, const void *b) nogil: # <<<<<<<<<<<<<< * cdef OctKey *ao * cdef OctKey *bo */ -static int __pyx_f_2yt_8geometry_13oct_container_root_node_compare(void *__pyx_v_a, void *__pyx_v_b) { +static int __pyx_f_2yt_8geometry_13oct_container_root_node_compare(void const *__pyx_v_a, void const *__pyx_v_b) { struct __pyx_t_2yt_8geometry_13oct_container_OctKey *__pyx_v_ao; struct __pyx_t_2yt_8geometry_13oct_container_OctKey *__pyx_v_bo; int __pyx_r; int __pyx_t_1; - /* "yt/geometry/oct_container.pyx":827 + /* "yt/geometry/oct_container.pyx":750 * cdef OctKey *ao * cdef OctKey *bo * ao = a # <<<<<<<<<<<<<< @@ -14789,7 +14468,7 @@ */ __pyx_v_ao = ((struct __pyx_t_2yt_8geometry_13oct_container_OctKey *)__pyx_v_a); - /* "yt/geometry/oct_container.pyx":828 + /* "yt/geometry/oct_container.pyx":751 * cdef OctKey *bo * ao = a * bo = b # <<<<<<<<<<<<<< @@ -14798,7 +14477,7 @@ */ __pyx_v_bo = ((struct __pyx_t_2yt_8geometry_13oct_container_OctKey *)__pyx_v_b); - /* "yt/geometry/oct_container.pyx":829 + /* "yt/geometry/oct_container.pyx":752 * ao = a * bo = b * if ao.key < bo.key: # <<<<<<<<<<<<<< @@ -14808,7 +14487,7 @@ __pyx_t_1 = ((__pyx_v_ao->key < __pyx_v_bo->key) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":830 + /* "yt/geometry/oct_container.pyx":753 * bo = b * if ao.key < bo.key: * return -1 # <<<<<<<<<<<<<< @@ -14818,7 +14497,7 @@ __pyx_r = -1; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":829 + /* "yt/geometry/oct_container.pyx":752 * ao = a * bo = b * if ao.key < bo.key: # <<<<<<<<<<<<<< @@ -14827,7 +14506,7 @@ */ } - /* "yt/geometry/oct_container.pyx":831 + /* "yt/geometry/oct_container.pyx":754 * if ao.key < bo.key: * return -1 * elif ao.key == bo.key: # <<<<<<<<<<<<<< @@ -14837,7 +14516,7 @@ __pyx_t_1 = ((__pyx_v_ao->key == __pyx_v_bo->key) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":832 + /* "yt/geometry/oct_container.pyx":755 * return -1 * elif ao.key == bo.key: * return 0 # <<<<<<<<<<<<<< @@ -14847,7 +14526,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":831 + /* "yt/geometry/oct_container.pyx":754 * if ao.key < bo.key: * return -1 * elif ao.key == bo.key: # <<<<<<<<<<<<<< @@ -14856,7 +14535,7 @@ */ } - /* "yt/geometry/oct_container.pyx":834 + /* "yt/geometry/oct_container.pyx":757 * return 0 * else: * return 1 # <<<<<<<<<<<<<< @@ -14868,10 +14547,10 @@ goto __pyx_L0; } - /* "yt/geometry/oct_container.pyx":824 + /* "yt/geometry/oct_container.pyx":747 * assert ((visitor.global_index+1)*visitor.nz == visitor.index) * - * cdef int root_node_compare(void *a, void *b) nogil: # <<<<<<<<<<<<<< + * cdef int root_node_compare(const void *a, const void *b) nogil: # <<<<<<<<<<<<<< * cdef OctKey *ao * cdef OctKey *bo */ @@ -14881,7 +14560,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":838 +/* "yt/geometry/oct_container.pyx":761 * cdef class SparseOctreeContainer(OctreeContainer): * * def __init__(self, domain_dimensions, domain_left_edge, domain_right_edge, # <<<<<<<<<<<<<< @@ -14908,9 +14587,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -14919,16 +14602,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_dimensions)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_left_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 838, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 761, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_right_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 838, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 761, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_over_refine); @@ -14936,11 +14622,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 838, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 761, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -14955,7 +14642,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 838, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 761, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.SparseOctreeContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -14979,7 +14666,7 @@ __pyx_t_5numpy_float64_t __pyx_t_5; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/oct_container.pyx":841 + /* "yt/geometry/oct_container.pyx":764 * over_refine = 1): * cdef int i, j, k, p * self.partial_coverage = 1 # <<<<<<<<<<<<<< @@ -14988,51 +14675,66 @@ */ __pyx_v_self->__pyx_base.partial_coverage = 1; - /* "yt/geometry/oct_container.pyx":842 + /* "yt/geometry/oct_container.pyx":765 * cdef int i, j, k, p * self.partial_coverage = 1 * self.oref = over_refine # <<<<<<<<<<<<<< * for i in range(3): * self.nn[i] = domain_dimensions[i] */ - __pyx_t_1 = __Pyx_PyInt_As_npy_uint8(__pyx_v_over_refine); if (unlikely((__pyx_t_1 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_npy_uint8(__pyx_v_over_refine); if (unlikely((__pyx_t_1 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 765, __pyx_L1_error) __pyx_v_self->__pyx_base.oref = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":843 + /* "yt/geometry/oct_container.pyx":766 * self.partial_coverage = 1 * self.oref = over_refine * for i in range(3): # <<<<<<<<<<<<<< * self.nn[i] = domain_dimensions[i] - * self.num_domains = 0 + * self.domains = OctObjectPool() */ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":844 + /* "yt/geometry/oct_container.pyx":767 * self.oref = over_refine * for i in range(3): * self.nn[i] = domain_dimensions[i] # <<<<<<<<<<<<<< + * self.domains = OctObjectPool() * self.num_domains = 0 - * self.level_offset = 0 */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_dimensions, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_dimensions, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->__pyx_base.nn[__pyx_v_i]) = __pyx_t_4; } - /* "yt/geometry/oct_container.pyx":845 + /* "yt/geometry/oct_container.pyx":768 * for i in range(3): * self.nn[i] = domain_dimensions[i] + * self.domains = OctObjectPool() # <<<<<<<<<<<<<< + * self.num_domains = 0 + * self.level_offset = 0 + */ + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->__pyx_base.domains); + __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.domains)); + __pyx_v_self->__pyx_base.domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "yt/geometry/oct_container.pyx":769 + * self.nn[i] = domain_dimensions[i] + * self.domains = OctObjectPool() * self.num_domains = 0 # <<<<<<<<<<<<<< * self.level_offset = 0 * self.nocts = 0 # Increment when initialized */ __pyx_v_self->__pyx_base.num_domains = 0; - /* "yt/geometry/oct_container.pyx":846 - * self.nn[i] = domain_dimensions[i] + /* "yt/geometry/oct_container.pyx":770 + * self.domains = OctObjectPool() * self.num_domains = 0 * self.level_offset = 0 # <<<<<<<<<<<<<< * self.nocts = 0 # Increment when initialized @@ -15040,7 +14742,7 @@ */ __pyx_v_self->__pyx_base.level_offset = 0; - /* "yt/geometry/oct_container.pyx":847 + /* "yt/geometry/oct_container.pyx":771 * self.num_domains = 0 * self.level_offset = 0 * self.nocts = 0 # Increment when initialized # <<<<<<<<<<<<<< @@ -15049,7 +14751,7 @@ */ __pyx_v_self->__pyx_base.nocts = 0; - /* "yt/geometry/oct_container.pyx":848 + /* "yt/geometry/oct_container.pyx":772 * self.level_offset = 0 * self.nocts = 0 # Increment when initialized * self.root_mesh = NULL # <<<<<<<<<<<<<< @@ -15058,7 +14760,7 @@ */ __pyx_v_self->__pyx_base.root_mesh = NULL; - /* "yt/geometry/oct_container.pyx":849 + /* "yt/geometry/oct_container.pyx":773 * self.nocts = 0 # Increment when initialized * self.root_mesh = NULL * self.root_nodes = NULL # <<<<<<<<<<<<<< @@ -15067,7 +14769,7 @@ */ __pyx_v_self->root_nodes = NULL; - /* "yt/geometry/oct_container.pyx":850 + /* "yt/geometry/oct_container.pyx":774 * self.root_mesh = NULL * self.root_nodes = NULL * self.tree_root = NULL # <<<<<<<<<<<<<< @@ -15076,7 +14778,7 @@ */ __pyx_v_self->tree_root = NULL; - /* "yt/geometry/oct_container.pyx":851 + /* "yt/geometry/oct_container.pyx":775 * self.root_nodes = NULL * self.tree_root = NULL * self.num_root = 0 # <<<<<<<<<<<<<< @@ -15085,7 +14787,7 @@ */ __pyx_v_self->num_root = 0; - /* "yt/geometry/oct_container.pyx":852 + /* "yt/geometry/oct_container.pyx":776 * self.tree_root = NULL * self.num_root = 0 * self.max_root = 0 # <<<<<<<<<<<<<< @@ -15094,7 +14796,7 @@ */ __pyx_v_self->max_root = 0; - /* "yt/geometry/oct_container.pyx":854 + /* "yt/geometry/oct_container.pyx":778 * self.max_root = 0 * # We don't initialize the octs yet * for i in range(3): # <<<<<<<<<<<<<< @@ -15104,34 +14806,34 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":855 + /* "yt/geometry/oct_container.pyx":779 * # We don't initialize the octs yet * for i in range(3): * self.DLE[i] = domain_left_edge[i] #0 # <<<<<<<<<<<<<< * self.DRE[i] = domain_right_edge[i] #num_grid * self.fill_style = "r" */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->__pyx_base.DLE[__pyx_v_i]) = __pyx_t_5; - /* "yt/geometry/oct_container.pyx":856 + /* "yt/geometry/oct_container.pyx":780 * for i in range(3): * self.DLE[i] = domain_left_edge[i] #0 * self.DRE[i] = domain_right_edge[i] #num_grid # <<<<<<<<<<<<<< * self.fill_style = "r" * */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->__pyx_base.DRE[__pyx_v_i]) = __pyx_t_5; } - /* "yt/geometry/oct_container.pyx":857 + /* "yt/geometry/oct_container.pyx":781 * self.DLE[i] = domain_left_edge[i] #0 * self.DRE[i] = domain_right_edge[i] #num_grid * self.fill_style = "r" # <<<<<<<<<<<<<< @@ -15144,7 +14846,7 @@ __Pyx_DECREF(__pyx_v_self->__pyx_base.fill_style); __pyx_v_self->__pyx_base.fill_style = __pyx_n_s_r; - /* "yt/geometry/oct_container.pyx":838 + /* "yt/geometry/oct_container.pyx":761 * cdef class SparseOctreeContainer(OctreeContainer): * * def __init__(self, domain_dimensions, domain_left_edge, domain_right_edge, # <<<<<<<<<<<<<< @@ -15164,7 +14866,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":860 +/* "yt/geometry/oct_container.pyx":784 * * @classmethod * def load_octree(self, header): # <<<<<<<<<<<<<< @@ -15190,7 +14892,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load_octree", 0); - /* "yt/geometry/oct_container.pyx":861 + /* "yt/geometry/oct_container.pyx":785 * @classmethod * def load_octree(self, header): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -15198,9 +14900,9 @@ * def save_octree(self): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 861, __pyx_L1_error) + __PYX_ERR(0, 785, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":860 + /* "yt/geometry/oct_container.pyx":784 * * @classmethod * def load_octree(self, header): # <<<<<<<<<<<<<< @@ -15217,7 +14919,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":863 +/* "yt/geometry/oct_container.pyx":787 * raise NotImplementedError * * def save_octree(self): # <<<<<<<<<<<<<< @@ -15243,7 +14945,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("save_octree", 0); - /* "yt/geometry/oct_container.pyx":864 + /* "yt/geometry/oct_container.pyx":788 * * def save_octree(self): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -15251,9 +14953,9 @@ * cdef int get_root(self, int ind[3], Oct **o): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 864, __pyx_L1_error) + __PYX_ERR(0, 788, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":863 + /* "yt/geometry/oct_container.pyx":787 * raise NotImplementedError * * def save_octree(self): # <<<<<<<<<<<<<< @@ -15270,7 +14972,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":866 +/* "yt/geometry/oct_container.pyx":790 * raise NotImplementedError * * cdef int get_root(self, int ind[3], Oct **o): # <<<<<<<<<<<<<< @@ -15288,7 +14990,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_t_2; __Pyx_RefNannySetupContext("get_root", 0); - /* "yt/geometry/oct_container.pyx":867 + /* "yt/geometry/oct_container.pyx":791 * * cdef int get_root(self, int ind[3], Oct **o): * o[0] = NULL # <<<<<<<<<<<<<< @@ -15297,7 +14999,7 @@ */ (__pyx_v_o[0]) = NULL; - /* "yt/geometry/oct_container.pyx":869 + /* "yt/geometry/oct_container.pyx":793 * o[0] = NULL * cdef int i * cdef np.int64_t key = self.ipos_to_key(ind) # <<<<<<<<<<<<<< @@ -15306,7 +15008,7 @@ */ __pyx_v_key = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->ipos_to_key(__pyx_v_self, __pyx_v_ind); - /* "yt/geometry/oct_container.pyx":871 + /* "yt/geometry/oct_container.pyx":795 * cdef np.int64_t key = self.ipos_to_key(ind) * cdef OctKey okey * cdef OctKey **oresult = NULL # <<<<<<<<<<<<<< @@ -15315,7 +15017,7 @@ */ __pyx_v_oresult = NULL; - /* "yt/geometry/oct_container.pyx":872 + /* "yt/geometry/oct_container.pyx":796 * cdef OctKey okey * cdef OctKey **oresult = NULL * okey.key = key # <<<<<<<<<<<<<< @@ -15324,7 +15026,7 @@ */ __pyx_v_okey.key = __pyx_v_key; - /* "yt/geometry/oct_container.pyx":873 + /* "yt/geometry/oct_container.pyx":797 * cdef OctKey **oresult = NULL * okey.key = key * okey.node = NULL # <<<<<<<<<<<<<< @@ -15333,7 +15035,7 @@ */ __pyx_v_okey.node = NULL; - /* "yt/geometry/oct_container.pyx":874 + /* "yt/geometry/oct_container.pyx":798 * okey.key = key * okey.node = NULL * oresult = tfind(&okey, # <<<<<<<<<<<<<< @@ -15342,7 +15044,7 @@ */ __pyx_v_oresult = ((struct __pyx_t_2yt_8geometry_13oct_container_OctKey **)tfind(((void *)(&__pyx_v_okey)), (&__pyx_v_self->tree_root), __pyx_f_2yt_8geometry_13oct_container_root_node_compare)); - /* "yt/geometry/oct_container.pyx":876 + /* "yt/geometry/oct_container.pyx":800 * oresult = tfind(&okey, * &self.tree_root, root_node_compare) * if oresult != NULL: # <<<<<<<<<<<<<< @@ -15352,7 +15054,7 @@ __pyx_t_1 = ((__pyx_v_oresult != NULL) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":877 + /* "yt/geometry/oct_container.pyx":801 * &self.tree_root, root_node_compare) * if oresult != NULL: * o[0] = oresult[0].node # <<<<<<<<<<<<<< @@ -15362,7 +15064,7 @@ __pyx_t_2 = (__pyx_v_oresult[0])->node; (__pyx_v_o[0]) = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":878 + /* "yt/geometry/oct_container.pyx":802 * if oresult != NULL: * o[0] = oresult[0].node * return 1 # <<<<<<<<<<<<<< @@ -15372,7 +15074,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":876 + /* "yt/geometry/oct_container.pyx":800 * oresult = tfind(&okey, * &self.tree_root, root_node_compare) * if oresult != NULL: # <<<<<<<<<<<<<< @@ -15381,7 +15083,7 @@ */ } - /* "yt/geometry/oct_container.pyx":879 + /* "yt/geometry/oct_container.pyx":803 * o[0] = oresult[0].node * return 1 * return 0 # <<<<<<<<<<<<<< @@ -15391,7 +15093,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":866 + /* "yt/geometry/oct_container.pyx":790 * raise NotImplementedError * * cdef int get_root(self, int ind[3], Oct **o): # <<<<<<<<<<<<<< @@ -15405,7 +15107,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":881 +/* "yt/geometry/oct_container.pyx":805 * return 0 * * cdef void key_to_ipos(self, np.int64_t key, np.int64_t pos[3]): # <<<<<<<<<<<<<< @@ -15420,7 +15122,7 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("key_to_ipos", 0); - /* "yt/geometry/oct_container.pyx":885 + /* "yt/geometry/oct_container.pyx":809 * # for i in range(20): * # ukey |= (1 << i) * cdef np.int64_t ukey = 1048575 # <<<<<<<<<<<<<< @@ -15429,7 +15131,7 @@ */ __pyx_v_ukey = 0xFFFFF; - /* "yt/geometry/oct_container.pyx":887 + /* "yt/geometry/oct_container.pyx":811 * cdef np.int64_t ukey = 1048575 * cdef int j * for j in range(3): # <<<<<<<<<<<<<< @@ -15439,7 +15141,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_j = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":888 + /* "yt/geometry/oct_container.pyx":812 * cdef int j * for j in range(3): * pos[2 - j] = ((key & ukey)) # <<<<<<<<<<<<<< @@ -15448,7 +15150,7 @@ */ (__pyx_v_pos[(2 - __pyx_v_j)]) = ((__pyx_t_5numpy_int64_t)(__pyx_v_key & __pyx_v_ukey)); - /* "yt/geometry/oct_container.pyx":889 + /* "yt/geometry/oct_container.pyx":813 * for j in range(3): * pos[2 - j] = ((key & ukey)) * key = key >> 20 # <<<<<<<<<<<<<< @@ -15458,7 +15160,7 @@ __pyx_v_key = (__pyx_v_key >> 20); } - /* "yt/geometry/oct_container.pyx":881 + /* "yt/geometry/oct_container.pyx":805 * return 0 * * cdef void key_to_ipos(self, np.int64_t key, np.int64_t pos[3]): # <<<<<<<<<<<<<< @@ -15470,7 +15172,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/oct_container.pyx":891 +/* "yt/geometry/oct_container.pyx":815 * key = key >> 20 * * cdef np.int64_t ipos_to_key(self, int pos[3]): # <<<<<<<<<<<<<< @@ -15486,7 +15188,7 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("ipos_to_key", 0); - /* "yt/geometry/oct_container.pyx":894 + /* "yt/geometry/oct_container.pyx":818 * # We (hope) that 20 bits is enough for each index. * cdef int i * cdef np.int64_t key = 0 # <<<<<<<<<<<<<< @@ -15495,7 +15197,7 @@ */ __pyx_v_key = 0; - /* "yt/geometry/oct_container.pyx":895 + /* "yt/geometry/oct_container.pyx":819 * cdef int i * cdef np.int64_t key = 0 * for i in range(3): # <<<<<<<<<<<<<< @@ -15505,7 +15207,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/oct_container.pyx":897 + /* "yt/geometry/oct_container.pyx":821 * for i in range(3): * # Note the casting here. Bitshifting can cause issues otherwise. * key |= ((pos[i]) << 20 * (2 - i)) # <<<<<<<<<<<<<< @@ -15515,7 +15217,7 @@ __pyx_v_key = (__pyx_v_key | (((__pyx_t_5numpy_int64_t)(__pyx_v_pos[__pyx_v_i])) << (20 * (2 - __pyx_v_i)))); } - /* "yt/geometry/oct_container.pyx":898 + /* "yt/geometry/oct_container.pyx":822 * # Note the casting here. Bitshifting can cause issues otherwise. * key |= ((pos[i]) << 20 * (2 - i)) * return key # <<<<<<<<<<<<<< @@ -15525,7 +15227,7 @@ __pyx_r = __pyx_v_key; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":891 + /* "yt/geometry/oct_container.pyx":815 * key = key >> 20 * * cdef np.int64_t ipos_to_key(self, int pos[3]): # <<<<<<<<<<<<<< @@ -15539,7 +15241,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":901 +/* "yt/geometry/oct_container.pyx":825 * * @cython.cdivision(True) * cdef void visit_all_octs(self, SelectorObject selector, # <<<<<<<<<<<<<< @@ -15570,7 +15272,7 @@ } } - /* "yt/geometry/oct_container.pyx":906 + /* "yt/geometry/oct_container.pyx":830 * cdef int i, j, k, n * cdef np.int64_t key, ukey * visitor.global_index = -1 # <<<<<<<<<<<<<< @@ -15579,7 +15281,7 @@ */ __pyx_v_visitor->global_index = -1LL; - /* "yt/geometry/oct_container.pyx":907 + /* "yt/geometry/oct_container.pyx":831 * cdef np.int64_t key, ukey * visitor.global_index = -1 * visitor.level = 0 # <<<<<<<<<<<<<< @@ -15588,7 +15290,7 @@ */ __pyx_v_visitor->level = 0; - /* "yt/geometry/oct_container.pyx":908 + /* "yt/geometry/oct_container.pyx":832 * visitor.global_index = -1 * visitor.level = 0 * if vc == -1: # <<<<<<<<<<<<<< @@ -15598,7 +15300,7 @@ __pyx_t_1 = ((__pyx_v_vc == -1L) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":909 + /* "yt/geometry/oct_container.pyx":833 * visitor.level = 0 * if vc == -1: * vc = self.partial_coverage # <<<<<<<<<<<<<< @@ -15608,7 +15310,7 @@ __pyx_t_2 = __pyx_v_self->__pyx_base.partial_coverage; __pyx_v_vc = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":908 + /* "yt/geometry/oct_container.pyx":832 * visitor.global_index = -1 * visitor.level = 0 * if vc == -1: # <<<<<<<<<<<<<< @@ -15617,7 +15319,7 @@ */ } - /* "yt/geometry/oct_container.pyx":913 + /* "yt/geometry/oct_container.pyx":837 * cdef np.float64_t dds[3] * # This dds is the oct-width * for i in range(3): # <<<<<<<<<<<<<< @@ -15627,7 +15329,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":914 + /* "yt/geometry/oct_container.pyx":838 * # This dds is the oct-width * for i in range(3): * dds[i] = (self.DRE[i] - self.DLE[i]) / self.nn[i] # <<<<<<<<<<<<<< @@ -15637,7 +15339,7 @@ (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_self->__pyx_base.DRE[__pyx_v_i]) - (__pyx_v_self->__pyx_base.DLE[__pyx_v_i])) / (__pyx_v_self->__pyx_base.nn[__pyx_v_i])); } - /* "yt/geometry/oct_container.pyx":917 + /* "yt/geometry/oct_container.pyx":841 * # Pos is the center of the octs * cdef Oct *o * for i in range(self.num_root): # <<<<<<<<<<<<<< @@ -15648,7 +15350,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/geometry/oct_container.pyx":918 + /* "yt/geometry/oct_container.pyx":842 * cdef Oct *o * for i in range(self.num_root): * o = self.root_nodes[i].node # <<<<<<<<<<<<<< @@ -15658,7 +15360,7 @@ __pyx_t_4 = (__pyx_v_self->root_nodes[__pyx_v_i]).node; __pyx_v_o = __pyx_t_4; - /* "yt/geometry/oct_container.pyx":919 + /* "yt/geometry/oct_container.pyx":843 * for i in range(self.num_root): * o = self.root_nodes[i].node * key = self.root_nodes[i].key # <<<<<<<<<<<<<< @@ -15668,7 +15370,7 @@ __pyx_t_5 = (__pyx_v_self->root_nodes[__pyx_v_i]).key; __pyx_v_key = __pyx_t_5; - /* "yt/geometry/oct_container.pyx":920 + /* "yt/geometry/oct_container.pyx":844 * o = self.root_nodes[i].node * key = self.root_nodes[i].key * self.key_to_ipos(key, visitor.pos) # <<<<<<<<<<<<<< @@ -15677,7 +15379,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->key_to_ipos(__pyx_v_self, __pyx_v_key, __pyx_v_visitor->pos); - /* "yt/geometry/oct_container.pyx":921 + /* "yt/geometry/oct_container.pyx":845 * key = self.root_nodes[i].key * self.key_to_ipos(key, visitor.pos) * for j in range(3): # <<<<<<<<<<<<<< @@ -15687,7 +15389,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "yt/geometry/oct_container.pyx":922 + /* "yt/geometry/oct_container.pyx":846 * self.key_to_ipos(key, visitor.pos) * for j in range(3): * pos[j] = self.DLE[j] + (visitor.pos[j] + 0.5) * dds[j] # <<<<<<<<<<<<<< @@ -15697,7 +15399,7 @@ (__pyx_v_pos[__pyx_v_j]) = ((__pyx_v_self->__pyx_base.DLE[__pyx_v_j]) + (((__pyx_v_visitor->pos[__pyx_v_j]) + 0.5) * (__pyx_v_dds[__pyx_v_j]))); } - /* "yt/geometry/oct_container.pyx":923 + /* "yt/geometry/oct_container.pyx":847 * for j in range(3): * pos[j] = self.DLE[j] + (visitor.pos[j] + 0.5) * dds[j] * selector.recursively_visit_octs( # <<<<<<<<<<<<<< @@ -15709,7 +15411,7 @@ ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->recursively_visit_octs(__pyx_v_selector, __pyx_v_o, __pyx_v_pos, __pyx_v_dds, 0, __pyx_v_visitor, &__pyx_t_7); } - /* "yt/geometry/oct_container.pyx":901 + /* "yt/geometry/oct_container.pyx":825 * * @cython.cdivision(True) * cdef void visit_all_octs(self, SelectorObject selector, # <<<<<<<<<<<<<< @@ -15721,7 +15423,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/oct_container.pyx":926 +/* "yt/geometry/oct_container.pyx":850 * o, pos, dds, 0, visitor, vc) * * cdef np.int64_t get_domain_offset(self, int domain_id): # <<<<<<<<<<<<<< @@ -15734,7 +15436,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_domain_offset", 0); - /* "yt/geometry/oct_container.pyx":927 + /* "yt/geometry/oct_container.pyx":851 * * cdef np.int64_t get_domain_offset(self, int domain_id): * return 0 # We no longer have a domain offset. # <<<<<<<<<<<<<< @@ -15744,7 +15446,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":926 + /* "yt/geometry/oct_container.pyx":850 * o, pos, dds, 0, visitor, vc) * * cdef np.int64_t get_domain_offset(self, int domain_id): # <<<<<<<<<<<<<< @@ -15758,7 +15460,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":929 +/* "yt/geometry/oct_container.pyx":853 * return 0 # We no longer have a domain offset. * * cdef Oct* next_root(self, int domain_id, int ind[3]): # <<<<<<<<<<<<<< @@ -15778,7 +15480,7 @@ __pyx_t_5numpy_int64_t __pyx_t_2; __Pyx_RefNannySetupContext("next_root", 0); - /* "yt/geometry/oct_container.pyx":931 + /* "yt/geometry/oct_container.pyx":855 * cdef Oct* next_root(self, int domain_id, int ind[3]): * cdef int i * cdef Oct *next = NULL # <<<<<<<<<<<<<< @@ -15787,20 +15489,20 @@ */ __pyx_v_next = NULL; - /* "yt/geometry/oct_container.pyx":932 + /* "yt/geometry/oct_container.pyx":856 * cdef int i * cdef Oct *next = NULL * self.get_root(ind, &next) # <<<<<<<<<<<<<< * if next != NULL: return next - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_root(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_ind, (&__pyx_v_next)); - /* "yt/geometry/oct_container.pyx":933 + /* "yt/geometry/oct_container.pyx":857 * cdef Oct *next = NULL * self.get_root(ind, &next) * if next != NULL: return next # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) * if cont.n_assigned >= cont.n: */ __pyx_t_1 = ((__pyx_v_next != NULL) != 0); @@ -15809,18 +15511,18 @@ goto __pyx_L0; } - /* "yt/geometry/oct_container.pyx":934 + /* "yt/geometry/oct_container.pyx":858 * self.get_root(ind, &next) * if next != NULL: return next - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] # <<<<<<<<<<<<<< + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) # <<<<<<<<<<<<<< * if cont.n_assigned >= cont.n: * print "Too many assigned." */ - __pyx_v_cont = (__pyx_v_self->__pyx_base.domains[(__pyx_v_domain_id - 1)]); + __pyx_v_cont = __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(__pyx_v_self->__pyx_base.domains, (__pyx_v_domain_id - 1)); - /* "yt/geometry/oct_container.pyx":935 + /* "yt/geometry/oct_container.pyx":859 * if next != NULL: return next - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) * if cont.n_assigned >= cont.n: # <<<<<<<<<<<<<< * print "Too many assigned." * return NULL @@ -15828,16 +15530,16 @@ __pyx_t_1 = ((__pyx_v_cont->n_assigned >= __pyx_v_cont->n) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":936 - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + /* "yt/geometry/oct_container.pyx":860 + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) * if cont.n_assigned >= cont.n: * print "Too many assigned." # <<<<<<<<<<<<<< * return NULL * if self.num_root >= self.max_root: */ - if (__Pyx_PrintOne(0, __pyx_kp_s_Too_many_assigned) < 0) __PYX_ERR(0, 936, __pyx_L1_error) + if (__Pyx_PrintOne(0, __pyx_kp_s_Too_many_assigned) < 0) __PYX_ERR(0, 860, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":937 + /* "yt/geometry/oct_container.pyx":861 * if cont.n_assigned >= cont.n: * print "Too many assigned." * return NULL # <<<<<<<<<<<<<< @@ -15847,16 +15549,16 @@ __pyx_r = NULL; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":935 + /* "yt/geometry/oct_container.pyx":859 * if next != NULL: return next - * cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + * cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) * if cont.n_assigned >= cont.n: # <<<<<<<<<<<<<< * print "Too many assigned." * return NULL */ } - /* "yt/geometry/oct_container.pyx":938 + /* "yt/geometry/oct_container.pyx":862 * print "Too many assigned." * return NULL * if self.num_root >= self.max_root: # <<<<<<<<<<<<<< @@ -15866,26 +15568,26 @@ __pyx_t_1 = ((__pyx_v_self->num_root >= __pyx_v_self->max_root) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":939 + /* "yt/geometry/oct_container.pyx":863 * return NULL * if self.num_root >= self.max_root: * print "Too many roots." # <<<<<<<<<<<<<< * return NULL - * next = &cont.my_octs[cont.n_assigned] + * next = &cont.my_objs[cont.n_assigned] */ - if (__Pyx_PrintOne(0, __pyx_kp_s_Too_many_roots) < 0) __PYX_ERR(0, 939, __pyx_L1_error) + if (__Pyx_PrintOne(0, __pyx_kp_s_Too_many_roots) < 0) __PYX_ERR(0, 863, __pyx_L1_error) - /* "yt/geometry/oct_container.pyx":940 + /* "yt/geometry/oct_container.pyx":864 * if self.num_root >= self.max_root: * print "Too many roots." * return NULL # <<<<<<<<<<<<<< - * next = &cont.my_octs[cont.n_assigned] + * next = &cont.my_objs[cont.n_assigned] * cont.n_assigned += 1 */ __pyx_r = NULL; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":938 + /* "yt/geometry/oct_container.pyx":862 * print "Too many assigned." * return NULL * if self.num_root >= self.max_root: # <<<<<<<<<<<<<< @@ -15894,26 +15596,26 @@ */ } - /* "yt/geometry/oct_container.pyx":941 + /* "yt/geometry/oct_container.pyx":865 * print "Too many roots." * return NULL - * next = &cont.my_octs[cont.n_assigned] # <<<<<<<<<<<<<< + * next = &cont.my_objs[cont.n_assigned] # <<<<<<<<<<<<<< * cont.n_assigned += 1 * cdef np.int64_t key = 0 */ - __pyx_v_next = (&(__pyx_v_cont->my_octs[__pyx_v_cont->n_assigned])); + __pyx_v_next = (&(__pyx_v_cont->my_objs[__pyx_v_cont->n_assigned])); - /* "yt/geometry/oct_container.pyx":942 + /* "yt/geometry/oct_container.pyx":866 * return NULL - * next = &cont.my_octs[cont.n_assigned] + * next = &cont.my_objs[cont.n_assigned] * cont.n_assigned += 1 # <<<<<<<<<<<<<< * cdef np.int64_t key = 0 * cdef OctKey *ikey = &self.root_nodes[self.num_root] */ __pyx_v_cont->n_assigned = (__pyx_v_cont->n_assigned + 1); - /* "yt/geometry/oct_container.pyx":943 - * next = &cont.my_octs[cont.n_assigned] + /* "yt/geometry/oct_container.pyx":867 + * next = &cont.my_objs[cont.n_assigned] * cont.n_assigned += 1 * cdef np.int64_t key = 0 # <<<<<<<<<<<<<< * cdef OctKey *ikey = &self.root_nodes[self.num_root] @@ -15921,7 +15623,7 @@ */ __pyx_v_key = 0; - /* "yt/geometry/oct_container.pyx":944 + /* "yt/geometry/oct_container.pyx":868 * cont.n_assigned += 1 * cdef np.int64_t key = 0 * cdef OctKey *ikey = &self.root_nodes[self.num_root] # <<<<<<<<<<<<<< @@ -15930,7 +15632,7 @@ */ __pyx_v_ikey = (&(__pyx_v_self->root_nodes[__pyx_v_self->num_root])); - /* "yt/geometry/oct_container.pyx":945 + /* "yt/geometry/oct_container.pyx":869 * cdef np.int64_t key = 0 * cdef OctKey *ikey = &self.root_nodes[self.num_root] * cdef np.int64_t okey = ikey.key # <<<<<<<<<<<<<< @@ -15940,7 +15642,7 @@ __pyx_t_2 = __pyx_v_ikey->key; __pyx_v_okey = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":946 + /* "yt/geometry/oct_container.pyx":870 * cdef OctKey *ikey = &self.root_nodes[self.num_root] * cdef np.int64_t okey = ikey.key * key = self.ipos_to_key(ind) # <<<<<<<<<<<<<< @@ -15949,7 +15651,7 @@ */ __pyx_v_key = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->ipos_to_key(__pyx_v_self, __pyx_v_ind); - /* "yt/geometry/oct_container.pyx":947 + /* "yt/geometry/oct_container.pyx":871 * cdef np.int64_t okey = ikey.key * key = self.ipos_to_key(ind) * self.root_nodes[self.num_root].key = key # <<<<<<<<<<<<<< @@ -15958,7 +15660,7 @@ */ (__pyx_v_self->root_nodes[__pyx_v_self->num_root]).key = __pyx_v_key; - /* "yt/geometry/oct_container.pyx":948 + /* "yt/geometry/oct_container.pyx":872 * key = self.ipos_to_key(ind) * self.root_nodes[self.num_root].key = key * self.root_nodes[self.num_root].node = next # <<<<<<<<<<<<<< @@ -15967,7 +15669,7 @@ */ (__pyx_v_self->root_nodes[__pyx_v_self->num_root]).node = __pyx_v_next; - /* "yt/geometry/oct_container.pyx":949 + /* "yt/geometry/oct_container.pyx":873 * self.root_nodes[self.num_root].key = key * self.root_nodes[self.num_root].node = next * tsearch(ikey, &self.tree_root, root_node_compare) # <<<<<<<<<<<<<< @@ -15976,7 +15678,7 @@ */ tsearch(((void *)__pyx_v_ikey), (&__pyx_v_self->tree_root), __pyx_f_2yt_8geometry_13oct_container_root_node_compare); - /* "yt/geometry/oct_container.pyx":950 + /* "yt/geometry/oct_container.pyx":874 * self.root_nodes[self.num_root].node = next * tsearch(ikey, &self.tree_root, root_node_compare) * self.num_root += 1 # <<<<<<<<<<<<<< @@ -15985,7 +15687,7 @@ */ __pyx_v_self->num_root = (__pyx_v_self->num_root + 1); - /* "yt/geometry/oct_container.pyx":951 + /* "yt/geometry/oct_container.pyx":875 * tsearch(ikey, &self.tree_root, root_node_compare) * self.num_root += 1 * self.nocts += 1 # <<<<<<<<<<<<<< @@ -15994,7 +15696,7 @@ */ __pyx_v_self->__pyx_base.nocts = (__pyx_v_self->__pyx_base.nocts + 1); - /* "yt/geometry/oct_container.pyx":952 + /* "yt/geometry/oct_container.pyx":876 * self.num_root += 1 * self.nocts += 1 * return next # <<<<<<<<<<<<<< @@ -16004,7 +15706,7 @@ __pyx_r = __pyx_v_next; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":929 + /* "yt/geometry/oct_container.pyx":853 * return 0 # We no longer have a domain offset. * * cdef Oct* next_root(self, int domain_id, int ind[3]): # <<<<<<<<<<<<<< @@ -16014,14 +15716,14 @@ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.oct_container.SparseOctreeContainer.next_root", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.oct_container.SparseOctreeContainer.next_root", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/oct_container.pyx":954 +/* "yt/geometry/oct_container.pyx":878 * return next * * def allocate_domains(self, domain_counts, int root_nodes): # <<<<<<<<<<<<<< @@ -16045,7 +15747,9 @@ 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; } @@ -16054,14 +15758,15 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_counts)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_root_nodes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("allocate_domains", 1, 2, 2, 1); __PYX_ERR(0, 954, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("allocate_domains", 1, 2, 2, 1); __PYX_ERR(0, 878, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allocate_domains") < 0)) __PYX_ERR(0, 954, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allocate_domains") < 0)) __PYX_ERR(0, 878, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -16070,11 +15775,11 @@ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_domain_counts = values[0]; - __pyx_v_root_nodes = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_root_nodes == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 954, __pyx_L3_error) + __pyx_v_root_nodes = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_root_nodes == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 878, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("allocate_domains", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 954, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("allocate_domains", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 878, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.SparseOctreeContainer.allocate_domains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -16099,14 +15804,14 @@ int __pyx_t_6; __Pyx_RefNannySetupContext("allocate_domains", 0); - /* "yt/geometry/oct_container.pyx":955 + /* "yt/geometry/oct_container.pyx":879 * * def allocate_domains(self, domain_counts, int root_nodes): * OctreeContainer.allocate_domains(self, domain_counts) # <<<<<<<<<<<<<< * self.root_nodes = malloc(sizeof(OctKey) * root_nodes) * self.max_root = root_nodes */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer), __pyx_n_s_allocate_domains); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer), __pyx_n_s_allocate_domains); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -16123,7 +15828,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_domain_counts}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -16131,13 +15836,13 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_domain_counts}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __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; @@ -16148,14 +15853,14 @@ __Pyx_INCREF(__pyx_v_domain_counts); __Pyx_GIVEREF(__pyx_v_domain_counts); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_domain_counts); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __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; - /* "yt/geometry/oct_container.pyx":956 + /* "yt/geometry/oct_container.pyx":880 * def allocate_domains(self, domain_counts, int root_nodes): * OctreeContainer.allocate_domains(self, domain_counts) * self.root_nodes = malloc(sizeof(OctKey) * root_nodes) # <<<<<<<<<<<<<< @@ -16164,7 +15869,7 @@ */ __pyx_v_self->root_nodes = ((struct __pyx_t_2yt_8geometry_13oct_container_OctKey *)malloc(((sizeof(struct __pyx_t_2yt_8geometry_13oct_container_OctKey)) * __pyx_v_root_nodes))); - /* "yt/geometry/oct_container.pyx":957 + /* "yt/geometry/oct_container.pyx":881 * OctreeContainer.allocate_domains(self, domain_counts) * self.root_nodes = malloc(sizeof(OctKey) * root_nodes) * self.max_root = root_nodes # <<<<<<<<<<<<<< @@ -16173,7 +15878,7 @@ */ __pyx_v_self->max_root = __pyx_v_root_nodes; - /* "yt/geometry/oct_container.pyx":958 + /* "yt/geometry/oct_container.pyx":882 * self.root_nodes = malloc(sizeof(OctKey) * root_nodes) * self.max_root = root_nodes * for i in range(root_nodes): # <<<<<<<<<<<<<< @@ -16184,7 +15889,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_4; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/oct_container.pyx":959 + /* "yt/geometry/oct_container.pyx":883 * self.max_root = root_nodes * for i in range(root_nodes): * self.root_nodes[i].key = -1 # <<<<<<<<<<<<<< @@ -16193,7 +15898,7 @@ */ (__pyx_v_self->root_nodes[__pyx_v_i]).key = -1LL; - /* "yt/geometry/oct_container.pyx":960 + /* "yt/geometry/oct_container.pyx":884 * for i in range(root_nodes): * self.root_nodes[i].key = -1 * self.root_nodes[i].node = NULL # <<<<<<<<<<<<<< @@ -16203,7 +15908,7 @@ (__pyx_v_self->root_nodes[__pyx_v_i]).node = NULL; } - /* "yt/geometry/oct_container.pyx":954 + /* "yt/geometry/oct_container.pyx":878 * return next * * def allocate_domains(self, domain_counts, int root_nodes): # <<<<<<<<<<<<<< @@ -16227,7 +15932,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":962 +/* "yt/geometry/oct_container.pyx":886 * self.root_nodes[i].node = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -16251,31 +15956,19 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "yt/geometry/oct_container.pyx":965 + /* "yt/geometry/oct_container.pyx":889 * # This gets called BEFORE the superclass deallocation. But, both get * # called. * if self.root_nodes != NULL: free(self.root_nodes) # <<<<<<<<<<<<<< - * if self.domains != NULL: free(self.domains) * + * cdef class RAMSESOctreeContainer(SparseOctreeContainer): */ __pyx_t_1 = ((__pyx_v_self->root_nodes != NULL) != 0); if (__pyx_t_1) { free(__pyx_v_self->root_nodes); } - /* "yt/geometry/oct_container.pyx":966 - * # called. - * if self.root_nodes != NULL: free(self.root_nodes) - * if self.domains != NULL: free(self.domains) # <<<<<<<<<<<<<< - * - * cdef class RAMSESOctreeContainer(SparseOctreeContainer): - */ - __pyx_t_1 = ((__pyx_v_self->__pyx_base.domains != NULL) != 0); - if (__pyx_t_1) { - free(__pyx_v_self->__pyx_base.domains); - } - - /* "yt/geometry/oct_container.pyx":962 + /* "yt/geometry/oct_container.pyx":886 * self.root_nodes[i].node = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -16287,7 +15980,221 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/oct_container.pyx":972 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_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_2yt_8geometry_13oct_container_21SparseOctreeContainer_10__reduce_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__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.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, 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.root_mesh,self.root_nodes,self.tree_root 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("yt.geometry.oct_container.SparseOctreeContainer.__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.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_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_2yt_8geometry_13oct_container_21SparseOctreeContainer_12__setstate_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__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.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, 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.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_container.SparseOctreeContainer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21RAMSESOctreeContainer_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21RAMSESOctreeContainer_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_2yt_8geometry_13oct_container_21RAMSESOctreeContainer___reduce_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21RAMSESOctreeContainer___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__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.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, 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.root_mesh,self.root_nodes,self.tree_root 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("yt.geometry.oct_container.RAMSESOctreeContainer.__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.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21RAMSESOctreeContainer_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21RAMSESOctreeContainer_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_2yt_8geometry_13oct_container_21RAMSESOctreeContainer_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21RAMSESOctreeContainer_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__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.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, 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.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_container.RAMSESOctreeContainer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_container.pyx":895 * * cdef class ARTOctreeContainer(OctreeContainer): * def __init__(self, oct_domain_dimensions, domain_left_edge, # <<<<<<<<<<<<<< @@ -16316,10 +16223,15 @@ 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; } @@ -16328,21 +16240,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oct_domain_dimensions)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_left_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 972, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 895, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_right_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 972, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 895, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_partial_coverage); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_over_refine); @@ -16350,12 +16266,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 972, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 895, __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); @@ -16371,7 +16289,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 972, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 895, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.oct_container.ARTOctreeContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -16394,17 +16312,17 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/oct_container.pyx":975 + /* "yt/geometry/oct_container.pyx":898 * domain_right_edge, partial_coverage = 0, * over_refine = 1): * OctreeContainer.__init__(self, oct_domain_dimensions, # <<<<<<<<<<<<<< * domain_left_edge, domain_right_edge, partial_coverage, * over_refine) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "yt/geometry/oct_container.pyx":977 + /* "yt/geometry/oct_container.pyx":900 * OctreeContainer.__init__(self, oct_domain_dimensions, * domain_left_edge, domain_right_edge, partial_coverage, * over_refine) # <<<<<<<<<<<<<< @@ -16426,7 +16344,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[7] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_oct_domain_dimensions, __pyx_v_domain_left_edge, __pyx_v_domain_right_edge, __pyx_v_partial_coverage, __pyx_v_over_refine}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 6+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 6+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -16434,13 +16352,13 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[7] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_oct_domain_dimensions, __pyx_v_domain_left_edge, __pyx_v_domain_right_edge, __pyx_v_partial_coverage, __pyx_v_over_refine}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 6+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 6+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(6+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(6+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __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; @@ -16463,14 +16381,14 @@ __Pyx_INCREF(__pyx_v_over_refine); __Pyx_GIVEREF(__pyx_v_over_refine); PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_4, __pyx_v_over_refine); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __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; - /* "yt/geometry/oct_container.pyx":978 + /* "yt/geometry/oct_container.pyx":901 * domain_left_edge, domain_right_edge, partial_coverage, * over_refine) * self.fill_style = "r" # <<<<<<<<<<<<<< @@ -16483,7 +16401,7 @@ __Pyx_DECREF(__pyx_v_self->__pyx_base.fill_style); __pyx_v_self->__pyx_base.fill_style = __pyx_n_s_r; - /* "yt/geometry/oct_container.pyx":972 + /* "yt/geometry/oct_container.pyx":895 * * cdef class ARTOctreeContainer(OctreeContainer): * def __init__(self, oct_domain_dimensions, domain_left_edge, # <<<<<<<<<<<<<< @@ -16506,7 +16424,114 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":980 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_3__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_2yt_8geometry_13oct_container_18ARTOctreeContainer_2__reduce_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *__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.root_mesh cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, 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.root_mesh 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("yt.geometry.oct_container.ARTOctreeContainer.__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.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_5__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_2yt_8geometry_13oct_container_18ARTOctreeContainer_4__setstate_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *__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.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, 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.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_container.ARTOctreeContainer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_container.pyx":903 * self.fill_style = "r" * * cdef OctList *OctList_subneighbor_find(OctList *olist, Oct *top, # <<<<<<<<<<<<<< @@ -16535,7 +16560,7 @@ __pyx_t_5numpy_int64_t __pyx_t_8; __Pyx_RefNannySetupContext("OctList_subneighbor_find", 0); - /* "yt/geometry/oct_container.pyx":982 + /* "yt/geometry/oct_container.pyx":905 * cdef OctList *OctList_subneighbor_find(OctList *olist, Oct *top, * int i, int j, int k): * if top.children == NULL: return olist # <<<<<<<<<<<<<< @@ -16548,7 +16573,7 @@ goto __pyx_L0; } - /* "yt/geometry/oct_container.pyx":991 + /* "yt/geometry/oct_container.pyx":914 * # For now, we assume we will not be doing this along all three zeros, * # because that would be pretty tricky. * if i == j == k == 1: return olist # <<<<<<<<<<<<<< @@ -16568,7 +16593,7 @@ goto __pyx_L0; } - /* "yt/geometry/oct_container.pyx":996 + /* "yt/geometry/oct_container.pyx":919 * cdef np.int64_t off[3][2] * cdef np.int64_t ii, ij, ik, ci * ind[0] = 1 - i # <<<<<<<<<<<<<< @@ -16577,7 +16602,7 @@ */ (__pyx_v_ind[0]) = (1 - __pyx_v_i); - /* "yt/geometry/oct_container.pyx":997 + /* "yt/geometry/oct_container.pyx":920 * cdef np.int64_t ii, ij, ik, ci * ind[0] = 1 - i * ind[1] = 1 - j # <<<<<<<<<<<<<< @@ -16586,7 +16611,7 @@ */ (__pyx_v_ind[1]) = (1 - __pyx_v_j); - /* "yt/geometry/oct_container.pyx":998 + /* "yt/geometry/oct_container.pyx":921 * ind[0] = 1 - i * ind[1] = 1 - j * ind[2] = 1 - k # <<<<<<<<<<<<<< @@ -16595,7 +16620,7 @@ */ (__pyx_v_ind[2]) = (1 - __pyx_v_k); - /* "yt/geometry/oct_container.pyx":999 + /* "yt/geometry/oct_container.pyx":922 * ind[1] = 1 - j * ind[2] = 1 - k * for ii in range(3): # <<<<<<<<<<<<<< @@ -16605,7 +16630,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_ii = __pyx_t_3; - /* "yt/geometry/oct_container.pyx":1000 + /* "yt/geometry/oct_container.pyx":923 * ind[2] = 1 - k * for ii in range(3): * if ind[ii] == 0: # <<<<<<<<<<<<<< @@ -16615,7 +16640,7 @@ __pyx_t_2 = (((__pyx_v_ind[__pyx_v_ii]) == 0) != 0); if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":1001 + /* "yt/geometry/oct_container.pyx":924 * for ii in range(3): * if ind[ii] == 0: * n[ii] = 2 # <<<<<<<<<<<<<< @@ -16624,7 +16649,7 @@ */ (__pyx_v_n[__pyx_v_ii]) = 2; - /* "yt/geometry/oct_container.pyx":1002 + /* "yt/geometry/oct_container.pyx":925 * if ind[ii] == 0: * n[ii] = 2 * off[ii][0] = 0 # <<<<<<<<<<<<<< @@ -16633,7 +16658,7 @@ */ ((__pyx_v_off[__pyx_v_ii])[0]) = 0; - /* "yt/geometry/oct_container.pyx":1003 + /* "yt/geometry/oct_container.pyx":926 * n[ii] = 2 * off[ii][0] = 0 * off[ii][1] = 1 # <<<<<<<<<<<<<< @@ -16642,7 +16667,7 @@ */ ((__pyx_v_off[__pyx_v_ii])[1]) = 1; - /* "yt/geometry/oct_container.pyx":1000 + /* "yt/geometry/oct_container.pyx":923 * ind[2] = 1 - k * for ii in range(3): * if ind[ii] == 0: # <<<<<<<<<<<<<< @@ -16652,7 +16677,7 @@ goto __pyx_L7; } - /* "yt/geometry/oct_container.pyx":1004 + /* "yt/geometry/oct_container.pyx":927 * off[ii][0] = 0 * off[ii][1] = 1 * elif ind[ii] == -1: # <<<<<<<<<<<<<< @@ -16662,7 +16687,7 @@ __pyx_t_2 = (((__pyx_v_ind[__pyx_v_ii]) == -1LL) != 0); if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":1005 + /* "yt/geometry/oct_container.pyx":928 * off[ii][1] = 1 * elif ind[ii] == -1: * n[ii] = 1 # <<<<<<<<<<<<<< @@ -16671,7 +16696,7 @@ */ (__pyx_v_n[__pyx_v_ii]) = 1; - /* "yt/geometry/oct_container.pyx":1006 + /* "yt/geometry/oct_container.pyx":929 * elif ind[ii] == -1: * n[ii] = 1 * off[ii][0] = 1 # <<<<<<<<<<<<<< @@ -16680,7 +16705,7 @@ */ ((__pyx_v_off[__pyx_v_ii])[0]) = 1; - /* "yt/geometry/oct_container.pyx":1004 + /* "yt/geometry/oct_container.pyx":927 * off[ii][0] = 0 * off[ii][1] = 1 * elif ind[ii] == -1: # <<<<<<<<<<<<<< @@ -16690,7 +16715,7 @@ goto __pyx_L7; } - /* "yt/geometry/oct_container.pyx":1007 + /* "yt/geometry/oct_container.pyx":930 * n[ii] = 1 * off[ii][0] = 1 * elif ind[ii] == 1: # <<<<<<<<<<<<<< @@ -16700,7 +16725,7 @@ __pyx_t_2 = (((__pyx_v_ind[__pyx_v_ii]) == 1) != 0); if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":1008 + /* "yt/geometry/oct_container.pyx":931 * off[ii][0] = 1 * elif ind[ii] == 1: * n[ii] = 1 # <<<<<<<<<<<<<< @@ -16709,7 +16734,7 @@ */ (__pyx_v_n[__pyx_v_ii]) = 1; - /* "yt/geometry/oct_container.pyx":1009 + /* "yt/geometry/oct_container.pyx":932 * elif ind[ii] == 1: * n[ii] = 1 * off[ii][0] = 0 # <<<<<<<<<<<<<< @@ -16718,7 +16743,7 @@ */ ((__pyx_v_off[__pyx_v_ii])[0]) = 0; - /* "yt/geometry/oct_container.pyx":1007 + /* "yt/geometry/oct_container.pyx":930 * n[ii] = 1 * off[ii][0] = 1 * elif ind[ii] == 1: # <<<<<<<<<<<<<< @@ -16729,7 +16754,7 @@ __pyx_L7:; } - /* "yt/geometry/oct_container.pyx":1010 + /* "yt/geometry/oct_container.pyx":933 * n[ii] = 1 * off[ii][0] = 0 * for ii in range(n[0]): # <<<<<<<<<<<<<< @@ -16740,7 +16765,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_ii = __pyx_t_4; - /* "yt/geometry/oct_container.pyx":1011 + /* "yt/geometry/oct_container.pyx":934 * off[ii][0] = 0 * for ii in range(n[0]): * for ij in range(n[1]): # <<<<<<<<<<<<<< @@ -16751,7 +16776,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_ij = __pyx_t_6; - /* "yt/geometry/oct_container.pyx":1012 + /* "yt/geometry/oct_container.pyx":935 * for ii in range(n[0]): * for ij in range(n[1]): * for ik in range(n[2]): # <<<<<<<<<<<<<< @@ -16762,7 +16787,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_ik = __pyx_t_8; - /* "yt/geometry/oct_container.pyx":1013 + /* "yt/geometry/oct_container.pyx":936 * for ij in range(n[1]): * for ik in range(n[2]): * ci = cind(off[0][ii], off[1][ij], off[2][ik]) # <<<<<<<<<<<<<< @@ -16771,7 +16796,7 @@ */ __pyx_v_ci = __pyx_f_2yt_8geometry_12oct_visitors_cind(((__pyx_v_off[0])[__pyx_v_ii]), ((__pyx_v_off[1])[__pyx_v_ij]), ((__pyx_v_off[2])[__pyx_v_ik])); - /* "yt/geometry/oct_container.pyx":1014 + /* "yt/geometry/oct_container.pyx":937 * for ik in range(n[2]): * ci = cind(off[0][ii], off[1][ij], off[2][ik]) * cand = top.children[ci] # <<<<<<<<<<<<<< @@ -16780,7 +16805,7 @@ */ __pyx_v_cand = (__pyx_v_top->children[__pyx_v_ci]); - /* "yt/geometry/oct_container.pyx":1015 + /* "yt/geometry/oct_container.pyx":938 * ci = cind(off[0][ii], off[1][ij], off[2][ik]) * cand = top.children[ci] * if cand.children != NULL: # <<<<<<<<<<<<<< @@ -16790,7 +16815,7 @@ __pyx_t_2 = ((__pyx_v_cand->children != NULL) != 0); if (__pyx_t_2) { - /* "yt/geometry/oct_container.pyx":1016 + /* "yt/geometry/oct_container.pyx":939 * cand = top.children[ci] * if cand.children != NULL: * olist = OctList_subneighbor_find(olist, # <<<<<<<<<<<<<< @@ -16799,7 +16824,7 @@ */ __pyx_v_olist = __pyx_f_2yt_8geometry_13oct_container_OctList_subneighbor_find(__pyx_v_olist, __pyx_v_cand, __pyx_v_i, __pyx_v_j, __pyx_v_k); - /* "yt/geometry/oct_container.pyx":1015 + /* "yt/geometry/oct_container.pyx":938 * ci = cind(off[0][ii], off[1][ij], off[2][ik]) * cand = top.children[ci] * if cand.children != NULL: # <<<<<<<<<<<<<< @@ -16809,7 +16834,7 @@ goto __pyx_L14; } - /* "yt/geometry/oct_container.pyx":1019 + /* "yt/geometry/oct_container.pyx":942 * cand, i, j, k) * else: * olist = OctList_append(olist, cand) # <<<<<<<<<<<<<< @@ -16824,7 +16849,7 @@ } } - /* "yt/geometry/oct_container.pyx":1020 + /* "yt/geometry/oct_container.pyx":943 * else: * olist = OctList_append(olist, cand) * return olist # <<<<<<<<<<<<<< @@ -16834,7 +16859,7 @@ __pyx_r = __pyx_v_olist; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":980 + /* "yt/geometry/oct_container.pyx":903 * self.fill_style = "r" * * cdef OctList *OctList_subneighbor_find(OctList *olist, Oct *top, # <<<<<<<<<<<<<< @@ -16848,7 +16873,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":1022 +/* "yt/geometry/oct_container.pyx":945 * return olist * * cdef OctList *OctList_append(OctList *olist, Oct *o): # <<<<<<<<<<<<<< @@ -16864,7 +16889,7 @@ struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_t_2; __Pyx_RefNannySetupContext("OctList_append", 0); - /* "yt/geometry/oct_container.pyx":1023 + /* "yt/geometry/oct_container.pyx":946 * * cdef OctList *OctList_append(OctList *olist, Oct *o): * cdef OctList *this = olist # <<<<<<<<<<<<<< @@ -16873,7 +16898,7 @@ */ __pyx_v_this = __pyx_v_olist; - /* "yt/geometry/oct_container.pyx":1024 + /* "yt/geometry/oct_container.pyx":947 * cdef OctList *OctList_append(OctList *olist, Oct *o): * cdef OctList *this = olist * if this == NULL: # <<<<<<<<<<<<<< @@ -16883,7 +16908,7 @@ __pyx_t_1 = ((__pyx_v_this == NULL) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_container.pyx":1025 + /* "yt/geometry/oct_container.pyx":948 * cdef OctList *this = olist * if this == NULL: * this = malloc(sizeof(OctList)) # <<<<<<<<<<<<<< @@ -16892,7 +16917,7 @@ */ __pyx_v_this = ((struct __pyx_t_2yt_8geometry_13oct_container_OctList *)malloc((sizeof(struct __pyx_t_2yt_8geometry_13oct_container_OctList)))); - /* "yt/geometry/oct_container.pyx":1026 + /* "yt/geometry/oct_container.pyx":949 * if this == NULL: * this = malloc(sizeof(OctList)) * this.next = NULL # <<<<<<<<<<<<<< @@ -16901,7 +16926,7 @@ */ __pyx_v_this->next = NULL; - /* "yt/geometry/oct_container.pyx":1027 + /* "yt/geometry/oct_container.pyx":950 * this = malloc(sizeof(OctList)) * this.next = NULL * this.o = o # <<<<<<<<<<<<<< @@ -16910,7 +16935,7 @@ */ __pyx_v_this->o = __pyx_v_o; - /* "yt/geometry/oct_container.pyx":1028 + /* "yt/geometry/oct_container.pyx":951 * this.next = NULL * this.o = o * return this # <<<<<<<<<<<<<< @@ -16920,7 +16945,7 @@ __pyx_r = __pyx_v_this; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":1024 + /* "yt/geometry/oct_container.pyx":947 * cdef OctList *OctList_append(OctList *olist, Oct *o): * cdef OctList *this = olist * if this == NULL: # <<<<<<<<<<<<<< @@ -16929,7 +16954,7 @@ */ } - /* "yt/geometry/oct_container.pyx":1029 + /* "yt/geometry/oct_container.pyx":952 * this.o = o * return this * while this.next != NULL: # <<<<<<<<<<<<<< @@ -16940,7 +16965,7 @@ __pyx_t_1 = ((__pyx_v_this->next != NULL) != 0); if (!__pyx_t_1) break; - /* "yt/geometry/oct_container.pyx":1030 + /* "yt/geometry/oct_container.pyx":953 * return this * while this.next != NULL: * this = this.next # <<<<<<<<<<<<<< @@ -16951,7 +16976,7 @@ __pyx_v_this = __pyx_t_2; } - /* "yt/geometry/oct_container.pyx":1031 + /* "yt/geometry/oct_container.pyx":954 * while this.next != NULL: * this = this.next * this.next = malloc(sizeof(OctList)) # <<<<<<<<<<<<<< @@ -16960,7 +16985,7 @@ */ __pyx_v_this->next = ((struct __pyx_t_2yt_8geometry_13oct_container_OctList *)malloc((sizeof(struct __pyx_t_2yt_8geometry_13oct_container_OctList)))); - /* "yt/geometry/oct_container.pyx":1032 + /* "yt/geometry/oct_container.pyx":955 * this = this.next * this.next = malloc(sizeof(OctList)) * this = this.next # <<<<<<<<<<<<<< @@ -16970,7 +16995,7 @@ __pyx_t_2 = __pyx_v_this->next; __pyx_v_this = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":1033 + /* "yt/geometry/oct_container.pyx":956 * this.next = malloc(sizeof(OctList)) * this = this.next * this.o = o # <<<<<<<<<<<<<< @@ -16979,7 +17004,7 @@ */ __pyx_v_this->o = __pyx_v_o; - /* "yt/geometry/oct_container.pyx":1034 + /* "yt/geometry/oct_container.pyx":957 * this = this.next * this.o = o * this.next = NULL # <<<<<<<<<<<<<< @@ -16988,7 +17013,7 @@ */ __pyx_v_this->next = NULL; - /* "yt/geometry/oct_container.pyx":1035 + /* "yt/geometry/oct_container.pyx":958 * this.o = o * this.next = NULL * return this # <<<<<<<<<<<<<< @@ -16998,7 +17023,7 @@ __pyx_r = __pyx_v_this; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":1022 + /* "yt/geometry/oct_container.pyx":945 * return olist * * cdef OctList *OctList_append(OctList *olist, Oct *o): # <<<<<<<<<<<<<< @@ -17012,7 +17037,7 @@ return __pyx_r; } -/* "yt/geometry/oct_container.pyx":1037 +/* "yt/geometry/oct_container.pyx":960 * return this * * cdef int OctList_count(OctList *olist): # <<<<<<<<<<<<<< @@ -17029,7 +17054,7 @@ struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_t_2; __Pyx_RefNannySetupContext("OctList_count", 0); - /* "yt/geometry/oct_container.pyx":1038 + /* "yt/geometry/oct_container.pyx":961 * * cdef int OctList_count(OctList *olist): * cdef OctList *this = olist # <<<<<<<<<<<<<< @@ -17038,7 +17063,7 @@ */ __pyx_v_this = __pyx_v_olist; - /* "yt/geometry/oct_container.pyx":1039 + /* "yt/geometry/oct_container.pyx":962 * cdef int OctList_count(OctList *olist): * cdef OctList *this = olist * cdef int i = 0 # Count the list # <<<<<<<<<<<<<< @@ -17047,7 +17072,7 @@ */ __pyx_v_i = 0; - /* "yt/geometry/oct_container.pyx":1040 + /* "yt/geometry/oct_container.pyx":963 * cdef OctList *this = olist * cdef int i = 0 # Count the list * while this != NULL: # <<<<<<<<<<<<<< @@ -17058,7 +17083,7 @@ __pyx_t_1 = ((__pyx_v_this != NULL) != 0); if (!__pyx_t_1) break; - /* "yt/geometry/oct_container.pyx":1041 + /* "yt/geometry/oct_container.pyx":964 * cdef int i = 0 # Count the list * while this != NULL: * i += 1 # <<<<<<<<<<<<<< @@ -17067,7 +17092,7 @@ */ __pyx_v_i = (__pyx_v_i + 1); - /* "yt/geometry/oct_container.pyx":1042 + /* "yt/geometry/oct_container.pyx":965 * while this != NULL: * i += 1 * this = this.next # <<<<<<<<<<<<<< @@ -17078,102 +17103,672 @@ __pyx_v_this = __pyx_t_2; } - /* "yt/geometry/oct_container.pyx":1043 - * i += 1 - * this = this.next - * return i # <<<<<<<<<<<<<< - * - * cdef void OctList_delete(OctList *olist): + /* "yt/geometry/oct_container.pyx":966 + * i += 1 + * this = this.next + * return i # <<<<<<<<<<<<<< + * + * cdef void OctList_delete(OctList *olist): + */ + __pyx_r = __pyx_v_i; + goto __pyx_L0; + + /* "yt/geometry/oct_container.pyx":960 + * return this + * + * cdef int OctList_count(OctList *olist): # <<<<<<<<<<<<<< + * cdef OctList *this = olist + * cdef int i = 0 # Count the list + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_container.pyx":968 + * return i + * + * cdef void OctList_delete(OctList *olist): # <<<<<<<<<<<<<< + * cdef OctList *next + * cdef OctList *this = olist + */ + +static void __pyx_f_2yt_8geometry_13oct_container_OctList_delete(struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_olist) { + struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_next; + struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_this; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_t_2; + __Pyx_RefNannySetupContext("OctList_delete", 0); + + /* "yt/geometry/oct_container.pyx":970 + * cdef void OctList_delete(OctList *olist): + * cdef OctList *next + * cdef OctList *this = olist # <<<<<<<<<<<<<< + * while this != NULL: + * next = this.next + */ + __pyx_v_this = __pyx_v_olist; + + /* "yt/geometry/oct_container.pyx":971 + * cdef OctList *next + * cdef OctList *this = olist + * while this != NULL: # <<<<<<<<<<<<<< + * next = this.next + * free(this) + */ + while (1) { + __pyx_t_1 = ((__pyx_v_this != NULL) != 0); + if (!__pyx_t_1) break; + + /* "yt/geometry/oct_container.pyx":972 + * cdef OctList *this = olist + * while this != NULL: + * next = this.next # <<<<<<<<<<<<<< + * free(this) + * this = next + */ + __pyx_t_2 = __pyx_v_this->next; + __pyx_v_next = __pyx_t_2; + + /* "yt/geometry/oct_container.pyx":973 + * while this != NULL: + * next = this.next + * free(this) # <<<<<<<<<<<<<< + * this = next + * + */ + free(__pyx_v_this); + + /* "yt/geometry/oct_container.pyx":974 + * next = this.next + * free(this) + * this = next # <<<<<<<<<<<<<< + * + * cdef class OctObjectPool(ObjectPool): + */ + __pyx_v_this = __pyx_v_next; + } + + /* "yt/geometry/oct_container.pyx":968 + * return i + * + * cdef void OctList_delete(OctList *olist): # <<<<<<<<<<<<<< + * cdef OctList *next + * cdef OctList *this = olist + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "yt/geometry/oct_container.pyx":982 + * # allocated memory in them. Implementing _con_to_array also provides the + * # opportunity to supply views of the octs in Python code. + * def __cinit__(self): # <<<<<<<<<<<<<< + * # Base class will ALSO be called + * self.itemsize = sizeof(Oct) + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool___cinit__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool___cinit__(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "yt/geometry/oct_container.pyx":984 + * def __cinit__(self): + * # Base class will ALSO be called + * self.itemsize = sizeof(Oct) # <<<<<<<<<<<<<< + * assert(sizeof(OctAllocationContainer) == sizeof(AllocationContainer)) + * + */ + __pyx_v_self->__pyx_base.itemsize = (sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct)); + + /* "yt/geometry/oct_container.pyx":985 + * # Base class will ALSO be called + * self.itemsize = sizeof(Oct) + * assert(sizeof(OctAllocationContainer) == sizeof(AllocationContainer)) # <<<<<<<<<<<<<< + * + * cdef void setup_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(((sizeof(struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer)) == (sizeof(struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer))) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 985, __pyx_L1_error) + } + } + #endif + + /* "yt/geometry/oct_container.pyx":982 + * # allocated memory in them. Implementing _con_to_array also provides the + * # opportunity to supply views of the octs in Python code. + * def __cinit__(self): # <<<<<<<<<<<<<< + * # Base class will ALSO be called + * self.itemsize = sizeof(Oct) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("yt.geometry.oct_container.OctObjectPool.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_container.pyx":987 + * assert(sizeof(OctAllocationContainer) == sizeof(AllocationContainer)) + * + * cdef void setup_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, # <<<<<<<<<<<<<< + * np.int64_t con_id): + * cdef np.uint64_t i + */ + +static void __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_setup_objs(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, void *__pyx_v_obj, __pyx_t_5numpy_uint64_t __pyx_v_n, __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id) { + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_octs; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_uint64_t __pyx_t_1; + __pyx_t_5numpy_uint64_t __pyx_t_2; + __Pyx_RefNannySetupContext("setup_objs", 0); + + /* "yt/geometry/oct_container.pyx":990 + * np.int64_t con_id): + * cdef np.uint64_t i + * cdef Oct* octs = obj # <<<<<<<<<<<<<< + * for n in range(n): + * octs[n].file_ind = octs[n].domain = - 1 + */ + __pyx_v_octs = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)__pyx_v_obj); + + /* "yt/geometry/oct_container.pyx":991 + * cdef np.uint64_t i + * cdef Oct* octs = obj + * for n in range(n): # <<<<<<<<<<<<<< + * octs[n].file_ind = octs[n].domain = - 1 + * octs[n].domain_ind = n + offset + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_n = __pyx_t_2; + + /* "yt/geometry/oct_container.pyx":992 + * cdef Oct* octs = obj + * for n in range(n): + * octs[n].file_ind = octs[n].domain = - 1 # <<<<<<<<<<<<<< + * octs[n].domain_ind = n + offset + * octs[n].children = NULL + */ + (__pyx_v_octs[__pyx_v_n]).file_ind = -1LL; + (__pyx_v_octs[__pyx_v_n]).domain = -1LL; + + /* "yt/geometry/oct_container.pyx":993 + * for n in range(n): + * octs[n].file_ind = octs[n].domain = - 1 + * octs[n].domain_ind = n + offset # <<<<<<<<<<<<<< + * octs[n].children = NULL + * + */ + (__pyx_v_octs[__pyx_v_n]).domain_ind = (__pyx_v_n + __pyx_v_offset); + + /* "yt/geometry/oct_container.pyx":994 + * octs[n].file_ind = octs[n].domain = - 1 + * octs[n].domain_ind = n + offset + * octs[n].children = NULL # <<<<<<<<<<<<<< + * + * cdef void teardown_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, + */ + (__pyx_v_octs[__pyx_v_n]).children = NULL; + } + + /* "yt/geometry/oct_container.pyx":987 + * assert(sizeof(OctAllocationContainer) == sizeof(AllocationContainer)) + * + * cdef void setup_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, # <<<<<<<<<<<<<< + * np.int64_t con_id): + * cdef np.uint64_t i + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "yt/geometry/oct_container.pyx":996 + * octs[n].children = NULL + * + * cdef void teardown_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, # <<<<<<<<<<<<<< + * np.int64_t con_id): + * cdef np.uint64_t i, j + */ + +static void __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_teardown_objs(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, void *__pyx_v_obj, __pyx_t_5numpy_uint64_t __pyx_v_n, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id) { + __pyx_t_5numpy_uint64_t __pyx_v_i; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_my_octs; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_uint64_t __pyx_t_1; + __pyx_t_5numpy_uint64_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("teardown_objs", 0); + + /* "yt/geometry/oct_container.pyx":999 + * np.int64_t con_id): + * cdef np.uint64_t i, j + * cdef Oct *my_octs = obj # <<<<<<<<<<<<<< + * for i in range(n): + * if my_octs[i].children != NULL: + */ + __pyx_v_my_octs = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)__pyx_v_obj); + + /* "yt/geometry/oct_container.pyx":1000 + * cdef np.uint64_t i, j + * cdef Oct *my_octs = obj + * for i in range(n): # <<<<<<<<<<<<<< + * if my_octs[i].children != NULL: + * free(my_octs[i].children) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/geometry/oct_container.pyx":1001 + * cdef Oct *my_octs = obj + * for i in range(n): + * if my_octs[i].children != NULL: # <<<<<<<<<<<<<< + * free(my_octs[i].children) + * free(obj) + */ + __pyx_t_3 = (((__pyx_v_my_octs[__pyx_v_i]).children != NULL) != 0); + if (__pyx_t_3) { + + /* "yt/geometry/oct_container.pyx":1002 + * for i in range(n): + * if my_octs[i].children != NULL: + * free(my_octs[i].children) # <<<<<<<<<<<<<< + * free(obj) + * + */ + free((__pyx_v_my_octs[__pyx_v_i]).children); + + /* "yt/geometry/oct_container.pyx":1001 + * cdef Oct *my_octs = obj + * for i in range(n): + * if my_octs[i].children != NULL: # <<<<<<<<<<<<<< + * free(my_octs[i].children) + * free(obj) + */ + } + } + + /* "yt/geometry/oct_container.pyx":1003 + * if my_octs[i].children != NULL: + * free(my_octs[i].children) + * free(obj) # <<<<<<<<<<<<<< + * + * def _con_to_array(self, int i): + */ + free(__pyx_v_obj); + + /* "yt/geometry/oct_container.pyx":996 + * octs[n].children = NULL + * + * cdef void teardown_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, # <<<<<<<<<<<<<< + * np.int64_t con_id): + * cdef np.uint64_t i, j + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "yt/geometry/oct_container.pyx":1005 + * free(obj) + * + * def _con_to_array(self, int i): # <<<<<<<<<<<<<< + * cdef AllocationContainer *obj = &self.containers[i] + * if obj.n_assigned == 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_3_con_to_array(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_3_con_to_array(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) { + int __pyx_v_i; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_con_to_array (wrapper)", 0); + assert(__pyx_arg_i); { + __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1005, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_container.OctObjectPool._con_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_2_con_to_array(((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_v_self), ((int)__pyx_v_i)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_2_con_to_array(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) { + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *__pyx_v_obj; + __Pyx_memviewslice __pyx_v_mm = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_rv = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded *__pyx_t_2; + struct __pyx_array_obj *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("_con_to_array", 0); + + /* "yt/geometry/oct_container.pyx":1006 + * + * def _con_to_array(self, int i): + * cdef AllocationContainer *obj = &self.containers[i] # <<<<<<<<<<<<<< + * if obj.n_assigned == 0: + * return None + */ + __pyx_v_obj = (&(__pyx_v_self->__pyx_base.containers[__pyx_v_i])); + + /* "yt/geometry/oct_container.pyx":1007 + * def _con_to_array(self, int i): + * cdef AllocationContainer *obj = &self.containers[i] + * if obj.n_assigned == 0: # <<<<<<<<<<<<<< + * return None + * cdef OctPadded[:] mm = ( + */ + __pyx_t_1 = ((__pyx_v_obj->n_assigned == 0) != 0); + if (__pyx_t_1) { + + /* "yt/geometry/oct_container.pyx":1008 + * cdef AllocationContainer *obj = &self.containers[i] + * if obj.n_assigned == 0: + * return None # <<<<<<<<<<<<<< + * cdef OctPadded[:] mm = ( + * obj.my_objs) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "yt/geometry/oct_container.pyx":1007 + * def _con_to_array(self, int i): + * cdef AllocationContainer *obj = &self.containers[i] + * if obj.n_assigned == 0: # <<<<<<<<<<<<<< + * return None + * cdef OctPadded[:] mm = ( + */ + } + + /* "yt/geometry/oct_container.pyx":1010 + * return None + * cdef OctPadded[:] mm = ( + * obj.my_objs) # <<<<<<<<<<<<<< + * rv = np.asarray(mm) + * return rv + */ + __pyx_t_2 = ((struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded *)__pyx_v_obj->my_objs); + + /* "yt/geometry/oct_container.pyx":1009 + * if obj.n_assigned == 0: + * return None + * cdef OctPadded[:] mm = ( # <<<<<<<<<<<<<< + * obj.my_objs) + * rv = np.asarray(mm) + */ + if (!__pyx_t_2) { + PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); + __PYX_ERR(0, 1010, __pyx_L1_error) + } + __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded); + __pyx_t_4 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_obj->n_assigned)); + if (unlikely(!__pyx_t_5 || !__pyx_t_4 || !PyBytes_AsString(__pyx_t_5))) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_array_new(__pyx_t_4, sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_t_2); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(((PyObject *)__pyx_t_3)); + if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_v_mm = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "yt/geometry/oct_container.pyx":1011 + * cdef OctPadded[:] mm = ( + * obj.my_objs) + * rv = np.asarray(mm) # <<<<<<<<<<<<<< + * return rv + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_mm, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + if (!__pyx_t_8) { + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __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_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1011, __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_4); + PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_rv = __pyx_t_5; + __pyx_t_5 = 0; + + /* "yt/geometry/oct_container.pyx":1012 + * obj.my_objs) + * rv = np.asarray(mm) + * return rv # <<<<<<<<<<<<<< */ - __pyx_r = __pyx_v_i; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_rv); + __pyx_r = __pyx_v_rv; goto __pyx_L0; - /* "yt/geometry/oct_container.pyx":1037 - * return this + /* "yt/geometry/oct_container.pyx":1005 + * free(obj) * - * cdef int OctList_count(OctList *olist): # <<<<<<<<<<<<<< - * cdef OctList *this = olist - * cdef int i = 0 # Count the list + * def _con_to_array(self, int i): # <<<<<<<<<<<<<< + * cdef AllocationContainer *obj = &self.containers[i] + * if obj.n_assigned == 0: */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(((PyObject *)__pyx_t_3)); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("yt.geometry.oct_container.OctObjectPool._con_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_mm, 1); + __Pyx_XDECREF(__pyx_v_rv); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/oct_container.pyx":1045 - * return i - * - * cdef void OctList_delete(OctList *olist): # <<<<<<<<<<<<<< - * cdef OctList *next - * cdef OctList *this = olist +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -static void __pyx_f_2yt_8geometry_13oct_container_OctList_delete(struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_olist) { - struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_next; - struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_this; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; - struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_t_2; - __Pyx_RefNannySetupContext("OctList_delete", 0); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_v_self)); - /* "yt/geometry/oct_container.pyx":1047 - * cdef void OctList_delete(OctList *olist): - * cdef OctList *next - * cdef OctList *this = olist # <<<<<<<<<<<<<< - * while this != NULL: - * next = this.next - */ - __pyx_v_this = __pyx_v_olist; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/geometry/oct_container.pyx":1048 - * cdef OctList *next - * cdef OctList *this = olist - * while this != NULL: # <<<<<<<<<<<<<< - * next = this.next - * free(this) +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__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__") */ - while (1) { - __pyx_t_1 = ((__pyx_v_this != NULL) != 0); - if (!__pyx_t_1) break; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, 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) - /* "yt/geometry/oct_container.pyx":1049 - * cdef OctList *this = olist - * while this != NULL: - * next = this.next # <<<<<<<<<<<<<< - * free(this) - * this = next + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_2 = __pyx_v_this->next; - __pyx_v_next = __pyx_t_2; - /* "yt/geometry/oct_container.pyx":1050 - * while this != NULL: - * next = this.next - * free(this) # <<<<<<<<<<<<<< - * this = next + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_container.OctObjectPool.__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__") */ - free(__pyx_v_this); - /* "yt/geometry/oct_container.pyx":1051 - * next = this.next - * free(this) - * this = next # <<<<<<<<<<<<<< +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_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_2yt_8geometry_13oct_container_13OctObjectPool_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__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_v_this = __pyx_v_next; - } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, 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) - /* "yt/geometry/oct_container.pyx":1045 - * return i - * - * cdef void OctList_delete(OctList *olist): # <<<<<<<<<<<<<< - * cdef OctList *next - * cdef OctList *this = olist + /* "(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("yt.geometry.oct_container.OctObjectPool.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } /* "oct_visitors.pxd":51 @@ -17271,7 +17866,7 @@ } /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -17293,7 +17888,7 @@ goto __pyx_L0; /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -17306,8 +17901,8 @@ return __pyx_r; } -/* "selection_routines.pxd":26 - * np.float64_t +/* "selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< * if hasattr(arr, "units"): @@ -17323,39 +17918,39 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_ensure_code", 0); - /* "selection_routines.pxd":27 + /* "selection_routines.pxd":23 * * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): # <<<<<<<<<<<<<< * if "code_length" == str(arr.units): * return arr */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 23, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "selection_routines.pxd":28 + /* "selection_routines.pxd":24 * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< * return arr * arr.convert_to_units("code_length") */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 24, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "selection_routines.pxd":29 + /* "selection_routines.pxd":25 * if hasattr(arr, "units"): * if "code_length" == str(arr.units): * return arr # <<<<<<<<<<<<<< @@ -17367,7 +17962,7 @@ __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "selection_routines.pxd":28 + /* "selection_routines.pxd":24 * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< @@ -17376,21 +17971,21 @@ */ } - /* "selection_routines.pxd":30 + /* "selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 30, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 30, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "selection_routines.pxd":27 + /* "selection_routines.pxd":23 * * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): # <<<<<<<<<<<<<< @@ -17399,7 +17994,7 @@ */ } - /* "selection_routines.pxd":31 + /* "selection_routines.pxd":27 * return arr * arr.convert_to_units("code_length") * return arr # <<<<<<<<<<<<<< @@ -17411,8 +18006,8 @@ __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "selection_routines.pxd":26 - * np.float64_t + /* "selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< * if hasattr(arr, "units"): @@ -17432,7 +18027,7 @@ } /* "selection_routines.pxd":78 - * cdef public np.int64_t domain_id + * cdef public SelectorObject sel2 * * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< * np.float64_t dw, bint periodic) nogil: @@ -17532,7 +18127,7 @@ goto __pyx_L0; /* "selection_routines.pxd":78 - * cdef public np.int64_t domain_id + * cdef public SelectorObject sel2 * * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< * np.float64_t dw, bint periodic) nogil: @@ -17547,18 +18142,18 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":20 * - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -17570,7 +18165,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -17582,7 +18177,7 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ @@ -17622,7 +18217,7 @@ * if f0 > f1: return f0 * return f1 # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ __pyx_r = __pyx_v_f1; goto __pyx_L0; @@ -17643,18 +18238,18 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":28 * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -17666,7 +18261,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -17678,7 +18273,7 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ @@ -17766,7 +18361,7 @@ * if f0 < 0.0: return -f0 * return f0 # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_f0; goto __pyx_L0; @@ -17787,18 +18382,18 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":40 * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -17810,7 +18405,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -17827,7 +18422,7 @@ * if i > b: return b * return i # <<<<<<<<<<<<<< * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_i; goto __pyx_L0; @@ -17835,7 +18430,7 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -17848,18 +18443,18 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -17871,7 +18466,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -17896,7 +18491,7 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -18204,11 +18799,11 @@ * * 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(3, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 218, __pyx_L1_error) + __PYX_ERR(4, 218, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 @@ -18260,11 +18855,11 @@ * * 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(3, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 222, __pyx_L1_error) + __PYX_ERR(4, 222, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") @@ -18569,11 +19164,11 @@ * 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(3, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 259, __pyx_L1_error) + __PYX_ERR(4, 259, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: @@ -18780,22 +19375,22 @@ * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(3, 278, __pyx_L1_error) + __PYX_ERR(4, 278, __pyx_L1_error) break; } @@ -18862,7 +19457,7 @@ * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(4, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 @@ -19021,7 +19616,7 @@ * 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(3, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -19068,7 +19663,7 @@ * 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(3, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -19115,7 +19710,7 @@ * 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(3, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -19162,7 +19757,7 @@ * 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(3, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -19209,7 +19804,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -19290,15 +19885,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(3, 794, __pyx_L1_error) + __PYX_ERR(4, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_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(3, 794, __pyx_L1_error) + __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(4, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -19313,11 +19908,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(3, 795, __pyx_L1_error) + __PYX_ERR(4, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(4, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -19338,7 +19933,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 796, __pyx_L1_error) + __PYX_ERR(4, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -19346,15 +19941,15 @@ __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(3, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(4, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -19367,12 +19962,12 @@ * 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(3, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -19384,11 +19979,11 @@ * * 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(3, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 799, __pyx_L1_error) + __PYX_ERR(4, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -19452,11 +20047,11 @@ * # 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(3, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 803, __pyx_L1_error) + __PYX_ERR(4, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -19475,11 +20070,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -19539,7 +20134,7 @@ * 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(3, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -19561,11 +20156,11 @@ * * # 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(3, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(3, 823, __pyx_L1_error) + __PYX_ERR(4, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -19583,11 +20178,11 @@ * 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(3, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -19601,11 +20196,11 @@ * 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(3, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -19619,11 +20214,11 @@ * 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(3, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -19637,11 +20232,11 @@ * 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(3, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -19655,11 +20250,11 @@ * 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(3, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -19673,11 +20268,11 @@ * 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(3, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -19691,11 +20286,11 @@ * 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(3, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -19709,11 +20304,11 @@ * 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(3, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -19727,11 +20322,11 @@ * 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(3, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -19745,11 +20340,11 @@ * 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(3, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -19763,11 +20358,11 @@ * 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(3, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -19781,11 +20376,11 @@ * 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(3, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -19799,11 +20394,11 @@ * 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(3, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -19817,11 +20412,11 @@ * 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(3, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -19837,11 +20432,11 @@ * 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(3, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -19857,11 +20452,11 @@ * 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(3, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -19877,11 +20472,11 @@ * 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(3, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -19896,19 +20491,19 @@ * 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(3, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 844, __pyx_L1_error) + __PYX_ERR(4, 844, __pyx_L1_error) } __pyx_L15:; @@ -19939,7 +20534,7 @@ * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(3, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(4, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; @@ -20203,7 +20798,7 @@ * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 987, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 987, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 * # Cython code. @@ -20216,7 +20811,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -20230,7 +20825,7 @@ __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(3, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(4, 988, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -20242,11 +20837,11 @@ * * 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(3, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(3, 989, __pyx_L5_except_error) + __PYX_ERR(4, 989, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -20264,7 +20859,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -20334,7 +20929,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 993, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * @@ -20347,7 +20942,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -20361,7 +20956,7 @@ __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(3, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(4, 994, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -20373,11 +20968,11 @@ * * 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(3, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(3, 995, __pyx_L5_except_error) + __PYX_ERR(4, 995, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -20395,7 +20990,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -20465,7 +21060,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 999, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 999, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * @@ -20478,7 +21073,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -20491,7 +21086,7 @@ __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(3, 1000, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(4, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -20501,11 +21096,11 @@ * 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(3, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(3, 1001, __pyx_L5_except_error) + __PYX_ERR(4, 1001, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -20523,7 +21118,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -20549,11 +21144,48 @@ return __pyx_r; } +/* "yt/geometry/oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) + * + */ + +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) { + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_cont", 0); + + /* "yt/geometry/oct_container.pxd":57 + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) # <<<<<<<<<<<<<< + * + * cdef OctList *OctList_append(OctList *list, Oct *o) + */ + __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i]))); + goto __pyx_L0; + + /* "yt/geometry/oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "FromPyStructUtility":11 * * @cname("__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded") - * cdef OctPadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj) except *: # <<<<<<<<<<<<<< - * cdef OctPadded result + * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj) except *: # <<<<<<<<<<<<<< + * cdef struct_type result * if not PyMapping_Check(obj): */ @@ -20575,8 +21207,8 @@ __Pyx_RefNannySetupContext("__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded", 0); /* "FromPyStructUtility":13 - * cdef OctPadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj) except *: - * cdef OctPadded result + * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj) except *: + * cdef struct_type result * if not PyMapping_Check(obj): # <<<<<<<<<<<<<< * PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name) * @@ -20585,19 +21217,19 @@ if (__pyx_t_1) { /* "FromPyStructUtility":14 - * cdef OctPadded result + * cdef struct_type result * if not PyMapping_Check(obj): * PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name) # <<<<<<<<<<<<<< * * try: */ - __pyx_t_2 = PyErr_Format(__pyx_builtin_TypeError, ((char const *)"Expected %.16s, got %.200s"), ((char *)"a mapping"), Py_TYPE(__pyx_v_obj)->tp_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 14, __pyx_L1_error) + __pyx_t_2 = PyErr_Format(__pyx_builtin_TypeError, ((char const *)"Expected %.16s, got %.200s"), ((char *)"a mapping"), Py_TYPE(__pyx_v_obj)->tp_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "FromPyStructUtility":13 - * cdef OctPadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj) except *: - * cdef OctPadded result + * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj) except *: + * cdef struct_type result * if not PyMapping_Check(obj): # <<<<<<<<<<<<<< * PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name) * @@ -20627,7 +21259,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'file_ind'") */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_file_ind); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 17, __pyx_L4_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_file_ind); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_value = __pyx_t_2; __pyx_t_2 = 0; @@ -20643,7 +21275,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20658,7 +21290,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 18, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 18, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -20670,11 +21302,11 @@ * result.file_ind = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 19, __pyx_L6_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 19, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 19, __pyx_L6_except_error) + __PYX_ERR(1, 19, __pyx_L6_except_error) } goto __pyx_L6_except_error; __pyx_L6_except_error:; @@ -20692,7 +21324,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "FromPyStructUtility":20 @@ -20702,7 +21334,7 @@ * try: * value = obj['domain_ind'] */ - __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 20, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 20, __pyx_L1_error) __pyx_v_result.file_ind = __pyx_t_10; /* "FromPyStructUtility":21 @@ -20728,7 +21360,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'domain_ind'") */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_domain_ind); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 22, __pyx_L14_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_domain_ind); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 22, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; @@ -20744,8 +21376,8 @@ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L21_try_end; - __pyx_L14_error:; + goto __pyx_L17_try_end; + __pyx_L12_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20762,7 +21394,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(4, 23, __pyx_L16_except_error) + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 23, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); @@ -20774,14 +21406,14 @@ * result.domain_ind = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 24, __pyx_L16_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 24, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 24, __pyx_L16_except_error) + __PYX_ERR(1, 24, __pyx_L14_except_error) } - goto __pyx_L16_except_error; - __pyx_L16_except_error:; + goto __pyx_L14_except_error; + __pyx_L14_except_error:; /* "FromPyStructUtility":21 * raise ValueError("No value specified for struct attribute 'file_ind'") @@ -20796,7 +21428,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; - __pyx_L21_try_end:; + __pyx_L17_try_end:; } /* "FromPyStructUtility":25 @@ -20806,7 +21438,7 @@ * try: * value = obj['domain'] */ - __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 25, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 25, __pyx_L1_error) __pyx_v_result.domain_ind = __pyx_t_10; /* "FromPyStructUtility":26 @@ -20832,7 +21464,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'domain'") */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 27, __pyx_L24_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 27, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; @@ -20848,8 +21480,8 @@ __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_L31_try_end; - __pyx_L24_error:; + goto __pyx_L25_try_end; + __pyx_L20_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -20866,7 +21498,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 28, __pyx_L26_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 28, __pyx_L22_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); @@ -20878,14 +21510,14 @@ * result.domain = value * try: */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 29, __pyx_L26_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 29, __pyx_L22_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 29, __pyx_L26_except_error) + __PYX_ERR(1, 29, __pyx_L22_except_error) } - goto __pyx_L26_except_error; - __pyx_L26_except_error:; + goto __pyx_L22_except_error; + __pyx_L22_except_error:; /* "FromPyStructUtility":26 * raise ValueError("No value specified for struct attribute 'domain_ind'") @@ -20900,7 +21532,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; - __pyx_L31_try_end:; + __pyx_L25_try_end:; } /* "FromPyStructUtility":30 @@ -20910,7 +21542,7 @@ * try: * value = obj['padding'] */ - __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 30, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_result.domain = __pyx_t_10; /* "FromPyStructUtility":31 @@ -20936,7 +21568,7 @@ * except KeyError: * raise ValueError("No value specified for struct attribute 'padding'") */ - __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_padding); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 32, __pyx_L34_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_padding); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 32, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; @@ -20952,8 +21584,8 @@ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L41_try_end; - __pyx_L34_error:; + goto __pyx_L33_try_end; + __pyx_L28_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20970,7 +21602,7 @@ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(4, 33, __pyx_L36_except_error) + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 33, __pyx_L30_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); @@ -20982,14 +21614,14 @@ * result.padding = value * return result */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 34, __pyx_L36_except_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 34, __pyx_L30_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 34, __pyx_L36_except_error) + __PYX_ERR(1, 34, __pyx_L30_except_error) } - goto __pyx_L36_except_error; - __pyx_L36_except_error:; + goto __pyx_L30_except_error; + __pyx_L30_except_error:; /* "FromPyStructUtility":31 * raise ValueError("No value specified for struct attribute 'domain'") @@ -21004,7 +21636,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3); goto __pyx_L1_error; - __pyx_L41_try_end:; + __pyx_L33_try_end:; } /* "FromPyStructUtility":35 @@ -21014,7 +21646,7 @@ * return result * */ - __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 35, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 35, __pyx_L1_error) __pyx_v_result.padding = __pyx_t_10; /* "FromPyStructUtility":36 @@ -21030,8 +21662,8 @@ /* "FromPyStructUtility":11 * * @cname("__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded") - * cdef OctPadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj) except *: # <<<<<<<<<<<<<< - * cdef OctPadded result + * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj) except *: # <<<<<<<<<<<<<< + * cdef struct_type result * if not PyMapping_Check(obj): */ @@ -21042,6 +21674,7 @@ __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); __pyx_L0:; __Pyx_XDECREF(__pyx_v_value); __Pyx_RefNannyFinishContext(); @@ -21076,10 +21709,15 @@ 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; } @@ -21088,21 +21726,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(4, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(4, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -21110,12 +21752,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -21124,11 +21768,11 @@ } } __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(4, 120, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 121, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) } else { /* "View.MemoryView":121 @@ -21143,15 +21787,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(4, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(4, 120, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __pyx_L1_error) } __pyx_r = __pyx_array___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); @@ -21202,9 +21846,9 @@ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(4, 127, __pyx_L1_error) + __PYX_ERR(1, 127, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(4, 127, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 @@ -21233,11 +21877,11 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 131, __pyx_L1_error) + __PYX_ERR(1, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize @@ -21265,11 +21909,11 @@ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 134, __pyx_L1_error) + __PYX_ERR(1, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") @@ -21298,9 +21942,9 @@ * 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(4, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -21322,7 +21966,7 @@ * 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(4, 138, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) __pyx_t_5 = __pyx_v_format; __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -21338,7 +21982,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(4, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -21376,11 +22020,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 146, __pyx_L1_error) + __PYX_ERR(1, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim @@ -21403,12 +22047,12 @@ 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(4, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 149, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dim = __pyx_t_8; __pyx_v_idx = __pyx_t_7; @@ -21431,11 +22075,11 @@ * self._shape[idx] = dim * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); @@ -21443,20 +22087,20 @@ 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(4, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 151, __pyx_L1_error) + __PYX_ERR(1, 151, __pyx_L1_error) /* "View.MemoryView":150 * @@ -21493,7 +22137,7 @@ * 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(4, 155, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":156 @@ -21535,7 +22179,7 @@ * 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(4, 158, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":159 @@ -21578,19 +22222,19 @@ * 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(4, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 162, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 162, __pyx_L1_error) + __PYX_ERR(1, 162, __pyx_L1_error) } __pyx_L10:; @@ -21619,8 +22263,8 @@ * if allocate_buffer: * */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 168, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; @@ -21660,11 +22304,11 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 174, __pyx_L1_error) + __PYX_ERR(1, 174, __pyx_L1_error) /* "View.MemoryView":173 * @@ -21703,11 +22347,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(4, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __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(4, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { @@ -21828,7 +22472,7 @@ * 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(4, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -21858,7 +22502,7 @@ * 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(4, 187, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { @@ -21898,11 +22542,11 @@ * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 190, __pyx_L1_error) + __PYX_ERR(1, 190, __pyx_L1_error) /* "View.MemoryView":189 * elif self.mode == u"fortran": @@ -22242,7 +22886,7 @@ * @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(4, 221, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22301,11 +22945,11 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -22316,7 +22960,7 @@ 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(4, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -22380,9 +23024,9 @@ * 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(4, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -22445,9 +23089,9 @@ * 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(4, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 233, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -22508,9 +23152,9 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(4, 236, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":235 @@ -22533,6 +23177,113 @@ 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__40, 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__41, 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":240 * * @cname("__pyx_array_new") @@ -22569,13 +23320,13 @@ * 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(4, 245, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 245, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -22589,7 +23340,7 @@ __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(4, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -22613,13 +23364,13 @@ * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -22641,9 +23392,9 @@ * result.data = buf * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 248, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(4, 248, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) /* "View.MemoryView":247 * result = array(shape, itemsize, format, mode.decode('ASCII')) @@ -22652,7 +23403,7 @@ * 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(4, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22728,6 +23479,7 @@ 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; } @@ -22738,7 +23490,7 @@ 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(4, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -22749,7 +23501,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -22847,6 +23599,293 @@ 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":294 * * @cname('__pyx_align_pointer') @@ -22955,8 +23994,11 @@ 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; } @@ -22965,11 +24007,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(4, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -22977,11 +24021,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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; @@ -22989,16 +24034,16 @@ } } __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(4, 341, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 341, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -23069,7 +24114,7 @@ * 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 == -1)) __PYX_ERR(4, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) /* "View.MemoryView":346 * if type(self) is memoryview or obj is not None: @@ -23190,7 +24235,7 @@ * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(4, 357, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) /* "View.MemoryView":356 * if self.lock is NULL: @@ -23531,26 +24576,26 @@ __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(4, 389, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 389, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(4, 389, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(4, 389, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -23560,7 +24605,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(4, 389, __pyx_L1_error) + else __PYX_ERR(1, 389, __pyx_L1_error) } break; } @@ -23578,8 +24623,8 @@ * * 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(4, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(4, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":389 @@ -23696,7 +24741,7 @@ * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 399, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -23708,7 +24753,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(4, 399, __pyx_L1_error) + __PYX_ERR(1, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -23716,14 +24761,14 @@ __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(4, 399, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 399, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 399, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; @@ -23737,7 +24782,7 @@ * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":403 @@ -23748,7 +24793,7 @@ * 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(4, 403, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -23771,7 +24816,7 @@ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(4, 405, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":406 @@ -23782,7 +24827,7 @@ * 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(4, 406, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -23852,7 +24897,7 @@ * * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 409, __pyx_L1_error) + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; @@ -23864,7 +24909,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(4, 409, __pyx_L1_error) + __PYX_ERR(1, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); @@ -23872,14 +24917,14 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 409, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 409, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 409, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; @@ -23893,7 +24938,7 @@ * obj = self.is_slice(value) * if obj: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":412 @@ -23903,7 +24948,7 @@ * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 412, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; @@ -23915,7 +24960,7 @@ * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":414 @@ -23925,9 +24970,9 @@ * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 414, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -23950,10 +24995,10 @@ * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 416, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -23978,7 +25023,7 @@ * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 418, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -24066,7 +25111,7 @@ * 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(4, 423, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":424 @@ -24076,7 +25121,7 @@ * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 424, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":423 @@ -24086,7 +25131,7 @@ * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 423, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -24097,7 +25142,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(4, 423, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -24114,7 +25159,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -24131,7 +25176,7 @@ __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(4, 425, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); @@ -24174,7 +25219,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -24246,7 +25291,7 @@ * 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(4, 434, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":435 * @@ -24255,7 +25300,7 @@ * 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(4, 435, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) /* "View.MemoryView":436 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], @@ -24264,13 +25309,13 @@ * * 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(4, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":434 @@ -24280,7 +25325,7 @@ * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 434, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":430 * return obj @@ -24386,7 +25431,7 @@ * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(4, 450, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) /* "View.MemoryView":449 * if self.view.itemsize > sizeof(array): @@ -24474,7 +25519,7 @@ * */ /*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(4, 459, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 459, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -24497,7 +25542,7 @@ * 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(4, 464, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -24612,7 +25657,7 @@ * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(4, 471, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":472 @@ -24622,7 +25667,7 @@ * * 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(4, 472, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -24681,7 +25726,7 @@ * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -24693,7 +25738,7 @@ * 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(4, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -24721,9 +25766,9 @@ * 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(4, 482, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 482, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -24740,7 +25785,7 @@ #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(4, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -24749,14 +25794,14 @@ #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(4, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 482, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -24767,7 +25812,7 @@ __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(4, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -24804,7 +25849,7 @@ * */ __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(4, 487, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -24846,13 +25891,13 @@ * raise ValueError("Unable to convert item to object") * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 483, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(4, 483, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); @@ -24864,11 +25909,11 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(4, 484, __pyx_L5_except_error) + __PYX_ERR(1, 484, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -24959,7 +26004,7 @@ * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -24982,26 +26027,26 @@ * 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(4, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(4, 499, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -25023,9 +26068,9 @@ * 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(4, 501, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -25042,7 +26087,7 @@ #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(4, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -25051,14 +26096,14 @@ #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(4, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 501, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -25069,12 +26114,12 @@ __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(4, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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(4, 501, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 501, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } @@ -25090,7 +26135,7 @@ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(4, 503, __pyx_L1_error) + __PYX_ERR(1, 503, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -25477,9 +26522,9 @@ * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 540, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(4, 540, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; @@ -25490,7 +26535,7 @@ * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(4, 541, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) /* "View.MemoryView":542 * cdef _memoryviewslice result = memoryview_copy(self) @@ -25617,18 +26662,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 550, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_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(4, 550, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(4, 550, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 550, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; @@ -25705,11 +26750,11 @@ * * 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(4, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(4, 556, __pyx_L1_error) + __PYX_ERR(1, 556, __pyx_L1_error) /* "View.MemoryView":554 * @property @@ -25728,18 +26773,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 558, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_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(4, 558, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 558, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 558, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; @@ -25817,9 +26862,9 @@ * 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(4, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__32, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__44, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -25843,18 +26888,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 565, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 565, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(4, 565, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 565, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -25916,7 +26961,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -25976,7 +27021,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26038,11 +27083,11 @@ * @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(4, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 577, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -26136,7 +27181,7 @@ __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(4, 584, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; @@ -26148,7 +27193,7 @@ * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 585, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; @@ -26326,12 +27371,12 @@ * */ __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(4, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -26342,12 +27387,12 @@ * * def __str__(self): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 599, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -26358,7 +27403,7 @@ * id(self)) * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -26366,7 +27411,7 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -26430,20 +27475,20 @@ * */ __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(4, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 602, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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(4, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -26516,7 +27561,7 @@ * 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(4, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26587,7 +27632,7 @@ * 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(4, 615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26667,7 +27712,7 @@ * 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(4, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":627 @@ -26678,7 +27723,7 @@ * 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(4, 627, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -26759,7 +27804,7 @@ * 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(4, 634, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":639 @@ -26770,7 +27815,7 @@ * */ __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(4, 639, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -26795,6 +27840,113 @@ 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__45, 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__46, 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":643 * * @cname('__pyx_memoryview_new') @@ -26819,11 +27971,11 @@ * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 644, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -26834,7 +27986,7 @@ 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(4, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); @@ -26971,7 +28123,7 @@ * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -27009,7 +28161,7 @@ * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 662, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -27045,26 +28197,26 @@ __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(4, 665, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 665, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(4, 665, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(4, 665, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -27074,7 +28226,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(4, 665, __pyx_L1_error) + else __PYX_ERR(1, 665, __pyx_L1_error) } break; } @@ -27084,7 +28236,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(4, 665, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -27118,17 +28270,17 @@ * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(4, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 668, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__33); - __Pyx_GIVEREF(__pyx_slice__33); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__33); + __Pyx_INCREF(__pyx_slice__47); + __Pyx_GIVEREF(__pyx_slice__47); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__47); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 668, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":669 @@ -27158,7 +28310,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__34); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__48); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) } __pyx_L7:; @@ -27208,19 +28360,19 @@ * * 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(4, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 675, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(4, 675, __pyx_L1_error) + __PYX_ERR(1, 675, __pyx_L1_error) /* "View.MemoryView":674 * have_slices = True @@ -27257,7 +28409,7 @@ * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 678, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) } __pyx_L6:; @@ -27279,7 +28431,7 @@ * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(4, 680, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":681 @@ -27299,16 +28451,16 @@ * * 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(4, 682, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__35); - __Pyx_GIVEREF(__pyx_slice__35); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__35); + __Pyx_INCREF(__pyx_slice__49); + __Pyx_GIVEREF(__pyx_slice__49); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__49); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":681 @@ -27330,20 +28482,20 @@ __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(4, 684, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 684, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 684, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 684, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -27429,11 +28581,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 689, __pyx_L1_error) + __PYX_ERR(1, 689, __pyx_L1_error) /* "View.MemoryView":688 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): @@ -27537,7 +28689,7 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(4, 708, __pyx_L1_error) + __PYX_ERR(1, 708, __pyx_L1_error) } } #endif @@ -27560,7 +28712,7 @@ * 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(4, 711, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -27656,26 +28808,26 @@ __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(4, 732, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 732, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(4, 732, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(4, 732, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -27685,7 +28837,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(4, 732, __pyx_L1_error) + else __PYX_ERR(1, 732, __pyx_L1_error) } break; } @@ -27713,7 +28865,7 @@ * 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(4, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) /* "View.MemoryView":734 * for dim, index in enumerate(indices): @@ -27722,7 +28874,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(4, 734, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) /* "View.MemoryView":733 * @@ -27799,13 +28951,13 @@ * 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(4, 746, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 746, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -27821,13 +28973,13 @@ * 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(4, 747, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 747, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -27843,13 +28995,13 @@ * * 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(4, 748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 748, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -27865,7 +29017,7 @@ * 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(4, 750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -27878,7 +29030,7 @@ * 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(4, 751, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -27891,7 +29043,7 @@ * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 752, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -27904,7 +29056,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(4, 754, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) /* "View.MemoryView":760 * have_start, have_stop, have_step, @@ -27954,7 +29106,7 @@ * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(4, 764, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } /* "View.MemoryView":765 * return memoryview_fromslice(dst, new_ndim, @@ -27963,7 +29115,7 @@ * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(4, 765, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } /* "View.MemoryView":763 * @@ -27972,9 +29124,9 @@ * 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(4, 763, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 763, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -28005,7 +29157,7 @@ * * */ - __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(4, 768, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":768 @@ -28015,7 +29167,7 @@ * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -28118,7 +29270,7 @@ * 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 == -1)) __PYX_ERR(4, 818, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: @@ -28183,7 +29335,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(4, 824, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) /* "View.MemoryView":823 * negative_step = have_step != 0 and step < 0 @@ -28755,7 +29907,7 @@ * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(4, 885, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) } __pyx_L26:; @@ -28812,11 +29964,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -28884,11 +30036,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(4, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __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(4, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); @@ -28996,22 +30148,22 @@ * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(4, 914, __pyx_L1_error) + __PYX_ERR(1, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: @@ -29048,22 +30200,22 @@ * * resultp = bufp + index * stride */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 917, __pyx_L1_error) + __PYX_ERR(1, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) @@ -29263,7 +30415,7 @@ * * return 1 */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(4, 943, __pyx_L1_error) + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] @@ -29297,11 +30449,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -29386,7 +30538,7 @@ * 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(4, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -29410,7 +30562,7 @@ */ /*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(4, 969, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -29469,7 +30621,7 @@ * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(4, 973, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) /* "View.MemoryView":972 * @@ -29489,7 +30641,7 @@ * @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(4, 975, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -29540,30 +30692,137 @@ 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); + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":979 + * @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":978 + * + * @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__51, 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); - /* "View.MemoryView":979 - * @property - * def base(self): - * return self.from_object # <<<<<<<<<<<<<< - * - * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + /* "(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_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->from_object); - __pyx_r = __pyx_v_self->from_object; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__52, 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) - /* "View.MemoryView":978 - * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.from_object - * + /* "(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_L0:; + __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; @@ -29632,9 +30891,9 @@ * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 999, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -29645,7 +30904,7 @@ __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(4, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -29676,7 +30935,7 @@ * 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(4, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -29847,7 +31106,7 @@ __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(4, 1026, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; @@ -29859,12 +31118,12 @@ * * 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(4, 1027, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1027, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1027, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } @@ -29956,7 +31215,7 @@ * 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(4, 1039, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -30013,7 +31272,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -30177,7 +31436,7 @@ * @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(4, 1067, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -30300,7 +31559,7 @@ * * */ - __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(4, 1084, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; @@ -31098,7 +32357,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(4, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) /* "View.MemoryView":1207 * @@ -31270,11 +32529,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -31298,7 +32557,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -31309,13 +32568,13 @@ * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -31334,20 +32593,20 @@ * (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(4, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1237, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 1237, __pyx_L1_error) + __PYX_ERR(1, 1237, __pyx_L1_error) /* "View.MemoryView":1235 * @@ -31367,7 +32626,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -31389,7 +32648,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -31401,11 +32660,11 @@ * * @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(4, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -31421,14 +32680,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #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(4, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -31437,20 +32696,20 @@ #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(4, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -31458,7 +32717,7 @@ __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(4, 1242, __pyx_L1_error) + __PYX_ERR(1, 1242, __pyx_L1_error) /* "View.MemoryView":1241 * @@ -31480,7 +32739,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -31503,7 +32762,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -31525,7 +32784,7 @@ * 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(4, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -31539,14 +32798,14 @@ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #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(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -31555,20 +32814,20 @@ #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(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -31576,7 +32835,7 @@ __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(4, 1247, __pyx_L1_error) + __PYX_ERR(1, 1247, __pyx_L1_error) /* "View.MemoryView":1246 * @cname('__pyx_memoryview_err') @@ -31596,7 +32855,7 @@ */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(4, 1249, __pyx_L1_error) + __PYX_ERR(1, 1249, __pyx_L1_error) } /* "View.MemoryView":1245 @@ -31619,7 +32878,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -31837,7 +33096,7 @@ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 1281, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) } __pyx_L7:; @@ -31867,7 +33126,7 @@ * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 1284, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) /* "View.MemoryView":1283 * _err_extents(i, dst.shape[i], src.shape[i]) @@ -31924,7 +33183,7 @@ * src = tmp * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(4, 1291, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1292 @@ -32108,7 +33367,7 @@ * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(4, 1313, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) /* "View.MemoryView":1314 * @@ -32117,7 +33376,7 @@ * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(4, 1314, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) /* "View.MemoryView":1310 * return 0 @@ -32186,11 +33445,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -32370,7 +33629,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -32394,7 +33653,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -32704,6 +33963,469 @@ /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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; +} + /* "BufferFormatFromTypeInfo":1447 * * @cname('__pyx_format_from_typeinfo') @@ -32764,7 +34486,7 @@ __pyx_L4_bool_binop_done:; if (unlikely(!__pyx_t_1)) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(4, 1453, __pyx_L1_error) + __PYX_ERR(1, 1453, __pyx_L1_error) } } #endif @@ -32786,8 +34508,8 @@ * else: * alignment = b'' */ - __Pyx_INCREF(__pyx_kp_b__37); - __pyx_v_alignment = __pyx_kp_b__37; + __Pyx_INCREF(__pyx_kp_b__53); + __pyx_v_alignment = __pyx_kp_b__53; /* "BufferFormatFromTypeInfo":1455 * assert type.fields != NULL and type.fields.type != NULL @@ -32807,8 +34529,8 @@ * parts = [b"T{"] */ /*else*/ { - __Pyx_INCREF(__pyx_kp_b__38); - __pyx_v_alignment = __pyx_kp_b__38; + __Pyx_INCREF(__pyx_kp_b__54); + __pyx_v_alignment = __pyx_kp_b__54; } __pyx_L6:; @@ -32819,7 +34541,7 @@ * field = type.fields * */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1460, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_b_T); __Pyx_GIVEREF(__pyx_kp_b_T); @@ -32855,7 +34577,7 @@ * parts.append(part + b':' + field.name + b':') * field += 1 */ - __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1464, __pyx_L1_error) + __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -32867,18 +34589,18 @@ * field += 1 * */ - __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__39); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1465, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__55); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1465, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1465, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__39); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1465, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__55); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(4, 1465, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "BufferFormatFromTypeInfo":1466 @@ -32898,12 +34620,12 @@ * else: * fmt = __Pyx_TypeInfoToFormat(type) */ - __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__40); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1468, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__56); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(4, 1468, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(1, 1468, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; @@ -32944,22 +34666,22 @@ * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string * else: */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1472, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __pyx_v_type->ndim; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; - __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1472, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1472, __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 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_5))) __PYX_ERR(4, 1472, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 1472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_extents = ((PyObject*)__pyx_t_6); @@ -32972,21 +34694,21 @@ * else: * result = fmt.string */ - __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__41, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1473, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__57, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1473, __pyx_L1_error) + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1473, __pyx_L1_error) + __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1473, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1473, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(4, 1473, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 1473, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -33008,7 +34730,7 @@ * return result */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1475, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -33052,6 +34774,94 @@ __Pyx_RefNannyFinishContext(); return __pyx_r; } +static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool __pyx_vtable_2yt_8geometry_13oct_container_OctObjectPool; + +static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_OctObjectPool(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *p; + PyObject *o = __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool; + if (unlikely(__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_2yt_8geometry_13oct_container_OctObjectPool(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + 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 + if (likely(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_2yt_8geometry_13oct_container_OctObjectPool); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_13oct_container_OctObjectPool[] = { + {"_con_to_array", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_3_con_to_array, METH_O, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_7__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_13oct_container_OctObjectPool = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_container.OctObjectPool", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_13oct_container_OctObjectPool, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_13oct_container_OctObjectPool, /*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*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_13oct_container_OctObjectPool, /*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_2yt_8geometry_13oct_container_OctreeContainer __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer; static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_OctreeContainer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { @@ -33065,6 +34875,7 @@ if (unlikely(!o)) return 0; p = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)o); p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer; + p->domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)Py_None); Py_INCREF(Py_None); p->fill_style = Py_None; Py_INCREF(Py_None); return o; } @@ -33072,7 +34883,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_13oct_container_OctreeContainer(PyObject *o) { struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *p = (struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -33085,6 +34896,7 @@ --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } + Py_CLEAR(p->domains); Py_CLEAR(p->fill_style); (*Py_TYPE(o)->tp_free)(o); } @@ -33092,6 +34904,9 @@ static int __pyx_tp_traverse_2yt_8geometry_13oct_container_OctreeContainer(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *p = (struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)o; + if (p->domains) { + e = (*v)(((PyObject *)p->domains), a); if (e) return e; + } if (p->fill_style) { e = (*v)(p->fill_style, a); if (e) return e; } @@ -33101,6 +34916,9 @@ static int __pyx_tp_clear_2yt_8geometry_13oct_container_OctreeContainer(PyObject *o) { PyObject* tmp; struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *p = (struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)o; + tmp = ((PyObject*)p->domains); + p->domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); tmp = ((PyObject*)p->fill_style); p->fill_style = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -33111,6 +34929,19 @@ return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10oct_arrays_1__get__(o); } +static PyObject *__pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_domains(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_1__get__(o); +} + +static int __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_domains(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_3__set__(o, v); + } + else { + return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_5__del__(o); + } +} + static PyObject *__pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_nocts(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_1__get__(o); } @@ -33155,27 +34986,30 @@ static PyMethodDef __pyx_methods_2yt_8geometry_13oct_container_OctreeContainer[] = { {"_initialize_root_mesh", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_3_initialize_root_mesh, METH_NOARGS, 0}, {"load_octree", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5load_octree, METH_O, 0}, - {"locate_positions", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_12locate_positions, METH_O, __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_11locate_positions}, - {"domain_identify", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_14domain_identify, METH_O, 0}, - {"mask", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_16mask, METH_VARARGS|METH_KEYWORDS, 0}, - {"icoords", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_18icoords, METH_VARARGS|METH_KEYWORDS, 0}, - {"ires", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_20ires, METH_VARARGS|METH_KEYWORDS, 0}, - {"fwidth", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_22fwidth, METH_VARARGS|METH_KEYWORDS, 0}, - {"fcoords", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_24fcoords, METH_VARARGS|METH_KEYWORDS, 0}, - {"save_octree", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_26save_octree, METH_NOARGS, 0}, - {"selector_fill", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_28selector_fill, METH_VARARGS|METH_KEYWORDS, 0}, - {"domain_ind", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_30domain_ind, METH_VARARGS|METH_KEYWORDS, 0}, - {"add", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_32add, METH_VARARGS|METH_KEYWORDS, 0}, - {"allocate_domains", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_34allocate_domains, METH_O, 0}, - {"file_index_octs", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_36file_index_octs, METH_VARARGS|METH_KEYWORDS, 0}, - {"domain_count", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_38domain_count, METH_O, 0}, - {"fill_level", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_40fill_level, METH_VARARGS|METH_KEYWORDS, 0}, - {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_42finalize, METH_NOARGS, 0}, + {"locate_positions", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9locate_positions, METH_O, __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_8locate_positions}, + {"domain_identify", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11domain_identify, METH_O, 0}, + {"mask", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_13mask, METH_VARARGS|METH_KEYWORDS, 0}, + {"icoords", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_15icoords, METH_VARARGS|METH_KEYWORDS, 0}, + {"ires", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_17ires, METH_VARARGS|METH_KEYWORDS, 0}, + {"fwidth", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_19fwidth, METH_VARARGS|METH_KEYWORDS, 0}, + {"fcoords", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_21fcoords, METH_VARARGS|METH_KEYWORDS, 0}, + {"save_octree", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_23save_octree, METH_NOARGS, 0}, + {"selector_fill", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_25selector_fill, METH_VARARGS|METH_KEYWORDS, 0}, + {"domain_ind", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_27domain_ind, METH_VARARGS|METH_KEYWORDS, 0}, + {"add", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_29add, METH_VARARGS|METH_KEYWORDS, 0}, + {"allocate_domains", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_31allocate_domains, METH_O, 0}, + {"file_index_octs", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_33file_index_octs, METH_VARARGS|METH_KEYWORDS, 0}, + {"domain_count", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_35domain_count, METH_O, 0}, + {"fill_level", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_37fill_level, METH_VARARGS|METH_KEYWORDS, 0}, + {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_39finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_41__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_43__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_2yt_8geometry_13oct_container_OctreeContainer[] = { {(char *)"oct_arrays", __pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_oct_arrays, 0, (char *)0, 0}, + {(char *)"domains", __pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_domains, __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_domains, (char *)0, 0}, {(char *)"nocts", __pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_nocts, __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_nocts, (char *)0, 0}, {(char *)"num_domains", __pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_num_domains, __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_num_domains, (char *)0, 0}, {(char *)"fill_style", __pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_fill_style, __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_fill_style, (char *)0, 0}, @@ -33213,7 +35047,7 @@ __pyx_tp_clear_2yt_8geometry_13oct_container_OctreeContainer, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9__iter__, /*tp_iter*/ + 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_2yt_8geometry_13oct_container_OctreeContainer, /*tp_methods*/ 0, /*tp_members*/ @@ -33252,7 +35086,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_13oct_container_SparseOctreeContainer(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -33273,6 +35107,8 @@ {"load_octree", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_3load_octree, METH_O, 0}, {"save_octree", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_5save_octree, METH_NOARGS, 0}, {"allocate_domains", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_7allocate_domains, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_11__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_13__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -33307,11 +35143,7 @@ __pyx_tp_clear_2yt_8geometry_13oct_container_OctreeContainer, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9__iter__, /*tp_iter*/ - #else 0, /*tp_iter*/ - #endif 0, /*tp_iternext*/ __pyx_methods_2yt_8geometry_13oct_container_SparseOctreeContainer, /*tp_methods*/ 0, /*tp_members*/ @@ -33348,6 +35180,12 @@ return o; } +static PyMethodDef __pyx_methods_2yt_8geometry_13oct_container_RAMSESOctreeContainer[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_21RAMSESOctreeContainer_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_21RAMSESOctreeContainer_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + static PyTypeObject __pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer = { PyVarObject_HEAD_INIT(0, 0) "yt.geometry.oct_container.RAMSESOctreeContainer", /*tp_name*/ @@ -33379,13 +35217,9 @@ __pyx_tp_clear_2yt_8geometry_13oct_container_OctreeContainer, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9__iter__, /*tp_iter*/ - #else 0, /*tp_iter*/ - #endif 0, /*tp_iternext*/ - 0, /*tp_methods*/ + __pyx_methods_2yt_8geometry_13oct_container_RAMSESOctreeContainer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -33425,6 +35259,8 @@ } static PyMethodDef __pyx_methods_2yt_8geometry_13oct_container_ARTOctreeContainer[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -33459,11 +35295,7 @@ __pyx_tp_clear_2yt_8geometry_13oct_container_OctreeContainer, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9__iter__, /*tp_iter*/ - #else 0, /*tp_iter*/ - #endif 0, /*tp_iternext*/ __pyx_methods_2yt_8geometry_13oct_container_ARTOctreeContainer, /*tp_methods*/ 0, /*tp_members*/ @@ -33489,110 +35321,6 @@ 0, /*tp_finalize*/ #endif }; - -static struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *__pyx_freelist_2yt_8geometry_13oct_container___pyx_scope_struct____iter__[8]; -static int __pyx_freecount_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ = 0; - -static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__)))) { - o = (PyObject*)__pyx_freelist_2yt_8geometry_13oct_container___pyx_scope_struct____iter__[--__pyx_freecount_2yt_8geometry_13oct_container___pyx_scope_struct____iter__]; - memset(o, 0, sizeof(struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_2yt_8geometry_13oct_container___pyx_scope_struct____iter__(PyObject *o) { - struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *p = (struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_self); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__)))) { - __pyx_freelist_2yt_8geometry_13oct_container___pyx_scope_struct____iter__[__pyx_freecount_2yt_8geometry_13oct_container___pyx_scope_struct____iter__++] = ((struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_2yt_8geometry_13oct_container___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *p = (struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *)o; - if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_2yt_8geometry_13oct_container___pyx_scope_struct____iter__(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *p = (struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ *)o; - tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_container.__pyx_scope_struct____iter__", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_13oct_container___pyx_scope_struct____iter__), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_13oct_container___pyx_scope_struct____iter__, /*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_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_2yt_8geometry_13oct_container___pyx_scope_struct____iter__, /*tp_traverse*/ - __pyx_tp_clear_2yt_8geometry_13oct_container___pyx_scope_struct____iter__, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_13oct_container___pyx_scope_struct____iter__, /*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) { @@ -33618,7 +35346,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -33668,6 +35396,8 @@ 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} }; @@ -33787,7 +35517,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -33815,6 +35545,8 @@ } 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} }; @@ -33902,7 +35634,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -34014,6 +35746,8 @@ {"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} }; @@ -34139,7 +35873,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -34183,6 +35917,8 @@ } 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} }; @@ -34292,6 +36028,7 @@ {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, {&__pyx_kp_s_GLOBAL_INDEX_RAN_AHEAD, __pyx_k_GLOBAL_INDEX_RAN_AHEAD, sizeof(__pyx_k_GLOBAL_INDEX_RAN_AHEAD), 0, 0, 1, 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}, @@ -34309,8 +36046,8 @@ {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, {&__pyx_n_s_ORDER_MAX, __pyx_k_ORDER_MAX, sizeof(__pyx_k_ORDER_MAX), 0, 0, 1, 1}, {&__pyx_n_s_ORDER_MAX_2, __pyx_k_ORDER_MAX_2, sizeof(__pyx_k_ORDER_MAX_2), 0, 0, 1, 1}, - {&__pyx_n_s_OctreeContainer___iter, __pyx_k_OctreeContainer___iter, sizeof(__pyx_k_OctreeContainer___iter), 0, 0, 1, 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_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0}, {&__pyx_kp_s_Too_many_assigned, __pyx_k_Too_many_assigned, sizeof(__pyx_k_Too_many_assigned), 0, 0, 1, 0}, @@ -34318,14 +36055,15 @@ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_b__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 0, 0, 0}, - {&__pyx_kp_b__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 0, 0, 0}, - {&__pyx_kp_b__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 0, 0, 0}, - {&__pyx_kp_b__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 0, 0, 0}, - {&__pyx_kp_u__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 1, 0, 0}, + {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, + {&__pyx_kp_b__53, __pyx_k__53, sizeof(__pyx_k__53), 0, 0, 0, 0}, + {&__pyx_kp_b__54, __pyx_k__54, sizeof(__pyx_k__54), 0, 0, 0, 0}, + {&__pyx_kp_b__55, __pyx_k__55, sizeof(__pyx_k__55), 0, 0, 0, 0}, + {&__pyx_kp_b__56, __pyx_k__56, sizeof(__pyx_k__56), 0, 0, 0, 0}, + {&__pyx_kp_u__57, __pyx_k__57, sizeof(__pyx_k__57), 0, 1, 0, 0}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_allocate_domains, __pyx_k_allocate_domains, sizeof(__pyx_k_allocate_domains), 0, 0, 1, 1}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 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}, @@ -34334,7 +36072,7 @@ {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, {&__pyx_n_s_cell_inds, __pyx_k_cell_inds, sizeof(__pyx_k_cell_inds), 0, 0, 1, 1}, {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 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}, @@ -34347,6 +36085,7 @@ {&__pyx_n_s_curlevel, __pyx_k_curlevel, sizeof(__pyx_k_curlevel), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_dest_fields, __pyx_k_dest_fields, sizeof(__pyx_k_dest_fields), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1}, {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1}, {&__pyx_n_s_domain_counts, __pyx_k_domain_counts, sizeof(__pyx_k_domain_counts), 0, 0, 1, 1}, @@ -34378,7 +36117,6 @@ {&__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_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_left_edge, __pyx_k_left_edge, sizeof(__pyx_k_left_edge), 0, 0, 1, 1}, {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1}, @@ -34392,6 +36130,8 @@ {&__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_num_cells, __pyx_k_num_cells, sizeof(__pyx_k_num_cells), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, @@ -34408,19 +36148,28 @@ {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_padding, __pyx_k_padding, sizeof(__pyx_k_padding), 0, 0, 1, 1}, {&__pyx_n_s_partial_coverage, __pyx_k_partial_coverage, sizeof(__pyx_k_partial_coverage), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 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_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_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 0, 0, 1, 1}, {&__pyx_n_s_root_nodes, __pyx_k_root_nodes, sizeof(__pyx_k_root_nodes), 0, 0, 1, 1}, {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0}, {&__pyx_n_s_selector, __pyx_k_selector, sizeof(__pyx_k_selector), 0, 0, 1, 1}, - {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_kp_s_self_root_mesh_cannot_be_convert, __pyx_k_self_root_mesh_cannot_be_convert, sizeof(__pyx_k_self_root_mesh_cannot_be_convert), 0, 0, 1, 0}, + {&__pyx_kp_s_self_root_mesh_self_root_nodes_s, __pyx_k_self_root_mesh_self_root_nodes_s, sizeof(__pyx_k_self_root_mesh_self_root_nodes_s), 0, 0, 1, 0}, + {&__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_skip_boundary, __pyx_k_skip_boundary, sizeof(__pyx_k_skip_boundary), 0, 0, 1, 1}, @@ -34432,32 +36181,33 @@ {&__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_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_to_arrays, __pyx_k_to_arrays, sizeof(__pyx_k_to_arrays), 0, 0, 1, 1}, {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 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_yt_geometry_oct_container, __pyx_k_yt_geometry_oct_container, sizeof(__pyx_k_yt_geometry_oct_container), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 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_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 45, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 49, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 165, __pyx_L1_error) - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 183, __pyx_L1_error) - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 605, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 700, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 218, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 989, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(4, 14, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(4, 396, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(4, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(4, 818, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(4, 218, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(4, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -34467,115 +36217,210 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "yt/geometry/oct_container.pyx":134 + /* "yt/geometry/oct_container.pyx":86 * partial_coverage = header['partial_coverage']) * # NOTE: We do not allow domain/file indices to be specified. * cdef SelectorObject selector = selection_routines.AlwaysSelector(None) # <<<<<<<<<<<<<< * cdef oct_visitors.LoadOctree visitor * visitor = oct_visitors.LoadOctree(obj, -1) */ - __pyx_tuple_ = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "yt/geometry/oct_container.pyx":466 + /* "yt/geometry/oct_container.pyx":404 * visitor.mask = mask * self.visit_all_octs(selector, visitor) * return mask.astype("bool") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "yt/geometry/oct_container.pyx":519 + /* "yt/geometry/oct_container.pyx":457 * for i in range(3): * base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i] * fwidth[:,i] *= base_dx # <<<<<<<<<<<<<< * return fwidth * */ - __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__3); __Pyx_GIVEREF(__pyx_slice__3); - /* "yt/geometry/oct_container.pyx":540 + /* "yt/geometry/oct_container.pyx":478 * for i in range(3): * base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i] * coords[:,i] *= base_dx # <<<<<<<<<<<<<< * coords[:,i] += self.DLE[i] * return coords */ - __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__4); __Pyx_GIVEREF(__pyx_slice__4); - /* "yt/geometry/oct_container.pyx":541 + /* "yt/geometry/oct_container.pyx":479 * base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i] * coords[:,i] *= base_dx * coords[:,i] += self.DLE[i] # <<<<<<<<<<<<<< * return coords * */ - __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__5); __Pyx_GIVEREF(__pyx_slice__5); - /* "yt/geometry/oct_container.pyx":551 + /* "yt/geometry/oct_container.pyx":489 * over_refine = self.oref, * partial_coverage = self.partial_coverage) * cdef SelectorObject selector = selection_routines.AlwaysSelector(None) # <<<<<<<<<<<<<< * # domain_id = -1 here, because we want *every* oct * cdef oct_visitors.StoreOctree visitor */ - __pyx_tuple__6 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "yt/geometry/oct_container.pyx":611 + /* "yt/geometry/oct_container.pyx":549 * self.visit_all_octs(selector, visitor) * if (visitor.global_index + 1) * visitor.nz * visitor.dims > source.size: * print "GLOBAL INDEX RAN AHEAD.", # <<<<<<<<<<<<<< * print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size * print dest.size, source.size, num_cells */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_GLOBAL_INDEX_RAN_AHEAD); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_GLOBAL_INDEX_RAN_AHEAD); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "yt/geometry/oct_container.pyx":616 + /* "yt/geometry/oct_container.pyx":554 * raise RuntimeError * if visitor.index > dest.size: * print "DEST INDEX RAN AHEAD.", # <<<<<<<<<<<<<< * print visitor.index - dest.size * print (visitor.global_index + 1) * visitor.nz * visitor.dims, source.size */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_DEST_INDEX_RAN_AHEAD); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 616, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_DEST_INDEX_RAN_AHEAD); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "yt/geometry/oct_container.pyx":818 + /* "yt/geometry/oct_container.pyx":741 * * def finalize(self): * cdef SelectorObject selector = selection_routines.AlwaysSelector(None) # <<<<<<<<<<<<<< * cdef oct_visitors.AssignDomainInd visitor * visitor = oct_visitors.AssignDomainInd(self, 1) */ - __pyx_tuple__9 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "selection_routines.pxd":30 + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_cannot_be_convert); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "(tree fragment)":4 + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_cannot_be_convert); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_self_root_nodes_s); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "(tree fragment)":4 + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_self_root_nodes_s); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_self_root_nodes_s); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "(tree fragment)":4 + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_self_root_nodes_s); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_cannot_be_convert); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "(tree fragment)":4 + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.root_mesh cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_cannot_be_convert); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "(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__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "(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__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -34584,9 +36429,9 @@ * * 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(3, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(4, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -34595,9 +36440,9 @@ * * 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(3, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(4, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -34606,9 +36451,9 @@ * 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(3, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(4, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -34617,9 +36462,9 @@ * * 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(3, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(4, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -34628,9 +36473,9 @@ * # 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(3, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(4, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -34639,9 +36484,9 @@ * * # 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(3, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(4, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -34650,9 +36495,9 @@ * * 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(3, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(4, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -34661,18 +36506,18 @@ * * 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(3, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(4, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _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(3, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(4, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "FromPyStructUtility":19 * value = obj['file_ind'] @@ -34681,9 +36526,9 @@ * result.file_ind = value * try: */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(4, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); /* "FromPyStructUtility":24 * value = obj['domain_ind'] @@ -34692,9 +36537,9 @@ * result.domain_ind = value * try: */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_2); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(4, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_2); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); /* "FromPyStructUtility":29 * value = obj['domain'] @@ -34703,9 +36548,9 @@ * result.domain = value * try: */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_3); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(4, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_3); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); /* "FromPyStructUtility":34 * value = obj['padding'] @@ -34714,9 +36559,9 @@ * result.padding = value * return result */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_4); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(4, 34, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_4); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); /* "View.MemoryView":131 * @@ -34725,9 +36570,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(4, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); /* "View.MemoryView":134 * @@ -34736,9 +36581,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(4, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); /* "View.MemoryView":137 * @@ -34747,9 +36592,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(4, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); /* "View.MemoryView":146 * @@ -34758,9 +36603,9 @@ * * */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(4, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -34769,9 +36614,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(4, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -34780,9 +36625,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(4, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "(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__40 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "(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__41 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -34791,9 +36655,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(4, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -34802,9 +36666,9 @@ * * 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(4, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); /* "View.MemoryView":563 * def suboffsets(self): @@ -34813,12 +36677,31 @@ * * 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(4, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); + __pyx_tuple__44 = PyTuple_New(1); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); __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); + PyTuple_SET_ITEM(__pyx_tuple__44, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "(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__45 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "(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__46 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); /* "View.MemoryView":668 * if item is Ellipsis: @@ -34827,9 +36710,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__33 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) __PYX_ERR(4, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__33); - __Pyx_GIVEREF(__pyx_slice__33); + __pyx_slice__47 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__47)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__47); + __Pyx_GIVEREF(__pyx_slice__47); /* "View.MemoryView":671 * seen_ellipsis = True @@ -34838,9 +36721,9 @@ * have_slices = True * else: */ - __pyx_slice__34 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__34)) __PYX_ERR(4, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__34); - __Pyx_GIVEREF(__pyx_slice__34); + __pyx_slice__48 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__48)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__48); + __Pyx_GIVEREF(__pyx_slice__48); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -34849,9 +36732,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__35 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__35)) __PYX_ERR(4, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__35); - __Pyx_GIVEREF(__pyx_slice__35); + __pyx_slice__49 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__49)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__49); + __Pyx_GIVEREF(__pyx_slice__49); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -34860,9 +36743,28 @@ * * */ - __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(4, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + + /* "(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__51 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + + /* "(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__52 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); /* "View.MemoryView":282 * return self.name @@ -34871,9 +36773,9 @@ * 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(4, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); /* "View.MemoryView":283 * @@ -34882,9 +36784,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(4, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -34893,9 +36795,9 @@ * * */ - __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(4, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); /* "View.MemoryView":287 * @@ -34904,9 +36806,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(4, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); /* "View.MemoryView":288 * @@ -34915,9 +36817,19 @@ * * */ - __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(4, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__63 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -34930,6 +36842,7 @@ __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:; @@ -34995,6 +36908,7 @@ __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 @@ -35032,6 +36946,20 @@ if (__Pyx_ExportFunction("OctList_count", (void (*)(void))__pyx_f_2yt_8geometry_13oct_container_OctList_count, "int (struct __pyx_t_2yt_8geometry_13oct_container_OctList *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("OctList_delete", (void (*)(void))__pyx_f_2yt_8geometry_13oct_container_OctList_delete, "void (struct __pyx_t_2yt_8geometry_13oct_container_OctList *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Type init code ---*/ + __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = __Pyx_ImportType("yt.utilities.lib.allocation_container", "ObjectPool", sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool = &__pyx_vtable_2yt_8geometry_13oct_container_OctObjectPool; + __pyx_vtable_2yt_8geometry_13oct_container_OctObjectPool.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + __pyx_vtable_2yt_8geometry_13oct_container_OctObjectPool.__pyx_base.setup_objs = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_setup_objs; + __pyx_vtable_2yt_8geometry_13oct_container_OctObjectPool.__pyx_base.teardown_objs = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_teardown_objs; + __pyx_vtable_2yt_8geometry_13oct_container_OctObjectPool.get_cont = (struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int))__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont; + __pyx_type_2yt_8geometry_13oct_container_OctObjectPool.tp_base = __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool; + if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_OctObjectPool) < 0) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_type_2yt_8geometry_13oct_container_OctObjectPool.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_OctObjectPool.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool) < 0) __PYX_ERR(0, 976, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "OctObjectPool", (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_OctObjectPool) < 0) __PYX_ERR(0, 976, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_13oct_container_OctObjectPool) < 0) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = &__pyx_type_2yt_8geometry_13oct_container_OctObjectPool; __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = &__pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer; __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.get = (struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_float64_t *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get *__pyx_optional_args))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get; __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.get_root = (int (*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get_root; @@ -35042,10 +36970,11 @@ __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.next_root = (struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_next_root; __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.next_child = (struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_next_child; __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.append_domain = (void (*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_append_domain; - if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_OctreeContainer) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_OctreeContainer) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __pyx_type_2yt_8geometry_13oct_container_OctreeContainer.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_OctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer) < 0) __PYX_ERR(0, 81, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "OctreeContainer", (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_OctreeContainer) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_OctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "OctreeContainer", (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_OctreeContainer) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_13oct_container_OctreeContainer) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = &__pyx_type_2yt_8geometry_13oct_container_OctreeContainer; __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = &__pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer; __pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer.__pyx_base = *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer; @@ -35056,38 +36985,40 @@ __pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer.key_to_ipos = (void (*)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *))__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_key_to_ipos; __pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer.ipos_to_key = (__pyx_t_5numpy_int64_t (*)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, int *))__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_ipos_to_key; __pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer.tp_base = __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer; - if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer) < 0) __PYX_ERR(0, 836, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer) < 0) __PYX_ERR(0, 759, __pyx_L1_error) __pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer) < 0) __PYX_ERR(0, 836, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "SparseOctreeContainer", (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer) < 0) __PYX_ERR(0, 836, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer) < 0) __PYX_ERR(0, 759, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SparseOctreeContainer", (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer) < 0) __PYX_ERR(0, 759, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer) < 0) __PYX_ERR(0, 759, __pyx_L1_error) __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = &__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer; __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = &__pyx_vtable_2yt_8geometry_13oct_container_RAMSESOctreeContainer; __pyx_vtable_2yt_8geometry_13oct_container_RAMSESOctreeContainer.__pyx_base = *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer; __pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer.tp_base = __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer; - if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer) < 0) __PYX_ERR(0, 968, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer) < 0) __PYX_ERR(0, 891, __pyx_L1_error) __pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer) < 0) __PYX_ERR(0, 968, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "RAMSESOctreeContainer", (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer) < 0) __PYX_ERR(0, 968, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer) < 0) __PYX_ERR(0, 891, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "RAMSESOctreeContainer", (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer) < 0) __PYX_ERR(0, 891, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer) < 0) __PYX_ERR(0, 891, __pyx_L1_error) __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = &__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer; __pyx_vtabptr_2yt_8geometry_13oct_container_ARTOctreeContainer = &__pyx_vtable_2yt_8geometry_13oct_container_ARTOctreeContainer; __pyx_vtable_2yt_8geometry_13oct_container_ARTOctreeContainer.__pyx_base = *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer; __pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer.tp_base = __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer; - if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer) < 0) __PYX_ERR(0, 971, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer) < 0) __PYX_ERR(0, 894, __pyx_L1_error) __pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_ARTOctreeContainer) < 0) __PYX_ERR(0, 971, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "ARTOctreeContainer", (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer) < 0) __PYX_ERR(0, 971, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_ARTOctreeContainer) < 0) __PYX_ERR(0, 894, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ARTOctreeContainer", (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer) < 0) __PYX_ERR(0, 894, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer) < 0) __PYX_ERR(0, 894, __pyx_L1_error) __pyx_ptype_2yt_8geometry_13oct_container_ARTOctreeContainer = &__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer; - if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 199, __pyx_L1_error) - __pyx_type_2yt_8geometry_13oct_container___pyx_scope_struct____iter__.tp_print = 0; - __pyx_ptype_2yt_8geometry_13oct_container___pyx_scope_struct____iter__ = &__pyx_type_2yt_8geometry_13oct_container___pyx_scope_struct____iter__; __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(4, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(4, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(4, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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; @@ -35097,18 +37028,20 @@ __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(4, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(4, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(4, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(4, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -35118,11 +37051,11 @@ sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(5, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 861, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(4, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(4, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(4, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(4, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(4, 861, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = __Pyx_ImportType("yt.geometry.oct_visitors", "OctVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(6, 33, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(6, 33, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = __Pyx_ImportType("yt.geometry.oct_visitors", "CountTotalOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts)) __PYX_ERR(6, 59, __pyx_L1_error) @@ -35161,12 +37094,14 @@ __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(6, 114, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType("yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(6, 117, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(6, 117, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 33, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 33, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 71, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 71, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 74, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 74, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(3, 29, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(3, 29, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(3, 67, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(3, 67, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(3, 70, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(3, 70, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType("yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(3, 74, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(3, 74, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("yt.geometry.grid_visitors"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) @@ -35210,51 +37145,51 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ORDER_MAX_2, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/oct_container.pyx":127 + /* "yt/geometry/oct_container.pyx":79 * * @classmethod * def load_octree(cls, header): # <<<<<<<<<<<<<< * cdef np.ndarray[np.uint8_t, ndim=1] ref_mask * ref_mask = header['octree'] */ - __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, __pyx_n_s_load_octree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, __pyx_n_s_load_octree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "yt/geometry/oct_container.pyx":126 - * return rv + /* "yt/geometry/oct_container.pyx":78 + * return self.domains.to_arrays() * * @classmethod # <<<<<<<<<<<<<< * def load_octree(cls, header): * cdef np.ndarray[np.uint8_t, ndim=1] ref_mask */ - __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict, __pyx_n_s_load_octree, __pyx_t_3) < 0) __PYX_ERR(0, 127, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict, __pyx_n_s_load_octree, __pyx_t_3) < 0) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer); - /* "yt/geometry/oct_container.pyx":860 + /* "yt/geometry/oct_container.pyx":784 * * @classmethod * def load_octree(self, header): # <<<<<<<<<<<<<< * raise NotImplementedError * */ - __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer, __pyx_n_s_load_octree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer, __pyx_n_s_load_octree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "yt/geometry/oct_container.pyx":859 + /* "yt/geometry/oct_container.pyx":783 * self.fill_style = "r" * * @classmethod # <<<<<<<<<<<<<< * def load_octree(self, header): * raise NotImplementedError */ - __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict, __pyx_n_s_load_octree, __pyx_t_2) < 0) __PYX_ERR(0, 860, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict, __pyx_n_s_load_octree, __pyx_t_2) < 0) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer); @@ -35275,9 +37210,9 @@ * * 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(4, 207, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(4, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_array_type); @@ -35288,7 +37223,7 @@ * 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(4, 282, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_2); @@ -35302,7 +37237,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 283, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_2); @@ -35316,7 +37251,7 @@ * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 284, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_2); @@ -35330,7 +37265,7 @@ * 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(4, 287, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_2); @@ -35344,7 +37279,7 @@ * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); @@ -35384,9 +37319,9 @@ * * */ - __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 535, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(4, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_memoryview_type); @@ -35397,12 +37332,22 @@ * * */ - __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 981, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(4, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_memoryviewslice_type); + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import 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(1, 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(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "BufferFormatFromTypeInfo":1447 * * @cname('__pyx_format_from_typeinfo') @@ -35420,7 +37365,7 @@ __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.geometry.oct_container", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.geometry.oct_container", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -35467,72 +37412,6 @@ return result; } -/* 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 -} - /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, @@ -35687,9 +37566,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -35702,9 +37584,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -35756,23 +37641,48 @@ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } +/* 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 + /* 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -35891,27 +37801,7 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - 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 #endif /* PyObjectCallMethO */ @@ -35952,11 +37842,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -35979,7 +37865,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -35999,8 +37885,21 @@ } #endif +/* 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(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + /* BufferFormatCheck */ - static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; } @@ -36549,8 +38448,22 @@ __Pyx_ReleaseBuffer(info); } +/* BufferFallbackError */ + static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +/* None */ + static CYTHON_INLINE __pyx_t_5numpy_int32_t __Pyx_div___pyx_t_5numpy_int32_t(__pyx_t_5numpy_int32_t a, __pyx_t_5numpy_int32_t b) { + __pyx_t_5numpy_int32_t q = a / b; + __pyx_t_5numpy_int32_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + /* MemviewSliceInit */ - static int + static int __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, @@ -36684,53 +38597,32 @@ } } -/* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -/* 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(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -/* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { - PyErr_SetString(PyExc_ValueError, - "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +/* 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); } - -/* None */ - static CYTHON_INLINE __pyx_t_5numpy_int32_t __Pyx_div___pyx_t_5numpy_int32_t(__pyx_t_5numpy_int32_t a, __pyx_t_5numpy_int32_t b) { - __pyx_t_5numpy_int32_t q = a / b; - __pyx_t_5numpy_int32_t r = a - q*b; - q -= ((r != 0) & ((r ^ b) < 0)); - return q; +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 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -36892,14 +38784,74 @@ } #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 + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + /* BufferIndexError */ - static void __Pyx_RaiseBufferIndexError(int axis) { + static void __Pyx_RaiseBufferIndexError(int axis) { PyErr_Format(PyExc_IndexError, "Out of bounds on buffer access (axis %d)", axis); } /* ArgTypeTest */ - static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); @@ -36926,7 +38878,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { @@ -37041,8 +38993,67 @@ } #endif +/* PyObjectCallMethod1 */ + static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method, *result = NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto done; +#if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(method))) { + PyObject *self = PyMethod_GET_SELF(method); + if (likely(self)) { + PyObject *args; + PyObject *function = PyMethod_GET_FUNCTION(method); + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {self, arg}; + result = __Pyx_PyFunction_FastCall(function, args, 2); + goto done; + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {self, arg}; + result = __Pyx_PyCFunction_FastCall(function, args, 2); + goto done; + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + Py_INCREF(function); + Py_DECREF(method); method = NULL; + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); + return result; + } + } +#endif + result = __Pyx_PyObject_CallOneArg(method, arg); +done: + Py_XDECREF(method); + return result; +} + +/* append */ + static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + /* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -37060,7 +39071,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -37080,7 +39100,7 @@ } /* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -37120,6 +39140,21 @@ 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; @@ -37163,26 +39198,97 @@ #endif } +/* KeywordStringCheck */ + static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +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 + return 0; +} + +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* 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; + } +} + /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -37206,7 +39312,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -37216,7 +39322,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -37277,28 +39383,15 @@ } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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_COMPILING_IN_CPYTHON -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); -} - /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -37330,8 +39423,23 @@ } } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -37356,7 +39464,7 @@ #endif /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -37430,7 +39538,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -37546,45 +39654,52 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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; } +/* 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; +} + /* StringJoin */ - #if !CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); } -#endif - -/* 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; +#endif + +/* CallNextTpDealloc */ + static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); } /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -37603,8 +39718,91 @@ return NULL; } +/* 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 */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* GetNameInClass */ - static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) { + static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) { PyObject *result; result = __Pyx_PyObject_GetAttrStr(nmspace, name); if (!result) @@ -37613,7 +39811,7 @@ } /* ClassMethod */ - static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { + static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { #if CYTHON_COMPILING_IN_PYPY if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { return PyClassMethod_New(method); @@ -37657,8 +39855,42 @@ return NULL; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -37738,7 +39970,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -37797,12 +40029,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -37841,8 +40076,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -37865,7 +40100,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -37901,7 +40136,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -37914,7 +40149,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -37945,7 +40180,7 @@ } /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -37986,7 +40221,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -38168,7 +40403,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -38191,7 +40426,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -38213,24 +40448,24 @@ } /* 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; + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { - if (sizeof(npy_int64) < sizeof(long)) { + if (sizeof(npy_int32) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) { + } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { - if (sizeof(npy_int64) <= sizeof(long)) { + if (sizeof(npy_int32) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -38238,64 +40473,30 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + return _PyLong_FromByteArray(bytes, sizeof(npy_int32), little, !is_unsigned); } } -static PyObject* __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded s) { - PyObject* res; - PyObject* member; - res = PyDict_New(); if (unlikely(!res)) return NULL; - member = __Pyx_PyInt_From_npy_int64(s.file_ind); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_file_ind, member) < 0)) goto bad; - Py_DECREF(member); - member = __Pyx_PyInt_From_npy_int64(s.domain_ind); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_domain_ind, member) < 0)) goto bad; - Py_DECREF(member); - member = __Pyx_PyInt_From_npy_int64(s.domain); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_domain, member) < 0)) goto bad; - Py_DECREF(member); - member = __Pyx_PyInt_From_npy_int64(s.padding); if (unlikely(!member)) goto bad; - if (unlikely(PyDict_SetItem(res, __pyx_n_s_padding, member) < 0)) goto bad; - Py_DECREF(member); - return res; - bad: - Py_XDECREF(member); - Py_DECREF(res); - return NULL; - } - /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char *itemp) { - return (PyObject *) __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(*(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded *) itemp); -} -static CYTHON_INLINE int __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char *itemp, PyObject *obj) { - struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded value = __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj); - if (PyErr_Occurred()) - return 0; - *(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded *) itemp = value; - return 1; -} - /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { - const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; + 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_int32) < sizeof(long)) { + if (sizeof(npy_int64) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int32) <= sizeof(unsigned PY_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_int32) <= sizeof(long)) { + if (sizeof(npy_int64) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -38303,13 +40504,13 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(npy_int32), + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), little, !is_unsigned); } } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) { const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -38340,7 +40541,7 @@ } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); } static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { @@ -38352,7 +40553,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -38383,7 +40584,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -38414,7 +40615,7 @@ } /* Print */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); if (!f) { @@ -38520,7 +40721,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -38550,8 +40751,42 @@ } } +static PyObject* __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded s) { + PyObject* res; + PyObject* member; + res = PyDict_New(); if (unlikely(!res)) return NULL; + member = __Pyx_PyInt_From_npy_int64(s.file_ind); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_file_ind, member) < 0)) goto bad; + Py_DECREF(member); + member = __Pyx_PyInt_From_npy_int64(s.domain_ind); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_domain_ind, member) < 0)) goto bad; + Py_DECREF(member); + member = __Pyx_PyInt_From_npy_int64(s.domain); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_domain, member) < 0)) goto bad; + Py_DECREF(member); + member = __Pyx_PyInt_From_npy_int64(s.padding); if (unlikely(!member)) goto bad; + if (unlikely(PyDict_SetItem(res, __pyx_n_s_padding, member) < 0)) goto bad; + Py_DECREF(member); + return res; + bad: + Py_XDECREF(member); + Py_DECREF(res); + return NULL; + } + /* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char *itemp) { + return (PyObject *) __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(*(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char *itemp, PyObject *obj) { + struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded value = __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj); + if (PyErr_Occurred()) + return 0; + *(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded *) itemp = value; + return 1; +} + /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -38571,7 +40806,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -38706,7 +40941,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -38726,7 +40961,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -38861,7 +41096,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -38892,7 +41127,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -38959,7 +41194,7 @@ } /* TypeInfoToFormat */ - static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) { + static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) { struct __pyx_typeinfo_string result = { {0} }; char *buf = (char *) result.string; size_t size = type->size; @@ -39003,7 +41238,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -39192,7 +41427,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -39381,7 +41616,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { + static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -39570,7 +41805,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -39758,8 +41993,197 @@ return (long) -1; } +/* CIntFromPy */ + static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { + const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (npy_uint64) 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_uint64) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, digits[0]) + case 2: + if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) >= 2 * PyLong_SHIFT) { + return (npy_uint64) (((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) >= 3 * PyLong_SHIFT) { + return (npy_uint64) (((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) >= 4 * PyLong_SHIFT) { + return (npy_uint64) (((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)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_uint64) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, 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_uint64) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_uint64, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, +digits[0]) + case -2: + if (8 * sizeof(npy_uint64) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint64) ((((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint64) ((((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint64) ((((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + } +#endif + if (sizeof(npy_uint64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, 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_uint64 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_uint64) -1; + } + } else { + npy_uint64 val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_uint64) -1; + val = __Pyx_PyInt_As_npy_uint64(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to npy_uint64"); + return (npy_uint64) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint64"); + return (npy_uint64) -1; +} + /* PrintOne */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static int __Pyx_PrintOne(PyObject* f, PyObject *o) { if (!f) { if (!(f = __Pyx_GetStdout())) @@ -39796,7 +42220,7 @@ #endif /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + 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 @@ -39985,9 +42409,9 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_BufFmt_StackElem stack[2]; + __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; int retcode; if (obj == Py_None) { @@ -39996,7 +42420,7 @@ } retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, PyBUF_RECORDS, 1, - &__Pyx_TypeInfo_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded, stack, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack, &result, obj); if (unlikely(retcode == -1)) goto __pyx_fail; @@ -40008,17 +42432,17 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; - int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__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, 1, + PyBUF_RECORDS, 4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack, &result, obj); if (unlikely(retcode == -1)) @@ -40030,820 +42454,19 @@ return result; } -/* FetchCommonType */ - static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* fake_module; - PyTypeObject* cached_type = NULL; - fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); - if (!fake_module) return NULL; - Py_INCREF(fake_module); - cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); - if (cached_type) { - if (!PyType_Check((PyObject*)cached_type)) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s is not a type object", - type->tp_name); - goto bad; - } - if (cached_type->tp_basicsize != type->tp_basicsize) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s has the wrong size, try recompiling", - type->tp_name); - goto bad; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; - } -done: - Py_DECREF(fake_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} - -/* PyObjectCallMethod1 */ - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { - PyObject *method, *result = NULL; - method = __Pyx_PyObject_GetAttrStr(obj, method_name); - if (unlikely(!method)) goto done; -#if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(method))) { - PyObject *self = PyMethod_GET_SELF(method); - if (likely(self)) { - PyObject *args; - PyObject *function = PyMethod_GET_FUNCTION(method); - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(function)) { - PyObject *args[2] = {self, arg}; - result = __Pyx_PyFunction_FastCall(function, args, 2); - goto done; - } - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(function)) { - PyObject *args[2] = {self, arg}; - result = __Pyx_PyCFunction_FastCall(function, args, 2); - goto done; - } - #endif - args = PyTuple_New(2); - if (unlikely(!args)) goto done; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 1, arg); - Py_INCREF(function); - Py_DECREF(method); method = NULL; - result = __Pyx_PyObject_Call(function, args, NULL); - Py_DECREF(args); - Py_DECREF(function); - return result; - } - } -#endif - result = __Pyx_PyObject_CallOneArg(method, arg); -done: - Py_XDECREF(method); - return result; -} - -/* CoroutineBase */ - #include -#include -static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); -static PyObject *__Pyx_Coroutine_Close(PyObject *self); -static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); -#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) -#if 1 || PY_VERSION_HEX < 0x030300B0 -static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { - PyObject *et, *ev, *tb; - PyObject *value = NULL; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&et, &ev, &tb); - if (!et) { - Py_XDECREF(tb); - Py_XDECREF(ev); - Py_INCREF(Py_None); - *pvalue = Py_None; - return 0; - } - if (likely(et == PyExc_StopIteration)) { - if (!ev) { - Py_INCREF(Py_None); - value = Py_None; - } -#if PY_VERSION_HEX >= 0x030300A0 - else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) { - value = ((PyStopIterationObject *)ev)->value; - Py_INCREF(value); - Py_DECREF(ev); - } -#endif - else if (unlikely(PyTuple_Check(ev))) { - if (PyTuple_GET_SIZE(ev) >= 1) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - value = PyTuple_GET_ITEM(ev, 0); - Py_INCREF(value); -#else - value = PySequence_ITEM(ev, 0); -#endif - } else { - Py_INCREF(Py_None); - value = Py_None; - } - Py_DECREF(ev); - } - else if (!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { - value = ev; - } - if (likely(value)) { - Py_XDECREF(tb); - Py_DECREF(et); - *pvalue = value; - return 0; - } - } else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { - __Pyx_ErrRestore(et, ev, tb); - return -1; - } - PyErr_NormalizeException(&et, &ev, &tb); - if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { - __Pyx_ErrRestore(et, ev, tb); - return -1; - } - Py_XDECREF(tb); - Py_DECREF(et); -#if PY_VERSION_HEX >= 0x030300A0 - value = ((PyStopIterationObject *)ev)->value; - Py_INCREF(value); - Py_DECREF(ev); -#else - { - PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); - Py_DECREF(ev); - if (likely(args)) { - value = PySequence_GetItem(args, 0); - Py_DECREF(args); - } - if (unlikely(!value)) { - __Pyx_ErrRestore(NULL, NULL, NULL); - Py_INCREF(Py_None); - value = Py_None; - } - } -#endif - *pvalue = value; - return 0; -} -#endif -static CYTHON_INLINE -void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) { - PyObject *exc_type = self->exc_type; - PyObject *exc_value = self->exc_value; - PyObject *exc_traceback = self->exc_traceback; - self->exc_type = NULL; - self->exc_value = NULL; - self->exc_traceback = NULL; - Py_XDECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_traceback); -} -static CYTHON_INLINE -int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) { - if (unlikely(gen->is_running)) { - PyErr_SetString(PyExc_ValueError, - "generator already executing"); - return 1; - } - return 0; -} -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) { - PyObject *retval; - __Pyx_PyThreadState_declare - assert(!self->is_running); - if (unlikely(self->resume_label == 0)) { - if (unlikely(value && value != Py_None)) { - PyErr_SetString(PyExc_TypeError, - "can't send non-None value to a " - "just-started generator"); - return NULL; - } - } - if (unlikely(self->resume_label == -1)) { - PyErr_SetNone(PyExc_StopIteration); - return NULL; - } - __Pyx_PyThreadState_assign - if (value) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON -#else - if (self->exc_traceback) { - PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; - PyFrameObject *f = tb->tb_frame; - Py_XINCREF(__pyx_tstate->frame); - assert(f->f_back == NULL); - f->f_back = __pyx_tstate->frame; - } -#endif - __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, - &self->exc_traceback); - } else { - __Pyx_Coroutine_ExceptionClear(self); - } - self->is_running = 1; - retval = self->body((PyObject *) self, value); - self->is_running = 0; - if (retval) { - __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, - &self->exc_traceback); -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON -#else - if (self->exc_traceback) { - PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; - PyFrameObject *f = tb->tb_frame; - Py_CLEAR(f->f_back); - } -#endif - } else { - __Pyx_Coroutine_ExceptionClear(self); - } - return retval; -} -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) { - if (unlikely(!retval && !PyErr_Occurred())) { - PyErr_SetNone(PyExc_StopIteration); - } - return retval; -} -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { - PyObject *ret; - PyObject *val = NULL; - __Pyx_Coroutine_Undelegate(gen); - __Pyx_PyGen_FetchStopIterationValue(&val); - ret = __Pyx_Coroutine_SendEx(gen, val); - Py_XDECREF(val); - return ret; -} -static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { - PyObject *retval; - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(__Pyx_Coroutine_CheckRunning(gen))) - return NULL; - if (yf) { - PyObject *ret; - gen->is_running = 1; - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - ret = __Pyx_Coroutine_Send(yf, value); - } else - #endif - #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_CheckExact(yf)) { - ret = __Pyx_Coroutine_Send(yf, value); - } else - #endif - { - if (value == Py_None) - ret = Py_TYPE(yf)->tp_iternext(yf); - else - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); - } - gen->is_running = 0; - if (likely(ret)) { - return ret; - } - retval = __Pyx_Coroutine_FinishDelegation(gen); - } else { - retval = __Pyx_Coroutine_SendEx(gen, value); - } - return __Pyx_Coroutine_MethodReturn(retval); -} -static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { - PyObject *retval = NULL; - int err = 0; - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; - } else - #endif - #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; - } else - #endif - { - PyObject *meth; - gen->is_running = 1; - meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close); - if (unlikely(!meth)) { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_WriteUnraisable(yf); - } - PyErr_Clear(); - } else { - retval = PyObject_CallFunction(meth, NULL); - Py_DECREF(meth); - if (!retval) - err = -1; - } - gen->is_running = 0; - } - Py_XDECREF(retval); - return err; -} -static PyObject *__Pyx_Generator_Next(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(__Pyx_Coroutine_CheckRunning(gen))) - return NULL; - if (yf) { - PyObject *ret; - gen->is_running = 1; - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - ret = __Pyx_Generator_Next(yf); - } else - #endif - ret = Py_TYPE(yf)->tp_iternext(yf); - gen->is_running = 0; - if (likely(ret)) { - return ret; - } - return __Pyx_Coroutine_FinishDelegation(gen); - } - return __Pyx_Coroutine_SendEx(gen, Py_None); -} -static PyObject *__Pyx_Coroutine_Close(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *retval, *raised_exception; - PyObject *yf = gen->yieldfrom; - int err = 0; - if (unlikely(__Pyx_Coroutine_CheckRunning(gen))) - return NULL; - if (yf) { - Py_INCREF(yf); - err = __Pyx_Coroutine_CloseIter(gen, yf); - __Pyx_Coroutine_Undelegate(gen); - Py_DECREF(yf); - } - if (err == 0) - PyErr_SetNone(PyExc_GeneratorExit); - retval = __Pyx_Coroutine_SendEx(gen, NULL); - if (retval) { - Py_DECREF(retval); - PyErr_SetString(PyExc_RuntimeError, - "generator ignored GeneratorExit"); - return NULL; - } - raised_exception = PyErr_Occurred(); - if (!raised_exception - || raised_exception == PyExc_StopIteration - || raised_exception == PyExc_GeneratorExit - || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit) - || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration)) - { - if (raised_exception) PyErr_Clear(); - Py_INCREF(Py_None); - return Py_None; - } - return NULL; -} -static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *typ; - PyObject *tb = NULL; - PyObject *val = NULL; - PyObject *yf = gen->yieldfrom; - if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) - return NULL; - if (unlikely(__Pyx_Coroutine_CheckRunning(gen))) - return NULL; - if (yf) { - PyObject *ret; - Py_INCREF(yf); - if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) { - int err = __Pyx_Coroutine_CloseIter(gen, yf); - Py_DECREF(yf); - __Pyx_Coroutine_Undelegate(gen); - if (err < 0) - return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL)); - goto throw_here; - } - gen->is_running = 1; - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - ret = __Pyx_Coroutine_Throw(yf, args); - } else - #endif - #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_CheckExact(yf)) { - ret = __Pyx_Coroutine_Throw(yf, args); - } else - #endif - { - PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw); - if (unlikely(!meth)) { - Py_DECREF(yf); - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { - gen->is_running = 0; - return NULL; - } - PyErr_Clear(); - __Pyx_Coroutine_Undelegate(gen); - gen->is_running = 0; - goto throw_here; - } - ret = PyObject_CallObject(meth, args); - Py_DECREF(meth); - } - gen->is_running = 0; - Py_DECREF(yf); - if (!ret) { - ret = __Pyx_Coroutine_FinishDelegation(gen); - } - return __Pyx_Coroutine_MethodReturn(ret); - } -throw_here: - __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL)); -} -static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - Py_VISIT(gen->closure); - Py_VISIT(gen->classobj); - Py_VISIT(gen->yieldfrom); - Py_VISIT(gen->exc_type); - Py_VISIT(gen->exc_value); - Py_VISIT(gen->exc_traceback); - return 0; -} -static int __Pyx_Coroutine_clear(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - Py_CLEAR(gen->closure); - Py_CLEAR(gen->classobj); - Py_CLEAR(gen->yieldfrom); - Py_CLEAR(gen->exc_type); - Py_CLEAR(gen->exc_value); - Py_CLEAR(gen->exc_traceback); - Py_CLEAR(gen->gi_name); - Py_CLEAR(gen->gi_qualname); - return 0; -} -static void __Pyx_Coroutine_dealloc(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject_GC_UnTrack(gen); - if (gen->gi_weakreflist != NULL) - PyObject_ClearWeakRefs(self); - if (gen->resume_label > 0) { - PyObject_GC_Track(self); -#if PY_VERSION_HEX >= 0x030400a1 - if (PyObject_CallFinalizerFromDealloc(self)) -#else - Py_TYPE(gen)->tp_del(self); - if (self->ob_refcnt > 0) -#endif - { - return; - } - PyObject_GC_UnTrack(self); - } - __Pyx_Coroutine_clear(self); - PyObject_GC_Del(gen); -} -static void __Pyx_Coroutine_del(PyObject *self) { - PyObject *res; - PyObject *error_type, *error_value, *error_traceback; - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - __Pyx_PyThreadState_declare - if (gen->resume_label <= 0) - return ; -#if PY_VERSION_HEX < 0x030400a1 - assert(self->ob_refcnt == 0); - self->ob_refcnt = 1; -#endif - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); - res = __Pyx_Coroutine_Close(self); - if (res == NULL) - PyErr_WriteUnraisable(self); - else - Py_DECREF(res); - __Pyx_ErrRestore(error_type, error_value, error_traceback); -#if PY_VERSION_HEX < 0x030400a1 - assert(self->ob_refcnt > 0); - if (--self->ob_refcnt == 0) { - return; - } - { - Py_ssize_t refcnt = self->ob_refcnt; - _Py_NewReference(self); - self->ob_refcnt = refcnt; - } -#if CYTHON_COMPILING_IN_CPYTHON - assert(PyType_IS_GC(self->ob_type) && - _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); - _Py_DEC_REFTOTAL; -#endif -#ifdef COUNT_ALLOCS - --Py_TYPE(self)->tp_frees; - --Py_TYPE(self)->tp_allocs; -#endif -#endif -} -static PyObject * -__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self) -{ - PyObject *name = self->gi_name; - if (unlikely(!name)) name = Py_None; - Py_INCREF(name); - return name; -} -static int -__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value) -{ - PyObject *tmp; -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) { -#else - if (unlikely(value == NULL || !PyString_Check(value))) { -#endif - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - tmp = self->gi_name; - Py_INCREF(value); - self->gi_name = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self) -{ - PyObject *name = self->gi_qualname; - if (unlikely(!name)) name = Py_None; - Py_INCREF(name); - return name; -} -static int -__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value) -{ - PyObject *tmp; -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) { -#else - if (unlikely(value == NULL || !PyString_Check(value))) { -#endif - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - tmp = self->gi_qualname; - Py_INCREF(value); - self->gi_qualname = value; - Py_XDECREF(tmp); - return 0; -} -static __pyx_CoroutineObject *__Pyx__Coroutine_New( - PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *closure, - PyObject *name, PyObject *qualname, PyObject *module_name) { - __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); - if (gen == NULL) - return NULL; - gen->body = body; - gen->closure = closure; - Py_XINCREF(closure); - gen->is_running = 0; - gen->resume_label = 0; - gen->classobj = NULL; - gen->yieldfrom = NULL; - gen->exc_type = NULL; - gen->exc_value = NULL; - gen->exc_traceback = NULL; - gen->gi_weakreflist = NULL; - Py_XINCREF(qualname); - gen->gi_qualname = qualname; - Py_XINCREF(name); - gen->gi_name = name; - Py_XINCREF(module_name); - gen->gi_modulename = module_name; - PyObject_GC_Track(gen); - return gen; -} - -/* PatchModuleWithCoroutine */ - static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - int result; - PyObject *globals, *result_obj; - globals = PyDict_New(); if (unlikely(!globals)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_coroutine_type", - #ifdef __Pyx_Coroutine_USED - (PyObject*)__pyx_CoroutineType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_generator_type", - #ifdef __Pyx_Generator_USED - (PyObject*)__pyx_GeneratorType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; - result_obj = PyRun_String(py_code, Py_file_input, globals, globals); - if (unlikely(!result_obj)) goto ignore; - Py_DECREF(result_obj); - Py_DECREF(globals); - return module; -ignore: - Py_XDECREF(globals); - PyErr_WriteUnraisable(module); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { - Py_DECREF(module); - module = NULL; - } -#else - py_code++; -#endif - return module; -} - -/* PatchGeneratorABC */ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) -static PyObject* __Pyx_patch_abc_module(PyObject *module); -static PyObject* __Pyx_patch_abc_module(PyObject *module) { - module = __Pyx_Coroutine_patch_module( - module, "" -"if _cython_generator_type is not None:\n" -" try: Generator = _module.Generator\n" -" except AttributeError: pass\n" -" else: Generator.register(_cython_generator_type)\n" -"if _cython_coroutine_type is not None:\n" -" try: Coroutine = _module.Coroutine\n" -" except AttributeError: pass\n" -" else: Coroutine.register(_cython_coroutine_type)\n" - ); - return module; -} -#endif -static int __Pyx_patch_abc(void) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - static int abc_patched = 0; - if (!abc_patched) { - PyObject *module; - module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections"); - if (!module) { - PyErr_WriteUnraisable(NULL); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, - ((PY_VERSION_HEX >= 0x03030000) ? - "Cython module failed to register with collections.abc module" : - "Cython module failed to register with collections module"), 1) < 0)) { - return -1; - } - } else { - module = __Pyx_patch_abc_module(module); - abc_patched = 1; - if (unlikely(!module)) - return -1; - Py_DECREF(module); - } - module = PyImport_ImportModule("backports_abc"); - if (module) { - module = __Pyx_patch_abc_module(module); - Py_XDECREF(module); - } - if (!module) { - PyErr_Clear(); - } - } -#else - if (0) __Pyx_Coroutine_patch_module(NULL, NULL); -#endif - return 0; -} - -/* Generator */ - static PyMethodDef __pyx_Generator_methods[] = { - {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, - (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, - {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, - (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, - {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS, - (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, - {0, 0, 0, 0} -}; -static PyMemberDef __pyx_Generator_memberlist[] = { - {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, - {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, - (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, - {0, 0, 0, 0, 0} -}; -static PyGetSetDef __pyx_Generator_getsets[] = { - {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, - (char*) PyDoc_STR("name of the generator"), 0}, - {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, - (char*) PyDoc_STR("qualified name of the generator"), 0}, - {0, 0, 0, 0, 0} -}; -static PyTypeObject __pyx_GeneratorType_type = { - PyVarObject_HEAD_INIT(0, 0) - "generator", - sizeof(__pyx_CoroutineObject), - 0, - (destructor) __Pyx_Coroutine_dealloc, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, - 0, - (traverseproc) __Pyx_Coroutine_traverse, - 0, - 0, - offsetof(__pyx_CoroutineObject, gi_weakreflist), - 0, - (iternextfunc) __Pyx_Generator_Next, - __pyx_Generator_methods, - __pyx_Generator_memberlist, - __pyx_Generator_getsets, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#else - __Pyx_Coroutine_del, -#endif - 0, -#if PY_VERSION_HEX >= 0x030400a1 - __Pyx_Coroutine_del, -#endif -}; -static int __pyx_Generator_init(void) { - __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; - __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; - __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); - if (unlikely(!__pyx_GeneratorType)) { - return -1; - } - return 0; -} - /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; - int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + 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, 4, - &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, &result, obj); if (unlikely(retcode == -1)) goto __pyx_fail; @@ -40855,17 +42478,17 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; - int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + 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, 2, + PyBUF_RECORDS, 1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, &result, obj); if (unlikely(retcode == -1)) @@ -40878,17 +42501,17 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsdsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; - int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__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, 1, + PyBUF_RECORDS, 6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, &result, obj); if (unlikely(retcode == -1)) @@ -40901,18 +42524,18 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsdsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; - int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__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, 6, - &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, + PyBUF_RECORDS, 5, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack, &result, obj); if (unlikely(retcode == -1)) goto __pyx_fail; @@ -40924,18 +42547,18 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_BufFmt_StackElem stack[1]; - int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + __Pyx_BufFmt_StackElem stack[2]; + 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, 5, - &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded, stack, &result, obj); if (unlikely(retcode == -1)) goto __pyx_fail; @@ -40947,7 +42570,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -40963,7 +42586,7 @@ } /* VoidPtrExport */ - static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { PyObject *d; PyObject *cobj = 0; d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); @@ -40994,7 +42617,7 @@ } /* FunctionExport */ - static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { @@ -41031,7 +42654,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -41049,7 +42672,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -41114,7 +42737,7 @@ #endif /* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction + #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; @@ -41168,7 +42791,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -41193,6 +42816,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -41201,11 +42826,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/geometry/oct_container.pxd yt-3.4.0/yt/geometry/oct_container.pxd --- yt-3.3.3/yt/geometry/oct_container.pxd 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/oct_container.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -22,6 +22,8 @@ from .oct_visitors cimport OctVisitor, Oct, cind from libc.stdlib cimport bsearch, qsort, realloc, malloc, free from libc.math cimport floor +from yt.utilities.lib.allocation_container cimport \ + ObjectPool, AllocationContainer cdef int ORDER_MAX @@ -35,28 +37,31 @@ np.int64_t ipos[3] np.int32_t level -cdef struct OctAllocationContainer -cdef struct OctAllocationContainer: - np.int64_t n - np.int64_t n_assigned - np.int64_t offset - np.int64_t con_id - OctAllocationContainer *next - Oct *my_octs - cdef struct OctList cdef struct OctList: OctList *next Oct *o +# NOTE: This object *has* to be the same size as the AllocationContainer +# object. There's an assert in the __cinit__ function. +cdef struct OctAllocationContainer: + np.uint64_t n + np.uint64_t n_assigned + np.uint64_t offset + np.int64_t con_id # container id + Oct *my_objs + +cdef class OctObjectPool(ObjectPool): + cdef inline OctAllocationContainer *get_cont(self, int i): + return (&self.containers[i]) + cdef OctList *OctList_append(OctList *list, Oct *o) cdef int OctList_count(OctList *list) cdef void OctList_delete(OctList *list) cdef class OctreeContainer: - cdef OctAllocationContainer *cont - cdef OctAllocationContainer **domains + cdef public OctObjectPool domains cdef Oct ****root_mesh cdef int partial_coverage cdef int level_offset @@ -73,7 +78,7 @@ Oct *o, bint periodicity[3]) cdef void oct_bounds(self, Oct *, np.float64_t *, np.float64_t *) # This function must return the offset from global-to-local domains; i.e., - # OctAllocationContainer.offset if such a thing exists. + # AllocationContainer.offset if such a thing exists. cdef np.int64_t get_domain_offset(self, int domain_id) cdef void visit_all_octs(self, selection_routines.SelectorObject selector, diff -Nru yt-3.3.3/yt/geometry/oct_container.pyx yt-3.4.0/yt/geometry/oct_container.pyx --- yt-3.3.3/yt/geometry/oct_container.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/oct_container.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -29,54 +29,16 @@ # NOTE that size_t might not be int void *alloca(int) -cdef OctAllocationContainer *allocate_octs( - int n_octs, OctAllocationContainer *prev): - cdef OctAllocationContainer *n_cont - cdef Oct *oct - cdef int n, i, j, k - n_cont = malloc( - sizeof(OctAllocationContainer)) - if prev == NULL: - n_cont.offset = 0 - else: - n_cont.offset = prev.offset + prev.n - n_cont.my_octs = malloc(sizeof(Oct) * n_octs) - if n_cont.my_octs == NULL: - raise MemoryError - n_cont.n = n_octs - n_cont.n_assigned = 0 - n_cont.con_id = -1 - for n in range(n_octs): - oct = &n_cont.my_octs[n] - oct.file_ind = oct.domain = -1 - oct.domain_ind = n + n_cont.offset - oct.children = NULL - if prev != NULL: - prev.next = n_cont - n_cont.next = NULL - return n_cont - -cdef void free_octs( - OctAllocationContainer *first): - cdef OctAllocationContainer *cur - while first != NULL: - cur = first - for i in range(cur.n): - if cur.my_octs[i].children != NULL: - free(cur.my_octs[i].children) - free(first.my_octs) - first = cur.next - free(cur) - # Here is the strategy for RAMSES containers: # * Read each domain individually, creating *all* octs found in that domain # file, even if they reside on other CPUs. # * Only allocate octs that reside on >= domain # * For all octs, insert into tree, which may require traversing existing # octs -# * Note that this does not allow OctAllocationContainer to exactly be a -# chunk, but it is close. For IO chunking, we can theoretically examine -# those octs that live inside a given allocator. +# * Note that this does not allow one component of an ObjectPool (an +# AllocationContainer) to exactly be a chunk, but it is close. For IO +# chunking, we can theoretically examine those octs that live inside a +# given allocator. cdef class OctreeContainer: @@ -86,13 +48,12 @@ # This will just initialize the root mesh octs self.oref = over_refine self.partial_coverage = partial_coverage - self.cont = NULL cdef int i, j, k, p for i in range(3): self.nn[i] = oct_domain_dimensions[i] self.num_domains = 0 self.level_offset = 0 - self.domains = NULL + self.domains = OctObjectPool() p = 0 self.nocts = 0 # Increment when initialized for i in range(3): @@ -112,16 +73,7 @@ @property def oct_arrays(self): - cdef OctAllocationContainer *cur = self.cont - cdef Oct *this - cdef int i - cdef OctPadded[:] mm - rv = [] - while cur != NULL: - mm = ( cur.my_octs) - rv.append(np.asarray(mm)) - cur = cur.next - return rv + return self.domains.to_arrays() @classmethod def load_octree(cls, header): @@ -148,11 +100,11 @@ for i in range(3): dds[i] = (obj.DRE[i] - obj.DLE[i]) / obj.nn[i] # Pos is the center of the octs - cdef OctAllocationContainer *cur = obj.domains[0] + cdef OctAllocationContainer *cur = obj.domains.get_cont(0) cdef Oct *o - cdef np.int64_t nfinest = 0 + cdef np.uint64_t nfinest = 0 visitor.ref_mask = ref_mask - visitor.octs = cur.my_octs + visitor.octs = cur.my_objs visitor.nocts = &cur.n_assigned visitor.nfinest = &nfinest pos[0] = obj.DLE[0] + dds[0]/2.0 @@ -163,7 +115,7 @@ for k in range(obj.nn[2]): if obj.root_mesh[i][j][k] != NULL: raise RuntimeError - o = &cur.my_octs[cur.n_assigned] + o = &cur.my_objs[cur.n_assigned] o.domain_ind = o.file_ind = 0 o.domain = 1 obj.root_mesh[i][j][k] = o @@ -185,7 +137,6 @@ return obj def __dealloc__(self): - free_octs(self.cont) if self.root_mesh == NULL: return for i in range(self.nn[0]): if self.root_mesh[i] == NULL: continue @@ -196,19 +147,6 @@ free(self.root_mesh[i]) free(self.root_mesh) - def __iter__(self): - #Get the next oct, will traverse domains - #Note that oct containers can be sorted - #so that consecutive octs are on the same domain - cdef OctAllocationContainer *cur = self.cont - cdef Oct *this - cdef int i - while cur != NULL: - for i in range(cur.n_assigned): - this = &cur.my_octs[i] - yield (this.file_ind, this.domain_ind, this.domain) - cur = cur.next - @cython.cdivision(True) cdef void visit_all_octs(self, SelectorObject selector, OctVisitor visitor, int vc = -1): @@ -649,7 +587,7 @@ cdef np.float64_t dds[3] no = pos.shape[0] #number of octs if curdom > self.num_domains: return 0 - cdef OctAllocationContainer *cont = self.domains[curdom - 1] + cdef OctAllocationContainer *cont = self.domains.get_cont(curdom - 1) cdef int initial = cont.n_assigned cdef int in_boundary = 0 # How do we bootstrap ourselves? @@ -692,35 +630,20 @@ def allocate_domains(self, domain_counts): cdef int count, i - cdef OctAllocationContainer *cur = self.cont - assert(cur == NULL) self.num_domains = len(domain_counts) # 1-indexed - self.domains = malloc( - sizeof(OctAllocationContainer *) * len(domain_counts)) for i, count in enumerate(domain_counts): - cur = allocate_octs(count, cur) - if self.cont == NULL: self.cont = cur - self.domains[i] = cur + self.domains.append(count) cdef void append_domain(self, np.int64_t domain_count): self.num_domains += 1 - self.domains = realloc(self.domains, - sizeof(OctAllocationContainer *) * self.num_domains) - if self.domains == NULL: raise RuntimeError - self.domains[self.num_domains - 1] = NULL - cdef OctAllocationContainer *cur = NULL - if self.num_domains > 1: - cur = self.domains[self.num_domains - 2] - cur = allocate_octs(domain_count, cur) - if self.cont == NULL: self.cont = cur - self.domains[self.num_domains - 1] = cur + self.domains.append(domain_count) cdef Oct* next_root(self, int domain_id, int ind[3]): cdef Oct *next = self.root_mesh[ind[0]][ind[1]][ind[2]] if next != NULL: return next - cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) if cont.n_assigned >= cont.n: raise RuntimeError - next = &cont.my_octs[cont.n_assigned] + next = &cont.my_objs[cont.n_assigned] cont.n_assigned += 1 self.root_mesh[ind[0]][ind[1]][ind[2]] = next self.nocts += 1 @@ -737,9 +660,9 @@ for i in range(8): parent.children[i] = NULL if next != NULL: return next - cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) if cont.n_assigned >= cont.n: raise RuntimeError - next = &cont.my_octs[cont.n_assigned] + next = &cont.my_objs[cont.n_assigned] cont.n_assigned += 1 parent.children[cind(ind[0],ind[1],ind[2])] = next self.nocts += 1 @@ -821,7 +744,7 @@ self.visit_all_octs(selector, visitor) assert ((visitor.global_index+1)*visitor.nz == visitor.index) -cdef int root_node_compare(void *a, void *b) nogil: +cdef int root_node_compare(const void *a, const void *b) nogil: cdef OctKey *ao cdef OctKey *bo ao = a @@ -842,6 +765,7 @@ self.oref = over_refine for i in range(3): self.nn[i] = domain_dimensions[i] + self.domains = OctObjectPool() self.num_domains = 0 self.level_offset = 0 self.nocts = 0 # Increment when initialized @@ -931,14 +855,14 @@ cdef Oct *next = NULL self.get_root(ind, &next) if next != NULL: return next - cdef OctAllocationContainer *cont = self.domains[domain_id - 1] + cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1) if cont.n_assigned >= cont.n: print "Too many assigned." return NULL if self.num_root >= self.max_root: print "Too many roots." return NULL - next = &cont.my_octs[cont.n_assigned] + next = &cont.my_objs[cont.n_assigned] cont.n_assigned += 1 cdef np.int64_t key = 0 cdef OctKey *ikey = &self.root_nodes[self.num_root] @@ -963,7 +887,6 @@ # This gets called BEFORE the superclass deallocation. But, both get # called. if self.root_nodes != NULL: free(self.root_nodes) - if self.domains != NULL: free(self.domains) cdef class RAMSESOctreeContainer(SparseOctreeContainer): pass @@ -1049,3 +972,41 @@ next = this.next free(this) this = next + +cdef class OctObjectPool(ObjectPool): + # This is an inherited version of the ObjectPool that provides setup and + # teardown functions for the individually allocated objects. These allow + # us to initialize the Octs to default values, and we can also free any + # allocated memory in them. Implementing _con_to_array also provides the + # opportunity to supply views of the octs in Python code. + def __cinit__(self): + # Base class will ALSO be called + self.itemsize = sizeof(Oct) + assert(sizeof(OctAllocationContainer) == sizeof(AllocationContainer)) + + cdef void setup_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, + np.int64_t con_id): + cdef np.uint64_t i + cdef Oct* octs = obj + for n in range(n): + octs[n].file_ind = octs[n].domain = - 1 + octs[n].domain_ind = n + offset + octs[n].children = NULL + + cdef void teardown_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, + np.int64_t con_id): + cdef np.uint64_t i, j + cdef Oct *my_octs = obj + for i in range(n): + if my_octs[i].children != NULL: + free(my_octs[i].children) + free(obj) + + def _con_to_array(self, int i): + cdef AllocationContainer *obj = &self.containers[i] + if obj.n_assigned == 0: + return None + cdef OctPadded[:] mm = ( + obj.my_objs) + rv = np.asarray(mm) + return rv diff -Nru yt-3.3.3/yt/geometry/oct_visitors.c yt-3.4.0/yt/geometry/oct_visitors.c --- yt-3.3.3/yt/geometry/oct_visitors.c 2016-12-12 01:41:26.000000000 +0000 +++ yt-3.4.0/yt/geometry/oct_visitors.c 2017-08-10 18:20:11.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -11,6 +11,10 @@ ], "libraries": [ "m" + ], + "name": "yt.geometry.oct_visitors", + "sources": [ + "yt/geometry/oct_visitors.pyx" ] }, "module_name": "yt.geometry.oct_visitors" @@ -24,7 +28,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -46,6 +50,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -198,16 +203,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -334,6 +343,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -388,6 +403,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -499,8 +543,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -513,8 +557,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -636,10 +683,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -673,10 +722,11 @@ static const char *__pyx_f[] = { "yt/geometry/oct_visitors.pyx", - "__init__.pxd", - "yt/geometry/selection_routines.pxd", "stringsource", + "yt/geometry/selection_routines.pxd", + "__init__.pxd", "type.pxd", + "yt/utilities/lib/allocation_container.pxd", "yt/geometry/oct_container.pxd", }; /* MemviewSliceStruct.proto */ @@ -992,6 +1042,9 @@ struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject; struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector; +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool; +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool; struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer; @@ -1094,7 +1147,7 @@ __pyx_t_5numpy_float64_t right_edge_x; __pyx_t_5numpy_float64_t right_edge_y; __pyx_t_5numpy_float64_t right_edge_z; - __pyx_t_5numpy_int64_t children_pointers; + __pyx_t_5numpy_int_t children_pointers; __pyx_t_5numpy_int64_t start_index_x; __pyx_t_5numpy_int64_t start_index_y; __pyx_t_5numpy_int64_t start_index_z; @@ -1136,7 +1189,7 @@ struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid; struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells; -/* "selection_routines.pxd":42 +/* "selection_routines.pxd":38 * cdef np.int64_t _hash * * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -1148,7 +1201,7 @@ int visit_covered; }; -/* "selection_routines.pxd":50 +/* "selection_routines.pxd":46 * np.float64_t spos[3], np.float64_t sdds[3], * OctVisitor visitor, int i, int j, int k) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1160,7 +1213,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "selection_routines.pxd":65 +/* "selection_routines.pxd":61 * np.ndarray[np.uint8_t, ndim=3] mask, * int level) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -1171,14 +1224,43 @@ int __pyx_n; __pyx_t_5numpy_uint8_t *cached_mask; }; +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer; +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs; + +/* "yt/utilities/lib/allocation_container.pxd":19 + * from libc.stdlib cimport malloc, free, realloc + * + * cdef struct AllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + void *my_objs; +}; + +/* "yt/utilities/lib/allocation_container.pxd":30 + * cdef np.uint64_t n_con + * cdef AllocationContainer* containers + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except * # <<<<<<<<<<<<<< + * cdef void setup_objs(self, void *obj, np.uint64_t count, + * np.uint64_t offset, np.int64_t con_id) + */ +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs { + int __pyx_n; + __pyx_t_5numpy_int64_t con_id; +}; struct __pyx_t_2yt_8geometry_13oct_container_OctKey; struct __pyx_t_2yt_8geometry_13oct_container_OctInfo; -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_t_2yt_8geometry_13oct_container_OctList; +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs; -/* "yt/geometry/oct_container.pxd":28 +/* "yt/geometry/oct_container.pxd":30 * cdef int ORDER_MAX * * cdef struct OctKey: # <<<<<<<<<<<<<< @@ -1190,7 +1272,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node; }; -/* "yt/geometry/oct_container.pxd":32 +/* "yt/geometry/oct_container.pxd":34 * Oct *node * * cdef struct OctInfo: # <<<<<<<<<<<<<< @@ -1204,25 +1286,9 @@ __pyx_t_5numpy_int32_t level; }; -/* "yt/geometry/oct_container.pxd":38 +/* "yt/geometry/oct_container.pxd":40 * np.int32_t level * - * cdef struct OctAllocationContainer # <<<<<<<<<<<<<< - * cdef struct OctAllocationContainer: - * np.int64_t n - */ -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { - __pyx_t_5numpy_int64_t n; - __pyx_t_5numpy_int64_t n_assigned; - __pyx_t_5numpy_int64_t offset; - __pyx_t_5numpy_int64_t con_id; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *next; - struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_octs; -}; - -/* "yt/geometry/oct_container.pxd":47 - * Oct *my_octs - * * cdef struct OctList # <<<<<<<<<<<<<< * * cdef struct OctList: @@ -1232,7 +1298,22 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "yt/geometry/oct_container.pxd":69 +/* "yt/geometry/oct_container.pxd":48 + * # NOTE: This object *has* to be the same size as the AllocationContainer + * # object. There's an assert in the __cinit__ function. + * cdef struct OctAllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs; +}; + +/* "yt/geometry/oct_container.pxd":74 * cdef public np.int64_t nocts * cdef public int num_domains * cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?, # <<<<<<<<<<<<<< @@ -1245,8 +1326,8 @@ int max_level; }; -/* "yt/geometry/oct_container.pxd":78 - * # OctAllocationContainer.offset if such a thing exists. +/* "yt/geometry/oct_container.pxd":83 + * # AllocationContainer.offset if such a thing exists. * cdef np.int64_t get_domain_offset(self, int domain_id) * cdef void visit_all_octs(self, # <<<<<<<<<<<<<< * selection_routines.SelectorObject selector, @@ -1287,7 +1368,7 @@ __pyx_t_5numpy_int64_t padding; }; -/* "selection_routines.pxd":33 +/* "selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1307,7 +1388,7 @@ }; -/* "selection_routines.pxd":71 +/* "selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1319,7 +1400,7 @@ }; -/* "selection_routines.pxd":74 +/* "selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1333,18 +1414,59 @@ }; -/* "yt/geometry/oct_container.pxd":57 +/* "selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2; +}; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool { + PyObject_HEAD + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab; + __pyx_t_5numpy_uint64_t itemsize; + __pyx_t_5numpy_uint64_t n_con; + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers; +}; + + +/* "yt/geometry/oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; +}; + + +/* "yt/geometry/oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer { PyObject_HEAD struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *cont; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer **domains; + struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh; int partial_coverage; int level_offset; @@ -1358,7 +1480,7 @@ }; -/* "yt/geometry/oct_container.pxd":89 +/* "yt/geometry/oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -1374,7 +1496,7 @@ }; -/* "yt/geometry/oct_container.pxd":97 +/* "yt/geometry/oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -1644,8 +1766,8 @@ struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base; __Pyx_memviewslice ref_mask; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs; - __pyx_t_5numpy_int64_t *nocts; - __pyx_t_5numpy_int64_t *nfinest; + __pyx_t_5numpy_uint64_t *nocts; + __pyx_t_5numpy_uint64_t *nfinest; }; @@ -1727,7 +1849,7 @@ -/* "selection_routines.pxd":33 +/* "selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1750,7 +1872,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; -/* "selection_routines.pxd":71 +/* "selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1764,7 +1886,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; -/* "selection_routines.pxd":74 +/* "selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1778,12 +1900,58 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; -/* "yt/geometry/oct_container.pxd":57 +/* "selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool { + void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args); + void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); + void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + + +/* "yt/geometry/oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ + +struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); +}; +static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool; +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); + + +/* "yt/geometry/oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer { @@ -1800,7 +1968,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer; -/* "yt/geometry/oct_container.pxd":89 +/* "yt/geometry/oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -1816,7 +1984,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer; -/* "yt/geometry/oct_container.pxd":97 +/* "yt/geometry/oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -2278,6 +2446,15 @@ int lineno, const char *filename, int full_traceback, int nogil); +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* GetModuleGlobalName.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + /* BufferFormatCheck.proto */ static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); @@ -2285,7 +2462,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* MemviewSliceInit.proto */ #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d @@ -2320,6 +2497,79 @@ #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, 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 + +/* 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); + +/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* IncludeStringH.proto */ +#include + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* 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 + /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { @@ -2380,22 +2630,6 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #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 - /* None.proto */ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); @@ -2405,8 +2639,19 @@ 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 *); +/* 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( @@ -2422,49 +2667,6 @@ 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); - -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -#if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); -#else -#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) -#endif -#endif - -/* PyCFunctionFastCall.proto */ -#if CYTHON_FAST_PYCCALL -static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); -#else -#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) -#endif - -/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS @@ -2529,23 +2731,28 @@ #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() + /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); -/* 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); - /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -2605,8 +2812,70 @@ static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); /* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int8(npy_int8 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); + +/* 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_nn___pyx_t_5numpy_int64_t(PyObject *); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsdsds_nn___pyx_t_5numpy_int64_t(PyObject *); + +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsds_nn___pyx_t_5numpy_float64_t(PyObject *); + +/* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value); +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_uint8_t(PyObject *); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *); + /* Print.proto */ static int __Pyx_Print(PyObject*, PyObject *, int); #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 @@ -2615,7 +2884,7 @@ #endif /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* RealImag.proto */ #if CYTHON_CCOMPLEX @@ -2716,9 +2985,6 @@ #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 */ @@ -2731,15 +2997,30 @@ /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_int8 __Pyx_PyInt_As_npy_int8(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); @@ -2786,6 +3067,7 @@ static void __pyx_f_2yt_8geometry_12oct_visitors_13CountByDomain_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected); /* proto*/ static void __pyx_f_2yt_8geometry_12oct_visitors_11StoreOctree_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected); /* proto*/ static void __pyx_f_2yt_8geometry_12oct_visitors_10LoadOctree_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected); /* proto*/ +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ @@ -2843,10 +3125,15 @@ static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0; /* Module declarations from 'libc.math' */ +/* Module declarations from 'yt.utilities.lib.allocation_container' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0; + /* Module declarations from 'yt.geometry.oct_container' */ +static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0; @@ -2885,6 +3172,28 @@ static int __pyx_memoryview_thread_locks_used; static PyThread_type_lock __pyx_memoryview_thread_locks[8]; static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int, int, int); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_OctVisitor__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_CopyArrayI64__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_CopyArrayF64__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_CountTotalOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_CountTotalCells__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_MarkOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_MaskOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_IndexOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_ICoordsOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_IResOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_FCoordsOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_FWidthOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_IdentifyOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_AssignDomainInd__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_FillFileIndicesO__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_FillFileIndicesR__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_CountByDomain__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_StoreOctree__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *, PyObject *); /*proto*/ +static int __Pyx_carray_from_py___pyx_t_5numpy_uint8_t(PyObject *, __pyx_t_5numpy_uint8_t *, Py_ssize_t); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t *, Py_ssize_t); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t *, Py_ssize_t); /*proto*/ +static int __Pyx_carray_from_py___pyx_t_5numpy_int64_t(PyObject *, __pyx_t_5numpy_int64_t *, Py_ssize_t); /*proto*/ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ static void *__pyx_align_pointer(void *, size_t); /*proto*/ static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ @@ -2917,6 +3226,10 @@ 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_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; #define __Pyx_MODULE_NAME "yt.geometry.oct_visitors" int __pyx_module_is_main_yt__geometry__oct_visitors = 0; @@ -2924,20 +3237,23 @@ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_ImportError; -static PyObject *__pyx_builtin_MemoryError; +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_TypeError; static PyObject *__pyx_builtin_id; -static PyObject *__pyx_builtin_IndexError; 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_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_file[] = "file"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; @@ -2963,41 +3279,74 @@ static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_octree[] = "octree"; +static const char __pyx_k_pickle[] = "pickle"; +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_UNKNOWN[] = "UNKNOWN"; static const char __pyx_k_fortran[] = "fortran"; static const char __pyx_k_memview[] = "memview"; static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_domain_id[] = "domain_id"; static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_ARRAY_CLUE[] = "ARRAY CLUE: "; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_code_length[] = "code_length"; 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_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_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_convert_to_units[] = "convert_to_units"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; static const char __pyx_k_SOMETHING_IS_AMISS[] = "SOMETHING IS AMISS"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_strided_and_indirect[] = ""; static const char __pyx_k_Oct_visitor_functions[] = "\nOct visitor functions\n\n\n\n\n"; static const char __pyx_k_contiguous_and_direct[] = ""; +static const char __pyx_k_pyx_unpickle_IResOcts[] = "__pyx_unpickle_IResOcts"; +static const char __pyx_k_pyx_unpickle_MarkOcts[] = "__pyx_unpickle_MarkOcts"; +static const char __pyx_k_pyx_unpickle_MaskOcts[] = "__pyx_unpickle_MaskOcts"; static const char __pyx_k_MemoryView_of_r_object[] = ""; +static const char __pyx_k_pyx_unpickle_IndexOcts[] = "__pyx_unpickle_IndexOcts"; static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; static const char __pyx_k_contiguous_and_indirect[] = ""; +static const char __pyx_k_pyx_unpickle_FWidthOcts[] = "__pyx_unpickle_FWidthOcts"; +static const char __pyx_k_pyx_unpickle_OctVisitor[] = "__pyx_unpickle_OctVisitor"; static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static const char __pyx_k_pyx_unpickle_FCoordsOcts[] = "__pyx_unpickle_FCoordsOcts"; +static const char __pyx_k_pyx_unpickle_ICoordsOcts[] = "__pyx_unpickle_ICoordsOcts"; +static const char __pyx_k_pyx_unpickle_StoreOctree[] = "__pyx_unpickle_StoreOctree"; +static const char __pyx_k_yt_geometry_oct_visitors[] = "yt.geometry.oct_visitors"; static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static const char __pyx_k_pyx_unpickle_CopyArrayF64[] = "__pyx_unpickle_CopyArrayF64"; +static const char __pyx_k_pyx_unpickle_CopyArrayI64[] = "__pyx_unpickle_CopyArrayI64"; +static const char __pyx_k_pyx_unpickle_IdentifyOcts[] = "__pyx_unpickle_IdentifyOcts"; +static const char __pyx_k_pyx_unpickle_CountByDomain[] = "__pyx_unpickle_CountByDomain"; 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_pyx_unpickle_CountTotalOcts[] = "__pyx_unpickle_CountTotalOcts"; +static const char __pyx_k_pyx_unpickle_AssignDomainInd[] = "__pyx_unpickle_AssignDomainInd"; +static const char __pyx_k_pyx_unpickle_CountTotalCells[] = "__pyx_unpickle_CountTotalCells"; +static const char __pyx_k_pyx_unpickle_FillFileIndicesO[] = "__pyx_unpickle_FillFileIndicesO"; +static const char __pyx_k_pyx_unpickle_FillFileIndicesR[] = "__pyx_unpickle_FillFileIndicesR"; 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"; @@ -3006,6 +3355,19 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_Incompatible_checksums_s_vs_0x04[] = "Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0x28[] = "Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0x2d[] = "Incompatible checksums (%s vs 0x2db9d3c = (dims, domain, fcoords, global_index, ind, index, last, level, nz, oref, pos))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0x43[] = "Incompatible checksums (%s vs 0x43a044e = (dims, domain, global_index, ind, index, last, level, mask, nz, oref, pos))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0x55[] = "Incompatible checksums (%s vs 0x55bf4cf = (dims, domain, fwidth, global_index, ind, index, last, level, nz, oref, pos))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0x5d[] = "Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0x5e[] = "Incompatible checksums (%s vs 0x5e07de9 = (dims, domain, domain_counts, global_index, ind, index, last, level, nz, oref, pos))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xaf[] = "Incompatible checksums (%s vs 0xafcb867 = (dims, domain, global_index, ind, index, last, level, nz, oref, pos, ref_mask))"; +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_0xbe[] = "Incompatible checksums (%s vs 0xbe9c5c9 = (dims, domain, domain_mask, global_index, ind, index, last, level, nz, oref, pos))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xc7[] = "Incompatible checksums (%s vs 0xc7df155 = (dims, domain, global_index, ind, index, last, level, nz, oct_index, oref, pos))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xf2[] = "Incompatible checksums (%s vs 0xf282e1e = (dims, domain, global_index, ind, index, ires, last, level, nz, oref, pos))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xfc[] = "Incompatible checksums (%s vs 0xfcf26e5 = (dims, domain, global_index, ind, index, last, level, mark, nz, oref, pos))"; 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"; @@ -3013,9 +3375,12 @@ 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_nfinest_self_nocts_self_oct[] = "self.nfinest,self.nocts,self.octs 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_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_Incompatible_checksums_s_vs_0x04_2[] = "Incompatible checksums (%s vs 0x04e90da = (dims, domain, global_index, icoords, ind, index, last, level, nz, oref, pos))"; static PyObject *__pyx_kp_s_ARRAY_CLUE; static PyObject *__pyx_n_s_ASCII; static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; @@ -3026,6 +3391,20 @@ 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_0x04; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x04_2; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x28; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x2d; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x43; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x55; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x5d; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x5e; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xaf; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xbe; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xc7; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xf2; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xfc; 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; @@ -3037,21 +3416,26 @@ static PyObject *__pyx_n_s_NotImplementedError; 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_kp_s_SOMETHING_IS_AMISS; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_UNKNOWN; 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_allocate_buffer; static PyObject *__pyx_n_s_base; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_u_c; static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_code_length; static PyObject *__pyx_kp_s_contiguous_and_direct; static PyObject *__pyx_kp_s_contiguous_and_indirect; static PyObject *__pyx_n_s_convert_to_units; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_domain_id; static PyObject *__pyx_n_s_dtype_is_object; static PyObject *__pyx_n_s_encode; @@ -3076,16 +3460,45 @@ 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_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_octree; static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle_AssignDomainInd; +static PyObject *__pyx_n_s_pyx_unpickle_CopyArrayF64; +static PyObject *__pyx_n_s_pyx_unpickle_CopyArrayI64; +static PyObject *__pyx_n_s_pyx_unpickle_CountByDomain; +static PyObject *__pyx_n_s_pyx_unpickle_CountTotalCells; +static PyObject *__pyx_n_s_pyx_unpickle_CountTotalOcts; +static PyObject *__pyx_n_s_pyx_unpickle_Enum; +static PyObject *__pyx_n_s_pyx_unpickle_FCoordsOcts; +static PyObject *__pyx_n_s_pyx_unpickle_FWidthOcts; +static PyObject *__pyx_n_s_pyx_unpickle_FillFileIndicesO; +static PyObject *__pyx_n_s_pyx_unpickle_FillFileIndicesR; +static PyObject *__pyx_n_s_pyx_unpickle_ICoordsOcts; +static PyObject *__pyx_n_s_pyx_unpickle_IResOcts; +static PyObject *__pyx_n_s_pyx_unpickle_IdentifyOcts; +static PyObject *__pyx_n_s_pyx_unpickle_IndexOcts; +static PyObject *__pyx_n_s_pyx_unpickle_MarkOcts; +static PyObject *__pyx_n_s_pyx_unpickle_MaskOcts; +static PyObject *__pyx_n_s_pyx_unpickle_OctVisitor; +static PyObject *__pyx_n_s_pyx_unpickle_StoreOctree; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_kp_s_self_nfinest_self_nocts_self_oct; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_start; @@ -3094,6 +3507,7 @@ 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_kp_s_unable_to_allocate_array_data; @@ -3101,7 +3515,65 @@ static PyObject *__pyx_n_s_units; 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_yt_geometry_oct_visitors; static int __pyx_pf_2yt_8geometry_12oct_visitors_10OctVisitor___init__(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, int __pyx_v_domain_id); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_10OctVisitor_2__reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_10OctVisitor_4__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12CopyArrayI64___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12CopyArrayI64_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12CopyArrayF64___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12CopyArrayF64_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_14CountTotalOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_14CountTotalOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_15CountTotalCells___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_15CountTotalCells_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8MarkOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8MarkOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8MaskOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8MaskOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_9IndexOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_9IndexOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_11ICoordsOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_11ICoordsOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8IResOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8IResOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_11FCoordsOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_11FCoordsOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_10FWidthOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_10FWidthOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12IdentifyOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12IdentifyOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_15AssignDomainInd___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_15AssignDomainInd_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_16FillFileIndicesO___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_16FillFileIndicesO_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_16FillFileIndicesR___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_16FillFileIndicesR_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_13CountByDomain___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_13CountByDomain_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_11StoreOctree___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_11StoreOctree_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_10LoadOctree___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_10LoadOctree_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors___pyx_unpickle_OctVisitor(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_2yt_8geometry_12oct_visitors_2__pyx_unpickle_CopyArrayI64(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_2yt_8geometry_12oct_visitors_4__pyx_unpickle_CopyArrayF64(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_2yt_8geometry_12oct_visitors_6__pyx_unpickle_CountTotalOcts(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_2yt_8geometry_12oct_visitors_8__pyx_unpickle_CountTotalCells(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_2yt_8geometry_12oct_visitors_10__pyx_unpickle_MarkOcts(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_2yt_8geometry_12oct_visitors_12__pyx_unpickle_MaskOcts(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_2yt_8geometry_12oct_visitors_14__pyx_unpickle_IndexOcts(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_2yt_8geometry_12oct_visitors_16__pyx_unpickle_ICoordsOcts(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_2yt_8geometry_12oct_visitors_18__pyx_unpickle_IResOcts(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_2yt_8geometry_12oct_visitors_20__pyx_unpickle_FCoordsOcts(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_2yt_8geometry_12oct_visitors_22__pyx_unpickle_FWidthOcts(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_2yt_8geometry_12oct_visitors_24__pyx_unpickle_IdentifyOcts(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_2yt_8geometry_12oct_visitors_26__pyx_unpickle_AssignDomainInd(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_2yt_8geometry_12oct_visitors_28__pyx_unpickle_FillFileIndicesO(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_2yt_8geometry_12oct_visitors_30__pyx_unpickle_FillFileIndicesR(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_2yt_8geometry_12oct_visitors_32__pyx_unpickle_CountByDomain(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_2yt_8geometry_12oct_visitors_34__pyx_unpickle_StoreOctree(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 */ @@ -3111,8 +3583,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -3134,8 +3610,13 @@ 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_2yt_8geometry_12oct_visitors_OctVisitor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_CountTotalOcts(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_CountTotalCells(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3161,6 +3642,20 @@ 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_4666766; +static PyObject *__pyx_int_5148890; +static PyObject *__pyx_int_42400366; +static PyObject *__pyx_int_47947068; +static PyObject *__pyx_int_70911054; +static PyObject *__pyx_int_89912527; +static PyObject *__pyx_int_97541528; +static PyObject *__pyx_int_98598377; +static PyObject *__pyx_int_184334439; +static PyObject *__pyx_int_184977713; +static PyObject *__pyx_int_199869897; +static PyObject *__pyx_int_209580373; +static PyObject *__pyx_int_254291486; +static PyObject *__pyx_int_265234149; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; @@ -3171,9 +3666,9 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__20; -static PyObject *__pyx_slice__21; -static PyObject *__pyx_slice__22; +static PyObject *__pyx_slice__26; +static PyObject *__pyx_slice__27; +static PyObject *__pyx_slice__28; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -3184,12 +3679,58 @@ 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__34; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__64; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_codeobj__33; +static PyObject *__pyx_codeobj__35; +static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__43; +static PyObject *__pyx_codeobj__45; +static PyObject *__pyx_codeobj__47; +static PyObject *__pyx_codeobj__49; +static PyObject *__pyx_codeobj__51; +static PyObject *__pyx_codeobj__53; +static PyObject *__pyx_codeobj__55; +static PyObject *__pyx_codeobj__57; +static PyObject *__pyx_codeobj__59; +static PyObject *__pyx_codeobj__61; +static PyObject *__pyx_codeobj__63; +static PyObject *__pyx_codeobj__65; +static PyObject *__pyx_codeobj__67; +static PyObject *__pyx_codeobj__74; /* "yt/geometry/oct_visitors.pyx":27 * @@ -3215,7 +3756,9 @@ 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; } @@ -3224,6 +3767,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_octree)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -3236,6 +3780,7 @@ } 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; @@ -3424,8 +3969,357 @@ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.oct_visitors.OctVisitor.visit", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.oct_visitors.OctVisitor.visit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_3__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_2yt_8geometry_12oct_visitors_10OctVisitor_2__reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_10OctVisitor_2__reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__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; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->global_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_FromCString(__pyx_v_self->ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->last); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->level); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->nz); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->oref); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->pos, 3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(10); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 9, __pyx_t_10); + __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_t_10 = 0; + __pyx_v_state = __pyx_t_11; + __pyx_t_11 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_11 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_v__dict = __pyx_t_11; + __pyx_t_11 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_12 = (__pyx_v__dict != Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v__dict); + __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_10); + __pyx_t_10 = 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.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _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_OctVisitor, (type(self), 0x047358e, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_OctVisitor, (type(self), 0x047358e, None), state + * else: + */ + __pyx_t_13 = (__pyx_v_use_setstate != 0); + if (__pyx_t_13) { + + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_OctVisitor, (type(self), 0x047358e, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_OctVisitor, (type(self), 0x047358e, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_OctVisitor); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_4666766); + __Pyx_GIVEREF(__pyx_int_4666766); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_4666766); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_11, 2, Py_None); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state); + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_OctVisitor, (type(self), 0x047358e, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_OctVisitor, (type(self), 0x047358e, None), state + * else: + * return __pyx_unpickle_OctVisitor, (type(self), 0x047358e, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_OctVisitor__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_OctVisitor); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_4666766); + __Pyx_GIVEREF(__pyx_int_4666766); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_4666766); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_state); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); + __pyx_t_9 = 0; + __pyx_t_11 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + */ + + /* 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_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("yt.geometry.oct_visitors.OctVisitor.__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_OctVisitor, (type(self), 0x047358e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_OctVisitor__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_5__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_2yt_8geometry_12oct_visitors_10OctVisitor_4__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_10OctVisitor_4__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__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_OctVisitor, (type(self), 0x047358e, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_OctVisitor__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_2yt_8geometry_12oct_visitors___pyx_unpickle_OctVisitor__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_OctVisitor, (type(self), 0x047358e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_OctVisitor__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("yt.geometry.oct_visitors.OctVisitor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } /* "yt/geometry/oct_visitors.pyx":49 @@ -3575,49 +4469,414 @@ __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1); - __Pyx_WriteUnraisable("yt.geometry.oct_visitors.CopyArrayI64.visit", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.oct_visitors.CopyArrayI64.visit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/oct_visitors.pyx":64 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # We should always have global_index less than our source. - * # "last" here tells us the dimensionality of the array. +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dest, self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.source) */ -static void __pyx_f_2yt_8geometry_12oct_visitors_12CopyArrayF64_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_12CopyArrayI64_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_12CopyArrayI64_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_RefNannySetupContext("visit", 0); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_12CopyArrayI64___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *)__pyx_v_self)); - /* "yt/geometry/oct_visitors.pyx":67 - * # We should always have global_index less than our source. - * # "last" here tells us the dimensionality of the array. - * if selected == 0: return # <<<<<<<<<<<<<< - * # There are this many records between "octs" - * self.dest[self.index, :] = self.source[ + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12CopyArrayI64___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *__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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + int __pyx_t_15; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dest, self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.source) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_t_1 = ((__pyx_v_selected == 0) != 0); - if (__pyx_t_1) { - goto __pyx_L0; + if (unlikely(!__pyx_v_self->dest.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->dest, 2, (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(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (unlikely(!__pyx_v_self->source.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_12 = __pyx_memoryview_fromslice(__pyx_v_self->source, 6, (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_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyTuple_New(12); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_13, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_13, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_13, 10, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_13, 11, __pyx_t_12); + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_v_state = __pyx_t_13; + __pyx_t_13 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dest, self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.source) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_13 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_v__dict = __pyx_t_13; + __pyx_t_13 = 0; + + /* "(tree fragment)":5 + * state = (self.dest, self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.source) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_14 = (__pyx_v__dict != Py_None); + __pyx_t_15 = (__pyx_t_14 != 0); + if (__pyx_t_15) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v__dict); + __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_12); + __pyx_t_12 = 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.dest, self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.source) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + goto __pyx_L3; } - /* "yt/geometry/oct_visitors.pyx":69 - * if selected == 0: return - * # There are this many records between "octs" - * self.dest[self.index, :] = self.source[ # <<<<<<<<<<<<<< - * self.ind[2], self.ind[1], self.ind[0], - * self.global_index, :] + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_CopyArrayI64, (type(self), 0x5d05d98, None), state */ - __pyx_t_2.data = __pyx_v_self->source.data; - __pyx_t_2.memview = __pyx_v_self->source.memview; - __PYX_INC_MEMVIEW(&__pyx_t_2, 0); - { + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_CopyArrayI64, (type(self), 0x5d05d98, None), state + * else: + */ + __pyx_t_15 = (__pyx_v_use_setstate != 0); + if (__pyx_t_15) { + + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_CopyArrayI64, (type(self), 0x5d05d98, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_CopyArrayI64, (type(self), 0x5d05d98, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_CopyArrayI64); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_97541528); + __Pyx_GIVEREF(__pyx_int_97541528); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_int_97541528); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_13, 2, Py_None); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_state); + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_CopyArrayI64, (type(self), 0x5d05d98, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_CopyArrayI64, (type(self), 0x5d05d98, None), state + * else: + * return __pyx_unpickle_CopyArrayI64, (type(self), 0x5d05d98, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_CopyArrayI64__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_CopyArrayI64); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_97541528); + __Pyx_GIVEREF(__pyx_int_97541528); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_int_97541528); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_state); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13); + __pyx_t_11 = 0; + __pyx_t_13 = 0; + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dest, self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.source) + */ + + /* 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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("yt.geometry.oct_visitors.CopyArrayI64.__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_CopyArrayI64, (type(self), 0x5d05d98, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_CopyArrayI64__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_12CopyArrayI64_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_12CopyArrayI64_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_2yt_8geometry_12oct_visitors_12CopyArrayI64_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12CopyArrayI64_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *__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_CopyArrayI64, (type(self), 0x5d05d98, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_CopyArrayI64__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_2yt_8geometry_12oct_visitors___pyx_unpickle_CopyArrayI64__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_CopyArrayI64, (type(self), 0x5d05d98, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_CopyArrayI64__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("yt.geometry.oct_visitors.CopyArrayI64.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_visitors.pyx":64 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # We should always have global_index less than our source. + * # "last" here tells us the dimensionality of the array. + */ + +static void __pyx_f_2yt_8geometry_12oct_visitors_12CopyArrayF64_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_RefNannySetupContext("visit", 0); + + /* "yt/geometry/oct_visitors.pyx":67 + * # We should always have global_index less than our source. + * # "last" here tells us the dimensionality of the array. + * if selected == 0: return # <<<<<<<<<<<<<< + * # There are this many records between "octs" + * self.dest[self.index, :] = self.source[ + */ + __pyx_t_1 = ((__pyx_v_selected == 0) != 0); + if (__pyx_t_1) { + goto __pyx_L0; + } + + /* "yt/geometry/oct_visitors.pyx":69 + * if selected == 0: return + * # There are this many records between "octs" + * self.dest[self.index, :] = self.source[ # <<<<<<<<<<<<<< + * self.ind[2], self.ind[1], self.ind[0], + * self.global_index, :] + */ + __pyx_t_2.data = __pyx_v_self->source.data; + __pyx_t_2.memview = __pyx_v_self->source.memview; + __PYX_INC_MEMVIEW(&__pyx_t_2, 0); + { Py_ssize_t __pyx_tmp_idx = (__pyx_v_self->__pyx_base.ind[2]); Py_ssize_t __pyx_tmp_shape = __pyx_v_self->source.shape[0]; Py_ssize_t __pyx_tmp_stride = __pyx_v_self->source.strides[0]; @@ -3723,889 +4982,1658 @@ __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1); - __Pyx_WriteUnraisable("yt.geometry.oct_visitors.CopyArrayF64.visit", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.oct_visitors.CopyArrayF64.visit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/oct_visitors.pyx":80 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # Count even if not selected. - * # Number of *octs* visited. +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dest, self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.source) */ -static void __pyx_f_2yt_8geometry_12oct_visitors_14CountTotalOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_12CopyArrayF64_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_12CopyArrayF64_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __pyx_t_5numpy_int64_t __pyx_t_2; - __Pyx_RefNannySetupContext("visit", 0); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_12CopyArrayF64___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *)__pyx_v_self)); - /* "yt/geometry/oct_visitors.pyx":83 - * # Count even if not selected. - * # Number of *octs* visited. - * if self.last != o.domain_ind: # <<<<<<<<<<<<<< - * self.index += 1 - * self.last = o.domain_ind - */ - __pyx_t_1 = ((__pyx_v_self->__pyx_base.last != __pyx_v_o->domain_ind) != 0); - if (__pyx_t_1) { + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/geometry/oct_visitors.pyx":84 - * # Number of *octs* visited. - * if self.last != o.domain_ind: - * self.index += 1 # <<<<<<<<<<<<<< - * self.last = o.domain_ind - * +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12CopyArrayF64___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *__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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + int __pyx_t_15; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dest, self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.source) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + if (unlikely(!__pyx_v_self->dest.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->dest, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (unlikely(!__pyx_v_self->source.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_12 = __pyx_memoryview_fromslice(__pyx_v_self->source, 5, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyTuple_New(12); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_13, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_13, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_13, 10, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_13, 11, __pyx_t_12); + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_v_state = __pyx_t_13; + __pyx_t_13 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dest, self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.source) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_13 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_v__dict = __pyx_t_13; + __pyx_t_13 = 0; + + /* "(tree fragment)":5 + * state = (self.dest, self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.source) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_14 = (__pyx_v__dict != Py_None); + __pyx_t_15 = (__pyx_t_14 != 0); + if (__pyx_t_15) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v__dict); + __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_12); + __pyx_t_12 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; - /* "yt/geometry/oct_visitors.pyx":85 - * if self.last != o.domain_ind: - * self.index += 1 - * self.last = o.domain_ind # <<<<<<<<<<<<<< - * - * # This counts the number of selected cells. + /* "(tree fragment)":5 + * state = (self.dest, self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.source) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - __pyx_t_2 = __pyx_v_o->domain_ind; - __pyx_v_self->__pyx_base.last = __pyx_t_2; + goto __pyx_L3; + } - /* "yt/geometry/oct_visitors.pyx":83 - * # Count even if not selected. - * # Number of *octs* visited. - * if self.last != o.domain_ind: # <<<<<<<<<<<<<< - * self.index += 1 - * self.last = o.domain_ind + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_CopyArrayF64, (type(self), 0x5d05d98, None), state */ + /*else*/ { + __pyx_v_use_setstate = 0; } + __pyx_L3:; - /* "yt/geometry/oct_visitors.pyx":80 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # Count even if not selected. - * # Number of *octs* visited. + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_CopyArrayF64, (type(self), 0x5d05d98, None), state + * else: */ + __pyx_t_15 = (__pyx_v_use_setstate != 0); + if (__pyx_t_15) { - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_CopyArrayF64, (type(self), 0x5d05d98, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_CopyArrayF64, (type(self), 0x5d05d98, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_CopyArrayF64); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_97541528); + __Pyx_GIVEREF(__pyx_int_97541528); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_int_97541528); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_13, 2, Py_None); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_state); + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; -/* "yt/geometry/oct_visitors.pyx":91 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # Number of *cells* visited and selected. - * self.index += selected + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_CopyArrayF64, (type(self), 0x5d05d98, None), state + * else: */ + } -static void __pyx_f_2yt_8geometry_12oct_visitors_15CountTotalCells_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("visit", 0); + /* "(tree fragment)":13 + * return __pyx_unpickle_CopyArrayF64, (type(self), 0x5d05d98, None), state + * else: + * return __pyx_unpickle_CopyArrayF64, (type(self), 0x5d05d98, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_CopyArrayF64__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_CopyArrayF64); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_97541528); + __Pyx_GIVEREF(__pyx_int_97541528); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_int_97541528); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_state); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13); + __pyx_t_11 = 0; + __pyx_t_13 = 0; + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + } - /* "yt/geometry/oct_visitors.pyx":93 - * cdef void visit(self, Oct* o, np.uint8_t selected): - * # Number of *cells* visited and selected. - * self.index += selected # <<<<<<<<<<<<<< - * - * # Every time a cell is visited, mark it. This will be for all visited octs. - */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + __pyx_v_selected); - - /* "yt/geometry/oct_visitors.pyx":91 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # Number of *cells* visited and selected. - * self.index += selected + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dest, self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.source) */ /* 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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("yt.geometry.oct_visitors.CopyArrayF64.__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; } -/* "yt/geometry/oct_visitors.pyx":99 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # We mark them even if they are not selected - * if self.last != o.domain_ind: +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_CopyArrayF64, (type(self), 0x5d05d98, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_CopyArrayF64__set_state(self, __pyx_state) */ -static void __pyx_f_2yt_8geometry_12oct_visitors_8MarkOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_12CopyArrayF64_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_12CopyArrayF64_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __pyx_t_5numpy_int64_t __pyx_t_2; - __pyx_t_5numpy_uint64_t __pyx_t_3; - size_t __pyx_t_4; - size_t __pyx_t_5; - size_t __pyx_t_6; - __Pyx_RefNannySetupContext("visit", 0); - - /* "yt/geometry/oct_visitors.pyx":101 - * cdef void visit(self, Oct* o, np.uint8_t selected): - * # We mark them even if they are not selected - * if self.last != o.domain_ind: # <<<<<<<<<<<<<< - * self.last = o.domain_ind - * self.index += 1 - */ - __pyx_t_1 = ((__pyx_v_self->__pyx_base.last != __pyx_v_o->domain_ind) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/oct_visitors.pyx":102 - * # We mark them even if they are not selected - * if self.last != o.domain_ind: - * self.last = o.domain_ind # <<<<<<<<<<<<<< - * self.index += 1 - * self.mark[self.index, self.ind[2], self.ind[1], self.ind[0]] = 1 - */ - __pyx_t_2 = __pyx_v_o->domain_ind; - __pyx_v_self->__pyx_base.last = __pyx_t_2; - - /* "yt/geometry/oct_visitors.pyx":103 - * if self.last != o.domain_ind: - * self.last = o.domain_ind - * self.index += 1 # <<<<<<<<<<<<<< - * self.mark[self.index, self.ind[2], self.ind[1], self.ind[0]] = 1 - * - */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); - - /* "yt/geometry/oct_visitors.pyx":101 - * cdef void visit(self, Oct* o, np.uint8_t selected): - * # We mark them even if they are not selected - * if self.last != o.domain_ind: # <<<<<<<<<<<<<< - * self.last = o.domain_ind - * self.index += 1 - */ - } - - /* "yt/geometry/oct_visitors.pyx":104 - * self.last = o.domain_ind - * self.index += 1 - * self.mark[self.index, self.ind[2], self.ind[1], self.ind[0]] = 1 # <<<<<<<<<<<<<< - * - * # Mask all the selected cells. - */ - __pyx_t_3 = __pyx_v_self->__pyx_base.index; - __pyx_t_4 = (__pyx_v_self->__pyx_base.ind[2]); - __pyx_t_5 = (__pyx_v_self->__pyx_base.ind[1]); - __pyx_t_6 = (__pyx_v_self->__pyx_base.ind[0]); - *((__pyx_t_5numpy_uint8_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->mark.data + __pyx_t_3 * __pyx_v_self->mark.strides[0]) ) + __pyx_t_4 * __pyx_v_self->mark.strides[1]) ) + __pyx_t_5 * __pyx_v_self->mark.strides[2]) ) + __pyx_t_6 * __pyx_v_self->mark.strides[3]) )) = 1; - - /* "yt/geometry/oct_visitors.pyx":99 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # We mark them even if they are not selected - * if self.last != o.domain_ind: - */ + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_12CopyArrayF64_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/oct_visitors.pyx":110 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * if selected == 0: return - * self.mask[self.global_index, self.ind[2], self.ind[1], self.ind[0]] = 1 - */ - -static void __pyx_f_2yt_8geometry_12oct_visitors_8MaskOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12CopyArrayF64_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __pyx_t_5numpy_int64_t __pyx_t_2; - size_t __pyx_t_3; - size_t __pyx_t_4; - size_t __pyx_t_5; - __Pyx_RefNannySetupContext("visit", 0); - - /* "yt/geometry/oct_visitors.pyx":111 - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): - * if selected == 0: return # <<<<<<<<<<<<<< - * self.mask[self.global_index, self.ind[2], self.ind[1], self.ind[0]] = 1 - * - */ - __pyx_t_1 = ((__pyx_v_selected == 0) != 0); - if (__pyx_t_1) { - goto __pyx_L0; - } + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "yt/geometry/oct_visitors.pyx":112 - * cdef void visit(self, Oct* o, np.uint8_t selected): - * if selected == 0: return - * self.mask[self.global_index, self.ind[2], self.ind[1], self.ind[0]] = 1 # <<<<<<<<<<<<<< - * - * # Compute a mapping from domain_ind to flattened index. + /* "(tree fragment)":15 + * return __pyx_unpickle_CopyArrayF64, (type(self), 0x5d05d98, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_CopyArrayF64__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_t_2 = __pyx_v_self->__pyx_base.global_index; - __pyx_t_3 = (__pyx_v_self->__pyx_base.ind[2]); - __pyx_t_4 = (__pyx_v_self->__pyx_base.ind[1]); - __pyx_t_5 = (__pyx_v_self->__pyx_base.ind[0]); - if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_v_self->mask.shape[0]; - *((__pyx_t_5numpy_uint8_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->mask.data + __pyx_t_2 * __pyx_v_self->mask.strides[0]) ) + __pyx_t_3 * __pyx_v_self->mask.strides[1]) ) + __pyx_t_4 * __pyx_v_self->mask.strides[2]) ) + __pyx_t_5 * __pyx_v_self->mask.strides[3]) )) = 1; + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_CopyArrayF64__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; - /* "yt/geometry/oct_visitors.pyx":110 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * if selected == 0: return - * self.mask[self.global_index, self.ind[2], self.ind[1], self.ind[0]] = 1 + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_CopyArrayF64, (type(self), 0x5d05d98, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_CopyArrayF64__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("yt.geometry.oct_visitors.CopyArrayF64.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/oct_visitors.pyx":118 +/* "yt/geometry/oct_visitors.pyx":80 * @cython.boundscheck(False) * @cython.initializedcheck(False) * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # Note that we provide an index even if the cell is not selected. - * if self.last != o.domain_ind: + * # Count even if not selected. + * # Number of *octs* visited. */ -static void __pyx_f_2yt_8geometry_12oct_visitors_9IndexOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected) { +static void __pyx_f_2yt_8geometry_12oct_visitors_14CountTotalOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected) { __Pyx_RefNannyDeclarations int __pyx_t_1; __pyx_t_5numpy_int64_t __pyx_t_2; - __pyx_t_5numpy_uint64_t __pyx_t_3; __Pyx_RefNannySetupContext("visit", 0); - /* "yt/geometry/oct_visitors.pyx":120 - * cdef void visit(self, Oct* o, np.uint8_t selected): - * # Note that we provide an index even if the cell is not selected. + /* "yt/geometry/oct_visitors.pyx":83 + * # Count even if not selected. + * # Number of *octs* visited. * if self.last != o.domain_ind: # <<<<<<<<<<<<<< + * self.index += 1 * self.last = o.domain_ind - * self.oct_index[o.domain_ind] = self.index */ __pyx_t_1 = ((__pyx_v_self->__pyx_base.last != __pyx_v_o->domain_ind) != 0); if (__pyx_t_1) { - /* "yt/geometry/oct_visitors.pyx":121 - * # Note that we provide an index even if the cell is not selected. + /* "yt/geometry/oct_visitors.pyx":84 + * # Number of *octs* visited. * if self.last != o.domain_ind: - * self.last = o.domain_ind # <<<<<<<<<<<<<< - * self.oct_index[o.domain_ind] = self.index - * self.index += 1 + * self.index += 1 # <<<<<<<<<<<<<< + * self.last = o.domain_ind + * */ - __pyx_t_2 = __pyx_v_o->domain_ind; - __pyx_v_self->__pyx_base.last = __pyx_t_2; + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); - /* "yt/geometry/oct_visitors.pyx":122 + /* "yt/geometry/oct_visitors.pyx":85 * if self.last != o.domain_ind: - * self.last = o.domain_ind - * self.oct_index[o.domain_ind] = self.index # <<<<<<<<<<<<<< * self.index += 1 + * self.last = o.domain_ind # <<<<<<<<<<<<<< * + * # This counts the number of selected cells. */ - __pyx_t_3 = __pyx_v_self->__pyx_base.index; __pyx_t_2 = __pyx_v_o->domain_ind; - if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_v_self->oct_index.shape[0]; - *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_self->oct_index.data + __pyx_t_2 * __pyx_v_self->oct_index.strides[0]) )) = __pyx_t_3; - - /* "yt/geometry/oct_visitors.pyx":123 - * self.last = o.domain_ind - * self.oct_index[o.domain_ind] = self.index - * self.index += 1 # <<<<<<<<<<<<<< - * - * # Integer coordinates - */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + __pyx_v_self->__pyx_base.last = __pyx_t_2; - /* "yt/geometry/oct_visitors.pyx":120 - * cdef void visit(self, Oct* o, np.uint8_t selected): - * # Note that we provide an index even if the cell is not selected. + /* "yt/geometry/oct_visitors.pyx":83 + * # Count even if not selected. + * # Number of *octs* visited. * if self.last != o.domain_ind: # <<<<<<<<<<<<<< + * self.index += 1 * self.last = o.domain_ind - * self.oct_index[o.domain_ind] = self.index */ } - /* "yt/geometry/oct_visitors.pyx":118 + /* "yt/geometry/oct_visitors.pyx":80 * @cython.boundscheck(False) * @cython.initializedcheck(False) * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # Note that we provide an index even if the cell is not selected. - * if self.last != o.domain_ind: + * # Count even if not selected. + * # Number of *octs* visited. */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/oct_visitors.pyx":129 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * if selected == 0: return - * cdef int i +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ -static void __pyx_f_2yt_8geometry_12oct_visitors_11ICoordsOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { - int __pyx_v_i; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_14CountTotalOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_14CountTotalOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __pyx_t_5numpy_uint64_t __pyx_t_3; - Py_ssize_t __pyx_t_4; - __Pyx_RefNannySetupContext("visit", 0); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_14CountTotalOcts___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *)__pyx_v_self)); - /* "yt/geometry/oct_visitors.pyx":130 - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): - * if selected == 0: return # <<<<<<<<<<<<<< - * cdef int i - * for i in range(3): - */ - __pyx_t_1 = ((__pyx_v_selected == 0) != 0); - if (__pyx_t_1) { - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/geometry/oct_visitors.pyx":132 - * if selected == 0: return - * cdef int i - * for i in range(3): # <<<<<<<<<<<<<< - * self.icoords[self.index,i] = (self.pos[i] << self.oref) + self.ind[i] - * self.index += 1 - */ - for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_14CountTotalOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *__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; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(10); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 9, __pyx_t_10); + __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_t_10 = 0; + __pyx_v_state = __pyx_t_11; + __pyx_t_11 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_11 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_v__dict = __pyx_t_11; + __pyx_t_11 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_12 = (__pyx_v__dict != Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v__dict); + __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_10); + __pyx_t_10 = 0; - /* "yt/geometry/oct_visitors.pyx":133 - * cdef int i - * for i in range(3): - * self.icoords[self.index,i] = (self.pos[i] << self.oref) + self.ind[i] # <<<<<<<<<<<<<< - * self.index += 1 - * + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False */ - __pyx_t_3 = __pyx_v_self->__pyx_base.index; - __pyx_t_4 = __pyx_v_i; - if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_self->icoords.shape[1]; - *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->icoords.data + __pyx_t_3 * __pyx_v_self->icoords.strides[0]) ) + __pyx_t_4 * __pyx_v_self->icoords.strides[1]) )) = (((__pyx_v_self->__pyx_base.pos[__pyx_v_i]) << __pyx_v_self->__pyx_base.oref) + (__pyx_v_self->__pyx_base.ind[__pyx_v_i])); + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + goto __pyx_L3; } - /* "yt/geometry/oct_visitors.pyx":134 - * for i in range(3): - * self.icoords[self.index,i] = (self.pos[i] << self.oref) + self.ind[i] - * self.index += 1 # <<<<<<<<<<<<<< - * - * # Level + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_CountTotalOcts, (type(self), 0x047358e, None), state */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; - /* "yt/geometry/oct_visitors.pyx":129 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * if selected == 0: return - * cdef int i + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_CountTotalOcts, (type(self), 0x047358e, None), state + * else: + */ + __pyx_t_13 = (__pyx_v_use_setstate != 0); + if (__pyx_t_13) { + + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_CountTotalOcts, (type(self), 0x047358e, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_CountTotalOcts, (type(self), 0x047358e, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_CountTotalOcts); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_4666766); + __Pyx_GIVEREF(__pyx_int_4666766); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_4666766); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_11, 2, Py_None); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state); + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_CountTotalOcts, (type(self), 0x047358e, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_CountTotalOcts, (type(self), 0x047358e, None), state + * else: + * return __pyx_unpickle_CountTotalOcts, (type(self), 0x047358e, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_CountTotalOcts__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_CountTotalOcts); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_4666766); + __Pyx_GIVEREF(__pyx_int_4666766); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_4666766); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_state); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); + __pyx_t_9 = 0; + __pyx_t_11 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ /* 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_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("yt.geometry.oct_visitors.CountTotalOcts.__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; } -/* "yt/geometry/oct_visitors.pyx":140 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * if selected == 0: return - * self.ires[self.index] = self.level +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_CountTotalOcts, (type(self), 0x047358e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_CountTotalOcts__set_state(self, __pyx_state) */ -static void __pyx_f_2yt_8geometry_12oct_visitors_8IResOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_14CountTotalOcts_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_14CountTotalOcts_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __pyx_t_5numpy_int8_t __pyx_t_2; - __pyx_t_5numpy_uint64_t __pyx_t_3; - __Pyx_RefNannySetupContext("visit", 0); + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_14CountTotalOcts_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "yt/geometry/oct_visitors.pyx":141 - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): - * if selected == 0: return # <<<<<<<<<<<<<< - * self.ires[self.index] = self.level - * self.index += 1 - */ - __pyx_t_1 = ((__pyx_v_selected == 0) != 0); - if (__pyx_t_1) { - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/geometry/oct_visitors.pyx":142 - * cdef void visit(self, Oct* o, np.uint8_t selected): - * if selected == 0: return - * self.ires[self.index] = self.level # <<<<<<<<<<<<<< - * self.index += 1 - * - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.level; - __pyx_t_3 = __pyx_v_self->__pyx_base.index; - *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_self->ires.data + __pyx_t_3 * __pyx_v_self->ires.strides[0]) )) = __pyx_t_2; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_14CountTotalOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "yt/geometry/oct_visitors.pyx":143 - * if selected == 0: return - * self.ires[self.index] = self.level - * self.index += 1 # <<<<<<<<<<<<<< - * - * # Floating point coordinates + /* "(tree fragment)":15 + * return __pyx_unpickle_CountTotalOcts, (type(self), 0x047358e, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_CountTotalOcts__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_CountTotalOcts__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; - /* "yt/geometry/oct_visitors.pyx":140 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * if selected == 0: return - * self.ires[self.index] = self.level + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_CountTotalOcts, (type(self), 0x047358e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_CountTotalOcts__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("yt.geometry.oct_visitors.CountTotalOcts.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/oct_visitors.pyx":150 +/* "yt/geometry/oct_visitors.pyx":91 * @cython.boundscheck(False) * @cython.initializedcheck(False) * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # Note that this does not actually give the correct floating point - * # coordinates. It gives them in some unit system where the domain is 1.0 + * # Number of *cells* visited and selected. + * self.index += selected */ -static void __pyx_f_2yt_8geometry_12oct_visitors_11FCoordsOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { - int __pyx_v_i; - __pyx_t_5numpy_float64_t __pyx_v_c; - __pyx_t_5numpy_float64_t __pyx_v_dx; +static void __pyx_f_2yt_8geometry_12oct_visitors_15CountTotalCells_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __pyx_t_5numpy_uint64_t __pyx_t_3; - Py_ssize_t __pyx_t_4; __Pyx_RefNannySetupContext("visit", 0); - /* "yt/geometry/oct_visitors.pyx":154 - * # coordinates. It gives them in some unit system where the domain is 1.0 - * # in all directions, and assumes that they will be scaled later. - * if selected == 0: return # <<<<<<<<<<<<<< - * cdef int i - * cdef np.float64_t c, dx + /* "yt/geometry/oct_visitors.pyx":93 + * cdef void visit(self, Oct* o, np.uint8_t selected): + * # Number of *cells* visited and selected. + * self.index += selected # <<<<<<<<<<<<<< + * + * # Every time a cell is visited, mark it. This will be for all visited octs. */ - __pyx_t_1 = ((__pyx_v_selected == 0) != 0); - if (__pyx_t_1) { - goto __pyx_L0; - } + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + __pyx_v_selected); - /* "yt/geometry/oct_visitors.pyx":157 - * cdef int i - * cdef np.float64_t c, dx - * dx = 1.0 / ((1 << self.oref) << self.level) # <<<<<<<<<<<<<< - * for i in range(3): - * c = ((self.pos[i] << self.oref ) + self.ind[i]) + /* "yt/geometry/oct_visitors.pyx":91 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # Number of *cells* visited and selected. + * self.index += selected */ - __pyx_v_dx = (1.0 / ((1 << __pyx_v_self->__pyx_base.oref) << __pyx_v_self->__pyx_base.level)); - /* "yt/geometry/oct_visitors.pyx":158 - * cdef np.float64_t c, dx - * dx = 1.0 / ((1 << self.oref) << self.level) - * for i in range(3): # <<<<<<<<<<<<<< - * c = ((self.pos[i] << self.oref ) + self.ind[i]) - * self.fcoords[self.index,i] = (c + 0.5) * dx - */ - for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "yt/geometry/oct_visitors.pyx":159 - * dx = 1.0 / ((1 << self.oref) << self.level) - * for i in range(3): - * c = ((self.pos[i] << self.oref ) + self.ind[i]) # <<<<<<<<<<<<<< - * self.fcoords[self.index,i] = (c + 0.5) * dx - * self.index += 1 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ - __pyx_v_c = ((__pyx_t_5numpy_float64_t)(((__pyx_v_self->__pyx_base.pos[__pyx_v_i]) << __pyx_v_self->__pyx_base.oref) + (__pyx_v_self->__pyx_base.ind[__pyx_v_i]))); - /* "yt/geometry/oct_visitors.pyx":160 - * for i in range(3): - * c = ((self.pos[i] << self.oref ) + self.ind[i]) - * self.fcoords[self.index,i] = (c + 0.5) * dx # <<<<<<<<<<<<<< - * self.index += 1 - * - */ - __pyx_t_3 = __pyx_v_self->__pyx_base.index; - __pyx_t_4 = __pyx_v_i; - if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_self->fcoords.shape[1]; - *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->fcoords.data + __pyx_t_3 * __pyx_v_self->fcoords.strides[0]) ) + __pyx_t_4 * __pyx_v_self->fcoords.strides[1]) )) = ((__pyx_v_c + 0.5) * __pyx_v_dx); - } - - /* "yt/geometry/oct_visitors.pyx":161 - * c = ((self.pos[i] << self.oref ) + self.ind[i]) - * self.fcoords[self.index,i] = (c + 0.5) * dx - * self.index += 1 # <<<<<<<<<<<<<< - * - * # Floating point widths; domain modifications are done later. - */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); - - /* "yt/geometry/oct_visitors.pyx":150 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # Note that this does not actually give the correct floating point - * # coordinates. It gives them in some unit system where the domain is 1.0 - */ +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_15CountTotalCells_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_15CountTotalCells_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_2yt_8geometry_12oct_visitors_15CountTotalCells___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *)__pyx_v_self)); /* function exit code */ - __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/oct_visitors.pyx":168 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # Note that this does not actually give the correct floating point - * # coordinates. It gives them in some unit system where the domain is 1.0 +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_15CountTotalCells___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *__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; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(10); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 9, __pyx_t_10); + __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_t_10 = 0; + __pyx_v_state = __pyx_t_11; + __pyx_t_11 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_11 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_v__dict = __pyx_t_11; + __pyx_t_11 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_12 = (__pyx_v__dict != Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v__dict); + __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_10); + __pyx_t_10 = 0; -static void __pyx_f_2yt_8geometry_12oct_visitors_10FWidthOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { - int __pyx_v_i; - __pyx_t_5numpy_float64_t __pyx_v_dx; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __pyx_t_5numpy_uint64_t __pyx_t_3; - Py_ssize_t __pyx_t_4; - __Pyx_RefNannySetupContext("visit", 0); + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; - /* "yt/geometry/oct_visitors.pyx":172 - * # coordinates. It gives them in some unit system where the domain is 1.0 - * # in all directions, and assumes that they will be scaled later. - * if selected == 0: return # <<<<<<<<<<<<<< - * cdef int i - * cdef np.float64_t dx + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - __pyx_t_1 = ((__pyx_v_selected == 0) != 0); - if (__pyx_t_1) { - goto __pyx_L0; + goto __pyx_L3; } - /* "yt/geometry/oct_visitors.pyx":175 - * cdef int i - * cdef np.float64_t dx - * dx = 1.0 / ((1 << self.oref) << self.level) # <<<<<<<<<<<<<< - * for i in range(3): - * self.fwidth[self.index,i] = dx + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_CountTotalCells, (type(self), 0x047358e, None), state */ - __pyx_v_dx = (1.0 / ((1 << __pyx_v_self->__pyx_base.oref) << __pyx_v_self->__pyx_base.level)); + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; - /* "yt/geometry/oct_visitors.pyx":176 - * cdef np.float64_t dx - * dx = 1.0 / ((1 << self.oref) << self.level) - * for i in range(3): # <<<<<<<<<<<<<< - * self.fwidth[self.index,i] = dx - * self.index += 1 + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_CountTotalCells, (type(self), 0x047358e, None), state + * else: */ - for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + __pyx_t_13 = (__pyx_v_use_setstate != 0); + if (__pyx_t_13) { - /* "yt/geometry/oct_visitors.pyx":177 - * dx = 1.0 / ((1 << self.oref) << self.level) - * for i in range(3): - * self.fwidth[self.index,i] = dx # <<<<<<<<<<<<<< - * self.index += 1 - * + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_CountTotalCells, (type(self), 0x047358e, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_CountTotalCells, (type(self), 0x047358e, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_CountTotalCells); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_4666766); + __Pyx_GIVEREF(__pyx_int_4666766); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_4666766); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_11, 2, Py_None); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state); + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_CountTotalCells, (type(self), 0x047358e, None), state + * else: */ - __pyx_t_3 = __pyx_v_self->__pyx_base.index; - __pyx_t_4 = __pyx_v_i; - if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_self->fwidth.shape[1]; - *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->fwidth.data + __pyx_t_3 * __pyx_v_self->fwidth.strides[0]) ) + __pyx_t_4 * __pyx_v_self->fwidth.strides[1]) )) = __pyx_v_dx; } - /* "yt/geometry/oct_visitors.pyx":178 - * for i in range(3): - * self.fwidth[self.index,i] = dx - * self.index += 1 # <<<<<<<<<<<<<< - * - * # Mark which domains are touched by a selector. + /* "(tree fragment)":13 + * return __pyx_unpickle_CountTotalCells, (type(self), 0x047358e, None), state + * else: + * return __pyx_unpickle_CountTotalCells, (type(self), 0x047358e, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_CountTotalCells__set_state(self, __pyx_state) */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_CountTotalCells); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_4666766); + __Pyx_GIVEREF(__pyx_int_4666766); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_4666766); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_state); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); + __pyx_t_9 = 0; + __pyx_t_11 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + } - /* "yt/geometry/oct_visitors.pyx":168 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # Note that this does not actually give the correct floating point - * # coordinates. It gives them in some unit system where the domain is 1.0 + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ /* 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_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("yt.geometry.oct_visitors.CountTotalCells.__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; } -/* "yt/geometry/oct_visitors.pyx":184 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # We assume that our domain has *already* been selected by, which means - * # we'll get all cells within the domain for a by-domain selector and all +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_CountTotalCells, (type(self), 0x047358e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_CountTotalCells__set_state(self, __pyx_state) */ -static void __pyx_f_2yt_8geometry_12oct_visitors_12IdentifyOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_15CountTotalCells_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_15CountTotalCells_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __pyx_t_5numpy_int64_t __pyx_t_2; - __Pyx_RefNannySetupContext("visit", 0); + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_15CountTotalCells_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "yt/geometry/oct_visitors.pyx":188 - * # we'll get all cells within the domain for a by-domain selector and all - * # cells within the domain *and* selector for the selector itself. - * if selected == 0: return # <<<<<<<<<<<<<< - * self.domain_mask[o.domain - 1] = 1 - * - */ - __pyx_t_1 = ((__pyx_v_selected == 0) != 0); - if (__pyx_t_1) { - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/geometry/oct_visitors.pyx":189 - * # cells within the domain *and* selector for the selector itself. - * if selected == 0: return - * self.domain_mask[o.domain - 1] = 1 # <<<<<<<<<<<<<< - * - * # Assign domain indices to octs +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_15CountTotalCells_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *__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_CountTotalCells, (type(self), 0x047358e, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_CountTotalCells__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_t_2 = (__pyx_v_o->domain - 1); - if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_v_self->domain_mask.shape[0]; - *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->domain_mask.data + __pyx_t_2 * __pyx_v_self->domain_mask.strides[0]) )) = 1; + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_CountTotalCells__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; - /* "yt/geometry/oct_visitors.pyx":184 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # We assume that our domain has *already* been selected by, which means - * # we'll get all cells within the domain for a by-domain selector and all + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_CountTotalCells, (type(self), 0x047358e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_CountTotalCells__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("yt.geometry.oct_visitors.CountTotalCells.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/oct_visitors.pyx":195 +/* "yt/geometry/oct_visitors.pyx":99 * @cython.boundscheck(False) * @cython.initializedcheck(False) * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * o.domain_ind = self.global_index - * self.index += 1 + * # We mark them even if they are not selected + * if self.last != o.domain_ind: */ -static void __pyx_f_2yt_8geometry_12oct_visitors_15AssignDomainInd_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected) { +static void __pyx_f_2yt_8geometry_12oct_visitors_8MarkOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected) { __Pyx_RefNannyDeclarations - __pyx_t_5numpy_int64_t __pyx_t_1; + int __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + __pyx_t_5numpy_uint64_t __pyx_t_3; + size_t __pyx_t_4; + size_t __pyx_t_5; + size_t __pyx_t_6; __Pyx_RefNannySetupContext("visit", 0); - /* "yt/geometry/oct_visitors.pyx":196 - * @cython.initializedcheck(False) + /* "yt/geometry/oct_visitors.pyx":101 * cdef void visit(self, Oct* o, np.uint8_t selected): - * o.domain_ind = self.global_index # <<<<<<<<<<<<<< - * self.index += 1 - * + * # We mark them even if they are not selected + * if self.last != o.domain_ind: # <<<<<<<<<<<<<< + * self.last = o.domain_ind + * self.index += 1 */ - __pyx_t_1 = __pyx_v_self->__pyx_base.global_index; - __pyx_v_o->domain_ind = __pyx_t_1; + __pyx_t_1 = ((__pyx_v_self->__pyx_base.last != __pyx_v_o->domain_ind) != 0); + if (__pyx_t_1) { - /* "yt/geometry/oct_visitors.pyx":197 + /* "yt/geometry/oct_visitors.pyx":102 + * # We mark them even if they are not selected + * if self.last != o.domain_ind: + * self.last = o.domain_ind # <<<<<<<<<<<<<< + * self.index += 1 + * self.mark[self.index, self.ind[2], self.ind[1], self.ind[0]] = 1 + */ + __pyx_t_2 = __pyx_v_o->domain_ind; + __pyx_v_self->__pyx_base.last = __pyx_t_2; + + /* "yt/geometry/oct_visitors.pyx":103 + * if self.last != o.domain_ind: + * self.last = o.domain_ind + * self.index += 1 # <<<<<<<<<<<<<< + * self.mark[self.index, self.ind[2], self.ind[1], self.ind[0]] = 1 + * + */ + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + + /* "yt/geometry/oct_visitors.pyx":101 * cdef void visit(self, Oct* o, np.uint8_t selected): - * o.domain_ind = self.global_index - * self.index += 1 # <<<<<<<<<<<<<< + * # We mark them even if they are not selected + * if self.last != o.domain_ind: # <<<<<<<<<<<<<< + * self.last = o.domain_ind + * self.index += 1 + */ + } + + /* "yt/geometry/oct_visitors.pyx":104 + * self.last = o.domain_ind + * self.index += 1 + * self.mark[self.index, self.ind[2], self.ind[1], self.ind[0]] = 1 # <<<<<<<<<<<<<< * - * # From the file, fill in C order + * # Mask all the selected cells. */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + __pyx_t_3 = __pyx_v_self->__pyx_base.index; + __pyx_t_4 = (__pyx_v_self->__pyx_base.ind[2]); + __pyx_t_5 = (__pyx_v_self->__pyx_base.ind[1]); + __pyx_t_6 = (__pyx_v_self->__pyx_base.ind[0]); + *((__pyx_t_5numpy_uint8_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->mark.data + __pyx_t_3 * __pyx_v_self->mark.strides[0]) ) + __pyx_t_4 * __pyx_v_self->mark.strides[1]) ) + __pyx_t_5 * __pyx_v_self->mark.strides[2]) ) + __pyx_t_6 * __pyx_v_self->mark.strides[3]) )) = 1; - /* "yt/geometry/oct_visitors.pyx":195 + /* "yt/geometry/oct_visitors.pyx":99 * @cython.boundscheck(False) * @cython.initializedcheck(False) * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * o.domain_ind = self.global_index - * self.index += 1 + * # We mark them even if they are not selected + * if self.last != o.domain_ind: */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/oct_visitors.pyx":203 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # We fill these arrays, then inside the level filler we use these as - * # indices as we fill a second array from the self. +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.mark, self.nz, self.oref, self.pos) */ -static void __pyx_f_2yt_8geometry_12oct_visitors_16FillFileIndicesO_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_8MarkOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_8MarkOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __pyx_t_5numpy_int8_t __pyx_t_2; - __pyx_t_5numpy_uint64_t __pyx_t_3; - __pyx_t_5numpy_int64_t __pyx_t_4; - __pyx_t_5numpy_uint64_t __pyx_t_5; - __pyx_t_5numpy_uint64_t __pyx_t_6; - __Pyx_RefNannySetupContext("visit", 0); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_8MarkOcts___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *)__pyx_v_self)); - /* "yt/geometry/oct_visitors.pyx":206 - * # We fill these arrays, then inside the level filler we use these as - * # indices as we fill a second array from the self. - * if selected == 0: return # <<<<<<<<<<<<<< - * self.levels[self.index] = self.level - * self.file_inds[self.index] = o.file_ind + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8MarkOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *__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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.mark, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_t_1 = ((__pyx_v_selected == 0) != 0); - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(!__pyx_v_self->mark.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_self->mark, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_t_11); + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_v_state = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.mark, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_12 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_v__dict = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.mark, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_13 = (__pyx_v__dict != Py_None); + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v__dict); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_11); + __pyx_t_11 = 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.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.mark, self.nz, self.oref, self.pos) + * _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_MarkOcts, (type(self), 0xfcf26e5, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_MarkOcts, (type(self), 0xfcf26e5, None), state + * else: + */ + __pyx_t_14 = (__pyx_v_use_setstate != 0); + if (__pyx_t_14) { + + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_MarkOcts, (type(self), 0xfcf26e5, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_MarkOcts, (type(self), 0xfcf26e5, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_MarkOcts); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_265234149); + __Pyx_GIVEREF(__pyx_int_265234149); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_265234149); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 2, Py_None); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_MarkOcts, (type(self), 0xfcf26e5, None), state + * else: + */ } - /* "yt/geometry/oct_visitors.pyx":207 - * # indices as we fill a second array from the self. - * if selected == 0: return - * self.levels[self.index] = self.level # <<<<<<<<<<<<<< - * self.file_inds[self.index] = o.file_ind - * self.cell_inds[self.index] = self.oind() + /* "(tree fragment)":13 + * return __pyx_unpickle_MarkOcts, (type(self), 0xfcf26e5, None), state + * else: + * return __pyx_unpickle_MarkOcts, (type(self), 0xfcf26e5, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_MarkOcts__set_state(self, __pyx_state) */ - __pyx_t_2 = __pyx_v_self->__pyx_base.level; - __pyx_t_3 = __pyx_v_self->__pyx_base.index; - *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->levels.data + __pyx_t_3 * __pyx_v_self->levels.strides[0]) )) = __pyx_t_2; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_MarkOcts); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_265234149); + __Pyx_GIVEREF(__pyx_int_265234149); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_265234149); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); + __pyx_t_10 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + } - /* "yt/geometry/oct_visitors.pyx":208 - * if selected == 0: return - * self.levels[self.index] = self.level - * self.file_inds[self.index] = o.file_ind # <<<<<<<<<<<<<< - * self.cell_inds[self.index] = self.oind() - * self.index +=1 + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.mark, self.nz, self.oref, self.pos) */ - __pyx_t_4 = __pyx_v_o->file_ind; - __pyx_t_5 = __pyx_v_self->__pyx_base.index; - *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_self->file_inds.data + __pyx_t_5 * __pyx_v_self->file_inds.strides[0]) )) = __pyx_t_4; - /* "yt/geometry/oct_visitors.pyx":209 - * self.levels[self.index] = self.level - * self.file_inds[self.index] = o.file_ind - * self.cell_inds[self.index] = self.oind() # <<<<<<<<<<<<<< - * self.index +=1 - * + /* 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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("yt.geometry.oct_visitors.MarkOcts.__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_MarkOcts, (type(self), 0xfcf26e5, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_MarkOcts__set_state(self, __pyx_state) */ - __pyx_t_6 = __pyx_v_self->__pyx_base.index; - *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->cell_inds.data + __pyx_t_6 * __pyx_v_self->cell_inds.strides[0]) )) = __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_self)); - /* "yt/geometry/oct_visitors.pyx":210 - * self.file_inds[self.index] = o.file_ind - * self.cell_inds[self.index] = self.oind() - * self.index +=1 # <<<<<<<<<<<<<< - * - * # From the file, fill in F order +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_8MarkOcts_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_8MarkOcts_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_2yt_8geometry_12oct_visitors_8MarkOcts_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8MarkOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *__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_MarkOcts, (type(self), 0xfcf26e5, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_MarkOcts__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_MarkOcts__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; - /* "yt/geometry/oct_visitors.pyx":203 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # We fill these arrays, then inside the level filler we use these as - * # indices as we fill a second array from the self. + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_MarkOcts, (type(self), 0xfcf26e5, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_MarkOcts__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("yt.geometry.oct_visitors.MarkOcts.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/oct_visitors.pyx":216 +/* "yt/geometry/oct_visitors.pyx":110 * @cython.boundscheck(False) * @cython.initializedcheck(False) * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # We fill these arrays, then inside the level filler we use these as - * # indices as we fill a second array from the self. + * if selected == 0: return + * self.mask[self.global_index, self.ind[2], self.ind[1], self.ind[0]] = 1 */ -static void __pyx_f_2yt_8geometry_12oct_visitors_16FillFileIndicesR_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { +static void __pyx_f_2yt_8geometry_12oct_visitors_8MaskOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { __Pyx_RefNannyDeclarations int __pyx_t_1; - __pyx_t_5numpy_int8_t __pyx_t_2; - __pyx_t_5numpy_uint64_t __pyx_t_3; - __pyx_t_5numpy_int64_t __pyx_t_4; - __pyx_t_5numpy_uint64_t __pyx_t_5; - __pyx_t_5numpy_uint64_t __pyx_t_6; + __pyx_t_5numpy_int64_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + size_t __pyx_t_5; __Pyx_RefNannySetupContext("visit", 0); - /* "yt/geometry/oct_visitors.pyx":219 - * # We fill these arrays, then inside the level filler we use these as - * # indices as we fill a second array from the self. + /* "yt/geometry/oct_visitors.pyx":111 + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): * if selected == 0: return # <<<<<<<<<<<<<< - * self.levels[self.index] = self.level - * self.file_inds[self.index] = o.file_ind - */ + * self.mask[self.global_index, self.ind[2], self.ind[1], self.ind[0]] = 1 + * + */ __pyx_t_1 = ((__pyx_v_selected == 0) != 0); if (__pyx_t_1) { goto __pyx_L0; } - /* "yt/geometry/oct_visitors.pyx":220 - * # indices as we fill a second array from the self. - * if selected == 0: return - * self.levels[self.index] = self.level # <<<<<<<<<<<<<< - * self.file_inds[self.index] = o.file_ind - * self.cell_inds[self.index] = self.rind() - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.level; - __pyx_t_3 = __pyx_v_self->__pyx_base.index; - *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->levels.data + __pyx_t_3 * __pyx_v_self->levels.strides[0]) )) = __pyx_t_2; - - /* "yt/geometry/oct_visitors.pyx":221 + /* "yt/geometry/oct_visitors.pyx":112 + * cdef void visit(self, Oct* o, np.uint8_t selected): * if selected == 0: return - * self.levels[self.index] = self.level - * self.file_inds[self.index] = o.file_ind # <<<<<<<<<<<<<< - * self.cell_inds[self.index] = self.rind() - * self.index +=1 - */ - __pyx_t_4 = __pyx_v_o->file_ind; - __pyx_t_5 = __pyx_v_self->__pyx_base.index; - *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_self->file_inds.data + __pyx_t_5 * __pyx_v_self->file_inds.strides[0]) )) = __pyx_t_4; - - /* "yt/geometry/oct_visitors.pyx":222 - * self.levels[self.index] = self.level - * self.file_inds[self.index] = o.file_ind - * self.cell_inds[self.index] = self.rind() # <<<<<<<<<<<<<< - * self.index +=1 - * - */ - __pyx_t_6 = __pyx_v_self->__pyx_base.index; - *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->cell_inds.data + __pyx_t_6 * __pyx_v_self->cell_inds.strides[0]) )) = __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_self)); - - /* "yt/geometry/oct_visitors.pyx":223 - * self.file_inds[self.index] = o.file_ind - * self.cell_inds[self.index] = self.rind() - * self.index +=1 # <<<<<<<<<<<<<< + * self.mask[self.global_index, self.ind[2], self.ind[1], self.ind[0]] = 1 # <<<<<<<<<<<<<< * - * # Count octs by domain + * # Compute a mapping from domain_ind to flattened index. */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + __pyx_t_2 = __pyx_v_self->__pyx_base.global_index; + __pyx_t_3 = (__pyx_v_self->__pyx_base.ind[2]); + __pyx_t_4 = (__pyx_v_self->__pyx_base.ind[1]); + __pyx_t_5 = (__pyx_v_self->__pyx_base.ind[0]); + if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_v_self->mask.shape[0]; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->mask.data + __pyx_t_2 * __pyx_v_self->mask.strides[0]) ) + __pyx_t_3 * __pyx_v_self->mask.strides[1]) ) + __pyx_t_4 * __pyx_v_self->mask.strides[2]) ) + __pyx_t_5 * __pyx_v_self->mask.strides[3]) )) = 1; - /* "yt/geometry/oct_visitors.pyx":216 + /* "yt/geometry/oct_visitors.pyx":110 * @cython.boundscheck(False) * @cython.initializedcheck(False) * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * # We fill these arrays, then inside the level filler we use these as - * # indices as we fill a second array from the self. + * if selected == 0: return + * self.mask[self.global_index, self.ind[2], self.ind[1], self.ind[0]] = 1 */ /* function exit code */ @@ -4613,5532 +6641,9252 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/oct_visitors.pyx":229 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * if selected == 0: return - * # NOTE: We do this for every *cell*. +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.mask, self.nz, self.oref, self.pos) */ -static void __pyx_f_2yt_8geometry_12oct_visitors_13CountByDomain_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_8MaskOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_8MaskOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __pyx_t_5numpy_int64_t __pyx_t_2; - __Pyx_RefNannySetupContext("visit", 0); - - /* "yt/geometry/oct_visitors.pyx":230 - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): - * if selected == 0: return # <<<<<<<<<<<<<< - * # NOTE: We do this for every *cell*. - * self.domain_counts[o.domain - 1] += 1 - */ - __pyx_t_1 = ((__pyx_v_selected == 0) != 0); - if (__pyx_t_1) { - goto __pyx_L0; - } - - /* "yt/geometry/oct_visitors.pyx":232 - * if selected == 0: return - * # NOTE: We do this for every *cell*. - * self.domain_counts[o.domain - 1] += 1 # <<<<<<<<<<<<<< - * - * # Store the refinement mapping of the octree to be loaded later - */ - __pyx_t_2 = (__pyx_v_o->domain - 1); - if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_v_self->domain_counts.shape[0]; - *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_self->domain_counts.data + __pyx_t_2 * __pyx_v_self->domain_counts.strides[0]) )) += 1; - - /* "yt/geometry/oct_visitors.pyx":229 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * if selected == 0: return - * # NOTE: We do this for every *cell*. - */ + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_8MaskOcts___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *)__pyx_v_self)); /* function exit code */ - __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/oct_visitors.pyx":238 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * cdef np.uint8_t res, ii - * ii = cind(self.ind[0], self.ind[1], self.ind[2]) - */ - -static void __pyx_f_2yt_8geometry_12oct_visitors_11StoreOctree_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected) { - __pyx_t_5numpy_uint8_t __pyx_v_res; - CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_ii; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8MaskOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_v_self) { + int __pyx_v_use_setstate; + PyObject *__pyx_v_state = NULL; + PyObject *__pyx_v__dict = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __pyx_t_5numpy_uint64_t __pyx_t_2; - __Pyx_RefNannySetupContext("visit", 0); - - /* "yt/geometry/oct_visitors.pyx":240 - * cdef void visit(self, Oct* o, np.uint8_t selected): - * cdef np.uint8_t res, ii - * ii = cind(self.ind[0], self.ind[1], self.ind[2]) # <<<<<<<<<<<<<< - * if o.children == NULL: - * # Not refined. + 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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.mask, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_v_ii = __pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_self->__pyx_base.ind[0]), (__pyx_v_self->__pyx_base.ind[1]), (__pyx_v_self->__pyx_base.ind[2])); - - /* "yt/geometry/oct_visitors.pyx":241 - * cdef np.uint8_t res, ii - * ii = cind(self.ind[0], self.ind[1], self.ind[2]) - * if o.children == NULL: # <<<<<<<<<<<<<< - * # Not refined. - * res = 0 + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(!__pyx_v_self->mask.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_self->mask, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_t_11); + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_v_state = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.mask, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_12 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_v__dict = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.mask, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_13 = (__pyx_v__dict != Py_None); + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ - __pyx_t_1 = ((__pyx_v_o->children == NULL) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/oct_visitors.pyx":243 - * if o.children == NULL: - * # Not refined. - * res = 0 # <<<<<<<<<<<<<< - * else: - * res = 1 + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v__dict); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_11); + __pyx_t_11 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False */ - __pyx_v_res = 0; + __pyx_v_use_setstate = 1; - /* "yt/geometry/oct_visitors.pyx":241 - * cdef np.uint8_t res, ii - * ii = cind(self.ind[0], self.ind[1], self.ind[2]) - * if o.children == NULL: # <<<<<<<<<<<<<< - * # Not refined. - * res = 0 + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.mask, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ goto __pyx_L3; } - /* "yt/geometry/oct_visitors.pyx":245 - * res = 0 - * else: - * res = 1 # <<<<<<<<<<<<<< - * self.ref_mask[self.index] = res - * self.index += 1 + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_MaskOcts, (type(self), 0x43a044e, None), state */ /*else*/ { - __pyx_v_res = 1; + __pyx_v_use_setstate = 0; } __pyx_L3:; - /* "yt/geometry/oct_visitors.pyx":246 - * else: - * res = 1 - * self.ref_mask[self.index] = res # <<<<<<<<<<<<<< - * self.index += 1 - * + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_MaskOcts, (type(self), 0x43a044e, None), state + * else: */ - __pyx_t_2 = __pyx_v_self->__pyx_base.index; - *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->ref_mask.data + __pyx_t_2 * __pyx_v_self->ref_mask.strides[0]) )) = __pyx_v_res; + __pyx_t_14 = (__pyx_v_use_setstate != 0); + if (__pyx_t_14) { - /* "yt/geometry/oct_visitors.pyx":247 - * res = 1 - * self.ref_mask[self.index] = res - * self.index += 1 # <<<<<<<<<<<<<< - * - * # Go from a refinement mapping to a new octree + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_MaskOcts, (type(self), 0x43a044e, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_MaskOcts, (type(self), 0x43a044e, state) */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_MaskOcts); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_70911054); + __Pyx_GIVEREF(__pyx_int_70911054); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_70911054); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 2, Py_None); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; - /* "yt/geometry/oct_visitors.pyx":238 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * cdef np.uint8_t res, ii - * ii = cind(self.ind[0], self.ind[1], self.ind[2]) + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_MaskOcts, (type(self), 0x43a044e, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_MaskOcts, (type(self), 0x43a044e, None), state + * else: + * return __pyx_unpickle_MaskOcts, (type(self), 0x43a044e, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_MaskOcts__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_MaskOcts); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_70911054); + __Pyx_GIVEREF(__pyx_int_70911054); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_70911054); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); + __pyx_t_10 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.mask, self.nz, self.oref, self.pos) */ /* 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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("yt.geometry.oct_visitors.MaskOcts.__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; } -/* "yt/geometry/oct_visitors.pyx":253 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * cdef int i, ii - * ii = cind(self.ind[0], self.ind[1], self.ind[2]) +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_MaskOcts, (type(self), 0x43a044e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_MaskOcts__set_state(self, __pyx_state) */ -static void __pyx_f_2yt_8geometry_12oct_visitors_10LoadOctree_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected) { - int __pyx_v_i; - int __pyx_v_ii; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_8MaskOcts_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_8MaskOcts_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __pyx_t_5numpy_uint64_t __pyx_t_1; - int __pyx_t_2; - long __pyx_t_3; - __pyx_t_5numpy_uint64_t __pyx_t_4; - __pyx_t_5numpy_uint64_t __pyx_t_5; - int __pyx_t_6; - __pyx_t_5numpy_uint64_t __pyx_t_7; - __pyx_t_5numpy_uint64_t __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; - __Pyx_RefNannySetupContext("visit", 0); + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_8MaskOcts_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "yt/geometry/oct_visitors.pyx":255 - * cdef void visit(self, Oct* o, np.uint8_t selected): - * cdef int i, ii - * ii = cind(self.ind[0], self.ind[1], self.ind[2]) # <<<<<<<<<<<<<< - * if self.ref_mask[self.index] == 0: - * # We only want to do this once. Otherwise we end up with way too many - */ - __pyx_v_ii = __pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_self->__pyx_base.ind[0]), (__pyx_v_self->__pyx_base.ind[1]), (__pyx_v_self->__pyx_base.ind[2])); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/geometry/oct_visitors.pyx":256 - * cdef int i, ii - * ii = cind(self.ind[0], self.ind[1], self.ind[2]) - * if self.ref_mask[self.index] == 0: # <<<<<<<<<<<<<< - * # We only want to do this once. Otherwise we end up with way too many - * # nfinest for our tastes. - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.index; - __pyx_t_2 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->ref_mask.data + __pyx_t_1 * __pyx_v_self->ref_mask.strides[0]) ))) == 0) != 0); - if (__pyx_t_2) { +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8MaskOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "yt/geometry/oct_visitors.pyx":259 - * # We only want to do this once. Otherwise we end up with way too many - * # nfinest for our tastes. - * if o.file_ind == -1: # <<<<<<<<<<<<<< - * o.children = NULL - * o.file_ind = self.nfinest[0] + /* "(tree fragment)":15 + * return __pyx_unpickle_MaskOcts, (type(self), 0x43a044e, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_MaskOcts__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_t_2 = ((__pyx_v_o->file_ind == -1LL) != 0); - if (__pyx_t_2) { + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_MaskOcts__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; - /* "yt/geometry/oct_visitors.pyx":260 - * # nfinest for our tastes. - * if o.file_ind == -1: - * o.children = NULL # <<<<<<<<<<<<<< - * o.file_ind = self.nfinest[0] - * o.domain = 1 + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_MaskOcts, (type(self), 0x43a044e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_MaskOcts__set_state(self, __pyx_state) */ - __pyx_v_o->children = NULL; - /* "yt/geometry/oct_visitors.pyx":261 - * if o.file_ind == -1: - * o.children = NULL - * o.file_ind = self.nfinest[0] # <<<<<<<<<<<<<< - * o.domain = 1 - * self.nfinest[0] += 1 - */ - __pyx_v_o->file_ind = (__pyx_v_self->nfinest[0]); + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_visitors.MaskOcts.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/geometry/oct_visitors.pyx":262 - * o.children = NULL - * o.file_ind = self.nfinest[0] - * o.domain = 1 # <<<<<<<<<<<<<< - * self.nfinest[0] += 1 - * elif self.ref_mask[self.index] > 0: +/* "yt/geometry/oct_visitors.pyx":118 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # Note that we provide an index even if the cell is not selected. + * if self.last != o.domain_ind: */ - __pyx_v_o->domain = 1; - /* "yt/geometry/oct_visitors.pyx":263 - * o.file_ind = self.nfinest[0] - * o.domain = 1 - * self.nfinest[0] += 1 # <<<<<<<<<<<<<< - * elif self.ref_mask[self.index] > 0: - * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: - */ - __pyx_t_3 = 0; - (__pyx_v_self->nfinest[__pyx_t_3]) = ((__pyx_v_self->nfinest[__pyx_t_3]) + 1); +static void __pyx_f_2yt_8geometry_12oct_visitors_9IndexOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + __pyx_t_5numpy_uint64_t __pyx_t_3; + __Pyx_RefNannySetupContext("visit", 0); - /* "yt/geometry/oct_visitors.pyx":259 - * # We only want to do this once. Otherwise we end up with way too many - * # nfinest for our tastes. - * if o.file_ind == -1: # <<<<<<<<<<<<<< - * o.children = NULL - * o.file_ind = self.nfinest[0] + /* "yt/geometry/oct_visitors.pyx":120 + * cdef void visit(self, Oct* o, np.uint8_t selected): + * # Note that we provide an index even if the cell is not selected. + * if self.last != o.domain_ind: # <<<<<<<<<<<<<< + * self.last = o.domain_ind + * self.oct_index[o.domain_ind] = self.index */ - } + __pyx_t_1 = ((__pyx_v_self->__pyx_base.last != __pyx_v_o->domain_ind) != 0); + if (__pyx_t_1) { - /* "yt/geometry/oct_visitors.pyx":256 - * cdef int i, ii - * ii = cind(self.ind[0], self.ind[1], self.ind[2]) - * if self.ref_mask[self.index] == 0: # <<<<<<<<<<<<<< - * # We only want to do this once. Otherwise we end up with way too many - * # nfinest for our tastes. + /* "yt/geometry/oct_visitors.pyx":121 + * # Note that we provide an index even if the cell is not selected. + * if self.last != o.domain_ind: + * self.last = o.domain_ind # <<<<<<<<<<<<<< + * self.oct_index[o.domain_ind] = self.index + * self.index += 1 */ - goto __pyx_L3; - } + __pyx_t_2 = __pyx_v_o->domain_ind; + __pyx_v_self->__pyx_base.last = __pyx_t_2; - /* "yt/geometry/oct_visitors.pyx":264 - * o.domain = 1 - * self.nfinest[0] += 1 - * elif self.ref_mask[self.index] > 0: # <<<<<<<<<<<<<< - * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: - * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" + /* "yt/geometry/oct_visitors.pyx":122 + * if self.last != o.domain_ind: + * self.last = o.domain_ind + * self.oct_index[o.domain_ind] = self.index # <<<<<<<<<<<<<< + * self.index += 1 + * */ - __pyx_t_4 = __pyx_v_self->__pyx_base.index; - __pyx_t_2 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->ref_mask.data + __pyx_t_4 * __pyx_v_self->ref_mask.strides[0]) ))) > 0) != 0); - if (__pyx_t_2) { + __pyx_t_3 = __pyx_v_self->__pyx_base.index; + __pyx_t_2 = __pyx_v_o->domain_ind; + if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_v_self->oct_index.shape[0]; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_self->oct_index.data + __pyx_t_2 * __pyx_v_self->oct_index.strides[0]) )) = __pyx_t_3; - /* "yt/geometry/oct_visitors.pyx":265 - * self.nfinest[0] += 1 - * elif self.ref_mask[self.index] > 0: - * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: # <<<<<<<<<<<<<< - * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" - * raise RuntimeError + /* "yt/geometry/oct_visitors.pyx":123 + * self.last = o.domain_ind + * self.oct_index[o.domain_ind] = self.index + * self.index += 1 # <<<<<<<<<<<<<< + * + * # Integer coordinates */ - __pyx_t_5 = __pyx_v_self->__pyx_base.index; - __pyx_t_6 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->ref_mask.data + __pyx_t_5 * __pyx_v_self->ref_mask.strides[0]) ))) != 1) != 0); - if (__pyx_t_6) { - } else { - __pyx_t_2 = __pyx_t_6; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_7 = __pyx_v_self->__pyx_base.index; - __pyx_t_6 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->ref_mask.data + __pyx_t_7 * __pyx_v_self->ref_mask.strides[0]) ))) != 8) != 0); - __pyx_t_2 = __pyx_t_6; - __pyx_L6_bool_binop_done:; - if (__pyx_t_2) { + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); - /* "yt/geometry/oct_visitors.pyx":266 - * elif self.ref_mask[self.index] > 0: - * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: - * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" # <<<<<<<<<<<<<< - * raise RuntimeError - * if o.children == NULL: + /* "yt/geometry/oct_visitors.pyx":120 + * cdef void visit(self, Oct* o, np.uint8_t selected): + * # Note that we provide an index even if the cell is not selected. + * if self.last != o.domain_ind: # <<<<<<<<<<<<<< + * self.last = o.domain_ind + * self.oct_index[o.domain_ind] = self.index */ - __pyx_t_8 = __pyx_v_self->__pyx_base.index; - __pyx_t_9 = __Pyx_PyInt_From_npy_uint8((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->ref_mask.data + __pyx_t_8 * __pyx_v_self->ref_mask.strides[0]) )))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_kp_s_ARRAY_CLUE); - __Pyx_GIVEREF(__pyx_kp_s_ARRAY_CLUE); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_s_ARRAY_CLUE); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); - __Pyx_INCREF(__pyx_n_s_UNKNOWN); - __Pyx_GIVEREF(__pyx_n_s_UNKNOWN); - PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_n_s_UNKNOWN); - __pyx_t_9 = 0; - if (__Pyx_Print(0, __pyx_t_10, 1) < 0) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } - /* "yt/geometry/oct_visitors.pyx":267 - * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: - * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" - * raise RuntimeError # <<<<<<<<<<<<<< - * if o.children == NULL: - * o.children = malloc(sizeof(Oct *) * 8) + /* "yt/geometry/oct_visitors.pyx":118 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # Note that we provide an index even if the cell is not selected. + * if self.last != o.domain_ind: */ - __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 267, __pyx_L1_error) - /* "yt/geometry/oct_visitors.pyx":265 - * self.nfinest[0] += 1 - * elif self.ref_mask[self.index] > 0: - * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: # <<<<<<<<<<<<<< - * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" - * raise RuntimeError - */ - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "yt/geometry/oct_visitors.pyx":268 - * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" - * raise RuntimeError - * if o.children == NULL: # <<<<<<<<<<<<<< - * o.children = malloc(sizeof(Oct *) * 8) - * for i in range(8): +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oct_index, self.oref, self.pos) */ - __pyx_t_2 = ((__pyx_v_o->children == NULL) != 0); - if (__pyx_t_2) { - /* "yt/geometry/oct_visitors.pyx":269 - * raise RuntimeError - * if o.children == NULL: - * o.children = malloc(sizeof(Oct *) * 8) # <<<<<<<<<<<<<< - * for i in range(8): - * o.children[i] = NULL - */ - __pyx_v_o->children = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **)malloc(((sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)) * 8))); +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_9IndexOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_9IndexOcts_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_2yt_8geometry_12oct_visitors_9IndexOcts___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *)__pyx_v_self)); - /* "yt/geometry/oct_visitors.pyx":270 - * if o.children == NULL: - * o.children = malloc(sizeof(Oct *) * 8) - * for i in range(8): # <<<<<<<<<<<<<< - * o.children[i] = NULL - * for i in range(8): - */ - for (__pyx_t_11 = 0; __pyx_t_11 < 8; __pyx_t_11+=1) { - __pyx_v_i = __pyx_t_11; - - /* "yt/geometry/oct_visitors.pyx":271 - * o.children = malloc(sizeof(Oct *) * 8) - * for i in range(8): - * o.children[i] = NULL # <<<<<<<<<<<<<< - * for i in range(8): - * o.children[ii + i] = &self.octs[self.nocts[0]] - */ - (__pyx_v_o->children[__pyx_v_i]) = NULL; - } - - /* "yt/geometry/oct_visitors.pyx":268 - * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" - * raise RuntimeError - * if o.children == NULL: # <<<<<<<<<<<<<< - * o.children = malloc(sizeof(Oct *) * 8) - * for i in range(8): - */ - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/geometry/oct_visitors.pyx":272 - * for i in range(8): - * o.children[i] = NULL - * for i in range(8): # <<<<<<<<<<<<<< - * o.children[ii + i] = &self.octs[self.nocts[0]] - * o.children[ii + i].domain_ind = self.nocts[0] +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_9IndexOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *__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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oct_index, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - for (__pyx_t_11 = 0; __pyx_t_11 < 8; __pyx_t_11+=1) { - __pyx_v_i = __pyx_t_11; - - /* "yt/geometry/oct_visitors.pyx":273 - * o.children[i] = NULL - * for i in range(8): - * o.children[ii + i] = &self.octs[self.nocts[0]] # <<<<<<<<<<<<<< - * o.children[ii + i].domain_ind = self.nocts[0] - * o.children[ii + i].file_ind = -1 + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(!__pyx_v_self->oct_index.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_self->oct_index, 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(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_t_11); + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_v_state = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oct_index, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_12 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_v__dict = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oct_index, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_13 = (__pyx_v__dict != Py_None); + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ - (__pyx_v_o->children[(__pyx_v_ii + __pyx_v_i)]) = (&(__pyx_v_self->octs[(__pyx_v_self->nocts[0])])); - - /* "yt/geometry/oct_visitors.pyx":274 - * for i in range(8): - * o.children[ii + i] = &self.octs[self.nocts[0]] - * o.children[ii + i].domain_ind = self.nocts[0] # <<<<<<<<<<<<<< - * o.children[ii + i].file_ind = -1 - * o.children[ii + i].domain = -1 + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v__dict); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_11); + __pyx_t_11 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False */ - (__pyx_v_o->children[(__pyx_v_ii + __pyx_v_i)])->domain_ind = (__pyx_v_self->nocts[0]); + __pyx_v_use_setstate = 1; - /* "yt/geometry/oct_visitors.pyx":275 - * o.children[ii + i] = &self.octs[self.nocts[0]] - * o.children[ii + i].domain_ind = self.nocts[0] - * o.children[ii + i].file_ind = -1 # <<<<<<<<<<<<<< - * o.children[ii + i].domain = -1 - * o.children[ii + i].children = NULL + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oct_index, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - (__pyx_v_o->children[(__pyx_v_ii + __pyx_v_i)])->file_ind = -1LL; + goto __pyx_L3; + } - /* "yt/geometry/oct_visitors.pyx":276 - * o.children[ii + i].domain_ind = self.nocts[0] - * o.children[ii + i].file_ind = -1 - * o.children[ii + i].domain = -1 # <<<<<<<<<<<<<< - * o.children[ii + i].children = NULL - * self.nocts[0] += 1 + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_IndexOcts, (type(self), 0xc7df155, None), state */ - (__pyx_v_o->children[(__pyx_v_ii + __pyx_v_i)])->domain = -1LL; + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; - /* "yt/geometry/oct_visitors.pyx":277 - * o.children[ii + i].file_ind = -1 - * o.children[ii + i].domain = -1 - * o.children[ii + i].children = NULL # <<<<<<<<<<<<<< - * self.nocts[0] += 1 - * else: + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_IndexOcts, (type(self), 0xc7df155, None), state + * else: */ - (__pyx_v_o->children[(__pyx_v_ii + __pyx_v_i)])->children = NULL; + __pyx_t_14 = (__pyx_v_use_setstate != 0); + if (__pyx_t_14) { - /* "yt/geometry/oct_visitors.pyx":278 - * o.children[ii + i].domain = -1 - * o.children[ii + i].children = NULL - * self.nocts[0] += 1 # <<<<<<<<<<<<<< - * else: - * print "SOMETHING IS AMISS", self.index + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_IndexOcts, (type(self), 0xc7df155, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_IndexOcts, (type(self), 0xc7df155, state) */ - __pyx_t_3 = 0; - (__pyx_v_self->nocts[__pyx_t_3]) = ((__pyx_v_self->nocts[__pyx_t_3]) + 1); - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_IndexOcts); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_209580373); + __Pyx_GIVEREF(__pyx_int_209580373); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_209580373); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 2, Py_None); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; - /* "yt/geometry/oct_visitors.pyx":264 - * o.domain = 1 - * self.nfinest[0] += 1 - * elif self.ref_mask[self.index] > 0: # <<<<<<<<<<<<<< - * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: - * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_IndexOcts, (type(self), 0xc7df155, None), state + * else: */ - goto __pyx_L3; } - /* "yt/geometry/oct_visitors.pyx":280 - * self.nocts[0] += 1 - * else: - * print "SOMETHING IS AMISS", self.index # <<<<<<<<<<<<<< - * raise RuntimeError - * self.index += 1 + /* "(tree fragment)":13 + * return __pyx_unpickle_IndexOcts, (type(self), 0xc7df155, None), state + * else: + * return __pyx_unpickle_IndexOcts, (type(self), 0xc7df155, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_IndexOcts__set_state(self, __pyx_state) */ /*else*/ { - __pyx_t_10 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_IndexOcts); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_kp_s_SOMETHING_IS_AMISS); - __Pyx_GIVEREF(__pyx_kp_s_SOMETHING_IS_AMISS); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_s_SOMETHING_IS_AMISS); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_209580373); + __Pyx_GIVEREF(__pyx_int_209580373); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_209580373); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); __pyx_t_10 = 0; - if (__Pyx_Print(0, __pyx_t_9, 1) < 0) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "yt/geometry/oct_visitors.pyx":281 - * else: - * print "SOMETHING IS AMISS", self.index - * raise RuntimeError # <<<<<<<<<<<<<< - * self.index += 1 - */ - __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_12 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; } - __pyx_L3:; - - /* "yt/geometry/oct_visitors.pyx":282 - * print "SOMETHING IS AMISS", self.index - * raise RuntimeError - * self.index += 1 # <<<<<<<<<<<<<< - */ - __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); - /* "yt/geometry/oct_visitors.pyx":253 - * @cython.boundscheck(False) - * @cython.initializedcheck(False) - * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< - * cdef int i, ii - * ii = cind(self.ind[0], self.ind[1], self.ind[2]) + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oct_index, self.oref, self.pos) */ /* function exit code */ - goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __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_WriteUnraisable("yt.geometry.oct_visitors.LoadOctree.visit", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("yt.geometry.oct_visitors.IndexOcts.__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; } -/* "yt/geometry/oct_visitors.pxd":51 - * cdef void visit(self, Oct*, np.uint8_t selected) - * - * cdef inline int oind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_IndexOcts, (type(self), 0xc7df155, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_IndexOcts__set_state(self, __pyx_state) */ -static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { - int __pyx_v_d; - int __pyx_r; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_9IndexOcts_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_9IndexOcts_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("oind", 0); + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_9IndexOcts_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "yt/geometry/oct_visitors.pxd":52 - * - * cdef inline int oind(self): - * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - * - */ - __pyx_v_d = (1 << __pyx_v_self->oref); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/geometry/oct_visitors.pxd":53 - * cdef inline int oind(self): - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) # <<<<<<<<<<<<<< - * - * cdef inline int rind(self): +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_9IndexOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *__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_IndexOcts, (type(self), 0xc7df155, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_IndexOcts__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_r = (((((__pyx_v_self->ind[0]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[2])); - goto __pyx_L0; + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_IndexOcts__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; - /* "yt/geometry/oct_visitors.pxd":51 - * cdef void visit(self, Oct*, np.uint8_t selected) - * - * cdef inline int oind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_IndexOcts, (type(self), 0xc7df155, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_IndexOcts__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("yt.geometry.oct_visitors.IndexOcts.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/oct_visitors.pxd":55 - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - * - * cdef inline int rind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) +/* "yt/geometry/oct_visitors.pyx":129 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * if selected == 0: return + * cdef int i */ -static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { - int __pyx_v_d; - int __pyx_r; +static void __pyx_f_2yt_8geometry_12oct_visitors_11ICoordsOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { + int __pyx_v_i; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rind", 0); + int __pyx_t_1; + int __pyx_t_2; + __pyx_t_5numpy_uint64_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + __Pyx_RefNannySetupContext("visit", 0); - /* "yt/geometry/oct_visitors.pxd":56 - * - * cdef inline int rind(self): - * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) - * + /* "yt/geometry/oct_visitors.pyx":130 + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): + * if selected == 0: return # <<<<<<<<<<<<<< + * cdef int i + * for i in range(3): */ - __pyx_v_d = (1 << __pyx_v_self->oref); + __pyx_t_1 = ((__pyx_v_selected == 0) != 0); + if (__pyx_t_1) { + goto __pyx_L0; + } - /* "yt/geometry/oct_visitors.pxd":57 - * cdef inline int rind(self): - * cdef int d = (1 << self.oref) - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) # <<<<<<<<<<<<<< + /* "yt/geometry/oct_visitors.pyx":132 + * if selected == 0: return + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * self.icoords[self.index,i] = (self.pos[i] << self.oref) + self.ind[i] + * self.index += 1 + */ + for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/geometry/oct_visitors.pyx":133 + * cdef int i + * for i in range(3): + * self.icoords[self.index,i] = (self.pos[i] << self.oref) + self.ind[i] # <<<<<<<<<<<<<< + * self.index += 1 * - * cdef class CountTotalOcts(OctVisitor): */ - __pyx_r = (((((__pyx_v_self->ind[2]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[0])); - goto __pyx_L0; + __pyx_t_3 = __pyx_v_self->__pyx_base.index; + __pyx_t_4 = __pyx_v_i; + if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_self->icoords.shape[1]; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->icoords.data + __pyx_t_3 * __pyx_v_self->icoords.strides[0]) ) + __pyx_t_4 * __pyx_v_self->icoords.strides[1]) )) = (((__pyx_v_self->__pyx_base.pos[__pyx_v_i]) << __pyx_v_self->__pyx_base.oref) + (__pyx_v_self->__pyx_base.ind[__pyx_v_i])); + } - /* "yt/geometry/oct_visitors.pxd":55 - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) + /* "yt/geometry/oct_visitors.pyx":134 + * for i in range(3): + * self.icoords[self.index,i] = (self.pos[i] << self.oref) + self.ind[i] + * self.index += 1 # <<<<<<<<<<<<<< * - * cdef inline int rind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) + * # Level + */ + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + + /* "yt/geometry/oct_visitors.pyx":129 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * if selected == 0: return + * cdef int i */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "yt/geometry/oct_visitors.pxd":123 - * cdef np.int64_t *nfinest - * - * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< - * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. - * return (((i*2)+j)*2+k) +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.icoords, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ -static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { - int __pyx_r; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11ICoordsOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11ICoordsOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("cind", 0); - - /* "yt/geometry/oct_visitors.pxd":125 - * cdef inline int cind(int i, int j, int k): - * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. - * return (((i*2)+j)*2+k) # <<<<<<<<<<<<<< - * - */ - __pyx_r = ((((__pyx_v_i * 2) + __pyx_v_j) * 2) + __pyx_v_k); - goto __pyx_L0; - - /* "yt/geometry/oct_visitors.pxd":123 - * cdef np.int64_t *nfinest - * - * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< - * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. - * return (((i*2)+j)*2+k) - */ + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_11ICoordsOcts___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *)__pyx_v_self)); /* function exit code */ - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_11ICoordsOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *__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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.icoords, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_v_self->icoords.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->icoords, 2, (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_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_t_11); + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_v_state = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.icoords, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_12 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_v__dict = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.icoords, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_13 = (__pyx_v__dict != Py_None); + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v__dict); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_11); + __pyx_t_11 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":20 - * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.icoords, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + goto __pyx_L3; } - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_ICoordsOcts, (type(self), 0x04e90da, None), state */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_ICoordsOcts, (type(self), 0x04e90da, None), state + * else: */ + __pyx_t_14 = (__pyx_v_use_setstate != 0); + if (__pyx_t_14) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_ICoordsOcts, (type(self), 0x04e90da, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_ICoordsOcts, (type(self), 0x04e90da, state) */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_ICoordsOcts); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_5148890); + __Pyx_GIVEREF(__pyx_int_5148890); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_5148890); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 2, Py_None); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":24 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 - * + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_ICoordsOcts, (type(self), 0x04e90da, None), state + * else: */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< - * - * cdef inline int imin(int i0, int i1) nogil: + /* "(tree fragment)":13 + * return __pyx_unpickle_ICoordsOcts, (type(self), 0x04e90da, None), state + * else: + * return __pyx_unpickle_ICoordsOcts, (type(self), 0x04e90da, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_ICoordsOcts__set_state(self, __pyx_state) */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_ICoordsOcts); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_5148890); + __Pyx_GIVEREF(__pyx_int_5148890); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_5148890); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); + __pyx_t_10 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + } - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.icoords, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ /* 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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("yt.geometry.oct_visitors.ICoordsOcts.__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; } -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 - * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_ICoordsOcts, (type(self), 0x04e90da, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_ICoordsOcts__set_state(self, __pyx_state) */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11ICoordsOcts_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11ICoordsOcts_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_2yt_8geometry_12oct_visitors_11ICoordsOcts_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * - */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_11ICoordsOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *__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_ICoordsOcts, (type(self), 0x04e90da, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_ICoordsOcts__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_ICoordsOcts__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; - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 - * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_ICoordsOcts, (type(self), 0x04e90da, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_ICoordsOcts__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("yt.geometry.oct_visitors.ICoordsOcts.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 +/* "yt/geometry/oct_visitors.pyx":140 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * if selected == 0: return + * self.ires[self.index] = self.level */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; +static void __pyx_f_2yt_8geometry_12oct_visitors_8IResOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { + __Pyx_RefNannyDeclarations int __pyx_t_1; + __pyx_t_5numpy_int8_t __pyx_t_2; + __pyx_t_5numpy_uint64_t __pyx_t_3; + __Pyx_RefNannySetupContext("visit", 0); - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 - * + /* "yt/geometry/oct_visitors.pyx":141 + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): + * if selected == 0: return # <<<<<<<<<<<<<< + * self.ires[self.index] = self.level + * self.index += 1 */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); + __pyx_t_1 = ((__pyx_v_selected == 0) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "yt/geometry/oct_visitors.pyx":142 + * cdef void visit(self, Oct* o, np.uint8_t selected): + * if selected == 0: return + * self.ires[self.index] = self.level # <<<<<<<<<<<<<< + * self.index += 1 * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_2 = __pyx_v_self->__pyx_base.level; + __pyx_t_3 = __pyx_v_self->__pyx_base.index; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_self->ires.data + __pyx_t_3 * __pyx_v_self->ires.strides[0]) )) = __pyx_t_2; - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "yt/geometry/oct_visitors.pyx":143 + * if selected == 0: return + * self.ires[self.index] = self.level + * self.index += 1 # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * # Floating point coordinates + */ + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + + /* "yt/geometry/oct_visitors.pyx":140 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * if selected == 0: return + * self.ires[self.index] = self.level */ /* function exit code */ __pyx_L0:; - return __pyx_r; + __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.ires, self.last, self.level, self.nz, self.oref, self.pos) */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_8IResOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_8IResOcts_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_2yt_8geometry_12oct_visitors_8IResOcts___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *)__pyx_v_self)); - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 - * - */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); - if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< - * - * cdef inline int iclip(int i, int a, int b) nogil: +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8IResOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *__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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.ires, self.last, self.level, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_v_self->ires.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_self->ires, 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_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_t_11); + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_v_state = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.ires, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_12 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_v__dict = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.ires, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_13 = (__pyx_v__dict != Py_None); + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v__dict); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_11); + __pyx_t_11 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False */ + __pyx_v_use_setstate = 1; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.ires, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + goto __pyx_L3; + } -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_IResOcts, (type(self), 0xf282e1e, None), state */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_IResOcts, (type(self), 0xf282e1e, None), state + * else: + */ + __pyx_t_14 = (__pyx_v_use_setstate != 0); + if (__pyx_t_14) { - /* "yt/utilities/lib/fp_utils.pxd":40 - * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_IResOcts, (type(self), 0xf282e1e, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_IResOcts, (type(self), 0xf282e1e, state) */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_IResOcts); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_254291486); + __Pyx_GIVEREF(__pyx_int_254291486); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_254291486); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 2, Py_None); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_IResOcts, (type(self), 0xf282e1e, None), state + * else: + */ } - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "(tree fragment)":13 + * return __pyx_unpickle_IResOcts, (type(self), 0xf282e1e, None), state + * else: + * return __pyx_unpickle_IResOcts, (type(self), 0xf282e1e, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_IResOcts__set_state(self, __pyx_state) */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_IResOcts); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_254291486); + __Pyx_GIVEREF(__pyx_int_254291486); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_254291486); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); + __pyx_t_10 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.ires, self.last, self.level, self.nz, self.oref, self.pos) */ /* 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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("yt.geometry.oct_visitors.IResOcts.__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; } -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i - */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * - */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fclip(np.float64_t f, +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_IResOcts, (type(self), 0xf282e1e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_IResOcts__set_state(self, __pyx_state) */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b - */ +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_8IResOcts_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_8IResOcts_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_2yt_8geometry_12oct_visitors_8IResOcts_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ - __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8IResOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + /* "(tree fragment)":15 + * return __pyx_unpickle_IResOcts, (type(self), 0xf282e1e, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_IResOcts__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_IResOcts__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; - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_IResOcts, (type(self), 0xf282e1e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_IResOcts__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("yt.geometry.oct_visitors.IResOcts.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "yt/geometry/oct_visitors.pyx":150 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # Note that this does not actually give the correct floating point + * # coordinates. It gives them in some unit system where the domain is 1.0 */ -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; +static void __pyx_f_2yt_8geometry_12oct_visitors_11FCoordsOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { + int __pyx_v_i; + __pyx_t_5numpy_float64_t __pyx_v_c; + __pyx_t_5numpy_float64_t __pyx_v_dx; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + __pyx_t_5numpy_uint64_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + __Pyx_RefNannySetupContext("visit", 0); - /* "yt/utilities/lib/fp_utils.pxd":54 - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * + /* "yt/geometry/oct_visitors.pyx":154 + * # coordinates. It gives them in some unit system where the domain is 1.0 + * # in all directions, and assumes that they will be scaled later. + * if selected == 0: return # <<<<<<<<<<<<<< + * cdef int i + * cdef np.float64_t c, dx */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + __pyx_t_1 = ((__pyx_v_selected == 0) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + /* "yt/geometry/oct_visitors.pyx":157 + * cdef int i + * cdef np.float64_t c, dx + * dx = 1.0 / ((1 << self.oref) << self.level) # <<<<<<<<<<<<<< + * for i in range(3): + * c = ((self.pos[i] << self.oref ) + self.ind[i]) */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_v_dx = (1.0 / ((1 << __pyx_v_self->__pyx_base.oref) << __pyx_v_self->__pyx_base.level)); - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "yt/geometry/oct_visitors.pyx":158 + * cdef np.float64_t c, dx + * dx = 1.0 / ((1 << self.oref) << self.level) + * for i in range(3): # <<<<<<<<<<<<<< + * c = ((self.pos[i] << self.oref ) + self.ind[i]) + * self.fcoords[self.index,i] = (c + 0.5) * dx */ + for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "yt/geometry/oct_visitors.pyx":159 + * dx = 1.0 / ((1 << self.oref) << self.level) + * for i in range(3): + * c = ((self.pos[i] << self.oref ) + self.ind[i]) # <<<<<<<<<<<<<< + * self.fcoords[self.index,i] = (c + 0.5) * dx + * self.index += 1 */ + __pyx_v_c = ((__pyx_t_5numpy_float64_t)(((__pyx_v_self->__pyx_base.pos[__pyx_v_i]) << __pyx_v_self->__pyx_base.oref) + (__pyx_v_self->__pyx_base.ind[__pyx_v_i]))); -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "yt/geometry/oct_visitors.pyx":160 + * for i in range(3): + * c = ((self.pos[i] << self.oref ) + self.ind[i]) + * self.fcoords[self.index,i] = (c + 0.5) * dx # <<<<<<<<<<<<<< + * self.index += 1 * */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + __pyx_t_3 = __pyx_v_self->__pyx_base.index; + __pyx_t_4 = __pyx_v_i; + if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_self->fcoords.shape[1]; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->fcoords.data + __pyx_t_3 * __pyx_v_self->fcoords.strides[0]) ) + __pyx_t_4 * __pyx_v_self->fcoords.strides[1]) )) = ((__pyx_v_c + 0.5) * __pyx_v_dx); } - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "yt/geometry/oct_visitors.pyx":161 + * c = ((self.pos[i] << self.oref ) + self.ind[i]) + * self.fcoords[self.index,i] = (c + 0.5) * dx + * self.index += 1 # <<<<<<<<<<<<<< * + * # Floating point widths; domain modifications are done later. */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "yt/geometry/oct_visitors.pyx":150 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # Note that this does not actually give the correct floating point + * # coordinates. It gives them in some unit system where the domain is 1.0 */ /* function exit code */ __pyx_L0:; - return __pyx_r; + __Pyx_RefNannyFinishContext(); } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.fcoords, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ /* 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; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11FCoordsOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11FCoordsOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __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)); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_11FCoordsOcts___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_11FCoordsOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_v_self) { + int __pyx_v_use_setstate; + PyObject *__pyx_v_state = NULL; + PyObject *__pyx_v__dict = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim + 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; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.fcoords, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_v_self->fcoords.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->fcoords, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_t_11); + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_v_state = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.fcoords, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_12 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_v__dict = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.fcoords, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_13 = (__pyx_v__dict != Py_None); + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ - __pyx_v_endian_detector = 1; + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v__dict); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_11); + __pyx_t_11 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.fcoords, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_FCoordsOcts, (type(self), 0x2db9d3c, None), state */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FCoordsOcts, (type(self), 0x2db9d3c, None), state + * else: */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + __pyx_t_14 = (__pyx_v_use_setstate != 0); + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_FCoordsOcts, (type(self), 0x2db9d3c, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_FCoordsOcts, (type(self), 0x2db9d3c, state) */ - __pyx_v_copy_shape = 1; + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FCoordsOcts); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_47947068); + __Pyx_GIVEREF(__pyx_int_47947068); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_47947068); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 2, Py_None); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FCoordsOcts, (type(self), 0x2db9d3c, None), state + * else: */ - goto __pyx_L4; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + /* "(tree fragment)":13 + * return __pyx_unpickle_FCoordsOcts, (type(self), 0x2db9d3c, None), state + * else: + * return __pyx_unpickle_FCoordsOcts, (type(self), 0x2db9d3c, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FCoordsOcts__set_state(self, __pyx_state) */ /*else*/ { - __pyx_v_copy_shape = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FCoordsOcts); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_47947068); + __Pyx_GIVEREF(__pyx_int_47947068); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_47947068); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); + __pyx_t_10 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; } - __pyx_L4:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.fcoords, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + /* 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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("yt.geometry.oct_visitors.FCoordsOcts.__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; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_FCoordsOcts, (type(self), 0x2db9d3c, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FCoordsOcts__set_state(self, __pyx_state) */ - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11FCoordsOcts_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11FCoordsOcts_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_2yt_8geometry_12oct_visitors_11FCoordsOcts_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_11FCoordsOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * + /* "(tree fragment)":15 + * return __pyx_unpickle_FCoordsOcts, (type(self), 0x2db9d3c, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FCoordsOcts__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; + if (!(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_2yt_8geometry_12oct_visitors___pyx_unpickle_FCoordsOcts__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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_FCoordsOcts, (type(self), 0x2db9d3c, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FCoordsOcts__set_state(self, __pyx_state) */ - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_visitors.FCoordsOcts.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_visitors.pyx":168 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # Note that this does not actually give the correct floating point + * # coordinates. It gives them in some unit system where the domain is 1.0 */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") +static void __pyx_f_2yt_8geometry_12oct_visitors_10FWidthOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { + int __pyx_v_i; + __pyx_t_5numpy_float64_t __pyx_v_dx; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __pyx_t_5numpy_uint64_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + __Pyx_RefNannySetupContext("visit", 0); + + /* "yt/geometry/oct_visitors.pyx":172 + * # coordinates. It gives them in some unit system where the domain is 1.0 + * # in all directions, and assumes that they will be scaled later. + * if selected == 0: return # <<<<<<<<<<<<<< + * cdef int i + * cdef np.float64_t dx */ + __pyx_t_1 = ((__pyx_v_selected == 0) != 0); + if (__pyx_t_1) { + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: + /* "yt/geometry/oct_visitors.pyx":175 + * cdef int i + * cdef np.float64_t dx + * dx = 1.0 / ((1 << self.oref) << self.level) # <<<<<<<<<<<<<< + * for i in range(3): + * self.fwidth[self.index,i] = dx */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + __pyx_v_dx = (1.0 / ((1 << __pyx_v_self->__pyx_base.oref) << __pyx_v_self->__pyx_base.level)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + /* "yt/geometry/oct_visitors.pyx":176 + * cdef np.float64_t dx + * dx = 1.0 / ((1 << self.oref) << self.level) + * for i in range(3): # <<<<<<<<<<<<<< + * self.fwidth[self.index,i] = dx + * self.index += 1 */ - __pyx_v_info->ndim = __pyx_v_ndim; + for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "yt/geometry/oct_visitors.pyx":177 + * dx = 1.0 / ((1 << self.oref) << self.level) + * for i in range(3): + * self.fwidth[self.index,i] = dx # <<<<<<<<<<<<<< + * self.index += 1 + * */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + __pyx_t_3 = __pyx_v_self->__pyx_base.index; + __pyx_t_4 = __pyx_v_i; + if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_self->fwidth.shape[1]; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->fwidth.data + __pyx_t_3 * __pyx_v_self->fwidth.strides[0]) ) + __pyx_t_4 * __pyx_v_self->fwidth.strides[1]) )) = __pyx_v_dx; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "yt/geometry/oct_visitors.pyx":178 + * for i in range(3): + * self.fwidth[self.index,i] = dx + * self.index += 1 # <<<<<<<<<<<<<< + * + * # Mark which domains are touched by a selector. */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "yt/geometry/oct_visitors.pyx":168 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # Note that this does not actually give the correct floating point + * # coordinates. It gives them in some unit system where the domain is 1.0 */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * 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: +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.fwidth, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_10FWidthOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_10FWidthOcts_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_2yt_8geometry_12oct_visitors_10FWidthOcts___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_10FWidthOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *__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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.fwidth, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_v_self->fwidth.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->fwidth, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_t_11); + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_v_state = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.fwidth, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_12 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_v__dict = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.fwidth, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_13 = (__pyx_v__dict != Py_None); + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v__dict); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_11); + __pyx_t_11 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.fwidth, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - goto __pyx_L11; + goto __pyx_L3; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_FWidthOcts, (type(self), 0x55bf4cf, None), state */ /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * 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_v_use_setstate = 0; } - __pyx_L11:; + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FWidthOcts, (type(self), 0x55bf4cf, None), state + * else: */ - __pyx_v_info->suboffsets = NULL; + __pyx_t_14 = (__pyx_v_use_setstate != 0); + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_FWidthOcts, (type(self), 0x55bf4cf, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_FWidthOcts, (type(self), 0x55bf4cf, state) */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FWidthOcts); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_89912527); + __Pyx_GIVEREF(__pyx_int_89912527); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_89912527); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 2, Py_None); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FWidthOcts, (type(self), 0x55bf4cf, None), state + * else: */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + /* "(tree fragment)":13 + * return __pyx_unpickle_FWidthOcts, (type(self), 0x55bf4cf, None), state + * else: + * return __pyx_unpickle_FWidthOcts, (type(self), 0x55bf4cf, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FWidthOcts__set_state(self, __pyx_state) */ - __pyx_v_f = NULL; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FWidthOcts); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_89912527); + __Pyx_GIVEREF(__pyx_int_89912527); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_89912527); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); + __pyx_t_10 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset - * + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.fwidth, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ - __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + /* 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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("yt.geometry.oct_visitors.FWidthOcts.__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; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_FWidthOcts, (type(self), 0x55bf4cf, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FWidthOcts__set_state(self, __pyx_state) */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_10FWidthOcts_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_10FWidthOcts_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_2yt_8geometry_12oct_visitors_10FWidthOcts_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_10FWidthOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *__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_FWidthOcts, (type(self), 0x55bf4cf, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FWidthOcts__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_FWidthOcts__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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_FWidthOcts, (type(self), 0x55bf4cf, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FWidthOcts__set_state(self, __pyx_state) */ - goto __pyx_L14; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_visitors.FWidthOcts.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_visitors.pyx":184 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # We assume that our domain has *already* been selected by, which means + * # we'll get all cells within the domain for a by-domain selector and all */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self +static void __pyx_f_2yt_8geometry_12oct_visitors_12IdentifyOcts_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + __Pyx_RefNannySetupContext("visit", 0); + + /* "yt/geometry/oct_visitors.pyx":188 + * # we'll get all cells within the domain for a by-domain selector and all + * # cells within the domain *and* selector for the selector itself. + * if selected == 0: return # <<<<<<<<<<<<<< + * self.domain_mask[o.domain - 1] = 1 * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + __pyx_t_1 = ((__pyx_v_selected == 0) != 0); if (__pyx_t_1) { + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "yt/geometry/oct_visitors.pyx":189 + * # cells within the domain *and* selector for the selector itself. + * if selected == 0: return + * self.domain_mask[o.domain - 1] = 1 # <<<<<<<<<<<<<< * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): + * # Assign domain indices to octs */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + __pyx_t_2 = (__pyx_v_o->domain - 1); + if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_v_self->domain_mask.shape[0]; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->domain_mask.data + __pyx_t_2 * __pyx_v_self->domain_mask.strides[0]) )) = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "yt/geometry/oct_visitors.pyx":184 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # We assume that our domain has *already* been selected by, which means + * # we'll get all cells within the domain for a by-domain selector and all */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.domain_mask, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_12IdentifyOcts_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_12IdentifyOcts_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_2yt_8geometry_12oct_visitors_12IdentifyOcts___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *)__pyx_v_self)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12IdentifyOcts___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *__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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.domain_mask, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_v_self->domain_mask.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->domain_mask, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_t_11); + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_v_state = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.domain_mask, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_12 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_v__dict = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.domain_mask, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_13 = (__pyx_v__dict != Py_None); + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v__dict); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_11); + __pyx_t_11 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; + __pyx_v_use_setstate = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.domain_mask, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_IdentifyOcts, (type(self), 0xbe9c5c9, None), state */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_IdentifyOcts, (type(self), 0xbe9c5c9, None), state + * else: */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; + __pyx_t_14 = (__pyx_v_use_setstate != 0); + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_IdentifyOcts, (type(self), 0xbe9c5c9, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_IdentifyOcts, (type(self), 0xbe9c5c9, state) */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_IdentifyOcts); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_199869897); + __Pyx_GIVEREF(__pyx_int_199869897); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_199869897); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 2, Py_None); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_IdentifyOcts, (type(self), 0xbe9c5c9, None), state + * else: */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "(tree fragment)":13 + * return __pyx_unpickle_IdentifyOcts, (type(self), 0xbe9c5c9, None), state + * else: + * return __pyx_unpickle_IdentifyOcts, (type(self), 0xbe9c5c9, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_IdentifyOcts__set_state(self, __pyx_state) */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_IdentifyOcts); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_199869897); + __Pyx_GIVEREF(__pyx_int_199869897); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_199869897); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); + __pyx_t_10 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.domain_mask, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; + /* 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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("yt.geometry.oct_visitors.IdentifyOcts.__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; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_IdentifyOcts, (type(self), 0xbe9c5c9, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_IdentifyOcts__set_state(self, __pyx_state) */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_12IdentifyOcts_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_12IdentifyOcts_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_2yt_8geometry_12oct_visitors_12IdentifyOcts_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12IdentifyOcts_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "(tree fragment)":15 + * return __pyx_unpickle_IdentifyOcts, (type(self), 0xbe9c5c9, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_IdentifyOcts__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_IdentifyOcts__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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_IdentifyOcts, (type(self), 0xbe9c5c9, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_IdentifyOcts__set_state(self, __pyx_state) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_visitors.IdentifyOcts.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_visitors.pyx":195 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * o.domain_ind = self.global_index + * self.index += 1 */ - __pyx_v_info->format = __pyx_v_f; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) +static void __pyx_f_2yt_8geometry_12oct_visitors_15AssignDomainInd_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected) { + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_int64_t __pyx_t_1; + __Pyx_RefNannySetupContext("visit", 0); + + /* "yt/geometry/oct_visitors.pyx":196 + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): + * o.domain_ind = self.global_index # <<<<<<<<<<<<<< + * self.index += 1 + * */ - __pyx_r = 0; - goto __pyx_L0; + __pyx_t_1 = __pyx_v_self->__pyx_base.global_index; + __pyx_v_o->domain_ind = __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "yt/geometry/oct_visitors.pyx":197 + * cdef void visit(self, Oct* o, np.uint8_t selected): + * o.domain_ind = self.global_index + * self.index += 1 # <<<<<<<<<<<<<< * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * # From the file, fill in C order + */ + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + + /* "yt/geometry/oct_visitors.pyx":195 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * o.domain_ind = self.global_index + * self.index += 1 + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_15AssignDomainInd_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_15AssignDomainInd_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_2yt_8geometry_12oct_visitors_15AssignDomainInd___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_15AssignDomainInd___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *__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; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(10); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 9, __pyx_t_10); + __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_t_10 = 0; + __pyx_v_state = __pyx_t_11; + __pyx_t_11 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_11 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_v__dict = __pyx_t_11; + __pyx_t_11 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_12 = (__pyx_v__dict != Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v__dict); + __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_10); + __pyx_t_10 = 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.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ + goto __pyx_L3; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_AssignDomainInd, (type(self), 0x047358e, None), state */ /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); + __pyx_v_use_setstate = 0; + } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_AssignDomainInd, (type(self), 0x047358e, None), state + * else: */ - (__pyx_v_info->format[0]) = '^'; + __pyx_t_13 = (__pyx_v_use_setstate != 0); + if (__pyx_t_13) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_AssignDomainInd, (type(self), 0x047358e, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_AssignDomainInd, (type(self), 0x047358e, state) */ - __pyx_v_offset = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_AssignDomainInd); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_4666766); + __Pyx_GIVEREF(__pyx_int_4666766); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_4666766); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_11, 2, Py_None); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state); + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_AssignDomainInd, (type(self), 0x047358e, None), state + * else: */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): + /* "(tree fragment)":13 + * return __pyx_unpickle_AssignDomainInd, (type(self), 0x047358e, None), state + * else: + * return __pyx_unpickle_AssignDomainInd, (type(self), 0x047358e, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_AssignDomainInd__set_state(self, __pyx_state) */ - (__pyx_v_f[0]) = '\x00'; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_AssignDomainInd); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_4666766); + __Pyx_GIVEREF(__pyx_int_4666766); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_4666766); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_state); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); + __pyx_t_9 = 0; + __pyx_t_11 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ /* 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_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("yt.geometry.oct_visitors.AssignDomainInd.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_AssignDomainInd, (type(self), 0x047358e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_AssignDomainInd__set_state(self, __pyx_state) */ /* 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) { +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_15AssignDomainInd_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_15AssignDomainInd_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_15AssignDomainInd_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_15AssignDomainInd_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "(tree fragment)":15 + * return __pyx_unpickle_AssignDomainInd, (type(self), 0x047358e, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_AssignDomainInd__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_AssignDomainInd__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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_AssignDomainInd, (type(self), 0x047358e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_AssignDomainInd__set_state(self, __pyx_state) */ - free(__pyx_v_info->format); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_visitors.AssignDomainInd.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_visitors.pyx":203 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # We fill these arrays, then inside the level filler we use these as + * # indices as we fill a second array from the self. */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block +static void __pyx_f_2yt_8geometry_12oct_visitors_16FillFileIndicesO_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __pyx_t_5numpy_int8_t __pyx_t_2; + __pyx_t_5numpy_uint64_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_uint64_t __pyx_t_5; + __pyx_t_5numpy_uint64_t __pyx_t_6; + __Pyx_RefNannySetupContext("visit", 0); + + /* "yt/geometry/oct_visitors.pyx":206 + * # We fill these arrays, then inside the level filler we use these as + * # indices as we fill a second array from the self. + * if selected == 0: return # <<<<<<<<<<<<<< + * self.levels[self.index] = self.level + * self.file_inds[self.index] = o.file_ind */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + __pyx_t_1 = ((__pyx_v_selected == 0) != 0); if (__pyx_t_1) { + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * + /* "yt/geometry/oct_visitors.pyx":207 + * # indices as we fill a second array from the self. + * if selected == 0: return + * self.levels[self.index] = self.level # <<<<<<<<<<<<<< + * self.file_inds[self.index] = o.file_ind + * self.cell_inds[self.index] = self.oind() */ - free(__pyx_v_info->strides); + __pyx_t_2 = __pyx_v_self->__pyx_base.level; + __pyx_t_3 = __pyx_v_self->__pyx_base.index; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->levels.data + __pyx_t_3 * __pyx_v_self->levels.strides[0]) )) = __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "yt/geometry/oct_visitors.pyx":208 + * if selected == 0: return + * self.levels[self.index] = self.level + * self.file_inds[self.index] = o.file_ind # <<<<<<<<<<<<<< + * self.cell_inds[self.index] = self.oind() + * self.index +=1 */ - } + __pyx_t_4 = __pyx_v_o->file_ind; + __pyx_t_5 = __pyx_v_self->__pyx_base.index; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_self->file_inds.data + __pyx_t_5 * __pyx_v_self->file_inds.strides[0]) )) = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "yt/geometry/oct_visitors.pyx":209 + * self.levels[self.index] = self.level + * self.file_inds[self.index] = o.file_ind + * self.cell_inds[self.index] = self.oind() # <<<<<<<<<<<<<< + * self.index +=1 * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + */ + __pyx_t_6 = __pyx_v_self->__pyx_base.index; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->cell_inds.data + __pyx_t_6 * __pyx_v_self->cell_inds.strides[0]) )) = __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_self)); + + /* "yt/geometry/oct_visitors.pyx":210 + * self.file_inds[self.index] = o.file_ind + * self.cell_inds[self.index] = self.oind() + * self.index +=1 # <<<<<<<<<<<<<< + * + * # From the file, fill in F order + */ + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + + /* "yt/geometry/oct_visitors.pyx":203 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # We fill these arrays, then inside the level filler we use these as + * # indices as we fill a second array from the self. */ /* function exit code */ + __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.cell_inds, self.dims, self.domain, self.file_inds, self.global_index, self.ind, self.index, self.last, self.level, self.levels, self.nz, self.oref, self.pos) */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_16FillFileIndicesO_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_16FillFileIndicesO_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_2yt_8geometry_12oct_visitors_16FillFileIndicesO___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_16FillFileIndicesO___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *__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; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): + 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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_t_16; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.cell_inds, self.dims, self.domain, self.file_inds, self.global_index, self.ind, self.index, self.last, self.level, self.levels, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) + if (unlikely(!__pyx_v_self->cell_inds.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->cell_inds, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_v_self->file_inds.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->file_inds, 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_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (unlikely(!__pyx_v_self->levels.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_v_self->levels, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyTuple_New(13); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_14, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_14, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_14, 10, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_14, 11, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_14, 12, __pyx_t_13); __pyx_t_1 = 0; - goto __pyx_L0; + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_v_state = __pyx_t_14; + __pyx_t_14 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.cell_inds, self.dims, self.domain, self.file_inds, self.global_index, self.ind, self.index, self.last, self.level, self.levels, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_14 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_v__dict = __pyx_t_14; + __pyx_t_14 = 0; + + /* "(tree fragment)":5 + * state = (self.cell_inds, self.dims, self.domain, self.file_inds, self.global_index, self.ind, self.index, self.last, self.level, self.levels, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_15 = (__pyx_v__dict != Py_None); + __pyx_t_16 = (__pyx_t_15 != 0); + if (__pyx_t_16) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v__dict); + __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_13); + __pyx_t_13 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * + /* "(tree fragment)":5 + * state = (self.cell_inds, self.dims, self.domain, self.file_inds, self.global_index, self.ind, self.index, self.last, self.level, self.levels, self.nz, self.oref, self.pos) + * _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_FillFileIndicesO, (type(self), 0x286fa6e, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FillFileIndicesO, (type(self), 0x286fa6e, None), state + * else: + */ + __pyx_t_16 = (__pyx_v_use_setstate != 0); + if (__pyx_t_16) { + + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_FillFileIndicesO, (type(self), 0x286fa6e, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_FillFileIndicesO, (type(self), 0x286fa6e, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FillFileIndicesO); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_42400366); + __Pyx_GIVEREF(__pyx_int_42400366); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_int_42400366); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_14, 2, Py_None); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state); + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FillFileIndicesO, (type(self), 0x286fa6e, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_FillFileIndicesO, (type(self), 0x286fa6e, None), state + * else: + * return __pyx_unpickle_FillFileIndicesO, (type(self), 0x286fa6e, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FillFileIndicesO__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FillFileIndicesO); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_42400366); + __Pyx_GIVEREF(__pyx_int_42400366); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_int_42400366); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_state); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_14); + __pyx_t_12 = 0; + __pyx_t_14 = 0; + __pyx_r = __pyx_t_13; + __pyx_t_13 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.cell_inds, self.dims, self.domain, self.file_inds, self.global_index, self.ind, self.index, self.last, self.level, self.levels, self.nz, self.oref, self.pos) */ /* 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_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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("yt.geometry.oct_visitors.FillFileIndicesO.__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; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_FillFileIndicesO, (type(self), 0x286fa6e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FillFileIndicesO__set_state(self, __pyx_state) */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_16FillFileIndicesO_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_16FillFileIndicesO_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_2yt_8geometry_12oct_visitors_16FillFileIndicesO_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_16FillFileIndicesO_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): + /* "(tree fragment)":15 + * return __pyx_unpickle_FillFileIndicesO, (type(self), 0x286fa6e, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FillFileIndicesO__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __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, 774, __pyx_L1_error) + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_FillFileIndicesO__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_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_FillFileIndicesO, (type(self), 0x286fa6e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FillFileIndicesO__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("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __Pyx_AddTraceback("yt.geometry.oct_visitors.FillFileIndicesO.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * +/* "yt/geometry/oct_visitors.pyx":216 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # We fill these arrays, then inside the level filler we use these as + * # indices as we fill a second array from the self. */ -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; +static void __pyx_f_2yt_8geometry_12oct_visitors_16FillFileIndicesR_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + int __pyx_t_1; + __pyx_t_5numpy_int8_t __pyx_t_2; + __pyx_t_5numpy_uint64_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_uint64_t __pyx_t_5; + __pyx_t_5numpy_uint64_t __pyx_t_6; + __Pyx_RefNannySetupContext("visit", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + /* "yt/geometry/oct_visitors.pyx":219 + * # We fill these arrays, then inside the level filler we use these as + * # indices as we fill a second array from the self. + * if selected == 0: return # <<<<<<<<<<<<<< + * self.levels[self.index] = self.level + * self.file_inds[self.index] = o.file_ind */ - __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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_1 = ((__pyx_v_selected == 0) != 0); + if (__pyx_t_1) { + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) + /* "yt/geometry/oct_visitors.pyx":220 + * # indices as we fill a second array from the self. + * if selected == 0: return + * self.levels[self.index] = self.level # <<<<<<<<<<<<<< + * self.file_inds[self.index] = o.file_ind + * self.cell_inds[self.index] = self.rind() + */ + __pyx_t_2 = __pyx_v_self->__pyx_base.level; + __pyx_t_3 = __pyx_v_self->__pyx_base.index; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->levels.data + __pyx_t_3 * __pyx_v_self->levels.strides[0]) )) = __pyx_t_2; + + /* "yt/geometry/oct_visitors.pyx":221 + * if selected == 0: return + * self.levels[self.index] = self.level + * self.file_inds[self.index] = o.file_ind # <<<<<<<<<<<<<< + * self.cell_inds[self.index] = self.rind() + * self.index +=1 + */ + __pyx_t_4 = __pyx_v_o->file_ind; + __pyx_t_5 = __pyx_v_self->__pyx_base.index; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_self->file_inds.data + __pyx_t_5 * __pyx_v_self->file_inds.strides[0]) )) = __pyx_t_4; + + /* "yt/geometry/oct_visitors.pyx":222 + * self.levels[self.index] = self.level + * self.file_inds[self.index] = o.file_ind + * self.cell_inds[self.index] = self.rind() # <<<<<<<<<<<<<< + * self.index +=1 * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + */ + __pyx_t_6 = __pyx_v_self->__pyx_base.index; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->cell_inds.data + __pyx_t_6 * __pyx_v_self->cell_inds.strides[0]) )) = __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_self)); + + /* "yt/geometry/oct_visitors.pyx":223 + * self.file_inds[self.index] = o.file_ind + * self.cell_inds[self.index] = self.rind() + * self.index +=1 # <<<<<<<<<<<<<< * + * # Count octs by domain + */ + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + + /* "yt/geometry/oct_visitors.pyx":216 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * # We fill these arrays, then inside the level filler we use these as + * # indices as we fill a second array from the self. */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.cell_inds, self.dims, self.domain, self.file_inds, self.global_index, self.ind, self.index, self.last, self.level, self.levels, self.nz, self.oref, self.pos) */ -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) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_16FillFileIndicesR_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_16FillFileIndicesR_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_2yt_8geometry_12oct_visitors_16FillFileIndicesR___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_16FillFileIndicesR___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *__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; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * 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): + 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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_t_16; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.cell_inds, self.dims, self.domain, self.file_inds, self.global_index, self.ind, self.index, self.last, self.level, self.levels, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __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, 780, __pyx_L1_error) + if (unlikely(!__pyx_v_self->cell_inds.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->cell_inds, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_v_self->file_inds.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->file_inds, 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_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (unlikely(!__pyx_v_self->levels.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_v_self->levels, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyTuple_New(13); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_14, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_14, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_14, 10, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_14, 11, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_14, 12, __pyx_t_13); __pyx_t_1 = 0; - goto __pyx_L0; + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_v_state = __pyx_t_14; + __pyx_t_14 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.cell_inds, self.dims, self.domain, self.file_inds, self.global_index, self.ind, self.index, self.last, self.level, self.levels, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_14 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_v__dict = __pyx_t_14; + __pyx_t_14 = 0; + + /* "(tree fragment)":5 + * state = (self.cell_inds, self.dims, self.domain, self.file_inds, self.global_index, self.ind, self.index, self.last, self.level, self.levels, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_15 = (__pyx_v__dict != Py_None); + __pyx_t_16 = (__pyx_t_15 != 0); + if (__pyx_t_16) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v__dict); + __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_13); + __pyx_t_13 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * + /* "(tree fragment)":5 + * state = (self.cell_inds, self.dims, self.domain, self.file_inds, self.global_index, self.ind, self.index, self.last, self.level, self.levels, self.nz, self.oref, self.pos) + * _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_FillFileIndicesR, (type(self), 0x286fa6e, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FillFileIndicesR, (type(self), 0x286fa6e, None), state + * else: + */ + __pyx_t_16 = (__pyx_v_use_setstate != 0); + if (__pyx_t_16) { + + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_FillFileIndicesR, (type(self), 0x286fa6e, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_FillFileIndicesR, (type(self), 0x286fa6e, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FillFileIndicesR); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_42400366); + __Pyx_GIVEREF(__pyx_int_42400366); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_int_42400366); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_14, 2, Py_None); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state); + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FillFileIndicesR, (type(self), 0x286fa6e, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_FillFileIndicesR, (type(self), 0x286fa6e, None), state + * else: + * return __pyx_unpickle_FillFileIndicesR, (type(self), 0x286fa6e, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FillFileIndicesR__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FillFileIndicesR); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_42400366); + __Pyx_GIVEREF(__pyx_int_42400366); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_int_42400366); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_state); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_14); + __pyx_t_12 = 0; + __pyx_t_14 = 0; + __pyx_r = __pyx_t_13; + __pyx_t_13 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.cell_inds, self.dims, self.domain, self.file_inds, self.global_index, self.ind, self.index, self.last, self.level, self.levels, self.nz, self.oref, self.pos) */ /* 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_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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("yt.geometry.oct_visitors.FillFileIndicesR.__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; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) - * +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_FillFileIndicesR, (type(self), 0x286fa6e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FillFileIndicesR__set_state(self, __pyx_state) */ -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) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_16FillFileIndicesR_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_16FillFileIndicesR_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_2yt_8geometry_12oct_visitors_16FillFileIndicesR_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_16FillFileIndicesR_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + /* "(tree fragment)":15 + * return __pyx_unpickle_FillFileIndicesR, (type(self), 0x286fa6e, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FillFileIndicesR__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __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, 783, __pyx_L1_error) + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_FillFileIndicesR__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_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) - * + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_FillFileIndicesR, (type(self), 0x286fa6e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FillFileIndicesR__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("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __Pyx_AddTraceback("yt.geometry.oct_visitors.FillFileIndicesR.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) +/* "yt/geometry/oct_visitors.pyx":229 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * if selected == 0: return + * # NOTE: We do this for every *cell*. + */ + +static void __pyx_f_2yt_8geometry_12oct_visitors_13CountByDomain_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_uint8_t __pyx_v_selected) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + __Pyx_RefNannySetupContext("visit", 0); + + /* "yt/geometry/oct_visitors.pyx":230 + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): + * if selected == 0: return # <<<<<<<<<<<<<< + * # NOTE: We do this for every *cell*. + * self.domain_counts[o.domain - 1] += 1 + */ + __pyx_t_1 = ((__pyx_v_selected == 0) != 0); + if (__pyx_t_1) { + goto __pyx_L0; + } + + /* "yt/geometry/oct_visitors.pyx":232 + * if selected == 0: return + * # NOTE: We do this for every *cell*. + * self.domain_counts[o.domain - 1] += 1 # <<<<<<<<<<<<<< * - * 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. + * # Store the refinement mapping of the octree to be loaded later */ + __pyx_t_2 = (__pyx_v_o->domain - 1); + if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_v_self->domain_counts.shape[0]; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_self->domain_counts.data + __pyx_t_2 * __pyx_v_self->domain_counts.strides[0]) )) += 1; -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; + /* "yt/geometry/oct_visitors.pyx":229 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * if selected == 0: return + * # NOTE: We do this for every *cell*. + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.domain_counts, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_13CountByDomain_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_13CountByDomain_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_2yt_8geometry_12oct_visitors_13CountByDomain___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_13CountByDomain___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *__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; - Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_2 = NULL; 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields + 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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.domain_counts, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_v_endian_detector = 1; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_v_self->domain_counts.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->domain_counts, 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_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_t_11); + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_v_state = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.domain_counts, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_12 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_v__dict = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.domain_counts, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_13 = (__pyx_v__dict != Py_None); + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v__dict); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_11); + __pyx_t_11 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.domain_counts, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_CountByDomain, (type(self), 0x5e07de9, None), state */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) + /*else*/ { + __pyx_v_use_setstate = 0; } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_CountByDomain, (type(self), 0x5e07de9, None), state + * else: */ - if (unlikely(__pyx_v_descr->fields == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; + __pyx_t_14 = (__pyx_v_use_setstate != 0); + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_CountByDomain, (type(self), 0x5e07de9, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_CountByDomain, (type(self), 0x5e07de9, state) */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_CountByDomain); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_98598377); + __Pyx_GIVEREF(__pyx_int_98598377); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_98598377); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 2, Py_None); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_CountByDomain, (type(self), 0x5e07de9, None), state + * else: */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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 + /* "(tree fragment)":13 + * return __pyx_unpickle_CountByDomain, (type(self), 0x5e07de9, None), state + * else: + * return __pyx_unpickle_CountByDomain, (type(self), 0x5e07de9, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_CountByDomain__set_state(self, __pyx_state) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_CountByDomain); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_98598377); + __Pyx_GIVEREF(__pyx_int_98598377); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_98598377); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); + __pyx_t_10 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.domain_counts, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos) */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 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:; + /* 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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("yt.geometry.oct_visitors.CountByDomain.__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; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_CountByDomain, (type(self), 0x5e07de9, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_CountByDomain__set_state(self, __pyx_state) */ - __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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_6) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_13CountByDomain_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_13CountByDomain_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_2yt_8geometry_12oct_visitors_13CountByDomain_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_13CountByDomain_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 + /* "(tree fragment)":15 + * return __pyx_unpickle_CountByDomain, (type(self), 0x5e07de9, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_CountByDomain__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_CountByDomain__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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_CountByDomain, (type(self), 0x5e07de9, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_CountByDomain__set_state(self, __pyx_state) */ - (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_visitors.CountByDomain.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_visitors.pyx":238 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * cdef np.uint8_t res, ii + * ii = cind(self.ind[0], self.ind[1], self.ind[2]) */ - __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize +static void __pyx_f_2yt_8geometry_12oct_visitors_11StoreOctree_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected) { + __pyx_t_5numpy_uint8_t __pyx_v_res; + CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_ii; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __pyx_t_5numpy_uint64_t __pyx_t_2; + __Pyx_RefNannySetupContext("visit", 0); + + /* "yt/geometry/oct_visitors.pyx":240 + * cdef void visit(self, Oct* o, np.uint8_t selected): + * cdef np.uint8_t res, ii + * ii = cind(self.ind[0], self.ind[1], self.ind[2]) # <<<<<<<<<<<<<< + * if o.children == NULL: + * # Not refined. */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } + __pyx_v_ii = __pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_self->__pyx_base.ind[0]), (__pyx_v_self->__pyx_base.ind[1]), (__pyx_v_self->__pyx_base.ind[2])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): + /* "yt/geometry/oct_visitors.pyx":241 + * cdef np.uint8_t res, ii + * ii = cind(self.ind[0], self.ind[1], self.ind[2]) + * if o.children == NULL: # <<<<<<<<<<<<<< + * # Not refined. + * res = 0 */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + __pyx_t_1 = ((__pyx_v_o->children == NULL) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + /* "yt/geometry/oct_visitors.pyx":243 + * if o.children == NULL: + * # Not refined. + * res = 0 # <<<<<<<<<<<<<< + * else: + * res = 1 */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { + __pyx_v_res = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") + /* "yt/geometry/oct_visitors.pyx":241 + * cdef np.uint8_t res, ii + * ii = cind(self.ind[0], self.ind[1], self.ind[2]) + * if o.children == NULL: # <<<<<<<<<<<<<< + * # Not refined. + * res = 0 */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * + /* "yt/geometry/oct_visitors.pyx":245 + * res = 0 + * else: + * res = 1 # <<<<<<<<<<<<<< + * self.ref_mask[self.index] = res + * self.index += 1 */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { + /*else*/ { + __pyx_v_res = 1; + } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + /* "yt/geometry/oct_visitors.pyx":246 + * else: + * res = 1 + * self.ref_mask[self.index] = res # <<<<<<<<<<<<<< + * self.index += 1 * - * # 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, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->__pyx_base.index; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->ref_mask.data + __pyx_t_2 * __pyx_v_self->ref_mask.strides[0]) )) = __pyx_v_res; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* "yt/geometry/oct_visitors.pyx":247 + * res = 1 + * self.ref_mask[self.index] = res + * self.index += 1 # <<<<<<<<<<<<<< * + * # Go from a refinement mapping to a new octree */ - } + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" + /* "yt/geometry/oct_visitors.pyx":238 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * cdef np.uint8_t res, ii + * ii = cind(self.ind[0], self.ind[1], self.ind[2]) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.ref_mask) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11StoreOctree_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11StoreOctree_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_2yt_8geometry_12oct_visitors_11StoreOctree___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *)__pyx_v_self)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_11StoreOctree___reduce_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *__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; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.ref_mask) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.global_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_FromCString(__pyx_v_self->__pyx_base.ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.last); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.level); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->__pyx_base.nz); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int8(__pyx_v_self->__pyx_base.oref); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_v_self->__pyx_base.pos, 3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (unlikely(!__pyx_v_self->ref_mask.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)} + __pyx_t_11 = __pyx_memoryview_fromslice(__pyx_v_self->ref_mask, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_t_11); + __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_t_10 = 0; + __pyx_t_11 = 0; + __pyx_v_state = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.ref_mask) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_12 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_v__dict = __pyx_t_12; + __pyx_t_12 = 0; + + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.ref_mask) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_13 = (__pyx_v__dict != Py_None); + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v__dict); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_11); + __pyx_t_11 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + /* "(tree fragment)":5 + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.ref_mask) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_StoreOctree, (type(self), 0xafcb867, None), state */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_StoreOctree, (type(self), 0xafcb867, None), state + * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } + __pyx_t_14 = (__pyx_v_use_setstate != 0); + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_StoreOctree, (type(self), 0xafcb867, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_StoreOctree, (type(self), 0xafcb867, state) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_StoreOctree); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184334439); + __Pyx_GIVEREF(__pyx_int_184334439); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_184334439); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 2, Py_None); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_StoreOctree, (type(self), 0xafcb867, None), state + * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + /* "(tree fragment)":13 + * return __pyx_unpickle_StoreOctree, (type(self), 0xafcb867, None), state + * else: + * return __pyx_unpickle_StoreOctree, (type(self), 0xafcb867, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_StoreOctree__set_state(self, __pyx_state) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_StoreOctree); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184334439); + __Pyx_GIVEREF(__pyx_int_184334439); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_184334439); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); + __pyx_t_10 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dims, self.domain, self.global_index, self.ind, self.index, self.last, self.level, self.nz, self.oref, self.pos, self.ref_mask) */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } + /* 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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("yt.geometry.oct_visitors.StoreOctree.__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; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_StoreOctree, (type(self), 0xafcb867, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_StoreOctree__set_state(self, __pyx_state) */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), - */ - __pyx_v_f = (__pyx_v_f + 1); +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11StoreOctree_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11StoreOctree_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_2yt_8geometry_12oct_visitors_11StoreOctree_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - goto __pyx_L13; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * - */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_11StoreOctree_2__setstate_cython__(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + /* "(tree fragment)":15 + * return __pyx_unpickle_StoreOctree, (type(self), 0xafcb867, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_StoreOctree__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_2yt_8geometry_12oct_visitors___pyx_unpickle_StoreOctree__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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_StoreOctree, (type(self), 0xafcb867, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_StoreOctree__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_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.geometry.oct_visitors.StoreOctree.__setstate_cython__", __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: +/* "yt/geometry/oct_visitors.pyx":253 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * cdef int i, ii + * ii = cind(self.ind[0], self.ind[1], self.ind[2]) */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; +static void __pyx_f_2yt_8geometry_12oct_visitors_10LoadOctree_visit(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_selected) { + int __pyx_v_i; + int __pyx_v_ii; __Pyx_RefNannyDeclarations - int __pyx_t_1; + __pyx_t_5numpy_uint64_t __pyx_t_1; int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); + long __pyx_t_3; + __pyx_t_5numpy_uint64_t __pyx_t_4; + __pyx_t_5numpy_uint64_t __pyx_t_5; + int __pyx_t_6; + __pyx_t_5numpy_uint64_t __pyx_t_7; + __pyx_t_5numpy_uint64_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + __Pyx_RefNannySetupContext("visit", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "yt/geometry/oct_visitors.pyx":255 + * cdef void visit(self, Oct* o, np.uint8_t selected): + * cdef int i, ii + * ii = cind(self.ind[0], self.ind[1], self.ind[2]) # <<<<<<<<<<<<<< + * if self.ref_mask[self.index] == 0: + * # We only want to do this once. Otherwise we end up with way too many */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); + __pyx_v_ii = __pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_self->__pyx_base.ind[0]), (__pyx_v_self->__pyx_base.ind[1]), (__pyx_v_self->__pyx_base.ind[2])); + + /* "yt/geometry/oct_visitors.pyx":256 + * cdef int i, ii + * ii = cind(self.ind[0], self.ind[1], self.ind[2]) + * if self.ref_mask[self.index] == 0: # <<<<<<<<<<<<<< + * # We only want to do this once. Otherwise we end up with way too many + * # nfinest for our tastes. + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.index; + __pyx_t_2 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->ref_mask.data + __pyx_t_1 * __pyx_v_self->ref_mask.strides[0]) ))) == 0) != 0); if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! + /* "yt/geometry/oct_visitors.pyx":259 + * # We only want to do this once. Otherwise we end up with way too many + * # nfinest for our tastes. + * if o.file_ind == -1: # <<<<<<<<<<<<<< + * o.children = NULL + * o.file_ind = self.nfinest[0] */ - __pyx_v_baseptr = NULL; + __pyx_t_2 = ((__pyx_v_o->file_ind == -1LL) != 0); + if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "yt/geometry/oct_visitors.pyx":260 + * # nfinest for our tastes. + * if o.file_ind == -1: + * o.children = NULL # <<<<<<<<<<<<<< + * o.file_ind = self.nfinest[0] + * o.domain = 1 */ - goto __pyx_L3; - } + __pyx_v_o->children = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) + /* "yt/geometry/oct_visitors.pyx":261 + * if o.file_ind == -1: + * o.children = NULL + * o.file_ind = self.nfinest[0] # <<<<<<<<<<<<<< + * o.domain = 1 + * self.nfinest[0] += 1 */ - /*else*/ { - Py_INCREF(__pyx_v_base); + __pyx_v_o->file_ind = (__pyx_v_self->nfinest[0]); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr + /* "yt/geometry/oct_visitors.pyx":262 + * o.children = NULL + * o.file_ind = self.nfinest[0] + * o.domain = 1 # <<<<<<<<<<<<<< + * self.nfinest[0] += 1 + * elif self.ref_mask[self.index] > 0: */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; + __pyx_v_o->domain = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr - * + /* "yt/geometry/oct_visitors.pyx":263 + * o.file_ind = self.nfinest[0] + * o.domain = 1 + * self.nfinest[0] += 1 # <<<<<<<<<<<<<< + * elif self.ref_mask[self.index] > 0: + * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: */ - Py_XDECREF(__pyx_v_arr->base); + __pyx_t_3 = 0; + (__pyx_v_self->nfinest[__pyx_t_3]) = ((__pyx_v_self->nfinest[__pyx_t_3]) + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): + /* "yt/geometry/oct_visitors.pyx":259 + * # We only want to do this once. Otherwise we end up with way too many + * # nfinest for our tastes. + * if o.file_ind == -1: # <<<<<<<<<<<<<< + * o.children = NULL + * o.file_ind = self.nfinest[0] */ - __pyx_v_arr->base = __pyx_v_baseptr; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + /* "yt/geometry/oct_visitors.pyx":256 + * cdef int i, ii + * ii = cind(self.ind[0], self.ind[1], self.ind[2]) + * if self.ref_mask[self.index] == 0: # <<<<<<<<<<<<<< + * # We only want to do this once. Otherwise we end up with way too many + * # nfinest for our tastes. */ + goto __pyx_L3; + } - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} + /* "yt/geometry/oct_visitors.pyx":264 + * o.domain = 1 + * self.nfinest[0] += 1 + * elif self.ref_mask[self.index] > 0: # <<<<<<<<<<<<<< + * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: + * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" + */ + __pyx_t_4 = __pyx_v_self->__pyx_base.index; + __pyx_t_2 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->ref_mask.data + __pyx_t_4 * __pyx_v_self->ref_mask.strides[0]) ))) > 0) != 0); + if (__pyx_t_2) { -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + /* "yt/geometry/oct_visitors.pyx":265 + * self.nfinest[0] += 1 + * elif self.ref_mask[self.index] > 0: + * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: # <<<<<<<<<<<<<< + * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" + * raise RuntimeError */ + __pyx_t_5 = __pyx_v_self->__pyx_base.index; + __pyx_t_6 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->ref_mask.data + __pyx_t_5 * __pyx_v_self->ref_mask.strides[0]) ))) != 1) != 0); + if (__pyx_t_6) { + } else { + __pyx_t_2 = __pyx_t_6; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_7 = __pyx_v_self->__pyx_base.index; + __pyx_t_6 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->ref_mask.data + __pyx_t_7 * __pyx_v_self->ref_mask.strides[0]) ))) != 8) != 0); + __pyx_t_2 = __pyx_t_6; + __pyx_L6_bool_binop_done:; + if (__pyx_t_2) { -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); + /* "yt/geometry/oct_visitors.pyx":266 + * elif self.ref_mask[self.index] > 0: + * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: + * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" # <<<<<<<<<<<<<< + * raise RuntimeError + * if o.children == NULL: + */ + __pyx_t_8 = __pyx_v_self->__pyx_base.index; + __pyx_t_9 = __Pyx_PyInt_From_npy_uint8((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->ref_mask.data + __pyx_t_8 * __pyx_v_self->ref_mask.strides[0]) )))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_kp_s_ARRAY_CLUE); + __Pyx_GIVEREF(__pyx_kp_s_ARRAY_CLUE); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_s_ARRAY_CLUE); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); + __Pyx_INCREF(__pyx_n_s_UNKNOWN); + __Pyx_GIVEREF(__pyx_n_s_UNKNOWN); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_n_s_UNKNOWN); + __pyx_t_9 = 0; + if (__Pyx_Print(0, __pyx_t_10, 1) < 0) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: + /* "yt/geometry/oct_visitors.pyx":267 + * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: + * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" + * raise RuntimeError # <<<<<<<<<<<<<< + * if o.children == NULL: + * o.children = malloc(sizeof(Oct *) * 8) */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { + __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); + __PYX_ERR(0, 267, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base + /* "yt/geometry/oct_visitors.pyx":265 + * self.nfinest[0] += 1 + * elif self.ref_mask[self.index] > 0: + * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: # <<<<<<<<<<<<<< + * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" + * raise RuntimeError */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: + /* "yt/geometry/oct_visitors.pyx":268 + * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" + * raise RuntimeError + * if o.children == NULL: # <<<<<<<<<<<<<< + * o.children = malloc(sizeof(Oct *) * 8) + * for i in range(8): */ - } + __pyx_t_2 = ((__pyx_v_o->children == NULL) != 0); + if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - * - * + /* "yt/geometry/oct_visitors.pyx":269 + * raise RuntimeError + * if o.children == NULL: + * o.children = malloc(sizeof(Oct *) * 8) # <<<<<<<<<<<<<< + * for i in range(8): + * o.children[i] = NULL */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } + __pyx_v_o->children = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **)malloc(((sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)) * 8))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + /* "yt/geometry/oct_visitors.pyx":270 + * if o.children == NULL: + * o.children = malloc(sizeof(Oct *) * 8) + * for i in range(8): # <<<<<<<<<<<<<< + * o.children[i] = NULL + * for i in range(8): */ + for (__pyx_t_11 = 0; __pyx_t_11 < 8; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "yt/geometry/oct_visitors.pyx":271 + * o.children = malloc(sizeof(Oct *) * 8) + * for i in range(8): + * o.children[i] = NULL # <<<<<<<<<<<<<< + * for i in range(8): + * o.children[ii + i] = &self.octs[self.nocts[0]] + */ + (__pyx_v_o->children[__pyx_v_i]) = NULL; + } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "yt/geometry/oct_visitors.pyx":268 + * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" + * raise RuntimeError + * if o.children == NULL: # <<<<<<<<<<<<<< + * o.children = malloc(sizeof(Oct *) * 8) + * for i in range(8): */ + } -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); + /* "yt/geometry/oct_visitors.pyx":272 + * for i in range(8): + * o.children[i] = NULL + * for i in range(8): # <<<<<<<<<<<<<< + * o.children[ii + i] = &self.octs[self.nocts[0]] + * o.children[ii + i].domain_ind = self.nocts[0] + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 8; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/geometry/oct_visitors.pyx":273 + * o.children[i] = NULL + * for i in range(8): + * o.children[ii + i] = &self.octs[self.nocts[0]] # <<<<<<<<<<<<<< + * o.children[ii + i].domain_ind = self.nocts[0] + * o.children[ii + i].file_ind = -1 */ - { - __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:*/ { + (__pyx_v_o->children[(__pyx_v_ii + __pyx_v_i)]) = (&(__pyx_v_self->octs[(__pyx_v_self->nocts[0])])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/geometry/oct_visitors.pyx":274 + * for i in range(8): + * o.children[ii + i] = &self.octs[self.nocts[0]] + * o.children[ii + i].domain_ind = self.nocts[0] # <<<<<<<<<<<<<< + * o.children[ii + i].file_ind = -1 + * o.children[ii + i].domain = -1 */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + (__pyx_v_o->children[(__pyx_v_ii + __pyx_v_i)])->domain_ind = (__pyx_v_self->nocts[0]); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/geometry/oct_visitors.pyx":275 + * o.children[ii + i] = &self.octs[self.nocts[0]] + * o.children[ii + i].domain_ind = self.nocts[0] + * o.children[ii + i].file_ind = -1 # <<<<<<<<<<<<<< + * o.children[ii + i].domain = -1 + * o.children[ii + i].children = NULL */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + (__pyx_v_o->children[(__pyx_v_ii + __pyx_v_i)])->file_ind = -1LL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") - * + /* "yt/geometry/oct_visitors.pyx":276 + * o.children[ii + i].domain_ind = self.nocts[0] + * o.children[ii + i].file_ind = -1 + * o.children[ii + i].domain = -1 # <<<<<<<<<<<<<< + * o.children[ii + i].children = NULL + * self.nocts[0] += 1 */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + (__pyx_v_o->children[(__pyx_v_ii + __pyx_v_i)])->domain = -1LL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: + /* "yt/geometry/oct_visitors.pyx":277 + * o.children[ii + i].file_ind = -1 + * o.children[ii + i].domain = -1 + * o.children[ii + i].children = NULL # <<<<<<<<<<<<<< + * self.nocts[0] += 1 + * else: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) + (__pyx_v_o->children[(__pyx_v_ii + __pyx_v_i)])->children = NULL; + + /* "yt/geometry/oct_visitors.pyx":278 + * o.children[ii + i].domain = -1 + * o.children[ii + i].children = NULL + * self.nocts[0] += 1 # <<<<<<<<<<<<<< + * else: + * print "SOMETHING IS AMISS", self.index + */ + __pyx_t_3 = 0; + (__pyx_v_self->nocts[__pyx_t_3]) = ((__pyx_v_self->nocts[__pyx_t_3]) + 1); } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/geometry/oct_visitors.pyx":264 + * o.domain = 1 + * self.nfinest[0] += 1 + * elif self.ref_mask[self.index] > 0: # <<<<<<<<<<<<<< + * if self.ref_mask[self.index] != 1 and self.ref_mask[self.index] != 8: + * print "ARRAY CLUE: ", self.ref_mask[self.index], "UNKNOWN" */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + goto __pyx_L3; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "yt/geometry/oct_visitors.pyx":280 + * self.nocts[0] += 1 + * else: + * print "SOMETHING IS AMISS", self.index # <<<<<<<<<<<<<< + * raise RuntimeError + * self.index += 1 + */ + /*else*/ { + __pyx_t_10 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_kp_s_SOMETHING_IS_AMISS); + __Pyx_GIVEREF(__pyx_kp_s_SOMETHING_IS_AMISS); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_s_SOMETHING_IS_AMISS); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); + __pyx_t_10 = 0; + if (__Pyx_Print(0, __pyx_t_9, 1) < 0) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "yt/geometry/oct_visitors.pyx":281 + * else: + * print "SOMETHING IS AMISS", self.index + * raise RuntimeError # <<<<<<<<<<<<<< + * self.index += 1 + */ + __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); + __PYX_ERR(0, 281, __pyx_L1_error) + } + __pyx_L3:; + + /* "yt/geometry/oct_visitors.pyx":282 + * print "SOMETHING IS AMISS", self.index + * raise RuntimeError + * self.index += 1 # <<<<<<<<<<<<<< + */ + __pyx_v_self->__pyx_base.index = (__pyx_v_self->__pyx_base.index + 1); + + /* "yt/geometry/oct_visitors.pyx":253 + * @cython.boundscheck(False) + * @cython.initializedcheck(False) + * cdef void visit(self, Oct* o, np.uint8_t selected): # <<<<<<<<<<<<<< + * cdef int i, ii + * ii = cind(self.ind[0], self.ind[1], self.ind[2]) */ /* 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_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("yt.geometry.oct_visitors.LoadOctree.visit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ -static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { - int __pyx_r; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_10LoadOctree_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_10LoadOctree_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_2yt_8geometry_12oct_visitors_10LoadOctree___reduce_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_10LoadOctree___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_v_self) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_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); + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") */ - { - __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:*/ { + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, 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) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_visitors.LoadOctree.__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.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_ufunc() except -1: - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_10LoadOctree_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_10LoadOctree_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_2yt_8geometry_12oct_visitors_10LoadOctree_2__setstate_cython__(((struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { - int __pyx_r; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_10LoadOctree_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; __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); + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "(tree fragment)":4 + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - { - __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:*/ { + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, 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) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.oct_visitors.LoadOctree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") +/* "(tree fragment)":1 + * def __pyx_unpickle_OctVisitor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_1__pyx_unpickle_OctVisitor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_1__pyx_unpickle_OctVisitor = {"__pyx_unpickle_OctVisitor", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_1__pyx_unpickle_OctVisitor, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_1__pyx_unpickle_OctVisitor(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_OctVisitor (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_OctVisitor", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_OctVisitor", 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_OctVisitor") < 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); } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + __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]; } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_OctVisitor", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_OctVisitor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors___pyx_unpickle_OctVisitor(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* 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; } -/* "selection_routines.pxd":26 - * np.float64_t - * - * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): - */ - -static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) { +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors___pyx_unpickle_OctVisitor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_ensure_code", 0); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("__pyx_unpickle_OctVisitor", 0); - /* "selection_routines.pxd":27 - * - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): # <<<<<<<<<<<<<< - * if "code_length" == str(arr.units): - * return arr + /* "(tree fragment)":2 + * def __pyx_unpickle_OctVisitor(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x047358e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 27, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x047358e) != 0); + if (__pyx_t_1) { - /* "selection_routines.pxd":28 - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< - * return arr - * arr.convert_to_units("code_length") + /* "(tree fragment)":3 + * def __pyx_unpickle_OctVisitor(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = OctVisitor.__new__(__pyx_type) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 28, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 28, __pyx_L1_error) + __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_4); __pyx_t_4 = 0; - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 28, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "selection_routines.pxd":29 - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): - * return arr # <<<<<<<<<<<<<< - * arr.convert_to_units("code_length") - * return arr + /* "(tree fragment)":4 + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = OctVisitor.__new__(__pyx_type) + * if __pyx_state is not None: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_arr); - __pyx_r = __pyx_v_arr; - goto __pyx_L0; + __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_0x04, __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_PickleError); + __pyx_t_2 = __pyx_v_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) - /* "selection_routines.pxd":28 - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< - * return arr - * arr.convert_to_units("code_length") + /* "(tree fragment)":2 + * def __pyx_unpickle_OctVisitor(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x047358e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = OctVisitor.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_OctVisitor__set_state( result, __pyx_state) */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor), __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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "selection_routines.pxd":30 - * if "code_length" == str(arr.units): - * return arr - * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< - * return arr - * + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = OctVisitor.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_OctVisitor__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = OctVisitor.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_OctVisitor__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_OctVisitor__set_state(OctVisitor result, tuple __pyx_state): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 30, __pyx_L1_error) + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_OctVisitor__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "selection_routines.pxd":27 - * - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): # <<<<<<<<<<<<<< - * if "code_length" == str(arr.units): - * return arr + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = OctVisitor.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_OctVisitor__set_state( result, __pyx_state) + * return result */ } - /* "selection_routines.pxd":31 - * return arr - * arr.convert_to_units("code_length") - * return arr # <<<<<<<<<<<<<< - * - * cdef class SelectorObject: + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_OctVisitor__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_OctVisitor__set_state(OctVisitor result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_arr); - __pyx_r = __pyx_v_arr; + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "selection_routines.pxd":26 - * np.float64_t - * - * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): + /* "(tree fragment)":1 + * def __pyx_unpickle_OctVisitor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError */ /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_OctVisitor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "selection_routines.pxd":78 - * cdef public np.int64_t domain_id - * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 +/* "(tree fragment)":9 + * __pyx_unpickle_OctVisitor__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_OctVisitor__set_state(OctVisitor result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) { - __pyx_t_5numpy_float64_t __pyx_v_rel; - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_OctVisitor__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __pyx_t_5numpy_int32_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5[3]; + __pyx_t_5numpy_uint64_t __pyx_t_6; + __pyx_t_5numpy_int8_t __pyx_t_7; + __pyx_t_5numpy_int64_t __pyx_t_8[3]; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_OctVisitor__set_state", 0); - /* "selection_routines.pxd":80 - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< - * if not periodic: return rel - * if rel > dw * 0.5: - */ - __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_OctVisitor__set_state(OctVisitor result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[10]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_5, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->ind[0]), __pyx_t_5, sizeof(__pyx_v_result->ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->last = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->level = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->oref = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_8, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->pos[0]), __pyx_t_8, sizeof(__pyx_v_result->pos[0]) * (3)); - /* "selection_routines.pxd":81 - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel # <<<<<<<<<<<<<< - * if rel > dw * 0.5: - * rel -= dw + /* "(tree fragment)":11 + * cdef __pyx_unpickle_OctVisitor__set_state(OctVisitor result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[10]) + */ + __pyx_t_9 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[10]) # <<<<<<<<<<<<<< + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_update); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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_11 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + if (!__pyx_t_13) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_12)) { + PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_11}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { + PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_11}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + { + __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL; + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_OctVisitor__set_state(OctVisitor result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[10]) */ - __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_rel; - goto __pyx_L0; } - /* "selection_routines.pxd":82 - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel - * if rel > dw * 0.5: # <<<<<<<<<<<<<< - * rel -= dw - * elif rel < -dw * 0.5: + /* "(tree fragment)":9 + * __pyx_unpickle_OctVisitor__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_OctVisitor__set_state(OctVisitor result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): */ - __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0); - if (__pyx_t_1) { - /* "selection_routines.pxd":83 - * if not periodic: return rel - * if rel > dw * 0.5: - * rel -= dw # <<<<<<<<<<<<<< - * elif rel < -dw * 0.5: - * rel += dw - */ - __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw); + /* 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_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_OctVisitor__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "selection_routines.pxd":82 - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel - * if rel > dw * 0.5: # <<<<<<<<<<<<<< - * rel -= dw - * elif rel < -dw * 0.5: - */ - goto __pyx_L4; - } - - /* "selection_routines.pxd":84 - * if rel > dw * 0.5: - * rel -= dw - * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< - * rel += dw - * return rel - */ - __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0); - if (__pyx_t_1) { - - /* "selection_routines.pxd":85 - * rel -= dw - * elif rel < -dw * 0.5: - * rel += dw # <<<<<<<<<<<<<< - * return rel - */ - __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw); - - /* "selection_routines.pxd":84 - * if rel > dw * 0.5: - * rel -= dw - * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< - * rel += dw - * return rel - */ - } - __pyx_L4:; - - /* "selection_routines.pxd":86 - * elif rel < -dw * 0.5: - * rel += dw - * return rel # <<<<<<<<<<<<<< - */ - __pyx_r = __pyx_v_rel; - goto __pyx_L0; - - /* "selection_routines.pxd":78 - * cdef public np.int64_t domain_id - * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "View.MemoryView":120 - * cdef bint dtype_is_object - * - * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< - * mode="c", bint allocate_buffer=True): - * +/* "(tree fragment)":1 + * def __pyx_unpickle_CopyArrayI64(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x5d05d98: + * from pickle import PickleError */ /* 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; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_3__pyx_unpickle_CopyArrayI64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_3__pyx_unpickle_CopyArrayI64 = {"__pyx_unpickle_CopyArrayI64", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_3__pyx_unpickle_CopyArrayI64, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_3__pyx_unpickle_CopyArrayI64(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("__cinit__ (wrapper)", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_CopyArrayI64 (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); + 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 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CopyArrayI64", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(3, 120, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); - if (value) { values[4] = value; kw_args--; } + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CopyArrayI64", 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, "__cinit__") < 0)) __PYX_ERR(3, 120, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_CopyArrayI64") < 0)) __PYX_ERR(1, 1, __pyx_L3_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(3, 120, __pyx_L3_error) - __pyx_v_format = values[2]; - __pyx_v_mode = values[3]; - if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 121, __pyx_L3_error) + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; } else { - - /* "View.MemoryView":121 - * - * 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); + 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("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CopyArrayI64", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_CopyArrayI64", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); - return -1; + return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(3, 120, __pyx_L1_error) - if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(3, 120, __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":120 - * cdef bint dtype_is_object - * - * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< - * mode="c", bint allocate_buffer=True): - * - */ + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_2__pyx_unpickle_CopyArrayI64(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* 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; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_2__pyx_unpickle_CopyArrayI64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - int __pyx_t_2; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; + PyObject *__pyx_t_6 = NULL; int __pyx_t_7; - Py_ssize_t __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - __Pyx_RefNannySetupContext("__cinit__", 0); - __Pyx_INCREF(__pyx_v_format); - - /* "View.MemoryView":127 - * 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(3, 127, __pyx_L1_error) - } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 127, __pyx_L1_error) - __pyx_v_self->ndim = ((int)__pyx_t_1); - - /* "View.MemoryView":128 - * - * self.ndim = len(shape) - * self.itemsize = itemsize # <<<<<<<<<<<<<< - * - * if not self.ndim: - */ - __pyx_v_self->itemsize = __pyx_v_itemsize; + __Pyx_RefNannySetupContext("__pyx_unpickle_CopyArrayI64", 0); - /* "View.MemoryView":130 - * self.itemsize = itemsize - * - * if not self.ndim: # <<<<<<<<<<<<<< - * raise ValueError("Empty shape tuple for cython.array") - * + /* "(tree fragment)":2 + * def __pyx_unpickle_CopyArrayI64(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x5d05d98: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) */ - __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x5d05d98) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":131 - * - * if not self.ndim: - * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< - * - * if itemsize <= 0: + /* "(tree fragment)":3 + * def __pyx_unpickle_CopyArrayI64(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x5d05d98: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) + * result = CopyArrayI64.__new__(__pyx_type) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 131, __pyx_L1_error) + __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_Raise(__pyx_t_3, 0, 0, 0); + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 131, __pyx_L1_error) - - /* "View.MemoryView":130 - * self.itemsize = itemsize - * - * if not self.ndim: # <<<<<<<<<<<<<< - * raise ValueError("Empty shape tuple for cython.array") - * - */ - } - - /* "View.MemoryView":133 - * raise ValueError("Empty shape tuple for cython.array") - * - * if itemsize <= 0: # <<<<<<<<<<<<<< - * raise ValueError("itemsize <= 0 for cython.array") - * - */ - __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":134 - * - * if itemsize <= 0: - * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< - * - * if not isinstance(format, bytes): + /* "(tree fragment)":4 + * if __pyx_checksum != 0x5d05d98: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = CopyArrayI64.__new__(__pyx_type) + * if __pyx_state is not None: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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_0x5d, __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_PickleError); + __pyx_t_2 = __pyx_v_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(3, 134, __pyx_L1_error) + __PYX_ERR(1, 4, __pyx_L1_error) - /* "View.MemoryView":133 - * raise ValueError("Empty shape tuple for cython.array") - * - * if itemsize <= 0: # <<<<<<<<<<<<<< - * raise ValueError("itemsize <= 0 for cython.array") - * + /* "(tree fragment)":2 + * def __pyx_unpickle_CopyArrayI64(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x5d05d98: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) */ } - /* "View.MemoryView":136 - * raise ValueError("itemsize <= 0 for cython.array") - * - * if not isinstance(format, bytes): # <<<<<<<<<<<<<< - * format = format.encode('ASCII') - * self._format = format # keep a reference to the byte string + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) + * result = CopyArrayI64.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_CopyArrayI64__set_state( result, __pyx_state) */ - __pyx_t_2 = PyBytes_Check(__pyx_v_format); - __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); - if (__pyx_t_4) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64), __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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "View.MemoryView":137 - * - * if not isinstance(format, bytes): - * format = format.encode('ASCII') # <<<<<<<<<<<<<< - * self._format = format # keep a reference to the byte string - * self.format = self._format + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) + * result = CopyArrayI64.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_CopyArrayI64__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = CopyArrayI64.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_CopyArrayI64__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_CopyArrayI64__set_state(CopyArrayI64 result, tuple __pyx_state): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 137, __pyx_L1_error) + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_CopyArrayI64__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *)__pyx_v_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); - __pyx_t_5 = 0; - /* "View.MemoryView":136 - * raise ValueError("itemsize <= 0 for cython.array") - * - * if not isinstance(format, bytes): # <<<<<<<<<<<<<< - * format = format.encode('ASCII') - * self._format = format # keep a reference to the byte string + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) + * result = CopyArrayI64.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_CopyArrayI64__set_state( result, __pyx_state) + * return result */ } - /* "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 - * + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_CopyArrayI64__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_CopyArrayI64__set_state(CopyArrayI64 result, tuple __pyx_state): + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] */ - 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(3, 138, __pyx_L1_error) - __pyx_t_5 = __pyx_v_format; - __Pyx_INCREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_v_self->_format); - __Pyx_DECREF(__pyx_v_self->_format); - __pyx_v_self->_format = ((PyObject*)__pyx_t_5); - __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; - /* "View.MemoryView":139 - * format = format.encode('ASCII') - * self._format = format # keep a reference to the byte string - * self.format = self._format # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":1 + * def __pyx_unpickle_CopyArrayI64(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x5d05d98: + * from pickle import PickleError */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 139, __pyx_L1_error) - __pyx_v_self->format = __pyx_t_6; - /* "View.MemoryView":142 - * - * - * 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))); + /* 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("yt.geometry.oct_visitors.__pyx_unpickle_CopyArrayI64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":143 - * - * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) - * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< - * - * if not self._shape: +/* "(tree fragment)":9 + * __pyx_unpickle_CopyArrayI64__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CopyArrayI64__set_state(CopyArrayI64 result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] + * if hasattr(result, '__dict__'): */ - __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); - /* "View.MemoryView":145 - * self._strides = self._shape + self.ndim - * - * if not self._shape: # <<<<<<<<<<<<<< - * raise MemoryError("unable to allocate shape and strides.") - * - */ - __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); - if (__pyx_t_4) { +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_CopyArrayI64__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *__pyx_v_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 } }; + int __pyx_t_3; + __pyx_t_5numpy_int32_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + __pyx_t_5numpy_uint8_t __pyx_t_6[3]; + __pyx_t_5numpy_uint64_t __pyx_t_7; + __pyx_t_5numpy_int8_t __pyx_t_8; + __pyx_t_5numpy_int64_t __pyx_t_9[3]; + __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_CopyArrayI64__set_state", 0); - /* "View.MemoryView":146 - * - * if not self._shape: - * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 146, __pyx_L1_error) + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_CopyArrayI64__set_state(CopyArrayI64 result, tuple __pyx_state): + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[12]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_t_1); + if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->dest, 0); + __pyx_v_result->dest = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_5 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_6, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_6, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __pyx_t_8; + 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, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __pyx_t_8; + 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, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_9, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_9, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsdsds_nn___pyx_t_5numpy_int64_t(__pyx_t_1); + if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->source, 0); + __pyx_v_result->source = __pyx_t_10; + __pyx_t_10.memview = NULL; + __pyx_t_10.data = NULL; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_CopyArrayI64__set_state(CopyArrayI64 result, tuple __pyx_state): + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[12]) + */ + __pyx_t_11 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + /* "(tree fragment)":12 + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[12]) # <<<<<<<<<<<<<< + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_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 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, function); + } + } + if (!__pyx_t_15) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_14)) { + PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_13}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) { + PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_13}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } else + #endif + { + __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL; + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } + } + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":145 - * self._strides = self._shape + self.ndim - * - * if not self._shape: # <<<<<<<<<<<<<< - * raise MemoryError("unable to allocate shape and strides.") - * + /* "(tree fragment)":11 + * cdef __pyx_unpickle_CopyArrayI64__set_state(CopyArrayI64 result, tuple __pyx_state): + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[12]) */ } - /* "View.MemoryView":149 - * - * - * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< - * if dim <= 0: - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + /* "(tree fragment)":9 + * __pyx_unpickle_CopyArrayI64__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CopyArrayI64__set_state(CopyArrayI64 result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] + * if hasattr(result, '__dict__'): */ - __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(3, 149, __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(3, 149, __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(3, 149, __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":150 - * - * for idx, dim in enumerate(shape): - * if dim <= 0: # <<<<<<<<<<<<<< - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) - * self._shape[idx] = dim - */ - __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); - if (__pyx_t_4) { + /* 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_XDEC_MEMVIEW(&__pyx_t_10, 1); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_CopyArrayI64__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "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 - * +/* "(tree fragment)":1 + * def __pyx_unpickle_CopyArrayF64(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x5d05d98: + * from pickle import PickleError */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 151, __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(3, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(3, 151, __pyx_L1_error) - /* "View.MemoryView":150 - * - * for idx, dim in enumerate(shape): - * if dim <= 0: # <<<<<<<<<<<<<< - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) - * self._shape[idx] = dim - */ +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_5__pyx_unpickle_CopyArrayF64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_5__pyx_unpickle_CopyArrayF64 = {"__pyx_unpickle_CopyArrayF64", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_5__pyx_unpickle_CopyArrayF64, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_5__pyx_unpickle_CopyArrayF64(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_CopyArrayF64 (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CopyArrayF64", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CopyArrayF64", 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_CopyArrayF64") < 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_CopyArrayF64", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_CopyArrayF64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_4__pyx_unpickle_CopyArrayF64(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); - /* "View.MemoryView":152 - * 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; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":149 - * - * - * 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; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_4__pyx_unpickle_CopyArrayF64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_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_CopyArrayF64", 0); - /* "View.MemoryView":155 - * - * cdef char order - * if mode == 'fortran': # <<<<<<<<<<<<<< - * order = b'F' - * self.mode = u'fortran' + /* "(tree fragment)":2 + * def __pyx_unpickle_CopyArrayF64(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x5d05d98: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) */ - __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 155, __pyx_L1_error) - if (__pyx_t_4) { + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x5d05d98) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":156 - * cdef char order - * if mode == 'fortran': - * order = b'F' # <<<<<<<<<<<<<< - * self.mode = u'fortran' - * elif mode == 'c': + /* "(tree fragment)":3 + * def __pyx_unpickle_CopyArrayF64(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x5d05d98: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) + * result = CopyArrayF64.__new__(__pyx_type) */ - __pyx_v_order = 'F'; + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":157 - * if mode == 'fortran': - * order = b'F' - * self.mode = u'fortran' # <<<<<<<<<<<<<< - * elif mode == 'c': - * order = b'C' + /* "(tree fragment)":4 + * if __pyx_checksum != 0x5d05d98: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = CopyArrayF64.__new__(__pyx_type) + * if __pyx_state is not None: */ - __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; + __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_0x5d, __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_PickleError); + __pyx_t_2 = __pyx_v_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) - /* "View.MemoryView":155 - * - * cdef char order - * if mode == 'fortran': # <<<<<<<<<<<<<< - * order = b'F' - * self.mode = u'fortran' + /* "(tree fragment)":2 + * def __pyx_unpickle_CopyArrayF64(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x5d05d98: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) */ - goto __pyx_L10; } - /* "View.MemoryView":158 - * order = b'F' - * self.mode = u'fortran' - * elif mode == 'c': # <<<<<<<<<<<<<< - * order = b'C' - * self.mode = u'c' - */ - __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 158, __pyx_L1_error) - if (__pyx_t_4) { - - /* "View.MemoryView":159 - * self.mode = u'fortran' - * elif mode == 'c': - * order = b'C' # <<<<<<<<<<<<<< - * self.mode = u'c' - * else: + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) + * result = CopyArrayF64.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_CopyArrayF64__set_state( result, __pyx_state) */ - __pyx_v_order = 'C'; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64), __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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "View.MemoryView":160 - * elif mode == 'c': - * order = b'C' - * self.mode = u'c' # <<<<<<<<<<<<<< - * else: - * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) + * result = CopyArrayF64.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_CopyArrayF64__set_state( result, __pyx_state) + * return result */ - __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; + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "View.MemoryView":158 - * order = b'F' - * self.mode = u'fortran' - * elif mode == 'c': # <<<<<<<<<<<<<< - * order = b'C' - * self.mode = u'c' + /* "(tree fragment)":7 + * result = CopyArrayF64.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_CopyArrayF64__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_CopyArrayF64__set_state(CopyArrayF64 result, tuple __pyx_state): */ - goto __pyx_L10; - } + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_CopyArrayF64__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *)__pyx_v_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; - /* "View.MemoryView":162 - * self.mode = u'c' - * else: - * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< - * - * self.len = fill_contig_strides_array(self._shape, self._strides, + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x5d05d98 = (dest, dims, domain, global_index, ind, index, last, level, nz, oref, pos, source))" % __pyx_checksum) + * result = CopyArrayF64.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_CopyArrayF64__set_state( result, __pyx_state) + * return result */ - /*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(3, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 162, __pyx_L1_error) } - __pyx_L10:; - /* "View.MemoryView":164 - * 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) - * + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_CopyArrayF64__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_CopyArrayF64__set_state(CopyArrayF64 result, tuple __pyx_state): + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] */ - __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); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; - /* "View.MemoryView":167 - * itemsize, self.ndim, order) - * - * self.free_data = allocate_buffer # <<<<<<<<<<<<<< - * self.dtype_is_object = format == b'O' - * if allocate_buffer: + /* "(tree fragment)":1 + * def __pyx_unpickle_CopyArrayF64(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x5d05d98: + * from pickle import PickleError */ - __pyx_v_self->free_data = __pyx_v_allocate_buffer; - /* "View.MemoryView":168 - * - * self.free_data = allocate_buffer - * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< - * if allocate_buffer: - * - */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 168, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_self->dtype_is_object = __pyx_t_4; - - /* "View.MemoryView":169 - * 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":172 - * - * - * 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)); + /* 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("yt.geometry.oct_visitors.__pyx_unpickle_CopyArrayF64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":173 - * - * self.data = malloc(self.len) - * if not self.data: # <<<<<<<<<<<<<< - * raise MemoryError("unable to allocate array data.") - * +/* "(tree fragment)":9 + * __pyx_unpickle_CopyArrayF64__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CopyArrayF64__set_state(CopyArrayF64 result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] + * if hasattr(result, '__dict__'): */ - __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); - if (__pyx_t_4) { - /* "View.MemoryView":174 - * self.data = malloc(self.len) - * if not self.data: - * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< - * - * if self.dtype_is_object: - */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 174, __pyx_L1_error) +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_CopyArrayF64__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *__pyx_v_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 } }; + int __pyx_t_3; + __pyx_t_5numpy_int32_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + __pyx_t_5numpy_uint8_t __pyx_t_6[3]; + __pyx_t_5numpy_uint64_t __pyx_t_7; + __pyx_t_5numpy_int8_t __pyx_t_8; + __pyx_t_5numpy_int64_t __pyx_t_9[3]; + __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_CopyArrayF64__set_state", 0); - /* "View.MemoryView":173 - * - * self.data = malloc(self.len) - * if not self.data: # <<<<<<<<<<<<<< - * raise MemoryError("unable to allocate array data.") - * - */ + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_CopyArrayF64__set_state(CopyArrayF64 result, tuple __pyx_state): + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[12]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); + if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->dest, 0); + __pyx_v_result->dest = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_5 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_6, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_6, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __pyx_t_8; + 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, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __pyx_t_8; + 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, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_9, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_9, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); + if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->source, 0); + __pyx_v_result->source = __pyx_t_10; + __pyx_t_10.memview = NULL; + __pyx_t_10.data = NULL; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_CopyArrayF64__set_state(CopyArrayF64 result, tuple __pyx_state): + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[12]) + */ + __pyx_t_11 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + /* "(tree fragment)":12 + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[12]) # <<<<<<<<<<<<<< + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_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) } - - /* "View.MemoryView":176 - * 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":177 - * - * 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":178 - * 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(3, 178, __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(3, 178, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, function); } - __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; - - /* "View.MemoryView":179 - * 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":180 - * for i in range(self.len / itemsize): - * p[i] = Py_None - * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * - * @cname('getbuffer') - */ - Py_INCREF(Py_None); + } + if (!__pyx_t_15) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_14)) { + PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_13}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) { + PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_13}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } else + #endif + { + __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL; + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } - - /* "View.MemoryView":176 - * raise MemoryError("unable to allocate array data.") - * - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * p = self.data - * for i in range(self.len / itemsize): - */ } + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":169 - * self.free_data = allocate_buffer - * self.dtype_is_object = format == b'O' - * if allocate_buffer: # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":11 + * cdef __pyx_unpickle_CopyArrayF64__set_state(CopyArrayF64 result, tuple __pyx_state): + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[12]) */ } - /* "View.MemoryView":120 - * cdef bint dtype_is_object - * - * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< - * mode="c", bint allocate_buffer=True): - * + /* "(tree fragment)":9 + * __pyx_unpickle_CopyArrayF64__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CopyArrayF64__set_state(CopyArrayF64 result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] + * if hasattr(result, '__dict__'): */ /* function exit code */ - __pyx_r = 0; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); 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_XDECREF(__pyx_t_1); + __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_CopyArrayF64__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_format); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":183 - * - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< - * cdef int bufmode = -1 - * if self.mode == u"c": +/* "(tree fragment)":1 + * def __pyx_unpickle_CountTotalOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError */ /* 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; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_7__pyx_unpickle_CountTotalOcts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_7__pyx_unpickle_CountTotalOcts = {"__pyx_unpickle_CountTotalOcts", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_7__pyx_unpickle_CountTotalOcts, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_7__pyx_unpickle_CountTotalOcts(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 - 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; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "View.MemoryView":184 - * @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; + __Pyx_RefNannySetupContext("__pyx_unpickle_CountTotalOcts (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CountTotalOcts", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CountTotalOcts", 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_CountTotalOcts") < 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_CountTotalOcts", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_CountTotalOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_6__pyx_unpickle_CountTotalOcts(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); - /* "View.MemoryView":185 - * def __getbuffer__(self, Py_buffer *info, int flags): - * cdef int bufmode = -1 - * if self.mode == u"c": # <<<<<<<<<<<<<< - * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * elif self.mode == u"fortran": - */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 185, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":186 - * 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 +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_6__pyx_unpickle_CountTotalOcts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_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_CountTotalOcts", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_CountTotalOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x047358e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x047358e) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":185 - * def __getbuffer__(self, Py_buffer *info, int flags): - * cdef int bufmode = -1 - * if self.mode == u"c": # <<<<<<<<<<<<<< - * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * elif self.mode == u"fortran": + /* "(tree fragment)":3 + * def __pyx_unpickle_CountTotalOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = CountTotalOcts.__new__(__pyx_type) */ - goto __pyx_L3; - } + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":187 - * if self.mode == u"c": - * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * elif self.mode == u"fortran": # <<<<<<<<<<<<<< - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): + /* "(tree fragment)":4 + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = CountTotalOcts.__new__(__pyx_type) + * if __pyx_state is not None: */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 187, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { + __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_0x04, __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_PickleError); + __pyx_t_2 = __pyx_v_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) - /* "View.MemoryView":188 - * 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.") + /* "(tree fragment)":2 + * def __pyx_unpickle_CountTotalOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x047358e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + } - /* "View.MemoryView":187 - * if self.mode == u"c": - * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * elif self.mode == u"fortran": # <<<<<<<<<<<<<< - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = CountTotalOcts.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_CountTotalOcts__set_state( result, __pyx_state) */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts), __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); + } } - __pyx_L3:; + 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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "View.MemoryView":189 - * elif self.mode == u"fortran": - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): # <<<<<<<<<<<<<< - * raise ValueError("Can only create a buffer that is contiguous in memory.") - * info.buf = self.data + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = CountTotalOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_CountTotalOcts__set_state( result, __pyx_state) + * return result */ - __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); - if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "View.MemoryView":190 - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): - * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< - * info.buf = self.data - * info.len = self.len + /* "(tree fragment)":7 + * result = CountTotalOcts.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_CountTotalOcts__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_CountTotalOcts__set_state(CountTotalOcts result, tuple __pyx_state): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 190, __pyx_L1_error) + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_CountTotalOcts__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *)__pyx_v_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __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(3, 190, __pyx_L1_error) - /* "View.MemoryView":189 - * elif self.mode == u"fortran": - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): # <<<<<<<<<<<<<< - * raise ValueError("Can only create a buffer that is contiguous in memory.") - * info.buf = self.data + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = CountTotalOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_CountTotalOcts__set_state( result, __pyx_state) + * return result */ } - /* "View.MemoryView":191 - * 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":192 - * 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 + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_CountTotalOcts__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_CountTotalOcts__set_state(CountTotalOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] */ - __pyx_t_5 = __pyx_v_self->len; - __pyx_v_info->len = __pyx_t_5; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; - /* "View.MemoryView":193 - * info.buf = self.data - * info.len = self.len - * info.ndim = self.ndim # <<<<<<<<<<<<<< - * info.shape = self._shape - * info.strides = self._strides + /* "(tree fragment)":1 + * def __pyx_unpickle_CountTotalOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError */ - __pyx_t_6 = __pyx_v_self->ndim; - __pyx_v_info->ndim = __pyx_t_6; - /* "View.MemoryView":194 - * 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; + /* 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("yt.geometry.oct_visitors.__pyx_unpickle_CountTotalOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":195 - * info.ndim = self.ndim - * info.shape = self._shape - * info.strides = self._strides # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = self.itemsize +/* "(tree fragment)":9 + * __pyx_unpickle_CountTotalOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CountTotalOcts__set_state(CountTotalOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): */ - __pyx_t_7 = __pyx_v_self->_strides; - __pyx_v_info->strides = __pyx_t_7; - /* "View.MemoryView":196 - * 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":197 - * 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":198 - * info.suboffsets = NULL - * info.itemsize = self.itemsize - * info.readonly = 0 # <<<<<<<<<<<<<< - * - * if flags & PyBUF_FORMAT: - */ - __pyx_v_info->readonly = 0; - - /* "View.MemoryView":200 - * 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":201 - * - * 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; +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_CountTotalOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __pyx_t_5numpy_int32_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5[3]; + __pyx_t_5numpy_uint64_t __pyx_t_6; + __pyx_t_5numpy_int8_t __pyx_t_7; + __pyx_t_5numpy_int64_t __pyx_t_8[3]; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_CountTotalOcts__set_state", 0); - /* "View.MemoryView":200 - * info.readonly = 0 - * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * info.format = self.format - * else: - */ - goto __pyx_L5; + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_CountTotalOcts__set_state(CountTotalOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[10]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) } - - /* "View.MemoryView":203 - * info.format = self.format - * else: - * info.format = NULL # <<<<<<<<<<<<<< - * - * info.obj = self - */ - /*else*/ { - __pyx_v_info->format = NULL; + __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(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_L5:; + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_5, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_5, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_8, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_8, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); - /* "View.MemoryView":205 - * info.format = NULL - * - * info.obj = self # <<<<<<<<<<<<<< - * - * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + /* "(tree fragment)":11 + * cdef __pyx_unpickle_CountTotalOcts__set_state(CountTotalOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[10]) + */ + __pyx_t_9 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[10]) # <<<<<<<<<<<<<< + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_update); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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_11 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + if (!__pyx_t_13) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_12)) { + PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_11}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { + PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_11}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + { + __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL; + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_CountTotalOcts__set_state(CountTotalOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[10]) */ - __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":183 - * - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< - * cdef int bufmode = -1 - * if self.mode == u"c": + /* "(tree fragment)":9 + * __pyx_unpickle_CountTotalOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CountTotalOcts__set_state(CountTotalOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): */ /* function exit code */ - __pyx_r = 0; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_CountTotalOcts__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":209 - * __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) +/* "(tree fragment)":1 + * def __pyx_unpickle_CountTotalCells(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError */ /* Python wrapper */ -static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_9__pyx_unpickle_CountTotalCells(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_9__pyx_unpickle_CountTotalCells = {"__pyx_unpickle_CountTotalCells", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_9__pyx_unpickle_CountTotalCells, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_9__pyx_unpickle_CountTotalCells(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("__dealloc__ (wrapper)", 0); - __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + __Pyx_RefNannySetupContext("__pyx_unpickle_CountTotalCells (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CountTotalCells", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CountTotalCells", 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_CountTotalCells") < 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_CountTotalCells", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_CountTotalCells", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_8__pyx_unpickle_CountTotalCells(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_8__pyx_unpickle_CountTotalCells(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; - __Pyx_RefNannySetupContext("__dealloc__", 0); + 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_CountTotalCells", 0); - /* "View.MemoryView":210 - * - * def __dealloc__(array self): - * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< - * self.callback_free_data(self.data) - * elif self.free_data: + /* "(tree fragment)":2 + * def __pyx_unpickle_CountTotalCells(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x047358e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x047358e) != 0); if (__pyx_t_1) { - /* "View.MemoryView":211 - * 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":210 - * - * def __dealloc__(array self): - * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< - * self.callback_free_data(self.data) - * elif self.free_data: + /* "(tree fragment)":3 + * def __pyx_unpickle_CountTotalCells(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = CountTotalCells.__new__(__pyx_type) */ - goto __pyx_L3; - } + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":212 - * if self.callback_free_data != NULL: - * self.callback_free_data(self.data) - * elif self.free_data: # <<<<<<<<<<<<<< - * if self.dtype_is_object: - * refcount_objects_in_slice(self.data, self._shape, + /* "(tree fragment)":4 + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = CountTotalCells.__new__(__pyx_type) + * if __pyx_state is not None: */ - __pyx_t_1 = (__pyx_v_self->free_data != 0); - if (__pyx_t_1) { + __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_0x04, __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_PickleError); + __pyx_t_2 = __pyx_v_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) - /* "View.MemoryView":213 - * self.callback_free_data(self.data) - * elif self.free_data: - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * refcount_objects_in_slice(self.data, self._shape, - * self._strides, self.ndim, False) + /* "(tree fragment)":2 + * def __pyx_unpickle_CountTotalCells(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x047358e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); - if (__pyx_t_1) { + } - /* "View.MemoryView":214 - * 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) + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = CountTotalCells.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_CountTotalCells__set_state( result, __pyx_state) */ - __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells), __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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "View.MemoryView":213 - * self.callback_free_data(self.data) - * elif self.free_data: - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * refcount_objects_in_slice(self.data, self._shape, - * self._strides, self.ndim, False) + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = CountTotalCells.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_CountTotalCells__set_state( result, __pyx_state) + * return result */ - } + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "View.MemoryView":216 - * refcount_objects_in_slice(self.data, self._shape, - * self._strides, self.ndim, False) - * free(self.data) # <<<<<<<<<<<<<< - * PyObject_Free(self._shape) - * + /* "(tree fragment)":7 + * result = CountTotalCells.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_CountTotalCells__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_CountTotalCells__set_state(CountTotalCells result, tuple __pyx_state): */ - free(__pyx_v_self->data); + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_CountTotalCells__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *)__pyx_v_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; - /* "View.MemoryView":212 - * if self.callback_free_data != NULL: - * self.callback_free_data(self.data) - * elif self.free_data: # <<<<<<<<<<<<<< - * if self.dtype_is_object: - * refcount_objects_in_slice(self.data, self._shape, + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = CountTotalCells.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_CountTotalCells__set_state( result, __pyx_state) + * return result */ } - __pyx_L3:; - /* "View.MemoryView":217 - * self._strides, self.ndim, False) - * free(self.data) - * PyObject_Free(self._shape) # <<<<<<<<<<<<<< - * - * @property + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_CountTotalCells__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_CountTotalCells__set_state(CountTotalCells result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] */ - PyObject_Free(__pyx_v_self->_shape); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; - /* "View.MemoryView":209 - * __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) + /* "(tree fragment)":1 + * def __pyx_unpickle_CountTotalCells(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x047358e: + * from pickle import 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("yt.geometry.oct_visitors.__pyx_unpickle_CountTotalCells", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "View.MemoryView":220 - * - * @property - * def memview(self): # <<<<<<<<<<<<<< - * return self.get_memview() - * +/* "(tree fragment)":9 + * __pyx_unpickle_CountTotalCells__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CountTotalCells__set_state(CountTotalCells result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): */ -/* 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) { +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_CountTotalCells__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *__pyx_v_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); + int __pyx_t_2; + __pyx_t_5numpy_int32_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5[3]; + __pyx_t_5numpy_uint64_t __pyx_t_6; + __pyx_t_5numpy_int8_t __pyx_t_7; + __pyx_t_5numpy_int64_t __pyx_t_8[3]; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_CountTotalCells__set_state", 0); - /* "View.MemoryView":221 - * @property - * def memview(self): - * return self.get_memview() # <<<<<<<<<<<<<< - * - * @cname('get_memview') - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 221, __pyx_L1_error) + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_CountTotalCells__set_state(CountTotalCells result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[10]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_5, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_5, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_8, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_8, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); - /* "View.MemoryView":220 - * - * @property - * def memview(self): # <<<<<<<<<<<<<< - * return self.get_memview() - * + /* "(tree fragment)":11 + * cdef __pyx_unpickle_CountTotalCells__set_state(CountTotalCells result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[10]) + */ + __pyx_t_9 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[10]) # <<<<<<<<<<<<<< + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_update); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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_11 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + if (!__pyx_t_13) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_12)) { + PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_11}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { + PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_11}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + { + __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL; + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_CountTotalCells__set_state(CountTotalCells result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[10]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_CountTotalCells__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CountTotalCells__set_state(CountTotalCells result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(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_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_CountTotalCells__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":224 - * - * @cname('get_memview') - * cdef get_memview(self): # <<<<<<<<<<<<<< - * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE - * return memoryview(self, flags, self.dtype_is_object) +/* "(tree fragment)":1 + * def __pyx_unpickle_MarkOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xfcf26e5: + * from pickle import PickleError */ -static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { - int __pyx_v_flags; - PyObject *__pyx_r = NULL; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11__pyx_unpickle_MarkOcts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_11__pyx_unpickle_MarkOcts = {"__pyx_unpickle_MarkOcts", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_11__pyx_unpickle_MarkOcts, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_11__pyx_unpickle_MarkOcts(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 - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("get_memview", 0); - - /* "View.MemoryView":225 - * @cname('get_memview') - * cdef get_memview(self): - * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< - * return memoryview(self, flags, self.dtype_is_object) - * + __Pyx_RefNannySetupContext("__pyx_unpickle_MarkOcts (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_MarkOcts", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_MarkOcts", 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_MarkOcts") < 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_MarkOcts", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_MarkOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_10__pyx_unpickle_MarkOcts(__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_2yt_8geometry_12oct_visitors_10__pyx_unpickle_MarkOcts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_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_MarkOcts", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_MarkOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xfcf26e5: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xfcf26e5 = (dims, domain, global_index, ind, index, last, level, mark, nz, oref, pos))" % __pyx_checksum) */ - __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xfcf26e5) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":226 - * cdef get_memview(self): - * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE - * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":3 + * def __pyx_unpickle_MarkOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xfcf26e5: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xfcf26e5 = (dims, domain, global_index, ind, index, last, level, mark, nz, oref, pos))" % __pyx_checksum) + * result = MarkOcts.__new__(__pyx_type) */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 226, __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(3, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":224 - * - * @cname('get_memview') - * cdef get_memview(self): # <<<<<<<<<<<<<< - * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE - * return memoryview(self, flags, self.dtype_is_object) + /* "(tree fragment)":4 + * if __pyx_checksum != 0xfcf26e5: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xfcf26e5 = (dims, domain, global_index, ind, index, last, level, mark, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = MarkOcts.__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_0xfc, __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_PickleError); + __pyx_t_2 = __pyx_v_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) - /* 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; -} + /* "(tree fragment)":2 + * def __pyx_unpickle_MarkOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xfcf26e5: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xfcf26e5 = (dims, domain, global_index, ind, index, last, level, mark, nz, oref, pos))" % __pyx_checksum) + */ + } -/* "View.MemoryView":229 - * - * - * def __getattr__(self, attr): # <<<<<<<<<<<<<< - * return getattr(self.memview, attr) - * + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xfcf26e5 = (dims, domain, global_index, ind, index, last, level, mark, nz, oref, pos))" % __pyx_checksum) + * result = MarkOcts.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_MarkOcts__set_state( result, __pyx_state) */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts), __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_result = __pyx_t_3; + __pyx_t_3 = 0; -/* 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_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xfcf26e5 = (dims, domain, global_index, ind, index, last, level, mark, nz, oref, pos))" % __pyx_checksum) + * result = MarkOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_MarkOcts__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "(tree fragment)":7 + * result = MarkOcts.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_MarkOcts__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_MarkOcts__set_state(MarkOcts 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_2yt_8geometry_12oct_visitors___pyx_unpickle_MarkOcts__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *)__pyx_v_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; -static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__getattr__", 0); + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xfcf26e5 = (dims, domain, global_index, ind, index, last, level, mark, nz, oref, pos))" % __pyx_checksum) + * result = MarkOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_MarkOcts__set_state( result, __pyx_state) + * return result + */ + } - /* "View.MemoryView":230 - * - * def __getattr__(self, attr): - * return getattr(self.memview, attr) # <<<<<<<<<<<<<< - * - * def __getitem__(self, item): + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_MarkOcts__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_MarkOcts__set_state(MarkOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mark = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] */ __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(3, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":229 - * - * - * def __getattr__(self, attr): # <<<<<<<<<<<<<< - * return getattr(self.memview, attr) - * + /* "(tree fragment)":1 + * def __pyx_unpickle_MarkOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xfcf26e5: + * from pickle import PickleError */ /* 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_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_MarkOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":232 - * return getattr(self.memview, attr) - * - * def __getitem__(self, item): # <<<<<<<<<<<<<< - * return self.memview[item] - * +/* "(tree fragment)":9 + * __pyx_unpickle_MarkOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_MarkOcts__set_state(MarkOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mark = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): */ -/* 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_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_MarkOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *__pyx_v_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__getitem__", 0); + int __pyx_t_2; + __pyx_t_5numpy_int32_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5[3]; + __pyx_t_5numpy_uint64_t __pyx_t_6; + __pyx_t_5numpy_int8_t __pyx_t_7; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_9[3]; + 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_MarkOcts__set_state", 0); - /* "View.MemoryView":233 - * - * 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(3, 233, __pyx_L1_error) + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_MarkOcts__set_state(MarkOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mark = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_5, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_5, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_uint8_t(__pyx_t_1); + if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->mark, 0); + __pyx_v_result->mark = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_9, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_9, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); - /* "View.MemoryView":232 - * return getattr(self.memview, attr) - * - * def __getitem__(self, item): # <<<<<<<<<<<<<< - * return self.memview[item] - * + /* "(tree fragment)":11 + * cdef __pyx_unpickle_MarkOcts__set_state(MarkOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mark = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ + __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mark = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) # <<<<<<<<<<<<<< + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_update); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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_12 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + if (!__pyx_t_14) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } 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_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_MarkOcts__set_state(MarkOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mark = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_MarkOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_MarkOcts__set_state(MarkOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mark = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(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_2); - __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_MarkOcts__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":235 - * return self.memview[item] - * - * def __setitem__(self, item, value): # <<<<<<<<<<<<<< - * self.memview[item] = value - * +/* "(tree fragment)":1 + * def __pyx_unpickle_MaskOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x43a044e: + * from pickle import PickleError */ /* 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; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_13__pyx_unpickle_MaskOcts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_13__pyx_unpickle_MaskOcts = {"__pyx_unpickle_MaskOcts", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_13__pyx_unpickle_MaskOcts, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_13__pyx_unpickle_MaskOcts(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("__setitem__ (wrapper)", 0); - __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); - - /* function exit code */ + __Pyx_RefNannySetupContext("__pyx_unpickle_MaskOcts (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_MaskOcts", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_MaskOcts", 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_MaskOcts") < 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_MaskOcts", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_MaskOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__setitem__", 0); - - /* "View.MemoryView":236 - * - * def __setitem__(self, item, value): - * self.memview[item] = value # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(3, 236, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "View.MemoryView":235 - * return self.memview[item] - * - * def __setitem__(self, item, value): # <<<<<<<<<<<<<< - * self.memview[item] = value - * - */ + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_12__pyx_unpickle_MaskOcts(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":240 - * - * @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; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_12__pyx_unpickle_MaskOcts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_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; - __Pyx_RefNannySetupContext("array_cwrapper", 0); + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("__pyx_unpickle_MaskOcts", 0); - /* "View.MemoryView":244 - * cdef array result - * - * if buf == NULL: # <<<<<<<<<<<<<< - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: + /* "(tree fragment)":2 + * def __pyx_unpickle_MaskOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x43a044e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x43a044e = (dims, domain, global_index, ind, index, last, level, mask, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x43a044e) != 0); if (__pyx_t_1) { - /* "View.MemoryView":245 - * - * if buf == NULL: - * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< - * else: - * result = array(shape, itemsize, format, mode.decode('ASCII'), + /* "(tree fragment)":3 + * def __pyx_unpickle_MaskOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x43a044e: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x43a044e = (dims, domain, global_index, ind, index, last, level, mask, nz, oref, pos))" % __pyx_checksum) + * result = MaskOcts.__new__(__pyx_type) */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 245, __pyx_L1_error) + __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_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(3, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 245, __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(3, 245, __pyx_L1_error) + __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_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 != 0x43a044e: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x43a044e = (dims, domain, global_index, ind, index, last, level, mask, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = MaskOcts.__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_0x43, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_PickleError); + __pyx_t_2 = __pyx_v_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) - /* "View.MemoryView":244 - * cdef array result - * - * if buf == NULL: # <<<<<<<<<<<<<< - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: + /* "(tree fragment)":2 + * def __pyx_unpickle_MaskOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x43a044e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x43a044e = (dims, domain, global_index, ind, index, last, level, mask, nz, oref, pos))" % __pyx_checksum) */ - goto __pyx_L3; } - /* "View.MemoryView":247 - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: - * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< - * allocate_buffer=False) - * result.data = buf + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x43a044e = (dims, domain, global_index, ind, index, last, level, mask, nz, oref, pos))" % __pyx_checksum) + * result = MaskOcts.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_MaskOcts__set_state( result, __pyx_state) */ - /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts), __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); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 247, __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; + } 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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "View.MemoryView":248 - * else: - * result = array(shape, itemsize, format, mode.decode('ASCII'), - * allocate_buffer=False) # <<<<<<<<<<<<<< - * result.data = buf - * + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x43a044e = (dims, domain, global_index, ind, index, last, level, mask, nz, oref, pos))" % __pyx_checksum) + * result = MaskOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_MaskOcts__set_state( result, __pyx_state) + * return result */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(3, 248, __pyx_L1_error) + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "View.MemoryView":247 - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: - * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< - * allocate_buffer=False) - * result.data = buf + /* "(tree fragment)":7 + * result = MaskOcts.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_MaskOcts__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_MaskOcts__set_state(MaskOcts result, tuple __pyx_state): */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_MaskOcts__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *)__pyx_v_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; - __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); - __pyx_t_5 = 0; - /* "View.MemoryView":249 - * result = array(shape, itemsize, format, mode.decode('ASCII'), - * allocate_buffer=False) - * result.data = buf # <<<<<<<<<<<<<< - * + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x43a044e = (dims, domain, global_index, ind, index, last, level, mask, nz, oref, pos))" % __pyx_checksum) + * result = MaskOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_MaskOcts__set_state( result, __pyx_state) * return result */ - __pyx_v_result->data = __pyx_v_buf; } - __pyx_L3:; - /* "View.MemoryView":251 - * result.data = buf - * + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_MaskOcts__set_state( result, __pyx_state) * return result # <<<<<<<<<<<<<< - * - * + * cdef __pyx_unpickle_MaskOcts__set_state(MaskOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mask = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":240 - * - * @cname("__pyx_array_new") - * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< - * char *mode, char *buf): - * cdef array result + /* "(tree fragment)":1 + * def __pyx_unpickle_MaskOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x43a044e: + * from pickle import PickleError */ /* function exit code */ @@ -10147,1892 +15895,3641 @@ __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_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_MaskOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_MaskOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_MaskOcts__set_state(MaskOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mask = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_MaskOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __pyx_t_5numpy_int32_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5[3]; + __pyx_t_5numpy_uint64_t __pyx_t_6; + __pyx_t_5numpy_int8_t __pyx_t_7; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_9[3]; + 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_MaskOcts__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_MaskOcts__set_state(MaskOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mask = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_5, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_5, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_uint8_t(__pyx_t_1); + if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->mask, 0); + __pyx_v_result->mask = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_9, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_9, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_MaskOcts__set_state(MaskOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mask = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ + __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mask = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) # <<<<<<<<<<<<<< + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_update); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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_12 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + if (!__pyx_t_14) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } 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_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_MaskOcts__set_state(MaskOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mask = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_MaskOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_MaskOcts__set_state(MaskOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mask = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(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_8, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_MaskOcts__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_result); - __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":277 - * cdef class Enum(object): - * cdef object name - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * def __repr__(self): +/* "(tree fragment)":1 + * def __pyx_unpickle_IndexOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xc7df155: + * from pickle import PickleError */ /* 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; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_15__pyx_unpickle_IndexOcts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_15__pyx_unpickle_IndexOcts = {"__pyx_unpickle_IndexOcts", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_15__pyx_unpickle_IndexOcts, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_15__pyx_unpickle_IndexOcts(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("__init__ (wrapper)", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_IndexOcts (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; - PyObject* values[1] = {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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_IndexOcts", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_IndexOcts", 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, "__init__") < 0)) __PYX_ERR(3, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_IndexOcts") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + } 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_name = values[0]; + __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("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_IndexOcts", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_IndexOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); - return -1; + return NULL; __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); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_14__pyx_unpickle_IndexOcts(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* 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; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_14__pyx_unpickle_IndexOcts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__", 0); + 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_IndexOcts", 0); - /* "View.MemoryView":278 - * cdef object name - * def __init__(self, name): - * self.name = name # <<<<<<<<<<<<<< - * def __repr__(self): - * return self.name + /* "(tree fragment)":2 + * def __pyx_unpickle_IndexOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xc7df155: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xc7df155 = (dims, domain, global_index, ind, index, last, level, nz, oct_index, oref, pos))" % __pyx_checksum) */ - __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; + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xc7df155) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":277 - * cdef class Enum(object): - * cdef object name - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * def __repr__(self): + /* "(tree fragment)":3 + * def __pyx_unpickle_IndexOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xc7df155: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xc7df155 = (dims, domain, global_index, ind, index, last, level, nz, oct_index, oref, pos))" % __pyx_checksum) + * result = IndexOcts.__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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * + /* "(tree fragment)":4 + * if __pyx_checksum != 0xc7df155: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xc7df155 = (dims, domain, global_index, ind, index, last, level, nz, oct_index, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = IndexOcts.__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_0xc7, __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_PickleError); + __pyx_t_2 = __pyx_v_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) -/* 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)); + /* "(tree fragment)":2 + * def __pyx_unpickle_IndexOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xc7df155: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xc7df155 = (dims, domain, global_index, ind, index, last, level, nz, oct_index, oref, pos))" % __pyx_checksum) + */ + } - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xc7df155 = (dims, domain, global_index, ind, index, last, level, nz, oct_index, oref, pos))" % __pyx_checksum) + * result = IndexOcts.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_IndexOcts__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts), __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_result = __pyx_t_3; + __pyx_t_3 = 0; -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); + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xc7df155 = (dims, domain, global_index, ind, index, last, level, nz, oct_index, oref, pos))" % __pyx_checksum) + * result = IndexOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_IndexOcts__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "View.MemoryView":280 - * self.name = name - * def __repr__(self): - * return self.name # <<<<<<<<<<<<<< - * - * cdef generic = Enum("") + /* "(tree fragment)":7 + * result = IndexOcts.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_IndexOcts__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_IndexOcts__set_state(IndexOcts 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_2yt_8geometry_12oct_visitors___pyx_unpickle_IndexOcts__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *)__pyx_v_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 PickleError("Incompatible checksums (%s vs 0xc7df155 = (dims, domain, global_index, ind, index, last, level, nz, oct_index, oref, pos))" % __pyx_checksum) + * result = IndexOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_IndexOcts__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_IndexOcts__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_IndexOcts__set_state(IndexOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oct_index = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->name); - __pyx_r = __pyx_v_self->name; + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * + /* "(tree fragment)":1 + * def __pyx_unpickle_IndexOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xc7df155: + * from pickle import 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("yt.geometry.oct_visitors.__pyx_unpickle_IndexOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":294 - * - * @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":296 - * 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 - * +/* "(tree fragment)":9 + * __pyx_unpickle_IndexOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_IndexOcts__set_state(IndexOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oct_index = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): */ - __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); - /* "View.MemoryView":300 - * - * with cython.cdivision(True): - * offset = aligned_p % alignment # <<<<<<<<<<<<<< - * - * if offset > 0: - */ - __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_IndexOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __pyx_t_5numpy_int32_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5[3]; + __pyx_t_5numpy_uint64_t __pyx_t_6; + __pyx_t_5numpy_int8_t __pyx_t_7; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_9[3]; + 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_IndexOcts__set_state", 0); - /* "View.MemoryView":302 - * offset = aligned_p % alignment - * - * if offset > 0: # <<<<<<<<<<<<<< - * aligned_p += alignment - offset - * - */ - __pyx_t_1 = ((__pyx_v_offset > 0) != 0); - if (__pyx_t_1) { + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_IndexOcts__set_state(IndexOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oct_index = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_5, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_5, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_1); + if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->oct_index, 0); + __pyx_v_result->oct_index = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_9, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_9, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); - /* "View.MemoryView":303 - * - * if offset > 0: - * aligned_p += alignment - offset # <<<<<<<<<<<<<< - * - * return aligned_p - */ - __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); + /* "(tree fragment)":11 + * cdef __pyx_unpickle_IndexOcts__set_state(IndexOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oct_index = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ + __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oct_index = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) # <<<<<<<<<<<<<< + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_update); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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_12 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + if (!__pyx_t_14) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } 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_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":302 - * offset = aligned_p % alignment - * - * if offset > 0: # <<<<<<<<<<<<<< - * aligned_p += alignment - offset - * + /* "(tree fragment)":11 + * cdef __pyx_unpickle_IndexOcts__set_state(IndexOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oct_index = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) */ } - /* "View.MemoryView":305 - * aligned_p += alignment - offset - * - * return aligned_p # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = ((void *)__pyx_v_aligned_p); - goto __pyx_L0; - - /* "View.MemoryView":294 - * - * @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 + /* "(tree fragment)":9 + * __pyx_unpickle_IndexOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_IndexOcts__set_state(IndexOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oct_index = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(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_8, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_IndexOcts__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":341 - * cdef __Pyx_TypeInfo *typeinfo - * - * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< - * self.obj = obj - * self.flags = flags +/* "(tree fragment)":1 + * def __pyx_unpickle_ICoordsOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x04e90da: + * from pickle import PickleError */ /* 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; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_17__pyx_unpickle_ICoordsOcts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_17__pyx_unpickle_ICoordsOcts = {"__pyx_unpickle_ICoordsOcts", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_17__pyx_unpickle_ICoordsOcts, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_17__pyx_unpickle_ICoordsOcts(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("__cinit__ (wrapper)", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_ICoordsOcts (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(3, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ICoordsOcts", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); - if (value) { values[2] = value; kw_args--; } + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ICoordsOcts", 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, "__cinit__") < 0)) __PYX_ERR(3, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_ICoordsOcts") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_obj = values[0]; - __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 341, __pyx_L3_error) - if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 341, __pyx_L3_error) - } else { - __pyx_v_dtype_is_object = ((int)0); + 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("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ICoordsOcts", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_ICoordsOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); - return -1; + return NULL; __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); + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_16__pyx_unpickle_ICoordsOcts(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* 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; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_16__pyx_unpickle_ICoordsOcts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("__cinit__", 0); - - /* "View.MemoryView":342 - * - * 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":343 - * 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; + 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_ICoordsOcts", 0); - /* "View.MemoryView":344 - * self.obj = obj - * self.flags = flags - * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< - * __Pyx_GetBuffer(obj, &self.view, flags) - * if self.view.obj == NULL: + /* "(tree fragment)":2 + * def __pyx_unpickle_ICoordsOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x04e90da: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x04e90da = (dims, domain, global_index, icoords, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __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:; + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x04e90da) != 0); if (__pyx_t_1) { - /* "View.MemoryView":345 - * 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 == -1)) __PYX_ERR(3, 345, __pyx_L1_error) - - /* "View.MemoryView":346 - * 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":347 - * __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":348 - * if self.view.obj == NULL: - * (<__pyx_buffer *> &self.view).obj = Py_None - * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * - * global __pyx_memoryview_thread_locks_used + /* "(tree fragment)":3 + * def __pyx_unpickle_ICoordsOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x04e90da: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x04e90da = (dims, domain, global_index, icoords, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = ICoordsOcts.__new__(__pyx_type) */ - Py_INCREF(Py_None); + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":346 - * 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) + /* "(tree fragment)":4 + * if __pyx_checksum != 0x04e90da: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x04e90da = (dims, domain, global_index, icoords, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = ICoordsOcts.__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_0x04_2, __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_PickleError); + __pyx_t_2 = __pyx_v_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) - /* "View.MemoryView":344 - * self.obj = obj - * self.flags = flags - * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< - * __Pyx_GetBuffer(obj, &self.view, flags) - * if self.view.obj == NULL: + /* "(tree fragment)":2 + * def __pyx_unpickle_ICoordsOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x04e90da: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x04e90da = (dims, domain, global_index, icoords, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ } - /* "View.MemoryView":351 - * - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x04e90da = (dims, domain, global_index, icoords, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = ICoordsOcts.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_ICoordsOcts__set_state( result, __pyx_state) */ - __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); - if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts), __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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "View.MemoryView":352 - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x04e90da = (dims, domain, global_index, icoords, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = ICoordsOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_ICoordsOcts__set_state( result, __pyx_state) + * return result */ - __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "View.MemoryView":353 - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() + /* "(tree fragment)":7 + * result = ICoordsOcts.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_ICoordsOcts__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_ICoordsOcts__set_state(ICoordsOcts result, tuple __pyx_state): */ - __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_ICoordsOcts__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *)__pyx_v_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; - /* "View.MemoryView":351 - * - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x04e90da = (dims, domain, global_index, icoords, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = ICoordsOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_ICoordsOcts__set_state( result, __pyx_state) + * return result */ } - /* "View.MemoryView":354 - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: # <<<<<<<<<<<<<< - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_ICoordsOcts__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_ICoordsOcts__set_state(ICoordsOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.icoords = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] */ - __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - if (__pyx_t_1) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; - /* "View.MemoryView":355 - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< - * if self.lock is NULL: - * raise MemoryError + /* "(tree fragment)":1 + * def __pyx_unpickle_ICoordsOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x04e90da: + * from pickle import PickleError */ - __pyx_v_self->lock = PyThread_allocate_lock(); - /* "View.MemoryView":356 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * - */ - __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - if (__pyx_t_1) { + /* 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("yt.geometry.oct_visitors.__pyx_unpickle_ICoordsOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":357 - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: - * raise MemoryError # <<<<<<<<<<<<<< - * - * if flags & PyBUF_FORMAT: +/* "(tree fragment)":9 + * __pyx_unpickle_ICoordsOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_ICoordsOcts__set_state(ICoordsOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.icoords = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): */ - PyErr_NoMemory(); __PYX_ERR(3, 357, __pyx_L1_error) - /* "View.MemoryView":356 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * - */ - } +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_ICoordsOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __pyx_t_5numpy_int32_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_uint8_t __pyx_t_6[3]; + __pyx_t_5numpy_uint64_t __pyx_t_7; + __pyx_t_5numpy_int8_t __pyx_t_8; + __pyx_t_5numpy_int64_t __pyx_t_9[3]; + 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_ICoordsOcts__set_state", 0); - /* "View.MemoryView":354 - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: # <<<<<<<<<<<<<< - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: - */ + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_ICoordsOcts__set_state(ICoordsOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.icoords = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_t_1); + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->icoords, 0); + __pyx_v_result->icoords = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_6, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_6, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __pyx_t_8; + 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, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __pyx_t_8; + 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, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_9, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_9, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); - /* "View.MemoryView":359 - * raise MemoryError - * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') - * else: - */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":360 - * - * 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) { + /* "(tree fragment)":11 + * cdef __pyx_unpickle_ICoordsOcts__set_state(ICoordsOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.icoords = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ + __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.icoords = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) # <<<<<<<<<<<<<< + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_update); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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_12 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + if (!__pyx_t_14) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L11_bool_binop_done; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } 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_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } } - __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":359 - * raise MemoryError - * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') - * else: - */ - goto __pyx_L10; - } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":362 - * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') - * else: - * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< - * - * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + /* "(tree fragment)":11 + * cdef __pyx_unpickle_ICoordsOcts__set_state(ICoordsOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.icoords = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) */ - /*else*/ { - __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; } - __pyx_L10:; - - /* "View.MemoryView":364 - * 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":366 - * 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":341 - * cdef __Pyx_TypeInfo *typeinfo - * - * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< - * self.obj = obj - * self.flags = flags + /* "(tree fragment)":9 + * __pyx_unpickle_ICoordsOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_ICoordsOcts__set_state(ICoordsOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.icoords = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): */ /* function exit code */ - __pyx_r = 0; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; + __Pyx_XDECREF(__pyx_t_1); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_ICoordsOcts__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":368 - * self.typeinfo = NULL - * - * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< - * if self.obj is not None: - * __Pyx_ReleaseBuffer(&self.view) +/* "(tree fragment)":1 + * def __pyx_unpickle_IResOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xf282e1e: + * from pickle import PickleError */ /* Python wrapper */ -static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_19__pyx_unpickle_IResOcts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_19__pyx_unpickle_IResOcts = {"__pyx_unpickle_IResOcts", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_19__pyx_unpickle_IResOcts, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_19__pyx_unpickle_IResOcts(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("__dealloc__ (wrapper)", 0); - __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __Pyx_RefNannySetupContext("__pyx_unpickle_IResOcts (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_IResOcts", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_IResOcts", 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_IResOcts") < 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_IResOcts", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_IResOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_18__pyx_unpickle_IResOcts(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { - int __pyx_v_i; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_18__pyx_unpickle_IResOcts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - PyThread_type_lock __pyx_t_5; - PyThread_type_lock __pyx_t_6; - __Pyx_RefNannySetupContext("__dealloc__", 0); + 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_IResOcts", 0); - /* "View.MemoryView":369 - * - * def __dealloc__(memoryview self): - * if self.obj is not None: # <<<<<<<<<<<<<< - * __Pyx_ReleaseBuffer(&self.view) - * + /* "(tree fragment)":2 + * def __pyx_unpickle_IResOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xf282e1e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xf282e1e = (dims, domain, global_index, ind, index, ires, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_1 = (__pyx_v_self->obj != Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xf282e1e) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":370 - * def __dealloc__(memoryview self): - * if self.obj is not None: - * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< - * - * cdef int i + /* "(tree fragment)":3 + * def __pyx_unpickle_IResOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xf282e1e: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xf282e1e = (dims, domain, global_index, ind, index, ires, last, level, nz, oref, pos))" % __pyx_checksum) + * result = IResOcts.__new__(__pyx_type) */ - __Pyx_ReleaseBuffer((&__pyx_v_self->view)); - - /* "View.MemoryView":369 - * - * def __dealloc__(memoryview self): - * if self.obj is not None: # <<<<<<<<<<<<<< - * __Pyx_ReleaseBuffer(&self.view) - * - */ - } + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":374 - * cdef int i - * global __pyx_memoryview_thread_locks_used - * if self.lock != NULL: # <<<<<<<<<<<<<< - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: + /* "(tree fragment)":4 + * if __pyx_checksum != 0xf282e1e: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xf282e1e = (dims, domain, global_index, ind, index, ires, last, level, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = IResOcts.__new__(__pyx_type) + * if __pyx_state is not None: */ - __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); - if (__pyx_t_2) { + __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_0xf2, __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_PickleError); + __pyx_t_2 = __pyx_v_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) - /* "View.MemoryView":375 - * global __pyx_memoryview_thread_locks_used - * if self.lock != NULL: - * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< - * if __pyx_memoryview_thread_locks[i] is self.lock: - * __pyx_memoryview_thread_locks_used -= 1 + /* "(tree fragment)":2 + * def __pyx_unpickle_IResOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xf282e1e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xf282e1e = (dims, domain, global_index, ind, index, ires, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_3 = __pyx_memoryview_thread_locks_used; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; + } - /* "View.MemoryView":376 - * if self.lock != NULL: - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xf282e1e = (dims, domain, global_index, ind, index, ires, last, level, nz, oref, pos))" % __pyx_checksum) + * result = IResOcts.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_IResOcts__set_state( result, __pyx_state) */ - __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); - if (__pyx_t_2) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts), __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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "View.MemoryView":377 - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: - * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< - * if i != __pyx_memoryview_thread_locks_used: - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xf282e1e = (dims, domain, global_index, ind, index, ires, last, level, nz, oref, pos))" % __pyx_checksum) + * result = IResOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_IResOcts__set_state( result, __pyx_state) + * return result */ - __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "View.MemoryView":378 - * if __pyx_memoryview_thread_locks[i] is self.lock: - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + /* "(tree fragment)":7 + * result = IResOcts.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_IResOcts__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_IResOcts__set_state(IResOcts result, tuple __pyx_state): */ - __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); - if (__pyx_t_2) { + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_IResOcts__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *)__pyx_v_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; - /* "View.MemoryView":380 - * if i != __pyx_memoryview_thread_locks_used: - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< - * break - * else: + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xf282e1e = (dims, domain, global_index, ind, index, ires, last, level, nz, oref, pos))" % __pyx_checksum) + * result = IResOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_IResOcts__set_state( result, __pyx_state) + * return result */ - __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); - __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + } - /* "View.MemoryView":379 - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) - * break + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_IResOcts__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_IResOcts__set_state(IResOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.ires = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] */ - (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; - (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; - /* "View.MemoryView":378 - * if __pyx_memoryview_thread_locks[i] is self.lock: - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + /* "(tree fragment)":1 + * def __pyx_unpickle_IResOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xf282e1e: + * from pickle import PickleError */ - } - /* "View.MemoryView":381 - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) - * break # <<<<<<<<<<<<<< - * else: - * PyThread_free_lock(self.lock) - */ - goto __pyx_L6_break; + /* 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("yt.geometry.oct_visitors.__pyx_unpickle_IResOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":376 - * if self.lock != NULL: - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: +/* "(tree fragment)":9 + * __pyx_unpickle_IResOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_IResOcts__set_state(IResOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.ires = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): */ + +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_IResOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __pyx_t_5numpy_int32_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5[3]; + __pyx_t_5numpy_uint64_t __pyx_t_6; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int8_t __pyx_t_8; + __pyx_t_5numpy_int64_t __pyx_t_9[3]; + 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_IResOcts__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_IResOcts__set_state(IResOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.ires = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_5, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_5, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_1); + if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->ires, 0); + __pyx_v_result->ires = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __pyx_t_8; + 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, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __pyx_t_8; + 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, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_9, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_9, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_IResOcts__set_state(IResOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.ires = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ + __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.ires = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) # <<<<<<<<<<<<<< + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_update); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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_12 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); } } - /*else*/ { - - /* "View.MemoryView":383 - * break - * else: - * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< - * - * cdef char *get_item_pointer(memoryview self, object index) except NULL: - */ - PyThread_free_lock(__pyx_v_self->lock); + if (!__pyx_t_14) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } 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_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } } - __pyx_L6_break:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":374 - * cdef int i - * global __pyx_memoryview_thread_locks_used - * if self.lock != NULL: # <<<<<<<<<<<<<< - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: + /* "(tree fragment)":11 + * cdef __pyx_unpickle_IResOcts__set_state(IResOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.ires = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) */ } - /* "View.MemoryView":368 - * self.typeinfo = NULL - * - * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< - * if self.obj is not None: - * __Pyx_ReleaseBuffer(&self.view) + /* "(tree fragment)":9 + * __pyx_unpickle_IResOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_IResOcts__set_state(IResOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.ires = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(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_7, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_IResOcts__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "View.MemoryView":385 - * 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 +/* "(tree fragment)":1 + * def __pyx_unpickle_FCoordsOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x2db9d3c: + * from pickle import PickleError */ -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; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_21__pyx_unpickle_FCoordsOcts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_21__pyx_unpickle_FCoordsOcts = {"__pyx_unpickle_FCoordsOcts", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_21__pyx_unpickle_FCoordsOcts, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_21__pyx_unpickle_FCoordsOcts(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 - Py_ssize_t __pyx_t_1; + __Pyx_RefNannySetupContext("__pyx_unpickle_FCoordsOcts (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FCoordsOcts", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FCoordsOcts", 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_FCoordsOcts") < 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_FCoordsOcts", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_FCoordsOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_20__pyx_unpickle_FCoordsOcts(__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_2yt_8geometry_12oct_visitors_20__pyx_unpickle_FCoordsOcts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("get_item_pointer", 0); + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("__pyx_unpickle_FCoordsOcts", 0); - /* "View.MemoryView":387 - * 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): + /* "(tree fragment)":2 + * def __pyx_unpickle_FCoordsOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x2db9d3c: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x2db9d3c = (dims, domain, fcoords, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x2db9d3c) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":389 - * cdef char *itemp = self.view.buf - * - * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< - * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + /* "(tree fragment)":3 + * def __pyx_unpickle_FCoordsOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x2db9d3c: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x2db9d3c = (dims, domain, fcoords, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = FCoordsOcts.__new__(__pyx_type) */ - __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(3, 389, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __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(3, 389, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_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(3, 389, __pyx_L1_error) - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 389, __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(3, 389, __pyx_L1_error) - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - #endif + __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_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 != 0x2db9d3c: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x2db9d3c = (dims, domain, fcoords, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = FCoordsOcts.__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_0x2d, __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_PickleError); + __pyx_t_2 = __pyx_v_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 { - __pyx_t_5 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_5)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 389, __pyx_L1_error) - } - break; + #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_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); + __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) - /* "View.MemoryView":390 - * - * for dim, idx in enumerate(index): - * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< - * - * return itemp + /* "(tree fragment)":2 + * def __pyx_unpickle_FCoordsOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x2db9d3c: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x2db9d3c = (dims, domain, fcoords, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 390, __pyx_L1_error) - __pyx_v_itemp = __pyx_t_7; + } - /* "View.MemoryView":389 - * cdef char *itemp = self.view.buf - * - * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< - * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x2db9d3c = (dims, domain, fcoords, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = FCoordsOcts.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_FCoordsOcts__set_state( result, __pyx_state) */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts), __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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "View.MemoryView":392 - * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * - * return itemp # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x2db9d3c = (dims, domain, fcoords, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = FCoordsOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_FCoordsOcts__set_state( result, __pyx_state) + * return result */ - __pyx_r = __pyx_v_itemp; + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = FCoordsOcts.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_FCoordsOcts__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_FCoordsOcts__set_state(FCoordsOcts 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_2yt_8geometry_12oct_visitors___pyx_unpickle_FCoordsOcts__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *)__pyx_v_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 PickleError("Incompatible checksums (%s vs 0x2db9d3c = (dims, domain, fcoords, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = FCoordsOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_FCoordsOcts__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_FCoordsOcts__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_FCoordsOcts__set_state(FCoordsOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fcoords = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":385 - * 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 + /* "(tree fragment)":1 + * def __pyx_unpickle_FCoordsOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x2db9d3c: + * from pickle import 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_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_FCoordsOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":395 - * - * - * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< - * if index is Ellipsis: - * return self +/* "(tree fragment)":9 + * __pyx_unpickle_FCoordsOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_FCoordsOcts__set_state(FCoordsOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fcoords = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): */ -/* 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; +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_FCoordsOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; __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; + PyObject *__pyx_t_1 = NULL; 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":396 - * - * 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":397 - * 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; + __pyx_t_5numpy_int32_t __pyx_t_3; + __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_5; + __pyx_t_5numpy_uint8_t __pyx_t_6[3]; + __pyx_t_5numpy_uint64_t __pyx_t_7; + __pyx_t_5numpy_int8_t __pyx_t_8; + __pyx_t_5numpy_int64_t __pyx_t_9[3]; + 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_FCoordsOcts__set_state", 0); - /* "View.MemoryView":396 - * - * def __getitem__(memoryview self, object index): - * if index is Ellipsis: # <<<<<<<<<<<<<< - * return self - * - */ + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_FCoordsOcts__set_state(FCoordsOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fcoords = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) } - - /* "View.MemoryView":399 - * return self - * - * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< - * - * cdef char *itemp - */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (likely(__pyx_t_3 != Py_None)) { - PyObject* sequence = __pyx_t_3; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 399, __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(3, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 399, __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(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_v_have_slices = __pyx_t_4; - __pyx_t_4 = 0; - __pyx_v_indices = __pyx_t_5; - __pyx_t_5 = 0; - - /* "View.MemoryView":402 - * - * cdef char *itemp - * if have_slices: # <<<<<<<<<<<<<< - * return memview_slice(self, indices) - * else: - */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 402, __pyx_L1_error) - if (__pyx_t_2) { - - /* "View.MemoryView":403 - * 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(3, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "View.MemoryView":402 - * - * cdef char *itemp - * if have_slices: # <<<<<<<<<<<<<< - * return memview_slice(self, indices) - * else: - */ + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); + if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->fcoords, 0); + __pyx_v_result->fcoords = __pyx_t_4; + __pyx_t_4.memview = NULL; + __pyx_t_4.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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_5 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_6, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_6, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __pyx_t_8; + 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, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __pyx_t_8; + 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, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_9, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_9, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); - /* "View.MemoryView":405 - * 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 == NULL)) __PYX_ERR(3, 405, __pyx_L1_error) - __pyx_v_itemp = __pyx_t_6; + /* "(tree fragment)":11 + * cdef __pyx_unpickle_FCoordsOcts__set_state(FCoordsOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fcoords = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ + __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fcoords = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) # <<<<<<<<<<<<<< + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_update); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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_12 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + if (!__pyx_t_14) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } 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_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":406 - * else: - * itemp = self.get_item_pointer(indices) - * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< - * - * def __setitem__(memoryview self, object index, object value): + /* "(tree fragment)":11 + * cdef __pyx_unpickle_FCoordsOcts__set_state(FCoordsOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fcoords = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) */ - __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(3, 406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; } - /* "View.MemoryView":395 - * - * - * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< - * if index is Ellipsis: - * return self + /* "(tree fragment)":9 + * __pyx_unpickle_FCoordsOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_FCoordsOcts__set_state(FCoordsOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fcoords = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): */ /* 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_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __Pyx_XDECREF(__pyx_t_1); + __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_FCoordsOcts__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_have_slices); - __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":408 - * return self.convert_item_to_object(itemp) - * - * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< - * have_slices, index = _unellipsify(index, self.view.ndim) - * +/* "(tree fragment)":1 + * def __pyx_unpickle_FWidthOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x55bf4cf: + * from pickle import PickleError */ /* 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; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_23__pyx_unpickle_FWidthOcts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_23__pyx_unpickle_FWidthOcts = {"__pyx_unpickle_FWidthOcts", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_23__pyx_unpickle_FWidthOcts, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_23__pyx_unpickle_FWidthOcts(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("__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)); + __Pyx_RefNannySetupContext("__pyx_unpickle_FWidthOcts (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FWidthOcts", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FWidthOcts", 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_FWidthOcts") < 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_FWidthOcts", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_FWidthOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_22__pyx_unpickle_FWidthOcts(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* 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; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_22__pyx_unpickle_FWidthOcts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("__setitem__", 0); - __Pyx_INCREF(__pyx_v_index); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("__pyx_unpickle_FWidthOcts", 0); - /* "View.MemoryView":409 - * - * def __setitem__(memoryview self, object index, object value): - * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< - * - * if have_slices: + /* "(tree fragment)":2 + * def __pyx_unpickle_FWidthOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x55bf4cf: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x55bf4cf = (dims, domain, fwidth, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(__pyx_t_1 != Py_None)) { - PyObject* sequence = __pyx_t_1; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 409, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 409, __pyx_L1_error) - } - __pyx_v_have_slices = __pyx_t_2; - __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x55bf4cf) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":411 - * have_slices, index = _unellipsify(index, self.view.ndim) - * - * if have_slices: # <<<<<<<<<<<<<< - * obj = self.is_slice(value) - * if obj: + /* "(tree fragment)":3 + * def __pyx_unpickle_FWidthOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x55bf4cf: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x55bf4cf = (dims, domain, fwidth, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = FWidthOcts.__new__(__pyx_type) */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 411, __pyx_L1_error) - if (__pyx_t_4) { + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":412 - * - * if have_slices: - * obj = self.is_slice(value) # <<<<<<<<<<<<<< - * if obj: - * self.setitem_slice_assignment(self[index], obj) + /* "(tree fragment)":4 + * if __pyx_checksum != 0x55bf4cf: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x55bf4cf = (dims, domain, fwidth, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = FWidthOcts.__new__(__pyx_type) + * if __pyx_state is not None: */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_obj = __pyx_t_1; - __pyx_t_1 = 0; + __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_0x55, __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_PickleError); + __pyx_t_2 = __pyx_v_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) - /* "View.MemoryView":413 - * if have_slices: - * obj = self.is_slice(value) - * if obj: # <<<<<<<<<<<<<< - * self.setitem_slice_assignment(self[index], obj) - * else: + /* "(tree fragment)":2 + * def __pyx_unpickle_FWidthOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x55bf4cf: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x55bf4cf = (dims, domain, fwidth, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 413, __pyx_L1_error) - if (__pyx_t_4) { + } - /* "View.MemoryView":414 - * obj = self.is_slice(value) - * if obj: - * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< - * else: - * self.setitem_slice_assign_scalar(self[index], value) + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x55bf4cf = (dims, domain, fwidth, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = FWidthOcts.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_FWidthOcts__set_state( result, __pyx_state) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 414, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts), __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); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __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_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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "View.MemoryView":413 - * if have_slices: - * obj = self.is_slice(value) - * if obj: # <<<<<<<<<<<<<< - * self.setitem_slice_assignment(self[index], obj) - * else: + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x55bf4cf = (dims, domain, fwidth, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = FWidthOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_FWidthOcts__set_state( result, __pyx_state) + * return result */ - goto __pyx_L4; - } + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "View.MemoryView":416 - * self.setitem_slice_assignment(self[index], obj) - * else: - * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< - * else: - * self.setitem_indexed(index, value) + /* "(tree fragment)":7 + * result = FWidthOcts.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_FWidthOcts__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_FWidthOcts__set_state(FWidthOcts result, tuple __pyx_state): */ - /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L4:; + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_FWidthOcts__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *)__pyx_v_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; - /* "View.MemoryView":411 - * have_slices, index = _unellipsify(index, self.view.ndim) - * - * if have_slices: # <<<<<<<<<<<<<< - * obj = self.is_slice(value) - * if obj: + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x55bf4cf = (dims, domain, fwidth, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = FWidthOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_FWidthOcts__set_state( result, __pyx_state) + * return result */ - goto __pyx_L3; } - /* "View.MemoryView":418 - * self.setitem_slice_assign_scalar(self[index], value) - * else: - * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< - * - * cdef is_slice(self, obj): + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_FWidthOcts__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_FWidthOcts__set_state(FWidthOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fwidth = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] */ - /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L3:; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; - /* "View.MemoryView":408 - * return self.convert_item_to_object(itemp) - * - * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< - * have_slices, index = _unellipsify(index, self.view.ndim) - * + /* "(tree fragment)":1 + * def __pyx_unpickle_FWidthOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x55bf4cf: + * from pickle import PickleError */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_FWidthOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_have_slices); - __Pyx_XDECREF(__pyx_v_obj); - __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":420 - * self.setitem_indexed(index, value) - * - * cdef is_slice(self, obj): # <<<<<<<<<<<<<< - * if not isinstance(obj, memoryview): - * try: +/* "(tree fragment)":9 + * __pyx_unpickle_FWidthOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_FWidthOcts__set_state(FWidthOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fwidth = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): */ -static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_FWidthOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *__pyx_v_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - __Pyx_RefNannySetupContext("is_slice", 0); - __Pyx_INCREF(__pyx_v_obj); - - /* "View.MemoryView":421 - * - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); - __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); - if (__pyx_t_2) { + __pyx_t_5numpy_int32_t __pyx_t_3; + __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_5; + __pyx_t_5numpy_uint8_t __pyx_t_6[3]; + __pyx_t_5numpy_uint64_t __pyx_t_7; + __pyx_t_5numpy_int8_t __pyx_t_8; + __pyx_t_5numpy_int64_t __pyx_t_9[3]; + 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_FWidthOcts__set_state", 0); - /* "View.MemoryView":422 - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): - * try: # <<<<<<<<<<<<<< - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) - */ - { - __Pyx_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":423 - * if not isinstance(obj, memoryview): - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< - * self.dtype_is_object) - * except TypeError: - */ - __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 423, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_6); - - /* "View.MemoryView":424 - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) # <<<<<<<<<<<<<< - * except TypeError: - * return None - */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 424, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_7); - - /* "View.MemoryView":423 - * if not isinstance(obj, memoryview): - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< - * self.dtype_is_object) - * except TypeError: - */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 423, __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(3, 423, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); - __pyx_t_7 = 0; + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_FWidthOcts__set_state(FWidthOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fwidth = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); + if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->fwidth, 0); + __pyx_v_result->fwidth = __pyx_t_4; + __pyx_t_4.memview = NULL; + __pyx_t_4.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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_5 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_6, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_6, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __pyx_t_8; + 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, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __pyx_t_8; + 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, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_9, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_9, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); - /* "View.MemoryView":422 - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): - * try: # <<<<<<<<<<<<<< - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) - */ + /* "(tree fragment)":11 + * cdef __pyx_unpickle_FWidthOcts__set_state(FWidthOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fwidth = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ + __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fwidth = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) # <<<<<<<<<<<<<< + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_update); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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_12 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); } - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; - __pyx_L4_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "View.MemoryView":425 - * 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(3, 425, __pyx_L6_except_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_6); - - /* "View.MemoryView":426 - * self.dtype_is_object) - * except TypeError: - * return None # <<<<<<<<<<<<<< - * - * return obj - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L7_except_return; + } + if (!__pyx_t_14) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } 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_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - goto __pyx_L6_except_error; - __pyx_L6_except_error:; - - /* "View.MemoryView":422 - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): - * try: # <<<<<<<<<<<<<< - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); - goto __pyx_L1_error; - __pyx_L7_except_return:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); - goto __pyx_L0; - __pyx_L11_try_end:; } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":421 - * - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + /* "(tree fragment)":11 + * cdef __pyx_unpickle_FWidthOcts__set_state(FWidthOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fwidth = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) */ } - /* "View.MemoryView":428 - * 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":420 - * self.setitem_indexed(index, value) - * - * cdef is_slice(self, obj): # <<<<<<<<<<<<<< - * if not isinstance(obj, memoryview): - * try: + /* "(tree fragment)":9 + * __pyx_unpickle_FWidthOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_FWidthOcts__set_state(FWidthOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fwidth = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __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_XDECREF(__pyx_t_1); + __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_FWidthOcts__set_state", __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":430 - * return obj - * - * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice dst_slice - * cdef __Pyx_memviewslice src_slice +/* "(tree fragment)":1 + * def __pyx_unpickle_IdentifyOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xbe9c5c9: + * from pickle import PickleError */ -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; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_25__pyx_unpickle_IdentifyOcts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_25__pyx_unpickle_IdentifyOcts = {"__pyx_unpickle_IdentifyOcts", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_25__pyx_unpickle_IdentifyOcts, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_25__pyx_unpickle_IdentifyOcts(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 - 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":434 - * cdef __Pyx_memviewslice src_slice - * - * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< - * get_slice_from_memview(dst, &dst_slice)[0], - * src.ndim, dst.ndim, self.dtype_is_object) - */ - if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(3, 434, __pyx_L1_error) - - /* "View.MemoryView":435 - * - * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], - * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< - * src.ndim, dst.ndim, self.dtype_is_object) - * - */ - if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(3, 435, __pyx_L1_error) - - /* "View.MemoryView":436 - * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], - * get_slice_from_memview(dst, &dst_slice)[0], - * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< - * - * cdef setitem_slice_assign_scalar(self, memoryview dst, value): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "View.MemoryView":434 - * cdef __Pyx_memviewslice src_slice - * - * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< - * get_slice_from_memview(dst, &dst_slice)[0], - * src.ndim, dst.ndim, self.dtype_is_object) - */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 434, __pyx_L1_error) - - /* "View.MemoryView":430 - * return obj - * - * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice dst_slice - * cdef __Pyx_memviewslice src_slice - */ + __Pyx_RefNannySetupContext("__pyx_unpickle_IdentifyOcts (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_IdentifyOcts", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_IdentifyOcts", 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_IdentifyOcts") < 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_IdentifyOcts", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_IdentifyOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_24__pyx_unpickle_IdentifyOcts(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___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.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":438 - * 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; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_24__pyx_unpickle_IdentifyOcts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; 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_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; - PyObject *__pyx_t_11 = NULL; - __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); - - /* "View.MemoryView":440 - * 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":445 - * 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)); + int __pyx_t_7; + __Pyx_RefNannySetupContext("__pyx_unpickle_IdentifyOcts", 0); - /* "View.MemoryView":447 - * dst_slice = get_slice_from_memview(dst, &tmp_slice) - * - * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< - * tmp = PyMem_Malloc(self.view.itemsize) - * if tmp == NULL: + /* "(tree fragment)":2 + * def __pyx_unpickle_IdentifyOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xbe9c5c9: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xbe9c5c9 = (dims, domain, domain_mask, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xbe9c5c9) != 0); if (__pyx_t_1) { - /* "View.MemoryView":448 - * - * if self.view.itemsize > sizeof(array): - * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< - * if tmp == NULL: - * raise MemoryError + /* "(tree fragment)":3 + * def __pyx_unpickle_IdentifyOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xbe9c5c9: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xbe9c5c9 = (dims, domain, domain_mask, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = IdentifyOcts.__new__(__pyx_type) */ - __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":449 - * if self.view.itemsize > sizeof(array): - * tmp = PyMem_Malloc(self.view.itemsize) - * if tmp == NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * item = tmp + /* "(tree fragment)":4 + * if __pyx_checksum != 0xbe9c5c9: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xbe9c5c9 = (dims, domain, domain_mask, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = IdentifyOcts.__new__(__pyx_type) + * if __pyx_state is not None: */ - __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); - if (__pyx_t_1) { + __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_0xbe, __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_PickleError); + __pyx_t_2 = __pyx_v_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) - /* "View.MemoryView":450 - * tmp = PyMem_Malloc(self.view.itemsize) - * if tmp == NULL: - * raise MemoryError # <<<<<<<<<<<<<< - * item = tmp - * else: + /* "(tree fragment)":2 + * def __pyx_unpickle_IdentifyOcts(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xbe9c5c9: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xbe9c5c9 = (dims, domain, domain_mask, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - PyErr_NoMemory(); __PYX_ERR(3, 450, __pyx_L1_error) + } - /* "View.MemoryView":449 - * if self.view.itemsize > sizeof(array): - * tmp = PyMem_Malloc(self.view.itemsize) - * if tmp == NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * item = tmp + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xbe9c5c9 = (dims, domain, domain_mask, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = IdentifyOcts.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_IdentifyOcts__set_state( result, __pyx_state) */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts), __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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "View.MemoryView":451 - * if tmp == NULL: - * raise MemoryError - * item = tmp # <<<<<<<<<<<<<< - * else: - * item = array + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xbe9c5c9 = (dims, domain, domain_mask, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = IdentifyOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_IdentifyOcts__set_state( result, __pyx_state) + * return result */ - __pyx_v_item = __pyx_v_tmp; + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "View.MemoryView":447 - * dst_slice = get_slice_from_memview(dst, &tmp_slice) - * - * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< - * tmp = PyMem_Malloc(self.view.itemsize) - * if tmp == NULL: + /* "(tree fragment)":7 + * result = IdentifyOcts.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_IdentifyOcts__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_IdentifyOcts__set_state(IdentifyOcts result, tuple __pyx_state): */ - goto __pyx_L3; - } + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_IdentifyOcts__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *)__pyx_v_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; - /* "View.MemoryView":453 - * item = tmp - * else: - * item = array # <<<<<<<<<<<<<< - * - * try: + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xbe9c5c9 = (dims, domain, domain_mask, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = IdentifyOcts.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_IdentifyOcts__set_state( result, __pyx_state) + * return result */ - /*else*/ { - __pyx_v_item = ((void *)__pyx_v_array); } - __pyx_L3:; - - /* "View.MemoryView":455 - * item = array - * - * try: # <<<<<<<<<<<<<< - * if self.dtype_is_object: - * ( item)[0] = value - */ - /*try:*/ { - /* "View.MemoryView":456 - * - * try: - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * ( item)[0] = value - * else: + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_IdentifyOcts__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_IdentifyOcts__set_state(IdentifyOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_mask = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] */ - __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); - if (__pyx_t_1) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; - /* "View.MemoryView":457 - * try: - * if self.dtype_is_object: - * ( item)[0] = value # <<<<<<<<<<<<<< - * else: - * self.assign_item_from_object( item, value) + /* "(tree fragment)":1 + * def __pyx_unpickle_IdentifyOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xbe9c5c9: + * from pickle import PickleError */ - (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); - /* "View.MemoryView":456 - * - * try: - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * ( item)[0] = value - * else: - */ - goto __pyx_L8; - } - - /* "View.MemoryView":459 - * ( 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(3, 459, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_L8:; - - /* "View.MemoryView":463 - * - * - * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< - * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) - * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, - */ - __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); - if (__pyx_t_1) { + /* 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("yt.geometry.oct_visitors.__pyx_unpickle_IdentifyOcts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":464 - * - * if self.view.suboffsets != NULL: - * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< - * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, - * item, self.dtype_is_object) +/* "(tree fragment)":9 + * __pyx_unpickle_IdentifyOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_IdentifyOcts__set_state(IdentifyOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_mask = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): */ - __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 464, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":463 - * - * - * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< - * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) - * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, - */ - } +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_IdentifyOcts__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __pyx_t_5numpy_int32_t __pyx_t_3; + __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_5; + __pyx_t_5numpy_uint8_t __pyx_t_6[3]; + __pyx_t_5numpy_uint64_t __pyx_t_7; + __pyx_t_5numpy_int8_t __pyx_t_8; + __pyx_t_5numpy_int64_t __pyx_t_9[3]; + 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_IdentifyOcts__set_state", 0); - /* "View.MemoryView":465 - * if self.view.suboffsets != NULL: - * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) - * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< - * 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); + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_IdentifyOcts__set_state(IdentifyOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_mask = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_1); + if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->domain_mask, 0); + __pyx_v_result->domain_mask = __pyx_t_4; + __pyx_t_4.memview = NULL; + __pyx_t_4.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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_5 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_6, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_6, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __pyx_t_8; + 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, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __pyx_t_8; + 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, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_9, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_9, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); - /* "View.MemoryView":468 - * 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; + /* "(tree fragment)":11 + * cdef __pyx_unpickle_IdentifyOcts__set_state(IdentifyOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_mask = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ + __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_mask = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) # <<<<<<<<<<<<<< + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_update); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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) } - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L6_error:; - __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); - __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); + __pyx_t_12 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); } - __Pyx_PyThreadState_assign - 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); + } + if (!__pyx_t_14) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } 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_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - __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:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_IdentifyOcts__set_state(IdentifyOcts result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_mask = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ } - /* "View.MemoryView":438 - * 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 + /* "(tree fragment)":9 + * __pyx_unpickle_IdentifyOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_IdentifyOcts__set_state(IdentifyOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_mask = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): */ /* 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_XDECREF(__pyx_t_1); + __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_IdentifyOcts__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -12040,14240 +19537,28470 @@ return __pyx_r; } -/* "View.MemoryView":470 - * PyMem_Free(tmp) - * - * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< - * cdef char *itemp = self.get_item_pointer(index) - * self.assign_item_from_object(itemp, value) +/* "(tree fragment)":1 + * def __pyx_unpickle_AssignDomainInd(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError */ -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; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_27__pyx_unpickle_AssignDomainInd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_27__pyx_unpickle_AssignDomainInd = {"__pyx_unpickle_AssignDomainInd", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_27__pyx_unpickle_AssignDomainInd, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_27__pyx_unpickle_AssignDomainInd(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_AssignDomainInd (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AssignDomainInd", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AssignDomainInd", 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_AssignDomainInd") < 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_AssignDomainInd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_AssignDomainInd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_26__pyx_unpickle_AssignDomainInd(__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_2yt_8geometry_12oct_visitors_26__pyx_unpickle_AssignDomainInd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - char *__pyx_t_1; + int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("setitem_indexed", 0); + 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_AssignDomainInd", 0); - /* "View.MemoryView":471 - * - * cdef setitem_indexed(self, index, value): - * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< - * self.assign_item_from_object(itemp, value) - * + /* "(tree fragment)":2 + * def __pyx_unpickle_AssignDomainInd(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x047358e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(3, 471, __pyx_L1_error) - __pyx_v_itemp = __pyx_t_1; + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x047358e) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":472 - * cdef setitem_indexed(self, index, value): - * cdef char *itemp = self.get_item_pointer(index) - * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< - * - * cdef convert_item_to_object(self, char *itemp): + /* "(tree fragment)":3 + * def __pyx_unpickle_AssignDomainInd(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = AssignDomainInd.__new__(__pyx_type) */ - __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(3, 472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "View.MemoryView":470 - * PyMem_Free(tmp) - * - * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< - * cdef char *itemp = self.get_item_pointer(index) - * self.assign_item_from_object(itemp, value) + __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_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 != 0x047358e: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = AssignDomainInd.__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_0x04, __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_PickleError); + __pyx_t_2 = __pyx_v_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_AssignDomainInd(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x047358e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ + } - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = AssignDomainInd.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_AssignDomainInd__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd), __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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = AssignDomainInd.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_AssignDomainInd__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = AssignDomainInd.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_AssignDomainInd__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_AssignDomainInd__set_state(AssignDomainInd 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_2yt_8geometry_12oct_visitors___pyx_unpickle_AssignDomainInd__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *)__pyx_v_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 PickleError("Incompatible checksums (%s vs 0x047358e = (dims, domain, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = AssignDomainInd.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_AssignDomainInd__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_AssignDomainInd__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_AssignDomainInd__set_state(AssignDomainInd result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_AssignDomainInd(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError + */ + + /* function exit code */ __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_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_AssignDomainInd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":474 - * 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""" +/* "(tree fragment)":9 + * __pyx_unpickle_AssignDomainInd__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_AssignDomainInd__set_state(AssignDomainInd result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): */ -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; +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_AssignDomainInd__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *__pyx_v_result, PyObject *__pyx_v___pyx_state) { 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); + int __pyx_t_2; + __pyx_t_5numpy_int32_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5[3]; + __pyx_t_5numpy_uint64_t __pyx_t_6; + __pyx_t_5numpy_int8_t __pyx_t_7; + __pyx_t_5numpy_int64_t __pyx_t_8[3]; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_AssignDomainInd__set_state", 0); - /* "View.MemoryView":477 - * """Only used if instantiated manually by the user, or if Cython doesn't - * know how to convert the type""" - * import struct # <<<<<<<<<<<<<< - * cdef bytes bytesitem - * - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 477, __pyx_L1_error) + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_AssignDomainInd__set_state(AssignDomainInd result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[10]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_struct = __pyx_t_1; - __pyx_t_1 = 0; - - /* "View.MemoryView":480 - * cdef bytes bytesitem - * - * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< - * try: - * result = struct.unpack(self.view.format, bytesitem) - */ - __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 480, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "View.MemoryView":481 - * - * bytesitem = itemp[:self.view.itemsize] - * try: # <<<<<<<<<<<<<< - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: - */ - { - __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:*/ { + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_5, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_5, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_8, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_8, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); - /* "View.MemoryView":482 - * bytesitem = itemp[:self.view.itemsize] - * try: - * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< - * except struct.error: - * raise ValueError("Unable to convert item to object") - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 482, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 482, __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; - } + /* "(tree fragment)":11 + * cdef __pyx_unpickle_AssignDomainInd__set_state(AssignDomainInd result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[10]) + */ + __pyx_t_9 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[10]) # <<<<<<<<<<<<<< + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_update); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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_11 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); } + } + if (!__pyx_t_13) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { #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(3, 482, __pyx_L3_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyFunction_Check(__pyx_t_12)) { + PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_11}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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(3, 482, __pyx_L3_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { + PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_11}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 482, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_9); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); - __Pyx_INCREF(__pyx_v_bytesitem); - __Pyx_GIVEREF(__pyx_v_bytesitem); - PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 482, __pyx_L3_error) + __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL; + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, 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_14); __pyx_t_14 = 0; } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_result = __pyx_t_1; - __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":481 - * - * bytesitem = itemp[:self.view.itemsize] - * try: # <<<<<<<<<<<<<< - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: + /* "(tree fragment)":11 + * cdef __pyx_unpickle_AssignDomainInd__set_state(AssignDomainInd result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[10]) */ - } + } - /* "View.MemoryView":486 - * raise ValueError("Unable to convert item to object") - * else: - * if len(self.view.format) == 1: # <<<<<<<<<<<<<< - * return result[0] - * return result - */ - /*else:*/ { - __pyx_t_10 = strlen(__pyx_v_self->view.format); - __pyx_t_11 = ((__pyx_t_10 == 1) != 0); - if (__pyx_t_11) { - - /* "View.MemoryView":487 - * 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(3, 487, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L6_except_return; - - /* "View.MemoryView":486 - * raise ValueError("Unable to convert item to object") - * else: - * if len(self.view.format) == 1: # <<<<<<<<<<<<<< - * return result[0] - * return result - */ - } - - /* "View.MemoryView":488 - * 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_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "View.MemoryView":483 - * try: - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: # <<<<<<<<<<<<<< - * raise ValueError("Unable to convert item to object") - * else: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 483, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(3, 483, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_9); - - /* "View.MemoryView":484 - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: - * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< - * else: - * if len(self.view.format) == 1: - */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 484, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(3, 484, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - - /* "View.MemoryView":481 - * - * bytesitem = itemp[:self.view.itemsize] - * try: # <<<<<<<<<<<<<< - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); - goto __pyx_L1_error; - __pyx_L6_except_return:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); - goto __pyx_L0; - } - - /* "View.MemoryView":474 - * 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""" + /* "(tree fragment)":9 + * __pyx_unpickle_AssignDomainInd__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_AssignDomainInd__set_state(AssignDomainInd result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(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_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_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_AssignDomainInd__set_state", __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":490 - * 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""" +/* "(tree fragment)":1 + * def __pyx_unpickle_FillFileIndicesO(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x286fa6e: + * from pickle import PickleError */ -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; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_29__pyx_unpickle_FillFileIndicesO(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_29__pyx_unpickle_FillFileIndicesO = {"__pyx_unpickle_FillFileIndicesO", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_29__pyx_unpickle_FillFileIndicesO, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_29__pyx_unpickle_FillFileIndicesO(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_FillFileIndicesO (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FillFileIndicesO", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FillFileIndicesO", 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_FillFileIndicesO") < 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_FillFileIndicesO", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_FillFileIndicesO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_28__pyx_unpickle_FillFileIndicesO(__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_2yt_8geometry_12oct_visitors_28__pyx_unpickle_FillFileIndicesO(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; + 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; - 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); + __Pyx_RefNannySetupContext("__pyx_unpickle_FillFileIndicesO", 0); - /* "View.MemoryView":493 - * """Only used if instantiated manually by the user, or if Cython doesn't - * know how to convert the type""" - * import struct # <<<<<<<<<<<<<< - * cdef char c - * cdef bytes bytesvalue + /* "(tree fragment)":2 + * def __pyx_unpickle_FillFileIndicesO(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x286fa6e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_struct = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x286fa6e) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":498 - * cdef Py_ssize_t i - * - * if isinstance(value, tuple): # <<<<<<<<<<<<<< - * bytesvalue = struct.pack(self.view.format, *value) - * else: + /* "(tree fragment)":3 + * def __pyx_unpickle_FillFileIndicesO(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x286fa6e: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) + * result = FillFileIndicesO.__new__(__pyx_type) */ - __pyx_t_2 = PyTuple_Check(__pyx_v_value); - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":499 - * - * if isinstance(value, tuple): - * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< - * else: - * bytesvalue = struct.pack(self.view.format, value) + /* "(tree fragment)":4 + * if __pyx_checksum != 0x286fa6e: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = FillFileIndicesO.__new__(__pyx_type) + * if __pyx_state is not None: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 499, __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 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __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_0x28, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __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(3, 499, __pyx_L1_error) - __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - - /* "View.MemoryView":498 - * cdef Py_ssize_t i - * - * if isinstance(value, tuple): # <<<<<<<<<<<<<< - * bytesvalue = struct.pack(self.view.format, *value) - * else: - */ - goto __pyx_L3; - } - - /* "View.MemoryView":501 - * 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(3, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 501, __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); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_PickleError); + __pyx_t_2 = __pyx_v_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_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_7 = 1; + __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_FillFileIndicesO(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x286fa6e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) + * result = FillFileIndicesO.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_FillFileIndicesO__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO), __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_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(3, 501, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + 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_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(3, 501, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + 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_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); - __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 501, __pyx_L1_error) + __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_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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_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(3, 501, __pyx_L1_error) - __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; } - __pyx_L3:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "View.MemoryView":503 - * bytesvalue = struct.pack(self.view.format, value) - * - * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< - * itemp[i] = c - * + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) + * result = FillFileIndicesO.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_FillFileIndicesO__set_state( result, __pyx_state) + * return result */ - __pyx_t_9 = 0; - if (unlikely(__pyx_v_bytesvalue == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(3, 503, __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]); + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "View.MemoryView":504 - * - * for i, c in enumerate(bytesvalue): - * itemp[i] = c # <<<<<<<<<<<<<< - * - * @cname('getbuffer') + /* "(tree fragment)":7 + * result = FillFileIndicesO.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_FillFileIndicesO__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_FillFileIndicesO__set_state(FillFileIndicesO result, tuple __pyx_state): */ - __pyx_v_i = __pyx_t_9; + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_FillFileIndicesO__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *)__pyx_v_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; - /* "View.MemoryView":503 - * bytesvalue = struct.pack(self.view.format, value) - * - * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< - * itemp[i] = c - * + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) + * result = FillFileIndicesO.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_FillFileIndicesO__set_state( result, __pyx_state) + * return result */ - __pyx_t_9 = (__pyx_t_9 + 1); + } - /* "View.MemoryView":504 - * - * for i, c in enumerate(bytesvalue): - * itemp[i] = c # <<<<<<<<<<<<<< - * - * @cname('getbuffer') + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_FillFileIndicesO__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_FillFileIndicesO__set_state(FillFileIndicesO result, tuple __pyx_state): + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] */ - (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; - /* "View.MemoryView":490 - * 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""" + /* "(tree fragment)":1 + * def __pyx_unpickle_FillFileIndicesO(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x286fa6e: + * from pickle import PickleError */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_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_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_FillFileIndicesO", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_struct); - __Pyx_XDECREF(__pyx_v_bytesvalue); + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":507 - * - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< - * if flags & PyBUF_STRIDES: - * info.shape = self.view.shape +/* "(tree fragment)":9 + * __pyx_unpickle_FillFileIndicesO__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_FillFileIndicesO__set_state(FillFileIndicesO result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] + * if hasattr(result, '__dict__'): */ -/* 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; +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_FillFileIndicesO__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; __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)); + PyObject *__pyx_t_1 = NULL; + __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_3; + __pyx_t_5numpy_int32_t __pyx_t_4; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_6; + __pyx_t_5numpy_uint8_t __pyx_t_7[3]; + __pyx_t_5numpy_uint64_t __pyx_t_8; + __pyx_t_5numpy_int8_t __pyx_t_9; + __pyx_t_5numpy_int64_t __pyx_t_10[3]; + int __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_FillFileIndicesO__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_FillFileIndicesO__set_state(FillFileIndicesO result, tuple __pyx_state): + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[13]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_1); + if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->cell_inds, 0); + __pyx_v_result->cell_inds = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_1); + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->file_inds, 0); + __pyx_v_result->file_inds = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_7, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_7, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __pyx_t_8; + 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, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __pyx_t_8; + 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, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_9 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __pyx_t_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_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_1); + if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->levels, 0); + __pyx_v_result->levels = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_9 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __pyx_t_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_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_10, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_10, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_FillFileIndicesO__set_state(FillFileIndicesO result, tuple __pyx_state): + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[13]) + */ + __pyx_t_11 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + /* "(tree fragment)":12 + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[13]) # <<<<<<<<<<<<<< + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_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 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, function); + } + } + if (!__pyx_t_15) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_14)) { + PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_13}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) { + PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_13}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } else + #endif + { + __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL; + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } + } + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_FillFileIndicesO__set_state(FillFileIndicesO result, tuple __pyx_state): + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[13]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_FillFileIndicesO__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_FillFileIndicesO__set_state(FillFileIndicesO result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] + * if hasattr(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_XDEC_MEMVIEW(&__pyx_t_5, 1); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_FillFileIndicesO__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __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; - Py_ssize_t *__pyx_t_2; - char *__pyx_t_3; - void *__pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); +/* "(tree fragment)":1 + * def __pyx_unpickle_FillFileIndicesR(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x286fa6e: + * from pickle import PickleError + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_31__pyx_unpickle_FillFileIndicesR(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_31__pyx_unpickle_FillFileIndicesR = {"__pyx_unpickle_FillFileIndicesR", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_31__pyx_unpickle_FillFileIndicesR, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_31__pyx_unpickle_FillFileIndicesR(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_FillFileIndicesR (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FillFileIndicesR", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FillFileIndicesR", 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_FillFileIndicesR") < 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_FillFileIndicesR", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_FillFileIndicesR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_30__pyx_unpickle_FillFileIndicesR(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); - /* "View.MemoryView":508 - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): - * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< - * info.shape = self.view.shape - * else: + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_30__pyx_unpickle_FillFileIndicesR(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_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_FillFileIndicesR", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_FillFileIndicesR(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x286fa6e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x286fa6e) != 0); if (__pyx_t_1) { - /* "View.MemoryView":509 - * def __getbuffer__(self, Py_buffer *info, int flags): - * if flags & PyBUF_STRIDES: - * info.shape = self.view.shape # <<<<<<<<<<<<<< - * else: - * info.shape = NULL + /* "(tree fragment)":3 + * def __pyx_unpickle_FillFileIndicesR(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x286fa6e: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) + * result = FillFileIndicesR.__new__(__pyx_type) */ - __pyx_t_2 = __pyx_v_self->view.shape; - __pyx_v_info->shape = __pyx_t_2; + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":508 - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): - * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< - * info.shape = self.view.shape - * else: + /* "(tree fragment)":4 + * if __pyx_checksum != 0x286fa6e: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = FillFileIndicesR.__new__(__pyx_type) + * if __pyx_state is not None: */ - goto __pyx_L3; - } + __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_0x28, __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_PickleError); + __pyx_t_2 = __pyx_v_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) - /* "View.MemoryView":511 - * info.shape = self.view.shape - * else: - * info.shape = NULL # <<<<<<<<<<<<<< - * - * if flags & PyBUF_STRIDES: + /* "(tree fragment)":2 + * def __pyx_unpickle_FillFileIndicesR(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x286fa6e: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) */ - /*else*/ { - __pyx_v_info->shape = NULL; } - __pyx_L3:; - /* "View.MemoryView":513 - * info.shape = NULL - * - * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< - * info.strides = self.view.strides - * else: + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) + * result = FillFileIndicesR.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_FillFileIndicesR__set_state( result, __pyx_state) */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); - if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR), __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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "View.MemoryView":514 - * - * if flags & PyBUF_STRIDES: - * info.strides = self.view.strides # <<<<<<<<<<<<<< - * else: - * info.strides = NULL + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) + * result = FillFileIndicesR.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_FillFileIndicesR__set_state( result, __pyx_state) + * return result */ - __pyx_t_2 = __pyx_v_self->view.strides; - __pyx_v_info->strides = __pyx_t_2; + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "View.MemoryView":513 - * info.shape = NULL - * - * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< - * info.strides = self.view.strides - * else: + /* "(tree fragment)":7 + * result = FillFileIndicesR.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_FillFileIndicesR__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_FillFileIndicesR__set_state(FillFileIndicesR result, tuple __pyx_state): */ - goto __pyx_L4; - } + 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_2yt_8geometry_12oct_visitors___pyx_unpickle_FillFileIndicesR__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *)__pyx_v_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; - /* "View.MemoryView":516 - * info.strides = self.view.strides - * else: - * info.strides = NULL # <<<<<<<<<<<<<< - * - * if flags & PyBUF_INDIRECT: + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x286fa6e = (cell_inds, dims, domain, file_inds, global_index, ind, index, last, level, levels, nz, oref, pos))" % __pyx_checksum) + * result = FillFileIndicesR.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_FillFileIndicesR__set_state( result, __pyx_state) + * return result */ - /*else*/ { - __pyx_v_info->strides = NULL; } - __pyx_L4:; - /* "View.MemoryView":518 - * info.strides = NULL - * - * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< - * info.suboffsets = self.view.suboffsets - * else: + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_FillFileIndicesR__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_FillFileIndicesR__set_state(FillFileIndicesR result, tuple __pyx_state): + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); - if (__pyx_t_1) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; - /* "View.MemoryView":519 - * - * if flags & PyBUF_INDIRECT: - * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< - * else: - * info.suboffsets = NULL + /* "(tree fragment)":1 + * def __pyx_unpickle_FillFileIndicesR(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x286fa6e: + * from pickle import PickleError */ - __pyx_t_2 = __pyx_v_self->view.suboffsets; - __pyx_v_info->suboffsets = __pyx_t_2; - /* "View.MemoryView":518 - * info.strides = NULL - * - * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< - * info.suboffsets = self.view.suboffsets - * else: - */ - goto __pyx_L5; - } + /* 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("yt.geometry.oct_visitors.__pyx_unpickle_FillFileIndicesR", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":521 - * info.suboffsets = self.view.suboffsets - * else: - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * - * if flags & PyBUF_FORMAT: +/* "(tree fragment)":9 + * __pyx_unpickle_FillFileIndicesR__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_FillFileIndicesR__set_state(FillFileIndicesR result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] + * if hasattr(result, '__dict__'): */ - /*else*/ { - __pyx_v_info->suboffsets = NULL; - } - __pyx_L5:; - /* "View.MemoryView":523 - * 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":524 - * - * if flags & PyBUF_FORMAT: - * info.format = self.view.format # <<<<<<<<<<<<<< - * else: - * info.format = NULL - */ - __pyx_t_3 = __pyx_v_self->view.format; - __pyx_v_info->format = __pyx_t_3; +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_FillFileIndicesR__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *__pyx_v_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 } }; + int __pyx_t_3; + __pyx_t_5numpy_int32_t __pyx_t_4; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_6; + __pyx_t_5numpy_uint8_t __pyx_t_7[3]; + __pyx_t_5numpy_uint64_t __pyx_t_8; + __pyx_t_5numpy_int8_t __pyx_t_9; + __pyx_t_5numpy_int64_t __pyx_t_10[3]; + int __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_FillFileIndicesR__set_state", 0); - /* "View.MemoryView":523 - * info.suboffsets = NULL - * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * info.format = self.view.format - * else: - */ - goto __pyx_L6; + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_FillFileIndicesR__set_state(FillFileIndicesR result, tuple __pyx_state): + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[13]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) } - - /* "View.MemoryView":526 - * info.format = self.view.format - * else: - * info.format = NULL # <<<<<<<<<<<<<< - * - * info.buf = self.view.buf - */ - /*else*/ { - __pyx_v_info->format = NULL; + __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(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_1); + if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->cell_inds, 0); + __pyx_v_result->cell_inds = __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_L6:; - - /* "View.MemoryView":528 - * info.format = NULL - * - * info.buf = self.view.buf # <<<<<<<<<<<<<< - * info.ndim = self.view.ndim - * info.itemsize = self.view.itemsize - */ - __pyx_t_4 = __pyx_v_self->view.buf; - __pyx_v_info->buf = __pyx_t_4; - - /* "View.MemoryView":529 - * - * info.buf = self.view.buf - * info.ndim = self.view.ndim # <<<<<<<<<<<<<< - * info.itemsize = self.view.itemsize - * info.len = self.view.len - */ - __pyx_t_5 = __pyx_v_self->view.ndim; - __pyx_v_info->ndim = __pyx_t_5; - - /* "View.MemoryView":530 - * info.buf = self.view.buf - * info.ndim = self.view.ndim - * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< - * info.len = self.view.len - * info.readonly = 0 - */ - __pyx_t_6 = __pyx_v_self->view.itemsize; - __pyx_v_info->itemsize = __pyx_t_6; - - /* "View.MemoryView":531 - * info.ndim = self.view.ndim - * info.itemsize = self.view.itemsize - * info.len = self.view.len # <<<<<<<<<<<<<< - * info.readonly = 0 - * info.obj = self - */ - __pyx_t_6 = __pyx_v_self->view.len; - __pyx_v_info->len = __pyx_t_6; + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_1); + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->file_inds, 0); + __pyx_v_result->file_inds = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_7, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_7, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __pyx_t_8; + 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, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __pyx_t_8; + 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, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_9 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __pyx_t_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_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_1); + if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->levels, 0); + __pyx_v_result->levels = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_9 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __pyx_t_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_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_10, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_10, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); - /* "View.MemoryView":532 - * info.itemsize = self.view.itemsize - * info.len = self.view.len - * info.readonly = 0 # <<<<<<<<<<<<<< - * info.obj = self - * - */ - __pyx_v_info->readonly = 0; + /* "(tree fragment)":11 + * cdef __pyx_unpickle_FillFileIndicesR__set_state(FillFileIndicesR result, tuple __pyx_state): + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[13]) + */ + __pyx_t_11 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + /* "(tree fragment)":12 + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[13]) # <<<<<<<<<<<<<< + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_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 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, function); + } + } + if (!__pyx_t_15) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_14)) { + PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_13}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) { + PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_13}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } else + #endif + { + __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL; + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } + } + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":533 - * info.len = self.view.len - * info.readonly = 0 - * info.obj = self # <<<<<<<<<<<<<< - * - * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + /* "(tree fragment)":11 + * cdef __pyx_unpickle_FillFileIndicesR__set_state(FillFileIndicesR result, tuple __pyx_state): + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[13]) */ - __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":507 - * - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< - * if flags & PyBUF_STRIDES: - * info.shape = self.view.shape + /* "(tree fragment)":9 + * __pyx_unpickle_FillFileIndicesR__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_FillFileIndicesR__set_state(FillFileIndicesR result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] + * if hasattr(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_XDEC_MEMVIEW(&__pyx_t_5, 1); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_FillFileIndicesR__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":539 - * - * @property - * def T(self): # <<<<<<<<<<<<<< - * cdef _memoryviewslice result = memoryview_copy(self) - * transpose_memslice(&result.from_slice) +/* "(tree fragment)":1 + * def __pyx_unpickle_CountByDomain(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x5e07de9: + * from pickle import PickleError */ /* 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) { +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_33__pyx_unpickle_CountByDomain(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_33__pyx_unpickle_CountByDomain = {"__pyx_unpickle_CountByDomain", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_33__pyx_unpickle_CountByDomain, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_33__pyx_unpickle_CountByDomain(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("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __Pyx_RefNannySetupContext("__pyx_unpickle_CountByDomain (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CountByDomain", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CountByDomain", 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_CountByDomain") < 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_CountByDomain", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_CountByDomain", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_32__pyx_unpickle_CountByDomain(__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_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_32__pyx_unpickle_CountByDomain(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - __Pyx_RefNannySetupContext("__get__", 0); + 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_CountByDomain", 0); - /* "View.MemoryView":540 - * @property - * def T(self): - * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< - * transpose_memslice(&result.from_slice) - * return result + /* "(tree fragment)":2 + * def __pyx_unpickle_CountByDomain(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x5e07de9: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x5e07de9 = (dims, domain, domain_counts, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(3, 540, __pyx_L1_error) - __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x5e07de9) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":541 - * def T(self): - * cdef _memoryviewslice result = memoryview_copy(self) - * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< - * return result - * + /* "(tree fragment)":3 + * def __pyx_unpickle_CountByDomain(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x5e07de9: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x5e07de9 = (dims, domain, domain_counts, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = CountByDomain.__new__(__pyx_type) */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(3, 541, __pyx_L1_error) + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":542 - * cdef _memoryviewslice result = memoryview_copy(self) - * transpose_memslice(&result.from_slice) - * return result # <<<<<<<<<<<<<< - * - * @property + /* "(tree fragment)":4 + * if __pyx_checksum != 0x5e07de9: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x5e07de9 = (dims, domain, domain_counts, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = CountByDomain.__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_0x5e, __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_PickleError); + __pyx_t_2 = __pyx_v_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_CountByDomain(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x5e07de9: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x5e07de9 = (dims, domain, domain_counts, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x5e07de9 = (dims, domain, domain_counts, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = CountByDomain.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_CountByDomain__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain), __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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x5e07de9 = (dims, domain, domain_counts, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = CountByDomain.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_CountByDomain__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = CountByDomain.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_CountByDomain__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_CountByDomain__set_state(CountByDomain 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_2yt_8geometry_12oct_visitors___pyx_unpickle_CountByDomain__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *)__pyx_v_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 PickleError("Incompatible checksums (%s vs 0x5e07de9 = (dims, domain, domain_counts, global_index, ind, index, last, level, nz, oref, pos))" % __pyx_checksum) + * result = CountByDomain.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_CountByDomain__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_CountByDomain__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_CountByDomain__set_state(CountByDomain result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_counts = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":539 - * - * @property - * def T(self): # <<<<<<<<<<<<<< - * cdef _memoryviewslice result = memoryview_copy(self) - * transpose_memslice(&result.from_slice) + /* "(tree fragment)":1 + * def __pyx_unpickle_CountByDomain(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x5e07de9: + * from pickle import PickleError */ /* 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_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("yt.geometry.oct_visitors.__pyx_unpickle_CountByDomain", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":545 - * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.obj - * +/* "(tree fragment)":9 + * __pyx_unpickle_CountByDomain__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CountByDomain__set_state(CountByDomain result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_counts = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): */ -/* 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; +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_CountByDomain__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __pyx_t_5numpy_int32_t __pyx_t_3; + __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_5; + __pyx_t_5numpy_uint8_t __pyx_t_6[3]; + __pyx_t_5numpy_uint64_t __pyx_t_7; + __pyx_t_5numpy_int8_t __pyx_t_8; + __pyx_t_5numpy_int64_t __pyx_t_9[3]; + 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_CountByDomain__set_state", 0); - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_CountByDomain__set_state(CountByDomain result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_counts = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_1); + if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->domain_counts, 0); + __pyx_v_result->domain_counts = __pyx_t_4; + __pyx_t_4.memview = NULL; + __pyx_t_4.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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_5 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_6, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_6, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __pyx_t_8; + 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, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __pyx_t_8; + 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, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_9, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_9, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (3)); -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); + /* "(tree fragment)":11 + * cdef __pyx_unpickle_CountByDomain__set_state(CountByDomain result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_counts = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ + __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_counts = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) # <<<<<<<<<<<<<< + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_update); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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_12 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + if (!__pyx_t_14) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } 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_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":546 - * @property - * def base(self): - * return self.obj # <<<<<<<<<<<<<< - * - * @property + /* "(tree fragment)":11 + * cdef __pyx_unpickle_CountByDomain__set_state(CountByDomain result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_counts = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->obj); - __pyx_r = __pyx_v_self->obj; - goto __pyx_L0; + } - /* "View.MemoryView":545 - * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.obj - * + /* "(tree fragment)":9 + * __pyx_unpickle_CountByDomain__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CountByDomain__set_state(CountByDomain result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_counts = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(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_4, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_CountByDomain__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":549 - * - * @property - * def shape(self): # <<<<<<<<<<<<<< - * return tuple([length for length in self.view.shape[:self.view.ndim]]) - * +/* "(tree fragment)":1 + * def __pyx_unpickle_StoreOctree(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xafcb867: + * from pickle import PickleError */ /* 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) { +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_35__pyx_unpickle_StoreOctree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_12oct_visitors_35__pyx_unpickle_StoreOctree = {"__pyx_unpickle_StoreOctree", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_35__pyx_unpickle_StoreOctree, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_12oct_visitors_35__pyx_unpickle_StoreOctree(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("__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":550 - * @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(3, 550, __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(3, 550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 550, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle_StoreOctree (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StoreOctree", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StoreOctree", 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_StoreOctree") < 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]; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 550, __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":549 - * - * @property - * def shape(self): # <<<<<<<<<<<<<< - * return tuple([length for length in self.view.shape[:self.view.ndim]]) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_StoreOctree", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_StoreOctree", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "View.MemoryView":553 - * - * @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)); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_12oct_visitors_34__pyx_unpickle_StoreOctree(__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_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - Py_ssize_t __pyx_v_stride; +static PyObject *__pyx_pf_2yt_8geometry_12oct_visitors_34__pyx_unpickle_StoreOctree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; 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_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); + int __pyx_t_7; + __Pyx_RefNannySetupContext("__pyx_unpickle_StoreOctree", 0); - /* "View.MemoryView":554 - * @property - * def strides(self): - * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * - * raise ValueError("Buffer view does not expose strides") + /* "(tree fragment)":2 + * def __pyx_unpickle_StoreOctree(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xafcb867: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xafcb867 = (dims, domain, global_index, ind, index, last, level, nz, oref, pos, ref_mask))" % __pyx_checksum) */ - __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xafcb867) != 0); if (__pyx_t_1) { - /* "View.MemoryView":556 - * 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]]) + /* "(tree fragment)":3 + * def __pyx_unpickle_StoreOctree(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xafcb867: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xafcb867 = (dims, domain, global_index, ind, index, last, level, nz, oref, pos, ref_mask))" % __pyx_checksum) + * result = StoreOctree.__new__(__pyx_type) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 556, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __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_ERR(3, 556, __pyx_L1_error) + __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_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":554 - * @property - * def strides(self): - * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * - * raise ValueError("Buffer view does not expose strides") + /* "(tree fragment)":4 + * if __pyx_checksum != 0xafcb867: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xafcb867 = (dims, domain, global_index, ind, index, last, level, nz, oref, pos, ref_mask))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = StoreOctree.__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_0xaf, __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_PickleError); + __pyx_t_2 = __pyx_v_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_StoreOctree(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xafcb867: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xafcb867 = (dims, domain, global_index, ind, index, last, level, nz, oref, pos, ref_mask))" % __pyx_checksum) */ } - /* "View.MemoryView":558 - * raise ValueError("Buffer view does not expose strides") - * - * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< - * - * @property + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xafcb867 = (dims, domain, global_index, ind, index, last, level, nz, oref, pos, ref_mask))" % __pyx_checksum) + * result = StoreOctree.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_StoreOctree__set_state( result, __pyx_state) */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 558, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __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(3, 558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 558, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __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_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 558, __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; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xafcb867 = (dims, domain, global_index, ind, index, last, level, nz, oref, pos, ref_mask))" % __pyx_checksum) + * result = StoreOctree.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_StoreOctree__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = StoreOctree.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_StoreOctree__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_StoreOctree__set_state(StoreOctree 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_2yt_8geometry_12oct_visitors___pyx_unpickle_StoreOctree__set_state(((struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *)__pyx_v_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 PickleError("Incompatible checksums (%s vs 0xafcb867 = (dims, domain, global_index, ind, index, last, level, nz, oref, pos, ref_mask))" % __pyx_checksum) + * result = StoreOctree.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_StoreOctree__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_StoreOctree__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_StoreOctree__set_state(StoreOctree result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9]; result.ref_mask = __pyx_state[10] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":553 - * - * @property - * def strides(self): # <<<<<<<<<<<<<< - * if self.view.strides == NULL: - * + /* "(tree fragment)":1 + * def __pyx_unpickle_StoreOctree(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xafcb867: + * from pickle import 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.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_StoreOctree", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":561 - * - * @property - * def suboffsets(self): # <<<<<<<<<<<<<< - * if self.view.suboffsets == NULL: - * return (-1,) * self.view.ndim +/* "(tree fragment)":9 + * __pyx_unpickle_StoreOctree__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_StoreOctree__set_state(StoreOctree result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9]; result.ref_mask = __pyx_state[10] + * if hasattr(result, '__dict__'): */ -/* 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; +static PyObject *__pyx_f_2yt_8geometry_12oct_visitors___pyx_unpickle_StoreOctree__set_state(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_v_result, PyObject *__pyx_v___pyx_state) { 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); + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __pyx_t_5numpy_int32_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5[3]; + __pyx_t_5numpy_uint64_t __pyx_t_6; + __pyx_t_5numpy_int8_t __pyx_t_7; + __pyx_t_5numpy_int64_t __pyx_t_8[3]; + __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; + 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_StoreOctree__set_state", 0); - /* "View.MemoryView":562 - * @property - * def suboffsets(self): - * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< - * return (-1,) * self.view.ndim - * - */ - __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":563 - * def suboffsets(self): - * if self.view.suboffsets == NULL: - * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< - * - * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__19, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "View.MemoryView":562 - * @property - * def suboffsets(self): - * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< - * return (-1,) * self.view.ndim - * - */ + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_StoreOctree__set_state(StoreOctree result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9]; result.ref_mask = __pyx_state[10] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) + */ + 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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.dims = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.domain = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.global_index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_uint8_t(__pyx_t_1, __pyx_t_5, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + memcpy(&(__pyx_v_result->__pyx_base.ind[0]), __pyx_t_5, sizeof(__pyx_v_result->__pyx_base.ind[0]) * (3)); + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.index = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.last = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.level = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.nz = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.oref = __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_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int64_t(__pyx_t_1, __pyx_t_8, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->__pyx_base.pos[0]), __pyx_t_8, sizeof(__pyx_v_result->__pyx_base.pos[0]) * (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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_1); + if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result->ref_mask, 0); + __pyx_v_result->ref_mask = __pyx_t_9; + __pyx_t_9.memview = NULL; + __pyx_t_9.data = NULL; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_StoreOctree__set_state(StoreOctree result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9]; result.ref_mask = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) + */ + __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "(tree fragment)":12 + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9]; result.ref_mask = __pyx_state[10] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[11]) # <<<<<<<<<<<<<< + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_update); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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_12 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + if (!__pyx_t_14) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { + PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } 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_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":565 - * return (-1,) * self.view.ndim - * - * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< - * - * @property + /* "(tree fragment)":11 + * cdef __pyx_unpickle_StoreOctree__set_state(StoreOctree result, tuple __pyx_state): + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9]; result.ref_mask = __pyx_state[10] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[11]) */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); - for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { - __pyx_t_4 = __pyx_t_6; - __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(3, 565, __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(3, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - /* "View.MemoryView":561 - * - * @property - * def suboffsets(self): # <<<<<<<<<<<<<< - * if self.view.suboffsets == NULL: - * return (-1,) * self.view.ndim + /* "(tree fragment)":9 + * __pyx_unpickle_StoreOctree__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_StoreOctree__set_state(StoreOctree result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9]; result.ref_mask = __pyx_state[10] + * if hasattr(result, '__dict__'): */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __Pyx_XDECREF(__pyx_t_1); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("yt.geometry.oct_visitors.__pyx_unpickle_StoreOctree__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":568 - * - * @property - * def ndim(self): # <<<<<<<<<<<<<< - * return self.view.ndim +/* "selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * + * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): */ -/* 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; +static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_ensure_code", 0); - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "selection_routines.pxd":23 + * + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): # <<<<<<<<<<<<<< + * if "code_length" == str(arr.units): + * return arr + */ + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 23, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { -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); + /* "selection_routines.pxd":24 + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< + * return arr + * arr.convert_to_units("code_length") + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 24, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { - /* "View.MemoryView":569 - * @property - * def ndim(self): - * return self.view.ndim # <<<<<<<<<<<<<< + /* "selection_routines.pxd":25 + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): + * return arr # <<<<<<<<<<<<<< + * arr.convert_to_units("code_length") + * return arr + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + + /* "selection_routines.pxd":24 + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< + * return arr + * arr.convert_to_units("code_length") + */ + } + + /* "selection_routines.pxd":26 + * if "code_length" == str(arr.units): + * return arr + * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< + * return arr * - * @property + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "selection_routines.pxd":23 + * + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): # <<<<<<<<<<<<<< + * if "code_length" == str(arr.units): + * return arr + */ + } + + /* "selection_routines.pxd":27 + * return arr + * arr.convert_to_units("code_length") + * return arr # <<<<<<<<<<<<<< + * + * cdef class SelectorObject: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "View.MemoryView":568 - * - * @property - * def ndim(self): # <<<<<<<<<<<<<< - * return self.view.ndim + /* "selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * + * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): */ /* 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_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":572 - * - * @property - * def itemsize(self): # <<<<<<<<<<<<<< - * return self.view.itemsize +/* "selection_routines.pxd":78 + * cdef public SelectorObject sel2 * + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 */ -/* 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)); +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) { + __pyx_t_5numpy_float64_t __pyx_v_rel; + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "selection_routines.pxd":80 + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< + * if not periodic: return rel + * if rel > dw * 0.5: + */ + __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); -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); + /* "selection_routines.pxd":81 + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel # <<<<<<<<<<<<<< + * if rel > dw * 0.5: + * rel -= dw + */ + __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_rel; + goto __pyx_L0; + } - /* "View.MemoryView":573 - * @property - * def itemsize(self): - * return self.view.itemsize # <<<<<<<<<<<<<< - * - * @property + /* "selection_routines.pxd":82 + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel + * if rel > dw * 0.5: # <<<<<<<<<<<<<< + * rel -= dw + * elif rel < -dw * 0.5: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0); + if (__pyx_t_1) { + + /* "selection_routines.pxd":83 + * if not periodic: return rel + * if rel > dw * 0.5: + * rel -= dw # <<<<<<<<<<<<<< + * elif rel < -dw * 0.5: + * rel += dw + */ + __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw); + + /* "selection_routines.pxd":82 + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel + * if rel > dw * 0.5: # <<<<<<<<<<<<<< + * rel -= dw + * elif rel < -dw * 0.5: + */ + goto __pyx_L4; + } + + /* "selection_routines.pxd":84 + * if rel > dw * 0.5: + * rel -= dw + * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< + * rel += dw + * return rel + */ + __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0); + if (__pyx_t_1) { + + /* "selection_routines.pxd":85 + * rel -= dw + * elif rel < -dw * 0.5: + * rel += dw # <<<<<<<<<<<<<< + * return rel + */ + __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw); + + /* "selection_routines.pxd":84 + * if rel > dw * 0.5: + * rel -= dw + * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< + * rel += dw + * return rel + */ + } + __pyx_L4:; + + /* "selection_routines.pxd":86 + * elif rel < -dw * 0.5: + * rel += dw + * return rel # <<<<<<<<<<<<<< + */ + __pyx_r = __pyx_v_rel; goto __pyx_L0; - /* "View.MemoryView":572 - * - * @property - * def itemsize(self): # <<<<<<<<<<<<<< - * return self.view.itemsize + /* "selection_routines.pxd":78 + * cdef public SelectorObject sel2 * + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 */ /* 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":576 - * - * @property - * def nbytes(self): # <<<<<<<<<<<<<< - * return self.size * self.view.itemsize +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -/* 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 CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; -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); + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * + */ + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "View.MemoryView":577 - * @property - * def nbytes(self): - * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * @property + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __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(3, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "View.MemoryView":576 - * - * @property - * def nbytes(self): # <<<<<<<<<<<<<< - * return self.size * self.view.itemsize + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ /* 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":580 +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * - * @property - * def size(self): # <<<<<<<<<<<<<< - * if self._size is None: - * result = 1 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ -/* 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 +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; 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":581 - * @property - * def size(self): - * if self._size is None: # <<<<<<<<<<<<<< - * result = 1 + /* "yt/utilities/lib/fp_utils.pxd":24 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 * */ - __pyx_t_1 = (__pyx_v_self->_size == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "View.MemoryView":582 - * def size(self): - * if self._size is None: - * result = 1 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< * - * for length in self.view.shape[:self.view.ndim]: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - __Pyx_INCREF(__pyx_int_1); - __pyx_v_result = __pyx_int_1; + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "View.MemoryView":584 - * result = 1 - * - * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< - * result *= length + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - __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(3, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); - __pyx_t_6 = 0; - /* "View.MemoryView":585 - * - * 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(3, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); - __pyx_t_6 = 0; - } + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "View.MemoryView":587 - * result *= length - * - * self._size = result # <<<<<<<<<<<<<< +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * return self._size + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __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":581 - * @property - * def size(self): - * if self._size is None: # <<<<<<<<<<<<<< - * result = 1 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * */ + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - /* "View.MemoryView":589 - * self._size = result - * - * return self._size # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * def __len__(self): + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->_size); - __pyx_r = __pyx_v_self->_size; + __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "View.MemoryView":580 + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * @property - * def size(self): # <<<<<<<<<<<<<< - * if self._size is None: - * result = 1 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* 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":591 - * return self._size +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * def __len__(self): # <<<<<<<<<<<<<< - * if self.view.ndim >= 1: - * return self.view.shape[0] + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ -/* 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 +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - __Pyx_RefNannySetupContext("__len__", 0); - /* "View.MemoryView":592 + /* "yt/utilities/lib/fp_utils.pxd":32 * - * def __len__(self): - * if self.view.ndim >= 1: # <<<<<<<<<<<<<< - * return self.view.shape[0] + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 * */ - __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); if (__pyx_t_1) { - - /* "View.MemoryView":593 - * def __len__(self): - * if self.view.ndim >= 1: - * return self.view.shape[0] # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_r = (__pyx_v_self->view.shape[0]); + __pyx_r = __pyx_v_f0; goto __pyx_L0; - - /* "View.MemoryView":592 - * - * def __len__(self): - * if self.view.ndim >= 1: # <<<<<<<<<<<<<< - * return self.view.shape[0] - * - */ } - /* "View.MemoryView":595 - * return self.view.shape[0] - * - * return 0 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< * - * def __repr__(self): + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_r = 0; + __pyx_r = __pyx_v_f1; goto __pyx_L0; - /* "View.MemoryView":591 - * return self._size + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * def __len__(self): # <<<<<<<<<<<<<< - * if self.view.ndim >= 1: - * return self.view.shape[0] + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ /* function exit code */ __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":597 - * return 0 +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "" % (self.base.__class__.__name__, - * id(self)) + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ -/* 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); +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; - /* "View.MemoryView":598 + /* "yt/utilities/lib/fp_utils.pxd":36 * - * def __repr__(self): - * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< - * id(self)) + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 * */ - __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(3, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + if (__pyx_t_1) { + __pyx_r = (-__pyx_v_f0); + goto __pyx_L0; + } - /* "View.MemoryView":599 - * def __repr__(self): - * return "" % (self.base.__class__.__name__, - * id(self)) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< * - * def __str__(self): + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_v_f0; + goto __pyx_L0; - /* "View.MemoryView":598 - * - * def __repr__(self): - * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< - * id(self)) + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * - */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __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_3); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "View.MemoryView":597 - * return 0 - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "" % (self.base.__class__.__name__, - * id(self)) + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ /* 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":601 - * id(self)) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "" % (self.base.__class__.__name__,) +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ -/* 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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "View.MemoryView":602 + /* "yt/utilities/lib/fp_utils.pxd":40 * - * def __str__(self): - * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i + */ + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * + */ + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __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(3, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __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(3, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_v_i; goto __pyx_L0; - /* "View.MemoryView":601 - * id(self)) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "" % (self.base.__class__.__name__,) + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* 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":605 - * +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * def is_c_contig(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice *mslice - * cdef __Pyx_memviewslice tmp + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ -/* 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 CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; -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); + /* "yt/utilities/lib/fp_utils.pxd":45 + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i + */ + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "View.MemoryView":608 - * 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) + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * */ - __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "View.MemoryView":609 - * cdef __Pyx_memviewslice tmp - * mslice = get_slice_from_memview(self, &tmp) - * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * - * def is_f_contig(self): + * cdef inline np.float64_t fclip(np.float64_t f, */ - __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(3, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_v_i; goto __pyx_L0; - /* "View.MemoryView":605 - * + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * def is_c_contig(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice *mslice - * cdef __Pyx_memviewslice tmp + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* 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":611 - * return slice_is_contig(mslice[0], 'C', self.view.ndim) +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * def is_f_contig(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice *mslice - * cdef __Pyx_memviewslice tmp + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ -/* 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); +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; - /* "View.MemoryView":614 - * 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) + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; - /* "View.MemoryView":615 - * cdef __Pyx_memviewslice tmp - * mslice = get_slice_from_memview(self, &tmp) - * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * 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(3, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "View.MemoryView":611 - * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * - * def is_f_contig(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice *mslice - * cdef __Pyx_memviewslice tmp + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ /* 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":617 - * return slice_is_contig(mslice[0], 'F', self.view.ndim) +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * def copy(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice mslice - * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -/* 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 CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; -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); + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * + */ + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "View.MemoryView":619 - * def copy(self): - * cdef __Pyx_memviewslice mslice - * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * slice_copy(self, &mslice) + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "View.MemoryView":621 - * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * slice_copy(self, &mslice) # <<<<<<<<<<<<<< - * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, - * self.view.itemsize, + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); - /* "View.MemoryView":622 + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * slice_copy(self, &mslice) - * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< - * self.view.itemsize, - * flags|PyBUF_C_CONTIGUOUS, + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __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(3, 622, __pyx_L1_error) - __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":627 - * self.dtype_is_object) +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":58 * - * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * 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(3, 627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + */ + __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "View.MemoryView":617 - * return slice_is_contig(mslice[0], 'F', self.view.ndim) + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * def copy(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice mslice - * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* 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":629 - * return memoryview_copy_from_slice(self, &mslice) - * - * def copy_fortran(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice src, dst - * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ /* 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; +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("copy_fortran (wrapper)", 0); - __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __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 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; +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_memviewslice __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("copy_fortran", 0); + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "View.MemoryView":631 - * def copy_fortran(self): - * cdef __Pyx_memviewslice src, dst - * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * - * slice_copy(self, &src) + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim */ - __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "View.MemoryView":633 - * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * 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)); + __pyx_v_endian_detector = 1; - /* "View.MemoryView":634 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * - * slice_copy(self, &src) - * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< - * self.view.itemsize, - * flags|PyBUF_F_CONTIGUOUS, + * ndim = PyArray_NDIM(self) */ - __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(3, 634, __pyx_L1_error) - __pyx_v_dst = __pyx_t_1; + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "View.MemoryView":639 - * self.dtype_is_object) - * - * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __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(3, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "View.MemoryView":629 - * return memoryview_copy_from_slice(self, &mslice) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * def copy_fortran(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice src, dst - * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "View.MemoryView":643 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * - * @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 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ + __pyx_v_copy_shape = 1; -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + goto __pyx_L4; + } - /* "View.MemoryView":644 - * @cname('__pyx_memoryview_new') - * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): - * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< - * result.typeinfo = typeinfo - * return result + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 644, __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(3, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); - __pyx_t_2 = 0; + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; - /* "View.MemoryView":645 - * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): - * cdef memoryview result = memoryview(o, flags, dtype_is_object) - * result.typeinfo = typeinfo # <<<<<<<<<<<<<< - * return result + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_v_result->typeinfo = __pyx_v_typeinfo; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } - /* "View.MemoryView":646 - * cdef memoryview result = memoryview(o, flags, dtype_is_object) - * result.typeinfo = typeinfo - * return result # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") * - * @cname('__pyx_memoryview_check') */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); - goto __pyx_L0; + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "View.MemoryView":643 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * @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 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ + if (__pyx_t_1) { - /* 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; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 218, __pyx_L1_error) -/* "View.MemoryView":649 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * @cname('__pyx_memoryview_check') - * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< - * return isinstance(o, memoryview) + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; - /* "View.MemoryView":650 - * @cname('__pyx_memoryview_check') - * cdef inline bint memoryview_check(object o): - * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef tuple _unellipsify(object index, int ndim): + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); - __pyx_r = __pyx_t_1; - goto __pyx_L0; + if (__pyx_t_1) { - /* "View.MemoryView":649 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_check') - * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< - * return isinstance(o, memoryview) + * info.buf = PyArray_DATA(self) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 222, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + } - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); -/* "View.MemoryView":652 - * return isinstance(o, memoryview) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * - * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< - * """ - * Replace all ellipses with full slices and fill incomplete indices with + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ + __pyx_v_info->ndim = __pyx_v_ndim; -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { - /* "View.MemoryView":657 - * full slices. - * """ - * if not isinstance(index, tuple): # <<<<<<<<<<<<<< - * tup = (index,) - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - __pyx_t_1 = PyTuple_Check(__pyx_v_index); - __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); - if (__pyx_t_2) { + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "View.MemoryView":658 - * """ - * if not isinstance(index, tuple): - * tup = (index,) # <<<<<<<<<<<<<< - * else: - * tup = index + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 658, __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; + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "View.MemoryView":657 - * full slices. - * """ - * if not isinstance(index, tuple): # <<<<<<<<<<<<<< - * tup = (index,) - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ - goto __pyx_L3; - } + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "View.MemoryView":660 - * tup = (index,) - * else: - * tup = index # <<<<<<<<<<<<<< - * - * result = [] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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: */ - /*else*/ { - __Pyx_INCREF(__pyx_v_index); - __pyx_v_tup = __pyx_v_index; - } - __pyx_L3:; + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "View.MemoryView":662 - * tup = index - * - * result = [] # <<<<<<<<<<<<<< - * have_slices = False - * seen_ellipsis = False + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_result = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } - /* "View.MemoryView":663 - * - * result = [] - * have_slices = False # <<<<<<<<<<<<<< - * seen_ellipsis = False - * for idx, item in enumerate(tup): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_v_have_slices = 0; + goto __pyx_L11; + } - /* "View.MemoryView":664 - * result = [] - * have_slices = False - * seen_ellipsis = False # <<<<<<<<<<<<<< - * for idx, item in enumerate(tup): - * if item is Ellipsis: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL */ - __pyx_v_seen_ellipsis = 0; + /*else*/ { + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "View.MemoryView":665 - * have_slices = False - * seen_ellipsis = False - * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< - * if item is Ellipsis: - * if not seen_ellipsis: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) */ - __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(3, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); } - 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(3, 665, __pyx_L1_error) - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 665, __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(3, 665, __pyx_L1_error) - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 665, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 665, __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(3, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); - __pyx_t_3 = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_L11:; - /* "View.MemoryView":666 - * seen_ellipsis = False - * for idx, item in enumerate(tup): - * if item is Ellipsis: # <<<<<<<<<<<<<< - * if not seen_ellipsis: - * result.extend([slice(None)] * (ndim - len(tup) + 1)) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { + __pyx_v_info->suboffsets = NULL; - /* "View.MemoryView":667 - * for idx, item in enumerate(tup): - * if item is Ellipsis: - * if not seen_ellipsis: # <<<<<<<<<<<<<< - * result.extend([slice(None)] * (ndim - len(tup) + 1)) - * seen_ellipsis = True + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * */ - __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); - if (__pyx_t_1) { + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "View.MemoryView":668 - * if item is Ellipsis: - * if not seen_ellipsis: - * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< - * seen_ellipsis = True - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - { Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__20); - } - } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "View.MemoryView":669 - * if not seen_ellipsis: - * result.extend([slice(None)] * (ndim - len(tup) + 1)) - * seen_ellipsis = True # <<<<<<<<<<<<<< - * else: - * result.append(slice(None)) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ - __pyx_v_seen_ellipsis = 1; + __pyx_v_f = NULL; - /* "View.MemoryView":667 - * for idx, item in enumerate(tup): - * if item is Ellipsis: - * if not seen_ellipsis: # <<<<<<<<<<<<<< - * result.extend([slice(None)] * (ndim - len(tup) + 1)) - * seen_ellipsis = True + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset + * */ - goto __pyx_L7; - } + __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; - /* "View.MemoryView":671 - * seen_ellipsis = True - * else: - * result.append(slice(None)) # <<<<<<<<<<<<<< - * have_slices = True - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: */ - /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__21); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 671, __pyx_L1_error) - } - __pyx_L7:; + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "View.MemoryView":672 - * else: - * result.append(slice(None)) - * have_slices = True # <<<<<<<<<<<<<< - * else: - * if not isinstance(item, slice) and not PyIndex_Check(item): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - __pyx_v_have_slices = 1; + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { - /* "View.MemoryView":666 - * seen_ellipsis = False - * for idx, item in enumerate(tup): - * if item is Ellipsis: # <<<<<<<<<<<<<< - * if not seen_ellipsis: - * result.extend([slice(None)] * (ndim - len(tup) + 1)) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer */ - goto __pyx_L6; - } + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* "View.MemoryView":674 - * have_slices = True - * else: - * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< - * raise TypeError("Cannot index with type '%s'" % type(item)) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - /*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 (__pyx_t_1) { + goto __pyx_L14; + } - /* "View.MemoryView":675 - * else: - * if not isinstance(item, slice) and not PyIndex_Check(item): - * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * - * have_slices = have_slices or isinstance(item, slice) + * if not hasfields: */ - __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(3, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(3, 675, __pyx_L1_error) + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L14:; - /* "View.MemoryView":674 - * have_slices = True - * else: - * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< - * raise TypeError("Cannot index with type '%s'" % type(item)) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - } + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":677 - * raise TypeError("Cannot index with type '%s'" % type(item)) - * - * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< - * result.append(item) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ - __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; + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* "View.MemoryView":678 - * - * have_slices = have_slices or isinstance(item, slice) - * result.append(item) # <<<<<<<<<<<<<< - * - * nslices = ndim - len(result) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 678, __pyx_L1_error) + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { } - __pyx_L6:; + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; - /* "View.MemoryView":665 - * have_slices = False - * seen_ellipsis = False - * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< - * if item is Ellipsis: - * if not seen_ellipsis: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* "View.MemoryView":680 - * result.append(item) - * - * nslices = ndim - len(result) # <<<<<<<<<<<<<< - * if nslices: - * result.extend([slice(None)] * nslices) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 680, __pyx_L1_error) - __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + if (__pyx_t_1) { - /* "View.MemoryView":681 - * - * nslices = ndim - len(result) - * if nslices: # <<<<<<<<<<<<<< - * result.extend([slice(None)] * nslices) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_1 = (__pyx_v_nslices != 0); - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 259, __pyx_L1_error) - /* "View.MemoryView":682 - * nslices = ndim - len(result) - * if nslices: - * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< - * - * return have_slices or nslices, tuple(result) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - { Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__22); - __Pyx_GIVEREF(__pyx_slice__22); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__22); - } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 682, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":681 - * - * nslices = ndim - len(result) - * if nslices: # <<<<<<<<<<<<<< - * result.extend([slice(None)] * nslices) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - } + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "View.MemoryView":684 - * result.extend([slice(None)] * nslices) - * - * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< - * - * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - __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(3, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L14_bool_binop_done; - } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; - __pyx_t_4 = 0; - __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_r = ((PyObject*)__pyx_t_7); - __pyx_t_7 = 0; - goto __pyx_L0; + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "View.MemoryView":652 - * return isinstance(o, memoryview) - * - * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< - * """ - * Replace all ellipses with full slices and fill incomplete indices with + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* 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":686 - * 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: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "View.MemoryView":687 - * - * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): - * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< - * if suboffset >= 0: - * raise ValueError("Indirect dimensions not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ - __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]); + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* "View.MemoryView":688 - * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): - * for suboffset in suboffsets[:ndim]: - * if suboffset >= 0: # <<<<<<<<<<<<<< - * raise ValueError("Indirect dimensions not supported") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ - __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); - if (__pyx_t_4) { + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; - /* "View.MemoryView":689 - * for suboffset in suboffsets[:ndim]: - * if suboffset >= 0: - * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 689, __pyx_L1_error) + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "View.MemoryView":688 - * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): - * for suboffset in suboffsets[:ndim]: - * if suboffset >= 0: # <<<<<<<<<<<<<< - * raise ValueError("Indirect dimensions not supported") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - } - } + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "View.MemoryView":686 - * 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: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* 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; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; -/* "View.MemoryView":696 - * - * @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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; -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":697 - * @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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_v_new_ndim = 0; - __pyx_v_suboffset_dim = -1; + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "View.MemoryView":704 - * - * - * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< - * - * cdef _memoryviewslice memviewsliceobj + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "View.MemoryView":708 - * cdef _memoryviewslice memviewsliceobj - * - * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< - * - * if isinstance(memview, _memoryviewslice): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!Py_OptimizeFlag)) { - if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { - PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(3, 708, __pyx_L1_error) - } - } - #endif + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "View.MemoryView":710 - * assert memview.view.ndim > 0 - * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * memviewsliceobj = memview - * p_src = &memviewsliceobj.from_slice + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "View.MemoryView":711 - * - * if isinstance(memview, _memoryviewslice): - * memviewsliceobj = memview # <<<<<<<<<<<<<< - * p_src = &memviewsliceobj.from_slice - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(3, 711, __pyx_L1_error) - __pyx_t_3 = ((PyObject *)__pyx_v_memview); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); - __pyx_t_3 = 0; + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: - /* "View.MemoryView":712 - * if isinstance(memview, _memoryviewslice): - * memviewsliceobj = memview - * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< - * else: - * slice_copy(memview, &src) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return */ - __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(3, 278, __pyx_L1_error) + break; + } - /* "View.MemoryView":710 - * assert memview.view.ndim > 0 - * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * memviewsliceobj = memview - * p_src = &memviewsliceobj.from_slice + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: */ - goto __pyx_L3; - } + __pyx_v_info->format = __pyx_v_f; - /* "View.MemoryView":714 - * p_src = &memviewsliceobj.from_slice - * else: - * slice_copy(memview, &src) # <<<<<<<<<<<<<< - * p_src = &src - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) */ - /*else*/ { - __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + __pyx_r = 0; + goto __pyx_L0; - /* "View.MemoryView":715 - * else: - * slice_copy(memview, &src) - * p_src = &src # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_v_p_src = (&__pyx_v_src); } - __pyx_L3:; - /* "View.MemoryView":721 - * - * - * dst.memview = p_src.memview # <<<<<<<<<<<<<< - * dst.data = p_src.data - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ - __pyx_t_4 = __pyx_v_p_src->memview; - __pyx_v_dst.memview = __pyx_t_4; + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "View.MemoryView":722 - * - * dst.memview = p_src.memview - * dst.data = p_src.data # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, */ - __pyx_t_5 = __pyx_v_p_src->data; - __pyx_v_dst.data = __pyx_t_5; + (__pyx_v_info->format[0]) = '^'; - /* "View.MemoryView":727 - * - * - * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< - * cdef int *p_suboffset_dim = &suboffset_dim - * cdef Py_ssize_t start, stop, step + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ - __pyx_v_p_dst = (&__pyx_v_dst); + __pyx_v_offset = 0; - /* "View.MemoryView":728 - * - * 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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) */ - __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "View.MemoryView":732 - * cdef bint have_start, have_stop, have_step + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< * - * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< - * if PyIndex_Check(index): - * slice_memviewslice( + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - __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(3, 732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 732, __pyx_L1_error) + (__pyx_v_f[0]) = '\x00'; } - 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(3, 732, __pyx_L1_error) - #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 732, __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(3, 732, __pyx_L1_error) - #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 732, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 732, __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":733 - * - * for dim, index in enumerate(indices): - * if PyIndex_Check(index): # <<<<<<<<<<<<<< - * slice_memviewslice( - * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":737 - * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], - * dim, new_ndim, p_suboffset_dim, - * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< - * 0, 0, 0, # have_{start,stop,step} - * False) - */ - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 737, __pyx_L1_error) + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":734 - * for dim, index in enumerate(indices): - * if PyIndex_Check(index): - * slice_memviewslice( # <<<<<<<<<<<<<< - * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], - * dim, new_ndim, p_suboffset_dim, +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 734, __pyx_L1_error) - /* "View.MemoryView":733 +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * 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], + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - goto __pyx_L6; - } + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":740 - * 0, 0, 0, # have_{start,stop,step} - * False) - * elif index is None: # <<<<<<<<<<<<<< - * p_dst.shape[new_ndim] = 1 - * p_dst.strides[new_ndim] = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) */ - __pyx_t_2 = (__pyx_v_index == Py_None); - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { + free(__pyx_v_info->format); - /* "View.MemoryView":741 - * False) - * elif index is None: - * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< - * p_dst.strides[new_ndim] = 0 - * p_dst.suboffsets[new_ndim] = -1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + } - /* "View.MemoryView":742 - * 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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":743 - * p_dst.shape[new_ndim] = 1 - * p_dst.strides[new_ndim] = 0 - * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< - * new_ndim += 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * */ - (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + free(__pyx_v_info->strides); - /* "View.MemoryView":744 - * p_dst.strides[new_ndim] = 0 - * p_dst.suboffsets[new_ndim] = -1 - * new_ndim += 1 # <<<<<<<<<<<<<< - * else: - * start = index.start or 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } - /* "View.MemoryView":740 - * 0, 0, 0, # have_{start,stop,step} - * False) - * elif index is None: # <<<<<<<<<<<<<< - * p_dst.shape[new_ndim] = 1 - * p_dst.strides[new_ndim] = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - goto __pyx_L6; - } - /* "View.MemoryView":746 - * 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(3, 746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 746, __pyx_L1_error) - if (!__pyx_t_1) { - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 746, __pyx_L1_error) - __pyx_t_10 = __pyx_t_12; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_10 = 0; - __pyx_L7_bool_binop_done:; - __pyx_v_start = __pyx_t_10; + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "View.MemoryView":747 - * else: - * start = index.start or 0 - * stop = index.stop or 0 # <<<<<<<<<<<<<< - * step = index.step or 0 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 747, __pyx_L1_error) - if (!__pyx_t_1) { - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 747, __pyx_L1_error) - __pyx_t_10 = __pyx_t_12; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L9_bool_binop_done; - } - __pyx_t_10 = 0; - __pyx_L9_bool_binop_done:; - __pyx_v_stop = __pyx_t_10; - /* "View.MemoryView":748 - * start = index.start or 0 - * stop = index.stop or 0 - * step = index.step or 0 # <<<<<<<<<<<<<< - * - * have_start = index.start is not None - */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 748, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 748, __pyx_L1_error) - if (!__pyx_t_1) { - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 748, __pyx_L1_error) - __pyx_t_10 = __pyx_t_12; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L11_bool_binop_done; - } - __pyx_t_10 = 0; - __pyx_L11_bool_binop_done:; - __pyx_v_step = __pyx_t_10; +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); - /* "View.MemoryView":750 - * step = index.step or 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 * - * have_start = index.start is not None # <<<<<<<<<<<<<< - * have_stop = index.stop is not None - * have_step = index.step is not None + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 750, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = (__pyx_t_9 != Py_None); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_have_start = __pyx_t_1; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":751 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t * - * have_start = index.start is not None - * have_stop = index.stop is not None # <<<<<<<<<<<<<< - * have_step = index.step is not None + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 751, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = (__pyx_t_9 != Py_None); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_have_stop = __pyx_t_1; - /* "View.MemoryView":752 - * have_start = index.start is not None - * have_stop = index.stop is not None - * have_step = index.step is not None # <<<<<<<<<<<<<< - * - * slice_memviewslice( - */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 752, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = (__pyx_t_9 != Py_None); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_have_step = __pyx_t_1; + /* 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; +} - /* "View.MemoryView":754 - * have_step = index.step is not None +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) * - * slice_memviewslice( # <<<<<<<<<<<<<< - * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], - * dim, new_ndim, p_suboffset_dim, - */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 754, __pyx_L1_error) - - /* "View.MemoryView":760 - * have_start, have_stop, have_step, - * True) - * new_ndim += 1 # <<<<<<<<<<<<<< + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) * - * if isinstance(memview, _memoryviewslice): */ - __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); - } - __pyx_L6:; - /* "View.MemoryView":732 - * 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; +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); - /* "View.MemoryView":762 - * new_ndim += 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 * - * 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":763 + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< * - * if isinstance(memview, _memoryviewslice): - * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< - * memviewsliceobj.to_object_func, - * memviewsliceobj.to_dtype_func, + * cdef inline object PyArray_MultiIterNew3(a, b, c): */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); + __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(3, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":764 - * if isinstance(memview, _memoryviewslice): - * return memoryview_fromslice(dst, new_ndim, - * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< - * memviewsliceobj.to_dtype_func, - * memview.dtype_is_object) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 764, __pyx_L1_error) } - /* "View.MemoryView":765 - * return memoryview_fromslice(dst, new_ndim, - * memviewsliceobj.to_object_func, - * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< - * memview.dtype_is_object) - * else: - */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 765, __pyx_L1_error) } + /* 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; +} - /* "View.MemoryView":763 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) * - * 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(3, 763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 763, __pyx_L1_error) - __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "View.MemoryView":762 - * new_ndim += 1 + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * return memoryview_fromslice(dst, new_ndim, - * memviewsliceobj.to_object_func, */ - } - /* "View.MemoryView":768 - * memview.dtype_is_object) - * else: - * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< - * memview.dtype_is_object) - * - */ - /*else*/ { - __Pyx_XDECREF(((PyObject *)__pyx_r)); +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); - /* "View.MemoryView":769 - * else: - * return memoryview_fromslice(dst, new_ndim, NULL, NULL, - * memview.dtype_is_object) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 * + * 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_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(3, 768, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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(3, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":768 - * memview.dtype_is_object) - * else: - * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< - * memview.dtype_is_object) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) * - */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 768, __pyx_L1_error) - __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; - } - - /* "View.MemoryView":696 + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * - * @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_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":793 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) * - * @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; +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); - /* "View.MemoryView":813 - * cdef bint negative_step + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 * - * if not is_slice: # <<<<<<<<<<<<<< + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< * - * if start < 0: + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ - __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); - if (__pyx_t_1) { + __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(3, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":815 - * if not is_slice: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) * - * if start < 0: # <<<<<<<<<<<<<< - * start += shape - * if not 0 <= start < shape: */ - __pyx_t_1 = ((__pyx_v_start < 0) != 0); - if (__pyx_t_1) { - /* "View.MemoryView":816 + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) * - * 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":815 - * if not is_slice: +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 * - * if start < 0: # <<<<<<<<<<<<<< - * start += shape - * if not 0 <= start < shape: + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":817 - * if start < 0: - * start += shape - * if not 0 <= start < shape: # <<<<<<<<<<<<<< - * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) + * */ - __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":818 - * start += shape - * if not 0 <= start < shape: - * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< - * else: + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 818, __pyx_L1_error) - /* "View.MemoryView":817 - * if start < 0: - * start += shape - * if not 0 <= start < shape: # <<<<<<<<<<<<<< - * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) - * else: +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ - } + __pyx_v_endian_detector = 1; - /* "View.MemoryView":813 - * cdef bint negative_step + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields * - * if not is_slice: # <<<<<<<<<<<<<< + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * if start < 0: + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - goto __pyx_L3; + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(3, 794, __pyx_L1_error) } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_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(3, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; - /* "View.MemoryView":821 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 * - * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields * - * 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; + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(3, 795, __pyx_L1_error) } - __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; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* "View.MemoryView":823 - * negative_step = have_step != 0 and step < 0 - * - * if have_step and step == 0: # <<<<<<<<<<<<<< - * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< * + * if (end - f) - (new_offset - offset[0]) < 15: */ - __pyx_t_1 = (__pyx_v_have_step != 0); - if (__pyx_t_1) { + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(3, 796, __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(3, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif } else { - __pyx_t_2 = __pyx_t_1; - goto __pyx_L9_bool_binop_done; + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 796, __pyx_L1_error) } - __pyx_t_1 = ((__pyx_v_step == 0) != 0); - __pyx_t_2 = __pyx_t_1; - __pyx_L9_bool_binop_done:; - if (__pyx_t_2) { + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; - /* "View.MemoryView":824 - * - * if have_step and step == 0: - * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 824, __pyx_L1_error) - - /* "View.MemoryView":823 - * negative_step = have_step != 0 and step < 0 + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * - * if have_step and step == 0: # <<<<<<<<<<<<<< - * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * 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__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 799, __pyx_L1_error) - /* "View.MemoryView":827 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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") * - * if have_start: # <<<<<<<<<<<<<< - * if start < 0: - * start += shape */ - __pyx_t_2 = (__pyx_v_have_start != 0); - if (__pyx_t_2) { + } - /* "View.MemoryView":828 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * if have_start: - * if start < 0: # <<<<<<<<<<<<<< - * start += shape - * if start < 0: + * 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_2 = ((__pyx_v_start < 0) != 0); - if (__pyx_t_2) { + __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:; - /* "View.MemoryView":829 - * if have_start: - * if start < 0: - * start += shape # <<<<<<<<<<<<<< - * if start < 0: - * start = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython */ - __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + __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:; - /* "View.MemoryView":830 - * if start < 0: - * start += shape - * if start < 0: # <<<<<<<<<<<<<< - * start = 0 - * elif start >= shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_2 = ((__pyx_v_start < 0) != 0); - if (__pyx_t_2) { + if (__pyx_t_6) { - /* "View.MemoryView":831 - * start += shape - * if start < 0: - * start = 0 # <<<<<<<<<<<<<< - * elif start >= shape: - * if negative_step: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply */ - __pyx_v_start = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 803, __pyx_L1_error) - /* "View.MemoryView":830 - * if start < 0: - * start += shape - * if start < 0: # <<<<<<<<<<<<<< - * start = 0 - * elif start >= shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - } + } - /* "View.MemoryView":828 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * - * if have_start: - * if start < 0: # <<<<<<<<<<<<<< - * start += shape - * if start < 0: + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ - goto __pyx_L12; - } + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; - /* "View.MemoryView":832 - * if start < 0: - * start = 0 - * elif start >= shape: # <<<<<<<<<<<<<< - * if negative_step: - * start = shape - 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 */ - __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); - if (__pyx_t_2) { + (__pyx_v_f[0]) = 0x78; - /* "View.MemoryView":833 - * start = 0 - * elif start >= shape: - * if negative_step: # <<<<<<<<<<<<<< - * start = shape - 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * */ - __pyx_t_2 = (__pyx_v_negative_step != 0); - if (__pyx_t_2) { + __pyx_v_f = (__pyx_v_f + 1); - /* "View.MemoryView":834 - * elif start >= shape: - * if negative_step: - * start = shape - 1 # <<<<<<<<<<<<<< - * else: - * start = shape + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize */ - __pyx_v_start = (__pyx_v_shape - 1); + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } - /* "View.MemoryView":833 - * start = 0 - * elif start >= shape: - * if negative_step: # <<<<<<<<<<<<<< - * start = shape - 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): */ - goto __pyx_L14; - } + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "View.MemoryView":836 - * start = shape - 1 - * else: - * start = shape # <<<<<<<<<<<<<< - * else: - * if negative_step: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - /*else*/ { - __pyx_v_start = __pyx_v_shape; - } - __pyx_L14:; + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { - /* "View.MemoryView":832 - * if start < 0: - * start = 0 - * elif start >= shape: # <<<<<<<<<<<<<< - * if negative_step: - * start = shape - 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ - } - __pyx_L12:; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; - /* "View.MemoryView":827 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * - * if have_start: # <<<<<<<<<<<<<< - * if start < 0: - * start += shape + * # Until ticket #99 is fixed, use integers to avoid warnings */ - goto __pyx_L11; - } + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(3, 823, __pyx_L1_error) - /* "View.MemoryView":838 - * start = shape - * else: - * if negative_step: # <<<<<<<<<<<<<< - * start = shape - 1 - * else: - */ - /*else*/ { - __pyx_t_2 = (__pyx_v_negative_step != 0); - if (__pyx_t_2) { - - /* "View.MemoryView":839 - * else: - * if negative_step: - * start = shape - 1 # <<<<<<<<<<<<<< - * else: - * start = 0 - */ - __pyx_v_start = (__pyx_v_shape - 1); - - /* "View.MemoryView":838 - * start = shape - * else: - * if negative_step: # <<<<<<<<<<<<<< - * start = shape - 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * */ - goto __pyx_L15; } - /* "View.MemoryView":841 - * start = shape - 1 - * else: - * start = 0 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 * - * if have_stop: + * # 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" */ - /*else*/ { - __pyx_v_start = 0; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; } - __pyx_L15:; - } - __pyx_L11:; - /* "View.MemoryView":843 - * start = 0 - * - * if have_stop: # <<<<<<<<<<<<<< - * if stop < 0: - * stop += shape + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_2 = (__pyx_v_have_stop != 0); - if (__pyx_t_2) { + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } - /* "View.MemoryView":844 - * - * if have_stop: - * if stop < 0: # <<<<<<<<<<<<<< - * stop += shape - * if stop < 0: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_2 = ((__pyx_v_stop < 0) != 0); - if (__pyx_t_2) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } - /* "View.MemoryView":845 - * if have_stop: - * if stop < 0: - * stop += shape # <<<<<<<<<<<<<< - * if stop < 0: - * stop = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } - /* "View.MemoryView":846 - * if stop < 0: - * stop += shape - * if stop < 0: # <<<<<<<<<<<<<< - * stop = 0 - * elif stop > shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_2 = ((__pyx_v_stop < 0) != 0); - if (__pyx_t_2) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } - /* "View.MemoryView":847 - * stop += shape - * if stop < 0: - * stop = 0 # <<<<<<<<<<<<<< - * elif stop > shape: - * stop = shape + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_v_stop = 0; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } - /* "View.MemoryView":846 - * if stop < 0: - * stop += shape - * if stop < 0: # <<<<<<<<<<<<<< - * stop = 0 - * elif stop > shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - } + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } - /* "View.MemoryView":844 - * - * if have_stop: - * if stop < 0: # <<<<<<<<<<<<<< - * stop += shape - * if stop < 0: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - goto __pyx_L17; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; } - /* "View.MemoryView":848 - * if stop < 0: - * stop = 0 - * elif stop > shape: # <<<<<<<<<<<<<< - * stop = shape - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); - if (__pyx_t_2) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } - /* "View.MemoryView":849 - * stop = 0 - * elif stop > shape: - * stop = shape # <<<<<<<<<<<<<< - * else: - * if negative_step: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_v_stop = __pyx_v_shape; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } - /* "View.MemoryView":848 - * if stop < 0: - * stop = 0 - * elif stop > shape: # <<<<<<<<<<<<<< - * stop = shape - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; } - __pyx_L17:; - /* "View.MemoryView":843 - * start = 0 - * - * if have_stop: # <<<<<<<<<<<<<< - * if stop < 0: - * stop += shape + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - goto __pyx_L16; - } + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } - /* "View.MemoryView":851 - * stop = shape - * else: - * if negative_step: # <<<<<<<<<<<<<< - * stop = -1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - /*else*/ { - __pyx_t_2 = (__pyx_v_negative_step != 0); - if (__pyx_t_2) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } - /* "View.MemoryView":852 - * else: - * if negative_step: - * stop = -1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: - * stop = shape */ - __pyx_v_stop = -1L; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "View.MemoryView":851 - * stop = shape - * else: - * if negative_step: # <<<<<<<<<<<<<< - * stop = -1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - goto __pyx_L19; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; } - /* "View.MemoryView":854 - * stop = -1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: - * stop = shape # <<<<<<<<<<<<<< - * - * if not have_step: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: */ /*else*/ { - __pyx_v_stop = __pyx_v_shape; + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 844, __pyx_L1_error) } - __pyx_L19:; - } - __pyx_L16:; + __pyx_L15:; - /* "View.MemoryView":856 - * stop = shape - * - * if not have_step: # <<<<<<<<<<<<<< - * step = 1 - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), */ - __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); - if (__pyx_t_2) { + __pyx_v_f = (__pyx_v_f + 1); - /* "View.MemoryView":857 - * - * if not have_step: - * step = 1 # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __pyx_v_step = 1; + goto __pyx_L13; + } - /* "View.MemoryView":856 - * stop = shape - * - * if not have_step: # <<<<<<<<<<<<<< - * step = 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f * */ + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(3, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; } + __pyx_L13:; - /* "View.MemoryView":861 - * - * with cython.cdivision(True): - * new_shape = (stop - start) // step # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * if (stop - start) - step * new_shape: + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":863 - * new_shape = (stop - start) // step + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< * - * 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) { + __pyx_r = __pyx_v_f; + goto __pyx_L0; - /* "View.MemoryView":864 - * - * if (stop - start) - step * new_shape: - * new_shape += 1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * - * if new_shape < 0: + * 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. */ - __pyx_v_new_shape = (__pyx_v_new_shape + 1); - /* "View.MemoryView":863 - * new_shape = (stop - start) // step - * - * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< - * new_shape += 1 - * - */ - } + /* 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; +} - /* "View.MemoryView":866 - * new_shape += 1 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * if new_shape < 0: # <<<<<<<<<<<<<< - * new_shape = 0 * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":867 - * - * if new_shape < 0: - * new_shape = 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_new_shape = 0; +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); - /* "View.MemoryView":866 - * new_shape += 1 - * - * if new_shape < 0: # <<<<<<<<<<<<<< - * new_shape = 0 - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - } + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "View.MemoryView":870 - * - * - * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< - * dst.shape[new_ndim] = new_shape - * dst.suboffsets[new_ndim] = suboffset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! */ - (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + __pyx_v_baseptr = NULL; - /* "View.MemoryView":871 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr * - * dst.strides[new_ndim] = stride * step - * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< - * dst.suboffsets[new_ndim] = suboffset + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< * + * cdef inline object get_array_base(ndarray arr): */ - (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + __pyx_v_arr->base = __pyx_v_baseptr; - /* "View.MemoryView":872 - * dst.strides[new_ndim] = stride * step - * dst.shape[new_ndim] = new_shape - * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; - } - __pyx_L3:; - /* "View.MemoryView":875 + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * - * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< - * dst.data += start * stride + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None * else: */ - __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":876 - * - * if suboffset_dim[0] < 0: - * dst.data += start * stride # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< * else: - * dst.suboffsets[suboffset_dim[0]] += start * stride + * return arr.base */ - __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; - /* "View.MemoryView":875 - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * - * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< - * dst.data += start * stride + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None * else: */ - goto __pyx_L23; } - /* "View.MemoryView":878 - * dst.data += start * stride + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None * else: - * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * return arr.base # <<<<<<<<<<<<<< + * * - * 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_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; } - __pyx_L23:; - /* "View.MemoryView":880 - * dst.suboffsets[suboffset_dim[0]] += start * stride + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr * - * if suboffset >= 0: # <<<<<<<<<<<<<< - * if not is_slice: - * if new_ndim == 0: + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ - __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":881 - * - * 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) { + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":882 - * if suboffset >= 0: - * if not is_slice: - * if new_ndim == 0: # <<<<<<<<<<<<<< - * dst.data = ( dst.data)[0] + suboffset - * else: +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ - __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":883 - * if not is_slice: - * if new_ndim == 0: - * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< - * else: - * _err_dim(IndexError, "All dimensions preceding dimension %d " +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); + { + __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:*/ { - /* "View.MemoryView":882 - * if suboffset >= 0: - * if not is_slice: - * if new_ndim == 0: # <<<<<<<<<<<<<< - * dst.data = ( dst.data)[0] + suboffset - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") */ - goto __pyx_L26; - } + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 987, __pyx_L3_error) - /* "View.MemoryView":885 - * 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":886 - * else: - * _err_dim(IndexError, "All dimensions preceding dimension %d " - * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< - * else: - * suboffset_dim[0] = new_ndim + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 885, __pyx_L1_error) - } - __pyx_L26:; + } + __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:; + __Pyx_PyThreadState_assign - /* "View.MemoryView":881 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") * - * if suboffset >= 0: - * if not is_slice: # <<<<<<<<<<<<<< - * if new_ndim == 0: - * dst.data = ( dst.data)[0] + suboffset */ - goto __pyx_L25; - } + __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(3, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "View.MemoryView":888 - * "must be indexed and not sliced", dim) - * else: - * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * - * return 0 + * cdef inline int import_umath() except -1: */ - /*else*/ { - (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 989, __pyx_L5_except_error) } - __pyx_L25:; + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "View.MemoryView":880 - * dst.suboffsets[suboffset_dim[0]] += start * stride - * - * if suboffset >= 0: # <<<<<<<<<<<<<< - * if not is_slice: - * if new_ndim == 0: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; } - /* "View.MemoryView":890 - * suboffset_dim[0] = new_ndim - * - * return 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "View.MemoryView":793 - * - * @cname('__pyx_memoryview_slice_memviewslice') - * cdef int slice_memviewslice( # <<<<<<<<<<<<<< - * __Pyx_memviewslice *dst, - * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; __pyx_L1_error:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - } + __Pyx_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; } -/* "View.MemoryView":896 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * - * @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 + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -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; +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - int __pyx_t_2; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("pybuffer_index", 0); - - /* "View.MemoryView":898 - * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, - * Py_ssize_t dim) except NULL: - * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< - * cdef Py_ssize_t itemsize = view.itemsize - * cdef char *resultp - */ - __pyx_v_suboffset = -1L; + 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); - /* "View.MemoryView":899 - * Py_ssize_t dim) except NULL: - * cdef Py_ssize_t shape, stride, suboffset = -1 - * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< - * cdef char *resultp + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_1 = __pyx_v_view->itemsize; - __pyx_v_itemsize = __pyx_t_1; + { + __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:*/ { - /* "View.MemoryView":902 - * cdef char *resultp - * - * if view.ndim == 0: # <<<<<<<<<<<<<< - * shape = view.len / itemsize - * stride = itemsize + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); - if (__pyx_t_2) { + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 993, __pyx_L3_error) - /* "View.MemoryView":903 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * if view.ndim == 0: - * shape = view.len / itemsize # <<<<<<<<<<<<<< - * stride = itemsize - * else: + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - if (unlikely(__pyx_v_itemsize == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(3, 903, __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(3, 903, __pyx_L1_error) - } - __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + __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:; + __Pyx_PyThreadState_assign - /* "View.MemoryView":904 - * if view.ndim == 0: - * shape = view.len / itemsize - * stride = itemsize # <<<<<<<<<<<<<< - * else: - * shape = view.shape[dim] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * */ - __pyx_v_stride = __pyx_v_itemsize; + __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(3, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "View.MemoryView":902 - * cdef char *resultp + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * - * if view.ndim == 0: # <<<<<<<<<<<<<< - * shape = view.len / itemsize - * stride = itemsize + * cdef inline int import_ufunc() except -1: */ - goto __pyx_L3; - } + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "View.MemoryView":906 - * stride = itemsize - * else: - * shape = view.shape[dim] # <<<<<<<<<<<<<< - * stride = view.strides[dim] - * if view.suboffsets != NULL: - */ - /*else*/ { - __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); - - /* "View.MemoryView":907 - * 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":908 - * shape = view.shape[dim] - * stride = view.strides[dim] - * if view.suboffsets != NULL: # <<<<<<<<<<<<<< - * suboffset = view.suboffsets[dim] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); - if (__pyx_t_2) { + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "View.MemoryView":909 - * stride = view.strides[dim] - * if view.suboffsets != NULL: - * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * - * if index < 0: + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); - /* "View.MemoryView":908 - * shape = view.shape[dim] - * stride = view.strides[dim] - * if view.suboffsets != NULL: # <<<<<<<<<<<<<< - * suboffset = view.suboffsets[dim] + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - } - } - __pyx_L3:; - /* "View.MemoryView":911 - * suboffset = view.suboffsets[dim] +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * if index < 0: # <<<<<<<<<<<<<< - * index += view.shape[dim] - * if index < 0: + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_2 = ((__pyx_v_index < 0) != 0); - if (__pyx_t_2) { + { + __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:*/ { - /* "View.MemoryView":912 - * - * if index < 0: - * index += view.shape[dim] # <<<<<<<<<<<<<< - * if index < 0: - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 999, __pyx_L3_error) - /* "View.MemoryView":913 - * if index < 0: - * index += view.shape[dim] - * if index < 0: # <<<<<<<<<<<<<< - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_2 = ((__pyx_v_index < 0) != 0); - if (__pyx_t_2) { + } + __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:; + __Pyx_PyThreadState_assign - /* "View.MemoryView":914 - * index += view.shape[dim] - * if index < 0: - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< - * - * if index >= shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(3, 914, __pyx_L1_error) + __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(3, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "View.MemoryView":913 - * if index < 0: - * index += view.shape[dim] - * if index < 0: # <<<<<<<<<<<<<< - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 1001, __pyx_L5_except_error) } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "View.MemoryView":911 - * suboffset = view.suboffsets[dim] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * if index < 0: # <<<<<<<<<<<<<< - * index += view.shape[dim] - * if index < 0: + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; } - /* "View.MemoryView":916 - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * - * if index >= shape: # <<<<<<<<<<<<<< - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":917 - * - * if index >= shape: - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< - * - * resultp = bufp + index * stride - */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 917, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 917, __pyx_L1_error) + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":916 - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) +/* "yt/geometry/oct_container.pxd":56 * - * if index >= shape: # <<<<<<<<<<<<<< - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) * */ - } - /* "View.MemoryView":919 - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) { + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_cont", 0); + + /* "yt/geometry/oct_container.pxd":57 + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) # <<<<<<<<<<<<<< * - * resultp = bufp + index * stride # <<<<<<<<<<<<<< - * if suboffset >= 0: - * resultp = ( resultp)[0] + suboffset + * cdef OctList *OctList_append(OctList *list, Oct *o) */ - __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i]))); + goto __pyx_L0; - /* "View.MemoryView":920 + /* "yt/geometry/oct_container.pxd":56 * - * resultp = bufp + index * stride - * if suboffset >= 0: # <<<<<<<<<<<<<< - * resultp = ( resultp)[0] + suboffset + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) * */ - __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":921 - * resultp = bufp + index * stride - * if suboffset >= 0: - * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/oct_visitors.pxd":51 + * cdef void visit(self, Oct*, np.uint8_t selected) * - * return resultp + * cdef inline int oind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) */ - __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); - /* "View.MemoryView":920 +static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { + int __pyx_v_d; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("oind", 0); + + /* "yt/geometry/oct_visitors.pxd":52 * - * resultp = bufp + index * stride - * if suboffset >= 0: # <<<<<<<<<<<<<< - * resultp = ( resultp)[0] + suboffset + * cdef inline int oind(self): + * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) * */ - } + __pyx_v_d = (1 << __pyx_v_self->oref); - /* "View.MemoryView":923 - * resultp = ( resultp)[0] + suboffset - * - * return resultp # <<<<<<<<<<<<<< - * + /* "yt/geometry/oct_visitors.pxd":53 + * cdef inline int oind(self): + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) # <<<<<<<<<<<<<< * + * cdef inline int rind(self): */ - __pyx_r = __pyx_v_resultp; + __pyx_r = (((((__pyx_v_self->ind[0]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[2])); goto __pyx_L0; - /* "View.MemoryView":896 + /* "yt/geometry/oct_visitors.pxd":51 + * cdef void visit(self, Oct*, np.uint8_t selected) * - * @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 + * cdef inline int oind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) */ /* 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":929 - * - * @cname('__pyx_memslice_transpose') - * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< - * cdef int ndim = memslice.memview.view.ndim +/* "yt/geometry/oct_visitors.pxd":55 + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) * + * cdef inline int rind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) */ -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; +static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { + int __pyx_v_d; int __pyx_r; - int __pyx_t_1; - Py_ssize_t *__pyx_t_2; - long __pyx_t_3; - Py_ssize_t __pyx_t_4; - Py_ssize_t __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - - /* "View.MemoryView":930 - * @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":932 - * 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; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rind", 0); - /* "View.MemoryView":933 - * - * cdef Py_ssize_t *shape = memslice.shape - * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< - * + /* "yt/geometry/oct_visitors.pxd":56 * - */ - __pyx_t_2 = __pyx_v_memslice->strides; - __pyx_v_strides = __pyx_t_2; - - /* "View.MemoryView":937 + * cdef inline int rind(self): + * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) * - * cdef int i, j - * for i in range(ndim / 2): # <<<<<<<<<<<<<< - * j = ndim - 1 - i - * strides[i], strides[j] = strides[j], strides[i] */ - __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); - for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "View.MemoryView":938 - * 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); + __pyx_v_d = (1 << __pyx_v_self->oref); - /* "View.MemoryView":939 - * 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] + /* "yt/geometry/oct_visitors.pxd":57 + * cdef inline int rind(self): + * cdef int d = (1 << self.oref) + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) # <<<<<<<<<<<<<< * + * cdef class CountTotalOcts(OctVisitor): */ - __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); - __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); - (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; - (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + __pyx_r = (((((__pyx_v_self->ind[2]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[0])); + goto __pyx_L0; - /* "View.MemoryView":940 - * j = ndim - 1 - i - * strides[i], strides[j] = strides[j], strides[i] - * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + /* "yt/geometry/oct_visitors.pxd":55 + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) * - * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * cdef inline int rind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) */ - __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); - __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); - (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; - (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; - /* "View.MemoryView":942 - * shape[i], shape[j] = shape[j], shape[i] - * - * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< - * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * - */ - __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); - __pyx_t_6 = __pyx_t_7; - __pyx_L6_bool_binop_done:; - if (__pyx_t_6) { + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":943 - * - * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: - * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< +/* "yt/geometry/oct_visitors.pxd":123 + * cdef np.uint64_t *nfinest * - * return 1 + * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< + * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. + * return (((i*2)+j)*2+k) */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 943, __pyx_L1_error) - /* "View.MemoryView":942 - * shape[i], shape[j] = shape[j], shape[i] - * - * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< - * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * - */ - } - } +static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cind", 0); - /* "View.MemoryView":945 - * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * - * return 1 # <<<<<<<<<<<<<< - * + /* "yt/geometry/oct_visitors.pxd":125 + * cdef inline int cind(int i, int j, int k): + * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. + * return (((i*2)+j)*2+k) # <<<<<<<<<<<<<< * */ - __pyx_r = 1; + __pyx_r = ((((__pyx_v_i * 2) + __pyx_v_j) * 2) + __pyx_v_k); goto __pyx_L0; - /* "View.MemoryView":929 - * - * @cname('__pyx_memslice_transpose') - * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< - * cdef int ndim = memslice.memview.view.ndim + /* "yt/geometry/oct_visitors.pxd":123 + * cdef np.uint64_t *nfinest * + * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< + * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. + * return (((i*2)+j)*2+k) */ /* function exit code */ - __pyx_L1_error:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - } - __pyx_r = 0; __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":962 - * cdef int (*to_dtype_func)(char *, object) except 0 - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) +/* "carray.from_py":77 * + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_uint8_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_uint8_t(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: */ -/* 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)); +static int __Pyx_carray_from_py___pyx_t_5numpy_uint8_t(PyObject *__pyx_v_o, __pyx_t_5numpy_uint8_t *__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; + __pyx_t_5numpy_uint8_t __pyx_t_11; + char const *__pyx_t_12; + __Pyx_RefNannySetupContext("__Pyx_carray_from_py___pyx_t_5numpy_uint8_t", 0); + + /* "carray.from_py":78 + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_uint8_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_uint8_t(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; - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_uint8_t(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:*/ { -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); + /* "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 == -1)) __PYX_ERR(1, 80, __pyx_L3_error) + __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":963 - * - * def __dealloc__(self): - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< - * - * cdef convert_item_to_object(self, char *itemp): + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_uint8_t(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_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); + } + __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:; + __Pyx_PyThreadState_assign - /* "View.MemoryView":962 - * cdef int (*to_dtype_func)(char *, object) except 0 - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + /* "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___pyx_t_5numpy_uint8_t(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_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 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); - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} + /* "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) { -/* "View.MemoryView":965 - * __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) + /* "carray.from_py":86 + * for i, item in enumerate(o): + * if i >= length: + * break # <<<<<<<<<<<<<< + * v[i] = item + * else: */ + goto __pyx_L11_break; -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); + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item + */ + } - /* "View.MemoryView":966 - * - * cdef convert_item_to_object(self, char *itemp): - * if self.to_object_func != NULL: # <<<<<<<<<<<<<< - * return self.to_object_func(itemp) + /* "carray.from_py":87 + * if i >= length: + * break + * v[i] = item # <<<<<<<<<<<<<< * else: + * i += 1 # convert index to length */ - __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); - if (__pyx_t_1) { + __pyx_t_11 = __Pyx_PyInt_As_npy_uint8(__pyx_v_item); if (unlikely((__pyx_t_11 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 87, __pyx_L1_error) + (__pyx_v_v[__pyx_v_i]) = __pyx_t_11; - /* "View.MemoryView":967 - * cdef convert_item_to_object(self, char *itemp): - * if self.to_object_func != NULL: - * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + /* "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: - * return memoryview.convert_item_to_object(self, itemp) + * i += 1 # convert index to length # <<<<<<<<<<<<<< + * if i == length: + * return 0 */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 967, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_v_i = (__pyx_v_i + 1); - /* "View.MemoryView":966 - * - * cdef convert_item_to_object(self, char *itemp): - * if self.to_object_func != NULL: # <<<<<<<<<<<<<< - * return self.to_object_func(itemp) + /* "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) { - /* "View.MemoryView":969 - * return self.to_object_func(itemp) + /* "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: - * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 * - * 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(3, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + } + } + + /* "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: + */ } - /* "View.MemoryView":965 - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + /* "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 * - * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< - * if self.to_object_func != NULL: - * return self.to_object_func(itemp) + * 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(1, 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___pyx_t_5numpy_uint8_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_uint8_t(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: */ /* 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; + 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___pyx_t_5numpy_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); + __Pyx_XDECREF(__pyx_v_item); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":971 - * return memoryview.convert_item_to_object(self, itemp) +/* "carray.to_py":112 * - * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< - * if self.to_dtype_func != NULL: - * self.to_dtype_func(itemp, value) + * @cname("__Pyx_carray_to_py___pyx_t_5numpy_int64_t") + * cdef inline list __Pyx_carray_to_py___pyx_t_5numpy_int64_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ -static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { +static CYTHON_INLINE PyObject *__Pyx_carray_to_py___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_l = NULL; 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); + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + __Pyx_RefNannySetupContext("__Pyx_carray_to_py___pyx_t_5numpy_int64_t", 0); - /* "View.MemoryView":972 - * - * cdef assign_item_from_object(self, char *itemp, object value): - * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< - * self.to_dtype_func(itemp, value) - * else: + /* "carray.to_py":115 + * cdef size_t i + * cdef object value + * l = PyList_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] */ - __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); - if (__pyx_t_1) { + __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_l = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "View.MemoryView":973 - * cdef assign_item_from_object(self, char *itemp, object value): - * if self.to_dtype_func != NULL: - * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< - * else: - * memoryview.assign_item_from_object(self, itemp, value) + /* "carray.to_py":116 + * cdef object value + * l = PyList_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(3, 973, __pyx_L1_error) + __pyx_t_2 = ((size_t)__pyx_v_length); + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":972 + /* "carray.to_py":117 + * l = PyList_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "carray.to_py":118 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyList_SET_ITEM(l, i, value) + * return l + */ + Py_INCREF(__pyx_v_value); + + /* "carray.to_py":119 + * value = v[i] + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) # <<<<<<<<<<<<<< + * return l * - * 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; + PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value); } - /* "View.MemoryView":975 - * self.to_dtype_func(itemp, value) - * else: - * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + /* "carray.to_py":120 + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) + * return l # <<<<<<<<<<<<<< + * * - * @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(3, 975, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_L3:; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_l); + __pyx_r = __pyx_v_l; + goto __pyx_L0; - /* "View.MemoryView":971 - * return memoryview.convert_item_to_object(self, itemp) + /* "carray.to_py":112 * - * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< - * if self.to_dtype_func != NULL: - * self.to_dtype_func(itemp, value) + * @cname("__Pyx_carray_to_py___pyx_t_5numpy_int64_t") + * cdef inline list __Pyx_carray_to_py___pyx_t_5numpy_int64_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object 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_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py___pyx_t_5numpy_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_l); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":978 - * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.from_object +/* "carray.to_py":124 * + * @cname("__Pyx_carray_to_tuple___pyx_t_5numpy_int64_t") + * cdef inline tuple __Pyx_carray_to_tuple___pyx_t_5numpy_int64_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ -/* 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; +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_r = NULL; __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)); + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple___pyx_t_5numpy_int64_t", 0); - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "carray.to_py":127 + * cdef size_t i + * cdef object value + * t = PyTuple_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] + */ + __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_t = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; -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); + /* "carray.to_py":128 + * cdef object value + * t = PyTuple_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) + */ + __pyx_t_2 = ((size_t)__pyx_v_length); + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":979 - * @property - * def base(self): - * return self.from_object # <<<<<<<<<<<<<< - * - * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + /* "carray.to_py":129 + * t = PyTuple_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "carray.to_py":130 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(t, i, value) + * return t + */ + Py_INCREF(__pyx_v_value); + + /* "carray.to_py":131 + * value = v[i] + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) # <<<<<<<<<<<<<< + * return t + */ + PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value); + } + + /* "carray.to_py":132 + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) + * return t # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->from_object); - __pyx_r = __pyx_v_self->from_object; + __Pyx_INCREF(__pyx_v_t); + __pyx_r = __pyx_v_t; goto __pyx_L0; - /* "View.MemoryView":978 - * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.from_object + /* "carray.to_py":124 * + * @cname("__Pyx_carray_to_tuple___pyx_t_5numpy_int64_t") + * cdef inline tuple __Pyx_carray_to_tuple___pyx_t_5numpy_int64_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple___pyx_t_5numpy_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_t); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":985 +/* "carray.from_py":77 * - * @cname('__pyx_memoryview_fromslice') - * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< - * int ndim, - * object (*to_object_func)(char *), + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_int64_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_int64_t(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: */ -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; +static int __Pyx_carray_from_py___pyx_t_5numpy_int64_t(PyObject *__pyx_v_o, __pyx_t_5numpy_int64_t *__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 - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; 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); + 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; + __pyx_t_5numpy_int64_t __pyx_t_11; + char const *__pyx_t_12; + __Pyx_RefNannySetupContext("__Pyx_carray_from_py___pyx_t_5numpy_int64_t", 0); + + /* "carray.from_py":78 + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_int64_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_int64_t(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; - /* "View.MemoryView":993 - * cdef _memoryviewslice result - * - * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< - * return None - * + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_int64_t(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_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); - if (__pyx_t_1) { + { + __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:*/ { - /* "View.MemoryView":994 - * - * if memviewslice.memview == Py_None: - * return None # <<<<<<<<<<<<<< - * - * + /* "carray.from_py":80 + * cdef Py_ssize_t i = length + * try: + * i = len(o) # <<<<<<<<<<<<<< + * except (TypeError, OverflowError): + * pass */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 80, __pyx_L3_error) + __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":993 - * cdef _memoryviewslice result - * - * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< - * return None - * + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_int64_t(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:; + __Pyx_PyThreadState_assign - /* "View.MemoryView":999 - * - * - * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< - * - * result.from_slice = memviewslice + /* "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___pyx_t_5numpy_int64_t(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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 999, __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(3, 999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } - /* "View.MemoryView":1001 - * result = _memoryviewslice(None, 0, dtype_is_object) - * - * result.from_slice = memviewslice # <<<<<<<<<<<<<< - * __PYX_INC_MEMVIEW(&memviewslice, 1) - * + /* "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_v_result->from_slice = __pyx_v_memviewslice; + __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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 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); - /* "View.MemoryView":1002 - * - * result.from_slice = memviewslice - * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< - * - * result.from_object = ( memviewslice.memview).base + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item */ - __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0); + if (__pyx_t_6) { - /* "View.MemoryView":1004 - * __PYX_INC_MEMVIEW(&memviewslice, 1) - * - * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< - * result.typeinfo = memviewslice.memview.typeinfo - * + /* "carray.from_py":86 + * for i, item in enumerate(o): + * if i >= length: + * break # <<<<<<<<<<<<<< + * v[i] = item + * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1004, __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; + goto __pyx_L11_break; - /* "View.MemoryView":1005 - * - * result.from_object = ( memviewslice.memview).base - * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< - * - * result.view = memviewslice.memview.view + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item */ - __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; - __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + } - /* "View.MemoryView":1007 - * result.typeinfo = memviewslice.memview.typeinfo - * - * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< - * result.view.buf = memviewslice.data - * result.view.ndim = ndim + /* "carray.from_py":87 + * if i >= length: + * break + * v[i] = item # <<<<<<<<<<<<<< + * else: + * i += 1 # convert index to length */ - __pyx_t_5 = __pyx_v_memviewslice.memview->view; - __pyx_v_result->__pyx_base.view = __pyx_t_5; + __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_item); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 87, __pyx_L1_error) + (__pyx_v_v[__pyx_v_i]) = __pyx_t_11; - /* "View.MemoryView":1008 - * - * result.view = memviewslice.memview.view - * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< - * result.view.ndim = ndim - * (<__pyx_buffer *> &result.view).obj = Py_None + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break */ - __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + } + /*else*/ { - /* "View.MemoryView":1009 - * 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) + /* "carray.from_py":89 + * v[i] = item + * else: + * i += 1 # convert index to length # <<<<<<<<<<<<<< + * if i == length: + * return 0 */ - __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; + __pyx_v_i = (__pyx_v_i + 1); - /* "View.MemoryView":1010 - * result.view.buf = memviewslice.data - * result.view.ndim = ndim - * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< - * Py_INCREF(Py_None) + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 * */ - ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { - /* "View.MemoryView":1011 - * result.view.ndim = ndim - * (<__pyx_buffer *> &result.view).obj = Py_None - * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + /* "carray.from_py":91 + * i += 1 # convert index to length + * if i == length: + * return 0 # <<<<<<<<<<<<<< * - * result.flags = PyBUF_RECORDS + * PyErr_Format( */ - Py_INCREF(Py_None); + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L0; - /* "View.MemoryView":1013 - * Py_INCREF(Py_None) + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 * - * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< - * - * result.view.shape = result.from_slice.shape - */ - __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; - - /* "View.MemoryView":1015 - * result.flags = PyBUF_RECORDS - * - * 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":1016 - * - * 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":1019 - * - * - * result.view.suboffsets = NULL # <<<<<<<<<<<<<< - * for suboffset in result.from_slice.suboffsets[:ndim]: - * if suboffset >= 0: - */ - __pyx_v_result->__pyx_base.view.suboffsets = NULL; - - /* "View.MemoryView":1020 - * - * result.view.suboffsets = NULL - * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< - * if suboffset >= 0: - * result.view.suboffsets = result.from_slice.suboffsets - */ - __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); - for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { - __pyx_t_6 = __pyx_t_8; - __pyx_v_suboffset = (__pyx_t_6[0]); - - /* "View.MemoryView":1021 - * result.view.suboffsets = NULL - * for suboffset in result.from_slice.suboffsets[:ndim]: - * if suboffset >= 0: # <<<<<<<<<<<<<< - * result.view.suboffsets = result.from_slice.suboffsets - * break */ - __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); - if (__pyx_t_1) { + } + } - /* "View.MemoryView":1022 - * for suboffset in result.from_slice.suboffsets[:ndim]: - * if suboffset >= 0: - * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< - * break - * + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break */ - __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + __pyx_L11_break:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":1023 - * if suboffset >= 0: - * result.view.suboffsets = result.from_slice.suboffsets - * break # <<<<<<<<<<<<<< - * - * result.view.len = result.view.itemsize + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: */ - goto __pyx_L5_break; + } - /* "View.MemoryView":1021 - * result.view.suboffsets = NULL - * for suboffset in result.from_slice.suboffsets[:ndim]: - * if suboffset >= 0: # <<<<<<<<<<<<<< - * result.view.suboffsets = result.from_slice.suboffsets - * break + /* "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"); } - __pyx_L5_break:; - /* "View.MemoryView":1025 - * break + /* "carray.from_py":93 + * return 0 * - * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< - * for length in result.view.shape[:ndim]: - * result.view.len *= length + * PyErr_Format( # <<<<<<<<<<<<<< + * IndexError, + * ("too many values found during array assignment, expected %zd" */ - __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; - __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":1026 - * - * result.view.len = result.view.itemsize - * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< - * result.view.len *= length + /* "carray.from_py":77 * + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_int64_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_int64_t(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: */ - __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(3, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); - __pyx_t_2 = 0; - /* "View.MemoryView":1027 - * 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(3, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1027, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result->__pyx_base.view.len = __pyx_t_9; - } + /* 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___pyx_t_5numpy_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1029 - * result.view.len *= length +/* "View.MemoryView":120 + * cdef bint dtype_is_object * - * result.to_object_func = to_object_func # <<<<<<<<<<<<<< - * result.to_dtype_func = to_dtype_func + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): * */ - __pyx_v_result->to_object_func = __pyx_v_to_object_func; - /* "View.MemoryView":1030 - * - * 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; +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __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, 120, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) + } else { - /* "View.MemoryView":1032 - * result.to_dtype_func = to_dtype_func + /* "View.MemoryView":121 * - * return result # <<<<<<<<<<<<<< + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef int idx */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); - goto __pyx_L0; + __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, 120, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __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":985 + /* "View.MemoryView":120 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): * - * @cname('__pyx_memoryview_fromslice') - * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< - * int ndim, - * object (*to_object_func)(char *), */ /* function exit code */ + goto __pyx_L0; __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_r = -1; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_result); - __Pyx_XDECREF(__pyx_v_length); - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":1035 - * - * @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; +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 - int __pyx_t_1; + Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("get_slice_from_memview", 0); - - /* "View.MemoryView":1038 - * __Pyx_memviewslice *mslice): - * cdef _memoryviewslice obj - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * obj = memview - * return &obj.from_slice - */ - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "View.MemoryView":1039 - * cdef _memoryviewslice obj - * if isinstance(memview, _memoryviewslice): - * obj = memview # <<<<<<<<<<<<<< - * return &obj.from_slice - * else: - */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(3, 1039, __pyx_L1_error) - __pyx_t_3 = ((PyObject *)__pyx_v_memview); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "View.MemoryView":1040 - * 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":1038 - * __Pyx_memviewslice *mslice): - * cdef _memoryviewslice obj - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * obj = memview - * return &obj.from_slice - */ - } + 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; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); - /* "View.MemoryView":1042 - * return &obj.from_slice - * else: - * slice_copy(memview, mslice) # <<<<<<<<<<<<<< - * return mslice + /* "View.MemoryView":127 + * cdef PyObject **p * - */ - /*else*/ { - __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); - - /* "View.MemoryView":1043 - * else: - * slice_copy(memview, mslice) - * return mslice # <<<<<<<<<<<<<< + * self.ndim = len(shape) # <<<<<<<<<<<<<< + * self.itemsize = itemsize * - * @cname('__pyx_memoryview_slice_copy') */ - __pyx_r = __pyx_v_mslice; - goto __pyx_L0; + if (unlikely(__pyx_v_shape == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 127, __pyx_L1_error) } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); - /* "View.MemoryView":1035 + /* "View.MemoryView":128 * - * @cname('__pyx_memoryview_get_slice_from_memoryview') - * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *mslice): - * cdef _memoryviewslice obj - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_obj); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "View.MemoryView":1046 + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_slice_copy') - * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< - * cdef int dim - * cdef (Py_ssize_t*) shape, strides, suboffsets + * if not self.ndim: */ + __pyx_v_self->itemsize = __pyx_v_itemsize; -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; - Py_ssize_t __pyx_t_4; - __Pyx_RefNannySetupContext("slice_copy", 0); - - /* "View.MemoryView":1050 - * cdef (Py_ssize_t*) shape, strides, suboffsets + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") * - * 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; + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1051 + /* "View.MemoryView":131 * - * shape = memview.view.shape - * strides = memview.view.strides # <<<<<<<<<<<<<< - * suboffsets = memview.view.suboffsets + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< * + * if itemsize <= 0: */ - __pyx_t_1 = __pyx_v_memview->view.strides; - __pyx_v_strides = __pyx_t_1; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 131, __pyx_L1_error) - /* "View.MemoryView":1052 - * shape = memview.view.shape - * strides = memview.view.strides - * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") * - * dst.memview = <__pyx_memoryview *> memview */ - __pyx_t_1 = __pyx_v_memview->view.suboffsets; - __pyx_v_suboffsets = __pyx_t_1; + } - /* "View.MemoryView":1054 - * suboffsets = memview.view.suboffsets + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") * - * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< - * dst.data = memview.view.buf + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") * */ - __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1055 + /* "View.MemoryView":134 * - * dst.memview = <__pyx_memoryview *> memview - * dst.data = memview.view.buf # <<<<<<<<<<<<<< + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< * - * for dim in range(memview.view.ndim): + * if not isinstance(format, bytes): */ - __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 134, __pyx_L1_error) - /* "View.MemoryView":1057 - * dst.data = memview.view.buf + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") * - * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< - * dst.shape[dim] = shape[dim] - * dst.strides[dim] = strides[dim] */ - __pyx_t_2 = __pyx_v_memview->view.ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_dim = __pyx_t_3; + } - /* "View.MemoryView":1058 + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") * - * 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 + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string */ - (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + __pyx_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { - /* "View.MemoryView":1059 - * 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 + /* "View.MemoryView":137 * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format */ - (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); + __pyx_t_5 = 0; - /* "View.MemoryView":1060 - * dst.shape[dim] = shape[dim] - * dst.strides[dim] = strides[dim] - * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") * - * @cname('__pyx_memoryview_copy_object') + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string */ - if ((__pyx_v_suboffsets != 0)) { - __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]); - } else { - __pyx_t_4 = -1L; - } - (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4; } - /* "View.MemoryView":1046 - * - * @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":1063 + /* "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 * - * @cname('__pyx_memoryview_copy_object') - * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< - * "Create a new memoryview object" - * cdef __Pyx_memviewslice memviewslice */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) + __pyx_t_5 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; -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":1066 - * "Create a new memoryview object" - * cdef __Pyx_memviewslice memviewslice - * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< - * return memoryview_copy_from_slice(memview, &memviewslice) + /* "View.MemoryView":139 + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * * */ - __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_6; - /* "View.MemoryView":1067 - * cdef __Pyx_memviewslice memviewslice - * slice_copy(memview, &memviewslice) - * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + /* "View.MemoryView":142 + * + * + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< + * self._strides = self._shape + self.ndim * - * @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(3, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); - /* "View.MemoryView":1063 + /* "View.MemoryView":143 * - * @cname('__pyx_memoryview_copy_object') - * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< - * "Create a new memoryview object" - * cdef __Pyx_memviewslice memviewslice + * 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); - /* 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":1070 + /* "View.MemoryView":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") * - * @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. */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (__pyx_t_4) { -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":1077 - * cdef int (*to_dtype_func)(char *, object) except 0 + /* "View.MemoryView":146 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * * - * 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) { + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 146, __pyx_L1_error) - /* "View.MemoryView":1078 + /* "View.MemoryView":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") * - * 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":1079 - * 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 + /* "View.MemoryView":149 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) */ - __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; - __pyx_v_to_dtype_func = __pyx_t_4; + __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, 149, __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, 149, __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, 149, __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":1077 - * cdef int (*to_dtype_func)(char *, object) except 0 + /* "View.MemoryView":150 * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * to_object_func = (<_memoryviewslice> memview).to_object_func - * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim */ - goto __pyx_L3; - } + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (__pyx_t_4) { - /* "View.MemoryView":1081 - * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func - * else: - * to_object_func = NULL # <<<<<<<<<<<<<< - * to_dtype_func = NULL + /* "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 * */ - /*else*/ { - __pyx_v_to_object_func = NULL; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __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, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __PYX_ERR(1, 151, __pyx_L1_error) - /* "View.MemoryView":1082 - * else: - * to_object_func = NULL - * to_dtype_func = NULL # <<<<<<<<<<<<<< + /* "View.MemoryView":150 * - * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim */ - __pyx_v_to_dtype_func = NULL; - } - __pyx_L3:; + } - /* "View.MemoryView":1084 - * to_dtype_func = NULL + /* "View.MemoryView":152 + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim # <<<<<<<<<<<<<< * - * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< - * to_object_func, to_dtype_func, - * memview.dtype_is_object) + * cdef char order */ - __Pyx_XDECREF(__pyx_r); + (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; - /* "View.MemoryView":1086 - * return memoryview_fromslice(memviewslice[0], memview.view.ndim, - * to_object_func, to_dtype_func, - * memview.dtype_is_object) # <<<<<<<<<<<<<< + /* "View.MemoryView":149 * * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) */ - __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(3, 1084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "View.MemoryView":1070 + /* "View.MemoryView":155 * - * @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; -} + * 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, 155, __pyx_L1_error) + if (__pyx_t_4) { -/* "View.MemoryView":1092 - * - * - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< - * if arg < 0: - * return -arg + /* "View.MemoryView":156 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': */ + __pyx_v_order = 'F'; -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":157 + * 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":1093 + /* "View.MemoryView":155 * - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: - * if arg < 0: # <<<<<<<<<<<<<< - * return -arg - * else: + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' */ - __pyx_t_1 = ((__pyx_v_arg < 0) != 0); - if (__pyx_t_1) { + goto __pyx_L10; + } - /* "View.MemoryView":1094 - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: - * if arg < 0: - * return -arg # <<<<<<<<<<<<<< - * else: - * return arg + /* "View.MemoryView":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' */ - __pyx_r = (-__pyx_v_arg); - goto __pyx_L0; + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) + if (__pyx_t_4) { - /* "View.MemoryView":1093 - * - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: - * if arg < 0: # <<<<<<<<<<<<<< - * return -arg - * else: + /* "View.MemoryView":159 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":160 + * 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":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' */ + goto __pyx_L10; } - /* "View.MemoryView":1096 - * return -arg - * else: - * return arg # <<<<<<<<<<<<<< + /* "View.MemoryView":162 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< * - * @cname('__pyx_get_best_slice_order') + * self.len = fill_contig_strides_array(self._shape, self._strides, */ /*else*/ { - __pyx_r = __pyx_v_arg; - goto __pyx_L0; + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 162, __pyx_L1_error) } + __pyx_L10:; - /* "View.MemoryView":1092 + /* "View.MemoryView":164 + * 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) * - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< - * if arg < 0: - * return -arg */ + __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); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "View.MemoryView":1099 + /* "View.MemoryView":167 + * itemsize, self.ndim, order) * - * @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. + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; -static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { - int __pyx_v_i; - Py_ssize_t __pyx_v_c_stride; - Py_ssize_t __pyx_v_f_stride; - char __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - - /* "View.MemoryView":1104 - * """ - * cdef int i - * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< - * cdef Py_ssize_t f_stride = 0 + /* "View.MemoryView":168 * - */ - __pyx_v_c_stride = 0; - - /* "View.MemoryView":1105 - * cdef int i - * cdef Py_ssize_t c_stride = 0 - * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: * - * for i in range(ndim - 1, -1, -1): */ - __pyx_v_f_stride = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; - /* "View.MemoryView":1107 - * cdef Py_ssize_t f_stride = 0 + /* "View.MemoryView":169 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * * - * 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 > -1L; __pyx_t_1-=1) { - __pyx_v_i = __pyx_t_1; + __pyx_t_4 = (__pyx_v_allocate_buffer != 0); + if (__pyx_t_4) { - /* "View.MemoryView":1108 + /* "View.MemoryView":172 * - * for i in range(ndim - 1, -1, -1): - * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< - * c_stride = mslice.strides[i] - * break + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") */ - __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); - if (__pyx_t_2) { + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); - /* "View.MemoryView":1109 - * for i in range(ndim - 1, -1, -1): - * if mslice.shape[i] > 1: - * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< - * break + /* "View.MemoryView":173 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") * */ - __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); + if (__pyx_t_4) { - /* "View.MemoryView":1110 - * if mslice.shape[i] > 1: - * c_stride = mslice.strides[i] - * break # <<<<<<<<<<<<<< + /* "View.MemoryView":174 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< * - * for i in range(ndim): + * if self.dtype_is_object: */ - goto __pyx_L4_break; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 174, __pyx_L1_error) - /* "View.MemoryView":1108 + /* "View.MemoryView":173 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") * - * for i in range(ndim - 1, -1, -1): - * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< - * c_stride = mslice.strides[i] - * break */ } - } - __pyx_L4_break:; - /* "View.MemoryView":1112 - * break + /* "View.MemoryView":176 + * raise MemoryError("unable to allocate array data.") * - * for i in range(ndim): # <<<<<<<<<<<<<< - * if mslice.shape[i] > 1: - * f_stride = mslice.strides[i] + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): */ - __pyx_t_1 = __pyx_v_ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { - /* "View.MemoryView":1113 + /* "View.MemoryView":177 * - * for i in range(ndim): - * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< - * f_stride = mslice.strides[i] - * break + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None */ - __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); - if (__pyx_t_2) { + __pyx_v_p = ((PyObject **)__pyx_v_self->data); - /* "View.MemoryView":1114 - * for i in range(ndim): - * if mslice.shape[i] > 1: - * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< - * break - * + /* "View.MemoryView":178 + * if self.dtype_is_object: + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) */ - __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(1, 178, __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, 178, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; - /* "View.MemoryView":1115 - * if mslice.shape[i] > 1: - * f_stride = mslice.strides[i] - * break # <<<<<<<<<<<<<< + /* "View.MemoryView":179 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) * - * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): */ - goto __pyx_L7_break; + (__pyx_v_p[__pyx_v_i]) = Py_None; - /* "View.MemoryView":1113 + /* "View.MemoryView":180 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * - * for i in range(ndim): - * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< - * f_stride = mslice.strides[i] - * break + * @cname('getbuffer') */ - } - } - __pyx_L7_break:; + Py_INCREF(Py_None); + } - /* "View.MemoryView":1117 - * break + /* "View.MemoryView":176 + * raise MemoryError("unable to allocate array data.") * - * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< - * return 'C' - * else: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): */ - __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":1118 + /* "View.MemoryView":169 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< * - * 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":1117 - * break * - * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< - * return 'C' - * else: */ } - /* "View.MemoryView":1120 - * return 'C' - * else: - * return 'F' # <<<<<<<<<<<<<< + /* "View.MemoryView":120 + * cdef bint dtype_is_object * - * @cython.cdivision(True) - */ - /*else*/ { - __pyx_r = 'F'; - goto __pyx_L0; - } - - /* "View.MemoryView":1099 + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): * - * @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_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":1123 +/* "View.MemoryView":183 * - * @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, + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": */ -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; +/* 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; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; + 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; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "View.MemoryView":1130 - * - * 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] + /* "View.MemoryView":184 + * @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_src_extent = (__pyx_v_src_shape[0]); + __pyx_v_bufmode = -1; - /* "View.MemoryView":1131 - * cdef Py_ssize_t i - * cdef Py_ssize_t src_extent = src_shape[0] - * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t src_stride = src_strides[0] - * cdef Py_ssize_t dst_stride = dst_strides[0] + /* "View.MemoryView":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": */ - __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1132 - * cdef Py_ssize_t src_extent = src_shape[0] - * cdef Py_ssize_t dst_extent = dst_shape[0] - * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t dst_stride = dst_strides[0] - * + /* "View.MemoryView":186 + * 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_src_stride = (__pyx_v_src_strides[0]); + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); - /* "View.MemoryView":1133 - * cdef Py_ssize_t dst_extent = dst_shape[0] - * cdef Py_ssize_t src_stride = src_strides[0] - * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< - * - * if ndim == 1: + /* "View.MemoryView":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": */ - __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + goto __pyx_L3; + } - /* "View.MemoryView":1135 - * 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): + /* "View.MemoryView":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): */ - __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "View.MemoryView":1136 - * - * 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":1137 - * 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: + /* "View.MemoryView":188 + * 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_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:; + __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); - /* "View.MemoryView":1136 - * - * 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) + /* "View.MemoryView":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): */ - if (__pyx_t_1) { + } + __pyx_L3:; - /* "View.MemoryView":1138 - * 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): + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data */ - memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1136 - * - * 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) + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len */ - goto __pyx_L4; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 190, __pyx_L1_error) - /* "View.MemoryView":1140 - * memcpy(dst_data, src_data, itemsize * dst_extent) - * else: - * for i in range(dst_extent): # <<<<<<<<<<<<<< - * memcpy(dst_data, src_data, itemsize) - * src_data += src_stride + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data */ - /*else*/ { - __pyx_t_4 = __pyx_v_dst_extent; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + } - /* "View.MemoryView":1141 - * else: - * for i in range(dst_extent): - * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< - * src_data += src_stride - * dst_data += dst_stride + /* "View.MemoryView":191 + * 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 */ - memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; - /* "View.MemoryView":1142 - * for i in range(dst_extent): - * memcpy(dst_data, src_data, itemsize) - * src_data += src_stride # <<<<<<<<<<<<<< - * dst_data += dst_stride - * else: + /* "View.MemoryView":192 + * 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_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; - /* "View.MemoryView":1143 - * memcpy(dst_data, src_data, itemsize) - * src_data += src_stride - * dst_data += dst_stride # <<<<<<<<<<<<<< - * else: - * for i in range(dst_extent): + /* "View.MemoryView":193 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides */ - __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); - } - } - __pyx_L4:; + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; - /* "View.MemoryView":1135 - * 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): + /* "View.MemoryView":194 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL */ - goto __pyx_L3; - } + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; - /* "View.MemoryView":1145 - * dst_data += dst_stride - * else: - * for i in range(dst_extent): # <<<<<<<<<<<<<< - * _copy_strided_to_strided(src_data, src_strides + 1, - * dst_data, dst_strides + 1, + /* "View.MemoryView":195 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize */ - /*else*/ { - __pyx_t_4 = __pyx_v_dst_extent; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; - /* "View.MemoryView":1146 - * 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, + /* "View.MemoryView":196 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 */ - _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); + __pyx_v_info->suboffsets = NULL; - /* "View.MemoryView":1150 - * src_shape + 1, dst_shape + 1, - * ndim - 1, itemsize) - * src_data += src_stride # <<<<<<<<<<<<<< - * dst_data += dst_stride + /* "View.MemoryView":197 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 * */ - __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; - /* "View.MemoryView":1151 - * ndim - 1, itemsize) - * src_data += src_stride - * dst_data += dst_stride # <<<<<<<<<<<<<< + /* "View.MemoryView":198 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< * - * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + * if flags & PyBUF_FORMAT: */ - __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); - } - } - __pyx_L3:; + __pyx_v_info->readonly = 0; - /* "View.MemoryView":1123 + /* "View.MemoryView":200 + * info.readonly = 0 * - * @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, + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { - /* function exit code */ -} + /* "View.MemoryView":201 + * + * 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":1153 - * dst_data += dst_stride + /* "View.MemoryView":200 + * info.readonly = 0 * - * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *dst, - * int ndim, size_t itemsize) nogil: + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: */ + goto __pyx_L5; + } -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":203 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; - /* "View.MemoryView":1156 - * __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) + /* "View.MemoryView":205 + * info.format = NULL + * + * info.obj = self # <<<<<<<<<<<<<< * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") */ - _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); + __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":1153 - * dst_data += dst_stride + /* "View.MemoryView":183 * - * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *dst, - * int ndim, size_t itemsize) nogil: + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "View.MemoryView":1160 +/* "View.MemoryView":209 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") * - * @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 + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) */ -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; +/* 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)); - /* "View.MemoryView":1163 - * "Return the size of the memory occupied by the slice in number of bytes" - * cdef int i - * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + /* 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":210 * - * for i in range(ndim): + * 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_src->memview->view.itemsize; - __pyx_v_size = __pyx_t_1; + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1165 - * cdef Py_ssize_t size = src.memview.view.itemsize - * - * for i in range(ndim): # <<<<<<<<<<<<<< - * size *= src.shape[i] - * + /* "View.MemoryView":211 + * 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_t_2 = __pyx_v_ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + __pyx_v_self->callback_free_data(__pyx_v_self->data); - /* "View.MemoryView":1166 - * - * for i in range(ndim): - * size *= src.shape[i] # <<<<<<<<<<<<<< + /* "View.MemoryView":210 * - * return size + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: */ - __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i])); + goto __pyx_L3; } - /* "View.MemoryView":1168 - * size *= src.shape[i] - * - * return size # <<<<<<<<<<<<<< - * - * @cname('__pyx_fill_contig_strides_array') + /* "View.MemoryView":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, */ - __pyx_r = __pyx_v_size; - goto __pyx_L0; + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1160 - * - * @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 + /* "View.MemoryView":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "View.MemoryView":1171 - * - * @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: + /* "View.MemoryView":214 + * 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); -static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { - int __pyx_v_idx; - Py_ssize_t __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - - /* "View.MemoryView":1180 - * cdef int idx - * - * if order == 'F': # <<<<<<<<<<<<<< - * for idx in range(ndim): - * strides[idx] = stride + /* "View.MemoryView":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) */ - __pyx_t_1 = ((__pyx_v_order == 'F') != 0); - if (__pyx_t_1) { + } - /* "View.MemoryView":1181 + /* "View.MemoryView":216 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyObject_Free(self._shape) * - * if order == 'F': - * for idx in range(ndim): # <<<<<<<<<<<<<< - * strides[idx] = stride - * stride = stride * shape[idx] */ - __pyx_t_2 = __pyx_v_ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_idx = __pyx_t_3; + free(__pyx_v_self->data); - /* "View.MemoryView":1182 - * if order == 'F': - * for idx in range(ndim): - * strides[idx] = stride # <<<<<<<<<<<<<< - * stride = stride * shape[idx] - * else: + /* "View.MemoryView":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, */ - (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + } + __pyx_L3:; - /* "View.MemoryView":1183 - * for idx in range(ndim): - * strides[idx] = stride - * stride = stride * shape[idx] # <<<<<<<<<<<<<< - * else: - * for idx in range(ndim - 1, -1, -1): + /* "View.MemoryView":217 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property */ - __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); - } + PyObject_Free(__pyx_v_self->_shape); - /* "View.MemoryView":1180 - * cdef int idx + /* "View.MemoryView":209 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") * - * if order == 'F': # <<<<<<<<<<<<<< - * for idx in range(ndim): - * strides[idx] = stride + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) */ - goto __pyx_L3; - } - /* "View.MemoryView":1185 - * 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 > -1L; __pyx_t_2-=1) { - __pyx_v_idx = __pyx_t_2; + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "View.MemoryView":1186 - * else: - * for idx in range(ndim - 1, -1, -1): - * strides[idx] = stride # <<<<<<<<<<<<<< - * stride = stride * shape[idx] +/* "View.MemoryView":220 * - */ - (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; - - /* "View.MemoryView":1187 - * for idx in range(ndim - 1, -1, -1): - * strides[idx] = stride - * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() * - * return stride */ - __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); - } - } - __pyx_L3:; - /* "View.MemoryView":1189 - * stride = stride * shape[idx] - * - * return stride # <<<<<<<<<<<<<< +/* 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":221 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_copy_data_to_temp') + * @cname('get_memview') */ - __pyx_r = __pyx_v_stride; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":1171 + /* "View.MemoryView":220 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() * - * @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_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":1192 +/* "View.MemoryView":224 * - * @cname('__pyx_memoryview_copy_data_to_temp') - * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *tmpslice, - * char order, + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) */ -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; +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":1203 - * cdef void *result - * - * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< - * cdef size_t size = slice_get_size(src, ndim) + /* "View.MemoryView":225 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) * */ - __pyx_t_1 = __pyx_v_src->memview->view.itemsize; - __pyx_v_itemsize = __pyx_t_1; + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); - /* "View.MemoryView":1204 + /* "View.MemoryView":226 + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< * - * 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); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __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, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "View.MemoryView":1206 - * cdef size_t size = slice_get_size(src, ndim) + /* "View.MemoryView":224 * - * result = malloc(size) # <<<<<<<<<<<<<< - * if not result: - * _err(MemoryError, NULL) + * @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_result = malloc(__pyx_v_size); - /* "View.MemoryView":1207 + /* 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 * - * result = malloc(size) - * if not result: # <<<<<<<<<<<<<< - * _err(MemoryError, NULL) + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) * */ - __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":1208 - * result = malloc(size) - * if not result: - * _err(MemoryError, NULL) # <<<<<<<<<<<<<< +/* 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_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":230 * + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< * + * def __getitem__(self, item): */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 1208, __pyx_L1_error) + __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, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "View.MemoryView":1207 + /* "View.MemoryView":229 * - * result = malloc(size) - * if not result: # <<<<<<<<<<<<<< - * _err(MemoryError, NULL) + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) * */ - } - /* "View.MemoryView":1211 + /* 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":232 + * return getattr(self.memview, attr) * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] * - * tmpslice.data = result # <<<<<<<<<<<<<< - * tmpslice.memview = src.memview - * for i in range(ndim): */ - __pyx_v_tmpslice->data = ((char *)__pyx_v_result); - /* "View.MemoryView":1212 - * - * 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; +/* 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_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); - /* "View.MemoryView":1213 - * 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; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1214 - * 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]); +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getitem__", 0); - /* "View.MemoryView":1215 - * for i in range(ndim): - * tmpslice.shape[i] = src.shape[i] - * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + /* "View.MemoryView":233 * - * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): */ - (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; - } + __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 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "View.MemoryView":1217 - * tmpslice.suboffsets[i] = -1 + /* "View.MemoryView":232 + * return getattr(self.memview, attr) * - * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< - * ndim, order) + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] * */ - __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":1221 + /* 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":235 + * return self.memview[item] * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value * - * for i in range(ndim): # <<<<<<<<<<<<<< - * if tmpslice.shape[i] == 1: - * tmpslice.strides[i] = 0 */ - __pyx_t_3 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - /* "View.MemoryView":1222 +/* 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_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":236 * - * for i in range(ndim): - * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< - * tmpslice.strides[i] = 0 + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< * - */ - __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); - if (__pyx_t_2) { - - /* "View.MemoryView":1223 - * 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; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":1222 + /* "View.MemoryView":235 + * return self.memview[item] * - * for i in range(ndim): - * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< - * tmpslice.strides[i] = 0 + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value * */ - } - } - /* "View.MemoryView":1225 - * 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) { + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1226 - * - * if slice_is_contig(src[0], order, ndim): - * memcpy(result, src.data, size) # <<<<<<<<<<<<<< - * else: - * copy_strided_to_strided(src, tmpslice, ndim, itemsize) +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); - /* "View.MemoryView":1225 - * tmpslice.strides[i] = 0 - * - * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< - * memcpy(result, src.data, size) - * else: - */ - goto __pyx_L9; - } +/* 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)); - /* "View.MemoryView":1228 - * memcpy(result, src.data, size) - * else: - * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< - * - * return result - */ - /*else*/ { - copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); - } - __pyx_L9:; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1230 - * copy_strided_to_strided(src, tmpslice, ndim, itemsize) - * - * return result # <<<<<<<<<<<<<< - * - * +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_r = __pyx_v_result; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, 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) - /* "View.MemoryView":1192 - * - * @cname('__pyx_memoryview_copy_data_to_temp') - * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *tmpslice, - * char order, + /* "(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:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - } + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":1235 - * - * @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)" % +/* "(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__") */ -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; +/* 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; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("_err_extents", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "View.MemoryView":1238 - * Py_ssize_t extent2) except -1 with gil: - * raise ValueError("got differing extents in dimension %d (got %d and %d)" % - * (i, extent1, extent2)) # <<<<<<<<<<<<<< - * - * @cname('__pyx_memoryview_err_dim') + /* "(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_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1238, __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":1237 - * cdef int _err_extents(int i, Py_ssize_t extent1, - * Py_ssize_t extent2) except -1 with gil: - * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< - * (i, extent1, extent2)) - * - */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1237, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 1237, __pyx_L1_error) + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) - /* "View.MemoryView":1235 - * - * @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)" % + /* "(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_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_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif return __pyx_r; } -/* "View.MemoryView":1241 - * - * @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) +/* "View.MemoryView":240 * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result */ -static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { - int __pyx_r; +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 - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; 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 = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("_err_dim", 0); - __Pyx_INCREF(__pyx_v_error); + __Pyx_RefNannySetupContext("array_cwrapper", 0); - /* "View.MemoryView":1242 - * @cname('__pyx_memoryview_err_dim') - * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: - * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + /* "View.MemoryView":244 + * cdef array result * - * @cname('__pyx_memoryview_err') + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: */ - __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(3, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_INCREF(__pyx_v_error); - __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; - if (CYTHON_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); - } + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":245 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __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, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":244 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; } - if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __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(3, 1242, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - #endif - { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __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":248 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":249 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; } - __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(3, 1242, __pyx_L1_error) + __pyx_L3:; - /* "View.MemoryView":1241 + /* "View.MemoryView":251 + * result.data = buf * - * @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) + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":240 * + * @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_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_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(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif return __pyx_r; } -/* "View.MemoryView":1245 - * - * @cname('__pyx_memoryview_err') - * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< - * if msg != NULL: - * raise error(msg.decode('ascii')) +/* "View.MemoryView":277 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): */ -static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { +/* 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 - 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 = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("_err", 0); - __Pyx_INCREF(__pyx_v_error); - - /* "View.MemoryView":1246 - * @cname('__pyx_memoryview_err') - * cdef int _err(object error, char *msg) except -1 with gil: - * if msg != NULL: # <<<<<<<<<<<<<< - * raise error(msg.decode('ascii')) - * else: - */ - __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":1247 - * cdef int _err(object error, char *msg) except -1 with gil: - * if msg != NULL: - * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< - * else: - * raise error - */ - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_error); - __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_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; } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __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(3, 1247, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __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_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(3, 1247, __pyx_L1_error) - - /* "View.MemoryView":1246 - * @cname('__pyx_memoryview_err') - * cdef int _err(object error, char *msg) except -1 with gil: - * if msg != NULL: # <<<<<<<<<<<<<< - * raise error(msg.decode('ascii')) - * else: - */ + __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, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); - /* "View.MemoryView":1249 - * raise error(msg.decode('ascii')) - * else: - * raise error # <<<<<<<<<<<<<< - * - * @cname('__pyx_memoryview_copy_contents') + /* 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":278 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name */ - /*else*/ { - __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(3, 1249, __pyx_L1_error) - } + __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":1245 - * - * @cname('__pyx_memoryview_err') - * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< - * if msg != NULL: - * raise error(msg.decode('ascii')) + /* "View.MemoryView":277 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): */ /* 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_r = 0; __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif return __pyx_r; } -/* "View.MemoryView":1252 +/* "View.MemoryView":279 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name * - * @cname('__pyx_memoryview_copy_contents') - * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice dst, - * int src_ndim, int dst_ndim, */ -static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { - void *__pyx_v_tmpdata; - size_t __pyx_v_itemsize; - int __pyx_v_i; - char __pyx_v_order; - int __pyx_v_broadcasting; - int __pyx_v_direct_copy; - __Pyx_memviewslice __pyx_v_tmp; - int __pyx_v_ndim; - int __pyx_r; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - void *__pyx_t_6; - int __pyx_t_7; +/* 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)); - /* "View.MemoryView":1260 - * 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; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1261 - * """ - * 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; +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":1263 - * 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 + /* "View.MemoryView":280 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< + * + * cdef generic = Enum("") */ - __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; - /* "View.MemoryView":1264 - * 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 + /* "View.MemoryView":279 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * */ - __pyx_v_broadcasting = 0; - /* "View.MemoryView":1265 - * cdef char order = get_best_order(&src, src_ndim) - * cdef bint broadcasting = False - * cdef bint direct_copy = False # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice tmp - * + /* 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,) */ - __pyx_v_direct_copy = 0; - /* "View.MemoryView":1268 - * cdef __Pyx_memviewslice tmp - * - * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: +/* 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_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); - if (__pyx_t_2) { + __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; - /* "View.MemoryView":1269 - * - * if src_ndim < dst_ndim: - * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< - * elif dst_ndim < src_ndim: - * broadcast_leading(&dst, dst_ndim, src_ndim) + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, */ - __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + __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; - /* "View.MemoryView":1268 - * cdef __Pyx_memviewslice tmp - * - * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: + /* "(tree fragment)":5 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - goto __pyx_L3; - } + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { - /* "View.MemoryView":1270 - * if src_ndim < dst_ndim: - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< - * broadcast_leading(&dst, dst_ndim, src_ndim) - * + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ - __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); - if (__pyx_t_2) { + __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; - /* "View.MemoryView":1271 - * 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) + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.name is not None */ - __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); + __pyx_v_use_setstate = 1; - /* "View.MemoryView":1270 - * if src_ndim < dst_ndim: - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< - * broadcast_leading(&dst, dst_ndim, src_ndim) - * + /* "(tree fragment)":5 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ + goto __pyx_L3; } - __pyx_L3:; - /* "View.MemoryView":1273 - * broadcast_leading(&dst, dst_ndim, src_ndim) - * - * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< - * - * for i in range(ndim): + /* "(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 */ - __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; + /*else*/ { + __pyx_t_3 = (__pyx_v_self->name != Py_None); + __pyx_v_use_setstate = __pyx_t_3; } - __pyx_v_ndim = __pyx_t_5; + __pyx_L3:; - /* "View.MemoryView":1275 - * 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: + /* "(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_5 = __pyx_v_ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { - /* "View.MemoryView":1276 - * - * for i in range(ndim): - * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< - * if src.shape[i] == 1: - * broadcasting = True + /* "(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_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); - if (__pyx_t_2) { + __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; - /* "View.MemoryView":1277 - * for i in range(ndim): - * if src.shape[i] != dst.shape[i]: - * if src.shape[i] == 1: # <<<<<<<<<<<<<< - * broadcasting = True - * src.strides[i] = 0 + /* "(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_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); - if (__pyx_t_2) { + } - /* "View.MemoryView":1278 - * if src.shape[i] != dst.shape[i]: - * if src.shape[i] == 1: - * broadcasting = True # <<<<<<<<<<<<<< - * src.strides[i] = 0 - * 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) */ - __pyx_v_broadcasting = 1; + /*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; + } - /* "View.MemoryView":1279 - * if src.shape[i] == 1: - * broadcasting = True - * src.strides[i] = 0 # <<<<<<<<<<<<<< - * else: - * _err_extents(i, dst.shape[i], src.shape[i]) + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.name,) */ - (__pyx_v_src.strides[__pyx_v_i]) = 0; - /* "View.MemoryView":1277 - * for i in range(ndim): - * if src.shape[i] != dst.shape[i]: - * if src.shape[i] == 1: # <<<<<<<<<<<<<< - * broadcasting = True - * src.strides[i] = 0 - */ - goto __pyx_L7; - } + /* 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; +} - /* "View.MemoryView":1281 - * src.strides[i] = 0 - * else: - * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< - * - * if src.suboffsets[i] >= 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) */ - /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 1281, __pyx_L1_error) - } - __pyx_L7:; - /* "View.MemoryView":1276 - * - * for i in range(ndim): - * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< - * if src.shape[i] == 1: - * broadcasting = True - */ - } +/* 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)); - /* "View.MemoryView":1283 - * _err_extents(i, dst.shape[i], src.shape[i]) - * - * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< - * _err_dim(ValueError, "Dimension %d is not direct", i) - * + /* 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) # <<<<<<<<<<<<<< */ - __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); - if (__pyx_t_2) { + 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; - /* "View.MemoryView":1284 - * - * if src.suboffsets[i] >= 0: - * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< - * - * if slices_overlap(&src, &dst, ndim, itemsize): + /* "(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) */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 1284, __pyx_L1_error) - /* "View.MemoryView":1283 - * _err_extents(i, dst.shape[i], src.shape[i]) - * - * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< - * _err_dim(ValueError, "Dimension %d is not direct", i) - * - */ - } - } + /* 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":1286 - * _err_dim(ValueError, "Dimension %d is not direct", i) - * - * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< +/* "View.MemoryView":294 * - * if not slice_is_contig(src, order, ndim): + * @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 */ - __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":1288 - * 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) { +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":1289 - * - * if not slice_is_contig(src, order, ndim): - * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< + /* "View.MemoryView":296 + * cdef void *align_pointer(void *memory, size_t alignment) nogil: + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< + * cdef size_t offset * - * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) */ - __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); + __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); - /* "View.MemoryView":1288 - * if slices_overlap(&src, &dst, ndim, itemsize): + /* "View.MemoryView":300 * - * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< - * order = get_best_order(&dst, ndim) + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< * + * if offset > 0: */ - } + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); - /* "View.MemoryView":1291 - * order = get_best_order(&dst, ndim) + /* "View.MemoryView":302 + * offset = aligned_p % alignment * - * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< - * src = tmp + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(3, 1291, __pyx_L1_error) - __pyx_v_tmpdata = __pyx_t_6; + __pyx_t_1 = ((__pyx_v_offset > 0) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1292 + /* "View.MemoryView":303 * - * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) - * src = tmp # <<<<<<<<<<<<<< + * if offset > 0: + * aligned_p += alignment - offset # <<<<<<<<<<<<<< * - * if not broadcasting: + * return aligned_p */ - __pyx_v_src = __pyx_v_tmp; + __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); - /* "View.MemoryView":1286 - * _err_dim(ValueError, "Dimension %d is not direct", i) + /* "View.MemoryView":302 + * offset = aligned_p % alignment * - * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset * - * if not slice_is_contig(src, order, ndim): */ } - /* "View.MemoryView":1294 - * src = tmp + /* "View.MemoryView":305 + * aligned_p += alignment - offset * - * if not broadcasting: # <<<<<<<<<<<<<< + * return aligned_p # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); - if (__pyx_t_2) { + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; - /* "View.MemoryView":1297 - * + /* "View.MemoryView":294 * - * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): + * @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 */ - __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":1298 - * - * if slice_is_contig(src, 'C', ndim): - * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< - * elif slice_is_contig(src, 'F', ndim): - * direct_copy = slice_is_contig(dst, 'F', ndim) - */ - __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "View.MemoryView":1297 - * +/* "View.MemoryView":341 + * cdef __Pyx_TypeInfo *typeinfo * - * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags */ - goto __pyx_L12; + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __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, 341, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___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); - /* "View.MemoryView":1299 - * if slice_is_contig(src, 'C', ndim): - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< - * direct_copy = slice_is_contig(dst, 'F', ndim) - * - */ - __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); - if (__pyx_t_2) { + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1300 - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): - * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< +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":342 * - * if direct_copy: + * 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_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + __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":1299 - * if slice_is_contig(src, 'C', ndim): - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< - * direct_copy = slice_is_contig(dst, 'F', ndim) - * + /* "View.MemoryView":343 + * 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_L12:; + __pyx_v_self->flags = __pyx_v_flags; - /* "View.MemoryView":1302 - * 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":1304 - * 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) + /* "View.MemoryView":344 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: */ - __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + __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":1305 - * - * 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) + /* "View.MemoryView":345 + * 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 */ - memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) - /* "View.MemoryView":1306 - * refcount_copying(&dst, dtype_is_object, ndim, False) - * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) - * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * free(tmpdata) - * return 0 + /* "View.MemoryView":346 + * 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_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1307 - * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) - * refcount_copying(&dst, dtype_is_object, ndim, True) - * free(tmpdata) # <<<<<<<<<<<<<< - * return 0 + /* "View.MemoryView":347 + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) * */ - free(__pyx_v_tmpdata); + ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; - /* "View.MemoryView":1308 - * refcount_copying(&dst, dtype_is_object, ndim, True) - * free(tmpdata) - * return 0 # <<<<<<<<<<<<<< + /* "View.MemoryView":348 + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * - * if order == 'F' == get_best_order(&dst, ndim): + * global __pyx_memoryview_thread_locks_used */ - __pyx_r = 0; - goto __pyx_L0; + Py_INCREF(Py_None); - /* "View.MemoryView":1302 - * direct_copy = slice_is_contig(dst, 'F', ndim) - * - * if direct_copy: # <<<<<<<<<<<<<< - * - * refcount_copying(&dst, dtype_is_object, ndim, False) + /* "View.MemoryView":346 + * 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":1294 - * src = tmp - * - * if not broadcasting: # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":344 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: */ } - /* "View.MemoryView":1310 - * return 0 - * - * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< - * + /* "View.MemoryView":351 * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 */ - __pyx_t_2 = (__pyx_v_order == 'F'); - if (__pyx_t_2) { - __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); - } - __pyx_t_7 = (__pyx_t_2 != 0); - if (__pyx_t_7) { + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1313 - * - * - * transpose_memslice(&src) # <<<<<<<<<<<<<< - * transpose_memslice(&dst) - * + /* "View.MemoryView":352 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(3, 1313, __pyx_L1_error) + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); - /* "View.MemoryView":1314 - * - * transpose_memslice(&src) - * transpose_memslice(&dst) # <<<<<<<<<<<<<< - * - * refcount_copying(&dst, dtype_is_object, ndim, False) + /* "View.MemoryView":353 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(3, 1314, __pyx_L1_error) + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); - /* "View.MemoryView":1310 - * return 0 - * - * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< - * + /* "View.MemoryView":351 * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 */ } - /* "View.MemoryView":1316 - * 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) + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: */ - __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1317 - * - * refcount_copying(&dst, dtype_is_object, ndim, False) - * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< - * refcount_copying(&dst, dtype_is_object, ndim, True) - * + /* "View.MemoryView":355 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError */ - copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); + __pyx_v_self->lock = PyThread_allocate_lock(); - /* "View.MemoryView":1318 - * refcount_copying(&dst, dtype_is_object, ndim, False) - * copy_strided_to_strided(&src, &dst, ndim, itemsize) - * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError * - * free(tmpdata) */ - __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1320 - * refcount_copying(&dst, dtype_is_object, ndim, True) - * - * free(tmpdata) # <<<<<<<<<<<<<< - * return 0 + /* "View.MemoryView":357 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< * + * if flags & PyBUF_FORMAT: */ - free(__pyx_v_tmpdata); + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) - /* "View.MemoryView":1321 - * - * free(tmpdata) - * return 0 # <<<<<<<<<<<<<< + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError * - * @cname('__pyx_memoryview_broadcast_leading') */ - __pyx_r = 0; - goto __pyx_L0; + } - /* "View.MemoryView":1252 - * - * @cname('__pyx_memoryview_copy_contents') - * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice dst, - * int src_ndim, int dst_ndim, + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: */ - - /* function exit code */ - __pyx_L1_error:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif } - __pyx_r = -1; - __pyx_L0:; - return __pyx_r; -} -/* "View.MemoryView":1324 - * - * @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; - - /* "View.MemoryView":1328 - * 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":1330 - * cdef int offset = ndim_other - ndim + /* "View.MemoryView":359 + * raise MemoryError * - * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< - * mslice.shape[i + offset] = mslice.shape[i] - * mslice.strides[i + offset] = mslice.strides[i] + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: */ - for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { - __pyx_v_i = __pyx_t_1; + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1331 + /* "View.MemoryView":360 * - * 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] + * 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_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); + __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":1332 - * 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] + /* "View.MemoryView":359 + * raise MemoryError * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: */ - (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); + goto __pyx_L10; + } - /* "View.MemoryView":1333 - * mslice.shape[i + offset] = mslice.shape[i] - * mslice.strides[i + offset] = mslice.strides[i] - * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + /* "View.MemoryView":362 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< * - * for i in range(offset): + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( */ - (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; } + __pyx_L10:; - /* "View.MemoryView":1335 - * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + /* "View.MemoryView":364 + * self.dtype_is_object = dtype_is_object * - * for i in range(offset): # <<<<<<<<<<<<<< - * mslice.shape[i] = 1 - * mslice.strides[i] = mslice.strides[0] + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL */ - __pyx_t_1 = __pyx_v_offset; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + __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":1336 + /* "View.MemoryView":366 + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL # <<<<<<<<<<<<<< * - * for i in range(offset): - * mslice.shape[i] = 1 # <<<<<<<<<<<<<< - * mslice.strides[i] = mslice.strides[0] - * mslice.suboffsets[i] = -1 + * def __dealloc__(memoryview self): */ - (__pyx_v_mslice->shape[__pyx_v_i]) = 1; + __pyx_v_self->typeinfo = NULL; - /* "View.MemoryView":1337 - * for i in range(offset): - * mslice.shape[i] = 1 - * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< - * mslice.suboffsets[i] = -1 + /* "View.MemoryView":341 + * cdef __Pyx_TypeInfo *typeinfo * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags */ - (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); - /* "View.MemoryView":1338 - * mslice.shape[i] = 1 - * mslice.strides[i] = mslice.strides[0] - * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< - * - * - */ - (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; - } + /* 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":1324 +/* "View.MemoryView":368 + * self.typeinfo = NULL * - * @cname('__pyx_memoryview_broadcast_leading') - * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< - * int ndim, - * int ndim_other) nogil: + * 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(); } -/* "View.MemoryView":1346 - * - * @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) { +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyThread_type_lock __pyx_t_5; + PyThread_type_lock __pyx_t_6; + __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":1350 + /* "View.MemoryView":369 * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) * - * 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) { + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1351 - * - * if dtype_is_object: - * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< - * dst.strides, ndim, inc) + /* "View.MemoryView":370 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< * + * cdef int i */ - __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); - /* "View.MemoryView":1350 + /* "View.MemoryView":369 * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) * - * if dtype_is_object: # <<<<<<<<<<<<<< - * refcount_objects_in_slice_with_gil(dst.data, dst.shape, - * dst.strides, ndim, inc) */ } - /* "View.MemoryView":1346 - * - * @cname('__pyx_memoryview_refcount_copying') - * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< - * int ndim, bint inc) nogil: - * + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { - /* function exit code */ -} - -/* "View.MemoryView":1355 - * - * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') - * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * bint inc) with gil: + /* "View.MemoryView":375 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; -static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { - __Pyx_RefNannyDeclarations - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1358 - * 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":1355 - * - * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') - * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * bint inc) with gil: - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif -} - -/* "View.MemoryView":1361 - * - * @cname('__pyx_memoryview_refcount_objects_in_slice') - * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, bint inc): - * cdef Py_ssize_t i - */ - -static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { - CYTHON_UNUSED Py_ssize_t __pyx_v_i; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); - - /* "View.MemoryView":1365 - * cdef Py_ssize_t i - * - * for i in range(shape[0]): # <<<<<<<<<<<<<< - * if ndim == 1: - * if inc: + /* "View.MemoryView":377 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( */ - __pyx_t_1 = (__pyx_v_shape[0]); - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); - /* "View.MemoryView":1366 - * - * for i in range(shape[0]): - * if ndim == 1: # <<<<<<<<<<<<<< - * if inc: - * Py_INCREF(( data)[0]) + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) */ - __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); - if (__pyx_t_3) { + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1367 - * for i in range(shape[0]): - * if ndim == 1: - * if inc: # <<<<<<<<<<<<<< - * Py_INCREF(( data)[0]) + /* "View.MemoryView":380 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break * else: */ - __pyx_t_3 = (__pyx_v_inc != 0); - if (__pyx_t_3) { + __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); - /* "View.MemoryView":1368 - * if ndim == 1: - * if inc: - * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< - * else: - * Py_DECREF(( data)[0]) + /* "View.MemoryView":379 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break */ - Py_INCREF((((PyObject **)__pyx_v_data)[0])); + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; - /* "View.MemoryView":1367 - * for i in range(shape[0]): - * if ndim == 1: - * if inc: # <<<<<<<<<<<<<< - * Py_INCREF(( data)[0]) - * else: + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) */ - goto __pyx_L6; - } + } - /* "View.MemoryView":1370 - * Py_INCREF(( data)[0]) + /* "View.MemoryView":381 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< * else: - * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< - * else: - * refcount_objects_in_slice(data, shape + 1, strides + 1, + * PyThread_free_lock(self.lock) */ - /*else*/ { - Py_DECREF((((PyObject **)__pyx_v_data)[0])); - } - __pyx_L6:; + goto __pyx_L6_break; - /* "View.MemoryView":1366 - * - * for i in range(shape[0]): - * if ndim == 1: # <<<<<<<<<<<<<< - * if inc: - * Py_INCREF(( data)[0]) + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: */ - goto __pyx_L5; + } } - - /* "View.MemoryView":1372 - * Py_DECREF(( data)[0]) - * else: - * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< - * ndim - 1, inc) - * - */ /*else*/ { - /* "View.MemoryView":1373 - * else: - * refcount_objects_in_slice(data, shape + 1, strides + 1, - * ndim - 1, inc) # <<<<<<<<<<<<<< + /* "View.MemoryView":383 + * break + * else: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< * - * data += strides[0] + * cdef char *get_item_pointer(memoryview self, object index) except NULL: */ - __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + PyThread_free_lock(__pyx_v_self->lock); } - __pyx_L5:; + __pyx_L6_break:; - /* "View.MemoryView":1375 - * ndim - 1, inc) - * - * data += strides[0] # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: */ - __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); } - /* "View.MemoryView":1361 + /* "View.MemoryView":368 + * self.typeinfo = NULL * - * @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 + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":1381 +/* "View.MemoryView":385 + * PyThread_free_lock(self.lock) * - * @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":1384 - * 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) + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf */ - __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1385 - * bint dtype_is_object) nogil: - * refcount_copying(dst, dtype_is_object, ndim, False) - * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< - * 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); +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":1387 - * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, - * itemsize, item) - * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * + /* "View.MemoryView":387 + * 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_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); - /* "View.MemoryView":1381 + /* "View.MemoryView":389 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) * - * @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: */ + __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, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 389, __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); - /* function exit code */ -} - -/* "View.MemoryView":1391 + /* "View.MemoryView":390 * - * @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: + * 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, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; -static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { - CYTHON_UNUSED Py_ssize_t __pyx_v_i; - Py_ssize_t __pyx_v_stride; - Py_ssize_t __pyx_v_extent; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - Py_ssize_t __pyx_t_3; - - /* "View.MemoryView":1395 - * 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] + /* "View.MemoryView":389 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) * */ - __pyx_v_stride = (__pyx_v_strides[0]); + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":1396 - * cdef Py_ssize_t i - * cdef Py_ssize_t stride = strides[0] - * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< + /* "View.MemoryView":392 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * * - * if ndim == 1: */ - __pyx_v_extent = (__pyx_v_shape[0]); + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; - /* "View.MemoryView":1398 - * cdef Py_ssize_t extent = shape[0] + /* "View.MemoryView":385 + * PyThread_free_lock(self.lock) * - * if ndim == 1: # <<<<<<<<<<<<<< - * for i in range(extent): - * memcpy(data, item, itemsize) + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf */ - __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); - if (__pyx_t_1) { - /* "View.MemoryView":1399 + /* 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":395 * - * if ndim == 1: - * for i in range(extent): # <<<<<<<<<<<<<< - * memcpy(data, item, itemsize) - * data += stride + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self */ - __pyx_t_2 = __pyx_v_extent; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":1400 - * if ndim == 1: - * for i in range(extent): - * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< - * data += stride - * else: - */ - memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); +/* 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)); - /* "View.MemoryView":1401 - * 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); - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1398 - * cdef Py_ssize_t extent = shape[0] +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":396 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self * - * if ndim == 1: # <<<<<<<<<<<<<< - * for i in range(extent): - * memcpy(data, item, itemsize) */ - goto __pyx_L3; - } + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1403 - * data += stride - * else: - * for i in range(extent): # <<<<<<<<<<<<<< - * _slice_assign_scalar(data, shape + 1, strides + 1, - * ndim - 1, itemsize, item) + /* "View.MemoryView":397 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) */ - /*else*/ { - __pyx_t_2 = __pyx_v_extent; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; - /* "View.MemoryView":1404 - * else: - * for i in range(extent): - * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< - * ndim - 1, itemsize, item) - * data += stride + /* "View.MemoryView":396 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * */ - __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":1406 - * _slice_assign_scalar(data, shape + 1, strides + 1, - * ndim - 1, itemsize, item) - * data += stride # <<<<<<<<<<<<<< + /* "View.MemoryView":399 + * return self * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * + * cdef char *itemp */ - __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 399, __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, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) } - __pyx_L3:; + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; - /* "View.MemoryView":1391 + /* "View.MemoryView":402 * - * @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: + * 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, 402, __pyx_L1_error) + if (__pyx_t_2) { - /* function exit code */ -} -static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_vtable_2yt_8geometry_12oct_visitors_OctVisitor; + /* "View.MemoryView":403 + * 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, 403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *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); + /* "View.MemoryView":402 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ } - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)o); - p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - return o; -} -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(PyObject *o) { - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - (*Py_TYPE(o)->tp_free)(o); -} + /* "View.MemoryView":405 + * 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 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; -static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_OctVisitor[] = { - {0, 0, 0, 0} -}; + /* "View.MemoryView":406 + * 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, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_OctVisitor = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.OctVisitor", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_12oct_visitors_OctVisitor, /*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_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor, /*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_2yt_8geometry_12oct_visitors_CountTotalOcts __pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalOcts; + /* "View.MemoryView":395 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_CountTotalOcts(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts; - return o; + /* 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; } -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.CountTotalOcts", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_CountTotalOcts, /*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_2yt_8geometry_12oct_visitors_CountTotalCells __pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalCells; +/* "View.MemoryView":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_CountTotalCells(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells; - return o; +/* 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 PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.CountTotalCells", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_CountTotalCells, /*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_2yt_8geometry_12oct_visitors_MarkOcts __pyx_vtable_2yt_8geometry_12oct_visitors_MarkOcts; - -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_MarkOcts(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts; - p->mark.data = NULL; - p->mark.memview = NULL; - return o; -} +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 + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_MarkOcts(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; + /* "View.MemoryView":409 + * + * def __setitem__(memoryview self, object index, object value): + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 409, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) } - #endif - __PYX_XDEC_MEMVIEW(&p->mark, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} + __pyx_v_have_slices = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_MarkOcts = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.MarkOcts", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_MarkOcts, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_MarkOcts, /*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_2yt_8geometry_12oct_visitors_MaskOcts __pyx_vtable_2yt_8geometry_12oct_visitors_MaskOcts; + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) + if (__pyx_t_4) { -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_MaskOcts(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts; - p->mask.data = NULL; - p->mask.memview = NULL; - return o; -} + /* "View.MemoryView":412 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_obj = __pyx_t_1; + __pyx_t_1 = 0; -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_MaskOcts(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - __PYX_XDEC_MEMVIEW(&p->mask, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) + if (__pyx_t_4) { -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_MaskOcts = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.MaskOcts", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_MaskOcts, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_MaskOcts, /*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_2yt_8geometry_12oct_visitors_IndexOcts __pyx_vtable_2yt_8geometry_12oct_visitors_IndexOcts; + /* "View.MemoryView":414 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_IndexOcts(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts; - p->oct_index.data = NULL; - p->oct_index.memview = NULL; - return o; -} + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L4; + } -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_IndexOcts(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; + /* "View.MemoryView":416 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L3; } - #endif - __PYX_XDEC_MEMVIEW(&p->oct_index, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_IndexOcts = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.IndexOcts", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_IndexOcts, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_IndexOcts, /*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_2yt_8geometry_12oct_visitors_ICoordsOcts __pyx_vtable_2yt_8geometry_12oct_visitors_ICoordsOcts; + /* "View.MemoryView":418 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_ICoordsOcts(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts; - p->icoords.data = NULL; - p->icoords.memview = NULL; - return o; -} + /* "View.MemoryView":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_ICoordsOcts(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - __PYX_XDEC_MEMVIEW(&p->icoords, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.ICoordsOcts", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_ICoordsOcts, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_ICoordsOcts, /*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_2yt_8geometry_12oct_visitors_IResOcts __pyx_vtable_2yt_8geometry_12oct_visitors_IResOcts; - -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_IResOcts(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts; - p->ires.data = NULL; - p->ires.memview = NULL; - return o; -} +/* "View.MemoryView":420 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_IResOcts(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - __PYX_XDEC_MEMVIEW(&p->ires, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} +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); -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_IResOcts = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.IResOcts", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_IResOcts, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_IResOcts, /*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_2yt_8geometry_12oct_visitors_FCoordsOcts __pyx_vtable_2yt_8geometry_12oct_visitors_FCoordsOcts; + /* "View.MemoryView":421 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_FCoordsOcts(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts; - p->fcoords.data = NULL; - p->fcoords.memview = NULL; - return o; -} + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_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:*/ { -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FCoordsOcts(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - __PYX_XDEC_MEMVIEW(&p->fcoords, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} + /* "View.MemoryView":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.FCoordsOcts", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FCoordsOcts, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_FCoordsOcts, /*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_2yt_8geometry_12oct_visitors_FWidthOcts __pyx_vtable_2yt_8geometry_12oct_visitors_FWidthOcts; + /* "View.MemoryView":424 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_FWidthOcts(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts; - p->fwidth.data = NULL; - p->fwidth.memview = NULL; - return o; -} + /* "View.MemoryView":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __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, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FWidthOcts(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - __PYX_XDEC_MEMVIEW(&p->fwidth, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.FWidthOcts", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FWidthOcts, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_FWidthOcts, /*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_2yt_8geometry_12oct_visitors_CopyArrayI64 __pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayI64; + /* "View.MemoryView":425 + * 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, 425, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_CopyArrayI64(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64; - p->source.data = NULL; - p->source.memview = NULL; - p->dest.data = NULL; - p->dest.memview = NULL; - return o; -} + /* "View.MemoryView":426 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_CopyArrayI64(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":421 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ } - #endif - __PYX_XDEC_MEMVIEW(&p->source, 1); - __PYX_XDEC_MEMVIEW(&p->dest, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64 = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.CopyArrayI64", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_CopyArrayI64, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_CopyArrayI64, /*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_2yt_8geometry_12oct_visitors_CopyArrayF64 __pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayF64; + /* "View.MemoryView":428 + * 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; -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_CopyArrayF64(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64; - p->source.data = NULL; - p->source.memview = NULL; - p->dest.data = NULL; - p->dest.memview = NULL; - return o; -} + /* "View.MemoryView":420 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_CopyArrayF64(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - __PYX_XDEC_MEMVIEW(&p->source, 1); - __PYX_XDEC_MEMVIEW(&p->dest, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); + /* 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; } -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64 = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.CopyArrayF64", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_CopyArrayF64, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_CopyArrayF64, /*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_2yt_8geometry_12oct_visitors_IdentifyOcts __pyx_vtable_2yt_8geometry_12oct_visitors_IdentifyOcts; +/* "View.MemoryView":430 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_IdentifyOcts(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts; - p->domain_mask.data = NULL; - p->domain_mask.memview = NULL; - return o; -} +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); -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_IdentifyOcts(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - __PYX_XDEC_MEMVIEW(&p->domain_mask, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} + /* "View.MemoryView":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.IdentifyOcts", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_IdentifyOcts, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_IdentifyOcts, /*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_2yt_8geometry_12oct_visitors_AssignDomainInd __pyx_vtable_2yt_8geometry_12oct_visitors_AssignDomainInd; + /* "View.MemoryView":435 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_AssignDomainInd(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd; - return o; + /* "View.MemoryView":436 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) + + /* "View.MemoryView":430 + * 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; } -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.AssignDomainInd", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_AssignDomainInd, /*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_2yt_8geometry_12oct_visitors_FillFileIndicesO __pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesO; +/* "View.MemoryView":438 + * 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_tp_new_2yt_8geometry_12oct_visitors_FillFileIndicesO(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO; - p->levels.data = NULL; - p->levels.memview = NULL; - p->file_inds.data = NULL; - p->file_inds.memview = NULL; - p->cell_inds.data = NULL; - p->cell_inds.memview = NULL; - return o; -} +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); -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FillFileIndicesO(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - __PYX_XDEC_MEMVIEW(&p->levels, 1); - __PYX_XDEC_MEMVIEW(&p->file_inds, 1); - __PYX_XDEC_MEMVIEW(&p->cell_inds, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} + /* "View.MemoryView":440 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item + * + */ + __pyx_v_tmp = NULL; -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.FillFileIndicesO", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FillFileIndicesO, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_FillFileIndicesO, /*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_2yt_8geometry_12oct_visitors_FillFileIndicesR __pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesR; + /* "View.MemoryView":445 + * 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)); -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_FillFileIndicesR(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR; - p->levels.data = NULL; - p->levels.memview = NULL; - p->file_inds.data = NULL; - p->file_inds.memview = NULL; - p->cell_inds.data = NULL; - p->cell_inds.memview = NULL; - return o; -} + /* "View.MemoryView":447 + * 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) { -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FillFileIndicesR(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; + /* "View.MemoryView":448 + * + * 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":449 + * 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 (__pyx_t_1) { + + /* "View.MemoryView":450 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) + + /* "View.MemoryView":449 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":451 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":447 + * 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; } - #endif - __PYX_XDEC_MEMVIEW(&p->levels, 1); - __PYX_XDEC_MEMVIEW(&p->file_inds, 1); - __PYX_XDEC_MEMVIEW(&p->cell_inds, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.FillFileIndicesR", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FillFileIndicesR, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_FillFileIndicesR, /*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_2yt_8geometry_12oct_visitors_CountByDomain __pyx_vtable_2yt_8geometry_12oct_visitors_CountByDomain; + /* "View.MemoryView":453 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_CountByDomain(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain; - p->domain_counts.data = NULL; - p->domain_counts.memview = NULL; - return o; -} + /* "View.MemoryView":455 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_CountByDomain(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - __PYX_XDEC_MEMVIEW(&p->domain_counts, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} + /* "View.MemoryView":456 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_CountByDomain = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.CountByDomain", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_CountByDomain, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_CountByDomain, /*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_2yt_8geometry_12oct_visitors_StoreOctree __pyx_vtable_2yt_8geometry_12oct_visitors_StoreOctree; + /* "View.MemoryView":457 + * 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); -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_StoreOctree(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree; - p->ref_mask.data = NULL; - p->ref_mask.memview = NULL; - return o; -} + /* "View.MemoryView":456 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_StoreOctree(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; + /* "View.MemoryView":459 + * ( 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, 459, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":463 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":464 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":463 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + } + + /* "View.MemoryView":465 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * 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); } - #endif - __PYX_XDEC_MEMVIEW(&p->ref_mask, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_StoreOctree = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.StoreOctree", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_StoreOctree, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_StoreOctree, /*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_2yt_8geometry_12oct_visitors_LoadOctree __pyx_vtable_2yt_8geometry_12oct_visitors_LoadOctree; - -static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_LoadOctree(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree; - p->ref_mask.data = NULL; - p->ref_mask.memview = NULL; - return o; -} - -static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_LoadOctree(PyObject *o) { - struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; + /* "View.MemoryView":468 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __pyx_L6_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __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); + } + __Pyx_PyThreadState_assign + 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:; } - #endif - __PYX_XDEC_MEMVIEW(&p->ref_mask, 1); - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); -} -static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_LoadOctree = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.LoadOctree", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_LoadOctree, /*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*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*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*/ - #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ - #else - 0, /*tp_init*/ - #endif - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_12oct_visitors_LoadOctree, /*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; + /* "View.MemoryView":438 + * 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_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; + /* 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; } -static void __pyx_tp_dealloc_array(PyObject *o) { - struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_array___dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_CLEAR(p->mode); - Py_CLEAR(p->_format); - (*Py_TYPE(o)->tp_free)(o); -} -static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { - PyObject *r; - PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; - r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); - Py_DECREF(x); - return r; -} +/* "View.MemoryView":470 + * 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 int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { - if (v) { - return __pyx_array___setitem__(o, i, v); - } - else { - PyErr_Format(PyExc_NotImplementedError, - "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); - return -1; - } -} - -static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { - PyObject *v = PyObject_GenericGetAttr(o, n); - if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - v = __pyx_array___getattr__(o, n); - } - return v; -} - -static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { - return __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}, - {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 = { - 0, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - __pyx_sq_item_array, /*sq_item*/ - 0, /*sq_slice*/ - 0, /*sq_ass_item*/ - 0, /*sq_ass_slice*/ - 0, /*sq_contains*/ - 0, /*sq_inplace_concat*/ - 0, /*sq_inplace_repeat*/ -}; +static 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); -static PyMappingMethods __pyx_tp_as_mapping_array = { - 0, /*mp_length*/ - __pyx_array___getitem__, /*mp_subscript*/ - __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ -}; + /* "View.MemoryView":471 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; -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*/ -}; + /* "View.MemoryView":472 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -static PyTypeObject __pyx_type___pyx_array = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.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 -}; + /* "View.MemoryView":470 + * 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_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; + /* 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; } -static void __pyx_tp_dealloc_Enum(PyObject *o) { - struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->name); - (*Py_TYPE(o)->tp_free)(o); -} +/* "View.MemoryView":474 + * 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 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 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); -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; -} + /* "View.MemoryView":477 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; -static PyMethodDef __pyx_methods_Enum[] = { - {0, 0, 0, 0} -}; + /* "View.MemoryView":480 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; -static PyTypeObject __pyx_type___pyx_MemviewEnum = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.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 PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ { - 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); -} + __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:*/ { -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; -} + /* "View.MemoryView":482 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __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, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 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; -} + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } -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; - } -} + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { -static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o); -} + /* "View.MemoryView":487 + * 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(1, 487, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; -static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o); -} + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } -static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o); -} + /* "View.MemoryView":488 + * 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_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; -static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o); -} + /* "View.MemoryView":483 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); -static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o); -} + /* "View.MemoryView":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 484, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; -static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o); -} + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } -static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o); -} + /* "View.MemoryView":474 + * 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_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o); + /* 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; } -static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o); -} +/* "View.MemoryView":490 + * 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 PyMethodDef __pyx_methods_memoryview[] = { - {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0}, - {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0}, - {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0}, - {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0}, - {0, 0, 0, 0} -}; +static 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); -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} -}; + /* "View.MemoryView":493 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; -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*/ -}; + /* "View.MemoryView":498 + * 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) { -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*/ -}; + /* "View.MemoryView":499 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __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 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; -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*/ -}; + /* "View.MemoryView":498 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } -static PyTypeObject __pyx_type___pyx_memoryview = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors.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 PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; + /* "View.MemoryView":501 + * 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, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __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, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __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, 501, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; } - #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); + __pyx_L3:; + + /* "View.MemoryView":503 + * 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, 503, __pyx_L1_error) } - Py_CLEAR(p->from_object); - PyObject_GC_Track(o); - __pyx_tp_dealloc_memoryview(o); -} + __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]); -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; + /* "View.MemoryView":504 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":503 + * 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":504 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; } - return 0; -} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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; -} + /* "View.MemoryView":490 + * 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_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o); + /* 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; } -static PyMethodDef __pyx_methods__memoryviewslice[] = { - {0, 0, 0, 0} -}; +/* "View.MemoryView":507 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ -static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { - {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; +/* 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)); -static PyTypeObject __pyx_type___pyx_memoryviewslice = { - PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.oct_visitors._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 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "oct_visitors", - __pyx_k_Oct_visitor_functions, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_ARRAY_CLUE, __pyx_k_ARRAY_CLUE, sizeof(__pyx_k_ARRAY_CLUE), 0, 0, 1, 0}, - {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, - {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, - {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, - {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, - {&__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_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_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_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, - {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, - {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_SOMETHING_IS_AMISS, __pyx_k_SOMETHING_IS_AMISS, sizeof(__pyx_k_SOMETHING_IS_AMISS), 0, 0, 1, 0}, - {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, - {&__pyx_n_s_UNKNOWN, __pyx_k_UNKNOWN, sizeof(__pyx_k_UNKNOWN), 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_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, - {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, - {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, - {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, - {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, - {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 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_convert_to_units, __pyx_k_convert_to_units, sizeof(__pyx_k_convert_to_units), 0, 0, 1, 1}, - {&__pyx_n_s_domain_id, __pyx_k_domain_id, sizeof(__pyx_k_domain_id), 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_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, - {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, - {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, - {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, - {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, - {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, - {&__pyx_n_s_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_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_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, - {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, - {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, - {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, - {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_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_octree, __pyx_k_octree, sizeof(__pyx_k_octree), 0, 0, 1, 1}, - {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, - {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, - {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, - {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, - {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, - {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, - {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, - {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, - {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, - {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, - {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, - {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 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}, - {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, 32, __pyx_L1_error) - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 42, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 267, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 146, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(3, 149, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(3, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(3, 425, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(3, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(3, 818, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static int __Pyx_InitCachedConstants(void) { +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 - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + char *__pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) + /* "View.MemoryView":509 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_t_2 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + /* "View.MemoryView":511 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< * - * if ((child.byteorder == c'>' and little_endian) or + * if flags & PyBUF_STRIDES: */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + /* "View.MemoryView":513 + * info.shape = NULL * - * # Until ticket #99 is fixed, use integers to avoid warnings + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + /* "View.MemoryView":514 * - * cdef inline int import_umath() except -1: + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_t_2 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "View.MemoryView":513 + * info.shape = NULL * - * cdef inline int import_ufunc() except -1: + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + goto __pyx_L4; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "View.MemoryView":516 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L4:; - /* "selection_routines.pxd":30 - * if "code_length" == str(arr.units): - * return arr - * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< - * return arr + /* "View.MemoryView":518 + * info.strides = NULL * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":131 - * - * if not self.ndim: - * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + /* "View.MemoryView":519 * - * if itemsize <= 0: + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_t_2 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_2; - /* "View.MemoryView":134 - * - * if itemsize <= 0: - * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + /* "View.MemoryView":518 + * info.strides = NULL * - * if not isinstance(format, bytes): + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + goto __pyx_L5; + } - /* "View.MemoryView":137 + /* "View.MemoryView":521 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< * - * if not isinstance(format, bytes): - * format = format.encode('ASCII') # <<<<<<<<<<<<<< - * self._format = format # keep a reference to the byte string - * self.format = self._format + * if flags & PyBUF_FORMAT: */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(3, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L5:; - /* "View.MemoryView":146 - * - * if not self._shape: - * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< - * + /* "View.MemoryView":523 + * info.suboffsets = NULL * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(3, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":174 - * self.data = malloc(self.len) - * if not self.data: - * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + /* "View.MemoryView":524 * - * if self.dtype_is_object: + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_t_3 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_3; - /* "View.MemoryView":190 - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): - * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< - * info.buf = self.data - * info.len = self.len + /* "View.MemoryView":523 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + goto __pyx_L6; + } - /* "View.MemoryView":484 - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: - * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + /* "View.MemoryView":526 + * info.format = self.view.format * else: - * if len(self.view.format) == 1: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L6:; - /* "View.MemoryView":556 - * if self.view.strides == NULL: - * - * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + /* "View.MemoryView":528 + * info.format = NULL * - * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_t_4 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_4; - /* "View.MemoryView":563 - * def suboffsets(self): - * if self.view.suboffsets == NULL: - * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + /* "View.MemoryView":529 * - * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len */ - __pyx_tuple__19 = PyTuple_New(1); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_INCREF(__pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__19, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_t_5 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_5; - /* "View.MemoryView":668 - * if item is Ellipsis: - * if not seen_ellipsis: - * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< - * seen_ellipsis = True - * else: + /* "View.MemoryView":530 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = 0 */ - __pyx_slice__20 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(3, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); + __pyx_t_6 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_6; - /* "View.MemoryView":671 - * seen_ellipsis = True - * else: - * result.append(slice(None)) # <<<<<<<<<<<<<< - * have_slices = True - * else: + /* "View.MemoryView":531 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.obj = self */ - __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(3, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__21); - __Pyx_GIVEREF(__pyx_slice__21); + __pyx_t_6 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_6; - /* "View.MemoryView":682 - * nslices = ndim - len(result) - * if nslices: - * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + /* "View.MemoryView":532 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.obj = self * - * return have_slices or nslices, tuple(result) */ - __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(3, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__22); - __Pyx_GIVEREF(__pyx_slice__22); + __pyx_v_info->readonly = 0; - /* "View.MemoryView":689 - * for suboffset in suboffsets[:ndim]: - * if suboffset >= 0: - * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< - * + /* "View.MemoryView":533 + * info.len = self.view.len + * info.readonly = 0 + * info.obj = self # <<<<<<<<<<<<<< * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __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":282 - * return self.name + /* "View.MemoryView":507 * - * cdef generic = Enum("") # <<<<<<<<<<<<<< - * cdef strided = Enum("") # default - * cdef indirect = Enum("") + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - /* "View.MemoryView":283 - * - * cdef generic = Enum("") - * cdef strided = Enum("") # default # <<<<<<<<<<<<<< - * cdef indirect = Enum("") + /* function exit code */ + __pyx_r = 0; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":539 * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(3, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - /* "View.MemoryView":284 - * cdef generic = Enum("") - * cdef strided = Enum("") # default - * cdef indirect = Enum("") # <<<<<<<<<<<<<< +/* 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":540 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":541 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) + + /* "View.MemoryView":542 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< * + * @property */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(3, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; - /* "View.MemoryView":287 + /* "View.MemoryView":539 * + * @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":545 * - * cdef contiguous = Enum("") # <<<<<<<<<<<<<< - * cdef indirect_contiguous = Enum("") + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj * */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - /* "View.MemoryView":288 +/* 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":546 + * @property + * def base(self): + * return self.obj # <<<<<<<<<<<<<< * - * cdef contiguous = Enum("") - * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; + + /* "View.MemoryView":545 * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj * */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); - return -1; + return __pyx_r; } -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_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; +/* "View.MemoryView":549 + * + * @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; } -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initoct_visitors(void); /*proto*/ -PyMODINIT_FUNC initoct_visitors(void) -#else -PyMODINIT_FUNC PyInit_oct_visitors(void); /*proto*/ -PyMODINIT_FUNC PyInit_oct_visitors(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - static PyThread_type_lock __pyx_t_4[8]; +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 - #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"); + 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":550 + * @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, 550, __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, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_oct_visitors(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_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 PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("oct_visitors", __pyx_methods, __pyx_k_Oct_visitor_functions, 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) - __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) - #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_yt__geometry__oct_visitors) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":549 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_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":553 + * + * @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":554 + * @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 (__pyx_t_1) { + + /* "View.MemoryView":556 + * 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__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 556, __pyx_L1_error) + + /* "View.MemoryView":554 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "yt.geometry.oct_visitors")) { - if (unlikely(PyDict_SetItemString(modules, "yt.geometry.oct_visitors", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - } + + /* "View.MemoryView":558 + * 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, 558, __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, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - #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 init code ---*/ - generic = Py_None; Py_INCREF(Py_None); - strided = Py_None; Py_INCREF(Py_None); - indirect = Py_None; Py_INCREF(Py_None); - contiguous = Py_None; Py_INCREF(Py_None); - indirect_contiguous = Py_None; Py_INCREF(Py_None); - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor = &__pyx_vtable_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_OctVisitor.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_visit; - __pyx_vtable_2yt_8geometry_12oct_visitors_OctVisitor.oind = (int (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *))__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind; - __pyx_vtable_2yt_8geometry_12oct_visitors_OctVisitor.rind = (int (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *))__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_OctVisitor) < 0) __PYX_ERR(0, 26, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_OctVisitor.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_OctVisitor.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor) < 0) __PYX_ERR(0, 26, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "OctVisitor", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_OctVisitor) < 0) __PYX_ERR(0, 26, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = &__pyx_type_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalOcts; - __pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_14CountTotalOcts_visit; - __pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "CountTotalOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = &__pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells = &__pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalCells; - __pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalCells.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalCells.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_15CountTotalCells_visit; - __pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells) < 0) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells) < 0) __PYX_ERR(0, 88, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "CountTotalCells", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells) < 0) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells = &__pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_MarkOcts; - __pyx_vtable_2yt_8geometry_12oct_visitors_MarkOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_MarkOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_8MarkOcts_visit; - __pyx_type_2yt_8geometry_12oct_visitors_MarkOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_MarkOcts) < 0) __PYX_ERR(0, 96, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_MarkOcts.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_MarkOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts) < 0) __PYX_ERR(0, 96, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "MarkOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_MarkOcts) < 0) __PYX_ERR(0, 96, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts = &__pyx_type_2yt_8geometry_12oct_visitors_MarkOcts; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_MaskOcts; - __pyx_vtable_2yt_8geometry_12oct_visitors_MaskOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_MaskOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_8MaskOcts_visit; - __pyx_type_2yt_8geometry_12oct_visitors_MaskOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_MaskOcts) < 0) __PYX_ERR(0, 107, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_MaskOcts.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_MaskOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts) < 0) __PYX_ERR(0, 107, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "MaskOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_MaskOcts) < 0) __PYX_ERR(0, 107, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts = &__pyx_type_2yt_8geometry_12oct_visitors_MaskOcts; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_IndexOcts; - __pyx_vtable_2yt_8geometry_12oct_visitors_IndexOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_IndexOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_9IndexOcts_visit; - __pyx_type_2yt_8geometry_12oct_visitors_IndexOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_IndexOcts) < 0) __PYX_ERR(0, 115, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_IndexOcts.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_IndexOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts) < 0) __PYX_ERR(0, 115, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "IndexOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_IndexOcts) < 0) __PYX_ERR(0, 115, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts = &__pyx_type_2yt_8geometry_12oct_visitors_IndexOcts; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_ICoordsOcts; - __pyx_vtable_2yt_8geometry_12oct_visitors_ICoordsOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_ICoordsOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_11ICoordsOcts_visit; - __pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts) < 0) __PYX_ERR(0, 126, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts) < 0) __PYX_ERR(0, 126, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "ICoordsOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts) < 0) __PYX_ERR(0, 126, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts = &__pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_IResOcts; - __pyx_vtable_2yt_8geometry_12oct_visitors_IResOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_IResOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_8IResOcts_visit; - __pyx_type_2yt_8geometry_12oct_visitors_IResOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_IResOcts) < 0) __PYX_ERR(0, 137, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_IResOcts.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_IResOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts) < 0) __PYX_ERR(0, 137, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "IResOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_IResOcts) < 0) __PYX_ERR(0, 137, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts = &__pyx_type_2yt_8geometry_12oct_visitors_IResOcts; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_FCoordsOcts; - __pyx_vtable_2yt_8geometry_12oct_visitors_FCoordsOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_FCoordsOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_11FCoordsOcts_visit; - __pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts) < 0) __PYX_ERR(0, 146, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts) < 0) __PYX_ERR(0, 146, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "FCoordsOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts) < 0) __PYX_ERR(0, 146, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts = &__pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_FWidthOcts; - __pyx_vtable_2yt_8geometry_12oct_visitors_FWidthOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_FWidthOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_10FWidthOcts_visit; - __pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts) < 0) __PYX_ERR(0, 164, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts) < 0) __PYX_ERR(0, 164, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "FWidthOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts) < 0) __PYX_ERR(0, 164, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts = &__pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64 = &__pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayI64; - __pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayI64.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayI64.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_12CopyArrayI64_visit; - __pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "CopyArrayI64", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64 = &__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64 = &__pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayF64; - __pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayF64.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayF64.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_12CopyArrayF64_visit; - __pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64) < 0) __PYX_ERR(0, 61, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64) < 0) __PYX_ERR(0, 61, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "CopyArrayF64", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64) < 0) __PYX_ERR(0, 61, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64 = &__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_IdentifyOcts; - __pyx_vtable_2yt_8geometry_12oct_visitors_IdentifyOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_IdentifyOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_12IdentifyOcts_visit; - __pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts) < 0) __PYX_ERR(0, 181, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts) < 0) __PYX_ERR(0, 181, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "IdentifyOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts) < 0) __PYX_ERR(0, 181, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts = &__pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd = &__pyx_vtable_2yt_8geometry_12oct_visitors_AssignDomainInd; - __pyx_vtable_2yt_8geometry_12oct_visitors_AssignDomainInd.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_AssignDomainInd.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_15AssignDomainInd_visit; - __pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd) < 0) __PYX_ERR(0, 192, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd) < 0) __PYX_ERR(0, 192, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "AssignDomainInd", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd) < 0) __PYX_ERR(0, 192, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd = &__pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO = &__pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesO; - __pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesO.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesO.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_16FillFileIndicesO_visit; - __pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO) < 0) __PYX_ERR(0, 200, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO) < 0) __PYX_ERR(0, 200, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "FillFileIndicesO", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO) < 0) __PYX_ERR(0, 200, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO = &__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR = &__pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesR; - __pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesR.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesR.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_16FillFileIndicesR_visit; - __pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR) < 0) __PYX_ERR(0, 213, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR) < 0) __PYX_ERR(0, 213, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "FillFileIndicesR", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR) < 0) __PYX_ERR(0, 213, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR = &__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain = &__pyx_vtable_2yt_8geometry_12oct_visitors_CountByDomain; - __pyx_vtable_2yt_8geometry_12oct_visitors_CountByDomain.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_CountByDomain.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_13CountByDomain_visit; - __pyx_type_2yt_8geometry_12oct_visitors_CountByDomain.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_CountByDomain) < 0) __PYX_ERR(0, 226, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_CountByDomain.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_CountByDomain.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain) < 0) __PYX_ERR(0, 226, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "CountByDomain", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_CountByDomain) < 0) __PYX_ERR(0, 226, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain = &__pyx_type_2yt_8geometry_12oct_visitors_CountByDomain; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = &__pyx_vtable_2yt_8geometry_12oct_visitors_StoreOctree; - __pyx_vtable_2yt_8geometry_12oct_visitors_StoreOctree.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_StoreOctree.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_11StoreOctree_visit; - __pyx_type_2yt_8geometry_12oct_visitors_StoreOctree.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_StoreOctree) < 0) __PYX_ERR(0, 235, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_StoreOctree.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_StoreOctree.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree) < 0) __PYX_ERR(0, 235, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "StoreOctree", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_StoreOctree) < 0) __PYX_ERR(0, 235, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree = &__pyx_type_2yt_8geometry_12oct_visitors_StoreOctree; - __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = &__pyx_vtable_2yt_8geometry_12oct_visitors_LoadOctree; - __pyx_vtable_2yt_8geometry_12oct_visitors_LoadOctree.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; - __pyx_vtable_2yt_8geometry_12oct_visitors_LoadOctree.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_10LoadOctree_visit; - __pyx_type_2yt_8geometry_12oct_visitors_LoadOctree.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; - if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_LoadOctree) < 0) __PYX_ERR(0, 250, __pyx_L1_error) - __pyx_type_2yt_8geometry_12oct_visitors_LoadOctree.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_LoadOctree.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree) < 0) __PYX_ERR(0, 250, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "LoadOctree", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_LoadOctree) < 0) __PYX_ERR(0, 250, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = &__pyx_type_2yt_8geometry_12oct_visitors_LoadOctree; - __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(3, 103, __pyx_L1_error) - __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(3, 103, __pyx_L1_error) - __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(3, 275, __pyx_L1_error) - __pyx_type___pyx_MemviewEnum.tp_print = 0; - __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; - __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; - __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; - __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; - __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; - __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; - __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; - __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; - __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; - if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(3, 326, __pyx_L1_error) - __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(3, 326, __pyx_L1_error) - __pyx_memoryview_type = &__pyx_type___pyx_memoryview; - __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; - __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; - __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; - __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; - __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) - __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) - __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; - /*--- Type import code ---*/ - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", - #if CYTHON_COMPILING_IN_PYPY - sizeof(PyTypeObject), - #else - sizeof(PyHeapTypeObject), - #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(4, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 33, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 33, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 71, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 71, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 74, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 74, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(5, 57, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(5, 57, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(5, 89, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(5, 89, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(5, 97, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(5, 97, __pyx_L1_error) - /*--- Variable import code ---*/ - __pyx_t_1 = __Pyx_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr(__pyx_t_1, "ORDER_MAX", (void **)&__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*--- Function import code ---*/ - __pyx_t_2 = __Pyx_ImportModule("yt.geometry.grid_visitors"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_2, "check_child_masked", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked, "__pyx_t_5numpy_uint8_t (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "yt/geometry/oct_visitors.pyx":19 - * cimport cython - * cimport numpy - * import numpy # <<<<<<<<<<<<<< - * from yt.utilities.lib.fp_utils cimport * - * from libc.stdlib cimport malloc, free - */ - __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; - /* "yt/geometry/oct_visitors.pyx":1 - * """ # <<<<<<<<<<<<<< - * Oct visitor functions + /* "View.MemoryView":553 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":207 - * info.obj = self - * - * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + /* 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":561 * - * def __dealloc__(array self): + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(3, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_array_type); - /* "View.MemoryView":282 - * return self.name +/* 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":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim * - * cdef generic = Enum("") # <<<<<<<<<<<<<< - * cdef strided = Enum("") # default - * cdef indirect = Enum("") */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XGOTREF(generic); - __Pyx_DECREF_SET(generic, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":283 - * - * cdef generic = Enum("") - * cdef strided = Enum("") # default # <<<<<<<<<<<<<< - * cdef indirect = Enum("") + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XGOTREF(strided); - __Pyx_DECREF_SET(strided, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__23, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "View.MemoryView":284 - * cdef generic = Enum("") - * cdef strided = Enum("") # default - * cdef indirect = Enum("") # <<<<<<<<<<<<<< - * + /* "View.MemoryView":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XGOTREF(indirect); - __Pyx_DECREF_SET(indirect, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + } - /* "View.MemoryView":287 - * + /* "View.MemoryView":565 + * return (-1,) * self.view.ndim * - * cdef contiguous = Enum("") # <<<<<<<<<<<<<< - * cdef indirect_contiguous = Enum("") + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< * + * @property */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 287, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_XGOTREF(contiguous); - __Pyx_DECREF_SET(contiguous, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":561 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_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":568 + * + * @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":569 + * @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, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":568 + * + * @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":572 + * + * @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":573 + * @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, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":572 + * + * @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":576 + * + * @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":577 + * @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, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":576 + * + * @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":580 + * + * @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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":582 + * 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":584 + * 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, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":585 + * + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":587 + * 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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":589 + * 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":580 + * + * @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":591 + * 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":592 + * + * 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":593 + * 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":592 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":595 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":591 + * 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":597 + * 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":598 + * + * 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, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":599 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":598 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":597 + * 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":601 + * 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":602 + * + * 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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":601 + * 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":605 + * + * + * 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":608 + * 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":609 + * 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, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":605 + * + * + * 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":611 + * 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":614 + * 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":615 + * 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, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":611 + * 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":617 + * 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":619 + * 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":621 + * 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":622 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":627 + * 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, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":617 + * 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":629 + * 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":631 + * 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":633 + * 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":634 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":639 + * 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, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":629 + * 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__24, 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__25, 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":643 + * + * @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":644 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __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, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":645 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":646 + * 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":643 + * + * @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":649 + * + * @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":650 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":649 + * + * @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":652 + * 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":657 + * 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":658 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":657 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":660 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":662 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":663 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":664 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":665 + * 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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 665, __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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__26); + __Pyx_GIVEREF(__pyx_slice__26); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__26); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":669 + * 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":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__27); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":672 + * 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":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":675 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(1, 675, __pyx_L1_error) + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":677 + * 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":678 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":665 + * 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":680 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__28); + __Pyx_GIVEREF(__pyx_slice__28); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__28); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":684 + * 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, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "View.MemoryView":652 + * 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":686 + * 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":687 + * + * 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":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":689 + * 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__29, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 689, __pyx_L1_error) + + /* "View.MemoryView":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":686 + * 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":696 + * + * @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":697 + * @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":704 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + + /* "View.MemoryView":708 + * 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, 708, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":711 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":712 + * 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":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":714 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":715 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":721 + * + * + * 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":722 + * + * 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":727 + * + * + * 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":728 + * + * 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":732 + * 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, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 732, __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":733 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":737 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) + + /* "View.MemoryView":734 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) + + /* "View.MemoryView":733 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":741 + * 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":742 + * 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":743 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":744 + * 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":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":746 + * 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, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":747 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":748 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":750 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":751 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":752 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":754 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) + + /* "View.MemoryView":760 + * 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":732 + * 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":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":763 + * + * 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":764 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } + + /* "View.MemoryView":765 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } + + /* "View.MemoryView":763 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":769 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":696 + * + * @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":793 + * + * @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":813 + * 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":815 + * 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":816 + * + * 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":815 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_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":818 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":813 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":821 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __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":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_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":824 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) + + /* "View.MemoryView":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + } + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":828 + * + * 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":829 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":830 + * 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":831 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":830 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":828 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":832 + * 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":833 + * 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":834 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":833 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":836 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":832 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":839 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":841 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":844 + * + * 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":845 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":846 + * 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":847 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":846 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":844 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":848 + * 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":849 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":848 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":852 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":854 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":857 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":861 + * + * 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":863 + * 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":864 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":863 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":866 + * 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":867 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":866 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":870 + * + * + * 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":871 + * + * 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":872 + * 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":875 + * + * + * 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":876 + * + * 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":875 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":878 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":880 + * 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":881 + * + * 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":882 + * 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":883 + * 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":882 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":885 + * 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":886 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":881 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":888 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":880 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":890 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":793 + * + * @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":896 + * + * @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":898 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":899 + * 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":902 + * 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":903 + * + * 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, 903, __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, 903, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":904 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":902 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":906 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":907 + * 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":908 + * 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":909 + * 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":908 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":911 + * 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":912 + * + * 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":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":914 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 914, __pyx_L1_error) + + /* "View.MemoryView":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":911 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":917 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 917, __pyx_L1_error) + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":919 + * 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":920 + * + * 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":921 + * 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":920 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":923 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":896 + * + * @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":929 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + + /* "View.MemoryView":930 + * @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":932 + * 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":933 + * + * 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":937 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":938 + * 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":939 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":940 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L6_bool_binop_done:; + if (__pyx_t_6) { + + /* "View.MemoryView":943 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + } + } + + /* "View.MemoryView":945 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":929 + * + * @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":962 + * 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":963 + * + * 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":962 + * 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":965 + * __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":966 + * + * 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":967 + * 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, 967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":966 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":969 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":965 + * __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":971 + * 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":972 + * + * 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":973 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) + + /* "View.MemoryView":972 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":975 + * 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, 975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":971 + * 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":978 + * + * @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":979 + * @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":978 + * + * @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__30, 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__31, 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":985 + * + * @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":993 + * 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":994 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "View.MemoryView":993 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":999 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __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, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1001 + * 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":1002 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1004 + * __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, 1004, __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":1005 + * + * 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":1007 + * 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":1008 + * + * 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":1009 + * 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":1010 + * 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":1011 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * result.flags = PyBUF_RECORDS + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":1013 + * Py_INCREF(Py_None) + * + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1015 + * result.flags = PyBUF_RECORDS + * + * 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":1016 + * + * 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":1019 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1020 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1022 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":1023 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L5_break; + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L5_break:; + + /* "View.MemoryView":1025 + * 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":1026 + * + * 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, 1026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1027 + * 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, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1029 + * 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":1030 + * + * 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":1032 + * 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":985 + * + * @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":1035 + * + * @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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1039 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1040 + * 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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1042 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1043 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1035 + * + * @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":1046 + * + * @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; + Py_ssize_t __pyx_t_4; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1050 + * 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":1051 + * + * 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":1052 + * 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":1054 + * 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":1055 + * + * 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":1057 + * 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; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_dim = __pyx_t_3; + + /* "View.MemoryView":1058 + * + * 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":1059 + * 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":1060 + * 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_4 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_4 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4; + } + + /* "View.MemoryView":1046 + * + * @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":1063 + * + * @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":1066 + * "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":1067 + * 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, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1063 + * + * @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":1070 + * + * @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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1078 + * + * 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":1079 + * 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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1081 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1082 + * 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":1084 + * 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":1086 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1070 + * + * @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":1092 + * + * + * 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":1093 + * + * 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":1094 + * 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":1093 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1096 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1092 + * + * + * 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":1099 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1104 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1105 + * 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":1107 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1108 + * + * 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":1109 + * 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":1110 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1108 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1112 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1113 + * + * 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":1114 + * 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":1115 + * 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":1113 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1117 + * 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":1118 + * + * 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":1117 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1120 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1099 + * + * @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":1123 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + + /* "View.MemoryView":1130 + * + * 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":1131 + * 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":1132 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1133 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1135 + * 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":1136 + * + * 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":1137 + * 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":1136 + * + * 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":1138 + * 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): + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + + /* "View.MemoryView":1136 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1140 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1141 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + + /* "View.MemoryView":1142 + * 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":1143 + * 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":1135 + * 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":1145 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1146 + * 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":1150 + * 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":1151 + * 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":1123 + * + * @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":1153 + * 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":1156 + * __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":1153 + * 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":1160 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1163 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1165 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1166 + * + * 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":1168 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1160 + * + * @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":1171 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1180 + * 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":1181 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "View.MemoryView":1182 + * 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":1183 + * 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":1180 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1185 + * 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 > -1L; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1186 + * 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":1187 + * 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":1189 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1171 + * + * @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":1192 + * + * @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; + + /* "View.MemoryView":1203 + * 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":1204 + * + * 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":1206 + * 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":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1208 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) + + /* "View.MemoryView":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1211 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1212 + * + * 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":1213 + * 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; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1214 + * 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":1215 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1217 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + + /* "View.MemoryView":1221 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1222 + * + * 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":1223 + * 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":1222 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1225 + * 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":1226 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + + /* "View.MemoryView":1225 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1228 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1230 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1192 + * + * @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":1235 + * + * @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":1238 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __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":1237 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 1237, __pyx_L1_error) + + /* "View.MemoryView":1235 + * + * @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":1241 + * + * @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":1242 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_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, 1242, __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, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 1242, __pyx_L1_error) + + /* "View.MemoryView":1241 + * + * @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":1245 + * + * @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":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1247 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_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, 1247, __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, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 1247, __pyx_L1_error) + + /* "View.MemoryView":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1249 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(1, 1249, __pyx_L1_error) + } + + /* "View.MemoryView":1245 + * + * @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":1252 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + + /* "View.MemoryView":1260 + * 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":1261 + * """ + * 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":1263 + * 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":1264 + * 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":1265 + * 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":1268 + * 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":1269 + * + * 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":1268 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1271 + * 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":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1273 + * 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":1275 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1276 + * + * 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":1277 + * 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":1278 + * 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":1279 + * 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":1277 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1281 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1276 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1284 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + } + } + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1289 + * + * 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":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1291 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_6; + + /* "View.MemoryView":1292 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1298 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1302 + * 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":1304 + * 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":1305 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + + /* "View.MemoryView":1306 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1307 + * 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":1308 + * 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":1302 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_7 = (__pyx_t_2 != 0); + if (__pyx_t_7) { + + /* "View.MemoryView":1313 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) + + /* "View.MemoryView":1314 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1316 + * 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":1317 + * + * 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":1318 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1320 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1321 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1252 + * + * @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":1324 + * + * @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; + + /* "View.MemoryView":1328 + * 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":1330 + * 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 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1331 + * + * 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":1332 + * 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":1333 + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1335 + * 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; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1336 + * + * for i in range(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":1337 + * 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":1338 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1324 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1346 + * + * @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":1350 + * + * + * 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":1351 + * + * 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":1350 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1346 + * + * @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":1355 + * + * @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":1358 + * 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":1355 + * + * @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":1361 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1365 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_3 = (__pyx_v_inc != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1368 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1370 + * 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":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1372 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1373 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1375 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1361 + * + * @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":1381 + * + * @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":1384 + * 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":1385 + * 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":1387 + * _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":1381 + * + * @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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "View.MemoryView":1395 + * 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":1396 + * 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":1398 + * 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":1399 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1400 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1401 + * 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":1398 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1403 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1404 + * 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":1406 + * _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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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_2yt_8geometry_12oct_visitors_OctVisitor __pyx_vtable_2yt_8geometry_12oct_visitors_OctVisitor; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *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_2yt_8geometry_12oct_visitors_OctVisitor *)o); + p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + 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_2yt_8geometry_12oct_visitors_OctVisitor[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_5__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_OctVisitor = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.OctVisitor", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_OctVisitor, /*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_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor, /*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_2yt_8geometry_12oct_visitors_CountTotalOcts __pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalOcts; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_CountTotalOcts(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts; + return o; +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_CountTotalOcts[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_14CountTotalOcts_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_14CountTotalOcts_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.CountTotalOcts", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_CountTotalOcts, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_CountTotalOcts, /*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_2yt_8geometry_12oct_visitors_CountTotalCells __pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalCells; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_CountTotalCells(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells; + return o; +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_CountTotalCells[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_15CountTotalCells_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_15CountTotalCells_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.CountTotalCells", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_CountTotalCells, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_CountTotalCells, /*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_2yt_8geometry_12oct_visitors_MarkOcts __pyx_vtable_2yt_8geometry_12oct_visitors_MarkOcts; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_MarkOcts(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts; + p->mark.data = NULL; + p->mark.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_MarkOcts(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->mark, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_MarkOcts[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_8MarkOcts_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_8MarkOcts_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_MarkOcts = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.MarkOcts", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_MarkOcts, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_MarkOcts, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_MarkOcts, /*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_2yt_8geometry_12oct_visitors_MaskOcts __pyx_vtable_2yt_8geometry_12oct_visitors_MaskOcts; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_MaskOcts(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts; + p->mask.data = NULL; + p->mask.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_MaskOcts(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->mask, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_MaskOcts[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_8MaskOcts_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_8MaskOcts_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_MaskOcts = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.MaskOcts", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_MaskOcts, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_MaskOcts, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_MaskOcts, /*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_2yt_8geometry_12oct_visitors_IndexOcts __pyx_vtable_2yt_8geometry_12oct_visitors_IndexOcts; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_IndexOcts(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts; + p->oct_index.data = NULL; + p->oct_index.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_IndexOcts(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->oct_index, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_IndexOcts[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_9IndexOcts_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_9IndexOcts_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_IndexOcts = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.IndexOcts", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_IndexOcts, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_IndexOcts, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_IndexOcts, /*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_2yt_8geometry_12oct_visitors_ICoordsOcts __pyx_vtable_2yt_8geometry_12oct_visitors_ICoordsOcts; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_ICoordsOcts(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts; + p->icoords.data = NULL; + p->icoords.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_ICoordsOcts(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->icoords, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_ICoordsOcts[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_11ICoordsOcts_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_11ICoordsOcts_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.ICoordsOcts", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_ICoordsOcts, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_ICoordsOcts, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_ICoordsOcts, /*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_2yt_8geometry_12oct_visitors_IResOcts __pyx_vtable_2yt_8geometry_12oct_visitors_IResOcts; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_IResOcts(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts; + p->ires.data = NULL; + p->ires.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_IResOcts(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->ires, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_IResOcts[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_8IResOcts_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_8IResOcts_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_IResOcts = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.IResOcts", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_IResOcts, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_IResOcts, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_IResOcts, /*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_2yt_8geometry_12oct_visitors_FCoordsOcts __pyx_vtable_2yt_8geometry_12oct_visitors_FCoordsOcts; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_FCoordsOcts(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts; + p->fcoords.data = NULL; + p->fcoords.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FCoordsOcts(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->fcoords, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_FCoordsOcts[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_11FCoordsOcts_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_11FCoordsOcts_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.FCoordsOcts", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FCoordsOcts, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_FCoordsOcts, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_FCoordsOcts, /*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_2yt_8geometry_12oct_visitors_FWidthOcts __pyx_vtable_2yt_8geometry_12oct_visitors_FWidthOcts; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_FWidthOcts(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts; + p->fwidth.data = NULL; + p->fwidth.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FWidthOcts(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->fwidth, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_FWidthOcts[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_10FWidthOcts_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_10FWidthOcts_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.FWidthOcts", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FWidthOcts, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_FWidthOcts, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_FWidthOcts, /*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_2yt_8geometry_12oct_visitors_CopyArrayI64 __pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayI64; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_CopyArrayI64(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64; + p->source.data = NULL; + p->source.memview = NULL; + p->dest.data = NULL; + p->dest.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_CopyArrayI64(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->source, 1); + __PYX_XDEC_MEMVIEW(&p->dest, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_CopyArrayI64[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_12CopyArrayI64_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_12CopyArrayI64_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64 = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.CopyArrayI64", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_CopyArrayI64, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_CopyArrayI64, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_CopyArrayI64, /*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_2yt_8geometry_12oct_visitors_CopyArrayF64 __pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayF64; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_CopyArrayF64(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64; + p->source.data = NULL; + p->source.memview = NULL; + p->dest.data = NULL; + p->dest.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_CopyArrayF64(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->source, 1); + __PYX_XDEC_MEMVIEW(&p->dest, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_CopyArrayF64[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_12CopyArrayF64_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_12CopyArrayF64_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64 = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.CopyArrayF64", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_CopyArrayF64, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_CopyArrayF64, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_CopyArrayF64, /*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_2yt_8geometry_12oct_visitors_IdentifyOcts __pyx_vtable_2yt_8geometry_12oct_visitors_IdentifyOcts; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_IdentifyOcts(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts; + p->domain_mask.data = NULL; + p->domain_mask.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_IdentifyOcts(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->domain_mask, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_IdentifyOcts[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_12IdentifyOcts_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_12IdentifyOcts_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.IdentifyOcts", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_IdentifyOcts, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_IdentifyOcts, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_IdentifyOcts, /*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_2yt_8geometry_12oct_visitors_AssignDomainInd __pyx_vtable_2yt_8geometry_12oct_visitors_AssignDomainInd; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_AssignDomainInd(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd; + return o; +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_AssignDomainInd[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_15AssignDomainInd_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_15AssignDomainInd_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.AssignDomainInd", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_AssignDomainInd, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_AssignDomainInd, /*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_2yt_8geometry_12oct_visitors_FillFileIndicesO __pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesO; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_FillFileIndicesO(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO; + p->levels.data = NULL; + p->levels.memview = NULL; + p->file_inds.data = NULL; + p->file_inds.memview = NULL; + p->cell_inds.data = NULL; + p->cell_inds.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FillFileIndicesO(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->levels, 1); + __PYX_XDEC_MEMVIEW(&p->file_inds, 1); + __PYX_XDEC_MEMVIEW(&p->cell_inds, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_FillFileIndicesO[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_16FillFileIndicesO_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_16FillFileIndicesO_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.FillFileIndicesO", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FillFileIndicesO, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_FillFileIndicesO, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_FillFileIndicesO, /*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_2yt_8geometry_12oct_visitors_FillFileIndicesR __pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesR; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_FillFileIndicesR(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR; + p->levels.data = NULL; + p->levels.memview = NULL; + p->file_inds.data = NULL; + p->file_inds.memview = NULL; + p->cell_inds.data = NULL; + p->cell_inds.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FillFileIndicesR(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->levels, 1); + __PYX_XDEC_MEMVIEW(&p->file_inds, 1); + __PYX_XDEC_MEMVIEW(&p->cell_inds, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_FillFileIndicesR[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_16FillFileIndicesR_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_16FillFileIndicesR_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.FillFileIndicesR", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_FillFileIndicesR, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_FillFileIndicesR, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_FillFileIndicesR, /*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_2yt_8geometry_12oct_visitors_CountByDomain __pyx_vtable_2yt_8geometry_12oct_visitors_CountByDomain; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_CountByDomain(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain; + p->domain_counts.data = NULL; + p->domain_counts.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_CountByDomain(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->domain_counts, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_CountByDomain[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_13CountByDomain_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_13CountByDomain_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_CountByDomain = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.CountByDomain", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_CountByDomain, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_CountByDomain, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_CountByDomain, /*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_2yt_8geometry_12oct_visitors_StoreOctree __pyx_vtable_2yt_8geometry_12oct_visitors_StoreOctree; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_StoreOctree(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree; + p->ref_mask.data = NULL; + p->ref_mask.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_StoreOctree(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->ref_mask, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_StoreOctree[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_11StoreOctree_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_11StoreOctree_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_StoreOctree = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.StoreOctree", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_StoreOctree, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_StoreOctree, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_StoreOctree, /*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_2yt_8geometry_12oct_visitors_LoadOctree __pyx_vtable_2yt_8geometry_12oct_visitors_LoadOctree; + +static PyObject *__pyx_tp_new_2yt_8geometry_12oct_visitors_LoadOctree(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_12oct_visitors_OctVisitor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree; + p->ref_mask.data = NULL; + p->ref_mask.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_LoadOctree(PyObject *o) { + struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *p = (struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_XDEC_MEMVIEW(&p->ref_mask, 1); + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_OctVisitor(o); +} + +static PyMethodDef __pyx_methods_2yt_8geometry_12oct_visitors_LoadOctree[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_10LoadOctree_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_12oct_visitors_10LoadOctree_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_12oct_visitors_LoadOctree = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.LoadOctree", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_12oct_visitors_LoadOctree, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_12oct_visitors_LoadOctree, /*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*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_12oct_visitors_10OctVisitor_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_12oct_visitors_LoadOctree, /*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 PY_VERSION_HEX >= 0x030400a1 + 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 = 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 = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + 0, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.oct_visitors.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.geometry.oct_visitors.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.geometry.oct_visitors.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.geometry.oct_visitors._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 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + "oct_visitors", + __pyx_k_Oct_visitor_functions, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_ARRAY_CLUE, __pyx_k_ARRAY_CLUE, sizeof(__pyx_k_ARRAY_CLUE), 0, 0, 1, 0}, + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__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_0x04, __pyx_k_Incompatible_checksums_s_vs_0x04, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x04), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0x04_2, __pyx_k_Incompatible_checksums_s_vs_0x04_2, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x04_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0x28, __pyx_k_Incompatible_checksums_s_vs_0x28, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x28), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0x2d, __pyx_k_Incompatible_checksums_s_vs_0x2d, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x2d), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0x43, __pyx_k_Incompatible_checksums_s_vs_0x43, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x43), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0x55, __pyx_k_Incompatible_checksums_s_vs_0x55, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x55), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0x5d, __pyx_k_Incompatible_checksums_s_vs_0x5d, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x5d), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0x5e, __pyx_k_Incompatible_checksums_s_vs_0x5e, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x5e), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xaf, __pyx_k_Incompatible_checksums_s_vs_0xaf, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xaf), 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_0xbe, __pyx_k_Incompatible_checksums_s_vs_0xbe, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xbe), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xc7, __pyx_k_Incompatible_checksums_s_vs_0xc7, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xc7), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xf2, __pyx_k_Incompatible_checksums_s_vs_0xf2, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xf2), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xfc, __pyx_k_Incompatible_checksums_s_vs_0xfc, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xfc), 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_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_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__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_kp_s_SOMETHING_IS_AMISS, __pyx_k_SOMETHING_IS_AMISS, sizeof(__pyx_k_SOMETHING_IS_AMISS), 0, 0, 1, 0}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_UNKNOWN, __pyx_k_UNKNOWN, sizeof(__pyx_k_UNKNOWN), 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_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 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_convert_to_units, __pyx_k_convert_to_units, sizeof(__pyx_k_convert_to_units), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_domain_id, __pyx_k_domain_id, sizeof(__pyx_k_domain_id), 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_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_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_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_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_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_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_octree, __pyx_k_octree, sizeof(__pyx_k_octree), 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_print, __pyx_k_print, sizeof(__pyx_k_print), 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_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_AssignDomainInd, __pyx_k_pyx_unpickle_AssignDomainInd, sizeof(__pyx_k_pyx_unpickle_AssignDomainInd), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_CopyArrayF64, __pyx_k_pyx_unpickle_CopyArrayF64, sizeof(__pyx_k_pyx_unpickle_CopyArrayF64), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_CopyArrayI64, __pyx_k_pyx_unpickle_CopyArrayI64, sizeof(__pyx_k_pyx_unpickle_CopyArrayI64), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_CountByDomain, __pyx_k_pyx_unpickle_CountByDomain, sizeof(__pyx_k_pyx_unpickle_CountByDomain), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_CountTotalCells, __pyx_k_pyx_unpickle_CountTotalCells, sizeof(__pyx_k_pyx_unpickle_CountTotalCells), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_CountTotalOcts, __pyx_k_pyx_unpickle_CountTotalOcts, sizeof(__pyx_k_pyx_unpickle_CountTotalOcts), 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_FCoordsOcts, __pyx_k_pyx_unpickle_FCoordsOcts, sizeof(__pyx_k_pyx_unpickle_FCoordsOcts), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_FWidthOcts, __pyx_k_pyx_unpickle_FWidthOcts, sizeof(__pyx_k_pyx_unpickle_FWidthOcts), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_FillFileIndicesO, __pyx_k_pyx_unpickle_FillFileIndicesO, sizeof(__pyx_k_pyx_unpickle_FillFileIndicesO), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_FillFileIndicesR, __pyx_k_pyx_unpickle_FillFileIndicesR, sizeof(__pyx_k_pyx_unpickle_FillFileIndicesR), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_ICoordsOcts, __pyx_k_pyx_unpickle_ICoordsOcts, sizeof(__pyx_k_pyx_unpickle_ICoordsOcts), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_IResOcts, __pyx_k_pyx_unpickle_IResOcts, sizeof(__pyx_k_pyx_unpickle_IResOcts), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_IdentifyOcts, __pyx_k_pyx_unpickle_IdentifyOcts, sizeof(__pyx_k_pyx_unpickle_IdentifyOcts), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_IndexOcts, __pyx_k_pyx_unpickle_IndexOcts, sizeof(__pyx_k_pyx_unpickle_IndexOcts), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_MarkOcts, __pyx_k_pyx_unpickle_MarkOcts, sizeof(__pyx_k_pyx_unpickle_MarkOcts), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_MaskOcts, __pyx_k_pyx_unpickle_MaskOcts, sizeof(__pyx_k_pyx_unpickle_MaskOcts), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_OctVisitor, __pyx_k_pyx_unpickle_OctVisitor, sizeof(__pyx_k_pyx_unpickle_OctVisitor), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_StoreOctree, __pyx_k_pyx_unpickle_StoreOctree, sizeof(__pyx_k_pyx_unpickle_StoreOctree), 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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_kp_s_self_nfinest_self_nocts_self_oct, __pyx_k_self_nfinest_self_nocts_self_oct, sizeof(__pyx_k_self_nfinest_self_nocts_self_oct), 0, 0, 1, 0}, + {&__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_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_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_units, __pyx_k_units, sizeof(__pyx_k_units), 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_yt_geometry_oct_visitors, __pyx_k_yt_geometry_oct_visitors, sizeof(__pyx_k_yt_geometry_oct_visitors), 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, 32, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 267, __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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 218, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 989, __pyx_L1_error) + __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(1, 81, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 84, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 94, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_nfinest_self_nocts_self_oct); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(tree fragment)":4 + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.nfinest,self.nocts,self.octs cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_nfinest_self_nocts_self_oct); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "selection_routines.pxd":26 + * if "code_length" == str(arr.units): + * return arr + * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "View.MemoryView":131 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "View.MemoryView":134 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "View.MemoryView":137 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "View.MemoryView":146 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "View.MemoryView":174 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "(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__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "(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__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "View.MemoryView":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "View.MemoryView":556 + * 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__22 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __pyx_tuple__23 = PyTuple_New(1); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__23, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "(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__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "(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__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "View.MemoryView":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__26); + __Pyx_GIVEREF(__pyx_slice__26); + + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__27); + __Pyx_GIVEREF(__pyx_slice__27); + + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__28); + __Pyx_GIVEREF(__pyx_slice__28); + + /* "View.MemoryView":689 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "(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__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "(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__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "(tree fragment)":1 + * def __pyx_unpickle_OctVisitor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError + */ + __pyx_tuple__32 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_OctVisitor, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CopyArrayI64, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CopyArrayF64, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CountTotalOcts, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 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, 0, __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_CountTotalCells, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_MarkOcts, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__44 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_MaskOcts, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__46 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_IndexOcts, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__48 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ICoordsOcts, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_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, 0, __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_IResOcts, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_FCoordsOcts, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_FWidthOcts, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_IdentifyOcts, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_AssignDomainInd, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__60 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_FillFileIndicesO, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__62 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_FillFileIndicesR, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__64 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CountByDomain, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__66 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_StoreOctree, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "View.MemoryView":282 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + + /* "View.MemoryView":283 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + + /* "View.MemoryView":284 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + + /* "View.MemoryView":287 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + + /* "View.MemoryView":288 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__73 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __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_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_4666766 = PyInt_FromLong(4666766L); if (unlikely(!__pyx_int_4666766)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_5148890 = PyInt_FromLong(5148890L); if (unlikely(!__pyx_int_5148890)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_42400366 = PyInt_FromLong(42400366L); if (unlikely(!__pyx_int_42400366)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_47947068 = PyInt_FromLong(47947068L); if (unlikely(!__pyx_int_47947068)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_70911054 = PyInt_FromLong(70911054L); if (unlikely(!__pyx_int_70911054)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_89912527 = PyInt_FromLong(89912527L); if (unlikely(!__pyx_int_89912527)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_97541528 = PyInt_FromLong(97541528L); if (unlikely(!__pyx_int_97541528)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_98598377 = PyInt_FromLong(98598377L); if (unlikely(!__pyx_int_98598377)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_184334439 = PyInt_FromLong(184334439L); if (unlikely(!__pyx_int_184334439)) __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_199869897 = PyInt_FromLong(199869897L); if (unlikely(!__pyx_int_199869897)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_209580373 = PyInt_FromLong(209580373L); if (unlikely(!__pyx_int_209580373)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_254291486 = PyInt_FromLong(254291486L); if (unlikely(!__pyx_int_254291486)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_265234149 = PyInt_FromLong(265234149L); if (unlikely(!__pyx_int_265234149)) __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; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initoct_visitors(void); /*proto*/ +PyMODINIT_FUNC initoct_visitors(void) +#else +PyMODINIT_FUNC PyInit_oct_visitors(void); /*proto*/ +PyMODINIT_FUNC PyInit_oct_visitors(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + static PyThread_type_lock __pyx_t_4[8]; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_oct_visitors(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_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 PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("oct_visitors", __pyx_methods, __pyx_k_Oct_visitor_functions, 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) + __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_yt__geometry__oct_visitors) { + 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, "yt.geometry.oct_visitors")) { + if (unlikely(PyDict_SetItemString(modules, "yt.geometry.oct_visitors", __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 init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor = &__pyx_vtable_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_OctVisitor.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_visit; + __pyx_vtable_2yt_8geometry_12oct_visitors_OctVisitor.oind = (int (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *))__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind; + __pyx_vtable_2yt_8geometry_12oct_visitors_OctVisitor.rind = (int (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *))__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_OctVisitor) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_OctVisitor.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_OctVisitor.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "OctVisitor", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_OctVisitor) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_OctVisitor) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = &__pyx_type_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalOcts; + __pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_14CountTotalOcts_visit; + __pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "CountTotalOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = &__pyx_type_2yt_8geometry_12oct_visitors_CountTotalOcts; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells = &__pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalCells; + __pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalCells.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_CountTotalCells.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_15CountTotalCells_visit; + __pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "CountTotalCells", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells = &__pyx_type_2yt_8geometry_12oct_visitors_CountTotalCells; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_MarkOcts; + __pyx_vtable_2yt_8geometry_12oct_visitors_MarkOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_MarkOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_8MarkOcts_visit; + __pyx_type_2yt_8geometry_12oct_visitors_MarkOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_MarkOcts) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_MarkOcts.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_MarkOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "MarkOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_MarkOcts) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_MarkOcts) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts = &__pyx_type_2yt_8geometry_12oct_visitors_MarkOcts; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_MaskOcts; + __pyx_vtable_2yt_8geometry_12oct_visitors_MaskOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_MaskOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_8MaskOcts_visit; + __pyx_type_2yt_8geometry_12oct_visitors_MaskOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_MaskOcts) < 0) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_MaskOcts.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_MaskOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts) < 0) __PYX_ERR(0, 107, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "MaskOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_MaskOcts) < 0) __PYX_ERR(0, 107, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_MaskOcts) < 0) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts = &__pyx_type_2yt_8geometry_12oct_visitors_MaskOcts; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_IndexOcts; + __pyx_vtable_2yt_8geometry_12oct_visitors_IndexOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_IndexOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_9IndexOcts_visit; + __pyx_type_2yt_8geometry_12oct_visitors_IndexOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_IndexOcts) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_IndexOcts.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_IndexOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "IndexOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_IndexOcts) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_IndexOcts) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts = &__pyx_type_2yt_8geometry_12oct_visitors_IndexOcts; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_ICoordsOcts; + __pyx_vtable_2yt_8geometry_12oct_visitors_ICoordsOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_ICoordsOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_11ICoordsOcts_visit; + __pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts) < 0) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts) < 0) __PYX_ERR(0, 126, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ICoordsOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts) < 0) __PYX_ERR(0, 126, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts) < 0) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts = &__pyx_type_2yt_8geometry_12oct_visitors_ICoordsOcts; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_IResOcts; + __pyx_vtable_2yt_8geometry_12oct_visitors_IResOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_IResOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_8IResOcts_visit; + __pyx_type_2yt_8geometry_12oct_visitors_IResOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_IResOcts) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_IResOcts.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_IResOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "IResOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_IResOcts) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_IResOcts) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts = &__pyx_type_2yt_8geometry_12oct_visitors_IResOcts; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_FCoordsOcts; + __pyx_vtable_2yt_8geometry_12oct_visitors_FCoordsOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_FCoordsOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_11FCoordsOcts_visit; + __pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts) < 0) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts) < 0) __PYX_ERR(0, 146, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "FCoordsOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts) < 0) __PYX_ERR(0, 146, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts) < 0) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts = &__pyx_type_2yt_8geometry_12oct_visitors_FCoordsOcts; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_FWidthOcts; + __pyx_vtable_2yt_8geometry_12oct_visitors_FWidthOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_FWidthOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_10FWidthOcts_visit; + __pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts) < 0) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts) < 0) __PYX_ERR(0, 164, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "FWidthOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts) < 0) __PYX_ERR(0, 164, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts) < 0) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts = &__pyx_type_2yt_8geometry_12oct_visitors_FWidthOcts; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64 = &__pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayI64; + __pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayI64.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayI64.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_12CopyArrayI64_visit; + __pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "CopyArrayI64", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64 = &__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayI64; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64 = &__pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayF64; + __pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayF64.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_CopyArrayF64.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_12CopyArrayF64_visit; + __pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64) < 0) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64) < 0) __PYX_ERR(0, 61, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "CopyArrayF64", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64) < 0) __PYX_ERR(0, 61, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64) < 0) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64 = &__pyx_type_2yt_8geometry_12oct_visitors_CopyArrayF64; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts = &__pyx_vtable_2yt_8geometry_12oct_visitors_IdentifyOcts; + __pyx_vtable_2yt_8geometry_12oct_visitors_IdentifyOcts.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_IdentifyOcts.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_12IdentifyOcts_visit; + __pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts) < 0) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts) < 0) __PYX_ERR(0, 181, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "IdentifyOcts", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts) < 0) __PYX_ERR(0, 181, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts) < 0) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts = &__pyx_type_2yt_8geometry_12oct_visitors_IdentifyOcts; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd = &__pyx_vtable_2yt_8geometry_12oct_visitors_AssignDomainInd; + __pyx_vtable_2yt_8geometry_12oct_visitors_AssignDomainInd.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_AssignDomainInd.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_15AssignDomainInd_visit; + __pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd) < 0) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd) < 0) __PYX_ERR(0, 192, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "AssignDomainInd", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd) < 0) __PYX_ERR(0, 192, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd) < 0) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd = &__pyx_type_2yt_8geometry_12oct_visitors_AssignDomainInd; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO = &__pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesO; + __pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesO.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesO.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_16FillFileIndicesO_visit; + __pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO) < 0) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO) < 0) __PYX_ERR(0, 200, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "FillFileIndicesO", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO) < 0) __PYX_ERR(0, 200, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO) < 0) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO = &__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesO; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR = &__pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesR; + __pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesR.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_FillFileIndicesR.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_16FillFileIndicesR_visit; + __pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "FillFileIndicesR", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR = &__pyx_type_2yt_8geometry_12oct_visitors_FillFileIndicesR; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain = &__pyx_vtable_2yt_8geometry_12oct_visitors_CountByDomain; + __pyx_vtable_2yt_8geometry_12oct_visitors_CountByDomain.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_CountByDomain.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_13CountByDomain_visit; + __pyx_type_2yt_8geometry_12oct_visitors_CountByDomain.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_CountByDomain) < 0) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_CountByDomain.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_CountByDomain.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain) < 0) __PYX_ERR(0, 226, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "CountByDomain", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_CountByDomain) < 0) __PYX_ERR(0, 226, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_CountByDomain) < 0) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain = &__pyx_type_2yt_8geometry_12oct_visitors_CountByDomain; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = &__pyx_vtable_2yt_8geometry_12oct_visitors_StoreOctree; + __pyx_vtable_2yt_8geometry_12oct_visitors_StoreOctree.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_StoreOctree.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_11StoreOctree_visit; + __pyx_type_2yt_8geometry_12oct_visitors_StoreOctree.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_StoreOctree) < 0) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_StoreOctree.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_StoreOctree.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree) < 0) __PYX_ERR(0, 235, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "StoreOctree", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_StoreOctree) < 0) __PYX_ERR(0, 235, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_StoreOctree) < 0) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree = &__pyx_type_2yt_8geometry_12oct_visitors_StoreOctree; + __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = &__pyx_vtable_2yt_8geometry_12oct_visitors_LoadOctree; + __pyx_vtable_2yt_8geometry_12oct_visitors_LoadOctree.__pyx_base = *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor; + __pyx_vtable_2yt_8geometry_12oct_visitors_LoadOctree.__pyx_base.visit = (void (*)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t))__pyx_f_2yt_8geometry_12oct_visitors_10LoadOctree_visit; + __pyx_type_2yt_8geometry_12oct_visitors_LoadOctree.tp_base = __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor; + if (PyType_Ready(&__pyx_type_2yt_8geometry_12oct_visitors_LoadOctree) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_type_2yt_8geometry_12oct_visitors_LoadOctree.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_12oct_visitors_LoadOctree.tp_dict, __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "LoadOctree", (PyObject *)&__pyx_type_2yt_8geometry_12oct_visitors_LoadOctree) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_12oct_visitors_LoadOctree) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = &__pyx_type_2yt_8geometry_12oct_visitors_LoadOctree; + __pyx_vtabptr_array = &__pyx_vtable_array; + __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + __pyx_type___pyx_array.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) + __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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, 326, __pyx_L1_error) + __pyx_type___pyx_memoryview.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(4, 9, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 861, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 29, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 29, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 67, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 67, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 70, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 70, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType("yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(2, 74, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(2, 74, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = __Pyx_ImportType("yt.utilities.lib.allocation_container", "ObjectPool", sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(5, 26, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(5, 26, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = __Pyx_ImportType("yt.geometry.oct_container", "OctObjectPool", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(6, 55, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(6, 55, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(6, 63, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(6, 63, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(6, 94, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(6, 94, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(6, 102, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(6, 102, __pyx_L1_error) + /*--- Variable import code ---*/ + __pyx_t_1 = __Pyx_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "ORDER_MAX", (void **)&__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*--- Function import code ---*/ + __pyx_t_2 = __Pyx_ImportModule("yt.geometry.grid_visitors"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_2, "check_child_masked", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked, "__pyx_t_5numpy_uint8_t (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "yt/geometry/oct_visitors.pyx":19 + * cimport cython + * cimport numpy + * import numpy # <<<<<<<<<<<<<< + * from yt.utilities.lib.fp_utils cimport * + * from libc.stdlib cimport malloc, free + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_OctVisitor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_1__pyx_unpickle_OctVisitor, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_OctVisitor, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_OctVisitor__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_OctVisitor__set_state(OctVisitor result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_3__pyx_unpickle_CopyArrayI64, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CopyArrayI64, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_CopyArrayF64(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x5d05d98: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_5__pyx_unpickle_CopyArrayF64, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CopyArrayF64, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_CopyArrayF64__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CopyArrayF64__set_state(CopyArrayF64 result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dest = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10]; result.source = __pyx_state[11] + * if hasattr(result, '__dict__'): + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_7__pyx_unpickle_CountTotalOcts, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CountTotalOcts, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_CountTotalCells(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x047358e: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_9__pyx_unpickle_CountTotalCells, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CountTotalCells, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_CountTotalCells__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CountTotalCells__set_state(CountTotalCells result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.nz = __pyx_state[7]; result.oref = __pyx_state[8]; result.pos = __pyx_state[9] + * if hasattr(result, '__dict__'): + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_11__pyx_unpickle_MarkOcts, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_MarkOcts, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_MaskOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x43a044e: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_13__pyx_unpickle_MaskOcts, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_MaskOcts, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_MaskOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_MaskOcts__set_state(MaskOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.ind = __pyx_state[3]; result.index = __pyx_state[4]; result.last = __pyx_state[5]; result.level = __pyx_state[6]; result.mask = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_15__pyx_unpickle_IndexOcts, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_IndexOcts, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_ICoordsOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x04e90da: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_17__pyx_unpickle_ICoordsOcts, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ICoordsOcts, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_ICoordsOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_ICoordsOcts__set_state(ICoordsOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.global_index = __pyx_state[2]; result.icoords = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_19__pyx_unpickle_IResOcts, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_IResOcts, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_FCoordsOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x2db9d3c: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_21__pyx_unpickle_FCoordsOcts, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FCoordsOcts, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_FCoordsOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_FCoordsOcts__set_state(FCoordsOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.fcoords = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_23__pyx_unpickle_FWidthOcts, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FWidthOcts, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_IdentifyOcts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xbe9c5c9: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_25__pyx_unpickle_IdentifyOcts, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_IdentifyOcts, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_IdentifyOcts__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_IdentifyOcts__set_state(IdentifyOcts result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_mask = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_27__pyx_unpickle_AssignDomainInd, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_AssignDomainInd, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_FillFileIndicesO(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x286fa6e: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_29__pyx_unpickle_FillFileIndicesO, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FillFileIndicesO, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_FillFileIndicesO__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_FillFileIndicesO__set_state(FillFileIndicesO result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.cell_inds = __pyx_state[0]; result.dims = __pyx_state[1]; result.domain = __pyx_state[2]; result.file_inds = __pyx_state[3]; result.global_index = __pyx_state[4]; result.ind = __pyx_state[5]; result.index = __pyx_state[6]; result.last = __pyx_state[7]; result.level = __pyx_state[8]; result.levels = __pyx_state[9]; result.nz = __pyx_state[10]; result.oref = __pyx_state[11]; result.pos = __pyx_state[12] + * if hasattr(result, '__dict__'): + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_31__pyx_unpickle_FillFileIndicesR, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FillFileIndicesR, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_CountByDomain(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x5e07de9: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_33__pyx_unpickle_CountByDomain, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CountByDomain, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_CountByDomain__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_CountByDomain__set_state(CountByDomain result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dims = __pyx_state[0]; result.domain = __pyx_state[1]; result.domain_counts = __pyx_state[2]; result.global_index = __pyx_state[3]; result.ind = __pyx_state[4]; result.index = __pyx_state[5]; result.last = __pyx_state[6]; result.level = __pyx_state[7]; result.nz = __pyx_state[8]; result.oref = __pyx_state[9]; result.pos = __pyx_state[10] + * if hasattr(result, '__dict__'): + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_12oct_visitors_35__pyx_unpickle_StoreOctree, NULL, __pyx_n_s_yt_geometry_oct_visitors); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_StoreOctree, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "yt/geometry/oct_visitors.pyx":1 + * """ # <<<<<<<<<<<<<< + * Oct visitor functions + * + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":207 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(1, 207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":282 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":283 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":284 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":287 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":288 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":312 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":313 + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_4[0] = PyThread_allocate_lock(); + __pyx_t_4[1] = PyThread_allocate_lock(); + __pyx_t_4[2] = PyThread_allocate_lock(); + __pyx_t_4[3] = PyThread_allocate_lock(); + __pyx_t_4[4] = PyThread_allocate_lock(); + __pyx_t_4[5] = PyThread_allocate_lock(); + __pyx_t_4[6] = PyThread_allocate_lock(); + __pyx_t_4[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":535 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(1, 535, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":981 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(1, 981, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init yt.geometry.oct_visitors", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init yt.geometry.oct_visitors"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #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 + +/* 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; +} + +/* 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); +} + +/* ArgTypeTest */ +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +/* 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 PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* 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 +} + +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +/* GetModuleGlobalName */ + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +/* BufferFormatCheck */ + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +/* 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; +} +static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + Py_FatalError(msg); + va_end(vargs); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview || (PyObject *) memview == Py_None) + return; + if (__pyx_get_slice_count(memview) < 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (first_time) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview ) { + return; + } else if ((PyObject *) memview == Py_None) { + memslice->memview = NULL; + return; + } + if (__pyx_get_slice_count(memview) <= 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (last_time) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} - /* "View.MemoryView":288 - * - * cdef contiguous = Enum("") - * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XGOTREF(indirect_contiguous); - __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; +/* 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 - /* "View.MemoryView":312 - * - * DEF THREAD_LOCKS_PREALLOCATED = 8 - * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< - * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ - * PyThread_allocate_lock(), - */ - __pyx_memoryview_thread_locks_used = 0; +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} - /* "View.MemoryView":313 - * DEF THREAD_LOCKS_PREALLOCATED = 8 - * cdef int __pyx_memoryview_thread_locks_used = 0 - * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< - * PyThread_allocate_lock(), - * PyThread_allocate_lock(), - */ - __pyx_t_4[0] = PyThread_allocate_lock(); - __pyx_t_4[1] = PyThread_allocate_lock(); - __pyx_t_4[2] = PyThread_allocate_lock(); - __pyx_t_4[3] = PyThread_allocate_lock(); - __pyx_t_4[4] = PyThread_allocate_lock(); - __pyx_t_4[5] = PyThread_allocate_lock(); - __pyx_t_4[6] = PyThread_allocate_lock(); - __pyx_t_4[7] = PyThread_allocate_lock(); - memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); +/* 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; +} - /* "View.MemoryView":535 - * info.obj = self - * - * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(3, 535, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_memoryview_type); +/* 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 - /* "View.MemoryView":981 - * return self.from_object - * - * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(3, 981, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_memoryviewslice_type); +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL +#include "frameobject.h" +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = PyThreadState_GET(); + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: - */ +/* 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 - /*--- Wrapped vars code ---*/ +/* 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 - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init yt.geometry.oct_visitors", __pyx_clineno, __pyx_lineno, __pyx_filename); +/* GetItemInt */ + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init yt.geometry.oct_visitors"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif + 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)); } -/* --- 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; +/* 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; + } } -#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); +/* 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 - "name '%.200s' is not defined", PyString_AS_STRING(name)); + 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; } - return result; -} - -/* 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 +#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; +/* 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; } - 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 +#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 (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++; - } + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } +#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 { - goto invalid_keyword; + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; } - return 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, +return_eq: #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); + Py_XDECREF(owned_ref); #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); + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif } -/* ArgTypeTest */ -static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); +/* RaiseTooManyValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ + +/* 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 (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (likely(Py_TYPE(obj) == type)) return 1; - #if PY_MAJOR_VERSION == 2 - else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(PyObject_TypeCheck(obj, type))) return 1; - } - __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); return 0; } -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } -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 PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); } #endif -/* 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; +/* 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 - __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); + 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; } - #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); + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); #endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; } -/* BufferFormatCheck */ - static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { - unsigned int n = 1; - return *(unsigned char*)(&n) != 0; -} -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type) { - stack[0].field = &ctx->root; - stack[0].parent_offset = 0; - ctx->root.type = type; - ctx->root.name = "buffer dtype"; - ctx->root.offset = 0; - ctx->head = stack; - ctx->head->field = &ctx->root; - ctx->fmt_offset = 0; - ctx->head->parent_offset = 0; - ctx->new_packmode = '@'; - ctx->enc_packmode = '@'; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->is_complex = 0; - ctx->is_valid_array = 0; - ctx->struct_alignment = 0; - while (type->typegroup == 'S') { - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = 0; - type = type->fields->type; - } +/* None */ + static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; } -static 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'; + +/* 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; } - *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; + length = stop - start; + if (unlikely(length <= 0)) + return PyUnicode_FromUnicode(NULL, 0); + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); } } -static 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; - } - } + +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; } -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; +#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 -typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; #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); + 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 - case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; #endif - case '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; + } + 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 -typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; + } 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 -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); + } + 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 - case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; #endif - case '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; + } + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + } -} -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 + 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); } -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); - } +#endif + +/* None */ + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } -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); + +/* 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; +} + +/* 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 */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (ret < 0) goto BAD; + } + PyType_Modified((PyTypeObject*)type_obj); + } } - 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) { + goto GOOD; +BAD: + if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +GOOD: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* GetVTable */ + static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; + use_cline = NULL; } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); } - 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 (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } - 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; - } + else if (PyObject_Not(use_cline) != 0) { + c_line = 0; } - } while (ctx->enc_count); - ctx->enc_type = 0; - ctx->is_complex = 0; - return 0; + return c_line; +#endif } -static CYTHON_INLINE PyObject * -__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) -{ - const char *ts = *tsp; - int i = 0, number; - int ndim = ctx->head->field->type->ndim; -; - ++ts; - if (ctx->new_count != 1) { - PyErr_SetString(PyExc_ValueError, - "Cannot handle repeated arrays in format string"); - return NULL; + +/* 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; } - 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; + 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; } - 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; + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; } - ctx->is_valid_array = 1; - ctx->new_count = 1; - *tsp = ++ts; - return Py_None; } -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { - int got_Z = 0; - while (1) { - switch(*ts) { - case 0: - if (ctx->enc_type != 0 && ctx->head == NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - if (ctx->head != NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - return ts; - case ' ': - case '\r': - case '\n': - ++ts; - break; - case '<': - if (!__Pyx_IsLittleEndian()) { - PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); - return NULL; - } - ctx->new_packmode = '='; - ++ts; - break; - case '>': - case '!': - if (__Pyx_IsLittleEndian()) { - PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); - return NULL; - } - ctx->new_packmode = '='; - ++ts; - break; - case '=': - case '@': - case '^': - ctx->new_packmode = *ts++; - break; - case 'T': - { - const char* ts_after_sub; - size_t i, struct_count = ctx->new_count; - size_t struct_alignment = ctx->struct_alignment; - ctx->new_count = 1; - ++ts; - if (*ts != '{') { - PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_type = 0; - ctx->enc_count = 0; - ctx->struct_alignment = 0; - ++ts; - ts_after_sub = ts; - for (i = 0; i != struct_count; ++i) { - ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); - if (!ts_after_sub) return NULL; - } - ts = ts_after_sub; - if (struct_alignment) ctx->struct_alignment = struct_alignment; - } - break; - case '}': - { - size_t alignment = ctx->struct_alignment; - ++ts; - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_type = 0; - if (alignment && ctx->fmt_offset % alignment) { - ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); - } - } - return ts; - case 'x': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->fmt_offset += ctx->new_count; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->enc_packmode = ctx->new_packmode; - ++ts; - break; - case 'Z': - got_Z = 1; - ++ts; - if (*ts != 'f' && *ts != 'd' && *ts != 'g') { - __Pyx_BufFmt_RaiseUnexpectedChar('Z'); - return NULL; - } - case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': - case 'l': case 'L': case 'q': case 'Q': - case 'f': case 'd': case 'g': - case 'O': case 'p': - if (ctx->enc_type == *ts && got_Z == ctx->is_complex && - ctx->enc_packmode == ctx->new_packmode) { - ctx->enc_count += ctx->new_count; - ctx->new_count = 1; - got_Z = 0; - ++ts; - break; +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); } - 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; + 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); } -static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { - buf->buf = NULL; - buf->obj = NULL; - buf->strides = __Pyx_zeros; - buf->shape = __Pyx_zeros; - buf->suboffsets = __Pyx_minusones; + +/* 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 CYTHON_INLINE int __Pyx_GetBufferAndValidate( - Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, - int nd, int cast, __Pyx_BufFmt_StackElem* stack) -{ - if (obj == Py_None || obj == NULL) { - __Pyx_ZeroBuffer(buf); - return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { - PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - nd, buf->ndim); - goto fail; - } - if (!cast) { - __Pyx_BufFmt_Context ctx; - __Pyx_BufFmt_Init(&ctx, stack, dtype); - if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; - } - if ((unsigned)buf->itemsize != dtype->size) { - PyErr_Format(PyExc_ValueError, - "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", - buf->itemsize, (buf->itemsize > 1) ? "s" : "", - dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); - goto fail; - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + if (c_line) { + c_line = __Pyx_CLineForTraceback(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( + PyThreadState_GET(), /*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); } -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { - if (info->buf == NULL) return; - if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; - __Pyx_ReleaseBuffer(info); + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + Py_DECREF(obj); + view->obj = NULL; } +#endif -/* MemviewSliceInit */ - static int -__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, - int ndim, - __Pyx_memviewslice *memviewslice, - int memview_is_new_reference) + + /* MemviewSliceIsContig */ + static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, + char order, int ndim) { - __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]; - } + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; } else { - Py_ssize_t stride = buf->itemsize; - for (i = ndim - 1; i >= 0; i--) { - memviewslice->strides[i] = stride; - stride *= buf->shape[i]; - } + step = -1; + start = ndim - 1; } for (i = 0; i < ndim; i++) { - memviewslice->shape[i] = buf->shape[i]; - if (buf->suboffsets) { - memviewslice->suboffsets[i] = buf->suboffsets[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 { - memviewslice->suboffsets[i] = -1; + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); } } - memviewslice->memview = memview; - memviewslice->data = (char *)buf->buf; - if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { - Py_INCREF(memview); - } - retval = 0; - goto no_fail; -fail: - memviewslice->memview = 0; - memviewslice->data = 0; - retval = -1; -no_fail: - __Pyx_RefNannyFinishContext(); - return retval; -} -static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { - va_list vargs; - char msg[200]; -#ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, fmt); -#else - va_start(vargs); -#endif - vsnprintf(msg, 200, fmt, vargs); - Py_FatalError(msg); - va_end(vargs); + *out_start = start; + *out_end = end + itemsize; } -static CYTHON_INLINE int -__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, - PyThread_type_lock lock) +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) { - int result; - PyThread_acquire_lock(lock, 1); - result = (*acquisition_count)++; - PyThread_release_lock(lock); - return result; + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); } -static CYTHON_INLINE int -__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, - PyThread_type_lock lock) + +/* Capsule */ + static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { - int result; - PyThread_acquire_lock(lock, 1); - result = (*acquisition_count)--; - PyThread_release_lock(lock); - return result; + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; } -static CYTHON_INLINE 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); + +/* 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); + } } -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; + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ } - if (__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); + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif } } else { - memslice->memview = NULL; + if (sizeof(npy_int32) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int32) <= 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_int32), + little, !is_unsigned); } } -/* 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"); +/* 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); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { + const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(npy_uint64) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= 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_uint64), + little, !is_unsigned); } - return result; -} -#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"); +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int8(npy_int8 value) { + const npy_int8 neg_one = (npy_int8) -1, const_zero = (npy_int8) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int8) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int8) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int8) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(npy_int8) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int8) <= 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_int8), + little, !is_unsigned); + } } -/* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +/* 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; } -/* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); +/* TypeInfoCompare */ + static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) return 0; - } - if (likely(PyObject_TypeCheck(obj, type))) + if (a == b) 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) { - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); + 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; } -#endif -/* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { - PyObject *exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; - return PyErr_GivenExceptionMatches(exc_type, err); +/* 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; } -#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; +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; + } } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif + 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; -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 = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 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 ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); + } 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 { - 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); + 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_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__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, 2, + &__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; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsdsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__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; } -#endif + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 6, + &__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; } -/* 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; +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_float64_t value = __pyx_PyFloat_AsDouble(obj); + if ((value == ((npy_float64)-1)) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_float64_t *) itemp = value; + return 1; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; } - 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); + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_dsdsdsdsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__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, 5, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_npy_uint8(npy_uint8 value) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint8) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); + if (sizeof(npy_uint8) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint8) <= 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_uint8), + little, !is_unsigned); + } +} + +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_uint8(*(__pyx_t_5numpy_uint8_t *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_uint8_t value = __Pyx_PyInt_As_npy_uint8(obj); + if ((value == ((npy_uint8)-1)) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_uint8_t *) itemp = value; + return 1; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__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; } -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 + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 4, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; } -/* 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; +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; } -/* GetAttr */ - static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { -#if CYTHON_COMPILING_IN_CPYTHON -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* Print */ + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} #else - if (likely(PyString_Check(n))) +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} #endif - return __Pyx_PyObject_GetAttrStr(o, n); + +/* 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 - return PyObject_GetAttr(o, n); -} - -/* 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; + } 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 } - 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); + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); } } -/* SwapException */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = *type; - tstate->exc_value = *value; - tstate->exc_traceback = *tb; - *type = tmp_type; - *value = tmp_value; - *tb = tmp_tb; -} +/* 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 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; -} + 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 -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; +/* 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 - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; + 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; } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); + 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); } } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif + 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; } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} +#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 = PyThreadState_GET(); - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; +/* 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); } - fastlocals = f->f_localsplus; - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; + #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; } - 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; + #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; } - 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; + +/* 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 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; + } + #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 (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; + #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 } - 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; + 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 } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 - kwdefs = PyFunction_GET_KW_DEFAULTS(func); + } 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 (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); + } } - else { - d = NULL; - nd = 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); } -#if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, - k, (int)nk, - d, (int)nd, closure); -#endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL -/* PyCFunctionFastCall */ - #if CYTHON_FAST_PYCCALL -static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { - PyCFunctionObject *func = (PyCFunctionObject*)func_obj; - PyCFunction meth = PyCFunction_GET_FUNCTION(func); - PyObject *self = PyCFunction_GET_SELF(func); - assert(PyCFunction_Check(func)); - assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); - assert(nargs >= 0); - assert(nargs == 0 || args != NULL); - /* _PyCFunction_FastCallDict() must not be called with an exception set, - because it may clear it (directly or indirectly) and so the - caller loses its exception */ - assert(!PyErr_Occurred()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); -} -#endif // CYTHON_FAST_PYCCALL - -/* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; +/* 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; } } - 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); + 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; } } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + __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; } -/* 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; +/* 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 - const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #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) { +#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(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 + 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(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 + 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(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 + 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(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 + 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(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 + 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(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 + 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]))); + } } - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + break; } - } - 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; -} - -/* 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 -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { #endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); -#if CYTHON_FAST_PYCCALL - } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { - return __Pyx_PyCFunction_FastCall(func, &arg, 1); + 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 + } } - } - 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 - -/* 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; -} - -/* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { - void* ptr; - PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); - if (!ob) - goto bad; -#if PY_VERSION_HEX >= 0x02070000 - ptr = PyCapsule_GetPointer(ob, 0); + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - ptr = PyCObject_AsVoidPtr(ob); + 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 - if (!ptr && !PyErr_Occurred()) - PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); - Py_DECREF(ob); - return ptr; -bad: - Py_XDECREF(ob); - return NULL; -} - -/* 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; + return (int) -1; } - } - if (code_line <= entries[mid].code_line) { - return mid; } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - 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; + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); 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; - 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); + return val; } - py_frame = PyFrame_New( - PyThreadState_GET(), /*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); +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; } +/* CIntFromPy */ + static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; + const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { - if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); - if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); - if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); - PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); - return -1; -} -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject *obj = view->obj; - if (!obj) return; - if (PyObject_CheckBuffer(obj)) { - PyBuffer_Release(view); - return; - } - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } - Py_DECREF(obj); - view->obj = NULL; -} + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (npy_int32) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0]) + case 2: + if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) { + return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) { + return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) { + return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (npy_int32) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } #endif - - - /* 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; + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (npy_int32) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0]) + case -2: + if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { + return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { + return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { + return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { + return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { + return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { + return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + } + } + break; + } +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } } else { - 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]; + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; } - return 1; +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to npy_int32"); + return (npy_int32) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; } -/* 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; +/* 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 { - if (stride > 0) - end += stride * (extent - 1); - else - start += stride * (extent - 1); + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (npy_int64) val; } - } - *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 +#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 - cobj = PyCObject_FromVoidPtr(p, NULL); + { + 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 - return cobj; -} - -/* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) { - const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(npy_uint8) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); + 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_uint8) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif + } } - } else { - if (sizeof(npy_uint8) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); + { +#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; } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(npy_uint8), - little, !is_unsigned); - } +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; } -/* Print */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 -static PyObject *__Pyx_GetStdout(void) { - PyObject *f = PySys_GetObject((char *)"stdout"); - if (!f) { - PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); - } - return f; -} -static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { - int i; - if (!f) { - if (!(f = __Pyx_GetStdout())) - return -1; - } - Py_INCREF(f); - for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { - PyObject* v; - if (PyFile_SoftSpace(f, 1)) { - if (PyFile_WriteString(" ", f) < 0) - goto error; - } - v = PyTuple_GET_ITEM(arg_tuple, i); - if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) - goto error; - if (PyString_Check(v)) { - char *s = PyString_AsString(v); - Py_ssize_t len = PyString_Size(v); - if (len > 0) { - switch (s[len-1]) { - case ' ': break; - case '\f': case '\r': case '\n': case '\t': case '\v': - PyFile_SoftSpace(f, 0); - break; - default: break; - } +/* CIntFromPy */ + static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint8) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; } + return (npy_uint8) val; } - } - if (newline) { - if (PyFile_WriteString("\n", f) < 0) - goto error; - PyFile_SoftSpace(f, 0); - } - Py_DECREF(f); - return 0; -error: - Py_DECREF(f); - return -1; -} + } 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_uint8) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_uint8, digit, digits[0]) + case 2: + if (8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint8) >= 2 * PyLong_SHIFT) { + return (npy_uint8) (((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint8) >= 3 * PyLong_SHIFT) { + return (npy_uint8) (((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) >= 4 * PyLong_SHIFT) { + return (npy_uint8) (((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } #else -static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { - PyObject* kwargs = 0; - PyObject* result = 0; - PyObject* end_string; - if (unlikely(!__pyx_print)) { - __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); - if (!__pyx_print) - return -1; - } - if (stream) { - kwargs = PyDict_New(); - if (unlikely(!kwargs)) - return -1; - if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) - goto bad; - if (!newline) { - end_string = PyUnicode_FromStringAndSize(" ", 1); - if (unlikely(!end_string)) - goto bad; - if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { - Py_DECREF(end_string); - goto bad; + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (npy_uint8) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, 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_uint8) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_uint8, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_uint8, digit, +digits[0]) + case -2: + if (8 * sizeof(npy_uint8) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint8) (((npy_uint8)-1)*(((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint8) ((((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint8) (((npy_uint8)-1)*(((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint8) ((((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint8) (((npy_uint8)-1)*(((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint8) ((((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); + } + } + break; + } +#endif + if (sizeof(npy_uint8) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } - Py_DECREF(end_string); } - } else if (!newline) { - if (unlikely(!__pyx_print_kwargs)) { - __pyx_print_kwargs = PyDict_New(); - if (unlikely(!__pyx_print_kwargs)) - return -1; - end_string = PyUnicode_FromStringAndSize(" ", 1); - if (unlikely(!end_string)) - return -1; - if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { - Py_DECREF(end_string); - return -1; + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint8 val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); } - Py_DECREF(end_string); + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint8) -1; } - kwargs = __pyx_print_kwargs; - } - result = PyObject_Call(__pyx_print, arg_tuple, kwargs); - if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) - Py_DECREF(kwargs); - if (!result) - return -1; - Py_DECREF(result); - return 0; -bad: - if (kwargs != __pyx_print_kwargs) - Py_XDECREF(kwargs); - return -1; + } else { + npy_uint8 val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_uint8) -1; + val = __Pyx_PyInt_As_npy_uint8(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to npy_uint8"); + return (npy_uint8) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; } -#endif -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { +/* CIntFromPy */ + static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { if (sizeof(npy_uint64) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif + __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (npy_uint64) val; } - } else { - if (sizeof(npy_uint64) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); + } else #endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(npy_uint64), - 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; - } + 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_uint64) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, digits[0]) + case 2: + if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) >= 2 * PyLong_SHIFT) { + return (npy_uint64) (((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) >= 3 * PyLong_SHIFT) { + return (npy_uint64) (((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) >= 4 * PyLong_SHIFT) { + return (npy_uint64) (((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + } + } + break; + } #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); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; } - } 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); - } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (npy_uint64) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; } - 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 + if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, 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_uint64) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_uint64, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, +digits[0]) + case -2: + if (8 * sizeof(npy_uint64) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint64) ((((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint64) ((((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint64) ((((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; } - 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; - } + if (sizeof(npy_uint64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif - -/* Arithmetic */ - #if CYTHON_CCOMPLEX + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #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); + npy_uint64 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); } - } 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); + #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_uint64) -1; } + } else { + npy_uint64 val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_uint64) -1; + val = __Pyx_PyInt_As_npy_uint64(tmp); + Py_DECREF(tmp); + return val; } - #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); +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to npy_uint64"); + return (npy_uint64) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint64"); + return (npy_uint64) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE npy_int8 __Pyx_PyInt_As_npy_int8(PyObject *x) { + const npy_int8 neg_one = (npy_int8) -1, const_zero = (npy_int8) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int8) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int8, long, PyInt_AS_LONG(x)) } else { - 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 + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (npy_int8) val; } - 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); - } + } 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_int8) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int8, digit, digits[0]) + case 2: + if (8 * sizeof(npy_int8) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int8) >= 2 * PyLong_SHIFT) { + return (npy_int8) (((((npy_int8)digits[1]) << PyLong_SHIFT) | (npy_int8)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(npy_int8) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int8) >= 3 * PyLong_SHIFT) { + return (npy_int8) (((((((npy_int8)digits[2]) << PyLong_SHIFT) | (npy_int8)digits[1]) << PyLong_SHIFT) | (npy_int8)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(npy_int8) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int8, 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_int8) >= 4 * PyLong_SHIFT) { + return (npy_int8) (((((((((npy_int8)digits[3]) << PyLong_SHIFT) | (npy_int8)digits[2]) << PyLong_SHIFT) | (npy_int8)digits[1]) << PyLong_SHIFT) | (npy_int8)digits[0])); + } + } + break; } - 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); +#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_int8) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(npy_int8) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int8, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int8) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int8, 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_int8) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_int8, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_int8, digit, +digits[0]) + case -2: + if (8 * sizeof(npy_int8) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int8, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int8) - 1 > 2 * PyLong_SHIFT) { + return (npy_int8) (((npy_int8)-1)*(((((npy_int8)digits[1]) << PyLong_SHIFT) | (npy_int8)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(npy_int8) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int8) - 1 > 2 * PyLong_SHIFT) { + return (npy_int8) ((((((npy_int8)digits[1]) << PyLong_SHIFT) | (npy_int8)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(npy_int8) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int8, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int8) - 1 > 3 * PyLong_SHIFT) { + return (npy_int8) (((npy_int8)-1)*(((((((npy_int8)digits[2]) << PyLong_SHIFT) | (npy_int8)digits[1]) << PyLong_SHIFT) | (npy_int8)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(npy_int8) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int8) - 1 > 3 * PyLong_SHIFT) { + return (npy_int8) ((((((((npy_int8)digits[2]) << PyLong_SHIFT) | (npy_int8)digits[1]) << PyLong_SHIFT) | (npy_int8)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(npy_int8) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int8, 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_int8) - 1 > 4 * PyLong_SHIFT) { + return (npy_int8) (((npy_int8)-1)*(((((((((npy_int8)digits[3]) << PyLong_SHIFT) | (npy_int8)digits[2]) << PyLong_SHIFT) | (npy_int8)digits[1]) << PyLong_SHIFT) | (npy_int8)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(npy_int8) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int8, 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_int8) - 1 > 4 * PyLong_SHIFT) { + return (npy_int8) ((((((((((npy_int8)digits[3]) << PyLong_SHIFT) | (npy_int8)digits[2]) << PyLong_SHIFT) | (npy_int8)digits[1]) << PyLong_SHIFT) | (npy_int8)digits[0]))); + } + } + break; } - 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); + if (sizeof(npy_int8) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int8, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); + } else if (sizeof(npy_int8) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int8, PY_LONG_LONG, PyLong_AsLongLong(x)) #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); + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int8 val; + PyObject *v = __Pyx_PyNumber_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_int8) -1; } } 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; + npy_int8 val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_int8) -1; + val = __Pyx_PyInt_As_npy_int8(tmp); + Py_DECREF(tmp); + return val; } - __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; +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to npy_int8"); + return (npy_int8) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int8"); + return (npy_int8) -1; } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; + 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(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (int) val; + return (long) val; } } else #endif @@ -26282,32 +48009,32 @@ #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 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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; @@ -26321,86 +48048,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (int) -1; + return (long) -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)) + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } 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 (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 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(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -26409,7 +48136,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - int val; + long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -26429,71 +48156,40 @@ return val; } #endif - return (int) -1; + return (long) -1; } } else { - int val; + long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; + "value too large to convert to long"); + return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -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); - } + "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; + 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(char) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(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 (char) val; + return (size_t) val; } } else #endif @@ -26502,32 +48198,32 @@ #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 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(size_t) > 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])); + __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(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(size_t) > 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])); + __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(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(size_t) > 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])); + __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; @@ -26541,86 +48237,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (char) -1; + return (size_t) -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)) + 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(char) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } 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 (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 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(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(size_t) - 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]))); + __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(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(size_t) > 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]))); + __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(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(size_t) - 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]))); + __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(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(size_t) > 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]))); + __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(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(size_t) - 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]))); + __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(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(size_t) > 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]))); + __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(char) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, 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)) + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -26629,7 +48325,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - char val; + size_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -26649,40 +48345,40 @@ return val; } #endif - return (char) -1; + return (size_t) -1; } } else { - char val; + size_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (char) -1; - val = __Pyx_PyInt_As_char(tmp); + 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 char"); - return (char) -1; + "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 char"); - return (char) -1; + "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; + static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = (char) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (long) val; + return (char) val; } } else #endif @@ -26691,32 +48387,32 @@ #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 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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; @@ -26730,86 +48426,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (long) -1; + return (char) -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)) + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, 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)) + } 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 (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 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(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, 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)) + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -26818,7 +48514,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - long val; + char val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -26838,24 +48534,24 @@ return val; } #endif - return (long) -1; + return (char) -1; } } else { - long val; + char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; + "value too large to convert to char"); + return (char) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; + "can't convert negative value to char"); + return (char) -1; } /* CheckBinaryVersion */ @@ -27086,6 +48782,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -27094,11 +48792,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/geometry/oct_visitors.pxd yt-3.4.0/yt/geometry/oct_visitors.pxd --- yt-3.3.3/yt/geometry/oct_visitors.pxd 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/oct_visitors.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -117,8 +117,8 @@ cdef class LoadOctree(OctVisitor): cdef np.uint8_t[:] ref_mask cdef Oct* octs - cdef np.int64_t *nocts - cdef np.int64_t *nfinest + cdef np.uint64_t *nocts + cdef np.uint64_t *nfinest cdef inline int cind(int i, int j, int k): # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. diff -Nru yt-3.3.3/yt/geometry/particle_deposit.c yt-3.4.0/yt/geometry/particle_deposit.c --- yt-3.3.3/yt/geometry/particle_deposit.c 2016-12-12 01:41:28.000000000 +0000 +++ yt-3.4.0/yt/geometry/particle_deposit.c 2017-08-10 18:20:14.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -12,6 +12,10 @@ ], "libraries": [ "m" + ], + "name": "yt.geometry.particle_deposit", + "sources": [ + "yt/geometry/particle_deposit.pyx" ] }, "module_name": "yt.geometry.particle_deposit" @@ -25,7 +29,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -47,6 +51,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -199,16 +204,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -335,6 +344,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -389,6 +404,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -501,8 +545,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -515,8 +559,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -638,10 +685,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -676,14 +725,15 @@ static const char *__pyx_f[] = { "yt/geometry/particle_deposit.pxd", "yt/geometry/particle_deposit.pyx", - "array.pxd", - "__init__.pxd", - "yt/geometry/selection_routines.pxd", "stringsource", + "yt/geometry/selection_routines.pxd", + "__init__.pxd", + "array.pxd", "type.pxd", "bool.pxd", "complex.pxd", "yt/geometry/oct_visitors.pxd", + "yt/utilities/lib/allocation_container.pxd", "yt/geometry/oct_container.pxd", }; /* BufferFormatStructs.proto */ @@ -1022,6 +1072,9 @@ struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject; struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector; +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool; +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool; struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer; @@ -1146,7 +1199,7 @@ __pyx_t_5numpy_float64_t right_edge_x; __pyx_t_5numpy_float64_t right_edge_y; __pyx_t_5numpy_float64_t right_edge_z; - __pyx_t_5numpy_int64_t children_pointers; + __pyx_t_5numpy_int_t children_pointers; __pyx_t_5numpy_int64_t start_index_x; __pyx_t_5numpy_int64_t start_index_y; __pyx_t_5numpy_int64_t start_index_z; @@ -1188,7 +1241,7 @@ struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid; struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells; -/* "selection_routines.pxd":42 +/* "selection_routines.pxd":38 * cdef np.int64_t _hash * * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -1200,7 +1253,7 @@ int visit_covered; }; -/* "selection_routines.pxd":50 +/* "selection_routines.pxd":46 * np.float64_t spos[3], np.float64_t sdds[3], * OctVisitor visitor, int i, int j, int k) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1212,7 +1265,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "selection_routines.pxd":65 +/* "selection_routines.pxd":61 * np.ndarray[np.uint8_t, ndim=3] mask, * int level) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -1223,14 +1276,43 @@ int __pyx_n; __pyx_t_5numpy_uint8_t *cached_mask; }; +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer; +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs; + +/* "yt/utilities/lib/allocation_container.pxd":19 + * from libc.stdlib cimport malloc, free, realloc + * + * cdef struct AllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + void *my_objs; +}; + +/* "yt/utilities/lib/allocation_container.pxd":30 + * cdef np.uint64_t n_con + * cdef AllocationContainer* containers + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except * # <<<<<<<<<<<<<< + * cdef void setup_objs(self, void *obj, np.uint64_t count, + * np.uint64_t offset, np.int64_t con_id) + */ +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs { + int __pyx_n; + __pyx_t_5numpy_int64_t con_id; +}; struct __pyx_t_2yt_8geometry_13oct_container_OctKey; struct __pyx_t_2yt_8geometry_13oct_container_OctInfo; -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_t_2yt_8geometry_13oct_container_OctList; +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs; -/* "oct_container.pxd":28 +/* "oct_container.pxd":30 * cdef int ORDER_MAX * * cdef struct OctKey: # <<<<<<<<<<<<<< @@ -1242,7 +1324,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node; }; -/* "oct_container.pxd":32 +/* "oct_container.pxd":34 * Oct *node * * cdef struct OctInfo: # <<<<<<<<<<<<<< @@ -1256,25 +1338,9 @@ __pyx_t_5numpy_int32_t level; }; -/* "oct_container.pxd":38 +/* "oct_container.pxd":40 * np.int32_t level * - * cdef struct OctAllocationContainer # <<<<<<<<<<<<<< - * cdef struct OctAllocationContainer: - * np.int64_t n - */ -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { - __pyx_t_5numpy_int64_t n; - __pyx_t_5numpy_int64_t n_assigned; - __pyx_t_5numpy_int64_t offset; - __pyx_t_5numpy_int64_t con_id; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *next; - struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_octs; -}; - -/* "oct_container.pxd":47 - * Oct *my_octs - * * cdef struct OctList # <<<<<<<<<<<<<< * * cdef struct OctList: @@ -1284,7 +1350,22 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "oct_container.pxd":69 +/* "oct_container.pxd":48 + * # NOTE: This object *has* to be the same size as the AllocationContainer + * # object. There's an assert in the __cinit__ function. + * cdef struct OctAllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs; +}; + +/* "oct_container.pxd":74 * cdef public np.int64_t nocts * cdef public int num_domains * cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?, # <<<<<<<<<<<<<< @@ -1297,8 +1378,8 @@ int max_level; }; -/* "oct_container.pxd":78 - * # OctAllocationContainer.offset if such a thing exists. +/* "oct_container.pxd":83 + * # AllocationContainer.offset if such a thing exists. * cdef np.int64_t get_domain_offset(self, int domain_id) * cdef void visit_all_octs(self, # <<<<<<<<<<<<<< * selection_routines.SelectorObject selector, @@ -1576,12 +1657,12 @@ struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base; __Pyx_memviewslice ref_mask; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs; - __pyx_t_5numpy_int64_t *nocts; - __pyx_t_5numpy_int64_t *nfinest; + __pyx_t_5numpy_uint64_t *nocts; + __pyx_t_5numpy_uint64_t *nfinest; }; -/* "selection_routines.pxd":33 +/* "selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1601,7 +1682,7 @@ }; -/* "selection_routines.pxd":71 +/* "selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1613,7 +1694,7 @@ }; -/* "selection_routines.pxd":74 +/* "selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1627,18 +1708,59 @@ }; -/* "oct_container.pxd":57 +/* "selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2; +}; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool { + PyObject_HEAD + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab; + __pyx_t_5numpy_uint64_t itemsize; + __pyx_t_5numpy_uint64_t n_con; + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers; +}; + + +/* "oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; +}; + + +/* "oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer { PyObject_HEAD struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *cont; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer **domains; + struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh; int partial_coverage; int level_offset; @@ -1652,7 +1774,7 @@ }; -/* "oct_container.pxd":89 +/* "oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -1668,7 +1790,7 @@ }; -/* "oct_container.pxd":97 +/* "oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -1696,7 +1818,7 @@ }; -/* "yt/geometry/particle_deposit.pyx":147 +/* "yt/geometry/particle_deposit.pyx":155 * raise NotImplementedError * * cdef class CountParticles(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -1709,7 +1831,7 @@ }; -/* "yt/geometry/particle_deposit.pyx":177 +/* "yt/geometry/particle_deposit.pyx":186 * deposit_count = CountParticles * * cdef class SimpleSmooth(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -1723,7 +1845,7 @@ }; -/* "yt/geometry/particle_deposit.pyx":242 +/* "yt/geometry/particle_deposit.pyx":252 * deposit_simple_smooth = SimpleSmooth * * cdef class SumParticleField(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -1736,7 +1858,7 @@ }; -/* "yt/geometry/particle_deposit.pyx":271 +/* "yt/geometry/particle_deposit.pyx":281 * deposit_sum = SumParticleField * * cdef class StdParticleField(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -1751,7 +1873,7 @@ }; -/* "yt/geometry/particle_deposit.pyx":328 +/* "yt/geometry/particle_deposit.pyx":339 * deposit_std = StdParticleField * * cdef class CICDeposit(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -1765,7 +1887,7 @@ }; -/* "yt/geometry/particle_deposit.pyx":381 +/* "yt/geometry/particle_deposit.pyx":394 * deposit_cic = CICDeposit * * cdef class WeightedMeanParticleField(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -1779,7 +1901,7 @@ }; -/* "yt/geometry/particle_deposit.pyx":417 +/* "yt/geometry/particle_deposit.pyx":431 * deposit_weighted_mean = WeightedMeanParticleField * * cdef class MeshIdentifier(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -1791,7 +1913,7 @@ }; -/* "yt/geometry/particle_deposit.pyx":440 +/* "yt/geometry/particle_deposit.pyx":455 * deposit_mesh_id = MeshIdentifier * * cdef class NNParticleField(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -1805,7 +1927,7 @@ }; -/* "yt/geometry/particle_deposit.pyx":331 +/* "yt/geometry/particle_deposit.pyx":342 * cdef np.float64_t[:,:,:,:] field * cdef public object ofield * def initialize(self): # <<<<<<<<<<<<<< @@ -1818,7 +1940,7 @@ }; -/* "yt/geometry/particle_deposit.pyx":332 +/* "yt/geometry/particle_deposit.pyx":343 * cdef public object ofield * def initialize(self): * if not all(_ > 1 for _ in self.nvals): # <<<<<<<<<<<<<< @@ -2200,7 +2322,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree; -/* "selection_routines.pxd":33 +/* "selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -2223,7 +2345,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; -/* "selection_routines.pxd":71 +/* "selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2237,7 +2359,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; -/* "selection_routines.pxd":74 +/* "selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2251,12 +2373,58 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; -/* "oct_container.pxd":57 +/* "selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool { + void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args); + void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); + void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + + +/* "oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ + +struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); +}; +static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool; +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); + + +/* "oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer { @@ -2273,7 +2441,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer; -/* "oct_container.pxd":89 +/* "oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -2289,7 +2457,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer; -/* "oct_container.pxd":97 +/* "oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -2312,12 +2480,12 @@ */ struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation { - void (*process)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t); + int (*process)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t); }; static struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation; -/* "yt/geometry/particle_deposit.pyx":147 +/* "yt/geometry/particle_deposit.pyx":155 * raise NotImplementedError * * cdef class CountParticles(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -2331,7 +2499,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_CountParticles *__pyx_vtabptr_2yt_8geometry_16particle_deposit_CountParticles; -/* "yt/geometry/particle_deposit.pyx":177 +/* "yt/geometry/particle_deposit.pyx":186 * deposit_count = CountParticles * * cdef class SimpleSmooth(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -2345,7 +2513,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_SimpleSmooth *__pyx_vtabptr_2yt_8geometry_16particle_deposit_SimpleSmooth; -/* "yt/geometry/particle_deposit.pyx":242 +/* "yt/geometry/particle_deposit.pyx":252 * deposit_simple_smooth = SimpleSmooth * * cdef class SumParticleField(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -2359,7 +2527,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_SumParticleField *__pyx_vtabptr_2yt_8geometry_16particle_deposit_SumParticleField; -/* "yt/geometry/particle_deposit.pyx":271 +/* "yt/geometry/particle_deposit.pyx":281 * deposit_sum = SumParticleField * * cdef class StdParticleField(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -2373,7 +2541,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_StdParticleField *__pyx_vtabptr_2yt_8geometry_16particle_deposit_StdParticleField; -/* "yt/geometry/particle_deposit.pyx":328 +/* "yt/geometry/particle_deposit.pyx":339 * deposit_std = StdParticleField * * cdef class CICDeposit(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -2387,7 +2555,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_CICDeposit *__pyx_vtabptr_2yt_8geometry_16particle_deposit_CICDeposit; -/* "yt/geometry/particle_deposit.pyx":381 +/* "yt/geometry/particle_deposit.pyx":394 * deposit_cic = CICDeposit * * cdef class WeightedMeanParticleField(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -2401,7 +2569,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *__pyx_vtabptr_2yt_8geometry_16particle_deposit_WeightedMeanParticleField; -/* "yt/geometry/particle_deposit.pyx":417 +/* "yt/geometry/particle_deposit.pyx":431 * deposit_weighted_mean = WeightedMeanParticleField * * cdef class MeshIdentifier(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -2415,7 +2583,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_MeshIdentifier *__pyx_vtabptr_2yt_8geometry_16particle_deposit_MeshIdentifier; -/* "yt/geometry/particle_deposit.pyx":440 +/* "yt/geometry/particle_deposit.pyx":455 * deposit_mesh_id = MeshIdentifier * * cdef class NNParticleField(ParticleDepositOperation): # <<<<<<<<<<<<<< @@ -2650,7 +2818,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); @@ -2714,11 +2882,6 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); -/* WriteUnraisableException.proto */ -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename, - int full_traceback, int nogil); - /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); @@ -2742,6 +2905,30 @@ /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* 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 + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { @@ -2799,22 +2986,6 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #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 - /* None.proto */ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); @@ -2824,6 +2995,20 @@ 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*/ +/* 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, @@ -2899,15 +3084,28 @@ #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() + /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -2992,6 +3190,10 @@ char *as_chars; unsigned long *as_ulongs; long *as_longs; +#if PY_MAJOR_VERSION >= 3 + unsigned long long *as_ulonglongs; + long long *as_longlongs; +#endif short *as_shorts; unsigned short *as_ushorts; Py_UNICODE *as_pyunicodes; @@ -3208,15 +3410,15 @@ /* CIntFromPy.proto */ static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(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 *); -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - /* TypeInfoCompare.proto */ static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); @@ -3319,15 +3521,16 @@ /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); -static void __pyx_f_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_ppos, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ -static void __pyx_f_2yt_8geometry_16particle_deposit_14CountParticles_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ -static void __pyx_f_2yt_8geometry_16particle_deposit_12SimpleSmooth_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ -static void __pyx_f_2yt_8geometry_16particle_deposit_16SumParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ -static void __pyx_f_2yt_8geometry_16particle_deposit_16StdParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ -static void __pyx_f_2yt_8geometry_16particle_deposit_10CICDeposit_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ -static void __pyx_f_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ -static void __pyx_f_2yt_8geometry_16particle_deposit_14MeshIdentifier_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_MeshIdentifier *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ -static void __pyx_f_2yt_8geometry_16particle_deposit_15NNParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ +static int __pyx_f_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_ppos, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ +static int __pyx_f_2yt_8geometry_16particle_deposit_14CountParticles_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ +static int __pyx_f_2yt_8geometry_16particle_deposit_12SimpleSmooth_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ +static int __pyx_f_2yt_8geometry_16particle_deposit_16SumParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ +static int __pyx_f_2yt_8geometry_16particle_deposit_16StdParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ +static int __pyx_f_2yt_8geometry_16particle_deposit_10CICDeposit_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ +static int __pyx_f_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ +static int __pyx_f_2yt_8geometry_16particle_deposit_14MeshIdentifier_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_MeshIdentifier *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ +static int __pyx_f_2yt_8geometry_16particle_deposit_15NNParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind); /* proto*/ +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ @@ -3445,7 +3648,7 @@ /* Module declarations from 'yt.utilities.lib.fp_utils' */ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ /* Module declarations from 'yt.geometry.oct_visitors' */ @@ -3477,8 +3680,13 @@ static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0; + +/* Module declarations from 'yt.utilities.lib.allocation_container' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0; /* Module declarations from 'yt.geometry.oct_container' */ +static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0; @@ -3555,6 +3763,7 @@ 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_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; #define __Pyx_MODULE_NAME "yt.geometry.particle_deposit" @@ -3563,13 +3772,13 @@ /* Implementation of 'yt.geometry.particle_deposit' */ static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_Ellipsis; -static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_F[] = "F"; @@ -3580,9 +3789,11 @@ static const char __pyx_k_pi[] = "pi"; static const char __pyx_k_dds[] = "dds"; static const char __pyx_k_inf[] = "inf"; +static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_gobj[] = "gobj"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; @@ -3622,8 +3833,11 @@ static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_octree[] = "octree"; +static const char __pyx_k_pickle[] = "pickle"; +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_asarray[] = "asarray"; static const char __pyx_k_dom_ind[] = "dom_ind"; static const char __pyx_k_float64[] = "float64"; @@ -3635,10 +3849,13 @@ static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_LeftEdge[] = "LeftEdge"; static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_RightEdge[] = "RightEdge"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_domain_id[] = "domain_id"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_positions[] = "positions"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_wendland2[] = "wendland2"; static const char __pyx_k_wendland4[] = "wendland4"; static const char __pyx_k_wendland6[] = "wendland6"; @@ -3647,6 +3864,7 @@ 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_code_length[] = "code_length"; static const char __pyx_k_deposit_cic[] = "deposit_cic"; static const char __pyx_k_deposit_std[] = "deposit_std"; @@ -3654,15 +3872,22 @@ static const char __pyx_k_kernel_name[] = "kernel_name"; static const char __pyx_k_OnceIndirect[] = "OnceIndirect"; 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_deposit_count[] = "deposit_count"; static const char __pyx_k_domain_offset[] = "domain_offset"; 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_deposit_mesh_id[] = "deposit_mesh_id"; static const char __pyx_k_deposit_nearest[] = "deposit_nearest"; static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_ActiveDimensions[] = "ActiveDimensions"; static const char __pyx_k_convert_to_units[] = "convert_to_units"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_strided_and_indirect[] = ""; @@ -3683,7 +3908,7 @@ static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static const char __pyx_k_Particle_Deposition_onto_Cells[] = "\nParticle Deposition onto Cells\n\n\n\n\n"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; -static const char __pyx_k_CIC_requires_minimum_of_2_zones[] = "CIC requires minimum of 2 zones in all dimensions"; +static const char __pyx_k_CIC_requires_minimum_of_2_zones[] = "CIC requires minimum of 2 zones in all spatial dimensions"; 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_yt_utilities_lib_misc_utilities[] = "yt.utilities.lib.misc_utilities"; @@ -3691,6 +3916,7 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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"; @@ -3698,7 +3924,9 @@ 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_sph_kernel_cannot_be_conver[] = "self.sph_kernel 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_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_n_s_ASCII; @@ -3713,6 +3941,7 @@ 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; @@ -3726,10 +3955,13 @@ static PyObject *__pyx_n_b_O; static PyObject *__pyx_n_s_OnceIndirect; static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_n_s_PickleError; +static PyObject *__pyx_n_s_RightEdge; 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_YTBoundsDefinitionError; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_args; @@ -3739,6 +3971,7 @@ 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_n_s_close; static PyObject *__pyx_n_s_code_length; static PyObject *__pyx_kp_s_contiguous_and_direct; @@ -3754,6 +3987,7 @@ static PyObject *__pyx_n_s_deposit_std; static PyObject *__pyx_n_s_deposit_sum; static PyObject *__pyx_n_s_deposit_weighted_mean; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dom_ind; static PyObject *__pyx_n_s_domain_id; static PyObject *__pyx_n_s_domain_offset; @@ -3788,6 +4022,8 @@ 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; @@ -3799,13 +4035,22 @@ static PyObject *__pyx_n_s_order; static PyObject *__pyx_n_s_pack; static PyObject *__pyx_n_s_pi; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_positions; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_quartic; static PyObject *__pyx_n_s_quintic; static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_kp_s_self_sph_kernel_cannot_be_conver; static PyObject *__pyx_n_s_send; +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; @@ -3815,6 +4060,7 @@ 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_throw; @@ -3823,6 +4069,7 @@ static PyObject *__pyx_n_s_units; 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_view; static PyObject *__pyx_n_s_wendland2; static PyObject *__pyx_n_s_wendland4; @@ -3841,30 +4088,48 @@ static int __pyx_pf_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_5nvals_4__del__(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_13update_values___get__(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_13update_values_2__set__(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_14CountParticles_initialize(struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_14CountParticles_2finalize(struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_14CountParticles_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_14CountParticles_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_12SimpleSmooth_initialize(struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_12SimpleSmooth_2finalize(struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_12SimpleSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_12SimpleSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_16SumParticleField_initialize(struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_16SumParticleField_2finalize(struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_16SumParticleField_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_16SumParticleField_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_16StdParticleField_initialize(struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_16StdParticleField_2finalize(struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_16StdParticleField_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_16StdParticleField_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_10CICDeposit_10initialize_genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_10CICDeposit_initialize(struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_10CICDeposit_2finalize(struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_10CICDeposit_6ofield___get__(struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_16particle_deposit_10CICDeposit_6ofield_2__set__(struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_8geometry_16particle_deposit_10CICDeposit_6ofield_4__del__(struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_10CICDeposit_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_10CICDeposit_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_initialize(struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_2finalize(struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_14MeshIdentifier_initialize(struct __pyx_obj_2yt_8geometry_16particle_deposit_MeshIdentifier *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_14MeshIdentifier_2finalize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_MeshIdentifier *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_14MeshIdentifier_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_MeshIdentifier *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_14MeshIdentifier_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_MeshIdentifier *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_15NNParticleField_initialize(struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_15NNParticleField_2finalize(struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *__pyx_v_self); /* proto */ -static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */ -static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_15NNParticleField_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_15NNParticleField_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *__pyx_v_self, CYTHON_UNUSED 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_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */ +static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__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 */ @@ -3872,8 +4137,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -3895,8 +4164,13 @@ 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_2yt_8geometry_16particle_deposit_ParticleDepositOperation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_16particle_deposit_CountParticles(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_16particle_deposit_SimpleSmooth(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3915,6 +4189,7 @@ static PyObject *__pyx_float_0_0; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; +static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; @@ -3925,9 +4200,9 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__22; -static PyObject *__pyx_slice__23; -static PyObject *__pyx_slice__24; +static PyObject *__pyx_slice__44; +static PyObject *__pyx_slice__45; +static PyObject *__pyx_slice__46; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -3940,12 +4215,38 @@ static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_codeobj__56; /* "yt/geometry/particle_deposit.pyx":31 * from yt.utilities.lib.misc_utilities import OnceIndirect @@ -4113,7 +4414,9 @@ 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; } @@ -4122,6 +4425,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nvals)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel_name)) != 0)) kw_args--; else { @@ -4364,11 +4668,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -4377,26 +4687,31 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_octree)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dom_ind)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("process_octree", 0, 3, 6, 1); __PYX_ERR(1, 53, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("process_octree", 0, 3, 6, 2); __PYX_ERR(1, 53, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); if (value) { values[4] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_offset); @@ -4409,8 +4724,11 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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); @@ -4848,7 +5166,7 @@ * offset, pos, field_vals, oct.domain_ind) * if self.update_values == 1: */ - ((struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *)__pyx_v_self->__pyx_vtab)->process(__pyx_v_self, __pyx_v_dims, __pyx_v_oi.left_edge, __pyx_v_oi.dds, __pyx_v_offset, __pyx_v_pos, __pyx_v_field_vals, __pyx_v_oct->domain_ind); + __pyx_t_13 = ((struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *)__pyx_v_self->__pyx_vtab)->process(__pyx_v_self, __pyx_v_dims, __pyx_v_oi.left_edge, __pyx_v_oi.dds, __pyx_v_offset, __pyx_v_pos, __pyx_v_field_vals, __pyx_v_oct->domain_ind); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(1, 103, __pyx_L1_error) /* "yt/geometry/particle_deposit.pyx":105 * self.process(dims, oi.left_edge, oi.dds, @@ -5002,8 +5320,11 @@ 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; } @@ -5012,11 +5333,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gobj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("process_grid", 0, 2, 3, 1); __PYX_ERR(1, 111, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields); @@ -5029,6 +5352,7 @@ } 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; @@ -5077,7 +5401,9 @@ __pyx_t_5numpy_int64_t __pyx_v_gid; __pyx_t_5numpy_float64_t __pyx_v_dds[3]; __pyx_t_5numpy_float64_t __pyx_v_left_edge[3]; + __pyx_t_5numpy_float64_t __pyx_v_right_edge[3]; int __pyx_v_dims[3]; + int __pyx_v_continue_loop; __Pyx_LocalBuf_ND __pyx_pybuffernd_positions; __Pyx_Buffer __pyx_pybuffer_positions; PyObject *__pyx_r = NULL; @@ -5269,8 +5595,8 @@ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_gid = __pyx_t_10; - /* "yt/geometry/particle_deposit.pyx":126 - * cdef np.float64_t left_edge[3] + /* "yt/geometry/particle_deposit.pyx":127 + * cdef np.float64_t right_edge[3] * cdef int dims[3] * for i in range(3): # <<<<<<<<<<<<<< * dds[i] = gobj.dds[i] @@ -5279,57 +5605,73 @@ for (__pyx_t_11 = 0; __pyx_t_11 < 3; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "yt/geometry/particle_deposit.pyx":127 + /* "yt/geometry/particle_deposit.pyx":128 * cdef int dims[3] * for i in range(3): * dds[i] = gobj.dds[i] # <<<<<<<<<<<<<< * left_edge[i] = gobj.LeftEdge[i] - * dims[i] = gobj.ActiveDimensions[i] + * right_edge[i] = gobj.RightEdge[i] */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 127, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 127, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 127, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_dds[__pyx_v_i]) = __pyx_t_12; - /* "yt/geometry/particle_deposit.pyx":128 + /* "yt/geometry/particle_deposit.pyx":129 * for i in range(3): * dds[i] = gobj.dds[i] * left_edge[i] = gobj.LeftEdge[i] # <<<<<<<<<<<<<< + * right_edge[i] = gobj.RightEdge[i] * dims[i] = gobj.ActiveDimensions[i] - * for i in range(positions.shape[0]): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 128, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 128, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 128, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; (__pyx_v_left_edge[__pyx_v_i]) = __pyx_t_12; - /* "yt/geometry/particle_deposit.pyx":129 + /* "yt/geometry/particle_deposit.pyx":130 * dds[i] = gobj.dds[i] * left_edge[i] = gobj.LeftEdge[i] - * dims[i] = gobj.ActiveDimensions[i] # <<<<<<<<<<<<<< + * right_edge[i] = gobj.RightEdge[i] # <<<<<<<<<<<<<< + * dims[i] = gobj.ActiveDimensions[i] * for i in range(positions.shape[0]): - * # Now we process */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 129, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 129, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 129, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 130, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + (__pyx_v_right_edge[__pyx_v_i]) = __pyx_t_12; + + /* "yt/geometry/particle_deposit.pyx":131 + * left_edge[i] = gobj.LeftEdge[i] + * right_edge[i] = gobj.RightEdge[i] + * dims[i] = gobj.ActiveDimensions[i] # <<<<<<<<<<<<<< + * for i in range(positions.shape[0]): + * # Now we process + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; (__pyx_v_dims[__pyx_v_i]) = __pyx_t_13; } - /* "yt/geometry/particle_deposit.pyx":130 - * left_edge[i] = gobj.LeftEdge[i] + /* "yt/geometry/particle_deposit.pyx":132 + * right_edge[i] = gobj.RightEdge[i] * dims[i] = gobj.ActiveDimensions[i] * for i in range(positions.shape[0]): # <<<<<<<<<<<<<< * # Now we process @@ -5339,7 +5681,7 @@ for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_14; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "yt/geometry/particle_deposit.pyx":132 + /* "yt/geometry/particle_deposit.pyx":134 * for i in range(positions.shape[0]): * # Now we process * for j in range(nf): # <<<<<<<<<<<<<< @@ -5350,53 +5692,137 @@ for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_13; __pyx_t_15+=1) { __pyx_v_j = __pyx_t_15; - /* "yt/geometry/particle_deposit.pyx":133 + /* "yt/geometry/particle_deposit.pyx":135 * # Now we process * for j in range(nf): * field_vals[j] = field_pointers[j,i] # <<<<<<<<<<<<<< * for j in range(3): * pos[j] = positions[i, j] */ - if (unlikely(!__pyx_v_field_pointers.memview)) { __Pyx_RaiseUnboundLocalError("field_pointers"); __PYX_ERR(1, 133, __pyx_L1_error) } + if (unlikely(!__pyx_v_field_pointers.memview)) { __Pyx_RaiseUnboundLocalError("field_pointers"); __PYX_ERR(1, 135, __pyx_L1_error) } __pyx_t_16 = __pyx_v_j; __pyx_t_17 = __pyx_v_i; __pyx_t_18 = __pyx_v_j; *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_field_vals.data + __pyx_t_18 * __pyx_v_field_vals.strides[0]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (*((char **) (__pyx_v_field_pointers.data + __pyx_t_16 * __pyx_v_field_pointers.strides[0])) + __pyx_v_field_pointers.suboffsets[0]) )) + __pyx_t_17)) ))); } - /* "yt/geometry/particle_deposit.pyx":134 + /* "yt/geometry/particle_deposit.pyx":136 * for j in range(nf): * field_vals[j] = field_pointers[j,i] * for j in range(3): # <<<<<<<<<<<<<< * pos[j] = positions[i, j] - * self.process(dims, left_edge, dds, 0, pos, field_vals, gid) + * continue_loop = False */ for (__pyx_t_13 = 0; __pyx_t_13 < 3; __pyx_t_13+=1) { __pyx_v_j = __pyx_t_13; - /* "yt/geometry/particle_deposit.pyx":135 + /* "yt/geometry/particle_deposit.pyx":137 * field_vals[j] = field_pointers[j,i] * for j in range(3): * pos[j] = positions[i, j] # <<<<<<<<<<<<<< - * self.process(dims, left_edge, dds, 0, pos, field_vals, gid) - * if self.update_values == 1: + * continue_loop = False + * for j in range(3): */ __pyx_t_19 = __pyx_v_i; __pyx_t_20 = __pyx_v_j; (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_positions.diminfo[1].strides)); } - /* "yt/geometry/particle_deposit.pyx":136 + /* "yt/geometry/particle_deposit.pyx":138 + * for j in range(3): + * pos[j] = positions[i, j] + * continue_loop = False # <<<<<<<<<<<<<< * for j in range(3): + * if pos[j] < left_edge[j] or pos[j] > right_edge[j]: + */ + __pyx_v_continue_loop = 0; + + /* "yt/geometry/particle_deposit.pyx":139 * pos[j] = positions[i, j] + * continue_loop = False + * for j in range(3): # <<<<<<<<<<<<<< + * if pos[j] < left_edge[j] or pos[j] > right_edge[j]: + * continue_loop = True + */ + for (__pyx_t_13 = 0; __pyx_t_13 < 3; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "yt/geometry/particle_deposit.pyx":140 + * continue_loop = False + * for j in range(3): + * if pos[j] < left_edge[j] or pos[j] > right_edge[j]: # <<<<<<<<<<<<<< + * continue_loop = True + * if continue_loop: + */ + __pyx_t_1 = (((__pyx_v_pos[__pyx_v_j]) < (__pyx_v_left_edge[__pyx_v_j])) != 0); + if (!__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_1 = (((__pyx_v_pos[__pyx_v_j]) > (__pyx_v_right_edge[__pyx_v_j])) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L16_bool_binop_done:; + if (__pyx_t_2) { + + /* "yt/geometry/particle_deposit.pyx":141 + * for j in range(3): + * if pos[j] < left_edge[j] or pos[j] > right_edge[j]: + * continue_loop = True # <<<<<<<<<<<<<< + * if continue_loop: + * continue + */ + __pyx_v_continue_loop = 1; + + /* "yt/geometry/particle_deposit.pyx":140 + * continue_loop = False + * for j in range(3): + * if pos[j] < left_edge[j] or pos[j] > right_edge[j]: # <<<<<<<<<<<<<< + * continue_loop = True + * if continue_loop: + */ + } + } + + /* "yt/geometry/particle_deposit.pyx":142 + * if pos[j] < left_edge[j] or pos[j] > right_edge[j]: + * continue_loop = True + * if continue_loop: # <<<<<<<<<<<<<< + * continue + * self.process(dims, left_edge, dds, 0, pos, field_vals, gid) + */ + __pyx_t_2 = (__pyx_v_continue_loop != 0); + if (__pyx_t_2) { + + /* "yt/geometry/particle_deposit.pyx":143 + * continue_loop = True + * if continue_loop: + * continue # <<<<<<<<<<<<<< + * self.process(dims, left_edge, dds, 0, pos, field_vals, gid) + * if self.update_values == 1: + */ + goto __pyx_L7_continue; + + /* "yt/geometry/particle_deposit.pyx":142 + * if pos[j] < left_edge[j] or pos[j] > right_edge[j]: + * continue_loop = True + * if continue_loop: # <<<<<<<<<<<<<< + * continue + * self.process(dims, left_edge, dds, 0, pos, field_vals, gid) + */ + } + + /* "yt/geometry/particle_deposit.pyx":144 + * if continue_loop: + * continue * self.process(dims, left_edge, dds, 0, pos, field_vals, gid) # <<<<<<<<<<<<<< * if self.update_values == 1: * for j in range(nf): */ - ((struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *)__pyx_v_self->__pyx_vtab)->process(__pyx_v_self, __pyx_v_dims, __pyx_v_left_edge, __pyx_v_dds, 0, __pyx_v_pos, __pyx_v_field_vals, __pyx_v_gid); + __pyx_t_13 = ((struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *)__pyx_v_self->__pyx_vtab)->process(__pyx_v_self, __pyx_v_dims, __pyx_v_left_edge, __pyx_v_dds, 0, __pyx_v_pos, __pyx_v_field_vals, __pyx_v_gid); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(1, 144, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":137 - * pos[j] = positions[i, j] + /* "yt/geometry/particle_deposit.pyx":145 + * continue * self.process(dims, left_edge, dds, 0, pos, field_vals, gid) * if self.update_values == 1: # <<<<<<<<<<<<<< * for j in range(nf): @@ -5405,7 +5831,7 @@ __pyx_t_2 = ((__pyx_v_self->update_values == 1) != 0); if (__pyx_t_2) { - /* "yt/geometry/particle_deposit.pyx":138 + /* "yt/geometry/particle_deposit.pyx":146 * self.process(dims, left_edge, dds, 0, pos, field_vals, gid) * if self.update_values == 1: * for j in range(nf): # <<<<<<<<<<<<<< @@ -5416,15 +5842,15 @@ for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_13; __pyx_t_15+=1) { __pyx_v_j = __pyx_t_15; - /* "yt/geometry/particle_deposit.pyx":139 + /* "yt/geometry/particle_deposit.pyx":147 * if self.update_values == 1: * for j in range(nf): * field_pointers[j][i] = field_vals[j] # <<<<<<<<<<<<<< * - * cdef void process(self, int dim[3], np.float64_t left_edge[3], + * cdef int process(self, int dim[3], np.float64_t left_edge[3], */ __pyx_t_21 = __pyx_v_j; - if (unlikely(!__pyx_v_field_pointers.memview)) { __Pyx_RaiseUnboundLocalError("field_pointers"); __PYX_ERR(1, 139, __pyx_L1_error) } + if (unlikely(!__pyx_v_field_pointers.memview)) { __Pyx_RaiseUnboundLocalError("field_pointers"); __PYX_ERR(1, 147, __pyx_L1_error) } __pyx_t_22.data = __pyx_v_field_pointers.data; __pyx_t_22.memview = __pyx_v_field_pointers.memview; __PYX_INC_MEMVIEW(&__pyx_t_22, 0); @@ -5437,7 +5863,7 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)"); - __PYX_ERR(1, 139, __pyx_L1_error) + __PYX_ERR(1, 147, __pyx_L1_error) } if (__pyx_t_23 < 0) { __pyx_t_22.data += __pyx_tmp_idx * __pyx_tmp_stride; @@ -5461,14 +5887,15 @@ __pyx_t_22.data = NULL; } - /* "yt/geometry/particle_deposit.pyx":137 - * pos[j] = positions[i, j] + /* "yt/geometry/particle_deposit.pyx":145 + * continue * self.process(dims, left_edge, dds, 0, pos, field_vals, gid) * if self.update_values == 1: # <<<<<<<<<<<<<< * for j in range(nf): * field_pointers[j][i] = field_vals[j] */ } + __pyx_L7_continue:; } /* "yt/geometry/particle_deposit.pyx":111 @@ -5510,40 +5937,43 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":141 +/* "yt/geometry/particle_deposit.pyx":149 * field_pointers[j][i] = field_vals[j] * - * cdef void process(self, int dim[3], np.float64_t left_edge[3], # <<<<<<<<<<<<<< - * np.float64_t dds[3], np.int64_t offset, - * np.float64_t ppos[3], np.float64_t[:] fields, + * cdef int process(self, int dim[3], np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t dds[3], np.int64_t offset, + * np.float64_t ppos[3], np.float64_t[:] fields, */ -static void __pyx_f_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_ppos, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { +static int __pyx_f_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_ppos, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { + int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_deposit.pyx":145 - * np.float64_t ppos[3], np.float64_t[:] fields, - * np.int64_t domain_ind): + /* "yt/geometry/particle_deposit.pyx":153 + * np.float64_t ppos[3], np.float64_t[:] fields, + * np.int64_t domain_ind) except -1: * raise NotImplementedError # <<<<<<<<<<<<<< * * cdef class CountParticles(ParticleDepositOperation): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(1, 145, __pyx_L1_error) + __PYX_ERR(1, 153, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":141 + /* "yt/geometry/particle_deposit.pyx":149 * field_pointers[j][i] = field_vals[j] * - * cdef void process(self, int dim[3], np.float64_t left_edge[3], # <<<<<<<<<<<<<< - * np.float64_t dds[3], np.int64_t offset, - * np.float64_t ppos[3], np.float64_t[:] fields, + * cdef int process(self, int dim[3], np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t dds[3], np.int64_t offset, + * np.float64_t ppos[3], np.float64_t[:] fields, */ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.ParticleDepositOperation.process", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("yt.geometry.particle_deposit.ParticleDepositOperation.process", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __Pyx_RefNannyFinishContext(); + return __pyx_r; } /* "yt/geometry/particle_deposit.pxd":137 @@ -5551,7 +5981,7 @@ * cdef kernel_func sph_kernel * cdef public object nvals # <<<<<<<<<<<<<< * cdef public int update_values - * cdef void process(self, int dim[3], np.float64_t left_edge[3], + * cdef int process(self, int dim[3], np.float64_t left_edge[3], */ /* Python wrapper */ @@ -5645,8 +6075,8 @@ * cdef kernel_func sph_kernel * cdef public object nvals * cdef public int update_values # <<<<<<<<<<<<<< - * cdef void process(self, int dim[3], np.float64_t left_edge[3], - * np.float64_t dds[3], np.int64_t offset, + * cdef int process(self, int dim[3], np.float64_t left_edge[3], + * np.float64_t dds[3], np.int64_t offset, */ /* Python wrapper */ @@ -5717,7 +6147,114 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":149 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_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_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_10__reduce_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__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.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, 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("self.sph_kernel 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("yt.geometry.particle_deposit.ParticleDepositOperation.__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_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_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_12__setstate_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, 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("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_deposit.ParticleDepositOperation.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pyx":157 * cdef class CountParticles(ParticleDepositOperation): * cdef np.int64_t[:,:,:,:] count * def initialize(self): # <<<<<<<<<<<<<< @@ -5748,53 +6285,53 @@ __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_deposit.pyx":152 + /* "yt/geometry/particle_deposit.pyx":160 * # Create a numpy array accessible to python * self.count = append_axes( * np.zeros(self.nvals, dtype="int64", order='F'), 4) # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 152, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 160, __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(1, 152, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 160, __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(1, 152, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(1, 152, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 152, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 152, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(1, 160, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 160, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 152, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 160, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":151 + /* "yt/geometry/particle_deposit.pyx":159 * def initialize(self): * # Create a numpy array accessible to python * self.count = append_axes( # <<<<<<<<<<<<<< * np.zeros(self.nvals, dtype="int64", order='F'), 4) * */ - __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_int64_t(__pyx_t_3); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 151, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->count, 0); __pyx_v_self->count = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/geometry/particle_deposit.pyx":149 + /* "yt/geometry/particle_deposit.pyx":157 * cdef class CountParticles(ParticleDepositOperation): * cdef np.int64_t[:,:,:,:] count * def initialize(self): # <<<<<<<<<<<<<< @@ -5819,17 +6356,18 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":155 +/* "yt/geometry/particle_deposit.pyx":163 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ -static void __pyx_f_2yt_8geometry_16particle_deposit_14CountParticles_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { +static int __pyx_f_2yt_8geometry_16particle_deposit_14CountParticles_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { int __pyx_v_ii[3]; int __pyx_v_i; + int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; @@ -5838,7 +6376,7 @@ __pyx_t_5numpy_int64_t __pyx_t_5; __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_deposit.pyx":166 + /* "yt/geometry/particle_deposit.pyx":174 * cdef int ii[3] * cdef int i * for i in range(3): # <<<<<<<<<<<<<< @@ -5848,24 +6386,24 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/particle_deposit.pyx":167 + /* "yt/geometry/particle_deposit.pyx":175 * cdef int i * for i in range(3): * ii[i] = ((ppos[i] - left_edge[i])/dds[i]) # <<<<<<<<<<<<<< * self.count[ii[2], ii[1], ii[0], offset] += 1 - * + * return 0 */ (__pyx_v_ii[__pyx_v_i]) = ((int)(((__pyx_v_ppos[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))); } - /* "yt/geometry/particle_deposit.pyx":168 + /* "yt/geometry/particle_deposit.pyx":176 * for i in range(3): * ii[i] = ((ppos[i] - left_edge[i])/dds[i]) * self.count[ii[2], ii[1], ii[0], offset] += 1 # <<<<<<<<<<<<<< + * return 0 * - * def finalize(self): */ - if (unlikely(!__pyx_v_self->count.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 168, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->count.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 176, __pyx_L1_error)} __pyx_t_2 = (__pyx_v_ii[2]); __pyx_t_3 = (__pyx_v_ii[1]); __pyx_t_4 = (__pyx_v_ii[0]); @@ -5889,28 +6427,39 @@ } else if (unlikely(__pyx_t_5 >= __pyx_v_self->count.shape[3])) __pyx_t_1 = 3; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 168, __pyx_L1_error) + __PYX_ERR(1, 176, __pyx_L1_error) } *((__pyx_t_5numpy_int64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->count.data + __pyx_t_2 * __pyx_v_self->count.strides[0]) ) + __pyx_t_3 * __pyx_v_self->count.strides[1]) ) + __pyx_t_4 * __pyx_v_self->count.strides[2]) ) + __pyx_t_5 * __pyx_v_self->count.strides[3]) )) += 1; - /* "yt/geometry/particle_deposit.pyx":155 + /* "yt/geometry/particle_deposit.pyx":177 + * ii[i] = ((ppos[i] - left_edge[i])/dds[i]) + * self.count[ii[2], ii[1], ii[0], offset] += 1 + * return 0 # <<<<<<<<<<<<<< + * + * def finalize(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pyx":163 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ /* function exit code */ - goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.CountParticles.process", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("yt.geometry.particle_deposit.CountParticles.process", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":170 - * self.count[ii[2], ii[1], ii[0], offset] += 1 +/* "yt/geometry/particle_deposit.pyx":179 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * arr = np.asarray(self.count) @@ -5941,20 +6490,20 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_deposit.pyx":171 + /* "yt/geometry/particle_deposit.pyx":180 * * def finalize(self): * arr = np.asarray(self.count) # <<<<<<<<<<<<<< * arr.shape = self.nvals * return arr.astype("float64") */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 171, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 180, __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(1, 171, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_v_self->count.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 171, __pyx_L1_error)} - __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->count, 4, (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(1, 171, __pyx_L1_error) + if (unlikely(!__pyx_v_self->count.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 180, __pyx_L1_error)} + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->count, 4, (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(1, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -5967,14 +6516,14 @@ } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 171, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 180, __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(1, 171, __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(1, 180, __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; @@ -5983,20 +6532,20 @@ #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(1, 171, __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(1, 180, __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(1, 171, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 180, __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(1, 171, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -6005,7 +6554,7 @@ __pyx_v_arr = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":172 + /* "yt/geometry/particle_deposit.pyx":181 * def finalize(self): * arr = np.asarray(self.count) * arr.shape = self.nvals # <<<<<<<<<<<<<< @@ -6014,10 +6563,10 @@ */ __pyx_t_1 = __pyx_v_self->__pyx_base.nvals; __Pyx_INCREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_arr, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(1, 172, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_arr, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(1, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":173 + /* "yt/geometry/particle_deposit.pyx":182 * arr = np.asarray(self.count) * arr.shape = self.nvals * return arr.astype("float64") # <<<<<<<<<<<<<< @@ -6025,17 +6574,17 @@ * deposit_count = CountParticles */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 173, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pyx":170 - * self.count[ii[2], ii[1], ii[0], offset] += 1 + /* "yt/geometry/particle_deposit.pyx":179 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * arr = np.asarray(self.count) @@ -6058,7 +6607,114 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":184 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_14CountParticles_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_14CountParticles_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_2yt_8geometry_16particle_deposit_14CountParticles_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_14CountParticles_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *__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.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel 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(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("self.sph_kernel 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("yt.geometry.particle_deposit.CountParticles.__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_14CountParticles_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_14CountParticles_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_2yt_8geometry_16particle_deposit_14CountParticles_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_14CountParticles_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, 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("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_deposit.CountParticles.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pyx":193 * cdef np.float64_t[:,:,:,:] temp * * def initialize(self): # <<<<<<<<<<<<<< @@ -6089,99 +6745,99 @@ __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_deposit.pyx":186 + /* "yt/geometry/particle_deposit.pyx":195 * def initialize(self): * self.data = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) # <<<<<<<<<<<<<< * self.temp = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 186, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 195, __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(1, 186, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 195, __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(1, 186, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 186, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 186, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 186, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 186, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 195, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 195, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 186, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 195, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":185 + /* "yt/geometry/particle_deposit.pyx":194 * * def initialize(self): * self.data = append_axes( # <<<<<<<<<<<<<< * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.temp = append_axes( */ - __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 185, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(__pyx_t_3); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 185, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->data, 0); __pyx_v_self->data = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/geometry/particle_deposit.pyx":188 + /* "yt/geometry/particle_deposit.pyx":197 * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.temp = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 188, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 188, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 188, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 188, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 188, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 188, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 188, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 197, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 197, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 188, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 197, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":187 + /* "yt/geometry/particle_deposit.pyx":196 * self.data = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.temp = append_axes( # <<<<<<<<<<<<<< * np.zeros(self.nvals, dtype="float64", order='F'), 4) * */ - __pyx_t_1 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_2), 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 187, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_2), 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 187, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->temp, 0); __pyx_v_self->temp = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/geometry/particle_deposit.pyx":184 + /* "yt/geometry/particle_deposit.pyx":193 * cdef np.float64_t[:,:,:,:] temp * * def initialize(self): # <<<<<<<<<<<<<< @@ -6206,15 +6862,15 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":191 +/* "yt/geometry/particle_deposit.pyx":200 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ -static void __pyx_f_2yt_8geometry_16particle_deposit_12SimpleSmooth_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { +static int __pyx_f_2yt_8geometry_16particle_deposit_12SimpleSmooth_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { int __pyx_v_ii[3]; int __pyx_v_ib0[3]; int __pyx_v_ib1[3]; @@ -6225,6 +6881,7 @@ __pyx_t_5numpy_float64_t __pyx_v_idist[3]; __pyx_t_5numpy_float64_t __pyx_v_kernel_sum; __pyx_t_5numpy_float64_t __pyx_v_dist; + int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; @@ -6254,7 +6911,7 @@ __pyx_t_5numpy_int64_t __pyx_t_26; __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_deposit.pyx":206 + /* "yt/geometry/particle_deposit.pyx":215 * cdef np.float64_t kernel_sum, dist * # Smoothing length is fields[0] * kernel_sum = 0.0 # <<<<<<<<<<<<<< @@ -6263,7 +6920,7 @@ */ __pyx_v_kernel_sum = 0.0; - /* "yt/geometry/particle_deposit.pyx":207 + /* "yt/geometry/particle_deposit.pyx":216 * # Smoothing length is fields[0] * kernel_sum = 0.0 * for i in range(3): # <<<<<<<<<<<<<< @@ -6273,7 +6930,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/particle_deposit.pyx":208 + /* "yt/geometry/particle_deposit.pyx":217 * kernel_sum = 0.0 * for i in range(3): * ii[i] = ((ppos[i] - left_edge[i])/dds[i]) # <<<<<<<<<<<<<< @@ -6282,7 +6939,7 @@ */ (__pyx_v_ii[__pyx_v_i]) = ((int)(((__pyx_v_ppos[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))); - /* "yt/geometry/particle_deposit.pyx":209 + /* "yt/geometry/particle_deposit.pyx":218 * for i in range(3): * ii[i] = ((ppos[i] - left_edge[i])/dds[i]) * half_len = (fields[0]/dds[i]) + 1 # <<<<<<<<<<<<<< @@ -6297,11 +6954,11 @@ } else if (unlikely(__pyx_t_2 >= __pyx_v_fields.shape[0])) __pyx_t_3 = 0; if (unlikely(__pyx_t_3 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_3); - __PYX_ERR(1, 209, __pyx_L1_error) + __PYX_ERR(1, 218, __pyx_L1_error) } __pyx_v_half_len = (((int)((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_2 * __pyx_v_fields.strides[0]) ))) / (__pyx_v_dds[__pyx_v_i]))) + 1); - /* "yt/geometry/particle_deposit.pyx":210 + /* "yt/geometry/particle_deposit.pyx":219 * ii[i] = ((ppos[i] - left_edge[i])/dds[i]) * half_len = (fields[0]/dds[i]) + 1 * ib0[i] = ii[i] - half_len # <<<<<<<<<<<<<< @@ -6310,20 +6967,20 @@ */ (__pyx_v_ib0[__pyx_v_i]) = ((__pyx_v_ii[__pyx_v_i]) - __pyx_v_half_len); - /* "yt/geometry/particle_deposit.pyx":211 + /* "yt/geometry/particle_deposit.pyx":220 * half_len = (fields[0]/dds[i]) + 1 * ib0[i] = ii[i] - half_len * ib1[i] = ii[i] + half_len # <<<<<<<<<<<<<< * if ib0[i] >= dim[i] or ib1[i] <0: - * return + * return 0 */ (__pyx_v_ib1[__pyx_v_i]) = ((__pyx_v_ii[__pyx_v_i]) + __pyx_v_half_len); - /* "yt/geometry/particle_deposit.pyx":212 + /* "yt/geometry/particle_deposit.pyx":221 * ib0[i] = ii[i] - half_len * ib1[i] = ii[i] + half_len * if ib0[i] >= dim[i] or ib1[i] <0: # <<<<<<<<<<<<<< - * return + * return 0 * ib0[i] = iclip(ib0[i], 0, dim[i] - 1) */ __pyx_t_5 = (((__pyx_v_ib0[__pyx_v_i]) >= (__pyx_v_dim[__pyx_v_i])) != 0); @@ -6337,35 +6994,36 @@ __pyx_L6_bool_binop_done:; if (__pyx_t_4) { - /* "yt/geometry/particle_deposit.pyx":213 + /* "yt/geometry/particle_deposit.pyx":222 * ib1[i] = ii[i] + half_len * if ib0[i] >= dim[i] or ib1[i] <0: - * return # <<<<<<<<<<<<<< + * return 0 # <<<<<<<<<<<<<< * ib0[i] = iclip(ib0[i], 0, dim[i] - 1) * ib1[i] = iclip(ib1[i], 0, dim[i] - 1) */ + __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pyx":212 + /* "yt/geometry/particle_deposit.pyx":221 * ib0[i] = ii[i] - half_len * ib1[i] = ii[i] + half_len * if ib0[i] >= dim[i] or ib1[i] <0: # <<<<<<<<<<<<<< - * return + * return 0 * ib0[i] = iclip(ib0[i], 0, dim[i] - 1) */ } - /* "yt/geometry/particle_deposit.pyx":214 + /* "yt/geometry/particle_deposit.pyx":223 * if ib0[i] >= dim[i] or ib1[i] <0: - * return + * return 0 * ib0[i] = iclip(ib0[i], 0, dim[i] - 1) # <<<<<<<<<<<<<< * ib1[i] = iclip(ib1[i], 0, dim[i] - 1) * for i from ib0[0] <= i <= ib1[0]: */ (__pyx_v_ib0[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip((__pyx_v_ib0[__pyx_v_i]), 0, ((__pyx_v_dim[__pyx_v_i]) - 1)); - /* "yt/geometry/particle_deposit.pyx":215 - * return + /* "yt/geometry/particle_deposit.pyx":224 + * return 0 * ib0[i] = iclip(ib0[i], 0, dim[i] - 1) * ib1[i] = iclip(ib1[i], 0, dim[i] - 1) # <<<<<<<<<<<<<< * for i from ib0[0] <= i <= ib1[0]: @@ -6374,7 +7032,7 @@ (__pyx_v_ib1[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip((__pyx_v_ib1[__pyx_v_i]), 0, ((__pyx_v_dim[__pyx_v_i]) - 1)); } - /* "yt/geometry/particle_deposit.pyx":216 + /* "yt/geometry/particle_deposit.pyx":225 * ib0[i] = iclip(ib0[i], 0, dim[i] - 1) * ib1[i] = iclip(ib1[i], 0, dim[i] - 1) * for i from ib0[0] <= i <= ib1[0]: # <<<<<<<<<<<<<< @@ -6384,7 +7042,7 @@ __pyx_t_1 = (__pyx_v_ib1[0]); for (__pyx_v_i = (__pyx_v_ib0[0]); __pyx_v_i <= __pyx_t_1; __pyx_v_i++) { - /* "yt/geometry/particle_deposit.pyx":217 + /* "yt/geometry/particle_deposit.pyx":226 * ib1[i] = iclip(ib1[i], 0, dim[i] - 1) * for i from ib0[0] <= i <= ib1[0]: * idist[0] = (ii[0] - i) * dds[0] # <<<<<<<<<<<<<< @@ -6393,7 +7051,7 @@ */ (__pyx_v_idist[0]) = (((__pyx_v_ii[0]) - __pyx_v_i) * (__pyx_v_dds[0])); - /* "yt/geometry/particle_deposit.pyx":218 + /* "yt/geometry/particle_deposit.pyx":227 * for i from ib0[0] <= i <= ib1[0]: * idist[0] = (ii[0] - i) * dds[0] * idist[0] *= idist[0] # <<<<<<<<<<<<<< @@ -6403,7 +7061,7 @@ __pyx_t_6 = 0; (__pyx_v_idist[__pyx_t_6]) = ((__pyx_v_idist[__pyx_t_6]) * (__pyx_v_idist[0])); - /* "yt/geometry/particle_deposit.pyx":219 + /* "yt/geometry/particle_deposit.pyx":228 * idist[0] = (ii[0] - i) * dds[0] * idist[0] *= idist[0] * for j from ib0[1] <= j <= ib1[1]: # <<<<<<<<<<<<<< @@ -6413,7 +7071,7 @@ __pyx_t_3 = (__pyx_v_ib1[1]); for (__pyx_v_j = (__pyx_v_ib0[1]); __pyx_v_j <= __pyx_t_3; __pyx_v_j++) { - /* "yt/geometry/particle_deposit.pyx":220 + /* "yt/geometry/particle_deposit.pyx":229 * idist[0] *= idist[0] * for j from ib0[1] <= j <= ib1[1]: * idist[1] = (ii[1] - j) * dds[1] # <<<<<<<<<<<<<< @@ -6422,7 +7080,7 @@ */ (__pyx_v_idist[1]) = (((__pyx_v_ii[1]) - __pyx_v_j) * (__pyx_v_dds[1])); - /* "yt/geometry/particle_deposit.pyx":221 + /* "yt/geometry/particle_deposit.pyx":230 * for j from ib0[1] <= j <= ib1[1]: * idist[1] = (ii[1] - j) * dds[1] * idist[1] *= idist[1] # <<<<<<<<<<<<<< @@ -6432,7 +7090,7 @@ __pyx_t_6 = 1; (__pyx_v_idist[__pyx_t_6]) = ((__pyx_v_idist[__pyx_t_6]) * (__pyx_v_idist[1])); - /* "yt/geometry/particle_deposit.pyx":222 + /* "yt/geometry/particle_deposit.pyx":231 * idist[1] = (ii[1] - j) * dds[1] * idist[1] *= idist[1] * for k from ib0[2] <= k <= ib1[2]: # <<<<<<<<<<<<<< @@ -6442,7 +7100,7 @@ __pyx_t_7 = (__pyx_v_ib1[2]); for (__pyx_v_k = (__pyx_v_ib0[2]); __pyx_v_k <= __pyx_t_7; __pyx_v_k++) { - /* "yt/geometry/particle_deposit.pyx":223 + /* "yt/geometry/particle_deposit.pyx":232 * idist[1] *= idist[1] * for k from ib0[2] <= k <= ib1[2]: * idist[2] = (ii[2] - k) * dds[2] # <<<<<<<<<<<<<< @@ -6451,7 +7109,7 @@ */ (__pyx_v_idist[2]) = (((__pyx_v_ii[2]) - __pyx_v_k) * (__pyx_v_dds[2])); - /* "yt/geometry/particle_deposit.pyx":224 + /* "yt/geometry/particle_deposit.pyx":233 * for k from ib0[2] <= k <= ib1[2]: * idist[2] = (ii[2] - k) * dds[2] * idist[2] *= idist[2] # <<<<<<<<<<<<<< @@ -6461,7 +7119,7 @@ __pyx_t_6 = 2; (__pyx_v_idist[__pyx_t_6]) = ((__pyx_v_idist[__pyx_t_6]) * (__pyx_v_idist[2])); - /* "yt/geometry/particle_deposit.pyx":225 + /* "yt/geometry/particle_deposit.pyx":234 * idist[2] = (ii[2] - k) * dds[2] * idist[2] *= idist[2] * dist = idist[0] + idist[1] + idist[2] # <<<<<<<<<<<<<< @@ -6470,7 +7128,7 @@ */ __pyx_v_dist = (((__pyx_v_idist[0]) + (__pyx_v_idist[1])) + (__pyx_v_idist[2])); - /* "yt/geometry/particle_deposit.pyx":227 + /* "yt/geometry/particle_deposit.pyx":236 * dist = idist[0] + idist[1] + idist[2] * # Calculate distance in multiples of the smoothing length * dist = sqrt(dist) / fields[0] # <<<<<<<<<<<<<< @@ -6485,18 +7143,18 @@ } else if (unlikely(__pyx_t_8 >= __pyx_v_fields.shape[0])) __pyx_t_9 = 0; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(1, 227, __pyx_L1_error) + __PYX_ERR(1, 236, __pyx_L1_error) } __pyx_v_dist = (sqrt(__pyx_v_dist) / (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_8 * __pyx_v_fields.strides[0]) )))); - /* "yt/geometry/particle_deposit.pyx":228 + /* "yt/geometry/particle_deposit.pyx":237 * # Calculate distance in multiples of the smoothing length * dist = sqrt(dist) / fields[0] * self.temp[k,j,i,offset] = self.sph_kernel(dist) # <<<<<<<<<<<<<< * kernel_sum += self.temp[k,j,i,offset] * # Having found the kernel, deposit accordingly into gdata */ - if (unlikely(!__pyx_v_self->temp.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 228, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->temp.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 237, __pyx_L1_error)} __pyx_t_10 = __pyx_v_k; __pyx_t_11 = __pyx_v_j; __pyx_t_12 = __pyx_v_i; @@ -6520,18 +7178,18 @@ } else if (unlikely(__pyx_t_13 >= __pyx_v_self->temp.shape[3])) __pyx_t_9 = 3; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(1, 228, __pyx_L1_error) + __PYX_ERR(1, 237, __pyx_L1_error) } *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->temp.data + __pyx_t_10 * __pyx_v_self->temp.strides[0]) ) + __pyx_t_11 * __pyx_v_self->temp.strides[1]) ) + __pyx_t_12 * __pyx_v_self->temp.strides[2]) ) + __pyx_t_13 * __pyx_v_self->temp.strides[3]) )) = __pyx_v_self->__pyx_base.sph_kernel(__pyx_v_dist); - /* "yt/geometry/particle_deposit.pyx":229 + /* "yt/geometry/particle_deposit.pyx":238 * dist = sqrt(dist) / fields[0] * self.temp[k,j,i,offset] = self.sph_kernel(dist) * kernel_sum += self.temp[k,j,i,offset] # <<<<<<<<<<<<<< * # Having found the kernel, deposit accordingly into gdata * for i from ib0[0] <= i <= ib1[0]: */ - if (unlikely(!__pyx_v_self->temp.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 229, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->temp.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 238, __pyx_L1_error)} __pyx_t_14 = __pyx_v_k; __pyx_t_15 = __pyx_v_j; __pyx_t_16 = __pyx_v_i; @@ -6555,14 +7213,14 @@ } else if (unlikely(__pyx_t_17 >= __pyx_v_self->temp.shape[3])) __pyx_t_9 = 3; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(1, 229, __pyx_L1_error) + __PYX_ERR(1, 238, __pyx_L1_error) } __pyx_v_kernel_sum = (__pyx_v_kernel_sum + (*((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->temp.data + __pyx_t_14 * __pyx_v_self->temp.strides[0]) ) + __pyx_t_15 * __pyx_v_self->temp.strides[1]) ) + __pyx_t_16 * __pyx_v_self->temp.strides[2]) ) + __pyx_t_17 * __pyx_v_self->temp.strides[3]) )))); } } } - /* "yt/geometry/particle_deposit.pyx":231 + /* "yt/geometry/particle_deposit.pyx":240 * kernel_sum += self.temp[k,j,i,offset] * # Having found the kernel, deposit accordingly into gdata * for i from ib0[0] <= i <= ib1[0]: # <<<<<<<<<<<<<< @@ -6572,7 +7230,7 @@ __pyx_t_1 = (__pyx_v_ib1[0]); for (__pyx_v_i = (__pyx_v_ib0[0]); __pyx_v_i <= __pyx_t_1; __pyx_v_i++) { - /* "yt/geometry/particle_deposit.pyx":232 + /* "yt/geometry/particle_deposit.pyx":241 * # Having found the kernel, deposit accordingly into gdata * for i from ib0[0] <= i <= ib1[0]: * for j from ib0[1] <= j <= ib1[1]: # <<<<<<<<<<<<<< @@ -6582,7 +7240,7 @@ __pyx_t_3 = (__pyx_v_ib1[1]); for (__pyx_v_j = (__pyx_v_ib0[1]); __pyx_v_j <= __pyx_t_3; __pyx_v_j++) { - /* "yt/geometry/particle_deposit.pyx":233 + /* "yt/geometry/particle_deposit.pyx":242 * for i from ib0[0] <= i <= ib1[0]: * for j from ib0[1] <= j <= ib1[1]: * for k from ib0[2] <= k <= ib1[2]: # <<<<<<<<<<<<<< @@ -6592,14 +7250,14 @@ __pyx_t_7 = (__pyx_v_ib1[2]); for (__pyx_v_k = (__pyx_v_ib0[2]); __pyx_v_k <= __pyx_t_7; __pyx_v_k++) { - /* "yt/geometry/particle_deposit.pyx":234 + /* "yt/geometry/particle_deposit.pyx":243 * for j from ib0[1] <= j <= ib1[1]: * for k from ib0[2] <= k <= ib1[2]: * dist = self.temp[k,j,i,offset] / kernel_sum # <<<<<<<<<<<<<< * self.data[k,j,i,offset] += fields[1] * dist - * + * return 0 */ - if (unlikely(!__pyx_v_self->temp.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 234, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->temp.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 243, __pyx_L1_error)} __pyx_t_18 = __pyx_v_k; __pyx_t_19 = __pyx_v_j; __pyx_t_20 = __pyx_v_i; @@ -6623,16 +7281,16 @@ } else if (unlikely(__pyx_t_21 >= __pyx_v_self->temp.shape[3])) __pyx_t_9 = 3; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(1, 234, __pyx_L1_error) + __PYX_ERR(1, 243, __pyx_L1_error) } __pyx_v_dist = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->temp.data + __pyx_t_18 * __pyx_v_self->temp.strides[0]) ) + __pyx_t_19 * __pyx_v_self->temp.strides[1]) ) + __pyx_t_20 * __pyx_v_self->temp.strides[2]) ) + __pyx_t_21 * __pyx_v_self->temp.strides[3]) ))) / __pyx_v_kernel_sum); - /* "yt/geometry/particle_deposit.pyx":235 + /* "yt/geometry/particle_deposit.pyx":244 * for k from ib0[2] <= k <= ib1[2]: * dist = self.temp[k,j,i,offset] / kernel_sum * self.data[k,j,i,offset] += fields[1] * dist # <<<<<<<<<<<<<< + * return 0 * - * def finalize(self): */ __pyx_t_22 = 1; __pyx_t_9 = -1; @@ -6642,9 +7300,9 @@ } else if (unlikely(__pyx_t_22 >= __pyx_v_fields.shape[0])) __pyx_t_9 = 0; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(1, 235, __pyx_L1_error) + __PYX_ERR(1, 244, __pyx_L1_error) } - if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 235, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 244, __pyx_L1_error)} __pyx_t_23 = __pyx_v_k; __pyx_t_24 = __pyx_v_j; __pyx_t_25 = __pyx_v_i; @@ -6668,31 +7326,42 @@ } else if (unlikely(__pyx_t_26 >= __pyx_v_self->data.shape[3])) __pyx_t_9 = 3; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(1, 235, __pyx_L1_error) + __PYX_ERR(1, 244, __pyx_L1_error) } *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_23 * __pyx_v_self->data.strides[0]) ) + __pyx_t_24 * __pyx_v_self->data.strides[1]) ) + __pyx_t_25 * __pyx_v_self->data.strides[2]) ) + __pyx_t_26 * __pyx_v_self->data.strides[3]) )) += ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_22 * __pyx_v_fields.strides[0]) ))) * __pyx_v_dist); } } } - /* "yt/geometry/particle_deposit.pyx":191 + /* "yt/geometry/particle_deposit.pyx":245 + * dist = self.temp[k,j,i,offset] / kernel_sum + * self.data[k,j,i,offset] += fields[1] * dist + * return 0 # <<<<<<<<<<<<<< + * + * def finalize(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pyx":200 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ /* function exit code */ - goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.SimpleSmooth.process", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("yt.geometry.particle_deposit.SimpleSmooth.process", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":237 - * self.data[k,j,i,offset] += fields[1] * dist +/* "yt/geometry/particle_deposit.pyx":247 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * return self.odata @@ -6718,7 +7387,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_deposit.pyx":238 + /* "yt/geometry/particle_deposit.pyx":248 * * def finalize(self): * return self.odata # <<<<<<<<<<<<<< @@ -6726,14 +7395,14 @@ * deposit_simple_smooth = SimpleSmooth */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_odata); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_odata); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pyx":237 - * self.data[k,j,i,offset] += fields[1] * dist + /* "yt/geometry/particle_deposit.pyx":247 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * return self.odata @@ -6751,7 +7420,114 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":244 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_12SimpleSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_12SimpleSmooth_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_2yt_8geometry_16particle_deposit_12SimpleSmooth_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_12SimpleSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *__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.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, 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("self.sph_kernel 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("yt.geometry.particle_deposit.SimpleSmooth.__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_12SimpleSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_12SimpleSmooth_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_2yt_8geometry_16particle_deposit_12SimpleSmooth_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_12SimpleSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, 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("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_deposit.SimpleSmooth.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pyx":254 * cdef class SumParticleField(ParticleDepositOperation): * cdef np.float64_t[:,:,:,:] sum * def initialize(self): # <<<<<<<<<<<<<< @@ -6782,53 +7558,53 @@ __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_deposit.pyx":246 + /* "yt/geometry/particle_deposit.pyx":256 * def initialize(self): * self.sum = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 246, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 256, __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(1, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 256, __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(1, 246, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 246, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 246, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 246, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 256, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 256, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 246, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 256, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":245 + /* "yt/geometry/particle_deposit.pyx":255 * cdef np.float64_t[:,:,:,:] sum * def initialize(self): * self.sum = append_axes( # <<<<<<<<<<<<<< * np.zeros(self.nvals, dtype="float64", order='F'), 4) * */ - __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(__pyx_t_3); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 245, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->sum, 0); __pyx_v_self->sum = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/geometry/particle_deposit.pyx":244 + /* "yt/geometry/particle_deposit.pyx":254 * cdef class SumParticleField(ParticleDepositOperation): * cdef np.float64_t[:,:,:,:] sum * def initialize(self): # <<<<<<<<<<<<<< @@ -6853,17 +7629,18 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":249 +/* "yt/geometry/particle_deposit.pyx":259 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ -static void __pyx_f_2yt_8geometry_16particle_deposit_16SumParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { +static int __pyx_f_2yt_8geometry_16particle_deposit_16SumParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { int __pyx_v_ii[3]; int __pyx_v_i; + int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; @@ -6873,7 +7650,7 @@ __pyx_t_5numpy_int64_t __pyx_t_6; __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_deposit.pyx":259 + /* "yt/geometry/particle_deposit.pyx":269 * cdef int ii[3] * cdef int i * for i in range(3): # <<<<<<<<<<<<<< @@ -6883,21 +7660,21 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/particle_deposit.pyx":260 + /* "yt/geometry/particle_deposit.pyx":270 * cdef int i * for i in range(3): * ii[i] = ((ppos[i] - left_edge[i]) / dds[i]) # <<<<<<<<<<<<<< * self.sum[ii[2], ii[1], ii[0], offset] += fields[0] - * return + * return 0 */ (__pyx_v_ii[__pyx_v_i]) = ((int)(((__pyx_v_ppos[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))); } - /* "yt/geometry/particle_deposit.pyx":261 + /* "yt/geometry/particle_deposit.pyx":271 * for i in range(3): * ii[i] = ((ppos[i] - left_edge[i]) / dds[i]) * self.sum[ii[2], ii[1], ii[0], offset] += fields[0] # <<<<<<<<<<<<<< - * return + * return 0 * */ __pyx_t_2 = 0; @@ -6908,9 +7685,9 @@ } else if (unlikely(__pyx_t_2 >= __pyx_v_fields.shape[0])) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 261, __pyx_L1_error) + __PYX_ERR(1, 271, __pyx_L1_error) } - if (unlikely(!__pyx_v_self->sum.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 261, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->sum.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 271, __pyx_L1_error)} __pyx_t_3 = (__pyx_v_ii[2]); __pyx_t_4 = (__pyx_v_ii[1]); __pyx_t_5 = (__pyx_v_ii[0]); @@ -6934,36 +7711,39 @@ } else if (unlikely(__pyx_t_6 >= __pyx_v_self->sum.shape[3])) __pyx_t_1 = 3; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 261, __pyx_L1_error) + __PYX_ERR(1, 271, __pyx_L1_error) } *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->sum.data + __pyx_t_3 * __pyx_v_self->sum.strides[0]) ) + __pyx_t_4 * __pyx_v_self->sum.strides[1]) ) + __pyx_t_5 * __pyx_v_self->sum.strides[2]) ) + __pyx_t_6 * __pyx_v_self->sum.strides[3]) )) += (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_2 * __pyx_v_fields.strides[0]) ))); - /* "yt/geometry/particle_deposit.pyx":262 + /* "yt/geometry/particle_deposit.pyx":272 * ii[i] = ((ppos[i] - left_edge[i]) / dds[i]) * self.sum[ii[2], ii[1], ii[0], offset] += fields[0] - * return # <<<<<<<<<<<<<< + * return 0 # <<<<<<<<<<<<<< * * def finalize(self): */ + __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pyx":249 + /* "yt/geometry/particle_deposit.pyx":259 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.SumParticleField.process", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("yt.geometry.particle_deposit.SumParticleField.process", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":264 - * return +/* "yt/geometry/particle_deposit.pyx":274 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * sum = np.asarray(self.sum) @@ -6994,20 +7774,20 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_deposit.pyx":265 + /* "yt/geometry/particle_deposit.pyx":275 * * def finalize(self): * sum = np.asarray(self.sum) # <<<<<<<<<<<<<< * sum.shape = self.nvals * return sum */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 265, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 275, __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(1, 265, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_v_self->sum.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 265, __pyx_L1_error)} - __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->sum, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 265, __pyx_L1_error) + if (unlikely(!__pyx_v_self->sum.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 275, __pyx_L1_error)} + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->sum, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -7020,14 +7800,14 @@ } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 265, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __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(1, 265, __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(1, 275, __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; @@ -7036,20 +7816,20 @@ #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(1, 265, __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(1, 275, __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(1, 265, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 275, __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(1, 265, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -7058,7 +7838,7 @@ __pyx_v_sum = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":266 + /* "yt/geometry/particle_deposit.pyx":276 * def finalize(self): * sum = np.asarray(self.sum) * sum.shape = self.nvals # <<<<<<<<<<<<<< @@ -7067,10 +7847,10 @@ */ __pyx_t_1 = __pyx_v_self->__pyx_base.nvals; __Pyx_INCREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_sum, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(1, 266, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_sum, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(1, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":267 + /* "yt/geometry/particle_deposit.pyx":277 * sum = np.asarray(self.sum) * sum.shape = self.nvals * return sum # <<<<<<<<<<<<<< @@ -7082,8 +7862,8 @@ __pyx_r = __pyx_v_sum; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pyx":264 - * return + /* "yt/geometry/particle_deposit.pyx":274 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * sum = np.asarray(self.sum) @@ -7106,7 +7886,114 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":278 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_16SumParticleField_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_16SumParticleField_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_2yt_8geometry_16particle_deposit_16SumParticleField_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_16SumParticleField_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *__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.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, 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("self.sph_kernel 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("yt.geometry.particle_deposit.SumParticleField.__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_16SumParticleField_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_16SumParticleField_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_2yt_8geometry_16particle_deposit_16SumParticleField_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_16SumParticleField_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, 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("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_deposit.SumParticleField.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pyx":288 * cdef np.float64_t[:,:,:,:] qk * cdef np.float64_t[:,:,:,:] i * def initialize(self): # <<<<<<<<<<<<<< @@ -7137,145 +8024,145 @@ __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_deposit.pyx":284 + /* "yt/geometry/particle_deposit.pyx":294 * # the M_k term * self.mk = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) # <<<<<<<<<<<<<< * self.qk = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 284, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 294, __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(1, 284, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 294, __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(1, 284, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 284, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 284, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 284, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 284, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 294, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 294, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 284, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 294, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":283 + /* "yt/geometry/particle_deposit.pyx":293 * # deposited into each one * # the M_k term * self.mk = append_axes( # <<<<<<<<<<<<<< * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.qk = append_axes( */ - __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 283, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(__pyx_t_3); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 283, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->mk, 0); __pyx_v_self->mk = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/geometry/particle_deposit.pyx":286 + /* "yt/geometry/particle_deposit.pyx":296 * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.qk = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) # <<<<<<<<<<<<<< * self.i = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 286, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 286, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 286, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 286, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 286, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 286, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 296, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 296, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 286, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 296, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":285 + /* "yt/geometry/particle_deposit.pyx":295 * self.mk = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.qk = append_axes( # <<<<<<<<<<<<<< * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.i = append_axes( */ - __pyx_t_1 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_2), 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_2), 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 285, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 295, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->qk, 0); __pyx_v_self->qk = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/geometry/particle_deposit.pyx":288 + /* "yt/geometry/particle_deposit.pyx":298 * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.i = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 298, __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(1, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 298, __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(1, 288, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 288, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 288, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 288, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 298, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 298, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 288, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 298, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":287 + /* "yt/geometry/particle_deposit.pyx":297 * self.qk = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.i = append_axes( # <<<<<<<<<<<<<< * np.zeros(self.nvals, dtype="float64", order='F'), 4) * */ - __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 287, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(__pyx_t_3); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 287, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->i, 0); __pyx_v_self->i = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/geometry/particle_deposit.pyx":278 + /* "yt/geometry/particle_deposit.pyx":288 * cdef np.float64_t[:,:,:,:] qk * cdef np.float64_t[:,:,:,:] i * def initialize(self): # <<<<<<<<<<<<<< @@ -7300,20 +8187,21 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":291 +/* "yt/geometry/particle_deposit.pyx":301 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ -static void __pyx_f_2yt_8geometry_16particle_deposit_16StdParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { +static int __pyx_f_2yt_8geometry_16particle_deposit_16StdParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { int __pyx_v_ii[3]; int __pyx_v_i; float __pyx_v_k; float __pyx_v_mk; float __pyx_v_qk; + int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; @@ -7343,14 +8231,15 @@ Py_ssize_t __pyx_t_26; Py_ssize_t __pyx_t_27; Py_ssize_t __pyx_t_28; - __pyx_t_5numpy_int64_t __pyx_t_29; - Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; Py_ssize_t __pyx_t_31; Py_ssize_t __pyx_t_32; - __pyx_t_5numpy_int64_t __pyx_t_33; + Py_ssize_t __pyx_t_33; + __pyx_t_5numpy_int64_t __pyx_t_34; __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_deposit.pyx":302 + /* "yt/geometry/particle_deposit.pyx":312 * cdef int i, cell_index * cdef float k, mk, qk * for i in range(3): # <<<<<<<<<<<<<< @@ -7360,7 +8249,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/particle_deposit.pyx":303 + /* "yt/geometry/particle_deposit.pyx":313 * cdef float k, mk, qk * for i in range(3): * ii[i] = ((ppos[i] - left_edge[i])/dds[i]) # <<<<<<<<<<<<<< @@ -7370,14 +8259,14 @@ (__pyx_v_ii[__pyx_v_i]) = ((int)(((__pyx_v_ppos[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))); } - /* "yt/geometry/particle_deposit.pyx":304 + /* "yt/geometry/particle_deposit.pyx":314 * for i in range(3): * ii[i] = ((ppos[i] - left_edge[i])/dds[i]) * k = self.i[ii[2], ii[1], ii[0], offset] # <<<<<<<<<<<<<< * mk = self.mk[ii[2], ii[1], ii[0], offset] * qk = self.qk[ii[2], ii[1], ii[0], offset] */ - if (unlikely(!__pyx_v_self->i.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 304, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->i.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 314, __pyx_L1_error)} __pyx_t_2 = (__pyx_v_ii[2]); __pyx_t_3 = (__pyx_v_ii[1]); __pyx_t_4 = (__pyx_v_ii[0]); @@ -7401,18 +8290,18 @@ } else if (unlikely(__pyx_t_5 >= __pyx_v_self->i.shape[3])) __pyx_t_1 = 3; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 304, __pyx_L1_error) + __PYX_ERR(1, 314, __pyx_L1_error) } __pyx_v_k = (*((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->i.data + __pyx_t_2 * __pyx_v_self->i.strides[0]) ) + __pyx_t_3 * __pyx_v_self->i.strides[1]) ) + __pyx_t_4 * __pyx_v_self->i.strides[2]) ) + __pyx_t_5 * __pyx_v_self->i.strides[3]) ))); - /* "yt/geometry/particle_deposit.pyx":305 + /* "yt/geometry/particle_deposit.pyx":315 * ii[i] = ((ppos[i] - left_edge[i])/dds[i]) * k = self.i[ii[2], ii[1], ii[0], offset] * mk = self.mk[ii[2], ii[1], ii[0], offset] # <<<<<<<<<<<<<< * qk = self.qk[ii[2], ii[1], ii[0], offset] * #print k, mk, qk, cell_index */ - if (unlikely(!__pyx_v_self->mk.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 305, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->mk.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 315, __pyx_L1_error)} __pyx_t_6 = (__pyx_v_ii[2]); __pyx_t_7 = (__pyx_v_ii[1]); __pyx_t_8 = (__pyx_v_ii[0]); @@ -7436,18 +8325,18 @@ } else if (unlikely(__pyx_t_9 >= __pyx_v_self->mk.shape[3])) __pyx_t_1 = 3; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 305, __pyx_L1_error) + __PYX_ERR(1, 315, __pyx_L1_error) } __pyx_v_mk = (*((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->mk.data + __pyx_t_6 * __pyx_v_self->mk.strides[0]) ) + __pyx_t_7 * __pyx_v_self->mk.strides[1]) ) + __pyx_t_8 * __pyx_v_self->mk.strides[2]) ) + __pyx_t_9 * __pyx_v_self->mk.strides[3]) ))); - /* "yt/geometry/particle_deposit.pyx":306 + /* "yt/geometry/particle_deposit.pyx":316 * k = self.i[ii[2], ii[1], ii[0], offset] * mk = self.mk[ii[2], ii[1], ii[0], offset] * qk = self.qk[ii[2], ii[1], ii[0], offset] # <<<<<<<<<<<<<< * #print k, mk, qk, cell_index * if k == 0.0: */ - if (unlikely(!__pyx_v_self->qk.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 306, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->qk.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 316, __pyx_L1_error)} __pyx_t_10 = (__pyx_v_ii[2]); __pyx_t_11 = (__pyx_v_ii[1]); __pyx_t_12 = (__pyx_v_ii[0]); @@ -7471,11 +8360,11 @@ } else if (unlikely(__pyx_t_13 >= __pyx_v_self->qk.shape[3])) __pyx_t_1 = 3; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 306, __pyx_L1_error) + __PYX_ERR(1, 316, __pyx_L1_error) } __pyx_v_qk = (*((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->qk.data + __pyx_t_10 * __pyx_v_self->qk.strides[0]) ) + __pyx_t_11 * __pyx_v_self->qk.strides[1]) ) + __pyx_t_12 * __pyx_v_self->qk.strides[2]) ) + __pyx_t_13 * __pyx_v_self->qk.strides[3]) ))); - /* "yt/geometry/particle_deposit.pyx":308 + /* "yt/geometry/particle_deposit.pyx":318 * qk = self.qk[ii[2], ii[1], ii[0], offset] * #print k, mk, qk, cell_index * if k == 0.0: # <<<<<<<<<<<<<< @@ -7485,7 +8374,7 @@ __pyx_t_14 = ((__pyx_v_k == 0.0) != 0); if (__pyx_t_14) { - /* "yt/geometry/particle_deposit.pyx":310 + /* "yt/geometry/particle_deposit.pyx":320 * if k == 0.0: * # Initialize cell values * self.mk[ii[2], ii[1], ii[0], offset] = fields[0] # <<<<<<<<<<<<<< @@ -7500,9 +8389,9 @@ } else if (unlikely(__pyx_t_15 >= __pyx_v_fields.shape[0])) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 310, __pyx_L1_error) + __PYX_ERR(1, 320, __pyx_L1_error) } - if (unlikely(!__pyx_v_self->mk.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 310, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->mk.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 320, __pyx_L1_error)} __pyx_t_16 = (__pyx_v_ii[2]); __pyx_t_17 = (__pyx_v_ii[1]); __pyx_t_18 = (__pyx_v_ii[0]); @@ -7526,11 +8415,11 @@ } else if (unlikely(__pyx_t_19 >= __pyx_v_self->mk.shape[3])) __pyx_t_1 = 3; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 310, __pyx_L1_error) + __PYX_ERR(1, 320, __pyx_L1_error) } *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->mk.data + __pyx_t_16 * __pyx_v_self->mk.strides[0]) ) + __pyx_t_17 * __pyx_v_self->mk.strides[1]) ) + __pyx_t_18 * __pyx_v_self->mk.strides[2]) ) + __pyx_t_19 * __pyx_v_self->mk.strides[3]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_15 * __pyx_v_fields.strides[0]) ))); - /* "yt/geometry/particle_deposit.pyx":308 + /* "yt/geometry/particle_deposit.pyx":318 * qk = self.qk[ii[2], ii[1], ii[0], offset] * #print k, mk, qk, cell_index * if k == 0.0: # <<<<<<<<<<<<<< @@ -7540,12 +8429,12 @@ goto __pyx_L5; } - /* "yt/geometry/particle_deposit.pyx":312 + /* "yt/geometry/particle_deposit.pyx":322 * self.mk[ii[2], ii[1], ii[0], offset] = fields[0] * else: * self.mk[ii[2], ii[1], ii[0], offset] = mk + (fields[0] - mk) / k # <<<<<<<<<<<<<< * self.qk[ii[2], ii[1], ii[0], offset] = \ - * qk + (k - 1.0) * (fields[0] - mk)**2.0 / k + * qk + (k - 1.0) * (fields[0] - mk) * (fields[0] - mk) / k */ /*else*/ { __pyx_t_20 = 0; @@ -7556,9 +8445,9 @@ } else if (unlikely(__pyx_t_20 >= __pyx_v_fields.shape[0])) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 312, __pyx_L1_error) + __PYX_ERR(1, 322, __pyx_L1_error) } - if (unlikely(!__pyx_v_self->mk.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 312, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->mk.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 322, __pyx_L1_error)} __pyx_t_21 = (__pyx_v_ii[2]); __pyx_t_22 = (__pyx_v_ii[1]); __pyx_t_23 = (__pyx_v_ii[0]); @@ -7582,16 +8471,16 @@ } else if (unlikely(__pyx_t_24 >= __pyx_v_self->mk.shape[3])) __pyx_t_1 = 3; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 312, __pyx_L1_error) + __PYX_ERR(1, 322, __pyx_L1_error) } *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->mk.data + __pyx_t_21 * __pyx_v_self->mk.strides[0]) ) + __pyx_t_22 * __pyx_v_self->mk.strides[1]) ) + __pyx_t_23 * __pyx_v_self->mk.strides[2]) ) + __pyx_t_24 * __pyx_v_self->mk.strides[3]) )) = (__pyx_v_mk + (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_20 * __pyx_v_fields.strides[0]) ))) - __pyx_v_mk) / __pyx_v_k)); - /* "yt/geometry/particle_deposit.pyx":314 + /* "yt/geometry/particle_deposit.pyx":324 * self.mk[ii[2], ii[1], ii[0], offset] = mk + (fields[0] - mk) / k * self.qk[ii[2], ii[1], ii[0], offset] = \ - * qk + (k - 1.0) * (fields[0] - mk)**2.0 / k # <<<<<<<<<<<<<< + * qk + (k - 1.0) * (fields[0] - mk) * (fields[0] - mk) / k # <<<<<<<<<<<<<< * self.i[ii[2], ii[1], ii[0], offset] += 1 - * + * return 0 */ __pyx_t_25 = 0; __pyx_t_1 = -1; @@ -7601,99 +8490,120 @@ } else if (unlikely(__pyx_t_25 >= __pyx_v_fields.shape[0])) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 314, __pyx_L1_error) + __PYX_ERR(1, 324, __pyx_L1_error) + } + __pyx_t_26 = 0; + __pyx_t_1 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_v_fields.shape[0]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_v_fields.shape[0])) __pyx_t_1 = 0; + if (unlikely(__pyx_t_1 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_1); + __PYX_ERR(1, 324, __pyx_L1_error) } - /* "yt/geometry/particle_deposit.pyx":313 + /* "yt/geometry/particle_deposit.pyx":323 * else: * self.mk[ii[2], ii[1], ii[0], offset] = mk + (fields[0] - mk) / k * self.qk[ii[2], ii[1], ii[0], offset] = \ # <<<<<<<<<<<<<< - * qk + (k - 1.0) * (fields[0] - mk)**2.0 / k + * qk + (k - 1.0) * (fields[0] - mk) * (fields[0] - mk) / k * self.i[ii[2], ii[1], ii[0], offset] += 1 */ - if (unlikely(!__pyx_v_self->qk.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 313, __pyx_L1_error)} - __pyx_t_26 = (__pyx_v_ii[2]); - __pyx_t_27 = (__pyx_v_ii[1]); - __pyx_t_28 = (__pyx_v_ii[0]); - __pyx_t_29 = __pyx_v_offset; + if (unlikely(!__pyx_v_self->qk.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 323, __pyx_L1_error)} + __pyx_t_27 = (__pyx_v_ii[2]); + __pyx_t_28 = (__pyx_v_ii[1]); + __pyx_t_29 = (__pyx_v_ii[0]); + __pyx_t_30 = __pyx_v_offset; __pyx_t_1 = -1; - if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_self->qk.shape[0]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_1 = 0; - } else if (unlikely(__pyx_t_26 >= __pyx_v_self->qk.shape[0])) __pyx_t_1 = 0; if (__pyx_t_27 < 0) { - __pyx_t_27 += __pyx_v_self->qk.shape[1]; - if (unlikely(__pyx_t_27 < 0)) __pyx_t_1 = 1; - } else if (unlikely(__pyx_t_27 >= __pyx_v_self->qk.shape[1])) __pyx_t_1 = 1; + __pyx_t_27 += __pyx_v_self->qk.shape[0]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_v_self->qk.shape[0])) __pyx_t_1 = 0; if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_v_self->qk.shape[2]; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_1 = 2; - } else if (unlikely(__pyx_t_28 >= __pyx_v_self->qk.shape[2])) __pyx_t_1 = 2; + __pyx_t_28 += __pyx_v_self->qk.shape[1]; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_1 = 1; + } else if (unlikely(__pyx_t_28 >= __pyx_v_self->qk.shape[1])) __pyx_t_1 = 1; if (__pyx_t_29 < 0) { - __pyx_t_29 += __pyx_v_self->qk.shape[3]; - if (unlikely(__pyx_t_29 < 0)) __pyx_t_1 = 3; - } else if (unlikely(__pyx_t_29 >= __pyx_v_self->qk.shape[3])) __pyx_t_1 = 3; + __pyx_t_29 += __pyx_v_self->qk.shape[2]; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_1 = 2; + } else if (unlikely(__pyx_t_29 >= __pyx_v_self->qk.shape[2])) __pyx_t_1 = 2; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_v_self->qk.shape[3]; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_1 = 3; + } else if (unlikely(__pyx_t_30 >= __pyx_v_self->qk.shape[3])) __pyx_t_1 = 3; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 313, __pyx_L1_error) + __PYX_ERR(1, 323, __pyx_L1_error) } - *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->qk.data + __pyx_t_26 * __pyx_v_self->qk.strides[0]) ) + __pyx_t_27 * __pyx_v_self->qk.strides[1]) ) + __pyx_t_28 * __pyx_v_self->qk.strides[2]) ) + __pyx_t_29 * __pyx_v_self->qk.strides[3]) )) = (__pyx_v_qk + (((__pyx_v_k - 1.0) * pow(((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_25 * __pyx_v_fields.strides[0]) ))) - __pyx_v_mk), ((__pyx_t_5numpy_float64_t)2.0))) / __pyx_v_k)); + *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->qk.data + __pyx_t_27 * __pyx_v_self->qk.strides[0]) ) + __pyx_t_28 * __pyx_v_self->qk.strides[1]) ) + __pyx_t_29 * __pyx_v_self->qk.strides[2]) ) + __pyx_t_30 * __pyx_v_self->qk.strides[3]) )) = (__pyx_v_qk + ((((__pyx_v_k - 1.0) * ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_25 * __pyx_v_fields.strides[0]) ))) - __pyx_v_mk)) * ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_26 * __pyx_v_fields.strides[0]) ))) - __pyx_v_mk)) / __pyx_v_k)); } __pyx_L5:; - /* "yt/geometry/particle_deposit.pyx":315 + /* "yt/geometry/particle_deposit.pyx":325 * self.qk[ii[2], ii[1], ii[0], offset] = \ - * qk + (k - 1.0) * (fields[0] - mk)**2.0 / k + * qk + (k - 1.0) * (fields[0] - mk) * (fields[0] - mk) / k * self.i[ii[2], ii[1], ii[0], offset] += 1 # <<<<<<<<<<<<<< + * return 0 * - * def finalize(self): */ - if (unlikely(!__pyx_v_self->i.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 315, __pyx_L1_error)} - __pyx_t_30 = (__pyx_v_ii[2]); - __pyx_t_31 = (__pyx_v_ii[1]); - __pyx_t_32 = (__pyx_v_ii[0]); - __pyx_t_33 = __pyx_v_offset; + if (unlikely(!__pyx_v_self->i.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 325, __pyx_L1_error)} + __pyx_t_31 = (__pyx_v_ii[2]); + __pyx_t_32 = (__pyx_v_ii[1]); + __pyx_t_33 = (__pyx_v_ii[0]); + __pyx_t_34 = __pyx_v_offset; __pyx_t_1 = -1; - if (__pyx_t_30 < 0) { - __pyx_t_30 += __pyx_v_self->i.shape[0]; - if (unlikely(__pyx_t_30 < 0)) __pyx_t_1 = 0; - } else if (unlikely(__pyx_t_30 >= __pyx_v_self->i.shape[0])) __pyx_t_1 = 0; if (__pyx_t_31 < 0) { - __pyx_t_31 += __pyx_v_self->i.shape[1]; - if (unlikely(__pyx_t_31 < 0)) __pyx_t_1 = 1; - } else if (unlikely(__pyx_t_31 >= __pyx_v_self->i.shape[1])) __pyx_t_1 = 1; + __pyx_t_31 += __pyx_v_self->i.shape[0]; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_v_self->i.shape[0])) __pyx_t_1 = 0; if (__pyx_t_32 < 0) { - __pyx_t_32 += __pyx_v_self->i.shape[2]; - if (unlikely(__pyx_t_32 < 0)) __pyx_t_1 = 2; - } else if (unlikely(__pyx_t_32 >= __pyx_v_self->i.shape[2])) __pyx_t_1 = 2; + __pyx_t_32 += __pyx_v_self->i.shape[1]; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_1 = 1; + } else if (unlikely(__pyx_t_32 >= __pyx_v_self->i.shape[1])) __pyx_t_1 = 1; if (__pyx_t_33 < 0) { - __pyx_t_33 += __pyx_v_self->i.shape[3]; - if (unlikely(__pyx_t_33 < 0)) __pyx_t_1 = 3; - } else if (unlikely(__pyx_t_33 >= __pyx_v_self->i.shape[3])) __pyx_t_1 = 3; + __pyx_t_33 += __pyx_v_self->i.shape[2]; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_1 = 2; + } else if (unlikely(__pyx_t_33 >= __pyx_v_self->i.shape[2])) __pyx_t_1 = 2; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_v_self->i.shape[3]; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_1 = 3; + } else if (unlikely(__pyx_t_34 >= __pyx_v_self->i.shape[3])) __pyx_t_1 = 3; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 315, __pyx_L1_error) + __PYX_ERR(1, 325, __pyx_L1_error) } - *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->i.data + __pyx_t_30 * __pyx_v_self->i.strides[0]) ) + __pyx_t_31 * __pyx_v_self->i.strides[1]) ) + __pyx_t_32 * __pyx_v_self->i.strides[2]) ) + __pyx_t_33 * __pyx_v_self->i.strides[3]) )) += 1.0; + *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->i.data + __pyx_t_31 * __pyx_v_self->i.strides[0]) ) + __pyx_t_32 * __pyx_v_self->i.strides[1]) ) + __pyx_t_33 * __pyx_v_self->i.strides[2]) ) + __pyx_t_34 * __pyx_v_self->i.strides[3]) )) += 1.0; + + /* "yt/geometry/particle_deposit.pyx":326 + * qk + (k - 1.0) * (fields[0] - mk) * (fields[0] - mk) / k + * self.i[ii[2], ii[1], ii[0], offset] += 1 + * return 0 # <<<<<<<<<<<<<< + * + * def finalize(self): + */ + __pyx_r = 0; + goto __pyx_L0; - /* "yt/geometry/particle_deposit.pyx":291 + /* "yt/geometry/particle_deposit.pyx":301 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ /* function exit code */ - goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.StdParticleField.process", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("yt.geometry.particle_deposit.StdParticleField.process", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":317 - * self.i[ii[2], ii[1], ii[0], offset] += 1 +/* "yt/geometry/particle_deposit.pyx":328 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * # This is the standard variance @@ -7725,20 +8635,20 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_deposit.pyx":320 + /* "yt/geometry/particle_deposit.pyx":331 * # This is the standard variance * # if we want sample variance divide by (self.oi - 1.0) * i = np.asarray(self.i) # <<<<<<<<<<<<<< * std2 = np.asarray(self.qk) / i * std2[i == 0.0] = 0.0 */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 320, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 331, __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(1, 320, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_v_self->i.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 320, __pyx_L1_error)} - __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->i, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 320, __pyx_L1_error) + if (unlikely(!__pyx_v_self->i.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 331, __pyx_L1_error)} + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->i, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -7751,14 +8661,14 @@ } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 320, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 331, __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(1, 320, __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(1, 331, __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; @@ -7767,20 +8677,20 @@ #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(1, 320, __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(1, 331, __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(1, 320, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 331, __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(1, 320, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -7789,20 +8699,20 @@ __pyx_v_i = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":321 + /* "yt/geometry/particle_deposit.pyx":332 * # if we want sample variance divide by (self.oi - 1.0) * i = np.asarray(self.i) * std2 = np.asarray(self.qk) / i # <<<<<<<<<<<<<< * std2[i == 0.0] = 0.0 * std2.shape = self.nvals */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 321, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 332, __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(1, 321, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_v_self->qk.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 321, __pyx_L1_error)} - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->qk, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 321, __pyx_L1_error) + if (unlikely(!__pyx_v_self->qk.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 332, __pyx_L1_error)} + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->qk, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -7815,14 +8725,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 321, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 332, __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(1, 321, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 332, __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; @@ -7831,44 +8741,44 @@ #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(1, 321, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 332, __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(1, 321, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 332, __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(1, 321, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 332, __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_t_5 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 321, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_std2 = __pyx_t_5; __pyx_t_5 = 0; - /* "yt/geometry/particle_deposit.pyx":322 + /* "yt/geometry/particle_deposit.pyx":333 * i = np.asarray(self.i) * std2 = np.asarray(self.qk) / i * std2[i == 0.0] = 0.0 # <<<<<<<<<<<<<< * std2.shape = self.nvals * return np.sqrt(std2) */ - __pyx_t_5 = __Pyx_PyFloat_EqObjC(__pyx_v_i, __pyx_float_0_0, 0.0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 322, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFloat_EqObjC(__pyx_v_i, __pyx_float_0_0, 0.0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyObject_SetItem(__pyx_v_std2, __pyx_t_5, __pyx_float_0_0) < 0)) __PYX_ERR(1, 322, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_std2, __pyx_t_5, __pyx_float_0_0) < 0)) __PYX_ERR(1, 333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/particle_deposit.pyx":323 + /* "yt/geometry/particle_deposit.pyx":334 * std2 = np.asarray(self.qk) / i * std2[i == 0.0] = 0.0 * std2.shape = self.nvals # <<<<<<<<<<<<<< @@ -7877,10 +8787,10 @@ */ __pyx_t_5 = __pyx_v_self->__pyx_base.nvals; __Pyx_INCREF(__pyx_t_5); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_std2, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(1, 323, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_std2, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(1, 334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/particle_deposit.pyx":324 + /* "yt/geometry/particle_deposit.pyx":335 * std2[i == 0.0] = 0.0 * std2.shape = self.nvals * return np.sqrt(std2) # <<<<<<<<<<<<<< @@ -7888,9 +8798,9 @@ * deposit_std = StdParticleField */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 324, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 324, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -7904,13 +8814,13 @@ } } if (!__pyx_t_1) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_std2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 324, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_std2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_std2}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 324, __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(1, 335, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else @@ -7918,19 +8828,19 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_std2}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 324, __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(1, 335, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 324, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_std2); __Pyx_GIVEREF(__pyx_v_std2); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_std2); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 324, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -7940,8 +8850,8 @@ __pyx_t_5 = 0; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pyx":317 - * self.i[ii[2], ii[1], ii[0], offset] += 1 + /* "yt/geometry/particle_deposit.pyx":328 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * # This is the standard variance @@ -7965,7 +8875,114 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":331 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_16StdParticleField_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_16StdParticleField_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_2yt_8geometry_16particle_deposit_16StdParticleField_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_16StdParticleField_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *__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.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, 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("self.sph_kernel 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("yt.geometry.particle_deposit.StdParticleField.__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_16StdParticleField_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_16StdParticleField_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_2yt_8geometry_16particle_deposit_16StdParticleField_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_16StdParticleField_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, 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("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_deposit.StdParticleField.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pyx":342 * cdef np.float64_t[:,:,:,:] field * cdef public object ofield * def initialize(self): # <<<<<<<<<<<<<< @@ -7987,7 +9004,7 @@ } static PyObject *__pyx_gb_2yt_8geometry_16particle_deposit_10CICDeposit_10initialize_2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "yt/geometry/particle_deposit.pyx":332 +/* "yt/geometry/particle_deposit.pyx":343 * cdef public object ofield * def initialize(self): * if not all(_ > 1 for _ in self.nvals): # <<<<<<<<<<<<<< @@ -8004,7 +9021,7 @@ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_2yt_8geometry_16particle_deposit___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(1, 332, __pyx_L1_error) + __PYX_ERR(1, 343, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -8012,7 +9029,7 @@ __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_2yt_8geometry_16particle_deposit_10CICDeposit_10initialize_2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_initialize_locals_genexpr, __pyx_n_s_yt_geometry_particle_deposit); if (unlikely(!gen)) __PYX_ERR(1, 332, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_2yt_8geometry_16particle_deposit_10CICDeposit_10initialize_2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_initialize_locals_genexpr, __pyx_n_s_yt_geometry_particle_deposit); if (unlikely(!gen)) __PYX_ERR(1, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -8047,32 +9064,32 @@ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 332, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(1, 332, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 343, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(1, 343, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->__pyx_base.nvals)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->__pyx_base.nvals)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->__pyx_base.nvals; __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_self->__pyx_base.nvals); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 332, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->__pyx_base.nvals); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 343, __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, 332, __pyx_L1_error) + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 343, __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, 332, __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(1, 343, __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, 332, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 343, __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, 332, __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(1, 343, __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, 332, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -8082,7 +9099,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(1, 332, __pyx_L1_error) + else __PYX_ERR(1, 343, __pyx_L1_error) } break; } @@ -8092,8 +9109,8 @@ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v__, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 332, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 332, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v__, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 343, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = ((!__pyx_t_5) != 0); if (__pyx_t_6) { @@ -8128,7 +9145,7 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":331 +/* "yt/geometry/particle_deposit.pyx":342 * cdef np.float64_t[:,:,:,:] field * cdef public object ofield * def initialize(self): # <<<<<<<<<<<<<< @@ -8154,7 +9171,7 @@ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_2yt_8geometry_16particle_deposit___pyx_scope_struct__initialize *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(1, 331, __pyx_L1_error) + __PYX_ERR(1, 342, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -8162,48 +9179,48 @@ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "yt/geometry/particle_deposit.pyx":332 + /* "yt/geometry/particle_deposit.pyx":343 * cdef public object ofield * def initialize(self): * if not all(_ > 1 for _ in self.nvals): # <<<<<<<<<<<<<< * from yt.utilities.exceptions import YTBoundsDefinitionError * raise YTBoundsDefinitionError( */ - __pyx_t_1 = __pyx_pf_2yt_8geometry_16particle_deposit_10CICDeposit_10initialize_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 332, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_2yt_8geometry_16particle_deposit_10CICDeposit_10initialize_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 332, __pyx_L1_error) + __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 332, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { - /* "yt/geometry/particle_deposit.pyx":333 + /* "yt/geometry/particle_deposit.pyx":344 * def initialize(self): * if not all(_ > 1 for _ in self.nvals): * from yt.utilities.exceptions import YTBoundsDefinitionError # <<<<<<<<<<<<<< * raise YTBoundsDefinitionError( - * "CIC requires minimum of 2 zones in all dimensions", + * "CIC requires minimum of 2 zones in all spatial dimensions", */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 333, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_YTBoundsDefinitionError); __Pyx_GIVEREF(__pyx_n_s_YTBoundsDefinitionError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_YTBoundsDefinitionError); - __pyx_t_1 = __Pyx_Import(__pyx_n_s_yt_utilities_exceptions, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 333, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_yt_utilities_exceptions, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 344, __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_YTBoundsDefinitionError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 333, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_YTBoundsDefinitionError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v_YTBoundsDefinitionError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":336 + /* "yt/geometry/particle_deposit.pyx":347 * raise YTBoundsDefinitionError( - * "CIC requires minimum of 2 zones in all dimensions", + * "CIC requires minimum of 2 zones in all spatial dimensions", * self.nvals) # <<<<<<<<<<<<<< * self.field = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) @@ -8224,7 +9241,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_CIC_requires_minimum_of_2_zones, __pyx_cur_scope->__pyx_v_self->__pyx_base.nvals}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 334, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 345, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -8232,13 +9249,13 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_CIC_requires_minimum_of_2_zones, __pyx_cur_scope->__pyx_v_self->__pyx_base.nvals}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 334, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 345, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 334, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -8249,16 +9266,16 @@ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_cur_scope->__pyx_v_self->__pyx_base.nvals); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 334, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(1, 334, __pyx_L1_error) + __PYX_ERR(1, 345, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":332 + /* "yt/geometry/particle_deposit.pyx":343 * cdef public object ofield * def initialize(self): * if not all(_ > 1 for _ in self.nvals): # <<<<<<<<<<<<<< @@ -8267,53 +9284,53 @@ */ } - /* "yt/geometry/particle_deposit.pyx":338 + /* "yt/geometry/particle_deposit.pyx":349 * self.nvals) * self.field = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 338, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 349, __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(1, 338, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 349, __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(1, 338, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_self->__pyx_base.nvals); - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 338, __pyx_L1_error) + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 338, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 338, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 338, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 349, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 349, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 349, __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_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 338, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 349, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":337 - * "CIC requires minimum of 2 zones in all dimensions", + /* "yt/geometry/particle_deposit.pyx":348 + * "CIC requires minimum of 2 zones in all spatial dimensions", * self.nvals) * self.field = append_axes( # <<<<<<<<<<<<<< * np.zeros(self.nvals, dtype="float64", order='F'), 4) * */ - __pyx_t_7 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_5), 4); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 337, __pyx_L1_error) + __pyx_t_7 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_5), 4); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(__pyx_t_7); - if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(1, 337, __pyx_L1_error) + if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(1, 348, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_self->field, 0); __pyx_cur_scope->__pyx_v_self->field = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "yt/geometry/particle_deposit.pyx":331 + /* "yt/geometry/particle_deposit.pyx":342 * cdef np.float64_t[:,:,:,:] field * cdef public object ofield * def initialize(self): # <<<<<<<<<<<<<< @@ -8340,21 +9357,22 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":341 +/* "yt/geometry/particle_deposit.pyx":352 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ -static void __pyx_f_2yt_8geometry_16particle_deposit_10CICDeposit_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { +static int __pyx_f_2yt_8geometry_16particle_deposit_10CICDeposit_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { int __pyx_v_i; int __pyx_v_j; int __pyx_v_k; int __pyx_v_ind[3]; __pyx_t_5numpy_float64_t __pyx_v_rpos[3]; __pyx_t_5numpy_float64_t __pyx_v_rdds[3][2]; + int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; @@ -8367,7 +9385,7 @@ __pyx_t_5numpy_int64_t __pyx_t_9; __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_deposit.pyx":360 + /* "yt/geometry/particle_deposit.pyx":371 * * # Compute the position of the central cell * for i in range(3): # <<<<<<<<<<<<<< @@ -8377,7 +9395,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/particle_deposit.pyx":361 + /* "yt/geometry/particle_deposit.pyx":372 * # Compute the position of the central cell * for i in range(3): * rpos[i] = (ppos[i]-left_edge[i])/dds[i] # <<<<<<<<<<<<<< @@ -8386,7 +9404,7 @@ */ (__pyx_v_rpos[__pyx_v_i]) = (((__pyx_v_ppos[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i])); - /* "yt/geometry/particle_deposit.pyx":362 + /* "yt/geometry/particle_deposit.pyx":373 * for i in range(3): * rpos[i] = (ppos[i]-left_edge[i])/dds[i] * rpos[i] = fclip(rpos[i], 0.5001, dim[i]-0.5001) # <<<<<<<<<<<<<< @@ -8395,7 +9413,7 @@ */ (__pyx_v_rpos[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip((__pyx_v_rpos[__pyx_v_i]), 0.5001, ((__pyx_v_dim[__pyx_v_i]) - 0.5001)); - /* "yt/geometry/particle_deposit.pyx":363 + /* "yt/geometry/particle_deposit.pyx":374 * rpos[i] = (ppos[i]-left_edge[i])/dds[i] * rpos[i] = fclip(rpos[i], 0.5001, dim[i]-0.5001) * ind[i] = (rpos[i] + 0.5) # <<<<<<<<<<<<<< @@ -8404,7 +9422,7 @@ */ (__pyx_v_ind[__pyx_v_i]) = ((int)((__pyx_v_rpos[__pyx_v_i]) + 0.5)); - /* "yt/geometry/particle_deposit.pyx":365 + /* "yt/geometry/particle_deposit.pyx":376 * ind[i] = (rpos[i] + 0.5) * # Note these are 1, then 0 * rdds[i][1] = ( ind[i]) + 0.5 - rpos[i] # <<<<<<<<<<<<<< @@ -8413,7 +9431,7 @@ */ ((__pyx_v_rdds[__pyx_v_i])[1]) = ((((__pyx_t_5numpy_float64_t)(__pyx_v_ind[__pyx_v_i])) + 0.5) - (__pyx_v_rpos[__pyx_v_i])); - /* "yt/geometry/particle_deposit.pyx":366 + /* "yt/geometry/particle_deposit.pyx":377 * # Note these are 1, then 0 * rdds[i][1] = ( ind[i]) + 0.5 - rpos[i] * rdds[i][0] = 1.0 - rdds[i][1] # <<<<<<<<<<<<<< @@ -8423,7 +9441,7 @@ ((__pyx_v_rdds[__pyx_v_i])[0]) = (1.0 - ((__pyx_v_rdds[__pyx_v_i])[1])); } - /* "yt/geometry/particle_deposit.pyx":368 + /* "yt/geometry/particle_deposit.pyx":379 * rdds[i][0] = 1.0 - rdds[i][1] * * for i in range(2): # <<<<<<<<<<<<<< @@ -8433,7 +9451,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/particle_deposit.pyx":369 + /* "yt/geometry/particle_deposit.pyx":380 * * for i in range(2): * for j in range(2): # <<<<<<<<<<<<<< @@ -8443,7 +9461,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 2; __pyx_t_2+=1) { __pyx_v_j = __pyx_t_2; - /* "yt/geometry/particle_deposit.pyx":370 + /* "yt/geometry/particle_deposit.pyx":381 * for i in range(2): * for j in range(2): * for k in range(2): # <<<<<<<<<<<<<< @@ -8453,12 +9471,12 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 2; __pyx_t_3+=1) { __pyx_v_k = __pyx_t_3; - /* "yt/geometry/particle_deposit.pyx":372 + /* "yt/geometry/particle_deposit.pyx":383 * for k in range(2): * self.field[ind[2] - k, ind[1] - j, ind[0] - i, offset] += \ * fields[0]*rdds[0][i]*rdds[1][j]*rdds[2][k] # <<<<<<<<<<<<<< * - * def finalize(self): + * return 0 */ __pyx_t_4 = 0; __pyx_t_5 = -1; @@ -8468,17 +9486,17 @@ } else if (unlikely(__pyx_t_4 >= __pyx_v_fields.shape[0])) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(1, 372, __pyx_L1_error) + __PYX_ERR(1, 383, __pyx_L1_error) } - /* "yt/geometry/particle_deposit.pyx":371 + /* "yt/geometry/particle_deposit.pyx":382 * for j in range(2): * for k in range(2): * self.field[ind[2] - k, ind[1] - j, ind[0] - i, offset] += \ # <<<<<<<<<<<<<< * fields[0]*rdds[0][i]*rdds[1][j]*rdds[2][k] * */ - if (unlikely(!__pyx_v_self->field.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 371, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->field.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 382, __pyx_L1_error)} __pyx_t_6 = ((__pyx_v_ind[2]) - __pyx_v_k); __pyx_t_7 = ((__pyx_v_ind[1]) - __pyx_v_j); __pyx_t_8 = ((__pyx_v_ind[0]) - __pyx_v_i); @@ -8502,31 +9520,42 @@ } else if (unlikely(__pyx_t_9 >= __pyx_v_self->field.shape[3])) __pyx_t_5 = 3; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(1, 371, __pyx_L1_error) + __PYX_ERR(1, 382, __pyx_L1_error) } *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->field.data + __pyx_t_6 * __pyx_v_self->field.strides[0]) ) + __pyx_t_7 * __pyx_v_self->field.strides[1]) ) + __pyx_t_8 * __pyx_v_self->field.strides[2]) ) + __pyx_t_9 * __pyx_v_self->field.strides[3]) )) += ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_4 * __pyx_v_fields.strides[0]) ))) * ((__pyx_v_rdds[0])[__pyx_v_i])) * ((__pyx_v_rdds[1])[__pyx_v_j])) * ((__pyx_v_rdds[2])[__pyx_v_k])); } } } - /* "yt/geometry/particle_deposit.pyx":341 + /* "yt/geometry/particle_deposit.pyx":385 + * fields[0]*rdds[0][i]*rdds[1][j]*rdds[2][k] + * + * return 0 # <<<<<<<<<<<<<< + * + * def finalize(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pyx":352 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ /* function exit code */ - goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.CICDeposit.process", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("yt.geometry.particle_deposit.CICDeposit.process", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":374 - * fields[0]*rdds[0][i]*rdds[1][j]*rdds[2][k] +/* "yt/geometry/particle_deposit.pyx":387 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * rv = np.asarray(self.field) @@ -8557,20 +9586,20 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_deposit.pyx":375 + /* "yt/geometry/particle_deposit.pyx":388 * * def finalize(self): * rv = np.asarray(self.field) # <<<<<<<<<<<<<< * rv.shape = self.nvals * return rv */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 375, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 388, __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(1, 375, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_v_self->field.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 375, __pyx_L1_error)} - __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->field, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 375, __pyx_L1_error) + if (unlikely(!__pyx_v_self->field.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 388, __pyx_L1_error)} + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->field, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -8583,14 +9612,14 @@ } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 388, __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(1, 375, __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(1, 388, __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; @@ -8599,20 +9628,20 @@ #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(1, 375, __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(1, 388, __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(1, 375, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 388, __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(1, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -8621,7 +9650,7 @@ __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":376 + /* "yt/geometry/particle_deposit.pyx":389 * def finalize(self): * rv = np.asarray(self.field) * rv.shape = self.nvals # <<<<<<<<<<<<<< @@ -8630,10 +9659,10 @@ */ __pyx_t_1 = __pyx_v_self->__pyx_base.nvals; __Pyx_INCREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(1, 376, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":377 + /* "yt/geometry/particle_deposit.pyx":390 * rv = np.asarray(self.field) * rv.shape = self.nvals * return rv # <<<<<<<<<<<<<< @@ -8645,8 +9674,8 @@ __pyx_r = __pyx_v_rv; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pyx":374 - * fields[0]*rdds[0][i]*rdds[1][j]*rdds[2][k] + /* "yt/geometry/particle_deposit.pyx":387 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * rv = np.asarray(self.field) @@ -8669,7 +9698,7 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":330 +/* "yt/geometry/particle_deposit.pyx":341 * cdef class CICDeposit(ParticleDepositOperation): * cdef np.float64_t[:,:,:,:] field * cdef public object ofield # <<<<<<<<<<<<<< @@ -8764,7 +9793,114 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":386 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_10CICDeposit_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_10CICDeposit_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_2yt_8geometry_16particle_deposit_10CICDeposit_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_10CICDeposit_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__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.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, 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("self.sph_kernel 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("yt.geometry.particle_deposit.CICDeposit.__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_10CICDeposit_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_10CICDeposit_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_2yt_8geometry_16particle_deposit_10CICDeposit_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_10CICDeposit_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, 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("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_deposit.CICDeposit.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pyx":399 * cdef np.float64_t[:,:,:,:] wf * cdef np.float64_t[:,:,:,:] w * def initialize(self): # <<<<<<<<<<<<<< @@ -8795,99 +9931,99 @@ __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_deposit.pyx":388 + /* "yt/geometry/particle_deposit.pyx":401 * def initialize(self): * self.wf = append_axes( * np.zeros(self.nvals, dtype='float64', order='F'), 4) # <<<<<<<<<<<<<< * self.w = append_axes( * np.zeros(self.nvals, dtype='float64', order='F'), 4) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 401, __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(1, 388, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 401, __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(1, 388, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 388, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 388, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 388, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 388, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 401, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 401, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 388, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 401, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":387 + /* "yt/geometry/particle_deposit.pyx":400 * cdef np.float64_t[:,:,:,:] w * def initialize(self): * self.wf = append_axes( # <<<<<<<<<<<<<< * np.zeros(self.nvals, dtype='float64', order='F'), 4) * self.w = append_axes( */ - __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 387, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(__pyx_t_3); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 387, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 400, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->wf, 0); __pyx_v_self->wf = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/geometry/particle_deposit.pyx":390 + /* "yt/geometry/particle_deposit.pyx":403 * np.zeros(self.nvals, dtype='float64', order='F'), 4) * self.w = append_axes( * np.zeros(self.nvals, dtype='float64', order='F'), 4) # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 390, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 390, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 390, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 403, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 403, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 390, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 403, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":389 + /* "yt/geometry/particle_deposit.pyx":402 * self.wf = append_axes( * np.zeros(self.nvals, dtype='float64', order='F'), 4) * self.w = append_axes( # <<<<<<<<<<<<<< * np.zeros(self.nvals, dtype='float64', order='F'), 4) * */ - __pyx_t_1 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_2), 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 389, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_2), 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 389, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 402, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->w, 0); __pyx_v_self->w = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/geometry/particle_deposit.pyx":386 + /* "yt/geometry/particle_deposit.pyx":399 * cdef np.float64_t[:,:,:,:] wf * cdef np.float64_t[:,:,:,:] w * def initialize(self): # <<<<<<<<<<<<<< @@ -8912,17 +10048,18 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":393 +/* "yt/geometry/particle_deposit.pyx":406 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ -static void __pyx_f_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { +static int __pyx_f_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { int __pyx_v_ii[3]; int __pyx_v_i; + int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; @@ -8938,7 +10075,7 @@ __pyx_t_5numpy_int64_t __pyx_t_12; __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_deposit.pyx":403 + /* "yt/geometry/particle_deposit.pyx":416 * cdef int ii[3] * cdef int i * for i in range(3): # <<<<<<<<<<<<<< @@ -8948,7 +10085,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/particle_deposit.pyx":404 + /* "yt/geometry/particle_deposit.pyx":417 * cdef int i * for i in range(3): * ii[i] = ((ppos[i] - left_edge[i]) / dds[i]) # <<<<<<<<<<<<<< @@ -8958,12 +10095,12 @@ (__pyx_v_ii[__pyx_v_i]) = ((int)(((__pyx_v_ppos[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))); } - /* "yt/geometry/particle_deposit.pyx":405 + /* "yt/geometry/particle_deposit.pyx":418 * for i in range(3): * ii[i] = ((ppos[i] - left_edge[i]) / dds[i]) * self.w[ii[2], ii[1], ii[0], offset] += fields[1] # <<<<<<<<<<<<<< * self.wf[ii[2], ii[1], ii[0], offset] += fields[0] * fields[1] - * + * return 0 */ __pyx_t_2 = 1; __pyx_t_1 = -1; @@ -8973,9 +10110,9 @@ } else if (unlikely(__pyx_t_2 >= __pyx_v_fields.shape[0])) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 405, __pyx_L1_error) + __PYX_ERR(1, 418, __pyx_L1_error) } - if (unlikely(!__pyx_v_self->w.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 405, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->w.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 418, __pyx_L1_error)} __pyx_t_3 = (__pyx_v_ii[2]); __pyx_t_4 = (__pyx_v_ii[1]); __pyx_t_5 = (__pyx_v_ii[0]); @@ -8999,16 +10136,16 @@ } else if (unlikely(__pyx_t_6 >= __pyx_v_self->w.shape[3])) __pyx_t_1 = 3; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 405, __pyx_L1_error) + __PYX_ERR(1, 418, __pyx_L1_error) } *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->w.data + __pyx_t_3 * __pyx_v_self->w.strides[0]) ) + __pyx_t_4 * __pyx_v_self->w.strides[1]) ) + __pyx_t_5 * __pyx_v_self->w.strides[2]) ) + __pyx_t_6 * __pyx_v_self->w.strides[3]) )) += (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_2 * __pyx_v_fields.strides[0]) ))); - /* "yt/geometry/particle_deposit.pyx":406 + /* "yt/geometry/particle_deposit.pyx":419 * ii[i] = ((ppos[i] - left_edge[i]) / dds[i]) * self.w[ii[2], ii[1], ii[0], offset] += fields[1] * self.wf[ii[2], ii[1], ii[0], offset] += fields[0] * fields[1] # <<<<<<<<<<<<<< + * return 0 * - * def finalize(self): */ __pyx_t_7 = 0; __pyx_t_1 = -1; @@ -9018,7 +10155,7 @@ } else if (unlikely(__pyx_t_7 >= __pyx_v_fields.shape[0])) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 406, __pyx_L1_error) + __PYX_ERR(1, 419, __pyx_L1_error) } __pyx_t_8 = 1; __pyx_t_1 = -1; @@ -9028,9 +10165,9 @@ } else if (unlikely(__pyx_t_8 >= __pyx_v_fields.shape[0])) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 406, __pyx_L1_error) + __PYX_ERR(1, 419, __pyx_L1_error) } - if (unlikely(!__pyx_v_self->wf.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 406, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->wf.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 419, __pyx_L1_error)} __pyx_t_9 = (__pyx_v_ii[2]); __pyx_t_10 = (__pyx_v_ii[1]); __pyx_t_11 = (__pyx_v_ii[0]); @@ -9054,28 +10191,39 @@ } else if (unlikely(__pyx_t_12 >= __pyx_v_self->wf.shape[3])) __pyx_t_1 = 3; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(1, 406, __pyx_L1_error) + __PYX_ERR(1, 419, __pyx_L1_error) } *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->wf.data + __pyx_t_9 * __pyx_v_self->wf.strides[0]) ) + __pyx_t_10 * __pyx_v_self->wf.strides[1]) ) + __pyx_t_11 * __pyx_v_self->wf.strides[2]) ) + __pyx_t_12 * __pyx_v_self->wf.strides[3]) )) += ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_7 * __pyx_v_fields.strides[0]) ))) * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_8 * __pyx_v_fields.strides[0]) )))); - /* "yt/geometry/particle_deposit.pyx":393 + /* "yt/geometry/particle_deposit.pyx":420 + * self.w[ii[2], ii[1], ii[0], offset] += fields[1] + * self.wf[ii[2], ii[1], ii[0], offset] += fields[0] * fields[1] + * return 0 # <<<<<<<<<<<<<< + * + * def finalize(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pyx":406 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ /* function exit code */ - goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.WeightedMeanParticleField.process", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("yt.geometry.particle_deposit.WeightedMeanParticleField.process", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":408 - * self.wf[ii[2], ii[1], ii[0], offset] += fields[0] * fields[1] +/* "yt/geometry/particle_deposit.pyx":422 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * wf = np.asarray(self.wf) @@ -9108,20 +10256,20 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_deposit.pyx":409 + /* "yt/geometry/particle_deposit.pyx":423 * * def finalize(self): * wf = np.asarray(self.wf) # <<<<<<<<<<<<<< * w = np.asarray(self.w) * rv = wf / w */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __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(1, 409, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_v_self->wf.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 409, __pyx_L1_error)} - __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->wf, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) + if (unlikely(!__pyx_v_self->wf.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 423, __pyx_L1_error)} + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->wf, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -9134,14 +10282,14 @@ } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 423, __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(1, 409, __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(1, 423, __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; @@ -9150,20 +10298,20 @@ #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(1, 409, __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(1, 423, __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(1, 409, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 423, __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(1, 409, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -9172,20 +10320,20 @@ __pyx_v_wf = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":410 + /* "yt/geometry/particle_deposit.pyx":424 * def finalize(self): * wf = np.asarray(self.wf) * w = np.asarray(self.w) # <<<<<<<<<<<<<< * rv = wf / w * rv.shape = self.nvals */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 410, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __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(1, 410, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_v_self->w.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 410, __pyx_L1_error)} - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->w, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 410, __pyx_L1_error) + if (unlikely(!__pyx_v_self->w.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 424, __pyx_L1_error)} + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->w, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -9198,14 +10346,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 410, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __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(1, 410, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __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; @@ -9214,20 +10362,20 @@ #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(1, 410, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __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(1, 410, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 424, __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(1, 410, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -9236,19 +10384,19 @@ __pyx_v_w = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":411 + /* "yt/geometry/particle_deposit.pyx":425 * wf = np.asarray(self.wf) * w = np.asarray(self.w) * rv = wf / w # <<<<<<<<<<<<<< * rv.shape = self.nvals * return rv */ - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_wf, __pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 411, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_wf, __pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":412 + /* "yt/geometry/particle_deposit.pyx":426 * w = np.asarray(self.w) * rv = wf / w * rv.shape = self.nvals # <<<<<<<<<<<<<< @@ -9257,10 +10405,10 @@ */ __pyx_t_1 = __pyx_v_self->__pyx_base.nvals; __Pyx_INCREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(1, 412, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(1, 426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":413 + /* "yt/geometry/particle_deposit.pyx":427 * rv = wf / w * rv.shape = self.nvals * return rv # <<<<<<<<<<<<<< @@ -9272,8 +10420,8 @@ __pyx_r = __pyx_v_rv; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pyx":408 - * self.wf[ii[2], ii[1], ii[0], offset] += fields[0] * fields[1] + /* "yt/geometry/particle_deposit.pyx":422 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * wf = np.asarray(self.wf) @@ -9298,7 +10446,114 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":421 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_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_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *__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.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, 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("self.sph_kernel 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("yt.geometry.particle_deposit.WeightedMeanParticleField.__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_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_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, 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("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_deposit.WeightedMeanParticleField.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pyx":435 * # value of the oct or block (grids will always be zero) identifier that a * # given particle resides in * def initialize(self): # <<<<<<<<<<<<<< @@ -9324,7 +10579,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_deposit.pyx":422 + /* "yt/geometry/particle_deposit.pyx":436 * # given particle resides in * def initialize(self): * self.update_values = 1 # <<<<<<<<<<<<<< @@ -9333,7 +10588,7 @@ */ __pyx_v_self->__pyx_base.update_values = 1; - /* "yt/geometry/particle_deposit.pyx":421 + /* "yt/geometry/particle_deposit.pyx":435 * # value of the oct or block (grids will always be zero) identifier that a * # given particle resides in * def initialize(self): # <<<<<<<<<<<<<< @@ -9348,26 +10603,27 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":425 +/* "yt/geometry/particle_deposit.pyx":439 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< * np.float64_t left_edge[3], * np.float64_t dds[3], */ -static void __pyx_f_2yt_8geometry_16particle_deposit_14MeshIdentifier_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_MeshIdentifier *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { +static int __pyx_f_2yt_8geometry_16particle_deposit_14MeshIdentifier_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_MeshIdentifier *__pyx_v_self, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { + int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_deposit.pyx":433 + /* "yt/geometry/particle_deposit.pyx":447 * np.int64_t domain_ind - * ): + * ) except -1: * fields[0] = domain_ind # <<<<<<<<<<<<<< + * return 0 * - * def finalize(self): */ __pyx_t_1 = 0; __pyx_t_2 = -1; @@ -9377,28 +10633,39 @@ } else if (unlikely(__pyx_t_1 >= __pyx_v_fields.shape[0])) __pyx_t_2 = 0; if (unlikely(__pyx_t_2 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_2); - __PYX_ERR(1, 433, __pyx_L1_error) + __PYX_ERR(1, 447, __pyx_L1_error) } *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_1 * __pyx_v_fields.strides[0]) )) = __pyx_v_domain_ind; - /* "yt/geometry/particle_deposit.pyx":425 + /* "yt/geometry/particle_deposit.pyx":448 + * ) except -1: + * fields[0] = domain_ind + * return 0 # <<<<<<<<<<<<<< + * + * def finalize(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pyx":439 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< * np.float64_t left_edge[3], * np.float64_t dds[3], */ /* function exit code */ - goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.MeshIdentifier.process", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("yt.geometry.particle_deposit.MeshIdentifier.process", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":435 - * fields[0] = domain_ind +/* "yt/geometry/particle_deposit.pyx":450 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * return @@ -9423,7 +10690,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_deposit.pyx":436 + /* "yt/geometry/particle_deposit.pyx":451 * * def finalize(self): * return # <<<<<<<<<<<<<< @@ -9434,8 +10701,8 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/geometry/particle_deposit.pyx":435 - * fields[0] = domain_ind + /* "yt/geometry/particle_deposit.pyx":450 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * return @@ -9449,7 +10716,114 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":443 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_14MeshIdentifier_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_14MeshIdentifier_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_2yt_8geometry_16particle_deposit_14MeshIdentifier_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_MeshIdentifier *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_14MeshIdentifier_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_MeshIdentifier *__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.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, 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("self.sph_kernel 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("yt.geometry.particle_deposit.MeshIdentifier.__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_14MeshIdentifier_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_14MeshIdentifier_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_2yt_8geometry_16particle_deposit_14MeshIdentifier_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_MeshIdentifier *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_14MeshIdentifier_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_MeshIdentifier *__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, 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("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_deposit.MeshIdentifier.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pyx":458 * cdef np.float64_t[:,:,:,:] nnfield * cdef np.float64_t[:,:,:,:] distfield * def initialize(self): # <<<<<<<<<<<<<< @@ -9481,113 +10855,113 @@ __pyx_t_5numpy_float64_t __pyx_t_6; __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_deposit.pyx":445 + /* "yt/geometry/particle_deposit.pyx":460 * def initialize(self): * self.nnfield = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) # <<<<<<<<<<<<<< * self.distfield = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 445, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 460, __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(1, 445, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 460, __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(1, 445, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 445, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 445, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 445, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 445, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 460, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 460, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 445, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 460, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":444 + /* "yt/geometry/particle_deposit.pyx":459 * cdef np.float64_t[:,:,:,:] distfield * def initialize(self): * self.nnfield = append_axes( # <<<<<<<<<<<<<< * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.distfield = append_axes( */ - __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 444, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_4), 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(__pyx_t_3); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 444, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->nnfield, 0); __pyx_v_self->nnfield = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/geometry/particle_deposit.pyx":447 + /* "yt/geometry/particle_deposit.pyx":462 * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.distfield = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) # <<<<<<<<<<<<<< * self.distfield[:] = np.inf * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 447, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 447, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 447, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 447, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 447, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(1, 462, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(1, 462, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 447, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 462, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":446 + /* "yt/geometry/particle_deposit.pyx":461 * self.nnfield = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.distfield = append_axes( # <<<<<<<<<<<<<< * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.distfield[:] = np.inf */ - __pyx_t_1 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_2), 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 446, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_16particle_deposit_append_axes(((PyArrayObject *)__pyx_t_2), 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 446, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->distfield, 0); __pyx_v_self->distfield = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/geometry/particle_deposit.pyx":448 + /* "yt/geometry/particle_deposit.pyx":463 * self.distfield = append_axes( * np.zeros(self.nvals, dtype="float64", order='F'), 4) * self.distfield[:] = np.inf # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 448, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 448, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 448, __pyx_L1_error) + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_v_self->distfield.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 448, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->distfield.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 463, __pyx_L1_error)} { __pyx_t_5numpy_float64_t __pyx_temp_scalar = __pyx_t_6; { @@ -9627,7 +11001,7 @@ } } - /* "yt/geometry/particle_deposit.pyx":443 + /* "yt/geometry/particle_deposit.pyx":458 * cdef np.float64_t[:,:,:,:] nnfield * cdef np.float64_t[:,:,:,:] distfield * def initialize(self): # <<<<<<<<<<<<<< @@ -9652,20 +11026,21 @@ return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":451 +/* "yt/geometry/particle_deposit.pyx":466 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ -static void __pyx_f_2yt_8geometry_16particle_deposit_15NNParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { +static int __pyx_f_2yt_8geometry_16particle_deposit_15NNParticleField_process(struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __Pyx_memviewslice __pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_domain_ind) { int __pyx_v_i; int __pyx_v_j; int __pyx_v_k; __pyx_t_5numpy_float64_t __pyx_v_r2; __pyx_t_5numpy_float64_t __pyx_v_gpos[3]; + int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; @@ -9691,7 +11066,7 @@ long __pyx_t_22; __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_deposit.pyx":465 + /* "yt/geometry/particle_deposit.pyx":480 * cdef np.float64_t r2 * cdef np.float64_t gpos[3] * gpos[0] = left_edge[0] + 0.5 * dds[0] # <<<<<<<<<<<<<< @@ -9700,7 +11075,7 @@ */ (__pyx_v_gpos[0]) = ((__pyx_v_left_edge[0]) + (0.5 * (__pyx_v_dds[0]))); - /* "yt/geometry/particle_deposit.pyx":466 + /* "yt/geometry/particle_deposit.pyx":481 * cdef np.float64_t gpos[3] * gpos[0] = left_edge[0] + 0.5 * dds[0] * for i in range(dim[0]): # <<<<<<<<<<<<<< @@ -9711,7 +11086,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_deposit.pyx":467 + /* "yt/geometry/particle_deposit.pyx":482 * gpos[0] = left_edge[0] + 0.5 * dds[0] * for i in range(dim[0]): * gpos[1] = left_edge[1] + 0.5 * dds[1] # <<<<<<<<<<<<<< @@ -9720,7 +11095,7 @@ */ (__pyx_v_gpos[1]) = ((__pyx_v_left_edge[1]) + (0.5 * (__pyx_v_dds[1]))); - /* "yt/geometry/particle_deposit.pyx":468 + /* "yt/geometry/particle_deposit.pyx":483 * for i in range(dim[0]): * gpos[1] = left_edge[1] + 0.5 * dds[1] * for j in range(dim[1]): # <<<<<<<<<<<<<< @@ -9731,7 +11106,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/geometry/particle_deposit.pyx":469 + /* "yt/geometry/particle_deposit.pyx":484 * gpos[1] = left_edge[1] + 0.5 * dds[1] * for j in range(dim[1]): * gpos[2] = left_edge[2] + 0.5 * dds[2] # <<<<<<<<<<<<<< @@ -9740,7 +11115,7 @@ */ (__pyx_v_gpos[2]) = ((__pyx_v_left_edge[2]) + (0.5 * (__pyx_v_dds[2]))); - /* "yt/geometry/particle_deposit.pyx":470 + /* "yt/geometry/particle_deposit.pyx":485 * for j in range(dim[1]): * gpos[2] = left_edge[2] + 0.5 * dds[2] * for k in range(dim[2]): # <<<<<<<<<<<<<< @@ -9751,7 +11126,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "yt/geometry/particle_deposit.pyx":472 + /* "yt/geometry/particle_deposit.pyx":487 * for k in range(dim[2]): * r2 = ((ppos[0] - gpos[0])*(ppos[0] - gpos[0]) + * (ppos[1] - gpos[1])*(ppos[1] - gpos[1]) + # <<<<<<<<<<<<<< @@ -9760,14 +11135,14 @@ */ __pyx_v_r2 = (((((__pyx_v_ppos[0]) - (__pyx_v_gpos[0])) * ((__pyx_v_ppos[0]) - (__pyx_v_gpos[0]))) + (((__pyx_v_ppos[1]) - (__pyx_v_gpos[1])) * ((__pyx_v_ppos[1]) - (__pyx_v_gpos[1])))) + (((__pyx_v_ppos[2]) - (__pyx_v_gpos[2])) * ((__pyx_v_ppos[2]) - (__pyx_v_gpos[2])))); - /* "yt/geometry/particle_deposit.pyx":474 + /* "yt/geometry/particle_deposit.pyx":489 * (ppos[1] - gpos[1])*(ppos[1] - gpos[1]) + * (ppos[2] - gpos[2])*(ppos[2] - gpos[2])) * if r2 < self.distfield[k,j,i,offset]: # <<<<<<<<<<<<<< * self.distfield[k,j,i,offset] = r2 * self.nnfield[k,j,i,offset] = fields[0] */ - if (unlikely(!__pyx_v_self->distfield.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 474, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->distfield.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 489, __pyx_L1_error)} __pyx_t_7 = __pyx_v_k; __pyx_t_8 = __pyx_v_j; __pyx_t_9 = __pyx_v_i; @@ -9791,19 +11166,19 @@ } else if (unlikely(__pyx_t_10 >= __pyx_v_self->distfield.shape[3])) __pyx_t_11 = 3; if (unlikely(__pyx_t_11 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_11); - __PYX_ERR(1, 474, __pyx_L1_error) + __PYX_ERR(1, 489, __pyx_L1_error) } __pyx_t_12 = ((__pyx_v_r2 < (*((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->distfield.data + __pyx_t_7 * __pyx_v_self->distfield.strides[0]) ) + __pyx_t_8 * __pyx_v_self->distfield.strides[1]) ) + __pyx_t_9 * __pyx_v_self->distfield.strides[2]) ) + __pyx_t_10 * __pyx_v_self->distfield.strides[3]) )))) != 0); if (__pyx_t_12) { - /* "yt/geometry/particle_deposit.pyx":475 + /* "yt/geometry/particle_deposit.pyx":490 * (ppos[2] - gpos[2])*(ppos[2] - gpos[2])) * if r2 < self.distfield[k,j,i,offset]: * self.distfield[k,j,i,offset] = r2 # <<<<<<<<<<<<<< * self.nnfield[k,j,i,offset] = fields[0] * gpos[2] += dds[2] */ - if (unlikely(!__pyx_v_self->distfield.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 475, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->distfield.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 490, __pyx_L1_error)} __pyx_t_13 = __pyx_v_k; __pyx_t_14 = __pyx_v_j; __pyx_t_15 = __pyx_v_i; @@ -9827,11 +11202,11 @@ } else if (unlikely(__pyx_t_16 >= __pyx_v_self->distfield.shape[3])) __pyx_t_11 = 3; if (unlikely(__pyx_t_11 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_11); - __PYX_ERR(1, 475, __pyx_L1_error) + __PYX_ERR(1, 490, __pyx_L1_error) } *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->distfield.data + __pyx_t_13 * __pyx_v_self->distfield.strides[0]) ) + __pyx_t_14 * __pyx_v_self->distfield.strides[1]) ) + __pyx_t_15 * __pyx_v_self->distfield.strides[2]) ) + __pyx_t_16 * __pyx_v_self->distfield.strides[3]) )) = __pyx_v_r2; - /* "yt/geometry/particle_deposit.pyx":476 + /* "yt/geometry/particle_deposit.pyx":491 * if r2 < self.distfield[k,j,i,offset]: * self.distfield[k,j,i,offset] = r2 * self.nnfield[k,j,i,offset] = fields[0] # <<<<<<<<<<<<<< @@ -9846,9 +11221,9 @@ } else if (unlikely(__pyx_t_17 >= __pyx_v_fields.shape[0])) __pyx_t_11 = 0; if (unlikely(__pyx_t_11 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_11); - __PYX_ERR(1, 476, __pyx_L1_error) + __PYX_ERR(1, 491, __pyx_L1_error) } - if (unlikely(!__pyx_v_self->nnfield.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 476, __pyx_L1_error)} + if (unlikely(!__pyx_v_self->nnfield.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 491, __pyx_L1_error)} __pyx_t_18 = __pyx_v_k; __pyx_t_19 = __pyx_v_j; __pyx_t_20 = __pyx_v_i; @@ -9872,11 +11247,11 @@ } else if (unlikely(__pyx_t_21 >= __pyx_v_self->nnfield.shape[3])) __pyx_t_11 = 3; if (unlikely(__pyx_t_11 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_11); - __PYX_ERR(1, 476, __pyx_L1_error) + __PYX_ERR(1, 491, __pyx_L1_error) } *((__pyx_t_5numpy_float64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->nnfield.data + __pyx_t_18 * __pyx_v_self->nnfield.strides[0]) ) + __pyx_t_19 * __pyx_v_self->nnfield.strides[1]) ) + __pyx_t_20 * __pyx_v_self->nnfield.strides[2]) ) + __pyx_t_21 * __pyx_v_self->nnfield.strides[3]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_fields.data + __pyx_t_17 * __pyx_v_fields.strides[0]) ))); - /* "yt/geometry/particle_deposit.pyx":474 + /* "yt/geometry/particle_deposit.pyx":489 * (ppos[1] - gpos[1])*(ppos[1] - gpos[1]) + * (ppos[2] - gpos[2])*(ppos[2] - gpos[2])) * if r2 < self.distfield[k,j,i,offset]: # <<<<<<<<<<<<<< @@ -9885,7 +11260,7 @@ */ } - /* "yt/geometry/particle_deposit.pyx":477 + /* "yt/geometry/particle_deposit.pyx":492 * self.distfield[k,j,i,offset] = r2 * self.nnfield[k,j,i,offset] = fields[0] * gpos[2] += dds[2] # <<<<<<<<<<<<<< @@ -9896,54 +11271,57 @@ (__pyx_v_gpos[__pyx_t_22]) = ((__pyx_v_gpos[__pyx_t_22]) + (__pyx_v_dds[2])); } - /* "yt/geometry/particle_deposit.pyx":478 + /* "yt/geometry/particle_deposit.pyx":493 * self.nnfield[k,j,i,offset] = fields[0] * gpos[2] += dds[2] * gpos[1] += dds[1] # <<<<<<<<<<<<<< * gpos[0] += dds[0] - * return + * return 0 */ __pyx_t_22 = 1; (__pyx_v_gpos[__pyx_t_22]) = ((__pyx_v_gpos[__pyx_t_22]) + (__pyx_v_dds[1])); } - /* "yt/geometry/particle_deposit.pyx":479 + /* "yt/geometry/particle_deposit.pyx":494 * gpos[2] += dds[2] * gpos[1] += dds[1] * gpos[0] += dds[0] # <<<<<<<<<<<<<< - * return + * return 0 * */ __pyx_t_22 = 0; (__pyx_v_gpos[__pyx_t_22]) = ((__pyx_v_gpos[__pyx_t_22]) + (__pyx_v_dds[0])); } - /* "yt/geometry/particle_deposit.pyx":480 + /* "yt/geometry/particle_deposit.pyx":495 * gpos[1] += dds[1] * gpos[0] += dds[0] - * return # <<<<<<<<<<<<<< + * return 0 # <<<<<<<<<<<<<< * * def finalize(self): */ + __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pyx":451 + /* "yt/geometry/particle_deposit.pyx":466 * * @cython.cdivision(True) - * cdef void process(self, int dim[3], # <<<<<<<<<<<<<< - * np.float64_t left_edge[3], - * np.float64_t dds[3], + * cdef int process(self, int dim[3], # <<<<<<<<<<<<<< + * np.float64_t left_edge[3], + * np.float64_t dds[3], */ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.NNParticleField.process", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("yt.geometry.particle_deposit.NNParticleField.process", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/particle_deposit.pyx":482 - * return +/* "yt/geometry/particle_deposit.pyx":497 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * nn = np.asarray(self.nnfield) @@ -9974,20 +11352,20 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_deposit.pyx":483 + /* "yt/geometry/particle_deposit.pyx":498 * * def finalize(self): * nn = np.asarray(self.nnfield) # <<<<<<<<<<<<<< * nn.shape = self.nvals * return nn */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 498, __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(1, 483, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_v_self->nnfield.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 483, __pyx_L1_error)} - __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->nnfield, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error) + if (unlikely(!__pyx_v_self->nnfield.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 498, __pyx_L1_error)} + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->nnfield, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -10000,14 +11378,14 @@ } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __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(1, 483, __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(1, 498, __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; @@ -10016,20 +11394,20 @@ #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(1, 483, __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(1, 498, __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(1, 483, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 498, __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(1, 483, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -10038,7 +11416,7 @@ __pyx_v_nn = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":484 + /* "yt/geometry/particle_deposit.pyx":499 * def finalize(self): * nn = np.asarray(self.nnfield) * nn.shape = self.nvals # <<<<<<<<<<<<<< @@ -10047,10 +11425,10 @@ */ __pyx_t_1 = __pyx_v_self->__pyx_base.nvals; __Pyx_INCREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(1, 484, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pyx":485 + /* "yt/geometry/particle_deposit.pyx":500 * nn = np.asarray(self.nnfield) * nn.shape = self.nvals * return nn # <<<<<<<<<<<<<< @@ -10062,8 +11440,8 @@ __pyx_r = __pyx_v_nn; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pyx":482 - * return + /* "yt/geometry/particle_deposit.pyx":497 + * return 0 * * def finalize(self): # <<<<<<<<<<<<<< * nn = np.asarray(self.nnfield) @@ -10086,830 +11464,1641 @@ return __pyx_r; } -/* "cpython/array.pxd":91 - * __data_union data - * - * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_15NNParticleField_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_15NNParticleField_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_16particle_deposit_15NNParticleField_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) { - PyObject *__pyx_v_item_count = NULL; - int __pyx_r; +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_15NNParticleField_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *__pyx_v_self) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - char *__pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - int __pyx_t_6; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "cpython/array.pxd":96 - * # In particular strided access is always provided regardless - * # of flags - * item_count = Py_SIZE(self) # <<<<<<<<<<<<<< - * - * info.suboffsets = NULL + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") */ - __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 96, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_item_count = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 2, __pyx_L1_error) - /* "cpython/array.pxd":98 - * item_count = Py_SIZE(self) - * - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.buf = self.data.as_chars - * info.readonly = 0 + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_v_info->suboffsets = NULL; - /* "cpython/array.pxd":99 - * - * info.suboffsets = NULL - * info.buf = self.data.as_chars # <<<<<<<<<<<<<< - * info.readonly = 0 - * info.ndim = 1 - */ - __pyx_t_2 = __pyx_v_self->data.as_chars; - __pyx_v_info->buf = __pyx_t_2; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_deposit.NNParticleField.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "cpython/array.pxd":100 - * info.suboffsets = NULL - * info.buf = self.data.as_chars - * info.readonly = 0 # <<<<<<<<<<<<<< - * info.ndim = 1 - * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") */ - __pyx_v_info->readonly = 0; - /* "cpython/array.pxd":101 - * info.buf = self.data.as_chars - * info.readonly = 0 - * info.ndim = 1 # <<<<<<<<<<<<<< - * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) - * info.len = info.itemsize * item_count - */ - __pyx_v_info->ndim = 1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_15NNParticleField_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_16particle_deposit_15NNParticleField_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_2yt_8geometry_16particle_deposit_15NNParticleField_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "cpython/array.pxd":102 - * info.readonly = 0 - * info.ndim = 1 - * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<< - * info.len = info.itemsize * item_count - * - */ - __pyx_t_3 = __pyx_v_self->ob_descr->itemsize; - __pyx_v_info->itemsize = __pyx_t_3; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "cpython/array.pxd":103 - * info.ndim = 1 - * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) - * info.len = info.itemsize * item_count # <<<<<<<<<<<<<< - * - * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) +static PyObject *__pyx_pf_2yt_8geometry_16particle_deposit_15NNParticleField_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *__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.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 103, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 103, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_info->len = __pyx_t_5; + __PYX_ERR(2, 4, __pyx_L1_error) - /* "cpython/array.pxd":105 - * info.len = info.itemsize * item_count - * - * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<< - * if not info.shape: - * raise MemoryError() + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") */ - __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2))); - /* "cpython/array.pxd":106 + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_deposit.NNParticleField.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * - * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) - * if not info.shape: # <<<<<<<<<<<<<< - * raise MemoryError() - * info.shape[0] = item_count # constant regardless of resizing + * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): */ - __pyx_t_6 = ((!(__pyx_v_info->shape != 0)) != 0); - if (__pyx_t_6) { - /* "cpython/array.pxd":107 - * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) - * if not info.shape: - * raise MemoryError() # <<<<<<<<<<<<<< - * info.shape[0] = item_count # constant regardless of resizing - * info.strides = &info.itemsize - */ - PyErr_NoMemory(); __PYX_ERR(2, 107, __pyx_L1_error) +static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_ensure_code", 0); - /* "cpython/array.pxd":106 + /* "selection_routines.pxd":23 * - * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) - * if not info.shape: # <<<<<<<<<<<<<< - * raise MemoryError() - * info.shape[0] = item_count # constant regardless of resizing + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): # <<<<<<<<<<<<<< + * if "code_length" == str(arr.units): + * return arr */ - } + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 23, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "cpython/array.pxd":108 - * if not info.shape: - * raise MemoryError() - * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<< - * info.strides = &info.itemsize - * + /* "selection_routines.pxd":24 + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< + * return arr + * arr.convert_to_units("code_length") */ - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_item_count); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 108, __pyx_L1_error) - (__pyx_v_info->shape[0]) = __pyx_t_5; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 24, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { - /* "cpython/array.pxd":109 - * raise MemoryError() - * info.shape[0] = item_count # constant regardless of resizing - * info.strides = &info.itemsize # <<<<<<<<<<<<<< - * - * info.format = (info.shape + 1) + /* "selection_routines.pxd":25 + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): + * return arr # <<<<<<<<<<<<<< + * arr.convert_to_units("code_length") + * return arr */ - __pyx_v_info->strides = (&__pyx_v_info->itemsize); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; - /* "cpython/array.pxd":111 - * info.strides = &info.itemsize - * - * info.format = (info.shape + 1) # <<<<<<<<<<<<<< - * info.format[0] = self.ob_descr.typecode - * info.format[1] = 0 + /* "selection_routines.pxd":24 + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< + * return arr + * arr.convert_to_units("code_length") */ - __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1)); + } - /* "cpython/array.pxd":112 + /* "selection_routines.pxd":26 + * if "code_length" == str(arr.units): + * return arr + * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< + * return arr * - * info.format = (info.shape + 1) - * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<< - * info.format[1] = 0 - * info.obj = self */ - __pyx_t_3 = __pyx_v_self->ob_descr->typecode; - (__pyx_v_info->format[0]) = __pyx_t_3; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "cpython/array.pxd":113 - * info.format = (info.shape + 1) - * info.format[0] = self.ob_descr.typecode - * info.format[1] = 0 # <<<<<<<<<<<<<< - * info.obj = self + /* "selection_routines.pxd":23 * + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): # <<<<<<<<<<<<<< + * if "code_length" == str(arr.units): + * return arr */ - (__pyx_v_info->format[1]) = 0; + } - /* "cpython/array.pxd":114 - * info.format[0] = self.ob_descr.typecode - * info.format[1] = 0 - * info.obj = self # <<<<<<<<<<<<<< + /* "selection_routines.pxd":27 + * return arr + * arr.convert_to_units("code_length") + * return arr # <<<<<<<<<<<<<< * - * def __releasebuffer__(self, Py_buffer* info): + * cdef class SelectorObject: */ - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; - /* "cpython/array.pxd":91 - * __data_union data + /* "selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * - * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; + __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF(__pyx_v_item_count); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "cpython/array.pxd":116 - * info.obj = self - * - * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<< - * PyObject_Free(info.shape) +/* "selection_routines.pxd":78 + * cdef public SelectorObject sel2 * + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 */ -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__", 0); +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) { + __pyx_t_5numpy_float64_t __pyx_v_rel; + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; - /* "cpython/array.pxd":117 - * - * def __releasebuffer__(self, Py_buffer* info): - * PyObject_Free(info.shape) # <<<<<<<<<<<<<< - * - * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr) + /* "selection_routines.pxd":80 + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< + * if not periodic: return rel + * if rel > dw * 0.5: */ - PyObject_Free(__pyx_v_info->shape); + __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); - /* "cpython/array.pxd":116 - * info.obj = self - * - * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<< - * PyObject_Free(info.shape) - * + /* "selection_routines.pxd":81 + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel # <<<<<<<<<<<<<< + * if rel > dw * 0.5: + * rel -= dw */ + __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_rel; + goto __pyx_L0; + } - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "cpython/array.pxd":128 - * - * - * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<< - * """ fast creation of a new array, given a template array. - * type will be same as template. + /* "selection_routines.pxd":82 + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel + * if rel > dw * 0.5: # <<<<<<<<<<<<<< + * rel -= dw + * elif rel < -dw * 0.5: */ + __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0); + if (__pyx_t_1) { -static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) { - arrayobject *__pyx_v_op = NULL; - arrayobject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("clone", 0); - - /* "cpython/array.pxd":132 - * type will be same as template. - * if zero is true, new array will be initialized with zeroes.""" - * op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<< - * if zero and op is not None: - * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) + /* "selection_routines.pxd":83 + * if not periodic: return rel + * if rel > dw * 0.5: + * rel -= dw # <<<<<<<<<<<<<< + * elif rel < -dw * 0.5: + * rel += dw */ - __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_template)), __pyx_v_length, __pyx_v_template->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_op = ((arrayobject *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw); - /* "cpython/array.pxd":133 - * if zero is true, new array will be initialized with zeroes.""" - * op = newarrayobject(Py_TYPE(template), length, template.ob_descr) - * if zero and op is not None: # <<<<<<<<<<<<<< - * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) - * return op + /* "selection_routines.pxd":82 + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel + * if rel > dw * 0.5: # <<<<<<<<<<<<<< + * rel -= dw + * elif rel < -dw * 0.5: */ - __pyx_t_3 = (__pyx_v_zero != 0); - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L4_bool_binop_done; + goto __pyx_L4; } - __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None); - __pyx_t_4 = (__pyx_t_3 != 0); - __pyx_t_2 = __pyx_t_4; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - /* "cpython/array.pxd":134 - * op = newarrayobject(Py_TYPE(template), length, template.ob_descr) - * if zero and op is not None: - * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<< - * return op - * + /* "selection_routines.pxd":84 + * if rel > dw * 0.5: + * rel -= dw + * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< + * rel += dw + * return rel */ - memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize)); + __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0); + if (__pyx_t_1) { - /* "cpython/array.pxd":133 - * if zero is true, new array will be initialized with zeroes.""" - * op = newarrayobject(Py_TYPE(template), length, template.ob_descr) - * if zero and op is not None: # <<<<<<<<<<<<<< - * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) - * return op + /* "selection_routines.pxd":85 + * rel -= dw + * elif rel < -dw * 0.5: + * rel += dw # <<<<<<<<<<<<<< + * return rel + */ + __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw); + + /* "selection_routines.pxd":84 + * if rel > dw * 0.5: + * rel -= dw + * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< + * rel += dw + * return rel */ } + __pyx_L4:; - /* "cpython/array.pxd":135 - * if zero and op is not None: - * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) - * return op # <<<<<<<<<<<<<< - * - * cdef inline array copy(array self): + /* "selection_routines.pxd":86 + * elif rel < -dw * 0.5: + * rel += dw + * return rel # <<<<<<<<<<<<<< */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_op)); - __pyx_r = __pyx_v_op; + __pyx_r = __pyx_v_rel; goto __pyx_L0; - /* "cpython/array.pxd":128 - * + /* "selection_routines.pxd":78 + * cdef public SelectorObject sel2 * - * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<< - * """ fast creation of a new array, given a template array. - * type will be same as template. + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_op); - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "cpython/array.pxd":137 - * return op +/* "yt/geometry/particle_deposit.pxd":29 + * void *alloca(int) * - * cdef inline array copy(array self): # <<<<<<<<<<<<<< - * """ make a copy of an array. """ - * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) + * cdef inline int gind(int i, int j, int k, int dims[3]): # <<<<<<<<<<<<<< + * # The ordering is such that we want i to vary the slowest in this instance, + * # even though in other instances it varies the fastest. To see this in */ -static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) { - arrayobject *__pyx_v_op = NULL; - arrayobject *__pyx_r = NULL; +static CYTHON_INLINE int __pyx_f_2yt_8geometry_16particle_deposit_gind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dims) { + int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("copy", 0); - - /* "cpython/array.pxd":139 - * cdef inline array copy(array self): - * """ make a copy of an array. """ - * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<< - * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) - * return op - */ - __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_self)), Py_SIZE(((PyObject *)__pyx_v_self)), __pyx_v_self->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_op = ((arrayobject *)__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_RefNannySetupContext("gind", 0); - /* "cpython/array.pxd":140 - * """ make a copy of an array. """ - * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) - * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<< - * return op + /* "yt/geometry/particle_deposit.pxd":34 + * # action, try looking at the results of an n_ref=256 particle CIC plot, + * # which shows it the most clearly. + * return ((i*dims[1])+j)*dims[2]+k # <<<<<<<<<<<<<< * - */ - memcpy(__pyx_v_op->data.as_chars, __pyx_v_self->data.as_chars, (Py_SIZE(((PyObject *)__pyx_v_op)) * __pyx_v_op->ob_descr->itemsize)); - - /* "cpython/array.pxd":141 - * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) - * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) - * return op # <<<<<<<<<<<<<< * - * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_op)); - __pyx_r = __pyx_v_op; + __pyx_r = ((((__pyx_v_i * (__pyx_v_dims[1])) + __pyx_v_j) * (__pyx_v_dims[2])) + __pyx_v_k); goto __pyx_L0; - /* "cpython/array.pxd":137 - * return op + /* "yt/geometry/particle_deposit.pxd":29 + * void *alloca(int) * - * cdef inline array copy(array self): # <<<<<<<<<<<<<< - * """ make a copy of an array. """ - * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) + * cdef inline int gind(int i, int j, int k, int dims[3]): # <<<<<<<<<<<<<< + * # The ordering is such that we want i to vary the slowest in this instance, + * # even though in other instances it varies the fastest. To see this in */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_op); - __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "cpython/array.pxd":143 - * return op +/* "yt/geometry/particle_deposit.pxd":41 + * #################################################### * - * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<< - * """ efficent appending of new stuff of same type - * (e.g. of same array type) + * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 */ -static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) { - Py_ssize_t __pyx_v_itemsize; - Py_ssize_t __pyx_v_origsize; - int __pyx_r; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - __Pyx_RefNannySetupContext("extend_buffer", 0); - - /* "cpython/array.pxd":147 - * (e.g. of same array type) - * n: number of elements (not number of bytes!) """ - * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<< - * cdef Py_ssize_t origsize = Py_SIZE(self) - * resize_smart(self, origsize + n) - */ - __pyx_t_1 = __pyx_v_self->ob_descr->itemsize; - __pyx_v_itemsize = __pyx_t_1; + int __pyx_t_2; - /* "cpython/array.pxd":148 - * n: number of elements (not number of bytes!) """ - * cdef Py_ssize_t itemsize = self.ob_descr.itemsize - * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<< - * resize_smart(self, origsize + n) - * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) + /* "yt/geometry/particle_deposit.pxd":43 + * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 # <<<<<<<<<<<<<< + * if x <= 0.5: + * kernel = 1.-6.*x*x*(1.-x) */ - __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self)); + __pyx_v_C = 2.5464790894703255; - /* "cpython/array.pxd":149 - * cdef Py_ssize_t itemsize = self.ob_descr.itemsize - * cdef Py_ssize_t origsize = Py_SIZE(self) - * resize_smart(self, origsize + n) # <<<<<<<<<<<<<< - * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) - * return 0 + /* "yt/geometry/particle_deposit.pxd":44 + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 + * if x <= 0.5: # <<<<<<<<<<<<<< + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: */ - __pyx_t_1 = resize_smart(__pyx_v_self, (__pyx_v_origsize + __pyx_v_n)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_t_1 = ((__pyx_v_x <= 0.5) != 0); + if (__pyx_t_1) { - /* "cpython/array.pxd":150 - * cdef Py_ssize_t origsize = Py_SIZE(self) - * resize_smart(self, origsize + n) - * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<< - * return 0 - * + /* "yt/geometry/particle_deposit.pxd":45 + * cdef np.float64_t C = 2.5464790894703255 + * if x <= 0.5: + * kernel = 1.-6.*x*x*(1.-x) # <<<<<<<<<<<<<< + * elif x>0.5 and x<=1.0: + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) */ - memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize)); + __pyx_v_kernel = (1. - (((6. * __pyx_v_x) * __pyx_v_x) * (1. - __pyx_v_x))); - /* "cpython/array.pxd":151 - * resize_smart(self, origsize + n) - * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) - * return 0 # <<<<<<<<<<<<<< - * - * cdef inline int extend(array self, array other) except -1: + /* "yt/geometry/particle_deposit.pxd":44 + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 + * if x <= 0.5: # <<<<<<<<<<<<<< + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: */ - __pyx_r = 0; - goto __pyx_L0; + goto __pyx_L3; + } - /* "cpython/array.pxd":143 - * return op - * - * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<< - * """ efficent appending of new stuff of same type - * (e.g. of same array type) + /* "yt/geometry/particle_deposit.pxd":46 + * if x <= 0.5: + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: # <<<<<<<<<<<<<< + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) + * else: */ + __pyx_t_2 = ((__pyx_v_x > 0.5) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_x <= 1.0) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "cpython/array.pxd":153 - * return 0 - * - * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<< - * """ extend array with data from another array; types must match. """ - * if self.ob_descr.typecode != other.ob_descr.typecode: + /* "yt/geometry/particle_deposit.pxd":47 + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) # <<<<<<<<<<<<<< + * else: + * kernel = 0. */ + __pyx_v_kernel = (((2. * (1. - __pyx_v_x)) * (1. - __pyx_v_x)) * (1. - __pyx_v_x)); -static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("extend", 0); - - /* "cpython/array.pxd":155 - * cdef inline int extend(array self, array other) except -1: - * """ extend array with data from another array; types must match. """ - * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<< - * PyErr_BadArgument() - * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) + /* "yt/geometry/particle_deposit.pxd":46 + * if x <= 0.5: + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: # <<<<<<<<<<<<<< + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) + * else: */ - __pyx_t_1 = ((__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode) != 0); - if (__pyx_t_1) { + goto __pyx_L3; + } - /* "cpython/array.pxd":156 - * """ extend array with data from another array; types must match. """ - * if self.ob_descr.typecode != other.ob_descr.typecode: - * PyErr_BadArgument() # <<<<<<<<<<<<<< - * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) + /* "yt/geometry/particle_deposit.pxd":49 + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C * */ - __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 156, __pyx_L1_error) - - /* "cpython/array.pxd":155 - * cdef inline int extend(array self, array other) except -1: - * """ extend array with data from another array; types must match. """ - * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<< - * PyErr_BadArgument() - * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) - */ + /*else*/ { + __pyx_v_kernel = 0.; } + __pyx_L3:; - /* "cpython/array.pxd":157 - * if self.ob_descr.typecode != other.ob_descr.typecode: - * PyErr_BadArgument() - * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<< + /* "yt/geometry/particle_deposit.pxd":50 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< * - * cdef inline void zero(array self): + * ######################################################## */ - __pyx_t_2 = __pyx_f_7cpython_5array_extend_buffer(__pyx_v_self, __pyx_v_other->data.as_chars, Py_SIZE(((PyObject *)__pyx_v_other))); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 157, __pyx_L1_error) - __pyx_r = __pyx_t_2; + __pyx_r = (__pyx_v_kernel * __pyx_v_C); goto __pyx_L0; - /* "cpython/array.pxd":153 - * return 0 + /* "yt/geometry/particle_deposit.pxd":41 + * #################################################### * - * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<< - * """ extend array with data from another array; types must match. """ - * if self.ob_descr.typecode != other.ob_descr.typecode: + * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 */ /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "cpython/array.pxd":159 - * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) +/* "yt/geometry/particle_deposit.pxd":57 * - * cdef inline void zero(array self): # <<<<<<<<<<<<<< - * """ set all elements of array to zero. """ - * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) + * # quartic spline + * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi */ -static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) { +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("zero", 0); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_quartic", 0); - /* "cpython/array.pxd":161 - * cdef inline void zero(array self): - * """ set all elements of array to zero. """ - * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<< + /* "yt/geometry/particle_deposit.pxd":59 + * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**4 */ - memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize)); + __pyx_t_1 = PyFloat_FromDouble((pow(5., 6.0) / 512.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __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, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; - /* "cpython/array.pxd":159 - * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) - * - * cdef inline void zero(array self): # <<<<<<<<<<<<<< - * """ set all elements of array to zero. """ - * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) + /* "yt/geometry/particle_deposit.pxd":60 + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**4 + * if x < 3./5: */ + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "yt/geometry/particle_deposit.pxd":61 + * cdef np.float64_t C = 5.**6/512/np.pi + * if x < 1: + * kernel = (1.-x)**4 # <<<<<<<<<<<<<< + * if x < 3./5: + * kernel -= 5*(3./5-x)**4 */ + __pyx_v_kernel = pow((1. - __pyx_v_x), 4.0); -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim + /* "yt/geometry/particle_deposit.pxd":62 + * if x < 1: + * kernel = (1.-x)**4 + * if x < 3./5: # <<<<<<<<<<<<<< + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } + __pyx_t_5 = ((__pyx_v_x < (3. / 5.0)) != 0); + if (__pyx_t_5) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * + /* "yt/geometry/particle_deposit.pxd":63 + * kernel = (1.-x)**4 + * if x < 3./5: + * kernel -= 5*(3./5-x)**4 # <<<<<<<<<<<<<< + * if x < 1./5: + * kernel += 10*(1./5-x)**4 */ - __pyx_v_endian_detector = 1; + __pyx_v_kernel = (__pyx_v_kernel - (5.0 * pow(((3. / 5.0) - __pyx_v_x), 4.0))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) + /* "yt/geometry/particle_deposit.pxd":64 + * if x < 3./5: + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: # <<<<<<<<<<<<<< + * kernel += 10*(1./5-x)**4 + * else: */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_5 = ((__pyx_v_x < (1. / 5.0)) != 0); + if (__pyx_t_5) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "yt/geometry/particle_deposit.pxd":65 + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: + * kernel += 10*(1./5-x)**4 # <<<<<<<<<<<<<< + * else: + * kernel = 0. */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + __pyx_v_kernel = (__pyx_v_kernel + (10.0 * pow(((1. / 5.0) - __pyx_v_x), 4.0))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "yt/geometry/particle_deposit.pxd":64 + * if x < 3./5: + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: # <<<<<<<<<<<<<< + * kernel += 10*(1./5-x)**4 + * else: */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + /* "yt/geometry/particle_deposit.pxd":62 + * if x < 1: + * kernel = (1.-x)**4 + * if x < 3./5: # <<<<<<<<<<<<<< + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: */ - __pyx_v_copy_shape = 1; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "yt/geometry/particle_deposit.pxd":60 + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**4 + * if x < 3./5: */ - goto __pyx_L4; + goto __pyx_L3; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< + /* "yt/geometry/particle_deposit.pxd":67 + * kernel += 10*(1./5-x)**4 + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ /*else*/ { - __pyx_v_copy_shape = 0; + __pyx_v_kernel = 0.; } - __pyx_L4:; + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "yt/geometry/particle_deposit.pxd":68 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< * - * 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") + * # quintic spline */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") + /* "yt/geometry/particle_deposit.pxd":57 * + * # quartic spline + * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - if (__pyx_t_1) { + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quartic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< +/* "yt/geometry/particle_deposit.pxd":71 * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * # quintic spline + * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 218, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - } +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_quintic", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "yt/geometry/particle_deposit.pxd":73 + * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**5 + */ + __pyx_t_1 = PyFloat_FromDouble((pow(3., 7.0) / 40.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __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, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; + + /* "yt/geometry/particle_deposit.pxd":74 + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**5 + * if x < 2./3: + */ + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":75 + * cdef np.float64_t C = 3.**7/40/np.pi + * if x < 1: + * kernel = (1.-x)**5 # <<<<<<<<<<<<<< + * if x < 2./3: + * kernel -= 6*(2./3-x)**5 + */ + __pyx_v_kernel = pow((1. - __pyx_v_x), 5.0); + + /* "yt/geometry/particle_deposit.pxd":76 + * if x < 1: + * kernel = (1.-x)**5 + * if x < 2./3: # <<<<<<<<<<<<<< + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: + */ + __pyx_t_5 = ((__pyx_v_x < (2. / 3.0)) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":77 + * kernel = (1.-x)**5 + * if x < 2./3: + * kernel -= 6*(2./3-x)**5 # <<<<<<<<<<<<<< + * if x < 1./3: + * kernel += 15*(1./3-x)**5 + */ + __pyx_v_kernel = (__pyx_v_kernel - (6.0 * pow(((2. / 3.0) - __pyx_v_x), 5.0))); + + /* "yt/geometry/particle_deposit.pxd":78 + * if x < 2./3: + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: # <<<<<<<<<<<<<< + * kernel += 15*(1./3-x)**5 + * else: + */ + __pyx_t_5 = ((__pyx_v_x < (1. / 3.0)) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":79 + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: + * kernel += 15*(1./3-x)**5 # <<<<<<<<<<<<<< + * else: + * kernel = 0. + */ + __pyx_v_kernel = (__pyx_v_kernel + (15.0 * pow(((1. / 3.0) - __pyx_v_x), 5.0))); + + /* "yt/geometry/particle_deposit.pxd":78 + * if x < 2./3: + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: # <<<<<<<<<<<<<< + * kernel += 15*(1./3-x)**5 + * else: + */ + } + + /* "yt/geometry/particle_deposit.pxd":76 + * if x < 1: + * kernel = (1.-x)**5 + * if x < 2./3: # <<<<<<<<<<<<<< + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: + */ + } + + /* "yt/geometry/particle_deposit.pxd":74 + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**5 + * if x < 2./3: + */ + goto __pyx_L3; + } + + /* "yt/geometry/particle_deposit.pxd":81 + * kernel += 15*(1./3-x)**5 + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C + * + */ + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; + + /* "yt/geometry/particle_deposit.pxd":82 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< + * + * # Wendland C2 + */ + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":71 + * + * # quintic spline + * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quintic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pxd":85 + * + * # Wendland C2 + * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_wendland2", 0); + + /* "yt/geometry/particle_deposit.pxd":87 + * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**4 * (1+4*x) + */ + __pyx_t_1 = PyFloat_FromDouble((21. / 2.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __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, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; + + /* "yt/geometry/particle_deposit.pxd":88 + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**4 * (1+4*x) + * else: + */ + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":89 + * cdef np.float64_t C = 21./2/np.pi + * if x < 1: + * kernel = (1.-x)**4 * (1+4*x) # <<<<<<<<<<<<<< + * else: + * kernel = 0. + */ + __pyx_v_kernel = (pow((1. - __pyx_v_x), 4.0) * (1.0 + (4.0 * __pyx_v_x))); + + /* "yt/geometry/particle_deposit.pxd":88 + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**4 * (1+4*x) + * else: + */ + goto __pyx_L3; + } + + /* "yt/geometry/particle_deposit.pxd":91 + * kernel = (1.-x)**4 * (1+4*x) + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C + * + */ + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; + + /* "yt/geometry/particle_deposit.pxd":92 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< + * + * # Wendland C4 + */ + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":85 + * + * # Wendland C2 + * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland2", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pxd":95 + * + * # Wendland C4 + * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_wendland4", 0); + + /* "yt/geometry/particle_deposit.pxd":97 + * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) + */ + __pyx_t_1 = PyFloat_FromDouble((495. / 32.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __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, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; + + /* "yt/geometry/particle_deposit.pxd":98 + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) + * else: + */ + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":99 + * cdef np.float64_t C = 495./32/np.pi + * if x < 1: + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) # <<<<<<<<<<<<<< + * else: + * kernel = 0. + */ + __pyx_v_kernel = (pow((1. - __pyx_v_x), 6.0) * ((1.0 + (6.0 * __pyx_v_x)) + ((35. / 3.0) * pow(__pyx_v_x, 2.0)))); + + /* "yt/geometry/particle_deposit.pxd":98 + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) + * else: + */ + goto __pyx_L3; + } + + /* "yt/geometry/particle_deposit.pxd":101 + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C + * + */ + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; + + /* "yt/geometry/particle_deposit.pxd":102 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< + * + * # Wendland C6 + */ + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":95 + * + * # Wendland C4 + * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland4", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pxd":105 + * + * # Wendland C6 + * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_wendland6", 0); + + /* "yt/geometry/particle_deposit.pxd":107 + * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + */ + __pyx_t_1 = PyFloat_FromDouble((1365. / 64.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __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, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; + + /* "yt/geometry/particle_deposit.pxd":108 + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + * else: + */ + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { + + /* "yt/geometry/particle_deposit.pxd":109 + * cdef np.float64_t C = 1365./64/np.pi + * if x < 1: + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) # <<<<<<<<<<<<<< + * else: + * kernel = 0. + */ + __pyx_v_kernel = (pow((1. - __pyx_v_x), 8.0) * (((1.0 + (8.0 * __pyx_v_x)) + (25.0 * pow(__pyx_v_x, 2.0))) + (32.0 * pow(__pyx_v_x, 3.0)))); + + /* "yt/geometry/particle_deposit.pxd":108 + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + * else: + */ + goto __pyx_L3; + } + + /* "yt/geometry/particle_deposit.pxd":111 + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C + * + */ + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; + + /* "yt/geometry/particle_deposit.pxd":112 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< + * + * # I don't know the way to use a dict in a cdef class. + */ + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":105 + * + * # Wendland C6 + * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland6", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_deposit.pxd":118 + * # I manually created a function to lookup the kernel functions. + * ctypedef np.float64_t (*kernel_func) (np.float64_t) + * cdef inline kernel_func get_kernel_func(str kernel_name): # <<<<<<<<<<<<<< + * if kernel_name == 'cubic': + * return sph_kernel_cubic + */ + +static CYTHON_INLINE __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(PyObject *__pyx_v_kernel_name) { + __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("get_kernel_func", 0); + + /* "yt/geometry/particle_deposit.pxd":119 + * ctypedef np.float64_t (*kernel_func) (np.float64_t) + * cdef inline kernel_func get_kernel_func(str kernel_name): + * if kernel_name == 'cubic': # <<<<<<<<<<<<<< + * return sph_kernel_cubic + * elif kernel_name == 'quartic': + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_cubic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "yt/geometry/particle_deposit.pxd":120 + * cdef inline kernel_func get_kernel_func(str kernel_name): + * if kernel_name == 'cubic': + * return sph_kernel_cubic # <<<<<<<<<<<<<< + * elif kernel_name == 'quartic': + * return sph_kernel_quartic + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":119 + * ctypedef np.float64_t (*kernel_func) (np.float64_t) + * cdef inline kernel_func get_kernel_func(str kernel_name): + * if kernel_name == 'cubic': # <<<<<<<<<<<<<< + * return sph_kernel_cubic + * elif kernel_name == 'quartic': + */ + } + + /* "yt/geometry/particle_deposit.pxd":121 + * if kernel_name == 'cubic': + * return sph_kernel_cubic + * elif kernel_name == 'quartic': # <<<<<<<<<<<<<< + * return sph_kernel_quartic + * elif kernel_name == 'quintic': + */ + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quartic, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "yt/geometry/particle_deposit.pxd":122 + * return sph_kernel_cubic + * elif kernel_name == 'quartic': + * return sph_kernel_quartic # <<<<<<<<<<<<<< + * elif kernel_name == 'quintic': + * return sph_kernel_quintic + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":121 + * if kernel_name == 'cubic': + * return sph_kernel_cubic + * elif kernel_name == 'quartic': # <<<<<<<<<<<<<< + * return sph_kernel_quartic + * elif kernel_name == 'quintic': + */ + } + + /* "yt/geometry/particle_deposit.pxd":123 + * elif kernel_name == 'quartic': + * return sph_kernel_quartic + * elif kernel_name == 'quintic': # <<<<<<<<<<<<<< + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quintic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "yt/geometry/particle_deposit.pxd":124 + * return sph_kernel_quartic + * elif kernel_name == 'quintic': + * return sph_kernel_quintic # <<<<<<<<<<<<<< + * elif kernel_name == 'wendland2': + * return sph_kernel_wendland2 + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":123 + * elif kernel_name == 'quartic': + * return sph_kernel_quartic + * elif kernel_name == 'quintic': # <<<<<<<<<<<<<< + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': + */ + } + + /* "yt/geometry/particle_deposit.pxd":125 + * elif kernel_name == 'quintic': + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': # <<<<<<<<<<<<<< + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': + */ + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "yt/geometry/particle_deposit.pxd":126 + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': + * return sph_kernel_wendland2 # <<<<<<<<<<<<<< + * elif kernel_name == 'wendland4': + * return sph_kernel_wendland4 + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":125 + * elif kernel_name == 'quintic': + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': # <<<<<<<<<<<<<< + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': + */ + } + + /* "yt/geometry/particle_deposit.pxd":127 + * elif kernel_name == 'wendland2': + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': # <<<<<<<<<<<<<< + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "yt/geometry/particle_deposit.pxd":128 + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': + * return sph_kernel_wendland4 # <<<<<<<<<<<<<< + * elif kernel_name == 'wendland6': + * return sph_kernel_wendland6 + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":127 + * elif kernel_name == 'wendland2': + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': # <<<<<<<<<<<<<< + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': + */ + } + + /* "yt/geometry/particle_deposit.pxd":129 + * elif kernel_name == 'wendland4': + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': # <<<<<<<<<<<<<< + * return sph_kernel_wendland6 + * else: + */ + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland6, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "yt/geometry/particle_deposit.pxd":130 + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': + * return sph_kernel_wendland6 # <<<<<<<<<<<<<< + * else: + * raise NotImplementedError + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6; + goto __pyx_L0; + + /* "yt/geometry/particle_deposit.pxd":129 + * elif kernel_name == 'wendland4': + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': # <<<<<<<<<<<<<< + * return sph_kernel_wendland6 + * else: + */ + } + + /* "yt/geometry/particle_deposit.pxd":132 + * return sph_kernel_wendland6 + * else: + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * cdef class ParticleDepositOperation: + */ + /*else*/ { + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + __PYX_ERR(0, 132, __pyx_L1_error) + } + + /* "yt/geometry/particle_deposit.pxd":118 + * # I manually created a function to lookup the kernel functions. + * ctypedef np.float64_t (*kernel_func) (np.float64_t) + * cdef inline kernel_func get_kernel_func(str kernel_name): # <<<<<<<<<<<<<< + * if kernel_name == 'cubic': + * return sph_kernel_cubic + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.get_kernel_func", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) + * + */ + +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) { + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_cont", 0); + + /* "oct_container.pxd":57 + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) # <<<<<<<<<<<<<< + * + * cdef OctList *OctList_append(OctList *list, Oct *o) + */ + __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i]))); + goto __pyx_L0; + + /* "oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + goto __pyx_L4; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 218, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); if (__pyx_t_2) { @@ -10945,11 +13134,11 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 222, __pyx_L1_error) + __PYX_ERR(4, 222, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") @@ -11254,11 +13443,11 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 259, __pyx_L1_error) + __PYX_ERR(4, 259, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: @@ -11465,22 +13654,22 @@ * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(3, 278, __pyx_L1_error) + __PYX_ERR(4, 278, __pyx_L1_error) break; } @@ -11547,7 +13736,7 @@ * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(4, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 @@ -11706,7 +13895,7 @@ * 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(3, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11753,7 +13942,7 @@ * 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(3, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11800,7 +13989,7 @@ * 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(3, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11847,7 +14036,7 @@ * 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(3, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11894,7 +14083,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11975,15 +14164,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(3, 794, __pyx_L1_error) + __PYX_ERR(4, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_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(3, 794, __pyx_L1_error) + __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(4, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -11998,11 +14187,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(3, 795, __pyx_L1_error) + __PYX_ERR(4, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(4, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -12023,7 +14212,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 796, __pyx_L1_error) + __PYX_ERR(4, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -12031,15 +14220,15 @@ __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(3, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(4, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -12052,12 +14241,12 @@ * 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(3, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -12069,11 +14258,11 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 799, __pyx_L1_error) + __PYX_ERR(4, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -12137,11 +14326,11 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 803, __pyx_L1_error) + __PYX_ERR(4, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -12160,11 +14349,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -12224,7 +14413,7 @@ * 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(3, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -12246,11 +14435,11 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(3, 823, __pyx_L1_error) + __PYX_ERR(4, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -12268,11 +14457,11 @@ * 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(3, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -12286,11 +14475,11 @@ * 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(3, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -12304,11 +14493,11 @@ * 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(3, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -12322,11 +14511,11 @@ * 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(3, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -12340,11 +14529,11 @@ * 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(3, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -12358,11 +14547,11 @@ * 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(3, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -12376,11 +14565,11 @@ * 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(3, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -12394,11 +14583,11 @@ * 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(3, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -12412,11 +14601,11 @@ * 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(3, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -12430,11 +14619,11 @@ * 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(3, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -12448,11 +14637,11 @@ * 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(3, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -12466,11 +14655,11 @@ * 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(3, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -12484,11 +14673,11 @@ * 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(3, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -12502,11 +14691,11 @@ * 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(3, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -12522,11 +14711,11 @@ * 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(3, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -12542,11 +14731,11 @@ * 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(3, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -12562,11 +14751,11 @@ * 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(3, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -12581,19 +14770,19 @@ * 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(3, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 844, __pyx_L1_error) + __PYX_ERR(4, 844, __pyx_L1_error) } __pyx_L15:; @@ -12624,7 +14813,7 @@ * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(3, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(4, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; @@ -12888,7 +15077,7 @@ * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 987, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 987, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 * # Cython code. @@ -12901,7 +15090,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -12915,7 +15104,7 @@ __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(3, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(4, 988, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -12927,11 +15116,11 @@ * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(3, 989, __pyx_L5_except_error) + __PYX_ERR(4, 989, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -12949,7 +15138,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -13019,7 +15208,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 993, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * @@ -13032,7 +15221,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -13046,7 +15235,7 @@ __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(3, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(4, 994, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -13058,11 +15247,11 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(3, 995, __pyx_L5_except_error) + __PYX_ERR(4, 995, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -13080,1223 +15269,794 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 * raise ImportError("numpy.core.multiarray failed to import") * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_ufunc", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 999, __pyx_L3_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(3, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/geometry/particle_deposit.pxd":29 - * void *alloca(int) - * - * cdef inline int gind(int i, int j, int k, int dims[3]): # <<<<<<<<<<<<<< - * # The ordering is such that we want i to vary the slowest in this instance, - * # even though in other instances it varies the fastest. To see this in - */ - -static CYTHON_INLINE int __pyx_f_2yt_8geometry_16particle_deposit_gind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dims) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("gind", 0); - - /* "yt/geometry/particle_deposit.pxd":34 - * # action, try looking at the results of an n_ref=256 particle CIC plot, - * # which shows it the most clearly. - * return ((i*dims[1])+j)*dims[2]+k # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = ((((__pyx_v_i * (__pyx_v_dims[1])) + __pyx_v_j) * (__pyx_v_dims[2])) + __pyx_v_k); - goto __pyx_L0; - - /* "yt/geometry/particle_deposit.pxd":29 - * void *alloca(int) - * - * cdef inline int gind(int i, int j, int k, int dims[3]): # <<<<<<<<<<<<<< - * # The ordering is such that we want i to vary the slowest in this instance, - * # even though in other instances it varies the fastest. To see this in - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/geometry/particle_deposit.pxd":41 - * #################################################### - * - * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - - /* "yt/geometry/particle_deposit.pxd":43 - * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 # <<<<<<<<<<<<<< - * if x <= 0.5: - * kernel = 1.-6.*x*x*(1.-x) - */ - __pyx_v_C = 2.5464790894703255; - - /* "yt/geometry/particle_deposit.pxd":44 - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 - * if x <= 0.5: # <<<<<<<<<<<<<< - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: - */ - __pyx_t_1 = ((__pyx_v_x <= 0.5) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/particle_deposit.pxd":45 - * cdef np.float64_t C = 2.5464790894703255 - * if x <= 0.5: - * kernel = 1.-6.*x*x*(1.-x) # <<<<<<<<<<<<<< - * elif x>0.5 and x<=1.0: - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) - */ - __pyx_v_kernel = (1. - (((6. * __pyx_v_x) * __pyx_v_x) * (1. - __pyx_v_x))); - - /* "yt/geometry/particle_deposit.pxd":44 - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 - * if x <= 0.5: # <<<<<<<<<<<<<< - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: - */ - goto __pyx_L3; - } - - /* "yt/geometry/particle_deposit.pxd":46 - * if x <= 0.5: - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: # <<<<<<<<<<<<<< - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) - * else: - */ - __pyx_t_2 = ((__pyx_v_x > 0.5) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = ((__pyx_v_x <= 1.0) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; - if (__pyx_t_1) { - - /* "yt/geometry/particle_deposit.pxd":47 - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) # <<<<<<<<<<<<<< - * else: - * kernel = 0. - */ - __pyx_v_kernel = (((2. * (1. - __pyx_v_x)) * (1. - __pyx_v_x)) * (1. - __pyx_v_x)); - - /* "yt/geometry/particle_deposit.pxd":46 - * if x <= 0.5: - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: # <<<<<<<<<<<<<< - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) - * else: - */ - goto __pyx_L3; - } - - /* "yt/geometry/particle_deposit.pxd":49 - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C - * - */ - /*else*/ { - __pyx_v_kernel = 0.; - } - __pyx_L3:; - - /* "yt/geometry/particle_deposit.pxd":50 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< - * - * ######################################################## - */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); - goto __pyx_L0; - - /* "yt/geometry/particle_deposit.pxd":41 - * #################################################### - * - * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 + * 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; } -/* "yt/geometry/particle_deposit.pxd":57 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * - * # quartic spline - * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; +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; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_quartic", 0); - - /* "yt/geometry/particle_deposit.pxd":59 - * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**4 - */ - __pyx_t_1 = PyFloat_FromDouble((pow(5., 6.0) / 512.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __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, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; - - /* "yt/geometry/particle_deposit.pxd":60 - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**4 - * if x < 3./5: - */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { - - /* "yt/geometry/particle_deposit.pxd":61 - * cdef np.float64_t C = 5.**6/512/np.pi - * if x < 1: - * kernel = (1.-x)**4 # <<<<<<<<<<<<<< - * if x < 3./5: - * kernel -= 5*(3./5-x)**4 - */ - __pyx_v_kernel = pow((1. - __pyx_v_x), 4.0); - - /* "yt/geometry/particle_deposit.pxd":62 - * if x < 1: - * kernel = (1.-x)**4 - * if x < 3./5: # <<<<<<<<<<<<<< - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: - */ - __pyx_t_5 = ((__pyx_v_x < (3. / 5.0)) != 0); - if (__pyx_t_5) { + 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); - /* "yt/geometry/particle_deposit.pxd":63 - * kernel = (1.-x)**4 - * if x < 3./5: - * kernel -= 5*(3./5-x)**4 # <<<<<<<<<<<<<< - * if x < 1./5: - * kernel += 10*(1./5-x)**4 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_v_kernel = (__pyx_v_kernel - (5.0 * pow(((3. / 5.0) - __pyx_v_x), 4.0))); + { + __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:*/ { - /* "yt/geometry/particle_deposit.pxd":64 - * if x < 3./5: - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: # <<<<<<<<<<<<<< - * kernel += 10*(1./5-x)**4 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_5 = ((__pyx_v_x < (1. / 5.0)) != 0); - if (__pyx_t_5) { + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 999, __pyx_L3_error) - /* "yt/geometry/particle_deposit.pxd":65 - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: - * kernel += 10*(1./5-x)**4 # <<<<<<<<<<<<<< - * else: - * kernel = 0. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_v_kernel = (__pyx_v_kernel + (10.0 * pow(((1. / 5.0) - __pyx_v_x), 4.0))); + } + __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:; + __Pyx_PyThreadState_assign - /* "yt/geometry/particle_deposit.pxd":64 - * if x < 3./5: - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: # <<<<<<<<<<<<<< - * kernel += 10*(1./5-x)**4 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") */ - } + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(4, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "yt/geometry/particle_deposit.pxd":62 - * if x < 1: - * kernel = (1.-x)**4 - * if x < 3./5: # <<<<<<<<<<<<<< - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(4, 1001, __pyx_L5_except_error) } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "yt/geometry/particle_deposit.pxd":60 - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**4 - * if x < 3./5: - */ - goto __pyx_L3; - } - - /* "yt/geometry/particle_deposit.pxd":67 - * kernel += 10*(1./5-x)**4 - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - /*else*/ { - __pyx_v_kernel = 0.; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; } - __pyx_L3:; - /* "yt/geometry/particle_deposit.pxd":68 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< - * - * # quintic spline - */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); - goto __pyx_L0; - - /* "yt/geometry/particle_deposit.pxd":57 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * - * # quartic spline - * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quartic", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __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; } -/* "yt/geometry/particle_deposit.pxd":71 +/* "cpython/array.pxd":93 + * __data_union data * - * # quintic spline - * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi + * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_7cpython_5array_5array_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_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) { + PyObject *__pyx_v_item_count = NULL; + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_quintic", 0); + char *__pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "yt/geometry/particle_deposit.pxd":73 - * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**5 + /* "cpython/array.pxd":98 + * # In particular strided access is always provided regardless + * # of flags + * item_count = Py_SIZE(self) # <<<<<<<<<<<<<< + * + * info.suboffsets = NULL */ - __pyx_t_1 = PyFloat_FromDouble((pow(3., 7.0) / 40.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 98, __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, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; + __pyx_v_item_count = __pyx_t_1; + __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pxd":74 - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**5 - * if x < 2./3: + /* "cpython/array.pxd":100 + * item_count = Py_SIZE(self) + * + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.buf = self.data.as_chars + * info.readonly = 0 */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { + __pyx_v_info->suboffsets = NULL; - /* "yt/geometry/particle_deposit.pxd":75 - * cdef np.float64_t C = 3.**7/40/np.pi - * if x < 1: - * kernel = (1.-x)**5 # <<<<<<<<<<<<<< - * if x < 2./3: - * kernel -= 6*(2./3-x)**5 + /* "cpython/array.pxd":101 + * + * info.suboffsets = NULL + * info.buf = self.data.as_chars # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.ndim = 1 */ - __pyx_v_kernel = pow((1. - __pyx_v_x), 5.0); + __pyx_t_2 = __pyx_v_self->data.as_chars; + __pyx_v_info->buf = __pyx_t_2; - /* "yt/geometry/particle_deposit.pxd":76 - * if x < 1: - * kernel = (1.-x)**5 - * if x < 2./3: # <<<<<<<<<<<<<< - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: + /* "cpython/array.pxd":102 + * info.suboffsets = NULL + * info.buf = self.data.as_chars + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.ndim = 1 + * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) */ - __pyx_t_5 = ((__pyx_v_x < (2. / 3.0)) != 0); - if (__pyx_t_5) { + __pyx_v_info->readonly = 0; - /* "yt/geometry/particle_deposit.pxd":77 - * kernel = (1.-x)**5 - * if x < 2./3: - * kernel -= 6*(2./3-x)**5 # <<<<<<<<<<<<<< - * if x < 1./3: - * kernel += 15*(1./3-x)**5 + /* "cpython/array.pxd":103 + * info.buf = self.data.as_chars + * info.readonly = 0 + * info.ndim = 1 # <<<<<<<<<<<<<< + * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) + * info.len = info.itemsize * item_count */ - __pyx_v_kernel = (__pyx_v_kernel - (6.0 * pow(((2. / 3.0) - __pyx_v_x), 5.0))); + __pyx_v_info->ndim = 1; - /* "yt/geometry/particle_deposit.pxd":78 - * if x < 2./3: - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: # <<<<<<<<<<<<<< - * kernel += 15*(1./3-x)**5 - * else: + /* "cpython/array.pxd":104 + * info.readonly = 0 + * info.ndim = 1 + * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<< + * info.len = info.itemsize * item_count + * */ - __pyx_t_5 = ((__pyx_v_x < (1. / 3.0)) != 0); - if (__pyx_t_5) { + __pyx_t_3 = __pyx_v_self->ob_descr->itemsize; + __pyx_v_info->itemsize = __pyx_t_3; - /* "yt/geometry/particle_deposit.pxd":79 - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: - * kernel += 15*(1./3-x)**5 # <<<<<<<<<<<<<< - * else: - * kernel = 0. + /* "cpython/array.pxd":105 + * info.ndim = 1 + * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) + * info.len = info.itemsize * item_count # <<<<<<<<<<<<<< + * + * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) */ - __pyx_v_kernel = (__pyx_v_kernel + (15.0 * pow(((1. / 3.0) - __pyx_v_x), 5.0))); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_info->len = __pyx_t_5; - /* "yt/geometry/particle_deposit.pxd":78 - * if x < 2./3: - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: # <<<<<<<<<<<<<< - * kernel += 15*(1./3-x)**5 - * else: + /* "cpython/array.pxd":107 + * info.len = info.itemsize * item_count + * + * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<< + * if not info.shape: + * raise MemoryError() */ - } + __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2))); - /* "yt/geometry/particle_deposit.pxd":76 - * if x < 1: - * kernel = (1.-x)**5 - * if x < 2./3: # <<<<<<<<<<<<<< - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: + /* "cpython/array.pxd":108 + * + * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) + * if not info.shape: # <<<<<<<<<<<<<< + * raise MemoryError() + * info.shape[0] = item_count # constant regardless of resizing */ - } + __pyx_t_6 = ((!(__pyx_v_info->shape != 0)) != 0); + if (__pyx_t_6) { - /* "yt/geometry/particle_deposit.pxd":74 - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**5 - * if x < 2./3: + /* "cpython/array.pxd":109 + * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) + * if not info.shape: + * raise MemoryError() # <<<<<<<<<<<<<< + * info.shape[0] = item_count # constant regardless of resizing + * info.strides = &info.itemsize */ - goto __pyx_L3; - } + PyErr_NoMemory(); __PYX_ERR(5, 109, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pxd":81 - * kernel += 15*(1./3-x)**5 - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C + /* "cpython/array.pxd":108 * + * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) + * if not info.shape: # <<<<<<<<<<<<<< + * raise MemoryError() + * info.shape[0] = item_count # constant regardless of resizing */ - /*else*/ { - __pyx_v_kernel = 0.; } - __pyx_L3:; - /* "yt/geometry/particle_deposit.pxd":82 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< + /* "cpython/array.pxd":110 + * if not info.shape: + * raise MemoryError() + * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<< + * info.strides = &info.itemsize * - * # Wendland C2 */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); - goto __pyx_L0; + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_item_count); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 110, __pyx_L1_error) + (__pyx_v_info->shape[0]) = __pyx_t_5; + + /* "cpython/array.pxd":111 + * raise MemoryError() + * info.shape[0] = item_count # constant regardless of resizing + * info.strides = &info.itemsize # <<<<<<<<<<<<<< + * + * info.format = (info.shape + 1) + */ + __pyx_v_info->strides = (&__pyx_v_info->itemsize); + + /* "cpython/array.pxd":113 + * info.strides = &info.itemsize + * + * info.format = (info.shape + 1) # <<<<<<<<<<<<<< + * info.format[0] = self.ob_descr.typecode + * info.format[1] = 0 + */ + __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1)); + + /* "cpython/array.pxd":114 + * + * info.format = (info.shape + 1) + * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<< + * info.format[1] = 0 + * info.obj = self + */ + __pyx_t_3 = __pyx_v_self->ob_descr->typecode; + (__pyx_v_info->format[0]) = __pyx_t_3; + + /* "cpython/array.pxd":115 + * info.format = (info.shape + 1) + * info.format[0] = self.ob_descr.typecode + * info.format[1] = 0 # <<<<<<<<<<<<<< + * info.obj = self + * + */ + (__pyx_v_info->format[1]) = 0; + + /* "cpython/array.pxd":116 + * info.format[0] = self.ob_descr.typecode + * info.format[1] = 0 + * info.obj = self # <<<<<<<<<<<<<< + * + * def __releasebuffer__(self, Py_buffer* info): + */ + __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); - /* "yt/geometry/particle_deposit.pxd":71 + /* "cpython/array.pxd":93 + * __data_union data * - * # quintic spline - * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi + * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quintic", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_item_count); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/particle_deposit.pxd":85 +/* "cpython/array.pxd":118 + * info.obj = self + * + * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<< + * PyObject_Free(info.shape) * - * # Wendland C2 - * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_wendland2", 0); - - /* "yt/geometry/particle_deposit.pxd":87 - * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**4 * (1+4*x) - */ - __pyx_t_1 = PyFloat_FromDouble((21. / 2.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __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, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; - - /* "yt/geometry/particle_deposit.pxd":88 - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**4 * (1+4*x) - * else: - */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - /* "yt/geometry/particle_deposit.pxd":89 - * cdef np.float64_t C = 21./2/np.pi - * if x < 1: - * kernel = (1.-x)**4 * (1+4*x) # <<<<<<<<<<<<<< - * else: - * kernel = 0. - */ - __pyx_v_kernel = (pow((1. - __pyx_v_x), 4.0) * (1.0 + (4.0 * __pyx_v_x))); + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "yt/geometry/particle_deposit.pxd":88 - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**4 * (1+4*x) - * else: - */ - goto __pyx_L3; - } +static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "yt/geometry/particle_deposit.pxd":91 - * kernel = (1.-x)**4 * (1+4*x) - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C + /* "cpython/array.pxd":119 * - */ - /*else*/ { - __pyx_v_kernel = 0.; - } - __pyx_L3:; - - /* "yt/geometry/particle_deposit.pxd":92 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< + * def __releasebuffer__(self, Py_buffer* info): + * PyObject_Free(info.shape) # <<<<<<<<<<<<<< * - * # Wendland C4 + * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr) */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); - goto __pyx_L0; + PyObject_Free(__pyx_v_info->shape); - /* "yt/geometry/particle_deposit.pxd":85 + /* "cpython/array.pxd":118 + * info.obj = self + * + * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<< + * PyObject_Free(info.shape) * - * # Wendland C2 - * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland2", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "yt/geometry/particle_deposit.pxd":95 +/* "cpython/array.pxd":130 * - * # Wendland C4 - * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi + * + * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<< + * """ fast creation of a new array, given a template array. + * type will be same as template. */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; +static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) { + arrayobject *__pyx_v_op = NULL; + arrayobject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_wendland4", 0); + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("clone", 0); - /* "yt/geometry/particle_deposit.pxd":97 - * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) + /* "cpython/array.pxd":134 + * type will be same as template. + * if zero is true, new array will be initialized with zeroes.""" + * op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<< + * if zero and op is not None: + * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) */ - __pyx_t_1 = PyFloat_FromDouble((495. / 32.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_template)), __pyx_v_length, __pyx_v_template->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 134, __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, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; - - /* "yt/geometry/particle_deposit.pxd":98 - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) - * else: - */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { - - /* "yt/geometry/particle_deposit.pxd":99 - * cdef np.float64_t C = 495./32/np.pi - * if x < 1: - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) # <<<<<<<<<<<<<< - * else: - * kernel = 0. - */ - __pyx_v_kernel = (pow((1. - __pyx_v_x), 6.0) * ((1.0 + (6.0 * __pyx_v_x)) + ((35. / 3.0) * pow(__pyx_v_x, 2.0)))); + __pyx_v_op = ((arrayobject *)__pyx_t_1); + __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pxd":98 - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) - * else: + /* "cpython/array.pxd":135 + * if zero is true, new array will be initialized with zeroes.""" + * op = newarrayobject(Py_TYPE(template), length, template.ob_descr) + * if zero and op is not None: # <<<<<<<<<<<<<< + * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) + * return op */ - goto __pyx_L3; + __pyx_t_3 = (__pyx_v_zero != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; } + __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + __pyx_t_2 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { - /* "yt/geometry/particle_deposit.pxd":101 - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C + /* "cpython/array.pxd":136 + * op = newarrayobject(Py_TYPE(template), length, template.ob_descr) + * if zero and op is not None: + * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<< + * return op * */ - /*else*/ { - __pyx_v_kernel = 0.; + memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize)); + + /* "cpython/array.pxd":135 + * if zero is true, new array will be initialized with zeroes.""" + * op = newarrayobject(Py_TYPE(template), length, template.ob_descr) + * if zero and op is not None: # <<<<<<<<<<<<<< + * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) + * return op + */ } - __pyx_L3:; - /* "yt/geometry/particle_deposit.pxd":102 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< + /* "cpython/array.pxd":137 + * if zero and op is not None: + * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) + * return op # <<<<<<<<<<<<<< * - * # Wendland C6 + * cdef inline array copy(array self): */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_op)); + __pyx_r = __pyx_v_op; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pxd":95 + /* "cpython/array.pxd":130 * - * # Wendland C4 - * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi + * + * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<< + * """ fast creation of a new array, given a template array. + * type will be same as template. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland4", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_op); + __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/particle_deposit.pxd":105 +/* "cpython/array.pxd":139 + * return op * - * # Wendland C6 - * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi + * cdef inline array copy(array self): # <<<<<<<<<<<<<< + * """ make a copy of an array. """ + * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; +static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) { + arrayobject *__pyx_v_op = NULL; + arrayobject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_wendland6", 0); + __Pyx_RefNannySetupContext("copy", 0); - /* "yt/geometry/particle_deposit.pxd":107 - * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + /* "cpython/array.pxd":141 + * cdef inline array copy(array self): + * """ make a copy of an array. """ + * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<< + * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) + * return op */ - __pyx_t_1 = PyFloat_FromDouble((1365. / 64.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_self)), Py_SIZE(((PyObject *)__pyx_v_self)), __pyx_v_self->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 141, __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, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; - - /* "yt/geometry/particle_deposit.pxd":108 - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) - * else: - */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { - - /* "yt/geometry/particle_deposit.pxd":109 - * cdef np.float64_t C = 1365./64/np.pi - * if x < 1: - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) # <<<<<<<<<<<<<< - * else: - * kernel = 0. - */ - __pyx_v_kernel = (pow((1. - __pyx_v_x), 8.0) * (((1.0 + (8.0 * __pyx_v_x)) + (25.0 * pow(__pyx_v_x, 2.0))) + (32.0 * pow(__pyx_v_x, 3.0)))); - - /* "yt/geometry/particle_deposit.pxd":108 - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) - * else: - */ - goto __pyx_L3; - } + __pyx_v_op = ((arrayobject *)__pyx_t_1); + __pyx_t_1 = 0; - /* "yt/geometry/particle_deposit.pxd":111 - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C + /* "cpython/array.pxd":142 + * """ make a copy of an array. """ + * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) + * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<< + * return op * */ - /*else*/ { - __pyx_v_kernel = 0.; - } - __pyx_L3:; + memcpy(__pyx_v_op->data.as_chars, __pyx_v_self->data.as_chars, (Py_SIZE(((PyObject *)__pyx_v_op)) * __pyx_v_op->ob_descr->itemsize)); - /* "yt/geometry/particle_deposit.pxd":112 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< + /* "cpython/array.pxd":143 + * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) + * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) + * return op # <<<<<<<<<<<<<< * - * # I don't know the way to use a dict in a cdef class. + * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_op)); + __pyx_r = __pyx_v_op; goto __pyx_L0; - /* "yt/geometry/particle_deposit.pxd":105 + /* "cpython/array.pxd":139 + * return op * - * # Wendland C6 - * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi + * cdef inline array copy(array self): # <<<<<<<<<<<<<< + * """ make a copy of an array. """ + * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland6", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_op); + __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/geometry/particle_deposit.pxd":118 - * # I manually created a function to lookup the kernel functions. - * ctypedef np.float64_t (*kernel_func) (np.float64_t) - * cdef inline kernel_func get_kernel_func(str kernel_name): # <<<<<<<<<<<<<< - * if kernel_name == 'cubic': - * return sph_kernel_cubic +/* "cpython/array.pxd":145 + * return op + * + * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<< + * """ efficent appending of new stuff of same type + * (e.g. of same array type) */ -static CYTHON_INLINE __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(PyObject *__pyx_v_kernel_name) { - __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_r; +static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) { + Py_ssize_t __pyx_v_itemsize; + Py_ssize_t __pyx_v_origsize; + int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("get_kernel_func", 0); - - /* "yt/geometry/particle_deposit.pxd":119 - * ctypedef np.float64_t (*kernel_func) (np.float64_t) - * cdef inline kernel_func get_kernel_func(str kernel_name): - * if kernel_name == 'cubic': # <<<<<<<<<<<<<< - * return sph_kernel_cubic - * elif kernel_name == 'quartic': - */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_cubic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 119, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "yt/geometry/particle_deposit.pxd":120 - * cdef inline kernel_func get_kernel_func(str kernel_name): - * if kernel_name == 'cubic': - * return sph_kernel_cubic # <<<<<<<<<<<<<< - * elif kernel_name == 'quartic': - * return sph_kernel_quartic - */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic; - goto __pyx_L0; - - /* "yt/geometry/particle_deposit.pxd":119 - * ctypedef np.float64_t (*kernel_func) (np.float64_t) - * cdef inline kernel_func get_kernel_func(str kernel_name): - * if kernel_name == 'cubic': # <<<<<<<<<<<<<< - * return sph_kernel_cubic - * elif kernel_name == 'quartic': - */ - } - - /* "yt/geometry/particle_deposit.pxd":121 - * if kernel_name == 'cubic': - * return sph_kernel_cubic - * elif kernel_name == 'quartic': # <<<<<<<<<<<<<< - * return sph_kernel_quartic - * elif kernel_name == 'quintic': - */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quartic, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 121, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { - - /* "yt/geometry/particle_deposit.pxd":122 - * return sph_kernel_cubic - * elif kernel_name == 'quartic': - * return sph_kernel_quartic # <<<<<<<<<<<<<< - * elif kernel_name == 'quintic': - * return sph_kernel_quintic - */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic; - goto __pyx_L0; - - /* "yt/geometry/particle_deposit.pxd":121 - * if kernel_name == 'cubic': - * return sph_kernel_cubic - * elif kernel_name == 'quartic': # <<<<<<<<<<<<<< - * return sph_kernel_quartic - * elif kernel_name == 'quintic': - */ - } - - /* "yt/geometry/particle_deposit.pxd":123 - * elif kernel_name == 'quartic': - * return sph_kernel_quartic - * elif kernel_name == 'quintic': # <<<<<<<<<<<<<< - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': - */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quintic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 123, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "yt/geometry/particle_deposit.pxd":124 - * return sph_kernel_quartic - * elif kernel_name == 'quintic': - * return sph_kernel_quintic # <<<<<<<<<<<<<< - * elif kernel_name == 'wendland2': - * return sph_kernel_wendland2 - */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic; - goto __pyx_L0; + __Pyx_RefNannySetupContext("extend_buffer", 0); - /* "yt/geometry/particle_deposit.pxd":123 - * elif kernel_name == 'quartic': - * return sph_kernel_quartic - * elif kernel_name == 'quintic': # <<<<<<<<<<<<<< - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': + /* "cpython/array.pxd":149 + * (e.g. of same array type) + * n: number of elements (not number of bytes!) """ + * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<< + * cdef Py_ssize_t origsize = Py_SIZE(self) + * resize_smart(self, origsize + n) */ - } + __pyx_t_1 = __pyx_v_self->ob_descr->itemsize; + __pyx_v_itemsize = __pyx_t_1; - /* "yt/geometry/particle_deposit.pxd":125 - * elif kernel_name == 'quintic': - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': # <<<<<<<<<<<<<< - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': + /* "cpython/array.pxd":150 + * n: number of elements (not number of bytes!) """ + * cdef Py_ssize_t itemsize = self.ob_descr.itemsize + * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<< + * resize_smart(self, origsize + n) + * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 125, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { + __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self)); - /* "yt/geometry/particle_deposit.pxd":126 - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': - * return sph_kernel_wendland2 # <<<<<<<<<<<<<< - * elif kernel_name == 'wendland4': - * return sph_kernel_wendland4 + /* "cpython/array.pxd":151 + * cdef Py_ssize_t itemsize = self.ob_descr.itemsize + * cdef Py_ssize_t origsize = Py_SIZE(self) + * resize_smart(self, origsize + n) # <<<<<<<<<<<<<< + * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) + * return 0 */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2; - goto __pyx_L0; + __pyx_t_1 = resize_smart(__pyx_v_self, (__pyx_v_origsize + __pyx_v_n)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(5, 151, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pxd":125 - * elif kernel_name == 'quintic': - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': # <<<<<<<<<<<<<< - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': + /* "cpython/array.pxd":152 + * cdef Py_ssize_t origsize = Py_SIZE(self) + * resize_smart(self, origsize + n) + * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<< + * return 0 + * */ - } + memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize)); - /* "yt/geometry/particle_deposit.pxd":127 - * elif kernel_name == 'wendland2': - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': # <<<<<<<<<<<<<< - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': + /* "cpython/array.pxd":153 + * resize_smart(self, origsize + n) + * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) + * return 0 # <<<<<<<<<<<<<< + * + * cdef inline int extend(array self, array other) except -1: */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 127, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_r = 0; + goto __pyx_L0; - /* "yt/geometry/particle_deposit.pxd":128 - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': - * return sph_kernel_wendland4 # <<<<<<<<<<<<<< - * elif kernel_name == 'wendland6': - * return sph_kernel_wendland6 + /* "cpython/array.pxd":145 + * return op + * + * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<< + * """ efficent appending of new stuff of same type + * (e.g. of same array type) */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4; - goto __pyx_L0; - /* "yt/geometry/particle_deposit.pxd":127 - * elif kernel_name == 'wendland2': - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': # <<<<<<<<<<<<<< - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/array.pxd":155 + * return 0 + * + * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<< + * """ extend array with data from another array; types must match. """ + * if self.ob_descr.typecode != other.ob_descr.typecode: */ - } - /* "yt/geometry/particle_deposit.pxd":129 - * elif kernel_name == 'wendland4': - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': # <<<<<<<<<<<<<< - * return sph_kernel_wendland6 - * else: +static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("extend", 0); + + /* "cpython/array.pxd":157 + * cdef inline int extend(array self, array other) except -1: + * """ extend array with data from another array; types must match. """ + * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<< + * PyErr_BadArgument() + * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland6, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 129, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_2 != 0); + __pyx_t_1 = ((__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode) != 0); if (__pyx_t_1) { - /* "yt/geometry/particle_deposit.pxd":130 - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': - * return sph_kernel_wendland6 # <<<<<<<<<<<<<< - * else: - * raise NotImplementedError + /* "cpython/array.pxd":158 + * """ extend array with data from another array; types must match. """ + * if self.ob_descr.typecode != other.ob_descr.typecode: + * PyErr_BadArgument() # <<<<<<<<<<<<<< + * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) + * */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6; - goto __pyx_L0; + __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(5, 158, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pxd":129 - * elif kernel_name == 'wendland4': - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': # <<<<<<<<<<<<<< - * return sph_kernel_wendland6 - * else: + /* "cpython/array.pxd":157 + * cdef inline int extend(array self, array other) except -1: + * """ extend array with data from another array; types must match. """ + * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<< + * PyErr_BadArgument() + * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) */ } - /* "yt/geometry/particle_deposit.pxd":132 - * return sph_kernel_wendland6 - * else: - * raise NotImplementedError # <<<<<<<<<<<<<< + /* "cpython/array.pxd":159 + * if self.ob_descr.typecode != other.ob_descr.typecode: + * PyErr_BadArgument() + * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<< * - * cdef class ParticleDepositOperation: + * cdef inline void zero(array self): */ - /*else*/ { - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 132, __pyx_L1_error) - } + __pyx_t_2 = __pyx_f_7cpython_5array_extend_buffer(__pyx_v_self, __pyx_v_other->data.as_chars, Py_SIZE(((PyObject *)__pyx_v_other))); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(5, 159, __pyx_L1_error) + __pyx_r = __pyx_t_2; + goto __pyx_L0; - /* "yt/geometry/particle_deposit.pxd":118 - * # I manually created a function to lookup the kernel functions. - * ctypedef np.float64_t (*kernel_func) (np.float64_t) - * cdef inline kernel_func get_kernel_func(str kernel_name): # <<<<<<<<<<<<<< - * if kernel_name == 'cubic': - * return sph_kernel_cubic + /* "cpython/array.pxd":155 + * return 0 + * + * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<< + * """ extend array with data from another array; types must match. """ + * if self.ob_descr.typecode != other.ob_descr.typecode: */ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.get_kernel_func", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; + __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "cpython/array.pxd":161 + * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) + * + * cdef inline void zero(array self): # <<<<<<<<<<<<<< + * """ set all elements of array to zero. """ + * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) + */ + +static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("zero", 0); + + /* "cpython/array.pxd":163 + * cdef inline void zero(array self): + * """ set all elements of array to zero. """ + * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<< + */ + memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize)); + + /* "cpython/array.pxd":161 + * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) + * + * cdef inline void zero(array self): # <<<<<<<<<<<<<< + * """ set all elements of array to zero. """ + * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + /* "oct_visitors.pxd":51 * cdef void visit(self, Oct*, np.uint8_t selected) * @@ -14392,7 +16152,7 @@ } /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -14414,7 +16174,7 @@ goto __pyx_L0; /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -14427,259 +16187,21 @@ return __pyx_r; } -/* "selection_routines.pxd":26 - * np.float64_t - * - * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): - */ - -static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_ensure_code", 0); - - /* "selection_routines.pxd":27 - * - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): # <<<<<<<<<<<<<< - * if "code_length" == str(arr.units): - * return arr - */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(4, 27, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "selection_routines.pxd":28 - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< - * return arr - * arr.convert_to_units("code_length") - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 28, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 28, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { - - /* "selection_routines.pxd":29 - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): - * return arr # <<<<<<<<<<<<<< - * arr.convert_to_units("code_length") - * return arr - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_arr); - __pyx_r = __pyx_v_arr; - goto __pyx_L0; - - /* "selection_routines.pxd":28 - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< - * return arr - * arr.convert_to_units("code_length") - */ - } - - /* "selection_routines.pxd":30 - * if "code_length" == str(arr.units): - * return arr - * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< - * return arr - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "selection_routines.pxd":27 - * - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): # <<<<<<<<<<<<<< - * if "code_length" == str(arr.units): - * return arr - */ - } - - /* "selection_routines.pxd":31 - * return arr - * arr.convert_to_units("code_length") - * return arr # <<<<<<<<<<<<<< - * - * cdef class SelectorObject: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_arr); - __pyx_r = __pyx_v_arr; - goto __pyx_L0; - - /* "selection_routines.pxd":26 - * np.float64_t - * - * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "selection_routines.pxd":78 - * cdef public np.int64_t domain_id - * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) { - __pyx_t_5numpy_float64_t __pyx_v_rel; - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "selection_routines.pxd":80 - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< - * if not periodic: return rel - * if rel > dw * 0.5: - */ - __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); - - /* "selection_routines.pxd":81 - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel # <<<<<<<<<<<<<< - * if rel > dw * 0.5: - * rel -= dw - */ - __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_rel; - goto __pyx_L0; - } - - /* "selection_routines.pxd":82 - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel - * if rel > dw * 0.5: # <<<<<<<<<<<<<< - * rel -= dw - * elif rel < -dw * 0.5: - */ - __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0); - if (__pyx_t_1) { - - /* "selection_routines.pxd":83 - * if not periodic: return rel - * if rel > dw * 0.5: - * rel -= dw # <<<<<<<<<<<<<< - * elif rel < -dw * 0.5: - * rel += dw - */ - __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw); - - /* "selection_routines.pxd":82 - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel - * if rel > dw * 0.5: # <<<<<<<<<<<<<< - * rel -= dw - * elif rel < -dw * 0.5: - */ - goto __pyx_L4; - } - - /* "selection_routines.pxd":84 - * if rel > dw * 0.5: - * rel -= dw - * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< - * rel += dw - * return rel - */ - __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0); - if (__pyx_t_1) { - - /* "selection_routines.pxd":85 - * rel -= dw - * elif rel < -dw * 0.5: - * rel += dw # <<<<<<<<<<<<<< - * return rel - */ - __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw); - - /* "selection_routines.pxd":84 - * if rel > dw * 0.5: - * rel -= dw - * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< - * rel += dw - * return rel - */ - } - __pyx_L4:; - - /* "selection_routines.pxd":86 - * elif rel < -dw * 0.5: - * rel += dw - * return rel # <<<<<<<<<<<<<< - */ - __pyx_r = __pyx_v_rel; - goto __pyx_L0; - - /* "selection_routines.pxd":78 - * cdef public np.int64_t domain_id - * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":20 * - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -14691,7 +16213,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -14703,7 +16225,7 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ @@ -14743,7 +16265,7 @@ * if f0 > f1: return f0 * return f1 # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ __pyx_r = __pyx_v_f1; goto __pyx_L0; @@ -14764,18 +16286,18 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":28 * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -14787,7 +16309,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -14799,7 +16321,7 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ @@ -14887,7 +16409,7 @@ * if f0 < 0.0: return -f0 * return f0 # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_f0; goto __pyx_L0; @@ -14908,18 +16430,18 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":40 * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -14931,7 +16453,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -14948,7 +16470,7 @@ * if i > b: return b * return i # <<<<<<<<<<<<<< * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_i; goto __pyx_L0; @@ -14956,7 +16478,7 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -14969,18 +16491,18 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -14992,7 +16514,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -15017,7 +16539,7 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -15184,10 +16706,15 @@ 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; } @@ -15196,21 +16723,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(5, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(5, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -15218,12 +16749,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(5, 120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -15232,11 +16765,11 @@ } } __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(5, 120, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 120, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 121, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error) } else { /* "View.MemoryView":121 @@ -15251,15 +16784,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(5, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(5, 120, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __pyx_L1_error) } __pyx_r = __pyx_array___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); @@ -15310,9 +16843,9 @@ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(5, 127, __pyx_L1_error) + __PYX_ERR(2, 127, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(5, 127, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 @@ -15341,11 +16874,11 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(5, 131, __pyx_L1_error) + __PYX_ERR(2, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize @@ -15373,11 +16906,11 @@ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(5, 134, __pyx_L1_error) + __PYX_ERR(2, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") @@ -15406,9 +16939,9 @@ * 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(5, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -15430,7 +16963,7 @@ * 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(5, 138, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 138, __pyx_L1_error) __pyx_t_5 = __pyx_v_format; __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -15446,7 +16979,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(5, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -15484,11 +17017,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(5, 146, __pyx_L1_error) + __PYX_ERR(2, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim @@ -15511,12 +17044,12 @@ 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(5, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 149, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 149, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dim = __pyx_t_8; __pyx_v_idx = __pyx_t_7; @@ -15539,11 +17072,11 @@ * self._shape[idx] = dim * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 151, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); @@ -15551,20 +17084,20 @@ 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(5, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(5, 151, __pyx_L1_error) + __PYX_ERR(2, 151, __pyx_L1_error) /* "View.MemoryView":150 * @@ -15601,7 +17134,7 @@ * 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(5, 155, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 155, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":156 @@ -15643,7 +17176,7 @@ * 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(5, 158, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":159 @@ -15686,19 +17219,19 @@ * 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(5, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 162, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(5, 162, __pyx_L1_error) + __PYX_ERR(2, 162, __pyx_L1_error) } __pyx_L10:; @@ -15727,8 +17260,8 @@ * if allocate_buffer: * */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 168, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; @@ -15768,11 +17301,11 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(5, 174, __pyx_L1_error) + __PYX_ERR(2, 174, __pyx_L1_error) /* "View.MemoryView":173 * @@ -15811,11 +17344,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(5, 178, __pyx_L1_error) + __PYX_ERR(2, 178, __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(5, 178, __pyx_L1_error) + __PYX_ERR(2, 178, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { @@ -15936,7 +17469,7 @@ * 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(5, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -15966,7 +17499,7 @@ * 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(5, 187, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 187, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { @@ -16006,11 +17539,11 @@ * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(5, 190, __pyx_L1_error) + __PYX_ERR(2, 190, __pyx_L1_error) /* "View.MemoryView":189 * elif self.mode == u"fortran": @@ -16350,7 +17883,7 @@ * @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(5, 221, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -16409,11 +17942,11 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 226, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -16424,7 +17957,7 @@ 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(5, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -16488,9 +18021,9 @@ * 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(5, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -16553,9 +18086,9 @@ * 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(5, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 233, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -16616,27 +18149,134 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":235 + * 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__37, 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__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(5, 236, __pyx_L1_error) + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 4, __pyx_L1_error) - /* "View.MemoryView":235 - * return self.memview[item] - * - * def __setitem__(self, item, value): # <<<<<<<<<<<<<< - * self.memview[item] = value - * + /* "(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_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_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -16677,13 +18317,13 @@ * 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(5, 245, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 245, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -16697,7 +18337,7 @@ __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(5, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -16721,13 +18361,13 @@ * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 247, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -16749,9 +18389,9 @@ * result.data = buf * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 248, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(5, 248, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error) /* "View.MemoryView":247 * result = array(shape, itemsize, format, mode.decode('ASCII')) @@ -16760,7 +18400,7 @@ * 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(5, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -16836,6 +18476,7 @@ 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; } @@ -16846,7 +18487,7 @@ 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(5, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -16857,7 +18498,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -16955,6 +18596,293 @@ 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":294 * * @cname('__pyx_align_pointer') @@ -17063,8 +18991,11 @@ 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; } @@ -17073,11 +19004,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(5, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -17085,11 +19018,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(5, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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; @@ -17097,16 +19031,16 @@ } } __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(5, 341, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 341, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -17177,7 +19111,7 @@ * 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 == -1)) __PYX_ERR(5, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 345, __pyx_L1_error) /* "View.MemoryView":346 * if type(self) is memoryview or obj is not None: @@ -17298,7 +19232,7 @@ * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(5, 357, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error) /* "View.MemoryView":356 * if self.lock is NULL: @@ -17639,26 +19573,26 @@ __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(5, 389, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 389, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(5, 389, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(5, 389, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -17668,7 +19602,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(5, 389, __pyx_L1_error) + else __PYX_ERR(2, 389, __pyx_L1_error) } break; } @@ -17686,8 +19620,8 @@ * * 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(5, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(5, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 390, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":389 @@ -17804,7 +19738,7 @@ * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 399, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -17816,7 +19750,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(5, 399, __pyx_L1_error) + __PYX_ERR(2, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -17824,14 +19758,14 @@ __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(5, 399, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 399, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(5, 399, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; @@ -17845,7 +19779,7 @@ * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(5, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 402, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":403 @@ -17856,7 +19790,7 @@ * 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(5, 403, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -17879,7 +19813,7 @@ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(5, 405, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 405, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":406 @@ -17890,7 +19824,7 @@ * 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(5, 406, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -17960,7 +19894,7 @@ * * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 409, __pyx_L1_error) + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; @@ -17972,7 +19906,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(5, 409, __pyx_L1_error) + __PYX_ERR(2, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); @@ -17980,14 +19914,14 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 409, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 409, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(5, 409, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; @@ -18001,7 +19935,7 @@ * obj = self.is_slice(value) * if obj: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(5, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":412 @@ -18011,7 +19945,7 @@ * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 412, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; @@ -18023,7 +19957,7 @@ * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(5, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":414 @@ -18033,9 +19967,9 @@ * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 414, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -18058,10 +19992,10 @@ * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(5, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 416, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18086,7 +20020,7 @@ * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 418, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -18174,7 +20108,7 @@ * 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(5, 423, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":424 @@ -18184,7 +20118,7 @@ * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 424, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":423 @@ -18194,7 +20128,7 @@ * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 423, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -18205,7 +20139,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(5, 423, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -18222,7 +20156,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -18239,7 +20173,7 @@ __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(5, 425, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 425, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); @@ -18282,7 +20216,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -18354,7 +20288,7 @@ * 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(5, 434, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 434, __pyx_L1_error) /* "View.MemoryView":435 * @@ -18363,7 +20297,7 @@ * 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(5, 435, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 435, __pyx_L1_error) /* "View.MemoryView":436 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], @@ -18372,13 +20306,13 @@ * * 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(5, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":434 @@ -18388,7 +20322,7 @@ * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(5, 434, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 434, __pyx_L1_error) /* "View.MemoryView":430 * return obj @@ -18494,7 +20428,7 @@ * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(5, 450, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error) /* "View.MemoryView":449 * if self.view.itemsize > sizeof(array): @@ -18582,7 +20516,7 @@ * */ /*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(5, 459, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 459, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -18605,7 +20539,7 @@ * 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(5, 464, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 464, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -18720,7 +20654,7 @@ * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(5, 471, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 471, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":472 @@ -18730,7 +20664,7 @@ * * 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(5, 472, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -18789,7 +20723,7 @@ * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -18801,7 +20735,7 @@ * 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(5, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -18829,9 +20763,9 @@ * 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(5, 482, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 482, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -18848,7 +20782,7 @@ #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(5, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -18857,14 +20791,14 @@ #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(5, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 482, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -18875,7 +20809,7 @@ __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(5, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -18912,7 +20846,7 @@ * */ __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(5, 487, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 487, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18954,13 +20888,13 @@ * raise ValueError("Unable to convert item to object") * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 483, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(5, 483, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); @@ -18972,11 +20906,11 @@ * 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(5, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(5, 484, __pyx_L5_except_error) + __PYX_ERR(2, 484, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -19067,7 +21001,7 @@ * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -19090,26 +21024,26 @@ * 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(5, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 499, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 499, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 499, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(5, 499, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 499, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -19131,9 +21065,9 @@ * 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(5, 501, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -19150,7 +21084,7 @@ #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(5, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19159,14 +21093,14 @@ #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(5, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 501, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -19177,12 +21111,12 @@ __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(5, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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(5, 501, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 501, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } @@ -19198,7 +21132,7 @@ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(5, 503, __pyx_L1_error) + __PYX_ERR(2, 503, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -19585,9 +21519,9 @@ * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 540, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(5, 540, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; @@ -19598,7 +21532,7 @@ * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(5, 541, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error) /* "View.MemoryView":542 * cdef _memoryviewslice result = memoryview_copy(self) @@ -19725,18 +21659,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 550, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_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(5, 550, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(5, 550, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 550, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; @@ -19813,11 +21747,11 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(5, 556, __pyx_L1_error) + __PYX_ERR(2, 556, __pyx_L1_error) /* "View.MemoryView":554 * @property @@ -19836,18 +21770,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 558, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_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(5, 558, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(5, 558, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 558, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; @@ -19925,9 +21859,9 @@ * 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(5, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__21, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__41, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -19951,18 +21885,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 565, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 565, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(5, 565, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 565, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -20024,7 +21958,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20084,7 +22018,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20146,11 +22080,11 @@ * @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(5, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 577, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20244,7 +22178,7 @@ __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(5, 584, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; @@ -20256,7 +22190,7 @@ * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 585, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; @@ -20434,12 +22368,12 @@ * */ __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(5, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20450,12 +22384,12 @@ * * def __str__(self): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 599, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20466,7 +22400,7 @@ * id(self)) * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 598, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -20474,7 +22408,7 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -20538,20 +22472,20 @@ * */ __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(5, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 602, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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(5, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -20624,7 +22558,7 @@ * 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(5, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20695,7 +22629,7 @@ * 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(5, 615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20775,7 +22709,7 @@ * 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(5, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":627 @@ -20786,7 +22720,7 @@ * 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(5, 627, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -20867,7 +22801,7 @@ * 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(5, 634, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 634, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":639 @@ -20878,7 +22812,7 @@ * */ __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(5, 639, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -20903,6 +22837,113 @@ 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__42, 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__43, 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":643 * * @cname('__pyx_memoryview_new') @@ -20927,11 +22968,11 @@ * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 644, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -20942,7 +22983,7 @@ 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(5, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); @@ -21079,7 +23120,7 @@ * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -21117,7 +23158,7 @@ * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 662, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -21153,26 +23194,26 @@ __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(5, 665, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 665, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(5, 665, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(5, 665, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -21182,7 +23223,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(5, 665, __pyx_L1_error) + else __PYX_ERR(2, 665, __pyx_L1_error) } break; } @@ -21192,7 +23233,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(5, 665, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -21226,17 +23267,17 @@ * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(5, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 668, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__22); - __Pyx_GIVEREF(__pyx_slice__22); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__22); + __Pyx_INCREF(__pyx_slice__44); + __Pyx_GIVEREF(__pyx_slice__44); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__44); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 668, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":669 @@ -21266,7 +23307,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__23); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__45); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) } __pyx_L7:; @@ -21316,19 +23357,19 @@ * * 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(5, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 675, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(5, 675, __pyx_L1_error) + __PYX_ERR(2, 675, __pyx_L1_error) /* "View.MemoryView":674 * have_slices = True @@ -21365,7 +23406,7 @@ * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 678, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error) } __pyx_L6:; @@ -21387,7 +23428,7 @@ * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(5, 680, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":681 @@ -21407,16 +23448,16 @@ * * 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(5, 682, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__24); - __Pyx_GIVEREF(__pyx_slice__24); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__24); + __Pyx_INCREF(__pyx_slice__46); + __Pyx_GIVEREF(__pyx_slice__46); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__46); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":681 @@ -21438,20 +23479,20 @@ __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(5, 684, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 684, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 684, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 684, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -21537,11 +23578,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(5, 689, __pyx_L1_error) + __PYX_ERR(2, 689, __pyx_L1_error) /* "View.MemoryView":688 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): @@ -21645,7 +23686,7 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(5, 708, __pyx_L1_error) + __PYX_ERR(2, 708, __pyx_L1_error) } } #endif @@ -21668,7 +23709,7 @@ * 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(5, 711, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 711, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -21764,26 +23805,26 @@ __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(5, 732, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 732, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(5, 732, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(5, 732, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -21793,7 +23834,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(5, 732, __pyx_L1_error) + else __PYX_ERR(2, 732, __pyx_L1_error) } break; } @@ -21821,7 +23862,7 @@ * 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(5, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 737, __pyx_L1_error) /* "View.MemoryView":734 * for dim, index in enumerate(indices): @@ -21830,7 +23871,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(5, 734, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 734, __pyx_L1_error) /* "View.MemoryView":733 * @@ -21907,13 +23948,13 @@ * 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(5, 746, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 746, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -21929,13 +23970,13 @@ * 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(5, 747, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 747, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -21951,13 +23992,13 @@ * * 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(5, 748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 748, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -21973,7 +24014,7 @@ * 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(5, 750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -21986,7 +24027,7 @@ * 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(5, 751, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -21999,7 +24040,7 @@ * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 752, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -22012,7 +24053,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(5, 754, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 754, __pyx_L1_error) /* "View.MemoryView":760 * have_start, have_stop, have_step, @@ -22062,7 +24103,7 @@ * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(5, 764, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) } /* "View.MemoryView":765 * return memoryview_fromslice(dst, new_ndim, @@ -22071,7 +24112,7 @@ * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(5, 765, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) } /* "View.MemoryView":763 * @@ -22080,9 +24121,9 @@ * 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(5, 763, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(5, 763, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -22113,7 +24154,7 @@ * * */ - __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(5, 768, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":768 @@ -22123,7 +24164,7 @@ * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(5, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -22226,7 +24267,7 @@ * 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 == -1)) __PYX_ERR(5, 818, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: @@ -22291,7 +24332,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(5, 824, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error) /* "View.MemoryView":823 * negative_step = have_step != 0 and step < 0 @@ -22863,7 +24904,7 @@ * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(5, 885, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error) } __pyx_L26:; @@ -22920,11 +24961,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -22992,11 +25033,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(5, 903, __pyx_L1_error) + __PYX_ERR(2, 903, __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(5, 903, __pyx_L1_error) + __PYX_ERR(2, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); @@ -23104,22 +25145,22 @@ * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 914, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(5, 914, __pyx_L1_error) + __PYX_ERR(2, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: @@ -23156,22 +25197,22 @@ * * resultp = bufp + index * stride */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 917, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 917, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(5, 917, __pyx_L1_error) + __PYX_ERR(2, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) @@ -23371,7 +25412,7 @@ * * return 1 */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(5, 943, __pyx_L1_error) + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] @@ -23405,11 +25446,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -23494,7 +25535,7 @@ * 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(5, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -23518,7 +25559,7 @@ */ /*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(5, 969, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -23577,7 +25618,7 @@ * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(5, 973, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error) /* "View.MemoryView":972 * @@ -23597,7 +25638,7 @@ * @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(5, 975, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -23677,6 +25718,113 @@ 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__48, 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__49, 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":985 * * @cname('__pyx_memoryview_fromslice') @@ -23740,9 +25888,9 @@ * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 999, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -23753,7 +25901,7 @@ __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(5, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -23784,7 +25932,7 @@ * 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(5, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -23955,7 +26103,7 @@ __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(5, 1026, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; @@ -23967,12 +26115,12 @@ * * 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(5, 1027, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1027, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 1027, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } @@ -24064,7 +26212,7 @@ * 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(5, 1039, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1039, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -24121,7 +26269,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -24285,7 +26433,7 @@ * @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(5, 1067, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -24408,7 +26556,7 @@ * * */ - __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(5, 1084, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; @@ -25206,7 +27354,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(5, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error) /* "View.MemoryView":1207 * @@ -25378,11 +27526,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -25406,7 +27554,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -25417,13 +27565,13 @@ * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1238, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1238, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1238, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -25442,20 +27590,20 @@ * (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(5, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1237, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(5, 1237, __pyx_L1_error) + __PYX_ERR(2, 1237, __pyx_L1_error) /* "View.MemoryView":1235 * @@ -25475,7 +27623,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -25497,7 +27645,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -25509,11 +27657,11 @@ * * @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(5, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1242, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -25529,14 +27677,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #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(5, 1242, __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(2, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -25545,20 +27693,20 @@ #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(5, 1242, __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(2, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1242, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -25566,7 +27714,7 @@ __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(5, 1242, __pyx_L1_error) + __PYX_ERR(2, 1242, __pyx_L1_error) /* "View.MemoryView":1241 * @@ -25588,7 +27736,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -25611,7 +27759,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -25633,7 +27781,7 @@ * 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(5, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -25647,14 +27795,14 @@ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #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(5, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -25663,20 +27811,20 @@ #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(5, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -25684,7 +27832,7 @@ __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(5, 1247, __pyx_L1_error) + __PYX_ERR(2, 1247, __pyx_L1_error) /* "View.MemoryView":1246 * @cname('__pyx_memoryview_err') @@ -25704,7 +27852,7 @@ */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(5, 1249, __pyx_L1_error) + __PYX_ERR(2, 1249, __pyx_L1_error) } /* "View.MemoryView":1245 @@ -25727,7 +27875,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -25945,7 +28093,7 @@ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(5, 1281, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1281, __pyx_L1_error) } __pyx_L7:; @@ -25975,7 +28123,7 @@ * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(5, 1284, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error) /* "View.MemoryView":1283 * _err_extents(i, dst.shape[i], src.shape[i]) @@ -26032,7 +28180,7 @@ * src = tmp * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(5, 1291, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1291, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1292 @@ -26216,7 +28364,7 @@ * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(5, 1313, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error) /* "View.MemoryView":1314 * @@ -26225,7 +28373,7 @@ * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(5, 1314, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error) /* "View.MemoryView":1310 * return 0 @@ -26294,11 +28442,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -26478,7 +28626,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -26502,7 +28650,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -26725,91 +28873,554 @@ * for i in range(extent): * memcpy(data, item, itemsize) */ - __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); - if (__pyx_t_1) { + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1399 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1400 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1401 + * 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":1398 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1403 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1404 + * 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":1406 + * _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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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; - /* "View.MemoryView":1399 - * - * if ndim == 1: - * for i in range(extent): # <<<<<<<<<<<<<< - * memcpy(data, item, itemsize) - * data += stride + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result */ - __pyx_t_2 = __pyx_v_extent; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + } - /* "View.MemoryView":1400 - * if ndim == 1: - * for i in range(extent): - * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< - * data += stride - * else: + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] */ - memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; - /* "View.MemoryView":1401 - * for i in range(extent): - * memcpy(data, item, itemsize) - * data += stride # <<<<<<<<<<<<<< - * else: - * for i in range(extent): + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError */ - __pyx_v_data = (__pyx_v_data + __pyx_v_stride); - } - /* "View.MemoryView":1398 - * cdef Py_ssize_t extent = shape[0] - * - * if ndim == 1: # <<<<<<<<<<<<<< - * for i in range(extent): - * memcpy(data, item, itemsize) + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ - goto __pyx_L3; + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; - /* "View.MemoryView":1403 - * data += stride - * else: - * for i in range(extent): # <<<<<<<<<<<<<< - * _slice_assign_scalar(data, shape + 1, strides + 1, - * ndim - 1, itemsize, item) + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) */ - /*else*/ { - __pyx_t_2 = __pyx_v_extent; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { - /* "View.MemoryView":1404 - * else: - * for i in range(extent): - * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< - * ndim - 1, itemsize, item) - * data += stride + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< */ - __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); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":1406 - * _slice_assign_scalar(data, shape + 1, strides + 1, - * ndim - 1, itemsize, item) - * data += stride # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) */ - __pyx_v_data = (__pyx_v_data + __pyx_v_stride); - } } - __pyx_L3:; - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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_2yt_8geometry_16particle_deposit_ParticleDepositOperation __pyx_vtable_2yt_8geometry_16particle_deposit_ParticleDepositOperation; @@ -26831,7 +29442,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_16particle_deposit_ParticleDepositOperation(PyObject *o) { struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *p = (struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -26890,6 +29501,8 @@ {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_5finalize, METH_VARARGS|METH_KEYWORDS, 0}, {"process_octree", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_7process_octree, METH_VARARGS|METH_KEYWORDS, 0}, {"process_grid", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_9process_grid, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_11__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_13__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -26972,7 +29585,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_16particle_deposit_CountParticles(PyObject *o) { struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *p = (struct __pyx_obj_2yt_8geometry_16particle_deposit_CountParticles *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -26985,6 +29598,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_16particle_deposit_CountParticles[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_14CountParticles_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_14CountParticles_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_14CountParticles_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_14CountParticles_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -27067,7 +29682,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_16particle_deposit_SimpleSmooth(PyObject *o) { struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *p = (struct __pyx_obj_2yt_8geometry_16particle_deposit_SimpleSmooth *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -27081,6 +29696,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_16particle_deposit_SimpleSmooth[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_12SimpleSmooth_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_12SimpleSmooth_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_12SimpleSmooth_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_12SimpleSmooth_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -27161,7 +29778,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_16particle_deposit_SumParticleField(PyObject *o) { struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *p = (struct __pyx_obj_2yt_8geometry_16particle_deposit_SumParticleField *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -27174,6 +29791,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_16particle_deposit_SumParticleField[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_16SumParticleField_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_16SumParticleField_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_16SumParticleField_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_16SumParticleField_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -27258,7 +29877,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_16particle_deposit_StdParticleField(PyObject *o) { struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *p = (struct __pyx_obj_2yt_8geometry_16particle_deposit_StdParticleField *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -27273,6 +29892,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_16particle_deposit_StdParticleField[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_16StdParticleField_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_16StdParticleField_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_16StdParticleField_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_16StdParticleField_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -27354,7 +29975,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_16particle_deposit_CICDeposit(PyObject *o) { struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *p = (struct __pyx_obj_2yt_8geometry_16particle_deposit_CICDeposit *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -27401,6 +30022,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_16particle_deposit_CICDeposit[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_10CICDeposit_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_10CICDeposit_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_10CICDeposit_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_10CICDeposit_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -27488,7 +30111,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_16particle_deposit_WeightedMeanParticleField(PyObject *o) { struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *p = (struct __pyx_obj_2yt_8geometry_16particle_deposit_WeightedMeanParticleField *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -27502,6 +30125,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_16particle_deposit_WeightedMeanParticleField[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -27580,6 +30205,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_16particle_deposit_MeshIdentifier[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_14MeshIdentifier_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_14MeshIdentifier_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_14MeshIdentifier_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_14MeshIdentifier_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -27662,7 +30289,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_16particle_deposit_NNParticleField(PyObject *o) { struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *p = (struct __pyx_obj_2yt_8geometry_16particle_deposit_NNParticleField *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -27676,6 +30303,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_16particle_deposit_NNParticleField[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_15NNParticleField_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_15NNParticleField_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_15NNParticleField_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_16particle_deposit_15NNParticleField_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -27773,7 +30402,7 @@ int e; struct __pyx_obj_2yt_8geometry_16particle_deposit___pyx_scope_struct__initialize *p = (struct __pyx_obj_2yt_8geometry_16particle_deposit___pyx_scope_struct__initialize *)o; if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } return 0; } @@ -27878,7 +30507,7 @@ int e; struct __pyx_obj_2yt_8geometry_16particle_deposit___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_2yt_8geometry_16particle_deposit___pyx_scope_struct_1_genexpr *)o; if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v__) { e = (*v)(p->__pyx_v__, a); if (e) return e; @@ -27980,7 +30609,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -28030,6 +30659,8 @@ 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} }; @@ -28149,7 +30780,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -28177,6 +30808,8 @@ } 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} }; @@ -28264,7 +30897,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -28376,6 +31009,8 @@ {"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} }; @@ -28501,7 +31136,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -28545,6 +31180,8 @@ } 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} }; @@ -28654,6 +31291,7 @@ {&__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}, @@ -28667,10 +31305,13 @@ {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, {&__pyx_n_s_OnceIndirect, __pyx_k_OnceIndirect, sizeof(__pyx_k_OnceIndirect), 0, 0, 1, 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_n_s_RightEdge, __pyx_k_RightEdge, sizeof(__pyx_k_RightEdge), 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_YTBoundsDefinitionError, __pyx_k_YTBoundsDefinitionError, sizeof(__pyx_k_YTBoundsDefinitionError), 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_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, @@ -28680,6 +31321,7 @@ {&__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_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 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}, @@ -28695,6 +31337,7 @@ {&__pyx_n_s_deposit_std, __pyx_k_deposit_std, sizeof(__pyx_k_deposit_std), 0, 0, 1, 1}, {&__pyx_n_s_deposit_sum, __pyx_k_deposit_sum, sizeof(__pyx_k_deposit_sum), 0, 0, 1, 1}, {&__pyx_n_s_deposit_weighted_mean, __pyx_k_deposit_weighted_mean, sizeof(__pyx_k_deposit_weighted_mean), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dom_ind, __pyx_k_dom_ind, sizeof(__pyx_k_dom_ind), 0, 0, 1, 1}, {&__pyx_n_s_domain_id, __pyx_k_domain_id, sizeof(__pyx_k_domain_id), 0, 0, 1, 1}, {&__pyx_n_s_domain_offset, __pyx_k_domain_offset, sizeof(__pyx_k_domain_offset), 0, 0, 1, 1}, @@ -28729,6 +31372,8 @@ {&__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}, @@ -28740,13 +31385,22 @@ {&__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_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 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_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_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_quartic, __pyx_k_quartic, sizeof(__pyx_k_quartic), 0, 0, 1, 1}, {&__pyx_n_s_quintic, __pyx_k_quintic, sizeof(__pyx_k_quintic), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 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_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_kp_s_self_sph_kernel_cannot_be_conver, __pyx_k_self_sph_kernel_cannot_be_conver, sizeof(__pyx_k_self_sph_kernel_cannot_be_conver), 0, 0, 1, 0}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 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}, @@ -28756,6 +31410,7 @@ {&__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_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, @@ -28764,6 +31419,7 @@ {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 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_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, {&__pyx_n_s_wendland2, __pyx_k_wendland2, sizeof(__pyx_k_wendland2), 0, 0, 1, 1}, {&__pyx_n_s_wendland4, __pyx_k_wendland4, sizeof(__pyx_k_wendland4), 0, 0, 1, 1}, @@ -28777,15 +31433,15 @@ static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 74, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 107, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 218, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 799, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 989, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(5, 149, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(5, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(5, 425, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(5, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(5, 818, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(4, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(4, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(4, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(5, 109, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -28809,16 +31465,198 @@ PyTuple_SET_ITEM(__pyx_tuple_, 0, __pyx_int_1); __Pyx_GIVEREF(__pyx_tuple_); - /* "yt/geometry/particle_deposit.pyx":173 + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "(tree fragment)":4 + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "yt/geometry/particle_deposit.pyx":182 * arr = np.asarray(self.count) * arr.shape = self.nvals * return arr.astype("float64") # <<<<<<<<<<<<<< * * deposit_count = CountParticles */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "(tree fragment)":4 + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "(tree fragment)":4 + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "(tree fragment)":4 + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "(tree fragment)":4 + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "(tree fragment)":4 + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "(tree fragment)":4 + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "(tree fragment)":4 + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "(tree fragment)":4 + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_self_sph_kernel_cannot_be_conver); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "selection_routines.pxd":26 + * if "code_length" == str(arr.units): + * return arr + * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(3, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -28827,9 +31665,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(3, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(4, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -28838,9 +31676,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(3, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(4, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -28849,9 +31687,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(3, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(4, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -28860,9 +31698,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(3, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(4, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -28871,9 +31709,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(4, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -28882,9 +31720,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(4, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -28893,9 +31731,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(4, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -28904,29 +31742,18 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(4, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - - /* "selection_routines.pxd":30 - * if "code_length" == str(arr.units): - * return arr - * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< - * return arr - * - */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(4, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(4, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); /* "View.MemoryView":131 * @@ -28935,9 +31762,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(5, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); /* "View.MemoryView":134 * @@ -28946,9 +31773,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(5, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); /* "View.MemoryView":137 * @@ -28957,9 +31784,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(5, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); /* "View.MemoryView":146 * @@ -28968,9 +31795,9 @@ * * */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(5, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -28979,9 +31806,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(5, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -28990,9 +31817,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(5, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "(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__37 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "(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__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -29001,9 +31847,9 @@ * 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(5, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(2, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -29012,9 +31858,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(5, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); /* "View.MemoryView":563 * def suboffsets(self): @@ -29023,12 +31869,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__21 = PyTuple_New(1); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(5, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); + __pyx_tuple__41 = PyTuple_New(1); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__21, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__21); + PyTuple_SET_ITEM(__pyx_tuple__41, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "(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__42 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "(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__43 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); /* "View.MemoryView":668 * if item is Ellipsis: @@ -29037,9 +31902,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(5, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__22); - __Pyx_GIVEREF(__pyx_slice__22); + __pyx_slice__44 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__44)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__44); + __Pyx_GIVEREF(__pyx_slice__44); /* "View.MemoryView":671 * seen_ellipsis = True @@ -29048,9 +31913,9 @@ * have_slices = True * else: */ - __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(5, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__23); - __Pyx_GIVEREF(__pyx_slice__23); + __pyx_slice__45 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__45)) __PYX_ERR(2, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__45); + __Pyx_GIVEREF(__pyx_slice__45); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -29059,9 +31924,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(5, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__24); - __Pyx_GIVEREF(__pyx_slice__24); + __pyx_slice__46 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__46)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__46); + __Pyx_GIVEREF(__pyx_slice__46); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -29070,9 +31935,28 @@ * * */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(5, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + + /* "(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__48 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + + /* "(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__49 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); /* "View.MemoryView":282 * return self.name @@ -29081,9 +31965,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(5, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); /* "View.MemoryView":283 * @@ -29092,9 +31976,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(5, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(2, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -29103,9 +31987,9 @@ * * */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(5, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); /* "View.MemoryView":287 * @@ -29114,9 +31998,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(5, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); /* "View.MemoryView":288 * @@ -29125,9 +32009,19 @@ * * */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(5, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__55 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -29140,6 +32034,7 @@ __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -29206,6 +32101,7 @@ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif @@ -29240,98 +32136,109 @@ /*--- Function export code ---*/ /*--- Type init code ---*/ __pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation = &__pyx_vtable_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - __pyx_vtable_2yt_8geometry_16particle_deposit_ParticleDepositOperation.process = (void (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_process; + __pyx_vtable_2yt_8geometry_16particle_deposit_ParticleDepositOperation.process = (int (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_24ParticleDepositOperation_process; if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_ParticleDepositOperation) < 0) __PYX_ERR(1, 39, __pyx_L1_error) __pyx_type_2yt_8geometry_16particle_deposit_ParticleDepositOperation.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_ParticleDepositOperation.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation) < 0) __PYX_ERR(1, 39, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "ParticleDepositOperation", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_ParticleDepositOperation) < 0) __PYX_ERR(1, 39, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_16particle_deposit_ParticleDepositOperation) < 0) __PYX_ERR(1, 39, __pyx_L1_error) __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation = &__pyx_type_2yt_8geometry_16particle_deposit_ParticleDepositOperation; __pyx_vtabptr_2yt_8geometry_16particle_deposit_CountParticles = &__pyx_vtable_2yt_8geometry_16particle_deposit_CountParticles; __pyx_vtable_2yt_8geometry_16particle_deposit_CountParticles.__pyx_base = *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - __pyx_vtable_2yt_8geometry_16particle_deposit_CountParticles.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_14CountParticles_process; + __pyx_vtable_2yt_8geometry_16particle_deposit_CountParticles.__pyx_base.process = (int (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_14CountParticles_process; __pyx_type_2yt_8geometry_16particle_deposit_CountParticles.tp_base = __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_CountParticles) < 0) __PYX_ERR(1, 147, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_CountParticles) < 0) __PYX_ERR(1, 155, __pyx_L1_error) __pyx_type_2yt_8geometry_16particle_deposit_CountParticles.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_CountParticles.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_CountParticles) < 0) __PYX_ERR(1, 147, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "CountParticles", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_CountParticles) < 0) __PYX_ERR(1, 147, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_CountParticles.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_CountParticles) < 0) __PYX_ERR(1, 155, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "CountParticles", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_CountParticles) < 0) __PYX_ERR(1, 155, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_16particle_deposit_CountParticles) < 0) __PYX_ERR(1, 155, __pyx_L1_error) __pyx_ptype_2yt_8geometry_16particle_deposit_CountParticles = &__pyx_type_2yt_8geometry_16particle_deposit_CountParticles; __pyx_vtabptr_2yt_8geometry_16particle_deposit_SimpleSmooth = &__pyx_vtable_2yt_8geometry_16particle_deposit_SimpleSmooth; __pyx_vtable_2yt_8geometry_16particle_deposit_SimpleSmooth.__pyx_base = *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - __pyx_vtable_2yt_8geometry_16particle_deposit_SimpleSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_12SimpleSmooth_process; + __pyx_vtable_2yt_8geometry_16particle_deposit_SimpleSmooth.__pyx_base.process = (int (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_12SimpleSmooth_process; __pyx_type_2yt_8geometry_16particle_deposit_SimpleSmooth.tp_base = __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_SimpleSmooth) < 0) __PYX_ERR(1, 177, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_SimpleSmooth) < 0) __PYX_ERR(1, 186, __pyx_L1_error) __pyx_type_2yt_8geometry_16particle_deposit_SimpleSmooth.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_SimpleSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_SimpleSmooth) < 0) __PYX_ERR(1, 177, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "SimpleSmooth", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_SimpleSmooth) < 0) __PYX_ERR(1, 177, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_SimpleSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_SimpleSmooth) < 0) __PYX_ERR(1, 186, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SimpleSmooth", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_SimpleSmooth) < 0) __PYX_ERR(1, 186, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_16particle_deposit_SimpleSmooth) < 0) __PYX_ERR(1, 186, __pyx_L1_error) __pyx_ptype_2yt_8geometry_16particle_deposit_SimpleSmooth = &__pyx_type_2yt_8geometry_16particle_deposit_SimpleSmooth; __pyx_vtabptr_2yt_8geometry_16particle_deposit_SumParticleField = &__pyx_vtable_2yt_8geometry_16particle_deposit_SumParticleField; __pyx_vtable_2yt_8geometry_16particle_deposit_SumParticleField.__pyx_base = *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - __pyx_vtable_2yt_8geometry_16particle_deposit_SumParticleField.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_16SumParticleField_process; + __pyx_vtable_2yt_8geometry_16particle_deposit_SumParticleField.__pyx_base.process = (int (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_16SumParticleField_process; __pyx_type_2yt_8geometry_16particle_deposit_SumParticleField.tp_base = __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_SumParticleField) < 0) __PYX_ERR(1, 242, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_SumParticleField) < 0) __PYX_ERR(1, 252, __pyx_L1_error) __pyx_type_2yt_8geometry_16particle_deposit_SumParticleField.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_SumParticleField.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_SumParticleField) < 0) __PYX_ERR(1, 242, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "SumParticleField", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_SumParticleField) < 0) __PYX_ERR(1, 242, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_SumParticleField.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_SumParticleField) < 0) __PYX_ERR(1, 252, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SumParticleField", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_SumParticleField) < 0) __PYX_ERR(1, 252, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_16particle_deposit_SumParticleField) < 0) __PYX_ERR(1, 252, __pyx_L1_error) __pyx_ptype_2yt_8geometry_16particle_deposit_SumParticleField = &__pyx_type_2yt_8geometry_16particle_deposit_SumParticleField; __pyx_vtabptr_2yt_8geometry_16particle_deposit_StdParticleField = &__pyx_vtable_2yt_8geometry_16particle_deposit_StdParticleField; __pyx_vtable_2yt_8geometry_16particle_deposit_StdParticleField.__pyx_base = *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - __pyx_vtable_2yt_8geometry_16particle_deposit_StdParticleField.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_16StdParticleField_process; + __pyx_vtable_2yt_8geometry_16particle_deposit_StdParticleField.__pyx_base.process = (int (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_16StdParticleField_process; __pyx_type_2yt_8geometry_16particle_deposit_StdParticleField.tp_base = __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_StdParticleField) < 0) __PYX_ERR(1, 271, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_StdParticleField) < 0) __PYX_ERR(1, 281, __pyx_L1_error) __pyx_type_2yt_8geometry_16particle_deposit_StdParticleField.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_StdParticleField.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_StdParticleField) < 0) __PYX_ERR(1, 271, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "StdParticleField", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_StdParticleField) < 0) __PYX_ERR(1, 271, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_StdParticleField.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_StdParticleField) < 0) __PYX_ERR(1, 281, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "StdParticleField", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_StdParticleField) < 0) __PYX_ERR(1, 281, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_16particle_deposit_StdParticleField) < 0) __PYX_ERR(1, 281, __pyx_L1_error) __pyx_ptype_2yt_8geometry_16particle_deposit_StdParticleField = &__pyx_type_2yt_8geometry_16particle_deposit_StdParticleField; __pyx_vtabptr_2yt_8geometry_16particle_deposit_CICDeposit = &__pyx_vtable_2yt_8geometry_16particle_deposit_CICDeposit; __pyx_vtable_2yt_8geometry_16particle_deposit_CICDeposit.__pyx_base = *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - __pyx_vtable_2yt_8geometry_16particle_deposit_CICDeposit.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_10CICDeposit_process; + __pyx_vtable_2yt_8geometry_16particle_deposit_CICDeposit.__pyx_base.process = (int (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_10CICDeposit_process; __pyx_type_2yt_8geometry_16particle_deposit_CICDeposit.tp_base = __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_CICDeposit) < 0) __PYX_ERR(1, 328, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_CICDeposit) < 0) __PYX_ERR(1, 339, __pyx_L1_error) __pyx_type_2yt_8geometry_16particle_deposit_CICDeposit.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_CICDeposit.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_CICDeposit) < 0) __PYX_ERR(1, 328, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "CICDeposit", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_CICDeposit) < 0) __PYX_ERR(1, 328, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_CICDeposit.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_CICDeposit) < 0) __PYX_ERR(1, 339, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "CICDeposit", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_CICDeposit) < 0) __PYX_ERR(1, 339, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_16particle_deposit_CICDeposit) < 0) __PYX_ERR(1, 339, __pyx_L1_error) __pyx_ptype_2yt_8geometry_16particle_deposit_CICDeposit = &__pyx_type_2yt_8geometry_16particle_deposit_CICDeposit; __pyx_vtabptr_2yt_8geometry_16particle_deposit_WeightedMeanParticleField = &__pyx_vtable_2yt_8geometry_16particle_deposit_WeightedMeanParticleField; __pyx_vtable_2yt_8geometry_16particle_deposit_WeightedMeanParticleField.__pyx_base = *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - __pyx_vtable_2yt_8geometry_16particle_deposit_WeightedMeanParticleField.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_process; + __pyx_vtable_2yt_8geometry_16particle_deposit_WeightedMeanParticleField.__pyx_base.process = (int (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_25WeightedMeanParticleField_process; __pyx_type_2yt_8geometry_16particle_deposit_WeightedMeanParticleField.tp_base = __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_WeightedMeanParticleField) < 0) __PYX_ERR(1, 381, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_WeightedMeanParticleField) < 0) __PYX_ERR(1, 394, __pyx_L1_error) __pyx_type_2yt_8geometry_16particle_deposit_WeightedMeanParticleField.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_WeightedMeanParticleField.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_WeightedMeanParticleField) < 0) __PYX_ERR(1, 381, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "WeightedMeanParticleField", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_WeightedMeanParticleField) < 0) __PYX_ERR(1, 381, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_WeightedMeanParticleField.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_WeightedMeanParticleField) < 0) __PYX_ERR(1, 394, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "WeightedMeanParticleField", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_WeightedMeanParticleField) < 0) __PYX_ERR(1, 394, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_16particle_deposit_WeightedMeanParticleField) < 0) __PYX_ERR(1, 394, __pyx_L1_error) __pyx_ptype_2yt_8geometry_16particle_deposit_WeightedMeanParticleField = &__pyx_type_2yt_8geometry_16particle_deposit_WeightedMeanParticleField; __pyx_vtabptr_2yt_8geometry_16particle_deposit_MeshIdentifier = &__pyx_vtable_2yt_8geometry_16particle_deposit_MeshIdentifier; __pyx_vtable_2yt_8geometry_16particle_deposit_MeshIdentifier.__pyx_base = *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - __pyx_vtable_2yt_8geometry_16particle_deposit_MeshIdentifier.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_14MeshIdentifier_process; + __pyx_vtable_2yt_8geometry_16particle_deposit_MeshIdentifier.__pyx_base.process = (int (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_14MeshIdentifier_process; __pyx_type_2yt_8geometry_16particle_deposit_MeshIdentifier.tp_base = __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_MeshIdentifier) < 0) __PYX_ERR(1, 417, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_MeshIdentifier) < 0) __PYX_ERR(1, 431, __pyx_L1_error) __pyx_type_2yt_8geometry_16particle_deposit_MeshIdentifier.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_MeshIdentifier.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_MeshIdentifier) < 0) __PYX_ERR(1, 417, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "MeshIdentifier", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_MeshIdentifier) < 0) __PYX_ERR(1, 417, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_MeshIdentifier.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_MeshIdentifier) < 0) __PYX_ERR(1, 431, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "MeshIdentifier", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_MeshIdentifier) < 0) __PYX_ERR(1, 431, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_16particle_deposit_MeshIdentifier) < 0) __PYX_ERR(1, 431, __pyx_L1_error) __pyx_ptype_2yt_8geometry_16particle_deposit_MeshIdentifier = &__pyx_type_2yt_8geometry_16particle_deposit_MeshIdentifier; __pyx_vtabptr_2yt_8geometry_16particle_deposit_NNParticleField = &__pyx_vtable_2yt_8geometry_16particle_deposit_NNParticleField; __pyx_vtable_2yt_8geometry_16particle_deposit_NNParticleField.__pyx_base = *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - __pyx_vtable_2yt_8geometry_16particle_deposit_NNParticleField.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_15NNParticleField_process; + __pyx_vtable_2yt_8geometry_16particle_deposit_NNParticleField.__pyx_base.process = (int (*)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_16particle_deposit_15NNParticleField_process; __pyx_type_2yt_8geometry_16particle_deposit_NNParticleField.tp_base = __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_NNParticleField) < 0) __PYX_ERR(1, 440, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit_NNParticleField) < 0) __PYX_ERR(1, 455, __pyx_L1_error) __pyx_type_2yt_8geometry_16particle_deposit_NNParticleField.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_NNParticleField.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_NNParticleField) < 0) __PYX_ERR(1, 440, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "NNParticleField", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_NNParticleField) < 0) __PYX_ERR(1, 440, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_16particle_deposit_NNParticleField.tp_dict, __pyx_vtabptr_2yt_8geometry_16particle_deposit_NNParticleField) < 0) __PYX_ERR(1, 455, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "NNParticleField", (PyObject *)&__pyx_type_2yt_8geometry_16particle_deposit_NNParticleField) < 0) __PYX_ERR(1, 455, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_16particle_deposit_NNParticleField) < 0) __PYX_ERR(1, 455, __pyx_L1_error) __pyx_ptype_2yt_8geometry_16particle_deposit_NNParticleField = &__pyx_type_2yt_8geometry_16particle_deposit_NNParticleField; - if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit___pyx_scope_struct__initialize) < 0) __PYX_ERR(1, 331, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit___pyx_scope_struct__initialize) < 0) __PYX_ERR(1, 342, __pyx_L1_error) __pyx_type_2yt_8geometry_16particle_deposit___pyx_scope_struct__initialize.tp_print = 0; __pyx_ptype_2yt_8geometry_16particle_deposit___pyx_scope_struct__initialize = &__pyx_type_2yt_8geometry_16particle_deposit___pyx_scope_struct__initialize; - if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(1, 332, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_16particle_deposit___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(1, 343, __pyx_L1_error) __pyx_type_2yt_8geometry_16particle_deposit___pyx_scope_struct_1_genexpr.tp_print = 0; __pyx_ptype_2yt_8geometry_16particle_deposit___pyx_scope_struct_1_genexpr = &__pyx_type_2yt_8geometry_16particle_deposit___pyx_scope_struct_1_genexpr; __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(5, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(5, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(5, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __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; @@ -29341,18 +32248,20 @@ __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(5, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(5, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(5, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(5, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -29364,11 +32273,11 @@ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(6, 9, __pyx_L1_error) __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) __PYX_ERR(7, 8, __pyx_L1_error) __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) __PYX_ERR(8, 15, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 861, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(4, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(4, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(4, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(4, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(4, 861, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = __Pyx_ImportType("yt.geometry.oct_visitors", "OctVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(9, 33, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(9, 33, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = __Pyx_ImportType("yt.geometry.oct_visitors", "CountTotalOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts)) __PYX_ERR(9, 59, __pyx_L1_error) @@ -29407,19 +32316,25 @@ __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(9, 114, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType("yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(9, 117, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(9, 117, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(4, 33, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(4, 33, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(4, 71, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(4, 71, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(4, 74, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(4, 74, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(10, 57, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(10, 57, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(10, 89, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(10, 89, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(10, 97, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(10, 97, __pyx_L1_error) - __pyx_ptype_7cpython_5array_array = __Pyx_ImportType("array", "array", sizeof(arrayobject), 0); if (unlikely(!__pyx_ptype_7cpython_5array_array)) __PYX_ERR(2, 58, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(3, 29, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(3, 29, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(3, 67, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(3, 67, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(3, 70, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(3, 70, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType("yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(3, 74, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(3, 74, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = __Pyx_ImportType("yt.utilities.lib.allocation_container", "ObjectPool", sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(10, 26, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(10, 26, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = __Pyx_ImportType("yt.geometry.oct_container", "OctObjectPool", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(11, 55, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(11, 55, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(11, 63, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(11, 63, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(11, 94, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(11, 94, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(11, 102, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(11, 102, __pyx_L1_error) + __pyx_ptype_7cpython_5array_array = __Pyx_ImportType("array", "array", sizeof(arrayobject), 0); if (unlikely(!__pyx_ptype_7cpython_5array_array)) __PYX_ERR(5, 58, __pyx_L1_error) /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) if (__Pyx_ImportVoidPtr(__pyx_t_1, "ORDER_MAX", (void **)&__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) __PYX_ERR(1, 1, __pyx_L1_error) @@ -29466,75 +32381,75 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/particle_deposit.pyx":175 + /* "yt/geometry/particle_deposit.pyx":184 * return arr.astype("float64") * * deposit_count = CountParticles # <<<<<<<<<<<<<< * * cdef class SimpleSmooth(ParticleDepositOperation): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_count, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_CountParticles)) < 0) __PYX_ERR(1, 175, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_count, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_CountParticles)) < 0) __PYX_ERR(1, 184, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":240 + /* "yt/geometry/particle_deposit.pyx":250 * return self.odata * * deposit_simple_smooth = SimpleSmooth # <<<<<<<<<<<<<< * * cdef class SumParticleField(ParticleDepositOperation): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_simple_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_SimpleSmooth)) < 0) __PYX_ERR(1, 240, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_simple_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_SimpleSmooth)) < 0) __PYX_ERR(1, 250, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":269 + /* "yt/geometry/particle_deposit.pyx":279 * return sum * * deposit_sum = SumParticleField # <<<<<<<<<<<<<< * * cdef class StdParticleField(ParticleDepositOperation): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_sum, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_SumParticleField)) < 0) __PYX_ERR(1, 269, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_sum, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_SumParticleField)) < 0) __PYX_ERR(1, 279, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":326 + /* "yt/geometry/particle_deposit.pyx":337 * return np.sqrt(std2) * * deposit_std = StdParticleField # <<<<<<<<<<<<<< * * cdef class CICDeposit(ParticleDepositOperation): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_std, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_StdParticleField)) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_std, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_StdParticleField)) < 0) __PYX_ERR(1, 337, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":379 + /* "yt/geometry/particle_deposit.pyx":392 * return rv * * deposit_cic = CICDeposit # <<<<<<<<<<<<<< * * cdef class WeightedMeanParticleField(ParticleDepositOperation): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_cic, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_CICDeposit)) < 0) __PYX_ERR(1, 379, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_cic, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_CICDeposit)) < 0) __PYX_ERR(1, 392, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":415 + /* "yt/geometry/particle_deposit.pyx":429 * return rv * * deposit_weighted_mean = WeightedMeanParticleField # <<<<<<<<<<<<<< * * cdef class MeshIdentifier(ParticleDepositOperation): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_weighted_mean, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_WeightedMeanParticleField)) < 0) __PYX_ERR(1, 415, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_weighted_mean, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_WeightedMeanParticleField)) < 0) __PYX_ERR(1, 429, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":438 + /* "yt/geometry/particle_deposit.pyx":453 * return * * deposit_mesh_id = MeshIdentifier # <<<<<<<<<<<<<< * * cdef class NNParticleField(ParticleDepositOperation): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_mesh_id, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_MeshIdentifier)) < 0) __PYX_ERR(1, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_mesh_id, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_MeshIdentifier)) < 0) __PYX_ERR(1, 453, __pyx_L1_error) - /* "yt/geometry/particle_deposit.pyx":487 + /* "yt/geometry/particle_deposit.pyx":502 * return nn * * deposit_nearest = NNParticleField # <<<<<<<<<<<<<< */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_nearest, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_NNParticleField)) < 0) __PYX_ERR(1, 487, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_deposit_nearest, ((PyObject *)__pyx_ptype_2yt_8geometry_16particle_deposit_NNParticleField)) < 0) __PYX_ERR(1, 502, __pyx_L1_error) /* "yt/geometry/particle_deposit.pyx":1 * """ # <<<<<<<<<<<<<< @@ -29553,9 +32468,9 @@ * * def __dealloc__(array self): */ - __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 207, __pyx_L1_error) + __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(5, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_array_type); @@ -29566,7 +32481,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 282, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_4); @@ -29580,7 +32495,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 283, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_4); @@ -29594,7 +32509,7 @@ * * */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 284, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_4); @@ -29608,7 +32523,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 287, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_4); @@ -29622,7 +32537,7 @@ * * */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 288, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_4); @@ -29662,9 +32577,9 @@ * * */ - __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 535, __pyx_L1_error) + __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(5, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(2, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_memoryview_type); @@ -29675,18 +32590,28 @@ * * */ - __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 981, __pyx_L1_error) + __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(5, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(2, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_4) < 0) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -29699,7 +32624,7 @@ __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.geometry.particle_deposit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.geometry.particle_deposit", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -29752,17 +32677,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -29881,8 +32811,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON @@ -29942,11 +32872,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -29969,7 +32895,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -29990,7 +32916,7 @@ #endif /* RaiseArgTupleInvalid */ - static void __Pyx_RaiseArgtupleInvalid( + static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, @@ -30016,7 +32942,7 @@ } /* RaiseDoubleKeywords */ - static void __Pyx_RaiseDoubleKeywordsError( + static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { @@ -30030,7 +32956,7 @@ } /* ParseKeywords */ - static int __Pyx_ParseOptionalKeywords( + static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, @@ -30132,7 +33058,7 @@ } /* KeywordStringCheck */ - static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) @@ -30172,7 +33098,7 @@ } /* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE + #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; @@ -30196,7 +33122,7 @@ #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -30359,7 +33285,7 @@ #endif /* ArgTypeTest */ - static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); @@ -30386,7 +33312,7 @@ } /* BufferFormatCheck */ - static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; } @@ -30936,7 +33862,7 @@ } /* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); @@ -30954,12 +33880,12 @@ } /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* MemviewSliceInit */ - static int + static int __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, @@ -31094,7 +34020,7 @@ } /* GetAttr */ - static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) @@ -31107,7 +34033,7 @@ } /* GetAttr3 */ - static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r = __Pyx_GetAttr(o, n); if (unlikely(!r)) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) @@ -31122,7 +34048,7 @@ } /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -31133,9 +34059,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -31148,9 +34077,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -31202,50 +34134,8 @@ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -/* 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 -} - /* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -31258,13 +34148,13 @@ } /* BufferIndexError */ - static void __Pyx_RaiseBufferIndexError(int axis) { + static void __Pyx_RaiseBufferIndexError(int axis) { PyErr_Format(PyExc_IndexError, "Out of bounds on buffer access (axis %d)", axis); } /* PyFloatBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_EqObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) { const double b = floatval; double a; @@ -31291,7 +34181,7 @@ case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -2) a = -a; break; @@ -31301,7 +34191,7 @@ case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -3) a = -a; break; @@ -31311,7 +34201,7 @@ case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -4) a = -a; break; @@ -31335,12 +34225,12 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -31414,134 +34304,39 @@ } /* ImportFrom */ - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + 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; -} - -/* 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) { - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -#endif - -/* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { - PyObject *exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; - return PyErr_GivenExceptionMatches(exc_type, err); -} -#endif - -/* GetException */ - #if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { -#endif - PyObject *local_type, *local_value, *local_tb; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; + #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; + } } /* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -31559,7 +34354,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -31579,7 +34383,7 @@ } /* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -31619,6 +34423,21 @@ 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; @@ -31662,8 +34481,163 @@ #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 +} + +/* 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) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { +#endif + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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)); @@ -31671,7 +34645,7 @@ } /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -31704,7 +34678,7 @@ } /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -31729,7 +34703,7 @@ #endif /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -31845,7 +34819,7 @@ #endif /* None */ - static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + 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)); @@ -31853,7 +34827,7 @@ } /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -31870,8 +34844,73 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -31890,8 +34929,42 @@ return NULL; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -31971,7 +35044,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -32030,12 +35103,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -32076,8 +35152,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -32100,7 +35176,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -32136,7 +35212,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -32149,7 +35225,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -32171,7 +35247,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -32202,7 +35278,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -32233,7 +35309,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + 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) { @@ -32264,7 +35340,7 @@ } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) { + 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) { @@ -32276,7 +35352,7 @@ } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); } static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { @@ -32288,7 +35364,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -32308,7 +35384,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -32443,7 +35519,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -32463,7 +35539,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -32598,7 +35674,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -32629,7 +35705,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -32696,7 +35772,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -32885,7 +35961,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -33073,51 +36149,20 @@ return (npy_int64) -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; + 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(char) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (char) val; + return (long) val; } } else #endif @@ -33126,32 +36171,32 @@ #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 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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; @@ -33165,86 +36210,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (char) -1; + return (long) -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)) + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } 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 (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 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(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(char) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -33253,7 +36298,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - char val; + long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -33273,40 +36318,71 @@ return val; } #endif - return (char) -1; + return (long) -1; } } else { - char val; + long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (char) -1; - val = __Pyx_PyInt_As_char(tmp); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to char"); - return (char) -1; + "value too large to convert to long"); + return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to char"); - return (char) -1; + "can't convert negative value to long"); + return (long) -1; } -/* 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 (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(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (long) val; + return (char) val; } } else #endif @@ -33315,32 +36391,32 @@ #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 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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; @@ -33354,86 +36430,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (long) -1; + return (char) -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)) + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, 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)) + } 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 (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 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(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, 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)) + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -33442,7 +36518,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - long val; + char val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -33462,28 +36538,28 @@ return val; } #endif - return (long) -1; + return (char) -1; } } else { - long val; + char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; + "value too large to convert to char"); + return (char) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; + "can't convert negative value to char"); + return (char) -1; } /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -33524,7 +36600,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -33706,7 +36782,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_psdc_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_psdc_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_PTR | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) }; @@ -33729,7 +36805,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -33752,7 +36828,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -33775,7 +36851,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -33798,7 +36874,7 @@ } /* FetchCommonType */ - static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); @@ -33837,7 +36913,7 @@ } /* PyObjectCallMethod1 */ - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto done; @@ -33883,7 +36959,7 @@ } /* CoroutineBase */ - #include + #include #include static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); @@ -34416,7 +37492,7 @@ } /* PatchModuleWithCoroutine */ - static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { + static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; @@ -34456,7 +37532,7 @@ } /* PatchGeneratorABC */ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( @@ -34510,7 +37586,7 @@ } /* Generator */ - static PyMethodDef __pyx_Generator_methods[] = { + static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, @@ -34599,7 +37675,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -34615,7 +37691,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -34633,7 +37709,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -34698,7 +37774,7 @@ #endif /* VoidPtrImport */ - #ifndef __PYX_HAVE_RT_ImportVoidPtr + #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; @@ -34747,7 +37823,7 @@ #endif /* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction + #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; @@ -34801,7 +37877,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -34826,6 +37902,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -34834,11 +37912,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/geometry/particle_deposit.pxd yt-3.4.0/yt/geometry/particle_deposit.pxd --- yt-3.3.3/yt/geometry/particle_deposit.pxd 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/particle_deposit.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -21,7 +21,7 @@ from libc.math cimport sqrt from yt.utilities.lib.fp_utils cimport * -from .oct_container cimport Oct, OctAllocationContainer, OctreeContainer +from .oct_container cimport Oct, OctreeContainer cdef extern from "platform_dep.h": void *alloca(int) @@ -136,7 +136,7 @@ cdef kernel_func sph_kernel cdef public object nvals cdef public int update_values - cdef void process(self, int dim[3], np.float64_t left_edge[3], - np.float64_t dds[3], np.int64_t offset, - np.float64_t ppos[3], np.float64_t[:] fields, - np.int64_t domain_ind) + cdef int process(self, int dim[3], np.float64_t left_edge[3], + np.float64_t dds[3], np.int64_t offset, + np.float64_t ppos[3], np.float64_t[:] fields, + np.int64_t domain_ind) except -1 diff -Nru yt-3.3.3/yt/geometry/particle_deposit.pyx yt-3.4.0/yt/geometry/particle_deposit.pyx --- yt-3.3.3/yt/geometry/particle_deposit.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/particle_deposit.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -22,8 +22,8 @@ from cpython cimport PyObject from yt.utilities.lib.fp_utils cimport * -from oct_container cimport Oct, OctAllocationContainer, \ - OctreeContainer, OctInfo +from oct_container cimport \ + Oct, OctreeContainer, OctInfo from cpython.array cimport array, clone from cython.view cimport memoryview as cymemview from yt.utilities.lib.misc_utilities import OnceIndirect @@ -122,10 +122,12 @@ cdef np.int64_t gid = getattr(gobj, "id", -1) cdef np.float64_t dds[3] cdef np.float64_t left_edge[3] + cdef np.float64_t right_edge[3] cdef int dims[3] for i in range(3): dds[i] = gobj.dds[i] left_edge[i] = gobj.LeftEdge[i] + right_edge[i] = gobj.RightEdge[i] dims[i] = gobj.ActiveDimensions[i] for i in range(positions.shape[0]): # Now we process @@ -133,15 +135,21 @@ field_vals[j] = field_pointers[j,i] for j in range(3): pos[j] = positions[i, j] + continue_loop = False + for j in range(3): + if pos[j] < left_edge[j] or pos[j] > right_edge[j]: + continue_loop = True + if continue_loop: + continue self.process(dims, left_edge, dds, 0, pos, field_vals, gid) if self.update_values == 1: for j in range(nf): field_pointers[j][i] = field_vals[j] - cdef void process(self, int dim[3], np.float64_t left_edge[3], - np.float64_t dds[3], np.int64_t offset, - np.float64_t ppos[3], np.float64_t[:] fields, - np.int64_t domain_ind): + cdef int process(self, int dim[3], np.float64_t left_edge[3], + np.float64_t dds[3], np.int64_t offset, + np.float64_t ppos[3], np.float64_t[:] fields, + np.int64_t domain_ind) except -1: raise NotImplementedError cdef class CountParticles(ParticleDepositOperation): @@ -152,20 +160,21 @@ np.zeros(self.nvals, dtype="int64", order='F'), 4) @cython.cdivision(True) - cdef void process(self, int dim[3], - np.float64_t left_edge[3], - np.float64_t dds[3], - np.int64_t offset, # offset into IO field - np.float64_t ppos[3], # this particle's position - np.float64_t[:] fields, - np.int64_t domain_ind - ): + cdef int process(self, int dim[3], + np.float64_t left_edge[3], + np.float64_t dds[3], + np.int64_t offset, # offset into IO field + np.float64_t ppos[3], # this particle's position + np.float64_t[:] fields, + np.int64_t domain_ind + ) except -1: # here we do our thing; this is the kernel cdef int ii[3] cdef int i for i in range(3): ii[i] = ((ppos[i] - left_edge[i])/dds[i]) self.count[ii[2], ii[1], ii[0], offset] += 1 + return 0 def finalize(self): arr = np.asarray(self.count) @@ -188,14 +197,14 @@ np.zeros(self.nvals, dtype="float64", order='F'), 4) @cython.cdivision(True) - cdef void process(self, int dim[3], - np.float64_t left_edge[3], - np.float64_t dds[3], - np.int64_t offset, - np.float64_t ppos[3], - np.float64_t[:] fields, - np.int64_t domain_ind - ): + cdef int process(self, int dim[3], + np.float64_t left_edge[3], + np.float64_t dds[3], + np.int64_t offset, + np.float64_t ppos[3], + np.float64_t[:] fields, + np.int64_t domain_ind + ) except -1: cdef int ii[3] cdef int ib0[3] cdef int ib1[3] @@ -210,7 +219,7 @@ ib0[i] = ii[i] - half_len ib1[i] = ii[i] + half_len if ib0[i] >= dim[i] or ib1[i] <0: - return + return 0 ib0[i] = iclip(ib0[i], 0, dim[i] - 1) ib1[i] = iclip(ib1[i], 0, dim[i] - 1) for i from ib0[0] <= i <= ib1[0]: @@ -233,6 +242,7 @@ for k from ib0[2] <= k <= ib1[2]: dist = self.temp[k,j,i,offset] / kernel_sum self.data[k,j,i,offset] += fields[1] * dist + return 0 def finalize(self): return self.odata @@ -246,20 +256,20 @@ np.zeros(self.nvals, dtype="float64", order='F'), 4) @cython.cdivision(True) - cdef void process(self, int dim[3], - np.float64_t left_edge[3], - np.float64_t dds[3], - np.int64_t offset, - np.float64_t ppos[3], - np.float64_t[:] fields, - np.int64_t domain_ind - ): + cdef int process(self, int dim[3], + np.float64_t left_edge[3], + np.float64_t dds[3], + np.int64_t offset, + np.float64_t ppos[3], + np.float64_t[:] fields, + np.int64_t domain_ind + ) except -1: cdef int ii[3] cdef int i for i in range(3): ii[i] = ((ppos[i] - left_edge[i]) / dds[i]) self.sum[ii[2], ii[1], ii[0], offset] += fields[0] - return + return 0 def finalize(self): sum = np.asarray(self.sum) @@ -288,14 +298,14 @@ np.zeros(self.nvals, dtype="float64", order='F'), 4) @cython.cdivision(True) - cdef void process(self, int dim[3], - np.float64_t left_edge[3], - np.float64_t dds[3], - np.int64_t offset, - np.float64_t ppos[3], - np.float64_t[:] fields, - np.int64_t domain_ind - ): + cdef int process(self, int dim[3], + np.float64_t left_edge[3], + np.float64_t dds[3], + np.int64_t offset, + np.float64_t ppos[3], + np.float64_t[:] fields, + np.int64_t domain_ind + ) except -1: cdef int ii[3] cdef int i, cell_index cdef float k, mk, qk @@ -311,8 +321,9 @@ else: self.mk[ii[2], ii[1], ii[0], offset] = mk + (fields[0] - mk) / k self.qk[ii[2], ii[1], ii[0], offset] = \ - qk + (k - 1.0) * (fields[0] - mk)**2.0 / k + qk + (k - 1.0) * (fields[0] - mk) * (fields[0] - mk) / k self.i[ii[2], ii[1], ii[0], offset] += 1 + return 0 def finalize(self): # This is the standard variance @@ -332,20 +343,20 @@ if not all(_ > 1 for _ in self.nvals): from yt.utilities.exceptions import YTBoundsDefinitionError raise YTBoundsDefinitionError( - "CIC requires minimum of 2 zones in all dimensions", + "CIC requires minimum of 2 zones in all spatial dimensions", self.nvals) self.field = append_axes( np.zeros(self.nvals, dtype="float64", order='F'), 4) @cython.cdivision(True) - cdef void process(self, int dim[3], - np.float64_t left_edge[3], - np.float64_t dds[3], - np.int64_t offset, # offset into IO field - np.float64_t ppos[3], # this particle's position - np.float64_t[:] fields, - np.int64_t domain_ind - ): + cdef int process(self, int dim[3], + np.float64_t left_edge[3], + np.float64_t dds[3], + np.int64_t offset, # offset into IO field + np.float64_t ppos[3], # this particle's position + np.float64_t[:] fields, + np.int64_t domain_ind + ) except -1: cdef int i, j, k cdef np.uint64_t ii @@ -371,6 +382,8 @@ self.field[ind[2] - k, ind[1] - j, ind[0] - i, offset] += \ fields[0]*rdds[0][i]*rdds[1][j]*rdds[2][k] + return 0 + def finalize(self): rv = np.asarray(self.field) rv.shape = self.nvals @@ -390,20 +403,21 @@ np.zeros(self.nvals, dtype='float64', order='F'), 4) @cython.cdivision(True) - cdef void process(self, int dim[3], - np.float64_t left_edge[3], - np.float64_t dds[3], - np.int64_t offset, - np.float64_t ppos[3], - np.float64_t[:] fields, - np.int64_t domain_ind - ): + cdef int process(self, int dim[3], + np.float64_t left_edge[3], + np.float64_t dds[3], + np.int64_t offset, + np.float64_t ppos[3], + np.float64_t[:] fields, + np.int64_t domain_ind + ) except -1: cdef int ii[3] cdef int i for i in range(3): ii[i] = ((ppos[i] - left_edge[i]) / dds[i]) self.w[ii[2], ii[1], ii[0], offset] += fields[1] self.wf[ii[2], ii[1], ii[0], offset] += fields[0] * fields[1] + return 0 def finalize(self): wf = np.asarray(self.wf) @@ -422,15 +436,16 @@ self.update_values = 1 @cython.cdivision(True) - cdef void process(self, int dim[3], + cdef int process(self, int dim[3], np.float64_t left_edge[3], np.float64_t dds[3], np.int64_t offset, np.float64_t ppos[3], np.float64_t[:] fields, np.int64_t domain_ind - ): + ) except -1: fields[0] = domain_ind + return 0 def finalize(self): return @@ -448,14 +463,14 @@ self.distfield[:] = np.inf @cython.cdivision(True) - cdef void process(self, int dim[3], - np.float64_t left_edge[3], - np.float64_t dds[3], - np.int64_t offset, - np.float64_t ppos[3], - np.float64_t[:] fields, - np.int64_t domain_ind - ): + cdef int process(self, int dim[3], + np.float64_t left_edge[3], + np.float64_t dds[3], + np.int64_t offset, + np.float64_t ppos[3], + np.float64_t[:] fields, + np.int64_t domain_ind + ) except -1: # This one is a bit slow. Every grid cell is going to be iterated # over, and we're going to deposit particles in it. cdef int i, j, k @@ -477,7 +492,7 @@ gpos[2] += dds[2] gpos[1] += dds[1] gpos[0] += dds[0] - return + return 0 def finalize(self): nn = np.asarray(self.nnfield) diff -Nru yt-3.3.3/yt/geometry/particle_geometry_handler.py yt-3.4.0/yt/geometry/particle_geometry_handler.py --- yt-3.3.3/yt/geometry/particle_geometry_handler.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/geometry/particle_geometry_handler.py 2017-08-10 18:02:57.000000000 +0000 @@ -69,13 +69,18 @@ def convert(self, unit): return self.dataset.conversion_factors[unit] - def _initialize_particle_handler(self): - self._setup_data_io() + def _setup_filenames(self): template = self.dataset.filename_template ndoms = self.dataset.file_count cls = self.dataset._file_class - self.data_files = [cls(self.dataset, self.io, template % {'num':i}, i) - for i in range(ndoms)] + self.data_files = \ + [cls(self.dataset, self.io, template % {'num':i}, i) + for i in range(ndoms)] + + def _initialize_particle_handler(self): + self._setup_data_io() + self._setup_filenames() + index_ptype = self.index_ptype if index_ptype == "all": self.total_particles = sum( diff -Nru yt-3.3.3/yt/geometry/particle_oct_container.c yt-3.4.0/yt/geometry/particle_oct_container.c --- yt-3.3.3/yt/geometry/particle_oct_container.c 2016-12-12 01:41:30.000000000 +0000 +++ yt-3.4.0/yt/geometry/particle_oct_container.c 2017-08-10 18:20:15.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -11,6 +11,10 @@ ], "libraries": [ "m" + ], + "name": "yt.geometry.particle_oct_container", + "sources": [ + "yt/geometry/particle_oct_container.pyx" ] }, "module_name": "yt.geometry.particle_oct_container" @@ -24,7 +28,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -46,6 +50,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -198,16 +203,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -334,6 +343,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -388,6 +403,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -499,8 +543,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -513,8 +557,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -636,10 +683,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -673,11 +722,12 @@ static const char *__pyx_f[] = { "yt/geometry/particle_oct_container.pyx", + "stringsource", "yt/geometry/selection_routines.pxd", "__init__.pxd", - "stringsource", "type.pxd", "yt/geometry/oct_visitors.pxd", + "yt/utilities/lib/allocation_container.pxd", "yt/geometry/oct_container.pxd", }; /* BufferFormatStructs.proto */ @@ -1012,6 +1062,9 @@ struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject; struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector; +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool; +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool; struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer; @@ -1128,7 +1181,7 @@ __pyx_t_5numpy_float64_t right_edge_x; __pyx_t_5numpy_float64_t right_edge_y; __pyx_t_5numpy_float64_t right_edge_z; - __pyx_t_5numpy_int64_t children_pointers; + __pyx_t_5numpy_int_t children_pointers; __pyx_t_5numpy_int64_t start_index_x; __pyx_t_5numpy_int64_t start_index_y; __pyx_t_5numpy_int64_t start_index_z; @@ -1170,7 +1223,7 @@ struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid; struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells; -/* "selection_routines.pxd":42 +/* "selection_routines.pxd":38 * cdef np.int64_t _hash * * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -1182,7 +1235,7 @@ int visit_covered; }; -/* "selection_routines.pxd":50 +/* "selection_routines.pxd":46 * np.float64_t spos[3], np.float64_t sdds[3], * OctVisitor visitor, int i, int j, int k) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1194,7 +1247,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "selection_routines.pxd":65 +/* "selection_routines.pxd":61 * np.ndarray[np.uint8_t, ndim=3] mask, * int level) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -1205,14 +1258,43 @@ int __pyx_n; __pyx_t_5numpy_uint8_t *cached_mask; }; +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer; +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs; + +/* "yt/utilities/lib/allocation_container.pxd":19 + * from libc.stdlib cimport malloc, free, realloc + * + * cdef struct AllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + void *my_objs; +}; + +/* "yt/utilities/lib/allocation_container.pxd":30 + * cdef np.uint64_t n_con + * cdef AllocationContainer* containers + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except * # <<<<<<<<<<<<<< + * cdef void setup_objs(self, void *obj, np.uint64_t count, + * np.uint64_t offset, np.int64_t con_id) + */ +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs { + int __pyx_n; + __pyx_t_5numpy_int64_t con_id; +}; struct __pyx_t_2yt_8geometry_13oct_container_OctKey; struct __pyx_t_2yt_8geometry_13oct_container_OctInfo; -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_t_2yt_8geometry_13oct_container_OctList; +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs; -/* "oct_container.pxd":28 +/* "oct_container.pxd":30 * cdef int ORDER_MAX * * cdef struct OctKey: # <<<<<<<<<<<<<< @@ -1224,7 +1306,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node; }; -/* "oct_container.pxd":32 +/* "oct_container.pxd":34 * Oct *node * * cdef struct OctInfo: # <<<<<<<<<<<<<< @@ -1238,25 +1320,9 @@ __pyx_t_5numpy_int32_t level; }; -/* "oct_container.pxd":38 +/* "oct_container.pxd":40 * np.int32_t level * - * cdef struct OctAllocationContainer # <<<<<<<<<<<<<< - * cdef struct OctAllocationContainer: - * np.int64_t n - */ -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { - __pyx_t_5numpy_int64_t n; - __pyx_t_5numpy_int64_t n_assigned; - __pyx_t_5numpy_int64_t offset; - __pyx_t_5numpy_int64_t con_id; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *next; - struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_octs; -}; - -/* "oct_container.pxd":47 - * Oct *my_octs - * * cdef struct OctList # <<<<<<<<<<<<<< * * cdef struct OctList: @@ -1266,7 +1332,22 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "oct_container.pxd":69 +/* "oct_container.pxd":48 + * # NOTE: This object *has* to be the same size as the AllocationContainer + * # object. There's an assert in the __cinit__ function. + * cdef struct OctAllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs; +}; + +/* "oct_container.pxd":74 * cdef public np.int64_t nocts * cdef public int num_domains * cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?, # <<<<<<<<<<<<<< @@ -1279,8 +1360,8 @@ int max_level; }; -/* "oct_container.pxd":78 - * # OctAllocationContainer.offset if such a thing exists. +/* "oct_container.pxd":83 + * # AllocationContainer.offset if such a thing exists. * cdef np.int64_t get_domain_offset(self, int domain_id) * cdef void visit_all_octs(self, # <<<<<<<<<<<<<< * selection_routines.SelectorObject selector, @@ -1292,7 +1373,7 @@ }; struct __pyx_opt_args_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_visit; -/* "yt/geometry/particle_oct_container.pyx":253 +/* "yt/geometry/particle_oct_container.pyx":254 * return level_counts * * cdef visit(self, Oct *o, np.int64_t *counts, level = 0): # <<<<<<<<<<<<<< @@ -1562,12 +1643,12 @@ struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base; __Pyx_memviewslice ref_mask; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs; - __pyx_t_5numpy_int64_t *nocts; - __pyx_t_5numpy_int64_t *nfinest; + __pyx_t_5numpy_uint64_t *nocts; + __pyx_t_5numpy_uint64_t *nfinest; }; -/* "selection_routines.pxd":33 +/* "selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1587,7 +1668,7 @@ }; -/* "selection_routines.pxd":71 +/* "selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1599,7 +1680,7 @@ }; -/* "selection_routines.pxd":74 +/* "selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1613,18 +1694,59 @@ }; -/* "oct_container.pxd":57 +/* "selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2; +}; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool { + PyObject_HEAD + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab; + __pyx_t_5numpy_uint64_t itemsize; + __pyx_t_5numpy_uint64_t n_con; + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers; +}; + + +/* "oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; +}; + + +/* "oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer { PyObject_HEAD struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *cont; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer **domains; + struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh; int partial_coverage; int level_offset; @@ -1638,7 +1760,7 @@ }; -/* "oct_container.pxd":89 +/* "oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -1654,7 +1776,7 @@ }; -/* "oct_container.pxd":97 +/* "oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -1666,8 +1788,8 @@ }; -/* "yt/geometry/particle_oct_container.pyx":27 - * cimport cython +/* "yt/geometry/particle_oct_container.pyx":28 + * from cython cimport floating * * cdef class ParticleOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< * cdef Oct** oct_list @@ -1682,7 +1804,7 @@ }; -/* "yt/geometry/particle_oct_container.pyx":270 +/* "yt/geometry/particle_oct_container.pyx":267 * cdef np.uint64_t ONEBIT=1 * * cdef class ParticleRegions: # <<<<<<<<<<<<<< @@ -1702,7 +1824,7 @@ }; -/* "yt/geometry/particle_oct_container.pyx":89 +/* "yt/geometry/particle_oct_container.pyx":90 * self.visit_clear(o.children[cind(i,j,k)]) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -2067,7 +2189,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree; -/* "selection_routines.pxd":33 +/* "selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -2090,7 +2212,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; -/* "selection_routines.pxd":71 +/* "selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2104,7 +2226,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; -/* "selection_routines.pxd":74 +/* "selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2118,12 +2240,58 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; -/* "oct_container.pxd":57 +/* "selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool { + void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args); + void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); + void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + + +/* "oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ + +struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); +}; +static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool; +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); + + +/* "oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer { @@ -2140,7 +2308,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer; -/* "oct_container.pxd":89 +/* "oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -2156,7 +2324,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer; -/* "oct_container.pxd":97 +/* "oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -2170,8 +2338,8 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer; -/* "yt/geometry/particle_oct_container.pyx":27 - * cimport cython +/* "yt/geometry/particle_oct_container.pyx":28 + * from cython cimport floating * * cdef class ParticleOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< * cdef Oct** oct_list @@ -2191,7 +2359,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *__pyx_vtabptr_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer; -/* "yt/geometry/particle_oct_container.pyx":270 +/* "yt/geometry/particle_oct_container.pyx":267 * cdef np.uint64_t ONEBIT=1 * * cdef class ParticleRegions: # <<<<<<<<<<<<<< @@ -2383,7 +2551,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL @@ -2501,9 +2669,24 @@ /* BufferIndexError.proto */ static void __Pyx_RaiseBufferIndexError(int axis); +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* 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 +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); @@ -2583,8 +2766,19 @@ 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 *); +/* 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( @@ -2600,9 +2794,6 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS @@ -2642,6 +2833,13 @@ #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() + /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); @@ -2660,6 +2858,12 @@ /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -2679,6 +2883,12 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value); + /* BufferStructDeclare.proto */ typedef struct { Py_ssize_t shape, strides, suboffsets; @@ -2713,10 +2923,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* MemviewSliceIsContig.proto */ static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, @@ -2832,20 +3039,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + /* MemviewSliceCopyTemplate.proto */ static __Pyx_memviewslice __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, @@ -2879,8 +3086,8 @@ static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); @@ -2968,6 +3175,7 @@ static PyObject *__pyx_f_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_visit(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, __pyx_t_5numpy_int64_t *__pyx_v_counts, struct __pyx_opt_args_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_visit *__pyx_optional_args); /* proto*/ static void __pyx_fuse_0__pyx_f_2yt_8geometry_22particle_oct_container_15ParticleRegions__mask_positions(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_self, PyArrayObject *__pyx_v_pos, __pyx_t_5numpy_uint64_t __pyx_v_file_id, int __pyx_v_filter); /* proto*/ static void __pyx_fuse_1__pyx_f_2yt_8geometry_22particle_oct_container_15ParticleRegions__mask_positions(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_self, PyArrayObject *__pyx_v_pos, __pyx_t_5numpy_uint64_t __pyx_v_file_id, int __pyx_v_filter); /* proto*/ +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ @@ -3015,11 +3223,11 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ /* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ /* Module declarations from 'yt.geometry.oct_visitors' */ static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = 0; @@ -3050,10 +3258,15 @@ static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0; /* Module declarations from 'libc.math' */ +/* Module declarations from 'yt.utilities.lib.allocation_container' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0; + /* Module declarations from 'yt.geometry.oct_container' */ +static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0; @@ -3076,6 +3289,13 @@ static PyObject *indirect_contiguous = 0; static int __pyx_memoryview_thread_locks_used; static PyThread_type_lock __pyx_memoryview_thread_locks[8]; +static PyObject *__pyx_f_2yt_8geometry_22particle_oct_container___pyx_unpickle_ParticleRegions__set_state(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_carray_to_py___pyx_t_5numpy_float64_t(__pyx_t_5numpy_float64_t *, Py_ssize_t); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple___pyx_t_5numpy_float64_t(__pyx_t_5numpy_float64_t *, Py_ssize_t); /*proto*/ +static int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(PyObject *, __pyx_t_5numpy_float64_t *, Py_ssize_t); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_carray_to_py___pyx_t_5numpy_int32_t(__pyx_t_5numpy_int32_t *, Py_ssize_t); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple___pyx_t_5numpy_int32_t(__pyx_t_5numpy_int32_t *, Py_ssize_t); /*proto*/ +static int __Pyx_carray_from_py___pyx_t_5numpy_int32_t(PyObject *, __pyx_t_5numpy_int32_t *, Py_ssize_t); /*proto*/ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ static void *__pyx_align_pointer(void *, size_t); /*proto*/ static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ @@ -3108,31 +3328,35 @@ 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_uint64_t = { "uint64_t", NULL, sizeof(__pyx_t_5numpy_uint64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint64_t), 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; #define __Pyx_MODULE_NAME "yt.geometry.particle_oct_container" int __pyx_module_is_main_yt__geometry__particle_oct_container = 0; /* Implementation of 'yt.geometry.particle_oct_container' */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_ImportError; -static PyObject *__pyx_builtin_MemoryError; +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_TypeError; static PyObject *__pyx_builtin_id; -static PyObject *__pyx_builtin_IndexError; 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_new[] = "__new__"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_dims[] = "dims"; static const char __pyx_k_iter[] = "__iter__"; static const char __pyx_k_main[] = "__main__"; @@ -3165,9 +3389,12 @@ static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_nfiles[] = "nfiles"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_result[] = "result"; static const char __pyx_k_struct[] = "struct"; static const char __pyx_k_uint64[] = "uint64"; static const char __pyx_k_unpack[] = "unpack"; +static const char __pyx_k_update[] = "update"; static const char __pyx_k_file_id[] = "file_id"; static const char __pyx_k_float32[] = "float32"; static const char __pyx_k_float64[] = "float64"; @@ -3175,22 +3402,33 @@ static const char __pyx_k_memview[] = "memview"; static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_left_edge[] = "left_edge"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_right_edge[] = "right_edge"; 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_code_length[] = "code_length"; 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_OverflowError[] = "OverflowError"; static const char __pyx_k_allocate_root[] = "allocate_root"; 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_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_convert_to_units[] = "convert_to_units"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +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_contiguous_and_direct[] = ""; @@ -3201,6 +3439,7 @@ 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_pyx_unpickle_ParticleRegions[] = "__pyx_unpickle_ParticleRegions"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static const char __pyx_k_ParticleOctreeContainer___iter[] = "ParticleOctreeContainer.__iter__"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; @@ -3211,6 +3450,8 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_Incompatible_checksums_s_vs_0x7e[] = "Incompatible checksums (%s vs 0x7e947ae = (dds, dims, idds, left_edge, masks, nfiles, right_edge))"; +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"; @@ -3218,7 +3459,9 @@ 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_dom_offsets_self_oct_list_s[] = "self.dom_offsets,self.oct_list,self.root_mesh 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_yt_geometry_particle_oct_contain[] = "yt.geometry.particle_oct_container"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; @@ -3231,6 +3474,8 @@ 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_0x7e; +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; @@ -3241,11 +3486,14 @@ 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_ParticleOctreeContainer___iter; +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_allocate_buffer; static PyObject *__pyx_n_s_allocate_root; static PyObject *__pyx_n_s_append; @@ -3254,11 +3502,13 @@ 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_n_s_close; static PyObject *__pyx_n_s_code_length; static PyObject *__pyx_kp_s_contiguous_and_direct; static PyObject *__pyx_kp_s_contiguous_and_indirect; static PyObject *__pyx_n_s_convert_to_units; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dims; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_dtype_is_object; @@ -3288,19 +3538,31 @@ 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_nfiles; +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_pack; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_pos; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_ParticleRegions; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_right_edge; +static PyObject *__pyx_kp_s_self_dom_offsets_self_oct_list_s; static PyObject *__pyx_n_s_send; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_start; @@ -3309,6 +3571,7 @@ 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_throw; @@ -3318,6 +3581,7 @@ static PyObject *__pyx_n_s_units; 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_yt_geometry_particle_oct_contain; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_allocate_root(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *__pyx_v_self); /* proto */ @@ -3332,6 +3596,8 @@ static int __pyx_pf_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_9max_level_2__set__(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_5n_ref___get__(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_5n_ref_2__set__(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_17__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_19__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions___init__(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_self, PyObject *__pyx_v_left_edge, PyObject *__pyx_v_right_edge, PyObject *__pyx_v_dims, PyObject *__pyx_v_nfiles); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_2add_data_file(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_self, PyArrayObject *__pyx_v_pos, int __pyx_v_file_id, int __pyx_v_filter); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_4identify_data_files(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector); /* proto */ @@ -3340,6 +3606,9 @@ static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_5masks___get__(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_5masks_2__set__(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_5masks_4__del__(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_6__reduce_cython__(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_8__setstate_cython__(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container___pyx_unpickle_ParticleRegions(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 */ @@ -3349,8 +3618,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -3372,8 +3645,13 @@ 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_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_22particle_oct_container_ParticleRegions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_22particle_oct_container___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3384,6 +3662,8 @@ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_64; +static PyObject *__pyx_int_132728750; +static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; @@ -3394,9 +3674,9 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__20; -static PyObject *__pyx_slice__21; -static PyObject *__pyx_slice__22; +static PyObject *__pyx_slice__26; +static PyObject *__pyx_slice__27; +static PyObject *__pyx_slice__28; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -3407,14 +3687,26 @@ 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__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_codeobj__33; +static PyObject *__pyx_codeobj__40; -/* "yt/geometry/particle_oct_container.pyx":35 +/* "yt/geometry/particle_oct_container.pyx":36 * cdef public int n_ref * * def allocate_root(self): # <<<<<<<<<<<<<< @@ -3450,7 +3742,7 @@ int __pyx_t_6; __Pyx_RefNannySetupContext("allocate_root", 0); - /* "yt/geometry/particle_oct_container.pyx":38 + /* "yt/geometry/particle_oct_container.pyx":39 * cdef int i, j, k * cdef Oct *cur * for i in range(self.nn[0]): # <<<<<<<<<<<<<< @@ -3461,7 +3753,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_oct_container.pyx":39 + /* "yt/geometry/particle_oct_container.pyx":40 * cdef Oct *cur * for i in range(self.nn[0]): * for j in range(self.nn[1]): # <<<<<<<<<<<<<< @@ -3472,7 +3764,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/geometry/particle_oct_container.pyx":40 + /* "yt/geometry/particle_oct_container.pyx":41 * for i in range(self.nn[0]): * for j in range(self.nn[1]): * for k in range(self.nn[2]): # <<<<<<<<<<<<<< @@ -3483,7 +3775,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "yt/geometry/particle_oct_container.pyx":41 + /* "yt/geometry/particle_oct_container.pyx":42 * for j in range(self.nn[1]): * for k in range(self.nn[2]): * cur = self.allocate_oct() # <<<<<<<<<<<<<< @@ -3492,7 +3784,7 @@ */ __pyx_v_cur = ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->allocate_oct(__pyx_v_self); - /* "yt/geometry/particle_oct_container.pyx":42 + /* "yt/geometry/particle_oct_container.pyx":43 * for k in range(self.nn[2]): * cur = self.allocate_oct() * self.root_mesh[i][j][k] = cur # <<<<<<<<<<<<<< @@ -3504,7 +3796,7 @@ } } - /* "yt/geometry/particle_oct_container.pyx":35 + /* "yt/geometry/particle_oct_container.pyx":36 * cdef public int n_ref * * def allocate_root(self): # <<<<<<<<<<<<<< @@ -3519,7 +3811,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":44 +/* "yt/geometry/particle_oct_container.pyx":45 * self.root_mesh[i][j][k] = cur * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -3559,7 +3851,7 @@ Py_ssize_t __pyx_t_14; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "yt/geometry/particle_oct_container.pyx":48 + /* "yt/geometry/particle_oct_container.pyx":49 * #of the root mesh recursively * cdef i, j, k * if self.root_mesh == NULL: return # <<<<<<<<<<<<<< @@ -3571,30 +3863,30 @@ goto __pyx_L0; } - /* "yt/geometry/particle_oct_container.pyx":49 + /* "yt/geometry/particle_oct_container.pyx":50 * cdef i, j, k * if self.root_mesh == NULL: return * for i in range(self.nn[0]): # <<<<<<<<<<<<<< * if self.root_mesh[i] == NULL: continue * for j in range(self.nn[1]): */ - __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->__pyx_base.nn[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->__pyx_base.nn[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __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_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 50, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -3602,17 +3894,17 @@ if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 50, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 50, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -3622,7 +3914,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 49, __pyx_L1_error) + else __PYX_ERR(0, 50, __pyx_L1_error) } break; } @@ -3631,43 +3923,43 @@ __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/particle_oct_container.pyx":50 + /* "yt/geometry/particle_oct_container.pyx":51 * if self.root_mesh == NULL: return * for i in range(self.nn[0]): * if self.root_mesh[i] == NULL: continue # <<<<<<<<<<<<<< * for j in range(self.nn[1]): * if self.root_mesh[i][j] == NULL: continue */ - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_t_1 = (((__pyx_v_self->__pyx_base.root_mesh[__pyx_t_6]) == NULL) != 0); if (__pyx_t_1) { goto __pyx_L4_continue; } - /* "yt/geometry/particle_oct_container.pyx":51 + /* "yt/geometry/particle_oct_container.pyx":52 * for i in range(self.nn[0]): * if self.root_mesh[i] == NULL: continue * for j in range(self.nn[1]): # <<<<<<<<<<<<<< * if self.root_mesh[i][j] == NULL: continue * for k in range(self.nn[2]): */ - __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->__pyx_base.nn[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->__pyx_base.nn[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_7 = __pyx_t_2; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -3675,17 +3967,17 @@ if (likely(PyList_CheckExact(__pyx_t_7))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 52, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 52, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -3695,7 +3987,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 51, __pyx_L1_error) + else __PYX_ERR(0, 52, __pyx_L1_error) } break; } @@ -3704,44 +3996,44 @@ __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/particle_oct_container.pyx":52 + /* "yt/geometry/particle_oct_container.pyx":53 * if self.root_mesh[i] == NULL: continue * for j in range(self.nn[1]): * if self.root_mesh[i][j] == NULL: continue # <<<<<<<<<<<<<< * for k in range(self.nn[2]): * if self.root_mesh[i][j][k] == NULL: continue */ - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_t_1 = ((((__pyx_v_self->__pyx_base.root_mesh[__pyx_t_9])[__pyx_t_10]) == NULL) != 0); if (__pyx_t_1) { goto __pyx_L7_continue; } - /* "yt/geometry/particle_oct_container.pyx":53 + /* "yt/geometry/particle_oct_container.pyx":54 * for j in range(self.nn[1]): * if self.root_mesh[i][j] == NULL: continue * for k in range(self.nn[2]): # <<<<<<<<<<<<<< * if self.root_mesh[i][j][k] == NULL: continue * self.visit_free(self.root_mesh[i][j][k]) */ - __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->__pyx_base.nn[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->__pyx_base.nn[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_11 = __pyx_t_2; __Pyx_INCREF(__pyx_t_11); __pyx_t_10 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 54, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -3749,17 +4041,17 @@ if (likely(PyList_CheckExact(__pyx_t_11))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_11)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 54, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_11, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_11, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_11)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 54, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_11, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_11, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -3769,7 +4061,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 53, __pyx_L1_error) + else __PYX_ERR(0, 54, __pyx_L1_error) } break; } @@ -3778,34 +4070,34 @@ __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/particle_oct_container.pyx":54 + /* "yt/geometry/particle_oct_container.pyx":55 * if self.root_mesh[i][j] == NULL: continue * for k in range(self.nn[2]): * if self.root_mesh[i][j][k] == NULL: continue # <<<<<<<<<<<<<< * self.visit_free(self.root_mesh[i][j][k]) * free(self.oct_list) */ - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) __pyx_t_1 = (((((__pyx_v_self->__pyx_base.root_mesh[__pyx_t_9])[__pyx_t_13])[__pyx_t_14]) == NULL) != 0); if (__pyx_t_1) { goto __pyx_L10_continue; } - /* "yt/geometry/particle_oct_container.pyx":55 + /* "yt/geometry/particle_oct_container.pyx":56 * for k in range(self.nn[2]): * if self.root_mesh[i][j][k] == NULL: continue * self.visit_free(self.root_mesh[i][j][k]) # <<<<<<<<<<<<<< * free(self.oct_list) * free(self.dom_offsets) */ - __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error) ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->visit_free(__pyx_v_self, (((__pyx_v_self->__pyx_base.root_mesh[__pyx_t_14])[__pyx_t_13])[__pyx_t_9])); - /* "yt/geometry/particle_oct_container.pyx":53 + /* "yt/geometry/particle_oct_container.pyx":54 * for j in range(self.nn[1]): * if self.root_mesh[i][j] == NULL: continue * for k in range(self.nn[2]): # <<<<<<<<<<<<<< @@ -3816,7 +4108,7 @@ } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "yt/geometry/particle_oct_container.pyx":51 + /* "yt/geometry/particle_oct_container.pyx":52 * for i in range(self.nn[0]): * if self.root_mesh[i] == NULL: continue * for j in range(self.nn[1]): # <<<<<<<<<<<<<< @@ -3827,7 +4119,7 @@ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/particle_oct_container.pyx":49 + /* "yt/geometry/particle_oct_container.pyx":50 * cdef i, j, k * if self.root_mesh == NULL: return * for i in range(self.nn[0]): # <<<<<<<<<<<<<< @@ -3838,7 +4130,7 @@ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/particle_oct_container.pyx":56 + /* "yt/geometry/particle_oct_container.pyx":57 * if self.root_mesh[i][j][k] == NULL: continue * self.visit_free(self.root_mesh[i][j][k]) * free(self.oct_list) # <<<<<<<<<<<<<< @@ -3847,7 +4139,7 @@ */ free(__pyx_v_self->oct_list); - /* "yt/geometry/particle_oct_container.pyx":57 + /* "yt/geometry/particle_oct_container.pyx":58 * self.visit_free(self.root_mesh[i][j][k]) * free(self.oct_list) * free(self.dom_offsets) # <<<<<<<<<<<<<< @@ -3856,7 +4148,7 @@ */ free(__pyx_v_self->dom_offsets); - /* "yt/geometry/particle_oct_container.pyx":44 + /* "yt/geometry/particle_oct_container.pyx":45 * self.root_mesh[i][j][k] = cur * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -3871,7 +4163,7 @@ __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); - __Pyx_WriteUnraisable("yt.geometry.particle_oct_container.ParticleOctreeContainer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.particle_oct_container.ParticleOctreeContainer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_j); @@ -3879,7 +4171,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_oct_container.pyx":59 +/* "yt/geometry/particle_oct_container.pyx":60 * free(self.dom_offsets) * * cdef void visit_free(self, Oct *o): # <<<<<<<<<<<<<< @@ -3899,7 +4191,7 @@ int __pyx_t_5; __Pyx_RefNannySetupContext("visit_free", 0); - /* "yt/geometry/particle_oct_container.pyx":62 + /* "yt/geometry/particle_oct_container.pyx":63 * #Free the memory for this oct recursively * cdef int i, j, k * for i in range(2): # <<<<<<<<<<<<<< @@ -3909,7 +4201,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/particle_oct_container.pyx":63 + /* "yt/geometry/particle_oct_container.pyx":64 * cdef int i, j, k * for i in range(2): * for j in range(2): # <<<<<<<<<<<<<< @@ -3919,7 +4211,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 2; __pyx_t_2+=1) { __pyx_v_j = __pyx_t_2; - /* "yt/geometry/particle_oct_container.pyx":64 + /* "yt/geometry/particle_oct_container.pyx":65 * for i in range(2): * for j in range(2): * for k in range(2): # <<<<<<<<<<<<<< @@ -3929,7 +4221,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 2; __pyx_t_3+=1) { __pyx_v_k = __pyx_t_3; - /* "yt/geometry/particle_oct_container.pyx":65 + /* "yt/geometry/particle_oct_container.pyx":66 * for j in range(2): * for k in range(2): * if o.children != NULL \ # <<<<<<<<<<<<<< @@ -3943,7 +4235,7 @@ goto __pyx_L10_bool_binop_done; } - /* "yt/geometry/particle_oct_container.pyx":66 + /* "yt/geometry/particle_oct_container.pyx":67 * for k in range(2): * if o.children != NULL \ * and o.children[cind(i,j,k)] != NULL: # <<<<<<<<<<<<<< @@ -3954,7 +4246,7 @@ __pyx_t_4 = __pyx_t_5; __pyx_L10_bool_binop_done:; - /* "yt/geometry/particle_oct_container.pyx":65 + /* "yt/geometry/particle_oct_container.pyx":66 * for j in range(2): * for k in range(2): * if o.children != NULL \ # <<<<<<<<<<<<<< @@ -3963,7 +4255,7 @@ */ if (__pyx_t_4) { - /* "yt/geometry/particle_oct_container.pyx":67 + /* "yt/geometry/particle_oct_container.pyx":68 * if o.children != NULL \ * and o.children[cind(i,j,k)] != NULL: * self.visit_free(o.children[cind(i,j,k)]) # <<<<<<<<<<<<<< @@ -3972,7 +4264,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->visit_free(__pyx_v_self, (__pyx_v_o->children[__pyx_f_2yt_8geometry_12oct_visitors_cind(__pyx_v_i, __pyx_v_j, __pyx_v_k)])); - /* "yt/geometry/particle_oct_container.pyx":65 + /* "yt/geometry/particle_oct_container.pyx":66 * for j in range(2): * for k in range(2): * if o.children != NULL \ # <<<<<<<<<<<<<< @@ -3984,7 +4276,7 @@ } } - /* "yt/geometry/particle_oct_container.pyx":68 + /* "yt/geometry/particle_oct_container.pyx":69 * and o.children[cind(i,j,k)] != NULL: * self.visit_free(o.children[cind(i,j,k)]) * free(o.children) # <<<<<<<<<<<<<< @@ -3993,7 +4285,7 @@ */ free(__pyx_v_o->children); - /* "yt/geometry/particle_oct_container.pyx":69 + /* "yt/geometry/particle_oct_container.pyx":70 * self.visit_free(o.children[cind(i,j,k)]) * free(o.children) * free(o) # <<<<<<<<<<<<<< @@ -4002,7 +4294,7 @@ */ free(__pyx_v_o); - /* "yt/geometry/particle_oct_container.pyx":59 + /* "yt/geometry/particle_oct_container.pyx":60 * free(self.dom_offsets) * * cdef void visit_free(self, Oct *o): # <<<<<<<<<<<<<< @@ -4014,7 +4306,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_oct_container.pyx":71 +/* "yt/geometry/particle_oct_container.pyx":72 * free(o) * * def clear_fileind(self): # <<<<<<<<<<<<<< @@ -4056,30 +4348,30 @@ Py_ssize_t __pyx_t_13; __Pyx_RefNannySetupContext("clear_fileind", 0); - /* "yt/geometry/particle_oct_container.pyx":73 + /* "yt/geometry/particle_oct_container.pyx":74 * def clear_fileind(self): * cdef i, j, k * for i in range(self.nn[0]): # <<<<<<<<<<<<<< * for j in range(self.nn[1]): * for k in range(self.nn[2]): */ - __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->__pyx_base.nn[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->__pyx_base.nn[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __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_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __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(0, 73, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -4087,17 +4379,17 @@ 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_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 74, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 74, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -4107,7 +4399,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 73, __pyx_L1_error) + else __PYX_ERR(0, 74, __pyx_L1_error) } break; } @@ -4116,30 +4408,30 @@ __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/particle_oct_container.pyx":74 + /* "yt/geometry/particle_oct_container.pyx":75 * cdef i, j, k * for i in range(self.nn[0]): * for j in range(self.nn[1]): # <<<<<<<<<<<<<< * for k in range(self.nn[2]): * self.visit_clear(self.root_mesh[i][j][k]) */ - __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->__pyx_base.nn[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->__pyx_base.nn[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 75, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -4147,17 +4439,17 @@ if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 75, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 75, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -4167,7 +4459,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 74, __pyx_L1_error) + else __PYX_ERR(0, 75, __pyx_L1_error) } break; } @@ -4176,30 +4468,30 @@ __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/particle_oct_container.pyx":75 + /* "yt/geometry/particle_oct_container.pyx":76 * for i in range(self.nn[0]): * for j in range(self.nn[1]): * for k in range(self.nn[2]): # <<<<<<<<<<<<<< * self.visit_clear(self.root_mesh[i][j][k]) * */ - __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->__pyx_base.nn[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->__pyx_base.nn[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -4207,17 +4499,17 @@ if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 76, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 76, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -4227,7 +4519,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 75, __pyx_L1_error) + else __PYX_ERR(0, 76, __pyx_L1_error) } break; } @@ -4236,19 +4528,19 @@ __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/particle_oct_container.pyx":76 + /* "yt/geometry/particle_oct_container.pyx":77 * for j in range(self.nn[1]): * for k in range(self.nn[2]): * self.visit_clear(self.root_mesh[i][j][k]) # <<<<<<<<<<<<<< * * cdef void visit_clear(self, Oct *o): */ - __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->visit_clear(__pyx_v_self, (((__pyx_v_self->__pyx_base.root_mesh[__pyx_t_11])[__pyx_t_12])[__pyx_t_13])); - /* "yt/geometry/particle_oct_container.pyx":75 + /* "yt/geometry/particle_oct_container.pyx":76 * for i in range(self.nn[0]): * for j in range(self.nn[1]): * for k in range(self.nn[2]): # <<<<<<<<<<<<<< @@ -4258,7 +4550,7 @@ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/particle_oct_container.pyx":74 + /* "yt/geometry/particle_oct_container.pyx":75 * cdef i, j, k * for i in range(self.nn[0]): * for j in range(self.nn[1]): # <<<<<<<<<<<<<< @@ -4268,7 +4560,7 @@ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/particle_oct_container.pyx":73 + /* "yt/geometry/particle_oct_container.pyx":74 * def clear_fileind(self): * cdef i, j, k * for i in range(self.nn[0]): # <<<<<<<<<<<<<< @@ -4278,7 +4570,7 @@ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/particle_oct_container.pyx":71 + /* "yt/geometry/particle_oct_container.pyx":72 * free(o) * * def clear_fileind(self): # <<<<<<<<<<<<<< @@ -4305,7 +4597,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":78 +/* "yt/geometry/particle_oct_container.pyx":79 * self.visit_clear(self.root_mesh[i][j][k]) * * cdef void visit_clear(self, Oct *o): # <<<<<<<<<<<<<< @@ -4325,7 +4617,7 @@ int __pyx_t_5; __Pyx_RefNannySetupContext("visit_clear", 0); - /* "yt/geometry/particle_oct_container.pyx":81 + /* "yt/geometry/particle_oct_container.pyx":82 * #Free the memory for this oct recursively * cdef int i, j, k * o.file_ind = 0 # <<<<<<<<<<<<<< @@ -4334,7 +4626,7 @@ */ __pyx_v_o->file_ind = 0; - /* "yt/geometry/particle_oct_container.pyx":82 + /* "yt/geometry/particle_oct_container.pyx":83 * cdef int i, j, k * o.file_ind = 0 * for i in range(2): # <<<<<<<<<<<<<< @@ -4344,7 +4636,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/particle_oct_container.pyx":83 + /* "yt/geometry/particle_oct_container.pyx":84 * o.file_ind = 0 * for i in range(2): * for j in range(2): # <<<<<<<<<<<<<< @@ -4354,7 +4646,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 2; __pyx_t_2+=1) { __pyx_v_j = __pyx_t_2; - /* "yt/geometry/particle_oct_container.pyx":84 + /* "yt/geometry/particle_oct_container.pyx":85 * for i in range(2): * for j in range(2): * for k in range(2): # <<<<<<<<<<<<<< @@ -4364,7 +4656,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 2; __pyx_t_3+=1) { __pyx_v_k = __pyx_t_3; - /* "yt/geometry/particle_oct_container.pyx":85 + /* "yt/geometry/particle_oct_container.pyx":86 * for j in range(2): * for k in range(2): * if o.children != NULL \ # <<<<<<<<<<<<<< @@ -4378,7 +4670,7 @@ goto __pyx_L10_bool_binop_done; } - /* "yt/geometry/particle_oct_container.pyx":86 + /* "yt/geometry/particle_oct_container.pyx":87 * for k in range(2): * if o.children != NULL \ * and o.children[cind(i,j,k)] != NULL: # <<<<<<<<<<<<<< @@ -4389,7 +4681,7 @@ __pyx_t_4 = __pyx_t_5; __pyx_L10_bool_binop_done:; - /* "yt/geometry/particle_oct_container.pyx":85 + /* "yt/geometry/particle_oct_container.pyx":86 * for j in range(2): * for k in range(2): * if o.children != NULL \ # <<<<<<<<<<<<<< @@ -4398,7 +4690,7 @@ */ if (__pyx_t_4) { - /* "yt/geometry/particle_oct_container.pyx":87 + /* "yt/geometry/particle_oct_container.pyx":88 * if o.children != NULL \ * and o.children[cind(i,j,k)] != NULL: * self.visit_clear(o.children[cind(i,j,k)]) # <<<<<<<<<<<<<< @@ -4407,7 +4699,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->visit_clear(__pyx_v_self, (__pyx_v_o->children[__pyx_f_2yt_8geometry_12oct_visitors_cind(__pyx_v_i, __pyx_v_j, __pyx_v_k)])); - /* "yt/geometry/particle_oct_container.pyx":85 + /* "yt/geometry/particle_oct_container.pyx":86 * for j in range(2): * for k in range(2): * if o.children != NULL \ # <<<<<<<<<<<<<< @@ -4419,7 +4711,7 @@ } } - /* "yt/geometry/particle_oct_container.pyx":78 + /* "yt/geometry/particle_oct_container.pyx":79 * self.visit_clear(self.root_mesh[i][j][k]) * * cdef void visit_clear(self, Oct *o): # <<<<<<<<<<<<<< @@ -4432,7 +4724,7 @@ } static PyObject *__pyx_gb_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_8generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "yt/geometry/particle_oct_container.pyx":89 +/* "yt/geometry/particle_oct_container.pyx":90 * self.visit_clear(o.children[cind(i,j,k)]) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -4462,7 +4754,7 @@ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_2yt_8geometry_22particle_oct_container___pyx_scope_struct____iter__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 89, __pyx_L1_error) + __PYX_ERR(0, 90, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -4470,7 +4762,7 @@ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_8generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_ParticleOctreeContainer___iter, __pyx_n_s_yt_geometry_particle_oct_contain); if (unlikely(!gen)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_8generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_ParticleOctreeContainer___iter, __pyx_n_s_yt_geometry_particle_oct_contain); if (unlikely(!gen)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -4506,9 +4798,9 @@ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 89, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 90, __pyx_L1_error) - /* "yt/geometry/particle_oct_container.pyx":95 + /* "yt/geometry/particle_oct_container.pyx":96 * cdef int oi * cdef Oct *o * for oi in range(self.nocts): # <<<<<<<<<<<<<< @@ -4519,7 +4811,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_cur_scope->__pyx_v_oi = __pyx_t_2; - /* "yt/geometry/particle_oct_container.pyx":96 + /* "yt/geometry/particle_oct_container.pyx":97 * cdef Oct *o * for oi in range(self.nocts): * o = self.oct_list[oi] # <<<<<<<<<<<<<< @@ -4528,20 +4820,20 @@ */ __pyx_cur_scope->__pyx_v_o = (__pyx_cur_scope->__pyx_v_self->oct_list[__pyx_cur_scope->__pyx_v_oi]); - /* "yt/geometry/particle_oct_container.pyx":97 + /* "yt/geometry/particle_oct_container.pyx":98 * for oi in range(self.nocts): * o = self.oct_list[oi] * yield (o.file_ind, o.domain_ind, o.domain) # <<<<<<<<<<<<<< * * def allocate_domains(self, domain_counts): */ - __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_o->file_ind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_o->file_ind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_o->domain_ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_o->domain_ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_o->domain); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_o->domain); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); @@ -4564,11 +4856,11 @@ __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 97, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 98, __pyx_L1_error) } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "yt/geometry/particle_oct_container.pyx":89 + /* "yt/geometry/particle_oct_container.pyx":90 * self.visit_clear(o.children[cind(i,j,k)]) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -4593,7 +4885,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":99 +/* "yt/geometry/particle_oct_container.pyx":100 * yield (o.file_ind, o.domain_ind, o.domain) * * def allocate_domains(self, domain_counts): # <<<<<<<<<<<<<< @@ -4626,7 +4918,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":102 +/* "yt/geometry/particle_oct_container.pyx":103 * pass * * def finalize(self): # <<<<<<<<<<<<<< @@ -4666,7 +4958,7 @@ __pyx_t_5numpy_int64_t __pyx_t_8; __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_oct_container.pyx":107 + /* "yt/geometry/particle_oct_container.pyx":108 * #And then find the oct index/offset for * #every domain * cdef int max_level = 0 # <<<<<<<<<<<<<< @@ -4675,7 +4967,7 @@ */ __pyx_v_max_level = 0; - /* "yt/geometry/particle_oct_container.pyx":108 + /* "yt/geometry/particle_oct_container.pyx":109 * #every domain * cdef int max_level = 0 * self.oct_list = malloc(sizeof(Oct*)*self.nocts) # <<<<<<<<<<<<<< @@ -4684,7 +4976,7 @@ */ __pyx_v_self->oct_list = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **)malloc(((sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)) * __pyx_v_self->__pyx_base.nocts))); - /* "yt/geometry/particle_oct_container.pyx":109 + /* "yt/geometry/particle_oct_container.pyx":110 * cdef int max_level = 0 * self.oct_list = malloc(sizeof(Oct*)*self.nocts) * cdef np.int64_t i = 0, lpos = 0 # <<<<<<<<<<<<<< @@ -4694,7 +4986,7 @@ __pyx_v_i = 0; __pyx_v_lpos = 0; - /* "yt/geometry/particle_oct_container.pyx":110 + /* "yt/geometry/particle_oct_container.pyx":111 * self.oct_list = malloc(sizeof(Oct*)*self.nocts) * cdef np.int64_t i = 0, lpos = 0 * cdef int cur_dom = -1 # <<<<<<<<<<<<<< @@ -4703,7 +4995,7 @@ */ __pyx_v_cur_dom = -1; - /* "yt/geometry/particle_oct_container.pyx":113 + /* "yt/geometry/particle_oct_container.pyx":114 * # Note that we now assign them in the same order they will be visited * # by recursive visitors. * for i in range(self.nn[0]): # <<<<<<<<<<<<<< @@ -4714,7 +5006,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_oct_container.pyx":114 + /* "yt/geometry/particle_oct_container.pyx":115 * # by recursive visitors. * for i in range(self.nn[0]): * for j in range(self.nn[1]): # <<<<<<<<<<<<<< @@ -4725,7 +5017,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/geometry/particle_oct_container.pyx":115 + /* "yt/geometry/particle_oct_container.pyx":116 * for i in range(self.nn[0]): * for j in range(self.nn[1]): * for k in range(self.nn[2]): # <<<<<<<<<<<<<< @@ -4736,21 +5028,21 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "yt/geometry/particle_oct_container.pyx":116 + /* "yt/geometry/particle_oct_container.pyx":117 * for j in range(self.nn[1]): * for k in range(self.nn[2]): * self.visit_assign(self.root_mesh[i][j][k], &lpos, # <<<<<<<<<<<<<< * 0, &max_level) * assert(lpos == self.nocts) */ - __pyx_t_7 = ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->visit_assign(__pyx_v_self, (((__pyx_v_self->__pyx_base.root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]), (&__pyx_v_lpos), 0, (&__pyx_v_max_level)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_7 = ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->visit_assign(__pyx_v_self, (((__pyx_v_self->__pyx_base.root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]), (&__pyx_v_lpos), 0, (&__pyx_v_max_level)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } } - /* "yt/geometry/particle_oct_container.pyx":118 + /* "yt/geometry/particle_oct_container.pyx":119 * self.visit_assign(self.root_mesh[i][j][k], &lpos, * 0, &max_level) * assert(lpos == self.nocts) # <<<<<<<<<<<<<< @@ -4761,12 +5053,12 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_lpos == __pyx_v_self->__pyx_base.nocts) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 118, __pyx_L1_error) + __PYX_ERR(0, 119, __pyx_L1_error) } } #endif - /* "yt/geometry/particle_oct_container.pyx":119 + /* "yt/geometry/particle_oct_container.pyx":120 * 0, &max_level) * assert(lpos == self.nocts) * for i in range(self.nocts): # <<<<<<<<<<<<<< @@ -4777,7 +5069,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_2; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "yt/geometry/particle_oct_container.pyx":120 + /* "yt/geometry/particle_oct_container.pyx":121 * assert(lpos == self.nocts) * for i in range(self.nocts): * self.oct_list[i].domain_ind = i # <<<<<<<<<<<<<< @@ -4786,7 +5078,7 @@ */ (__pyx_v_self->oct_list[__pyx_v_i])->domain_ind = __pyx_v_i; - /* "yt/geometry/particle_oct_container.pyx":121 + /* "yt/geometry/particle_oct_container.pyx":122 * for i in range(self.nocts): * self.oct_list[i].domain_ind = i * self.oct_list[i].domain = 0 # <<<<<<<<<<<<<< @@ -4795,7 +5087,7 @@ */ (__pyx_v_self->oct_list[__pyx_v_i])->domain = 0; - /* "yt/geometry/particle_oct_container.pyx":122 + /* "yt/geometry/particle_oct_container.pyx":123 * self.oct_list[i].domain_ind = i * self.oct_list[i].domain = 0 * self.oct_list[i].file_ind = -1 # <<<<<<<<<<<<<< @@ -4805,7 +5097,7 @@ (__pyx_v_self->oct_list[__pyx_v_i])->file_ind = -1LL; } - /* "yt/geometry/particle_oct_container.pyx":123 + /* "yt/geometry/particle_oct_container.pyx":124 * self.oct_list[i].domain = 0 * self.oct_list[i].file_ind = -1 * self.max_level = max_level # <<<<<<<<<<<<<< @@ -4814,7 +5106,7 @@ */ __pyx_v_self->max_level = __pyx_v_max_level; - /* "yt/geometry/particle_oct_container.pyx":102 + /* "yt/geometry/particle_oct_container.pyx":103 * pass * * def finalize(self): # <<<<<<<<<<<<<< @@ -4835,7 +5127,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":125 +/* "yt/geometry/particle_oct_container.pyx":126 * self.max_level = max_level * * cdef visit_assign(self, Oct *o, np.int64_t *lpos, int level, int *max_level): # <<<<<<<<<<<<<< @@ -4858,7 +5150,7 @@ PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("visit_assign", 0); - /* "yt/geometry/particle_oct_container.pyx":127 + /* "yt/geometry/particle_oct_container.pyx":128 * cdef visit_assign(self, Oct *o, np.int64_t *lpos, int level, int *max_level): * cdef int i, j, k * self.oct_list[lpos[0]] = o # <<<<<<<<<<<<<< @@ -4867,7 +5159,7 @@ */ (__pyx_v_self->oct_list[(__pyx_v_lpos[0])]) = __pyx_v_o; - /* "yt/geometry/particle_oct_container.pyx":128 + /* "yt/geometry/particle_oct_container.pyx":129 * cdef int i, j, k * self.oct_list[lpos[0]] = o * lpos[0] += 1 # <<<<<<<<<<<<<< @@ -4877,7 +5169,7 @@ __pyx_t_1 = 0; (__pyx_v_lpos[__pyx_t_1]) = ((__pyx_v_lpos[__pyx_t_1]) + 1); - /* "yt/geometry/particle_oct_container.pyx":129 + /* "yt/geometry/particle_oct_container.pyx":130 * self.oct_list[lpos[0]] = o * lpos[0] += 1 * max_level[0] = imax(max_level[0], level) # <<<<<<<<<<<<<< @@ -4886,7 +5178,7 @@ */ (__pyx_v_max_level[0]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_imax((__pyx_v_max_level[0]), __pyx_v_level); - /* "yt/geometry/particle_oct_container.pyx":130 + /* "yt/geometry/particle_oct_container.pyx":131 * lpos[0] += 1 * max_level[0] = imax(max_level[0], level) * for i in range(2): # <<<<<<<<<<<<<< @@ -4896,7 +5188,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 2; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_oct_container.pyx":131 + /* "yt/geometry/particle_oct_container.pyx":132 * max_level[0] = imax(max_level[0], level) * for i in range(2): * for j in range(2): # <<<<<<<<<<<<<< @@ -4906,7 +5198,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 2; __pyx_t_3+=1) { __pyx_v_j = __pyx_t_3; - /* "yt/geometry/particle_oct_container.pyx":132 + /* "yt/geometry/particle_oct_container.pyx":133 * for i in range(2): * for j in range(2): * for k in range(2): # <<<<<<<<<<<<<< @@ -4916,7 +5208,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 2; __pyx_t_4+=1) { __pyx_v_k = __pyx_t_4; - /* "yt/geometry/particle_oct_container.pyx":133 + /* "yt/geometry/particle_oct_container.pyx":134 * for j in range(2): * for k in range(2): * if o.children != NULL \ # <<<<<<<<<<<<<< @@ -4930,7 +5222,7 @@ goto __pyx_L10_bool_binop_done; } - /* "yt/geometry/particle_oct_container.pyx":134 + /* "yt/geometry/particle_oct_container.pyx":135 * for k in range(2): * if o.children != NULL \ * and o.children[cind(i,j,k)] != NULL: # <<<<<<<<<<<<<< @@ -4941,7 +5233,7 @@ __pyx_t_5 = __pyx_t_6; __pyx_L10_bool_binop_done:; - /* "yt/geometry/particle_oct_container.pyx":133 + /* "yt/geometry/particle_oct_container.pyx":134 * for j in range(2): * for k in range(2): * if o.children != NULL \ # <<<<<<<<<<<<<< @@ -4950,18 +5242,18 @@ */ if (__pyx_t_5) { - /* "yt/geometry/particle_oct_container.pyx":135 + /* "yt/geometry/particle_oct_container.pyx":136 * if o.children != NULL \ * and o.children[cind(i,j,k)] != NULL: * self.visit_assign(o.children[cind(i,j,k)], lpos, # <<<<<<<<<<<<<< * level + 1, max_level) * return */ - __pyx_t_7 = ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->visit_assign(__pyx_v_self, (__pyx_v_o->children[__pyx_f_2yt_8geometry_12oct_visitors_cind(__pyx_v_i, __pyx_v_j, __pyx_v_k)]), __pyx_v_lpos, (__pyx_v_level + 1), __pyx_v_max_level); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_7 = ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->visit_assign(__pyx_v_self, (__pyx_v_o->children[__pyx_f_2yt_8geometry_12oct_visitors_cind(__pyx_v_i, __pyx_v_j, __pyx_v_k)]), __pyx_v_lpos, (__pyx_v_level + 1), __pyx_v_max_level); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/particle_oct_container.pyx":133 + /* "yt/geometry/particle_oct_container.pyx":134 * for j in range(2): * for k in range(2): * if o.children != NULL \ # <<<<<<<<<<<<<< @@ -4973,7 +5265,7 @@ } } - /* "yt/geometry/particle_oct_container.pyx":137 + /* "yt/geometry/particle_oct_container.pyx":138 * self.visit_assign(o.children[cind(i,j,k)], lpos, * level + 1, max_level) * return # <<<<<<<<<<<<<< @@ -4984,7 +5276,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/geometry/particle_oct_container.pyx":125 + /* "yt/geometry/particle_oct_container.pyx":126 * self.max_level = max_level * * cdef visit_assign(self, Oct *o, np.int64_t *lpos, int level, int *max_level): # <<<<<<<<<<<<<< @@ -5003,7 +5295,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":139 +/* "yt/geometry/particle_oct_container.pyx":140 * return * * cdef np.int64_t get_domain_offset(self, int domain_id): # <<<<<<<<<<<<<< @@ -5016,7 +5308,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_domain_offset", 0); - /* "yt/geometry/particle_oct_container.pyx":140 + /* "yt/geometry/particle_oct_container.pyx":141 * * cdef np.int64_t get_domain_offset(self, int domain_id): * return 0 # <<<<<<<<<<<<<< @@ -5026,7 +5318,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/particle_oct_container.pyx":139 + /* "yt/geometry/particle_oct_container.pyx":140 * return * * cdef np.int64_t get_domain_offset(self, int domain_id): # <<<<<<<<<<<<<< @@ -5040,7 +5332,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":142 +/* "yt/geometry/particle_oct_container.pyx":143 * return 0 * * cdef Oct* allocate_oct(self): # <<<<<<<<<<<<<< @@ -5054,7 +5346,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("allocate_oct", 0); - /* "yt/geometry/particle_oct_container.pyx":146 + /* "yt/geometry/particle_oct_container.pyx":147 * #We reserve space for n_ref particles, but keep * #track of how many are used with np initially 0 * self.nocts += 1 # <<<<<<<<<<<<<< @@ -5063,7 +5355,7 @@ */ __pyx_v_self->__pyx_base.nocts = (__pyx_v_self->__pyx_base.nocts + 1); - /* "yt/geometry/particle_oct_container.pyx":147 + /* "yt/geometry/particle_oct_container.pyx":148 * #track of how many are used with np initially 0 * self.nocts += 1 * cdef Oct *my_oct = malloc(sizeof(Oct)) # <<<<<<<<<<<<<< @@ -5072,7 +5364,7 @@ */ __pyx_v_my_oct = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)malloc((sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct)))); - /* "yt/geometry/particle_oct_container.pyx":149 + /* "yt/geometry/particle_oct_container.pyx":150 * cdef Oct *my_oct = malloc(sizeof(Oct)) * cdef int i, j, k * my_oct.domain = -1 # <<<<<<<<<<<<<< @@ -5081,7 +5373,7 @@ */ __pyx_v_my_oct->domain = -1LL; - /* "yt/geometry/particle_oct_container.pyx":150 + /* "yt/geometry/particle_oct_container.pyx":151 * cdef int i, j, k * my_oct.domain = -1 * my_oct.file_ind = 0 # <<<<<<<<<<<<<< @@ -5090,7 +5382,7 @@ */ __pyx_v_my_oct->file_ind = 0; - /* "yt/geometry/particle_oct_container.pyx":151 + /* "yt/geometry/particle_oct_container.pyx":152 * my_oct.domain = -1 * my_oct.file_ind = 0 * my_oct.domain_ind = self.nocts - 1 # <<<<<<<<<<<<<< @@ -5099,7 +5391,7 @@ */ __pyx_v_my_oct->domain_ind = (__pyx_v_self->__pyx_base.nocts - 1); - /* "yt/geometry/particle_oct_container.pyx":152 + /* "yt/geometry/particle_oct_container.pyx":153 * my_oct.file_ind = 0 * my_oct.domain_ind = self.nocts - 1 * my_oct.children = NULL # <<<<<<<<<<<<<< @@ -5108,7 +5400,7 @@ */ __pyx_v_my_oct->children = NULL; - /* "yt/geometry/particle_oct_container.pyx":153 + /* "yt/geometry/particle_oct_container.pyx":154 * my_oct.domain_ind = self.nocts - 1 * my_oct.children = NULL * return my_oct # <<<<<<<<<<<<<< @@ -5118,7 +5410,7 @@ __pyx_r = __pyx_v_my_oct; goto __pyx_L0; - /* "yt/geometry/particle_oct_container.pyx":142 + /* "yt/geometry/particle_oct_container.pyx":143 * return 0 * * cdef Oct* allocate_oct(self): # <<<<<<<<<<<<<< @@ -5132,7 +5424,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":158 +/* "yt/geometry/particle_oct_container.pyx":159 * @cython.wraparound(False) * @cython.cdivision(True) * def add(self, np.ndarray[np.uint64_t, ndim=1] indices): # <<<<<<<<<<<<<< @@ -5146,7 +5438,7 @@ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) __PYX_ERR(0, 158, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) __PYX_ERR(0, 159, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_13add(((struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self), ((PyArrayObject *)__pyx_v_indices)); /* function exit code */ @@ -5188,11 +5480,11 @@ __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 158, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 159, __pyx_L1_error) } __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; - /* "yt/geometry/particle_oct_container.pyx":162 + /* "yt/geometry/particle_oct_container.pyx":163 * #Then if that oct has children, add it to them recursively * #If the child needs to be refined because of max particles, do so * cdef np.int64_t no = indices.shape[0], p, index # <<<<<<<<<<<<<< @@ -5201,7 +5493,7 @@ */ __pyx_v_no = (__pyx_v_indices->dimensions[0]); - /* "yt/geometry/particle_oct_container.pyx":165 + /* "yt/geometry/particle_oct_container.pyx":166 * cdef int i, level * cdef int ind[3] * if self.root_mesh[0][0][0] == NULL: self.allocate_root() # <<<<<<<<<<<<<< @@ -5210,7 +5502,7 @@ */ __pyx_t_1 = (((((__pyx_v_self->__pyx_base.root_mesh[0])[0])[0]) == NULL) != 0); if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_allocate_root); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_allocate_root); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -5223,17 +5515,17 @@ } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "yt/geometry/particle_oct_container.pyx":166 + /* "yt/geometry/particle_oct_container.pyx":167 * cdef int ind[3] * if self.root_mesh[0][0][0] == NULL: self.allocate_root() * cdef np.uint64_t *data = indices.data # <<<<<<<<<<<<<< @@ -5242,7 +5534,7 @@ */ __pyx_v_data = ((__pyx_t_5numpy_uint64_t *)__pyx_v_indices->data); - /* "yt/geometry/particle_oct_container.pyx":167 + /* "yt/geometry/particle_oct_container.pyx":168 * if self.root_mesh[0][0][0] == NULL: self.allocate_root() * cdef np.uint64_t *data = indices.data * cdef np.uint64_t FLAG = ~(0) # <<<<<<<<<<<<<< @@ -5251,7 +5543,7 @@ */ __pyx_v_FLAG = (~((__pyx_t_5numpy_uint64_t)0)); - /* "yt/geometry/particle_oct_container.pyx":168 + /* "yt/geometry/particle_oct_container.pyx":169 * cdef np.uint64_t *data = indices.data * cdef np.uint64_t FLAG = ~(0) * for p in range(no): # <<<<<<<<<<<<<< @@ -5262,7 +5554,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_p = __pyx_t_6; - /* "yt/geometry/particle_oct_container.pyx":171 + /* "yt/geometry/particle_oct_container.pyx":172 * # We have morton indices, which means we choose left and right by * # looking at (MAX_ORDER - level) & with the values 1, 2, 4. * level = 0 # <<<<<<<<<<<<<< @@ -5271,7 +5563,7 @@ */ __pyx_v_level = 0; - /* "yt/geometry/particle_oct_container.pyx":172 + /* "yt/geometry/particle_oct_container.pyx":173 * # looking at (MAX_ORDER - level) & with the values 1, 2, 4. * level = 0 * index = indices[p] # <<<<<<<<<<<<<< @@ -5281,7 +5573,7 @@ __pyx_t_7 = __pyx_v_p; __pyx_v_index = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indices.diminfo[0].strides)); - /* "yt/geometry/particle_oct_container.pyx":173 + /* "yt/geometry/particle_oct_container.pyx":174 * level = 0 * index = indices[p] * if index == FLAG: # <<<<<<<<<<<<<< @@ -5291,7 +5583,7 @@ __pyx_t_1 = ((__pyx_v_index == __pyx_v_FLAG) != 0); if (__pyx_t_1) { - /* "yt/geometry/particle_oct_container.pyx":176 + /* "yt/geometry/particle_oct_container.pyx":177 * # This is a marker for the index not being inside the domain * # we're interested in. * continue # <<<<<<<<<<<<<< @@ -5300,7 +5592,7 @@ */ goto __pyx_L4_continue; - /* "yt/geometry/particle_oct_container.pyx":173 + /* "yt/geometry/particle_oct_container.pyx":174 * level = 0 * index = indices[p] * if index == FLAG: # <<<<<<<<<<<<<< @@ -5309,7 +5601,7 @@ */ } - /* "yt/geometry/particle_oct_container.pyx":177 + /* "yt/geometry/particle_oct_container.pyx":178 * # we're interested in. * continue * for i in range(3): # <<<<<<<<<<<<<< @@ -5319,7 +5611,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < 3; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "yt/geometry/particle_oct_container.pyx":178 + /* "yt/geometry/particle_oct_container.pyx":179 * continue * for i in range(3): * ind[i] = (index >> ((ORDER_MAX - level)*3 + (2 - i))) & 1 # <<<<<<<<<<<<<< @@ -5329,7 +5621,7 @@ (__pyx_v_ind[__pyx_v_i]) = ((__pyx_v_index >> (((__pyx_v_2yt_8geometry_13oct_container_ORDER_MAX - __pyx_v_level) * 3) + (2 - __pyx_v_i))) & 1); } - /* "yt/geometry/particle_oct_container.pyx":179 + /* "yt/geometry/particle_oct_container.pyx":180 * for i in range(3): * ind[i] = (index >> ((ORDER_MAX - level)*3 + (2 - i))) & 1 * cur = self.root_mesh[ind[0]][ind[1]][ind[2]] # <<<<<<<<<<<<<< @@ -5338,7 +5630,7 @@ */ __pyx_v_cur = (((__pyx_v_self->__pyx_base.root_mesh[(__pyx_v_ind[0])])[(__pyx_v_ind[1])])[(__pyx_v_ind[2])]); - /* "yt/geometry/particle_oct_container.pyx":180 + /* "yt/geometry/particle_oct_container.pyx":181 * ind[i] = (index >> ((ORDER_MAX - level)*3 + (2 - i))) & 1 * cur = self.root_mesh[ind[0]][ind[1]][ind[2]] * if cur == NULL: # <<<<<<<<<<<<<< @@ -5348,7 +5640,7 @@ __pyx_t_1 = ((__pyx_v_cur == NULL) != 0); if (__pyx_t_1) { - /* "yt/geometry/particle_oct_container.pyx":181 + /* "yt/geometry/particle_oct_container.pyx":182 * cur = self.root_mesh[ind[0]][ind[1]][ind[2]] * if cur == NULL: * raise RuntimeError # <<<<<<<<<<<<<< @@ -5356,9 +5648,9 @@ * if level >= ORDER_MAX: break # Just dump it here. */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 181, __pyx_L1_error) + __PYX_ERR(0, 182, __pyx_L1_error) - /* "yt/geometry/particle_oct_container.pyx":180 + /* "yt/geometry/particle_oct_container.pyx":181 * ind[i] = (index >> ((ORDER_MAX - level)*3 + (2 - i))) & 1 * cur = self.root_mesh[ind[0]][ind[1]][ind[2]] * if cur == NULL: # <<<<<<<<<<<<<< @@ -5367,7 +5659,7 @@ */ } - /* "yt/geometry/particle_oct_container.pyx":182 + /* "yt/geometry/particle_oct_container.pyx":183 * if cur == NULL: * raise RuntimeError * while (cur.file_ind + 1) > self.n_ref: # <<<<<<<<<<<<<< @@ -5378,7 +5670,7 @@ __pyx_t_1 = (((__pyx_v_cur->file_ind + 1) > __pyx_v_self->n_ref) != 0); if (!__pyx_t_1) break; - /* "yt/geometry/particle_oct_container.pyx":183 + /* "yt/geometry/particle_oct_container.pyx":184 * raise RuntimeError * while (cur.file_ind + 1) > self.n_ref: * if level >= ORDER_MAX: break # Just dump it here. # <<<<<<<<<<<<<< @@ -5390,7 +5682,7 @@ goto __pyx_L11_break; } - /* "yt/geometry/particle_oct_container.pyx":184 + /* "yt/geometry/particle_oct_container.pyx":185 * while (cur.file_ind + 1) > self.n_ref: * if level >= ORDER_MAX: break # Just dump it here. * level += 1 # <<<<<<<<<<<<<< @@ -5399,7 +5691,7 @@ */ __pyx_v_level = (__pyx_v_level + 1); - /* "yt/geometry/particle_oct_container.pyx":185 + /* "yt/geometry/particle_oct_container.pyx":186 * if level >= ORDER_MAX: break # Just dump it here. * level += 1 * for i in range(3): # <<<<<<<<<<<<<< @@ -5409,7 +5701,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < 3; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "yt/geometry/particle_oct_container.pyx":186 + /* "yt/geometry/particle_oct_container.pyx":187 * level += 1 * for i in range(3): * ind[i] = (index >> ((ORDER_MAX - level)*3 + (2 - i))) & 1 # <<<<<<<<<<<<<< @@ -5419,7 +5711,7 @@ (__pyx_v_ind[__pyx_v_i]) = ((__pyx_v_index >> (((__pyx_v_2yt_8geometry_13oct_container_ORDER_MAX - __pyx_v_level) * 3) + (2 - __pyx_v_i))) & 1); } - /* "yt/geometry/particle_oct_container.pyx":187 + /* "yt/geometry/particle_oct_container.pyx":188 * for i in range(3): * ind[i] = (index >> ((ORDER_MAX - level)*3 + (2 - i))) & 1 * if cur.children == NULL or \ # <<<<<<<<<<<<<< @@ -5433,7 +5725,7 @@ goto __pyx_L16_bool_binop_done; } - /* "yt/geometry/particle_oct_container.pyx":188 + /* "yt/geometry/particle_oct_container.pyx":189 * ind[i] = (index >> ((ORDER_MAX - level)*3 + (2 - i))) & 1 * if cur.children == NULL or \ * cur.children[cind(ind[0],ind[1],ind[2])] == NULL: # <<<<<<<<<<<<<< @@ -5444,7 +5736,7 @@ __pyx_t_1 = __pyx_t_9; __pyx_L16_bool_binop_done:; - /* "yt/geometry/particle_oct_container.pyx":187 + /* "yt/geometry/particle_oct_container.pyx":188 * for i in range(3): * ind[i] = (index >> ((ORDER_MAX - level)*3 + (2 - i))) & 1 * if cur.children == NULL or \ # <<<<<<<<<<<<<< @@ -5453,7 +5745,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/particle_oct_container.pyx":189 + /* "yt/geometry/particle_oct_container.pyx":190 * if cur.children == NULL or \ * cur.children[cind(ind[0],ind[1],ind[2])] == NULL: * cur = self.refine_oct(cur, index, level) # <<<<<<<<<<<<<< @@ -5462,7 +5754,7 @@ */ __pyx_v_cur = ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->refine_oct(__pyx_v_self, __pyx_v_cur, __pyx_v_index, __pyx_v_level); - /* "yt/geometry/particle_oct_container.pyx":190 + /* "yt/geometry/particle_oct_container.pyx":191 * cur.children[cind(ind[0],ind[1],ind[2])] == NULL: * cur = self.refine_oct(cur, index, level) * self.filter_particles(cur, data, p, level) # <<<<<<<<<<<<<< @@ -5471,7 +5763,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->filter_particles(__pyx_v_self, __pyx_v_cur, __pyx_v_data, __pyx_v_p, __pyx_v_level); - /* "yt/geometry/particle_oct_container.pyx":187 + /* "yt/geometry/particle_oct_container.pyx":188 * for i in range(3): * ind[i] = (index >> ((ORDER_MAX - level)*3 + (2 - i))) & 1 * if cur.children == NULL or \ # <<<<<<<<<<<<<< @@ -5481,7 +5773,7 @@ goto __pyx_L15; } - /* "yt/geometry/particle_oct_container.pyx":192 + /* "yt/geometry/particle_oct_container.pyx":193 * self.filter_particles(cur, data, p, level) * else: * cur = cur.children[cind(ind[0],ind[1],ind[2])] # <<<<<<<<<<<<<< @@ -5495,7 +5787,7 @@ } __pyx_L11_break:; - /* "yt/geometry/particle_oct_container.pyx":193 + /* "yt/geometry/particle_oct_container.pyx":194 * else: * cur = cur.children[cind(ind[0],ind[1],ind[2])] * cur.file_ind += 1 # <<<<<<<<<<<<<< @@ -5506,7 +5798,7 @@ __pyx_L4_continue:; } - /* "yt/geometry/particle_oct_container.pyx":158 + /* "yt/geometry/particle_oct_container.pyx":159 * @cython.wraparound(False) * @cython.cdivision(True) * def add(self, np.ndarray[np.uint64_t, ndim=1] indices): # <<<<<<<<<<<<<< @@ -5538,7 +5830,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":198 +/* "yt/geometry/particle_oct_container.pyx":199 * @cython.wraparound(False) * @cython.cdivision(True) * cdef Oct *refine_oct(self, Oct *o, np.uint64_t index, int level): # <<<<<<<<<<<<<< @@ -5560,7 +5852,7 @@ __pyx_t_5numpy_int64_t __pyx_t_4; __Pyx_RefNannySetupContext("refine_oct", 0); - /* "yt/geometry/particle_oct_container.pyx":207 + /* "yt/geometry/particle_oct_container.pyx":208 * cdef np.uint64_t prefix1, prefix2 * # TODO: This does not need to be changed. * o.children = malloc(sizeof(Oct *)*8) # <<<<<<<<<<<<<< @@ -5569,7 +5861,7 @@ */ __pyx_v_o->children = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **)malloc(((sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)) * 8))); - /* "yt/geometry/particle_oct_container.pyx":208 + /* "yt/geometry/particle_oct_container.pyx":209 * # TODO: This does not need to be changed. * o.children = malloc(sizeof(Oct *)*8) * for i in range(2): # <<<<<<<<<<<<<< @@ -5579,7 +5871,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/particle_oct_container.pyx":209 + /* "yt/geometry/particle_oct_container.pyx":210 * o.children = malloc(sizeof(Oct *)*8) * for i in range(2): * for j in range(2): # <<<<<<<<<<<<<< @@ -5589,7 +5881,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 2; __pyx_t_2+=1) { __pyx_v_j = __pyx_t_2; - /* "yt/geometry/particle_oct_container.pyx":210 + /* "yt/geometry/particle_oct_container.pyx":211 * for i in range(2): * for j in range(2): * for k in range(2): # <<<<<<<<<<<<<< @@ -5599,7 +5891,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 2; __pyx_t_3+=1) { __pyx_v_k = __pyx_t_3; - /* "yt/geometry/particle_oct_container.pyx":211 + /* "yt/geometry/particle_oct_container.pyx":212 * for j in range(2): * for k in range(2): * noct = self.allocate_oct() # <<<<<<<<<<<<<< @@ -5608,7 +5900,7 @@ */ __pyx_v_noct = ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->allocate_oct(__pyx_v_self); - /* "yt/geometry/particle_oct_container.pyx":212 + /* "yt/geometry/particle_oct_container.pyx":213 * for k in range(2): * noct = self.allocate_oct() * noct.domain = o.domain # <<<<<<<<<<<<<< @@ -5618,7 +5910,7 @@ __pyx_t_4 = __pyx_v_o->domain; __pyx_v_noct->domain = __pyx_t_4; - /* "yt/geometry/particle_oct_container.pyx":213 + /* "yt/geometry/particle_oct_container.pyx":214 * noct = self.allocate_oct() * noct.domain = o.domain * noct.file_ind = 0 # <<<<<<<<<<<<<< @@ -5627,7 +5919,7 @@ */ __pyx_v_noct->file_ind = 0; - /* "yt/geometry/particle_oct_container.pyx":214 + /* "yt/geometry/particle_oct_container.pyx":215 * noct.domain = o.domain * noct.file_ind = 0 * o.children[cind(i,j,k)] = noct # <<<<<<<<<<<<<< @@ -5639,7 +5931,7 @@ } } - /* "yt/geometry/particle_oct_container.pyx":215 + /* "yt/geometry/particle_oct_container.pyx":216 * noct.file_ind = 0 * o.children[cind(i,j,k)] = noct * o.file_ind = self.n_ref + 1 # <<<<<<<<<<<<<< @@ -5648,7 +5940,7 @@ */ __pyx_v_o->file_ind = (__pyx_v_self->n_ref + 1); - /* "yt/geometry/particle_oct_container.pyx":216 + /* "yt/geometry/particle_oct_container.pyx":217 * o.children[cind(i,j,k)] = noct * o.file_ind = self.n_ref + 1 * for i in range(3): # <<<<<<<<<<<<<< @@ -5658,7 +5950,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/particle_oct_container.pyx":217 + /* "yt/geometry/particle_oct_container.pyx":218 * o.file_ind = self.n_ref + 1 * for i in range(3): * ind[i] = (index >> ((ORDER_MAX - level)*3 + (2 - i))) & 1 # <<<<<<<<<<<<<< @@ -5668,7 +5960,7 @@ (__pyx_v_ind[__pyx_v_i]) = ((__pyx_v_index >> (((__pyx_v_2yt_8geometry_13oct_container_ORDER_MAX - __pyx_v_level) * 3) + (2 - __pyx_v_i))) & 1); } - /* "yt/geometry/particle_oct_container.pyx":218 + /* "yt/geometry/particle_oct_container.pyx":219 * for i in range(3): * ind[i] = (index >> ((ORDER_MAX - level)*3 + (2 - i))) & 1 * noct = o.children[cind(ind[0],ind[1],ind[2])] # <<<<<<<<<<<<<< @@ -5677,7 +5969,7 @@ */ __pyx_v_noct = (__pyx_v_o->children[__pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_ind[0]), (__pyx_v_ind[1]), (__pyx_v_ind[2]))]); - /* "yt/geometry/particle_oct_container.pyx":219 + /* "yt/geometry/particle_oct_container.pyx":220 * ind[i] = (index >> ((ORDER_MAX - level)*3 + (2 - i))) & 1 * noct = o.children[cind(ind[0],ind[1],ind[2])] * return noct # <<<<<<<<<<<<<< @@ -5687,7 +5979,7 @@ __pyx_r = __pyx_v_noct; goto __pyx_L0; - /* "yt/geometry/particle_oct_container.pyx":198 + /* "yt/geometry/particle_oct_container.pyx":199 * @cython.wraparound(False) * @cython.cdivision(True) * cdef Oct *refine_oct(self, Oct *o, np.uint64_t index, int level): # <<<<<<<<<<<<<< @@ -5701,7 +5993,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":221 +/* "yt/geometry/particle_oct_container.pyx":222 * return noct * * cdef void filter_particles(self, Oct *o, np.uint64_t *data, np.int64_t p, # <<<<<<<<<<<<<< @@ -5721,7 +6013,7 @@ int __pyx_t_3; __Pyx_RefNannySetupContext("filter_particles", 0); - /* "yt/geometry/particle_oct_container.pyx":224 + /* "yt/geometry/particle_oct_container.pyx":225 * int level): * # Now we look at the last nref particles to decide where they go. * cdef int n = imin(p, self.n_ref) # <<<<<<<<<<<<<< @@ -5730,7 +6022,7 @@ */ __pyx_v_n = __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_v_p, __pyx_v_self->n_ref); - /* "yt/geometry/particle_oct_container.pyx":225 + /* "yt/geometry/particle_oct_container.pyx":226 * # Now we look at the last nref particles to decide where they go. * cdef int n = imin(p, self.n_ref) * cdef np.uint64_t *arr = data + imax(p - self.n_ref, 0) # <<<<<<<<<<<<<< @@ -5739,7 +6031,7 @@ */ __pyx_v_arr = (__pyx_v_data + __pyx_f_2yt_9utilities_3lib_8fp_utils_imax((__pyx_v_p - __pyx_v_self->n_ref), 0)); - /* "yt/geometry/particle_oct_container.pyx":230 + /* "yt/geometry/particle_oct_container.pyx":231 * # As long as we're actually in Morton order, we do not need to worry * # about *any* of the other children of the oct. * prefix1 = data[p] >> (ORDER_MAX - level)*3 # <<<<<<<<<<<<<< @@ -5748,7 +6040,7 @@ */ __pyx_v_prefix1 = ((__pyx_v_data[__pyx_v_p]) >> ((__pyx_v_2yt_8geometry_13oct_container_ORDER_MAX - __pyx_v_level) * 3)); - /* "yt/geometry/particle_oct_container.pyx":231 + /* "yt/geometry/particle_oct_container.pyx":232 * # about *any* of the other children of the oct. * prefix1 = data[p] >> (ORDER_MAX - level)*3 * for i in range(n): # <<<<<<<<<<<<<< @@ -5759,7 +6051,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_oct_container.pyx":232 + /* "yt/geometry/particle_oct_container.pyx":233 * prefix1 = data[p] >> (ORDER_MAX - level)*3 * for i in range(n): * prefix2 = arr[i] >> (ORDER_MAX - level)*3 # <<<<<<<<<<<<<< @@ -5768,7 +6060,7 @@ */ __pyx_v_prefix2 = ((__pyx_v_arr[__pyx_v_i]) >> ((__pyx_v_2yt_8geometry_13oct_container_ORDER_MAX - __pyx_v_level) * 3)); - /* "yt/geometry/particle_oct_container.pyx":233 + /* "yt/geometry/particle_oct_container.pyx":234 * for i in range(n): * prefix2 = arr[i] >> (ORDER_MAX - level)*3 * if (prefix1 == prefix2): # <<<<<<<<<<<<<< @@ -5778,7 +6070,7 @@ __pyx_t_3 = ((__pyx_v_prefix1 == __pyx_v_prefix2) != 0); if (__pyx_t_3) { - /* "yt/geometry/particle_oct_container.pyx":234 + /* "yt/geometry/particle_oct_container.pyx":235 * prefix2 = arr[i] >> (ORDER_MAX - level)*3 * if (prefix1 == prefix2): * o.file_ind += 1 # <<<<<<<<<<<<<< @@ -5787,7 +6079,7 @@ */ __pyx_v_o->file_ind = (__pyx_v_o->file_ind + 1); - /* "yt/geometry/particle_oct_container.pyx":233 + /* "yt/geometry/particle_oct_container.pyx":234 * for i in range(n): * prefix2 = arr[i] >> (ORDER_MAX - level)*3 * if (prefix1 == prefix2): # <<<<<<<<<<<<<< @@ -5797,7 +6089,7 @@ } } - /* "yt/geometry/particle_oct_container.pyx":221 + /* "yt/geometry/particle_oct_container.pyx":222 * return noct * * cdef void filter_particles(self, Oct *o, np.uint64_t *data, np.int64_t p, # <<<<<<<<<<<<<< @@ -5809,7 +6101,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_oct_container.pyx":237 +/* "yt/geometry/particle_oct_container.pyx":238 * #print ind[0], ind[1], ind[2], o.file_ind, level * * def recursively_count(self): # <<<<<<<<<<<<<< @@ -5849,7 +6141,7 @@ PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("recursively_count", 0); - /* "yt/geometry/particle_oct_container.pyx":241 + /* "yt/geometry/particle_oct_container.pyx":242 * cdef int i, j, k * cdef np.int64_t counts[128] * for i in range(128): counts[i] = 0 # <<<<<<<<<<<<<< @@ -5861,7 +6153,7 @@ (__pyx_v_counts[__pyx_v_i]) = 0; } - /* "yt/geometry/particle_oct_container.pyx":242 + /* "yt/geometry/particle_oct_container.pyx":243 * cdef np.int64_t counts[128] * for i in range(128): counts[i] = 0 * for i in range(self.nn[0]): # <<<<<<<<<<<<<< @@ -5872,7 +6164,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_oct_container.pyx":243 + /* "yt/geometry/particle_oct_container.pyx":244 * for i in range(128): counts[i] = 0 * for i in range(self.nn[0]): * for j in range(self.nn[1]): # <<<<<<<<<<<<<< @@ -5883,7 +6175,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/geometry/particle_oct_container.pyx":244 + /* "yt/geometry/particle_oct_container.pyx":245 * for i in range(self.nn[0]): * for j in range(self.nn[1]): * for k in range(self.nn[2]): # <<<<<<<<<<<<<< @@ -5894,7 +6186,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "yt/geometry/particle_oct_container.pyx":245 + /* "yt/geometry/particle_oct_container.pyx":246 * for j in range(self.nn[1]): * for k in range(self.nn[2]): * if self.root_mesh[i][j][k] != NULL: # <<<<<<<<<<<<<< @@ -5904,18 +6196,18 @@ __pyx_t_7 = (((((__pyx_v_self->__pyx_base.root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]) != NULL) != 0); if (__pyx_t_7) { - /* "yt/geometry/particle_oct_container.pyx":246 + /* "yt/geometry/particle_oct_container.pyx":247 * for k in range(self.nn[2]): * if self.root_mesh[i][j][k] != NULL: * self.visit(self.root_mesh[i][j][k], counts) # <<<<<<<<<<<<<< * level_counts = {} * for i in range(128): */ - __pyx_t_8 = ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->visit(__pyx_v_self, (((__pyx_v_self->__pyx_base.root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]), __pyx_v_counts, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_8 = ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->visit(__pyx_v_self, (((__pyx_v_self->__pyx_base.root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]), __pyx_v_counts, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/particle_oct_container.pyx":245 + /* "yt/geometry/particle_oct_container.pyx":246 * for j in range(self.nn[1]): * for k in range(self.nn[2]): * if self.root_mesh[i][j][k] != NULL: # <<<<<<<<<<<<<< @@ -5927,19 +6219,19 @@ } } - /* "yt/geometry/particle_oct_container.pyx":247 + /* "yt/geometry/particle_oct_container.pyx":248 * if self.root_mesh[i][j][k] != NULL: * self.visit(self.root_mesh[i][j][k], counts) * level_counts = {} # <<<<<<<<<<<<<< * for i in range(128): * if counts[i] == 0: break */ - __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_level_counts = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/particle_oct_container.pyx":248 + /* "yt/geometry/particle_oct_container.pyx":249 * self.visit(self.root_mesh[i][j][k], counts) * level_counts = {} * for i in range(128): # <<<<<<<<<<<<<< @@ -5949,7 +6241,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 0x80; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/particle_oct_container.pyx":249 + /* "yt/geometry/particle_oct_container.pyx":250 * level_counts = {} * for i in range(128): * if counts[i] == 0: break # <<<<<<<<<<<<<< @@ -5961,24 +6253,24 @@ goto __pyx_L13_break; } - /* "yt/geometry/particle_oct_container.pyx":250 + /* "yt/geometry/particle_oct_container.pyx":251 * for i in range(128): * if counts[i] == 0: break * level_counts[i] = counts[i] # <<<<<<<<<<<<<< * return level_counts * */ - __pyx_t_8 = __Pyx_PyInt_From_npy_int64((__pyx_v_counts[__pyx_v_i])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_npy_int64((__pyx_v_counts[__pyx_v_i])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (unlikely(PyDict_SetItem(__pyx_v_level_counts, __pyx_t_9, __pyx_t_8) < 0)) __PYX_ERR(0, 250, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_level_counts, __pyx_t_9, __pyx_t_8) < 0)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_L13_break:; - /* "yt/geometry/particle_oct_container.pyx":251 + /* "yt/geometry/particle_oct_container.pyx":252 * if counts[i] == 0: break * level_counts[i] = counts[i] * return level_counts # <<<<<<<<<<<<<< @@ -5990,7 +6282,7 @@ __pyx_r = __pyx_v_level_counts; goto __pyx_L0; - /* "yt/geometry/particle_oct_container.pyx":237 + /* "yt/geometry/particle_oct_container.pyx":238 * #print ind[0], ind[1], ind[2], o.file_ind, level * * def recursively_count(self): # <<<<<<<<<<<<<< @@ -6011,7 +6303,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":253 +/* "yt/geometry/particle_oct_container.pyx":254 * return level_counts * * cdef visit(self, Oct *o, np.int64_t *counts, level = 0): # <<<<<<<<<<<<<< @@ -6042,17 +6334,17 @@ } } - /* "yt/geometry/particle_oct_container.pyx":255 + /* "yt/geometry/particle_oct_container.pyx":256 * cdef visit(self, Oct *o, np.int64_t *counts, level = 0): * cdef int i, j, k * counts[level] += 1 # <<<<<<<<<<<<<< * for i in range(2): * for j in range(2): */ - __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_level); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_level); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L1_error) (__pyx_v_counts[__pyx_t_1]) = ((__pyx_v_counts[__pyx_t_1]) + 1); - /* "yt/geometry/particle_oct_container.pyx":256 + /* "yt/geometry/particle_oct_container.pyx":257 * cdef int i, j, k * counts[level] += 1 * for i in range(2): # <<<<<<<<<<<<<< @@ -6062,7 +6354,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 2; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_oct_container.pyx":257 + /* "yt/geometry/particle_oct_container.pyx":258 * counts[level] += 1 * for i in range(2): * for j in range(2): # <<<<<<<<<<<<<< @@ -6072,7 +6364,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 2; __pyx_t_3+=1) { __pyx_v_j = __pyx_t_3; - /* "yt/geometry/particle_oct_container.pyx":258 + /* "yt/geometry/particle_oct_container.pyx":259 * for i in range(2): * for j in range(2): * for k in range(2): # <<<<<<<<<<<<<< @@ -6082,7 +6374,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 2; __pyx_t_4+=1) { __pyx_v_k = __pyx_t_4; - /* "yt/geometry/particle_oct_container.pyx":259 + /* "yt/geometry/particle_oct_container.pyx":260 * for j in range(2): * for k in range(2): * if o.children != NULL \ # <<<<<<<<<<<<<< @@ -6096,7 +6388,7 @@ goto __pyx_L10_bool_binop_done; } - /* "yt/geometry/particle_oct_container.pyx":260 + /* "yt/geometry/particle_oct_container.pyx":261 * for k in range(2): * if o.children != NULL \ * and o.children[cind(i,j,k)] != NULL: # <<<<<<<<<<<<<< @@ -6107,7 +6399,7 @@ __pyx_t_5 = __pyx_t_6; __pyx_L10_bool_binop_done:; - /* "yt/geometry/particle_oct_container.pyx":259 + /* "yt/geometry/particle_oct_container.pyx":260 * for j in range(2): * for k in range(2): * if o.children != NULL \ # <<<<<<<<<<<<<< @@ -6116,23 +6408,23 @@ */ if (__pyx_t_5) { - /* "yt/geometry/particle_oct_container.pyx":261 + /* "yt/geometry/particle_oct_container.pyx":262 * if o.children != NULL \ * and o.children[cind(i,j,k)] != NULL: * self.visit(o.children[cind(i,j,k)], counts, level + 1) # <<<<<<<<<<<<<< * return * */ - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_level, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_level, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9.__pyx_n = 1; __pyx_t_9.level = __pyx_t_7; - __pyx_t_8 = ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->visit(__pyx_v_self, (__pyx_v_o->children[__pyx_f_2yt_8geometry_12oct_visitors_cind(__pyx_v_i, __pyx_v_j, __pyx_v_k)]), __pyx_v_counts, &__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_8 = ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->visit(__pyx_v_self, (__pyx_v_o->children[__pyx_f_2yt_8geometry_12oct_visitors_cind(__pyx_v_i, __pyx_v_j, __pyx_v_k)]), __pyx_v_counts, &__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/particle_oct_container.pyx":259 + /* "yt/geometry/particle_oct_container.pyx":260 * for j in range(2): * for k in range(2): * if o.children != NULL \ # <<<<<<<<<<<<<< @@ -6144,18 +6436,18 @@ } } - /* "yt/geometry/particle_oct_container.pyx":262 + /* "yt/geometry/particle_oct_container.pyx":263 * and o.children[cind(i,j,k)] != NULL: * self.visit(o.children[cind(i,j,k)], counts, level + 1) * return # <<<<<<<<<<<<<< * - * ctypedef fused anyfloat: + * cdef np.uint64_t ONEBIT=1 */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/geometry/particle_oct_container.pyx":253 + /* "yt/geometry/particle_oct_container.pyx":254 * return level_counts * * cdef visit(self, Oct *o, np.int64_t *counts, level = 0): # <<<<<<<<<<<<<< @@ -6175,7 +6467,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":31 +/* "yt/geometry/particle_oct_container.pyx":32 * #The starting oct index of each domain * cdef np.int64_t *dom_offsets * cdef public int max_level # <<<<<<<<<<<<<< @@ -6202,7 +6494,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->max_level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->max_level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6237,7 +6529,7 @@ __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L1_error) __pyx_v_self->max_level = __pyx_t_1; /* function exit code */ @@ -6251,7 +6543,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":33 +/* "yt/geometry/particle_oct_container.pyx":34 * cdef public int max_level * #How many particles do we keep befor refining * cdef public int n_ref # <<<<<<<<<<<<<< @@ -6278,7 +6570,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->n_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->n_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6313,7 +6605,7 @@ __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_v_self->n_ref = __pyx_t_1; /* function exit code */ @@ -6327,7 +6619,114 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":279 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_18__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_18__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_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_17__reduce_cython__(((struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_17__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *__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.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, 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.dom_offsets,self.oct_list,self.root_mesh 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("yt.geometry.particle_oct_container.ParticleOctreeContainer.__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.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_20__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_20__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_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_19__setstate_cython__(((struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_19__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *__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.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, 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.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_oct_container.ParticleOctreeContainer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_oct_container.pyx":276 * cdef public object masks * * def __init__(self, left_edge, right_edge, dims, nfiles): # <<<<<<<<<<<<<< @@ -6353,9 +6752,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -6364,24 +6767,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 276, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dims)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 276, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nfiles)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 276, __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, 279, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 276, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -6398,7 +6804,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 276, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.particle_oct_container.ParticleRegions.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6427,17 +6833,17 @@ int __pyx_t_10; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/particle_oct_container.pyx":281 + /* "yt/geometry/particle_oct_container.pyx":278 * def __init__(self, left_edge, right_edge, dims, nfiles): * cdef int i * self.nfiles = nfiles # <<<<<<<<<<<<<< * for i in range(3): * self.left_edge[i] = left_edge[i] */ - __pyx_t_1 = __Pyx_PyInt_As_npy_uint64(__pyx_v_nfiles); if (unlikely((__pyx_t_1 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_npy_uint64(__pyx_v_nfiles); if (unlikely((__pyx_t_1 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L1_error) __pyx_v_self->nfiles = __pyx_t_1; - /* "yt/geometry/particle_oct_container.pyx":282 + /* "yt/geometry/particle_oct_container.pyx":279 * cdef int i * self.nfiles = nfiles * for i in range(3): # <<<<<<<<<<<<<< @@ -6447,71 +6853,71 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_oct_container.pyx":283 + /* "yt/geometry/particle_oct_container.pyx":280 * self.nfiles = nfiles * for i in range(3): * self.left_edge[i] = left_edge[i] # <<<<<<<<<<<<<< * self.right_edge[i] = right_edge[i] * self.dims[i] = dims[i] */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->left_edge[__pyx_v_i]) = __pyx_t_4; - /* "yt/geometry/particle_oct_container.pyx":284 + /* "yt/geometry/particle_oct_container.pyx":281 * for i in range(3): * self.left_edge[i] = left_edge[i] * self.right_edge[i] = right_edge[i] # <<<<<<<<<<<<<< * self.dims[i] = dims[i] * self.dds[i] = (right_edge[i] - left_edge[i])/dims[i] */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->right_edge[__pyx_v_i]) = __pyx_t_4; - /* "yt/geometry/particle_oct_container.pyx":285 + /* "yt/geometry/particle_oct_container.pyx":282 * self.left_edge[i] = left_edge[i] * self.right_edge[i] = right_edge[i] * self.dims[i] = dims[i] # <<<<<<<<<<<<<< * self.dds[i] = (right_edge[i] - left_edge[i])/dims[i] * self.idds[i] = 1.0/self.dds[i] */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_dims, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_dims, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->dims[__pyx_v_i]) = __pyx_t_5; - /* "yt/geometry/particle_oct_container.pyx":286 + /* "yt/geometry/particle_oct_container.pyx":283 * self.right_edge[i] = right_edge[i] * self.dims[i] = dims[i] * self.dds[i] = (right_edge[i] - left_edge[i])/dims[i] # <<<<<<<<<<<<<< * self.idds[i] = 1.0/self.dds[i] * # We use 64-bit masks */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dims, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dims, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->dds[__pyx_v_i]) = __pyx_t_4; - /* "yt/geometry/particle_oct_container.pyx":287 + /* "yt/geometry/particle_oct_container.pyx":284 * self.dims[i] = dims[i] * self.dds[i] = (right_edge[i] - left_edge[i])/dims[i] * self.idds[i] = 1.0/self.dds[i] # <<<<<<<<<<<<<< @@ -6520,19 +6926,19 @@ */ if (unlikely((__pyx_v_self->dds[__pyx_v_i]) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 287, __pyx_L1_error) + __PYX_ERR(0, 284, __pyx_L1_error) } (__pyx_v_self->idds[__pyx_v_i]) = (1.0 / (__pyx_v_self->dds[__pyx_v_i])); } - /* "yt/geometry/particle_oct_container.pyx":289 + /* "yt/geometry/particle_oct_container.pyx":286 * self.idds[i] = 1.0/self.dds[i] * # We use 64-bit masks * self.masks = [] # <<<<<<<<<<<<<< * for i in range(nfiles/64 + 1): * self.masks.append(np.zeros(dims, dtype="uint64")) */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->masks); @@ -6540,53 +6946,53 @@ __pyx_v_self->masks = __pyx_t_3; __pyx_t_3 = 0; - /* "yt/geometry/particle_oct_container.pyx":290 + /* "yt/geometry/particle_oct_container.pyx":287 * # We use 64-bit masks * self.masks = [] * for i in range(nfiles/64 + 1): # <<<<<<<<<<<<<< * self.masks.append(np.zeros(dims, dtype="uint64")) * */ - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_nfiles, __pyx_int_64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_nfiles, __pyx_int_64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyInt_As_long(__pyx_t_6); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_long(__pyx_t_6); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_8; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_oct_container.pyx":291 + /* "yt/geometry/particle_oct_container.pyx":288 * self.masks = [] * for i in range(nfiles/64 + 1): * self.masks.append(np.zeros(dims, dtype="uint64")) # <<<<<<<<<<<<<< * * def add_data_file(self, np.ndarray pos, int file_id, int filter = 0): */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_dims); __Pyx_GIVEREF(__pyx_v_dims); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_dims); - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_uint64) < 0) __PYX_ERR(0, 291, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 291, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_uint64) < 0) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_self->masks, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_self->masks, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - /* "yt/geometry/particle_oct_container.pyx":279 + /* "yt/geometry/particle_oct_container.pyx":276 * cdef public object masks * * def __init__(self, left_edge, right_edge, dims, nfiles): # <<<<<<<<<<<<<< @@ -6609,7 +7015,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":293 +/* "yt/geometry/particle_oct_container.pyx":290 * self.masks.append(np.zeros(dims, dtype="uint64")) * * def add_data_file(self, np.ndarray pos, int file_id, int filter = 0): # <<<<<<<<<<<<<< @@ -6634,8 +7040,11 @@ 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; } @@ -6644,11 +7053,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_id)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_data_file", 0, 2, 3, 1); __PYX_ERR(0, 293, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_data_file", 0, 2, 3, 1); __PYX_ERR(0, 290, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filter); @@ -6656,11 +7067,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_data_file") < 0)) __PYX_ERR(0, 293, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_data_file") < 0)) __PYX_ERR(0, 290, __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; @@ -6668,22 +7080,22 @@ } } __pyx_v_pos = ((PyArrayObject *)values[0]); - __pyx_v_file_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_file_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L3_error) + __pyx_v_file_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_file_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L3_error) if (values[2]) { - __pyx_v_filter = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_filter == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L3_error) + __pyx_v_filter = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_filter == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L3_error) } else { __pyx_v_filter = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_data_file", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 293, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_data_file", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 290, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.particle_oct_container.ParticleRegions.add_data_file", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos), __pyx_ptype_5numpy_ndarray, 1, "pos", 0))) __PYX_ERR(0, 293, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos), __pyx_ptype_5numpy_ndarray, 1, "pos", 0))) __PYX_ERR(0, 290, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_2add_data_file(((struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *)__pyx_v_self), __pyx_v_pos, __pyx_v_file_id, __pyx_v_filter); /* function exit code */ @@ -6704,28 +7116,28 @@ int __pyx_t_4; __Pyx_RefNannySetupContext("add_data_file", 0); - /* "yt/geometry/particle_oct_container.pyx":294 + /* "yt/geometry/particle_oct_container.pyx":291 * * def add_data_file(self, np.ndarray pos, int file_id, int filter = 0): * if pos.dtype == np.float32: # <<<<<<<<<<<<<< * self._mask_positions[np.float32_t](pos, file_id, filter) * elif pos.dtype == np.float64: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __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, 294, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "yt/geometry/particle_oct_container.pyx":295 + /* "yt/geometry/particle_oct_container.pyx":292 * def add_data_file(self, np.ndarray pos, int file_id, int filter = 0): * if pos.dtype == np.float32: * self._mask_positions[np.float32_t](pos, file_id, filter) # <<<<<<<<<<<<<< @@ -6734,7 +7146,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleRegions *)__pyx_v_self->__pyx_vtab)->__pyx_fuse_0_mask_positions(__pyx_v_self, ((PyArrayObject *)__pyx_v_pos), __pyx_v_file_id, __pyx_v_filter); - /* "yt/geometry/particle_oct_container.pyx":294 + /* "yt/geometry/particle_oct_container.pyx":291 * * def add_data_file(self, np.ndarray pos, int file_id, int filter = 0): * if pos.dtype == np.float32: # <<<<<<<<<<<<<< @@ -6744,28 +7156,28 @@ goto __pyx_L3; } - /* "yt/geometry/particle_oct_container.pyx":296 + /* "yt/geometry/particle_oct_container.pyx":293 * if pos.dtype == np.float32: * self._mask_positions[np.float32_t](pos, file_id, filter) * elif pos.dtype == np.float64: # <<<<<<<<<<<<<< * self._mask_positions[np.float64_t](pos, file_id, filter) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "yt/geometry/particle_oct_container.pyx":297 + /* "yt/geometry/particle_oct_container.pyx":294 * self._mask_positions[np.float32_t](pos, file_id, filter) * elif pos.dtype == np.float64: * self._mask_positions[np.float64_t](pos, file_id, filter) # <<<<<<<<<<<<<< @@ -6774,7 +7186,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_22particle_oct_container_ParticleRegions *)__pyx_v_self->__pyx_vtab)->__pyx_fuse_1_mask_positions(__pyx_v_self, ((PyArrayObject *)__pyx_v_pos), __pyx_v_file_id, __pyx_v_filter); - /* "yt/geometry/particle_oct_container.pyx":296 + /* "yt/geometry/particle_oct_container.pyx":293 * if pos.dtype == np.float32: * self._mask_positions[np.float32_t](pos, file_id, filter) * elif pos.dtype == np.float64: # <<<<<<<<<<<<<< @@ -6784,7 +7196,7 @@ } __pyx_L3:; - /* "yt/geometry/particle_oct_container.pyx":293 + /* "yt/geometry/particle_oct_container.pyx":290 * self.masks.append(np.zeros(dims, dtype="uint64")) * * def add_data_file(self, np.ndarray pos, int file_id, int filter = 0): # <<<<<<<<<<<<<< @@ -6807,10 +7219,10 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":302 +/* "yt/geometry/particle_oct_container.pyx":299 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void _mask_positions(self, np.ndarray[anyfloat, ndim=2] pos, # <<<<<<<<<<<<<< + * cdef void _mask_positions(self, np.ndarray[floating, ndim=2] pos, # <<<<<<<<<<<<<< * np.uint64_t file_id, int filter): * # TODO: Replace with the bitarray */ @@ -6859,11 +7271,11 @@ __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 299, __pyx_L1_error) } __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_pos.diminfo[1].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_pos.diminfo[1].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[1]; - /* "yt/geometry/particle_oct_container.pyx":305 + /* "yt/geometry/particle_oct_container.pyx":302 * np.uint64_t file_id, int filter): * # TODO: Replace with the bitarray * cdef np.int64_t no = pos.shape[0] # <<<<<<<<<<<<<< @@ -6872,7 +7284,7 @@ */ __pyx_v_no = (__pyx_v_pos->dimensions[0]); - /* "yt/geometry/particle_oct_container.pyx":310 + /* "yt/geometry/particle_oct_container.pyx":307 * cdef int i, use * cdef np.ndarray[np.uint64_t, ndim=3] mask * mask = self.masks[file_id/64] # <<<<<<<<<<<<<< @@ -6880,9 +7292,9 @@ * for p in range(no): */ __pyx_t_1 = (__pyx_v_file_id / 64); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->masks, __pyx_t_1, __pyx_t_5numpy_uint64_t, 0, __Pyx_PyInt_From_npy_uint64, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->masks, __pyx_t_1, __pyx_t_5numpy_uint64_t, 0, __Pyx_PyInt_From_npy_uint64, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 310, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 307, __pyx_L1_error) __pyx_t_3 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6898,13 +7310,13 @@ } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 310, __pyx_L1_error) + if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 307, __pyx_L1_error) } __pyx_t_3 = 0; __pyx_v_mask = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/particle_oct_container.pyx":311 + /* "yt/geometry/particle_oct_container.pyx":308 * cdef np.ndarray[np.uint64_t, ndim=3] mask * mask = self.masks[file_id/64] * cdef np.uint64_t val = ONEBIT << (file_id - (file_id/64)*64) # <<<<<<<<<<<<<< @@ -6913,7 +7325,7 @@ */ __pyx_v_val = (__pyx_v_2yt_8geometry_22particle_oct_container_ONEBIT << (__pyx_v_file_id - ((__pyx_v_file_id / 64) * 64))); - /* "yt/geometry/particle_oct_container.pyx":312 + /* "yt/geometry/particle_oct_container.pyx":309 * mask = self.masks[file_id/64] * cdef np.uint64_t val = ONEBIT << (file_id - (file_id/64)*64) * for p in range(no): # <<<<<<<<<<<<<< @@ -6924,7 +7336,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_p = __pyx_t_9; - /* "yt/geometry/particle_oct_container.pyx":314 + /* "yt/geometry/particle_oct_container.pyx":311 * for p in range(no): * # Now we locate the particle * use = 1 # <<<<<<<<<<<<<< @@ -6933,7 +7345,7 @@ */ __pyx_v_use = 1; - /* "yt/geometry/particle_oct_container.pyx":315 + /* "yt/geometry/particle_oct_container.pyx":312 * # Now we locate the particle * use = 1 * for i in range(3): # <<<<<<<<<<<<<< @@ -6943,7 +7355,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/particle_oct_container.pyx":316 + /* "yt/geometry/particle_oct_container.pyx":313 * use = 1 * for i in range(3): * if filter and (pos[p,i] < self.left_edge[i] # <<<<<<<<<<<<<< @@ -6957,7 +7369,7 @@ goto __pyx_L8_bool_binop_done; } - /* "yt/geometry/particle_oct_container.pyx":317 + /* "yt/geometry/particle_oct_container.pyx":314 * for i in range(3): * if filter and (pos[p,i] < self.left_edge[i] * or pos[p,i] > self.right_edge[i]): # <<<<<<<<<<<<<< @@ -6967,21 +7379,21 @@ __pyx_t_12 = __pyx_v_p; __pyx_t_13 = __pyx_v_i; - /* "yt/geometry/particle_oct_container.pyx":316 + /* "yt/geometry/particle_oct_container.pyx":313 * use = 1 * for i in range(3): * if filter and (pos[p,i] < self.left_edge[i] # <<<<<<<<<<<<<< * or pos[p,i] > self.right_edge[i]): * use = 0 */ - __pyx_t_11 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_pos.diminfo[1].strides)) < (__pyx_v_self->left_edge[__pyx_v_i])) != 0); + __pyx_t_11 = (((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_pos.diminfo[1].strides)) < (__pyx_v_self->left_edge[__pyx_v_i])) != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L8_bool_binop_done; } - /* "yt/geometry/particle_oct_container.pyx":317 + /* "yt/geometry/particle_oct_container.pyx":314 * for i in range(3): * if filter and (pos[p,i] < self.left_edge[i] * or pos[p,i] > self.right_edge[i]): # <<<<<<<<<<<<<< @@ -6990,11 +7402,11 @@ */ __pyx_t_14 = __pyx_v_p; __pyx_t_15 = __pyx_v_i; - __pyx_t_11 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_pos.diminfo[1].strides)) > (__pyx_v_self->right_edge[__pyx_v_i])) != 0); + __pyx_t_11 = (((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_pos.diminfo[1].strides)) > (__pyx_v_self->right_edge[__pyx_v_i])) != 0); __pyx_t_10 = __pyx_t_11; __pyx_L8_bool_binop_done:; - /* "yt/geometry/particle_oct_container.pyx":316 + /* "yt/geometry/particle_oct_container.pyx":313 * use = 1 * for i in range(3): * if filter and (pos[p,i] < self.left_edge[i] # <<<<<<<<<<<<<< @@ -7003,7 +7415,7 @@ */ if (__pyx_t_10) { - /* "yt/geometry/particle_oct_container.pyx":318 + /* "yt/geometry/particle_oct_container.pyx":315 * if filter and (pos[p,i] < self.left_edge[i] * or pos[p,i] > self.right_edge[i]): * use = 0 # <<<<<<<<<<<<<< @@ -7012,7 +7424,7 @@ */ __pyx_v_use = 0; - /* "yt/geometry/particle_oct_container.pyx":319 + /* "yt/geometry/particle_oct_container.pyx":316 * or pos[p,i] > self.right_edge[i]): * use = 0 * break # <<<<<<<<<<<<<< @@ -7021,7 +7433,7 @@ */ goto __pyx_L6_break; - /* "yt/geometry/particle_oct_container.pyx":316 + /* "yt/geometry/particle_oct_container.pyx":313 * use = 1 * for i in range(3): * if filter and (pos[p,i] < self.left_edge[i] # <<<<<<<<<<<<<< @@ -7030,7 +7442,7 @@ */ } - /* "yt/geometry/particle_oct_container.pyx":320 + /* "yt/geometry/particle_oct_container.pyx":317 * use = 0 * break * ind[i] = ((pos[p, i] - self.left_edge[i])*self.idds[i]) # <<<<<<<<<<<<<< @@ -7039,9 +7451,9 @@ */ __pyx_t_16 = __pyx_v_p; __pyx_t_17 = __pyx_v_i; - (__pyx_v_ind[__pyx_v_i]) = ((int)(((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_pos.diminfo[1].strides)) - (__pyx_v_self->left_edge[__pyx_v_i])) * (__pyx_v_self->idds[__pyx_v_i]))); + (__pyx_v_ind[__pyx_v_i]) = ((int)(((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_pos.diminfo[1].strides)) - (__pyx_v_self->left_edge[__pyx_v_i])) * (__pyx_v_self->idds[__pyx_v_i]))); - /* "yt/geometry/particle_oct_container.pyx":321 + /* "yt/geometry/particle_oct_container.pyx":318 * break * ind[i] = ((pos[p, i] - self.left_edge[i])*self.idds[i]) * ind[i] = iclip(ind[i], 0, self.dims[i]) # <<<<<<<<<<<<<< @@ -7052,7 +7464,7 @@ } __pyx_L6_break:; - /* "yt/geometry/particle_oct_container.pyx":322 + /* "yt/geometry/particle_oct_container.pyx":319 * ind[i] = ((pos[p, i] - self.left_edge[i])*self.idds[i]) * ind[i] = iclip(ind[i], 0, self.dims[i]) * if use == 1: # <<<<<<<<<<<<<< @@ -7062,7 +7474,7 @@ __pyx_t_10 = ((__pyx_v_use == 1) != 0); if (__pyx_t_10) { - /* "yt/geometry/particle_oct_container.pyx":323 + /* "yt/geometry/particle_oct_container.pyx":320 * ind[i] = iclip(ind[i], 0, self.dims[i]) * if use == 1: * mask[ind[0],ind[1],ind[2]] |= val # <<<<<<<<<<<<<< @@ -7074,7 +7486,7 @@ __pyx_t_20 = (__pyx_v_ind[2]); *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_mask.diminfo[2].strides) |= __pyx_v_val; - /* "yt/geometry/particle_oct_container.pyx":322 + /* "yt/geometry/particle_oct_container.pyx":319 * ind[i] = ((pos[p, i] - self.left_edge[i])*self.idds[i]) * ind[i] = iclip(ind[i], 0, self.dims[i]) * if use == 1: # <<<<<<<<<<<<<< @@ -7084,7 +7496,7 @@ } } - /* "yt/geometry/particle_oct_container.pyx":324 + /* "yt/geometry/particle_oct_container.pyx":321 * if use == 1: * mask[ind[0],ind[1],ind[2]] |= val * return # <<<<<<<<<<<<<< @@ -7093,10 +7505,10 @@ */ goto __pyx_L0; - /* "yt/geometry/particle_oct_container.pyx":302 + /* "yt/geometry/particle_oct_container.pyx":299 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void _mask_positions(self, np.ndarray[anyfloat, ndim=2] pos, # <<<<<<<<<<<<<< + * cdef void _mask_positions(self, np.ndarray[floating, ndim=2] pos, # <<<<<<<<<<<<<< * np.uint64_t file_id, int filter): * # TODO: Replace with the bitarray */ @@ -7111,7 +7523,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.geometry.particle_oct_container.ParticleRegions._mask_positions", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.particle_oct_container.ParticleRegions._mask_positions", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); @@ -7165,11 +7577,11 @@ __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 299, __pyx_L1_error) } __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_pos.diminfo[1].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_pos.diminfo[1].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[1]; - /* "yt/geometry/particle_oct_container.pyx":305 + /* "yt/geometry/particle_oct_container.pyx":302 * np.uint64_t file_id, int filter): * # TODO: Replace with the bitarray * cdef np.int64_t no = pos.shape[0] # <<<<<<<<<<<<<< @@ -7178,7 +7590,7 @@ */ __pyx_v_no = (__pyx_v_pos->dimensions[0]); - /* "yt/geometry/particle_oct_container.pyx":310 + /* "yt/geometry/particle_oct_container.pyx":307 * cdef int i, use * cdef np.ndarray[np.uint64_t, ndim=3] mask * mask = self.masks[file_id/64] # <<<<<<<<<<<<<< @@ -7186,9 +7598,9 @@ * for p in range(no): */ __pyx_t_1 = (__pyx_v_file_id / 64); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->masks, __pyx_t_1, __pyx_t_5numpy_uint64_t, 0, __Pyx_PyInt_From_npy_uint64, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->masks, __pyx_t_1, __pyx_t_5numpy_uint64_t, 0, __Pyx_PyInt_From_npy_uint64, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 310, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 307, __pyx_L1_error) __pyx_t_3 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7204,13 +7616,13 @@ } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 310, __pyx_L1_error) + if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 307, __pyx_L1_error) } __pyx_t_3 = 0; __pyx_v_mask = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/particle_oct_container.pyx":311 + /* "yt/geometry/particle_oct_container.pyx":308 * cdef np.ndarray[np.uint64_t, ndim=3] mask * mask = self.masks[file_id/64] * cdef np.uint64_t val = ONEBIT << (file_id - (file_id/64)*64) # <<<<<<<<<<<<<< @@ -7219,7 +7631,7 @@ */ __pyx_v_val = (__pyx_v_2yt_8geometry_22particle_oct_container_ONEBIT << (__pyx_v_file_id - ((__pyx_v_file_id / 64) * 64))); - /* "yt/geometry/particle_oct_container.pyx":312 + /* "yt/geometry/particle_oct_container.pyx":309 * mask = self.masks[file_id/64] * cdef np.uint64_t val = ONEBIT << (file_id - (file_id/64)*64) * for p in range(no): # <<<<<<<<<<<<<< @@ -7230,7 +7642,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_p = __pyx_t_9; - /* "yt/geometry/particle_oct_container.pyx":314 + /* "yt/geometry/particle_oct_container.pyx":311 * for p in range(no): * # Now we locate the particle * use = 1 # <<<<<<<<<<<<<< @@ -7239,7 +7651,7 @@ */ __pyx_v_use = 1; - /* "yt/geometry/particle_oct_container.pyx":315 + /* "yt/geometry/particle_oct_container.pyx":312 * # Now we locate the particle * use = 1 * for i in range(3): # <<<<<<<<<<<<<< @@ -7249,7 +7661,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/particle_oct_container.pyx":316 + /* "yt/geometry/particle_oct_container.pyx":313 * use = 1 * for i in range(3): * if filter and (pos[p,i] < self.left_edge[i] # <<<<<<<<<<<<<< @@ -7263,7 +7675,7 @@ goto __pyx_L8_bool_binop_done; } - /* "yt/geometry/particle_oct_container.pyx":317 + /* "yt/geometry/particle_oct_container.pyx":314 * for i in range(3): * if filter and (pos[p,i] < self.left_edge[i] * or pos[p,i] > self.right_edge[i]): # <<<<<<<<<<<<<< @@ -7273,21 +7685,21 @@ __pyx_t_12 = __pyx_v_p; __pyx_t_13 = __pyx_v_i; - /* "yt/geometry/particle_oct_container.pyx":316 + /* "yt/geometry/particle_oct_container.pyx":313 * use = 1 * for i in range(3): * if filter and (pos[p,i] < self.left_edge[i] # <<<<<<<<<<<<<< * or pos[p,i] > self.right_edge[i]): * use = 0 */ - __pyx_t_11 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_pos.diminfo[1].strides)) < (__pyx_v_self->left_edge[__pyx_v_i])) != 0); + __pyx_t_11 = (((*__Pyx_BufPtrStrided2d(double *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_pos.diminfo[1].strides)) < (__pyx_v_self->left_edge[__pyx_v_i])) != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L8_bool_binop_done; } - /* "yt/geometry/particle_oct_container.pyx":317 + /* "yt/geometry/particle_oct_container.pyx":314 * for i in range(3): * if filter and (pos[p,i] < self.left_edge[i] * or pos[p,i] > self.right_edge[i]): # <<<<<<<<<<<<<< @@ -7296,11 +7708,11 @@ */ __pyx_t_14 = __pyx_v_p; __pyx_t_15 = __pyx_v_i; - __pyx_t_11 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_pos.diminfo[1].strides)) > (__pyx_v_self->right_edge[__pyx_v_i])) != 0); + __pyx_t_11 = (((*__Pyx_BufPtrStrided2d(double *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_pos.diminfo[1].strides)) > (__pyx_v_self->right_edge[__pyx_v_i])) != 0); __pyx_t_10 = __pyx_t_11; __pyx_L8_bool_binop_done:; - /* "yt/geometry/particle_oct_container.pyx":316 + /* "yt/geometry/particle_oct_container.pyx":313 * use = 1 * for i in range(3): * if filter and (pos[p,i] < self.left_edge[i] # <<<<<<<<<<<<<< @@ -7309,7 +7721,7 @@ */ if (__pyx_t_10) { - /* "yt/geometry/particle_oct_container.pyx":318 + /* "yt/geometry/particle_oct_container.pyx":315 * if filter and (pos[p,i] < self.left_edge[i] * or pos[p,i] > self.right_edge[i]): * use = 0 # <<<<<<<<<<<<<< @@ -7318,7 +7730,7 @@ */ __pyx_v_use = 0; - /* "yt/geometry/particle_oct_container.pyx":319 + /* "yt/geometry/particle_oct_container.pyx":316 * or pos[p,i] > self.right_edge[i]): * use = 0 * break # <<<<<<<<<<<<<< @@ -7327,7 +7739,7 @@ */ goto __pyx_L6_break; - /* "yt/geometry/particle_oct_container.pyx":316 + /* "yt/geometry/particle_oct_container.pyx":313 * use = 1 * for i in range(3): * if filter and (pos[p,i] < self.left_edge[i] # <<<<<<<<<<<<<< @@ -7336,7 +7748,7 @@ */ } - /* "yt/geometry/particle_oct_container.pyx":320 + /* "yt/geometry/particle_oct_container.pyx":317 * use = 0 * break * ind[i] = ((pos[p, i] - self.left_edge[i])*self.idds[i]) # <<<<<<<<<<<<<< @@ -7345,9 +7757,9 @@ */ __pyx_t_16 = __pyx_v_p; __pyx_t_17 = __pyx_v_i; - (__pyx_v_ind[__pyx_v_i]) = ((int)(((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_pos.diminfo[1].strides)) - (__pyx_v_self->left_edge[__pyx_v_i])) * (__pyx_v_self->idds[__pyx_v_i]))); + (__pyx_v_ind[__pyx_v_i]) = ((int)(((*__Pyx_BufPtrStrided2d(double *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_pos.diminfo[1].strides)) - (__pyx_v_self->left_edge[__pyx_v_i])) * (__pyx_v_self->idds[__pyx_v_i]))); - /* "yt/geometry/particle_oct_container.pyx":321 + /* "yt/geometry/particle_oct_container.pyx":318 * break * ind[i] = ((pos[p, i] - self.left_edge[i])*self.idds[i]) * ind[i] = iclip(ind[i], 0, self.dims[i]) # <<<<<<<<<<<<<< @@ -7358,7 +7770,7 @@ } __pyx_L6_break:; - /* "yt/geometry/particle_oct_container.pyx":322 + /* "yt/geometry/particle_oct_container.pyx":319 * ind[i] = ((pos[p, i] - self.left_edge[i])*self.idds[i]) * ind[i] = iclip(ind[i], 0, self.dims[i]) * if use == 1: # <<<<<<<<<<<<<< @@ -7368,7 +7780,7 @@ __pyx_t_10 = ((__pyx_v_use == 1) != 0); if (__pyx_t_10) { - /* "yt/geometry/particle_oct_container.pyx":323 + /* "yt/geometry/particle_oct_container.pyx":320 * ind[i] = iclip(ind[i], 0, self.dims[i]) * if use == 1: * mask[ind[0],ind[1],ind[2]] |= val # <<<<<<<<<<<<<< @@ -7380,7 +7792,7 @@ __pyx_t_20 = (__pyx_v_ind[2]); *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_mask.diminfo[2].strides) |= __pyx_v_val; - /* "yt/geometry/particle_oct_container.pyx":322 + /* "yt/geometry/particle_oct_container.pyx":319 * ind[i] = ((pos[p, i] - self.left_edge[i])*self.idds[i]) * ind[i] = iclip(ind[i], 0, self.dims[i]) * if use == 1: # <<<<<<<<<<<<<< @@ -7390,7 +7802,7 @@ } } - /* "yt/geometry/particle_oct_container.pyx":324 + /* "yt/geometry/particle_oct_container.pyx":321 * if use == 1: * mask[ind[0],ind[1],ind[2]] |= val * return # <<<<<<<<<<<<<< @@ -7399,10 +7811,10 @@ */ goto __pyx_L0; - /* "yt/geometry/particle_oct_container.pyx":302 + /* "yt/geometry/particle_oct_container.pyx":299 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void _mask_positions(self, np.ndarray[anyfloat, ndim=2] pos, # <<<<<<<<<<<<<< + * cdef void _mask_positions(self, np.ndarray[floating, ndim=2] pos, # <<<<<<<<<<<<<< * np.uint64_t file_id, int filter): * # TODO: Replace with the bitarray */ @@ -7417,7 +7829,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.geometry.particle_oct_container.ParticleRegions._mask_positions", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.particle_oct_container.ParticleRegions._mask_positions", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); @@ -7427,7 +7839,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_oct_container.pyx":326 +/* "yt/geometry/particle_oct_container.pyx":323 * return * * def identify_data_files(self, SelectorObject selector): # <<<<<<<<<<<<<< @@ -7441,7 +7853,7 @@ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("identify_data_files (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 326, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 323, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_4identify_data_files(((struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *)__pyx_v_self), ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector)); /* function exit code */ @@ -7495,19 +7907,19 @@ __pyx_pybuffernd_mask.data = NULL; __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; - /* "yt/geometry/particle_oct_container.pyx":333 + /* "yt/geometry/particle_oct_container.pyx":330 * cdef np.float64_t RE[3] * cdef np.ndarray[np.uint64_t, ndim=3] mask * files = [] # <<<<<<<<<<<<<< * for n in range(len(self.masks)): * fmask = 0 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_files = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/particle_oct_container.pyx":334 + /* "yt/geometry/particle_oct_container.pyx":331 * cdef np.ndarray[np.uint64_t, ndim=3] mask * files = [] * for n in range(len(self.masks)): # <<<<<<<<<<<<<< @@ -7516,12 +7928,12 @@ */ __pyx_t_1 = __pyx_v_self->masks; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_n = __pyx_t_3; - /* "yt/geometry/particle_oct_container.pyx":335 + /* "yt/geometry/particle_oct_container.pyx":332 * files = [] * for n in range(len(self.masks)): * fmask = 0 # <<<<<<<<<<<<<< @@ -7530,16 +7942,16 @@ */ __pyx_v_fmask = 0; - /* "yt/geometry/particle_oct_container.pyx":336 + /* "yt/geometry/particle_oct_container.pyx":333 * for n in range(len(self.masks)): * fmask = 0 * mask = self.masks[n] # <<<<<<<<<<<<<< * LE[0] = self.left_edge[0] * RE[0] = LE[0] + self.dds[0] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->masks, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->masks, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 336, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 333, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7555,13 +7967,13 @@ } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) } __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_mask, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "yt/geometry/particle_oct_container.pyx":337 + /* "yt/geometry/particle_oct_container.pyx":334 * fmask = 0 * mask = self.masks[n] * LE[0] = self.left_edge[0] # <<<<<<<<<<<<<< @@ -7570,7 +7982,7 @@ */ (__pyx_v_LE[0]) = (__pyx_v_self->left_edge[0]); - /* "yt/geometry/particle_oct_container.pyx":338 + /* "yt/geometry/particle_oct_container.pyx":335 * mask = self.masks[n] * LE[0] = self.left_edge[0] * RE[0] = LE[0] + self.dds[0] # <<<<<<<<<<<<<< @@ -7579,7 +7991,7 @@ */ (__pyx_v_RE[0]) = ((__pyx_v_LE[0]) + (__pyx_v_self->dds[0])); - /* "yt/geometry/particle_oct_container.pyx":339 + /* "yt/geometry/particle_oct_container.pyx":336 * LE[0] = self.left_edge[0] * RE[0] = LE[0] + self.dds[0] * for i in range(self.dims[0]): # <<<<<<<<<<<<<< @@ -7590,7 +8002,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_9; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "yt/geometry/particle_oct_container.pyx":340 + /* "yt/geometry/particle_oct_container.pyx":337 * RE[0] = LE[0] + self.dds[0] * for i in range(self.dims[0]): * LE[1] = self.left_edge[1] # <<<<<<<<<<<<<< @@ -7599,7 +8011,7 @@ */ (__pyx_v_LE[1]) = (__pyx_v_self->left_edge[1]); - /* "yt/geometry/particle_oct_container.pyx":341 + /* "yt/geometry/particle_oct_container.pyx":338 * for i in range(self.dims[0]): * LE[1] = self.left_edge[1] * RE[1] = LE[1] + self.dds[1] # <<<<<<<<<<<<<< @@ -7608,7 +8020,7 @@ */ (__pyx_v_RE[1]) = ((__pyx_v_LE[1]) + (__pyx_v_self->dds[1])); - /* "yt/geometry/particle_oct_container.pyx":342 + /* "yt/geometry/particle_oct_container.pyx":339 * LE[1] = self.left_edge[1] * RE[1] = LE[1] + self.dds[1] * for j in range(self.dims[1]): # <<<<<<<<<<<<<< @@ -7619,7 +8031,7 @@ for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_j = __pyx_t_11; - /* "yt/geometry/particle_oct_container.pyx":343 + /* "yt/geometry/particle_oct_container.pyx":340 * RE[1] = LE[1] + self.dds[1] * for j in range(self.dims[1]): * LE[2] = self.left_edge[2] # <<<<<<<<<<<<<< @@ -7628,7 +8040,7 @@ */ (__pyx_v_LE[2]) = (__pyx_v_self->left_edge[2]); - /* "yt/geometry/particle_oct_container.pyx":344 + /* "yt/geometry/particle_oct_container.pyx":341 * for j in range(self.dims[1]): * LE[2] = self.left_edge[2] * RE[2] = LE[2] + self.dds[2] # <<<<<<<<<<<<<< @@ -7637,7 +8049,7 @@ */ (__pyx_v_RE[2]) = ((__pyx_v_LE[2]) + (__pyx_v_self->dds[2])); - /* "yt/geometry/particle_oct_container.pyx":345 + /* "yt/geometry/particle_oct_container.pyx":342 * LE[2] = self.left_edge[2] * RE[2] = LE[2] + self.dds[2] * for k in range(self.dims[2]): # <<<<<<<<<<<<<< @@ -7648,7 +8060,7 @@ for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_k = __pyx_t_13; - /* "yt/geometry/particle_oct_container.pyx":346 + /* "yt/geometry/particle_oct_container.pyx":343 * RE[2] = LE[2] + self.dds[2] * for k in range(self.dims[2]): * if selector.select_grid(LE, RE, 0) == 1: # <<<<<<<<<<<<<< @@ -7658,7 +8070,7 @@ __pyx_t_14 = ((((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->select_grid(__pyx_v_selector, __pyx_v_LE, __pyx_v_RE, 0, NULL) == 1) != 0); if (__pyx_t_14) { - /* "yt/geometry/particle_oct_container.pyx":347 + /* "yt/geometry/particle_oct_container.pyx":344 * for k in range(self.dims[2]): * if selector.select_grid(LE, RE, 0) == 1: * fmask |= mask[i,j,k] # <<<<<<<<<<<<<< @@ -7683,11 +8095,11 @@ } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_mask.diminfo[2].shape)) __pyx_t_18 = 2; if (unlikely(__pyx_t_18 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_18); - __PYX_ERR(0, 347, __pyx_L1_error) + __PYX_ERR(0, 344, __pyx_L1_error) } __pyx_v_fmask = (__pyx_v_fmask | (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_mask.diminfo[2].strides))); - /* "yt/geometry/particle_oct_container.pyx":346 + /* "yt/geometry/particle_oct_container.pyx":343 * RE[2] = LE[2] + self.dds[2] * for k in range(self.dims[2]): * if selector.select_grid(LE, RE, 0) == 1: # <<<<<<<<<<<<<< @@ -7696,7 +8108,7 @@ */ } - /* "yt/geometry/particle_oct_container.pyx":348 + /* "yt/geometry/particle_oct_container.pyx":345 * if selector.select_grid(LE, RE, 0) == 1: * fmask |= mask[i,j,k] * LE[2] += self.dds[2] # <<<<<<<<<<<<<< @@ -7706,7 +8118,7 @@ __pyx_t_19 = 2; (__pyx_v_LE[__pyx_t_19]) = ((__pyx_v_LE[__pyx_t_19]) + (__pyx_v_self->dds[2])); - /* "yt/geometry/particle_oct_container.pyx":349 + /* "yt/geometry/particle_oct_container.pyx":346 * fmask |= mask[i,j,k] * LE[2] += self.dds[2] * RE[2] += self.dds[2] # <<<<<<<<<<<<<< @@ -7717,7 +8129,7 @@ (__pyx_v_RE[__pyx_t_19]) = ((__pyx_v_RE[__pyx_t_19]) + (__pyx_v_self->dds[2])); } - /* "yt/geometry/particle_oct_container.pyx":350 + /* "yt/geometry/particle_oct_container.pyx":347 * LE[2] += self.dds[2] * RE[2] += self.dds[2] * LE[1] += self.dds[1] # <<<<<<<<<<<<<< @@ -7727,7 +8139,7 @@ __pyx_t_19 = 1; (__pyx_v_LE[__pyx_t_19]) = ((__pyx_v_LE[__pyx_t_19]) + (__pyx_v_self->dds[1])); - /* "yt/geometry/particle_oct_container.pyx":351 + /* "yt/geometry/particle_oct_container.pyx":348 * RE[2] += self.dds[2] * LE[1] += self.dds[1] * RE[1] += self.dds[1] # <<<<<<<<<<<<<< @@ -7738,7 +8150,7 @@ (__pyx_v_RE[__pyx_t_19]) = ((__pyx_v_RE[__pyx_t_19]) + (__pyx_v_self->dds[1])); } - /* "yt/geometry/particle_oct_container.pyx":352 + /* "yt/geometry/particle_oct_container.pyx":349 * LE[1] += self.dds[1] * RE[1] += self.dds[1] * LE[0] += self.dds[0] # <<<<<<<<<<<<<< @@ -7748,7 +8160,7 @@ __pyx_t_19 = 0; (__pyx_v_LE[__pyx_t_19]) = ((__pyx_v_LE[__pyx_t_19]) + (__pyx_v_self->dds[0])); - /* "yt/geometry/particle_oct_container.pyx":353 + /* "yt/geometry/particle_oct_container.pyx":350 * RE[1] += self.dds[1] * LE[0] += self.dds[0] * RE[0] += self.dds[0] # <<<<<<<<<<<<<< @@ -7759,7 +8171,7 @@ (__pyx_v_RE[__pyx_t_19]) = ((__pyx_v_RE[__pyx_t_19]) + (__pyx_v_self->dds[0])); } - /* "yt/geometry/particle_oct_container.pyx":355 + /* "yt/geometry/particle_oct_container.pyx":352 * RE[0] += self.dds[0] * # Now we iterate through... * for fcheck in range(64): # <<<<<<<<<<<<<< @@ -7769,7 +8181,7 @@ for (__pyx_t_20 = 0; __pyx_t_20 < 64; __pyx_t_20+=1) { __pyx_v_fcheck = __pyx_t_20; - /* "yt/geometry/particle_oct_container.pyx":356 + /* "yt/geometry/particle_oct_container.pyx":353 * # Now we iterate through... * for fcheck in range(64): * if ((fmask >> fcheck) & ONEBIT) == ONEBIT: # <<<<<<<<<<<<<< @@ -7779,19 +8191,19 @@ __pyx_t_14 = ((((__pyx_v_fmask >> __pyx_v_fcheck) & __pyx_v_2yt_8geometry_22particle_oct_container_ONEBIT) == __pyx_v_2yt_8geometry_22particle_oct_container_ONEBIT) != 0); if (__pyx_t_14) { - /* "yt/geometry/particle_oct_container.pyx":357 + /* "yt/geometry/particle_oct_container.pyx":354 * for fcheck in range(64): * if ((fmask >> fcheck) & ONEBIT) == ONEBIT: * files.append(fcheck + n * 64) # <<<<<<<<<<<<<< * return files * */ - __pyx_t_1 = __Pyx_PyInt_From_npy_uint64((__pyx_v_fcheck + (__pyx_v_n * 64))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_uint64((__pyx_v_fcheck + (__pyx_v_n * 64))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_files, __pyx_t_1); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_files, __pyx_t_1); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/particle_oct_container.pyx":356 + /* "yt/geometry/particle_oct_container.pyx":353 * # Now we iterate through... * for fcheck in range(64): * if ((fmask >> fcheck) & ONEBIT) == ONEBIT: # <<<<<<<<<<<<<< @@ -7802,7 +8214,7 @@ } } - /* "yt/geometry/particle_oct_container.pyx":358 + /* "yt/geometry/particle_oct_container.pyx":355 * if ((fmask >> fcheck) & ONEBIT) == ONEBIT: * files.append(fcheck + n * 64) * return files # <<<<<<<<<<<<<< @@ -7813,7 +8225,7 @@ __pyx_r = __pyx_v_files; goto __pyx_L0; - /* "yt/geometry/particle_oct_container.pyx":326 + /* "yt/geometry/particle_oct_container.pyx":323 * return * * def identify_data_files(self, SelectorObject selector): # <<<<<<<<<<<<<< @@ -7843,7 +8255,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":276 +/* "yt/geometry/particle_oct_container.pyx":273 * cdef np.float64_t idds[3] * cdef np.int32_t dims[3] * cdef public np.uint64_t nfiles # <<<<<<<<<<<<<< @@ -7870,7 +8282,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->nfiles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->nfiles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7905,7 +8317,7 @@ __Pyx_RefNannyDeclarations __pyx_t_5numpy_uint64_t __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_npy_uint64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_npy_uint64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error) __pyx_v_self->nfiles = __pyx_t_1; /* function exit code */ @@ -7919,7 +8331,7 @@ return __pyx_r; } -/* "yt/geometry/particle_oct_container.pyx":277 +/* "yt/geometry/particle_oct_container.pyx":274 * cdef np.int32_t dims[3] * cdef public np.uint64_t nfiles * cdef public object masks # <<<<<<<<<<<<<< @@ -8014,763 +8426,1249 @@ return __pyx_r; } -/* "oct_visitors.pxd":51 - * cdef void visit(self, Oct*, np.uint8_t selected) - * - * cdef inline int oind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dds, self.dims, self.idds, self.left_edge, self.masks, self.nfiles, self.right_edge) */ -static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { - int __pyx_v_d; - int __pyx_r; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_22particle_oct_container_15ParticleRegions_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_22particle_oct_container_15ParticleRegions_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("oind", 0); - - /* "oct_visitors.pxd":52 - * - * cdef inline int oind(self): - * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - * - */ - __pyx_v_d = (1 << __pyx_v_self->oref); - - /* "oct_visitors.pxd":53 - * cdef inline int oind(self): - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) # <<<<<<<<<<<<<< - * - * cdef inline int rind(self): - */ - __pyx_r = (((((__pyx_v_self->ind[0]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[2])); - goto __pyx_L0; - - /* "oct_visitors.pxd":51 - * cdef void visit(self, Oct*, np.uint8_t selected) - * - * cdef inline int oind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - */ + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_6__reduce_cython__(((struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *)__pyx_v_self)); /* function exit code */ - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "oct_visitors.pxd":55 - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - * - * cdef inline int rind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) - */ - -static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { - int __pyx_v_d; - int __pyx_r; +static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_6__reduce_cython__(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_self) { + int __pyx_v_use_setstate; + PyObject *__pyx_v_state = NULL; + PyObject *__pyx_v__dict = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rind", 0); + 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; + int __pyx_t_9; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "oct_visitors.pxd":56 - * - * cdef inline int rind(self): - * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) - * + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.dds, self.dims, self.idds, self.left_edge, self.masks, self.nfiles, self.right_edge) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_v_d = (1 << __pyx_v_self->oref); + __pyx_t_1 = __Pyx_carray_to_py___pyx_t_5numpy_float64_t(__pyx_v_self->dds, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_carray_to_py___pyx_t_5numpy_int32_t(__pyx_v_self->dims, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_carray_to_py___pyx_t_5numpy_float64_t(__pyx_v_self->idds, 3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_carray_to_py___pyx_t_5numpy_float64_t(__pyx_v_self->left_edge, 3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->nfiles); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_carray_to_py___pyx_t_5numpy_float64_t(__pyx_v_self->right_edge, 3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(7); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4); + __Pyx_INCREF(__pyx_v_self->masks); + __Pyx_GIVEREF(__pyx_v_self->masks); + PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_self->masks); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_6); + __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_v_state = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; - /* "oct_visitors.pxd":57 - * cdef inline int rind(self): - * cdef int d = (1 << self.oref) - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) # <<<<<<<<<<<<<< - * - * cdef class CountTotalOcts(OctVisitor): + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.dds, self.dims, self.idds, self.left_edge, self.masks, self.nfiles, self.right_edge) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, */ - __pyx_r = (((((__pyx_v_self->ind[2]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[0])); - goto __pyx_L0; + __pyx_t_7 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_v__dict = __pyx_t_7; + __pyx_t_7 = 0; - /* "oct_visitors.pxd":55 - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - * - * cdef inline int rind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) + /* "(tree fragment)":5 + * state = (self.dds, self.dims, self.idds, self.left_edge, self.masks, self.nfiles, self.right_edge) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_8 = (__pyx_v__dict != Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v__dict); + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.masks is not None + */ + __pyx_v_use_setstate = 1; -/* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest - * - * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< - * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. - * return (((i*2)+j)*2+k) + /* "(tree fragment)":5 + * state = (self.dds, self.dims, self.idds, self.left_edge, self.masks, self.nfiles, self.right_edge) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ + goto __pyx_L3; + } -static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("cind", 0); + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = self.masks is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_ParticleRegions, (type(self), 0x7e947ae, None), state + */ + /*else*/ { + __pyx_t_9 = (__pyx_v_self->masks != Py_None); + __pyx_v_use_setstate = __pyx_t_9; + } + __pyx_L3:; - /* "oct_visitors.pxd":125 - * cdef inline int cind(int i, int j, int k): - * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. - * return (((i*2)+j)*2+k) # <<<<<<<<<<<<<< - * + /* "(tree fragment)":10 + * else: + * use_setstate = self.masks is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_ParticleRegions, (type(self), 0x7e947ae, None), state + * else: */ - __pyx_r = ((((__pyx_v_i * 2) + __pyx_v_j) * 2) + __pyx_v_k); - goto __pyx_L0; + __pyx_t_9 = (__pyx_v_use_setstate != 0); + if (__pyx_t_9) { - /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest - * - * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< - * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. - * return (((i*2)+j)*2+k) + /* "(tree fragment)":11 + * use_setstate = self.masks is not None + * if use_setstate: + * return __pyx_unpickle_ParticleRegions, (type(self), 0x7e947ae, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_ParticleRegions, (type(self), 0x7e947ae, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_ParticleRegions); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_132728750); + __Pyx_GIVEREF(__pyx_int_132728750); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_132728750); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_7, 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_6); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = self.masks is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_ParticleRegions, (type(self), 0x7e947ae, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_ParticleRegions, (type(self), 0x7e947ae, None), state + * else: + * return __pyx_unpickle_ParticleRegions, (type(self), 0x7e947ae, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_ParticleRegions__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_ParticleRegions); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_132728750); + __Pyx_GIVEREF(__pyx_int_132728750); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_132728750); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); + __pyx_t_5 = 0; + __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.dds, self.dims, self.idds, self.left_edge, self.masks, self.nfiles, self.right_edge) */ /* 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_AddTraceback("yt.geometry.particle_oct_container.ParticleRegions.__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; } -/* "selection_routines.pxd":26 - * np.float64_t - * - * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_ParticleRegions, (type(self), 0x7e947ae, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_ParticleRegions__set_state(self, __pyx_state) */ -static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_22particle_oct_container_15ParticleRegions_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_22particle_oct_container_15ParticleRegions_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_ensure_code", 0); - - /* "selection_routines.pxd":27 - * - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): # <<<<<<<<<<<<<< - * if "code_length" == str(arr.units): - * return arr - */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 27, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "selection_routines.pxd":28 - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< - * return arr - * arr.convert_to_units("code_length") - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 28, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 28, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { - - /* "selection_routines.pxd":29 - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): - * return arr # <<<<<<<<<<<<<< - * arr.convert_to_units("code_length") - * return arr - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_arr); - __pyx_r = __pyx_v_arr; - goto __pyx_L0; - - /* "selection_routines.pxd":28 - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< - * return arr - * arr.convert_to_units("code_length") - */ - } + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_8__setstate_cython__(((struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "selection_routines.pxd":30 - * if "code_length" == str(arr.units): - * return arr - * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< - * return arr - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "selection_routines.pxd":27 - * - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): # <<<<<<<<<<<<<< - * if "code_length" == str(arr.units): - * return arr - */ - } +static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container_15ParticleRegions_8__setstate_cython__(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "selection_routines.pxd":31 - * return arr - * arr.convert_to_units("code_length") - * return arr # <<<<<<<<<<<<<< - * - * cdef class SelectorObject: + /* "(tree fragment)":15 + * return __pyx_unpickle_ParticleRegions, (type(self), 0x7e947ae, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_ParticleRegions__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_arr); - __pyx_r = __pyx_v_arr; - goto __pyx_L0; + 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_2yt_8geometry_22particle_oct_container___pyx_unpickle_ParticleRegions__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; - /* "selection_routines.pxd":26 - * np.float64_t - * - * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_ParticleRegions, (type(self), 0x7e947ae, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_ParticleRegions__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_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_oct_container.ParticleRegions.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "selection_routines.pxd":78 - * cdef public np.int64_t domain_id - * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 +/* "(tree fragment)":1 + * def __pyx_unpickle_ParticleRegions(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x7e947ae: + * from pickle import PickleError */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) { - __pyx_t_5numpy_float64_t __pyx_v_rel; - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_22particle_oct_container_1__pyx_unpickle_ParticleRegions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_8geometry_22particle_oct_container_1__pyx_unpickle_ParticleRegions = {"__pyx_unpickle_ParticleRegions", (PyCFunction)__pyx_pw_2yt_8geometry_22particle_oct_container_1__pyx_unpickle_ParticleRegions, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_8geometry_22particle_oct_container_1__pyx_unpickle_ParticleRegions(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_ParticleRegions (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ParticleRegions", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ParticleRegions", 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_ParticleRegions") < 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_ParticleRegions", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.particle_oct_container.__pyx_unpickle_ParticleRegions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_22particle_oct_container___pyx_unpickle_ParticleRegions(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); - /* "selection_routines.pxd":80 - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< - * if not periodic: return rel - * if rel > dw * 0.5: - */ - __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "selection_routines.pxd":81 - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel # <<<<<<<<<<<<<< - * if rel > dw * 0.5: - * rel -= dw - */ - __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_rel; - goto __pyx_L0; - } +static PyObject *__pyx_pf_2yt_8geometry_22particle_oct_container___pyx_unpickle_ParticleRegions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_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_ParticleRegions", 0); - /* "selection_routines.pxd":82 - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel - * if rel > dw * 0.5: # <<<<<<<<<<<<<< - * rel -= dw - * elif rel < -dw * 0.5: + /* "(tree fragment)":2 + * def __pyx_unpickle_ParticleRegions(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x7e947ae: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x7e947ae = (dds, dims, idds, left_edge, masks, nfiles, right_edge))" % __pyx_checksum) */ - __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0); + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x7e947ae) != 0); if (__pyx_t_1) { - /* "selection_routines.pxd":83 - * if not periodic: return rel - * if rel > dw * 0.5: - * rel -= dw # <<<<<<<<<<<<<< - * elif rel < -dw * 0.5: - * rel += dw + /* "(tree fragment)":3 + * def __pyx_unpickle_ParticleRegions(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x7e947ae: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x7e947ae = (dds, dims, idds, left_edge, masks, nfiles, right_edge))" % __pyx_checksum) + * result = ParticleRegions.__new__(__pyx_type) */ - __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw); - - /* "selection_routines.pxd":82 - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel - * if rel > dw * 0.5: # <<<<<<<<<<<<<< - * rel -= dw - * elif rel < -dw * 0.5: + __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_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 != 0x7e947ae: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x7e947ae = (dds, dims, idds, left_edge, masks, nfiles, right_edge))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = ParticleRegions.__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_0x7e, __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_PickleError); + __pyx_t_2 = __pyx_v_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_ParticleRegions(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x7e947ae: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x7e947ae = (dds, dims, idds, left_edge, masks, nfiles, right_edge))" % __pyx_checksum) */ - goto __pyx_L4; } - /* "selection_routines.pxd":84 - * if rel > dw * 0.5: - * rel -= dw - * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< - * rel += dw - * return rel + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x7e947ae = (dds, dims, idds, left_edge, masks, nfiles, right_edge))" % __pyx_checksum) + * result = ParticleRegions.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_ParticleRegions__set_state( result, __pyx_state) */ - __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0); - if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_22particle_oct_container_ParticleRegions), __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_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "selection_routines.pxd":85 - * rel -= dw - * elif rel < -dw * 0.5: - * rel += dw # <<<<<<<<<<<<<< - * return rel + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x7e947ae = (dds, dims, idds, left_edge, masks, nfiles, right_edge))" % __pyx_checksum) + * result = ParticleRegions.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_ParticleRegions__set_state( result, __pyx_state) + * return result */ - __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw); + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { - /* "selection_routines.pxd":84 - * if rel > dw * 0.5: - * rel -= dw - * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< - * rel += dw - * return rel + /* "(tree fragment)":7 + * result = ParticleRegions.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_ParticleRegions__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_ParticleRegions__set_state(ParticleRegions 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_2yt_8geometry_22particle_oct_container___pyx_unpickle_ParticleRegions__set_state(((struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *)__pyx_v_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 PickleError("Incompatible checksums (%s vs 0x7e947ae = (dds, dims, idds, left_edge, masks, nfiles, right_edge))" % __pyx_checksum) + * result = ParticleRegions.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_ParticleRegions__set_state( result, __pyx_state) + * return result */ } - __pyx_L4:; - /* "selection_routines.pxd":86 - * elif rel < -dw * 0.5: - * rel += dw - * return rel # <<<<<<<<<<<<<< + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_ParticleRegions__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_ParticleRegions__set_state(ParticleRegions result, tuple __pyx_state): + * result.dds = __pyx_state[0]; result.dims = __pyx_state[1]; result.idds = __pyx_state[2]; result.left_edge = __pyx_state[3]; result.masks = __pyx_state[4]; result.nfiles = __pyx_state[5]; result.right_edge = __pyx_state[6] */ - __pyx_r = __pyx_v_rel; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "selection_routines.pxd":78 - * cdef public np.int64_t domain_id - * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 + /* "(tree fragment)":1 + * def __pyx_unpickle_ParticleRegions(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x7e947ae: + * from pickle import 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("yt.geometry.particle_oct_container.__pyx_unpickle_ParticleRegions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "(tree fragment)":9 + * __pyx_unpickle_ParticleRegions__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_ParticleRegions__set_state(ParticleRegions result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dds = __pyx_state[0]; result.dims = __pyx_state[1]; result.idds = __pyx_state[2]; result.left_edge = __pyx_state[3]; result.masks = __pyx_state[4]; result.nfiles = __pyx_state[5]; result.right_edge = __pyx_state[6] + * if hasattr(result, '__dict__'): */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; +static PyObject *__pyx_f_2yt_8geometry_22particle_oct_container___pyx_unpickle_ParticleRegions__set_state(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_2[3]; + __pyx_t_5numpy_int32_t __pyx_t_3[3]; + __pyx_t_5numpy_uint64_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_ParticleRegions__set_state", 0); - /* "yt/utilities/lib/fp_utils.pxd":20 - * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * - */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_ParticleRegions__set_state(ParticleRegions result, tuple __pyx_state): + * result.dds = __pyx_state[0]; result.dims = __pyx_state[1]; result.idds = __pyx_state[2]; result.left_edge = __pyx_state[3]; result.masks = __pyx_state[4]; result.nfiles = __pyx_state[5]; result.right_edge = __pyx_state[6] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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) + } + __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(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_float64_t(__pyx_t_1, __pyx_t_2, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->dds[0]), __pyx_t_2, sizeof(__pyx_v_result->dds[0]) * (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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_int32_t(__pyx_t_1, __pyx_t_3, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->dims[0]), __pyx_t_3, sizeof(__pyx_v_result->dims[0]) * (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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_float64_t(__pyx_t_1, __pyx_t_2, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->idds[0]), __pyx_t_2, sizeof(__pyx_v_result->idds[0]) * (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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_float64_t(__pyx_t_1, __pyx_t_2, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->left_edge[0]), __pyx_t_2, sizeof(__pyx_v_result->left_edge[0]) * (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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); 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_result->masks); + __Pyx_DECREF(__pyx_v_result->masks); + __pyx_v_result->masks = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->nfiles = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_carray_from_py___pyx_t_5numpy_float64_t(__pyx_t_1, __pyx_t_2, 3) < 0)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_result->right_edge[0]), __pyx_t_2, sizeof(__pyx_v_result->right_edge[0]) * (3)); - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + /* "(tree fragment)":11 + * cdef __pyx_unpickle_ParticleRegions__set_state(ParticleRegions result, tuple __pyx_state): + * result.dds = __pyx_state[0]; result.dims = __pyx_state[1]; result.idds = __pyx_state[2]; result.left_edge = __pyx_state[3]; result.masks = __pyx_state[4]; result.nfiles = __pyx_state[5]; result.right_edge = __pyx_state[6] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[7]) + */ + __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":12 + * result.dds = __pyx_state[0]; result.dims = __pyx_state[1]; result.idds = __pyx_state[2]; result.left_edge = __pyx_state[3]; result.masks = __pyx_state[4]; result.nfiles = __pyx_state[5]; result.right_edge = __pyx_state[6] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[7]) # <<<<<<<<<<<<<< */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + if (!__pyx_t_9) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "(tree fragment)":11 + * cdef __pyx_unpickle_ParticleRegions__set_state(ParticleRegions result, tuple __pyx_state): + * result.dds = __pyx_state[0]; result.dims = __pyx_state[1]; result.idds = __pyx_state[2]; result.left_edge = __pyx_state[3]; result.masks = __pyx_state[4]; result.nfiles = __pyx_state[5]; result.right_edge = __pyx_state[6] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[7]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_ParticleRegions__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_ParticleRegions__set_state(ParticleRegions result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.dds = __pyx_state[0]; result.dims = __pyx_state[1]; result.idds = __pyx_state[2]; result.left_edge = __pyx_state[3]; result.masks = __pyx_state[4]; result.nfiles = __pyx_state[5]; result.right_edge = __pyx_state[6] + * if hasattr(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_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("yt.geometry.particle_oct_container.__pyx_unpickle_ParticleRegions__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 +/* "oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) { + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_cont", 0); - /* "yt/utilities/lib/fp_utils.pxd":24 + /* "oct_container.pxd":57 + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 + * cdef OctList *OctList_append(OctList *list, Oct *o) + */ + __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i]))); + goto __pyx_L0; + + /* "oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) * */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< - * - * cdef inline int imin(int i0, int i1) nogil: - */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 - */ /* function exit code */ __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 +/* "oct_visitors.pxd":51 + * cdef void visit(self, Oct*, np.uint8_t selected) * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * cdef inline int oind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { +static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { + int __pyx_v_d; int __pyx_r; - int __pyx_t_1; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("oind", 0); - /* "yt/utilities/lib/fp_utils.pxd":28 + /* "oct_visitors.pxd":52 * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * cdef inline int oind(self): + * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) * */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + __pyx_v_d = (1 << __pyx_v_self->oref); - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "oct_visitors.pxd":53 + * cdef inline int oind(self): + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * cdef inline int rind(self): */ - __pyx_r = __pyx_v_i1; + __pyx_r = (((((__pyx_v_self->ind[0]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[2])); goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "oct_visitors.pxd":51 + * cdef void visit(self, Oct*, np.uint8_t selected) * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * cdef inline int oind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) */ /* function exit code */ __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 +/* "oct_visitors.pxd":55 + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * cdef inline int rind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { + int __pyx_v_d; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rind", 0); - /* "yt/utilities/lib/fp_utils.pxd":32 + /* "oct_visitors.pxd":56 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + * cdef inline int rind(self): + * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) * */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } + __pyx_v_d = (1 << __pyx_v_self->oref); - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "oct_visitors.pxd":57 + * cdef inline int rind(self): + * cdef int d = (1 << self.oref) + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * cdef class CountTotalOcts(OctVisitor): */ - __pyx_r = __pyx_v_f1; + __pyx_r = (((((__pyx_v_self->ind[2]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[0])); goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "oct_visitors.pxd":55 + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * cdef inline int rind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) */ /* function exit code */ __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 +/* "oct_visitors.pxd":123 + * cdef np.uint64_t *nfinest * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< + * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. + * return (((i*2)+j)*2+k) */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 - * - */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); - if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; - } +static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cind", 0); - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< + /* "oct_visitors.pxd":125 + * cdef inline int cind(int i, int j, int k): + * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. + * return (((i*2)+j)*2+k) # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: */ - __pyx_r = __pyx_v_f0; + __pyx_r = ((((__pyx_v_i * 2) + __pyx_v_j) * 2) + __pyx_v_k); goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "oct_visitors.pxd":123 + * cdef np.uint64_t *nfinest * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< + * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. + * return (((i*2)+j)*2+k) */ /* function exit code */ __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 +/* "selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_ensure_code", 0); - /* "yt/utilities/lib/fp_utils.pxd":40 + /* "selection_routines.pxd":23 * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): # <<<<<<<<<<<<<< + * if "code_length" == str(arr.units): + * return arr */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 23, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "selection_routines.pxd":24 + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< + * return arr + * arr.convert_to_units("code_length") */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 24, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + /* "selection_routines.pxd":25 + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): + * return arr # <<<<<<<<<<<<<< + * arr.convert_to_units("code_length") + * return arr */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "selection_routines.pxd":24 + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< + * return arr + * arr.convert_to_units("code_length") */ + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":45 + /* "selection_routines.pxd":26 + * if "code_length" == str(arr.units): + * return arr + * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< + * return arr * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i + /* "selection_routines.pxd":23 * + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): # <<<<<<<<<<<<<< + * if "code_length" == str(arr.units): + * return arr */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< + /* "selection_routines.pxd":27 + * return arr + * arr.convert_to_units("code_length") + * return arr # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fclip(np.float64_t f, + * cdef class SelectorObject: */ - __pyx_r = __pyx_v_i; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i + /* "selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i +/* "selection_routines.pxd":78 + * cdef public SelectorObject sel2 * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) { + __pyx_t_5numpy_float64_t __pyx_v_rel; __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + /* "selection_routines.pxd":80 + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< + * if not periodic: return rel + * if rel > dw * 0.5: */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); + + /* "selection_routines.pxd":81 + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel # <<<<<<<<<<<<<< + * if rel > dw * 0.5: + * rel -= dw + */ + __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_rel; + goto __pyx_L0; + } + + /* "selection_routines.pxd":82 + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel + * if rel > dw * 0.5: # <<<<<<<<<<<<<< + * rel -= dw + * elif rel < -dw * 0.5: + */ + __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0); + if (__pyx_t_1) { + + /* "selection_routines.pxd":83 + * if not periodic: return rel + * if rel > dw * 0.5: + * rel -= dw # <<<<<<<<<<<<<< + * elif rel < -dw * 0.5: + * rel += dw + */ + __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw); + + /* "selection_routines.pxd":82 + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel + * if rel > dw * 0.5: # <<<<<<<<<<<<<< + * rel -= dw + * elif rel < -dw * 0.5: + */ + goto __pyx_L4; + } + + /* "selection_routines.pxd":84 + * if rel > dw * 0.5: + * rel -= dw + * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< + * rel += dw + * return rel + */ + __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0); + if (__pyx_t_1) { + + /* "selection_routines.pxd":85 + * rel -= dw + * elif rel < -dw * 0.5: + * rel += dw # <<<<<<<<<<<<<< + * return rel + */ + __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw); + + /* "selection_routines.pxd":84 + * if rel > dw * 0.5: + * rel -= dw + * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< + * rel += dw + * return rel + */ + } + __pyx_L4:; + + /* "selection_routines.pxd":86 + * elif rel < -dw * 0.5: + * rel += dw + * return rel # <<<<<<<<<<<<<< + */ + __pyx_r = __pyx_v_rel; goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "selection_routines.pxd":78 + * cdef public SelectorObject sel2 * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 */ /* function exit code */ @@ -8778,21 +9676,21 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; - /* "yt/utilities/lib/fp_utils.pxd":54 + /* "yt/utilities/lib/fp_utils.pxd":20 * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -8803,20 +9701,20 @@ goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 * return i1 # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ @@ -8826,46 +9724,47 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":57 +/* "yt/utilities/lib/fp_utils.pxd":23 * return i1 * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - /* "yt/utilities/lib/fp_utils.pxd":58 + /* "yt/utilities/lib/fp_utils.pxd":24 * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 * */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; + __pyx_r = __pyx_v_f0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_r = __pyx_v_i1; + __pyx_r = __pyx_v_f1; goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":57 + /* "yt/utilities/lib/fp_utils.pxd":23 * return i1 * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ /* function exit code */ @@ -8873,2288 +9772,3704 @@ return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags + /* "yt/utilities/lib/fp_utils.pxd":28 * - * if info == NULL: return # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); if (__pyx_t_1) { - __pyx_r = 0; + __pyx_r = __pyx_v_i0; goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_v_endian_detector = 1; + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * ndim = PyArray_NDIM(self) + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_v_copy_shape = 1; + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - goto __pyx_L4; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":36 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + if (__pyx_t_1) { + __pyx_r = (-__pyx_v_f0); + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + __pyx_r = __pyx_v_f0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * - * 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") + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 218, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":40 * - * 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") + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 * - * 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") + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * info.buf = PyArray_DATA(self) + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 222, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":45 * - * 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") + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + * cdef inline np.float64_t fclip(np.float64_t f, */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i + * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * 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]); +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i + * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - goto __pyx_L11; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * 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)); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * 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; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * cdef int t + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_v_f = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":58 * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * if not hasfields and not copy_shape: */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - goto __pyx_L14; + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * - * if not hasfields: + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; } - __pyx_L14:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { + __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): + * ndim = PyArray_NDIM(self) */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ - if (__pyx_t_1) { + __pyx_v_copy_shape = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 259, __pyx_L1_error) + goto __pyx_L4; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 218, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 222, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; + __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 278, __pyx_L1_error) - break; - } + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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->format = __pyx_v_f; + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< * else: - * info.format = stdlib.malloc(_buffer_format_string_len) + * info.strides = PyArray_STRIDES(self) */ - __pyx_r = 0; - goto __pyx_L0; + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ + goto __pyx_L11; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * info.shape[i] = PyArray_DIMS(self)[i] * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL */ /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) */ - __pyx_v_offset = 0; + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L11:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; + __pyx_v_info->suboffsets = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * - * def __releasebuffer__(ndarray self, Py_buffer* info): */ - (__pyx_v_f[0]) = '\x00'; - } + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * 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)); - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ + __pyx_v_f = NULL; -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: */ - free(__pyx_v_info->format); + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer */ - free(__pyx_v_info->strides); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + goto __pyx_L14; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * if not hasfields: */ + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L14:; - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * - * cdef inline object PyArray_MultiIterNew2(a, b): + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 259, __pyx_L1_error) - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(3, 278, __pyx_L1_error) + break; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + */ + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = '\x00'; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * 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(3, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * 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(3, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * 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); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * 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(3, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * 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(3, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + long __pyx_t_8; + char *__pyx_t_9; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(3, 794, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_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(3, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * 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(3, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(3, 796, __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(3, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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(3, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 799, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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") + * + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 803, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 0x78; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(3, 823, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + /*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(3, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 844, __pyx_L1_error) + } + __pyx_L15:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + goto __pyx_L13; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f * - * 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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(3, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __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_XGIVEREF(__pyx_r); + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ -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; +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * cdef inline object get_array_base(ndarray arr): */ - __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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ -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) { +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: */ - __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, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) * */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ -static CYTHON_INLINE 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; +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_2 = NULL; 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); + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __pyx_v_endian_detector = 1; + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 987, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(2, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_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, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; + } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") * */ - if (unlikely(__pyx_v_descr->fields == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; + __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(3, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * - * if (end - f) - (new_offset - offset[0]) < 15: + * cdef inline int import_umath() except -1: */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 989, __pyx_L5_except_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * if ((child.byteorder == c'>' and little_endian) or + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 799, __pyx_L1_error) + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - } + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 993, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __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:; + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") * - * 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:; + __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(3, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + * cdef inline int import_ufunc() except -1: */ - if (__pyx_t_6) { + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 0x78; +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 999, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * offset[0] += child.itemsize + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + __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(3, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + /* 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.to_py":112 * - * # Until ticket #99 is fixed, use integers to avoid warnings + * @cname("__Pyx_carray_to_py___pyx_t_5numpy_float64_t") + * cdef inline list __Pyx_carray_to_py___pyx_t_5numpy_float64_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 823, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * +static CYTHON_INLINE PyObject *__Pyx_carray_to_py___pyx_t_5numpy_float64_t(__pyx_t_5numpy_float64_t *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_l = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + __Pyx_RefNannySetupContext("__Pyx_carray_to_py___pyx_t_5numpy_float64_t", 0); + + /* "carray.to_py":115 + * cdef size_t i + * cdef object value + * l = PyList_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] */ - } + __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_l = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" + /* "carray.to_py":116 + * cdef object value + * l = PyList_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } + __pyx_t_2 = ((size_t)__pyx_v_length); + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" + /* "carray.to_py":117 + * l = PyList_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" + /* "carray.to_py":118 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyList_SET_ITEM(l, i, value) + * return l */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } + Py_INCREF(__pyx_v_value); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" + /* "carray.to_py":119 + * value = v[i] + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) # <<<<<<<<<<<<<< + * return l + * */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } + PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" + /* "carray.to_py":120 + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) + * return l # <<<<<<<<<<<<<< + * + * */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_l); + __pyx_r = __pyx_v_l; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" + /* "carray.to_py":112 + * + * @cname("__Pyx_carray_to_py___pyx_t_5numpy_float64_t") + * cdef inline list __Pyx_carray_to_py___pyx_t_5numpy_float64_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py___pyx_t_5numpy_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_l); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "carray.to_py":124 + * + * @cname("__Pyx_carray_to_tuple___pyx_t_5numpy_float64_t") + * cdef inline tuple __Pyx_carray_to_tuple___pyx_t_5numpy_float64_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple___pyx_t_5numpy_float64_t(__pyx_t_5numpy_float64_t *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple___pyx_t_5numpy_float64_t", 0); + + /* "carray.to_py":127 + * cdef size_t i + * cdef object value + * t = PyTuple_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } + __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_t = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" + /* "carray.to_py":128 + * cdef object value + * t = PyTuple_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } + __pyx_t_2 = ((size_t)__pyx_v_length); + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" + /* "carray.to_py":129 + * t = PyTuple_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + /* "carray.to_py":130 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(t, i, value) + * return t + */ + Py_INCREF(__pyx_v_value); + + /* "carray.to_py":131 + * value = v[i] + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) # <<<<<<<<<<<<<< + * return t + */ + PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value); + } + + /* "carray.to_py":132 + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) + * return t # <<<<<<<<<<<<<< */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_t); + __pyx_r = __pyx_v_t; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + /* "carray.to_py":124 + * + * @cname("__Pyx_carray_to_tuple___pyx_t_5numpy_float64_t") + * cdef inline tuple __Pyx_carray_to_tuple___pyx_t_5numpy_float64_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple___pyx_t_5numpy_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "carray.from_py":77 + * + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_float64_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg +static int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(PyObject *__pyx_v_o, __pyx_t_5numpy_float64_t *__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; + __pyx_t_5numpy_float64_t __pyx_t_11; + char const *__pyx_t_12; + __Pyx_RefNannySetupContext("__Pyx_carray_from_py___pyx_t_5numpy_float64_t", 0); + + /* "carray.from_py":78 + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_float64_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length # <<<<<<<<<<<<<< + * try: + * i = len(o) */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_v_i = __pyx_v_length; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: + /* "carray.from_py":80 + * cdef Py_ssize_t i = length + * try: + * i = len(o) # <<<<<<<<<<<<<< + * except (TypeError, OverflowError): + * pass */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 80, __pyx_L3_error) + __pyx_v_i = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } + } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: + /* "carray.from_py":81 + * try: + * i = len(o) + * except (TypeError, OverflowError): # <<<<<<<<<<<<<< + * pass + * if i == length: */ - /*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, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 844, __pyx_L1_error) - } - __pyx_L15:; + __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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(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_v_f = (__pyx_v_f + 1); + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: */ - goto __pyx_L13; - } + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; + __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(1, 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(1, 84, __pyx_L1_error) } - __pyx_L13:; + 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(1, 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(1, 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(1, 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(1, 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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * - * + /* "carray.from_py":86 + * for i, item in enumerate(o): + * if i >= length: + * break # <<<<<<<<<<<<<< + * v[i] = item + * else: */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; + goto __pyx_L11_break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item */ + } - /* 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; -} + /* "carray.from_py":87 + * if i >= length: + * break + * v[i] = item # <<<<<<<<<<<<<< + * else: + * i += 1 # convert index to length + */ + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_item); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 87, __pyx_L1_error) + (__pyx_v_v[__pyx_v_i]) = __pyx_t_11; -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break */ + } + /*else*/ { -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); + /* "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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 + * */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! + /* "carray.from_py":91 + * i += 1 # convert index to length + * if i == length: + * return 0 # <<<<<<<<<<<<<< + * + * PyErr_Format( */ - __pyx_v_baseptr = NULL; + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 + * */ - goto __pyx_L3; - } + } + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break */ - /*else*/ { - Py_INCREF(__pyx_v_base); + __pyx_L11_break:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); } - __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr - * + /* "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) */ - Py_XDECREF(__pyx_v_arr->base); + 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"); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< + /* "carray.from_py":93 + * return 0 * - * cdef inline object get_array_base(ndarray arr): + * PyErr_Format( # <<<<<<<<<<<<<< + * IndexError, + * ("too many values found during array assignment, expected %zd" */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "carray.from_py":77 * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_float64_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_float64_t(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___pyx_t_5numpy_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr +/* "carray.to_py":112 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * @cname("__Pyx_carray_to_py___pyx_t_5numpy_int32_t") + * cdef inline list __Pyx_carray_to_py___pyx_t_5numpy_int32_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { +static CYTHON_INLINE PyObject *__Pyx_carray_to_py___pyx_t_5numpy_int32_t(__pyx_t_5numpy_int32_t *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_l = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + __Pyx_RefNannySetupContext("__Pyx_carray_to_py___pyx_t_5numpy_int32_t", 0); + + /* "carray.to_py":115 + * cdef size_t i + * cdef object value + * l = PyList_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] + */ + __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_l = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: + /* "carray.to_py":116 + * cdef object value + * l = PyList_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { + __pyx_t_2 = ((size_t)__pyx_v_length); + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base + /* "carray.to_py":117 + * l = PyList_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyInt_From_npy_int32((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "carray.to_py":118 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyList_SET_ITEM(l, i, value) + * return l + */ + Py_INCREF(__pyx_v_value); + + /* "carray.to_py":119 + * value = v[i] + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) # <<<<<<<<<<<<<< + * return l * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: */ + PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value); } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< + /* "carray.to_py":120 + * Py_INCREF(value) + * PyList_SET_ITEM(l, i, value) + * return l # <<<<<<<<<<<<<< * * */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_l); + __pyx_r = __pyx_v_l; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "carray.to_py":112 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * @cname("__Pyx_carray_to_py___pyx_t_5numpy_int32_t") + * cdef inline list __Pyx_carray_to_py___pyx_t_5numpy_int32_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py___pyx_t_5numpy_int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_l); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_array", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") +} + +/* "carray.to_py":124 + * + * @cname("__Pyx_carray_to_tuple___pyx_t_5numpy_int32_t") + * cdef inline tuple __Pyx_carray_to_tuple___pyx_t_5numpy_int32_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: +static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple___pyx_t_5numpy_int32_t(__pyx_t_5numpy_int32_t *__pyx_v_v, Py_ssize_t __pyx_v_length) { + size_t __pyx_v_i; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple___pyx_t_5numpy_int32_t", 0); + + /* "carray.to_py":127 + * cdef size_t i + * cdef object value + * t = PyTuple_New(length) # <<<<<<<<<<<<<< + * for i in range(length): + * value = v[i] */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_t = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") - * + /* "carray.to_py":128 + * cdef object value + * t = PyTuple_New(length) + * for i in range(length): # <<<<<<<<<<<<<< + * value = v[i] + * Py_INCREF(value) */ - __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, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = ((size_t)__pyx_v_length); + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: + /* "carray.to_py":129 + * t = PyTuple_New(length) + * for i in range(length): + * value = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = __Pyx_PyInt_From_npy_int32((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "carray.to_py":130 + * for i in range(length): + * value = v[i] + * Py_INCREF(value) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(t, i, value) + * return t + */ + Py_INCREF(__pyx_v_value); + + /* "carray.to_py":131 + * value = v[i] + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) # <<<<<<<<<<<<<< + * return t + */ + PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value); + } + + /* "carray.to_py":132 + * Py_INCREF(value) + * PyTuple_SET_ITEM(t, i, value) + * return t # <<<<<<<<<<<<<< */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_t); + __pyx_r = __pyx_v_t; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "carray.to_py":124 + * + * @cname("__Pyx_carray_to_tuple___pyx_t_5numpy_int32_t") + * cdef inline tuple __Pyx_carray_to_tuple___pyx_t_5numpy_int32_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef size_t i + * cdef object value */ /* 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_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple___pyx_t_5numpy_int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") +/* "carray.from_py":77 * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_int32_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_int32_t(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length * try: - * _import_umath() */ -static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { +static int __Pyx_carray_from_py___pyx_t_5numpy_int32_t(PyObject *__pyx_v_o, __pyx_t_5numpy_int32_t *__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; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_umath", 0); + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + __pyx_t_5numpy_int32_t __pyx_t_11; + char const *__pyx_t_12; + __Pyx_RefNannySetupContext("__Pyx_carray_from_py___pyx_t_5numpy_int32_t", 0); + + /* "carray.from_py":78 + * @cname("__Pyx_carray_from_py___pyx_t_5numpy_int32_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_int32_t(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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_int32_t(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * i = len(o) + * except (TypeError, OverflowError): */ { __Pyx_PyThreadState_declare @@ -11165,67 +13480,52 @@ __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: + /* "carray.from_py":80 + * cdef Py_ssize_t i = length * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + * i = len(o) # <<<<<<<<<<<<<< + * except (TypeError, OverflowError): + * pass */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) + __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 80, __pyx_L3_error) + __pyx_v_i = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_int32_t(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * 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_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + /* "carray.from_py":81 * 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, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_ufunc() except -1: + * i = len(o) + * except (TypeError, OverflowError): # <<<<<<<<<<<<<< + * pass + * if i == length: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 995, __pyx_L5_except_error) + __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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_int32_t(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * i = len(o) + * except (TypeError, OverflowError): */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_1); @@ -11233,156 +13533,226 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L4_exception_handled:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + /* "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) { - /* 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; -} + /* "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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 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); -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + /* "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) { -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); + /* "carray.from_py":86 + * for i, item in enumerate(o): + * if i >= length: + * break # <<<<<<<<<<<<<< + * v[i] = item + * else: + */ + goto __pyx_L11_break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "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_PyInt_As_npy_int32(__pyx_v_item); if (unlikely((__pyx_t_11 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 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 * - * 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:*/ { + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "carray.from_py":91 + * i += 1 # convert index to length + * if i == length: + * return 0 # <<<<<<<<<<<<<< + * + * PyErr_Format( */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: */ + } } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break */ - __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, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_L11_break:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "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) */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + 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"); } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "carray.from_py":93 + * return 0 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * 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(1, 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___pyx_t_5numpy_int32_t") + * cdef int __Pyx_carray_from_py___pyx_t_5numpy_int32_t(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length * 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_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py___pyx_t_5numpy_int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -11415,10 +13785,15 @@ 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; } @@ -11427,21 +13802,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -11449,12 +13828,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -11463,11 +13844,11 @@ } } __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(3, 120, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 121, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) } else { /* "View.MemoryView":121 @@ -11482,15 +13863,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(3, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(3, 120, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __pyx_L1_error) } __pyx_r = __pyx_array___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); @@ -11541,9 +13922,9 @@ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(3, 127, __pyx_L1_error) + __PYX_ERR(1, 127, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 127, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 @@ -11572,11 +13953,11 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 131, __pyx_L1_error) + __PYX_ERR(1, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize @@ -11604,11 +13985,11 @@ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 134, __pyx_L1_error) + __PYX_ERR(1, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") @@ -11637,9 +14018,9 @@ * 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(3, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -11661,7 +14042,7 @@ * 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(3, 138, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) __pyx_t_5 = __pyx_v_format; __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -11677,7 +14058,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -11715,11 +14096,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 146, __pyx_L1_error) + __PYX_ERR(1, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim @@ -11742,12 +14123,12 @@ 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(3, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 149, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dim = __pyx_t_8; __pyx_v_idx = __pyx_t_7; @@ -11770,11 +14151,11 @@ * self._shape[idx] = dim * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); @@ -11782,20 +14163,20 @@ 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(3, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(3, 151, __pyx_L1_error) + __PYX_ERR(1, 151, __pyx_L1_error) /* "View.MemoryView":150 * @@ -11832,7 +14213,7 @@ * 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(3, 155, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":156 @@ -11874,7 +14255,7 @@ * 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(3, 158, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":159 @@ -11917,19 +14298,19 @@ * 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(3, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 162, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 162, __pyx_L1_error) + __PYX_ERR(1, 162, __pyx_L1_error) } __pyx_L10:; @@ -11958,8 +14339,8 @@ * if allocate_buffer: * */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 168, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; @@ -11999,11 +14380,11 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 174, __pyx_L1_error) + __PYX_ERR(1, 174, __pyx_L1_error) /* "View.MemoryView":173 * @@ -12042,11 +14423,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(3, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __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(3, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { @@ -12167,7 +14548,7 @@ * 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(3, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -12197,7 +14578,7 @@ * 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(3, 187, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { @@ -12237,11 +14618,11 @@ * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 190, __pyx_L1_error) + __PYX_ERR(1, 190, __pyx_L1_error) /* "View.MemoryView":189 * elif self.mode == u"fortran": @@ -12581,7 +14962,7 @@ * @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(3, 221, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -12640,11 +15021,11 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 226, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -12655,7 +15036,7 @@ 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(3, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -12719,9 +15100,9 @@ * 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(3, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -12784,9 +15165,9 @@ * 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(3, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 233, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -12847,9 +15228,9 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(3, 236, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":235 @@ -12872,6 +15253,113 @@ 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__19, 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__20, 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":240 * * @cname("__pyx_array_new") @@ -12908,13 +15396,13 @@ * 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(3, 245, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -12928,7 +15416,7 @@ __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(3, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -12952,13 +15440,13 @@ * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -12980,9 +15468,9 @@ * result.data = buf * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 248, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(3, 248, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) /* "View.MemoryView":247 * result = array(shape, itemsize, format, mode.decode('ASCII')) @@ -12991,7 +15479,7 @@ * 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(3, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -13067,6 +15555,7 @@ 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; } @@ -13077,7 +15566,7 @@ 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(3, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -13086,100 +15575,387 @@ } __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(3, 277, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___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":278 + * 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":277 + * 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":279 + * 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":280 + * 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":279 + * 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; + } - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "(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:; -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); + /* "(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) { - /* "View.MemoryView":278 - * cdef object name - * def __init__(self, name): - * self.name = name # <<<<<<<<<<<<<< - * def __repr__(self): - * return self.name + /* "(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_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; + __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; - /* "View.MemoryView":277 - * cdef class Enum(object): - * cdef object name - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * def __repr__(self): + /* "(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_r = 0; + __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; } -/* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * +/* "(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_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { +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("__repr__ (wrapper)", 0); - __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + __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_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { +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 - __Pyx_RefNannySetupContext("__repr__", 0); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "View.MemoryView":280 - * self.name = name - * def __repr__(self): - * return self.name # <<<<<<<<<<<<<< - * - * cdef generic = Enum("") + /* "(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) # <<<<<<<<<<<<<< */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->name); - __pyx_r = __pyx_v_self->name; - goto __pyx_L0; + 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; - /* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * + /* "(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(); @@ -13294,8 +16070,11 @@ 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; } @@ -13304,11 +16083,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(3, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -13316,11 +16097,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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; @@ -13328,16 +16110,16 @@ } } __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(3, 341, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 341, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -13408,7 +16190,7 @@ * 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 == -1)) __PYX_ERR(3, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) /* "View.MemoryView":346 * if type(self) is memoryview or obj is not None: @@ -13529,7 +16311,7 @@ * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(3, 357, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) /* "View.MemoryView":356 * if self.lock is NULL: @@ -13870,26 +16652,26 @@ __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(3, 389, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 389, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(3, 389, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(3, 389, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -13899,7 +16681,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 389, __pyx_L1_error) + else __PYX_ERR(1, 389, __pyx_L1_error) } break; } @@ -13917,8 +16699,8 @@ * * 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(3, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":389 @@ -14035,7 +16817,7 @@ * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 399, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -14047,7 +16829,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 399, __pyx_L1_error) + __PYX_ERR(1, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -14055,14 +16837,14 @@ __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(3, 399, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 399, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 399, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; @@ -14076,7 +16858,7 @@ * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":403 @@ -14087,7 +16869,7 @@ * 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(3, 403, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -14110,7 +16892,7 @@ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(3, 405, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":406 @@ -14121,7 +16903,7 @@ * 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(3, 406, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -14191,7 +16973,7 @@ * * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 409, __pyx_L1_error) + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; @@ -14203,7 +16985,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 409, __pyx_L1_error) + __PYX_ERR(1, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); @@ -14211,14 +16993,14 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 409, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 409, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 409, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; @@ -14232,7 +17014,7 @@ * obj = self.is_slice(value) * if obj: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":412 @@ -14242,7 +17024,7 @@ * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 412, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; @@ -14254,7 +17036,7 @@ * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":414 @@ -14264,9 +17046,9 @@ * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 414, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -14289,10 +17071,10 @@ * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 416, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -14317,7 +17099,7 @@ * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 418, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -14405,7 +17187,7 @@ * 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(3, 423, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":424 @@ -14415,7 +17197,7 @@ * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 424, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":423 @@ -14425,7 +17207,7 @@ * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 423, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -14436,7 +17218,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(3, 423, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -14453,7 +17235,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -14470,7 +17252,7 @@ __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(3, 425, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); @@ -14513,7 +17295,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -14585,7 +17367,7 @@ * 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(3, 434, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":435 * @@ -14594,7 +17376,7 @@ * 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(3, 435, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) /* "View.MemoryView":436 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], @@ -14603,13 +17385,13 @@ * * 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(3, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":434 @@ -14619,7 +17401,7 @@ * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 434, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":430 * return obj @@ -14725,7 +17507,7 @@ * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(3, 450, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) /* "View.MemoryView":449 * if self.view.itemsize > sizeof(array): @@ -14813,7 +17595,7 @@ * */ /*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(3, 459, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 459, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -14836,7 +17618,7 @@ * 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(3, 464, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -14951,7 +17733,7 @@ * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(3, 471, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":472 @@ -14961,7 +17743,7 @@ * * 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(3, 472, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15020,7 +17802,7 @@ * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -15032,7 +17814,7 @@ * 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(3, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -15060,9 +17842,9 @@ * 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(3, 482, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 482, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -15079,7 +17861,7 @@ #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(3, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -15088,14 +17870,14 @@ #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(3, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 482, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -15106,7 +17888,7 @@ __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(3, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -15143,7 +17925,7 @@ * */ __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(3, 487, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -15185,13 +17967,13 @@ * raise ValueError("Unable to convert item to object") * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 483, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(3, 483, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); @@ -15203,11 +17985,11 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(3, 484, __pyx_L5_except_error) + __PYX_ERR(1, 484, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -15298,7 +18080,7 @@ * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -15321,26 +18103,26 @@ * 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(3, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(3, 499, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -15362,9 +18144,9 @@ * 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(3, 501, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -15381,7 +18163,7 @@ #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(3, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -15390,14 +18172,14 @@ #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(3, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 501, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -15408,12 +18190,12 @@ __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(3, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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(3, 501, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 501, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } @@ -15429,7 +18211,7 @@ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(3, 503, __pyx_L1_error) + __PYX_ERR(1, 503, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -15816,9 +18598,9 @@ * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 540, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(3, 540, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; @@ -15829,7 +18611,7 @@ * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(3, 541, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) /* "View.MemoryView":542 * cdef _memoryviewslice result = memoryview_copy(self) @@ -15956,18 +18738,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 550, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_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(3, 550, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 550, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 550, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; @@ -16044,11 +18826,11 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(3, 556, __pyx_L1_error) + __PYX_ERR(1, 556, __pyx_L1_error) /* "View.MemoryView":554 * @property @@ -16067,18 +18849,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 558, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_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(3, 558, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 558, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 558, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; @@ -16156,9 +18938,9 @@ * 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(3, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__19, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__23, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -16182,18 +18964,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 565, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 565, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(3, 565, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 565, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -16255,7 +19037,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -16315,7 +19097,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -16377,11 +19159,11 @@ * @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(3, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 577, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -16475,7 +19257,7 @@ __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(3, 584, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; @@ -16487,7 +19269,7 @@ * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 585, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; @@ -16665,12 +19447,12 @@ * */ __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(3, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -16681,12 +19463,12 @@ * * def __str__(self): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 599, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -16697,7 +19479,7 @@ * id(self)) * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -16705,7 +19487,7 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -16769,20 +19551,20 @@ * */ __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(3, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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(3, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -16855,7 +19637,7 @@ * 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(3, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -16926,7 +19708,7 @@ * 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(3, 615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -17006,7 +19788,7 @@ * 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(3, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":627 @@ -17017,7 +19799,7 @@ * 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(3, 627, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -17098,7 +19880,7 @@ * 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(3, 634, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":639 @@ -17109,7 +19891,7 @@ * */ __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(3, 639, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -17134,6 +19916,113 @@ 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__24, 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__25, 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":643 * * @cname('__pyx_memoryview_new') @@ -17158,11 +20047,11 @@ * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -17173,7 +20062,7 @@ 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(3, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); @@ -17310,7 +20199,7 @@ * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -17348,7 +20237,7 @@ * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 662, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -17384,26 +20273,26 @@ __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(3, 665, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(3, 665, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(3, 665, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -17413,7 +20302,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 665, __pyx_L1_error) + else __PYX_ERR(1, 665, __pyx_L1_error) } break; } @@ -17423,7 +20312,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(3, 665, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -17457,17 +20346,17 @@ * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 668, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__20); + __Pyx_INCREF(__pyx_slice__26); + __Pyx_GIVEREF(__pyx_slice__26); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__26); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":669 @@ -17497,7 +20386,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__21); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__27); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) } __pyx_L7:; @@ -17547,19 +20436,19 @@ * * 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(3, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 675, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(3, 675, __pyx_L1_error) + __PYX_ERR(1, 675, __pyx_L1_error) /* "View.MemoryView":674 * have_slices = True @@ -17596,7 +20485,7 @@ * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 678, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) } __pyx_L6:; @@ -17618,7 +20507,7 @@ * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 680, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":681 @@ -17638,16 +20527,16 @@ * * 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(3, 682, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__22); - __Pyx_GIVEREF(__pyx_slice__22); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__22); + __Pyx_INCREF(__pyx_slice__28); + __Pyx_GIVEREF(__pyx_slice__28); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__28); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":681 @@ -17669,20 +20558,20 @@ __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(3, 684, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 684, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 684, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 684, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -17768,11 +20657,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 689, __pyx_L1_error) + __PYX_ERR(1, 689, __pyx_L1_error) /* "View.MemoryView":688 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): @@ -17876,7 +20765,7 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(3, 708, __pyx_L1_error) + __PYX_ERR(1, 708, __pyx_L1_error) } } #endif @@ -17899,7 +20788,7 @@ * 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(3, 711, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -17995,26 +20884,26 @@ __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(3, 732, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 732, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(3, 732, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(3, 732, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -18024,7 +20913,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 732, __pyx_L1_error) + else __PYX_ERR(1, 732, __pyx_L1_error) } break; } @@ -18052,7 +20941,7 @@ * 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(3, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) /* "View.MemoryView":734 * for dim, index in enumerate(indices): @@ -18061,7 +20950,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 734, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) /* "View.MemoryView":733 * @@ -18138,13 +21027,13 @@ * 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(3, 746, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 746, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -18160,13 +21049,13 @@ * 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(3, 747, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 747, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -18182,13 +21071,13 @@ * * 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(3, 748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 748, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -18204,7 +21093,7 @@ * 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(3, 750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -18217,7 +21106,7 @@ * 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(3, 751, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -18230,7 +21119,7 @@ * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 752, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -18243,7 +21132,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 754, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) /* "View.MemoryView":760 * have_start, have_stop, have_step, @@ -18293,7 +21182,7 @@ * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 764, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } /* "View.MemoryView":765 * return memoryview_fromslice(dst, new_ndim, @@ -18302,7 +21191,7 @@ * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 765, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } /* "View.MemoryView":763 * @@ -18311,9 +21200,9 @@ * 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(3, 763, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 763, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -18344,7 +21233,7 @@ * * */ - __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(3, 768, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":768 @@ -18354,7 +21243,7 @@ * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -18457,7 +21346,7 @@ * 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 == -1)) __PYX_ERR(3, 818, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: @@ -18522,7 +21411,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 824, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) /* "View.MemoryView":823 * negative_step = have_step != 0 and step < 0 @@ -19094,7 +21983,7 @@ * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 885, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) } __pyx_L26:; @@ -19151,11 +22040,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -19223,11 +22112,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(3, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __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(3, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); @@ -19335,22 +22224,22 @@ * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(3, 914, __pyx_L1_error) + __PYX_ERR(1, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: @@ -19387,22 +22276,22 @@ * * resultp = bufp + index * stride */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 917, __pyx_L1_error) + __PYX_ERR(1, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) @@ -19602,7 +22491,7 @@ * * return 1 */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 943, __pyx_L1_error) + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] @@ -19636,11 +22525,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -19725,7 +22614,7 @@ * 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(3, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -19749,7 +22638,7 @@ */ /*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(3, 969, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -19808,7 +22697,7 @@ * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(3, 973, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) /* "View.MemoryView":972 * @@ -19828,7 +22717,7 @@ * @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(3, 975, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -19902,7 +22791,114 @@ */ /* function exit code */ - __pyx_L0:; + __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__30, 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__31, 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; @@ -19971,9 +22967,9 @@ * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 999, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -19984,7 +22980,7 @@ __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(3, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -20015,7 +23011,7 @@ * 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(3, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -20186,7 +23182,7 @@ __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(3, 1026, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; @@ -20198,12 +23194,12 @@ * * 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(3, 1027, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1027, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1027, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } @@ -20295,7 +23291,7 @@ * 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(3, 1039, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -20352,7 +23348,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -20516,7 +23512,7 @@ * @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(3, 1067, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20639,7 +23635,7 @@ * * */ - __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(3, 1084, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; @@ -21437,7 +24433,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) /* "View.MemoryView":1207 * @@ -21609,11 +24605,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -21637,7 +24633,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -21648,13 +24644,13 @@ * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -21673,20 +24669,20 @@ * (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(3, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1237, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 1237, __pyx_L1_error) + __PYX_ERR(1, 1237, __pyx_L1_error) /* "View.MemoryView":1235 * @@ -21706,7 +24702,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -21728,7 +24724,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -21740,11 +24736,11 @@ * * @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(3, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -21760,14 +24756,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #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(3, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -21776,20 +24772,20 @@ #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(3, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -21797,7 +24793,7 @@ __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(3, 1242, __pyx_L1_error) + __PYX_ERR(1, 1242, __pyx_L1_error) /* "View.MemoryView":1241 * @@ -21819,7 +24815,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -21842,7 +24838,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -21864,7 +24860,7 @@ * 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(3, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -21878,14 +24874,14 @@ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #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(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -21894,20 +24890,20 @@ #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(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -21915,7 +24911,7 @@ __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(3, 1247, __pyx_L1_error) + __PYX_ERR(1, 1247, __pyx_L1_error) /* "View.MemoryView":1246 * @cname('__pyx_memoryview_err') @@ -21935,7 +24931,7 @@ */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(3, 1249, __pyx_L1_error) + __PYX_ERR(1, 1249, __pyx_L1_error) } /* "View.MemoryView":1245 @@ -21958,7 +24954,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -22176,7 +25172,7 @@ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 1281, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) } __pyx_L7:; @@ -22206,7 +25202,7 @@ * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 1284, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) /* "View.MemoryView":1283 * _err_extents(i, dst.shape[i], src.shape[i]) @@ -22263,7 +25259,7 @@ * src = tmp * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(3, 1291, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1292 @@ -22447,7 +25443,7 @@ * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(3, 1313, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) /* "View.MemoryView":1314 * @@ -22456,7 +25452,7 @@ * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(3, 1314, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) /* "View.MemoryView":1310 * return 0 @@ -22525,11 +25521,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -22709,7 +25705,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -22733,7 +25729,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -23027,20 +26023,483 @@ * * */ - __pyx_v_data = (__pyx_v_data + __pyx_v_stride); - } + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ } - __pyx_L3:; - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer __pyx_vtable_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer; @@ -23055,7 +26514,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -23118,6 +26577,8 @@ {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_12finalize, METH_NOARGS, 0}, {"add", (PyCFunction)__pyx_pw_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_14add, METH_O, 0}, {"recursively_count", (PyCFunction)__pyx_pw_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_16recursively_count, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_18__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_20__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -23204,7 +26665,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_22particle_oct_container_ParticleRegions(PyObject *o) { struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *p = (struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -23261,6 +26722,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_22particle_oct_container_ParticleRegions[] = { {"add_data_file", (PyCFunction)__pyx_pw_2yt_8geometry_22particle_oct_container_15ParticleRegions_3add_data_file, METH_VARARGS|METH_KEYWORDS, 0}, {"identify_data_files", (PyCFunction)__pyx_pw_2yt_8geometry_22particle_oct_container_15ParticleRegions_5identify_data_files, METH_O, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_22particle_oct_container_15ParticleRegions_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_22particle_oct_container_15ParticleRegions_9__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -23360,7 +26823,7 @@ int e; struct __pyx_obj_2yt_8geometry_22particle_oct_container___pyx_scope_struct____iter__ *p = (struct __pyx_obj_2yt_8geometry_22particle_oct_container___pyx_scope_struct____iter__ *)o; if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } return 0; } @@ -23456,7 +26919,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -23506,6 +26969,8 @@ 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} }; @@ -23625,7 +27090,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -23653,6 +27118,8 @@ } 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} }; @@ -23740,7 +27207,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -23852,6 +27319,8 @@ {"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} }; @@ -23977,7 +27446,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -24021,6 +27490,8 @@ } 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} }; @@ -24127,6 +27598,8 @@ {&__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_0x7e, __pyx_k_Incompatible_checksums_s_vs_0x7e, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x7e), 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_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}, @@ -24137,11 +27610,14 @@ {&__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_ParticleOctreeContainer___iter, __pyx_k_ParticleOctreeContainer___iter, sizeof(__pyx_k_ParticleOctreeContainer___iter), 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_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_allocate_root, __pyx_k_allocate_root, sizeof(__pyx_k_allocate_root), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, @@ -24150,11 +27626,13 @@ {&__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_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 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_convert_to_units, __pyx_k_convert_to_units, sizeof(__pyx_k_convert_to_units), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, @@ -24184,19 +27662,31 @@ {&__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_nfiles, __pyx_k_nfiles, sizeof(__pyx_k_nfiles), 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_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_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 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_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_ParticleRegions, __pyx_k_pyx_unpickle_ParticleRegions, sizeof(__pyx_k_pyx_unpickle_ParticleRegions), 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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 0, 0, 1, 1}, + {&__pyx_kp_s_self_dom_offsets_self_oct_list_s, __pyx_k_self_dom_offsets_self_oct_list_s, sizeof(__pyx_k_self_dom_offsets_self_oct_list_s), 0, 0, 1, 0}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 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_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, @@ -24205,6 +27695,7 @@ {&__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_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, @@ -24214,21 +27705,23 @@ {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 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_yt_geometry_particle_oct_contain, __pyx_k_yt_geometry_particle_oct_contain, sizeof(__pyx_k_yt_geometry_particle_oct_contain), 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, 38, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 181, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 146, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(3, 149, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(3, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(3, 425, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(3, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(3, 818, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 182, __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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 218, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 989, __pyx_L1_error) + __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(1, 81, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 84, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 94, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -24238,16 +27731,35 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "selection_routines.pxd":30 + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_dom_offsets_self_oct_list_s); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(tree fragment)":4 + * raise TypeError("self.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.dom_offsets,self.oct_list,self.root_mesh cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_dom_offsets_self_oct_list_s); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -24256,9 +27768,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -24267,9 +27779,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -24278,9 +27790,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -24289,9 +27801,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -24300,9 +27812,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -24311,9 +27823,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -24322,9 +27834,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -24333,18 +27845,18 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); /* "View.MemoryView":131 * @@ -24353,9 +27865,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); /* "View.MemoryView":134 * @@ -24364,9 +27876,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); /* "View.MemoryView":137 * @@ -24375,9 +27887,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(3, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); /* "View.MemoryView":146 * @@ -24386,9 +27898,9 @@ * * */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(3, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -24397,9 +27909,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -24408,9 +27920,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "(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__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "(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__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -24419,9 +27950,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -24430,9 +27961,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "View.MemoryView":563 * def suboffsets(self): @@ -24441,12 +27972,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__19 = PyTuple_New(1); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); + __pyx_tuple__23 = PyTuple_New(1); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__19, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__19); + PyTuple_SET_ITEM(__pyx_tuple__23, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "(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__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "(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__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "View.MemoryView":668 * if item is Ellipsis: @@ -24455,9 +28005,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__20 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(3, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); + __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__26); + __Pyx_GIVEREF(__pyx_slice__26); /* "View.MemoryView":671 * seen_ellipsis = True @@ -24466,9 +28016,9 @@ * have_slices = True * else: */ - __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(3, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__21); - __Pyx_GIVEREF(__pyx_slice__21); + __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__27); + __Pyx_GIVEREF(__pyx_slice__27); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -24477,9 +28027,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(3, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__22); - __Pyx_GIVEREF(__pyx_slice__22); + __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__28); + __Pyx_GIVEREF(__pyx_slice__28); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -24488,9 +28038,38 @@ * * */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "(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__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "(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__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "(tree fragment)":1 + * def __pyx_unpickle_ParticleRegions(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x7e947ae: + * from pickle import PickleError + */ + __pyx_tuple__32 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ParticleRegions, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(1, 1, __pyx_L1_error) /* "View.MemoryView":282 * return self.name @@ -24499,9 +28078,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); /* "View.MemoryView":283 * @@ -24510,9 +28089,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(3, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -24521,9 +28100,9 @@ * * */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(3, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); /* "View.MemoryView":287 * @@ -24532,9 +28111,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); /* "View.MemoryView":288 * @@ -24543,9 +28122,19 @@ * * */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__39 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -24558,6 +28147,8 @@ __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_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_132728750 = PyInt_FromLong(132728750L); if (unlikely(!__pyx_int_132728750)) __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:; @@ -24623,6 +28214,7 @@ __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 @@ -24669,30 +28261,34 @@ __pyx_vtable_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer.filter_particles = (void (*)(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint64_t *, __pyx_t_5numpy_int64_t, int))__pyx_f_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_filter_particles; __pyx_vtable_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer.visit = (PyObject *(*)(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_int64_t *, struct __pyx_opt_args_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_visit *__pyx_optional_args))__pyx_f_2yt_8geometry_22particle_oct_container_23ParticleOctreeContainer_visit; __pyx_type_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer.tp_base = __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer; - if (PyType_Ready(&__pyx_type_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_type_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer) < 0) __PYX_ERR(0, 27, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "ParticleOctreeContainer", (PyObject *)&__pyx_type_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ParticleOctreeContainer", (PyObject *)&__pyx_type_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_ptype_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer = &__pyx_type_2yt_8geometry_22particle_oct_container_ParticleOctreeContainer; __pyx_vtabptr_2yt_8geometry_22particle_oct_container_ParticleRegions = &__pyx_vtable_2yt_8geometry_22particle_oct_container_ParticleRegions; __pyx_vtable_2yt_8geometry_22particle_oct_container_ParticleRegions.__pyx_fuse_0_mask_positions = (void (*)(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *, PyArrayObject *, __pyx_t_5numpy_uint64_t, int))__pyx_fuse_0__pyx_f_2yt_8geometry_22particle_oct_container_15ParticleRegions__mask_positions; __pyx_vtable_2yt_8geometry_22particle_oct_container_ParticleRegions.__pyx_fuse_1_mask_positions = (void (*)(struct __pyx_obj_2yt_8geometry_22particle_oct_container_ParticleRegions *, PyArrayObject *, __pyx_t_5numpy_uint64_t, int))__pyx_fuse_1__pyx_f_2yt_8geometry_22particle_oct_container_15ParticleRegions__mask_positions; - if (PyType_Ready(&__pyx_type_2yt_8geometry_22particle_oct_container_ParticleRegions) < 0) __PYX_ERR(0, 270, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_22particle_oct_container_ParticleRegions) < 0) __PYX_ERR(0, 267, __pyx_L1_error) __pyx_type_2yt_8geometry_22particle_oct_container_ParticleRegions.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_22particle_oct_container_ParticleRegions.tp_dict, __pyx_vtabptr_2yt_8geometry_22particle_oct_container_ParticleRegions) < 0) __PYX_ERR(0, 270, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "ParticleRegions", (PyObject *)&__pyx_type_2yt_8geometry_22particle_oct_container_ParticleRegions) < 0) __PYX_ERR(0, 270, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_22particle_oct_container_ParticleRegions.tp_dict, __pyx_vtabptr_2yt_8geometry_22particle_oct_container_ParticleRegions) < 0) __PYX_ERR(0, 267, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ParticleRegions", (PyObject *)&__pyx_type_2yt_8geometry_22particle_oct_container_ParticleRegions) < 0) __PYX_ERR(0, 267, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_22particle_oct_container_ParticleRegions) < 0) __PYX_ERR(0, 267, __pyx_L1_error) __pyx_ptype_2yt_8geometry_22particle_oct_container_ParticleRegions = &__pyx_type_2yt_8geometry_22particle_oct_container_ParticleRegions; - if (PyType_Ready(&__pyx_type_2yt_8geometry_22particle_oct_container___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_22particle_oct_container___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_type_2yt_8geometry_22particle_oct_container___pyx_scope_struct____iter__.tp_print = 0; __pyx_ptype_2yt_8geometry_22particle_oct_container___pyx_scope_struct____iter__ = &__pyx_type_2yt_8geometry_22particle_oct_container___pyx_scope_struct____iter__; __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(3, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(3, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(3, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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; @@ -24702,18 +28298,20 @@ __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(3, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(3, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -24723,11 +28321,11 @@ sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(4, 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, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 861, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = __Pyx_ImportType("yt.geometry.oct_visitors", "OctVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(5, 33, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(5, 33, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = __Pyx_ImportType("yt.geometry.oct_visitors", "CountTotalOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts)) __PYX_ERR(5, 59, __pyx_L1_error) @@ -24766,16 +28364,22 @@ __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(5, 114, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType("yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(5, 117, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(5, 117, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(1, 33, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(1, 33, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(1, 71, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(1, 71, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(1, 74, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(1, 74, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(6, 89, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(6, 89, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(6, 97, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(6, 97, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 29, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 29, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 67, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 67, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 70, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 70, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType("yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(2, 74, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(2, 74, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = __Pyx_ImportType("yt.utilities.lib.allocation_container", "ObjectPool", sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(6, 26, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(6, 26, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = __Pyx_ImportType("yt.geometry.oct_container", "OctObjectPool", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(7, 55, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(7, 55, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(7, 94, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(7, 94, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(7, 102, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(7, 102, __pyx_L1_error) /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportVoidPtr(__pyx_t_1, "ORDER_MAX", (void **)&__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -24801,8 +28405,8 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/particle_oct_container.pyx":268 - * np.float64_t + /* "yt/geometry/particle_oct_container.pyx":265 + * return * * cdef np.uint64_t ONEBIT=1 # <<<<<<<<<<<<<< * @@ -24810,6 +28414,16 @@ */ __pyx_v_2yt_8geometry_22particle_oct_container_ONEBIT = 1; + /* "(tree fragment)":1 + * def __pyx_unpickle_ParticleRegions(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x7e947ae: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_22particle_oct_container_1__pyx_unpickle_ParticleRegions, NULL, __pyx_n_s_yt_geometry_particle_oct_contain); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ParticleRegions, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* "yt/geometry/particle_oct_container.pyx":1 * """ # <<<<<<<<<<<<<< * Oct container tuned for Particles @@ -24827,9 +28441,9 @@ * * def __dealloc__(array self): */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 207, __pyx_L1_error) + __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(3, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_array_type); @@ -24840,7 +28454,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_3); @@ -24854,7 +28468,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 283, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_3); @@ -24868,7 +28482,7 @@ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 284, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_3); @@ -24882,7 +28496,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 287, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_3); @@ -24896,7 +28510,7 @@ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 288, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_3); @@ -24936,9 +28550,9 @@ * * */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 535, __pyx_L1_error) + __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(3, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_memoryview_type); @@ -24949,18 +28563,28 @@ * * */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 981, __pyx_L1_error) + __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(3, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -24972,7 +28596,7 @@ __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.geometry.particle_oct_container", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.geometry.particle_oct_container", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -25688,17 +29312,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -25817,8 +29446,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON @@ -25858,11 +29487,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -25885,7 +29510,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -25906,7 +29531,7 @@ #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -26069,7 +29694,7 @@ #endif /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -26185,7 +29810,7 @@ #endif /* RaiseArgTupleInvalid */ - static void __Pyx_RaiseArgtupleInvalid( + static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, @@ -26211,7 +29836,7 @@ } /* RaiseDoubleKeywords */ - static void __Pyx_RaiseDoubleKeywordsError( + static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { @@ -26225,7 +29850,7 @@ } /* ParseKeywords */ - static int __Pyx_ParseOptionalKeywords( + static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, @@ -26327,7 +29952,7 @@ } /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -26338,9 +29963,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -26353,9 +29981,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -26408,7 +30039,7 @@ } /* PyObjectCallMethod1 */ - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto done; @@ -26454,7 +30085,7 @@ } /* append */ - static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { @@ -26467,7 +30098,7 @@ } /* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); @@ -26485,7 +30116,7 @@ } /* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -26498,19 +30129,153 @@ } /* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { + static void __Pyx_RaiseBufferFallbackError(void) { PyErr_SetString(PyExc_ValueError, "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); } /* BufferIndexError */ - static void __Pyx_RaiseBufferIndexError(int axis) { + static void __Pyx_RaiseBufferIndexError(int axis) { PyErr_Format(PyExc_IndexError, "Out of bounds on buffer access (axis %d)", axis); } +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* 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; + } +} + /* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -26528,7 +30293,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -26548,7 +30322,7 @@ } /* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -26588,6 +30362,21 @@ 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; @@ -26632,25 +30421,25 @@ } /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -26674,7 +30463,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -26684,7 +30473,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -26745,28 +30534,15 @@ } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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_COMPILING_IN_CPYTHON -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); -} - /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -26799,7 +30575,7 @@ } /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -26823,87 +30599,13 @@ } #endif -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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)); @@ -26911,7 +30613,7 @@ } /* CallNextTpDealloc */ - static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { PyTypeObject* type = Py_TYPE(obj); while (type && type->tp_dealloc != current_tp_dealloc) type = type->tp_base; @@ -26922,7 +30624,7 @@ } /* CallNextTpTraverse */ - static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { PyTypeObject* type = Py_TYPE(obj); while (type && type->tp_traverse != current_tp_traverse) type = type->tp_base; @@ -26934,7 +30636,7 @@ } /* CallNextTpClear */ - static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { PyTypeObject* type = Py_TYPE(obj); while (type && type->tp_clear != current_tp_clear) type = type->tp_base; @@ -26945,7 +30647,7 @@ } /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -26965,7 +30667,7 @@ } /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -26982,8 +30684,107 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -27063,7 +30864,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -27122,12 +30923,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -27143,31 +30947,39 @@ Py_XDECREF(py_frame); } -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { - if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); - if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); - if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); - PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); - return -1; -} -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject *obj = view->obj; - if (!obj) return; - if (PyObject_CheckBuffer(obj)) { - PyBuffer_Release(view); - return; +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(npy_int32) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int32) <= 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_int32), + little, !is_unsigned); } - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } - Py_DECREF(obj); - view->obj = NULL; } -#endif - - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -27189,24 +31001,24 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { + const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { + if (sizeof(npy_uint64) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { + } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { - if (sizeof(int) <= sizeof(long)) { + if (sizeof(npy_uint64) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -27214,30 +31026,53 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), + return _PyLong_FromByteArray(bytes, sizeof(npy_uint64), 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; +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + Py_DECREF(obj); + view->obj = NULL; +} +#endif + + + /* 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(npy_int64) < sizeof(long)) { + if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) { + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { - if (sizeof(npy_int64) <= sizeof(long)) { + if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -27245,30 +31080,30 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { - const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; + 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_uint64) < sizeof(long)) { + if (sizeof(npy_int64) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_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_uint64) <= sizeof(long)) { + if (sizeof(npy_int64) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -27276,30 +31111,30 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(npy_uint64), + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), little, !is_unsigned); } } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { - const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; + 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(npy_int32) < sizeof(long)) { + if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) { + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { - if (sizeof(npy_int32) <= sizeof(long)) { + if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -27307,13 +31142,13 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(npy_int32), + return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* MemviewSliceIsContig */ - static int + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -27336,7 +31171,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -27372,7 +31207,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -27385,7 +31220,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -27405,7 +31240,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -27540,7 +31375,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -27560,7 +31395,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -27695,7 +31530,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -27726,19 +31561,19 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; + static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (int) val; + return (npy_int32) val; } } else #endif @@ -27747,32 +31582,32 @@ #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 0: return (npy_int32) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0]) case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 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])); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) { + return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); } } break; case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 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])); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) { + return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); } } break; case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 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])); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) { + return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); } } break; @@ -27786,86 +31621,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (int) -1; + return (npy_int32) -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)) + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { - case 0: return (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 0: return (npy_int32) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0]) case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) - 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]))); + __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { + return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 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]))); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { + return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) - 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]))); + __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { + return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 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]))); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { + return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) - 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]))); + __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { + return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int32) > 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]))); + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { + return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); } } break; } #endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, 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)) + } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -27874,7 +31709,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - int val; + npy_int32 val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -27894,40 +31729,40 @@ return val; } #endif - return (int) -1; + return (npy_int32) -1; } } else { - int val; + npy_int32 val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; + "value too large to convert to npy_int32"); + return (npy_int32) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; + "can't convert negative value to npy_int32"); + return (npy_int32) -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; + static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { + const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 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)) + if (sizeof(npy_uint64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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; + return (npy_uint64) val; } } else #endif @@ -27936,32 +31771,32 @@ #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 0: return (npy_uint64) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, digits[0]) case 2: - if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_uint64) > 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])); + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) >= 2 * PyLong_SHIFT) { + return (npy_uint64) (((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); } } break; case 3: - if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_uint64) > 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])); + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) >= 3 * PyLong_SHIFT) { + return (npy_uint64) (((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); } } break; case 4: - if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_uint64) > 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])); + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) >= 4 * PyLong_SHIFT) { + return (npy_uint64) (((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); } } break; @@ -27975,86 +31810,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (npy_int64) -1; + return (npy_uint64) -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)) + if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, 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)) + } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, 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 0: return (npy_uint64) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_uint64, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, +digits[0]) case -2: - if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_uint64) - 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]))); + __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); } } break; case 2: - if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_uint64) > 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]))); + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint64) ((((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); } } break; case -3: - if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_uint64) - 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]))); + __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); } } break; case 3: - if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_uint64) > 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]))); + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint64) ((((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); } } break; case -4: - if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_uint64) - 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]))); + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); } } break; case 4: - if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_uint64) > 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]))); + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint64) ((((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); } } break; } #endif - if (sizeof(npy_int64) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x)) + if (sizeof(npy_uint64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, 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)) + } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -28063,7 +31898,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - npy_int64 val; + npy_uint64 val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -28083,40 +31918,40 @@ return val; } #endif - return (npy_int64) -1; + return (npy_uint64) -1; } } else { - npy_int64 val; + npy_uint64 val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (npy_int64) -1; - val = __Pyx_PyInt_As_npy_int64(tmp); + if (!tmp) return (npy_uint64) -1; + val = __Pyx_PyInt_As_npy_uint64(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to npy_int64"); - return (npy_int64) -1; + "value too large to convert to npy_uint64"); + return (npy_uint64) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to npy_int64"); - return (npy_int64) -1; + "can't convert negative value to npy_uint64"); + return (npy_uint64) -1; } /* CIntFromPy */ - static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { - const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; + 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(npy_uint64) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG(x)) + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (npy_uint64) val; + return (int) val; } } else #endif @@ -28125,32 +31960,32 @@ #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { - case 0: return (npy_uint64) 0; - case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, digits[0]) + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: - if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_uint64) >= 2 * PyLong_SHIFT) { - return (npy_uint64) (((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + __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(npy_uint64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_uint64) >= 3 * PyLong_SHIFT) { - return (npy_uint64) (((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + __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(npy_uint64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) >= 4 * PyLong_SHIFT) { - return (npy_uint64) (((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + __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; @@ -28164,86 +31999,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (npy_uint64) -1; + return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif - if (sizeof(npy_uint64) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned long, PyLong_AsUnsignedLong(x)) + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } 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 (npy_uint64) 0; - case -1: __PYX_VERIFY_RETURN_INT(npy_uint64, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, +digits[0]) + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: - if (8 * sizeof(npy_uint64) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { - return (npy_uint64) (((npy_uint64)-1)*(((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + __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(npy_uint64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { - return (npy_uint64) ((((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + __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(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { - return (npy_uint64) (((npy_uint64)-1)*(((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + __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(npy_uint64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { - return (npy_uint64) ((((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + __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(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { - return (npy_uint64) (((npy_uint64)-1)*(((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + __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(npy_uint64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { - return (npy_uint64) ((((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + __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(npy_uint64) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, long, PyLong_AsLong(x)) + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -28252,7 +32087,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - npy_uint64 val; + int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -28272,40 +32107,40 @@ return val; } #endif - return (npy_uint64) -1; + return (int) -1; } } else { - npy_uint64 val; + int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (npy_uint64) -1; - val = __Pyx_PyInt_As_npy_uint64(tmp); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to npy_uint64"); - return (npy_uint64) -1; + "value too large to convert to int"); + return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to npy_uint64"); - return (npy_uint64) -1; + "can't convert negative value to int"); + return (int) -1; } /* CIntFromPy */ - static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { - const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; + 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(npy_int32) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x)) + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (npy_int32) val; + return (long) val; } } else #endif @@ -28314,32 +32149,32 @@ #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { - case 0: return (npy_int32) 0; - case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0]) + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: - if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) { - return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); + __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(npy_int32) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) { - return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); + __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(npy_int32) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) { - return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])); + __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; @@ -28353,86 +32188,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (npy_int32) -1; + return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif - if (sizeof(npy_int32) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x)) + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } 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 (npy_int32) 0; - case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0]) + case 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(npy_int32) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { - return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + __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(npy_int32) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { - return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + __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(npy_int32) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { - return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + __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(npy_int32) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { - return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + __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(npy_int32) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { - return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + __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(npy_int32) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { - return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]))); + __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(npy_int32) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x)) + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -28441,7 +32276,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - npy_int32 val; + long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -28461,40 +32296,40 @@ return val; } #endif - return (npy_int32) -1; + return (long) -1; } } else { - npy_int32 val; + long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (npy_int32) -1; - val = __Pyx_PyInt_As_npy_int32(tmp); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to npy_int32"); - return (npy_int32) -1; + "value too large to convert to long"); + return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to npy_int32"); - return (npy_int32) -1; + "can't convert negative value to long"); + return (long) -1; } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; + 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(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(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 (long) val; + return (npy_int64) val; } } else #endif @@ -28503,32 +32338,32 @@ #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 0: return (npy_int64) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0]) case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 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])); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 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])); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 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])); + __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; @@ -28542,86 +32377,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (long) -1; + return (npy_int64) -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)) + 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(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } 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 (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 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(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) - 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]))); + __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(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 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]))); + __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(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) - 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]))); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 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]))); + __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(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) - 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]))); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 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]))); + __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(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, 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)) + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -28630,7 +32465,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - long val; + npy_int64 val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -28650,28 +32485,28 @@ return val; } #endif - return (long) -1; + return (npy_int64) -1; } } else { - long val; + npy_int64 val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + 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 long"); - return (long) -1; + "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 long"); - return (long) -1; + "can't convert negative value to npy_int64"); + return (npy_int64) -1; } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -28738,7 +32573,7 @@ } /* MemviewSliceInit */ - static int + static int __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, @@ -28872,39 +32707,197 @@ } } -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; +/* CIntFromPy */ + static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; const int is_unsigned = neg_one > const_zero; - if (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); +#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(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } 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 (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + } + } 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(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); + } 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; } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } +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) { + 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 @@ -29093,7 +33086,7 @@ } /* FetchCommonType */ - static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); @@ -29132,7 +33125,7 @@ } /* CoroutineBase */ - #include + #include #include static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); @@ -29665,7 +33658,7 @@ } /* PatchModuleWithCoroutine */ - static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { + static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; @@ -29705,7 +33698,7 @@ } /* PatchGeneratorABC */ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( @@ -29759,7 +33752,7 @@ } /* Generator */ - static PyMethodDef __pyx_Generator_methods[] = { + static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, @@ -29848,7 +33841,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -29864,7 +33857,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -29882,7 +33875,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -29947,7 +33940,7 @@ #endif /* VoidPtrImport */ - #ifndef __PYX_HAVE_RT_ImportVoidPtr + #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; @@ -29996,7 +33989,7 @@ #endif /* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction + #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; @@ -30050,7 +34043,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -30075,6 +34068,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -30083,11 +34078,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/geometry/particle_oct_container.pyx yt-3.4.0/yt/geometry/particle_oct_container.pyx --- yt-3.3.3/yt/geometry/particle_oct_container.pyx 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/geometry/particle_oct_container.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -23,6 +23,7 @@ import numpy as np from selection_routines cimport SelectorObject cimport cython +from cython cimport floating cdef class ParticleOctreeContainer(OctreeContainer): cdef Oct** oct_list @@ -261,10 +262,6 @@ self.visit(o.children[cind(i,j,k)], counts, level + 1) return -ctypedef fused anyfloat: - np.float32_t - np.float64_t - cdef np.uint64_t ONEBIT=1 cdef class ParticleRegions: @@ -299,7 +296,7 @@ @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) - cdef void _mask_positions(self, np.ndarray[anyfloat, ndim=2] pos, + cdef void _mask_positions(self, np.ndarray[floating, ndim=2] pos, np.uint64_t file_id, int filter): # TODO: Replace with the bitarray cdef np.int64_t no = pos.shape[0] diff -Nru yt-3.3.3/yt/geometry/particle_smooth.c yt-3.4.0/yt/geometry/particle_smooth.c --- yt-3.3.3/yt/geometry/particle_smooth.c 2016-12-12 01:41:32.000000000 +0000 +++ yt-3.4.0/yt/geometry/particle_smooth.c 2017-08-10 18:20:18.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -12,6 +12,10 @@ ], "libraries": [ "m" + ], + "name": "yt.geometry.particle_smooth", + "sources": [ + "yt/geometry/particle_smooth.pyx" ] }, "module_name": "yt.geometry.particle_smooth" @@ -25,7 +29,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -47,6 +51,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -199,16 +204,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -335,6 +344,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -389,6 +404,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -501,8 +545,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -515,8 +559,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -638,10 +685,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -675,13 +724,15 @@ static const char *__pyx_f[] = { "yt/geometry/particle_smooth.pyx", - "yt/geometry/particle_deposit.pxd", + "stringsource", "yt/geometry/selection_routines.pxd", "__init__.pxd", - "stringsource", + "yt/geometry/particle_deposit.pxd", "type.pxd", "yt/geometry/oct_visitors.pxd", + "yt/utilities/lib/allocation_container.pxd", "yt/geometry/oct_container.pxd", + "yt/utilities/lib/distance_queue.pxd", }; /* MemviewSliceStruct.proto */ struct __pyx_memoryview_obj; @@ -1015,10 +1066,15 @@ struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject; struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector; +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool; +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool; struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer; struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation; +struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue; +struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue; struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth; struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth; @@ -1135,7 +1191,7 @@ __pyx_t_5numpy_float64_t right_edge_x; __pyx_t_5numpy_float64_t right_edge_y; __pyx_t_5numpy_float64_t right_edge_z; - __pyx_t_5numpy_int64_t children_pointers; + __pyx_t_5numpy_int_t children_pointers; __pyx_t_5numpy_int64_t start_index_x; __pyx_t_5numpy_int64_t start_index_y; __pyx_t_5numpy_int64_t start_index_z; @@ -1177,7 +1233,7 @@ struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid; struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells; -/* "selection_routines.pxd":42 +/* "selection_routines.pxd":38 * cdef np.int64_t _hash * * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -1189,7 +1245,7 @@ int visit_covered; }; -/* "selection_routines.pxd":50 +/* "selection_routines.pxd":46 * np.float64_t spos[3], np.float64_t sdds[3], * OctVisitor visitor, int i, int j, int k) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1201,7 +1257,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "selection_routines.pxd":65 +/* "selection_routines.pxd":61 * np.ndarray[np.uint8_t, ndim=3] mask, * int level) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -1212,14 +1268,43 @@ int __pyx_n; __pyx_t_5numpy_uint8_t *cached_mask; }; +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer; +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs; + +/* "yt/utilities/lib/allocation_container.pxd":19 + * from libc.stdlib cimport malloc, free, realloc + * + * cdef struct AllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + void *my_objs; +}; + +/* "yt/utilities/lib/allocation_container.pxd":30 + * cdef np.uint64_t n_con + * cdef AllocationContainer* containers + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except * # <<<<<<<<<<<<<< + * cdef void setup_objs(self, void *obj, np.uint64_t count, + * np.uint64_t offset, np.int64_t con_id) + */ +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs { + int __pyx_n; + __pyx_t_5numpy_int64_t con_id; +}; struct __pyx_t_2yt_8geometry_13oct_container_OctKey; struct __pyx_t_2yt_8geometry_13oct_container_OctInfo; -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_t_2yt_8geometry_13oct_container_OctList; +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs; -/* "oct_container.pxd":28 +/* "oct_container.pxd":30 * cdef int ORDER_MAX * * cdef struct OctKey: # <<<<<<<<<<<<<< @@ -1231,7 +1316,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node; }; -/* "oct_container.pxd":32 +/* "oct_container.pxd":34 * Oct *node * * cdef struct OctInfo: # <<<<<<<<<<<<<< @@ -1245,25 +1330,9 @@ __pyx_t_5numpy_int32_t level; }; -/* "oct_container.pxd":38 +/* "oct_container.pxd":40 * np.int32_t level * - * cdef struct OctAllocationContainer # <<<<<<<<<<<<<< - * cdef struct OctAllocationContainer: - * np.int64_t n - */ -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { - __pyx_t_5numpy_int64_t n; - __pyx_t_5numpy_int64_t n_assigned; - __pyx_t_5numpy_int64_t offset; - __pyx_t_5numpy_int64_t con_id; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *next; - struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_octs; -}; - -/* "oct_container.pxd":47 - * Oct *my_octs - * * cdef struct OctList # <<<<<<<<<<<<<< * * cdef struct OctList: @@ -1273,7 +1342,22 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "oct_container.pxd":69 +/* "oct_container.pxd":48 + * # NOTE: This object *has* to be the same size as the AllocationContainer + * # object. There's an assert in the __cinit__ function. + * cdef struct OctAllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs; +}; + +/* "oct_container.pxd":74 * cdef public np.int64_t nocts * cdef public int num_domains * cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?, # <<<<<<<<<<<<<< @@ -1286,8 +1370,8 @@ int max_level; }; -/* "oct_container.pxd":78 - * # OctAllocationContainer.offset if such a thing exists. +/* "oct_container.pxd":83 + * # AllocationContainer.offset if such a thing exists. * cdef np.int64_t get_domain_offset(self, int domain_id) * cdef void visit_all_octs(self, # <<<<<<<<<<<<<< * selection_routines.SelectorObject selector, @@ -1306,24 +1390,37 @@ * if kernel_name == 'cubic': */ typedef __pyx_t_5numpy_float64_t (*__pyx_t_2yt_8geometry_16particle_deposit_kernel_func)(__pyx_t_5numpy_float64_t); -struct __pyx_t_2yt_8geometry_15particle_smooth_NeighborList; -struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search; +struct __pyx_t_2yt_9utilities_3lib_14distance_queue_ItemList; +struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList; -/* "yt/geometry/particle_smooth.pxd":30 - * void *alloca(int) +/* "yt/utilities/lib/distance_queue.pxd":25 + * # THESE TWO STRUCTS MUST BE EQUIVALENT + * + * cdef struct ItemList: # <<<<<<<<<<<<<< + * np.int64_t ind + * np.float64_t value + */ +struct __pyx_t_2yt_9utilities_3lib_14distance_queue_ItemList { + __pyx_t_5numpy_int64_t ind; + __pyx_t_5numpy_float64_t value; +}; + +/* "yt/utilities/lib/distance_queue.pxd":29 + * np.float64_t value * - * cdef struct NeighborList # <<<<<<<<<<<<<< - * cdef struct NeighborList: + * cdef struct NeighborList: # <<<<<<<<<<<<<< * np.int64_t pn # Particle number + * np.float64_t r2 # radius**2 */ -struct __pyx_t_2yt_8geometry_15particle_smooth_NeighborList { +struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList { __pyx_t_5numpy_int64_t pn; __pyx_t_5numpy_float64_t r2; }; +struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search; -/* "yt/geometry/particle_smooth.pxd":56 +/* "yt/geometry/particle_smooth.pxd":51 * int *nsize, np.float64_t[:,:] oct_left_edges, - * np.float64_t[:,:] oct_dds) + * np.float64_t[:,:] oct_dds, DistanceQueue dq) * cdef int neighbor_search(self, np.float64_t pos[3], OctreeContainer octree, # <<<<<<<<<<<<<< * np.int64_t **nind, int *nsize, * np.int64_t nneighbors, np.int64_t domain_id, @@ -1592,12 +1689,12 @@ struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base; __Pyx_memviewslice ref_mask; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs; - __pyx_t_5numpy_int64_t *nocts; - __pyx_t_5numpy_int64_t *nfinest; + __pyx_t_5numpy_uint64_t *nocts; + __pyx_t_5numpy_uint64_t *nfinest; }; -/* "selection_routines.pxd":33 +/* "selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1617,7 +1714,7 @@ }; -/* "selection_routines.pxd":71 +/* "selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1629,7 +1726,7 @@ }; -/* "selection_routines.pxd":74 +/* "selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1643,18 +1740,59 @@ }; -/* "oct_container.pxd":57 +/* "selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2; +}; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool { + PyObject_HEAD + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab; + __pyx_t_5numpy_uint64_t itemsize; + __pyx_t_5numpy_uint64_t n_con; + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers; +}; + + +/* "oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; +}; + + +/* "oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer { PyObject_HEAD struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *cont; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer **domains; + struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh; int partial_coverage; int level_offset; @@ -1668,7 +1806,7 @@ }; -/* "oct_container.pxd":89 +/* "oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -1684,7 +1822,7 @@ }; -/* "oct_container.pxd":97 +/* "oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -1712,8 +1850,39 @@ }; -/* "yt/geometry/particle_smooth.pxd":35 - * np.float64_t r2 # radius**2 +/* "yt/utilities/lib/distance_queue.pxd":40 + * np.float64_t max_dist2) + * + * cdef class PriorityQueue: # <<<<<<<<<<<<<< + * cdef int maxn + * cdef int curn + */ +struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue { + PyObject_HEAD + struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_vtab; + int maxn; + int curn; + struct __pyx_t_2yt_9utilities_3lib_14distance_queue_ItemList *items; +}; + + +/* "yt/utilities/lib/distance_queue.pxd":47 + * cdef int item_insert(self, np.int64_t i, np.float64_t value) + * + * cdef class DistanceQueue(PriorityQueue): # <<<<<<<<<<<<<< + * cdef np.float64_t DW[3] + * cdef bint periodicity[3] + */ +struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue { + struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue __pyx_base; + __pyx_t_5numpy_float64_t DW[3]; + int periodicity[3]; + struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList *neighbors; +}; + + +/* "yt/geometry/particle_smooth.pxd":32 + * void *alloca(int) * * cdef class ParticleSmoothOperation: # <<<<<<<<<<<<<< * # We assume each will allocate and define their own temporary storage @@ -1727,15 +1896,13 @@ __pyx_t_5numpy_float64_t DW[3]; int nfields; int maxn; - int curn; int periodicity[3]; - struct __pyx_t_2yt_8geometry_15particle_smooth_NeighborList *neighbors; void (*pos_setup)(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); }; -/* "yt/geometry/particle_smooth.pyx":657 - * self.process(offset, i, j, k, dim, opos, fields, index_fields) +/* "yt/geometry/particle_smooth.pyx":583 + * self.process(offset, i, j, k, dim, opos, fields, index_fields, dq) * * cdef class VolumeWeightedSmooth(ParticleSmoothOperation): # <<<<<<<<<<<<<< * # This smoothing function evaluates the field, *without* normalization, at @@ -1748,7 +1915,7 @@ }; -/* "yt/geometry/particle_smooth.pyx":734 +/* "yt/geometry/particle_smooth.pyx":660 * volume_weighted_smooth = VolumeWeightedSmooth * * cdef class NearestNeighborSmooth(ParticleSmoothOperation): # <<<<<<<<<<<<<< @@ -1762,7 +1929,7 @@ }; -/* "yt/geometry/particle_smooth.pyx":766 +/* "yt/geometry/particle_smooth.pyx":692 * nearest_smooth = NearestNeighborSmooth * * cdef class IDWInterpolationSmooth(ParticleSmoothOperation): # <<<<<<<<<<<<<< @@ -1777,7 +1944,7 @@ }; -/* "yt/geometry/particle_smooth.pyx":809 +/* "yt/geometry/particle_smooth.pyx":735 * idw_smooth = IDWInterpolationSmooth * * cdef class NthNeighborDistanceSmooth(ParticleSmoothOperation): # <<<<<<<<<<<<<< @@ -1789,7 +1956,7 @@ }; -/* "yt/geometry/particle_smooth.pyx":831 +/* "yt/geometry/particle_smooth.pyx":757 * nth_neighbor_smooth = NthNeighborDistanceSmooth * * cdef class SmoothedDensityEstimate(ParticleSmoothOperation): # <<<<<<<<<<<<<< @@ -2149,7 +2316,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree; -/* "selection_routines.pxd":33 +/* "selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -2172,7 +2339,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; -/* "selection_routines.pxd":71 +/* "selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2186,7 +2353,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; -/* "selection_routines.pxd":74 +/* "selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2200,12 +2367,58 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; -/* "oct_container.pxd":57 +/* "selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool { + void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args); + void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); + void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + + +/* "oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ + +struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); +}; +static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool; +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); + + +/* "oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer { @@ -2222,7 +2435,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer; -/* "oct_container.pxd":89 +/* "oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -2238,7 +2451,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer; -/* "oct_container.pxd":97 +/* "oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -2261,12 +2474,44 @@ */ struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation { - void (*process)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t); + int (*process)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_int64_t); }; static struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation; -/* "yt/geometry/particle_smooth.pyx":76 +/* "yt/utilities/lib/distance_queue.pxd":40 + * np.float64_t max_dist2) + * + * cdef class PriorityQueue: # <<<<<<<<<<<<<< + * cdef int maxn + * cdef int curn + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue { + void (*item_reset)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *); + int (*item_insert)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_PriorityQueue; + + +/* "yt/utilities/lib/distance_queue.pxd":47 + * cdef int item_insert(self, np.int64_t i, np.float64_t value) + * + * cdef class DistanceQueue(PriorityQueue): # <<<<<<<<<<<<<< + * cdef np.float64_t DW[3] + * cdef bint periodicity[3] + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue { + struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue __pyx_base; + void (*_setup)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *, __pyx_t_5numpy_float64_t *, int *); + void (*neighbor_eval)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); + void (*neighbor_reset)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_DistanceQueue; + + +/* "yt/geometry/particle_smooth.pyx":40 * opos[2] = ipos[2] * * cdef class ParticleSmoothOperation: # <<<<<<<<<<<<<< @@ -2275,19 +2520,17 @@ */ struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation { - void (*neighbor_process)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_float64_t **, __Pyx_memviewslice, __pyx_t_5numpy_int64_t **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t, int *, __Pyx_memviewslice, __Pyx_memviewslice); + void (*neighbor_process)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_float64_t **, __Pyx_memviewslice, __pyx_t_5numpy_int64_t **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t, int *, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *); int (*neighbor_search)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_float64_t *, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t **, int *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search *__pyx_optional_args); - void (*neighbor_process_particle)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_float64_t **, __Pyx_memviewslice, __pyx_t_5numpy_int64_t **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t, int *); - void (*neighbor_eval)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); - void (*neighbor_reset)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *); - void (*neighbor_find)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __Pyx_memviewslice); - void (*process)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **); + void (*neighbor_process_particle)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_float64_t **, __Pyx_memviewslice, __pyx_t_5numpy_int64_t **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t, int *, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *); + void (*neighbor_find)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *); + void (*process)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *); }; static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; -/* "yt/geometry/particle_smooth.pyx":657 - * self.process(offset, i, j, k, dim, opos, fields, index_fields) +/* "yt/geometry/particle_smooth.pyx":583 + * self.process(offset, i, j, k, dim, opos, fields, index_fields, dq) * * cdef class VolumeWeightedSmooth(ParticleSmoothOperation): # <<<<<<<<<<<<<< * # This smoothing function evaluates the field, *without* normalization, at @@ -2300,7 +2543,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_vtabptr_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth; -/* "yt/geometry/particle_smooth.pyx":734 +/* "yt/geometry/particle_smooth.pyx":660 * volume_weighted_smooth = VolumeWeightedSmooth * * cdef class NearestNeighborSmooth(ParticleSmoothOperation): # <<<<<<<<<<<<<< @@ -2314,7 +2557,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_vtabptr_2yt_8geometry_15particle_smooth_NearestNeighborSmooth; -/* "yt/geometry/particle_smooth.pyx":766 +/* "yt/geometry/particle_smooth.pyx":692 * nearest_smooth = NearestNeighborSmooth * * cdef class IDWInterpolationSmooth(ParticleSmoothOperation): # <<<<<<<<<<<<<< @@ -2328,7 +2571,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_vtabptr_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth; -/* "yt/geometry/particle_smooth.pyx":809 +/* "yt/geometry/particle_smooth.pyx":735 * idw_smooth = IDWInterpolationSmooth * * cdef class NthNeighborDistanceSmooth(ParticleSmoothOperation): # <<<<<<<<<<<<<< @@ -2342,7 +2585,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_vtabptr_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth; -/* "yt/geometry/particle_smooth.pyx":831 +/* "yt/geometry/particle_smooth.pyx":757 * nth_neighbor_smooth = NthNeighborDistanceSmooth * * cdef class SmoothedDensityEstimate(ParticleSmoothOperation): # <<<<<<<<<<<<<< @@ -2535,7 +2778,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* MemviewSliceInit.proto */ #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d @@ -2685,6 +2928,12 @@ /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { @@ -2751,8 +3000,19 @@ 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 *); +/* 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( @@ -2760,6 +3020,9 @@ 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) @@ -2818,15 +3081,31 @@ #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() + /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -2922,9 +3201,6 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - /* Print.proto */ static int __Pyx_Print(PyObject*, PyObject *, int); #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 @@ -2932,6 +3208,9 @@ static PyObject* __pyx_print_kwargs = 0; #endif +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + /* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -3047,10 +3326,10 @@ static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); /* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *); @@ -3083,17 +3362,16 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static int __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t **__pyx_v_nind, int *__pyx_v_nsize, __pyx_t_5numpy_int64_t __pyx_v_nneighbors, __pyx_t_5numpy_int64_t __pyx_v_domain_id, struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search *__pyx_optional_args); /* proto*/ -static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_ifields); /* proto*/ -static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_reset(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self); /* proto*/ -static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_eval(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_pn, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __pyx_t_5numpy_float64_t *__pyx_v_cpos); /* proto*/ -static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_find(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_nneighbors, __pyx_t_5numpy_int64_t *__pyx_v_nind, __Pyx_memviewslice __pyx_v_doffs, __Pyx_memviewslice __pyx_v_pcounts, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __Pyx_memviewslice __pyx_v_oct_left_edges, __Pyx_memviewslice __pyx_v_oct_dds); /* proto*/ -static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __Pyx_memviewslice __pyx_v_doffs, __pyx_t_5numpy_int64_t **__pyx_v_nind, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_pcounts, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t __pyx_v_domain_id, int *__pyx_v_nsize, __Pyx_memviewslice __pyx_v_oct_left_edges, __Pyx_memviewslice __pyx_v_oct_dds); /* proto*/ -static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process_particle(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __Pyx_memviewslice __pyx_v_doffs, __pyx_t_5numpy_int64_t **__pyx_v_nind, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_pcounts, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t __pyx_v_domain_id, int *__pyx_v_nsize); /* proto*/ -static void __pyx_f_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __pyx_t_5numpy_float64_t **__pyx_v_index_fields); /* proto*/ -static void __pyx_f_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields); /* proto*/ -static void __pyx_f_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields); /* proto*/ -static void __pyx_f_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields); /* proto*/ -static void __pyx_f_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields); /* proto*/ +static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_ifields, CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/ +static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_find(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_nneighbors, __pyx_t_5numpy_int64_t *__pyx_v_nind, __Pyx_memviewslice __pyx_v_doffs, __Pyx_memviewslice __pyx_v_pcounts, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __Pyx_memviewslice __pyx_v_oct_left_edges, __Pyx_memviewslice __pyx_v_oct_dds, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/ +static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __Pyx_memviewslice __pyx_v_doffs, __pyx_t_5numpy_int64_t **__pyx_v_nind, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_pcounts, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t __pyx_v_domain_id, int *__pyx_v_nsize, __Pyx_memviewslice __pyx_v_oct_left_edges, __Pyx_memviewslice __pyx_v_oct_dds, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/ +static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process_particle(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __Pyx_memviewslice __pyx_v_doffs, __pyx_t_5numpy_int64_t **__pyx_v_nind, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_pcounts, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t __pyx_v_domain_id, int *__pyx_v_nsize, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/ +static void __pyx_f_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/ +static void __pyx_f_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/ +static void __pyx_f_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/ +static void __pyx_f_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/ +static void __pyx_f_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq); /* proto*/ +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ @@ -3175,8 +3453,13 @@ static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0; + +/* Module declarations from 'yt.utilities.lib.allocation_container' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0; /* Module declarations from 'yt.geometry.oct_container' */ +static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0; @@ -3194,6 +3477,14 @@ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6(__pyx_t_5numpy_float64_t); /*proto*/ static CYTHON_INLINE __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(PyObject *); /*proto*/ +/* Module declarations from 'yt.utilities.lib.distance_queue' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14distance_queue_PriorityQueue = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue = 0; +static int (*__pyx_f_2yt_9utilities_3lib_14distance_queue_Neighbor_compare)(void *, void *); /*proto*/ +static __pyx_t_5numpy_float64_t (*__pyx_f_2yt_9utilities_3lib_14distance_queue_r2dist)(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, __pyx_t_5numpy_float64_t); /*proto*/ + +/* Module declarations from 'cpython.exc' */ + /* Module declarations from 'yt.geometry.particle_smooth' */ static PyTypeObject *__pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth = 0; @@ -3212,7 +3503,6 @@ static PyObject *indirect_contiguous = 0; static int __pyx_memoryview_thread_locks_used; static PyThread_type_lock __pyx_memoryview_thread_locks[8]; -static __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_15particle_smooth_r2dist(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, __pyx_t_5numpy_float64_t); /*proto*/ static void __pyx_f_2yt_8geometry_15particle_smooth_spherical_coord_setup(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); /*proto*/ static void __pyx_f_2yt_8geometry_15particle_smooth_cart_coord_setup(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); /*proto*/ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ @@ -3247,6 +3537,7 @@ 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_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_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 }; @@ -3254,15 +3545,15 @@ int __pyx_module_is_main_yt__geometry__particle_smooth = 0; /* Implementation of 'yt.geometry.particle_smooth' */ -static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_Ellipsis; -static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_C[] = "C"; @@ -3274,9 +3565,11 @@ static const char __pyx_k_pi[] = "pi"; static const char __pyx_k_cos[] = "cos"; 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_sin[] = "sin"; static const char __pyx_k_base[] = "base"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_file[] = "file"; static const char __pyx_k_gobj[] = "gobj"; static const char __pyx_k_main[] = "__main__"; @@ -3312,8 +3605,11 @@ 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_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_argsort[] = "argsort"; static const char __pyx_k_asarray[] = "asarray"; static const char __pyx_k_float64[] = "float64"; @@ -3327,11 +3623,13 @@ static const char __pyx_k_itemsize[] = "itemsize"; static const char __pyx_k_mdom_ind[] = "mdom_ind"; static const char __pyx_k_pdom_ind[] = "pdom_ind"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_cartesian[] = "cartesian"; static const char __pyx_k_domain_id[] = "domain_id"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_positions[] = "positions"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_spherical[] = "spherical"; static const char __pyx_k_wendland2[] = "wendland2"; static const char __pyx_k_wendland4[] = "wendland4"; @@ -3343,23 +3641,31 @@ static const char __pyx_k_zeros_like[] = "zeros_like"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_code_length[] = "code_length"; static const char __pyx_k_kernel_name[] = "kernel_name"; static const char __pyx_k_mesh_octree[] = "mesh_octree"; static const char __pyx_k_periodicity[] = "periodicity"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_index_fields[] = "index_fields"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_domain_offset[] = "domain_offset"; static const char __pyx_k_max_neighbors[] = "max_neighbors"; static const char __pyx_k_oct_positions[] = "oct_positions"; static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_density_smooth[] = "density_smooth"; static const char __pyx_k_nearest_smooth[] = "nearest_smooth"; static const char __pyx_k_SOMETHING_WRONG[] = "SOMETHING WRONG"; +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_particle_octree[] = "particle_octree"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_convert_to_units[] = "convert_to_units"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_nth_neighbor_smooth[] = "nth_neighbor_smooth"; @@ -3377,11 +3683,13 @@ 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_self_fp_self_pos_setup_self_sph[] = "self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling"; static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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"; @@ -3389,7 +3697,9 @@ 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_pos_setup_self_sph_kernel_c[] = "self.pos_setup,self.sph_kernel 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_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_n_s_ASCII; @@ -3403,6 +3713,7 @@ 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; @@ -3414,11 +3725,13 @@ static PyObject *__pyx_n_s_NotImplementedError; 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_n_s_RuntimeError; static PyObject *__pyx_kp_s_SOMETHING_WRONG; 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_allocate_buffer; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_argsort; @@ -3428,6 +3741,7 @@ static PyObject *__pyx_n_u_c; static PyObject *__pyx_n_s_cartesian; static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_code_length; static PyObject *__pyx_kp_s_contiguous_and_direct; static PyObject *__pyx_kp_s_contiguous_and_indirect; @@ -3435,6 +3749,7 @@ static PyObject *__pyx_n_s_cos; static PyObject *__pyx_n_s_cubic; static PyObject *__pyx_n_s_density_smooth; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_domain_id; static PyObject *__pyx_n_s_domain_offset; static PyObject *__pyx_n_s_dtype; @@ -3474,7 +3789,9 @@ static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; static PyObject *__pyx_n_s_ndim; static PyObject *__pyx_n_s_nearest_smooth; +static PyObject *__pyx_n_s_new; static PyObject *__pyx_n_s_nfields; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_np; static PyObject *__pyx_n_s_nth_neighbor_smooth; static PyObject *__pyx_n_s_numpy; @@ -3489,13 +3806,23 @@ static PyObject *__pyx_n_s_pdom_ind; static PyObject *__pyx_n_s_periodicity; static PyObject *__pyx_n_s_pi; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_positions; static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_quartic; static PyObject *__pyx_n_s_quintic; static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_kp_s_self_fp_self_pos_setup_self_sph; +static PyObject *__pyx_kp_s_self_pos_setup_self_sph_kernel_c; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_sin; static PyObject *__pyx_n_s_size; @@ -3506,6 +3833,7 @@ 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_uint8; @@ -3514,6 +3842,7 @@ static PyObject *__pyx_n_s_units; 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_volume_weighted_smooth; static PyObject *__pyx_n_s_wendland2; static PyObject *__pyx_n_s_wendland4; @@ -3529,16 +3858,22 @@ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_5nvals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_initialize(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_2finalize(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4vals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_initialize(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_2finalize(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4vals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_initialize(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2finalize(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_2p2___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self); /* proto */ @@ -3546,10 +3881,16 @@ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals___get__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_2__set__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4vals_4__del__(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_initialize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_2finalize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_initialize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_2finalize(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self, CYTHON_UNUSED 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 */ @@ -3559,8 +3900,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -3582,8 +3927,13 @@ 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_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_NearestNeighborSmooth(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3598,6 +3948,7 @@ static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; +static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; static __Pyx_memviewslice __pyx_k__2; static PyObject *__pyx_tuple_; @@ -3616,9 +3967,9 @@ static PyObject *__pyx_slice__21; static PyObject *__pyx_slice__23; static PyObject *__pyx_slice__25; -static PyObject *__pyx_slice__47; -static PyObject *__pyx_slice__48; -static PyObject *__pyx_slice__49; +static PyObject *__pyx_slice__63; +static PyObject *__pyx_slice__64; +static PyObject *__pyx_slice__65; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__14; @@ -3648,318 +3999,35 @@ static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__52; static PyObject *__pyx_tuple__53; static PyObject *__pyx_tuple__54; static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__74; +static PyObject *__pyx_codeobj__75; -/* "yt/geometry/particle_smooth.pyx":27 - * OctreeContainer, OctInfo - * - * cdef int Neighbor_compare(void *on1, void *on2) nogil: # <<<<<<<<<<<<<< - * cdef NeighborList *n1 - * cdef NeighborList *n2 - */ - -static int __pyx_f_2yt_8geometry_15particle_smooth_Neighbor_compare(void *__pyx_v_on1, void *__pyx_v_on2) { - struct __pyx_t_2yt_8geometry_15particle_smooth_NeighborList *__pyx_v_n1; - struct __pyx_t_2yt_8geometry_15particle_smooth_NeighborList *__pyx_v_n2; - int __pyx_r; - int __pyx_t_1; - - /* "yt/geometry/particle_smooth.pyx":30 - * cdef NeighborList *n1 - * cdef NeighborList *n2 - * n1 = on1 # <<<<<<<<<<<<<< - * n2 = on2 - * # Note that we set this up so that "greatest" evaluates to the *end* of the - */ - __pyx_v_n1 = ((struct __pyx_t_2yt_8geometry_15particle_smooth_NeighborList *)__pyx_v_on1); - - /* "yt/geometry/particle_smooth.pyx":31 - * cdef NeighborList *n2 - * n1 = on1 - * n2 = on2 # <<<<<<<<<<<<<< - * # Note that we set this up so that "greatest" evaluates to the *end* of the - * # list, so we can do standard radius comparisons. - */ - __pyx_v_n2 = ((struct __pyx_t_2yt_8geometry_15particle_smooth_NeighborList *)__pyx_v_on2); - - /* "yt/geometry/particle_smooth.pyx":34 - * # Note that we set this up so that "greatest" evaluates to the *end* of the - * # list, so we can do standard radius comparisons. - * if n1.r2 < n2.r2: # <<<<<<<<<<<<<< - * return -1 - * elif n1.r2 == n2.r2: - */ - __pyx_t_1 = ((__pyx_v_n1->r2 < __pyx_v_n2->r2) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/particle_smooth.pyx":35 - * # list, so we can do standard radius comparisons. - * if n1.r2 < n2.r2: - * return -1 # <<<<<<<<<<<<<< - * elif n1.r2 == n2.r2: - * return 0 - */ - __pyx_r = -1; - goto __pyx_L0; - - /* "yt/geometry/particle_smooth.pyx":34 - * # Note that we set this up so that "greatest" evaluates to the *end* of the - * # list, so we can do standard radius comparisons. - * if n1.r2 < n2.r2: # <<<<<<<<<<<<<< - * return -1 - * elif n1.r2 == n2.r2: - */ - } - - /* "yt/geometry/particle_smooth.pyx":36 - * if n1.r2 < n2.r2: - * return -1 - * elif n1.r2 == n2.r2: # <<<<<<<<<<<<<< - * return 0 - * else: - */ - __pyx_t_1 = ((__pyx_v_n1->r2 == __pyx_v_n2->r2) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/particle_smooth.pyx":37 - * return -1 - * elif n1.r2 == n2.r2: - * return 0 # <<<<<<<<<<<<<< - * else: - * return 1 - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "yt/geometry/particle_smooth.pyx":36 - * if n1.r2 < n2.r2: - * return -1 - * elif n1.r2 == n2.r2: # <<<<<<<<<<<<<< - * return 0 - * else: - */ - } - - /* "yt/geometry/particle_smooth.pyx":39 - * return 0 - * else: - * return 1 # <<<<<<<<<<<<<< - * - * @cython.cdivision(True) - */ - /*else*/ { - __pyx_r = 1; - goto __pyx_L0; - } - - /* "yt/geometry/particle_smooth.pyx":27 - * OctreeContainer, OctInfo - * - * cdef int Neighbor_compare(void *on1, void *on2) nogil: # <<<<<<<<<<<<<< - * cdef NeighborList *n1 - * cdef NeighborList *n2 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/geometry/particle_smooth.pyx":45 - * @cython.wraparound(False) - * @cython.initializedcheck(False) - * cdef np.float64_t r2dist(np.float64_t ppos[3], # <<<<<<<<<<<<<< - * np.float64_t cpos[3], - * np.float64_t DW[3], - */ - -static __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_15particle_smooth_r2dist(__pyx_t_5numpy_float64_t *__pyx_v_ppos, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t *__pyx_v_DW, int *__pyx_v_periodicity, __pyx_t_5numpy_float64_t __pyx_v_max_dist2) { - int __pyx_v_i; - __pyx_t_5numpy_float64_t __pyx_v_r2; - __pyx_t_5numpy_float64_t __pyx_v_DR; - __pyx_t_5numpy_float64_t __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - __Pyx_RefNannySetupContext("r2dist", 0); - - /* "yt/geometry/particle_smooth.pyx":52 - * cdef int i - * cdef np.float64_t r2, DR - * r2 = 0.0 # <<<<<<<<<<<<<< - * for i in range(3): - * DR = (ppos[i] - cpos[i]) - */ - __pyx_v_r2 = 0.0; - - /* "yt/geometry/particle_smooth.pyx":53 - * cdef np.float64_t r2, DR - * r2 = 0.0 - * for i in range(3): # <<<<<<<<<<<<<< - * DR = (ppos[i] - cpos[i]) - * if not periodicity[i]: - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "yt/geometry/particle_smooth.pyx":54 - * r2 = 0.0 - * for i in range(3): - * DR = (ppos[i] - cpos[i]) # <<<<<<<<<<<<<< - * if not periodicity[i]: - * pass - */ - __pyx_v_DR = ((__pyx_v_ppos[__pyx_v_i]) - (__pyx_v_cpos[__pyx_v_i])); - - /* "yt/geometry/particle_smooth.pyx":55 - * for i in range(3): - * DR = (ppos[i] - cpos[i]) - * if not periodicity[i]: # <<<<<<<<<<<<<< - * pass - * elif (DR > DW[i]/2.0): - */ - __pyx_t_2 = ((!((__pyx_v_periodicity[__pyx_v_i]) != 0)) != 0); - if (__pyx_t_2) { - goto __pyx_L5; - } - - /* "yt/geometry/particle_smooth.pyx":57 - * if not periodicity[i]: - * pass - * elif (DR > DW[i]/2.0): # <<<<<<<<<<<<<< - * DR -= DW[i] - * elif (DR < -DW[i]/2.0): - */ - __pyx_t_2 = ((__pyx_v_DR > ((__pyx_v_DW[__pyx_v_i]) / 2.0)) != 0); - if (__pyx_t_2) { - - /* "yt/geometry/particle_smooth.pyx":58 - * pass - * elif (DR > DW[i]/2.0): - * DR -= DW[i] # <<<<<<<<<<<<<< - * elif (DR < -DW[i]/2.0): - * DR += DW[i] - */ - __pyx_v_DR = (__pyx_v_DR - (__pyx_v_DW[__pyx_v_i])); - - /* "yt/geometry/particle_smooth.pyx":57 - * if not periodicity[i]: - * pass - * elif (DR > DW[i]/2.0): # <<<<<<<<<<<<<< - * DR -= DW[i] - * elif (DR < -DW[i]/2.0): - */ - goto __pyx_L5; - } - - /* "yt/geometry/particle_smooth.pyx":59 - * elif (DR > DW[i]/2.0): - * DR -= DW[i] - * elif (DR < -DW[i]/2.0): # <<<<<<<<<<<<<< - * DR += DW[i] - * r2 += DR * DR - */ - __pyx_t_2 = ((__pyx_v_DR < ((-(__pyx_v_DW[__pyx_v_i])) / 2.0)) != 0); - if (__pyx_t_2) { - - /* "yt/geometry/particle_smooth.pyx":60 - * DR -= DW[i] - * elif (DR < -DW[i]/2.0): - * DR += DW[i] # <<<<<<<<<<<<<< - * r2 += DR * DR - * if max_dist2 >= 0.0 and r2 > max_dist2: - */ - __pyx_v_DR = (__pyx_v_DR + (__pyx_v_DW[__pyx_v_i])); - - /* "yt/geometry/particle_smooth.pyx":59 - * elif (DR > DW[i]/2.0): - * DR -= DW[i] - * elif (DR < -DW[i]/2.0): # <<<<<<<<<<<<<< - * DR += DW[i] - * r2 += DR * DR - */ - } - __pyx_L5:; - - /* "yt/geometry/particle_smooth.pyx":61 - * elif (DR < -DW[i]/2.0): - * DR += DW[i] - * r2 += DR * DR # <<<<<<<<<<<<<< - * if max_dist2 >= 0.0 and r2 > max_dist2: - * return -1.0 - */ - __pyx_v_r2 = (__pyx_v_r2 + (__pyx_v_DR * __pyx_v_DR)); - - /* "yt/geometry/particle_smooth.pyx":62 - * DR += DW[i] - * r2 += DR * DR - * if max_dist2 >= 0.0 and r2 > max_dist2: # <<<<<<<<<<<<<< - * return -1.0 - * return r2 - */ - __pyx_t_3 = ((__pyx_v_max_dist2 >= 0.0) != 0); - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_3 = ((__pyx_v_r2 > __pyx_v_max_dist2) != 0); - __pyx_t_2 = __pyx_t_3; - __pyx_L7_bool_binop_done:; - if (__pyx_t_2) { - - /* "yt/geometry/particle_smooth.pyx":63 - * r2 += DR * DR - * if max_dist2 >= 0.0 and r2 > max_dist2: - * return -1.0 # <<<<<<<<<<<<<< - * return r2 +/* "yt/geometry/particle_smooth.pyx":30 * - */ - __pyx_r = -1.0; - goto __pyx_L0; - - /* "yt/geometry/particle_smooth.pyx":62 - * DR += DW[i] - * r2 += DR * DR - * if max_dist2 >= 0.0 and r2 > max_dist2: # <<<<<<<<<<<<<< - * return -1.0 - * return r2 - */ - } - } - - /* "yt/geometry/particle_smooth.pyx":64 - * if max_dist2 >= 0.0 and r2 > max_dist2: - * return -1.0 - * return r2 # <<<<<<<<<<<<<< - * - * cdef void spherical_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]): - */ - __pyx_r = __pyx_v_r2; - goto __pyx_L0; - - /* "yt/geometry/particle_smooth.pyx":45 - * @cython.wraparound(False) - * @cython.initializedcheck(False) - * cdef np.float64_t r2dist(np.float64_t ppos[3], # <<<<<<<<<<<<<< - * np.float64_t cpos[3], - * np.float64_t DW[3], - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/geometry/particle_smooth.pyx":66 - * return r2 * * cdef void spherical_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]): # <<<<<<<<<<<<<< * opos[0] = ipos[0] * sin(ipos[1]) * cos(ipos[2]) @@ -3970,7 +4038,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("spherical_coord_setup", 0); - /* "yt/geometry/particle_smooth.pyx":67 + /* "yt/geometry/particle_smooth.pyx":31 * * cdef void spherical_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]): * opos[0] = ipos[0] * sin(ipos[1]) * cos(ipos[2]) # <<<<<<<<<<<<<< @@ -3979,7 +4047,7 @@ */ (__pyx_v_opos[0]) = (((__pyx_v_ipos[0]) * sin((__pyx_v_ipos[1]))) * cos((__pyx_v_ipos[2]))); - /* "yt/geometry/particle_smooth.pyx":68 + /* "yt/geometry/particle_smooth.pyx":32 * cdef void spherical_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]): * opos[0] = ipos[0] * sin(ipos[1]) * cos(ipos[2]) * opos[1] = ipos[0] * sin(ipos[1]) * sin(ipos[2]) # <<<<<<<<<<<<<< @@ -3988,7 +4056,7 @@ */ (__pyx_v_opos[1]) = (((__pyx_v_ipos[0]) * sin((__pyx_v_ipos[1]))) * sin((__pyx_v_ipos[2]))); - /* "yt/geometry/particle_smooth.pyx":69 + /* "yt/geometry/particle_smooth.pyx":33 * opos[0] = ipos[0] * sin(ipos[1]) * cos(ipos[2]) * opos[1] = ipos[0] * sin(ipos[1]) * sin(ipos[2]) * opos[2] = ipos[0] * cos(ipos[1]) # <<<<<<<<<<<<<< @@ -3997,8 +4065,8 @@ */ (__pyx_v_opos[2]) = ((__pyx_v_ipos[0]) * cos((__pyx_v_ipos[1]))); - /* "yt/geometry/particle_smooth.pyx":66 - * return r2 + /* "yt/geometry/particle_smooth.pyx":30 + * * * cdef void spherical_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]): # <<<<<<<<<<<<<< * opos[0] = ipos[0] * sin(ipos[1]) * cos(ipos[2]) @@ -4009,7 +4077,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_smooth.pyx":71 +/* "yt/geometry/particle_smooth.pyx":35 * opos[2] = ipos[0] * cos(ipos[1]) * * cdef void cart_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]): # <<<<<<<<<<<<<< @@ -4021,7 +4089,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cart_coord_setup", 0); - /* "yt/geometry/particle_smooth.pyx":72 + /* "yt/geometry/particle_smooth.pyx":36 * * cdef void cart_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]): * opos[0] = ipos[0] # <<<<<<<<<<<<<< @@ -4030,7 +4098,7 @@ */ (__pyx_v_opos[0]) = (__pyx_v_ipos[0]); - /* "yt/geometry/particle_smooth.pyx":73 + /* "yt/geometry/particle_smooth.pyx":37 * cdef void cart_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]): * opos[0] = ipos[0] * opos[1] = ipos[1] # <<<<<<<<<<<<<< @@ -4039,7 +4107,7 @@ */ (__pyx_v_opos[1]) = (__pyx_v_ipos[1]); - /* "yt/geometry/particle_smooth.pyx":74 + /* "yt/geometry/particle_smooth.pyx":38 * opos[0] = ipos[0] * opos[1] = ipos[1] * opos[2] = ipos[2] # <<<<<<<<<<<<<< @@ -4048,7 +4116,7 @@ */ (__pyx_v_opos[2]) = (__pyx_v_ipos[2]); - /* "yt/geometry/particle_smooth.pyx":71 + /* "yt/geometry/particle_smooth.pyx":35 * opos[2] = ipos[0] * cos(ipos[1]) * * cdef void cart_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]): # <<<<<<<<<<<<<< @@ -4060,7 +4128,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_smooth.pyx":77 +/* "yt/geometry/particle_smooth.pyx":41 * * cdef class ParticleSmoothOperation: * def __init__(self, nvals, nfields, max_neighbors, kernel_name): # <<<<<<<<<<<<<< @@ -4086,9 +4154,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -4097,24 +4169,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nvals)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nfields)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 77, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 41, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_neighbors)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 77, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 41, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel_name)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 77, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 41, __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, 77, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 41, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -4131,7 +4206,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 77, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 41, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4150,7 +4225,7 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/particle_smooth.pyx":80 + /* "yt/geometry/particle_smooth.pyx":44 * # This is the set of cells, in grids, blocks or octs, we are handling. * cdef int i * self.nvals = nvals # <<<<<<<<<<<<<< @@ -4163,55 +4238,37 @@ __Pyx_DECREF(__pyx_v_self->nvals); __pyx_v_self->nvals = __pyx_v_nvals; - /* "yt/geometry/particle_smooth.pyx":81 + /* "yt/geometry/particle_smooth.pyx":45 * cdef int i * self.nvals = nvals * self.nfields = nfields # <<<<<<<<<<<<<< * self.maxn = max_neighbors - * + * self.sph_kernel = get_kernel_func(kernel_name) */ - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_nfields); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_nfields); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) __pyx_v_self->nfields = __pyx_t_1; - /* "yt/geometry/particle_smooth.pyx":82 + /* "yt/geometry/particle_smooth.pyx":46 * self.nvals = nvals * self.nfields = nfields * self.maxn = max_neighbors # <<<<<<<<<<<<<< + * self.sph_kernel = get_kernel_func(kernel_name) * - * self.neighbors = malloc( */ - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_max_neighbors); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_max_neighbors); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) __pyx_v_self->maxn = __pyx_t_1; - /* "yt/geometry/particle_smooth.pyx":84 + /* "yt/geometry/particle_smooth.pyx":47 + * self.nfields = nfields * self.maxn = max_neighbors - * - * self.neighbors = malloc( # <<<<<<<<<<<<<< - * sizeof(NeighborList) * self.maxn) - * self.neighbor_reset() - */ - __pyx_v_self->neighbors = ((struct __pyx_t_2yt_8geometry_15particle_smooth_NeighborList *)malloc(((sizeof(struct __pyx_t_2yt_8geometry_15particle_smooth_NeighborList)) * __pyx_v_self->maxn))); - - /* "yt/geometry/particle_smooth.pyx":86 - * self.neighbors = malloc( - * sizeof(NeighborList) * self.maxn) - * self.neighbor_reset() # <<<<<<<<<<<<<< - * self.sph_kernel = get_kernel_func(kernel_name) - * - */ - ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_reset(__pyx_v_self); - - /* "yt/geometry/particle_smooth.pyx":87 - * sizeof(NeighborList) * self.maxn) - * self.neighbor_reset() * self.sph_kernel = get_kernel_func(kernel_name) # <<<<<<<<<<<<<< * * def initialize(self, *args): */ - if (!(likely(PyString_CheckExact(__pyx_v_kernel_name))||((__pyx_v_kernel_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_kernel_name)->tp_name), 0))) __PYX_ERR(0, 87, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_v_kernel_name))||((__pyx_v_kernel_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_kernel_name)->tp_name), 0))) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_v_self->sph_kernel = __pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(((PyObject*)__pyx_v_kernel_name)); - /* "yt/geometry/particle_smooth.pyx":77 + /* "yt/geometry/particle_smooth.pyx":41 * * cdef class ParticleSmoothOperation: * def __init__(self, nvals, nfields, max_neighbors, kernel_name): # <<<<<<<<<<<<<< @@ -4230,7 +4287,7 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":89 +/* "yt/geometry/particle_smooth.pyx":49 * self.sph_kernel = get_kernel_func(kernel_name) * * def initialize(self, *args): # <<<<<<<<<<<<<< @@ -4261,7 +4318,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_smooth.pyx":90 + /* "yt/geometry/particle_smooth.pyx":50 * * def initialize(self, *args): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -4269,9 +4326,9 @@ * def finalize(self, *args): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 90, __pyx_L1_error) + __PYX_ERR(0, 50, __pyx_L1_error) - /* "yt/geometry/particle_smooth.pyx":89 + /* "yt/geometry/particle_smooth.pyx":49 * self.sph_kernel = get_kernel_func(kernel_name) * * def initialize(self, *args): # <<<<<<<<<<<<<< @@ -4288,7 +4345,7 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":92 +/* "yt/geometry/particle_smooth.pyx":52 * raise NotImplementedError * * def finalize(self, *args): # <<<<<<<<<<<<<< @@ -4319,7 +4376,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_smooth.pyx":93 + /* "yt/geometry/particle_smooth.pyx":53 * * def finalize(self, *args): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -4327,9 +4384,9 @@ * @cython.cdivision(True) */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 93, __pyx_L1_error) + __PYX_ERR(0, 53, __pyx_L1_error) - /* "yt/geometry/particle_smooth.pyx":92 + /* "yt/geometry/particle_smooth.pyx":52 * raise NotImplementedError * * def finalize(self, *args): # <<<<<<<<<<<<<< @@ -4346,7 +4403,7 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":99 +/* "yt/geometry/particle_smooth.pyx":59 * @cython.wraparound(False) * @cython.initializedcheck(False) * def process_octree(self, OctreeContainer mesh_octree, # <<<<<<<<<<<<<< @@ -4376,7 +4433,7 @@ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mesh_octree,&__pyx_n_s_mdom_ind,&__pyx_n_s_positions,&__pyx_n_s_oct_positions,&__pyx_n_s_fields,&__pyx_n_s_domain_id,&__pyx_n_s_domain_offset,&__pyx_n_s_periodicity,&__pyx_n_s_index_fields,&__pyx_n_s_particle_octree,&__pyx_n_s_pdom_ind,&__pyx_n_s_geometry,0}; PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0}; - /* "yt/geometry/particle_smooth.pyx":103 + /* "yt/geometry/particle_smooth.pyx":63 * np.float64_t[:,:] positions, * np.float64_t[:,:] oct_positions, * fields = None, int domain_id = -1, # <<<<<<<<<<<<<< @@ -4385,7 +4442,7 @@ */ values[4] = ((PyObject *)Py_None); - /* "yt/geometry/particle_smooth.pyx":105 + /* "yt/geometry/particle_smooth.pyx":65 * fields = None, int domain_id = -1, * int domain_offset = 0, * periodicity = (True, True, True), # <<<<<<<<<<<<<< @@ -4394,7 +4451,7 @@ */ values[7] = ((PyObject *)__pyx_tuple_); - /* "yt/geometry/particle_smooth.pyx":106 + /* "yt/geometry/particle_smooth.pyx":66 * int domain_offset = 0, * periodicity = (True, True, True), * index_fields = None, # <<<<<<<<<<<<<< @@ -4403,7 +4460,7 @@ */ values[8] = ((PyObject *)Py_None); - /* "yt/geometry/particle_smooth.pyx":107 + /* "yt/geometry/particle_smooth.pyx":67 * periodicity = (True, True, True), * index_fields = None, * OctreeContainer particle_octree = None, # <<<<<<<<<<<<<< @@ -4417,17 +4474,29 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -4436,56 +4505,67 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mesh_octree)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mdom_ind)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("process_octree", 0, 4, 12, 1); __PYX_ERR(0, 99, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("process_octree", 0, 4, 12, 1); __PYX_ERR(0, 59, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("process_octree", 0, 4, 12, 2); __PYX_ERR(0, 99, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("process_octree", 0, 4, 12, 2); __PYX_ERR(0, 59, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oct_positions)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("process_octree", 0, 4, 12, 3); __PYX_ERR(0, 99, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("process_octree", 0, 4, 12, 3); __PYX_ERR(0, 59, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields); if (value) { values[4] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); if (value) { values[5] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_offset); if (value) { values[6] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periodicity); if (value) { values[7] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index_fields); if (value) { values[8] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_particle_octree); if (value) { values[9] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdom_ind); if (value) { values[10] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_geometry); @@ -4493,18 +4573,26 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_octree") < 0)) __PYX_ERR(0, 99, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_octree") < 0)) __PYX_ERR(0, 59, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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); @@ -4514,17 +4602,17 @@ } } __pyx_v_mesh_octree = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)values[0]); - __pyx_v_mdom_ind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_mdom_ind.memview)) __PYX_ERR(0, 100, __pyx_L3_error) - __pyx_v_positions = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_positions.memview)) __PYX_ERR(0, 101, __pyx_L3_error) - __pyx_v_oct_positions = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_oct_positions.memview)) __PYX_ERR(0, 102, __pyx_L3_error) + __pyx_v_mdom_ind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_mdom_ind.memview)) __PYX_ERR(0, 60, __pyx_L3_error) + __pyx_v_positions = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_positions.memview)) __PYX_ERR(0, 61, __pyx_L3_error) + __pyx_v_oct_positions = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_oct_positions.memview)) __PYX_ERR(0, 62, __pyx_L3_error) __pyx_v_fields = values[4]; if (values[5]) { - __pyx_v_domain_id = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error) + __pyx_v_domain_id = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) } else { __pyx_v_domain_id = ((int)-1); } if (values[6]) { - __pyx_v_domain_offset = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_domain_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) + __pyx_v_domain_offset = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_domain_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L3_error) } else { __pyx_v_domain_offset = ((int)0); } @@ -4532,7 +4620,7 @@ __pyx_v_index_fields = values[8]; __pyx_v_particle_octree = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)values[9]); if (values[10]) { - __pyx_v_pdom_ind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[10]); if (unlikely(!__pyx_v_pdom_ind.memview)) __PYX_ERR(0, 108, __pyx_L3_error) + __pyx_v_pdom_ind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[10]); if (unlikely(!__pyx_v_pdom_ind.memview)) __PYX_ERR(0, 68, __pyx_L3_error) } else { __pyx_v_pdom_ind = __pyx_k__2; __PYX_INC_MEMVIEW(&__pyx_v_pdom_ind, 1); @@ -4541,17 +4629,17 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("process_octree", 0, 4, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 99, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("process_octree", 0, 4, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 59, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.process_octree", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mesh_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "mesh_octree", 0))) __PYX_ERR(0, 99, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_particle_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "particle_octree", 0))) __PYX_ERR(0, 107, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mesh_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "mesh_octree", 0))) __PYX_ERR(0, 59, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_particle_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "particle_octree", 0))) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_6process_octree(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self), __pyx_v_mesh_octree, __pyx_v_mdom_ind, __pyx_v_positions, __pyx_v_oct_positions, __pyx_v_fields, __pyx_v_domain_id, __pyx_v_domain_offset, __pyx_v_periodicity, __pyx_v_index_fields, __pyx_v_particle_octree, __pyx_v_pdom_ind, __pyx_v_geometry); - /* "yt/geometry/particle_smooth.pyx":99 + /* "yt/geometry/particle_smooth.pyx":59 * @cython.wraparound(False) * @cython.initializedcheck(False) * def process_octree(self, OctreeContainer mesh_octree, # <<<<<<<<<<<<<< @@ -4600,6 +4688,7 @@ __pyx_t_5numpy_float64_t __pyx_v_factor; PyArrayObject *__pyx_v_visited = 0; int __pyx_v_nproc; + struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dist_queue = 0; __Pyx_LocalBuf_ND __pyx_pybuffernd_iarr; __Pyx_Buffer __pyx_pybuffer_iarr; __Pyx_LocalBuf_ND __pyx_pybuffernd_tarr; @@ -4671,7 +4760,7 @@ __pyx_pybuffernd_visited.data = NULL; __pyx_pybuffernd_visited.rcbuffer = &__pyx_pybuffer_visited; - /* "yt/geometry/particle_smooth.pyx":134 + /* "yt/geometry/particle_smooth.pyx":94 * # mechanism of an expandable array for holding pointers to Octs, so * # that we can deal with >27 neighbors. * if particle_octree is None: # <<<<<<<<<<<<<< @@ -4682,7 +4771,7 @@ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "yt/geometry/particle_smooth.pyx":135 + /* "yt/geometry/particle_smooth.pyx":95 * # that we can deal with >27 neighbors. * if particle_octree is None: * particle_octree = mesh_octree # <<<<<<<<<<<<<< @@ -4692,7 +4781,7 @@ __Pyx_INCREF(((PyObject *)__pyx_v_mesh_octree)); __Pyx_DECREF_SET(__pyx_v_particle_octree, __pyx_v_mesh_octree); - /* "yt/geometry/particle_smooth.pyx":136 + /* "yt/geometry/particle_smooth.pyx":96 * if particle_octree is None: * particle_octree = mesh_octree * pdom_ind = mdom_ind # <<<<<<<<<<<<<< @@ -4703,7 +4792,7 @@ __PYX_INC_MEMVIEW(&__pyx_v_mdom_ind, 0); __pyx_v_pdom_ind = __pyx_v_mdom_ind; - /* "yt/geometry/particle_smooth.pyx":134 + /* "yt/geometry/particle_smooth.pyx":94 * # mechanism of an expandable array for holding pointers to Octs, so * # that we can deal with >27 neighbors. * if particle_octree is None: # <<<<<<<<<<<<<< @@ -4712,7 +4801,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":145 + /* "yt/geometry/particle_smooth.pyx":105 * cdef np.float64_t dds[3] * cdef np.float64_t **octree_field_pointers * cdef int nsize = 0 # <<<<<<<<<<<<<< @@ -4721,7 +4810,7 @@ */ __pyx_v_nsize = 0; - /* "yt/geometry/particle_smooth.pyx":146 + /* "yt/geometry/particle_smooth.pyx":106 * cdef np.float64_t **octree_field_pointers * cdef int nsize = 0 * cdef np.int64_t *nind = NULL # <<<<<<<<<<<<<< @@ -4730,17 +4819,17 @@ */ __pyx_v_nind = NULL; - /* "yt/geometry/particle_smooth.pyx":158 + /* "yt/geometry/particle_smooth.pyx":118 * cdef np.float64_t[:,:] oct_left_edges, oct_dds * cdef OctInfo oinfo * if geometry == "cartesian": # <<<<<<<<<<<<<< * self.pos_setup = cart_coord_setup * cart_positions = positions */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_geometry, __pyx_n_s_cartesian, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_geometry, __pyx_n_s_cartesian, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 118, __pyx_L1_error) if (__pyx_t_2) { - /* "yt/geometry/particle_smooth.pyx":159 + /* "yt/geometry/particle_smooth.pyx":119 * cdef OctInfo oinfo * if geometry == "cartesian": * self.pos_setup = cart_coord_setup # <<<<<<<<<<<<<< @@ -4749,7 +4838,7 @@ */ __pyx_v_self->pos_setup = __pyx_f_2yt_8geometry_15particle_smooth_cart_coord_setup; - /* "yt/geometry/particle_smooth.pyx":160 + /* "yt/geometry/particle_smooth.pyx":120 * if geometry == "cartesian": * self.pos_setup = cart_coord_setup * cart_positions = positions # <<<<<<<<<<<<<< @@ -4759,7 +4848,7 @@ __PYX_INC_MEMVIEW(&__pyx_v_positions, 0); __pyx_v_cart_positions = __pyx_v_positions; - /* "yt/geometry/particle_smooth.pyx":158 + /* "yt/geometry/particle_smooth.pyx":118 * cdef np.float64_t[:,:] oct_left_edges, oct_dds * cdef OctInfo oinfo * if geometry == "cartesian": # <<<<<<<<<<<<<< @@ -4769,17 +4858,17 @@ goto __pyx_L4; } - /* "yt/geometry/particle_smooth.pyx":161 + /* "yt/geometry/particle_smooth.pyx":121 * self.pos_setup = cart_coord_setup * cart_positions = positions * elif geometry == "spherical": # <<<<<<<<<<<<<< * self.pos_setup = spherical_coord_setup * cart_positions = np.empty((positions.shape[0], 3), dtype="float64") */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_geometry, __pyx_n_s_spherical, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_geometry, __pyx_n_s_spherical, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 121, __pyx_L1_error) if (__pyx_t_2) { - /* "yt/geometry/particle_smooth.pyx":162 + /* "yt/geometry/particle_smooth.pyx":122 * cart_positions = positions * elif geometry == "spherical": * self.pos_setup = spherical_coord_setup # <<<<<<<<<<<<<< @@ -4788,21 +4877,21 @@ */ __pyx_v_self->pos_setup = __pyx_f_2yt_8geometry_15particle_smooth_spherical_coord_setup; - /* "yt/geometry/particle_smooth.pyx":163 + /* "yt/geometry/particle_smooth.pyx":123 * elif geometry == "spherical": * self.pos_setup = spherical_coord_setup * cart_positions = np.empty((positions.shape[0], 3), dtype="float64") # <<<<<<<<<<<<<< * * cart_positions[:,0] = positions[:,0] * \ */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_positions.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_positions.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); @@ -4810,27 +4899,27 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __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 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 163, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_t_6); - if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 163, __pyx_L1_error) + if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_cart_positions = __pyx_t_7; __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL; - /* "yt/geometry/particle_smooth.pyx":165 + /* "yt/geometry/particle_smooth.pyx":125 * cart_positions = np.empty((positions.shape[0], 3), dtype="float64") * * cart_positions[:,0] = positions[:,0] * \ # <<<<<<<<<<<<<< @@ -4852,27 +4941,27 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 165, __pyx_L1_error) + __PYX_ERR(0, 125, __pyx_L1_error) } __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_8, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error) +__pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_8, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "yt/geometry/particle_smooth.pyx":166 + /* "yt/geometry/particle_smooth.pyx":126 * * cart_positions[:,0] = positions[:,0] * \ * np.sin(positions[:,1]) * \ # <<<<<<<<<<<<<< * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8.data = __pyx_v_positions.data; @@ -4890,12 +4979,12 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 166, __pyx_L1_error) + __PYX_ERR(0, 126, __pyx_L1_error) } __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_3 = __pyx_memoryview_fromslice(__pyx_t_8, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) +__pyx_t_3 = __pyx_memoryview_fromslice(__pyx_t_8, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); __pyx_t_8.memview = NULL; @@ -4911,14 +5000,14 @@ } } if (!__pyx_t_9) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __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_4)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_3}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __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, 126, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4927,48 +5016,48 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_3}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __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, 126, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/particle_smooth.pyx":165 + /* "yt/geometry/particle_smooth.pyx":125 * cart_positions = np.empty((positions.shape[0], 3), dtype="float64") * * cart_positions[:,0] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) */ - __pyx_t_4 = PyNumber_Multiply(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/particle_smooth.pyx":167 + /* "yt/geometry/particle_smooth.pyx":127 * cart_positions[:,0] = positions[:,0] * \ * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) # <<<<<<<<<<<<<< * cart_positions[:,1] = positions[:,0] * \ * np.sin(positions[:,1]) * \ */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_cos); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_cos); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8.data = __pyx_v_positions.data; @@ -4986,12 +5075,12 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 167, __pyx_L1_error) + __PYX_ERR(0, 127, __pyx_L1_error) } __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_8, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error) +__pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_8, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); __pyx_t_8.memview = NULL; @@ -5007,14 +5096,14 @@ } } if (!__pyx_t_3) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -5023,41 +5112,41 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "yt/geometry/particle_smooth.pyx":166 + /* "yt/geometry/particle_smooth.pyx":126 * * cart_positions[:,0] = positions[:,0] * \ * np.sin(positions[:,1]) * \ # <<<<<<<<<<<<<< * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ */ - __pyx_t_10 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_10 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "yt/geometry/particle_smooth.pyx":165 + /* "yt/geometry/particle_smooth.pyx":125 * cart_positions = np.empty((positions.shape[0], 3), dtype="float64") * * cart_positions[:,0] = positions[:,0] * \ # <<<<<<<<<<<<<< @@ -5079,7 +5168,7 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 165, __pyx_L1_error) + __PYX_ERR(0, 125, __pyx_L1_error) } __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -5102,7 +5191,7 @@ __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "yt/geometry/particle_smooth.pyx":168 + /* "yt/geometry/particle_smooth.pyx":128 * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ # <<<<<<<<<<<<<< @@ -5124,27 +5213,27 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 168, __pyx_L1_error) + __PYX_ERR(0, 128, __pyx_L1_error) } __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_12, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 168, __pyx_L1_error) +__pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_12, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); __pyx_t_12.memview = NULL; __pyx_t_12.data = NULL; - /* "yt/geometry/particle_smooth.pyx":169 + /* "yt/geometry/particle_smooth.pyx":129 * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ * np.sin(positions[:,1]) * \ # <<<<<<<<<<<<<< * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12.data = __pyx_v_positions.data; @@ -5162,12 +5251,12 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 169, __pyx_L1_error) + __PYX_ERR(0, 129, __pyx_L1_error) } __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_12, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error) +__pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_12, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); __pyx_t_12.memview = NULL; @@ -5183,14 +5272,14 @@ } } if (!__pyx_t_6) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __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_9)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __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; @@ -5199,48 +5288,48 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __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_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "yt/geometry/particle_smooth.pyx":168 + /* "yt/geometry/particle_smooth.pyx":128 * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) */ - __pyx_t_9 = PyNumber_Multiply(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/particle_smooth.pyx":170 + /* "yt/geometry/particle_smooth.pyx":130 * cart_positions[:,1] = positions[:,0] * \ * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) # <<<<<<<<<<<<<< * cart_positions[:,2] = positions[:,0] * \ * np.cos(positions[:,1]) */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_12.data = __pyx_v_positions.data; @@ -5258,12 +5347,12 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 170, __pyx_L1_error) + __PYX_ERR(0, 130, __pyx_L1_error) } __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_12, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 170, __pyx_L1_error) +__pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_12, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); __pyx_t_12.memview = NULL; @@ -5279,14 +5368,14 @@ } } if (!__pyx_t_4) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_10}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -5295,41 +5384,41 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_10}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __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_10); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/particle_smooth.pyx":169 + /* "yt/geometry/particle_smooth.pyx":129 * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ * np.sin(positions[:,1]) * \ # <<<<<<<<<<<<<< * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ */ - __pyx_t_3 = PyNumber_Multiply(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/particle_smooth.pyx":168 + /* "yt/geometry/particle_smooth.pyx":128 * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ # <<<<<<<<<<<<<< @@ -5351,7 +5440,7 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 168, __pyx_L1_error) + __PYX_ERR(0, 128, __pyx_L1_error) } __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -5374,7 +5463,7 @@ __pyx_t_12.memview = NULL; __pyx_t_12.data = NULL; - /* "yt/geometry/particle_smooth.pyx":171 + /* "yt/geometry/particle_smooth.pyx":131 * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ # <<<<<<<<<<<<<< @@ -5396,27 +5485,27 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 171, __pyx_L1_error) + __PYX_ERR(0, 131, __pyx_L1_error) } __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_3 = __pyx_memoryview_fromslice(__pyx_t_13, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) +__pyx_t_3 = __pyx_memoryview_fromslice(__pyx_t_13, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1); __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; - /* "yt/geometry/particle_smooth.pyx":172 + /* "yt/geometry/particle_smooth.pyx":132 * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ * np.cos(positions[:,1]) # <<<<<<<<<<<<<< * periodicity = (False, False, False) * else: */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_cos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_cos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13.data = __pyx_v_positions.data; @@ -5434,12 +5523,12 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 172, __pyx_L1_error) + __PYX_ERR(0, 132, __pyx_L1_error) } __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_9 = __pyx_memoryview_fromslice(__pyx_t_13, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) +__pyx_t_9 = __pyx_memoryview_fromslice(__pyx_t_13, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1); __pyx_t_13.memview = NULL; @@ -5455,14 +5544,14 @@ } } if (!__pyx_t_10) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_9}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -5471,38 +5560,38 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_9}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "yt/geometry/particle_smooth.pyx":171 + /* "yt/geometry/particle_smooth.pyx":131 * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.cos(positions[:,1]) * periodicity = (False, False, False) */ - __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_13.data = __pyx_v_cart_positions.data; __pyx_t_13.memview = __pyx_v_cart_positions.memview; @@ -5519,7 +5608,7 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 171, __pyx_L1_error) + __PYX_ERR(0, 131, __pyx_L1_error) } __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -5542,7 +5631,7 @@ __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; - /* "yt/geometry/particle_smooth.pyx":173 + /* "yt/geometry/particle_smooth.pyx":133 * cart_positions[:,2] = positions[:,0] * \ * np.cos(positions[:,1]) * periodicity = (False, False, False) # <<<<<<<<<<<<<< @@ -5552,7 +5641,7 @@ __Pyx_INCREF(__pyx_tuple__3); __Pyx_DECREF_SET(__pyx_v_periodicity, __pyx_tuple__3); - /* "yt/geometry/particle_smooth.pyx":161 + /* "yt/geometry/particle_smooth.pyx":121 * self.pos_setup = cart_coord_setup * cart_positions = positions * elif geometry == "spherical": # <<<<<<<<<<<<<< @@ -5562,7 +5651,7 @@ goto __pyx_L4; } - /* "yt/geometry/particle_smooth.pyx":175 + /* "yt/geometry/particle_smooth.pyx":135 * periodicity = (False, False, False) * else: * raise NotImplementedError # <<<<<<<<<<<<<< @@ -5571,11 +5660,11 @@ */ /*else*/ { __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 175, __pyx_L1_error) + __PYX_ERR(0, 135, __pyx_L1_error) } __pyx_L4:; - /* "yt/geometry/particle_smooth.pyx":176 + /* "yt/geometry/particle_smooth.pyx":136 * else: * raise NotImplementedError * dims[0] = dims[1] = dims[2] = (1 << mesh_octree.oref) # <<<<<<<<<<<<<< @@ -5587,7 +5676,7 @@ (__pyx_v_dims[1]) = __pyx_t_14; (__pyx_v_dims[2]) = __pyx_t_14; - /* "yt/geometry/particle_smooth.pyx":177 + /* "yt/geometry/particle_smooth.pyx":137 * raise NotImplementedError * dims[0] = dims[1] = dims[2] = (1 << mesh_octree.oref) * cdef int nz = dims[0] * dims[1] * dims[2] # <<<<<<<<<<<<<< @@ -5596,7 +5685,7 @@ */ __pyx_v_nz = (((__pyx_v_dims[0]) * (__pyx_v_dims[1])) * (__pyx_v_dims[2])); - /* "yt/geometry/particle_smooth.pyx":178 + /* "yt/geometry/particle_smooth.pyx":138 * dims[0] = dims[1] = dims[2] = (1 << mesh_octree.oref) * cdef int nz = dims[0] * dims[1] * dims[2] * numpart = positions.shape[0] # <<<<<<<<<<<<<< @@ -5605,19 +5694,19 @@ */ __pyx_v_numpart = (__pyx_v_positions.shape[0]); - /* "yt/geometry/particle_smooth.pyx":180 + /* "yt/geometry/particle_smooth.pyx":140 * numpart = positions.shape[0] * # pcount is the number of particles per oct. * pcount = np.zeros_like(pdom_ind) # <<<<<<<<<<<<<< * oct_left_edges = np.zeros((pdom_ind.shape[0], 3), dtype='float64') * oct_dds = np.zeros_like(oct_left_edges) */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_pdom_ind, 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, 180, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_pdom_ind, 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, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -5630,14 +5719,14 @@ } } if (!__pyx_t_4) { - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -5646,47 +5735,47 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_6); __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, 180, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_6); - if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 180, __pyx_L1_error) + if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_pcount = __pyx_t_15; __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL; - /* "yt/geometry/particle_smooth.pyx":181 + /* "yt/geometry/particle_smooth.pyx":141 * # pcount is the number of particles per oct. * pcount = np.zeros_like(pdom_ind) * oct_left_edges = np.zeros((pdom_ind.shape[0], 3), dtype='float64') # <<<<<<<<<<<<<< * oct_dds = np.zeros_like(oct_left_edges) * # doff is the offset to a given oct in the sorted particles. */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_pdom_ind.shape[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_pdom_ind.shape[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); @@ -5694,39 +5783,39 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_3); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 181, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_t_5); - if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 181, __pyx_L1_error) + if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_oct_left_edges = __pyx_t_7; __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL; - /* "yt/geometry/particle_smooth.pyx":182 + /* "yt/geometry/particle_smooth.pyx":142 * pcount = np.zeros_like(pdom_ind) * oct_left_edges = np.zeros((pdom_ind.shape[0], 3), dtype='float64') * oct_dds = np.zeros_like(oct_left_edges) # <<<<<<<<<<<<<< * # doff is the offset to a given oct in the sorted particles. * doff = np.zeros_like(pdom_ind) - 1 */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_oct_left_edges, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_oct_left_edges, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -5739,14 +5828,14 @@ } } if (!__pyx_t_3) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_9}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -5755,45 +5844,45 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_9}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __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_9); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_t_5); - if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 182, __pyx_L1_error) + if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_oct_dds = __pyx_t_7; __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL; - /* "yt/geometry/particle_smooth.pyx":184 + /* "yt/geometry/particle_smooth.pyx":144 * oct_dds = np.zeros_like(oct_left_edges) * # doff is the offset to a given oct in the sorted particles. * doff = np.zeros_like(pdom_ind) - 1 # <<<<<<<<<<<<<< * doff_m = np.zeros((mdom_ind.shape[0], 2), dtype="int64") * moff_p = particle_octree.get_domain_offset(domain_id + domain_offset) */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_pdom_ind, 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_6)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_pdom_ind, 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_6)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -5806,14 +5895,14 @@ } } if (!__pyx_t_9) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __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, 144, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -5822,50 +5911,50 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __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, 144, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_4); - if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 184, __pyx_L1_error) + if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_doff = __pyx_t_15; __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL; - /* "yt/geometry/particle_smooth.pyx":185 + /* "yt/geometry/particle_smooth.pyx":145 * # doff is the offset to a given oct in the sorted particles. * doff = np.zeros_like(pdom_ind) - 1 * doff_m = np.zeros((mdom_ind.shape[0], 2), dtype="int64") # <<<<<<<<<<<<<< * moff_p = particle_octree.get_domain_offset(domain_id + domain_offset) * moff_m = mesh_octree.get_domain_offset(domain_id + domain_offset) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __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, 185, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_mdom_ind.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_mdom_ind.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); @@ -5873,27 +5962,27 @@ __Pyx_GIVEREF(__pyx_int_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_2); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __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 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 185, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_t_6); - if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 185, __pyx_L1_error) + if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_doff_m = __pyx_t_16; __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL; - /* "yt/geometry/particle_smooth.pyx":186 + /* "yt/geometry/particle_smooth.pyx":146 * doff = np.zeros_like(pdom_ind) - 1 * doff_m = np.zeros((mdom_ind.shape[0], 2), dtype="int64") * moff_p = particle_octree.get_domain_offset(domain_id + domain_offset) # <<<<<<<<<<<<<< @@ -5902,7 +5991,7 @@ */ __pyx_v_moff_p = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_particle_octree->__pyx_vtab)->get_domain_offset(__pyx_v_particle_octree, (__pyx_v_domain_id + __pyx_v_domain_offset)); - /* "yt/geometry/particle_smooth.pyx":187 + /* "yt/geometry/particle_smooth.pyx":147 * doff_m = np.zeros((mdom_ind.shape[0], 2), dtype="int64") * moff_p = particle_octree.get_domain_offset(domain_id + domain_offset) * moff_m = mesh_octree.get_domain_offset(domain_id + domain_offset) # <<<<<<<<<<<<<< @@ -5911,54 +6000,54 @@ */ __pyx_v_moff_m = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_mesh_octree->__pyx_vtab)->get_domain_offset(__pyx_v_mesh_octree, (__pyx_v_domain_id + __pyx_v_domain_offset)); - /* "yt/geometry/particle_smooth.pyx":190 + /* "yt/geometry/particle_smooth.pyx":150 * # pdoms points particles at their octs. So the value in this array, for * # a given index, is the local oct index. * pdoms = np.zeros(positions.shape[0], dtype="int64") - 1 # <<<<<<<<<<<<<< * nf = len(fields) * if fields is None: */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_positions.shape[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_positions.shape[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 190, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_6); - if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 190, __pyx_L1_error) + if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_pdoms = __pyx_t_15; __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL; - /* "yt/geometry/particle_smooth.pyx":191 + /* "yt/geometry/particle_smooth.pyx":151 * # a given index, is the local oct index. * pdoms = np.zeros(positions.shape[0], dtype="int64") - 1 * nf = len(fields) # <<<<<<<<<<<<<< * if fields is None: * fields = [] */ - __pyx_t_17 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_17 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 151, __pyx_L1_error) __pyx_v_nf = __pyx_t_17; - /* "yt/geometry/particle_smooth.pyx":192 + /* "yt/geometry/particle_smooth.pyx":152 * pdoms = np.zeros(positions.shape[0], dtype="int64") - 1 * nf = len(fields) * if fields is None: # <<<<<<<<<<<<<< @@ -5969,19 +6058,19 @@ __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "yt/geometry/particle_smooth.pyx":193 + /* "yt/geometry/particle_smooth.pyx":153 * nf = len(fields) * if fields is None: * fields = [] # <<<<<<<<<<<<<< * field_pointers = alloca(sizeof(np.float64_t *) * nf) * for i in range(nf): */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_fields, __pyx_t_6); __pyx_t_6 = 0; - /* "yt/geometry/particle_smooth.pyx":192 + /* "yt/geometry/particle_smooth.pyx":152 * pdoms = np.zeros(positions.shape[0], dtype="int64") - 1 * nf = len(fields) * if fields is None: # <<<<<<<<<<<<<< @@ -5990,7 +6079,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":194 + /* "yt/geometry/particle_smooth.pyx":154 * if fields is None: * fields = [] * field_pointers = alloca(sizeof(np.float64_t *) * nf) # <<<<<<<<<<<<<< @@ -5999,7 +6088,7 @@ */ __pyx_v_field_pointers = ((__pyx_t_5numpy_float64_t **)alloca(((sizeof(__pyx_t_5numpy_float64_t *)) * __pyx_v_nf))); - /* "yt/geometry/particle_smooth.pyx":195 + /* "yt/geometry/particle_smooth.pyx":155 * fields = [] * field_pointers = alloca(sizeof(np.float64_t *) * nf) * for i in range(nf): # <<<<<<<<<<<<<< @@ -6010,16 +6099,16 @@ for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { __pyx_v_i = __pyx_t_19; - /* "yt/geometry/particle_smooth.pyx":196 + /* "yt/geometry/particle_smooth.pyx":156 * field_pointers = alloca(sizeof(np.float64_t *) * nf) * for i in range(nf): * tarr = fields[i] # <<<<<<<<<<<<<< * field_pointers[i] = tarr.data * if index_fields is None: */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_fields, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_fields, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 196, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 156, __pyx_L1_error) __pyx_t_20 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6035,13 +6124,13 @@ } } __pyx_pybuffernd_tarr.diminfo[0].strides = __pyx_pybuffernd_tarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tarr.diminfo[0].shape = __pyx_pybuffernd_tarr.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_21 < 0)) __PYX_ERR(0, 196, __pyx_L1_error) + if (unlikely(__pyx_t_21 < 0)) __PYX_ERR(0, 156, __pyx_L1_error) } __pyx_t_20 = 0; __Pyx_XDECREF_SET(__pyx_v_tarr, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; - /* "yt/geometry/particle_smooth.pyx":197 + /* "yt/geometry/particle_smooth.pyx":157 * for i in range(nf): * tarr = fields[i] * field_pointers[i] = tarr.data # <<<<<<<<<<<<<< @@ -6051,7 +6140,7 @@ (__pyx_v_field_pointers[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_tarr->data); } - /* "yt/geometry/particle_smooth.pyx":198 + /* "yt/geometry/particle_smooth.pyx":158 * tarr = fields[i] * field_pointers[i] = tarr.data * if index_fields is None: # <<<<<<<<<<<<<< @@ -6062,19 +6151,19 @@ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "yt/geometry/particle_smooth.pyx":199 + /* "yt/geometry/particle_smooth.pyx":159 * field_pointers[i] = tarr.data * if index_fields is None: * index_fields = [] # <<<<<<<<<<<<<< * nf = len(index_fields) * index_field_pointers = alloca(sizeof(np.float64_t *) * nf) */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_index_fields, __pyx_t_6); __pyx_t_6 = 0; - /* "yt/geometry/particle_smooth.pyx":198 + /* "yt/geometry/particle_smooth.pyx":158 * tarr = fields[i] * field_pointers[i] = tarr.data * if index_fields is None: # <<<<<<<<<<<<<< @@ -6083,17 +6172,17 @@ */ } - /* "yt/geometry/particle_smooth.pyx":200 + /* "yt/geometry/particle_smooth.pyx":160 * if index_fields is None: * index_fields = [] * nf = len(index_fields) # <<<<<<<<<<<<<< * index_field_pointers = alloca(sizeof(np.float64_t *) * nf) * for i in range(nf): */ - __pyx_t_17 = PyObject_Length(__pyx_v_index_fields); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_17 = PyObject_Length(__pyx_v_index_fields); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 160, __pyx_L1_error) __pyx_v_nf = __pyx_t_17; - /* "yt/geometry/particle_smooth.pyx":201 + /* "yt/geometry/particle_smooth.pyx":161 * index_fields = [] * nf = len(index_fields) * index_field_pointers = alloca(sizeof(np.float64_t *) * nf) # <<<<<<<<<<<<<< @@ -6102,7 +6191,7 @@ */ __pyx_v_index_field_pointers = ((__pyx_t_5numpy_float64_t **)alloca(((sizeof(__pyx_t_5numpy_float64_t *)) * __pyx_v_nf))); - /* "yt/geometry/particle_smooth.pyx":202 + /* "yt/geometry/particle_smooth.pyx":162 * nf = len(index_fields) * index_field_pointers = alloca(sizeof(np.float64_t *) * nf) * for i in range(nf): # <<<<<<<<<<<<<< @@ -6113,16 +6202,16 @@ for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { __pyx_v_i = __pyx_t_19; - /* "yt/geometry/particle_smooth.pyx":203 + /* "yt/geometry/particle_smooth.pyx":163 * index_field_pointers = alloca(sizeof(np.float64_t *) * nf) * for i in range(nf): * iarr = index_fields[i] # <<<<<<<<<<<<<< * index_field_pointers[i] = iarr.data * for i in range(3): */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_index_fields, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_index_fields, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 203, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 163, __pyx_L1_error) __pyx_t_25 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6138,13 +6227,13 @@ } } __pyx_pybuffernd_iarr.diminfo[0].strides = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iarr.diminfo[0].shape = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_iarr.diminfo[1].strides = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_iarr.diminfo[1].shape = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_iarr.diminfo[2].strides = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_iarr.diminfo[2].shape = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_iarr.diminfo[3].strides = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_iarr.diminfo[3].shape = __pyx_pybuffernd_iarr.rcbuffer->pybuffer.shape[3]; - if (unlikely(__pyx_t_21 < 0)) __PYX_ERR(0, 203, __pyx_L1_error) + if (unlikely(__pyx_t_21 < 0)) __PYX_ERR(0, 163, __pyx_L1_error) } __pyx_t_25 = 0; __Pyx_XDECREF_SET(__pyx_v_iarr, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; - /* "yt/geometry/particle_smooth.pyx":204 + /* "yt/geometry/particle_smooth.pyx":164 * for i in range(nf): * iarr = index_fields[i] * index_field_pointers[i] = iarr.data # <<<<<<<<<<<<<< @@ -6154,7 +6243,7 @@ (__pyx_v_index_field_pointers[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_iarr->data); } - /* "yt/geometry/particle_smooth.pyx":205 + /* "yt/geometry/particle_smooth.pyx":165 * iarr = index_fields[i] * index_field_pointers[i] = iarr.data * for i in range(3): # <<<<<<<<<<<<<< @@ -6164,7 +6253,7 @@ for (__pyx_t_18 = 0; __pyx_t_18 < 3; __pyx_t_18+=1) { __pyx_v_i = __pyx_t_18; - /* "yt/geometry/particle_smooth.pyx":206 + /* "yt/geometry/particle_smooth.pyx":166 * index_field_pointers[i] = iarr.data * for i in range(3): * self.DW[i] = (mesh_octree.DRE[i] - mesh_octree.DLE[i]) # <<<<<<<<<<<<<< @@ -6173,21 +6262,21 @@ */ (__pyx_v_self->DW[__pyx_v_i]) = ((__pyx_v_mesh_octree->DRE[__pyx_v_i]) - (__pyx_v_mesh_octree->DLE[__pyx_v_i])); - /* "yt/geometry/particle_smooth.pyx":207 + /* "yt/geometry/particle_smooth.pyx":167 * for i in range(3): * self.DW[i] = (mesh_octree.DRE[i] - mesh_octree.DLE[i]) * self.periodicity[i] = periodicity[i] # <<<<<<<<<<<<<< * cdef np.float64_t factor = (1 << (particle_octree.oref)) * for i in range(positions.shape[0]): */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_periodicity, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_periodicity, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (__pyx_v_self->periodicity[__pyx_v_i]) = __pyx_t_2; } - /* "yt/geometry/particle_smooth.pyx":208 + /* "yt/geometry/particle_smooth.pyx":168 * self.DW[i] = (mesh_octree.DRE[i] - mesh_octree.DLE[i]) * self.periodicity[i] = periodicity[i] * cdef np.float64_t factor = (1 << (particle_octree.oref)) # <<<<<<<<<<<<<< @@ -6196,7 +6285,7 @@ */ __pyx_v_factor = (1 << __pyx_v_particle_octree->oref); - /* "yt/geometry/particle_smooth.pyx":209 + /* "yt/geometry/particle_smooth.pyx":169 * self.periodicity[i] = periodicity[i] * cdef np.float64_t factor = (1 << (particle_octree.oref)) * for i in range(positions.shape[0]): # <<<<<<<<<<<<<< @@ -6207,7 +6296,7 @@ for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { __pyx_v_i = __pyx_t_18; - /* "yt/geometry/particle_smooth.pyx":210 + /* "yt/geometry/particle_smooth.pyx":170 * cdef np.float64_t factor = (1 << (particle_octree.oref)) * for i in range(positions.shape[0]): * for j in range(3): # <<<<<<<<<<<<<< @@ -6217,7 +6306,7 @@ for (__pyx_t_19 = 0; __pyx_t_19 < 3; __pyx_t_19+=1) { __pyx_v_j = __pyx_t_19; - /* "yt/geometry/particle_smooth.pyx":211 + /* "yt/geometry/particle_smooth.pyx":171 * for i in range(positions.shape[0]): * for j in range(3): * pos[j] = positions[i, j] # <<<<<<<<<<<<<< @@ -6229,7 +6318,7 @@ (__pyx_v_pos[__pyx_v_j]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_positions.data + __pyx_t_26 * __pyx_v_positions.strides[0]) ) + __pyx_t_27 * __pyx_v_positions.strides[1]) ))); } - /* "yt/geometry/particle_smooth.pyx":212 + /* "yt/geometry/particle_smooth.pyx":172 * for j in range(3): * pos[j] = positions[i, j] * oct = particle_octree.get(pos, &oinfo) # <<<<<<<<<<<<<< @@ -6241,7 +6330,7 @@ __pyx_t_28 = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_particle_octree->__pyx_vtab)->get(__pyx_v_particle_octree, __pyx_v_pos, &__pyx_t_29); __pyx_v_oct = __pyx_t_28; - /* "yt/geometry/particle_smooth.pyx":213 + /* "yt/geometry/particle_smooth.pyx":173 * pos[j] = positions[i, j] * oct = particle_octree.get(pos, &oinfo) * if oct == NULL or (domain_id > 0 and oct.domain != domain_id): # <<<<<<<<<<<<<< @@ -6265,7 +6354,7 @@ __pyx_L18_bool_binop_done:; if (__pyx_t_2) { - /* "yt/geometry/particle_smooth.pyx":214 + /* "yt/geometry/particle_smooth.pyx":174 * oct = particle_octree.get(pos, &oinfo) * if oct == NULL or (domain_id > 0 and oct.domain != domain_id): * continue # <<<<<<<<<<<<<< @@ -6274,7 +6363,7 @@ */ goto __pyx_L13_continue; - /* "yt/geometry/particle_smooth.pyx":213 + /* "yt/geometry/particle_smooth.pyx":173 * pos[j] = positions[i, j] * oct = particle_octree.get(pos, &oinfo) * if oct == NULL or (domain_id > 0 and oct.domain != domain_id): # <<<<<<<<<<<<<< @@ -6283,7 +6372,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":218 + /* "yt/geometry/particle_smooth.pyx":178 * # This is the particle count, which we'll use once we have sorted * # the particles to calculate the offsets into each oct's particles. * offset = oct.domain_ind - moff_p # <<<<<<<<<<<<<< @@ -6292,7 +6381,7 @@ */ __pyx_v_offset = (__pyx_v_oct->domain_ind - __pyx_v_moff_p); - /* "yt/geometry/particle_smooth.pyx":219 + /* "yt/geometry/particle_smooth.pyx":179 * # the particles to calculate the offsets into each oct's particles. * offset = oct.domain_ind - moff_p * pcount[offset] += 1 # <<<<<<<<<<<<<< @@ -6302,7 +6391,7 @@ __pyx_t_30 = __pyx_v_offset; *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pcount.data + __pyx_t_30 * __pyx_v_pcount.strides[0]) )) += 1; - /* "yt/geometry/particle_smooth.pyx":220 + /* "yt/geometry/particle_smooth.pyx":180 * offset = oct.domain_ind - moff_p * pcount[offset] += 1 * pdoms[i] = offset # We store the *actual* offset. # <<<<<<<<<<<<<< @@ -6312,7 +6401,7 @@ __pyx_t_31 = __pyx_v_i; *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pdoms.data + __pyx_t_31 * __pyx_v_pdoms.strides[0]) )) = __pyx_v_offset; - /* "yt/geometry/particle_smooth.pyx":223 + /* "yt/geometry/particle_smooth.pyx":183 * # store oct positions and dds to avoid searching for neighbors * # in octs that we know are too far away * for j in range(3): # <<<<<<<<<<<<<< @@ -6322,7 +6411,7 @@ for (__pyx_t_19 = 0; __pyx_t_19 < 3; __pyx_t_19+=1) { __pyx_v_j = __pyx_t_19; - /* "yt/geometry/particle_smooth.pyx":224 + /* "yt/geometry/particle_smooth.pyx":184 * # in octs that we know are too far away * for j in range(3): * oct_left_edges[offset, j] = oinfo.left_edge[j] # <<<<<<<<<<<<<< @@ -6333,7 +6422,7 @@ __pyx_t_33 = __pyx_v_j; *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_oct_left_edges.data + __pyx_t_32 * __pyx_v_oct_left_edges.strides[0]) ) + __pyx_t_33 * __pyx_v_oct_left_edges.strides[1]) )) = (__pyx_v_oinfo.left_edge[__pyx_v_j]); - /* "yt/geometry/particle_smooth.pyx":225 + /* "yt/geometry/particle_smooth.pyx":185 * for j in range(3): * oct_left_edges[offset, j] = oinfo.left_edge[j] * oct_dds[offset, j] = oinfo.dds[j] * factor # <<<<<<<<<<<<<< @@ -6347,24 +6436,24 @@ __pyx_L13_continue:; } - /* "yt/geometry/particle_smooth.pyx":230 + /* "yt/geometry/particle_smooth.pyx":190 * # actually be indirectly-sorted fields. This preserves memory at the * # expense of additional pointer lookups. * pind = np.asarray(np.argsort(pdoms), dtype='int64', order='C') # <<<<<<<<<<<<<< * # So what this means is that we now have all the oct-0 particle indices * # in order, then the oct-1, etc etc. */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_argsort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_argsort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_pdoms, 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_4)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_pdoms, 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_4)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -6377,14 +6466,14 @@ } } if (!__pyx_t_9) { - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_4}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6393,47 +6482,47 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_4}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 230, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 230, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 230, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_10); - if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 230, __pyx_L1_error) + if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_pind = __pyx_t_15; __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL; - /* "yt/geometry/particle_smooth.pyx":234 + /* "yt/geometry/particle_smooth.pyx":194 * # in order, then the oct-1, etc etc. * # This now gives us the indices to the particles for each domain. * for i in range(positions.shape[0]): # <<<<<<<<<<<<<< @@ -6444,7 +6533,7 @@ for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { __pyx_v_i = __pyx_t_18; - /* "yt/geometry/particle_smooth.pyx":237 + /* "yt/geometry/particle_smooth.pyx":197 * # This value, poff, is the index of the particle in the *unsorted* * # arrays. * poff = pind[i] # <<<<<<<<<<<<<< @@ -6454,7 +6543,7 @@ __pyx_t_36 = __pyx_v_i; __pyx_v_poff = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pind.data + __pyx_t_36 * __pyx_v_pind.strides[0]) ))); - /* "yt/geometry/particle_smooth.pyx":238 + /* "yt/geometry/particle_smooth.pyx":198 * # arrays. * poff = pind[i] * offset = pdoms[poff] # <<<<<<<<<<<<<< @@ -6464,7 +6553,7 @@ __pyx_t_37 = __pyx_v_poff; __pyx_v_offset = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pdoms.data + __pyx_t_37 * __pyx_v_pdoms.strides[0]) ))); - /* "yt/geometry/particle_smooth.pyx":241 + /* "yt/geometry/particle_smooth.pyx":201 * # If we have yet to assign the starting index to this oct, we do so * # now. * if doff[offset] < 0: doff[offset] = i # <<<<<<<<<<<<<< @@ -6479,34 +6568,34 @@ } } - /* "yt/geometry/particle_smooth.pyx":247 + /* "yt/geometry/particle_smooth.pyx":207 * # refers to that oct's particles. * cdef np.ndarray[np.uint8_t, ndim=1] visited * visited = np.zeros(mdom_ind.shape[0], dtype="uint8") # <<<<<<<<<<<<<< * cdef int nproc = 0 - * for i in range(oct_positions.shape[0]): + * # This should be thread-private if we ever go to OpenMP */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyInt_FromSsize_t((__pyx_v_mdom_ind.shape[0])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_10 = PyInt_FromSsize_t((__pyx_v_mdom_ind.shape[0])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 247, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 247, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 207, __pyx_L1_error) __pyx_t_40 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6522,35 +6611,92 @@ } } __pyx_pybuffernd_visited.diminfo[0].strides = __pyx_pybuffernd_visited.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_visited.diminfo[0].shape = __pyx_pybuffernd_visited.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 247, __pyx_L1_error) + if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 207, __pyx_L1_error) } __pyx_t_40 = 0; __pyx_v_visited = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/particle_smooth.pyx":248 + /* "yt/geometry/particle_smooth.pyx":208 * cdef np.ndarray[np.uint8_t, ndim=1] visited * visited = np.zeros(mdom_ind.shape[0], dtype="uint8") * cdef int nproc = 0 # <<<<<<<<<<<<<< - * for i in range(oct_positions.shape[0]): - * for j in range(3): + * # This should be thread-private if we ever go to OpenMP + * cdef DistanceQueue dist_queue = DistanceQueue(self.maxn) */ __pyx_v_nproc = 0; - /* "yt/geometry/particle_smooth.pyx":249 - * visited = np.zeros(mdom_ind.shape[0], dtype="uint8") + /* "yt/geometry/particle_smooth.pyx":210 * cdef int nproc = 0 + * # This should be thread-private if we ever go to OpenMP + * cdef DistanceQueue dist_queue = DistanceQueue(self.maxn) # <<<<<<<<<<<<<< + * dist_queue._setup(self.DW, self.periodicity) + * for i in range(oct_positions.shape[0]): + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->maxn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue), __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_dist_queue = ((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "yt/geometry/particle_smooth.pyx":211 + * # This should be thread-private if we ever go to OpenMP + * cdef DistanceQueue dist_queue = DistanceQueue(self.maxn) + * dist_queue._setup(self.DW, self.periodicity) # <<<<<<<<<<<<<< + * for i in range(oct_positions.shape[0]): + * if (i % 10000) == 0: + */ + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_dist_queue->__pyx_base.__pyx_vtab)->_setup(__pyx_v_dist_queue, __pyx_v_self->DW, __pyx_v_self->periodicity); + + /* "yt/geometry/particle_smooth.pyx":212 + * cdef DistanceQueue dist_queue = DistanceQueue(self.maxn) + * dist_queue._setup(self.DW, self.periodicity) * for i in range(oct_positions.shape[0]): # <<<<<<<<<<<<<< - * for j in range(3): - * pos[j] = oct_positions[i, j] + * if (i % 10000) == 0: + * PyErr_CheckSignals() */ __pyx_t_17 = (__pyx_v_oct_positions.shape[0]); for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { __pyx_v_i = __pyx_t_18; - /* "yt/geometry/particle_smooth.pyx":250 - * cdef int nproc = 0 + /* "yt/geometry/particle_smooth.pyx":213 + * dist_queue._setup(self.DW, self.periodicity) + * for i in range(oct_positions.shape[0]): + * if (i % 10000) == 0: # <<<<<<<<<<<<<< + * PyErr_CheckSignals() + * for j in range(3): + */ + __pyx_t_2 = (((__pyx_v_i % 0x2710) == 0) != 0); + if (__pyx_t_2) { + + /* "yt/geometry/particle_smooth.pyx":214 + * for i in range(oct_positions.shape[0]): + * if (i % 10000) == 0: + * PyErr_CheckSignals() # <<<<<<<<<<<<<< + * for j in range(3): + * pos[j] = oct_positions[i, j] + */ + __pyx_t_19 = PyErr_CheckSignals(); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 214, __pyx_L1_error) + + /* "yt/geometry/particle_smooth.pyx":213 + * dist_queue._setup(self.DW, self.periodicity) * for i in range(oct_positions.shape[0]): + * if (i % 10000) == 0: # <<<<<<<<<<<<<< + * PyErr_CheckSignals() + * for j in range(3): + */ + } + + /* "yt/geometry/particle_smooth.pyx":215 + * if (i % 10000) == 0: + * PyErr_CheckSignals() * for j in range(3): # <<<<<<<<<<<<<< * pos[j] = oct_positions[i, j] * oct = mesh_octree.get(pos, &moi) @@ -6558,8 +6704,8 @@ for (__pyx_t_19 = 0; __pyx_t_19 < 3; __pyx_t_19+=1) { __pyx_v_j = __pyx_t_19; - /* "yt/geometry/particle_smooth.pyx":251 - * for i in range(oct_positions.shape[0]): + /* "yt/geometry/particle_smooth.pyx":216 + * PyErr_CheckSignals() * for j in range(3): * pos[j] = oct_positions[i, j] # <<<<<<<<<<<<<< * oct = mesh_octree.get(pos, &moi) @@ -6570,7 +6716,7 @@ (__pyx_v_pos[__pyx_v_j]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_oct_positions.data + __pyx_t_41 * __pyx_v_oct_positions.strides[0]) ) + __pyx_t_42 * __pyx_v_oct_positions.strides[1]) ))); } - /* "yt/geometry/particle_smooth.pyx":252 + /* "yt/geometry/particle_smooth.pyx":217 * for j in range(3): * pos[j] = oct_positions[i, j] * oct = mesh_octree.get(pos, &moi) # <<<<<<<<<<<<<< @@ -6582,7 +6728,7 @@ __pyx_t_28 = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_mesh_octree->__pyx_vtab)->get(__pyx_v_mesh_octree, __pyx_v_pos, &__pyx_t_29); __pyx_v_oct = __pyx_t_28; - /* "yt/geometry/particle_smooth.pyx":253 + /* "yt/geometry/particle_smooth.pyx":218 * pos[j] = oct_positions[i, j] * oct = mesh_octree.get(pos, &moi) * offset = mdom_ind[oct.domain_ind - moff_m] * nz # <<<<<<<<<<<<<< @@ -6592,7 +6738,7 @@ __pyx_t_43 = (__pyx_v_oct->domain_ind - __pyx_v_moff_m); __pyx_v_offset = ((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_mdom_ind.data + __pyx_t_43 * __pyx_v_mdom_ind.strides[0]) ))) * __pyx_v_nz); - /* "yt/geometry/particle_smooth.pyx":254 + /* "yt/geometry/particle_smooth.pyx":219 * oct = mesh_octree.get(pos, &moi) * offset = mdom_ind[oct.domain_ind - moff_m] * nz * if visited[oct.domain_ind - moff_m] == 1: continue # <<<<<<<<<<<<<< @@ -6605,7 +6751,7 @@ goto __pyx_L26_continue; } - /* "yt/geometry/particle_smooth.pyx":255 + /* "yt/geometry/particle_smooth.pyx":220 * offset = mdom_ind[oct.domain_ind - moff_m] * nz * if visited[oct.domain_ind - moff_m] == 1: continue * visited[oct.domain_ind - moff_m] = 1 # <<<<<<<<<<<<<< @@ -6615,7 +6761,7 @@ __pyx_t_45 = (__pyx_v_oct->domain_ind - __pyx_v_moff_m); *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_visited.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_visited.diminfo[0].strides) = 1; - /* "yt/geometry/particle_smooth.pyx":256 + /* "yt/geometry/particle_smooth.pyx":221 * if visited[oct.domain_ind - moff_m] == 1: continue * visited[oct.domain_ind - moff_m] = 1 * if offset < 0: continue # <<<<<<<<<<<<<< @@ -6627,7 +6773,7 @@ goto __pyx_L26_continue; } - /* "yt/geometry/particle_smooth.pyx":257 + /* "yt/geometry/particle_smooth.pyx":222 * visited[oct.domain_ind - moff_m] = 1 * if offset < 0: continue * nproc += 1 # <<<<<<<<<<<<<< @@ -6636,18 +6782,18 @@ */ __pyx_v_nproc = (__pyx_v_nproc + 1); - /* "yt/geometry/particle_smooth.pyx":258 + /* "yt/geometry/particle_smooth.pyx":223 * if offset < 0: continue * nproc += 1 * self.neighbor_process( # <<<<<<<<<<<<<< * dims, moi.left_edge, moi.dds, cart_positions, field_pointers, doff, * &nind, pind, pcount, offset, index_field_pointers, */ - ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_process(__pyx_v_self, __pyx_v_dims, __pyx_v_moi.left_edge, __pyx_v_moi.dds, __pyx_v_cart_positions, __pyx_v_field_pointers, __pyx_v_doff, (&__pyx_v_nind), __pyx_v_pind, __pyx_v_pcount, __pyx_v_offset, __pyx_v_index_field_pointers, __pyx_v_particle_octree, __pyx_v_domain_id, (&__pyx_v_nsize), __pyx_v_oct_left_edges, __pyx_v_oct_dds); + ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_process(__pyx_v_self, __pyx_v_dims, __pyx_v_moi.left_edge, __pyx_v_moi.dds, __pyx_v_cart_positions, __pyx_v_field_pointers, __pyx_v_doff, (&__pyx_v_nind), __pyx_v_pind, __pyx_v_pcount, __pyx_v_offset, __pyx_v_index_field_pointers, __pyx_v_particle_octree, __pyx_v_domain_id, (&__pyx_v_nsize), __pyx_v_oct_left_edges, __pyx_v_oct_dds, __pyx_v_dist_queue); __pyx_L26_continue:; } - /* "yt/geometry/particle_smooth.pyx":265 + /* "yt/geometry/particle_smooth.pyx":230 * #print "VISITED", visited.sum(), visited.size, * #print 100.0*float(visited.sum())/visited.size * if nind != NULL: # <<<<<<<<<<<<<< @@ -6657,7 +6803,7 @@ __pyx_t_2 = ((__pyx_v_nind != NULL) != 0); if (__pyx_t_2) { - /* "yt/geometry/particle_smooth.pyx":266 + /* "yt/geometry/particle_smooth.pyx":231 * #print 100.0*float(visited.sum())/visited.size * if nind != NULL: * free(nind) # <<<<<<<<<<<<<< @@ -6666,7 +6812,7 @@ */ free(__pyx_v_nind); - /* "yt/geometry/particle_smooth.pyx":265 + /* "yt/geometry/particle_smooth.pyx":230 * #print "VISITED", visited.sum(), visited.size, * #print 100.0*float(visited.sum())/visited.size * if nind != NULL: # <<<<<<<<<<<<<< @@ -6675,7 +6821,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":99 + /* "yt/geometry/particle_smooth.pyx":59 * @cython.wraparound(False) * @cython.initializedcheck(False) * def process_octree(self, OctreeContainer mesh_octree, # <<<<<<<<<<<<<< @@ -6726,6 +6872,7 @@ __PYX_XDEC_MEMVIEW(&__pyx_v_oct_left_edges, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_oct_dds, 1); __Pyx_XDECREF((PyObject *)__pyx_v_visited); + __Pyx_XDECREF((PyObject *)__pyx_v_dist_queue); __PYX_XDEC_MEMVIEW(&__pyx_v_mdom_ind, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_positions, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_oct_positions, 1); @@ -6739,7 +6886,7 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":272 +/* "yt/geometry/particle_smooth.pyx":237 * @cython.wraparound(False) * @cython.initializedcheck(False) * def process_particles(self, OctreeContainer particle_octree, # <<<<<<<<<<<<<< @@ -6765,7 +6912,7 @@ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_particle_octree,&__pyx_n_s_pdom_ind,&__pyx_n_s_positions,&__pyx_n_s_fields,&__pyx_n_s_domain_id,&__pyx_n_s_domain_offset,&__pyx_n_s_periodicity,&__pyx_n_s_geometry,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; - /* "yt/geometry/particle_smooth.pyx":275 + /* "yt/geometry/particle_smooth.pyx":240 * np.ndarray[np.int64_t, ndim=1] pdom_ind, * np.ndarray[np.float64_t, ndim=2] positions, * fields = None, int domain_id = -1, # <<<<<<<<<<<<<< @@ -6774,7 +6921,7 @@ */ values[3] = ((PyObject *)Py_None); - /* "yt/geometry/particle_smooth.pyx":277 + /* "yt/geometry/particle_smooth.pyx":242 * fields = None, int domain_id = -1, * int domain_offset = 0, * periodicity = (True, True, True), # <<<<<<<<<<<<<< @@ -6788,13 +6935,21 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -6803,36 +6958,43 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_particle_octree)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdom_ind)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("process_particles", 0, 3, 8, 1); __PYX_ERR(0, 272, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("process_particles", 0, 3, 8, 1); __PYX_ERR(0, 237, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("process_particles", 0, 3, 8, 2); __PYX_ERR(0, 272, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("process_particles", 0, 3, 8, 2); __PYX_ERR(0, 237, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); if (value) { values[4] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_offset); if (value) { values[5] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periodicity); if (value) { values[6] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_geometry); @@ -6840,15 +7002,20 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_particles") < 0)) __PYX_ERR(0, 272, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_particles") < 0)) __PYX_ERR(0, 237, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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); @@ -6861,12 +7028,12 @@ __pyx_v_positions = ((PyArrayObject *)values[2]); __pyx_v_fields = values[3]; if (values[4]) { - __pyx_v_domain_id = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error) + __pyx_v_domain_id = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L3_error) } else { __pyx_v_domain_id = ((int)-1); } if (values[5]) { - __pyx_v_domain_offset = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_domain_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error) + __pyx_v_domain_offset = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_domain_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L3_error) } else { __pyx_v_domain_offset = ((int)0); } @@ -6875,18 +7042,18 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("process_particles", 0, 3, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 272, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("process_particles", 0, 3, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 237, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.process_particles", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_particle_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "particle_octree", 0))) __PYX_ERR(0, 272, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdom_ind), __pyx_ptype_5numpy_ndarray, 1, "pdom_ind", 0))) __PYX_ERR(0, 273, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_positions), __pyx_ptype_5numpy_ndarray, 1, "positions", 0))) __PYX_ERR(0, 274, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_particle_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "particle_octree", 0))) __PYX_ERR(0, 237, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdom_ind), __pyx_ptype_5numpy_ndarray, 1, "pdom_ind", 0))) __PYX_ERR(0, 238, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_positions), __pyx_ptype_5numpy_ndarray, 1, "positions", 0))) __PYX_ERR(0, 239, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_8process_particles(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self), __pyx_v_particle_octree, __pyx_v_pdom_ind, __pyx_v_positions, __pyx_v_fields, __pyx_v_domain_id, __pyx_v_domain_offset, __pyx_v_periodicity, __pyx_v_geometry); - /* "yt/geometry/particle_smooth.pyx":272 + /* "yt/geometry/particle_smooth.pyx":237 * @cython.wraparound(False) * @cython.initializedcheck(False) * def process_particles(self, OctreeContainer particle_octree, # <<<<<<<<<<<<<< @@ -6927,6 +7094,7 @@ PyArrayObject *__pyx_v_cart_positions = 0; CYTHON_UNUSED int __pyx_v_maxnei; CYTHON_UNUSED int __pyx_v_nproc; + struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dist_queue = 0; __Pyx_LocalBuf_ND __pyx_pybuffernd_cart_positions; __Pyx_Buffer __pyx_pybuffer_cart_positions; __Pyx_LocalBuf_ND __pyx_pybuffernd_pdom_ind; @@ -6997,16 +7165,16 @@ __pyx_pybuffernd_positions.rcbuffer = &__pyx_pybuffer_positions; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pdom_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_pdom_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 272, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pdom_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_pdom_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 237, __pyx_L1_error) } __pyx_pybuffernd_pdom_ind.diminfo[0].strides = __pyx_pybuffernd_pdom_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pdom_ind.diminfo[0].shape = __pyx_pybuffernd_pdom_ind.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_positions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 272, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_positions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 237, __pyx_L1_error) } __pyx_pybuffernd_positions.diminfo[0].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_positions.diminfo[0].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_positions.diminfo[1].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_positions.diminfo[1].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[1]; - /* "yt/geometry/particle_smooth.pyx":293 + /* "yt/geometry/particle_smooth.pyx":258 * cdef np.float64_t pos[3] * cdef np.float64_t **octree_field_pointers * cdef int nsize = 0 # <<<<<<<<<<<<<< @@ -7015,7 +7183,7 @@ */ __pyx_v_nsize = 0; - /* "yt/geometry/particle_smooth.pyx":294 + /* "yt/geometry/particle_smooth.pyx":259 * cdef np.float64_t **octree_field_pointers * cdef int nsize = 0 * cdef np.int64_t *nind = NULL # <<<<<<<<<<<<<< @@ -7024,7 +7192,7 @@ */ __pyx_v_nind = NULL; - /* "yt/geometry/particle_smooth.pyx":297 + /* "yt/geometry/particle_smooth.pyx":262 * cdef OctInfo moi, poi * cdef Oct *oct * cdef Oct **neighbors = NULL # <<<<<<<<<<<<<< @@ -7033,17 +7201,17 @@ */ __pyx_v_neighbors = NULL; - /* "yt/geometry/particle_smooth.pyx":303 + /* "yt/geometry/particle_smooth.pyx":268 * cdef np.ndarray[np.float64_t, ndim=1] tarr * cdef np.ndarray[np.float64_t, ndim=2] cart_positions * if geometry == "cartesian": # <<<<<<<<<<<<<< * self.pos_setup = cart_coord_setup * cart_positions = positions */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_geometry, __pyx_n_s_cartesian, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_geometry, __pyx_n_s_cartesian, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 268, __pyx_L1_error) if (__pyx_t_1) { - /* "yt/geometry/particle_smooth.pyx":304 + /* "yt/geometry/particle_smooth.pyx":269 * cdef np.ndarray[np.float64_t, ndim=2] cart_positions * if geometry == "cartesian": * self.pos_setup = cart_coord_setup # <<<<<<<<<<<<<< @@ -7052,7 +7220,7 @@ */ __pyx_v_self->pos_setup = __pyx_f_2yt_8geometry_15particle_smooth_cart_coord_setup; - /* "yt/geometry/particle_smooth.pyx":305 + /* "yt/geometry/particle_smooth.pyx":270 * if geometry == "cartesian": * self.pos_setup = cart_coord_setup * cart_positions = positions # <<<<<<<<<<<<<< @@ -7073,12 +7241,12 @@ } } __pyx_pybuffernd_cart_positions.diminfo[0].strides = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cart_positions.diminfo[0].shape = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_cart_positions.diminfo[1].strides = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_cart_positions.diminfo[1].shape = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 305, __pyx_L1_error) + if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 270, __pyx_L1_error) } __Pyx_INCREF(((PyObject *)__pyx_v_positions)); __pyx_v_cart_positions = ((PyArrayObject *)__pyx_v_positions); - /* "yt/geometry/particle_smooth.pyx":303 + /* "yt/geometry/particle_smooth.pyx":268 * cdef np.ndarray[np.float64_t, ndim=1] tarr * cdef np.ndarray[np.float64_t, ndim=2] cart_positions * if geometry == "cartesian": # <<<<<<<<<<<<<< @@ -7088,17 +7256,17 @@ goto __pyx_L3; } - /* "yt/geometry/particle_smooth.pyx":306 + /* "yt/geometry/particle_smooth.pyx":271 * self.pos_setup = cart_coord_setup * cart_positions = positions * elif geometry == "spherical": # <<<<<<<<<<<<<< * self.pos_setup = spherical_coord_setup * cart_positions = np.empty((positions.shape[0], 3), dtype="float64") */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_geometry, __pyx_n_s_spherical, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_geometry, __pyx_n_s_spherical, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 271, __pyx_L1_error) if (__pyx_t_1) { - /* "yt/geometry/particle_smooth.pyx":307 + /* "yt/geometry/particle_smooth.pyx":272 * cart_positions = positions * elif geometry == "spherical": * self.pos_setup = spherical_coord_setup # <<<<<<<<<<<<<< @@ -7107,21 +7275,21 @@ */ __pyx_v_self->pos_setup = __pyx_f_2yt_8geometry_15particle_smooth_spherical_coord_setup; - /* "yt/geometry/particle_smooth.pyx":308 + /* "yt/geometry/particle_smooth.pyx":273 * elif geometry == "spherical": * self.pos_setup = spherical_coord_setup * cart_positions = np.empty((positions.shape[0], 3), dtype="float64") # <<<<<<<<<<<<<< * * cart_positions[:,0] = positions[:,0] * \ */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_positions->dimensions[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_positions->dimensions[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); @@ -7129,20 +7297,20 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_3); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 308, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 308, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 308, __pyx_L1_error) + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 273, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7158,35 +7326,35 @@ } } __pyx_pybuffernd_cart_positions.diminfo[0].strides = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cart_positions.diminfo[0].shape = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_cart_positions.diminfo[1].strides = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_cart_positions.diminfo[1].shape = __pyx_pybuffernd_cart_positions.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 308, __pyx_L1_error) + if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 273, __pyx_L1_error) } __pyx_t_10 = 0; __pyx_v_cart_positions = ((PyArrayObject *)__pyx_t_9); __pyx_t_9 = 0; - /* "yt/geometry/particle_smooth.pyx":310 + /* "yt/geometry/particle_smooth.pyx":275 * cart_positions = np.empty((positions.shape[0], 3), dtype="float64") * * cart_positions[:,0] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) */ - __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - /* "yt/geometry/particle_smooth.pyx":311 + /* "yt/geometry/particle_smooth.pyx":276 * * cart_positions[:,0] = positions[:,0] * \ * np.sin(positions[:,1]) * \ # <<<<<<<<<<<<<< * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { @@ -7199,14 +7367,14 @@ } } if (!__pyx_t_11) { - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_6}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -7215,51 +7383,51 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_6}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/particle_smooth.pyx":310 + /* "yt/geometry/particle_smooth.pyx":275 * cart_positions = np.empty((positions.shape[0], 3), dtype="float64") * * cart_positions[:,0] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) */ - __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/particle_smooth.pyx":312 + /* "yt/geometry/particle_smooth.pyx":277 * cart_positions[:,0] = positions[:,0] * \ * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) # <<<<<<<<<<<<<< * cart_positions[:,1] = positions[:,0] * \ * np.sin(positions[:,1]) * \ */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_cos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_cos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { @@ -7272,14 +7440,14 @@ } } if (!__pyx_t_6) { - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_9}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -7288,71 +7456,71 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_9}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "yt/geometry/particle_smooth.pyx":311 + /* "yt/geometry/particle_smooth.pyx":276 * * cart_positions[:,0] = positions[:,0] * \ * np.sin(positions[:,1]) * \ # <<<<<<<<<<<<<< * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ */ - __pyx_t_12 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_12 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/particle_smooth.pyx":310 + /* "yt/geometry/particle_smooth.pyx":275 * cart_positions = np.empty((positions.shape[0], 3), dtype="float64") * * cart_positions[:,0] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) */ - if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_cart_positions), __pyx_tuple__12, __pyx_t_12) < 0)) __PYX_ERR(0, 310, __pyx_L1_error) + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_cart_positions), __pyx_tuple__12, __pyx_t_12) < 0)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "yt/geometry/particle_smooth.pyx":313 + /* "yt/geometry/particle_smooth.pyx":278 * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) */ - __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - /* "yt/geometry/particle_smooth.pyx":314 + /* "yt/geometry/particle_smooth.pyx":279 * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ * np.sin(positions[:,1]) * \ # <<<<<<<<<<<<<< * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { @@ -7365,14 +7533,14 @@ } } if (!__pyx_t_9) { - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_7}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -7381,51 +7549,51 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_7}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "yt/geometry/particle_smooth.pyx":313 + /* "yt/geometry/particle_smooth.pyx":278 * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) */ - __pyx_t_11 = PyNumber_Multiply(__pyx_t_12, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_11 = PyNumber_Multiply(__pyx_t_12, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/particle_smooth.pyx":315 + /* "yt/geometry/particle_smooth.pyx":280 * cart_positions[:,1] = positions[:,0] * \ * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) # <<<<<<<<<<<<<< * cart_positions[:,2] = positions[:,0] * \ * np.cos(positions[:,1]) */ - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_sin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_sin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__18); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__18); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -7438,14 +7606,14 @@ } } if (!__pyx_t_7) { - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_12}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -7454,71 +7622,71 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_12}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_12); __pyx_t_12 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "yt/geometry/particle_smooth.pyx":314 + /* "yt/geometry/particle_smooth.pyx":279 * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ * np.sin(positions[:,1]) * \ # <<<<<<<<<<<<<< * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ */ - __pyx_t_6 = PyNumber_Multiply(__pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/particle_smooth.pyx":313 + /* "yt/geometry/particle_smooth.pyx":278 * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) */ - if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_cart_positions), __pyx_tuple__20, __pyx_t_6) < 0)) __PYX_ERR(0, 313, __pyx_L1_error) + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_cart_positions), __pyx_tuple__20, __pyx_t_6) < 0)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "yt/geometry/particle_smooth.pyx":316 + /* "yt/geometry/particle_smooth.pyx":281 * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.cos(positions[:,1]) * periodicity = (False, False, False) */ - __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "yt/geometry/particle_smooth.pyx":317 + /* "yt/geometry/particle_smooth.pyx":282 * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ * np.cos(positions[:,1]) # <<<<<<<<<<<<<< * periodicity = (False, False, False) * else: */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_cos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_cos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__24); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_11 = PyObject_GetItem(((PyObject *)__pyx_v_positions), __pyx_tuple__24); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { @@ -7531,14 +7699,14 @@ } } if (!__pyx_t_12) { - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_11}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -7547,41 +7715,41 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_11}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_11); __pyx_t_11 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "yt/geometry/particle_smooth.pyx":316 + /* "yt/geometry/particle_smooth.pyx":281 * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.cos(positions[:,1]) * periodicity = (False, False, False) */ - __pyx_t_9 = PyNumber_Multiply(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_cart_positions), __pyx_tuple__26, __pyx_t_9) < 0)) __PYX_ERR(0, 316, __pyx_L1_error) + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_cart_positions), __pyx_tuple__26, __pyx_t_9) < 0)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "yt/geometry/particle_smooth.pyx":318 + /* "yt/geometry/particle_smooth.pyx":283 * cart_positions[:,2] = positions[:,0] * \ * np.cos(positions[:,1]) * periodicity = (False, False, False) # <<<<<<<<<<<<<< @@ -7591,7 +7759,7 @@ __Pyx_INCREF(__pyx_tuple__27); __Pyx_DECREF_SET(__pyx_v_periodicity, __pyx_tuple__27); - /* "yt/geometry/particle_smooth.pyx":306 + /* "yt/geometry/particle_smooth.pyx":271 * self.pos_setup = cart_coord_setup * cart_positions = positions * elif geometry == "spherical": # <<<<<<<<<<<<<< @@ -7601,7 +7769,7 @@ goto __pyx_L3; } - /* "yt/geometry/particle_smooth.pyx":320 + /* "yt/geometry/particle_smooth.pyx":285 * periodicity = (False, False, False) * else: * raise NotImplementedError # <<<<<<<<<<<<<< @@ -7610,11 +7778,11 @@ */ /*else*/ { __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 320, __pyx_L1_error) + __PYX_ERR(0, 285, __pyx_L1_error) } __pyx_L3:; - /* "yt/geometry/particle_smooth.pyx":321 + /* "yt/geometry/particle_smooth.pyx":286 * else: * raise NotImplementedError * numpart = positions.shape[0] # <<<<<<<<<<<<<< @@ -7623,16 +7791,16 @@ */ __pyx_v_numpart = (__pyx_v_positions->dimensions[0]); - /* "yt/geometry/particle_smooth.pyx":322 + /* "yt/geometry/particle_smooth.pyx":287 * raise NotImplementedError * numpart = positions.shape[0] * pcount = np.zeros_like(pdom_ind) # <<<<<<<<<<<<<< * doff = np.zeros_like(pdom_ind) - 1 * moff_p = particle_octree.get_domain_offset(domain_id + domain_offset) */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -7646,13 +7814,13 @@ } } if (!__pyx_t_8) { - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_pdom_ind)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_pdom_ind)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_8, ((PyObject *)__pyx_v_pdom_ind)}; - __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_9); } else @@ -7660,41 +7828,41 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_8, ((PyObject *)__pyx_v_pdom_ind)}; - __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_9); } else #endif { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_pdom_ind)); __Pyx_GIVEREF(((PyObject *)__pyx_v_pdom_ind)); PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_pdom_ind)); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_9); - if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 322, __pyx_L1_error) + if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_pcount = __pyx_t_13; __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; - /* "yt/geometry/particle_smooth.pyx":323 + /* "yt/geometry/particle_smooth.pyx":288 * numpart = positions.shape[0] * pcount = np.zeros_like(pdom_ind) * doff = np.zeros_like(pdom_ind) - 1 # <<<<<<<<<<<<<< * moff_p = particle_octree.get_domain_offset(domain_id + domain_offset) * pdoms = np.zeros(positions.shape[0], dtype="int64") - 1 */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -7708,13 +7876,13 @@ } } if (!__pyx_t_6) { - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_pdom_ind)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_pdom_ind)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_6, ((PyObject *)__pyx_v_pdom_ind)}; - __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_9); } else @@ -7722,35 +7890,35 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_6, ((PyObject *)__pyx_v_pdom_ind)}; - __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_9); } else #endif { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_pdom_ind)); __Pyx_GIVEREF(((PyObject *)__pyx_v_pdom_ind)); PyTuple_SET_ITEM(__pyx_t_8, 0+1, ((PyObject *)__pyx_v_pdom_ind)); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_t_9, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_t_9, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_7); - if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 323, __pyx_L1_error) + if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_doff = __pyx_t_13; __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; - /* "yt/geometry/particle_smooth.pyx":324 + /* "yt/geometry/particle_smooth.pyx":289 * pcount = np.zeros_like(pdom_ind) * doff = np.zeros_like(pdom_ind) - 1 * moff_p = particle_octree.get_domain_offset(domain_id + domain_offset) # <<<<<<<<<<<<<< @@ -7759,54 +7927,54 @@ */ __pyx_v_moff_p = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_particle_octree->__pyx_vtab)->get_domain_offset(__pyx_v_particle_octree, (__pyx_v_domain_id + __pyx_v_domain_offset)); - /* "yt/geometry/particle_smooth.pyx":325 + /* "yt/geometry/particle_smooth.pyx":290 * doff = np.zeros_like(pdom_ind) - 1 * moff_p = particle_octree.get_domain_offset(domain_id + domain_offset) * pdoms = np.zeros(positions.shape[0], dtype="int64") - 1 # <<<<<<<<<<<<<< * nf = len(fields) * if fields is None: */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_positions->dimensions[0])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_positions->dimensions[0])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __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 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 325, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_7); - if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 325, __pyx_L1_error) + if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_pdoms = __pyx_t_13; __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; - /* "yt/geometry/particle_smooth.pyx":326 + /* "yt/geometry/particle_smooth.pyx":291 * moff_p = particle_octree.get_domain_offset(domain_id + domain_offset) * pdoms = np.zeros(positions.shape[0], dtype="int64") - 1 * nf = len(fields) # <<<<<<<<<<<<<< * if fields is None: * fields = [] */ - __pyx_t_14 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_14 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 291, __pyx_L1_error) __pyx_v_nf = __pyx_t_14; - /* "yt/geometry/particle_smooth.pyx":327 + /* "yt/geometry/particle_smooth.pyx":292 * pdoms = np.zeros(positions.shape[0], dtype="int64") - 1 * nf = len(fields) * if fields is None: # <<<<<<<<<<<<<< @@ -7817,19 +7985,19 @@ __pyx_t_15 = (__pyx_t_1 != 0); if (__pyx_t_15) { - /* "yt/geometry/particle_smooth.pyx":328 + /* "yt/geometry/particle_smooth.pyx":293 * nf = len(fields) * if fields is None: * fields = [] # <<<<<<<<<<<<<< * field_pointers = alloca(sizeof(np.float64_t *) * nf) * for i in range(nf): */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_fields, __pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/particle_smooth.pyx":327 + /* "yt/geometry/particle_smooth.pyx":292 * pdoms = np.zeros(positions.shape[0], dtype="int64") - 1 * nf = len(fields) * if fields is None: # <<<<<<<<<<<<<< @@ -7838,7 +8006,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":329 + /* "yt/geometry/particle_smooth.pyx":294 * if fields is None: * fields = [] * field_pointers = alloca(sizeof(np.float64_t *) * nf) # <<<<<<<<<<<<<< @@ -7847,7 +8015,7 @@ */ __pyx_v_field_pointers = ((__pyx_t_5numpy_float64_t **)alloca(((sizeof(__pyx_t_5numpy_float64_t *)) * __pyx_v_nf))); - /* "yt/geometry/particle_smooth.pyx":330 + /* "yt/geometry/particle_smooth.pyx":295 * fields = [] * field_pointers = alloca(sizeof(np.float64_t *) * nf) * for i in range(nf): # <<<<<<<<<<<<<< @@ -7858,16 +8026,16 @@ for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_2; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "yt/geometry/particle_smooth.pyx":331 + /* "yt/geometry/particle_smooth.pyx":296 * field_pointers = alloca(sizeof(np.float64_t *) * nf) * for i in range(nf): * tarr = fields[i] # <<<<<<<<<<<<<< * field_pointers[i] = tarr.data * for i in range(3): */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_fields, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_fields, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 331, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 296, __pyx_L1_error) __pyx_t_17 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7883,13 +8051,13 @@ } } __pyx_pybuffernd_tarr.diminfo[0].strides = __pyx_pybuffernd_tarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tarr.diminfo[0].shape = __pyx_pybuffernd_tarr.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 331, __pyx_L1_error) + if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 296, __pyx_L1_error) } __pyx_t_17 = 0; __Pyx_XDECREF_SET(__pyx_v_tarr, ((PyArrayObject *)__pyx_t_7)); __pyx_t_7 = 0; - /* "yt/geometry/particle_smooth.pyx":332 + /* "yt/geometry/particle_smooth.pyx":297 * for i in range(nf): * tarr = fields[i] * field_pointers[i] = tarr.data # <<<<<<<<<<<<<< @@ -7899,7 +8067,7 @@ (__pyx_v_field_pointers[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_tarr->data); } - /* "yt/geometry/particle_smooth.pyx":333 + /* "yt/geometry/particle_smooth.pyx":298 * tarr = fields[i] * field_pointers[i] = tarr.data * for i in range(3): # <<<<<<<<<<<<<< @@ -7909,7 +8077,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_smooth.pyx":334 + /* "yt/geometry/particle_smooth.pyx":299 * field_pointers[i] = tarr.data * for i in range(3): * self.DW[i] = (particle_octree.DRE[i] - particle_octree.DLE[i]) # <<<<<<<<<<<<<< @@ -7918,21 +8086,21 @@ */ (__pyx_v_self->DW[__pyx_v_i]) = ((__pyx_v_particle_octree->DRE[__pyx_v_i]) - (__pyx_v_particle_octree->DLE[__pyx_v_i])); - /* "yt/geometry/particle_smooth.pyx":335 + /* "yt/geometry/particle_smooth.pyx":300 * for i in range(3): * self.DW[i] = (particle_octree.DRE[i] - particle_octree.DLE[i]) * self.periodicity[i] = periodicity[i] # <<<<<<<<<<<<<< * for i in range(positions.shape[0]): * for j in range(3): */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_periodicity, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_periodicity, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; (__pyx_v_self->periodicity[__pyx_v_i]) = __pyx_t_15; } - /* "yt/geometry/particle_smooth.pyx":336 + /* "yt/geometry/particle_smooth.pyx":301 * self.DW[i] = (particle_octree.DRE[i] - particle_octree.DLE[i]) * self.periodicity[i] = periodicity[i] * for i in range(positions.shape[0]): # <<<<<<<<<<<<<< @@ -7943,7 +8111,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_19; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_smooth.pyx":337 + /* "yt/geometry/particle_smooth.pyx":302 * self.periodicity[i] = periodicity[i] * for i in range(positions.shape[0]): * for j in range(3): # <<<<<<<<<<<<<< @@ -7953,7 +8121,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_j = __pyx_t_16; - /* "yt/geometry/particle_smooth.pyx":338 + /* "yt/geometry/particle_smooth.pyx":303 * for i in range(positions.shape[0]): * for j in range(3): * pos[j] = positions[i, j] # <<<<<<<<<<<<<< @@ -7965,7 +8133,7 @@ (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_positions.diminfo[1].strides)); } - /* "yt/geometry/particle_smooth.pyx":339 + /* "yt/geometry/particle_smooth.pyx":304 * for j in range(3): * pos[j] = positions[i, j] * oct = particle_octree.get(pos) # <<<<<<<<<<<<<< @@ -7974,7 +8142,7 @@ */ __pyx_v_oct = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_particle_octree->__pyx_vtab)->get(__pyx_v_particle_octree, __pyx_v_pos, NULL); - /* "yt/geometry/particle_smooth.pyx":340 + /* "yt/geometry/particle_smooth.pyx":305 * pos[j] = positions[i, j] * oct = particle_octree.get(pos) * if oct == NULL or (domain_id > 0 and oct.domain != domain_id): # <<<<<<<<<<<<<< @@ -7998,7 +8166,7 @@ __pyx_L14_bool_binop_done:; if (__pyx_t_15) { - /* "yt/geometry/particle_smooth.pyx":341 + /* "yt/geometry/particle_smooth.pyx":306 * oct = particle_octree.get(pos) * if oct == NULL or (domain_id > 0 and oct.domain != domain_id): * continue # <<<<<<<<<<<<<< @@ -8007,7 +8175,7 @@ */ goto __pyx_L9_continue; - /* "yt/geometry/particle_smooth.pyx":340 + /* "yt/geometry/particle_smooth.pyx":305 * pos[j] = positions[i, j] * oct = particle_octree.get(pos) * if oct == NULL or (domain_id > 0 and oct.domain != domain_id): # <<<<<<<<<<<<<< @@ -8016,7 +8184,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":345 + /* "yt/geometry/particle_smooth.pyx":310 * # This is the particle count, which we'll use once we have sorted * # the particles to calculate the offsets into each oct's particles. * offset = oct.domain_ind - moff_p # <<<<<<<<<<<<<< @@ -8025,7 +8193,7 @@ */ __pyx_v_offset = (__pyx_v_oct->domain_ind - __pyx_v_moff_p); - /* "yt/geometry/particle_smooth.pyx":346 + /* "yt/geometry/particle_smooth.pyx":311 * # the particles to calculate the offsets into each oct's particles. * offset = oct.domain_ind - moff_p * pcount[offset] += 1 # <<<<<<<<<<<<<< @@ -8035,7 +8203,7 @@ __pyx_t_22 = __pyx_v_offset; *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pcount.data + __pyx_t_22 * __pyx_v_pcount.strides[0]) )) += 1; - /* "yt/geometry/particle_smooth.pyx":347 + /* "yt/geometry/particle_smooth.pyx":312 * offset = oct.domain_ind - moff_p * pcount[offset] += 1 * pdoms[i] = offset # We store the *actual* offset. # <<<<<<<<<<<<<< @@ -8047,110 +8215,93 @@ __pyx_L9_continue:; } - /* "yt/geometry/particle_smooth.pyx":352 + /* "yt/geometry/particle_smooth.pyx":317 * # actually be indirectly-sorted fields. This preserves memory at the * # expense of additional pointer lookups. - * pind = np.argsort(pdoms) # <<<<<<<<<<<<<< - * pind = np.asarray(pind, dtype='int64', order='C') + * pind = np.asarray(np.argsort(pdoms), dtype='int64', order='C') # <<<<<<<<<<<<<< * # So what this means is that we now have all the oct-0 particle indices + * # in order, then the oct-1, etc etc. */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_argsort); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_pdoms, 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_6)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_9); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_argsort); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_pdoms, 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_8)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); + __Pyx_DECREF_SET(__pyx_t_9, function); } } - if (!__pyx_t_9) { - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_11) { + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_7); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_8)) { - PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_6}; - __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyFunction_Check(__pyx_t_9)) { + PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_8}; + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_9, __pyx_t_6}; - __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { + PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_8}; + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 352, __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_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_7); - if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_pind = __pyx_t_13; - __pyx_t_13.memview = NULL; - __pyx_t_13.data = NULL; - - /* "yt/geometry/particle_smooth.pyx":353 - * # expense of additional pointer lookups. - * pind = np.argsort(pdoms) - * pind = np.asarray(pind, dtype='int64', order='C') # <<<<<<<<<<<<<< - * # So what this means is that we now have all the oct-0 particle indices - * # in order, then the oct-1, etc etc. - */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_pind, 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_7)) __PYX_ERR(0, 353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 353, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 353, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_6); - if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 353, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 317, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_XDEC_MEMVIEW(&__pyx_v_pind, 1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_12); + if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_v_pind = __pyx_t_13; __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; - /* "yt/geometry/particle_smooth.pyx":357 + /* "yt/geometry/particle_smooth.pyx":321 * # in order, then the oct-1, etc etc. * # This now gives us the indices to the particles for each domain. * for i in range(positions.shape[0]): # <<<<<<<<<<<<<< @@ -8161,7 +8312,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_19; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_smooth.pyx":360 + /* "yt/geometry/particle_smooth.pyx":324 * # This value, poff, is the index of the particle in the *unsorted* * # arrays. * poff = pind[i] # <<<<<<<<<<<<<< @@ -8171,7 +8322,7 @@ __pyx_t_24 = __pyx_v_i; __pyx_v_poff = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pind.data + __pyx_t_24 * __pyx_v_pind.strides[0]) ))); - /* "yt/geometry/particle_smooth.pyx":361 + /* "yt/geometry/particle_smooth.pyx":325 * # arrays. * poff = pind[i] * offset = pdoms[poff] # <<<<<<<<<<<<<< @@ -8181,7 +8332,7 @@ __pyx_t_25 = __pyx_v_poff; __pyx_v_offset = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pdoms.data + __pyx_t_25 * __pyx_v_pdoms.strides[0]) ))); - /* "yt/geometry/particle_smooth.pyx":364 + /* "yt/geometry/particle_smooth.pyx":328 * # If we have yet to assign the starting index to this oct, we do so * # now. * if doff[offset] < 0: doff[offset] = i # <<<<<<<<<<<<<< @@ -8196,27 +8347,56 @@ } } - /* "yt/geometry/particle_smooth.pyx":369 + /* "yt/geometry/particle_smooth.pyx":333 * # Now doff is full of offsets to the first entry in the pind that * # refers to that oct's particles. * cdef int maxnei = 0 # <<<<<<<<<<<<<< * cdef int nproc = 0 - * for i in range(doff.shape[0]): + * # This should be thread-private if we ever go to OpenMP */ __pyx_v_maxnei = 0; - /* "yt/geometry/particle_smooth.pyx":370 + /* "yt/geometry/particle_smooth.pyx":334 * # refers to that oct's particles. * cdef int maxnei = 0 * cdef int nproc = 0 # <<<<<<<<<<<<<< - * for i in range(doff.shape[0]): - * if doff[i] < 0: continue + * # This should be thread-private if we ever go to OpenMP + * cdef DistanceQueue dist_queue = DistanceQueue(self.maxn) */ __pyx_v_nproc = 0; - /* "yt/geometry/particle_smooth.pyx":371 - * cdef int maxnei = 0 + /* "yt/geometry/particle_smooth.pyx":336 * cdef int nproc = 0 + * # This should be thread-private if we ever go to OpenMP + * cdef DistanceQueue dist_queue = DistanceQueue(self.maxn) # <<<<<<<<<<<<<< + * dist_queue._setup(self.DW, self.periodicity) + * for i in range(doff.shape[0]): + */ + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_self->maxn); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue), __pyx_t_7, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_dist_queue = ((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "yt/geometry/particle_smooth.pyx":337 + * # This should be thread-private if we ever go to OpenMP + * cdef DistanceQueue dist_queue = DistanceQueue(self.maxn) + * dist_queue._setup(self.DW, self.periodicity) # <<<<<<<<<<<<<< + * for i in range(doff.shape[0]): + * if doff[i] < 0: continue + */ + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_dist_queue->__pyx_base.__pyx_vtab)->_setup(__pyx_v_dist_queue, __pyx_v_self->DW, __pyx_v_self->periodicity); + + /* "yt/geometry/particle_smooth.pyx":338 + * cdef DistanceQueue dist_queue = DistanceQueue(self.maxn) + * dist_queue._setup(self.DW, self.periodicity) * for i in range(doff.shape[0]): # <<<<<<<<<<<<<< * if doff[i] < 0: continue * offset = pind[doff[i]] @@ -8225,8 +8405,8 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_14; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_smooth.pyx":372 - * cdef int nproc = 0 + /* "yt/geometry/particle_smooth.pyx":339 + * dist_queue._setup(self.DW, self.periodicity) * for i in range(doff.shape[0]): * if doff[i] < 0: continue # <<<<<<<<<<<<<< * offset = pind[doff[i]] @@ -8238,7 +8418,7 @@ goto __pyx_L20_continue; } - /* "yt/geometry/particle_smooth.pyx":373 + /* "yt/geometry/particle_smooth.pyx":340 * for i in range(doff.shape[0]): * if doff[i] < 0: continue * offset = pind[doff[i]] # <<<<<<<<<<<<<< @@ -8249,7 +8429,7 @@ __pyx_t_30 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_doff.data + __pyx_t_29 * __pyx_v_doff.strides[0]) ))); __pyx_v_offset = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pind.data + __pyx_t_30 * __pyx_v_pind.strides[0]) ))); - /* "yt/geometry/particle_smooth.pyx":374 + /* "yt/geometry/particle_smooth.pyx":341 * if doff[i] < 0: continue * offset = pind[doff[i]] * for j in range(3): # <<<<<<<<<<<<<< @@ -8259,7 +8439,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_j = __pyx_t_16; - /* "yt/geometry/particle_smooth.pyx":375 + /* "yt/geometry/particle_smooth.pyx":342 * offset = pind[doff[i]] * for j in range(3): * pos[j] = positions[offset, j] # <<<<<<<<<<<<<< @@ -8271,7 +8451,7 @@ (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_positions.diminfo[1].strides)); } - /* "yt/geometry/particle_smooth.pyx":376 + /* "yt/geometry/particle_smooth.pyx":343 * for j in range(3): * pos[j] = positions[offset, j] * for j in range(pcount[i]): # <<<<<<<<<<<<<< @@ -8283,7 +8463,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_34; __pyx_t_16+=1) { __pyx_v_j = __pyx_t_16; - /* "yt/geometry/particle_smooth.pyx":377 + /* "yt/geometry/particle_smooth.pyx":344 * pos[j] = positions[offset, j] * for j in range(pcount[i]): * pind0 = pind[doff[i] + j] # <<<<<<<<<<<<<< @@ -8294,7 +8474,7 @@ __pyx_t_36 = ((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_doff.data + __pyx_t_35 * __pyx_v_doff.strides[0]) ))) + __pyx_v_j); __pyx_v_pind0 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pind.data + __pyx_t_36 * __pyx_v_pind.strides[0]) ))); - /* "yt/geometry/particle_smooth.pyx":378 + /* "yt/geometry/particle_smooth.pyx":345 * for j in range(pcount[i]): * pind0 = pind[doff[i] + j] * for k in range(3): # <<<<<<<<<<<<<< @@ -8304,7 +8484,7 @@ for (__pyx_t_18 = 0; __pyx_t_18 < 3; __pyx_t_18+=1) { __pyx_v_k = __pyx_t_18; - /* "yt/geometry/particle_smooth.pyx":379 + /* "yt/geometry/particle_smooth.pyx":346 * pind0 = pind[doff[i] + j] * for k in range(3): * pos[k] = positions[pind0, k] # <<<<<<<<<<<<<< @@ -8316,24 +8496,24 @@ (__pyx_v_pos[__pyx_v_k]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_positions.diminfo[1].strides)); } - /* "yt/geometry/particle_smooth.pyx":380 + /* "yt/geometry/particle_smooth.pyx":347 * for k in range(3): * pos[k] = positions[pind0, k] * self.neighbor_process_particle(pos, cart_positions, field_pointers, # <<<<<<<<<<<<<< * doff, &nind, pind, pcount, pind0, - * NULL, particle_octree, domain_id, &nsize) + * NULL, particle_octree, domain_id, &nsize, */ __pyx_t_39 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_cart_positions)); - if (unlikely(!__pyx_t_39.memview)) __PYX_ERR(0, 380, __pyx_L1_error) + if (unlikely(!__pyx_t_39.memview)) __PYX_ERR(0, 347, __pyx_L1_error) - /* "yt/geometry/particle_smooth.pyx":382 - * self.neighbor_process_particle(pos, cart_positions, field_pointers, + /* "yt/geometry/particle_smooth.pyx":350 * doff, &nind, pind, pcount, pind0, - * NULL, particle_octree, domain_id, &nsize) # <<<<<<<<<<<<<< + * NULL, particle_octree, domain_id, &nsize, + * dist_queue) # <<<<<<<<<<<<<< * #print "VISITED", visited.sum(), visited.size, * #print 100.0*float(visited.sum())/visited.size */ - ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_process_particle(__pyx_v_self, __pyx_v_pos, __pyx_t_39, __pyx_v_field_pointers, __pyx_v_doff, (&__pyx_v_nind), __pyx_v_pind, __pyx_v_pcount, __pyx_v_pind0, NULL, __pyx_v_particle_octree, __pyx_v_domain_id, (&__pyx_v_nsize)); + ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_process_particle(__pyx_v_self, __pyx_v_pos, __pyx_t_39, __pyx_v_field_pointers, __pyx_v_doff, (&__pyx_v_nind), __pyx_v_pind, __pyx_v_pcount, __pyx_v_pind0, NULL, __pyx_v_particle_octree, __pyx_v_domain_id, (&__pyx_v_nsize), __pyx_v_dist_queue); __PYX_XDEC_MEMVIEW(&__pyx_t_39, 1); __pyx_t_39.memview = NULL; __pyx_t_39.data = NULL; @@ -8341,7 +8521,7 @@ __pyx_L20_continue:; } - /* "yt/geometry/particle_smooth.pyx":385 + /* "yt/geometry/particle_smooth.pyx":353 * #print "VISITED", visited.sum(), visited.size, * #print 100.0*float(visited.sum())/visited.size * if nind != NULL: # <<<<<<<<<<<<<< @@ -8351,7 +8531,7 @@ __pyx_t_15 = ((__pyx_v_nind != NULL) != 0); if (__pyx_t_15) { - /* "yt/geometry/particle_smooth.pyx":386 + /* "yt/geometry/particle_smooth.pyx":354 * #print 100.0*float(visited.sum())/visited.size * if nind != NULL: * free(nind) # <<<<<<<<<<<<<< @@ -8360,7 +8540,7 @@ */ free(__pyx_v_nind); - /* "yt/geometry/particle_smooth.pyx":385 + /* "yt/geometry/particle_smooth.pyx":353 * #print "VISITED", visited.sum(), visited.size, * #print 100.0*float(visited.sum())/visited.size * if nind != NULL: # <<<<<<<<<<<<<< @@ -8369,7 +8549,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":272 + /* "yt/geometry/particle_smooth.pyx":237 * @cython.wraparound(False) * @cython.initializedcheck(False) * def process_particles(self, OctreeContainer particle_octree, # <<<<<<<<<<<<<< @@ -8413,6 +8593,7 @@ __PYX_XDEC_MEMVIEW(&__pyx_v_pcount, 1); __Pyx_XDECREF((PyObject *)__pyx_v_tarr); __Pyx_XDECREF((PyObject *)__pyx_v_cart_positions); + __Pyx_XDECREF((PyObject *)__pyx_v_dist_queue); __Pyx_XDECREF(__pyx_v_fields); __Pyx_XDECREF(__pyx_v_periodicity); __Pyx_XGIVEREF(__pyx_r); @@ -8420,7 +8601,7 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":388 +/* "yt/geometry/particle_smooth.pyx":356 * free(nind) * * cdef int neighbor_search(self, np.float64_t pos[3], OctreeContainer octree, # <<<<<<<<<<<<<< @@ -8430,7 +8611,7 @@ static int __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t **__pyx_v_nind, int *__pyx_v_nsize, __pyx_t_5numpy_int64_t __pyx_v_nneighbors, __pyx_t_5numpy_int64_t __pyx_v_domain_id, struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search *__pyx_optional_args) { - /* "yt/geometry/particle_smooth.pyx":391 + /* "yt/geometry/particle_smooth.pyx":359 * np.int64_t **nind, int *nsize, * np.int64_t nneighbors, np.int64_t domain_id, * Oct **oct = NULL, int extra_layer = 0): # <<<<<<<<<<<<<< @@ -8470,7 +8651,7 @@ } } - /* "yt/geometry/particle_smooth.pyx":396 + /* "yt/geometry/particle_smooth.pyx":364 * cdef Oct **neighbors * cdef Oct **first_layer * cdef int j, total_neighbors = 0, initial_layer = 0 # <<<<<<<<<<<<<< @@ -8480,7 +8661,7 @@ __pyx_v_total_neighbors = 0; __pyx_v_initial_layer = 0; - /* "yt/geometry/particle_smooth.pyx":397 + /* "yt/geometry/particle_smooth.pyx":365 * cdef Oct **first_layer * cdef int j, total_neighbors = 0, initial_layer = 0 * cdef int layer_ind = 0 # <<<<<<<<<<<<<< @@ -8489,7 +8670,7 @@ */ __pyx_v_layer_ind = 0; - /* "yt/geometry/particle_smooth.pyx":398 + /* "yt/geometry/particle_smooth.pyx":366 * cdef int j, total_neighbors = 0, initial_layer = 0 * cdef int layer_ind = 0 * cdef np.int64_t moff = octree.get_domain_offset(domain_id) # <<<<<<<<<<<<<< @@ -8498,7 +8679,7 @@ */ __pyx_v_moff = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_octree->__pyx_vtab)->get_domain_offset(__pyx_v_octree, __pyx_v_domain_id); - /* "yt/geometry/particle_smooth.pyx":399 + /* "yt/geometry/particle_smooth.pyx":367 * cdef int layer_ind = 0 * cdef np.int64_t moff = octree.get_domain_offset(domain_id) * ooct = octree.get(pos, &oi) # <<<<<<<<<<<<<< @@ -8510,7 +8691,7 @@ __pyx_t_1 = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_octree->__pyx_vtab)->get(__pyx_v_octree, __pyx_v_pos, &__pyx_t_2); __pyx_v_ooct = __pyx_t_1; - /* "yt/geometry/particle_smooth.pyx":400 + /* "yt/geometry/particle_smooth.pyx":368 * cdef np.int64_t moff = octree.get_domain_offset(domain_id) * ooct = octree.get(pos, &oi) * if oct != NULL and ooct == oct[0]: # <<<<<<<<<<<<<< @@ -8528,7 +8709,7 @@ __pyx_L4_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/particle_smooth.pyx":401 + /* "yt/geometry/particle_smooth.pyx":369 * ooct = octree.get(pos, &oi) * if oct != NULL and ooct == oct[0]: * return nneighbors # <<<<<<<<<<<<<< @@ -8538,7 +8719,7 @@ __pyx_r = __pyx_v_nneighbors; goto __pyx_L0; - /* "yt/geometry/particle_smooth.pyx":400 + /* "yt/geometry/particle_smooth.pyx":368 * cdef np.int64_t moff = octree.get_domain_offset(domain_id) * ooct = octree.get(pos, &oi) * if oct != NULL and ooct == oct[0]: # <<<<<<<<<<<<<< @@ -8547,7 +8728,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":402 + /* "yt/geometry/particle_smooth.pyx":370 * if oct != NULL and ooct == oct[0]: * return nneighbors * oct[0] = ooct # <<<<<<<<<<<<<< @@ -8556,7 +8737,7 @@ */ (__pyx_v_oct[0]) = __pyx_v_ooct; - /* "yt/geometry/particle_smooth.pyx":403 + /* "yt/geometry/particle_smooth.pyx":371 * return nneighbors * oct[0] = ooct * if nind[0] == NULL: # <<<<<<<<<<<<<< @@ -8566,7 +8747,7 @@ __pyx_t_3 = (((__pyx_v_nind[0]) == NULL) != 0); if (__pyx_t_3) { - /* "yt/geometry/particle_smooth.pyx":404 + /* "yt/geometry/particle_smooth.pyx":372 * oct[0] = ooct * if nind[0] == NULL: * nsize[0] = 27 # <<<<<<<<<<<<<< @@ -8575,7 +8756,7 @@ */ (__pyx_v_nsize[0]) = 27; - /* "yt/geometry/particle_smooth.pyx":405 + /* "yt/geometry/particle_smooth.pyx":373 * if nind[0] == NULL: * nsize[0] = 27 * nind[0] = malloc(sizeof(np.int64_t)*nsize[0]) # <<<<<<<<<<<<<< @@ -8584,7 +8765,7 @@ */ (__pyx_v_nind[0]) = ((__pyx_t_5numpy_int64_t *)malloc(((sizeof(__pyx_t_5numpy_int64_t)) * (__pyx_v_nsize[0])))); - /* "yt/geometry/particle_smooth.pyx":403 + /* "yt/geometry/particle_smooth.pyx":371 * return nneighbors * oct[0] = ooct * if nind[0] == NULL: # <<<<<<<<<<<<<< @@ -8593,7 +8774,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":409 + /* "yt/geometry/particle_smooth.pyx":377 * # create a master list of neighbors that is much bigger and includes * # everything. * layer_ind = 0 # <<<<<<<<<<<<<< @@ -8602,7 +8783,7 @@ */ __pyx_v_layer_ind = 0; - /* "yt/geometry/particle_smooth.pyx":410 + /* "yt/geometry/particle_smooth.pyx":378 * # everything. * layer_ind = 0 * first_layer = NULL # <<<<<<<<<<<<<< @@ -8611,7 +8792,7 @@ */ __pyx_v_first_layer = NULL; - /* "yt/geometry/particle_smooth.pyx":411 + /* "yt/geometry/particle_smooth.pyx":379 * layer_ind = 0 * first_layer = NULL * while 1: # <<<<<<<<<<<<<< @@ -8620,7 +8801,7 @@ */ while (1) { - /* "yt/geometry/particle_smooth.pyx":412 + /* "yt/geometry/particle_smooth.pyx":380 * first_layer = NULL * while 1: * neighbors = octree.neighbors(&oi, &nneighbors, ooct, self.periodicity) # <<<<<<<<<<<<<< @@ -8629,7 +8810,7 @@ */ __pyx_v_neighbors = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_octree->__pyx_vtab)->neighbors(__pyx_v_octree, (&__pyx_v_oi), (&__pyx_v_nneighbors), __pyx_v_ooct, __pyx_v_self->periodicity); - /* "yt/geometry/particle_smooth.pyx":415 + /* "yt/geometry/particle_smooth.pyx":383 * # Now we have all our neighbors. And, we should be set for what * # else we need to do. * if total_neighbors + nneighbors > nsize[0]: # <<<<<<<<<<<<<< @@ -8639,7 +8820,7 @@ __pyx_t_3 = (((__pyx_v_total_neighbors + __pyx_v_nneighbors) > (__pyx_v_nsize[0])) != 0); if (__pyx_t_3) { - /* "yt/geometry/particle_smooth.pyx":416 + /* "yt/geometry/particle_smooth.pyx":384 * # else we need to do. * if total_neighbors + nneighbors > nsize[0]: * nind[0] = realloc( # <<<<<<<<<<<<<< @@ -8648,7 +8829,7 @@ */ (__pyx_v_nind[0]) = ((__pyx_t_5numpy_int64_t *)realloc((__pyx_v_nind[0]), ((sizeof(__pyx_t_5numpy_int64_t)) * (__pyx_v_nneighbors + __pyx_v_total_neighbors)))); - /* "yt/geometry/particle_smooth.pyx":418 + /* "yt/geometry/particle_smooth.pyx":386 * nind[0] = realloc( * nind[0], sizeof(np.int64_t)*(nneighbors + total_neighbors)) * nsize[0] = nneighbors + total_neighbors # <<<<<<<<<<<<<< @@ -8657,7 +8838,7 @@ */ (__pyx_v_nsize[0]) = (__pyx_v_nneighbors + __pyx_v_total_neighbors); - /* "yt/geometry/particle_smooth.pyx":415 + /* "yt/geometry/particle_smooth.pyx":383 * # Now we have all our neighbors. And, we should be set for what * # else we need to do. * if total_neighbors + nneighbors > nsize[0]: # <<<<<<<<<<<<<< @@ -8666,7 +8847,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":419 + /* "yt/geometry/particle_smooth.pyx":387 * nind[0], sizeof(np.int64_t)*(nneighbors + total_neighbors)) * nsize[0] = nneighbors + total_neighbors * for j in range(nneighbors): # <<<<<<<<<<<<<< @@ -8677,7 +8858,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "yt/geometry/particle_smooth.pyx":421 + /* "yt/geometry/particle_smooth.pyx":389 * for j in range(nneighbors): * # Particle octree neighbor indices * nind[0][j + total_neighbors] = neighbors[j].domain_ind - moff # <<<<<<<<<<<<<< @@ -8687,7 +8868,7 @@ ((__pyx_v_nind[0])[(__pyx_v_j + __pyx_v_total_neighbors)]) = ((__pyx_v_neighbors[__pyx_v_j])->domain_ind - __pyx_v_moff); } - /* "yt/geometry/particle_smooth.pyx":422 + /* "yt/geometry/particle_smooth.pyx":390 * # Particle octree neighbor indices * nind[0][j + total_neighbors] = neighbors[j].domain_ind - moff * total_neighbors += nneighbors # <<<<<<<<<<<<<< @@ -8696,7 +8877,7 @@ */ __pyx_v_total_neighbors = (__pyx_v_total_neighbors + __pyx_v_nneighbors); - /* "yt/geometry/particle_smooth.pyx":423 + /* "yt/geometry/particle_smooth.pyx":391 * nind[0][j + total_neighbors] = neighbors[j].domain_ind - moff * total_neighbors += nneighbors * if extra_layer == 0: # <<<<<<<<<<<<<< @@ -8706,7 +8887,7 @@ __pyx_t_3 = ((__pyx_v_extra_layer == 0) != 0); if (__pyx_t_3) { - /* "yt/geometry/particle_smooth.pyx":425 + /* "yt/geometry/particle_smooth.pyx":393 * if extra_layer == 0: * # Not adding on any additional layers here. * free(neighbors) # <<<<<<<<<<<<<< @@ -8715,7 +8896,7 @@ */ free(__pyx_v_neighbors); - /* "yt/geometry/particle_smooth.pyx":426 + /* "yt/geometry/particle_smooth.pyx":394 * # Not adding on any additional layers here. * free(neighbors) * neighbors = NULL # <<<<<<<<<<<<<< @@ -8724,7 +8905,7 @@ */ __pyx_v_neighbors = NULL; - /* "yt/geometry/particle_smooth.pyx":427 + /* "yt/geometry/particle_smooth.pyx":395 * free(neighbors) * neighbors = NULL * break # <<<<<<<<<<<<<< @@ -8733,7 +8914,7 @@ */ goto __pyx_L8_break; - /* "yt/geometry/particle_smooth.pyx":423 + /* "yt/geometry/particle_smooth.pyx":391 * nind[0][j + total_neighbors] = neighbors[j].domain_ind - moff * total_neighbors += nneighbors * if extra_layer == 0: # <<<<<<<<<<<<<< @@ -8742,7 +8923,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":428 + /* "yt/geometry/particle_smooth.pyx":396 * neighbors = NULL * break * if initial_layer == 0: # <<<<<<<<<<<<<< @@ -8752,7 +8933,7 @@ __pyx_t_3 = ((__pyx_v_initial_layer == 0) != 0); if (__pyx_t_3) { - /* "yt/geometry/particle_smooth.pyx":429 + /* "yt/geometry/particle_smooth.pyx":397 * break * if initial_layer == 0: * initial_layer = nneighbors # <<<<<<<<<<<<<< @@ -8761,7 +8942,7 @@ */ __pyx_v_initial_layer = __pyx_v_nneighbors; - /* "yt/geometry/particle_smooth.pyx":430 + /* "yt/geometry/particle_smooth.pyx":398 * if initial_layer == 0: * initial_layer = nneighbors * first_layer = neighbors # <<<<<<<<<<<<<< @@ -8770,7 +8951,7 @@ */ __pyx_v_first_layer = __pyx_v_neighbors; - /* "yt/geometry/particle_smooth.pyx":428 + /* "yt/geometry/particle_smooth.pyx":396 * neighbors = NULL * break * if initial_layer == 0: # <<<<<<<<<<<<<< @@ -8780,7 +8961,7 @@ goto __pyx_L13; } - /* "yt/geometry/particle_smooth.pyx":434 + /* "yt/geometry/particle_smooth.pyx":402 * # Allocated internally; we free this in the loops if we aren't * # tracking it * free(neighbors) # <<<<<<<<<<<<<< @@ -8790,7 +8971,7 @@ /*else*/ { free(__pyx_v_neighbors); - /* "yt/geometry/particle_smooth.pyx":435 + /* "yt/geometry/particle_smooth.pyx":403 * # tracking it * free(neighbors) * neighbors = NULL # <<<<<<<<<<<<<< @@ -8801,7 +8982,7 @@ } __pyx_L13:; - /* "yt/geometry/particle_smooth.pyx":436 + /* "yt/geometry/particle_smooth.pyx":404 * free(neighbors) * neighbors = NULL * ooct = first_layer[layer_ind] # <<<<<<<<<<<<<< @@ -8810,7 +8991,7 @@ */ __pyx_v_ooct = (__pyx_v_first_layer[__pyx_v_layer_ind]); - /* "yt/geometry/particle_smooth.pyx":437 + /* "yt/geometry/particle_smooth.pyx":405 * neighbors = NULL * ooct = first_layer[layer_ind] * layer_ind += 1 # <<<<<<<<<<<<<< @@ -8819,7 +9000,7 @@ */ __pyx_v_layer_ind = (__pyx_v_layer_ind + 1); - /* "yt/geometry/particle_smooth.pyx":438 + /* "yt/geometry/particle_smooth.pyx":406 * ooct = first_layer[layer_ind] * layer_ind += 1 * if layer_ind == initial_layer: # <<<<<<<<<<<<<< @@ -8829,7 +9010,7 @@ __pyx_t_3 = ((__pyx_v_layer_ind == __pyx_v_initial_layer) != 0); if (__pyx_t_3) { - /* "yt/geometry/particle_smooth.pyx":439 + /* "yt/geometry/particle_smooth.pyx":407 * layer_ind += 1 * if layer_ind == initial_layer: * neighbors # <<<<<<<<<<<<<< @@ -8838,7 +9019,7 @@ */ __pyx_v_neighbors; - /* "yt/geometry/particle_smooth.pyx":440 + /* "yt/geometry/particle_smooth.pyx":408 * if layer_ind == initial_layer: * neighbors * break # <<<<<<<<<<<<<< @@ -8847,7 +9028,7 @@ */ goto __pyx_L8_break; - /* "yt/geometry/particle_smooth.pyx":438 + /* "yt/geometry/particle_smooth.pyx":406 * ooct = first_layer[layer_ind] * layer_ind += 1 * if layer_ind == initial_layer: # <<<<<<<<<<<<<< @@ -8858,7 +9039,7 @@ } __pyx_L8_break:; - /* "yt/geometry/particle_smooth.pyx":443 + /* "yt/geometry/particle_smooth.pyx":411 * * * for j in range(total_neighbors): # <<<<<<<<<<<<<< @@ -8869,7 +9050,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_j = __pyx_t_7; - /* "yt/geometry/particle_smooth.pyx":445 + /* "yt/geometry/particle_smooth.pyx":413 * for j in range(total_neighbors): * # Particle octree neighbor indices * if nind[0][j] == -1: continue # <<<<<<<<<<<<<< @@ -8881,7 +9062,7 @@ goto __pyx_L15_continue; } - /* "yt/geometry/particle_smooth.pyx":446 + /* "yt/geometry/particle_smooth.pyx":414 * # Particle octree neighbor indices * if nind[0][j] == -1: continue * for n in range(j): # <<<<<<<<<<<<<< @@ -8892,7 +9073,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_n = __pyx_t_9; - /* "yt/geometry/particle_smooth.pyx":447 + /* "yt/geometry/particle_smooth.pyx":415 * if nind[0][j] == -1: continue * for n in range(j): * if nind[0][j] == nind[0][n]: # <<<<<<<<<<<<<< @@ -8902,7 +9083,7 @@ __pyx_t_3 = ((((__pyx_v_nind[0])[__pyx_v_j]) == ((__pyx_v_nind[0])[__pyx_v_n])) != 0); if (__pyx_t_3) { - /* "yt/geometry/particle_smooth.pyx":448 + /* "yt/geometry/particle_smooth.pyx":416 * for n in range(j): * if nind[0][j] == nind[0][n]: * nind[0][j] = -1 # <<<<<<<<<<<<<< @@ -8911,7 +9092,7 @@ */ ((__pyx_v_nind[0])[__pyx_v_j]) = -1LL; - /* "yt/geometry/particle_smooth.pyx":447 + /* "yt/geometry/particle_smooth.pyx":415 * if nind[0][j] == -1: continue * for n in range(j): * if nind[0][j] == nind[0][n]: # <<<<<<<<<<<<<< @@ -8923,7 +9104,7 @@ __pyx_L15_continue:; } - /* "yt/geometry/particle_smooth.pyx":450 + /* "yt/geometry/particle_smooth.pyx":418 * nind[0][j] = -1 * # This is allocated by the neighbors function, so we deallocate it. * if first_layer != NULL: # <<<<<<<<<<<<<< @@ -8933,7 +9114,7 @@ __pyx_t_3 = ((__pyx_v_first_layer != NULL) != 0); if (__pyx_t_3) { - /* "yt/geometry/particle_smooth.pyx":451 + /* "yt/geometry/particle_smooth.pyx":419 * # This is allocated by the neighbors function, so we deallocate it. * if first_layer != NULL: * free(first_layer) # <<<<<<<<<<<<<< @@ -8942,7 +9123,7 @@ */ free(__pyx_v_first_layer); - /* "yt/geometry/particle_smooth.pyx":450 + /* "yt/geometry/particle_smooth.pyx":418 * nind[0][j] = -1 * # This is allocated by the neighbors function, so we deallocate it. * if first_layer != NULL: # <<<<<<<<<<<<<< @@ -8951,7 +9132,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":452 + /* "yt/geometry/particle_smooth.pyx":420 * if first_layer != NULL: * free(first_layer) * return total_neighbors # <<<<<<<<<<<<<< @@ -8961,7 +9142,7 @@ __pyx_r = __pyx_v_total_neighbors; goto __pyx_L0; - /* "yt/geometry/particle_smooth.pyx":388 + /* "yt/geometry/particle_smooth.pyx":356 * free(nind) * * cdef int neighbor_search(self, np.float64_t pos[3], OctreeContainer octree, # <<<<<<<<<<<<<< @@ -8975,7 +9156,7 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":458 +/* "yt/geometry/particle_smooth.pyx":426 * @cython.wraparound(False) * @cython.initializedcheck(False) * def process_grid(self, gobj, # <<<<<<<<<<<<<< @@ -8996,7 +9177,7 @@ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gobj,&__pyx_n_s_positions,&__pyx_n_s_fields,0}; PyObject* values[3] = {0,0,0}; - /* "yt/geometry/particle_smooth.pyx":460 + /* "yt/geometry/particle_smooth.pyx":428 * def process_grid(self, gobj, * np.ndarray[np.float64_t, ndim=2] positions, * fields = None): # <<<<<<<<<<<<<< @@ -9009,8 +9190,11 @@ 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; } @@ -9019,11 +9203,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gobj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("process_grid", 0, 2, 3, 1); __PYX_ERR(0, 458, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("process_grid", 0, 2, 3, 1); __PYX_ERR(0, 426, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields); @@ -9031,11 +9217,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_grid") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_grid") < 0)) __PYX_ERR(0, 426, __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; @@ -9048,16 +9235,16 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("process_grid", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("process_grid", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 426, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.process_grid", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_positions), __pyx_ptype_5numpy_ndarray, 1, "positions", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_positions), __pyx_ptype_5numpy_ndarray, 1, "positions", 0))) __PYX_ERR(0, 427, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_10process_grid(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self), __pyx_v_gobj, __pyx_v_positions, __pyx_v_fields); - /* "yt/geometry/particle_smooth.pyx":458 + /* "yt/geometry/particle_smooth.pyx":426 * @cython.wraparound(False) * @cython.initializedcheck(False) * def process_grid(self, gobj, # <<<<<<<<<<<<<< @@ -9086,11 +9273,11 @@ __pyx_pybuffernd_positions.rcbuffer = &__pyx_pybuffer_positions; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_positions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_positions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 426, __pyx_L1_error) } __pyx_pybuffernd_positions.diminfo[0].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_positions.diminfo[0].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_positions.diminfo[1].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_positions.diminfo[1].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[1]; - /* "yt/geometry/particle_smooth.pyx":461 + /* "yt/geometry/particle_smooth.pyx":429 * np.ndarray[np.float64_t, ndim=2] positions, * fields = None): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -9098,9 +9285,9 @@ * cdef void process(self, np.int64_t offset, int i, int j, int k, */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 461, __pyx_L1_error) + __PYX_ERR(0, 429, __pyx_L1_error) - /* "yt/geometry/particle_smooth.pyx":458 + /* "yt/geometry/particle_smooth.pyx":426 * @cython.wraparound(False) * @cython.initializedcheck(False) * def process_grid(self, gobj, # <<<<<<<<<<<<<< @@ -9126,435 +9313,43 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":463 +/* "yt/geometry/particle_smooth.pyx":431 * raise NotImplementedError * * cdef void process(self, np.int64_t offset, int i, int j, int k, # <<<<<<<<<<<<<< * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **ifields): + * np.float64_t **ifields, DistanceQueue dq): */ -static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_ifields) { +static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_ifields, CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_smooth.pyx":466 + /* "yt/geometry/particle_smooth.pyx":434 * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **ifields): + * np.float64_t **ifields, DistanceQueue dq): * raise NotImplementedError # <<<<<<<<<<<<<< * - * cdef void neighbor_reset(self): + * @cython.cdivision(True) */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 466, __pyx_L1_error) + __PYX_ERR(0, 434, __pyx_L1_error) - /* "yt/geometry/particle_smooth.pyx":463 + /* "yt/geometry/particle_smooth.pyx":431 * raise NotImplementedError * * cdef void process(self, np.int64_t offset, int i, int j, int k, # <<<<<<<<<<<<<< * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **ifields): + * np.float64_t **ifields, DistanceQueue dq): */ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_smooth.ParticleSmoothOperation.process", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __Pyx_RefNannyFinishContext(); -} - -/* "yt/geometry/particle_smooth.pyx":468 - * raise NotImplementedError - * - * cdef void neighbor_reset(self): # <<<<<<<<<<<<<< - * self.curn = 0 - * for i in range(self.maxn): - */ - -static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_reset(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self) { - int __pyx_v_i; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("neighbor_reset", 0); - - /* "yt/geometry/particle_smooth.pyx":469 - * - * cdef void neighbor_reset(self): - * self.curn = 0 # <<<<<<<<<<<<<< - * for i in range(self.maxn): - * self.neighbors[i].pn = -1 - */ - __pyx_v_self->curn = 0; - - /* "yt/geometry/particle_smooth.pyx":470 - * cdef void neighbor_reset(self): - * self.curn = 0 - * for i in range(self.maxn): # <<<<<<<<<<<<<< - * self.neighbors[i].pn = -1 - * self.neighbors[i].r2 = 1e300 - */ - __pyx_t_1 = __pyx_v_self->maxn; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; - - /* "yt/geometry/particle_smooth.pyx":471 - * self.curn = 0 - * for i in range(self.maxn): - * self.neighbors[i].pn = -1 # <<<<<<<<<<<<<< - * self.neighbors[i].r2 = 1e300 - * - */ - (__pyx_v_self->neighbors[__pyx_v_i]).pn = -1LL; - - /* "yt/geometry/particle_smooth.pyx":472 - * for i in range(self.maxn): - * self.neighbors[i].pn = -1 - * self.neighbors[i].r2 = 1e300 # <<<<<<<<<<<<<< - * - * cdef void neighbor_eval(self, np.int64_t pn, np.float64_t ppos[3], - */ - (__pyx_v_self->neighbors[__pyx_v_i]).r2 = 1e300; - } - - /* "yt/geometry/particle_smooth.pyx":468 - * raise NotImplementedError - * - * cdef void neighbor_reset(self): # <<<<<<<<<<<<<< - * self.curn = 0 - * for i in range(self.maxn): - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "yt/geometry/particle_smooth.pyx":474 - * self.neighbors[i].r2 = 1e300 - * - * cdef void neighbor_eval(self, np.int64_t pn, np.float64_t ppos[3], # <<<<<<<<<<<<<< - * np.float64_t cpos[3]): - * # Here's a python+numpy simulator of this: - */ - -static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_eval(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_pn, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __pyx_t_5numpy_float64_t *__pyx_v_cpos) { - int __pyx_v_i; - int __pyx_v_di; - __pyx_t_5numpy_float64_t __pyx_v_r2; - __pyx_t_5numpy_float64_t __pyx_v_r2_trunc; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __pyx_t_5numpy_float64_t __pyx_t_2; - int __pyx_t_3; - __Pyx_RefNannySetupContext("neighbor_eval", 0); - - /* "yt/geometry/particle_smooth.pyx":480 - * cdef int i, di - * cdef np.float64_t r2, r2_trunc - * if self.curn == self.maxn: # <<<<<<<<<<<<<< - * # Truncate calculation if it's bigger than this in any dimension - * r2_trunc = self.neighbors[self.curn - 1].r2 - */ - __pyx_t_1 = ((__pyx_v_self->curn == __pyx_v_self->maxn) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/particle_smooth.pyx":482 - * if self.curn == self.maxn: - * # Truncate calculation if it's bigger than this in any dimension - * r2_trunc = self.neighbors[self.curn - 1].r2 # <<<<<<<<<<<<<< - * else: - * # Don't truncate our calculation - */ - __pyx_t_2 = (__pyx_v_self->neighbors[(__pyx_v_self->curn - 1)]).r2; - __pyx_v_r2_trunc = __pyx_t_2; - - /* "yt/geometry/particle_smooth.pyx":480 - * cdef int i, di - * cdef np.float64_t r2, r2_trunc - * if self.curn == self.maxn: # <<<<<<<<<<<<<< - * # Truncate calculation if it's bigger than this in any dimension - * r2_trunc = self.neighbors[self.curn - 1].r2 - */ - goto __pyx_L3; - } - - /* "yt/geometry/particle_smooth.pyx":485 - * else: - * # Don't truncate our calculation - * r2_trunc = -1 # <<<<<<<<<<<<<< - * r2 = r2dist(ppos, cpos, self.DW, self.periodicity, r2_trunc) - * if r2 == -1: - */ - /*else*/ { - __pyx_v_r2_trunc = -1.0; - } - __pyx_L3:; - - /* "yt/geometry/particle_smooth.pyx":486 - * # Don't truncate our calculation - * r2_trunc = -1 - * r2 = r2dist(ppos, cpos, self.DW, self.periodicity, r2_trunc) # <<<<<<<<<<<<<< - * if r2 == -1: - * return - */ - __pyx_v_r2 = __pyx_f_2yt_8geometry_15particle_smooth_r2dist(__pyx_v_ppos, __pyx_v_cpos, __pyx_v_self->DW, __pyx_v_self->periodicity, __pyx_v_r2_trunc); - - /* "yt/geometry/particle_smooth.pyx":487 - * r2_trunc = -1 - * r2 = r2dist(ppos, cpos, self.DW, self.periodicity, r2_trunc) - * if r2 == -1: # <<<<<<<<<<<<<< - * return - * if self.curn == 0: - */ - __pyx_t_1 = ((__pyx_v_r2 == -1.0) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/particle_smooth.pyx":488 - * r2 = r2dist(ppos, cpos, self.DW, self.periodicity, r2_trunc) - * if r2 == -1: - * return # <<<<<<<<<<<<<< - * if self.curn == 0: - * self.neighbors[0].r2 = r2 - */ - goto __pyx_L0; - - /* "yt/geometry/particle_smooth.pyx":487 - * r2_trunc = -1 - * r2 = r2dist(ppos, cpos, self.DW, self.periodicity, r2_trunc) - * if r2 == -1: # <<<<<<<<<<<<<< - * return - * if self.curn == 0: - */ - } - - /* "yt/geometry/particle_smooth.pyx":489 - * if r2 == -1: - * return - * if self.curn == 0: # <<<<<<<<<<<<<< - * self.neighbors[0].r2 = r2 - * self.neighbors[0].pn = pn - */ - __pyx_t_1 = ((__pyx_v_self->curn == 0) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/particle_smooth.pyx":490 - * return - * if self.curn == 0: - * self.neighbors[0].r2 = r2 # <<<<<<<<<<<<<< - * self.neighbors[0].pn = pn - * self.curn += 1 - */ - (__pyx_v_self->neighbors[0]).r2 = __pyx_v_r2; - - /* "yt/geometry/particle_smooth.pyx":491 - * if self.curn == 0: - * self.neighbors[0].r2 = r2 - * self.neighbors[0].pn = pn # <<<<<<<<<<<<<< - * self.curn += 1 - * return - */ - (__pyx_v_self->neighbors[0]).pn = __pyx_v_pn; - - /* "yt/geometry/particle_smooth.pyx":492 - * self.neighbors[0].r2 = r2 - * self.neighbors[0].pn = pn - * self.curn += 1 # <<<<<<<<<<<<<< - * return - * # Now insert in a sorted way - */ - __pyx_v_self->curn = (__pyx_v_self->curn + 1); - - /* "yt/geometry/particle_smooth.pyx":493 - * self.neighbors[0].pn = pn - * self.curn += 1 - * return # <<<<<<<<<<<<<< - * # Now insert in a sorted way - * di = -1 - */ - goto __pyx_L0; - - /* "yt/geometry/particle_smooth.pyx":489 - * if r2 == -1: - * return - * if self.curn == 0: # <<<<<<<<<<<<<< - * self.neighbors[0].r2 = r2 - * self.neighbors[0].pn = pn - */ - } - - /* "yt/geometry/particle_smooth.pyx":495 - * return - * # Now insert in a sorted way - * di = -1 # <<<<<<<<<<<<<< - * for i in range(self.curn - 1, -1, -1): - * # We are checking if i is less than us, to see if we should insert - */ - __pyx_v_di = -1; - - /* "yt/geometry/particle_smooth.pyx":496 - * # Now insert in a sorted way - * di = -1 - * for i in range(self.curn - 1, -1, -1): # <<<<<<<<<<<<<< - * # We are checking if i is less than us, to see if we should insert - * # to the right (i.e., i+1). - */ - for (__pyx_t_3 = (__pyx_v_self->curn - 1); __pyx_t_3 > -1L; __pyx_t_3-=1) { - __pyx_v_i = __pyx_t_3; - - /* "yt/geometry/particle_smooth.pyx":499 - * # We are checking if i is less than us, to see if we should insert - * # to the right (i.e., i+1). - * if self.neighbors[i].r2 < r2: # <<<<<<<<<<<<<< - * di = i - * break - */ - __pyx_t_1 = (((__pyx_v_self->neighbors[__pyx_v_i]).r2 < __pyx_v_r2) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/particle_smooth.pyx":500 - * # to the right (i.e., i+1). - * if self.neighbors[i].r2 < r2: - * di = i # <<<<<<<<<<<<<< - * break - * # The outermost one is already too small. - */ - __pyx_v_di = __pyx_v_i; - - /* "yt/geometry/particle_smooth.pyx":501 - * if self.neighbors[i].r2 < r2: - * di = i - * break # <<<<<<<<<<<<<< - * # The outermost one is already too small. - * if di == self.maxn - 1: - */ - goto __pyx_L7_break; - - /* "yt/geometry/particle_smooth.pyx":499 - * # We are checking if i is less than us, to see if we should insert - * # to the right (i.e., i+1). - * if self.neighbors[i].r2 < r2: # <<<<<<<<<<<<<< - * di = i - * break - */ - } - } - __pyx_L7_break:; - - /* "yt/geometry/particle_smooth.pyx":503 - * break - * # The outermost one is already too small. - * if di == self.maxn - 1: # <<<<<<<<<<<<<< - * return - * if (self.maxn - (di + 2)) > 0: - */ - __pyx_t_1 = ((__pyx_v_di == (__pyx_v_self->maxn - 1)) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/particle_smooth.pyx":504 - * # The outermost one is already too small. - * if di == self.maxn - 1: - * return # <<<<<<<<<<<<<< - * if (self.maxn - (di + 2)) > 0: - * memmove( (self.neighbors + di + 2), - */ - goto __pyx_L0; - - /* "yt/geometry/particle_smooth.pyx":503 - * break - * # The outermost one is already too small. - * if di == self.maxn - 1: # <<<<<<<<<<<<<< - * return - * if (self.maxn - (di + 2)) > 0: - */ - } - - /* "yt/geometry/particle_smooth.pyx":505 - * if di == self.maxn - 1: - * return - * if (self.maxn - (di + 2)) > 0: # <<<<<<<<<<<<<< - * memmove( (self.neighbors + di + 2), - * (self.neighbors + di + 1), - */ - __pyx_t_1 = (((__pyx_v_self->maxn - (__pyx_v_di + 2)) > 0) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/particle_smooth.pyx":506 - * return - * if (self.maxn - (di + 2)) > 0: - * memmove( (self.neighbors + di + 2), # <<<<<<<<<<<<<< - * (self.neighbors + di + 1), - * sizeof(NeighborList) * (self.maxn - (di + 2))) - */ - memmove(((void *)((__pyx_v_self->neighbors + __pyx_v_di) + 2)), ((void *)((__pyx_v_self->neighbors + __pyx_v_di) + 1)), ((sizeof(struct __pyx_t_2yt_8geometry_15particle_smooth_NeighborList)) * (__pyx_v_self->maxn - (__pyx_v_di + 2)))); - - /* "yt/geometry/particle_smooth.pyx":505 - * if di == self.maxn - 1: - * return - * if (self.maxn - (di + 2)) > 0: # <<<<<<<<<<<<<< - * memmove( (self.neighbors + di + 2), - * (self.neighbors + di + 1), - */ - } - - /* "yt/geometry/particle_smooth.pyx":509 - * (self.neighbors + di + 1), - * sizeof(NeighborList) * (self.maxn - (di + 2))) - * self.neighbors[di + 1].r2 = r2 # <<<<<<<<<<<<<< - * self.neighbors[di + 1].pn = pn - * if self.curn < self.maxn: - */ - (__pyx_v_self->neighbors[(__pyx_v_di + 1)]).r2 = __pyx_v_r2; - - /* "yt/geometry/particle_smooth.pyx":510 - * sizeof(NeighborList) * (self.maxn - (di + 2))) - * self.neighbors[di + 1].r2 = r2 - * self.neighbors[di + 1].pn = pn # <<<<<<<<<<<<<< - * if self.curn < self.maxn: - * self.curn += 1 - */ - (__pyx_v_self->neighbors[(__pyx_v_di + 1)]).pn = __pyx_v_pn; - - /* "yt/geometry/particle_smooth.pyx":511 - * self.neighbors[di + 1].r2 = r2 - * self.neighbors[di + 1].pn = pn - * if self.curn < self.maxn: # <<<<<<<<<<<<<< - * self.curn += 1 - * - */ - __pyx_t_1 = ((__pyx_v_self->curn < __pyx_v_self->maxn) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/particle_smooth.pyx":512 - * self.neighbors[di + 1].pn = pn - * if self.curn < self.maxn: - * self.curn += 1 # <<<<<<<<<<<<<< - * - * @cython.cdivision(True) - */ - __pyx_v_self->curn = (__pyx_v_self->curn + 1); - - /* "yt/geometry/particle_smooth.pyx":511 - * self.neighbors[di + 1].r2 = r2 - * self.neighbors[di + 1].pn = pn - * if self.curn < self.maxn: # <<<<<<<<<<<<<< - * self.curn += 1 - * - */ - } - - /* "yt/geometry/particle_smooth.pyx":474 - * self.neighbors[i].r2 = 1e300 - * - * cdef void neighbor_eval(self, np.int64_t pn, np.float64_t ppos[3], # <<<<<<<<<<<<<< - * np.float64_t cpos[3]): - * # Here's a python+numpy simulator of this: - */ - - /* function exit code */ - __pyx_L0:; + __Pyx_WriteUnraisable("yt.geometry.particle_smooth.ParticleSmoothOperation.process", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_smooth.pyx":518 +/* "yt/geometry/particle_smooth.pyx":440 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void neighbor_find(self, # <<<<<<<<<<<<<< @@ -9562,7 +9357,7 @@ * np.int64_t *nind, */ -static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_find(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_nneighbors, __pyx_t_5numpy_int64_t *__pyx_v_nind, __Pyx_memviewslice __pyx_v_doffs, __Pyx_memviewslice __pyx_v_pcounts, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __Pyx_memviewslice __pyx_v_oct_left_edges, __Pyx_memviewslice __pyx_v_oct_dds) { +static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_find(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_nneighbors, __pyx_t_5numpy_int64_t *__pyx_v_nind, __Pyx_memviewslice __pyx_v_doffs, __Pyx_memviewslice __pyx_v_pcounts, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __Pyx_memviewslice __pyx_v_oct_left_edges, __Pyx_memviewslice __pyx_v_oct_dds, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) { int __pyx_v_ni; int __pyx_v_i; int __pyx_v_j; @@ -9597,18 +9392,18 @@ Py_ssize_t __pyx_t_18; __Pyx_RefNannySetupContext("neighbor_find", 0); - /* "yt/geometry/particle_smooth.pyx":537 + /* "yt/geometry/particle_smooth.pyx":460 * cdef np.float64_t DR[2] * cdef np.float64_t cp, r2_trunc, r2, dist - * self.neighbor_reset() # <<<<<<<<<<<<<< + * dq.neighbor_reset() # <<<<<<<<<<<<<< * for ni in range(nneighbors): * if nind[ni] == -1: continue */ - ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_reset(__pyx_v_self); + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_dq->__pyx_base.__pyx_vtab)->neighbor_reset(__pyx_v_dq); - /* "yt/geometry/particle_smooth.pyx":538 + /* "yt/geometry/particle_smooth.pyx":461 * cdef np.float64_t cp, r2_trunc, r2, dist - * self.neighbor_reset() + * dq.neighbor_reset() * for ni in range(nneighbors): # <<<<<<<<<<<<<< * if nind[ni] == -1: continue * # terminate early if all 8 corners of oct are farther away than @@ -9617,8 +9412,8 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_ni = __pyx_t_2; - /* "yt/geometry/particle_smooth.pyx":539 - * self.neighbor_reset() + /* "yt/geometry/particle_smooth.pyx":462 + * dq.neighbor_reset() * for ni in range(nneighbors): * if nind[ni] == -1: continue # <<<<<<<<<<<<<< * # terminate early if all 8 corners of oct are farther away than @@ -9629,11 +9424,11 @@ goto __pyx_L3_continue; } - /* "yt/geometry/particle_smooth.pyx":542 + /* "yt/geometry/particle_smooth.pyx":465 * # terminate early if all 8 corners of oct are farther away than * # most distant currently known neighbor - * if oct_left_edges != None and self.curn == self.maxn: # <<<<<<<<<<<<<< - * r2_trunc = self.neighbors[self.curn - 1].r2 + * if oct_left_edges != None and dq.curn == dq.maxn: # <<<<<<<<<<<<<< + * r2_trunc = dq.neighbors[dq.curn - 1].r2 * # iterate over each dimension in the outer loop so we can */ __pyx_t_4 = ((((PyObject *) __pyx_v_oct_left_edges.memview) != Py_None) != 0); @@ -9642,22 +9437,22 @@ __pyx_t_3 = __pyx_t_4; goto __pyx_L7_bool_binop_done; } - __pyx_t_4 = ((__pyx_v_self->curn == __pyx_v_self->maxn) != 0); + __pyx_t_4 = ((__pyx_v_dq->__pyx_base.curn == __pyx_v_dq->__pyx_base.maxn) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/particle_smooth.pyx":543 + /* "yt/geometry/particle_smooth.pyx":466 * # most distant currently known neighbor - * if oct_left_edges != None and self.curn == self.maxn: - * r2_trunc = self.neighbors[self.curn - 1].r2 # <<<<<<<<<<<<<< + * if oct_left_edges != None and dq.curn == dq.maxn: + * r2_trunc = dq.neighbors[dq.curn - 1].r2 # <<<<<<<<<<<<<< * # iterate over each dimension in the outer loop so we can * # consolidate temporary storage */ - __pyx_t_5 = (__pyx_v_self->neighbors[(__pyx_v_self->curn - 1)]).r2; + __pyx_t_5 = (__pyx_v_dq->neighbors[(__pyx_v_dq->__pyx_base.curn - 1)]).r2; __pyx_v_r2_trunc = __pyx_t_5; - /* "yt/geometry/particle_smooth.pyx":549 + /* "yt/geometry/particle_smooth.pyx":472 * # closest, of each possible permutation. * # k here is the dimension * r2 = 0.0 # <<<<<<<<<<<<<< @@ -9666,7 +9461,7 @@ */ __pyx_v_r2 = 0.0; - /* "yt/geometry/particle_smooth.pyx":550 + /* "yt/geometry/particle_smooth.pyx":473 * # k here is the dimension * r2 = 0.0 * for k in range(3): # <<<<<<<<<<<<<< @@ -9676,7 +9471,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "yt/geometry/particle_smooth.pyx":552 + /* "yt/geometry/particle_smooth.pyx":475 * for k in range(3): * # We start at left edge, then do halfway, then right edge. * ex[0] = oct_left_edges[nind[ni], k] # <<<<<<<<<<<<<< @@ -9687,7 +9482,7 @@ __pyx_t_8 = __pyx_v_k; (__pyx_v_ex[0]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_oct_left_edges.data + __pyx_t_7 * __pyx_v_oct_left_edges.strides[0]) ) + __pyx_t_8 * __pyx_v_oct_left_edges.strides[1]) ))); - /* "yt/geometry/particle_smooth.pyx":553 + /* "yt/geometry/particle_smooth.pyx":476 * # We start at left edge, then do halfway, then right edge. * ex[0] = oct_left_edges[nind[ni], k] * ex[1] = ex[0] + oct_dds[nind[ni], k] # <<<<<<<<<<<<<< @@ -9698,7 +9493,7 @@ __pyx_t_10 = __pyx_v_k; (__pyx_v_ex[1]) = ((__pyx_v_ex[0]) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_oct_dds.data + __pyx_t_9 * __pyx_v_oct_dds.strides[0]) ) + __pyx_t_10 * __pyx_v_oct_dds.strides[1]) )))); - /* "yt/geometry/particle_smooth.pyx":559 + /* "yt/geometry/particle_smooth.pyx":482 * # for some help. This has been modified to account for * # periodicity. * dist = 0.0 # <<<<<<<<<<<<<< @@ -9707,7 +9502,7 @@ */ __pyx_v_dist = 0.0; - /* "yt/geometry/particle_smooth.pyx":560 + /* "yt/geometry/particle_smooth.pyx":483 * # periodicity. * dist = 0.0 * DR[0] = (ex[0] - cpos[k]) # <<<<<<<<<<<<<< @@ -9716,7 +9511,7 @@ */ (__pyx_v_DR[0]) = ((__pyx_v_ex[0]) - (__pyx_v_cpos[__pyx_v_k])); - /* "yt/geometry/particle_smooth.pyx":561 + /* "yt/geometry/particle_smooth.pyx":484 * dist = 0.0 * DR[0] = (ex[0] - cpos[k]) * DR[1] = (cpos[k] - ex[1]) # <<<<<<<<<<<<<< @@ -9725,7 +9520,7 @@ */ (__pyx_v_DR[1]) = ((__pyx_v_cpos[__pyx_v_k]) - (__pyx_v_ex[1])); - /* "yt/geometry/particle_smooth.pyx":562 + /* "yt/geometry/particle_smooth.pyx":485 * DR[0] = (ex[0] - cpos[k]) * DR[1] = (cpos[k] - ex[1]) * for j in range(2): # <<<<<<<<<<<<<< @@ -9735,7 +9530,7 @@ for (__pyx_t_11 = 0; __pyx_t_11 < 2; __pyx_t_11+=1) { __pyx_v_j = __pyx_t_11; - /* "yt/geometry/particle_smooth.pyx":563 + /* "yt/geometry/particle_smooth.pyx":486 * DR[1] = (cpos[k] - ex[1]) * for j in range(2): * if not self.periodicity[k]: # <<<<<<<<<<<<<< @@ -9747,7 +9542,7 @@ goto __pyx_L13; } - /* "yt/geometry/particle_smooth.pyx":565 + /* "yt/geometry/particle_smooth.pyx":488 * if not self.periodicity[k]: * pass * elif (DR[j] > self.DW[k]/2.0): # <<<<<<<<<<<<<< @@ -9757,7 +9552,7 @@ __pyx_t_3 = (((__pyx_v_DR[__pyx_v_j]) > ((__pyx_v_self->DW[__pyx_v_k]) / 2.0)) != 0); if (__pyx_t_3) { - /* "yt/geometry/particle_smooth.pyx":566 + /* "yt/geometry/particle_smooth.pyx":489 * pass * elif (DR[j] > self.DW[k]/2.0): * DR[j] -= self.DW[k] # <<<<<<<<<<<<<< @@ -9767,7 +9562,7 @@ __pyx_t_12 = __pyx_v_j; (__pyx_v_DR[__pyx_t_12]) = ((__pyx_v_DR[__pyx_t_12]) - (__pyx_v_self->DW[__pyx_v_k])); - /* "yt/geometry/particle_smooth.pyx":565 + /* "yt/geometry/particle_smooth.pyx":488 * if not self.periodicity[k]: * pass * elif (DR[j] > self.DW[k]/2.0): # <<<<<<<<<<<<<< @@ -9777,7 +9572,7 @@ goto __pyx_L13; } - /* "yt/geometry/particle_smooth.pyx":567 + /* "yt/geometry/particle_smooth.pyx":490 * elif (DR[j] > self.DW[k]/2.0): * DR[j] -= self.DW[k] * elif (DR[j] < -self.DW[k]/2.0): # <<<<<<<<<<<<<< @@ -9787,7 +9582,7 @@ __pyx_t_3 = (((__pyx_v_DR[__pyx_v_j]) < ((-(__pyx_v_self->DW[__pyx_v_k])) / 2.0)) != 0); if (__pyx_t_3) { - /* "yt/geometry/particle_smooth.pyx":568 + /* "yt/geometry/particle_smooth.pyx":491 * DR[j] -= self.DW[k] * elif (DR[j] < -self.DW[k]/2.0): * DR[j] += self.DW[k] # <<<<<<<<<<<<<< @@ -9797,7 +9592,7 @@ __pyx_t_12 = __pyx_v_j; (__pyx_v_DR[__pyx_t_12]) = ((__pyx_v_DR[__pyx_t_12]) + (__pyx_v_self->DW[__pyx_v_k])); - /* "yt/geometry/particle_smooth.pyx":567 + /* "yt/geometry/particle_smooth.pyx":490 * elif (DR[j] > self.DW[k]/2.0): * DR[j] -= self.DW[k] * elif (DR[j] < -self.DW[k]/2.0): # <<<<<<<<<<<<<< @@ -9807,7 +9602,7 @@ } __pyx_L13:; - /* "yt/geometry/particle_smooth.pyx":569 + /* "yt/geometry/particle_smooth.pyx":492 * elif (DR[j] < -self.DW[k]/2.0): * DR[j] += self.DW[k] * dist = fmax(dist, DR[j]) # <<<<<<<<<<<<<< @@ -9817,7 +9612,7 @@ __pyx_v_dist = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_dist, (__pyx_v_DR[__pyx_v_j])); } - /* "yt/geometry/particle_smooth.pyx":570 + /* "yt/geometry/particle_smooth.pyx":493 * DR[j] += self.DW[k] * dist = fmax(dist, DR[j]) * r2 += dist*dist # <<<<<<<<<<<<<< @@ -9827,7 +9622,7 @@ __pyx_v_r2 = (__pyx_v_r2 + (__pyx_v_dist * __pyx_v_dist)); } - /* "yt/geometry/particle_smooth.pyx":571 + /* "yt/geometry/particle_smooth.pyx":494 * dist = fmax(dist, DR[j]) * r2 += dist*dist * if r2 > r2_trunc: # <<<<<<<<<<<<<< @@ -9837,7 +9632,7 @@ __pyx_t_3 = ((__pyx_v_r2 > __pyx_v_r2_trunc) != 0); if (__pyx_t_3) { - /* "yt/geometry/particle_smooth.pyx":572 + /* "yt/geometry/particle_smooth.pyx":495 * r2 += dist*dist * if r2 > r2_trunc: * continue # <<<<<<<<<<<<<< @@ -9846,7 +9641,7 @@ */ goto __pyx_L3_continue; - /* "yt/geometry/particle_smooth.pyx":571 + /* "yt/geometry/particle_smooth.pyx":494 * dist = fmax(dist, DR[j]) * r2 += dist*dist * if r2 > r2_trunc: # <<<<<<<<<<<<<< @@ -9855,16 +9650,16 @@ */ } - /* "yt/geometry/particle_smooth.pyx":542 + /* "yt/geometry/particle_smooth.pyx":465 * # terminate early if all 8 corners of oct are farther away than * # most distant currently known neighbor - * if oct_left_edges != None and self.curn == self.maxn: # <<<<<<<<<<<<<< - * r2_trunc = self.neighbors[self.curn - 1].r2 + * if oct_left_edges != None and dq.curn == dq.maxn: # <<<<<<<<<<<<<< + * r2_trunc = dq.neighbors[dq.curn - 1].r2 * # iterate over each dimension in the outer loop so we can */ } - /* "yt/geometry/particle_smooth.pyx":573 + /* "yt/geometry/particle_smooth.pyx":496 * if r2 > r2_trunc: * continue * offset = doffs[nind[ni]] # <<<<<<<<<<<<<< @@ -9874,7 +9669,7 @@ __pyx_t_13 = (__pyx_v_nind[__pyx_v_ni]); __pyx_v_offset = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_doffs.data + __pyx_t_13 * __pyx_v_doffs.strides[0]) ))); - /* "yt/geometry/particle_smooth.pyx":574 + /* "yt/geometry/particle_smooth.pyx":497 * continue * offset = doffs[nind[ni]] * pc = pcounts[nind[ni]] # <<<<<<<<<<<<<< @@ -9884,7 +9679,7 @@ __pyx_t_14 = (__pyx_v_nind[__pyx_v_ni]); __pyx_v_pc = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pcounts.data + __pyx_t_14 * __pyx_v_pcounts.strides[0]) ))); - /* "yt/geometry/particle_smooth.pyx":575 + /* "yt/geometry/particle_smooth.pyx":498 * offset = doffs[nind[ni]] * pc = pcounts[nind[ni]] * for i in range(pc): # <<<<<<<<<<<<<< @@ -9895,7 +9690,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_15; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/particle_smooth.pyx":576 + /* "yt/geometry/particle_smooth.pyx":499 * pc = pcounts[nind[ni]] * for i in range(pc): * pn = pinds[offset + i] # <<<<<<<<<<<<<< @@ -9905,21 +9700,21 @@ __pyx_t_16 = (__pyx_v_offset + __pyx_v_i); __pyx_v_pn = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_pinds.data + __pyx_t_16 * __pyx_v_pinds.strides[0]) ))); - /* "yt/geometry/particle_smooth.pyx":577 + /* "yt/geometry/particle_smooth.pyx":500 * for i in range(pc): * pn = pinds[offset + i] * for j in range(3): # <<<<<<<<<<<<<< * pos[j] = ppos[pn, j] - * self.neighbor_eval(pn, pos, cpos) + * dq.neighbor_eval(pn, pos, cpos) */ for (__pyx_t_11 = 0; __pyx_t_11 < 3; __pyx_t_11+=1) { __pyx_v_j = __pyx_t_11; - /* "yt/geometry/particle_smooth.pyx":578 + /* "yt/geometry/particle_smooth.pyx":501 * pn = pinds[offset + i] * for j in range(3): * pos[j] = ppos[pn, j] # <<<<<<<<<<<<<< - * self.neighbor_eval(pn, pos, cpos) + * dq.neighbor_eval(pn, pos, cpos) * */ __pyx_t_17 = __pyx_v_pn; @@ -9927,19 +9722,19 @@ (__pyx_v_pos[__pyx_v_j]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_ppos.data + __pyx_t_17 * __pyx_v_ppos.strides[0]) ) + __pyx_t_18 * __pyx_v_ppos.strides[1]) ))); } - /* "yt/geometry/particle_smooth.pyx":579 + /* "yt/geometry/particle_smooth.pyx":502 * for j in range(3): * pos[j] = ppos[pn, j] - * self.neighbor_eval(pn, pos, cpos) # <<<<<<<<<<<<<< + * dq.neighbor_eval(pn, pos, cpos) # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ - ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_eval(__pyx_v_self, __pyx_v_pn, __pyx_v_pos, __pyx_v_cpos); + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_dq->__pyx_base.__pyx_vtab)->neighbor_eval(__pyx_v_dq, __pyx_v_pn, __pyx_v_pos, __pyx_v_cpos); } __pyx_L3_continue:; } - /* "yt/geometry/particle_smooth.pyx":518 + /* "yt/geometry/particle_smooth.pyx":440 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void neighbor_find(self, # <<<<<<<<<<<<<< @@ -9951,7 +9746,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_smooth.pyx":585 +/* "yt/geometry/particle_smooth.pyx":508 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void neighbor_process(self, int dim[3], np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -9959,7 +9754,7 @@ * np.float64_t **fields, */ -static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __Pyx_memviewslice __pyx_v_doffs, __pyx_t_5numpy_int64_t **__pyx_v_nind, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_pcounts, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t __pyx_v_domain_id, int *__pyx_v_nsize, __Pyx_memviewslice __pyx_v_oct_left_edges, __Pyx_memviewslice __pyx_v_oct_dds) { +static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, int *__pyx_v_dim, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_dds, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __Pyx_memviewslice __pyx_v_doffs, __pyx_t_5numpy_int64_t **__pyx_v_nind, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_pcounts, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t __pyx_v_domain_id, int *__pyx_v_nsize, __Pyx_memviewslice __pyx_v_oct_left_edges, __Pyx_memviewslice __pyx_v_oct_dds, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) { int __pyx_v_i; int __pyx_v_j; int __pyx_v_k; @@ -9990,7 +9785,7 @@ long __pyx_t_17; __Pyx_RefNannySetupContext("neighbor_process", 0); - /* "yt/geometry/particle_smooth.pyx":601 + /* "yt/geometry/particle_smooth.pyx":525 * cdef np.float64_t cpos[3] * cdef np.float64_t opos[3] * cdef Oct* oct = NULL # <<<<<<<<<<<<<< @@ -9999,7 +9794,7 @@ */ __pyx_v_oct = NULL; - /* "yt/geometry/particle_smooth.pyx":602 + /* "yt/geometry/particle_smooth.pyx":526 * cdef np.float64_t opos[3] * cdef Oct* oct = NULL * cpos[0] = left_edge[0] + 0.5*dds[0] # <<<<<<<<<<<<<< @@ -10008,7 +9803,7 @@ */ (__pyx_v_cpos[0]) = ((__pyx_v_left_edge[0]) + (0.5 * (__pyx_v_dds[0]))); - /* "yt/geometry/particle_smooth.pyx":603 + /* "yt/geometry/particle_smooth.pyx":527 * cdef Oct* oct = NULL * cpos[0] = left_edge[0] + 0.5*dds[0] * for i in range(dim[0]): # <<<<<<<<<<<<<< @@ -10019,7 +9814,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/particle_smooth.pyx":604 + /* "yt/geometry/particle_smooth.pyx":528 * cpos[0] = left_edge[0] + 0.5*dds[0] * for i in range(dim[0]): * cpos[1] = left_edge[1] + 0.5*dds[1] # <<<<<<<<<<<<<< @@ -10028,7 +9823,7 @@ */ (__pyx_v_cpos[1]) = ((__pyx_v_left_edge[1]) + (0.5 * (__pyx_v_dds[1]))); - /* "yt/geometry/particle_smooth.pyx":605 + /* "yt/geometry/particle_smooth.pyx":529 * for i in range(dim[0]): * cpos[1] = left_edge[1] + 0.5*dds[1] * for j in range(dim[1]): # <<<<<<<<<<<<<< @@ -10039,7 +9834,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/geometry/particle_smooth.pyx":606 + /* "yt/geometry/particle_smooth.pyx":530 * cpos[1] = left_edge[1] + 0.5*dds[1] * for j in range(dim[1]): * cpos[2] = left_edge[2] + 0.5*dds[2] # <<<<<<<<<<<<<< @@ -10048,7 +9843,7 @@ */ (__pyx_v_cpos[2]) = ((__pyx_v_left_edge[2]) + (0.5 * (__pyx_v_dds[2]))); - /* "yt/geometry/particle_smooth.pyx":607 + /* "yt/geometry/particle_smooth.pyx":531 * for j in range(dim[1]): * cpos[2] = left_edge[2] + 0.5*dds[2] * for k in range(dim[2]): # <<<<<<<<<<<<<< @@ -10059,7 +9854,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "yt/geometry/particle_smooth.pyx":608 + /* "yt/geometry/particle_smooth.pyx":532 * cpos[2] = left_edge[2] + 0.5*dds[2] * for k in range(dim[2]): * self.pos_setup(cpos, opos) # <<<<<<<<<<<<<< @@ -10068,7 +9863,7 @@ */ __pyx_v_self->pos_setup(__pyx_v_cpos, __pyx_v_opos); - /* "yt/geometry/particle_smooth.pyx":609 + /* "yt/geometry/particle_smooth.pyx":533 * for k in range(dim[2]): * self.pos_setup(cpos, opos) * nneighbors = self.neighbor_search(opos, octree, # <<<<<<<<<<<<<< @@ -10081,28 +9876,28 @@ __pyx_t_7 = ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_search(__pyx_v_self, __pyx_v_opos, __pyx_v_octree, __pyx_v_nind, __pyx_v_nsize, __pyx_v_nneighbors, __pyx_v_domain_id, &__pyx_t_8); __pyx_v_nneighbors = __pyx_t_7; - /* "yt/geometry/particle_smooth.pyx":611 + /* "yt/geometry/particle_smooth.pyx":535 * nneighbors = self.neighbor_search(opos, octree, * nind, nsize, nneighbors, domain_id, &oct, 0) * self.neighbor_find(nneighbors, nind[0], doffs, pcounts, # <<<<<<<<<<<<<< - * pinds, ppos, opos, oct_left_edges, oct_dds) - * # Now we have all our neighbors in our neighbor list. + * pinds, ppos, opos, oct_left_edges, + * oct_dds, dq) */ - ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_find(__pyx_v_self, __pyx_v_nneighbors, (__pyx_v_nind[0]), __pyx_v_doffs, __pyx_v_pcounts, __pyx_v_pinds, __pyx_v_ppos, __pyx_v_opos, __pyx_v_oct_left_edges, __pyx_v_oct_dds); + ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_find(__pyx_v_self, __pyx_v_nneighbors, (__pyx_v_nind[0]), __pyx_v_doffs, __pyx_v_pcounts, __pyx_v_pinds, __pyx_v_ppos, __pyx_v_opos, __pyx_v_oct_left_edges, __pyx_v_oct_dds, __pyx_v_dq); - /* "yt/geometry/particle_smooth.pyx":614 - * pinds, ppos, opos, oct_left_edges, oct_dds) + /* "yt/geometry/particle_smooth.pyx":539 + * oct_dds, dq) * # Now we have all our neighbors in our neighbor list. - * if self.curn <-1*self.maxn: # <<<<<<<<<<<<<< + * if dq.curn <-1*dq.maxn: # <<<<<<<<<<<<<< * ntot = nntot = 0 * for m in range(nneighbors): */ - __pyx_t_9 = ((__pyx_v_self->curn < (-1L * __pyx_v_self->maxn)) != 0); + __pyx_t_9 = ((__pyx_v_dq->__pyx_base.curn < (-1L * __pyx_v_dq->__pyx_base.maxn)) != 0); if (__pyx_t_9) { - /* "yt/geometry/particle_smooth.pyx":615 + /* "yt/geometry/particle_smooth.pyx":540 * # Now we have all our neighbors in our neighbor list. - * if self.curn <-1*self.maxn: + * if dq.curn <-1*dq.maxn: * ntot = nntot = 0 # <<<<<<<<<<<<<< * for m in range(nneighbors): * if nind[0][m] < 0: continue @@ -10110,8 +9905,8 @@ __pyx_v_ntot = 0; __pyx_v_nntot = 0; - /* "yt/geometry/particle_smooth.pyx":616 - * if self.curn <-1*self.maxn: + /* "yt/geometry/particle_smooth.pyx":541 + * if dq.curn <-1*dq.maxn: * ntot = nntot = 0 * for m in range(nneighbors): # <<<<<<<<<<<<<< * if nind[0][m] < 0: continue @@ -10121,7 +9916,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_7; __pyx_t_10+=1) { __pyx_v_m = __pyx_t_10; - /* "yt/geometry/particle_smooth.pyx":617 + /* "yt/geometry/particle_smooth.pyx":542 * ntot = nntot = 0 * for m in range(nneighbors): * if nind[0][m] < 0: continue # <<<<<<<<<<<<<< @@ -10133,20 +9928,20 @@ goto __pyx_L10_continue; } - /* "yt/geometry/particle_smooth.pyx":618 + /* "yt/geometry/particle_smooth.pyx":543 * for m in range(nneighbors): * if nind[0][m] < 0: continue * nntot += 1 # <<<<<<<<<<<<<< * ntot += pcounts[nind[0][m]] - * print "SOMETHING WRONG", self.curn, nneighbors, ntot, nntot + * print "SOMETHING WRONG", dq.curn, nneighbors, ntot, nntot */ __pyx_v_nntot = (__pyx_v_nntot + 1); - /* "yt/geometry/particle_smooth.pyx":619 + /* "yt/geometry/particle_smooth.pyx":544 * if nind[0][m] < 0: continue * nntot += 1 * ntot += pcounts[nind[0][m]] # <<<<<<<<<<<<<< - * print "SOMETHING WRONG", self.curn, nneighbors, ntot, nntot + * print "SOMETHING WRONG", dq.curn, nneighbors, ntot, nntot * self.process(offset, i, j, k, dim, opos, fields, */ __pyx_t_11 = ((__pyx_v_nind[0])[__pyx_v_m]); @@ -10154,22 +9949,22 @@ __pyx_L10_continue:; } - /* "yt/geometry/particle_smooth.pyx":620 + /* "yt/geometry/particle_smooth.pyx":545 * nntot += 1 * ntot += pcounts[nind[0][m]] - * print "SOMETHING WRONG", self.curn, nneighbors, ntot, nntot # <<<<<<<<<<<<<< + * print "SOMETHING WRONG", dq.curn, nneighbors, ntot, nntot # <<<<<<<<<<<<<< * self.process(offset, i, j, k, dim, opos, fields, - * index_fields) + * index_fields, dq) */ - __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_self->curn); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_dq->__pyx_base.curn); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_nneighbors); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_nneighbors); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_ntot); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_ntot); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_nntot); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_nntot); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = PyTuple_New(5); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_16 = PyTuple_New(5); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_kp_s_SOMETHING_WRONG); __Pyx_GIVEREF(__pyx_kp_s_SOMETHING_WRONG); @@ -10186,30 +9981,30 @@ __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; - if (__Pyx_Print(0, __pyx_t_16, 1) < 0) __PYX_ERR(0, 620, __pyx_L1_error) + if (__Pyx_Print(0, __pyx_t_16, 1) < 0) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - /* "yt/geometry/particle_smooth.pyx":614 - * pinds, ppos, opos, oct_left_edges, oct_dds) + /* "yt/geometry/particle_smooth.pyx":539 + * oct_dds, dq) * # Now we have all our neighbors in our neighbor list. - * if self.curn <-1*self.maxn: # <<<<<<<<<<<<<< + * if dq.curn <-1*dq.maxn: # <<<<<<<<<<<<<< * ntot = nntot = 0 * for m in range(nneighbors): */ } - /* "yt/geometry/particle_smooth.pyx":621 + /* "yt/geometry/particle_smooth.pyx":546 * ntot += pcounts[nind[0][m]] - * print "SOMETHING WRONG", self.curn, nneighbors, ntot, nntot + * print "SOMETHING WRONG", dq.curn, nneighbors, ntot, nntot * self.process(offset, i, j, k, dim, opos, fields, # <<<<<<<<<<<<<< - * index_fields) + * index_fields, dq) * cpos[2] += dds[2] */ - ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->process(__pyx_v_self, __pyx_v_offset, __pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim, __pyx_v_opos, __pyx_v_fields, __pyx_v_index_fields); + ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->process(__pyx_v_self, __pyx_v_offset, __pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim, __pyx_v_opos, __pyx_v_fields, __pyx_v_index_fields, __pyx_v_dq); - /* "yt/geometry/particle_smooth.pyx":623 + /* "yt/geometry/particle_smooth.pyx":548 * self.process(offset, i, j, k, dim, opos, fields, - * index_fields) + * index_fields, dq) * cpos[2] += dds[2] # <<<<<<<<<<<<<< * cpos[1] += dds[1] * cpos[0] += dds[0] @@ -10218,8 +10013,8 @@ (__pyx_v_cpos[__pyx_t_17]) = ((__pyx_v_cpos[__pyx_t_17]) + (__pyx_v_dds[2])); } - /* "yt/geometry/particle_smooth.pyx":624 - * index_fields) + /* "yt/geometry/particle_smooth.pyx":549 + * index_fields, dq) * cpos[2] += dds[2] * cpos[1] += dds[1] # <<<<<<<<<<<<<< * cpos[0] += dds[0] @@ -10229,7 +10024,7 @@ (__pyx_v_cpos[__pyx_t_17]) = ((__pyx_v_cpos[__pyx_t_17]) + (__pyx_v_dds[1])); } - /* "yt/geometry/particle_smooth.pyx":625 + /* "yt/geometry/particle_smooth.pyx":550 * cpos[2] += dds[2] * cpos[1] += dds[1] * cpos[0] += dds[0] # <<<<<<<<<<<<<< @@ -10240,7 +10035,7 @@ (__pyx_v_cpos[__pyx_t_17]) = ((__pyx_v_cpos[__pyx_t_17]) + (__pyx_v_dds[0])); } - /* "yt/geometry/particle_smooth.pyx":585 + /* "yt/geometry/particle_smooth.pyx":508 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void neighbor_process(self, int dim[3], np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -10256,12 +10051,12 @@ __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); - __Pyx_WriteUnraisable("yt.geometry.particle_smooth.ParticleSmoothOperation.neighbor_process", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.particle_smooth.ParticleSmoothOperation.neighbor_process", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_smooth.pyx":631 +/* "yt/geometry/particle_smooth.pyx":556 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void neighbor_process_particle(self, np.float64_t cpos[3], # <<<<<<<<<<<<<< @@ -10269,7 +10064,7 @@ * np.float64_t **fields, */ -static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process_particle(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __Pyx_memviewslice __pyx_v_doffs, __pyx_t_5numpy_int64_t **__pyx_v_nind, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_pcounts, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t __pyx_v_domain_id, int *__pyx_v_nsize) { +static void __pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process_particle(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __Pyx_memviewslice __pyx_v_ppos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __Pyx_memviewslice __pyx_v_doffs, __pyx_t_5numpy_int64_t **__pyx_v_nind, __Pyx_memviewslice __pyx_v_pinds, __Pyx_memviewslice __pyx_v_pcounts, __pyx_t_5numpy_int64_t __pyx_v_offset, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, __pyx_t_5numpy_int64_t __pyx_v_domain_id, int *__pyx_v_nsize, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) { int __pyx_v_i; int __pyx_v_j; int __pyx_v_k; @@ -10284,7 +10079,7 @@ __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_RefNannySetupContext("neighbor_process_particle", 0); - /* "yt/geometry/particle_smooth.pyx":645 + /* "yt/geometry/particle_smooth.pyx":571 * cdef int i, j, k, ntot, nntot, m * cdef int dim[3] * cdef Oct *oct = NULL # <<<<<<<<<<<<<< @@ -10293,7 +10088,7 @@ */ __pyx_v_oct = NULL; - /* "yt/geometry/particle_smooth.pyx":646 + /* "yt/geometry/particle_smooth.pyx":572 * cdef int dim[3] * cdef Oct *oct = NULL * cdef np.int64_t nneighbors = 0 # <<<<<<<<<<<<<< @@ -10302,7 +10097,7 @@ */ __pyx_v_nneighbors = 0; - /* "yt/geometry/particle_smooth.pyx":647 + /* "yt/geometry/particle_smooth.pyx":573 * cdef Oct *oct = NULL * cdef np.int64_t nneighbors = 0 * i = j = k = 0 # <<<<<<<<<<<<<< @@ -10313,7 +10108,7 @@ __pyx_v_j = 0; __pyx_v_k = 0; - /* "yt/geometry/particle_smooth.pyx":648 + /* "yt/geometry/particle_smooth.pyx":574 * cdef np.int64_t nneighbors = 0 * i = j = k = 0 * dim[0] = dim[1] = dim[2] = 1 # <<<<<<<<<<<<<< @@ -10324,7 +10119,7 @@ (__pyx_v_dim[1]) = 1; (__pyx_v_dim[2]) = 1; - /* "yt/geometry/particle_smooth.pyx":650 + /* "yt/geometry/particle_smooth.pyx":576 * dim[0] = dim[1] = dim[2] = 1 * cdef np.float64_t opos[3] * self.pos_setup(cpos, opos) # <<<<<<<<<<<<<< @@ -10333,7 +10128,7 @@ */ __pyx_v_self->pos_setup(__pyx_v_cpos, __pyx_v_opos); - /* "yt/geometry/particle_smooth.pyx":651 + /* "yt/geometry/particle_smooth.pyx":577 * cdef np.float64_t opos[3] * self.pos_setup(cpos, opos) * nneighbors = self.neighbor_search(opos, octree, # <<<<<<<<<<<<<< @@ -10346,26 +10141,26 @@ __pyx_t_1 = ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_search(__pyx_v_self, __pyx_v_opos, __pyx_v_octree, __pyx_v_nind, __pyx_v_nsize, __pyx_v_nneighbors, __pyx_v_domain_id, &__pyx_t_2); __pyx_v_nneighbors = __pyx_t_1; - /* "yt/geometry/particle_smooth.pyx":654 + /* "yt/geometry/particle_smooth.pyx":580 * nind, nsize, nneighbors, domain_id, &oct, 0) * self.neighbor_find(nneighbors, nind[0], doffs, pcounts, pinds, ppos, - * opos, None, None) # <<<<<<<<<<<<<< - * self.process(offset, i, j, k, dim, opos, fields, index_fields) + * opos, None, None, dq) # <<<<<<<<<<<<<< + * self.process(offset, i, j, k, dim, opos, fields, index_fields, dq) * */ __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(Py_None); - if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 580, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(Py_None); - if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 580, __pyx_L1_error) - /* "yt/geometry/particle_smooth.pyx":653 + /* "yt/geometry/particle_smooth.pyx":579 * nneighbors = self.neighbor_search(opos, octree, * nind, nsize, nneighbors, domain_id, &oct, 0) * self.neighbor_find(nneighbors, nind[0], doffs, pcounts, pinds, ppos, # <<<<<<<<<<<<<< - * opos, None, None) - * self.process(offset, i, j, k, dim, opos, fields, index_fields) + * opos, None, None, dq) + * self.process(offset, i, j, k, dim, opos, fields, index_fields, dq) */ - ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_find(__pyx_v_self, __pyx_v_nneighbors, (__pyx_v_nind[0]), __pyx_v_doffs, __pyx_v_pcounts, __pyx_v_pinds, __pyx_v_ppos, __pyx_v_opos, __pyx_t_3, __pyx_t_4); + ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->neighbor_find(__pyx_v_self, __pyx_v_nneighbors, (__pyx_v_nind[0]), __pyx_v_doffs, __pyx_v_pcounts, __pyx_v_pinds, __pyx_v_ppos, __pyx_v_opos, __pyx_t_3, __pyx_t_4, __pyx_v_dq); __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1); __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; @@ -10373,16 +10168,16 @@ __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL; - /* "yt/geometry/particle_smooth.pyx":655 + /* "yt/geometry/particle_smooth.pyx":581 * self.neighbor_find(nneighbors, nind[0], doffs, pcounts, pinds, ppos, - * opos, None, None) - * self.process(offset, i, j, k, dim, opos, fields, index_fields) # <<<<<<<<<<<<<< + * opos, None, None, dq) + * self.process(offset, i, j, k, dim, opos, fields, index_fields, dq) # <<<<<<<<<<<<<< * * cdef class VolumeWeightedSmooth(ParticleSmoothOperation): */ - ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->process(__pyx_v_self, __pyx_v_offset, __pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim, __pyx_v_opos, __pyx_v_fields, __pyx_v_index_fields); + ((struct __pyx_vtabstruct_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self->__pyx_vtab)->process(__pyx_v_self, __pyx_v_offset, __pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim, __pyx_v_opos, __pyx_v_fields, __pyx_v_index_fields, __pyx_v_dq); - /* "yt/geometry/particle_smooth.pyx":631 + /* "yt/geometry/particle_smooth.pyx":556 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void neighbor_process_particle(self, np.float64_t cpos[3], # <<<<<<<<<<<<<< @@ -10395,12 +10190,12 @@ __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1); - __Pyx_WriteUnraisable("yt.geometry.particle_smooth.ParticleSmoothOperation.neighbor_process_particle", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.particle_smooth.ParticleSmoothOperation.neighbor_process_particle", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_smooth.pxd":38 +/* "yt/geometry/particle_smooth.pxd":35 * # We assume each will allocate and define their own temporary storage * cdef kernel_func sph_kernel * cdef public object nvals # <<<<<<<<<<<<<< @@ -10495,7 +10290,114 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":666 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_13__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_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_12__reduce_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__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.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, 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.pos_setup,self.sph_kernel 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("yt.geometry.particle_smooth.ParticleSmoothOperation.__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.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_15__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_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_14__setstate_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *__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.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, 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.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_smooth.ParticleSmoothOperation.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_smooth.pyx":592 * cdef np.float64_t **fp * cdef public object vals * def initialize(self): # <<<<<<<<<<<<<< @@ -10531,7 +10433,7 @@ int __pyx_t_8; __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_smooth.pyx":668 + /* "yt/geometry/particle_smooth.pyx":594 * def initialize(self): * cdef int i * if self.nfields < 4: # <<<<<<<<<<<<<< @@ -10541,7 +10443,7 @@ __pyx_t_1 = ((__pyx_v_self->__pyx_base.nfields < 4) != 0); if (__pyx_t_1) { - /* "yt/geometry/particle_smooth.pyx":672 + /* "yt/geometry/particle_smooth.pyx":598 * # smoothing length for particles, the normalization factor to * # ensure mass conservation, then the field we're smoothing. * raise RuntimeError # <<<<<<<<<<<<<< @@ -10549,9 +10451,9 @@ * self.fp = malloc( */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 672, __pyx_L1_error) + __PYX_ERR(0, 598, __pyx_L1_error) - /* "yt/geometry/particle_smooth.pyx":668 + /* "yt/geometry/particle_smooth.pyx":594 * def initialize(self): * cdef int i * if self.nfields < 4: # <<<<<<<<<<<<<< @@ -10560,7 +10462,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":674 + /* "yt/geometry/particle_smooth.pyx":600 * raise RuntimeError * cdef np.ndarray tarr * self.fp = malloc( # <<<<<<<<<<<<<< @@ -10569,14 +10471,14 @@ */ __pyx_v_self->fp = ((__pyx_t_5numpy_float64_t **)malloc(((sizeof(__pyx_t_5numpy_float64_t *)) * (__pyx_v_self->__pyx_base.nfields - 3)))); - /* "yt/geometry/particle_smooth.pyx":676 + /* "yt/geometry/particle_smooth.pyx":602 * self.fp = malloc( * sizeof(np.float64_t *) * (self.nfields - 3)) * self.vals = [] # <<<<<<<<<<<<<< * # We usually only allocate one field; if we are doing multiple field, * # single-pass smoothing, then we might have more. */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->vals); @@ -10584,7 +10486,7 @@ __pyx_v_self->vals = __pyx_t_2; __pyx_t_2 = 0; - /* "yt/geometry/particle_smooth.pyx":679 + /* "yt/geometry/particle_smooth.pyx":605 * # We usually only allocate one field; if we are doing multiple field, * # single-pass smoothing, then we might have more. * for i in range(self.nfields - 3): # <<<<<<<<<<<<<< @@ -10595,46 +10497,46 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/particle_smooth.pyx":680 + /* "yt/geometry/particle_smooth.pyx":606 * # single-pass smoothing, then we might have more. * for i in range(self.nfields - 3): * tarr = np.zeros(self.nvals, dtype="float64", order="F") # <<<<<<<<<<<<<< * self.vals.append(tarr) * self.fp[i] = tarr.data */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 680, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 680, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 606, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 606, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 680, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_tarr, ((PyArrayObject *)__pyx_t_7)); __pyx_t_7 = 0; - /* "yt/geometry/particle_smooth.pyx":681 + /* "yt/geometry/particle_smooth.pyx":607 * for i in range(self.nfields - 3): * tarr = np.zeros(self.nvals, dtype="float64", order="F") * self.vals.append(tarr) # <<<<<<<<<<<<<< * self.fp[i] = tarr.data * */ - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_self->vals, ((PyObject *)__pyx_v_tarr)); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_self->vals, ((PyObject *)__pyx_v_tarr)); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 607, __pyx_L1_error) - /* "yt/geometry/particle_smooth.pyx":682 + /* "yt/geometry/particle_smooth.pyx":608 * tarr = np.zeros(self.nvals, dtype="float64", order="F") * self.vals.append(tarr) * self.fp[i] = tarr.data # <<<<<<<<<<<<<< @@ -10644,7 +10546,7 @@ (__pyx_v_self->fp[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_tarr->data); } - /* "yt/geometry/particle_smooth.pyx":666 + /* "yt/geometry/particle_smooth.pyx":592 * cdef np.float64_t **fp * cdef public object vals * def initialize(self): # <<<<<<<<<<<<<< @@ -10669,7 +10571,7 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":684 +/* "yt/geometry/particle_smooth.pyx":610 * self.fp[i] = tarr.data * * def finalize(self): # <<<<<<<<<<<<<< @@ -10695,7 +10597,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_smooth.pyx":685 + /* "yt/geometry/particle_smooth.pyx":611 * * def finalize(self): * free(self.fp) # <<<<<<<<<<<<<< @@ -10704,7 +10606,7 @@ */ free(__pyx_v_self->fp); - /* "yt/geometry/particle_smooth.pyx":686 + /* "yt/geometry/particle_smooth.pyx":612 * def finalize(self): * free(self.fp) * return self.vals # <<<<<<<<<<<<<< @@ -10716,7 +10618,7 @@ __pyx_r = __pyx_v_self->vals; goto __pyx_L0; - /* "yt/geometry/particle_smooth.pyx":684 + /* "yt/geometry/particle_smooth.pyx":610 * self.fp[i] = tarr.data * * def finalize(self): # <<<<<<<<<<<<<< @@ -10731,15 +10633,15 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":692 +/* "yt/geometry/particle_smooth.pyx":618 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void process(self, np.int64_t offset, int i, int j, int k, # <<<<<<<<<<<<<< * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **index_fields): + * np.float64_t **index_fields, DistanceQueue dq): */ -static void __pyx_f_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __pyx_t_5numpy_float64_t **__pyx_v_index_fields) { +static void __pyx_f_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) { int __pyx_v_n; int __pyx_v_fi; __pyx_t_5numpy_float64_t __pyx_v_weight; @@ -10766,7 +10668,7 @@ int __pyx_t_8; __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_smooth.pyx":700 + /* "yt/geometry/particle_smooth.pyx":626 * cdef np.float64_t weight, r2, val, hsml, dens, mass, coeff, max_r * cdef np.float64_t max_hsml, ihsml, ihsml3, kern * coeff = 0.0 # <<<<<<<<<<<<<< @@ -10775,57 +10677,57 @@ */ __pyx_v_coeff = 0.0; - /* "yt/geometry/particle_smooth.pyx":704 + /* "yt/geometry/particle_smooth.pyx":630 * # We get back our mass * # rho_i = sum(j = 1 .. n) m_j * W_ij - * max_r = sqrt(self.neighbors[self.curn-1].r2) # <<<<<<<<<<<<<< + * max_r = sqrt(dq.neighbors[dq.curn-1].r2) # <<<<<<<<<<<<<< * max_hsml = index_fields[0][gind(i,j,k,dim) + offset] - * for n in range(self.curn): + * for n in range(dq.curn): */ - __pyx_v_max_r = sqrt((__pyx_v_self->__pyx_base.neighbors[(__pyx_v_self->__pyx_base.curn - 1)]).r2); + __pyx_v_max_r = sqrt((__pyx_v_dq->neighbors[(__pyx_v_dq->__pyx_base.curn - 1)]).r2); - /* "yt/geometry/particle_smooth.pyx":705 + /* "yt/geometry/particle_smooth.pyx":631 * # rho_i = sum(j = 1 .. n) m_j * W_ij - * max_r = sqrt(self.neighbors[self.curn-1].r2) + * max_r = sqrt(dq.neighbors[dq.curn-1].r2) * max_hsml = index_fields[0][gind(i,j,k,dim) + offset] # <<<<<<<<<<<<<< - * for n in range(self.curn): + * for n in range(dq.curn): * # No normalization for the moment. */ __pyx_v_max_hsml = ((__pyx_v_index_fields[0])[(__pyx_f_2yt_8geometry_16particle_deposit_gind(__pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim) + __pyx_v_offset)]); - /* "yt/geometry/particle_smooth.pyx":706 - * max_r = sqrt(self.neighbors[self.curn-1].r2) + /* "yt/geometry/particle_smooth.pyx":632 + * max_r = sqrt(dq.neighbors[dq.curn-1].r2) * max_hsml = index_fields[0][gind(i,j,k,dim) + offset] - * for n in range(self.curn): # <<<<<<<<<<<<<< + * for n in range(dq.curn): # <<<<<<<<<<<<<< * # No normalization for the moment. * # fields[0] is the smoothing length. */ - __pyx_t_1 = __pyx_v_self->__pyx_base.curn; + __pyx_t_1 = __pyx_v_dq->__pyx_base.curn; for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_n = __pyx_t_2; - /* "yt/geometry/particle_smooth.pyx":709 + /* "yt/geometry/particle_smooth.pyx":635 * # No normalization for the moment. * # fields[0] is the smoothing length. - * r2 = self.neighbors[n].r2 # <<<<<<<<<<<<<< - * pn = self.neighbors[n].pn + * r2 = dq.neighbors[n].r2 # <<<<<<<<<<<<<< + * pn = dq.neighbors[n].pn * # Smoothing kernel weight function */ - __pyx_t_3 = (__pyx_v_self->__pyx_base.neighbors[__pyx_v_n]).r2; + __pyx_t_3 = (__pyx_v_dq->neighbors[__pyx_v_n]).r2; __pyx_v_r2 = __pyx_t_3; - /* "yt/geometry/particle_smooth.pyx":710 + /* "yt/geometry/particle_smooth.pyx":636 * # fields[0] is the smoothing length. - * r2 = self.neighbors[n].r2 - * pn = self.neighbors[n].pn # <<<<<<<<<<<<<< + * r2 = dq.neighbors[n].r2 + * pn = dq.neighbors[n].pn # <<<<<<<<<<<<<< * # Smoothing kernel weight function * mass = fields[0][pn] */ - __pyx_t_4 = (__pyx_v_self->__pyx_base.neighbors[__pyx_v_n]).pn; + __pyx_t_4 = (__pyx_v_dq->neighbors[__pyx_v_n]).pn; __pyx_v_pn = __pyx_t_4; - /* "yt/geometry/particle_smooth.pyx":712 - * pn = self.neighbors[n].pn + /* "yt/geometry/particle_smooth.pyx":638 + * pn = dq.neighbors[n].pn * # Smoothing kernel weight function * mass = fields[0][pn] # <<<<<<<<<<<<<< * hsml = fields[1][pn] @@ -10833,7 +10735,7 @@ */ __pyx_v_mass = ((__pyx_v_fields[0])[__pyx_v_pn]); - /* "yt/geometry/particle_smooth.pyx":713 + /* "yt/geometry/particle_smooth.pyx":639 * # Smoothing kernel weight function * mass = fields[0][pn] * hsml = fields[1][pn] # <<<<<<<<<<<<<< @@ -10842,7 +10744,7 @@ */ __pyx_v_hsml = ((__pyx_v_fields[1])[__pyx_v_pn]); - /* "yt/geometry/particle_smooth.pyx":714 + /* "yt/geometry/particle_smooth.pyx":640 * mass = fields[0][pn] * hsml = fields[1][pn] * dens = fields[2][pn] # <<<<<<<<<<<<<< @@ -10851,7 +10753,7 @@ */ __pyx_v_dens = ((__pyx_v_fields[2])[__pyx_v_pn]); - /* "yt/geometry/particle_smooth.pyx":715 + /* "yt/geometry/particle_smooth.pyx":641 * hsml = fields[1][pn] * dens = fields[2][pn] * if hsml < 0: # <<<<<<<<<<<<<< @@ -10861,7 +10763,7 @@ __pyx_t_5 = ((__pyx_v_hsml < 0.0) != 0); if (__pyx_t_5) { - /* "yt/geometry/particle_smooth.pyx":716 + /* "yt/geometry/particle_smooth.pyx":642 * dens = fields[2][pn] * if hsml < 0: * hsml = max_r # <<<<<<<<<<<<<< @@ -10870,7 +10772,7 @@ */ __pyx_v_hsml = __pyx_v_max_r; - /* "yt/geometry/particle_smooth.pyx":715 + /* "yt/geometry/particle_smooth.pyx":641 * hsml = fields[1][pn] * dens = fields[2][pn] * if hsml < 0: # <<<<<<<<<<<<<< @@ -10879,7 +10781,7 @@ */ } - /* "yt/geometry/particle_smooth.pyx":717 + /* "yt/geometry/particle_smooth.pyx":643 * if hsml < 0: * hsml = max_r * if hsml == 0: continue # <<<<<<<<<<<<<< @@ -10891,7 +10793,7 @@ goto __pyx_L3_continue; } - /* "yt/geometry/particle_smooth.pyx":718 + /* "yt/geometry/particle_smooth.pyx":644 * hsml = max_r * if hsml == 0: continue * ihsml = 1.0/hsml # <<<<<<<<<<<<<< @@ -10900,7 +10802,7 @@ */ __pyx_v_ihsml = (1.0 / __pyx_v_hsml); - /* "yt/geometry/particle_smooth.pyx":719 + /* "yt/geometry/particle_smooth.pyx":645 * if hsml == 0: continue * ihsml = 1.0/hsml * hsml = fmax(max_hsml/2.0, hsml) # <<<<<<<<<<<<<< @@ -10909,7 +10811,7 @@ */ __pyx_v_hsml = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((__pyx_v_max_hsml / 2.0), __pyx_v_hsml); - /* "yt/geometry/particle_smooth.pyx":720 + /* "yt/geometry/particle_smooth.pyx":646 * ihsml = 1.0/hsml * hsml = fmax(max_hsml/2.0, hsml) * ihsml3 = ihsml*ihsml*ihsml # <<<<<<<<<<<<<< @@ -10918,7 +10820,7 @@ */ __pyx_v_ihsml3 = ((__pyx_v_ihsml * __pyx_v_ihsml) * __pyx_v_ihsml); - /* "yt/geometry/particle_smooth.pyx":722 + /* "yt/geometry/particle_smooth.pyx":648 * ihsml3 = ihsml*ihsml*ihsml * # Usually this density has been computed * if dens == 0.0: continue # <<<<<<<<<<<<<< @@ -10930,7 +10832,7 @@ goto __pyx_L3_continue; } - /* "yt/geometry/particle_smooth.pyx":723 + /* "yt/geometry/particle_smooth.pyx":649 * # Usually this density has been computed * if dens == 0.0: continue * weight = (mass / dens) * ihsml3 # <<<<<<<<<<<<<< @@ -10939,7 +10841,7 @@ */ __pyx_v_weight = ((__pyx_v_mass / __pyx_v_dens) * __pyx_v_ihsml3); - /* "yt/geometry/particle_smooth.pyx":724 + /* "yt/geometry/particle_smooth.pyx":650 * if dens == 0.0: continue * weight = (mass / dens) * ihsml3 * kern = self.sph_kernel(sqrt(r2) * ihsml) # <<<<<<<<<<<<<< @@ -10948,7 +10850,7 @@ */ __pyx_v_kern = __pyx_v_self->__pyx_base.sph_kernel((sqrt(__pyx_v_r2) * __pyx_v_ihsml)); - /* "yt/geometry/particle_smooth.pyx":725 + /* "yt/geometry/particle_smooth.pyx":651 * weight = (mass / dens) * ihsml3 * kern = self.sph_kernel(sqrt(r2) * ihsml) * weight *= kern # <<<<<<<<<<<<<< @@ -10957,7 +10859,7 @@ */ __pyx_v_weight = (__pyx_v_weight * __pyx_v_kern); - /* "yt/geometry/particle_smooth.pyx":727 + /* "yt/geometry/particle_smooth.pyx":653 * weight *= kern * # Mass of the particle times the value * for fi in range(self.nfields - 3): # <<<<<<<<<<<<<< @@ -10968,7 +10870,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_fi = __pyx_t_7; - /* "yt/geometry/particle_smooth.pyx":728 + /* "yt/geometry/particle_smooth.pyx":654 * # Mass of the particle times the value * for fi in range(self.nfields - 3): * val = fields[fi + 3][pn] # <<<<<<<<<<<<<< @@ -10977,7 +10879,7 @@ */ __pyx_v_val = ((__pyx_v_fields[(__pyx_v_fi + 3)])[__pyx_v_pn]); - /* "yt/geometry/particle_smooth.pyx":729 + /* "yt/geometry/particle_smooth.pyx":655 * for fi in range(self.nfields - 3): * val = fields[fi + 3][pn] * self.fp[fi][gind(i,j,k,dim) + offset] += val * weight # <<<<<<<<<<<<<< @@ -10991,7 +10893,7 @@ __pyx_L3_continue:; } - /* "yt/geometry/particle_smooth.pyx":730 + /* "yt/geometry/particle_smooth.pyx":656 * val = fields[fi + 3][pn] * self.fp[fi][gind(i,j,k,dim) + offset] += val * weight * return # <<<<<<<<<<<<<< @@ -11000,12 +10902,12 @@ */ goto __pyx_L0; - /* "yt/geometry/particle_smooth.pyx":692 + /* "yt/geometry/particle_smooth.pyx":618 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void process(self, np.int64_t offset, int i, int j, int k, # <<<<<<<<<<<<<< * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **index_fields): + * np.float64_t **index_fields, DistanceQueue dq): */ /* function exit code */ @@ -11013,7 +10915,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_smooth.pyx":665 +/* "yt/geometry/particle_smooth.pyx":591 * # applying here is equation 6, with variable smoothing lengths (eq 13). * cdef np.float64_t **fp * cdef public object vals # <<<<<<<<<<<<<< @@ -11108,7 +11010,114 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":737 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_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_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__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.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, 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.fp,self.pos_setup,self.sph_kernel 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("yt.geometry.particle_smooth.VolumeWeightedSmooth.__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.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_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_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *__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.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, 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.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_smooth.VolumeWeightedSmooth.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_smooth.pyx":663 * cdef np.float64_t *fp * cdef public object vals * def initialize(self): # <<<<<<<<<<<<<< @@ -11139,7 +11148,7 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_smooth.pyx":739 + /* "yt/geometry/particle_smooth.pyx":665 * def initialize(self): * cdef np.ndarray tarr * assert(self.nfields == 1) # <<<<<<<<<<<<<< @@ -11150,42 +11159,42 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_self->__pyx_base.nfields == 1) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 739, __pyx_L1_error) + __PYX_ERR(0, 665, __pyx_L1_error) } } #endif - /* "yt/geometry/particle_smooth.pyx":740 + /* "yt/geometry/particle_smooth.pyx":666 * cdef np.ndarray tarr * assert(self.nfields == 1) * tarr = np.zeros(self.nvals, dtype="float64", order="F") # <<<<<<<<<<<<<< * self.vals = tarr * self.fp = tarr.data */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __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, 740, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __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, 740, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 740, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 740, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 666, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 740, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 666, __pyx_L1_error) __pyx_v_tarr = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/particle_smooth.pyx":741 + /* "yt/geometry/particle_smooth.pyx":667 * assert(self.nfields == 1) * tarr = np.zeros(self.nvals, dtype="float64", order="F") * self.vals = tarr # <<<<<<<<<<<<<< @@ -11198,7 +11207,7 @@ __Pyx_DECREF(__pyx_v_self->vals); __pyx_v_self->vals = ((PyObject *)__pyx_v_tarr); - /* "yt/geometry/particle_smooth.pyx":742 + /* "yt/geometry/particle_smooth.pyx":668 * tarr = np.zeros(self.nvals, dtype="float64", order="F") * self.vals = tarr * self.fp = tarr.data # <<<<<<<<<<<<<< @@ -11207,7 +11216,7 @@ */ __pyx_v_self->fp = ((__pyx_t_5numpy_float64_t *)__pyx_v_tarr->data); - /* "yt/geometry/particle_smooth.pyx":737 + /* "yt/geometry/particle_smooth.pyx":663 * cdef np.float64_t *fp * cdef public object vals * def initialize(self): # <<<<<<<<<<<<<< @@ -11232,7 +11241,7 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":744 +/* "yt/geometry/particle_smooth.pyx":670 * self.fp = tarr.data * * def finalize(self): # <<<<<<<<<<<<<< @@ -11258,7 +11267,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_smooth.pyx":745 + /* "yt/geometry/particle_smooth.pyx":671 * * def finalize(self): * return self.vals # <<<<<<<<<<<<<< @@ -11270,7 +11279,7 @@ __pyx_r = __pyx_v_self->vals; goto __pyx_L0; - /* "yt/geometry/particle_smooth.pyx":744 + /* "yt/geometry/particle_smooth.pyx":670 * self.fp = tarr.data * * def finalize(self): # <<<<<<<<<<<<<< @@ -11285,54 +11294,54 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":751 +/* "yt/geometry/particle_smooth.pyx":677 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void process(self, np.int64_t offset, int i, int j, int k, # <<<<<<<<<<<<<< * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **index_fields): + * np.float64_t **index_fields, DistanceQueue dq): */ -static void __pyx_f_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields) { +static void __pyx_f_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) { __pyx_t_5numpy_int64_t __pyx_v_pn; __Pyx_RefNannyDeclarations __pyx_t_5numpy_int64_t __pyx_t_1; __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_smooth.pyx":759 + /* "yt/geometry/particle_smooth.pyx":685 * # We get back our mass * # rho_i = sum(j = 1 .. n) m_j * W_ij - * pn = self.neighbors[0].pn # <<<<<<<<<<<<<< + * pn = dq.neighbors[0].pn # <<<<<<<<<<<<<< * self.fp[gind(i,j,k,dim) + offset] = fields[0][pn] - * #self.fp[gind(i,j,k,dim) + offset] = self.neighbors[0].r2 + * #self.fp[gind(i,j,k,dim) + offset] = dq.neighbors[0].r2 */ - __pyx_t_1 = (__pyx_v_self->__pyx_base.neighbors[0]).pn; + __pyx_t_1 = (__pyx_v_dq->neighbors[0]).pn; __pyx_v_pn = __pyx_t_1; - /* "yt/geometry/particle_smooth.pyx":760 + /* "yt/geometry/particle_smooth.pyx":686 * # rho_i = sum(j = 1 .. n) m_j * W_ij - * pn = self.neighbors[0].pn + * pn = dq.neighbors[0].pn * self.fp[gind(i,j,k,dim) + offset] = fields[0][pn] # <<<<<<<<<<<<<< - * #self.fp[gind(i,j,k,dim) + offset] = self.neighbors[0].r2 + * #self.fp[gind(i,j,k,dim) + offset] = dq.neighbors[0].r2 * return */ (__pyx_v_self->fp[(__pyx_f_2yt_8geometry_16particle_deposit_gind(__pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim) + __pyx_v_offset)]) = ((__pyx_v_fields[0])[__pyx_v_pn]); - /* "yt/geometry/particle_smooth.pyx":762 + /* "yt/geometry/particle_smooth.pyx":688 * self.fp[gind(i,j,k,dim) + offset] = fields[0][pn] - * #self.fp[gind(i,j,k,dim) + offset] = self.neighbors[0].r2 + * #self.fp[gind(i,j,k,dim) + offset] = dq.neighbors[0].r2 * return # <<<<<<<<<<<<<< * * nearest_smooth = NearestNeighborSmooth */ goto __pyx_L0; - /* "yt/geometry/particle_smooth.pyx":751 + /* "yt/geometry/particle_smooth.pyx":677 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void process(self, np.int64_t offset, int i, int j, int k, # <<<<<<<<<<<<<< * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **index_fields): + * np.float64_t **index_fields, DistanceQueue dq): */ /* function exit code */ @@ -11340,7 +11349,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_smooth.pyx":736 +/* "yt/geometry/particle_smooth.pyx":662 * cdef class NearestNeighborSmooth(ParticleSmoothOperation): * cdef np.float64_t *fp * cdef public object vals # <<<<<<<<<<<<<< @@ -11435,7 +11444,114 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":770 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_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_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__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.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, 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.fp,self.pos_setup,self.sph_kernel 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("yt.geometry.particle_smooth.NearestNeighborSmooth.__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.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_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_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *__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.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, 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.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_smooth.NearestNeighborSmooth.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_smooth.pyx":696 * cdef public int p2 * cdef public object vals * def initialize(self): # <<<<<<<<<<<<<< @@ -11466,7 +11582,7 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_smooth.pyx":772 + /* "yt/geometry/particle_smooth.pyx":698 * def initialize(self): * cdef np.ndarray tarr * assert(self.nfields == 1) # <<<<<<<<<<<<<< @@ -11477,42 +11593,42 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_self->__pyx_base.nfields == 1) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 772, __pyx_L1_error) + __PYX_ERR(0, 698, __pyx_L1_error) } } #endif - /* "yt/geometry/particle_smooth.pyx":773 + /* "yt/geometry/particle_smooth.pyx":699 * cdef np.ndarray tarr * assert(self.nfields == 1) * tarr = np.zeros(self.nvals, dtype="float64", order="F") # <<<<<<<<<<<<<< * self.vals = tarr * self.fp = tarr.data */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __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, 773, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __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, 773, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base.nvals); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.nvals); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.nvals); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 773, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 773, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 699, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 773, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 699, __pyx_L1_error) __pyx_v_tarr = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/particle_smooth.pyx":774 + /* "yt/geometry/particle_smooth.pyx":700 * assert(self.nfields == 1) * tarr = np.zeros(self.nvals, dtype="float64", order="F") * self.vals = tarr # <<<<<<<<<<<<<< @@ -11525,7 +11641,7 @@ __Pyx_DECREF(__pyx_v_self->vals); __pyx_v_self->vals = ((PyObject *)__pyx_v_tarr); - /* "yt/geometry/particle_smooth.pyx":775 + /* "yt/geometry/particle_smooth.pyx":701 * tarr = np.zeros(self.nvals, dtype="float64", order="F") * self.vals = tarr * self.fp = tarr.data # <<<<<<<<<<<<<< @@ -11534,7 +11650,7 @@ */ __pyx_v_self->fp = ((__pyx_t_5numpy_float64_t *)__pyx_v_tarr->data); - /* "yt/geometry/particle_smooth.pyx":776 + /* "yt/geometry/particle_smooth.pyx":702 * self.vals = tarr * self.fp = tarr.data * self.p2 = 2 # Power, for IDW, in units of 2. So we only do even p's. # <<<<<<<<<<<<<< @@ -11543,7 +11659,7 @@ */ __pyx_v_self->p2 = 2; - /* "yt/geometry/particle_smooth.pyx":770 + /* "yt/geometry/particle_smooth.pyx":696 * cdef public int p2 * cdef public object vals * def initialize(self): # <<<<<<<<<<<<<< @@ -11568,7 +11684,7 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":778 +/* "yt/geometry/particle_smooth.pyx":704 * self.p2 = 2 # Power, for IDW, in units of 2. So we only do even p's. * * def finalize(self): # <<<<<<<<<<<<<< @@ -11594,7 +11710,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_smooth.pyx":779 + /* "yt/geometry/particle_smooth.pyx":705 * * def finalize(self): * return self.vals # <<<<<<<<<<<<<< @@ -11606,7 +11722,7 @@ __pyx_r = __pyx_v_self->vals; goto __pyx_L0; - /* "yt/geometry/particle_smooth.pyx":778 + /* "yt/geometry/particle_smooth.pyx":704 * self.p2 = 2 # Power, for IDW, in units of 2. So we only do even p's. * * def finalize(self): # <<<<<<<<<<<<<< @@ -11621,15 +11737,15 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":785 +/* "yt/geometry/particle_smooth.pyx":711 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void process(self, np.int64_t offset, int i, int j, int k, # <<<<<<<<<<<<<< * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **index_fields): + * np.float64_t **index_fields, DistanceQueue dq): */ -static void __pyx_f_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields) { +static void __pyx_f_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) { __pyx_t_5numpy_int64_t __pyx_v_pn; __pyx_t_5numpy_int64_t __pyx_v_ni; CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_di; @@ -11647,95 +11763,95 @@ __pyx_t_5numpy_int64_t __pyx_t_6; __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_smooth.pyx":791 + /* "yt/geometry/particle_smooth.pyx":717 * # We also have a list of neighboring particles with particle numbers. * cdef np.int64_t pn, ni, di * cdef np.float64_t total_weight = 0.0, total_value = 0.0, r2, val, w # <<<<<<<<<<<<<< * # We're going to do a very simple IDW average - * if self.neighbors[0].r2 == 0.0: + * if dq.neighbors[0].r2 == 0.0: */ __pyx_v_total_weight = 0.0; __pyx_v_total_value = 0.0; - /* "yt/geometry/particle_smooth.pyx":793 + /* "yt/geometry/particle_smooth.pyx":719 * cdef np.float64_t total_weight = 0.0, total_value = 0.0, r2, val, w * # We're going to do a very simple IDW average - * if self.neighbors[0].r2 == 0.0: # <<<<<<<<<<<<<< - * pn = self.neighbors[0].pn + * if dq.neighbors[0].r2 == 0.0: # <<<<<<<<<<<<<< + * pn = dq.neighbors[0].pn * self.fp[gind(i,j,k,dim) + offset] = fields[0][pn] */ - __pyx_t_1 = (((__pyx_v_self->__pyx_base.neighbors[0]).r2 == 0.0) != 0); + __pyx_t_1 = (((__pyx_v_dq->neighbors[0]).r2 == 0.0) != 0); if (__pyx_t_1) { - /* "yt/geometry/particle_smooth.pyx":794 + /* "yt/geometry/particle_smooth.pyx":720 * # We're going to do a very simple IDW average - * if self.neighbors[0].r2 == 0.0: - * pn = self.neighbors[0].pn # <<<<<<<<<<<<<< + * if dq.neighbors[0].r2 == 0.0: + * pn = dq.neighbors[0].pn # <<<<<<<<<<<<<< * self.fp[gind(i,j,k,dim) + offset] = fields[0][pn] - * for ni in range(self.curn): + * for ni in range(dq.curn): */ - __pyx_t_2 = (__pyx_v_self->__pyx_base.neighbors[0]).pn; + __pyx_t_2 = (__pyx_v_dq->neighbors[0]).pn; __pyx_v_pn = __pyx_t_2; - /* "yt/geometry/particle_smooth.pyx":795 - * if self.neighbors[0].r2 == 0.0: - * pn = self.neighbors[0].pn + /* "yt/geometry/particle_smooth.pyx":721 + * if dq.neighbors[0].r2 == 0.0: + * pn = dq.neighbors[0].pn * self.fp[gind(i,j,k,dim) + offset] = fields[0][pn] # <<<<<<<<<<<<<< - * for ni in range(self.curn): - * r2 = self.neighbors[ni].r2 + * for ni in range(dq.curn): + * r2 = dq.neighbors[ni].r2 */ (__pyx_v_self->fp[(__pyx_f_2yt_8geometry_16particle_deposit_gind(__pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim) + __pyx_v_offset)]) = ((__pyx_v_fields[0])[__pyx_v_pn]); - /* "yt/geometry/particle_smooth.pyx":793 + /* "yt/geometry/particle_smooth.pyx":719 * cdef np.float64_t total_weight = 0.0, total_value = 0.0, r2, val, w * # We're going to do a very simple IDW average - * if self.neighbors[0].r2 == 0.0: # <<<<<<<<<<<<<< - * pn = self.neighbors[0].pn + * if dq.neighbors[0].r2 == 0.0: # <<<<<<<<<<<<<< + * pn = dq.neighbors[0].pn * self.fp[gind(i,j,k,dim) + offset] = fields[0][pn] */ } - /* "yt/geometry/particle_smooth.pyx":796 - * pn = self.neighbors[0].pn + /* "yt/geometry/particle_smooth.pyx":722 + * pn = dq.neighbors[0].pn * self.fp[gind(i,j,k,dim) + offset] = fields[0][pn] - * for ni in range(self.curn): # <<<<<<<<<<<<<< - * r2 = self.neighbors[ni].r2 - * val = fields[0][self.neighbors[ni].pn] + * for ni in range(dq.curn): # <<<<<<<<<<<<<< + * r2 = dq.neighbors[ni].r2 + * val = fields[0][dq.neighbors[ni].pn] */ - __pyx_t_3 = __pyx_v_self->__pyx_base.curn; + __pyx_t_3 = __pyx_v_dq->__pyx_base.curn; for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2+=1) { __pyx_v_ni = __pyx_t_2; - /* "yt/geometry/particle_smooth.pyx":797 + /* "yt/geometry/particle_smooth.pyx":723 * self.fp[gind(i,j,k,dim) + offset] = fields[0][pn] - * for ni in range(self.curn): - * r2 = self.neighbors[ni].r2 # <<<<<<<<<<<<<< - * val = fields[0][self.neighbors[ni].pn] + * for ni in range(dq.curn): + * r2 = dq.neighbors[ni].r2 # <<<<<<<<<<<<<< + * val = fields[0][dq.neighbors[ni].pn] * w = r2 */ - __pyx_t_4 = (__pyx_v_self->__pyx_base.neighbors[__pyx_v_ni]).r2; + __pyx_t_4 = (__pyx_v_dq->neighbors[__pyx_v_ni]).r2; __pyx_v_r2 = __pyx_t_4; - /* "yt/geometry/particle_smooth.pyx":798 - * for ni in range(self.curn): - * r2 = self.neighbors[ni].r2 - * val = fields[0][self.neighbors[ni].pn] # <<<<<<<<<<<<<< + /* "yt/geometry/particle_smooth.pyx":724 + * for ni in range(dq.curn): + * r2 = dq.neighbors[ni].r2 + * val = fields[0][dq.neighbors[ni].pn] # <<<<<<<<<<<<<< * w = r2 * for di in range(self.p2 - 1): */ - __pyx_v_val = ((__pyx_v_fields[0])[(__pyx_v_self->__pyx_base.neighbors[__pyx_v_ni]).pn]); + __pyx_v_val = ((__pyx_v_fields[0])[(__pyx_v_dq->neighbors[__pyx_v_ni]).pn]); - /* "yt/geometry/particle_smooth.pyx":799 - * r2 = self.neighbors[ni].r2 - * val = fields[0][self.neighbors[ni].pn] + /* "yt/geometry/particle_smooth.pyx":725 + * r2 = dq.neighbors[ni].r2 + * val = fields[0][dq.neighbors[ni].pn] * w = r2 # <<<<<<<<<<<<<< * for di in range(self.p2 - 1): * w *= r2 */ __pyx_v_w = __pyx_v_r2; - /* "yt/geometry/particle_smooth.pyx":800 - * val = fields[0][self.neighbors[ni].pn] + /* "yt/geometry/particle_smooth.pyx":726 + * val = fields[0][dq.neighbors[ni].pn] * w = r2 * for di in range(self.p2 - 1): # <<<<<<<<<<<<<< * w *= r2 @@ -11745,7 +11861,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_di = __pyx_t_6; - /* "yt/geometry/particle_smooth.pyx":801 + /* "yt/geometry/particle_smooth.pyx":727 * w = r2 * for di in range(self.p2 - 1): * w *= r2 # <<<<<<<<<<<<<< @@ -11755,7 +11871,7 @@ __pyx_v_w = (__pyx_v_w * __pyx_v_r2); } - /* "yt/geometry/particle_smooth.pyx":802 + /* "yt/geometry/particle_smooth.pyx":728 * for di in range(self.p2 - 1): * w *= r2 * total_value += w * val # <<<<<<<<<<<<<< @@ -11764,7 +11880,7 @@ */ __pyx_v_total_value = (__pyx_v_total_value + (__pyx_v_w * __pyx_v_val)); - /* "yt/geometry/particle_smooth.pyx":803 + /* "yt/geometry/particle_smooth.pyx":729 * w *= r2 * total_value += w * val * total_weight += w # <<<<<<<<<<<<<< @@ -11774,7 +11890,7 @@ __pyx_v_total_weight = (__pyx_v_total_weight + __pyx_v_w); } - /* "yt/geometry/particle_smooth.pyx":804 + /* "yt/geometry/particle_smooth.pyx":730 * total_value += w * val * total_weight += w * self.fp[gind(i,j,k,dim) + offset] = total_value / total_weight # <<<<<<<<<<<<<< @@ -11783,7 +11899,7 @@ */ (__pyx_v_self->fp[(__pyx_f_2yt_8geometry_16particle_deposit_gind(__pyx_v_i, __pyx_v_j, __pyx_v_k, __pyx_v_dim) + __pyx_v_offset)]) = (__pyx_v_total_value / __pyx_v_total_weight); - /* "yt/geometry/particle_smooth.pyx":805 + /* "yt/geometry/particle_smooth.pyx":731 * total_weight += w * self.fp[gind(i,j,k,dim) + offset] = total_value / total_weight * return # <<<<<<<<<<<<<< @@ -11792,12 +11908,12 @@ */ goto __pyx_L0; - /* "yt/geometry/particle_smooth.pyx":785 + /* "yt/geometry/particle_smooth.pyx":711 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void process(self, np.int64_t offset, int i, int j, int k, # <<<<<<<<<<<<<< * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **index_fields): + * np.float64_t **index_fields, DistanceQueue dq): */ /* function exit code */ @@ -11805,7 +11921,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/particle_smooth.pyx":768 +/* "yt/geometry/particle_smooth.pyx":694 * cdef class IDWInterpolationSmooth(ParticleSmoothOperation): * cdef np.float64_t *fp * cdef public int p2 # <<<<<<<<<<<<<< @@ -11832,7 +11948,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11867,7 +11983,7 @@ __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 768, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 694, __pyx_L1_error) __pyx_v_self->p2 = __pyx_t_1; /* function exit code */ @@ -11881,7 +11997,7 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":769 +/* "yt/geometry/particle_smooth.pyx":695 * cdef np.float64_t *fp * cdef public int p2 * cdef public object vals # <<<<<<<<<<<<<< @@ -11976,7 +12092,114 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":811 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_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_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__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.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, 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.fp,self.pos_setup,self.sph_kernel 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("yt.geometry.particle_smooth.IDWInterpolationSmooth.__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.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_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_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *__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.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, 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.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_smooth.IDWInterpolationSmooth.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/particle_smooth.pyx":737 * cdef class NthNeighborDistanceSmooth(ParticleSmoothOperation): * * def initialize(self): # <<<<<<<<<<<<<< @@ -12002,7 +12225,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_smooth.pyx":812 + /* "yt/geometry/particle_smooth.pyx":738 * * def initialize(self): * return # <<<<<<<<<<<<<< @@ -12013,7 +12236,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/geometry/particle_smooth.pyx":811 + /* "yt/geometry/particle_smooth.pyx":737 * cdef class NthNeighborDistanceSmooth(ParticleSmoothOperation): * * def initialize(self): # <<<<<<<<<<<<<< @@ -12028,7 +12251,7 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":814 +/* "yt/geometry/particle_smooth.pyx":740 * return * * def finalize(self): # <<<<<<<<<<<<<< @@ -12054,7 +12277,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_smooth.pyx":815 + /* "yt/geometry/particle_smooth.pyx":741 * * def finalize(self): * return # <<<<<<<<<<<<<< @@ -12065,7 +12288,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/geometry/particle_smooth.pyx":814 + /* "yt/geometry/particle_smooth.pyx":740 * return * * def finalize(self): # <<<<<<<<<<<<<< @@ -12080,50 +12303,157 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":821 +/* "yt/geometry/particle_smooth.pyx":747 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void process(self, np.int64_t offset, int i, int j, int k, # <<<<<<<<<<<<<< * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **index_fields): + * np.float64_t **index_fields, DistanceQueue dq): */ -static void __pyx_f_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields) { +static void __pyx_f_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_process(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) { __pyx_t_5numpy_float64_t __pyx_v_max_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_smooth.pyx":826 + /* "yt/geometry/particle_smooth.pyx":752 * cdef np.float64_t max_r * # We assume "offset" here is the particle index. - * max_r = sqrt(self.neighbors[self.curn-1].r2) # <<<<<<<<<<<<<< + * max_r = sqrt(dq.neighbors[dq.curn-1].r2) # <<<<<<<<<<<<<< * fields[0][offset] = max_r * */ - __pyx_v_max_r = sqrt((__pyx_v_self->__pyx_base.neighbors[(__pyx_v_self->__pyx_base.curn - 1)]).r2); + __pyx_v_max_r = sqrt((__pyx_v_dq->neighbors[(__pyx_v_dq->__pyx_base.curn - 1)]).r2); - /* "yt/geometry/particle_smooth.pyx":827 + /* "yt/geometry/particle_smooth.pyx":753 * # We assume "offset" here is the particle index. - * max_r = sqrt(self.neighbors[self.curn-1].r2) + * max_r = sqrt(dq.neighbors[dq.curn-1].r2) * fields[0][offset] = max_r # <<<<<<<<<<<<<< * * nth_neighbor_smooth = NthNeighborDistanceSmooth */ ((__pyx_v_fields[0])[__pyx_v_offset]) = __pyx_v_max_r; - /* "yt/geometry/particle_smooth.pyx":821 + /* "yt/geometry/particle_smooth.pyx":747 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void process(self, np.int64_t offset, int i, int j, int k, # <<<<<<<<<<<<<< * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **index_fields): + * np.float64_t **index_fields, DistanceQueue dq): + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_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_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__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.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, 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.pos_setup,self.sph_kernel 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("yt.geometry.particle_smooth.NthNeighborDistanceSmooth.__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.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_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_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth *__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.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, 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.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_smooth.NthNeighborDistanceSmooth.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":832 +/* "yt/geometry/particle_smooth.pyx":758 * * cdef class SmoothedDensityEstimate(ParticleSmoothOperation): * def initialize(self): # <<<<<<<<<<<<<< @@ -12149,7 +12479,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("initialize", 0); - /* "yt/geometry/particle_smooth.pyx":833 + /* "yt/geometry/particle_smooth.pyx":759 * cdef class SmoothedDensityEstimate(ParticleSmoothOperation): * def initialize(self): * return # <<<<<<<<<<<<<< @@ -12160,7 +12490,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/geometry/particle_smooth.pyx":832 + /* "yt/geometry/particle_smooth.pyx":758 * * cdef class SmoothedDensityEstimate(ParticleSmoothOperation): * def initialize(self): # <<<<<<<<<<<<<< @@ -12175,7 +12505,7 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":835 +/* "yt/geometry/particle_smooth.pyx":761 * return * * def finalize(self): # <<<<<<<<<<<<<< @@ -12201,7 +12531,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("finalize", 0); - /* "yt/geometry/particle_smooth.pyx":836 + /* "yt/geometry/particle_smooth.pyx":762 * * def finalize(self): * return # <<<<<<<<<<<<<< @@ -12212,7 +12542,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/geometry/particle_smooth.pyx":835 + /* "yt/geometry/particle_smooth.pyx":761 * return * * def finalize(self): # <<<<<<<<<<<<<< @@ -12227,15 +12557,15 @@ return __pyx_r; } -/* "yt/geometry/particle_smooth.pyx":842 +/* "yt/geometry/particle_smooth.pyx":768 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void process(self, np.int64_t offset, int i, int j, int k, # <<<<<<<<<<<<<< * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **index_fields): + * np.float64_t **index_fields, DistanceQueue dq): */ -static void __pyx_f_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields) { +static void __pyx_f_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_process(struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_offset, CYTHON_UNUSED int __pyx_v_i, CYTHON_UNUSED int __pyx_v_j, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED int *__pyx_v_dim, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t **__pyx_v_fields, CYTHON_UNUSED __pyx_t_5numpy_float64_t **__pyx_v_index_fields, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_dq) { __pyx_t_5numpy_float64_t __pyx_v_r2; __pyx_t_5numpy_float64_t __pyx_v_hsml; __pyx_t_5numpy_float64_t __pyx_v_dens; @@ -12249,74 +12579,74 @@ __pyx_t_5numpy_float64_t __pyx_t_3; __Pyx_RefNannySetupContext("process", 0); - /* "yt/geometry/particle_smooth.pyx":848 + /* "yt/geometry/particle_smooth.pyx":774 * cdef int pn * # We assume "offset" here is the particle index. - * hsml = sqrt(self.neighbors[self.curn-1].r2) # <<<<<<<<<<<<<< + * hsml = sqrt(dq.neighbors[dq.curn-1].r2) # <<<<<<<<<<<<<< * dens = 0.0 * weight = 0.0 */ - __pyx_v_hsml = sqrt((__pyx_v_self->__pyx_base.neighbors[(__pyx_v_self->__pyx_base.curn - 1)]).r2); + __pyx_v_hsml = sqrt((__pyx_v_dq->neighbors[(__pyx_v_dq->__pyx_base.curn - 1)]).r2); - /* "yt/geometry/particle_smooth.pyx":849 + /* "yt/geometry/particle_smooth.pyx":775 * # We assume "offset" here is the particle index. - * hsml = sqrt(self.neighbors[self.curn-1].r2) + * hsml = sqrt(dq.neighbors[dq.curn-1].r2) * dens = 0.0 # <<<<<<<<<<<<<< * weight = 0.0 - * for pn in range(self.curn): + * for pn in range(dq.curn): */ __pyx_v_dens = 0.0; - /* "yt/geometry/particle_smooth.pyx":850 - * hsml = sqrt(self.neighbors[self.curn-1].r2) + /* "yt/geometry/particle_smooth.pyx":776 + * hsml = sqrt(dq.neighbors[dq.curn-1].r2) * dens = 0.0 * weight = 0.0 # <<<<<<<<<<<<<< - * for pn in range(self.curn): - * mass = fields[0][self.neighbors[pn].pn] + * for pn in range(dq.curn): + * mass = fields[0][dq.neighbors[pn].pn] */ __pyx_v_weight = 0.0; - /* "yt/geometry/particle_smooth.pyx":851 + /* "yt/geometry/particle_smooth.pyx":777 * dens = 0.0 * weight = 0.0 - * for pn in range(self.curn): # <<<<<<<<<<<<<< - * mass = fields[0][self.neighbors[pn].pn] - * r2 = self.neighbors[pn].r2 + * for pn in range(dq.curn): # <<<<<<<<<<<<<< + * mass = fields[0][dq.neighbors[pn].pn] + * r2 = dq.neighbors[pn].r2 */ - __pyx_t_1 = __pyx_v_self->__pyx_base.curn; + __pyx_t_1 = __pyx_v_dq->__pyx_base.curn; for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_pn = __pyx_t_2; - /* "yt/geometry/particle_smooth.pyx":852 + /* "yt/geometry/particle_smooth.pyx":778 * weight = 0.0 - * for pn in range(self.curn): - * mass = fields[0][self.neighbors[pn].pn] # <<<<<<<<<<<<<< - * r2 = self.neighbors[pn].r2 + * for pn in range(dq.curn): + * mass = fields[0][dq.neighbors[pn].pn] # <<<<<<<<<<<<<< + * r2 = dq.neighbors[pn].r2 * lw = self.sph_kernel(sqrt(r2) / hsml) */ - __pyx_v_mass = ((__pyx_v_fields[0])[(__pyx_v_self->__pyx_base.neighbors[__pyx_v_pn]).pn]); + __pyx_v_mass = ((__pyx_v_fields[0])[(__pyx_v_dq->neighbors[__pyx_v_pn]).pn]); - /* "yt/geometry/particle_smooth.pyx":853 - * for pn in range(self.curn): - * mass = fields[0][self.neighbors[pn].pn] - * r2 = self.neighbors[pn].r2 # <<<<<<<<<<<<<< + /* "yt/geometry/particle_smooth.pyx":779 + * for pn in range(dq.curn): + * mass = fields[0][dq.neighbors[pn].pn] + * r2 = dq.neighbors[pn].r2 # <<<<<<<<<<<<<< * lw = self.sph_kernel(sqrt(r2) / hsml) * dens += mass * lw */ - __pyx_t_3 = (__pyx_v_self->__pyx_base.neighbors[__pyx_v_pn]).r2; + __pyx_t_3 = (__pyx_v_dq->neighbors[__pyx_v_pn]).r2; __pyx_v_r2 = __pyx_t_3; - /* "yt/geometry/particle_smooth.pyx":854 - * mass = fields[0][self.neighbors[pn].pn] - * r2 = self.neighbors[pn].r2 + /* "yt/geometry/particle_smooth.pyx":780 + * mass = fields[0][dq.neighbors[pn].pn] + * r2 = dq.neighbors[pn].r2 * lw = self.sph_kernel(sqrt(r2) / hsml) # <<<<<<<<<<<<<< * dens += mass * lw * weight = (4.0/3.0) * 3.1415926 * hsml**3 */ __pyx_v_lw = __pyx_v_self->__pyx_base.sph_kernel((sqrt(__pyx_v_r2) / __pyx_v_hsml)); - /* "yt/geometry/particle_smooth.pyx":855 - * r2 = self.neighbors[pn].r2 + /* "yt/geometry/particle_smooth.pyx":781 + * r2 = dq.neighbors[pn].r2 * lw = self.sph_kernel(sqrt(r2) / hsml) * dens += mass * lw # <<<<<<<<<<<<<< * weight = (4.0/3.0) * 3.1415926 * hsml**3 @@ -12325,7 +12655,7 @@ __pyx_v_dens = (__pyx_v_dens + (__pyx_v_mass * __pyx_v_lw)); } - /* "yt/geometry/particle_smooth.pyx":856 + /* "yt/geometry/particle_smooth.pyx":782 * lw = self.sph_kernel(sqrt(r2) / hsml) * dens += mass * lw * weight = (4.0/3.0) * 3.1415926 * hsml**3 # <<<<<<<<<<<<<< @@ -12334,7 +12664,7 @@ */ __pyx_v_weight = (((4.0 / 3.0) * 3.1415926) * pow(__pyx_v_hsml, 3.0)); - /* "yt/geometry/particle_smooth.pyx":857 + /* "yt/geometry/particle_smooth.pyx":783 * dens += mass * lw * weight = (4.0/3.0) * 3.1415926 * hsml**3 * fields[1][offset] = dens/weight # <<<<<<<<<<<<<< @@ -12343,29 +12673,173 @@ */ ((__pyx_v_fields[1])[__pyx_v_offset]) = (__pyx_v_dens / __pyx_v_weight); - /* "yt/geometry/particle_smooth.pyx":842 + /* "yt/geometry/particle_smooth.pyx":768 * @cython.wraparound(False) * @cython.initializedcheck(False) * cdef void process(self, np.int64_t offset, int i, int j, int k, # <<<<<<<<<<<<<< * int dim[3], np.float64_t cpos[3], np.float64_t **fields, - * np.float64_t **index_fields): + * np.float64_t **index_fields, DistanceQueue dq): */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "oct_visitors.pxd":51 - * cdef void visit(self, Oct*, np.uint8_t selected) - * - * cdef inline int oind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ -static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { - int __pyx_v_d; - int __pyx_r; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_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_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__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.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, 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.pos_setup,self.sph_kernel 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("yt.geometry.particle_smooth.SmoothedDensityEstimate.__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.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_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_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate *__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.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, 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.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.particle_smooth.SmoothedDensityEstimate.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) + * + */ + +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) { + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_cont", 0); + + /* "oct_container.pxd":57 + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) # <<<<<<<<<<<<<< + * + * cdef OctList *OctList_append(OctList *list, Oct *o) + */ + __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i]))); + goto __pyx_L0; + + /* "oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oct_visitors.pxd":51 + * cdef void visit(self, Oct*, np.uint8_t selected) + * + * cdef inline int oind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) + */ + +static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { + int __pyx_v_d; + int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("oind", 0); @@ -12450,7 +12924,7 @@ } /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -12472,7 +12946,7 @@ goto __pyx_L0; /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -12485,161 +12959,237 @@ return __pyx_r; } -/* "particle_deposit.pxd":29 - * void *alloca(int) +/* "selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * - * cdef inline int gind(int i, int j, int k, int dims[3]): # <<<<<<<<<<<<<< - * # The ordering is such that we want i to vary the slowest in this instance, - * # even though in other instances it varies the fastest. To see this in + * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): */ -static CYTHON_INLINE int __pyx_f_2yt_8geometry_16particle_deposit_gind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dims) { - int __pyx_r; +static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("gind", 0); + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_ensure_code", 0); - /* "particle_deposit.pxd":34 - * # action, try looking at the results of an n_ref=256 particle CIC plot, - * # which shows it the most clearly. - * return ((i*dims[1])+j)*dims[2]+k # <<<<<<<<<<<<<< + /* "selection_routines.pxd":23 + * + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): # <<<<<<<<<<<<<< + * if "code_length" == str(arr.units): + * return arr + */ + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 23, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "selection_routines.pxd":24 + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< + * return arr + * arr.convert_to_units("code_length") + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 24, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "selection_routines.pxd":25 + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): + * return arr # <<<<<<<<<<<<<< + * arr.convert_to_units("code_length") + * return arr + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + + /* "selection_routines.pxd":24 + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< + * return arr + * arr.convert_to_units("code_length") + */ + } + + /* "selection_routines.pxd":26 + * if "code_length" == str(arr.units): + * return arr + * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "selection_routines.pxd":23 * + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): # <<<<<<<<<<<<<< + * if "code_length" == str(arr.units): + * return arr + */ + } + + /* "selection_routines.pxd":27 + * return arr + * arr.convert_to_units("code_length") + * return arr # <<<<<<<<<<<<<< * + * cdef class SelectorObject: */ - __pyx_r = ((((__pyx_v_i * (__pyx_v_dims[1])) + __pyx_v_j) * (__pyx_v_dims[2])) + __pyx_v_k); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "particle_deposit.pxd":29 - * void *alloca(int) + /* "selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * - * cdef inline int gind(int i, int j, int k, int dims[3]): # <<<<<<<<<<<<<< - * # The ordering is such that we want i to vary the slowest in this instance, - * # even though in other instances it varies the fastest. To see this in + * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "particle_deposit.pxd":41 - * #################################################### +/* "selection_routines.pxd":78 + * cdef public SelectorObject sel2 * - * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) { + __pyx_t_5numpy_float64_t __pyx_v_rel; __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - int __pyx_t_2; - /* "particle_deposit.pxd":43 - * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 # <<<<<<<<<<<<<< - * if x <= 0.5: - * kernel = 1.-6.*x*x*(1.-x) + /* "selection_routines.pxd":80 + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< + * if not periodic: return rel + * if rel > dw * 0.5: */ - __pyx_v_C = 2.5464790894703255; + __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); - /* "particle_deposit.pxd":44 - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 - * if x <= 0.5: # <<<<<<<<<<<<<< - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: + /* "selection_routines.pxd":81 + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel # <<<<<<<<<<<<<< + * if rel > dw * 0.5: + * rel -= dw */ - __pyx_t_1 = ((__pyx_v_x <= 0.5) != 0); + __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0); if (__pyx_t_1) { + __pyx_r = __pyx_v_rel; + goto __pyx_L0; + } - /* "particle_deposit.pxd":45 - * cdef np.float64_t C = 2.5464790894703255 - * if x <= 0.5: - * kernel = 1.-6.*x*x*(1.-x) # <<<<<<<<<<<<<< - * elif x>0.5 and x<=1.0: - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) + /* "selection_routines.pxd":82 + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel + * if rel > dw * 0.5: # <<<<<<<<<<<<<< + * rel -= dw + * elif rel < -dw * 0.5: */ - __pyx_v_kernel = (1. - (((6. * __pyx_v_x) * __pyx_v_x) * (1. - __pyx_v_x))); + __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0); + if (__pyx_t_1) { - /* "particle_deposit.pxd":44 - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 - * if x <= 0.5: # <<<<<<<<<<<<<< - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: + /* "selection_routines.pxd":83 + * if not periodic: return rel + * if rel > dw * 0.5: + * rel -= dw # <<<<<<<<<<<<<< + * elif rel < -dw * 0.5: + * rel += dw */ - goto __pyx_L3; - } + __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw); - /* "particle_deposit.pxd":46 - * if x <= 0.5: - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: # <<<<<<<<<<<<<< - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) - * else: + /* "selection_routines.pxd":82 + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel + * if rel > dw * 0.5: # <<<<<<<<<<<<<< + * rel -= dw + * elif rel < -dw * 0.5: */ - __pyx_t_2 = ((__pyx_v_x > 0.5) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; + goto __pyx_L4; } - __pyx_t_2 = ((__pyx_v_x <= 1.0) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; - if (__pyx_t_1) { - /* "particle_deposit.pxd":47 - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) # <<<<<<<<<<<<<< - * else: - * kernel = 0. + /* "selection_routines.pxd":84 + * if rel > dw * 0.5: + * rel -= dw + * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< + * rel += dw + * return rel */ - __pyx_v_kernel = (((2. * (1. - __pyx_v_x)) * (1. - __pyx_v_x)) * (1. - __pyx_v_x)); + __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0); + if (__pyx_t_1) { - /* "particle_deposit.pxd":46 - * if x <= 0.5: - * kernel = 1.-6.*x*x*(1.-x) - * elif x>0.5 and x<=1.0: # <<<<<<<<<<<<<< - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) - * else: + /* "selection_routines.pxd":85 + * rel -= dw + * elif rel < -dw * 0.5: + * rel += dw # <<<<<<<<<<<<<< + * return rel */ - goto __pyx_L3; - } + __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw); - /* "particle_deposit.pxd":49 - * kernel = 2.*(1.-x)*(1.-x)*(1.-x) - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C - * + /* "selection_routines.pxd":84 + * if rel > dw * 0.5: + * rel -= dw + * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< + * rel += dw + * return rel */ - /*else*/ { - __pyx_v_kernel = 0.; } - __pyx_L3:; + __pyx_L4:; - /* "particle_deposit.pxd":50 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< - * - * ######################################################## + /* "selection_routines.pxd":86 + * elif rel < -dw * 0.5: + * rel += dw + * return rel # <<<<<<<<<<<<<< */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); + __pyx_r = __pyx_v_rel; goto __pyx_L0; - /* "particle_deposit.pxd":41 - * #################################################### + /* "selection_routines.pxd":78 + * cdef public SelectorObject sel2 * - * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 2.5464790894703255 + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 */ /* function exit code */ @@ -12647,4145 +13197,4069 @@ return __pyx_r; } -/* "particle_deposit.pxd":57 +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * # quartic spline - * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_quartic", 0); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "particle_deposit.pxd":59 - * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**4 + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ - __pyx_t_1 = PyFloat_FromDouble((pow(5., 6.0) / 512.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 59, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "particle_deposit.pxd":60 - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**4 - * if x < 3./5: + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "particle_deposit.pxd":61 - * cdef np.float64_t C = 5.**6/512/np.pi - * if x < 1: - * kernel = (1.-x)**4 # <<<<<<<<<<<<<< - * if x < 3./5: - * kernel -= 5*(3./5-x)**4 + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_v_kernel = pow((1. - __pyx_v_x), 4.0); - /* "particle_deposit.pxd":62 - * if x < 1: - * kernel = (1.-x)**4 - * if x < 3./5: # <<<<<<<<<<<<<< - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: - */ - __pyx_t_5 = ((__pyx_v_x < (3. / 5.0)) != 0); - if (__pyx_t_5) { + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "particle_deposit.pxd":63 - * kernel = (1.-x)**4 - * if x < 3./5: - * kernel -= 5*(3./5-x)**4 # <<<<<<<<<<<<<< - * if x < 1./5: - * kernel += 10*(1./5-x)**4 +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - __pyx_v_kernel = (__pyx_v_kernel - (5.0 * pow(((3. / 5.0) - __pyx_v_x), 4.0))); - /* "particle_deposit.pxd":64 - * if x < 3./5: - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: # <<<<<<<<<<<<<< - * kernel += 10*(1./5-x)**4 - * else: +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":24 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 + * */ - __pyx_t_5 = ((__pyx_v_x < (1. / 5.0)) != 0); - if (__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "particle_deposit.pxd":65 - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: - * kernel += 10*(1./5-x)**4 # <<<<<<<<<<<<<< - * else: - * kernel = 0. + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_v_kernel = (__pyx_v_kernel + (10.0 * pow(((1. / 5.0) - __pyx_v_x), 4.0))); + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "particle_deposit.pxd":64 - * if x < 3./5: - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: # <<<<<<<<<<<<<< - * kernel += 10*(1./5-x)**4 - * else: + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - } - /* "particle_deposit.pxd":62 - * if x < 1: - * kernel = (1.-x)**4 - * if x < 3./5: # <<<<<<<<<<<<<< - * kernel -= 5*(3./5-x)**4 - * if x < 1./5: - */ - } + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "particle_deposit.pxd":60 - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**4 - * if x < 3./5: +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - goto __pyx_L3; - } - /* "particle_deposit.pxd":67 - * kernel += 10*(1./5-x)**4 - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * */ - /*else*/ { - __pyx_v_kernel = 0.; + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - __pyx_L3:; - /* "particle_deposit.pxd":68 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * # quintic spline + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); + __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "particle_deposit.pxd":57 + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * # quartic spline - * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 5.**6/512/np.pi + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quartic", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "particle_deposit.pxd":71 +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * # quintic spline - * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { __pyx_t_5numpy_float64_t __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_quintic", 0); - - /* "particle_deposit.pxd":73 - * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**5 - */ - __pyx_t_1 = PyFloat_FromDouble((pow(3., 7.0) / 40.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 73, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; - - /* "particle_deposit.pxd":74 - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**5 - * if x < 2./3: - */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { - - /* "particle_deposit.pxd":75 - * cdef np.float64_t C = 3.**7/40/np.pi - * if x < 1: - * kernel = (1.-x)**5 # <<<<<<<<<<<<<< - * if x < 2./3: - * kernel -= 6*(2./3-x)**5 - */ - __pyx_v_kernel = pow((1. - __pyx_v_x), 5.0); - - /* "particle_deposit.pxd":76 - * if x < 1: - * kernel = (1.-x)**5 - * if x < 2./3: # <<<<<<<<<<<<<< - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: - */ - __pyx_t_5 = ((__pyx_v_x < (2. / 3.0)) != 0); - if (__pyx_t_5) { + int __pyx_t_1; - /* "particle_deposit.pxd":77 - * kernel = (1.-x)**5 - * if x < 2./3: - * kernel -= 6*(2./3-x)**5 # <<<<<<<<<<<<<< - * if x < 1./3: - * kernel += 15*(1./3-x)**5 + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 + * */ - __pyx_v_kernel = (__pyx_v_kernel - (6.0 * pow(((2. / 3.0) - __pyx_v_x), 5.0))); + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "particle_deposit.pxd":78 - * if x < 2./3: - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: # <<<<<<<<<<<<<< - * kernel += 15*(1./3-x)**5 - * else: + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_t_5 = ((__pyx_v_x < (1. / 3.0)) != 0); - if (__pyx_t_5) { + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "particle_deposit.pxd":79 - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: - * kernel += 15*(1./3-x)**5 # <<<<<<<<<<<<<< - * else: - * kernel = 0. + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - __pyx_v_kernel = (__pyx_v_kernel + (15.0 * pow(((1. / 3.0) - __pyx_v_x), 5.0))); - /* "particle_deposit.pxd":78 - * if x < 2./3: - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: # <<<<<<<<<<<<<< - * kernel += 15*(1./3-x)**5 - * else: - */ - } + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "particle_deposit.pxd":76 - * if x < 1: - * kernel = (1.-x)**5 - * if x < 2./3: # <<<<<<<<<<<<<< - * kernel -= 6*(2./3-x)**5 - * if x < 1./3: +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ - } - /* "particle_deposit.pxd":74 - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**5 - * if x < 2./3: - */ - goto __pyx_L3; - } +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; - /* "particle_deposit.pxd":81 - * kernel += 15*(1./3-x)**5 - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C + /* "yt/utilities/lib/fp_utils.pxd":36 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 * */ - /*else*/ { - __pyx_v_kernel = 0.; + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + if (__pyx_t_1) { + __pyx_r = (-__pyx_v_f0); + goto __pyx_L0; } - __pyx_L3:; - /* "particle_deposit.pxd":82 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< * - * # Wendland C2 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); + __pyx_r = __pyx_v_f0; goto __pyx_L0; - /* "particle_deposit.pxd":71 + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * - * # quintic spline - * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 3.**7/40/np.pi + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quintic", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "particle_deposit.pxd":85 +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 * - * # Wendland C2 - * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_wendland2", 0); - - /* "particle_deposit.pxd":87 - * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**4 * (1+4*x) - */ - __pyx_t_1 = PyFloat_FromDouble((21. / 2.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 87, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; - - /* "particle_deposit.pxd":88 - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**4 * (1+4*x) - * else: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { - /* "particle_deposit.pxd":89 - * cdef np.float64_t C = 21./2/np.pi - * if x < 1: - * kernel = (1.-x)**4 * (1+4*x) # <<<<<<<<<<<<<< - * else: - * kernel = 0. - */ - __pyx_v_kernel = (pow((1. - __pyx_v_x), 4.0) * (1.0 + (4.0 * __pyx_v_x))); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "particle_deposit.pxd":88 - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**4 * (1+4*x) - * else: + /* "yt/utilities/lib/fp_utils.pxd":40 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - goto __pyx_L3; + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; } - /* "particle_deposit.pxd":91 - * kernel = (1.-x)**4 * (1+4*x) - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * */ - /*else*/ { - __pyx_v_kernel = 0.; + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; } - __pyx_L3:; - /* "particle_deposit.pxd":92 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * - * # Wendland C4 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); + __pyx_r = __pyx_v_i; goto __pyx_L0; - /* "particle_deposit.pxd":85 + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 * - * # Wendland C2 - * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 21./2/np.pi + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland2", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "particle_deposit.pxd":95 +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * # Wendland C4 - * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; - __pyx_t_5numpy_float64_t __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_wendland4", 0); - - /* "particle_deposit.pxd":97 - * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) - */ - __pyx_t_1 = PyFloat_FromDouble((495. / 32.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 97, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; - - /* "particle_deposit.pxd":98 - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) - * else: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { - /* "particle_deposit.pxd":99 - * cdef np.float64_t C = 495./32/np.pi - * if x < 1: - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) # <<<<<<<<<<<<<< - * else: - * kernel = 0. - */ - __pyx_v_kernel = (pow((1. - __pyx_v_x), 6.0) * ((1.0 + (6.0 * __pyx_v_x)) + ((35. / 3.0) * pow(__pyx_v_x, 2.0)))); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "particle_deposit.pxd":98 - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) - * else: + /* "yt/utilities/lib/fp_utils.pxd":45 + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - goto __pyx_L3; + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; } - /* "particle_deposit.pxd":101 - * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * */ - /*else*/ { - __pyx_v_kernel = 0.; + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; } - __pyx_L3:; - /* "particle_deposit.pxd":102 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * - * # Wendland C6 + * cdef inline np.float64_t fclip(np.float64_t f, */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); + __pyx_r = __pyx_v_i; goto __pyx_L0; - /* "particle_deposit.pxd":95 + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * # Wendland C4 - * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 495./32/np.pi + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland4", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "particle_deposit.pxd":105 +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * # Wendland C6 - * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_v_kernel; - __pyx_t_5numpy_float64_t __pyx_v_C; +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { __pyx_t_5numpy_float64_t __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("sph_kernel_wendland6", 0); - /* "particle_deposit.pxd":107 - * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi # <<<<<<<<<<<<<< - * if x < 1: - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_t_1 = PyFloat_FromDouble((1365. / 64.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 107, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_C = __pyx_t_4; + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; - /* "particle_deposit.pxd":108 - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) - * else: + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i + * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); - if (__pyx_t_5) { - /* "particle_deposit.pxd":109 - * cdef np.float64_t C = 1365./64/np.pi - * if x < 1: - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) # <<<<<<<<<<<<<< - * else: - * kernel = 0. - */ - __pyx_v_kernel = (pow((1. - __pyx_v_x), 8.0) * (((1.0 + (8.0 * __pyx_v_x)) + (25.0 * pow(__pyx_v_x, 2.0))) + (32.0 * pow(__pyx_v_x, 3.0)))); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "particle_deposit.pxd":108 - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi - * if x < 1: # <<<<<<<<<<<<<< - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) - * else: +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - goto __pyx_L3; - } - /* "particle_deposit.pxd":111 - * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) - * else: - * kernel = 0. # <<<<<<<<<<<<<< - * return kernel * C +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * */ - /*else*/ { - __pyx_v_kernel = 0.; + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - __pyx_L3:; - /* "particle_deposit.pxd":112 - * else: - * kernel = 0. - * return kernel * C # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * # I don't know the way to use a dict in a cdef class. + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_r = (__pyx_v_kernel * __pyx_v_C); + __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "particle_deposit.pxd":105 + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * # Wendland C6 - * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): # <<<<<<<<<<<<<< - * cdef np.float64_t kernel - * cdef np.float64_t C = 1365./64/np.pi + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland6", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "particle_deposit.pxd":118 - * # I manually created a function to lookup the kernel functions. - * ctypedef np.float64_t (*kernel_func) (np.float64_t) - * cdef inline kernel_func get_kernel_func(str kernel_name): # <<<<<<<<<<<<<< - * if kernel_name == 'cubic': - * return sph_kernel_cubic +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ -static CYTHON_INLINE __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(PyObject *__pyx_v_kernel_name) { - __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_r; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("get_kernel_func", 0); - - /* "particle_deposit.pxd":119 - * ctypedef np.float64_t (*kernel_func) (np.float64_t) - * cdef inline kernel_func get_kernel_func(str kernel_name): - * if kernel_name == 'cubic': # <<<<<<<<<<<<<< - * return sph_kernel_cubic - * elif kernel_name == 'quartic': - */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_cubic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 119, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - /* "particle_deposit.pxd":120 - * cdef inline kernel_func get_kernel_func(str kernel_name): - * if kernel_name == 'cubic': - * return sph_kernel_cubic # <<<<<<<<<<<<<< - * elif kernel_name == 'quartic': - * return sph_kernel_quartic + /* "yt/utilities/lib/fp_utils.pxd":58 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic; + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; goto __pyx_L0; - - /* "particle_deposit.pxd":119 - * ctypedef np.float64_t (*kernel_func) (np.float64_t) - * cdef inline kernel_func get_kernel_func(str kernel_name): - * if kernel_name == 'cubic': # <<<<<<<<<<<<<< - * return sph_kernel_cubic - * elif kernel_name == 'quartic': - */ } - /* "particle_deposit.pxd":121 - * if kernel_name == 'cubic': - * return sph_kernel_cubic - * elif kernel_name == 'quartic': # <<<<<<<<<<<<<< - * return sph_kernel_quartic - * elif kernel_name == 'quintic': + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quartic, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 121, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "particle_deposit.pxd":122 - * return sph_kernel_cubic - * elif kernel_name == 'quartic': - * return sph_kernel_quartic # <<<<<<<<<<<<<< - * elif kernel_name == 'quintic': - * return sph_kernel_quintic + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic; - goto __pyx_L0; - /* "particle_deposit.pxd":121 - * if kernel_name == 'cubic': - * return sph_kernel_cubic - * elif kernel_name == 'quartic': # <<<<<<<<<<<<<< - * return sph_kernel_quartic - * elif kernel_name == 'quintic': - */ - } + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "particle_deposit.pxd":123 - * elif kernel_name == 'quartic': - * return sph_kernel_quartic - * elif kernel_name == 'quintic': # <<<<<<<<<<<<<< - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quintic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 123, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - /* "particle_deposit.pxd":124 - * return sph_kernel_quartic - * elif kernel_name == 'quintic': - * return sph_kernel_quintic # <<<<<<<<<<<<<< - * elif kernel_name == 'wendland2': - * return sph_kernel_wendland2 - */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic; - goto __pyx_L0; +/* 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)); - /* "particle_deposit.pxd":123 - * elif kernel_name == 'quartic': - * return sph_kernel_quartic - * elif kernel_name == 'quintic': # <<<<<<<<<<<<<< - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': - */ + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "particle_deposit.pxd":125 - * elif kernel_name == 'quintic': - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': # <<<<<<<<<<<<<< - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 125, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_2 != 0); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); if (__pyx_t_1) { - - /* "particle_deposit.pxd":126 - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': - * return sph_kernel_wendland2 # <<<<<<<<<<<<<< - * elif kernel_name == 'wendland4': - * return sph_kernel_wendland4 - */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2; + __pyx_r = 0; goto __pyx_L0; - - /* "particle_deposit.pxd":125 - * elif kernel_name == 'quintic': - * return sph_kernel_quintic - * elif kernel_name == 'wendland2': # <<<<<<<<<<<<<< - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': - */ } - /* "particle_deposit.pxd":127 - * elif kernel_name == 'wendland2': - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': # <<<<<<<<<<<<<< - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 127, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_v_endian_detector = 1; - /* "particle_deposit.pxd":128 - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': - * return sph_kernel_wendland4 # <<<<<<<<<<<<<< - * elif kernel_name == 'wendland6': - * return sph_kernel_wendland6 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4; - goto __pyx_L0; + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "particle_deposit.pxd":127 - * elif kernel_name == 'wendland2': - * return sph_kernel_wendland2 - * elif kernel_name == 'wendland4': # <<<<<<<<<<<<<< - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - } + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "particle_deposit.pxd":129 - * elif kernel_name == 'wendland4': - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': # <<<<<<<<<<<<<< - * return sph_kernel_wendland6 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland6, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 129, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_2 != 0); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "particle_deposit.pxd":130 - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': - * return sph_kernel_wendland6 # <<<<<<<<<<<<<< - * else: - * raise NotImplementedError + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ - __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6; - goto __pyx_L0; + __pyx_v_copy_shape = 1; - /* "particle_deposit.pxd":129 - * elif kernel_name == 'wendland4': - * return sph_kernel_wendland4 - * elif kernel_name == 'wendland6': # <<<<<<<<<<<<<< - * return sph_kernel_wendland6 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; } - /* "particle_deposit.pxd":132 - * return sph_kernel_wendland6 - * else: - * raise NotImplementedError # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< * - * cdef class ParticleDepositOperation: + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ /*else*/ { - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(1, 132, __pyx_L1_error) + __pyx_v_copy_shape = 0; } + __pyx_L4:; - /* "particle_deposit.pxd":118 - * # I manually created a function to lookup the kernel functions. - * ctypedef np.float64_t (*kernel_func) (np.float64_t) - * cdef inline kernel_func get_kernel_func(str kernel_name): # <<<<<<<<<<<<<< - * if kernel_name == 'cubic': - * return sph_kernel_cubic + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.particle_deposit.get_kernel_func", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "selection_routines.pxd":26 - * np.float64_t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; -static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_ensure_code", 0); - - /* "selection_routines.pxd":27 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): # <<<<<<<<<<<<<< - * if "code_length" == str(arr.units): - * return arr + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 27, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + if (__pyx_t_1) { - /* "selection_routines.pxd":28 - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< - * return arr - * arr.convert_to_units("code_length") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 28, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 28, __pyx_L1_error) + __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { - - /* "selection_routines.pxd":29 - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): - * return arr # <<<<<<<<<<<<<< - * arr.convert_to_units("code_length") - * return arr - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_arr); - __pyx_r = __pyx_v_arr; - goto __pyx_L0; + __PYX_ERR(3, 218, __pyx_L1_error) - /* "selection_routines.pxd":28 - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< - * return arr - * arr.convert_to_units("code_length") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - } + } - /* "selection_routines.pxd":30 - * if "code_length" == str(arr.units): - * return arr - * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< - * return arr + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } - /* "selection_routines.pxd":27 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") * - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): # <<<<<<<<<<<<<< - * if "code_length" == str(arr.units): - * return arr */ - } + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; - /* "selection_routines.pxd":31 - * return arr - * arr.convert_to_units("code_length") - * return arr # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef class SelectorObject: + * 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_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_arr); - __pyx_r = __pyx_v_arr; - goto __pyx_L0; + if (__pyx_t_1) { - /* "selection_routines.pxd":26 - * np.float64_t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * - * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): + * info.buf = PyArray_DATA(self) */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 222, __pyx_L1_error) - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "selection_routines.pxd":78 - * cdef public np.int64_t domain_id + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 + * 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") */ + } -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) { - __pyx_t_5numpy_float64_t __pyx_v_rel; - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "selection_routines.pxd":80 - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< - * if not periodic: return rel - * if rel > dw * 0.5: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ - __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); + __pyx_v_info->ndim = __pyx_v_ndim; - /* "selection_routines.pxd":81 - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel # <<<<<<<<<<<<<< - * if rel > dw * 0.5: - * rel -= dw + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0); + __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_rel; - goto __pyx_L0; - } - /* "selection_routines.pxd":82 - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel - * if rel > dw * 0.5: # <<<<<<<<<<<<<< - * rel -= dw - * elif rel < -dw * 0.5: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0); - if (__pyx_t_1) { + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "selection_routines.pxd":83 - * if not periodic: return rel - * if rel > dw * 0.5: - * rel -= dw # <<<<<<<<<<<<<< - * elif rel < -dw * 0.5: - * rel += dw + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ - __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw); + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "selection_routines.pxd":82 - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel - * if rel > dw * 0.5: # <<<<<<<<<<<<<< - * rel -= dw - * elif rel < -dw * 0.5: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ - goto __pyx_L4; - } + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "selection_routines.pxd":84 - * if rel > dw * 0.5: - * rel -= dw - * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< - * rel += dw - * return rel + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0); - if (__pyx_t_1) { + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "selection_routines.pxd":85 - * rel -= dw - * elif rel < -dw * 0.5: - * rel += dw # <<<<<<<<<<<<<< - * return rel + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) */ - __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw); + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } - /* "selection_routines.pxd":84 - * if rel > dw * 0.5: - * rel -= dw - * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< - * rel += dw - * return rel + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ + goto __pyx_L11; } - __pyx_L4:; - /* "selection_routines.pxd":86 - * elif rel < -dw * 0.5: - * rel += dw - * return rel # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL */ - __pyx_r = __pyx_v_rel; - goto __pyx_L0; + /*else*/ { + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "selection_routines.pxd":78 - * cdef public np.int64_t domain_id - * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":20 - * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * cdef int t */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ + __pyx_v_f = NULL; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 */ + __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; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":24 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< * + * if not hasfields and not copy_shape: */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * cdef inline int imin(int i0, int i1) nogil: + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + goto __pyx_L14; + } -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * + * if not hasfields: */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); } + __pyx_L14:; - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 259, __pyx_L1_error) - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); - if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; - } + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< - * - * cdef inline int iclip(int i, int a, int b) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "yt/utilities/lib/fp_utils.pxd":40 - * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(3, 278, __pyx_L1_error) + break; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * - * cdef inline np.float64_t fclip(np.float64_t f, + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + } - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ + __pyx_v_offset = 0; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + (__pyx_v_f[0]) = '\x00'; + } - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; +/* 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); - /* "yt/utilities/lib/fp_utils.pxd":54 - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + free(__pyx_v_info->format); - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 */ + free(__pyx_v_info->strides); -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + } - /* "yt/utilities/lib/fp_utils.pxd":58 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) * */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - __pyx_r = __pyx_v_i1; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ -/* 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; +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; __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)); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * 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(3, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * 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; } -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) * - * if info == NULL: return # <<<<<<<<<<<<<< + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * - * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) + * 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_v_endian_detector = 1; + __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(3, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * - * ndim = PyArray_NDIM(self) */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ - goto __pyx_L4; - } + __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(3, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * return PyArray_MultiIterNew(4, a, b, c, d) * - * 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") + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) * */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - if (__pyx_t_1) { +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 218, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< * - * 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") + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 * - * 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") + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ - if (__pyx_t_1) { + __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields * - * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 222, __pyx_L1_error) + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * 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") + * 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(3, 794, __pyx_L1_error) } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_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(3, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(3, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + * if (end - f) - (new_offset - offset[0]) < 15: */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(3, 796, __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(3, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 799, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * 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: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; } + __pyx_L8_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython */ - goto __pyx_L11; - } + __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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 803, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_info->suboffsets = NULL; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset */ - __pyx_v_f = NULL; + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< * + * offset[0] += child.itemsize */ - __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * offset[0] += child.itemsize # <<<<<<<<<<<<<< * - * if not hasfields and not copy_shape: + * if not PyDataType_HASFIELDS(child): */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ - goto __pyx_L14; - } + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * if not hasfields: */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(3, 823, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" */ - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __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(3, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 259, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" */ - } + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __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(3, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(3, 278, __pyx_L1_error) - break; - } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_v_info->format = __pyx_v_f; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * 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(3, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 844, __pyx_L1_error) + } + __pyx_L15:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - (__pyx_v_info->format[0]) = '^'; + goto __pyx_L13; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * */ - __pyx_v_offset = 0; + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(3, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * * - * def __releasebuffer__(ndarray self, Py_buffer* info): */ - (__pyx_v_f[0]) = '\x00'; - } + __pyx_r = __pyx_v_f; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ -/* 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) { +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; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! */ - free(__pyx_v_info->format); + __pyx_v_baseptr = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ + goto __pyx_L3; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + /*else*/ { + Py_INCREF(__pyx_v_base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr * */ - free(__pyx_v_info->strides); + Py_XDECREF(__pyx_v_arr->base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): */ - } + __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * - * cdef inline object PyArray_MultiIterNew2(a, b): + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) * */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __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(3, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 987, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + */ + __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(3, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { - PyObject *__pyx_r = NULL; +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __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(3, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 993, __pyx_L3_error) - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + */ + __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(3, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * cdef inline int import_ufunc() except -1: */ - __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(3, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -static CYTHON_INLINE 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; +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 999, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __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(3, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) +/* "particle_deposit.pxd":29 + * void *alloca(int) * - * 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. + * cdef inline int gind(int i, int j, int k, int dims[3]): # <<<<<<<<<<<<<< + * # The ordering is such that we want i to vary the slowest in this instance, + * # even though in other instances it varies the fastest. To see this in */ -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; +static CYTHON_INLINE int __pyx_f_2yt_8geometry_16particle_deposit_gind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dims) { + int __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); + __Pyx_RefNannySetupContext("gind", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "particle_deposit.pxd":34 + * # action, try looking at the results of an n_ref=256 particle CIC plot, + * # which shows it the most clearly. + * return ((i*dims[1])+j)*dims[2]+k # <<<<<<<<<<<<<< * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * 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); + __pyx_r = ((((__pyx_v_i * (__pyx_v_dims[1])) + __pyx_v_j) * (__pyx_v_dims[2])) + __pyx_v_k); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields + /* "particle_deposit.pxd":29 + * void *alloca(int) * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + * cdef inline int gind(int i, int j, int k, int dims[3]): # <<<<<<<<<<<<<< + * # The ordering is such that we want i to vary the slowest in this instance, + * # even though in other instances it varies the fastest. To see this in */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(3, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_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(3, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * 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(3, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< +/* "particle_deposit.pxd":41 + * #################################################### * - * if (end - f) - (new_offset - offset[0]) < 15: + * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 796, __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(3, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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(3, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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 + /* "particle_deposit.pxd":43 + * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 # <<<<<<<<<<<<<< + * if x <= 0.5: + * kernel = 1.-6.*x*x*(1.-x) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 799, __pyx_L1_error) + __pyx_v_C = 2.5464790894703255; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * + /* "particle_deposit.pxd":44 + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 + * if x <= 0.5: # <<<<<<<<<<<<<< + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: */ - } + __pyx_t_1 = ((__pyx_v_x <= 0.5) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "particle_deposit.pxd":45 + * cdef np.float64_t C = 2.5464790894703255 + * if x <= 0.5: + * kernel = 1.-6.*x*x*(1.-x) # <<<<<<<<<<<<<< + * elif x>0.5 and x<=1.0: + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) */ - __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:; + __pyx_v_kernel = (1. - (((6. * __pyx_v_x) * __pyx_v_x) * (1. - __pyx_v_x))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython + /* "particle_deposit.pxd":44 + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 + * if x <= 0.5: # <<<<<<<<<<<<<< + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: */ - __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:; + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "particle_deposit.pxd":46 + * if x <= 0.5: + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: # <<<<<<<<<<<<<< + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) + * else: */ - if (__pyx_t_6) { + __pyx_t_2 = ((__pyx_v_x > 0.5) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_x <= 1.0) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply + /* "particle_deposit.pxd":47 + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) # <<<<<<<<<<<<<< + * else: + * kernel = 0. */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 803, __pyx_L1_error) + __pyx_v_kernel = (((2. * (1. - __pyx_v_x)) * (1. - __pyx_v_x)) * (1. - __pyx_v_x)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "particle_deposit.pxd":46 + * if x <= 0.5: + * kernel = 1.-6.*x*x*(1.-x) + * elif x>0.5 and x<=1.0: # <<<<<<<<<<<<<< + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) + * else: */ - } + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "particle_deposit.pxd":49 + * kernel = 2.*(1.-x)*(1.-x)*(1.-x) + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C * - * # 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(3, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 */ - (__pyx_v_f[0]) = 0x78; + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 + /* "particle_deposit.pxd":50 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< * + * ######################################################## */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< + /* "particle_deposit.pxd":41 + * #################################################### * - * offset[0] += child.itemsize + * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil: # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 2.5464790894703255 */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize +/* "particle_deposit.pxd":57 * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + * # quartic spline + * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_quartic", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * + /* "particle_deposit.pxd":59 + * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**4 */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { + __pyx_t_1 = PyFloat_FromDouble((pow(5., 6.0) / 512.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 59, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings + /* "particle_deposit.pxd":60 + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**4 + * if x < 3./5: */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(3, 823, __pyx_L1_error) + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * + /* "particle_deposit.pxd":61 + * cdef np.float64_t C = 5.**6/512/np.pi + * if x < 1: + * kernel = (1.-x)**4 # <<<<<<<<<<<<<< + * if x < 3./5: + * kernel -= 5*(3./5-x)**4 */ - } + __pyx_v_kernel = pow((1. - __pyx_v_x), 4.0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" + /* "particle_deposit.pxd":62 + * if x < 1: + * kernel = (1.-x)**4 + * if x < 3./5: # <<<<<<<<<<<<<< + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } + __pyx_t_5 = ((__pyx_v_x < (3. / 5.0)) != 0); + if (__pyx_t_5) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } + /* "particle_deposit.pxd":63 + * kernel = (1.-x)**4 + * if x < 3./5: + * kernel -= 5*(3./5-x)**4 # <<<<<<<<<<<<<< + * if x < 1./5: + * kernel += 10*(1./5-x)**4 + */ + __pyx_v_kernel = (__pyx_v_kernel - (5.0 * pow(((3. / 5.0) - __pyx_v_x), 4.0))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" + /* "particle_deposit.pxd":64 + * if x < 3./5: + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: # <<<<<<<<<<<<<< + * kernel += 10*(1./5-x)**4 + * else: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } + __pyx_t_5 = ((__pyx_v_x < (1. / 5.0)) != 0); + if (__pyx_t_5) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" + /* "particle_deposit.pxd":65 + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: + * kernel += 10*(1./5-x)**4 # <<<<<<<<<<<<<< + * else: + * kernel = 0. */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } + __pyx_v_kernel = (__pyx_v_kernel + (10.0 * pow(((1. / 5.0) - __pyx_v_x), 4.0))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" + /* "particle_deposit.pxd":64 + * if x < 3./5: + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: # <<<<<<<<<<<<<< + * kernel += 10*(1./5-x)**4 + * else: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" + /* "particle_deposit.pxd":62 + * if x < 1: + * kernel = (1.-x)**4 + * if x < 3./5: # <<<<<<<<<<<<<< + * kernel -= 5*(3./5-x)**4 + * if x < 1./5: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" + /* "particle_deposit.pxd":60 + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**4 + * if x < 3./5: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + /* "particle_deposit.pxd":67 + * kernel += 10*(1./5-x)**4 + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C + * */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" + /* "particle_deposit.pxd":68 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< + * + * # quintic spline */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" + /* "particle_deposit.pxd":57 + * + * # quartic spline + * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 5.**6/512/np.pi */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quartic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "particle_deposit.pxd":71 + * + * # quintic spline + * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_quintic", 0); + + /* "particle_deposit.pxd":73 + * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**5 */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } + __pyx_t_1 = PyFloat_FromDouble((pow(3., 7.0) / 40.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + /* "particle_deposit.pxd":74 + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**5 + * if x < 2./3: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + /* "particle_deposit.pxd":75 + * cdef np.float64_t C = 3.**7/40/np.pi + * if x < 1: + * kernel = (1.-x)**5 # <<<<<<<<<<<<<< + * if x < 2./3: + * kernel -= 6*(2./3-x)**5 */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_v_kernel = pow((1. - __pyx_v_x), 5.0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" + /* "particle_deposit.pxd":76 + * if x < 1: + * kernel = (1.-x)**5 + * if x < 2./3: # <<<<<<<<<<<<<< + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_t_5 = ((__pyx_v_x < (2. / 3.0)) != 0); + if (__pyx_t_5) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: + /* "particle_deposit.pxd":77 + * kernel = (1.-x)**5 + * if x < 2./3: + * kernel -= 6*(2./3-x)**5 # <<<<<<<<<<<<<< + * if x < 1./3: + * kernel += 15*(1./3-x)**5 */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_v_kernel = (__pyx_v_kernel - (6.0 * pow(((2. / 3.0) - __pyx_v_x), 5.0))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "particle_deposit.pxd":78 + * if x < 2./3: + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: # <<<<<<<<<<<<<< + * kernel += 15*(1./3-x)**5 + * else: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } + __pyx_t_5 = ((__pyx_v_x < (1. / 3.0)) != 0); + if (__pyx_t_5) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: + /* "particle_deposit.pxd":79 + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: + * kernel += 15*(1./3-x)**5 # <<<<<<<<<<<<<< + * else: + * kernel = 0. */ - /*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(3, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 844, __pyx_L1_error) - } - __pyx_L15:; + __pyx_v_kernel = (__pyx_v_kernel + (15.0 * pow(((1. / 3.0) - __pyx_v_x), 5.0))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), + /* "particle_deposit.pxd":78 + * if x < 2./3: + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: # <<<<<<<<<<<<<< + * kernel += 15*(1./3-x)**5 + * else: */ - __pyx_v_f = (__pyx_v_f + 1); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + /* "particle_deposit.pxd":76 + * if x < 1: + * kernel = (1.-x)**5 + * if x < 2./3: # <<<<<<<<<<<<<< + * kernel -= 6*(2./3-x)**5 + * if x < 1./3: */ - goto __pyx_L13; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * + /* "particle_deposit.pxd":74 + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**5 + * if x < 2./3: */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(3, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields + /* "particle_deposit.pxd":81 + * kernel += 15*(1./3-x)**5 + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields */ + /*else*/ { + __pyx_v_kernel = 0.; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * + /* "particle_deposit.pxd":82 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< * + * # Wendland C2 */ - __pyx_r = __pyx_v_f; + __pyx_r = (__pyx_v_kernel * __pyx_v_C); goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "particle_deposit.pxd":71 * - * 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. + * # quintic spline + * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 3.**7/40/np.pi */ /* 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_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quintic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * +/* "particle_deposit.pxd":85 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * # Wendland C2 + * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_wendland2", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "particle_deposit.pxd":87 + * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**4 * (1+4*x) */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = PyFloat_FromDouble((21. / 2.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! + /* "particle_deposit.pxd":88 + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**4 * (1+4*x) + * else: */ - __pyx_v_baseptr = NULL; + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "particle_deposit.pxd":89 + * cdef np.float64_t C = 21./2/np.pi + * if x < 1: + * kernel = (1.-x)**4 * (1+4*x) # <<<<<<<<<<<<<< + * else: + * kernel = 0. + */ + __pyx_v_kernel = (pow((1. - __pyx_v_x), 4.0) * (1.0 + (4.0 * __pyx_v_x))); + + /* "particle_deposit.pxd":88 + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**4 * (1+4*x) + * else: */ goto __pyx_L3; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) + /* "particle_deposit.pxd":91 + * kernel = (1.-x)**4 * (1+4*x) + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C + * */ /*else*/ { - Py_INCREF(__pyx_v_base); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * 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_v_kernel = 0.; } __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< + /* "particle_deposit.pxd":92 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): + * # Wendland C4 */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * + /* "particle_deposit.pxd":85 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * # Wendland C2 + * cdef inline np.float64_t sph_kernel_wendland2(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 21./2/np.pi */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland2", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr +/* "particle_deposit.pxd":95 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * # Wendland C4 + * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __pyx_r; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_wendland4", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None + /* "particle_deposit.pxd":97 + * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) + */ + __pyx_t_1 = PyFloat_FromDouble((495. / 32.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; + + /* "particle_deposit.pxd":98 + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) * else: */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< + /* "particle_deposit.pxd":99 + * cdef np.float64_t C = 495./32/np.pi + * if x < 1: + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) # <<<<<<<<<<<<<< * else: - * return arr.base + * kernel = 0. */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + __pyx_v_kernel = (pow((1. - __pyx_v_x), 6.0) * ((1.0 + (6.0 * __pyx_v_x)) + ((35. / 3.0) * pow(__pyx_v_x, 2.0)))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None + /* "particle_deposit.pxd":98 + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) * else: */ + goto __pyx_L3; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None + /* "particle_deposit.pxd":101 + * kernel = (1.-x)**6 * (1+6*x+35./3*x**2) * else: - * return arr.base # <<<<<<<<<<<<<< - * + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C * */ /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; + __pyx_v_kernel = 0.; } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "particle_deposit.pxd":102 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * # Wendland C6 + */ + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; + + /* "particle_deposit.pxd":95 + * + * # Wendland C4 + * cdef inline np.float64_t sph_kernel_wendland4(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 495./32/np.pi */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland4", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() +/* "particle_deposit.pxd":105 + * + * # Wendland C6 + * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi */ -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6(__pyx_t_5numpy_float64_t __pyx_v_x) { + __pyx_t_5numpy_float64_t __pyx_v_kernel; + __pyx_t_5numpy_float64_t __pyx_v_C; + __pyx_t_5numpy_float64_t __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); + __pyx_t_5numpy_float64_t __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("sph_kernel_wendland6", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "particle_deposit.pxd":107 + * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi # <<<<<<<<<<<<<< + * if x < 1: + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) */ - { - __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:*/ { + __pyx_t_1 = PyFloat_FromDouble((1365. / 64.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(4, 107, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_C = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") + /* "particle_deposit.pxd":108 + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + * else: */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 987, __pyx_L3_error) + __pyx_t_5 = ((__pyx_v_x < 1.0) != 0); + if (__pyx_t_5) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "particle_deposit.pxd":109 + * cdef np.float64_t C = 1365./64/np.pi + * if x < 1: + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) # <<<<<<<<<<<<<< + * else: + * kernel = 0. */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_v_kernel = (pow((1. - __pyx_v_x), 8.0) * (((1.0 + (8.0 * __pyx_v_x)) + (25.0 * pow(__pyx_v_x, 2.0))) + (32.0 * pow(__pyx_v_x, 3.0)))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") - * + /* "particle_deposit.pxd":108 + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi + * if x < 1: # <<<<<<<<<<<<<< + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + * else: */ - __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(3, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + /* "particle_deposit.pxd":111 + * kernel = (1.-x)**8 * (1+8*x+25*x**2+32*x**3) + * else: + * kernel = 0. # <<<<<<<<<<<<<< + * return kernel * C * - * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(3, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + /*else*/ { + __pyx_v_kernel = 0.; + } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "particle_deposit.pxd":112 + * else: + * kernel = 0. + * return kernel * C # <<<<<<<<<<<<<< + * + * # I don't know the way to use a dict in a cdef class. */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = (__pyx_v_kernel * __pyx_v_C); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "particle_deposit.pxd":105 + * + * # Wendland C6 + * cdef inline np.float64_t sph_kernel_wendland6(np.float64_t x): # <<<<<<<<<<<<<< + * cdef np.float64_t kernel + * cdef np.float64_t C = 1365./64/np.pi */ /* 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_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_wendland6", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() +/* "particle_deposit.pxd":118 + * # I manually created a function to lookup the kernel functions. + * ctypedef np.float64_t (*kernel_func) (np.float64_t) + * cdef inline kernel_func get_kernel_func(str kernel_name): # <<<<<<<<<<<<<< + * if kernel_name == 'cubic': + * return sph_kernel_cubic */ -static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(PyObject *__pyx_v_kernel_name) { + __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __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); + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("get_kernel_func", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "particle_deposit.pxd":119 + * ctypedef np.float64_t (*kernel_func) (np.float64_t) + * cdef inline kernel_func get_kernel_func(str kernel_name): + * if kernel_name == 'cubic': # <<<<<<<<<<<<<< + * return sph_kernel_cubic + * elif kernel_name == 'quartic': + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_cubic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 119, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "particle_deposit.pxd":120 + * cdef inline kernel_func get_kernel_func(str kernel_name): + * if kernel_name == 'cubic': + * return sph_kernel_cubic # <<<<<<<<<<<<<< + * elif kernel_name == 'quartic': + * return sph_kernel_quartic + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic; + goto __pyx_L0; + + /* "particle_deposit.pxd":119 + * ctypedef np.float64_t (*kernel_func) (np.float64_t) + * cdef inline kernel_func get_kernel_func(str kernel_name): + * if kernel_name == 'cubic': # <<<<<<<<<<<<<< + * return sph_kernel_cubic + * elif kernel_name == 'quartic': + */ + } + + /* "particle_deposit.pxd":121 + * if kernel_name == 'cubic': + * return sph_kernel_cubic + * elif kernel_name == 'quartic': # <<<<<<<<<<<<<< + * return sph_kernel_quartic + * elif kernel_name == 'quintic': */ - { - __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:*/ { + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quartic, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 121, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "particle_deposit.pxd":122 + * return sph_kernel_cubic + * elif kernel_name == 'quartic': + * return sph_kernel_quartic # <<<<<<<<<<<<<< + * elif kernel_name == 'quintic': + * return sph_kernel_quintic */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 993, __pyx_L3_error) + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "particle_deposit.pxd":121 + * if kernel_name == 'cubic': + * return sph_kernel_cubic + * elif kernel_name == 'quartic': # <<<<<<<<<<<<<< + * return sph_kernel_quartic + * elif kernel_name == 'quintic': */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * + /* "particle_deposit.pxd":123 + * elif kernel_name == 'quartic': + * return sph_kernel_quartic + * elif kernel_name == 'quintic': # <<<<<<<<<<<<<< + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': */ - __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(3, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quintic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 123, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_ufunc() except -1: + /* "particle_deposit.pxd":124 + * return sph_kernel_quartic + * elif kernel_name == 'quintic': + * return sph_kernel_quintic # <<<<<<<<<<<<<< + * elif kernel_name == 'wendland2': + * return sph_kernel_wendland2 */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(3, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "particle_deposit.pxd":123 + * elif kernel_name == 'quartic': + * return sph_kernel_quartic + * elif kernel_name == 'quintic': # <<<<<<<<<<<<<< + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + /* "particle_deposit.pxd":125 + * elif kernel_name == 'quintic': + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': # <<<<<<<<<<<<<< + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': */ + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 125, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { - /* 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; -} + /* "particle_deposit.pxd":126 + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': + * return sph_kernel_wendland2 # <<<<<<<<<<<<<< + * elif kernel_name == 'wendland4': + * return sph_kernel_wendland4 + */ + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland2; + goto __pyx_L0; -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + /* "particle_deposit.pxd":125 + * elif kernel_name == 'quintic': + * return sph_kernel_quintic + * elif kernel_name == 'wendland2': # <<<<<<<<<<<<<< + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': */ + } -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); + /* "particle_deposit.pxd":127 + * elif kernel_name == 'wendland2': + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': # <<<<<<<<<<<<<< + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 127, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "particle_deposit.pxd":128 + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': + * return sph_kernel_wendland4 # <<<<<<<<<<<<<< + * elif kernel_name == 'wendland6': + * return sph_kernel_wendland6 */ - { - __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:*/ { + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland4; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "particle_deposit.pxd":127 + * elif kernel_name == 'wendland2': + * return sph_kernel_wendland2 + * elif kernel_name == 'wendland4': # <<<<<<<<<<<<<< + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 999, __pyx_L3_error) + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "particle_deposit.pxd":129 + * elif kernel_name == 'wendland4': + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': # <<<<<<<<<<<<<< + * return sph_kernel_wendland6 + * else: */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_wendland6, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 129, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "particle_deposit.pxd":130 + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': + * return sph_kernel_wendland6 # <<<<<<<<<<<<<< + * else: + * raise NotImplementedError */ - __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(3, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_wendland6; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "particle_deposit.pxd":129 + * elif kernel_name == 'wendland4': + * return sph_kernel_wendland4 + * elif kernel_name == 'wendland6': # <<<<<<<<<<<<<< + * return sph_kernel_wendland6 + * else: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(3, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "particle_deposit.pxd":132 + * return sph_kernel_wendland6 + * else: + * raise NotImplementedError # <<<<<<<<<<<<<< * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef class ParticleDepositOperation: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + /*else*/ { + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + __PYX_ERR(4, 132, __pyx_L1_error) } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + /* "particle_deposit.pxd":118 + * # I manually created a function to lookup the kernel functions. + * ctypedef np.float64_t (*kernel_func) (np.float64_t) + * cdef inline kernel_func get_kernel_func(str kernel_name): # <<<<<<<<<<<<<< + * if kernel_name == 'cubic': + * return sph_kernel_cubic */ /* 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_WriteUnraisable("yt.geometry.particle_deposit.get_kernel_func", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -16819,10 +17293,15 @@ 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; } @@ -16831,21 +17310,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(4, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(4, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -16853,12 +17336,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -16867,11 +17352,11 @@ } } __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(4, 120, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 121, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) } else { /* "View.MemoryView":121 @@ -16886,15 +17371,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(4, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(4, 120, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __pyx_L1_error) } __pyx_r = __pyx_array___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); @@ -16945,9 +17430,9 @@ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(4, 127, __pyx_L1_error) + __PYX_ERR(1, 127, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(4, 127, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 @@ -16976,11 +17461,11 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 131, __pyx_L1_error) + __PYX_ERR(1, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize @@ -17008,11 +17493,11 @@ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 134, __pyx_L1_error) + __PYX_ERR(1, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") @@ -17041,9 +17526,9 @@ * 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(4, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -17065,7 +17550,7 @@ * 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(4, 138, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) __pyx_t_5 = __pyx_v_format; __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -17081,7 +17566,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(4, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -17119,11 +17604,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 146, __pyx_L1_error) + __PYX_ERR(1, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim @@ -17146,12 +17631,12 @@ 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(4, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 149, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dim = __pyx_t_8; __pyx_v_idx = __pyx_t_7; @@ -17174,11 +17659,11 @@ * self._shape[idx] = dim * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); @@ -17186,20 +17671,20 @@ 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(4, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(4, 151, __pyx_L1_error) + __PYX_ERR(1, 151, __pyx_L1_error) /* "View.MemoryView":150 * @@ -17236,7 +17721,7 @@ * 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(4, 155, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":156 @@ -17278,7 +17763,7 @@ * 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(4, 158, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":159 @@ -17321,19 +17806,19 @@ * 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(4, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 162, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 162, __pyx_L1_error) + __PYX_ERR(1, 162, __pyx_L1_error) } __pyx_L10:; @@ -17362,8 +17847,8 @@ * if allocate_buffer: * */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 168, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; @@ -17403,11 +17888,11 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 174, __pyx_L1_error) + __PYX_ERR(1, 174, __pyx_L1_error) /* "View.MemoryView":173 * @@ -17446,11 +17931,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(4, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __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(4, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { @@ -17571,7 +18056,7 @@ * 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(4, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -17601,7 +18086,7 @@ * 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(4, 187, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { @@ -17641,11 +18126,11 @@ * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 190, __pyx_L1_error) + __PYX_ERR(1, 190, __pyx_L1_error) /* "View.MemoryView":189 * elif self.mode == u"fortran": @@ -17985,7 +18470,7 @@ * @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(4, 221, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18044,11 +18529,11 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -18059,7 +18544,7 @@ 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(4, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -18123,9 +18608,9 @@ * 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(4, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -18188,9 +18673,9 @@ * 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(4, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 233, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -18251,9 +18736,9 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(4, 236, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":235 @@ -18276,6 +18761,113 @@ 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__56, 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__57, 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":240 * * @cname("__pyx_array_new") @@ -18312,13 +18904,13 @@ * 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(4, 245, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 245, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -18332,7 +18924,7 @@ __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(4, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -18356,13 +18948,13 @@ * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -18384,9 +18976,9 @@ * result.data = buf * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 248, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(4, 248, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) /* "View.MemoryView":247 * result = array(shape, itemsize, format, mode.decode('ASCII')) @@ -18395,7 +18987,7 @@ * 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(4, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -18471,6 +19063,7 @@ 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; } @@ -18481,7 +19074,7 @@ 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(4, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -18492,7 +19085,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18570,20 +19163,307 @@ * * cdef generic = Enum("") */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->name); - __pyx_r = __pyx_v_self->name; - goto __pyx_L0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* "View.MemoryView":279 + * 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; - /* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * + /* "(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(); @@ -18698,8 +19578,11 @@ 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; } @@ -18708,11 +19591,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(4, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -18720,11 +19605,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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; @@ -18732,16 +19618,16 @@ } } __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(4, 341, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 341, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18812,7 +19698,7 @@ * 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 == -1)) __PYX_ERR(4, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) /* "View.MemoryView":346 * if type(self) is memoryview or obj is not None: @@ -18933,7 +19819,7 @@ * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(4, 357, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) /* "View.MemoryView":356 * if self.lock is NULL: @@ -19274,26 +20160,26 @@ __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(4, 389, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 389, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(4, 389, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(4, 389, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -19303,7 +20189,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(4, 389, __pyx_L1_error) + else __PYX_ERR(1, 389, __pyx_L1_error) } break; } @@ -19321,8 +20207,8 @@ * * 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(4, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(4, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":389 @@ -19439,7 +20325,7 @@ * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 399, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -19451,7 +20337,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(4, 399, __pyx_L1_error) + __PYX_ERR(1, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -19459,14 +20345,14 @@ __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(4, 399, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 399, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 399, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; @@ -19480,7 +20366,7 @@ * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":403 @@ -19491,7 +20377,7 @@ * 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(4, 403, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -19514,7 +20400,7 @@ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(4, 405, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":406 @@ -19525,7 +20411,7 @@ * 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(4, 406, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -19595,7 +20481,7 @@ * * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 409, __pyx_L1_error) + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; @@ -19607,7 +20493,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(4, 409, __pyx_L1_error) + __PYX_ERR(1, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); @@ -19615,14 +20501,14 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 409, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 409, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 409, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; @@ -19636,7 +20522,7 @@ * obj = self.is_slice(value) * if obj: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":412 @@ -19646,7 +20532,7 @@ * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 412, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; @@ -19658,7 +20544,7 @@ * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":414 @@ -19668,9 +20554,9 @@ * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 414, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -19693,10 +20579,10 @@ * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 416, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19721,7 +20607,7 @@ * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 418, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -19809,7 +20695,7 @@ * 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(4, 423, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":424 @@ -19819,7 +20705,7 @@ * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 424, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":423 @@ -19829,7 +20715,7 @@ * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 423, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -19840,7 +20726,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(4, 423, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -19857,7 +20743,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -19874,7 +20760,7 @@ __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(4, 425, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); @@ -19917,7 +20803,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -19989,7 +20875,7 @@ * 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(4, 434, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":435 * @@ -19998,7 +20884,7 @@ * 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(4, 435, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) /* "View.MemoryView":436 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], @@ -20007,13 +20893,13 @@ * * 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(4, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":434 @@ -20023,7 +20909,7 @@ * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 434, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":430 * return obj @@ -20129,7 +21015,7 @@ * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(4, 450, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) /* "View.MemoryView":449 * if self.view.itemsize > sizeof(array): @@ -20217,7 +21103,7 @@ * */ /*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(4, 459, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 459, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -20240,7 +21126,7 @@ * 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(4, 464, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20355,7 +21241,7 @@ * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(4, 471, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":472 @@ -20365,7 +21251,7 @@ * * 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(4, 472, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20424,7 +21310,7 @@ * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -20436,7 +21322,7 @@ * 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(4, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -20464,9 +21350,9 @@ * 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(4, 482, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 482, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -20483,7 +21369,7 @@ #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(4, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -20492,14 +21378,14 @@ #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(4, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 482, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -20510,7 +21396,7 @@ __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(4, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -20547,7 +21433,7 @@ * */ __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(4, 487, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20589,13 +21475,13 @@ * raise ValueError("Unable to convert item to object") * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 483, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(4, 483, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); @@ -20607,11 +21493,11 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(4, 484, __pyx_L5_except_error) + __PYX_ERR(1, 484, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -20702,7 +21588,7 @@ * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -20725,26 +21611,26 @@ * 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(4, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(4, 499, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -20766,9 +21652,9 @@ * 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(4, 501, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -20785,7 +21671,7 @@ #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(4, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -20794,14 +21680,14 @@ #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(4, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 501, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -20812,12 +21698,12 @@ __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(4, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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(4, 501, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 501, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } @@ -20833,7 +21719,7 @@ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(4, 503, __pyx_L1_error) + __PYX_ERR(1, 503, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -21220,9 +22106,9 @@ * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 540, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(4, 540, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; @@ -21233,7 +22119,7 @@ * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(4, 541, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) /* "View.MemoryView":542 * cdef _memoryviewslice result = memoryview_copy(self) @@ -21360,18 +22246,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 550, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_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(4, 550, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(4, 550, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 550, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; @@ -21448,11 +22334,11 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(4, 556, __pyx_L1_error) + __PYX_ERR(1, 556, __pyx_L1_error) /* "View.MemoryView":554 * @property @@ -21471,18 +22357,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 558, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_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(4, 558, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 558, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 558, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; @@ -21560,9 +22446,9 @@ * 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(4, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__46, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__60, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -21586,18 +22472,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 565, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 565, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(4, 565, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 565, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -21659,7 +22545,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21719,7 +22605,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21781,11 +22667,11 @@ * @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(4, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 577, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -21879,7 +22765,7 @@ __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(4, 584, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; @@ -21891,7 +22777,7 @@ * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 585, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; @@ -22069,12 +22955,12 @@ * */ __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(4, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -22085,12 +22971,12 @@ * * def __str__(self): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 599, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -22101,7 +22987,7 @@ * id(self)) * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -22109,7 +22995,7 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -22173,20 +23059,20 @@ * */ __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(4, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 602, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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(4, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -22259,7 +23145,7 @@ * 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(4, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22330,7 +23216,7 @@ * 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(4, 615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22410,7 +23296,7 @@ * 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(4, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":627 @@ -22421,7 +23307,7 @@ * 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(4, 627, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -22502,7 +23388,7 @@ * 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(4, 634, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":639 @@ -22513,7 +23399,7 @@ * */ __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(4, 639, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -22538,6 +23424,113 @@ 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__61, 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__62, 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":643 * * @cname('__pyx_memoryview_new') @@ -22562,11 +23555,11 @@ * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 644, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -22577,7 +23570,7 @@ 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(4, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); @@ -22714,7 +23707,7 @@ * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -22752,7 +23745,7 @@ * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 662, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -22788,26 +23781,26 @@ __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(4, 665, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 665, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(4, 665, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(4, 665, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -22817,7 +23810,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(4, 665, __pyx_L1_error) + else __PYX_ERR(1, 665, __pyx_L1_error) } break; } @@ -22827,7 +23820,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(4, 665, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -22861,17 +23854,17 @@ * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(4, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 668, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__47); - __Pyx_GIVEREF(__pyx_slice__47); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__47); + __Pyx_INCREF(__pyx_slice__63); + __Pyx_GIVEREF(__pyx_slice__63); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__63); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 668, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":669 @@ -22901,7 +23894,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__48); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__64); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) } __pyx_L7:; @@ -22951,19 +23944,19 @@ * * 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(4, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 675, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(4, 675, __pyx_L1_error) + __PYX_ERR(1, 675, __pyx_L1_error) /* "View.MemoryView":674 * have_slices = True @@ -23000,7 +23993,7 @@ * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 678, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) } __pyx_L6:; @@ -23022,7 +24015,7 @@ * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(4, 680, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":681 @@ -23042,16 +24035,16 @@ * * 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(4, 682, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__49); - __Pyx_GIVEREF(__pyx_slice__49); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__49); + __Pyx_INCREF(__pyx_slice__65); + __Pyx_GIVEREF(__pyx_slice__65); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__65); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(4, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":681 @@ -23073,20 +24066,20 @@ __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(4, 684, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 684, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 684, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 684, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -23172,11 +24165,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(4, 689, __pyx_L1_error) + __PYX_ERR(1, 689, __pyx_L1_error) /* "View.MemoryView":688 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): @@ -23280,7 +24273,7 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(4, 708, __pyx_L1_error) + __PYX_ERR(1, 708, __pyx_L1_error) } } #endif @@ -23303,7 +24296,7 @@ * 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(4, 711, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -23399,26 +24392,26 @@ __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(4, 732, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 732, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(4, 732, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(4, 732, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -23428,7 +24421,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(4, 732, __pyx_L1_error) + else __PYX_ERR(1, 732, __pyx_L1_error) } break; } @@ -23456,7 +24449,7 @@ * 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(4, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) /* "View.MemoryView":734 * for dim, index in enumerate(indices): @@ -23465,7 +24458,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(4, 734, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) /* "View.MemoryView":733 * @@ -23542,13 +24535,13 @@ * 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(4, 746, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 746, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -23564,13 +24557,13 @@ * 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(4, 747, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 747, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -23586,13 +24579,13 @@ * * 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(4, 748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 748, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -23608,7 +24601,7 @@ * 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(4, 750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -23621,7 +24614,7 @@ * 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(4, 751, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -23634,7 +24627,7 @@ * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 752, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -23647,7 +24640,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(4, 754, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) /* "View.MemoryView":760 * have_start, have_stop, have_step, @@ -23697,7 +24690,7 @@ * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(4, 764, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } /* "View.MemoryView":765 * return memoryview_fromslice(dst, new_ndim, @@ -23706,7 +24699,7 @@ * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(4, 765, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } /* "View.MemoryView":763 * @@ -23715,9 +24708,9 @@ * 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(4, 763, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 763, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -23748,7 +24741,7 @@ * * */ - __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(4, 768, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":768 @@ -23758,7 +24751,7 @@ * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -23861,7 +24854,7 @@ * 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 == -1)) __PYX_ERR(4, 818, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: @@ -23926,7 +24919,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(4, 824, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) /* "View.MemoryView":823 * negative_step = have_step != 0 and step < 0 @@ -24498,7 +25491,7 @@ * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(4, 885, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) } __pyx_L26:; @@ -24555,11 +25548,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -24627,11 +25620,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(4, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __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(4, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); @@ -24739,22 +25732,22 @@ * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(4, 914, __pyx_L1_error) + __PYX_ERR(1, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: @@ -24791,22 +25784,22 @@ * * resultp = bufp + index * stride */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 917, __pyx_L1_error) + __PYX_ERR(1, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) @@ -25006,7 +25999,7 @@ * * return 1 */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(4, 943, __pyx_L1_error) + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] @@ -25040,11 +26033,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -25129,7 +26122,7 @@ * 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(4, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -25153,7 +26146,7 @@ */ /*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(4, 969, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -25212,7 +26205,7 @@ * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(4, 973, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) /* "View.MemoryView":972 * @@ -25232,7 +26225,7 @@ * @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(4, 975, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -25312,6 +26305,113 @@ 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__67, 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__68, 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":985 * * @cname('__pyx_memoryview_fromslice') @@ -25375,9 +26475,9 @@ * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 999, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -25388,7 +26488,7 @@ __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(4, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -25419,7 +26519,7 @@ * 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(4, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -25590,7 +26690,7 @@ __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(4, 1026, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; @@ -25602,12 +26702,12 @@ * * 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(4, 1027, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1027, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1027, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } @@ -25699,7 +26799,7 @@ * 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(4, 1039, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -25756,7 +26856,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -25920,7 +27020,7 @@ * @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(4, 1067, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26043,7 +27143,7 @@ * * */ - __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(4, 1084, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; @@ -26841,7 +27941,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(4, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) /* "View.MemoryView":1207 * @@ -27013,11 +28113,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -27041,7 +28141,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -27052,13 +28152,13 @@ * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1238, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -27077,20 +28177,20 @@ * (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(4, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1237, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(4, 1237, __pyx_L1_error) + __PYX_ERR(1, 1237, __pyx_L1_error) /* "View.MemoryView":1235 * @@ -27110,7 +28210,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -27132,7 +28232,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -27144,11 +28244,11 @@ * * @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(4, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -27164,14 +28264,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #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(4, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -27180,20 +28280,20 @@ #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(4, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -27201,7 +28301,7 @@ __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(4, 1242, __pyx_L1_error) + __PYX_ERR(1, 1242, __pyx_L1_error) /* "View.MemoryView":1241 * @@ -27223,7 +28323,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -27246,7 +28346,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -27268,7 +28368,7 @@ * 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(4, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -27282,14 +28382,14 @@ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #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(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -27298,20 +28398,20 @@ #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(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -27319,7 +28419,7 @@ __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(4, 1247, __pyx_L1_error) + __PYX_ERR(1, 1247, __pyx_L1_error) /* "View.MemoryView":1246 * @cname('__pyx_memoryview_err') @@ -27339,7 +28439,7 @@ */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(4, 1249, __pyx_L1_error) + __PYX_ERR(1, 1249, __pyx_L1_error) } /* "View.MemoryView":1245 @@ -27362,7 +28462,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -27580,7 +28680,7 @@ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 1281, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) } __pyx_L7:; @@ -27610,7 +28710,7 @@ * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(4, 1284, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) /* "View.MemoryView":1283 * _err_extents(i, dst.shape[i], src.shape[i]) @@ -27667,7 +28767,7 @@ * src = tmp * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(4, 1291, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1292 @@ -27851,7 +28951,7 @@ * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(4, 1313, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) /* "View.MemoryView":1314 * @@ -27860,7 +28960,7 @@ * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(4, 1314, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) /* "View.MemoryView":1310 * return 0 @@ -27929,11 +29029,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -28113,7 +29213,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -28137,7 +29237,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -28446,6 +29546,469 @@ /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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_2yt_8geometry_15particle_smooth_ParticleSmoothOperation __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; static PyObject *__pyx_tp_new_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { @@ -28466,7 +30029,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_ParticleSmoothOperation(PyObject *o) { struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -28512,6 +30075,8 @@ {"process_octree", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_7process_octree, METH_VARARGS|METH_KEYWORDS, 0}, {"process_particles", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_9process_particles, METH_VARARGS|METH_KEYWORDS, 0}, {"process_grid", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_11process_grid, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_13__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_15__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -28592,7 +30157,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth(PyObject *o) { struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -28638,6 +30203,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -28722,7 +30289,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_NearestNeighborSmooth(PyObject *o) { struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_NearestNeighborSmooth *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -28768,6 +30335,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_15particle_smooth_NearestNeighborSmooth[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -28852,7 +30421,7 @@ static void __pyx_tp_dealloc_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth(PyObject *o) { struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *p = (struct __pyx_obj_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -28912,6 +30481,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -28996,6 +30567,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -29074,6 +30647,8 @@ static PyMethodDef __pyx_methods_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate[] = { {"initialize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_1initialize, METH_NOARGS, 0}, {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_3finalize, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -29163,7 +30738,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -29213,6 +30788,8 @@ 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} }; @@ -29332,7 +30909,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -29360,6 +30937,8 @@ } 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} }; @@ -29447,7 +31026,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -29559,6 +31138,8 @@ {"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} }; @@ -29684,7 +31265,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -29728,6 +31309,8 @@ } 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} }; @@ -29836,6 +31419,7 @@ {&__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}, @@ -29847,11 +31431,13 @@ {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__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_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_kp_s_SOMETHING_WRONG, __pyx_k_SOMETHING_WRONG, sizeof(__pyx_k_SOMETHING_WRONG), 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_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1}, @@ -29861,6 +31447,7 @@ {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, {&__pyx_n_s_cartesian, __pyx_k_cartesian, sizeof(__pyx_k_cartesian), 0, 0, 1, 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_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 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}, @@ -29868,6 +31455,7 @@ {&__pyx_n_s_cos, __pyx_k_cos, sizeof(__pyx_k_cos), 0, 0, 1, 1}, {&__pyx_n_s_cubic, __pyx_k_cubic, sizeof(__pyx_k_cubic), 0, 0, 1, 1}, {&__pyx_n_s_density_smooth, __pyx_k_density_smooth, sizeof(__pyx_k_density_smooth), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_domain_id, __pyx_k_domain_id, sizeof(__pyx_k_domain_id), 0, 0, 1, 1}, {&__pyx_n_s_domain_offset, __pyx_k_domain_offset, sizeof(__pyx_k_domain_offset), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, @@ -29907,7 +31495,9 @@ {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, {&__pyx_n_s_nearest_smooth, __pyx_k_nearest_smooth, sizeof(__pyx_k_nearest_smooth), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_nfields, __pyx_k_nfields, sizeof(__pyx_k_nfields), 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_nth_neighbor_smooth, __pyx_k_nth_neighbor_smooth, sizeof(__pyx_k_nth_neighbor_smooth), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, @@ -29922,13 +31512,23 @@ {&__pyx_n_s_pdom_ind, __pyx_k_pdom_ind, sizeof(__pyx_k_pdom_ind), 0, 0, 1, 1}, {&__pyx_n_s_periodicity, __pyx_k_periodicity, sizeof(__pyx_k_periodicity), 0, 0, 1, 1}, {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 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_print, __pyx_k_print, sizeof(__pyx_k_print), 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_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_quartic, __pyx_k_quartic, sizeof(__pyx_k_quartic), 0, 0, 1, 1}, {&__pyx_n_s_quintic, __pyx_k_quintic, sizeof(__pyx_k_quintic), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 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_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_kp_s_self_fp_self_pos_setup_self_sph, __pyx_k_self_fp_self_pos_setup_self_sph, sizeof(__pyx_k_self_fp_self_pos_setup_self_sph), 0, 0, 1, 0}, + {&__pyx_kp_s_self_pos_setup_self_sph_kernel_c, __pyx_k_self_pos_setup_self_sph_kernel_c, sizeof(__pyx_k_self_pos_setup_self_sph_kernel_c), 0, 0, 1, 0}, + {&__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_sin, __pyx_k_sin, sizeof(__pyx_k_sin), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, @@ -29939,6 +31539,7 @@ {&__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_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, @@ -29947,6 +31548,7 @@ {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 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_volume_weighted_smooth, __pyx_k_volume_weighted_smooth, sizeof(__pyx_k_volume_weighted_smooth), 0, 0, 1, 1}, {&__pyx_n_s_wendland2, __pyx_k_wendland2, sizeof(__pyx_k_wendland2), 0, 0, 1, 1}, {&__pyx_n_s_wendland4, __pyx_k_wendland4, sizeof(__pyx_k_wendland4), 0, 0, 1, 1}, @@ -29956,17 +31558,17 @@ {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, 53, __pyx_L1_error) - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 90, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 672, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 155, __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_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 598, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 218, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 989, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(4, 146, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(4, 149, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(4, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(4, 425, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(4, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(4, 818, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -29976,214 +31578,328 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "yt/geometry/particle_smooth.pyx":105 + /* "yt/geometry/particle_smooth.pyx":65 * fields = None, int domain_id = -1, * int domain_offset = 0, * periodicity = (True, True, True), # <<<<<<<<<<<<<< * index_fields = None, * OctreeContainer particle_octree = None, */ - __pyx_tuple_ = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "yt/geometry/particle_smooth.pyx":173 + /* "yt/geometry/particle_smooth.pyx":133 * cart_positions[:,2] = positions[:,0] * \ * np.cos(positions[:,1]) * periodicity = (False, False, False) # <<<<<<<<<<<<<< * else: * raise NotImplementedError */ - __pyx_tuple__3 = PyTuple_Pack(3, Py_False, Py_False, Py_False); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(3, Py_False, Py_False, Py_False); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "yt/geometry/particle_smooth.pyx":277 + /* "yt/geometry/particle_smooth.pyx":242 * fields = None, int domain_id = -1, * int domain_offset = 0, * periodicity = (True, True, True), # <<<<<<<<<<<<<< * geometry = "cartesian"): * # The other functions in this base class process particles in a way */ - __pyx_tuple__4 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "yt/geometry/particle_smooth.pyx":310 + /* "yt/geometry/particle_smooth.pyx":275 * cart_positions = np.empty((positions.shape[0], 3), dtype="float64") * * cart_positions[:,0] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) */ - __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__5); __Pyx_GIVEREF(__pyx_slice__5); - __pyx_tuple__6 = PyTuple_Pack(2, __pyx_slice__5, __pyx_int_0); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(2, __pyx_slice__5, __pyx_int_0); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "yt/geometry/particle_smooth.pyx":311 + /* "yt/geometry/particle_smooth.pyx":276 * * cart_positions[:,0] = positions[:,0] * \ * np.sin(positions[:,1]) * \ # <<<<<<<<<<<<<< * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ */ - __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); - __pyx_tuple__8 = PyTuple_Pack(2, __pyx_slice__7, __pyx_int_1); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(2, __pyx_slice__7, __pyx_int_1); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "yt/geometry/particle_smooth.pyx":312 + /* "yt/geometry/particle_smooth.pyx":277 * cart_positions[:,0] = positions[:,0] * \ * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) # <<<<<<<<<<<<<< * cart_positions[:,1] = positions[:,0] * \ * np.sin(positions[:,1]) * \ */ - __pyx_slice__9 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__9)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_slice__9 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__9)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__9); __Pyx_GIVEREF(__pyx_slice__9); - __pyx_tuple__10 = PyTuple_Pack(2, __pyx_slice__9, __pyx_int_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(2, __pyx_slice__9, __pyx_int_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "yt/geometry/particle_smooth.pyx":310 + /* "yt/geometry/particle_smooth.pyx":275 * cart_positions = np.empty((positions.shape[0], 3), dtype="float64") * * cart_positions[:,0] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) */ - __pyx_slice__11 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_slice__11 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__11); __Pyx_GIVEREF(__pyx_slice__11); - __pyx_tuple__12 = PyTuple_Pack(2, __pyx_slice__11, __pyx_int_0); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(2, __pyx_slice__11, __pyx_int_0); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - /* "yt/geometry/particle_smooth.pyx":313 + /* "yt/geometry/particle_smooth.pyx":278 * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) */ - __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__13); __Pyx_GIVEREF(__pyx_slice__13); - __pyx_tuple__14 = PyTuple_Pack(2, __pyx_slice__13, __pyx_int_0); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(2, __pyx_slice__13, __pyx_int_0); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - /* "yt/geometry/particle_smooth.pyx":314 + /* "yt/geometry/particle_smooth.pyx":279 * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ * np.sin(positions[:,1]) * \ # <<<<<<<<<<<<<< * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ */ - __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__15); __Pyx_GIVEREF(__pyx_slice__15); - __pyx_tuple__16 = PyTuple_Pack(2, __pyx_slice__15, __pyx_int_1); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(2, __pyx_slice__15, __pyx_int_1); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - /* "yt/geometry/particle_smooth.pyx":315 + /* "yt/geometry/particle_smooth.pyx":280 * cart_positions[:,1] = positions[:,0] * \ * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) # <<<<<<<<<<<<<< * cart_positions[:,2] = positions[:,0] * \ * np.cos(positions[:,1]) */ - __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__17); __Pyx_GIVEREF(__pyx_slice__17); - __pyx_tuple__18 = PyTuple_Pack(2, __pyx_slice__17, __pyx_int_2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_tuple__18 = PyTuple_Pack(2, __pyx_slice__17, __pyx_int_2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); - /* "yt/geometry/particle_smooth.pyx":313 + /* "yt/geometry/particle_smooth.pyx":278 * np.sin(positions[:,1]) * \ * np.cos(positions[:,2]) * cart_positions[:,1] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) */ - __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(0, 278, __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, 313, __pyx_L1_error) + __pyx_tuple__20 = PyTuple_Pack(2, __pyx_slice__19, __pyx_int_1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); - /* "yt/geometry/particle_smooth.pyx":316 + /* "yt/geometry/particle_smooth.pyx":281 * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.cos(positions[:,1]) * periodicity = (False, False, False) */ - __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__21); __Pyx_GIVEREF(__pyx_slice__21); - __pyx_tuple__22 = PyTuple_Pack(2, __pyx_slice__21, __pyx_int_0); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(2, __pyx_slice__21, __pyx_int_0); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); - /* "yt/geometry/particle_smooth.pyx":317 + /* "yt/geometry/particle_smooth.pyx":282 * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ * np.cos(positions[:,1]) # <<<<<<<<<<<<<< * periodicity = (False, False, False) * else: */ - __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__23); __Pyx_GIVEREF(__pyx_slice__23); - __pyx_tuple__24 = PyTuple_Pack(2, __pyx_slice__23, __pyx_int_1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(2, __pyx_slice__23, __pyx_int_1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); - /* "yt/geometry/particle_smooth.pyx":316 + /* "yt/geometry/particle_smooth.pyx":281 * np.sin(positions[:,1]) * \ * np.sin(positions[:,2]) * cart_positions[:,2] = positions[:,0] * \ # <<<<<<<<<<<<<< * np.cos(positions[:,1]) * periodicity = (False, False, False) */ - __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__25); __Pyx_GIVEREF(__pyx_slice__25); - __pyx_tuple__26 = PyTuple_Pack(2, __pyx_slice__25, __pyx_int_2); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(2, __pyx_slice__25, __pyx_int_2); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); - /* "yt/geometry/particle_smooth.pyx":318 + /* "yt/geometry/particle_smooth.pyx":283 * cart_positions[:,2] = positions[:,0] * \ * np.cos(positions[:,1]) * periodicity = (False, False, False) # <<<<<<<<<<<<<< * else: * raise NotImplementedError */ - __pyx_tuple__27 = PyTuple_Pack(3, Py_False, Py_False, Py_False); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(3, Py_False, Py_False, Py_False); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); - /* "selection_routines.pxd":30 + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_self_pos_setup_self_sph_kernel_c); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "(tree fragment)":4 + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_self_pos_setup_self_sph_kernel_c); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_self_fp_self_pos_setup_self_sph); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "(tree fragment)":4 + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_self_fp_self_pos_setup_self_sph); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_self_fp_self_pos_setup_self_sph); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "(tree fragment)":4 + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_self_fp_self_pos_setup_self_sph); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_self_fp_self_pos_setup_self_sph); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "(tree fragment)":4 + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.fp,self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_self_fp_self_pos_setup_self_sph); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_self_pos_setup_self_sph_kernel_c); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "(tree fragment)":4 + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_self_pos_setup_self_sph_kernel_c); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_self_pos_setup_self_sph_kernel_c); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "(tree fragment)":4 + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.pos_setup,self.sph_kernel cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_self_pos_setup_self_sph_kernel_c); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -30192,9 +31908,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(3, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -30203,9 +31919,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(3, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -30214,9 +31930,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(3, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -30225,9 +31941,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(3, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -30236,9 +31952,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(3, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -30247,9 +31963,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(3, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -30258,9 +31974,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(3, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(3, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -30269,18 +31985,18 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(3, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(3, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(3, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(3, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); /* "View.MemoryView":131 * @@ -30289,9 +32005,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(4, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); /* "View.MemoryView":134 * @@ -30300,9 +32016,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(4, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); /* "View.MemoryView":137 * @@ -30311,9 +32027,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(4, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); /* "View.MemoryView":146 * @@ -30322,9 +32038,9 @@ * * */ - __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(4, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -30333,9 +32049,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(4, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -30344,9 +32060,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(4, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "(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__56 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + + /* "(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__57 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -30355,9 +32090,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(4, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -30366,9 +32101,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(4, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); /* "View.MemoryView":563 * def suboffsets(self): @@ -30377,12 +32112,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__46 = PyTuple_New(1); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(4, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); + __pyx_tuple__60 = PyTuple_New(1); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__46, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__46); + PyTuple_SET_ITEM(__pyx_tuple__60, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "(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__61 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + + /* "(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__62 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); /* "View.MemoryView":668 * if item is Ellipsis: @@ -30391,9 +32145,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__47 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__47)) __PYX_ERR(4, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__47); - __Pyx_GIVEREF(__pyx_slice__47); + __pyx_slice__63 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__63)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__63); + __Pyx_GIVEREF(__pyx_slice__63); /* "View.MemoryView":671 * seen_ellipsis = True @@ -30402,9 +32156,9 @@ * have_slices = True * else: */ - __pyx_slice__48 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__48)) __PYX_ERR(4, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__48); - __Pyx_GIVEREF(__pyx_slice__48); + __pyx_slice__64 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__64)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__64); + __Pyx_GIVEREF(__pyx_slice__64); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -30413,9 +32167,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__49 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__49)) __PYX_ERR(4, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__49); - __Pyx_GIVEREF(__pyx_slice__49); + __pyx_slice__65 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__65)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__65); + __Pyx_GIVEREF(__pyx_slice__65); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -30424,9 +32178,28 @@ * * */ - __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(4, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + + /* "(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__67 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(1, 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__68 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); /* "View.MemoryView":282 * return self.name @@ -30435,9 +32208,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(4, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); /* "View.MemoryView":283 * @@ -30446,9 +32219,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(4, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__52); - __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -30457,9 +32230,9 @@ * * */ - __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(4, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); /* "View.MemoryView":287 * @@ -30468,9 +32241,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(4, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__54); - __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); /* "View.MemoryView":288 * @@ -30479,9 +32252,19 @@ * * */ - __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(4, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__74 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -30495,6 +32278,7 @@ __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_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:; @@ -30512,8 +32296,9 @@ PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } }; - static PyThread_type_lock __pyx_t_5[8]; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + static PyThread_type_lock __pyx_t_6[8]; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -30561,6 +32346,7 @@ __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 @@ -30595,71 +32381,77 @@ /*--- Function export code ---*/ /*--- Type init code ---*/ __pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation = &__pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; - __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_float64_t **, __Pyx_memviewslice, __pyx_t_5numpy_int64_t **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t, int *, __Pyx_memviewslice, __Pyx_memviewslice))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process; + __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_float64_t **, __Pyx_memviewslice, __pyx_t_5numpy_int64_t **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t, int *, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process; __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_search = (int (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_float64_t *, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t **, int *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, struct __pyx_opt_args_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search *__pyx_optional_args))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_search; - __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_process_particle = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_float64_t **, __Pyx_memviewslice, __pyx_t_5numpy_int64_t **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t, int *))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process_particle; - __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_eval = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_eval; - __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_reset = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_reset; - __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_find = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __Pyx_memviewslice))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_find; - __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_process; - if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation) < 0) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_process_particle = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __pyx_t_5numpy_float64_t **, __Pyx_memviewslice, __pyx_t_5numpy_int64_t **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t, int *, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_process_particle; + __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.neighbor_find = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_float64_t *, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_neighbor_find; + __pyx_vtable_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_23ParticleSmoothOperation_process; + if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation) < 0) __PYX_ERR(0, 76, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "ParticleSmoothOperation", (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation) < 0) __PYX_ERR(0, 76, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ParticleSmoothOperation", (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation = &__pyx_type_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; __pyx_vtabptr_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth = &__pyx_vtable_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth; __pyx_vtable_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.__pyx_base = *__pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; - __pyx_vtable_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **))__pyx_f_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_process; + __pyx_vtable_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_20VolumeWeightedSmooth_process; __pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.tp_base = __pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth) < 0) __PYX_ERR(0, 657, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth) < 0) __PYX_ERR(0, 583, __pyx_L1_error) __pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth) < 0) __PYX_ERR(0, 657, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "VolumeWeightedSmooth", (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth) < 0) __PYX_ERR(0, 657, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth) < 0) __PYX_ERR(0, 583, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "VolumeWeightedSmooth", (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth) < 0) __PYX_ERR(0, 583, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth) < 0) __PYX_ERR(0, 583, __pyx_L1_error) __pyx_ptype_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth = &__pyx_type_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth; __pyx_vtabptr_2yt_8geometry_15particle_smooth_NearestNeighborSmooth = &__pyx_vtable_2yt_8geometry_15particle_smooth_NearestNeighborSmooth; __pyx_vtable_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.__pyx_base = *__pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; - __pyx_vtable_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **))__pyx_f_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_process; + __pyx_vtable_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_21NearestNeighborSmooth_process; __pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.tp_base = __pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth) < 0) __PYX_ERR(0, 734, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth) < 0) __PYX_ERR(0, 660, __pyx_L1_error) __pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_NearestNeighborSmooth) < 0) __PYX_ERR(0, 734, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "NearestNeighborSmooth", (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth) < 0) __PYX_ERR(0, 734, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_NearestNeighborSmooth) < 0) __PYX_ERR(0, 660, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "NearestNeighborSmooth", (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth) < 0) __PYX_ERR(0, 660, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth) < 0) __PYX_ERR(0, 660, __pyx_L1_error) __pyx_ptype_2yt_8geometry_15particle_smooth_NearestNeighborSmooth = &__pyx_type_2yt_8geometry_15particle_smooth_NearestNeighborSmooth; __pyx_vtabptr_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth = &__pyx_vtable_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth; __pyx_vtable_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.__pyx_base = *__pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; - __pyx_vtable_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **))__pyx_f_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_process; + __pyx_vtable_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_22IDWInterpolationSmooth_process; __pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.tp_base = __pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth) < 0) __PYX_ERR(0, 766, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth) < 0) __PYX_ERR(0, 692, __pyx_L1_error) __pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth) < 0) __PYX_ERR(0, 766, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "IDWInterpolationSmooth", (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth) < 0) __PYX_ERR(0, 766, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth) < 0) __PYX_ERR(0, 692, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "IDWInterpolationSmooth", (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth) < 0) __PYX_ERR(0, 692, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth) < 0) __PYX_ERR(0, 692, __pyx_L1_error) __pyx_ptype_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth = &__pyx_type_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth; __pyx_vtabptr_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth = &__pyx_vtable_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth; __pyx_vtable_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.__pyx_base = *__pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; - __pyx_vtable_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **))__pyx_f_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_process; + __pyx_vtable_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_25NthNeighborDistanceSmooth_process; __pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.tp_base = __pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth) < 0) __PYX_ERR(0, 735, __pyx_L1_error) __pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth) < 0) __PYX_ERR(0, 809, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "NthNeighborDistanceSmooth", (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth) < 0) __PYX_ERR(0, 735, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "NthNeighborDistanceSmooth", (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth) < 0) __PYX_ERR(0, 735, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth) < 0) __PYX_ERR(0, 735, __pyx_L1_error) __pyx_ptype_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth = &__pyx_type_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth; __pyx_vtabptr_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate = &__pyx_vtable_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate; __pyx_vtable_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.__pyx_base = *__pyx_vtabptr_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; - __pyx_vtable_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **))__pyx_f_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_process; + __pyx_vtable_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.__pyx_base.process = (void (*)(struct __pyx_obj_2yt_8geometry_15particle_smooth_ParticleSmoothOperation *, __pyx_t_5numpy_int64_t, int, int, int, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t **, __pyx_t_5numpy_float64_t **, struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_8geometry_15particle_smooth_23SmoothedDensityEstimate_process; __pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.tp_base = __pyx_ptype_2yt_8geometry_15particle_smooth_ParticleSmoothOperation; - if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate) < 0) __PYX_ERR(0, 831, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate) < 0) __PYX_ERR(0, 757, __pyx_L1_error) __pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate) < 0) __PYX_ERR(0, 831, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "SmoothedDensityEstimate", (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate) < 0) __PYX_ERR(0, 831, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate.tp_dict, __pyx_vtabptr_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate) < 0) __PYX_ERR(0, 757, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SmoothedDensityEstimate", (PyObject *)&__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate) < 0) __PYX_ERR(0, 757, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate) < 0) __PYX_ERR(0, 757, __pyx_L1_error) __pyx_ptype_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate = &__pyx_type_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate; __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(4, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(4, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(4, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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; @@ -30669,18 +32461,20 @@ __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(4, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(4, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(4, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(4, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -30733,20 +32527,30 @@ __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(6, 114, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType("yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(6, 117, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(6, 117, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 33, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 33, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 71, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 71, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 74, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 74, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(7, 57, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(7, 57, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(7, 89, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(7, 89, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(7, 97, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(7, 97, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation = __Pyx_ImportType("yt.geometry.particle_deposit", "ParticleDepositOperation", sizeof(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation)) __PYX_ERR(1, 134, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation = (struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation)) __PYX_ERR(1, 134, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 29, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 29, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 67, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 67, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 70, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 70, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType("yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(2, 74, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(2, 74, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = __Pyx_ImportType("yt.utilities.lib.allocation_container", "ObjectPool", sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(7, 26, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(7, 26, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = __Pyx_ImportType("yt.geometry.oct_container", "OctObjectPool", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(8, 55, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(8, 55, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(8, 63, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(8, 63, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(8, 94, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(8, 94, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(8, 102, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(8, 102, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation = __Pyx_ImportType("yt.geometry.particle_deposit", "ParticleDepositOperation", sizeof(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation)) __PYX_ERR(4, 134, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation = (struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation)) __PYX_ERR(4, 134, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14distance_queue_PriorityQueue = __Pyx_ImportType("yt.utilities.lib.distance_queue", "PriorityQueue", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14distance_queue_PriorityQueue)) __PYX_ERR(9, 40, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_PriorityQueue = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14distance_queue_PriorityQueue->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_PriorityQueue)) __PYX_ERR(9, 40, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue = __Pyx_ImportType("yt.utilities.lib.distance_queue", "DistanceQueue", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue)) __PYX_ERR(9, 47, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_DistanceQueue = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_DistanceQueue)) __PYX_ERR(9, 47, __pyx_L1_error) /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportVoidPtr(__pyx_t_1, "ORDER_MAX", (void **)&__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -30755,6 +32559,10 @@ __pyx_t_2 = __Pyx_ImportModule("yt.geometry.grid_visitors"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_2, "check_child_masked", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked, "__pyx_t_5numpy_uint8_t (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_ImportModule("yt.utilities.lib.distance_queue"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_3, "Neighbor_compare", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_14distance_queue_Neighbor_compare, "int (void *, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_3, "r2dist", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_14distance_queue_r2dist, "__pyx_t_5numpy_float64_t (__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, __pyx_t_5numpy_float64_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -30764,79 +32572,79 @@ * * cimport numpy as np * import numpy as np # <<<<<<<<<<<<<< - * from libc.stdlib cimport malloc, free, realloc - * from libc.string cimport memmove + * cimport cython + * */ - __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_4) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/particle_smooth.pyx":108 + /* "yt/geometry/particle_smooth.pyx":68 * index_fields = None, * OctreeContainer particle_octree = None, * np.int64_t [:] pdom_ind = None, # <<<<<<<<<<<<<< * geometry = "cartesian"): * # This will be a several-step operation. */ - __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(Py_None); - if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 108, __pyx_L1_error) - __pyx_k__2 = __pyx_t_4; - __pyx_t_4.memview = NULL; - __pyx_t_4.data = NULL; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(Py_None); + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_k__2 = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; - /* "yt/geometry/particle_smooth.pyx":732 + /* "yt/geometry/particle_smooth.pyx":658 * return * * volume_weighted_smooth = VolumeWeightedSmooth # <<<<<<<<<<<<<< * * cdef class NearestNeighborSmooth(ParticleSmoothOperation): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_volume_weighted_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth)) < 0) __PYX_ERR(0, 732, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_volume_weighted_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_VolumeWeightedSmooth)) < 0) __PYX_ERR(0, 658, __pyx_L1_error) - /* "yt/geometry/particle_smooth.pyx":764 + /* "yt/geometry/particle_smooth.pyx":690 * return * * nearest_smooth = NearestNeighborSmooth # <<<<<<<<<<<<<< * * cdef class IDWInterpolationSmooth(ParticleSmoothOperation): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_nearest_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_NearestNeighborSmooth)) < 0) __PYX_ERR(0, 764, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nearest_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_NearestNeighborSmooth)) < 0) __PYX_ERR(0, 690, __pyx_L1_error) - /* "yt/geometry/particle_smooth.pyx":807 + /* "yt/geometry/particle_smooth.pyx":733 * return * * idw_smooth = IDWInterpolationSmooth # <<<<<<<<<<<<<< * * cdef class NthNeighborDistanceSmooth(ParticleSmoothOperation): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_idw_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth)) < 0) __PYX_ERR(0, 807, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_idw_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_IDWInterpolationSmooth)) < 0) __PYX_ERR(0, 733, __pyx_L1_error) - /* "yt/geometry/particle_smooth.pyx":829 + /* "yt/geometry/particle_smooth.pyx":755 * fields[0][offset] = max_r * * nth_neighbor_smooth = NthNeighborDistanceSmooth # <<<<<<<<<<<<<< * * cdef class SmoothedDensityEstimate(ParticleSmoothOperation): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_nth_neighbor_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth)) < 0) __PYX_ERR(0, 829, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nth_neighbor_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_NthNeighborDistanceSmooth)) < 0) __PYX_ERR(0, 755, __pyx_L1_error) - /* "yt/geometry/particle_smooth.pyx":859 + /* "yt/geometry/particle_smooth.pyx":785 * fields[1][offset] = dens/weight * * density_smooth = SmoothedDensityEstimate # <<<<<<<<<<<<<< */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_density_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate)) < 0) __PYX_ERR(0, 859, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_density_smooth, ((PyObject *)__pyx_ptype_2yt_8geometry_15particle_smooth_SmoothedDensityEstimate)) < 0) __PYX_ERR(0, 785, __pyx_L1_error) /* "yt/geometry/particle_smooth.pyx":1 * """ # <<<<<<<<<<<<<< * Particle smoothing in cells * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyDict_New(); 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; /* "View.MemoryView":207 * info.obj = self @@ -30845,10 +32653,10 @@ * * def __dealloc__(array self): */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(4, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(1, 207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_array_type); /* "View.MemoryView":282 @@ -30858,12 +32666,12 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(generic); - __Pyx_DECREF_SET(generic, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(generic, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; /* "View.MemoryView":283 * @@ -30872,12 +32680,12 @@ * cdef indirect = Enum("") * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(strided); - __Pyx_DECREF_SET(strided, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(strided, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; /* "View.MemoryView":284 * cdef generic = Enum("") @@ -30886,12 +32694,12 @@ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(indirect); - __Pyx_DECREF_SET(indirect, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(indirect, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; /* "View.MemoryView":287 * @@ -30900,12 +32708,12 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(contiguous); - __Pyx_DECREF_SET(contiguous, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(contiguous, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; /* "View.MemoryView":288 * @@ -30914,12 +32722,12 @@ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(indirect_contiguous); - __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; /* "View.MemoryView":312 * @@ -30937,15 +32745,15 @@ * PyThread_allocate_lock(), * PyThread_allocate_lock(), */ - __pyx_t_5[0] = PyThread_allocate_lock(); - __pyx_t_5[1] = PyThread_allocate_lock(); - __pyx_t_5[2] = PyThread_allocate_lock(); - __pyx_t_5[3] = PyThread_allocate_lock(); - __pyx_t_5[4] = PyThread_allocate_lock(); - __pyx_t_5[5] = PyThread_allocate_lock(); - __pyx_t_5[6] = PyThread_allocate_lock(); - __pyx_t_5[7] = PyThread_allocate_lock(); - memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_5, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + __pyx_t_6[0] = PyThread_allocate_lock(); + __pyx_t_6[1] = PyThread_allocate_lock(); + __pyx_t_6[2] = PyThread_allocate_lock(); + __pyx_t_6[3] = PyThread_allocate_lock(); + __pyx_t_6[4] = PyThread_allocate_lock(); + __pyx_t_6[5] = PyThread_allocate_lock(); + __pyx_t_6[6] = PyThread_allocate_lock(); + __pyx_t_6[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_6, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); /* "View.MemoryView":535 * info.obj = self @@ -30954,10 +32762,10 @@ * * */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(4, 535, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(1, 535, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_memoryview_type); /* "View.MemoryView":981 @@ -30967,18 +32775,28 @@ * * */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(4, 981, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(1, 981, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_4) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -30988,10 +32806,11 @@ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.geometry.particle_smooth", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.geometry.particle_smooth", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -32138,7 +33957,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -32198,6 +34026,21 @@ 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; @@ -32285,17 +34128,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -32414,8 +34262,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON @@ -32455,11 +34303,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -32482,7 +34326,7 @@ #endif /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { @@ -32598,7 +34442,7 @@ #endif /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -32609,9 +34453,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -32624,9 +34471,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -32679,7 +34529,7 @@ } /* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -32692,13 +34542,13 @@ } /* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { + static void __Pyx_RaiseBufferFallbackError(void) { PyErr_SetString(PyExc_ValueError, "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); } /* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + 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; @@ -32740,7 +34590,7 @@ } /* PyObjectCallMethod1 */ - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto done; @@ -32786,7 +34636,7 @@ } /* append */ - static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { @@ -32798,26 +34648,57 @@ return 0; } +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* 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; + } +} + /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -32841,7 +34722,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -32851,7 +34732,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -32912,28 +34793,15 @@ } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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_COMPILING_IN_CPYTHON -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); -} - /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -32965,8 +34833,23 @@ } } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -32991,7 +34874,7 @@ #endif /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -33065,7 +34948,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -33181,20 +35064,34 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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; } +/* 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; +} + /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -33211,8 +35108,73 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -33231,8 +35193,42 @@ return NULL; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -33312,7 +35308,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -33371,12 +35367,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -33415,8 +35414,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -33439,7 +35438,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -33475,7 +35474,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -33488,7 +35487,7 @@ } /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -33529,7 +35528,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -33711,7 +35710,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -33734,7 +35733,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -33757,7 +35756,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -33779,7 +35778,7 @@ } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); } static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { @@ -33791,7 +35790,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + 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) { @@ -33822,7 +35821,7 @@ } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) { + 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) { @@ -33834,7 +35833,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -33865,7 +35864,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -33895,39 +35894,8 @@ } } -/* 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); - } -} - /* Print */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); if (!f) { @@ -34032,8 +36000,39 @@ } #endif +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -34053,7 +36052,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -34188,7 +36187,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -34208,7 +36207,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -34343,7 +36342,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -34374,7 +36373,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -34441,7 +36440,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -34630,7 +36629,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -34819,19 +36818,19 @@ } /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { - const char neg_one = (char) -1, const_zero = (char) 0; + 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(char) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (char) val; + return (long) val; } } else #endif @@ -34840,32 +36839,32 @@ #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 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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; @@ -34879,86 +36878,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (char) -1; + return (long) -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)) + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } 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 (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 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(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(char) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -34967,7 +36966,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - char val; + long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -34987,40 +36986,40 @@ return val; } #endif - return (char) -1; + return (long) -1; } } else { - char val; + long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (char) -1; - val = __Pyx_PyInt_As_char(tmp); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to char"); - return (char) -1; + "value too large to convert to long"); + return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to char"); - return (char) -1; + "can't convert negative value to long"); + return (long) -1; } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; + static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = (char) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (long) val; + return (char) val; } } else #endif @@ -35029,32 +37028,32 @@ #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 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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; @@ -35068,86 +37067,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (long) -1; + return (char) -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)) + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, 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)) + } 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 (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 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(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, 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)) + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -35156,7 +37155,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - long val; + char val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -35176,28 +37175,28 @@ return val; } #endif - return (long) -1; + return (char) -1; } } else { - long val; + char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; + "value too large to convert to char"); + return (char) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; + "can't convert negative value to char"); + return (char) -1; } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -35220,7 +37219,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -35236,7 +37235,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -35254,7 +37253,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -35319,7 +37318,7 @@ #endif /* VoidPtrImport */ - #ifndef __PYX_HAVE_RT_ImportVoidPtr + #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; @@ -35368,7 +37367,7 @@ #endif /* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction + #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; @@ -35422,7 +37421,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -35447,6 +37446,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -35455,11 +37456,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/geometry/particle_smooth.pxd yt-3.4.0/yt/geometry/particle_smooth.pxd --- yt-3.3.3/yt/geometry/particle_smooth.pxd 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/particle_smooth.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -21,17 +21,14 @@ from libc.math cimport sqrt from yt.utilities.lib.fp_utils cimport * -from oct_container cimport Oct, OctAllocationContainer, OctreeContainer +from oct_container cimport Oct, OctreeContainer from .particle_deposit cimport kernel_func, get_kernel_func, gind +from yt.utilities.lib.distance_queue cimport NeighborList, Neighbor_compare, \ + r2dist, DistanceQueue cdef extern from "platform_dep.h": void *alloca(int) -cdef struct NeighborList -cdef struct NeighborList: - np.int64_t pn # Particle number - np.float64_t r2 # radius**2 - cdef class ParticleSmoothOperation: # We assume each will allocate and define their own temporary storage cdef kernel_func sph_kernel @@ -39,10 +36,8 @@ cdef np.float64_t DW[3] cdef int nfields cdef int maxn - cdef int curn cdef bint periodicity[3] # Note that we are preallocating here, so this is *not* threadsafe. - cdef NeighborList *neighbors cdef void (*pos_setup)(np.float64_t ipos[3], np.float64_t opos[3]) cdef void neighbor_process(self, int dim[3], np.float64_t left_edge[3], np.float64_t dds[3], np.float64_t[:,:] ppos, @@ -52,7 +47,7 @@ np.int64_t offset, np.float64_t **index_fields, OctreeContainer octree, np.int64_t domain_id, int *nsize, np.float64_t[:,:] oct_left_edges, - np.float64_t[:,:] oct_dds) + np.float64_t[:,:] oct_dds, DistanceQueue dq) cdef int neighbor_search(self, np.float64_t pos[3], OctreeContainer octree, np.int64_t **nind, int *nsize, np.int64_t nneighbors, np.int64_t domain_id, @@ -65,10 +60,7 @@ np.int64_t offset, np.float64_t **index_fields, OctreeContainer octree, np.int64_t domain_id, - int *nsize) - cdef void neighbor_eval(self, np.int64_t pn, np.float64_t ppos[3], - np.float64_t cpos[3]) - cdef void neighbor_reset(self) + int *nsize, DistanceQueue dq) cdef void neighbor_find(self, np.int64_t nneighbors, np.int64_t *nind, @@ -78,7 +70,7 @@ np.float64_t[:,:] ppos, np.float64_t cpos[3], np.float64_t[:,:] oct_left_edges, - np.float64_t[:,:] oct_dds) + np.float64_t[:,:] oct_dds, DistanceQueue dq) cdef void process(self, np.int64_t offset, int i, int j, int k, int dim[3], np.float64_t cpos[3], np.float64_t **fields, - np.float64_t **index_fields) + np.float64_t **index_fields, DistanceQueue dq) diff -Nru yt-3.3.3/yt/geometry/particle_smooth.pyx yt-3.4.0/yt/geometry/particle_smooth.pyx --- yt-3.3.3/yt/geometry/particle_smooth.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/particle_smooth.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -16,52 +16,16 @@ cimport numpy as np import numpy as np +cimport cython + +from cpython.exc cimport PyErr_CheckSignals from libc.stdlib cimport malloc, free, realloc from libc.string cimport memmove -cimport cython from libc.math cimport sqrt, fabs, sin, cos -from oct_container cimport Oct, OctAllocationContainer, \ - OctreeContainer, OctInfo +from oct_container cimport \ + Oct, OctreeContainer, OctInfo -cdef int Neighbor_compare(void *on1, void *on2) nogil: - cdef NeighborList *n1 - cdef NeighborList *n2 - n1 = on1 - n2 = on2 - # Note that we set this up so that "greatest" evaluates to the *end* of the - # list, so we can do standard radius comparisons. - if n1.r2 < n2.r2: - return -1 - elif n1.r2 == n2.r2: - return 0 - else: - return 1 - -@cython.cdivision(True) -@cython.boundscheck(False) -@cython.wraparound(False) -@cython.initializedcheck(False) -cdef np.float64_t r2dist(np.float64_t ppos[3], - np.float64_t cpos[3], - np.float64_t DW[3], - bint periodicity[3], - np.float64_t max_dist2): - cdef int i - cdef np.float64_t r2, DR - r2 = 0.0 - for i in range(3): - DR = (ppos[i] - cpos[i]) - if not periodicity[i]: - pass - elif (DR > DW[i]/2.0): - DR -= DW[i] - elif (DR < -DW[i]/2.0): - DR += DW[i] - r2 += DR * DR - if max_dist2 >= 0.0 and r2 > max_dist2: - return -1.0 - return r2 cdef void spherical_coord_setup(np.float64_t ipos[3], np.float64_t opos[3]): opos[0] = ipos[0] * sin(ipos[1]) * cos(ipos[2]) @@ -80,10 +44,6 @@ self.nvals = nvals self.nfields = nfields self.maxn = max_neighbors - - self.neighbors = malloc( - sizeof(NeighborList) * self.maxn) - self.neighbor_reset() self.sph_kernel = get_kernel_func(kernel_name) def initialize(self, *args): @@ -246,7 +206,12 @@ cdef np.ndarray[np.uint8_t, ndim=1] visited visited = np.zeros(mdom_ind.shape[0], dtype="uint8") cdef int nproc = 0 + # This should be thread-private if we ever go to OpenMP + cdef DistanceQueue dist_queue = DistanceQueue(self.maxn) + dist_queue._setup(self.DW, self.periodicity) for i in range(oct_positions.shape[0]): + if (i % 10000) == 0: + PyErr_CheckSignals() for j in range(3): pos[j] = oct_positions[i, j] oct = mesh_octree.get(pos, &moi) @@ -259,7 +224,7 @@ dims, moi.left_edge, moi.dds, cart_positions, field_pointers, doff, &nind, pind, pcount, offset, index_field_pointers, particle_octree, domain_id, &nsize, oct_left_edges, - oct_dds) + oct_dds, dist_queue) #print "VISITED", visited.sum(), visited.size, #print 100.0*float(visited.sum())/visited.size if nind != NULL: @@ -349,8 +314,7 @@ # Note that what we will be providing to our processing functions will # actually be indirectly-sorted fields. This preserves memory at the # expense of additional pointer lookups. - pind = np.argsort(pdoms) - pind = np.asarray(pind, dtype='int64', order='C') + pind = np.asarray(np.argsort(pdoms), dtype='int64', order='C') # So what this means is that we now have all the oct-0 particle indices # in order, then the oct-1, etc etc. # This now gives us the indices to the particles for each domain. @@ -368,6 +332,9 @@ # refers to that oct's particles. cdef int maxnei = 0 cdef int nproc = 0 + # This should be thread-private if we ever go to OpenMP + cdef DistanceQueue dist_queue = DistanceQueue(self.maxn) + dist_queue._setup(self.DW, self.periodicity) for i in range(doff.shape[0]): if doff[i] < 0: continue offset = pind[doff[i]] @@ -379,7 +346,8 @@ pos[k] = positions[pind0, k] self.neighbor_process_particle(pos, cart_positions, field_pointers, doff, &nind, pind, pcount, pind0, - NULL, particle_octree, domain_id, &nsize) + NULL, particle_octree, domain_id, &nsize, + dist_queue) #print "VISITED", visited.sum(), visited.size, #print 100.0*float(visited.sum())/visited.size if nind != NULL: @@ -462,55 +430,9 @@ cdef void process(self, np.int64_t offset, int i, int j, int k, int dim[3], np.float64_t cpos[3], np.float64_t **fields, - np.float64_t **ifields): + np.float64_t **ifields, DistanceQueue dq): raise NotImplementedError - cdef void neighbor_reset(self): - self.curn = 0 - for i in range(self.maxn): - self.neighbors[i].pn = -1 - self.neighbors[i].r2 = 1e300 - - cdef void neighbor_eval(self, np.int64_t pn, np.float64_t ppos[3], - np.float64_t cpos[3]): - # Here's a python+numpy simulator of this: - # http://paste.yt-project.org/show/5445/ - cdef int i, di - cdef np.float64_t r2, r2_trunc - if self.curn == self.maxn: - # Truncate calculation if it's bigger than this in any dimension - r2_trunc = self.neighbors[self.curn - 1].r2 - else: - # Don't truncate our calculation - r2_trunc = -1 - r2 = r2dist(ppos, cpos, self.DW, self.periodicity, r2_trunc) - if r2 == -1: - return - if self.curn == 0: - self.neighbors[0].r2 = r2 - self.neighbors[0].pn = pn - self.curn += 1 - return - # Now insert in a sorted way - di = -1 - for i in range(self.curn - 1, -1, -1): - # We are checking if i is less than us, to see if we should insert - # to the right (i.e., i+1). - if self.neighbors[i].r2 < r2: - di = i - break - # The outermost one is already too small. - if di == self.maxn - 1: - return - if (self.maxn - (di + 2)) > 0: - memmove( (self.neighbors + di + 2), - (self.neighbors + di + 1), - sizeof(NeighborList) * (self.maxn - (di + 2))) - self.neighbors[di + 1].r2 = r2 - self.neighbors[di + 1].pn = pn - if self.curn < self.maxn: - self.curn += 1 - @cython.cdivision(True) @cython.boundscheck(False) @cython.wraparound(False) @@ -525,6 +447,7 @@ np.float64_t cpos[3], np.float64_t[:,:] oct_left_edges, np.float64_t[:,:] oct_dds, + DistanceQueue dq ): # We are now given the number of neighbors, the indices into the # domains for them, and the number of particles for each. @@ -534,13 +457,13 @@ cdef np.float64_t ex[2] cdef np.float64_t DR[2] cdef np.float64_t cp, r2_trunc, r2, dist - self.neighbor_reset() + dq.neighbor_reset() for ni in range(nneighbors): if nind[ni] == -1: continue # terminate early if all 8 corners of oct are farther away than # most distant currently known neighbor - if oct_left_edges != None and self.curn == self.maxn: - r2_trunc = self.neighbors[self.curn - 1].r2 + if oct_left_edges != None and dq.curn == dq.maxn: + r2_trunc = dq.neighbors[dq.curn - 1].r2 # iterate over each dimension in the outer loop so we can # consolidate temporary storage # What this next bit does is figure out which component is the @@ -576,7 +499,7 @@ pn = pinds[offset + i] for j in range(3): pos[j] = ppos[pn, j] - self.neighbor_eval(pn, pos, cpos) + dq.neighbor_eval(pn, pos, cpos) @cython.cdivision(True) @cython.boundscheck(False) @@ -591,7 +514,8 @@ np.float64_t **index_fields, OctreeContainer octree, np.int64_t domain_id, int *nsize, np.float64_t[:,:] oct_left_edges, - np.float64_t[:,:] oct_dds): + np.float64_t[:,:] oct_dds, + DistanceQueue dq): # Note that we assume that fields[0] == smoothing length in the native # units supplied. We can now iterate over every cell in the block and # every particle to find the nearest. We will use a priority heap. @@ -609,17 +533,18 @@ nneighbors = self.neighbor_search(opos, octree, nind, nsize, nneighbors, domain_id, &oct, 0) self.neighbor_find(nneighbors, nind[0], doffs, pcounts, - pinds, ppos, opos, oct_left_edges, oct_dds) + pinds, ppos, opos, oct_left_edges, + oct_dds, dq) # Now we have all our neighbors in our neighbor list. - if self.curn <-1*self.maxn: + if dq.curn <-1*dq.maxn: ntot = nntot = 0 for m in range(nneighbors): if nind[0][m] < 0: continue nntot += 1 ntot += pcounts[nind[0][m]] - print "SOMETHING WRONG", self.curn, nneighbors, ntot, nntot + print "SOMETHING WRONG", dq.curn, nneighbors, ntot, nntot self.process(offset, i, j, k, dim, opos, fields, - index_fields) + index_fields, dq) cpos[2] += dds[2] cpos[1] += dds[1] cpos[0] += dds[0] @@ -636,7 +561,8 @@ np.int64_t offset, np.float64_t **index_fields, OctreeContainer octree, - np.int64_t domain_id, int *nsize): + np.int64_t domain_id, int *nsize, + DistanceQueue dq): # Note that we assume that fields[0] == smoothing length in the native # units supplied. We can now iterate over every cell in the block and # every particle to find the nearest. We will use a priority heap. @@ -651,8 +577,8 @@ nneighbors = self.neighbor_search(opos, octree, nind, nsize, nneighbors, domain_id, &oct, 0) self.neighbor_find(nneighbors, nind[0], doffs, pcounts, pinds, ppos, - opos, None, None) - self.process(offset, i, j, k, dim, opos, fields, index_fields) + opos, None, None, dq) + self.process(offset, i, j, k, dim, opos, fields, index_fields, dq) cdef class VolumeWeightedSmooth(ParticleSmoothOperation): # This smoothing function evaluates the field, *without* normalization, at @@ -691,7 +617,7 @@ @cython.initializedcheck(False) cdef void process(self, np.int64_t offset, int i, int j, int k, int dim[3], np.float64_t cpos[3], np.float64_t **fields, - np.float64_t **index_fields): + np.float64_t **index_fields, DistanceQueue dq): # We have our i, j, k for our cell, as well as the cell position. # We also have a list of neighboring particles with particle numbers. cdef int n, fi @@ -701,13 +627,13 @@ cdef np.int64_t pn # We get back our mass # rho_i = sum(j = 1 .. n) m_j * W_ij - max_r = sqrt(self.neighbors[self.curn-1].r2) + max_r = sqrt(dq.neighbors[dq.curn-1].r2) max_hsml = index_fields[0][gind(i,j,k,dim) + offset] - for n in range(self.curn): + for n in range(dq.curn): # No normalization for the moment. # fields[0] is the smoothing length. - r2 = self.neighbors[n].r2 - pn = self.neighbors[n].pn + r2 = dq.neighbors[n].r2 + pn = dq.neighbors[n].pn # Smoothing kernel weight function mass = fields[0][pn] hsml = fields[1][pn] @@ -750,15 +676,15 @@ @cython.initializedcheck(False) cdef void process(self, np.int64_t offset, int i, int j, int k, int dim[3], np.float64_t cpos[3], np.float64_t **fields, - np.float64_t **index_fields): + np.float64_t **index_fields, DistanceQueue dq): # We have our i, j, k for our cell, as well as the cell position. # We also have a list of neighboring particles with particle numbers. cdef np.int64_t pn # We get back our mass # rho_i = sum(j = 1 .. n) m_j * W_ij - pn = self.neighbors[0].pn + pn = dq.neighbors[0].pn self.fp[gind(i,j,k,dim) + offset] = fields[0][pn] - #self.fp[gind(i,j,k,dim) + offset] = self.neighbors[0].r2 + #self.fp[gind(i,j,k,dim) + offset] = dq.neighbors[0].r2 return nearest_smooth = NearestNeighborSmooth @@ -784,18 +710,18 @@ @cython.initializedcheck(False) cdef void process(self, np.int64_t offset, int i, int j, int k, int dim[3], np.float64_t cpos[3], np.float64_t **fields, - np.float64_t **index_fields): + np.float64_t **index_fields, DistanceQueue dq): # We have our i, j, k for our cell, as well as the cell position. # We also have a list of neighboring particles with particle numbers. cdef np.int64_t pn, ni, di cdef np.float64_t total_weight = 0.0, total_value = 0.0, r2, val, w # We're going to do a very simple IDW average - if self.neighbors[0].r2 == 0.0: - pn = self.neighbors[0].pn + if dq.neighbors[0].r2 == 0.0: + pn = dq.neighbors[0].pn self.fp[gind(i,j,k,dim) + offset] = fields[0][pn] - for ni in range(self.curn): - r2 = self.neighbors[ni].r2 - val = fields[0][self.neighbors[ni].pn] + for ni in range(dq.curn): + r2 = dq.neighbors[ni].r2 + val = fields[0][dq.neighbors[ni].pn] w = r2 for di in range(self.p2 - 1): w *= r2 @@ -820,10 +746,10 @@ @cython.initializedcheck(False) cdef void process(self, np.int64_t offset, int i, int j, int k, int dim[3], np.float64_t cpos[3], np.float64_t **fields, - np.float64_t **index_fields): + np.float64_t **index_fields, DistanceQueue dq): cdef np.float64_t max_r # We assume "offset" here is the particle index. - max_r = sqrt(self.neighbors[self.curn-1].r2) + max_r = sqrt(dq.neighbors[dq.curn-1].r2) fields[0][offset] = max_r nth_neighbor_smooth = NthNeighborDistanceSmooth @@ -841,16 +767,16 @@ @cython.initializedcheck(False) cdef void process(self, np.int64_t offset, int i, int j, int k, int dim[3], np.float64_t cpos[3], np.float64_t **fields, - np.float64_t **index_fields): + np.float64_t **index_fields, DistanceQueue dq): cdef np.float64_t r2, hsml, dens, mass, weight, lw cdef int pn # We assume "offset" here is the particle index. - hsml = sqrt(self.neighbors[self.curn-1].r2) + hsml = sqrt(dq.neighbors[dq.curn-1].r2) dens = 0.0 weight = 0.0 - for pn in range(self.curn): - mass = fields[0][self.neighbors[pn].pn] - r2 = self.neighbors[pn].r2 + for pn in range(dq.curn): + mass = fields[0][dq.neighbors[pn].pn] + r2 = dq.neighbors[pn].r2 lw = self.sph_kernel(sqrt(r2) / hsml) dens += mass * lw weight = (4.0/3.0) * 3.1415926 * hsml**3 diff -Nru yt-3.3.3/yt/geometry/selection_routines.c yt-3.4.0/yt/geometry/selection_routines.c --- yt-3.3.3/yt/geometry/selection_routines.c 2016-12-12 01:41:35.000000000 +0000 +++ yt-3.4.0/yt/geometry/selection_routines.c 2017-08-10 18:20:21.000000000 +0000 @@ -1,11 +1,9 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "yt/utilities/lib/kdtree.h", - "yt/utilities/lib/platform_dep.h", "yt/utilities/lib/tsearch.h" ], "include_dirs": [ @@ -13,6 +11,10 @@ ], "libraries": [ "m" + ], + "name": "yt.geometry.selection_routines", + "sources": [ + "yt/geometry/selection_routines.pyx" ] }, "module_name": "yt.geometry.selection_routines" @@ -26,7 +28,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -48,6 +50,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -200,16 +203,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -336,6 +343,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -390,6 +403,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -455,9 +497,6 @@ #include "numpy/ufuncobject.h" #include #include "tsearch.h" -#include "kdtree.h" -#include "platform_dep.h" -#include "limits.h" #include "math.h" #include "pythread.h" #include "pystate.h" @@ -505,8 +544,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -519,8 +558,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -642,10 +684,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -680,10 +724,11 @@ static const char *__pyx_f[] = { "yt/geometry/selection_routines.pyx", "yt/geometry/selection_routines.pxd", - "__init__.pxd", "stringsource", + "__init__.pxd", "type.pxd", "yt/geometry/oct_visitors.pxd", + "yt/utilities/lib/allocation_container.pxd", "yt/geometry/oct_container.pxd", "yt/utilities/lib/partitioned_grid.pxd", "yt/utilities/lib/image_samplers.pxd", @@ -1018,6 +1063,8 @@ struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain; struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree; struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree; +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool; +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool; struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer; @@ -1031,6 +1078,7 @@ struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject; struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector; @@ -1046,6 +1094,14 @@ struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector; struct __pyx_obj_2yt_8geometry_18selection_routines___pyx_scope_struct____init__; struct __pyx_obj_2yt_8geometry_18selection_routines___pyx_scope_struct_1_genexpr; struct __pyx_array_obj; @@ -1158,7 +1214,7 @@ __pyx_t_5numpy_float64_t right_edge_x; __pyx_t_5numpy_float64_t right_edge_y; __pyx_t_5numpy_float64_t right_edge_z; - __pyx_t_5numpy_int64_t children_pointers; + __pyx_t_5numpy_int_t children_pointers; __pyx_t_5numpy_int64_t start_index_x; __pyx_t_5numpy_int64_t start_index_y; __pyx_t_5numpy_int64_t start_index_z; @@ -1196,14 +1252,43 @@ * # This is similar in spirit to the way oct visitor functions work. However, */ typedef void __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t); +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer; +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs; + +/* "yt/utilities/lib/allocation_container.pxd":19 + * from libc.stdlib cimport malloc, free, realloc + * + * cdef struct AllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + void *my_objs; +}; + +/* "yt/utilities/lib/allocation_container.pxd":30 + * cdef np.uint64_t n_con + * cdef AllocationContainer* containers + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except * # <<<<<<<<<<<<<< + * cdef void setup_objs(self, void *obj, np.uint64_t count, + * np.uint64_t offset, np.int64_t con_id) + */ +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs { + int __pyx_n; + __pyx_t_5numpy_int64_t con_id; +}; struct __pyx_t_2yt_8geometry_13oct_container_OctKey; struct __pyx_t_2yt_8geometry_13oct_container_OctInfo; -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_t_2yt_8geometry_13oct_container_OctList; +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs; -/* "oct_container.pxd":28 +/* "oct_container.pxd":30 * cdef int ORDER_MAX * * cdef struct OctKey: # <<<<<<<<<<<<<< @@ -1215,7 +1300,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node; }; -/* "oct_container.pxd":32 +/* "oct_container.pxd":34 * Oct *node * * cdef struct OctInfo: # <<<<<<<<<<<<<< @@ -1229,25 +1314,9 @@ __pyx_t_5numpy_int32_t level; }; -/* "oct_container.pxd":38 +/* "oct_container.pxd":40 * np.int32_t level * - * cdef struct OctAllocationContainer # <<<<<<<<<<<<<< - * cdef struct OctAllocationContainer: - * np.int64_t n - */ -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { - __pyx_t_5numpy_int64_t n; - __pyx_t_5numpy_int64_t n_assigned; - __pyx_t_5numpy_int64_t offset; - __pyx_t_5numpy_int64_t con_id; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *next; - struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_octs; -}; - -/* "oct_container.pxd":47 - * Oct *my_octs - * * cdef struct OctList # <<<<<<<<<<<<<< * * cdef struct OctList: @@ -1257,7 +1326,22 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "oct_container.pxd":69 +/* "oct_container.pxd":48 + * # NOTE: This object *has* to be the same size as the AllocationContainer + * # object. There's an assert in the __cinit__ function. + * cdef struct OctAllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs; +}; + +/* "oct_container.pxd":74 * cdef public np.int64_t nocts * cdef public int num_domains * cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?, # <<<<<<<<<<<<<< @@ -1270,8 +1354,8 @@ int max_level; }; -/* "oct_container.pxd":78 - * # OctAllocationContainer.offset if such a thing exists. +/* "oct_container.pxd":83 + * # AllocationContainer.offset if such a thing exists. * cdef np.int64_t get_domain_offset(self, int domain_id) * cdef void visit_all_octs(self, # <<<<<<<<<<<<<< * selection_routines.SelectorObject selector, @@ -1300,53 +1384,28 @@ __pyx_t_5numpy_float64_t idds[3]; int dims[3]; }; -struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer; - -/* "lenses.pxd":32 - * cdef int SHRT_MAX - * - * cdef struct ImageContainer: # <<<<<<<<<<<<<< - * np.float64_t[:,:,:] vp_pos - * np.float64_t[:,:,:] vp_dir - */ -struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer { - __Pyx_memviewslice vp_pos; - __Pyx_memviewslice vp_dir; - __pyx_t_5numpy_float64_t *center; - __Pyx_memviewslice image; - __Pyx_memviewslice zbuffer; - __Pyx_memviewslice image_used; - __Pyx_memviewslice mesh_lines; - __pyx_t_5numpy_float64_t pdx; - __pyx_t_5numpy_float64_t pdy; - __pyx_t_5numpy_float64_t bounds[4]; - __Pyx_memviewslice camera_data; - int nv[2]; - __pyx_t_5numpy_float64_t *x_vec; - __pyx_t_5numpy_float64_t *y_vec; -}; +struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator; -/* "lenses.pxd":48 - * +/* "image_samplers.pxd":30 + * cdef struct VolumeRenderAccumulator * - * ctypedef int calculate_extent_function(ImageContainer *image, # <<<<<<<<<<<<<< + * ctypedef int calculate_extent_function(ImageSampler image, # <<<<<<<<<<<<<< * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 * */ -typedef int __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *); +typedef int __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *); -/* "lenses.pxd":51 +/* "image_samplers.pxd":33 * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 * - * ctypedef void generate_vector_info_function(ImageContainer *im, # <<<<<<<<<<<<<< + * ctypedef void generate_vector_info_function(ImageSampler im, # <<<<<<<<<<<<<< * np.int64_t vi, np.int64_t vj, * np.float64_t width[2], */ -typedef void __pyx_t_2yt_9utilities_3lib_6lenses_generate_vector_info_function(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); -struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator; +typedef void __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); -/* "image_samplers.pxd":35 - * cdef struct VolumeRenderAccumulator +/* "image_samplers.pxd":38 + * np.float64_t v_dir[3], np.float64_t v_pos[3]) nogil * * cdef struct ImageAccumulator: # <<<<<<<<<<<<<< * np.float64_t rgba[Nch] @@ -1387,8 +1446,15 @@ struct __pyx_opt_args_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_select_grid; struct __pyx_opt_args_2yt_8geometry_18selection_routines_14AlwaysSelector_select_grid; struct __pyx_opt_args_2yt_8geometry_18selection_routines_15ComposeSelector_select_grid; +struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_grid; +struct __pyx_opt_args_2yt_8geometry_18selection_routines_17BooleanORSelector_select_grid; +struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_grid; +struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_grid; +struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_grid; +struct __pyx_opt_args_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_grid; +struct __pyx_opt_args_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_grid; -/* "yt/geometry/selection_routines.pxd":42 +/* "yt/geometry/selection_routines.pxd":38 * cdef np.int64_t _hash * * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -1400,7 +1466,7 @@ int visit_covered; }; -/* "yt/geometry/selection_routines.pxd":50 +/* "yt/geometry/selection_routines.pxd":46 * np.float64_t spos[3], np.float64_t sdds[3], * OctVisitor visitor, int i, int j, int k) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1412,7 +1478,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "yt/geometry/selection_routines.pxd":65 +/* "yt/geometry/selection_routines.pxd":61 * np.ndarray[np.uint8_t, ndim=3] mask, * int level) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -1424,7 +1490,7 @@ __pyx_t_5numpy_uint8_t *cached_mask; }; -/* "yt/geometry/selection_routines.pyx":1392 +/* "yt/geometry/selection_routines.pyx":1381 * ortho_ray_selector = OrthoRaySelector * * cdef struct IntegrationAccumulator: # <<<<<<<<<<<<<< @@ -1438,7 +1504,7 @@ int hits; }; -/* "yt/geometry/selection_routines.pyx":1847 +/* "yt/geometry/selection_routines.pyx":1852 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1450,7 +1516,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "yt/geometry/selection_routines.pyx":1927 +/* "yt/geometry/selection_routines.pyx":1932 * return self.base_selector.select_bbox(left_edge, right_edge) * * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1462,7 +1528,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "yt/geometry/selection_routines.pyx":1961 +/* "yt/geometry/selection_routines.pyx":1966 * return 1 * * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1474,7 +1540,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "yt/geometry/selection_routines.pyx":2004 +/* "yt/geometry/selection_routines.pyx":2009 * return 0 * * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1486,6 +1552,90 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; +/* "yt/geometry/selection_routines.pyx":2123 + * return 1 + * + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + */ +struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_grid { + int __pyx_n; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; +}; + +/* "yt/geometry/selection_routines.pyx":2167 + * return 0 + * + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + */ +struct __pyx_opt_args_2yt_8geometry_18selection_routines_17BooleanORSelector_select_grid { + int __pyx_n; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; +}; + +/* "yt/geometry/selection_routines.pyx":2209 + * return 1 + * + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + */ +struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_grid { + int __pyx_n; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; +}; + +/* "yt/geometry/selection_routines.pyx":2241 + * return 1 + * + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + */ +struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_grid { + int __pyx_n; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; +}; + +/* "yt/geometry/selection_routines.pyx":2277 + * return self.sel1.select_bbox(left_edge, right_edge) + * + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + */ +struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_grid { + int __pyx_n; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; +}; + +/* "yt/geometry/selection_routines.pyx":2334 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + */ +struct __pyx_opt_args_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_grid { + int __pyx_n; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; +}; + +/* "yt/geometry/selection_routines.pyx":2400 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + */ +struct __pyx_opt_args_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_grid { + int __pyx_n; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; +}; + /* "oct_visitors.pxd":33 * np.int64_t padding * @@ -1744,23 +1894,50 @@ struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base; __Pyx_memviewslice ref_mask; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs; - __pyx_t_5numpy_int64_t *nocts; - __pyx_t_5numpy_int64_t *nfinest; + __pyx_t_5numpy_uint64_t *nocts; + __pyx_t_5numpy_uint64_t *nfinest; +}; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool { + PyObject_HEAD + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab; + __pyx_t_5numpy_uint64_t itemsize; + __pyx_t_5numpy_uint64_t n_con; + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers; +}; + + +/* "oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; }; -/* "oct_container.pxd":57 +/* "oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer { PyObject_HEAD struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *cont; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer **domains; + struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh; int partial_coverage; int level_offset; @@ -1774,7 +1951,7 @@ }; -/* "oct_container.pxd":89 +/* "oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -1790,7 +1967,7 @@ }; -/* "oct_container.pxd":97 +/* "oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -1824,17 +2001,30 @@ }; -/* "image_samplers.pxd":39 +/* "image_samplers.pxd":42 * void *supp_data * * cdef class ImageSampler: # <<<<<<<<<<<<<< - * cdef ImageContainer *image - * cdef public object acenter, aimage, ax_vec, ay_vec + * cdef np.float64_t[:,:,:] vp_pos + * cdef np.float64_t[:,:,:] vp_dir */ struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler { PyObject_HEAD struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtab; - struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *image; + __Pyx_memviewslice vp_pos; + __Pyx_memviewslice vp_dir; + __pyx_t_5numpy_float64_t *center; + __Pyx_memviewslice image; + __Pyx_memviewslice zbuffer; + __Pyx_memviewslice image_used; + __Pyx_memviewslice mesh_lines; + __pyx_t_5numpy_float64_t pdx; + __pyx_t_5numpy_float64_t pdy; + __pyx_t_5numpy_float64_t bounds[4]; + __Pyx_memviewslice camera_data; + int nv[2]; + __pyx_t_5numpy_float64_t *x_vec; + __pyx_t_5numpy_float64_t *y_vec; PyObject *acenter; PyObject *aimage; PyObject *ax_vec; @@ -1845,12 +2035,12 @@ void *supp_data; __pyx_t_5numpy_float64_t width[3]; PyObject *lens_type; - __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function *extent_function; - __pyx_t_2yt_9utilities_3lib_6lenses_generate_vector_info_function *vector_function; + __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function *extent_function; + __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function *vector_function; }; -/* "image_samplers.pxd":60 +/* "image_samplers.pxd":75 * void *data) nogil * * cdef class ProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1862,7 +2052,7 @@ }; -/* "image_samplers.pxd":63 +/* "image_samplers.pxd":78 * pass * * cdef class InterpolatedProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1877,7 +2067,7 @@ }; -/* "image_samplers.pxd":68 +/* "image_samplers.pxd":83 * cdef public object my_field_tables * * cdef class VolumeRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1889,12 +2079,11 @@ struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *vra; PyObject *tf_obj; PyObject *my_field_tables; - struct kdtree **trees; PyObject *tree_containers; }; -/* "image_samplers.pxd":75 +/* "image_samplers.pxd":89 * cdef object tree_containers * * cdef class LightSourceRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1926,7 +2115,7 @@ }; -/* "yt/geometry/selection_routines.pxd":33 +/* "yt/geometry/selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1946,7 +2135,7 @@ }; -/* "yt/geometry/selection_routines.pxd":71 +/* "yt/geometry/selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1958,7 +2147,7 @@ }; -/* "yt/geometry/selection_routines.pxd":74 +/* "yt/geometry/selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1972,7 +2161,21 @@ }; -/* "yt/geometry/selection_routines.pyx":649 +/* "yt/geometry/selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2; +}; + + +/* "yt/geometry/selection_routines.pyx":641 * * * cdef class PointSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1985,7 +2188,7 @@ }; -/* "yt/geometry/selection_routines.pyx":706 +/* "yt/geometry/selection_routines.pyx":698 * * * cdef class SphereSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2002,7 +2205,7 @@ }; -/* "yt/geometry/selection_routines.pyx":808 +/* "yt/geometry/selection_routines.pyx":800 * sphere_selector = SphereSelector * * cdef class RegionSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2019,7 +2222,7 @@ }; -/* "yt/geometry/selection_routines.pyx":972 +/* "yt/geometry/selection_routines.pyx":961 * region_selector = RegionSelector * * cdef class CutRegionSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2033,7 +2236,7 @@ }; -/* "yt/geometry/selection_routines.pyx":1006 +/* "yt/geometry/selection_routines.pyx":995 * cut_region_selector = CutRegionSelector * * cdef class DiskSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2050,7 +2253,7 @@ }; -/* "yt/geometry/selection_routines.pyx":1121 +/* "yt/geometry/selection_routines.pyx":1110 * disk_selector = DiskSelector * * cdef class CuttingPlaneSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2064,7 +2267,7 @@ }; -/* "yt/geometry/selection_routines.pyx":1201 +/* "yt/geometry/selection_routines.pyx":1190 * cutting_selector = CuttingPlaneSelector * * cdef class SliceSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2080,7 +2283,7 @@ }; -/* "yt/geometry/selection_routines.pyx":1290 +/* "yt/geometry/selection_routines.pyx":1279 * slice_selector = SliceSelector * * cdef class OrthoRaySelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2097,7 +2300,7 @@ }; -/* "yt/geometry/selection_routines.pyx":1414 +/* "yt/geometry/selection_routines.pyx":1403 * am.dt[di] = (exit_t - enter_t) * * cdef class RaySelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2141,7 +2344,7 @@ }; -/* "yt/geometry/selection_routines.pyx":1762 +/* "yt/geometry/selection_routines.pyx":1767 * ellipsoid_selector = EllipsoidSelector * * cdef class GridSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2154,7 +2357,7 @@ }; -/* "yt/geometry/selection_routines.pyx":1865 +/* "yt/geometry/selection_routines.pyx":1870 * octree_subset_selector = OctreeSubsetSelector * * cdef class IndexedOctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2172,7 +2375,7 @@ }; -/* "yt/geometry/selection_routines.pyx":1981 +/* "yt/geometry/selection_routines.pyx":1986 * always_selector = AlwaysSelector * * cdef class ComposeSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2186,7 +2389,7 @@ }; -/* "yt/geometry/selection_routines.pyx":2040 +/* "yt/geometry/selection_routines.pyx":2045 * compose_selector = ComposeSelector * * cdef class HaloParticlesSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2202,7 +2405,105 @@ }; -/* "yt/geometry/selection_routines.pyx":976 +/* "yt/geometry/selection_routines.pyx":2114 + * self.sel2 = dobj.dobj2.selector + * + * cdef class BooleanANDSelector(BooleanSelector): # <<<<<<<<<<<<<< + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector __pyx_base; +}; + + +/* "yt/geometry/selection_routines.pyx":2158 + * self.sel2._hash_vals()) + * + * cdef class BooleanORSelector(BooleanSelector): # <<<<<<<<<<<<<< + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector __pyx_base; +}; + + +/* "yt/geometry/selection_routines.pyx":2202 + * self.sel2._hash_vals()) + * + * cdef class BooleanNOTSelector(BooleanSelector): # <<<<<<<<<<<<<< + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector __pyx_base; +}; + + +/* "yt/geometry/selection_routines.pyx":2233 + * ("not",)) + * + * cdef class BooleanXORSelector(BooleanSelector): # <<<<<<<<<<<<<< + * + * cdef int select_bbox(self, np.float64_t left_edge[3], + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector __pyx_base; +}; + + +/* "yt/geometry/selection_routines.pyx":2269 + * self.sel2._hash_vals()) + * + * cdef class BooleanNEGSelector(BooleanSelector): # <<<<<<<<<<<<<< + * + * cdef int select_bbox(self, np.float64_t left_edge[3], + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector __pyx_base; +}; + + +/* "yt/geometry/selection_routines.pyx":2308 + * self.sel2._hash_vals()) + * + * cdef class ChainedBooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef int n_obj + * cdef np.ndarray selectors + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; + int n_obj; + PyArrayObject *selectors; +}; + + +/* "yt/geometry/selection_routines.pyx":2318 + * self.selectors[i] = dobj.data_objects[i].selector + * + * cdef class ChainedBooleanANDSelector(ChainedBooleanSelector): # <<<<<<<<<<<<<< + * @cython.cdivision(True) + * @cython.boundscheck(False) + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector __pyx_base; +}; + + +/* "yt/geometry/selection_routines.pyx":2384 + * intersection_selector = ChainedBooleanANDSelector + * + * cdef class ChainedBooleanORSelector(ChainedBooleanSelector): # <<<<<<<<<<<<<< + * @cython.cdivision(True) + * @cython.boundscheck(False) + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector __pyx_base; +}; + + +/* "yt/geometry/selection_routines.pyx":965 * cdef tuple _conditionals * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -2215,7 +2516,7 @@ }; -/* "yt/geometry/selection_routines.pyx":979 +/* "yt/geometry/selection_routines.pyx":968 * positions = np.array([dobj['x'], dobj['y'], dobj['z']]).T * self._conditionals = tuple(dobj.conditionals) * self._positions = set(tuple(position) for position in positions) # <<<<<<<<<<<<<< @@ -2577,12 +2878,44 @@ static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree; -/* "oct_container.pxd":57 +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool { + void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args); + void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); + void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + + +/* "oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ + +struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); +}; +static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool; +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); + + +/* "oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer { @@ -2599,7 +2932,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer; -/* "oct_container.pxd":89 +/* "oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -2615,7 +2948,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer; -/* "oct_container.pxd":97 +/* "oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -2643,12 +2976,12 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid; -/* "image_samplers.pxd":39 +/* "image_samplers.pxd":42 * void *supp_data * * cdef class ImageSampler: # <<<<<<<<<<<<<< - * cdef ImageContainer *image - * cdef public object acenter, aimage, ax_vec, ay_vec + * cdef np.float64_t[:,:,:] vp_pos + * cdef np.float64_t[:,:,:] vp_dir */ struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler { @@ -2658,7 +2991,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler; -/* "image_samplers.pxd":60 +/* "image_samplers.pxd":75 * void *data) nogil * * cdef class ProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -2672,7 +3005,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler; -/* "image_samplers.pxd":63 +/* "image_samplers.pxd":78 * pass * * cdef class InterpolatedProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -2686,7 +3019,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler; -/* "image_samplers.pxd":68 +/* "image_samplers.pxd":83 * cdef public object my_field_tables * * cdef class VolumeRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -2700,7 +3033,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler; -/* "image_samplers.pxd":75 +/* "image_samplers.pxd":89 * cdef object tree_containers * * cdef class LightSourceRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -2729,7 +3062,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray; -/* "yt/geometry/selection_routines.pyx":121 +/* "yt/geometry/selection_routines.pyx":113 * raise RuntimeError * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -2752,7 +3085,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; -/* "yt/geometry/selection_routines.pyx":1939 +/* "yt/geometry/selection_routines.pyx":1944 * indexed_octree_subset_selector = IndexedOctreeSubsetSelector * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2766,7 +3099,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; -/* "yt/geometry/selection_routines.pyx":1801 +/* "yt/geometry/selection_routines.pyx":1806 * grid_selector = GridSelector * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2780,7 +3113,21 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; -/* "yt/geometry/selection_routines.pyx":649 +/* "yt/geometry/selection_routines.pyx":2100 + * return mask + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * + * def __init__(self, dobj): + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + + +/* "yt/geometry/selection_routines.pyx":641 * * * cdef class PointSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2794,7 +3141,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_PointSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_PointSelector; -/* "yt/geometry/selection_routines.pyx":706 +/* "yt/geometry/selection_routines.pyx":698 * * * cdef class SphereSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2808,7 +3155,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SphereSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_SphereSelector; -/* "yt/geometry/selection_routines.pyx":808 +/* "yt/geometry/selection_routines.pyx":800 * sphere_selector = SphereSelector * * cdef class RegionSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2822,7 +3169,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_RegionSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_RegionSelector; -/* "yt/geometry/selection_routines.pyx":972 +/* "yt/geometry/selection_routines.pyx":961 * region_selector = RegionSelector * * cdef class CutRegionSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2836,7 +3183,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_CutRegionSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_CutRegionSelector; -/* "yt/geometry/selection_routines.pyx":1006 +/* "yt/geometry/selection_routines.pyx":995 * cut_region_selector = CutRegionSelector * * cdef class DiskSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2850,7 +3197,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_DiskSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_DiskSelector; -/* "yt/geometry/selection_routines.pyx":1121 +/* "yt/geometry/selection_routines.pyx":1110 * disk_selector = DiskSelector * * cdef class CuttingPlaneSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2864,7 +3211,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_CuttingPlaneSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_CuttingPlaneSelector; -/* "yt/geometry/selection_routines.pyx":1201 +/* "yt/geometry/selection_routines.pyx":1190 * cutting_selector = CuttingPlaneSelector * * cdef class SliceSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2878,7 +3225,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SliceSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_SliceSelector; -/* "yt/geometry/selection_routines.pyx":1290 +/* "yt/geometry/selection_routines.pyx":1279 * slice_selector = SliceSelector * * cdef class OrthoRaySelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2892,7 +3239,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OrthoRaySelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OrthoRaySelector; -/* "yt/geometry/selection_routines.pyx":1414 +/* "yt/geometry/selection_routines.pyx":1403 * am.dt[di] = (exit_t - enter_t) * * cdef class RaySelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2934,7 +3281,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_EllipsoidSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_EllipsoidSelector; -/* "yt/geometry/selection_routines.pyx":1762 +/* "yt/geometry/selection_routines.pyx":1767 * ellipsoid_selector = EllipsoidSelector * * cdef class GridSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2948,7 +3295,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_GridSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_GridSelector; -/* "yt/geometry/selection_routines.pyx":1865 +/* "yt/geometry/selection_routines.pyx":1870 * octree_subset_selector = OctreeSubsetSelector * * cdef class IndexedOctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2962,7 +3309,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector; -/* "yt/geometry/selection_routines.pyx":1981 +/* "yt/geometry/selection_routines.pyx":1986 * always_selector = AlwaysSelector * * cdef class ComposeSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2976,7 +3323,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ComposeSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_ComposeSelector; -/* "yt/geometry/selection_routines.pyx":2040 +/* "yt/geometry/selection_routines.pyx":2045 * compose_selector = ComposeSelector * * cdef class HaloParticlesSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2990,6 +3337,118 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_HaloParticlesSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_HaloParticlesSelector; +/* "yt/geometry/selection_routines.pyx":2114 + * self.sel2 = dobj.dobj2.selector + * + * cdef class BooleanANDSelector(BooleanSelector): # <<<<<<<<<<<<<< + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanANDSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanANDSelector; + + +/* "yt/geometry/selection_routines.pyx":2158 + * self.sel2._hash_vals()) + * + * cdef class BooleanORSelector(BooleanSelector): # <<<<<<<<<<<<<< + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanORSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanORSelector; + + +/* "yt/geometry/selection_routines.pyx":2202 + * self.sel2._hash_vals()) + * + * cdef class BooleanNOTSelector(BooleanSelector): # <<<<<<<<<<<<<< + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanNOTSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanNOTSelector; + + +/* "yt/geometry/selection_routines.pyx":2233 + * ("not",)) + * + * cdef class BooleanXORSelector(BooleanSelector): # <<<<<<<<<<<<<< + * + * cdef int select_bbox(self, np.float64_t left_edge[3], + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanXORSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanXORSelector; + + +/* "yt/geometry/selection_routines.pyx":2269 + * self.sel2._hash_vals()) + * + * cdef class BooleanNEGSelector(BooleanSelector): # <<<<<<<<<<<<<< + * + * cdef int select_bbox(self, np.float64_t left_edge[3], + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanNEGSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanNEGSelector; + + +/* "yt/geometry/selection_routines.pyx":2308 + * self.sel2._hash_vals()) + * + * cdef class ChainedBooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef int n_obj + * cdef np.ndarray selectors + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ChainedBooleanSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ChainedBooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanSelector; + + +/* "yt/geometry/selection_routines.pyx":2318 + * self.selectors[i] = dobj.data_objects[i].selector + * + * cdef class ChainedBooleanANDSelector(ChainedBooleanSelector): # <<<<<<<<<<<<<< + * @cython.cdivision(True) + * @cython.boundscheck(False) + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ChainedBooleanSelector __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector; + + +/* "yt/geometry/selection_routines.pyx":2384 + * intersection_selector = ChainedBooleanANDSelector + * + * cdef class ChainedBooleanORSelector(ChainedBooleanSelector): # <<<<<<<<<<<<<< + * @cython.cdivision(True) + * @cython.boundscheck(False) + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ChainedBooleanORSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ChainedBooleanSelector __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanORSelector; + + /* "View.MemoryView":103 * * @cname("__pyx_array") @@ -3120,35 +3579,6 @@ /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* WriteUnraisableException.proto */ -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename, - int full_traceback, int nogil); - /* 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); @@ -3172,7 +3602,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); @@ -3192,6 +3622,30 @@ #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2) #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); @@ -3253,35 +3707,17 @@ static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* SaveResetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -#else -#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) -#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) -#endif - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif +/* 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() -/* 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 +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); /* PyDictContains.proto */ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { @@ -3322,6 +3758,34 @@ #endif static long __Pyx__PyObject_Ord(PyObject* c); +/* 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 + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + /* SetItemInt.proto */ #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ @@ -3332,9 +3796,6 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); -/* IterFinish.proto */ -static CYTHON_INLINE int __Pyx_IterFinish(void); - /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ @@ -3371,15 +3832,6 @@ /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* RaiseTooManyValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -/* UnpackItemEndCheck.proto */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); - /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); @@ -3454,20 +3906,34 @@ ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) #endif -/* IncludeStringH.proto */ -#include +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); +/* 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 -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); +/* 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 -/* StrEquals.proto */ -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +/* 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 -#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* None.proto */ @@ -3479,6 +3945,20 @@ 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*/ +/* 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, @@ -3493,6 +3973,9 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS @@ -3530,6 +4013,9 @@ /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + /* CallNextTpTraverse.proto */ static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); @@ -3539,6 +4025,9 @@ /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); @@ -3618,6 +4107,9 @@ static int __pyx_FusedFunction_init(void); #define __Pyx_FusedFunction_USED +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -3676,6 +4168,9 @@ /* Capsule.proto */ static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); +/* IsLittleEndian.proto */ +static int __Pyx_Is_Little_Endian(void); + /* TypeInfoCompare.proto */ static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); @@ -3691,17 +4186,13 @@ PyObject *original_obj); /* ObjectToMemviewSlice.proto */ -static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *); +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *); /* ObjectToMemviewSlice.proto */ -static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *); +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value); - -/* MemviewDtypeToObject.proto */ -static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_char(const char *itemp); -static CYTHON_INLINE int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj); +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); @@ -3850,12 +4341,6 @@ static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); - -/* CIntFromPy.proto */ static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); /* CIntFromPy.proto */ @@ -3873,6 +4358,13 @@ /* BytesContains.proto */ static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character); +/* ImportNumPyArray.proto */ +static PyObject *__pyx_numpy_ndarray = NULL; +static PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void); + +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + /* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(PyObject *); @@ -4020,6 +4512,42 @@ static int __pyx_f_2yt_8geometry_18selection_routines_15ComposeSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos); /* proto*/ static int __pyx_f_2yt_8geometry_18selection_routines_15ComposeSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius); /* proto*/ static int __pyx_f_2yt_8geometry_18selection_routines_15ComposeSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_grid *__pyx_optional_args); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_17BooleanORSelector_select_grid *__pyx_optional_args); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_bbox(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_right_edge); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_grid(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_right_edge, CYTHON_UNUSED __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_grid *__pyx_optional_args); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_bbox(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_right_edge); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_grid(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_right_edge, CYTHON_UNUSED __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_grid *__pyx_optional_args); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_grid *__pyx_optional_args); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_grid *__pyx_optional_args); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_grid *__pyx_optional_args); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos); /* proto*/ +static int __pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius); /* proto*/ +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ @@ -4091,18 +4619,24 @@ /* Module declarations from 'cython' */ +/* Module declarations from 'yt.utilities.lib.fnv_hash' */ +static __pyx_t_5numpy_int64_t (*__pyx_f_2yt_9utilities_3lib_8fnv_hash_c_fnv_hash)(__Pyx_memviewslice); /*proto*/ + /* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ /* Module declarations from 'libc.math' */ +/* Module declarations from 'yt.utilities.lib.allocation_container' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0; + /* Module declarations from 'yt.geometry.oct_container' */ +static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0; @@ -4113,12 +4647,6 @@ static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, int, int, int); /*proto*/ static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *); /*proto*/ -/* Module declarations from 'yt.utilities.lib.kdtree_utils' */ - -/* Module declarations from 'yt.utilities.lib.vec3_ops' */ - -/* Module declarations from 'yt.utilities.lib.lenses' */ - /* Module declarations from 'yt.utilities.lib.partitioned_grid' */ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = 0; @@ -4141,6 +4669,7 @@ static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_PointSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SphereSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_RegionSelector = 0; @@ -4156,6 +4685,14 @@ static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_ComposeSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_HaloParticlesSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanANDSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanORSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanNOTSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanXORSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanNEGSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_ChainedBooleanSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_ChainedBooleanORSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines___pyx_scope_struct____init__ = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines___pyx_scope_struct_1_genexpr = 0; static PyTypeObject *__pyx_array_type = 0; @@ -4172,7 +4709,6 @@ static PyThread_type_lock __pyx_memoryview_thread_locks[8]; static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int); /*proto*/ -static __pyx_t_5numpy_int64_t __pyx_f_2yt_8geometry_18selection_routines_fnv_hash(__Pyx_memviewslice); /*proto*/ static void __pyx_f_2yt_8geometry_18selection_routines_dt_sampler(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int *, void *); /*proto*/ static PyObject *__pyx_fuse_0__pyx_f_2yt_8geometry_18selection_routines__mask_fill(PyArrayObject *, __pyx_t_5numpy_int64_t, PyArrayObject *, PyArrayObject *); /*proto*/ static PyObject *__pyx_fuse_1__pyx_f_2yt_8geometry_18selection_routines__mask_fill(PyArrayObject *, __pyx_t_5numpy_int64_t, PyArrayObject *, PyArrayObject *); /*proto*/ @@ -4208,10 +4744,12 @@ 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_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_char = { "unsigned char", NULL, sizeof(unsigned char), { 0 }, 0, IS_UNSIGNED(unsigned char) ? 'U' : 'I', IS_UNSIGNED(unsigned char), 0 }; #define __Pyx_MODULE_NAME "yt.geometry.selection_routines" @@ -4220,13 +4758,13 @@ /* Implementation of 'yt.geometry.selection_routines' */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_ImportError; -static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_zip; +static PyObject *__pyx_builtin_reversed; static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_id; @@ -4242,11 +4780,14 @@ static const char __pyx_k_j[] = "j"; static const char __pyx_k_k[] = "k"; static const char __pyx_k_p[] = "p"; +static const char __pyx_k_s[] = "s"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k_z[] = "z"; -static const char __pyx_k__5[] = "()"; -static const char __pyx_k__7[] = "|"; +static const char __pyx_k__5[] = "<"; +static const char __pyx_k__6[] = ">"; +static const char __pyx_k__7[] = "()"; +static const char __pyx_k__9[] = "|"; static const char __pyx_k_cx[] = "cx"; static const char __pyx_k_cy[] = "cy"; static const char __pyx_k_cz[] = "cz"; @@ -4260,9 +4801,11 @@ static const char __pyx_k_id[] = "id"; static const char __pyx_k_np[] = "np"; static const char __pyx_k_nz[] = "nz"; +static const char __pyx_k_or[] = "or"; static const char __pyx_k_px[] = "px"; static const char __pyx_k_py[] = "py"; static const char __pyx_k_pz[] = "pz"; +static const char __pyx_k_and[] = "and"; static const char __pyx_k_d_2[] = "_d"; static const char __pyx_k_dds[] = "dds"; static const char __pyx_k_end[] = "end"; @@ -4270,6 +4813,9 @@ static const char __pyx_k_inf[] = "inf"; static const char __pyx_k_n_c[] = "n_c"; static const char __pyx_k_n_p[] = "n_p"; +static const char __pyx_k_neg[] = "neg"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_not[] = "not"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_out[] = "out"; static const char __pyx_k_p_0[] = "p[0]"; @@ -4277,12 +4823,14 @@ static const char __pyx_k_p_2[] = "p[2]"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_vec[] = "vec"; +static const char __pyx_k_xor[] = "xor"; static const char __pyx_k_zip[] = "zip"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_axis[] = "axis"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_bool[] = "bool"; static const char __pyx_k_cpos[] = "cpos"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_dobj[] = "dobj"; static const char __pyx_k_file[] = "file"; static const char __pyx_k_fmod[] = "fmod"; @@ -4317,11 +4865,14 @@ static const char __pyx_k_close[] = "close"; static const char __pyx_k_coord[] = "coord"; static const char __pyx_k_count[] = "count"; +static const char __pyx_k_dobj1[] = "dobj1"; +static const char __pyx_k_dobj2[] = "dobj2"; 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_finfo[] = "finfo"; static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_float[] = "float"; static const char __pyx_k_int64[] = "int64"; static const char __pyx_k_mag_0[] = "mag[0]"; static const char __pyx_k_mag_1[] = "mag[1]"; @@ -4345,6 +4896,7 @@ static const char __pyx_k_always[] = "always"; static const char __pyx_k_astype[] = "astype"; static const char __pyx_k_center[] = "center"; +static const char __pyx_k_double[] = "double"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_extend[] = "extend"; static const char __pyx_k_format[] = "format"; @@ -4353,11 +4905,15 @@ static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_levels[] = "levels"; static const char __pyx_k_name_2[] = "__name__"; +static const char __pyx_k_object[] = "object"; static const char __pyx_k_octree[] = "octree"; static const char __pyx_k_offset[] = "offset"; +static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_radius[] = "radius"; +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_float32[] = "float32"; static const char __pyx_k_float64[] = "float64"; static const char __pyx_k_fortran[] = "fortran"; @@ -4366,9 +4922,9 @@ static const char __pyx_k_max_ind[] = "max_ind"; static const char __pyx_k_memview[] = "memview"; static const char __pyx_k_min_ind[] = "min_ind"; -static const char __pyx_k_ndarray[] = "ndarray"; static const char __pyx_k_obj_ids[] = "_obj_ids"; static const char __pyx_k_radius2[] = "radius2"; +static const char __pyx_k_strides[] = "strides"; static const char __pyx_k_vec_0_0[] = "vec[0][0]"; static const char __pyx_k_vec_0_1[] = "vec[0][1]"; static const char __pyx_k_vec_0_2[] = "vec[0][2]"; @@ -4386,27 +4942,30 @@ static const char __pyx_k_defaults[] = "defaults"; static const char __pyx_k_itemsize[] = "itemsize"; static const char __pyx_k_norm_vec[] = "_norm_vec"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_reversed[] = "reversed"; static const char __pyx_k_selector[] = "selector"; static const char __pyx_k_tostring[] = "tostring"; static const char __pyx_k_RightEdge[] = "RightEdge"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_base_hash[] = "_base_hash"; +static const char __pyx_k_byteorder[] = "byteorder"; static const char __pyx_k_domain_id[] = "domain_id"; static const char __pyx_k_end_point[] = "end_point"; static const char __pyx_k_enumerate[] = "enumerate"; -static const char __pyx_k_float32_t[] = "float32_t"; -static const char __pyx_k_float64_t[] = "float64_t"; static const char __pyx_k_hash_vals[] = "_hash_vals"; static const char __pyx_k_id_offset[] = "_id_offset"; static const char __pyx_k_left_edge[] = "left_edge"; static const char __pyx_k_mask_fill[] = "mask_fill"; static const char __pyx_k_max_level[] = "max_level"; static const char __pyx_k_min_level[] = "min_level"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_selector1[] = "selector1"; static const char __pyx_k_selector2[] = "selector2"; static const char __pyx_k_transpose[] = "transpose"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_chained_or[] = "chained_or"; static const char __pyx_k_child_mask[] = "child_mask"; static const char __pyx_k_left_edges[] = "left_edges"; static const char __pyx_k_logical_or[] = "logical_or"; @@ -4418,7 +4977,9 @@ static const char __pyx_k_to_ndarray[] = "to_ndarray"; 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_base_source[] = "base_source"; +static const char __pyx_k_chained_and[] = "chained_and"; static const char __pyx_k_code_length[] = "code_length"; static const char __pyx_k_filter_bbox[] = "filter_bbox"; static const char __pyx_k_left_edge_0[] = "left_edge[0]"; @@ -4430,13 +4991,17 @@ static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_conditionals[] = "conditionals"; static const char __pyx_k_count_points[] = "count_points"; +static const char __pyx_k_data_objects[] = "data_objects"; static const char __pyx_k_domain_width[] = "domain_width"; +static const char __pyx_k_f_contiguous[] = "f_contiguous"; static const char __pyx_k_index_offset[] = "_index_offset"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_ray_selector[] = "ray_selector"; static const char __pyx_k_right_edge_0[] = "right_edge[0]"; static const char __pyx_k_right_edge_1[] = "right_edge[1]"; static const char __pyx_k_right_edge_2[] = "right_edge[2]"; static const char __pyx_k_select_grids[] = "select_grids"; +static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_base_selector[] = "base_selector"; static const char __pyx_k_conditional_s[] = "conditional[%s]"; static const char __pyx_k_disk_selector[] = "disk_selector"; @@ -4446,20 +5011,23 @@ static const char __pyx_k_periodicity_1[] = "periodicity[1]"; static const char __pyx_k_periodicity_2[] = "periodicity[2]"; static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_select_points[] = "select_points"; -static const char __pyx_k_AttributeError[] = "AttributeError"; static const char __pyx_k_domain_width_0[] = "domain_width[0]"; static const char __pyx_k_domain_width_1[] = "domain_width[1]"; static const char __pyx_k_domain_width_2[] = "domain_width[2]"; static const char __pyx_k_halo_particles[] = "halo_particles"; static const char __pyx_k_point_selector[] = "point_selector"; static const char __pyx_k_slice_selector[] = "slice_selector"; +static const char __pyx_k_union_selector[] = "union_selector"; +static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; static const char __pyx_k_always_selector[] = "always_selector"; static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; static const char __pyx_k_loose_selection[] = "loose_selection"; static const char __pyx_k_points_in_cells[] = "points_in_cells"; static const char __pyx_k_region_selector[] = "region_selector"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_sphere_selector[] = "sphere_selector"; static const char __pyx_k_ActiveDimensions[] = "ActiveDimensions"; static const char __pyx_k_compose_selector[] = "compose_selector"; @@ -4468,6 +5036,8 @@ static const char __pyx_k_domain_left_edge[] = "domain_left_edge"; static const char __pyx_k_particle_indices[] = "particle_indices"; static const char __pyx_k_domain_right_edge[] = "domain_right_edge"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_ellipsoid_selector[] = "ellipsoid_selector"; static const char __pyx_k_ortho_ray_selector[] = "ortho_ray_selector"; static const char __pyx_k_strided_and_direct[] = ""; @@ -4479,6 +5049,7 @@ static const char __pyx_k_strided_and_indirect[] = ""; static const char __pyx_k_contiguous_and_direct[] = ""; static const char __pyx_k_init___locals_genexpr[] = "__init__..genexpr"; +static const char __pyx_k_intersection_selector[] = "intersection_selector"; static const char __pyx_k_MemoryView_of_r_object[] = ""; static const char __pyx_k_octree_subset_selector[] = "octree_subset_selector"; static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; @@ -4494,9 +5065,7 @@ 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_SelectorObject_select_points[] = "SelectorObject.select_points"; -static const char __pyx_k_Expected_at_least_d_arguments[] = "Expected at least %d arguments"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/geometry/selection_routines.pyx"; static const char __pyx_k_indexed_octree_subset_selector[] = "indexed_octree_subset_selector"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_yt_geometry_selection_routines[] = "yt.geometry.selection_routines"; @@ -4506,8 +5075,10 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Error_yt_attempted_to_read_outsi[] = "Error: yt attempted to read outside the boundaries of a non-periodic domain along dimension %s.\nRegion left edge = %s, Region right edge = %s\nDataset left edge = %s, Dataset right edge = %s\n\nThis commonly happens when trying to compute ghost cells up to the domain boundary. Two possible solutions are to load a smaller region that does not border the edge or override the periodicity for this dataset."; +static const char __pyx_k_Expected_at_least_d_argument_s_g[] = "Expected at least %d argument%s, got %d"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; static const char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types"; +static const char __pyx_k_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"; @@ -4516,13 +5087,14 @@ 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_yt_geometry_selection_routines_p[] = "yt/geometry/selection_routines.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_n_s_A; static PyObject *__pyx_n_s_ASCII; static PyObject *__pyx_n_s_ActiveDimensions; -static PyObject *__pyx_n_s_AttributeError; static PyObject *__pyx_n_s_B; static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; static PyObject *__pyx_n_s_C; @@ -4531,11 +5103,12 @@ static PyObject *__pyx_n_s_Ellipsis; static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; static PyObject *__pyx_kp_s_Error_yt_attempted_to_read_outsi; -static PyObject *__pyx_kp_s_Expected_at_least_d_arguments; +static PyObject *__pyx_kp_s_Expected_at_least_d_argument_s_g; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; static PyObject *__pyx_kp_s_Function_call_with_ambiguous_arg; static PyObject *__pyx_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; @@ -4550,6 +5123,7 @@ static PyObject *__pyx_n_s_NotImplementedError; 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_Region_right_edge_s_left_edge_wi; static PyObject *__pyx_n_s_RightEdge; static PyObject *__pyx_n_s_RuntimeError; @@ -4558,13 +5132,16 @@ static PyObject *__pyx_n_s_T; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_kp_s__6; static PyObject *__pyx_kp_s__7; +static PyObject *__pyx_kp_s__9; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_always; static PyObject *__pyx_n_s_always_selector; +static PyObject *__pyx_n_s_and; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_s_array; static PyObject *__pyx_n_s_ascii; @@ -4575,14 +5152,18 @@ static PyObject *__pyx_n_s_base_selector; static PyObject *__pyx_n_s_base_source; static PyObject *__pyx_n_s_bool; +static PyObject *__pyx_n_s_byteorder; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_u_c; static PyObject *__pyx_n_s_center; static PyObject *__pyx_kp_s_center_0; static PyObject *__pyx_kp_s_center_1; static PyObject *__pyx_kp_s_center_2; +static PyObject *__pyx_n_s_chained_and; +static PyObject *__pyx_n_s_chained_or; static PyObject *__pyx_n_s_child_mask; static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_s_code_length; static PyObject *__pyx_n_s_compose_selector; @@ -4607,10 +5188,14 @@ static PyObject *__pyx_n_s_d; static PyObject *__pyx_n_s_d_2; static PyObject *__pyx_n_s_data_collection_selector; +static PyObject *__pyx_n_s_data_objects; static PyObject *__pyx_n_s_dds; static PyObject *__pyx_n_s_defaults; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_disk_selector; static PyObject *__pyx_n_s_dobj; +static PyObject *__pyx_n_s_dobj1; +static PyObject *__pyx_n_s_dobj2; static PyObject *__pyx_n_s_domain_id; static PyObject *__pyx_n_s_domain_left_edge; static PyObject *__pyx_n_s_domain_right_edge; @@ -4618,6 +5203,7 @@ static PyObject *__pyx_kp_s_domain_width_0; static PyObject *__pyx_kp_s_domain_width_1; static PyObject *__pyx_kp_s_domain_width_2; +static PyObject *__pyx_n_s_double; static PyObject *__pyx_n_s_ds; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_dtype_is_object; @@ -4636,14 +5222,14 @@ static PyObject *__pyx_n_s_eps; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_extend; +static PyObject *__pyx_n_s_f_contiguous; static PyObject *__pyx_n_s_file; static PyObject *__pyx_n_s_filter_bbox; static PyObject *__pyx_n_s_finfo; static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_float; static PyObject *__pyx_n_s_float32; -static PyObject *__pyx_n_s_float32_t; static PyObject *__pyx_n_s_float64; -static PyObject *__pyx_n_s_float64_t; static PyObject *__pyx_n_s_fmod; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_fortran; @@ -4665,6 +5251,7 @@ static PyObject *__pyx_n_s_inf; static PyObject *__pyx_n_s_init___locals_genexpr; static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_intersection_selector; static PyObject *__pyx_n_s_itemsize; static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; static PyObject *__pyx_n_s_j; @@ -4696,14 +5283,17 @@ static PyObject *__pyx_n_s_n_p; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_name_2; -static PyObject *__pyx_n_s_ndarray; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_neg; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_norm_vec; static PyObject *__pyx_kp_s_norm_vec_0; static PyObject *__pyx_kp_s_norm_vec_1; static PyObject *__pyx_kp_s_norm_vec_2; +static PyObject *__pyx_n_s_not; static PyObject *__pyx_n_s_np; static PyObject *__pyx_n_s_numpy; static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; @@ -4711,10 +5301,12 @@ static PyObject *__pyx_n_s_nz; static PyObject *__pyx_n_s_obj; static PyObject *__pyx_n_s_obj_ids; +static PyObject *__pyx_n_s_object; static PyObject *__pyx_n_s_octree; static PyObject *__pyx_n_s_octree_subset_selector; static PyObject *__pyx_n_s_offset; static PyObject *__pyx_n_s_ones; +static PyObject *__pyx_n_s_or; static PyObject *__pyx_n_s_ortho_ray_selector; static PyObject *__pyx_n_s_out; static PyObject *__pyx_n_s_overlap_cells; @@ -4734,6 +5326,7 @@ static PyObject *__pyx_kp_s_periodicity_0; static PyObject *__pyx_kp_s_periodicity_1; static PyObject *__pyx_kp_s_periodicity_2; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_point_selector; static PyObject *__pyx_n_s_points_in_cells; static PyObject *__pyx_n_s_pos; @@ -4742,19 +5335,27 @@ static PyObject *__pyx_n_s_px_ax; static PyObject *__pyx_n_s_py; static PyObject *__pyx_n_s_py_ax; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_pz; static PyObject *__pyx_n_s_radius; static PyObject *__pyx_n_s_radius2; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_ray_selector; +static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_region_selector; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_reversed; static PyObject *__pyx_n_s_right_edge; static PyObject *__pyx_kp_s_right_edge_0; static PyObject *__pyx_kp_s_right_edge_1; static PyObject *__pyx_kp_s_right_edge_2; static PyObject *__pyx_n_s_right_edges; +static PyObject *__pyx_n_s_s; static PyObject *__pyx_n_s_select_grids; static PyObject *__pyx_n_s_select_points; static PyObject *__pyx_n_s_selector; @@ -4762,6 +5363,7 @@ static PyObject *__pyx_n_s_selector2; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_send; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_slice_selector; @@ -4774,6 +5376,8 @@ static PyObject *__pyx_kp_s_strided_and_direct; static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_n_s_strides; +static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_strip; static PyObject *__pyx_n_s_struct; static PyObject *__pyx_n_s_test; @@ -4784,9 +5388,11 @@ static PyObject *__pyx_n_s_uint8; static PyObject *__pyx_kp_s_unable_to_allocate_array_data; static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; +static PyObject *__pyx_n_s_union_selector; static PyObject *__pyx_n_s_units; 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_vals; static PyObject *__pyx_n_s_vec; static PyObject *__pyx_kp_s_vec_0; @@ -4803,8 +5409,10 @@ static PyObject *__pyx_kp_s_vec_2_2; static PyObject *__pyx_n_s_view; static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_xor; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_yt_geometry_selection_routines; +static PyObject *__pyx_kp_s_yt_geometry_selection_routines_p; static PyObject *__pyx_n_s_z; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_n_s_zip; @@ -4830,54 +5438,88 @@ static int __pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_9min_level_2__set__(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_9max_level___get__(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_9max_level_2__set__(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_36__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_38__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_13PointSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_13PointSelector_2_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_13PointSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_13PointSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_14SphereSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14SphereSelector_2_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14SphereSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14SphereSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_14RegionSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14RegionSelector_2_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14RegionSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14RegionSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17CutRegionSelector_8__init___genexpr(PyObject *__pyx_self); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_17CutRegionSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17CutRegionSelector_2_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17CutRegionSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17CutRegionSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_12DiskSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_12DiskSelector_2_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_12DiskSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_12DiskSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_20CuttingPlaneSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_2_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_13SliceSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_13SliceSelector_2fill_mask(struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *__pyx_v_self, PyObject *__pyx_v_gobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_13SliceSelector_4_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_13SliceSelector_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_13SliceSelector_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_16OrthoRaySelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_16OrthoRaySelector_2fill_mask(struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *__pyx_v_self, PyObject *__pyx_v_gobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_16OrthoRaySelector_4_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_16OrthoRaySelector_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_16OrthoRaySelector_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_11RaySelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_11RaySelector_2fill_mask(struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *__pyx_v_self, PyObject *__pyx_v_gobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_11RaySelector_4get_dt(struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *__pyx_v_self, PyObject *__pyx_v_gobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_11RaySelector_6get_dt_mesh(struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *__pyx_v_self, PyObject *__pyx_v_mesh, PyObject *__pyx_v_nz, int __pyx_v_offset); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_11RaySelector_8_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_11RaySelector_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_11RaySelector_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_22DataCollectionSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_22DataCollectionSelector_2select_grids(struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *__pyx_v_self, PyArrayObject *__pyx_v_left_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_right_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_22DataCollectionSelector_4fill_mask(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *__pyx_v_self, PyObject *__pyx_v_gobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_22DataCollectionSelector_6_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_22DataCollectionSelector_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_22DataCollectionSelector_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_17EllipsoidSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17EllipsoidSelector_2_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17EllipsoidSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17EllipsoidSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_12GridSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_12GridSelector_2select_grids(struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *__pyx_v_self, PyArrayObject *__pyx_v_left_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_right_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_12GridSelector_4fill_mask(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *__pyx_v_self, PyObject *__pyx_v_gobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_12GridSelector_6_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_12GridSelector_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_12GridSelector_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_20OctreeSubsetSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_2select_grids(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_left_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_right_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_4_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_9domain_id___get__(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_9domain_id_2__set__(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_2select_grids(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_left_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_right_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_4_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_14AlwaysSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14AlwaysSelector_2select_grids(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_v_self, PyArrayObject *__pyx_v_left_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_right_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14AlwaysSelector_4_hash_vals(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14AlwaysSelector_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14AlwaysSelector_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_15ComposeSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dobj, PyObject *__pyx_v_selector1, PyObject *__pyx_v_selector2); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15ComposeSelector_2select_grids(struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *__pyx_v_self, PyArrayObject *__pyx_v_left_edges, PyArrayObject *__pyx_v_right_edges, PyArrayObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15ComposeSelector_4_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15ComposeSelector_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15ComposeSelector_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_21HaloParticlesSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_21HaloParticlesSelector_2_hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_21HaloParticlesSelector_11base_source___get__(struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *__pyx_v_self); /* proto */ @@ -4885,7 +5527,42 @@ static int __pyx_pf_2yt_8geometry_18selection_routines_21HaloParticlesSelector_11base_source_4__del__(struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_21HaloParticlesSelector_7halo_id___get__(struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_8geometry_18selection_routines_21HaloParticlesSelector_7halo_id_2__set__(struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_21HaloParticlesSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_21HaloParticlesSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_4points_in_cells(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_cx, __Pyx_memviewslice __pyx_v_cy, __Pyx_memviewslice __pyx_v_cz, __Pyx_memviewslice __pyx_v_dx, __Pyx_memviewslice __pyx_v_dy, __Pyx_memviewslice __pyx_v_dz, __Pyx_memviewslice __pyx_v_px, __Pyx_memviewslice __pyx_v_py, __Pyx_memviewslice __pyx_v_pz); /* proto */ +static int __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1___get__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self); /* proto */ +static int __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_2__set__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_4__del__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2___get__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self); /* proto */ +static int __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_2__set__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_4__del__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanANDSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanANDSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanANDSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17BooleanORSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17BooleanORSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17BooleanORSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanNOTSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanNOTSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanNOTSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanXORSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanXORSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanXORSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanNEGSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanNEGSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanNEGSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_2yt_8geometry_18selection_routines_22ChainedBooleanSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self, CYTHON_UNUSED 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 */ @@ -4895,8 +5572,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -4918,11 +5599,17 @@ 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_2yt_8geometry_18selection_routines_SelectorObject(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_AlwaysSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_OctreeSubsetSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_BooleanSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_PointSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_SphereSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_RegionSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -4938,6 +5625,14 @@ static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_ComposeSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_HaloParticlesSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_BooleanANDSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_BooleanORSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_BooleanNOTSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_BooleanXORSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_BooleanNEGSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_ChainedBooleanSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_ChainedBooleanORSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines___pyx_scope_struct____init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -4948,18 +5643,15 @@ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_3; +static PyObject *__pyx_int_5; static PyObject *__pyx_int_99; +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__6; static PyObject *__pyx_tuple__8; -static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__53; -static PyObject *__pyx_slice__54; -static PyObject *__pyx_slice__55; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -5003,163 +5695,98 @@ static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__55; static PyObject *__pyx_tuple__56; static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__58; static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__64; static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__66; static PyObject *__pyx_tuple__67; static PyObject *__pyx_tuple__68; static PyObject *__pyx_tuple__69; static PyObject *__pyx_tuple__70; static PyObject *__pyx_tuple__71; -static PyObject *__pyx_codeobj__58; -static PyObject *__pyx_codeobj__60; -static PyObject *__pyx_codeobj__62; -static PyObject *__pyx_codeobj__64; -static PyObject *__pyx_codeobj__66; - -/* "yt/geometry/selection_routines.pyx":47 - * grid_eps = 0.0 - * - * cdef np.int64_t fnv_hash(unsigned char[:] octets): # <<<<<<<<<<<<<< - * # https://bitbucket.org/yt_analysis/yt/issues/1052/field-access-tests-fail-under-python3 - * # FNV hash cf. http://www.isthe.com/chongo/tech/comp/fnv/index.html - */ - -static __pyx_t_5numpy_int64_t __pyx_f_2yt_8geometry_18selection_routines_fnv_hash(__Pyx_memviewslice __pyx_v_octets) { - __pyx_t_5numpy_int64_t __pyx_v_hash_val; - char __pyx_v_octet; - __pyx_t_5numpy_int64_t __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); - char __pyx_t_5; - __Pyx_RefNannySetupContext("fnv_hash", 0); - - /* "yt/geometry/selection_routines.pyx":50 - * # https://bitbucket.org/yt_analysis/yt/issues/1052/field-access-tests-fail-under-python3 - * # FNV hash cf. http://www.isthe.com/chongo/tech/comp/fnv/index.html - * cdef np.int64_t hash_val = 2166136261 # <<<<<<<<<<<<<< - * cdef char octet - * for octet in octets: - */ - __pyx_v_hash_val = 0x811C9DC5; - - /* "yt/geometry/selection_routines.pyx":52 - * cdef np.int64_t hash_val = 2166136261 - * cdef char octet - * for octet in octets: # <<<<<<<<<<<<<< - * hash_val = hash_val ^ octet - * hash_val = hash_val * 16777619 - */ - __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_octets, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_char, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_char, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __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(0, 52, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 52, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 52, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 52, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __pyx_t_5 = __Pyx_PyInt_As_char(__pyx_t_1); if (unlikely((__pyx_t_5 == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_octet = __pyx_t_5; - - /* "yt/geometry/selection_routines.pyx":53 - * cdef char octet - * for octet in octets: - * hash_val = hash_val ^ octet # <<<<<<<<<<<<<< - * hash_val = hash_val * 16777619 - * return hash_val - */ - __pyx_v_hash_val = (__pyx_v_hash_val ^ __pyx_v_octet); - - /* "yt/geometry/selection_routines.pyx":54 - * for octet in octets: - * hash_val = hash_val ^ octet - * hash_val = hash_val * 16777619 # <<<<<<<<<<<<<< - * return hash_val - * - */ - __pyx_v_hash_val = (__pyx_v_hash_val * 0x1000193); - - /* "yt/geometry/selection_routines.pyx":52 - * cdef np.int64_t hash_val = 2166136261 - * cdef char octet - * for octet in octets: # <<<<<<<<<<<<<< - * hash_val = hash_val ^ octet - * hash_val = hash_val * 16777619 - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "yt/geometry/selection_routines.pyx":55 - * hash_val = hash_val ^ octet - * hash_val = hash_val * 16777619 - * return hash_val # <<<<<<<<<<<<<< - * - * # These routines are separated into a couple different categories: - */ - __pyx_r = __pyx_v_hash_val; - goto __pyx_L0; - - /* "yt/geometry/selection_routines.pyx":47 - * grid_eps = 0.0 - * - * cdef np.int64_t fnv_hash(unsigned char[:] octets): # <<<<<<<<<<<<<< - * # https://bitbucket.org/yt_analysis/yt/issues/1052/field-access-tests-fail-under-python3 - * # FNV hash cf. http://www.isthe.com/chongo/tech/comp/fnv/index.html - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_WriteUnraisable("yt.geometry.selection_routines.fnv_hash", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__74; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__76; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__89; +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__91; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__93; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__96; +static PyObject *__pyx_tuple__97; +static PyObject *__pyx_tuple__98; +static PyObject *__pyx_tuple__99; +static PyObject *__pyx_slice__120; +static PyObject *__pyx_slice__121; +static PyObject *__pyx_slice__122; +static PyObject *__pyx_tuple__100; +static PyObject *__pyx_tuple__101; +static PyObject *__pyx_tuple__102; +static PyObject *__pyx_tuple__103; +static PyObject *__pyx_tuple__104; +static PyObject *__pyx_tuple__105; +static PyObject *__pyx_tuple__106; +static PyObject *__pyx_tuple__107; +static PyObject *__pyx_tuple__108; +static PyObject *__pyx_tuple__109; +static PyObject *__pyx_tuple__110; +static PyObject *__pyx_tuple__111; +static PyObject *__pyx_tuple__112; +static PyObject *__pyx_tuple__113; +static PyObject *__pyx_tuple__114; +static PyObject *__pyx_tuple__115; +static PyObject *__pyx_tuple__116; +static PyObject *__pyx_tuple__117; +static PyObject *__pyx_tuple__118; +static PyObject *__pyx_tuple__119; +static PyObject *__pyx_tuple__123; +static PyObject *__pyx_tuple__124; +static PyObject *__pyx_tuple__125; +static PyObject *__pyx_tuple__126; +static PyObject *__pyx_tuple__128; +static PyObject *__pyx_tuple__130; +static PyObject *__pyx_tuple__132; +static PyObject *__pyx_tuple__134; +static PyObject *__pyx_tuple__136; +static PyObject *__pyx_tuple__137; +static PyObject *__pyx_tuple__138; +static PyObject *__pyx_tuple__139; +static PyObject *__pyx_tuple__140; +static PyObject *__pyx_tuple__141; +static PyObject *__pyx_codeobj__127; +static PyObject *__pyx_codeobj__129; +static PyObject *__pyx_codeobj__131; +static PyObject *__pyx_codeobj__133; +static PyObject *__pyx_codeobj__135; +static PyObject *__pyx_codeobj__142; -/* "yt/geometry/selection_routines.pyx":71 +/* "yt/geometry/selection_routines.pyx":63 * @cython.wraparound(False) * @cython.cdivision(True) * def convert_mask_to_indices(np.ndarray[np.uint8_t, ndim=3, cast=True] mask, # <<<<<<<<<<<<<< @@ -5185,8 +5812,11 @@ 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; } @@ -5195,11 +5825,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_count)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("convert_mask_to_indices", 0, 2, 3, 1); __PYX_ERR(0, 71, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("convert_mask_to_indices", 0, 2, 3, 1); __PYX_ERR(0, 63, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transpose); @@ -5207,11 +5839,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert_mask_to_indices") < 0)) __PYX_ERR(0, 71, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert_mask_to_indices") < 0)) __PYX_ERR(0, 63, __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; @@ -5219,22 +5852,22 @@ } } __pyx_v_mask = ((PyArrayObject *)values[0]); - __pyx_v_count = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) + __pyx_v_count = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L3_error) if (values[2]) { - __pyx_v_transpose = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transpose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) + __pyx_v_transpose = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transpose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L3_error) } else { __pyx_v_transpose = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("convert_mask_to_indices", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 71, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("convert_mask_to_indices", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.convert_mask_to_indices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 71, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_convert_mask_to_indices(__pyx_self, __pyx_v_mask, __pyx_v_count, __pyx_v_transpose); /* function exit code */ @@ -5299,25 +5932,25 @@ __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 71, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 63, __pyx_L1_error) } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; - /* "yt/geometry/selection_routines.pyx":75 + /* "yt/geometry/selection_routines.pyx":67 * cdef int i, j, k, cpos * cdef np.ndarray[np.int64_t, ndim=2] indices * indices = np.zeros((count, 3), dtype='int64') # <<<<<<<<<<<<<< * cpos = 0 * for i in range(mask.shape[0]): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __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, 75, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __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_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -5325,20 +5958,20 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 75, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 75, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5354,13 +5987,13 @@ } } __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indices.diminfo[1].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indices.diminfo[1].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 75, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 67, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_indices = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":76 + /* "yt/geometry/selection_routines.pyx":68 * cdef np.ndarray[np.int64_t, ndim=2] indices * indices = np.zeros((count, 3), dtype='int64') * cpos = 0 # <<<<<<<<<<<<<< @@ -5369,7 +6002,7 @@ */ __pyx_v_cpos = 0; - /* "yt/geometry/selection_routines.pyx":77 + /* "yt/geometry/selection_routines.pyx":69 * indices = np.zeros((count, 3), dtype='int64') * cpos = 0 * for i in range(mask.shape[0]): # <<<<<<<<<<<<<< @@ -5380,7 +6013,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_10; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":78 + /* "yt/geometry/selection_routines.pyx":70 * cpos = 0 * for i in range(mask.shape[0]): * for j in range(mask.shape[1]): # <<<<<<<<<<<<<< @@ -5391,7 +6024,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_j = __pyx_t_12; - /* "yt/geometry/selection_routines.pyx":79 + /* "yt/geometry/selection_routines.pyx":71 * for i in range(mask.shape[0]): * for j in range(mask.shape[1]): * for k in range(mask.shape[2]): # <<<<<<<<<<<<<< @@ -5402,7 +6035,7 @@ for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_k = __pyx_t_14; - /* "yt/geometry/selection_routines.pyx":80 + /* "yt/geometry/selection_routines.pyx":72 * for j in range(mask.shape[1]): * for k in range(mask.shape[2]): * if mask[i, j, k] == 1: # <<<<<<<<<<<<<< @@ -5415,7 +6048,7 @@ __pyx_t_18 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_mask.diminfo[2].strides)) == 1) != 0); if (__pyx_t_18) { - /* "yt/geometry/selection_routines.pyx":81 + /* "yt/geometry/selection_routines.pyx":73 * for k in range(mask.shape[2]): * if mask[i, j, k] == 1: * if transpose == 1: # <<<<<<<<<<<<<< @@ -5425,7 +6058,7 @@ __pyx_t_18 = ((__pyx_v_transpose == 1) != 0); if (__pyx_t_18) { - /* "yt/geometry/selection_routines.pyx":82 + /* "yt/geometry/selection_routines.pyx":74 * if mask[i, j, k] == 1: * if transpose == 1: * indices[cpos, 0] = k # <<<<<<<<<<<<<< @@ -5436,7 +6069,7 @@ __pyx_t_20 = 0; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_indices.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_indices.diminfo[1].strides) = __pyx_v_k; - /* "yt/geometry/selection_routines.pyx":83 + /* "yt/geometry/selection_routines.pyx":75 * if transpose == 1: * indices[cpos, 0] = k * indices[cpos, 1] = j # <<<<<<<<<<<<<< @@ -5447,7 +6080,7 @@ __pyx_t_22 = 1; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_indices.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_indices.diminfo[1].strides) = __pyx_v_j; - /* "yt/geometry/selection_routines.pyx":84 + /* "yt/geometry/selection_routines.pyx":76 * indices[cpos, 0] = k * indices[cpos, 1] = j * indices[cpos, 2] = i # <<<<<<<<<<<<<< @@ -5458,7 +6091,7 @@ __pyx_t_24 = 2; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_indices.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_indices.diminfo[1].strides) = __pyx_v_i; - /* "yt/geometry/selection_routines.pyx":81 + /* "yt/geometry/selection_routines.pyx":73 * for k in range(mask.shape[2]): * if mask[i, j, k] == 1: * if transpose == 1: # <<<<<<<<<<<<<< @@ -5468,7 +6101,7 @@ goto __pyx_L10; } - /* "yt/geometry/selection_routines.pyx":86 + /* "yt/geometry/selection_routines.pyx":78 * indices[cpos, 2] = i * else: * indices[cpos, 0] = i # <<<<<<<<<<<<<< @@ -5480,7 +6113,7 @@ __pyx_t_26 = 0; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indices.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_indices.diminfo[1].strides) = __pyx_v_i; - /* "yt/geometry/selection_routines.pyx":87 + /* "yt/geometry/selection_routines.pyx":79 * else: * indices[cpos, 0] = i * indices[cpos, 1] = j # <<<<<<<<<<<<<< @@ -5491,7 +6124,7 @@ __pyx_t_28 = 1; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indices.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_indices.diminfo[1].strides) = __pyx_v_j; - /* "yt/geometry/selection_routines.pyx":88 + /* "yt/geometry/selection_routines.pyx":80 * indices[cpos, 0] = i * indices[cpos, 1] = j * indices[cpos, 2] = k # <<<<<<<<<<<<<< @@ -5504,7 +6137,7 @@ } __pyx_L10:; - /* "yt/geometry/selection_routines.pyx":89 + /* "yt/geometry/selection_routines.pyx":81 * indices[cpos, 1] = j * indices[cpos, 2] = k * cpos += 1 # <<<<<<<<<<<<<< @@ -5513,7 +6146,7 @@ */ __pyx_v_cpos = (__pyx_v_cpos + 1); - /* "yt/geometry/selection_routines.pyx":80 + /* "yt/geometry/selection_routines.pyx":72 * for j in range(mask.shape[1]): * for k in range(mask.shape[2]): * if mask[i, j, k] == 1: # <<<<<<<<<<<<<< @@ -5525,7 +6158,7 @@ } } - /* "yt/geometry/selection_routines.pyx":90 + /* "yt/geometry/selection_routines.pyx":82 * indices[cpos, 2] = k * cpos += 1 * return indices # <<<<<<<<<<<<<< @@ -5537,7 +6170,7 @@ __pyx_r = ((PyObject *)__pyx_v_indices); goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":71 + /* "yt/geometry/selection_routines.pyx":63 * @cython.wraparound(False) * @cython.cdivision(True) * def convert_mask_to_indices(np.ndarray[np.uint8_t, ndim=3, cast=True] mask, # <<<<<<<<<<<<<< @@ -5571,7 +6204,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":96 +/* "yt/geometry/selection_routines.pyx":88 * @cython.wraparound(False) * @cython.cdivision(True) * cdef _mask_fill(np.ndarray[np.float64_t, ndim=1] out, # <<<<<<<<<<<<<< @@ -5622,30 +6255,30 @@ __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 88, __pyx_L1_error) } __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 88, __pyx_L1_error) } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 88, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vals.diminfo[1].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vals.diminfo[1].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_vals.diminfo[2].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_vals.diminfo[2].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[2]; - /* "yt/geometry/selection_routines.pyx":100 + /* "yt/geometry/selection_routines.pyx":92 * np.ndarray[np.uint8_t, ndim=3, cast=True] mask, - * np.ndarray[anyfloat, ndim=3] vals): + * np.ndarray[floating, ndim=3] vals): * cdef np.int64_t count = 0 # <<<<<<<<<<<<<< * cdef int i, j, k * for i in range(mask.shape[0]): */ __pyx_v_count = 0; - /* "yt/geometry/selection_routines.pyx":102 + /* "yt/geometry/selection_routines.pyx":94 * cdef np.int64_t count = 0 * cdef int i, j, k * for i in range(mask.shape[0]): # <<<<<<<<<<<<<< @@ -5656,7 +6289,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":103 + /* "yt/geometry/selection_routines.pyx":95 * cdef int i, j, k * for i in range(mask.shape[0]): * for j in range(mask.shape[1]): # <<<<<<<<<<<<<< @@ -5667,7 +6300,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":104 + /* "yt/geometry/selection_routines.pyx":96 * for i in range(mask.shape[0]): * for j in range(mask.shape[1]): * for k in range(mask.shape[2]): # <<<<<<<<<<<<<< @@ -5678,7 +6311,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":105 + /* "yt/geometry/selection_routines.pyx":97 * for j in range(mask.shape[1]): * for k in range(mask.shape[2]): * if mask[i, j, k] == 1: # <<<<<<<<<<<<<< @@ -5691,7 +6324,7 @@ __pyx_t_10 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_9, __pyx_pybuffernd_mask.diminfo[2].strides)) == 1) != 0); if (__pyx_t_10) { - /* "yt/geometry/selection_routines.pyx":106 + /* "yt/geometry/selection_routines.pyx":98 * for k in range(mask.shape[2]): * if mask[i, j, k] == 1: * out[offset + count] = vals[i, j, k] # <<<<<<<<<<<<<< @@ -5702,9 +6335,9 @@ __pyx_t_12 = __pyx_v_j; __pyx_t_13 = __pyx_v_k; __pyx_t_14 = (__pyx_v_offset + __pyx_v_count); - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_vals.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_vals.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_vals.diminfo[2].strides)); + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(float *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_vals.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_vals.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_vals.diminfo[2].strides)); - /* "yt/geometry/selection_routines.pyx":107 + /* "yt/geometry/selection_routines.pyx":99 * if mask[i, j, k] == 1: * out[offset + count] = vals[i, j, k] * count += 1 # <<<<<<<<<<<<<< @@ -5713,7 +6346,7 @@ */ __pyx_v_count = (__pyx_v_count + 1); - /* "yt/geometry/selection_routines.pyx":105 + /* "yt/geometry/selection_routines.pyx":97 * for j in range(mask.shape[1]): * for k in range(mask.shape[2]): * if mask[i, j, k] == 1: # <<<<<<<<<<<<<< @@ -5725,7 +6358,7 @@ } } - /* "yt/geometry/selection_routines.pyx":108 + /* "yt/geometry/selection_routines.pyx":100 * out[offset + count] = vals[i, j, k] * count += 1 * return count # <<<<<<<<<<<<<< @@ -5733,13 +6366,13 @@ * def mask_fill(np.ndarray[np.float64_t, ndim=1] out, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_15 = __Pyx_PyInt_From_npy_int64(__pyx_v_count); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyInt_From_npy_int64(__pyx_v_count); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_r = __pyx_t_15; __pyx_t_15 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":96 + /* "yt/geometry/selection_routines.pyx":88 * @cython.wraparound(False) * @cython.cdivision(True) * cdef _mask_fill(np.ndarray[np.float64_t, ndim=1] out, # <<<<<<<<<<<<<< @@ -5814,30 +6447,30 @@ __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 88, __pyx_L1_error) } __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 88, __pyx_L1_error) } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 88, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vals.diminfo[1].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vals.diminfo[1].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_vals.diminfo[2].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_vals.diminfo[2].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[2]; - /* "yt/geometry/selection_routines.pyx":100 + /* "yt/geometry/selection_routines.pyx":92 * np.ndarray[np.uint8_t, ndim=3, cast=True] mask, - * np.ndarray[anyfloat, ndim=3] vals): + * np.ndarray[floating, ndim=3] vals): * cdef np.int64_t count = 0 # <<<<<<<<<<<<<< * cdef int i, j, k * for i in range(mask.shape[0]): */ __pyx_v_count = 0; - /* "yt/geometry/selection_routines.pyx":102 + /* "yt/geometry/selection_routines.pyx":94 * cdef np.int64_t count = 0 * cdef int i, j, k * for i in range(mask.shape[0]): # <<<<<<<<<<<<<< @@ -5848,7 +6481,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":103 + /* "yt/geometry/selection_routines.pyx":95 * cdef int i, j, k * for i in range(mask.shape[0]): * for j in range(mask.shape[1]): # <<<<<<<<<<<<<< @@ -5859,7 +6492,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":104 + /* "yt/geometry/selection_routines.pyx":96 * for i in range(mask.shape[0]): * for j in range(mask.shape[1]): * for k in range(mask.shape[2]): # <<<<<<<<<<<<<< @@ -5870,7 +6503,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":105 + /* "yt/geometry/selection_routines.pyx":97 * for j in range(mask.shape[1]): * for k in range(mask.shape[2]): * if mask[i, j, k] == 1: # <<<<<<<<<<<<<< @@ -5883,7 +6516,7 @@ __pyx_t_10 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_9, __pyx_pybuffernd_mask.diminfo[2].strides)) == 1) != 0); if (__pyx_t_10) { - /* "yt/geometry/selection_routines.pyx":106 + /* "yt/geometry/selection_routines.pyx":98 * for k in range(mask.shape[2]): * if mask[i, j, k] == 1: * out[offset + count] = vals[i, j, k] # <<<<<<<<<<<<<< @@ -5894,9 +6527,9 @@ __pyx_t_12 = __pyx_v_j; __pyx_t_13 = __pyx_v_k; __pyx_t_14 = (__pyx_v_offset + __pyx_v_count); - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_vals.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_vals.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_vals.diminfo[2].strides)); + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(double *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_vals.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_vals.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_vals.diminfo[2].strides)); - /* "yt/geometry/selection_routines.pyx":107 + /* "yt/geometry/selection_routines.pyx":99 * if mask[i, j, k] == 1: * out[offset + count] = vals[i, j, k] * count += 1 # <<<<<<<<<<<<<< @@ -5905,7 +6538,7 @@ */ __pyx_v_count = (__pyx_v_count + 1); - /* "yt/geometry/selection_routines.pyx":105 + /* "yt/geometry/selection_routines.pyx":97 * for j in range(mask.shape[1]): * for k in range(mask.shape[2]): * if mask[i, j, k] == 1: # <<<<<<<<<<<<<< @@ -5917,7 +6550,7 @@ } } - /* "yt/geometry/selection_routines.pyx":108 + /* "yt/geometry/selection_routines.pyx":100 * out[offset + count] = vals[i, j, k] * count += 1 * return count # <<<<<<<<<<<<<< @@ -5925,13 +6558,13 @@ * def mask_fill(np.ndarray[np.float64_t, ndim=1] out, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_15 = __Pyx_PyInt_From_npy_int64(__pyx_v_count); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyInt_From_npy_int64(__pyx_v_count); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_r = __pyx_t_15; __pyx_t_15 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":96 + /* "yt/geometry/selection_routines.pyx":88 * @cython.wraparound(False) * @cython.cdivision(True) * cdef _mask_fill(np.ndarray[np.float64_t, ndim=1] out, # <<<<<<<<<<<<<< @@ -5963,7 +6596,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":110 +/* "yt/geometry/selection_routines.pyx":102 * return count * * def mask_fill(np.ndarray[np.float64_t, ndim=1] out, # <<<<<<<<<<<<<< @@ -5990,9 +6623,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -6001,24 +6638,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("mask_fill", 1, 4, 4, 1); __PYX_ERR(0, 110, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mask_fill", 1, 4, 4, 1); __PYX_ERR(0, 102, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("mask_fill", 1, 4, 4, 2); __PYX_ERR(0, 110, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mask_fill", 1, 4, 4, 2); __PYX_ERR(0, 102, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("mask_fill", 1, 4, 4, 3); __PYX_ERR(0, 110, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mask_fill", 1, 4, 4, 3); __PYX_ERR(0, 102, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mask_fill") < 0)) __PYX_ERR(0, 110, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mask_fill") < 0)) __PYX_ERR(0, 102, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -6029,21 +6669,21 @@ values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_out = ((PyArrayObject *)values[0]); - __pyx_v_offset = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_offset == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_offset == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error) __pyx_v_mask = ((PyArrayObject *)values[2]); __pyx_v_vals = ((PyArrayObject *)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("mask_fill", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 110, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mask_fill", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.mask_fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 110, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 112, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 113, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 102, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 104, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 105, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_2mask_fill(__pyx_self, __pyx_v_out, __pyx_v_offset, __pyx_v_mask, __pyx_v_vals); /* function exit code */ @@ -6077,37 +6717,37 @@ __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 102, __pyx_L1_error) } __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 102, __pyx_L1_error) } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; - /* "yt/geometry/selection_routines.pyx":114 + /* "yt/geometry/selection_routines.pyx":106 * np.ndarray[np.uint8_t, ndim=3, cast=True] mask, * np.ndarray vals): * if vals.dtype == np.float32: # <<<<<<<<<<<<<< * return _mask_fill[np.float32_t](out, offset, mask, vals) * elif vals.dtype == np.float64: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __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, 114, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":115 + /* "yt/geometry/selection_routines.pyx":107 * np.ndarray vals): * if vals.dtype == np.float32: * return _mask_fill[np.float32_t](out, offset, mask, vals) # <<<<<<<<<<<<<< @@ -6115,13 +6755,13 @@ * return _mask_fill[np.float64_t](out, offset, mask, vals) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_fuse_0__pyx_f_2yt_8geometry_18selection_routines__mask_fill(((PyArrayObject *)__pyx_v_out), __pyx_v_offset, ((PyArrayObject *)__pyx_v_mask), ((PyArrayObject *)__pyx_v_vals)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_2 = __pyx_fuse_0__pyx_f_2yt_8geometry_18selection_routines__mask_fill(((PyArrayObject *)__pyx_v_out), __pyx_v_offset, ((PyArrayObject *)__pyx_v_mask), ((PyArrayObject *)__pyx_v_vals)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":114 + /* "yt/geometry/selection_routines.pyx":106 * np.ndarray[np.uint8_t, ndim=3, cast=True] mask, * np.ndarray vals): * if vals.dtype == np.float32: # <<<<<<<<<<<<<< @@ -6130,28 +6770,28 @@ */ } - /* "yt/geometry/selection_routines.pyx":116 + /* "yt/geometry/selection_routines.pyx":108 * if vals.dtype == np.float32: * return _mask_fill[np.float32_t](out, offset, mask, vals) * elif vals.dtype == np.float64: # <<<<<<<<<<<<<< * return _mask_fill[np.float64_t](out, offset, mask, vals) * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __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, 116, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":117 + /* "yt/geometry/selection_routines.pyx":109 * return _mask_fill[np.float32_t](out, offset, mask, vals) * elif vals.dtype == np.float64: * return _mask_fill[np.float64_t](out, offset, mask, vals) # <<<<<<<<<<<<<< @@ -6159,13 +6799,13 @@ * raise RuntimeError */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_fuse_1__pyx_f_2yt_8geometry_18selection_routines__mask_fill(((PyArrayObject *)__pyx_v_out), __pyx_v_offset, ((PyArrayObject *)__pyx_v_mask), ((PyArrayObject *)__pyx_v_vals)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_3 = __pyx_fuse_1__pyx_f_2yt_8geometry_18selection_routines__mask_fill(((PyArrayObject *)__pyx_v_out), __pyx_v_offset, ((PyArrayObject *)__pyx_v_mask), ((PyArrayObject *)__pyx_v_vals)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":116 + /* "yt/geometry/selection_routines.pyx":108 * if vals.dtype == np.float32: * return _mask_fill[np.float32_t](out, offset, mask, vals) * elif vals.dtype == np.float64: # <<<<<<<<<<<<<< @@ -6174,7 +6814,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":119 + /* "yt/geometry/selection_routines.pyx":111 * return _mask_fill[np.float64_t](out, offset, mask, vals) * else: * raise RuntimeError # <<<<<<<<<<<<<< @@ -6183,10 +6823,10 @@ */ /*else*/ { __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 119, __pyx_L1_error) + __PYX_ERR(0, 111, __pyx_L1_error) } - /* "yt/geometry/selection_routines.pyx":110 + /* "yt/geometry/selection_routines.pyx":102 * return count * * def mask_fill(np.ndarray[np.float64_t, ndim=1] out, # <<<<<<<<<<<<<< @@ -6218,7 +6858,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":123 +/* "yt/geometry/selection_routines.pyx":115 * cdef class SelectorObject: * * def __cinit__(self, dobj, *args): # <<<<<<<<<<<<<< @@ -6253,6 +6893,7 @@ switch (pos_args) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); @@ -6263,7 +6904,7 @@ } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 123, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 115, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; @@ -6274,7 +6915,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 123, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -6308,7 +6949,7 @@ Py_ssize_t __pyx_t_10; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "yt/geometry/selection_routines.pyx":124 + /* "yt/geometry/selection_routines.pyx":116 * * def __cinit__(self, dobj, *args): * self._hash_initialized = 0 # <<<<<<<<<<<<<< @@ -6317,33 +6958,33 @@ */ __pyx_v_self->_hash_initialized = 0; - /* "yt/geometry/selection_routines.pyx":127 + /* "yt/geometry/selection_routines.pyx":119 * cdef np.float64_t [:] DLE * cdef np.float64_t [:] DRE * self.min_level = getattr(dobj, "min_level", 0) # <<<<<<<<<<<<<< * self.max_level = getattr(dobj, "max_level", 99) * self.overlap_cells = 0 */ - __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_dobj, __pyx_n_s_min_level, __pyx_int_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_dobj, __pyx_n_s_min_level, __pyx_int_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->min_level = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":128 + /* "yt/geometry/selection_routines.pyx":120 * cdef np.float64_t [:] DRE * self.min_level = getattr(dobj, "min_level", 0) * self.max_level = getattr(dobj, "max_level", 99) # <<<<<<<<<<<<<< * self.overlap_cells = 0 * */ - __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_dobj, __pyx_n_s_max_level, __pyx_int_99); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_dobj, __pyx_n_s_max_level, __pyx_int_99); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->max_level = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":129 + /* "yt/geometry/selection_routines.pyx":121 * self.min_level = getattr(dobj, "min_level", 0) * self.max_level = getattr(dobj, "max_level", 99) * self.overlap_cells = 0 # <<<<<<<<<<<<<< @@ -6352,19 +6993,19 @@ */ __pyx_v_self->overlap_cells = 0; - /* "yt/geometry/selection_routines.pyx":131 + /* "yt/geometry/selection_routines.pyx":123 * self.overlap_cells = 0 * * ds = getattr(dobj, 'ds', None) # <<<<<<<<<<<<<< * if ds is None: * for i in range(3): */ - __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_dobj, __pyx_n_s_ds, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_dobj, __pyx_n_s_ds, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ds = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":132 + /* "yt/geometry/selection_routines.pyx":124 * * ds = getattr(dobj, 'ds', None) * if ds is None: # <<<<<<<<<<<<<< @@ -6375,7 +7016,7 @@ __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":133 + /* "yt/geometry/selection_routines.pyx":125 * ds = getattr(dobj, 'ds', None) * if ds is None: * for i in range(3): # <<<<<<<<<<<<<< @@ -6385,7 +7026,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < 3; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "yt/geometry/selection_routines.pyx":135 + /* "yt/geometry/selection_routines.pyx":127 * for i in range(3): * # NOTE that this is not universal. * self.domain_width[i] = 1.0 # <<<<<<<<<<<<<< @@ -6394,7 +7035,7 @@ */ (__pyx_v_self->domain_width[__pyx_v_i]) = 1.0; - /* "yt/geometry/selection_routines.pyx":136 + /* "yt/geometry/selection_routines.pyx":128 * # NOTE that this is not universal. * self.domain_width[i] = 1.0 * self.periodicity[i] = False # <<<<<<<<<<<<<< @@ -6404,7 +7045,7 @@ (__pyx_v_self->periodicity[__pyx_v_i]) = 0; } - /* "yt/geometry/selection_routines.pyx":132 + /* "yt/geometry/selection_routines.pyx":124 * * ds = getattr(dobj, 'ds', None) * if ds is None: # <<<<<<<<<<<<<< @@ -6414,7 +7055,7 @@ goto __pyx_L3; } - /* "yt/geometry/selection_routines.pyx":138 + /* "yt/geometry/selection_routines.pyx":130 * self.periodicity[i] = False * else: * DLE = _ensure_code(ds.domain_left_edge) # <<<<<<<<<<<<<< @@ -6422,38 +7063,38 @@ * for i in range(3): */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ds, __pyx_n_s_domain_left_edge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ds, __pyx_n_s_domain_left_edge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_6 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_6); - if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 138, __pyx_L1_error) + if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_DLE = __pyx_t_7; __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL; - /* "yt/geometry/selection_routines.pyx":139 + /* "yt/geometry/selection_routines.pyx":131 * else: * DLE = _ensure_code(ds.domain_left_edge) * DRE = _ensure_code(ds.domain_right_edge) # <<<<<<<<<<<<<< * for i in range(3): * self.domain_width[i] = DRE[i] - DLE[i] */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ds, __pyx_n_s_domain_right_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ds, __pyx_n_s_domain_right_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_DRE = __pyx_t_7; __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL; - /* "yt/geometry/selection_routines.pyx":140 + /* "yt/geometry/selection_routines.pyx":132 * DLE = _ensure_code(ds.domain_left_edge) * DRE = _ensure_code(ds.domain_right_edge) * for i in range(3): # <<<<<<<<<<<<<< @@ -6463,7 +7104,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < 3; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "yt/geometry/selection_routines.pyx":141 + /* "yt/geometry/selection_routines.pyx":133 * DRE = _ensure_code(ds.domain_right_edge) * for i in range(3): * self.domain_width[i] = DRE[i] - DLE[i] # <<<<<<<<<<<<<< @@ -6478,7 +7119,7 @@ } else if (unlikely(__pyx_t_8 >= __pyx_v_DRE.shape[0])) __pyx_t_9 = 0; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 141, __pyx_L1_error) + __PYX_ERR(0, 133, __pyx_L1_error) } __pyx_t_10 = __pyx_v_i; __pyx_t_9 = -1; @@ -6488,30 +7129,30 @@ } else if (unlikely(__pyx_t_10 >= __pyx_v_DLE.shape[0])) __pyx_t_9 = 0; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 141, __pyx_L1_error) + __PYX_ERR(0, 133, __pyx_L1_error) } (__pyx_v_self->domain_width[__pyx_v_i]) = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_DRE.data + __pyx_t_8 * __pyx_v_DRE.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_DLE.data + __pyx_t_10 * __pyx_v_DLE.strides[0]) )))); - /* "yt/geometry/selection_routines.pyx":142 + /* "yt/geometry/selection_routines.pyx":134 * for i in range(3): * self.domain_width[i] = DRE[i] - DLE[i] * self.periodicity[i] = ds.periodicity[i] # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ds, __pyx_n_s_periodicity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ds, __pyx_n_s_periodicity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (__pyx_v_self->periodicity[__pyx_v_i]) = __pyx_t_4; } } __pyx_L3:; - /* "yt/geometry/selection_routines.pyx":123 + /* "yt/geometry/selection_routines.pyx":115 * cdef class SelectorObject: * * def __cinit__(self, dobj, *args): # <<<<<<<<<<<<<< @@ -6536,7 +7177,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":147 +/* "yt/geometry/selection_routines.pyx":139 * @cython.wraparound(False) * @cython.cdivision(True) * def select_grids(self, # <<<<<<<<<<<<<< @@ -6561,8 +7202,11 @@ 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; } @@ -6571,19 +7215,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 147, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 139, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); __PYX_ERR(0, 147, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); __PYX_ERR(0, 139, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) __PYX_ERR(0, 147, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) __PYX_ERR(0, 139, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -6598,15 +7244,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 147, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 139, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.select_grids", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 148, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 149, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 150, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 142, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_2select_grids(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_levels); /* function exit code */ @@ -6669,21 +7315,21 @@ __pyx_pybuffernd_levels.rcbuffer = &__pyx_pybuffer_levels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 147, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 147, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 147, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error) } __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_levels.diminfo[1].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_levels.diminfo[1].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[1]; - /* "yt/geometry/selection_routines.pyx":152 + /* "yt/geometry/selection_routines.pyx":144 * np.ndarray[np.int32_t, ndim=2] levels): * cdef int i, n * cdef int ng = left_edges.shape[0] # <<<<<<<<<<<<<< @@ -6692,40 +7338,40 @@ */ __pyx_v_ng = (__pyx_v_left_edges->dimensions[0]); - /* "yt/geometry/selection_routines.pyx":153 + /* "yt/geometry/selection_routines.pyx":145 * cdef int i, n * cdef int ng = left_edges.shape[0] * cdef np.ndarray[np.uint8_t, ndim=1] gridi = np.zeros(ng, dtype='uint8') # <<<<<<<<<<<<<< * cdef np.float64_t LE[3] * cdef np.float64_t RE[3] */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __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, 153, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __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_ng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __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_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, 153, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gridi.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_gridi = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_gridi.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 153, __pyx_L1_error) + __PYX_ERR(0, 145, __pyx_L1_error) } else {__pyx_pybuffernd_gridi.diminfo[0].strides = __pyx_pybuffernd_gridi.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gridi.diminfo[0].shape = __pyx_pybuffernd_gridi.rcbuffer->pybuffer.shape[0]; } } @@ -6733,29 +7379,29 @@ __pyx_v_gridi = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":156 + /* "yt/geometry/selection_routines.pyx":148 * cdef np.float64_t LE[3] * cdef np.float64_t RE[3] * _ensure_code(left_edges) # <<<<<<<<<<<<<< * _ensure_code(right_edges) * with nogil: */ - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_left_edges)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_left_edges)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":157 + /* "yt/geometry/selection_routines.pyx":149 * cdef np.float64_t RE[3] * _ensure_code(left_edges) * _ensure_code(right_edges) # <<<<<<<<<<<<<< * with nogil: * for n in range(ng): */ - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_right_edges)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_right_edges)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":158 + /* "yt/geometry/selection_routines.pyx":150 * _ensure_code(left_edges) * _ensure_code(right_edges) * with nogil: # <<<<<<<<<<<<<< @@ -6766,10 +7412,11 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/geometry/selection_routines.pyx":159 + /* "yt/geometry/selection_routines.pyx":151 * _ensure_code(right_edges) * with nogil: * for n in range(ng): # <<<<<<<<<<<<<< @@ -6780,7 +7427,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_n = __pyx_t_7; - /* "yt/geometry/selection_routines.pyx":162 + /* "yt/geometry/selection_routines.pyx":154 * # Call our selector function * # Check if the sphere is inside the grid * for i in range(3): # <<<<<<<<<<<<<< @@ -6790,7 +7437,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < 3; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "yt/geometry/selection_routines.pyx":163 + /* "yt/geometry/selection_routines.pyx":155 * # Check if the sphere is inside the grid * for i in range(3): * LE[i] = left_edges[n, i] # <<<<<<<<<<<<<< @@ -6801,7 +7448,7 @@ __pyx_t_10 = __pyx_v_i; (__pyx_v_LE[__pyx_v_i]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_left_edges.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_left_edges.diminfo[1].strides)); - /* "yt/geometry/selection_routines.pyx":164 + /* "yt/geometry/selection_routines.pyx":156 * for i in range(3): * LE[i] = left_edges[n, i] * RE[i] = right_edges[n, i] # <<<<<<<<<<<<<< @@ -6813,7 +7460,7 @@ (__pyx_v_RE[__pyx_v_i]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_right_edges.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_right_edges.diminfo[1].strides)); } - /* "yt/geometry/selection_routines.pyx":165 + /* "yt/geometry/selection_routines.pyx":157 * LE[i] = left_edges[n, i] * RE[i] = right_edges[n, i] * gridi[n] = self.select_grid(LE, RE, levels[n, 0]) # <<<<<<<<<<<<<< @@ -6827,7 +7474,7 @@ } } - /* "yt/geometry/selection_routines.pyx":158 + /* "yt/geometry/selection_routines.pyx":150 * _ensure_code(left_edges) * _ensure_code(right_edges) * with nogil: # <<<<<<<<<<<<<< @@ -6837,6 +7484,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; @@ -6845,7 +7493,7 @@ } } - /* "yt/geometry/selection_routines.pyx":166 + /* "yt/geometry/selection_routines.pyx":158 * RE[i] = right_edges[n, i] * gridi[n] = self.select_grid(LE, RE, levels[n, 0]) * return gridi.astype("bool") # <<<<<<<<<<<<<< @@ -6853,16 +7501,16 @@ * def count_octs(self, OctreeContainer octree, int domain_id = -1): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_gridi), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_gridi), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":147 + /* "yt/geometry/selection_routines.pyx":139 * @cython.wraparound(False) * @cython.cdivision(True) * def select_grids(self, # <<<<<<<<<<<<<< @@ -6900,7 +7548,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":168 +/* "yt/geometry/selection_routines.pyx":160 * return gridi.astype("bool") * * def count_octs(self, OctreeContainer octree, int domain_id = -1): # <<<<<<<<<<<<<< @@ -6924,7 +7572,9 @@ 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; } @@ -6933,6 +7583,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_octree)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -6940,11 +7591,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_octs") < 0)) __PYX_ERR(0, 168, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_octs") < 0)) __PYX_ERR(0, 160, __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; @@ -6952,20 +7604,20 @@ } __pyx_v_octree = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)values[0]); if (values[1]) { - __pyx_v_domain_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L3_error) + __pyx_v_domain_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L3_error) } else { __pyx_v_domain_id = ((int)-1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("count_octs", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("count_octs", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 160, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.count_octs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "octree", 0))) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "octree", 0))) __PYX_ERR(0, 160, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_4count_octs(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_octree, __pyx_v_domain_id); /* function exit code */ @@ -6985,16 +7637,16 @@ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("count_octs", 0); - /* "yt/geometry/selection_routines.pyx":170 + /* "yt/geometry/selection_routines.pyx":162 * def count_octs(self, OctreeContainer octree, int domain_id = -1): * cdef oct_visitors.CountTotalOcts visitor * visitor = oct_visitors.CountTotalOcts(octree, domain_id) # <<<<<<<<<<<<<< * octree.visit_all_octs(self, visitor) * return visitor.index */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_octree)); __Pyx_GIVEREF(((PyObject *)__pyx_v_octree)); @@ -7002,13 +7654,13 @@ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":171 + /* "yt/geometry/selection_routines.pyx":163 * cdef oct_visitors.CountTotalOcts visitor * visitor = oct_visitors.CountTotalOcts(octree, domain_id) * octree.visit_all_octs(self, visitor) # <<<<<<<<<<<<<< @@ -7017,7 +7669,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_octree->__pyx_vtab)->visit_all_octs(__pyx_v_octree, __pyx_v_self, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL); - /* "yt/geometry/selection_routines.pyx":172 + /* "yt/geometry/selection_routines.pyx":164 * visitor = oct_visitors.CountTotalOcts(octree, domain_id) * octree.visit_all_octs(self, visitor) * return visitor.index # <<<<<<<<<<<<<< @@ -7025,13 +7677,13 @@ * def count_oct_cells(self, OctreeContainer octree, int domain_id = -1): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_v_visitor->__pyx_base.index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_v_visitor->__pyx_base.index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":168 + /* "yt/geometry/selection_routines.pyx":160 * return gridi.astype("bool") * * def count_octs(self, OctreeContainer octree, int domain_id = -1): # <<<<<<<<<<<<<< @@ -7052,7 +7704,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":174 +/* "yt/geometry/selection_routines.pyx":166 * return visitor.index * * def count_oct_cells(self, OctreeContainer octree, int domain_id = -1): # <<<<<<<<<<<<<< @@ -7076,7 +7728,9 @@ 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; } @@ -7085,6 +7739,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_octree)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id); @@ -7092,11 +7747,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_oct_cells") < 0)) __PYX_ERR(0, 174, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_oct_cells") < 0)) __PYX_ERR(0, 166, __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; @@ -7104,20 +7760,20 @@ } __pyx_v_octree = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)values[0]); if (values[1]) { - __pyx_v_domain_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) + __pyx_v_domain_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error) } else { __pyx_v_domain_id = ((int)-1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("count_oct_cells", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 174, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("count_oct_cells", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 166, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.count_oct_cells", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "octree", 0))) __PYX_ERR(0, 174, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_octree), __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, 1, "octree", 0))) __PYX_ERR(0, 166, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_6count_oct_cells(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_octree, __pyx_v_domain_id); /* function exit code */ @@ -7137,16 +7793,16 @@ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("count_oct_cells", 0); - /* "yt/geometry/selection_routines.pyx":176 + /* "yt/geometry/selection_routines.pyx":168 * def count_oct_cells(self, OctreeContainer octree, int domain_id = -1): * cdef oct_visitors.CountTotalCells visitor * visitor = oct_visitors.CountTotalCells(octree, domain_id) # <<<<<<<<<<<<<< * octree.visit_all_octs(self, visitor) * return visitor.index */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_octree)); __Pyx_GIVEREF(((PyObject *)__pyx_v_octree)); @@ -7154,13 +7810,13 @@ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":177 + /* "yt/geometry/selection_routines.pyx":169 * cdef oct_visitors.CountTotalCells visitor * visitor = oct_visitors.CountTotalCells(octree, domain_id) * octree.visit_all_octs(self, visitor) # <<<<<<<<<<<<<< @@ -7169,7 +7825,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_octree->__pyx_vtab)->visit_all_octs(__pyx_v_octree, __pyx_v_self, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL); - /* "yt/geometry/selection_routines.pyx":178 + /* "yt/geometry/selection_routines.pyx":170 * visitor = oct_visitors.CountTotalCells(octree, domain_id) * octree.visit_all_octs(self, visitor) * return visitor.index # <<<<<<<<<<<<<< @@ -7177,13 +7833,13 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_v_visitor->__pyx_base.index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_v_visitor->__pyx_base.index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":174 + /* "yt/geometry/selection_routines.pyx":166 * return visitor.index * * def count_oct_cells(self, OctreeContainer octree, int domain_id = -1): # <<<<<<<<<<<<<< @@ -7204,7 +7860,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":183 +/* "yt/geometry/selection_routines.pyx":175 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -7243,7 +7899,7 @@ } } - /* "yt/geometry/selection_routines.pyx":200 + /* "yt/geometry/selection_routines.pyx":192 * # Remember that pos is the *center* of the oct, and dds is the oct * # width. So to get to the edges, we add/subtract half of dds. * for i in range(3): # <<<<<<<<<<<<<< @@ -7253,7 +7909,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":202 + /* "yt/geometry/selection_routines.pyx":194 * for i in range(3): * # sdds is the cell width * sdds[i] = dds[i]/2.0 # <<<<<<<<<<<<<< @@ -7262,7 +7918,7 @@ */ (__pyx_v_sdds[__pyx_v_i]) = ((__pyx_v_dds[__pyx_v_i]) / 2.0); - /* "yt/geometry/selection_routines.pyx":203 + /* "yt/geometry/selection_routines.pyx":195 * # sdds is the cell width * sdds[i] = dds[i]/2.0 * LE[i] = pos[i] - dds[i]/2.0 # <<<<<<<<<<<<<< @@ -7271,7 +7927,7 @@ */ (__pyx_v_LE[__pyx_v_i]) = ((__pyx_v_pos[__pyx_v_i]) - ((__pyx_v_dds[__pyx_v_i]) / 2.0)); - /* "yt/geometry/selection_routines.pyx":204 + /* "yt/geometry/selection_routines.pyx":196 * sdds[i] = dds[i]/2.0 * LE[i] = pos[i] - dds[i]/2.0 * RE[i] = pos[i] + dds[i]/2.0 # <<<<<<<<<<<<<< @@ -7281,7 +7937,7 @@ (__pyx_v_RE[__pyx_v_i]) = ((__pyx_v_pos[__pyx_v_i]) + ((__pyx_v_dds[__pyx_v_i]) / 2.0)); } - /* "yt/geometry/selection_routines.pyx":206 + /* "yt/geometry/selection_routines.pyx":198 * RE[i] = pos[i] + dds[i]/2.0 * #print LE[0], RE[0], LE[1], RE[1], LE[2], RE[2] * res = self.select_grid(LE, RE, level, root) # <<<<<<<<<<<<<< @@ -7293,7 +7949,7 @@ __pyx_t_1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_grid(__pyx_v_self, __pyx_v_LE, __pyx_v_RE, __pyx_v_level, &__pyx_t_2); __pyx_v_res = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":207 + /* "yt/geometry/selection_routines.pyx":199 * #print LE[0], RE[0], LE[1], RE[1], LE[2], RE[2] * res = self.select_grid(LE, RE, level, root) * if res == 1 and visitor.domain > 0 and root.domain != visitor.domain: # <<<<<<<<<<<<<< @@ -7317,7 +7973,7 @@ __pyx_L6_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/selection_routines.pyx":208 + /* "yt/geometry/selection_routines.pyx":200 * res = self.select_grid(LE, RE, level, root) * if res == 1 and visitor.domain > 0 and root.domain != visitor.domain: * res = -1 # <<<<<<<<<<<<<< @@ -7326,7 +7982,7 @@ */ __pyx_v_res = -1; - /* "yt/geometry/selection_routines.pyx":207 + /* "yt/geometry/selection_routines.pyx":199 * #print LE[0], RE[0], LE[1], RE[1], LE[2], RE[2] * res = self.select_grid(LE, RE, level, root) * if res == 1 and visitor.domain > 0 and root.domain != visitor.domain: # <<<<<<<<<<<<<< @@ -7335,7 +7991,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":209 + /* "yt/geometry/selection_routines.pyx":201 * if res == 1 and visitor.domain > 0 and root.domain != visitor.domain: * res = -1 * cdef int increment = 1 # <<<<<<<<<<<<<< @@ -7344,7 +8000,7 @@ */ __pyx_v_increment = 1; - /* "yt/geometry/selection_routines.pyx":214 + /* "yt/geometry/selection_routines.pyx":206 * # this_level: an int that says whether or not we can select from this * # level * next_level = this_level = 1 # <<<<<<<<<<<<<< @@ -7354,7 +8010,7 @@ __pyx_v_next_level = 1; __pyx_v_this_level = 1; - /* "yt/geometry/selection_routines.pyx":215 + /* "yt/geometry/selection_routines.pyx":207 * # level * next_level = this_level = 1 * if res == -1: # <<<<<<<<<<<<<< @@ -7364,7 +8020,7 @@ __pyx_t_3 = ((__pyx_v_res == -1L) != 0); if (__pyx_t_3) { - /* "yt/geometry/selection_routines.pyx":219 + /* "yt/geometry/selection_routines.pyx":211 * # children. This would allow an oct to pass to its children but * # not get accessed itself. * next_level = 1 # <<<<<<<<<<<<<< @@ -7373,7 +8029,7 @@ */ __pyx_v_next_level = 1; - /* "yt/geometry/selection_routines.pyx":220 + /* "yt/geometry/selection_routines.pyx":212 * # not get accessed itself. * next_level = 1 * this_level = 0 # <<<<<<<<<<<<<< @@ -7382,7 +8038,7 @@ */ __pyx_v_this_level = 0; - /* "yt/geometry/selection_routines.pyx":215 + /* "yt/geometry/selection_routines.pyx":207 * # level * next_level = this_level = 1 * if res == -1: # <<<<<<<<<<<<<< @@ -7392,7 +8048,7 @@ goto __pyx_L9; } - /* "yt/geometry/selection_routines.pyx":221 + /* "yt/geometry/selection_routines.pyx":213 * next_level = 1 * this_level = 0 * elif level == self.max_level: # <<<<<<<<<<<<<< @@ -7402,7 +8058,7 @@ __pyx_t_3 = ((__pyx_v_level == __pyx_v_self->max_level) != 0); if (__pyx_t_3) { - /* "yt/geometry/selection_routines.pyx":222 + /* "yt/geometry/selection_routines.pyx":214 * this_level = 0 * elif level == self.max_level: * next_level = 0 # <<<<<<<<<<<<<< @@ -7411,7 +8067,7 @@ */ __pyx_v_next_level = 0; - /* "yt/geometry/selection_routines.pyx":221 + /* "yt/geometry/selection_routines.pyx":213 * next_level = 1 * this_level = 0 * elif level == self.max_level: # <<<<<<<<<<<<<< @@ -7421,7 +8077,7 @@ goto __pyx_L9; } - /* "yt/geometry/selection_routines.pyx":223 + /* "yt/geometry/selection_routines.pyx":215 * elif level == self.max_level: * next_level = 0 * elif level < self.min_level or level > self.max_level: # <<<<<<<<<<<<<< @@ -7439,7 +8095,7 @@ __pyx_L10_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/selection_routines.pyx":224 + /* "yt/geometry/selection_routines.pyx":216 * next_level = 0 * elif level < self.min_level or level > self.max_level: * this_level = 0 # <<<<<<<<<<<<<< @@ -7448,7 +8104,7 @@ */ __pyx_v_this_level = 0; - /* "yt/geometry/selection_routines.pyx":223 + /* "yt/geometry/selection_routines.pyx":215 * elif level == self.max_level: * next_level = 0 * elif level < self.min_level or level > self.max_level: # <<<<<<<<<<<<<< @@ -7458,7 +8114,7 @@ } __pyx_L9:; - /* "yt/geometry/selection_routines.pyx":225 + /* "yt/geometry/selection_routines.pyx":217 * elif level < self.min_level or level > self.max_level: * this_level = 0 * if res == 0 and this_level == 1: # <<<<<<<<<<<<<< @@ -7476,7 +8132,7 @@ __pyx_L13_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/selection_routines.pyx":226 + /* "yt/geometry/selection_routines.pyx":218 * this_level = 0 * if res == 0 and this_level == 1: * return # <<<<<<<<<<<<<< @@ -7485,7 +8141,7 @@ */ goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":225 + /* "yt/geometry/selection_routines.pyx":217 * elif level < self.min_level or level > self.max_level: * this_level = 0 * if res == 0 and this_level == 1: # <<<<<<<<<<<<<< @@ -7494,7 +8150,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":229 + /* "yt/geometry/selection_routines.pyx":221 * # Now we visit all our children. We subtract off sdds for the first * # pass because we center it on the first cell. * cdef int iter = 1 - visit_covered # 2 if 1, 1 if 0. # <<<<<<<<<<<<<< @@ -7503,7 +8159,7 @@ */ __pyx_v_iter = (1 - __pyx_v_visit_covered); - /* "yt/geometry/selection_routines.pyx":236 + /* "yt/geometry/selection_routines.pyx":228 * # visit potentially covered cells. The next time through, we visit * # child cells. * while iter < 2: # <<<<<<<<<<<<<< @@ -7514,7 +8170,7 @@ __pyx_t_3 = ((__pyx_v_iter < 2) != 0); if (!__pyx_t_3) break; - /* "yt/geometry/selection_routines.pyx":237 + /* "yt/geometry/selection_routines.pyx":229 * # child cells. * while iter < 2: * spos[0] = pos[0] - sdds[0]/2.0 # <<<<<<<<<<<<<< @@ -7523,7 +8179,7 @@ */ (__pyx_v_spos[0]) = ((__pyx_v_pos[0]) - ((__pyx_v_sdds[0]) / 2.0)); - /* "yt/geometry/selection_routines.pyx":238 + /* "yt/geometry/selection_routines.pyx":230 * while iter < 2: * spos[0] = pos[0] - sdds[0]/2.0 * for i in range(2): # <<<<<<<<<<<<<< @@ -7533,7 +8189,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":239 + /* "yt/geometry/selection_routines.pyx":231 * spos[0] = pos[0] - sdds[0]/2.0 * for i in range(2): * spos[1] = pos[1] - sdds[1]/2.0 # <<<<<<<<<<<<<< @@ -7542,7 +8198,7 @@ */ (__pyx_v_spos[1]) = ((__pyx_v_pos[1]) - ((__pyx_v_sdds[1]) / 2.0)); - /* "yt/geometry/selection_routines.pyx":240 + /* "yt/geometry/selection_routines.pyx":232 * for i in range(2): * spos[1] = pos[1] - sdds[1]/2.0 * for j in range(2): # <<<<<<<<<<<<<< @@ -7552,7 +8208,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < 2; __pyx_t_5+=1) { __pyx_v_j = __pyx_t_5; - /* "yt/geometry/selection_routines.pyx":241 + /* "yt/geometry/selection_routines.pyx":233 * spos[1] = pos[1] - sdds[1]/2.0 * for j in range(2): * spos[2] = pos[2] - sdds[2]/2.0 # <<<<<<<<<<<<<< @@ -7561,7 +8217,7 @@ */ (__pyx_v_spos[2]) = ((__pyx_v_pos[2]) - ((__pyx_v_sdds[2]) / 2.0)); - /* "yt/geometry/selection_routines.pyx":242 + /* "yt/geometry/selection_routines.pyx":234 * for j in range(2): * spos[2] = pos[2] - sdds[2]/2.0 * for k in range(2): # <<<<<<<<<<<<<< @@ -7571,7 +8227,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 2; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":243 + /* "yt/geometry/selection_routines.pyx":235 * spos[2] = pos[2] - sdds[2]/2.0 * for k in range(2): * ch = NULL # <<<<<<<<<<<<<< @@ -7580,7 +8236,7 @@ */ __pyx_v_ch = NULL; - /* "yt/geometry/selection_routines.pyx":246 + /* "yt/geometry/selection_routines.pyx":238 * # We only supply a child if we are actually going to * # look at the next level. * if root.children != NULL and next_level == 1: # <<<<<<<<<<<<<< @@ -7598,7 +8254,7 @@ __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/selection_routines.pyx":247 + /* "yt/geometry/selection_routines.pyx":239 * # look at the next level. * if root.children != NULL and next_level == 1: * ch = root.children[cind(i, j, k)] # <<<<<<<<<<<<<< @@ -7607,7 +8263,7 @@ */ __pyx_v_ch = (__pyx_v_root->children[__pyx_f_2yt_8geometry_12oct_visitors_cind(__pyx_v_i, __pyx_v_j, __pyx_v_k)]); - /* "yt/geometry/selection_routines.pyx":246 + /* "yt/geometry/selection_routines.pyx":238 * # We only supply a child if we are actually going to * # look at the next level. * if root.children != NULL and next_level == 1: # <<<<<<<<<<<<<< @@ -7616,7 +8272,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":248 + /* "yt/geometry/selection_routines.pyx":240 * if root.children != NULL and next_level == 1: * ch = root.children[cind(i, j, k)] * if iter == 1 and next_level == 1 and ch != NULL: # <<<<<<<<<<<<<< @@ -7640,7 +8296,7 @@ __pyx_L27_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/selection_routines.pyx":253 + /* "yt/geometry/selection_routines.pyx":245 * # to be the same as the position of the cell under * # investigation. * visitor.pos[0] = (visitor.pos[0] << 1) + i # <<<<<<<<<<<<<< @@ -7649,7 +8305,7 @@ */ (__pyx_v_visitor->pos[0]) = (((__pyx_v_visitor->pos[0]) << 1) + __pyx_v_i); - /* "yt/geometry/selection_routines.pyx":254 + /* "yt/geometry/selection_routines.pyx":246 * # investigation. * visitor.pos[0] = (visitor.pos[0] << 1) + i * visitor.pos[1] = (visitor.pos[1] << 1) + j # <<<<<<<<<<<<<< @@ -7658,7 +8314,7 @@ */ (__pyx_v_visitor->pos[1]) = (((__pyx_v_visitor->pos[1]) << 1) + __pyx_v_j); - /* "yt/geometry/selection_routines.pyx":255 + /* "yt/geometry/selection_routines.pyx":247 * visitor.pos[0] = (visitor.pos[0] << 1) + i * visitor.pos[1] = (visitor.pos[1] << 1) + j * visitor.pos[2] = (visitor.pos[2] << 1) + k # <<<<<<<<<<<<<< @@ -7667,7 +8323,7 @@ */ (__pyx_v_visitor->pos[2]) = (((__pyx_v_visitor->pos[2]) << 1) + __pyx_v_k); - /* "yt/geometry/selection_routines.pyx":256 + /* "yt/geometry/selection_routines.pyx":248 * visitor.pos[1] = (visitor.pos[1] << 1) + j * visitor.pos[2] = (visitor.pos[2] << 1) + k * visitor.level += 1 # <<<<<<<<<<<<<< @@ -7676,7 +8332,7 @@ */ __pyx_v_visitor->level = (__pyx_v_visitor->level + 1); - /* "yt/geometry/selection_routines.pyx":257 + /* "yt/geometry/selection_routines.pyx":249 * visitor.pos[2] = (visitor.pos[2] << 1) + k * visitor.level += 1 * self.recursively_visit_octs( # <<<<<<<<<<<<<< @@ -7687,7 +8343,7 @@ __pyx_t_7.visit_covered = __pyx_v_visit_covered; ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->recursively_visit_octs(__pyx_v_self, __pyx_v_ch, __pyx_v_spos, __pyx_v_sdds, (__pyx_v_level + 1), __pyx_v_visitor, &__pyx_t_7); - /* "yt/geometry/selection_routines.pyx":260 + /* "yt/geometry/selection_routines.pyx":252 * ch, spos, sdds, level + 1, visitor, * visit_covered) * visitor.pos[0] = (visitor.pos[0] >> 1) # <<<<<<<<<<<<<< @@ -7696,7 +8352,7 @@ */ (__pyx_v_visitor->pos[0]) = ((__pyx_v_visitor->pos[0]) >> 1); - /* "yt/geometry/selection_routines.pyx":261 + /* "yt/geometry/selection_routines.pyx":253 * visit_covered) * visitor.pos[0] = (visitor.pos[0] >> 1) * visitor.pos[1] = (visitor.pos[1] >> 1) # <<<<<<<<<<<<<< @@ -7705,7 +8361,7 @@ */ (__pyx_v_visitor->pos[1]) = ((__pyx_v_visitor->pos[1]) >> 1); - /* "yt/geometry/selection_routines.pyx":262 + /* "yt/geometry/selection_routines.pyx":254 * visitor.pos[0] = (visitor.pos[0] >> 1) * visitor.pos[1] = (visitor.pos[1] >> 1) * visitor.pos[2] = (visitor.pos[2] >> 1) # <<<<<<<<<<<<<< @@ -7714,7 +8370,7 @@ */ (__pyx_v_visitor->pos[2]) = ((__pyx_v_visitor->pos[2]) >> 1); - /* "yt/geometry/selection_routines.pyx":263 + /* "yt/geometry/selection_routines.pyx":255 * visitor.pos[1] = (visitor.pos[1] >> 1) * visitor.pos[2] = (visitor.pos[2] >> 1) * visitor.level -= 1 # <<<<<<<<<<<<<< @@ -7723,7 +8379,7 @@ */ __pyx_v_visitor->level = (__pyx_v_visitor->level - 1); - /* "yt/geometry/selection_routines.pyx":248 + /* "yt/geometry/selection_routines.pyx":240 * if root.children != NULL and next_level == 1: * ch = root.children[cind(i, j, k)] * if iter == 1 and next_level == 1 and ch != NULL: # <<<<<<<<<<<<<< @@ -7733,7 +8389,7 @@ goto __pyx_L26; } - /* "yt/geometry/selection_routines.pyx":264 + /* "yt/geometry/selection_routines.pyx":256 * visitor.pos[2] = (visitor.pos[2] >> 1) * visitor.level -= 1 * elif this_level == 1 and visitor.oref > 0: # <<<<<<<<<<<<<< @@ -7751,7 +8407,7 @@ __pyx_L30_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/selection_routines.pyx":265 + /* "yt/geometry/selection_routines.pyx":257 * visitor.level -= 1 * elif this_level == 1 and visitor.oref > 0: * visitor.global_index += increment # <<<<<<<<<<<<<< @@ -7760,7 +8416,7 @@ */ __pyx_v_visitor->global_index = (__pyx_v_visitor->global_index + __pyx_v_increment); - /* "yt/geometry/selection_routines.pyx":266 + /* "yt/geometry/selection_routines.pyx":258 * elif this_level == 1 and visitor.oref > 0: * visitor.global_index += increment * increment = 0 # <<<<<<<<<<<<<< @@ -7769,7 +8425,7 @@ */ __pyx_v_increment = 0; - /* "yt/geometry/selection_routines.pyx":267 + /* "yt/geometry/selection_routines.pyx":259 * visitor.global_index += increment * increment = 0 * self.visit_oct_cells(root, ch, spos, sdds, # <<<<<<<<<<<<<< @@ -7778,7 +8434,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->visit_oct_cells(__pyx_v_self, __pyx_v_root, __pyx_v_ch, __pyx_v_spos, __pyx_v_sdds, __pyx_v_visitor, __pyx_v_i, __pyx_v_j, __pyx_v_k); - /* "yt/geometry/selection_routines.pyx":264 + /* "yt/geometry/selection_routines.pyx":256 * visitor.pos[2] = (visitor.pos[2] >> 1) * visitor.level -= 1 * elif this_level == 1 and visitor.oref > 0: # <<<<<<<<<<<<<< @@ -7788,7 +8444,7 @@ goto __pyx_L26; } - /* "yt/geometry/selection_routines.pyx":269 + /* "yt/geometry/selection_routines.pyx":261 * self.visit_oct_cells(root, ch, spos, sdds, * visitor, i, j, k) * elif this_level == 1 and increment == 1: # <<<<<<<<<<<<<< @@ -7806,7 +8462,7 @@ __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/selection_routines.pyx":270 + /* "yt/geometry/selection_routines.pyx":262 * visitor, i, j, k) * elif this_level == 1 and increment == 1: * visitor.global_index += increment # <<<<<<<<<<<<<< @@ -7815,7 +8471,7 @@ */ __pyx_v_visitor->global_index = (__pyx_v_visitor->global_index + __pyx_v_increment); - /* "yt/geometry/selection_routines.pyx":271 + /* "yt/geometry/selection_routines.pyx":263 * elif this_level == 1 and increment == 1: * visitor.global_index += increment * increment = 0 # <<<<<<<<<<<<<< @@ -7824,7 +8480,7 @@ */ __pyx_v_increment = 0; - /* "yt/geometry/selection_routines.pyx":272 + /* "yt/geometry/selection_routines.pyx":264 * visitor.global_index += increment * increment = 0 * visitor.ind[0] = visitor.ind[1] = visitor.ind[2] = 0 # <<<<<<<<<<<<<< @@ -7835,7 +8491,7 @@ (__pyx_v_visitor->ind[1]) = 0; (__pyx_v_visitor->ind[2]) = 0; - /* "yt/geometry/selection_routines.pyx":273 + /* "yt/geometry/selection_routines.pyx":265 * increment = 0 * visitor.ind[0] = visitor.ind[1] = visitor.ind[2] = 0 * visitor.visit(root, 1) # <<<<<<<<<<<<<< @@ -7844,7 +8500,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor->__pyx_vtab)->visit(__pyx_v_visitor, __pyx_v_root, 1); - /* "yt/geometry/selection_routines.pyx":269 + /* "yt/geometry/selection_routines.pyx":261 * self.visit_oct_cells(root, ch, spos, sdds, * visitor, i, j, k) * elif this_level == 1 and increment == 1: # <<<<<<<<<<<<<< @@ -7854,7 +8510,7 @@ } __pyx_L26:; - /* "yt/geometry/selection_routines.pyx":274 + /* "yt/geometry/selection_routines.pyx":266 * visitor.ind[0] = visitor.ind[1] = visitor.ind[2] = 0 * visitor.visit(root, 1) * spos[2] += sdds[2] # <<<<<<<<<<<<<< @@ -7865,7 +8521,7 @@ (__pyx_v_spos[__pyx_t_8]) = ((__pyx_v_spos[__pyx_t_8]) + (__pyx_v_sdds[2])); } - /* "yt/geometry/selection_routines.pyx":275 + /* "yt/geometry/selection_routines.pyx":267 * visitor.visit(root, 1) * spos[2] += sdds[2] * spos[1] += sdds[1] # <<<<<<<<<<<<<< @@ -7876,7 +8532,7 @@ (__pyx_v_spos[__pyx_t_8]) = ((__pyx_v_spos[__pyx_t_8]) + (__pyx_v_sdds[1])); } - /* "yt/geometry/selection_routines.pyx":276 + /* "yt/geometry/selection_routines.pyx":268 * spos[2] += sdds[2] * spos[1] += sdds[1] * spos[0] += sdds[0] # <<<<<<<<<<<<<< @@ -7887,7 +8543,7 @@ (__pyx_v_spos[__pyx_t_8]) = ((__pyx_v_spos[__pyx_t_8]) + (__pyx_v_sdds[0])); } - /* "yt/geometry/selection_routines.pyx":277 + /* "yt/geometry/selection_routines.pyx":269 * spos[1] += sdds[1] * spos[0] += sdds[0] * this_level = 0 # We turn this off for the second pass. # <<<<<<<<<<<<<< @@ -7896,7 +8552,7 @@ */ __pyx_v_this_level = 0; - /* "yt/geometry/selection_routines.pyx":278 + /* "yt/geometry/selection_routines.pyx":270 * spos[0] += sdds[0] * this_level = 0 # We turn this off for the second pass. * iter += 1 # <<<<<<<<<<<<<< @@ -7906,7 +8562,7 @@ __pyx_v_iter = (__pyx_v_iter + 1); } - /* "yt/geometry/selection_routines.pyx":183 + /* "yt/geometry/selection_routines.pyx":175 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -7919,7 +8575,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/selection_routines.pyx":280 +/* "yt/geometry/selection_routines.pyx":272 * iter += 1 * * cdef void visit_oct_cells(self, Oct *root, Oct *ch, # <<<<<<<<<<<<<< @@ -7946,7 +8602,7 @@ long __pyx_t_8; __Pyx_RefNannySetupContext("visit_oct_cells", 0); - /* "yt/geometry/selection_routines.pyx":286 + /* "yt/geometry/selection_routines.pyx":278 * # This saves us some funny-business. * cdef int selected * if visitor.oref == 1: # <<<<<<<<<<<<<< @@ -7956,7 +8612,7 @@ __pyx_t_1 = ((__pyx_v_visitor->oref == 1) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":287 + /* "yt/geometry/selection_routines.pyx":279 * cdef int selected * if visitor.oref == 1: * selected = self.select_cell(spos, sdds) # <<<<<<<<<<<<<< @@ -7965,7 +8621,7 @@ */ __pyx_v_selected = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_cell(__pyx_v_self, __pyx_v_spos, __pyx_v_sdds); - /* "yt/geometry/selection_routines.pyx":288 + /* "yt/geometry/selection_routines.pyx":280 * if visitor.oref == 1: * selected = self.select_cell(spos, sdds) * if ch != NULL: # <<<<<<<<<<<<<< @@ -7975,7 +8631,7 @@ __pyx_t_1 = ((__pyx_v_ch != NULL) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":289 + /* "yt/geometry/selection_routines.pyx":281 * selected = self.select_cell(spos, sdds) * if ch != NULL: * selected *= self.overlap_cells # <<<<<<<<<<<<<< @@ -7984,7 +8640,7 @@ */ __pyx_v_selected = (__pyx_v_selected * __pyx_v_self->overlap_cells); - /* "yt/geometry/selection_routines.pyx":288 + /* "yt/geometry/selection_routines.pyx":280 * if visitor.oref == 1: * selected = self.select_cell(spos, sdds) * if ch != NULL: # <<<<<<<<<<<<<< @@ -7993,7 +8649,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":291 + /* "yt/geometry/selection_routines.pyx":283 * selected *= self.overlap_cells * # visitor.ind refers to the cell, not to the oct. * visitor.ind[0] = i # <<<<<<<<<<<<<< @@ -8002,7 +8658,7 @@ */ (__pyx_v_visitor->ind[0]) = __pyx_v_i; - /* "yt/geometry/selection_routines.pyx":292 + /* "yt/geometry/selection_routines.pyx":284 * # visitor.ind refers to the cell, not to the oct. * visitor.ind[0] = i * visitor.ind[1] = j # <<<<<<<<<<<<<< @@ -8011,7 +8667,7 @@ */ (__pyx_v_visitor->ind[1]) = __pyx_v_j; - /* "yt/geometry/selection_routines.pyx":293 + /* "yt/geometry/selection_routines.pyx":285 * visitor.ind[0] = i * visitor.ind[1] = j * visitor.ind[2] = k # <<<<<<<<<<<<<< @@ -8020,7 +8676,7 @@ */ (__pyx_v_visitor->ind[2]) = __pyx_v_k; - /* "yt/geometry/selection_routines.pyx":294 + /* "yt/geometry/selection_routines.pyx":286 * visitor.ind[1] = j * visitor.ind[2] = k * visitor.visit(root, selected) # <<<<<<<<<<<<<< @@ -8029,7 +8685,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor->__pyx_vtab)->visit(__pyx_v_visitor, __pyx_v_root, __pyx_v_selected); - /* "yt/geometry/selection_routines.pyx":295 + /* "yt/geometry/selection_routines.pyx":287 * visitor.ind[2] = k * visitor.visit(root, selected) * return # <<<<<<<<<<<<<< @@ -8038,7 +8694,7 @@ */ goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":286 + /* "yt/geometry/selection_routines.pyx":278 * # This saves us some funny-business. * cdef int selected * if visitor.oref == 1: # <<<<<<<<<<<<<< @@ -8047,7 +8703,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":304 + /* "yt/geometry/selection_routines.pyx":296 * cdef np.float64_t pos[3] * cdef int ci, cj, ck * cdef int nr = (1 << (visitor.oref - 1)) # <<<<<<<<<<<<<< @@ -8056,7 +8712,7 @@ */ __pyx_v_nr = (1 << (__pyx_v_visitor->oref - 1)); - /* "yt/geometry/selection_routines.pyx":305 + /* "yt/geometry/selection_routines.pyx":297 * cdef int ci, cj, ck * cdef int nr = (1 << (visitor.oref - 1)) * for ci in range(3): # <<<<<<<<<<<<<< @@ -8066,7 +8722,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_ci = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":306 + /* "yt/geometry/selection_routines.pyx":298 * cdef int nr = (1 << (visitor.oref - 1)) * for ci in range(3): * dds[ci] = sdds[ci] / nr # <<<<<<<<<<<<<< @@ -8075,12 +8731,12 @@ */ if (unlikely(__pyx_v_nr == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 306, __pyx_L1_error) + __PYX_ERR(0, 298, __pyx_L1_error) } (__pyx_v_dds[__pyx_v_ci]) = ((__pyx_v_sdds[__pyx_v_ci]) / __pyx_v_nr); } - /* "yt/geometry/selection_routines.pyx":308 + /* "yt/geometry/selection_routines.pyx":300 * dds[ci] = sdds[ci] / nr * # Boot strap at the first index. * pos[0] = (spos[0] - sdds[0]/2.0) + dds[0] * 0.5 # <<<<<<<<<<<<<< @@ -8089,7 +8745,7 @@ */ (__pyx_v_pos[0]) = (((__pyx_v_spos[0]) - ((__pyx_v_sdds[0]) / 2.0)) + ((__pyx_v_dds[0]) * 0.5)); - /* "yt/geometry/selection_routines.pyx":309 + /* "yt/geometry/selection_routines.pyx":301 * # Boot strap at the first index. * pos[0] = (spos[0] - sdds[0]/2.0) + dds[0] * 0.5 * for ci in range(nr): # <<<<<<<<<<<<<< @@ -8100,7 +8756,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_ci = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":310 + /* "yt/geometry/selection_routines.pyx":302 * pos[0] = (spos[0] - sdds[0]/2.0) + dds[0] * 0.5 * for ci in range(nr): * pos[1] = (spos[1] - sdds[1]/2.0) + dds[1] * 0.5 # <<<<<<<<<<<<<< @@ -8109,7 +8765,7 @@ */ (__pyx_v_pos[1]) = (((__pyx_v_spos[1]) - ((__pyx_v_sdds[1]) / 2.0)) + ((__pyx_v_dds[1]) * 0.5)); - /* "yt/geometry/selection_routines.pyx":311 + /* "yt/geometry/selection_routines.pyx":303 * for ci in range(nr): * pos[1] = (spos[1] - sdds[1]/2.0) + dds[1] * 0.5 * for cj in range(nr): # <<<<<<<<<<<<<< @@ -8120,7 +8776,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_cj = __pyx_t_5; - /* "yt/geometry/selection_routines.pyx":312 + /* "yt/geometry/selection_routines.pyx":304 * pos[1] = (spos[1] - sdds[1]/2.0) + dds[1] * 0.5 * for cj in range(nr): * pos[2] = (spos[2] - sdds[2]/2.0) + dds[2] * 0.5 # <<<<<<<<<<<<<< @@ -8129,7 +8785,7 @@ */ (__pyx_v_pos[2]) = (((__pyx_v_spos[2]) - ((__pyx_v_sdds[2]) / 2.0)) + ((__pyx_v_dds[2]) * 0.5)); - /* "yt/geometry/selection_routines.pyx":313 + /* "yt/geometry/selection_routines.pyx":305 * for cj in range(nr): * pos[2] = (spos[2] - sdds[2]/2.0) + dds[2] * 0.5 * for ck in range(nr): # <<<<<<<<<<<<<< @@ -8140,7 +8796,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_ck = __pyx_t_7; - /* "yt/geometry/selection_routines.pyx":314 + /* "yt/geometry/selection_routines.pyx":306 * pos[2] = (spos[2] - sdds[2]/2.0) + dds[2] * 0.5 * for ck in range(nr): * selected = self.select_cell(pos, dds) # <<<<<<<<<<<<<< @@ -8149,7 +8805,7 @@ */ __pyx_v_selected = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_cell(__pyx_v_self, __pyx_v_pos, __pyx_v_dds); - /* "yt/geometry/selection_routines.pyx":315 + /* "yt/geometry/selection_routines.pyx":307 * for ck in range(nr): * selected = self.select_cell(pos, dds) * if ch != NULL: # <<<<<<<<<<<<<< @@ -8159,7 +8815,7 @@ __pyx_t_1 = ((__pyx_v_ch != NULL) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":316 + /* "yt/geometry/selection_routines.pyx":308 * selected = self.select_cell(pos, dds) * if ch != NULL: * selected *= self.overlap_cells # <<<<<<<<<<<<<< @@ -8168,7 +8824,7 @@ */ __pyx_v_selected = (__pyx_v_selected * __pyx_v_self->overlap_cells); - /* "yt/geometry/selection_routines.pyx":315 + /* "yt/geometry/selection_routines.pyx":307 * for ck in range(nr): * selected = self.select_cell(pos, dds) * if ch != NULL: # <<<<<<<<<<<<<< @@ -8177,7 +8833,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":317 + /* "yt/geometry/selection_routines.pyx":309 * if ch != NULL: * selected *= self.overlap_cells * visitor.ind[0] = ci + i * nr # <<<<<<<<<<<<<< @@ -8186,7 +8842,7 @@ */ (__pyx_v_visitor->ind[0]) = (__pyx_v_ci + (__pyx_v_i * __pyx_v_nr)); - /* "yt/geometry/selection_routines.pyx":318 + /* "yt/geometry/selection_routines.pyx":310 * selected *= self.overlap_cells * visitor.ind[0] = ci + i * nr * visitor.ind[1] = cj + j * nr # <<<<<<<<<<<<<< @@ -8195,7 +8851,7 @@ */ (__pyx_v_visitor->ind[1]) = (__pyx_v_cj + (__pyx_v_j * __pyx_v_nr)); - /* "yt/geometry/selection_routines.pyx":319 + /* "yt/geometry/selection_routines.pyx":311 * visitor.ind[0] = ci + i * nr * visitor.ind[1] = cj + j * nr * visitor.ind[2] = ck + k * nr # <<<<<<<<<<<<<< @@ -8204,7 +8860,7 @@ */ (__pyx_v_visitor->ind[2]) = (__pyx_v_ck + (__pyx_v_k * __pyx_v_nr)); - /* "yt/geometry/selection_routines.pyx":320 + /* "yt/geometry/selection_routines.pyx":312 * visitor.ind[1] = cj + j * nr * visitor.ind[2] = ck + k * nr * visitor.visit(root, selected) # <<<<<<<<<<<<<< @@ -8213,7 +8869,7 @@ */ ((struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor->__pyx_vtab)->visit(__pyx_v_visitor, __pyx_v_root, __pyx_v_selected); - /* "yt/geometry/selection_routines.pyx":321 + /* "yt/geometry/selection_routines.pyx":313 * visitor.ind[2] = ck + k * nr * visitor.visit(root, selected) * pos[2] += dds[2] # <<<<<<<<<<<<<< @@ -8224,7 +8880,7 @@ (__pyx_v_pos[__pyx_t_8]) = ((__pyx_v_pos[__pyx_t_8]) + (__pyx_v_dds[2])); } - /* "yt/geometry/selection_routines.pyx":322 + /* "yt/geometry/selection_routines.pyx":314 * visitor.visit(root, selected) * pos[2] += dds[2] * pos[1] += dds[1] # <<<<<<<<<<<<<< @@ -8235,7 +8891,7 @@ (__pyx_v_pos[__pyx_t_8]) = ((__pyx_v_pos[__pyx_t_8]) + (__pyx_v_dds[1])); } - /* "yt/geometry/selection_routines.pyx":323 + /* "yt/geometry/selection_routines.pyx":315 * pos[2] += dds[2] * pos[1] += dds[1] * pos[0] += dds[0] # <<<<<<<<<<<<<< @@ -8246,7 +8902,7 @@ (__pyx_v_pos[__pyx_t_8]) = ((__pyx_v_pos[__pyx_t_8]) + (__pyx_v_dds[0])); } - /* "yt/geometry/selection_routines.pyx":280 + /* "yt/geometry/selection_routines.pyx":272 * iter += 1 * * cdef void visit_oct_cells(self, Oct *root, Oct *ch, # <<<<<<<<<<<<<< @@ -8257,12 +8913,12 @@ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.geometry.selection_routines.SelectorObject.visit_oct_cells", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.SelectorObject.visit_oct_cells", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/selection_routines.pyx":328 +/* "yt/geometry/selection_routines.pyx":320 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -8277,7 +8933,7 @@ if (__pyx_optional_args) { } - /* "yt/geometry/selection_routines.pyx":331 + /* "yt/geometry/selection_routines.pyx":323 * np.float64_t right_edge[3], * np.int32_t level, Oct *o = NULL) nogil: * if level < self.min_level or level > self.max_level: return 0 # <<<<<<<<<<<<<< @@ -8298,7 +8954,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":332 + /* "yt/geometry/selection_routines.pyx":324 * np.int32_t level, Oct *o = NULL) nogil: * if level < self.min_level or level > self.max_level: return 0 * return self.select_bbox(left_edge, right_edge) # <<<<<<<<<<<<<< @@ -8308,7 +8964,7 @@ __pyx_r = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_bbox(__pyx_v_self, __pyx_v_left_edge, __pyx_v_right_edge); goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":328 + /* "yt/geometry/selection_routines.pyx":320 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -8321,7 +8977,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":334 +/* "yt/geometry/selection_routines.pyx":326 * return self.select_bbox(left_edge, right_edge) * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -8332,7 +8988,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_14SelectorObject_select_cell(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":335 + /* "yt/geometry/selection_routines.pyx":327 * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * return 0 # <<<<<<<<<<<<<< @@ -8342,7 +8998,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":334 + /* "yt/geometry/selection_routines.pyx":326 * return self.select_bbox(left_edge, right_edge) * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -8355,7 +9011,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":337 +/* "yt/geometry/selection_routines.pyx":329 * return 0 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -8366,7 +9022,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_14SelectorObject_select_point(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":338 + /* "yt/geometry/selection_routines.pyx":330 * * cdef int select_point(self, np.float64_t pos[3]) nogil: * return 0 # <<<<<<<<<<<<<< @@ -8376,7 +9032,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":337 + /* "yt/geometry/selection_routines.pyx":329 * return 0 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -8389,7 +9045,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":340 +/* "yt/geometry/selection_routines.pyx":332 * return 0 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -8400,7 +9056,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_14SelectorObject_select_sphere(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_radius) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":341 + /* "yt/geometry/selection_routines.pyx":333 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * return 0 # <<<<<<<<<<<<<< @@ -8410,7 +9066,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":340 + /* "yt/geometry/selection_routines.pyx":332 * return 0 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -8423,7 +9079,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":343 +/* "yt/geometry/selection_routines.pyx":335 * return 0 * * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -8434,7 +9090,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_14SelectorObject_select_bbox(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":345 + /* "yt/geometry/selection_routines.pyx":337 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * return 0 # <<<<<<<<<<<<<< @@ -8444,7 +9100,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":343 + /* "yt/geometry/selection_routines.pyx":335 * return 0 * * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -8457,7 +9113,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":350 +/* "yt/geometry/selection_routines.pyx":342 * @cython.wraparound(False) * @cython.cdivision(True) * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil: # <<<<<<<<<<<<<< @@ -8470,7 +9126,7 @@ __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":353 + /* "yt/geometry/selection_routines.pyx":345 * # domain_width is already in code units, and we assume what is fed in * # is too. * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< @@ -8479,7 +9135,7 @@ */ __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); - /* "yt/geometry/selection_routines.pyx":354 + /* "yt/geometry/selection_routines.pyx":346 * # is too. * cdef np.float64_t rel = x1 - x2 * if self.periodicity[d]: # <<<<<<<<<<<<<< @@ -8489,7 +9145,7 @@ __pyx_t_1 = ((__pyx_v_self->periodicity[__pyx_v_d]) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":355 + /* "yt/geometry/selection_routines.pyx":347 * cdef np.float64_t rel = x1 - x2 * if self.periodicity[d]: * if rel > self.domain_width[d] * 0.5: # <<<<<<<<<<<<<< @@ -8499,7 +9155,7 @@ __pyx_t_1 = ((__pyx_v_rel > ((__pyx_v_self->domain_width[__pyx_v_d]) * 0.5)) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":356 + /* "yt/geometry/selection_routines.pyx":348 * if self.periodicity[d]: * if rel > self.domain_width[d] * 0.5: * rel -= self.domain_width[d] # <<<<<<<<<<<<<< @@ -8508,7 +9164,7 @@ */ __pyx_v_rel = (__pyx_v_rel - (__pyx_v_self->domain_width[__pyx_v_d])); - /* "yt/geometry/selection_routines.pyx":355 + /* "yt/geometry/selection_routines.pyx":347 * cdef np.float64_t rel = x1 - x2 * if self.periodicity[d]: * if rel > self.domain_width[d] * 0.5: # <<<<<<<<<<<<<< @@ -8518,7 +9174,7 @@ goto __pyx_L4; } - /* "yt/geometry/selection_routines.pyx":357 + /* "yt/geometry/selection_routines.pyx":349 * if rel > self.domain_width[d] * 0.5: * rel -= self.domain_width[d] * elif rel < -self.domain_width[d] * 0.5: # <<<<<<<<<<<<<< @@ -8528,7 +9184,7 @@ __pyx_t_1 = ((__pyx_v_rel < ((-(__pyx_v_self->domain_width[__pyx_v_d])) * 0.5)) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":358 + /* "yt/geometry/selection_routines.pyx":350 * rel -= self.domain_width[d] * elif rel < -self.domain_width[d] * 0.5: * rel += self.domain_width[d] # <<<<<<<<<<<<<< @@ -8537,7 +9193,7 @@ */ __pyx_v_rel = (__pyx_v_rel + (__pyx_v_self->domain_width[__pyx_v_d])); - /* "yt/geometry/selection_routines.pyx":357 + /* "yt/geometry/selection_routines.pyx":349 * if rel > self.domain_width[d] * 0.5: * rel -= self.domain_width[d] * elif rel < -self.domain_width[d] * 0.5: # <<<<<<<<<<<<<< @@ -8547,7 +9203,7 @@ } __pyx_L4:; - /* "yt/geometry/selection_routines.pyx":354 + /* "yt/geometry/selection_routines.pyx":346 * # is too. * cdef np.float64_t rel = x1 - x2 * if self.periodicity[d]: # <<<<<<<<<<<<<< @@ -8556,7 +9212,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":359 + /* "yt/geometry/selection_routines.pyx":351 * elif rel < -self.domain_width[d] * 0.5: * rel += self.domain_width[d] * return rel # <<<<<<<<<<<<<< @@ -8566,7 +9222,7 @@ __pyx_r = __pyx_v_rel; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":350 + /* "yt/geometry/selection_routines.pyx":342 * @cython.wraparound(False) * @cython.cdivision(True) * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil: # <<<<<<<<<<<<<< @@ -8579,7 +9235,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":364 +/* "yt/geometry/selection_routines.pyx":356 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mesh_mask(self, mesh): # <<<<<<<<<<<<<< @@ -8656,20 +9312,20 @@ __pyx_pybuffernd_mask.data = NULL; __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; - /* "yt/geometry/selection_routines.pyx":370 + /* "yt/geometry/selection_routines.pyx":362 * cdef np.ndarray[np.uint8_t, ndim=1] mask * cdef int i, j, k, selected * cdef int npoints, nv = mesh._connectivity_length # <<<<<<<<<<<<<< * cdef int total = 0 * cdef int offset = mesh._index_offset */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __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(0, 370, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nv = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":371 + /* "yt/geometry/selection_routines.pyx":363 * cdef int i, j, k, selected * cdef int npoints, nv = mesh._connectivity_length * cdef int total = 0 # <<<<<<<<<<<<<< @@ -8678,32 +9334,32 @@ */ __pyx_v_total = 0; - /* "yt/geometry/selection_routines.pyx":372 + /* "yt/geometry/selection_routines.pyx":364 * cdef int npoints, nv = mesh._connectivity_length * cdef int total = 0 * cdef int offset = mesh._index_offset # <<<<<<<<<<<<<< * coords = _ensure_code(mesh.connectivity_coords) * indices = mesh.connectivity_indices */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_index_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_index_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __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(0, 372, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_offset = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":373 + /* "yt/geometry/selection_routines.pyx":365 * cdef int total = 0 * cdef int offset = mesh._index_offset * coords = _ensure_code(mesh.connectivity_coords) # <<<<<<<<<<<<<< * indices = mesh.connectivity_indices * npoints = indices.shape[0] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_coords); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_coords); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 373, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 365, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -8719,22 +9375,22 @@ } } __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 373, __pyx_L1_error) + if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 365, __pyx_L1_error) } __pyx_t_4 = 0; __pyx_v_coords = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":374 + /* "yt/geometry/selection_routines.pyx":366 * cdef int offset = mesh._index_offset * coords = _ensure_code(mesh.connectivity_coords) * indices = mesh.connectivity_indices # <<<<<<<<<<<<<< * npoints = indices.shape[0] * mask = np.zeros(npoints, dtype='uint8') */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 374, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 366, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -8750,13 +9406,13 @@ } } __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indices.diminfo[1].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indices.diminfo[1].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 374, __pyx_L1_error) + if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 366, __pyx_L1_error) } __pyx_t_8 = 0; __pyx_v_indices = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":375 + /* "yt/geometry/selection_routines.pyx":367 * coords = _ensure_code(mesh.connectivity_coords) * indices = mesh.connectivity_indices * npoints = indices.shape[0] # <<<<<<<<<<<<<< @@ -8765,34 +9421,34 @@ */ __pyx_v_npoints = (__pyx_v_indices->dimensions[0]); - /* "yt/geometry/selection_routines.pyx":376 + /* "yt/geometry/selection_routines.pyx":368 * indices = mesh.connectivity_indices * npoints = indices.shape[0] * mask = np.zeros(npoints, dtype='uint8') # <<<<<<<<<<<<<< * for i in range(npoints): * selected = 0 */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_npoints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_npoints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 376, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 376, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 376, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 368, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -8808,13 +9464,13 @@ } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 376, __pyx_L1_error) + if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 368, __pyx_L1_error) } __pyx_t_11 = 0; __pyx_v_mask = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; - /* "yt/geometry/selection_routines.pyx":377 + /* "yt/geometry/selection_routines.pyx":369 * npoints = indices.shape[0] * mask = np.zeros(npoints, dtype='uint8') * for i in range(npoints): # <<<<<<<<<<<<<< @@ -8825,7 +9481,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "yt/geometry/selection_routines.pyx":378 + /* "yt/geometry/selection_routines.pyx":370 * mask = np.zeros(npoints, dtype='uint8') * for i in range(npoints): * selected = 0 # <<<<<<<<<<<<<< @@ -8834,7 +9490,7 @@ */ __pyx_v_selected = 0; - /* "yt/geometry/selection_routines.pyx":379 + /* "yt/geometry/selection_routines.pyx":371 * for i in range(npoints): * selected = 0 * for j in range(nv): # <<<<<<<<<<<<<< @@ -8845,7 +9501,7 @@ for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "yt/geometry/selection_routines.pyx":380 + /* "yt/geometry/selection_routines.pyx":372 * selected = 0 * for j in range(nv): * for k in range(3): # <<<<<<<<<<<<<< @@ -8855,7 +9511,7 @@ for (__pyx_t_15 = 0; __pyx_t_15 < 3; __pyx_t_15+=1) { __pyx_v_k = __pyx_t_15; - /* "yt/geometry/selection_routines.pyx":381 + /* "yt/geometry/selection_routines.pyx":373 * for j in range(nv): * for k in range(3): * pos[k] = coords[indices[i, j] - offset, k] # <<<<<<<<<<<<<< @@ -8869,7 +9525,7 @@ (__pyx_v_pos[__pyx_v_k]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_coords.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_coords.diminfo[1].strides)); } - /* "yt/geometry/selection_routines.pyx":382 + /* "yt/geometry/selection_routines.pyx":374 * for k in range(3): * pos[k] = coords[indices[i, j] - offset, k] * selected = self.select_point(pos) # <<<<<<<<<<<<<< @@ -8878,7 +9534,7 @@ */ __pyx_v_selected = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_point(__pyx_v_self, __pyx_v_pos); - /* "yt/geometry/selection_routines.pyx":383 + /* "yt/geometry/selection_routines.pyx":375 * pos[k] = coords[indices[i, j] - offset, k] * selected = self.select_point(pos) * if selected == 1: break # <<<<<<<<<<<<<< @@ -8892,7 +9548,7 @@ } __pyx_L6_break:; - /* "yt/geometry/selection_routines.pyx":384 + /* "yt/geometry/selection_routines.pyx":376 * selected = self.select_point(pos) * if selected == 1: break * total += selected # <<<<<<<<<<<<<< @@ -8901,7 +9557,7 @@ */ __pyx_v_total = (__pyx_v_total + __pyx_v_selected); - /* "yt/geometry/selection_routines.pyx":385 + /* "yt/geometry/selection_routines.pyx":377 * if selected == 1: break * total += selected * mask[i] = selected # <<<<<<<<<<<<<< @@ -8912,7 +9568,7 @@ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_mask.diminfo[0].strides) = __pyx_v_selected; } - /* "yt/geometry/selection_routines.pyx":386 + /* "yt/geometry/selection_routines.pyx":378 * total += selected * mask[i] = selected * if total == 0: return None # <<<<<<<<<<<<<< @@ -8927,7 +9583,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":387 + /* "yt/geometry/selection_routines.pyx":379 * mask[i] = selected * if total == 0: return None * return mask.astype("bool") # <<<<<<<<<<<<<< @@ -8935,16 +9591,16 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":364 + /* "yt/geometry/selection_routines.pyx":356 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mesh_mask(self, mesh): # <<<<<<<<<<<<<< @@ -8982,7 +9638,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":392 +/* "yt/geometry/selection_routines.pyx":384 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mesh_cell_mask(self, mesh): # <<<<<<<<<<<<<< @@ -9063,39 +9719,39 @@ __pyx_pybuffernd_mask.data = NULL; __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; - /* "yt/geometry/selection_routines.pyx":400 + /* "yt/geometry/selection_routines.pyx":392 * cdef np.ndarray[np.uint8_t, ndim=1] mask * cdef int i, j, k, selected * cdef int npoints, nv = mesh._connectivity_length # <<<<<<<<<<<<<< * cdef int ndim = mesh.connectivity_coords.shape[1] * cdef int total = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __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(0, 400, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nv = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":401 + /* "yt/geometry/selection_routines.pyx":393 * cdef int i, j, k, selected * cdef int npoints, nv = mesh._connectivity_length * cdef int ndim = mesh.connectivity_coords.shape[1] # <<<<<<<<<<<<<< * cdef int total = 0 * cdef int offset = mesh._index_offset */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_coords); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_coords); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ndim = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":402 + /* "yt/geometry/selection_routines.pyx":394 * cdef int npoints, nv = mesh._connectivity_length * cdef int ndim = mesh.connectivity_coords.shape[1] * cdef int total = 0 # <<<<<<<<<<<<<< @@ -9104,32 +9760,32 @@ */ __pyx_v_total = 0; - /* "yt/geometry/selection_routines.pyx":403 + /* "yt/geometry/selection_routines.pyx":395 * cdef int ndim = mesh.connectivity_coords.shape[1] * cdef int total = 0 * cdef int offset = mesh._index_offset # <<<<<<<<<<<<<< * coords = _ensure_code(mesh.connectivity_coords) * indices = mesh.connectivity_indices */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_index_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_index_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __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(0, 403, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_offset = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":404 + /* "yt/geometry/selection_routines.pyx":396 * cdef int total = 0 * cdef int offset = mesh._index_offset * coords = _ensure_code(mesh.connectivity_coords) # <<<<<<<<<<<<<< * indices = mesh.connectivity_indices * npoints = indices.shape[0] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_coords); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_coords); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 404, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 396, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -9145,22 +9801,22 @@ } } __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 404, __pyx_L1_error) + if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 396, __pyx_L1_error) } __pyx_t_4 = 0; __pyx_v_coords = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":405 + /* "yt/geometry/selection_routines.pyx":397 * cdef int offset = mesh._index_offset * coords = _ensure_code(mesh.connectivity_coords) * indices = mesh.connectivity_indices # <<<<<<<<<<<<<< * npoints = indices.shape[0] * mask = np.zeros(npoints, dtype='uint8') */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 405, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 397, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -9176,13 +9832,13 @@ } } __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indices.diminfo[1].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indices.diminfo[1].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 405, __pyx_L1_error) + if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 397, __pyx_L1_error) } __pyx_t_8 = 0; __pyx_v_indices = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":406 + /* "yt/geometry/selection_routines.pyx":398 * coords = _ensure_code(mesh.connectivity_coords) * indices = mesh.connectivity_indices * npoints = indices.shape[0] # <<<<<<<<<<<<<< @@ -9191,34 +9847,34 @@ */ __pyx_v_npoints = (__pyx_v_indices->dimensions[0]); - /* "yt/geometry/selection_routines.pyx":407 + /* "yt/geometry/selection_routines.pyx":399 * indices = mesh.connectivity_indices * npoints = indices.shape[0] * mask = np.zeros(npoints, dtype='uint8') # <<<<<<<<<<<<<< * for i in range(npoints): * selected = 0 */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_npoints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_npoints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 407, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 407, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 407, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 399, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -9234,13 +9890,13 @@ } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 407, __pyx_L1_error) + if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) } __pyx_t_11 = 0; __pyx_v_mask = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; - /* "yt/geometry/selection_routines.pyx":408 + /* "yt/geometry/selection_routines.pyx":400 * npoints = indices.shape[0] * mask = np.zeros(npoints, dtype='uint8') * for i in range(npoints): # <<<<<<<<<<<<<< @@ -9251,7 +9907,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "yt/geometry/selection_routines.pyx":409 + /* "yt/geometry/selection_routines.pyx":401 * mask = np.zeros(npoints, dtype='uint8') * for i in range(npoints): * selected = 0 # <<<<<<<<<<<<<< @@ -9260,7 +9916,7 @@ */ __pyx_v_selected = 0; - /* "yt/geometry/selection_routines.pyx":410 + /* "yt/geometry/selection_routines.pyx":402 * for i in range(npoints): * selected = 0 * for k in range(ndim): # <<<<<<<<<<<<<< @@ -9271,7 +9927,7 @@ for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_k = __pyx_t_14; - /* "yt/geometry/selection_routines.pyx":411 + /* "yt/geometry/selection_routines.pyx":403 * selected = 0 * for k in range(ndim): * le[k] = 1e60 # <<<<<<<<<<<<<< @@ -9280,7 +9936,7 @@ */ (__pyx_v_le[__pyx_v_k]) = 1e60; - /* "yt/geometry/selection_routines.pyx":412 + /* "yt/geometry/selection_routines.pyx":404 * for k in range(ndim): * le[k] = 1e60 * re[k] = -1e60 # <<<<<<<<<<<<<< @@ -9290,7 +9946,7 @@ (__pyx_v_re[__pyx_v_k]) = -1e60; } - /* "yt/geometry/selection_routines.pyx":413 + /* "yt/geometry/selection_routines.pyx":405 * le[k] = 1e60 * re[k] = -1e60 * for j in range(nv): # <<<<<<<<<<<<<< @@ -9301,7 +9957,7 @@ for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "yt/geometry/selection_routines.pyx":414 + /* "yt/geometry/selection_routines.pyx":406 * re[k] = -1e60 * for j in range(nv): * for k in range(ndim): # <<<<<<<<<<<<<< @@ -9312,7 +9968,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_k = __pyx_t_16; - /* "yt/geometry/selection_routines.pyx":415 + /* "yt/geometry/selection_routines.pyx":407 * for j in range(nv): * for k in range(ndim): * pos = coords[indices[i, j] - offset, k] # <<<<<<<<<<<<<< @@ -9325,7 +9981,7 @@ __pyx_t_20 = __pyx_v_k; __pyx_v_pos = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_coords.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_coords.diminfo[1].strides)); - /* "yt/geometry/selection_routines.pyx":416 + /* "yt/geometry/selection_routines.pyx":408 * for k in range(ndim): * pos = coords[indices[i, j] - offset, k] * le[k] = fmin(pos, le[k]) # <<<<<<<<<<<<<< @@ -9334,7 +9990,7 @@ */ (__pyx_v_le[__pyx_v_k]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_pos, (__pyx_v_le[__pyx_v_k])); - /* "yt/geometry/selection_routines.pyx":417 + /* "yt/geometry/selection_routines.pyx":409 * pos = coords[indices[i, j] - offset, k] * le[k] = fmin(pos, le[k]) * re[k] = fmax(pos, re[k]) # <<<<<<<<<<<<<< @@ -9345,7 +10001,7 @@ } } - /* "yt/geometry/selection_routines.pyx":418 + /* "yt/geometry/selection_routines.pyx":410 * le[k] = fmin(pos, le[k]) * re[k] = fmax(pos, re[k]) * selected = self.select_bbox(le, re) # <<<<<<<<<<<<<< @@ -9354,7 +10010,7 @@ */ __pyx_v_selected = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_bbox(__pyx_v_self, __pyx_v_le, __pyx_v_re); - /* "yt/geometry/selection_routines.pyx":419 + /* "yt/geometry/selection_routines.pyx":411 * re[k] = fmax(pos, re[k]) * selected = self.select_bbox(le, re) * total += selected # <<<<<<<<<<<<<< @@ -9363,7 +10019,7 @@ */ __pyx_v_total = (__pyx_v_total + __pyx_v_selected); - /* "yt/geometry/selection_routines.pyx":420 + /* "yt/geometry/selection_routines.pyx":412 * selected = self.select_bbox(le, re) * total += selected * mask[i] = selected # <<<<<<<<<<<<<< @@ -9374,7 +10030,7 @@ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_mask.diminfo[0].strides) = __pyx_v_selected; } - /* "yt/geometry/selection_routines.pyx":421 + /* "yt/geometry/selection_routines.pyx":413 * total += selected * mask[i] = selected * if total == 0: return None # <<<<<<<<<<<<<< @@ -9389,7 +10045,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":422 + /* "yt/geometry/selection_routines.pyx":414 * mask[i] = selected * if total == 0: return None * return mask.astype("bool") # <<<<<<<<<<<<<< @@ -9397,16 +10053,16 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":392 + /* "yt/geometry/selection_routines.pyx":384 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mesh_cell_mask(self, mesh): # <<<<<<<<<<<<<< @@ -9444,7 +10100,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":427 +/* "yt/geometry/selection_routines.pyx":419 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mask(self, gobj): # <<<<<<<<<<<<<< @@ -9531,16 +10187,16 @@ __pyx_pybuffernd_oright_edge.data = NULL; __pyx_pybuffernd_oright_edge.rcbuffer = &__pyx_pybuffer_oright_edge; - /* "yt/geometry/selection_routines.pyx":429 + /* "yt/geometry/selection_routines.pyx":421 * def fill_mask(self, gobj): * cdef np.ndarray[np.uint8_t, ndim=3, cast=True] child_mask * child_mask = gobj.child_mask # <<<<<<<<<<<<<< * cdef np.ndarray[np.uint8_t, ndim=3] mask * cdef int dim[3] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_child_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_child_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 429, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 421, __pyx_L1_error) __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -9556,73 +10212,73 @@ } } __pyx_pybuffernd_child_mask.diminfo[0].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_mask.diminfo[0].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_child_mask.diminfo[1].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_child_mask.diminfo[1].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_child_mask.diminfo[2].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_child_mask.diminfo[2].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 429, __pyx_L1_error) + if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 421, __pyx_L1_error) } __pyx_t_2 = 0; __pyx_v_child_mask = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":432 + /* "yt/geometry/selection_routines.pyx":424 * cdef np.ndarray[np.uint8_t, ndim=3] mask * cdef int dim[3] * _ensure_code(gobj.dds) # <<<<<<<<<<<<<< * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.RightEdge) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_7 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/selection_routines.pyx":433 + /* "yt/geometry/selection_routines.pyx":425 * cdef int dim[3] * _ensure_code(gobj.dds) * _ensure_code(gobj.LeftEdge) # <<<<<<<<<<<<<< * _ensure_code(gobj.RightEdge) * cdef np.ndarray[np.float64_t, ndim=1] odds = gobj.dds.d */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":434 + /* "yt/geometry/selection_routines.pyx":426 * _ensure_code(gobj.dds) * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.RightEdge) # <<<<<<<<<<<<<< * cdef np.ndarray[np.float64_t, ndim=1] odds = gobj.dds.d * cdef np.ndarray[np.float64_t, ndim=1] oleft_edge = gobj.LeftEdge.d */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_7 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/selection_routines.pyx":435 + /* "yt/geometry/selection_routines.pyx":427 * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.RightEdge) * cdef np.ndarray[np.float64_t, ndim=1] odds = gobj.dds.d # <<<<<<<<<<<<<< * cdef np.ndarray[np.float64_t, ndim=1] oleft_edge = gobj.LeftEdge.d * cdef np.ndarray[np.float64_t, ndim=1] oright_edge = gobj.RightEdge.d */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 435, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 427, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_odds.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_odds = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_odds.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 435, __pyx_L1_error) + __PYX_ERR(0, 427, __pyx_L1_error) } else {__pyx_pybuffernd_odds.diminfo[0].strides = __pyx_pybuffernd_odds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_odds.diminfo[0].shape = __pyx_pybuffernd_odds.rcbuffer->pybuffer.shape[0]; } } @@ -9630,25 +10286,25 @@ __pyx_v_odds = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":436 + /* "yt/geometry/selection_routines.pyx":428 * _ensure_code(gobj.RightEdge) * cdef np.ndarray[np.float64_t, ndim=1] odds = gobj.dds.d * cdef np.ndarray[np.float64_t, ndim=1] oleft_edge = gobj.LeftEdge.d # <<<<<<<<<<<<<< * cdef np.ndarray[np.float64_t, ndim=1] oright_edge = gobj.RightEdge.d * cdef int i */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 436, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 428, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oleft_edge.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_oleft_edge = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_oleft_edge.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 436, __pyx_L1_error) + __PYX_ERR(0, 428, __pyx_L1_error) } else {__pyx_pybuffernd_oleft_edge.diminfo[0].strides = __pyx_pybuffernd_oleft_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_oleft_edge.diminfo[0].shape = __pyx_pybuffernd_oleft_edge.rcbuffer->pybuffer.shape[0]; } } @@ -9656,25 +10312,25 @@ __pyx_v_oleft_edge = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/selection_routines.pyx":437 + /* "yt/geometry/selection_routines.pyx":429 * cdef np.ndarray[np.float64_t, ndim=1] odds = gobj.dds.d * cdef np.ndarray[np.float64_t, ndim=1] oleft_edge = gobj.LeftEdge.d * cdef np.ndarray[np.float64_t, ndim=1] oright_edge = gobj.RightEdge.d # <<<<<<<<<<<<<< * cdef int i * cdef np.float64_t dds[3] */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 437, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 429, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oright_edge.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_oright_edge = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_oright_edge.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 437, __pyx_L1_error) + __PYX_ERR(0, 429, __pyx_L1_error) } else {__pyx_pybuffernd_oright_edge.diminfo[0].strides = __pyx_pybuffernd_oright_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_oright_edge.diminfo[0].shape = __pyx_pybuffernd_oright_edge.rcbuffer->pybuffer.shape[0]; } } @@ -9682,7 +10338,7 @@ __pyx_v_oright_edge = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":442 + /* "yt/geometry/selection_routines.pyx":434 * cdef np.float64_t left_edge[3] * cdef np.float64_t right_edge[3] * for i in range(3): # <<<<<<<<<<<<<< @@ -9692,7 +10348,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":443 + /* "yt/geometry/selection_routines.pyx":435 * cdef np.float64_t right_edge[3] * for i in range(3): * dds[i] = odds[i] # <<<<<<<<<<<<<< @@ -9702,23 +10358,23 @@ __pyx_t_11 = __pyx_v_i; (__pyx_v_dds[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_odds.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_odds.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":444 + /* "yt/geometry/selection_routines.pyx":436 * for i in range(3): * dds[i] = odds[i] * dim[i] = gobj.ActiveDimensions[i] # <<<<<<<<<<<<<< * left_edge[i] = oleft_edge[i] * right_edge[i] = oright_edge[i] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; (__pyx_v_dim[__pyx_v_i]) = __pyx_t_12; - /* "yt/geometry/selection_routines.pyx":445 + /* "yt/geometry/selection_routines.pyx":437 * dds[i] = odds[i] * dim[i] = gobj.ActiveDimensions[i] * left_edge[i] = oleft_edge[i] # <<<<<<<<<<<<<< @@ -9728,7 +10384,7 @@ __pyx_t_13 = __pyx_v_i; (__pyx_v_left_edge[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_oleft_edge.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_oleft_edge.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":446 + /* "yt/geometry/selection_routines.pyx":438 * dim[i] = gobj.ActiveDimensions[i] * left_edge[i] = oleft_edge[i] * right_edge[i] = oright_edge[i] # <<<<<<<<<<<<<< @@ -9739,34 +10395,34 @@ (__pyx_v_right_edge[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_oright_edge.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_oright_edge.diminfo[0].strides)); } - /* "yt/geometry/selection_routines.pyx":447 + /* "yt/geometry/selection_routines.pyx":439 * left_edge[i] = oleft_edge[i] * right_edge[i] = oright_edge[i] * mask = np.zeros(gobj.ActiveDimensions, dtype='uint8') # <<<<<<<<<<<<<< * # Check for the level bounds * cdef np.int32_t level = gobj.Level */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 447, __pyx_L1_error) - __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, __pyx_t_7); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 447, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, __pyx_t_7); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 447, __pyx_L1_error) + if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 439, __pyx_L1_error) __pyx_t_17 = ((PyArrayObject *)__pyx_t_16); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -9782,26 +10438,26 @@ } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 447, __pyx_L1_error) + if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 439, __pyx_L1_error) } __pyx_t_17 = 0; __pyx_v_mask = ((PyArrayObject *)__pyx_t_16); __pyx_t_16 = 0; - /* "yt/geometry/selection_routines.pyx":449 + /* "yt/geometry/selection_routines.pyx":441 * mask = np.zeros(gobj.ActiveDimensions, dtype='uint8') * # Check for the level bounds * cdef np.int32_t level = gobj.Level # <<<<<<<<<<<<<< * # We set this to 1 if we ignore child_mask * cdef int total */ - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_Level); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_Level); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_18 = __Pyx_PyInt_As_npy_int32(__pyx_t_16); if (unlikely((__pyx_t_18 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyInt_As_npy_int32(__pyx_t_16); if (unlikely((__pyx_t_18 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_v_level = __pyx_t_18; - /* "yt/geometry/selection_routines.pyx":452 + /* "yt/geometry/selection_routines.pyx":444 * # We set this to 1 if we ignore child_mask * cdef int total * total = self.fill_mask_selector(left_edge, right_edge, dds, dim, # <<<<<<<<<<<<<< @@ -9810,7 +10466,7 @@ */ __pyx_v_total = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->fill_mask_selector(__pyx_v_self, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_dds, __pyx_v_dim, ((PyArrayObject *)__pyx_v_child_mask), ((PyArrayObject *)__pyx_v_mask), __pyx_v_level); - /* "yt/geometry/selection_routines.pyx":454 + /* "yt/geometry/selection_routines.pyx":446 * total = self.fill_mask_selector(left_edge, right_edge, dds, dim, * child_mask, mask, level) * if total == 0: return None # <<<<<<<<<<<<<< @@ -9825,7 +10481,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":455 + /* "yt/geometry/selection_routines.pyx":447 * child_mask, mask, level) * if total == 0: return None * return mask.astype("bool") # <<<<<<<<<<<<<< @@ -9833,16 +10489,16 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":427 + /* "yt/geometry/selection_routines.pyx":419 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mask(self, gobj): # <<<<<<<<<<<<<< @@ -9886,7 +10542,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":460 +/* "yt/geometry/selection_routines.pyx":452 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int fill_mask_selector(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -9936,16 +10592,16 @@ __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_child_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 460, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_child_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 452, __pyx_L1_error) } __pyx_pybuffernd_child_mask.diminfo[0].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_mask.diminfo[0].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_child_mask.diminfo[1].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_child_mask.diminfo[1].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_child_mask.diminfo[2].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_child_mask.diminfo[2].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 460, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 452, __pyx_L1_error) } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; - /* "yt/geometry/selection_routines.pyx":467 + /* "yt/geometry/selection_routines.pyx":459 * int level): * cdef int i, j, k * cdef int total = 0, this_level = 0 # <<<<<<<<<<<<<< @@ -9955,7 +10611,7 @@ __pyx_v_total = 0; __pyx_v_this_level = 0; - /* "yt/geometry/selection_routines.pyx":469 + /* "yt/geometry/selection_routines.pyx":461 * cdef int total = 0, this_level = 0 * cdef np.float64_t pos[3] * if level < self.min_level or level > self.max_level: # <<<<<<<<<<<<<< @@ -9973,7 +10629,7 @@ __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":470 + /* "yt/geometry/selection_routines.pyx":462 * cdef np.float64_t pos[3] * if level < self.min_level or level > self.max_level: * return 0 # <<<<<<<<<<<<<< @@ -9983,7 +10639,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":469 + /* "yt/geometry/selection_routines.pyx":461 * cdef int total = 0, this_level = 0 * cdef np.float64_t pos[3] * if level < self.min_level or level > self.max_level: # <<<<<<<<<<<<<< @@ -9992,7 +10648,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":471 + /* "yt/geometry/selection_routines.pyx":463 * if level < self.min_level or level > self.max_level: * return 0 * if level == self.max_level: # <<<<<<<<<<<<<< @@ -10002,7 +10658,7 @@ __pyx_t_1 = ((__pyx_v_level == __pyx_v_self->max_level) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":472 + /* "yt/geometry/selection_routines.pyx":464 * return 0 * if level == self.max_level: * this_level = 1 # <<<<<<<<<<<<<< @@ -10011,7 +10667,7 @@ */ __pyx_v_this_level = 1; - /* "yt/geometry/selection_routines.pyx":471 + /* "yt/geometry/selection_routines.pyx":463 * if level < self.min_level or level > self.max_level: * return 0 * if level == self.max_level: # <<<<<<<<<<<<<< @@ -10020,7 +10676,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":473 + /* "yt/geometry/selection_routines.pyx":465 * if level == self.max_level: * this_level = 1 * with nogil: # <<<<<<<<<<<<<< @@ -10031,10 +10687,11 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/geometry/selection_routines.pyx":474 + /* "yt/geometry/selection_routines.pyx":466 * this_level = 1 * with nogil: * pos[0] = left_edge[0] + dds[0] * 0.5 # <<<<<<<<<<<<<< @@ -10043,7 +10700,7 @@ */ (__pyx_v_pos[0]) = ((__pyx_v_left_edge[0]) + ((__pyx_v_dds[0]) * 0.5)); - /* "yt/geometry/selection_routines.pyx":475 + /* "yt/geometry/selection_routines.pyx":467 * with nogil: * pos[0] = left_edge[0] + dds[0] * 0.5 * for i in range(dim[0]): # <<<<<<<<<<<<<< @@ -10054,7 +10711,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":476 + /* "yt/geometry/selection_routines.pyx":468 * pos[0] = left_edge[0] + dds[0] * 0.5 * for i in range(dim[0]): * pos[1] = left_edge[1] + dds[1] * 0.5 # <<<<<<<<<<<<<< @@ -10063,7 +10720,7 @@ */ (__pyx_v_pos[1]) = ((__pyx_v_left_edge[1]) + ((__pyx_v_dds[1]) * 0.5)); - /* "yt/geometry/selection_routines.pyx":477 + /* "yt/geometry/selection_routines.pyx":469 * for i in range(dim[0]): * pos[1] = left_edge[1] + dds[1] * 0.5 * for j in range(dim[1]): # <<<<<<<<<<<<<< @@ -10074,7 +10731,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":478 + /* "yt/geometry/selection_routines.pyx":470 * pos[1] = left_edge[1] + dds[1] * 0.5 * for j in range(dim[1]): * pos[2] = left_edge[2] + dds[2] * 0.5 # <<<<<<<<<<<<<< @@ -10083,7 +10740,7 @@ */ (__pyx_v_pos[2]) = ((__pyx_v_left_edge[2]) + ((__pyx_v_dds[2]) * 0.5)); - /* "yt/geometry/selection_routines.pyx":479 + /* "yt/geometry/selection_routines.pyx":471 * for j in range(dim[1]): * pos[2] = left_edge[2] + dds[2] * 0.5 * for k in range(dim[2]): # <<<<<<<<<<<<<< @@ -10094,7 +10751,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_k = __pyx_t_8; - /* "yt/geometry/selection_routines.pyx":480 + /* "yt/geometry/selection_routines.pyx":472 * pos[2] = left_edge[2] + dds[2] * 0.5 * for k in range(dim[2]): * if child_mask[i, j, k] == 1 or this_level == 1: # <<<<<<<<<<<<<< @@ -10115,7 +10772,7 @@ __pyx_L17_bool_binop_done:; if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":481 + /* "yt/geometry/selection_routines.pyx":473 * for k in range(dim[2]): * if child_mask[i, j, k] == 1 or this_level == 1: * mask[i, j, k] = self.select_cell(pos, dds) # <<<<<<<<<<<<<< @@ -10127,7 +10784,7 @@ __pyx_t_14 = __pyx_v_k; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[2].strides) = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_cell(__pyx_v_self, __pyx_v_pos, __pyx_v_dds); - /* "yt/geometry/selection_routines.pyx":482 + /* "yt/geometry/selection_routines.pyx":474 * if child_mask[i, j, k] == 1 or this_level == 1: * mask[i, j, k] = self.select_cell(pos, dds) * total += mask[i, j, k] # <<<<<<<<<<<<<< @@ -10139,7 +10796,7 @@ __pyx_t_17 = __pyx_v_k; __pyx_v_total = (__pyx_v_total + (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_mask.diminfo[2].strides))); - /* "yt/geometry/selection_routines.pyx":480 + /* "yt/geometry/selection_routines.pyx":472 * pos[2] = left_edge[2] + dds[2] * 0.5 * for k in range(dim[2]): * if child_mask[i, j, k] == 1 or this_level == 1: # <<<<<<<<<<<<<< @@ -10148,7 +10805,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":483 + /* "yt/geometry/selection_routines.pyx":475 * mask[i, j, k] = self.select_cell(pos, dds) * total += mask[i, j, k] * pos[2] += dds[2] # <<<<<<<<<<<<<< @@ -10159,7 +10816,7 @@ (__pyx_v_pos[__pyx_t_18]) = ((__pyx_v_pos[__pyx_t_18]) + (__pyx_v_dds[2])); } - /* "yt/geometry/selection_routines.pyx":484 + /* "yt/geometry/selection_routines.pyx":476 * total += mask[i, j, k] * pos[2] += dds[2] * pos[1] += dds[1] # <<<<<<<<<<<<<< @@ -10170,7 +10827,7 @@ (__pyx_v_pos[__pyx_t_18]) = ((__pyx_v_pos[__pyx_t_18]) + (__pyx_v_dds[1])); } - /* "yt/geometry/selection_routines.pyx":485 + /* "yt/geometry/selection_routines.pyx":477 * pos[2] += dds[2] * pos[1] += dds[1] * pos[0] += dds[0] # <<<<<<<<<<<<<< @@ -10182,7 +10839,7 @@ } } - /* "yt/geometry/selection_routines.pyx":473 + /* "yt/geometry/selection_routines.pyx":465 * if level == self.max_level: * this_level = 1 * with nogil: # <<<<<<<<<<<<<< @@ -10192,6 +10849,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L9; @@ -10200,7 +10858,7 @@ } } - /* "yt/geometry/selection_routines.pyx":486 + /* "yt/geometry/selection_routines.pyx":478 * pos[1] += dds[1] * pos[0] += dds[0] * return total # <<<<<<<<<<<<<< @@ -10210,7 +10868,7 @@ __pyx_r = __pyx_v_total; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":460 + /* "yt/geometry/selection_routines.pyx":452 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int fill_mask_selector(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -10227,7 +10885,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_mask.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.geometry.selection_routines.SelectorObject.fill_mask_selector", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.SelectorObject.fill_mask_selector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; goto __pyx_L2; __pyx_L0:; @@ -10238,7 +10896,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":491 +/* "yt/geometry/selection_routines.pyx":483 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -10248,7 +10906,7 @@ static void __pyx_f_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_self, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *__pyx_v_func, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells *__pyx_optional_args) { - /* "yt/geometry/selection_routines.pyx":493 + /* "yt/geometry/selection_routines.pyx":485 * cdef void visit_grid_cells(self, GridVisitorData *data, * grid_visitor_function *func, * np.uint8_t *cached_mask = NULL): # <<<<<<<<<<<<<< @@ -10286,7 +10944,7 @@ } } - /* "yt/geometry/selection_routines.pyx":503 + /* "yt/geometry/selection_routines.pyx":495 * cdef np.float64_t dds[3] * cdef int dim[3] * cdef int this_level = 0, level, i # <<<<<<<<<<<<<< @@ -10295,7 +10953,7 @@ */ __pyx_v_this_level = 0; - /* "yt/geometry/selection_routines.pyx":505 + /* "yt/geometry/selection_routines.pyx":497 * cdef int this_level = 0, level, i * cdef np.float64_t pos[3] * level = data.grid.level # <<<<<<<<<<<<<< @@ -10305,7 +10963,7 @@ __pyx_t_1 = __pyx_v_data->grid->level; __pyx_v_level = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":506 + /* "yt/geometry/selection_routines.pyx":498 * cdef np.float64_t pos[3] * level = data.grid.level * if level < self.min_level or level > self.max_level: # <<<<<<<<<<<<<< @@ -10323,7 +10981,7 @@ __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pyx":507 + /* "yt/geometry/selection_routines.pyx":499 * level = data.grid.level * if level < self.min_level or level > self.max_level: * return # <<<<<<<<<<<<<< @@ -10332,7 +10990,7 @@ */ goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":506 + /* "yt/geometry/selection_routines.pyx":498 * cdef np.float64_t pos[3] * level = data.grid.level * if level < self.min_level or level > self.max_level: # <<<<<<<<<<<<<< @@ -10341,7 +10999,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":508 + /* "yt/geometry/selection_routines.pyx":500 * if level < self.min_level or level > self.max_level: * return * if level == self.max_level: # <<<<<<<<<<<<<< @@ -10351,7 +11009,7 @@ __pyx_t_2 = ((__pyx_v_level == __pyx_v_self->max_level) != 0); if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pyx":509 + /* "yt/geometry/selection_routines.pyx":501 * return * if level == self.max_level: * this_level = 1 # <<<<<<<<<<<<<< @@ -10360,7 +11018,7 @@ */ __pyx_v_this_level = 1; - /* "yt/geometry/selection_routines.pyx":508 + /* "yt/geometry/selection_routines.pyx":500 * if level < self.min_level or level > self.max_level: * return * if level == self.max_level: # <<<<<<<<<<<<<< @@ -10369,7 +11027,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":511 + /* "yt/geometry/selection_routines.pyx":503 * this_level = 1 * cdef np.uint8_t child_masked, selected * for i in range(3): # <<<<<<<<<<<<<< @@ -10379,7 +11037,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":512 + /* "yt/geometry/selection_routines.pyx":504 * cdef np.uint8_t child_masked, selected * for i in range(3): * left_edge[i] = data.grid.left_edge[i] # <<<<<<<<<<<<<< @@ -10388,7 +11046,7 @@ */ (__pyx_v_left_edge[__pyx_v_i]) = (__pyx_v_data->grid->left_edge[__pyx_v_i]); - /* "yt/geometry/selection_routines.pyx":513 + /* "yt/geometry/selection_routines.pyx":505 * for i in range(3): * left_edge[i] = data.grid.left_edge[i] * right_edge[i] = data.grid.right_edge[i] # <<<<<<<<<<<<<< @@ -10397,7 +11055,7 @@ */ (__pyx_v_right_edge[__pyx_v_i]) = (__pyx_v_data->grid->right_edge[__pyx_v_i]); - /* "yt/geometry/selection_routines.pyx":514 + /* "yt/geometry/selection_routines.pyx":506 * left_edge[i] = data.grid.left_edge[i] * right_edge[i] = data.grid.right_edge[i] * dds[i] = (right_edge[i] - left_edge[i])/data.grid.dims[i] # <<<<<<<<<<<<<< @@ -10406,7 +11064,7 @@ */ (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_right_edge[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])) / (__pyx_v_data->grid->dims[__pyx_v_i])); - /* "yt/geometry/selection_routines.pyx":515 + /* "yt/geometry/selection_routines.pyx":507 * right_edge[i] = data.grid.right_edge[i] * dds[i] = (right_edge[i] - left_edge[i])/data.grid.dims[i] * dim[i] = data.grid.dims[i] # <<<<<<<<<<<<<< @@ -10416,7 +11074,7 @@ (__pyx_v_dim[__pyx_v_i]) = (__pyx_v_data->grid->dims[__pyx_v_i]); } - /* "yt/geometry/selection_routines.pyx":516 + /* "yt/geometry/selection_routines.pyx":508 * dds[i] = (right_edge[i] - left_edge[i])/data.grid.dims[i] * dim[i] = data.grid.dims[i] * with nogil: # <<<<<<<<<<<<<< @@ -10427,10 +11085,11 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/geometry/selection_routines.pyx":517 + /* "yt/geometry/selection_routines.pyx":509 * dim[i] = data.grid.dims[i] * with nogil: * pos[0] = left_edge[0] + dds[0] * 0.5 # <<<<<<<<<<<<<< @@ -10439,7 +11098,7 @@ */ (__pyx_v_pos[0]) = ((__pyx_v_left_edge[0]) + ((__pyx_v_dds[0]) * 0.5)); - /* "yt/geometry/selection_routines.pyx":518 + /* "yt/geometry/selection_routines.pyx":510 * with nogil: * pos[0] = left_edge[0] + dds[0] * 0.5 * data.pos[0] = 0 # <<<<<<<<<<<<<< @@ -10448,7 +11107,7 @@ */ (__pyx_v_data->pos[0]) = 0; - /* "yt/geometry/selection_routines.pyx":519 + /* "yt/geometry/selection_routines.pyx":511 * pos[0] = left_edge[0] + dds[0] * 0.5 * data.pos[0] = 0 * for i in range(dim[0]): # <<<<<<<<<<<<<< @@ -10459,7 +11118,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "yt/geometry/selection_routines.pyx":520 + /* "yt/geometry/selection_routines.pyx":512 * data.pos[0] = 0 * for i in range(dim[0]): * pos[1] = left_edge[1] + dds[1] * 0.5 # <<<<<<<<<<<<<< @@ -10468,7 +11127,7 @@ */ (__pyx_v_pos[1]) = ((__pyx_v_left_edge[1]) + ((__pyx_v_dds[1]) * 0.5)); - /* "yt/geometry/selection_routines.pyx":521 + /* "yt/geometry/selection_routines.pyx":513 * for i in range(dim[0]): * pos[1] = left_edge[1] + dds[1] * 0.5 * data.pos[1] = 0 # <<<<<<<<<<<<<< @@ -10477,7 +11136,7 @@ */ (__pyx_v_data->pos[1]) = 0; - /* "yt/geometry/selection_routines.pyx":522 + /* "yt/geometry/selection_routines.pyx":514 * pos[1] = left_edge[1] + dds[1] * 0.5 * data.pos[1] = 0 * for j in range(dim[1]): # <<<<<<<<<<<<<< @@ -10488,7 +11147,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_j = __pyx_t_7; - /* "yt/geometry/selection_routines.pyx":523 + /* "yt/geometry/selection_routines.pyx":515 * data.pos[1] = 0 * for j in range(dim[1]): * pos[2] = left_edge[2] + dds[2] * 0.5 # <<<<<<<<<<<<<< @@ -10497,7 +11156,7 @@ */ (__pyx_v_pos[2]) = ((__pyx_v_left_edge[2]) + ((__pyx_v_dds[2]) * 0.5)); - /* "yt/geometry/selection_routines.pyx":524 + /* "yt/geometry/selection_routines.pyx":516 * for j in range(dim[1]): * pos[2] = left_edge[2] + dds[2] * 0.5 * data.pos[2] = 0 # <<<<<<<<<<<<<< @@ -10506,7 +11165,7 @@ */ (__pyx_v_data->pos[2]) = 0; - /* "yt/geometry/selection_routines.pyx":525 + /* "yt/geometry/selection_routines.pyx":517 * pos[2] = left_edge[2] + dds[2] * 0.5 * data.pos[2] = 0 * for k in range(dim[2]): # <<<<<<<<<<<<<< @@ -10517,7 +11176,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_k = __pyx_t_9; - /* "yt/geometry/selection_routines.pyx":529 + /* "yt/geometry/selection_routines.pyx":521 * # only set selected to true if it's *not* masked by a * # child and it *is* selected. * if cached_mask != NULL: # <<<<<<<<<<<<<< @@ -10527,7 +11186,7 @@ __pyx_t_2 = ((__pyx_v_cached_mask != NULL) != 0); if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pyx":530 + /* "yt/geometry/selection_routines.pyx":522 * # child and it *is* selected. * if cached_mask != NULL: * selected = ba_get_value(cached_mask, # <<<<<<<<<<<<<< @@ -10536,7 +11195,7 @@ */ __pyx_v_selected = __pyx_f_2yt_9utilities_3lib_8bitarray_ba_get_value(__pyx_v_cached_mask, __pyx_v_data->global_index); - /* "yt/geometry/selection_routines.pyx":529 + /* "yt/geometry/selection_routines.pyx":521 * # only set selected to true if it's *not* masked by a * # child and it *is* selected. * if cached_mask != NULL: # <<<<<<<<<<<<<< @@ -10546,7 +11205,7 @@ goto __pyx_L18; } - /* "yt/geometry/selection_routines.pyx":533 + /* "yt/geometry/selection_routines.pyx":525 * data.global_index) * else: * if this_level == 1: # <<<<<<<<<<<<<< @@ -10557,7 +11216,7 @@ __pyx_t_2 = ((__pyx_v_this_level == 1) != 0); if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pyx":534 + /* "yt/geometry/selection_routines.pyx":526 * else: * if this_level == 1: * child_masked = 0 # <<<<<<<<<<<<<< @@ -10566,7 +11225,7 @@ */ __pyx_v_child_masked = 0; - /* "yt/geometry/selection_routines.pyx":533 + /* "yt/geometry/selection_routines.pyx":525 * data.global_index) * else: * if this_level == 1: # <<<<<<<<<<<<<< @@ -10576,7 +11235,7 @@ goto __pyx_L19; } - /* "yt/geometry/selection_routines.pyx":536 + /* "yt/geometry/selection_routines.pyx":528 * child_masked = 0 * else: * child_masked = check_child_masked(data) # <<<<<<<<<<<<<< @@ -10588,7 +11247,7 @@ } __pyx_L19:; - /* "yt/geometry/selection_routines.pyx":537 + /* "yt/geometry/selection_routines.pyx":529 * else: * child_masked = check_child_masked(data) * if child_masked == 0: # <<<<<<<<<<<<<< @@ -10598,7 +11257,7 @@ __pyx_t_2 = ((__pyx_v_child_masked == 0) != 0); if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pyx":538 + /* "yt/geometry/selection_routines.pyx":530 * child_masked = check_child_masked(data) * if child_masked == 0: * selected = self.select_cell(pos, dds) # <<<<<<<<<<<<<< @@ -10607,7 +11266,7 @@ */ __pyx_v_selected = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_cell(__pyx_v_self, __pyx_v_pos, __pyx_v_dds); - /* "yt/geometry/selection_routines.pyx":537 + /* "yt/geometry/selection_routines.pyx":529 * else: * child_masked = check_child_masked(data) * if child_masked == 0: # <<<<<<<<<<<<<< @@ -10617,7 +11276,7 @@ goto __pyx_L20; } - /* "yt/geometry/selection_routines.pyx":540 + /* "yt/geometry/selection_routines.pyx":532 * selected = self.select_cell(pos, dds) * else: * selected = 0 # <<<<<<<<<<<<<< @@ -10631,7 +11290,7 @@ } __pyx_L18:; - /* "yt/geometry/selection_routines.pyx":541 + /* "yt/geometry/selection_routines.pyx":533 * else: * selected = 0 * func(data, selected) # <<<<<<<<<<<<<< @@ -10640,7 +11299,7 @@ */ __pyx_v_func(__pyx_v_data, __pyx_v_selected); - /* "yt/geometry/selection_routines.pyx":542 + /* "yt/geometry/selection_routines.pyx":534 * selected = 0 * func(data, selected) * data.global_index += 1 # <<<<<<<<<<<<<< @@ -10649,7 +11308,7 @@ */ __pyx_v_data->global_index = (__pyx_v_data->global_index + 1); - /* "yt/geometry/selection_routines.pyx":543 + /* "yt/geometry/selection_routines.pyx":535 * func(data, selected) * data.global_index += 1 * pos[2] += dds[2] # <<<<<<<<<<<<<< @@ -10659,7 +11318,7 @@ __pyx_t_10 = 2; (__pyx_v_pos[__pyx_t_10]) = ((__pyx_v_pos[__pyx_t_10]) + (__pyx_v_dds[2])); - /* "yt/geometry/selection_routines.pyx":544 + /* "yt/geometry/selection_routines.pyx":536 * data.global_index += 1 * pos[2] += dds[2] * data.pos[2] += 1 # <<<<<<<<<<<<<< @@ -10670,7 +11329,7 @@ (__pyx_v_data->pos[__pyx_t_10]) = ((__pyx_v_data->pos[__pyx_t_10]) + 1); } - /* "yt/geometry/selection_routines.pyx":545 + /* "yt/geometry/selection_routines.pyx":537 * pos[2] += dds[2] * data.pos[2] += 1 * pos[1] += dds[1] # <<<<<<<<<<<<<< @@ -10680,7 +11339,7 @@ __pyx_t_10 = 1; (__pyx_v_pos[__pyx_t_10]) = ((__pyx_v_pos[__pyx_t_10]) + (__pyx_v_dds[1])); - /* "yt/geometry/selection_routines.pyx":546 + /* "yt/geometry/selection_routines.pyx":538 * data.pos[2] += 1 * pos[1] += dds[1] * data.pos[1] += 1 # <<<<<<<<<<<<<< @@ -10691,7 +11350,7 @@ (__pyx_v_data->pos[__pyx_t_10]) = ((__pyx_v_data->pos[__pyx_t_10]) + 1); } - /* "yt/geometry/selection_routines.pyx":547 + /* "yt/geometry/selection_routines.pyx":539 * pos[1] += dds[1] * data.pos[1] += 1 * pos[0] += dds[0] # <<<<<<<<<<<<<< @@ -10701,7 +11360,7 @@ __pyx_t_10 = 0; (__pyx_v_pos[__pyx_t_10]) = ((__pyx_v_pos[__pyx_t_10]) + (__pyx_v_dds[0])); - /* "yt/geometry/selection_routines.pyx":548 + /* "yt/geometry/selection_routines.pyx":540 * data.pos[1] += 1 * pos[0] += dds[0] * data.pos[0] += 1 # <<<<<<<<<<<<<< @@ -10713,7 +11372,7 @@ } } - /* "yt/geometry/selection_routines.pyx":516 + /* "yt/geometry/selection_routines.pyx":508 * dds[i] = (right_edge[i] - left_edge[i])/data.grid.dims[i] * dim[i] = data.grid.dims[i] * with nogil: # <<<<<<<<<<<<<< @@ -10723,6 +11382,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L11; @@ -10731,7 +11391,7 @@ } } - /* "yt/geometry/selection_routines.pyx":491 + /* "yt/geometry/selection_routines.pyx":483 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -10744,12 +11404,12 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/geometry/selection_routines.pyx":553 +/* "yt/geometry/selection_routines.pyx":545 * @cython.wraparound(False) * @cython.cdivision(True) - * def count_points(self, np.ndarray[anyfloat, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] y, - * np.ndarray[anyfloat, ndim=1] z, + * def count_points(self, np.ndarray[floating, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] y, + * np.ndarray[floating, ndim=1] z, */ /* Python wrapper */ @@ -10770,8 +11430,11 @@ 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; } @@ -10780,19 +11443,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, 1); __PYX_ERR(0, 553, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, 1); __PYX_ERR(0, 545, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, 2); __PYX_ERR(0, 553, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, 2); __PYX_ERR(0, 545, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 553, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 545, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -10807,7 +11472,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 553, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 545, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -10822,174 +11487,154 @@ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_14count_points(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) { PyObject *__pyx_v_dest_sig = NULL; + Py_ssize_t __pyx_v_i; PyTypeObject *__pyx_v_ndarray = 0; - PyObject *__pyx_v_numpy = NULL; __Pyx_memviewslice __pyx_v_memslice; Py_ssize_t __pyx_v_itemsize; CYTHON_UNUSED int __pyx_v_dtype_signed; char __pyx_v_kind; + int __pyx_v_arg_is_pythran_compatible; PyObject *__pyx_v_arg = NULL; PyObject *__pyx_v_dtype = NULL; PyObject *__pyx_v_arg_base = NULL; + PyObject *__pyx_v_byteorder = NULL; + PyObject *__pyx_v_cur_stride = NULL; + PyObject *__pyx_v_dim = NULL; + PyObject *__pyx_v_stride = NULL; PyObject *__pyx_v_candidates = NULL; PyObject *__pyx_v_sig = NULL; int __pyx_v_match_found; - PyObject *__pyx_v_src_type = NULL; + PyObject *__pyx_v_src_sig = NULL; PyObject *__pyx_v_dst_type = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; + long __pyx_t_7; + int __pyx_t_8; PyObject *__pyx_t_9 = NULL; - Py_ssize_t __pyx_t_10; - long __pyx_t_11; - __Pyx_memviewslice __pyx_t_12; - Py_ssize_t __pyx_t_13; - int __pyx_t_14; + PyObject *(*__pyx_t_10)(PyObject *); + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + __Pyx_memviewslice __pyx_t_14; Py_ssize_t __pyx_t_15; - PyObject *(*__pyx_t_16)(PyObject *); - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - PyObject *(*__pyx_t_20)(PyObject *); - int __pyx_t_21; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; __Pyx_RefNannySetupContext("count_points", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyList_SET_ITEM(__pyx_t_1, 0, Py_None); __pyx_v_dest_sig = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = (__pyx_v_kwargs == Py_None); - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_v_kwargs != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; } - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - /*try:*/ { - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_numpy = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 553, __pyx_L4_error) - __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); - __pyx_t_1 = 0; - } - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L11_try_end; - __pyx_L4_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); - if (__pyx_t_7) { - __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 553, __pyx_L6_except_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(Py_None); - __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L5_exception_handled; - } - goto __pyx_L6_except_error; - __pyx_L6_except_error:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); - goto __pyx_L1_error; - __pyx_L5_exception_handled:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); - __pyx_L11_try_end:; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_3 = ((!__pyx_t_4) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + __Pyx_INCREF(Py_None); + __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); + __pyx_t_1 = 0; __pyx_v_itemsize = -1L; + __pyx_v_arg_is_pythran_compatible = 0; if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 553, __pyx_L1_error) + __PYX_ERR(0, 545, __pyx_L1_error) } - __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_t_3 = ((1 < __pyx_t_10) != 0); - if (__pyx_t_3) { + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_2 = ((1 < __pyx_t_5) != 0); + if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 553, __pyx_L1_error) + __PYX_ERR(0, 545, __pyx_L1_error) } - __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 1); - __Pyx_INCREF(__pyx_t_9); - __pyx_v_arg = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L14; + __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_arg = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6; + } + __pyx_t_3 = (__pyx_v_kwargs != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L7_bool_binop_done; } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 553, __pyx_L1_error) + __PYX_ERR(0, 545, __pyx_L1_error) } - __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_x, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_x, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 553, __pyx_L1_error) + __PYX_ERR(0, 545, __pyx_L1_error) } - __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_v_arg = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L14; + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_arg = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6; } /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 553, __pyx_L1_error) + __PYX_ERR(0, 545, __pyx_L1_error) } - __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_int_5); + __Pyx_GIVEREF(__pyx_int_5); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_5); + __Pyx_INCREF(__pyx_n_s_s); + __Pyx_GIVEREF(__pyx_n_s_s); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_s); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 545, __pyx_L1_error) } - __pyx_L14:; + __pyx_L6:; while (1) { __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None)); __pyx_t_3 = (__pyx_t_2 != 0); @@ -10997,93 +11642,293 @@ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_dtype = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L18; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_dtype = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_arg_is_pythran_compatible = 1; + goto __pyx_L12; } __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_arg_base = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_arg_base = __pyx_t_1; + __pyx_t_1 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_dtype = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L19; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_dtype = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L13; } /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_dtype = Py_None; } - __pyx_L19:; - goto __pyx_L18; + __pyx_L13:; + goto __pyx_L12; } /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_dtype = Py_None; } - __pyx_L18:; + __pyx_L12:; __pyx_v_itemsize = -1L; __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_itemsize = __pyx_t_10; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_kind = __pyx_t_11; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_itemsize = __pyx_t_5; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_1); if (unlikely(__pyx_t_7 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_kind = __pyx_t_7; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_byteorder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_byteorder = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_byteorder, __pyx_kp_s__5, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_8 = __Pyx_Is_Little_Endian(); + __pyx_t_2 = ((!(__pyx_t_8 != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L16_bool_binop_done:; + if (__pyx_t_3) { + __pyx_v_arg_is_pythran_compatible = 0; + } + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_byteorder, __pyx_kp_s__6, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_8 = __Pyx_Is_Little_Endian(); + __pyx_t_2 = (__pyx_t_8 != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L19_bool_binop_done:; + if (__pyx_t_3) { + __pyx_v_arg_is_pythran_compatible = 0; + } __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); + __pyx_t_3 = (__pyx_v_arg_is_pythran_compatible != 0); + if (__pyx_t_3) { + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cur_stride = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_reversed, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_strides); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_reversed, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_9 = __pyx_t_6; __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 545, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_9))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_10(__pyx_t_9); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 545, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 545, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_11 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_11); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L24_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L24_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_unpacking_done; + __pyx_L24_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_L25_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_6 = PyObject_RichCompare(__pyx_v_stride, __pyx_v_cur_stride, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { + __pyx_v_arg_is_pythran_compatible = 0; + goto __pyx_L23_break; + } + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_cur_stride, __pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_cur_stride, __pyx_t_6); + __pyx_t_6 = 0; + } + /*else*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L28_bool_binop_done; + } + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_11, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = __pyx_t_2; + __pyx_L28_bool_binop_done:; + __pyx_v_arg_is_pythran_compatible = (!__pyx_t_3); + } + __pyx_L23_break:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } switch (__pyx_v_kind) { case 'i': case 'u': break; case 'f': - __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0); + __pyx_t_2 = (((sizeof(float)) == __pyx_v_itemsize) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L22_bool_binop_done; + goto __pyx_L31_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L22_bool_binop_done:; + __pyx_L31_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 553, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + goto __pyx_L10_break; } - __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize) != 0); + __pyx_t_2 = (((sizeof(double)) == __pyx_v_itemsize) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L25_bool_binop_done; + goto __pyx_L34_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L25_bool_binop_done:; + __pyx_L34_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 553, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + goto __pyx_L10_break; } break; case 'c': @@ -11098,19 +11943,19 @@ if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L28_bool_binop_done; + goto __pyx_L37_bool_binop_done; } - __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0); + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(float))) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L28_bool_binop_done:; + __pyx_L37_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg); - __pyx_v_memslice = __pyx_t_12; + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg); + __pyx_v_memslice = __pyx_t_14; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 553, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); @@ -11120,242 +11965,150 @@ if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L32_bool_binop_done; + goto __pyx_L41_bool_binop_done; } - __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0); + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(double))) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L32_bool_binop_done:; + __pyx_L41_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg); - __pyx_v_memslice = __pyx_t_12; + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg); + __pyx_v_memslice = __pyx_t_14; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 553, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 553, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + goto __pyx_L10_break; } - __pyx_L16_break:; - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_candidates = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_10 = 0; + __pyx_L10_break:; + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_candidates = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_5 = 0; if (unlikely(((PyObject *)__pyx_v_signatures) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 553, __pyx_L1_error) + __PYX_ERR(0, 545, __pyx_L1_error) } - __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); - __pyx_t_8 = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_15), (&__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __pyx_t_9 = __pyx_t_6; + __pyx_t_6 = 0; while (1) { - __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7); - if (unlikely(__pyx_t_14 == 0)) break; - if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_15, &__pyx_t_5, &__pyx_t_6, NULL, NULL, __pyx_t_8); + if (unlikely(__pyx_t_16 == 0)) break; + if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_6); + __pyx_t_6 = 0; __pyx_v_match_found = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); - __Pyx_INCREF(__pyx_v_dest_sig); - __Pyx_GIVEREF(__pyx_v_dest_sig); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0; - __pyx_t_16 = NULL; - } else { - __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 553, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_16)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { - if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 553, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 553, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_16(__pyx_t_9); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 553, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 553, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_17 = PyList_GET_ITEM(sequence, 0); - __pyx_t_18 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_17); - __Pyx_INCREF(__pyx_t_18); - #else - __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_18); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_19); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; - index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L39_unpacking_failed; - __Pyx_GOTREF(__pyx_t_17); - index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L39_unpacking_failed; - __Pyx_GOTREF(__pyx_t_18); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_t_20 = NULL; - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - goto __pyx_L40_unpacking_done; - __pyx_L39_unpacking_failed:; - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_20 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_L40_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17); - __pyx_t_17 = 0; - __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18); - __pyx_t_18 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_17 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 545, __pyx_L1_error) + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_i = __pyx_t_18; + __pyx_t_11 = PyList_GET_ITEM(__pyx_v_dest_sig, __pyx_v_i); + __Pyx_INCREF(__pyx_t_11); + __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_11); + __pyx_t_11 = 0; __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_11, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; - goto __pyx_L42; + goto __pyx_L49; } /*else*/ { __pyx_v_match_found = 0; - goto __pyx_L38_break; + goto __pyx_L47_break; } - __pyx_L42:; + __pyx_L49:; } } - __pyx_L38_break:; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_L47_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 545, __pyx_L1_error) } } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __PYX_ERR(0, 545, __pyx_L1_error) } - __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_t_3 = ((__pyx_t_13 > 1) != 0); + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_15 > 1) != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __PYX_ERR(0, 545, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(((PyObject *)__pyx_v_signatures) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 553, __pyx_L1_error) + __PYX_ERR(0, 545, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; goto __pyx_L0; } /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_17); - __Pyx_XDECREF(__pyx_t_18); - __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dest_sig); __Pyx_XDECREF(__pyx_v_ndarray); - __Pyx_XDECREF(__pyx_v_numpy); __Pyx_XDECREF(__pyx_v_arg); __Pyx_XDECREF(__pyx_v_dtype); __Pyx_XDECREF(__pyx_v_arg_base); + __Pyx_XDECREF(__pyx_v_byteorder); + __Pyx_XDECREF(__pyx_v_cur_stride); + __Pyx_XDECREF(__pyx_v_dim); + __Pyx_XDECREF(__pyx_v_stride); __Pyx_XDECREF(__pyx_v_candidates); __Pyx_XDECREF(__pyx_v_sig); - __Pyx_XDECREF(__pyx_v_src_type); + __Pyx_XDECREF(__pyx_v_src_sig); __Pyx_XDECREF(__pyx_v_dst_type); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_XGIVEREF(__pyx_r); @@ -11382,9 +12135,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -11393,24 +12150,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, 1); __PYX_ERR(0, 553, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, 1); __PYX_ERR(0, 545, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, 2); __PYX_ERR(0, 553, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, 2); __PYX_ERR(0, 545, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, 3); __PYX_ERR(0, 553, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, 3); __PYX_ERR(0, 545, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_points") < 0)) __PYX_ERR(0, 553, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_points") < 0)) __PYX_ERR(0, 545, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -11423,19 +12183,19 @@ __pyx_v_x = ((PyArrayObject *)values[0]); __pyx_v_y = ((PyArrayObject *)values[1]); __pyx_v_z = ((PyArrayObject *)values[2]); - __pyx_v_radius = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_radius == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 556, __pyx_L3_error) + __pyx_v_radius = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_radius == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 548, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 553, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 545, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.count_points", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 553, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 554, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 555, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 545, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 546, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 547, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_24count_points(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_z, __pyx_v_radius); /* function exit code */ @@ -11484,22 +12244,22 @@ __pyx_pybuffernd_z.rcbuffer = &__pyx_pybuffer_z; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 553, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 545, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 553, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 545, __pyx_L1_error) } __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 553, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 545, __pyx_L1_error) } __pyx_pybuffernd_z.diminfo[0].strides = __pyx_pybuffernd_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z.diminfo[0].shape = __pyx_pybuffernd_z.rcbuffer->pybuffer.shape[0]; - /* "yt/geometry/selection_routines.pyx":557 - * np.ndarray[anyfloat, ndim=1] z, + /* "yt/geometry/selection_routines.pyx":549 + * np.ndarray[floating, ndim=1] z, * np.float64_t radius): * cdef int count = 0 # <<<<<<<<<<<<<< * cdef int i @@ -11507,40 +12267,40 @@ */ __pyx_v_count = 0; - /* "yt/geometry/selection_routines.pyx":560 + /* "yt/geometry/selection_routines.pyx":552 * cdef int i * cdef np.float64_t pos[3] * _ensure_code(x) # <<<<<<<<<<<<<< * _ensure_code(y) * _ensure_code(z) */ - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":561 + /* "yt/geometry/selection_routines.pyx":553 * cdef np.float64_t pos[3] * _ensure_code(x) * _ensure_code(y) # <<<<<<<<<<<<<< * _ensure_code(z) * with nogil: */ - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_y)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_y)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":562 + /* "yt/geometry/selection_routines.pyx":554 * _ensure_code(x) * _ensure_code(y) * _ensure_code(z) # <<<<<<<<<<<<<< * with nogil: * if radius == 0.0 : */ - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_z)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_z)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":563 + /* "yt/geometry/selection_routines.pyx":555 * _ensure_code(y) * _ensure_code(z) * with nogil: # <<<<<<<<<<<<<< @@ -11551,10 +12311,11 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/geometry/selection_routines.pyx":564 + /* "yt/geometry/selection_routines.pyx":556 * _ensure_code(z) * with nogil: * if radius == 0.0 : # <<<<<<<<<<<<<< @@ -11564,7 +12325,7 @@ __pyx_t_2 = ((__pyx_v_radius == 0.0) != 0); if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pyx":565 + /* "yt/geometry/selection_routines.pyx":557 * with nogil: * if radius == 0.0 : * for i in range(x.shape[0]): # <<<<<<<<<<<<<< @@ -11575,7 +12336,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":566 + /* "yt/geometry/selection_routines.pyx":558 * if radius == 0.0 : * for i in range(x.shape[0]): * pos[0] = x[i] # <<<<<<<<<<<<<< @@ -11583,9 +12344,9 @@ * pos[2] = z[i] */ __pyx_t_5 = __pyx_v_i; - (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_x.diminfo[0].strides)); + (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_x.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":567 + /* "yt/geometry/selection_routines.pyx":559 * for i in range(x.shape[0]): * pos[0] = x[i] * pos[1] = y[i] # <<<<<<<<<<<<<< @@ -11593,9 +12354,9 @@ * count += self.select_point(pos) */ __pyx_t_6 = __pyx_v_i; - (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_y.diminfo[0].strides)); + (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_y.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":568 + /* "yt/geometry/selection_routines.pyx":560 * pos[0] = x[i] * pos[1] = y[i] * pos[2] = z[i] # <<<<<<<<<<<<<< @@ -11603,9 +12364,9 @@ * else : */ __pyx_t_7 = __pyx_v_i; - (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_z.diminfo[0].strides)); + (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_z.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":569 + /* "yt/geometry/selection_routines.pyx":561 * pos[1] = y[i] * pos[2] = z[i] * count += self.select_point(pos) # <<<<<<<<<<<<<< @@ -11615,7 +12376,7 @@ __pyx_v_count = (__pyx_v_count + ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_point(__pyx_v_self, __pyx_v_pos)); } - /* "yt/geometry/selection_routines.pyx":564 + /* "yt/geometry/selection_routines.pyx":556 * _ensure_code(z) * with nogil: * if radius == 0.0 : # <<<<<<<<<<<<<< @@ -11625,7 +12386,7 @@ goto __pyx_L6; } - /* "yt/geometry/selection_routines.pyx":571 + /* "yt/geometry/selection_routines.pyx":563 * count += self.select_point(pos) * else : * for i in range(x.shape[0]): # <<<<<<<<<<<<<< @@ -11637,7 +12398,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":572 + /* "yt/geometry/selection_routines.pyx":564 * else : * for i in range(x.shape[0]): * pos[0] = x[i] # <<<<<<<<<<<<<< @@ -11645,9 +12406,9 @@ * pos[2] = z[i] */ __pyx_t_8 = __pyx_v_i; - (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides)); + (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":573 + /* "yt/geometry/selection_routines.pyx":565 * for i in range(x.shape[0]): * pos[0] = x[i] * pos[1] = y[i] # <<<<<<<<<<<<<< @@ -11655,9 +12416,9 @@ * count += self.select_sphere(pos, radius) */ __pyx_t_9 = __pyx_v_i; - (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_y.diminfo[0].strides)); + (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_y.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":574 + /* "yt/geometry/selection_routines.pyx":566 * pos[0] = x[i] * pos[1] = y[i] * pos[2] = z[i] # <<<<<<<<<<<<<< @@ -11665,9 +12426,9 @@ * return count */ __pyx_t_10 = __pyx_v_i; - (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_z.diminfo[0].strides)); + (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_z.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":575 + /* "yt/geometry/selection_routines.pyx":567 * pos[1] = y[i] * pos[2] = z[i] * count += self.select_sphere(pos, radius) # <<<<<<<<<<<<<< @@ -11680,7 +12441,7 @@ __pyx_L6:; } - /* "yt/geometry/selection_routines.pyx":563 + /* "yt/geometry/selection_routines.pyx":555 * _ensure_code(y) * _ensure_code(z) * with nogil: # <<<<<<<<<<<<<< @@ -11690,6 +12451,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; @@ -11698,7 +12460,7 @@ } } - /* "yt/geometry/selection_routines.pyx":576 + /* "yt/geometry/selection_routines.pyx":568 * pos[2] = z[i] * count += self.select_sphere(pos, radius) * return count # <<<<<<<<<<<<<< @@ -11706,18 +12468,18 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":553 + /* "yt/geometry/selection_routines.pyx":545 * @cython.wraparound(False) * @cython.cdivision(True) - * def count_points(self, np.ndarray[anyfloat, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] y, - * np.ndarray[anyfloat, ndim=1] z, + * def count_points(self, np.ndarray[floating, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] y, + * np.ndarray[floating, ndim=1] z, */ /* function exit code */ @@ -11763,9 +12525,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -11774,24 +12540,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, 1); __PYX_ERR(0, 553, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, 1); __PYX_ERR(0, 545, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, 2); __PYX_ERR(0, 553, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, 2); __PYX_ERR(0, 545, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, 3); __PYX_ERR(0, 553, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, 3); __PYX_ERR(0, 545, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_points") < 0)) __PYX_ERR(0, 553, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_points") < 0)) __PYX_ERR(0, 545, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -11804,19 +12573,19 @@ __pyx_v_x = ((PyArrayObject *)values[0]); __pyx_v_y = ((PyArrayObject *)values[1]); __pyx_v_z = ((PyArrayObject *)values[2]); - __pyx_v_radius = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_radius == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 556, __pyx_L3_error) + __pyx_v_radius = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_radius == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 548, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 553, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("count_points", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 545, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.count_points", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 553, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 554, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 555, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 545, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 546, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 547, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_26count_points(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_z, __pyx_v_radius); /* function exit code */ @@ -11865,22 +12634,22 @@ __pyx_pybuffernd_z.rcbuffer = &__pyx_pybuffer_z; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 553, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 545, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 553, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 545, __pyx_L1_error) } __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 553, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 545, __pyx_L1_error) } __pyx_pybuffernd_z.diminfo[0].strides = __pyx_pybuffernd_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z.diminfo[0].shape = __pyx_pybuffernd_z.rcbuffer->pybuffer.shape[0]; - /* "yt/geometry/selection_routines.pyx":557 - * np.ndarray[anyfloat, ndim=1] z, + /* "yt/geometry/selection_routines.pyx":549 + * np.ndarray[floating, ndim=1] z, * np.float64_t radius): * cdef int count = 0 # <<<<<<<<<<<<<< * cdef int i @@ -11888,40 +12657,40 @@ */ __pyx_v_count = 0; - /* "yt/geometry/selection_routines.pyx":560 + /* "yt/geometry/selection_routines.pyx":552 * cdef int i * cdef np.float64_t pos[3] * _ensure_code(x) # <<<<<<<<<<<<<< * _ensure_code(y) * _ensure_code(z) */ - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":561 + /* "yt/geometry/selection_routines.pyx":553 * cdef np.float64_t pos[3] * _ensure_code(x) * _ensure_code(y) # <<<<<<<<<<<<<< * _ensure_code(z) * with nogil: */ - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_y)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_y)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":562 + /* "yt/geometry/selection_routines.pyx":554 * _ensure_code(x) * _ensure_code(y) * _ensure_code(z) # <<<<<<<<<<<<<< * with nogil: * if radius == 0.0 : */ - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_z)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_z)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":563 + /* "yt/geometry/selection_routines.pyx":555 * _ensure_code(y) * _ensure_code(z) * with nogil: # <<<<<<<<<<<<<< @@ -11932,10 +12701,11 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/geometry/selection_routines.pyx":564 + /* "yt/geometry/selection_routines.pyx":556 * _ensure_code(z) * with nogil: * if radius == 0.0 : # <<<<<<<<<<<<<< @@ -11945,7 +12715,7 @@ __pyx_t_2 = ((__pyx_v_radius == 0.0) != 0); if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pyx":565 + /* "yt/geometry/selection_routines.pyx":557 * with nogil: * if radius == 0.0 : * for i in range(x.shape[0]): # <<<<<<<<<<<<<< @@ -11956,7 +12726,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":566 + /* "yt/geometry/selection_routines.pyx":558 * if radius == 0.0 : * for i in range(x.shape[0]): * pos[0] = x[i] # <<<<<<<<<<<<<< @@ -11964,9 +12734,9 @@ * pos[2] = z[i] */ __pyx_t_5 = __pyx_v_i; - (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_x.diminfo[0].strides)); + (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_x.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":567 + /* "yt/geometry/selection_routines.pyx":559 * for i in range(x.shape[0]): * pos[0] = x[i] * pos[1] = y[i] # <<<<<<<<<<<<<< @@ -11974,9 +12744,9 @@ * count += self.select_point(pos) */ __pyx_t_6 = __pyx_v_i; - (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_y.diminfo[0].strides)); + (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_y.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":568 + /* "yt/geometry/selection_routines.pyx":560 * pos[0] = x[i] * pos[1] = y[i] * pos[2] = z[i] # <<<<<<<<<<<<<< @@ -11984,9 +12754,9 @@ * else : */ __pyx_t_7 = __pyx_v_i; - (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_z.diminfo[0].strides)); + (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_z.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":569 + /* "yt/geometry/selection_routines.pyx":561 * pos[1] = y[i] * pos[2] = z[i] * count += self.select_point(pos) # <<<<<<<<<<<<<< @@ -11996,7 +12766,7 @@ __pyx_v_count = (__pyx_v_count + ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_point(__pyx_v_self, __pyx_v_pos)); } - /* "yt/geometry/selection_routines.pyx":564 + /* "yt/geometry/selection_routines.pyx":556 * _ensure_code(z) * with nogil: * if radius == 0.0 : # <<<<<<<<<<<<<< @@ -12006,7 +12776,7 @@ goto __pyx_L6; } - /* "yt/geometry/selection_routines.pyx":571 + /* "yt/geometry/selection_routines.pyx":563 * count += self.select_point(pos) * else : * for i in range(x.shape[0]): # <<<<<<<<<<<<<< @@ -12018,7 +12788,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":572 + /* "yt/geometry/selection_routines.pyx":564 * else : * for i in range(x.shape[0]): * pos[0] = x[i] # <<<<<<<<<<<<<< @@ -12026,9 +12796,9 @@ * pos[2] = z[i] */ __pyx_t_8 = __pyx_v_i; - (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides)); + (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":573 + /* "yt/geometry/selection_routines.pyx":565 * for i in range(x.shape[0]): * pos[0] = x[i] * pos[1] = y[i] # <<<<<<<<<<<<<< @@ -12036,9 +12806,9 @@ * count += self.select_sphere(pos, radius) */ __pyx_t_9 = __pyx_v_i; - (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_y.diminfo[0].strides)); + (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_y.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":574 + /* "yt/geometry/selection_routines.pyx":566 * pos[0] = x[i] * pos[1] = y[i] * pos[2] = z[i] # <<<<<<<<<<<<<< @@ -12046,9 +12816,9 @@ * return count */ __pyx_t_10 = __pyx_v_i; - (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_z.diminfo[0].strides)); + (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_z.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":575 + /* "yt/geometry/selection_routines.pyx":567 * pos[1] = y[i] * pos[2] = z[i] * count += self.select_sphere(pos, radius) # <<<<<<<<<<<<<< @@ -12061,7 +12831,7 @@ __pyx_L6:; } - /* "yt/geometry/selection_routines.pyx":563 + /* "yt/geometry/selection_routines.pyx":555 * _ensure_code(y) * _ensure_code(z) * with nogil: # <<<<<<<<<<<<<< @@ -12071,6 +12841,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; @@ -12079,7 +12850,7 @@ } } - /* "yt/geometry/selection_routines.pyx":576 + /* "yt/geometry/selection_routines.pyx":568 * pos[2] = z[i] * count += self.select_sphere(pos, radius) * return count # <<<<<<<<<<<<<< @@ -12087,18 +12858,18 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":553 + /* "yt/geometry/selection_routines.pyx":545 * @cython.wraparound(False) * @cython.cdivision(True) - * def count_points(self, np.ndarray[anyfloat, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] y, - * np.ndarray[anyfloat, ndim=1] z, + * def count_points(self, np.ndarray[floating, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] y, + * np.ndarray[floating, ndim=1] z, */ /* function exit code */ @@ -12125,12 +12896,12 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":581 +/* "yt/geometry/selection_routines.pyx":573 * @cython.wraparound(False) * @cython.cdivision(True) - * def select_points(self, np.ndarray[anyfloat, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] y, - * np.ndarray[anyfloat, ndim=1] z, + * def select_points(self, np.ndarray[floating, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] y, + * np.ndarray[floating, ndim=1] z, */ /* Python wrapper */ @@ -12151,8 +12922,11 @@ 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; } @@ -12161,19 +12935,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, 1); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, 1); __PYX_ERR(0, 573, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, 2); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, 2); __PYX_ERR(0, 573, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 581, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 573, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -12188,7 +12964,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 573, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -12203,174 +12979,154 @@ static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_16select_points(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) { PyObject *__pyx_v_dest_sig = NULL; + Py_ssize_t __pyx_v_i; PyTypeObject *__pyx_v_ndarray = 0; - PyObject *__pyx_v_numpy = NULL; __Pyx_memviewslice __pyx_v_memslice; Py_ssize_t __pyx_v_itemsize; CYTHON_UNUSED int __pyx_v_dtype_signed; char __pyx_v_kind; + int __pyx_v_arg_is_pythran_compatible; PyObject *__pyx_v_arg = NULL; PyObject *__pyx_v_dtype = NULL; PyObject *__pyx_v_arg_base = NULL; + PyObject *__pyx_v_byteorder = NULL; + PyObject *__pyx_v_cur_stride = NULL; + PyObject *__pyx_v_dim = NULL; + PyObject *__pyx_v_stride = NULL; PyObject *__pyx_v_candidates = NULL; PyObject *__pyx_v_sig = NULL; int __pyx_v_match_found; - PyObject *__pyx_v_src_type = NULL; + PyObject *__pyx_v_src_sig = NULL; PyObject *__pyx_v_dst_type = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; + long __pyx_t_7; + int __pyx_t_8; PyObject *__pyx_t_9 = NULL; - Py_ssize_t __pyx_t_10; - long __pyx_t_11; - __Pyx_memviewslice __pyx_t_12; - Py_ssize_t __pyx_t_13; - int __pyx_t_14; + PyObject *(*__pyx_t_10)(PyObject *); + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + __Pyx_memviewslice __pyx_t_14; Py_ssize_t __pyx_t_15; - PyObject *(*__pyx_t_16)(PyObject *); - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - PyObject *(*__pyx_t_20)(PyObject *); - int __pyx_t_21; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; __Pyx_RefNannySetupContext("select_points", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyList_SET_ITEM(__pyx_t_1, 0, Py_None); __pyx_v_dest_sig = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = (__pyx_v_kwargs == Py_None); - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_v_kwargs != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; } - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - /*try:*/ { - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_numpy = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 581, __pyx_L4_error) - __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); - __pyx_t_1 = 0; - } - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L11_try_end; - __pyx_L4_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); - if (__pyx_t_7) { - __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 581, __pyx_L6_except_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(Py_None); - __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L5_exception_handled; - } - goto __pyx_L6_except_error; - __pyx_L6_except_error:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); - goto __pyx_L1_error; - __pyx_L5_exception_handled:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); - __pyx_L11_try_end:; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_3 = ((!__pyx_t_4) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + __Pyx_INCREF(Py_None); + __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); + __pyx_t_1 = 0; __pyx_v_itemsize = -1L; + __pyx_v_arg_is_pythran_compatible = 0; if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 581, __pyx_L1_error) + __PYX_ERR(0, 573, __pyx_L1_error) } - __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 581, __pyx_L1_error) - __pyx_t_3 = ((1 < __pyx_t_10) != 0); - if (__pyx_t_3) { + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_2 = ((1 < __pyx_t_5) != 0); + if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 581, __pyx_L1_error) + __PYX_ERR(0, 573, __pyx_L1_error) } - __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 1); - __Pyx_INCREF(__pyx_t_9); - __pyx_v_arg = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L14; + __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_arg = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6; + } + __pyx_t_3 = (__pyx_v_kwargs != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L7_bool_binop_done; } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 581, __pyx_L1_error) + __PYX_ERR(0, 573, __pyx_L1_error) } - __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_x, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 581, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_x, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 581, __pyx_L1_error) + __PYX_ERR(0, 573, __pyx_L1_error) } - __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_v_arg = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L14; + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_arg = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6; } /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 581, __pyx_L1_error) + __PYX_ERR(0, 573, __pyx_L1_error) } - __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 581, __pyx_L1_error) - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_int_5); + __Pyx_GIVEREF(__pyx_int_5); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_5); + __Pyx_INCREF(__pyx_n_s_s); + __Pyx_GIVEREF(__pyx_n_s_s); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_s); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 573, __pyx_L1_error) } - __pyx_L14:; + __pyx_L6:; while (1) { __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None)); __pyx_t_3 = (__pyx_t_2 != 0); @@ -12378,93 +13134,293 @@ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_dtype = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L18; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_dtype = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_arg_is_pythran_compatible = 1; + goto __pyx_L12; } __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_arg_base = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_arg_base = __pyx_t_1; + __pyx_t_1 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_dtype = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L19; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_dtype = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L13; } /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_dtype = Py_None; } - __pyx_L19:; - goto __pyx_L18; + __pyx_L13:; + goto __pyx_L12; } /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_dtype = Py_None; } - __pyx_L18:; + __pyx_L12:; __pyx_v_itemsize = -1L; __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_itemsize = __pyx_t_10; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_kind = __pyx_t_11; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_itemsize = __pyx_t_5; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_1); if (unlikely(__pyx_t_7 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_kind = __pyx_t_7; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_byteorder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_byteorder = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_byteorder, __pyx_kp_s__5, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_8 = __Pyx_Is_Little_Endian(); + __pyx_t_2 = ((!(__pyx_t_8 != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L16_bool_binop_done:; + if (__pyx_t_3) { + __pyx_v_arg_is_pythran_compatible = 0; + } + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_byteorder, __pyx_kp_s__6, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_8 = __Pyx_Is_Little_Endian(); + __pyx_t_2 = (__pyx_t_8 != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L19_bool_binop_done:; + if (__pyx_t_3) { + __pyx_v_arg_is_pythran_compatible = 0; + } __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); + __pyx_t_3 = (__pyx_v_arg_is_pythran_compatible != 0); + if (__pyx_t_3) { + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cur_stride = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_reversed, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_strides); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_reversed, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_9 = __pyx_t_6; __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 573, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_9))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_10(__pyx_t_9); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 573, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 573, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_11 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_11); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L24_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L24_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_unpacking_done; + __pyx_L24_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_L25_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_6 = PyObject_RichCompare(__pyx_v_stride, __pyx_v_cur_stride, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { + __pyx_v_arg_is_pythran_compatible = 0; + goto __pyx_L23_break; + } + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_cur_stride, __pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_cur_stride, __pyx_t_6); + __pyx_t_6 = 0; + } + /*else*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L28_bool_binop_done; + } + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_11, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = __pyx_t_2; + __pyx_L28_bool_binop_done:; + __pyx_v_arg_is_pythran_compatible = (!__pyx_t_3); + } + __pyx_L23_break:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } switch (__pyx_v_kind) { case 'i': case 'u': break; case 'f': - __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0); + __pyx_t_2 = (((sizeof(float)) == __pyx_v_itemsize) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L22_bool_binop_done; + goto __pyx_L31_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L22_bool_binop_done:; + __pyx_L31_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 581, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + goto __pyx_L10_break; } - __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize) != 0); + __pyx_t_2 = (((sizeof(double)) == __pyx_v_itemsize) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L25_bool_binop_done; + goto __pyx_L34_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L25_bool_binop_done:; + __pyx_L34_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 581, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + goto __pyx_L10_break; } break; case 'c': @@ -12479,19 +13435,19 @@ if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L28_bool_binop_done; + goto __pyx_L37_bool_binop_done; } - __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0); + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(float))) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L28_bool_binop_done:; + __pyx_L37_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg); - __pyx_v_memslice = __pyx_t_12; + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg); + __pyx_v_memslice = __pyx_t_14; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 581, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); @@ -12501,242 +13457,150 @@ if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L32_bool_binop_done; + goto __pyx_L41_bool_binop_done; } - __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0); + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(double))) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L32_bool_binop_done:; + __pyx_L41_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg); - __pyx_v_memslice = __pyx_t_12; + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg); + __pyx_v_memslice = __pyx_t_14; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 581, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 581, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + goto __pyx_L10_break; } - __pyx_L16_break:; - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_candidates = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_10 = 0; + __pyx_L10_break:; + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_candidates = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_5 = 0; if (unlikely(((PyObject *)__pyx_v_signatures) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 581, __pyx_L1_error) + __PYX_ERR(0, 573, __pyx_L1_error) } - __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); - __pyx_t_8 = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_15), (&__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __pyx_t_9 = __pyx_t_6; + __pyx_t_6 = 0; while (1) { - __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7); - if (unlikely(__pyx_t_14 == 0)) break; - if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_15, &__pyx_t_5, &__pyx_t_6, NULL, NULL, __pyx_t_8); + if (unlikely(__pyx_t_16 == 0)) break; + if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_6); + __pyx_t_6 = 0; __pyx_v_match_found = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); - __Pyx_INCREF(__pyx_v_dest_sig); - __Pyx_GIVEREF(__pyx_v_dest_sig); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0; - __pyx_t_16 = NULL; - } else { - __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 581, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_16)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { - if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 581, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 581, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_16(__pyx_t_9); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 581, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 581, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_17 = PyList_GET_ITEM(sequence, 0); - __pyx_t_18 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_17); - __Pyx_INCREF(__pyx_t_18); - #else - __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_18); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_19); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; - index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L39_unpacking_failed; - __Pyx_GOTREF(__pyx_t_17); - index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L39_unpacking_failed; - __Pyx_GOTREF(__pyx_t_18); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 581, __pyx_L1_error) - __pyx_t_20 = NULL; - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - goto __pyx_L40_unpacking_done; - __pyx_L39_unpacking_failed:; - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_20 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 581, __pyx_L1_error) - __pyx_L40_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17); - __pyx_t_17 = 0; - __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18); - __pyx_t_18 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_17 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 573, __pyx_L1_error) + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_i = __pyx_t_18; + __pyx_t_11 = PyList_GET_ITEM(__pyx_v_dest_sig, __pyx_v_i); + __Pyx_INCREF(__pyx_t_11); + __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_11); + __pyx_t_11 = 0; __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_11, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; - goto __pyx_L42; + goto __pyx_L49; } /*else*/ { __pyx_v_match_found = 0; - goto __pyx_L38_break; + goto __pyx_L47_break; } - __pyx_L42:; + __pyx_L49:; } } - __pyx_L38_break:; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_L47_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 573, __pyx_L1_error) } } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __PYX_ERR(0, 573, __pyx_L1_error) } - __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 581, __pyx_L1_error) - __pyx_t_3 = ((__pyx_t_13 > 1) != 0); + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_15 > 1) != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __PYX_ERR(0, 573, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(((PyObject *)__pyx_v_signatures) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 581, __pyx_L1_error) + __PYX_ERR(0, 573, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; goto __pyx_L0; } /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_17); - __Pyx_XDECREF(__pyx_t_18); - __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dest_sig); __Pyx_XDECREF(__pyx_v_ndarray); - __Pyx_XDECREF(__pyx_v_numpy); __Pyx_XDECREF(__pyx_v_arg); __Pyx_XDECREF(__pyx_v_dtype); __Pyx_XDECREF(__pyx_v_arg_base); + __Pyx_XDECREF(__pyx_v_byteorder); + __Pyx_XDECREF(__pyx_v_cur_stride); + __Pyx_XDECREF(__pyx_v_dim); + __Pyx_XDECREF(__pyx_v_stride); __Pyx_XDECREF(__pyx_v_candidates); __Pyx_XDECREF(__pyx_v_sig); - __Pyx_XDECREF(__pyx_v_src_type); + __Pyx_XDECREF(__pyx_v_src_sig); __Pyx_XDECREF(__pyx_v_dst_type); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_XGIVEREF(__pyx_r); @@ -12763,9 +13627,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -12774,24 +13642,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, 1); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, 1); __PYX_ERR(0, 573, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, 2); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, 2); __PYX_ERR(0, 573, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, 3); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, 3); __PYX_ERR(0, 573, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_points") < 0)) __PYX_ERR(0, 581, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_points") < 0)) __PYX_ERR(0, 573, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -12804,19 +13675,19 @@ __pyx_v_x = ((PyArrayObject *)values[0]); __pyx_v_y = ((PyArrayObject *)values[1]); __pyx_v_z = ((PyArrayObject *)values[2]); - __pyx_v_radius = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_radius == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) + __pyx_v_radius = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_radius == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 576, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 573, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.select_points", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 581, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 582, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 583, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 573, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 574, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 575, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_30select_points(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_z, __pyx_v_radius); /* function exit code */ @@ -12883,22 +13754,22 @@ __pyx_pybuffernd_z.rcbuffer = &__pyx_pybuffer_z; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 581, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 573, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 581, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 573, __pyx_L1_error) } __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 581, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 573, __pyx_L1_error) } __pyx_pybuffernd_z.diminfo[0].strides = __pyx_pybuffernd_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z.diminfo[0].shape = __pyx_pybuffernd_z.rcbuffer->pybuffer.shape[0]; - /* "yt/geometry/selection_routines.pyx":585 - * np.ndarray[anyfloat, ndim=1] z, + /* "yt/geometry/selection_routines.pyx":577 + * np.ndarray[floating, ndim=1] z, * np.float64_t radius): * cdef int count = 0 # <<<<<<<<<<<<<< * cdef int i @@ -12906,34 +13777,34 @@ */ __pyx_v_count = 0; - /* "yt/geometry/selection_routines.pyx":589 + /* "yt/geometry/selection_routines.pyx":581 * cdef np.float64_t pos[3] * cdef np.ndarray[np.uint8_t, ndim=1] mask * mask = np.empty(x.shape[0], dtype='uint8') # <<<<<<<<<<<<<< * _ensure_code(x) * _ensure_code(y) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __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, 589, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 589, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __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_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, 589, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 581, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -12949,46 +13820,46 @@ } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 589, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 581, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_mask = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":590 + /* "yt/geometry/selection_routines.pyx":582 * cdef np.ndarray[np.uint8_t, ndim=1] mask * mask = np.empty(x.shape[0], dtype='uint8') * _ensure_code(x) # <<<<<<<<<<<<<< * _ensure_code(y) * _ensure_code(z) */ - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":591 + /* "yt/geometry/selection_routines.pyx":583 * mask = np.empty(x.shape[0], dtype='uint8') * _ensure_code(x) * _ensure_code(y) # <<<<<<<<<<<<<< * _ensure_code(z) * */ - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":592 + /* "yt/geometry/selection_routines.pyx":584 * _ensure_code(x) * _ensure_code(y) * _ensure_code(z) # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_z)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_z)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":600 + /* "yt/geometry/selection_routines.pyx":592 * # between a ray and a point is null, while ray and a * # sphere is allowed) * with nogil: # <<<<<<<<<<<<<< @@ -12999,10 +13870,11 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/geometry/selection_routines.pyx":601 + /* "yt/geometry/selection_routines.pyx":593 * # sphere is allowed) * with nogil: * if radius == 0.0 : # <<<<<<<<<<<<<< @@ -13012,7 +13884,7 @@ __pyx_t_10 = ((__pyx_v_radius == 0.0) != 0); if (__pyx_t_10) { - /* "yt/geometry/selection_routines.pyx":602 + /* "yt/geometry/selection_routines.pyx":594 * with nogil: * if radius == 0.0 : * for i in range(x.shape[0]) : # <<<<<<<<<<<<<< @@ -13023,7 +13895,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_11; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":603 + /* "yt/geometry/selection_routines.pyx":595 * if radius == 0.0 : * for i in range(x.shape[0]) : * pos[0] = x[i] # <<<<<<<<<<<<<< @@ -13031,9 +13903,9 @@ * pos[2] = z[i] */ __pyx_t_12 = __pyx_v_i; - (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_x.diminfo[0].strides)); + (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_x.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":604 + /* "yt/geometry/selection_routines.pyx":596 * for i in range(x.shape[0]) : * pos[0] = x[i] * pos[1] = y[i] # <<<<<<<<<<<<<< @@ -13041,9 +13913,9 @@ * mask[i] = self.select_point(pos) */ __pyx_t_13 = __pyx_v_i; - (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_y.diminfo[0].strides)); + (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_y.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":605 + /* "yt/geometry/selection_routines.pyx":597 * pos[0] = x[i] * pos[1] = y[i] * pos[2] = z[i] # <<<<<<<<<<<<<< @@ -13051,9 +13923,9 @@ * count += mask[i] */ __pyx_t_14 = __pyx_v_i; - (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_z.diminfo[0].strides)); + (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_z.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":606 + /* "yt/geometry/selection_routines.pyx":598 * pos[1] = y[i] * pos[2] = z[i] * mask[i] = self.select_point(pos) # <<<<<<<<<<<<<< @@ -13063,7 +13935,7 @@ __pyx_t_15 = __pyx_v_i; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides) = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_point(__pyx_v_self, __pyx_v_pos); - /* "yt/geometry/selection_routines.pyx":607 + /* "yt/geometry/selection_routines.pyx":599 * pos[2] = z[i] * mask[i] = self.select_point(pos) * count += mask[i] # <<<<<<<<<<<<<< @@ -13074,7 +13946,7 @@ __pyx_v_count = (__pyx_v_count + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[0].strides))); } - /* "yt/geometry/selection_routines.pyx":601 + /* "yt/geometry/selection_routines.pyx":593 * # sphere is allowed) * with nogil: * if radius == 0.0 : # <<<<<<<<<<<<<< @@ -13084,7 +13956,7 @@ goto __pyx_L6; } - /* "yt/geometry/selection_routines.pyx":609 + /* "yt/geometry/selection_routines.pyx":601 * count += mask[i] * else : * for i in range(x.shape[0]): # <<<<<<<<<<<<<< @@ -13096,7 +13968,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_11; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":610 + /* "yt/geometry/selection_routines.pyx":602 * else : * for i in range(x.shape[0]): * pos[0] = x[i] # <<<<<<<<<<<<<< @@ -13104,9 +13976,9 @@ * pos[2] = z[i] */ __pyx_t_17 = __pyx_v_i; - (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides)); + (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":611 + /* "yt/geometry/selection_routines.pyx":603 * for i in range(x.shape[0]): * pos[0] = x[i] * pos[1] = y[i] # <<<<<<<<<<<<<< @@ -13114,9 +13986,9 @@ * mask[i] = self.select_sphere(pos, radius) */ __pyx_t_18 = __pyx_v_i; - (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_y.diminfo[0].strides)); + (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_y.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":612 + /* "yt/geometry/selection_routines.pyx":604 * pos[0] = x[i] * pos[1] = y[i] * pos[2] = z[i] # <<<<<<<<<<<<<< @@ -13124,9 +13996,9 @@ * count += mask[i] */ __pyx_t_19 = __pyx_v_i; - (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_z.diminfo[0].strides)); + (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_z.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":613 + /* "yt/geometry/selection_routines.pyx":605 * pos[1] = y[i] * pos[2] = z[i] * mask[i] = self.select_sphere(pos, radius) # <<<<<<<<<<<<<< @@ -13136,7 +14008,7 @@ __pyx_t_20 = __pyx_v_i; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_mask.diminfo[0].strides) = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_sphere(__pyx_v_self, __pyx_v_pos, __pyx_v_radius); - /* "yt/geometry/selection_routines.pyx":614 + /* "yt/geometry/selection_routines.pyx":606 * pos[2] = z[i] * mask[i] = self.select_sphere(pos, radius) * count += mask[i] # <<<<<<<<<<<<<< @@ -13150,7 +14022,7 @@ __pyx_L6:; } - /* "yt/geometry/selection_routines.pyx":600 + /* "yt/geometry/selection_routines.pyx":592 * # between a ray and a point is null, while ray and a * # sphere is allowed) * with nogil: # <<<<<<<<<<<<<< @@ -13160,6 +14032,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; @@ -13168,7 +14041,7 @@ } } - /* "yt/geometry/selection_routines.pyx":615 + /* "yt/geometry/selection_routines.pyx":607 * mask[i] = self.select_sphere(pos, radius) * count += mask[i] * if count == 0: return None # <<<<<<<<<<<<<< @@ -13183,7 +14056,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":616 + /* "yt/geometry/selection_routines.pyx":608 * count += mask[i] * if count == 0: return None * return mask.view("bool") # <<<<<<<<<<<<<< @@ -13191,21 +14064,21 @@ * def __hash__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":581 + /* "yt/geometry/selection_routines.pyx":573 * @cython.wraparound(False) * @cython.cdivision(True) - * def select_points(self, np.ndarray[anyfloat, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] y, - * np.ndarray[anyfloat, ndim=1] z, + * def select_points(self, np.ndarray[floating, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] y, + * np.ndarray[floating, ndim=1] z, */ /* function exit code */ @@ -13257,9 +14130,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -13268,24 +14145,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, 1); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, 1); __PYX_ERR(0, 573, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, 2); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, 2); __PYX_ERR(0, 573, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, 3); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, 3); __PYX_ERR(0, 573, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_points") < 0)) __PYX_ERR(0, 581, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_points") < 0)) __PYX_ERR(0, 573, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -13298,19 +14178,19 @@ __pyx_v_x = ((PyArrayObject *)values[0]); __pyx_v_y = ((PyArrayObject *)values[1]); __pyx_v_z = ((PyArrayObject *)values[2]); - __pyx_v_radius = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_radius == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) + __pyx_v_radius = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_radius == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 576, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_points", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 573, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.SelectorObject.select_points", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 581, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 582, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 583, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 573, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 574, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 575, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_32select_points(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_z, __pyx_v_radius); /* function exit code */ @@ -13377,22 +14257,22 @@ __pyx_pybuffernd_z.rcbuffer = &__pyx_pybuffer_z; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 581, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 573, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 581, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 573, __pyx_L1_error) } __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 581, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 573, __pyx_L1_error) } __pyx_pybuffernd_z.diminfo[0].strides = __pyx_pybuffernd_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z.diminfo[0].shape = __pyx_pybuffernd_z.rcbuffer->pybuffer.shape[0]; - /* "yt/geometry/selection_routines.pyx":585 - * np.ndarray[anyfloat, ndim=1] z, + /* "yt/geometry/selection_routines.pyx":577 + * np.ndarray[floating, ndim=1] z, * np.float64_t radius): * cdef int count = 0 # <<<<<<<<<<<<<< * cdef int i @@ -13400,34 +14280,34 @@ */ __pyx_v_count = 0; - /* "yt/geometry/selection_routines.pyx":589 + /* "yt/geometry/selection_routines.pyx":581 * cdef np.float64_t pos[3] * cdef np.ndarray[np.uint8_t, ndim=1] mask * mask = np.empty(x.shape[0], dtype='uint8') # <<<<<<<<<<<<<< * _ensure_code(x) * _ensure_code(y) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __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, 589, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 589, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __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_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, 589, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 581, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -13443,46 +14323,46 @@ } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 589, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 581, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_mask = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":590 + /* "yt/geometry/selection_routines.pyx":582 * cdef np.ndarray[np.uint8_t, ndim=1] mask * mask = np.empty(x.shape[0], dtype='uint8') * _ensure_code(x) # <<<<<<<<<<<<<< * _ensure_code(y) * _ensure_code(z) */ - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":591 + /* "yt/geometry/selection_routines.pyx":583 * mask = np.empty(x.shape[0], dtype='uint8') * _ensure_code(x) * _ensure_code(y) # <<<<<<<<<<<<<< * _ensure_code(z) * */ - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":592 + /* "yt/geometry/selection_routines.pyx":584 * _ensure_code(x) * _ensure_code(y) * _ensure_code(z) # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_z)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_z)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":600 + /* "yt/geometry/selection_routines.pyx":592 * # between a ray and a point is null, while ray and a * # sphere is allowed) * with nogil: # <<<<<<<<<<<<<< @@ -13493,10 +14373,11 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/geometry/selection_routines.pyx":601 + /* "yt/geometry/selection_routines.pyx":593 * # sphere is allowed) * with nogil: * if radius == 0.0 : # <<<<<<<<<<<<<< @@ -13506,7 +14387,7 @@ __pyx_t_10 = ((__pyx_v_radius == 0.0) != 0); if (__pyx_t_10) { - /* "yt/geometry/selection_routines.pyx":602 + /* "yt/geometry/selection_routines.pyx":594 * with nogil: * if radius == 0.0 : * for i in range(x.shape[0]) : # <<<<<<<<<<<<<< @@ -13517,7 +14398,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_11; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":603 + /* "yt/geometry/selection_routines.pyx":595 * if radius == 0.0 : * for i in range(x.shape[0]) : * pos[0] = x[i] # <<<<<<<<<<<<<< @@ -13525,9 +14406,9 @@ * pos[2] = z[i] */ __pyx_t_12 = __pyx_v_i; - (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_x.diminfo[0].strides)); + (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_x.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":604 + /* "yt/geometry/selection_routines.pyx":596 * for i in range(x.shape[0]) : * pos[0] = x[i] * pos[1] = y[i] # <<<<<<<<<<<<<< @@ -13535,9 +14416,9 @@ * mask[i] = self.select_point(pos) */ __pyx_t_13 = __pyx_v_i; - (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_y.diminfo[0].strides)); + (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_y.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":605 + /* "yt/geometry/selection_routines.pyx":597 * pos[0] = x[i] * pos[1] = y[i] * pos[2] = z[i] # <<<<<<<<<<<<<< @@ -13545,9 +14426,9 @@ * count += mask[i] */ __pyx_t_14 = __pyx_v_i; - (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_z.diminfo[0].strides)); + (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_z.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":606 + /* "yt/geometry/selection_routines.pyx":598 * pos[1] = y[i] * pos[2] = z[i] * mask[i] = self.select_point(pos) # <<<<<<<<<<<<<< @@ -13557,7 +14438,7 @@ __pyx_t_15 = __pyx_v_i; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides) = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_point(__pyx_v_self, __pyx_v_pos); - /* "yt/geometry/selection_routines.pyx":607 + /* "yt/geometry/selection_routines.pyx":599 * pos[2] = z[i] * mask[i] = self.select_point(pos) * count += mask[i] # <<<<<<<<<<<<<< @@ -13568,7 +14449,7 @@ __pyx_v_count = (__pyx_v_count + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[0].strides))); } - /* "yt/geometry/selection_routines.pyx":601 + /* "yt/geometry/selection_routines.pyx":593 * # sphere is allowed) * with nogil: * if radius == 0.0 : # <<<<<<<<<<<<<< @@ -13578,7 +14459,7 @@ goto __pyx_L6; } - /* "yt/geometry/selection_routines.pyx":609 + /* "yt/geometry/selection_routines.pyx":601 * count += mask[i] * else : * for i in range(x.shape[0]): # <<<<<<<<<<<<<< @@ -13590,7 +14471,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_11; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":610 + /* "yt/geometry/selection_routines.pyx":602 * else : * for i in range(x.shape[0]): * pos[0] = x[i] # <<<<<<<<<<<<<< @@ -13598,9 +14479,9 @@ * pos[2] = z[i] */ __pyx_t_17 = __pyx_v_i; - (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides)); + (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":611 + /* "yt/geometry/selection_routines.pyx":603 * for i in range(x.shape[0]): * pos[0] = x[i] * pos[1] = y[i] # <<<<<<<<<<<<<< @@ -13608,9 +14489,9 @@ * mask[i] = self.select_sphere(pos, radius) */ __pyx_t_18 = __pyx_v_i; - (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_y.diminfo[0].strides)); + (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_y.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":612 + /* "yt/geometry/selection_routines.pyx":604 * pos[0] = x[i] * pos[1] = y[i] * pos[2] = z[i] # <<<<<<<<<<<<<< @@ -13618,9 +14499,9 @@ * count += mask[i] */ __pyx_t_19 = __pyx_v_i; - (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_z.diminfo[0].strides)); + (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_z.diminfo[0].strides)); - /* "yt/geometry/selection_routines.pyx":613 + /* "yt/geometry/selection_routines.pyx":605 * pos[1] = y[i] * pos[2] = z[i] * mask[i] = self.select_sphere(pos, radius) # <<<<<<<<<<<<<< @@ -13630,7 +14511,7 @@ __pyx_t_20 = __pyx_v_i; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_mask.diminfo[0].strides) = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_vtab)->select_sphere(__pyx_v_self, __pyx_v_pos, __pyx_v_radius); - /* "yt/geometry/selection_routines.pyx":614 + /* "yt/geometry/selection_routines.pyx":606 * pos[2] = z[i] * mask[i] = self.select_sphere(pos, radius) * count += mask[i] # <<<<<<<<<<<<<< @@ -13644,7 +14525,7 @@ __pyx_L6:; } - /* "yt/geometry/selection_routines.pyx":600 + /* "yt/geometry/selection_routines.pyx":592 * # between a ray and a point is null, while ray and a * # sphere is allowed) * with nogil: # <<<<<<<<<<<<<< @@ -13654,6 +14535,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; @@ -13662,7 +14544,7 @@ } } - /* "yt/geometry/selection_routines.pyx":615 + /* "yt/geometry/selection_routines.pyx":607 * mask[i] = self.select_sphere(pos, radius) * count += mask[i] * if count == 0: return None # <<<<<<<<<<<<<< @@ -13677,7 +14559,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":616 + /* "yt/geometry/selection_routines.pyx":608 * count += mask[i] * if count == 0: return None * return mask.view("bool") # <<<<<<<<<<<<<< @@ -13685,21 +14567,21 @@ * def __hash__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":581 + /* "yt/geometry/selection_routines.pyx":573 * @cython.wraparound(False) * @cython.cdivision(True) - * def select_points(self, np.ndarray[anyfloat, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] y, - * np.ndarray[anyfloat, ndim=1] z, + * def select_points(self, np.ndarray[floating, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] y, + * np.ndarray[floating, ndim=1] z, */ /* function exit code */ @@ -13732,7 +14614,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":618 +/* "yt/geometry/selection_routines.pyx":610 * return mask.view("bool") * * def __hash__(self): # <<<<<<<<<<<<<< @@ -13772,7 +14654,7 @@ __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_RefNannySetupContext("__hash__", 0); - /* "yt/geometry/selection_routines.pyx":620 + /* "yt/geometry/selection_routines.pyx":612 * def __hash__(self): * # convert data to be hashed to a byte array, which FNV algorithm expects * if self._hash_initialized == 1: # <<<<<<<<<<<<<< @@ -13782,7 +14664,7 @@ __pyx_t_1 = ((__pyx_v_self->_hash_initialized == 1) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":621 + /* "yt/geometry/selection_routines.pyx":613 * # convert data to be hashed to a byte array, which FNV algorithm expects * if self._hash_initialized == 1: * return self._hash # <<<<<<<<<<<<<< @@ -13792,7 +14674,7 @@ __pyx_r = __pyx_v_self->_hash; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":620 + /* "yt/geometry/selection_routines.pyx":612 * def __hash__(self): * # convert data to be hashed to a byte array, which FNV algorithm expects * if self._hash_initialized == 1: # <<<<<<<<<<<<<< @@ -13801,26 +14683,26 @@ */ } - /* "yt/geometry/selection_routines.pyx":622 + /* "yt/geometry/selection_routines.pyx":614 * if self._hash_initialized == 1: * return self._hash * hash_data = bytearray() # <<<<<<<<<<<<<< * for v in self._hash_vals() + self._base_hash(): * if isinstance(v, tuple): */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_hash_data = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/selection_routines.pyx":623 + /* "yt/geometry/selection_routines.pyx":615 * return self._hash * hash_data = bytearray() * for v in self._hash_vals() + self._base_hash(): # <<<<<<<<<<<<<< * if isinstance(v, tuple): * hash_data.extend(v[0].encode('ascii')) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -13833,14 +14715,14 @@ } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base_hash); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base_hash); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -13853,14 +14735,14 @@ } } if (__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __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; @@ -13868,9 +14750,9 @@ __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -13878,17 +14760,17 @@ if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 615, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 615, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -13898,7 +14780,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 623, __pyx_L1_error) + else __PYX_ERR(0, 615, __pyx_L1_error) } break; } @@ -13907,7 +14789,7 @@ __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":624 + /* "yt/geometry/selection_routines.pyx":616 * hash_data = bytearray() * for v in self._hash_vals() + self._base_hash(): * if isinstance(v, tuple): # <<<<<<<<<<<<<< @@ -13918,21 +14800,21 @@ __pyx_t_8 = (__pyx_t_1 != 0); if (__pyx_t_8) { - /* "yt/geometry/selection_routines.pyx":625 + /* "yt/geometry/selection_routines.pyx":617 * for v in self._hash_vals() + self._base_hash(): * if isinstance(v, tuple): * hash_data.extend(v[0].encode('ascii')) # <<<<<<<<<<<<<< * hash_data.extend(repr(v[1]).encode('ascii')) * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hash_data, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hash_data, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_v, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_v, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -13946,14 +14828,14 @@ } } if (!__pyx_t_9) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_5}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -13962,20 +14844,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_5}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -13983,24 +14865,24 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":626 + /* "yt/geometry/selection_routines.pyx":618 * if isinstance(v, tuple): * hash_data.extend(v[0].encode('ascii')) * hash_data.extend(repr(v[1]).encode('ascii')) # <<<<<<<<<<<<<< * else: * hash_data.extend(repr(v).encode('ascii')) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hash_data, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hash_data, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_v, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_v, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = PyObject_Repr(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_5 = PyObject_Repr(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -14014,14 +14896,14 @@ } } if (!__pyx_t_10) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_5}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -14030,20 +14912,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_5}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_4); __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, 626, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __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, 626, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -14051,7 +14933,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":624 + /* "yt/geometry/selection_routines.pyx":616 * hash_data = bytearray() * for v in self._hash_vals() + self._base_hash(): * if isinstance(v, tuple): # <<<<<<<<<<<<<< @@ -14061,7 +14943,7 @@ goto __pyx_L6; } - /* "yt/geometry/selection_routines.pyx":628 + /* "yt/geometry/selection_routines.pyx":620 * hash_data.extend(repr(v[1]).encode('ascii')) * else: * hash_data.extend(repr(v).encode('ascii')) # <<<<<<<<<<<<<< @@ -14069,14 +14951,14 @@ * self._hash = hash_value */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hash_data, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hash_data, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PyObject_Repr(__pyx_v_v); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_9 = PyObject_Repr(__pyx_v_v); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -14090,14 +14972,14 @@ } } if (!__pyx_t_5) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_9}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -14106,20 +14988,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_9}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -14129,7 +15011,7 @@ } __pyx_L6:; - /* "yt/geometry/selection_routines.pyx":623 + /* "yt/geometry/selection_routines.pyx":615 * return self._hash * hash_data = bytearray() * for v in self._hash_vals() + self._base_hash(): # <<<<<<<<<<<<<< @@ -14139,7 +15021,7 @@ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":629 + /* "yt/geometry/selection_routines.pyx":621 * else: * hash_data.extend(repr(v).encode('ascii')) * cdef np.int64_t hash_value = fnv_hash(hash_data) # <<<<<<<<<<<<<< @@ -14147,13 +15029,13 @@ * self._hash_initialized = 1 */ __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_v_hash_data); - if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 629, __pyx_L1_error) - __pyx_v_hash_value = __pyx_f_2yt_8geometry_18selection_routines_fnv_hash(__pyx_t_11); + if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 621, __pyx_L1_error) + __pyx_v_hash_value = __pyx_f_2yt_9utilities_3lib_8fnv_hash_c_fnv_hash(__pyx_t_11); __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); __pyx_t_11.memview = NULL; __pyx_t_11.data = NULL; - /* "yt/geometry/selection_routines.pyx":630 + /* "yt/geometry/selection_routines.pyx":622 * hash_data.extend(repr(v).encode('ascii')) * cdef np.int64_t hash_value = fnv_hash(hash_data) * self._hash = hash_value # <<<<<<<<<<<<<< @@ -14162,7 +15044,7 @@ */ __pyx_v_self->_hash = __pyx_v_hash_value; - /* "yt/geometry/selection_routines.pyx":631 + /* "yt/geometry/selection_routines.pyx":623 * cdef np.int64_t hash_value = fnv_hash(hash_data) * self._hash = hash_value * self._hash_initialized = 1 # <<<<<<<<<<<<<< @@ -14171,7 +15053,7 @@ */ __pyx_v_self->_hash_initialized = 1; - /* "yt/geometry/selection_routines.pyx":632 + /* "yt/geometry/selection_routines.pyx":624 * self._hash = hash_value * self._hash_initialized = 1 * return hash_value # <<<<<<<<<<<<<< @@ -14181,7 +15063,7 @@ __pyx_r = __pyx_v_hash_value; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":618 + /* "yt/geometry/selection_routines.pyx":610 * return mask.view("bool") * * def __hash__(self): # <<<<<<<<<<<<<< @@ -14208,7 +15090,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":634 +/* "yt/geometry/selection_routines.pyx":626 * return hash_value * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -14234,7 +15116,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":635 + /* "yt/geometry/selection_routines.pyx":627 * * def _hash_vals(self): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -14242,9 +15124,9 @@ * def _base_hash(self): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 635, __pyx_L1_error) + __PYX_ERR(0, 627, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":634 + /* "yt/geometry/selection_routines.pyx":626 * return hash_value * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -14261,7 +15143,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":637 +/* "yt/geometry/selection_routines.pyx":629 * raise NotImplementedError * * def _base_hash(self): # <<<<<<<<<<<<<< @@ -14297,7 +15179,7 @@ PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("_base_hash", 0); - /* "yt/geometry/selection_routines.pyx":638 + /* "yt/geometry/selection_routines.pyx":630 * * def _base_hash(self): * return (("min_level", self.min_level), # <<<<<<<<<<<<<< @@ -14305,9 +15187,9 @@ * ("overlap_cells", self.overlap_cells), */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->min_level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->min_level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_min_level); __Pyx_GIVEREF(__pyx_n_s_min_level); @@ -14316,16 +15198,16 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":639 + /* "yt/geometry/selection_routines.pyx":631 * def _base_hash(self): * return (("min_level", self.min_level), * ("max_level", self.max_level), # <<<<<<<<<<<<<< * ("overlap_cells", self.overlap_cells), * ("periodicity[0]", self.periodicity[0]), */ - __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->max_level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->max_level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_max_level); __Pyx_GIVEREF(__pyx_n_s_max_level); @@ -14334,16 +15216,16 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":640 + /* "yt/geometry/selection_routines.pyx":632 * return (("min_level", self.min_level), * ("max_level", self.max_level), * ("overlap_cells", self.overlap_cells), # <<<<<<<<<<<<<< * ("periodicity[0]", self.periodicity[0]), * ("periodicity[1]", self.periodicity[1]), */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->overlap_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->overlap_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_overlap_cells); __Pyx_GIVEREF(__pyx_n_s_overlap_cells); @@ -14352,16 +15234,16 @@ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":641 + /* "yt/geometry/selection_routines.pyx":633 * ("max_level", self.max_level), * ("overlap_cells", self.overlap_cells), * ("periodicity[0]", self.periodicity[0]), # <<<<<<<<<<<<<< * ("periodicity[1]", self.periodicity[1]), * ("periodicity[2]", self.periodicity[2]), */ - __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->periodicity[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->periodicity[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_periodicity_0); __Pyx_GIVEREF(__pyx_kp_s_periodicity_0); @@ -14370,16 +15252,16 @@ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":642 + /* "yt/geometry/selection_routines.pyx":634 * ("overlap_cells", self.overlap_cells), * ("periodicity[0]", self.periodicity[0]), * ("periodicity[1]", self.periodicity[1]), # <<<<<<<<<<<<<< * ("periodicity[2]", self.periodicity[2]), * ("domain_width[0]", self.domain_width[0]), */ - __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->periodicity[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->periodicity[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_kp_s_periodicity_1); __Pyx_GIVEREF(__pyx_kp_s_periodicity_1); @@ -14388,16 +15270,16 @@ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":643 + /* "yt/geometry/selection_routines.pyx":635 * ("periodicity[0]", self.periodicity[0]), * ("periodicity[1]", self.periodicity[1]), * ("periodicity[2]", self.periodicity[2]), # <<<<<<<<<<<<<< * ("domain_width[0]", self.domain_width[0]), * ("domain_width[1]", self.domain_width[1]), */ - __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->periodicity[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->periodicity[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_kp_s_periodicity_2); __Pyx_GIVEREF(__pyx_kp_s_periodicity_2); @@ -14406,16 +15288,16 @@ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":644 + /* "yt/geometry/selection_routines.pyx":636 * ("periodicity[1]", self.periodicity[1]), * ("periodicity[2]", self.periodicity[2]), * ("domain_width[0]", self.domain_width[0]), # <<<<<<<<<<<<<< * ("domain_width[1]", self.domain_width[1]), * ("domain_width[2]", self.domain_width[2])) */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->domain_width[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->domain_width[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_kp_s_domain_width_0); __Pyx_GIVEREF(__pyx_kp_s_domain_width_0); @@ -14424,16 +15306,16 @@ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":645 + /* "yt/geometry/selection_routines.pyx":637 * ("periodicity[2]", self.periodicity[2]), * ("domain_width[0]", self.domain_width[0]), * ("domain_width[1]", self.domain_width[1]), # <<<<<<<<<<<<<< * ("domain_width[2]", self.domain_width[2])) * */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->domain_width[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->domain_width[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 645, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_kp_s_domain_width_1); __Pyx_GIVEREF(__pyx_kp_s_domain_width_1); @@ -14442,16 +15324,16 @@ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":646 + /* "yt/geometry/selection_routines.pyx":638 * ("domain_width[0]", self.domain_width[0]), * ("domain_width[1]", self.domain_width[1]), * ("domain_width[2]", self.domain_width[2])) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->domain_width[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->domain_width[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_kp_s_domain_width_2); __Pyx_GIVEREF(__pyx_kp_s_domain_width_2); @@ -14460,14 +15342,14 @@ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":638 + /* "yt/geometry/selection_routines.pyx":630 * * def _base_hash(self): * return (("min_level", self.min_level), # <<<<<<<<<<<<<< * ("max_level", self.max_level), * ("overlap_cells", self.overlap_cells), */ - __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -14500,7 +15382,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":637 + /* "yt/geometry/selection_routines.pyx":629 * raise NotImplementedError * * def _base_hash(self): # <<<<<<<<<<<<<< @@ -14528,7 +15410,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pxd":34 +/* "yt/geometry/selection_routines.pxd":30 * * cdef class SelectorObject: * cdef public np.int32_t min_level # <<<<<<<<<<<<<< @@ -14555,7 +15437,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->min_level); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 34, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->min_level); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14590,7 +15472,7 @@ __Pyx_RefNannyDeclarations __pyx_t_5numpy_int32_t __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 34, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->min_level = __pyx_t_1; /* function exit code */ @@ -14604,7 +15486,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pxd":35 +/* "yt/geometry/selection_routines.pxd":31 * cdef class SelectorObject: * cdef public np.int32_t min_level * cdef public np.int32_t max_level # <<<<<<<<<<<<<< @@ -14631,7 +15513,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->max_level); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_self->max_level); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14666,7 +15548,7 @@ __Pyx_RefNannyDeclarations __pyx_t_5numpy_int32_t __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 35, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error) __pyx_v_self->max_level = __pyx_t_1; /* function exit code */ @@ -14680,7 +15562,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":652 +/* "(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_2yt_8geometry_18selection_routines_14SelectorObject_37__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_37__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_2yt_8geometry_18selection_routines_14SelectorObject_36__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_36__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__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__22, 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("yt.geometry.selection_routines.SelectorObject.__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_2yt_8geometry_18selection_routines_14SelectorObject_39__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_39__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_2yt_8geometry_18selection_routines_14SelectorObject_38__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14SelectorObject_38__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__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__23, 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("yt.geometry.selection_routines.SelectorObject.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":644 * cdef np.float64_t p[3] * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -14703,6 +15692,7 @@ 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; } @@ -14713,7 +15703,7 @@ 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(0, 652, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 644, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -14724,7 +15714,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 652, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 644, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.PointSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -14754,7 +15744,7 @@ long __pyx_t_11; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":653 + /* "yt/geometry/selection_routines.pyx":645 * * def __init__(self, dobj): * for i in range(3): # <<<<<<<<<<<<<< @@ -14764,26 +15754,26 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":654 + /* "yt/geometry/selection_routines.pyx":646 * def __init__(self, dobj): * for i in range(3): * self.p[i] = _ensure_code(dobj.p[i]) # <<<<<<<<<<<<<< * * # ensure the point lies in the domain */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_self->p[__pyx_v_i]) = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":657 + /* "yt/geometry/selection_routines.pyx":649 * * # ensure the point lies in the domain * if self.periodicity[i]: # <<<<<<<<<<<<<< @@ -14793,21 +15783,21 @@ __pyx_t_5 = ((__pyx_v_self->__pyx_base.periodicity[__pyx_v_i]) != 0); if (__pyx_t_5) { - /* "yt/geometry/selection_routines.pyx":658 + /* "yt/geometry/selection_routines.pyx":650 * # ensure the point lies in the domain * if self.periodicity[i]: * self.p[i] = np.fmod(self.p[i], self.domain_width[i]) # <<<<<<<<<<<<<< * if self.p[i] < 0.0: * self.p[i] += self.domain_width[i] */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fmod); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fmod); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble((__pyx_v_self->p[__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble((__pyx_v_self->p[__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyFloat_FromDouble((__pyx_v_self->__pyx_base.domain_width[__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble((__pyx_v_self->__pyx_base.domain_width[__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; @@ -14824,7 +15814,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_3, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -14834,7 +15824,7 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_3, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -14842,7 +15832,7 @@ } else #endif { - __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; @@ -14853,16 +15843,16 @@ PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_3 = 0; __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_self->p[__pyx_v_i]) = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":659 + /* "yt/geometry/selection_routines.pyx":651 * if self.periodicity[i]: * self.p[i] = np.fmod(self.p[i], self.domain_width[i]) * if self.p[i] < 0.0: # <<<<<<<<<<<<<< @@ -14872,7 +15862,7 @@ __pyx_t_5 = (((__pyx_v_self->p[__pyx_v_i]) < 0.0) != 0); if (__pyx_t_5) { - /* "yt/geometry/selection_routines.pyx":660 + /* "yt/geometry/selection_routines.pyx":652 * self.p[i] = np.fmod(self.p[i], self.domain_width[i]) * if self.p[i] < 0.0: * self.p[i] += self.domain_width[i] # <<<<<<<<<<<<<< @@ -14882,7 +15872,7 @@ __pyx_t_11 = __pyx_v_i; (__pyx_v_self->p[__pyx_t_11]) = ((__pyx_v_self->p[__pyx_t_11]) + (__pyx_v_self->__pyx_base.domain_width[__pyx_v_i])); - /* "yt/geometry/selection_routines.pyx":659 + /* "yt/geometry/selection_routines.pyx":651 * if self.periodicity[i]: * self.p[i] = np.fmod(self.p[i], self.domain_width[i]) * if self.p[i] < 0.0: # <<<<<<<<<<<<<< @@ -14891,7 +15881,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":657 + /* "yt/geometry/selection_routines.pyx":649 * * # ensure the point lies in the domain * if self.periodicity[i]: # <<<<<<<<<<<<<< @@ -14901,7 +15891,7 @@ } } - /* "yt/geometry/selection_routines.pyx":652 + /* "yt/geometry/selection_routines.pyx":644 * cdef np.float64_t p[3] * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -14926,7 +15916,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":665 +/* "yt/geometry/selection_routines.pyx":657 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -14940,7 +15930,7 @@ int __pyx_t_2; int __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":666 + /* "yt/geometry/selection_routines.pyx":658 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if (pos[0] - 0.5*dds[0] <= self.p[0] < pos[0]+0.5*dds[0] and # <<<<<<<<<<<<<< @@ -14958,7 +15948,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":667 + /* "yt/geometry/selection_routines.pyx":659 * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if (pos[0] - 0.5*dds[0] <= self.p[0] < pos[0]+0.5*dds[0] and * pos[1] - 0.5*dds[1] <= self.p[1] < pos[1]+0.5*dds[1] and # <<<<<<<<<<<<<< @@ -14976,7 +15966,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":668 + /* "yt/geometry/selection_routines.pyx":660 * if (pos[0] - 0.5*dds[0] <= self.p[0] < pos[0]+0.5*dds[0] and * pos[1] - 0.5*dds[1] <= self.p[1] < pos[1]+0.5*dds[1] and * pos[2] - 0.5*dds[2] <= self.p[2] < pos[2]+0.5*dds[2]): # <<<<<<<<<<<<<< @@ -14991,7 +15981,7 @@ __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":666 + /* "yt/geometry/selection_routines.pyx":658 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if (pos[0] - 0.5*dds[0] <= self.p[0] < pos[0]+0.5*dds[0] and # <<<<<<<<<<<<<< @@ -15000,7 +15990,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":669 + /* "yt/geometry/selection_routines.pyx":661 * pos[1] - 0.5*dds[1] <= self.p[1] < pos[1]+0.5*dds[1] and * pos[2] - 0.5*dds[2] <= self.p[2] < pos[2]+0.5*dds[2]): * return 1 # <<<<<<<<<<<<<< @@ -15010,7 +16000,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":666 + /* "yt/geometry/selection_routines.pyx":658 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if (pos[0] - 0.5*dds[0] <= self.p[0] < pos[0]+0.5*dds[0] and # <<<<<<<<<<<<<< @@ -15019,7 +16009,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":671 + /* "yt/geometry/selection_routines.pyx":663 * return 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -15031,7 +16021,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":665 + /* "yt/geometry/selection_routines.pyx":657 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -15044,7 +16034,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":676 +/* "yt/geometry/selection_routines.pyx":668 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -15060,7 +16050,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":678 + /* "yt/geometry/selection_routines.pyx":670 * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * cdef int i * cdef np.float64_t dist, dist2 = 0 # <<<<<<<<<<<<<< @@ -15069,7 +16059,7 @@ */ __pyx_v_dist2 = 0.0; - /* "yt/geometry/selection_routines.pyx":679 + /* "yt/geometry/selection_routines.pyx":671 * cdef int i * cdef np.float64_t dist, dist2 = 0 * for i in range(3): # <<<<<<<<<<<<<< @@ -15079,7 +16069,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":680 + /* "yt/geometry/selection_routines.pyx":672 * cdef np.float64_t dist, dist2 = 0 * for i in range(3): * dist = self.difference(pos[i], self.p[i], i) # <<<<<<<<<<<<<< @@ -15088,7 +16078,7 @@ */ __pyx_v_dist = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_PointSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.difference(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), (__pyx_v_pos[__pyx_v_i]), (__pyx_v_self->p[__pyx_v_i]), __pyx_v_i); - /* "yt/geometry/selection_routines.pyx":681 + /* "yt/geometry/selection_routines.pyx":673 * for i in range(3): * dist = self.difference(pos[i], self.p[i], i) * dist2 += dist*dist # <<<<<<<<<<<<<< @@ -15098,7 +16088,7 @@ __pyx_v_dist2 = (__pyx_v_dist2 + (__pyx_v_dist * __pyx_v_dist)); } - /* "yt/geometry/selection_routines.pyx":682 + /* "yt/geometry/selection_routines.pyx":674 * dist = self.difference(pos[i], self.p[i], i) * dist2 += dist*dist * if dist2 <= radius*radius: return 1 # <<<<<<<<<<<<<< @@ -15111,7 +16101,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":683 + /* "yt/geometry/selection_routines.pyx":675 * dist2 += dist*dist * if dist2 <= radius*radius: return 1 * return 0 # <<<<<<<<<<<<<< @@ -15121,7 +16111,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":676 + /* "yt/geometry/selection_routines.pyx":668 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -15134,7 +16124,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":688 +/* "yt/geometry/selection_routines.pyx":680 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -15148,7 +16138,7 @@ int __pyx_t_2; int __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":691 + /* "yt/geometry/selection_routines.pyx":683 * np.float64_t right_edge[3]) nogil: * # point definitely can only be in one cell * if (left_edge[0] <= self.p[0] < right_edge[0] and # <<<<<<<<<<<<<< @@ -15166,7 +16156,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":692 + /* "yt/geometry/selection_routines.pyx":684 * # point definitely can only be in one cell * if (left_edge[0] <= self.p[0] < right_edge[0] and * left_edge[1] <= self.p[1] < right_edge[1] and # <<<<<<<<<<<<<< @@ -15184,7 +16174,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":693 + /* "yt/geometry/selection_routines.pyx":685 * if (left_edge[0] <= self.p[0] < right_edge[0] and * left_edge[1] <= self.p[1] < right_edge[1] and * left_edge[2] <= self.p[2] < right_edge[2]): # <<<<<<<<<<<<<< @@ -15199,7 +16189,7 @@ __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":691 + /* "yt/geometry/selection_routines.pyx":683 * np.float64_t right_edge[3]) nogil: * # point definitely can only be in one cell * if (left_edge[0] <= self.p[0] < right_edge[0] and # <<<<<<<<<<<<<< @@ -15208,7 +16198,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":694 + /* "yt/geometry/selection_routines.pyx":686 * left_edge[1] <= self.p[1] < right_edge[1] and * left_edge[2] <= self.p[2] < right_edge[2]): * return 1 # <<<<<<<<<<<<<< @@ -15218,7 +16208,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":691 + /* "yt/geometry/selection_routines.pyx":683 * np.float64_t right_edge[3]) nogil: * # point definitely can only be in one cell * if (left_edge[0] <= self.p[0] < right_edge[0] and # <<<<<<<<<<<<<< @@ -15227,7 +16217,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":696 + /* "yt/geometry/selection_routines.pyx":688 * return 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -15239,7 +16229,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":688 + /* "yt/geometry/selection_routines.pyx":680 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -15252,7 +16242,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":698 +/* "yt/geometry/selection_routines.pyx":690 * return 0 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -15282,7 +16272,7 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":699 + /* "yt/geometry/selection_routines.pyx":691 * * def _hash_vals(self): * return (("p[0]", self.p[0]), # <<<<<<<<<<<<<< @@ -15290,9 +16280,9 @@ * ("p[2]", self.p[2])) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->p[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->p[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_kp_s_p_0); __Pyx_GIVEREF(__pyx_kp_s_p_0); @@ -15301,16 +16291,16 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":700 + /* "yt/geometry/selection_routines.pyx":692 * def _hash_vals(self): * return (("p[0]", self.p[0]), * ("p[1]", self.p[1]), # <<<<<<<<<<<<<< * ("p[2]", self.p[2])) * */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->p[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->p[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_s_p_1); __Pyx_GIVEREF(__pyx_kp_s_p_1); @@ -15319,16 +16309,16 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":701 + /* "yt/geometry/selection_routines.pyx":693 * return (("p[0]", self.p[0]), * ("p[1]", self.p[1]), * ("p[2]", self.p[2])) # <<<<<<<<<<<<<< * * point_selector = PointSelector */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->p[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->p[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_p_2); __Pyx_GIVEREF(__pyx_kp_s_p_2); @@ -15337,14 +16327,14 @@ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":699 + /* "yt/geometry/selection_routines.pyx":691 * * def _hash_vals(self): * return (("p[0]", self.p[0]), # <<<<<<<<<<<<<< * ("p[1]", self.p[1]), * ("p[2]", self.p[2])) */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -15359,7 +16349,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":698 + /* "yt/geometry/selection_routines.pyx":690 * return 0 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -15381,7 +16371,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":713 +/* "(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_2yt_8geometry_18selection_routines_13PointSelector_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_13PointSelector_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_2yt_8geometry_18selection_routines_13PointSelector_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_13PointSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector *__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__24, 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("yt.geometry.selection_routines.PointSelector.__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_2yt_8geometry_18selection_routines_13PointSelector_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_13PointSelector_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_2yt_8geometry_18selection_routines_13PointSelector_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_13PointSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector *__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__25, 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("yt.geometry.selection_routines.PointSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":705 * cdef bint check_box[3] * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -15404,6 +16501,7 @@ 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; } @@ -15414,7 +16512,7 @@ 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(0, 713, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 705, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -15425,7 +16523,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 713, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 705, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.SphereSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -15451,7 +16549,7 @@ int __pyx_t_6; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":714 + /* "yt/geometry/selection_routines.pyx":706 * * def __init__(self, dobj): * for i in range(3): # <<<<<<<<<<<<<< @@ -15461,43 +16559,43 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":715 + /* "yt/geometry/selection_routines.pyx":707 * def __init__(self, dobj): * for i in range(3): * self.center[i] = _ensure_code(dobj.center[i]) # <<<<<<<<<<<<<< * self.radius = _ensure_code(dobj.radius) * self.radius2 = self.radius * self.radius */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_center); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_center); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_self->center[__pyx_v_i]) = __pyx_t_4; } - /* "yt/geometry/selection_routines.pyx":716 + /* "yt/geometry/selection_routines.pyx":708 * for i in range(3): * self.center[i] = _ensure_code(dobj.center[i]) * self.radius = _ensure_code(dobj.radius) # <<<<<<<<<<<<<< * self.radius2 = self.radius * self.radius * center = _ensure_code(dobj.center) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_radius); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_radius); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->radius = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":717 + /* "yt/geometry/selection_routines.pyx":709 * self.center[i] = _ensure_code(dobj.center[i]) * self.radius = _ensure_code(dobj.radius) * self.radius2 = self.radius * self.radius # <<<<<<<<<<<<<< @@ -15506,22 +16604,22 @@ */ __pyx_v_self->radius2 = (__pyx_v_self->radius * __pyx_v_self->radius); - /* "yt/geometry/selection_routines.pyx":718 + /* "yt/geometry/selection_routines.pyx":710 * self.radius = _ensure_code(dobj.radius) * self.radius2 = self.radius * self.radius * center = _ensure_code(dobj.center) # <<<<<<<<<<<<<< * for i in range(3): * self.center[i] = center[i] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_center); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 718, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_center); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error) + __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_center = __pyx_t_2; __pyx_t_2 = 0; - /* "yt/geometry/selection_routines.pyx":719 + /* "yt/geometry/selection_routines.pyx":711 * self.radius2 = self.radius * self.radius * center = _ensure_code(dobj.center) * for i in range(3): # <<<<<<<<<<<<<< @@ -15531,20 +16629,20 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":720 + /* "yt/geometry/selection_routines.pyx":712 * center = _ensure_code(dobj.center) * for i in range(3): * self.center[i] = center[i] # <<<<<<<<<<<<<< * self.bbox[i][0] = self.center[i] - self.radius * self.bbox[i][1] = self.center[i] + self.radius */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 720, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_self->center[__pyx_v_i]) = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":721 + /* "yt/geometry/selection_routines.pyx":713 * for i in range(3): * self.center[i] = center[i] * self.bbox[i][0] = self.center[i] - self.radius # <<<<<<<<<<<<<< @@ -15553,7 +16651,7 @@ */ ((__pyx_v_self->bbox[__pyx_v_i])[0]) = ((__pyx_v_self->center[__pyx_v_i]) - __pyx_v_self->radius); - /* "yt/geometry/selection_routines.pyx":722 + /* "yt/geometry/selection_routines.pyx":714 * self.center[i] = center[i] * self.bbox[i][0] = self.center[i] - self.radius * self.bbox[i][1] = self.center[i] + self.radius # <<<<<<<<<<<<<< @@ -15562,31 +16660,31 @@ */ ((__pyx_v_self->bbox[__pyx_v_i])[1]) = ((__pyx_v_self->center[__pyx_v_i]) + __pyx_v_self->radius); - /* "yt/geometry/selection_routines.pyx":723 + /* "yt/geometry/selection_routines.pyx":715 * self.bbox[i][0] = self.center[i] - self.radius * self.bbox[i][1] = self.center[i] + self.radius * if self.bbox[i][0] < dobj.ds.domain_left_edge[i]: # <<<<<<<<<<<<<< * self.check_box[i] = False * elif self.bbox[i][1] > dobj.ds.domain_right_edge[i]: */ - __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_self->bbox[__pyx_v_i])[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_self->bbox[__pyx_v_i])[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_domain_left_edge); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_domain_left_edge); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "yt/geometry/selection_routines.pyx":724 + /* "yt/geometry/selection_routines.pyx":716 * self.bbox[i][1] = self.center[i] + self.radius * if self.bbox[i][0] < dobj.ds.domain_left_edge[i]: * self.check_box[i] = False # <<<<<<<<<<<<<< @@ -15595,7 +16693,7 @@ */ (__pyx_v_self->check_box[__pyx_v_i]) = 0; - /* "yt/geometry/selection_routines.pyx":723 + /* "yt/geometry/selection_routines.pyx":715 * self.bbox[i][0] = self.center[i] - self.radius * self.bbox[i][1] = self.center[i] + self.radius * if self.bbox[i][0] < dobj.ds.domain_left_edge[i]: # <<<<<<<<<<<<<< @@ -15605,31 +16703,31 @@ goto __pyx_L7; } - /* "yt/geometry/selection_routines.pyx":725 + /* "yt/geometry/selection_routines.pyx":717 * if self.bbox[i][0] < dobj.ds.domain_left_edge[i]: * self.check_box[i] = False * elif self.bbox[i][1] > dobj.ds.domain_right_edge[i]: # <<<<<<<<<<<<<< * self.check_box[i] = False * else: */ - __pyx_t_5 = PyFloat_FromDouble(((__pyx_v_self->bbox[__pyx_v_i])[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(((__pyx_v_self->bbox[__pyx_v_i])[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_domain_right_edge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_domain_right_edge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "yt/geometry/selection_routines.pyx":726 + /* "yt/geometry/selection_routines.pyx":718 * self.check_box[i] = False * elif self.bbox[i][1] > dobj.ds.domain_right_edge[i]: * self.check_box[i] = False # <<<<<<<<<<<<<< @@ -15638,7 +16736,7 @@ */ (__pyx_v_self->check_box[__pyx_v_i]) = 0; - /* "yt/geometry/selection_routines.pyx":725 + /* "yt/geometry/selection_routines.pyx":717 * if self.bbox[i][0] < dobj.ds.domain_left_edge[i]: * self.check_box[i] = False * elif self.bbox[i][1] > dobj.ds.domain_right_edge[i]: # <<<<<<<<<<<<<< @@ -15648,7 +16746,7 @@ goto __pyx_L7; } - /* "yt/geometry/selection_routines.pyx":728 + /* "yt/geometry/selection_routines.pyx":720 * self.check_box[i] = False * else: * self.check_box[i] = True # <<<<<<<<<<<<<< @@ -15661,7 +16759,7 @@ __pyx_L7:; } - /* "yt/geometry/selection_routines.pyx":713 + /* "yt/geometry/selection_routines.pyx":705 * cdef bint check_box[3] * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -15684,7 +16782,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":733 +/* "yt/geometry/selection_routines.pyx":725 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -15698,7 +16796,7 @@ int __pyx_t_2; int __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":735 + /* "yt/geometry/selection_routines.pyx":727 * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * # sphere center either inside cell or center of cell lies inside sphere * if (pos[0] - 0.5*dds[0] <= self.center[0] <= pos[0]+0.5*dds[0] and # <<<<<<<<<<<<<< @@ -15716,7 +16814,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":736 + /* "yt/geometry/selection_routines.pyx":728 * # sphere center either inside cell or center of cell lies inside sphere * if (pos[0] - 0.5*dds[0] <= self.center[0] <= pos[0]+0.5*dds[0] and * pos[1] - 0.5*dds[1] <= self.center[1] <= pos[1]+0.5*dds[1] and # <<<<<<<<<<<<<< @@ -15734,7 +16832,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":737 + /* "yt/geometry/selection_routines.pyx":729 * if (pos[0] - 0.5*dds[0] <= self.center[0] <= pos[0]+0.5*dds[0] and * pos[1] - 0.5*dds[1] <= self.center[1] <= pos[1]+0.5*dds[1] and * pos[2] - 0.5*dds[2] <= self.center[2] <= pos[2]+0.5*dds[2]): # <<<<<<<<<<<<<< @@ -15749,7 +16847,7 @@ __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":735 + /* "yt/geometry/selection_routines.pyx":727 * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * # sphere center either inside cell or center of cell lies inside sphere * if (pos[0] - 0.5*dds[0] <= self.center[0] <= pos[0]+0.5*dds[0] and # <<<<<<<<<<<<<< @@ -15758,7 +16856,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":738 + /* "yt/geometry/selection_routines.pyx":730 * pos[1] - 0.5*dds[1] <= self.center[1] <= pos[1]+0.5*dds[1] and * pos[2] - 0.5*dds[2] <= self.center[2] <= pos[2]+0.5*dds[2]): * return 1 # <<<<<<<<<<<<<< @@ -15768,7 +16866,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":735 + /* "yt/geometry/selection_routines.pyx":727 * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * # sphere center either inside cell or center of cell lies inside sphere * if (pos[0] - 0.5*dds[0] <= self.center[0] <= pos[0]+0.5*dds[0] and # <<<<<<<<<<<<<< @@ -15777,7 +16875,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":739 + /* "yt/geometry/selection_routines.pyx":731 * pos[2] - 0.5*dds[2] <= self.center[2] <= pos[2]+0.5*dds[2]): * return 1 * return self.select_point(pos) # <<<<<<<<<<<<<< @@ -15787,7 +16885,7 @@ __pyx_r = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SphereSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.select_point(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_pos); goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":733 + /* "yt/geometry/selection_routines.pyx":725 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -15800,7 +16898,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":744 +/* "yt/geometry/selection_routines.pyx":736 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -15817,7 +16915,7 @@ int __pyx_t_2; int __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":746 + /* "yt/geometry/selection_routines.pyx":738 * cdef int select_point(self, np.float64_t pos[3]) nogil: * cdef int i * cdef np.float64_t dist, dist2 = 0 # <<<<<<<<<<<<<< @@ -15826,7 +16924,7 @@ */ __pyx_v_dist2 = 0.0; - /* "yt/geometry/selection_routines.pyx":747 + /* "yt/geometry/selection_routines.pyx":739 * cdef int i * cdef np.float64_t dist, dist2 = 0 * for i in range(3): # <<<<<<<<<<<<<< @@ -15836,7 +16934,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":748 + /* "yt/geometry/selection_routines.pyx":740 * cdef np.float64_t dist, dist2 = 0 * for i in range(3): * if self.check_box[i] and \ # <<<<<<<<<<<<<< @@ -15850,7 +16948,7 @@ goto __pyx_L6_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":749 + /* "yt/geometry/selection_routines.pyx":741 * for i in range(3): * if self.check_box[i] and \ * (pos[i] < self.bbox[i][0] or # <<<<<<<<<<<<<< @@ -15864,7 +16962,7 @@ goto __pyx_L6_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":750 + /* "yt/geometry/selection_routines.pyx":742 * if self.check_box[i] and \ * (pos[i] < self.bbox[i][0] or * pos[i] > self.bbox[i][1]): # <<<<<<<<<<<<<< @@ -15875,7 +16973,7 @@ __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":748 + /* "yt/geometry/selection_routines.pyx":740 * cdef np.float64_t dist, dist2 = 0 * for i in range(3): * if self.check_box[i] and \ # <<<<<<<<<<<<<< @@ -15884,7 +16982,7 @@ */ if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pyx":751 + /* "yt/geometry/selection_routines.pyx":743 * (pos[i] < self.bbox[i][0] or * pos[i] > self.bbox[i][1]): * return 0 # <<<<<<<<<<<<<< @@ -15894,7 +16992,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":748 + /* "yt/geometry/selection_routines.pyx":740 * cdef np.float64_t dist, dist2 = 0 * for i in range(3): * if self.check_box[i] and \ # <<<<<<<<<<<<<< @@ -15903,7 +17001,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":752 + /* "yt/geometry/selection_routines.pyx":744 * pos[i] > self.bbox[i][1]): * return 0 * dist = _periodic_dist(pos[i], self.center[i], self.domain_width[i], # <<<<<<<<<<<<<< @@ -15912,7 +17010,7 @@ */ __pyx_v_dist = __pyx_f_2yt_8geometry_18selection_routines__periodic_dist((__pyx_v_pos[__pyx_v_i]), (__pyx_v_self->center[__pyx_v_i]), (__pyx_v_self->__pyx_base.domain_width[__pyx_v_i]), (__pyx_v_self->__pyx_base.periodicity[__pyx_v_i])); - /* "yt/geometry/selection_routines.pyx":754 + /* "yt/geometry/selection_routines.pyx":746 * dist = _periodic_dist(pos[i], self.center[i], self.domain_width[i], * self.periodicity[i]) * dist2 += dist*dist # <<<<<<<<<<<<<< @@ -15921,7 +17019,7 @@ */ __pyx_v_dist2 = (__pyx_v_dist2 + (__pyx_v_dist * __pyx_v_dist)); - /* "yt/geometry/selection_routines.pyx":755 + /* "yt/geometry/selection_routines.pyx":747 * self.periodicity[i]) * dist2 += dist*dist * if dist2 > self.radius2: return 0 # <<<<<<<<<<<<<< @@ -15935,7 +17033,7 @@ } } - /* "yt/geometry/selection_routines.pyx":756 + /* "yt/geometry/selection_routines.pyx":748 * dist2 += dist*dist * if dist2 > self.radius2: return 0 * return 1 # <<<<<<<<<<<<<< @@ -15945,7 +17043,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":744 + /* "yt/geometry/selection_routines.pyx":736 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -15958,7 +17056,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":761 +/* "yt/geometry/selection_routines.pyx":753 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -15974,7 +17072,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":763 + /* "yt/geometry/selection_routines.pyx":755 * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * cdef int i * cdef np.float64_t dist, dist2 = 0 # <<<<<<<<<<<<<< @@ -15983,7 +17081,7 @@ */ __pyx_v_dist2 = 0.0; - /* "yt/geometry/selection_routines.pyx":764 + /* "yt/geometry/selection_routines.pyx":756 * cdef int i * cdef np.float64_t dist, dist2 = 0 * for i in range(3): # <<<<<<<<<<<<<< @@ -15993,7 +17091,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":765 + /* "yt/geometry/selection_routines.pyx":757 * cdef np.float64_t dist, dist2 = 0 * for i in range(3): * dist = self.difference(pos[i], self.center[i], i) # <<<<<<<<<<<<<< @@ -16002,7 +17100,7 @@ */ __pyx_v_dist = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SphereSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.difference(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), (__pyx_v_pos[__pyx_v_i]), (__pyx_v_self->center[__pyx_v_i]), __pyx_v_i); - /* "yt/geometry/selection_routines.pyx":766 + /* "yt/geometry/selection_routines.pyx":758 * for i in range(3): * dist = self.difference(pos[i], self.center[i], i) * dist2 += dist*dist # <<<<<<<<<<<<<< @@ -16012,7 +17110,7 @@ __pyx_v_dist2 = (__pyx_v_dist2 + (__pyx_v_dist * __pyx_v_dist)); } - /* "yt/geometry/selection_routines.pyx":767 + /* "yt/geometry/selection_routines.pyx":759 * dist = self.difference(pos[i], self.center[i], i) * dist2 += dist*dist * dist = self.radius+radius # <<<<<<<<<<<<<< @@ -16021,7 +17119,7 @@ */ __pyx_v_dist = (__pyx_v_self->radius + __pyx_v_radius); - /* "yt/geometry/selection_routines.pyx":768 + /* "yt/geometry/selection_routines.pyx":760 * dist2 += dist*dist * dist = self.radius+radius * if dist2 <= dist*dist: return 1 # <<<<<<<<<<<<<< @@ -16034,7 +17132,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":769 + /* "yt/geometry/selection_routines.pyx":761 * dist = self.radius+radius * if dist2 <= dist*dist: return 1 * return 0 # <<<<<<<<<<<<<< @@ -16044,7 +17142,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":761 + /* "yt/geometry/selection_routines.pyx":753 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -16057,7 +17155,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":774 +/* "yt/geometry/selection_routines.pyx":766 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -16078,7 +17176,7 @@ int __pyx_t_3; int __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":778 + /* "yt/geometry/selection_routines.pyx":770 * cdef np.float64_t box_center, relcenter, closest, dist, edge * cdef int i * if (left_edge[0] <= self.center[0] <= right_edge[0] and # <<<<<<<<<<<<<< @@ -16096,7 +17194,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":779 + /* "yt/geometry/selection_routines.pyx":771 * cdef int i * if (left_edge[0] <= self.center[0] <= right_edge[0] and * left_edge[1] <= self.center[1] <= right_edge[1] and # <<<<<<<<<<<<<< @@ -16114,7 +17212,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":780 + /* "yt/geometry/selection_routines.pyx":772 * if (left_edge[0] <= self.center[0] <= right_edge[0] and * left_edge[1] <= self.center[1] <= right_edge[1] and * left_edge[2] <= self.center[2] <= right_edge[2]): # <<<<<<<<<<<<<< @@ -16129,7 +17227,7 @@ __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":778 + /* "yt/geometry/selection_routines.pyx":770 * cdef np.float64_t box_center, relcenter, closest, dist, edge * cdef int i * if (left_edge[0] <= self.center[0] <= right_edge[0] and # <<<<<<<<<<<<<< @@ -16138,7 +17236,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":781 + /* "yt/geometry/selection_routines.pyx":773 * left_edge[1] <= self.center[1] <= right_edge[1] and * left_edge[2] <= self.center[2] <= right_edge[2]): * return 1 # <<<<<<<<<<<<<< @@ -16148,7 +17246,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":778 + /* "yt/geometry/selection_routines.pyx":770 * cdef np.float64_t box_center, relcenter, closest, dist, edge * cdef int i * if (left_edge[0] <= self.center[0] <= right_edge[0] and # <<<<<<<<<<<<<< @@ -16157,7 +17255,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":782 + /* "yt/geometry/selection_routines.pyx":774 * left_edge[2] <= self.center[2] <= right_edge[2]): * return 1 * for i in range(3): # <<<<<<<<<<<<<< @@ -16167,7 +17265,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":783 + /* "yt/geometry/selection_routines.pyx":775 * return 1 * for i in range(3): * if not self.check_box[i]: continue # <<<<<<<<<<<<<< @@ -16179,7 +17277,7 @@ goto __pyx_L7_continue; } - /* "yt/geometry/selection_routines.pyx":784 + /* "yt/geometry/selection_routines.pyx":776 * for i in range(3): * if not self.check_box[i]: continue * if right_edge[i] < self.bbox[i][0] or \ # <<<<<<<<<<<<<< @@ -16193,7 +17291,7 @@ goto __pyx_L11_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":785 + /* "yt/geometry/selection_routines.pyx":777 * if not self.check_box[i]: continue * if right_edge[i] < self.bbox[i][0] or \ * left_edge[i] > self.bbox[i][1]: # <<<<<<<<<<<<<< @@ -16204,7 +17302,7 @@ __pyx_t_1 = __pyx_t_3; __pyx_L11_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":784 + /* "yt/geometry/selection_routines.pyx":776 * for i in range(3): * if not self.check_box[i]: continue * if right_edge[i] < self.bbox[i][0] or \ # <<<<<<<<<<<<<< @@ -16213,7 +17311,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":786 + /* "yt/geometry/selection_routines.pyx":778 * if right_edge[i] < self.bbox[i][0] or \ * left_edge[i] > self.bbox[i][1]: * return 0 # <<<<<<<<<<<<<< @@ -16223,7 +17321,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":784 + /* "yt/geometry/selection_routines.pyx":776 * for i in range(3): * if not self.check_box[i]: continue * if right_edge[i] < self.bbox[i][0] or \ # <<<<<<<<<<<<<< @@ -16234,7 +17332,7 @@ __pyx_L7_continue:; } - /* "yt/geometry/selection_routines.pyx":788 + /* "yt/geometry/selection_routines.pyx":780 * return 0 * # http://www.gamedev.net/topic/335465-is-this-the-simplest-sphere-aabb-collision-test/ * dist = 0 # <<<<<<<<<<<<<< @@ -16243,7 +17341,7 @@ */ __pyx_v_dist = 0.0; - /* "yt/geometry/selection_routines.pyx":789 + /* "yt/geometry/selection_routines.pyx":781 * # http://www.gamedev.net/topic/335465-is-this-the-simplest-sphere-aabb-collision-test/ * dist = 0 * for i in range(3): # <<<<<<<<<<<<<< @@ -16253,7 +17351,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":791 + /* "yt/geometry/selection_routines.pyx":783 * for i in range(3): * # Early terminate * box_center = (right_edge[i] + left_edge[i])/2.0 # <<<<<<<<<<<<<< @@ -16262,7 +17360,7 @@ */ __pyx_v_box_center = (((__pyx_v_right_edge[__pyx_v_i]) + (__pyx_v_left_edge[__pyx_v_i])) / 2.0); - /* "yt/geometry/selection_routines.pyx":792 + /* "yt/geometry/selection_routines.pyx":784 * # Early terminate * box_center = (right_edge[i] + left_edge[i])/2.0 * relcenter = self.difference(box_center, self.center[i], i) # <<<<<<<<<<<<<< @@ -16271,7 +17369,7 @@ */ __pyx_v_relcenter = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SphereSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.difference(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_box_center, (__pyx_v_self->center[__pyx_v_i]), __pyx_v_i); - /* "yt/geometry/selection_routines.pyx":793 + /* "yt/geometry/selection_routines.pyx":785 * box_center = (right_edge[i] + left_edge[i])/2.0 * relcenter = self.difference(box_center, self.center[i], i) * edge = right_edge[i] - left_edge[i] # <<<<<<<<<<<<<< @@ -16280,7 +17378,7 @@ */ __pyx_v_edge = ((__pyx_v_right_edge[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])); - /* "yt/geometry/selection_routines.pyx":794 + /* "yt/geometry/selection_routines.pyx":786 * relcenter = self.difference(box_center, self.center[i], i) * edge = right_edge[i] - left_edge[i] * closest = relcenter - fclip(relcenter, -edge/2.0, edge/2.0) # <<<<<<<<<<<<<< @@ -16289,7 +17387,7 @@ */ __pyx_v_closest = (__pyx_v_relcenter - __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_v_relcenter, ((-__pyx_v_edge) / 2.0), (__pyx_v_edge / 2.0))); - /* "yt/geometry/selection_routines.pyx":795 + /* "yt/geometry/selection_routines.pyx":787 * edge = right_edge[i] - left_edge[i] * closest = relcenter - fclip(relcenter, -edge/2.0, edge/2.0) * dist += closest*closest # <<<<<<<<<<<<<< @@ -16298,7 +17396,7 @@ */ __pyx_v_dist = (__pyx_v_dist + (__pyx_v_closest * __pyx_v_closest)); - /* "yt/geometry/selection_routines.pyx":796 + /* "yt/geometry/selection_routines.pyx":788 * closest = relcenter - fclip(relcenter, -edge/2.0, edge/2.0) * dist += closest*closest * if dist > self.radius2: return 0 # <<<<<<<<<<<<<< @@ -16312,7 +17410,7 @@ } } - /* "yt/geometry/selection_routines.pyx":797 + /* "yt/geometry/selection_routines.pyx":789 * dist += closest*closest * if dist > self.radius2: return 0 * return 1 # <<<<<<<<<<<<<< @@ -16322,7 +17420,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":774 + /* "yt/geometry/selection_routines.pyx":766 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -16335,7 +17433,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":799 +/* "yt/geometry/selection_routines.pyx":791 * return 1 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -16367,7 +17465,7 @@ PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":800 + /* "yt/geometry/selection_routines.pyx":792 * * def _hash_vals(self): * return (("radius", self.radius), # <<<<<<<<<<<<<< @@ -16375,9 +17473,9 @@ * ("center[0]", self.center[0]), */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->radius); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->radius); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_radius); __Pyx_GIVEREF(__pyx_n_s_radius); @@ -16386,16 +17484,16 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":801 + /* "yt/geometry/selection_routines.pyx":793 * def _hash_vals(self): * return (("radius", self.radius), * ("radius2", self.radius2), # <<<<<<<<<<<<<< * ("center[0]", self.center[0]), * ("center[1]", self.center[1]), */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->radius2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->radius2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_radius2); __Pyx_GIVEREF(__pyx_n_s_radius2); @@ -16404,16 +17502,16 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":802 + /* "yt/geometry/selection_routines.pyx":794 * return (("radius", self.radius), * ("radius2", self.radius2), * ("center[0]", self.center[0]), # <<<<<<<<<<<<<< * ("center[1]", self.center[1]), * ("center[2]", self.center[2])) */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_center_0); __Pyx_GIVEREF(__pyx_kp_s_center_0); @@ -16422,16 +17520,16 @@ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":803 + /* "yt/geometry/selection_routines.pyx":795 * ("radius2", self.radius2), * ("center[0]", self.center[0]), * ("center[1]", self.center[1]), # <<<<<<<<<<<<<< * ("center[2]", self.center[2])) * */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 803, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_center_1); __Pyx_GIVEREF(__pyx_kp_s_center_1); @@ -16440,16 +17538,16 @@ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":804 + /* "yt/geometry/selection_routines.pyx":796 * ("center[0]", self.center[0]), * ("center[1]", self.center[1]), * ("center[2]", self.center[2])) # <<<<<<<<<<<<<< * * sphere_selector = SphereSelector */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 804, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_kp_s_center_2); __Pyx_GIVEREF(__pyx_kp_s_center_2); @@ -16458,14 +17556,14 @@ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":800 + /* "yt/geometry/selection_routines.pyx":792 * * def _hash_vals(self): * return (("radius", self.radius), # <<<<<<<<<<<<<< * ("radius2", self.radius2), * ("center[0]", self.center[0]), */ - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -16486,7 +17584,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":799 + /* "yt/geometry/selection_routines.pyx":791 * return 1 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -16510,73 +17608,181 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":817 - * @cython.boundscheck(False) - * @cython.wraparound(False) - * def __init__(self, dobj): # <<<<<<<<<<<<<< - * cdef int i - * # We are modifying dobj.left_edge and dobj.right_edge , so here we will +/* "(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 int __pyx_pw_2yt_8geometry_18selection_routines_14RegionSelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_8geometry_18selection_routines_14RegionSelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_dobj = 0; - int __pyx_r; +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_14SphereSelector_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_14SphereSelector_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dobj,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dobj)) != 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(0, 817, __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_dobj = 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(0, 817, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.geometry.selection_routines.RegionSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_14RegionSelector___init__(((struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *)__pyx_v_self), __pyx_v_dobj); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_14SphereSelector_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_2yt_8geometry_18selection_routines_14RegionSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *__pyx_v_self, PyObject *__pyx_v_dobj) { - int __pyx_v_i; - __Pyx_memviewslice __pyx_v_RE = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_LE = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_DW = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_DLE = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_DRE = { 0, 0, { 0 }, { 0 }, { 0 } }; - __pyx_t_5numpy_float64_t __pyx_v_region_width[3]; - int __pyx_v_p[3]; - int __pyx_r; +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14SphereSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector *__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(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("yt.geometry.selection_routines.SphereSelector.__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_2yt_8geometry_18selection_routines_14SphereSelector_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_14SphereSelector_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_2yt_8geometry_18selection_routines_14SphereSelector_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14SphereSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector *__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(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("yt.geometry.selection_routines.SphereSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":809 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def __init__(self, dobj): # <<<<<<<<<<<<<< + * cdef int i + * # We are modifying dobj.left_edge and dobj.right_edge , so here we will + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_8geometry_18selection_routines_14RegionSelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_8geometry_18selection_routines_14RegionSelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dobj = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dobj,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dobj)) != 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(0, 809, __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_dobj = 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(0, 809, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.selection_routines.RegionSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_14RegionSelector___init__(((struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *)__pyx_v_self), __pyx_v_dobj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_8geometry_18selection_routines_14RegionSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *__pyx_v_self, PyObject *__pyx_v_dobj) { + int __pyx_v_i; + __Pyx_memviewslice __pyx_v_RE = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_LE = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_DW = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_DLE = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_DRE = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_float64_t __pyx_v_region_width[3]; + int __pyx_v_p[3]; + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -16619,124 +17825,124 @@ __pyx_t_5numpy_float64_t __pyx_t_39; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":821 + /* "yt/geometry/selection_routines.pyx":813 * # We are modifying dobj.left_edge and dobj.right_edge , so here we will * # do an in-place conversion of those arrays. * cdef np.float64_t[:] RE = _ensure_code(dobj.right_edge) # <<<<<<<<<<<<<< * cdef np.float64_t[:] LE = _ensure_code(dobj.left_edge) * cdef np.float64_t[:] DW = _ensure_code(dobj.ds.domain_width) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_right_edge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_right_edge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) + __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __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_nn___pyx_t_5numpy_float64_t(__pyx_t_2); - if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 821, __pyx_L1_error) + if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_RE = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "yt/geometry/selection_routines.pyx":822 + /* "yt/geometry/selection_routines.pyx":814 * # do an in-place conversion of those arrays. * cdef np.float64_t[:] RE = _ensure_code(dobj.right_edge) * cdef np.float64_t[:] LE = _ensure_code(dobj.left_edge) # <<<<<<<<<<<<<< * cdef np.float64_t[:] DW = _ensure_code(dobj.ds.domain_width) * cdef np.float64_t[:] DLE = _ensure_code(dobj.ds.domain_left_edge) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_left_edge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_left_edge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 822, __pyx_L1_error) + if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_LE = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "yt/geometry/selection_routines.pyx":823 + /* "yt/geometry/selection_routines.pyx":815 * cdef np.float64_t[:] RE = _ensure_code(dobj.right_edge) * cdef np.float64_t[:] LE = _ensure_code(dobj.left_edge) * cdef np.float64_t[:] DW = _ensure_code(dobj.ds.domain_width) # <<<<<<<<<<<<<< * cdef np.float64_t[:] DLE = _ensure_code(dobj.ds.domain_left_edge) * cdef np.float64_t[:] DRE = _ensure_code(dobj.ds.domain_right_edge) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_domain_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_domain_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 823, __pyx_L1_error) + if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_DW = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "yt/geometry/selection_routines.pyx":824 + /* "yt/geometry/selection_routines.pyx":816 * cdef np.float64_t[:] LE = _ensure_code(dobj.left_edge) * cdef np.float64_t[:] DW = _ensure_code(dobj.ds.domain_width) * cdef np.float64_t[:] DLE = _ensure_code(dobj.ds.domain_left_edge) # <<<<<<<<<<<<<< * cdef np.float64_t[:] DRE = _ensure_code(dobj.ds.domain_right_edge) * cdef np.float64_t region_width[3] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_domain_left_edge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_domain_left_edge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 824, __pyx_L1_error) + if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_DLE = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "yt/geometry/selection_routines.pyx":825 + /* "yt/geometry/selection_routines.pyx":817 * cdef np.float64_t[:] DW = _ensure_code(dobj.ds.domain_width) * cdef np.float64_t[:] DLE = _ensure_code(dobj.ds.domain_left_edge) * cdef np.float64_t[:] DRE = _ensure_code(dobj.ds.domain_right_edge) # <<<<<<<<<<<<<< * cdef np.float64_t region_width[3] * cdef bint p[3] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_domain_right_edge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_domain_right_edge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 825, __pyx_L1_error) + if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_DRE = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "yt/geometry/selection_routines.pyx":830 + /* "yt/geometry/selection_routines.pyx":822 * # This is for if we want to include zones that overlap and whose * # centers are not strictly included. * self.loose_selection = getattr(dobj, "loose_selection", False) # <<<<<<<<<<<<<< * self.check_period = False * */ - __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_dobj, __pyx_n_s_loose_selection, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_dobj, __pyx_n_s_loose_selection, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->loose_selection = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":831 + /* "yt/geometry/selection_routines.pyx":823 * # centers are not strictly included. * self.loose_selection = getattr(dobj, "loose_selection", False) * self.check_period = False # <<<<<<<<<<<<<< @@ -16745,7 +17951,7 @@ */ __pyx_v_self->check_period = 0; - /* "yt/geometry/selection_routines.pyx":833 + /* "yt/geometry/selection_routines.pyx":825 * self.check_period = False * * for i in range(3): # <<<<<<<<<<<<<< @@ -16755,7 +17961,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < 3; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "yt/geometry/selection_routines.pyx":834 + /* "yt/geometry/selection_routines.pyx":826 * * for i in range(3): * region_width[i] = RE[i] - LE[i] # <<<<<<<<<<<<<< @@ -16766,26 +17972,26 @@ __pyx_t_7 = __pyx_v_i; (__pyx_v_region_width[__pyx_v_i]) = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_RE.data + __pyx_t_6 * __pyx_v_RE.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_LE.data + __pyx_t_7 * __pyx_v_LE.strides[0]) )))); - /* "yt/geometry/selection_routines.pyx":835 + /* "yt/geometry/selection_routines.pyx":827 * for i in range(3): * region_width[i] = RE[i] - LE[i] * p[i] = dobj.ds.periodicity[i] # <<<<<<<<<<<<<< * if region_width[i] <= 0: * raise RuntimeError( */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_periodicity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_periodicity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_p[__pyx_v_i]) = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":836 + /* "yt/geometry/selection_routines.pyx":828 * region_width[i] = RE[i] - LE[i] * p[i] = dobj.ds.periodicity[i] * if region_width[i] <= 0: # <<<<<<<<<<<<<< @@ -16795,18 +18001,18 @@ __pyx_t_4 = (((__pyx_v_region_width[__pyx_v_i]) <= 0.0) != 0); if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":839 + /* "yt/geometry/selection_routines.pyx":831 * raise RuntimeError( * "Region right edge[%s] < left edge: width = %s" % ( * i, region_width[i])) # <<<<<<<<<<<<<< * * for i in range(3): */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_region_width[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((__pyx_v_region_width[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); @@ -16815,37 +18021,37 @@ __pyx_t_1 = 0; __pyx_t_2 = 0; - /* "yt/geometry/selection_routines.pyx":838 + /* "yt/geometry/selection_routines.pyx":830 * if region_width[i] <= 0: * raise RuntimeError( * "Region right edge[%s] < left edge: width = %s" % ( # <<<<<<<<<<<<<< * i, region_width[i])) * */ - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Region_right_edge_s_left_edge_wi, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Region_right_edge_s_left_edge_wi, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/selection_routines.pyx":837 + /* "yt/geometry/selection_routines.pyx":829 * p[i] = dobj.ds.periodicity[i] * if region_width[i] <= 0: * raise RuntimeError( # <<<<<<<<<<<<<< * "Region right edge[%s] < left edge: width = %s" % ( * i, region_width[i])) */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 829, __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 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 837, __pyx_L1_error) + __PYX_ERR(0, 829, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":836 + /* "yt/geometry/selection_routines.pyx":828 * region_width[i] = RE[i] - LE[i] * p[i] = dobj.ds.periodicity[i] * if region_width[i] <= 0: # <<<<<<<<<<<<<< @@ -16855,7 +18061,7 @@ } } - /* "yt/geometry/selection_routines.pyx":841 + /* "yt/geometry/selection_routines.pyx":833 * i, region_width[i])) * * for i in range(3): # <<<<<<<<<<<<<< @@ -16865,7 +18071,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < 3; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "yt/geometry/selection_routines.pyx":843 + /* "yt/geometry/selection_routines.pyx":835 * for i in range(3): * * if p[i]: # <<<<<<<<<<<<<< @@ -16875,7 +18081,7 @@ __pyx_t_4 = ((__pyx_v_p[__pyx_v_i]) != 0); if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":847 + /* "yt/geometry/selection_routines.pyx":839 * # without any adjustments. This is for short-circuiting the * # short-circuit of the loop down below in mask filling. * if LE[i] < DLE[i] or LE[i] > DRE[i] or RE[i] > DRE[i]: # <<<<<<<<<<<<<< @@ -16905,7 +18111,7 @@ __pyx_L10_bool_binop_done:; if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":848 + /* "yt/geometry/selection_routines.pyx":840 * # short-circuit of the loop down below in mask filling. * if LE[i] < DLE[i] or LE[i] > DRE[i] or RE[i] > DRE[i]: * self.check_period = True # <<<<<<<<<<<<<< @@ -16914,7 +18120,7 @@ */ __pyx_v_self->check_period = 1; - /* "yt/geometry/selection_routines.pyx":847 + /* "yt/geometry/selection_routines.pyx":839 * # without any adjustments. This is for short-circuiting the * # short-circuit of the loop down below in mask filling. * if LE[i] < DLE[i] or LE[i] > DRE[i] or RE[i] > DRE[i]: # <<<<<<<<<<<<<< @@ -16923,7 +18129,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":850 + /* "yt/geometry/selection_routines.pyx":842 * self.check_period = True * # shift so left_edge guaranteed in domain * if LE[i] < DLE[i]: # <<<<<<<<<<<<<< @@ -16935,7 +18141,7 @@ __pyx_t_4 = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_LE.data + __pyx_t_16 * __pyx_v_LE.strides[0]) ))) < (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_DLE.data + __pyx_t_17 * __pyx_v_DLE.strides[0]) )))) != 0); if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":851 + /* "yt/geometry/selection_routines.pyx":843 * # shift so left_edge guaranteed in domain * if LE[i] < DLE[i]: * LE[i] += DW[i] # <<<<<<<<<<<<<< @@ -16946,7 +18152,7 @@ __pyx_t_19 = __pyx_v_i; *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_LE.data + __pyx_t_19 * __pyx_v_LE.strides[0]) )) += (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_DW.data + __pyx_t_18 * __pyx_v_DW.strides[0]) ))); - /* "yt/geometry/selection_routines.pyx":852 + /* "yt/geometry/selection_routines.pyx":844 * if LE[i] < DLE[i]: * LE[i] += DW[i] * RE[i] += DW[i] # <<<<<<<<<<<<<< @@ -16957,7 +18163,7 @@ __pyx_t_21 = __pyx_v_i; *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_RE.data + __pyx_t_21 * __pyx_v_RE.strides[0]) )) += (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_DW.data + __pyx_t_20 * __pyx_v_DW.strides[0]) ))); - /* "yt/geometry/selection_routines.pyx":850 + /* "yt/geometry/selection_routines.pyx":842 * self.check_period = True * # shift so left_edge guaranteed in domain * if LE[i] < DLE[i]: # <<<<<<<<<<<<<< @@ -16967,7 +18173,7 @@ goto __pyx_L13; } - /* "yt/geometry/selection_routines.pyx":853 + /* "yt/geometry/selection_routines.pyx":845 * LE[i] += DW[i] * RE[i] += DW[i] * elif LE[i] > DRE[i]: # <<<<<<<<<<<<<< @@ -16979,7 +18185,7 @@ __pyx_t_4 = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_LE.data + __pyx_t_22 * __pyx_v_LE.strides[0]) ))) > (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_DRE.data + __pyx_t_23 * __pyx_v_DRE.strides[0]) )))) != 0); if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":854 + /* "yt/geometry/selection_routines.pyx":846 * RE[i] += DW[i] * elif LE[i] > DRE[i]: * LE[i] -= DW[i] # <<<<<<<<<<<<<< @@ -16990,7 +18196,7 @@ __pyx_t_25 = __pyx_v_i; *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_LE.data + __pyx_t_25 * __pyx_v_LE.strides[0]) )) -= (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_DW.data + __pyx_t_24 * __pyx_v_DW.strides[0]) ))); - /* "yt/geometry/selection_routines.pyx":855 + /* "yt/geometry/selection_routines.pyx":847 * elif LE[i] > DRE[i]: * LE[i] -= DW[i] * RE[i] -= DW[i] # <<<<<<<<<<<<<< @@ -17001,7 +18207,7 @@ __pyx_t_27 = __pyx_v_i; *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_RE.data + __pyx_t_27 * __pyx_v_RE.strides[0]) )) -= (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_DW.data + __pyx_t_26 * __pyx_v_DW.strides[0]) ))); - /* "yt/geometry/selection_routines.pyx":853 + /* "yt/geometry/selection_routines.pyx":845 * LE[i] += DW[i] * RE[i] += DW[i] * elif LE[i] > DRE[i]: # <<<<<<<<<<<<<< @@ -17011,7 +18217,7 @@ } __pyx_L13:; - /* "yt/geometry/selection_routines.pyx":843 + /* "yt/geometry/selection_routines.pyx":835 * for i in range(3): * * if p[i]: # <<<<<<<<<<<<<< @@ -17021,7 +18227,7 @@ goto __pyx_L8; } - /* "yt/geometry/selection_routines.pyx":857 + /* "yt/geometry/selection_routines.pyx":849 * RE[i] -= DW[i] * else: * if LE[i] < DLE[i] or RE[i] > DRE[i]: # <<<<<<<<<<<<<< @@ -17044,58 +18250,58 @@ __pyx_L15_bool_binop_done:; if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":867 + /* "yt/geometry/selection_routines.pyx":859 * "load a smaller region that does not border the edge or " * "override the periodicity for this dataset." % \ * (i, dobj.left_edge[i], dobj.right_edge[i], # <<<<<<<<<<<<<< * dobj.ds.domain_left_edge[i], dobj.ds.domain_right_edge[i]) * ) */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_left_edge); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 867, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_left_edge); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_right_edge); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 867, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_right_edge); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_32 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 867, __pyx_L1_error) + __pyx_t_32 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_32); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/selection_routines.pyx":868 + /* "yt/geometry/selection_routines.pyx":860 * "override the periodicity for this dataset." % \ * (i, dobj.left_edge[i], dobj.right_edge[i], * dobj.ds.domain_left_edge[i], dobj.ds.domain_right_edge[i]) # <<<<<<<<<<<<<< * ) * # Already ensured in code */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_domain_left_edge); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_domain_left_edge); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_33, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_33, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); - __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_domain_right_edge); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_domain_right_edge); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_34); __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - __pyx_t_33 = __Pyx_GetItemInt(__pyx_t_34, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_t_33 = __Pyx_GetItemInt(__pyx_t_34, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - /* "yt/geometry/selection_routines.pyx":867 + /* "yt/geometry/selection_routines.pyx":859 * "load a smaller region that does not border the edge or " * "override the periodicity for this dataset." % \ * (i, dobj.left_edge[i], dobj.right_edge[i], # <<<<<<<<<<<<<< * dobj.ds.domain_left_edge[i], dobj.ds.domain_right_edge[i]) * ) */ - __pyx_t_34 = PyTuple_New(5); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 867, __pyx_L1_error) + __pyx_t_34 = PyTuple_New(5); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_34); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_2); @@ -17113,37 +18319,37 @@ __pyx_t_8 = 0; __pyx_t_33 = 0; - /* "yt/geometry/selection_routines.pyx":866 + /* "yt/geometry/selection_routines.pyx":858 * "up to the domain boundary. Two possible solutions are to " * "load a smaller region that does not border the edge or " * "override the periodicity for this dataset." % \ # <<<<<<<<<<<<<< * (i, dobj.left_edge[i], dobj.right_edge[i], * dobj.ds.domain_left_edge[i], dobj.ds.domain_right_edge[i]) */ - __pyx_t_33 = __Pyx_PyString_Format(__pyx_kp_s_Error_yt_attempted_to_read_outsi, __pyx_t_34); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 866, __pyx_L1_error) + __pyx_t_33 = __Pyx_PyString_Format(__pyx_kp_s_Error_yt_attempted_to_read_outsi, __pyx_t_34); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - /* "yt/geometry/selection_routines.pyx":858 + /* "yt/geometry/selection_routines.pyx":850 * else: * if LE[i] < DLE[i] or RE[i] > DRE[i]: * raise RuntimeError( # <<<<<<<<<<<<<< * "Error: yt attempted to read outside the boundaries of " * "a non-periodic domain along dimension %s.\n" */ - __pyx_t_34 = PyTuple_New(1); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_34 = PyTuple_New(1); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_34); __Pyx_GIVEREF(__pyx_t_33); PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_33); __pyx_t_33 = 0; - __pyx_t_33 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_34, NULL); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_33 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_34, NULL); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; __Pyx_Raise(__pyx_t_33, 0, 0, 0); __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - __PYX_ERR(0, 858, __pyx_L1_error) + __PYX_ERR(0, 850, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":857 + /* "yt/geometry/selection_routines.pyx":849 * RE[i] -= DW[i] * else: * if LE[i] < DLE[i] or RE[i] > DRE[i]: # <<<<<<<<<<<<<< @@ -17154,7 +18360,7 @@ } __pyx_L8:; - /* "yt/geometry/selection_routines.pyx":871 + /* "yt/geometry/selection_routines.pyx":863 * ) * # Already ensured in code * self.left_edge[i] = LE[i] # <<<<<<<<<<<<<< @@ -17164,7 +18370,7 @@ __pyx_t_35 = __pyx_v_i; (__pyx_v_self->left_edge[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_LE.data + __pyx_t_35 * __pyx_v_LE.strides[0]) ))); - /* "yt/geometry/selection_routines.pyx":872 + /* "yt/geometry/selection_routines.pyx":864 * # Already ensured in code * self.left_edge[i] = LE[i] * self.right_edge[i] = RE[i] # <<<<<<<<<<<<<< @@ -17174,7 +18380,7 @@ __pyx_t_36 = __pyx_v_i; (__pyx_v_self->right_edge[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_RE.data + __pyx_t_36 * __pyx_v_RE.strides[0]) ))); - /* "yt/geometry/selection_routines.pyx":873 + /* "yt/geometry/selection_routines.pyx":865 * self.left_edge[i] = LE[i] * self.right_edge[i] = RE[i] * self.right_edge_shift[i] = RE[i] - DW[i] # <<<<<<<<<<<<<< @@ -17185,7 +18391,7 @@ __pyx_t_38 = __pyx_v_i; (__pyx_v_self->right_edge_shift[__pyx_v_i]) = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_RE.data + __pyx_t_37 * __pyx_v_RE.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_DW.data + __pyx_t_38 * __pyx_v_DW.strides[0]) )))); - /* "yt/geometry/selection_routines.pyx":874 + /* "yt/geometry/selection_routines.pyx":866 * self.right_edge[i] = RE[i] * self.right_edge_shift[i] = RE[i] - DW[i] * if not self.periodicity[i]: # <<<<<<<<<<<<<< @@ -17195,26 +18401,26 @@ __pyx_t_4 = ((!((__pyx_v_self->__pyx_base.periodicity[__pyx_v_i]) != 0)) != 0); if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":875 + /* "yt/geometry/selection_routines.pyx":867 * self.right_edge_shift[i] = RE[i] - DW[i] * if not self.periodicity[i]: * self.right_edge_shift[i] = -np.inf # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_t_33 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_33 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); - __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_inf); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_inf); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_34); __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - __pyx_t_33 = PyNumber_Negative(__pyx_t_34); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_33 = PyNumber_Negative(__pyx_t_34); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - __pyx_t_39 = __pyx_PyFloat_AsDouble(__pyx_t_33); if (unlikely((__pyx_t_39 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_39 = __pyx_PyFloat_AsDouble(__pyx_t_33); if (unlikely((__pyx_t_39 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; (__pyx_v_self->right_edge_shift[__pyx_v_i]) = __pyx_t_39; - /* "yt/geometry/selection_routines.pyx":874 + /* "yt/geometry/selection_routines.pyx":866 * self.right_edge[i] = RE[i] * self.right_edge_shift[i] = RE[i] - DW[i] * if not self.periodicity[i]: # <<<<<<<<<<<<<< @@ -17224,7 +18430,7 @@ } } - /* "yt/geometry/selection_routines.pyx":817 + /* "yt/geometry/selection_routines.pyx":809 * @cython.boundscheck(False) * @cython.wraparound(False) * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -17255,7 +18461,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":880 +/* "yt/geometry/selection_routines.pyx":872 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -17270,7 +18476,7 @@ int __pyx_t_2; int __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":883 + /* "yt/geometry/selection_routines.pyx":875 * np.float64_t right_edge[3]) nogil: * cdef int i * for i in range(3): # <<<<<<<<<<<<<< @@ -17280,7 +18486,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":884 + /* "yt/geometry/selection_routines.pyx":876 * cdef int i * for i in range(3): * if (right_edge[i] < self.left_edge[i] and \ # <<<<<<<<<<<<<< @@ -17293,7 +18499,7 @@ } else { } - /* "yt/geometry/selection_routines.pyx":885 + /* "yt/geometry/selection_routines.pyx":877 * for i in range(3): * if (right_edge[i] < self.left_edge[i] and \ * left_edge[i] >= self.right_edge_shift[i]) or \ # <<<<<<<<<<<<<< @@ -17308,7 +18514,7 @@ } __pyx_L7_next_or:; - /* "yt/geometry/selection_routines.pyx":886 + /* "yt/geometry/selection_routines.pyx":878 * if (right_edge[i] < self.left_edge[i] and \ * left_edge[i] >= self.right_edge_shift[i]) or \ * left_edge[i] >= self.right_edge[i]: # <<<<<<<<<<<<<< @@ -17319,7 +18525,7 @@ __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":884 + /* "yt/geometry/selection_routines.pyx":876 * cdef int i * for i in range(3): * if (right_edge[i] < self.left_edge[i] and \ # <<<<<<<<<<<<<< @@ -17328,7 +18534,7 @@ */ if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pyx":887 + /* "yt/geometry/selection_routines.pyx":879 * left_edge[i] >= self.right_edge_shift[i]) or \ * left_edge[i] >= self.right_edge[i]: * return 0 # <<<<<<<<<<<<<< @@ -17338,7 +18544,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":884 + /* "yt/geometry/selection_routines.pyx":876 * cdef int i * for i in range(3): * if (right_edge[i] < self.left_edge[i] and \ # <<<<<<<<<<<<<< @@ -17348,7 +18554,7 @@ } } - /* "yt/geometry/selection_routines.pyx":888 + /* "yt/geometry/selection_routines.pyx":880 * left_edge[i] >= self.right_edge[i]: * return 0 * return 1 # <<<<<<<<<<<<<< @@ -17358,7 +18564,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":880 + /* "yt/geometry/selection_routines.pyx":872 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -17371,7 +18577,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":893 +/* "yt/geometry/selection_routines.pyx":885 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -17387,7 +18593,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":897 + /* "yt/geometry/selection_routines.pyx":889 * cdef np.float64_t right_edge[3] * cdef int i * if self.loose_selection: # <<<<<<<<<<<<<< @@ -17397,7 +18603,7 @@ __pyx_t_1 = (__pyx_v_self->loose_selection != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":898 + /* "yt/geometry/selection_routines.pyx":890 * cdef int i * if self.loose_selection: * for i in range(3): # <<<<<<<<<<<<<< @@ -17407,7 +18613,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":899 + /* "yt/geometry/selection_routines.pyx":891 * if self.loose_selection: * for i in range(3): * left_edge[i] = pos[i] - dds[i]*0.5 # <<<<<<<<<<<<<< @@ -17416,7 +18622,7 @@ */ (__pyx_v_left_edge[__pyx_v_i]) = ((__pyx_v_pos[__pyx_v_i]) - ((__pyx_v_dds[__pyx_v_i]) * 0.5)); - /* "yt/geometry/selection_routines.pyx":900 + /* "yt/geometry/selection_routines.pyx":892 * for i in range(3): * left_edge[i] = pos[i] - dds[i]*0.5 * right_edge[i] = pos[i] + dds[i]*0.5 # <<<<<<<<<<<<<< @@ -17426,7 +18632,7 @@ (__pyx_v_right_edge[__pyx_v_i]) = ((__pyx_v_pos[__pyx_v_i]) + ((__pyx_v_dds[__pyx_v_i]) * 0.5)); } - /* "yt/geometry/selection_routines.pyx":901 + /* "yt/geometry/selection_routines.pyx":893 * left_edge[i] = pos[i] - dds[i]*0.5 * right_edge[i] = pos[i] + dds[i]*0.5 * return self.select_bbox(left_edge, right_edge) # <<<<<<<<<<<<<< @@ -17436,7 +18642,7 @@ __pyx_r = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_RegionSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.select_bbox(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_left_edge, __pyx_v_right_edge); goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":897 + /* "yt/geometry/selection_routines.pyx":889 * cdef np.float64_t right_edge[3] * cdef int i * if self.loose_selection: # <<<<<<<<<<<<<< @@ -17445,7 +18651,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":902 + /* "yt/geometry/selection_routines.pyx":894 * right_edge[i] = pos[i] + dds[i]*0.5 * return self.select_bbox(left_edge, right_edge) * return self.select_point(pos) # <<<<<<<<<<<<<< @@ -17455,7 +18661,7 @@ __pyx_r = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_RegionSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.select_point(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_pos); goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":893 + /* "yt/geometry/selection_routines.pyx":885 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -17468,7 +18674,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":907 +/* "yt/geometry/selection_routines.pyx":899 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -17484,7 +18690,7 @@ int __pyx_t_3; int __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":909 + /* "yt/geometry/selection_routines.pyx":901 * cdef int select_point(self, np.float64_t pos[3]) nogil: * cdef int i * for i in range(3): # <<<<<<<<<<<<<< @@ -17494,7 +18700,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":910 + /* "yt/geometry/selection_routines.pyx":902 * cdef int i * for i in range(3): * if (self.right_edge_shift[i] <= pos[i] < self.left_edge[i]) or \ # <<<<<<<<<<<<<< @@ -17512,7 +18718,7 @@ goto __pyx_L6_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":911 + /* "yt/geometry/selection_routines.pyx":903 * for i in range(3): * if (self.right_edge_shift[i] <= pos[i] < self.left_edge[i]) or \ * pos[i] >= self.right_edge[i]: # <<<<<<<<<<<<<< @@ -17523,7 +18729,7 @@ __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":910 + /* "yt/geometry/selection_routines.pyx":902 * cdef int i * for i in range(3): * if (self.right_edge_shift[i] <= pos[i] < self.left_edge[i]) or \ # <<<<<<<<<<<<<< @@ -17532,7 +18738,7 @@ */ if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pyx":912 + /* "yt/geometry/selection_routines.pyx":904 * if (self.right_edge_shift[i] <= pos[i] < self.left_edge[i]) or \ * pos[i] >= self.right_edge[i]: * return 0 # <<<<<<<<<<<<<< @@ -17542,7 +18748,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":910 + /* "yt/geometry/selection_routines.pyx":902 * cdef int i * for i in range(3): * if (self.right_edge_shift[i] <= pos[i] < self.left_edge[i]) or \ # <<<<<<<<<<<<<< @@ -17552,7 +18758,7 @@ } } - /* "yt/geometry/selection_routines.pyx":913 + /* "yt/geometry/selection_routines.pyx":905 * pos[i] >= self.right_edge[i]: * return 0 * return 1 # <<<<<<<<<<<<<< @@ -17562,7 +18768,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":907 + /* "yt/geometry/selection_routines.pyx":899 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -17575,7 +18781,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":918 +/* "yt/geometry/selection_routines.pyx":910 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int fill_mask_selector(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -17590,8 +18796,8 @@ int __pyx_v_total; int __pyx_v_this_level; __pyx_t_5numpy_float64_t __pyx_v_pos[3]; - int __pyx_v_si[3]; - int __pyx_v_ei[3]; + __pyx_t_5numpy_int64_t __pyx_v_si[3]; + __pyx_t_5numpy_int64_t __pyx_v_ei[3]; __Pyx_LocalBuf_ND __pyx_pybuffernd_child_mask; __Pyx_Buffer __pyx_pybuffer_child_mask; __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; @@ -17601,10 +18807,10 @@ int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; int __pyx_t_6; - int __pyx_t_7; + __pyx_t_5numpy_int64_t __pyx_t_7; int __pyx_t_8; Py_ssize_t __pyx_t_9; Py_ssize_t __pyx_t_10; @@ -17627,16 +18833,16 @@ __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_child_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 918, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_child_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 910, __pyx_L1_error) } __pyx_pybuffernd_child_mask.diminfo[0].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_mask.diminfo[0].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_child_mask.diminfo[1].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_child_mask.diminfo[1].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_child_mask.diminfo[2].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_child_mask.diminfo[2].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 918, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 910, __pyx_L1_error) } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; - /* "yt/geometry/selection_routines.pyx":925 + /* "yt/geometry/selection_routines.pyx":917 * int level): * cdef int i, j, k * cdef int total = 0, this_level = 0 # <<<<<<<<<<<<<< @@ -17646,7 +18852,7 @@ __pyx_v_total = 0; __pyx_v_this_level = 0; - /* "yt/geometry/selection_routines.pyx":927 + /* "yt/geometry/selection_routines.pyx":919 * cdef int total = 0, this_level = 0 * cdef np.float64_t pos[3] * if level < self.min_level or level > self.max_level: # <<<<<<<<<<<<<< @@ -17664,7 +18870,7 @@ __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":928 + /* "yt/geometry/selection_routines.pyx":920 * cdef np.float64_t pos[3] * if level < self.min_level or level > self.max_level: * return 0 # <<<<<<<<<<<<<< @@ -17674,7 +18880,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":927 + /* "yt/geometry/selection_routines.pyx":919 * cdef int total = 0, this_level = 0 * cdef np.float64_t pos[3] * if level < self.min_level or level > self.max_level: # <<<<<<<<<<<<<< @@ -17683,83 +18889,83 @@ */ } - /* "yt/geometry/selection_routines.pyx":929 + /* "yt/geometry/selection_routines.pyx":921 * if level < self.min_level or level > self.max_level: * return 0 * if level == self.max_level: # <<<<<<<<<<<<<< * this_level = 1 - * cdef int si[3] + * cdef np.int64_t si[3] */ __pyx_t_1 = ((__pyx_v_level == __pyx_v_self->__pyx_base.max_level) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":930 + /* "yt/geometry/selection_routines.pyx":922 * return 0 * if level == self.max_level: * this_level = 1 # <<<<<<<<<<<<<< - * cdef int si[3] - * cdef int ei[3] + * cdef np.int64_t si[3] + * cdef np.int64_t ei[3] */ __pyx_v_this_level = 1; - /* "yt/geometry/selection_routines.pyx":929 + /* "yt/geometry/selection_routines.pyx":921 * if level < self.min_level or level > self.max_level: * return 0 * if level == self.max_level: # <<<<<<<<<<<<<< * this_level = 1 - * cdef int si[3] + * cdef np.int64_t si[3] */ } - /* "yt/geometry/selection_routines.pyx":936 - * #print self.right_edge[0], self.right_edge[1], self.right_edge[2], - * #print self.right_edge_shift[0], self.right_edge_shift[1], self.right_edge_shift[2] + /* "yt/geometry/selection_routines.pyx":925 + * cdef np.int64_t si[3] + * cdef np.int64_t ei[3] * if not self.check_period: # <<<<<<<<<<<<<< * for i in range(3): - * si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) + * si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) */ __pyx_t_1 = ((!(__pyx_v_self->check_period != 0)) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":937 - * #print self.right_edge_shift[0], self.right_edge_shift[1], self.right_edge_shift[2] + /* "yt/geometry/selection_routines.pyx":926 + * cdef np.int64_t ei[3] * if not self.check_period: * for i in range(3): # <<<<<<<<<<<<<< - * si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) - * ei[i] = ((self.right_edge[i] - left_edge[i])/dds[i]) + * si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) + * ei[i] = ((self.right_edge[i] - left_edge[i])/dds[i]) */ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":938 + /* "yt/geometry/selection_routines.pyx":927 * if not self.check_period: * for i in range(3): - * si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) # <<<<<<<<<<<<<< - * ei[i] = ((self.right_edge[i] - left_edge[i])/dds[i]) + * si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) # <<<<<<<<<<<<<< + * ei[i] = ((self.right_edge[i] - left_edge[i])/dds[i]) * si[i] = iclip(si[i] - 1, 0, dim[i]) */ - (__pyx_v_si[__pyx_v_i]) = ((int)(((__pyx_v_self->left_edge[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))); + (__pyx_v_si[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t)(((__pyx_v_self->left_edge[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))); - /* "yt/geometry/selection_routines.pyx":939 + /* "yt/geometry/selection_routines.pyx":928 * for i in range(3): - * si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) - * ei[i] = ((self.right_edge[i] - left_edge[i])/dds[i]) # <<<<<<<<<<<<<< + * si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) + * ei[i] = ((self.right_edge[i] - left_edge[i])/dds[i]) # <<<<<<<<<<<<<< * si[i] = iclip(si[i] - 1, 0, dim[i]) * ei[i] = iclip(ei[i] + 1, 0, dim[i]) */ - (__pyx_v_ei[__pyx_v_i]) = ((int)(((__pyx_v_self->right_edge[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))); + (__pyx_v_ei[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t)(((__pyx_v_self->right_edge[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))); - /* "yt/geometry/selection_routines.pyx":940 - * si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) - * ei[i] = ((self.right_edge[i] - left_edge[i])/dds[i]) + /* "yt/geometry/selection_routines.pyx":929 + * si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) + * ei[i] = ((self.right_edge[i] - left_edge[i])/dds[i]) * si[i] = iclip(si[i] - 1, 0, dim[i]) # <<<<<<<<<<<<<< * ei[i] = iclip(ei[i] + 1, 0, dim[i]) * else: */ (__pyx_v_si[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(((__pyx_v_si[__pyx_v_i]) - 1), 0, (__pyx_v_dim[__pyx_v_i])); - /* "yt/geometry/selection_routines.pyx":941 - * ei[i] = ((self.right_edge[i] - left_edge[i])/dds[i]) + /* "yt/geometry/selection_routines.pyx":930 + * ei[i] = ((self.right_edge[i] - left_edge[i])/dds[i]) * si[i] = iclip(si[i] - 1, 0, dim[i]) * ei[i] = iclip(ei[i] + 1, 0, dim[i]) # <<<<<<<<<<<<<< * else: @@ -17768,17 +18974,17 @@ (__pyx_v_ei[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(((__pyx_v_ei[__pyx_v_i]) + 1), 0, (__pyx_v_dim[__pyx_v_i])); } - /* "yt/geometry/selection_routines.pyx":936 - * #print self.right_edge[0], self.right_edge[1], self.right_edge[2], - * #print self.right_edge_shift[0], self.right_edge_shift[1], self.right_edge_shift[2] + /* "yt/geometry/selection_routines.pyx":925 + * cdef np.int64_t si[3] + * cdef np.int64_t ei[3] * if not self.check_period: # <<<<<<<<<<<<<< * for i in range(3): - * si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) + * si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) */ goto __pyx_L7; } - /* "yt/geometry/selection_routines.pyx":943 + /* "yt/geometry/selection_routines.pyx":932 * ei[i] = iclip(ei[i] + 1, 0, dim[i]) * else: * for i in range(3): # <<<<<<<<<<<<<< @@ -17789,7 +18995,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":944 + /* "yt/geometry/selection_routines.pyx":933 * else: * for i in range(3): * si[i] = 0 # <<<<<<<<<<<<<< @@ -17798,7 +19004,7 @@ */ (__pyx_v_si[__pyx_v_i]) = 0; - /* "yt/geometry/selection_routines.pyx":945 + /* "yt/geometry/selection_routines.pyx":934 * for i in range(3): * si[i] = 0 * ei[i] = dim[i] # <<<<<<<<<<<<<< @@ -17810,7 +19016,7 @@ } __pyx_L7:; - /* "yt/geometry/selection_routines.pyx":946 + /* "yt/geometry/selection_routines.pyx":935 * si[i] = 0 * ei[i] = dim[i] * with nogil: # <<<<<<<<<<<<<< @@ -17821,10 +19027,11 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/geometry/selection_routines.pyx":947 + /* "yt/geometry/selection_routines.pyx":936 * ei[i] = dim[i] * with nogil: * pos[0] = left_edge[0] + (si[0] + 0.5) * dds[0] # <<<<<<<<<<<<<< @@ -17833,18 +19040,18 @@ */ (__pyx_v_pos[0]) = ((__pyx_v_left_edge[0]) + (((__pyx_v_si[0]) + 0.5) * (__pyx_v_dds[0]))); - /* "yt/geometry/selection_routines.pyx":948 + /* "yt/geometry/selection_routines.pyx":937 * with nogil: * pos[0] = left_edge[0] + (si[0] + 0.5) * dds[0] * for i in range(si[0], ei[0]): # <<<<<<<<<<<<<< * pos[1] = left_edge[1] + (si[1] + 0.5) * dds[1] * for j in range(si[1], ei[1]): */ - __pyx_t_3 = (__pyx_v_ei[0]); - for (__pyx_t_4 = (__pyx_v_si[0]); __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; + __pyx_t_4 = (__pyx_v_ei[0]); + for (__pyx_t_3 = (__pyx_v_si[0]); __pyx_t_3 < __pyx_t_4; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":949 + /* "yt/geometry/selection_routines.pyx":938 * pos[0] = left_edge[0] + (si[0] + 0.5) * dds[0] * for i in range(si[0], ei[0]): * pos[1] = left_edge[1] + (si[1] + 0.5) * dds[1] # <<<<<<<<<<<<<< @@ -17853,7 +19060,7 @@ */ (__pyx_v_pos[1]) = ((__pyx_v_left_edge[1]) + (((__pyx_v_si[1]) + 0.5) * (__pyx_v_dds[1]))); - /* "yt/geometry/selection_routines.pyx":950 + /* "yt/geometry/selection_routines.pyx":939 * for i in range(si[0], ei[0]): * pos[1] = left_edge[1] + (si[1] + 0.5) * dds[1] * for j in range(si[1], ei[1]): # <<<<<<<<<<<<<< @@ -17864,7 +19071,7 @@ for (__pyx_t_6 = (__pyx_v_si[1]); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":951 + /* "yt/geometry/selection_routines.pyx":940 * pos[1] = left_edge[1] + (si[1] + 0.5) * dds[1] * for j in range(si[1], ei[1]): * pos[2] = left_edge[2] + (si[2] + 0.5) * dds[2] # <<<<<<<<<<<<<< @@ -17873,7 +19080,7 @@ */ (__pyx_v_pos[2]) = ((__pyx_v_left_edge[2]) + (((__pyx_v_si[2]) + 0.5) * (__pyx_v_dds[2]))); - /* "yt/geometry/selection_routines.pyx":952 + /* "yt/geometry/selection_routines.pyx":941 * for j in range(si[1], ei[1]): * pos[2] = left_edge[2] + (si[2] + 0.5) * dds[2] * for k in range(si[2], ei[2]): # <<<<<<<<<<<<<< @@ -17884,7 +19091,7 @@ for (__pyx_t_8 = (__pyx_v_si[2]); __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_k = __pyx_t_8; - /* "yt/geometry/selection_routines.pyx":953 + /* "yt/geometry/selection_routines.pyx":942 * pos[2] = left_edge[2] + (si[2] + 0.5) * dds[2] * for k in range(si[2], ei[2]): * if child_mask[i, j, k] == 1 or this_level == 1: # <<<<<<<<<<<<<< @@ -17905,7 +19112,7 @@ __pyx_L22_bool_binop_done:; if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":954 + /* "yt/geometry/selection_routines.pyx":943 * for k in range(si[2], ei[2]): * if child_mask[i, j, k] == 1 or this_level == 1: * mask[i, j, k] = self.select_cell(pos, dds) # <<<<<<<<<<<<<< @@ -17917,7 +19124,7 @@ __pyx_t_14 = __pyx_v_k; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[2].strides) = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_RegionSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.select_cell(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_pos, __pyx_v_dds); - /* "yt/geometry/selection_routines.pyx":955 + /* "yt/geometry/selection_routines.pyx":944 * if child_mask[i, j, k] == 1 or this_level == 1: * mask[i, j, k] = self.select_cell(pos, dds) * total += mask[i, j, k] # <<<<<<<<<<<<<< @@ -17929,7 +19136,7 @@ __pyx_t_17 = __pyx_v_k; __pyx_v_total = (__pyx_v_total + (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_mask.diminfo[2].strides))); - /* "yt/geometry/selection_routines.pyx":953 + /* "yt/geometry/selection_routines.pyx":942 * pos[2] = left_edge[2] + (si[2] + 0.5) * dds[2] * for k in range(si[2], ei[2]): * if child_mask[i, j, k] == 1 or this_level == 1: # <<<<<<<<<<<<<< @@ -17938,7 +19145,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":956 + /* "yt/geometry/selection_routines.pyx":945 * mask[i, j, k] = self.select_cell(pos, dds) * total += mask[i, j, k] * pos[2] += dds[2] # <<<<<<<<<<<<<< @@ -17949,7 +19156,7 @@ (__pyx_v_pos[__pyx_t_18]) = ((__pyx_v_pos[__pyx_t_18]) + (__pyx_v_dds[2])); } - /* "yt/geometry/selection_routines.pyx":957 + /* "yt/geometry/selection_routines.pyx":946 * total += mask[i, j, k] * pos[2] += dds[2] * pos[1] += dds[1] # <<<<<<<<<<<<<< @@ -17960,7 +19167,7 @@ (__pyx_v_pos[__pyx_t_18]) = ((__pyx_v_pos[__pyx_t_18]) + (__pyx_v_dds[1])); } - /* "yt/geometry/selection_routines.pyx":958 + /* "yt/geometry/selection_routines.pyx":947 * pos[2] += dds[2] * pos[1] += dds[1] * pos[0] += dds[0] # <<<<<<<<<<<<<< @@ -17972,7 +19179,7 @@ } } - /* "yt/geometry/selection_routines.pyx":946 + /* "yt/geometry/selection_routines.pyx":935 * si[i] = 0 * ei[i] = dim[i] * with nogil: # <<<<<<<<<<<<<< @@ -17982,6 +19189,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L14; @@ -17990,7 +19198,7 @@ } } - /* "yt/geometry/selection_routines.pyx":959 + /* "yt/geometry/selection_routines.pyx":948 * pos[1] += dds[1] * pos[0] += dds[0] * return total # <<<<<<<<<<<<<< @@ -18000,7 +19208,7 @@ __pyx_r = __pyx_v_total; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":918 + /* "yt/geometry/selection_routines.pyx":910 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int fill_mask_selector(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -18017,7 +19225,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_mask.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.geometry.selection_routines.RegionSelector.fill_mask_selector", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.RegionSelector.fill_mask_selector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; goto __pyx_L2; __pyx_L0:; @@ -18028,7 +19236,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":962 +/* "yt/geometry/selection_routines.pyx":951 * * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -18061,7 +19269,7 @@ PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":963 + /* "yt/geometry/selection_routines.pyx":952 * * def _hash_vals(self): * return (("left_edge[0]", self.left_edge[0]), # <<<<<<<<<<<<<< @@ -18069,9 +19277,9 @@ * ("left_edge[2]", self.left_edge[2]), */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->left_edge[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->left_edge[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_kp_s_left_edge_0); __Pyx_GIVEREF(__pyx_kp_s_left_edge_0); @@ -18080,16 +19288,16 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":964 + /* "yt/geometry/selection_routines.pyx":953 * def _hash_vals(self): * return (("left_edge[0]", self.left_edge[0]), * ("left_edge[1]", self.left_edge[1]), # <<<<<<<<<<<<<< * ("left_edge[2]", self.left_edge[2]), * ("right_edge[0]", self.right_edge[0]), */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->left_edge[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->left_edge[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_s_left_edge_1); __Pyx_GIVEREF(__pyx_kp_s_left_edge_1); @@ -18098,16 +19306,16 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":965 + /* "yt/geometry/selection_routines.pyx":954 * return (("left_edge[0]", self.left_edge[0]), * ("left_edge[1]", self.left_edge[1]), * ("left_edge[2]", self.left_edge[2]), # <<<<<<<<<<<<<< * ("right_edge[0]", self.right_edge[0]), * ("right_edge[1]", self.right_edge[1]), */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->left_edge[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->left_edge[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 965, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_left_edge_2); __Pyx_GIVEREF(__pyx_kp_s_left_edge_2); @@ -18116,16 +19324,16 @@ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":966 + /* "yt/geometry/selection_routines.pyx":955 * ("left_edge[1]", self.left_edge[1]), * ("left_edge[2]", self.left_edge[2]), * ("right_edge[0]", self.right_edge[0]), # <<<<<<<<<<<<<< * ("right_edge[1]", self.right_edge[1]), * ("right_edge[2]", self.right_edge[2])) */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->right_edge[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->right_edge[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_right_edge_0); __Pyx_GIVEREF(__pyx_kp_s_right_edge_0); @@ -18134,16 +19342,16 @@ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":967 + /* "yt/geometry/selection_routines.pyx":956 * ("left_edge[2]", self.left_edge[2]), * ("right_edge[0]", self.right_edge[0]), * ("right_edge[1]", self.right_edge[1]), # <<<<<<<<<<<<<< * ("right_edge[2]", self.right_edge[2])) * */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->right_edge[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->right_edge[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 967, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_kp_s_right_edge_1); __Pyx_GIVEREF(__pyx_kp_s_right_edge_1); @@ -18152,16 +19360,16 @@ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":968 + /* "yt/geometry/selection_routines.pyx":957 * ("right_edge[0]", self.right_edge[0]), * ("right_edge[1]", self.right_edge[1]), * ("right_edge[2]", self.right_edge[2])) # <<<<<<<<<<<<<< * * region_selector = RegionSelector */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->right_edge[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->right_edge[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_kp_s_right_edge_2); __Pyx_GIVEREF(__pyx_kp_s_right_edge_2); @@ -18170,14 +19378,14 @@ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":963 + /* "yt/geometry/selection_routines.pyx":952 * * def _hash_vals(self): * return (("left_edge[0]", self.left_edge[0]), # <<<<<<<<<<<<<< * ("left_edge[1]", self.left_edge[1]), * ("left_edge[2]", self.left_edge[2]), */ - __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -18201,7 +19409,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":962 + /* "yt/geometry/selection_routines.pyx":951 * * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -18226,7 +19434,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":976 +/* "(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_2yt_8geometry_18selection_routines_14RegionSelector_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_14RegionSelector_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_2yt_8geometry_18selection_routines_14RegionSelector_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14RegionSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *__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("yt.geometry.selection_routines.RegionSelector.__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_2yt_8geometry_18selection_routines_14RegionSelector_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_14RegionSelector_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_2yt_8geometry_18selection_routines_14RegionSelector_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14RegionSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *__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("yt.geometry.selection_routines.RegionSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":965 * cdef tuple _conditionals * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -18249,6 +19564,7 @@ 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; } @@ -18259,7 +19575,7 @@ 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(0, 976, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 965, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -18270,7 +19586,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 976, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 965, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.CutRegionSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18284,7 +19600,7 @@ } static PyObject *__pyx_gb_2yt_8geometry_18selection_routines_17CutRegionSelector_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "yt/geometry/selection_routines.pyx":979 +/* "yt/geometry/selection_routines.pyx":968 * positions = np.array([dobj['x'], dobj['y'], dobj['z']]).T * self._conditionals = tuple(dobj.conditionals) * self._positions = set(tuple(position) for position in positions) # <<<<<<<<<<<<<< @@ -18301,7 +19617,7 @@ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_2yt_8geometry_18selection_routines___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 979, __pyx_L1_error) + __PYX_ERR(0, 968, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -18309,7 +19625,7 @@ __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_2yt_8geometry_18selection_routines_17CutRegionSelector_8__init___2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr, __pyx_n_s_yt_geometry_selection_routines); if (unlikely(!gen)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_2yt_8geometry_18selection_routines_17CutRegionSelector_8__init___2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr, __pyx_n_s_yt_geometry_selection_routines); if (unlikely(!gen)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -18342,34 +19658,34 @@ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 979, __pyx_L1_error) - __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 979, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_positions)) { __Pyx_RaiseClosureNameError("positions"); __PYX_ERR(0, 979, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_positions)) { __Pyx_RaiseClosureNameError("positions"); __PYX_ERR(0, 968, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_positions)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_positions)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_positions; __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_positions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_positions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __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, 979, __pyx_L1_error) + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __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, 979, __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, 968, __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, 979, __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, 968, __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, 979, __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, 968, __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, 979, __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, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -18379,7 +19695,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 979, __pyx_L1_error) + else __PYX_ERR(0, 968, __pyx_L1_error) } break; } @@ -18389,9 +19705,9 @@ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_position, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_position); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_position); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 979, __pyx_L1_error) + if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18412,7 +19728,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":976 +/* "yt/geometry/selection_routines.pyx":965 * cdef tuple _conditionals * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -18435,30 +19751,30 @@ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_2yt_8geometry_18selection_routines___pyx_scope_struct____init__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 976, __pyx_L1_error) + __PYX_ERR(0, 965, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } - /* "yt/geometry/selection_routines.pyx":977 + /* "yt/geometry/selection_routines.pyx":966 * * def __init__(self, dobj): * positions = np.array([dobj['x'], dobj['y'], dobj['z']]).T # <<<<<<<<<<<<<< * self._conditionals = tuple(dobj.conditionals) * self._positions = set(tuple(position) for position in positions) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetItem(__pyx_v_dobj, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_dobj, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_GetItem(__pyx_v_dobj, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_4 = PyObject_GetItem(__pyx_v_dobj, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_GetItem(__pyx_v_dobj, __pyx_n_s_z); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_5 = PyObject_GetItem(__pyx_v_dobj, __pyx_n_s_z); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); @@ -18480,14 +19796,14 @@ } } if (!__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __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_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __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, 966, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -18496,42 +19812,42 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __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, 966, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_positions = __pyx_t_3; __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":978 + /* "yt/geometry/selection_routines.pyx":967 * def __init__(self, dobj): * positions = np.array([dobj['x'], dobj['y'], dobj['z']]).T * self._conditionals = tuple(dobj.conditionals) # <<<<<<<<<<<<<< * self._positions = set(tuple(position) for position in positions) * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_conditionals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_conditionals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); @@ -18540,16 +19856,16 @@ __pyx_v_self->_conditionals = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":979 + /* "yt/geometry/selection_routines.pyx":968 * positions = np.array([dobj['x'], dobj['y'], dobj['z']]).T * self._conditionals = tuple(dobj.conditionals) * self._positions = set(tuple(position) for position in positions) # <<<<<<<<<<<<<< * * cdef int select_bbox(self, np.float64_t left_edge[3], */ - __pyx_t_1 = __pyx_pf_2yt_8geometry_18selection_routines_17CutRegionSelector_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_2yt_8geometry_18selection_routines_17CutRegionSelector_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); @@ -18558,7 +19874,7 @@ __pyx_v_self->_positions = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":976 + /* "yt/geometry/selection_routines.pyx":965 * cdef tuple _conditionals * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -18584,7 +19900,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":981 +/* "yt/geometry/selection_routines.pyx":970 * self._positions = set(tuple(position) for position in positions) * * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -18595,7 +19911,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_17CutRegionSelector_select_bbox(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":983 + /* "yt/geometry/selection_routines.pyx":972 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * return 1 # <<<<<<<<<<<<<< @@ -18605,7 +19921,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":981 + /* "yt/geometry/selection_routines.pyx":970 * self._positions = set(tuple(position) for position in positions) * * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -18618,7 +19934,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":985 +/* "yt/geometry/selection_routines.pyx":974 * return 1 * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -18636,14 +19952,14 @@ int __pyx_t_5; int __pyx_t_6; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("select_cell", 0); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - /* "yt/geometry/selection_routines.pyx":986 + /* "yt/geometry/selection_routines.pyx":975 * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * with gil: # <<<<<<<<<<<<<< @@ -18653,24 +19969,24 @@ /*try:*/ { { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - /* "yt/geometry/selection_routines.pyx":987 + /* "yt/geometry/selection_routines.pyx":976 * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * with gil: * if (pos[0], pos[1], pos[2]) in self._positions: # <<<<<<<<<<<<<< * return 1 * else: */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_pos[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L7_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_pos[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_pos[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L7_error) + __pyx_t_2 = PyFloat_FromDouble((__pyx_v_pos[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble((__pyx_v_pos[2])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __pyx_L7_error) + __pyx_t_3 = PyFloat_FromDouble((__pyx_v_pos[2])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 987, __pyx_L7_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -18681,12 +19997,12 @@ __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_self->_positions, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 987, __pyx_L7_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_self->_positions, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 976, __pyx_L7_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { - /* "yt/geometry/selection_routines.pyx":988 + /* "yt/geometry/selection_routines.pyx":977 * with gil: * if (pos[0], pos[1], pos[2]) in self._positions: * return 1 # <<<<<<<<<<<<<< @@ -18696,7 +20012,7 @@ __pyx_r = 1; goto __pyx_L6_return; - /* "yt/geometry/selection_routines.pyx":987 + /* "yt/geometry/selection_routines.pyx":976 * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * with gil: * if (pos[0], pos[1], pos[2]) in self._positions: # <<<<<<<<<<<<<< @@ -18705,7 +20021,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":990 + /* "yt/geometry/selection_routines.pyx":979 * return 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -18718,7 +20034,7 @@ } } - /* "yt/geometry/selection_routines.pyx":986 + /* "yt/geometry/selection_routines.pyx":975 * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * with gil: # <<<<<<<<<<<<<< @@ -18728,13 +20044,13 @@ /*finally:*/ { __pyx_L6_return: { #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif goto __pyx_L3_return; } __pyx_L7_error: { #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif goto __pyx_L4_error; } @@ -18744,19 +20060,19 @@ /*finally:*/ { __pyx_L3_return: { #ifdef WITH_THREAD - __pyx_gilstate_save = PyGILState_Ensure(); + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif goto __pyx_L0; } __pyx_L4_error: { #ifdef WITH_THREAD - __pyx_gilstate_save = PyGILState_Ensure(); + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif goto __pyx_L1_error; } } - /* "yt/geometry/selection_routines.pyx":985 + /* "yt/geometry/selection_routines.pyx":974 * return 1 * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -18772,16 +20088,16 @@ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("yt.geometry.selection_routines.CutRegionSelector.select_cell", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.CutRegionSelector.select_cell", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); __pyx_r = 0; __pyx_L0:; #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":992 +/* "yt/geometry/selection_routines.pyx":981 * return 0 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -18792,7 +20108,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_17CutRegionSelector_select_point(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":993 + /* "yt/geometry/selection_routines.pyx":982 * * cdef int select_point(self, np.float64_t pos[3]) nogil: * return 1 # <<<<<<<<<<<<<< @@ -18802,7 +20118,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":992 + /* "yt/geometry/selection_routines.pyx":981 * return 0 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -18815,7 +20131,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":995 +/* "yt/geometry/selection_routines.pyx":984 * return 1 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -18826,7 +20142,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_17CutRegionSelector_select_sphere(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_radius) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":996 + /* "yt/geometry/selection_routines.pyx":985 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * return 1 # <<<<<<<<<<<<<< @@ -18836,7 +20152,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":995 + /* "yt/geometry/selection_routines.pyx":984 * return 1 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -18849,7 +20165,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":998 +/* "yt/geometry/selection_routines.pyx":987 * return 1 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -18883,7 +20199,7 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":999 + /* "yt/geometry/selection_routines.pyx":988 * * def _hash_vals(self): * t = () # <<<<<<<<<<<<<< @@ -18893,7 +20209,7 @@ __Pyx_INCREF(__pyx_empty_tuple); __pyx_v_t = __pyx_empty_tuple; - /* "yt/geometry/selection_routines.pyx":1000 + /* "yt/geometry/selection_routines.pyx":989 * def _hash_vals(self): * t = () * for i, c in enumerate(self._conditionals): # <<<<<<<<<<<<<< @@ -18906,31 +20222,31 @@ for (;;) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 989, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":1001 + /* "yt/geometry/selection_routines.pyx":990 * t = () * for i, c in enumerate(self._conditionals): * t += ("conditional[%s]" % i, c) # <<<<<<<<<<<<<< * return ("conditionals", t) * */ - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_conditional_s, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_conditional_s, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); @@ -18938,13 +20254,13 @@ __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_c); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_t, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_t, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_t, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":1000 + /* "yt/geometry/selection_routines.pyx":989 * def _hash_vals(self): * t = () * for i, c in enumerate(self._conditionals): # <<<<<<<<<<<<<< @@ -18955,7 +20271,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1002 + /* "yt/geometry/selection_routines.pyx":991 * for i, c in enumerate(self._conditionals): * t += ("conditional[%s]" % i, c) * return ("conditionals", t) # <<<<<<<<<<<<<< @@ -18963,7 +20279,7 @@ * cut_region_selector = CutRegionSelector */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_conditionals); __Pyx_GIVEREF(__pyx_n_s_conditionals); @@ -18975,7 +20291,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":998 + /* "yt/geometry/selection_routines.pyx":987 * return 1 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -19000,7 +20316,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1012 +/* "(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_2yt_8geometry_18selection_routines_17CutRegionSelector_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_17CutRegionSelector_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_2yt_8geometry_18selection_routines_17CutRegionSelector_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17CutRegionSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *__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__30, 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("yt.geometry.selection_routines.CutRegionSelector.__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_2yt_8geometry_18selection_routines_17CutRegionSelector_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_17CutRegionSelector_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_2yt_8geometry_18selection_routines_17CutRegionSelector_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17CutRegionSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *__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__31, 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("yt.geometry.selection_routines.CutRegionSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":1001 * cdef np.float64_t height * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -19023,6 +20446,7 @@ 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; } @@ -19033,7 +20457,7 @@ 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(0, 1012, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1001, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -19044,7 +20468,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1012, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1001, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.DiskSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -19067,7 +20491,7 @@ __pyx_t_5numpy_float64_t __pyx_t_4; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":1014 + /* "yt/geometry/selection_routines.pyx":1003 * def __init__(self, dobj): * cdef int i * for i in range(3): # <<<<<<<<<<<<<< @@ -19077,59 +20501,59 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":1015 + /* "yt/geometry/selection_routines.pyx":1004 * cdef int i * for i in range(3): * self.norm_vec[i] = dobj._norm_vec[i] # <<<<<<<<<<<<<< * self.center[i] = _ensure_code(dobj.center[i]) * self.radius = _ensure_code(dobj.radius) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_norm_vec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_norm_vec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->norm_vec[__pyx_v_i]) = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":1016 + /* "yt/geometry/selection_routines.pyx":1005 * for i in range(3): * self.norm_vec[i] = dobj._norm_vec[i] * self.center[i] = _ensure_code(dobj.center[i]) # <<<<<<<<<<<<<< * self.radius = _ensure_code(dobj.radius) * self.radius2 = self.radius * self.radius */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_center); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_center); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->center[__pyx_v_i]) = __pyx_t_4; } - /* "yt/geometry/selection_routines.pyx":1017 + /* "yt/geometry/selection_routines.pyx":1006 * self.norm_vec[i] = dobj._norm_vec[i] * self.center[i] = _ensure_code(dobj.center[i]) * self.radius = _ensure_code(dobj.radius) # <<<<<<<<<<<<<< * self.radius2 = self.radius * self.radius * self.height = _ensure_code(dobj.height) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error) + __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1017, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->radius = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":1018 + /* "yt/geometry/selection_routines.pyx":1007 * self.center[i] = _ensure_code(dobj.center[i]) * self.radius = _ensure_code(dobj.radius) * self.radius2 = self.radius * self.radius # <<<<<<<<<<<<<< @@ -19138,23 +20562,23 @@ */ __pyx_v_self->radius2 = (__pyx_v_self->radius * __pyx_v_self->radius); - /* "yt/geometry/selection_routines.pyx":1019 + /* "yt/geometry/selection_routines.pyx":1008 * self.radius = _ensure_code(dobj.radius) * self.radius2 = self.radius * self.radius * self.height = _ensure_code(dobj.height) # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_height); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1019, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_height); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1019, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1019, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1008, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->height = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":1012 + /* "yt/geometry/selection_routines.pyx":1001 * cdef np.float64_t height * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -19175,7 +20599,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1024 +/* "yt/geometry/selection_routines.pyx":1013 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -19186,7 +20610,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_12DiskSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1025 + /* "yt/geometry/selection_routines.pyx":1014 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * return self.select_point(pos) # <<<<<<<<<<<<<< @@ -19196,7 +20620,7 @@ __pyx_r = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_DiskSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.select_point(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_pos); goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1024 + /* "yt/geometry/selection_routines.pyx":1013 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -19209,7 +20633,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1030 +/* "yt/geometry/selection_routines.pyx":1019 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -19228,7 +20652,7 @@ int __pyx_t_2; int __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":1033 + /* "yt/geometry/selection_routines.pyx":1022 * cdef np.float64_t h, d, r2, temp * cdef int i * h = d = 0 # <<<<<<<<<<<<<< @@ -19238,7 +20662,7 @@ __pyx_v_h = 0.0; __pyx_v_d = 0.0; - /* "yt/geometry/selection_routines.pyx":1034 + /* "yt/geometry/selection_routines.pyx":1023 * cdef int i * h = d = 0 * for i in range(3): # <<<<<<<<<<<<<< @@ -19248,7 +20672,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":1035 + /* "yt/geometry/selection_routines.pyx":1024 * h = d = 0 * for i in range(3): * temp = self.difference(pos[i], self.center[i], i) # <<<<<<<<<<<<<< @@ -19257,7 +20681,7 @@ */ __pyx_v_temp = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_DiskSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.difference(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), (__pyx_v_pos[__pyx_v_i]), (__pyx_v_self->center[__pyx_v_i]), __pyx_v_i); - /* "yt/geometry/selection_routines.pyx":1036 + /* "yt/geometry/selection_routines.pyx":1025 * for i in range(3): * temp = self.difference(pos[i], self.center[i], i) * h += temp * self.norm_vec[i] # <<<<<<<<<<<<<< @@ -19266,7 +20690,7 @@ */ __pyx_v_h = (__pyx_v_h + (__pyx_v_temp * (__pyx_v_self->norm_vec[__pyx_v_i]))); - /* "yt/geometry/selection_routines.pyx":1037 + /* "yt/geometry/selection_routines.pyx":1026 * temp = self.difference(pos[i], self.center[i], i) * h += temp * self.norm_vec[i] * d += temp*temp # <<<<<<<<<<<<<< @@ -19276,7 +20700,7 @@ __pyx_v_d = (__pyx_v_d + (__pyx_v_temp * __pyx_v_temp)); } - /* "yt/geometry/selection_routines.pyx":1038 + /* "yt/geometry/selection_routines.pyx":1027 * h += temp * self.norm_vec[i] * d += temp*temp * r2 = (d - h*h) # <<<<<<<<<<<<<< @@ -19285,7 +20709,7 @@ */ __pyx_v_r2 = (__pyx_v_d - (__pyx_v_h * __pyx_v_h)); - /* "yt/geometry/selection_routines.pyx":1039 + /* "yt/geometry/selection_routines.pyx":1028 * d += temp*temp * r2 = (d - h*h) * if fabs(h) <= self.height and r2 <= self.radius2: return 1 # <<<<<<<<<<<<<< @@ -19306,7 +20730,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":1040 + /* "yt/geometry/selection_routines.pyx":1029 * r2 = (d - h*h) * if fabs(h) <= self.height and r2 <= self.radius2: return 1 * return 0 # <<<<<<<<<<<<<< @@ -19316,7 +20740,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1030 + /* "yt/geometry/selection_routines.pyx":1019 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -19329,7 +20753,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1045 +/* "yt/geometry/selection_routines.pyx":1034 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -19348,7 +20772,7 @@ int __pyx_t_2; int __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":1048 + /* "yt/geometry/selection_routines.pyx":1037 * cdef np.float64_t h, d, r2, temp * cdef int i * h = d = 0 # <<<<<<<<<<<<<< @@ -19358,7 +20782,7 @@ __pyx_v_h = 0.0; __pyx_v_d = 0.0; - /* "yt/geometry/selection_routines.pyx":1049 + /* "yt/geometry/selection_routines.pyx":1038 * cdef int i * h = d = 0 * for i in range(3): # <<<<<<<<<<<<<< @@ -19368,7 +20792,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":1050 + /* "yt/geometry/selection_routines.pyx":1039 * h = d = 0 * for i in range(3): * temp = self.difference(pos[i], self.center[i], i) # <<<<<<<<<<<<<< @@ -19377,7 +20801,7 @@ */ __pyx_v_temp = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_DiskSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.difference(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), (__pyx_v_pos[__pyx_v_i]), (__pyx_v_self->center[__pyx_v_i]), __pyx_v_i); - /* "yt/geometry/selection_routines.pyx":1051 + /* "yt/geometry/selection_routines.pyx":1040 * for i in range(3): * temp = self.difference(pos[i], self.center[i], i) * h += pos[i] * self.norm_vec[i] # <<<<<<<<<<<<<< @@ -19386,7 +20810,7 @@ */ __pyx_v_h = (__pyx_v_h + ((__pyx_v_pos[__pyx_v_i]) * (__pyx_v_self->norm_vec[__pyx_v_i]))); - /* "yt/geometry/selection_routines.pyx":1052 + /* "yt/geometry/selection_routines.pyx":1041 * temp = self.difference(pos[i], self.center[i], i) * h += pos[i] * self.norm_vec[i] * d += temp*temp # <<<<<<<<<<<<<< @@ -19396,7 +20820,7 @@ __pyx_v_d = (__pyx_v_d + (__pyx_v_temp * __pyx_v_temp)); } - /* "yt/geometry/selection_routines.pyx":1053 + /* "yt/geometry/selection_routines.pyx":1042 * h += pos[i] * self.norm_vec[i] * d += temp*temp * r2 = (d - h*h) # <<<<<<<<<<<<<< @@ -19405,7 +20829,7 @@ */ __pyx_v_r2 = (__pyx_v_d - (__pyx_v_h * __pyx_v_h)); - /* "yt/geometry/selection_routines.pyx":1054 + /* "yt/geometry/selection_routines.pyx":1043 * d += temp*temp * r2 = (d - h*h) * d = self.radius+radius # <<<<<<<<<<<<<< @@ -19414,7 +20838,7 @@ */ __pyx_v_d = (__pyx_v_self->radius + __pyx_v_radius); - /* "yt/geometry/selection_routines.pyx":1055 + /* "yt/geometry/selection_routines.pyx":1044 * r2 = (d - h*h) * d = self.radius+radius * if fabs(h) <= self.height+radius and r2 <= d*d: return 1 # <<<<<<<<<<<<<< @@ -19435,7 +20859,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":1056 + /* "yt/geometry/selection_routines.pyx":1045 * d = self.radius+radius * if fabs(h) <= self.height+radius and r2 <= d*d: return 1 * return 0 # <<<<<<<<<<<<<< @@ -19445,7 +20869,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1045 + /* "yt/geometry/selection_routines.pyx":1034 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -19458,7 +20882,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1061 +/* "yt/geometry/selection_routines.pyx":1050 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -19469,7 +20893,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_12DiskSelector_select_bbox(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1064 + /* "yt/geometry/selection_routines.pyx":1053 * np.float64_t right_edge[3]) nogil: * # Until we can get our OBB/OBB intersection correct, disable this. * return 1 # <<<<<<<<<<<<<< @@ -19479,7 +20903,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1061 + /* "yt/geometry/selection_routines.pyx":1050 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -19492,7 +20916,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1108 +/* "yt/geometry/selection_routines.pyx":1097 * # return 0 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -19528,7 +20952,7 @@ PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":1109 + /* "yt/geometry/selection_routines.pyx":1098 * * def _hash_vals(self): * return (("norm_vec[0]", self.norm_vec[0]), # <<<<<<<<<<<<<< @@ -19536,9 +20960,9 @@ * ("norm_vec[2]", self.norm_vec[2]), */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->norm_vec[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->norm_vec[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_kp_s_norm_vec_0); __Pyx_GIVEREF(__pyx_kp_s_norm_vec_0); @@ -19547,16 +20971,16 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1110 + /* "yt/geometry/selection_routines.pyx":1099 * def _hash_vals(self): * return (("norm_vec[0]", self.norm_vec[0]), * ("norm_vec[1]", self.norm_vec[1]), # <<<<<<<<<<<<<< * ("norm_vec[2]", self.norm_vec[2]), * ("center[0]", self.center[0]), */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->norm_vec[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->norm_vec[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1110, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_s_norm_vec_1); __Pyx_GIVEREF(__pyx_kp_s_norm_vec_1); @@ -19565,16 +20989,16 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1111 + /* "yt/geometry/selection_routines.pyx":1100 * return (("norm_vec[0]", self.norm_vec[0]), * ("norm_vec[1]", self.norm_vec[1]), * ("norm_vec[2]", self.norm_vec[2]), # <<<<<<<<<<<<<< * ("center[0]", self.center[0]), * ("center[1]", self.center[1]), */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->norm_vec[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->norm_vec[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_norm_vec_2); __Pyx_GIVEREF(__pyx_kp_s_norm_vec_2); @@ -19583,16 +21007,16 @@ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1112 + /* "yt/geometry/selection_routines.pyx":1101 * ("norm_vec[1]", self.norm_vec[1]), * ("norm_vec[2]", self.norm_vec[2]), * ("center[0]", self.center[0]), # <<<<<<<<<<<<<< * ("center[1]", self.center[1]), * ("center[2]", self.center[2]), */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_center_0); __Pyx_GIVEREF(__pyx_kp_s_center_0); @@ -19601,16 +21025,16 @@ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1113 + /* "yt/geometry/selection_routines.pyx":1102 * ("norm_vec[2]", self.norm_vec[2]), * ("center[0]", self.center[0]), * ("center[1]", self.center[1]), # <<<<<<<<<<<<<< * ("center[2]", self.center[2]), * ("radius", self.radius), */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1113, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1113, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_kp_s_center_1); __Pyx_GIVEREF(__pyx_kp_s_center_1); @@ -19619,16 +21043,16 @@ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1114 + /* "yt/geometry/selection_routines.pyx":1103 * ("center[0]", self.center[0]), * ("center[1]", self.center[1]), * ("center[2]", self.center[2]), # <<<<<<<<<<<<<< * ("radius", self.radius), * ("radius2", self.radius2), */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1114, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_kp_s_center_2); __Pyx_GIVEREF(__pyx_kp_s_center_2); @@ -19637,16 +21061,16 @@ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1115 + /* "yt/geometry/selection_routines.pyx":1104 * ("center[1]", self.center[1]), * ("center[2]", self.center[2]), * ("radius", self.radius), # <<<<<<<<<<<<<< * ("radius2", self.radius2), * ("height", self.height)) */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->radius); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->radius); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1115, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_n_s_radius); __Pyx_GIVEREF(__pyx_n_s_radius); @@ -19655,16 +21079,16 @@ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1116 + /* "yt/geometry/selection_routines.pyx":1105 * ("center[2]", self.center[2]), * ("radius", self.radius), * ("radius2", self.radius2), # <<<<<<<<<<<<<< * ("height", self.height)) * */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->radius2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->radius2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1116, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_n_s_radius2); __Pyx_GIVEREF(__pyx_n_s_radius2); @@ -19673,16 +21097,16 @@ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1117 + /* "yt/geometry/selection_routines.pyx":1106 * ("radius", self.radius), * ("radius2", self.radius2), * ("height", self.height)) # <<<<<<<<<<<<<< * * disk_selector = DiskSelector */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1117, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_n_s_height); __Pyx_GIVEREF(__pyx_n_s_height); @@ -19691,14 +21115,14 @@ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1109 + /* "yt/geometry/selection_routines.pyx":1098 * * def _hash_vals(self): * return (("norm_vec[0]", self.norm_vec[0]), # <<<<<<<<<<<<<< * ("norm_vec[1]", self.norm_vec[1]), * ("norm_vec[2]", self.norm_vec[2]), */ - __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -19731,7 +21155,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1108 + /* "yt/geometry/selection_routines.pyx":1097 * # return 0 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -19759,7 +21183,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1125 +/* "(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_2yt_8geometry_18selection_routines_12DiskSelector_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_12DiskSelector_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_2yt_8geometry_18selection_routines_12DiskSelector_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_12DiskSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *__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__32, 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("yt.geometry.selection_routines.DiskSelector.__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_2yt_8geometry_18selection_routines_12DiskSelector_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_12DiskSelector_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_2yt_8geometry_18selection_routines_12DiskSelector_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_12DiskSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *__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__33, 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("yt.geometry.selection_routines.DiskSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":1114 * cdef np.float64_t d * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -19782,6 +21313,7 @@ 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; } @@ -19792,7 +21324,7 @@ 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(0, 1125, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1114, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -19803,7 +21335,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1125, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1114, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.CuttingPlaneSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -19826,7 +21358,7 @@ __pyx_t_5numpy_float64_t __pyx_t_4; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":1127 + /* "yt/geometry/selection_routines.pyx":1116 * def __init__(self, dobj): * cdef int i * for i in range(3): # <<<<<<<<<<<<<< @@ -19836,40 +21368,40 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":1128 + /* "yt/geometry/selection_routines.pyx":1117 * cdef int i * for i in range(3): * self.norm_vec[i] = dobj._norm_vec[i] # <<<<<<<<<<<<<< * self.d = _ensure_code(dobj._d) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_norm_vec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1128, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_norm_vec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1128, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1128, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->norm_vec[__pyx_v_i]) = __pyx_t_4; } - /* "yt/geometry/selection_routines.pyx":1129 + /* "yt/geometry/selection_routines.pyx":1118 * for i in range(3): * self.norm_vec[i] = dobj._norm_vec[i] * self.d = _ensure_code(dobj._d) # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_d_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_d_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1129, __pyx_L1_error) + __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1129, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->d = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":1125 + /* "yt/geometry/selection_routines.pyx":1114 * cdef np.float64_t d * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -19890,7 +21422,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1134 +/* "yt/geometry/selection_routines.pyx":1123 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -19905,7 +21437,7 @@ int __pyx_r; int __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":1138 + /* "yt/geometry/selection_routines.pyx":1127 * cdef np.float64_t right_edge[3] * cdef int i * for i in range(3): # <<<<<<<<<<<<<< @@ -19915,7 +21447,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":1139 + /* "yt/geometry/selection_routines.pyx":1128 * cdef int i * for i in range(3): * left_edge[i] = pos[i] - 0.5*dds[i] # <<<<<<<<<<<<<< @@ -19924,7 +21456,7 @@ */ (__pyx_v_left_edge[__pyx_v_i]) = ((__pyx_v_pos[__pyx_v_i]) - (0.5 * (__pyx_v_dds[__pyx_v_i]))); - /* "yt/geometry/selection_routines.pyx":1140 + /* "yt/geometry/selection_routines.pyx":1129 * for i in range(3): * left_edge[i] = pos[i] - 0.5*dds[i] * right_edge[i] = pos[i] + 0.5*dds[i] # <<<<<<<<<<<<<< @@ -19934,7 +21466,7 @@ (__pyx_v_right_edge[__pyx_v_i]) = ((__pyx_v_pos[__pyx_v_i]) + (0.5 * (__pyx_v_dds[__pyx_v_i]))); } - /* "yt/geometry/selection_routines.pyx":1141 + /* "yt/geometry/selection_routines.pyx":1130 * left_edge[i] = pos[i] - 0.5*dds[i] * right_edge[i] = pos[i] + 0.5*dds[i] * return self.select_bbox(left_edge, right_edge) # <<<<<<<<<<<<<< @@ -19944,7 +21476,7 @@ __pyx_r = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_CuttingPlaneSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.select_bbox(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_left_edge, __pyx_v_right_edge); goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1134 + /* "yt/geometry/selection_routines.pyx":1123 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -19957,7 +21489,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1143 +/* "yt/geometry/selection_routines.pyx":1132 * return self.select_bbox(left_edge, right_edge) * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -19968,7 +21500,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_select_point(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1145 + /* "yt/geometry/selection_routines.pyx":1134 * cdef int select_point(self, np.float64_t pos[3]) nogil: * # two 0-volume constructs don't intersect * return 0 # <<<<<<<<<<<<<< @@ -19978,7 +21510,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1143 + /* "yt/geometry/selection_routines.pyx":1132 * return self.select_bbox(left_edge, right_edge) * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -19991,7 +21523,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1150 +/* "yt/geometry/selection_routines.pyx":1139 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -20007,7 +21539,7 @@ int __pyx_t_2; int __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":1152 + /* "yt/geometry/selection_routines.pyx":1141 * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * cdef int i * cdef np.float64_t height = self.d # <<<<<<<<<<<<<< @@ -20017,7 +21549,7 @@ __pyx_t_1 = __pyx_v_self->d; __pyx_v_height = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":1153 + /* "yt/geometry/selection_routines.pyx":1142 * cdef int i * cdef np.float64_t height = self.d * for i in range(3) : # <<<<<<<<<<<<<< @@ -20027,7 +21559,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1154 + /* "yt/geometry/selection_routines.pyx":1143 * cdef np.float64_t height = self.d * for i in range(3) : * height += pos[i] * self.norm_vec[i] # <<<<<<<<<<<<<< @@ -20037,7 +21569,7 @@ __pyx_v_height = (__pyx_v_height + ((__pyx_v_pos[__pyx_v_i]) * (__pyx_v_self->norm_vec[__pyx_v_i]))); } - /* "yt/geometry/selection_routines.pyx":1155 + /* "yt/geometry/selection_routines.pyx":1144 * for i in range(3) : * height += pos[i] * self.norm_vec[i] * if height*height <= radius*radius : return 1 # <<<<<<<<<<<<<< @@ -20050,7 +21582,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":1156 + /* "yt/geometry/selection_routines.pyx":1145 * height += pos[i] * self.norm_vec[i] * if height*height <= radius*radius : return 1 * return 0 # <<<<<<<<<<<<<< @@ -20060,7 +21592,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1150 + /* "yt/geometry/selection_routines.pyx":1139 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -20073,7 +21605,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1161 +/* "yt/geometry/selection_routines.pyx":1150 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -20100,7 +21632,7 @@ int __pyx_t_6; int __pyx_t_7; - /* "yt/geometry/selection_routines.pyx":1167 + /* "yt/geometry/selection_routines.pyx":1156 * cdef np.float64_t pos[3] * cdef np.float64_t gd * arr[0] = left_edge # <<<<<<<<<<<<<< @@ -20109,7 +21641,7 @@ */ (__pyx_v_arr[0]) = __pyx_v_left_edge; - /* "yt/geometry/selection_routines.pyx":1168 + /* "yt/geometry/selection_routines.pyx":1157 * cdef np.float64_t gd * arr[0] = left_edge * arr[1] = right_edge # <<<<<<<<<<<<<< @@ -20118,7 +21650,7 @@ */ (__pyx_v_arr[1]) = __pyx_v_right_edge; - /* "yt/geometry/selection_routines.pyx":1169 + /* "yt/geometry/selection_routines.pyx":1158 * arr[0] = left_edge * arr[1] = right_edge * all_under = 1 # <<<<<<<<<<<<<< @@ -20127,7 +21659,7 @@ */ __pyx_v_all_under = 1; - /* "yt/geometry/selection_routines.pyx":1170 + /* "yt/geometry/selection_routines.pyx":1159 * arr[1] = right_edge * all_under = 1 * all_over = 1 # <<<<<<<<<<<<<< @@ -20136,7 +21668,7 @@ */ __pyx_v_all_over = 1; - /* "yt/geometry/selection_routines.pyx":1172 + /* "yt/geometry/selection_routines.pyx":1161 * all_over = 1 * # Check each corner * for i in range(2): # <<<<<<<<<<<<<< @@ -20146,7 +21678,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":1173 + /* "yt/geometry/selection_routines.pyx":1162 * # Check each corner * for i in range(2): * pos[0] = arr[i][0] # <<<<<<<<<<<<<< @@ -20155,7 +21687,7 @@ */ (__pyx_v_pos[0]) = ((__pyx_v_arr[__pyx_v_i])[0]); - /* "yt/geometry/selection_routines.pyx":1174 + /* "yt/geometry/selection_routines.pyx":1163 * for i in range(2): * pos[0] = arr[i][0] * for j in range(2): # <<<<<<<<<<<<<< @@ -20165,7 +21697,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 2; __pyx_t_2+=1) { __pyx_v_j = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1175 + /* "yt/geometry/selection_routines.pyx":1164 * pos[0] = arr[i][0] * for j in range(2): * pos[1] = arr[j][1] # <<<<<<<<<<<<<< @@ -20174,7 +21706,7 @@ */ (__pyx_v_pos[1]) = ((__pyx_v_arr[__pyx_v_j])[1]); - /* "yt/geometry/selection_routines.pyx":1176 + /* "yt/geometry/selection_routines.pyx":1165 * for j in range(2): * pos[1] = arr[j][1] * for k in range(2): # <<<<<<<<<<<<<< @@ -20184,7 +21716,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 2; __pyx_t_3+=1) { __pyx_v_k = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":1177 + /* "yt/geometry/selection_routines.pyx":1166 * pos[1] = arr[j][1] * for k in range(2): * pos[2] = arr[k][2] # <<<<<<<<<<<<<< @@ -20193,7 +21725,7 @@ */ (__pyx_v_pos[2]) = ((__pyx_v_arr[__pyx_v_k])[2]); - /* "yt/geometry/selection_routines.pyx":1178 + /* "yt/geometry/selection_routines.pyx":1167 * for k in range(2): * pos[2] = arr[k][2] * gd = self.d # <<<<<<<<<<<<<< @@ -20203,7 +21735,7 @@ __pyx_t_4 = __pyx_v_self->d; __pyx_v_gd = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":1179 + /* "yt/geometry/selection_routines.pyx":1168 * pos[2] = arr[k][2] * gd = self.d * for n in range(3): # <<<<<<<<<<<<<< @@ -20213,7 +21745,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < 3; __pyx_t_5+=1) { __pyx_v_n = __pyx_t_5; - /* "yt/geometry/selection_routines.pyx":1180 + /* "yt/geometry/selection_routines.pyx":1169 * gd = self.d * for n in range(3): * gd += pos[n] * self.norm_vec[n] # <<<<<<<<<<<<<< @@ -20223,7 +21755,7 @@ __pyx_v_gd = (__pyx_v_gd + ((__pyx_v_pos[__pyx_v_n]) * (__pyx_v_self->norm_vec[__pyx_v_n]))); } - /* "yt/geometry/selection_routines.pyx":1183 + /* "yt/geometry/selection_routines.pyx":1172 * # this allows corners and faces on the low-end to * # collide, while not selecting cells on the high-side * if i == 0 and j == 0 and k == 0 : # <<<<<<<<<<<<<< @@ -20247,7 +21779,7 @@ __pyx_L12_bool_binop_done:; if (__pyx_t_6) { - /* "yt/geometry/selection_routines.pyx":1184 + /* "yt/geometry/selection_routines.pyx":1173 * # collide, while not selecting cells on the high-side * if i == 0 and j == 0 and k == 0 : * if gd <= 0: all_over = 0 # <<<<<<<<<<<<<< @@ -20259,7 +21791,7 @@ __pyx_v_all_over = 0; } - /* "yt/geometry/selection_routines.pyx":1185 + /* "yt/geometry/selection_routines.pyx":1174 * if i == 0 and j == 0 and k == 0 : * if gd <= 0: all_over = 0 * if gd >= 0: all_under = 0 # <<<<<<<<<<<<<< @@ -20271,7 +21803,7 @@ __pyx_v_all_under = 0; } - /* "yt/geometry/selection_routines.pyx":1183 + /* "yt/geometry/selection_routines.pyx":1172 * # this allows corners and faces on the low-end to * # collide, while not selecting cells on the high-side * if i == 0 and j == 0 and k == 0 : # <<<<<<<<<<<<<< @@ -20281,7 +21813,7 @@ goto __pyx_L11; } - /* "yt/geometry/selection_routines.pyx":1187 + /* "yt/geometry/selection_routines.pyx":1176 * if gd >= 0: all_under = 0 * else : * if gd < 0: all_over = 0 # <<<<<<<<<<<<<< @@ -20294,7 +21826,7 @@ __pyx_v_all_over = 0; } - /* "yt/geometry/selection_routines.pyx":1188 + /* "yt/geometry/selection_routines.pyx":1177 * else : * if gd < 0: all_over = 0 * if gd > 0: all_under = 0 # <<<<<<<<<<<<<< @@ -20311,7 +21843,7 @@ } } - /* "yt/geometry/selection_routines.pyx":1189 + /* "yt/geometry/selection_routines.pyx":1178 * if gd < 0: all_over = 0 * if gd > 0: all_under = 0 * if all_over == 1 or all_under == 1: # <<<<<<<<<<<<<< @@ -20329,7 +21861,7 @@ __pyx_L20_bool_binop_done:; if (__pyx_t_6) { - /* "yt/geometry/selection_routines.pyx":1190 + /* "yt/geometry/selection_routines.pyx":1179 * if gd > 0: all_under = 0 * if all_over == 1 or all_under == 1: * return 0 # <<<<<<<<<<<<<< @@ -20339,7 +21871,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1189 + /* "yt/geometry/selection_routines.pyx":1178 * if gd < 0: all_over = 0 * if gd > 0: all_under = 0 * if all_over == 1 or all_under == 1: # <<<<<<<<<<<<<< @@ -20348,7 +21880,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1191 + /* "yt/geometry/selection_routines.pyx":1180 * if all_over == 1 or all_under == 1: * return 0 * return 1 # <<<<<<<<<<<<<< @@ -20358,7 +21890,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1161 + /* "yt/geometry/selection_routines.pyx":1150 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -20371,7 +21903,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1193 +/* "yt/geometry/selection_routines.pyx":1182 * return 1 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -20402,7 +21934,7 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":1194 + /* "yt/geometry/selection_routines.pyx":1183 * * def _hash_vals(self): * return (("norm_vec[0]", self.norm_vec[0]), # <<<<<<<<<<<<<< @@ -20410,9 +21942,9 @@ * ("norm_vec[2]", self.norm_vec[2]), */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->norm_vec[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->norm_vec[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_kp_s_norm_vec_0); __Pyx_GIVEREF(__pyx_kp_s_norm_vec_0); @@ -20421,16 +21953,16 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1195 + /* "yt/geometry/selection_routines.pyx":1184 * def _hash_vals(self): * return (("norm_vec[0]", self.norm_vec[0]), * ("norm_vec[1]", self.norm_vec[1]), # <<<<<<<<<<<<<< * ("norm_vec[2]", self.norm_vec[2]), * ("d", self.d)) */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->norm_vec[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->norm_vec[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1195, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_s_norm_vec_1); __Pyx_GIVEREF(__pyx_kp_s_norm_vec_1); @@ -20439,16 +21971,16 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1196 + /* "yt/geometry/selection_routines.pyx":1185 * return (("norm_vec[0]", self.norm_vec[0]), * ("norm_vec[1]", self.norm_vec[1]), * ("norm_vec[2]", self.norm_vec[2]), # <<<<<<<<<<<<<< * ("d", self.d)) * */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->norm_vec[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1196, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->norm_vec[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1196, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_norm_vec_2); __Pyx_GIVEREF(__pyx_kp_s_norm_vec_2); @@ -20457,16 +21989,16 @@ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1197 + /* "yt/geometry/selection_routines.pyx":1186 * ("norm_vec[1]", self.norm_vec[1]), * ("norm_vec[2]", self.norm_vec[2]), * ("d", self.d)) # <<<<<<<<<<<<<< * * cutting_selector = CuttingPlaneSelector */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1197, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_n_s_d); __Pyx_GIVEREF(__pyx_n_s_d); @@ -20475,14 +22007,14 @@ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1194 + /* "yt/geometry/selection_routines.pyx":1183 * * def _hash_vals(self): * return (("norm_vec[0]", self.norm_vec[0]), # <<<<<<<<<<<<<< * ("norm_vec[1]", self.norm_vec[1]), * ("norm_vec[2]", self.norm_vec[2]), */ - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -20500,7 +22032,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1193 + /* "yt/geometry/selection_routines.pyx":1182 * return 1 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -20523,7 +22055,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1206 +/* "(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_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_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_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *__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("yt.geometry.selection_routines.CuttingPlaneSelector.__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_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_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_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *__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("yt.geometry.selection_routines.CuttingPlaneSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":1195 * cdef int ax, ay * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -20546,6 +22185,7 @@ 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; } @@ -20556,7 +22196,7 @@ 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(0, 1206, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1195, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -20567,7 +22207,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1195, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.SliceSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -20589,36 +22229,36 @@ __pyx_t_5numpy_float64_t __pyx_t_4; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":1207 + /* "yt/geometry/selection_routines.pyx":1196 * * def __init__(self, dobj): * self.axis = dobj.axis # <<<<<<<<<<<<<< * self.coord = _ensure_code(dobj.coord) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_axis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1207, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_axis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1207, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->axis = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1208 + /* "yt/geometry/selection_routines.pyx":1197 * def __init__(self, dobj): * self.axis = dobj.axis * self.coord = _ensure_code(dobj.coord) # <<<<<<<<<<<<<< * * self.ax = (self.axis+1) % 3 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_coord); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_coord); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->coord = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":1210 + /* "yt/geometry/selection_routines.pyx":1199 * self.coord = _ensure_code(dobj.coord) * * self.ax = (self.axis+1) % 3 # <<<<<<<<<<<<<< @@ -20627,7 +22267,7 @@ */ __pyx_v_self->ax = __Pyx_mod_long((__pyx_v_self->axis + 1), 3); - /* "yt/geometry/selection_routines.pyx":1211 + /* "yt/geometry/selection_routines.pyx":1200 * * self.ax = (self.axis+1) % 3 * self.ay = (self.axis+2) % 3 # <<<<<<<<<<<<<< @@ -20636,7 +22276,7 @@ */ __pyx_v_self->ay = __Pyx_mod_long((__pyx_v_self->axis + 2), 3); - /* "yt/geometry/selection_routines.pyx":1206 + /* "yt/geometry/selection_routines.pyx":1195 * cdef int ax, ay * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -20657,7 +22297,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1216 +/* "yt/geometry/selection_routines.pyx":1205 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mask(self, gobj): # <<<<<<<<<<<<<< @@ -20729,7 +22369,7 @@ __pyx_pybuffernd_child_mask.data = NULL; __pyx_pybuffernd_child_mask.rcbuffer = &__pyx_pybuffer_child_mask; - /* "yt/geometry/selection_routines.pyx":1220 + /* "yt/geometry/selection_routines.pyx":1209 * cdef np.ndarray[np.uint8_t, ndim=3, cast=True] child_mask * cdef int i, j, k * cdef int total = 0 # <<<<<<<<<<<<<< @@ -20738,7 +22378,7 @@ */ __pyx_v_total = 0; - /* "yt/geometry/selection_routines.pyx":1221 + /* "yt/geometry/selection_routines.pyx":1210 * cdef int i, j, k * cdef int total = 0 * cdef int this_level = 0 # <<<<<<<<<<<<<< @@ -20747,48 +22387,48 @@ */ __pyx_v_this_level = 0; - /* "yt/geometry/selection_routines.pyx":1223 + /* "yt/geometry/selection_routines.pyx":1212 * cdef int this_level = 0 * cdef int ind[3][2] * cdef np.int32_t level = gobj.Level # <<<<<<<<<<<<<< * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.dds) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_Level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_Level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1223, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_level = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1224 + /* "yt/geometry/selection_routines.pyx":1213 * cdef int ind[3][2] * cdef np.int32_t level = gobj.Level * _ensure_code(gobj.LeftEdge) # <<<<<<<<<<<<<< * _ensure_code(gobj.dds) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":1225 + /* "yt/geometry/selection_routines.pyx":1214 * cdef np.int32_t level = gobj.Level * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.dds) # <<<<<<<<<<<<<< * * if level < self.min_level or level > self.max_level: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1225, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1227 + /* "yt/geometry/selection_routines.pyx":1216 * _ensure_code(gobj.dds) * * if level < self.min_level or level > self.max_level: # <<<<<<<<<<<<<< @@ -20806,7 +22446,7 @@ __pyx_L4_bool_binop_done:; if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":1228 + /* "yt/geometry/selection_routines.pyx":1217 * * if level < self.min_level or level > self.max_level: * return None # <<<<<<<<<<<<<< @@ -20818,7 +22458,7 @@ __pyx_r = Py_None; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1227 + /* "yt/geometry/selection_routines.pyx":1216 * _ensure_code(gobj.dds) * * if level < self.min_level or level > self.max_level: # <<<<<<<<<<<<<< @@ -20827,7 +22467,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1230 + /* "yt/geometry/selection_routines.pyx":1219 * return None * else: * child_mask = gobj.child_mask # <<<<<<<<<<<<<< @@ -20835,9 +22475,9 @@ * if level == self.max_level: */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_child_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_child_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1230, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1219, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20853,46 +22493,46 @@ } } __pyx_pybuffernd_child_mask.diminfo[0].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_mask.diminfo[0].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_child_mask.diminfo[1].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_child_mask.diminfo[1].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_child_mask.diminfo[2].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_child_mask.diminfo[2].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1219, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_child_mask = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1231 + /* "yt/geometry/selection_routines.pyx":1220 * else: * child_mask = gobj.child_mask * mask = np.zeros(gobj.ActiveDimensions, dtype=np.uint8) # <<<<<<<<<<<<<< * if level == self.max_level: * this_level = 1 */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1231, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1231, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1231, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_uint8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1231, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_uint8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(0, 1231, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(0, 1220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1231, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1231, __pyx_L1_error) + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1220, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20908,13 +22548,13 @@ } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1231, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1220, __pyx_L1_error) } __pyx_t_14 = 0; __pyx_v_mask = ((PyArrayObject *)__pyx_t_13); __pyx_t_13 = 0; - /* "yt/geometry/selection_routines.pyx":1232 + /* "yt/geometry/selection_routines.pyx":1221 * child_mask = gobj.child_mask * mask = np.zeros(gobj.ActiveDimensions, dtype=np.uint8) * if level == self.max_level: # <<<<<<<<<<<<<< @@ -20924,7 +22564,7 @@ __pyx_t_4 = ((__pyx_v_level == __pyx_v_self->__pyx_base.max_level) != 0); if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":1233 + /* "yt/geometry/selection_routines.pyx":1222 * mask = np.zeros(gobj.ActiveDimensions, dtype=np.uint8) * if level == self.max_level: * this_level = 1 # <<<<<<<<<<<<<< @@ -20933,7 +22573,7 @@ */ __pyx_v_this_level = 1; - /* "yt/geometry/selection_routines.pyx":1232 + /* "yt/geometry/selection_routines.pyx":1221 * child_mask = gobj.child_mask * mask = np.zeros(gobj.ActiveDimensions, dtype=np.uint8) * if level == self.max_level: # <<<<<<<<<<<<<< @@ -20942,7 +22582,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1234 + /* "yt/geometry/selection_routines.pyx":1223 * if level == self.max_level: * this_level = 1 * for i in range(3): # <<<<<<<<<<<<<< @@ -20952,7 +22592,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "yt/geometry/selection_routines.pyx":1235 + /* "yt/geometry/selection_routines.pyx":1224 * this_level = 1 * for i in range(3): * if i == self.axis: # <<<<<<<<<<<<<< @@ -20962,21 +22602,21 @@ __pyx_t_4 = ((__pyx_v_i == __pyx_v_self->axis) != 0); if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":1237 + /* "yt/geometry/selection_routines.pyx":1226 * if i == self.axis: * ind[i][0] = \ * ((self.coord - (gobj.LeftEdge[i]).to_ndarray()) / # <<<<<<<<<<<<<< * gobj.dds[i]) * ind[i][1] = ind[i][0] + 1 */ - __pyx_t_13 = PyFloat_FromDouble(__pyx_v_self->coord); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_13 = PyFloat_FromDouble(__pyx_v_self->coord); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_11, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_11, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_to_ndarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_to_ndarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -20990,46 +22630,46 @@ } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyNumber_Subtract(__pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_11 = PyNumber_Subtract(__pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1238 + /* "yt/geometry/selection_routines.pyx":1227 * ind[i][0] = \ * ((self.coord - (gobj.LeftEdge[i]).to_ndarray()) / * gobj.dds[i]) # <<<<<<<<<<<<<< * ind[i][1] = ind[i][0] + 1 * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1238, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1237 + /* "yt/geometry/selection_routines.pyx":1226 * if i == self.axis: * ind[i][0] = \ * ((self.coord - (gobj.LeftEdge[i]).to_ndarray()) / # <<<<<<<<<<<<<< * gobj.dds[i]) * ind[i][1] = ind[i][0] + 1 */ - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1236 + /* "yt/geometry/selection_routines.pyx":1225 * for i in range(3): * if i == self.axis: * ind[i][0] = \ # <<<<<<<<<<<<<< @@ -21038,7 +22678,7 @@ */ ((__pyx_v_ind[__pyx_v_i])[0]) = ((int)__pyx_t_15); - /* "yt/geometry/selection_routines.pyx":1239 + /* "yt/geometry/selection_routines.pyx":1228 * ((self.coord - (gobj.LeftEdge[i]).to_ndarray()) / * gobj.dds[i]) * ind[i][1] = ind[i][0] + 1 # <<<<<<<<<<<<<< @@ -21047,7 +22687,7 @@ */ ((__pyx_v_ind[__pyx_v_i])[1]) = (((__pyx_v_ind[__pyx_v_i])[0]) + 1); - /* "yt/geometry/selection_routines.pyx":1235 + /* "yt/geometry/selection_routines.pyx":1224 * this_level = 1 * for i in range(3): * if i == self.axis: # <<<<<<<<<<<<<< @@ -21057,7 +22697,7 @@ goto __pyx_L9; } - /* "yt/geometry/selection_routines.pyx":1241 + /* "yt/geometry/selection_routines.pyx":1230 * ind[i][1] = ind[i][0] + 1 * else: * ind[i][0] = 0 # <<<<<<<<<<<<<< @@ -21067,26 +22707,26 @@ /*else*/ { ((__pyx_v_ind[__pyx_v_i])[0]) = 0; - /* "yt/geometry/selection_routines.pyx":1242 + /* "yt/geometry/selection_routines.pyx":1231 * else: * ind[i][0] = 0 * ind[i][1] = gobj.ActiveDimensions[i] # <<<<<<<<<<<<<< * with nogil: * for i in range(ind[0][0], ind[0][1]): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_13); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_13); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; ((__pyx_v_ind[__pyx_v_i])[1]) = __pyx_t_15; } __pyx_L9:; } - /* "yt/geometry/selection_routines.pyx":1243 + /* "yt/geometry/selection_routines.pyx":1232 * ind[i][0] = 0 * ind[i][1] = gobj.ActiveDimensions[i] * with nogil: # <<<<<<<<<<<<<< @@ -21097,10 +22737,11 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/geometry/selection_routines.pyx":1244 + /* "yt/geometry/selection_routines.pyx":1233 * ind[i][1] = gobj.ActiveDimensions[i] * with nogil: * for i in range(ind[0][0], ind[0][1]): # <<<<<<<<<<<<<< @@ -21111,7 +22752,7 @@ for (__pyx_t_15 = ((__pyx_v_ind[0])[0]); __pyx_t_15 < __pyx_t_7; __pyx_t_15+=1) { __pyx_v_i = __pyx_t_15; - /* "yt/geometry/selection_routines.pyx":1245 + /* "yt/geometry/selection_routines.pyx":1234 * with nogil: * for i in range(ind[0][0], ind[0][1]): * for j in range(ind[1][0], ind[1][1]): # <<<<<<<<<<<<<< @@ -21122,7 +22763,7 @@ for (__pyx_t_17 = ((__pyx_v_ind[1])[0]); __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_j = __pyx_t_17; - /* "yt/geometry/selection_routines.pyx":1246 + /* "yt/geometry/selection_routines.pyx":1235 * for i in range(ind[0][0], ind[0][1]): * for j in range(ind[1][0], ind[1][1]): * for k in range(ind[2][0], ind[2][1]): # <<<<<<<<<<<<<< @@ -21133,7 +22774,7 @@ for (__pyx_t_19 = ((__pyx_v_ind[2])[0]); __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { __pyx_v_k = __pyx_t_19; - /* "yt/geometry/selection_routines.pyx":1247 + /* "yt/geometry/selection_routines.pyx":1236 * for j in range(ind[1][0], ind[1][1]): * for k in range(ind[2][0], ind[2][1]): * if this_level == 1 or child_mask[i, j, k]: # <<<<<<<<<<<<<< @@ -21154,7 +22795,7 @@ __pyx_L20_bool_binop_done:; if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":1248 + /* "yt/geometry/selection_routines.pyx":1237 * for k in range(ind[2][0], ind[2][1]): * if this_level == 1 or child_mask[i, j, k]: * mask[i, j, k] = 1 # <<<<<<<<<<<<<< @@ -21166,7 +22807,7 @@ __pyx_t_25 = __pyx_v_k; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_mask.diminfo[2].strides) = 1; - /* "yt/geometry/selection_routines.pyx":1249 + /* "yt/geometry/selection_routines.pyx":1238 * if this_level == 1 or child_mask[i, j, k]: * mask[i, j, k] = 1 * total += 1 # <<<<<<<<<<<<<< @@ -21175,7 +22816,7 @@ */ __pyx_v_total = (__pyx_v_total + 1); - /* "yt/geometry/selection_routines.pyx":1247 + /* "yt/geometry/selection_routines.pyx":1236 * for j in range(ind[1][0], ind[1][1]): * for k in range(ind[2][0], ind[2][1]): * if this_level == 1 or child_mask[i, j, k]: # <<<<<<<<<<<<<< @@ -21188,7 +22829,7 @@ } } - /* "yt/geometry/selection_routines.pyx":1243 + /* "yt/geometry/selection_routines.pyx":1232 * ind[i][0] = 0 * ind[i][1] = gobj.ActiveDimensions[i] * with nogil: # <<<<<<<<<<<<<< @@ -21198,6 +22839,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L12; @@ -21206,7 +22848,7 @@ } } - /* "yt/geometry/selection_routines.pyx":1250 + /* "yt/geometry/selection_routines.pyx":1239 * mask[i, j, k] = 1 * total += 1 * if total == 0: return None # <<<<<<<<<<<<<< @@ -21221,7 +22863,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":1251 + /* "yt/geometry/selection_routines.pyx":1240 * total += 1 * if total == 0: return None * return mask.astype("bool") # <<<<<<<<<<<<<< @@ -21229,9 +22871,9 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1251, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_r = __pyx_t_1; @@ -21239,7 +22881,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":1216 + /* "yt/geometry/selection_routines.pyx":1205 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mask(self, gobj): # <<<<<<<<<<<<<< @@ -21275,7 +22917,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1256 +/* "yt/geometry/selection_routines.pyx":1245 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -21288,7 +22930,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1257 + /* "yt/geometry/selection_routines.pyx":1246 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if pos[self.axis] + 0.5*dds[self.axis] > self.coord \ # <<<<<<<<<<<<<< @@ -21302,7 +22944,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":1258 + /* "yt/geometry/selection_routines.pyx":1247 * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if pos[self.axis] + 0.5*dds[self.axis] > self.coord \ * and pos[self.axis] - 0.5*dds[self.axis] - grid_eps <= self.coord: # <<<<<<<<<<<<<< @@ -21313,7 +22955,7 @@ __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":1257 + /* "yt/geometry/selection_routines.pyx":1246 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if pos[self.axis] + 0.5*dds[self.axis] > self.coord \ # <<<<<<<<<<<<<< @@ -21322,7 +22964,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":1259 + /* "yt/geometry/selection_routines.pyx":1248 * if pos[self.axis] + 0.5*dds[self.axis] > self.coord \ * and pos[self.axis] - 0.5*dds[self.axis] - grid_eps <= self.coord: * return 1 # <<<<<<<<<<<<<< @@ -21332,7 +22974,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1257 + /* "yt/geometry/selection_routines.pyx":1246 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if pos[self.axis] + 0.5*dds[self.axis] > self.coord \ # <<<<<<<<<<<<<< @@ -21341,7 +22983,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1260 + /* "yt/geometry/selection_routines.pyx":1249 * and pos[self.axis] - 0.5*dds[self.axis] - grid_eps <= self.coord: * return 1 * return 0 # <<<<<<<<<<<<<< @@ -21351,7 +22993,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1256 + /* "yt/geometry/selection_routines.pyx":1245 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -21364,7 +23006,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1262 +/* "yt/geometry/selection_routines.pyx":1251 * return 0 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -21375,7 +23017,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_13SliceSelector_select_point(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1264 + /* "yt/geometry/selection_routines.pyx":1253 * cdef int select_point(self, np.float64_t pos[3]) nogil: * # two 0-volume constructs don't intersect * return 0 # <<<<<<<<<<<<<< @@ -21385,7 +23027,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1262 + /* "yt/geometry/selection_routines.pyx":1251 * return 0 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -21398,7 +23040,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1269 +/* "yt/geometry/selection_routines.pyx":1258 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -21411,7 +23053,7 @@ int __pyx_r; int __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":1270 + /* "yt/geometry/selection_routines.pyx":1259 * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * cdef np.float64_t dist = self.difference(pos[self.axis], self.coord, self.axis) # <<<<<<<<<<<<<< @@ -21420,7 +23062,7 @@ */ __pyx_v_dist = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SliceSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.difference(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), (__pyx_v_pos[__pyx_v_self->axis]), __pyx_v_self->coord, __pyx_v_self->axis); - /* "yt/geometry/selection_routines.pyx":1271 + /* "yt/geometry/selection_routines.pyx":1260 * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * cdef np.float64_t dist = self.difference(pos[self.axis], self.coord, self.axis) * if dist*dist < radius*radius: # <<<<<<<<<<<<<< @@ -21430,7 +23072,7 @@ __pyx_t_1 = (((__pyx_v_dist * __pyx_v_dist) < (__pyx_v_radius * __pyx_v_radius)) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":1272 + /* "yt/geometry/selection_routines.pyx":1261 * cdef np.float64_t dist = self.difference(pos[self.axis], self.coord, self.axis) * if dist*dist < radius*radius: * return 1 # <<<<<<<<<<<<<< @@ -21440,7 +23082,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1271 + /* "yt/geometry/selection_routines.pyx":1260 * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * cdef np.float64_t dist = self.difference(pos[self.axis], self.coord, self.axis) * if dist*dist < radius*radius: # <<<<<<<<<<<<<< @@ -21449,7 +23091,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1273 + /* "yt/geometry/selection_routines.pyx":1262 * if dist*dist < radius*radius: * return 1 * return 0 # <<<<<<<<<<<<<< @@ -21459,7 +23101,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1269 + /* "yt/geometry/selection_routines.pyx":1258 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -21472,7 +23114,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1278 +/* "yt/geometry/selection_routines.pyx":1267 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -21485,7 +23127,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1280 + /* "yt/geometry/selection_routines.pyx":1269 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * if left_edge[self.axis] - grid_eps <= self.coord < right_edge[self.axis]: # <<<<<<<<<<<<<< @@ -21499,7 +23141,7 @@ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pyx":1281 + /* "yt/geometry/selection_routines.pyx":1270 * np.float64_t right_edge[3]) nogil: * if left_edge[self.axis] - grid_eps <= self.coord < right_edge[self.axis]: * return 1 # <<<<<<<<<<<<<< @@ -21509,7 +23151,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1280 + /* "yt/geometry/selection_routines.pyx":1269 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * if left_edge[self.axis] - grid_eps <= self.coord < right_edge[self.axis]: # <<<<<<<<<<<<<< @@ -21518,7 +23160,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1282 + /* "yt/geometry/selection_routines.pyx":1271 * if left_edge[self.axis] - grid_eps <= self.coord < right_edge[self.axis]: * return 1 * return 0 # <<<<<<<<<<<<<< @@ -21528,7 +23170,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1278 + /* "yt/geometry/selection_routines.pyx":1267 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -21541,7 +23183,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1284 +/* "yt/geometry/selection_routines.pyx":1273 * return 0 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -21570,7 +23212,7 @@ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":1285 + /* "yt/geometry/selection_routines.pyx":1274 * * def _hash_vals(self): * return (("axis", self.axis), # <<<<<<<<<<<<<< @@ -21578,9 +23220,9 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->axis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->axis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1285, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_axis); __Pyx_GIVEREF(__pyx_n_s_axis); @@ -21589,16 +23231,16 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1286 + /* "yt/geometry/selection_routines.pyx":1275 * def _hash_vals(self): * return (("axis", self.axis), * ("coord", self.coord)) # <<<<<<<<<<<<<< * * slice_selector = SliceSelector */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->coord); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1286, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->coord); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1286, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_coord); __Pyx_GIVEREF(__pyx_n_s_coord); @@ -21607,14 +23249,14 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1285 + /* "yt/geometry/selection_routines.pyx":1274 * * def _hash_vals(self): * return (("axis", self.axis), # <<<<<<<<<<<<<< * ("coord", self.coord)) * */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -21626,7 +23268,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1284 + /* "yt/geometry/selection_routines.pyx":1273 * return 0 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -21647,53 +23289,161 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1298 - * cdef int axis - * - * def __init__(self, dobj): # <<<<<<<<<<<<<< - * self.axis = dobj.axis - * self.px_ax = dobj.px_ax +/* "(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 int __pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_dobj = 0; - int __pyx_r; +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_13SliceSelector_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_13SliceSelector_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dobj,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dobj)) != 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(0, 1298, __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_dobj = 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(0, 1298, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.geometry.selection_routines.OrthoRaySelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_13SliceSelector_6__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_13SliceSelector_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *__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__37, 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("yt.geometry.selection_routines.SliceSelector.__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_2yt_8geometry_18selection_routines_13SliceSelector_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_13SliceSelector_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_2yt_8geometry_18selection_routines_13SliceSelector_8__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_13SliceSelector_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *__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__38, 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("yt.geometry.selection_routines.SliceSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":1287 + * cdef int axis + * + * def __init__(self, dobj): # <<<<<<<<<<<<<< + * self.axis = dobj.axis + * self.px_ax = dobj.px_ax + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dobj = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dobj,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dobj)) != 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(0, 1287, __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_dobj = 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(0, 1287, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.selection_routines.OrthoRaySelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; @@ -21713,72 +23463,72 @@ __pyx_t_5numpy_float64_t __pyx_t_4; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":1299 + /* "yt/geometry/selection_routines.pyx":1288 * * def __init__(self, dobj): * self.axis = dobj.axis # <<<<<<<<<<<<<< * self.px_ax = dobj.px_ax * self.py_ax = dobj.py_ax */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_axis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_axis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __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(0, 1299, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->axis = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1300 + /* "yt/geometry/selection_routines.pyx":1289 * def __init__(self, dobj): * self.axis = dobj.axis * self.px_ax = dobj.px_ax # <<<<<<<<<<<<<< * self.py_ax = dobj.py_ax * self.px = dobj.px */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_px_ax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1300, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_px_ax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_npy_uint8(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1300, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_npy_uint8(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->px_ax = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":1301 + /* "yt/geometry/selection_routines.pyx":1290 * self.axis = dobj.axis * self.px_ax = dobj.px_ax * self.py_ax = dobj.py_ax # <<<<<<<<<<<<<< * self.px = dobj.px * self.py = dobj.py */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_py_ax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_py_ax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_npy_uint8(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1301, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_npy_uint8(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->py_ax = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":1302 + /* "yt/geometry/selection_routines.pyx":1291 * self.px_ax = dobj.px_ax * self.py_ax = dobj.py_ax * self.px = dobj.px # <<<<<<<<<<<<<< * self.py = dobj.py * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_px); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_px); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1302, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->px = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":1303 + /* "yt/geometry/selection_routines.pyx":1292 * self.py_ax = dobj.py_ax * self.px = dobj.px * self.py = dobj.py # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_py); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_py); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1303, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1292, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->py = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":1298 + /* "yt/geometry/selection_routines.pyx":1287 * cdef int axis * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -21798,7 +23548,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1308 +/* "yt/geometry/selection_routines.pyx":1297 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mask(self, gobj): # <<<<<<<<<<<<<< @@ -21870,7 +23620,7 @@ __pyx_pybuffernd_child_mask.data = NULL; __pyx_pybuffernd_child_mask.rcbuffer = &__pyx_pybuffer_child_mask; - /* "yt/geometry/selection_routines.pyx":1312 + /* "yt/geometry/selection_routines.pyx":1301 * cdef np.ndarray[np.uint8_t, ndim=3, cast=True] child_mask * cdef int i, j, k * cdef int total = 0 # <<<<<<<<<<<<<< @@ -21879,7 +23629,7 @@ */ __pyx_v_total = 0; - /* "yt/geometry/selection_routines.pyx":1313 + /* "yt/geometry/selection_routines.pyx":1302 * cdef int i, j, k * cdef int total = 0 * cdef int this_level = 0 # <<<<<<<<<<<<<< @@ -21888,62 +23638,62 @@ */ __pyx_v_this_level = 0; - /* "yt/geometry/selection_routines.pyx":1315 + /* "yt/geometry/selection_routines.pyx":1304 * cdef int this_level = 0 * cdef int ind[3][2] * cdef np.int32_t level = gobj.Level # <<<<<<<<<<<<<< * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.RightEdge) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_Level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1315, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_Level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1315, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_level = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1316 + /* "yt/geometry/selection_routines.pyx":1305 * cdef int ind[3][2] * cdef np.int32_t level = gobj.Level * _ensure_code(gobj.LeftEdge) # <<<<<<<<<<<<<< * _ensure_code(gobj.RightEdge) * _ensure_code(gobj.dds) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":1317 + /* "yt/geometry/selection_routines.pyx":1306 * cdef np.int32_t level = gobj.Level * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.RightEdge) # <<<<<<<<<<<<<< * _ensure_code(gobj.dds) * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1318 + /* "yt/geometry/selection_routines.pyx":1307 * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.RightEdge) * _ensure_code(gobj.dds) # <<<<<<<<<<<<<< * * if level < self.min_level or level > self.max_level: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_3 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":1320 + /* "yt/geometry/selection_routines.pyx":1309 * _ensure_code(gobj.dds) * * if level < self.min_level or level > self.max_level: # <<<<<<<<<<<<<< @@ -21961,7 +23711,7 @@ __pyx_L4_bool_binop_done:; if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":1321 + /* "yt/geometry/selection_routines.pyx":1310 * * if level < self.min_level or level > self.max_level: * return None # <<<<<<<<<<<<<< @@ -21973,7 +23723,7 @@ __pyx_r = Py_None; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1320 + /* "yt/geometry/selection_routines.pyx":1309 * _ensure_code(gobj.dds) * * if level < self.min_level or level > self.max_level: # <<<<<<<<<<<<<< @@ -21982,7 +23732,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1323 + /* "yt/geometry/selection_routines.pyx":1312 * return None * else: * child_mask = gobj.child_mask # <<<<<<<<<<<<<< @@ -21990,9 +23740,9 @@ * if level == self.max_level: */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_child_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_child_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1323, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1312, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -22008,46 +23758,46 @@ } } __pyx_pybuffernd_child_mask.diminfo[0].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_mask.diminfo[0].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_child_mask.diminfo[1].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_child_mask.diminfo[1].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_child_mask.diminfo[2].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_child_mask.diminfo[2].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1323, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1312, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_child_mask = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":1324 + /* "yt/geometry/selection_routines.pyx":1313 * else: * child_mask = gobj.child_mask * mask = np.zeros(gobj.ActiveDimensions, dtype=np.uint8) # <<<<<<<<<<<<<< * if level == self.max_level: * this_level = 1 */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1324, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1324, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1324, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1324, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1324, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_uint8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1324, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_uint8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(0, 1324, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1324, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1324, __pyx_L1_error) + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1313, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -22063,13 +23813,13 @@ } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1324, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1313, __pyx_L1_error) } __pyx_t_14 = 0; __pyx_v_mask = ((PyArrayObject *)__pyx_t_13); __pyx_t_13 = 0; - /* "yt/geometry/selection_routines.pyx":1325 + /* "yt/geometry/selection_routines.pyx":1314 * child_mask = gobj.child_mask * mask = np.zeros(gobj.ActiveDimensions, dtype=np.uint8) * if level == self.max_level: # <<<<<<<<<<<<<< @@ -22079,7 +23829,7 @@ __pyx_t_4 = ((__pyx_v_level == __pyx_v_self->__pyx_base.max_level) != 0); if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":1326 + /* "yt/geometry/selection_routines.pyx":1315 * mask = np.zeros(gobj.ActiveDimensions, dtype=np.uint8) * if level == self.max_level: * this_level = 1 # <<<<<<<<<<<<<< @@ -22088,7 +23838,7 @@ */ __pyx_v_this_level = 1; - /* "yt/geometry/selection_routines.pyx":1325 + /* "yt/geometry/selection_routines.pyx":1314 * child_mask = gobj.child_mask * mask = np.zeros(gobj.ActiveDimensions, dtype=np.uint8) * if level == self.max_level: # <<<<<<<<<<<<<< @@ -22097,7 +23847,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1327 + /* "yt/geometry/selection_routines.pyx":1316 * if level == self.max_level: * this_level = 1 * ind[self.axis][0] = 0 # <<<<<<<<<<<<<< @@ -22106,34 +23856,34 @@ */ ((__pyx_v_ind[__pyx_v_self->axis])[0]) = 0; - /* "yt/geometry/selection_routines.pyx":1328 + /* "yt/geometry/selection_routines.pyx":1317 * this_level = 1 * ind[self.axis][0] = 0 * ind[self.axis][1] = gobj.ActiveDimensions[self.axis] # <<<<<<<<<<<<<< * ind[self.px_ax][0] = \ * ((self.px - (gobj.LeftEdge).to_ndarray()[self.px_ax]) / */ - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_13, __pyx_v_self->axis, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_13, __pyx_v_self->axis, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; ((__pyx_v_ind[__pyx_v_self->axis])[1]) = __pyx_t_7; - /* "yt/geometry/selection_routines.pyx":1330 + /* "yt/geometry/selection_routines.pyx":1319 * ind[self.axis][1] = gobj.ActiveDimensions[self.axis] * ind[self.px_ax][0] = \ * ((self.px - (gobj.LeftEdge).to_ndarray()[self.px_ax]) / # <<<<<<<<<<<<<< * gobj.dds[self.px_ax]) * ind[self.px_ax][1] = ind[self.px_ax][0] + 1 */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->px); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->px); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_to_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_to_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -22147,49 +23897,49 @@ } } if (__pyx_t_11) { - __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { - __pyx_t_13 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1319, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_13, __pyx_v_self->px_ax, __pyx_t_5numpy_uint8_t, 0, __Pyx_PyInt_From_npy_uint8, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_13, __pyx_v_self->px_ax, __pyx_t_5numpy_uint8_t, 0, __Pyx_PyInt_From_npy_uint8, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_13 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1331 + /* "yt/geometry/selection_routines.pyx":1320 * ind[self.px_ax][0] = \ * ((self.px - (gobj.LeftEdge).to_ndarray()[self.px_ax]) / * gobj.dds[self.px_ax]) # <<<<<<<<<<<<<< * ind[self.px_ax][1] = ind[self.px_ax][0] + 1 * ind[self.py_ax][0] = \ */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_self->px_ax, __pyx_t_5numpy_uint8_t, 0, __Pyx_PyInt_From_npy_uint8, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_self->px_ax, __pyx_t_5numpy_uint8_t, 0, __Pyx_PyInt_From_npy_uint8, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1330 + /* "yt/geometry/selection_routines.pyx":1319 * ind[self.axis][1] = gobj.ActiveDimensions[self.axis] * ind[self.px_ax][0] = \ * ((self.px - (gobj.LeftEdge).to_ndarray()[self.px_ax]) / # <<<<<<<<<<<<<< * gobj.dds[self.px_ax]) * ind[self.px_ax][1] = ind[self.px_ax][0] + 1 */ - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_13, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_13, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1329 + /* "yt/geometry/selection_routines.pyx":1318 * ind[self.axis][0] = 0 * ind[self.axis][1] = gobj.ActiveDimensions[self.axis] * ind[self.px_ax][0] = \ # <<<<<<<<<<<<<< @@ -22198,7 +23948,7 @@ */ ((__pyx_v_ind[__pyx_v_self->px_ax])[0]) = ((int)__pyx_t_7); - /* "yt/geometry/selection_routines.pyx":1332 + /* "yt/geometry/selection_routines.pyx":1321 * ((self.px - (gobj.LeftEdge).to_ndarray()[self.px_ax]) / * gobj.dds[self.px_ax]) * ind[self.px_ax][1] = ind[self.px_ax][0] + 1 # <<<<<<<<<<<<<< @@ -22207,18 +23957,18 @@ */ ((__pyx_v_ind[__pyx_v_self->px_ax])[1]) = (((__pyx_v_ind[__pyx_v_self->px_ax])[0]) + 1); - /* "yt/geometry/selection_routines.pyx":1334 + /* "yt/geometry/selection_routines.pyx":1323 * ind[self.px_ax][1] = ind[self.px_ax][0] + 1 * ind[self.py_ax][0] = \ * ((self.py - (gobj.LeftEdge).to_ndarray()[self.py_ax]) / # <<<<<<<<<<<<<< * gobj.dds[self.py_ax]) * ind[self.py_ax][1] = ind[self.py_ax][0] + 1 */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->py); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->py); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_to_ndarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_to_ndarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; @@ -22232,49 +23982,49 @@ } } if (__pyx_t_13) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_self->py_ax, __pyx_t_5numpy_uint8_t, 0, __Pyx_PyInt_From_npy_uint8, 0, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_self->py_ax, __pyx_t_5numpy_uint8_t, 0, __Pyx_PyInt_From_npy_uint8, 0, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "yt/geometry/selection_routines.pyx":1335 + /* "yt/geometry/selection_routines.pyx":1324 * ind[self.py_ax][0] = \ * ((self.py - (gobj.LeftEdge).to_ndarray()[self.py_ax]) / * gobj.dds[self.py_ax]) # <<<<<<<<<<<<<< * ind[self.py_ax][1] = ind[self.py_ax][0] + 1 * */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_11, __pyx_v_self->py_ax, __pyx_t_5numpy_uint8_t, 0, __Pyx_PyInt_From_npy_uint8, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_11, __pyx_v_self->py_ax, __pyx_t_5numpy_uint8_t, 0, __Pyx_PyInt_From_npy_uint8, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "yt/geometry/selection_routines.pyx":1334 + /* "yt/geometry/selection_routines.pyx":1323 * ind[self.px_ax][1] = ind[self.px_ax][0] + 1 * ind[self.py_ax][0] = \ * ((self.py - (gobj.LeftEdge).to_ndarray()[self.py_ax]) / # <<<<<<<<<<<<<< * gobj.dds[self.py_ax]) * ind[self.py_ax][1] = ind[self.py_ax][0] + 1 */ - __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "yt/geometry/selection_routines.pyx":1333 + /* "yt/geometry/selection_routines.pyx":1322 * gobj.dds[self.px_ax]) * ind[self.px_ax][1] = ind[self.px_ax][0] + 1 * ind[self.py_ax][0] = \ # <<<<<<<<<<<<<< @@ -22283,7 +24033,7 @@ */ ((__pyx_v_ind[__pyx_v_self->py_ax])[0]) = ((int)__pyx_t_7); - /* "yt/geometry/selection_routines.pyx":1336 + /* "yt/geometry/selection_routines.pyx":1325 * ((self.py - (gobj.LeftEdge).to_ndarray()[self.py_ax]) / * gobj.dds[self.py_ax]) * ind[self.py_ax][1] = ind[self.py_ax][0] + 1 # <<<<<<<<<<<<<< @@ -22292,7 +24042,7 @@ */ ((__pyx_v_ind[__pyx_v_self->py_ax])[1]) = (((__pyx_v_ind[__pyx_v_self->py_ax])[0]) + 1); - /* "yt/geometry/selection_routines.pyx":1338 + /* "yt/geometry/selection_routines.pyx":1327 * ind[self.py_ax][1] = ind[self.py_ax][0] + 1 * * with nogil: # <<<<<<<<<<<<<< @@ -22303,10 +24053,11 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/geometry/selection_routines.pyx":1339 + /* "yt/geometry/selection_routines.pyx":1328 * * with nogil: * for i in range(ind[0][0], ind[0][1]): # <<<<<<<<<<<<<< @@ -22317,7 +24068,7 @@ for (__pyx_t_15 = ((__pyx_v_ind[0])[0]); __pyx_t_15 < __pyx_t_7; __pyx_t_15+=1) { __pyx_v_i = __pyx_t_15; - /* "yt/geometry/selection_routines.pyx":1340 + /* "yt/geometry/selection_routines.pyx":1329 * with nogil: * for i in range(ind[0][0], ind[0][1]): * for j in range(ind[1][0], ind[1][1]): # <<<<<<<<<<<<<< @@ -22328,7 +24079,7 @@ for (__pyx_t_17 = ((__pyx_v_ind[1])[0]); __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_j = __pyx_t_17; - /* "yt/geometry/selection_routines.pyx":1341 + /* "yt/geometry/selection_routines.pyx":1330 * for i in range(ind[0][0], ind[0][1]): * for j in range(ind[1][0], ind[1][1]): * for k in range(ind[2][0], ind[2][1]): # <<<<<<<<<<<<<< @@ -22339,7 +24090,7 @@ for (__pyx_t_19 = ((__pyx_v_ind[2])[0]); __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { __pyx_v_k = __pyx_t_19; - /* "yt/geometry/selection_routines.pyx":1342 + /* "yt/geometry/selection_routines.pyx":1331 * for j in range(ind[1][0], ind[1][1]): * for k in range(ind[2][0], ind[2][1]): * if this_level == 1 or child_mask[i, j, k]: # <<<<<<<<<<<<<< @@ -22360,7 +24111,7 @@ __pyx_L17_bool_binop_done:; if (__pyx_t_4) { - /* "yt/geometry/selection_routines.pyx":1343 + /* "yt/geometry/selection_routines.pyx":1332 * for k in range(ind[2][0], ind[2][1]): * if this_level == 1 or child_mask[i, j, k]: * mask[i, j, k] = 1 # <<<<<<<<<<<<<< @@ -22372,7 +24123,7 @@ __pyx_t_25 = __pyx_v_k; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_mask.diminfo[2].strides) = 1; - /* "yt/geometry/selection_routines.pyx":1344 + /* "yt/geometry/selection_routines.pyx":1333 * if this_level == 1 or child_mask[i, j, k]: * mask[i, j, k] = 1 * total += 1 # <<<<<<<<<<<<<< @@ -22381,7 +24132,7 @@ */ __pyx_v_total = (__pyx_v_total + 1); - /* "yt/geometry/selection_routines.pyx":1342 + /* "yt/geometry/selection_routines.pyx":1331 * for j in range(ind[1][0], ind[1][1]): * for k in range(ind[2][0], ind[2][1]): * if this_level == 1 or child_mask[i, j, k]: # <<<<<<<<<<<<<< @@ -22394,7 +24145,7 @@ } } - /* "yt/geometry/selection_routines.pyx":1338 + /* "yt/geometry/selection_routines.pyx":1327 * ind[self.py_ax][1] = ind[self.py_ax][0] + 1 * * with nogil: # <<<<<<<<<<<<<< @@ -22404,6 +24155,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L9; @@ -22412,7 +24164,7 @@ } } - /* "yt/geometry/selection_routines.pyx":1345 + /* "yt/geometry/selection_routines.pyx":1334 * mask[i, j, k] = 1 * total += 1 * if total == 0: return None # <<<<<<<<<<<<<< @@ -22427,7 +24179,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":1346 + /* "yt/geometry/selection_routines.pyx":1335 * total += 1 * if total == 0: return None * return mask.astype("bool") # <<<<<<<<<<<<<< @@ -22435,9 +24187,9 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1346, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_r = __pyx_t_1; @@ -22445,7 +24197,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":1308 + /* "yt/geometry/selection_routines.pyx":1297 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mask(self, gobj): # <<<<<<<<<<<<<< @@ -22481,7 +24233,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1351 +/* "yt/geometry/selection_routines.pyx":1340 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -22494,7 +24246,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1352 + /* "yt/geometry/selection_routines.pyx":1341 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if self.px >= pos[self.px_ax] - 0.5*dds[self.px_ax] and \ # <<<<<<<<<<<<<< @@ -22508,7 +24260,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":1353 + /* "yt/geometry/selection_routines.pyx":1342 * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if self.px >= pos[self.px_ax] - 0.5*dds[self.px_ax] and \ * self.px < pos[self.px_ax] + 0.5*dds[self.px_ax] and \ # <<<<<<<<<<<<<< @@ -22522,7 +24274,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":1354 + /* "yt/geometry/selection_routines.pyx":1343 * if self.px >= pos[self.px_ax] - 0.5*dds[self.px_ax] and \ * self.px < pos[self.px_ax] + 0.5*dds[self.px_ax] and \ * self.py >= pos[self.py_ax] - 0.5*dds[self.py_ax] and \ # <<<<<<<<<<<<<< @@ -22536,7 +24288,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":1355 + /* "yt/geometry/selection_routines.pyx":1344 * self.px < pos[self.px_ax] + 0.5*dds[self.px_ax] and \ * self.py >= pos[self.py_ax] - 0.5*dds[self.py_ax] and \ * self.py < pos[self.py_ax] + 0.5*dds[self.py_ax]: # <<<<<<<<<<<<<< @@ -22547,7 +24299,7 @@ __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":1352 + /* "yt/geometry/selection_routines.pyx":1341 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if self.px >= pos[self.px_ax] - 0.5*dds[self.px_ax] and \ # <<<<<<<<<<<<<< @@ -22556,7 +24308,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":1356 + /* "yt/geometry/selection_routines.pyx":1345 * self.py >= pos[self.py_ax] - 0.5*dds[self.py_ax] and \ * self.py < pos[self.py_ax] + 0.5*dds[self.py_ax]: * return 1 # <<<<<<<<<<<<<< @@ -22566,7 +24318,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1352 + /* "yt/geometry/selection_routines.pyx":1341 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if self.px >= pos[self.px_ax] - 0.5*dds[self.px_ax] and \ # <<<<<<<<<<<<<< @@ -22575,7 +24327,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1357 + /* "yt/geometry/selection_routines.pyx":1346 * self.py < pos[self.py_ax] + 0.5*dds[self.py_ax]: * return 1 * return 0 # <<<<<<<<<<<<<< @@ -22585,7 +24337,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1351 + /* "yt/geometry/selection_routines.pyx":1340 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -22598,7 +24350,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1359 +/* "yt/geometry/selection_routines.pyx":1348 * return 0 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -22609,7 +24361,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_16OrthoRaySelector_select_point(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1361 + /* "yt/geometry/selection_routines.pyx":1350 * cdef int select_point(self, np.float64_t pos[3]) nogil: * # two 0-volume constructs don't intersect * return 0 # <<<<<<<<<<<<<< @@ -22619,7 +24371,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1359 + /* "yt/geometry/selection_routines.pyx":1348 * return 0 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -22632,7 +24384,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1366 +/* "yt/geometry/selection_routines.pyx":1355 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -22646,7 +24398,7 @@ int __pyx_r; int __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":1367 + /* "yt/geometry/selection_routines.pyx":1356 * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * cdef np.float64_t dx = self.difference(pos[self.px_ax], self.px, self.px_ax) # <<<<<<<<<<<<<< @@ -22655,7 +24407,7 @@ */ __pyx_v_dx = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OrthoRaySelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.difference(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), (__pyx_v_pos[__pyx_v_self->px_ax]), __pyx_v_self->px, __pyx_v_self->px_ax); - /* "yt/geometry/selection_routines.pyx":1368 + /* "yt/geometry/selection_routines.pyx":1357 * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * cdef np.float64_t dx = self.difference(pos[self.px_ax], self.px, self.px_ax) * cdef np.float64_t dy = self.difference(pos[self.py_ax], self.py, self.py_ax) # <<<<<<<<<<<<<< @@ -22664,7 +24416,7 @@ */ __pyx_v_dy = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OrthoRaySelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.difference(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), (__pyx_v_pos[__pyx_v_self->py_ax]), __pyx_v_self->py, __pyx_v_self->py_ax); - /* "yt/geometry/selection_routines.pyx":1369 + /* "yt/geometry/selection_routines.pyx":1358 * cdef np.float64_t dx = self.difference(pos[self.px_ax], self.px, self.px_ax) * cdef np.float64_t dy = self.difference(pos[self.py_ax], self.py, self.py_ax) * if dx*dx + dy*dy < radius*radius: # <<<<<<<<<<<<<< @@ -22674,7 +24426,7 @@ __pyx_t_1 = ((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) < (__pyx_v_radius * __pyx_v_radius)) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":1370 + /* "yt/geometry/selection_routines.pyx":1359 * cdef np.float64_t dy = self.difference(pos[self.py_ax], self.py, self.py_ax) * if dx*dx + dy*dy < radius*radius: * return 1 # <<<<<<<<<<<<<< @@ -22684,7 +24436,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1369 + /* "yt/geometry/selection_routines.pyx":1358 * cdef np.float64_t dx = self.difference(pos[self.px_ax], self.px, self.px_ax) * cdef np.float64_t dy = self.difference(pos[self.py_ax], self.py, self.py_ax) * if dx*dx + dy*dy < radius*radius: # <<<<<<<<<<<<<< @@ -22693,7 +24445,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1371 + /* "yt/geometry/selection_routines.pyx":1360 * if dx*dx + dy*dy < radius*radius: * return 1 * return 0 # <<<<<<<<<<<<<< @@ -22703,7 +24455,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1366 + /* "yt/geometry/selection_routines.pyx":1355 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -22716,7 +24468,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1376 +/* "yt/geometry/selection_routines.pyx":1365 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -22730,7 +24482,7 @@ int __pyx_t_2; int __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":1378 + /* "yt/geometry/selection_routines.pyx":1367 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * if left_edge[self.px_ax] <= self.px < right_edge[self.px_ax] and \ # <<<<<<<<<<<<<< @@ -22748,7 +24500,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":1379 + /* "yt/geometry/selection_routines.pyx":1368 * np.float64_t right_edge[3]) nogil: * if left_edge[self.px_ax] <= self.px < right_edge[self.px_ax] and \ * left_edge[self.py_ax] <= self.py < right_edge[self.py_ax] : # <<<<<<<<<<<<<< @@ -22763,7 +24515,7 @@ __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":1378 + /* "yt/geometry/selection_routines.pyx":1367 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * if left_edge[self.px_ax] <= self.px < right_edge[self.px_ax] and \ # <<<<<<<<<<<<<< @@ -22772,7 +24524,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":1380 + /* "yt/geometry/selection_routines.pyx":1369 * if left_edge[self.px_ax] <= self.px < right_edge[self.px_ax] and \ * left_edge[self.py_ax] <= self.py < right_edge[self.py_ax] : * return 1 # <<<<<<<<<<<<<< @@ -22782,7 +24534,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1378 + /* "yt/geometry/selection_routines.pyx":1367 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * if left_edge[self.px_ax] <= self.px < right_edge[self.px_ax] and \ # <<<<<<<<<<<<<< @@ -22791,7 +24543,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1381 + /* "yt/geometry/selection_routines.pyx":1370 * left_edge[self.py_ax] <= self.py < right_edge[self.py_ax] : * return 1 * return 0 # <<<<<<<<<<<<<< @@ -22801,7 +24553,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1376 + /* "yt/geometry/selection_routines.pyx":1365 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -22814,7 +24566,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1383 +/* "yt/geometry/selection_routines.pyx":1372 * return 0 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -22846,7 +24598,7 @@ PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":1384 + /* "yt/geometry/selection_routines.pyx":1373 * * def _hash_vals(self): * return (("px_ax", self.px_ax), # <<<<<<<<<<<<<< @@ -22854,9 +24606,9 @@ * ("px", self.px), */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_uint8(__pyx_v_self->px_ax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1384, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_uint8(__pyx_v_self->px_ax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_px_ax); __Pyx_GIVEREF(__pyx_n_s_px_ax); @@ -22865,16 +24617,16 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1385 + /* "yt/geometry/selection_routines.pyx":1374 * def _hash_vals(self): * return (("px_ax", self.px_ax), * ("py_ax", self.py_ax), # <<<<<<<<<<<<<< * ("px", self.px), * ("py", self.py), */ - __pyx_t_1 = __Pyx_PyInt_From_npy_uint8(__pyx_v_self->py_ax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_uint8(__pyx_v_self->py_ax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_py_ax); __Pyx_GIVEREF(__pyx_n_s_py_ax); @@ -22883,16 +24635,16 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1386 + /* "yt/geometry/selection_routines.pyx":1375 * return (("px_ax", self.px_ax), * ("py_ax", self.py_ax), * ("px", self.px), # <<<<<<<<<<<<<< * ("py", self.py), * ("axis", self.axis)) */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->px); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->px); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1386, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_px); __Pyx_GIVEREF(__pyx_n_s_px); @@ -22901,16 +24653,16 @@ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1387 + /* "yt/geometry/selection_routines.pyx":1376 * ("py_ax", self.py_ax), * ("px", self.px), * ("py", self.py), # <<<<<<<<<<<<<< * ("axis", self.axis)) * */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->py); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->py); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1387, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_n_s_py); __Pyx_GIVEREF(__pyx_n_s_py); @@ -22919,16 +24671,16 @@ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1388 + /* "yt/geometry/selection_routines.pyx":1377 * ("px", self.px), * ("py", self.py), * ("axis", self.axis)) # <<<<<<<<<<<<<< * * ortho_ray_selector = OrthoRaySelector */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->axis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->axis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1388, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_n_s_axis); __Pyx_GIVEREF(__pyx_n_s_axis); @@ -22937,14 +24689,14 @@ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1384 + /* "yt/geometry/selection_routines.pyx":1373 * * def _hash_vals(self): * return (("px_ax", self.px_ax), # <<<<<<<<<<<<<< * ("py_ax", self.py_ax), * ("px", self.px), */ - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1384, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -22965,7 +24717,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1383 + /* "yt/geometry/selection_routines.pyx":1372 * return 0 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -22989,7 +24741,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1398 +/* "(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_2yt_8geometry_18selection_routines_16OrthoRaySelector_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_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_2yt_8geometry_18selection_routines_16OrthoRaySelector_6__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_16OrthoRaySelector_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *__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__40, 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("yt.geometry.selection_routines.OrthoRaySelector.__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_2yt_8geometry_18selection_routines_16OrthoRaySelector_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_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_2yt_8geometry_18selection_routines_16OrthoRaySelector_8__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_16OrthoRaySelector_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *__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__41, 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("yt.geometry.selection_routines.OrthoRaySelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":1387 * int hits * * cdef void dt_sampler( # <<<<<<<<<<<<<< @@ -23003,7 +24862,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1406 + /* "yt/geometry/selection_routines.pyx":1395 * int index[3], * void *data) nogil: * cdef IntegrationAccumulator *am = data # <<<<<<<<<<<<<< @@ -23012,7 +24871,7 @@ */ __pyx_v_am = ((struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator *)__pyx_v_data); - /* "yt/geometry/selection_routines.pyx":1407 + /* "yt/geometry/selection_routines.pyx":1396 * void *data) nogil: * cdef IntegrationAccumulator *am = data * cdef int di = (index[0]*vc.dims[1]+index[1])*vc.dims[2]+index[2] # <<<<<<<<<<<<<< @@ -23021,7 +24880,7 @@ */ __pyx_v_di = (((((__pyx_v_index[0]) * (__pyx_v_vc->dims[1])) + (__pyx_v_index[1])) * (__pyx_v_vc->dims[2])) + (__pyx_v_index[2])); - /* "yt/geometry/selection_routines.pyx":1408 + /* "yt/geometry/selection_routines.pyx":1397 * cdef IntegrationAccumulator *am = data * cdef int di = (index[0]*vc.dims[1]+index[1])*vc.dims[2]+index[2] * if am.child_mask[di] == 0 or enter_t == exit_t: # <<<<<<<<<<<<<< @@ -23039,7 +24898,7 @@ __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":1409 + /* "yt/geometry/selection_routines.pyx":1398 * cdef int di = (index[0]*vc.dims[1]+index[1])*vc.dims[2]+index[2] * if am.child_mask[di] == 0 or enter_t == exit_t: * return # <<<<<<<<<<<<<< @@ -23048,7 +24907,7 @@ */ goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1408 + /* "yt/geometry/selection_routines.pyx":1397 * cdef IntegrationAccumulator *am = data * cdef int di = (index[0]*vc.dims[1]+index[1])*vc.dims[2]+index[2] * if am.child_mask[di] == 0 or enter_t == exit_t: # <<<<<<<<<<<<<< @@ -23057,7 +24916,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1410 + /* "yt/geometry/selection_routines.pyx":1399 * if am.child_mask[di] == 0 or enter_t == exit_t: * return * am.hits += 1 # <<<<<<<<<<<<<< @@ -23066,7 +24925,7 @@ */ __pyx_v_am->hits = (__pyx_v_am->hits + 1); - /* "yt/geometry/selection_routines.pyx":1411 + /* "yt/geometry/selection_routines.pyx":1400 * return * am.hits += 1 * am.t[di] = enter_t # <<<<<<<<<<<<<< @@ -23075,7 +24934,7 @@ */ (__pyx_v_am->t[__pyx_v_di]) = __pyx_v_enter_t; - /* "yt/geometry/selection_routines.pyx":1412 + /* "yt/geometry/selection_routines.pyx":1401 * am.hits += 1 * am.t[di] = enter_t * am.dt[di] = (exit_t - enter_t) # <<<<<<<<<<<<<< @@ -23084,7 +24943,7 @@ */ (__pyx_v_am->dt[__pyx_v_di]) = (__pyx_v_exit_t - __pyx_v_enter_t); - /* "yt/geometry/selection_routines.pyx":1398 + /* "yt/geometry/selection_routines.pyx":1387 * int hits * * cdef void dt_sampler( # <<<<<<<<<<<<<< @@ -23096,7 +24955,7 @@ __pyx_L0:; } -/* "yt/geometry/selection_routines.pyx":1420 +/* "yt/geometry/selection_routines.pyx":1409 * cdef np.float64_t vec[3] * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -23119,6 +24978,7 @@ 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; } @@ -23129,7 +24989,7 @@ 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(0, 1420, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1409, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -23140,7 +25000,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1420, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1409, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.RaySelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -23163,35 +25023,35 @@ __pyx_t_5numpy_float64_t __pyx_t_4; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":1422 + /* "yt/geometry/selection_routines.pyx":1411 * def __init__(self, dobj): * cdef int i * _ensure_code(dobj.start_point) # <<<<<<<<<<<<<< * _ensure_code(dobj.end_point) * for i in range(3): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_start_point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_start_point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error) + __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/selection_routines.pyx":1423 + /* "yt/geometry/selection_routines.pyx":1412 * cdef int i * _ensure_code(dobj.start_point) * _ensure_code(dobj.end_point) # <<<<<<<<<<<<<< * for i in range(3): * self.vec[i] = dobj.vec[i] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_end_point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1423, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_end_point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1424 + /* "yt/geometry/selection_routines.pyx":1413 * _ensure_code(dobj.start_point) * _ensure_code(dobj.end_point) * for i in range(3): # <<<<<<<<<<<<<< @@ -23201,56 +25061,56 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":1425 + /* "yt/geometry/selection_routines.pyx":1414 * _ensure_code(dobj.end_point) * for i in range(3): * self.vec[i] = dobj.vec[i] # <<<<<<<<<<<<<< * self.p1[i] = dobj.start_point[i] * self.p2[i] = dobj.end_point[i] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_vec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_vec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_self->vec[__pyx_v_i]) = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":1426 + /* "yt/geometry/selection_routines.pyx":1415 * for i in range(3): * self.vec[i] = dobj.vec[i] * self.p1[i] = dobj.start_point[i] # <<<<<<<<<<<<<< * self.p2[i] = dobj.end_point[i] * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_start_point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1426, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_start_point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1426, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_self->p1[__pyx_v_i]) = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":1427 + /* "yt/geometry/selection_routines.pyx":1416 * self.vec[i] = dobj.vec[i] * self.p1[i] = dobj.start_point[i] * self.p2[i] = dobj.end_point[i] # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_end_point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_end_point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_self->p2[__pyx_v_i]) = __pyx_t_4; } - /* "yt/geometry/selection_routines.pyx":1420 + /* "yt/geometry/selection_routines.pyx":1409 * cdef np.float64_t vec[3] * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -23271,7 +25131,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1432 +/* "yt/geometry/selection_routines.pyx":1421 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mask(self, gobj): # <<<<<<<<<<<<<< @@ -23298,7 +25158,7 @@ PyArrayObject *__pyx_v_child_mask = 0; int __pyx_v_i; int __pyx_v_total; - struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator __pyx_v_ia; + struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator *__pyx_v_ia; struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer __pyx_v_vc; PyObject *__pyx_v_mask = NULL; npy_intp __pyx_v_j; @@ -23345,38 +25205,47 @@ __pyx_pybuffernd_child_mask.data = NULL; __pyx_pybuffernd_child_mask.rcbuffer = &__pyx_pybuffer_child_mask; - /* "yt/geometry/selection_routines.pyx":1436 + /* "yt/geometry/selection_routines.pyx":1425 * cdef np.ndarray[np.uint8_t, ndim=3, cast=True] child_mask * cdef int i * cdef int total = 0 # <<<<<<<<<<<<<< - * cdef IntegrationAccumulator ia - * cdef VolumeContainer vc + * cdef IntegrationAccumulator *ia + * ia = malloc(sizeof(IntegrationAccumulator)) */ __pyx_v_total = 0; - /* "yt/geometry/selection_routines.pyx":1439 - * cdef IntegrationAccumulator ia + /* "yt/geometry/selection_routines.pyx":1427 + * cdef int total = 0 + * cdef IntegrationAccumulator *ia + * ia = malloc(sizeof(IntegrationAccumulator)) # <<<<<<<<<<<<<< + * cdef VolumeContainer vc + * mask = np.zeros(gobj.ActiveDimensions, dtype='uint8') + */ + __pyx_v_ia = ((struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator *)malloc((sizeof(struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator)))); + + /* "yt/geometry/selection_routines.pyx":1429 + * ia = malloc(sizeof(IntegrationAccumulator)) * cdef VolumeContainer vc * mask = np.zeros(gobj.ActiveDimensions, dtype='uint8') # <<<<<<<<<<<<<< * t = np.zeros(gobj.ActiveDimensions, dtype="float64") * dt = np.zeros(gobj.ActiveDimensions, dtype="float64") - 1 */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __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, 1439, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1439, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 1439, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1429, __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; @@ -23384,34 +25253,34 @@ __pyx_v_mask = __pyx_t_4; __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":1440 + /* "yt/geometry/selection_routines.pyx":1430 * cdef VolumeContainer vc * mask = np.zeros(gobj.ActiveDimensions, dtype='uint8') * t = np.zeros(gobj.ActiveDimensions, dtype="float64") # <<<<<<<<<<<<<< * dt = np.zeros(gobj.ActiveDimensions, dtype="float64") - 1 * child_mask = gobj.child_mask */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1430, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1440, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1430, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -23427,43 +25296,43 @@ } } __pyx_pybuffernd_t.diminfo[0].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t.diminfo[0].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_t.diminfo[1].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_t.diminfo[1].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_t.diminfo[2].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_t.diminfo[2].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1440, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1430, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_t = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/selection_routines.pyx":1441 + /* "yt/geometry/selection_routines.pyx":1431 * mask = np.zeros(gobj.ActiveDimensions, dtype='uint8') * t = np.zeros(gobj.ActiveDimensions, dtype="float64") * dt = np.zeros(gobj.ActiveDimensions, dtype="float64") - 1 # <<<<<<<<<<<<<< * child_mask = gobj.child_mask * ia.t = t.data */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1441, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1441, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1431, __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1441, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1441, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1431, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -23479,22 +25348,22 @@ } } __pyx_pybuffernd_dt.diminfo[0].strides = __pyx_pybuffernd_dt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dt.diminfo[0].shape = __pyx_pybuffernd_dt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dt.diminfo[1].strides = __pyx_pybuffernd_dt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dt.diminfo[1].shape = __pyx_pybuffernd_dt.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dt.diminfo[2].strides = __pyx_pybuffernd_dt.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dt.diminfo[2].shape = __pyx_pybuffernd_dt.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1441, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1431, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_dt = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/selection_routines.pyx":1442 + /* "yt/geometry/selection_routines.pyx":1432 * t = np.zeros(gobj.ActiveDimensions, dtype="float64") * dt = np.zeros(gobj.ActiveDimensions, dtype="float64") - 1 * child_mask = gobj.child_mask # <<<<<<<<<<<<<< * ia.t = t.data * ia.dt = dt.data */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_child_mask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1442, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_child_mask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1442, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1432, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -23510,91 +25379,91 @@ } } __pyx_pybuffernd_child_mask.diminfo[0].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_mask.diminfo[0].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_child_mask.diminfo[1].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_child_mask.diminfo[1].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_child_mask.diminfo[2].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_child_mask.diminfo[2].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1442, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1432, __pyx_L1_error) } __pyx_t_10 = 0; __pyx_v_child_mask = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/selection_routines.pyx":1443 + /* "yt/geometry/selection_routines.pyx":1433 * dt = np.zeros(gobj.ActiveDimensions, dtype="float64") - 1 * child_mask = gobj.child_mask * ia.t = t.data # <<<<<<<<<<<<<< * ia.dt = dt.data * ia.child_mask = child_mask.data */ - __pyx_v_ia.t = ((__pyx_t_5numpy_float64_t *)__pyx_v_t->data); + __pyx_v_ia->t = ((__pyx_t_5numpy_float64_t *)__pyx_v_t->data); - /* "yt/geometry/selection_routines.pyx":1444 + /* "yt/geometry/selection_routines.pyx":1434 * child_mask = gobj.child_mask * ia.t = t.data * ia.dt = dt.data # <<<<<<<<<<<<<< * ia.child_mask = child_mask.data * ia.hits = 0 */ - __pyx_v_ia.dt = ((__pyx_t_5numpy_float64_t *)__pyx_v_dt->data); + __pyx_v_ia->dt = ((__pyx_t_5numpy_float64_t *)__pyx_v_dt->data); - /* "yt/geometry/selection_routines.pyx":1445 + /* "yt/geometry/selection_routines.pyx":1435 * ia.t = t.data * ia.dt = dt.data * ia.child_mask = child_mask.data # <<<<<<<<<<<<<< * ia.hits = 0 * _ensure_code(gobj.LeftEdge) */ - __pyx_v_ia.child_mask = ((__pyx_t_5numpy_uint8_t *)__pyx_v_child_mask->data); + __pyx_v_ia->child_mask = ((__pyx_t_5numpy_uint8_t *)__pyx_v_child_mask->data); - /* "yt/geometry/selection_routines.pyx":1446 + /* "yt/geometry/selection_routines.pyx":1436 * ia.dt = dt.data * ia.child_mask = child_mask.data * ia.hits = 0 # <<<<<<<<<<<<<< * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.RightEdge) */ - __pyx_v_ia.hits = 0; + __pyx_v_ia->hits = 0; - /* "yt/geometry/selection_routines.pyx":1447 + /* "yt/geometry/selection_routines.pyx":1437 * ia.child_mask = child_mask.data * ia.hits = 0 * _ensure_code(gobj.LeftEdge) # <<<<<<<<<<<<<< * _ensure_code(gobj.RightEdge) * _ensure_code(gobj.dds) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1447, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1448 + /* "yt/geometry/selection_routines.pyx":1438 * ia.hits = 0 * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.RightEdge) # <<<<<<<<<<<<<< * _ensure_code(gobj.dds) * for i in range(3): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1448, __pyx_L1_error) + __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/selection_routines.pyx":1449 + /* "yt/geometry/selection_routines.pyx":1439 * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.RightEdge) * _ensure_code(gobj.dds) # <<<<<<<<<<<<<< * for i in range(3): * vc.left_edge[i] = gobj.LeftEdge[i] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1450 + /* "yt/geometry/selection_routines.pyx":1440 * _ensure_code(gobj.RightEdge) * _ensure_code(gobj.dds) * for i in range(3): # <<<<<<<<<<<<<< @@ -23604,95 +25473,95 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":1451 + /* "yt/geometry/selection_routines.pyx":1441 * _ensure_code(gobj.dds) * for i in range(3): * vc.left_edge[i] = gobj.LeftEdge[i] # <<<<<<<<<<<<<< * vc.right_edge[i] = gobj.RightEdge[i] * vc.dds[i] = gobj.dds[i] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1451, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1451, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_vc.left_edge[__pyx_v_i]) = __pyx_t_11; - /* "yt/geometry/selection_routines.pyx":1452 + /* "yt/geometry/selection_routines.pyx":1442 * for i in range(3): * vc.left_edge[i] = gobj.LeftEdge[i] * vc.right_edge[i] = gobj.RightEdge[i] # <<<<<<<<<<<<<< * vc.dds[i] = gobj.dds[i] * vc.idds[i] = 1.0/gobj.dds[i] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1452, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1452, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1442, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_vc.right_edge[__pyx_v_i]) = __pyx_t_11; - /* "yt/geometry/selection_routines.pyx":1453 + /* "yt/geometry/selection_routines.pyx":1443 * vc.left_edge[i] = gobj.LeftEdge[i] * vc.right_edge[i] = gobj.RightEdge[i] * vc.dds[i] = gobj.dds[i] # <<<<<<<<<<<<<< * vc.idds[i] = 1.0/gobj.dds[i] * vc.dims[i] = dt.shape[i] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1453, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_vc.dds[__pyx_v_i]) = __pyx_t_11; - /* "yt/geometry/selection_routines.pyx":1454 + /* "yt/geometry/selection_routines.pyx":1444 * vc.right_edge[i] = gobj.RightEdge[i] * vc.dds[i] = gobj.dds[i] * vc.idds[i] = 1.0/gobj.dds[i] # <<<<<<<<<<<<<< * vc.dims[i] = dt.shape[i] - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1454, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1454, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyFloat_DivideCObj(__pyx_float_1_0, __pyx_t_1, 1.0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1454, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFloat_DivideCObj(__pyx_float_1_0, __pyx_t_1, 1.0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1454, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_vc.idds[__pyx_v_i]) = __pyx_t_11; - /* "yt/geometry/selection_routines.pyx":1455 + /* "yt/geometry/selection_routines.pyx":1445 * vc.dds[i] = gobj.dds[i] * vc.idds[i] = 1.0/gobj.dds[i] * vc.dims[i] = dt.shape[i] # <<<<<<<<<<<<<< - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) * for i in range(dt.shape[0]): */ (__pyx_v_vc.dims[__pyx_v_i]) = (__pyx_v_dt->dimensions[__pyx_v_i]); } - /* "yt/geometry/selection_routines.pyx":1456 + /* "yt/geometry/selection_routines.pyx":1446 * vc.idds[i] = 1.0/gobj.dds[i] * vc.dims[i] = dt.shape[i] - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) # <<<<<<<<<<<<<< + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) # <<<<<<<<<<<<<< * for i in range(dt.shape[0]): * for j in range(dt.shape[1]): */ - __pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume((&__pyx_v_vc), __pyx_v_self->p1, __pyx_v_self->vec, __pyx_f_2yt_8geometry_18selection_routines_dt_sampler, ((void *)(&__pyx_v_ia)), NULL); + __pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume((&__pyx_v_vc), __pyx_v_self->p1, __pyx_v_self->vec, __pyx_f_2yt_8geometry_18selection_routines_dt_sampler, ((void *)__pyx_v_ia), NULL); - /* "yt/geometry/selection_routines.pyx":1457 + /* "yt/geometry/selection_routines.pyx":1447 * vc.dims[i] = dt.shape[i] - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) * for i in range(dt.shape[0]): # <<<<<<<<<<<<<< * for j in range(dt.shape[1]): * for k in range(dt.shape[2]): @@ -23701,8 +25570,8 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_12; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":1458 - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + /* "yt/geometry/selection_routines.pyx":1448 + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) * for i in range(dt.shape[0]): * for j in range(dt.shape[1]): # <<<<<<<<<<<<<< * for k in range(dt.shape[2]): @@ -23712,7 +25581,7 @@ for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "yt/geometry/selection_routines.pyx":1459 + /* "yt/geometry/selection_routines.pyx":1449 * for i in range(dt.shape[0]): * for j in range(dt.shape[1]): * for k in range(dt.shape[2]): # <<<<<<<<<<<<<< @@ -23723,7 +25592,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_k = __pyx_t_16; - /* "yt/geometry/selection_routines.pyx":1460 + /* "yt/geometry/selection_routines.pyx":1450 * for j in range(dt.shape[1]): * for k in range(dt.shape[2]): * if dt[i, j, k] >= 0: # <<<<<<<<<<<<<< @@ -23736,20 +25605,20 @@ __pyx_t_20 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dt.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_dt.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_dt.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_dt.diminfo[2].strides)) >= 0.0) != 0); if (__pyx_t_20) { - /* "yt/geometry/selection_routines.pyx":1461 + /* "yt/geometry/selection_routines.pyx":1451 * for k in range(dt.shape[2]): * if dt[i, j, k] >= 0: * mask[i, j, k] = 1 # <<<<<<<<<<<<<< * total += 1 - * if total == 0: return None + * free(ia) */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1461, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1461, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1461, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -23760,19 +25629,19 @@ __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_mask, __pyx_t_4, __pyx_int_1) < 0)) __PYX_ERR(0, 1461, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_mask, __pyx_t_4, __pyx_int_1) < 0)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":1462 + /* "yt/geometry/selection_routines.pyx":1452 * if dt[i, j, k] >= 0: * mask[i, j, k] = 1 * total += 1 # <<<<<<<<<<<<<< + * free(ia) * if total == 0: return None - * return mask.astype("bool") */ __pyx_v_total = (__pyx_v_total + 1); - /* "yt/geometry/selection_routines.pyx":1460 + /* "yt/geometry/selection_routines.pyx":1450 * for j in range(dt.shape[1]): * for k in range(dt.shape[2]): * if dt[i, j, k] >= 0: # <<<<<<<<<<<<<< @@ -23784,9 +25653,18 @@ } } - /* "yt/geometry/selection_routines.pyx":1463 + /* "yt/geometry/selection_routines.pyx":1453 * mask[i, j, k] = 1 * total += 1 + * free(ia) # <<<<<<<<<<<<<< + * if total == 0: return None + * return mask.astype("bool") + */ + free(__pyx_v_ia); + + /* "yt/geometry/selection_routines.pyx":1454 + * total += 1 + * free(ia) * if total == 0: return None # <<<<<<<<<<<<<< * return mask.astype("bool") * @@ -23799,24 +25677,24 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":1464 - * total += 1 + /* "yt/geometry/selection_routines.pyx":1455 + * free(ia) * if total == 0: return None * return mask.astype("bool") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1464, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1464, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1432 + /* "yt/geometry/selection_routines.pyx":1421 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mask(self, gobj): # <<<<<<<<<<<<<< @@ -23855,7 +25733,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1469 +/* "yt/geometry/selection_routines.pyx":1460 * @cython.wraparound(False) * @cython.cdivision(True) * def get_dt(self, gobj): # <<<<<<<<<<<<<< @@ -23886,7 +25764,7 @@ int __pyx_v_j; int __pyx_v_k; int __pyx_v_ni; - struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator __pyx_v_ia; + struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator *__pyx_v_ia; struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer __pyx_v_vc; __Pyx_LocalBuf_ND __pyx_pybuffernd_child_mask; __Pyx_Buffer __pyx_pybuffer_child_mask; @@ -23951,34 +25829,43 @@ __pyx_pybuffernd_child_mask.data = NULL; __pyx_pybuffernd_child_mask.rcbuffer = &__pyx_pybuffer_child_mask; - /* "yt/geometry/selection_routines.pyx":1476 - * cdef IntegrationAccumulator ia + /* "yt/geometry/selection_routines.pyx":1466 + * cdef int i, j, k, ni + * cdef IntegrationAccumulator *ia + * ia = malloc(sizeof(IntegrationAccumulator)) # <<<<<<<<<<<<<< + * cdef VolumeContainer vc + * t = np.zeros(gobj.ActiveDimensions, dtype="float64") + */ + __pyx_v_ia = ((struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator *)malloc((sizeof(struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator)))); + + /* "yt/geometry/selection_routines.pyx":1468 + * ia = malloc(sizeof(IntegrationAccumulator)) * cdef VolumeContainer vc * t = np.zeros(gobj.ActiveDimensions, dtype="float64") # <<<<<<<<<<<<<< * dt = np.zeros(gobj.ActiveDimensions, dtype="float64") - 1 * child_mask = gobj.child_mask */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __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, 1476, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1476, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1468, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1476, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1476, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1468, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1468, __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_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, 1476, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1468, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -23994,43 +25881,43 @@ } } __pyx_pybuffernd_t.diminfo[0].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t.diminfo[0].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_t.diminfo[1].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_t.diminfo[1].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_t.diminfo[2].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_t.diminfo[2].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1476, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1468, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_t = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":1477 + /* "yt/geometry/selection_routines.pyx":1469 * cdef VolumeContainer vc * t = np.zeros(gobj.ActiveDimensions, dtype="float64") * dt = np.zeros(gobj.ActiveDimensions, dtype="float64") - 1 # <<<<<<<<<<<<<< * child_mask = gobj.child_mask * ia.t = t.data */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1477, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1477, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1469, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1477, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1469, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -24046,22 +25933,22 @@ } } __pyx_pybuffernd_dt.diminfo[0].strides = __pyx_pybuffernd_dt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dt.diminfo[0].shape = __pyx_pybuffernd_dt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dt.diminfo[1].strides = __pyx_pybuffernd_dt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dt.diminfo[1].shape = __pyx_pybuffernd_dt.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dt.diminfo[2].strides = __pyx_pybuffernd_dt.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dt.diminfo[2].shape = __pyx_pybuffernd_dt.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1477, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1469, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_dt = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":1478 + /* "yt/geometry/selection_routines.pyx":1470 * t = np.zeros(gobj.ActiveDimensions, dtype="float64") * dt = np.zeros(gobj.ActiveDimensions, dtype="float64") - 1 * child_mask = gobj.child_mask # <<<<<<<<<<<<<< * ia.t = t.data * ia.dt = dt.data */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_child_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1478, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_child_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1478, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1470, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -24077,91 +25964,91 @@ } } __pyx_pybuffernd_child_mask.diminfo[0].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_mask.diminfo[0].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_child_mask.diminfo[1].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_child_mask.diminfo[1].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_child_mask.diminfo[2].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_child_mask.diminfo[2].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1478, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1470, __pyx_L1_error) } __pyx_t_10 = 0; __pyx_v_child_mask = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":1479 + /* "yt/geometry/selection_routines.pyx":1471 * dt = np.zeros(gobj.ActiveDimensions, dtype="float64") - 1 * child_mask = gobj.child_mask * ia.t = t.data # <<<<<<<<<<<<<< * ia.dt = dt.data * ia.child_mask = child_mask.data */ - __pyx_v_ia.t = ((__pyx_t_5numpy_float64_t *)__pyx_v_t->data); + __pyx_v_ia->t = ((__pyx_t_5numpy_float64_t *)__pyx_v_t->data); - /* "yt/geometry/selection_routines.pyx":1480 + /* "yt/geometry/selection_routines.pyx":1472 * child_mask = gobj.child_mask * ia.t = t.data * ia.dt = dt.data # <<<<<<<<<<<<<< * ia.child_mask = child_mask.data * ia.hits = 0 */ - __pyx_v_ia.dt = ((__pyx_t_5numpy_float64_t *)__pyx_v_dt->data); + __pyx_v_ia->dt = ((__pyx_t_5numpy_float64_t *)__pyx_v_dt->data); - /* "yt/geometry/selection_routines.pyx":1481 + /* "yt/geometry/selection_routines.pyx":1473 * ia.t = t.data * ia.dt = dt.data * ia.child_mask = child_mask.data # <<<<<<<<<<<<<< * ia.hits = 0 * _ensure_code(gobj.LeftEdge) */ - __pyx_v_ia.child_mask = ((__pyx_t_5numpy_uint8_t *)__pyx_v_child_mask->data); + __pyx_v_ia->child_mask = ((__pyx_t_5numpy_uint8_t *)__pyx_v_child_mask->data); - /* "yt/geometry/selection_routines.pyx":1482 + /* "yt/geometry/selection_routines.pyx":1474 * ia.dt = dt.data * ia.child_mask = child_mask.data * ia.hits = 0 # <<<<<<<<<<<<<< * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.RightEdge) */ - __pyx_v_ia.hits = 0; + __pyx_v_ia->hits = 0; - /* "yt/geometry/selection_routines.pyx":1483 + /* "yt/geometry/selection_routines.pyx":1475 * ia.child_mask = child_mask.data * ia.hits = 0 * _ensure_code(gobj.LeftEdge) # <<<<<<<<<<<<<< * _ensure_code(gobj.RightEdge) * _ensure_code(gobj.dds) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1483, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1483, __pyx_L1_error) + __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1475, __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; - /* "yt/geometry/selection_routines.pyx":1484 + /* "yt/geometry/selection_routines.pyx":1476 * ia.hits = 0 * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.RightEdge) # <<<<<<<<<<<<<< * _ensure_code(gobj.dds) * for i in range(3): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1484, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1476, __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; - /* "yt/geometry/selection_routines.pyx":1485 + /* "yt/geometry/selection_routines.pyx":1477 * _ensure_code(gobj.LeftEdge) * _ensure_code(gobj.RightEdge) * _ensure_code(gobj.dds) # <<<<<<<<<<<<<< * for i in range(3): * vc.left_edge[i] = gobj.LeftEdge[i] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1485, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1485, __pyx_L1_error) + __pyx_t_2 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __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; - /* "yt/geometry/selection_routines.pyx":1486 + /* "yt/geometry/selection_routines.pyx":1478 * _ensure_code(gobj.RightEdge) * _ensure_code(gobj.dds) * for i in range(3): # <<<<<<<<<<<<<< @@ -24171,120 +26058,120 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":1487 + /* "yt/geometry/selection_routines.pyx":1479 * _ensure_code(gobj.dds) * for i in range(3): * vc.left_edge[i] = gobj.LeftEdge[i] # <<<<<<<<<<<<<< * vc.right_edge[i] = gobj.RightEdge[i] * vc.dds[i] = gobj.dds[i] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1487, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_LeftEdge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1487, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1487, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_vc.left_edge[__pyx_v_i]) = __pyx_t_11; - /* "yt/geometry/selection_routines.pyx":1488 + /* "yt/geometry/selection_routines.pyx":1480 * for i in range(3): * vc.left_edge[i] = gobj.LeftEdge[i] * vc.right_edge[i] = gobj.RightEdge[i] # <<<<<<<<<<<<<< * vc.dds[i] = gobj.dds[i] * vc.idds[i] = 1.0/gobj.dds[i] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1488, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_RightEdge); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1488, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1488, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_vc.right_edge[__pyx_v_i]) = __pyx_t_11; - /* "yt/geometry/selection_routines.pyx":1489 + /* "yt/geometry/selection_routines.pyx":1481 * vc.left_edge[i] = gobj.LeftEdge[i] * vc.right_edge[i] = gobj.RightEdge[i] * vc.dds[i] = gobj.dds[i] # <<<<<<<<<<<<<< * vc.idds[i] = 1.0/gobj.dds[i] * vc.dims[i] = dt.shape[i] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1489, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1489, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_vc.dds[__pyx_v_i]) = __pyx_t_11; - /* "yt/geometry/selection_routines.pyx":1490 + /* "yt/geometry/selection_routines.pyx":1482 * vc.right_edge[i] = gobj.RightEdge[i] * vc.dds[i] = gobj.dds[i] * vc.idds[i] = 1.0/gobj.dds[i] # <<<<<<<<<<<<<< * vc.dims[i] = dt.shape[i] - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_dds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyFloat_DivideCObj(__pyx_float_1_0, __pyx_t_2, 1.0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFloat_DivideCObj(__pyx_float_1_0, __pyx_t_2, 1.0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1490, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1482, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_vc.idds[__pyx_v_i]) = __pyx_t_11; - /* "yt/geometry/selection_routines.pyx":1491 + /* "yt/geometry/selection_routines.pyx":1483 * vc.dds[i] = gobj.dds[i] * vc.idds[i] = 1.0/gobj.dds[i] * vc.dims[i] = dt.shape[i] # <<<<<<<<<<<<<< - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) * tr = np.zeros(ia.hits, dtype="float64") */ (__pyx_v_vc.dims[__pyx_v_i]) = (__pyx_v_dt->dimensions[__pyx_v_i]); } - /* "yt/geometry/selection_routines.pyx":1492 + /* "yt/geometry/selection_routines.pyx":1484 * vc.idds[i] = 1.0/gobj.dds[i] * vc.dims[i] = dt.shape[i] - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) # <<<<<<<<<<<<<< + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) # <<<<<<<<<<<<<< * tr = np.zeros(ia.hits, dtype="float64") * dtr = np.zeros(ia.hits, dtype="float64") */ - __pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume((&__pyx_v_vc), __pyx_v_self->p1, __pyx_v_self->vec, __pyx_f_2yt_8geometry_18selection_routines_dt_sampler, ((void *)(&__pyx_v_ia)), NULL); + __pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume((&__pyx_v_vc), __pyx_v_self->p1, __pyx_v_self->vec, __pyx_f_2yt_8geometry_18selection_routines_dt_sampler, ((void *)__pyx_v_ia), NULL); - /* "yt/geometry/selection_routines.pyx":1493 + /* "yt/geometry/selection_routines.pyx":1485 * vc.dims[i] = dt.shape[i] - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) * tr = np.zeros(ia.hits, dtype="float64") # <<<<<<<<<<<<<< * dtr = np.zeros(ia.hits, dtype="float64") * ni = 0 */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1493, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1493, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ia.hits); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1493, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ia->hits); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1493, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1493, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1493, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1485, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1493, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1485, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -24300,40 +26187,40 @@ } } __pyx_pybuffernd_tr.diminfo[0].strides = __pyx_pybuffernd_tr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tr.diminfo[0].shape = __pyx_pybuffernd_tr.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1493, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1485, __pyx_L1_error) } __pyx_t_12 = 0; __pyx_v_tr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1494 - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + /* "yt/geometry/selection_routines.pyx":1486 + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) * tr = np.zeros(ia.hits, dtype="float64") * dtr = np.zeros(ia.hits, dtype="float64") # <<<<<<<<<<<<<< * ni = 0 * for i in range(dt.shape[0]): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1494, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ia.hits); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ia->hits); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1494, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1486, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1494, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1494, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1486, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1494, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1486, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -24349,13 +26236,13 @@ } } __pyx_pybuffernd_dtr.diminfo[0].strides = __pyx_pybuffernd_dtr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtr.diminfo[0].shape = __pyx_pybuffernd_dtr.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1494, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1486, __pyx_L1_error) } __pyx_t_12 = 0; __pyx_v_dtr = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/selection_routines.pyx":1495 + /* "yt/geometry/selection_routines.pyx":1487 * tr = np.zeros(ia.hits, dtype="float64") * dtr = np.zeros(ia.hits, dtype="float64") * ni = 0 # <<<<<<<<<<<<<< @@ -24364,7 +26251,7 @@ */ __pyx_v_ni = 0; - /* "yt/geometry/selection_routines.pyx":1496 + /* "yt/geometry/selection_routines.pyx":1488 * dtr = np.zeros(ia.hits, dtype="float64") * ni = 0 * for i in range(dt.shape[0]): # <<<<<<<<<<<<<< @@ -24375,7 +26262,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_13; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":1497 + /* "yt/geometry/selection_routines.pyx":1489 * ni = 0 * for i in range(dt.shape[0]): * for j in range(dt.shape[1]): # <<<<<<<<<<<<<< @@ -24386,7 +26273,7 @@ for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { __pyx_v_j = __pyx_t_15; - /* "yt/geometry/selection_routines.pyx":1498 + /* "yt/geometry/selection_routines.pyx":1490 * for i in range(dt.shape[0]): * for j in range(dt.shape[1]): * for k in range(dt.shape[2]): # <<<<<<<<<<<<<< @@ -24397,7 +26284,7 @@ for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_k = __pyx_t_17; - /* "yt/geometry/selection_routines.pyx":1499 + /* "yt/geometry/selection_routines.pyx":1491 * for j in range(dt.shape[1]): * for k in range(dt.shape[2]): * if dt[i, j, k] >= 0: # <<<<<<<<<<<<<< @@ -24410,7 +26297,7 @@ __pyx_t_21 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dt.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dt.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_dt.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_dt.diminfo[2].strides)) >= 0.0) != 0); if (__pyx_t_21) { - /* "yt/geometry/selection_routines.pyx":1500 + /* "yt/geometry/selection_routines.pyx":1492 * for k in range(dt.shape[2]): * if dt[i, j, k] >= 0: * tr[ni] = t[i, j, k] # <<<<<<<<<<<<<< @@ -24423,7 +26310,7 @@ __pyx_t_25 = __pyx_v_ni; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_tr.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_t.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_t.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_t.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_t.diminfo[2].strides)); - /* "yt/geometry/selection_routines.pyx":1501 + /* "yt/geometry/selection_routines.pyx":1493 * if dt[i, j, k] >= 0: * tr[ni] = t[i, j, k] * dtr[ni] = dt[i, j, k] # <<<<<<<<<<<<<< @@ -24436,7 +26323,7 @@ __pyx_t_29 = __pyx_v_ni; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dtr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_dtr.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dt.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_dt.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_dt.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_dt.diminfo[2].strides)); - /* "yt/geometry/selection_routines.pyx":1502 + /* "yt/geometry/selection_routines.pyx":1494 * tr[ni] = t[i, j, k] * dtr[ni] = dt[i, j, k] * ni += 1 # <<<<<<<<<<<<<< @@ -24445,7 +26332,7 @@ */ __pyx_v_ni = (__pyx_v_ni + 1); - /* "yt/geometry/selection_routines.pyx":1499 + /* "yt/geometry/selection_routines.pyx":1491 * for j in range(dt.shape[1]): * for k in range(dt.shape[2]): * if dt[i, j, k] >= 0: # <<<<<<<<<<<<<< @@ -24457,28 +26344,28 @@ } } - /* "yt/geometry/selection_routines.pyx":1503 + /* "yt/geometry/selection_routines.pyx":1495 * dtr[ni] = dt[i, j, k] * ni += 1 * if not (ni == ia.hits): # <<<<<<<<<<<<<< * print ni, ia.hits - * return dtr, tr + * free(ia) */ - __pyx_t_21 = ((!((__pyx_v_ni == __pyx_v_ia.hits) != 0)) != 0); + __pyx_t_21 = ((!((__pyx_v_ni == __pyx_v_ia->hits) != 0)) != 0); if (__pyx_t_21) { - /* "yt/geometry/selection_routines.pyx":1504 + /* "yt/geometry/selection_routines.pyx":1496 * ni += 1 * if not (ni == ia.hits): * print ni, ia.hits # <<<<<<<<<<<<<< + * free(ia) * return dtr, tr - * */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ni); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ni); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ia.hits); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1504, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ia->hits); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); @@ -24486,27 +26373,36 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; - if (__Pyx_Print(0, __pyx_t_3, 1) < 0) __PYX_ERR(0, 1504, __pyx_L1_error) + if (__Pyx_Print(0, __pyx_t_3, 1) < 0) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":1503 + /* "yt/geometry/selection_routines.pyx":1495 * dtr[ni] = dt[i, j, k] * ni += 1 * if not (ni == ia.hits): # <<<<<<<<<<<<<< * print ni, ia.hits - * return dtr, tr + * free(ia) */ } - /* "yt/geometry/selection_routines.pyx":1505 + /* "yt/geometry/selection_routines.pyx":1497 * if not (ni == ia.hits): * print ni, ia.hits + * free(ia) # <<<<<<<<<<<<<< + * return dtr, tr + * + */ + free(__pyx_v_ia); + + /* "yt/geometry/selection_routines.pyx":1498 + * print ni, ia.hits + * free(ia) * return dtr, tr # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1505, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_dtr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_dtr)); @@ -24518,7 +26414,7 @@ __pyx_t_3 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1469 + /* "yt/geometry/selection_routines.pyx":1460 * @cython.wraparound(False) * @cython.cdivision(True) * def get_dt(self, gobj): # <<<<<<<<<<<<<< @@ -24562,7 +26458,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1510 +/* "yt/geometry/selection_routines.pyx":1503 * @cython.wraparound(False) * @cython.cdivision(True) * def get_dt_mesh(self, mesh, nz, int offset): # <<<<<<<<<<<<<< @@ -24587,8 +26483,11 @@ 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; } @@ -24597,19 +26496,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mesh)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nz)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_dt_mesh", 1, 3, 3, 1); __PYX_ERR(0, 1510, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_dt_mesh", 1, 3, 3, 1); __PYX_ERR(0, 1503, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_dt_mesh", 1, 3, 3, 2); __PYX_ERR(0, 1510, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_dt_mesh", 1, 3, 3, 2); __PYX_ERR(0, 1503, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_dt_mesh") < 0)) __PYX_ERR(0, 1510, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_dt_mesh") < 0)) __PYX_ERR(0, 1503, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -24620,11 +26521,11 @@ } __pyx_v_mesh = values[0]; __pyx_v_nz = values[1]; - __pyx_v_offset = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1510, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1503, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_dt_mesh", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1510, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_dt_mesh", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1503, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.RaySelector.get_dt_mesh", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -24650,7 +26551,7 @@ __pyx_t_5numpy_float64_t __pyx_v_LE[3]; __pyx_t_5numpy_float64_t __pyx_v_RE[3]; __pyx_t_5numpy_float64_t __pyx_v_pos; - struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator __pyx_v_ia; + struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator *__pyx_v_ia; PyArrayObject *__pyx_v_coords = 0; PyArrayObject *__pyx_v_indices = 0; int __pyx_v_nc; @@ -24741,16 +26642,25 @@ __pyx_pybuffernd_indices.data = NULL; __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; - /* "yt/geometry/selection_routines.pyx":1521 + /* "yt/geometry/selection_routines.pyx":1512 + * cdef np.float64_t pos + * cdef IntegrationAccumulator *ia + * ia = malloc(sizeof(IntegrationAccumulator)) # <<<<<<<<<<<<<< + * cdef np.ndarray[np.float64_t, ndim=2] coords + * cdef np.ndarray[np.int64_t, ndim=2] indices + */ + __pyx_v_ia = ((struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator *)malloc((sizeof(struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator)))); + + /* "yt/geometry/selection_routines.pyx":1515 * cdef np.ndarray[np.float64_t, ndim=2] coords * cdef np.ndarray[np.int64_t, ndim=2] indices * indices = mesh.connectivity_indices # <<<<<<<<<<<<<< * coords = _ensure_code(mesh.connectivity_coords) * cdef int nc = indices.shape[0] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1521, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1515, __pyx_L1_error) __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -24766,25 +26676,25 @@ } } __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indices.diminfo[1].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indices.diminfo[1].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1521, __pyx_L1_error) + if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1515, __pyx_L1_error) } __pyx_t_2 = 0; __pyx_v_indices = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1522 + /* "yt/geometry/selection_routines.pyx":1516 * cdef np.ndarray[np.int64_t, ndim=2] indices * indices = mesh.connectivity_indices * coords = _ensure_code(mesh.connectivity_coords) # <<<<<<<<<<<<<< * cdef int nc = indices.shape[0] * cdef int nv = indices.shape[1] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_coords); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1522, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_connectivity_coords); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1522, __pyx_L1_error) + __pyx_t_7 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1522, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1516, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -24800,13 +26710,13 @@ } } __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1522, __pyx_L1_error) + if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1516, __pyx_L1_error) } __pyx_t_8 = 0; __pyx_v_coords = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/selection_routines.pyx":1523 + /* "yt/geometry/selection_routines.pyx":1517 * indices = mesh.connectivity_indices * coords = _ensure_code(mesh.connectivity_coords) * cdef int nc = indices.shape[0] # <<<<<<<<<<<<<< @@ -24815,7 +26725,7 @@ */ __pyx_v_nc = (__pyx_v_indices->dimensions[0]); - /* "yt/geometry/selection_routines.pyx":1524 + /* "yt/geometry/selection_routines.pyx":1518 * coords = _ensure_code(mesh.connectivity_coords) * cdef int nc = indices.shape[0] * cdef int nv = indices.shape[1] # <<<<<<<<<<<<<< @@ -24824,7 +26734,7 @@ */ __pyx_v_nv = (__pyx_v_indices->dimensions[1]); - /* "yt/geometry/selection_routines.pyx":1525 + /* "yt/geometry/selection_routines.pyx":1519 * cdef int nc = indices.shape[0] * cdef int nv = indices.shape[1] * if nv != 8: # <<<<<<<<<<<<<< @@ -24834,7 +26744,7 @@ __pyx_t_9 = ((__pyx_v_nv != 8) != 0); if (__pyx_t_9) { - /* "yt/geometry/selection_routines.pyx":1526 + /* "yt/geometry/selection_routines.pyx":1520 * cdef int nv = indices.shape[1] * if nv != 8: * raise NotImplementedError # <<<<<<<<<<<<<< @@ -24842,9 +26752,9 @@ * child_mask = np.ones((1,1,1), dtype="uint8") */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 1526, __pyx_L1_error) + __PYX_ERR(0, 1520, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1525 + /* "yt/geometry/selection_routines.pyx":1519 * cdef int nc = indices.shape[0] * cdef int nv = indices.shape[1] * if nv != 8: # <<<<<<<<<<<<<< @@ -24853,26 +26763,26 @@ */ } - /* "yt/geometry/selection_routines.pyx":1528 + /* "yt/geometry/selection_routines.pyx":1522 * raise NotImplementedError * cdef VolumeContainer vc * child_mask = np.ones((1,1,1), dtype="uint8") # <<<<<<<<<<<<<< * t = np.zeros((1,1,1), dtype="float64") * dt = np.zeros((1,1,1), dtype="float64") - 1 */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1528, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ones); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1528, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ones); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1528, __pyx_L1_error) + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 1528, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__24, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 1522, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__44, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1528, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1522, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -24888,32 +26798,32 @@ } } __pyx_pybuffernd_child_mask.diminfo[0].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_mask.diminfo[0].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_child_mask.diminfo[1].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_child_mask.diminfo[1].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_child_mask.diminfo[2].strides = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_child_mask.diminfo[2].shape = __pyx_pybuffernd_child_mask.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1528, __pyx_L1_error) + if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1522, __pyx_L1_error) } __pyx_t_11 = 0; __pyx_v_child_mask = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; - /* "yt/geometry/selection_routines.pyx":1529 + /* "yt/geometry/selection_routines.pyx":1523 * cdef VolumeContainer vc * child_mask = np.ones((1,1,1), dtype="uint8") * t = np.zeros((1,1,1), dtype="float64") # <<<<<<<<<<<<<< * dt = np.zeros((1,1,1), dtype="float64") - 1 * tr = np.zeros(nz, dtype="float64") */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1529, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1529, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1529, __pyx_L1_error) + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1529, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__26, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1529, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1523, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__46, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1529, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1523, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -24929,35 +26839,35 @@ } } __pyx_pybuffernd_t.diminfo[0].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t.diminfo[0].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_t.diminfo[1].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_t.diminfo[1].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_t.diminfo[2].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_t.diminfo[2].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1529, __pyx_L1_error) + if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1523, __pyx_L1_error) } __pyx_t_12 = 0; __pyx_v_t = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1530 + /* "yt/geometry/selection_routines.pyx":1524 * child_mask = np.ones((1,1,1), dtype="uint8") * t = np.zeros((1,1,1), dtype="float64") * dt = np.zeros((1,1,1), dtype="float64") - 1 # <<<<<<<<<<<<<< * tr = np.zeros(nz, dtype="float64") * dtr = np.zeros(nz, dtype="float64") */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1530, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1530, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1530, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1530, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__28, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1530, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1524, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__48, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1530, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1530, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1524, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -24973,38 +26883,38 @@ } } __pyx_pybuffernd_dt.diminfo[0].strides = __pyx_pybuffernd_dt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dt.diminfo[0].shape = __pyx_pybuffernd_dt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dt.diminfo[1].strides = __pyx_pybuffernd_dt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dt.diminfo[1].shape = __pyx_pybuffernd_dt.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dt.diminfo[2].strides = __pyx_pybuffernd_dt.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dt.diminfo[2].shape = __pyx_pybuffernd_dt.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1530, __pyx_L1_error) + if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1524, __pyx_L1_error) } __pyx_t_12 = 0; __pyx_v_dt = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1531 + /* "yt/geometry/selection_routines.pyx":1525 * t = np.zeros((1,1,1), dtype="float64") * dt = np.zeros((1,1,1), dtype="float64") - 1 * tr = np.zeros(nz, dtype="float64") # <<<<<<<<<<<<<< * dtr = np.zeros(nz, dtype="float64") * ia.t = t.data */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1531, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_nz); __Pyx_GIVEREF(__pyx_v_nz); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_nz); - __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1531, __pyx_L1_error) + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1531, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1531, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1525, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1531, __pyx_L1_error) + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1525, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -25020,38 +26930,38 @@ } } __pyx_pybuffernd_tr.diminfo[0].strides = __pyx_pybuffernd_tr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tr.diminfo[0].shape = __pyx_pybuffernd_tr.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1531, __pyx_L1_error) + if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1525, __pyx_L1_error) } __pyx_t_14 = 0; __pyx_v_tr = ((PyArrayObject *)__pyx_t_13); __pyx_t_13 = 0; - /* "yt/geometry/selection_routines.pyx":1532 + /* "yt/geometry/selection_routines.pyx":1526 * dt = np.zeros((1,1,1), dtype="float64") - 1 * tr = np.zeros(nz, dtype="float64") * dtr = np.zeros(nz, dtype="float64") # <<<<<<<<<<<<<< * ia.t = t.data * ia.dt = dt.data */ - __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1532, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1532, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1532, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_nz); __Pyx_GIVEREF(__pyx_v_nz); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_nz); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1532, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1532, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1532, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 1526, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1532, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1526, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -25067,49 +26977,49 @@ } } __pyx_pybuffernd_dtr.diminfo[0].strides = __pyx_pybuffernd_dtr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtr.diminfo[0].shape = __pyx_pybuffernd_dtr.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1532, __pyx_L1_error) + if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1526, __pyx_L1_error) } __pyx_t_14 = 0; __pyx_v_dtr = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/selection_routines.pyx":1533 + /* "yt/geometry/selection_routines.pyx":1527 * tr = np.zeros(nz, dtype="float64") * dtr = np.zeros(nz, dtype="float64") * ia.t = t.data # <<<<<<<<<<<<<< * ia.dt = dt.data * ia.child_mask = child_mask.data */ - __pyx_v_ia.t = ((__pyx_t_5numpy_float64_t *)__pyx_v_t->data); + __pyx_v_ia->t = ((__pyx_t_5numpy_float64_t *)__pyx_v_t->data); - /* "yt/geometry/selection_routines.pyx":1534 + /* "yt/geometry/selection_routines.pyx":1528 * dtr = np.zeros(nz, dtype="float64") * ia.t = t.data * ia.dt = dt.data # <<<<<<<<<<<<<< * ia.child_mask = child_mask.data * ia.hits = 0 */ - __pyx_v_ia.dt = ((__pyx_t_5numpy_float64_t *)__pyx_v_dt->data); + __pyx_v_ia->dt = ((__pyx_t_5numpy_float64_t *)__pyx_v_dt->data); - /* "yt/geometry/selection_routines.pyx":1535 + /* "yt/geometry/selection_routines.pyx":1529 * ia.t = t.data * ia.dt = dt.data * ia.child_mask = child_mask.data # <<<<<<<<<<<<<< * ia.hits = 0 * ni = 0 */ - __pyx_v_ia.child_mask = ((__pyx_t_5numpy_uint8_t *)__pyx_v_child_mask->data); + __pyx_v_ia->child_mask = ((__pyx_t_5numpy_uint8_t *)__pyx_v_child_mask->data); - /* "yt/geometry/selection_routines.pyx":1536 + /* "yt/geometry/selection_routines.pyx":1530 * ia.dt = dt.data * ia.child_mask = child_mask.data * ia.hits = 0 # <<<<<<<<<<<<<< * ni = 0 * for i in range(nc): */ - __pyx_v_ia.hits = 0; + __pyx_v_ia->hits = 0; - /* "yt/geometry/selection_routines.pyx":1537 + /* "yt/geometry/selection_routines.pyx":1531 * ia.child_mask = child_mask.data * ia.hits = 0 * ni = 0 # <<<<<<<<<<<<<< @@ -25118,7 +27028,7 @@ */ __pyx_v_ni = 0; - /* "yt/geometry/selection_routines.pyx":1538 + /* "yt/geometry/selection_routines.pyx":1532 * ia.hits = 0 * ni = 0 * for i in range(nc): # <<<<<<<<<<<<<< @@ -25129,7 +27039,7 @@ for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_3; __pyx_t_15+=1) { __pyx_v_i = __pyx_t_15; - /* "yt/geometry/selection_routines.pyx":1539 + /* "yt/geometry/selection_routines.pyx":1533 * ni = 0 * for i in range(nc): * for j in range(3): # <<<<<<<<<<<<<< @@ -25139,7 +27049,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_j = __pyx_t_16; - /* "yt/geometry/selection_routines.pyx":1540 + /* "yt/geometry/selection_routines.pyx":1534 * for i in range(nc): * for j in range(3): * LE[j] = 1e60 # <<<<<<<<<<<<<< @@ -25148,7 +27058,7 @@ */ (__pyx_v_LE[__pyx_v_j]) = 1e60; - /* "yt/geometry/selection_routines.pyx":1541 + /* "yt/geometry/selection_routines.pyx":1535 * for j in range(3): * LE[j] = 1e60 * RE[j] = -1e60 # <<<<<<<<<<<<<< @@ -25158,7 +27068,7 @@ (__pyx_v_RE[__pyx_v_j]) = -1e60; } - /* "yt/geometry/selection_routines.pyx":1542 + /* "yt/geometry/selection_routines.pyx":1536 * LE[j] = 1e60 * RE[j] = -1e60 * for j in range(nv): # <<<<<<<<<<<<<< @@ -25169,7 +27079,7 @@ for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_j = __pyx_t_17; - /* "yt/geometry/selection_routines.pyx":1543 + /* "yt/geometry/selection_routines.pyx":1537 * RE[j] = -1e60 * for j in range(nv): * for k in range(3): # <<<<<<<<<<<<<< @@ -25179,7 +27089,7 @@ for (__pyx_t_18 = 0; __pyx_t_18 < 3; __pyx_t_18+=1) { __pyx_v_k = __pyx_t_18; - /* "yt/geometry/selection_routines.pyx":1544 + /* "yt/geometry/selection_routines.pyx":1538 * for j in range(nv): * for k in range(3): * pos = coords[indices[i, j] - offset, k] # <<<<<<<<<<<<<< @@ -25192,7 +27102,7 @@ __pyx_t_22 = __pyx_v_k; __pyx_v_pos = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_coords.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_coords.diminfo[1].strides)); - /* "yt/geometry/selection_routines.pyx":1545 + /* "yt/geometry/selection_routines.pyx":1539 * for k in range(3): * pos = coords[indices[i, j] - offset, k] * LE[k] = fmin(pos, LE[k]) # <<<<<<<<<<<<<< @@ -25201,7 +27111,7 @@ */ (__pyx_v_LE[__pyx_v_k]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_pos, (__pyx_v_LE[__pyx_v_k])); - /* "yt/geometry/selection_routines.pyx":1546 + /* "yt/geometry/selection_routines.pyx":1540 * pos = coords[indices[i, j] - offset, k] * LE[k] = fmin(pos, LE[k]) * RE[k] = fmax(pos, RE[k]) # <<<<<<<<<<<<<< @@ -25212,7 +27122,7 @@ } } - /* "yt/geometry/selection_routines.pyx":1547 + /* "yt/geometry/selection_routines.pyx":1541 * LE[k] = fmin(pos, LE[k]) * RE[k] = fmax(pos, RE[k]) * for j in range(3): # <<<<<<<<<<<<<< @@ -25222,7 +27132,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_j = __pyx_t_16; - /* "yt/geometry/selection_routines.pyx":1548 + /* "yt/geometry/selection_routines.pyx":1542 * RE[k] = fmax(pos, RE[k]) * for j in range(3): * vc.left_edge[j] = LE[j] # <<<<<<<<<<<<<< @@ -25231,7 +27141,7 @@ */ (__pyx_v_vc.left_edge[__pyx_v_j]) = (__pyx_v_LE[__pyx_v_j]); - /* "yt/geometry/selection_routines.pyx":1549 + /* "yt/geometry/selection_routines.pyx":1543 * for j in range(3): * vc.left_edge[j] = LE[j] * vc.right_edge[j] = RE[j] # <<<<<<<<<<<<<< @@ -25240,7 +27150,7 @@ */ (__pyx_v_vc.right_edge[__pyx_v_j]) = (__pyx_v_RE[__pyx_v_j]); - /* "yt/geometry/selection_routines.pyx":1550 + /* "yt/geometry/selection_routines.pyx":1544 * vc.left_edge[j] = LE[j] * vc.right_edge[j] = RE[j] * vc.dds[j] = RE[j] - LE[j] # <<<<<<<<<<<<<< @@ -25249,7 +27159,7 @@ */ (__pyx_v_vc.dds[__pyx_v_j]) = ((__pyx_v_RE[__pyx_v_j]) - (__pyx_v_LE[__pyx_v_j])); - /* "yt/geometry/selection_routines.pyx":1551 + /* "yt/geometry/selection_routines.pyx":1545 * vc.right_edge[j] = RE[j] * vc.dds[j] = RE[j] - LE[j] * vc.idds[j] = 1.0/vc.dds[j] # <<<<<<<<<<<<<< @@ -25258,21 +27168,21 @@ */ (__pyx_v_vc.idds[__pyx_v_j]) = (1.0 / (__pyx_v_vc.dds[__pyx_v_j])); - /* "yt/geometry/selection_routines.pyx":1552 + /* "yt/geometry/selection_routines.pyx":1546 * vc.dds[j] = RE[j] - LE[j] * vc.idds[j] = 1.0/vc.dds[j] * vc.dims[j] = 1 # <<<<<<<<<<<<<< * t[0,0,0] = dt[0,0,0] = -1 - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) */ (__pyx_v_vc.dims[__pyx_v_j]) = 1; } - /* "yt/geometry/selection_routines.pyx":1553 + /* "yt/geometry/selection_routines.pyx":1547 * vc.idds[j] = 1.0/vc.dds[j] * vc.dims[j] = 1 * t[0,0,0] = dt[0,0,0] = -1 # <<<<<<<<<<<<<< - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) * if dt[0,0,0] >= 0: */ __pyx_t_23 = 0; @@ -25284,18 +27194,18 @@ __pyx_t_28 = 0; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dt.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_dt.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_dt.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_dt.diminfo[2].strides) = -1.0; - /* "yt/geometry/selection_routines.pyx":1554 + /* "yt/geometry/selection_routines.pyx":1548 * vc.dims[j] = 1 * t[0,0,0] = dt[0,0,0] = -1 - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) # <<<<<<<<<<<<<< + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) # <<<<<<<<<<<<<< * if dt[0,0,0] >= 0: * tr[ni] = t[0,0,0] */ - __pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume((&__pyx_v_vc), __pyx_v_self->p1, __pyx_v_self->vec, __pyx_f_2yt_8geometry_18selection_routines_dt_sampler, ((void *)(&__pyx_v_ia)), NULL); + __pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume((&__pyx_v_vc), __pyx_v_self->p1, __pyx_v_self->vec, __pyx_f_2yt_8geometry_18selection_routines_dt_sampler, ((void *)__pyx_v_ia), NULL); - /* "yt/geometry/selection_routines.pyx":1555 + /* "yt/geometry/selection_routines.pyx":1549 * t[0,0,0] = dt[0,0,0] = -1 - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) * if dt[0,0,0] >= 0: # <<<<<<<<<<<<<< * tr[ni] = t[0,0,0] * dtr[ni] = dt[0,0,0] @@ -25306,8 +27216,8 @@ __pyx_t_9 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dt.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_dt.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_dt.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_dt.diminfo[2].strides)) >= 0.0) != 0); if (__pyx_t_9) { - /* "yt/geometry/selection_routines.pyx":1556 - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + /* "yt/geometry/selection_routines.pyx":1550 + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) * if dt[0,0,0] >= 0: * tr[ni] = t[0,0,0] # <<<<<<<<<<<<<< * dtr[ni] = dt[0,0,0] @@ -25319,12 +27229,12 @@ __pyx_t_35 = __pyx_v_ni; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tr.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_tr.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_t.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_t.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_t.diminfo[1].strides, __pyx_t_34, __pyx_pybuffernd_t.diminfo[2].strides)); - /* "yt/geometry/selection_routines.pyx":1557 + /* "yt/geometry/selection_routines.pyx":1551 * if dt[0,0,0] >= 0: * tr[ni] = t[0,0,0] * dtr[ni] = dt[0,0,0] # <<<<<<<<<<<<<< * ni += 1 - * return dtr, tr + * free(ia) */ __pyx_t_36 = 0; __pyx_t_37 = 0; @@ -25332,18 +27242,18 @@ __pyx_t_39 = __pyx_v_ni; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dtr.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_dtr.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dt.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_dt.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_dt.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_dt.diminfo[2].strides)); - /* "yt/geometry/selection_routines.pyx":1558 + /* "yt/geometry/selection_routines.pyx":1552 * tr[ni] = t[0,0,0] * dtr[ni] = dt[0,0,0] * ni += 1 # <<<<<<<<<<<<<< + * free(ia) * return dtr, tr - * */ __pyx_v_ni = (__pyx_v_ni + 1); - /* "yt/geometry/selection_routines.pyx":1555 + /* "yt/geometry/selection_routines.pyx":1549 * t[0,0,0] = dt[0,0,0] = -1 - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) * if dt[0,0,0] >= 0: # <<<<<<<<<<<<<< * tr[ni] = t[0,0,0] * dtr[ni] = dt[0,0,0] @@ -25351,15 +27261,24 @@ } } - /* "yt/geometry/selection_routines.pyx":1559 + /* "yt/geometry/selection_routines.pyx":1553 * dtr[ni] = dt[0,0,0] * ni += 1 + * free(ia) # <<<<<<<<<<<<<< + * return dtr, tr + * + */ + free(__pyx_v_ia); + + /* "yt/geometry/selection_routines.pyx":1554 + * ni += 1 + * free(ia) * return dtr, tr # <<<<<<<<<<<<<< * * cdef int select_point(self, np.float64_t pos[3]) nogil: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1559, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_v_dtr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_dtr)); @@ -25371,7 +27290,7 @@ __pyx_t_7 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1510 + /* "yt/geometry/selection_routines.pyx":1503 * @cython.wraparound(False) * @cython.cdivision(True) * def get_dt_mesh(self, mesh, nz, int offset): # <<<<<<<<<<<<<< @@ -25421,7 +27340,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1561 +/* "yt/geometry/selection_routines.pyx":1556 * return dtr, tr * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -25432,7 +27351,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_11RaySelector_select_point(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1563 + /* "yt/geometry/selection_routines.pyx":1558 * cdef int select_point(self, np.float64_t pos[3]) nogil: * # two 0-volume constructs don't intersect * return 0 # <<<<<<<<<<<<<< @@ -25442,7 +27361,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1561 + /* "yt/geometry/selection_routines.pyx":1556 * return dtr, tr * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -25455,7 +27374,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1565 +/* "yt/geometry/selection_routines.pyx":1560 * return 0 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -25466,7 +27385,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_11RaySelector_select_sphere(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_radius) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1567 + /* "yt/geometry/selection_routines.pyx":1562 * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * # not implemented * return 0 # <<<<<<<<<<<<<< @@ -25476,7 +27395,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1565 + /* "yt/geometry/selection_routines.pyx":1560 * return 0 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -25489,37 +27408,38 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1572 +/* "yt/geometry/selection_routines.pyx":1567 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< * np.float64_t right_edge[3]) nogil: - * cdef int i + * cdef int i, rv */ static int __pyx_f_2yt_8geometry_18selection_routines_11RaySelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { int __pyx_v_i; - __pyx_t_5numpy_uint8_t __pyx_v_cm; + int __pyx_v_rv; struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer __pyx_v_vc; - struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator __pyx_v_ia; - __pyx_t_5numpy_float64_t __pyx_v_dt; - __pyx_t_5numpy_float64_t __pyx_v_t; + struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator *__pyx_v_ia; + __pyx_t_5numpy_float64_t __pyx_v_dt[1]; + __pyx_t_5numpy_float64_t __pyx_v_t[1]; + __pyx_t_5numpy_uint8_t __pyx_v_cm[1]; int __pyx_r; int __pyx_t_1; int __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1575 - * np.float64_t right_edge[3]) nogil: - * cdef int i - * cdef np.uint8_t cm = 1 # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":1572 * cdef VolumeContainer vc - * cdef IntegrationAccumulator ia - */ - __pyx_v_cm = 1; - - /* "yt/geometry/selection_routines.pyx":1579 - * cdef IntegrationAccumulator ia - * cdef np.float64_t dt, t + * cdef IntegrationAccumulator *ia + * ia = malloc(sizeof(IntegrationAccumulator)) # <<<<<<<<<<<<<< + * cdef np.float64_t dt[1] + * cdef np.float64_t t[1] + */ + __pyx_v_ia = ((struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator *)malloc((sizeof(struct __pyx_t_2yt_8geometry_18selection_routines_IntegrationAccumulator)))); + + /* "yt/geometry/selection_routines.pyx":1576 + * cdef np.float64_t t[1] + * cdef np.uint8_t cm[1] * for i in range(3): # <<<<<<<<<<<<<< * vc.left_edge[i] = left_edge[i] * vc.right_edge[i] = right_edge[i] @@ -25527,8 +27447,8 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":1580 - * cdef np.float64_t dt, t + /* "yt/geometry/selection_routines.pyx":1577 + * cdef np.uint8_t cm[1] * for i in range(3): * vc.left_edge[i] = left_edge[i] # <<<<<<<<<<<<<< * vc.right_edge[i] = right_edge[i] @@ -25536,7 +27456,7 @@ */ (__pyx_v_vc.left_edge[__pyx_v_i]) = (__pyx_v_left_edge[__pyx_v_i]); - /* "yt/geometry/selection_routines.pyx":1581 + /* "yt/geometry/selection_routines.pyx":1578 * for i in range(3): * vc.left_edge[i] = left_edge[i] * vc.right_edge[i] = right_edge[i] # <<<<<<<<<<<<<< @@ -25545,7 +27465,7 @@ */ (__pyx_v_vc.right_edge[__pyx_v_i]) = (__pyx_v_right_edge[__pyx_v_i]); - /* "yt/geometry/selection_routines.pyx":1582 + /* "yt/geometry/selection_routines.pyx":1579 * vc.left_edge[i] = left_edge[i] * vc.right_edge[i] = right_edge[i] * vc.dds[i] = right_edge[i] - left_edge[i] # <<<<<<<<<<<<<< @@ -25554,125 +27474,151 @@ */ (__pyx_v_vc.dds[__pyx_v_i]) = ((__pyx_v_right_edge[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])); - /* "yt/geometry/selection_routines.pyx":1583 + /* "yt/geometry/selection_routines.pyx":1580 * vc.right_edge[i] = right_edge[i] * vc.dds[i] = right_edge[i] - left_edge[i] * vc.idds[i] = 1.0/vc.dds[i] # <<<<<<<<<<<<<< * vc.dims[i] = 1 - * t = dt = 0.0 + * t[0] = dt[0] = 0.0 */ (__pyx_v_vc.idds[__pyx_v_i]) = (1.0 / (__pyx_v_vc.dds[__pyx_v_i])); - /* "yt/geometry/selection_routines.pyx":1584 + /* "yt/geometry/selection_routines.pyx":1581 * vc.dds[i] = right_edge[i] - left_edge[i] * vc.idds[i] = 1.0/vc.dds[i] * vc.dims[i] = 1 # <<<<<<<<<<<<<< - * t = dt = 0.0 - * ia.t = &t + * t[0] = dt[0] = 0.0 + * cm[0] = 1 */ (__pyx_v_vc.dims[__pyx_v_i]) = 1; } - /* "yt/geometry/selection_routines.pyx":1585 + /* "yt/geometry/selection_routines.pyx":1582 * vc.idds[i] = 1.0/vc.dds[i] * vc.dims[i] = 1 - * t = dt = 0.0 # <<<<<<<<<<<<<< - * ia.t = &t - * ia.dt = &dt + * t[0] = dt[0] = 0.0 # <<<<<<<<<<<<<< + * cm[0] = 1 + * ia.t = t */ - __pyx_v_t = 0.0; - __pyx_v_dt = 0.0; + (__pyx_v_t[0]) = 0.0; + (__pyx_v_dt[0]) = 0.0; - /* "yt/geometry/selection_routines.pyx":1586 + /* "yt/geometry/selection_routines.pyx":1583 * vc.dims[i] = 1 - * t = dt = 0.0 - * ia.t = &t # <<<<<<<<<<<<<< - * ia.dt = &dt - * ia.child_mask = &cm + * t[0] = dt[0] = 0.0 + * cm[0] = 1 # <<<<<<<<<<<<<< + * ia.t = t + * ia.dt = dt + */ + (__pyx_v_cm[0]) = 1; + + /* "yt/geometry/selection_routines.pyx":1584 + * t[0] = dt[0] = 0.0 + * cm[0] = 1 + * ia.t = t # <<<<<<<<<<<<<< + * ia.dt = dt + * ia.child_mask = cm */ - __pyx_v_ia.t = (&__pyx_v_t); + __pyx_v_ia->t = __pyx_v_t; - /* "yt/geometry/selection_routines.pyx":1587 - * t = dt = 0.0 - * ia.t = &t - * ia.dt = &dt # <<<<<<<<<<<<<< - * ia.child_mask = &cm + /* "yt/geometry/selection_routines.pyx":1585 + * cm[0] = 1 + * ia.t = t + * ia.dt = dt # <<<<<<<<<<<<<< + * ia.child_mask = cm * ia.hits = 0 */ - __pyx_v_ia.dt = (&__pyx_v_dt); + __pyx_v_ia->dt = __pyx_v_dt; - /* "yt/geometry/selection_routines.pyx":1588 - * ia.t = &t - * ia.dt = &dt - * ia.child_mask = &cm # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":1586 + * ia.t = t + * ia.dt = dt + * ia.child_mask = cm # <<<<<<<<<<<<<< * ia.hits = 0 - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) */ - __pyx_v_ia.child_mask = (&__pyx_v_cm); + __pyx_v_ia->child_mask = __pyx_v_cm; - /* "yt/geometry/selection_routines.pyx":1589 - * ia.dt = &dt - * ia.child_mask = &cm + /* "yt/geometry/selection_routines.pyx":1587 + * ia.dt = dt + * ia.child_mask = cm * ia.hits = 0 # <<<<<<<<<<<<<< - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) - * if ia.hits > 0: + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) + * rv = 0 */ - __pyx_v_ia.hits = 0; + __pyx_v_ia->hits = 0; - /* "yt/geometry/selection_routines.pyx":1590 - * ia.child_mask = &cm + /* "yt/geometry/selection_routines.pyx":1588 + * ia.child_mask = cm * ia.hits = 0 - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) # <<<<<<<<<<<<<< + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) # <<<<<<<<<<<<<< + * rv = 0 * if ia.hits > 0: - * return 1 */ - __pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume((&__pyx_v_vc), __pyx_v_self->p1, __pyx_v_self->vec, __pyx_f_2yt_8geometry_18selection_routines_dt_sampler, ((void *)(&__pyx_v_ia)), NULL); + __pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume((&__pyx_v_vc), __pyx_v_self->p1, __pyx_v_self->vec, __pyx_f_2yt_8geometry_18selection_routines_dt_sampler, ((void *)__pyx_v_ia), NULL); - /* "yt/geometry/selection_routines.pyx":1591 + /* "yt/geometry/selection_routines.pyx":1589 * ia.hits = 0 - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) - * if ia.hits > 0: # <<<<<<<<<<<<<< - * return 1 - * return 0 + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) + * rv = 0 # <<<<<<<<<<<<<< + * if ia.hits > 0: + * rv = 1 */ - __pyx_t_2 = ((__pyx_v_ia.hits > 0) != 0); - if (__pyx_t_2) { + __pyx_v_rv = 0; - /* "yt/geometry/selection_routines.pyx":1592 - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) - * if ia.hits > 0: - * return 1 # <<<<<<<<<<<<<< - * return 0 - * + /* "yt/geometry/selection_routines.pyx":1590 + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) + * rv = 0 + * if ia.hits > 0: # <<<<<<<<<<<<<< + * rv = 1 + * free(ia) */ - __pyx_r = 1; - goto __pyx_L0; + __pyx_t_2 = ((__pyx_v_ia->hits > 0) != 0); + if (__pyx_t_2) { /* "yt/geometry/selection_routines.pyx":1591 - * ia.hits = 0 - * walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + * rv = 0 + * if ia.hits > 0: + * rv = 1 # <<<<<<<<<<<<<< + * free(ia) + * return rv + */ + __pyx_v_rv = 1; + + /* "yt/geometry/selection_routines.pyx":1590 + * walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) + * rv = 0 * if ia.hits > 0: # <<<<<<<<<<<<<< - * return 1 - * return 0 + * rv = 1 + * free(ia) */ } - /* "yt/geometry/selection_routines.pyx":1593 + /* "yt/geometry/selection_routines.pyx":1592 * if ia.hits > 0: - * return 1 - * return 0 # <<<<<<<<<<<<<< + * rv = 1 + * free(ia) # <<<<<<<<<<<<<< + * return rv + * + */ + free(__pyx_v_ia); + + /* "yt/geometry/selection_routines.pyx":1593 + * rv = 1 + * free(ia) + * return rv # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_r = 0; + __pyx_r = __pyx_v_rv; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1572 + /* "yt/geometry/selection_routines.pyx":1567 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< * np.float64_t right_edge[3]) nogil: - * cdef int i + * cdef int i, rv */ /* function exit code */ @@ -26014,6 +27960,113 @@ 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_2yt_8geometry_18selection_routines_11RaySelector_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_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_2yt_8geometry_18selection_routines_11RaySelector_10__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_11RaySelector_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *__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__49, 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("yt.geometry.selection_routines.RaySelector.__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_2yt_8geometry_18selection_routines_11RaySelector_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_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_2yt_8geometry_18selection_routines_11RaySelector_12__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_11RaySelector_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *__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__50, 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("yt.geometry.selection_routines.RaySelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/geometry/selection_routines.pyx":1627 * cdef np.int64_t nids * @@ -26037,6 +28090,7 @@ 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; } @@ -26156,8 +28210,11 @@ 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; } @@ -26166,11 +28223,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 1634, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else { @@ -26358,6 +28417,7 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { @@ -26395,6 +28455,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; @@ -26413,7 +28474,7 @@ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_gridi), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; @@ -26562,7 +28623,7 @@ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1653, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; @@ -26698,6 +28759,113 @@ 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_2yt_8geometry_18selection_routines_22DataCollectionSelector_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_22DataCollectionSelector_9__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_2yt_8geometry_18selection_routines_22DataCollectionSelector_8__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_22DataCollectionSelector_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *__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__53, 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("yt.geometry.selection_routines.DataCollectionSelector.__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_2yt_8geometry_18selection_routines_22DataCollectionSelector_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_22DataCollectionSelector_11__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_2yt_8geometry_18selection_routines_22DataCollectionSelector_10__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_22DataCollectionSelector_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *__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__54, 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("yt.geometry.selection_routines.DataCollectionSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/geometry/selection_routines.pyx":1665 * cdef np.float64_t center[3] * @@ -26721,6 +28889,7 @@ 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; } @@ -27178,6 +29347,8 @@ static int __pyx_f_2yt_8geometry_18selection_routines_17EllipsoidSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius) { int __pyx_v_i; + __pyx_t_5numpy_float64_t __pyx_v_dist; + __pyx_t_5numpy_float64_t __pyx_v_dist2_max; __pyx_t_5numpy_float64_t __pyx_v_dist2; int __pyx_r; int __pyx_t_1; @@ -27186,61 +29357,95 @@ /* "yt/geometry/selection_routines.pyx":1714 * # this is the sphere selection * cdef int i - * cdef np.float64_t dist2 = 0 # <<<<<<<<<<<<<< + * cdef np.float64_t dist, dist2_max, dist2 = 0 # <<<<<<<<<<<<<< * for i in range(3): - * dist2 += self.difference(pos[i], self.center[i], i)**2 + * dist = self.difference(pos[i], self.center[i], i) */ __pyx_v_dist2 = 0.0; /* "yt/geometry/selection_routines.pyx":1715 * cdef int i - * cdef np.float64_t dist2 = 0 + * cdef np.float64_t dist, dist2_max, dist2 = 0 * for i in range(3): # <<<<<<<<<<<<<< - * dist2 += self.difference(pos[i], self.center[i], i)**2 - * if dist2 <= (self.mag[0]+radius)**2: return 1 + * dist = self.difference(pos[i], self.center[i], i) + * dist2 += dist * dist */ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; /* "yt/geometry/selection_routines.pyx":1716 - * cdef np.float64_t dist2 = 0 + * cdef np.float64_t dist, dist2_max, dist2 = 0 * for i in range(3): - * dist2 += self.difference(pos[i], self.center[i], i)**2 # <<<<<<<<<<<<<< - * if dist2 <= (self.mag[0]+radius)**2: return 1 - * return 0 + * dist = self.difference(pos[i], self.center[i], i) # <<<<<<<<<<<<<< + * dist2 += dist * dist + * dist2_max = (self.mag[0] + radius) * (self.mag[0] + radius) */ - __pyx_v_dist2 = (__pyx_v_dist2 + pow(((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_EllipsoidSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.difference(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), (__pyx_v_pos[__pyx_v_i]), (__pyx_v_self->center[__pyx_v_i]), __pyx_v_i), 2.0)); - } + __pyx_v_dist = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_EllipsoidSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.difference(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), (__pyx_v_pos[__pyx_v_i]), (__pyx_v_self->center[__pyx_v_i]), __pyx_v_i); - /* "yt/geometry/selection_routines.pyx":1717 + /* "yt/geometry/selection_routines.pyx":1717 * for i in range(3): - * dist2 += self.difference(pos[i], self.center[i], i)**2 - * if dist2 <= (self.mag[0]+radius)**2: return 1 # <<<<<<<<<<<<<< - * return 0 - * + * dist = self.difference(pos[i], self.center[i], i) + * dist2 += dist * dist # <<<<<<<<<<<<<< + * dist2_max = (self.mag[0] + radius) * (self.mag[0] + radius) + * if dist2 <= dist2_max: */ - __pyx_t_2 = ((__pyx_v_dist2 <= pow(((__pyx_v_self->mag[0]) + __pyx_v_radius), 2.0)) != 0); - if (__pyx_t_2) { - __pyx_r = 1; - goto __pyx_L0; + __pyx_v_dist2 = (__pyx_v_dist2 + (__pyx_v_dist * __pyx_v_dist)); } /* "yt/geometry/selection_routines.pyx":1718 - * dist2 += self.difference(pos[i], self.center[i], i)**2 - * if dist2 <= (self.mag[0]+radius)**2: return 1 - * return 0 # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) + * dist = self.difference(pos[i], self.center[i], i) + * dist2 += dist * dist + * dist2_max = (self.mag[0] + radius) * (self.mag[0] + radius) # <<<<<<<<<<<<<< + * if dist2 <= dist2_max: + * return 1 */ - __pyx_r = 0; - goto __pyx_L0; + __pyx_v_dist2_max = (((__pyx_v_self->mag[0]) + __pyx_v_radius) * ((__pyx_v_self->mag[0]) + __pyx_v_radius)); - /* "yt/geometry/selection_routines.pyx":1711 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< - * # this is the sphere selection - * cdef int i + /* "yt/geometry/selection_routines.pyx":1719 + * dist2 += dist * dist + * dist2_max = (self.mag[0] + radius) * (self.mag[0] + radius) + * if dist2 <= dist2_max: # <<<<<<<<<<<<<< + * return 1 + * return 0 + */ + __pyx_t_2 = ((__pyx_v_dist2 <= __pyx_v_dist2_max) != 0); + if (__pyx_t_2) { + + /* "yt/geometry/selection_routines.pyx":1720 + * dist2_max = (self.mag[0] + radius) * (self.mag[0] + radius) + * if dist2 <= dist2_max: + * return 1 # <<<<<<<<<<<<<< + * return 0 + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/geometry/selection_routines.pyx":1719 + * dist2 += dist * dist + * dist2_max = (self.mag[0] + radius) * (self.mag[0] + radius) + * if dist2 <= dist2_max: # <<<<<<<<<<<<<< + * return 1 + * return 0 + */ + } + + /* "yt/geometry/selection_routines.pyx":1721 + * if dist2 <= dist2_max: + * return 1 + * return 0 # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/geometry/selection_routines.pyx":1711 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * # this is the sphere selection + * cdef int i */ /* function exit code */ @@ -27248,7 +29453,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1723 +/* "yt/geometry/selection_routines.pyx":1726 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -27263,15 +29468,16 @@ __pyx_t_5numpy_float64_t __pyx_v_closest; __pyx_t_5numpy_float64_t __pyx_v_dist; __pyx_t_5numpy_float64_t __pyx_v_edge; + __pyx_t_5numpy_float64_t __pyx_v_dist_max; int __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":1728 + /* "yt/geometry/selection_routines.pyx":1731 * cdef int i - * cdef np.float64_t box_center, relcenter, closest, dist, edge + * cdef np.float64_t box_center, relcenter, closest, dist, edge, dist_max * if left_edge[0] <= self.center[0] <= right_edge[0] and \ # <<<<<<<<<<<<<< * left_edge[1] <= self.center[1] <= right_edge[1] and \ * left_edge[2] <= self.center[2] <= right_edge[2]: @@ -27287,8 +29493,8 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":1729 - * cdef np.float64_t box_center, relcenter, closest, dist, edge + /* "yt/geometry/selection_routines.pyx":1732 + * cdef np.float64_t box_center, relcenter, closest, dist, edge, dist_max * if left_edge[0] <= self.center[0] <= right_edge[0] and \ * left_edge[1] <= self.center[1] <= right_edge[1] and \ # <<<<<<<<<<<<<< * left_edge[2] <= self.center[2] <= right_edge[2]: @@ -27305,7 +29511,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":1730 + /* "yt/geometry/selection_routines.pyx":1733 * if left_edge[0] <= self.center[0] <= right_edge[0] and \ * left_edge[1] <= self.center[1] <= right_edge[1] and \ * left_edge[2] <= self.center[2] <= right_edge[2]: # <<<<<<<<<<<<<< @@ -27320,16 +29526,16 @@ __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":1728 + /* "yt/geometry/selection_routines.pyx":1731 * cdef int i - * cdef np.float64_t box_center, relcenter, closest, dist, edge + * cdef np.float64_t box_center, relcenter, closest, dist, edge, dist_max * if left_edge[0] <= self.center[0] <= right_edge[0] and \ # <<<<<<<<<<<<<< * left_edge[1] <= self.center[1] <= right_edge[1] and \ * left_edge[2] <= self.center[2] <= right_edge[2]: */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":1731 + /* "yt/geometry/selection_routines.pyx":1734 * left_edge[1] <= self.center[1] <= right_edge[1] and \ * left_edge[2] <= self.center[2] <= right_edge[2]: * return 1 # <<<<<<<<<<<<<< @@ -27339,16 +29545,16 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1728 + /* "yt/geometry/selection_routines.pyx":1731 * cdef int i - * cdef np.float64_t box_center, relcenter, closest, dist, edge + * cdef np.float64_t box_center, relcenter, closest, dist, edge, dist_max * if left_edge[0] <= self.center[0] <= right_edge[0] and \ # <<<<<<<<<<<<<< * left_edge[1] <= self.center[1] <= right_edge[1] and \ * left_edge[2] <= self.center[2] <= right_edge[2]: */ } - /* "yt/geometry/selection_routines.pyx":1733 + /* "yt/geometry/selection_routines.pyx":1736 * return 1 * # http://www.gamedev.net/topic/335465-is-this-the-simplest-sphere-aabb-collision-test/ * dist = 0 # <<<<<<<<<<<<<< @@ -27357,7 +29563,7 @@ */ __pyx_v_dist = 0.0; - /* "yt/geometry/selection_routines.pyx":1734 + /* "yt/geometry/selection_routines.pyx":1737 * # http://www.gamedev.net/topic/335465-is-this-the-simplest-sphere-aabb-collision-test/ * dist = 0 * for i in range(3): # <<<<<<<<<<<<<< @@ -27367,7 +29573,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/geometry/selection_routines.pyx":1735 + /* "yt/geometry/selection_routines.pyx":1738 * dist = 0 * for i in range(3): * box_center = (right_edge[i] + left_edge[i])/2.0 # <<<<<<<<<<<<<< @@ -27376,7 +29582,7 @@ */ __pyx_v_box_center = (((__pyx_v_right_edge[__pyx_v_i]) + (__pyx_v_left_edge[__pyx_v_i])) / 2.0); - /* "yt/geometry/selection_routines.pyx":1736 + /* "yt/geometry/selection_routines.pyx":1739 * for i in range(3): * box_center = (right_edge[i] + left_edge[i])/2.0 * relcenter = self.difference(box_center, self.center[i], i) # <<<<<<<<<<<<<< @@ -27385,7 +29591,7 @@ */ __pyx_v_relcenter = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_EllipsoidSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.difference(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_box_center, (__pyx_v_self->center[__pyx_v_i]), __pyx_v_i); - /* "yt/geometry/selection_routines.pyx":1737 + /* "yt/geometry/selection_routines.pyx":1740 * box_center = (right_edge[i] + left_edge[i])/2.0 * relcenter = self.difference(box_center, self.center[i], i) * edge = right_edge[i] - left_edge[i] # <<<<<<<<<<<<<< @@ -27394,41 +29600,66 @@ */ __pyx_v_edge = ((__pyx_v_right_edge[__pyx_v_i]) - (__pyx_v_left_edge[__pyx_v_i])); - /* "yt/geometry/selection_routines.pyx":1738 + /* "yt/geometry/selection_routines.pyx":1741 * relcenter = self.difference(box_center, self.center[i], i) * edge = right_edge[i] - left_edge[i] * closest = relcenter - fclip(relcenter, -edge/2.0, edge/2.0) # <<<<<<<<<<<<<< * dist += closest * closest - * if dist <= self.mag[0]**2: return 1 + * dist_max = self.mag[0] * self.mag[0] */ __pyx_v_closest = (__pyx_v_relcenter - __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_v_relcenter, ((-__pyx_v_edge) / 2.0), (__pyx_v_edge / 2.0))); - /* "yt/geometry/selection_routines.pyx":1739 + /* "yt/geometry/selection_routines.pyx":1742 * edge = right_edge[i] - left_edge[i] * closest = relcenter - fclip(relcenter, -edge/2.0, edge/2.0) * dist += closest * closest # <<<<<<<<<<<<<< - * if dist <= self.mag[0]**2: return 1 - * return 0 + * dist_max = self.mag[0] * self.mag[0] + * if dist <= dist_max: */ __pyx_v_dist = (__pyx_v_dist + (__pyx_v_closest * __pyx_v_closest)); } - /* "yt/geometry/selection_routines.pyx":1740 + /* "yt/geometry/selection_routines.pyx":1743 * closest = relcenter - fclip(relcenter, -edge/2.0, edge/2.0) * dist += closest * closest - * if dist <= self.mag[0]**2: return 1 # <<<<<<<<<<<<<< + * dist_max = self.mag[0] * self.mag[0] # <<<<<<<<<<<<<< + * if dist <= dist_max: + * return 1 + */ + __pyx_v_dist_max = ((__pyx_v_self->mag[0]) * (__pyx_v_self->mag[0])); + + /* "yt/geometry/selection_routines.pyx":1744 + * dist += closest * closest + * dist_max = self.mag[0] * self.mag[0] + * if dist <= dist_max: # <<<<<<<<<<<<<< + * return 1 * return 0 - * */ - __pyx_t_1 = ((__pyx_v_dist <= pow((__pyx_v_self->mag[0]), 2.0)) != 0); + __pyx_t_1 = ((__pyx_v_dist <= __pyx_v_dist_max) != 0); if (__pyx_t_1) { + + /* "yt/geometry/selection_routines.pyx":1745 + * dist_max = self.mag[0] * self.mag[0] + * if dist <= dist_max: + * return 1 # <<<<<<<<<<<<<< + * return 0 + * + */ __pyx_r = 1; goto __pyx_L0; - } - /* "yt/geometry/selection_routines.pyx":1741 + /* "yt/geometry/selection_routines.pyx":1744 * dist += closest * closest - * if dist <= self.mag[0]**2: return 1 + * dist_max = self.mag[0] * self.mag[0] + * if dist <= dist_max: # <<<<<<<<<<<<<< + * return 1 + * return 0 + */ + } + + /* "yt/geometry/selection_routines.pyx":1746 + * if dist <= dist_max: + * return 1 * return 0 # <<<<<<<<<<<<<< * * def _hash_vals(self): @@ -27436,7 +29667,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1723 + /* "yt/geometry/selection_routines.pyx":1726 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -27449,7 +29680,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1743 +/* "yt/geometry/selection_routines.pyx":1748 * return 0 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -27491,7 +29722,7 @@ PyObject *__pyx_t_16 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":1744 + /* "yt/geometry/selection_routines.pyx":1749 * * def _hash_vals(self): * return (("vec[0][0]", self.vec[0][0]), # <<<<<<<<<<<<<< @@ -27499,9 +29730,9 @@ * ("vec[0][2]", self.vec[0][2]), */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[0])[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1744, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[0])[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1744, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_kp_s_vec_0_0); __Pyx_GIVEREF(__pyx_kp_s_vec_0_0); @@ -27510,16 +29741,16 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1745 + /* "yt/geometry/selection_routines.pyx":1750 * def _hash_vals(self): * return (("vec[0][0]", self.vec[0][0]), * ("vec[0][1]", self.vec[0][1]), # <<<<<<<<<<<<<< * ("vec[0][2]", self.vec[0][2]), * ("vec[1][0]", self.vec[1][0]), */ - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[0])[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1745, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[0])[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1745, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_s_vec_0_1); __Pyx_GIVEREF(__pyx_kp_s_vec_0_1); @@ -27528,16 +29759,16 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1746 + /* "yt/geometry/selection_routines.pyx":1751 * return (("vec[0][0]", self.vec[0][0]), * ("vec[0][1]", self.vec[0][1]), * ("vec[0][2]", self.vec[0][2]), # <<<<<<<<<<<<<< * ("vec[1][0]", self.vec[1][0]), * ("vec[1][1]", self.vec[1][1]), */ - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[0])[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1746, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[0])[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1746, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_vec_0_2); __Pyx_GIVEREF(__pyx_kp_s_vec_0_2); @@ -27546,16 +29777,16 @@ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1747 + /* "yt/geometry/selection_routines.pyx":1752 * ("vec[0][1]", self.vec[0][1]), * ("vec[0][2]", self.vec[0][2]), * ("vec[1][0]", self.vec[1][0]), # <<<<<<<<<<<<<< * ("vec[1][1]", self.vec[1][1]), * ("vec[1][2]", self.vec[1][2]), */ - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[1])[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1747, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[1])[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1747, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_vec_1_0); __Pyx_GIVEREF(__pyx_kp_s_vec_1_0); @@ -27564,16 +29795,16 @@ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1748 + /* "yt/geometry/selection_routines.pyx":1753 * ("vec[0][2]", self.vec[0][2]), * ("vec[1][0]", self.vec[1][0]), * ("vec[1][1]", self.vec[1][1]), # <<<<<<<<<<<<<< * ("vec[1][2]", self.vec[1][2]), * ("vec[2][0]", self.vec[2][0]), */ - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[1])[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1748, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[1])[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1748, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_kp_s_vec_1_1); __Pyx_GIVEREF(__pyx_kp_s_vec_1_1); @@ -27582,16 +29813,16 @@ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1749 + /* "yt/geometry/selection_routines.pyx":1754 * ("vec[1][0]", self.vec[1][0]), * ("vec[1][1]", self.vec[1][1]), * ("vec[1][2]", self.vec[1][2]), # <<<<<<<<<<<<<< * ("vec[2][0]", self.vec[2][0]), * ("vec[2][1]", self.vec[2][1]), */ - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[1])[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1749, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[1])[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1749, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_kp_s_vec_1_2); __Pyx_GIVEREF(__pyx_kp_s_vec_1_2); @@ -27600,16 +29831,16 @@ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1750 + /* "yt/geometry/selection_routines.pyx":1755 * ("vec[1][1]", self.vec[1][1]), * ("vec[1][2]", self.vec[1][2]), * ("vec[2][0]", self.vec[2][0]), # <<<<<<<<<<<<<< * ("vec[2][1]", self.vec[2][1]), * ("vec[2][2]", self.vec[2][2]), */ - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[2])[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1750, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[2])[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1750, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_kp_s_vec_2_0); __Pyx_GIVEREF(__pyx_kp_s_vec_2_0); @@ -27618,16 +29849,16 @@ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1751 + /* "yt/geometry/selection_routines.pyx":1756 * ("vec[1][2]", self.vec[1][2]), * ("vec[2][0]", self.vec[2][0]), * ("vec[2][1]", self.vec[2][1]), # <<<<<<<<<<<<<< * ("vec[2][2]", self.vec[2][2]), * ("mag[0]", self.mag[0]), */ - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[2])[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1751, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[2])[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1751, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_kp_s_vec_2_1); __Pyx_GIVEREF(__pyx_kp_s_vec_2_1); @@ -27636,16 +29867,16 @@ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1752 + /* "yt/geometry/selection_routines.pyx":1757 * ("vec[2][0]", self.vec[2][0]), * ("vec[2][1]", self.vec[2][1]), * ("vec[2][2]", self.vec[2][2]), # <<<<<<<<<<<<<< * ("mag[0]", self.mag[0]), * ("mag[1]", self.mag[1]), */ - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[2])[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->vec[2])[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1752, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_kp_s_vec_2_2); __Pyx_GIVEREF(__pyx_kp_s_vec_2_2); @@ -27654,16 +29885,16 @@ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1753 + /* "yt/geometry/selection_routines.pyx":1758 * ("vec[2][1]", self.vec[2][1]), * ("vec[2][2]", self.vec[2][2]), * ("mag[0]", self.mag[0]), # <<<<<<<<<<<<<< * ("mag[1]", self.mag[1]), * ("mag[2]", self.mag[2]), */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->mag[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1753, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->mag[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1753, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_kp_s_mag_0); __Pyx_GIVEREF(__pyx_kp_s_mag_0); @@ -27672,16 +29903,16 @@ PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1754 + /* "yt/geometry/selection_routines.pyx":1759 * ("vec[2][2]", self.vec[2][2]), * ("mag[0]", self.mag[0]), * ("mag[1]", self.mag[1]), # <<<<<<<<<<<<<< * ("mag[2]", self.mag[2]), * ("center[0]", self.center[0]), */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->mag[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1754, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->mag[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1754, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_kp_s_mag_1); __Pyx_GIVEREF(__pyx_kp_s_mag_1); @@ -27690,16 +29921,16 @@ PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1755 + /* "yt/geometry/selection_routines.pyx":1760 * ("mag[0]", self.mag[0]), * ("mag[1]", self.mag[1]), * ("mag[2]", self.mag[2]), # <<<<<<<<<<<<<< * ("center[0]", self.center[0]), * ("center[1]", self.center[1]), */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->mag[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1755, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->mag[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1755, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_kp_s_mag_2); __Pyx_GIVEREF(__pyx_kp_s_mag_2); @@ -27708,16 +29939,16 @@ PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1756 + /* "yt/geometry/selection_routines.pyx":1761 * ("mag[1]", self.mag[1]), * ("mag[2]", self.mag[2]), * ("center[0]", self.center[0]), # <<<<<<<<<<<<<< * ("center[1]", self.center[1]), * ("center[2]", self.center[2])) */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1756, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1756, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_kp_s_center_0); __Pyx_GIVEREF(__pyx_kp_s_center_0); @@ -27726,16 +29957,16 @@ PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1757 + /* "yt/geometry/selection_routines.pyx":1762 * ("mag[2]", self.mag[2]), * ("center[0]", self.center[0]), * ("center[1]", self.center[1]), # <<<<<<<<<<<<<< * ("center[2]", self.center[2])) * */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1757, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1757, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_kp_s_center_1); __Pyx_GIVEREF(__pyx_kp_s_center_1); @@ -27744,16 +29975,16 @@ PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1758 + /* "yt/geometry/selection_routines.pyx":1763 * ("center[0]", self.center[0]), * ("center[1]", self.center[1]), * ("center[2]", self.center[2])) # <<<<<<<<<<<<<< * * ellipsoid_selector = EllipsoidSelector */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1758, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->center[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1758, __pyx_L1_error) + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_kp_s_center_2); __Pyx_GIVEREF(__pyx_kp_s_center_2); @@ -27762,14 +29993,14 @@ PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1744 + /* "yt/geometry/selection_routines.pyx":1749 * * def _hash_vals(self): * return (("vec[0][0]", self.vec[0][0]), # <<<<<<<<<<<<<< * ("vec[0][1]", self.vec[0][1]), * ("vec[0][2]", self.vec[0][2]), */ - __pyx_t_1 = PyTuple_New(15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1744, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -27820,7 +30051,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1743 + /* "yt/geometry/selection_routines.pyx":1748 * return 0 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -27854,7 +30085,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1765 +/* "(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_2yt_8geometry_18selection_routines_17EllipsoidSelector_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_17EllipsoidSelector_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_2yt_8geometry_18selection_routines_17EllipsoidSelector_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17EllipsoidSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *__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__55, 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("yt.geometry.selection_routines.EllipsoidSelector.__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_2yt_8geometry_18selection_routines_17EllipsoidSelector_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_17EllipsoidSelector_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_2yt_8geometry_18selection_routines_17EllipsoidSelector_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17EllipsoidSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *__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__56, 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("yt.geometry.selection_routines.EllipsoidSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":1770 * cdef object ind * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -27877,6 +30215,7 @@ 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; } @@ -27887,7 +30226,7 @@ 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(0, 1765, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1770, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -27898,7 +30237,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1765, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1770, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.GridSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -27919,18 +30258,18 @@ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":1766 + /* "yt/geometry/selection_routines.pyx":1771 * * def __init__(self, dobj): * self.ind = dobj.id - dobj._id_offset # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1766, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_id_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1766, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_id_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1766, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1771, __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; @@ -27940,7 +30279,7 @@ __pyx_v_self->ind = __pyx_t_3; __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pyx":1765 + /* "yt/geometry/selection_routines.pyx":1770 * cdef object ind * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -27962,7 +30301,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1771 +/* "yt/geometry/selection_routines.pyx":1776 * @cython.wraparound(False) * @cython.cdivision(True) * def select_grids(self, # <<<<<<<<<<<<<< @@ -27987,8 +30326,11 @@ 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; } @@ -27997,19 +30339,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 1771, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 1776, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); __PYX_ERR(0, 1771, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); __PYX_ERR(0, 1776, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) __PYX_ERR(0, 1771, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) __PYX_ERR(0, 1776, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -28024,15 +30368,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1771, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1776, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.GridSelector.select_grids", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 1772, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 1773, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 1774, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 1777, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 1778, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 1779, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_12GridSelector_2select_grids(((struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *)__pyx_v_self), __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_levels); /* function exit code */ @@ -28081,21 +30425,21 @@ __pyx_pybuffernd_levels.rcbuffer = &__pyx_pybuffer_levels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1771, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1776, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1771, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1776, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1771, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1776, __pyx_L1_error) } __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_levels.diminfo[1].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_levels.diminfo[1].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[1]; - /* "yt/geometry/selection_routines.pyx":1775 + /* "yt/geometry/selection_routines.pyx":1780 * np.ndarray[np.float64_t, ndim=2] right_edges, * np.ndarray[np.int32_t, ndim=2] levels): * cdef int ng = left_edges.shape[0] # <<<<<<<<<<<<<< @@ -28104,40 +30448,40 @@ */ __pyx_v_ng = (__pyx_v_left_edges->dimensions[0]); - /* "yt/geometry/selection_routines.pyx":1776 + /* "yt/geometry/selection_routines.pyx":1781 * np.ndarray[np.int32_t, ndim=2] levels): * cdef int ng = left_edges.shape[0] * cdef np.ndarray[np.uint8_t, ndim=1] gridi = np.zeros(ng, dtype='uint8') # <<<<<<<<<<<<<< * gridi[self.ind] = 1 * return gridi.astype("bool") */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1776, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1781, __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, 1776, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1781, __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_ng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1776, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1776, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1781, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1776, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 1776, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1776, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 1781, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1781, __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_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, 1776, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1781, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gridi.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_gridi = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_gridi.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1776, __pyx_L1_error) + __PYX_ERR(0, 1781, __pyx_L1_error) } else {__pyx_pybuffernd_gridi.diminfo[0].strides = __pyx_pybuffernd_gridi.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gridi.diminfo[0].shape = __pyx_pybuffernd_gridi.rcbuffer->pybuffer.shape[0]; } } @@ -28145,16 +30489,16 @@ __pyx_v_gridi = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":1777 + /* "yt/geometry/selection_routines.pyx":1782 * cdef int ng = left_edges.shape[0] * cdef np.ndarray[np.uint8_t, ndim=1] gridi = np.zeros(ng, dtype='uint8') * gridi[self.ind] = 1 # <<<<<<<<<<<<<< * return gridi.astype("bool") * */ - if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_gridi), __pyx_v_self->ind, __pyx_int_1) < 0)) __PYX_ERR(0, 1777, __pyx_L1_error) + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_gridi), __pyx_v_self->ind, __pyx_int_1) < 0)) __PYX_ERR(0, 1782, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1778 + /* "yt/geometry/selection_routines.pyx":1783 * cdef np.ndarray[np.uint8_t, ndim=1] gridi = np.zeros(ng, dtype='uint8') * gridi[self.ind] = 1 * return gridi.astype("bool") # <<<<<<<<<<<<<< @@ -28162,16 +30506,16 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_gridi), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1778, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_gridi), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1778, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1771 + /* "yt/geometry/selection_routines.pyx":1776 * @cython.wraparound(False) * @cython.cdivision(True) * def select_grids(self, # <<<<<<<<<<<<<< @@ -28209,7 +30553,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1783 +/* "yt/geometry/selection_routines.pyx":1788 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mask(self, gobj): # <<<<<<<<<<<<<< @@ -28239,7 +30583,7 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("fill_mask", 0); - /* "yt/geometry/selection_routines.pyx":1784 + /* "yt/geometry/selection_routines.pyx":1789 * @cython.cdivision(True) * def fill_mask(self, gobj): * return np.ones(gobj.ActiveDimensions, dtype='bool') # <<<<<<<<<<<<<< @@ -28247,22 +30591,22 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1784, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1784, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1784, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gobj, __pyx_n_s_ActiveDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1784, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1789, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1784, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1784, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1784, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1789, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1789, __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; @@ -28271,7 +30615,7 @@ __pyx_t_4 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1783 + /* "yt/geometry/selection_routines.pyx":1788 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_mask(self, gobj): # <<<<<<<<<<<<<< @@ -28293,7 +30637,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1789 +/* "yt/geometry/selection_routines.pyx":1794 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -28304,7 +30648,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_12GridSelector_select_cell(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1790 + /* "yt/geometry/selection_routines.pyx":1795 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * return 1 # <<<<<<<<<<<<<< @@ -28314,7 +30658,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1789 + /* "yt/geometry/selection_routines.pyx":1794 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -28327,7 +30671,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1792 +/* "yt/geometry/selection_routines.pyx":1797 * return 1 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -28338,7 +30682,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_12GridSelector_select_point(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1794 + /* "yt/geometry/selection_routines.pyx":1799 * cdef int select_point(self, np.float64_t pos[3]) nogil: * # we apparently don't check if the point actually lies in the grid.. * return 1 # <<<<<<<<<<<<<< @@ -28348,7 +30692,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1792 + /* "yt/geometry/selection_routines.pyx":1797 * return 1 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -28361,7 +30705,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1796 +/* "yt/geometry/selection_routines.pyx":1801 * return 1 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -28388,7 +30732,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":1797 + /* "yt/geometry/selection_routines.pyx":1802 * * def _hash_vals(self): * return (self.ind,) # <<<<<<<<<<<<<< @@ -28396,7 +30740,7 @@ * grid_selector = GridSelector */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1797, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->ind); __Pyx_GIVEREF(__pyx_v_self->ind); @@ -28405,7 +30749,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1796 + /* "yt/geometry/selection_routines.pyx":1801 * return 1 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -28424,7 +30768,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1803 +/* "(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_2yt_8geometry_18selection_routines_12GridSelector_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_12GridSelector_9__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_2yt_8geometry_18selection_routines_12GridSelector_8__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_12GridSelector_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *__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__58, 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("yt.geometry.selection_routines.GridSelector.__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_2yt_8geometry_18selection_routines_12GridSelector_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_12GridSelector_11__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_2yt_8geometry_18selection_routines_12GridSelector_10__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_12GridSelector_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *__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__59, 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("yt.geometry.selection_routines.GridSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":1808 * cdef class OctreeSubsetSelector(SelectorObject): * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -28447,6 +30898,7 @@ 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; } @@ -28457,7 +30909,7 @@ 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(0, 1803, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1808, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -28468,7 +30920,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1803, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1808, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.OctreeSubsetSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -28489,23 +30941,23 @@ __pyx_t_5numpy_int64_t __pyx_t_3; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":1804 + /* "yt/geometry/selection_routines.pyx":1809 * * def __init__(self, dobj): * self.base_selector = dobj.base_selector # <<<<<<<<<<<<<< * self.min_level = self.base_selector.min_level * self.max_level = self.base_selector.max_level */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_base_selector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_base_selector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 1804, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 1809, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->base_selector); __Pyx_DECREF(((PyObject *)__pyx_v_self->base_selector)); __pyx_v_self->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1805 + /* "yt/geometry/selection_routines.pyx":1810 * def __init__(self, dobj): * self.base_selector = dobj.base_selector * self.min_level = self.base_selector.min_level # <<<<<<<<<<<<<< @@ -28515,7 +30967,7 @@ __pyx_t_2 = __pyx_v_self->base_selector->min_level; __pyx_v_self->__pyx_base.min_level = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1806 + /* "yt/geometry/selection_routines.pyx":1811 * self.base_selector = dobj.base_selector * self.min_level = self.base_selector.min_level * self.max_level = self.base_selector.max_level # <<<<<<<<<<<<<< @@ -28525,20 +30977,20 @@ __pyx_t_2 = __pyx_v_self->base_selector->max_level; __pyx_v_self->__pyx_base.max_level = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1807 + /* "yt/geometry/selection_routines.pyx":1812 * self.min_level = self.base_selector.min_level * self.max_level = self.base_selector.max_level * self.domain_id = dobj.domain_id # <<<<<<<<<<<<<< * self.overlap_cells = 1 * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_domain_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1807, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_domain_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1812, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->domain_id = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":1808 + /* "yt/geometry/selection_routines.pyx":1813 * self.max_level = self.base_selector.max_level * self.domain_id = dobj.domain_id * self.overlap_cells = 1 # <<<<<<<<<<<<<< @@ -28547,7 +30999,7 @@ */ __pyx_v_self->__pyx_base.overlap_cells = 1; - /* "yt/geometry/selection_routines.pyx":1803 + /* "yt/geometry/selection_routines.pyx":1808 * cdef class OctreeSubsetSelector(SelectorObject): * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -28567,7 +31019,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1813 +/* "yt/geometry/selection_routines.pyx":1818 * @cython.wraparound(False) * @cython.cdivision(True) * def select_grids(self, # <<<<<<<<<<<<<< @@ -28592,8 +31044,11 @@ 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; } @@ -28602,19 +31057,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 1813, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 1818, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); __PYX_ERR(0, 1813, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); __PYX_ERR(0, 1818, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) __PYX_ERR(0, 1813, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) __PYX_ERR(0, 1818, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -28629,15 +31086,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1813, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1818, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.OctreeSubsetSelector.select_grids", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 1814, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 1815, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 1816, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 1819, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 1820, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 1821, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_2select_grids(((struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *)__pyx_v_self), __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_levels); /* function exit code */ @@ -28673,21 +31130,21 @@ __pyx_pybuffernd_levels.rcbuffer = &__pyx_pybuffer_levels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1813, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1818, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1813, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1818, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1813, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1818, __pyx_L1_error) } __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_levels.diminfo[1].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_levels.diminfo[1].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[1]; - /* "yt/geometry/selection_routines.pyx":1817 + /* "yt/geometry/selection_routines.pyx":1822 * np.ndarray[np.float64_t, ndim=2] right_edges, * np.ndarray[np.int32_t, ndim=2] levels): * raise RuntimeError # <<<<<<<<<<<<<< @@ -28695,9 +31152,9 @@ * @cython.boundscheck(False) */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 1817, __pyx_L1_error) + __PYX_ERR(0, 1822, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1813 + /* "yt/geometry/selection_routines.pyx":1818 * @cython.wraparound(False) * @cython.cdivision(True) * def select_grids(self, # <<<<<<<<<<<<<< @@ -28727,7 +31184,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1822 +/* "yt/geometry/selection_routines.pyx":1827 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -28738,7 +31195,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_select_sphere(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_radius) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1823 + /* "yt/geometry/selection_routines.pyx":1828 * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * return 1 # <<<<<<<<<<<<<< @@ -28748,7 +31205,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1822 + /* "yt/geometry/selection_routines.pyx":1827 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -28761,7 +31218,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1828 +/* "yt/geometry/selection_routines.pyx":1833 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -28772,7 +31229,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_select_cell(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1829 + /* "yt/geometry/selection_routines.pyx":1834 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * return 1 # <<<<<<<<<<<<<< @@ -28782,7 +31239,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1828 + /* "yt/geometry/selection_routines.pyx":1833 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -28795,7 +31252,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1834 +/* "yt/geometry/selection_routines.pyx":1839 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -28806,7 +31263,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_select_point(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1835 + /* "yt/geometry/selection_routines.pyx":1840 * @cython.cdivision(True) * cdef int select_point(self, np.float64_t pos[3]) nogil: * return 1 # <<<<<<<<<<<<<< @@ -28816,7 +31273,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1834 + /* "yt/geometry/selection_routines.pyx":1839 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -28829,7 +31286,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1840 +/* "yt/geometry/selection_routines.pyx":1845 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -28840,7 +31297,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1842 + /* "yt/geometry/selection_routines.pyx":1847 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * return self.base_selector.select_bbox(left_edge, right_edge) # <<<<<<<<<<<<<< @@ -28850,7 +31307,7 @@ __pyx_r = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->base_selector->__pyx_vtab)->select_bbox(__pyx_v_self->base_selector, __pyx_v_left_edge, __pyx_v_right_edge); goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1840 + /* "yt/geometry/selection_routines.pyx":1845 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -28863,7 +31320,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1847 +/* "yt/geometry/selection_routines.pyx":1852 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -28873,7 +31330,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_select_grid *__pyx_optional_args) { - /* "yt/geometry/selection_routines.pyx":1849 + /* "yt/geometry/selection_routines.pyx":1854 * cdef int select_grid(self, np.float64_t left_edge[3], * np.float64_t right_edge[3], np.int32_t level, * Oct *o = NULL) nogil: # <<<<<<<<<<<<<< @@ -28893,7 +31350,7 @@ } } - /* "yt/geometry/selection_routines.pyx":1853 + /* "yt/geometry/selection_routines.pyx":1858 * # checking this. * cdef int res * res = self.base_selector.select_grid(left_edge, right_edge, level, o) # <<<<<<<<<<<<<< @@ -28905,7 +31362,7 @@ __pyx_t_1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->base_selector->__pyx_vtab)->select_grid(__pyx_v_self->base_selector, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_level, &__pyx_t_2); __pyx_v_res = __pyx_t_1; - /* "yt/geometry/selection_routines.pyx":1854 + /* "yt/geometry/selection_routines.pyx":1859 * cdef int res * res = self.base_selector.select_grid(left_edge, right_edge, level, o) * if self.domain_id == -1: # <<<<<<<<<<<<<< @@ -28915,7 +31372,7 @@ __pyx_t_3 = ((__pyx_v_self->domain_id == -1LL) != 0); if (__pyx_t_3) { - /* "yt/geometry/selection_routines.pyx":1855 + /* "yt/geometry/selection_routines.pyx":1860 * res = self.base_selector.select_grid(left_edge, right_edge, level, o) * if self.domain_id == -1: * return res # <<<<<<<<<<<<<< @@ -28925,7 +31382,7 @@ __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1854 + /* "yt/geometry/selection_routines.pyx":1859 * cdef int res * res = self.base_selector.select_grid(left_edge, right_edge, level, o) * if self.domain_id == -1: # <<<<<<<<<<<<<< @@ -28934,7 +31391,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1856 + /* "yt/geometry/selection_routines.pyx":1861 * if self.domain_id == -1: * return res * elif res == 1 and o != NULL and o.domain != self.domain_id: # <<<<<<<<<<<<<< @@ -28958,7 +31415,7 @@ __pyx_L4_bool_binop_done:; if (__pyx_t_3) { - /* "yt/geometry/selection_routines.pyx":1857 + /* "yt/geometry/selection_routines.pyx":1862 * return res * elif res == 1 and o != NULL and o.domain != self.domain_id: * return -1 # <<<<<<<<<<<<<< @@ -28968,7 +31425,7 @@ __pyx_r = -1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1856 + /* "yt/geometry/selection_routines.pyx":1861 * if self.domain_id == -1: * return res * elif res == 1 and o != NULL and o.domain != self.domain_id: # <<<<<<<<<<<<<< @@ -28977,7 +31434,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1858 + /* "yt/geometry/selection_routines.pyx":1863 * elif res == 1 and o != NULL and o.domain != self.domain_id: * return -1 * return res # <<<<<<<<<<<<<< @@ -28987,7 +31444,7 @@ __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1847 + /* "yt/geometry/selection_routines.pyx":1852 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -29000,7 +31457,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1860 +/* "yt/geometry/selection_routines.pyx":1865 * return res * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -29030,7 +31487,7 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":1861 + /* "yt/geometry/selection_routines.pyx":1866 * * def _hash_vals(self): * return (hash(self.base_selector), self.domain_id) # <<<<<<<<<<<<<< @@ -29040,13 +31497,13 @@ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_v_self->base_selector); __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1861, __pyx_L1_error) + __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1866, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromHash_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1861, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromHash_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->domain_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1861, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->domain_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1861, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -29058,7 +31515,7 @@ __pyx_t_4 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1860 + /* "yt/geometry/selection_routines.pyx":1865 * return res * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -29079,12 +31536,12 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pxd":76 +/* "yt/geometry/selection_routines.pxd":72 * cdef class OctreeSubsetSelector(SelectorObject): * cdef SelectorObject base_selector * cdef public np.int64_t domain_id # <<<<<<<<<<<<<< * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, + * cdef class BooleanSelector(SelectorObject): */ /* Python wrapper */ @@ -29106,7 +31563,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->domain_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 76, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->domain_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -29141,7 +31598,7 @@ __Pyx_RefNannyDeclarations __pyx_t_5numpy_int64_t __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 76, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 72, __pyx_L1_error) __pyx_v_self->domain_id = __pyx_t_1; /* function exit code */ @@ -29155,7 +31612,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1874 +/* "(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_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_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_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_6__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__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__60, 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("yt.geometry.selection_routines.OctreeSubsetSelector.__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_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_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_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_8__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__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__61, 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("yt.geometry.selection_routines.OctreeSubsetSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":1879 * cdef np.float64_t DRE[3] * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -29178,6 +31742,7 @@ 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; } @@ -29188,7 +31753,7 @@ 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(0, 1874, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1879, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -29199,7 +31764,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1874, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1879, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.IndexedOctreeSubsetSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -29225,49 +31790,49 @@ __pyx_t_5numpy_float64_t __pyx_t_7; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":1875 + /* "yt/geometry/selection_routines.pyx":1880 * * def __init__(self, dobj): * self.min_ind = dobj.min_ind # <<<<<<<<<<<<<< * self.max_ind = dobj.max_ind * self.base_selector = dobj.base_selector */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_min_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1875, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_min_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1875, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1880, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->min_ind = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1876 + /* "yt/geometry/selection_routines.pyx":1881 * def __init__(self, dobj): * self.min_ind = dobj.min_ind * self.max_ind = dobj.max_ind # <<<<<<<<<<<<<< * self.base_selector = dobj.base_selector * self.min_level = self.base_selector.min_level */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_max_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1876, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_max_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1876, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1881, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->max_ind = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1877 + /* "yt/geometry/selection_routines.pyx":1882 * self.min_ind = dobj.min_ind * self.max_ind = dobj.max_ind * self.base_selector = dobj.base_selector # <<<<<<<<<<<<<< * self.min_level = self.base_selector.min_level * self.max_level = self.base_selector.max_level */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_base_selector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1877, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_base_selector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 1877, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->base_selector); __Pyx_DECREF(((PyObject *)__pyx_v_self->base_selector)); __pyx_v_self->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1878 + /* "yt/geometry/selection_routines.pyx":1883 * self.max_ind = dobj.max_ind * self.base_selector = dobj.base_selector * self.min_level = self.base_selector.min_level # <<<<<<<<<<<<<< @@ -29277,7 +31842,7 @@ __pyx_t_3 = __pyx_v_self->base_selector->min_level; __pyx_v_self->__pyx_base.min_level = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":1879 + /* "yt/geometry/selection_routines.pyx":1884 * self.base_selector = dobj.base_selector * self.min_level = self.base_selector.min_level * self.max_level = self.base_selector.max_level # <<<<<<<<<<<<<< @@ -29287,7 +31852,7 @@ __pyx_t_3 = __pyx_v_self->base_selector->max_level; __pyx_v_self->__pyx_base.max_level = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":1880 + /* "yt/geometry/selection_routines.pyx":1885 * self.min_level = self.base_selector.min_level * self.max_level = self.base_selector.max_level * self.filter_bbox = 0 # <<<<<<<<<<<<<< @@ -29296,23 +31861,23 @@ */ __pyx_v_self->filter_bbox = 0; - /* "yt/geometry/selection_routines.pyx":1881 + /* "yt/geometry/selection_routines.pyx":1886 * self.max_level = self.base_selector.max_level * self.filter_bbox = 0 * if getattr(dobj.ds, "filter_bbox", False): # <<<<<<<<<<<<<< * self.filter_bbox = 1 * for i in range(3): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetAttr3(__pyx_t_1, __pyx_n_s_filter_bbox, Py_False); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1881, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetAttr3(__pyx_t_1, __pyx_n_s_filter_bbox, Py_False); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1881, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "yt/geometry/selection_routines.pyx":1882 + /* "yt/geometry/selection_routines.pyx":1887 * self.filter_bbox = 0 * if getattr(dobj.ds, "filter_bbox", False): * self.filter_bbox = 1 # <<<<<<<<<<<<<< @@ -29321,7 +31886,7 @@ */ __pyx_v_self->filter_bbox = 1; - /* "yt/geometry/selection_routines.pyx":1881 + /* "yt/geometry/selection_routines.pyx":1886 * self.max_level = self.base_selector.max_level * self.filter_bbox = 0 * if getattr(dobj.ds, "filter_bbox", False): # <<<<<<<<<<<<<< @@ -29330,7 +31895,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1883 + /* "yt/geometry/selection_routines.pyx":1888 * if getattr(dobj.ds, "filter_bbox", False): * self.filter_bbox = 1 * for i in range(3): # <<<<<<<<<<<<<< @@ -29340,46 +31905,46 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/geometry/selection_routines.pyx":1884 + /* "yt/geometry/selection_routines.pyx":1889 * self.filter_bbox = 1 * for i in range(3): * self.DLE[i] = dobj.ds.domain_left_edge[i] # <<<<<<<<<<<<<< * self.DRE[i] = dobj.ds.domain_right_edge[i] * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1884, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_domain_left_edge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1884, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_domain_left_edge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1884, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1884, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1889, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_self->DLE[__pyx_v_i]) = __pyx_t_7; - /* "yt/geometry/selection_routines.pyx":1885 + /* "yt/geometry/selection_routines.pyx":1890 * for i in range(3): * self.DLE[i] = dobj.ds.domain_left_edge[i] * self.DRE[i] = dobj.ds.domain_right_edge[i] # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1885, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_ds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_domain_right_edge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1885, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_domain_right_edge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1885, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1885, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1890, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_self->DRE[__pyx_v_i]) = __pyx_t_7; } - /* "yt/geometry/selection_routines.pyx":1874 + /* "yt/geometry/selection_routines.pyx":1879 * cdef np.float64_t DRE[3] * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -29400,7 +31965,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1890 +/* "yt/geometry/selection_routines.pyx":1895 * @cython.wraparound(False) * @cython.cdivision(True) * def select_grids(self, # <<<<<<<<<<<<<< @@ -29425,8 +31990,11 @@ 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; } @@ -29435,19 +32003,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 1890, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 1895, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); __PYX_ERR(0, 1890, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); __PYX_ERR(0, 1895, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) __PYX_ERR(0, 1890, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) __PYX_ERR(0, 1895, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -29462,15 +32032,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1890, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1895, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.IndexedOctreeSubsetSelector.select_grids", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 1891, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 1892, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 1893, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 1896, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 1897, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 1898, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_2select_grids(((struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *)__pyx_v_self), __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_levels); /* function exit code */ @@ -29506,21 +32076,21 @@ __pyx_pybuffernd_levels.rcbuffer = &__pyx_pybuffer_levels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1890, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1895, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1890, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1895, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1890, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1895, __pyx_L1_error) } __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_levels.diminfo[1].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_levels.diminfo[1].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[1]; - /* "yt/geometry/selection_routines.pyx":1894 + /* "yt/geometry/selection_routines.pyx":1899 * np.ndarray[np.float64_t, ndim=2] right_edges, * np.ndarray[np.int32_t, ndim=2] levels): * raise RuntimeError # <<<<<<<<<<<<<< @@ -29528,9 +32098,9 @@ * @cython.boundscheck(False) */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 1894, __pyx_L1_error) + __PYX_ERR(0, 1899, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1890 + /* "yt/geometry/selection_routines.pyx":1895 * @cython.wraparound(False) * @cython.cdivision(True) * def select_grids(self, # <<<<<<<<<<<<<< @@ -29560,7 +32130,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1899 +/* "yt/geometry/selection_routines.pyx":1904 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -29571,7 +32141,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_select_sphere(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_radius) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1900 + /* "yt/geometry/selection_routines.pyx":1905 * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * return 1 # <<<<<<<<<<<<<< @@ -29581,7 +32151,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1899 + /* "yt/geometry/selection_routines.pyx":1904 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -29594,7 +32164,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1905 +/* "yt/geometry/selection_routines.pyx":1910 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -29605,7 +32175,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_select_cell(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1906 + /* "yt/geometry/selection_routines.pyx":1911 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * return 1 # <<<<<<<<<<<<<< @@ -29615,7 +32185,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1905 + /* "yt/geometry/selection_routines.pyx":1910 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -29628,7 +32198,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1911 +/* "yt/geometry/selection_routines.pyx":1916 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -29643,7 +32213,7 @@ int __pyx_t_2; int __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":1913 + /* "yt/geometry/selection_routines.pyx":1918 * cdef int select_point(self, np.float64_t pos[3]) nogil: * cdef int i * if self.filter_bbox == 0: # <<<<<<<<<<<<<< @@ -29653,7 +32223,7 @@ __pyx_t_1 = ((__pyx_v_self->filter_bbox == 0) != 0); if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":1914 + /* "yt/geometry/selection_routines.pyx":1919 * cdef int i * if self.filter_bbox == 0: * return 1 # <<<<<<<<<<<<<< @@ -29663,7 +32233,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1913 + /* "yt/geometry/selection_routines.pyx":1918 * cdef int select_point(self, np.float64_t pos[3]) nogil: * cdef int i * if self.filter_bbox == 0: # <<<<<<<<<<<<<< @@ -29672,7 +32242,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":1915 + /* "yt/geometry/selection_routines.pyx":1920 * if self.filter_bbox == 0: * return 1 * for i in range(3): # <<<<<<<<<<<<<< @@ -29682,7 +32252,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1916 + /* "yt/geometry/selection_routines.pyx":1921 * return 1 * for i in range(3): * if pos[i] < self.DLE[i] or pos[i] > self.DRE[i]: # <<<<<<<<<<<<<< @@ -29700,7 +32270,7 @@ __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":1917 + /* "yt/geometry/selection_routines.pyx":1922 * for i in range(3): * if pos[i] < self.DLE[i] or pos[i] > self.DRE[i]: * return 0 # <<<<<<<<<<<<<< @@ -29710,7 +32280,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1916 + /* "yt/geometry/selection_routines.pyx":1921 * return 1 * for i in range(3): * if pos[i] < self.DLE[i] or pos[i] > self.DRE[i]: # <<<<<<<<<<<<<< @@ -29720,7 +32290,7 @@ } } - /* "yt/geometry/selection_routines.pyx":1918 + /* "yt/geometry/selection_routines.pyx":1923 * if pos[i] < self.DLE[i] or pos[i] > self.DRE[i]: * return 0 * return 1 # <<<<<<<<<<<<<< @@ -29730,7 +32300,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1911 + /* "yt/geometry/selection_routines.pyx":1916 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -29743,7 +32313,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1923 +/* "yt/geometry/selection_routines.pyx":1928 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -29754,7 +32324,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1925 + /* "yt/geometry/selection_routines.pyx":1930 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * return self.base_selector.select_bbox(left_edge, right_edge) # <<<<<<<<<<<<<< @@ -29764,7 +32334,7 @@ __pyx_r = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->base_selector->__pyx_vtab)->select_bbox(__pyx_v_self->base_selector, __pyx_v_left_edge, __pyx_v_right_edge); goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1923 + /* "yt/geometry/selection_routines.pyx":1928 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -29777,7 +32347,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1927 +/* "yt/geometry/selection_routines.pyx":1932 * return self.base_selector.select_bbox(left_edge, right_edge) * * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -29787,7 +32357,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_select_grid *__pyx_optional_args) { - /* "yt/geometry/selection_routines.pyx":1929 + /* "yt/geometry/selection_routines.pyx":1934 * cdef int select_grid(self, np.float64_t left_edge[3], * np.float64_t right_edge[3], np.int32_t level, * Oct *o = NULL) nogil: # <<<<<<<<<<<<<< @@ -29804,7 +32374,7 @@ } } - /* "yt/geometry/selection_routines.pyx":1932 + /* "yt/geometry/selection_routines.pyx":1937 * # Because visitors now use select_grid, we should be explicitly * # checking this. * return self.base_selector.select_grid(left_edge, right_edge, level, o) # <<<<<<<<<<<<<< @@ -29817,7 +32387,7 @@ __pyx_r = __pyx_t_1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1927 + /* "yt/geometry/selection_routines.pyx":1932 * return self.base_selector.select_bbox(left_edge, right_edge) * * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -29830,7 +32400,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1934 +/* "yt/geometry/selection_routines.pyx":1939 * return self.base_selector.select_grid(left_edge, right_edge, level, o) * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -29861,7 +32431,7 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":1935 + /* "yt/geometry/selection_routines.pyx":1940 * * def _hash_vals(self): * return (hash(self.base_selector), self.min_ind, self.max_ind) # <<<<<<<<<<<<<< @@ -29871,15 +32441,15 @@ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_v_self->base_selector); __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1935, __pyx_L1_error) + __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1940, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromHash_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1935, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromHash_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->min_ind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1935, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->min_ind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->max_ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1935, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->max_ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1935, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); @@ -29894,7 +32464,7 @@ __pyx_t_5 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1934 + /* "yt/geometry/selection_routines.pyx":1939 * return self.base_selector.select_grid(left_edge, right_edge, level, o) * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -29916,7 +32486,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1941 +/* "(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_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_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_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_6__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *__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__62, 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("yt.geometry.selection_routines.IndexedOctreeSubsetSelector.__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_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_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_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_8__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *__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__63, 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("yt.geometry.selection_routines.IndexedOctreeSubsetSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":1946 * cdef class AlwaysSelector(SelectorObject): * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -29939,6 +32616,7 @@ 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; } @@ -29949,7 +32627,7 @@ 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(0, 1941, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1946, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -29960,7 +32638,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1941, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1946, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.AlwaysSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -29978,7 +32656,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":1942 + /* "yt/geometry/selection_routines.pyx":1947 * * def __init__(self, dobj): * self.overlap_cells = 1 # <<<<<<<<<<<<<< @@ -29987,7 +32665,7 @@ */ __pyx_v_self->__pyx_base.overlap_cells = 1; - /* "yt/geometry/selection_routines.pyx":1941 + /* "yt/geometry/selection_routines.pyx":1946 * cdef class AlwaysSelector(SelectorObject): * * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -30001,7 +32679,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1947 +/* "yt/geometry/selection_routines.pyx":1952 * @cython.wraparound(False) * @cython.cdivision(True) * def select_grids(self, # <<<<<<<<<<<<<< @@ -30026,8 +32704,11 @@ 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; } @@ -30036,19 +32717,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 1947, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 1952, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); __PYX_ERR(0, 1947, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); __PYX_ERR(0, 1952, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) __PYX_ERR(0, 1947, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) __PYX_ERR(0, 1952, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -30063,15 +32746,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1947, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1952, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.AlwaysSelector.select_grids", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 1948, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 1949, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 1950, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 1953, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 1954, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 1955, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_14AlwaysSelector_2select_grids(((struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *)__pyx_v_self), __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_levels); /* function exit code */ @@ -30120,21 +32803,21 @@ __pyx_pybuffernd_levels.rcbuffer = &__pyx_pybuffer_levels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1947, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1952, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1947, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1952, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1947, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1952, __pyx_L1_error) } __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_levels.diminfo[1].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_levels.diminfo[1].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[1]; - /* "yt/geometry/selection_routines.pyx":1951 + /* "yt/geometry/selection_routines.pyx":1956 * np.ndarray[np.float64_t, ndim=2] right_edges, * np.ndarray[np.int32_t, ndim=2] levels): * cdef int ng = left_edges.shape[0] # <<<<<<<<<<<<<< @@ -30143,40 +32826,40 @@ */ __pyx_v_ng = (__pyx_v_left_edges->dimensions[0]); - /* "yt/geometry/selection_routines.pyx":1952 + /* "yt/geometry/selection_routines.pyx":1957 * np.ndarray[np.int32_t, ndim=2] levels): * cdef int ng = left_edges.shape[0] * cdef np.ndarray[np.uint8_t, ndim=1] gridi = np.ones(ng, dtype='uint8') # <<<<<<<<<<<<<< * return gridi.astype("bool") * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1952, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1952, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1957, __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_ng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1952, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1952, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1957, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1952, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 1952, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1952, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 1957, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1957, __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_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, 1952, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1957, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gridi.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_gridi = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_gridi.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1952, __pyx_L1_error) + __PYX_ERR(0, 1957, __pyx_L1_error) } else {__pyx_pybuffernd_gridi.diminfo[0].strides = __pyx_pybuffernd_gridi.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gridi.diminfo[0].shape = __pyx_pybuffernd_gridi.rcbuffer->pybuffer.shape[0]; } } @@ -30184,7 +32867,7 @@ __pyx_v_gridi = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":1953 + /* "yt/geometry/selection_routines.pyx":1958 * cdef int ng = left_edges.shape[0] * cdef np.ndarray[np.uint8_t, ndim=1] gridi = np.ones(ng, dtype='uint8') * return gridi.astype("bool") # <<<<<<<<<<<<<< @@ -30192,16 +32875,16 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_gridi), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1953, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_gridi), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1953, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1947 + /* "yt/geometry/selection_routines.pyx":1952 * @cython.wraparound(False) * @cython.cdivision(True) * def select_grids(self, # <<<<<<<<<<<<<< @@ -30239,7 +32922,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1958 +/* "yt/geometry/selection_routines.pyx":1963 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -30250,7 +32933,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_14AlwaysSelector_select_cell(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1959 + /* "yt/geometry/selection_routines.pyx":1964 * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * return 1 # <<<<<<<<<<<<<< @@ -30260,7 +32943,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1958 + /* "yt/geometry/selection_routines.pyx":1963 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -30273,7 +32956,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1961 +/* "yt/geometry/selection_routines.pyx":1966 * return 1 * * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -30286,7 +32969,7 @@ if (__pyx_optional_args) { } - /* "yt/geometry/selection_routines.pyx":1964 + /* "yt/geometry/selection_routines.pyx":1969 * np.float64_t right_edge[3], np.int32_t level, * Oct *o = NULL) nogil: * return 1 # <<<<<<<<<<<<<< @@ -30296,7 +32979,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1961 + /* "yt/geometry/selection_routines.pyx":1966 * return 1 * * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -30309,7 +32992,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1966 +/* "yt/geometry/selection_routines.pyx":1971 * return 1 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -30320,7 +33003,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_14AlwaysSelector_select_point(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1967 + /* "yt/geometry/selection_routines.pyx":1972 * * cdef int select_point(self, np.float64_t pos[3]) nogil: * return 1 # <<<<<<<<<<<<<< @@ -30330,7 +33013,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1966 + /* "yt/geometry/selection_routines.pyx":1971 * return 1 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -30343,7 +33026,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1969 +/* "yt/geometry/selection_routines.pyx":1974 * return 1 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -30354,7 +33037,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_14AlwaysSelector_select_sphere(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_radius) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1970 + /* "yt/geometry/selection_routines.pyx":1975 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * return 1 # <<<<<<<<<<<<<< @@ -30364,7 +33047,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1969 + /* "yt/geometry/selection_routines.pyx":1974 * return 1 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -30377,7 +33060,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1972 +/* "yt/geometry/selection_routines.pyx":1977 * return 1 * * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -30388,7 +33071,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_14AlwaysSelector_select_bbox(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { int __pyx_r; - /* "yt/geometry/selection_routines.pyx":1974 + /* "yt/geometry/selection_routines.pyx":1979 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * return 1 # <<<<<<<<<<<<<< @@ -30398,7 +33081,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1972 + /* "yt/geometry/selection_routines.pyx":1977 * return 1 * * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -30411,7 +33094,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1976 +/* "yt/geometry/selection_routines.pyx":1981 * return 1 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -30437,7 +33120,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":1977 + /* "yt/geometry/selection_routines.pyx":1982 * * def _hash_vals(self): * return ("always", 1,) # <<<<<<<<<<<<<< @@ -30445,11 +33128,11 @@ * always_selector = AlwaysSelector */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_tuple__33); - __pyx_r = __pyx_tuple__33; + __Pyx_INCREF(__pyx_tuple__65); + __pyx_r = __pyx_tuple__65; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1976 + /* "yt/geometry/selection_routines.pyx":1981 * return 1 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -30464,7 +33147,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1985 +/* "(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_2yt_8geometry_18selection_routines_14AlwaysSelector_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_14AlwaysSelector_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_2yt_8geometry_18selection_routines_14AlwaysSelector_6__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14AlwaysSelector_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *__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__66, 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("yt.geometry.selection_routines.AlwaysSelector.__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_2yt_8geometry_18selection_routines_14AlwaysSelector_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_14AlwaysSelector_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_2yt_8geometry_18selection_routines_14AlwaysSelector_8__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_14AlwaysSelector_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *__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__67, 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("yt.geometry.selection_routines.AlwaysSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":1990 * cdef SelectorObject selector2 * * def __init__(self, dobj, selector1, selector2): # <<<<<<<<<<<<<< @@ -30489,8 +33279,11 @@ 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; } @@ -30499,19 +33292,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dobj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 1985, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 1990, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 1985, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 1990, __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, 1985, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1990, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -30526,7 +33321,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1985, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1990, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.ComposeSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -30545,14 +33340,14 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":1986 + /* "yt/geometry/selection_routines.pyx":1991 * * def __init__(self, dobj, selector1, selector2): * self.selector1 = selector1 # <<<<<<<<<<<<<< * self.selector2 = selector2 * */ - if (!(likely(((__pyx_v_selector1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_selector1, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 1986, __pyx_L1_error) + if (!(likely(((__pyx_v_selector1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_selector1, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 1991, __pyx_L1_error) __pyx_t_1 = __pyx_v_selector1; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -30561,14 +33356,14 @@ __pyx_v_self->selector1 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1987 + /* "yt/geometry/selection_routines.pyx":1992 * def __init__(self, dobj, selector1, selector2): * self.selector1 = selector1 * self.selector2 = selector2 # <<<<<<<<<<<<<< * * def select_grids(self, */ - if (!(likely(((__pyx_v_selector2) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_selector2, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 1987, __pyx_L1_error) + if (!(likely(((__pyx_v_selector2) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_selector2, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 1992, __pyx_L1_error) __pyx_t_1 = __pyx_v_selector2; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -30577,7 +33372,7 @@ __pyx_v_self->selector2 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":1985 + /* "yt/geometry/selection_routines.pyx":1990 * cdef SelectorObject selector2 * * def __init__(self, dobj, selector1, selector2): # <<<<<<<<<<<<<< @@ -30597,7 +33392,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1989 +/* "yt/geometry/selection_routines.pyx":1994 * self.selector2 = selector2 * * def select_grids(self, # <<<<<<<<<<<<<< @@ -30622,8 +33417,11 @@ 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; } @@ -30632,19 +33430,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 1989, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); __PYX_ERR(0, 1994, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); __PYX_ERR(0, 1989, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); __PYX_ERR(0, 1994, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) __PYX_ERR(0, 1989, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) __PYX_ERR(0, 1994, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -30659,15 +33459,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1989, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1994, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.ComposeSelector.select_grids", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 1990, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 1991, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 1992, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 1995, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 1996, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 1997, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_15ComposeSelector_2select_grids(((struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *)__pyx_v_self), __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_levels); /* function exit code */ @@ -30711,21 +33511,21 @@ __pyx_pybuffernd_levels.rcbuffer = &__pyx_pybuffer_levels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1989, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1994, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1989, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1994, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1989, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1994, __pyx_L1_error) } __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_levels.diminfo[1].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_levels.diminfo[1].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[1]; - /* "yt/geometry/selection_routines.pyx":1993 + /* "yt/geometry/selection_routines.pyx":1998 * np.ndarray[np.float64_t, ndim=2] right_edges, * np.ndarray[np.int32_t, ndim=2] levels): * return np.logical_or( # <<<<<<<<<<<<<< @@ -30733,20 +33533,20 @@ * self.selector2.select_grids(left_edges, right_edges, levels)) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1993, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logical_or); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1993, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logical_or); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/geometry/selection_routines.pyx":1994 + /* "yt/geometry/selection_routines.pyx":1999 * np.ndarray[np.int32_t, ndim=2] levels): * return np.logical_or( * self.selector1.select_grids(left_edges, right_edges, levels), # <<<<<<<<<<<<<< * self.selector2.select_grids(left_edges, right_edges, levels)) * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->selector1), __pyx_n_s_select_grids); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1994, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->selector1), __pyx_n_s_select_grids); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -30763,7 +33563,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_left_edges), ((PyObject *)__pyx_v_right_edges), ((PyObject *)__pyx_v_levels)}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1994, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1999, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -30771,13 +33571,13 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_left_edges), ((PyObject *)__pyx_v_right_edges), ((PyObject *)__pyx_v_levels)}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1994, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1999, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1994, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -30791,20 +33591,20 @@ __Pyx_INCREF(((PyObject *)__pyx_v_levels)); __Pyx_GIVEREF(((PyObject *)__pyx_v_levels)); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_levels)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1994, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pyx":1995 + /* "yt/geometry/selection_routines.pyx":2000 * return np.logical_or( * self.selector1.select_grids(left_edges, right_edges, levels), * self.selector2.select_grids(left_edges, right_edges, levels)) # <<<<<<<<<<<<<< * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->selector2), __pyx_n_s_select_grids); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1995, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->selector2), __pyx_n_s_select_grids); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -30821,7 +33621,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_left_edges), ((PyObject *)__pyx_v_right_edges), ((PyObject *)__pyx_v_levels)}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else @@ -30829,13 +33629,13 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_left_edges), ((PyObject *)__pyx_v_right_edges), ((PyObject *)__pyx_v_levels)}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { - __pyx_t_8 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1995, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2000, __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; @@ -30849,7 +33649,7 @@ __Pyx_INCREF(((PyObject *)__pyx_v_levels)); __Pyx_GIVEREF(((PyObject *)__pyx_v_levels)); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_6, ((PyObject *)__pyx_v_levels)); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -30869,7 +33669,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1993, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -30879,7 +33679,7 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1993, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -30887,7 +33687,7 @@ } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1993, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -30898,7 +33698,7 @@ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1993, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -30907,7 +33707,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1989 + /* "yt/geometry/selection_routines.pyx":1994 * self.selector2 = selector2 * * def select_grids(self, # <<<<<<<<<<<<<< @@ -30945,7 +33745,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":1997 +/* "yt/geometry/selection_routines.pyx":2002 * self.selector2.select_grids(left_edges, right_edges, levels)) * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -30958,7 +33758,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":1998 + /* "yt/geometry/selection_routines.pyx":2003 * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if self.selector1.select_cell(pos, dds) and \ # <<<<<<<<<<<<<< @@ -30972,7 +33772,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":1999 + /* "yt/geometry/selection_routines.pyx":2004 * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if self.selector1.select_cell(pos, dds) and \ * self.selector2.select_cell(pos, dds): # <<<<<<<<<<<<<< @@ -30983,7 +33783,7 @@ __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":1998 + /* "yt/geometry/selection_routines.pyx":2003 * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if self.selector1.select_cell(pos, dds) and \ # <<<<<<<<<<<<<< @@ -30992,7 +33792,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":2000 + /* "yt/geometry/selection_routines.pyx":2005 * if self.selector1.select_cell(pos, dds) and \ * self.selector2.select_cell(pos, dds): * return 1 # <<<<<<<<<<<<<< @@ -31002,7 +33802,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":1998 + /* "yt/geometry/selection_routines.pyx":2003 * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: * if self.selector1.select_cell(pos, dds) and \ # <<<<<<<<<<<<<< @@ -31011,7 +33811,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":2002 + /* "yt/geometry/selection_routines.pyx":2007 * return 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -31023,7 +33823,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":1997 + /* "yt/geometry/selection_routines.pyx":2002 * self.selector2.select_grids(left_edges, right_edges, levels)) * * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< @@ -31036,7 +33836,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":2004 +/* "yt/geometry/selection_routines.pyx":2009 * return 0 * * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -31046,7 +33846,7 @@ static int __pyx_f_2yt_8geometry_18selection_routines_15ComposeSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_15ComposeSelector_select_grid *__pyx_optional_args) { - /* "yt/geometry/selection_routines.pyx":2006 + /* "yt/geometry/selection_routines.pyx":2011 * cdef int select_grid(self, np.float64_t left_edge[3], * np.float64_t right_edge[3], np.int32_t level, * Oct *o = NULL) nogil: # <<<<<<<<<<<<<< @@ -31065,7 +33865,7 @@ } } - /* "yt/geometry/selection_routines.pyx":2007 + /* "yt/geometry/selection_routines.pyx":2012 * np.float64_t right_edge[3], np.int32_t level, * Oct *o = NULL) nogil: * if self.selector1.select_grid(left_edge, right_edge, level, o) or \ # <<<<<<<<<<<<<< @@ -31082,7 +33882,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":2008 + /* "yt/geometry/selection_routines.pyx":2013 * Oct *o = NULL) nogil: * if self.selector1.select_grid(left_edge, right_edge, level, o) or \ * self.selector2.select_grid(left_edge, right_edge, level, o): # <<<<<<<<<<<<<< @@ -31096,7 +33896,7 @@ __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":2007 + /* "yt/geometry/selection_routines.pyx":2012 * np.float64_t right_edge[3], np.int32_t level, * Oct *o = NULL) nogil: * if self.selector1.select_grid(left_edge, right_edge, level, o) or \ # <<<<<<<<<<<<<< @@ -31105,7 +33905,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":2009 + /* "yt/geometry/selection_routines.pyx":2014 * if self.selector1.select_grid(left_edge, right_edge, level, o) or \ * self.selector2.select_grid(left_edge, right_edge, level, o): * return 1 # <<<<<<<<<<<<<< @@ -31115,7 +33915,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":2007 + /* "yt/geometry/selection_routines.pyx":2012 * np.float64_t right_edge[3], np.int32_t level, * Oct *o = NULL) nogil: * if self.selector1.select_grid(left_edge, right_edge, level, o) or \ # <<<<<<<<<<<<<< @@ -31124,7 +33924,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":2011 + /* "yt/geometry/selection_routines.pyx":2016 * return 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -31136,7 +33936,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":2004 + /* "yt/geometry/selection_routines.pyx":2009 * return 0 * * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -31149,7 +33949,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":2013 +/* "yt/geometry/selection_routines.pyx":2018 * return 0 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -31162,7 +33962,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":2014 + /* "yt/geometry/selection_routines.pyx":2019 * * cdef int select_point(self, np.float64_t pos[3]) nogil: * if self.selector1.select_point(pos) and \ # <<<<<<<<<<<<<< @@ -31176,7 +33976,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":2015 + /* "yt/geometry/selection_routines.pyx":2020 * cdef int select_point(self, np.float64_t pos[3]) nogil: * if self.selector1.select_point(pos) and \ * self.selector2.select_point(pos): # <<<<<<<<<<<<<< @@ -31187,7 +33987,7 @@ __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":2014 + /* "yt/geometry/selection_routines.pyx":2019 * * cdef int select_point(self, np.float64_t pos[3]) nogil: * if self.selector1.select_point(pos) and \ # <<<<<<<<<<<<<< @@ -31196,7 +33996,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":2016 + /* "yt/geometry/selection_routines.pyx":2021 * if self.selector1.select_point(pos) and \ * self.selector2.select_point(pos): * return 1 # <<<<<<<<<<<<<< @@ -31206,7 +34006,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":2014 + /* "yt/geometry/selection_routines.pyx":2019 * * cdef int select_point(self, np.float64_t pos[3]) nogil: * if self.selector1.select_point(pos) and \ # <<<<<<<<<<<<<< @@ -31215,7 +34015,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":2018 + /* "yt/geometry/selection_routines.pyx":2023 * return 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -31227,7 +34027,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":2013 + /* "yt/geometry/selection_routines.pyx":2018 * return 0 * * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< @@ -31240,7 +34040,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":2020 +/* "yt/geometry/selection_routines.pyx":2025 * return 0 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -31253,7 +34053,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":2021 + /* "yt/geometry/selection_routines.pyx":2026 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * if self.selector1.select_sphere(pos, radius) and \ # <<<<<<<<<<<<<< @@ -31267,7 +34067,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":2022 + /* "yt/geometry/selection_routines.pyx":2027 * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * if self.selector1.select_sphere(pos, radius) and \ * self.selector2.select_sphere(pos, radius): # <<<<<<<<<<<<<< @@ -31278,7 +34078,7 @@ __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":2021 + /* "yt/geometry/selection_routines.pyx":2026 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * if self.selector1.select_sphere(pos, radius) and \ # <<<<<<<<<<<<<< @@ -31287,7 +34087,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":2023 + /* "yt/geometry/selection_routines.pyx":2028 * if self.selector1.select_sphere(pos, radius) and \ * self.selector2.select_sphere(pos, radius): * return 1 # <<<<<<<<<<<<<< @@ -31297,7 +34097,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":2021 + /* "yt/geometry/selection_routines.pyx":2026 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: * if self.selector1.select_sphere(pos, radius) and \ # <<<<<<<<<<<<<< @@ -31306,7 +34106,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":2025 + /* "yt/geometry/selection_routines.pyx":2030 * return 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -31318,7 +34118,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":2020 + /* "yt/geometry/selection_routines.pyx":2025 * return 0 * * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< @@ -31331,7 +34131,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":2027 +/* "yt/geometry/selection_routines.pyx":2032 * return 0 * * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -31344,7 +34144,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/geometry/selection_routines.pyx":2029 + /* "yt/geometry/selection_routines.pyx":2034 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * if self.selector1.select_bbox(left_edge, right_edge) and \ # <<<<<<<<<<<<<< @@ -31358,7 +34158,7 @@ goto __pyx_L4_bool_binop_done; } - /* "yt/geometry/selection_routines.pyx":2030 + /* "yt/geometry/selection_routines.pyx":2035 * np.float64_t right_edge[3]) nogil: * if self.selector1.select_bbox(left_edge, right_edge) and \ * self.selector2.select_bbox(left_edge, right_edge): # <<<<<<<<<<<<<< @@ -31369,7 +34169,7 @@ __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "yt/geometry/selection_routines.pyx":2029 + /* "yt/geometry/selection_routines.pyx":2034 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * if self.selector1.select_bbox(left_edge, right_edge) and \ # <<<<<<<<<<<<<< @@ -31378,7 +34178,7 @@ */ if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pyx":2031 + /* "yt/geometry/selection_routines.pyx":2036 * if self.selector1.select_bbox(left_edge, right_edge) and \ * self.selector2.select_bbox(left_edge, right_edge): * return 1 # <<<<<<<<<<<<<< @@ -31388,7 +34188,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":2029 + /* "yt/geometry/selection_routines.pyx":2034 * cdef int select_bbox(self, np.float64_t left_edge[3], * np.float64_t right_edge[3]) nogil: * if self.selector1.select_bbox(left_edge, right_edge) and \ # <<<<<<<<<<<<<< @@ -31397,7 +34197,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":2033 + /* "yt/geometry/selection_routines.pyx":2038 * return 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -31409,7 +34209,7 @@ goto __pyx_L0; } - /* "yt/geometry/selection_routines.pyx":2027 + /* "yt/geometry/selection_routines.pyx":2032 * return 0 * * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -31422,7 +34222,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":2035 +/* "yt/geometry/selection_routines.pyx":2040 * return 0 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -31452,7 +34252,7 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":2036 + /* "yt/geometry/selection_routines.pyx":2041 * * def _hash_vals(self): * return (hash(self.selector1), hash(self.selector2)) # <<<<<<<<<<<<<< @@ -31462,17 +34262,17 @@ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_v_self->selector1); __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2036, __pyx_L1_error) + __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2041, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromHash_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2036, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromHash_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_v_self->selector2); __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = PyObject_Hash(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2036, __pyx_L1_error) + __pyx_t_2 = PyObject_Hash(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2041, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_FromHash_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2036, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromHash_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2036, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -31484,7 +34284,7 @@ __pyx_t_4 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":2035 + /* "yt/geometry/selection_routines.pyx":2040 * return 0 * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -31505,7 +34305,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":2045 +/* "(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_2yt_8geometry_18selection_routines_15ComposeSelector_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_15ComposeSelector_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_2yt_8geometry_18selection_routines_15ComposeSelector_6__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15ComposeSelector_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *__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__68, 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("yt.geometry.selection_routines.ComposeSelector.__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_2yt_8geometry_18selection_routines_15ComposeSelector_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_15ComposeSelector_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_2yt_8geometry_18selection_routines_15ComposeSelector_8__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15ComposeSelector_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *__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__69, 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("yt.geometry.selection_routines.ComposeSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2050 * cdef object pind * cdef public np.int64_t halo_id * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -31528,6 +34435,7 @@ 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; } @@ -31538,7 +34446,7 @@ 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(0, 2045, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2050, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -31549,7 +34457,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2045, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2050, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.HaloParticlesSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -31568,14 +34476,14 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/geometry/selection_routines.pyx":2046 + /* "yt/geometry/selection_routines.pyx":2051 * cdef public np.int64_t halo_id * def __init__(self, dobj): * self.base_source = dobj.base_source # <<<<<<<<<<<<<< * self.base_selector = self.base_source.selector * self.pind = dobj.particle_indices */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_base_source); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2046, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_base_source); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->base_source); @@ -31583,30 +34491,30 @@ __pyx_v_self->base_source = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":2047 + /* "yt/geometry/selection_routines.pyx":2052 * def __init__(self, dobj): * self.base_source = dobj.base_source * self.base_selector = self.base_source.selector # <<<<<<<<<<<<<< * self.pind = dobj.particle_indices * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->base_source, __pyx_n_s_selector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2047, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->base_source, __pyx_n_s_selector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 2047, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 2052, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->base_selector); __Pyx_DECREF(((PyObject *)__pyx_v_self->base_selector)); __pyx_v_self->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":2048 + /* "yt/geometry/selection_routines.pyx":2053 * self.base_source = dobj.base_source * self.base_selector = self.base_source.selector * self.pind = dobj.particle_indices # <<<<<<<<<<<<<< * * def _hash_vals(self): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_particle_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2048, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_particle_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->pind); @@ -31614,7 +34522,7 @@ __pyx_v_self->pind = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/geometry/selection_routines.pyx":2045 + /* "yt/geometry/selection_routines.pyx":2050 * cdef object pind * cdef public np.int64_t halo_id * def __init__(self, dobj): # <<<<<<<<<<<<<< @@ -31634,7 +34542,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":2050 +/* "yt/geometry/selection_routines.pyx":2055 * self.pind = dobj.particle_indices * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -31662,7 +34570,7 @@ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "yt/geometry/selection_routines.pyx":2051 + /* "yt/geometry/selection_routines.pyx":2056 * * def _hash_vals(self): * return ("halo_particles", self.halo_id) # <<<<<<<<<<<<<< @@ -31670,9 +34578,9 @@ * halo_particles_selector = HaloParticlesSelector */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->halo_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2051, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->halo_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2051, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_halo_particles); __Pyx_GIVEREF(__pyx_n_s_halo_particles); @@ -31684,7 +34592,7 @@ __pyx_t_2 = 0; goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":2050 + /* "yt/geometry/selection_routines.pyx":2055 * self.pind = dobj.particle_indices * * def _hash_vals(self): # <<<<<<<<<<<<<< @@ -31704,7 +34612,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":2041 +/* "yt/geometry/selection_routines.pyx":2046 * * cdef class HaloParticlesSelector(SelectorObject): * cdef public object base_source # <<<<<<<<<<<<<< @@ -31799,7 +34707,7 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":2044 +/* "yt/geometry/selection_routines.pyx":2049 * cdef SelectorObject base_selector * cdef object pind * cdef public np.int64_t halo_id # <<<<<<<<<<<<<< @@ -31826,7 +34734,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->halo_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2044, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->halo_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -31861,7 +34769,7 @@ __Pyx_RefNannyDeclarations __pyx_t_5numpy_int64_t __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2044, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2049, __pyx_L1_error) __pyx_v_self->halo_id = __pyx_t_1; /* function exit code */ @@ -31875,7 +34783,114 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pyx":2058 +/* "(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_2yt_8geometry_18selection_routines_21HaloParticlesSelector_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_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_2yt_8geometry_18selection_routines_21HaloParticlesSelector_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_21HaloParticlesSelector_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *__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__70, 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("yt.geometry.selection_routines.HaloParticlesSelector.__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_2yt_8geometry_18selection_routines_21HaloParticlesSelector_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_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_2yt_8geometry_18selection_routines_21HaloParticlesSelector_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_21HaloParticlesSelector_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *__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__71, 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("yt.geometry.selection_routines.HaloParticlesSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2063 * @cython.boundscheck(False) * @cython.wraparound(False) * def points_in_cells( # <<<<<<<<<<<<<< @@ -31907,14 +34922,23 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -31923,49 +34947,57 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 1); __PYX_ERR(0, 2058, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 1); __PYX_ERR(0, 2063, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cz)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 2); __PYX_ERR(0, 2058, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 2); __PYX_ERR(0, 2063, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 3); __PYX_ERR(0, 2058, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 3); __PYX_ERR(0, 2063, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 4); __PYX_ERR(0, 2058, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 4); __PYX_ERR(0, 2063, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dz)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 5); __PYX_ERR(0, 2058, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 5); __PYX_ERR(0, 2063, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 6); __PYX_ERR(0, 2058, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 6); __PYX_ERR(0, 2063, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 7); __PYX_ERR(0, 2058, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 7); __PYX_ERR(0, 2063, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pz)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 8); __PYX_ERR(0, 2058, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, 8); __PYX_ERR(0, 2063, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "points_in_cells") < 0)) __PYX_ERR(0, 2058, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "points_in_cells") < 0)) __PYX_ERR(0, 2063, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; @@ -31980,19 +35012,19 @@ values[7] = PyTuple_GET_ITEM(__pyx_args, 7); values[8] = PyTuple_GET_ITEM(__pyx_args, 8); } - __pyx_v_cx = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_cx.memview)) __PYX_ERR(0, 2059, __pyx_L3_error) - __pyx_v_cy = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_cy.memview)) __PYX_ERR(0, 2060, __pyx_L3_error) - __pyx_v_cz = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_cz.memview)) __PYX_ERR(0, 2061, __pyx_L3_error) - __pyx_v_dx = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_dx.memview)) __PYX_ERR(0, 2062, __pyx_L3_error) - __pyx_v_dy = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[4]); if (unlikely(!__pyx_v_dy.memview)) __PYX_ERR(0, 2063, __pyx_L3_error) - __pyx_v_dz = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[5]); if (unlikely(!__pyx_v_dz.memview)) __PYX_ERR(0, 2064, __pyx_L3_error) - __pyx_v_px = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[6]); if (unlikely(!__pyx_v_px.memview)) __PYX_ERR(0, 2065, __pyx_L3_error) - __pyx_v_py = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[7]); if (unlikely(!__pyx_v_py.memview)) __PYX_ERR(0, 2066, __pyx_L3_error) - __pyx_v_pz = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[8]); if (unlikely(!__pyx_v_pz.memview)) __PYX_ERR(0, 2067, __pyx_L3_error) + __pyx_v_cx = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_cx.memview)) __PYX_ERR(0, 2064, __pyx_L3_error) + __pyx_v_cy = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_cy.memview)) __PYX_ERR(0, 2065, __pyx_L3_error) + __pyx_v_cz = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_cz.memview)) __PYX_ERR(0, 2066, __pyx_L3_error) + __pyx_v_dx = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_dx.memview)) __PYX_ERR(0, 2067, __pyx_L3_error) + __pyx_v_dy = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[4]); if (unlikely(!__pyx_v_dy.memview)) __PYX_ERR(0, 2068, __pyx_L3_error) + __pyx_v_dz = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[5]); if (unlikely(!__pyx_v_dz.memview)) __PYX_ERR(0, 2069, __pyx_L3_error) + __pyx_v_px = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[6]); if (unlikely(!__pyx_v_px.memview)) __PYX_ERR(0, 2070, __pyx_L3_error) + __pyx_v_py = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[7]); if (unlikely(!__pyx_v_py.memview)) __PYX_ERR(0, 2071, __pyx_L3_error) + __pyx_v_pz = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[8]); if (unlikely(!__pyx_v_pz.memview)) __PYX_ERR(0, 2072, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2058, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("points_in_cells", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2063, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.geometry.selection_routines.points_in_cells", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -32047,66 +35079,66 @@ __pyx_pybuffernd_mask.data = NULL; __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; - /* "yt/geometry/selection_routines.pyx":2076 + /* "yt/geometry/selection_routines.pyx":2081 * cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask * * n_p = px.size # <<<<<<<<<<<<<< * n_c = cx.size * mask = np.ones(n_p, dtype="bool") */ - __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_px, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_px, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2081, __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, 2076, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2081, __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, 2076, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2081, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_n_p = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":2077 + /* "yt/geometry/selection_routines.pyx":2082 * * n_p = px.size * n_c = cx.size # <<<<<<<<<<<<<< * mask = np.ones(n_p, dtype="bool") * */ - __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_cx, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2077, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_cx, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2077, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2082, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_c = __pyx_t_3; - /* "yt/geometry/selection_routines.pyx":2078 + /* "yt/geometry/selection_routines.pyx":2083 * n_p = px.size * n_c = cx.size * mask = np.ones(n_p, dtype="bool") # <<<<<<<<<<<<<< * * for p in range(n_p): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2078, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2078, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2083, __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_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2078, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2078, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2078, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2078, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2078, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2083, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2078, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2083, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -32122,13 +35154,13 @@ } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2078, __pyx_L1_error) + if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2083, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_mask = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/selection_routines.pyx":2080 + /* "yt/geometry/selection_routines.pyx":2085 * mask = np.ones(n_p, dtype="bool") * * for p in range(n_p): # <<<<<<<<<<<<<< @@ -32139,7 +35171,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_3; __pyx_t_10+=1) { __pyx_v_p = __pyx_t_10; - /* "yt/geometry/selection_routines.pyx":2081 + /* "yt/geometry/selection_routines.pyx":2086 * * for p in range(n_p): * for c in range(n_c): # <<<<<<<<<<<<<< @@ -32150,7 +35182,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_c = __pyx_t_12; - /* "yt/geometry/selection_routines.pyx":2082 + /* "yt/geometry/selection_routines.pyx":2087 * for p in range(n_p): * for c in range(n_c): * if fabs(px[p] - cx[c]) > 0.5 * dx[c]: # <<<<<<<<<<<<<< @@ -32163,7 +35195,7 @@ __pyx_t_16 = ((fabs(((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_px.data + __pyx_t_13 * __pyx_v_px.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_cx.data + __pyx_t_14 * __pyx_v_cx.strides[0]) ))))) > (0.5 * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_dx.data + __pyx_t_15 * __pyx_v_dx.strides[0]) ))))) != 0); if (__pyx_t_16) { - /* "yt/geometry/selection_routines.pyx":2083 + /* "yt/geometry/selection_routines.pyx":2088 * for c in range(n_c): * if fabs(px[p] - cx[c]) > 0.5 * dx[c]: * mask[p] = False # <<<<<<<<<<<<<< @@ -32173,7 +35205,7 @@ __pyx_t_17 = __pyx_v_p; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_mask.diminfo[0].strides) = 0; - /* "yt/geometry/selection_routines.pyx":2084 + /* "yt/geometry/selection_routines.pyx":2089 * if fabs(px[p] - cx[c]) > 0.5 * dx[c]: * mask[p] = False * continue # <<<<<<<<<<<<<< @@ -32182,7 +35214,7 @@ */ goto __pyx_L5_continue; - /* "yt/geometry/selection_routines.pyx":2082 + /* "yt/geometry/selection_routines.pyx":2087 * for p in range(n_p): * for c in range(n_c): * if fabs(px[p] - cx[c]) > 0.5 * dx[c]: # <<<<<<<<<<<<<< @@ -32191,7 +35223,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":2085 + /* "yt/geometry/selection_routines.pyx":2090 * mask[p] = False * continue * if fabs(py[p] - cy[c]) > 0.5 * dy[c]: # <<<<<<<<<<<<<< @@ -32204,7 +35236,7 @@ __pyx_t_16 = ((fabs(((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_py.data + __pyx_t_18 * __pyx_v_py.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_cy.data + __pyx_t_19 * __pyx_v_cy.strides[0]) ))))) > (0.5 * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_dy.data + __pyx_t_20 * __pyx_v_dy.strides[0]) ))))) != 0); if (__pyx_t_16) { - /* "yt/geometry/selection_routines.pyx":2086 + /* "yt/geometry/selection_routines.pyx":2091 * continue * if fabs(py[p] - cy[c]) > 0.5 * dy[c]: * mask[p] = False # <<<<<<<<<<<<<< @@ -32214,7 +35246,7 @@ __pyx_t_21 = __pyx_v_p; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_mask.diminfo[0].strides) = 0; - /* "yt/geometry/selection_routines.pyx":2087 + /* "yt/geometry/selection_routines.pyx":2092 * if fabs(py[p] - cy[c]) > 0.5 * dy[c]: * mask[p] = False * continue # <<<<<<<<<<<<<< @@ -32223,7 +35255,7 @@ */ goto __pyx_L5_continue; - /* "yt/geometry/selection_routines.pyx":2085 + /* "yt/geometry/selection_routines.pyx":2090 * mask[p] = False * continue * if fabs(py[p] - cy[c]) > 0.5 * dy[c]: # <<<<<<<<<<<<<< @@ -32232,7 +35264,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":2088 + /* "yt/geometry/selection_routines.pyx":2093 * mask[p] = False * continue * if fabs(pz[p] - cz[c]) > 0.5 * dz[c]: # <<<<<<<<<<<<<< @@ -32245,7 +35277,7 @@ __pyx_t_16 = ((fabs(((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pz.data + __pyx_t_22 * __pyx_v_pz.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_cz.data + __pyx_t_23 * __pyx_v_cz.strides[0]) ))))) > (0.5 * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_dz.data + __pyx_t_24 * __pyx_v_dz.strides[0]) ))))) != 0); if (__pyx_t_16) { - /* "yt/geometry/selection_routines.pyx":2089 + /* "yt/geometry/selection_routines.pyx":2094 * continue * if fabs(pz[p] - cz[c]) > 0.5 * dz[c]: * mask[p] = False # <<<<<<<<<<<<<< @@ -32255,7 +35287,7 @@ __pyx_t_25 = __pyx_v_p; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_mask.diminfo[0].strides) = 0; - /* "yt/geometry/selection_routines.pyx":2090 + /* "yt/geometry/selection_routines.pyx":2095 * if fabs(pz[p] - cz[c]) > 0.5 * dz[c]: * mask[p] = False * continue # <<<<<<<<<<<<<< @@ -32264,7 +35296,7 @@ */ goto __pyx_L5_continue; - /* "yt/geometry/selection_routines.pyx":2088 + /* "yt/geometry/selection_routines.pyx":2093 * mask[p] = False * continue * if fabs(pz[p] - cz[c]) > 0.5 * dz[c]: # <<<<<<<<<<<<<< @@ -32273,7 +35305,7 @@ */ } - /* "yt/geometry/selection_routines.pyx":2091 + /* "yt/geometry/selection_routines.pyx":2096 * mask[p] = False * continue * if mask[p]: break # <<<<<<<<<<<<<< @@ -32290,17 +35322,19 @@ __pyx_L6_break:; } - /* "yt/geometry/selection_routines.pyx":2093 + /* "yt/geometry/selection_routines.pyx":2098 * if mask[p]: break * * return mask # <<<<<<<<<<<<<< + * + * cdef class BooleanSelector(SelectorObject): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_mask)); __pyx_r = ((PyObject *)__pyx_v_mask); goto __pyx_L0; - /* "yt/geometry/selection_routines.pyx":2058 + /* "yt/geometry/selection_routines.pyx":2063 * @cython.boundscheck(False) * @cython.wraparound(False) * def points_in_cells( # <<<<<<<<<<<<<< @@ -32341,539 +35375,712 @@ return __pyx_r; } -/* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] - */ - -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; - - /* "vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< - * +/* "yt/geometry/selection_routines.pyx":2102 + * cdef class BooleanSelector(SelectorObject): * + * def __init__(self, dobj): # <<<<<<<<<<<<<< + * # Note that this has a different API than the other selector objects, + * # so will not work as a traditional data selector. */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); - goto __pyx_L0; - /* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] - */ +/* Python wrapper */ +static int __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dobj = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dobj,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dobj)) != 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(0, 2102, __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_dobj = 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(0, 2102, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector___init__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)__pyx_v_self), __pyx_v_dobj); /* function exit code */ - __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double *__pyx_v_a, double *__pyx_v_b) { - double __pyx_r; +static int __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self, PyObject *__pyx_v_dobj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); - /* "vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< - * - * + /* "yt/geometry/selection_routines.pyx":2105 + * # Note that this has a different API than the other selector objects, + * # so will not work as a traditional data selector. + * if not hasattr(dobj.dobj1, "selector"): # <<<<<<<<<<<<<< + * self.sel1 = dobj.dobj1 + * else: */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_dobj1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_s_selector); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_3) { - /* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + /* "yt/geometry/selection_routines.pyx":2106 + * # so will not work as a traditional data selector. + * if not hasattr(dobj.dobj1, "selector"): + * self.sel1 = dobj.dobj1 # <<<<<<<<<<<<<< + * else: + * self.sel1 = dobj.dobj1.selector */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_dobj1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 2106, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->sel1); + __Pyx_DECREF(((PyObject *)__pyx_v_self->sel1)); + __pyx_v_self->sel1 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1); + __pyx_t_1 = 0; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "yt/geometry/selection_routines.pyx":2105 + * # Note that this has a different API than the other selector objects, + * # so will not work as a traditional data selector. + * if not hasattr(dobj.dobj1, "selector"): # <<<<<<<<<<<<<< + * self.sel1 = dobj.dobj1 + * else: + */ + goto __pyx_L3; + } -/* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "yt/geometry/selection_routines.pyx":2108 + * self.sel1 = dobj.dobj1 + * else: + * self.sel1 = dobj.dobj1.selector # <<<<<<<<<<<<<< + * if not hasattr(dobj.dobj2, "selector"): + * self.sel2 = dobj.dobj2 */ + /*else*/ { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_dobj1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_selector); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 2108, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->sel1); + __Pyx_DECREF(((PyObject *)__pyx_v_self->sel1)); + __pyx_v_self->sel1 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { + /* "yt/geometry/selection_routines.pyx":2109 + * else: + * self.sel1 = dobj.dobj1.selector + * if not hasattr(dobj.dobj2, "selector"): # <<<<<<<<<<<<<< + * self.sel2 = dobj.dobj2 + * else: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_dobj2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_HasAttr(__pyx_t_4, __pyx_n_s_selector); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0); + if (__pyx_t_2) { - /* "vec3_ops.pxd":20 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "yt/geometry/selection_routines.pyx":2110 + * self.sel1 = dobj.dobj1.selector + * if not hasattr(dobj.dobj2, "selector"): + * self.sel2 = dobj.dobj2 # <<<<<<<<<<<<<< + * else: + * self.sel2 = dobj.dobj2.selector */ - (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_dobj2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 2110, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->sel2); + __Pyx_DECREF(((PyObject *)__pyx_v_self->sel2)); + __pyx_v_self->sel2 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_4); + __pyx_t_4 = 0; - /* "vec3_ops.pxd":21 - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< - * c[2] = a[0]*b[1] - a[1]*b[0] - * + /* "yt/geometry/selection_routines.pyx":2109 + * else: + * self.sel1 = dobj.dobj1.selector + * if not hasattr(dobj.dobj2, "selector"): # <<<<<<<<<<<<<< + * self.sel2 = dobj.dobj2 + * else: */ - (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); + goto __pyx_L4; + } - /* "vec3_ops.pxd":22 - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< - * + /* "yt/geometry/selection_routines.pyx":2112 + * self.sel2 = dobj.dobj2 + * else: + * self.sel2 = dobj.dobj2.selector # <<<<<<<<<<<<<< * + * cdef class BooleanANDSelector(BooleanSelector): */ - (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_dobj2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_selector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 2112, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->sel2); + __Pyx_DECREF(((PyObject *)__pyx_v_self->sel2)); + __pyx_v_self->sel2 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L4:; - /* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "yt/geometry/selection_routines.pyx":2102 + * cdef class BooleanSelector(SelectorObject): + * + * def __init__(self, dobj): # <<<<<<<<<<<<<< + * # Note that this has a different API than the other selector objects, + * # so will not work as a traditional data selector. */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "vec3_ops.pxd":20 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] - */ - (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); - - /* "vec3_ops.pxd":21 - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< - * c[2] = a[0]*b[1] - a[1]*b[0] - * - */ - (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); - - /* "vec3_ops.pxd":22 - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< +/* "yt/geometry/selection_routines.pxd":75 * + * cdef class BooleanSelector(SelectorObject): + * cdef public SelectorObject sel1 # <<<<<<<<<<<<<< + * cdef public SelectorObject sel2 * */ - (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); - /* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - */ +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1___get__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)__pyx_v_self)); /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - */ - -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1___get__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->sel1)); + __pyx_r = ((PyObject *)__pyx_v_self->sel1); + goto __pyx_L0; - /* "vec3_ops.pxd":31 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] - */ - (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "vec3_ops.pxd":32 - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< - * c[2] = a[2] - b[2] - * - */ - (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); +/* Python wrapper */ +static int __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_2__set__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - /* "vec3_ops.pxd":33 - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< - * - * - */ - (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - */ +static int __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_2__set__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(1, 75, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->sel1); + __Pyx_DECREF(((PyObject *)__pyx_v_self->sel1)); + __pyx_v_self->sel1 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1); + __pyx_t_1 = 0; /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanSelector.sel1.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { +/* Python wrapper */ +static int __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_4__del__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)__pyx_v_self)); - /* "vec3_ops.pxd":31 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] - */ - (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "vec3_ops.pxd":32 - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< - * c[2] = a[2] - b[2] - * - */ - (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); +static int __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_4__del__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->sel1); + __Pyx_DECREF(((PyObject *)__pyx_v_self->sel1)); + __pyx_v_self->sel1 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); - /* "vec3_ops.pxd":33 - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< - * + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pxd":76 + * cdef class BooleanSelector(SelectorObject): + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 # <<<<<<<<<<<<<< * + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, */ - (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); - /* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - */ +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2___get__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)__pyx_v_self)); /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) - */ - -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; - - /* "vec3_ops.pxd":41 - * cdef inline cython.floating distance(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = sqrt(((powf(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + powf(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + powf(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2___get__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->sel2)); + __pyx_r = ((PyObject *)__pyx_v_self->sel2); goto __pyx_L0; - /* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) - */ - /* function exit code */ __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(double *__pyx_v_a, double *__pyx_v_b) { - double __pyx_r; +/* Python wrapper */ +static int __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_2__set__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - /* "vec3_ops.pxd":41 - * cdef inline cython.floating distance(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = sqrt(((pow(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + pow(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + pow(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); - goto __pyx_L0; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) - */ +static int __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_2__set__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(1, 76, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->sel2); + __Pyx_DECREF(((PyObject *)__pyx_v_self->sel2)); + __pyx_v_self->sel2 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1); + __pyx_t_1 = 0; /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanSelector.sel2.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, - */ +/* Python wrapper */ +static int __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_4__del__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)__pyx_v_self)); -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(float const __pyx_v_f, float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "vec3_ops.pxd":51 - * const cython.floating[3] b, - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] - */ - (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); +static int __pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_4__del__(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->sel2); + __Pyx_DECREF(((PyObject *)__pyx_v_self->sel2)); + __pyx_v_self->sel2 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); - /* "vec3_ops.pxd":52 - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< - * c[2] = f * a[2] + b[2] - * - */ - (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "vec3_ops.pxd":53 - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< - * - * +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); - /* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, - */ +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_3__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_2yt_8geometry_18selection_routines_15BooleanSelector_2__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)__pyx_v_self)); /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const __pyx_v_f, double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "vec3_ops.pxd":51 - * const cython.floating[3] b, - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] - */ - (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); - - /* "vec3_ops.pxd":52 - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< - * c[2] = f * a[2] + b[2] - * - */ - (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "vec3_ops.pxd":53 - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< - * - * + /* "(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_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__72, 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) - /* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "(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("yt.geometry.selection_routines.BooleanSelector.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) - */ - -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(float *__pyx_v_a) { - float __pyx_r; - - /* "vec3_ops.pxd":60 - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< +/* "(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__") */ - __pyx_r = sqrt(((((__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; - /* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) - */ +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_5__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_2yt_8geometry_18selection_routines_15BooleanSelector_4__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ - __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *__pyx_v_a) { - double __pyx_r; +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_15BooleanSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *__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); - /* "vec3_ops.pxd":60 - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< + /* "(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_r = sqrt(((((__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; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__73, 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) - /* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "(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_L0:; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/bitarray.pxd":20 - * cimport cython +/* "yt/geometry/selection_routines.pyx":2115 * - * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, # <<<<<<<<<<<<<< - * np.uint8_t val) nogil: - * if val > 0: val = 1 + * cdef class BooleanANDSelector(BooleanSelector): + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * cdef int rv1 = self.sel1.select_bbox(left_edge, right_edge) */ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_8bitarray_ba_set_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind, __pyx_t_5numpy_uint8_t __pyx_v_val) { +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { + int __pyx_v_rv1; + int __pyx_v_rv2; + int __pyx_r; int __pyx_t_1; - __pyx_t_5numpy_uint64_t __pyx_t_2; - /* "yt/utilities/lib/bitarray.pxd":22 - * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, - * np.uint8_t val) nogil: - * if val > 0: val = 1 # <<<<<<<<<<<<<< - * buf[ind >> 3] |= (val << (ind & 7)) + /* "yt/geometry/selection_routines.pyx":2117 + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + * cdef int rv1 = self.sel1.select_bbox(left_edge, right_edge) # <<<<<<<<<<<<<< + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_bbox(left_edge, right_edge) + */ + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_bbox(__pyx_v_self->__pyx_base.sel1, __pyx_v_left_edge, __pyx_v_right_edge); + + /* "yt/geometry/selection_routines.pyx":2118 + * np.float64_t right_edge[3]) nogil: + * cdef int rv1 = self.sel1.select_bbox(left_edge, right_edge) + * if rv1 == 0: return 0 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_bbox(left_edge, right_edge) + * if rv2 == 0: return 0 + */ + __pyx_t_1 = ((__pyx_v_rv1 == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "yt/geometry/selection_routines.pyx":2119 + * cdef int rv1 = self.sel1.select_bbox(left_edge, right_edge) + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_bbox(left_edge, right_edge) # <<<<<<<<<<<<<< + * if rv2 == 0: return 0 + * return 1 + */ + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_bbox(__pyx_v_self->__pyx_base.sel2, __pyx_v_left_edge, __pyx_v_right_edge); + + /* "yt/geometry/selection_routines.pyx":2120 + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_bbox(left_edge, right_edge) + * if rv2 == 0: return 0 # <<<<<<<<<<<<<< + * return 1 * */ - __pyx_t_1 = ((__pyx_v_val > 0) != 0); + __pyx_t_1 = ((__pyx_v_rv2 == 0) != 0); if (__pyx_t_1) { - __pyx_v_val = 1; + __pyx_r = 0; + goto __pyx_L0; } - /* "yt/utilities/lib/bitarray.pxd":23 - * np.uint8_t val) nogil: - * if val > 0: val = 1 - * buf[ind >> 3] |= (val << (ind & 7)) # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2121 + * cdef int rv2 = self.sel2.select_bbox(left_edge, right_edge) + * if rv2 == 0: return 0 + * return 1 # <<<<<<<<<<<<<< * - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: + * cdef int select_grid(self, np.float64_t left_edge[3], */ - __pyx_t_2 = (__pyx_v_ind >> 3); - (__pyx_v_buf[__pyx_t_2]) = ((__pyx_v_buf[__pyx_t_2]) | (__pyx_v_val << (__pyx_v_ind & 7))); + __pyx_r = 1; + goto __pyx_L0; - /* "yt/utilities/lib/bitarray.pxd":20 - * cimport cython + /* "yt/geometry/selection_routines.pyx":2115 * - * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, # <<<<<<<<<<<<<< - * np.uint8_t val) nogil: - * if val > 0: val = 1 + * cdef class BooleanANDSelector(BooleanSelector): + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * cdef int rv1 = self.sel1.select_bbox(left_edge, right_edge) */ /* function exit code */ + __pyx_L0:; + return __pyx_r; } -/* "yt/utilities/lib/bitarray.pxd":25 - * buf[ind >> 3] |= (val << (ind & 7)) +/* "yt/geometry/selection_routines.pyx":2123 + * return 1 * - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) - * if rv == 0: return 0 + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ -static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_9utilities_3lib_8bitarray_ba_get_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind) { - __pyx_t_5numpy_uint8_t __pyx_v_rv; - __pyx_t_5numpy_uint8_t __pyx_r; +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_grid *__pyx_optional_args) { + + /* "yt/geometry/selection_routines.pyx":2125 + * cdef int select_grid(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_grid(left_edge, right_edge, level, o) + * if rv1 == 0: return 0 + */ + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)NULL); + int __pyx_v_rv1; + int __pyx_v_rv2; + int __pyx_r; int __pyx_t_1; + struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid __pyx_t_2; + int __pyx_t_3; + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_o = __pyx_optional_args->o; + } + } - /* "yt/utilities/lib/bitarray.pxd":26 - * - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) # <<<<<<<<<<<<<< - * if rv == 0: return 0 - * return 1 + /* "yt/geometry/selection_routines.pyx":2126 + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + * cdef int rv1 = self.sel1.select_grid(left_edge, right_edge, level, o) # <<<<<<<<<<<<<< + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_grid(left_edge, right_edge, level, o) */ - __pyx_v_rv = ((__pyx_v_buf[(__pyx_v_ind >> 3)]) & (1 << (__pyx_v_ind & 7))); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.o = __pyx_v_o; + __pyx_t_1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_grid(__pyx_v_self->__pyx_base.sel1, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_level, &__pyx_t_2); + __pyx_v_rv1 = __pyx_t_1; - /* "yt/utilities/lib/bitarray.pxd":27 - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) - * if rv == 0: return 0 # <<<<<<<<<<<<<< - * return 1 + /* "yt/geometry/selection_routines.pyx":2127 + * Oct *o = NULL) nogil: + * cdef int rv1 = self.sel1.select_grid(left_edge, right_edge, level, o) + * if rv1 == 0: return 0 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_grid(left_edge, right_edge, level, o) + * if rv2 == 0: return 0 + */ + __pyx_t_3 = ((__pyx_v_rv1 == 0) != 0); + if (__pyx_t_3) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "yt/geometry/selection_routines.pyx":2128 + * cdef int rv1 = self.sel1.select_grid(left_edge, right_edge, level, o) + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_grid(left_edge, right_edge, level, o) # <<<<<<<<<<<<<< + * if rv2 == 0: return 0 + * return 1 + */ + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.o = __pyx_v_o; + __pyx_t_1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_grid(__pyx_v_self->__pyx_base.sel2, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_level, &__pyx_t_2); + __pyx_v_rv2 = __pyx_t_1; + + /* "yt/geometry/selection_routines.pyx":2129 + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_grid(left_edge, right_edge, level, o) + * if rv2 == 0: return 0 # <<<<<<<<<<<<<< + * return 1 * */ - __pyx_t_1 = ((__pyx_v_rv == 0) != 0); - if (__pyx_t_1) { + __pyx_t_3 = ((__pyx_v_rv2 == 0) != 0); + if (__pyx_t_3) { __pyx_r = 0; goto __pyx_L0; } - /* "yt/utilities/lib/bitarray.pxd":28 - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) - * if rv == 0: return 0 - * return 1 # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2130 + * cdef int rv2 = self.sel2.select_grid(left_edge, right_edge, level, o) + * if rv2 == 0: return 0 + * return 1 # <<<<<<<<<<<<<< * - * cdef class bitarray: + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: */ __pyx_r = 1; goto __pyx_L0; - /* "yt/utilities/lib/bitarray.pxd":25 - * buf[ind >> 3] |= (val << (ind & 7)) + /* "yt/geometry/selection_routines.pyx":2123 + * return 1 * - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) - * if rv == 0: return 0 + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ /* function exit code */ @@ -32881,4183 +36088,4895 @@ return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. +/* "yt/geometry/selection_routines.pyx":2132 + * return 1 + * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 0: return 0 */ -/* 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) { +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds) { + int __pyx_v_rv1; + int __pyx_v_rv2; 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)); + int __pyx_t_1; - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "yt/geometry/selection_routines.pyx":2133 + * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * cdef int rv1 = self.sel1.select_cell(pos, dds) # <<<<<<<<<<<<<< + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_cell(pos, dds) + */ + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_cell(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos, __pyx_v_dds); -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); + /* "yt/geometry/selection_routines.pyx":2134 + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 0: return 0 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_cell(pos, dds) + * if rv2 == 0: return 0 + */ + __pyx_t_1 = ((__pyx_v_rv1 == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2135 + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_cell(pos, dds) # <<<<<<<<<<<<<< + * if rv2 == 0: return 0 + * return 1 + */ + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_cell(__pyx_v_self->__pyx_base.sel2, __pyx_v_pos, __pyx_v_dds); + + /* "yt/geometry/selection_routines.pyx":2136 + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_cell(pos, dds) + * if rv2 == 0: return 0 # <<<<<<<<<<<<<< + * return 1 * - * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + __pyx_t_1 = ((__pyx_v_rv2 == 0) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) + /* "yt/geometry/selection_routines.pyx":2137 + * cdef int rv2 = self.sel2.select_cell(pos, dds) + * if rv2 == 0: return 0 + * return 1 # <<<<<<<<<<<<<< * + * cdef int select_point(self, np.float64_t pos[3]) nogil: */ - __pyx_v_endian_detector = 1; + __pyx_r = 1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2132 + * return 1 * - * ndim = PyArray_NDIM(self) + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 0: return 0 */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2139 + * return 1 * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 0: return 0 */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos) { + int __pyx_v_rv1; + int __pyx_v_rv2; + int __pyx_r; + int __pyx_t_1; + + /* "yt/geometry/selection_routines.pyx":2140 * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * cdef int rv1 = self.sel1.select_point(pos) # <<<<<<<<<<<<<< + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_point(pos) */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_point(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos); + + /* "yt/geometry/selection_routines.pyx":2141 + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 0: return 0 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_point(pos) + * if rv2 == 0: return 0 + */ + __pyx_t_1 = ((__pyx_v_rv1 == 0) != 0); if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + /* "yt/geometry/selection_routines.pyx":2142 + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_point(pos) # <<<<<<<<<<<<<< + * if rv2 == 0: return 0 + * return 1 */ - __pyx_v_copy_shape = 1; + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_point(__pyx_v_self->__pyx_base.sel2, __pyx_v_pos); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + /* "yt/geometry/selection_routines.pyx":2143 + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_point(pos) + * if rv2 == 0: return 0 # <<<<<<<<<<<<<< + * return 1 * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: */ - goto __pyx_L4; + __pyx_t_1 = ((__pyx_v_rv2 == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2144 + * cdef int rv2 = self.sel2.select_point(pos) + * if rv2 == 0: return 0 + * return 1 # <<<<<<<<<<<<<< * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; + __pyx_r = 1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "yt/geometry/selection_routines.pyx":2139 + * return 1 * - * 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") + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 0: return 0 */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2146 + * return 1 * + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 0: return 0 */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius) { + int __pyx_v_rv1; + int __pyx_v_rv2; + int __pyx_r; + int __pyx_t_1; + + /* "yt/geometry/selection_routines.pyx":2147 * - * 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") + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * cdef int rv1 = self.sel1.select_sphere(pos, radius) # <<<<<<<<<<<<<< + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) */ + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_sphere(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos, __pyx_v_radius); + + /* "yt/geometry/selection_routines.pyx":2148 + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 0: return 0 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_sphere(pos, radius) + * if rv2 == 0: return 0 + */ + __pyx_t_1 = ((__pyx_v_rv1 == 0) != 0); if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + /* "yt/geometry/selection_routines.pyx":2149 + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) # <<<<<<<<<<<<<< + * if rv2 == 0: return 0 + * return 1 */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_sphere(__pyx_v_self->__pyx_base.sel2, __pyx_v_pos, __pyx_v_radius); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "yt/geometry/selection_routines.pyx":2150 + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) + * if rv2 == 0: return 0 # <<<<<<<<<<<<<< + * return 1 * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") */ + __pyx_t_1 = ((__pyx_v_rv2 == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "yt/geometry/selection_routines.pyx":2151 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) + * if rv2 == 0: return 0 + * return 1 # <<<<<<<<<<<<<< * - * 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") + * def _hash_vals(self): */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } + __pyx_r = 1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "yt/geometry/selection_routines.pyx":2146 + * return 1 * + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 0: return 0 */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2153 + * return 1 * - * 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") + * def _hash_vals(self): # <<<<<<<<<<<<<< + * return (self.sel1._hash_vals() + + * ("and",) + */ - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanANDSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanANDSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_hash_vals (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_18BooleanANDSelector__hash_vals(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanANDSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__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; + __Pyx_RefNannySetupContext("_hash_vals", 0); + + /* "yt/geometry/selection_routines.pyx":2154 * - * info.buf = PyArray_DATA(self) + * def _hash_vals(self): + * return (self.sel1._hash_vals() + # <<<<<<<<<<<<<< + * ("and",) + + * self.sel2._hash_vals()) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.sel1), __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 222, __pyx_L1_error) + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2154, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "yt/geometry/selection_routines.pyx":2155 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("and",) + # <<<<<<<<<<<<<< + * self.sel2._hash_vals()) * - * 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 = PyNumber_Add(__pyx_t_1, __pyx_tuple__74); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/geometry/selection_routines.pyx":2156 + * return (self.sel1._hash_vals() + + * ("and",) + + * self.sel2._hash_vals()) # <<<<<<<<<<<<<< + * + * cdef class BooleanORSelector(BooleanSelector): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.sel2), __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2156, __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_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2156, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2156, __pyx_L1_error) } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "yt/geometry/selection_routines.pyx":2155 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("and",) + # <<<<<<<<<<<<<< + * self.sel2._hash_vals()) * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "yt/geometry/selection_routines.pyx":2153 + * return 1 * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + * def _hash_vals(self): # <<<<<<<<<<<<<< + * return (self.sel1._hash_vals() + + * ("and",) + */ - __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* 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("yt.geometry.selection_routines.BooleanANDSelector._hash_vals", __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): */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanANDSelector_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanANDSelector_3__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_2yt_8geometry_18selection_routines_18BooleanANDSelector_2__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanANDSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__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_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__75, 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) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanANDSelector.__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__") */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * 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: +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanANDSelector_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanANDSelector_5__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_2yt_8geometry_18selection_routines_18BooleanANDSelector_4__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanANDSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *__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_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__76, 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) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) + /* "(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__") */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanANDSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2159 + * + * cdef class BooleanORSelector(BooleanSelector): + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * cdef int rv1 = self.sel1.select_bbox(left_edge, right_edge) */ - goto __pyx_L11; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL +static int __pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { + int __pyx_v_rv1; + int __pyx_v_rv2; + int __pyx_r; + int __pyx_t_1; + + /* "yt/geometry/selection_routines.pyx":2161 + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + * cdef int rv1 = self.sel1.select_bbox(left_edge, right_edge) # <<<<<<<<<<<<<< + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_bbox(left_edge, right_edge) */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_bbox(__pyx_v_self->__pyx_base.sel1, __pyx_v_left_edge, __pyx_v_right_edge); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) + /* "yt/geometry/selection_routines.pyx":2162 + * np.float64_t right_edge[3]) nogil: + * cdef int rv1 = self.sel1.select_bbox(left_edge, right_edge) + * if rv1 == 1: return 1 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_bbox(left_edge, right_edge) + * if rv2 == 1: return 1 */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + __pyx_t_1 = ((__pyx_v_rv1 == 1) != 0); + if (__pyx_t_1) { + __pyx_r = 1; + goto __pyx_L0; } - __pyx_L11:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "yt/geometry/selection_routines.pyx":2163 + * cdef int rv1 = self.sel1.select_bbox(left_edge, right_edge) + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_bbox(left_edge, right_edge) # <<<<<<<<<<<<<< + * if rv2 == 1: return 1 + * return 0 */ - __pyx_v_info->suboffsets = NULL; + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_bbox(__pyx_v_self->__pyx_base.sel2, __pyx_v_left_edge, __pyx_v_right_edge); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "yt/geometry/selection_routines.pyx":2164 + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_bbox(left_edge, right_edge) + * if rv2 == 1: return 1 # <<<<<<<<<<<<<< + * return 0 * */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + __pyx_t_1 = ((__pyx_v_rv2 == 1) != 0); + if (__pyx_t_1) { + __pyx_r = 1; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2165 + * cdef int rv2 = self.sel2.select_bbox(left_edge, right_edge) + * if rv2 == 1: return 1 + * return 0 # <<<<<<<<<<<<<< * - * cdef int t + * cdef int select_grid(self, np.float64_t left_edge[3], */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "yt/geometry/selection_routines.pyx":2159 * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + * cdef class BooleanORSelector(BooleanSelector): + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * cdef int rv1 = self.sel1.select_bbox(left_edge, right_edge) */ - __pyx_v_f = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * 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; + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< +/* "yt/geometry/selection_routines.pyx":2167 + * return 0 * - * if not hasfields and not copy_shape: + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None +static int __pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_17BooleanORSelector_select_grid *__pyx_optional_args) { + + /* "yt/geometry/selection_routines.pyx":2169 + * cdef int select_grid(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_grid(left_edge, right_edge, level, o) + * if rv1 == 1: return 1 */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)NULL); + int __pyx_v_rv1; + int __pyx_v_rv2; + int __pyx_r; + int __pyx_t_1; + struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid __pyx_t_2; + int __pyx_t_3; + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_o = __pyx_optional_args->o; + } } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer + /* "yt/geometry/selection_routines.pyx":2170 + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + * cdef int rv1 = self.sel1.select_grid(left_edge, right_edge, level, o) # <<<<<<<<<<<<<< + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_grid(left_edge, right_edge, level, o) */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.o = __pyx_v_o; + __pyx_t_1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_grid(__pyx_v_self->__pyx_base.sel1, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_level, &__pyx_t_2); + __pyx_v_rv1 = __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + /* "yt/geometry/selection_routines.pyx":2171 + * Oct *o = NULL) nogil: + * cdef int rv1 = self.sel1.select_grid(left_edge, right_edge, level, o) + * if rv1 == 1: return 1 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_grid(left_edge, right_edge, level, o) + * if rv2 == 1: return 1 */ - goto __pyx_L14; + __pyx_t_3 = ((__pyx_v_rv1 == 1) != 0); + if (__pyx_t_3) { + __pyx_r = 1; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2172 + * cdef int rv1 = self.sel1.select_grid(left_edge, right_edge, level, o) + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_grid(left_edge, right_edge, level, o) # <<<<<<<<<<<<<< + * if rv2 == 1: return 1 + * return 0 + */ + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.o = __pyx_v_o; + __pyx_t_1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_grid(__pyx_v_self->__pyx_base.sel2, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_level, &__pyx_t_2); + __pyx_v_rv2 = __pyx_t_1; + + /* "yt/geometry/selection_routines.pyx":2173 + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_grid(left_edge, right_edge, level, o) + * if rv2 == 1: return 1 # <<<<<<<<<<<<<< + * return 0 * - * if not hasfields: */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + __pyx_t_3 = ((__pyx_v_rv2 == 1) != 0); + if (__pyx_t_3) { + __pyx_r = 1; + goto __pyx_L0; } - __pyx_L14:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "yt/geometry/selection_routines.pyx":2174 + * cdef int rv2 = self.sel2.select_grid(left_edge, right_edge, level, o) + * if rv2 == 1: return 1 + * return 0 # <<<<<<<<<<<<<< * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "yt/geometry/selection_routines.pyx":2167 + * return 0 * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2176 + * return 0 + * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 1: return 1 */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" +static int __pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds) { + int __pyx_v_rv1; + int __pyx_v_rv2; + int __pyx_r; + int __pyx_t_1; + + /* "yt/geometry/selection_routines.pyx":2177 + * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * cdef int rv1 = self.sel1.select_cell(pos, dds) # <<<<<<<<<<<<<< + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_cell(pos, dds) */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_cell(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos, __pyx_v_dds); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "yt/geometry/selection_routines.pyx":2178 + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 1: return 1 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_cell(pos, dds) + * if rv2 == 1: return 1 */ - if (__pyx_t_1) { + __pyx_t_1 = ((__pyx_v_rv1 == 1) != 0); + if (__pyx_t_1) { + __pyx_r = 1; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" + /* "yt/geometry/selection_routines.pyx":2179 + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_cell(pos, dds) # <<<<<<<<<<<<<< + * if rv2 == 1: return 1 + * return 0 */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 259, __pyx_L1_error) + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_cell(__pyx_v_self->__pyx_base.sel2, __pyx_v_pos, __pyx_v_dds); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "yt/geometry/selection_routines.pyx":2180 + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_cell(pos, dds) + * if rv2 == 1: return 1 # <<<<<<<<<<<<<< + * return 0 + * */ - } + __pyx_t_1 = ((__pyx_v_rv2 == 1) != 0); + if (__pyx_t_1) { + __pyx_r = 1; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" + /* "yt/geometry/selection_routines.pyx":2181 + * cdef int rv2 = self.sel2.select_cell(pos, dds) + * if rv2 == 1: return 1 + * return 0 # <<<<<<<<<<<<<< + * + * cdef int select_point(self, np.float64_t pos[3]) nogil: */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" + /* "yt/geometry/selection_routines.pyx":2176 + * return 0 + * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 1: return 1 */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2183 + * return 0 + * + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 1: return 1 */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" +static int __pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos) { + int __pyx_v_rv1; + int __pyx_v_rv2; + int __pyx_r; + int __pyx_t_1; + + /* "yt/geometry/selection_routines.pyx":2184 + * + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * cdef int rv1 = self.sel1.select_point(pos) # <<<<<<<<<<<<<< + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_point(pos) */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_point(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" + /* "yt/geometry/selection_routines.pyx":2185 + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 1: return 1 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_point(pos) + * if rv2 == 1: return 1 */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; + __pyx_t_1 = ((__pyx_v_rv1 == 1) != 0); + if (__pyx_t_1) { + __pyx_r = 1; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" + /* "yt/geometry/selection_routines.pyx":2186 + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_point(pos) # <<<<<<<<<<<<<< + * if rv2 == 1: return 1 + * return 0 */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_point(__pyx_v_self->__pyx_base.sel2, __pyx_v_pos); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" + /* "yt/geometry/selection_routines.pyx":2187 + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_point(pos) + * if rv2 == 1: return 1 # <<<<<<<<<<<<<< + * return 0 + * */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; + __pyx_t_1 = ((__pyx_v_rv2 == 1) != 0); + if (__pyx_t_1) { + __pyx_r = 1; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" + /* "yt/geometry/selection_routines.pyx":2188 + * cdef int rv2 = self.sel2.select_point(pos) + * if rv2 == 1: return 1 + * return 0 # <<<<<<<<<<<<<< + * + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" + /* "yt/geometry/selection_routines.pyx":2183 + * return 0 + * + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 1: return 1 */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2190 + * return 0 + * + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 1: return 1 */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" +static int __pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius) { + int __pyx_v_rv1; + int __pyx_v_rv2; + int __pyx_r; + int __pyx_t_1; + + /* "yt/geometry/selection_routines.pyx":2191 + * + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * cdef int rv1 = self.sel1.select_sphere(pos, radius) # <<<<<<<<<<<<<< + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_sphere(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos, __pyx_v_radius); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" + /* "yt/geometry/selection_routines.pyx":2192 + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 1: return 1 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_sphere(pos, radius) + * if rv2 == 1: return 1 */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; + __pyx_t_1 = ((__pyx_v_rv1 == 1) != 0); + if (__pyx_t_1) { + __pyx_r = 1; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" + /* "yt/geometry/selection_routines.pyx":2193 + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) # <<<<<<<<<<<<<< + * if rv2 == 1: return 1 + * return 0 */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_sphere(__pyx_v_self->__pyx_base.sel2, __pyx_v_pos, __pyx_v_radius); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 278, __pyx_L1_error) - break; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "yt/geometry/selection_routines.pyx":2194 + * if rv1 == 1: return 1 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) + * if rv2 == 1: return 1 # <<<<<<<<<<<<<< + * return 0 * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or */ + __pyx_t_1 = ((__pyx_v_rv2 == 1) != 0); + if (__pyx_t_1) { + __pyx_r = 1; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2195 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) + * if rv2 == 1: return 1 + * return 0 # <<<<<<<<<<<<<< * - * def __releasebuffer__(ndarray self, Py_buffer* info): + * def _hash_vals(self): */ - (__pyx_v_f[0]) = '\x00'; - } + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "yt/geometry/selection_routines.pyx":2190 + * return 0 + * + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 1: return 1 */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string +/* "yt/geometry/selection_routines.pyx":2197 + * return 0 * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * def _hash_vals(self): # <<<<<<<<<<<<<< + * return (self.sel1._hash_vals() + + * ("or",) + */ /* 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) { +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_17BooleanORSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_17BooleanORSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + __Pyx_RefNannySetupContext("_hash_vals (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_17BooleanORSelector__hash_vals(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17BooleanORSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "yt/geometry/selection_routines.pyx":2198 * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * def _hash_vals(self): + * return (self.sel1._hash_vals() + # <<<<<<<<<<<<<< + * ("or",) + + * self.sel2._hash_vals()) */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.sel1), __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2198, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2198, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "yt/geometry/selection_routines.pyx":2199 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("or",) + # <<<<<<<<<<<<<< + * self.sel2._hash_vals()) + * */ - free(__pyx_v_info->format); + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_tuple__77); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "yt/geometry/selection_routines.pyx":2200 + * return (self.sel1._hash_vals() + + * ("or",) + + * self.sel2._hash_vals()) # <<<<<<<<<<<<<< * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * cdef class BooleanNOTSelector(BooleanSelector): */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.sel2), __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2200, __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_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } } + if (__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2200, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2200, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "yt/geometry/selection_routines.pyx":2199 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("or",) + # <<<<<<<<<<<<<< + * self.sel2._hash_vals()) * */ - free(__pyx_v_info->strides); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - } + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "yt/geometry/selection_routines.pyx":2197 + * return 0 * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * def _hash_vals(self): # <<<<<<<<<<<<<< + * return (self.sel1._hash_vals() + + * ("or",) + */ /* 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("yt.geometry.selection_routines.BooleanORSelector._hash_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_17BooleanORSelector_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_17BooleanORSelector_3__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_2yt_8geometry_18selection_routines_17BooleanORSelector_2__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17BooleanORSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): + /* "(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_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 2, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * + /* "(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("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanORSelector.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * +/* "(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__") */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_17BooleanORSelector_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_17BooleanORSelector_5__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_2yt_8geometry_18selection_routines_17BooleanORSelector_4__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_17BooleanORSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): + /* "(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_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, 774, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 4, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * + /* "(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("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanORSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) +/* "yt/geometry/selection_routines.pyx":2203 * + * cdef class BooleanNOTSelector(BooleanSelector): + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * # We always return True here, because we don't have a "fully included" */ -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); +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_bbox(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { + int __pyx_r; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2207 + * # We always return True here, because we don't have a "fully included" + * # check anywhere else. + * return 1 # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * cdef int select_grid(self, np.float64_t left_edge[3], */ - __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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = 1; goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + /* "yt/geometry/selection_routines.pyx":2203 * + * cdef class BooleanNOTSelector(BooleanSelector): + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * # We always return True here, because we don't have a "fully included" */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) +/* "yt/geometry/selection_routines.pyx":2209 + * return 1 * + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ -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); +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_grid(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_right_edge, CYTHON_UNUSED __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_grid *__pyx_optional_args) { + int __pyx_r; + if (__pyx_optional_args) { + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2212 + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + * return 1 # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: */ - __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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = 1; goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "yt/geometry/selection_routines.pyx":2209 + * return 1 * + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) +/* "yt/geometry/selection_routines.pyx":2214 + * return 1 * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 0: return 1 */ -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); +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds) { + int __pyx_v_rv1; + int __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "yt/geometry/selection_routines.pyx":2215 * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * cdef int rv1 = self.sel1.select_cell(pos, dds) # <<<<<<<<<<<<<< + * if rv1 == 0: return 1 + * return 0 + */ + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_cell(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos, __pyx_v_dds); + + /* "yt/geometry/selection_routines.pyx":2216 + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 0: return 1 # <<<<<<<<<<<<<< + * return 0 * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_1 = ((__pyx_v_rv1 == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 1; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "yt/geometry/selection_routines.pyx":2217 + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 0: return 1 + * return 0 # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) + * cdef int select_point(self, np.float64_t pos[3]) nogil: + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/geometry/selection_routines.pyx":2214 + * return 1 * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 0: return 1 */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) +/* "yt/geometry/selection_routines.pyx":2219 + * return 0 * - * 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. + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 0: return 1 */ -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); +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos) { + int __pyx_v_rv1; + int __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "yt/geometry/selection_routines.pyx":2220 * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * cdef int rv1 = self.sel1.select_point(pos) # <<<<<<<<<<<<<< + * if rv1 == 0: return 1 + * return 0 */ - __pyx_v_endian_detector = 1; + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_point(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields + /* "yt/geometry/selection_routines.pyx":2221 + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 0: return 1 # <<<<<<<<<<<<<< + * return 0 * */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_1 = ((__pyx_v_rv1 == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 1; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields + /* "yt/geometry/selection_routines.pyx":2222 + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 0: return 1 + * return 0 # <<<<<<<<<<<<<< * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(2, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_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, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "yt/geometry/selection_routines.pyx":2219 + * return 0 * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 0: return 1 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2224 + * return 0 * + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 0: return 1 */ - if (unlikely(__pyx_v_descr->fields == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius) { + int __pyx_v_rv1; + int __pyx_r; + int __pyx_t_1; + + /* "yt/geometry/selection_routines.pyx":2225 * - * if (end - f) - (new_offset - offset[0]) < 15: + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * cdef int rv1 = self.sel1.select_sphere(pos, radius) # <<<<<<<<<<<<<< + * if rv1 == 0: return 1 + * return 0 */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_sphere(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos, __pyx_v_radius); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields + /* "yt/geometry/selection_routines.pyx":2226 + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 0: return 1 # <<<<<<<<<<<<<< + * return 0 * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + */ + __pyx_t_1 = ((__pyx_v_rv1 == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 1; + goto __pyx_L0; + } + + /* "yt/geometry/selection_routines.pyx":2227 + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 0: return 1 + * return 0 # <<<<<<<<<<<<<< * + * def _hash_vals(self): */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "yt/geometry/selection_routines.pyx":2224 + * return 0 * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 0: return 1 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2229 + * return 0 * - * if ((child.byteorder == c'>' and little_endian) or + * def _hash_vals(self): # <<<<<<<<<<<<<< + * return (self.sel1._hash_vals() + + * ("not",)) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 799, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNOTSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNOTSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_hash_vals (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_18BooleanNOTSelector__hash_vals(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanNOTSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__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("_hash_vals", 0); + + /* "yt/geometry/selection_routines.pyx":2230 * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * def _hash_vals(self): + * return (self.sel1._hash_vals() + # <<<<<<<<<<<<<< + * ("not",)) * */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.sel1), __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + 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); } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2230, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2230, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + /* "yt/geometry/selection_routines.pyx":2231 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("not",)) # <<<<<<<<<<<<<< * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + * cdef class BooleanXORSelector(BooleanSelector): */ - __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:; + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_tuple__80); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2230, __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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "yt/geometry/selection_routines.pyx":2229 + * return 0 * - * 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 + * def _hash_vals(self): # <<<<<<<<<<<<<< + * return (self.sel1._hash_vals() + + * ("not",)) */ - __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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanNOTSelector._hash_vals", __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): */ - if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNOTSelector_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNOTSelector_3__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_2yt_8geometry_18selection_routines_18BooleanNOTSelector_2__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanNOTSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 803, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__81, 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) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanNOTSelector.__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__") */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNOTSelector_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNOTSelector_5__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_2yt_8geometry_18selection_routines_18BooleanNOTSelector_4__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanNOTSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *__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_v_f[0]) = 0x78; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__82, 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) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * + /* "(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__") */ - __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanNOTSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2235 + * cdef class BooleanXORSelector(BooleanSelector): * - * offset[0] += child.itemsize + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * # We always return True here, because we don't have a "fully included" */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_bbox(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { + int __pyx_r; + + /* "yt/geometry/selection_routines.pyx":2239 + * # We always return True here, because we don't have a "fully included" + * # check anywhere else. + * return 1 # <<<<<<<<<<<<<< * - * if not PyDataType_HASFIELDS(child): + * cdef int select_grid(self, np.float64_t left_edge[3], */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + __pyx_r = 1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* "yt/geometry/selection_routines.pyx":2235 + * cdef class BooleanXORSelector(BooleanSelector): * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * # We always return True here, because we don't have a "fully included" */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2241 + * return 1 * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_grid(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_left_edge, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_right_edge, CYTHON_UNUSED __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_grid *__pyx_optional_args) { + int __pyx_r; + if (__pyx_optional_args) { + } + + /* "yt/geometry/selection_routines.pyx":2244 + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + * return 1 # <<<<<<<<<<<<<< * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { + __pyx_r = 1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2241 + * return 1 * - * # Until ticket #99 is fixed, use integers to avoid warnings + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 823, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2246 + * return 1 * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * cdef int rv2 = self.sel2.select_cell(pos, dds) */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds) { + int __pyx_v_rv1; + int __pyx_v_rv2; + int __pyx_r; + int __pyx_t_1; + + /* "yt/geometry/selection_routines.pyx":2247 * - * # 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" + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * cdef int rv1 = self.sel1.select_cell(pos, dds) # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_cell(pos, dds) + * if rv1 == rv2: return 0 */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_cell(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos, __pyx_v_dds); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" + /* "yt/geometry/selection_routines.pyx":2248 + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * cdef int rv2 = self.sel2.select_cell(pos, dds) # <<<<<<<<<<<<<< + * if rv1 == rv2: return 0 + * return 1 */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_cell(__pyx_v_self->__pyx_base.sel2, __pyx_v_pos, __pyx_v_dds); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" + /* "yt/geometry/selection_routines.pyx":2249 + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * cdef int rv2 = self.sel2.select_cell(pos, dds) + * if rv1 == rv2: return 0 # <<<<<<<<<<<<<< + * return 1 + * */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } + __pyx_t_1 = ((__pyx_v_rv1 == __pyx_v_rv2) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" + /* "yt/geometry/selection_routines.pyx":2250 + * cdef int rv2 = self.sel2.select_cell(pos, dds) + * if rv1 == rv2: return 0 + * return 1 # <<<<<<<<<<<<<< + * + * cdef int select_point(self, np.float64_t pos[3]) nogil: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } + __pyx_r = 1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" + /* "yt/geometry/selection_routines.pyx":2246 + * return 1 + * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * cdef int rv2 = self.sel2.select_cell(pos, dds) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" +/* "yt/geometry/selection_routines.pyx":2252 + * return 1 + * + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_point(pos) + * cdef int rv2 = self.sel2.select_point(pos) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos) { + int __pyx_v_rv1; + int __pyx_v_rv2; + int __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" + /* "yt/geometry/selection_routines.pyx":2253 + * + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * cdef int rv1 = self.sel1.select_point(pos) # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_point(pos) + * if rv1 == rv2: return 0 */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_point(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" + /* "yt/geometry/selection_routines.pyx":2254 + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * cdef int rv1 = self.sel1.select_point(pos) + * cdef int rv2 = self.sel2.select_point(pos) # <<<<<<<<<<<<<< + * if rv1 == rv2: return 0 + * return 1 */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_point(__pyx_v_self->__pyx_base.sel2, __pyx_v_pos); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + /* "yt/geometry/selection_routines.pyx":2255 + * cdef int rv1 = self.sel1.select_point(pos) + * cdef int rv2 = self.sel2.select_point(pos) + * if rv1 == rv2: return 0 # <<<<<<<<<<<<<< + * return 1 + * */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } + __pyx_t_1 = ((__pyx_v_rv1 == __pyx_v_rv2) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + /* "yt/geometry/selection_routines.pyx":2256 + * cdef int rv2 = self.sel2.select_point(pos) + * if rv1 == rv2: return 0 + * return 1 # <<<<<<<<<<<<<< + * + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } + __pyx_r = 1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + /* "yt/geometry/selection_routines.pyx":2252 + * return 1 + * + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_point(pos) + * cdef int rv2 = self.sel2.select_point(pos) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2258 + * return 1 + * + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * cdef int rv2 = self.sel2.select_sphere(pos, radius) */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius) { + int __pyx_v_rv1; + int __pyx_v_rv2; + int __pyx_r; + int __pyx_t_1; + + /* "yt/geometry/selection_routines.pyx":2259 + * + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * cdef int rv1 = self.sel1.select_sphere(pos, radius) # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_sphere(pos, radius) + * if rv1 == rv2: return 0 */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_sphere(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos, __pyx_v_radius); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: + /* "yt/geometry/selection_routines.pyx":2260 + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * cdef int rv2 = self.sel2.select_sphere(pos, radius) # <<<<<<<<<<<<<< + * if rv1 == rv2: return 0 + * return 1 */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_sphere(__pyx_v_self->__pyx_base.sel2, __pyx_v_pos, __pyx_v_radius); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "yt/geometry/selection_routines.pyx":2261 + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * cdef int rv2 = self.sel2.select_sphere(pos, radius) + * if rv1 == rv2: return 0 # <<<<<<<<<<<<<< + * return 1 + * */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } + __pyx_t_1 = ((__pyx_v_rv1 == __pyx_v_rv2) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: + /* "yt/geometry/selection_routines.pyx":2262 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) + * if rv1 == rv2: return 0 + * return 1 # <<<<<<<<<<<<<< + * + * def _hash_vals(self): */ - /*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, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 844, __pyx_L1_error) - } - __pyx_L15:; + __pyx_r = 1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), + /* "yt/geometry/selection_routines.pyx":2258 + * return 1 + * + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * cdef int rv2 = self.sel2.select_sphere(pos, radius) */ - __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2264 + * return 1 * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + * def _hash_vals(self): # <<<<<<<<<<<<<< + * return (self.sel1._hash_vals() + + * ("xor",) + */ - goto __pyx_L13; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanXORSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanXORSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_hash_vals (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_18BooleanXORSelector__hash_vals(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanXORSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__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; + __Pyx_RefNannySetupContext("_hash_vals", 0); + + /* "yt/geometry/selection_routines.pyx":2265 * + * def _hash_vals(self): + * return (self.sel1._hash_vals() + # <<<<<<<<<<<<<< + * ("xor",) + + * self.sel2._hash_vals()) */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.sel1), __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + 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_L13:; + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2265, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2265, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields + /* "yt/geometry/selection_routines.pyx":2266 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("xor",) + # <<<<<<<<<<<<<< + * self.sel2._hash_vals()) * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields */ - } + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_tuple__83); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2267 + * return (self.sel1._hash_vals() + + * ("xor",) + + * self.sel2._hash_vals()) # <<<<<<<<<<<<<< * + * cdef class BooleanNEGSelector(BooleanSelector): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.sel2), __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2267, __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_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2267, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2267, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "yt/geometry/selection_routines.pyx":2266 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("xor",) + # <<<<<<<<<<<<<< + * self.sel2._hash_vals()) * */ - __pyx_r = __pyx_v_f; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "yt/geometry/selection_routines.pyx":2264 + * return 1 * - * 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. + * def _hash_vals(self): # <<<<<<<<<<<<<< + * return (self.sel1._hash_vals() + + * ("xor",) + */ /* 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("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanXORSelector._hash_vals", __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanXORSelector_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanXORSelector_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_18BooleanXORSelector_2__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *)__pyx_v_self)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanXORSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__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_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__84, 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) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_v_baseptr = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanXORSelector.__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__") */ - goto __pyx_L3; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanXORSelector_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanXORSelector_5__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_2yt_8geometry_18selection_routines_18BooleanXORSelector_4__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanXORSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *__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__") # <<<<<<<<<<<<<< */ - /*else*/ { - Py_INCREF(__pyx_v_base); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__85, 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) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr + /* "(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__") */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanXORSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2271 + * cdef class BooleanNEGSelector(BooleanSelector): * + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * # We always return True here, because we don't have a "fully included" */ - Py_XDECREF(__pyx_v_arr->base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { + int __pyx_r; + + /* "yt/geometry/selection_routines.pyx":2275 + * # We always return True here, because we don't have a "fully included" + * # check anywhere else. + * return self.sel1.select_bbox(left_edge, right_edge) # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): + * cdef int select_grid(self, np.float64_t left_edge[3], */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_r = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_bbox(__pyx_v_self->__pyx_base.sel1, __pyx_v_left_edge, __pyx_v_right_edge); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "yt/geometry/selection_routines.pyx":2271 + * cdef class BooleanNEGSelector(BooleanSelector): * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * # We always return True here, because we don't have a "fully included" */ /* function exit code */ - __Pyx_RefNannyFinishContext(); + __pyx_L0:; + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr +/* "yt/geometry/selection_routines.pyx":2277 + * return self.sel1.select_bbox(left_edge, right_edge) * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ -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); +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_grid *__pyx_optional_args) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/geometry/selection_routines.pyx":2279 + * cdef int select_grid(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: # <<<<<<<<<<<<<< + * return self.sel1.select_grid(left_edge, right_edge, level, o) * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: */ + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)NULL); + int __pyx_r; + int __pyx_t_1; + struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid __pyx_t_2; + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_o = __pyx_optional_args->o; + } } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - * + /* "yt/geometry/selection_routines.pyx":2280 + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + * return self.sel1.select_grid(left_edge, right_edge, level, o) # <<<<<<<<<<<<<< * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.o = __pyx_v_o; + __pyx_t_1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_grid(__pyx_v_self->__pyx_base.sel1, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_level, &__pyx_t_2); + __pyx_r = __pyx_t_1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "yt/geometry/selection_routines.pyx":2277 + * return self.sel1.select_bbox(left_edge, right_edge) * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() +/* "yt/geometry/selection_routines.pyx":2282 + * return self.sel1.select_grid(left_edge, right_edge, level, o) + * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 0: return 0 */ -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds) { + int __pyx_v_rv1; + int __pyx_v_rv2; 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); + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/geometry/selection_routines.pyx":2283 + * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * cdef int rv1 = self.sel1.select_cell(pos, dds) # <<<<<<<<<<<<<< + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_cell(pos, dds) */ - { - __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:*/ { + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_cell(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos, __pyx_v_dds); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/geometry/selection_routines.pyx":2284 + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 0: return 0 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_cell(pos, dds) + * if rv2 == 1: return 0 */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) + __pyx_t_1 = ((__pyx_v_rv1 == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/geometry/selection_routines.pyx":2285 + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_cell(pos, dds) # <<<<<<<<<<<<<< + * if rv2 == 1: return 0 + * return 1 */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_cell(__pyx_v_self->__pyx_base.sel2, __pyx_v_pos, __pyx_v_dds); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/geometry/selection_routines.pyx":2286 + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_cell(pos, dds) + * if rv2 == 1: return 0 # <<<<<<<<<<<<<< + * return 1 * */ - __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, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = ((__pyx_v_rv2 == 1) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2287 + * cdef int rv2 = self.sel2.select_cell(pos, dds) + * if rv2 == 1: return 0 + * return 1 # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + * cdef int select_point(self, np.float64_t pos[3]) nogil: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = 1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "yt/geometry/selection_routines.pyx":2282 + * return self.sel1.select_grid(left_edge, right_edge, level, o) + * + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_cell(pos, dds) + * if rv1 == 0: return 0 */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/geometry/selection_routines.pyx":2289 + * return 1 * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 0: return 0 */ -static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos) { + int __pyx_v_rv1; + int __pyx_v_rv2; 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); + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/geometry/selection_routines.pyx":2290 * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * cdef int rv1 = self.sel1.select_point(pos) # <<<<<<<<<<<<<< + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_point(pos) */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_point(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "yt/geometry/selection_routines.pyx":2291 + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 0: return 0 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_point(pos) + * if rv2 == 1: return 0 */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_t_1 = ((__pyx_v_rv1 == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * + /* "yt/geometry/selection_routines.pyx":2292 + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_point(pos) # <<<<<<<<<<<<<< + * if rv2 == 1: return 0 + * return 1 */ - __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, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_point(__pyx_v_self->__pyx_base.sel2, __pyx_v_pos); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2293 + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_point(pos) + * if rv2 == 1: return 0 # <<<<<<<<<<<<<< + * return 1 * - * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = ((__pyx_v_rv2 == 1) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/geometry/selection_routines.pyx":2294 + * cdef int rv2 = self.sel2.select_point(pos) + * if rv2 == 1: return 0 + * return 1 # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = 1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/geometry/selection_routines.pyx":2289 + * return 1 * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_point(pos) + * if rv1 == 0: return 0 */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") +/* "yt/geometry/selection_routines.pyx":2296 + * return 1 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 0: return 0 */ -static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { +static int __pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius) { + int __pyx_v_rv1; + int __pyx_v_rv2; 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); + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/geometry/selection_routines.pyx":2297 * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * cdef int rv1 = self.sel1.select_sphere(pos, radius) # <<<<<<<<<<<<<< + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) + __pyx_v_rv1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel1->__pyx_vtab)->select_sphere(__pyx_v_self->__pyx_base.sel1, __pyx_v_pos, __pyx_v_radius); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "yt/geometry/selection_routines.pyx":2298 + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 0: return 0 # <<<<<<<<<<<<<< + * cdef int rv2 = self.sel2.select_sphere(pos, radius) + * if rv2 == 1: return 0 */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_t_1 = ((__pyx_v_rv1 == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "yt/geometry/selection_routines.pyx":2299 + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) # <<<<<<<<<<<<<< + * if rv2 == 1: return 0 + * return 1 */ - __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, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_v_rv2 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->__pyx_base.sel2->__pyx_vtab)->select_sphere(__pyx_v_self->__pyx_base.sel2, __pyx_v_pos, __pyx_v_radius); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2300 + * if rv1 == 0: return 0 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) + * if rv2 == 1: return 0 # <<<<<<<<<<<<<< + * return 1 + * */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = ((__pyx_v_rv2 == 1) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/geometry/selection_routines.pyx":2301 + * cdef int rv2 = self.sel2.select_sphere(pos, radius) + * if rv2 == 1: return 0 + * return 1 # <<<<<<<<<<<<<< * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * def _hash_vals(self): */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = 1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/geometry/selection_routines.pyx":2296 + * return 1 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * cdef int rv1 = self.sel1.select_sphere(pos, radius) + * if rv1 == 0: return 0 */ /* 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; } -/* "oct_visitors.pxd":51 - * cdef void visit(self, Oct*, np.uint8_t selected) +/* "yt/geometry/selection_routines.pyx":2303 + * return 1 * - * cdef inline int oind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) + * def _hash_vals(self): # <<<<<<<<<<<<<< + * return (self.sel1._hash_vals() + + * ("neg",) + */ -static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { - int __pyx_v_d; - int __pyx_r; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNEGSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNEGSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("oind", 0); - - /* "oct_visitors.pxd":52 - * - * cdef inline int oind(self): - * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - * - */ - __pyx_v_d = (1 << __pyx_v_self->oref); - - /* "oct_visitors.pxd":53 - * cdef inline int oind(self): - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) # <<<<<<<<<<<<<< - * - * cdef inline int rind(self): - */ - __pyx_r = (((((__pyx_v_self->ind[0]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[2])); - goto __pyx_L0; - - /* "oct_visitors.pxd":51 - * cdef void visit(self, Oct*, np.uint8_t selected) - * - * cdef inline int oind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - */ + __Pyx_RefNannySetupContext("_hash_vals (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_18BooleanNEGSelector__hash_vals(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *)__pyx_v_self)); /* function exit code */ - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "oct_visitors.pxd":55 - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - * - * cdef inline int rind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) - */ - -static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { - int __pyx_v_d; - int __pyx_r; +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanNEGSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__pyx_v_self) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rind", 0); - - /* "oct_visitors.pxd":56 - * - * cdef inline int rind(self): - * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) - * - */ - __pyx_v_d = (1 << __pyx_v_self->oref); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "oct_visitors.pxd":57 - * cdef inline int rind(self): - * cdef int d = (1 << self.oref) - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2304 * - * cdef class CountTotalOcts(OctVisitor): + * def _hash_vals(self): + * return (self.sel1._hash_vals() + # <<<<<<<<<<<<<< + * ("neg",) + + * self.sel2._hash_vals()) */ - __pyx_r = (((((__pyx_v_self->ind[2]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[0])); - goto __pyx_L0; - - /* "oct_visitors.pxd":55 - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) - * - * cdef inline int rind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.sel1), __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2304, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2304, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -/* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + /* "yt/geometry/selection_routines.pyx":2305 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("neg",) + # <<<<<<<<<<<<<< + * self.sel2._hash_vals()) * - * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< - * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. - * return (((i*2)+j)*2+k) */ + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_tuple__86); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("cind", 0); + /* "yt/geometry/selection_routines.pyx":2306 + * return (self.sel1._hash_vals() + + * ("neg",) + + * self.sel2._hash_vals()) # <<<<<<<<<<<<<< + * + * cdef class ChainedBooleanSelector(SelectorObject): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.sel2), __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2306, __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_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2306, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "oct_visitors.pxd":125 - * cdef inline int cind(int i, int j, int k): - * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. - * return (((i*2)+j)*2+k) # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2305 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("neg",) + # <<<<<<<<<<<<<< + * self.sel2._hash_vals()) * */ - __pyx_r = ((((__pyx_v_i * 2) + __pyx_v_j) * 2) + __pyx_v_k); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + /* "yt/geometry/selection_routines.pyx":2303 + * return 1 * - * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< - * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. - * return (((i*2)+j)*2+k) + * def _hash_vals(self): # <<<<<<<<<<<<<< + * return (self.sel1._hash_vals() + + * ("neg",) + */ /* 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("yt.geometry.selection_routines.BooleanNEGSelector._hash_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNEGSelector_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNEGSelector_3__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_2yt_8geometry_18selection_routines_18BooleanNEGSelector_2__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *)__pyx_v_self)); - /* "yt/utilities/lib/fp_utils.pxd":20 - * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * - */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanNEGSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__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_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__87, 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) - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "(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_L0:; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanNEGSelector.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 +/* "(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__") */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNEGSelector_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNEGSelector_5__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_2yt_8geometry_18selection_routines_18BooleanNEGSelector_4__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "yt/utilities/lib/fp_utils.pxd":24 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 - * - */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< - * - * cdef inline int imin(int i0, int i1) nogil: +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_18BooleanNEGSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *__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_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__88, 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) - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + /* "(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_L0:; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.BooleanNEGSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 - * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 +/* "yt/geometry/selection_routines.pyx":2311 + * cdef int n_obj + * cdef np.ndarray selectors + * def __init__(self, dobj): # <<<<<<<<<<<<<< + * # These are data objects, not selectors + * self.n_obj = len(dobj.data_objects) */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { +/* Python wrapper */ +static int __pyx_pw_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dobj = 0; int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * - */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dobj,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dobj)) != 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(0, 2311, __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_dobj = values[0]; } - - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 - * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2311, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.geometry.selection_routines.ChainedBooleanSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_22ChainedBooleanSelector___init__(((struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *)__pyx_v_self), __pyx_v_dobj); /* function exit code */ - __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 +static int __pyx_pf_2yt_8geometry_18selection_routines_22ChainedBooleanSelector___init__(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *__pyx_v_self, PyObject *__pyx_v_dobj) { + int __pyx_v_i; + int __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; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "yt/geometry/selection_routines.pyx":2313 + * def __init__(self, dobj): + * # These are data objects, not selectors + * self.n_obj = len(dobj.data_objects) # <<<<<<<<<<<<<< + * self.selectors = np.empty(self.n_obj, dtype="object") + * for i in range(self.n_obj): */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_data_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2313, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->n_obj = __pyx_t_2; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; + /* "yt/geometry/selection_routines.pyx":2314 + * # These are data objects, not selectors + * self.n_obj = len(dobj.data_objects) + * self.selectors = np.empty(self.n_obj, dtype="object") # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * self.selectors[i] = dobj.data_objects[i].selector + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2314, __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->n_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_object) < 0) __PYX_ERR(0, 2314, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2314, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->selectors); + __Pyx_DECREF(((PyObject *)__pyx_v_self->selectors)); + __pyx_v_self->selectors = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "yt/geometry/selection_routines.pyx":2315 + * self.n_obj = len(dobj.data_objects) + * self.selectors = np.empty(self.n_obj, dtype="object") + * for i in range(self.n_obj): # <<<<<<<<<<<<<< + * self.selectors[i] = dobj.data_objects[i].selector * */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } + __pyx_t_6 = __pyx_v_self->n_obj; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2316 + * self.selectors = np.empty(self.n_obj, dtype="object") + * for i in range(self.n_obj): + * self.selectors[i] = dobj.data_objects[i].selector # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * cdef class ChainedBooleanANDSelector(ChainedBooleanSelector): */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_data_objects); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_selector); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_self->selectors), __pyx_v_i, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 2316, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + /* "yt/geometry/selection_routines.pyx":2311 + * cdef int n_obj + * cdef np.ndarray selectors + * def __init__(self, dobj): # <<<<<<<<<<<<<< + * # These are data objects, not selectors + * self.n_obj = len(dobj.data_objects) */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("yt.geometry.selection_routines.ChainedBooleanSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_3__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_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_2__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *)__pyx_v_self)); - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 - * - */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); - if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< - * - * cdef inline int iclip(int i, int a, int b) nogil: +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *__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_r = __pyx_v_f0; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__89, 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) - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + /* "(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_L0:; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.ChainedBooleanSelector.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b +/* "(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__") */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_5__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_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_4__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "yt/utilities/lib/fp_utils.pxd":40 - * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i - */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * - */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *__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); - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + /* "(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_r = __pyx_v_i; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__90, 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) - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "(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_L0:; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.ChainedBooleanSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b +/* "yt/geometry/selection_routines.pyx":2322 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * with gil: */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { +static int __pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { + int __pyx_v_i; int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("select_bbox", 0); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "yt/geometry/selection_routines.pyx":2324 + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + /*try:*/ { + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * - */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } + /* "yt/geometry/selection_routines.pyx":2325 + * np.float64_t right_edge[3]) nogil: + * with gil: + * for i in range(self.n_obj): # <<<<<<<<<<<<<< + * if (self.selectors[i]).select_bbox( + * left_edge, right_edge) == 0: + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.n_obj; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fclip(np.float64_t f, + /* "yt/geometry/selection_routines.pyx":2326 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( # <<<<<<<<<<<<<< + * left_edge, right_edge) == 0: + * return 0 + */ + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.selectors), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2326, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "yt/geometry/selection_routines.pyx":2327 + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( + * left_edge, right_edge) == 0: # <<<<<<<<<<<<<< + * return 0 + * return 1 */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_t_4 = ((((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3)->__pyx_vtab)->select_bbox(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3), __pyx_v_left_edge, __pyx_v_right_edge) == 0) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i + /* "yt/geometry/selection_routines.pyx":2326 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( # <<<<<<<<<<<<<< + * left_edge, right_edge) == 0: + * return 0 + */ + if (__pyx_t_4) { + + /* "yt/geometry/selection_routines.pyx":2328 + * if (self.selectors[i]).select_bbox( + * left_edge, right_edge) == 0: + * return 0 # <<<<<<<<<<<<<< + * return 1 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b */ + __pyx_r = 0; + goto __pyx_L6_return; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "yt/geometry/selection_routines.pyx":2326 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( # <<<<<<<<<<<<<< + * left_edge, right_edge) == 0: + * return 0 */ + } + } + } -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; + /* "yt/geometry/selection_routines.pyx":2324 + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L8; + } + __pyx_L6_return: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L3_return; + } + __pyx_L7_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + __pyx_L8:; + } + } - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2329 + * left_edge, right_edge) == 0: + * return 0 + * return 1 # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * @cython.cdivision(True) */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + __pyx_r = 1; + goto __pyx_L3_return; + } - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "yt/geometry/selection_routines.pyx":2324 + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( + */ + /*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; + } + } + + /* "yt/geometry/selection_routines.pyx":2322 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * with gil: */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.ChainedBooleanANDSelector.select_bbox", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; __pyx_L0:; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "yt/geometry/selection_routines.pyx":2334 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; +static int __pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_grid *__pyx_optional_args) { - /* "yt/utilities/lib/fp_utils.pxd":54 - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * + /* "yt/geometry/selection_routines.pyx":2336 + * cdef int select_grid(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)NULL); + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid __pyx_t_5; + int __pyx_t_6; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("select_grid", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_o = __pyx_optional_args->o; + } } + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + /* "yt/geometry/selection_routines.pyx":2337 + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + /*try:*/ { + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 - */ + /* "yt/geometry/selection_routines.pyx":2338 + * Oct *o = NULL) nogil: + * with gil: + * for i in range(self.n_obj): # <<<<<<<<<<<<<< + * if (self.selectors[i]).select_grid( + * left_edge, right_edge, level, o) == 0: + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.n_obj; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "yt/geometry/selection_routines.pyx":2339 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( # <<<<<<<<<<<<<< + * left_edge, right_edge, level, o) == 0: + * return 0 + */ + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.selectors), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2339, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "yt/geometry/selection_routines.pyx":2340 + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( + * left_edge, right_edge, level, o) == 0: # <<<<<<<<<<<<<< + * return 0 + * return 1 + */ + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.o = __pyx_v_o; + __pyx_t_4 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3)->__pyx_vtab)->select_grid(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3), __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_level, &__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((__pyx_t_4 == 0) != 0); -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "yt/geometry/selection_routines.pyx":2339 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( # <<<<<<<<<<<<<< + * left_edge, right_edge, level, o) == 0: + * return 0 + */ + if (__pyx_t_6) { + + /* "yt/geometry/selection_routines.pyx":2341 + * if (self.selectors[i]).select_grid( + * left_edge, right_edge, level, o) == 0: + * return 0 # <<<<<<<<<<<<<< + * return 1 * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 */ + __pyx_r = 0; + goto __pyx_L6_return; -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; + /* "yt/geometry/selection_routines.pyx":2339 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( # <<<<<<<<<<<<<< + * left_edge, right_edge, level, o) == 0: + * return 0 + */ + } + } + } - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "yt/geometry/selection_routines.pyx":2337 + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L8; + } + __pyx_L6_return: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L3_return; + } + __pyx_L7_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + __pyx_L8:; + } + } + + /* "yt/geometry/selection_routines.pyx":2342 + * left_edge, right_edge, level, o) == 0: + * return 0 + * return 1 # <<<<<<<<<<<<<< * + * @cython.cdivision(True) */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + __pyx_r = 1; + goto __pyx_L3_return; } - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * + /* "yt/geometry/selection_routines.pyx":2337 + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + /*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; + } + } - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "yt/geometry/selection_routines.pyx":2334 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.ChainedBooleanANDSelector.select_grid", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; __pyx_L0:; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif return __pyx_r; } -/* "yt/geometry/selection_routines.pxd":26 - * np.float64_t - * - * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): +/* "yt/geometry/selection_routines.pyx":2347 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ -static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; +static int __pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds) { + int __pyx_v_i; + int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_ensure_code", 0); + int __pyx_t_4; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("select_cell", 0); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif - /* "yt/geometry/selection_routines.pxd":27 - * - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): # <<<<<<<<<<<<<< - * if "code_length" == str(arr.units): - * return arr + /* "yt/geometry/selection_routines.pyx":2348 + * @cython.wraparound(False) + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 27, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + /*try:*/ { + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { - /* "yt/geometry/selection_routines.pxd":28 - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< - * return arr - * arr.convert_to_units("code_length") + /* "yt/geometry/selection_routines.pyx":2349 + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * with gil: + * for i in range(self.n_obj): # <<<<<<<<<<<<<< + * if (self.selectors[i]).select_cell( + * pos, dds) == 0: + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.n_obj; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/geometry/selection_routines.pyx":2350 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( # <<<<<<<<<<<<<< + * pos, dds) == 0: + * return 0 + */ + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.selectors), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2350, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "yt/geometry/selection_routines.pyx":2351 + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( + * pos, dds) == 0: # <<<<<<<<<<<<<< + * return 0 + * return 1 */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 28, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 28, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { + __pyx_t_4 = ((((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3)->__pyx_vtab)->select_cell(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3), __pyx_v_pos, __pyx_v_dds) == 0) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/geometry/selection_routines.pxd":29 - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): - * return arr # <<<<<<<<<<<<<< - * arr.convert_to_units("code_length") - * return arr + /* "yt/geometry/selection_routines.pyx":2350 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( # <<<<<<<<<<<<<< + * pos, dds) == 0: + * return 0 + */ + if (__pyx_t_4) { + + /* "yt/geometry/selection_routines.pyx":2352 + * if (self.selectors[i]).select_cell( + * pos, dds) == 0: + * return 0 # <<<<<<<<<<<<<< + * return 1 + * */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_arr); - __pyx_r = __pyx_v_arr; - goto __pyx_L0; + __pyx_r = 0; + goto __pyx_L6_return; - /* "yt/geometry/selection_routines.pxd":28 - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< - * return arr - * arr.convert_to_units("code_length") + /* "yt/geometry/selection_routines.pyx":2350 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( # <<<<<<<<<<<<<< + * pos, dds) == 0: + * return 0 */ - } + } + } + } - /* "yt/geometry/selection_routines.pxd":30 - * if "code_length" == str(arr.units): - * return arr - * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< - * return arr - * + /* "yt/geometry/selection_routines.pyx":2348 + * @cython.wraparound(False) + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L8; + } + __pyx_L6_return: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L3_return; + } + __pyx_L7_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + __pyx_L8:; + } + } - /* "yt/geometry/selection_routines.pxd":27 + /* "yt/geometry/selection_routines.pyx":2353 + * pos, dds) == 0: + * return 0 + * return 1 # <<<<<<<<<<<<<< * - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): # <<<<<<<<<<<<<< - * if "code_length" == str(arr.units): - * return arr + * @cython.cdivision(True) */ + __pyx_r = 1; + goto __pyx_L3_return; } - /* "yt/geometry/selection_routines.pxd":31 - * return arr - * arr.convert_to_units("code_length") - * return arr # <<<<<<<<<<<<<< - * - * cdef class SelectorObject: + /* "yt/geometry/selection_routines.pyx":2348 + * @cython.wraparound(False) + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_arr); - __pyx_r = __pyx_v_arr; - goto __pyx_L0; + /*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; + } + } - /* "yt/geometry/selection_routines.pxd":26 - * np.float64_t - * - * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): + /* "yt/geometry/selection_routines.pyx":2347 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.ChainedBooleanANDSelector.select_cell", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif return __pyx_r; } -/* "yt/geometry/selection_routines.pxd":78 - * cdef public np.int64_t domain_id - * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 +/* "yt/geometry/selection_routines.pyx":2358 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) { - __pyx_t_5numpy_float64_t __pyx_v_rel; - __pyx_t_5numpy_float64_t __pyx_r; +static int __pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos) { + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("select_point", 0); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif - /* "yt/geometry/selection_routines.pxd":80 - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< - * if not periodic: return rel - * if rel > dw * 0.5: + /* "yt/geometry/selection_routines.pyx":2359 + * @cython.wraparound(False) + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_point(pos) == 0: */ - __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); + /*try:*/ { + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { - /* "yt/geometry/selection_routines.pxd":81 - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel # <<<<<<<<<<<<<< - * if rel > dw * 0.5: - * rel -= dw + /* "yt/geometry/selection_routines.pyx":2360 + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * with gil: + * for i in range(self.n_obj): # <<<<<<<<<<<<<< + * if (self.selectors[i]).select_point(pos) == 0: + * return 0 + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.n_obj; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/geometry/selection_routines.pyx":2361 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_point(pos) == 0: # <<<<<<<<<<<<<< + * return 0 + * return 1 */ - __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_rel; - goto __pyx_L0; - } + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.selectors), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2361, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = ((((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3)->__pyx_vtab)->select_point(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3), __pyx_v_pos) == 0) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "yt/geometry/selection_routines.pyx":2362 + * for i in range(self.n_obj): + * if (self.selectors[i]).select_point(pos) == 0: + * return 0 # <<<<<<<<<<<<<< + * return 1 + * + */ + __pyx_r = 0; + goto __pyx_L6_return; - /* "yt/geometry/selection_routines.pxd":82 - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel - * if rel > dw * 0.5: # <<<<<<<<<<<<<< - * rel -= dw - * elif rel < -dw * 0.5: + /* "yt/geometry/selection_routines.pyx":2361 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_point(pos) == 0: # <<<<<<<<<<<<<< + * return 0 + * return 1 */ - __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0); - if (__pyx_t_1) { + } + } + } - /* "yt/geometry/selection_routines.pxd":83 - * if not periodic: return rel - * if rel > dw * 0.5: - * rel -= dw # <<<<<<<<<<<<<< - * elif rel < -dw * 0.5: - * rel += dw + /* "yt/geometry/selection_routines.pyx":2359 + * @cython.wraparound(False) + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_point(pos) == 0: */ - __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw); + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L8; + } + __pyx_L6_return: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L3_return; + } + __pyx_L7_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + __pyx_L8:; + } + } - /* "yt/geometry/selection_routines.pxd":82 - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel - * if rel > dw * 0.5: # <<<<<<<<<<<<<< - * rel -= dw - * elif rel < -dw * 0.5: + /* "yt/geometry/selection_routines.pyx":2363 + * if (self.selectors[i]).select_point(pos) == 0: + * return 0 + * return 1 # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) */ - goto __pyx_L4; + __pyx_r = 1; + goto __pyx_L3_return; } - /* "yt/geometry/selection_routines.pxd":84 - * if rel > dw * 0.5: - * rel -= dw - * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< - * rel += dw - * return rel - */ - __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/selection_routines.pxd":85 - * rel -= dw - * elif rel < -dw * 0.5: - * rel += dw # <<<<<<<<<<<<<< - * return rel - */ - __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw); - - /* "yt/geometry/selection_routines.pxd":84 - * if rel > dw * 0.5: - * rel -= dw - * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< - * rel += dw - * return rel + /* "yt/geometry/selection_routines.pyx":2359 + * @cython.wraparound(False) + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_point(pos) == 0: */ + /*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; + } } - __pyx_L4:; - - /* "yt/geometry/selection_routines.pxd":86 - * elif rel < -dw * 0.5: - * rel += dw - * return rel # <<<<<<<<<<<<<< - */ - __pyx_r = __pyx_v_rel; - goto __pyx_L0; - /* "yt/geometry/selection_routines.pxd":78 - * cdef public np.int64_t domain_id - * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 + /* "yt/geometry/selection_routines.pyx":2358 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.ChainedBooleanANDSelector.select_point", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; __pyx_L0:; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif return __pyx_r; } -/* "yt/utilities/lib/volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * +/* "yt/geometry/selection_routines.pyx":2368 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { +static int __pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius) { + int __pyx_v_i; int __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("vc_index", 0); + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("select_sphere", 0); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif - /* "yt/utilities/lib/volume_container.pxd":31 - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): - * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): + /* "yt/geometry/selection_routines.pyx":2369 + * @cython.wraparound(False) + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( */ - __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); - goto __pyx_L0; + /*try:*/ { + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { - /* "yt/utilities/lib/volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - */ + /* "yt/geometry/selection_routines.pyx":2370 + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * with gil: + * for i in range(self.n_obj): # <<<<<<<<<<<<<< + * if (self.selectors[i]).select_sphere( + * pos, radius) == 0: + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.n_obj; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "yt/geometry/selection_routines.pyx":2371 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( # <<<<<<<<<<<<<< + * pos, radius) == 0: + * return 0 + */ + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.selectors), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2371, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "yt/geometry/selection_routines.pyx":2372 + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( + * pos, radius) == 0: # <<<<<<<<<<<<<< + * return 0 + * return 1 + */ + __pyx_t_4 = ((((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3)->__pyx_vtab)->select_sphere(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3), __pyx_v_pos, __pyx_v_radius) == 0) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -/* "yt/utilities/lib/volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k + /* "yt/geometry/selection_routines.pyx":2371 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( # <<<<<<<<<<<<<< + * pos, radius) == 0: + * return 0 + */ + if (__pyx_t_4) { + + /* "yt/geometry/selection_routines.pyx":2373 + * if (self.selectors[i]).select_sphere( + * pos, radius) == 0: + * return 0 # <<<<<<<<<<<<<< + * return 1 * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i */ + __pyx_r = 0; + goto __pyx_L6_return; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { - int __pyx_v_index[3]; - int __pyx_v_i; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("vc_pos_index", 0); + /* "yt/geometry/selection_routines.pyx":2371 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( # <<<<<<<<<<<<<< + * pos, radius) == 0: + * return 0 + */ + } + } + } - /* "yt/utilities/lib/volume_container.pxd":36 - * cdef int index[3] - * cdef int i - * for i in range(3): # <<<<<<<<<<<<<< - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) + /* "yt/geometry/selection_routines.pyx":2369 + * @cython.wraparound(False) + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L8; + } + __pyx_L6_return: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L3_return; + } + __pyx_L7_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + __pyx_L8:; + } + } - /* "yt/utilities/lib/volume_container.pxd":37 - * cdef int i - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< - * return vc_index(vc, index[0], index[1], index[2]) + /* "yt/geometry/selection_routines.pyx":2374 + * pos, radius) == 0: + * return 0 + * return 1 # <<<<<<<<<<<<<< * + * def _hash_vals(self): */ - (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); + __pyx_r = 1; + goto __pyx_L3_return; } - /* "yt/utilities/lib/volume_container.pxd":38 - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< - * + /* "yt/geometry/selection_routines.pyx":2369 + * @cython.wraparound(False) + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); - goto __pyx_L0; + /*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; + } + } - /* "yt/utilities/lib/volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i + /* "yt/geometry/selection_routines.pyx":2368 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.ChainedBooleanANDSelector.select_sphere", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif return __pyx_r; } -/* "View.MemoryView":120 - * cdef bint dtype_is_object - * - * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< - * mode="c", bint allocate_buffer=True): +/* "yt/geometry/selection_routines.pyx":2376 + * return 1 * + * def _hash_vals(self): # <<<<<<<<<<<<<< + * v = ("chained_and",) + * for s in self.selectors: */ /* 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; +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; - PyObject* values[5] = {0,0,0,0,0}; - values[3] = ((PyObject *)__pyx_n_s_c); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(3, 120, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(3, 120, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RefNannySetupContext("_hash_vals (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector__hash_vals(((struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self) { + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_v_s = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("_hash_vals", 0); + + /* "yt/geometry/selection_routines.pyx":2377 + * + * def _hash_vals(self): + * v = ("chained_and",) # <<<<<<<<<<<<<< + * for s in self.selectors: + * v += s._hash_vals() + */ + __Pyx_INCREF(__pyx_tuple__91); + __pyx_v_v = __pyx_tuple__91; + + /* "yt/geometry/selection_routines.pyx":2378 + * def _hash_vals(self): + * v = ("chained_and",) + * for s in self.selectors: # <<<<<<<<<<<<<< + * v += s._hash_vals() + * return v + */ + if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self->__pyx_base.selectors))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self->__pyx_base.selectors))) { + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.selectors); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self->__pyx_base.selectors)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __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, 2378, __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, 2378, __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, 2378, __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, 2378, __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, 2378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif } } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 2378, __pyx_L1_error) + } break; - default: goto __pyx_L5_argtuple_error; } + __Pyx_GOTREF(__pyx_t_4); } - __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(3, 120, __pyx_L3_error) - __pyx_v_format = values[2]; - __pyx_v_mode = values[3]; - if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 121, __pyx_L3_error) - } else { + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4); + __pyx_t_4 = 0; - /* "View.MemoryView":121 + /* "yt/geometry/selection_routines.pyx":2379 + * v = ("chained_and",) + * for s in self.selectors: + * v += s._hash_vals() # <<<<<<<<<<<<<< + * return v * - * 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); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } } + if (__pyx_t_6) { + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2379, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2379, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_v, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "yt/geometry/selection_routines.pyx":2378 + * def _hash_vals(self): + * v = ("chained_and",) + * for s in self.selectors: # <<<<<<<<<<<<<< + * v += s._hash_vals() + * return v + */ } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 120, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(3, 120, __pyx_L1_error) - if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(3, 120, __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); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":120 - * cdef bint dtype_is_object + /* "yt/geometry/selection_routines.pyx":2380 + * for s in self.selectors: + * v += s._hash_vals() + * return v # <<<<<<<<<<<<<< * - * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< - * mode="c", bint allocate_buffer=True): + * intersection_selector = ChainedBooleanANDSelector + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_v); + __pyx_r = __pyx_v_v; + goto __pyx_L0; + + /* "yt/geometry/selection_routines.pyx":2376 + * return 1 * + * def _hash_vals(self): # <<<<<<<<<<<<<< + * v = ("chained_and",) + * for s in self.selectors: */ /* function exit code */ - goto __pyx_L0; __pyx_L1_error:; - __pyx_r = -1; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("yt.geometry.selection_routines.ChainedBooleanANDSelector._hash_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); __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; +/* "(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_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __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; - __Pyx_RefNannySetupContext("__cinit__", 0); - __Pyx_INCREF(__pyx_v_format); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_2__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *)__pyx_v_self)); - /* "View.MemoryView":127 - * 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(3, 127, __pyx_L1_error) - } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 127, __pyx_L1_error) - __pyx_v_self->ndim = ((int)__pyx_t_1); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":128 - * - * self.ndim = len(shape) - * self.itemsize = itemsize # <<<<<<<<<<<<<< - * - * if not self.ndim: - */ - __pyx_v_self->itemsize = __pyx_v_itemsize; +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "View.MemoryView":130 - * self.itemsize = itemsize - * - * if not self.ndim: # <<<<<<<<<<<<<< - * raise ValueError("Empty shape tuple for cython.array") - * + /* "(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_2 = ((!(__pyx_v_self->ndim != 0)) != 0); - if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__92, 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) - /* "View.MemoryView":131 - * - * if not self.ndim: - * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< - * - * if itemsize <= 0: + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 131, __pyx_L1_error) - /* "View.MemoryView":130 - * self.itemsize = itemsize - * - * if not self.ndim: # <<<<<<<<<<<<<< - * raise ValueError("Empty shape tuple for cython.array") - * - */ - } + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.ChainedBooleanANDSelector.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":133 - * raise ValueError("Empty shape tuple for cython.array") - * - * if itemsize <= 0: # <<<<<<<<<<<<<< - * raise ValueError("itemsize <= 0 for cython.array") - * +/* "(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__") */ - __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":134 - * - * if itemsize <= 0: - * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< - * - * if not isinstance(format, bytes): +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_5__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_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_4__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *__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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 134, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__93, 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) - /* "View.MemoryView":133 - * raise ValueError("Empty shape tuple for cython.array") - * - * if itemsize <= 0: # <<<<<<<<<<<<<< - * raise ValueError("itemsize <= 0 for cython.array") - * + /* "(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__") */ - } - /* "View.MemoryView":136 - * raise ValueError("itemsize <= 0 for cython.array") - * - * if not isinstance(format, bytes): # <<<<<<<<<<<<<< - * format = format.encode('ASCII') - * self._format = format # keep a reference to the byte string - */ - __pyx_t_2 = PyBytes_Check(__pyx_v_format); - __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); - if (__pyx_t_4) { + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.geometry.selection_routines.ChainedBooleanANDSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":137 - * - * if not isinstance(format, bytes): - * format = format.encode('ASCII') # <<<<<<<<<<<<<< - * self._format = format # keep a reference to the byte string - * self.format = self._format +/* "yt/geometry/selection_routines.pyx":2388 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * with gil: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); - __pyx_t_5 = 0; - /* "View.MemoryView":136 - * raise ValueError("itemsize <= 0 for cython.array") - * - * if not isinstance(format, bytes): # <<<<<<<<<<<<<< - * format = format.encode('ASCII') - * self._format = format # keep a reference to the byte string - */ - } +static int __pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_bbox(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge) { + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("select_bbox", 0); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif - /* "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 - * + /* "yt/geometry/selection_routines.pyx":2390 + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( */ - 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(3, 138, __pyx_L1_error) - __pyx_t_5 = __pyx_v_format; - __Pyx_INCREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_v_self->_format); - __Pyx_DECREF(__pyx_v_self->_format); - __pyx_v_self->_format = ((PyObject*)__pyx_t_5); - __pyx_t_5 = 0; + /*try:*/ { + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { - /* "View.MemoryView":139 - * format = format.encode('ASCII') - * self._format = format # keep a reference to the byte string - * self.format = self._format # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 139, __pyx_L1_error) - __pyx_v_self->format = __pyx_t_6; + /* "yt/geometry/selection_routines.pyx":2391 + * np.float64_t right_edge[3]) nogil: + * with gil: + * for i in range(self.n_obj): # <<<<<<<<<<<<<< + * if (self.selectors[i]).select_bbox( + * left_edge, right_edge) == 1: + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.n_obj; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "View.MemoryView":142 - * - * - * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< - * self._strides = self._shape + self.ndim - * + /* "yt/geometry/selection_routines.pyx":2392 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( # <<<<<<<<<<<<<< + * left_edge, right_edge) == 1: + * return 1 + */ + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.selectors), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2392, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "yt/geometry/selection_routines.pyx":2393 + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( + * left_edge, right_edge) == 1: # <<<<<<<<<<<<<< + * return 1 + * return 0 */ - __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); + __pyx_t_4 = ((((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3)->__pyx_vtab)->select_bbox(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3), __pyx_v_left_edge, __pyx_v_right_edge) == 1) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":143 - * - * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) - * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2392 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( # <<<<<<<<<<<<<< + * left_edge, right_edge) == 1: + * return 1 + */ + if (__pyx_t_4) { + + /* "yt/geometry/selection_routines.pyx":2394 + * if (self.selectors[i]).select_bbox( + * left_edge, right_edge) == 1: + * return 1 # <<<<<<<<<<<<<< + * return 0 * - * if not self._shape: */ - __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); + __pyx_r = 1; + goto __pyx_L6_return; - /* "View.MemoryView":145 - * self._strides = self._shape + self.ndim - * - * if not self._shape: # <<<<<<<<<<<<<< - * raise MemoryError("unable to allocate shape and strides.") - * + /* "yt/geometry/selection_routines.pyx":2392 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( # <<<<<<<<<<<<<< + * left_edge, right_edge) == 1: + * return 1 */ - __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); - if (__pyx_t_4) { + } + } + } - /* "View.MemoryView":146 - * - * if not self._shape: - * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< - * - * + /* "yt/geometry/selection_routines.pyx":2390 + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 146, __pyx_L1_error) + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L8; + } + __pyx_L6_return: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L3_return; + } + __pyx_L7_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + __pyx_L8:; + } + } - /* "View.MemoryView":145 - * self._strides = self._shape + self.ndim - * - * if not self._shape: # <<<<<<<<<<<<<< - * raise MemoryError("unable to allocate shape and strides.") + /* "yt/geometry/selection_routines.pyx":2395 + * left_edge, right_edge) == 1: + * return 1 + * return 0 # <<<<<<<<<<<<<< * + * @cython.cdivision(True) */ + __pyx_r = 0; + goto __pyx_L3_return; } - /* "View.MemoryView":149 - * - * - * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< - * if dim <= 0: - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + /* "yt/geometry/selection_routines.pyx":2390 + * cdef int select_bbox(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_bbox( */ - __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(3, 149, __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(3, 149, __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(3, 149, __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); + /*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; + } + } - /* "View.MemoryView":150 - * - * for idx, dim in enumerate(shape): - * if dim <= 0: # <<<<<<<<<<<<<< - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) - * self._shape[idx] = dim + /* "yt/geometry/selection_routines.pyx":2388 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_bbox(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3]) nogil: + * with gil: */ - __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); - if (__pyx_t_4) { - /* "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 - * + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.ChainedBooleanORSelector.select_bbox", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2400 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 151, __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(3, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(3, 151, __pyx_L1_error) - /* "View.MemoryView":150 - * - * for idx, dim in enumerate(shape): - * if dim <= 0: # <<<<<<<<<<<<<< - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) - * self._shape[idx] = dim +static int __pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_grid(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_grid *__pyx_optional_args) { + + /* "yt/geometry/selection_routines.pyx":2402 + * cdef int select_grid(self, np.float64_t left_edge[3], + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)NULL); + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid __pyx_t_5; + int __pyx_t_6; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("select_grid", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_o = __pyx_optional_args->o; } + } + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif - /* "View.MemoryView":152 - * if dim <= 0: - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) - * self._shape[idx] = dim # <<<<<<<<<<<<<< - * - * cdef char order + /* "yt/geometry/selection_routines.pyx":2403 + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( */ - (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; + /*try:*/ { + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { - /* "View.MemoryView":149 - * - * - * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< - * if dim <= 0: - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + /* "yt/geometry/selection_routines.pyx":2404 + * Oct *o = NULL) nogil: + * with gil: + * for i in range(self.n_obj): # <<<<<<<<<<<<<< + * if (self.selectors[i]).select_grid( + * left_edge, right_edge, level, o) == 1: + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.n_obj; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/geometry/selection_routines.pyx":2405 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( # <<<<<<<<<<<<<< + * left_edge, right_edge, level, o) == 1: + * return 1 + */ + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.selectors), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2405, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "yt/geometry/selection_routines.pyx":2406 + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( + * left_edge, right_edge, level, o) == 1: # <<<<<<<<<<<<<< + * return 1 + * return 0 */ - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.o = __pyx_v_o; + __pyx_t_4 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3)->__pyx_vtab)->select_grid(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3), __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_level, &__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((__pyx_t_4 == 1) != 0); - /* "View.MemoryView":155 + /* "yt/geometry/selection_routines.pyx":2405 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( # <<<<<<<<<<<<<< + * left_edge, right_edge, level, o) == 1: + * return 1 + */ + if (__pyx_t_6) { + + /* "yt/geometry/selection_routines.pyx":2407 + * if (self.selectors[i]).select_grid( + * left_edge, right_edge, level, o) == 1: + * return 1 # <<<<<<<<<<<<<< + * return 0 * - * 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(3, 155, __pyx_L1_error) - if (__pyx_t_4) { + __pyx_r = 1; + goto __pyx_L6_return; - /* "View.MemoryView":156 - * cdef char order - * if mode == 'fortran': - * order = b'F' # <<<<<<<<<<<<<< - * self.mode = u'fortran' - * elif mode == 'c': + /* "yt/geometry/selection_routines.pyx":2405 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( # <<<<<<<<<<<<<< + * left_edge, right_edge, level, o) == 1: + * return 1 */ - __pyx_v_order = 'F'; + } + } + } - /* "View.MemoryView":157 - * if mode == 'fortran': - * order = b'F' - * self.mode = u'fortran' # <<<<<<<<<<<<<< - * elif mode == 'c': - * order = b'C' + /* "yt/geometry/selection_routines.pyx":2403 + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( */ - __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; + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L8; + } + __pyx_L6_return: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L3_return; + } + __pyx_L7_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + __pyx_L8:; + } + } - /* "View.MemoryView":155 + /* "yt/geometry/selection_routines.pyx":2408 + * left_edge, right_edge, level, o) == 1: + * return 1 + * return 0 # <<<<<<<<<<<<<< * - * cdef char order - * if mode == 'fortran': # <<<<<<<<<<<<<< - * order = b'F' - * self.mode = u'fortran' + * @cython.cdivision(True) */ - goto __pyx_L10; + __pyx_r = 0; + goto __pyx_L3_return; } - /* "View.MemoryView":158 - * order = b'F' - * self.mode = u'fortran' - * elif mode == 'c': # <<<<<<<<<<<<<< - * order = b'C' - * self.mode = u'c' + /* "yt/geometry/selection_routines.pyx":2403 + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_grid( */ - __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 158, __pyx_L1_error) - if (__pyx_t_4) { + /*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; + } + } - /* "View.MemoryView":159 - * self.mode = u'fortran' - * elif mode == 'c': - * order = b'C' # <<<<<<<<<<<<<< - * self.mode = u'c' - * else: + /* "yt/geometry/selection_routines.pyx":2400 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< + * np.float64_t right_edge[3], np.int32_t level, + * Oct *o = NULL) nogil: */ - __pyx_v_order = 'C'; - /* "View.MemoryView":160 - * 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; + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.ChainedBooleanORSelector.select_grid", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} - /* "View.MemoryView":158 - * order = b'F' - * self.mode = u'fortran' - * elif mode == 'c': # <<<<<<<<<<<<<< - * order = b'C' - * self.mode = u'c' +/* "yt/geometry/selection_routines.pyx":2413 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ - goto __pyx_L10; - } - /* "View.MemoryView":162 - * self.mode = u'c' - * else: - * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< - * - * self.len = fill_contig_strides_array(self._shape, self._strides, - */ - /*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(3, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 162, __pyx_L1_error) - } - __pyx_L10:; +static int __pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_cell(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_dds) { + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("select_cell", 0); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif - /* "View.MemoryView":164 - * 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) - * + /* "yt/geometry/selection_routines.pyx":2414 + * @cython.wraparound(False) + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( */ - __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); + /*try:*/ { + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { - /* "View.MemoryView":167 - * 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; + /* "yt/geometry/selection_routines.pyx":2415 + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * with gil: + * for i in range(self.n_obj): # <<<<<<<<<<<<<< + * if (self.selectors[i]).select_cell( + * pos, dds) == 1: + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.n_obj; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "View.MemoryView":168 - * - * self.free_data = allocate_buffer - * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< - * if allocate_buffer: - * + /* "yt/geometry/selection_routines.pyx":2416 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( # <<<<<<<<<<<<<< + * pos, dds) == 1: + * return 1 + */ + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.selectors), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2416, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "yt/geometry/selection_routines.pyx":2417 + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( + * pos, dds) == 1: # <<<<<<<<<<<<<< + * return 1 + * return 0 */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 168, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_self->dtype_is_object = __pyx_t_4; + __pyx_t_4 = ((((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3)->__pyx_vtab)->select_cell(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3), __pyx_v_pos, __pyx_v_dds) == 1) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":169 - * self.free_data = allocate_buffer - * self.dtype_is_object = format == b'O' - * if allocate_buffer: # <<<<<<<<<<<<<< - * + /* "yt/geometry/selection_routines.pyx":2416 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( # <<<<<<<<<<<<<< + * pos, dds) == 1: + * return 1 + */ + if (__pyx_t_4) { + + /* "yt/geometry/selection_routines.pyx":2418 + * if (self.selectors[i]).select_cell( + * pos, dds) == 1: + * return 1 # <<<<<<<<<<<<<< + * return 0 * */ - __pyx_t_4 = (__pyx_v_allocate_buffer != 0); - if (__pyx_t_4) { + __pyx_r = 1; + goto __pyx_L6_return; - /* "View.MemoryView":172 - * - * - * self.data = malloc(self.len) # <<<<<<<<<<<<<< - * if not self.data: - * raise MemoryError("unable to allocate array data.") + /* "yt/geometry/selection_routines.pyx":2416 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( # <<<<<<<<<<<<<< + * pos, dds) == 1: + * return 1 */ - __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); + } + } + } - /* "View.MemoryView":173 - * - * self.data = malloc(self.len) - * if not self.data: # <<<<<<<<<<<<<< - * raise MemoryError("unable to allocate array data.") - * + /* "yt/geometry/selection_routines.pyx":2414 + * @cython.wraparound(False) + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( */ - __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); - if (__pyx_t_4) { - - /* "View.MemoryView":174 - * self.data = malloc(self.len) - * if not self.data: - * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L8; + } + __pyx_L6_return: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L3_return; + } + __pyx_L7_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + __pyx_L8:; + } + } + + /* "yt/geometry/selection_routines.pyx":2419 + * pos, dds) == 1: + * return 1 + * return 0 # <<<<<<<<<<<<<< * - * if self.dtype_is_object: + * @cython.cdivision(True) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 174, __pyx_L1_error) + __pyx_r = 0; + goto __pyx_L3_return; + } - /* "View.MemoryView":173 - * - * self.data = malloc(self.len) - * if not self.data: # <<<<<<<<<<<<<< - * raise MemoryError("unable to allocate array data.") - * + /* "yt/geometry/selection_routines.pyx":2414 + * @cython.wraparound(False) + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_cell( */ + /*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; } + } - /* "View.MemoryView":176 - * raise MemoryError("unable to allocate array data.") - * - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * p = self.data - * for i in range(self.len / itemsize): + /* "yt/geometry/selection_routines.pyx":2413 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ - __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); - if (__pyx_t_4) { - /* "View.MemoryView":177 - * - * if self.dtype_is_object: - * p = self.data # <<<<<<<<<<<<<< - * for i in range(self.len / itemsize): - * p[i] = Py_None + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.ChainedBooleanORSelector.select_cell", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pyx":2424 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ - __pyx_v_p = ((PyObject **)__pyx_v_self->data); - /* "View.MemoryView":178 - * if self.dtype_is_object: - * p = self.data - * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< - * p[i] = Py_None - * Py_INCREF(Py_None) +static int __pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_point(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos) { + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("select_point", 0); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + + /* "yt/geometry/selection_routines.pyx":2425 + * @cython.wraparound(False) + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_point(pos) == 1: */ - if (unlikely(__pyx_v_itemsize == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(3, 178, __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(3, 178, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; + /*try:*/ { + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { - /* "View.MemoryView":179 - * p = self.data - * for i in range(self.len / itemsize): - * p[i] = Py_None # <<<<<<<<<<<<<< - * Py_INCREF(Py_None) + /* "yt/geometry/selection_routines.pyx":2426 + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * with gil: + * for i in range(self.n_obj): # <<<<<<<<<<<<<< + * if (self.selectors[i]).select_point(pos) == 1: + * return 1 + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.n_obj; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/geometry/selection_routines.pyx":2427 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_point(pos) == 1: # <<<<<<<<<<<<<< + * return 1 + * return 0 + */ + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.selectors), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2427, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = ((((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3)->__pyx_vtab)->select_point(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3), __pyx_v_pos) == 1) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "yt/geometry/selection_routines.pyx":2428 + * for i in range(self.n_obj): + * if (self.selectors[i]).select_point(pos) == 1: + * return 1 # <<<<<<<<<<<<<< + * return 0 * */ - (__pyx_v_p[__pyx_v_i]) = Py_None; + __pyx_r = 1; + goto __pyx_L6_return; - /* "View.MemoryView":180 - * for i in range(self.len / itemsize): - * p[i] = Py_None - * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * - * @cname('getbuffer') + /* "yt/geometry/selection_routines.pyx":2427 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_point(pos) == 1: # <<<<<<<<<<<<<< + * return 1 + * return 0 */ - Py_INCREF(Py_None); - } + } + } + } - /* "View.MemoryView":176 - * raise MemoryError("unable to allocate array data.") - * - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * p = self.data - * for i in range(self.len / itemsize): + /* "yt/geometry/selection_routines.pyx":2425 + * @cython.wraparound(False) + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_point(pos) == 1: */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L8; + } + __pyx_L6_return: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L3_return; + } + __pyx_L7_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + __pyx_L8:; + } } - /* "View.MemoryView":169 - * self.free_data = allocate_buffer - * self.dtype_is_object = format == b'O' - * if allocate_buffer: # <<<<<<<<<<<<<< - * + /* "yt/geometry/selection_routines.pyx":2429 + * if (self.selectors[i]).select_point(pos) == 1: + * return 1 + * return 0 # <<<<<<<<<<<<<< * + * @cython.cdivision(True) */ + __pyx_r = 0; + goto __pyx_L3_return; } - /* "View.MemoryView":120 - * cdef bint dtype_is_object - * - * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< - * mode="c", bint allocate_buffer=True): - * + /* "yt/geometry/selection_routines.pyx":2425 + * @cython.wraparound(False) + * cdef int select_point(self, np.float64_t pos[3]) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_point(pos) == 1: + */ + /*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; + } + } + + /* "yt/geometry/selection_routines.pyx":2424 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_point(self, np.float64_t pos[3]) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ /* function exit code */ @@ -37065,1166 +40984,939 @@ 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_WriteUnraisable("yt.geometry.selection_routines.ChainedBooleanORSelector.select_point", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_format); - __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif return __pyx_r; } -/* "View.MemoryView":183 - * - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< - * cdef int bufmode = -1 - * if self.mode == u"c": +/* "yt/geometry/selection_routines.pyx":2434 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ -/* 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; +static int __pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_sphere(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_radius) { + int __pyx_v_i; 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; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } + int __pyx_t_4; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("select_sphere", 0); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif - /* "View.MemoryView":184 - * @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 + /* "yt/geometry/selection_routines.pyx":2435 + * @cython.wraparound(False) + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( */ - __pyx_v_bufmode = -1; + /*try:*/ { + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { - /* "View.MemoryView":185 - * def __getbuffer__(self, Py_buffer *info, int flags): - * cdef int bufmode = -1 - * if self.mode == u"c": # <<<<<<<<<<<<<< - * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * elif self.mode == u"fortran": - */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 185, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + /* "yt/geometry/selection_routines.pyx":2436 + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * with gil: + * for i in range(self.n_obj): # <<<<<<<<<<<<<< + * if (self.selectors[i]).select_sphere( + * pos, radius) == 1: + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.n_obj; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "View.MemoryView":186 - * 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 + /* "yt/geometry/selection_routines.pyx":2437 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( # <<<<<<<<<<<<<< + * pos, radius) == 1: + * return 1 + */ + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.selectors), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2437, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "yt/geometry/selection_routines.pyx":2438 + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( + * pos, radius) == 1: # <<<<<<<<<<<<<< + * return 1 + * return 0 */ - __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + __pyx_t_4 = ((((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3)->__pyx_vtab)->select_sphere(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_3), __pyx_v_pos, __pyx_v_radius) == 1) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":185 - * def __getbuffer__(self, Py_buffer *info, int flags): - * cdef int bufmode = -1 - * if self.mode == u"c": # <<<<<<<<<<<<<< - * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * elif self.mode == u"fortran": + /* "yt/geometry/selection_routines.pyx":2437 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( # <<<<<<<<<<<<<< + * pos, radius) == 1: + * return 1 + */ + if (__pyx_t_4) { + + /* "yt/geometry/selection_routines.pyx":2439 + * if (self.selectors[i]).select_sphere( + * pos, radius) == 1: + * return 1 # <<<<<<<<<<<<<< + * return 0 + * */ - goto __pyx_L3; - } + __pyx_r = 1; + goto __pyx_L6_return; - /* "View.MemoryView":187 - * if self.mode == u"c": - * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * elif self.mode == u"fortran": # <<<<<<<<<<<<<< - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): + /* "yt/geometry/selection_routines.pyx":2437 + * with gil: + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( # <<<<<<<<<<<<<< + * pos, radius) == 1: + * return 1 */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 187, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { + } + } + } - /* "View.MemoryView":188 - * 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.") + /* "yt/geometry/selection_routines.pyx":2435 + * @cython.wraparound(False) + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( */ - __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L8; + } + __pyx_L6_return: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L3_return; + } + __pyx_L7_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + __pyx_L8:; + } + } - /* "View.MemoryView":187 - * if self.mode == u"c": - * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * elif self.mode == u"fortran": # <<<<<<<<<<<<<< - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): + /* "yt/geometry/selection_routines.pyx":2440 + * pos, radius) == 1: + * return 1 + * return 0 # <<<<<<<<<<<<<< + * + * def _hash_vals(self): */ + __pyx_r = 0; + goto __pyx_L3_return; } - __pyx_L3:; - - /* "View.MemoryView":189 - * elif self.mode == u"fortran": - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): # <<<<<<<<<<<<<< - * raise ValueError("Can only create a buffer that is contiguous in memory.") - * info.buf = self.data - */ - __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":190 - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): - * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< - * info.buf = self.data - * info.len = self.len - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 190, __pyx_L1_error) - /* "View.MemoryView":189 - * elif self.mode == u"fortran": - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): # <<<<<<<<<<<<<< - * raise ValueError("Can only create a buffer that is contiguous in memory.") - * info.buf = self.data + /* "yt/geometry/selection_routines.pyx":2435 + * @cython.wraparound(False) + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + * with gil: # <<<<<<<<<<<<<< + * for i in range(self.n_obj): + * if (self.selectors[i]).select_sphere( */ + /*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; + } } - /* "View.MemoryView":191 - * 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":192 - * 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":193 - * info.buf = self.data - * info.len = self.len - * info.ndim = self.ndim # <<<<<<<<<<<<<< - * info.shape = self._shape - * info.strides = self._strides + /* "yt/geometry/selection_routines.pyx":2434 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # <<<<<<<<<<<<<< + * with gil: + * for i in range(self.n_obj): */ - __pyx_t_6 = __pyx_v_self->ndim; - __pyx_v_info->ndim = __pyx_t_6; - /* "View.MemoryView":194 - * 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; + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("yt.geometry.selection_routines.ChainedBooleanORSelector.select_sphere", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} - /* "View.MemoryView":195 - * info.ndim = self.ndim - * info.shape = self._shape - * info.strides = self._strides # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = self.itemsize +/* "yt/geometry/selection_routines.pyx":2442 + * return 0 + * + * def _hash_vals(self): # <<<<<<<<<<<<<< + * v = ("chained_or",) + * for s in self.selectors: */ - __pyx_t_7 = __pyx_v_self->_strides; - __pyx_v_info->strides = __pyx_t_7; - /* "View.MemoryView":196 - * info.shape = self._shape - * info.strides = self._strides - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = self.itemsize - * info.readonly = 0 - */ - __pyx_v_info->suboffsets = NULL; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_1_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_hash_vals (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector__hash_vals(((struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *)__pyx_v_self)); - /* "View.MemoryView":197 - * 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; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":198 - * info.suboffsets = NULL - * info.itemsize = self.itemsize - * info.readonly = 0 # <<<<<<<<<<<<<< - * - * if flags & PyBUF_FORMAT: - */ - __pyx_v_info->readonly = 0; +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector__hash_vals(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self) { + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_v_s = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("_hash_vals", 0); - /* "View.MemoryView":200 - * info.readonly = 0 + /* "yt/geometry/selection_routines.pyx":2443 * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * info.format = self.format - * else: + * def _hash_vals(self): + * v = ("chained_or",) # <<<<<<<<<<<<<< + * for s in self.selectors: + * v += s._hash_vals() */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); - if (__pyx_t_1) { + __Pyx_INCREF(__pyx_tuple__94); + __pyx_v_v = __pyx_tuple__94; - /* "View.MemoryView":201 - * - * if flags & PyBUF_FORMAT: - * info.format = self.format # <<<<<<<<<<<<<< - * else: - * info.format = NULL + /* "yt/geometry/selection_routines.pyx":2444 + * def _hash_vals(self): + * v = ("chained_or",) + * for s in self.selectors: # <<<<<<<<<<<<<< + * v += s._hash_vals() + * return v */ - __pyx_t_4 = __pyx_v_self->format; - __pyx_v_info->format = __pyx_t_4; + if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self->__pyx_base.selectors))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self->__pyx_base.selectors))) { + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.selectors); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self->__pyx_base.selectors)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2444, __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, 2444, __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, 2444, __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, 2444, __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, 2444, __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, 2444, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 2444, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4); + __pyx_t_4 = 0; - /* "View.MemoryView":200 - * info.readonly = 0 + /* "yt/geometry/selection_routines.pyx":2445 + * v = ("chained_or",) + * for s in self.selectors: + * v += s._hash_vals() # <<<<<<<<<<<<<< + * return v * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * info.format = self.format - * else: */ - goto __pyx_L5; - } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_hash_vals); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (__pyx_t_6) { + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2445, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2445, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_v, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; - /* "View.MemoryView":203 - * info.format = self.format - * else: - * info.format = NULL # <<<<<<<<<<<<<< - * - * info.obj = self + /* "yt/geometry/selection_routines.pyx":2444 + * def _hash_vals(self): + * v = ("chained_or",) + * for s in self.selectors: # <<<<<<<<<<<<<< + * v += s._hash_vals() + * return v */ - /*else*/ { - __pyx_v_info->format = NULL; } - __pyx_L5:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":205 - * info.format = NULL - * - * info.obj = self # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pyx":2446 + * for s in self.selectors: + * v += s._hash_vals() + * return v # <<<<<<<<<<<<<< * - * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * union_selector = ChainedBooleanORSelector */ - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_v); + __pyx_r = __pyx_v_v; + goto __pyx_L0; - /* "View.MemoryView":183 + /* "yt/geometry/selection_routines.pyx":2442 + * return 0 * - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< - * cdef int bufmode = -1 - * if self.mode == u"c": + * def _hash_vals(self): # <<<<<<<<<<<<<< + * v = ("chained_or",) + * for s in self.selectors: */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("yt.geometry.selection_routines.ChainedBooleanORSelector._hash_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":209 - * __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) +/* "(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 void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_2__reduce_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__dealloc__", 0); - - /* "View.MemoryView":210 - * - * 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":211 - * 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":210 - * - * def __dealloc__(array self): - * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< - * self.callback_free_data(self.data) - * elif self.free_data: - */ - goto __pyx_L3; - } - - /* "View.MemoryView":212 - * if self.callback_free_data != NULL: - * self.callback_free_data(self.data) - * elif self.free_data: # <<<<<<<<<<<<<< - * if self.dtype_is_object: - * refcount_objects_in_slice(self.data, self._shape, - */ - __pyx_t_1 = (__pyx_v_self->free_data != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":213 - * self.callback_free_data(self.data) - * elif self.free_data: - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * refcount_objects_in_slice(self.data, self._shape, - * self._strides, self.ndim, False) - */ - __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":214 - * 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":213 - * self.callback_free_data(self.data) - * elif self.free_data: - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * refcount_objects_in_slice(self.data, self._shape, - * self._strides, self.ndim, False) - */ - } - - /* "View.MemoryView":216 - * 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":212 - * if self.callback_free_data != NULL: - * self.callback_free_data(self.data) - * elif self.free_data: # <<<<<<<<<<<<<< - * if self.dtype_is_object: - * refcount_objects_in_slice(self.data, self._shape, - */ - } - __pyx_L3:; + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "View.MemoryView":217 - * self._strides, self.ndim, False) - * free(self.data) - * PyObject_Free(self._shape) # <<<<<<<<<<<<<< - * - * @property + /* "(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__") */ - PyObject_Free(__pyx_v_self->_shape); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__95, 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) - /* "View.MemoryView":209 - * __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) + /* "(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("yt.geometry.selection_routines.ChainedBooleanORSelector.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "View.MemoryView":220 - * - * @property - * def memview(self): # <<<<<<<<<<<<<< - * return self.get_memview() - * +/* "(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_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) { +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { 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)); + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_4__setstate_cython__(((struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* 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) { +static PyObject *__pyx_pf_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "View.MemoryView":221 - * @property - * def memview(self): - * return self.get_memview() # <<<<<<<<<<<<<< - * - * @cname('get_memview') + /* "(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_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(3, 221, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 4, __pyx_L1_error) - /* "View.MemoryView":220 - * - * @property - * def memview(self): # <<<<<<<<<<<<<< - * return self.get_memview() - * + /* "(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.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.geometry.selection_routines.ChainedBooleanORSelector.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":224 +/* "oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) * - * @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; +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) { + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("get_memview", 0); - - /* "View.MemoryView":225 - * @cname('get_memview') - * cdef get_memview(self): - * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< - * return memoryview(self, flags, self.dtype_is_object) - * - */ - __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + __Pyx_RefNannySetupContext("get_cont", 0); - /* "View.MemoryView":226 - * cdef get_memview(self): - * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE - * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< - * + /* "oct_container.pxd":57 + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) # <<<<<<<<<<<<<< * + * cdef OctList *OctList_append(OctList *list, Oct *o) */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 226, __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(3, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i]))); goto __pyx_L0; - /* "View.MemoryView":224 + /* "oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) * - * @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 - * - * - * def __getattr__(self, attr): # <<<<<<<<<<<<<< - * return getattr(self.memview, attr) +/* "oct_visitors.pxd":51 + * cdef void visit(self, Oct*, np.uint8_t selected) * + * cdef inline int oind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) */ -/* 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_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { - PyObject *__pyx_r = NULL; +static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { + int __pyx_v_d; + int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__getattr__", 0); + __Pyx_RefNannySetupContext("oind", 0); - /* "View.MemoryView":230 + /* "oct_visitors.pxd":52 * - * def __getattr__(self, attr): - * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + * cdef inline int oind(self): + * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) * - * 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(3, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_v_d = (1 << __pyx_v_self->oref); - /* "View.MemoryView":229 - * + /* "oct_visitors.pxd":53 + * cdef inline int oind(self): + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) # <<<<<<<<<<<<<< * - * def __getattr__(self, attr): # <<<<<<<<<<<<<< - * return getattr(self.memview, attr) + * cdef inline int rind(self): + */ + __pyx_r = (((((__pyx_v_self->ind[0]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[2])); + goto __pyx_L0; + + /* "oct_visitors.pxd":51 + * cdef void visit(self, Oct*, np.uint8_t selected) * + * cdef inline int oind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) */ /* 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":232 - * return getattr(self.memview, attr) - * - * def __getitem__(self, item): # <<<<<<<<<<<<<< - * return self.memview[item] +/* "oct_visitors.pxd":55 + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) * + * cdef inline int rind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) */ -/* 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_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { - PyObject *__pyx_r = NULL; +static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { + int __pyx_v_d; + int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__getitem__", 0); + __Pyx_RefNannySetupContext("rind", 0); - /* "View.MemoryView":233 + /* "oct_visitors.pxd":56 * - * def __getitem__(self, item): - * return self.memview[item] # <<<<<<<<<<<<<< + * cdef inline int rind(self): + * cdef int d = (1 << self.oref) # <<<<<<<<<<<<<< + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) * - * 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(3, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 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; + __pyx_v_d = (1 << __pyx_v_self->oref); - /* "View.MemoryView":232 - * return getattr(self.memview, attr) + /* "oct_visitors.pxd":57 + * cdef inline int rind(self): + * cdef int d = (1 << self.oref) + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) # <<<<<<<<<<<<<< * - * def __getitem__(self, item): # <<<<<<<<<<<<<< - * return self.memview[item] + * cdef class CountTotalOcts(OctVisitor): + */ + __pyx_r = (((((__pyx_v_self->ind[2]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[0])); + goto __pyx_L0; + + /* "oct_visitors.pxd":55 + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) * + * cdef inline int rind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0]) */ /* 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":235 - * return self.memview[item] - * - * def __setitem__(self, item, value): # <<<<<<<<<<<<<< - * self.memview[item] = value +/* "oct_visitors.pxd":123 + * cdef np.uint64_t *nfinest * + * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< + * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. + * return (((i*2)+j)*2+k) */ -/* 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_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { +static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_RefNannySetupContext("cind", 0); - /* "View.MemoryView":236 - * - * def __setitem__(self, item, value): - * self.memview[item] = value # <<<<<<<<<<<<<< - * + /* "oct_visitors.pxd":125 + * cdef inline int cind(int i, int j, int k): + * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. + * return (((i*2)+j)*2+k) # <<<<<<<<<<<<<< * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(3, 236, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = ((((__pyx_v_i * 2) + __pyx_v_j) * 2) + __pyx_v_k); + goto __pyx_L0; - /* "View.MemoryView":235 - * return self.memview[item] - * - * def __setitem__(self, item, value): # <<<<<<<<<<<<<< - * self.memview[item] = value + /* "oct_visitors.pxd":123 + * cdef np.uint64_t *nfinest * + * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< + * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. + * return (((i*2)+j)*2+k) */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":240 +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * @cname("__pyx_array_new") - * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< - * char *mode, char *buf): - * cdef array result + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -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 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; 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":244 - * cdef array result + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * if buf == NULL: # <<<<<<<<<<<<<< - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: */ - __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "View.MemoryView":245 + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * if buf == NULL: - * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< - * else: - * result = array(shape, itemsize, format, mode.decode('ASCII'), + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 245, __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(3, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "View.MemoryView":244 - * cdef array result + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * if buf == NULL: # <<<<<<<<<<<<<< - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - goto __pyx_L3; - } - /* "View.MemoryView":247 - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: - * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< - * allocate_buffer=False) - * result.data = buf - */ - /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 247, __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; + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "View.MemoryView":248 - * else: - * result = array(shape, itemsize, format, mode.decode('ASCII'), - * allocate_buffer=False) # <<<<<<<<<<<<<< - * result.data = buf +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(3, 248, __pyx_L1_error) - /* "View.MemoryView":247 - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: - * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< - * allocate_buffer=False) - * result.data = buf - */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); - __pyx_t_5 = 0; +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; - /* "View.MemoryView":249 - * result = array(shape, itemsize, format, mode.decode('ASCII'), - * allocate_buffer=False) - * result.data = buf # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":24 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 * - * return result */ - __pyx_v_result->data = __pyx_v_buf; + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; } - __pyx_L3:; - /* "View.MemoryView":251 - * result.data = buf - * - * return result # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = __pyx_v_result; + __pyx_r = __pyx_v_f1; goto __pyx_L0; - /* "View.MemoryView":240 + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * - * @cname("__pyx_array_new") - * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< - * char *mode, char *buf): - * cdef array result + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ /* 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":277 - * cdef class Enum(object): - * cdef object name - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * def __repr__(self): +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ -/* 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); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(3, 277, __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(3, 277, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_MemviewEnum___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 CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; -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); + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * + */ + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "View.MemoryView":278 - * cdef object name - * def __init__(self, name): - * self.name = name # <<<<<<<<<<<<<< - * def __repr__(self): - * return self.name + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __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; + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "View.MemoryView":277 - * cdef class Enum(object): - * cdef object name - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * def __repr__(self): + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); + __pyx_L0:; return __pyx_r; } -/* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ -/* 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 CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; -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); + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 + * + */ + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "View.MemoryView":280 - * self.name = name - * def __repr__(self): - * return self.name # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< * - * cdef generic = Enum("") + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->name); - __pyx_r = __pyx_v_self->name; + __pyx_r = __pyx_v_f1; goto __pyx_L0; - /* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":294 +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * - * @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 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ -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; +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - /* "View.MemoryView":296 - * cdef void *align_pointer(void *memory, size_t alignment) nogil: - * "Align pointer memory on a given boundary" - * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< - * cdef size_t offset + /* "yt/utilities/lib/fp_utils.pxd":36 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 * */ - __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + if (__pyx_t_1) { + __pyx_r = (-__pyx_v_f0); + goto __pyx_L0; + } - /* "View.MemoryView":300 - * - * with cython.cdivision(True): - * offset = aligned_p % alignment # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< * - * if offset > 0: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + __pyx_r = __pyx_v_f0; + goto __pyx_L0; - /* "View.MemoryView":302 - * offset = aligned_p % alignment - * - * if offset > 0: # <<<<<<<<<<<<<< - * aligned_p += alignment - offset + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ - __pyx_t_1 = ((__pyx_v_offset > 0) != 0); - if (__pyx_t_1) { - /* "View.MemoryView":303 - * - * if offset > 0: - * aligned_p += alignment - offset # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 * - * return aligned_p + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); - /* "View.MemoryView":302 - * offset = aligned_p % alignment - * - * if offset > 0: # <<<<<<<<<<<<<< - * aligned_p += alignment - offset +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":40 * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; } - /* "View.MemoryView":305 - * aligned_p += alignment - offset - * - * return aligned_p # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * + */ + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_r = ((void *)__pyx_v_aligned_p); + __pyx_r = __pyx_v_i; goto __pyx_L0; - /* "View.MemoryView":294 + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 * - * @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 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* function exit code */ @@ -38232,1372 +41924,1296 @@ return __pyx_r; } -/* "View.MemoryView":341 - * cdef __Pyx_TypeInfo *typeinfo +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< - * self.obj = obj - * self.flags = flags + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ -/* 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); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(3, 341, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 341, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_obj = values[0]; - __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 341, __pyx_L3_error) - if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 341, __pyx_L3_error) - } else { - __pyx_v_dtype_is_object = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 341, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_memoryview___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 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("__cinit__", 0); - /* "View.MemoryView":342 + /* "yt/utilities/lib/fp_utils.pxd":45 * - * 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":343 - * 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) + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - __pyx_v_self->flags = __pyx_v_flags; + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "View.MemoryView":344 - * self.obj = obj - * self.flags = flags - * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< - * __Pyx_GetBuffer(obj, &self.view, flags) - * if self.view.obj == NULL: + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * */ - __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:; + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "View.MemoryView":345 - * 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 + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fclip(np.float64_t f, */ - __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 345, __pyx_L1_error) + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "View.MemoryView":346 - * 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) + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); - if (__pyx_t_1) { - /* "View.MemoryView":347 - * __Pyx_GetBuffer(obj, &self.view, flags) - * if self.view.obj == NULL: - * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< - * Py_INCREF(Py_None) + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; - /* "View.MemoryView":348 - * if self.view.obj == NULL: - * (<__pyx_buffer *> &self.view).obj = Py_None - * Py_INCREF(Py_None) # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< * - * global __pyx_memoryview_thread_locks_used + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - Py_INCREF(Py_None); + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; - /* "View.MemoryView":346 - * 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) + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i + * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - } - /* "View.MemoryView":344 - * self.obj = obj - * self.flags = flags - * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< - * __Pyx_GetBuffer(obj, &self.view, flags) - * if self.view.obj == NULL: + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - } - /* "View.MemoryView":351 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * 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); + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "View.MemoryView":352 - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "View.MemoryView":353 - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); - /* "View.MemoryView":351 + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * 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 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - } - /* "View.MemoryView":354 - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: # <<<<<<<<<<<<<< - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: - */ - __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - if (__pyx_t_1) { +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "View.MemoryView":355 - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< - * if self.lock is NULL: - * raise MemoryError + /* "yt/utilities/lib/fp_utils.pxd":58 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ - __pyx_v_self->lock = PyThread_allocate_lock(); + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "View.MemoryView":356 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: # <<<<<<<<<<<<<< - * raise MemoryError + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * */ - __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - if (__pyx_t_1) { + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "View.MemoryView":357 - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: - * raise MemoryError # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * if flags & PyBUF_FORMAT: + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - PyErr_NoMemory(); __PYX_ERR(3, 357, __pyx_L1_error) - /* "View.MemoryView":356 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: # <<<<<<<<<<<<<< - * raise MemoryError + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k * */ - } - /* "View.MemoryView":354 - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: # <<<<<<<<<<<<<< - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: - */ - } +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("vc_index", 0); - /* "View.MemoryView":359 - * raise MemoryError + /* "yt/utilities/lib/volume_container.pxd":31 * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') - * else: + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): + * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< + * + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); - if (__pyx_t_1) { + __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); + goto __pyx_L0; - /* "View.MemoryView":360 + /* "yt/utilities/lib/volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * 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":359 - * raise MemoryError + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') - * else: + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i */ - goto __pyx_L10; - } - /* "View.MemoryView":362 - * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') - * else: - * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< - * - * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { + int __pyx_v_index[3]; + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("vc_pos_index", 0); + + /* "yt/utilities/lib/volume_container.pxd":36 + * cdef int index[3] + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) */ - /*else*/ { - __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; - } - __pyx_L10:; + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":364 - * self.dtype_is_object = dtype_is_object + /* "yt/utilities/lib/volume_container.pxd":37 + * cdef int i + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< + * return vc_index(vc, index[0], index[1], index[2]) * - * 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)))); + (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); + } - /* "View.MemoryView":366 - * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( - * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) - * self.typeinfo = NULL # <<<<<<<<<<<<<< + /* "yt/utilities/lib/volume_container.pxd":38 + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< * - * def __dealloc__(memoryview self): */ - __pyx_v_self->typeinfo = NULL; + __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); + goto __pyx_L0; - /* "View.MemoryView":341 - * cdef __Pyx_TypeInfo *typeinfo + /* "yt/utilities/lib/volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< - * self.obj = obj - * self.flags = flags + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i */ /* 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":368 - * self.typeinfo = NULL - * - * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< - * if self.obj is not None: - * __Pyx_ReleaseBuffer(&self.view) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ /* Python wrapper */ -static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { +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("__dealloc__ (wrapper)", 0); - __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __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 void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; - int __pyx_t_3; + PyObject *__pyx_t_3 = NULL; int __pyx_t_4; - PyThread_type_lock __pyx_t_5; - PyThread_type_lock __pyx_t_6; - __Pyx_RefNannySetupContext("__dealloc__", 0); + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "View.MemoryView":369 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * - * def __dealloc__(memoryview self): - * if self.obj is not None: # <<<<<<<<<<<<<< - * __Pyx_ReleaseBuffer(&self.view) + * if info == NULL: return # <<<<<<<<<<<<<< * + * cdef int copy_shape, i, ndim */ - __pyx_t_1 = (__pyx_v_self->obj != Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "View.MemoryView":370 - * def __dealloc__(memoryview self): - * if self.obj is not None: - * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< - * - * cdef int i - */ - __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "View.MemoryView":369 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 * - * def __dealloc__(memoryview self): - * if self.obj is not None: # <<<<<<<<<<<<<< - * __Pyx_ReleaseBuffer(&self.view) + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) * */ - } - - /* "View.MemoryView":374 - * cdef int i - * global __pyx_memoryview_thread_locks_used - * if self.lock != NULL: # <<<<<<<<<<<<<< - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: - */ - __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); - if (__pyx_t_2) { - - /* "View.MemoryView":375 - * global __pyx_memoryview_thread_locks_used - * if self.lock != NULL: - * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< - * if __pyx_memoryview_thread_locks[i] is self.lock: - * __pyx_memoryview_thread_locks_used -= 1 - */ - __pyx_t_3 = __pyx_memoryview_thread_locks_used; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "View.MemoryView":376 - * if self.lock != NULL: - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: - */ - __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); - if (__pyx_t_2) { + __pyx_v_endian_detector = 1; - /* "View.MemoryView":377 - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: - * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< - * if i != __pyx_memoryview_thread_locks_used: - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) */ - __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "View.MemoryView":378 - * if __pyx_memoryview_thread_locks[i] is self.lock: - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); - if (__pyx_t_2) { + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "View.MemoryView":380 - * if i != __pyx_memoryview_thread_locks_used: - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< - * break + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 * else: */ - __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); - __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); - - /* "View.MemoryView":379 - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) - * break - */ - (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; - (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; - - /* "View.MemoryView":378 - * if __pyx_memoryview_thread_locks[i] is self.lock: - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) - */ - } + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":381 - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) - * break # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< * else: - * PyThread_free_lock(self.lock) + * copy_shape = 0 */ - goto __pyx_L6_break; + __pyx_v_copy_shape = 1; - /* "View.MemoryView":376 - * if self.lock != NULL: - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - } - } - /*else*/ { + goto __pyx_L4; + } - /* "View.MemoryView":383 - * break + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 * else: - * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * copy_shape = 0 # <<<<<<<<<<<<<< * - * cdef char *get_item_pointer(memoryview self, object index) except NULL: - */ - PyThread_free_lock(__pyx_v_self->lock); - } - __pyx_L6_break:; - - /* "View.MemoryView":374 - * cdef int i - * global __pyx_memoryview_thread_locks_used - * if self.lock != NULL: # <<<<<<<<<<<<<< - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ + /*else*/ { + __pyx_v_copy_shape = 0; } + __pyx_L4:; - /* "View.MemoryView":368 - * self.typeinfo = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< - * if self.obj is not None: - * __Pyx_ReleaseBuffer(&self.view) + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "View.MemoryView":385 - * PyThread_free_lock(self.lock) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 * - * 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":387 - * cdef char *get_item_pointer(memoryview self, object index) except NULL: - * cdef Py_ssize_t dim - * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< + * 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") * - * for dim, idx in enumerate(index): */ - __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "View.MemoryView":389 - * cdef char *itemp = self.view.buf - * - * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< - * itemp = pybuffer_index(&self.view, itemp, idx, dim) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __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(3, 389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 389, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_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(3, 389, __pyx_L1_error) - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 389, __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(3, 389, __pyx_L1_error) - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 389, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 389, __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); + if (__pyx_t_1) { - /* "View.MemoryView":390 - * - * for dim, idx in enumerate(index): - * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * - * return itemp + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 390, __pyx_L1_error) - __pyx_v_itemp = __pyx_t_7; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 218, __pyx_L1_error) - /* "View.MemoryView":389 - * cdef char *itemp = self.view.buf - * - * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< - * itemp = pybuffer_index(&self.view, itemp, idx, dim) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "View.MemoryView":392 - * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * - * return itemp # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_itemp; - goto __pyx_L0; - /* "View.MemoryView":385 - * PyThread_free_lock(self.lock) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< - * cdef Py_ssize_t dim - * cdef char *itemp = self.view.buf + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } - /* 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":395 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") * - * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< - * if index is Ellipsis: - * return self */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; -/* 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":396 - * - * def __getitem__(memoryview self, object index): - * if index is Ellipsis: # <<<<<<<<<<<<<< - * return self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + if (__pyx_t_1) { - /* "View.MemoryView":397 - * def __getitem__(memoryview self, object index): - * if index is Ellipsis: - * return self # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * - * have_slices, indices = _unellipsify(index, self.view.ndim) + * info.buf = PyArray_DATA(self) */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 222, __pyx_L1_error) - /* "View.MemoryView":396 - * - * def __getitem__(memoryview self, object index): - * if index is Ellipsis: # <<<<<<<<<<<<<< - * return self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ } - /* "View.MemoryView":399 - * return self - * - * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") * - * cdef char *itemp + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (likely(__pyx_t_3 != Py_None)) { - PyObject* sequence = __pyx_t_3; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 399, __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(3, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 399, __pyx_L1_error) - } - __pyx_v_have_slices = __pyx_t_4; - __pyx_t_4 = 0; - __pyx_v_indices = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "View.MemoryView":402 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * - * cdef char *itemp - * if have_slices: # <<<<<<<<<<<<<< - * return memview_slice(self, indices) - * else: + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 402, __pyx_L1_error) - if (__pyx_t_2) { + __pyx_v_info->ndim = __pyx_v_ndim; - /* "View.MemoryView":403 - * cdef char *itemp - * if have_slices: - * return memview_slice(self, indices) # <<<<<<<<<<<<<< - * else: - * itemp = self.get_item_pointer(indices) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { - /* "View.MemoryView":402 - * - * cdef char *itemp - * if have_slices: # <<<<<<<<<<<<<< - * return memview_slice(self, indices) - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - } + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "View.MemoryView":405 - * return memview_slice(self, indices) - * else: - * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< - * return self.convert_item_to_object(itemp) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ - /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(3, 405, __pyx_L1_error) - __pyx_v_itemp = __pyx_t_6; + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "View.MemoryView":406 - * else: - * itemp = self.get_item_pointer(indices) - * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< - * - * def __setitem__(memoryview self, object index, object value): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ - __Pyx_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(3, 406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - } + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "View.MemoryView":395 - * - * - * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< - * if index is Ellipsis: - * return self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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]); - /* 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; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } -/* "View.MemoryView":408 - * return self.convert_item_to_object(itemp) - * - * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< - * have_slices, index = _unellipsify(index, self.view.ndim) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ + goto __pyx_L11; + } -/* 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)); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * 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)); - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; -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 - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("__setitem__", 0); - __Pyx_INCREF(__pyx_v_index); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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; - /* "View.MemoryView":409 - * - * def __setitem__(memoryview self, object index, object value): - * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * - * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(__pyx_t_1 != Py_None)) { - PyObject* sequence = __pyx_t_1; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 409, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 409, __pyx_L1_error) - } - __pyx_v_have_slices = __pyx_t_2; - __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "View.MemoryView":411 - * have_slices, index = _unellipsify(index, self.view.ndim) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * - * if have_slices: # <<<<<<<<<<<<<< - * obj = self.is_slice(value) - * if obj: + * cdef int t */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 411, __pyx_L1_error) - if (__pyx_t_4) { + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "View.MemoryView":412 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * - * if have_slices: - * obj = self.is_slice(value) # <<<<<<<<<<<<<< - * if obj: - * self.setitem_slice_assignment(self[index], obj) + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_obj = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_f = NULL; - /* "View.MemoryView":413 - * if have_slices: - * obj = self.is_slice(value) - * if obj: # <<<<<<<<<<<<<< - * self.setitem_slice_assignment(self[index], obj) - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset + * */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 413, __pyx_L1_error) - if (__pyx_t_4) { + __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; - /* "View.MemoryView":414 - * obj = self.is_slice(value) - * if obj: - * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< - * else: - * self.setitem_slice_assign_scalar(self[index], value) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "View.MemoryView":413 - * if have_slices: - * obj = self.is_slice(value) - * if obj: # <<<<<<<<<<<<<< - * self.setitem_slice_assignment(self[index], obj) - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - goto __pyx_L4; - } + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { - /* "View.MemoryView":416 - * self.setitem_slice_assignment(self[index], obj) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< * else: - * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< - * else: - * self.setitem_indexed(index, value) + * # need to call releasebuffer */ - /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L4:; + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* "View.MemoryView":411 - * have_slices, index = _unellipsify(index, self.view.ndim) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * if have_slices: # <<<<<<<<<<<<<< - * obj = self.is_slice(value) - * if obj: + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - goto __pyx_L3; + goto __pyx_L14; } - /* "View.MemoryView":418 - * self.setitem_slice_assign_scalar(self[index], value) - * else: - * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * - * cdef is_slice(self, obj): + * if not hasfields: */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); } - __pyx_L3:; + __pyx_L14:; - /* "View.MemoryView":408 - * return self.convert_item_to_object(itemp) - * - * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< - * have_slices, index = _unellipsify(index, self.view.ndim) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_have_slices); - __Pyx_XDECREF(__pyx_v_obj); - __Pyx_XDECREF(__pyx_v_index); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "View.MemoryView":420 - * self.setitem_indexed(index, value) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * - * cdef is_slice(self, obj): # <<<<<<<<<<<<<< - * if not isinstance(obj, memoryview): - * try: + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; -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":421 - * - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); - __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); - if (__pyx_t_2) { + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; - /* "View.MemoryView":422 - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): - * try: # <<<<<<<<<<<<<< - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ - { - __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:*/ { + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* "View.MemoryView":423 - * if not isinstance(obj, memoryview): - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< - * self.dtype_is_object) - * except TypeError: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 423, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_1) { - /* "View.MemoryView":424 - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) # <<<<<<<<<<<<<< - * except TypeError: - * return None + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 424, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 259, __pyx_L1_error) - /* "View.MemoryView":423 - * if not isinstance(obj, memoryview): - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< - * self.dtype_is_object) - * except TypeError: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 423, __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(3, 423, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); - __pyx_t_7 = 0; + } - /* "View.MemoryView":422 - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): - * try: # <<<<<<<<<<<<<< - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - } - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; - __pyx_L4_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "View.MemoryView":425 - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) - * except TypeError: # <<<<<<<<<<<<<< - * return None - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - __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(3, 425, __pyx_L6_except_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_6); + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "View.MemoryView":426 - * self.dtype_is_object) - * except TypeError: - * return None # <<<<<<<<<<<<<< - * - * return obj + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L7_except_return; - } - goto __pyx_L6_except_error; - __pyx_L6_except_error:; + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "View.MemoryView":422 - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): - * try: # <<<<<<<<<<<<<< - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); - goto __pyx_L1_error; - __pyx_L7_except_return:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); - goto __pyx_L0; - __pyx_L11_try_end:; + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(3, 278, __pyx_L1_error) + break; } - /* "View.MemoryView":421 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ } - /* "View.MemoryView":428 - * return None - * - * return obj # <<<<<<<<<<<<<< - * - * cdef setitem_slice_assignment(self, dst, src): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_obj); - __pyx_r = __pyx_v_obj; - goto __pyx_L0; + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "View.MemoryView":420 - * self.setitem_indexed(index, value) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< * - * cdef is_slice(self, obj): # <<<<<<<<<<<<<< - * if not isinstance(obj, memoryview): - * try: + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = '\x00'; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); - __Pyx_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_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_obj); - __Pyx_XGIVEREF(__pyx_r); + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":430 - * return obj +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice dst_slice - * cdef __Pyx_memviewslice src_slice + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ -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; +/* 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 - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - /* "View.MemoryView":434 - * cdef __Pyx_memviewslice src_slice + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * 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) + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(3, 434, __pyx_L1_error) + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":435 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * 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) + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block * */ - if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(3, 435, __pyx_L1_error) + free(__pyx_v_info->strides); - /* "View.MemoryView":436 - * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], - * get_slice_from_memview(dst, &dst_slice)[0], - * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":434 - * cdef __Pyx_memviewslice src_slice + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) * - * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< - * get_slice_from_memview(dst, &dst_slice)[0], - * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 434, __pyx_L1_error) - /* "View.MemoryView":430 - * return obj +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * 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(3, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) * - * 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_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -39605,285 +43221,140 @@ return __pyx_r; } -/* "View.MemoryView":438 - * src.ndim, dst.ndim, self.dtype_is_object) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) * - * 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; +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { 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); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "View.MemoryView":440 - * cdef setitem_slice_assign_scalar(self, memoryview dst, value): - * cdef int array[128] - * cdef void *tmp = NULL # <<<<<<<<<<<<<< - * cdef void *item + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 * - */ - __pyx_v_tmp = NULL; - - /* "View.MemoryView":445 - * cdef __Pyx_memviewslice *dst_slice - * cdef __Pyx_memviewslice tmp_slice - * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< * - * if self.view.itemsize > sizeof(array): + * cdef inline object PyArray_MultiIterNew3(a, b, c): */ - __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); + __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(3, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":447 - * dst_slice = get_slice_from_memview(dst, &tmp_slice) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) * - * 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":448 + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) * - * 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":449 - * 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 (__pyx_t_1) { - - /* "View.MemoryView":450 - * tmp = PyMem_Malloc(self.view.itemsize) - * if tmp == NULL: - * raise MemoryError # <<<<<<<<<<<<<< - * item = tmp - * else: - */ - PyErr_NoMemory(); __PYX_ERR(3, 450, __pyx_L1_error) - - /* "View.MemoryView":449 - * if self.view.itemsize > sizeof(array): - * tmp = PyMem_Malloc(self.view.itemsize) - * if tmp == NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * item = tmp */ - } - /* "View.MemoryView":451 - * if tmp == NULL: - * raise MemoryError - * item = tmp # <<<<<<<<<<<<<< - * else: - * item = array - */ - __pyx_v_item = __pyx_v_tmp; + /* 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; +} - /* "View.MemoryView":447 - * dst_slice = get_slice_from_memview(dst, &tmp_slice) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) * - * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< - * tmp = PyMem_Malloc(self.view.itemsize) - * if tmp == NULL: - */ - goto __pyx_L3; - } - - /* "View.MemoryView":453 - * item = tmp - * else: - * item = array # <<<<<<<<<<<<<< + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * - * try: */ - /*else*/ { - __pyx_v_item = ((void *)__pyx_v_array); - } - __pyx_L3:; - /* "View.MemoryView":455 - * item = array - * - * try: # <<<<<<<<<<<<<< - * if self.dtype_is_object: - * ( item)[0] = value - */ - /*try:*/ { +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); - /* "View.MemoryView":456 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 * - * 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":457 - * 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":456 + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< * - * try: - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * ( item)[0] = value - * else: + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ - goto __pyx_L8; - } + __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(3, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":459 - * ( item)[0] = value - * else: - * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * */ - /*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(3, 459, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_L8:; - /* "View.MemoryView":463 + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) * - * 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":464 - * - * if self.view.suboffsets != NULL: - * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< - * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, - * item, self.dtype_is_object) - */ - __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 464, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +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); - /* "View.MemoryView":463 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< * - * 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":465 - * if self.view.suboffsets != NULL: - * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) - * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< - * item, self.dtype_is_object) - * finally: + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ - __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); - } + __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(3, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":468 - * item, self.dtype_is_object) - * finally: - * PyMem_Free(tmp) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) * - * cdef setitem_indexed(self, index, value): - */ - /*finally:*/ { - /*normal exit:*/{ - PyMem_Free(__pyx_v_tmp); - goto __pyx_L7; - } - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L6_error:; - __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); - __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); - } - __Pyx_PyThreadState_assign - 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":438 - * src.ndim, dst.ndim, self.dtype_is_object) + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) * - * 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_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -39891,57 +43362,46 @@ return __pyx_r; } -/* "View.MemoryView":470 - * PyMem_Free(tmp) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) * - * 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; +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 - char *__pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("setitem_indexed", 0); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "View.MemoryView":471 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 * - * cdef setitem_indexed(self, index, value): - * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< - * self.assign_item_from_object(itemp, value) + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(3, 471, __pyx_L1_error) - __pyx_v_itemp = __pyx_t_1; + __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(3, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":472 - * cdef setitem_indexed(self, index, value): - * cdef char *itemp = self.get_item_pointer(index) - * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * return PyArray_MultiIterNew(4, a, b, c, d) * - * 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(3, 472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "View.MemoryView":470 - * PyMem_Free(tmp) + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) * - * 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_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -39949,6714 +43409,7405 @@ return __pyx_r; } -/* "View.MemoryView":474 - * self.assign_item_from_object(itemp, value) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * - * 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""" + * 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 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; +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; - PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = 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); + 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); - /* "View.MemoryView":477 - * """Only used if instantiated manually by the user, or if Cython doesn't - * know how to convert the type""" - * import struct # <<<<<<<<<<<<<< - * cdef bytes bytesitem + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_struct = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_endian_detector = 1; - /* "View.MemoryView":480 - * cdef bytes bytesitem + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields * - * 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(3, 480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "View.MemoryView":481 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * bytesitem = itemp[:self.view.itemsize] - * try: # <<<<<<<<<<<<<< - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - { - __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:*/ { + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(3, 794, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_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(3, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; - /* "View.MemoryView":482 - * bytesitem = itemp[:self.view.itemsize] - * try: - * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< - * except struct.error: - * raise ValueError("Unable to convert item to object") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 482, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 482, __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 (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(3, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(3, 796, __pyx_L1_error) } - #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(3, 482, __pyx_L3_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else + #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(3, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); #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(3, 482, __pyx_L3_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else - #endif - { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 482, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_9); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); - __Pyx_INCREF(__pyx_v_bytesitem); - __Pyx_GIVEREF(__pyx_v_bytesitem); - PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 482, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_result = __pyx_t_1; - __pyx_t_1 = 0; - - /* "View.MemoryView":481 - * - * bytesitem = itemp[:self.view.itemsize] - * try: # <<<<<<<<<<<<<< - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: - */ + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 796, __pyx_L1_error) } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; - /* "View.MemoryView":486 - * raise ValueError("Unable to convert item to object") - * else: - * if len(self.view.format) == 1: # <<<<<<<<<<<<<< - * return result[0] - * return result - */ - /*else:*/ { - __pyx_t_10 = strlen(__pyx_v_self->view.format); - __pyx_t_11 = ((__pyx_t_10 == 1) != 0); - if (__pyx_t_11) { - - /* "View.MemoryView":487 - * else: - * if len(self.view.format) == 1: - * return result[0] # <<<<<<<<<<<<<< - * return result + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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_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(3, 487, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L6_except_return; + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { - /* "View.MemoryView":486 - * raise ValueError("Unable to convert item to object") - * else: - * if len(self.view.format) == 1: # <<<<<<<<<<<<<< - * return result[0] - * return result + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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__100, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 799, __pyx_L1_error) - /* "View.MemoryView":488 - * if len(self.view.format) == 1: - * return result[0] - * return result # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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") * - * 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_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "View.MemoryView":483 - * try: - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: # <<<<<<<<<<<<<< - * raise ValueError("Unable to convert item to object") - * else: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 483, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(3, 483, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_9); - /* "View.MemoryView":484 - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: - * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< - * else: - * if len(self.view.format) == 1: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 484, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(3, 484, __pyx_L5_except_error) + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __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:; - /* "View.MemoryView":481 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 * - * bytesitem = itemp[:self.view.itemsize] - * try: # <<<<<<<<<<<<<< - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: + * 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_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); - goto __pyx_L1_error; - __pyx_L6_except_return:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); - goto __pyx_L0; - } + __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:; - /* "View.MemoryView":474 - * self.assign_item_from_object(itemp, value) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * 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""" + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + if (__pyx_t_6) { - /* 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":490 - * 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""" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 803, __pyx_L1_error) -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":493 - * """Only used if instantiated manually by the user, or if Cython doesn't - * know how to convert the type""" - * import struct # <<<<<<<<<<<<<< - * cdef char c - * cdef bytes bytesvalue + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_struct = __pyx_t_1; - __pyx_t_1 = 0; + } - /* "View.MemoryView":498 - * cdef Py_ssize_t i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * - * if isinstance(value, tuple): # <<<<<<<<<<<<<< - * bytesvalue = struct.pack(self.view.format, *value) - * else: + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ - __pyx_t_2 = PyTuple_Check(__pyx_v_value); - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; - /* "View.MemoryView":499 - * - * if isinstance(value, tuple): - * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< - * else: - * bytesvalue = struct.pack(self.view.format, value) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 499, __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 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(3, 499, __pyx_L1_error) - __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; + (__pyx_v_f[0]) = 0x78; - /* "View.MemoryView":498 - * cdef Py_ssize_t i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 * - * if isinstance(value, tuple): # <<<<<<<<<<<<<< - * bytesvalue = struct.pack(self.view.format, *value) - * else: */ - goto __pyx_L3; - } + __pyx_v_f = (__pyx_v_f + 1); - /* "View.MemoryView":501 - * bytesvalue = struct.pack(self.view.format, *value) - * else: - * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< * - * for i, c in enumerate(bytesvalue): + * offset[0] += child.itemsize */ - /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 501, __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(3, 501, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { - PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 501, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else - #endif - { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); - __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - __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(3, 501, __pyx_L1_error) - __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L3:; - /* "View.MemoryView":503 - * bytesvalue = struct.pack(self.view.format, value) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 * - * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< - * itemp[i] = c + * offset[0] += child.itemsize # <<<<<<<<<<<<<< * + * if not PyDataType_HASFIELDS(child): */ - __pyx_t_9 = 0; - if (unlikely(__pyx_v_bytesvalue == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(3, 503, __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]); + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "View.MemoryView":504 - * - * for i, c in enumerate(bytesvalue): - * itemp[i] = c # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * - * @cname('getbuffer') + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __pyx_v_i = __pyx_t_9; + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { - /* "View.MemoryView":503 - * bytesvalue = struct.pack(self.view.format, value) - * - * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< - * itemp[i] = c + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_9 = (__pyx_t_9 + 1); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; - /* "View.MemoryView":504 - * - * for i, c in enumerate(bytesvalue): - * itemp[i] = c # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * @cname('getbuffer') */ - (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { - /* "View.MemoryView":490 - * return result + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * - * 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""" + * # Until ticket #99 is fixed, use integers to avoid warnings */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(3, 823, __pyx_L1_error) - /* 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; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + } -/* "View.MemoryView":507 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 * - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< - * if flags & PyBUF_STRIDES: - * info.shape = self.view.shape + * # 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(3, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } -/* 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; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } -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; - Py_ssize_t *__pyx_t_2; - char *__pyx_t_3; - void *__pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } - /* "View.MemoryView":508 - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): - * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< - * info.shape = self.view.shape - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } - /* "View.MemoryView":509 - * def __getbuffer__(self, Py_buffer *info, int flags): - * if flags & PyBUF_STRIDES: - * info.shape = self.view.shape # <<<<<<<<<<<<<< - * else: - * info.shape = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_2 = __pyx_v_self->view.shape; - __pyx_v_info->shape = __pyx_t_2; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } - /* "View.MemoryView":508 - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): - * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< - * info.shape = self.view.shape - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" */ - goto __pyx_L3; - } + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } - /* "View.MemoryView":511 - * info.shape = self.view.shape - * else: - * info.shape = NULL # <<<<<<<<<<<<<< - * - * if flags & PyBUF_STRIDES: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - /*else*/ { - __pyx_v_info->shape = NULL; - } - __pyx_L3:; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } - /* "View.MemoryView":513 - * info.shape = NULL - * - * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< - * info.strides = self.view.strides - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } - /* "View.MemoryView":514 - * - * if flags & PyBUF_STRIDES: - * info.strides = self.view.strides # <<<<<<<<<<<<<< - * else: - * info.strides = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_2 = __pyx_v_self->view.strides; - __pyx_v_info->strides = __pyx_t_2; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } - /* "View.MemoryView":513 - * info.shape = NULL - * - * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< - * info.strides = self.view.strides - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - goto __pyx_L4; - } + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } - /* "View.MemoryView":516 - * info.strides = self.view.strides - * else: - * info.strides = NULL # <<<<<<<<<<<<<< - * - * if flags & PyBUF_INDIRECT: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - /*else*/ { - __pyx_v_info->strides = NULL; - } - __pyx_L4:; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } - /* "View.MemoryView":518 - * info.strides = NULL - * - * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< - * info.suboffsets = self.view.suboffsets - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } - /* "View.MemoryView":519 - * - * if flags & PyBUF_INDIRECT: - * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< - * else: - * info.suboffsets = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_2 = __pyx_v_self->view.suboffsets; - __pyx_v_info->suboffsets = __pyx_t_2; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } - /* "View.MemoryView":518 - * info.strides = NULL - * - * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< - * info.suboffsets = self.view.suboffsets - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - goto __pyx_L5; - } + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "View.MemoryView":521 - * info.suboffsets = self.view.suboffsets - * else: - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * - * if flags & PyBUF_FORMAT: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - /*else*/ { - __pyx_v_info->suboffsets = NULL; - } - __pyx_L5:; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "View.MemoryView":523 - * info.suboffsets = NULL - * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * info.format = self.view.format - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "View.MemoryView":524 - * - * if flags & PyBUF_FORMAT: - * info.format = self.view.format # <<<<<<<<<<<<<< - * else: - * info.format = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_3 = __pyx_v_self->view.format; - __pyx_v_info->format = __pyx_t_3; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } - /* "View.MemoryView":523 - * info.suboffsets = NULL - * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * info.format = self.view.format + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 * else: */ - goto __pyx_L6; - } + /*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(3, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 844, __pyx_L1_error) + } + __pyx_L15:; - /* "View.MemoryView":526 - * info.format = self.view.format + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< * else: - * info.format = NULL # <<<<<<<<<<<<<< - * - * info.buf = self.view.buf + * # Cython ignores struct boundary information ("T{...}"), */ - /*else*/ { - __pyx_v_info->format = NULL; - } - __pyx_L6:; + __pyx_v_f = (__pyx_v_f + 1); - /* "View.MemoryView":528 - * info.format = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * - * info.buf = self.view.buf # <<<<<<<<<<<<<< - * info.ndim = self.view.ndim - * info.itemsize = self.view.itemsize + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __pyx_t_4 = __pyx_v_self->view.buf; - __pyx_v_info->buf = __pyx_t_4; + goto __pyx_L13; + } - /* "View.MemoryView":529 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f * - * info.buf = self.view.buf - * info.ndim = self.view.ndim # <<<<<<<<<<<<<< - * info.itemsize = self.view.itemsize - * info.len = self.view.len - */ - __pyx_t_5 = __pyx_v_self->view.ndim; - __pyx_v_info->ndim = __pyx_t_5; - - /* "View.MemoryView":530 - * info.buf = self.view.buf - * info.ndim = self.view.ndim - * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< - * info.len = self.view.len - * info.readonly = 0 - */ - __pyx_t_6 = __pyx_v_self->view.itemsize; - __pyx_v_info->itemsize = __pyx_t_6; - - /* "View.MemoryView":531 - * info.ndim = self.view.ndim - * info.itemsize = self.view.itemsize - * info.len = self.view.len # <<<<<<<<<<<<<< - * info.readonly = 0 - * info.obj = self */ - __pyx_t_6 = __pyx_v_self->view.len; - __pyx_v_info->len = __pyx_t_6; + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(3, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; - /* "View.MemoryView":532 - * info.itemsize = self.view.itemsize - * info.len = self.view.len - * info.readonly = 0 # <<<<<<<<<<<<<< - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - __pyx_v_info->readonly = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":533 - * info.len = self.view.len - * info.readonly = 0 - * info.obj = self # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * * - * __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); + __pyx_r = __pyx_v_f; + goto __pyx_L0; - /* "View.MemoryView":507 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< - * if flags & PyBUF_STRIDES: - * info.shape = self.view.shape + * 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_r = 0; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } + __pyx_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; } -/* "View.MemoryView":539 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * @property - * def T(self): # <<<<<<<<<<<<<< - * cdef _memoryviewslice result = memoryview_copy(self) - * transpose_memslice(&result.from_slice) + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ -/* 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; +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; int __pyx_t_2; - __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_RefNannySetupContext("set_array_base", 0); - /* "View.MemoryView":540 - * @property - * def T(self): - * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< - * transpose_memslice(&result.from_slice) - * return result + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(3, 540, __pyx_L1_error) - __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "View.MemoryView":541 - * def T(self): - * cdef _memoryviewslice result = memoryview_copy(self) - * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< - * return result - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(3, 541, __pyx_L1_error) + __pyx_v_baseptr = NULL; - /* "View.MemoryView":542 - * cdef _memoryviewslice result = memoryview_copy(self) - * transpose_memslice(&result.from_slice) - * return result # <<<<<<<<<<<<<< - * - * @property + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); - goto __pyx_L0; + goto __pyx_L3; + } - /* "View.MemoryView":539 - * - * @property - * def T(self): # <<<<<<<<<<<<<< - * cdef _memoryviewslice result = memoryview_copy(self) - * transpose_memslice(&result.from_slice) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * 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); - /* 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; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; -/* "View.MemoryView":545 - * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.obj + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * 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); -/* 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":546 - * @property - * def base(self): - * return self.obj # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< * - * @property + * cdef inline object get_array_base(ndarray arr): */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->obj); - __pyx_r = __pyx_v_self->obj; - goto __pyx_L0; + __pyx_v_arr->base = __pyx_v_baseptr; - /* "View.MemoryView":545 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.obj * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "View.MemoryView":549 - * - * @property - * def shape(self): # <<<<<<<<<<<<<< - * return tuple([length for length in self.view.shape[:self.view.ndim]]) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ -/* 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; +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; - /* "View.MemoryView":550 - * @property - * def shape(self): - * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * - * @property + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 550, __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(3, 550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 550, __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(3, 550, __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":549 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< * - * @property - * def shape(self): # <<<<<<<<<<<<<< - * return tuple([length for length in self.view.shape[:self.view.ndim]]) * */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ /* function exit code */ - __pyx_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":553 - * - * @property - * def strides(self): # <<<<<<<<<<<<<< - * if self.view.strides == NULL: - * +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ -/* 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; +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; __Pyx_RefNannyDeclarations - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; 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_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); - /* "View.MemoryView":554 - * @property - * def strides(self): - * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * - * raise ValueError("Buffer view does not expose strides") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); - if (__pyx_t_1) { + { + __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:*/ { - /* "View.MemoryView":556 - * 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]]) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(3, 556, __pyx_L1_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 987, __pyx_L3_error) - /* "View.MemoryView":554 - * @property - * def strides(self): - * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * - * raise ValueError("Buffer view does not expose strides") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign - /* "View.MemoryView":558 - * raise ValueError("Buffer view does not expose strides") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") * - * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< + */ + __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(3, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * - * @property + * cdef inline int import_umath() except -1: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 558, __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(3, 558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 558, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 558, __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":553 - * - * @property - * def strides(self): # <<<<<<<<<<<<<< - * if self.view.strides == NULL: - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __Pyx_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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":561 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * - * @property - * def suboffsets(self): # <<<<<<<<<<<<<< - * if self.view.suboffsets == NULL: - * return (-1,) * self.view.ndim + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -/* 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; +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; __Pyx_RefNannyDeclarations - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; 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); + 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); - /* "View.MemoryView":562 - * @property - * def suboffsets(self): - * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< - * return (-1,) * self.view.ndim + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); - if (__pyx_t_1) { + { + __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:*/ { - /* "View.MemoryView":563 - * def suboffsets(self): - * if self.view.suboffsets == NULL: - * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< - * - * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__52, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "View.MemoryView":562 - * @property - * def suboffsets(self): - * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< - * return (-1,) * self.view.ndim - * - */ - } + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 993, __pyx_L3_error) - /* "View.MemoryView":565 - * return (-1,) * self.view.ndim - * - * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * @property + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); - for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { - __pyx_t_4 = __pyx_t_6; - __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(3, 565, __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(3, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + } + __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:; + __Pyx_PyThreadState_assign - /* "View.MemoryView":561 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") * - * @property - * def suboffsets(self): # <<<<<<<<<<<<<< - * if self.view.suboffsets == NULL: - * return (-1,) * self.view.ndim */ + __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(3, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* 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":568 - * - * @property - * def ndim(self): # <<<<<<<<<<<<<< - * return self.view.ndim + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * + * cdef inline int import_ufunc() except -1: */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; -/* 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":569 - * @property - * def ndim(self): - * return self.view.ndim # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * @property + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "View.MemoryView":568 - * - * @property - * def ndim(self): # <<<<<<<<<<<<<< - * return self.view.ndim + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":572 - * - * @property - * def itemsize(self): # <<<<<<<<<<<<<< - * return self.view.itemsize +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -/* 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; +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); + 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); - /* "View.MemoryView":573 - * @property - * def itemsize(self): - * return self.view.itemsize # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * @property + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + { + __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:*/ { - /* "View.MemoryView":572 - * - * @property - * def itemsize(self): # <<<<<<<<<<<<<< - * return self.view.itemsize - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 999, __pyx_L3_error) - /* 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":576 - * - * @property - * def nbytes(self): # <<<<<<<<<<<<<< - * return self.size * self.view.itemsize + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign -/* 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; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "View.MemoryView":577 - * @property - * def nbytes(self): - * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * @property + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __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(3, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "View.MemoryView":576 - * - * @property - * def nbytes(self): # <<<<<<<<<<<<<< - * return self.size * self.view.itemsize + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_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_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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":580 +/* "yt/geometry/selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * - * @property - * def size(self): # <<<<<<<<<<<<<< - * if self._size is None: - * result = 1 + * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): */ -/* 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; +static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) { 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); + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_ensure_code", 0); - /* "View.MemoryView":581 - * @property - * def size(self): - * if self._size is None: # <<<<<<<<<<<<<< - * result = 1 + /* "yt/geometry/selection_routines.pxd":23 * + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): # <<<<<<<<<<<<<< + * if "code_length" == str(arr.units): + * return arr */ - __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 23, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":582 - * def size(self): - * if self._size is None: - * result = 1 # <<<<<<<<<<<<<< - * - * for length in self.view.shape[:self.view.ndim]: + /* "yt/geometry/selection_routines.pxd":24 + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< + * return arr + * arr.convert_to_units("code_length") */ - __Pyx_INCREF(__pyx_int_1); - __pyx_v_result = __pyx_int_1; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 24, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { - /* "View.MemoryView":584 - * result = 1 - * - * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< - * result *= length - * + /* "yt/geometry/selection_routines.pxd":25 + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): + * return arr # <<<<<<<<<<<<<< + * arr.convert_to_units("code_length") + * return arr */ - __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(3, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); - __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; - /* "View.MemoryView":585 - * - * for length in self.view.shape[:self.view.ndim]: - * result *= length # <<<<<<<<<<<<<< - * - * self._size = result + /* "yt/geometry/selection_routines.pxd":24 + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< + * return arr + * arr.convert_to_units("code_length") */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); - __pyx_t_6 = 0; } - /* "View.MemoryView":587 - * result *= length - * - * self._size = result # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pxd":26 + * if "code_length" == str(arr.units): + * return arr + * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< + * return arr * - * 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; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":581 - * @property - * def size(self): - * if self._size is None: # <<<<<<<<<<<<<< - * result = 1 + /* "yt/geometry/selection_routines.pxd":23 * + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): # <<<<<<<<<<<<<< + * if "code_length" == str(arr.units): + * return arr */ } - /* "View.MemoryView":589 - * self._size = result - * - * return self._size # <<<<<<<<<<<<<< + /* "yt/geometry/selection_routines.pxd":27 + * return arr + * arr.convert_to_units("code_length") + * return arr # <<<<<<<<<<<<<< * - * def __len__(self): + * cdef class SelectorObject: */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->_size); - __pyx_r = __pyx_v_self->_size; + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "View.MemoryView":580 + /* "yt/geometry/selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * - * @property - * def size(self): # <<<<<<<<<<<<<< - * if self._size is None: - * result = 1 + * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): */ /* 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_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_result); - __Pyx_XDECREF(__pyx_v_length); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":591 - * return self._size +/* "yt/geometry/selection_routines.pxd":78 + * cdef public SelectorObject sel2 * - * def __len__(self): # <<<<<<<<<<<<<< - * if self.view.ndim >= 1: - * return self.view.shape[0] + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 */ -/* 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)); +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) { + __pyx_t_5numpy_float64_t __pyx_v_rel; + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "yt/geometry/selection_routines.pxd":80 + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< + * if not periodic: return rel + * if rel > dw * 0.5: + */ + __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); -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); + /* "yt/geometry/selection_routines.pxd":81 + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel # <<<<<<<<<<<<<< + * if rel > dw * 0.5: + * rel -= dw + */ + __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_rel; + goto __pyx_L0; + } - /* "View.MemoryView":592 - * - * def __len__(self): - * if self.view.ndim >= 1: # <<<<<<<<<<<<<< - * return self.view.shape[0] - * + /* "yt/geometry/selection_routines.pxd":82 + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel + * if rel > dw * 0.5: # <<<<<<<<<<<<<< + * rel -= dw + * elif rel < -dw * 0.5: */ - __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0); if (__pyx_t_1) { - /* "View.MemoryView":593 - * def __len__(self): - * if self.view.ndim >= 1: - * return self.view.shape[0] # <<<<<<<<<<<<<< - * - * return 0 + /* "yt/geometry/selection_routines.pxd":83 + * if not periodic: return rel + * if rel > dw * 0.5: + * rel -= dw # <<<<<<<<<<<<<< + * elif rel < -dw * 0.5: + * rel += dw */ - __pyx_r = (__pyx_v_self->view.shape[0]); - goto __pyx_L0; + __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw); - /* "View.MemoryView":592 - * - * def __len__(self): - * if self.view.ndim >= 1: # <<<<<<<<<<<<<< - * return self.view.shape[0] - * + /* "yt/geometry/selection_routines.pxd":82 + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel + * if rel > dw * 0.5: # <<<<<<<<<<<<<< + * rel -= dw + * elif rel < -dw * 0.5: */ + goto __pyx_L4; } - /* "View.MemoryView":595 - * return self.view.shape[0] - * - * return 0 # <<<<<<<<<<<<<< - * - * def __repr__(self): + /* "yt/geometry/selection_routines.pxd":84 + * if rel > dw * 0.5: + * rel -= dw + * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< + * rel += dw + * return rel */ - __pyx_r = 0; + __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0); + if (__pyx_t_1) { + + /* "yt/geometry/selection_routines.pxd":85 + * rel -= dw + * elif rel < -dw * 0.5: + * rel += dw # <<<<<<<<<<<<<< + * return rel + */ + __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw); + + /* "yt/geometry/selection_routines.pxd":84 + * if rel > dw * 0.5: + * rel -= dw + * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< + * rel += dw + * return rel + */ + } + __pyx_L4:; + + /* "yt/geometry/selection_routines.pxd":86 + * elif rel < -dw * 0.5: + * rel += dw + * return rel # <<<<<<<<<<<<<< + */ + __pyx_r = __pyx_v_rel; goto __pyx_L0; - /* "View.MemoryView":591 - * return self._size + /* "yt/geometry/selection_routines.pxd":78 + * cdef public SelectorObject sel2 * - * def __len__(self): # <<<<<<<<<<<<<< - * if self.view.ndim >= 1: - * return self.view.shape[0] + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 */ /* function exit code */ __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":597 - * return 0 +/* "yt/utilities/lib/bitarray.pxd":20 + * cimport cython * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "" % (self.base.__class__.__name__, - * id(self)) + * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, # <<<<<<<<<<<<<< + * np.uint8_t val) nogil: + * if val > 0: val = 1 */ -/* 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)); +static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_8bitarray_ba_set_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind, __pyx_t_5numpy_uint8_t __pyx_v_val) { + int __pyx_t_1; + __pyx_t_5numpy_uint64_t __pyx_t_2; - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "yt/utilities/lib/bitarray.pxd":22 + * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, + * np.uint8_t val) nogil: + * if val > 0: val = 1 # <<<<<<<<<<<<<< + * buf[ind >> 3] |= (val << (ind & 7)) + * + */ + __pyx_t_1 = ((__pyx_v_val > 0) != 0); + if (__pyx_t_1) { + __pyx_v_val = 1; + } -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); + /* "yt/utilities/lib/bitarray.pxd":23 + * np.uint8_t val) nogil: + * if val > 0: val = 1 + * buf[ind >> 3] |= (val << (ind & 7)) # <<<<<<<<<<<<<< + * + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: + */ + __pyx_t_2 = (__pyx_v_ind >> 3); + (__pyx_v_buf[__pyx_t_2]) = ((__pyx_v_buf[__pyx_t_2]) | (__pyx_v_val << (__pyx_v_ind & 7))); - /* "View.MemoryView":598 + /* "yt/utilities/lib/bitarray.pxd":20 + * cimport cython * - * def __repr__(self): - * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< - * id(self)) + * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, # <<<<<<<<<<<<<< + * np.uint8_t val) nogil: + * if val > 0: val = 1 + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/bitarray.pxd":25 + * buf[ind >> 3] |= (val << (ind & 7)) * + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 */ - __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(3, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":599 - * def __repr__(self): - * return "" % (self.base.__class__.__name__, - * id(self)) # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_9utilities_3lib_8bitarray_ba_get_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind) { + __pyx_t_5numpy_uint8_t __pyx_v_rv; + __pyx_t_5numpy_uint8_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/bitarray.pxd":26 * - * def __str__(self): + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) # <<<<<<<<<<<<<< + * if rv == 0: return 0 + * return 1 */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_rv = ((__pyx_v_buf[(__pyx_v_ind >> 3)]) & (1 << (__pyx_v_ind & 7))); - /* "View.MemoryView":598 + /* "yt/utilities/lib/bitarray.pxd":27 + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 # <<<<<<<<<<<<<< + * return 1 * - * def __repr__(self): - * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< - * id(self)) + */ + __pyx_t_1 = ((__pyx_v_rv == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "yt/utilities/lib/bitarray.pxd":28 + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 + * return 1 # <<<<<<<<<<<<<< * + * cdef class bitarray: */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __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_3); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = 1; goto __pyx_L0; - /* "View.MemoryView":597 - * return 0 + /* "yt/utilities/lib/bitarray.pxd":25 + * buf[ind >> 3] |= (val << (ind & 7)) * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "" % (self.base.__class__.__name__, - * id(self)) + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 */ /* 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":601 - * id(self)) +/* "View.MemoryView":120 + * cdef bint dtype_is_object * - * def __str__(self): # <<<<<<<<<<<<<< - * return "" % (self.base.__class__.__name__,) + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): * */ /* 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; +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 - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__str__", 0); + __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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __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, 120, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error) + } else { - /* "View.MemoryView":602 - * - * def __str__(self): - * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< + /* "View.MemoryView":121 * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< * + * cdef int idx */ - __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(3, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __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(3, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __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, 120, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __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":601 - * id(self)) + /* "View.MemoryView":120 + * cdef bint dtype_is_object * - * def __str__(self): # <<<<<<<<<<<<<< - * return "" % (self.base.__class__.__name__,) + * 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_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_r = -1; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":605 +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; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":127 + * cdef PyObject **p * + * self.ndim = len(shape) # <<<<<<<<<<<<<< + * self.itemsize = itemsize * - * def is_c_contig(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice *mslice - * cdef __Pyx_memviewslice tmp */ + if (unlikely(__pyx_v_shape == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(2, 127, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); -/* 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":608 - * 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) + /* "View.MemoryView":128 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< * + * if not self.ndim: */ - __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + __pyx_v_self->itemsize = __pyx_v_itemsize; - /* "View.MemoryView":609 - * cdef __Pyx_memviewslice tmp - * mslice = get_slice_from_memview(self, &tmp) - * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") * - * 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(3, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":605 + /* "View.MemoryView":131 * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< * - * def is_c_contig(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice *mslice - * cdef __Pyx_memviewslice tmp + * if itemsize <= 0: */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 131, __pyx_L1_error) - /* 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":611 - * return slice_is_contig(mslice[0], 'C', self.view.ndim) + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") * - * 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":614 - * 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) + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") * */ - __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":615 - * cdef __Pyx_memviewslice tmp - * mslice = get_slice_from_memview(self, &tmp) - * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< + /* "View.MemoryView":134 * - * def copy(self): + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): */ - __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(3, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 134, __pyx_L1_error) - /* "View.MemoryView":611 - * return slice_is_contig(mslice[0], 'C', self.view.ndim) + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") * - * 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":617 - * return slice_is_contig(mslice[0], 'F', self.view.ndim) + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") * - * def copy(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice mslice - * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * 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) { -/* 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":619 - * def copy(self): - * cdef __Pyx_memviewslice mslice - * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< + /* "View.MemoryView":137 * - * slice_copy(self, &mslice) + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format */ - __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__109, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); + __pyx_t_5 = 0; - /* "View.MemoryView":621 - * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") * - * slice_copy(self, &mslice) # <<<<<<<<<<<<<< - * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, - * self.view.itemsize, + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string */ - __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); + } - /* "View.MemoryView":622 + /* "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 * - * 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(3, 622, __pyx_L1_error) - __pyx_v_mslice = __pyx_t_1; + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 138, __pyx_L1_error) + __pyx_t_5 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; - /* "View.MemoryView":627 - * self.dtype_is_object) + /* "View.MemoryView":139 + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< * - * 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(3, 627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_6; - /* "View.MemoryView":617 - * return slice_is_contig(mslice[0], 'F', self.view.ndim) + /* "View.MemoryView":142 * - * 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":629 - * 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":631 - * def copy_fortran(self): - * cdef __Pyx_memviewslice src, dst - * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< + * self._strides = self._shape + self.ndim * - * slice_copy(self, &src) */ - __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); + __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); - /* "View.MemoryView":633 - * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + /* "View.MemoryView":143 * - * slice_copy(self, &src) # <<<<<<<<<<<<<< - * dst = slice_copy_contig(&src, "fortran", self.view.ndim, - * self.view.itemsize, + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) + * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< + * + * if not self._shape: */ - __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); - /* "View.MemoryView":634 + /* "View.MemoryView":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") * - * 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(3, 634, __pyx_L1_error) - __pyx_v_dst = __pyx_t_1; + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (__pyx_t_4) { - /* "View.MemoryView":639 - * self.dtype_is_object) + /* "View.MemoryView":146 * - * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< * * */ - __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(3, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 146, __pyx_L1_error) - /* "View.MemoryView":629 - * return memoryview_copy_from_slice(self, &mslice) + /* "View.MemoryView":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") * - * def copy_fortran(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice src, dst - * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS */ + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "View.MemoryView":643 + /* "View.MemoryView":149 * - * @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 + * + * 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, 149, __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, 149, __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, 149, __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); -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":644 - * @cname('__pyx_memoryview_new') - * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): - * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< - * result.typeinfo = typeinfo - * return result + /* "View.MemoryView":150 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 644, __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(3, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (__pyx_t_4) { - /* "View.MemoryView":645 - * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): - * cdef memoryview result = memoryview(o, flags, dtype_is_object) - * result.typeinfo = typeinfo # <<<<<<<<<<<<<< - * return result + /* "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_v_result->typeinfo = __pyx_v_typeinfo; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __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, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __PYX_ERR(2, 151, __pyx_L1_error) - /* "View.MemoryView":646 - * cdef memoryview result = memoryview(o, flags, dtype_is_object) - * result.typeinfo = typeinfo - * return result # <<<<<<<<<<<<<< + /* "View.MemoryView":150 * - * @cname('__pyx_memoryview_check') + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); - goto __pyx_L0; + } - /* "View.MemoryView":643 + /* "View.MemoryView":152 + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim # <<<<<<<<<<<<<< * - * @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 + * cdef char order */ + (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; - /* 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":649 + /* "View.MemoryView":149 * - * @cname('__pyx_memoryview_check') - * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< - * return isinstance(o, memoryview) * + * 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; -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":650 - * @cname('__pyx_memoryview_check') - * cdef inline bint memoryview_check(object o): - * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + /* "View.MemoryView":155 * - * cdef tuple _unellipsify(object index, int ndim): + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); - __pyx_r = __pyx_t_1; - goto __pyx_L0; + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 155, __pyx_L1_error) + if (__pyx_t_4) { - /* "View.MemoryView":649 - * - * @cname('__pyx_memoryview_check') - * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< - * return isinstance(o, memoryview) - * + /* "View.MemoryView":156 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': */ + __pyx_v_order = 'F'; - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "View.MemoryView":652 - * return isinstance(o, memoryview) - * - * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< - * """ - * Replace all ellipses with full slices and fill incomplete indices with + /* "View.MemoryView":157 + * 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; -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":657 - * 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":658 - * """ - * if not isinstance(index, tuple): - * tup = (index,) # <<<<<<<<<<<<<< - * else: - * tup = index - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 658, __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":657 - * full slices. - * """ - * if not isinstance(index, tuple): # <<<<<<<<<<<<<< - * tup = (index,) - * else: - */ - goto __pyx_L3; - } - - /* "View.MemoryView":660 - * tup = (index,) - * else: - * tup = index # <<<<<<<<<<<<<< + /* "View.MemoryView":155 * - * result = [] + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' */ - /*else*/ { - __Pyx_INCREF(__pyx_v_index); - __pyx_v_tup = __pyx_v_index; + goto __pyx_L10; } - __pyx_L3:; - /* "View.MemoryView":662 - * tup = index - * - * result = [] # <<<<<<<<<<<<<< - * have_slices = False - * seen_ellipsis = False + /* "View.MemoryView":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_result = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error) + if (__pyx_t_4) { - /* "View.MemoryView":663 - * - * result = [] - * have_slices = False # <<<<<<<<<<<<<< - * seen_ellipsis = False - * for idx, item in enumerate(tup): + /* "View.MemoryView":159 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: */ - __pyx_v_have_slices = 0; + __pyx_v_order = 'C'; - /* "View.MemoryView":664 - * result = [] - * have_slices = False - * seen_ellipsis = False # <<<<<<<<<<<<<< - * for idx, item in enumerate(tup): - * if item is Ellipsis: + /* "View.MemoryView":160 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) */ - __pyx_v_seen_ellipsis = 0; + __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":665 - * have_slices = False - * seen_ellipsis = False - * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< - * if item is Ellipsis: - * if not seen_ellipsis: + /* "View.MemoryView":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' */ - __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(3, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 665, __pyx_L1_error) + goto __pyx_L10; } - 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(3, 665, __pyx_L1_error) - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 665, __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(3, 665, __pyx_L1_error) - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 665, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 665, __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(3, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); - __pyx_t_3 = __pyx_t_7; - __pyx_t_7 = 0; - - /* "View.MemoryView":666 - * seen_ellipsis = False - * for idx, item in enumerate(tup): - * if item is Ellipsis: # <<<<<<<<<<<<<< - * if not seen_ellipsis: - * result.extend([slice(None)] * (ndim - len(tup) + 1)) - */ - __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":667 - * for idx, item in enumerate(tup): - * if item is Ellipsis: - * if not seen_ellipsis: # <<<<<<<<<<<<<< - * result.extend([slice(None)] * (ndim - len(tup) + 1)) - * seen_ellipsis = True - */ - __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":668 - * if item is Ellipsis: - * if not seen_ellipsis: - * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< - * seen_ellipsis = True - * else: - */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - { Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__53); - __Pyx_GIVEREF(__pyx_slice__53); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__53); - } - } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "View.MemoryView":669 - * 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":667 - * for idx, item in enumerate(tup): - * if item is Ellipsis: - * if not seen_ellipsis: # <<<<<<<<<<<<<< - * result.extend([slice(None)] * (ndim - len(tup) + 1)) - * seen_ellipsis = True - */ - goto __pyx_L7; - } - /* "View.MemoryView":671 - * seen_ellipsis = True - * else: - * result.append(slice(None)) # <<<<<<<<<<<<<< - * have_slices = True + /* "View.MemoryView":162 + * self.mode = u'c' * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, */ - /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__54); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 671, __pyx_L1_error) - } - __pyx_L7:; + /*else*/ { + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 162, __pyx_L1_error) + } + __pyx_L10:; - /* "View.MemoryView":672 - * else: - * result.append(slice(None)) - * have_slices = True # <<<<<<<<<<<<<< - * else: - * if not isinstance(item, slice) and not PyIndex_Check(item): + /* "View.MemoryView":164 + * 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_have_slices = 1; + __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":666 - * seen_ellipsis = False - * for idx, item in enumerate(tup): - * if item is Ellipsis: # <<<<<<<<<<<<<< - * if not seen_ellipsis: - * result.extend([slice(None)] * (ndim - len(tup) + 1)) + /* "View.MemoryView":167 + * itemsize, self.ndim, order) + * + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: */ - goto __pyx_L6; - } + __pyx_v_self->free_data = __pyx_v_allocate_buffer; - /* "View.MemoryView":674 - * have_slices = True - * else: - * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< - * raise TypeError("Cannot index with type '%s'" % type(item)) + /* "View.MemoryView":168 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: * */ - /*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 (__pyx_t_1) { + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; - /* "View.MemoryView":675 - * else: - * if not isinstance(item, slice) and not PyIndex_Check(item): - * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + /* "View.MemoryView":169 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * * - * 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(3, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(3, 675, __pyx_L1_error) + __pyx_t_4 = (__pyx_v_allocate_buffer != 0); + if (__pyx_t_4) { - /* "View.MemoryView":674 - * have_slices = True - * else: - * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< - * raise TypeError("Cannot index with type '%s'" % type(item)) + /* "View.MemoryView":172 * + * + * 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":677 - * raise TypeError("Cannot index with type '%s'" % type(item)) + /* "View.MemoryView":173 * - * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< - * result.append(item) + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") * */ - __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; + __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); + if (__pyx_t_4) { - /* "View.MemoryView":678 + /* "View.MemoryView":174 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< * - * have_slices = have_slices or isinstance(item, slice) - * result.append(item) # <<<<<<<<<<<<<< + * if self.dtype_is_object: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 174, __pyx_L1_error) + + /* "View.MemoryView":173 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") * - * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 678, __pyx_L1_error) } - __pyx_L6:; - /* "View.MemoryView":665 - * have_slices = False - * seen_ellipsis = False - * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< - * if item is Ellipsis: - * if not seen_ellipsis: + /* "View.MemoryView":176 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): */ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { - /* "View.MemoryView":680 - * result.append(item) + /* "View.MemoryView":177 * - * nslices = ndim - len(result) # <<<<<<<<<<<<<< - * if nslices: - * result.extend([slice(None)] * nslices) + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 680, __pyx_L1_error) - __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + __pyx_v_p = ((PyObject **)__pyx_v_self->data); - /* "View.MemoryView":681 - * - * nslices = ndim - len(result) - * if nslices: # <<<<<<<<<<<<<< - * result.extend([slice(None)] * nslices) + /* "View.MemoryView":178 + * 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, 178, __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, 178, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":179 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) * */ - __pyx_t_1 = (__pyx_v_nslices != 0); - if (__pyx_t_1) { + (__pyx_v_p[__pyx_v_i]) = Py_None; - /* "View.MemoryView":682 - * nslices = ndim - len(result) - * if nslices: - * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + /* "View.MemoryView":180 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * - * return have_slices or nslices, tuple(result) + * @cname('getbuffer') */ - __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - { Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__55); - __Pyx_GIVEREF(__pyx_slice__55); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__55); + Py_INCREF(Py_None); } - } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 682, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":681 - * - * nslices = ndim - len(result) - * if nslices: # <<<<<<<<<<<<<< - * result.extend([slice(None)] * nslices) + /* "View.MemoryView":176 + * raise MemoryError("unable to allocate array data.") * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): */ - } + } - /* "View.MemoryView":684 - * result.extend([slice(None)] * nslices) + /* "View.MemoryView":169 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< * - * 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(3, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; - __pyx_t_4 = 0; - __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_r = ((PyObject*)__pyx_t_7); - __pyx_t_7 = 0; - goto __pyx_L0; - /* "View.MemoryView":652 - * return isinstance(o, memoryview) + /* "View.MemoryView":120 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): * - * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< - * """ - * Replace all ellipses with full slices and fill incomplete indices with */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; __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_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_tup); - __Pyx_XDECREF(__pyx_v_result); - __Pyx_XDECREF(__pyx_v_idx); - __Pyx_XDECREF(__pyx_v_item); - __Pyx_XGIVEREF(__pyx_r); + __Pyx_XDECREF(__pyx_v_format); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":686 - * return have_slices or nslices, tuple(result) +/* "View.MemoryView":183 * - * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< - * for suboffset in suboffsets[:ndim]: - * if suboffset >= 0: + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": */ -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; +/* 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 - 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":687 - * - * 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":688 - * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): - * for suboffset in suboffsets[:ndim]: - * if suboffset >= 0: # <<<<<<<<<<<<<< - * raise ValueError("Indirect dimensions not supported") - * - */ - __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); - if (__pyx_t_4) { - - /* "View.MemoryView":689 - * 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__56, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 689, __pyx_L1_error) - - /* "View.MemoryView":688 - * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): - * for suboffset in suboffsets[:ndim]: - * if suboffset >= 0: # <<<<<<<<<<<<<< - * raise ValueError("Indirect dimensions not supported") - * - */ - } - } - - /* "View.MemoryView":686 - * 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: - */ + __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_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":696 - * - * @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; +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; - struct __pyx_memoryview_obj *__pyx_t_4; - char *__pyx_t_5; + char *__pyx_t_4; + Py_ssize_t __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":697 - * @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":704 - * - * - * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< - * - * cdef _memoryviewslice memviewsliceobj - */ - memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + Py_ssize_t *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "View.MemoryView":708 - * cdef _memoryviewslice memviewsliceobj - * - * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< - * - * if isinstance(memview, _memoryviewslice): + /* "View.MemoryView":184 + * @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 */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!Py_OptimizeFlag)) { - if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { - PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(3, 708, __pyx_L1_error) - } - } - #endif + __pyx_v_bufmode = -1; - /* "View.MemoryView":710 - * assert memview.view.ndim > 0 - * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * memviewsliceobj = memview - * p_src = &memviewsliceobj.from_slice + /* "View.MemoryView":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": */ - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":711 - * - * if isinstance(memview, _memoryviewslice): - * memviewsliceobj = memview # <<<<<<<<<<<<<< - * p_src = &memviewsliceobj.from_slice - * else: - */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(3, 711, __pyx_L1_error) - __pyx_t_3 = ((PyObject *)__pyx_v_memview); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "View.MemoryView":712 - * if isinstance(memview, _memoryviewslice): - * memviewsliceobj = memview - * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< - * else: - * slice_copy(memview, &src) + /* "View.MemoryView":186 + * 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_p_src = (&__pyx_v_memviewsliceobj->from_slice); + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); - /* "View.MemoryView":710 - * assert memview.view.ndim > 0 - * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * memviewsliceobj = memview - * p_src = &memviewsliceobj.from_slice + /* "View.MemoryView":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": */ goto __pyx_L3; } - /* "View.MemoryView":714 - * p_src = &memviewsliceobj.from_slice - * else: - * slice_copy(memview, &src) # <<<<<<<<<<<<<< - * p_src = &src - * + /* "View.MemoryView":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): */ - /*else*/ { - __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 187, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { - /* "View.MemoryView":715 - * else: - * slice_copy(memview, &src) - * p_src = &src # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":188 + * 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":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): */ - __pyx_v_p_src = (&__pyx_v_src); } __pyx_L3:; - /* "View.MemoryView":721 - * - * - * dst.memview = p_src.memview # <<<<<<<<<<<<<< - * dst.data = p_src.data - * + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data */ - __pyx_t_4 = __pyx_v_p_src->memview; - __pyx_v_dst.memview = __pyx_t_4; + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":722 - * - * dst.memview = p_src.memview - * dst.data = p_src.data # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len */ - __pyx_t_5 = __pyx_v_p_src->data; - __pyx_v_dst.data = __pyx_t_5; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 190, __pyx_L1_error) - /* "View.MemoryView":727 - * - * - * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< - * cdef int *p_suboffset_dim = &suboffset_dim - * cdef Py_ssize_t start, stop, step + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data */ - __pyx_v_p_dst = (&__pyx_v_dst); + } - /* "View.MemoryView":728 - * - * 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 + /* "View.MemoryView":191 + * 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_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; - /* "View.MemoryView":732 - * cdef bint have_start, have_stop, have_step - * - * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< - * if PyIndex_Check(index): - * slice_memviewslice( + /* "View.MemoryView":192 + * 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_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(3, 732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 732, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_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(3, 732, __pyx_L1_error) - #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 732, __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(3, 732, __pyx_L1_error) - #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 732, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 732, __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); + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; - /* "View.MemoryView":733 - * - * for dim, index in enumerate(indices): - * if PyIndex_Check(index): # <<<<<<<<<<<<<< - * slice_memviewslice( - * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + /* "View.MemoryView":193 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides */ - __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); - if (__pyx_t_2) { + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; - /* "View.MemoryView":737 - * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], - * dim, new_ndim, p_suboffset_dim, - * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< - * 0, 0, 0, # have_{start,stop,step} - * False) + /* "View.MemoryView":194 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL */ - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 737, __pyx_L1_error) + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; - /* "View.MemoryView":734 - * for dim, index in enumerate(indices): - * if PyIndex_Check(index): - * slice_memviewslice( # <<<<<<<<<<<<<< - * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], - * dim, new_ndim, p_suboffset_dim, + /* "View.MemoryView":195 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 734, __pyx_L1_error) + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; - /* "View.MemoryView":733 - * - * for dim, index in enumerate(indices): - * if PyIndex_Check(index): # <<<<<<<<<<<<<< - * slice_memviewslice( - * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + /* "View.MemoryView":196 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 */ - goto __pyx_L6; - } + __pyx_v_info->suboffsets = NULL; - /* "View.MemoryView":740 - * 0, 0, 0, # have_{start,stop,step} - * False) - * elif index is None: # <<<<<<<<<<<<<< - * p_dst.shape[new_ndim] = 1 - * p_dst.strides[new_ndim] = 0 + /* "View.MemoryView":197 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 + * */ - __pyx_t_2 = (__pyx_v_index == Py_None); - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; - /* "View.MemoryView":741 - * False) - * elif index is None: - * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< - * p_dst.strides[new_ndim] = 0 - * p_dst.suboffsets[new_ndim] = -1 + /* "View.MemoryView":198 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: */ - (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + __pyx_v_info->readonly = 0; - /* "View.MemoryView":742 - * 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 + /* "View.MemoryView":200 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: */ - (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":743 - * p_dst.shape[new_ndim] = 1 - * p_dst.strides[new_ndim] = 0 - * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< - * new_ndim += 1 + /* "View.MemoryView":201 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< * else: + * info.format = NULL */ - (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; - /* "View.MemoryView":744 - * p_dst.strides[new_ndim] = 0 - * p_dst.suboffsets[new_ndim] = -1 - * new_ndim += 1 # <<<<<<<<<<<<<< + /* "View.MemoryView":200 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format * else: - * start = index.start or 0 */ - __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); - - /* "View.MemoryView":740 - * 0, 0, 0, # have_{start,stop,step} - * False) - * elif index is None: # <<<<<<<<<<<<<< - * p_dst.shape[new_ndim] = 1 - * p_dst.strides[new_ndim] = 0 - */ - goto __pyx_L6; - } - - /* "View.MemoryView":746 - * 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(3, 746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 746, __pyx_L1_error) - if (!__pyx_t_1) { - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 746, __pyx_L1_error) - __pyx_t_10 = __pyx_t_12; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_10 = 0; - __pyx_L7_bool_binop_done:; - __pyx_v_start = __pyx_t_10; + goto __pyx_L5; + } - /* "View.MemoryView":747 + /* "View.MemoryView":203 + * info.format = self.format * else: - * start = index.start or 0 - * stop = index.stop or 0 # <<<<<<<<<<<<<< - * step = index.step or 0 + * info.format = NULL # <<<<<<<<<<<<<< * + * info.obj = self */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 747, __pyx_L1_error) - if (!__pyx_t_1) { - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 747, __pyx_L1_error) - __pyx_t_10 = __pyx_t_12; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L9_bool_binop_done; - } - __pyx_t_10 = 0; - __pyx_L9_bool_binop_done:; - __pyx_v_stop = __pyx_t_10; + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; - /* "View.MemoryView":748 - * start = index.start or 0 - * stop = index.stop or 0 - * step = index.step or 0 # <<<<<<<<<<<<<< + /* "View.MemoryView":205 + * info.format = NULL * - * 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(3, 748, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 748, __pyx_L1_error) - if (!__pyx_t_1) { - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 748, __pyx_L1_error) - __pyx_t_10 = __pyx_t_12; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L11_bool_binop_done; - } - __pyx_t_10 = 0; - __pyx_L11_bool_binop_done:; - __pyx_v_step = __pyx_t_10; - - /* "View.MemoryView":750 - * step = index.step or 0 + * info.obj = self # <<<<<<<<<<<<<< * - * have_start = index.start is not None # <<<<<<<<<<<<<< - * have_stop = index.stop is not None - * have_step = index.step is not None + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 750, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = (__pyx_t_9 != Py_None); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_have_start = __pyx_t_1; + __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":751 - * - * have_start = index.start is not None - * have_stop = index.stop is not None # <<<<<<<<<<<<<< - * have_step = index.step is not None + /* "View.MemoryView":183 * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 751, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = (__pyx_t_9 != Py_None); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_have_stop = __pyx_t_1; - /* "View.MemoryView":752 - * have_start = index.start is not None - * have_stop = index.stop is not None - * have_step = index.step is not None # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":209 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") * - * slice_memviewslice( + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 752, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = (__pyx_t_9 != Py_None); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_have_step = __pyx_t_1; - /* "View.MemoryView":754 - * have_step = index.step is not None +/* 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":210 * - * slice_memviewslice( # <<<<<<<<<<<<<< - * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], - * dim, new_ndim, p_suboffset_dim, + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 754, __pyx_L1_error) + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":760 - * have_start, have_stop, have_step, - * True) - * new_ndim += 1 # <<<<<<<<<<<<<< - * - * if isinstance(memview, _memoryviewslice): + /* "View.MemoryView":211 + * 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_new_ndim = (__pyx_v_new_ndim + 1); - } - __pyx_L6:; + __pyx_v_self->callback_free_data(__pyx_v_self->data); - /* "View.MemoryView":732 - * cdef bint have_start, have_stop, have_step + /* "View.MemoryView":210 * - * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< - * if PyIndex_Check(index): - * slice_memviewslice( + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: */ + goto __pyx_L3; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":762 - * new_ndim += 1 - * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * return memoryview_fromslice(dst, new_ndim, - * memviewsliceobj.to_object_func, + /* "View.MemoryView":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, */ - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { - /* "View.MemoryView":763 - * - * if isinstance(memview, _memoryviewslice): - * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< - * memviewsliceobj.to_object_func, - * memviewsliceobj.to_dtype_func, + /* "View.MemoryView":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { - /* "View.MemoryView":764 - * if isinstance(memview, _memoryviewslice): - * return memoryview_fromslice(dst, new_ndim, - * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< - * memviewsliceobj.to_dtype_func, - * memview.dtype_is_object) + /* "View.MemoryView":214 + * 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) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 764, __pyx_L1_error) } + __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":765 - * return memoryview_fromslice(dst, new_ndim, - * memviewsliceobj.to_object_func, - * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< - * memview.dtype_is_object) - * else: + /* "View.MemoryView":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 765, __pyx_L1_error) } + } - /* "View.MemoryView":763 + /* "View.MemoryView":216 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyObject_Free(self._shape) * - * 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(3, 763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 763, __pyx_L1_error) - __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; + free(__pyx_v_self->data); - /* "View.MemoryView":762 - * new_ndim += 1 - * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * return memoryview_fromslice(dst, new_ndim, - * memviewsliceobj.to_object_func, + /* "View.MemoryView":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, */ } + __pyx_L3:; - /* "View.MemoryView":768 - * memview.dtype_is_object) - * else: - * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< - * memview.dtype_is_object) + /* "View.MemoryView":217 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< * + * @property */ - /*else*/ { - __Pyx_XDECREF(((PyObject *)__pyx_r)); + PyObject_Free(__pyx_v_self->_shape); - /* "View.MemoryView":769 - * else: - * return memoryview_fromslice(dst, new_ndim, NULL, NULL, - * memview.dtype_is_object) # <<<<<<<<<<<<<< + /* "View.MemoryView":209 + * __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":220 * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() * */ - __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(3, 768, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - /* "View.MemoryView":768 - * memview.dtype_is_object) - * else: - * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< - * memview.dtype_is_object) +/* 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":221 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< * + * @cname('get_memview') */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 768, __pyx_L1_error) - __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":696 + /* "View.MemoryView":220 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() * - * @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_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); - __Pyx_XDECREF(__pyx_v_index); - __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":793 +/* "View.MemoryView":224 * - * @cname('__pyx_memoryview_slice_memviewslice') - * cdef int slice_memviewslice( # <<<<<<<<<<<<<< - * __Pyx_memviewslice *dst, - * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) */ -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; +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":813 - * cdef bint negative_step - * - * if not is_slice: # <<<<<<<<<<<<<< + /* "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) * - * if start < 0: */ - __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); - if (__pyx_t_1) { + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); - /* "View.MemoryView":815 - * if not is_slice: + /* "View.MemoryView":226 + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< * - * if start < 0: # <<<<<<<<<<<<<< - * start += shape - * if not 0 <= start < shape: - */ - __pyx_t_1 = ((__pyx_v_start < 0) != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":816 * - * 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); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __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, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "View.MemoryView":815 - * if not is_slice: + /* "View.MemoryView":224 * - * if start < 0: # <<<<<<<<<<<<<< - * start += shape - * if not 0 <= start < shape: + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) */ - } - /* "View.MemoryView":817 - * if start < 0: - * start += shape - * if not 0 <= start < shape: # <<<<<<<<<<<<<< - * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) - * else: - */ - __pyx_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) { + /* 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":818 - * start += shape - * if not 0 <= start < shape: - * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< - * else: +/* "View.MemoryView":229 * - */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 818, __pyx_L1_error) - - /* "View.MemoryView":817 - * if start < 0: - * start += shape - * if not 0 <= start < shape: # <<<<<<<<<<<<<< - * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) - * else: - */ - } - - /* "View.MemoryView":813 - * cdef bint negative_step * - * if not is_slice: # <<<<<<<<<<<<<< + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) * - * if start < 0: */ - goto __pyx_L3; - } - /* "View.MemoryView":821 - * else: +/* 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_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":230 * - * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< * - * if have_step and step == 0: + * def __getitem__(self, item): */ - /*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; + __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, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "View.MemoryView":823 - * negative_step = have_step != 0 and step < 0 + /* "View.MemoryView":229 * - * if have_step and step == 0: # <<<<<<<<<<<<<< - * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) * */ - __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":824 - * - * if have_step and step == 0: - * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + /* 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":232 + * return getattr(self.memview, attr) * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 824, __pyx_L1_error) - /* "View.MemoryView":823 - * negative_step = have_step != 0 and step < 0 +/* 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_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":233 * - * if have_step and step == 0: # <<<<<<<<<<<<<< - * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * 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, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __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":827 + /* "View.MemoryView":232 + * return getattr(self.memview, attr) * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] * - * if have_start: # <<<<<<<<<<<<<< - * if start < 0: - * start += shape */ - __pyx_t_2 = (__pyx_v_have_start != 0); - if (__pyx_t_2) { - /* "View.MemoryView":828 + /* 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":235 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value * - * 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":829 - * if have_start: - * if start < 0: - * start += shape # <<<<<<<<<<<<<< - * if start < 0: - * start = 0 - */ - __pyx_v_start = (__pyx_v_start + __pyx_v_shape); +/* 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_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); - /* "View.MemoryView":830 - * 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) { + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":831 - * start += shape - * if start < 0: - * start = 0 # <<<<<<<<<<<<<< - * elif start >= shape: - * if negative_step: - */ - __pyx_v_start = 0; +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); - /* "View.MemoryView":830 - * if start < 0: - * start += shape - * if start < 0: # <<<<<<<<<<<<<< - * start = 0 - * elif start >= shape: + /* "View.MemoryView":236 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * */ - } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":828 + /* "View.MemoryView":235 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value * - * if have_start: - * if start < 0: # <<<<<<<<<<<<<< - * start += shape - * if start < 0: */ - goto __pyx_L12; - } - /* "View.MemoryView":832 - * 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) { + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":833 - * start = 0 - * elif start >= shape: - * if negative_step: # <<<<<<<<<<<<<< - * start = shape - 1 - * else: +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_2 = (__pyx_v_negative_step != 0); - if (__pyx_t_2) { - /* "View.MemoryView":834 - * elif start >= shape: - * if negative_step: - * start = shape - 1 # <<<<<<<<<<<<<< - * else: - * start = shape - */ - __pyx_v_start = (__pyx_v_shape - 1); +/* 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)); - /* "View.MemoryView":833 - * start = 0 - * elif start >= shape: - * if negative_step: # <<<<<<<<<<<<<< - * start = shape - 1 - * else: - */ - goto __pyx_L14; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":836 - * start = shape - 1 - * else: - * start = shape # <<<<<<<<<<<<<< - * else: - * if negative_step: - */ - /*else*/ { - __pyx_v_start = __pyx_v_shape; - } - __pyx_L14:; +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); - /* "View.MemoryView":832 - * if start < 0: - * start = 0 - * elif start >= shape: # <<<<<<<<<<<<<< - * if negative_step: - * start = shape - 1 + /* "(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_L12:; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__113, 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) - /* "View.MemoryView":827 - * - * - * if have_start: # <<<<<<<<<<<<<< - * if start < 0: - * start += shape + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - goto __pyx_L11; - } - /* "View.MemoryView":838 - * start = shape - * else: - * if negative_step: # <<<<<<<<<<<<<< - * start = shape - 1 - * else: + /* 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__") */ - /*else*/ { - __pyx_t_2 = (__pyx_v_negative_step != 0); - if (__pyx_t_2) { - /* "View.MemoryView":839 - * else: - * if negative_step: - * start = shape - 1 # <<<<<<<<<<<<<< - * else: - * start = 0 +/* 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_v_start = (__pyx_v_shape - 1); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__114, 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) - /* "View.MemoryView":838 - * start = shape - * else: - * if negative_step: # <<<<<<<<<<<<<< - * start = shape - 1 - * else: + /* "(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__") */ - goto __pyx_L15; - } - /* "View.MemoryView":841 - * start = shape - 1 - * else: - * start = 0 # <<<<<<<<<<<<<< + /* 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":240 * - * if have_stop: + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result */ - /*else*/ { - __pyx_v_start = 0; - } - __pyx_L15:; - } - __pyx_L11:; - /* "View.MemoryView":843 - * start = 0 +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":244 + * cdef array result * - * if have_stop: # <<<<<<<<<<<<<< - * if stop < 0: - * stop += shape + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: */ - __pyx_t_2 = (__pyx_v_have_stop != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":844 + /* "View.MemoryView":245 * - * if have_stop: - * if stop < 0: # <<<<<<<<<<<<<< - * stop += shape - * if stop < 0: + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), */ - __pyx_t_2 = ((__pyx_v_stop < 0) != 0); - if (__pyx_t_2) { + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __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, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; - /* "View.MemoryView":845 - * if have_stop: - * if stop < 0: - * stop += shape # <<<<<<<<<<<<<< - * if stop < 0: - * stop = 0 + /* "View.MemoryView":244 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: */ - __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + goto __pyx_L3; + } - /* "View.MemoryView":846 - * if stop < 0: - * stop += shape - * if stop < 0: # <<<<<<<<<<<<<< - * stop = 0 - * elif stop > shape: + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf */ - __pyx_t_2 = ((__pyx_v_stop < 0) != 0); - if (__pyx_t_2) { + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __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":847 - * stop += shape - * if stop < 0: - * stop = 0 # <<<<<<<<<<<<<< - * elif stop > shape: - * stop = shape + /* "View.MemoryView":248 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * */ - __pyx_v_stop = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error) - /* "View.MemoryView":846 - * if stop < 0: - * stop += shape - * if stop < 0: # <<<<<<<<<<<<<< - * stop = 0 - * elif stop > shape: + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf */ - } - - /* "View.MemoryView":844 - * - * if have_stop: - * if stop < 0: # <<<<<<<<<<<<<< - * stop += shape - * if stop < 0: - */ - goto __pyx_L17; - } - - /* "View.MemoryView":848 - * 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) { + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; - /* "View.MemoryView":849 - * stop = 0 - * elif stop > shape: - * stop = shape # <<<<<<<<<<<<<< - * else: - * if negative_step: + /* "View.MemoryView":249 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result */ - __pyx_v_stop = __pyx_v_shape; + __pyx_v_result->data = __pyx_v_buf; + } + __pyx_L3:; - /* "View.MemoryView":848 - * if stop < 0: - * stop = 0 - * elif stop > shape: # <<<<<<<<<<<<<< - * stop = shape - * else: + /* "View.MemoryView":251 + * result.data = buf + * + * return result # <<<<<<<<<<<<<< + * + * */ - } - __pyx_L17:; + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; - /* "View.MemoryView":843 - * start = 0 + /* "View.MemoryView":240 * - * if have_stop: # <<<<<<<<<<<<<< - * if stop < 0: - * stop += shape + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result */ - goto __pyx_L16; - } - /* "View.MemoryView":851 - * stop = shape - * else: - * if negative_step: # <<<<<<<<<<<<<< - * stop = -1 - * else: - */ - /*else*/ { - __pyx_t_2 = (__pyx_v_negative_step != 0); - if (__pyx_t_2) { + /* 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":852 - * else: - * if negative_step: - * stop = -1 # <<<<<<<<<<<<<< - * else: - * stop = shape +/* "View.MemoryView":277 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): */ - __pyx_v_stop = -1L; - /* "View.MemoryView":851 - * stop = shape - * else: - * if negative_step: # <<<<<<<<<<<<<< - * stop = -1 - * else: - */ - goto __pyx_L19; +/* 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; } - - /* "View.MemoryView":854 - * stop = -1 - * else: - * stop = shape # <<<<<<<<<<<<<< - * - * if not have_step: - */ - /*else*/ { - __pyx_v_stop = __pyx_v_shape; + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; } - __pyx_L19:; + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 277, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } - __pyx_L16:; + __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, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); - /* "View.MemoryView":856 - * stop = shape - * - * if not have_step: # <<<<<<<<<<<<<< - * step = 1 - * + /* 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":278 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name */ - __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); - if (__pyx_t_2) { + __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":857 - * - * if not have_step: - * step = 1 # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":277 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): */ - __pyx_v_step = 1; - /* "View.MemoryView":856 - * stop = shape - * - * if not have_step: # <<<<<<<<<<<<<< - * step = 1 + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":279 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name * */ - } - /* "View.MemoryView":861 - * - * with cython.cdivision(True): - * new_shape = (stop - start) // step # <<<<<<<<<<<<<< +/* 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":280 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< * - * if (stop - start) - step * new_shape: + * cdef generic = Enum("") */ - __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; - /* "View.MemoryView":863 - * new_shape = (stop - start) // step - * - * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< - * new_shape += 1 + /* "View.MemoryView":279 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name * */ - __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":864 - * - * if (stop - start) - step * new_shape: - * new_shape += 1 # <<<<<<<<<<<<<< - * - * if new_shape < 0: + /* 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,) */ - __pyx_v_new_shape = (__pyx_v_new_shape + 1); - /* "View.MemoryView":863 - * new_shape = (stop - start) // step - * - * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< - * new_shape += 1 - * +/* 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; - /* "View.MemoryView":866 - * new_shape += 1 - * - * if new_shape < 0: # <<<<<<<<<<<<<< - * new_shape = 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_2 = ((__pyx_v_new_shape < 0) != 0); - if (__pyx_t_2) { + __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; - /* "View.MemoryView":867 - * - * if new_shape < 0: - * new_shape = 0 # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":5 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - __pyx_v_new_shape = 0; + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { - /* "View.MemoryView":866 - * new_shape += 1 - * - * if new_shape < 0: # <<<<<<<<<<<<<< - * new_shape = 0 - * + /* "(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; - /* "View.MemoryView":870 - * - * - * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< - * dst.shape[new_ndim] = new_shape - * dst.suboffsets[new_ndim] = suboffset + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.name is not None */ - (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + __pyx_v_use_setstate = 1; - /* "View.MemoryView":871 - * - * dst.strides[new_ndim] = stride * step - * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< - * dst.suboffsets[new_ndim] = suboffset - * + /* "(tree fragment)":5 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + goto __pyx_L3; + } - /* "View.MemoryView":872 - * dst.strides[new_ndim] = stride * step - * dst.shape[new_ndim] = new_shape - * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< - * - * + /* "(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 */ - (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; + /*else*/ { + __pyx_t_3 = (__pyx_v_self->name != Py_None); + __pyx_v_use_setstate = __pyx_t_3; } __pyx_L3:; - /* "View.MemoryView":875 - * - * - * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< - * dst.data += start * stride + /* "(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_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); - if (__pyx_t_2) { + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { - /* "View.MemoryView":876 - * - * if suboffset_dim[0] < 0: - * dst.data += start * stride # <<<<<<<<<<<<<< + /* "(tree fragment)":11 + * use_setstate = self.name is not None + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<< * else: - * dst.suboffsets[suboffset_dim[0]] += start * stride + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) */ - __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + __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; - /* "View.MemoryView":875 - * - * - * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< - * dst.data += start * stride + /* "(tree fragment)":10 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state * else: */ - goto __pyx_L23; } - /* "View.MemoryView":878 - * dst.data += start * stride + /* "(tree fragment)":13 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state * else: - * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< - * - * if suboffset >= 0: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) */ /*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_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; } - __pyx_L23:; - /* "View.MemoryView":880 - * dst.suboffsets[suboffset_dim[0]] += start * stride - * - * if suboffset >= 0: # <<<<<<<<<<<<<< - * if not is_slice: - * if new_ndim == 0: + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.name,) */ - __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":881 - * - * 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) { + /* 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; +} - /* "View.MemoryView":882 - * if suboffset >= 0: - * if not is_slice: - * if new_ndim == 0: # <<<<<<<<<<<<<< - * dst.data = ( dst.data)[0] + suboffset - * else: +/* "(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) */ - __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":883 - * 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); +/* 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)); - /* "View.MemoryView":882 - * if suboffset >= 0: - * if not is_slice: - * if new_ndim == 0: # <<<<<<<<<<<<<< - * dst.data = ( dst.data)[0] + suboffset - * else: - */ - goto __pyx_L26; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":885 - * dst.data = ( dst.data)[0] + suboffset - * else: - * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< - * "must be indexed and not sliced", dim) - * else: - */ - /*else*/ { +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); - /* "View.MemoryView":886 - * else: - * _err_dim(IndexError, "All dimensions preceding dimension %d " - * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< - * else: - * suboffset_dim[0] = new_ndim + /* "(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) # <<<<<<<<<<<<<< */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 885, __pyx_L1_error) - } - __pyx_L26:; + 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; - /* "View.MemoryView":881 - * - * if suboffset >= 0: - * if not is_slice: # <<<<<<<<<<<<<< - * if new_ndim == 0: - * dst.data = ( dst.data)[0] + suboffset + /* "(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) */ - goto __pyx_L25; - } - /* "View.MemoryView":888 - * "must be indexed and not sliced", dim) - * else: - * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + /* 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":294 * - * return 0 + * @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 */ - /*else*/ { - (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; - } - __pyx_L25:; - /* "View.MemoryView":880 - * dst.suboffsets[suboffset_dim[0]] += start * stride +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":296 + * 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":300 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":302 + * 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":303 + * + * 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":302 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset * - * if suboffset >= 0: # <<<<<<<<<<<<<< - * if not is_slice: - * if new_ndim == 0: */ } - /* "View.MemoryView":890 - * suboffset_dim[0] = new_ndim + /* "View.MemoryView":305 + * aligned_p += alignment - offset * - * return 0 # <<<<<<<<<<<<<< + * return aligned_p # <<<<<<<<<<<<<< * * */ - __pyx_r = 0; + __pyx_r = ((void *)__pyx_v_aligned_p); goto __pyx_L0; - /* "View.MemoryView":793 + /* "View.MemoryView":294 * - * @cname('__pyx_memoryview_slice_memviewslice') - * cdef int slice_memviewslice( # <<<<<<<<<<<<<< - * __Pyx_memviewslice *dst, - * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + * @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_L1_error:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - } - __pyx_r = -1; __pyx_L0:; return __pyx_r; } -/* "View.MemoryView":896 +/* "View.MemoryView":341 + * cdef __Pyx_TypeInfo *typeinfo * - * @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 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags */ -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; +/* 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 - Py_ssize_t __pyx_t_1; + __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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __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, 341, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___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; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("pybuffer_index", 0); + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__cinit__", 0); - /* "View.MemoryView":898 - * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, - * Py_ssize_t dim) except NULL: - * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< - * cdef Py_ssize_t itemsize = view.itemsize - * cdef char *resultp + /* "View.MemoryView":342 + * + * 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_v_suboffset = -1L; + __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":899 - * Py_ssize_t dim) except NULL: - * cdef Py_ssize_t shape, stride, suboffset = -1 - * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< - * cdef char *resultp - * + /* "View.MemoryView":343 + * 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_t_1 = __pyx_v_view->itemsize; - __pyx_v_itemsize = __pyx_t_1; + __pyx_v_self->flags = __pyx_v_flags; - /* "View.MemoryView":902 - * cdef char *resultp - * - * if view.ndim == 0: # <<<<<<<<<<<<<< - * shape = view.len / itemsize - * stride = itemsize + /* "View.MemoryView":344 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: */ - __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); - if (__pyx_t_2) { + __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":903 - * - * if view.ndim == 0: - * shape = view.len / itemsize # <<<<<<<<<<<<<< - * stride = itemsize - * else: + /* "View.MemoryView":345 + * 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 */ - if (unlikely(__pyx_v_itemsize == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(3, 903, __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(3, 903, __pyx_L1_error) - } - __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 345, __pyx_L1_error) - /* "View.MemoryView":904 - * if view.ndim == 0: - * shape = view.len / itemsize - * stride = itemsize # <<<<<<<<<<<<<< - * else: - * shape = view.shape[dim] + /* "View.MemoryView":346 + * 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_v_stride = __pyx_v_itemsize; + __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":902 - * cdef char *resultp + /* "View.MemoryView":347 + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) * - * if view.ndim == 0: # <<<<<<<<<<<<<< - * shape = view.len / itemsize - * stride = itemsize */ - goto __pyx_L3; - } + ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; - /* "View.MemoryView":906 - * stride = itemsize - * else: - * shape = view.shape[dim] # <<<<<<<<<<<<<< - * stride = view.strides[dim] - * if view.suboffsets != NULL: + /* "View.MemoryView":348 + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * global __pyx_memoryview_thread_locks_used */ - /*else*/ { - __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + Py_INCREF(Py_None); - /* "View.MemoryView":907 - * else: - * shape = view.shape[dim] - * stride = view.strides[dim] # <<<<<<<<<<<<<< - * if view.suboffsets != NULL: - * suboffset = view.suboffsets[dim] + /* "View.MemoryView":346 + * 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_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); + } - /* "View.MemoryView":908 - * shape = view.shape[dim] - * stride = view.strides[dim] - * if view.suboffsets != NULL: # <<<<<<<<<<<<<< - * suboffset = view.suboffsets[dim] - * + /* "View.MemoryView":344 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: */ - __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); - if (__pyx_t_2) { + } - /* "View.MemoryView":909 - * stride = view.strides[dim] - * if view.suboffsets != NULL: - * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< + /* "View.MemoryView":351 * - * if index < 0: + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 */ - __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":908 - * shape = view.shape[dim] - * stride = view.strides[dim] - * if view.suboffsets != NULL: # <<<<<<<<<<<<<< - * suboffset = view.suboffsets[dim] + /* "View.MemoryView":352 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":353 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":351 * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 */ - } } - __pyx_L3:; - /* "View.MemoryView":911 - * suboffset = view.suboffsets[dim] - * - * if index < 0: # <<<<<<<<<<<<<< - * index += view.shape[dim] - * if index < 0: + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: */ - __pyx_t_2 = ((__pyx_v_index < 0) != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":912 - * - * if index < 0: - * index += view.shape[dim] # <<<<<<<<<<<<<< - * if index < 0: - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + /* "View.MemoryView":355 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError */ - __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + __pyx_v_self->lock = PyThread_allocate_lock(); - /* "View.MemoryView":913 - * if index < 0: - * index += view.shape[dim] - * if index < 0: # <<<<<<<<<<<<<< - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError * */ - __pyx_t_2 = ((__pyx_v_index < 0) != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":914 - * index += view.shape[dim] - * if index < 0: - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + /* "View.MemoryView":357 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< * - * if index >= shape: + * if flags & PyBUF_FORMAT: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(3, 914, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error) - /* "View.MemoryView":913 - * if index < 0: - * index += view.shape[dim] - * if index < 0: # <<<<<<<<<<<<<< - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError * */ } - /* "View.MemoryView":911 - * suboffset = view.suboffsets[dim] - * - * if index < 0: # <<<<<<<<<<<<<< - * index += view.shape[dim] - * if index < 0: + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: */ } - /* "View.MemoryView":916 - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * - * if index >= shape: # <<<<<<<<<<<<<< - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + /* "View.MemoryView":359 + * raise MemoryError * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: */ - __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":917 - * - * if index >= shape: - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + /* "View.MemoryView":360 * - * resultp = bufp + index * stride + * 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_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 917, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 917, __pyx_L1_error) + __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":916 - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * - * if index >= shape: # <<<<<<<<<<<<<< - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + /* "View.MemoryView":359 + * raise MemoryError * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: */ + goto __pyx_L10; } - /* "View.MemoryView":919 - * 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":920 - * - * 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":921 - * resultp = bufp + index * stride - * if suboffset >= 0: - * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< + /* "View.MemoryView":362 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< * - * return resultp + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( */ - __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; - /* "View.MemoryView":920 - * - * resultp = bufp + index * stride - * if suboffset >= 0: # <<<<<<<<<<<<<< - * resultp = ( resultp)[0] + suboffset + /* "View.MemoryView":364 + * 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":923 - * resultp = ( resultp)[0] + suboffset - * - * return resultp # <<<<<<<<<<<<<< - * + /* "View.MemoryView":366 + * 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_r = __pyx_v_resultp; - goto __pyx_L0; + __pyx_v_self->typeinfo = NULL; - /* "View.MemoryView":896 + /* "View.MemoryView":341 + * cdef __Pyx_TypeInfo *typeinfo * - * @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 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":929 - * - * @cname('__pyx_memslice_transpose') - * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< - * cdef int ndim = memslice.memview.view.ndim +/* "View.MemoryView":368 + * self.typeinfo = NULL * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) */ -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; +/* 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; - int __pyx_v_j; - int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; - Py_ssize_t *__pyx_t_2; - long __pyx_t_3; - Py_ssize_t __pyx_t_4; - Py_ssize_t __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyThread_type_lock __pyx_t_5; + PyThread_type_lock __pyx_t_6; + __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":930 - * @cname('__pyx_memslice_transpose') - * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: - * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< + /* "View.MemoryView":369 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) * - * cdef Py_ssize_t *shape = memslice.shape */ - __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; - __pyx_v_ndim = __pyx_t_1; + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "View.MemoryView":932 - * cdef int ndim = memslice.memview.view.ndim - * - * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< - * cdef Py_ssize_t *strides = memslice.strides + /* "View.MemoryView":370 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< * + * cdef int i */ - __pyx_t_2 = __pyx_v_memslice->shape; - __pyx_v_shape = __pyx_t_2; + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); - /* "View.MemoryView":933 - * - * cdef Py_ssize_t *shape = memslice.shape - * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< + /* "View.MemoryView":369 * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) * */ - __pyx_t_2 = __pyx_v_memslice->strides; - __pyx_v_strides = __pyx_t_2; + } - /* "View.MemoryView":937 + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":375 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":377 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":380 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":379 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; + + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":381 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":383 + * break + * else: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< * - * cdef int i, j - * for i in range(ndim / 2): # <<<<<<<<<<<<<< - * j = ndim - 1 - i - * strides[i], strides[j] = strides[j], strides[i] + * cdef char *get_item_pointer(memoryview self, object index) except NULL: */ - __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); - for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + PyThread_free_lock(__pyx_v_self->lock); + } + __pyx_L6_break:; - /* "View.MemoryView":938 - * 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] + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: */ - __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + } - /* "View.MemoryView":939 - * 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] + /* "View.MemoryView":368 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":385 + * 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 */ - __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); - __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); - (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; - (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; - /* "View.MemoryView":940 - * j = ndim - 1 - i - * strides[i], strides[j] = strides[j], strides[i] - * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< +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":387 + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< * - * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * for dim, idx in enumerate(index): */ - __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); - __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); - (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; - (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); - /* "View.MemoryView":942 - * shape[i], shape[j] = shape[j], shape[i] + /* "View.MemoryView":389 + * cdef char *itemp = self.view.buf * - * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< - * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) * */ - __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); - if (!__pyx_t_7) { + __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, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L6_bool_binop_done; + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 389, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); - __pyx_t_6 = __pyx_t_7; - __pyx_L6_bool_binop_done:; - if (__pyx_t_6) { + __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":943 + /* "View.MemoryView":390 * - * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: - * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< * - * return 1 + * return itemp */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 943, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; - /* "View.MemoryView":942 - * shape[i], shape[j] = shape[j], shape[i] + /* "View.MemoryView":389 + * cdef char *itemp = self.view.buf * - * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< - * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * 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":945 - * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + /* "View.MemoryView":392 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) * - * return 1 # <<<<<<<<<<<<<< + * return itemp # <<<<<<<<<<<<<< * * */ - __pyx_r = 1; + __pyx_r = __pyx_v_itemp; goto __pyx_L0; - /* "View.MemoryView":929 - * - * @cname('__pyx_memslice_transpose') - * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< - * cdef int ndim = memslice.memview.view.ndim + /* "View.MemoryView":385 + * 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:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - } - __pyx_r = 0; + __Pyx_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":962 - * cdef int (*to_dtype_func)(char *, object) except 0 +/* "View.MemoryView":395 * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self */ /* Python wrapper */ -static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { +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("__dealloc__ (wrapper)", 0); - __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + __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 void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { +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 - __Pyx_RefNannySetupContext("__dealloc__", 0); + 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":963 + /* "View.MemoryView":396 * - * def __dealloc__(self): - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self * - * cdef convert_item_to_object(self, char *itemp): */ - __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); - - /* "View.MemoryView":962 - * cdef int (*to_dtype_func)(char *, object) except 0 - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":397 + * 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; - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "View.MemoryView":965 - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + /* "View.MemoryView":396 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self * - * 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":399 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 399, __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, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; - /* "View.MemoryView":966 + /* "View.MemoryView":402 * - * cdef convert_item_to_object(self, char *itemp): - * if self.to_object_func != NULL: # <<<<<<<<<<<<<< - * return self.to_object_func(itemp) + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) * else: */ - __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); - if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 402, __pyx_L1_error) + if (__pyx_t_2) { - /* "View.MemoryView":967 - * cdef convert_item_to_object(self, char *itemp): - * if self.to_object_func != NULL: - * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + /* "View.MemoryView":403 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< * else: - * return memoryview.convert_item_to_object(self, itemp) + * itemp = self.get_item_pointer(indices) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 967, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":966 + /* "View.MemoryView":402 * - * cdef convert_item_to_object(self, char *itemp): - * if self.to_object_func != NULL: # <<<<<<<<<<<<<< - * return self.to_object_func(itemp) + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) * else: */ } - /* "View.MemoryView":969 - * return self.to_object_func(itemp) + /* "View.MemoryView":405 + * return memview_slice(self, indices) * else: - * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< + * return self.convert_item_to_object(itemp) * - * cdef assign_item_from_object(self, char *itemp, object value): */ /*else*/ { + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 405, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":406 + * 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_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; } - /* "View.MemoryView":965 - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + /* "View.MemoryView":395 * - * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< - * if self.to_object_func != NULL: - * return self.to_object_func(itemp) + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self */ /* 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_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":971 - * return memoryview.convert_item_to_object(self, itemp) +/* "View.MemoryView":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) * - * 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; +/* 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 - int __pyx_t_1; - int __pyx_t_2; + __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 + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("assign_item_from_object", 0); + int __pyx_t_4; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); - /* "View.MemoryView":972 + /* "View.MemoryView":409 * - * cdef assign_item_from_object(self, char *itemp, object value): - * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< - * self.to_dtype_func(itemp, value) - * else: + * def __setitem__(memoryview self, object index, object value): + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: */ - __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); - if (__pyx_t_1) { + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 409, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; - /* "View.MemoryView":973 - * cdef assign_item_from_object(self, char *itemp, object value): - * if self.to_dtype_func != NULL: - * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< - * else: - * memoryview.assign_item_from_object(self, itemp, value) + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(3, 973, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error) + if (__pyx_t_4) { - /* "View.MemoryView":972 + /* "View.MemoryView":412 * - * cdef assign_item_from_object(self, char *itemp, object value): - * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< - * self.to_dtype_func(itemp, value) + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_obj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":414 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":416 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: */ goto __pyx_L3; } - /* "View.MemoryView":975 - * self.to_dtype_func(itemp, value) + /* "View.MemoryView":418 + * self.setitem_slice_assign_scalar(self[index], value) * else: - * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< * - * @property + * cdef is_slice(self, obj): */ /*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(3, 975, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; - /* "View.MemoryView":971 - * return memoryview.convert_item_to_object(self, itemp) + /* "View.MemoryView":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) * - * 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); + __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":978 - * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.from_object +/* "View.MemoryView":420 + * self.setitem_indexed(index, value) * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: */ -/* 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) { +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); + 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":979 - * @property - * def base(self): - * return self.from_object # <<<<<<<<<<<<<< + /* "View.MemoryView":421 * - * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->from_object); - __pyx_r = __pyx_v_self->from_object; - goto __pyx_L0; + __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":978 - * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.from_object - * + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) */ + { + __Pyx_PyThreadState_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:*/ { - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "View.MemoryView":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); -/* "View.MemoryView":985 - * - * @cname('__pyx_memoryview_fromslice') - * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< - * int ndim, - * object (*to_object_func)(char *), + /* "View.MemoryView":424 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); -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":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __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, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; - /* "View.MemoryView":993 - * cdef _memoryviewslice result - * - * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< - * return None - * + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) */ - __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); - if (__pyx_t_1) { + } + __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_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":994 - * - * if memviewslice.memview == Py_None: - * return None # <<<<<<<<<<<<<< - * + /* "View.MemoryView":425 + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None * */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + __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, 425, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); - /* "View.MemoryView":993 - * cdef _memoryviewslice result + /* "View.MemoryView":426 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< * - * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< - * return None + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":421 * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, */ } - /* "View.MemoryView":999 - * + /* "View.MemoryView":428 + * return None * - * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * return obj # <<<<<<<<<<<<<< * - * result.from_slice = memviewslice + * cdef setitem_slice_assignment(self, dst, src): */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 999, __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(3, 999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; - /* "View.MemoryView":1001 - * result = _memoryviewslice(None, 0, dtype_is_object) - * - * result.from_slice = memviewslice # <<<<<<<<<<<<<< - * __PYX_INC_MEMVIEW(&memviewslice, 1) + /* "View.MemoryView":420 + * self.setitem_indexed(index, value) * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: */ - __pyx_v_result->from_slice = __pyx_v_memviewslice; - /* "View.MemoryView":1002 - * - * result.from_slice = memviewslice - * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + /* 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":430 + * return obj * - * result.from_object = ( memviewslice.memview).base + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice */ - __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); - /* "View.MemoryView":1004 - * __PYX_INC_MEMVIEW(&memviewslice, 1) - * - * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< - * result.typeinfo = memviewslice.memview.typeinfo +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":434 + * cdef __Pyx_memviewslice src_slice * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1004, __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; + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 434, __pyx_L1_error) - /* "View.MemoryView":1005 + /* "View.MemoryView":435 * - * result.from_object = ( memviewslice.memview).base - * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< + * 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) * - * result.view = memviewslice.memview.view */ - __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; - __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 435, __pyx_L1_error) - /* "View.MemoryView":1007 - * result.typeinfo = memviewslice.memview.typeinfo + /* "View.MemoryView":436 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< * - * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< - * result.view.buf = memviewslice.data - * result.view.ndim = ndim + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): */ - __pyx_t_5 = __pyx_v_memviewslice.memview->view; - __pyx_v_result->__pyx_base.view = __pyx_t_5; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":1008 + /* "View.MemoryView":434 + * cdef __Pyx_memviewslice src_slice * - * result.view = memviewslice.memview.view - * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< - * result.view.ndim = ndim - * (<__pyx_buffer *> &result.view).obj = Py_None + * 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_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 434, __pyx_L1_error) - /* "View.MemoryView":1009 - * 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) + /* "View.MemoryView":430 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice */ - __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; - /* "View.MemoryView":1010 - * result.view.buf = memviewslice.data - * result.view.ndim = ndim - * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< - * Py_INCREF(Py_None) + /* 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":438 + * 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 */ - ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; - /* "View.MemoryView":1011 - * result.view.ndim = ndim - * (<__pyx_buffer *> &result.view).obj = Py_None - * Py_INCREF(Py_None) # <<<<<<<<<<<<<< +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":440 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item * - * result.flags = PyBUF_RECORDS */ - Py_INCREF(Py_None); + __pyx_v_tmp = NULL; - /* "View.MemoryView":1013 - * Py_INCREF(Py_None) - * - * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + /* "View.MemoryView":445 + * cdef __Pyx_memviewslice *dst_slice + * cdef __Pyx_memviewslice tmp_slice + * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< * - * result.view.shape = result.from_slice.shape + * if self.view.itemsize > sizeof(array): */ - __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); - /* "View.MemoryView":1015 - * result.flags = PyBUF_RECORDS - * - * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< - * result.view.strides = result.from_slice.strides + /* "View.MemoryView":447 + * 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_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); + __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1016 - * - * result.view.shape = result.from_slice.shape - * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< - * + /* "View.MemoryView":448 * + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError */ - __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); - /* "View.MemoryView":1019 - * - * - * result.view.suboffsets = NULL # <<<<<<<<<<<<<< - * for suboffset in result.from_slice.suboffsets[:ndim]: - * if suboffset >= 0: + /* "View.MemoryView":449 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp */ - __pyx_v_result->__pyx_base.view.suboffsets = NULL; + __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1020 - * - * result.view.suboffsets = NULL - * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< - * if suboffset >= 0: - * result.view.suboffsets = result.from_slice.suboffsets + /* "View.MemoryView":450 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: */ - __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]); + PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error) - /* "View.MemoryView":1021 - * result.view.suboffsets = NULL - * for suboffset in result.from_slice.suboffsets[:ndim]: - * if suboffset >= 0: # <<<<<<<<<<<<<< - * result.view.suboffsets = result.from_slice.suboffsets - * break + /* "View.MemoryView":449 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp */ - __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); - if (__pyx_t_1) { + } - /* "View.MemoryView":1022 - * for suboffset in result.from_slice.suboffsets[:ndim]: - * if suboffset >= 0: - * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< - * break - * + /* "View.MemoryView":451 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array */ - __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + __pyx_v_item = __pyx_v_tmp; - /* "View.MemoryView":1023 - * if suboffset >= 0: - * result.view.suboffsets = result.from_slice.suboffsets - * break # <<<<<<<<<<<<<< + /* "View.MemoryView":447 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) * - * result.view.len = result.view.itemsize + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: */ - goto __pyx_L5_break; + goto __pyx_L3; + } - /* "View.MemoryView":1021 - * result.view.suboffsets = NULL - * for suboffset in result.from_slice.suboffsets[:ndim]: - * if suboffset >= 0: # <<<<<<<<<<<<<< - * result.view.suboffsets = result.from_slice.suboffsets - * break + /* "View.MemoryView":453 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: */ - } + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); } - __pyx_L5_break:; + __pyx_L3:; - /* "View.MemoryView":1025 - * break + /* "View.MemoryView":455 + * item = array * - * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< - * for length in result.view.shape[:ndim]: - * result.view.len *= length + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value */ - __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; - __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + /*try:*/ { - /* "View.MemoryView":1026 - * - * result.view.len = result.view.itemsize - * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< - * result.view.len *= length + /* "View.MemoryView":456 * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: */ - __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(3, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1027 - * result.view.len = result.view.itemsize - * for length in result.view.shape[:ndim]: - * result.view.len *= length # <<<<<<<<<<<<<< - * - * result.to_object_func = to_object_func + /* "View.MemoryView":457 + * try: + * if self.dtype_is_object: + * ( item)[0] = value # <<<<<<<<<<<<<< + * else: + * self.assign_item_from_object( item, value) */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1027, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result->__pyx_base.view.len = __pyx_t_9; - } + (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); - /* "View.MemoryView":1029 - * result.view.len *= length - * - * result.to_object_func = to_object_func # <<<<<<<<<<<<<< - * result.to_dtype_func = to_dtype_func + /* "View.MemoryView":456 * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: */ - __pyx_v_result->to_object_func = __pyx_v_to_object_func; + goto __pyx_L8; + } - /* "View.MemoryView":1030 + /* "View.MemoryView":459 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< * - * 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; + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 459, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; - /* "View.MemoryView":1032 - * result.to_dtype_func = to_dtype_func + /* "View.MemoryView":463 * - * return result # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_get_slice_from_memoryview') + * 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_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); - goto __pyx_L0; + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":985 + /* "View.MemoryView":464 * - * @cname('__pyx_memoryview_fromslice') - * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< - * int ndim, - * object (*to_object_func)(char *), + * 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, 464, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* 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":1035 + /* "View.MemoryView":463 * - * @cname('__pyx_memoryview_get_slice_from_memoryview') - * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *mslice): - * cdef _memoryviewslice obj + * + * 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, */ + } -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":1038 - * __Pyx_memviewslice *mslice): - * cdef _memoryviewslice obj - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * obj = memview - * return &obj.from_slice - */ - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "View.MemoryView":1039 - * cdef _memoryviewslice obj - * if isinstance(memview, _memoryviewslice): - * obj = memview # <<<<<<<<<<<<<< - * return &obj.from_slice - * else: - */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(3, 1039, __pyx_L1_error) - __pyx_t_3 = ((PyObject *)__pyx_v_memview); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "View.MemoryView":1040 - * 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":1038 - * __Pyx_memviewslice *mslice): - * cdef _memoryviewslice obj - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * obj = memview - * return &obj.from_slice + /* "View.MemoryView":465 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * 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":1042 - * return &obj.from_slice - * else: - * slice_copy(memview, mslice) # <<<<<<<<<<<<<< - * return mslice - * - */ - /*else*/ { - __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); - - /* "View.MemoryView":1043 - * else: - * slice_copy(memview, mslice) - * return mslice # <<<<<<<<<<<<<< + /* "View.MemoryView":468 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_slice_copy') + * cdef setitem_indexed(self, index, value): */ - __pyx_r = __pyx_v_mslice; - goto __pyx_L0; + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __pyx_L6_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __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); + } + __Pyx_PyThreadState_assign + 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":1035 + /* "View.MemoryView":438 + * src.ndim, dst.ndim, self.dtype_is_object) * - * @cname('__pyx_memoryview_get_slice_from_memoryview') - * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *mslice): - * cdef _memoryviewslice obj + * 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_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":1046 +/* "View.MemoryView":470 + * PyMem_Free(tmp) * - * @cname('__pyx_memoryview_slice_copy') - * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< - * cdef int dim - * cdef (Py_ssize_t*) shape, strides, suboffsets + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) */ -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; +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 - Py_ssize_t *__pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - __Pyx_RefNannySetupContext("slice_copy", 0); + char *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("setitem_indexed", 0); - /* "View.MemoryView":1050 - * cdef (Py_ssize_t*) shape, strides, suboffsets + /* "View.MemoryView":471 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) * - * 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; + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 471, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; - /* "View.MemoryView":1051 - * - * shape = memview.view.shape - * strides = memview.view.strides # <<<<<<<<<<<<<< - * suboffsets = memview.view.suboffsets + /* "View.MemoryView":472 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< * + * cdef convert_item_to_object(self, char *itemp): */ - __pyx_t_1 = __pyx_v_memview->view.strides; - __pyx_v_strides = __pyx_t_1; + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":1052 - * shape = memview.view.shape - * strides = memview.view.strides - * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + /* "View.MemoryView":470 + * PyMem_Free(tmp) * - * dst.memview = <__pyx_memoryview *> memview + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) */ - __pyx_t_1 = __pyx_v_memview->view.suboffsets; - __pyx_v_suboffsets = __pyx_t_1; - /* "View.MemoryView":1054 - * suboffsets = memview.view.suboffsets - * - * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< - * dst.data = memview.view.buf + /* 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":474 + * 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""" */ - __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); - /* "View.MemoryView":1055 - * - * dst.memview = <__pyx_memoryview *> memview - * dst.data = memview.view.buf # <<<<<<<<<<<<<< +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":477 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem * - * for dim in range(memview.view.ndim): */ - __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; - /* "View.MemoryView":1057 - * dst.data = memview.view.buf + /* "View.MemoryView":480 + * cdef bytes bytesitem * - * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< - * dst.shape[dim] = shape[dim] - * dst.strides[dim] = strides[dim] + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) */ - __pyx_t_2 = __pyx_v_memview->view.ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_dim = __pyx_t_3; + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "View.MemoryView":1058 + /* "View.MemoryView":481 * - * 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 + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: */ - (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + { + __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":1059 - * 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 - * + /* "View.MemoryView":482 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") */ - (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __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, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; - /* "View.MemoryView":1060 - * dst.shape[dim] = shape[dim] - * dst.strides[dim] = strides[dim] - * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< + /* "View.MemoryView":481 * - * @cname('__pyx_memoryview_copy_object') + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: */ - if ((__pyx_v_suboffsets != 0)) { - __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]); - } else { - __pyx_t_4 = -1L; } - (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4; - } - /* "View.MemoryView":1046 + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":487 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result * - * @cname('__pyx_memoryview_slice_copy') - * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< - * cdef int dim - * cdef (Py_ssize_t*) shape, strides, suboffsets */ + __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, 487, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } -/* "View.MemoryView":1063 + /* "View.MemoryView":488 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_copy_object') - * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< - * "Create a new memoryview object" - * cdef __Pyx_memviewslice memviewslice + * 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_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; -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":483 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); - /* "View.MemoryView":1066 - * "Create a new memoryview object" - * cdef __Pyx_memviewslice memviewslice - * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< - * return memoryview_copy_from_slice(memview, &memviewslice) - * + /* "View.MemoryView":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: */ - __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(2, 484, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "View.MemoryView":1067 - * cdef __Pyx_memviewslice memviewslice - * slice_copy(memview, &memviewslice) - * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + /* "View.MemoryView":481 * - * @cname('__pyx_memoryview_copy_object_from_slice') + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: */ - __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(3, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } - /* "View.MemoryView":1063 + /* "View.MemoryView":474 + * self.assign_item_from_object(itemp, value) * - * @cname('__pyx_memoryview_copy_object') - * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< - * "Create a new memoryview object" - * cdef __Pyx_memviewslice memviewslice + * 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_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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":1070 +/* "View.MemoryView":490 + * return result * - * @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. + * 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_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 *); +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 - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; int __pyx_t_2; - PyObject *(*__pyx_t_3)(char *); - int (*__pyx_t_4)(char *, PyObject *); + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + 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":1077 - * cdef int (*to_dtype_func)(char *, object) except 0 - * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * to_object_func = (<_memoryviewslice> memview).to_object_func - * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + /* "View.MemoryView":493 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; - /* "View.MemoryView":1078 + /* "View.MemoryView":498 + * cdef Py_ssize_t i * - * if isinstance(memview, _memoryviewslice): - * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< - * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func - * else: + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: */ - __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; - __pyx_v_to_object_func = __pyx_t_3; + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { - /* "View.MemoryView":1079 - * 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 + /* "View.MemoryView":499 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) */ - __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; - __pyx_v_to_dtype_func = __pyx_t_4; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __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 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* "View.MemoryView":1077 - * cdef int (*to_dtype_func)(char *, object) except 0 + /* "View.MemoryView":498 + * cdef Py_ssize_t i * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * to_object_func = (<_memoryviewslice> memview).to_object_func - * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: */ goto __pyx_L3; } - /* "View.MemoryView":1081 - * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func - * else: - * to_object_func = NULL # <<<<<<<<<<<<<< - * to_dtype_func = NULL + /* "View.MemoryView":501 + * bytesvalue = struct.pack(self.view.format, *value) + * else: + * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< * + * for i, c in enumerate(bytesvalue): */ /*else*/ { - __pyx_v_to_object_func = NULL; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __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, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __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, 501, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; - /* "View.MemoryView":1082 - * else: - * to_object_func = NULL - * to_dtype_func = NULL # <<<<<<<<<<<<<< + /* "View.MemoryView":503 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c * - * return memoryview_fromslice(memviewslice[0], memview.view.ndim, */ - __pyx_v_to_dtype_func = NULL; + __pyx_t_9 = 0; + if (unlikely(__pyx_v_bytesvalue == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + __PYX_ERR(2, 503, __pyx_L1_error) } - __pyx_L3:; + __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":1084 - * to_dtype_func = NULL + /* "View.MemoryView":504 * - * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< - * to_object_func, to_dtype_func, - * memview.dtype_is_object) + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') */ - __Pyx_XDECREF(__pyx_r); + __pyx_v_i = __pyx_t_9; - /* "View.MemoryView":1086 - * return memoryview_fromslice(memviewslice[0], memview.view.ndim, - * to_object_func, to_dtype_func, - * memview.dtype_is_object) # <<<<<<<<<<<<<< + /* "View.MemoryView":503 + * bytesvalue = struct.pack(self.view.format, value) * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c * */ - __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(3, 1084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; + __pyx_t_9 = (__pyx_t_9 + 1); - /* "View.MemoryView":1070 + /* "View.MemoryView":504 * - * @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. + * 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":490 + * 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_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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":1092 - * +/* "View.MemoryView":507 * - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< - * if arg < 0: - * return -arg + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape */ -static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { - Py_ssize_t __pyx_r; +/* 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; + Py_ssize_t *__pyx_t_2; + char *__pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "View.MemoryView":1093 - * - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: - * if arg < 0: # <<<<<<<<<<<<<< - * return -arg - * else: + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: */ - __pyx_t_1 = ((__pyx_v_arg < 0) != 0); + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1094 - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: - * if arg < 0: - * return -arg # <<<<<<<<<<<<<< - * else: - * return arg + /* "View.MemoryView":509 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL */ - __pyx_r = (-__pyx_v_arg); - goto __pyx_L0; + __pyx_t_2 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_2; - /* "View.MemoryView":1093 - * - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: - * if arg < 0: # <<<<<<<<<<<<<< - * return -arg - * else: + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: */ + goto __pyx_L3; } - /* "View.MemoryView":1096 - * return -arg - * else: - * return arg # <<<<<<<<<<<<<< + /* "View.MemoryView":511 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< * - * @cname('__pyx_get_best_slice_order') + * if flags & PyBUF_STRIDES: */ /*else*/ { - __pyx_r = __pyx_v_arg; - goto __pyx_L0; + __pyx_v_info->shape = NULL; } + __pyx_L3:; - /* "View.MemoryView":1092 - * + /* "View.MemoryView":513 + * info.shape = NULL * - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< - * if arg < 0: - * return -arg + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "View.MemoryView":514 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_2 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_2; -/* "View.MemoryView":1099 + /* "View.MemoryView":513 + * info.shape = NULL * - * @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. + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: */ + goto __pyx_L4; + } -static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { - int __pyx_v_i; - Py_ssize_t __pyx_v_c_stride; - Py_ssize_t __pyx_v_f_stride; - char __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; + /* "View.MemoryView":516 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L4:; - /* "View.MemoryView":1104 - * """ - * cdef int i - * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< - * cdef Py_ssize_t f_stride = 0 + /* "View.MemoryView":518 + * info.strides = NULL * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: */ - __pyx_v_c_stride = 0; + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1105 - * cdef int i - * cdef Py_ssize_t c_stride = 0 - * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< + /* "View.MemoryView":519 * - * for i in range(ndim - 1, -1, -1): + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL */ - __pyx_v_f_stride = 0; + __pyx_t_2 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_2; - /* "View.MemoryView":1107 - * cdef Py_ssize_t f_stride = 0 + /* "View.MemoryView":518 + * info.strides = NULL * - * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< - * if mslice.shape[i] > 1: - * c_stride = mslice.strides[i] + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: */ - for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { - __pyx_v_i = __pyx_t_1; + goto __pyx_L5; + } - /* "View.MemoryView":1108 + /* "View.MemoryView":521 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< * - * for i in range(ndim - 1, -1, -1): - * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< - * c_stride = mslice.strides[i] - * break + * if flags & PyBUF_FORMAT: */ - __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); - if (__pyx_t_2) { + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L5:; - /* "View.MemoryView":1109 - * for i in range(ndim - 1, -1, -1): - * if mslice.shape[i] > 1: - * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< - * break + /* "View.MemoryView":523 + * info.suboffsets = NULL * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: */ - __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1110 - * if mslice.shape[i] > 1: - * c_stride = mslice.strides[i] - * break # <<<<<<<<<<<<<< + /* "View.MemoryView":524 * - * for i in range(ndim): + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL */ - goto __pyx_L4_break; + __pyx_t_3 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_3; - /* "View.MemoryView":1108 + /* "View.MemoryView":523 + * info.suboffsets = NULL * - * for i in range(ndim - 1, -1, -1): - * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< - * c_stride = mslice.strides[i] - * break + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: */ - } + goto __pyx_L6; } - __pyx_L4_break:; - /* "View.MemoryView":1112 - * break + /* "View.MemoryView":526 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< * - * for i in range(ndim): # <<<<<<<<<<<<<< - * if mslice.shape[i] > 1: - * f_stride = mslice.strides[i] + * info.buf = self.view.buf */ - __pyx_t_1 = __pyx_v_ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L6:; - /* "View.MemoryView":1113 + /* "View.MemoryView":528 + * info.format = NULL * - * for i in range(ndim): - * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< - * f_stride = mslice.strides[i] - * break + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize */ - __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); - if (__pyx_t_2) { + __pyx_t_4 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_4; - /* "View.MemoryView":1114 - * for i in range(ndim): - * if mslice.shape[i] > 1: - * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< - * break + /* "View.MemoryView":529 * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len */ - __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + __pyx_t_5 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_5; - /* "View.MemoryView":1115 - * if mslice.shape[i] > 1: - * f_stride = mslice.strides[i] - * break # <<<<<<<<<<<<<< - * - * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + /* "View.MemoryView":530 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = 0 */ - goto __pyx_L7_break; + __pyx_t_6 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_6; - /* "View.MemoryView":1113 - * - * for i in range(ndim): - * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< - * f_stride = mslice.strides[i] - * break + /* "View.MemoryView":531 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.obj = self */ - } - } - __pyx_L7_break:; + __pyx_t_6 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_6; - /* "View.MemoryView":1117 - * break + /* "View.MemoryView":532 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.obj = self * - * 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) { + __pyx_v_info->readonly = 0; - /* "View.MemoryView":1118 + /* "View.MemoryView":533 + * info.len = self.view.len + * info.readonly = 0 + * info.obj = self # <<<<<<<<<<<<<< * - * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): - * return 'C' # <<<<<<<<<<<<<< - * else: - * return 'F' + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ - __pyx_r = 'C'; - goto __pyx_L0; + __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":1117 - * break + /* "View.MemoryView":507 * - * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< - * return 'C' - * else: + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape */ - } - /* "View.MemoryView":1120 - * return 'C' - * else: - * return 'F' # <<<<<<<<<<<<<< - * - * @cython.cdivision(True) - */ - /*else*/ { - __pyx_r = 'F'; - goto __pyx_L0; + /* function exit code */ + __pyx_r = 0; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1099 +/* "View.MemoryView":539 * - * @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. + * @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_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":1123 - * - * @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; +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; int __pyx_t_2; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - Py_ssize_t __pyx_t_5; - - /* "View.MemoryView":1130 - * - * 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":1131 - * 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]); + __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":1132 - * cdef Py_ssize_t src_extent = src_shape[0] - * cdef Py_ssize_t dst_extent = dst_shape[0] - * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t dst_stride = dst_strides[0] - * + /* "View.MemoryView":540 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result */ - __pyx_v_src_stride = (__pyx_v_src_strides[0]); + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; - /* "View.MemoryView":1133 - * cdef Py_ssize_t dst_extent = dst_shape[0] - * cdef Py_ssize_t src_stride = src_strides[0] - * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + /* "View.MemoryView":541 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result * - * if ndim == 1: */ - __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error) - /* "View.MemoryView":1135 - * cdef Py_ssize_t dst_stride = dst_strides[0] + /* "View.MemoryView":542 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< * - * if ndim == 1: # <<<<<<<<<<<<<< - * if (src_stride > 0 and dst_stride > 0 and - * src_stride == itemsize == dst_stride): + * @property */ - __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); - if (__pyx_t_1) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; - /* "View.MemoryView":1136 + /* "View.MemoryView":539 * - * 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) + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) */ - __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":1137 - * 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:; + /* 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":1136 +/* "View.MemoryView":545 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj * - * 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":1138 - * 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): - */ - memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); +/* 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)); - /* "View.MemoryView":1136 - * - * 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; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1140 - * memcpy(dst_data, src_data, itemsize * dst_extent) - * else: - * for i in range(dst_extent): # <<<<<<<<<<<<<< - * memcpy(dst_data, src_data, itemsize) - * src_data += src_stride - */ - /*else*/ { - __pyx_t_4 = __pyx_v_dst_extent; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; +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":1141 - * else: - * for i in range(dst_extent): - * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< - * src_data += src_stride - * dst_data += dst_stride + /* "View.MemoryView":546 + * @property + * def base(self): + * return self.obj # <<<<<<<<<<<<<< + * + * @property */ - memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; - /* "View.MemoryView":1142 - * for i in range(dst_extent): - * memcpy(dst_data, src_data, itemsize) - * src_data += src_stride # <<<<<<<<<<<<<< - * dst_data += dst_stride - * else: + /* "View.MemoryView":545 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * */ - __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); - /* "View.MemoryView":1143 - * 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:; + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1135 - * cdef Py_ssize_t dst_stride = dst_strides[0] +/* "View.MemoryView":549 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) * - * if ndim == 1: # <<<<<<<<<<<<<< - * if (src_stride > 0 and dst_stride > 0 and - * src_stride == itemsize == dst_stride): */ - goto __pyx_L3; - } - /* "View.MemoryView":1145 - * dst_data += dst_stride - * else: - * for i in range(dst_extent): # <<<<<<<<<<<<<< - * _copy_strided_to_strided(src_data, src_strides + 1, - * dst_data, dst_strides + 1, - */ - /*else*/ { - __pyx_t_4 = __pyx_v_dst_extent; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; +/* 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)); - /* "View.MemoryView":1146 - * 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); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1150 - * 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); +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":1151 - * ndim - 1, itemsize) - * src_data += src_stride - * dst_data += dst_stride # <<<<<<<<<<<<<< + /* "View.MemoryView":550 + * @property + * def shape(self): + * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< * - * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + * @property */ - __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_length = (__pyx_t_2[0]); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_L3:; + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; - /* "View.MemoryView":1123 + /* "View.MemoryView":549 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) * - * @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 */ + __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":1153 - * dst_data += dst_stride +/* "View.MemoryView":553 * - * 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":1156 - * __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) + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: * */ - _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":1153 - * dst_data += dst_stride - * - * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *dst, - * int ndim, size_t itemsize) nogil: - */ +/* 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; } -/* "View.MemoryView":1160 - * - * @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; +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":1163 - * "Return the size of the memory occupied by the slice in number of bytes" - * cdef int i - * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + /* "View.MemoryView":554 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< * - * for i in range(ndim): + * raise ValueError("Buffer view does not expose strides") */ - __pyx_t_1 = __pyx_v_src->memview->view.itemsize; - __pyx_v_size = __pyx_t_1; + __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1165 - * cdef Py_ssize_t size = src.memview.view.itemsize + /* "View.MemoryView":556 + * if self.view.strides == NULL: * - * for i in range(ndim): # <<<<<<<<<<<<<< - * size *= src.shape[i] + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< * + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __pyx_v_ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 556, __pyx_L1_error) - /* "View.MemoryView":1166 - * - * for i in range(ndim): - * size *= src.shape[i] # <<<<<<<<<<<<<< + /* "View.MemoryView":554 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< * - * return size + * raise ValueError("Buffer view does not expose strides") */ - __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i])); } - /* "View.MemoryView":1168 - * size *= src.shape[i] + /* "View.MemoryView":558 + * raise ValueError("Buffer view does not expose strides") * - * return size # <<<<<<<<<<<<<< + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< * - * @cname('__pyx_fill_contig_strides_array') + * @property */ - __pyx_r = __pyx_v_size; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_v_stride = (__pyx_t_3[0]); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; goto __pyx_L0; - /* "View.MemoryView":1160 + /* "View.MemoryView":553 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: * - * @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_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":1171 +/* "View.MemoryView":561 * - * @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: + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim */ -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; +/* 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; - int __pyx_t_2; - int __pyx_t_3; + 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":1180 - * cdef int idx + /* "View.MemoryView":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim * - * if order == 'F': # <<<<<<<<<<<<<< - * for idx in range(ndim): - * strides[idx] = stride */ - __pyx_t_1 = ((__pyx_v_order == 'F') != 0); + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1181 + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< * - * if order == 'F': - * for idx in range(ndim): # <<<<<<<<<<<<<< - * strides[idx] = stride - * stride = stride * shape[idx] - */ - __pyx_t_2 = __pyx_v_ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_idx = __pyx_t_3; - - /* "View.MemoryView":1182 - * 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":1183 - * for idx in range(ndim): - * strides[idx] = stride - * stride = stride * shape[idx] # <<<<<<<<<<<<<< - * else: - * for idx in range(ndim - 1, -1, -1): + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__117, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "View.MemoryView":1180 - * cdef int idx + /* "View.MemoryView":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim * - * if order == 'F': # <<<<<<<<<<<<<< - * for idx in range(ndim): - * strides[idx] = stride */ - goto __pyx_L3; } - /* "View.MemoryView":1185 - * 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 > -1L; __pyx_t_2-=1) { - __pyx_v_idx = __pyx_t_2; - - /* "View.MemoryView":1186 - * else: - * for idx in range(ndim - 1, -1, -1): - * strides[idx] = stride # <<<<<<<<<<<<<< - * stride = stride * shape[idx] + /* "View.MemoryView":565 + * return (-1,) * self.view.ndim * - */ - (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; - - /* "View.MemoryView":1187 - * for idx in range(ndim - 1, -1, -1): - * strides[idx] = stride - * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< * - * return stride + * @property */ - __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_L3:; - - /* "View.MemoryView":1189 - * stride = stride * shape[idx] - * - * return stride # <<<<<<<<<<<<<< - * - * @cname('__pyx_memoryview_copy_data_to_temp') - */ - __pyx_r = __pyx_v_stride; + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":1171 + /* "View.MemoryView":561 * - * @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: + * @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":1192 +/* "View.MemoryView":568 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim * - * @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; +/* 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)); - /* "View.MemoryView":1203 - * 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; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1204 - * - * 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); +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":1206 - * cdef size_t size = slice_get_size(src, ndim) + /* "View.MemoryView":569 + * @property + * def ndim(self): + * return self.view.ndim # <<<<<<<<<<<<<< * - * result = malloc(size) # <<<<<<<<<<<<<< - * if not result: - * _err(MemoryError, NULL) + * @property */ - __pyx_v_result = malloc(__pyx_v_size); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":1207 + /* "View.MemoryView":568 * - * result = malloc(size) - * if not result: # <<<<<<<<<<<<<< - * _err(MemoryError, NULL) + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim * */ - __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":1208 - * result = malloc(size) - * if not result: - * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + /* 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":572 * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 1208, __pyx_L1_error) - /* "View.MemoryView":1207 - * - * result = malloc(size) - * if not result: # <<<<<<<<<<<<<< - * _err(MemoryError, NULL) +/* 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":573 + * @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, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":1211 + /* "View.MemoryView":572 * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize * - * tmpslice.data = result # <<<<<<<<<<<<<< - * tmpslice.memview = src.memview - * for i in range(ndim): */ - __pyx_v_tmpslice->data = ((char *)__pyx_v_result); - /* "View.MemoryView":1212 + /* 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":576 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize * - * 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":1213 - * 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; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; +/* 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)); - /* "View.MemoryView":1214 - * 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]); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1215 - * for i in range(ndim): - * tmpslice.shape[i] = src.shape[i] - * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< - * - * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, - */ - (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; - } +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":1217 - * tmpslice.suboffsets[i] = -1 - * - * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< - * ndim, order) + /* "View.MemoryView":577 + * @property + * def nbytes(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< * + * @property */ - __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + __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, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "View.MemoryView":1221 + /* "View.MemoryView":576 * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize * - * for i in range(ndim): # <<<<<<<<<<<<<< - * if tmpslice.shape[i] == 1: - * tmpslice.strides[i] = 0 */ - __pyx_t_3 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - /* "View.MemoryView":1222 - * - * for i in range(ndim): - * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< - * tmpslice.strides[i] = 0 + /* 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":580 * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 */ - __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":1223 - * for i in range(ndim): - * if tmpslice.shape[i] == 1: - * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< +/* 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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 * - * if slice_is_contig(src[0], order, ndim): */ - (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1222 + /* "View.MemoryView":582 + * def size(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< * - * for i in range(ndim): - * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< - * tmpslice.strides[i] = 0 + * for length in self.view.shape[:self.view.ndim]: + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; + + /* "View.MemoryView":584 + * 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, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":585 + * + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< * + * self._size = result */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; } + + /* "View.MemoryView":587 + * 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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ } - /* "View.MemoryView":1225 - * tmpslice.strides[i] = 0 + /* "View.MemoryView":589 + * self._size = result * - * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< - * memcpy(result, src.data, size) - * else: + * return self._size # <<<<<<<<<<<<<< + * + * def __len__(self): */ - __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); - if (__pyx_t_2) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; + goto __pyx_L0; - /* "View.MemoryView":1226 + /* "View.MemoryView":580 * - * if slice_is_contig(src[0], order, ndim): - * memcpy(result, src.data, size) # <<<<<<<<<<<<<< - * else: - * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 */ - memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); - /* "View.MemoryView":1225 - * tmpslice.strides[i] = 0 + /* 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":591 + * return self._size * - * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< - * memcpy(result, src.data, size) - * else: + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] */ - goto __pyx_L9; - } - /* "View.MemoryView":1228 - * memcpy(result, src.data, size) - * else: - * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< +/* 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":592 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] * - * return result */ - /*else*/ { - copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); - } - __pyx_L9:; + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1230 - * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + /* "View.MemoryView":593 + * def __len__(self): + * if self.view.ndim >= 1: + * return self.view.shape[0] # <<<<<<<<<<<<<< * - * return result # <<<<<<<<<<<<<< + * return 0 + */ + __pyx_r = (__pyx_v_self->view.shape[0]); + goto __pyx_L0; + + /* "View.MemoryView":592 * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] * */ - __pyx_r = __pyx_v_result; + } + + /* "View.MemoryView":595 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":1192 + /* "View.MemoryView":591 + * return self._size * - * @cname('__pyx_memoryview_copy_data_to_temp') - * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *tmpslice, - * char order, + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] */ /* function exit code */ - __pyx_L1_error:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - } - __pyx_r = NULL; __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":1235 +/* "View.MemoryView":597 + * return 0 * - * @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)" % + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) */ -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; +/* 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; - PyObject *__pyx_t_4 = NULL; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("_err_extents", 0); + __Pyx_RefNannySetupContext("__repr__", 0); - /* "View.MemoryView":1238 - * Py_ssize_t extent2) except -1 with gil: - * raise ValueError("got differing extents in dimension %d (got %d and %d)" % - * (i, extent1, extent2)) # <<<<<<<<<<<<<< + /* "View.MemoryView":598 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) * - * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1238, __pyx_L1_error) + __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, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1238, __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_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, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":1237 - * cdef int _err_extents(int i, Py_ssize_t extent1, - * Py_ssize_t extent2) except -1 with gil: - * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< - * (i, extent1, extent2)) + /* "View.MemoryView":599 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< * + * def __str__(self): */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1237, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":598 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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_3); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 1237, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "View.MemoryView":1235 + /* "View.MemoryView":597 + * return 0 * - * @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)" % + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) */ /* function exit code */ @@ -46664,109 +50815,75 @@ __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_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif return __pyx_r; } -/* "View.MemoryView":1241 +/* "View.MemoryView":601 + * id(self)) * - * @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) + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) * */ -static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { - int __pyx_r; +/* 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; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("_err_dim", 0); - __Pyx_INCREF(__pyx_v_error); + __Pyx_RefNannySetupContext("__str__", 0); - /* "View.MemoryView":1242 - * @cname('__pyx_memoryview_err_dim') - * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: - * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + /* "View.MemoryView":602 + * + * def __str__(self): + * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< + * * - * @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(3, 1242, __pyx_L1_error) + __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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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(3, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_INCREF(__pyx_v_error); - __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; - if (CYTHON_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(3, 1242, __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(3, 1242, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - #endif - { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":1241 + /* "View.MemoryView":601 + * id(self)) * - * @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) + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) * */ @@ -46774,1320 +50891,7788 @@ __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_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif return __pyx_r; } -/* "View.MemoryView":1245 +/* "View.MemoryView":605 * - * @cname('__pyx_memoryview_err') - * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< - * if msg != NULL: - * raise error(msg.decode('ascii')) + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp */ -static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { - int __pyx_r; +/* 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 - 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 = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("_err", 0); - __Pyx_INCREF(__pyx_v_error); + __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)); - /* "View.MemoryView":1246 - * @cname('__pyx_memoryview_err') - * cdef int _err(object error, char *msg) except -1 with gil: - * if msg != NULL: # <<<<<<<<<<<<<< - * raise error(msg.decode('ascii')) - * else: - */ - __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); - if (__pyx_t_1) { + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1247 - * cdef int _err(object error, char *msg) except -1 with gil: - * if msg != NULL: - * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< - * else: - * raise error - */ - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_error); - __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; - if (CYTHON_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(3, 1247, __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(3, 1247, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(3, 1247, __pyx_L1_error) +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":1246 - * @cname('__pyx_memoryview_err') - * cdef int _err(object error, char *msg) except -1 with gil: - * if msg != NULL: # <<<<<<<<<<<<<< - * raise error(msg.decode('ascii')) - * else: + /* "View.MemoryView":608 + * 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":1249 - * raise error(msg.decode('ascii')) - * else: - * raise error # <<<<<<<<<<<<<< + /* "View.MemoryView":609 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_copy_contents') + * def is_f_contig(self): */ - /*else*/ { - __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(3, 1249, __pyx_L1_error) - } + __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, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":1245 + /* "View.MemoryView":605 * - * @cname('__pyx_memoryview_err') - * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< - * if msg != NULL: - * raise error(msg.decode('ascii')) + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp */ /* 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_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(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif return __pyx_r; } -/* "View.MemoryView":1252 +/* "View.MemoryView":611 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) * - * @cname('__pyx_memoryview_copy_contents') - * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice dst, - * int src_ndim, int dst_ndim, - */ - -static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { - void *__pyx_v_tmpdata; - size_t __pyx_v_itemsize; - int __pyx_v_i; - char __pyx_v_order; - int __pyx_v_broadcasting; - int __pyx_v_direct_copy; - __Pyx_memviewslice __pyx_v_tmp; - int __pyx_v_ndim; - int __pyx_r; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - void *__pyx_t_6; - int __pyx_t_7; - - /* "View.MemoryView":1260 - * Check for overlapping memory and verify the shapes. - * """ - * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< - * cdef size_t itemsize = src.memview.view.itemsize - * cdef int i + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp */ - __pyx_v_tmpdata = NULL; - /* "View.MemoryView":1261 - * """ - * 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; +/* 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)); - /* "View.MemoryView":1263 - * 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); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1264 - * 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; +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":1265 - * cdef char order = get_best_order(&src, src_ndim) - * cdef bint broadcasting = False - * cdef bint direct_copy = False # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice tmp + /* "View.MemoryView":614 + * 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_direct_copy = 0; + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); - /* "View.MemoryView":1268 - * cdef __Pyx_memviewslice tmp + /* "View.MemoryView":615 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< * - * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: + * def copy(self): */ - __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); - if (__pyx_t_2) { + __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, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":1269 + /* "View.MemoryView":611 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) * - * if src_ndim < dst_ndim: - * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< - * elif dst_ndim < src_ndim: - * broadcast_leading(&dst, dst_ndim, src_ndim) + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp */ - __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); - /* "View.MemoryView":1268 - * 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":617 + * return slice_is_contig(mslice[0], 'F', self.view.ndim) * - * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS */ - goto __pyx_L3; - } - /* "View.MemoryView":1270 - * if src_ndim < dst_ndim: - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< - * broadcast_leading(&dst, dst_ndim, src_ndim) +/* 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":619 + * def copy(self): + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< * + * slice_copy(self, &mslice) */ - __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); - if (__pyx_t_2) { + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); - /* "View.MemoryView":1271 - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: - * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< + /* "View.MemoryView":621 + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS * - * cdef int ndim = max(src_ndim, dst_ndim) + * slice_copy(self, &mslice) # <<<<<<<<<<<<<< + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, + * self.view.itemsize, */ - __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); - /* "View.MemoryView":1270 - * if src_ndim < dst_ndim: - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< - * broadcast_leading(&dst, dst_ndim, src_ndim) + /* "View.MemoryView":622 * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, */ - } - __pyx_L3:; + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 622, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":1273 - * broadcast_leading(&dst, dst_ndim, src_ndim) + /* "View.MemoryView":627 + * self.dtype_is_object) * - * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< * - * for i in range(ndim): + * def copy_fortran(self): */ - __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; + __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, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "View.MemoryView":1275 - * cdef int ndim = max(src_ndim, dst_ndim) + /* "View.MemoryView":617 + * return slice_is_contig(mslice[0], 'F', self.view.ndim) * - * for i in range(ndim): # <<<<<<<<<<<<<< - * if src.shape[i] != dst.shape[i]: - * if src.shape[i] == 1: + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS */ - __pyx_t_5 = __pyx_v_ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":1276 - * - * 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) { + /* 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":1277 - * for i in range(ndim): - * if src.shape[i] != dst.shape[i]: - * if src.shape[i] == 1: # <<<<<<<<<<<<<< - * broadcasting = True - * src.strides[i] = 0 +/* "View.MemoryView":629 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS */ - __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":1278 - * if src.shape[i] != dst.shape[i]: - * if src.shape[i] == 1: - * broadcasting = True # <<<<<<<<<<<<<< - * src.strides[i] = 0 - * else: - */ - __pyx_v_broadcasting = 1; +/* 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)); - /* "View.MemoryView":1279 - * 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; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1277 - * for i in range(ndim): - * if src.shape[i] != dst.shape[i]: - * if src.shape[i] == 1: # <<<<<<<<<<<<<< - * broadcasting = True - * src.strides[i] = 0 - */ - goto __pyx_L7; - } +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":1281 - * src.strides[i] = 0 - * else: - * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + /* "View.MemoryView":631 + * def copy_fortran(self): + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< * - * if src.suboffsets[i] >= 0: + * slice_copy(self, &src) */ - /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 1281, __pyx_L1_error) - } - __pyx_L7:; + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); - /* "View.MemoryView":1276 + /* "View.MemoryView":633 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS * - * for i in range(ndim): - * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< - * if src.shape[i] == 1: - * broadcasting = True + * 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":1283 - * _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":634 * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, */ - __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); - if (__pyx_t_2) { + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 634, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; - /* "View.MemoryView":1284 + /* "View.MemoryView":639 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< * - * if src.suboffsets[i] >= 0: - * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< * - * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 1284, __pyx_L1_error) + __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, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "View.MemoryView":1283 - * _err_extents(i, dst.shape[i], src.shape[i]) - * - * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< - * _err_dim(ValueError, "Dimension %d is not direct", i) + /* "View.MemoryView":629 + * return memoryview_copy_from_slice(self, &mslice) * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS */ - } - } - /* "View.MemoryView":1286 - * _err_dim(ValueError, "Dimension %d is not direct", i) - * - * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< - * - * if not slice_is_contig(src, order, ndim): - */ - __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); - if (__pyx_t_2) { + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1288 - * if slices_overlap(&src, &dst, ndim, itemsize): - * - * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< - * order = get_best_order(&dst, ndim) - * +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":1289 - * - * 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); +/* 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)); - /* "View.MemoryView":1288 - * if slices_overlap(&src, &dst, ndim, itemsize): - * - * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< - * order = get_best_order(&dst, ndim) - * - */ - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1291 - * order = get_best_order(&dst, ndim) - * - * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< - * src = tmp - * - */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(3, 1291, __pyx_L1_error) - __pyx_v_tmpdata = __pyx_t_6; +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); - /* "View.MemoryView":1292 - * - * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) - * src = tmp # <<<<<<<<<<<<<< - * - * if not broadcasting: + /* "(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_v_src = __pyx_v_tmp; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__118, 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) - /* "View.MemoryView":1286 - * _err_dim(ValueError, "Dimension %d is not direct", i) - * - * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< - * - * if not slice_is_contig(src, order, ndim): + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - } - /* "View.MemoryView":1294 - * src = tmp - * - * if not broadcasting: # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); - if (__pyx_t_2) { + /* 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; +} - /* "View.MemoryView":1297 - * - * - * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): +/* "(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__") */ - __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":1298 - * - * if slice_is_contig(src, 'C', ndim): - * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< - * elif slice_is_contig(src, 'F', ndim): - * direct_copy = slice_is_contig(dst, 'F', ndim) - */ - __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); +/* 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)); - /* "View.MemoryView":1297 - * - * - * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): - */ - goto __pyx_L12; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1299 - * if slice_is_contig(src, 'C', ndim): - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< - * direct_copy = slice_is_contig(dst, 'F', ndim) - * - */ - __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); - if (__pyx_t_2) { +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); - /* "View.MemoryView":1300 - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): - * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< - * - * if direct_copy: + /* "(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_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__119, 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) - /* "View.MemoryView":1299 - * if slice_is_contig(src, 'C', ndim): - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< - * direct_copy = slice_is_contig(dst, 'F', ndim) - * + /* "(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__") */ - } - __pyx_L12:; - /* "View.MemoryView":1302 - * 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) { + /* 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":1304 - * if direct_copy: +/* "View.MemoryView":643 * - * 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) + * @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 */ - __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1305 - * - * refcount_copying(&dst, dtype_is_object, ndim, False) - * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< - * refcount_copying(&dst, dtype_is_object, ndim, True) - * free(tmpdata) - */ - memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); +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":1306 - * refcount_copying(&dst, dtype_is_object, ndim, False) - * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) - * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * free(tmpdata) - * return 0 + /* "View.MemoryView":644 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result */ - __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __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, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; - /* "View.MemoryView":1307 - * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) - * refcount_copying(&dst, dtype_is_object, ndim, True) - * free(tmpdata) # <<<<<<<<<<<<<< - * return 0 + /* "View.MemoryView":645 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result * */ - free(__pyx_v_tmpdata); + __pyx_v_result->typeinfo = __pyx_v_typeinfo; - /* "View.MemoryView":1308 - * refcount_copying(&dst, dtype_is_object, ndim, True) - * free(tmpdata) - * return 0 # <<<<<<<<<<<<<< + /* "View.MemoryView":646 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< * - * if order == 'F' == get_best_order(&dst, ndim): + * @cname('__pyx_memoryview_check') */ - __pyx_r = 0; - goto __pyx_L0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; - /* "View.MemoryView":1302 - * direct_copy = slice_is_contig(dst, 'F', ndim) - * - * if direct_copy: # <<<<<<<<<<<<<< + /* "View.MemoryView":643 * - * refcount_copying(&dst, dtype_is_object, ndim, False) + * @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 */ - } - /* "View.MemoryView":1294 - * src = tmp - * - * if not broadcasting: # <<<<<<<<<<<<<< - * - * - */ - } + /* 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":1310 - * return 0 - * - * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< +/* "View.MemoryView":649 * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) * */ - __pyx_t_2 = (__pyx_v_order == 'F'); - if (__pyx_t_2) { - __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); - } - __pyx_t_7 = (__pyx_t_2 != 0); - if (__pyx_t_7) { - /* "View.MemoryView":1313 - * - * - * transpose_memslice(&src) # <<<<<<<<<<<<<< - * transpose_memslice(&dst) - * - */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(3, 1313, __pyx_L1_error) +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":1314 - * - * transpose_memslice(&src) - * transpose_memslice(&dst) # <<<<<<<<<<<<<< + /* "View.MemoryView":650 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< * - * refcount_copying(&dst, dtype_is_object, ndim, False) + * cdef tuple _unellipsify(object index, int ndim): */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(3, 1314, __pyx_L1_error) + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); + __pyx_r = __pyx_t_1; + goto __pyx_L0; - /* "View.MemoryView":1310 - * return 0 - * - * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + /* "View.MemoryView":649 * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) * */ - } - /* "View.MemoryView":1316 - * 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); + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1317 - * - * refcount_copying(&dst, dtype_is_object, ndim, False) - * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< - * refcount_copying(&dst, dtype_is_object, ndim, True) +/* "View.MemoryView":652 + * return isinstance(o, memoryview) * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with */ - copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); - /* "View.MemoryView":1318 - * refcount_copying(&dst, dtype_is_object, ndim, False) - * copy_strided_to_strided(&src, &dst, ndim, itemsize) - * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * - * free(tmpdata) +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":657 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: */ - __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1320 - * refcount_copying(&dst, dtype_is_object, ndim, True) - * - * free(tmpdata) # <<<<<<<<<<<<<< - * return 0 - * + /* "View.MemoryView":658 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index */ - free(__pyx_v_tmpdata); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __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":1321 - * - * free(tmpdata) - * return 0 # <<<<<<<<<<<<<< - * - * @cname('__pyx_memoryview_broadcast_leading') + /* "View.MemoryView":657 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: */ - __pyx_r = 0; - goto __pyx_L0; + goto __pyx_L3; + } - /* "View.MemoryView":1252 + /* "View.MemoryView":660 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_copy_contents') - * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice dst, - * int src_ndim, int dst_ndim, + * result = [] */ - - /* function exit code */ - __pyx_L1_error:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; } - __pyx_r = -1; - __pyx_L0:; - return __pyx_r; -} + __pyx_L3:; -/* "View.MemoryView":1324 + /* "View.MemoryView":662 + * tup = index * - * @cname('__pyx_memoryview_broadcast_leading') - * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< - * int ndim, - * int ndim_other) nogil: + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; -static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) { - int __pyx_v_i; - int __pyx_v_offset; - int __pyx_t_1; - int __pyx_t_2; - - /* "View.MemoryView":1328 - * int ndim_other) nogil: - * cdef int i - * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< + /* "View.MemoryView":663 * - * for i in range(ndim - 1, -1, -1): + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): */ - __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); + __pyx_v_have_slices = 0; - /* "View.MemoryView":1330 - * 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] + /* "View.MemoryView":664 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: */ - for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { - __pyx_v_i = __pyx_t_1; + __pyx_v_seen_ellipsis = 0; - /* "View.MemoryView":1331 - * - * 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] + /* "View.MemoryView":665 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: */ - (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); + __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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 665, __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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; - /* "View.MemoryView":1332 - * 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] - * + /* "View.MemoryView":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) */ - (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1333 - * mslice.shape[i + offset] = mslice.shape[i] - * mslice.strides[i + offset] = mslice.strides[i] - * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< - * - * for i in range(offset): + /* "View.MemoryView":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True */ - (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); - } + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1335 - * mslice.suboffsets[i + offset] = mslice.suboffsets[i] - * - * for i in range(offset): # <<<<<<<<<<<<<< - * mslice.shape[i] = 1 - * mslice.strides[i] = mslice.strides[0] + /* "View.MemoryView":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: */ - __pyx_t_1 = __pyx_v_offset; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__120); + __Pyx_GIVEREF(__pyx_slice__120); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__120); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":1336 - * - * for i in range(offset): - * mslice.shape[i] = 1 # <<<<<<<<<<<<<< - * mslice.strides[i] = mslice.strides[0] - * mslice.suboffsets[i] = -1 + /* "View.MemoryView":669 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) */ - (__pyx_v_mslice->shape[__pyx_v_i]) = 1; + __pyx_v_seen_ellipsis = 1; - /* "View.MemoryView":1337 - * for i in range(offset): - * mslice.shape[i] = 1 - * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< - * mslice.suboffsets[i] = -1 - * + /* "View.MemoryView":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True */ - (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); + goto __pyx_L7; + } - /* "View.MemoryView":1338 - * mslice.shape[i] = 1 - * mslice.strides[i] = mslice.strides[0] - * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: */ - (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; - } + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__121); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) + } + __pyx_L7:; - /* "View.MemoryView":1324 - * - * @cname('__pyx_memoryview_broadcast_leading') - * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< - * int ndim, - * int ndim_other) nogil: + /* "View.MemoryView":672 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): */ + __pyx_v_have_slices = 1; - /* function exit code */ -} + /* "View.MemoryView":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } -/* "View.MemoryView":1346 - * - * @cname('__pyx_memoryview_refcount_copying') - * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< - * int ndim, bint inc) nogil: + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) * */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { -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":1350 + /* "View.MemoryView":675 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(2, 675, __pyx_L1_error) + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) * - * 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":1351 + /* "View.MemoryView":677 + * raise TypeError("Cannot index with type '%s'" % type(item)) * - * if dtype_is_object: - * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< - * dst.strides, ndim, inc) + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) * */ - __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); + __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":1350 + /* "View.MemoryView":678 * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< * - * if dtype_is_object: # <<<<<<<<<<<<<< - * refcount_objects_in_slice_with_gil(dst.data, dst.shape, - * dst.strides, ndim, inc) + * nslices = ndim - len(result) + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":665 + * 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":1346 - * - * @cname('__pyx_memoryview_refcount_copying') - * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< - * int ndim, bint inc) nogil: + /* "View.MemoryView":680 + * result.append(item) * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); - /* function exit code */ -} + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { -/* "View.MemoryView":1355 + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< * - * @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: + * 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, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__122); + __Pyx_GIVEREF(__pyx_slice__122); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__122); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { - __Pyx_RefNannyDeclarations - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } - /* "View.MemoryView":1358 - * Py_ssize_t *strides, int ndim, - * bint inc) with gil: - * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< + /* "View.MemoryView":684 + * result.extend([slice(None)] * nslices) * - * @cname('__pyx_memoryview_refcount_objects_in_slice') + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): */ - __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); + __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, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L0; - /* "View.MemoryView":1355 + /* "View.MemoryView":652 + * return isinstance(o, memoryview) * - * @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: + * 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(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif + return __pyx_r; } -/* "View.MemoryView":1361 +/* "View.MemoryView":686 + * return have_slices or nslices, tuple(result) * - * @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 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: */ -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; +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; - int __pyx_t_3; - __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + Py_ssize_t *__pyx_t_1; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); - /* "View.MemoryView":1365 - * cdef Py_ssize_t i + /* "View.MemoryView":687 * - * for i in range(shape[0]): # <<<<<<<<<<<<<< - * if ndim == 1: - * if inc: + * 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_1 = (__pyx_v_shape[0]); - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + __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":1366 + /* "View.MemoryView":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") * - * for i in range(shape[0]): - * if ndim == 1: # <<<<<<<<<<<<<< - * if inc: - * Py_INCREF(( data)[0]) - */ - __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); - if (__pyx_t_3) { - - /* "View.MemoryView":1367 - * for i in range(shape[0]): - * if ndim == 1: - * if inc: # <<<<<<<<<<<<<< - * Py_INCREF(( data)[0]) - * else: - */ - __pyx_t_3 = (__pyx_v_inc != 0); - if (__pyx_t_3) { - - /* "View.MemoryView":1368 - * if ndim == 1: - * if inc: - * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< - * else: - * Py_DECREF(( data)[0]) - */ - Py_INCREF((((PyObject **)__pyx_v_data)[0])); - - /* "View.MemoryView":1367 - * for i in range(shape[0]): - * if ndim == 1: - * if inc: # <<<<<<<<<<<<<< - * Py_INCREF(( data)[0]) - * else: */ - goto __pyx_L6; - } + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_4) { - /* "View.MemoryView":1370 - * Py_INCREF(( data)[0]) - * else: - * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< - * else: - * refcount_objects_in_slice(data, shape + 1, strides + 1, + /* "View.MemoryView":689 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * */ - /*else*/ { - Py_DECREF((((PyObject **)__pyx_v_data)[0])); - } - __pyx_L6:; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 689, __pyx_L1_error) - /* "View.MemoryView":1366 + /* "View.MemoryView":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") * - * for i in range(shape[0]): - * if ndim == 1: # <<<<<<<<<<<<<< - * if inc: - * Py_INCREF(( data)[0]) */ - goto __pyx_L5; } + } - /* "View.MemoryView":1372 - * Py_DECREF(( data)[0]) - * else: - * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< - * ndim - 1, inc) + /* "View.MemoryView":686 + * 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: */ - /*else*/ { - /* "View.MemoryView":1373 - * else: - * refcount_objects_in_slice(data, shape + 1, strides + 1, - * ndim - 1, inc) # <<<<<<<<<<<<<< + /* 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":696 * - * data += strides[0] + * @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 */ - __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":1375 - * ndim - 1, inc) +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":697 + * @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":704 * - * data += strides[0] # <<<<<<<<<<<<<< * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< * + * cdef _memoryviewslice memviewsliceobj */ - __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); - } + memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); - /* "View.MemoryView":1361 + /* "View.MemoryView":708 + * cdef _memoryviewslice memviewsliceobj * - * @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 + * 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, 708, __pyx_L1_error) + } + } + #endif - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} + /* "View.MemoryView":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { -/* "View.MemoryView":1381 + /* "View.MemoryView":711 * - * @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: + * 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, 711, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; -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":712 + * 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":1384 - * 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) + /* "View.MemoryView":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice */ - __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + goto __pyx_L3; + } - /* "View.MemoryView":1385 - * bint dtype_is_object) nogil: - * refcount_copying(dst, dtype_is_object, ndim, False) - * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< - * itemsize, item) - * refcount_copying(dst, dtype_is_object, ndim, True) + /* "View.MemoryView":714 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * */ - __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); + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); - /* "View.MemoryView":1387 - * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, - * itemsize, item) - * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + /* "View.MemoryView":715 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< * * */ - __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; - /* "View.MemoryView":1381 + /* "View.MemoryView":721 + * + * + * dst.memview = p_src.memview # <<<<<<<<<<<<<< + * dst.data = p_src.data * - * @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: */ + __pyx_t_4 = __pyx_v_p_src->memview; + __pyx_v_dst.memview = __pyx_t_4; - /* function exit code */ -} - -/* "View.MemoryView":1391 + /* "View.MemoryView":722 + * + * dst.memview = p_src.memview + * dst.data = p_src.data # <<<<<<<<<<<<<< + * * - * @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: */ + __pyx_t_5 = __pyx_v_p_src->data; + __pyx_v_dst.data = __pyx_t_5; -static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { - CYTHON_UNUSED Py_ssize_t __pyx_v_i; - Py_ssize_t __pyx_v_stride; - Py_ssize_t __pyx_v_extent; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - Py_ssize_t __pyx_t_3; + /* "View.MemoryView":727 + * + * + * 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":1395 - * 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] + /* "View.MemoryView":728 * + * 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_stride = (__pyx_v_strides[0]); + __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); - /* "View.MemoryView":1396 - * cdef Py_ssize_t i - * cdef Py_ssize_t stride = strides[0] - * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< + /* "View.MemoryView":732 + * cdef bint have_start, have_stop, have_step * - * if ndim == 1: + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( */ - __pyx_v_extent = (__pyx_v_shape[0]); + __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, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 732, __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":1398 - * cdef Py_ssize_t extent = shape[0] + /* "View.MemoryView":733 * - * if ndim == 1: # <<<<<<<<<<<<<< - * for i in range(extent): - * memcpy(data, item, itemsize) + * 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_1 = ((__pyx_v_ndim == 1) != 0); - if (__pyx_t_1) { + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1399 + /* "View.MemoryView":737 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 737, __pyx_L1_error) + + /* "View.MemoryView":734 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 734, __pyx_L1_error) + + /* "View.MemoryView":733 * - * if ndim == 1: - * for i in range(extent): # <<<<<<<<<<<<<< - * memcpy(data, item, itemsize) - * data += stride + * 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 = __pyx_v_extent; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + goto __pyx_L6; + } - /* "View.MemoryView":1400 - * if ndim == 1: - * for i in range(extent): - * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< - * data += stride - * else: + /* "View.MemoryView":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 */ - memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1401 - * for i in range(extent): - * memcpy(data, item, itemsize) - * data += stride # <<<<<<<<<<<<<< - * else: - * for i in range(extent): + /* "View.MemoryView":741 + * 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_data = (__pyx_v_data + __pyx_v_stride); + (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + + /* "View.MemoryView":742 + * 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":743 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":744 + * 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":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; } - /* "View.MemoryView":1398 - * cdef Py_ssize_t extent = shape[0] + /* "View.MemoryView":746 + * 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, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":747 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 * - * if ndim == 1: # <<<<<<<<<<<<<< - * for i in range(extent): - * memcpy(data, item, itemsize) */ - goto __pyx_L3; - } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; - /* "View.MemoryView":1403 - * data += stride - * else: - * for i in range(extent): # <<<<<<<<<<<<<< - * _slice_assign_scalar(data, shape + 1, strides + 1, - * ndim - 1, itemsize, item) + /* "View.MemoryView":748 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None */ - /*else*/ { - __pyx_t_2 = __pyx_v_extent; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; - /* "View.MemoryView":1404 - * else: - * for i in range(extent): - * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< - * ndim - 1, itemsize, item) - * data += stride + /* "View.MemoryView":750 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None */ - __pyx_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); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; - /* "View.MemoryView":1406 - * _slice_assign_scalar(data, shape + 1, strides + 1, - * ndim - 1, itemsize, item) - * data += stride # <<<<<<<<<<<<<< + /* "View.MemoryView":751 * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None * */ - __pyx_v_data = (__pyx_v_data + __pyx_v_stride); - } - } - __pyx_L3:; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; - /* "View.MemoryView":1391 + /* "View.MemoryView":752 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< * - * @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: + * slice_memviewslice( */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; - /* function exit code */ -} -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_vtable_2yt_8geometry_18selection_routines_SelectorObject; + /* "View.MemoryView":754 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 754, __pyx_L1_error) -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *p; - PyObject *o; + /* "View.MemoryView":760 + * 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":732 + * 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":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":763 + * + * 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":764 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) } + + /* "View.MemoryView":765 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) } + + /* "View.MemoryView":763 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":769 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":696 + * + * @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":793 + * + * @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":813 + * 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":815 + * 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":816 + * + * 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":815 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_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":818 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 818, __pyx_L1_error) + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":813 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":821 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __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":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_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":824 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error) + + /* "View.MemoryView":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + } + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":828 + * + * 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":829 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":830 + * 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":831 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":830 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":828 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":832 + * 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":833 + * 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":834 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":833 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":836 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":832 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":839 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":841 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":844 + * + * 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":845 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":846 + * 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":847 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":846 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":844 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":848 + * 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":849 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":848 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":852 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":854 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":857 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":861 + * + * 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":863 + * 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":864 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":863 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":866 + * 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":867 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":866 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":870 + * + * + * 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":871 + * + * 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":872 + * 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":875 + * + * + * 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":876 + * + * 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":875 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":878 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":880 + * 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":881 + * + * 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":882 + * 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":883 + * 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":882 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":885 + * 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":886 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":881 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":888 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":880 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":890 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":793 + * + * @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":896 + * + * @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":898 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":899 + * 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":902 + * 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":903 + * + * 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, 903, __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, 903, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":904 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":902 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":906 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":907 + * 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":908 + * 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":909 + * 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":908 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":911 + * 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":912 + * + * 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":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":914 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(2, 914, __pyx_L1_error) + + /* "View.MemoryView":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":911 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":917 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 917, __pyx_L1_error) + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":919 + * 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":920 + * + * 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":921 + * 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":920 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":923 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":896 + * + * @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":929 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + + /* "View.MemoryView":930 + * @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":932 + * 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":933 + * + * 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":937 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":938 + * 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":939 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":940 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L6_bool_binop_done:; + if (__pyx_t_6) { + + /* "View.MemoryView":943 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error) + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + } + } + + /* "View.MemoryView":945 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":929 + * + * @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":962 + * 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":963 + * + * 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":962 + * 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":965 + * __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":966 + * + * 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":967 + * 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, 967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":966 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":969 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 969, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":965 + * __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":971 + * 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":972 + * + * 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":973 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error) + + /* "View.MemoryView":972 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":975 + * 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, 975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":971 + * 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":978 + * + * @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":979 + * @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":978 + * + * @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__124, 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__125, 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":985 + * + * @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":993 + * 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":994 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "View.MemoryView":993 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":999 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __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, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1001 + * 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":1002 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1004 + * __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, 1004, __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":1005 + * + * 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":1007 + * 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":1008 + * + * 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":1009 + * 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":1010 + * 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":1011 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * result.flags = PyBUF_RECORDS + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":1013 + * Py_INCREF(Py_None) + * + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1015 + * result.flags = PyBUF_RECORDS + * + * 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":1016 + * + * 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":1019 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1020 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1022 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":1023 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L5_break; + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L5_break:; + + /* "View.MemoryView":1025 + * 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":1026 + * + * 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, 1026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1027 + * 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, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1029 + * 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":1030 + * + * 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":1032 + * 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":985 + * + * @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":1035 + * + * @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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1039 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1039, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1040 + * 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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1042 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1043 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1035 + * + * @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":1046 + * + * @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; + Py_ssize_t __pyx_t_4; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1050 + * 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":1051 + * + * 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":1052 + * 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":1054 + * 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":1055 + * + * 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":1057 + * 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; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_dim = __pyx_t_3; + + /* "View.MemoryView":1058 + * + * 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":1059 + * 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":1060 + * 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_4 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_4 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4; + } + + /* "View.MemoryView":1046 + * + * @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":1063 + * + * @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":1066 + * "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":1067 + * 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, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1063 + * + * @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":1070 + * + * @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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1078 + * + * 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":1079 + * 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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1081 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1082 + * 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":1084 + * 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":1086 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1070 + * + * @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":1092 + * + * + * 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":1093 + * + * 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":1094 + * 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":1093 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1096 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1092 + * + * + * 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":1099 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1104 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1105 + * 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":1107 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1108 + * + * 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":1109 + * 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":1110 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1108 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1112 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1113 + * + * 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":1114 + * 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":1115 + * 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":1113 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1117 + * 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":1118 + * + * 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":1117 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1120 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1099 + * + * @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":1123 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + + /* "View.MemoryView":1130 + * + * 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":1131 + * 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":1132 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1133 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1135 + * 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":1136 + * + * 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":1137 + * 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":1136 + * + * 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":1138 + * 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): + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + + /* "View.MemoryView":1136 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1140 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1141 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + + /* "View.MemoryView":1142 + * 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":1143 + * 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":1135 + * 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":1145 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1146 + * 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":1150 + * 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":1151 + * 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":1123 + * + * @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":1153 + * 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":1156 + * __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":1153 + * 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":1160 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1163 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1165 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1166 + * + * 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":1168 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1160 + * + * @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":1171 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1180 + * 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":1181 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "View.MemoryView":1182 + * 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":1183 + * 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":1180 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1185 + * 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 > -1L; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1186 + * 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":1187 + * 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":1189 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1171 + * + * @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":1192 + * + * @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; + + /* "View.MemoryView":1203 + * 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":1204 + * + * 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":1206 + * 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":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1208 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error) + + /* "View.MemoryView":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1211 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1212 + * + * 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":1213 + * 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; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1214 + * 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":1215 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1217 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + + /* "View.MemoryView":1221 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1222 + * + * 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":1223 + * 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":1222 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1225 + * 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":1226 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + + /* "View.MemoryView":1225 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1228 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1230 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1192 + * + * @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":1235 + * + * @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":1238 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __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":1237 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 1237, __pyx_L1_error) + + /* "View.MemoryView":1235 + * + * @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":1241 + * + * @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":1242 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_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, 1242, __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, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 1242, __pyx_L1_error) + + /* "View.MemoryView":1241 + * + * @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":1245 + * + * @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":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1247 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_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, 1247, __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, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1247, __pyx_L1_error) + + /* "View.MemoryView":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1249 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(2, 1249, __pyx_L1_error) + } + + /* "View.MemoryView":1245 + * + * @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":1252 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + + /* "View.MemoryView":1260 + * 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":1261 + * """ + * 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":1263 + * 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":1264 + * 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":1265 + * 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":1268 + * 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":1269 + * + * 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":1268 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1271 + * 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":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1273 + * 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":1275 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1276 + * + * 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":1277 + * 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":1278 + * 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":1279 + * 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":1277 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1281 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1281, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1276 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1284 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error) + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + } + } + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1289 + * + * 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":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1291 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1291, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_6; + + /* "View.MemoryView":1292 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1298 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1302 + * 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":1304 + * 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":1305 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + + /* "View.MemoryView":1306 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1307 + * 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":1308 + * 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":1302 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_7 = (__pyx_t_2 != 0); + if (__pyx_t_7) { + + /* "View.MemoryView":1313 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error) + + /* "View.MemoryView":1314 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error) + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1316 + * 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":1317 + * + * 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":1318 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1320 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1321 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1252 + * + * @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":1324 + * + * @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; + + /* "View.MemoryView":1328 + * 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":1330 + * 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 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1331 + * + * 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":1332 + * 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":1333 + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1335 + * 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; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1336 + * + * for i in range(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":1337 + * 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":1338 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1324 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1346 + * + * @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":1350 + * + * + * 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":1351 + * + * 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":1350 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1346 + * + * @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":1355 + * + * @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":1358 + * 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":1355 + * + * @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":1361 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1365 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_3 = (__pyx_v_inc != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1368 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1370 + * 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":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1372 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1373 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1375 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1361 + * + * @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":1381 + * + * @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":1384 + * 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":1385 + * 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":1387 + * _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":1381 + * + * @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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "View.MemoryView":1395 + * 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":1396 + * 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":1398 + * 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":1399 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1400 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1401 + * 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":1398 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1403 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1404 + * 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":1406 + * _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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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_2yt_8geometry_18selection_routines_SelectorObject __pyx_vtable_2yt_8geometry_18selection_routines_SelectorObject; + +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *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_2yt_8geometry_18selection_routines_SelectorObject *)o); - p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; - if (unlikely(__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_1__cinit__(o, a, k) < 0)) goto bad; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)o); + p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; + if (unlikely(__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + 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 PyObject *__pyx_getprop_2yt_8geometry_18selection_routines_14SelectorObject_min_level(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_9min_level_1__get__(o); +} + +static int __pyx_setprop_2yt_8geometry_18selection_routines_14SelectorObject_min_level(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_9min_level_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_2yt_8geometry_18selection_routines_14SelectorObject_max_level(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_9max_level_1__get__(o); +} + +static int __pyx_setprop_2yt_8geometry_18selection_routines_14SelectorObject_max_level(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_9max_level_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_SelectorObject[] = { + {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, + {"count_octs", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_5count_octs, METH_VARARGS|METH_KEYWORDS, 0}, + {"count_oct_cells", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_7count_oct_cells, METH_VARARGS|METH_KEYWORDS, 0}, + {"fill_mesh_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_9fill_mesh_mask, METH_O, 0}, + {"fill_mesh_cell_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_11fill_mesh_cell_mask, METH_O, 0}, + {"fill_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_13fill_mask, METH_O, 0}, + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_21_hash_vals, METH_NOARGS, 0}, + {"_base_hash", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_23_base_hash, METH_NOARGS, 0}, + {"__pyx_fuse_0count_points", (PyCFunction)__pyx_fuse_0__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_25count_points, METH_VARARGS|METH_KEYWORDS, 0}, + {"__pyx_fuse_1count_points", (PyCFunction)__pyx_fuse_1__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_27count_points, METH_VARARGS|METH_KEYWORDS, 0}, + {"__pyx_fuse_0select_points", (PyCFunction)__pyx_fuse_0__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_31select_points, METH_VARARGS|METH_KEYWORDS, 0}, + {"__pyx_fuse_1select_points", (PyCFunction)__pyx_fuse_1__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_33select_points, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_37__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_39__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_2yt_8geometry_18selection_routines_SelectorObject[] = { + {(char *)"min_level", __pyx_getprop_2yt_8geometry_18selection_routines_14SelectorObject_min_level, __pyx_setprop_2yt_8geometry_18selection_routines_14SelectorObject_min_level, (char *)0, 0}, + {(char *)"max_level", __pyx_getprop_2yt_8geometry_18selection_routines_14SelectorObject_max_level, __pyx_setprop_2yt_8geometry_18selection_routines_14SelectorObject_max_level, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_SelectorObject = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.selection_routines.SelectorObject", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*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*/ + __pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_19__hash__, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_18selection_routines_SelectorObject, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_2yt_8geometry_18selection_routines_SelectorObject, /*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_2yt_8geometry_18selection_routines_SelectorObject, /*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_2yt_8geometry_18selection_routines_AlwaysSelector __pyx_vtable_2yt_8geometry_18selection_routines_AlwaysSelector; + +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_AlwaysSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; + return o; +} + +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_AlwaysSelector[] = { + {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14AlwaysSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14AlwaysSelector_5_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14AlwaysSelector_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14AlwaysSelector_9__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_AlwaysSelector = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.selection_routines.AlwaysSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_18selection_routines_AlwaysSelector, /*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_2yt_8geometry_18selection_routines_14AlwaysSelector_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_AlwaysSelector, /*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_2yt_8geometry_18selection_routines_OctreeSubsetSelector __pyx_vtable_2yt_8geometry_18selection_routines_OctreeSubsetSelector; + +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_OctreeSubsetSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; + p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_OctreeSubsetSelector(PyObject *o) { + struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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->base_selector); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); +} + +static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_OctreeSubsetSelector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *)o; + e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_OctreeSubsetSelector)); if (e) return e; + if (p->base_selector) { + e = (*v)(((PyObject *)p->base_selector), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_2yt_8geometry_18selection_routines_OctreeSubsetSelector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *)o; + if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_OctreeSubsetSelector); + tmp = ((PyObject*)p->base_selector); + p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_domain_id(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_9domain_id_1__get__(o); +} + +static int __pyx_setprop_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_domain_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_9domain_id_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_OctreeSubsetSelector[] = { + {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_5_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_9__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_2yt_8geometry_18selection_routines_OctreeSubsetSelector[] = { + {(char *)"domain_id", __pyx_getprop_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_domain_id, __pyx_setprop_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_domain_id, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_OctreeSubsetSelector = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.selection_routines.OctreeSubsetSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_OctreeSubsetSelector, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_OctreeSubsetSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_OctreeSubsetSelector, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_18selection_routines_OctreeSubsetSelector, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_2yt_8geometry_18selection_routines_OctreeSubsetSelector, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_OctreeSubsetSelector, /*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_2yt_8geometry_18selection_routines_BooleanSelector __pyx_vtable_2yt_8geometry_18selection_routines_BooleanSelector; + +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_BooleanSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + p->sel1 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + p->sel2 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); return o; - bad: - Py_DECREF(o); o = 0; - return NULL; } -static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(PyObject *o) { +static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_BooleanSelector(PyObject *o) { + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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->sel1); + Py_CLEAR(p->sel2); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); +} + +static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_BooleanSelector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)o; + e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_BooleanSelector)); if (e) return e; + if (p->sel1) { + e = (*v)(((PyObject *)p->sel1), a); if (e) return e; + } + if (p->sel2) { + e = (*v)(((PyObject *)p->sel2), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_2yt_8geometry_18selection_routines_BooleanSelector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector *)o; + if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_BooleanSelector); + tmp = ((PyObject*)p->sel1); + p->sel1 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->sel2); + p->sel2 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_2yt_8geometry_18selection_routines_15BooleanSelector_sel1(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_1__get__(o); +} + +static int __pyx_setprop_2yt_8geometry_18selection_routines_15BooleanSelector_sel1(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_3__set__(o, v); + } + else { + return __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel1_5__del__(o); + } +} + +static PyObject *__pyx_getprop_2yt_8geometry_18selection_routines_15BooleanSelector_sel2(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_1__get__(o); +} + +static int __pyx_setprop_2yt_8geometry_18selection_routines_15BooleanSelector_sel2(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_3__set__(o, v); + } + else { + return __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_4sel2_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_BooleanSelector[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_5__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_2yt_8geometry_18selection_routines_BooleanSelector[] = { + {(char *)"sel1", __pyx_getprop_2yt_8geometry_18selection_routines_15BooleanSelector_sel1, __pyx_setprop_2yt_8geometry_18selection_routines_15BooleanSelector_sel1, (char *)0, 0}, + {(char *)"sel2", __pyx_getprop_2yt_8geometry_18selection_routines_15BooleanSelector_sel2, __pyx_setprop_2yt_8geometry_18selection_routines_15BooleanSelector_sel2, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_BooleanSelector = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.selection_routines.BooleanSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_BooleanSelector, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_BooleanSelector, /*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_2yt_8geometry_18selection_routines_PointSelector __pyx_vtable_2yt_8geometry_18selection_routines_PointSelector; + +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_PointSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_PointSelector; + return o; +} + +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_PointSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_13PointSelector_3_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_13PointSelector_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_13PointSelector_7__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_PointSelector = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.selection_routines.PointSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_18selection_routines_PointSelector, /*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_2yt_8geometry_18selection_routines_13PointSelector_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_PointSelector, /*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_2yt_8geometry_18selection_routines_SphereSelector __pyx_vtable_2yt_8geometry_18selection_routines_SphereSelector; + +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_SphereSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_SphereSelector; + return o; +} + +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_SphereSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SphereSelector_3_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SphereSelector_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SphereSelector_7__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_SphereSelector = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.selection_routines.SphereSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_18selection_routines_SphereSelector, /*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_2yt_8geometry_18selection_routines_14SphereSelector_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_SphereSelector, /*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_2yt_8geometry_18selection_routines_RegionSelector __pyx_vtable_2yt_8geometry_18selection_routines_RegionSelector; + +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_RegionSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_RegionSelector; + return o; +} + +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_RegionSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14RegionSelector_3_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14RegionSelector_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14RegionSelector_7__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_RegionSelector = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.selection_routines.RegionSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_18selection_routines_RegionSelector, /*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_2yt_8geometry_18selection_routines_14RegionSelector_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_RegionSelector, /*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_2yt_8geometry_18selection_routines_CutRegionSelector __pyx_vtable_2yt_8geometry_18selection_routines_CutRegionSelector; + +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_CutRegionSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_CutRegionSelector; + p->_positions = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_conditionals = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_CutRegionSelector(PyObject *o) { + struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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->_positions); + Py_CLEAR(p->_conditionals); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); +} + +static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_CutRegionSelector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *)o; + e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_CutRegionSelector)); if (e) return e; + if (p->_positions) { + e = (*v)(p->_positions, a); if (e) return e; + } + if (p->_conditionals) { + e = (*v)(p->_conditionals, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_2yt_8geometry_18selection_routines_CutRegionSelector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *)o; + if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_CutRegionSelector); + tmp = ((PyObject*)p->_positions); + p->_positions = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_conditionals); + p->_conditionals = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_CutRegionSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_17CutRegionSelector_3_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_17CutRegionSelector_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_17CutRegionSelector_7__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_CutRegionSelector = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.selection_routines.CutRegionSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_CutRegionSelector, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_CutRegionSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_CutRegionSelector, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_18selection_routines_CutRegionSelector, /*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_2yt_8geometry_18selection_routines_17CutRegionSelector_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_CutRegionSelector, /*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 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } + 0, /*tp_finalize*/ #endif - (*Py_TYPE(o)->tp_free)(o); -} - -static PyObject *__pyx_getprop_2yt_8geometry_18selection_routines_14SelectorObject_min_level(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_9min_level_1__get__(o); -} - -static int __pyx_setprop_2yt_8geometry_18selection_routines_14SelectorObject_min_level(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_9min_level_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_2yt_8geometry_18selection_routines_14SelectorObject_max_level(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_9max_level_1__get__(o); -} +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_DiskSelector __pyx_vtable_2yt_8geometry_18selection_routines_DiskSelector; -static int __pyx_setprop_2yt_8geometry_18selection_routines_14SelectorObject_max_level(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_9max_level_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_DiskSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_DiskSelector; + return o; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_SelectorObject[] = { - {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, - {"count_octs", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_5count_octs, METH_VARARGS|METH_KEYWORDS, 0}, - {"count_oct_cells", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_7count_oct_cells, METH_VARARGS|METH_KEYWORDS, 0}, - {"fill_mesh_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_9fill_mesh_mask, METH_O, 0}, - {"fill_mesh_cell_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_11fill_mesh_cell_mask, METH_O, 0}, - {"fill_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_13fill_mask, METH_O, 0}, - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_21_hash_vals, METH_NOARGS, 0}, - {"_base_hash", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_23_base_hash, METH_NOARGS, 0}, - {"__pyx_fuse_0count_points", (PyCFunction)__pyx_fuse_0__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_25count_points, METH_VARARGS|METH_KEYWORDS, 0}, - {"__pyx_fuse_1count_points", (PyCFunction)__pyx_fuse_1__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_27count_points, METH_VARARGS|METH_KEYWORDS, 0}, - {"__pyx_fuse_0select_points", (PyCFunction)__pyx_fuse_0__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_31select_points, METH_VARARGS|METH_KEYWORDS, 0}, - {"__pyx_fuse_1select_points", (PyCFunction)__pyx_fuse_1__pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_33select_points, METH_VARARGS|METH_KEYWORDS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_DiskSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_12DiskSelector_3_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_12DiskSelector_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_12DiskSelector_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_2yt_8geometry_18selection_routines_SelectorObject[] = { - {(char *)"min_level", __pyx_getprop_2yt_8geometry_18selection_routines_14SelectorObject_min_level, __pyx_setprop_2yt_8geometry_18selection_routines_14SelectorObject_min_level, (char *)0, 0}, - {(char *)"max_level", __pyx_getprop_2yt_8geometry_18selection_routines_14SelectorObject_max_level, __pyx_setprop_2yt_8geometry_18selection_routines_14SelectorObject_max_level, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_SelectorObject = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_DiskSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.SelectorObject", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), /*tp_basicsize*/ + "yt.geometry.selection_routines.DiskSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ 0, /*tp_print*/ @@ -48103,7 +58688,7 @@ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ - __pyx_pw_2yt_8geometry_18selection_routines_14SelectorObject_19__hash__, /*tp_hash*/ + 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ @@ -48117,17 +58702,17 @@ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_SelectorObject, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_DiskSelector, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_2yt_8geometry_18selection_routines_SelectorObject, /*tp_getset*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - 0, /*tp_init*/ + __pyx_pw_2yt_8geometry_18selection_routines_12DiskSelector_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_DiskSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -48141,27 +58726,28 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector __pyx_vtable_2yt_8geometry_18selection_routines_AlwaysSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_CuttingPlaneSelector __pyx_vtable_2yt_8geometry_18selection_routines_CuttingPlaneSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_AlwaysSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *p; +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_CuttingPlaneSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *p; PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_CuttingPlaneSelector; return o; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_AlwaysSelector[] = { - {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14AlwaysSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14AlwaysSelector_5_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_CuttingPlaneSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_3_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_AlwaysSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_CuttingPlaneSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.AlwaysSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.CuttingPlaneSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ 0, /*tp_print*/ @@ -48191,7 +58777,7 @@ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_AlwaysSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_CuttingPlaneSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -48199,9 +58785,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_14AlwaysSelector_1__init__, /*tp_init*/ + __pyx_pw_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_AlwaysSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_CuttingPlaneSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -48215,85 +58801,107 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector __pyx_vtable_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SliceSelector __pyx_vtable_2yt_8geometry_18selection_routines_SliceSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_OctreeSubsetSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *p; +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_SliceSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *p; PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; - p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_SliceSelector; return o; } -static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_OctreeSubsetSelector(PyObject *o) { - struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_SliceSelector[] = { + {"fill_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_13SliceSelector_3fill_mask, METH_O, 0}, + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_13SliceSelector_5_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_13SliceSelector_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_13SliceSelector_9__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_SliceSelector = { + PyVarObject_HEAD_INIT(0, 0) + "yt.geometry.selection_routines.SliceSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->base_selector); - #if CYTHON_USE_TYPE_SLOTS - if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ #endif - PyObject_GC_Track(o); - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); -} - -static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_OctreeSubsetSelector(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *)o; - e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_OctreeSubsetSelector)); if (e) return e; - if (p->base_selector) { - e = (*v)(((PyObject*)p->base_selector), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_2yt_8geometry_18selection_routines_OctreeSubsetSelector(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector *)o; - if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_OctreeSubsetSelector); - tmp = ((PyObject*)p->base_selector); - p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_domain_id(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_9domain_id_1__get__(o); -} + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_8geometry_18selection_routines_SliceSelector, /*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_2yt_8geometry_18selection_routines_13SliceSelector_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_SliceSelector, /*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_2yt_8geometry_18selection_routines_OrthoRaySelector __pyx_vtable_2yt_8geometry_18selection_routines_OrthoRaySelector; -static int __pyx_setprop_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_domain_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_9domain_id_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_OrthoRaySelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_OrthoRaySelector; + return o; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_OctreeSubsetSelector[] = { - {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_5_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_OrthoRaySelector[] = { + {"fill_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_3fill_mask, METH_O, 0}, + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_5_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_9__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_2yt_8geometry_18selection_routines_OctreeSubsetSelector[] = { - {(char *)"domain_id", __pyx_getprop_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_domain_id, __pyx_setprop_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_domain_id, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_OctreeSubsetSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_OrthoRaySelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.OctreeSubsetSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.OrthoRaySelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_OctreeSubsetSelector, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -48313,25 +58921,25 @@ 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*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_2yt_8geometry_18selection_routines_OctreeSubsetSelector, /*tp_traverse*/ - __pyx_tp_clear_2yt_8geometry_18selection_routines_OctreeSubsetSelector, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_OctreeSubsetSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_OrthoRaySelector, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_2yt_8geometry_18selection_routines_OctreeSubsetSelector, /*tp_getset*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_1__init__, /*tp_init*/ + __pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_OctreeSubsetSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_OrthoRaySelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -48345,26 +58953,31 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_PointSelector __pyx_vtable_2yt_8geometry_18selection_routines_PointSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_RaySelector __pyx_vtable_2yt_8geometry_18selection_routines_RaySelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_PointSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector *p; +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_RaySelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *p; PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_PointSelector; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_RaySelector; return o; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_PointSelector[] = { - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_13PointSelector_3_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_RaySelector[] = { + {"fill_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_3fill_mask, METH_O, 0}, + {"get_dt", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_5get_dt, METH_O, 0}, + {"get_dt_mesh", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_7get_dt_mesh, METH_VARARGS|METH_KEYWORDS, 0}, + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_9_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_11__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_13__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_PointSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_RaySelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.PointSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_PointSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.RaySelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ 0, /*tp_print*/ @@ -48394,7 +59007,7 @@ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_PointSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_RaySelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -48402,9 +59015,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_13PointSelector_1__init__, /*tp_init*/ + __pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_PointSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_RaySelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -48418,28 +59031,69 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SphereSelector __pyx_vtable_2yt_8geometry_18selection_routines_SphereSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_DataCollectionSelector __pyx_vtable_2yt_8geometry_18selection_routines_DataCollectionSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_SphereSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector *p; +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_DataCollectionSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *p; PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_SphereSelector; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_DataCollectionSelector; + p->obj_ids = Py_None; Py_INCREF(Py_None); return o; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_SphereSelector[] = { - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14SphereSelector_3_hash_vals, METH_NOARGS, 0}, +static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_DataCollectionSelector(PyObject *o) { + struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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->obj_ids); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); +} + +static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_DataCollectionSelector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *)o; + e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_DataCollectionSelector)); if (e) return e; + if (p->obj_ids) { + e = (*v)(p->obj_ids, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_2yt_8geometry_18selection_routines_DataCollectionSelector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *)o; + if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_DataCollectionSelector); + tmp = ((PyObject*)p->obj_ids); + p->obj_ids = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_DataCollectionSelector[] = { + {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_22DataCollectionSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, + {"fill_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_22DataCollectionSelector_5fill_mask, METH_O, 0}, + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_22DataCollectionSelector_7_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_22DataCollectionSelector_9__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_22DataCollectionSelector_11__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_SphereSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_DataCollectionSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.SphereSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SphereSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.DataCollectionSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_DataCollectionSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -48459,15 +59113,15 @@ 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*/ + 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*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_DataCollectionSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_DataCollectionSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_SphereSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_DataCollectionSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -48475,9 +59129,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_14SphereSelector_1__init__, /*tp_init*/ + __pyx_pw_2yt_8geometry_18selection_routines_22DataCollectionSelector_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_SphereSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_DataCollectionSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -48491,26 +59145,28 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_RegionSelector __pyx_vtable_2yt_8geometry_18selection_routines_RegionSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_EllipsoidSelector __pyx_vtable_2yt_8geometry_18selection_routines_EllipsoidSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_RegionSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *p; +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_EllipsoidSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *p; PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_RegionSelector; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_EllipsoidSelector; return o; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_RegionSelector[] = { - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_14RegionSelector_3_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_EllipsoidSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_17EllipsoidSelector_3_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_17EllipsoidSelector_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_17EllipsoidSelector_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_RegionSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_EllipsoidSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.RegionSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_RegionSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.EllipsoidSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ 0, /*tp_print*/ @@ -48540,7 +59196,7 @@ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_RegionSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_EllipsoidSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -48548,9 +59204,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_14RegionSelector_1__init__, /*tp_init*/ + __pyx_pw_2yt_8geometry_18selection_routines_17EllipsoidSelector_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_RegionSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_EllipsoidSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -48564,29 +59220,27 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_CutRegionSelector __pyx_vtable_2yt_8geometry_18selection_routines_CutRegionSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_GridSelector __pyx_vtable_2yt_8geometry_18selection_routines_GridSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_CutRegionSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *p; +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_GridSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *p; PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_CutRegionSelector; - p->_positions = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->_conditionals = ((PyObject*)Py_None); Py_INCREF(Py_None); + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_GridSelector; + p->ind = Py_None; Py_INCREF(Py_None); return o; } -static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_CutRegionSelector(PyObject *o) { - struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *)o; +static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_GridSelector(PyObject *o) { + struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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->_positions); - Py_CLEAR(p->_conditionals); + Py_CLEAR(p->ind); #if CYTHON_USE_TYPE_SLOTS if (PyType_IS_GC(Py_TYPE(o)->tp_base)) #endif @@ -48594,43 +59248,41 @@ __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); } -static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_CutRegionSelector(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_GridSelector(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *)o; - e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_CutRegionSelector)); if (e) return e; - if (p->_positions) { - e = (*v)(p->_positions, a); if (e) return e; - } - if (p->_conditionals) { - e = (*v)(p->_conditionals, a); if (e) return e; + struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *)o; + e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_GridSelector)); if (e) return e; + if (p->ind) { + e = (*v)(p->ind, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_2yt_8geometry_18selection_routines_CutRegionSelector(PyObject *o) { +static int __pyx_tp_clear_2yt_8geometry_18selection_routines_GridSelector(PyObject *o) { PyObject* tmp; - struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector *)o; - if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_CutRegionSelector); - tmp = ((PyObject*)p->_positions); - p->_positions = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_conditionals); - p->_conditionals = ((PyObject*)Py_None); Py_INCREF(Py_None); + struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *)o; + if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_GridSelector); + tmp = ((PyObject*)p->ind); + p->ind = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_CutRegionSelector[] = { - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_17CutRegionSelector_3_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_GridSelector[] = { + {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_12GridSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, + {"fill_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_12GridSelector_5fill_mask, METH_O, 0}, + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_12GridSelector_7_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_12GridSelector_9__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_12GridSelector_11__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_CutRegionSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_GridSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.CutRegionSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_CutRegionSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.GridSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_CutRegionSelector, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_GridSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -48652,13 +59304,13 @@ 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_2yt_8geometry_18selection_routines_CutRegionSelector, /*tp_traverse*/ - __pyx_tp_clear_2yt_8geometry_18selection_routines_CutRegionSelector, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_GridSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_GridSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_CutRegionSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_GridSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -48666,9 +59318,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_17CutRegionSelector_1__init__, /*tp_init*/ + __pyx_pw_2yt_8geometry_18selection_routines_12GridSelector_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_CutRegionSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_GridSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -48682,28 +59334,68 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_DiskSelector __pyx_vtable_2yt_8geometry_18selection_routines_DiskSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector __pyx_vtable_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_DiskSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *p; +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *p; PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_DiskSelector; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector; + p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); return o; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_DiskSelector[] = { - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_12DiskSelector_3_hash_vals, METH_NOARGS, 0}, +static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector(PyObject *o) { + struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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->base_selector); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); +} + +static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *)o; + e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector)); if (e) return e; + if (p->base_selector) { + e = (*v)(((PyObject *)p->base_selector), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *)o; + if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector); + tmp = ((PyObject*)p->base_selector); + p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector[] = { + {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_5_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_9__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_DiskSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.DiskSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_DiskSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.IndexedOctreeSubsetSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -48723,15 +59415,15 @@ 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*/ + 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*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_DiskSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -48739,9 +59431,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_12DiskSelector_1__init__, /*tp_init*/ + __pyx_pw_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_DiskSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -48755,28 +59447,76 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_CuttingPlaneSelector __pyx_vtable_2yt_8geometry_18selection_routines_CuttingPlaneSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ComposeSelector __pyx_vtable_2yt_8geometry_18selection_routines_ComposeSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_CuttingPlaneSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *p; +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_ComposeSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *p; PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_CuttingPlaneSelector; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_ComposeSelector; + p->selector1 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + p->selector2 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); return o; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_CuttingPlaneSelector[] = { - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_3_hash_vals, METH_NOARGS, 0}, +static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_ComposeSelector(PyObject *o) { + struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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->selector1); + Py_CLEAR(p->selector2); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); +} + +static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_ComposeSelector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *)o; + e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_ComposeSelector)); if (e) return e; + if (p->selector1) { + e = (*v)(((PyObject *)p->selector1), a); if (e) return e; + } + if (p->selector2) { + e = (*v)(((PyObject *)p->selector2), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_2yt_8geometry_18selection_routines_ComposeSelector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *)o; + if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_ComposeSelector); + tmp = ((PyObject*)p->selector1); + p->selector1 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->selector2); + p->selector2 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_ComposeSelector[] = { + {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_15ComposeSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_15ComposeSelector_5_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_15ComposeSelector_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_15ComposeSelector_9__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_CuttingPlaneSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_ComposeSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.CuttingPlaneSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_CuttingPlaneSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.ComposeSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_ComposeSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -48796,15 +59536,15 @@ 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*/ + 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*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_ComposeSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_ComposeSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_CuttingPlaneSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_ComposeSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -48812,9 +59552,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_1__init__, /*tp_init*/ + __pyx_pw_2yt_8geometry_18selection_routines_15ComposeSelector_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_CuttingPlaneSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_ComposeSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -48828,29 +59568,116 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SliceSelector __pyx_vtable_2yt_8geometry_18selection_routines_SliceSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_HaloParticlesSelector __pyx_vtable_2yt_8geometry_18selection_routines_HaloParticlesSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_SliceSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *p; +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_HaloParticlesSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *p; PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_SliceSelector; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_HaloParticlesSelector; + p->base_source = Py_None; Py_INCREF(Py_None); + p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + p->pind = Py_None; Py_INCREF(Py_None); return o; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_SliceSelector[] = { - {"fill_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_13SliceSelector_3fill_mask, METH_O, 0}, - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_13SliceSelector_5_hash_vals, METH_NOARGS, 0}, +static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_HaloParticlesSelector(PyObject *o) { + struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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->base_source); + Py_CLEAR(p->base_selector); + Py_CLEAR(p->pind); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); +} + +static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_HaloParticlesSelector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *)o; + e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_HaloParticlesSelector)); if (e) return e; + if (p->base_source) { + e = (*v)(p->base_source, a); if (e) return e; + } + if (p->base_selector) { + e = (*v)(((PyObject *)p->base_selector), a); if (e) return e; + } + if (p->pind) { + e = (*v)(p->pind, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_2yt_8geometry_18selection_routines_HaloParticlesSelector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *)o; + if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_HaloParticlesSelector); + tmp = ((PyObject*)p->base_source); + p->base_source = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->base_selector); + p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->pind); + p->pind = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_base_source(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_11base_source_1__get__(o); +} + +static int __pyx_setprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_base_source(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_11base_source_3__set__(o, v); + } + else { + return __pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_11base_source_5__del__(o); + } +} + +static PyObject *__pyx_getprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_halo_id(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_7halo_id_1__get__(o); +} + +static int __pyx_setprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_halo_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_7halo_id_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_HaloParticlesSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_3_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_SliceSelector = { +static struct PyGetSetDef __pyx_getsets_2yt_8geometry_18selection_routines_HaloParticlesSelector[] = { + {(char *)"base_source", __pyx_getprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_base_source, __pyx_setprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_base_source, (char *)0, 0}, + {(char *)"halo_id", __pyx_getprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_halo_id, __pyx_setprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_halo_id, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_HaloParticlesSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.SliceSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SliceSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.HaloParticlesSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_HaloParticlesSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -48870,25 +59697,25 @@ 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*/ + 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*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_HaloParticlesSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_HaloParticlesSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_SliceSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_HaloParticlesSelector, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + __pyx_getsets_2yt_8geometry_18selection_routines_HaloParticlesSelector, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_13SliceSelector_1__init__, /*tp_init*/ + __pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_SliceSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_HaloParticlesSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -48902,29 +59729,30 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OrthoRaySelector __pyx_vtable_2yt_8geometry_18selection_routines_OrthoRaySelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanANDSelector __pyx_vtable_2yt_8geometry_18selection_routines_BooleanANDSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_OrthoRaySelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_BooleanANDSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_BooleanSelector(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_OrthoRaySelector; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanANDSelector; return o; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_OrthoRaySelector[] = { - {"fill_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_3fill_mask, METH_O, 0}, - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_5_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_BooleanANDSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_18BooleanANDSelector_1_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_18BooleanANDSelector_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_18BooleanANDSelector_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_OrthoRaySelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_BooleanANDSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.OrthoRaySelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OrthoRaySelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.BooleanANDSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanANDSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -48944,15 +59772,15 @@ 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*/ + 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*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_OrthoRaySelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_BooleanANDSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -48960,9 +59788,13 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_16OrthoRaySelector_1__init__, /*tp_init*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_OrthoRaySelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_BooleanANDSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -48976,31 +59808,30 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_RaySelector __pyx_vtable_2yt_8geometry_18selection_routines_RaySelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanORSelector __pyx_vtable_2yt_8geometry_18selection_routines_BooleanORSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_RaySelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_BooleanORSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_BooleanSelector(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_RaySelector; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanORSelector; return o; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_RaySelector[] = { - {"fill_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_3fill_mask, METH_O, 0}, - {"get_dt", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_5get_dt, METH_O, 0}, - {"get_dt_mesh", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_7get_dt_mesh, METH_VARARGS|METH_KEYWORDS, 0}, - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_9_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_BooleanORSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_17BooleanORSelector_1_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_17BooleanORSelector_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_17BooleanORSelector_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_RaySelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_BooleanORSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.RaySelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_RaySelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.BooleanORSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanORSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -49020,15 +59851,15 @@ 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*/ + 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*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_RaySelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_BooleanORSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -49036,9 +59867,13 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_11RaySelector_1__init__, /*tp_init*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_RaySelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_BooleanORSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -49052,67 +59887,30 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_DataCollectionSelector __pyx_vtable_2yt_8geometry_18selection_routines_DataCollectionSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanNOTSelector __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNOTSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_DataCollectionSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_BooleanNOTSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_BooleanSelector(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_DataCollectionSelector; - p->obj_ids = Py_None; Py_INCREF(Py_None); + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanNOTSelector; return o; } -static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_DataCollectionSelector(PyObject *o) { - struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->obj_ids); - #if CYTHON_USE_TYPE_SLOTS - if (PyType_IS_GC(Py_TYPE(o)->tp_base)) - #endif - PyObject_GC_Track(o); - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); -} - -static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_DataCollectionSelector(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *)o; - e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_DataCollectionSelector)); if (e) return e; - if (p->obj_ids) { - e = (*v)(p->obj_ids, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_2yt_8geometry_18selection_routines_DataCollectionSelector(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector *)o; - if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_DataCollectionSelector); - tmp = ((PyObject*)p->obj_ids); - p->obj_ids = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_DataCollectionSelector[] = { - {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_22DataCollectionSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, - {"fill_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_22DataCollectionSelector_5fill_mask, METH_O, 0}, - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_22DataCollectionSelector_7_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_BooleanNOTSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNOTSelector_1_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNOTSelector_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNOTSelector_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_DataCollectionSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_BooleanNOTSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.DataCollectionSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_DataCollectionSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.BooleanNOTSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNOTSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_DataCollectionSelector, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -49134,13 +59932,13 @@ 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_2yt_8geometry_18selection_routines_DataCollectionSelector, /*tp_traverse*/ - __pyx_tp_clear_2yt_8geometry_18selection_routines_DataCollectionSelector, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_DataCollectionSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_BooleanNOTSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -49148,9 +59946,13 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_22DataCollectionSelector_1__init__, /*tp_init*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_DataCollectionSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_BooleanNOTSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -49164,28 +59966,30 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_EllipsoidSelector __pyx_vtable_2yt_8geometry_18selection_routines_EllipsoidSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanXORSelector __pyx_vtable_2yt_8geometry_18selection_routines_BooleanXORSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_EllipsoidSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_BooleanXORSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_BooleanSelector(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_EllipsoidSelector; + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanXORSelector; return o; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_EllipsoidSelector[] = { - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_17EllipsoidSelector_3_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_BooleanXORSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_18BooleanXORSelector_1_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_18BooleanXORSelector_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_18BooleanXORSelector_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_EllipsoidSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_BooleanXORSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.EllipsoidSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_EllipsoidSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.BooleanXORSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanXORSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -49205,15 +60009,15 @@ 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*/ + 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*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_EllipsoidSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_BooleanXORSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -49221,9 +60025,13 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_17EllipsoidSelector_1__init__, /*tp_init*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_EllipsoidSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_BooleanXORSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -49237,67 +60045,30 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_GridSelector __pyx_vtable_2yt_8geometry_18selection_routines_GridSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanNEGSelector __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNEGSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_GridSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_BooleanNEGSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_BooleanSelector(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_GridSelector; - p->ind = Py_None; Py_INCREF(Py_None); + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanNEGSelector; return o; } -static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_GridSelector(PyObject *o) { - struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->ind); - #if CYTHON_USE_TYPE_SLOTS - if (PyType_IS_GC(Py_TYPE(o)->tp_base)) - #endif - PyObject_GC_Track(o); - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); -} - -static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_GridSelector(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *)o; - e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_GridSelector)); if (e) return e; - if (p->ind) { - e = (*v)(p->ind, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_2yt_8geometry_18selection_routines_GridSelector(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector *)o; - if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_GridSelector); - tmp = ((PyObject*)p->ind); - p->ind = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_GridSelector[] = { - {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_12GridSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, - {"fill_mask", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_12GridSelector_5fill_mask, METH_O, 0}, - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_12GridSelector_7_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_BooleanNEGSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNEGSelector_1_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNEGSelector_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_18BooleanNEGSelector_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_GridSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_BooleanNEGSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.GridSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_GridSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.BooleanNEGSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanNEGSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_GridSelector, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -49319,13 +60090,13 @@ 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_2yt_8geometry_18selection_routines_GridSelector, /*tp_traverse*/ - __pyx_tp_clear_2yt_8geometry_18selection_routines_GridSelector, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_BooleanSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_GridSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_BooleanNEGSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -49333,9 +60104,13 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_12GridSelector_1__init__, /*tp_init*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_18selection_routines_15BooleanSelector_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_GridSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_BooleanNEGSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -49349,27 +60124,27 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector __pyx_vtable_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ChainedBooleanSelector __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *p; +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_ChainedBooleanSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *p; PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector; - p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanSelector; + p->selectors = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); return o; } -static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector(PyObject *o) { - struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *)o; +static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_ChainedBooleanSelector(PyObject *o) { + struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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->base_selector); + Py_CLEAR(p->selectors); #if CYTHON_USE_TYPE_SLOTS if (PyType_IS_GC(Py_TYPE(o)->tp_base)) #endif @@ -49377,38 +60152,38 @@ __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); } -static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_ChainedBooleanSelector(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *)o; - e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector)); if (e) return e; - if (p->base_selector) { - e = (*v)(((PyObject*)p->base_selector), a); if (e) return e; + struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *)o; + e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_ChainedBooleanSelector)); if (e) return e; + if (p->selectors) { + e = (*v)(((PyObject *)p->selectors), a); if (e) return e; } return 0; } -static int __pyx_tp_clear_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector(PyObject *o) { +static int __pyx_tp_clear_2yt_8geometry_18selection_routines_ChainedBooleanSelector(PyObject *o) { PyObject* tmp; - struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector *)o; - if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector); - tmp = ((PyObject*)p->base_selector); - p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector *)o; + if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_ChainedBooleanSelector); + tmp = ((PyObject*)p->selectors); + p->selectors = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector[] = { - {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_5_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_ChainedBooleanSelector[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.IndexedOctreeSubsetSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.ChainedBooleanSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_ChainedBooleanSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -49430,13 +60205,13 @@ 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_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector, /*tp_traverse*/ - __pyx_tp_clear_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_ChainedBooleanSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_ChainedBooleanSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_ChainedBooleanSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -49444,9 +60219,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_1__init__, /*tp_init*/ + __pyx_pw_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_ChainedBooleanSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -49460,74 +60235,30 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ComposeSelector __pyx_vtable_2yt_8geometry_18selection_routines_ComposeSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_ComposeSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_ChainedBooleanSelector(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_ComposeSelector; - p->selector1 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); - p->selector2 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector; return o; } -static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_ComposeSelector(PyObject *o) { - struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->selector1); - Py_CLEAR(p->selector2); - #if CYTHON_USE_TYPE_SLOTS - if (PyType_IS_GC(Py_TYPE(o)->tp_base)) - #endif - PyObject_GC_Track(o); - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); -} - -static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_ComposeSelector(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *)o; - e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_ComposeSelector)); if (e) return e; - if (p->selector1) { - e = (*v)(((PyObject*)p->selector1), a); if (e) return e; - } - if (p->selector2) { - e = (*v)(((PyObject*)p->selector2), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_2yt_8geometry_18selection_routines_ComposeSelector(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector *)o; - if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_ComposeSelector); - tmp = ((PyObject*)p->selector1); - p->selector1 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->selector2); - p->selector2 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_ComposeSelector[] = { - {"select_grids", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_15ComposeSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0}, - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_15ComposeSelector_5_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_1_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_ComposeSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.ComposeSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_ComposeSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.ChainedBooleanANDSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_ComposeSelector, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_ChainedBooleanSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -49549,13 +60280,13 @@ 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_2yt_8geometry_18selection_routines_ComposeSelector, /*tp_traverse*/ - __pyx_tp_clear_2yt_8geometry_18selection_routines_ComposeSelector, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_ChainedBooleanSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_ChainedBooleanSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_ComposeSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -49563,9 +60294,13 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_15ComposeSelector_1__init__, /*tp_init*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_ComposeSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -49579,114 +60314,30 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_HaloParticlesSelector __pyx_vtable_2yt_8geometry_18selection_routines_HaloParticlesSelector; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_ChainedBooleanORSelector __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanORSelector; -static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_HaloParticlesSelector(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *p; - PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_SelectorObject(t, a, k); +static PyObject *__pyx_tp_new_2yt_8geometry_18selection_routines_ChainedBooleanORSelector(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *p; + PyObject *o = __pyx_tp_new_2yt_8geometry_18selection_routines_ChainedBooleanSelector(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_HaloParticlesSelector; - p->base_source = Py_None; Py_INCREF(Py_None); - p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); - p->pind = Py_None; Py_INCREF(Py_None); + p = ((struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanORSelector; return o; } -static void __pyx_tp_dealloc_2yt_8geometry_18selection_routines_HaloParticlesSelector(PyObject *o) { - struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->base_source); - Py_CLEAR(p->base_selector); - Py_CLEAR(p->pind); - #if CYTHON_USE_TYPE_SLOTS - if (PyType_IS_GC(Py_TYPE(o)->tp_base)) - #endif - PyObject_GC_Track(o); - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_SelectorObject(o); -} - -static int __pyx_tp_traverse_2yt_8geometry_18selection_routines_HaloParticlesSelector(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *)o; - e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_8geometry_18selection_routines_HaloParticlesSelector)); if (e) return e; - if (p->base_source) { - e = (*v)(p->base_source, a); if (e) return e; - } - if (p->base_selector) { - e = (*v)(((PyObject*)p->base_selector), a); if (e) return e; - } - if (p->pind) { - e = (*v)(p->pind, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_2yt_8geometry_18selection_routines_HaloParticlesSelector(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *p = (struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector *)o; - if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_8geometry_18selection_routines_HaloParticlesSelector); - tmp = ((PyObject*)p->base_source); - p->base_source = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->base_selector); - p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->pind); - p->pind = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_base_source(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_11base_source_1__get__(o); -} - -static int __pyx_setprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_base_source(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_11base_source_3__set__(o, v); - } - else { - return __pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_11base_source_5__del__(o); - } -} - -static PyObject *__pyx_getprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_halo_id(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_7halo_id_1__get__(o); -} - -static int __pyx_setprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_halo_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_7halo_id_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_HaloParticlesSelector[] = { - {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_3_hash_vals, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_2yt_8geometry_18selection_routines_ChainedBooleanORSelector[] = { + {"_hash_vals", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_1_hash_vals, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_2yt_8geometry_18selection_routines_HaloParticlesSelector[] = { - {(char *)"base_source", __pyx_getprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_base_source, __pyx_setprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_base_source, (char *)0, 0}, - {(char *)"halo_id", __pyx_getprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_halo_id, __pyx_setprop_2yt_8geometry_18selection_routines_21HaloParticlesSelector_halo_id, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_HaloParticlesSelector = { +static PyTypeObject __pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanORSelector = { PyVarObject_HEAD_INIT(0, 0) - "yt.geometry.selection_routines.HaloParticlesSelector", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_HaloParticlesSelector), /*tp_basicsize*/ + "yt.geometry.selection_routines.ChainedBooleanORSelector", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_ChainedBooleanORSelector), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_8geometry_18selection_routines_HaloParticlesSelector, /*tp_dealloc*/ + __pyx_tp_dealloc_2yt_8geometry_18selection_routines_ChainedBooleanSelector, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -49708,23 +60359,27 @@ 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_2yt_8geometry_18selection_routines_HaloParticlesSelector, /*tp_traverse*/ - __pyx_tp_clear_2yt_8geometry_18selection_routines_HaloParticlesSelector, /*tp_clear*/ + __pyx_tp_traverse_2yt_8geometry_18selection_routines_ChainedBooleanSelector, /*tp_traverse*/ + __pyx_tp_clear_2yt_8geometry_18selection_routines_ChainedBooleanSelector, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_8geometry_18selection_routines_HaloParticlesSelector, /*tp_methods*/ + __pyx_methods_2yt_8geometry_18selection_routines_ChainedBooleanORSelector, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_2yt_8geometry_18selection_routines_HaloParticlesSelector, /*tp_getset*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_8geometry_18selection_routines_21HaloParticlesSelector_1__init__, /*tp_init*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_2yt_8geometry_18selection_routines_22ChainedBooleanSelector_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif 0, /*tp_alloc*/ - __pyx_tp_new_2yt_8geometry_18selection_routines_HaloParticlesSelector, /*tp_new*/ + __pyx_tp_new_2yt_8geometry_18selection_routines_ChainedBooleanORSelector, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -49876,7 +60531,7 @@ int e; struct __pyx_obj_2yt_8geometry_18selection_routines___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_2yt_8geometry_18selection_routines___pyx_scope_struct_1_genexpr *)o; if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_position) { e = (*v)(p->__pyx_v_position, a); if (e) return e; @@ -49978,7 +60633,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -50028,6 +60683,8 @@ 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} }; @@ -50147,7 +60804,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -50175,6 +60832,8 @@ } 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} }; @@ -50262,7 +60921,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -50374,6 +61033,8 @@ {"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} }; @@ -50499,7 +61160,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -50543,6 +61204,8 @@ } 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} }; @@ -50643,7 +61306,6 @@ {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1}, {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, {&__pyx_n_s_ActiveDimensions, __pyx_k_ActiveDimensions, sizeof(__pyx_k_ActiveDimensions), 0, 0, 1, 1}, - {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1}, {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, @@ -50652,11 +61314,12 @@ {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, {&__pyx_kp_s_Error_yt_attempted_to_read_outsi, __pyx_k_Error_yt_attempted_to_read_outsi, sizeof(__pyx_k_Error_yt_attempted_to_read_outsi), 0, 0, 1, 0}, - {&__pyx_kp_s_Expected_at_least_d_arguments, __pyx_k_Expected_at_least_d_arguments, sizeof(__pyx_k_Expected_at_least_d_arguments), 0, 0, 1, 0}, + {&__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_k_Expected_at_least_d_argument_s_g, sizeof(__pyx_k_Expected_at_least_d_argument_s_g), 0, 0, 1, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, {&__pyx_kp_s_Function_call_with_ambiguous_arg, __pyx_k_Function_call_with_ambiguous_arg, sizeof(__pyx_k_Function_call_with_ambiguous_arg), 0, 0, 1, 0}, {&__pyx_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}, @@ -50671,6 +61334,7 @@ {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__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_Region_right_edge_s_left_edge_wi, __pyx_k_Region_right_edge_s_left_edge_wi, sizeof(__pyx_k_Region_right_edge_s_left_edge_wi), 0, 0, 1, 0}, {&__pyx_n_s_RightEdge, __pyx_k_RightEdge, sizeof(__pyx_k_RightEdge), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, @@ -50679,13 +61343,16 @@ {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 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_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 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_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0}, + {&__pyx_kp_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 0}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_always, __pyx_k_always, sizeof(__pyx_k_always), 0, 0, 1, 1}, {&__pyx_n_s_always_selector, __pyx_k_always_selector, sizeof(__pyx_k_always_selector), 0, 0, 1, 1}, + {&__pyx_n_s_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, @@ -50696,14 +61363,18 @@ {&__pyx_n_s_base_selector, __pyx_k_base_selector, sizeof(__pyx_k_base_selector), 0, 0, 1, 1}, {&__pyx_n_s_base_source, __pyx_k_base_source, sizeof(__pyx_k_base_source), 0, 0, 1, 1}, {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_byteorder, __pyx_k_byteorder, sizeof(__pyx_k_byteorder), 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_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 1}, {&__pyx_kp_s_center_0, __pyx_k_center_0, sizeof(__pyx_k_center_0), 0, 0, 1, 0}, {&__pyx_kp_s_center_1, __pyx_k_center_1, sizeof(__pyx_k_center_1), 0, 0, 1, 0}, {&__pyx_kp_s_center_2, __pyx_k_center_2, sizeof(__pyx_k_center_2), 0, 0, 1, 0}, + {&__pyx_n_s_chained_and, __pyx_k_chained_and, sizeof(__pyx_k_chained_and), 0, 0, 1, 1}, + {&__pyx_n_s_chained_or, __pyx_k_chained_or, sizeof(__pyx_k_chained_or), 0, 0, 1, 1}, {&__pyx_n_s_child_mask, __pyx_k_child_mask, sizeof(__pyx_k_child_mask), 0, 0, 1, 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_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 0, 0, 1, 1}, {&__pyx_n_s_compose_selector, __pyx_k_compose_selector, sizeof(__pyx_k_compose_selector), 0, 0, 1, 1}, @@ -50728,10 +61399,14 @@ {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_d_2, __pyx_k_d_2, sizeof(__pyx_k_d_2), 0, 0, 1, 1}, {&__pyx_n_s_data_collection_selector, __pyx_k_data_collection_selector, sizeof(__pyx_k_data_collection_selector), 0, 0, 1, 1}, + {&__pyx_n_s_data_objects, __pyx_k_data_objects, sizeof(__pyx_k_data_objects), 0, 0, 1, 1}, {&__pyx_n_s_dds, __pyx_k_dds, sizeof(__pyx_k_dds), 0, 0, 1, 1}, {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_disk_selector, __pyx_k_disk_selector, sizeof(__pyx_k_disk_selector), 0, 0, 1, 1}, {&__pyx_n_s_dobj, __pyx_k_dobj, sizeof(__pyx_k_dobj), 0, 0, 1, 1}, + {&__pyx_n_s_dobj1, __pyx_k_dobj1, sizeof(__pyx_k_dobj1), 0, 0, 1, 1}, + {&__pyx_n_s_dobj2, __pyx_k_dobj2, sizeof(__pyx_k_dobj2), 0, 0, 1, 1}, {&__pyx_n_s_domain_id, __pyx_k_domain_id, sizeof(__pyx_k_domain_id), 0, 0, 1, 1}, {&__pyx_n_s_domain_left_edge, __pyx_k_domain_left_edge, sizeof(__pyx_k_domain_left_edge), 0, 0, 1, 1}, {&__pyx_n_s_domain_right_edge, __pyx_k_domain_right_edge, sizeof(__pyx_k_domain_right_edge), 0, 0, 1, 1}, @@ -50739,6 +61414,7 @@ {&__pyx_kp_s_domain_width_0, __pyx_k_domain_width_0, sizeof(__pyx_k_domain_width_0), 0, 0, 1, 0}, {&__pyx_kp_s_domain_width_1, __pyx_k_domain_width_1, sizeof(__pyx_k_domain_width_1), 0, 0, 1, 0}, {&__pyx_kp_s_domain_width_2, __pyx_k_domain_width_2, sizeof(__pyx_k_domain_width_2), 0, 0, 1, 0}, + {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, {&__pyx_n_s_ds, __pyx_k_ds, sizeof(__pyx_k_ds), 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}, @@ -50757,14 +61433,14 @@ {&__pyx_n_s_eps, __pyx_k_eps, sizeof(__pyx_k_eps), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, + {&__pyx_n_s_f_contiguous, __pyx_k_f_contiguous, sizeof(__pyx_k_f_contiguous), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_filter_bbox, __pyx_k_filter_bbox, sizeof(__pyx_k_filter_bbox), 0, 0, 1, 1}, {&__pyx_n_s_finfo, __pyx_k_finfo, sizeof(__pyx_k_finfo), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1}, {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, - {&__pyx_n_s_float32_t, __pyx_k_float32_t, sizeof(__pyx_k_float32_t), 0, 0, 1, 1}, {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, - {&__pyx_n_s_float64_t, __pyx_k_float64_t, sizeof(__pyx_k_float64_t), 0, 0, 1, 1}, {&__pyx_n_s_fmod, __pyx_k_fmod, sizeof(__pyx_k_fmod), 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}, @@ -50786,6 +61462,7 @@ {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, {&__pyx_n_s_init___locals_genexpr, __pyx_k_init___locals_genexpr, sizeof(__pyx_k_init___locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_intersection_selector, __pyx_k_intersection_selector, sizeof(__pyx_k_intersection_selector), 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}, @@ -50817,14 +61494,17 @@ {&__pyx_n_s_n_p, __pyx_k_n_p, sizeof(__pyx_k_n_p), 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_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1}, {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_neg, __pyx_k_neg, sizeof(__pyx_k_neg), 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_vec, __pyx_k_norm_vec, sizeof(__pyx_k_norm_vec), 0, 0, 1, 1}, {&__pyx_kp_s_norm_vec_0, __pyx_k_norm_vec_0, sizeof(__pyx_k_norm_vec_0), 0, 0, 1, 0}, {&__pyx_kp_s_norm_vec_1, __pyx_k_norm_vec_1, sizeof(__pyx_k_norm_vec_1), 0, 0, 1, 0}, {&__pyx_kp_s_norm_vec_2, __pyx_k_norm_vec_2, sizeof(__pyx_k_norm_vec_2), 0, 0, 1, 0}, + {&__pyx_n_s_not, __pyx_k_not, sizeof(__pyx_k_not), 0, 0, 1, 1}, {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, @@ -50832,10 +61512,12 @@ {&__pyx_n_s_nz, __pyx_k_nz, sizeof(__pyx_k_nz), 0, 0, 1, 1}, {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, {&__pyx_n_s_obj_ids, __pyx_k_obj_ids, sizeof(__pyx_k_obj_ids), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_octree, __pyx_k_octree, sizeof(__pyx_k_octree), 0, 0, 1, 1}, {&__pyx_n_s_octree_subset_selector, __pyx_k_octree_subset_selector, sizeof(__pyx_k_octree_subset_selector), 0, 0, 1, 1}, {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1}, + {&__pyx_n_s_or, __pyx_k_or, sizeof(__pyx_k_or), 0, 0, 1, 1}, {&__pyx_n_s_ortho_ray_selector, __pyx_k_ortho_ray_selector, sizeof(__pyx_k_ortho_ray_selector), 0, 0, 1, 1}, {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, {&__pyx_n_s_overlap_cells, __pyx_k_overlap_cells, sizeof(__pyx_k_overlap_cells), 0, 0, 1, 1}, @@ -50855,6 +61537,7 @@ {&__pyx_kp_s_periodicity_0, __pyx_k_periodicity_0, sizeof(__pyx_k_periodicity_0), 0, 0, 1, 0}, {&__pyx_kp_s_periodicity_1, __pyx_k_periodicity_1, sizeof(__pyx_k_periodicity_1), 0, 0, 1, 0}, {&__pyx_kp_s_periodicity_2, __pyx_k_periodicity_2, sizeof(__pyx_k_periodicity_2), 0, 0, 1, 0}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_point_selector, __pyx_k_point_selector, sizeof(__pyx_k_point_selector), 0, 0, 1, 1}, {&__pyx_n_s_points_in_cells, __pyx_k_points_in_cells, sizeof(__pyx_k_points_in_cells), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, @@ -50863,19 +61546,27 @@ {&__pyx_n_s_px_ax, __pyx_k_px_ax, sizeof(__pyx_k_px_ax), 0, 0, 1, 1}, {&__pyx_n_s_py, __pyx_k_py, sizeof(__pyx_k_py), 0, 0, 1, 1}, {&__pyx_n_s_py_ax, __pyx_k_py_ax, sizeof(__pyx_k_py_ax), 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_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_pz, __pyx_k_pz, sizeof(__pyx_k_pz), 0, 0, 1, 1}, {&__pyx_n_s_radius, __pyx_k_radius, sizeof(__pyx_k_radius), 0, 0, 1, 1}, {&__pyx_n_s_radius2, __pyx_k_radius2, sizeof(__pyx_k_radius2), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_ray_selector, __pyx_k_ray_selector, sizeof(__pyx_k_ray_selector), 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_region_selector, __pyx_k_region_selector, sizeof(__pyx_k_region_selector), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1}, {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 0, 0, 1, 1}, {&__pyx_kp_s_right_edge_0, __pyx_k_right_edge_0, sizeof(__pyx_k_right_edge_0), 0, 0, 1, 0}, {&__pyx_kp_s_right_edge_1, __pyx_k_right_edge_1, sizeof(__pyx_k_right_edge_1), 0, 0, 1, 0}, {&__pyx_kp_s_right_edge_2, __pyx_k_right_edge_2, sizeof(__pyx_k_right_edge_2), 0, 0, 1, 0}, {&__pyx_n_s_right_edges, __pyx_k_right_edges, sizeof(__pyx_k_right_edges), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_n_s_select_grids, __pyx_k_select_grids, sizeof(__pyx_k_select_grids), 0, 0, 1, 1}, {&__pyx_n_s_select_points, __pyx_k_select_points, sizeof(__pyx_k_select_points), 0, 0, 1, 1}, {&__pyx_n_s_selector, __pyx_k_selector, sizeof(__pyx_k_selector), 0, 0, 1, 1}, @@ -50883,6 +61574,7 @@ {&__pyx_n_s_selector2, __pyx_k_selector2, sizeof(__pyx_k_selector2), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_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_slice_selector, __pyx_k_slice_selector, sizeof(__pyx_k_slice_selector), 0, 0, 1, 1}, @@ -50895,6 +61587,8 @@ {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_strides, __pyx_k_strides, sizeof(__pyx_k_strides), 0, 0, 1, 1}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, @@ -50905,9 +61599,11 @@ {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_n_s_union_selector, __pyx_k_union_selector, sizeof(__pyx_k_union_selector), 0, 0, 1, 1}, {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 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_vals, __pyx_k_vals, sizeof(__pyx_k_vals), 0, 0, 1, 1}, {&__pyx_n_s_vec, __pyx_k_vec, sizeof(__pyx_k_vec), 0, 0, 1, 1}, {&__pyx_kp_s_vec_0, __pyx_k_vec_0, sizeof(__pyx_k_vec_0), 0, 0, 1, 0}, @@ -50924,27 +61620,29 @@ {&__pyx_kp_s_vec_2_2, __pyx_k_vec_2_2, sizeof(__pyx_k_vec_2_2), 0, 0, 1, 0}, {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_xor, __pyx_k_xor, sizeof(__pyx_k_xor), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_yt_geometry_selection_routines, __pyx_k_yt_geometry_selection_routines, sizeof(__pyx_k_yt_geometry_selection_routines), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_geometry_selection_routines_p, __pyx_k_yt_geometry_selection_routines_p, sizeof(__pyx_k_yt_geometry_selection_routines_p), 0, 0, 1, 0}, {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 77, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 119, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 635, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1000, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 146, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(3, 396, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(3, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(3, 818, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 627, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 989, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 218, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -50954,211 +61652,401 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "yt/geometry/selection_routines.pyx":166 + /* "yt/geometry/selection_routines.pyx":158 * RE[i] = right_edges[n, i] * gridi[n] = self.select_grid(LE, RE, levels[n, 0]) * return gridi.astype("bool") # <<<<<<<<<<<<<< * * def count_octs(self, OctreeContainer octree, int domain_id = -1): */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "yt/geometry/selection_routines.pyx":387 + /* "yt/geometry/selection_routines.pyx":379 * mask[i] = selected * if total == 0: return None * return mask.astype("bool") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "yt/geometry/selection_routines.pyx":422 + /* "yt/geometry/selection_routines.pyx":414 * mask[i] = selected * if total == 0: return None * return mask.astype("bool") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "yt/geometry/selection_routines.pyx":455 + /* "yt/geometry/selection_routines.pyx":447 * child_mask, mask, level) * if total == 0: return None * return mask.astype("bool") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "yt/geometry/selection_routines.pyx":553 + /* "yt/geometry/selection_routines.pyx":545 * @cython.wraparound(False) * @cython.cdivision(True) - * def count_points(self, np.ndarray[anyfloat, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] y, - * np.ndarray[anyfloat, ndim=1] z, - */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s__7); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 553, __pyx_L1_error) + * def count_points(self, np.ndarray[floating, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] y, + * np.ndarray[floating, ndim=1] z, + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s__7); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s__9); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - - /* "yt/geometry/selection_routines.pyx":581 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def select_points(self, np.ndarray[anyfloat, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] y, - * np.ndarray[anyfloat, ndim=1] z, - */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s__7); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 581, __pyx_L1_error) + + /* "yt/geometry/selection_routines.pyx":573 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def select_points(self, np.ndarray[floating, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] y, + * np.ndarray[floating, ndim=1] z, + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s__7); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s__9); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); - /* "yt/geometry/selection_routines.pyx":616 + /* "yt/geometry/selection_routines.pyx":608 * count += mask[i] * if count == 0: return None * return mask.view("bool") # <<<<<<<<<<<<<< * * def __hash__(self): */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); - /* "yt/geometry/selection_routines.pyx":625 + /* "yt/geometry/selection_routines.pyx":617 * for v in self._hash_vals() + self._base_hash(): * if isinstance(v, tuple): * hash_data.extend(v[0].encode('ascii')) # <<<<<<<<<<<<<< * hash_data.extend(repr(v[1]).encode('ascii')) * else: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); - /* "yt/geometry/selection_routines.pyx":626 + /* "yt/geometry/selection_routines.pyx":618 * if isinstance(v, tuple): * hash_data.extend(v[0].encode('ascii')) * hash_data.extend(repr(v[1]).encode('ascii')) # <<<<<<<<<<<<<< * else: * hash_data.extend(repr(v).encode('ascii')) */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); - /* "yt/geometry/selection_routines.pyx":628 + /* "yt/geometry/selection_routines.pyx":620 * hash_data.extend(repr(v[1]).encode('ascii')) * else: * hash_data.extend(repr(v).encode('ascii')) # <<<<<<<<<<<<<< * cdef np.int64_t hash_value = fnv_hash(hash_data) * self._hash = hash_value */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); - /* "yt/geometry/selection_routines.pyx":1251 + /* "(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__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "(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__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "(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__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "(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__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 4, __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(2, 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(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __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); + + /* "(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__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "(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__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "(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__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "(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__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 4, __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); + + /* "yt/geometry/selection_routines.pyx":1240 * total += 1 * if total == 0: return None * return mask.astype("bool") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 1240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); - /* "yt/geometry/selection_routines.pyx":1346 + /* "(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__37 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "(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__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "yt/geometry/selection_routines.pyx":1335 * total += 1 * if total == 0: return None * return mask.astype("bool") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 1335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); - /* "yt/geometry/selection_routines.pyx":1464 - * total += 1 + /* "(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__40 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "(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__41 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "yt/geometry/selection_routines.pyx":1455 + * free(ia) * if total == 0: return None * return mask.astype("bool") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); - /* "yt/geometry/selection_routines.pyx":1528 + /* "yt/geometry/selection_routines.pyx":1522 * raise NotImplementedError * cdef VolumeContainer vc * child_mask = np.ones((1,1,1), dtype="uint8") # <<<<<<<<<<<<<< * t = np.zeros((1,1,1), dtype="float64") * dt = np.zeros((1,1,1), dtype="float64") - 1 */ - __pyx_tuple__23 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_tuple__23); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__43 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 1522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_tuple__43); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 1522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); - /* "yt/geometry/selection_routines.pyx":1529 + /* "yt/geometry/selection_routines.pyx":1523 * cdef VolumeContainer vc * child_mask = np.ones((1,1,1), dtype="uint8") * t = np.zeros((1,1,1), dtype="float64") # <<<<<<<<<<<<<< * dt = np.zeros((1,1,1), dtype="float64") - 1 * tr = np.zeros(nz, dtype="float64") */ - __pyx_tuple__25 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_tuple__25); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__45 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_tuple__45); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); - /* "yt/geometry/selection_routines.pyx":1530 + /* "yt/geometry/selection_routines.pyx":1524 * child_mask = np.ones((1,1,1), dtype="uint8") * t = np.zeros((1,1,1), dtype="float64") * dt = np.zeros((1,1,1), dtype="float64") - 1 # <<<<<<<<<<<<<< * tr = np.zeros(nz, dtype="float64") * dtr = np.zeros(nz, dtype="float64") */ - __pyx_tuple__27 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_tuple__27); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__47 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 1524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_tuple__47); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 1524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + + /* "(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__49 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + + /* "(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__50 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); /* "yt/geometry/selection_routines.pyx":1645 * for n in range(self.nids): @@ -51167,9 +62055,9 @@ * * @cython.boundscheck(False) */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 1645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); /* "yt/geometry/selection_routines.pyx":1653 * cdef np.ndarray[np.uint8_t, ndim=3] mask @@ -51178,42 +62066,442 @@ * * def _hash_vals(self): */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 1653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + + /* "(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__53 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + + /* "(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__54 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + + /* "(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__55 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "(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__56 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); - /* "yt/geometry/selection_routines.pyx":1778 + /* "yt/geometry/selection_routines.pyx":1783 * cdef np.ndarray[np.uint8_t, ndim=1] gridi = np.zeros(ng, dtype='uint8') * gridi[self.ind] = 1 * return gridi.astype("bool") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 1783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + + /* "(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__58 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + + /* "(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__59 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + + /* "(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__60 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "(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__61 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + + /* "(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__62 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + + /* "(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__63 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); - /* "yt/geometry/selection_routines.pyx":1953 + /* "yt/geometry/selection_routines.pyx":1958 * cdef int ng = left_edges.shape[0] * cdef np.ndarray[np.uint8_t, ndim=1] gridi = np.ones(ng, dtype='uint8') * return gridi.astype("bool") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); - /* "yt/geometry/selection_routines.pyx":1977 + /* "yt/geometry/selection_routines.pyx":1982 * * def _hash_vals(self): * return ("always", 1,) # <<<<<<<<<<<<<< * * always_selector = AlwaysSelector */ - __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_always, __pyx_int_1); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 1977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_always, __pyx_int_1); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + + /* "(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__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); + + /* "(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); + + /* "(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__68 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + + /* "(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__69 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + + /* "(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__70 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + + /* "(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__71 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + + /* "(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__72 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + + /* "(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__73 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + + /* "yt/geometry/selection_routines.pyx":2155 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("and",) + # <<<<<<<<<<<<<< + * self.sel2._hash_vals()) + * + */ + __pyx_tuple__74 = PyTuple_Pack(1, __pyx_n_s_and); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 2155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + + /* "(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__75 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + + /* "(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__76 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + + /* "yt/geometry/selection_routines.pyx":2199 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("or",) + # <<<<<<<<<<<<<< + * self.sel2._hash_vals()) + * + */ + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_s_or); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 2199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + + /* "(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__78 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + + /* "(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__79 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + + /* "yt/geometry/selection_routines.pyx":2231 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("not",)) # <<<<<<<<<<<<<< + * + * cdef class BooleanXORSelector(BooleanSelector): + */ + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_n_s_not); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 2231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + + /* "(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__81 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + + /* "(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__82 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + + /* "yt/geometry/selection_routines.pyx":2266 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("xor",) + # <<<<<<<<<<<<<< + * self.sel2._hash_vals()) + * + */ + __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_s_xor); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 2266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + + /* "(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__84 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + + /* "(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__85 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + + /* "yt/geometry/selection_routines.pyx":2305 + * def _hash_vals(self): + * return (self.sel1._hash_vals() + + * ("neg",) + # <<<<<<<<<<<<<< + * self.sel2._hash_vals()) + * + */ + __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_s_neg); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 2305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + + /* "(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__87 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + + /* "(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__88 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + + /* "(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__89 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__89); + __Pyx_GIVEREF(__pyx_tuple__89); + + /* "(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__90 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + + /* "yt/geometry/selection_routines.pyx":2377 + * + * def _hash_vals(self): + * v = ("chained_and",) # <<<<<<<<<<<<<< + * for s in self.selectors: + * v += s._hash_vals() + */ + __pyx_tuple__91 = PyTuple_Pack(1, __pyx_n_s_chained_and); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 2377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + + /* "(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__92 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + + /* "(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__93 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + + /* "yt/geometry/selection_routines.pyx":2443 + * + * def _hash_vals(self): + * v = ("chained_or",) # <<<<<<<<<<<<<< + * for s in self.selectors: + * v += s._hash_vals() + */ + __pyx_tuple__94 = PyTuple_Pack(1, __pyx_n_s_chained_or); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 2443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + + /* "(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__95 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + + /* "(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__96 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -51222,9 +62510,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -51233,9 +62521,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -51244,9 +62532,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__99 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -51255,9 +62543,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -51266,9 +62554,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(2, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__101); + __Pyx_GIVEREF(__pyx_tuple__101); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -51277,9 +62565,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(2, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__102); + __Pyx_GIVEREF(__pyx_tuple__102); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -51288,9 +62576,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(3, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__103); + __Pyx_GIVEREF(__pyx_tuple__103); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -51299,29 +62587,29 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(3, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__104); + __Pyx_GIVEREF(__pyx_tuple__104); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(3, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__105); + __Pyx_GIVEREF(__pyx_tuple__105); - /* "yt/geometry/selection_routines.pxd":30 + /* "yt/geometry/selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_tuple__106 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(1, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__106); + __Pyx_GIVEREF(__pyx_tuple__106); /* "View.MemoryView":131 * @@ -51330,9 +62618,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(3, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(2, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__107); + __Pyx_GIVEREF(__pyx_tuple__107); /* "View.MemoryView":134 * @@ -51341,9 +62629,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(3, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(2, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__108); + __Pyx_GIVEREF(__pyx_tuple__108); /* "View.MemoryView":137 * @@ -51352,9 +62640,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(3, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_tuple__109 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__109); + __Pyx_GIVEREF(__pyx_tuple__109); /* "View.MemoryView":146 * @@ -51363,9 +62651,9 @@ * * */ - __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(3, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(2, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -51374,9 +62662,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(3, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(2, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__111); + __Pyx_GIVEREF(__pyx_tuple__111); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -51385,9 +62673,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(3, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(2, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__112); + __Pyx_GIVEREF(__pyx_tuple__112); + + /* "(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__113 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__113); + __Pyx_GIVEREF(__pyx_tuple__113); + + /* "(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__114 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__114); + __Pyx_GIVEREF(__pyx_tuple__114); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -51396,9 +62703,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(3, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(2, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__115); + __Pyx_GIVEREF(__pyx_tuple__115); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -51407,9 +62714,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(3, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__116); + __Pyx_GIVEREF(__pyx_tuple__116); /* "View.MemoryView":563 * def suboffsets(self): @@ -51418,12 +62725,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__52 = PyTuple_New(1); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(3, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__52); + __pyx_tuple__117 = PyTuple_New(1); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__117); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__52, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__52); + PyTuple_SET_ITEM(__pyx_tuple__117, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__117); + + /* "(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__118 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__118); + __Pyx_GIVEREF(__pyx_tuple__118); + + /* "(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__119 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__119); + __Pyx_GIVEREF(__pyx_tuple__119); /* "View.MemoryView":668 * if item is Ellipsis: @@ -51432,9 +62758,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__53 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__53)) __PYX_ERR(3, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__53); - __Pyx_GIVEREF(__pyx_slice__53); + __pyx_slice__120 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__120)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__120); + __Pyx_GIVEREF(__pyx_slice__120); /* "View.MemoryView":671 * seen_ellipsis = True @@ -51443,9 +62769,9 @@ * have_slices = True * else: */ - __pyx_slice__54 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__54)) __PYX_ERR(3, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__54); - __Pyx_GIVEREF(__pyx_slice__54); + __pyx_slice__121 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__121)) __PYX_ERR(2, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__121); + __Pyx_GIVEREF(__pyx_slice__121); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -51454,9 +62780,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__55 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__55)) __PYX_ERR(3, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__55); - __Pyx_GIVEREF(__pyx_slice__55); + __pyx_slice__122 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__122)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__122); + __Pyx_GIVEREF(__pyx_slice__122); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -51465,69 +62791,88 @@ * * */ - __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(3, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_tuple__123 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__123); + __Pyx_GIVEREF(__pyx_tuple__123); + + /* "(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__124 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__124); + __Pyx_GIVEREF(__pyx_tuple__124); + + /* "(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__125 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__125); + __Pyx_GIVEREF(__pyx_tuple__125); - /* "yt/geometry/selection_routines.pyx":71 + /* "yt/geometry/selection_routines.pyx":63 * @cython.wraparound(False) * @cython.cdivision(True) * def convert_mask_to_indices(np.ndarray[np.uint8_t, ndim=3, cast=True] mask, # <<<<<<<<<<<<<< * int count, int transpose = 0): * cdef int i, j, k, cpos */ - __pyx_tuple__57 = PyTuple_Pack(8, __pyx_n_s_mask, __pyx_n_s_count, __pyx_n_s_transpose, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_cpos, __pyx_n_s_indices); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 71, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__57); - __Pyx_GIVEREF(__pyx_tuple__57); - __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_convert_mask_to_indices, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_tuple__126 = PyTuple_Pack(8, __pyx_n_s_mask, __pyx_n_s_count, __pyx_n_s_transpose, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_cpos, __pyx_n_s_indices); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__126); + __Pyx_GIVEREF(__pyx_tuple__126); + __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_geometry_selection_routines_p, __pyx_n_s_convert_mask_to_indices, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 63, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":110 + /* "yt/geometry/selection_routines.pyx":102 * return count * * def mask_fill(np.ndarray[np.float64_t, ndim=1] out, # <<<<<<<<<<<<<< * np.int64_t offset, * np.ndarray[np.uint8_t, ndim=3, cast=True] mask, */ - __pyx_tuple__59 = PyTuple_Pack(4, __pyx_n_s_out, __pyx_n_s_offset, __pyx_n_s_mask, __pyx_n_s_vals); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__59); - __Pyx_GIVEREF(__pyx_tuple__59); - __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_mask_fill, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_tuple__128 = PyTuple_Pack(4, __pyx_n_s_out, __pyx_n_s_offset, __pyx_n_s_mask, __pyx_n_s_vals); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__128); + __Pyx_GIVEREF(__pyx_tuple__128); + __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_geometry_selection_routines_p, __pyx_n_s_mask_fill, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 102, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":553 + /* "yt/geometry/selection_routines.pyx":545 * @cython.wraparound(False) * @cython.cdivision(True) - * def count_points(self, np.ndarray[anyfloat, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] y, - * np.ndarray[anyfloat, ndim=1] z, - */ - __pyx_tuple__61 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_radius, __pyx_n_s_count, __pyx_n_s_i, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); - __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_count_points, 553, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 553, __pyx_L1_error) + * def count_points(self, np.ndarray[floating, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] y, + * np.ndarray[floating, ndim=1] z, + */ + __pyx_tuple__130 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_radius, __pyx_n_s_count, __pyx_n_s_i, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__130); + __Pyx_GIVEREF(__pyx_tuple__130); + __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_geometry_selection_routines_p, __pyx_n_s_count_points, 545, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 545, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":581 + /* "yt/geometry/selection_routines.pyx":573 * @cython.wraparound(False) * @cython.cdivision(True) - * def select_points(self, np.ndarray[anyfloat, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] y, - * np.ndarray[anyfloat, ndim=1] z, - */ - __pyx_tuple__63 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_radius, __pyx_n_s_count, __pyx_n_s_i, __pyx_n_s_pos, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__63); - __Pyx_GIVEREF(__pyx_tuple__63); - __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_select_points, 581, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 581, __pyx_L1_error) + * def select_points(self, np.ndarray[floating, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] y, + * np.ndarray[floating, ndim=1] z, + */ + __pyx_tuple__132 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_radius, __pyx_n_s_count, __pyx_n_s_i, __pyx_n_s_pos, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__132); + __Pyx_GIVEREF(__pyx_tuple__132); + __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_geometry_selection_routines_p, __pyx_n_s_select_points, 573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 573, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":2058 + /* "yt/geometry/selection_routines.pyx":2063 * @cython.boundscheck(False) * @cython.wraparound(False) * def points_in_cells( # <<<<<<<<<<<<<< * np.float64_t[:] cx, * np.float64_t[:] cy, */ - __pyx_tuple__65 = PyTuple_Pack(14, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_cz, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dz, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pz, __pyx_n_s_p, __pyx_n_s_c, __pyx_n_s_n_p, __pyx_n_s_n_c, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 2058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__65); - __Pyx_GIVEREF(__pyx_tuple__65); - __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(9, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_points_in_cells, 2058, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 2058, __pyx_L1_error) + __pyx_tuple__134 = PyTuple_Pack(14, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_cz, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dz, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pz, __pyx_n_s_p, __pyx_n_s_c, __pyx_n_s_n_p, __pyx_n_s_n_c, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 2063, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__134); + __Pyx_GIVEREF(__pyx_tuple__134); + __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(9, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_geometry_selection_routines_p, __pyx_n_s_points_in_cells, 2063, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 2063, __pyx_L1_error) /* "View.MemoryView":282 * return self.name @@ -51536,9 +62881,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(3, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__67); - __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_tuple__136 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__136); + __Pyx_GIVEREF(__pyx_tuple__136); /* "View.MemoryView":283 * @@ -51547,9 +62892,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(3, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_tuple__137 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(2, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__137); + __Pyx_GIVEREF(__pyx_tuple__137); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -51558,9 +62903,9 @@ * * */ - __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(3, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__69); - __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_tuple__138 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__138); + __Pyx_GIVEREF(__pyx_tuple__138); /* "View.MemoryView":287 * @@ -51569,9 +62914,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(3, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__70); - __Pyx_GIVEREF(__pyx_tuple__70); + __pyx_tuple__139 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__139); + __Pyx_GIVEREF(__pyx_tuple__139); /* "View.MemoryView":288 * @@ -51580,9 +62925,19 @@ * * */ - __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(3, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__71); - __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_tuple__140 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__140); + __Pyx_GIVEREF(__pyx_tuple__140); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__141 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__141); + __Pyx_GIVEREF(__pyx_tuple__141); + __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -51596,7 +62951,9 @@ __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_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_99 = PyInt_FromLong(99); if (unlikely(!__pyx_int_99)) __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:; @@ -51619,8 +62976,9 @@ PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_9; - static PyThread_type_lock __pyx_t_10[8]; + PyObject *__pyx_t_9 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_10; + static PyThread_type_lock __pyx_t_11[8]; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -51668,6 +63026,7 @@ __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 @@ -51712,10 +63071,11 @@ __pyx_vtable_2yt_8geometry_18selection_routines_SelectorObject.fill_mask_selector = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, PyArrayObject *, PyArrayObject *, int))__pyx_f_2yt_8geometry_18selection_routines_14SelectorObject_fill_mask_selector; __pyx_vtable_2yt_8geometry_18selection_routines_SelectorObject.visit_grid_cells = (void (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells *__pyx_optional_args))__pyx_f_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells; __pyx_vtable_2yt_8geometry_18selection_routines_SelectorObject.difference = (__pyx_t_5numpy_float64_t (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int))__pyx_f_2yt_8geometry_18selection_routines_14SelectorObject_difference; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_SelectorObject) < 0) __PYX_ERR(0, 121, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_SelectorObject) < 0) __PYX_ERR(0, 113, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_SelectorObject.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_SelectorObject.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject) < 0) __PYX_ERR(0, 121, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "SelectorObject", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_SelectorObject) < 0) __PYX_ERR(0, 121, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_SelectorObject.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject) < 0) __PYX_ERR(0, 113, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SelectorObject", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_SelectorObject) < 0) __PYX_ERR(0, 113, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_SelectorObject) < 0) __PYX_ERR(0, 113, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = &__pyx_type_2yt_8geometry_18selection_routines_SelectorObject; __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_AlwaysSelector; __pyx_vtable_2yt_8geometry_18selection_routines_AlwaysSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51725,10 +63085,11 @@ __pyx_vtable_2yt_8geometry_18selection_routines_AlwaysSelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_14AlwaysSelector_select_sphere; __pyx_vtable_2yt_8geometry_18selection_routines_AlwaysSelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_14AlwaysSelector_select_bbox; __pyx_type_2yt_8geometry_18selection_routines_AlwaysSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_AlwaysSelector) < 0) __PYX_ERR(0, 1939, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_AlwaysSelector) < 0) __PYX_ERR(0, 1944, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_AlwaysSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_AlwaysSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector) < 0) __PYX_ERR(0, 1939, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "AlwaysSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_AlwaysSelector) < 0) __PYX_ERR(0, 1939, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_AlwaysSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector) < 0) __PYX_ERR(0, 1944, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "AlwaysSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_AlwaysSelector) < 0) __PYX_ERR(0, 1944, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_AlwaysSelector) < 0) __PYX_ERR(0, 1944, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = &__pyx_type_2yt_8geometry_18selection_routines_AlwaysSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_OctreeSubsetSelector; __pyx_vtable_2yt_8geometry_18selection_routines_OctreeSubsetSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51738,21 +63099,32 @@ __pyx_vtable_2yt_8geometry_18selection_routines_OctreeSubsetSelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_select_sphere; __pyx_vtable_2yt_8geometry_18selection_routines_OctreeSubsetSelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_20OctreeSubsetSelector_select_bbox; __pyx_type_2yt_8geometry_18selection_routines_OctreeSubsetSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_OctreeSubsetSelector) < 0) __PYX_ERR(0, 1801, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_OctreeSubsetSelector) < 0) __PYX_ERR(0, 1806, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_OctreeSubsetSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_OctreeSubsetSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector) < 0) __PYX_ERR(0, 1801, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "OctreeSubsetSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_OctreeSubsetSelector) < 0) __PYX_ERR(0, 1801, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_OctreeSubsetSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector) < 0) __PYX_ERR(0, 1806, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "OctreeSubsetSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_OctreeSubsetSelector) < 0) __PYX_ERR(0, 1806, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_OctreeSubsetSelector) < 0) __PYX_ERR(0, 1806, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = &__pyx_type_2yt_8geometry_18selection_routines_OctreeSubsetSelector; + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_BooleanSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; + __pyx_type_2yt_8geometry_18selection_routines_BooleanSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_BooleanSelector) < 0) __PYX_ERR(0, 2100, __pyx_L1_error) + __pyx_type_2yt_8geometry_18selection_routines_BooleanSelector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_BooleanSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector) < 0) __PYX_ERR(0, 2100, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "BooleanSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_BooleanSelector) < 0) __PYX_ERR(0, 2100, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_BooleanSelector) < 0) __PYX_ERR(0, 2100, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = &__pyx_type_2yt_8geometry_18selection_routines_BooleanSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_PointSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_PointSelector; __pyx_vtable_2yt_8geometry_18selection_routines_PointSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; __pyx_vtable_2yt_8geometry_18selection_routines_PointSelector.__pyx_base.select_cell = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_13PointSelector_select_cell; __pyx_vtable_2yt_8geometry_18selection_routines_PointSelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_13PointSelector_select_sphere; __pyx_vtable_2yt_8geometry_18selection_routines_PointSelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_13PointSelector_select_bbox; __pyx_type_2yt_8geometry_18selection_routines_PointSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_PointSelector) < 0) __PYX_ERR(0, 649, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_PointSelector) < 0) __PYX_ERR(0, 641, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_PointSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_PointSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_PointSelector) < 0) __PYX_ERR(0, 649, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "PointSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_PointSelector) < 0) __PYX_ERR(0, 649, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_PointSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_PointSelector) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "PointSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_PointSelector) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_PointSelector) < 0) __PYX_ERR(0, 641, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_PointSelector = &__pyx_type_2yt_8geometry_18selection_routines_PointSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_SphereSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_SphereSelector; __pyx_vtable_2yt_8geometry_18selection_routines_SphereSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51761,10 +63133,11 @@ __pyx_vtable_2yt_8geometry_18selection_routines_SphereSelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_14SphereSelector_select_sphere; __pyx_vtable_2yt_8geometry_18selection_routines_SphereSelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_14SphereSelector_select_bbox; __pyx_type_2yt_8geometry_18selection_routines_SphereSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_SphereSelector) < 0) __PYX_ERR(0, 706, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_SphereSelector) < 0) __PYX_ERR(0, 698, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_SphereSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_SphereSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_SphereSelector) < 0) __PYX_ERR(0, 706, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "SphereSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_SphereSelector) < 0) __PYX_ERR(0, 706, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_SphereSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_SphereSelector) < 0) __PYX_ERR(0, 698, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SphereSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_SphereSelector) < 0) __PYX_ERR(0, 698, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_SphereSelector) < 0) __PYX_ERR(0, 698, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_SphereSelector = &__pyx_type_2yt_8geometry_18selection_routines_SphereSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_RegionSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_RegionSelector; __pyx_vtable_2yt_8geometry_18selection_routines_RegionSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51773,10 +63146,11 @@ __pyx_vtable_2yt_8geometry_18selection_routines_RegionSelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_14RegionSelector_select_bbox; __pyx_vtable_2yt_8geometry_18selection_routines_RegionSelector.__pyx_base.fill_mask_selector = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, PyArrayObject *, PyArrayObject *, int))__pyx_f_2yt_8geometry_18selection_routines_14RegionSelector_fill_mask_selector; __pyx_type_2yt_8geometry_18selection_routines_RegionSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_RegionSelector) < 0) __PYX_ERR(0, 808, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_RegionSelector) < 0) __PYX_ERR(0, 800, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_RegionSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_RegionSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_RegionSelector) < 0) __PYX_ERR(0, 808, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "RegionSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_RegionSelector) < 0) __PYX_ERR(0, 808, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_RegionSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_RegionSelector) < 0) __PYX_ERR(0, 800, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "RegionSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_RegionSelector) < 0) __PYX_ERR(0, 800, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_RegionSelector) < 0) __PYX_ERR(0, 800, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_RegionSelector = &__pyx_type_2yt_8geometry_18selection_routines_RegionSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_CutRegionSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_CutRegionSelector; __pyx_vtable_2yt_8geometry_18selection_routines_CutRegionSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51785,10 +63159,11 @@ __pyx_vtable_2yt_8geometry_18selection_routines_CutRegionSelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_17CutRegionSelector_select_sphere; __pyx_vtable_2yt_8geometry_18selection_routines_CutRegionSelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_17CutRegionSelector_select_bbox; __pyx_type_2yt_8geometry_18selection_routines_CutRegionSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_CutRegionSelector) < 0) __PYX_ERR(0, 972, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_CutRegionSelector) < 0) __PYX_ERR(0, 961, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_CutRegionSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_CutRegionSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_CutRegionSelector) < 0) __PYX_ERR(0, 972, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "CutRegionSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_CutRegionSelector) < 0) __PYX_ERR(0, 972, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_CutRegionSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_CutRegionSelector) < 0) __PYX_ERR(0, 961, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "CutRegionSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_CutRegionSelector) < 0) __PYX_ERR(0, 961, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_CutRegionSelector) < 0) __PYX_ERR(0, 961, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_CutRegionSelector = &__pyx_type_2yt_8geometry_18selection_routines_CutRegionSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_DiskSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_DiskSelector; __pyx_vtable_2yt_8geometry_18selection_routines_DiskSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51797,10 +63172,11 @@ __pyx_vtable_2yt_8geometry_18selection_routines_DiskSelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_12DiskSelector_select_sphere; __pyx_vtable_2yt_8geometry_18selection_routines_DiskSelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_12DiskSelector_select_bbox; __pyx_type_2yt_8geometry_18selection_routines_DiskSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_DiskSelector) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_DiskSelector) < 0) __PYX_ERR(0, 995, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_DiskSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_DiskSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_DiskSelector) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "DiskSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_DiskSelector) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_DiskSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_DiskSelector) < 0) __PYX_ERR(0, 995, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "DiskSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_DiskSelector) < 0) __PYX_ERR(0, 995, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_DiskSelector) < 0) __PYX_ERR(0, 995, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_DiskSelector = &__pyx_type_2yt_8geometry_18selection_routines_DiskSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_CuttingPlaneSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_CuttingPlaneSelector; __pyx_vtable_2yt_8geometry_18selection_routines_CuttingPlaneSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51809,10 +63185,11 @@ __pyx_vtable_2yt_8geometry_18selection_routines_CuttingPlaneSelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_select_sphere; __pyx_vtable_2yt_8geometry_18selection_routines_CuttingPlaneSelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_20CuttingPlaneSelector_select_bbox; __pyx_type_2yt_8geometry_18selection_routines_CuttingPlaneSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_CuttingPlaneSelector) < 0) __PYX_ERR(0, 1121, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_CuttingPlaneSelector) < 0) __PYX_ERR(0, 1110, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_CuttingPlaneSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_CuttingPlaneSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_CuttingPlaneSelector) < 0) __PYX_ERR(0, 1121, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "CuttingPlaneSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_CuttingPlaneSelector) < 0) __PYX_ERR(0, 1121, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_CuttingPlaneSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_CuttingPlaneSelector) < 0) __PYX_ERR(0, 1110, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "CuttingPlaneSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_CuttingPlaneSelector) < 0) __PYX_ERR(0, 1110, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_CuttingPlaneSelector) < 0) __PYX_ERR(0, 1110, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_CuttingPlaneSelector = &__pyx_type_2yt_8geometry_18selection_routines_CuttingPlaneSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_SliceSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_SliceSelector; __pyx_vtable_2yt_8geometry_18selection_routines_SliceSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51821,10 +63198,11 @@ __pyx_vtable_2yt_8geometry_18selection_routines_SliceSelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_13SliceSelector_select_sphere; __pyx_vtable_2yt_8geometry_18selection_routines_SliceSelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_13SliceSelector_select_bbox; __pyx_type_2yt_8geometry_18selection_routines_SliceSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_SliceSelector) < 0) __PYX_ERR(0, 1201, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_SliceSelector) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_SliceSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_SliceSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_SliceSelector) < 0) __PYX_ERR(0, 1201, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "SliceSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_SliceSelector) < 0) __PYX_ERR(0, 1201, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_SliceSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_SliceSelector) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SliceSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_SliceSelector) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_SliceSelector) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_SliceSelector = &__pyx_type_2yt_8geometry_18selection_routines_SliceSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_OrthoRaySelector = &__pyx_vtable_2yt_8geometry_18selection_routines_OrthoRaySelector; __pyx_vtable_2yt_8geometry_18selection_routines_OrthoRaySelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51833,10 +63211,11 @@ __pyx_vtable_2yt_8geometry_18selection_routines_OrthoRaySelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_16OrthoRaySelector_select_sphere; __pyx_vtable_2yt_8geometry_18selection_routines_OrthoRaySelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_16OrthoRaySelector_select_bbox; __pyx_type_2yt_8geometry_18selection_routines_OrthoRaySelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_OrthoRaySelector) < 0) __PYX_ERR(0, 1290, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_OrthoRaySelector) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_OrthoRaySelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_OrthoRaySelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_OrthoRaySelector) < 0) __PYX_ERR(0, 1290, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "OrthoRaySelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_OrthoRaySelector) < 0) __PYX_ERR(0, 1290, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_OrthoRaySelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_OrthoRaySelector) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "OrthoRaySelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_OrthoRaySelector) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_OrthoRaySelector) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_OrthoRaySelector = &__pyx_type_2yt_8geometry_18selection_routines_OrthoRaySelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_RaySelector = &__pyx_vtable_2yt_8geometry_18selection_routines_RaySelector; __pyx_vtable_2yt_8geometry_18selection_routines_RaySelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51845,10 +63224,11 @@ __pyx_vtable_2yt_8geometry_18selection_routines_RaySelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_11RaySelector_select_sphere; __pyx_vtable_2yt_8geometry_18selection_routines_RaySelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_11RaySelector_select_bbox; __pyx_type_2yt_8geometry_18selection_routines_RaySelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_RaySelector) < 0) __PYX_ERR(0, 1414, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_RaySelector) < 0) __PYX_ERR(0, 1403, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_RaySelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_RaySelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_RaySelector) < 0) __PYX_ERR(0, 1414, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "RaySelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_RaySelector) < 0) __PYX_ERR(0, 1414, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_RaySelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_RaySelector) < 0) __PYX_ERR(0, 1403, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "RaySelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_RaySelector) < 0) __PYX_ERR(0, 1403, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_RaySelector) < 0) __PYX_ERR(0, 1403, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_RaySelector = &__pyx_type_2yt_8geometry_18selection_routines_RaySelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_DataCollectionSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_DataCollectionSelector; __pyx_vtable_2yt_8geometry_18selection_routines_DataCollectionSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51857,6 +63237,7 @@ __pyx_type_2yt_8geometry_18selection_routines_DataCollectionSelector.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_DataCollectionSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_DataCollectionSelector) < 0) __PYX_ERR(0, 1623, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "DataCollectionSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_DataCollectionSelector) < 0) __PYX_ERR(0, 1623, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_DataCollectionSelector) < 0) __PYX_ERR(0, 1623, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_DataCollectionSelector = &__pyx_type_2yt_8geometry_18selection_routines_DataCollectionSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_EllipsoidSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_EllipsoidSelector; __pyx_vtable_2yt_8geometry_18selection_routines_EllipsoidSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51869,16 +63250,18 @@ __pyx_type_2yt_8geometry_18selection_routines_EllipsoidSelector.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_EllipsoidSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_EllipsoidSelector) < 0) __PYX_ERR(0, 1660, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "EllipsoidSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_EllipsoidSelector) < 0) __PYX_ERR(0, 1660, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_EllipsoidSelector) < 0) __PYX_ERR(0, 1660, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_EllipsoidSelector = &__pyx_type_2yt_8geometry_18selection_routines_EllipsoidSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_GridSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_GridSelector; __pyx_vtable_2yt_8geometry_18selection_routines_GridSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; __pyx_vtable_2yt_8geometry_18selection_routines_GridSelector.__pyx_base.select_cell = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_12GridSelector_select_cell; __pyx_vtable_2yt_8geometry_18selection_routines_GridSelector.__pyx_base.select_point = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_12GridSelector_select_point; __pyx_type_2yt_8geometry_18selection_routines_GridSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_GridSelector) < 0) __PYX_ERR(0, 1762, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_GridSelector) < 0) __PYX_ERR(0, 1767, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_GridSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_GridSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_GridSelector) < 0) __PYX_ERR(0, 1762, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "GridSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_GridSelector) < 0) __PYX_ERR(0, 1762, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_GridSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_GridSelector) < 0) __PYX_ERR(0, 1767, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "GridSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_GridSelector) < 0) __PYX_ERR(0, 1767, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_GridSelector) < 0) __PYX_ERR(0, 1767, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_GridSelector = &__pyx_type_2yt_8geometry_18selection_routines_GridSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector; __pyx_vtable_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51888,10 +63271,11 @@ __pyx_vtable_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_select_sphere; __pyx_vtable_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_27IndexedOctreeSubsetSelector_select_bbox; __pyx_type_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector) < 0) __PYX_ERR(0, 1865, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector) < 0) __PYX_ERR(0, 1870, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector) < 0) __PYX_ERR(0, 1865, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "IndexedOctreeSubsetSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector) < 0) __PYX_ERR(0, 1865, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector) < 0) __PYX_ERR(0, 1870, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "IndexedOctreeSubsetSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector) < 0) __PYX_ERR(0, 1870, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector) < 0) __PYX_ERR(0, 1870, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector = &__pyx_type_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_ComposeSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_ComposeSelector; __pyx_vtable_2yt_8geometry_18selection_routines_ComposeSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; @@ -51901,33 +63285,144 @@ __pyx_vtable_2yt_8geometry_18selection_routines_ComposeSelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_15ComposeSelector_select_sphere; __pyx_vtable_2yt_8geometry_18selection_routines_ComposeSelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_15ComposeSelector_select_bbox; __pyx_type_2yt_8geometry_18selection_routines_ComposeSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_ComposeSelector) < 0) __PYX_ERR(0, 1981, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_ComposeSelector) < 0) __PYX_ERR(0, 1986, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_ComposeSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_ComposeSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_ComposeSelector) < 0) __PYX_ERR(0, 1981, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "ComposeSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_ComposeSelector) < 0) __PYX_ERR(0, 1981, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_ComposeSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_ComposeSelector) < 0) __PYX_ERR(0, 1986, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ComposeSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_ComposeSelector) < 0) __PYX_ERR(0, 1986, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_ComposeSelector) < 0) __PYX_ERR(0, 1986, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_ComposeSelector = &__pyx_type_2yt_8geometry_18selection_routines_ComposeSelector; __pyx_vtabptr_2yt_8geometry_18selection_routines_HaloParticlesSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_HaloParticlesSelector; __pyx_vtable_2yt_8geometry_18selection_routines_HaloParticlesSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; __pyx_type_2yt_8geometry_18selection_routines_HaloParticlesSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_HaloParticlesSelector) < 0) __PYX_ERR(0, 2040, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_HaloParticlesSelector) < 0) __PYX_ERR(0, 2045, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines_HaloParticlesSelector.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_HaloParticlesSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_HaloParticlesSelector) < 0) __PYX_ERR(0, 2040, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "HaloParticlesSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_HaloParticlesSelector) < 0) __PYX_ERR(0, 2040, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_HaloParticlesSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_HaloParticlesSelector) < 0) __PYX_ERR(0, 2045, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "HaloParticlesSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_HaloParticlesSelector) < 0) __PYX_ERR(0, 2045, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_HaloParticlesSelector) < 0) __PYX_ERR(0, 2045, __pyx_L1_error) __pyx_ptype_2yt_8geometry_18selection_routines_HaloParticlesSelector = &__pyx_type_2yt_8geometry_18selection_routines_HaloParticlesSelector; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines___pyx_scope_struct____init__) < 0) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanANDSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_BooleanANDSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanANDSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanANDSelector.__pyx_base.__pyx_base.select_grid = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid *__pyx_optional_args))__pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_grid; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanANDSelector.__pyx_base.__pyx_base.select_cell = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_cell; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanANDSelector.__pyx_base.__pyx_base.select_point = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_point; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanANDSelector.__pyx_base.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_sphere; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanANDSelector.__pyx_base.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_18BooleanANDSelector_select_bbox; + __pyx_type_2yt_8geometry_18selection_routines_BooleanANDSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector; + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_BooleanANDSelector) < 0) __PYX_ERR(0, 2114, __pyx_L1_error) + __pyx_type_2yt_8geometry_18selection_routines_BooleanANDSelector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_BooleanANDSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanANDSelector) < 0) __PYX_ERR(0, 2114, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "BooleanANDSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_BooleanANDSelector) < 0) __PYX_ERR(0, 2114, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_BooleanANDSelector) < 0) __PYX_ERR(0, 2114, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanANDSelector = &__pyx_type_2yt_8geometry_18selection_routines_BooleanANDSelector; + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanORSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_BooleanORSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanORSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanORSelector.__pyx_base.__pyx_base.select_grid = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid *__pyx_optional_args))__pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_grid; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanORSelector.__pyx_base.__pyx_base.select_cell = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_cell; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanORSelector.__pyx_base.__pyx_base.select_point = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_point; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanORSelector.__pyx_base.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_sphere; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanORSelector.__pyx_base.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_17BooleanORSelector_select_bbox; + __pyx_type_2yt_8geometry_18selection_routines_BooleanORSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector; + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_BooleanORSelector) < 0) __PYX_ERR(0, 2158, __pyx_L1_error) + __pyx_type_2yt_8geometry_18selection_routines_BooleanORSelector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_BooleanORSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanORSelector) < 0) __PYX_ERR(0, 2158, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "BooleanORSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_BooleanORSelector) < 0) __PYX_ERR(0, 2158, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_BooleanORSelector) < 0) __PYX_ERR(0, 2158, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanORSelector = &__pyx_type_2yt_8geometry_18selection_routines_BooleanORSelector; + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanNOTSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_BooleanNOTSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNOTSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNOTSelector.__pyx_base.__pyx_base.select_grid = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid *__pyx_optional_args))__pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_grid; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNOTSelector.__pyx_base.__pyx_base.select_cell = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_cell; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNOTSelector.__pyx_base.__pyx_base.select_point = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_point; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNOTSelector.__pyx_base.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_sphere; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNOTSelector.__pyx_base.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_18BooleanNOTSelector_select_bbox; + __pyx_type_2yt_8geometry_18selection_routines_BooleanNOTSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector; + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_BooleanNOTSelector) < 0) __PYX_ERR(0, 2202, __pyx_L1_error) + __pyx_type_2yt_8geometry_18selection_routines_BooleanNOTSelector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_BooleanNOTSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanNOTSelector) < 0) __PYX_ERR(0, 2202, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "BooleanNOTSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_BooleanNOTSelector) < 0) __PYX_ERR(0, 2202, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_BooleanNOTSelector) < 0) __PYX_ERR(0, 2202, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanNOTSelector = &__pyx_type_2yt_8geometry_18selection_routines_BooleanNOTSelector; + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanXORSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_BooleanXORSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanXORSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanXORSelector.__pyx_base.__pyx_base.select_grid = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid *__pyx_optional_args))__pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_grid; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanXORSelector.__pyx_base.__pyx_base.select_cell = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_cell; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanXORSelector.__pyx_base.__pyx_base.select_point = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_point; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanXORSelector.__pyx_base.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_sphere; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanXORSelector.__pyx_base.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_18BooleanXORSelector_select_bbox; + __pyx_type_2yt_8geometry_18selection_routines_BooleanXORSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector; + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_BooleanXORSelector) < 0) __PYX_ERR(0, 2233, __pyx_L1_error) + __pyx_type_2yt_8geometry_18selection_routines_BooleanXORSelector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_BooleanXORSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanXORSelector) < 0) __PYX_ERR(0, 2233, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "BooleanXORSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_BooleanXORSelector) < 0) __PYX_ERR(0, 2233, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_BooleanXORSelector) < 0) __PYX_ERR(0, 2233, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanXORSelector = &__pyx_type_2yt_8geometry_18selection_routines_BooleanXORSelector; + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanNEGSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_BooleanNEGSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNEGSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNEGSelector.__pyx_base.__pyx_base.select_grid = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid *__pyx_optional_args))__pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_grid; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNEGSelector.__pyx_base.__pyx_base.select_cell = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_cell; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNEGSelector.__pyx_base.__pyx_base.select_point = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_point; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNEGSelector.__pyx_base.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_sphere; + __pyx_vtable_2yt_8geometry_18selection_routines_BooleanNEGSelector.__pyx_base.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_18BooleanNEGSelector_select_bbox; + __pyx_type_2yt_8geometry_18selection_routines_BooleanNEGSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector; + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_BooleanNEGSelector) < 0) __PYX_ERR(0, 2269, __pyx_L1_error) + __pyx_type_2yt_8geometry_18selection_routines_BooleanNEGSelector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_BooleanNEGSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanNEGSelector) < 0) __PYX_ERR(0, 2269, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "BooleanNEGSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_BooleanNEGSelector) < 0) __PYX_ERR(0, 2269, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_BooleanNEGSelector) < 0) __PYX_ERR(0, 2269, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanNEGSelector = &__pyx_type_2yt_8geometry_18selection_routines_BooleanNEGSelector; + __pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; + __pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject; + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanSelector) < 0) __PYX_ERR(0, 2308, __pyx_L1_error) + __pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanSelector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanSelector) < 0) __PYX_ERR(0, 2308, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ChainedBooleanSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanSelector) < 0) __PYX_ERR(0, 2308, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanSelector) < 0) __PYX_ERR(0, 2308, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_ChainedBooleanSelector = &__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanSelector; + __pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector.__pyx_base.__pyx_base.select_grid = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid *__pyx_optional_args))__pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_grid; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector.__pyx_base.__pyx_base.select_cell = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_cell; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector.__pyx_base.__pyx_base.select_point = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_point; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector.__pyx_base.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_sphere; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector.__pyx_base.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_25ChainedBooleanANDSelector_select_bbox; + __pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_ChainedBooleanSelector; + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector) < 0) __PYX_ERR(0, 2318, __pyx_L1_error) + __pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector) < 0) __PYX_ERR(0, 2318, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ChainedBooleanANDSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector) < 0) __PYX_ERR(0, 2318, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector) < 0) __PYX_ERR(0, 2318, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector = &__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector; + __pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanORSelector = &__pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanORSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanORSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanSelector; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanORSelector.__pyx_base.__pyx_base.select_grid = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid *__pyx_optional_args))__pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_grid; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanORSelector.__pyx_base.__pyx_base.select_cell = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_cell; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanORSelector.__pyx_base.__pyx_base.select_point = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_point; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanORSelector.__pyx_base.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_sphere; + __pyx_vtable_2yt_8geometry_18selection_routines_ChainedBooleanORSelector.__pyx_base.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_8geometry_18selection_routines_24ChainedBooleanORSelector_select_bbox; + __pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanORSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_ChainedBooleanSelector; + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanORSelector) < 0) __PYX_ERR(0, 2384, __pyx_L1_error) + __pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanORSelector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanORSelector.tp_dict, __pyx_vtabptr_2yt_8geometry_18selection_routines_ChainedBooleanORSelector) < 0) __PYX_ERR(0, 2384, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ChainedBooleanORSelector", (PyObject *)&__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanORSelector) < 0) __PYX_ERR(0, 2384, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanORSelector) < 0) __PYX_ERR(0, 2384, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_ChainedBooleanORSelector = &__pyx_type_2yt_8geometry_18selection_routines_ChainedBooleanORSelector; + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines___pyx_scope_struct____init__) < 0) __PYX_ERR(0, 965, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines___pyx_scope_struct____init__.tp_print = 0; __pyx_ptype_2yt_8geometry_18selection_routines___pyx_scope_struct____init__ = &__pyx_type_2yt_8geometry_18selection_routines___pyx_scope_struct____init__; - if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 979, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_8geometry_18selection_routines___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 968, __pyx_L1_error) __pyx_type_2yt_8geometry_18selection_routines___pyx_scope_struct_1_genexpr.tp_print = 0; __pyx_ptype_2yt_8geometry_18selection_routines___pyx_scope_struct_1_genexpr = &__pyx_type_2yt_8geometry_18selection_routines___pyx_scope_struct_1_genexpr; __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(3, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(3, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(3, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __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; @@ -51937,18 +63432,20 @@ __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(3, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(3, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -51958,11 +63455,11 @@ sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(4, 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, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 861, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = __Pyx_ImportType("yt.geometry.oct_visitors", "OctVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(5, 33, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(5, 33, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = __Pyx_ImportType("yt.geometry.oct_visitors", "CountTotalOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts)) __PYX_ERR(5, 59, __pyx_L1_error) @@ -52001,26 +63498,30 @@ __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(5, 114, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType("yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(5, 117, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(5, 117, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(6, 57, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(6, 57, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(6, 89, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(6, 89, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(6, 97, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(6, 97, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = __Pyx_ImportType("yt.utilities.lib.partitioned_grid", "PartitionedGrid", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(7, 22, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(7, 22, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ImageSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(8, 39, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(8, 39, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(8, 60, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(8, 60, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "InterpolatedProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(8, 63, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(8, 63, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "VolumeRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(8, 68, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(8, 68, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "LightSourceRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(8, 75, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(8, 75, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray = __Pyx_ImportType("yt.utilities.lib.bitarray", "bitarray", sizeof(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray)) __PYX_ERR(9, 30, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray = (struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray)) __PYX_ERR(9, 30, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = __Pyx_ImportType("yt.utilities.lib.allocation_container", "ObjectPool", sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(6, 26, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(6, 26, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = __Pyx_ImportType("yt.geometry.oct_container", "OctObjectPool", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(7, 55, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(7, 55, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(7, 63, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(7, 63, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(7, 94, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(7, 94, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(7, 102, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(7, 102, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = __Pyx_ImportType("yt.utilities.lib.partitioned_grid", "PartitionedGrid", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(8, 22, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(8, 22, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ImageSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(9, 42, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(9, 42, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(9, 75, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(9, 75, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "InterpolatedProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(9, 78, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(9, 78, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "VolumeRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(9, 83, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(9, 83, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "LightSourceRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(9, 89, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(9, 89, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray = __Pyx_ImportType("yt.utilities.lib.bitarray", "bitarray", sizeof(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray)) __PYX_ERR(10, 30, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray = (struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray)) __PYX_ERR(10, 30, __pyx_L1_error) /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportVoidPtr(__pyx_t_1, "ORDER_MAX", (void **)&__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -52029,9 +63530,12 @@ __pyx_t_2 = __Pyx_ImportModule("yt.geometry.grid_visitors"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_2, "check_child_masked", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked, "__pyx_t_5numpy_uint8_t (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_ImportModule("yt.utilities.lib.grid_traversal"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_3, "walk_volume", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume, "int (struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_2yt_9utilities_3lib_14grid_traversal_sampler_function *, void *, struct __pyx_opt_args_2yt_9utilities_3lib_14grid_traversal_walk_volume *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportModule("yt.utilities.lib.fnv_hash"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_3, "c_fnv_hash", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_8fnv_hash_c_fnv_hash, "__pyx_t_5numpy_int64_t (__Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_ImportModule("yt.utilities.lib.grid_traversal"); if (!__pyx_t_4) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_4, "walk_volume", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume, "int (struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_2yt_9utilities_3lib_14grid_traversal_sampler_function *, void *, struct __pyx_opt_args_2yt_9utilities_3lib_14grid_traversal_walk_volume *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -52044,241 +63548,241 @@ * cimport numpy as np * cimport cython */ - __pyx_t_4 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_4) < 0) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_5) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/selection_routines.pyx":44 + /* "yt/geometry/selection_routines.pyx":46 * # use this as an epsilon test for grids aligned with selector * # define here to avoid the gil later * cdef np.float64_t grid_eps = np.finfo(np.float64).eps # <<<<<<<<<<<<<< * grid_eps = 0.0 * */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_finfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_finfo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - if (!__pyx_t_5) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_4); + if (!__pyx_t_6) { + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_6)) { - PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_8}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { - PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_8}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __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_7); - PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_eps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_9 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_2yt_8geometry_18selection_routines_grid_eps = __pyx_t_9; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_eps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_10 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_2yt_8geometry_18selection_routines_grid_eps = __pyx_t_10; - /* "yt/geometry/selection_routines.pyx":45 + /* "yt/geometry/selection_routines.pyx":47 * # define here to avoid the gil later * cdef np.float64_t grid_eps = np.finfo(np.float64).eps * grid_eps = 0.0 # <<<<<<<<<<<<<< * - * cdef np.int64_t fnv_hash(unsigned char[:] octets): + * # These routines are separated into a couple different categories: */ __pyx_v_2yt_8geometry_18selection_routines_grid_eps = 0.0; - /* "yt/geometry/selection_routines.pyx":71 + /* "yt/geometry/selection_routines.pyx":63 * @cython.wraparound(False) * @cython.cdivision(True) * def convert_mask_to_indices(np.ndarray[np.uint8_t, ndim=3, cast=True] mask, # <<<<<<<<<<<<<< * int count, int transpose = 0): * cdef int i, j, k, cpos */ - __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_18selection_routines_1convert_mask_to_indices, NULL, __pyx_n_s_yt_geometry_selection_routines); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 71, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_mask_to_indices, __pyx_t_6) < 0) __PYX_ERR(0, 71, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_18selection_routines_1convert_mask_to_indices, NULL, __pyx_n_s_yt_geometry_selection_routines); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_mask_to_indices, __pyx_t_7) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/selection_routines.pyx":110 + /* "yt/geometry/selection_routines.pyx":102 * return count * * def mask_fill(np.ndarray[np.float64_t, ndim=1] out, # <<<<<<<<<<<<<< * np.int64_t offset, * np.ndarray[np.uint8_t, ndim=3, cast=True] mask, */ - __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_18selection_routines_3mask_fill, NULL, __pyx_n_s_yt_geometry_selection_routines); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_mask_fill, __pyx_t_6) < 0) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_18selection_routines_3mask_fill, NULL, __pyx_n_s_yt_geometry_selection_routines); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mask_fill, __pyx_t_7) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/geometry/selection_routines.pyx":553 + /* "yt/geometry/selection_routines.pyx":545 * @cython.wraparound(False) * @cython.cdivision(True) - * def count_points(self, np.ndarray[anyfloat, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] y, - * np.ndarray[anyfloat, ndim=1] z, + * def count_points(self, np.ndarray[floating, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] y, + * np.ndarray[floating, ndim=1] z, */ - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_2yt_8geometry_18selection_routines_14SelectorObject_25count_points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SelectorObject_count_points, NULL, __pyx_n_s_yt_geometry_selection_routines, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_float32_t, __pyx_t_4) < 0) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_2yt_8geometry_18selection_routines_14SelectorObject_27count_points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SelectorObject_count_points, NULL, __pyx_n_s_yt_geometry_selection_routines, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_float64_t, __pyx_t_4) < 0) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_mdef_2yt_8geometry_18selection_routines_14SelectorObject_15count_points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SelectorObject_count_points, NULL, __pyx_n_s_yt_geometry_selection_routines, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple); - ((__pyx_FusedFunctionObject *) __pyx_t_4)->__signatures__ = __pyx_t_6; - __Pyx_GIVEREF(__pyx_t_6); - if (PyDict_SetItem((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict, __pyx_n_s_count_points, __pyx_t_4) < 0) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_2yt_8geometry_18selection_routines_14SelectorObject_25count_points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SelectorObject_count_points, NULL, __pyx_n_s_yt_geometry_selection_routines, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_float, __pyx_t_5) < 0) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_2yt_8geometry_18selection_routines_14SelectorObject_27count_points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SelectorObject_count_points, NULL, __pyx_n_s_yt_geometry_selection_routines, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_double, __pyx_t_5) < 0) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_mdef_2yt_8geometry_18selection_routines_14SelectorObject_15count_points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SelectorObject_count_points, NULL, __pyx_n_s_yt_geometry_selection_routines, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple); + ((__pyx_FusedFunctionObject *) __pyx_t_5)->__signatures__ = __pyx_t_7; + __Pyx_GIVEREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict, __pyx_n_s_count_points, __pyx_t_5) < 0) __PYX_ERR(0, 545, __pyx_L1_error) PyType_Modified(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "yt/geometry/selection_routines.pyx":581 + /* "yt/geometry/selection_routines.pyx":573 * @cython.wraparound(False) * @cython.cdivision(True) - * def select_points(self, np.ndarray[anyfloat, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] y, - * np.ndarray[anyfloat, ndim=1] z, + * def select_points(self, np.ndarray[floating, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] y, + * np.ndarray[floating, ndim=1] z, */ - __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_2yt_8geometry_18selection_routines_14SelectorObject_31select_points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SelectorObject_select_points, NULL, __pyx_n_s_yt_geometry_selection_routines, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_2yt_8geometry_18selection_routines_14SelectorObject_31select_points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SelectorObject_select_points, NULL, __pyx_n_s_yt_geometry_selection_routines, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_float32_t, __pyx_t_7) < 0) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_2yt_8geometry_18selection_routines_14SelectorObject_33select_points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SelectorObject_select_points, NULL, __pyx_n_s_yt_geometry_selection_routines, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_float64_t, __pyx_t_7) < 0) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __pyx_FusedFunction_NewEx(&__pyx_mdef_2yt_8geometry_18selection_routines_14SelectorObject_17select_points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SelectorObject_select_points, NULL, __pyx_n_s_yt_geometry_selection_routines, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_empty_tuple); - ((__pyx_FusedFunctionObject *) __pyx_t_7)->__signatures__ = __pyx_t_8; - __Pyx_GIVEREF(__pyx_t_8); - if (PyDict_SetItem((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict, __pyx_n_s_select_points, __pyx_t_7) < 0) __PYX_ERR(0, 581, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_float, __pyx_t_8) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_2yt_8geometry_18selection_routines_14SelectorObject_33select_points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SelectorObject_select_points, NULL, __pyx_n_s_yt_geometry_selection_routines, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_double, __pyx_t_8) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_FusedFunction_NewEx(&__pyx_mdef_2yt_8geometry_18selection_routines_14SelectorObject_17select_points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SelectorObject_select_points, NULL, __pyx_n_s_yt_geometry_selection_routines, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_empty_tuple); + ((__pyx_FusedFunctionObject *) __pyx_t_8)->__signatures__ = __pyx_t_9; + __Pyx_GIVEREF(__pyx_t_9); + if (PyDict_SetItem((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict, __pyx_n_s_select_points, __pyx_t_8) < 0) __PYX_ERR(0, 573, __pyx_L1_error) PyType_Modified(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "yt/geometry/selection_routines.pyx":703 + /* "yt/geometry/selection_routines.pyx":695 * ("p[2]", self.p[2])) * * point_selector = PointSelector # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_point_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_PointSelector)) < 0) __PYX_ERR(0, 703, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_point_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_PointSelector)) < 0) __PYX_ERR(0, 695, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":806 + /* "yt/geometry/selection_routines.pyx":798 * ("center[2]", self.center[2])) * * sphere_selector = SphereSelector # <<<<<<<<<<<<<< * * cdef class RegionSelector(SelectorObject): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sphere_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_SphereSelector)) < 0) __PYX_ERR(0, 806, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sphere_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_SphereSelector)) < 0) __PYX_ERR(0, 798, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":970 + /* "yt/geometry/selection_routines.pyx":959 * ("right_edge[2]", self.right_edge[2])) * * region_selector = RegionSelector # <<<<<<<<<<<<<< * * cdef class CutRegionSelector(SelectorObject): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_region_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_RegionSelector)) < 0) __PYX_ERR(0, 970, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_region_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_RegionSelector)) < 0) __PYX_ERR(0, 959, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1004 + /* "yt/geometry/selection_routines.pyx":993 * return ("conditionals", t) * * cut_region_selector = CutRegionSelector # <<<<<<<<<<<<<< * * cdef class DiskSelector(SelectorObject): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_cut_region_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_CutRegionSelector)) < 0) __PYX_ERR(0, 1004, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cut_region_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_CutRegionSelector)) < 0) __PYX_ERR(0, 993, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1119 + /* "yt/geometry/selection_routines.pyx":1108 * ("height", self.height)) * * disk_selector = DiskSelector # <<<<<<<<<<<<<< * * cdef class CuttingPlaneSelector(SelectorObject): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_disk_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_DiskSelector)) < 0) __PYX_ERR(0, 1119, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_disk_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_DiskSelector)) < 0) __PYX_ERR(0, 1108, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1199 + /* "yt/geometry/selection_routines.pyx":1188 * ("d", self.d)) * * cutting_selector = CuttingPlaneSelector # <<<<<<<<<<<<<< * * cdef class SliceSelector(SelectorObject): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_cutting_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_CuttingPlaneSelector)) < 0) __PYX_ERR(0, 1199, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cutting_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_CuttingPlaneSelector)) < 0) __PYX_ERR(0, 1188, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1288 + /* "yt/geometry/selection_routines.pyx":1277 * ("coord", self.coord)) * * slice_selector = SliceSelector # <<<<<<<<<<<<<< * * cdef class OrthoRaySelector(SelectorObject): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_slice_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_SliceSelector)) < 0) __PYX_ERR(0, 1288, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_slice_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_SliceSelector)) < 0) __PYX_ERR(0, 1277, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1390 + /* "yt/geometry/selection_routines.pyx":1379 * ("axis", self.axis)) * * ortho_ray_selector = OrthoRaySelector # <<<<<<<<<<<<<< * * cdef struct IntegrationAccumulator: */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ortho_ray_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_OrthoRaySelector)) < 0) __PYX_ERR(0, 1390, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ortho_ray_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_OrthoRaySelector)) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) /* "yt/geometry/selection_routines.pyx":1621 * ("vec[2]", self.vec[2])) @@ -52298,90 +63802,107 @@ */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_data_collection_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_DataCollectionSelector)) < 0) __PYX_ERR(0, 1658, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1760 + /* "yt/geometry/selection_routines.pyx":1765 * ("center[2]", self.center[2])) * * ellipsoid_selector = EllipsoidSelector # <<<<<<<<<<<<<< * * cdef class GridSelector(SelectorObject): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ellipsoid_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_EllipsoidSelector)) < 0) __PYX_ERR(0, 1760, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ellipsoid_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_EllipsoidSelector)) < 0) __PYX_ERR(0, 1765, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1799 + /* "yt/geometry/selection_routines.pyx":1804 * return (self.ind,) * * grid_selector = GridSelector # <<<<<<<<<<<<<< * * cdef class OctreeSubsetSelector(SelectorObject): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_grid_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_GridSelector)) < 0) __PYX_ERR(0, 1799, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_grid_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_GridSelector)) < 0) __PYX_ERR(0, 1804, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1863 + /* "yt/geometry/selection_routines.pyx":1868 * return (hash(self.base_selector), self.domain_id) * * octree_subset_selector = OctreeSubsetSelector # <<<<<<<<<<<<<< * * cdef class IndexedOctreeSubsetSelector(SelectorObject): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_octree_subset_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) < 0) __PYX_ERR(0, 1863, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_octree_subset_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) < 0) __PYX_ERR(0, 1868, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1937 + /* "yt/geometry/selection_routines.pyx":1942 * return (hash(self.base_selector), self.min_ind, self.max_ind) * * indexed_octree_subset_selector = IndexedOctreeSubsetSelector # <<<<<<<<<<<<<< * * cdef class AlwaysSelector(SelectorObject): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_indexed_octree_subset_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector)) < 0) __PYX_ERR(0, 1937, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_indexed_octree_subset_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_IndexedOctreeSubsetSelector)) < 0) __PYX_ERR(0, 1942, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":1979 + /* "yt/geometry/selection_routines.pyx":1984 * return ("always", 1,) * * always_selector = AlwaysSelector # <<<<<<<<<<<<<< * * cdef class ComposeSelector(SelectorObject): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_always_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) < 0) __PYX_ERR(0, 1979, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_always_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) < 0) __PYX_ERR(0, 1984, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":2038 + /* "yt/geometry/selection_routines.pyx":2043 * return (hash(self.selector1), hash(self.selector2)) * * compose_selector = ComposeSelector # <<<<<<<<<<<<<< * * cdef class HaloParticlesSelector(SelectorObject): */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_compose_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_ComposeSelector)) < 0) __PYX_ERR(0, 2038, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_compose_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_ComposeSelector)) < 0) __PYX_ERR(0, 2043, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":2053 + /* "yt/geometry/selection_routines.pyx":2058 * return ("halo_particles", self.halo_id) * * halo_particles_selector = HaloParticlesSelector # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_halo_particles_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_HaloParticlesSelector)) < 0) __PYX_ERR(0, 2053, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_halo_particles_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_HaloParticlesSelector)) < 0) __PYX_ERR(0, 2058, __pyx_L1_error) - /* "yt/geometry/selection_routines.pyx":2058 + /* "yt/geometry/selection_routines.pyx":2063 * @cython.boundscheck(False) * @cython.wraparound(False) * def points_in_cells( # <<<<<<<<<<<<<< * np.float64_t[:] cx, * np.float64_t[:] cy, */ - __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_18selection_routines_5points_in_cells, NULL, __pyx_n_s_yt_geometry_selection_routines); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_points_in_cells, __pyx_t_5) < 0) __PYX_ERR(0, 2058, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_2yt_8geometry_18selection_routines_5points_in_cells, NULL, __pyx_n_s_yt_geometry_selection_routines); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2063, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_points_in_cells, __pyx_t_6) < 0) __PYX_ERR(0, 2063, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "yt/geometry/selection_routines.pyx":2382 + * return v + * + * intersection_selector = ChainedBooleanANDSelector # <<<<<<<<<<<<<< + * + * cdef class ChainedBooleanORSelector(ChainedBooleanSelector): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_intersection_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_ChainedBooleanANDSelector)) < 0) __PYX_ERR(0, 2382, __pyx_L1_error) + + /* "yt/geometry/selection_routines.pyx":2448 + * return v + * + * union_selector = ChainedBooleanORSelector # <<<<<<<<<<<<<< + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_union_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_ChainedBooleanORSelector)) < 0) __PYX_ERR(0, 2448, __pyx_L1_error) /* "yt/geometry/selection_routines.pyx":1 * """ # <<<<<<<<<<<<<< * Geometry selection routines. * */ - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "View.MemoryView":207 * info.obj = self @@ -52390,10 +63911,10 @@ * * def __dealloc__(array self): */ - __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) __PYX_ERR(3, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_6) < 0) __PYX_ERR(2, 207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; PyType_Modified(__pyx_array_type); /* "View.MemoryView":282 @@ -52403,12 +63924,12 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__136, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_XGOTREF(generic); - __Pyx_DECREF_SET(generic, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(generic, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; /* "View.MemoryView":283 * @@ -52417,12 +63938,12 @@ * cdef indirect = Enum("") * */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__137, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_XGOTREF(strided); - __Pyx_DECREF_SET(strided, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(strided, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; /* "View.MemoryView":284 * cdef generic = Enum("") @@ -52431,12 +63952,12 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_XGOTREF(indirect); - __Pyx_DECREF_SET(indirect, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(indirect, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; /* "View.MemoryView":287 * @@ -52445,12 +63966,12 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__139, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_XGOTREF(contiguous); - __Pyx_DECREF_SET(contiguous, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(contiguous, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; /* "View.MemoryView":288 * @@ -52459,12 +63980,12 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__140, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_XGOTREF(indirect_contiguous); - __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; /* "View.MemoryView":312 * @@ -52482,15 +64003,15 @@ * PyThread_allocate_lock(), * PyThread_allocate_lock(), */ - __pyx_t_10[0] = PyThread_allocate_lock(); - __pyx_t_10[1] = PyThread_allocate_lock(); - __pyx_t_10[2] = PyThread_allocate_lock(); - __pyx_t_10[3] = PyThread_allocate_lock(); - __pyx_t_10[4] = PyThread_allocate_lock(); - __pyx_t_10[5] = PyThread_allocate_lock(); - __pyx_t_10[6] = PyThread_allocate_lock(); - __pyx_t_10[7] = PyThread_allocate_lock(); - memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_10, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + __pyx_t_11[0] = PyThread_allocate_lock(); + __pyx_t_11[1] = PyThread_allocate_lock(); + __pyx_t_11[2] = PyThread_allocate_lock(); + __pyx_t_11[3] = PyThread_allocate_lock(); + __pyx_t_11[4] = PyThread_allocate_lock(); + __pyx_t_11[5] = PyThread_allocate_lock(); + __pyx_t_11[6] = PyThread_allocate_lock(); + __pyx_t_11[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_11, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); /* "View.MemoryView":535 * info.obj = self @@ -52499,10 +64020,10 @@ * * */ - __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) __PYX_ERR(3, 535, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_6) < 0) __PYX_ERR(2, 535, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; PyType_Modified(__pyx_memoryview_type); /* "View.MemoryView":981 @@ -52512,18 +64033,28 @@ * * */ - __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) __PYX_ERR(3, 981, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_6) < 0) __PYX_ERR(2, 981, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_6) < 0) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -52538,9 +64069,10 @@ __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.geometry.selection_routines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.geometry.selection_routines", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -52587,72 +64119,6 @@ return result; } -/* 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 -} - /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, @@ -53429,6 +64895,30 @@ "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); } +/* 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, @@ -53638,9 +65128,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -53653,9 +65146,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -53842,177 +65338,50 @@ } } -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -#endif - -/* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { - PyObject *exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; - return PyErr_GivenExceptionMatches(exc_type, err); -} -#endif - -/* GetException */ - #if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { -#endif - PyObject *local_type, *local_value, *local_tb; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); +/* 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 - 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; + __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 - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); + __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 - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; } /* UnicodeAsUCS4 */ - static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { + static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { Py_ssize_t length; #if CYTHON_PEP393_ENABLED length = PyUnicode_GET_LENGTH(x); @@ -54042,37 +65411,243 @@ return (Py_UCS4)-1; } -/* object_ord */ - static long __Pyx__PyObject_Ord(PyObject* c) { - Py_ssize_t size; - if (PyBytes_Check(c)) { - size = PyBytes_GET_SIZE(c); - if (likely(size == 1)) { - return (unsigned char) PyBytes_AS_STRING(c)[0]; +/* object_ord */ + static long __Pyx__PyObject_Ord(PyObject* c) { + Py_ssize_t size; + if (PyBytes_Check(c)) { + size = PyBytes_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyBytes_AS_STRING(c)[0]; + } +#if PY_MAJOR_VERSION < 3 + } else if (PyUnicode_Check(c)) { + return (long)__Pyx_PyUnicode_AsPy_UCS4(c); +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + } else if (PyByteArray_Check(c)) { + size = PyByteArray_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyByteArray_AS_STRING(c)[0]; + } +#endif + } else { + PyErr_Format(PyExc_TypeError, + "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name); + return (long)(Py_UCS4)-1; + } + PyErr_Format(PyExc_TypeError, + "ord() expected a character, but string of length %zd found", size); + return (long)(Py_UCS4)-1; +} + +/* 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_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 +} + +/* 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"); +} + +/* IterFinish */ + static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; } -#if PY_MAJOR_VERSION < 3 - } else if (PyUnicode_Check(c)) { - return (long)__Pyx_PyUnicode_AsPy_UCS4(c); -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - } else if (PyByteArray_Check(c)) { - size = PyByteArray_GET_SIZE(c); - if (likely(size == 1)) { - return (unsigned char) PyByteArray_AS_STRING(c)[0]; + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; } + } + return 0; #endif +} + +/* UnpackItemEndCheck */ + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; } else { - PyErr_Format(PyExc_TypeError, - "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name); - return (long)(Py_UCS4)-1; + return __Pyx_IterFinish(); } - PyErr_Format(PyExc_TypeError, - "ord() expected a character, but string of length %zd found", size); - return (long)(Py_UCS4)-1; + return 0; } /* SetItemInt */ - static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); @@ -54119,43 +65694,8 @@ return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } -/* IterFinish */ - static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = PyThreadState_GET(); - PyObject* exc_type = tstate->curexc_type; - if (unlikely(exc_type)) { - if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { - PyObject *exc_value, *exc_tb; - exc_value = tstate->curexc_value; - exc_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - Py_DECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - return 0; - } else { - return -1; - } - } - return 0; -#else - if (unlikely(PyErr_Occurred())) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { - PyErr_Clear(); - return 0; - } else { - return -1; - } - } - return 0; -#endif -} - /* PyFunctionFastCall */ - #if CYTHON_FAST_PYCALL + #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { @@ -54271,11 +65811,11 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCallMethO */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; @@ -54295,7 +65835,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -54316,25 +65856,30 @@ #endif /* PyCFunctionFastCall */ - #if CYTHON_FAST_PYCCALL + #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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyObjectCallOneArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); @@ -54351,11 +65896,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -54378,7 +65919,7 @@ #endif /* PyObjectCallMethod0 */ - static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; @@ -54399,38 +65940,13 @@ return result; } -/* 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"); -} - -/* 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); -} - -/* UnpackItemEndCheck */ - static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else { - return __Pyx_IterFinish(); - } - return 0; -} - /* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ - static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { @@ -54441,7 +65957,7 @@ } /* UnpackTuple2 */ - static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int is_tuple, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; @@ -54488,17 +66004,32 @@ } /* dict_iter */ - static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; -#if !CYTHON_COMPILING_IN_PYPY if (is_dict) { +#if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; - } +#elif PY_MAJOR_VERSION >= 3 + static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; + const char *name = PyUnicode_AsUTF8(method_name); + PyObject **pp = NULL; + if (strcmp(name, "iteritems") == 0) pp = &py_items; + else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; + else if (strcmp(name, "itervalues") == 0) pp = &py_values; + if (pp) { + if (!*pp) { + *pp = PyUnicode_FromString(name + 4); + if (!*pp) + return NULL; + } + method_name = *pp; + } #endif + } *p_orig_length = 0; if (method_name) { PyObject* iter; @@ -54584,12 +66115,12 @@ } /* None */ - static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -54705,14 +66236,14 @@ #endif /* None */ - static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { + static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { long r = a % b; r += ((r != 0) & ((r ^ b) < 0)) * b; return r; } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { @@ -54828,7 +66359,7 @@ #endif /* PyFloatBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_DivideCObj(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) { const double a = floatval; double b, result; @@ -54852,7 +66383,7 @@ case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -2) b = -b; break; @@ -54862,7 +66393,7 @@ case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -3) b = -b; break; @@ -54872,7 +66403,7 @@ case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -4) b = -b; break; @@ -54895,130 +66426,121 @@ } #endif -/* 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 = 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); +/* 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 { - 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; + Py_DECREF(r); + return 1; } +} + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} #endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); } +#endif -/* 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); +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { #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); - } + 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 - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; + 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; } -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); + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); #endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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)); @@ -55026,7 +66548,7 @@ } /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -55059,7 +66581,7 @@ } /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -55083,21 +66605,109 @@ } #endif +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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; } +/* 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; +} + /* CallNextTpTraverse */ - static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { PyTypeObject* type = Py_TYPE(obj); while (type && type->tp_traverse != current_tp_traverse) type = type->tp_base; @@ -55109,7 +66719,7 @@ } /* CallNextTpClear */ - static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { PyTypeObject* type = Py_TYPE(obj); while (type && type->tp_clear != current_tp_clear) type = type->tp_base; @@ -55120,7 +66730,7 @@ } /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -55137,8 +66747,73 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -55158,7 +66833,7 @@ } /* FetchCommonType */ - static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); @@ -55197,7 +66872,7 @@ } /* CythonFunction */ - static PyObject * + static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { @@ -55780,7 +67455,7 @@ } /* FusedFunction */ - static PyObject * + static PyObject * __pyx_FusedFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject *qualname, PyObject *self, PyObject *module, PyObject *globals, @@ -56104,8 +67779,42 @@ return 0; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -56185,7 +67894,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -56244,12 +67953,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -56288,8 +68000,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -56312,7 +68024,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -56348,7 +68060,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -56360,8 +68072,19 @@ return cobj; } +/* IsLittleEndian */ + static int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -56402,7 +68125,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -56584,7 +68307,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -56595,7 +68318,7 @@ } retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, PyBUF_RECORDS, 1, - &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, stack, + &__Pyx_TypeInfo_float, stack, &result, obj); if (unlikely(retcode == -1)) goto __pyx_fail; @@ -56607,7 +68330,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -56618,7 +68341,7 @@ } retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, PyBUF_RECORDS, 1, - &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack, + &__Pyx_TypeInfo_double, stack, &result, obj); if (unlikely(retcode == -1)) goto __pyx_fail; @@ -56630,7 +68353,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -56651,51 +68374,31 @@ return (target_type) value;\ } -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) { - const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(unsigned char) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(unsigned char) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(unsigned char) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(unsigned char), - little, !is_unsigned); +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; } -} - -/* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_char(const char *itemp) { - return (PyObject *) __Pyx_PyInt_From_unsigned_char(*(unsigned char *) itemp); -} -static CYTHON_INLINE int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj) { - unsigned char value = __Pyx_PyInt_As_unsigned_char(obj); - if ((value == (unsigned char)-1) && PyErr_Occurred()) - return 0; - *(unsigned char *) itemp = value; - return 1; + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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) { + 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) { @@ -56726,7 +68429,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -56757,7 +68460,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + 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) { @@ -56788,7 +68491,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -56819,7 +68522,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -56850,7 +68553,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -56881,7 +68584,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) { const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -56912,7 +68615,7 @@ } /* Print */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); if (!f) { @@ -57018,7 +68721,7 @@ #endif /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); } static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { @@ -57030,7 +68733,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -57050,7 +68753,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -57185,7 +68888,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -57205,7 +68908,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -57340,7 +69043,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -57371,7 +69074,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -57438,7 +69141,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -57627,7 +69330,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -57816,385 +69519,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) { - const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(unsigned char) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(unsigned char, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (unsigned char) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (unsigned char) 0; - case 1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, digits[0]) - case 2: - if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned char) >= 2 * PyLong_SHIFT) { - return (unsigned char) (((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned char) >= 3 * PyLong_SHIFT) { - return (unsigned char) (((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned char) >= 4 * PyLong_SHIFT) { - return (unsigned char) (((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (unsigned char) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(unsigned char) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (unsigned char) 0; - case -1: __PYX_VERIFY_RETURN_INT(unsigned char, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, +digits[0]) - case -2: - if (8 * sizeof(unsigned char) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) { - return (unsigned char) (((unsigned char)-1)*(((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) { - return (unsigned char) ((((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) { - return (unsigned char) (((unsigned char)-1)*(((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) { - return (unsigned char) ((((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) { - return (unsigned char) (((unsigned char)-1)*(((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) { - return (unsigned char) ((((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); - } - } - break; - } -#endif - if (sizeof(unsigned char) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(unsigned char, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - unsigned char val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (unsigned char) -1; - } - } else { - unsigned char val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (unsigned char) -1; - val = __Pyx_PyInt_As_unsigned_char(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to unsigned char"); - return (unsigned char) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned char"); - return (unsigned char) -1; -} - -/* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { - const char neg_one = (char) -1, const_zero = (char) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(char) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (char) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (char) 0; - case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) - case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { - return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(char) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { - return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(char) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { - return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (char) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(char) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (char) 0; - case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) - case -2: - if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { - return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { - return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { - return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(char) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { - return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { - return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(char) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { - return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - } -#endif - if (sizeof(char) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - char val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (char) -1; - } - } else { - char val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (char) -1; - val = __Pyx_PyInt_As_char(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to char"); - return (char) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to char"); - return (char) -1; -} - -/* CIntFromPy */ - static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -58383,7 +69708,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -58572,7 +69897,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { + static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -58761,7 +70086,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { + static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -58950,7 +70275,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { + static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -59139,14 +70464,229 @@ } /* BytesContains */ - static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character) { + static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character) { const Py_ssize_t length = PyBytes_GET_SIZE(bytes); char* char_start = PyBytes_AS_STRING(bytes); return memchr(char_start, (unsigned char)character, (size_t)length) != NULL; } +/* ImportNumPyArray */ + static PyObject* __Pyx__ImportNumPyArray(void) { + PyObject *numpy_module, *ndarray_object = NULL; + numpy_module = __Pyx_Import(__pyx_n_s_numpy, NULL, 0); + if (likely(numpy_module)) { + ndarray_object = PyObject_GetAttrString(numpy_module, "ndarray"); + Py_DECREF(numpy_module); + } + if (unlikely(!ndarray_object)) { + PyErr_Clear(); + } + if (unlikely(!ndarray_object || !PyObject_TypeCheck(ndarray_object, &PyType_Type))) { + Py_XDECREF(ndarray_object); + Py_INCREF(Py_None); + ndarray_object = Py_None; + } + return ndarray_object; +} +static CYTHON_INLINE PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void) { + if (unlikely(!__pyx_numpy_ndarray)) { + __pyx_numpy_ndarray = __Pyx__ImportNumPyArray(); + } + Py_INCREF(__pyx_numpy_ndarray); + return __pyx_numpy_ndarray; +} + +/* 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_unsigned_char(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -59169,7 +70709,7 @@ } /* PyObjectCallMethod1 */ - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto done; @@ -59215,7 +70755,7 @@ } /* CoroutineBase */ - #include + #include #include static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); @@ -59748,7 +71288,7 @@ } /* PatchModuleWithCoroutine */ - static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { + static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; @@ -59788,7 +71328,7 @@ } /* PatchGeneratorABC */ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( @@ -59842,7 +71382,7 @@ } /* Generator */ - static PyMethodDef __pyx_Generator_methods[] = { + static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, @@ -59931,7 +71471,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -59947,7 +71487,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -59965,7 +71505,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -60030,7 +71570,7 @@ #endif /* VoidPtrImport */ - #ifndef __PYX_HAVE_RT_ImportVoidPtr + #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; @@ -60079,7 +71619,7 @@ #endif /* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction + #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; @@ -60133,7 +71673,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -60158,6 +71698,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -60166,11 +71708,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/geometry/selection_routines.pxd yt-3.4.0/yt/geometry/selection_routines.pxd --- yt-3.3.3/yt/geometry/selection_routines.pxd 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/selection_routines.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -19,10 +19,6 @@ from grid_visitors cimport GridTreeNode, GridVisitorData, \ grid_visitor_function, check_child_masked -ctypedef fused anyfloat: - np.float32_t - np.float64_t - cdef inline _ensure_code(arr): if hasattr(arr, "units"): if "code_length" == str(arr.units): @@ -75,6 +71,10 @@ cdef SelectorObject base_selector cdef public np.int64_t domain_id +cdef class BooleanSelector(SelectorObject): + cdef public SelectorObject sel1 + cdef public SelectorObject sel2 + cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, np.float64_t dw, bint periodic) nogil: cdef np.float64_t rel = x1 - x2 diff -Nru yt-3.3.3/yt/geometry/selection_routines.pyx yt-3.4.0/yt/geometry/selection_routines.pyx --- yt-3.3.3/yt/geometry/selection_routines.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/geometry/selection_routines.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -17,9 +17,11 @@ import numpy as np cimport numpy as np cimport cython +from cython cimport floating from libc.stdlib cimport malloc, free +from yt.utilities.lib.fnv_hash cimport c_fnv_hash as fnv_hash from yt.utilities.lib.fp_utils cimport fclip, iclip, fmax, fmin, imin, imax -from .oct_container cimport OctreeContainer, OctAllocationContainer, Oct +from .oct_container cimport OctreeContainer, Oct cimport oct_visitors from .oct_visitors cimport cind from yt.utilities.lib.volume_container cimport \ @@ -44,16 +46,6 @@ cdef np.float64_t grid_eps = np.finfo(np.float64).eps grid_eps = 0.0 -cdef np.int64_t fnv_hash(unsigned char[:] octets): - # https://bitbucket.org/yt_analysis/yt/issues/1052/field-access-tests-fail-under-python3 - # FNV hash cf. http://www.isthe.com/chongo/tech/comp/fnv/index.html - cdef np.int64_t hash_val = 2166136261 - cdef char octet - for octet in octets: - hash_val = hash_val ^ octet - hash_val = hash_val * 16777619 - return hash_val - # These routines are separated into a couple different categories: # # * Routines for identifying intersections of an object with a bounding box @@ -96,7 +88,7 @@ cdef _mask_fill(np.ndarray[np.float64_t, ndim=1] out, np.int64_t offset, np.ndarray[np.uint8_t, ndim=3, cast=True] mask, - np.ndarray[anyfloat, ndim=3] vals): + np.ndarray[floating, ndim=3] vals): cdef np.int64_t count = 0 cdef int i, j, k for i in range(mask.shape[0]): @@ -550,9 +542,9 @@ @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) - def count_points(self, np.ndarray[anyfloat, ndim=1] x, - np.ndarray[anyfloat, ndim=1] y, - np.ndarray[anyfloat, ndim=1] z, + def count_points(self, np.ndarray[floating, ndim=1] x, + np.ndarray[floating, ndim=1] y, + np.ndarray[floating, ndim=1] z, np.float64_t radius): cdef int count = 0 cdef int i @@ -578,9 +570,9 @@ @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) - def select_points(self, np.ndarray[anyfloat, ndim=1] x, - np.ndarray[anyfloat, ndim=1] y, - np.ndarray[anyfloat, ndim=1] z, + def select_points(self, np.ndarray[floating, ndim=1] x, + np.ndarray[floating, ndim=1] y, + np.ndarray[floating, ndim=1] z, np.float64_t radius): cdef int count = 0 cdef int i @@ -928,15 +920,12 @@ return 0 if level == self.max_level: this_level = 1 - cdef int si[3] - cdef int ei[3] - #print self.left_edge[0], self.left_edge[1], self.left_edge[2], - #print self.right_edge[0], self.right_edge[1], self.right_edge[2], - #print self.right_edge_shift[0], self.right_edge_shift[1], self.right_edge_shift[2] + cdef np.int64_t si[3] + cdef np.int64_t ei[3] if not self.check_period: for i in range(3): - si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) - ei[i] = ((self.right_edge[i] - left_edge[i])/dds[i]) + si[i] = ((self.left_edge[i] - left_edge[i])/dds[i]) + ei[i] = ((self.right_edge[i] - left_edge[i])/dds[i]) si[i] = iclip(si[i] - 1, 0, dim[i]) ei[i] = iclip(ei[i] + 1, 0, dim[i]) else: @@ -1434,7 +1423,8 @@ cdef np.ndarray[np.uint8_t, ndim=3, cast=True] child_mask cdef int i cdef int total = 0 - cdef IntegrationAccumulator ia + cdef IntegrationAccumulator *ia + ia = malloc(sizeof(IntegrationAccumulator)) cdef VolumeContainer vc mask = np.zeros(gobj.ActiveDimensions, dtype='uint8') t = np.zeros(gobj.ActiveDimensions, dtype="float64") @@ -1453,13 +1443,14 @@ vc.dds[i] = gobj.dds[i] vc.idds[i] = 1.0/gobj.dds[i] vc.dims[i] = dt.shape[i] - walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) for i in range(dt.shape[0]): for j in range(dt.shape[1]): for k in range(dt.shape[2]): if dt[i, j, k] >= 0: mask[i, j, k] = 1 total += 1 + free(ia) if total == 0: return None return mask.astype("bool") @@ -1471,7 +1462,8 @@ cdef np.ndarray[np.float64_t, ndim=1] tr, dtr cdef np.ndarray[np.uint8_t, ndim=3, cast=True] child_mask cdef int i, j, k, ni - cdef IntegrationAccumulator ia + cdef IntegrationAccumulator *ia + ia = malloc(sizeof(IntegrationAccumulator)) cdef VolumeContainer vc t = np.zeros(gobj.ActiveDimensions, dtype="float64") dt = np.zeros(gobj.ActiveDimensions, dtype="float64") - 1 @@ -1489,7 +1481,7 @@ vc.dds[i] = gobj.dds[i] vc.idds[i] = 1.0/gobj.dds[i] vc.dims[i] = dt.shape[i] - walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) tr = np.zeros(ia.hits, dtype="float64") dtr = np.zeros(ia.hits, dtype="float64") ni = 0 @@ -1502,6 +1494,7 @@ ni += 1 if not (ni == ia.hits): print ni, ia.hits + free(ia) return dtr, tr @cython.boundscheck(False) @@ -1515,7 +1508,8 @@ cdef np.float64_t LE[3] cdef np.float64_t RE[3] cdef np.float64_t pos - cdef IntegrationAccumulator ia + cdef IntegrationAccumulator *ia + ia = malloc(sizeof(IntegrationAccumulator)) cdef np.ndarray[np.float64_t, ndim=2] coords cdef np.ndarray[np.int64_t, ndim=2] indices indices = mesh.connectivity_indices @@ -1551,11 +1545,12 @@ vc.idds[j] = 1.0/vc.dds[j] vc.dims[j] = 1 t[0,0,0] = dt[0,0,0] = -1 - walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) if dt[0,0,0] >= 0: tr[ni] = t[0,0,0] dtr[ni] = dt[0,0,0] ni += 1 + free(ia) return dtr, tr cdef int select_point(self, np.float64_t pos[3]) nogil: @@ -1571,26 +1566,31 @@ @cython.cdivision(True) cdef int select_bbox(self, np.float64_t left_edge[3], np.float64_t right_edge[3]) nogil: - cdef int i - cdef np.uint8_t cm = 1 + cdef int i, rv cdef VolumeContainer vc - cdef IntegrationAccumulator ia - cdef np.float64_t dt, t + cdef IntegrationAccumulator *ia + ia = malloc(sizeof(IntegrationAccumulator)) + cdef np.float64_t dt[1] + cdef np.float64_t t[1] + cdef np.uint8_t cm[1] for i in range(3): vc.left_edge[i] = left_edge[i] vc.right_edge[i] = right_edge[i] vc.dds[i] = right_edge[i] - left_edge[i] vc.idds[i] = 1.0/vc.dds[i] vc.dims[i] = 1 - t = dt = 0.0 - ia.t = &t - ia.dt = &dt - ia.child_mask = &cm + t[0] = dt[0] = 0.0 + cm[0] = 1 + ia.t = t + ia.dt = dt + ia.child_mask = cm ia.hits = 0 - walk_volume(&vc, self.p1, self.vec, dt_sampler, &ia) + walk_volume(&vc, self.p1, self.vec, dt_sampler, ia) + rv = 0 if ia.hits > 0: - return 1 - return 0 + rv = 1 + free(ia) + return rv @cython.boundscheck(False) @cython.wraparound(False) @@ -1711,10 +1711,13 @@ cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: # this is the sphere selection cdef int i - cdef np.float64_t dist2 = 0 + cdef np.float64_t dist, dist2_max, dist2 = 0 for i in range(3): - dist2 += self.difference(pos[i], self.center[i], i)**2 - if dist2 <= (self.mag[0]+radius)**2: return 1 + dist = self.difference(pos[i], self.center[i], i) + dist2 += dist * dist + dist2_max = (self.mag[0] + radius) * (self.mag[0] + radius) + if dist2 <= dist2_max: + return 1 return 0 @cython.boundscheck(False) @@ -1724,7 +1727,7 @@ np.float64_t right_edge[3]) nogil: # This is the sphere selection cdef int i - cdef np.float64_t box_center, relcenter, closest, dist, edge + cdef np.float64_t box_center, relcenter, closest, dist, edge, dist_max if left_edge[0] <= self.center[0] <= right_edge[0] and \ left_edge[1] <= self.center[1] <= right_edge[1] and \ left_edge[2] <= self.center[2] <= right_edge[2]: @@ -1737,7 +1740,9 @@ edge = right_edge[i] - left_edge[i] closest = relcenter - fclip(relcenter, -edge/2.0, edge/2.0) dist += closest * closest - if dist <= self.mag[0]**2: return 1 + dist_max = self.mag[0] * self.mag[0] + if dist <= dist_max: + return 1 return 0 def _hash_vals(self): @@ -2091,3 +2096,354 @@ if mask[p]: break return mask + +cdef class BooleanSelector(SelectorObject): + + def __init__(self, dobj): + # Note that this has a different API than the other selector objects, + # so will not work as a traditional data selector. + if not hasattr(dobj.dobj1, "selector"): + self.sel1 = dobj.dobj1 + else: + self.sel1 = dobj.dobj1.selector + if not hasattr(dobj.dobj2, "selector"): + self.sel2 = dobj.dobj2 + else: + self.sel2 = dobj.dobj2.selector + +cdef class BooleanANDSelector(BooleanSelector): + cdef int select_bbox(self, np.float64_t left_edge[3], + np.float64_t right_edge[3]) nogil: + cdef int rv1 = self.sel1.select_bbox(left_edge, right_edge) + if rv1 == 0: return 0 + cdef int rv2 = self.sel2.select_bbox(left_edge, right_edge) + if rv2 == 0: return 0 + return 1 + + cdef int select_grid(self, np.float64_t left_edge[3], + np.float64_t right_edge[3], np.int32_t level, + Oct *o = NULL) nogil: + cdef int rv1 = self.sel1.select_grid(left_edge, right_edge, level, o) + if rv1 == 0: return 0 + cdef int rv2 = self.sel2.select_grid(left_edge, right_edge, level, o) + if rv2 == 0: return 0 + return 1 + + cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + cdef int rv1 = self.sel1.select_cell(pos, dds) + if rv1 == 0: return 0 + cdef int rv2 = self.sel2.select_cell(pos, dds) + if rv2 == 0: return 0 + return 1 + + cdef int select_point(self, np.float64_t pos[3]) nogil: + cdef int rv1 = self.sel1.select_point(pos) + if rv1 == 0: return 0 + cdef int rv2 = self.sel2.select_point(pos) + if rv2 == 0: return 0 + return 1 + + cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + cdef int rv1 = self.sel1.select_sphere(pos, radius) + if rv1 == 0: return 0 + cdef int rv2 = self.sel2.select_sphere(pos, radius) + if rv2 == 0: return 0 + return 1 + + def _hash_vals(self): + return (self.sel1._hash_vals() + + ("and",) + + self.sel2._hash_vals()) + +cdef class BooleanORSelector(BooleanSelector): + cdef int select_bbox(self, np.float64_t left_edge[3], + np.float64_t right_edge[3]) nogil: + cdef int rv1 = self.sel1.select_bbox(left_edge, right_edge) + if rv1 == 1: return 1 + cdef int rv2 = self.sel2.select_bbox(left_edge, right_edge) + if rv2 == 1: return 1 + return 0 + + cdef int select_grid(self, np.float64_t left_edge[3], + np.float64_t right_edge[3], np.int32_t level, + Oct *o = NULL) nogil: + cdef int rv1 = self.sel1.select_grid(left_edge, right_edge, level, o) + if rv1 == 1: return 1 + cdef int rv2 = self.sel2.select_grid(left_edge, right_edge, level, o) + if rv2 == 1: return 1 + return 0 + + cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + cdef int rv1 = self.sel1.select_cell(pos, dds) + if rv1 == 1: return 1 + cdef int rv2 = self.sel2.select_cell(pos, dds) + if rv2 == 1: return 1 + return 0 + + cdef int select_point(self, np.float64_t pos[3]) nogil: + cdef int rv1 = self.sel1.select_point(pos) + if rv1 == 1: return 1 + cdef int rv2 = self.sel2.select_point(pos) + if rv2 == 1: return 1 + return 0 + + cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + cdef int rv1 = self.sel1.select_sphere(pos, radius) + if rv1 == 1: return 1 + cdef int rv2 = self.sel2.select_sphere(pos, radius) + if rv2 == 1: return 1 + return 0 + + def _hash_vals(self): + return (self.sel1._hash_vals() + + ("or",) + + self.sel2._hash_vals()) + +cdef class BooleanNOTSelector(BooleanSelector): + cdef int select_bbox(self, np.float64_t left_edge[3], + np.float64_t right_edge[3]) nogil: + # We always return True here, because we don't have a "fully included" + # check anywhere else. + return 1 + + cdef int select_grid(self, np.float64_t left_edge[3], + np.float64_t right_edge[3], np.int32_t level, + Oct *o = NULL) nogil: + return 1 + + cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + cdef int rv1 = self.sel1.select_cell(pos, dds) + if rv1 == 0: return 1 + return 0 + + cdef int select_point(self, np.float64_t pos[3]) nogil: + cdef int rv1 = self.sel1.select_point(pos) + if rv1 == 0: return 1 + return 0 + + cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + cdef int rv1 = self.sel1.select_sphere(pos, radius) + if rv1 == 0: return 1 + return 0 + + def _hash_vals(self): + return (self.sel1._hash_vals() + + ("not",)) + +cdef class BooleanXORSelector(BooleanSelector): + + cdef int select_bbox(self, np.float64_t left_edge[3], + np.float64_t right_edge[3]) nogil: + # We always return True here, because we don't have a "fully included" + # check anywhere else. + return 1 + + cdef int select_grid(self, np.float64_t left_edge[3], + np.float64_t right_edge[3], np.int32_t level, + Oct *o = NULL) nogil: + return 1 + + cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + cdef int rv1 = self.sel1.select_cell(pos, dds) + cdef int rv2 = self.sel2.select_cell(pos, dds) + if rv1 == rv2: return 0 + return 1 + + cdef int select_point(self, np.float64_t pos[3]) nogil: + cdef int rv1 = self.sel1.select_point(pos) + cdef int rv2 = self.sel2.select_point(pos) + if rv1 == rv2: return 0 + return 1 + + cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + cdef int rv1 = self.sel1.select_sphere(pos, radius) + cdef int rv2 = self.sel2.select_sphere(pos, radius) + if rv1 == rv2: return 0 + return 1 + + def _hash_vals(self): + return (self.sel1._hash_vals() + + ("xor",) + + self.sel2._hash_vals()) + +cdef class BooleanNEGSelector(BooleanSelector): + + cdef int select_bbox(self, np.float64_t left_edge[3], + np.float64_t right_edge[3]) nogil: + # We always return True here, because we don't have a "fully included" + # check anywhere else. + return self.sel1.select_bbox(left_edge, right_edge) + + cdef int select_grid(self, np.float64_t left_edge[3], + np.float64_t right_edge[3], np.int32_t level, + Oct *o = NULL) nogil: + return self.sel1.select_grid(left_edge, right_edge, level, o) + + cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + cdef int rv1 = self.sel1.select_cell(pos, dds) + if rv1 == 0: return 0 + cdef int rv2 = self.sel2.select_cell(pos, dds) + if rv2 == 1: return 0 + return 1 + + cdef int select_point(self, np.float64_t pos[3]) nogil: + cdef int rv1 = self.sel1.select_point(pos) + if rv1 == 0: return 0 + cdef int rv2 = self.sel2.select_point(pos) + if rv2 == 1: return 0 + return 1 + + cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + cdef int rv1 = self.sel1.select_sphere(pos, radius) + if rv1 == 0: return 0 + cdef int rv2 = self.sel2.select_sphere(pos, radius) + if rv2 == 1: return 0 + return 1 + + def _hash_vals(self): + return (self.sel1._hash_vals() + + ("neg",) + + self.sel2._hash_vals()) + +cdef class ChainedBooleanSelector(SelectorObject): + cdef int n_obj + cdef np.ndarray selectors + def __init__(self, dobj): + # These are data objects, not selectors + self.n_obj = len(dobj.data_objects) + self.selectors = np.empty(self.n_obj, dtype="object") + for i in range(self.n_obj): + self.selectors[i] = dobj.data_objects[i].selector + +cdef class ChainedBooleanANDSelector(ChainedBooleanSelector): + @cython.cdivision(True) + @cython.boundscheck(False) + @cython.wraparound(False) + cdef int select_bbox(self, np.float64_t left_edge[3], + np.float64_t right_edge[3]) nogil: + with gil: + for i in range(self.n_obj): + if (self.selectors[i]).select_bbox( + left_edge, right_edge) == 0: + return 0 + return 1 + + @cython.cdivision(True) + @cython.boundscheck(False) + @cython.wraparound(False) + cdef int select_grid(self, np.float64_t left_edge[3], + np.float64_t right_edge[3], np.int32_t level, + Oct *o = NULL) nogil: + with gil: + for i in range(self.n_obj): + if (self.selectors[i]).select_grid( + left_edge, right_edge, level, o) == 0: + return 0 + return 1 + + @cython.cdivision(True) + @cython.boundscheck(False) + @cython.wraparound(False) + cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + with gil: + for i in range(self.n_obj): + if (self.selectors[i]).select_cell( + pos, dds) == 0: + return 0 + return 1 + + @cython.cdivision(True) + @cython.boundscheck(False) + @cython.wraparound(False) + cdef int select_point(self, np.float64_t pos[3]) nogil: + with gil: + for i in range(self.n_obj): + if (self.selectors[i]).select_point(pos) == 0: + return 0 + return 1 + + @cython.cdivision(True) + @cython.boundscheck(False) + @cython.wraparound(False) + cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + with gil: + for i in range(self.n_obj): + if (self.selectors[i]).select_sphere( + pos, radius) == 0: + return 0 + return 1 + + def _hash_vals(self): + v = ("chained_and",) + for s in self.selectors: + v += s._hash_vals() + return v + +intersection_selector = ChainedBooleanANDSelector + +cdef class ChainedBooleanORSelector(ChainedBooleanSelector): + @cython.cdivision(True) + @cython.boundscheck(False) + @cython.wraparound(False) + cdef int select_bbox(self, np.float64_t left_edge[3], + np.float64_t right_edge[3]) nogil: + with gil: + for i in range(self.n_obj): + if (self.selectors[i]).select_bbox( + left_edge, right_edge) == 1: + return 1 + return 0 + + @cython.cdivision(True) + @cython.boundscheck(False) + @cython.wraparound(False) + cdef int select_grid(self, np.float64_t left_edge[3], + np.float64_t right_edge[3], np.int32_t level, + Oct *o = NULL) nogil: + with gil: + for i in range(self.n_obj): + if (self.selectors[i]).select_grid( + left_edge, right_edge, level, o) == 1: + return 1 + return 0 + + @cython.cdivision(True) + @cython.boundscheck(False) + @cython.wraparound(False) + cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil: + with gil: + for i in range(self.n_obj): + if (self.selectors[i]).select_cell( + pos, dds) == 1: + return 1 + return 0 + + @cython.cdivision(True) + @cython.boundscheck(False) + @cython.wraparound(False) + cdef int select_point(self, np.float64_t pos[3]) nogil: + with gil: + for i in range(self.n_obj): + if (self.selectors[i]).select_point(pos) == 1: + return 1 + return 0 + + @cython.cdivision(True) + @cython.boundscheck(False) + @cython.wraparound(False) + cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil: + with gil: + for i in range(self.n_obj): + if (self.selectors[i]).select_sphere( + pos, radius) == 1: + return 1 + return 0 + + def _hash_vals(self): + v = ("chained_or",) + for s in self.selectors: + v += s._hash_vals() + return v + +union_selector = ChainedBooleanORSelector + diff -Nru yt-3.3.3/yt/geometry/tests/test_grid_container.py yt-3.4.0/yt/geometry/tests/test_grid_container.py --- yt-3.3.3/yt/geometry/tests/test_grid_container.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/geometry/tests/test_grid_container.py 2017-08-10 18:02:57.000000000 +0000 @@ -57,15 +57,15 @@ grid_indices = [grid.id - grid._id_offset for grid in test_ds.index.grids] grid_nchild = [len(grid.Children) for grid in test_ds.index.grids] - yield assert_equal, levels, grid_levels - yield assert_equal, indices, grid_indices - yield assert_equal, nchild, grid_nchild + assert_equal(levels, grid_levels) + assert_equal(indices, grid_indices) + assert_equal(nchild, grid_nchild) for i, grid in enumerate(test_ds.index.grids): if grid_nchild[i] > 0: grid_children = np.array([child.id - child._id_offset for child in grid.Children]) - yield assert_equal, grid_children, children[i] + assert_equal(grid_children, children[i]) def test_find_points(): """Main test suite for MatchPoints""" @@ -98,30 +98,29 @@ pt_level = grid.Level grid_inds[ind] = grid.id - grid._id_offset - yield assert_equal, point_grid_inds, grid_inds + assert_equal(point_grid_inds, grid_inds) # Test wheter find_points works for lists point_grids, point_grid_inds = test_ds.index._find_points(randx.tolist(), randy.tolist(), randz.tolist()) - yield assert_equal, point_grid_inds, grid_inds + assert_equal(point_grid_inds, grid_inds) # Test if find_points works for scalar ind = random.randint(0, num_points - 1) point_grids, point_grid_inds = test_ds.index._find_points(randx[ind], randy[ind], randz[ind]) - yield assert_equal, point_grid_inds, grid_inds[ind] + assert_equal(point_grid_inds, grid_inds[ind]) # Test if find_points fails properly for non equal indices' array sizes - yield assert_raises, AssertionError, test_ds.index._find_points, \ - [0], 1.0, [2, 3] + assert_raises(AssertionError, test_ds.index._find_points, [0], 1.0, [2, 3]) def test_grid_arrays_view(): ds = setup_test_ds() tree = ds.index._get_grid_tree() grid_arr = tree.grid_arrays - yield assert_equal, grid_arr['left_edge'], ds.index.grid_left_edge - yield assert_equal, grid_arr['right_edge'], ds.index.grid_right_edge - yield assert_equal, grid_arr['dims'], ds.index.grid_dimensions - yield assert_equal, grid_arr['level'], ds.index.grid_levels[:,0] + assert_equal(grid_arr['left_edge'], ds.index.grid_left_edge) + assert_equal(grid_arr['right_edge'], ds.index.grid_right_edge) + assert_equal(grid_arr['dims'], ds.index.grid_dimensions) + assert_equal(grid_arr['level'], ds.index.grid_levels[:,0]) diff -Nru yt-3.3.3/yt/geometry/tests/test_neighbor_search.py yt-3.4.0/yt/geometry/tests/test_neighbor_search.py --- yt-3.3.3/yt/geometry/tests/test_neighbor_search.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/geometry/tests/test_neighbor_search.py 2017-08-10 18:02:57.000000000 +0000 @@ -54,5 +54,5 @@ min_in[i] = np.argmin(np.abs(radius - nearest_neighbors[i])) #if i == 34: raise RuntimeError #dd.field_data.pop(("all", "particle_radius")) - yield assert_equal, (min_in == 63).sum(), min_in.size - yield assert_array_almost_equal, nearest_neighbors, all_neighbors + assert_equal((min_in == 63).sum(), min_in.size) + assert_array_almost_equal(nearest_neighbors, all_neighbors) diff -Nru yt-3.3.3/yt/geometry/tests/test_particle_octree.py yt-3.4.0/yt/geometry/tests/test_particle_octree.py --- yt-3.3.3/yt/geometry/tests/test_particle_octree.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/geometry/tests/test_particle_octree.py 2017-08-10 18:02:57.000000000 +0000 @@ -15,7 +15,6 @@ import numpy as np -import time from yt.frontends.stream.data_structures import load_particles from yt.geometry.oct_container import \ @@ -61,11 +60,11 @@ total_count = np.zeros(len(tc), dtype="int32") for i in sorted(tc): total_count[i] = tc[i] - yield assert_equal, octree.nocts, total_count.sum() + assert_equal(octree.nocts, total_count.sum()) # This visits every cell -- including those covered by octs. #for dom in range(ndom): # level_count += octree.count_levels(total_count.size-1, dom, mask) - yield assert_equal, total_count, [1, 8, 64, 64, 256, 536, 1856, 1672] + assert_equal(total_count, [1, 8, 64, 64, 256, 536, 1856, 1672]) def test_save_load_octree(): np.random.seed(int(0x4d3d3d3)) @@ -85,15 +84,15 @@ always = AlwaysSelector(None) ir1 = octree.ires(always) ir2 = loaded.ires(always) - yield assert_equal, ir1, ir2 + assert_equal(ir1, ir2) fc1 = octree.fcoords(always) fc2 = loaded.fcoords(always) - yield assert_equal, fc1, fc2 + assert_equal(fc1, fc2) fw1 = octree.fwidth(always) fw2 = loaded.fwidth(always) - yield assert_equal, fw1, fw2 + assert_equal(fw1, fw2) def test_particle_octree_counts(): np.random.seed(int(0x4d3d3d3)) @@ -112,9 +111,9 @@ dd = ds.all_data() bi = dd["io","mesh_id"] v = np.bincount(bi.astype("intp")) - yield assert_equal, v.max() <= n_ref, True + assert_equal(v.max() <= n_ref, True) bi2 = dd["all","mesh_id"] - yield assert_equal, bi, bi2 + assert_equal(bi, bi2) def test_particle_overrefine(): np.random.seed(int(0x4d3d3d3)) @@ -140,9 +139,9 @@ dd2 = ds2.all_data() v2 = dict((a, getattr(dd2, a)) for a in _attrs) for a in sorted(v1): - yield assert_equal, v1[a].size * f, v2[a].size + assert_equal(v1[a].size * f, v2[a].size) cv2 = dd2["cell_volume"].sum(dtype="float64") - yield assert_equal, cv1, cv2 + assert_equal(cv1, cv2) index_ptype_snap = "snapshot_033/snap_033.0.hdf5" @requires_file(index_ptype_snap) @@ -156,8 +155,8 @@ cv = dd["cell_volume"] cv_all = dd_all["cell_volume"] cv_pt0 = dd_pt0["cell_volume"] - yield assert_equal, cv.shape, cv_all.shape - yield assert_equal, cv.sum(dtype="float64"), cv_pt0.sum(dtype="float64") + assert_equal(cv.shape, cv_all.shape) + assert_equal(cv.sum(dtype="float64"), cv_pt0.sum(dtype="float64")) class FakeDS: domain_left_edge = None @@ -209,20 +208,15 @@ fr.set_edges(i) selector = RegionSelector(fr) df = reg.identify_data_files(selector) - yield assert_equal, len(df), 1 - yield assert_equal, df[0], i + assert_equal(len(df), 1) + assert_equal(df[0], i) pos[:,0] += 1.0 for mask in reg.masks: maxs = np.unique(mask.max(axis=-1).max(axis=-1)) mins = np.unique(mask.min(axis=-1).min(axis=-1)) - yield assert_equal, maxs, mins - yield assert_equal, maxs, np.unique(mask) - -if __name__=="__main__": - for i in test_add_particles_random(): - i[0](*i[1:]) - time.sleep(1) + assert_equal(maxs, mins) + assert_equal(maxs, np.unique(mask)) def test_position_location(): np.random.seed(int(0x4d3d3d3)) @@ -246,5 +240,6 @@ @requires_file(os33) def test_get_smallest_dx(): ds = yt.load(os33) - yield assert_equal, ds.index.get_smallest_dx(), \ - ds.domain_width / (ds.domain_dimensions*2.**(ds.index.max_level)) + small_dx = ( + ds.domain_width / (ds.domain_dimensions*2.**(ds.index.max_level))) + assert_equal(ds.index.get_smallest_dx(), small_dx) diff -Nru yt-3.3.3/yt/__init__.py yt-3.4.0/yt/__init__.py --- yt-3.3.3/yt/__init__.py 2016-12-12 01:41:06.000000000 +0000 +++ yt-3.4.0/yt/__init__.py 2017-08-10 18:19:54.000000000 +0000 @@ -1,66 +1,10 @@ """ -YT is a package written primarily in Python designed to make the task of -running Enzo easier. It contains facilities for creating Enzo data (currently -in prototype form) as well as runnning Enzo simulations, simulating the actions -of Enzo on various existing data, and analyzing output from Enzo in a -wide-variety of methods. - -An ever-growing collection of documentation is also available at -http://yt-project.org/doc/ . Additionally, there is a -project site at http://yt-project.org/ with recipes, a wiki, a variety of -ways of peering into the version control, and a bug-reporting system. - -YT is divided into several packages. - -frontends ---------- - -This is where interfaces to codes are created. Within each subdirectory of -yt/frontends/ there must exist the following files, even if empty: - -* data_structures.py, where subclasses of AMRGridPatch, Dataset and - AMRHierarchy are defined. -* io.py, where a subclass of IOHandler is defined. -* misc.py, where any miscellaneous functions or classes are defined. -* definitions.py, where any definitions specific to the frontend are - defined. (i.e., header formats, etc.) - -visualization -------------- - -This is where all visualization modules are stored. This includes plot -collections, the volume rendering interface, and pixelization frontends. - -data_objects ------------- - -All objects that handle data, processed or unprocessed, not explicitly -defined as visualization are located in here. This includes the base -classes for data regions, covering grids, time series, and so on. This -also includes derived fields and derived quantities. - -analysis_modules ----------------- - -This is where all mechanisms for processing data live. This includes -things like clump finding, halo profiling, halo finding, and so on. This -is something of a catchall, but it serves as a level of greater -abstraction that simply data selection and modification. - -gui ---- - -This is where all GUI components go. Typically this will be some small -tool used for one or two things, which contains a launching mechanism on -the command line. - -utilities ---------- - -All broadly useful code that doesn't clearly fit in one of the other -categories goes here. - +yt is a toolkit for analyzing and visualizing volumetric data. +* Website: http://yt-project.org +* Documentation: http://yt-project.org/doc +* Data hub: http://hub.yt +* Contribute: http://github.com/yt-project/yt """ @@ -72,7 +16,7 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -__version__ = "3.3.3" +__version__ = "3.4.0" # First module imports import numpy as np # For modern purposes @@ -93,17 +37,24 @@ parallel_profile, \ enable_plugins, \ memory_checker, \ - deprecated_class + deprecated_class, \ + toggle_interactivity from yt.utilities.logger import ytLogger as mylog import yt.utilities.physical_constants as physical_constants import yt.units as units +from yt.units.unit_object import define_unit from yt.units.yt_array import \ YTArray, \ YTQuantity, \ uconcatenate, \ + ucross, \ uintersect1d, \ uunion1d, \ + unorm, \ + udot, \ + uvstack, \ + uhstack, \ loadtxt, \ savetxt @@ -118,7 +69,8 @@ ValidateSpatial, \ ValidateGridType, \ add_field, \ - derived_field + derived_field, \ + add_xray_emissivity_field from yt.data_objects.api import \ DatasetSeries, ImageArray, \ @@ -151,11 +103,13 @@ FixedResolutionBuffer, ObliqueFixedResolutionBuffer, \ write_bitmap, write_image, \ apply_colormap, scale_image, write_projection, \ - SlicePlot, AxisAlignedSlicePlot, OffAxisSlicePlot, \ - ProjectionPlot, OffAxisProjectionPlot, \ + SlicePlot, AxisAlignedSlicePlot, OffAxisSlicePlot, LinePlot, \ + LineBuffer, ProjectionPlot, OffAxisProjectionPlot, \ show_colormaps, add_cmap, make_colormap, \ ProfilePlot, PhasePlot, ParticlePhasePlot, \ - ParticleProjectionPlot, ParticleImageBuffer, ParticlePlot + ParticleProjectionPlot, ParticleImageBuffer, ParticlePlot, \ + FITSImageData, FITSSlice, FITSProjection, FITSOffAxisSlice, \ + FITSOffAxisProjection, plot_2d from yt.visualization.volume_rendering.api import \ volume_render, create_scene, ColorTransferFunction, TransferFunction, \ diff -Nru yt-3.3.3/yt/pmods.py yt-3.4.0/yt/pmods.py --- yt-3.3.3/yt/pmods.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/pmods.py 2017-08-10 18:02:57.000000000 +0000 @@ -79,13 +79,13 @@ # LLC, and shall not be used for advertising or product endorsement # purposes. -"""MPI_Import defines an mpi-aware import hook. The standard use of -this module is as follows: +"""``MPI_Import`` defines an mpi-aware import hook. The standard use of +this module is as follows:: - from MPI_Import import mpi_import - with mpi_import(): - import foo - import bar + from MPI_Import import mpi_import + with mpi_import(): + import foo + import bar Within the with block, the standard import statement is replaced by an MPI-aware import statement. The rank 0 process finds the location of @@ -94,35 +94,35 @@ One CRITICAL detail: any code inside the mpi_import block must be executed exactly the same on all of the MPI ranks. For example, -consider this: +consider this:: -def foo(): - import mpi - if mpi.rank == 0: - bar = someFunction() - bar = mpi.bcast(bar,root=0) - -def someFunction(): - import os - return os.name + def foo(): + import mpi + if mpi.rank == 0: + bar = someFunction() + bar = mpi.bcast(bar,root=0) + + def someFunction(): + import os + return os.name -If foo() is called during the import process, then things may go very +If ``foo()`` is called during the import process, then things may go very wrong. If the os module hasn't been loaded, then the rank 0 process will find os and broadcast its location. Since there's no -corresponding bcast for rank > 0, the other processes will receive +corresponding bcast for ``rank > 0``, the other processes will receive that broadcast instead of the broadcast for bar, resulting in -undefined behavior. Similarly, if rank >0 process encounters an import -that rank 0 does not encounter, that process will either hang waiting +undefined behavior. Similarly, if ``rank > 0`` process encounters an import +that ``rank`` 0 does not encounter, that process will either hang waiting for the bcast, or it will receive an out-of-order bcast. The import hook provides a way to test whether we're using this importer, which can be used to disable rank-asymmetric behavior in a -module import: +module import:: -from yt.extern.six.moves import builtins -hasattr(builtins.__import__,"mpi_import") + from yt.extern.six.moves import builtins + hasattr(builtins.__import__,"mpi_import") -This evaluates to True only when we're in an mpi_import() context +This evaluates to True only when we're in an ``mpi_import()`` context manager. There are some situations where rank-dependent code may be necessary. @@ -130,66 +130,66 @@ tends to cause deadlocks when it is executed inside an mpi_imported module. In that case, we provide a hook to execute a function after the mpi_import hook has been replaced by the standard import hook. -Here is an example showing the use of this feature: +Here is an example showing the use of this feature:: -# encapsulate the rank-asymmetric code in a function -def f(): - if mpi.rank == 0: - doOneThing() + # encapsulate the rank-asymmetric code in a function + def f(): + if mpi.rank == 0: + doOneThing() + else: + doSomethingElse() + + # Either importer is None (standard import) or it's a reference to + # the mpi_import object that owns the current importer. + from yt.extern.six.moves import builtins + importer = getattr(builtins.__import__,"mpi_import",None) + if importer: + importer.callAfterImport(f) else: - doSomethingElse() + # If we're using the standard import, then we'll execute the + # code in f immediately + f() -# Either importer is None (standard import) or it's a reference to -# the mpi_import object that owns the current importer. -from yt.extern.six.moves import builtins -importer = getattr(builtins.__import__,"mpi_import",None) -if importer: - importer.callAfterImport(f) -else: - # If we're using the standard import, then we'll execute the - # code in f immediately - f() - -WARNING: the callAfterImport feature is not intended for casual use. +WARNING: the ``callAfterImport`` feature is not intended for casual use. Usually it will be sufficient (and preferable) to either remove the rank-asymmetric code or explicitly move it outside of the 'with mpi_import' block. callAfterImport is provided for the (hopefully rare!) cases where this does not suffice. +Some implementation details +--------------------------- -Some implementation details: - --This code is based on knee.py, which is an example of a pure Python - hierarchical import that was included with Python 2.6 distributions. +* This code is based on knee.py, which is an example of a pure Python + hierarchical import that was included with Python 2.6 distributions. --Python PEP 302 defines another way to override import by using finder - and loader objects, which behave similarly to the imp.find_module and - imp.load_module functions in __import_module__ below. Unfortunately, - the implementation of PEP 302 is such that the path for the module - has already been found by the time that the "finder" object is - constructed, so it's not suitable for our purposes. - --This module uses pyMPI. It was originally designed with mpi4py, and - switching back to mpi4py requires only minor modifications. To - quickly substitute mpi4py for pyMPI, the 'import mpi' line below can - be replaced with the following wrapper: - -from mpi4py import MPI -class mpi(object): - rank = MPI.COMM_WORLD.Get_rank() - @staticmethod - def bcast(obj=None,root=0): - return MPI.COMM_WORLD.bcast(obj,root) - --An alternate version of this module had rank 0 perform all of the - lookups, and then broadcast the locations all-at-once when that - process reached the end of the context manager. This was somewhat - faster than the current implementation, but was prone to deadlock - when loading modules containing MPI synchronization points. - --The 'level' parameter to the import hook is not handled correctly; we - treat it as if it were -1 (try relative and absolute imports). For - more information about the level parameter, run 'help(__import__)'. +* Python PEP 302 defines another way to override import by using finder + and loader objects, which behave similarly to the imp.find_module and + imp.load_module functions in __import_module__ below. Unfortunately, + the implementation of PEP 302 is such that the path for the module + has already been found by the time that the "finder" object is + constructed, so it's not suitable for our purposes. + +* This module uses pyMPI. It was originally designed with mpi4py, and + switching back to mpi4py requires only minor modifications. To + quickly substitute mpi4py for pyMPI, the 'import mpi' line below can + be replaced with the following wrapper:: + + from mpi4py import MPI + class mpi(object): + rank = MPI.COMM_WORLD.Get_rank() + @staticmethod + def bcast(obj=None,root=0): + return MPI.COMM_WORLD.bcast(obj,root) + +* An alternate version of this module had rank 0 perform all of the + lookups, and then broadcast the locations all-at-once when that + process reached the end of the context manager. This was somewhat + faster than the current implementation, but was prone to deadlock + when loading modules containing MPI synchronization points. + +* The ``level`` parameter to the import hook is not handled correctly; we + treat it as if it were -1 (try relative and absolute imports). For + more information about the level parameter, run ``help(__import__)``. """ from __future__ import print_function diff -Nru yt-3.3.3/yt/testing.py yt-3.4.0/yt/testing.py --- yt-3.3.3/yt/testing.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/testing.py 2017-08-10 18:02:57.000000000 +0000 @@ -32,6 +32,7 @@ from numpy.testing import assert_string_equal # NOQA from numpy.testing import assert_array_almost_equal_nulp # NOQA from numpy.testing import assert_allclose, assert_raises # NOQA +from numpy.random import RandomState from yt.convenience import load from yt.units.yt_array import YTArray, YTQuantity from yt.utilities.exceptions import YTUnitOperationError @@ -180,6 +181,7 @@ negative = False, nprocs = 1, particles = 0, length_unit=1.0, unit_system="cgs", bbox=None): from yt.frontends.stream.api import load_uniform_grid + prng = RandomState(0x4d3d3d3) if not iterable(ndims): ndims = [ndims, ndims, ndims] else: @@ -195,7 +197,7 @@ offsets.append(0.0) data = {} for field, offset, u in zip(fields, offsets, units): - v = (np.random.random(ndims) - offset) * peak_value + v = (prng.random_sample(ndims) - offset) * peak_value if field[0] == "all": data['number_of_particles'] = v.size v = v.ravel() @@ -204,15 +206,17 @@ if particle_fields is not None: for field, unit in zip(particle_fields, particle_field_units): if field in ('particle_position', 'particle_velocity'): - data['io', field] = (np.random.random((particles, 3)), unit) + data['io', field] = ( + prng.random_sample((int(particles), 3)), unit) else: - data['io', field] = (np.random.random(size=particles), unit) + data['io', field] = ( + prng.random_sample(size=int(particles)), unit) else: for f in ('particle_position_%s' % ax for ax in 'xyz'): - data['io', f] = (np.random.random(size=particles), 'code_length') + data['io', f] = (prng.random_sample(size=particles), 'code_length') for f in ('particle_velocity_%s' % ax for ax in 'xyz'): - data['io', f] = (np.random.random(size=particles) - 0.5, 'cm/s') - data['io', 'particle_mass'] = (np.random.random(particles), 'g') + data['io', f] = (prng.random_sample(size=particles) - 0.5, 'cm/s') + data['io', 'particle_mass'] = (prng.random_sample(particles), 'g') data['number_of_particles'] = particles ug = load_uniform_grid(data, ndims, length_unit=length_unit, nprocs=nprocs, unit_system=unit_system, bbox=bbox) @@ -229,8 +233,9 @@ ( (-90.0, -180.0, 0.0), (90.0, 180.0, 1000.0) ), # latlondep } -def fake_amr_ds(fields = ("Density",), geometry = "cartesian"): +def fake_amr_ds(fields = ("Density",), geometry = "cartesian", particles=0): from yt.frontends.stream.api import load_amr_grids + prng = RandomState(0x4d3d3d3) LE, RE = _geom_transforms[geometry] LE = np.array(LE) RE = np.array(RE) @@ -244,7 +249,17 @@ right_edge = right_edge, dimensions = dims) for f in fields: - gdata[f] = np.random.random(dims) + gdata[f] = prng.random_sample(dims) + if particles: + for i, f in enumerate('particle_position_%s' % ax for ax in 'xyz'): + pdata = prng.random_sample(particles) + pdata /= (right_edge[i] - left_edge[i]) + pdata += left_edge[i] + gdata['io', f] = (pdata, 'code_length') + for f in ('particle_velocity_%s' % ax for ax in 'xyz'): + gdata['io', f] = (prng.random_sample(particles) - 0.5, 'cm/s') + gdata['io', 'particle_mass'] = (prng.random_sample(particles), 'g') + gdata['number_of_particles'] = particles data.append(gdata) bbox = np.array([LE, RE]).T return load_amr_grids(data, [32, 32, 32], geometry=geometry, bbox=bbox) @@ -261,6 +276,8 @@ negative = (False, False, False, False, True, True, True), npart = 16**3, length_unit=1.0): from yt.frontends.stream.api import load_particles + + prng = RandomState(0x4d3d3d3) if not iterable(negative): negative = [negative for f in fields] assert(len(fields) == len(negative)) @@ -273,9 +290,9 @@ data = {} for field, offset, u in zip(fields, offsets, units): if "position" in field: - v = np.random.normal(loc=0.5, scale=0.25, size=npart) + v = prng.normal(loc=0.5, scale=0.25, size=npart) np.clip(v, 0.0, 1.0, v) - v = (np.random.random(npart) - offset) + v = (prng.random_sample(npart) - offset) data[field] = (v, u) bbox = np.array([[0.0, 1.0], [0.0, 1.0], [0.0, 1.0]]) ds = load_particles(data, 1.0, bbox=bbox) @@ -287,6 +304,8 @@ from yt.frontends.stream.sample_data.tetrahedral_mesh import \ _connectivity, _coordinates + prng = RandomState(0x4d3d3d3) + # the distance from the origin node_data = {} dist = np.sum(_coordinates**2, 1) @@ -294,7 +313,7 @@ # each element gets a random number elem_data = {} - elem_data[('connect1', 'elem')] = np.random.rand(_connectivity.shape[0]) + elem_data[('connect1', 'elem')] = prng.rand(_connectivity.shape[0]) ds = load_unstructured_mesh(_connectivity, _coordinates, @@ -308,6 +327,7 @@ from yt.frontends.stream.sample_data.hexahedral_mesh import \ _connectivity, _coordinates + prng = RandomState(0x4d3d3d3) # the distance from the origin node_data = {} dist = np.sum(_coordinates**2, 1) @@ -315,7 +335,7 @@ # each element gets a random number elem_data = {} - elem_data[('connect1', 'elem')] = np.random.rand(_connectivity.shape[0]) + elem_data[('connect1', 'elem')] = prng.rand(_connectivity.shape[0]) ds = load_unstructured_mesh(_connectivity-1, _coordinates, @@ -323,6 +343,30 @@ elem_data=elem_data) return ds +def small_fake_hexahedral_ds(): + from yt.frontends.stream.api import load_unstructured_mesh + + _coordinates = np.array([[-1., -1., -1.], + [ 0., -1., -1.], + [ -0., 0., -1.], + [-1., -0., -1.], + [-1., -1., 0.], + [ -0., -1., 0.], + [ -0., 0., -0.], + [-1., 0., -0.]]) + _connectivity = np.array([[1, 2, 3, 4, 5, 6, 7, 8]]) + + # the distance from the origin + node_data = {} + dist = np.sum(_coordinates**2, 1) + node_data[('connect1', 'test')] = dist[_connectivity-1] + + ds = load_unstructured_mesh(_connectivity-1, + _coordinates, + node_data=node_data) + return ds + + def fake_vr_orientation_test_ds(N = 96, scale=1): """ @@ -335,13 +379,13 @@ This dataset allows you to easily explore orientations and handiness in VR and other renderings - Parameters: - ----------- + Parameters + ---------- - N: integer + N : integer The number of cells along each direction - scale: float + scale : float A spatial scale, the domain boundaries will be multiplied by scale to test datasets that have spatial different scales (e.g. data in CGS units) @@ -558,7 +602,7 @@ unit_attr = getattr(ds2, "%s_unit" % u, None) if unit_attr is not None: attrs2.append(unit_attr) - yield assert_equal, attrs1, attrs2 + assert_equal(attrs1, attrs2) # This is an export of the 40 grids in IsolatedGalaxy that are of level 4 or # lower. It's just designed to give a sample AMR index to deal with. @@ -793,17 +837,17 @@ Examples -------- - @check_results - def my_func(ds): - return ds.domain_width + >>> @check_results + ... def my_func(ds): + ... return ds.domain_width - my_func(ds) + >>> my_func(ds) - @check_results - def field_checker(dd, field_name): - return dd[field_name] + >>> @check_results + ... def field_checker(dd, field_name): + ... return dd[field_name] - field_cheker(ds.all_data(), 'density', result_basename='density') + >>> field_cheker(ds.all_data(), 'density', result_basename='density') """ def compute_results(func): @@ -875,7 +919,7 @@ yield center def run_nose(verbose=False, run_answer_tests=False, answer_big_data=False, - call_pdb = False): + call_pdb=False, module=None): from yt.utilities.on_demand_imports import _nose import sys from yt.utilities.logger import ytLogger as mylog @@ -891,6 +935,8 @@ nose_argv.append('--with-answer-testing') if answer_big_data: nose_argv.append('--answer-big-data') + if module: + nose_argv.append(module) initial_dir = os.getcwd() yt_file = os.path.abspath(__file__) yt_dir = os.path.dirname(yt_file) @@ -934,9 +980,12 @@ with the units of ``actual`` and ``desired``. If no units are attached, assumes the same units as ``desired``. Defaults to zero. + Notes + ----- Also accepts additional keyword arguments accepted by :func:`numpy.testing.assert_allclose`, see the documentation of that function for details. + """ # Create a copy to ensure this function does not alter input arrays act = YTArray(actual) @@ -970,3 +1019,30 @@ at = at.value return assert_allclose(act, des, rt, at, **kwargs) + +def assert_fname(fname): + """Function that checks file type using libmagic""" + if fname is None: + return + + with open(fname, 'rb') as fimg: + data = fimg.read() + image_type = '' + + # see http://www.w3.org/TR/PNG/#5PNG-file-signature + if data.startswith(b'\211PNG\r\n\032\n'): + image_type = '.png' + # see http://www.mathguide.de/info/tools/media-types/image/jpeg + elif data.startswith(b'\377\330'): + image_type = '.jpeg' + elif data.startswith(b'%!PS-Adobe'): + data_str = data.decode("utf-8", "ignore") + if 'EPSF' in data_str[:data_str.index('\n')]: + image_type = '.eps' + else: + image_type = '.ps' + elif data.startswith(b'%PDF'): + image_type = '.pdf' + + return image_type == os.path.splitext(fname)[1] + diff -Nru yt-3.3.3/yt/tests/test_flake8.py yt-3.4.0/yt/tests/test_flake8.py --- yt-3.3.3/yt/tests/test_flake8.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/tests/test_flake8.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,6 +1,8 @@ import subprocess import yt import os +import sys +import tempfile from yt.testing import requires_module @@ -8,17 +10,19 @@ @requires_module('flake8') def test_flake8(): yt_dir = os.path.dirname(os.path.abspath(yt.__file__)) - output_file = os.environ.get("WORKSPACE", None) or os.getcwd() + output_file = os.environ.get("WORKSPACE", None) or tempfile.mkdtemp() output_file = os.path.join(output_file, 'flake8.out') if os.path.exists(output_file): os.remove(output_file) output_string = "--output-file=%s" % output_file config_string = "--config=%s" % os.path.join(os.path.dirname(yt_dir), 'setup.cfg') - subprocess.call(['flake8', output_string, config_string, yt_dir]) - - with open(output_file) as f: - flake8_output = f.readlines() - if flake8_output != []: - raise AssertionError( - "flake8 found style errors:\n\n%s" % "\n".join(flake8_output)) + subprocess.call([sys.executable, '-m', 'flake8', output_string, + config_string, yt_dir]) + + if os.path.exists(output_file): + with open(output_file) as f: + flake8_output = f.readlines() + if flake8_output != []: + raise AssertionError( + "flake8 found style errors:\n\n%s" % "\n".join(flake8_output)) diff -Nru yt-3.3.3/yt/units/dimensions.py yt-3.4.0/yt/units/dimensions.py --- yt-3.3.3/yt/units/dimensions.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/units/dimensions.py 2017-08-10 18:02:57.000000000 +0000 @@ -32,6 +32,8 @@ rate = 1 / time frequency = rate +solid_angle = angle * angle + velocity = length / time acceleration = length / time**2 jerk = length / time**3 @@ -53,6 +55,8 @@ angular_momentum = mass*length*velocity specific_angular_momentum = angular_momentum / mass specific_energy = energy / mass +count_flux = 1 / (area*time) +count_intensity = count_flux / solid_angle # Gaussian electromagnetic units charge_cgs = (energy * length)**Rational(1, 2) # proper 1/2 power @@ -77,8 +81,6 @@ resistance = resistance_cgs current = current_cgs -solid_angle = angle * angle - derived_dimensions = [rate, velocity, acceleration, jerk, snap, crackle, pop, momentum, force, energy, power, charge_cgs, electric_field_cgs, magnetic_field_cgs, solid_angle, flux, specific_flux, volume, diff -Nru yt-3.3.3/yt/units/tests/test_define_unit.py yt-3.4.0/yt/units/tests/test_define_unit.py --- yt-3.3.3/yt/units/tests/test_define_unit.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/units/tests/test_define_unit.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,25 @@ +from yt.units.unit_object import define_unit +from yt.units.yt_array import YTQuantity +from yt.convenience import load +from yt.testing import requires_file + +def test_define_unit(): + define_unit("mph", (1.0, "mile/hr")) + a = YTQuantity(2.0, "mph") + b = YTQuantity(1.0, "mile") + c = YTQuantity(1.0, "hr") + assert a == 2.0*b/c + d = YTQuantity(1000.0, "cm**3") + define_unit("L", d, prefixable=True) + e = YTQuantity(1.0, "mL") + f = YTQuantity(1.0, "cm**3") + assert e == f + +gslr = "GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0300" +@requires_file(gslr) +def test_define_unit_dataset(): + ds = load(gslr) + ds.define_unit("fortnight", (14.0, "day")) + a = ds.quan(1.0, "fortnight") + b = ds.quan(3600.0*24.0*14.0, "code_time") + assert a == b diff -Nru yt-3.3.3/yt/units/tests/test_units.py yt-3.4.0/yt/units/tests/test_units.py --- yt-3.3.3/yt/units/tests/test_units.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/units/tests/test_units.py 2017-08-10 18:02:57.000000000 +0000 @@ -26,6 +26,7 @@ fake_random_ds, assert_allclose_units, \ assert_almost_equal from yt.units.unit_registry import UnitRegistry +from yt.units import electrostatic_unit, elementary_charge # dimensions from yt.units.dimensions import \ @@ -65,7 +66,6 @@ raise RuntimeError full_set.add(new_symbol) - yield assert_true, True def test_dimensionless(): """ @@ -74,20 +74,20 @@ """ u1 = Unit() - yield assert_true, u1.is_dimensionless - yield assert_true, u1.expr == 1 - yield assert_true, u1.base_value == 1 - yield assert_true, u1.dimensions == 1 + assert_true(u1.is_dimensionless) + assert_true(u1.expr == 1) + assert_true(u1.base_value == 1) + assert_true(u1.dimensions == 1) u2 = Unit("") - yield assert_true, u2.is_dimensionless - yield assert_true, u2.expr == 1 - yield assert_true, u2.base_value == 1 - yield assert_true, u2.dimensions == 1 + assert_true(u2.is_dimensionless) + assert_true(u2.expr == 1) + assert_true(u2.base_value == 1) + assert_true(u2.dimensions == 1) - yield assert_equal, u1.latex_repr, '' - yield assert_equal, u2.latex_repr, '' + assert_equal(u1.latex_repr, '') + assert_equal(u2.latex_repr, '') # # Start init tests @@ -100,39 +100,38 @@ """ u1 = Unit("g * cm**2 * s**-2") - yield assert_true, u1.dimensions == energy - yield assert_true, u1.base_value == 1.0 + assert_true(u1.dimensions == energy) + assert_true(u1.base_value == 1.0) # make sure order doesn't matter u2 = Unit("cm**2 * s**-2 * g") - yield assert_true, u2.dimensions == energy - yield assert_true, u2.base_value == 1.0 + assert_true(u2.dimensions == energy) + assert_true(u2.base_value == 1.0) # Test rationals u3 = Unit("g**0.5 * cm**-0.5 * s**-1") - yield assert_true, u3.dimensions == magnetic_field - yield assert_true, u3.base_value == 1.0 + assert_true(u3.dimensions == magnetic_field) + assert_true(u3.base_value == 1.0) # sqrt functions u4 = Unit("sqrt(g)/sqrt(cm)/s") - yield assert_true, u4.dimensions == magnetic_field - yield assert_true, u4.base_value == 1.0 + assert_true(u4.dimensions == magnetic_field) + assert_true(u4.base_value == 1.0) # commutative sqrt function u5 = Unit("sqrt(g/cm)/s") - yield assert_true, u5.dimensions == magnetic_field - yield assert_true, u5.base_value == 1.0 + assert_true(u5.dimensions == magnetic_field) + assert_true(u5.base_value == 1.0) # nonzero CGS conversion factor u6 = Unit("Msun/pc**3") - yield assert_true, u6.dimensions == mass/length**3 - yield assert_array_almost_equal_nulp, np.array([u6.base_value]), \ - np.array([mass_sun_grams/cm_per_pc**3]) - - yield assert_raises, UnitParseError, Unit, 'm**m' - yield assert_raises, UnitParseError, Unit, 'm**g' - yield assert_raises, UnitParseError, Unit, 'm+g' - yield assert_raises, UnitParseError, Unit, 'm-g' + assert_true(u6.dimensions == mass/length**3) + assert_array_almost_equal_nulp(np.array([u6.base_value]), np.array([mass_sun_grams/cm_per_pc**3])) + + assert_raises(UnitParseError, Unit, 'm**m') + assert_raises(UnitParseError, Unit, 'm**g') + assert_raises(UnitParseError, Unit, 'm+g') + assert_raises(UnitParseError, Unit, 'm-g') def test_create_from_expr(): @@ -156,20 +155,20 @@ u3 = Unit(s3) u4 = Unit(s4) - yield assert_true, u1.expr == s1 - yield assert_true, u2.expr == s2 - yield assert_true, u3.expr == s3 - yield assert_true, u4.expr == s4 - - yield assert_allclose_units, u1.base_value, pc_cgs, 1e-12 - yield assert_allclose_units, u2.base_value, yr_cgs, 1e-12 - yield assert_allclose_units, u3.base_value, pc_cgs * yr_cgs, 1e-12 - yield assert_allclose_units, u4.base_value, pc_cgs**2 / yr_cgs, 1e-12 - - yield assert_true, u1.dimensions == length - yield assert_true, u2.dimensions == time - yield assert_true, u3.dimensions == length * time - yield assert_true, u4.dimensions == length**2 / time + assert_true(u1.expr == s1) + assert_true(u2.expr == s2) + assert_true(u3.expr == s3) + assert_true(u4.expr == s4) + + assert_allclose_units(u1.base_value, pc_cgs, 1e-12) + assert_allclose_units(u2.base_value, yr_cgs, 1e-12) + assert_allclose_units(u3.base_value, pc_cgs * yr_cgs, 1e-12) + assert_allclose_units(u4.base_value, pc_cgs**2 / yr_cgs, 1e-12) + + assert_true(u1.dimensions == length) + assert_true(u2.dimensions == time) + assert_true(u3.dimensions == length * time) + assert_true(u4.dimensions == length**2 / time) def test_create_with_duplicate_dimensions(): @@ -183,11 +182,11 @@ km_cgs = cm_per_km Mpc_cgs = cm_per_mpc - yield assert_true, u1.base_value == 1 - yield assert_true, u1.dimensions == power + assert_true(u1.base_value == 1) + assert_true(u1.dimensions == power) - yield assert_allclose_units, u2.base_value, km_cgs / Mpc_cgs, 1e-12 - yield assert_true, u2.dimensions == rate + assert_allclose_units(u2.base_value, km_cgs / Mpc_cgs, 1e-12) + assert_true(u2.dimensions == rate) def test_create_new_symbol(): """ @@ -196,21 +195,21 @@ """ u1 = Unit("abc", base_value=42, dimensions=(mass/time)) - yield assert_true, u1.expr == Symbol("abc", positive=True) - yield assert_true, u1.base_value == 42 - yield assert_true, u1.dimensions == mass / time + assert_true(u1.expr == Symbol("abc", positive=True)) + assert_true(u1.base_value == 42) + assert_true(u1.dimensions == mass / time) u1 = Unit("abc", base_value=42, dimensions=length**3) - yield assert_true, u1.expr == Symbol("abc", positive=True) - yield assert_true, u1.base_value == 42 - yield assert_true, u1.dimensions == length**3 + assert_true(u1.expr == Symbol("abc", positive=True)) + assert_true(u1.base_value == 42) + assert_true(u1.dimensions == length**3) u1 = Unit("abc", base_value=42, dimensions=length*(mass*length)) - yield assert_true, u1.expr == Symbol("abc", positive=True) - yield assert_true, u1.base_value == 42 - yield assert_true, u1.dimensions == length**2*mass + assert_true(u1.expr == Symbol("abc", positive=True)) + assert_true(u1.base_value == 42) + assert_true( u1.dimensions == length**2*mass) assert_raises(UnitParseError, Unit, 'abc', base_value=42, dimensions=length**length) @@ -229,9 +228,9 @@ try: Unit(Symbol("jigawatts")) except UnitParseError: - yield assert_true, True + assert_true(True) else: - yield assert_true, False + assert_true(False) def test_create_fail_on_bad_symbol_type(): """ @@ -241,9 +240,9 @@ try: Unit([1]) # something other than Expr and str except UnitParseError: - yield assert_true, True + assert_true(True) else: - yield assert_true, False + assert_true(False) def test_create_fail_on_bad_dimensions_type(): """ @@ -253,9 +252,9 @@ try: Unit("a", base_value=1, dimensions="(mass)") except UnitParseError: - yield assert_true, True + assert_true(True) else: - yield assert_true, False + assert_true(False) def test_create_fail_on_dimensions_content(): @@ -270,7 +269,7 @@ except UnitParseError: pass else: - yield assert_true, False + assert_true(False) def test_create_fail_on_base_value_type(): @@ -281,9 +280,9 @@ try: Unit("a", base_value="a", dimensions=(mass/time)) except UnitParseError: - yield assert_true, True + assert_true(True) else: - yield assert_true, False + assert_true(False) # # End init tests @@ -299,11 +298,11 @@ speed = pc / Myr dimensionless = Unit() - yield assert_true, str(pc) == "pc" - yield assert_true, str(Myr) == "Myr" - yield assert_true, str(speed) == "pc/Myr" - yield assert_true, repr(speed) == "pc/Myr" - yield assert_true, str(dimensionless) == "dimensionless" + assert_true(str(pc) == "pc") + assert_true(str(Myr) == "Myr") + assert_true(str(speed) == "pc/Myr") + assert_true(repr(speed) == "pc/Myr") + assert_true(str(dimensionless) == "dimensionless") # # Start operation tests @@ -329,9 +328,9 @@ # Mul operation u3 = u1 * u2 - yield assert_true, u3.expr == msun_sym * pc_sym - yield assert_allclose_units, u3.base_value, msun_cgs * pc_cgs, 1e-12 - yield assert_true, u3.dimensions == mass * length + assert_true(u3.expr == msun_sym * pc_sym) + assert_allclose_units(u3.base_value, msun_cgs * pc_cgs, 1e-12) + assert_true(u3.dimensions == mass * length) # Pow and Mul operations u4 = Unit("pc**2") @@ -339,9 +338,9 @@ u6 = u4 * u5 - yield assert_true, u6.expr == pc_sym**2 * msun_sym * s_sym - yield assert_allclose_units, u6.base_value, pc_cgs**2 * msun_cgs, 1e-12 - yield assert_true, u6.dimensions == length**2 * mass * time + assert_true(u6.expr == pc_sym**2 * msun_sym * s_sym) + assert_allclose_units(u6.base_value, pc_cgs**2 * msun_cgs, 1e-12) + assert_true(u6.dimensions == length**2 * mass * time) def test_division(): @@ -363,9 +362,9 @@ u3 = u1 / u2 - yield assert_true, u3.expr == pc_sym / (km_sym * s_sym) - yield assert_allclose_units, u3.base_value, pc_cgs / km_cgs, 1e-12 - yield assert_true, u3.dimensions == 1 / time + assert_true(u3.expr == pc_sym / (km_sym * s_sym)) + assert_allclose_units(u3.base_value, pc_cgs / km_cgs, 1e-12) + assert_true(u3.dimensions == 1 / time) def test_power(): @@ -382,13 +381,13 @@ u2 = u1**2 - yield assert_true, u2.dimensions == u1_dims**2 - yield assert_allclose_units, u2.base_value, (pc_cgs**2 * mK_cgs**4)**2, 1e-12 + assert_true(u2.dimensions == u1_dims**2) + assert_allclose_units(u2.base_value, (pc_cgs**2 * mK_cgs**4)**2, 1e-12) u3 = u1**(-1.0/3) - yield assert_true, u3.dimensions == nsimplify(u1_dims**(-1.0/3)) - yield assert_allclose_units, u3.base_value, (pc_cgs**2 * mK_cgs**4)**(-1.0/3), 1e-12 + assert_true(u3.dimensions == nsimplify(u1_dims**(-1.0/3))) + assert_allclose_units(u3.base_value, (pc_cgs**2 * mK_cgs**4)**(-1.0/3), 1e-12) def test_equality(): @@ -399,7 +398,7 @@ u1 = Unit("km * s**-1") u2 = Unit("m * ms**-1") - yield assert_true, u1 == u2 + assert_true(u1 == u2) # # End operation tests. @@ -417,21 +416,20 @@ u2 = Unit("g * cm**-3") u3 = u1.get_base_equivalent() - yield assert_true, u2.expr == u3.expr - yield assert_true, u2 == u3 + assert_true(u2.expr == u3.expr) + assert_true(u2 == u3) - yield assert_allclose_units, u1.base_value, Msun_cgs / Mpc_cgs**3, 1e-12 - yield assert_true, u2.base_value == 1 - yield assert_true, u3.base_value == 1 + assert_allclose_units(u1.base_value, Msun_cgs / Mpc_cgs**3, 1e-12) + assert_true(u2.base_value == 1) + assert_true(u3.base_value == 1) mass_density = mass / length**3 - yield assert_true, u1.dimensions == mass_density - yield assert_true, u2.dimensions == mass_density - yield assert_true, u3.dimensions == mass_density + assert_true(u1.dimensions == mass_density) + assert_true(u2.dimensions == mass_density) + assert_true(u3.dimensions == mass_density) - yield assert_allclose_units, get_conversion_factor(u1, u3)[0], \ - Msun_cgs / Mpc_cgs**3, 1e-12 + assert_allclose_units(get_conversion_factor(u1, u3)[0], Msun_cgs / Mpc_cgs**3, 1e-12) def test_is_code_unit(): ds = fake_random_ds(64, nprocs=1) @@ -442,12 +440,12 @@ u5 = Unit('code_mass*g', registry=ds.unit_registry) u6 = Unit('g/cm**3') - yield assert_true, u1.is_code_unit - yield assert_true, u2.is_code_unit - yield assert_true, u3.is_code_unit - yield assert_true, u4.is_code_unit - yield assert_true, not u5.is_code_unit - yield assert_true, not u6.is_code_unit + assert_true(u1.is_code_unit) + assert_true(u2.is_code_unit) + assert_true(u3.is_code_unit) + assert_true(u4.is_code_unit) + assert_true(not u5.is_code_unit) + assert_true(not u6.is_code_unit) def test_temperature_offsets(): u1 = Unit('degC') @@ -487,22 +485,22 @@ lat = unit_symbols.lat lon = unit_symbols.lon deg = unit_symbols.deg - yield assert_equal, lat.units.base_offset, 90.0 - yield assert_equal, (deg*90.0).in_units("lat").value, 0.0 - yield assert_equal, (deg*180).in_units("lat").value, -90.0 - yield assert_equal, (lat*0.0).in_units("deg"), deg*90.0 - yield assert_equal, (lat*-90).in_units("deg"), deg*180 - - yield assert_equal, lon.units.base_offset, -180.0 - yield assert_equal, (deg*0.0).in_units("lon").value, -180.0 - yield assert_equal, (deg*90.0).in_units("lon").value, -90.0 - yield assert_equal, (deg*180).in_units("lon").value, 0.0 - yield assert_equal, (deg*360).in_units("lon").value, 180.0 - - yield assert_equal, (lon*-180.0).in_units("deg"), deg*0.0 - yield assert_equal, (lon*-90.0).in_units("deg"), deg*90.0 - yield assert_equal, (lon*0.0).in_units("deg"), deg*180.0 - yield assert_equal, (lon*180.0).in_units("deg"), deg*360 + assert_equal(lat.units.base_offset, 90.0) + assert_equal((deg*90.0).in_units("lat").value, 0.0) + assert_equal((deg*180).in_units("lat").value, -90.0) + assert_equal((lat*0.0).in_units("deg"), deg*90.0) + assert_equal((lat*-90).in_units("deg"), deg*180) + + assert_equal(lon.units.base_offset, -180.0) + assert_equal((deg*0.0).in_units("lon").value, -180.0) + assert_equal((deg*90.0).in_units("lon").value, -90.0) + assert_equal((deg*180).in_units("lon").value, 0.0) + assert_equal((deg*360).in_units("lon").value, 180.0) + + assert_equal((lon*-180.0).in_units("deg"), deg*0.0) + assert_equal((lon*-90.0).in_units("deg"), deg*90.0) + assert_equal((lon*0.0).in_units("deg"), deg*180.0) + assert_equal((lon*180.0).in_units("deg"), deg*360) def test_registry_json(): reg = UnitRegistry() @@ -510,3 +508,18 @@ unserialized_reg = UnitRegistry.from_json(json_reg) assert_equal(reg.lut, unserialized_reg.lut) + +def test_creation_from_ytarray(): + u1 = Unit(electrostatic_unit) + assert_equal(str(u1), 'esu') + assert_equal(u1, Unit('esu')) + assert_equal(u1, electrostatic_unit.units) + + u2 = Unit(elementary_charge) + assert_equal(str(u2), '4.8032056e-10*esu') + assert_equal(u2, Unit('4.8032056e-10*esu')) + assert_equal(u1, elementary_charge.units) + + assert_equal((u1/u2).base_value, electrostatic_unit/elementary_charge) + + assert_raises(UnitParseError, Unit, [1, 2, 3]*elementary_charge) diff -Nru yt-3.3.3/yt/units/tests/test_unit_systems.py yt-3.4.0/yt/units/tests/test_unit_systems.py --- yt-3.3.3/yt/units/tests/test_unit_systems.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/units/tests/test_unit_systems.py 2017-08-10 18:02:57.000000000 +0000 @@ -15,7 +15,8 @@ from yt.units.unit_systems import UnitSystem from yt.units import dimensions from yt.convenience import load -from yt.testing import assert_almost_equal, assert_allclose, requires_file +from yt.testing import assert_almost_equal, assert_allclose, requires_file, \ + fake_random_ds from yt.config import ytcfg def test_unit_systems(): @@ -69,11 +70,7 @@ ds = load(gslr, unit_system=us) dd = ds.sphere("c", (15.,"kpc")) for field in test_fields: - if us == "code": - # For this dataset code units are cgs - v1 = dd_cgs[field] - else: - v1 = dd_cgs[field].in_base(us) + v1 = dd_cgs[field].in_base(us) v2 = dd[field] assert_almost_equal(v1.v, v2.v) assert str(v2.units) == test_units[us][field] @@ -88,7 +85,7 @@ for us in test_units: ds = load(etc, unit_system=us) - dd = ds.sphere("max", (500.,"kpc")) + dd = ds.sphere("max", (500., "kpc")) for field in test_fields: if us == "code": v1 = dd_cgs[field].in_units(test_units["code"][field]) @@ -108,7 +105,7 @@ ad = ds.all_data() dens = ad['density'] magx = ad['magx'] - magnetic_field_x = ad['magnetic_field_x'] + magnetic_field_x = ad['magnetic_field_r'] if us == 'cgs': assert str(dens.units) == 'g/cm**3' @@ -137,3 +134,14 @@ assert_allclose(magx.value, magnetic_field_x.value) assert_allclose(magnetic_field_x.to_equivalent('G', 'CGS').value, magnetic_field_x.value*1e4) + +def test_code_unit_system_uniqueness(): + ds1 = fake_random_ds(64) + ds2 = fake_random_ds(64, length_unit=2.0) + ds3 = fake_random_ds(64) + + assert ds1.unit_registry.unit_system_id != ds2.unit_registry.unit_system_id + assert ds1.unit_registry.unit_system_id == ds3.unit_registry.unit_system_id + + assert ds1.unit_registry.unit_system_id in unit_system_registry.keys() + assert ds2.unit_registry.unit_system_id in unit_system_registry.keys() \ No newline at end of file diff -Nru yt-3.3.3/yt/units/tests/test_ytarray.py yt-3.4.0/yt/units/tests/test_ytarray.py --- yt-3.3.3/yt/units/tests/test_ytarray.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/units/tests/test_ytarray.py 2017-08-10 18:02:57.000000000 +0000 @@ -23,6 +23,7 @@ import shutil import tempfile +from distutils.version import LooseVersion from nose.tools import assert_true from numpy.testing import \ assert_array_equal, \ @@ -39,7 +40,8 @@ from yt.utilities.exceptions import \ YTUnitOperationError, YTUfuncUnitError from yt.testing import \ - fake_random_ds, requires_module, \ + fake_random_ds, \ + requires_module, \ assert_allclose_units from yt.funcs import fix_length from yt.units.unit_symbols import \ @@ -68,14 +70,14 @@ a3 = [4*cm, 5*cm, 6*cm] answer = YTArray([5, 7, 9], 'cm') - yield operate_and_compare, a1, a2, operator.add, answer - yield operate_and_compare, a2, a1, operator.add, answer - yield operate_and_compare, a1, a3, operator.add, answer - yield operate_and_compare, a3, a1, operator.add, answer - yield operate_and_compare, a2, a1, np.add, answer - yield operate_and_compare, a1, a2, np.add, answer - yield operate_and_compare, a1, a3, np.add, answer - yield operate_and_compare, a3, a1, np.add, answer + operate_and_compare(a1, a2, operator.add, answer) + operate_and_compare(a2, a1, operator.add, answer) + operate_and_compare(a1, a3, operator.add, answer) + operate_and_compare(a3, a1, operator.add, answer) + operate_and_compare(a2, a1, np.add, answer) + operate_and_compare(a1, a2, np.add, answer) + operate_and_compare(a1, a3, np.add, answer) + operate_and_compare(a3, a1, np.add, answer) # different units a1 = YTArray([1, 2, 3], 'cm') @@ -84,12 +86,20 @@ answer1 = YTArray([401, 502, 603], 'cm') answer2 = YTArray([4.01, 5.02, 6.03], 'm') - yield operate_and_compare, a1, a2, operator.add, answer1 - yield operate_and_compare, a2, a1, operator.add, answer2 - yield operate_and_compare, a1, a3, operator.add, answer1 - yield operate_and_compare, a3, a1, operator.add, answer1 - yield assert_raises, YTUfuncUnitError, np.add, a1, a2 - yield assert_raises, YTUfuncUnitError, np.add, a1, a3 + operate_and_compare(a1, a2, operator.add, answer1) + operate_and_compare(a2, a1, operator.add, answer2) + operate_and_compare(a1, a3, operator.add, answer1) + if LooseVersion(np.__version__) < LooseVersion('1.13.0'): + operate_and_compare(a3, a1, operator.add, answer1) + assert_raises(YTUfuncUnitError, np.add, a1, a2) + assert_raises(YTUfuncUnitError, np.add, a1, a3) + else: + operate_and_compare(a3, a1, operator.add, answer2) + operate_and_compare(a1, a2, np.add, answer1) + operate_and_compare(a2, a1, np.add, answer2) + operate_and_compare(a1, a3, np.add, answer1) + operate_and_compare(a3, a1, np.add, answer2) + # Test dimensionless quantities a1 = YTArray([1, 2, 3]) @@ -97,21 +107,31 @@ a3 = [4, 5, 6] answer = YTArray([5, 7, 9]) - yield operate_and_compare, a1, a2, operator.add, answer - yield operate_and_compare, a2, a1, operator.add, answer - yield operate_and_compare, a1, a3, operator.add, answer - yield operate_and_compare, a3, a1, operator.add, answer - yield operate_and_compare, a1, a2, np.add, answer - yield operate_and_compare, a2, a1, np.add, answer - yield operate_and_compare, a1, a3, np.add, answer - yield operate_and_compare, a3, a1, np.add, answer + operate_and_compare(a1, a2, operator.add, answer) + operate_and_compare(a2, a1, operator.add, answer) + operate_and_compare(a1, a3, operator.add, answer) + operate_and_compare(a3, a1, operator.add, answer) + operate_and_compare(a1, a2, np.add, answer) + operate_and_compare(a2, a1, np.add, answer) + operate_and_compare(a1, a3, np.add, answer) + operate_and_compare(a3, a1, np.add, answer) # Catch the different dimensions error a1 = YTArray([1, 2, 3], 'm') a2 = YTArray([4, 5, 6], 'kg') + a3 = [7, 8, 9] + a4 = YTArray([10, 11, 12], '') - yield assert_raises, YTUnitOperationError, operator.add, a1, a2 - yield assert_raises, YTUnitOperationError, operator.iadd, a1, a2 + assert_raises(YTUnitOperationError, operator.add, a1, a2) + assert_raises(YTUnitOperationError, operator.iadd, a1, a2) + assert_raises(YTUnitOperationError, operator.add, a1, a3) + assert_raises(YTUnitOperationError, operator.iadd, a1, a3) + assert_raises(YTUnitOperationError, operator.add, a3, a1) + assert_raises(YTUnitOperationError, operator.iadd, a3, a1) + assert_raises(YTUnitOperationError, operator.add, a1, a4) + assert_raises(YTUnitOperationError, operator.iadd, a1, a4) + assert_raises(YTUnitOperationError, operator.add, a4, a1) + assert_raises(YTUnitOperationError, operator.iadd, a4, a1) # adding with zero is allowed irrespective of the units zeros = np.zeros(3) @@ -123,10 +143,10 @@ for op in [operator.add, np.add]: for operand in operands: - yield operate_and_compare, a1, operand, op, a1 - yield operate_and_compare, operand, a1, op, a1 - yield operate_and_compare, 4*m, operand, op, 4*m - yield operate_and_compare, operand, 4*m, op, 4*m + operate_and_compare(a1, operand, op, a1) + operate_and_compare(operand, a1, op, a1) + operate_and_compare(4*m, operand, op, 4*m) + operate_and_compare(operand, 4*m, op, 4*m) def test_subtraction(): """ @@ -141,14 +161,14 @@ answer1 = YTArray([-3, -3, -3], 'cm') answer2 = YTArray([3, 3, 3], 'cm') - yield operate_and_compare, a1, a2, operator.sub, answer1 - yield operate_and_compare, a2, a1, operator.sub, answer2 - yield operate_and_compare, a1, a3, operator.sub, answer1 - yield operate_and_compare, a3, a1, operator.sub, answer2 - yield operate_and_compare, a1, a2, np.subtract, answer1 - yield operate_and_compare, a2, a1, np.subtract, answer2 - yield operate_and_compare, a1, a3, np.subtract, answer1 - yield operate_and_compare, a3, a1, np.subtract, answer2 + operate_and_compare(a1, a2, operator.sub, answer1) + operate_and_compare(a2, a1, operator.sub, answer2) + operate_and_compare(a1, a3, operator.sub, answer1) + operate_and_compare(a3, a1, operator.sub, answer2) + operate_and_compare(a1, a2, np.subtract, answer1) + operate_and_compare(a2, a1, np.subtract, answer2) + operate_and_compare(a1, a3, np.subtract, answer1) + operate_and_compare(a3, a1, np.subtract, answer2) # different units a1 = YTArray([1, 2, 3], 'cm') @@ -158,12 +178,18 @@ answer2 = YTArray([3.99, 4.98, 5.97], 'm') answer3 = YTArray([399, 498, 597], 'cm') - yield operate_and_compare, a1, a2, operator.sub, answer1 - yield operate_and_compare, a2, a1, operator.sub, answer2 - yield operate_and_compare, a1, a3, operator.sub, answer1 - yield operate_and_compare, a3, a1, operator.sub, answer3 - yield assert_raises, YTUfuncUnitError, np.subtract, a1, a2 - yield assert_raises, YTUfuncUnitError, np.subtract, a1, a3 + operate_and_compare(a1, a2, operator.sub, answer1) + operate_and_compare(a2, a1, operator.sub, answer2) + operate_and_compare(a1, a3, operator.sub, answer1) + operate_and_compare(a3, a1, operator.sub, answer3) + if LooseVersion(np.__version__) < LooseVersion('1.13.0'): + assert_raises(YTUfuncUnitError, np.subtract, a1, a2) + assert_raises(YTUfuncUnitError, np.subtract, a1, a3) + else: + operate_and_compare(a1, a2, np.subtract, answer1) + operate_and_compare(a2, a1, np.subtract, answer2) + operate_and_compare(a1, a3, np.subtract, answer1) + operate_and_compare(a3, a1, np.subtract, answer3) # Test dimensionless quantities a1 = YTArray([1, 2, 3]) @@ -172,21 +198,31 @@ answer1 = YTArray([-3, -3, -3]) answer2 = YTArray([3, 3, 3]) - yield operate_and_compare, a1, a2, operator.sub, answer1 - yield operate_and_compare, a2, a1, operator.sub, answer2 - yield operate_and_compare, a1, a3, operator.sub, answer1 - yield operate_and_compare, a3, a1, operator.sub, answer2 - yield operate_and_compare, a1, a2, np.subtract, answer1 - yield operate_and_compare, a2, a1, np.subtract, answer2 - yield operate_and_compare, a1, a3, np.subtract, answer1 - yield operate_and_compare, a3, a1, np.subtract, answer2 + operate_and_compare(a1, a2, operator.sub, answer1) + operate_and_compare(a2, a1, operator.sub, answer2) + operate_and_compare(a1, a3, operator.sub, answer1) + operate_and_compare(a3, a1, operator.sub, answer2) + operate_and_compare(a1, a2, np.subtract, answer1) + operate_and_compare(a2, a1, np.subtract, answer2) + operate_and_compare(a1, a3, np.subtract, answer1) + operate_and_compare(a3, a1, np.subtract, answer2) # Catch the different dimensions error a1 = YTArray([1, 2, 3], 'm') a2 = YTArray([4, 5, 6], 'kg') + a3 = [7, 8, 9] + a4 = YTArray([10, 11, 12], '') - yield assert_raises, YTUnitOperationError, operator.sub, a1, a2 - yield assert_raises, YTUnitOperationError, operator.isub, a1, a2 + assert_raises(YTUnitOperationError, operator.sub, a1, a2) + assert_raises(YTUnitOperationError, operator.isub, a1, a2) + assert_raises(YTUnitOperationError, operator.sub, a1, a3) + assert_raises(YTUnitOperationError, operator.isub, a1, a3) + assert_raises(YTUnitOperationError, operator.sub, a3, a1) + assert_raises(YTUnitOperationError, operator.isub, a3, a1) + assert_raises(YTUnitOperationError, operator.sub, a1, a4) + assert_raises(YTUnitOperationError, operator.isub, a1, a4) + assert_raises(YTUnitOperationError, operator.sub, a4, a1) + assert_raises(YTUnitOperationError, operator.isub, a4, a1) # subtracting with zero is allowed irrespective of the units zeros = np.zeros(3) @@ -198,10 +234,10 @@ for op in [operator.sub, np.subtract]: for operand in operands: - yield operate_and_compare, a1, operand, op, a1 - yield operate_and_compare, operand, a1, op, -a1 - yield operate_and_compare, 4*m, operand, op, 4*m - yield operate_and_compare, operand, 4*m, op, -4*m + operate_and_compare(a1, operand, op, a1) + operate_and_compare(operand, a1, op, -a1) + operate_and_compare(4*m, operand, op, 4*m) + operate_and_compare(operand, 4*m, op, -4*m) def test_multiplication(): """ @@ -215,14 +251,14 @@ a3 = [4*cm, 5*cm, 6*cm] answer = YTArray([4, 10, 18], 'cm**2') - yield operate_and_compare, a1, a2, operator.mul, answer - yield operate_and_compare, a2, a1, operator.mul, answer - yield operate_and_compare, a1, a3, operator.mul, answer - yield operate_and_compare, a3, a1, operator.mul, answer - yield operate_and_compare, a1, a2, np.multiply, answer - yield operate_and_compare, a2, a1, np.multiply, answer - yield operate_and_compare, a1, a3, np.multiply, answer - yield operate_and_compare, a3, a1, np.multiply, answer + operate_and_compare(a1, a2, operator.mul, answer) + operate_and_compare(a2, a1, operator.mul, answer) + operate_and_compare(a1, a3, operator.mul, answer) + operate_and_compare(a3, a1, operator.mul, answer) + operate_and_compare(a1, a2, np.multiply, answer) + operate_and_compare(a2, a1, np.multiply, answer) + operate_and_compare(a1, a3, np.multiply, answer) + operate_and_compare(a3, a1, np.multiply, answer) # different units, same dimension a1 = YTArray([1, 2, 3], 'cm') @@ -232,14 +268,14 @@ answer2 = YTArray([.04, .10, .18], 'm**2') answer3 = YTArray([4, 10, 18], 'cm*m') - yield operate_and_compare, a1, a2, operator.mul, answer1 - yield operate_and_compare, a2, a1, operator.mul, answer2 - yield operate_and_compare, a1, a3, operator.mul, answer1 - yield operate_and_compare, a3, a1, operator.mul, answer2 - yield operate_and_compare, a1, a2, np.multiply, answer3 - yield operate_and_compare, a2, a1, np.multiply, answer3 - yield operate_and_compare, a1, a3, np.multiply, answer3 - yield operate_and_compare, a3, a1, np.multiply, answer3 + operate_and_compare(a1, a2, operator.mul, answer1) + operate_and_compare(a2, a1, operator.mul, answer2) + operate_and_compare(a1, a3, operator.mul, answer1) + operate_and_compare(a3, a1, operator.mul, answer2) + operate_and_compare(a1, a2, np.multiply, answer3) + operate_and_compare(a2, a1, np.multiply, answer3) + operate_and_compare(a1, a3, np.multiply, answer3) + operate_and_compare(a3, a1, np.multiply, answer3) # different dimensions a1 = YTArray([1, 2, 3], 'cm') @@ -247,14 +283,14 @@ a3 = [4*g, 5*g, 6*g] answer = YTArray([4, 10, 18], 'cm*g') - yield operate_and_compare, a1, a2, operator.mul, answer - yield operate_and_compare, a2, a1, operator.mul, answer - yield operate_and_compare, a1, a3, operator.mul, answer - yield operate_and_compare, a3, a1, operator.mul, answer - yield operate_and_compare, a1, a2, np.multiply, answer - yield operate_and_compare, a2, a1, np.multiply, answer - yield operate_and_compare, a1, a3, np.multiply, answer - yield operate_and_compare, a3, a1, np.multiply, answer + operate_and_compare(a1, a2, operator.mul, answer) + operate_and_compare(a2, a1, operator.mul, answer) + operate_and_compare(a1, a3, operator.mul, answer) + operate_and_compare(a3, a1, operator.mul, answer) + operate_and_compare(a1, a2, np.multiply, answer) + operate_and_compare(a2, a1, np.multiply, answer) + operate_and_compare(a1, a3, np.multiply, answer) + operate_and_compare(a3, a1, np.multiply, answer) # One dimensionless, one unitful a1 = YTArray([1, 2, 3], 'cm') @@ -262,14 +298,14 @@ a3 = [4, 5, 6] answer = YTArray([4, 10, 18], 'cm') - yield operate_and_compare, a1, a2, operator.mul, answer - yield operate_and_compare, a2, a1, operator.mul, answer - yield operate_and_compare, a1, a3, operator.mul, answer - yield operate_and_compare, a3, a1, operator.mul, answer - yield operate_and_compare, a1, a2, np.multiply, answer - yield operate_and_compare, a2, a1, np.multiply, answer - yield operate_and_compare, a1, a3, np.multiply, answer - yield operate_and_compare, a3, a1, np.multiply, answer + operate_and_compare(a1, a2, operator.mul, answer) + operate_and_compare(a2, a1, operator.mul, answer) + operate_and_compare(a1, a3, operator.mul, answer) + operate_and_compare(a3, a1, operator.mul, answer) + operate_and_compare(a1, a2, np.multiply, answer) + operate_and_compare(a2, a1, np.multiply, answer) + operate_and_compare(a1, a3, np.multiply, answer) + operate_and_compare(a3, a1, np.multiply, answer) # Both dimensionless quantities a1 = YTArray([1, 2, 3]) @@ -277,14 +313,14 @@ a3 = [4, 5, 6] answer = YTArray([4, 10, 18]) - yield operate_and_compare, a1, a2, operator.mul, answer - yield operate_and_compare, a2, a1, operator.mul, answer - yield operate_and_compare, a1, a3, operator.mul, answer - yield operate_and_compare, a3, a1, operator.mul, answer - yield operate_and_compare, a1, a2, np.multiply, answer - yield operate_and_compare, a2, a1, np.multiply, answer - yield operate_and_compare, a1, a3, np.multiply, answer - yield operate_and_compare, a3, a1, np.multiply, answer + operate_and_compare(a1, a2, operator.mul, answer) + operate_and_compare(a2, a1, operator.mul, answer) + operate_and_compare(a1, a3, operator.mul, answer) + operate_and_compare(a3, a1, operator.mul, answer) + operate_and_compare(a1, a2, np.multiply, answer) + operate_and_compare(a2, a1, np.multiply, answer) + operate_and_compare(a1, a3, np.multiply, answer) + operate_and_compare(a3, a1, np.multiply, answer) def test_division(): @@ -304,14 +340,14 @@ else: op = operator.truediv - yield operate_and_compare, a1, a2, op, answer1 - yield operate_and_compare, a2, a1, op, answer2 - yield operate_and_compare, a1, a3, op, answer1 - yield operate_and_compare, a3, a1, op, answer2 - yield operate_and_compare, a1, a2, np.divide, answer1 - yield operate_and_compare, a2, a1, np.divide, answer2 - yield operate_and_compare, a1, a3, np.divide, answer1 - yield operate_and_compare, a3, a1, np.divide, answer2 + operate_and_compare(a1, a2, op, answer1) + operate_and_compare(a2, a1, op, answer2) + operate_and_compare(a1, a3, op, answer1) + operate_and_compare(a3, a1, op, answer2) + operate_and_compare(a1, a2, np.divide, answer1) + operate_and_compare(a2, a1, np.divide, answer2) + operate_and_compare(a1, a3, np.divide, answer1) + operate_and_compare(a3, a1, np.divide, answer2) # different units, same dimension a1 = YTArray([1., 2., 3.], 'cm') @@ -322,14 +358,20 @@ answer3 = YTArray([0.25, 0.4, 0.5], 'cm/m') answer4 = YTArray([4.0, 2.5, 2.0], 'm/cm') - yield operate_and_compare, a1, a2, op, answer1 - yield operate_and_compare, a2, a1, op, answer2 - yield operate_and_compare, a1, a3, op, answer1 - yield operate_and_compare, a3, a1, op, answer2 - yield operate_and_compare, a1, a2, np.divide, answer3 - yield operate_and_compare, a2, a1, np.divide, answer4 - yield operate_and_compare, a1, a3, np.divide, answer3 - yield operate_and_compare, a3, a1, np.divide, answer4 + operate_and_compare(a1, a2, op, answer1) + operate_and_compare(a2, a1, op, answer2) + operate_and_compare(a1, a3, op, answer1) + operate_and_compare(a3, a1, op, answer2) + if LooseVersion(np.__version__) < LooseVersion('1.13.0'): + operate_and_compare(a1, a2, np.divide, answer3) + operate_and_compare(a2, a1, np.divide, answer4) + operate_and_compare(a1, a3, np.divide, answer3) + operate_and_compare(a3, a1, np.divide, answer4) + else: + operate_and_compare(a1, a2, np.divide, answer1) + operate_and_compare(a2, a1, np.divide, answer2) + operate_and_compare(a1, a3, np.divide, answer1) + operate_and_compare(a3, a1, np.divide, answer2) # different dimensions a1 = YTArray([1., 2., 3.], 'cm') @@ -338,14 +380,14 @@ answer1 = YTArray([0.25, 0.4, 0.5], 'cm/g') answer2 = YTArray([4, 2.5, 2], 'g/cm') - yield operate_and_compare, a1, a2, op, answer1 - yield operate_and_compare, a2, a1, op, answer2 - yield operate_and_compare, a1, a3, op, answer1 - yield operate_and_compare, a3, a1, op, answer2 - yield operate_and_compare, a1, a2, np.divide, answer1 - yield operate_and_compare, a2, a1, np.divide, answer2 - yield operate_and_compare, a1, a3, np.divide, answer1 - yield operate_and_compare, a3, a1, np.divide, answer2 + operate_and_compare(a1, a2, op, answer1) + operate_and_compare(a2, a1, op, answer2) + operate_and_compare(a1, a3, op, answer1) + operate_and_compare(a3, a1, op, answer2) + operate_and_compare(a1, a2, np.divide, answer1) + operate_and_compare(a2, a1, np.divide, answer2) + operate_and_compare(a1, a3, np.divide, answer1) + operate_and_compare(a3, a1, np.divide, answer2) # One dimensionless, one unitful a1 = YTArray([1., 2., 3.], 'cm') @@ -354,14 +396,14 @@ answer1 = YTArray([0.25, 0.4, 0.5], 'cm') answer2 = YTArray([4, 2.5, 2], '1/cm') - yield operate_and_compare, a1, a2, op, answer1 - yield operate_and_compare, a2, a1, op, answer2 - yield operate_and_compare, a1, a3, op, answer1 - yield operate_and_compare, a3, a1, op, answer2 - yield operate_and_compare, a1, a2, np.divide, answer1 - yield operate_and_compare, a2, a1, np.divide, answer2 - yield operate_and_compare, a1, a3, np.divide, answer1 - yield operate_and_compare, a3, a1, np.divide, answer2 + operate_and_compare(a1, a2, op, answer1) + operate_and_compare(a2, a1, op, answer2) + operate_and_compare(a1, a3, op, answer1) + operate_and_compare(a3, a1, op, answer2) + operate_and_compare(a1, a2, np.divide, answer1) + operate_and_compare(a2, a1, np.divide, answer2) + operate_and_compare(a1, a3, np.divide, answer1) + operate_and_compare(a3, a1, np.divide, answer2) # Both dimensionless quantities a1 = YTArray([1., 2., 3.]) @@ -370,14 +412,14 @@ answer1 = YTArray([0.25, 0.4, 0.5]) answer2 = YTArray([4, 2.5, 2]) - yield operate_and_compare, a1, a2, op, answer1 - yield operate_and_compare, a2, a1, op, answer2 - yield operate_and_compare, a1, a3, op, answer1 - yield operate_and_compare, a3, a1, op, answer2 - yield operate_and_compare, a1, a3, np.divide, answer1 - yield operate_and_compare, a3, a1, np.divide, answer2 - yield operate_and_compare, a1, a3, np.divide, answer1 - yield operate_and_compare, a3, a1, np.divide, answer2 + operate_and_compare(a1, a2, op, answer1) + operate_and_compare(a2, a1, op, answer2) + operate_and_compare(a1, a3, op, answer1) + operate_and_compare(a3, a1, op, answer2) + operate_and_compare(a1, a3, np.divide, answer1) + operate_and_compare(a3, a1, np.divide, answer2) + operate_and_compare(a1, a3, np.divide, answer1) + operate_and_compare(a3, a1, np.divide, answer2) def test_power(): @@ -432,23 +474,26 @@ ) for op, answer in zip(ops, answers): - yield operate_and_compare, a1, a2, op, answer + operate_and_compare(a1, a2, op, answer) for op, answer in zip(ops, answers): - yield operate_and_compare, a1, dimless, op, answer + operate_and_compare(a1, dimless, op, answer) - for op in ops: - yield assert_raises, YTUfuncUnitError, op, a1, a3 + for op, answer in zip(ops, answers): + if LooseVersion(np.__version__) < LooseVersion('1.13.0'): + assert_raises(YTUfuncUnitError, op, a1, a3) + else: + operate_and_compare(a1, a3, op, answer) for op, answer in zip(ops, answers): - yield operate_and_compare, a1, a3.in_units('cm'), op, answer + operate_and_compare(a1, a3.in_units('cm'), op, answer) # Check that comparisons with dimensionless quantities work in both directions. - yield operate_and_compare, a3, dimless, np.less, [True, True, True] - yield operate_and_compare, dimless, a3, np.less, [False, False, False] - yield assert_equal, a1 < 2, [True, False, False] - yield assert_equal, a1 < 2, np.less(a1, 2) - yield assert_equal, 2 < a1, [False, False, True] - yield assert_equal, 2 < a1, np.less(2, a1) + operate_and_compare(a3, dimless, np.less, [True, True, True]) + operate_and_compare(dimless, a3, np.less, [False, False, False]) + assert_equal(a1 < 2, [True, False, False]) + assert_equal(a1 < 2, np.less(a1, 2)) + assert_equal(2 < a1, [False, False, True]) + assert_equal(2 < a1, np.less(2, a1)) def test_unit_conversions(): @@ -464,60 +509,60 @@ cm_unit = Unit('cm') kpc_unit = Unit('kpc') - yield assert_equal, km_in_cm, km - yield assert_equal, km_in_cm.in_cgs(), 1e5 - yield assert_equal, km_in_cm.in_mks(), 1e3 - yield assert_equal, km_in_cm.units, cm_unit + assert_equal(km_in_cm, km) + assert_equal(km_in_cm.in_cgs(), 1e5) + assert_equal(km_in_cm.in_mks(), 1e3) + assert_equal(km_in_cm.units, cm_unit) km_view = km.ndarray_view() km.convert_to_units('cm') assert_true(km_view.base is km.base) - yield assert_equal, km, YTQuantity(1, 'km') - yield assert_equal, km.in_cgs(), 1e5 - yield assert_equal, km.in_mks(), 1e3 - yield assert_equal, km.units, cm_unit + assert_equal(km, YTQuantity(1, 'km')) + assert_equal(km.in_cgs(), 1e5) + assert_equal(km.in_mks(), 1e3) + assert_equal(km.units, cm_unit) km.convert_to_units('kpc') assert_true(km_view.base is km.base) - yield assert_array_almost_equal_nulp, km, YTQuantity(1, 'km') - yield assert_array_almost_equal_nulp, km.in_cgs(), YTQuantity(1e5, 'cm') - yield assert_array_almost_equal_nulp, km.in_mks(), YTQuantity(1e3, 'm') - yield assert_equal, km.units, kpc_unit + assert_array_almost_equal_nulp(km, YTQuantity(1, 'km')) + assert_array_almost_equal_nulp(km.in_cgs(), YTQuantity(1e5, 'cm')) + assert_array_almost_equal_nulp(km.in_mks(), YTQuantity(1e3, 'm')) + assert_equal(km.units, kpc_unit) - yield assert_isinstance, km.to_ndarray(), np.ndarray - yield assert_isinstance, km.ndarray_view(), np.ndarray + assert_isinstance(km.to_ndarray(), np.ndarray) + assert_isinstance(km.ndarray_view(), np.ndarray) dyne = YTQuantity(1.0, 'dyne') - yield assert_equal, dyne.in_cgs(), dyne - yield assert_equal, dyne.in_cgs(), 1.0 - yield assert_equal, dyne.in_mks(), dyne - yield assert_equal, dyne.in_mks(), 1e-5 - yield assert_equal, str(dyne.in_mks().units), 'kg*m/s**2' - yield assert_equal, str(dyne.in_cgs().units), 'cm*g/s**2' + assert_equal(dyne.in_cgs(), dyne) + assert_equal(dyne.in_cgs(), 1.0) + assert_equal(dyne.in_mks(), dyne) + assert_equal(dyne.in_mks(), 1e-5) + assert_equal(str(dyne.in_mks().units), 'kg*m/s**2') + assert_equal(str(dyne.in_cgs().units), 'cm*g/s**2') em3 = YTQuantity(1.0, 'erg/m**3') - yield assert_equal, em3.in_cgs(), em3 - yield assert_equal, em3.in_cgs(), 1e-6 - yield assert_equal, em3.in_mks(), em3 - yield assert_equal, em3.in_mks(), 1e-7 - yield assert_equal, str(em3.in_mks().units), 'kg/(m*s**2)' - yield assert_equal, str(em3.in_cgs().units), 'g/(cm*s**2)' + assert_equal(em3.in_cgs(), em3) + assert_equal(em3.in_cgs(), 1e-6) + assert_equal(em3.in_mks(), em3) + assert_equal(em3.in_mks(), 1e-7) + assert_equal(str(em3.in_mks().units), 'kg/(m*s**2)') + assert_equal(str(em3.in_cgs().units), 'g/(cm*s**2)') em3_converted = YTQuantity(1545436840.386756, 'Msun/(Myr**2*kpc)') - yield assert_equal, em3.in_base(unit_system="galactic"), em3 - yield assert_array_almost_equal, em3.in_base(unit_system="galactic"), em3_converted - yield assert_equal, str(em3.in_base(unit_system="galactic").units), 'Msun/(Myr**2*kpc)' + assert_equal(em3.in_base(unit_system="galactic"), em3) + assert_array_almost_equal(em3.in_base(unit_system="galactic"), em3_converted) + assert_equal(str(em3.in_base(unit_system="galactic").units), 'Msun/(Myr**2*kpc)') dimless = YTQuantity(1.0, "") - yield assert_equal, dimless.in_cgs(), dimless - yield assert_equal, dimless.in_cgs(), 1.0 - yield assert_equal, dimless.in_mks(), dimless - yield assert_equal, dimless.in_mks(), 1.0 - yield assert_equal, str(dimless.in_cgs().units), "dimensionless" + assert_equal(dimless.in_cgs(), dimless) + assert_equal(dimless.in_cgs(), 1.0) + assert_equal(dimless.in_mks(), dimless) + assert_equal(dimless.in_mks(), 1.0) + assert_equal(str(dimless.in_cgs().units), "dimensionless") def test_temperature_conversions(): """ @@ -542,32 +587,32 @@ balmy_view = balmy.ndarray_view() balmy.convert_to_units('degF') - yield assert_true, balmy_view.base is balmy.base - yield assert_array_almost_equal, np.array(balmy), np.array(balmy_F) + assert_true(balmy_view.base is balmy.base) + assert_array_almost_equal(np.array(balmy), np.array(balmy_F)) balmy.convert_to_units('degC') - yield assert_true, balmy_view.base is balmy.base - yield assert_array_almost_equal, np.array(balmy), np.array(balmy_C) + assert_true(balmy_view.base is balmy.base) + assert_array_almost_equal(np.array(balmy), np.array(balmy_C)) balmy.convert_to_units('R') - yield assert_true, balmy_view.base is balmy.base - yield assert_array_almost_equal, np.array(balmy), np.array(balmy_R) + assert_true(balmy_view.base is balmy.base) + assert_array_almost_equal(np.array(balmy), np.array(balmy_R)) balmy.convert_to_units('degF') - yield assert_true, balmy_view.base is balmy.base - yield assert_array_almost_equal, np.array(balmy), np.array(balmy_F) + assert_true(balmy_view.base is balmy.base) + assert_array_almost_equal(np.array(balmy), np.array(balmy_F)) - yield assert_raises, InvalidUnitOperation, np.multiply, balmy, km + assert_raises(InvalidUnitOperation, np.multiply, balmy, km) # Does CGS conversion from F to K work? - yield assert_array_almost_equal, balmy.in_cgs(), YTQuantity(300, 'K') + assert_array_almost_equal(balmy.in_cgs(), YTQuantity(300, 'K')) def test_yt_array_yt_quantity_ops(): """ Test operations that combine YTArray and YTQuantity """ - a = YTArray(range(10), 'cm') + a = YTArray(range(10, 1), 'cm') b = YTQuantity(5, 'g') assert_isinstance(a*b, YTArray) @@ -595,16 +640,20 @@ a_boolean_index = a[a > 5] a_selection = a[0] - yield assert_array_equal, a_slice, YTArray([0, 1, 2], 'cm') - yield assert_array_equal, a_fancy_index, YTArray([1, 1, 3, 5], 'cm') - yield assert_array_equal, a_array_fancy_index, \ - YTArray([[1, 1, ], [3, 5]], 'cm') - yield assert_array_equal, a_boolean_index, YTArray([6, 7, 8, 9], 'cm') - yield assert_isinstance, a_selection, YTQuantity + assert_array_equal(a_slice, YTArray([0, 1, 2], 'cm')) + assert_equal(a_slice.units, a.units) + assert_array_equal(a_fancy_index, YTArray([1, 1, 3, 5], 'cm')) + assert_equal(a_fancy_index.units, a.units) + assert_array_equal(a_array_fancy_index, YTArray([[1, 1, ], [3, 5]], 'cm')) + assert_equal(a_array_fancy_index.units, a.units) + assert_array_equal(a_boolean_index, YTArray([6, 7, 8, 9], 'cm')) + assert_equal(a_boolean_index.units, a.units) + assert_isinstance(a_selection, YTQuantity) + assert_equal(a_selection.units, a.units) # .base points to the original array for a numpy view. If it is not a # view, .base is None. - yield assert_true, a_slice.base is a + assert_true(a_slice.base is a) def test_iteration(): @@ -614,8 +663,8 @@ a = np.arange(3) b = YTArray(np.arange(3), 'cm') for ia, ib, in zip(a, b): - yield assert_equal, ia, ib.value - yield assert_equal, ib.units, b.units + assert_equal(ia, ib.value) + assert_equal(ib.units, b.units) def test_fix_length(): @@ -625,7 +674,7 @@ ds = fake_random_ds(64, nprocs=1, length_unit=10) length = ds.quan(1.0, 'code_length') new_length = fix_length(length, ds=ds) - yield assert_equal, YTQuantity(10, 'cm'), new_length + assert_equal(YTQuantity(10, 'cm'), new_length) def test_code_unit_combinations(): """ @@ -665,30 +714,35 @@ loaded_data = pickle.load(fname) os.unlink(tempf.name) - yield assert_array_equal, data, loaded_data - yield assert_equal, data.units, loaded_data.units - yield assert_array_equal, array(data.in_cgs()), \ - array(loaded_data.in_cgs()) - yield assert_equal, float(data.units.base_value), \ - float(loaded_data.units.base_value) + assert_array_equal(data, loaded_data) + assert_equal(data.units, loaded_data.units) + assert_array_equal(array(data.in_cgs()), array(loaded_data.in_cgs())) + assert_equal(float(data.units.base_value), float(loaded_data.units.base_value)) def test_copy(): quan = YTQuantity(1, 'g') arr = YTArray([1, 2, 3], 'cm') - yield assert_equal, copy.copy(quan), quan - yield assert_array_equal, copy.copy(arr), arr + assert_equal(copy.copy(quan), quan) + assert_array_equal(copy.copy(arr), arr) - yield assert_equal, copy.deepcopy(quan), quan - yield assert_array_equal, copy.deepcopy(arr), arr + assert_equal( copy.deepcopy(quan), quan) + assert_array_equal(copy.deepcopy(arr), arr) - yield assert_equal, quan.copy(), quan - yield assert_array_equal, arr.copy(), arr - - yield assert_equal, np.copy(quan), quan - yield assert_array_equal, np.copy(arr), arr + assert_equal(quan.copy(), quan) + assert_array_equal(arr.copy(), arr) + assert_equal(np.copy(quan), quan) + assert_array_equal(np.copy(arr), arr) + +# needed so the tests function on older numpy versions that have +# different sets of ufuncs +def yield_np_ufuncs(ufunc_list): + for u in ufunc_list: + ufunc = getattr(np, u, None) + if ufunc is not None: + yield ufunc def unary_ufunc_comparison(ufunc, a): out = a.copy() @@ -699,40 +753,44 @@ ret = ufunc(a) assert_true(not hasattr(ret, 'units')) assert_array_equal(ret, ufunc(a)) - elif ufunc in (np.exp, np.exp2, np.log, np.log2, np.log10, np.expm1, - np.log1p, np.sin, np.cos, np.tan, np.arcsin, np.arccos, - np.arctan, np.sinh, np.cosh, np.tanh, np.arccosh, - np.arcsinh, np.arctanh, np.deg2rad, np.rad2deg, - np.isfinite, np.isinf, np.isnan, np.signbit, np.sign, - np.rint, np.logical_not): + elif ufunc in yield_np_ufuncs([ + 'exp', 'exp2', 'log', 'log2', 'log10', 'expm1', 'log1p', 'sin', + 'cos', 'tan', 'arcsin', 'arccos', 'arctan', 'sinh', 'cosh', 'tanh', + 'arccosh', 'arcsinh', 'arctanh', 'deg2rad', 'rad2deg', 'isfinite', + 'isinf', 'isnan', 'signbit', 'sign', 'rint', 'logical_not']): # These operations should return identical results compared to numpy. + with np.errstate(invalid='ignore'): + try: + ret = ufunc(a, out=out) + except YTUnitOperationError: + assert_true(ufunc in (np.deg2rad, np.rad2deg)) + ret = ufunc(YTArray(a, '1')) - try: - ret = ufunc(a, out=out) - except YTUnitOperationError: - assert_true(ufunc in (np.deg2rad, np.rad2deg)) - ret = ufunc(YTArray(a, '1')) + assert_array_equal(ret, out) + assert_array_equal(ret, ufunc(a_array)) + # In-place copies do not drop units. + assert_true(hasattr(out, 'units')) + assert_true(not hasattr(ret, 'units')) + elif ufunc in yield_np_ufuncs( + ['absolute', 'fabs', 'conjugate', 'floor', 'ceil', 'trunc', + 'negative', 'spacing', 'positive']): - assert_array_equal(ret, out) - assert_array_equal(ret, ufunc(a_array)) - # In-place copies do not drop units. - assert_true(hasattr(out, 'units')) - assert_true(not hasattr(ret, 'units')) - elif ufunc in (np.absolute, np.fabs, np.conjugate, np.floor, np.ceil, - np.trunc, np.negative, np.spacing): ret = ufunc(a, out=out) assert_array_equal(ret, out) assert_array_equal(ret.to_ndarray(), ufunc(a_array)) assert_true(ret.units == out.units) - elif ufunc in (np.ones_like, np.square, np.sqrt, np.reciprocal): + elif ufunc in yield_np_ufuncs( + ['ones_like', 'square', 'sqrt', 'reciprocal']): if ufunc is np.ones_like: ret = ufunc(a) else: - ret = ufunc(a, out=out) + with np.errstate(invalid='ignore'): + ret = ufunc(a, out=out) assert_array_equal(ret, out) - - assert_array_equal(ret.to_ndarray(), ufunc(a_array)) + + with np.errstate(invalid='ignore'): + assert_array_equal(ret.to_ndarray(), ufunc(a_array)) if ufunc is np.square: assert_true(out.units == a.units**2) assert_true(ret.units == a.units**2) @@ -756,6 +814,8 @@ assert_array_equal(ret2, npret2) elif ufunc is np.invert: assert_raises(TypeError, ufunc, a) + elif hasattr(np, 'isnat') and ufunc is np.isnat: + assert_raises(ValueError, ufunc, a) else: # There shouldn't be any untested ufuncs. assert_true(False) @@ -763,23 +823,26 @@ def binary_ufunc_comparison(ufunc, a, b): out = a.copy() - if ufunc in (np.add, np.subtract, np.remainder, np.fmod, np.mod, - np.arctan2, np.hypot, np.greater, np.greater_equal, np.less, - np.less_equal, np.equal, np.not_equal, np.logical_and, - np.logical_or, np.logical_xor, np.maximum, np.minimum, - np.fmax, np.fmin, np.nextafter): + if ufunc in yield_np_ufuncs([ + 'add', 'subtract', 'remainder', 'fmod', 'mod', 'arctan2', 'hypot', + 'greater', 'greater_equal', 'less', 'less_equal', 'equal', + 'not_equal', 'logical_and', 'logical_or', 'logical_xor', 'maximum', + 'minimum', 'fmax', 'fmin', 'nextafter', 'heaviside']): if a.units != b.units and a.units.dimensions == b.units.dimensions: - assert_raises(YTUfuncUnitError, ufunc, a, b) - return + if LooseVersion(np.__version__) < LooseVersion('1.13.0'): + assert_raises(YTUfuncUnitError, ufunc, a, b) + return elif a.units != b.units: assert_raises(YTUnitOperationError, ufunc, a, b) return - if ufunc in (np.bitwise_and, np.bitwise_or, np.bitwise_xor, - np.left_shift, np.right_shift, np.ldexp): + if ufunc in yield_np_ufuncs( + ['bitwise_and', 'bitwise_or', 'bitwise_xor', 'left_shift', + 'right_shift', 'ldexp']): assert_raises(TypeError, ufunc, a, b) return ret = ufunc(a, b, out=out) + ret = ufunc(a, b) if ufunc is np.multiply: assert_true(ret.units == a.units*b.units) @@ -790,23 +853,29 @@ np.logical_xor): assert_true(not isinstance(ret, YTArray) and isinstance(ret, np.ndarray)) - assert_array_equal(ret, out) + if isinstance(ret, tuple): + assert_array_equal(ret[0], out) + else: + assert_array_equal(ret, out) if (ufunc in (np.divide, np.true_divide, np.arctan2) and (a.units.dimensions == b.units.dimensions)): assert_array_almost_equal( np.array(ret), ufunc(np.array(a.in_cgs()), np.array(b.in_cgs()))) - else: + elif LooseVersion(np.__version__) < LooseVersion('1.13.0'): assert_array_almost_equal(np.array(ret), ufunc(np.array(a), np.array(b))) def test_ufuncs(): for ufunc in unary_operators: - yield unary_ufunc_comparison, ufunc, YTArray([.3, .4, .5], 'cm') - yield unary_ufunc_comparison, ufunc, YTArray([12, 23, 47], 'g') - yield unary_ufunc_comparison, ufunc, YTArray([2, 4, -6], 'erg/m**3') + if ufunc is None: + continue + unary_ufunc_comparison(ufunc, YTArray([.3, .4, .5], 'cm')) + unary_ufunc_comparison(ufunc, YTArray([12, 23, 47], 'g')) + unary_ufunc_comparison(ufunc, YTArray([2, 4, -6], 'erg/m**3')) for ufunc in binary_operators: - + if ufunc is None: + continue # arr**arr is undefined for arrays with units because # each element of the result would have different units. if ufunc is np.power: @@ -814,8 +883,8 @@ b = YTArray([.1, .2, .3], 'dimensionless') c = np.array(b) d = YTArray([1., 2., 3.], 'g') - yield binary_ufunc_comparison, ufunc, a, b - yield binary_ufunc_comparison, ufunc, a, c + binary_ufunc_comparison(ufunc, a, b) + binary_ufunc_comparison(ufunc, a, c) assert_raises(YTUnitOperationError, ufunc, a, d) continue @@ -826,30 +895,63 @@ e = YTArray([.1, .2, .3], 'erg/m**3') for pair in itertools.product([a, b, c, d, e], repeat=2): - yield binary_ufunc_comparison, ufunc, pair[0], pair[1] + binary_ufunc_comparison(ufunc, pair[0], pair[1]) + +def test_reductions(): + arr = YTArray([[1, 2, 3], [4, 5, 6]], 'cm') + ev_result = arr.dot(YTArray([1, 2, 3], 'cm')) + res = YTArray([ 14., 32.], 'cm**2') + assert_equal(ev_result, res) + assert_equal(ev_result.units, res.units) + assert_isinstance(ev_result, YTArray) + + answers = { + 'prod': (YTQuantity(720, 'cm**6'), + YTArray([4, 10, 18], 'cm**2'), + YTArray([6, 120], 'cm**3')), + 'sum': (YTQuantity(21, 'cm'), + YTArray([ 5., 7., 9.], 'cm'), + YTArray([6, 15], 'cm'),), + 'mean': (YTQuantity(3.5, 'cm'), + YTArray([ 2.5, 3.5, 4.5], 'cm'), + YTArray([2, 5], 'cm')), + 'std': (YTQuantity(1.707825127659933, 'cm'), + YTArray([ 1.5, 1.5, 1.5], 'cm'), + YTArray([0.81649658, 0.81649658], 'cm')), + } + for op, (result1, result2, result3) in answers.items(): + ev_result = getattr(arr, op)() + assert_almost_equal(ev_result, result1) + assert_almost_equal(ev_result.units, result1.units) + assert_isinstance(ev_result, YTQuantity) + for axis, result in [(0, result2), (1, result3), (-1, result3)]: + ev_result = getattr(arr, op)(axis=axis) + assert_almost_equal(ev_result, result) + assert_almost_equal(ev_result.units, result.units) + assert_isinstance(ev_result, YTArray) def test_convenience(): arr = YTArray([1, 2, 3], 'cm') - yield assert_equal, arr.unit_quantity, YTQuantity(1, 'cm') - yield assert_equal, arr.uq, YTQuantity(1, 'cm') - yield assert_isinstance, arr.unit_quantity, YTQuantity - yield assert_isinstance, arr.uq, YTQuantity - - yield assert_array_equal, arr.unit_array, YTArray(np.ones_like(arr), 'cm') - yield assert_array_equal, arr.ua, YTArray(np.ones_like(arr), 'cm') - yield assert_isinstance, arr.unit_array, YTArray - yield assert_isinstance, arr.ua, YTArray - - yield assert_array_equal, arr.ndview, arr.view(np.ndarray) - yield assert_array_equal, arr.d, arr.view(np.ndarray) - yield assert_true, arr.ndview.base is arr.base - yield assert_true, arr.d.base is arr.base + assert_equal(arr.unit_quantity, YTQuantity(1, 'cm')) + assert_equal(arr.uq, YTQuantity(1, 'cm')) + assert_isinstance(arr.unit_quantity, YTQuantity) + assert_isinstance(arr.uq, YTQuantity) + + assert_array_equal(arr.unit_array, YTArray(np.ones_like(arr), 'cm')) + assert_array_equal(arr.ua, YTArray(np.ones_like(arr), 'cm')) + assert_isinstance(arr.unit_array, YTArray) + assert_isinstance(arr.ua, YTArray) + + assert_array_equal(arr.ndview, arr.view(np.ndarray)) + assert_array_equal(arr.d, arr.view(np.ndarray)) + assert_true(arr.ndview.base is arr.base) + assert_true(arr.d.base is arr.base) - yield assert_array_equal, arr.value, np.array(arr) - yield assert_array_equal, arr.v, np.array(arr) + assert_array_equal(arr.value, np.array(arr)) + assert_array_equal(arr.v, np.array(arr)) def test_registry_association(): @@ -859,7 +961,7 @@ c = ds.quan(6, '') d = 5 - yield assert_equal, id(a.units.registry), id(ds.unit_registry) + assert_equal(id(a.units.registry), id(ds.unit_registry)) def binary_op_registry_comparison(op): e = op(a, b) @@ -884,10 +986,10 @@ if hasattr(operator, "div"): binary_ops.append(operator.div) for op in binary_ops: - yield binary_op_registry_comparison, op + binary_op_registry_comparison(op) for op in [operator.abs, operator.neg, operator.pos]: - yield unary_op_registry_comparison, op + unary_op_registry_comparison(op) @requires_module("astropy") def test_astropy(): @@ -901,16 +1003,16 @@ yt_quan = YTQuantity(10., "sqrt(Msun)/kpc**3") yt_quan2 = YTQuantity.from_astropy(ap_quan) - yield assert_array_equal, ap_arr, yt_arr.to_astropy() - yield assert_array_equal, yt_arr, YTArray.from_astropy(ap_arr) - yield assert_array_equal, yt_arr, yt_arr2 - - yield assert_equal, ap_quan, yt_quan.to_astropy() - yield assert_equal, yt_quan, YTQuantity.from_astropy(ap_quan) - yield assert_equal, yt_quan, yt_quan2 + assert_array_equal(ap_arr, yt_arr.to_astropy()) + assert_array_equal(yt_arr, YTArray.from_astropy(ap_arr)) + assert_array_equal(yt_arr, yt_arr2) + + assert_equal(ap_quan, yt_quan.to_astropy()) + assert_equal(yt_quan, YTQuantity.from_astropy(ap_quan)) + assert_equal(yt_quan, yt_quan2) - yield assert_array_equal, yt_arr, YTArray.from_astropy(yt_arr.to_astropy()) - yield assert_equal, yt_quan, YTQuantity.from_astropy(yt_quan.to_astropy()) + assert_array_equal(yt_arr, YTArray.from_astropy(yt_arr.to_astropy())) + assert_equal(yt_quan, YTQuantity.from_astropy(yt_quan.to_astropy())) @requires_module("pint") def test_pint(): @@ -926,18 +1028,18 @@ yt_quan = YTQuantity(10., "sqrt(g)/mm**3") yt_quan2 = YTQuantity.from_pint(p_quan) - yield assert_array_equal, p_arr, yt_arr.to_pint() + assert_array_equal(p_arr, yt_arr.to_pint()) assert_equal(p_quan, yt_quan.to_pint()) - yield assert_array_equal, yt_arr, YTArray.from_pint(p_arr) - yield assert_array_equal, yt_arr, yt_arr2 + assert_array_equal(yt_arr, YTArray.from_pint(p_arr)) + assert_array_equal(yt_arr, yt_arr2) - yield assert_equal, p_quan.magnitude, yt_quan.to_pint().magnitude + assert_equal(p_quan.magnitude, yt_quan.to_pint().magnitude) assert_equal(p_quan, yt_quan.to_pint()) - yield assert_equal, yt_quan, YTQuantity.from_pint(p_quan) - yield assert_equal, yt_quan, yt_quan2 + assert_equal(yt_quan, YTQuantity.from_pint(p_quan)) + assert_equal(yt_quan, yt_quan2) - yield assert_array_equal, yt_arr, YTArray.from_pint(yt_arr.to_pint()) - yield assert_equal, yt_quan, YTQuantity.from_pint(yt_quan.to_pint()) + assert_array_equal(yt_arr, YTArray.from_pint(yt_arr.to_pint())) + assert_equal(yt_quan, YTQuantity.from_pint(yt_quan.to_pint())) def test_subclass(): @@ -977,7 +1079,8 @@ assert_isinstance(a[:], YTASubclass) assert_isinstance(a[:2], YTASubclass) assert_isinstance(YTASubclass(yta), YTASubclass) - + +@requires_module('h5py') def test_h5_io(): tmpdir = tempfile.mkdtemp() curdir = os.getcwd() @@ -991,14 +1094,14 @@ iarr = YTArray.from_hdf5('test.h5') - yield assert_equal, warr, iarr - yield assert_equal, warr.units.registry['code_length'], iarr.units.registry['code_length'] + assert_equal(warr, iarr) + assert_equal(warr.units.registry['code_length'], iarr.units.registry['code_length']) warr.write_hdf5('test.h5', dataset_name="test_dset", group_name='/arrays/test_group') giarr = YTArray.from_hdf5('test.h5', dataset_name="test_dset", group_name='/arrays/test_group') - yield assert_equal, warr, giarr + assert_equal(warr, giarr) os.chdir(curdir) shutil.rmtree(tmpdir) @@ -1011,83 +1114,82 @@ # Mass-energy E = mp.to_equivalent("keV","mass_energy") - yield assert_equal, E, mp*clight*clight - yield assert_allclose_units, mp, E.to_equivalent("g", "mass_energy") + assert_equal(E, mp*clight*clight) + assert_allclose_units(mp, E.to_equivalent("g", "mass_energy")) # Thermal T = YTQuantity(1.0e8,"K") E = T.to_equivalent("W*hr","thermal") - yield assert_equal, E, (kboltz*T).in_units("W*hr") - yield assert_allclose_units, T, E.to_equivalent("K", "thermal") + assert_equal(E, (kboltz*T).in_units("W*hr")) + assert_allclose_units(T, E.to_equivalent("K", "thermal")) # Spectral l = YTQuantity(4000.,"angstrom") nu = l.to_equivalent("Hz","spectral") - yield assert_equal, nu, clight/l + assert_equal(nu, clight/l) E = hcgs*nu l2 = E.to_equivalent("angstrom", "spectral") - yield assert_allclose_units, l, l2 + assert_allclose_units(l, l2) nu2 = clight/l2.in_units("cm") - yield assert_allclose_units, nu, nu2 + assert_allclose_units(nu, nu2) E2 = nu2.to_equivalent("keV", "spectral") - yield assert_allclose_units, E2, E.in_units("keV") + assert_allclose_units(E2, E.in_units("keV")) # Sound-speed mu = 0.6 gg = 5./3. c_s = T.to_equivalent("km/s","sound_speed") - yield assert_equal, c_s, np.sqrt(gg*kboltz*T/(mu*mh)) - yield assert_allclose_units, T, c_s.to_equivalent("K","sound_speed") + assert_equal(c_s, np.sqrt(gg*kboltz*T/(mu*mh))) + assert_allclose_units(T, c_s.to_equivalent("K","sound_speed")) mu = 0.5 gg = 4./3. c_s = T.to_equivalent("km/s","sound_speed", mu=mu, gamma=gg) - yield assert_equal, c_s, np.sqrt(gg*kboltz*T/(mu*mh)) - yield assert_allclose_units, T, c_s.to_equivalent("K","sound_speed", - mu=mu, gamma=gg) + assert_equal(c_s, np.sqrt(gg*kboltz*T/(mu*mh))) + assert_allclose_units(T, c_s.to_equivalent("K","sound_speed", mu=mu, gamma=gg)) # Lorentz v = 0.8*clight g = v.to_equivalent("dimensionless","lorentz") g2 = YTQuantity(1./np.sqrt(1.-0.8*0.8), "dimensionless") - yield assert_allclose_units, g, g2 + assert_allclose_units(g, g2) v2 = g2.to_equivalent("mile/hr", "lorentz") - yield assert_allclose_units, v2, v.in_units("mile/hr") + assert_allclose_units(v2, v.in_units("mile/hr")) # Schwarzschild R = mass_sun_cgs.to_equivalent("kpc","schwarzschild") - yield assert_equal, R.in_cgs(), 2*G*mass_sun_cgs/(clight*clight) - yield assert_allclose_units, mass_sun_cgs, R.to_equivalent("g", "schwarzschild") + assert_equal(R.in_cgs(), 2*G*mass_sun_cgs/(clight*clight)) + assert_allclose_units(mass_sun_cgs, R.to_equivalent("g", "schwarzschild")) # Compton l = me.to_equivalent("angstrom","compton") - yield assert_equal, l, hcgs/(me*clight) - yield assert_allclose_units, me, l.to_equivalent("g", "compton") + assert_equal(l, hcgs/(me*clight)) + assert_allclose_units(me, l.to_equivalent("g", "compton")) # Number density rho = mp/u.cm**3 n = rho.to_equivalent("cm**-3","number_density") - yield assert_equal, n, rho/(mh*0.6) - yield assert_allclose_units, rho, n.to_equivalent("g/cm**3","number_density") + assert_equal(n, rho/(mh*0.6)) + assert_allclose_units(rho, n.to_equivalent("g/cm**3","number_density")) n = rho.to_equivalent("cm**-3","number_density", mu=0.75) - yield assert_equal, n, rho/(mh*0.75) - yield assert_allclose_units, rho, n.to_equivalent("g/cm**3","number_density", mu=0.75) + assert_equal(n, rho/(mh*0.75)) + assert_allclose_units(rho, n.to_equivalent("g/cm**3","number_density", mu=0.75)) # Effective temperature T = YTQuantity(1.0e4, "K") F = T.to_equivalent("erg/s/cm**2","effective_temperature") - yield assert_equal, F, stefan_boltzmann_constant_cgs*T**4 - yield assert_allclose_units, T, F.to_equivalent("K", "effective_temperature") + assert_equal(F, stefan_boltzmann_constant_cgs*T**4) + assert_allclose_units(T, F.to_equivalent("K", "effective_temperature")) def test_electromagnetic(): from yt.units.dimensions import charge_mks, pressure, current_cgs, \ @@ -1098,46 +1200,46 @@ # Various tests of SI and CGS electromagnetic units qp_mks = qp.to_equivalent("C", "SI") - yield assert_equal, qp_mks.units.dimensions, charge_mks - yield assert_array_almost_equal, qp_mks.v, 10.0*qp.v/speed_of_light_cm_per_s + assert_equal(qp_mks.units.dimensions, charge_mks) + assert_array_almost_equal(qp_mks.v, 10.0*qp.v/speed_of_light_cm_per_s) qp_cgs = qp_mks.to_equivalent("esu", "CGS") - yield assert_array_almost_equal, qp_cgs, qp - yield assert_equal, qp_cgs.units.dimensions, qp.units.dimensions + assert_array_almost_equal(qp_cgs, qp) + assert_equal(qp_cgs.units.dimensions, qp.units.dimensions) qp_mks_k = qp.to_equivalent("kC", "SI") - yield assert_array_almost_equal, qp_mks_k.v, 1.0e-2*qp.v/speed_of_light_cm_per_s + assert_array_almost_equal(qp_mks_k.v, 1.0e-2*qp.v/speed_of_light_cm_per_s) B = YTQuantity(1.0, "T") B_cgs = B.to_equivalent("gauss", "CGS") - yield assert_equal, B.units.dimensions, magnetic_field_mks - yield assert_equal, B_cgs.units.dimensions, magnetic_field_cgs - yield assert_array_almost_equal, B_cgs, YTQuantity(1.0e4, "gauss") + assert_equal(B.units.dimensions, magnetic_field_mks) + assert_equal(B_cgs.units.dimensions, magnetic_field_cgs) + assert_array_almost_equal(B_cgs, YTQuantity(1.0e4, "gauss")) u_mks = B*B/(2*mu_0) - yield assert_equal, u_mks.units.dimensions, pressure + assert_equal(u_mks.units.dimensions, pressure) u_cgs = B_cgs*B_cgs/(8*np.pi) - yield assert_equal, u_cgs.units.dimensions, pressure - yield assert_array_almost_equal, u_mks.in_cgs(), u_cgs + assert_equal(u_cgs.units.dimensions, pressure) + assert_array_almost_equal(u_mks.in_cgs(), u_cgs) I = YTQuantity(1.0, "A") I_cgs = I.to_equivalent("statA", "CGS") - yield assert_array_almost_equal, I_cgs, YTQuantity(0.1*speed_of_light_cm_per_s, "statA") - yield assert_array_almost_equal, I_cgs.to_equivalent("mA", "SI"), I.in_units("mA") - yield assert_equal, I_cgs.units.dimensions, current_cgs + assert_array_almost_equal(I_cgs, YTQuantity(0.1*speed_of_light_cm_per_s, "statA")) + assert_array_almost_equal(I_cgs.to_equivalent("mA", "SI"), I.in_units("mA")) + assert_equal(I_cgs.units.dimensions, current_cgs) R = YTQuantity(1.0, "ohm") R_cgs = R.to_equivalent("statohm", "CGS") P_mks = I*I*R P_cgs = I_cgs*I_cgs*R_cgs - yield assert_equal, P_mks.units.dimensions, power - yield assert_equal, P_cgs.units.dimensions, power - yield assert_array_almost_equal, P_cgs.in_cgs(), P_mks.in_cgs() - yield assert_array_almost_equal, P_cgs.in_mks(), YTQuantity(1.0, "W") + assert_equal(P_mks.units.dimensions, power) + assert_equal(P_cgs.units.dimensions, power) + assert_array_almost_equal(P_cgs.in_cgs(), P_mks.in_cgs()) + assert_array_almost_equal(P_cgs.in_mks(), YTQuantity(1.0, "W")) V = YTQuantity(1.0, "statV") V_mks = V.to_equivalent("V", "SI") - yield assert_array_almost_equal, V_mks.v, 1.0e8*V.v/speed_of_light_cm_per_s + assert_array_almost_equal(V_mks.v, 1.0e8*V.v/speed_of_light_cm_per_s) def test_ytarray_coercion(): a = YTArray([1, 2, 3], 'cm') @@ -1157,23 +1259,21 @@ intersect_answer = [2, 3] union_answer = [1, 2, 3, 4, 5, 6] - yield (assert_array_equal, YTArray(catenate_answer, 'cm'), - uconcatenate((a1, a2))) - yield assert_array_equal, catenate_answer, np.concatenate((a1, a2)) - - yield (assert_array_equal, YTArray(intersect_answer, 'cm'), - uintersect1d(a1, a2)) - yield assert_array_equal, intersect_answer, np.intersect1d(a1, a2) + assert_array_equal(YTArray(catenate_answer, 'cm'), uconcatenate((a1, a2))) + assert_array_equal(catenate_answer, np.concatenate((a1, a2))) + + assert_array_equal(YTArray(intersect_answer, 'cm'), uintersect1d(a1, a2)) + assert_array_equal(intersect_answer, np.intersect1d(a1, a2)) - yield assert_array_equal, YTArray(union_answer, 'cm'), uunion1d(a1, a2) - yield assert_array_equal, union_answer, np.union1d(a1, a2) + assert_array_equal(YTArray(union_answer, 'cm'), uunion1d(a1, a2)) + assert_array_equal(union_answer, np.union1d(a1, a2)) def test_dimensionless_conversion(): a = YTQuantity(1, 'Zsun') b = a.in_units('Zsun') a.convert_to_units('Zsun') - yield assert_true, a.units.base_value == metallicity_sun - yield assert_true, b.units.base_value == metallicity_sun + assert_true(a.units.base_value == metallicity_sun) + assert_true(b.units.base_value == metallicity_sun) def test_modified_unit_division(): ds1 = fake_random_ds(64) @@ -1187,9 +1287,9 @@ b = ds2.quan(3, 'm') ret = a/b - yield assert_true, ret == 0.5 - yield assert_true, ret.units.is_dimensionless - yield assert_true, ret.units.base_value == 1.0 + assert_true(ret == 0.5) + assert_true(ret.units.is_dimensionless) + assert_true(ret.units.base_value == 1.0) def test_load_and_save(): tmpdir = tempfile.mkdtemp() @@ -1204,8 +1304,8 @@ d, e = loadtxt("arrays.dat", usecols=(1,2), delimiter=",") - yield assert_array_equal, b, d - yield assert_array_equal, c, e + assert_array_equal(b, d) + assert_array_equal(c, e) os.chdir(curdir) shutil.rmtree(tmpdir) @@ -1235,3 +1335,13 @@ assert_almost_equal(float(l2.in_cgs()), 0.9) assert_almost_equal(float(ds1.quan(0.3, 'unitary').in_cgs()), 0.3) assert_almost_equal(float(ds2.quan(0.3, 'unitary').in_cgs()), 0.9) + +def test_ones_and_zeros_like(): + data = YTArray([1, 2, 3], 'cm') + zd = np.zeros_like(data) + od = np.ones_like(data) + + assert_equal(zd, YTArray([0, 0, 0], 'cm')) + assert_equal(zd.units, data.units) + assert_equal(od, YTArray([1, 1, 1], 'cm')) + assert_equal(od.units, data.units) diff -Nru yt-3.3.3/yt/units/unit_lookup_table.py yt-3.4.0/yt/units/unit_lookup_table.py --- yt-3.3.3/yt/units/unit_lookup_table.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/units/unit_lookup_table.py 2017-08-10 18:02:57.000000000 +0000 @@ -124,8 +124,8 @@ "me": (mass_electron_grams, dimensions.mass, 0.0, r"m_e"), "mp": (mass_hydrogen_grams, dimensions.mass, 0.0, r"m_p"), "mol": (1.0/amu_grams, dimensions.dimensionless, 0.0, r"\rm{mol}"), - 'Sv': (cm_per_m**2, dimensions.specific_energy, 0.0, - r"\rm{Sv}"), + 'Sv': (cm_per_m**2, dimensions.specific_energy, 0.0, r"\rm{Sv}"), + "rayleigh": (0.25e6/np.pi, dimensions.count_intensity, 0.0, r"\rm{R}"), # for AstroPy compatibility "solMass": (mass_sun_grams, dimensions.mass, 0.0, r"M_\odot"), @@ -187,7 +187,7 @@ "u": r"\mu", } -prefixable_units = ( +prefixable_units = [ "m", "pc", "mcm", @@ -217,7 +217,7 @@ "ohm", "statohm", "Sv", -) +] default_base_units = { dimensions.mass: 'g', diff -Nru yt-3.3.3/yt/units/unit_object.py yt-3.4.0/yt/units/unit_object.py --- yt-3.3.3/yt/units/unit_object.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/units/unit_object.py 2017-08-10 18:02:57.000000000 +0000 @@ -216,6 +216,17 @@ elif isinstance(unit_expr, Unit): # grab the unit object's sympy expression. unit_expr = unit_expr.expr + elif hasattr(unit_expr, 'units') and hasattr(unit_expr, 'value'): + # something that looks like a YTArray, grab the unit and value + if unit_expr.shape != (): + raise UnitParseError( + 'Cannot create a unit from a non-scalar YTArray, received: ' + '%s' % (unit_expr, )) + value = unit_expr.value + if value == 1: + unit_expr = unit_expr.units.expr + else: + unit_expr = unit_expr.value*unit_expr.units.expr # Make sure we have an Expr at this point. if not isinstance(unit_expr, Expr): raise UnitParseError("Unit representation must be a string or " \ @@ -475,10 +486,10 @@ raise YTUnitsNotReducible(self, "cgs") return yt_base_unit else: - if unit_system == "code": - raise RuntimeError(r'You must refer to a dataset instance to convert to a ' - r'code unit system. Try again with unit_system=ds instead, ' - r'where \'ds\' is your dataset.') + if hasattr(unit_system, "unit_registry"): + unit_system = unit_system.unit_registry.unit_system_id + elif unit_system == "code": + unit_system = self.registry.unit_system_id unit_system = unit_system_registry[str(unit_system)] units_string = _get_system_unit_string(self.dimensions, unit_system.base_units) u = Unit(units_string, registry=self.registry) @@ -694,3 +705,46 @@ power_string = "" units.append("(%s)%s" % (unit_string, power_string)) return " * ".join(units) + +def _define_unit(registry, symbol, value, tex_repr=None, offset=None, prefixable=False): + from yt.units.yt_array import YTQuantity, iterable + if symbol in registry: + raise RuntimeError("The symbol \"%s\" is already in the unit registry!" % symbol) + if not isinstance(value, YTQuantity): + if iterable(value) and len(value) == 2: + value = YTQuantity(value[0], value[1]) + else: + raise RuntimeError("\"value\" needs to be a (value, unit) tuple!") + base_value = float(value.in_base(unit_system='cgs-ampere')) + dimensions = value.units.dimensions + registry.add(symbol, base_value, dimensions, tex_repr=tex_repr, offset=offset) + if prefixable: + prefixable_units.append(symbol) + +def define_unit(symbol, value, tex_repr=None, offset=None, prefixable=False): + """ + Define a new unit and add it to the default unit registry. + + Parameters + ---------- + symbol : string + The symbol for the new unit. + value : tuple or ~yt.units.yt_array.YTQuantity + The definition of the new unit in terms of some other units. For example, + one would define a new "mph" unit with (1.0, "mile/hr") + tex_repr : string, optional + The LaTeX representation of the new unit. If one is not supplied, it will + be generated automatically based on the symbol string. + offset : float, optional + The default offset for the unit. If not set, an offset of 0 is assumed. + prefixable : boolean, optional + Whether or not the new unit can use SI prefixes. Default: False + + Examples + -------- + >>> yt.define_unit("mph", (1.0, "mile/hr")) + >>> two_weeks = YTQuantity(14.0, "days") + >>> yt.define_unit("fortnight", two_weeks) + """ + _define_unit(default_unit_registry, symbol, value, tex_repr=tex_repr, + offset=offset, prefixable=prefixable) diff -Nru yt-3.3.3/yt/units/unit_registry.py yt-3.4.0/yt/units/unit_registry.py --- yt-3.3.3/yt/units/unit_registry.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/units/unit_registry.py 2017-08-10 18:02:57.000000000 +0000 @@ -18,6 +18,7 @@ from distutils.version import LooseVersion from yt.units.unit_lookup_table import \ default_unit_symbol_lut +from yt.utilities.lib.fnv_hash import fnv_hash from yt.extern import six from sympy import \ sympify, \ @@ -53,6 +54,22 @@ def __contains__(self, item): return item in self.lut + _unit_system_id = None + @property + def unit_system_id(self): + """ + This is a unique identifier for the unit registry created + from a FNV hash. It is needed to register a dataset's code + unit system in the unit system registry. + """ + if self._unit_system_id is None: + hash_data = bytearray() + for k, v in self.lut.items(): + hash_data.extend(k.encode('ascii')) + hash_data.extend(repr(v).encode('ascii')) + self._unit_system_id = "code_%d" % fnv_hash(hash_data) + return self._unit_system_id + def add(self, symbol, base_value, dimensions, tex_repr=None, offset=None): """ Add a symbol to this registry. diff -Nru yt-3.3.3/yt/units/unit_systems.py yt-3.4.0/yt/units/unit_systems.py --- yt-3.3.3/yt/units/unit_systems.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/units/unit_systems.py 2017-08-10 18:02:57.000000000 +0000 @@ -40,8 +40,8 @@ Parameters ---------- name : string - The name of the unit system. Will be used as the key in the *unit_system_registry* - dict to reference the unit system by. + The name of the unit system. Will be used as the key in the + *unit_system_registry* dict to reference the unit system by. length_unit : string The base length unit of this unit system. mass_unit : string @@ -53,10 +53,11 @@ angle_unit : string, optional The base angle unit of this unit system. Defaults to "rad". curent_mks_unit : string, optional - The base current unit of this unit system. Only used in MKS or MKS-based unit systems. + The base current unit of this unit system. Only used in MKS + or MKS-based unit systems. registry : :class:`yt.units.unit_registry.UnitRegistry` object - The unit registry associated with this unit system. Only useful for defining unit - systems based on code units. + The unit registry associated with this unit system. Only + useful for defining unit systems based on code units. """ def __init__(self, name, length_unit, mass_unit, time_unit, temperature_unit="K", angle_unit="rad", current_mks_unit=None, @@ -108,10 +109,11 @@ repr += " %s: %s\n" % (key, self.units_map[dim]) return repr -def create_code_unit_system(ds, current_mks_unit=None): - code_unit_system = UnitSystem( - str(ds), "code_length", "code_mass", "code_time", "code_temperature", - current_mks_unit=current_mks_unit, registry=ds.unit_registry) +def create_code_unit_system(unit_registry, current_mks_unit=None): + code_unit_system = UnitSystem(unit_registry.unit_system_id, "code_length", + "code_mass", "code_time", "code_temperature", + current_mks_unit=current_mks_unit, + registry=unit_registry) code_unit_system["velocity"] = "code_velocity" if current_mks_unit: code_unit_system["magnetic_field_mks"] = "code_magnetic" @@ -136,7 +138,8 @@ mks_unit_system["magnetic_field_mks"] = "T" mks_unit_system["charge_mks"] = "C" -imperial_unit_system = UnitSystem("imperial", "ft", "lbm", "s", temperature_unit="R") +imperial_unit_system = UnitSystem("imperial", "ft", "lbm", "s", + temperature_unit="R") imperial_unit_system["force"] = "lbf" imperial_unit_system["energy"] = "ft*lbf" imperial_unit_system["pressure"] = "lbf/ft**2" @@ -147,9 +150,11 @@ solar_unit_system = UnitSystem("solar", "AU", "Mearth", "yr") -geometrized_unit_system = UnitSystem("geometrized", "l_geom", "m_geom", "t_geom") +geometrized_unit_system = UnitSystem("geometrized", "l_geom", + "m_geom", "t_geom") -planck_unit_system = UnitSystem("planck", "l_pl", "m_pl", "t_pl", temperature_unit="T_pl") +planck_unit_system = UnitSystem("planck", "l_pl", "m_pl", "t_pl", + temperature_unit="T_pl") planck_unit_system["energy"] = "E_pl" planck_unit_system["charge_cgs"] = "q_pl" diff -Nru yt-3.3.3/yt/units/yt_array.py yt-3.4.0/yt/units/yt_array.py --- yt-3.3.3/yt/units/yt_array.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/units/yt_array.py 2017-08-10 18:02:57.000000000 +0000 @@ -16,12 +16,13 @@ import copy import numpy as np +from distutils.version import LooseVersion from functools import wraps from numpy import \ add, subtract, multiply, divide, logaddexp, logaddexp2, true_divide, \ floor_divide, negative, power, remainder, mod, absolute, rint, \ sign, conj, exp, exp2, log, log2, log10, expm1, log1p, sqrt, square, \ - reciprocal, ones_like, sin, cos, tan, arcsin, arccos, arctan, arctan2, \ + reciprocal, sin, cos, tan, arcsin, arccos, arctan, arctan2, \ hypot, sinh, cosh, tanh, arcsinh, arccosh, arctanh, deg2rad, rad2deg, \ bitwise_and, bitwise_or, bitwise_xor, invert, left_shift, right_shift, \ greater, greater_equal, less, less_equal, not_equal, equal, logical_and, \ @@ -29,6 +30,12 @@ isreal, iscomplex, isfinite, isinf, isnan, signbit, copysign, nextafter, \ modf, ldexp, frexp, fmod, floor, ceil, trunc, fabs, spacing +try: + # numpy 1.13 or newer + from numpy import positive, divmod as divmod_, isnat, heaviside +except ImportError: + positive, divmod_, isnat, heaviside = (None,)*4 + from yt.units.unit_object import Unit, UnitParseError from yt.units.unit_registry import UnitRegistry from yt.units.dimensions import \ @@ -51,6 +58,7 @@ from .pint_conversions import convert_pint_units NULL_UNIT = Unit() +POWER_SIGN_MAPPING = {multiply: 1, divide: -1} # redefine this here to avoid a circular import from yt.funcs def iterable(obj): @@ -77,7 +85,7 @@ def multiply_units(unit1, unit2): return unit1 * unit2 -def preserve_units(unit1, unit2): +def preserve_units(unit1, unit2=None): return unit1 @lru_cache(maxsize=128, typed=False) @@ -96,16 +104,16 @@ def reciprocal_unit(unit): return unit**-1 -def passthrough_unit(unit): +def passthrough_unit(unit, unit2=None): return unit -def return_without_unit(unit): +def return_without_unit(unit, unit2=None): return None def arctan2_unit(unit1, unit2): return NULL_UNIT -def comparison_unit(unit1, unit2): +def comparison_unit(unit1, unit2=None): return None def invert_units(unit): @@ -116,6 +124,80 @@ raise TypeError( "Bit-twiddling operators are not defined for YTArray instances") +def get_inp_u_unary(ufunc, inputs, out_arr=None): + inp = inputs[0] + u = getattr(inp, 'units', None) + if u is None: + u = NULL_UNIT + if u.dimensions is angle and ufunc in trigonometric_operators: + inp = inp.in_units('radian').v + if out_arr is not None: + out_arr = ufunc(inp).view(np.ndarray) + return out_arr, inp, u + +def get_inp_u_binary(ufunc, inputs): + inp1 = coerce_iterable_units(inputs[0]) + inp2 = coerce_iterable_units(inputs[1]) + unit1 = getattr(inp1, 'units', None) + unit2 = getattr(inp2, 'units', None) + ret_class = get_binary_op_return_class(type(inp1), type(inp2)) + if unit1 is None: + unit1 = Unit(registry=getattr(unit2, 'registry', None)) + if unit2 is None and ufunc is not power: + unit2 = Unit(registry=getattr(unit1, 'registry', None)) + elif ufunc is power: + unit2 = inp2 + if isinstance(unit2, np.ndarray): + if isinstance(unit2, YTArray): + if unit2.units.is_dimensionless: + pass + else: + raise YTUnitOperationError(ufunc, unit1, unit2) + unit2 = 1.0 + return (inp1, inp2), (unit1, unit2), ret_class + +def handle_preserve_units(inps, units, ufunc, ret_class): + if units[0] != units[1]: + any_nonzero = [np.any(inps[0]), np.any(inps[1])] + if any_nonzero[0] == np.bool_(False): + units = (units[1], units[1]) + elif any_nonzero[1] == np.bool_(False): + units = (units[0], units[0]) + else: + if not units[0].same_dimensions_as(units[1]): + raise YTUnitOperationError(ufunc, *units) + inps = (inps[0], ret_class(inps[1]).to( + ret_class(inps[0]).units)) + return inps, units + +def handle_comparison_units(inps, units, ufunc, ret_class, raise_error=False): + if units[0] != units[1]: + u1d = units[0].is_dimensionless + u2d = units[1].is_dimensionless + any_nonzero = [np.any(inps[0]), np.any(inps[1])] + if any_nonzero[0] == np.bool_(False): + units = (units[1], units[1]) + elif any_nonzero[1] == np.bool_(False): + units = (units[0], units[0]) + elif not any([u1d, u2d]): + if not units[0].same_dimensions_as(units[1]): + raise YTUnitOperationError(ufunc, *units) + else: + if raise_error: + raise YTUfuncUnitError(ufunc, *units) + inps = (inps[0], ret_class(inps[1]).to( + ret_class(inps[0]).units)) + return inps, units + +def handle_multiply_divide_units(unit, units, out, out_arr): + if unit.is_dimensionless and unit.base_value != 1.0: + if not units[0].is_dimensionless: + if units[0].dimensions == units[1].dimensions: + out_arr = np.multiply(out_arr.view(np.ndarray), + unit.base_value, out=out) + unit = Unit(registry=unit.registry) + return out, out_arr, unit + def coerce_iterable_units(input_object): if isinstance(input_object, np.ndarray): return input_object @@ -201,11 +283,11 @@ return other_units unary_operators = ( - negative, absolute, rint, ones_like, sign, conj, exp, exp2, log, log2, + negative, absolute, rint, sign, conj, exp, exp2, log, log2, log10, expm1, log1p, sqrt, square, reciprocal, sin, cos, tan, arcsin, arccos, arctan, sinh, cosh, tanh, arcsinh, arccosh, arctanh, deg2rad, rad2deg, invert, logical_not, isreal, iscomplex, isfinite, isinf, isnan, - signbit, floor, ceil, trunc, modf, frexp, fabs, spacing + signbit, floor, ceil, trunc, modf, frexp, fabs, spacing, positive, isnat, ) binary_operators = ( @@ -213,7 +295,7 @@ remainder, mod, arctan2, hypot, bitwise_and, bitwise_or, bitwise_xor, left_shift, right_shift, greater, greater_equal, less, less_equal, not_equal, equal, logical_and, logical_or, logical_xor, maximum, minimum, - fmax, fmin, copysign, nextafter, ldexp, fmod, + fmax, fmin, copysign, nextafter, ldexp, fmod, divmod_, heaviside ) trigonometric_operators = ( @@ -227,16 +309,16 @@ Parameters ---------- - input_array : iterable + input_array : :obj:`!iterable` A tuple, list, or array to attach units to input_units : String unit specification, unit symbol object, or astropy units The units of the array. Powers must be specified using python syntax (cm**3, not cm^3). - registry : A UnitRegistry object + registry : ~yt.units.unit_registry.UnitRegistry The registry to create units from. If input_units is already associated with a unit registry and this is specified, this will be used instead of the registry associated with the unit object. - dtype : string or NumPy dtype object + dtype : data-type The dtype of the array data. Defaults to the dtype of the input data, or, if none is found, uses np.float64 bypass_validation : boolean @@ -259,9 +341,9 @@ NumPy ufuncs will pass through units where appropriate. >>> import numpy as np - >>> a = YTArray(np.arange(8), 'g/cm**3') - >>> np.ones_like(a) - YTArray([1, 1, 1, 1, 1, 1, 1, 1]) g/cm**3 + >>> a = YTArray(np.arange(8) - 4, 'g/cm**3') + >>> np.abs(a) + YTArray([4, 3, 2, 1, 0, 1, 2, 3]) g/cm**3 and strip them when it would be annoying to deal with them. @@ -314,7 +396,6 @@ sqrt: sqrt_unit, square: square_unit, reciprocal: reciprocal_unit, - ones_like: passthrough_unit, sin: return_without_unit, cos: return_without_unit, tan: return_without_unit, @@ -366,6 +447,10 @@ ceil: passthrough_unit, trunc: passthrough_unit, spacing: passthrough_unit, + positive: passthrough_unit, + divmod_: passthrough_unit, + isnat: return_without_unit, + heaviside: preserve_units, } __array_priority__ = 2.0 @@ -393,7 +478,7 @@ ret = input_array.view(cls) if input_units is None: if registry is None: - pass + ret.units = input_array.units else: units = Unit(str(input_array.units), registry=registry) ret.units = units @@ -434,14 +519,6 @@ return obj - def __array_finalize__(self, obj): - """ - - """ - if obj is None and hasattr(self, 'units'): - return - self.units = getattr(obj, 'units', NULL_UNIT) - def __repr__(self): """ @@ -615,7 +692,7 @@ self, conv_unit.dimensions, **kwargs) if isinstance(new_arr, tuple): try: - return YTArray(new_arr[0], new_arr[1]).in_units(unit) + return type(self)(new_arr[0], new_arr[1]).in_units(unit) except YTUnitConversionError: raise YTInvalidUnitEquivalence(equiv, self.units, unit) else: @@ -774,7 +851,7 @@ info: dictionary A dictionary of supplementary info to write to append as attributes to the dataset. - + group_name: string An optional group to write the arrays to. If not specified, the arrays are datasets at the top level by default. @@ -786,7 +863,7 @@ >>> a.write_hdf5('test_array_data.h5', dataset_name='dinosaurs', ... info=myinfo) """ - import h5py + from yt.utilities.on_demand_imports import _h5py as h5py from yt.extern.six.moves import cPickle as pickle if info is None: info = {} @@ -809,7 +886,7 @@ d = g[dataset_name] # Overwrite without deleting if we can get away with it. if d.shape == self.shape and d.dtype == self.dtype: - d[:] = self + d[...] = self for k in d.attrs.keys(): del d.attrs[k] else: @@ -824,7 +901,8 @@ @classmethod def from_hdf5(cls, filename, dataset_name=None, group_name=None): - r"""Attempts read in and convert a dataset in an hdf5 file into a YTArray. + r"""Attempts read in and convert a dataset in an hdf5 file into a + YTArray. Parameters ---------- @@ -836,8 +914,8 @@ attribute, attempt to infer units as well. group_name: string - An optional group to read the arrays from. If not specified, the arrays - are datasets at the top level by default. + An optional group to read the arrays from. If not specified, the + arrays are datasets at the top level by default. """ import h5py @@ -882,371 +960,403 @@ @property def unit_quantity(self): - """Get a YTQuantity with the same unit as this array and a value of 1.0""" + """Get a YTQuantity with the same unit as this array and a value of + 1.0""" return YTQuantity(1.0, self.units) uq = unit_quantity @property def unit_array(self): - """Get a YTArray filled with ones with the same unit and shape as this array""" + """Get a YTArray filled with ones with the same unit and shape as this + array""" return np.ones_like(self) ua = unit_array + def __getitem__(self, item): + ret = super(YTArray, self).__getitem__(item) + if ret.shape == (): + return YTQuantity(ret, self.units, bypass_validation=True) + else: + if hasattr(self, 'units'): + ret.units = self.units + return ret + # # Start operation methods # - def __add__(self, right_object): - """ - Add this ytarray to the object on the right of the `+` operator. Must - check for the correct (same dimension) units. + if LooseVersion(np.__version__) < LooseVersion('1.13.0'): - """ - ro = sanitize_units_add(self, right_object, "addition") - return super(YTArray, self).__add__(ro) + def __add__(self, right_object): + """ + Add this ytarray to the object on the right of the `+` operator. + Must check for the correct (same dimension) units. + + """ + ro = sanitize_units_add(self, right_object, "addition") + return super(YTArray, self).__add__(ro) + + def __radd__(self, left_object): + """ See __add__. """ + lo = sanitize_units_add(self, left_object, "addition") + return super(YTArray, self).__radd__(lo) + + def __iadd__(self, other): + """ See __add__. """ + oth = sanitize_units_add(self, other, "addition") + np.add(self, oth, out=self) + return self + + def __sub__(self, right_object): + """ + Subtract the object on the right of the `-` from this ytarray. Must + check for the correct (same dimension) units. + + """ + ro = sanitize_units_add(self, right_object, "subtraction") + return super(YTArray, self).__sub__(ro) + + def __rsub__(self, left_object): + """ See __sub__. """ + lo = sanitize_units_add(self, left_object, "subtraction") + return super(YTArray, self).__rsub__(lo) + + def __isub__(self, other): + """ See __sub__. """ + oth = sanitize_units_add(self, other, "subtraction") + np.subtract(self, oth, out=self) + return self + + def __neg__(self): + """ Negate the data. """ + return super(YTArray, self).__neg__() + + def __mul__(self, right_object): + """ + Multiply this YTArray by the object on the right of the `*` + operator. The unit objects handle being multiplied. + + """ + ro = sanitize_units_mul(self, right_object) + return super(YTArray, self).__mul__(ro) + + def __rmul__(self, left_object): + """ See __mul__. """ + lo = sanitize_units_mul(self, left_object) + return super(YTArray, self).__rmul__(lo) + + def __imul__(self, other): + """ See __mul__. """ + oth = sanitize_units_mul(self, other) + np.multiply(self, oth, out=self) + return self + + def __div__(self, right_object): + """ + Divide this YTArray by the object on the right of the `/` operator. + + """ + ro = sanitize_units_mul(self, right_object) + return super(YTArray, self).__div__(ro) + + def __rdiv__(self, left_object): + """ See __div__. """ + lo = sanitize_units_mul(self, left_object) + return super(YTArray, self).__rdiv__(lo) + + def __idiv__(self, other): + """ See __div__. """ + oth = sanitize_units_mul(self, other) + np.divide(self, oth, out=self) + return self + + def __truediv__(self, right_object): + ro = sanitize_units_mul(self, right_object) + return super(YTArray, self).__truediv__(ro) + + def __rtruediv__(self, left_object): + """ See __div__. """ + lo = sanitize_units_mul(self, left_object) + return super(YTArray, self).__rtruediv__(lo) + + def __itruediv__(self, other): + """ See __div__. """ + oth = sanitize_units_mul(self, other) + np.true_divide(self, oth, out=self) + return self + + def __floordiv__(self, right_object): + ro = sanitize_units_mul(self, right_object) + return super(YTArray, self).__floordiv__(ro) + + def __rfloordiv__(self, left_object): + """ See __div__. """ + lo = sanitize_units_mul(self, left_object) + return super(YTArray, self).__rfloordiv__(lo) + + def __ifloordiv__(self, other): + """ See __div__. """ + oth = sanitize_units_mul(self, other) + np.floor_divide(self, oth, out=self) + return self + + def __or__(self, right_object): + return super(YTArray, self).__or__(right_object) + + def __ror__(self, left_object): + return super(YTArray, self).__ror__(left_object) + + def __ior__(self, other): + np.bitwise_or(self, other, out=self) + return self + + def __xor__(self, right_object): + return super(YTArray, self).__xor__(right_object) + + def __rxor__(self, left_object): + return super(YTArray, self).__rxor__(left_object) + + def __ixor__(self, other): + np.bitwise_xor(self, other, out=self) + return self + + def __and__(self, right_object): + return super(YTArray, self).__and__(right_object) + + def __rand__(self, left_object): + return super(YTArray, self).__rand__(left_object) + + def __iand__(self, other): + np.bitwise_and(self, other, out=self) + return self + + def __pow__(self, power): + """ + Raise this YTArray to some power. + + Parameters + ---------- + power : float or dimensionless YTArray. + The pow value. + + """ + if isinstance(power, YTArray): + if not power.units.is_dimensionless: + raise YTUnitOperationError('power', power.unit) + + # Work around a sympy issue (I think?) + # + # If I don't do this, super(YTArray, self).__pow__ returns a YTArray + # with a unit attribute set to the sympy expression 1/1 rather than + # a dimensionless Unit object. + if self.units.is_dimensionless and power == -1: + ret = super(YTArray, self).__pow__(power) + return type(self)(ret, input_units='') + + return super(YTArray, self).__pow__(power) + + def __abs__(self): + """ Return a YTArray with the abs of the data. """ + return super(YTArray, self).__abs__() - def __radd__(self, left_object): - """ See __add__. """ - lo = sanitize_units_add(self, left_object, "addition") - return super(YTArray, self).__radd__(lo) + # + # Start comparison operators. + # - def __iadd__(self, other): - """ See __add__. """ - oth = sanitize_units_add(self, other, "addition") - np.add(self, oth, out=self) - return self + def __lt__(self, other): + """ Test if this is less than the object on the right. """ + # converts if possible + oth = validate_comparison_units(self, other, 'less_than') + return super(YTArray, self).__lt__(oth) + + def __le__(self, other): + """Test if this is less than or equal to the object on the right. + """ + oth = validate_comparison_units(self, other, 'less_than or equal') + return super(YTArray, self).__le__(oth) + + def __eq__(self, other): + """ Test if this is equal to the object on the right. """ + # Check that other is a YTArray. + if other is None: + # self is a YTArray, so it can't be None. + return False + oth = validate_comparison_units(self, other, 'equal') + return super(YTArray, self).__eq__(oth) + + def __ne__(self, other): + """ Test if this is not equal to the object on the right. """ + # Check that the other is a YTArray. + if other is None: + return True + oth = validate_comparison_units(self, other, 'not equal') + return super(YTArray, self).__ne__(oth) + + def __ge__(self, other): + """ Test if this is greater than or equal to other. """ + # Check that the other is a YTArray. + oth = validate_comparison_units( + self, other, 'greater than or equal') + return super(YTArray, self).__ge__(oth) + + def __gt__(self, other): + """ Test if this is greater than the object on the right. """ + # Check that the other is a YTArray. + oth = validate_comparison_units(self, other, 'greater than') + return super(YTArray, self).__gt__(oth) - def __sub__(self, right_object): - """ - Subtract the object on the right of the `-` from this ytarray. Must - check for the correct (same dimension) units. + # + # End comparison operators + # - """ - ro = sanitize_units_add(self, right_object, "subtraction") - return super(YTArray, self).__sub__(ro) + # + # Begin reduction operators + # - def __rsub__(self, left_object): - """ See __sub__. """ - lo = sanitize_units_add(self, left_object, "subtraction") - return super(YTArray, self).__rsub__(lo) + @return_arr + def prod(self, axis=None, dtype=None, out=None): + if axis is not None: + units = self.units**self.shape[axis] + else: + units = self.units**self.size + return super(YTArray, self).prod(axis, dtype, out), units - def __isub__(self, other): - """ See __sub__. """ - oth = sanitize_units_add(self, other, "subtraction") - np.subtract(self, oth, out=self) - return self + @return_arr + def mean(self, axis=None, dtype=None, out=None): + return super(YTArray, self).mean(axis, dtype, out), self.units + + @return_arr + def sum(self, axis=None, dtype=None, out=None): + return super(YTArray, self).sum(axis, dtype, out), self.units + + @return_arr + def std(self, axis=None, dtype=None, out=None, ddof=0): + return super(YTArray, self).std(axis, dtype, out, ddof), self.units + + def __array_wrap__(self, out_arr, context=None): + ret = super(YTArray, self).__array_wrap__(out_arr, context) + if isinstance(ret, YTQuantity) and ret.shape != (): + ret = ret.view(YTArray) + if context is None: + if ret.shape == (): + return ret[()] + else: + return ret + ufunc = context[0] + inputs = context[1] + if ufunc in unary_operators: + out_arr, inp, u = get_inp_u_unary(ufunc, inputs, out_arr) + unit = self._ufunc_registry[context[0]](u) + ret_class = type(self) + elif ufunc in binary_operators: + unit_operator = self._ufunc_registry[context[0]] + inps, units, ret_class = get_inp_u_binary(ufunc, inputs) + if unit_operator in (preserve_units, comparison_unit, + arctan2_unit): + inps, units = handle_comparison_units( + inps, units, ufunc, ret_class, raise_error=True) + unit = unit_operator(*units) + if unit_operator in (multiply_units, divide_units): + out_arr, out_arr, unit = handle_multiply_divide_units( + unit, units, out_arr, out_arr) + else: + raise RuntimeError( + "Support for the %s ufunc has not been added " + "to YTArray." % str(context[0])) + if unit is None: + out_arr = np.array(out_arr, copy=False) + return out_arr + out_arr.units = unit + if out_arr.size == 1: + return YTQuantity(np.array(out_arr), unit) + else: + if ret_class is YTQuantity: + # This happens if you do ndarray * YTQuantity. Explicitly + # casting to YTArray avoids creating a YTQuantity with + # size > 1 + return YTArray(np.array(out_arr), unit) + return ret_class(np.array(out_arr, copy=False), unit) + + else: # numpy version equal to or newer than 1.13 + + def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): + func = getattr(ufunc, method) + if 'out' in kwargs: + out_orig = kwargs.pop('out') + out = np.asarray(out_orig[0]) + else: + out = None + if len(inputs) == 1: + _, inp, u = get_inp_u_unary(ufunc, inputs) + out_arr = func(np.asarray(inp), out=out, **kwargs) + if ufunc in (multiply, divide) and method == 'reduce': + power_sign = POWER_SIGN_MAPPING[ufunc] + if 'axis' in kwargs and kwargs['axis'] is not None: + unit = u**(power_sign*inp.shape[kwargs['axis']]) + else: + unit = u**(power_sign*inp.size) + else: + unit = self._ufunc_registry[ufunc](u) + ret_class = type(self) + elif len(inputs) == 2: + unit_operator = self._ufunc_registry[ufunc] + inps, units, ret_class = get_inp_u_binary(ufunc, inputs) + if unit_operator in (comparison_unit, arctan2_unit): + inps, units = handle_comparison_units( + inps, units, ufunc, ret_class) + elif unit_operator is preserve_units: + inps, units = handle_preserve_units( + inps, units, ufunc, ret_class) + unit = unit_operator(*units) + out_arr = func(np.asarray(inps[0]), np.asarray(inps[1]), + out=out, **kwargs) + if unit_operator in (multiply_units, divide_units): + out, out_arr, unit = handle_multiply_divide_units( + unit, units, out, out_arr) + else: + raise RuntimeError( + "Support for the %s ufunc with %i inputs has not been" + "added to YTArray." % (str(ufunc), len(inputs))) + if unit is None: + out_arr = np.array(out_arr, copy=False) + elif ufunc in (modf, divmod_): + out_arr = tuple((ret_class(o, unit) for o in out_arr)) + elif out_arr.size == 1: + out_arr = YTQuantity(np.asarray(out_arr), unit) + else: + if ret_class is YTQuantity: + # This happens if you do ndarray * YTQuantity. Explicitly + # casting to YTArray avoids creating a YTQuantity with + # size > 1 + out_arr = YTArray(np.asarray(out_arr), unit) + else: + out_arr = ret_class(np.asarray(out_arr), unit) + if out is not None: + out_orig[0].flat[:] = out.flat[:] + if isinstance(out_orig[0], YTArray): + out_orig[0].units = unit + return out_arr - def __neg__(self): - """ Negate the data. """ - return super(YTArray, self).__neg__() + def copy(self, order='C'): + return type(self)(np.copy(np.asarray(self)), self.units) + + def __array_finalize__(self, obj): + if obj is None and hasattr(self, 'units'): + return + self.units = getattr(obj, 'units', NULL_UNIT) def __pos__(self): """ Posify the data. """ + # this needs to be defined for all numpy versions, see + # numpy issue #9081 return type(self)(super(YTArray, self).__pos__(), self.units) - def __mul__(self, right_object): - """ - Multiply this YTArray by the object on the right of the `*` operator. - The unit objects handle being multiplied. - - """ - ro = sanitize_units_mul(self, right_object) - return super(YTArray, self).__mul__(ro) - - def __rmul__(self, left_object): - """ See __mul__. """ - lo = sanitize_units_mul(self, left_object) - return super(YTArray, self).__rmul__(lo) - - def __imul__(self, other): - """ See __mul__. """ - oth = sanitize_units_mul(self, other) - np.multiply(self, oth, out=self) - return self - - def __div__(self, right_object): - """ - Divide this YTArray by the object on the right of the `/` operator. - - """ - ro = sanitize_units_mul(self, right_object) - return super(YTArray, self).__div__(ro) - - def __rdiv__(self, left_object): - """ See __div__. """ - lo = sanitize_units_mul(self, left_object) - return super(YTArray, self).__rdiv__(lo) - - def __idiv__(self, other): - """ See __div__. """ - oth = sanitize_units_mul(self, other) - np.divide(self, oth, out=self) - return self - - def __truediv__(self, right_object): - ro = sanitize_units_mul(self, right_object) - return super(YTArray, self).__truediv__(ro) - - def __rtruediv__(self, left_object): - """ See __div__. """ - lo = sanitize_units_mul(self, left_object) - return super(YTArray, self).__rtruediv__(lo) - - def __itruediv__(self, other): - """ See __div__. """ - oth = sanitize_units_mul(self, other) - np.true_divide(self, oth, out=self) - return self - - def __floordiv__(self, right_object): - ro = sanitize_units_mul(self, right_object) - return super(YTArray, self).__floordiv__(ro) - - def __rfloordiv__(self, left_object): - """ See __div__. """ - lo = sanitize_units_mul(self, left_object) - return super(YTArray, self).__rfloordiv__(lo) - - def __ifloordiv__(self, other): - """ See __div__. """ - oth = sanitize_units_mul(self, other) - np.floor_divide(self, oth, out=self) - return self - - def __or__(self, right_object): - return super(YTArray, self).__or__(right_object) - - def __ror__(self, left_object): - return super(YTArray, self).__ror__(left_object) - - def __ior__(self, other): - np.bitwise_or(self, other, out=self) - return self - - def __xor__(self, right_object): - return super(YTArray, self).__xor__(right_object) - - def __rxor__(self, left_object): - return super(YTArray, self).__rxor__(left_object) - - def __ixor__(self, other): - np.bitwise_xor(self, other, out=self) - return self - - def __and__(self, right_object): - return super(YTArray, self).__and__(right_object) - - def __rand__(self, left_object): - return super(YTArray, self).__rand__(left_object) - - def __iand__(self, other): - np.bitwise_and(self, other, out=self) - return self - - def __pow__(self, power): - """ - Raise this YTArray to some power. - - Parameters - ---------- - power : float or dimensionless YTArray. - The pow value. - - """ - if isinstance(power, YTArray): - if not power.units.is_dimensionless: - raise YTUnitOperationError('power', power.unit) - - # Work around a sympy issue (I think?) - # - # If I don't do this, super(YTArray, self).__pow__ returns a YTArray - # with a unit attribute set to the sympy expression 1/1 rather than a - # dimensionless Unit object. - if self.units.is_dimensionless and power == -1: - ret = super(YTArray, self).__pow__(power) - return type(self)(ret, input_units='') - - return super(YTArray, self).__pow__(power) - - def __abs__(self): - """ Return a YTArray with the abs of the data. """ - return super(YTArray, self).__abs__() - - def sqrt(self): - """ - Return sqrt of this YTArray. We take the sqrt for the array and use - take the 1/2 power of the units. - - """ - return type(self)(super(YTArray, self).sqrt(), - input_units=self.units**0.5) - - # - # Start comparison operators. - # - - def __lt__(self, other): - """ Test if this is less than the object on the right. """ - # converts if possible - oth = validate_comparison_units(self, other, 'less_than') - return super(YTArray, self).__lt__(oth) - - def __le__(self, other): - """ Test if this is less than or equal to the object on the right. """ - oth = validate_comparison_units(self, other, 'less_than or equal') - return super(YTArray, self).__le__(oth) - - def __eq__(self, other): - """ Test if this is equal to the object on the right. """ - # Check that other is a YTArray. - if other is None: - # self is a YTArray, so it can't be None. - return False - oth = validate_comparison_units(self, other, 'equal') - return super(YTArray, self).__eq__(oth) - - def __ne__(self, other): - """ Test if this is not equal to the object on the right. """ - # Check that the other is a YTArray. - if other is None: - return True - oth = validate_comparison_units(self, other, 'not equal') - return super(YTArray, self).__ne__(oth) - - def __ge__(self, other): - """ Test if this is greater than or equal to other. """ - # Check that the other is a YTArray. - oth = validate_comparison_units(self, other, 'greater than or equal') - return super(YTArray, self).__ge__(oth) - - def __gt__(self, other): - """ Test if this is greater than the object on the right. """ - # Check that the other is a YTArray. - oth = validate_comparison_units(self, other, 'greater than') - return super(YTArray, self).__gt__(oth) - - # - # End comparison operators - # - - # - # Begin reduction operators - # - - @return_arr - def prod(self, axis=None, dtype=None, out=None): - if axis is not None: - units = self.units**self.shape[axis] - else: - units = self.units**self.size - return super(YTArray, self).prod(axis, dtype, out), units - - @return_arr - def mean(self, axis=None, dtype=None, out=None): - return super(YTArray, self).mean(axis, dtype, out), self.units - - @return_arr - def sum(self, axis=None, dtype=None, out=None): - return super(YTArray, self).sum(axis, dtype, out), self.units - @return_arr def dot(self, b, out=None): return super(YTArray, self).dot(b), self.units*b.units - @return_arr - def std(self, axis=None, dtype=None, out=None, ddof=0): - return super(YTArray, self).std(axis, dtype, out, ddof), self.units - - def __getitem__(self, item): - ret = super(YTArray, self).__getitem__(item) - if ret.shape == (): - return YTQuantity(ret, self.units, bypass_validation=True) - else: - return ret - - def __array_wrap__(self, out_arr, context=None): - ret = super(YTArray, self).__array_wrap__(out_arr, context) - if isinstance(ret, YTQuantity) and ret.shape != (): - ret = ret.view(YTArray) - if context is None: - if ret.shape == (): - return ret[()] - else: - return ret - elif context[0] in unary_operators: - u = getattr(context[1][0], 'units', None) - if u is None: - u = NULL_UNIT - if u.dimensions is angle and context[0] in trigonometric_operators: - out_arr = context[0]( - context[1][0].in_units('radian').view(np.ndarray)) - unit = self._ufunc_registry[context[0]](u) - ret_class = type(self) - elif context[0] in binary_operators: - oper1 = coerce_iterable_units(context[1][0]) - oper2 = coerce_iterable_units(context[1][1]) - cls1 = type(oper1) - cls2 = type(oper2) - unit1 = getattr(oper1, 'units', None) - unit2 = getattr(oper2, 'units', None) - ret_class = get_binary_op_return_class(cls1, cls2) - if unit1 is None: - unit1 = Unit(registry=getattr(unit2, 'registry', None)) - if unit2 is None and context[0] is not power: - unit2 = Unit(registry=getattr(unit1, 'registry', None)) - elif context[0] is power: - unit2 = oper2 - if isinstance(unit2, np.ndarray): - if isinstance(unit2, YTArray): - if unit2.units.is_dimensionless: - pass - else: - raise YTUnitOperationError(context[0], unit1, unit2) - unit2 = 1.0 - unit_operator = self._ufunc_registry[context[0]] - if unit_operator in (preserve_units, comparison_unit, arctan2_unit): - # Allow comparisons, addition, and subtraction with - # dimensionless quantities or arrays filled with zeros. - u1d = unit1.is_dimensionless - u2d = unit2.is_dimensionless - if unit1 != unit2: - any_nonzero = [np.any(oper1), np.any(oper2)] - if any_nonzero[0] is np.bool_(False): - unit1 = unit2 - elif any_nonzero[1] is np.bool_(False): - unit2 = unit1 - elif not any([u1d, u2d]): - if not unit1.same_dimensions_as(unit2): - raise YTUnitOperationError(context[0], unit1, unit2) - else: - raise YTUfuncUnitError(context[0], unit1, unit2) - unit = unit_operator(unit1, unit2) - if unit_operator in (multiply_units, divide_units): - if unit.is_dimensionless and unit.base_value != 1.0: - if not unit1.is_dimensionless: - if unit1.dimensions == unit2.dimensions: - np.multiply(out_arr.view(np.ndarray), - unit.base_value, out=out_arr) - unit = Unit(registry=unit.registry) - else: - raise RuntimeError("Support for the %s ufunc has not been added " - "to YTArray." % str(context[0])) - if unit is None: - out_arr = np.array(out_arr, copy=False) - return out_arr - out_arr.units = unit - if out_arr.size == 1: - return YTQuantity(np.array(out_arr), unit) - else: - if ret_class is YTQuantity: - # This happens if you do ndarray * YTQuantity. Explicitly - # casting to YTArray avoids creating a YTQuantity with size > 1 - return YTArray(np.array(out_arr), unit) - return ret_class(np.array(out_arr, copy=False), unit) - - def __reduce__(self): """Pickle reduction method @@ -1306,7 +1416,7 @@ The registry to create units from. If input_units is already associated with a unit registry and this is specified, this will be used instead of the registry associated with the unit object. - dtype : string or NumPy dtype object + dtype : data-type The dtype of the array data. Examples @@ -1324,8 +1434,8 @@ >>> import numpy as np >>> a = YTQuantity(12, 'g/cm**3') - >>> np.ones_like(a) - 1 g/cm**3 + >>> np.abs(a) + 12 g/cm**3 and strip them when it would be annoying to deal with them. @@ -1390,17 +1500,16 @@ v = validate_numpy_wrapper_units(v, arrs) return v -def ucross(arr1,arr2, registry=None): +def ucross(arr1, arr2, registry=None, axisa=-1, axisb=-1, axisc=-1, axis=None): """Applies the cross product to two YT arrays. This wrapper around numpy.cross preserves units. See the documentation of numpy.cross for full details. """ - - v = np.cross(arr1,arr2) + v = np.cross(arr1, arr2, axisa=axisa, axisb=axisb, axisc=axisc, axis=axis) units = arr1.units * arr2.units - arr = YTArray(v,units, registry=registry) + arr = YTArray(v, units, registry=registry) return arr def uintersect1d(arr1, arr2, assume_unique=False): @@ -1441,12 +1550,34 @@ v = validate_numpy_wrapper_units(v, [arr1, arr2]) return v -def unorm(data): +def unorm(data, ord=None, axis=None, keepdims=False): """Matrix or vector norm that preserves units - This is a wrapper around np.linalg.norm that preserves units. + This is a wrapper around np.linalg.norm that preserves units. See + the documentation for that function for descriptions of the keyword + arguments. + + The keepdims argument is ignored if the version of numpy installed is + older than numpy 1.10.0. + """ + if LooseVersion(np.__version__) < LooseVersion('1.10.0'): + norm = np.linalg.norm(data, ord=ord, axis=axis) + else: + norm = np.linalg.norm(data, ord=ord, axis=axis, keepdims=keepdims) + if norm.shape == (): + return YTQuantity(norm, data.units) + return YTArray(norm, data.units) + +def udot(op1, op2): + """Matrix or vector dot product that preservs units + + This is a wrapper around np.dot that preserves units. """ - return YTArray(np.linalg.norm(data), data.units) + dot = np.dot(op1.d, op2.d) + units = op1.units*op2.units + if dot.shape == (): + return YTQuantity(dot, units) + return YTArray(dot, units) def uvstack(arrs): """Stack arrays in sequence vertically (row wise) while preserving units @@ -1484,9 +1615,9 @@ def get_binary_op_return_class(cls1, cls2): if cls1 is cls2: return cls1 - if cls1 is np.ndarray or issubclass(cls1, (numeric_type, np.number, list, tuple)): + if cls1 in (np.ndarray, np.matrix, np.ma.masked_array) or issubclass(cls1, (numeric_type, np.number, list, tuple)): return cls2 - if cls2 is np.ndarray or issubclass(cls2, (numeric_type, np.number, list, tuple)): + if cls2 in (np.ndarray, np.matrix, np.ma.masked_array) or issubclass(cls2, (numeric_type, np.number, list, tuple)): return cls1 if issubclass(cls1, YTQuantity): return cls2 diff -Nru yt-3.3.3/yt/utilities/answer_testing/framework.py yt-3.4.0/yt/utilities/answer_testing/framework.py --- yt-3.3.3/yt/utilities/answer_testing/framework.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/answer_testing/framework.py 2017-08-10 18:02:57.000000000 +0000 @@ -229,7 +229,13 @@ class AnswerTestLocalStorage(AnswerTestStorage): def dump(self, result_storage): - if self.answer_name is None: return + # The 'tainted' attribute is automatically set to 'True' + # if the dataset required for an answer test is missing + # (see can_run_ds() and can_run_sim()). + # This logic check prevents creating a shelve with empty answers. + storage_is_tainted = result_storage.get('tainted', False) + if self.answer_name is None or storage_is_tainted: + return # Store data using shelve ds = shelve.open(self.answer_name, protocol=-1) for ds_name in result_storage: @@ -259,34 +265,44 @@ os.chdir(oldcwd) def can_run_ds(ds_fn, file_check = False): + result_storage = AnswerTestingTest.result_storage if isinstance(ds_fn, Dataset): - return AnswerTestingTest.result_storage is not None + return result_storage is not None path = ytcfg.get("yt", "test_data_dir") if not os.path.isdir(path): return False if file_check: return os.path.isfile(os.path.join(path, ds_fn)) and \ - AnswerTestingTest.result_storage is not None + result_storage is not None try: load(ds_fn) except YTOutputNotIdentified: + if ytcfg.getboolean("yt", "requires_ds_strict"): + if result_storage is not None: + result_storage['tainted'] = True + raise return False - return AnswerTestingTest.result_storage is not None + return result_storage is not None def can_run_sim(sim_fn, sim_type, file_check = False): + result_storage = AnswerTestingTest.result_storage if isinstance(sim_fn, SimulationTimeSeries): - return AnswerTestingTest.result_storage is not None + return result_storage is not None path = ytcfg.get("yt", "test_data_dir") if not os.path.isdir(path): return False if file_check: return os.path.isfile(os.path.join(path, sim_fn)) and \ - AnswerTestingTest.result_storage is not None + result_storage is not None try: simulation(sim_fn, sim_type) except YTOutputNotIdentified: + if ytcfg.getboolean("yt", "requires_ds_strict"): + if result_storage is not None: + result_storage['tainted'] = True + raise return False - return AnswerTestingTest.result_storage is not None + return result_storage is not None def data_dir_load(ds_fn, cls = None, args = None, kwargs = None): args = args or () @@ -324,6 +340,8 @@ self.ds = data_dir_load(ds_fn) def __call__(self): + if AnswerTestingTest.result_storage is None: + return nv = self.run() if self.reference_storage.reference_name is not None: dd = self.reference_storage.get(self.storage_name) @@ -387,7 +405,7 @@ oname = "_".join((str(s) for s in obj_type)) args = [self._type_name, str(self.ds), oname] args += [str(getattr(self, an)) for an in self._attrs] - return "_".join(args) + return "_".join(args).replace('.', '_') class FieldValuesTest(AnswerTestingTest): _type_name = "FieldValues" @@ -712,7 +730,7 @@ def compare(self, new_result, old_result): compare_image_lists(new_result, old_result, self.decimals) - + class PlotWindowAttributeTest(AnswerTestingTest): _type_name = "PlotWindowAttribute" _attrs = ('plot_type', 'plot_field', 'plot_axis', 'attr_name', 'attr_args', @@ -756,7 +774,7 @@ _type_name = "PhasePlotAttribute" _attrs = ('plot_type', 'x_field', 'y_field', 'z_field', 'attr_name', 'attr_args') - def __init__(self, ds_fn, x_field, y_field, z_field, + def __init__(self, ds_fn, x_field, y_field, z_field, attr_name, attr_args, decimals, plot_type='PhasePlot'): super(PhasePlotAttributeTest, self).__init__(ds_fn) self.data_source = self.ds.all_data() @@ -769,7 +787,7 @@ self.attr_args = attr_args self.decimals = decimals - def create_plot(self, data_source, x_field, y_field, z_field, + def create_plot(self, data_source, x_field, y_field, z_field, plot_type, plot_kwargs=None): # plot_type should be a string # plot_kwargs should be a dict @@ -864,6 +882,47 @@ def compare(self, new_result, old_result): compare_image_lists(new_result, old_result, self.decimals) +class AxialPixelizationTest(AnswerTestingTest): + # This test is typically used once per geometry or coordinates type. + # Feed it a dataset, and it checks that the results of basic pixelization + # don't change. + _type_name = "AxialPixelization" + _attrs = ('geometry',) + def __init__(self, ds_fn, decimals=None): + super(AxialPixelizationTest, self).__init__(ds_fn) + self.decimals = decimals + self.geometry = self.ds.coordinates.name + + def run(self): + rv = {} + ds = self.ds + for i, axis in enumerate(ds.coordinates.axis_order): + (bounds, center, display_center) = \ + pw.get_window_parameters(axis, ds.domain_center, None, ds) + slc = ds.slice(axis, center[i]) + xax = ds.coordinates.axis_name[ds.coordinates.x_axis[axis]] + yax = ds.coordinates.axis_name[ds.coordinates.y_axis[axis]] + pix_x = ds.coordinates.pixelize(axis, slc, xax, bounds, (512, 512)) + pix_y = ds.coordinates.pixelize(axis, slc, yax, bounds, (512, 512)) + # Wipe out all NaNs + pix_x[np.isnan(pix_x)] = 0.0 + pix_y[np.isnan(pix_y)] = 0.0 + rv['%s_x' % axis] = pix_x + rv['%s_y' % axis] = pix_y + return rv + + def compare(self, new_result, old_result): + assert_equal(len(new_result), len(old_result), + err_msg="Number of outputs not equal.", + verbose=True) + for k in new_result: + if self.decimals is None: + assert_almost_equal(new_result[k], old_result[k]) + else: + assert_allclose_units(new_result[k], old_result[k], + 10**(-self.decimals)) + + def requires_sim(sim_fn, sim_type, big_data = False, file_check = False): def ffalse(func): return lambda: None @@ -885,7 +944,7 @@ return ftrue else: return ffalse - + def requires_ds(ds_fn, big_data = False, file_check = False): def ffalse(func): return lambda: None @@ -933,21 +992,18 @@ def sph_answer(ds, ds_str_repr, ds_nparticles, fields): if not can_run_ds(ds): return - yield AssertWrapper("%s_string_representation" % str(ds), assert_equal, - str(ds), ds_str_repr) + assert_equal(str(ds), ds_str_repr) dso = [None, ("sphere", ("c", (0.1, 'unitary')))] dd = ds.all_data() - yield AssertWrapper("%s_all_data_part_shape" % str(ds), assert_equal, - dd["particle_position"].shape, (ds_nparticles, 3)) + assert_equal(dd["particle_position"].shape, (ds_nparticles, 3)) tot = sum(dd[ptype, "particle_position"].shape[0] for ptype in ds.particle_types if ptype != "all") - yield AssertWrapper("%s_all_data_part_total" % str(ds), assert_equal, - tot, ds_nparticles) + assert_equal(tot, ds_nparticles) for dobj_name in dso: dobj = create_obj(ds, dobj_name) s1 = dobj["ones"].sum() s2 = sum(mask.sum() for block, mask in dobj.blocks) - yield AssertWrapper("%s_mask_test" % str(ds), assert_equal, s1, s2) + assert_equal(s1, s2) for field, weight_field in fields.items(): if field[0] in ds.particle_types: particle_type = True @@ -969,17 +1025,3 @@ cls = getattr(ds, obj_type[0]) obj = cls(*obj_type[1]) return obj - -class AssertWrapper(object): - """ - Used to wrap a numpy testing assertion, in order to provide a useful name - for a given assertion test. - """ - def __init__(self, description, *args): - # The key here is to add a description attribute, which nose will pick - # up. - self.args = args - self.description = description - - def __call__(self): - self.args[0](*self.args[1:]) diff -Nru yt-3.3.3/yt/utilities/command_line.py yt-3.4.0/yt/utilities/command_line.py --- yt-3.3.3/yt/utilities/command_line.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/command_line.py 2017-08-10 18:02:57.000000000 +0000 @@ -25,27 +25,33 @@ import tempfile import json import pprint +import textwrap -from yt.config import ytcfg +from yt.config import ytcfg, CURRENT_CONFIG_FILE ytcfg["yt","__command_line"] = "True" from yt.startup_tasks import parser, subparsers from yt.funcs import \ + ensure_dir, \ ensure_list, \ - get_hg_version, \ + get_hg_or_git_version, \ get_yt_version, \ mylog, \ ensure_dir_exists, \ - update_hg, \ - enable_plugins + update_hg_or_git, \ + enable_plugins, \ + download_file from yt.extern.six import add_metaclass, string_types from yt.extern.six.moves import urllib, input +from yt.extern.six.moves.urllib.parse import urlparse +from yt.extern.tqdm import tqdm from yt.convenience import load from yt.visualization.plot_window import \ SlicePlot, \ ProjectionPlot from yt.utilities.metadata import get_metadata +from yt.utilities.configure import set_config from yt.utilities.exceptions import \ - YTOutputNotIdentified, YTFieldNotParseable + YTOutputNotIdentified, YTFieldNotParseable, YTCommandRequiresModule # loading field plugins for backward compatibility, since this module # used to do "from yt.mods import *" @@ -78,7 +84,7 @@ def _print_failed_source_update(reinstall=False): print() - print("The yt package is not installed from a mercurial repository,") + print("The yt package is not installed from a git repository,") print("so you must update this installation manually.") if 'Continuum Analytics' in sys.version or 'Anaconda' in sys.version: # see http://stackoverflow.com/a/21318941/1382869 for why we need @@ -95,6 +101,13 @@ print("To update all of your packages, you can do:") print() print(" $ conda update --all") + else: + print("If you manage your python dependencies with pip, you may") + print("want to do:") + print() + print(" $ pip install -U yt") + print() + print("to update your yt installation.") def _print_installation_information(path): import yt @@ -112,21 +125,75 @@ print() print("---") print("Version = %s" % yt.__version__) - vstring = get_hg_version(path) + vstring = get_hg_or_git_version(path) if vstring is not None: - print("Changeset = %s" % vstring.strip().decode("utf-8")) + print("Changeset = %s" % vstring.strip()) print("---") return vstring + +def _get_girder_client(): + try: + import girder_client + except ImportError: + raise YTCommandRequiresModule('girder_client') + if not ytcfg.get("yt", "hub_api_key"): + print("Before you can access the yt Hub you need an API key") + print("In order to obtain one, either register by typing:") + print(" yt hub register") + print("or follow the instruction on:") + print(" http://yt-project.org/docs/dev/sharing_data.html#obtaining-an-api-key") + sys.exit() + hub_url = urlparse(ytcfg.get("yt", "hub_url")) + gc = girder_client.GirderClient(apiUrl=hub_url.geturl()) + gc.authenticate(apiKey=ytcfg.get("yt", "hub_api_key")) + return gc + + +class FileStreamer: + final_size = None + next_sent = 0 + chunksize = 100*1024 + + def __init__(self, f, final_size = None): + location = f.tell() + f.seek(0, os.SEEK_END) + self.final_size = f.tell() - location + f.seek(location) + self.f = f + + def __iter__(self): + with tqdm(total=self.final_size, desc='Uploading file', + unit='B', unit_scale=True) as pbar: + while self.f.tell() < self.final_size: + yield self.f.read(self.chunksize) + pbar.update(self.chunksize) + +_subparsers = {None: subparsers} +_subparsers_description = { + 'config': 'Get and set configuration values for yt', + 'hub': 'Interact with the yt Hub' +} class YTCommandSubtype(type): def __init__(cls, name, b, d): type.__init__(cls, name, b, d) if cls.name is not None: names = ensure_list(cls.name) + if cls.subparser not in _subparsers: + try: + description = _subparsers_description[cls.subparser] + except KeyError: + description = cls.subparser + parent_parser = argparse.ArgumentParser(add_help=False) + p = subparsers.add_parser(cls.subparser, help=description, + description=description, + parents=[parent_parser]) + _subparsers[cls.subparser] = p.add_subparsers( + title=cls.subparser, dest=cls.subparser) + sp = _subparsers[cls.subparser] for name in names: - sc = subparsers.add_parser(name, - description = cls.description, - help = cls.description) + sc = sp.add_parser(name, description=cls.description, + help=cls.description) sc.set_defaults(func=cls.run) for arg in cls.args: _add_arg(sc, arg) @@ -138,6 +205,7 @@ description = "" aliases = () ndatasets = 1 + subparser = None @classmethod def run(cls, args): @@ -185,7 +253,9 @@ _common_options = dict( all = dict(longname="--all", dest="reinstall", default=False, action="store_true", - help="Reinstall the full yt stack in the current location."), + help=("Reinstall the full yt stack in the current location." + "This option has been deprecated and will not have any" + "effect."),), ds = dict(short="ds", action=GetParameterFiles, nargs="+", help="datasets to run on"), ods = dict(action=GetParameterFiles, dest="ds", @@ -237,7 +307,7 @@ unit = dict(short="-u", longname="--unit", action="store", type=str, dest="unit", default='1', - help="Desired units"), + help="Desired axes units"), center = dict(short="-c", longname="--center", action="store", type=float, dest="center", default=None, @@ -376,54 +446,6 @@ ) -def _get_yt_stack_date(): - if "YT_DEST" not in os.environ: - print("Could not determine when yt stack was last updated.") - return - date_file = os.path.join(os.environ["YT_DEST"], ".yt_update") - if not os.path.exists(date_file): - print("Could not determine when yt stack was last updated.") - return - print("".join(open(date_file, 'r').readlines())) - print("To update all dependencies, run \"yt update --all\".") - -def _update_yt_stack(path): - "Rerun the install script to updated all dependencies." - - if "YT_DEST" not in os.environ: - print() - print("This yt installation does not appear to be managed by the") - print("source-based install script, but 'update --all' was specified.") - print("You will need to update your dependencies manually.") - return - - install_script = os.path.join(path, "doc/install_script.sh") - if not os.path.exists(install_script): - print() - print("Install script not found!") - print("The install script should be here: %s," % install_script) - print("but it was not.") - return - - print() - print("We will now attempt to update the yt stack located at:") - print(" %s." % os.environ["YT_DEST"]) - print() - print("[hit enter to continue or Ctrl-C to stop]") - try: - input() - except: - sys.exit(0) - os.environ["REINST_YT"] = "1" - ret = subprocess.call(["bash", install_script]) - print() - if ret: - print("The install script seems to have failed.") - print("Check the output above.") - else: - print("The yt stack has been updated successfully.") - print("Now get back to work!") - # This code snippet is modified from Georg Brandl def bb_apicall(endpoint, data, use_pass = True): uri = 'https://api.bitbucket.org/1.0/%s/' % endpoint @@ -557,25 +579,24 @@ class YTHubRegisterCmd(YTCommand): - name = "hub_register" + subparser = "hub" + name = "register" description = \ """ - Register a user on the Hub: http://hub.yt-project.org/ + Register a user on the yt Hub: http://hub.yt/ """ def __call__(self, args): - # We need these pieces of information: - # 1. Name - # 2. Email - # 3. Username - # 4. Password (and password2) - # 5. (optional) URL - # 6. "Secret" key to make it epsilon harder for spammers - if ytcfg.get("yt","hub_api_key") != "": + try: + import requests + except ImportError: + raise YTCommandRequiresModule('requests') + if ytcfg.get("yt", "hub_api_key") != "": print("You seem to already have an API key for the hub in") - print("~/.yt/config . Delete this if you want to force a") + print("{} . Delete this if you want to force a".format(CURRENT_CONFIG_FILE)) print("new user registration.") + sys.exit() print("Awesome! Let's start by registering a new user for you.") - print("Here's the URL, for reference: http://hub.yt-project.org/ ") + print("Here's the URL, for reference: http://hub.yt/ ") print() print("As always, bail out with Ctrl-C at any time.") print() @@ -586,8 +607,11 @@ print() print("To start out, what's your name?") print() - name = input("Name? ") - if len(name) == 0: sys.exit(1) + first_name = input("First Name? ") + if len(first_name) == 0: sys.exit(1) + print() + last_name = input("Last Name? ") + if len(last_name) == 0: sys.exit(1) print() print("And your email address?") print() @@ -604,33 +628,32 @@ print("Sorry, they didn't match! Let's try again.") print() print() - print("Would you like a URL displayed for your user?") - print("Leave blank if no.") - print() - url = input("URL? ") - print() print("Okay, press enter to register. You should receive a welcome") print("message at %s when this is complete." % email) print() input() - data = dict(name = name, email = email, username = username, - password = password1, password2 = password2, - url = url, zap = "rowsdower") - data = urllib.parse.urlencode(data) - hub_url = "https://hub.yt-project.org/create_user" - req = urllib.request.Request(hub_url, data) - try: - urllib.request.urlopen(req).read() - except urllib.error.HTTPError as exc: - if exc.code == 400: - print("Sorry, the Hub couldn't create your user.") - print("You can't register duplicate users, which is the most") - print("common cause of this error. All values for username,") - print("name, and email must be unique in our system.") - sys.exit(1) - except urllib.URLError as exc: - print("Something has gone wrong. Here's the error message.") - raise exc + + data = dict(firstName=first_name, email=email, login=username, + password=password1, lastName=last_name, admin=False) + hub_url = ytcfg.get("yt", "hub_url") + req = requests.post(hub_url + "/user", data=data) + + if req.ok: + headers = {'Girder-Token': req.json()['authToken']['token']} + else: + if req.status_code == 400: + print("Registration failed with 'Bad request':") + print(req.json()["message"]) + exit(1) + print("User registration successful") + print("Obtaining API key...") + req = requests.post(hub_url + "/api_key", headers=headers, + data={'name': 'ytcmd', 'active': True}) + apiKey = req.json()["key"] + + print("Storing API key in configuration file") + set_config("yt", "hub_api_key", apiKey) + print() print("SUCCESS!") print() @@ -661,9 +684,7 @@ if vstring is not None: print("This installation CAN be automatically updated.") if opts.update_source: - update_hg(path) - print("Updated successfully.") - _get_yt_stack_date() + update_hg_or_git(path) elif opts.update_source: _print_failed_source_update() if vstring is not None and opts.outputfile is not None: @@ -687,33 +708,21 @@ import yt import IPython - from distutils import version - if version.LooseVersion(IPython.__version__) <= version.LooseVersion('0.10'): - api_version = '0.10' - else: - api_version = '0.11' local_ns = yt.mods.__dict__.copy() local_ns['ds'] = args.ds local_ns['pf'] = args.ds local_ns['yt'] = yt - if api_version == '0.10': - shell = IPython.Shell.IPShellEmbed() - shell(local_ns = local_ns, - header = - "\nHi there! Welcome to yt.\n\nWe've loaded your dataset as 'ds'. Enjoy!" - ) - else: - try: - from traitlets.config.loader import Config - except ImportError: - from IPython.config.loader import Config - import sys - cfg = Config() - # prepend sys.path with current working directory - sys.path.insert(0,'') - IPython.embed(config=cfg,user_ns=local_ns) + try: + from traitlets.config.loader import Config + except ImportError: + from IPython.config.loader import Config + import sys + cfg = Config() + # prepend sys.path with current working directory + sys.path.insert(0,'') + IPython.embed(config=cfg,user_ns=local_ns) class YTMapserverCmd(YTCommand): args = ("proj", "field", "weight", @@ -810,46 +819,70 @@ import yt.utilities.lodgeit as lo lo.main( None, download=args.number ) +class YTHubStartNotebook(YTCommand): + args = ( + dict(dest="folderId", default=ytcfg.get("yt", "hub_sandbox"), + nargs="?", + help="(Optional) Hub folder to mount inside the Notebook"), + ) + description = \ + """ + Start the Jupyter Notebook on the yt Hub. + """ + subparser = "hub" + name = "start" + def __call__(self, args): + gc = _get_girder_client() + + # TODO: should happen server-side + _id = gc._checkResourcePath(args.folderId) + + resp = gc.post("/notebook/{}".format(_id)) + try: + print("Launched! Please visit this URL:") + print(" https://tmpnb.hub.yt" + resp['url']) + print() + except (KeyError, TypeError): + print("Something went wrong. The yt Hub responded with : ") + print(resp) + class YTNotebookUploadCmd(YTCommand): args = (dict(short="file", type=str),) description = \ """ - Upload an IPython notebook to hub.yt-project.org. + Upload an IPython Notebook to the yt Hub. """ name = "upload_notebook" def __call__(self, args): - filename = args.file - if not os.path.isfile(filename): - raise IOError(filename) - if not filename.endswith(".ipynb"): - print("File must be an IPython notebook!") - return 1 - import json - try: - t = json.loads(open(filename).read())['metadata']['name'] - except (ValueError, KeyError): - print("File does not appear to be an IPython notebook.") - if len(t) == 0: - t = filename.strip(".ipynb") - from yt.utilities.minimal_representation import MinimalNotebook - mn = MinimalNotebook(filename, t) - rv = mn.upload() + gc = _get_girder_client() + username = gc.get("/user/me")["login"] + gc.upload(args.file, "/user/{}/Public".format(username)) + + _id = gc.resourceLookup( + "/user/{}/Public/{}".format(username, args.file))["_id"] + _fid = next(gc.listFile(_id))["_id"] + hub_url = urlparse(ytcfg.get("yt", "hub_url")) print("Upload successful!") print() print("To access your raw notebook go here:") print() - print(" %s" % (rv['url'])) + print(" {}://{}/#item/{}".format(hub_url.scheme, hub_url.netloc, _id)) print() print("To view your notebook go here:") print() - print(" %s" % (rv['url'].replace("/go/", "/nb/"))) + print(" http://nbviewer.jupyter.org/urls/{}/file/{}/download".format( + hub_url.netloc + hub_url.path, _fid)) print() class YTPlotCmd(YTCommand): args = ("width", "unit", "bn", "proj", "center", "zlim", "axis", "field", "weight", "skip", "cmap", "output", "grids", "time", "ds", "max", - "log", "linear") + "log", "linear", + dict(short="-fu", longname="--field-unit", + action="store", type=str, + dest="field_unit", default=None, + help="Desired field units")) name = "plot" @@ -898,8 +931,10 @@ if args.grids: plt.annotate_grids() if args.time: - time = ds.current_time.in_units("yr") - plt.annotate_text((0.2,0.8), 't = %5.2e yr'%time) + plt.annotate_timestamp() + + if args.field_unit: + plt.set_unit(args.field, args.field_unit) plt.set_cmap(args.field, args.cmap) plt.set_log(args.field, args.takelog) @@ -947,7 +982,7 @@ ) description = \ """ - Run the IPython Notebook + Start the Jupyter Notebook locally. """ def __call__(self, args): kwargs = {} @@ -965,7 +1000,7 @@ pw = IPython.lib.passwd() print("If you would like to use this password in the future,") print("place a line like this inside the [yt] section in your") - print("yt configuration file at ~/.yt/config") + print("yt configuration file at ~/.config/yt/ytrc") print() print("notebook_password = %s" % pw) print() @@ -1057,11 +1092,7 @@ if vstring is not None: print() print("This installation CAN be automatically updated.") - update_hg(path, skip_rebuild=opts.reinstall) - print("Updated successfully.") - _get_yt_stack_date() - if opts.reinstall: - _update_yt_stack(path) + update_hg_or_git(path) else: _print_failed_source_update(opts.reinstall) @@ -1141,6 +1172,84 @@ print() pprint.pprint(rv) + +class YTUploadFileCmd(YTCommand): + args = (dict(short="file", type=str),) + description = \ + """ + Upload a file to yt's curldrop. + + """ + name = "upload" + + def __call__(self, args): + try: + import requests + except ImportError: + raise YTCommandRequiresModule('requests') + + fs = iter(FileStreamer(open(args.file, 'rb'))) + upload_url = ytcfg.get("yt", "curldrop_upload_url") + r = requests.put(upload_url + "/" + os.path.basename(args.file), + data=fs) + print() + print(r.text) + + +class YTConfigGetCmd(YTCommand): + subparser = 'config' + name = 'get' + description = 'get a config value' + args = (dict(short='section', help='The section containing the option.'), + dict(short='option', help='The option to retrieve.')) + def __call__(self, args): + from yt.utilities.configure import get_config + print(get_config(args.section, args.option)) + + +class YTConfigSetCmd(YTCommand): + subparser = 'config' + name = 'set' + description = 'set a config value' + args = (dict(short='section', help='The section containing the option.'), + dict(short='option', help='The option to set.'), + dict(short='value', help='The value to set the option to.')) + def __call__(self, args): + from yt.utilities.configure import set_config + set_config(args.section, args.option, args.value) + + +class YTConfigRemoveCmd(YTCommand): + subparser = 'config' + name = 'rm' + description = 'remove a config option' + args = (dict(short='section', help='The section containing the option.'), + dict(short='option', help='The option to remove.')) + def __call__(self, args): + from yt.utilities.configure import rm_config + rm_config(args.section, args.option) + + +class YTConfigListCmd(YTCommand): + subparser = 'config' + name = 'list' + description = 'show the config content' + args = () + def __call__(self, args): + from yt.utilities.configure import write_config + write_config(sys.stdout) + + +class YTConfigMigrateCmd(YTCommand): + subparser = 'config' + name = 'migrate' + description = 'migrate old config file' + args = () + def __call__(self, args): + from yt.utilities.configure import migrate_config + migrate_config() + + class YTSearchCmd(YTCommand): args = (dict(short="-o", longname="--output", action="store", type=str, @@ -1190,6 +1299,76 @@ print("Identified %s records output to %s" % ( len(records), args.output)) +class YTDownloadData(YTCommand): + + args = ( + dict(short="filename", action="store", type=str, + help="The name of the file to download", nargs='?', + default=''), + dict(short="location", action="store", type=str, nargs='?', + help="The location in which to place the file, can be " + "\"supp_data_dir\", \"test_data_dir\", or any valid " + "path on disk. ", default=''), + dict(longname="--overwrite", short="-c", + help="Overwrite existing file.", + action="store_true", default=False), + dict(longname="--list", short="-l", + help="Display all available files.", + action="store_true", default=False), + ) + description = \ + """ + Download a file from http://yt-project.org/data and save it to a + particular location. Files can be saved to the locations provided + by the "test_data_dir" or "supp_data_dir" configuration entries, or + any valid path to a location on disk. + """ + name = "download" + + def __call__(self, args): + if args.list: + self.get_list() + return + if not args.filename: + raise RuntimeError('You need to provide a filename. See --help ' + 'for details or use --list to get available ' + 'datasets.') + elif not args.location: + raise RuntimeError('You need to specify download location. See ' + '--help for details.') + data_url = "http://yt-project.org/data/%s" % args.filename + if args.location in ["test_data_dir", "supp_data_dir"]: + data_dir = ytcfg.get("yt", args.location) + if data_dir == "/does/not/exist": + raise RuntimeError("'%s' is not configured!" % args.location) + else: + data_dir = args.location + if not os.path.exists(data_dir): + print("The directory '%s' does not exist. Creating..." % data_dir) + ensure_dir(data_dir) + data_file = os.path.join(data_dir, args.filename) + if os.path.exists(data_file) and not args.overwrite: + raise IOError("File '%s' exists and overwrite=False!" % data_file) + print("Attempting to download file: %s" % args.filename) + fn = download_file(data_url, data_file) + + if not os.path.exists(fn): + raise IOError("The file '%s' did not download!!" % args.filename) + print("File: %s downloaded successfully to %s" % + (args.filename, data_file)) + + def get_list(self): + data = urllib.request.urlopen( + 'http://yt-project.org/data/datafiles.json').read().decode('utf8') + data = json.loads(data) + for key in data: + for ds in data[key]: + ds['fullname'] = ds['url'].replace( + 'http://yt-project.org/data/', '') + print('{fullname} ({size}) type: {code}'.format(**ds)) + for line in textwrap.wrap(ds['description']): + print('\t', line) + def run_main(): args = parser.parse_args() # The following is a workaround for a nasty Python 3 bug: @@ -1200,7 +1379,7 @@ except AttributeError: parser.print_help() sys.exit(0) - + args.func(args) if __name__ == "__main__": run_main() diff -Nru yt-3.3.3/yt/utilities/configure.py yt-3.4.0/yt/utilities/configure.py --- yt-3.3.3/yt/utilities/configure.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/configure.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,104 @@ +# -*- coding: UTF-8 -*- +#----------------------------------------------------------------------------- +# Copyright (c) 2016, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import os +import shutil +import sys +import argparse +from yt.config import CURRENT_CONFIG_FILE, _OLD_CONFIG_FILE, YTConfigParser + +CONFIG = YTConfigParser() +CONFIG.read([CURRENT_CONFIG_FILE]) + + +def get_config(section, option): + return CONFIG.get(section, option) + + +def set_config(section, option, value): + if not CONFIG.has_section(section): + CONFIG.add_section(section) + CONFIG.set(section, option, value) + write_config() + + +def write_config(fd=None): + if fd is None: + with open(CURRENT_CONFIG_FILE, 'w') as fd: + CONFIG.write(fd) + else: + CONFIG.write(fd) + +def migrate_config(): + if not os.path.exists(_OLD_CONFIG_FILE): + print('Old config not found.') + sys.exit() + CONFIG.read(_OLD_CONFIG_FILE) + print('Writing a new config file to: {}'.format(CURRENT_CONFIG_FILE)) + write_config() + print('Backing up the old config file: {}.bak'.format(_OLD_CONFIG_FILE)) + os.rename(_OLD_CONFIG_FILE, _OLD_CONFIG_FILE + '.bak') + + old_config_dir = os.path.dirname(_OLD_CONFIG_FILE) + plugin_file = CONFIG.get('yt', 'pluginfilename') + if plugin_file and \ + os.path.exists(os.path.join(old_config_dir, plugin_file)): + print('Migrating plugin file {} to new location'.format(plugin_file)) + shutil.copyfile( + os.path.join(old_config_dir, plugin_file), + os.path.join(os.path.dirname(CURRENT_CONFIG_FILE), plugin_file)) + print('Backing up the old plugin file: {}.bak'.format(_OLD_CONFIG_FILE)) + plugin_file = os.path.join(old_config_dir, plugin_file) + os.rename(plugin_file, plugin_file + '.bak') + + +def rm_config(section, option): + CONFIG.remove_option(section, option) + write_config() + + +def main(): + parser = argparse.ArgumentParser( + description='Get and set configuration values for yt') + subparsers = parser.add_subparsers(help='sub-command help', dest='cmd') + + get_parser = subparsers.add_parser('get', help='get a config value') + set_parser = subparsers.add_parser('set', help='set a config value') + rm_parser = subparsers.add_parser('rm', help='remove a config option') + subparsers.add_parser('migrate', help='migrate old config file') + subparsers.add_parser('list', help='show all config values') + + get_parser.add_argument( + 'section', help='The section containing the option.') + get_parser.add_argument('option', help='The option to retrieve.') + + set_parser.add_argument( + 'section', help='The section containing the option.') + set_parser.add_argument('option', help='The option to set.') + set_parser.add_argument('value', help='The value to set the option to.') + + rm_parser.add_argument( + 'section', help='The section containing the option to remove.') + rm_parser.add_argument('option', help='The option to remove.') + + args = parser.parse_args() + + if args.cmd == 'get': + print(get_config(args.section, args.option)) + elif args.cmd == 'set': + set_config(args.section, args.option, args.value) + elif args.cmd == 'list': + write_config(sys.stdout) + elif args.cmd == 'migrate': + migrate_config() + elif args.cmd == 'rm': + rm_config(args.section, args.option) + +if __name__ == '__main__': + main() # pragma: no cover diff -Nru yt-3.3.3/yt/utilities/cosmology.py yt-3.4.0/yt/utilities/cosmology.py --- yt-3.3.3/yt/utilities/cosmology.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/cosmology.py 2017-08-10 18:02:57.000000000 +0000 @@ -58,6 +58,17 @@ unit_system : :class:`yt.units.unit_systems.UnitSystem`, optional The units system to use when making calculations. If not specified, cgs units are assumed. + use_dark_factor: Bool, optional + The flag to either use the cosmological constant (False, default) + or to use the parameterization of w(a) as given in Linder 2002. This, + along with w_0 and w_a, only matters in the function expansion_factor. + w_0 : float, optional + The Linder 2002 parameterization of w(a) is: w(a) = w_0 + w_a(1 - a). + w_0 is w(a = 1). Only matters if use_dark_factor = True. Default is None. + Cosmological constant case corresponds to w_0 = -1. + w_a : float, optional + See w_0. w_a is the derivative of w(a) evaluated at a = 1. Cosmological + constant case corresponds to w_a = 0. Default is None. Examples -------- @@ -72,7 +83,10 @@ omega_lambda = 0.73, omega_curvature = 0.0, unit_registry = None, - unit_system = "cgs"): + unit_system = "cgs", + use_dark_factor = False, + w_0 = -1.0, + w_a = 0.0): self.omega_matter = float(omega_matter) self.omega_lambda = float(omega_lambda) self.omega_curvature = float(omega_curvature) @@ -87,6 +101,12 @@ self.unit_registry = unit_registry self.hubble_constant = self.quan(hubble_constant, "100*km/s/Mpc") self.unit_system = unit_system + + # For non-standard dark energy. If false, use default cosmological constant + # This only affects the expansion_factor function. + self.use_dark_factor = use_dark_factor + self.w_0 = w_0 + self.w_a = w_a def hubble_distance(self): r""" @@ -382,9 +402,18 @@ cosmological distances. """ + + # Use non-standard dark energy + if self.use_dark_factor: + dark_factor = self.get_dark_factor(z) + + # Use default cosmological constant + else: + dark_factor = 1.0 + return np.sqrt(self.omega_matter * ((1 + z)**3.0) + self.omega_curvature * ((1 + z)**2.0) + - self.omega_lambda) + (self.omega_lambda * dark_factor)) def inverse_expansion_factor(self, z): return 1 / self.expansion_factor(z) @@ -548,6 +577,31 @@ return my_time.in_base(self.unit_system) + def get_dark_factor(self, z): + """ + This function computes the additional term that enters the expansion factor + when using non-standard dark energy. See Dolag et al 2004 eq. 7 for ref (but + note that there's a typo in his eq. There should be no negative sign). + + At the moment, this only works using the parameterization given in Linder 2002 + eq. 7: w(a) = w0 + wa(1 - a) = w0 + wa * z / (1+z). This gives rise to an analytic + expression. It is also only functional for Gadget simulations, at the moment. + + Parameters + ---------- + z: float + Redshift + """ + + # Get value of scale factor a corresponding to redshift z + scale_factor = 1.0 / (1.0 + z) + + # Evaluate exponential using Linder02 parameterization + dark_factor = np.power(scale_factor, -3.0 * (1.0 + self.w_0 + self.w_a)) * \ + np.exp(-3.0 * self.w_a * (1.0 - scale_factor)) + + return dark_factor + _arr = None @property def arr(self): diff -Nru yt-3.3.3/yt/utilities/exceptions.py yt-3.4.0/yt/utilities/exceptions.py --- yt-3.3.3/yt/utilities/exceptions.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/exceptions.py 2017-08-10 18:02:57.000000000 +0000 @@ -321,7 +321,7 @@ self.config_name = config_name def __str__(self): - return "You need to set an API key for %s in ~/.yt/config as %s" % ( + return "You need to set an API key for %s in ~/.config/yt/ytrc as %s" % ( self.service, self.config_name) class YTTooManyVertices(YTException): @@ -392,6 +392,17 @@ return "Filter '%s' ill-defined. Applied to shape %s but is shape %s." % ( self.filter, self.s1, self.s2) +class YTIllDefinedParticleFilter(YTException): + def __init__(self, filter, missing): + self.filter = filter + self.missing = missing + + def __str__(self): + msg = ("\nThe fields\n\t{},\nrequired by the \"{}\" particle filter, " + "are not defined for this dataset.") + f = self.filter + return msg.format("\n".join([str(m) for m in self.missing]), f.name) + class YTIllDefinedBounds(YTException): def __init__(self, lb, ub): self.lb = lb @@ -633,3 +644,82 @@ weight_msg = "" return msg + weight_msg + +class YTBooleanObjectError(YTException): + def __init__(self, bad_object): + self.bad_object = bad_object + + def __str__(self): + v = "Supplied:\n%s\nto a boolean operation" % (self.bad_object) + v += " but it is not a YTSelectionContainer3D object." + return v + +class YTBooleanObjectsWrongDataset(YTException): + def __init__(self): + pass + + def __str__(self): + return "Boolean data objects must share a common dataset object." + +class YTIllDefinedAMR(YTException): + def __init__(self, level, axis): + self.level = level + self.axis = axis + + def __str__(self): + msg = ( + "Grids on the level {} are not properly aligned with cell edges " + "on the parent level ({} axis)" + ).format(self.level, self.axis) + return msg + +class YTInconsistentGridFieldShape(YTException): + def __init__(self, shapes): + self.shapes = shapes + + def __str__(self): + msg = "Not all grid-based fields have the same shape!\n" + for name, shape in self.shapes: + msg += " Field {} has shape {}.\n".format(name, shape) + return msg + +class YTInconsistentParticleFieldShape(YTException): + def __init__(self, ptype, shapes): + self.ptype = ptype + self.shapes = shapes + + def __str__(self): + msg = ( + "Not all fields with field type '{}' have the same shape!\n" + ).format(self.ptype) + for name, shape in self.shapes: + field = (self.ptype, name) + msg += " Field {} has shape {}.\n".format(field, shape) + return msg + +class YTInconsistentGridFieldShapeGridDims(YTException): + def __init__(self, shapes, grid_dims): + self.shapes = shapes + self.grid_dims = grid_dims + + def __str__(self): + msg = "Not all grid-based fields match the grid dimensions! " + msg += "Grid dims are {}, ".format(self.grid_dims) + msg += "and the following fields have shapes that do not match them:\n" + for name, shape in self.shapes: + if shape != self.grid_dims: + msg += " Field {} has shape {}.\n".format(name, shape) + return msg + +class YTCommandRequiresModule(YTException): + def __init__(self, module): + self.module = module + + def __str__(self): + msg = "This command requires \"%s\" to be installed.\n\n" % self.module + msg += "Please install \"%s\" with the package manager " % self.module + msg += "appropriate for your python environment, e.g.:\n" + msg += " conda install %s\n" % self.module + msg += "or:\n" + msg += " pip install %s\n" % self.module + return msg diff -Nru yt-3.3.3/yt/utilities/exodusII_reader.py yt-3.4.0/yt/utilities/exodusII_reader.py --- yt-3.3.3/yt/utilities/exodusII_reader.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/exodusII_reader.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -import string -from itertools import takewhile -from netCDF4 import Dataset -import numpy as np -from yt.config import ytcfg -import os - - -def sanitize_string(s): - s = "".join(_ for _ in takewhile(lambda a: a in string.printable, s)) - return s - - -def get_data(fn): - try: - f = Dataset(fn) - except RuntimeError: - f = Dataset(os.path.join(ytcfg.get("yt", "test_data_dir"), fn)) - fvars = f.variables - # Is this correct? - etypes = fvars["eb_status"][:] - nelem = etypes.shape[0] - varnames = [sanitize_string(v.tostring()) for v in - fvars["name_elem_var"][:]] - nodnames = [sanitize_string(v.tostring()) for v in - fvars["name_nod_var"][:]] - coord = np.array([fvars["coord%s" % ax][:] - for ax in 'xyz']).transpose().copy() - coords = [] - connects = [] - data = [] - for i in range(nelem): - connects.append(fvars["connect%s" % (i+1)][:].astype("i8")) - ci = connects[-1] - coords.append(coord) # Same for all - vals = {} - for j, v in enumerate(varnames): - values = fvars["vals_elem_var%seb%s" % (j+1, i+1)][:] - vals['gas', v] = values.astype("f8")[-1, :] - for j, v in enumerate(nodnames): - # We want just for this set of nodes all the node variables - # Use (ci - 1) to get these values - values = fvars["vals_nod_var%s" % (j+1)][:] - vals['gas', v] = values.astype("f8")[-1, ci - 1, ...] - data.append(vals) - return coords, connects, data diff -Nru yt-3.3.3/yt/utilities/file_handler.py yt-3.4.0/yt/utilities/file_handler.py --- yt-3.3.3/yt/utilities/file_handler.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/file_handler.py 2017-08-10 18:02:57.000000000 +0000 @@ -14,6 +14,26 @@ #----------------------------------------------------------------------------- from yt.utilities.on_demand_imports import _h5py as h5py +from yt.utilities.on_demand_imports import NotAModule +from contextlib import contextmanager + + +def valid_hdf5_signature(fn): + signature = b'\x89HDF\r\n\x1a\n' + try: + with open(fn, 'rb') as f: + header = f.read(8) + return header == signature + except: + return False + + +def warn_h5py(fn): + needs_h5py = valid_hdf5_signature(fn) + if needs_h5py and isinstance(h5py.File, NotAModule): + raise RuntimeError("This appears to be an HDF5 file, " + "but h5py is not installed.") + class HDF5FileHandler(object): handle = None @@ -44,6 +64,7 @@ if self.handle is not None: self.handle.close() + class FITSFileHandler(HDF5FileHandler): def __init__(self, filename): from yt.utilities.on_demand_imports import _astropy @@ -67,8 +88,38 @@ def close(self): self.handle.close() + +def valid_netcdf_classic_signature(filename): + signature_v1 = b'CDF\x01' + signature_v2 = b'CDF\x02' + try: + with open(filename, 'rb') as f: + header = f.read(4) + return (header == signature_v1 or header == signature_v2) + except: + return False + + +def warn_netcdf(fn): + # There are a few variants of the netCDF format. + classic = valid_netcdf_classic_signature(fn) + # NetCDF-4 Classic files are HDF5 files constrained to the Classic + # data model used by netCDF-3. + netcdf4_classic = valid_hdf5_signature(fn) and fn.endswith(('.nc', '.nc4')) + needs_netcdf = classic or netcdf4_classic + from yt.utilities.on_demand_imports import _netCDF4 as netCDF4 + if needs_netcdf and isinstance(netCDF4.Dataset, NotAModule): + raise RuntimeError("This appears to be a netCDF file, but the " + "python bindings for netCDF4 are not installed.") + + class NetCDF4FileHandler(object): def __init__(self, filename): - from netCDF4 import Dataset - ds = Dataset(filename) - self.dataset = ds + self.filename = filename + + @contextmanager + def open_ds(self): + from yt.utilities.on_demand_imports import _netCDF4 as netCDF4 + ds = netCDF4.Dataset(self.filename) + yield ds + ds.close() diff -Nru yt-3.3.3/yt/utilities/fits_image.py yt-3.4.0/yt/utilities/fits_image.py --- yt-3.3.3/yt/utilities/fits_image.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/fits_image.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,774 +1,9 @@ -""" -FITSImageData Class -""" +from yt.funcs import issue_deprecation_warning -#----------------------------------------------------------------------------- -# Copyright (c) 2013, yt Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- -from yt.extern.six import string_types -import numpy as np -from yt.funcs import mylog, iterable, fix_axis, ensure_list -from yt.visualization.fixed_resolution import FixedResolutionBuffer -from yt.data_objects.construction_data_containers import YTCoveringGrid -from yt.utilities.on_demand_imports import _astropy -from yt.units.yt_array import YTQuantity, YTArray -from yt.units import dimensions -from yt.utilities.parallel_tools.parallel_analysis_interface import \ - parallel_root_only -from yt.visualization.volume_rendering.off_axis_projection import off_axis_projection -import re - -class FITSImageData(object): - - def __init__(self, data, fields=None, units=None, width=None, wcs=None): - r""" Initialize a FITSImageData object. - - FITSImageData contains a collection of FITS ImageHDU instances and - WCS information, along with units for each of the images. FITSImageData - instances can be constructed from ImageArrays, NumPy arrays, dicts - of such arrays, FixedResolutionBuffers, and YTCoveringGrids. The latter - two are the most powerful because WCS information can be constructed - automatically from their coordinates. - - Parameters - ---------- - data : FixedResolutionBuffer or a YTCoveringGrid. Or, an - ImageArray, an numpy.ndarray, or dict of such arrays - The data to be made into a FITS image or images. - fields : single string or list of strings, optional - The field names for the data. If *fields* is none and *data* has - keys, it will use these for the fields. If *data* is just a - single array one field name must be specified. - units : string - The units of the WCS coordinates. Defaults to "cm". - width : float or YTQuantity - The width of the image. Either a single value or iterable of values. - If a float, assumed to be in *units*. Only used if this information - is not already provided by *data*. - wcs : `astropy.wcs.WCS` instance, optional - Supply an AstroPy WCS instance. Will override automatic WCS - creation from FixedResolutionBuffers and YTCoveringGrids. - - Examples - -------- - - >>> # This example uses a FRB. - >>> ds = load("sloshing_nomag2_hdf5_plt_cnt_0150") - >>> prj = ds.proj(2, "kT", weight_field="density") - >>> frb = prj.to_frb((0.5, "Mpc"), 800) - >>> # This example just uses the FRB and puts the coords in kpc. - >>> f_kpc = FITSImageData(frb, fields="kT", units="kpc") - >>> # This example specifies a specific WCS. - >>> from astropy.wcs import WCS - >>> w = WCS(naxis=self.dimensionality) - >>> w.wcs.crval = [30., 45.] # RA, Dec in degrees - >>> w.wcs.cunit = ["deg"]*2 - >>> nx, ny = 800, 800 - >>> w.wcs.crpix = [0.5*(nx+1), 0.5*(ny+1)] - >>> w.wcs.ctype = ["RA---TAN","DEC--TAN"] - >>> scale = 1./3600. # One arcsec per pixel - >>> w.wcs.cdelt = [-scale, scale] - >>> f_deg = FITSImageData(frb, fields="kT", wcs=w) - >>> f_deg.writeto("temp.fits") - """ - - if units is None: - units = "cm" - if width is None: - width = 1.0 - - exclude_fields = ['x','y','z','px','py','pz', - 'pdx','pdy','pdz','weight_field'] - - self.hdulist = _astropy.pyfits.HDUList() - - if isinstance(fields, string_types): - fields = [fields] - - if hasattr(data, 'keys'): - img_data = data - if fields is None: - fields = list(img_data.keys()) - elif isinstance(data, np.ndarray): - if fields is None: - mylog.warning("No field name given for this array. Calling it 'image_data'.") - fn = 'image_data' - fields = [fn] - else: - fn = fields[0] - img_data = {fn: data} - - self.fields = [] - for fd in fields: - if isinstance(fd, tuple): - self.fields.append(fd[1]) - else: - self.fields.append(fd) - - first = True - self.field_units = {} - for key in fields: - if key not in exclude_fields: - if hasattr(img_data[key], "units"): - self.field_units[key] = img_data[key].units - else: - self.field_units[key] = "dimensionless" - mylog.info("Making a FITS image of field %s" % key) - if first: - hdu = _astropy.pyfits.PrimaryHDU(np.array(img_data[key])) - first = False - else: - hdu = _astropy.pyfits.ImageHDU(np.array(img_data[key])) - hdu.name = key - hdu.header["btype"] = key - if hasattr(img_data[key], "units"): - hdu.header["bunit"] = re.sub('()', '', str(img_data[key].units)) - self.hdulist.append(hdu) - - self.shape = self.hdulist[0].shape - self.dimensionality = len(self.shape) - - if wcs is None: - w = _astropy.pywcs.WCS(header=self.hdulist[0].header, naxis=self.dimensionality) - if isinstance(img_data, FixedResolutionBuffer): - # FRBs are a special case where we have coordinate - # information, so we take advantage of this and - # construct the WCS object - dx = (img_data.bounds[1]-img_data.bounds[0]).in_units(units).v/self.shape[0] - dy = (img_data.bounds[3]-img_data.bounds[2]).in_units(units).v/self.shape[1] - xctr = 0.5*(img_data.bounds[1]+img_data.bounds[0]).in_units(units).v - yctr = 0.5*(img_data.bounds[3]+img_data.bounds[2]).in_units(units).v - center = [xctr, yctr] - cdelt = [dx,dy] - elif isinstance(img_data, YTCoveringGrid): - cdelt = img_data.dds.in_units(units).v - center = 0.5*(img_data.left_edge+img_data.right_edge).in_units(units).v - else: - # If img_data is just an array, we assume the center is the origin - # and use the image width to determine the cell widths - if not iterable(width): - width = [width]*self.dimensionality - if isinstance(width[0], YTQuantity): - cdelt = [wh.in_units(units).v/n for wh, n in zip(width, self.shape)] - else: - cdelt = [float(wh)/n for wh, n in zip(width, self.shape)] - center = [0.0]*self.dimensionality - w.wcs.crpix = 0.5*(np.array(self.shape)+1) - w.wcs.crval = center - w.wcs.cdelt = cdelt - w.wcs.ctype = ["linear"]*self.dimensionality - w.wcs.cunit = [units]*self.dimensionality - self.set_wcs(w) - else: - self.set_wcs(wcs) - - def set_wcs(self, wcs): - """ - Set the WCS coordinate information for all images - with a WCS object *wcs*. - """ - self.wcs = wcs - h = self.wcs.to_header() - for img in self.hdulist: - for k, v in h.items(): - img.header[k] = v - - def update_header(self, field, key, value): - """ - Update the FITS header for *field* with a - *key*, *value* pair. If *field* == "all", all - headers will be updated. - """ - if field == "all": - for img in self.hdulist: - img.header[key] = value - else: - if field not in self.keys(): - raise KeyError("%s not an image!" % field) - idx = self.fields.index(field) - self.hdulist[idx].header[key] = value - - def update_all_headers(self, key, value): - mylog.warning("update_all_headers is deprecated. "+ - "Use update_header('all', key, value) instead.") - self.update_header("all", key, value) - - def keys(self): - return self.fields - - def has_key(self, key): - return key in self.fields - - def values(self): - return [self.hdulist[k] for k in self.fields] - - def items(self): - return [(k, self.hdulist[k]) for k in self.fields] - - def __getitem__(self, item): - return self.hdulist[item] - - def info(self): - return self.hdulist.info() - - @parallel_root_only - def writeto(self, fileobj, fields=None, clobber=False, **kwargs): - r""" - Write all of the fields or a subset of them to a FITS file. - - Parameters - ---------- - fileobj : string - The name of the file to write to. - fields : list of strings, optional - The fields to write to the file. If not specified - all of the fields in the buffer will be written. - clobber : boolean, optional - Whether or not to overwrite a previously existing file. - Default: False - All other keyword arguments are passed to the `writeto` - method of `astropy.io.fits.HDUList`. - """ - if fields is None: - hdus = self.hdulist - else: - hdus = _astropy.pyfits.HDUList() - for field in fields: - hdus.append(self.hdulist[field]) - hdus.writeto(fileobj, clobber=clobber, **kwargs) - - def to_glue(self, label="yt", data_collection=None): - """ - Takes the data in the FITSImageData instance and exports it to - Glue (http://www.glueviz.org) for interactive analysis. Optionally - add a *label*. If you are already within the Glue environment, you - can pass a *data_collection* object, otherwise Glue will be started. - """ - from glue.core import DataCollection, Data - from glue.core.coordinates import coordinates_from_header - from glue.qt.glue_application import GlueApplication - - image = Data(label=label) - image.coords = coordinates_from_header(self.wcs.to_header()) - for k,f in self.hdulist.items(): - image.add_component(f.data, k) - if data_collection is None: - dc = DataCollection([image]) - app = GlueApplication(dc) - app.start() - else: - data_collection.append(image) - - def to_aplpy(self, **kwargs): - """ - Use APLpy (http://aplpy.github.io) for plotting. Returns an - `aplpy.FITSFigure` instance. All keyword arguments are passed to the - `aplpy.FITSFigure` constructor. - """ - import aplpy - return aplpy.FITSFigure(self.hdulist, **kwargs) - - def get_data(self, field): - """ - Return the data array of the image corresponding to *field* - with units attached. - """ - return YTArray(self.hdulist[field].data, self.field_units[field]) - - def set_unit(self, field, units): - """ - Set the units of *field* to *units*. - """ - if field not in self.keys(): - raise KeyError("%s not an image!" % field) - idx = self.fields.index(field) - new_data = YTArray(self.hdulist[idx].data, self.field_units[field]).in_units(units) - self.hdulist[idx].data = new_data.v - self.hdulist[idx].header["bunit"] = units - self.field_units[field] = units - - def pop(self, key): - """ - Remove a field with name *key* - and return it as a new FITSImageData - instance. - """ - if key not in self.keys(): - raise KeyError("%s not an image!" % key) - idx = self.fields.index(key) - im = self.hdulist.pop(idx) - data = YTArray(im.data, self.field_units[key]) - self.field_units.pop(key) - self.fields.remove(key) - return FITSImageData(data, fields=key, wcs=self.wcs) - - @classmethod - def from_file(cls, filename): - """ - Generate a FITSImageData instance from one previously written to - disk. - - Parameters - ---------- - filename : string - The name of the file to open. - """ - f = _astropy.pyfits.open(filename) - data = {} - for hdu in f: - data[hdu.header["btype"]] = YTArray(hdu.data, hdu.header["bunit"]) - f.close() - return cls(data, wcs=_astropy.pywcs.WCS(header=hdu.header)) - - @classmethod - def from_images(cls, image_list): - """ - Generate a new FITSImageData instance from a list of FITSImageData - instances. - - Parameters - ---------- - image_list : list of FITSImageData instances - The images to be combined. - """ - w = image_list[0].wcs - img_shape = image_list[0].shape - data = {} - for image in image_list: - assert_same_wcs(w, image.wcs) - if img_shape != image.shape: - raise RuntimeError("Images do not have the same shape!") - for key in image.keys(): - data[key] = image.get_data(key) - return cls(data, wcs=w) - - def create_sky_wcs(self, sky_center, sky_scale, - ctype=["RA---TAN","DEC--TAN"], - crota=None, cd=None, pc=None): - """ - Takes a Cartesian WCS and converts it to one in a - celestial coordinate system. - - Parameters - ---------- - sky_center : iterable of floats - Reference coordinates of the WCS in degrees. - sky_scale : tuple or YTQuantity - Conversion between an angle unit and a length unit, - e.g. (3.0, "arcsec/kpc") - ctype : list of strings, optional - The type of the coordinate system to create. - crota : 2-element ndarray, optional - Rotation angles between cartesian coordinates and - the celestial coordinates. - cd : 2x2-element ndarray, optional - Dimensioned coordinate transformation matrix. - pc : 2x2-element ndarray, optional - Coordinate transformation matrix. - """ - old_wcs = self.wcs - naxis = old_wcs.naxis - crval = [sky_center[0], sky_center[1]] - if isinstance(sky_scale, YTQuantity): - scaleq = sky_scale - else: - scaleq = YTQuantity(sky_scale[0],sky_scale[1]) - if scaleq.units.dimensions != dimensions.angle/dimensions.length: - raise RuntimeError("sky_scale %s not in correct dimensions of angle/length!" % sky_scale) - deltas = old_wcs.wcs.cdelt - units = [str(unit) for unit in old_wcs.wcs.cunit] - new_dx = (YTQuantity(-deltas[0], units[0])*scaleq).in_units("deg") - new_dy = (YTQuantity(deltas[1], units[1])*scaleq).in_units("deg") - new_wcs = _astropy.pywcs.WCS(naxis=naxis) - cdelt = [new_dx.v, new_dy.v] - cunit = ["deg"]*2 - if naxis == 3: - crval.append(old_wcs.wcs.crval[2]) - cdelt.append(old_wcs.wcs.cdelt[2]) - ctype.append(old_wcs.wcs.ctype[2]) - cunit.append(old_wcs.wcs.cunit[2]) - new_wcs.wcs.crpix = old_wcs.wcs.crpix - new_wcs.wcs.cdelt = cdelt - new_wcs.wcs.crval = crval - new_wcs.wcs.cunit = cunit - new_wcs.wcs.ctype = ctype - if crota is not None: - new_wcs.wcs.crota = crota - if cd is not None: - new_wcs.wcs.cd = cd - if pc is not None: - new_wcs.wcs.cd = pc - self.set_wcs(new_wcs) - -class FITSImageBuffer(FITSImageData): - pass - -def sanitize_fits_unit(unit): - if unit == "Mpc": - mylog.info("Changing FITS file unit to kpc.") - unit = "kpc" - elif unit == "au": - unit = "AU" - return unit - -axis_wcs = [[1,2],[0,2],[0,1]] - -def construct_image(ds, axis, data_source, center, width=None, image_res=None): - if width is None: - width = ds.domain_width[axis_wcs[axis]] - unit = ds.get_smallest_appropriate_unit(width[0]) - mylog.info("Making an image of the entire domain, "+ - "so setting the center to the domain center.") - else: - width = ds.coordinates.sanitize_width(axis, width, None) - unit = str(width[0].units) - if image_res is None: - ddims = ds.domain_dimensions*ds.refine_by**ds.index.max_level - if iterable(axis): - nx = ddims.max() - ny = ddims.max() - else: - nx, ny = [ddims[idx] for idx in axis_wcs[axis]] - else: - if iterable(image_res): - nx, ny = image_res - else: - nx, ny = image_res, image_res - dx = width[0]/nx - crpix = [0.5*(nx+1), 0.5*(ny+1)] - if hasattr(ds, "wcs") and not iterable(axis): - # This is a FITS dataset, so we use it to construct the WCS - cunit = [str(ds.wcs.wcs.cunit[idx]) for idx in axis_wcs[axis]] - ctype = [ds.wcs.wcs.ctype[idx] for idx in axis_wcs[axis]] - cdelt = [ds.wcs.wcs.cdelt[idx] for idx in axis_wcs[axis]] - ctr_pix = center.in_units("code_length")[:ds.dimensionality].v - crval = ds.wcs.wcs_pix2world(ctr_pix.reshape(1, ds.dimensionality))[0] - crval = [crval[idx] for idx in axis_wcs[axis]] - else: - if unit == "unitary": - unit = ds.get_smallest_appropriate_unit(ds.domain_width.max()) - elif unit == "code_length": - unit = ds.get_smallest_appropriate_unit(ds.quan(1.0,"code_length")) - unit = sanitize_fits_unit(unit) - cunit = [unit]*2 - ctype = ["LINEAR"]*2 - cdelt = [dx.in_units(unit)]*2 - if iterable(axis): - crval = center.in_units(unit) - else: - crval = [center[idx].in_units(unit) for idx in axis_wcs[axis]] - if hasattr(data_source, 'to_frb'): - if iterable(axis): - frb = data_source.to_frb(width[0], (nx, ny), height=width[1]) - else: - frb = data_source.to_frb(width[0], (nx, ny), center=center, height=width[1]) - else: - frb = None - w = _astropy.pywcs.WCS(naxis=2) - w.wcs.crpix = crpix - w.wcs.cdelt = cdelt - w.wcs.crval = crval - w.wcs.cunit = cunit - w.wcs.ctype = ctype - return w, frb - -def assert_same_wcs(wcs1, wcs2): - from numpy.testing import assert_allclose - assert wcs1.naxis == wcs2.naxis - for i in range(wcs1.naxis): - assert wcs1.wcs.cunit[i] == wcs2.wcs.cunit[i] - assert wcs1.wcs.ctype[i] == wcs2.wcs.ctype[i] - assert_allclose(wcs1.wcs.crpix, wcs2.wcs.crpix) - assert_allclose(wcs1.wcs.cdelt, wcs2.wcs.cdelt) - assert_allclose(wcs1.wcs.crval, wcs2.wcs.crval) - crota1 = getattr(wcs1.wcs, "crota", None) - crota2 = getattr(wcs2.wcs, "crota", None) - if crota1 is None or crota2 is None: - assert crota1 == crota2 - else: - assert_allclose(wcs1.wcs.crota, wcs2.wcs.crota) - cd1 = getattr(wcs1.wcs, "cd", None) - cd2 = getattr(wcs2.wcs, "cd", None) - if cd1 is None or cd2 is None: - assert cd1 == cd2 - else: - assert_allclose(wcs1.wcs.cd, wcs2.wcs.cd) - pc1 = getattr(wcs1.wcs, "pc", None) - pc2 = getattr(wcs2.wcs, "pc", None) - if pc1 is None or pc2 is None: - assert pc1 == pc2 - else: - assert_allclose(wcs1.wcs.pc, wcs2.wcs.pc) - -class FITSSlice(FITSImageData): - r""" - Generate a FITSImageData of an on-axis slice. - - Parameters - ---------- - ds : :class:`yt.data_objects.api.Dataset` - The dataset object. - axis : character or integer - The axis of the slice. One of "x","y","z", or 0,1,2. - fields : string or list of strings - The fields to slice - center : A sequence of floats, a string, or a tuple. - The coordinate of the center of the image. If set to 'c', 'center' or - left blank, the plot is centered on the middle of the domain. If set to - 'max' or 'm', the center will be located at the maximum of the - ('gas', 'density') field. Centering on the max or min of a specific - field is supported by providing a tuple such as ("min","temperature") or - ("max","dark_matter_density"). Units can be specified by passing in *center* - as a tuple containing a coordinate and string unit name or by passing - in a YTArray. If a list or unitless array is supplied, code units are - assumed. - width : tuple or a float. - Width can have four different formats to support windows with variable - x and y widths. They are: - - ================================== ======================= - format example - ================================== ======================= - (float, string) (10,'kpc') - ((float, string), (float, string)) ((10,'kpc'),(15,'kpc')) - float 0.2 - (float, float) (0.2, 0.3) - ================================== ======================= - - For example, (10, 'kpc') requests a plot window that is 10 kiloparsecs - wide in the x and y directions, ((10,'kpc'),(15,'kpc')) requests a - window that is 10 kiloparsecs wide along the x axis and 15 - kiloparsecs wide along the y axis. In the other two examples, code - units are assumed, for example (0.2, 0.3) requests a plot that has an - x width of 0.2 and a y width of 0.3 in code units. If units are - provided the resulting plot axis labels will use the supplied units. - image_res : an int or 2-tuple of ints - Specify the resolution of the resulting image. If not provided, it will be - determined based on the minimum cell size of the dataset. - """ - def __init__(self, ds, axis, fields, center="c", width=None, image_res=None, **kwargs): - fields = ensure_list(fields) - axis = fix_axis(axis, ds) - center, dcenter = ds.coordinates.sanitize_center(center, axis) - slc = ds.slice(axis, center[axis], **kwargs) - w, frb = construct_image(ds, axis, slc, dcenter, width=width, image_res=image_res) - super(FITSSlice, self).__init__(frb, fields=fields, wcs=w) - - -class FITSProjection(FITSImageData): - r""" - Generate a FITSImageData of an on-axis projection. - - Parameters - ---------- - ds : :class:`yt.data_objects.api.Dataset` - The dataset object. - axis : character or integer - The axis along which to project. One of "x","y","z", or 0,1,2. - fields : string or list of strings - The fields to project - weight_field : string - The field used to weight the projection. - center : A sequence of floats, a string, or a tuple. - The coordinate of the center of the image. If set to 'c', 'center' or - left blank, the plot is centered on the middle of the domain. If set to - 'max' or 'm', the center will be located at the maximum of the - ('gas', 'density') field. Centering on the max or min of a specific - field is supported by providing a tuple such as ("min","temperature") or - ("max","dark_matter_density"). Units can be specified by passing in *center* - as a tuple containing a coordinate and string unit name or by passing - in a YTArray. If a list or unitless array is supplied, code units are - assumed. - width : tuple or a float. - Width can have four different formats to support windows with variable - x and y widths. They are: - - ================================== ======================= - format example - ================================== ======================= - (float, string) (10,'kpc') - ((float, string), (float, string)) ((10,'kpc'),(15,'kpc')) - float 0.2 - (float, float) (0.2, 0.3) - ================================== ======================= - - For example, (10, 'kpc') requests a plot window that is 10 kiloparsecs - wide in the x and y directions, ((10,'kpc'),(15,'kpc')) requests a - window that is 10 kiloparsecs wide along the x axis and 15 - kiloparsecs wide along the y axis. In the other two examples, code - units are assumed, for example (0.2, 0.3) requests a plot that has an - x width of 0.2 and a y width of 0.3 in code units. If units are - provided the resulting plot axis labels will use the supplied units. - image_res : an int or 2-tuple of ints - Specify the resolution of the resulting image. If not provided, it will be - determined based on the minimum cell size of the dataset. - """ - def __init__(self, ds, axis, fields, center="c", width=None, - weight_field=None, image_res=None, **kwargs): - fields = ensure_list(fields) - axis = fix_axis(axis, ds) - center, dcenter = ds.coordinates.sanitize_center(center, axis) - prj = ds.proj(fields[0], axis, weight_field=weight_field, **kwargs) - w, frb = construct_image(ds, axis, prj, dcenter, width=width, image_res=image_res) - super(FITSProjection, self).__init__(frb, fields=fields, wcs=w) - -class FITSOffAxisSlice(FITSImageData): - r""" - Generate a FITSImageData of an off-axis slice. - - Parameters - ---------- - ds : :class:`yt.data_objects.api.Dataset` - The dataset object. - normal : a sequence of floats - The vector normal to the projection plane. - fields : string or list of strings - The fields to slice - center : A sequence of floats, a string, or a tuple. - The coordinate of the center of the image. If set to 'c', 'center' or - left blank, the plot is centered on the middle of the domain. If set to - 'max' or 'm', the center will be located at the maximum of the - ('gas', 'density') field. Centering on the max or min of a specific - field is supported by providing a tuple such as ("min","temperature") or - ("max","dark_matter_density"). Units can be specified by passing in *center* - as a tuple containing a coordinate and string unit name or by passing - in a YTArray. If a list or unitless array is supplied, code units are - assumed. - width : tuple or a float. - Width can have four different formats to support windows with variable - x and y widths. They are: - - ================================== ======================= - format example - ================================== ======================= - (float, string) (10,'kpc') - ((float, string), (float, string)) ((10,'kpc'),(15,'kpc')) - float 0.2 - (float, float) (0.2, 0.3) - ================================== ======================= - - For example, (10, 'kpc') requests a plot window that is 10 kiloparsecs - wide in the x and y directions, ((10,'kpc'),(15,'kpc')) requests a - window that is 10 kiloparsecs wide along the x axis and 15 - kiloparsecs wide along the y axis. In the other two examples, code - units are assumed, for example (0.2, 0.3) requests a plot that has an - x width of 0.2 and a y width of 0.3 in code units. If units are - provided the resulting plot axis labels will use the supplied units. - image_res : an int or 2-tuple of ints - Specify the resolution of the resulting image. - north_vector : a sequence of floats - A vector defining the 'up' direction in the plot. This - option sets the orientation of the slicing plane. If not - set, an arbitrary grid-aligned north-vector is chosen. - """ - def __init__(self, ds, normal, fields, center='c', width=None, image_res=512, - north_vector=None): - fields = ensure_list(fields) - center, dcenter = ds.coordinates.sanitize_center(center, 4) - cut = ds.cutting(normal, center, north_vector=north_vector) - center = ds.arr([0.0] * 2, 'code_length') - w, frb = construct_image(ds, normal, cut, center, width=width, image_res=image_res) - super(FITSOffAxisSlice, self).__init__(frb, fields=fields, wcs=w) - - -class FITSOffAxisProjection(FITSImageData): - r""" - Generate a FITSImageData of an off-axis projection. - - Parameters - ---------- - ds : :class:`yt.data_objects.api.Dataset` - This is the dataset object corresponding to the - simulation output to be plotted. - normal : a sequence of floats - The vector normal to the projection plane. - fields : string, list of strings - The name of the field(s) to be plotted. - center : A sequence of floats, a string, or a tuple. - The coordinate of the center of the image. If set to 'c', 'center' or - left blank, the plot is centered on the middle of the domain. If set to - 'max' or 'm', the center will be located at the maximum of the - ('gas', 'density') field. Centering on the max or min of a specific - field is supported by providing a tuple such as ("min","temperature") or - ("max","dark_matter_density"). Units can be specified by passing in *center* - as a tuple containing a coordinate and string unit name or by passing - in a YTArray. If a list or unitless array is supplied, code units are - assumed. - width : tuple or a float. - Width can have four different formats to support windows with variable - x and y widths. They are: - - ================================== ======================= - format example - ================================== ======================= - (float, string) (10,'kpc') - ((float, string), (float, string)) ((10,'kpc'),(15,'kpc')) - float 0.2 - (float, float) (0.2, 0.3) - ================================== ======================= - - For example, (10, 'kpc') requests a plot window that is 10 kiloparsecs - wide in the x and y directions, ((10,'kpc'),(15,'kpc')) requests a - window that is 10 kiloparsecs wide along the x axis and 15 - kiloparsecs wide along the y axis. In the other two examples, code - units are assumed, for example (0.2, 0.3) requests a plot that has an - x width of 0.2 and a y width of 0.3 in code units. If units are - provided the resulting plot axis labels will use the supplied units. - depth : A tuple or a float - A tuple containing the depth to project through and the string - key of the unit: (width, 'unit'). If set to a float, code units - are assumed - weight_field : string - The name of the weighting field. Set to None for no weight. - image_res : an int or 2-tuple of ints - Specify the resolution of the resulting image. - depth_res : integer - Deprecated, this is still in the function signature for API - compatibility - north_vector : a sequence of floats - A vector defining the 'up' direction in the plot. This - option sets the orientation of the slicing plane. If not - set, an arbitrary grid-aligned north-vector is chosen. - method : string - The method of projection. Valid methods are: - - "integrate" with no weight_field specified : integrate the requested - field along the line of sight. - - "integrate" with a weight_field specified : weight the requested - field by the weighting field and integrate along the line of sight. - - "sum" : This method is the same as integrate, except that it does not - multiply by a path length when performing the integration, and is - just a straight summation of the field along the given axis. WARNING: - This should only be used for uniform resolution grid datasets, as other - datasets may result in unphysical images. - data_source : yt.data_objects.data_containers.YTSelectionContainer, optional - If specified, this will be the data source used for selecting regions to project. - """ - def __init__(self, ds, normal, fields, center='c', width=(1.0, 'unitary'), - weight_field=None, image_res=512, depth_res=256, data_source=None, - north_vector=None, depth=(1.0,"unitary"), no_ghost=False, method='integrate'): - fields = ensure_list(fields) - center, dcenter = ds.coordinates.sanitize_center(center, 4) - buf = {} - width = ds.coordinates.sanitize_width(normal, width, depth) - wd = tuple(el.in_units('code_length').v for el in width) - if not iterable(image_res): - image_res = (image_res, image_res) - res = (image_res[0], image_res[1]) - if data_source is None: - source = ds - else: - source = data_source - for field in fields: - buf[field] = off_axis_projection(source, center, normal, wd, res, field, - no_ghost=no_ghost, north_vector=north_vector, - method=method, weight=weight_field).swapaxes(0, 1) - center = ds.arr([0.0] * 2, 'code_length') - w, not_an_frb = construct_image(ds, normal, buf, center, width=width, image_res=image_res) - super(FITSOffAxisProjection, self).__init__(buf, fields=fields, wcs=w) +issue_deprecation_warning("The fits_image classes have been moved to yt.visualization " + "and can be imported from yt directly. yt.utilities.fits_image " + "is deprecated.") + +from yt.visualization.fits_image import \ + FITSImageData, FITSSlice, FITSProjection, \ + FITSOffAxisSlice, FITSOffAxisProjection \ No newline at end of file diff -Nru yt-3.3.3/yt/utilities/grid_data_format/docs/gdf_specification.txt yt-3.4.0/yt/utilities/grid_data_format/docs/gdf_specification.txt --- yt-3.3.3/yt/utilities/grid_data_format/docs/gdf_specification.txt 2016-09-22 03:28:40.000000000 +0000 +++ yt-3.4.0/yt/utilities/grid_data_format/docs/gdf_specification.txt 2017-08-10 18:02:57.000000000 +0000 @@ -13,7 +13,7 @@ #. We avoid having many attributes on many nodes, as access can be quite slow #. Cartesian data only for now #. All grids must have the same number of ghost zones. -#. If “/grid_parent” does not exist, parentage relationships will be +#. If "/grid_parent" does not exist, parentage relationships will be reconstructed and assumed to allow multiple grids #. No parentage can skip levels #. All grids are at the same time @@ -173,7 +173,7 @@ ``domain_dimensions`` dimensions in the top grid ``current_time`` - current time in simulation, in seconds, from “start” of simulation + current time in simulation, in seconds, from "start" of simulation ``domain_left_edge`` the left edge of the domain, in cm ``domain_right_edge`` diff -Nru yt-3.3.3/yt/utilities/grid_data_format/writer.py yt-3.4.0/yt/utilities/grid_data_format/writer.py --- yt-3.3.3/yt/utilities/grid_data_format/writer.py 2016-12-08 23:43:49.000000000 +0000 +++ yt-3.4.0/yt/utilities/grid_data_format/writer.py 2017-08-10 18:02:57.000000000 +0000 @@ -40,8 +40,8 @@ The yt data to write out. gdf_path : string The path of the file to output. - fields : field or list of fields - The fields(s) to write out. If None, defaults to + fields + The field or list of fields to write out. If None, defaults to ds.field_list. data_author : string, optional The name of the author who wrote the data. Default: None. @@ -50,11 +50,13 @@ dataset_units : dictionary, optional A dictionary of (value, unit) tuples to set the default units of the dataset. Keys can be: - "length_unit" - "time_unit" - "mass_unit" - "velocity_unit" - "magnetic_unit" + + * "length_unit" + * "time_unit" + * "mass_unit" + * "velocity_unit" + * "magnetic_unit" + If not specified, these will carry over from the parent dataset. particle_type_name : string, optional diff -Nru yt-3.3.3/yt/utilities/hierarchy_inspection.py yt-3.4.0/yt/utilities/hierarchy_inspection.py --- yt-3.3.3/yt/utilities/hierarchy_inspection.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/hierarchy_inspection.py 2017-08-10 18:02:57.000000000 +0000 @@ -12,7 +12,7 @@ Parameters ---------- - candidates : iterable + candidates : Iterable An interable object that is a collection of classes to find the lowest subclass of. diff -Nru yt-3.3.3/yt/utilities/io_handler.py yt-3.4.0/yt/utilities/io_handler.py --- yt-3.3.3/yt/utilities/io_handler.py 2016-12-08 23:43:49.000000000 +0000 +++ yt-3.4.0/yt/utilities/io_handler.py 2017-08-10 18:02:57.000000000 +0000 @@ -20,16 +20,29 @@ from yt.utilities.on_demand_imports import _h5py as h5py import numpy as np from yt.extern.six import add_metaclass +from yt.utilities.lru_cache import \ + local_lru_cache, _make_key +from yt.geometry.selection_routines import GridSelector _axis_ids = {0:2,1:1,2:0} io_registry = {} +use_caching = 0 + +def _make_io_key( args, *_args, **kwargs): + self, obj, field, ctx = args + # Ignore self because we have a self-specific cache + return _make_key((obj.id, field), *_args, **kwargs) + class RegisteredIOHandler(type): def __init__(cls, name, b, d): type.__init__(cls, name, b, d) if hasattr(cls, "_dataset_type"): io_registry[cls._dataset_type] = cls + if use_caching and hasattr(cls, "_read_obj_field"): + cls._read_obj_field = local_lru_cache(maxsize=use_caching, + typed=True, make_key=_make_io_key)(cls._read_obj_field) @add_metaclass(RegisteredIOHandler) class BaseIOHandler(object): @@ -54,7 +67,6 @@ # We need a function for reading a list of sets # and a function for *popping* from a queue all the appropriate sets - @contextmanager def preload(self, chunk, fields, max_size): yield self @@ -87,7 +99,7 @@ return return_val else: return False - + def _read_data_set(self, grid, field): # check backup file first. if field not found, # call frontend-specific io method @@ -108,6 +120,34 @@ def _read_data(self, grid, field): pass + def _read_fluid_selection(self, chunks, selector, fields, size): + # This function has an interesting history. It previously was mandate + # to be defined by all of the subclasses. But, to avoid having to + # rewrite a whole bunch of IO handlers all at once, and to allow a + # better abstraction for grid-based frontends, we're now defining it in + # the base class. + rv = {} + nodal_fields = [] + for field in fields: + finfo = self.ds.field_info[field] + nodal_flag = finfo.nodal_flag + if np.any(nodal_flag): + num_nodes = 2**sum(nodal_flag) + rv[field] = np.empty((size, num_nodes), dtype="=f8") + nodal_fields.append(field) + else: + rv[field] = np.empty(size, dtype="=f8") + ind = {field: 0 for field in fields} + for field, obj, data in self.io_iter(chunks, fields): + if data is None: + continue + if isinstance(selector, GridSelector) and field not in nodal_fields: + ind[field] += data.size + rv[field] = data.copy() + else: + ind[field] += obj.select(selector, data, rv[field], ind[field]) + return rv + def _read_data_slice(self, grid, field, axis, coord): sl = [slice(None), slice(None), slice(None)] sl[axis] = slice(coord, coord + 1) diff -Nru yt-3.3.3/yt/utilities/lib/allocation_container.c yt-3.4.0/yt/utilities/lib/allocation_container.c --- yt-3.3.3/yt/utilities/lib/allocation_container.c 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/allocation_container.c 2017-08-10 18:20:22.000000000 +0000 @@ -0,0 +1,26184 @@ +/* Generated by Cython 0.26rc2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [], + "libraries": [ + "m" + ], + "name": "yt.utilities.lib.allocation_container", + "sources": [ + "yt/utilities/lib/allocation_container.pyx" + ] + }, + "module_name": "yt.utilities.lib.allocation_container" +} +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 < 0x03020000) + #error Cython requires Python 2.6+ or Python 3.2+. +#else +#define CYTHON_ABI "0_26rc2" +#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 >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#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_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !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 < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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 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 +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#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 +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#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 + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#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; \ +} + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__yt__utilities__lib__allocation_container +#define __PYX_HAVE_API__yt__utilities__lib__allocation_container +#include +#include +#include +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "pythread.h" +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_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) && defined (_M_X64) + #define __Pyx_sst_abs(value) _abs64(value) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE 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_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) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_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; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; +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[] = { + "yt/utilities/lib/allocation_container.pyx", + "stringsource", + "yt/utilities/lib/allocation_container.pxd", + "__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; + +/* 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; + +/* 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 + + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":726 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":727 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":728 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":732 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":733 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":734 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":735 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":739 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":740 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":749 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":750 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":751 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":753 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":754 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":755 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":757 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":758 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":760 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":761 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":762 + * 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_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool; +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool; +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":765 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":766 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":768 + * 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_2yt_9utilities_3lib_20allocation_container_AllocationContainer; +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs; + +/* "yt/utilities/lib/allocation_container.pxd":19 + * from libc.stdlib cimport malloc, free, realloc + * + * cdef struct AllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + void *my_objs; +}; + +/* "yt/utilities/lib/allocation_container.pxd":30 + * cdef np.uint64_t n_con + * cdef AllocationContainer* containers + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except * # <<<<<<<<<<<<<< + * cdef void setup_objs(self, void *obj, np.uint64_t count, + * np.uint64_t offset, np.int64_t con_id) + */ +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs { + int __pyx_n; + __pyx_t_5numpy_int64_t con_id; +}; + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool { + PyObject_HEAD + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab; + __pyx_t_5numpy_uint64_t itemsize; + __pyx_t_5numpy_uint64_t n_con; + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers; +}; + + +/* "yt/utilities/lib/allocation_container.pyx":104 + * raise NotImplementedError + * + * cdef class BitmaskPool(ObjectPool): # <<<<<<<<<<<<<< + * def __cinit__(self): + * """This is an example implementation of object pools for bitmasks + */ +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool { + struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; +}; + + +/* "View.MemoryView":103 + * + * @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":275 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":326 + * + * @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":951 + * + * @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 *); +}; + + + +/* "yt/utilities/lib/allocation_container.pyx":19 + * import numpy as np + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * def __cinit__(self): + * """This class is *not* meant to be initialized directly, but instead + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool { + void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args); + void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); + void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + + +/* "yt/utilities/lib/allocation_container.pyx":104 + * raise NotImplementedError + * + * cdef class BitmaskPool(ObjectPool): # <<<<<<<<<<<<<< + * def __cinit__(self): + * """This is an example implementation of object pools for bitmasks + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_BitmaskPool { + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_BitmaskPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_BitmaskPool; + + +/* "View.MemoryView":103 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_array { + PyObject *(*get_memview)(struct __pyx_array_obj *); +}; +static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; + + +/* "View.MemoryView":326 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * 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":951 + * + * @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) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* 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); + +/* KeywordStringCheck.proto */ +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* 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); + +/* 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); + +/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* 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 + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* GetModuleGlobalName.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + +/* BufferFormatCheck.proto */ +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* 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); + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* ArgTypeTest.proto */ +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); + +/* IncludeStringH.proto */ +#include + +/* 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 *); + +/* 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); + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +/* 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 + +/* 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); + +/* 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() + +/* 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 *); + +/* StringJoin.proto */ +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + +/* 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; + +/* None.proto */ +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, + char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value); + +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_uint8_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 *); + +/* TypeInfoToFormat.proto */ +struct __pyx_typeinfo_string { + char string[3]; +}; +static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type); + +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(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 *); + +/* 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_uint8_t(PyObject *); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyIdentifierFromString.proto */ +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#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_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, int __pyx_v_n_objs, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args); /* proto*/ +static void __pyx_f_2yt_9utilities_3lib_20allocation_container_10ObjectPool_setup_objs(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, CYTHON_UNUSED void *__pyx_v_obj, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_count, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id); /* proto*/ +static void __pyx_f_2yt_9utilities_3lib_20allocation_container_10ObjectPool_teardown_objs(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, void *__pyx_v_obj, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_n, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id); /* proto*/ +static void __pyx_f_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_setup_objs(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *__pyx_v_self, void *__pyx_v_obj, __pyx_t_5numpy_uint64_t __pyx_v_n, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id); /* 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.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 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'yt.utilities.lib.allocation_container' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_BitmaskPool = 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 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 PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; +#define __Pyx_MODULE_NAME "yt.utilities.lib.allocation_container" +int __pyx_module_is_main_yt__utilities__lib__allocation_container = 0; + +/* Implementation of 'yt.utilities.lib.allocation_container' */ +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_ValueError; +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_O[] = "O"; +static const char __pyx_k_T[] = "T{"; + static const char __pyx_k_c[] = "c"; + static const char __pyx_k_s[] = "(%s)"; + static const char __pyx_k_id[] = "id"; + static const char __pyx_k_np[] = "np"; + static const char __pyx_k__33[] = "^"; + static const char __pyx_k__34[] = ""; + static const char __pyx_k__35[] = ":"; +static const char __pyx_k__36[] = "}"; +static const char __pyx_k__37[] = ","; +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_join[] = "join"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_mode[] = "mode"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_ndim[] = "ndim"; +static const char __pyx_k_pack[] = "pack"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_step[] = "step"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_ASCII[] = "ASCII"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_error[] = "error"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_shape[] = "shape"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_con_id[] = "con_id"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_format[] = "format"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_n_objs[] = "n_objs"; +static const char __pyx_k_name_2[] = "__name__"; +static const char __pyx_k_pickle[] = "pickle"; +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_asarray[] = "asarray"; +static const char __pyx_k_fortran[] = "fortran"; +static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_Ellipsis[] = "Ellipsis"; +static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +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_IndexError[] = "IndexError"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_con_to_array[] = "_con_to_array"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +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_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_strided_and_direct[] = ""; +static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; +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_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_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_An_allocation_container_and_mem[] = "\nAn allocation container and memory pool\n\n\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_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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_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_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_s_NotImplementedError; +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_n_s_RuntimeError; +static PyObject *__pyx_kp_b_T; +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_kp_b__33; +static PyObject *__pyx_kp_b__34; +static PyObject *__pyx_kp_b__35; +static PyObject *__pyx_kp_b__36; +static PyObject *__pyx_kp_u__37; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_s_asarray; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_con_id; +static PyObject *__pyx_n_s_con_to_array; +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_dtype_is_object; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_itemsize; +static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_n_objs; +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_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_pack; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_getbuffer; +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_cython; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_kp_u_s; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_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_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_2yt_9utilities_3lib_20allocation_container_10ObjectPool___cinit__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self); /* proto */ +static void __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_2__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_4__getitem__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, int __pyx_v_i); /* proto */ +static Py_ssize_t __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_6__len__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8append(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, int __pyx_v_n_objs, __pyx_t_5numpy_int64_t __pyx_v_con_id); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_10to_arrays(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_12_con_to_array(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, CYTHON_UNUSED int __pyx_v_i); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8itemsize___get__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self); /* proto */ +static int __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8itemsize_2__set__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_2yt_9utilities_3lib_20allocation_container_11BitmaskPool___cinit__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_2_con_to_array(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *__pyx_v_self, int __pyx_v_i); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *__pyx_v_self, CYTHON_UNUSED 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 PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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_2yt_9utilities_3lib_20allocation_container_ObjectPool(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_20allocation_container_BitmaskPool(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_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__27; +static PyObject *__pyx_slice__28; +static PyObject *__pyx_slice__29; +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__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_codeobj__44; + +/* "yt/utilities/lib/allocation_container.pyx":20 + * + * cdef class ObjectPool: + * def __cinit__(self): # <<<<<<<<<<<<<< + * """This class is *not* meant to be initialized directly, but instead + * through subclasses. Those subclasses need to implement at a minimum + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool___cinit__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "yt/utilities/lib/allocation_container.pyx":26 + * and teardown_objs to either set default values or initialize additional + * pointers and values, and then free them.""" + * self.containers = NULL # <<<<<<<<<<<<<< + * self.n_con = 0 + * self.itemsize = -1 # Never use the base class + */ + __pyx_v_self->containers = NULL; + + /* "yt/utilities/lib/allocation_container.pyx":27 + * pointers and values, and then free them.""" + * self.containers = NULL + * self.n_con = 0 # <<<<<<<<<<<<<< + * self.itemsize = -1 # Never use the base class + * + */ + __pyx_v_self->n_con = 0; + + /* "yt/utilities/lib/allocation_container.pyx":28 + * self.containers = NULL + * self.n_con = 0 + * self.itemsize = -1 # Never use the base class # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_v_self->itemsize = -1LL; + + /* "yt/utilities/lib/allocation_container.pyx":20 + * + * cdef class ObjectPool: + * def __cinit__(self): # <<<<<<<<<<<<<< + * """This class is *not* meant to be initialized directly, but instead + * through subclasses. Those subclasses need to implement at a minimum + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/allocation_container.pyx":30 + * self.itemsize = -1 # Never use the base class + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * cdef int i + * cdef AllocationContainer *obj + */ + +/* Python wrapper */ +static void __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_2__dealloc__(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_2__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self) { + int __pyx_v_i; + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *__pyx_v_obj; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_uint64_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "yt/utilities/lib/allocation_container.pyx":33 + * cdef int i + * cdef AllocationContainer *obj + * for i in range(self.n_con): # <<<<<<<<<<<<<< + * obj = &self.containers[i] + * self.teardown_objs(obj.my_objs, obj.n, obj.offset, obj.con_id) + */ + __pyx_t_1 = __pyx_v_self->n_con; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/utilities/lib/allocation_container.pyx":34 + * cdef AllocationContainer *obj + * for i in range(self.n_con): + * obj = &self.containers[i] # <<<<<<<<<<<<<< + * self.teardown_objs(obj.my_objs, obj.n, obj.offset, obj.con_id) + * if self.containers != NULL: + */ + __pyx_v_obj = (&(__pyx_v_self->containers[__pyx_v_i])); + + /* "yt/utilities/lib/allocation_container.pyx":35 + * for i in range(self.n_con): + * obj = &self.containers[i] + * self.teardown_objs(obj.my_objs, obj.n, obj.offset, obj.con_id) # <<<<<<<<<<<<<< + * if self.containers != NULL: + * free(self.containers) + */ + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self->__pyx_vtab)->teardown_objs(__pyx_v_self, __pyx_v_obj->my_objs, __pyx_v_obj->n, __pyx_v_obj->offset, __pyx_v_obj->con_id); + } + + /* "yt/utilities/lib/allocation_container.pyx":36 + * obj = &self.containers[i] + * self.teardown_objs(obj.my_objs, obj.n, obj.offset, obj.con_id) + * if self.containers != NULL: # <<<<<<<<<<<<<< + * free(self.containers) + * + */ + __pyx_t_3 = ((__pyx_v_self->containers != NULL) != 0); + if (__pyx_t_3) { + + /* "yt/utilities/lib/allocation_container.pyx":37 + * self.teardown_objs(obj.my_objs, obj.n, obj.offset, obj.con_id) + * if self.containers != NULL: + * free(self.containers) # <<<<<<<<<<<<<< + * + * def __getitem__(self, int i): + */ + free(__pyx_v_self->containers); + + /* "yt/utilities/lib/allocation_container.pyx":36 + * obj = &self.containers[i] + * self.teardown_objs(obj.my_objs, obj.n, obj.offset, obj.con_id) + * if self.containers != NULL: # <<<<<<<<<<<<<< + * free(self.containers) + * + */ + } + + /* "yt/utilities/lib/allocation_container.pyx":30 + * self.itemsize = -1 # Never use the base class + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * cdef int i + * cdef AllocationContainer *obj + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "yt/utilities/lib/allocation_container.pyx":39 + * free(self.containers) + * + * def __getitem__(self, int i): # <<<<<<<<<<<<<< + * """This returns an array view (if possible and implemented in a + * subclass) on the pool of objects specified by i.""" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/ +static char __pyx_doc_2yt_9utilities_3lib_20allocation_container_10ObjectPool_4__getitem__[] = "This returns an array view (if possible and implemented in a\n subclass) on the pool of objects specified by i."; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_2yt_9utilities_3lib_20allocation_container_10ObjectPool_4__getitem__; +#endif +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) { + int __pyx_v_i; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + assert(__pyx_arg_i); { + __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.allocation_container.ObjectPool.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_4__getitem__(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self), ((int)__pyx_v_i)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_4__getitem__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, int __pyx_v_i) { + 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_RefNannySetupContext("__getitem__", 0); + + /* "yt/utilities/lib/allocation_container.pyx":42 + * """This returns an array view (if possible and implemented in a + * subclass) on the pool of objects specified by i.""" + * return self._con_to_array(i) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_con_to_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __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, 42, __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, 42, __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, 42, __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, 42, __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, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/allocation_container.pyx":39 + * free(self.containers) + * + * def __getitem__(self, int i): # <<<<<<<<<<<<<< + * """This returns an array view (if possible and implemented in a + * subclass) on the pool of objects specified by i.""" + */ + + /* 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("yt.utilities.lib.allocation_container.ObjectPool.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/allocation_container.pyx":44 + * return self._con_to_array(i) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n_con + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_7__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_7__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_6__len__(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_6__len__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "yt/utilities/lib/allocation_container.pyx":45 + * + * def __len__(self): + * return self.n_con # <<<<<<<<<<<<<< + * + * def append(self, int n_objs, np.int64_t con_id = -1): + */ + __pyx_r = __pyx_v_self->n_con; + goto __pyx_L0; + + /* "yt/utilities/lib/allocation_container.pyx":44 + * return self._con_to_array(i) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n_con + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/allocation_container.pyx":47 + * return self.n_con + * + * def append(self, int n_objs, np.int64_t con_id = -1): # <<<<<<<<<<<<<< + * """This allocates a new batch of n_objs objects, with the container id + * specified as con_id. Return value is a view on them.""" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_9append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8append[] = "This allocates a new batch of n_objs objects, with the container id\n specified as con_id. Return value is a view on them."; +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_9append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_n_objs; + __pyx_t_5numpy_int64_t __pyx_v_con_id; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("append (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n_objs,&__pyx_n_s_con_id,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_objs)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_con_id); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append") < 0)) __PYX_ERR(0, 47, __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_n_objs = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n_objs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) + if (values[1]) { + __pyx_v_con_id = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_con_id == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) + } else { + __pyx_v_con_id = ((__pyx_t_5numpy_int64_t)-1LL); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("append", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 47, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.allocation_container.ObjectPool.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8append(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self), __pyx_v_n_objs, __pyx_v_con_id); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8append(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, int __pyx_v_n_objs, __pyx_t_5numpy_int64_t __pyx_v_con_id) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs __pyx_t_1; + __pyx_t_5numpy_uint64_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("append", 0); + + /* "yt/utilities/lib/allocation_container.pyx":50 + * """This allocates a new batch of n_objs objects, with the container id + * specified as con_id. Return value is a view on them.""" + * self.allocate_objs(n_objs, con_id) # <<<<<<<<<<<<<< + * return self[self.n_con - 1] + * + */ + __pyx_t_1.__pyx_n = 1; + __pyx_t_1.con_id = __pyx_v_con_id; + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self->__pyx_vtab)->allocate_objs(__pyx_v_self, __pyx_v_n_objs, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 50, __pyx_L1_error) + + /* "yt/utilities/lib/allocation_container.pyx":51 + * specified as con_id. Return value is a view on them.""" + * self.allocate_objs(n_objs, con_id) + * return self[self.n_con - 1] # <<<<<<<<<<<<<< + * + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = -1) except *: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = (__pyx_v_self->n_con - 1); + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self), __pyx_t_2, __pyx_t_5numpy_uint64_t, 0, __Pyx_PyInt_From_npy_uint64, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/allocation_container.pyx":47 + * return self.n_con + * + * def append(self, int n_objs, np.int64_t con_id = -1): # <<<<<<<<<<<<<< + * """This allocates a new batch of n_objs objects, with the container id + * specified as con_id. Return value is a view on them.""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.allocation_container.ObjectPool.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/allocation_container.pyx":53 + * return self[self.n_con - 1] + * + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = -1) except *: # <<<<<<<<<<<<<< + * cdef AllocationContainer *n_cont + * cdef AllocationContainer *prev + */ + +static void __pyx_f_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, int __pyx_v_n_objs, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args) { + __pyx_t_5numpy_int64_t __pyx_v_con_id = ((__pyx_t_5numpy_int64_t)-1LL); + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *__pyx_v_n_cont; + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *__pyx_v_prev; + CYTHON_UNUSED char *__pyx_v_obj; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("allocate_objs", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_con_id = __pyx_optional_args->con_id; + } + } + + /* "yt/utilities/lib/allocation_container.pyx":58 + * cdef int n, i, j, k + * cdef char *obj # char so we can do pointer math + * self.containers = realloc( # <<<<<<<<<<<<<< + * self.containers, + * sizeof(AllocationContainer) * (self.n_con + 1)) + */ + __pyx_v_self->containers = ((struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *)realloc(__pyx_v_self->containers, ((sizeof(struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer)) * (__pyx_v_self->n_con + 1)))); + + /* "yt/utilities/lib/allocation_container.pyx":61 + * self.containers, + * sizeof(AllocationContainer) * (self.n_con + 1)) + * n_cont = &self.containers[self.n_con] # <<<<<<<<<<<<<< + * if self.n_con == 0: + * n_cont.offset = 0 + */ + __pyx_v_n_cont = (&(__pyx_v_self->containers[__pyx_v_self->n_con])); + + /* "yt/utilities/lib/allocation_container.pyx":62 + * sizeof(AllocationContainer) * (self.n_con + 1)) + * n_cont = &self.containers[self.n_con] + * if self.n_con == 0: # <<<<<<<<<<<<<< + * n_cont.offset = 0 + * else: + */ + __pyx_t_1 = ((__pyx_v_self->n_con == 0) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/allocation_container.pyx":63 + * n_cont = &self.containers[self.n_con] + * if self.n_con == 0: + * n_cont.offset = 0 # <<<<<<<<<<<<<< + * else: + * prev = &self.containers[self.n_con - 1] + */ + __pyx_v_n_cont->offset = 0; + + /* "yt/utilities/lib/allocation_container.pyx":62 + * sizeof(AllocationContainer) * (self.n_con + 1)) + * n_cont = &self.containers[self.n_con] + * if self.n_con == 0: # <<<<<<<<<<<<<< + * n_cont.offset = 0 + * else: + */ + goto __pyx_L3; + } + + /* "yt/utilities/lib/allocation_container.pyx":65 + * n_cont.offset = 0 + * else: + * prev = &self.containers[self.n_con - 1] # <<<<<<<<<<<<<< + * n_cont.offset = prev.offset + prev.n + * self.n_con += 1 + */ + /*else*/ { + __pyx_v_prev = (&(__pyx_v_self->containers[(__pyx_v_self->n_con - 1)])); + + /* "yt/utilities/lib/allocation_container.pyx":66 + * else: + * prev = &self.containers[self.n_con - 1] + * n_cont.offset = prev.offset + prev.n # <<<<<<<<<<<<<< + * self.n_con += 1 + * n_cont.my_objs = malloc(self.itemsize * n_objs) + */ + __pyx_v_n_cont->offset = (__pyx_v_prev->offset + __pyx_v_prev->n); + } + __pyx_L3:; + + /* "yt/utilities/lib/allocation_container.pyx":67 + * prev = &self.containers[self.n_con - 1] + * n_cont.offset = prev.offset + prev.n + * self.n_con += 1 # <<<<<<<<<<<<<< + * n_cont.my_objs = malloc(self.itemsize * n_objs) + * if n_cont.my_objs == NULL: + */ + __pyx_v_self->n_con = (__pyx_v_self->n_con + 1); + + /* "yt/utilities/lib/allocation_container.pyx":68 + * n_cont.offset = prev.offset + prev.n + * self.n_con += 1 + * n_cont.my_objs = malloc(self.itemsize * n_objs) # <<<<<<<<<<<<<< + * if n_cont.my_objs == NULL: + * raise MemoryError + */ + __pyx_v_n_cont->my_objs = malloc((__pyx_v_self->itemsize * __pyx_v_n_objs)); + + /* "yt/utilities/lib/allocation_container.pyx":69 + * self.n_con += 1 + * n_cont.my_objs = malloc(self.itemsize * n_objs) + * if n_cont.my_objs == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * n_cont.n = n_objs + */ + __pyx_t_1 = ((__pyx_v_n_cont->my_objs == NULL) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/allocation_container.pyx":70 + * n_cont.my_objs = malloc(self.itemsize * n_objs) + * if n_cont.my_objs == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * n_cont.n = n_objs + * n_cont.n_assigned = 0 + */ + PyErr_NoMemory(); __PYX_ERR(0, 70, __pyx_L1_error) + + /* "yt/utilities/lib/allocation_container.pyx":69 + * self.n_con += 1 + * n_cont.my_objs = malloc(self.itemsize * n_objs) + * if n_cont.my_objs == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * n_cont.n = n_objs + */ + } + + /* "yt/utilities/lib/allocation_container.pyx":71 + * if n_cont.my_objs == NULL: + * raise MemoryError + * n_cont.n = n_objs # <<<<<<<<<<<<<< + * n_cont.n_assigned = 0 + * n_cont.con_id = con_id + */ + __pyx_v_n_cont->n = __pyx_v_n_objs; + + /* "yt/utilities/lib/allocation_container.pyx":72 + * raise MemoryError + * n_cont.n = n_objs + * n_cont.n_assigned = 0 # <<<<<<<<<<<<<< + * n_cont.con_id = con_id + * obj = n_cont.my_objs + */ + __pyx_v_n_cont->n_assigned = 0; + + /* "yt/utilities/lib/allocation_container.pyx":73 + * n_cont.n = n_objs + * n_cont.n_assigned = 0 + * n_cont.con_id = con_id # <<<<<<<<<<<<<< + * obj = n_cont.my_objs + * self.setup_objs(n_cont.my_objs, n_objs, n_cont.offset, n_cont.con_id) + */ + __pyx_v_n_cont->con_id = __pyx_v_con_id; + + /* "yt/utilities/lib/allocation_container.pyx":74 + * n_cont.n_assigned = 0 + * n_cont.con_id = con_id + * obj = n_cont.my_objs # <<<<<<<<<<<<<< + * self.setup_objs(n_cont.my_objs, n_objs, n_cont.offset, n_cont.con_id) + * + */ + __pyx_v_obj = ((char *)__pyx_v_n_cont->my_objs); + + /* "yt/utilities/lib/allocation_container.pyx":75 + * n_cont.con_id = con_id + * obj = n_cont.my_objs + * self.setup_objs(n_cont.my_objs, n_objs, n_cont.offset, n_cont.con_id) # <<<<<<<<<<<<<< + * + * cdef void setup_objs(self, void *obj, np.uint64_t count, + */ + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self->__pyx_vtab)->setup_objs(__pyx_v_self, __pyx_v_n_cont->my_objs, __pyx_v_n_objs, __pyx_v_n_cont->offset, __pyx_v_n_cont->con_id); + + /* "yt/utilities/lib/allocation_container.pyx":53 + * return self[self.n_con - 1] + * + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = -1) except *: # <<<<<<<<<<<<<< + * cdef AllocationContainer *n_cont + * cdef AllocationContainer *prev + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("yt.utilities.lib.allocation_container.ObjectPool.allocate_objs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + +/* "yt/utilities/lib/allocation_container.pyx":77 + * self.setup_objs(n_cont.my_objs, n_objs, n_cont.offset, n_cont.con_id) + * + * cdef void setup_objs(self, void *obj, np.uint64_t count, # <<<<<<<<<<<<<< + * np.uint64_t offset, np.int64_t con_id): + * """This can be overridden in the subclass, where it can initialize any + */ + +static void __pyx_f_2yt_9utilities_3lib_20allocation_container_10ObjectPool_setup_objs(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, CYTHON_UNUSED void *__pyx_v_obj, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_count, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("setup_objs", 0); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "yt/utilities/lib/allocation_container.pyx":83 + * pass + * + * cdef void teardown_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, # <<<<<<<<<<<<<< + * np.int64_t con_id): + * # We assume that these are all allocated and have no sub-allocations + */ + +static void __pyx_f_2yt_9utilities_3lib_20allocation_container_10ObjectPool_teardown_objs(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, void *__pyx_v_obj, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_n, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("teardown_objs", 0); + + /* "yt/utilities/lib/allocation_container.pyx":89 + * of allocations. For instance, if you allocate some memory on each of + * the allocated objects.""" + * if obj != NULL: # <<<<<<<<<<<<<< + * free(obj) + * + */ + __pyx_t_1 = ((__pyx_v_obj != NULL) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/allocation_container.pyx":90 + * the allocated objects.""" + * if obj != NULL: + * free(obj) # <<<<<<<<<<<<<< + * + * def to_arrays(self): + */ + free(__pyx_v_obj); + + /* "yt/utilities/lib/allocation_container.pyx":89 + * of allocations. For instance, if you allocate some memory on each of + * the allocated objects.""" + * if obj != NULL: # <<<<<<<<<<<<<< + * free(obj) + * + */ + } + + /* "yt/utilities/lib/allocation_container.pyx":83 + * pass + * + * cdef void teardown_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, # <<<<<<<<<<<<<< + * np.int64_t con_id): + * # We assume that these are all allocated and have no sub-allocations + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "yt/utilities/lib/allocation_container.pyx":92 + * free(obj) + * + * def to_arrays(self): # <<<<<<<<<<<<<< + * rv = [] + * cdef int i + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_11to_arrays(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_11to_arrays(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_arrays (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_10to_arrays(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_10to_arrays(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self) { + PyObject *__pyx_v_rv = NULL; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __pyx_t_5numpy_uint64_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + __Pyx_RefNannySetupContext("to_arrays", 0); + + /* "yt/utilities/lib/allocation_container.pyx":93 + * + * def to_arrays(self): + * rv = [] # <<<<<<<<<<<<<< + * cdef int i + * for i in range(self.n_con): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_rv = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "yt/utilities/lib/allocation_container.pyx":95 + * rv = [] + * cdef int i + * for i in range(self.n_con): # <<<<<<<<<<<<<< + * rv.append(self._con_to_array(i)) + * return rv + */ + __pyx_t_2 = __pyx_v_self->n_con; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "yt/utilities/lib/allocation_container.pyx":96 + * cdef int i + * for i in range(self.n_con): + * rv.append(self._con_to_array(i)) # <<<<<<<<<<<<<< + * return rv + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_con_to_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __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_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __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, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "yt/utilities/lib/allocation_container.pyx":97 + * for i in range(self.n_con): + * rv.append(self._con_to_array(i)) + * return rv # <<<<<<<<<<<<<< + * + * def _con_to_array(self, int i): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_rv); + __pyx_r = __pyx_v_rv; + goto __pyx_L0; + + /* "yt/utilities/lib/allocation_container.pyx":92 + * free(obj) + * + * def to_arrays(self): # <<<<<<<<<<<<<< + * rv = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("yt.utilities.lib.allocation_container.ObjectPool.to_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rv); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/allocation_container.pyx":99 + * return rv + * + * def _con_to_array(self, int i): # <<<<<<<<<<<<<< + * """This has to be implemented in a subclass, and should return an + * appropriate np.asarray() of a memoryview of self.my_objs.""" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_13_con_to_array(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/ +static char __pyx_doc_2yt_9utilities_3lib_20allocation_container_10ObjectPool_12_con_to_array[] = "This has to be implemented in a subclass, and should return an\n appropriate np.asarray() of a memoryview of self.my_objs."; +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_13_con_to_array(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) { + CYTHON_UNUSED int __pyx_v_i; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_con_to_array (wrapper)", 0); + assert(__pyx_arg_i); { + __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.allocation_container.ObjectPool._con_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_12_con_to_array(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self), ((int)__pyx_v_i)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_12_con_to_array(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, CYTHON_UNUSED int __pyx_v_i) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_con_to_array", 0); + + /* "yt/utilities/lib/allocation_container.pyx":102 + * """This has to be implemented in a subclass, and should return an + * appropriate np.asarray() of a memoryview of self.my_objs.""" + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * cdef class BitmaskPool(ObjectPool): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + __PYX_ERR(0, 102, __pyx_L1_error) + + /* "yt/utilities/lib/allocation_container.pyx":99 + * return rv + * + * def _con_to_array(self, int i): # <<<<<<<<<<<<<< + * """This has to be implemented in a subclass, and should return an + * appropriate np.asarray() of a memoryview of self.my_objs.""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("yt.utilities.lib.allocation_container.ObjectPool._con_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/allocation_container.pxd":27 + * + * cdef class ObjectPool: + * cdef public np.uint64_t itemsize # <<<<<<<<<<<<<< + * cdef np.uint64_t n_con + * cdef AllocationContainer* containers + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8itemsize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8itemsize___get__(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8itemsize___get__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__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 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 27, __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("yt.utilities.lib.allocation_container.ObjectPool.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8itemsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8itemsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8itemsize_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8itemsize_2__set__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_uint64_t __pyx_t_1; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_npy_uint64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(2, 27, __pyx_L1_error) + __pyx_v_self->itemsize = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("yt.utilities.lib.allocation_container.ObjectPool.itemsize.__set__", __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_2yt_9utilities_3lib_20allocation_container_10ObjectPool_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_15__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_2yt_9utilities_3lib_20allocation_container_10ObjectPool_14__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__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_, 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("yt.utilities.lib.allocation_container.ObjectPool.__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_2yt_9utilities_3lib_20allocation_container_10ObjectPool_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_17__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_2yt_9utilities_3lib_20allocation_container_10ObjectPool_16__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_10ObjectPool_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *__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__2, 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("yt.utilities.lib.allocation_container.ObjectPool.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/allocation_container.pyx":105 + * + * cdef class BitmaskPool(ObjectPool): + * def __cinit__(self): # <<<<<<<<<<<<<< + * """This is an example implementation of object pools for bitmasks + * (uint8) arrays. It lets you reasonably quickly allocate a set of + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_20allocation_container_11BitmaskPool___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_20allocation_container_11BitmaskPool___cinit__(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "yt/utilities/lib/allocation_container.pyx":111 + * append to that.""" + * # Base class will ALSO be called + * self.itemsize = sizeof(np.uint8_t) # <<<<<<<<<<<<<< + * + * cdef void setup_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, + */ + __pyx_v_self->__pyx_base.itemsize = (sizeof(__pyx_t_5numpy_uint8_t)); + + /* "yt/utilities/lib/allocation_container.pyx":105 + * + * cdef class BitmaskPool(ObjectPool): + * def __cinit__(self): # <<<<<<<<<<<<<< + * """This is an example implementation of object pools for bitmasks + * (uint8) arrays. It lets you reasonably quickly allocate a set of + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/allocation_container.pyx":113 + * self.itemsize = sizeof(np.uint8_t) + * + * cdef void setup_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, # <<<<<<<<<<<<<< + * np.int64_t con_id): + * cdef np.uint64_t i + */ + +static void __pyx_f_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_setup_objs(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *__pyx_v_self, void *__pyx_v_obj, __pyx_t_5numpy_uint64_t __pyx_v_n, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id) { + __pyx_t_5numpy_uint64_t __pyx_v_i; + __pyx_t_5numpy_uint8_t *__pyx_v_mask; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_uint64_t __pyx_t_1; + __pyx_t_5numpy_uint64_t __pyx_t_2; + __Pyx_RefNannySetupContext("setup_objs", 0); + + /* "yt/utilities/lib/allocation_container.pyx":116 + * np.int64_t con_id): + * cdef np.uint64_t i + * cdef np.uint8_t *mask = obj # <<<<<<<<<<<<<< + * for i in range(n): + * mask[i] = 0 + */ + __pyx_v_mask = ((__pyx_t_5numpy_uint8_t *)__pyx_v_obj); + + /* "yt/utilities/lib/allocation_container.pyx":117 + * cdef np.uint64_t i + * cdef np.uint8_t *mask = obj + * for i in range(n): # <<<<<<<<<<<<<< + * mask[i] = 0 + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/utilities/lib/allocation_container.pyx":118 + * cdef np.uint8_t *mask = obj + * for i in range(n): + * mask[i] = 0 # <<<<<<<<<<<<<< + * + * def _con_to_array(self, int i): + */ + (__pyx_v_mask[__pyx_v_i]) = 0; + } + + /* "yt/utilities/lib/allocation_container.pyx":113 + * self.itemsize = sizeof(np.uint8_t) + * + * cdef void setup_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, # <<<<<<<<<<<<<< + * np.int64_t con_id): + * cdef np.uint64_t i + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "yt/utilities/lib/allocation_container.pyx":120 + * mask[i] = 0 + * + * def _con_to_array(self, int i): # <<<<<<<<<<<<<< + * cdef AllocationContainer *obj = &self.containers[i] + * cdef np.uint8_t[:] o = ( obj.my_objs) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_3_con_to_array(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_3_con_to_array(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) { + int __pyx_v_i; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_con_to_array (wrapper)", 0); + assert(__pyx_arg_i); { + __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.allocation_container.BitmaskPool._con_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_2_con_to_array(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *)__pyx_v_self), ((int)__pyx_v_i)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_2_con_to_array(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *__pyx_v_self, int __pyx_v_i) { + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *__pyx_v_obj; + __Pyx_memviewslice __pyx_v_o = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_rv = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_uint8_t *__pyx_t_1; + struct __pyx_array_obj *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("_con_to_array", 0); + + /* "yt/utilities/lib/allocation_container.pyx":121 + * + * def _con_to_array(self, int i): + * cdef AllocationContainer *obj = &self.containers[i] # <<<<<<<<<<<<<< + * cdef np.uint8_t[:] o = ( obj.my_objs) + * rv = np.asarray(o) + */ + __pyx_v_obj = (&(__pyx_v_self->__pyx_base.containers[__pyx_v_i])); + + /* "yt/utilities/lib/allocation_container.pyx":122 + * def _con_to_array(self, int i): + * cdef AllocationContainer *obj = &self.containers[i] + * cdef np.uint8_t[:] o = ( obj.my_objs) # <<<<<<<<<<<<<< + * rv = np.asarray(o) + * return rv + */ + __pyx_t_1 = ((__pyx_t_5numpy_uint8_t *)__pyx_v_obj->my_objs); + if (!__pyx_t_1) { + PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); + __PYX_ERR(0, 122, __pyx_L1_error) + } + __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t); + __pyx_t_3 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_obj->n)); + if (unlikely(!__pyx_t_4 || !__pyx_t_3 || !PyBytes_AsString(__pyx_t_4))) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_array_new(__pyx_t_3, sizeof(__pyx_t_5numpy_uint8_t), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_t_1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __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_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_t_2)); + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_o = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "yt/utilities/lib/allocation_container.pyx":123 + * cdef AllocationContainer *obj = &self.containers[i] + * cdef np.uint8_t[:] o = ( obj.my_objs) + * rv = np.asarray(o) # <<<<<<<<<<<<<< + * return rv + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_o, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + if (!__pyx_t_7) { + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 123, __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_3); + PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __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; + __pyx_v_rv = __pyx_t_4; + __pyx_t_4 = 0; + + /* "yt/utilities/lib/allocation_container.pyx":124 + * cdef np.uint8_t[:] o = ( obj.my_objs) + * rv = np.asarray(o) + * return rv # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_rv); + __pyx_r = __pyx_v_rv; + goto __pyx_L0; + + /* "yt/utilities/lib/allocation_container.pyx":120 + * mask[i] = 0 + * + * def _con_to_array(self, int i): # <<<<<<<<<<<<<< + * cdef AllocationContainer *obj = &self.containers[i] + * cdef np.uint8_t[:] o = ( obj.my_objs) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(((PyObject *)__pyx_t_2)); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("yt.utilities.lib.allocation_container.BitmaskPool._con_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_o, 1); + __Pyx_XDECREF(__pyx_v_rv); + __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_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_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_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_4__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *__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__3, 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("yt.utilities.lib.allocation_container.BitmaskPool.__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_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_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_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_6__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *__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__4, 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("yt.utilities.lib.allocation_container.BitmaskPool.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + goto __pyx_L4; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 218, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 222, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + goto __pyx_L11; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * 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)); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset + */ + __pyx_v_f = NULL; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * 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; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + goto __pyx_L14; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L14:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 259, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(3, 278, __pyx_L1_error) + break; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + */ + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = '\x00'; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * 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(3, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * 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(3, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + * + * 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(3, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * 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(3, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + long __pyx_t_8; + char *__pyx_t_9; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(3, 794, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_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(3, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * 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(3, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(3, 796, __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(3, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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(3, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 799, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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") + * + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 803, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 0x78; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(3, 823, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + /*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(3, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 844, __pyx_L1_error) + } + __pyx_L15:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + goto __pyx_L13; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(3, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * 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; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 987, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 993, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 999, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(3, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":120 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __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, 120, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) + } else { + + /* "View.MemoryView":121 + * + * 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, 120, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __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":120 + * 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; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":127 + * 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, 127, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":128 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":131 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 131, __pyx_L1_error) + + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + } + + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":134 + * + * 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__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 134, __pyx_L1_error) + + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + } + + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":137 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + } + + /* "View.MemoryView":138 + * if not isinstance(format, bytes): + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) + __pyx_t_5 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":139 + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_6; + + /* "View.MemoryView":142 + * + * + * 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":143 + * + * 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":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":146 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 146, __pyx_L1_error) + + /* "View.MemoryView":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + } + + /* "View.MemoryView":149 + * + * + * 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, 149, __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, 149, __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, 149, __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":150 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":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_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __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, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __PYX_ERR(1, 151, __pyx_L1_error) + + /* "View.MemoryView":150 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + } + + /* "View.MemoryView":152 + * 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":149 + * + * + * 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":155 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":156 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":157 + * 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":155 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":159 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":160 + * 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":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":162 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + /*else*/ { + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 162, __pyx_L1_error) + } + __pyx_L10:; + + /* "View.MemoryView":164 + * 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":167 + * 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":168 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":169 + * 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":172 + * + * + * 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":173 + * + * 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 (__pyx_t_4) { + + /* "View.MemoryView":174 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 174, __pyx_L1_error) + + /* "View.MemoryView":173 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + } + + /* "View.MemoryView":176 + * 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":177 + * + * 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":178 + * 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, 178, __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, 178, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":179 + * 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":180 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + + /* "View.MemoryView":176 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + } + + /* "View.MemoryView":169 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":120 + * 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":183 + * + * @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; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":184 + * @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":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":186 + * 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":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + goto __pyx_L3; + } + + /* "View.MemoryView":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":188 + * 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":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; + + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 190, __pyx_L1_error) + + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + } + + /* "View.MemoryView":191 + * 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":192 + * 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":193 + * 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":194 + * 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":195 + * 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":196 + * 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":197 + * 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":198 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":200 + * 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":201 + * + * 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":200 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":203 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":205 + * 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":183 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":209 + * __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":210 + * + * 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":211 + * 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":210 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":214 + * 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":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } + + /* "View.MemoryView":216 + * 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":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + } + __pyx_L3:; + + /* "View.MemoryView":217 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":209 + * __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":220 + * + * @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":221 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":220 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":224 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_memview", 0); + + /* "View.MemoryView":225 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":226 + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __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, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":224 + * + * @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 + * + * + * 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_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":230 + * + * 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, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":229 + * + * + * 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":232 + * 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_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":233 + * + * 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, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __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 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":235 + * 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_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":236 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":235 + * 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__20, 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__21, 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":240 + * + * @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":244 + * 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":245 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __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, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":244 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __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":248 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":249 + * 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":251 + * 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":240 + * + * @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":277 + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __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, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___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":278 + * 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":277 + * 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":279 + * 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":280 + * 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":279 + * 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":294 + * + * @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":296 + * 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":300 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":302 + * 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":303 + * + * 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":302 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":305 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":294 + * + * @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":341 + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __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, 341, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___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":342 + * + * 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":343 + * 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":344 + * 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":345 + * 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 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) + + /* "View.MemoryView":346 + * 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":347 + * __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":348 + * 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":346 + * 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":344 + * 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":351 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":352 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":353 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":351 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + } + + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":355 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":357 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) + + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } + + /* "View.MemoryView":359 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":360 + * + * 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":359 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + goto __pyx_L10; + } + + /* "View.MemoryView":362 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; + + /* "View.MemoryView":364 + * 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":366 + * 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":341 + * 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":368 + * 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; + PyThread_type_lock __pyx_t_5; + PyThread_type_lock __pyx_t_6; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":369 + * + * 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":370 + * 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":369 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + } + + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * 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":375 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":377 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":380 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":379 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; + + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":381 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":383 + * break + * else: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + } + __pyx_L6_break:; + + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":368 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":385 + * 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":387 + * 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":389 + * 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, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 389, __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":390 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":389 + * 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":392 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":385 + * 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":395 + * + * + * 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":396 + * + * 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":397 + * 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":396 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + } + + /* "View.MemoryView":399 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 399, __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, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":402 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) + if (__pyx_t_2) { + + /* "View.MemoryView":403 + * 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, 403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":402 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + } + + /* "View.MemoryView":405 + * 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 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":406 + * 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, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":395 + * + * + * 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":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___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 + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":409 + * + * def __setitem__(memoryview self, object index, object value): + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 409, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":412 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_obj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":414 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":416 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":418 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":420 + * 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":421 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_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":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":424 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __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, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":425 + * 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, 425, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":426 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":421 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + } + + /* "View.MemoryView":428 + * 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":420 + * 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":430 + * 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":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) + + /* "View.MemoryView":435 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) + + /* "View.MemoryView":436 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) + + /* "View.MemoryView":430 + * 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":438 + * 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":440 + * 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":445 + * 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":447 + * 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":448 + * + * 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":449 + * 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 (__pyx_t_1) { + + /* "View.MemoryView":450 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) + + /* "View.MemoryView":449 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":451 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":447 + * 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":453 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":455 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":456 + * + * 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":457 + * 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":456 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":459 + * ( 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, 459, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":463 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":464 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":463 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + } + + /* "View.MemoryView":465 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * 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":468 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __pyx_L6_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __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); + } + __Pyx_PyThreadState_assign + 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":438 + * 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":470 + * 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":471 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":472 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":470 + * 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":474 + * 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":477 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":480 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __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":482 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __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, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } + + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":487 + * 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(1, 487, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; + + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } + + /* "View.MemoryView":488 + * 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_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":483 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); + + /* "View.MemoryView":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 484, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } + + /* "View.MemoryView":474 + * 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":490 + * 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":493 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":498 + * 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":499 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __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 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":498 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":501 + * 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, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __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, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __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, 501, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":503 + * 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, 503, __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":504 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":503 + * 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":504 + * + * 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":490 + * 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":507 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___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; + Py_ssize_t *__pyx_t_2; + char *__pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":509 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_2 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_2; + + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":511 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":513 + * 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":514 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_2 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_2; + + /* "View.MemoryView":513 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":516 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L4:; + + /* "View.MemoryView":518 + * 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":519 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_2 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_2; + + /* "View.MemoryView":518 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":521 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":523 + * 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":524 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_3 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_3; + + /* "View.MemoryView":523 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":526 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":528 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_4 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":529 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_5 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_5; + + /* "View.MemoryView":530 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = 0 + */ + __pyx_t_6 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_6; + + /* "View.MemoryView":531 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.obj = self + */ + __pyx_t_6 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_6; + + /* "View.MemoryView":532 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":533 + * info.len = self.view.len + * info.readonly = 0 + * 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":507 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + + /* function exit code */ + __pyx_r = 0; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":539 + * + * @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":540 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":541 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) + + /* "View.MemoryView":542 + * 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":539 + * + * @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":545 + * + * @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":546 + * @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":545 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":549 + * + * @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":550 + * @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, 550, __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, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":549 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_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":553 + * + * @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":554 + * @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 (__pyx_t_1) { + + /* "View.MemoryView":556 + * 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__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 556, __pyx_L1_error) + + /* "View.MemoryView":554 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + } + + /* "View.MemoryView":558 + * 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, 558, __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, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "View.MemoryView":553 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_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":561 + * + * @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":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__24, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + } + + /* "View.MemoryView":565 + * 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, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":561 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_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":568 + * + * @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":569 + * @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, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":568 + * + * @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":572 + * + * @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":573 + * @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, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":572 + * + * @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":576 + * + * @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":577 + * @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, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":576 + * + * @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":580 + * + * @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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":582 + * 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":584 + * 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, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":585 + * + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":587 + * 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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":589 + * 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":580 + * + * @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":591 + * 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":592 + * + * 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":593 + * 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":592 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":595 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":591 + * 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":597 + * 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":598 + * + * 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, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":599 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":598 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":597 + * 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":601 + * 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":602 + * + * 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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":601 + * 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":605 + * + * + * 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":608 + * 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":609 + * 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, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":605 + * + * + * 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":611 + * 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":614 + * 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":615 + * 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, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":611 + * 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":617 + * 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":619 + * 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":621 + * 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":622 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":627 + * 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, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":617 + * 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":629 + * 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":631 + * 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":633 + * 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":634 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":639 + * 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, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":629 + * 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__25, 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__26, 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":643 + * + * @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":644 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __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, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":645 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":646 + * 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":643 + * + * @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":649 + * + * @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":650 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":649 + * + * @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":652 + * 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":657 + * 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":658 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":657 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":660 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":662 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":663 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":664 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":665 + * 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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 665, __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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__27); + __Pyx_GIVEREF(__pyx_slice__27); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__27); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":669 + * 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":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__28); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":672 + * 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":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":675 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(1, 675, __pyx_L1_error) + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":677 + * 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":678 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":665 + * 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":680 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__29); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":684 + * 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, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "View.MemoryView":652 + * 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":686 + * 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":687 + * + * 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":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":689 + * 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__30, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 689, __pyx_L1_error) + + /* "View.MemoryView":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":686 + * 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":696 + * + * @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":697 + * @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":704 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + + /* "View.MemoryView":708 + * 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, 708, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":711 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":712 + * 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":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":714 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":715 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":721 + * + * + * 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":722 + * + * 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":727 + * + * + * 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":728 + * + * 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":732 + * 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, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 732, __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":733 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":737 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) + + /* "View.MemoryView":734 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) + + /* "View.MemoryView":733 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":741 + * 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":742 + * 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":743 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":744 + * 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":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":746 + * 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, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":747 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":748 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":750 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":751 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":752 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":754 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) + + /* "View.MemoryView":760 + * 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":732 + * 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":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":763 + * + * 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":764 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } + + /* "View.MemoryView":765 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } + + /* "View.MemoryView":763 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":769 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":696 + * + * @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":793 + * + * @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":813 + * 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":815 + * 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":816 + * + * 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":815 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_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":818 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":813 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":821 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __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":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_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":824 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) + + /* "View.MemoryView":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + } + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":828 + * + * 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":829 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":830 + * 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":831 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":830 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":828 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":832 + * 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":833 + * 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":834 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":833 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":836 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":832 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":839 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":841 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":844 + * + * 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":845 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":846 + * 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":847 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":846 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":844 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":848 + * 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":849 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":848 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":852 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":854 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":857 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":861 + * + * 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":863 + * 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":864 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":863 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":866 + * 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":867 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":866 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":870 + * + * + * 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":871 + * + * 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":872 + * 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":875 + * + * + * 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":876 + * + * 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":875 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":878 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":880 + * 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":881 + * + * 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":882 + * 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":883 + * 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":882 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":885 + * 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":886 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":881 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":888 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":880 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":890 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":793 + * + * @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":896 + * + * @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":898 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":899 + * 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":902 + * 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":903 + * + * 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, 903, __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, 903, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":904 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":902 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":906 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":907 + * 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":908 + * 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":909 + * 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":908 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":911 + * 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":912 + * + * 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":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":914 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 914, __pyx_L1_error) + + /* "View.MemoryView":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":911 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":917 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 917, __pyx_L1_error) + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":919 + * 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":920 + * + * 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":921 + * 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":920 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":923 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":896 + * + * @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":929 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + + /* "View.MemoryView":930 + * @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":932 + * 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":933 + * + * 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":937 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":938 + * 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":939 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":940 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L6_bool_binop_done:; + if (__pyx_t_6) { + + /* "View.MemoryView":943 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + } + } + + /* "View.MemoryView":945 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":929 + * + * @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":962 + * 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":963 + * + * 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":962 + * 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":965 + * __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":966 + * + * 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":967 + * 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, 967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":966 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":969 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":965 + * __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":971 + * 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":972 + * + * 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":973 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) + + /* "View.MemoryView":972 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":975 + * 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, 975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":971 + * 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":978 + * + * @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":979 + * @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":978 + * + * @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__31, 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__32, 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":985 + * + * @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":993 + * 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":994 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "View.MemoryView":993 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":999 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __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, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1001 + * 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":1002 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1004 + * __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, 1004, __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":1005 + * + * 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":1007 + * 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":1008 + * + * 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":1009 + * 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":1010 + * 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":1011 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * result.flags = PyBUF_RECORDS + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":1013 + * Py_INCREF(Py_None) + * + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1015 + * result.flags = PyBUF_RECORDS + * + * 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":1016 + * + * 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":1019 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1020 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1022 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":1023 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L5_break; + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L5_break:; + + /* "View.MemoryView":1025 + * 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":1026 + * + * 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, 1026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1027 + * 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, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1029 + * 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":1030 + * + * 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":1032 + * 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":985 + * + * @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":1035 + * + * @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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1039 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1040 + * 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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1042 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1043 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1035 + * + * @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":1046 + * + * @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; + Py_ssize_t __pyx_t_4; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1050 + * 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":1051 + * + * 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":1052 + * 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":1054 + * 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":1055 + * + * 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":1057 + * 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; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_dim = __pyx_t_3; + + /* "View.MemoryView":1058 + * + * 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":1059 + * 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":1060 + * 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_4 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_4 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4; + } + + /* "View.MemoryView":1046 + * + * @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":1063 + * + * @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":1066 + * "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":1067 + * 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, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1063 + * + * @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":1070 + * + * @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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1078 + * + * 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":1079 + * 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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1081 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1082 + * 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":1084 + * 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":1086 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1070 + * + * @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":1092 + * + * + * 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":1093 + * + * 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":1094 + * 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":1093 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1096 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1092 + * + * + * 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":1099 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1104 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1105 + * 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":1107 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1108 + * + * 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":1109 + * 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":1110 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1108 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1112 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1113 + * + * 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":1114 + * 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":1115 + * 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":1113 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1117 + * 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":1118 + * + * 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":1117 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1120 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1099 + * + * @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":1123 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + + /* "View.MemoryView":1130 + * + * 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":1131 + * 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":1132 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1133 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1135 + * 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":1136 + * + * 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":1137 + * 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":1136 + * + * 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":1138 + * 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): + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + + /* "View.MemoryView":1136 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1140 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1141 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + + /* "View.MemoryView":1142 + * 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":1143 + * 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":1135 + * 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":1145 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1146 + * 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":1150 + * 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":1151 + * 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":1123 + * + * @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":1153 + * 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":1156 + * __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":1153 + * 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":1160 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1163 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1165 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1166 + * + * 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":1168 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1160 + * + * @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":1171 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1180 + * 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":1181 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "View.MemoryView":1182 + * 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":1183 + * 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":1180 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1185 + * 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 > -1L; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1186 + * 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":1187 + * 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":1189 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1171 + * + * @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":1192 + * + * @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; + + /* "View.MemoryView":1203 + * 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":1204 + * + * 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":1206 + * 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":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1208 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) + + /* "View.MemoryView":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1211 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1212 + * + * 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":1213 + * 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; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1214 + * 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":1215 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1217 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + + /* "View.MemoryView":1221 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1222 + * + * 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":1223 + * 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":1222 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1225 + * 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":1226 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + + /* "View.MemoryView":1225 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1228 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1230 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1192 + * + * @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":1235 + * + * @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":1238 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __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":1237 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 1237, __pyx_L1_error) + + /* "View.MemoryView":1235 + * + * @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":1241 + * + * @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":1242 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_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, 1242, __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, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 1242, __pyx_L1_error) + + /* "View.MemoryView":1241 + * + * @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":1245 + * + * @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":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1247 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_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, 1247, __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, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 1247, __pyx_L1_error) + + /* "View.MemoryView":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1249 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(1, 1249, __pyx_L1_error) + } + + /* "View.MemoryView":1245 + * + * @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":1252 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + + /* "View.MemoryView":1260 + * 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":1261 + * """ + * 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":1263 + * 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":1264 + * 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":1265 + * 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":1268 + * 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":1269 + * + * 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":1268 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1271 + * 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":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1273 + * 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":1275 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1276 + * + * 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":1277 + * 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":1278 + * 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":1279 + * 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":1277 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1281 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1276 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1284 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + } + } + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1289 + * + * 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":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1291 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_6; + + /* "View.MemoryView":1292 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1298 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1302 + * 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":1304 + * 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":1305 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + + /* "View.MemoryView":1306 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1307 + * 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":1308 + * 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":1302 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_7 = (__pyx_t_2 != 0); + if (__pyx_t_7) { + + /* "View.MemoryView":1313 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) + + /* "View.MemoryView":1314 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1316 + * 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":1317 + * + * 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":1318 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1320 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1321 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1252 + * + * @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":1324 + * + * @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; + + /* "View.MemoryView":1328 + * 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":1330 + * 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 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1331 + * + * 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":1332 + * 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":1333 + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1335 + * 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; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1336 + * + * for i in range(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":1337 + * 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":1338 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1324 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1346 + * + * @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":1350 + * + * + * 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":1351 + * + * 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":1350 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1346 + * + * @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":1355 + * + * @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":1358 + * 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":1355 + * + * @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":1361 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1365 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_3 = (__pyx_v_inc != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1368 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1370 + * 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":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1372 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1373 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1375 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1361 + * + * @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":1381 + * + * @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":1384 + * 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":1385 + * 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":1387 + * _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":1381 + * + * @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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "View.MemoryView":1395 + * 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":1396 + * 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":1398 + * 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":1399 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1400 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1401 + * 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":1398 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1403 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1404 + * 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":1406 + * _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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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; +} + +/* "BufferFormatFromTypeInfo":1447 + * + * @cname('__pyx_format_from_typeinfo') + * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< + * cdef __Pyx_StructField *field + * cdef __pyx_typeinfo_string fmt + */ + +static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) { + __Pyx_StructField *__pyx_v_field; + struct __pyx_typeinfo_string __pyx_v_fmt; + PyObject *__pyx_v_part = 0; + PyObject *__pyx_v_result = 0; + PyObject *__pyx_v_alignment = NULL; + PyObject *__pyx_v_parts = NULL; + PyObject *__pyx_v_extents = NULL; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_StructField *__pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("format_from_typeinfo", 0); + + /* "BufferFormatFromTypeInfo":1452 + * cdef bytes part, result + * + * if type.typegroup == 'S': # <<<<<<<<<<<<<< + * assert type.fields != NULL and type.fields.type != NULL + * + */ + __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0); + if (__pyx_t_1) { + + /* "BufferFormatFromTypeInfo":1453 + * + * if type.typegroup == 'S': + * assert type.fields != NULL and type.fields.type != NULL # <<<<<<<<<<<<<< + * + * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_2 = ((__pyx_v_type->fields != NULL) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_type->fields->type != NULL) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(!__pyx_t_1)) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 1453, __pyx_L1_error) + } + } + #endif + + /* "BufferFormatFromTypeInfo":1455 + * assert type.fields != NULL and type.fields.type != NULL + * + * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<< + * alignment = b'^' + * else: + */ + __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0); + if (__pyx_t_1) { + + /* "BufferFormatFromTypeInfo":1456 + * + * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: + * alignment = b'^' # <<<<<<<<<<<<<< + * else: + * alignment = b'' + */ + __Pyx_INCREF(__pyx_kp_b__33); + __pyx_v_alignment = __pyx_kp_b__33; + + /* "BufferFormatFromTypeInfo":1455 + * assert type.fields != NULL and type.fields.type != NULL + * + * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<< + * alignment = b'^' + * else: + */ + goto __pyx_L6; + } + + /* "BufferFormatFromTypeInfo":1458 + * alignment = b'^' + * else: + * alignment = b'' # <<<<<<<<<<<<<< + * + * parts = [b"T{"] + */ + /*else*/ { + __Pyx_INCREF(__pyx_kp_b__34); + __pyx_v_alignment = __pyx_kp_b__34; + } + __pyx_L6:; + + /* "BufferFormatFromTypeInfo":1460 + * alignment = b'' + * + * parts = [b"T{"] # <<<<<<<<<<<<<< + * field = type.fields + * + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_kp_b_T); + __Pyx_GIVEREF(__pyx_kp_b_T); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_b_T); + __pyx_v_parts = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "BufferFormatFromTypeInfo":1461 + * + * parts = [b"T{"] + * field = type.fields # <<<<<<<<<<<<<< + * + * while field.type: + */ + __pyx_t_4 = __pyx_v_type->fields; + __pyx_v_field = __pyx_t_4; + + /* "BufferFormatFromTypeInfo":1463 + * field = type.fields + * + * while field.type: # <<<<<<<<<<<<<< + * part = format_from_typeinfo(field.type) + * parts.append(part + b':' + field.name + b':') + */ + while (1) { + __pyx_t_1 = (__pyx_v_field->type != 0); + if (!__pyx_t_1) break; + + /* "BufferFormatFromTypeInfo":1464 + * + * while field.type: + * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<< + * parts.append(part + b':' + field.name + b':') + * field += 1 + */ + __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "BufferFormatFromTypeInfo":1465 + * while field.type: + * part = format_from_typeinfo(field.type) + * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<< + * field += 1 + * + */ + __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__35); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__35); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 1465, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "BufferFormatFromTypeInfo":1466 + * part = format_from_typeinfo(field.type) + * parts.append(part + b':' + field.name + b':') + * field += 1 # <<<<<<<<<<<<<< + * + * result = alignment.join(parts) + b'}' + */ + __pyx_v_field = (__pyx_v_field + 1); + } + + /* "BufferFormatFromTypeInfo":1468 + * field += 1 + * + * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<< + * else: + * fmt = __Pyx_TypeInfoToFormat(type) + */ + __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__36); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(1, 1468, __pyx_L1_error) + __pyx_v_result = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "BufferFormatFromTypeInfo":1452 + * cdef bytes part, result + * + * if type.typegroup == 'S': # <<<<<<<<<<<<<< + * assert type.fields != NULL and type.fields.type != NULL + * + */ + goto __pyx_L3; + } + + /* "BufferFormatFromTypeInfo":1470 + * result = alignment.join(parts) + b'}' + * else: + * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<< + * if type.arraysize[0]: + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] + */ + /*else*/ { + __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type); + + /* "BufferFormatFromTypeInfo":1471 + * else: + * fmt = __Pyx_TypeInfoToFormat(type) + * if type.arraysize[0]: # <<<<<<<<<<<<<< + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + */ + __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0); + if (__pyx_t_1) { + + /* "BufferFormatFromTypeInfo":1472 + * fmt = __Pyx_TypeInfoToFormat(type) + * if type.arraysize[0]: + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<< + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + * else: + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __pyx_v_type->ndim; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1472, __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 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 1472, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_v_extents = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "BufferFormatFromTypeInfo":1473 + * if type.arraysize[0]: + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<< + * else: + * result = fmt.string + */ + __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__37, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 1473, __pyx_L1_error) + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "BufferFormatFromTypeInfo":1471 + * else: + * fmt = __Pyx_TypeInfoToFormat(type) + * if type.arraysize[0]: # <<<<<<<<<<<<<< + * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + */ + goto __pyx_L9; + } + + /* "BufferFormatFromTypeInfo":1475 + * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string + * else: + * result = fmt.string # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L9:; + } + __pyx_L3:; + + /* "BufferFormatFromTypeInfo":1477 + * result = fmt.string + * + * return result # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "BufferFormatFromTypeInfo":1447 + * + * @cname('__pyx_format_from_typeinfo') + * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< + * cdef __Pyx_StructField *field + * cdef __pyx_typeinfo_string fmt + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_part); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_alignment); + __Pyx_XDECREF(__pyx_v_parts); + __Pyx_XDECREF(__pyx_v_extents); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_vtable_2yt_9utilities_3lib_20allocation_container_ObjectPool; + +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_20allocation_container_ObjectPool(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *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_2yt_9utilities_3lib_20allocation_container_ObjectPool *)o); + p->__pyx_vtab = __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + if (unlikely(__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_2yt_9utilities_3lib_20allocation_container_ObjectPool(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + 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_2yt_9utilities_3lib_20allocation_container_10ObjectPool_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_2yt_9utilities_3lib_20allocation_container_ObjectPool(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 PyObject *__pyx_getprop_2yt_9utilities_3lib_20allocation_container_10ObjectPool_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8itemsize_1__get__(o); +} + +static int __pyx_setprop_2yt_9utilities_3lib_20allocation_container_10ObjectPool_itemsize(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8itemsize_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_20allocation_container_ObjectPool[] = { + {"append", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_9append, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_9utilities_3lib_20allocation_container_10ObjectPool_8append}, + {"to_arrays", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_11to_arrays, METH_NOARGS, 0}, + {"_con_to_array", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_13_con_to_array, METH_O, __pyx_doc_2yt_9utilities_3lib_20allocation_container_10ObjectPool_12_con_to_array}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_15__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_17__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_2yt_9utilities_3lib_20allocation_container_ObjectPool[] = { + {(char *)"itemsize", __pyx_getprop_2yt_9utilities_3lib_20allocation_container_10ObjectPool_itemsize, __pyx_setprop_2yt_9utilities_3lib_20allocation_container_10ObjectPool_itemsize, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_ObjectPool = { + __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_7__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_2yt_9utilities_3lib_20allocation_container_ObjectPool, /*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_ObjectPool = { + __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_7__len__, /*mp_length*/ + __pyx_pw_2yt_9utilities_3lib_20allocation_container_10ObjectPool_5__getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_2yt_9utilities_3lib_20allocation_container_ObjectPool = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.allocation_container.ObjectPool", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_9utilities_3lib_20allocation_container_ObjectPool, /*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_ObjectPool, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_ObjectPool, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_9utilities_3lib_20allocation_container_ObjectPool, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_2yt_9utilities_3lib_20allocation_container_ObjectPool, /*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_2yt_9utilities_3lib_20allocation_container_ObjectPool, /*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_2yt_9utilities_3lib_20allocation_container_BitmaskPool __pyx_vtable_2yt_9utilities_3lib_20allocation_container_BitmaskPool; + +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_20allocation_container_BitmaskPool(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *p; + PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_20allocation_container_ObjectPool(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_BitmaskPool; + if (unlikely(__pyx_pw_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_20allocation_container_BitmaskPool[] = { + {"_con_to_array", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_3_con_to_array, METH_O, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_7__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_9utilities_3lib_20allocation_container_BitmaskPool = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.allocation_container.BitmaskPool", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_BitmaskPool), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_9utilities_3lib_20allocation_container_ObjectPool, /*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*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_9utilities_3lib_20allocation_container_BitmaskPool, /*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*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_9utilities_3lib_20allocation_container_BitmaskPool, /*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 PY_VERSION_HEX >= 0x030400a1 + 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 = 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 = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + 0, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.allocation_container.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.allocation_container.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.allocation_container.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.allocation_container._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 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + "allocation_container", + __pyx_k_An_allocation_container_and_mem, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__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_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_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__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_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 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_kp_b__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 0, 0}, + {&__pyx_kp_b__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 0, 0}, + {&__pyx_kp_b__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 0, 0, 0}, + {&__pyx_kp_b__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 0, 0, 0}, + {&__pyx_kp_u__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 1, 0, 0}, + {&__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_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_con_id, __pyx_k_con_id, sizeof(__pyx_k_con_id), 0, 0, 1, 1}, + {&__pyx_n_s_con_to_array, __pyx_k_con_to_array, sizeof(__pyx_k_con_to_array), 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_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_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_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_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_n_objs, __pyx_k_n_objs, sizeof(__pyx_k_n_objs), 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_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_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_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_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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0}, + {&__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_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_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, 33, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 102, __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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 989, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 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_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(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__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "(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__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "(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__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(3, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "View.MemoryView":131 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "View.MemoryView":134 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "View.MemoryView":137 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "View.MemoryView":146 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "View.MemoryView":174 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "(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__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "(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__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "View.MemoryView":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "View.MemoryView":556 + * 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__23 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __pyx_tuple__24 = PyTuple_New(1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__24, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "(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__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "(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__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "View.MemoryView":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__27); + __Pyx_GIVEREF(__pyx_slice__27); + + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__28); + __Pyx_GIVEREF(__pyx_slice__28); + + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); + + /* "View.MemoryView":689 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "(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__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "(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__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "View.MemoryView":282 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "View.MemoryView":283 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "View.MemoryView":284 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "View.MemoryView":287 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "View.MemoryView":288 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__43 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_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, 0, __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_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __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_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_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; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initallocation_container(void); /*proto*/ +PyMODINIT_FUNC initallocation_container(void) +#else +PyMODINIT_FUNC PyInit_allocation_container(void); /*proto*/ +PyMODINIT_FUNC PyInit_allocation_container(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + static PyThread_type_lock __pyx_t_2[8]; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_allocation_container(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_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 PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("allocation_container", __pyx_methods, __pyx_k_An_allocation_container_and_mem, 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) + __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_yt__utilities__lib__allocation_container) { + 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, "yt.utilities.lib.allocation_container")) { + if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.allocation_container", __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 init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = &__pyx_vtable_2yt_9utilities_3lib_20allocation_container_ObjectPool; + __pyx_vtable_2yt_9utilities_3lib_20allocation_container_ObjectPool.allocate_objs = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args))__pyx_f_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs; + __pyx_vtable_2yt_9utilities_3lib_20allocation_container_ObjectPool.setup_objs = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t))__pyx_f_2yt_9utilities_3lib_20allocation_container_10ObjectPool_setup_objs; + __pyx_vtable_2yt_9utilities_3lib_20allocation_container_ObjectPool.teardown_objs = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t))__pyx_f_2yt_9utilities_3lib_20allocation_container_10ObjectPool_teardown_objs; + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_20allocation_container_ObjectPool) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + __pyx_type_2yt_9utilities_3lib_20allocation_container_ObjectPool.tp_print = 0; + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_2yt_9utilities_3lib_20allocation_container_ObjectPool, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 19, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_2yt_9utilities_3lib_20allocation_container_10ObjectPool_4__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_2yt_9utilities_3lib_20allocation_container_10ObjectPool_4__getitem__.doc = __pyx_doc_2yt_9utilities_3lib_20allocation_container_10ObjectPool_4__getitem__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_2yt_9utilities_3lib_20allocation_container_10ObjectPool_4__getitem__; + } + } + #endif + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_20allocation_container_ObjectPool.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ObjectPool", (PyObject *)&__pyx_type_2yt_9utilities_3lib_20allocation_container_ObjectPool) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_20allocation_container_ObjectPool) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = &__pyx_type_2yt_9utilities_3lib_20allocation_container_ObjectPool; + __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_BitmaskPool = &__pyx_vtable_2yt_9utilities_3lib_20allocation_container_BitmaskPool; + __pyx_vtable_2yt_9utilities_3lib_20allocation_container_BitmaskPool.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + __pyx_vtable_2yt_9utilities_3lib_20allocation_container_BitmaskPool.__pyx_base.setup_objs = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t))__pyx_f_2yt_9utilities_3lib_20allocation_container_11BitmaskPool_setup_objs; + __pyx_type_2yt_9utilities_3lib_20allocation_container_BitmaskPool.tp_base = __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool; + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_20allocation_container_BitmaskPool) < 0) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_type_2yt_9utilities_3lib_20allocation_container_BitmaskPool.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_20allocation_container_BitmaskPool.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_BitmaskPool) < 0) __PYX_ERR(0, 104, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "BitmaskPool", (PyObject *)&__pyx_type_2yt_9utilities_3lib_20allocation_container_BitmaskPool) < 0) __PYX_ERR(0, 104, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_20allocation_container_BitmaskPool) < 0) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_20allocation_container_BitmaskPool = &__pyx_type_2yt_9utilities_3lib_20allocation_container_BitmaskPool; + __pyx_vtabptr_array = &__pyx_vtable_array; + __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + __pyx_type___pyx_array.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) + __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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, 326, __pyx_L1_error) + __pyx_type___pyx_memoryview.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(4, 9, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 861, __pyx_L1_error) + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "yt/utilities/lib/allocation_container.pyx":17 + * + * cimport numpy as np + * import numpy as np # <<<<<<<<<<<<<< + * + * cdef class ObjectPool: + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/allocation_container.pyx":1 + * """ # <<<<<<<<<<<<<< + * An allocation container and memory pool + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":207 + * 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, 207, __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, 207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":282 + * 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__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":283 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":284 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":287 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":288 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":312 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":313 + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_2[0] = PyThread_allocate_lock(); + __pyx_t_2[1] = PyThread_allocate_lock(); + __pyx_t_2[2] = PyThread_allocate_lock(); + __pyx_t_2[3] = PyThread_allocate_lock(); + __pyx_t_2[4] = PyThread_allocate_lock(); + __pyx_t_2[5] = PyThread_allocate_lock(); + __pyx_t_2[6] = PyThread_allocate_lock(); + __pyx_t_2[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":535 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__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, 535, __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, 535, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":981 + * 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, 981, __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, 981, __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 + */ + __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; + + /* "BufferFormatFromTypeInfo":1447 + * + * @cname('__pyx_format_from_typeinfo') + * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< + * cdef __Pyx_StructField *field + * cdef __pyx_typeinfo_string fmt + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init yt.utilities.lib.allocation_container", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib.allocation_container"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #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 + +/* 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); +} + +/* KeywordStringCheck */ +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +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 + return 0; +} + +/* 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 = PyThreadState_GET(); + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#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 + +/* 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; +} + +/* GetItemInt */ +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + 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)); +} + +/* 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 PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* GetModuleGlobalName */ + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +/* BufferFormatCheck */ + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +/* 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; +} +static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + Py_FatalError(msg); + va_end(vargs); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview || (PyObject *) memview == Py_None) + return; + if (__pyx_get_slice_count(memview) < 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (first_time) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview ) { + return; + } else if ((PyObject *) memview == Py_None) { + memslice->memview = NULL; + return; + } + if (__pyx_get_slice_count(memview) <= 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (last_time) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +/* 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(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { +#endif + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* ArgTypeTest */ + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +/* 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_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_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* 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 CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* PyIntBinop */ + #if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + x = (long)((unsigned long)a + b); + if (likely((x^a) >= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* None */ + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* 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; + } +} + +/* StringJoin */ + #if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +/* 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 */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; + if (c_line) { + c_line = __Pyx_CLineForTraceback(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( + PyThreadState_GET(), /*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 (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + Py_DECREF(obj); + view->obj = NULL; +} +#endif + + + /* MemviewSliceIsContig */ + static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, + char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) + return 0; + itemsize *= mvs.shape[index]; + } + return 1; +} + +/* OverlappingSlices */ + static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +/* Capsule */ + static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +/* 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_npy_uint64(npy_uint64 value) { + const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(npy_uint64) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= 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_uint64), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint8) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(npy_uint8) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint8) <= 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_uint8), + little, !is_unsigned); + } +} + +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_uint8(*(__pyx_t_5numpy_uint8_t *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_uint8_t value = __Pyx_PyInt_As_npy_uint8(obj); + if ((value == ((npy_uint8)-1)) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_uint8_t *) itemp = value; + return 1; +} + +/* 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; +} + +/* TypeInfoToFormat */ + static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) { + struct __pyx_typeinfo_string result = { {0} }; + char *buf = (char *) result.string; + size_t size = type->size; + switch (type->typegroup) { + case 'H': + *buf = 'c'; + break; + case 'I': + case 'U': + if (size == 1) + *buf = (type->is_unsigned) ? 'B' : 'b'; + else if (size == 2) + *buf = (type->is_unsigned) ? 'H' : 'h'; + else if (size == 4) + *buf = (type->is_unsigned) ? 'I' : 'i'; + else if (size == 8) + *buf = (type->is_unsigned) ? 'Q' : 'q'; + break; + case 'P': + *buf = 'P'; + break; + case 'C': + { + __Pyx_TypeInfo complex_type = *type; + complex_type.typegroup = 'R'; + complex_type.size /= 2; + *buf++ = 'Z'; + *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0]; + break; + } + case 'R': + if (size == 4) + *buf = 'f'; + else if (size == 8) + *buf = 'd'; + else + *buf = 'g'; + break; + } + return result; +} + +/* 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 npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { + const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (npy_uint64) 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_uint64) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, digits[0]) + case 2: + if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) >= 2 * PyLong_SHIFT) { + return (npy_uint64) (((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) >= 3 * PyLong_SHIFT) { + return (npy_uint64) (((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) >= 4 * PyLong_SHIFT) { + return (npy_uint64) (((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)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_uint64) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, 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_uint64) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_uint64, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, +digits[0]) + case -2: + if (8 * sizeof(npy_uint64) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint64) ((((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint64) ((((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint64) (((npy_uint64)-1)*(((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint64, 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_uint64) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint64) ((((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]))); + } + } + break; + } +#endif + if (sizeof(npy_uint64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, 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_uint64 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_uint64) -1; + } + } else { + npy_uint64 val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_uint64) -1; + val = __Pyx_PyInt_As_npy_uint64(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to npy_uint64"); + return (npy_uint64) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint64"); + return (npy_uint64) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint8) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (npy_uint8) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (npy_uint8) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_uint8, digit, digits[0]) + case 2: + if (8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint8) >= 2 * PyLong_SHIFT) { + return (npy_uint8) (((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint8) >= 3 * PyLong_SHIFT) { + return (npy_uint8) (((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) >= 4 * PyLong_SHIFT) { + return (npy_uint8) (((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)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_uint8) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, 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_uint8) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_uint8, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_uint8, digit, +digits[0]) + case -2: + if (8 * sizeof(npy_uint8) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint8) (((npy_uint8)-1)*(((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT) { + return (npy_uint8) ((((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint8) (((npy_uint8)-1)*(((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) { + return (npy_uint8) ((((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint8) (((npy_uint8)-1)*(((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint8) ((((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); + } + } + break; + } +#endif + if (sizeof(npy_uint8) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, 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_uint8 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_uint8) -1; + } + } else { + npy_uint8 val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_uint8) -1; + val = __Pyx_PyInt_As_npy_uint8(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to npy_uint8"); + return (npy_uint8) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; +} + +/* 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; +} + +/* 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_uint8_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* 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) + PyErr_Clear(); + ++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); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else + if (__Pyx_PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +#endif + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (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 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 (PyInt_Check(x) || PyLong_Check(x)) +#else + if (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 = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } + #else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } + #endif +#else + res = PyNumber_Int(x); +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + 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_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff -Nru yt-3.3.3/yt/utilities/lib/allocation_container.pxd yt-3.4.0/yt/utilities/lib/allocation_container.pxd --- yt-3.3.3/yt/utilities/lib/allocation_container.pxd 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/allocation_container.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,35 @@ +""" +An allocation container and memory pool + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2016, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +cimport numpy as np +from libc.stdlib cimport malloc, free, realloc + +cdef struct AllocationContainer: + np.uint64_t n + np.uint64_t n_assigned + np.uint64_t offset + np.int64_t con_id # container id + void *my_objs + +cdef class ObjectPool: + cdef public np.uint64_t itemsize + cdef np.uint64_t n_con + cdef AllocationContainer* containers + cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except * + cdef void setup_objs(self, void *obj, np.uint64_t count, + np.uint64_t offset, np.int64_t con_id) + cdef void teardown_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, + np.int64_t con_id) + diff -Nru yt-3.3.3/yt/utilities/lib/allocation_container.pyx yt-3.4.0/yt/utilities/lib/allocation_container.pyx --- yt-3.3.3/yt/utilities/lib/allocation_container.pyx 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/allocation_container.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,124 @@ +""" +An allocation container and memory pool + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2016, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +cimport numpy as np +import numpy as np + +cdef class ObjectPool: + def __cinit__(self): + """This class is *not* meant to be initialized directly, but instead + through subclasses. Those subclasses need to implement at a minimum + the setting of itemsize, but can optionally also implement setup_objs + and teardown_objs to either set default values or initialize additional + pointers and values, and then free them.""" + self.containers = NULL + self.n_con = 0 + self.itemsize = -1 # Never use the base class + + def __dealloc__(self): + cdef int i + cdef AllocationContainer *obj + for i in range(self.n_con): + obj = &self.containers[i] + self.teardown_objs(obj.my_objs, obj.n, obj.offset, obj.con_id) + if self.containers != NULL: + free(self.containers) + + def __getitem__(self, int i): + """This returns an array view (if possible and implemented in a + subclass) on the pool of objects specified by i.""" + return self._con_to_array(i) + + def __len__(self): + return self.n_con + + def append(self, int n_objs, np.int64_t con_id = -1): + """This allocates a new batch of n_objs objects, with the container id + specified as con_id. Return value is a view on them.""" + self.allocate_objs(n_objs, con_id) + return self[self.n_con - 1] + + cdef void allocate_objs(self, int n_objs, np.int64_t con_id = -1) except *: + cdef AllocationContainer *n_cont + cdef AllocationContainer *prev + cdef int n, i, j, k + cdef char *obj # char so we can do pointer math + self.containers = realloc( + self.containers, + sizeof(AllocationContainer) * (self.n_con + 1)) + n_cont = &self.containers[self.n_con] + if self.n_con == 0: + n_cont.offset = 0 + else: + prev = &self.containers[self.n_con - 1] + n_cont.offset = prev.offset + prev.n + self.n_con += 1 + n_cont.my_objs = malloc(self.itemsize * n_objs) + if n_cont.my_objs == NULL: + raise MemoryError + n_cont.n = n_objs + n_cont.n_assigned = 0 + n_cont.con_id = con_id + obj = n_cont.my_objs + self.setup_objs(n_cont.my_objs, n_objs, n_cont.offset, n_cont.con_id) + + cdef void setup_objs(self, void *obj, np.uint64_t count, + np.uint64_t offset, np.int64_t con_id): + """This can be overridden in the subclass, where it can initialize any + of the allocated objects.""" + pass + + cdef void teardown_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, + np.int64_t con_id): + # We assume that these are all allocated and have no sub-allocations + """If overridden, additional behavior can be provided during teardown + of allocations. For instance, if you allocate some memory on each of + the allocated objects.""" + if obj != NULL: + free(obj) + + def to_arrays(self): + rv = [] + cdef int i + for i in range(self.n_con): + rv.append(self._con_to_array(i)) + return rv + + def _con_to_array(self, int i): + """This has to be implemented in a subclass, and should return an + appropriate np.asarray() of a memoryview of self.my_objs.""" + raise NotImplementedError + +cdef class BitmaskPool(ObjectPool): + def __cinit__(self): + """This is an example implementation of object pools for bitmasks + (uint8) arrays. It lets you reasonably quickly allocate a set of + uint8 arrays which can be accessed and modified, and then virtually + append to that.""" + # Base class will ALSO be called + self.itemsize = sizeof(np.uint8_t) + + cdef void setup_objs(self, void *obj, np.uint64_t n, np.uint64_t offset, + np.int64_t con_id): + cdef np.uint64_t i + cdef np.uint8_t *mask = obj + for i in range(n): + mask[i] = 0 + + def _con_to_array(self, int i): + cdef AllocationContainer *obj = &self.containers[i] + cdef np.uint8_t[:] o = ( obj.my_objs) + rv = np.asarray(o) + return rv diff -Nru yt-3.3.3/yt/utilities/lib/alt_ray_tracers.c yt-3.4.0/yt/utilities/lib/alt_ray_tracers.c --- yt-3.3.3/yt/utilities/lib/alt_ray_tracers.c 2016-12-12 01:41:36.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/alt_ray_tracers.c 2017-08-10 18:20:23.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,6 +6,10 @@ "depends": [], "libraries": [ "m" + ], + "name": "yt.utilities.lib.alt_ray_tracers", + "sources": [ + "yt/utilities/lib/alt_ray_tracers.pyx" ] }, "module_name": "yt.utilities.lib.alt_ray_tracers" @@ -19,7 +23,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -41,6 +45,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -193,16 +198,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -329,6 +338,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -383,6 +398,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -491,8 +535,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -505,8 +549,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -628,10 +675,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1050,7 +1099,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); @@ -1240,6 +1289,9 @@ /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1295,6 +1347,9 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_long(npy_long value); + /* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -1400,6 +1455,9 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ +static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *); + +/* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CheckBinaryVersion.proto */ @@ -1484,8 +1542,9 @@ static const char __pyx_k_np[] = "np"; static const char __pyx_k_p1[] = "p1"; static const char __pyx_k_p2[] = "p2"; -static const char __pyx_k__31[] = "\n\n\n\n\n"; +static const char __pyx_k__37[] = "\n\n\n\n\n"; static const char __pyx_k_loc[] = "loc"; +static const char __pyx_k_ret[] = "ret"; static const char __pyx_k_sum[] = "sum"; static const char __pyx_k_xyz[] = "xyz"; static const char __pyx_k_axis[] = "axis"; @@ -1505,6 +1564,7 @@ static const char __pyx_k_dsect[] = "dsect"; static const char __pyx_k_dtype[] = "dtype"; static const char __pyx_k_empty[] = "empty"; +static const char __pyx_k_int64[] = "int64"; static const char __pyx_k_isnan[] = "isnan"; static const char __pyx_k_numpy[] = "numpy"; static const char __pyx_k_ptemp[] = "ptemp"; @@ -1518,6 +1578,7 @@ static const char __pyx_k_xcart[] = "xcart"; static const char __pyx_k_zleft[] = "zleft"; static const char __pyx_k_arange[] = "arange"; +static const char __pyx_k_astype[] = "astype"; static const char __pyx_k_cright[] = "cright"; static const char __pyx_k_dpcart[] = "dpcart"; static const char __pyx_k_import[] = "__import__"; @@ -1552,17 +1613,18 @@ static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_return_index[] = "return_index"; static const char __pyx_k_cart_intersect[] = "_cart_intersect"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_cylindrical_ray_trace[] = "cylindrical_ray_trace"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/alt_ray_tracers.pyx"; 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"; static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_utilities_lib_alt_ray_tracers[] = "yt.utilities.lib.alt_ray_tracers"; +static const char __pyx_k_yt_utilities_lib_alt_ray_tracers[] = "yt/utilities/lib/alt_ray_tracers.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_utilities_lib_alt_ray_tracers_2[] = "yt.utilities.lib.alt_ray_tracers"; 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_I; @@ -1570,7 +1632,6 @@ static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_T; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_a; static PyObject *__pyx_n_s_arange; @@ -1578,6 +1639,7 @@ static PyObject *__pyx_n_s_argsort; static PyObject *__pyx_n_s_argwhere; static PyObject *__pyx_n_s_array; +static PyObject *__pyx_n_s_astype; static PyObject *__pyx_n_s_axis; static PyObject *__pyx_n_s_b; static PyObject *__pyx_n_s_b1; @@ -1586,6 +1648,7 @@ static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_s_cart_intersect; static PyObject *__pyx_n_s_cleft; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_concatenate; static PyObject *__pyx_n_s_cright; static PyObject *__pyx_n_s_cross; @@ -1602,6 +1665,7 @@ static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_inds; +static PyObject *__pyx_n_s_int64; static PyObject *__pyx_n_s_intp; static PyObject *__pyx_n_s_isnan; static PyObject *__pyx_n_s_left_edges; @@ -1623,6 +1687,7 @@ static PyObject *__pyx_n_s_ptemp; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_ret; static PyObject *__pyx_n_s_return_index; static PyObject *__pyx_n_s_right_edges; static PyObject *__pyx_n_s_rleft; @@ -1654,7 +1719,8 @@ static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_xcart; static PyObject *__pyx_n_s_xyz; -static PyObject *__pyx_n_s_yt_utilities_lib_alt_ray_tracers; +static PyObject *__pyx_kp_s_yt_utilities_lib_alt_ray_tracers; +static PyObject *__pyx_n_s_yt_utilities_lib_alt_ray_tracers_2; static PyObject *__pyx_n_s_zleft; static PyObject *__pyx_n_s_zright; static PyObject *__pyx_pf_2yt_9utilities_3lib_15alt_ray_tracers__cyl2cart(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x); /* proto */ @@ -1672,38 +1738,44 @@ static PyObject *__pyx_slice__3; static PyObject *__pyx_slice__5; static PyObject *__pyx_slice__7; -static PyObject *__pyx_slice__9; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; static PyObject *__pyx_slice__11; static PyObject *__pyx_slice__13; -static PyObject *__pyx_slice__14; static PyObject *__pyx_slice__15; static PyObject *__pyx_slice__17; static PyObject *__pyx_slice__19; +static PyObject *__pyx_slice__20; static PyObject *__pyx_slice__21; +static PyObject *__pyx_slice__23; +static PyObject *__pyx_slice__25; +static PyObject *__pyx_slice__27; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__18; -static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__22; -static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__24; -static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; -static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; -static PyObject *__pyx_codeobj__33; -static PyObject *__pyx_codeobj__35; -static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__43; /* "yt/utilities/lib/alt_ray_tracers.pyx":24 * @cython.wraparound(False) @@ -1981,9 +2053,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -1992,16 +2068,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_cart_intersect", 1, 4, 4, 1); __PYX_ERR(0, 40, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_cart_intersect", 1, 4, 4, 2); __PYX_ERR(0, 40, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; else { @@ -2635,9 +2714,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -2646,16 +2729,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p1)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("cylindrical_ray_trace", 1, 4, 4, 1); __PYX_ERR(0, 68, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("cylindrical_ray_trace", 1, 4, 4, 2); __PYX_ERR(0, 68, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { @@ -2702,8 +2788,8 @@ } static PyObject *__pyx_pf_2yt_9utilities_3lib_15alt_ray_tracers_4cylindrical_ray_trace(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_p1, PyArrayObject *__pyx_v_p2, PyArrayObject *__pyx_v_left_edges, PyArrayObject *__pyx_v_right_edges) { - int __pyx_v_i; - int __pyx_v_I; + __pyx_t_5numpy_int_t __pyx_v_i; + __pyx_t_5numpy_int_t __pyx_v_I; __pyx_t_5numpy_float64_t __pyx_v_a; __pyx_t_5numpy_float64_t __pyx_v_b; __pyx_t_5numpy_float64_t __pyx_v_bsqrd; @@ -2741,6 +2827,7 @@ PyObject *__pyx_v_tpmleft = NULL; PyObject *__pyx_v_nans = NULL; PyObject *__pyx_v_tmask = NULL; + PyObject *__pyx_v_ret = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_b1; __Pyx_Buffer __pyx_pybuffer_b1; __Pyx_LocalBuf_ND __pyx_pybuffernd_b2; @@ -2826,34 +2913,34 @@ Py_ssize_t __pyx_t_19; Py_ssize_t __pyx_t_20; Py_ssize_t __pyx_t_21; - int __pyx_t_22; + 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_5numpy_int_t __pyx_t_28; + __pyx_t_5numpy_int_t __pyx_t_29; Py_ssize_t __pyx_t_30; - PyObject *__pyx_t_31 = NULL; + Py_ssize_t __pyx_t_31; Py_ssize_t __pyx_t_32; Py_ssize_t __pyx_t_33; Py_ssize_t __pyx_t_34; Py_ssize_t __pyx_t_35; - PyObject *__pyx_t_36 = NULL; - PyObject *__pyx_t_37 = NULL; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; PyObject *__pyx_t_38 = NULL; - PyObject *__pyx_t_39 = NULL; - PyObject *__pyx_t_40 = NULL; - PyArrayObject *__pyx_t_41 = NULL; - int __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; - Py_ssize_t __pyx_t_47; - Py_ssize_t __pyx_t_48; - Py_ssize_t __pyx_t_49; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + PyObject *__pyx_t_43 = NULL; + PyObject *__pyx_t_44 = NULL; + PyObject *__pyx_t_45 = NULL; + PyObject *__pyx_t_46 = NULL; + PyObject *__pyx_t_47 = NULL; + PyArrayObject *__pyx_t_48 = NULL; + int __pyx_t_49; Py_ssize_t __pyx_t_50; Py_ssize_t __pyx_t_51; Py_ssize_t __pyx_t_52; @@ -2865,7 +2952,14 @@ Py_ssize_t __pyx_t_58; Py_ssize_t __pyx_t_59; Py_ssize_t __pyx_t_60; - PyObject *(*__pyx_t_61)(PyObject *); + Py_ssize_t __pyx_t_61; + Py_ssize_t __pyx_t_62; + Py_ssize_t __pyx_t_63; + Py_ssize_t __pyx_t_64; + Py_ssize_t __pyx_t_65; + Py_ssize_t __pyx_t_66; + Py_ssize_t __pyx_t_67; + PyObject *(*__pyx_t_68)(PyObject *); __Pyx_RefNannySetupContext("cylindrical_ray_trace", 0); __pyx_pybuffer_p1cart.pybuffer.buf = NULL; __pyx_pybuffer_p1cart.refcount = 0; @@ -3365,7 +3459,7 @@ * zleft = left_edges[:,1] * zright = right_edges[:,1] # <<<<<<<<<<<<<< * - * a = (dpcart[0]**2) + (dpcart[1]**2) + * a = dpcart[0] * dpcart[0] + dpcart[1] * dpcart[1] */ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_right_edges), __pyx_tuple__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -3394,39 +3488,43 @@ /* "yt/utilities/lib/alt_ray_tracers.pyx":120 * zright = right_edges[:,1] * - * a = (dpcart[0]**2) + (dpcart[1]**2) # <<<<<<<<<<<<<< - * b = (2*dpcart[0]*p1cart[0]) + (2*dpcart[1]*p1cart[1]) - * cleft = ((p1cart[0]**2) + (p1cart[1]**2)) - rleft**2 + * a = dpcart[0] * dpcart[0] + dpcart[1] * dpcart[1] # <<<<<<<<<<<<<< + * b = 2 * dpcart[0] * p1cart[0] + 2 * dpcart[1] * p1cart[1] + * cleft = p1cart[0] * p1cart[0] + p1cart[1] * p1cart[1] - rleft * rleft */ __pyx_t_12 = 0; - __pyx_t_13 = 1; - __pyx_v_a = (pow((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_dpcart.diminfo[0].strides)), 2.0) + pow((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_dpcart.diminfo[0].strides)), 2.0)); + __pyx_t_13 = 0; + __pyx_t_14 = 1; + __pyx_t_15 = 1; + __pyx_v_a = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_dpcart.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_dpcart.diminfo[0].strides))) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_dpcart.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_dpcart.diminfo[0].strides)))); /* "yt/utilities/lib/alt_ray_tracers.pyx":121 * - * a = (dpcart[0]**2) + (dpcart[1]**2) - * b = (2*dpcart[0]*p1cart[0]) + (2*dpcart[1]*p1cart[1]) # <<<<<<<<<<<<<< - * cleft = ((p1cart[0]**2) + (p1cart[1]**2)) - rleft**2 - * cright = ((p1cart[0]**2) + (p1cart[1]**2)) - rright**2 - */ - __pyx_t_14 = 0; - __pyx_t_15 = 0; - __pyx_t_16 = 1; - __pyx_t_17 = 1; - __pyx_v_b = (((2.0 * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_dpcart.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_p1cart.diminfo[0].strides))) + ((2.0 * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_dpcart.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_p1cart.diminfo[0].strides)))); + * a = dpcart[0] * dpcart[0] + dpcart[1] * dpcart[1] + * b = 2 * dpcart[0] * p1cart[0] + 2 * dpcart[1] * p1cart[1] # <<<<<<<<<<<<<< + * cleft = p1cart[0] * p1cart[0] + p1cart[1] * p1cart[1] - rleft * rleft + * cright = p1cart[0] * p1cart[0] + p1cart[1] * p1cart[1] - rright * rright + */ + __pyx_t_16 = 0; + __pyx_t_17 = 0; + __pyx_t_18 = 1; + __pyx_t_19 = 1; + __pyx_v_b = (((2.0 * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_dpcart.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_p1cart.diminfo[0].strides))) + ((2.0 * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dpcart.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_p1cart.diminfo[0].strides)))); /* "yt/utilities/lib/alt_ray_tracers.pyx":122 - * a = (dpcart[0]**2) + (dpcart[1]**2) - * b = (2*dpcart[0]*p1cart[0]) + (2*dpcart[1]*p1cart[1]) - * cleft = ((p1cart[0]**2) + (p1cart[1]**2)) - rleft**2 # <<<<<<<<<<<<<< - * cright = ((p1cart[0]**2) + (p1cart[1]**2)) - rright**2 - * twoa = 2*a + * a = dpcart[0] * dpcart[0] + dpcart[1] * dpcart[1] + * b = 2 * dpcart[0] * p1cart[0] + 2 * dpcart[1] * p1cart[1] + * cleft = p1cart[0] * p1cart[0] + p1cart[1] * p1cart[1] - rleft * rleft # <<<<<<<<<<<<<< + * cright = p1cart[0] * p1cart[0] + p1cart[1] * p1cart[1] - rright * rright + * twoa = 2 * a */ - __pyx_t_18 = 0; - __pyx_t_19 = 1; - __pyx_t_1 = PyFloat_FromDouble((pow((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_p1cart.diminfo[0].strides)), 2.0) + pow((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_p1cart.diminfo[0].strides)), 2.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_20 = 0; + __pyx_t_21 = 0; + __pyx_t_22 = 1; + __pyx_t_23 = 1; + __pyx_t_1 = PyFloat_FromDouble((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_p1cart.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_p1cart.diminfo[0].strides))) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_p1cart.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_p1cart.diminfo[0].strides))))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Power(((PyObject *)__pyx_v_rleft), __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_rleft), ((PyObject *)__pyx_v_rleft)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -3455,17 +3553,19 @@ __pyx_t_2 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":123 - * b = (2*dpcart[0]*p1cart[0]) + (2*dpcart[1]*p1cart[1]) - * cleft = ((p1cart[0]**2) + (p1cart[1]**2)) - rleft**2 - * cright = ((p1cart[0]**2) + (p1cart[1]**2)) - rright**2 # <<<<<<<<<<<<<< - * twoa = 2*a - * bsqrd = b**2 - */ - __pyx_t_20 = 0; - __pyx_t_21 = 1; - __pyx_t_2 = PyFloat_FromDouble((pow((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_p1cart.diminfo[0].strides)), 2.0) + pow((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_p1cart.diminfo[0].strides)), 2.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + * b = 2 * dpcart[0] * p1cart[0] + 2 * dpcart[1] * p1cart[1] + * cleft = p1cart[0] * p1cart[0] + p1cart[1] * p1cart[1] - rleft * rleft + * cright = p1cart[0] * p1cart[0] + p1cart[1] * p1cart[1] - rright * rright # <<<<<<<<<<<<<< + * twoa = 2 * a + * bsqrd = b * b + */ + __pyx_t_24 = 0; + __pyx_t_25 = 0; + __pyx_t_26 = 1; + __pyx_t_27 = 1; + __pyx_t_2 = PyFloat_FromDouble((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_p1cart.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_p1cart.diminfo[0].strides))) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_p1cart.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_p1cart.diminfo[0].strides))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Power(((PyObject *)__pyx_v_rright), __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_rright), ((PyObject *)__pyx_v_rright)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -3494,22 +3594,22 @@ __pyx_t_1 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":124 - * cleft = ((p1cart[0]**2) + (p1cart[1]**2)) - rleft**2 - * cright = ((p1cart[0]**2) + (p1cart[1]**2)) - rright**2 - * twoa = 2*a # <<<<<<<<<<<<<< - * bsqrd = b**2 + * cleft = p1cart[0] * p1cart[0] + p1cart[1] * p1cart[1] - rleft * rleft + * cright = p1cart[0] * p1cart[0] + p1cart[1] * p1cart[1] - rright * rright + * twoa = 2 * a # <<<<<<<<<<<<<< + * bsqrd = b * b * */ __pyx_v_twoa = (2.0 * __pyx_v_a); /* "yt/utilities/lib/alt_ray_tracers.pyx":125 - * cright = ((p1cart[0]**2) + (p1cart[1]**2)) - rright**2 - * twoa = 2*a - * bsqrd = b**2 # <<<<<<<<<<<<<< + * cright = p1cart[0] * p1cart[0] + p1cart[1] * p1cart[1] - rright * rright + * twoa = 2 * a + * bsqrd = b * b # <<<<<<<<<<<<<< * * # Compute positive and negative times and associated masks */ - __pyx_v_bsqrd = pow(__pyx_v_b, 2.0); + __pyx_v_bsqrd = (__pyx_v_b * __pyx_v_b); /* "yt/utilities/lib/alt_ray_tracers.pyx":128 * @@ -3571,9 +3671,9 @@ } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_28 = __Pyx_PyInt_As_npy_long(__pyx_t_1); if (unlikely((__pyx_t_28 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_I = __pyx_t_7; + __pyx_v_I = __pyx_t_28; /* "yt/utilities/lib/alt_ray_tracers.pyx":129 * # Compute positive and negative times and associated masks @@ -3587,7 +3687,7 @@ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_long(__pyx_v_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -3636,7 +3736,7 @@ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_long(__pyx_v_I); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -3685,7 +3785,7 @@ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_long(__pyx_v_I); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -3734,7 +3834,7 @@ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); 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_1 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_long(__pyx_v_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -3778,9 +3878,9 @@ * tmleft[i] = (-b - math.sqrt(bsqrd - 4*a*cleft[i])) / twoa * tpleft[i] = (-b + math.sqrt(bsqrd - 4*a*cleft[i])) / twoa */ - __pyx_t_7 = __pyx_v_I; - for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_7; __pyx_t_22+=1) { - __pyx_v_i = __pyx_t_22; + __pyx_t_28 = __pyx_v_I; + for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_i = __pyx_t_29; /* "yt/utilities/lib/alt_ray_tracers.pyx":134 * tpright = np.empty(I, dtype='float64') @@ -3789,9 +3889,9 @@ * tpleft[i] = (-b + math.sqrt(bsqrd - 4*a*cleft[i])) / twoa * tmright[i] = (-b - math.sqrt(bsqrd - 4*a*cright[i])) / twoa */ - __pyx_t_23 = __pyx_v_i; - __pyx_t_24 = __pyx_v_i; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tmleft.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_tmleft.diminfo[0].strides) = (((-__pyx_v_b) - sqrt((__pyx_v_bsqrd - ((4.0 * __pyx_v_a) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cleft.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_cleft.diminfo[0].strides)))))) / __pyx_v_twoa); + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tmleft.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_tmleft.diminfo[0].strides) = (((-__pyx_v_b) - sqrt((__pyx_v_bsqrd - ((4.0 * __pyx_v_a) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cleft.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_cleft.diminfo[0].strides)))))) / __pyx_v_twoa); /* "yt/utilities/lib/alt_ray_tracers.pyx":135 * for i in range(I): @@ -3800,9 +3900,9 @@ * tmright[i] = (-b - math.sqrt(bsqrd - 4*a*cright[i])) / twoa * tpright[i] = (-b + math.sqrt(bsqrd - 4*a*cright[i])) / twoa */ - __pyx_t_25 = __pyx_v_i; - __pyx_t_26 = __pyx_v_i; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tpleft.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_tpleft.diminfo[0].strides) = (((-__pyx_v_b) + sqrt((__pyx_v_bsqrd - ((4.0 * __pyx_v_a) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cleft.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_cleft.diminfo[0].strides)))))) / __pyx_v_twoa); + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tpleft.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_tpleft.diminfo[0].strides) = (((-__pyx_v_b) + sqrt((__pyx_v_bsqrd - ((4.0 * __pyx_v_a) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cleft.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_cleft.diminfo[0].strides)))))) / __pyx_v_twoa); /* "yt/utilities/lib/alt_ray_tracers.pyx":136 * tmleft[i] = (-b - math.sqrt(bsqrd - 4*a*cleft[i])) / twoa @@ -3811,9 +3911,9 @@ * tpright[i] = (-b + math.sqrt(bsqrd - 4*a*cright[i])) / twoa * */ - __pyx_t_27 = __pyx_v_i; - __pyx_t_28 = __pyx_v_i; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tmright.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_tmright.diminfo[0].strides) = (((-__pyx_v_b) - sqrt((__pyx_v_bsqrd - ((4.0 * __pyx_v_a) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cright.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_cright.diminfo[0].strides)))))) / __pyx_v_twoa); + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tmright.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_tmright.diminfo[0].strides) = (((-__pyx_v_b) - sqrt((__pyx_v_bsqrd - ((4.0 * __pyx_v_a) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cright.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_cright.diminfo[0].strides)))))) / __pyx_v_twoa); /* "yt/utilities/lib/alt_ray_tracers.pyx":137 * tpleft[i] = (-b + math.sqrt(bsqrd - 4*a*cleft[i])) / twoa @@ -3822,9 +3922,9 @@ * * tmmright = np.logical_and(~np.isnan(tmright), rright <= p1[0]) */ - __pyx_t_29 = __pyx_v_i; - __pyx_t_30 = __pyx_v_i; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tpright.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_tpright.diminfo[0].strides) = (((-__pyx_v_b) + sqrt((__pyx_v_bsqrd - ((4.0 * __pyx_v_a) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cright.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_cright.diminfo[0].strides)))))) / __pyx_v_twoa); + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tpright.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_tpright.diminfo[0].strides) = (((-__pyx_v_b) + sqrt((__pyx_v_bsqrd - ((4.0 * __pyx_v_a) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cright.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_cright.diminfo[0].strides)))))) / __pyx_v_twoa); } /* "yt/utilities/lib/alt_ray_tracers.pyx":139 @@ -3875,25 +3975,25 @@ } else #endif { - __pyx_t_31 = PyTuple_New(1+1); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_31, 0, __pyx_t_2); __pyx_t_2 = NULL; + __pyx_t_38 = PyTuple_New(1+1); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_38, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_tmright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tmright)); - PyTuple_SET_ITEM(__pyx_t_31, 0+1, ((PyObject *)__pyx_v_tmright)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_38, 0+1, ((PyObject *)__pyx_v_tmright)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyNumber_Invert(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_32 = 0; - __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_p1.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_39 = 0; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_p1.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_31 = PyObject_RichCompare(((PyObject *)__pyx_v_rright), __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_31); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_38 = PyObject_RichCompare(((PyObject *)__pyx_v_rright), __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_38); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_7 = 0; @@ -3909,22 +4009,22 @@ } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_31}; + PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_38}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_31}; + PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_38}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; } else #endif { @@ -3935,10 +4035,10 @@ } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_7, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_31); - PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_7, __pyx_t_31); + __Pyx_GIVEREF(__pyx_t_38); + PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_7, __pyx_t_38); __pyx_t_5 = 0; - __pyx_t_31 = 0; + __pyx_t_38 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3959,45 +4059,45 @@ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_31 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_31, __pyx_n_s_isnan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_38 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_38, __pyx_n_s_isnan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; - __pyx_t_31 = NULL; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __pyx_t_38 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_31 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_31)) { + __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_38)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_31); + __Pyx_INCREF(__pyx_t_38); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } - if (!__pyx_t_31) { + if (!__pyx_t_38) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_tpright)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[2] = {__pyx_t_31, ((PyObject *)__pyx_v_tpright)}; + PyObject *__pyx_temp[2] = {__pyx_t_38, ((PyObject *)__pyx_v_tpright)}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[2] = {__pyx_t_31, ((PyObject *)__pyx_v_tpright)}; + PyObject *__pyx_temp[2] = {__pyx_t_38, ((PyObject *)__pyx_v_tpright)}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_31); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_31); __pyx_t_31 = NULL; + __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_38); __pyx_t_38 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_tpright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tpright)); PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_tpright)); @@ -4010,8 +4110,8 @@ __pyx_t_5 = PyNumber_Invert(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_33 = 0; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p2.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_p2.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_40 = 0; + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p2.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_p2.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_rright), __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -4048,20 +4148,20 @@ } else #endif { - __pyx_t_31 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); + __pyx_t_38 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_31, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_38, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_31, 0+__pyx_t_7, __pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_38, 0+__pyx_t_7, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_31, 1+__pyx_t_7, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_38, 1+__pyx_t_7, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tpmright = __pyx_t_3; @@ -4076,8 +4176,8 @@ */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_31 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); + __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -4130,27 +4230,27 @@ __pyx_t_5 = PyNumber_Invert(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_34 = 0; - __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_p1.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_41 = 0; + __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_p1.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_rleft), __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_31))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_31); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_38))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_38); if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_31); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_31, function); + __Pyx_DECREF_SET(__pyx_t_38, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_31)) { + if (PyFunction_Check(__pyx_t_38)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_31, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_38, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4158,9 +4258,9 @@ } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_31)) { + if (__Pyx_PyFastCFunction_Check(__pyx_t_38)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_31, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_38, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4179,11 +4279,11 @@ PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_31, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_38, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; __pyx_v_tmmleft = __pyx_t_3; __pyx_t_3 = 0; @@ -4194,11 +4294,11 @@ * * # compute first cut of indexes and thetas, which */ - __pyx_t_31 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_31, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_38 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_38, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isnan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error) @@ -4215,23 +4315,23 @@ } } if (!__pyx_t_4) { - __pyx_t_31 = __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_tpleft)); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); + __pyx_t_38 = __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_tpleft)); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_tpleft)}; - __pyx_t_31 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_38 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_31); + __Pyx_GOTREF(__pyx_t_38); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_tpleft)}; - __pyx_t_31 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_38 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_31); + __Pyx_GOTREF(__pyx_t_38); } else #endif { @@ -4241,27 +4341,27 @@ __Pyx_INCREF(((PyObject *)__pyx_v_tpleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tpleft)); PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_tpleft)); - __pyx_t_31 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); + __pyx_t_38 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Invert(__pyx_t_31); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_5 = PyNumber_Invert(__pyx_t_38); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; - __pyx_t_35 = 0; - __pyx_t_31 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p2.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_p2.diminfo[0].strides))); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); - __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_rleft), __pyx_t_31, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; - __pyx_t_31 = NULL; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __pyx_t_42 = 0; + __pyx_t_38 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p2.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_p2.diminfo[0].strides))); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_rleft), __pyx_t_38, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __pyx_t_38 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_31 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_31)) { + __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_38)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_31); + __Pyx_INCREF(__pyx_t_38); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; @@ -4269,9 +4369,9 @@ } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[3] = {__pyx_t_31, __pyx_t_5, __pyx_t_2}; + PyObject *__pyx_temp[3] = {__pyx_t_38, __pyx_t_5, __pyx_t_2}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4279,9 +4379,9 @@ #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[3] = {__pyx_t_31, __pyx_t_5, __pyx_t_2}; + PyObject *__pyx_temp[3] = {__pyx_t_38, __pyx_t_5, __pyx_t_2}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4290,8 +4390,8 @@ { __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_31) { - __Pyx_GIVEREF(__pyx_t_31); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_31); __pyx_t_31 = NULL; + if (__pyx_t_38) { + __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_38); __pyx_t_38 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_t_5); @@ -4324,56 +4424,56 @@ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_31 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); - __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_31, __pyx_n_s_argwhere); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; - __pyx_t_31 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_36))) { - __pyx_t_31 = PyMethod_GET_SELF(__pyx_t_36); - if (likely(__pyx_t_31)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_36); - __Pyx_INCREF(__pyx_t_31); + __pyx_t_38 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_38, __pyx_n_s_argwhere); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __pyx_t_38 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_43))) { + __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_43); + if (likely(__pyx_t_38)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_43); + __Pyx_INCREF(__pyx_t_38); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_36, function); + __Pyx_DECREF_SET(__pyx_t_43, function); } } - if (!__pyx_t_31) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_36, __pyx_v_tmmleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + if (!__pyx_t_38) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_43, __pyx_v_tmmleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_36)) { - PyObject *__pyx_temp[2] = {__pyx_t_31, __pyx_v_tmmleft}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_36, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0; + if (PyFunction_Check(__pyx_t_43)) { + PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_v_tmmleft}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_43, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_36)) { - PyObject *__pyx_temp[2] = {__pyx_t_31, __pyx_v_tmmleft}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_36, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_43)) { + PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_v_tmmleft}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_43, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_37 = PyTuple_New(1+1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_GIVEREF(__pyx_t_31); PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_31); __pyx_t_31 = NULL; + __pyx_t_44 = PyTuple_New(1+1); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_t_38); __pyx_t_38 = NULL; __Pyx_INCREF(__pyx_v_tmmleft); __Pyx_GIVEREF(__pyx_v_tmmleft); - PyTuple_SET_ITEM(__pyx_t_37, 0+1, __pyx_v_tmmleft); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_36, __pyx_t_37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_44, 0+1, __pyx_v_tmmleft); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_43, __pyx_t_44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } } - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_flat); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_flat); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":150 @@ -4383,56 +4483,56 @@ * np.argwhere(tmmright).flat, * np.argwhere(tpmright).flat,])) */ - __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_31 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_argwhere); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_31))) { - __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_31); - if (likely(__pyx_t_37)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_31); - __Pyx_INCREF(__pyx_t_37); + __pyx_t_44 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_44, __pyx_n_s_argwhere); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __pyx_t_44 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_38))) { + __pyx_t_44 = PyMethod_GET_SELF(__pyx_t_38); + if (likely(__pyx_t_44)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); + __Pyx_INCREF(__pyx_t_44); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_31, function); + __Pyx_DECREF_SET(__pyx_t_38, function); } } - if (!__pyx_t_37) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_31, __pyx_v_tpmleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) + if (!__pyx_t_44) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_38, __pyx_v_tpmleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_31)) { - PyObject *__pyx_temp[2] = {__pyx_t_37, __pyx_v_tpmleft}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_31, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; + if (PyFunction_Check(__pyx_t_38)) { + PyObject *__pyx_temp[2] = {__pyx_t_44, __pyx_v_tpmleft}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_38, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_31)) { - PyObject *__pyx_temp[2] = {__pyx_t_37, __pyx_v_tpmleft}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_31, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_38)) { + PyObject *__pyx_temp[2] = {__pyx_t_44, __pyx_v_tpmleft}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_38, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_38 = PyTuple_New(1+1); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __Pyx_GIVEREF(__pyx_t_37); PyTuple_SET_ITEM(__pyx_t_38, 0, __pyx_t_37); __pyx_t_37 = NULL; + __pyx_t_45 = PyTuple_New(1+1); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __Pyx_GIVEREF(__pyx_t_44); PyTuple_SET_ITEM(__pyx_t_45, 0, __pyx_t_44); __pyx_t_44 = NULL; __Pyx_INCREF(__pyx_v_tpmleft); __Pyx_GIVEREF(__pyx_v_tpmleft); - PyTuple_SET_ITEM(__pyx_t_38, 0+1, __pyx_v_tpmleft); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_31, __pyx_t_38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_45, 0+1, __pyx_v_tpmleft); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_38, __pyx_t_45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; } } - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; - __pyx_t_31 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_flat); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_flat); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":151 @@ -4442,56 +4542,56 @@ * np.argwhere(tpmright).flat,])) * if 0 == inds.shape[0]: */ - __pyx_t_38 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_38, __pyx_n_s_argwhere); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __pyx_t_38 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_37))) { - __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_37); - if (likely(__pyx_t_38)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37); - __Pyx_INCREF(__pyx_t_38); + __pyx_t_45 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_45, __pyx_n_s_argwhere); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __pyx_t_45 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_44))) { + __pyx_t_45 = PyMethod_GET_SELF(__pyx_t_44); + if (likely(__pyx_t_45)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_44); + __Pyx_INCREF(__pyx_t_45); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_37, function); + __Pyx_DECREF_SET(__pyx_t_44, function); } } - if (!__pyx_t_38) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_37, __pyx_v_tmmright); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) + if (!__pyx_t_45) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_44, __pyx_v_tmmright); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_37)) { - PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_v_tmmright}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_37, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + if (PyFunction_Check(__pyx_t_44)) { + PyObject *__pyx_temp[2] = {__pyx_t_45, __pyx_v_tmmright}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_44, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_45); __pyx_t_45 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_37)) { - PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_v_tmmright}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_37, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_44)) { + PyObject *__pyx_temp[2] = {__pyx_t_45, __pyx_v_tmmright}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_44, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_45); __pyx_t_45 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_39 = PyTuple_New(1+1); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_39); - __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_39, 0, __pyx_t_38); __pyx_t_38 = NULL; + __pyx_t_46 = PyTuple_New(1+1); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_46); + __Pyx_GIVEREF(__pyx_t_45); PyTuple_SET_ITEM(__pyx_t_46, 0, __pyx_t_45); __pyx_t_45 = NULL; __Pyx_INCREF(__pyx_v_tmmright); __Pyx_GIVEREF(__pyx_v_tmmright); - PyTuple_SET_ITEM(__pyx_t_39, 0+1, __pyx_v_tmmright); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_37, __pyx_t_39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_46, 0+1, __pyx_v_tmmright); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_44, __pyx_t_46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0; + __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0; } } - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_flat); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_flat); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":152 @@ -4501,56 +4601,56 @@ * if 0 == inds.shape[0]: * inds = np.arange(np.intp(I)) */ - __pyx_t_39 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_39); - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_39, __pyx_n_s_argwhere); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0; - __pyx_t_39 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_38))) { - __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_38); - if (likely(__pyx_t_39)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); - __Pyx_INCREF(__pyx_t_39); + __pyx_t_46 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_46); + __pyx_t_45 = __Pyx_PyObject_GetAttrStr(__pyx_t_46, __pyx_n_s_argwhere); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0; + __pyx_t_46 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_45))) { + __pyx_t_46 = PyMethod_GET_SELF(__pyx_t_45); + if (likely(__pyx_t_46)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_45); + __Pyx_INCREF(__pyx_t_46); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_38, function); + __Pyx_DECREF_SET(__pyx_t_45, function); } } - if (!__pyx_t_39) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_38, __pyx_v_tpmright); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + if (!__pyx_t_46) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_45, __pyx_v_tpmright); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_38)) { - PyObject *__pyx_temp[2] = {__pyx_t_39, __pyx_v_tpmright}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_38, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; + if (PyFunction_Check(__pyx_t_45)) { + PyObject *__pyx_temp[2] = {__pyx_t_46, __pyx_v_tpmright}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_45, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_46); __pyx_t_46 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_38)) { - PyObject *__pyx_temp[2] = {__pyx_t_39, __pyx_v_tpmright}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_38, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_45)) { + PyObject *__pyx_temp[2] = {__pyx_t_46, __pyx_v_tpmright}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_45, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_46); __pyx_t_46 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_40 = PyTuple_New(1+1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_40); - __Pyx_GIVEREF(__pyx_t_39); PyTuple_SET_ITEM(__pyx_t_40, 0, __pyx_t_39); __pyx_t_39 = NULL; + __pyx_t_47 = PyTuple_New(1+1); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_47); + __Pyx_GIVEREF(__pyx_t_46); PyTuple_SET_ITEM(__pyx_t_47, 0, __pyx_t_46); __pyx_t_46 = NULL; __Pyx_INCREF(__pyx_v_tpmright); __Pyx_GIVEREF(__pyx_v_tpmright); - PyTuple_SET_ITEM(__pyx_t_40, 0+1, __pyx_v_tpmright); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_38, __pyx_t_40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_47, 0+1, __pyx_v_tpmright); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_45, __pyx_t_47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0; + __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0; } } - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_flat); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __pyx_t_45 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_flat); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":149 @@ -4562,61 +4662,61 @@ */ __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_36); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_36); - __Pyx_GIVEREF(__pyx_t_31); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_31); - __Pyx_GIVEREF(__pyx_t_37); - PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_37); + __Pyx_GIVEREF(__pyx_t_43); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_43); __Pyx_GIVEREF(__pyx_t_38); - PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_38); - __pyx_t_36 = 0; - __pyx_t_31 = 0; - __pyx_t_37 = 0; + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_38); + __Pyx_GIVEREF(__pyx_t_44); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_44); + __Pyx_GIVEREF(__pyx_t_45); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_45); + __pyx_t_43 = 0; __pyx_t_38 = 0; - __pyx_t_38 = NULL; + __pyx_t_44 = 0; + __pyx_t_45 = 0; + __pyx_t_45 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_38)) { + __pyx_t_45 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_45)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_38); + __Pyx_INCREF(__pyx_t_45); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } - if (!__pyx_t_38) { + if (!__pyx_t_45) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __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_5)) { - PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_t_2}; + PyObject *__pyx_temp[2] = {__pyx_t_45, __pyx_t_2}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_XDECREF(__pyx_t_45); __pyx_t_45 = 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_5)) { - PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_t_2}; + PyObject *__pyx_temp[2] = {__pyx_t_45, __pyx_t_2}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_XDECREF(__pyx_t_45); __pyx_t_45 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_37 = PyTuple_New(1+1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_38); __pyx_t_38 = NULL; + __pyx_t_44 = PyTuple_New(1+1); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_GIVEREF(__pyx_t_45); PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_t_45); __pyx_t_45 = NULL; __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_37, 0+1, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_44, 0+1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4654,24 +4754,24 @@ } else #endif { - __pyx_t_37 = PyTuple_New(1+1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_5); __pyx_t_5 = NULL; + __pyx_t_44 = PyTuple_New(1+1); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_37, 0+1, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_44, 0+1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 149, __pyx_L1_error) - __pyx_t_41 = ((PyArrayObject *)__pyx_t_3); + __pyx_t_48 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_41, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { @@ -4684,7 +4784,7 @@ __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0]; if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) } - __pyx_t_41 = 0; + __pyx_t_48 = 0; __pyx_v_inds = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; @@ -4695,8 +4795,8 @@ * inds = np.arange(np.intp(I)) * thetaleft = np.empty(I) */ - __pyx_t_42 = ((0 == (__pyx_v_inds->dimensions[0])) != 0); - if (__pyx_t_42) { + __pyx_t_49 = ((0 == (__pyx_v_inds->dimensions[0])) != 0); + if (__pyx_t_49) { /* "yt/utilities/lib/alt_ray_tracers.pyx":154 * np.argwhere(tpmright).flat,])) @@ -4707,15 +4807,15 @@ */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); + __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_long(__pyx_v_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -4751,70 +4851,70 @@ } else #endif { - __pyx_t_38 = PyTuple_New(1+1); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_38, 0, __pyx_t_2); __pyx_t_2 = NULL; + __pyx_t_45 = PyTuple_New(1+1); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_45, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_38, 0+1, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_45, 0+1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_38, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_45, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_37))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_37); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_44))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_44); if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_44); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_37, function); + __Pyx_DECREF_SET(__pyx_t_44, function); } } if (!__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_37, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_44, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __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_37)) { + if (PyFunction_Check(__pyx_t_44)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_37, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_44, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __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_37)) { + if (__Pyx_PyFastCFunction_Check(__pyx_t_44)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_37, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_44, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __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_38 = PyTuple_New(1+1); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_38, 0, __pyx_t_5); __pyx_t_5 = NULL; + __pyx_t_45 = PyTuple_New(1+1); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_45, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_38, 0+1, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_45, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_37, __pyx_t_38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_44, __pyx_t_45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; } } - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 154, __pyx_L1_error) - __pyx_t_41 = ((PyArrayObject *)__pyx_t_3); + __pyx_t_48 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_41, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { @@ -4827,7 +4927,7 @@ __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0]; if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 154, __pyx_L1_error) } - __pyx_t_41 = 0; + __pyx_t_48 = 0; __Pyx_DECREF_SET(__pyx_v_inds, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; @@ -4838,59 +4938,59 @@ * thetaleft.fill(p1[2]) * thetaright = np.empty(I) */ - __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_empty); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); + __pyx_t_44 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_45 = __Pyx_PyObject_GetAttrStr(__pyx_t_44, __pyx_n_s_empty); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __pyx_t_44 = __Pyx_PyInt_From_npy_long(__pyx_v_I); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_38))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_38); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_45))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_45); if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_45); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_38, function); + __Pyx_DECREF_SET(__pyx_t_45, function); } } if (!__pyx_t_4) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_38, __pyx_t_37); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_45, __pyx_t_44); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_38)) { - PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_37}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_38, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) + if (PyFunction_Check(__pyx_t_45)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_44}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_45, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_38)) { - PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_37}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_38, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) + if (__Pyx_PyFastCFunction_Check(__pyx_t_45)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_44}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_45, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __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_37); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_37); - __pyx_t_37 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_38, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_44); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_44); + __pyx_t_44 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_45, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 155, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_3); { @@ -4918,42 +5018,42 @@ * thetaleft = np.empty(I) * thetaleft.fill(p1[2]) # <<<<<<<<<<<<<< * thetaright = np.empty(I) - * thetaleft.fill(p2[2]) + * thetaright.fill(p2[2]) */ - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_thetaleft), __pyx_n_s_fill); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __pyx_t_43 = 2; - __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_p1.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_45 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_thetaleft), __pyx_n_s_fill); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __pyx_t_50 = 2; + __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_p1.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_37 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_38))) { - __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_38); - if (likely(__pyx_t_37)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); - __Pyx_INCREF(__pyx_t_37); + __pyx_t_44 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_45))) { + __pyx_t_44 = PyMethod_GET_SELF(__pyx_t_45); + if (likely(__pyx_t_44)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_45); + __Pyx_INCREF(__pyx_t_44); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_38, function); + __Pyx_DECREF_SET(__pyx_t_45, function); } } - if (!__pyx_t_37) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_38, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error) + if (!__pyx_t_44) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_45, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __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_38)) { - PyObject *__pyx_temp[2] = {__pyx_t_37, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_38, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; + if (PyFunction_Check(__pyx_t_45)) { + PyObject *__pyx_temp[2] = {__pyx_t_44, __pyx_t_5}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_45, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_44); __pyx_t_44 = 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_38)) { - PyObject *__pyx_temp[2] = {__pyx_t_37, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_38, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_45)) { + PyObject *__pyx_temp[2] = {__pyx_t_44, __pyx_t_5}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_45, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else @@ -4961,32 +5061,32 @@ { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_37); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_37); __pyx_t_37 = NULL; + __Pyx_GIVEREF(__pyx_t_44); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_44); __pyx_t_44 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_38, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_45, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":157 * thetaleft = np.empty(I) * thetaleft.fill(p1[2]) * thetaright = np.empty(I) # <<<<<<<<<<<<<< - * thetaleft.fill(p2[2]) + * thetaright.fill(p2[2]) * else: */ - __pyx_t_38 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_38, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_45 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_45, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __pyx_t_38 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __pyx_t_45 = __Pyx_PyInt_From_npy_long(__pyx_v_I); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); @@ -4998,38 +5098,38 @@ } } if (!__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_38); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_45); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_38}; + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_45}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_38}; + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_45}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; } else #endif { - __pyx_t_37 = PyTuple_New(1+1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_38); - PyTuple_SET_ITEM(__pyx_t_37, 0+1, __pyx_t_38); - __pyx_t_38 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_44 = PyTuple_New(1+1); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_45); + PyTuple_SET_ITEM(__pyx_t_44, 0+1, __pyx_t_45); + __pyx_t_45 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5058,55 +5158,55 @@ /* "yt/utilities/lib/alt_ray_tracers.pyx":158 * thetaleft.fill(p1[2]) * thetaright = np.empty(I) - * thetaleft.fill(p2[2]) # <<<<<<<<<<<<<< + * thetaright.fill(p2[2]) # <<<<<<<<<<<<<< * else: * rleft = rleft[inds] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_thetaleft), __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_thetaright), __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_44 = 2; - __pyx_t_37 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p2.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_p2.diminfo[0].strides))); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_38 = NULL; + __pyx_t_51 = 2; + __pyx_t_44 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p2.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_p2.diminfo[0].strides))); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_45 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_38)) { + __pyx_t_45 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_45)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_38); + __Pyx_INCREF(__pyx_t_45); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } - if (!__pyx_t_38) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_37); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + if (!__pyx_t_45) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_44); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_t_37}; + PyObject *__pyx_temp[2] = {__pyx_t_45, __pyx_t_44}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_XDECREF(__pyx_t_45); __pyx_t_45 = 0; __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_t_37}; + PyObject *__pyx_temp[2] = {__pyx_t_45, __pyx_t_44}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_XDECREF(__pyx_t_45); __pyx_t_45 = 0; __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_38); __pyx_t_38 = NULL; - __Pyx_GIVEREF(__pyx_t_37); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_37); - __pyx_t_37 = 0; + __Pyx_GIVEREF(__pyx_t_45); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_45); __pyx_t_45 = NULL; + __Pyx_GIVEREF(__pyx_t_44); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_44); + __pyx_t_44 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -5126,7 +5226,7 @@ } /* "yt/utilities/lib/alt_ray_tracers.pyx":160 - * thetaleft.fill(p2[2]) + * thetaright.fill(p2[2]) * else: * rleft = rleft[inds] # <<<<<<<<<<<<<< * rright = rright[inds] @@ -5262,20 +5362,20 @@ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arctan2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_45 = 1; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_52 = 1; + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_37 = PyObject_GetItem(((PyObject *)__pyx_v_tmleft), ((PyObject *)__pyx_v_inds)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_46 = 1; - __pyx_t_38 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_37, __pyx_t_38); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_44 = PyObject_GetItem(((PyObject *)__pyx_v_tmleft), ((PyObject *)__pyx_v_inds)); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_53 = 1; + __pyx_t_45 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_44, __pyx_t_45); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __pyx_t_38 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __pyx_t_45 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5286,20 +5386,20 @@ * nans = np.isnan(thetaleft) * thetaleft[nans] = np.arctan2((p1cart[1] + tpleft[inds[nans]]*dpcart[1]), */ - __pyx_t_47 = 0; - __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_54 = 0; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_tmleft), ((PyObject *)__pyx_v_inds)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_48 = 0; - __pyx_t_37 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_37); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_55 = 0; + __pyx_t_44 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_44); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __pyx_t_44 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -5316,22 +5416,22 @@ } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_38, __pyx_t_37}; + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_45, __pyx_t_44}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_38, __pyx_t_37}; + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_45, __pyx_t_44}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } else #endif { @@ -5340,12 +5440,12 @@ if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL; } - __Pyx_GIVEREF(__pyx_t_38); - PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_t_38); - __Pyx_GIVEREF(__pyx_t_37); - PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_t_37); - __pyx_t_38 = 0; - __pyx_t_37 = 0; + __Pyx_GIVEREF(__pyx_t_45); + PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_t_45); + __Pyx_GIVEREF(__pyx_t_44); + PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_t_44); + __pyx_t_45 = 0; + __pyx_t_44 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5424,15 +5524,15 @@ } else #endif { - __pyx_t_37 = PyTuple_New(1+1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_5); __pyx_t_5 = NULL; + __pyx_t_44 = PyTuple_New(1+1); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_thetaleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_thetaleft)); - PyTuple_SET_ITEM(__pyx_t_37, 0+1, ((PyObject *)__pyx_v_thetaleft)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_44, 0+1, ((PyObject *)__pyx_v_thetaleft)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5448,23 +5548,23 @@ */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arctan2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); + __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arctan2); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_49 = 1; - __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_56 = 1; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_inds), __pyx_v_nans); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_38 = PyObject_GetItem(((PyObject *)__pyx_v_tpleft), __pyx_t_5); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_45 = PyObject_GetItem(((PyObject *)__pyx_v_tpleft), __pyx_t_5); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_50 = 1; - __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_57 = 1; + __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_38, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_t_45, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -5478,20 +5578,20 @@ * thetaright = np.arctan2((p1cart[1] + tmright[inds]*dpcart[1]), * (p1cart[0] + tmright[inds]*dpcart[0])) */ - __pyx_t_51 = 0; - __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_58 = 0; + __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_inds), __pyx_v_nans); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_38 = PyObject_GetItem(((PyObject *)__pyx_v_tpleft), __pyx_t_1); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_45 = PyObject_GetItem(((PyObject *)__pyx_v_tpleft), __pyx_t_1); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_52 = 0; - __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_59 = 0; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_38, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_45, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5499,20 +5599,20 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_37))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_37); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_44))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_44); if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_44); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_37, function); + __Pyx_DECREF_SET(__pyx_t_44, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_37)) { + if (PyFunction_Check(__pyx_t_44)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_t_1}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_37, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_44, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -5520,9 +5620,9 @@ } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_37)) { + if (__Pyx_PyFastCFunction_Check(__pyx_t_44)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_t_1}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_37, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_44, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -5541,11 +5641,11 @@ PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_7, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_37, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_44, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":169 * (p1cart[0] + tmleft[inds]*dpcart[0])) @@ -5564,26 +5664,26 @@ * (p1cart[0] + tmright[inds]*dpcart[0])) * nans = np.isnan(thetaright) */ - __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_arctan2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_44 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_44, __pyx_n_s_arctan2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_53 = 1; - __pyx_t_37 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __pyx_t_60 = 1; + __pyx_t_44 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_tmright), ((PyObject *)__pyx_v_inds)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_54 = 1; - __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_61 = 1; + __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_37, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_44, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":172 @@ -5593,29 +5693,29 @@ * nans = np.isnan(thetaright) * thetaright[nans] = np.arctan2((p1cart[1] + tpright[inds[nans]]*dpcart[1]), */ - __pyx_t_55 = 0; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_62 = 0; + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_37 = PyObject_GetItem(((PyObject *)__pyx_v_tmright), ((PyObject *)__pyx_v_inds)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_56 = 0; - __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_44 = PyObject_GetItem(((PyObject *)__pyx_v_tmright), ((PyObject *)__pyx_v_inds)); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_63 = 0; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_38 = PyNumber_Multiply(__pyx_t_37, __pyx_t_1); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __pyx_t_45 = PyNumber_Multiply(__pyx_t_44, __pyx_t_1); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_38); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_45); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __pyx_t_38 = NULL; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __pyx_t_45 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_38)) { + __pyx_t_45 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_45)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_38); + __Pyx_INCREF(__pyx_t_45); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; @@ -5623,9 +5723,9 @@ } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_38, __pyx_t_5, __pyx_t_1}; + PyObject *__pyx_temp[3] = {__pyx_t_45, __pyx_t_5, __pyx_t_1}; __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, 171, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_XDECREF(__pyx_t_45); __pyx_t_45 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5633,9 +5733,9 @@ #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_38, __pyx_t_5, __pyx_t_1}; + PyObject *__pyx_temp[3] = {__pyx_t_45, __pyx_t_5, __pyx_t_1}; __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, 171, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_XDECREF(__pyx_t_45); __pyx_t_45 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5644,8 +5744,8 @@ { __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_38) { - __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_38); __pyx_t_38 = NULL; + if (__pyx_t_45) { + __Pyx_GIVEREF(__pyx_t_45); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_45); __pyx_t_45 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_t_5); @@ -5758,25 +5858,25 @@ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arctan2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_57 = 1; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_64 = 1; + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_inds), __pyx_v_nans); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_tpright), __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_58 = 1; - __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_65 = 1; + __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_65, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_38 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_45 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_38); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_45); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":175 * nans = np.isnan(thetaright) @@ -5785,32 +5885,32 @@ * * # Set up the cell boundary arrays */ - __pyx_t_59 = 0; - __pyx_t_38 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_66 = 0; + __pyx_t_45 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p1cart.rcbuffer->pybuffer.buf, __pyx_t_66, __pyx_pybuffernd_p1cart.diminfo[0].strides))); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_inds), __pyx_v_nans); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_tpright), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_60 = 0; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_67 = 0; + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dpcart.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_dpcart.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_37 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); + __pyx_t_44 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_38, __pyx_t_37); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_45, __pyx_t_44); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = NULL; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __pyx_t_44 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_37)) { + __pyx_t_44 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_44)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_37); + __Pyx_INCREF(__pyx_t_44); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; @@ -5818,9 +5918,9 @@ } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[3] = {__pyx_t_37, __pyx_t_2, __pyx_t_4}; + PyObject *__pyx_temp[3] = {__pyx_t_44, __pyx_t_2, __pyx_t_4}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_XDECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5828,29 +5928,29 @@ #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[3] = {__pyx_t_37, __pyx_t_2, __pyx_t_4}; + PyObject *__pyx_temp[3] = {__pyx_t_44, __pyx_t_2, __pyx_t_4}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_XDECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_38 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - if (__pyx_t_37) { - __Pyx_GIVEREF(__pyx_t_37); PyTuple_SET_ITEM(__pyx_t_38, 0, __pyx_t_37); __pyx_t_37 = NULL; + __pyx_t_45 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + if (__pyx_t_44) { + __Pyx_GIVEREF(__pyx_t_44); PyTuple_SET_ITEM(__pyx_t_45, 0, __pyx_t_44); __pyx_t_44 = NULL; } __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_38, 0+__pyx_t_7, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_45, 0+__pyx_t_7, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_38, 1+__pyx_t_7, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_45, 1+__pyx_t_7, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5897,17 +5997,17 @@ * [rleft, zleft, thetaleft], * [rright, zleft, thetaright], */ - __pyx_t_38 = PyList_New(3); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_45 = PyList_New(3); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __Pyx_INCREF(((PyObject *)__pyx_v_rleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rleft)); - PyList_SET_ITEM(__pyx_t_38, 0, ((PyObject *)__pyx_v_rleft)); + PyList_SET_ITEM(__pyx_t_45, 0, ((PyObject *)__pyx_v_rleft)); __Pyx_INCREF(((PyObject *)__pyx_v_zleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_zleft)); - PyList_SET_ITEM(__pyx_t_38, 1, ((PyObject *)__pyx_v_zleft)); + PyList_SET_ITEM(__pyx_t_45, 1, ((PyObject *)__pyx_v_zleft)); __Pyx_INCREF(((PyObject *)__pyx_v_thetaleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_thetaleft)); - PyList_SET_ITEM(__pyx_t_38, 2, ((PyObject *)__pyx_v_thetaleft)); + PyList_SET_ITEM(__pyx_t_45, 2, ((PyObject *)__pyx_v_thetaleft)); /* "yt/utilities/lib/alt_ray_tracers.pyx":180 * b1 = np.concatenate([[rleft, zright, thetaleft], @@ -5954,17 +6054,17 @@ * [rright, zright, thetaleft], * [rleft, zright, thetaleft], */ - __pyx_t_37 = PyList_New(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); + __pyx_t_44 = PyList_New(3); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); __Pyx_INCREF(((PyObject *)__pyx_v_rleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rleft)); - PyList_SET_ITEM(__pyx_t_37, 0, ((PyObject *)__pyx_v_rleft)); + PyList_SET_ITEM(__pyx_t_44, 0, ((PyObject *)__pyx_v_rleft)); __Pyx_INCREF(((PyObject *)__pyx_v_zleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_zleft)); - PyList_SET_ITEM(__pyx_t_37, 1, ((PyObject *)__pyx_v_zleft)); + PyList_SET_ITEM(__pyx_t_44, 1, ((PyObject *)__pyx_v_zleft)); __Pyx_INCREF(((PyObject *)__pyx_v_thetaleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_thetaleft)); - PyList_SET_ITEM(__pyx_t_37, 2, ((PyObject *)__pyx_v_thetaleft)); + PyList_SET_ITEM(__pyx_t_44, 2, ((PyObject *)__pyx_v_thetaleft)); /* "yt/utilities/lib/alt_ray_tracers.pyx":183 * [rright, zleft, thetaright], @@ -5992,17 +6092,17 @@ * [rright, zleft, thetaleft], * ], axis=1).T */ - __pyx_t_31 = PyList_New(3); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); + __pyx_t_38 = PyList_New(3); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); __Pyx_INCREF(((PyObject *)__pyx_v_rleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rleft)); - PyList_SET_ITEM(__pyx_t_31, 0, ((PyObject *)__pyx_v_rleft)); + PyList_SET_ITEM(__pyx_t_38, 0, ((PyObject *)__pyx_v_rleft)); __Pyx_INCREF(((PyObject *)__pyx_v_zright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_zright)); - PyList_SET_ITEM(__pyx_t_31, 1, ((PyObject *)__pyx_v_zright)); + PyList_SET_ITEM(__pyx_t_38, 1, ((PyObject *)__pyx_v_zright)); __Pyx_INCREF(((PyObject *)__pyx_v_thetaleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_thetaleft)); - PyList_SET_ITEM(__pyx_t_31, 2, ((PyObject *)__pyx_v_thetaleft)); + PyList_SET_ITEM(__pyx_t_38, 2, ((PyObject *)__pyx_v_thetaleft)); /* "yt/utilities/lib/alt_ray_tracers.pyx":185 * [rright, zright, thetaleft], @@ -6011,17 +6111,17 @@ * ], axis=1).T * */ - __pyx_t_36 = PyList_New(3); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); + __pyx_t_43 = PyList_New(3); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); __Pyx_INCREF(((PyObject *)__pyx_v_rright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rright)); - PyList_SET_ITEM(__pyx_t_36, 0, ((PyObject *)__pyx_v_rright)); + PyList_SET_ITEM(__pyx_t_43, 0, ((PyObject *)__pyx_v_rright)); __Pyx_INCREF(((PyObject *)__pyx_v_zleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_zleft)); - PyList_SET_ITEM(__pyx_t_36, 1, ((PyObject *)__pyx_v_zleft)); + PyList_SET_ITEM(__pyx_t_43, 1, ((PyObject *)__pyx_v_zleft)); __Pyx_INCREF(((PyObject *)__pyx_v_thetaleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_thetaleft)); - PyList_SET_ITEM(__pyx_t_36, 2, ((PyObject *)__pyx_v_thetaleft)); + PyList_SET_ITEM(__pyx_t_43, 2, ((PyObject *)__pyx_v_thetaleft)); /* "yt/utilities/lib/alt_ray_tracers.pyx":178 * @@ -6030,37 +6130,37 @@ * [rleft, zleft, thetaleft], * [rleft, zleft, thetaleft], */ - __pyx_t_40 = PyList_New(8); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_40); + __pyx_t_47 = PyList_New(8); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_47); __Pyx_GIVEREF(__pyx_t_3); - PyList_SET_ITEM(__pyx_t_40, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_38); - PyList_SET_ITEM(__pyx_t_40, 1, __pyx_t_38); + PyList_SET_ITEM(__pyx_t_47, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_45); + PyList_SET_ITEM(__pyx_t_47, 1, __pyx_t_45); __Pyx_GIVEREF(__pyx_t_4); - PyList_SET_ITEM(__pyx_t_40, 2, __pyx_t_4); + PyList_SET_ITEM(__pyx_t_47, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); - PyList_SET_ITEM(__pyx_t_40, 3, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_37); - PyList_SET_ITEM(__pyx_t_40, 4, __pyx_t_37); + PyList_SET_ITEM(__pyx_t_47, 3, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_44); + PyList_SET_ITEM(__pyx_t_47, 4, __pyx_t_44); __Pyx_GIVEREF(__pyx_t_5); - PyList_SET_ITEM(__pyx_t_40, 5, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_31); - PyList_SET_ITEM(__pyx_t_40, 6, __pyx_t_31); - __Pyx_GIVEREF(__pyx_t_36); - PyList_SET_ITEM(__pyx_t_40, 7, __pyx_t_36); + PyList_SET_ITEM(__pyx_t_47, 5, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_38); + PyList_SET_ITEM(__pyx_t_47, 6, __pyx_t_38); + __Pyx_GIVEREF(__pyx_t_43); + PyList_SET_ITEM(__pyx_t_47, 7, __pyx_t_43); __pyx_t_3 = 0; - __pyx_t_38 = 0; + __pyx_t_45 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; - __pyx_t_37 = 0; + __pyx_t_44 = 0; __pyx_t_5 = 0; - __pyx_t_31 = 0; - __pyx_t_36 = 0; - __pyx_t_36 = PyTuple_New(1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); - __Pyx_GIVEREF(__pyx_t_40); - PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_40); - __pyx_t_40 = 0; + __pyx_t_38 = 0; + __pyx_t_43 = 0; + __pyx_t_43 = PyTuple_New(1); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); + __Pyx_GIVEREF(__pyx_t_47); + PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_t_47); + __pyx_t_47 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":186 * [rleft, zright, thetaleft], @@ -6069,9 +6169,9 @@ * * b2 = np.concatenate([[rright, zright, thetaright], */ - __pyx_t_40 = PyDict_New(); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_40); - if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_47 = PyDict_New(); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_47); + if (PyDict_SetItem(__pyx_t_47, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 186, __pyx_L1_error) /* "yt/utilities/lib/alt_ray_tracers.pyx":178 * @@ -6080,11 +6180,11 @@ * [rleft, zleft, thetaleft], * [rleft, zleft, thetaleft], */ - __pyx_t_31 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_36, __pyx_t_40); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); + __pyx_t_38 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_43, __pyx_t_47); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":186 * [rleft, zright, thetaleft], @@ -6093,11 +6193,11 @@ * * b2 = np.concatenate([[rright, zright, thetaright], */ - __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_31, __pyx_n_s_T); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_40); - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; - if (!(likely(((__pyx_t_40) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_40, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 186, __pyx_L1_error) - __pyx_t_6 = ((PyArrayObject *)__pyx_t_40); + __pyx_t_47 = __Pyx_PyObject_GetAttrStr(__pyx_t_38, __pyx_n_s_T); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_47); + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + if (!(likely(((__pyx_t_47) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_47, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_47); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_b1.rcbuffer->pybuffer); @@ -6115,8 +6215,8 @@ if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 178, __pyx_L1_error) } __pyx_t_6 = 0; - __pyx_v_b1 = ((PyArrayObject *)__pyx_t_40); - __pyx_t_40 = 0; + __pyx_v_b1 = ((PyArrayObject *)__pyx_t_47); + __pyx_t_47 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":188 * ], axis=1).T @@ -6125,22 +6225,22 @@ * [rright, zleft, thetaright], * [rleft, zright, thetaleft], */ - __pyx_t_40 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_40); - __pyx_t_31 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); - __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0; - __pyx_t_40 = PyList_New(3); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_40); + __pyx_t_47 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_47); + __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_47, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0; + __pyx_t_47 = PyList_New(3); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_47); __Pyx_INCREF(((PyObject *)__pyx_v_rright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rright)); - PyList_SET_ITEM(__pyx_t_40, 0, ((PyObject *)__pyx_v_rright)); + PyList_SET_ITEM(__pyx_t_47, 0, ((PyObject *)__pyx_v_rright)); __Pyx_INCREF(((PyObject *)__pyx_v_zright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_zright)); - PyList_SET_ITEM(__pyx_t_40, 1, ((PyObject *)__pyx_v_zright)); + PyList_SET_ITEM(__pyx_t_47, 1, ((PyObject *)__pyx_v_zright)); __Pyx_INCREF(((PyObject *)__pyx_v_thetaright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_thetaright)); - PyList_SET_ITEM(__pyx_t_40, 2, ((PyObject *)__pyx_v_thetaright)); + PyList_SET_ITEM(__pyx_t_47, 2, ((PyObject *)__pyx_v_thetaright)); /* "yt/utilities/lib/alt_ray_tracers.pyx":189 * @@ -6149,17 +6249,17 @@ * [rleft, zright, thetaleft], * [rright, zright, thetaright], */ - __pyx_t_36 = PyList_New(3); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); + __pyx_t_43 = PyList_New(3); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); __Pyx_INCREF(((PyObject *)__pyx_v_rright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rright)); - PyList_SET_ITEM(__pyx_t_36, 0, ((PyObject *)__pyx_v_rright)); + PyList_SET_ITEM(__pyx_t_43, 0, ((PyObject *)__pyx_v_rright)); __Pyx_INCREF(((PyObject *)__pyx_v_zleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_zleft)); - PyList_SET_ITEM(__pyx_t_36, 1, ((PyObject *)__pyx_v_zleft)); + PyList_SET_ITEM(__pyx_t_43, 1, ((PyObject *)__pyx_v_zleft)); __Pyx_INCREF(((PyObject *)__pyx_v_thetaright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_thetaright)); - PyList_SET_ITEM(__pyx_t_36, 2, ((PyObject *)__pyx_v_thetaright)); + PyList_SET_ITEM(__pyx_t_43, 2, ((PyObject *)__pyx_v_thetaright)); /* "yt/utilities/lib/alt_ray_tracers.pyx":190 * b2 = np.concatenate([[rright, zright, thetaright], @@ -6206,17 +6306,17 @@ * [rright, zright, thetaright], * [rleft, zright, thetaright], */ - __pyx_t_37 = PyList_New(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); + __pyx_t_44 = PyList_New(3); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); __Pyx_INCREF(((PyObject *)__pyx_v_rleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rleft)); - PyList_SET_ITEM(__pyx_t_37, 0, ((PyObject *)__pyx_v_rleft)); + PyList_SET_ITEM(__pyx_t_44, 0, ((PyObject *)__pyx_v_rleft)); __Pyx_INCREF(((PyObject *)__pyx_v_zleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_zleft)); - PyList_SET_ITEM(__pyx_t_37, 1, ((PyObject *)__pyx_v_zleft)); + PyList_SET_ITEM(__pyx_t_44, 1, ((PyObject *)__pyx_v_zleft)); __Pyx_INCREF(((PyObject *)__pyx_v_thetaright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_thetaright)); - PyList_SET_ITEM(__pyx_t_37, 2, ((PyObject *)__pyx_v_thetaright)); + PyList_SET_ITEM(__pyx_t_44, 2, ((PyObject *)__pyx_v_thetaright)); /* "yt/utilities/lib/alt_ray_tracers.pyx":193 * [rright, zright, thetaright], @@ -6263,17 +6363,17 @@ * ], axis=1).T * */ - __pyx_t_38 = PyList_New(3); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_45 = PyList_New(3); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __Pyx_INCREF(((PyObject *)__pyx_v_rright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rright)); - PyList_SET_ITEM(__pyx_t_38, 0, ((PyObject *)__pyx_v_rright)); + PyList_SET_ITEM(__pyx_t_45, 0, ((PyObject *)__pyx_v_rright)); __Pyx_INCREF(((PyObject *)__pyx_v_zleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_zleft)); - PyList_SET_ITEM(__pyx_t_38, 1, ((PyObject *)__pyx_v_zleft)); + PyList_SET_ITEM(__pyx_t_45, 1, ((PyObject *)__pyx_v_zleft)); __Pyx_INCREF(((PyObject *)__pyx_v_thetaright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_thetaright)); - PyList_SET_ITEM(__pyx_t_38, 2, ((PyObject *)__pyx_v_thetaright)); + PyList_SET_ITEM(__pyx_t_45, 2, ((PyObject *)__pyx_v_thetaright)); /* "yt/utilities/lib/alt_ray_tracers.pyx":188 * ], axis=1).T @@ -6284,34 +6384,34 @@ */ __pyx_t_3 = PyList_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_40); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_40); - __Pyx_GIVEREF(__pyx_t_36); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_36); + __Pyx_GIVEREF(__pyx_t_47); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_47); + __Pyx_GIVEREF(__pyx_t_43); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_43); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyList_SET_ITEM(__pyx_t_3, 3, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_37); - PyList_SET_ITEM(__pyx_t_3, 4, __pyx_t_37); + __Pyx_GIVEREF(__pyx_t_44); + PyList_SET_ITEM(__pyx_t_3, 4, __pyx_t_44); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_3, 5, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_3, 6, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_38); - PyList_SET_ITEM(__pyx_t_3, 7, __pyx_t_38); - __pyx_t_40 = 0; - __pyx_t_36 = 0; + __Pyx_GIVEREF(__pyx_t_45); + PyList_SET_ITEM(__pyx_t_3, 7, __pyx_t_45); + __pyx_t_47 = 0; + __pyx_t_43 = 0; __pyx_t_1 = 0; __pyx_t_5 = 0; - __pyx_t_37 = 0; + __pyx_t_44 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; - __pyx_t_38 = 0; - __pyx_t_38 = PyTuple_New(1); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_45 = 0; + __pyx_t_45 = PyTuple_New(1); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_38, 0, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_45, 0, __pyx_t_3); __pyx_t_3 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":196 @@ -6332,10 +6432,10 @@ * [rright, zleft, thetaright], * [rleft, zright, thetaleft], */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_31, __pyx_t_38, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_38, __pyx_t_45, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":196 @@ -6379,8 +6479,8 @@ */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_45 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyList_New(8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -6408,35 +6508,35 @@ __Pyx_INCREF(((PyObject *)__pyx_v_inds)); __Pyx_GIVEREF(((PyObject *)__pyx_v_inds)); PyList_SET_ITEM(__pyx_t_4, 7, ((PyObject *)__pyx_v_inds)); - __pyx_t_31 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_38))) { - __pyx_t_31 = PyMethod_GET_SELF(__pyx_t_38); - if (likely(__pyx_t_31)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); - __Pyx_INCREF(__pyx_t_31); + __pyx_t_38 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_45))) { + __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_45); + if (likely(__pyx_t_38)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_45); + __Pyx_INCREF(__pyx_t_38); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_38, function); + __Pyx_DECREF_SET(__pyx_t_45, function); } } - if (!__pyx_t_31) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_38, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) + if (!__pyx_t_38) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_45, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __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_38)) { - PyObject *__pyx_temp[2] = {__pyx_t_31, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_38, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0; + if (PyFunction_Check(__pyx_t_45)) { + PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_45, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 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_38)) { - PyObject *__pyx_temp[2] = {__pyx_t_31, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_38, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_45)) { + PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_45, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else @@ -6444,22 +6544,22 @@ { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_31); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_31); __pyx_t_31 = NULL; + __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_38); __pyx_t_38 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_38, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_45, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 198, __pyx_L1_error) - __pyx_t_41 = ((PyArrayObject *)__pyx_t_3); + __pyx_t_48 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_41, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { @@ -6472,7 +6572,7 @@ __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0]; if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 198, __pyx_L1_error) } - __pyx_t_41 = 0; + __pyx_t_48 = 0; __Pyx_DECREF_SET(__pyx_v_inds, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; @@ -6481,127 +6581,127 @@ * # find intersections and compute return values * tsect, dsect = _cart_intersect(p1cart, p2cart, _cyl2cart(b1), _cyl2cart(b2)) # <<<<<<<<<<<<<< * tmask = np.logical_and(0.0<=tsect, tsect<=1.0) - * tsect, tinds = np.unique(tsect[tmask], return_index=True) + * ret = np.unique(tsect[tmask], return_index=True) */ - __pyx_t_38 = __Pyx_GetModuleGlobalName(__pyx_n_s_cart_intersect); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_45 = __Pyx_GetModuleGlobalName(__pyx_n_s_cart_intersect); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_cyl2cart); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_31 = NULL; + __pyx_t_38 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_31 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_31)) { + __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_38)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_31); + __Pyx_INCREF(__pyx_t_38); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } - if (!__pyx_t_31) { + if (!__pyx_t_38) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_b1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __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_31, ((PyObject *)__pyx_v_b1)}; + PyObject *__pyx_temp[2] = {__pyx_t_38, ((PyObject *)__pyx_v_b1)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 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_31, ((PyObject *)__pyx_v_b1)}; + PyObject *__pyx_temp[2] = {__pyx_t_38, ((PyObject *)__pyx_v_b1)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_37 = PyTuple_New(1+1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_GIVEREF(__pyx_t_31); PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_31); __pyx_t_31 = NULL; + __pyx_t_44 = PyTuple_New(1+1); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_t_38); __pyx_t_38 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_b1)); __Pyx_GIVEREF(((PyObject *)__pyx_v_b1)); - PyTuple_SET_ITEM(__pyx_t_37, 0+1, ((PyObject *)__pyx_v_b1)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_44, 0+1, ((PyObject *)__pyx_v_b1)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_cyl2cart); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_31 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_37))) { - __pyx_t_31 = PyMethod_GET_SELF(__pyx_t_37); - if (likely(__pyx_t_31)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37); - __Pyx_INCREF(__pyx_t_31); + __pyx_t_44 = __Pyx_GetModuleGlobalName(__pyx_n_s_cyl2cart); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_38 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_44))) { + __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_44); + if (likely(__pyx_t_38)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_44); + __Pyx_INCREF(__pyx_t_38); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_37, function); + __Pyx_DECREF_SET(__pyx_t_44, function); } } - if (!__pyx_t_31) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_37, ((PyObject *)__pyx_v_b2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) + if (!__pyx_t_38) { + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_44, ((PyObject *)__pyx_v_b2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_37)) { - PyObject *__pyx_temp[2] = {__pyx_t_31, ((PyObject *)__pyx_v_b2)}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_37, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0; + if (PyFunction_Check(__pyx_t_44)) { + PyObject *__pyx_temp[2] = {__pyx_t_38, ((PyObject *)__pyx_v_b2)}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_44, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_37)) { - PyObject *__pyx_temp[2] = {__pyx_t_31, ((PyObject *)__pyx_v_b2)}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_37, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_44)) { + PyObject *__pyx_temp[2] = {__pyx_t_38, ((PyObject *)__pyx_v_b2)}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_44, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_31); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_31); __pyx_t_31 = NULL; + __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_38); __pyx_t_38 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_b2)); __Pyx_GIVEREF(((PyObject *)__pyx_v_b2)); PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_b2)); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_37, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_44, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = NULL; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __pyx_t_44 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_38))) { - __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_38); - if (likely(__pyx_t_37)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); - __Pyx_INCREF(__pyx_t_37); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_45))) { + __pyx_t_44 = PyMethod_GET_SELF(__pyx_t_45); + if (likely(__pyx_t_44)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_45); + __Pyx_INCREF(__pyx_t_44); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_38, function); + __Pyx_DECREF_SET(__pyx_t_45, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_38)) { - PyObject *__pyx_temp[5] = {__pyx_t_37, ((PyObject *)__pyx_v_p1cart), ((PyObject *)__pyx_v_p2cart), __pyx_t_2, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_38, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; + if (PyFunction_Check(__pyx_t_45)) { + PyObject *__pyx_temp[5] = {__pyx_t_44, ((PyObject *)__pyx_v_p1cart), ((PyObject *)__pyx_v_p2cart), __pyx_t_2, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_45, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_38)) { - PyObject *__pyx_temp[5] = {__pyx_t_37, ((PyObject *)__pyx_v_p1cart), ((PyObject *)__pyx_v_p2cart), __pyx_t_2, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_38, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_45)) { + PyObject *__pyx_temp[5] = {__pyx_t_44, ((PyObject *)__pyx_v_p1cart), ((PyObject *)__pyx_v_p2cart), __pyx_t_2, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_45, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6610,8 +6710,8 @@ { __pyx_t_5 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_37) { - __Pyx_GIVEREF(__pyx_t_37); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_37); __pyx_t_37 = NULL; + if (__pyx_t_44) { + __Pyx_GIVEREF(__pyx_t_44); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_44); __pyx_t_44 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_p1cart)); __Pyx_GIVEREF(((PyObject *)__pyx_v_p1cart)); @@ -6625,11 +6725,11 @@ PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_7, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_38, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_45, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; #if !CYTHON_COMPILING_IN_PYPY @@ -6644,17 +6744,17 @@ } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_38 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_45 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_38 = PyList_GET_ITEM(sequence, 0); + __pyx_t_45 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_38); + __Pyx_INCREF(__pyx_t_45); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_38 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_45 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif @@ -6664,25 +6764,25 @@ __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_61 = Py_TYPE(__pyx_t_4)->tp_iternext; - index = 0; __pyx_t_38 = __pyx_t_61(__pyx_t_4); if (unlikely(!__pyx_t_38)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_38); - index = 1; __pyx_t_5 = __pyx_t_61(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; + __pyx_t_68 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_45 = __pyx_t_68(__pyx_t_4); if (unlikely(!__pyx_t_45)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_45); + index = 1; __pyx_t_5 = __pyx_t_68(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_61(__pyx_t_4), 2) < 0) __PYX_ERR(0, 201, __pyx_L1_error) - __pyx_t_61 = NULL; + if (__Pyx_IternextUnpackEndCheck(__pyx_t_68(__pyx_t_4), 2) < 0) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_68 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_61 = NULL; + __pyx_t_68 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 201, __pyx_L1_error) __pyx_L7_unpacking_done:; } - if (!(likely(((__pyx_t_38) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_38, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 201, __pyx_L1_error) + if (!(likely(((__pyx_t_45) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_45, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 201, __pyx_L1_error) if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 201, __pyx_L1_error) - __pyx_t_11 = ((PyArrayObject *)__pyx_t_38); + __pyx_t_11 = ((PyArrayObject *)__pyx_t_45); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tsect.rcbuffer->pybuffer); @@ -6700,8 +6800,8 @@ if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 201, __pyx_L1_error) } __pyx_t_11 = 0; - __pyx_v_tsect = ((PyArrayObject *)__pyx_t_38); - __pyx_t_38 = 0; + __pyx_v_tsect = ((PyArrayObject *)__pyx_t_45); + __pyx_t_45 = 0; __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6727,32 +6827,32 @@ * # find intersections and compute return values * tsect, dsect = _cart_intersect(p1cart, p2cart, _cyl2cart(b1), _cyl2cart(b2)) * tmask = np.logical_and(0.0<=tsect, tsect<=1.0) # <<<<<<<<<<<<<< - * tsect, tinds = np.unique(tsect[tmask], return_index=True) - * inds = inds[tmask][tinds] + * ret = np.unique(tsect[tmask], return_index=True) + * tsect, tinds = ret[0], ret[1].astype('int64') */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_45 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_RichCompare(__pyx_float_0_0, ((PyObject *)__pyx_v_tsect), Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_tsect), __pyx_float_1_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) __pyx_t_2 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_38))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_38); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_45))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_45); if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_45); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_38, function); + __Pyx_DECREF_SET(__pyx_t_45, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_38)) { + if (PyFunction_Check(__pyx_t_45)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_38, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_45, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -6760,9 +6860,9 @@ } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_38)) { + if (__Pyx_PyFastCFunction_Check(__pyx_t_45)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_38, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_45, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -6770,129 +6870,99 @@ } else #endif { - __pyx_t_37 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); + __pyx_t_44 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); if (__pyx_t_2) { - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_37, 0+__pyx_t_7, __pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_44, 0+__pyx_t_7, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_37, 1+__pyx_t_7, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_44, 1+__pyx_t_7, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_38, __pyx_t_37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_45, __pyx_t_44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; __pyx_v_tmask = __pyx_t_3; __pyx_t_3 = 0; /* "yt/utilities/lib/alt_ray_tracers.pyx":203 * tsect, dsect = _cart_intersect(p1cart, p2cart, _cyl2cart(b1), _cyl2cart(b2)) * tmask = np.logical_and(0.0<=tsect, tsect<=1.0) - * tsect, tinds = np.unique(tsect[tmask], return_index=True) # <<<<<<<<<<<<<< + * ret = np.unique(tsect[tmask], return_index=True) # <<<<<<<<<<<<<< + * tsect, tinds = ret[0], ret[1].astype('int64') * inds = inds[tmask][tinds] - * xyz = dsect[tmask][tinds] */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_unique); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_45 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_unique); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_tsect), __pyx_v_tmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_37 = PyTuple_New(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); + __pyx_t_44 = PyTuple_New(1); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return_index, Py_True) < 0) __PYX_ERR(0, 203, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_38, __pyx_t_37, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_45, __pyx_t_44, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 203, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_37 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_37 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_37); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_37 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_38 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_61 = Py_TYPE(__pyx_t_38)->tp_iternext; - index = 0; __pyx_t_3 = __pyx_t_61(__pyx_t_38); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_37 = __pyx_t_61(__pyx_t_38); if (unlikely(!__pyx_t_37)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_37); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_61(__pyx_t_38), 2) < 0) __PYX_ERR(0, 203, __pyx_L1_error) - __pyx_t_61 = NULL; - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - goto __pyx_L9_unpacking_done; - __pyx_L8_unpacking_failed:; - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __pyx_t_61 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 203, __pyx_L1_error) - __pyx_L9_unpacking_done:; - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 203, __pyx_L1_error) - if (!(likely(((__pyx_t_37) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_37, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 203, __pyx_L1_error) - __pyx_t_11 = ((PyArrayObject *)__pyx_t_3); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tsect.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tsect.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tsect.rcbuffer->pybuffer, (PyObject*)__pyx_v_tsect, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); - } + __pyx_v_ret = __pyx_t_4; + __pyx_t_4 = 0; + + /* "yt/utilities/lib/alt_ray_tracers.pyx":204 + * tmask = np.logical_and(0.0<=tsect, tsect<=1.0) + * ret = np.unique(tsect[tmask], return_index=True) + * tsect, tinds = ret[0], ret[1].astype('int64') # <<<<<<<<<<<<<< + * inds = inds[tmask][tinds] + * xyz = dsect[tmask][tinds] + */ + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_ret, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_44, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tsect.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tsect.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tsect.rcbuffer->pybuffer, (PyObject*)__pyx_v_tsect, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } } __pyx_pybuffernd_tsect.diminfo[0].strides = __pyx_pybuffernd_tsect.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tsect.diminfo[0].shape = __pyx_pybuffernd_tsect.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 203, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 204, __pyx_L1_error) } __pyx_t_11 = 0; - __Pyx_DECREF_SET(__pyx_v_tsect, ((PyArrayObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_41 = ((PyArrayObject *)__pyx_t_37); + __Pyx_DECREF_SET(__pyx_v_tsect, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + __pyx_t_48 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tinds.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tinds.rcbuffer->pybuffer, (PyObject*)__pyx_t_41, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tinds.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tinds.rcbuffer->pybuffer, (PyObject*)__pyx_v_tinds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { @@ -6903,30 +6973,30 @@ } } __pyx_pybuffernd_tinds.diminfo[0].strides = __pyx_pybuffernd_tinds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tinds.diminfo[0].shape = __pyx_pybuffernd_tinds.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 203, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 204, __pyx_L1_error) } - __pyx_t_41 = 0; - __pyx_v_tinds = ((PyArrayObject *)__pyx_t_37); - __pyx_t_37 = 0; + __pyx_t_48 = 0; + __pyx_v_tinds = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":204 - * tmask = np.logical_and(0.0<=tsect, tsect<=1.0) - * tsect, tinds = np.unique(tsect[tmask], return_index=True) + /* "yt/utilities/lib/alt_ray_tracers.pyx":205 + * ret = np.unique(tsect[tmask], return_index=True) + * tsect, tinds = ret[0], ret[1].astype('int64') * inds = inds[tmask][tinds] # <<<<<<<<<<<<<< * xyz = dsect[tmask][tinds] - * s = np.sqrt(((xyz - p1cart)**2).sum(axis=1)) + * s = np.sqrt(((xyz - p1cart) * (xyz - p1cart)).sum(axis=1)) */ - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_inds), __pyx_v_tmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_inds), __pyx_v_tmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetItem(__pyx_t_3, ((PyObject *)__pyx_v_tinds)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_37 = PyObject_GetItem(__pyx_t_4, ((PyObject *)__pyx_v_tinds)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_37) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_37, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 204, __pyx_L1_error) - __pyx_t_41 = ((PyArrayObject *)__pyx_t_37); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_48 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_41, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { @@ -6937,26 +7007,26 @@ } } __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 205, __pyx_L1_error) } - __pyx_t_41 = 0; - __Pyx_DECREF_SET(__pyx_v_inds, ((PyArrayObject *)__pyx_t_37)); - __pyx_t_37 = 0; + __pyx_t_48 = 0; + __Pyx_DECREF_SET(__pyx_v_inds, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":205 - * tsect, tinds = np.unique(tsect[tmask], return_index=True) + /* "yt/utilities/lib/alt_ray_tracers.pyx":206 + * tsect, tinds = ret[0], ret[1].astype('int64') * inds = inds[tmask][tinds] * xyz = dsect[tmask][tinds] # <<<<<<<<<<<<<< - * s = np.sqrt(((xyz - p1cart)**2).sum(axis=1)) - * s, sinds = np.unique(s, return_index=True) + * s = np.sqrt(((xyz - p1cart) * (xyz - p1cart)).sum(axis=1)) + * ret = np.unique(s, return_index=True) */ - __pyx_t_37 = PyObject_GetItem(((PyObject *)__pyx_v_dsect), __pyx_v_tmask); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_4 = PyObject_GetItem(__pyx_t_37, ((PyObject *)__pyx_v_tinds)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_dsect), __pyx_v_tmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 205, __pyx_L1_error) - __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); + __pyx_t_3 = PyObject_GetItem(__pyx_t_4, ((PyObject *)__pyx_v_tinds)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xyz.rcbuffer->pybuffer); @@ -6971,87 +7041,90 @@ } } __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]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 205, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 206, __pyx_L1_error) } __pyx_t_6 = 0; - __pyx_v_xyz = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_xyz = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":206 + /* "yt/utilities/lib/alt_ray_tracers.pyx":207 * inds = inds[tmask][tinds] * xyz = dsect[tmask][tinds] - * s = np.sqrt(((xyz - p1cart)**2).sum(axis=1)) # <<<<<<<<<<<<<< - * s, sinds = np.unique(s, return_index=True) - * inds = inds[sinds] + * s = np.sqrt(((xyz - p1cart) * (xyz - p1cart)).sum(axis=1)) # <<<<<<<<<<<<<< + * ret = np.unique(s, return_index=True) + * s, sinds = ret[0], ret[1].astype('int64') */ - __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = PyNumber_Subtract(((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_p1cart)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_38 = PyNumber_Power(__pyx_t_37, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_38, __pyx_n_s_sum); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __pyx_t_38 = PyDict_New(); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - if (PyDict_SetItem(__pyx_t_38, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 206, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_37, __pyx_empty_tuple, __pyx_t_38); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Subtract(((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_p1cart)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_45 = PyNumber_Subtract(((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_p1cart)); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_t_45); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __pyx_t_38 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_38)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_38); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __pyx_t_45 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sum); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_45, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_44))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_44); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_44); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_44, function); } } - if (!__pyx_t_38) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_4); + if (!__pyx_t_5) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_44, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __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_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_t_5}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyFunction_Check(__pyx_t_44)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_44, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __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_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_t_5}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_44)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_44, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __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_37 = PyTuple_New(1+1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_38); __pyx_t_38 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_37, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_37, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __pyx_t_45 = PyTuple_New(1+1); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_45, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_45, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_44, __pyx_t_45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; } } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 206, __pyx_L1_error) - __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_s.rcbuffer->pybuffer); @@ -7066,90 +7139,60 @@ } } __pyx_pybuffernd_s.diminfo[0].strides = __pyx_pybuffernd_s.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_s.diminfo[0].shape = __pyx_pybuffernd_s.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 207, __pyx_L1_error) } __pyx_t_11 = 0; - __pyx_v_s = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_s = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":207 + /* "yt/utilities/lib/alt_ray_tracers.pyx":208 * xyz = dsect[tmask][tinds] - * s = np.sqrt(((xyz - p1cart)**2).sum(axis=1)) - * s, sinds = np.unique(s, return_index=True) # <<<<<<<<<<<<<< + * s = np.sqrt(((xyz - p1cart) * (xyz - p1cart)).sum(axis=1)) + * ret = np.unique(s, return_index=True) # <<<<<<<<<<<<<< + * s, sinds = ret[0], ret[1].astype('int64') * inds = inds[sinds] - * xyz = xyz[sinds] */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_unique); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_s)); __Pyx_GIVEREF(((PyObject *)__pyx_v_s)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_s)); - __pyx_t_37 = PyDict_New(); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_return_index, Py_True) < 0) __PYX_ERR(0, 207, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_37); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_s)); + __pyx_t_45 = PyDict_New(); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + if (PyDict_SetItem(__pyx_t_45, __pyx_n_s_return_index, Py_True) < 0) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_44, __pyx_t_3, __pyx_t_45); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { - PyObject* sequence = __pyx_t_5; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 207, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_37 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_37 = PyList_GET_ITEM(sequence, 0); - __pyx_t_4 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_37); - __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_37 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_61 = Py_TYPE(__pyx_t_3)->tp_iternext; - index = 0; __pyx_t_37 = __pyx_t_61(__pyx_t_3); if (unlikely(!__pyx_t_37)) goto __pyx_L10_unpacking_failed; - __Pyx_GOTREF(__pyx_t_37); - index = 1; __pyx_t_4 = __pyx_t_61(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_61(__pyx_t_3), 2) < 0) __PYX_ERR(0, 207, __pyx_L1_error) - __pyx_t_61 = NULL; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L11_unpacking_done; - __pyx_L10_unpacking_failed:; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_61 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 207, __pyx_L1_error) - __pyx_L11_unpacking_done:; - } - if (!(likely(((__pyx_t_37) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_37, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 207, __pyx_L1_error) - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 207, __pyx_L1_error) - __pyx_t_11 = ((PyArrayObject *)__pyx_t_37); + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_4); + __pyx_t_4 = 0; + + /* "yt/utilities/lib/alt_ray_tracers.pyx":209 + * s = np.sqrt(((xyz - p1cart) * (xyz - p1cart)).sum(axis=1)) + * ret = np.unique(s, return_index=True) + * s, sinds = ret[0], ret[1].astype('int64') # <<<<<<<<<<<<<< + * inds = inds[sinds] + * xyz = xyz[sinds] + */ + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_45 = __Pyx_GetItemInt(__pyx_v_ret, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_45, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __pyx_t_45 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_45) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_45, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_s.rcbuffer->pybuffer); @@ -7164,16 +7207,16 @@ } } __pyx_pybuffernd_s.diminfo[0].strides = __pyx_pybuffernd_s.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_s.diminfo[0].shape = __pyx_pybuffernd_s.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 207, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 209, __pyx_L1_error) } __pyx_t_11 = 0; - __Pyx_DECREF_SET(__pyx_v_s, ((PyArrayObject *)__pyx_t_37)); - __pyx_t_37 = 0; - __pyx_t_41 = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_s, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + __pyx_t_48 = ((PyArrayObject *)__pyx_t_45); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer, (PyObject*)__pyx_t_41, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer, (PyObject*)__pyx_v_sinds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { @@ -7184,27 +7227,27 @@ } } __pyx_pybuffernd_sinds.diminfo[0].strides = __pyx_pybuffernd_sinds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sinds.diminfo[0].shape = __pyx_pybuffernd_sinds.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 207, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 209, __pyx_L1_error) } - __pyx_t_41 = 0; - __pyx_v_sinds = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_48 = 0; + __pyx_v_sinds = ((PyArrayObject *)__pyx_t_45); + __pyx_t_45 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":208 - * s = np.sqrt(((xyz - p1cart)**2).sum(axis=1)) - * s, sinds = np.unique(s, return_index=True) + /* "yt/utilities/lib/alt_ray_tracers.pyx":210 + * ret = np.unique(s, return_index=True) + * s, sinds = ret[0], ret[1].astype('int64') * inds = inds[sinds] # <<<<<<<<<<<<<< * xyz = xyz[sinds] - * t = s/np.sqrt((dpcart**2).sum()) + * t = s/np.sqrt((dpcart*dpcart).sum()) */ - __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_inds), ((PyObject *)__pyx_v_sinds)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 208, __pyx_L1_error) - __pyx_t_41 = ((PyArrayObject *)__pyx_t_5); + __pyx_t_45 = PyObject_GetItem(((PyObject *)__pyx_v_inds), ((PyObject *)__pyx_v_sinds)); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + if (!(likely(((__pyx_t_45) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_45, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_48 = ((PyArrayObject *)__pyx_t_45); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_41, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { @@ -7215,23 +7258,23 @@ } } __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 208, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 210, __pyx_L1_error) } - __pyx_t_41 = 0; - __Pyx_DECREF_SET(__pyx_v_inds, ((PyArrayObject *)__pyx_t_5)); - __pyx_t_5 = 0; + __pyx_t_48 = 0; + __Pyx_DECREF_SET(__pyx_v_inds, ((PyArrayObject *)__pyx_t_45)); + __pyx_t_45 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":209 - * s, sinds = np.unique(s, return_index=True) + /* "yt/utilities/lib/alt_ray_tracers.pyx":211 + * s, sinds = ret[0], ret[1].astype('int64') * inds = inds[sinds] * xyz = xyz[sinds] # <<<<<<<<<<<<<< - * t = s/np.sqrt((dpcart**2).sum()) + * t = s/np.sqrt((dpcart*dpcart).sum()) * sinds = s.argsort() */ - __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_sinds)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 209, __pyx_L1_error) - __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + __pyx_t_45 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_sinds)); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + if (!(likely(((__pyx_t_45) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_45, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_45); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xyz.rcbuffer->pybuffer); @@ -7246,98 +7289,98 @@ } } __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]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 211, __pyx_L1_error) } __pyx_t_6 = 0; - __Pyx_DECREF_SET(__pyx_v_xyz, ((PyArrayObject *)__pyx_t_5)); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_xyz, ((PyArrayObject *)__pyx_t_45)); + __pyx_t_45 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":210 + /* "yt/utilities/lib/alt_ray_tracers.pyx":212 * inds = inds[sinds] * xyz = xyz[sinds] - * t = s/np.sqrt((dpcart**2).sum()) # <<<<<<<<<<<<<< + * t = s/np.sqrt((dpcart*dpcart).sum()) # <<<<<<<<<<<<<< * sinds = s.argsort() * s = s[sinds] */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = PyNumber_Power(((PyObject *)__pyx_v_dpcart), __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_38))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_38); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); - __Pyx_INCREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_44 = PyNumber_Multiply(((PyObject *)__pyx_v_dpcart), ((PyObject *)__pyx_v_dpcart)); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_44, __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __pyx_t_44 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_44 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_44)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_44); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_38, function); + __Pyx_DECREF_SET(__pyx_t_5, function); } } - if (__pyx_t_3) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_38, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_44) { + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_44); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } else { - __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_38); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - __pyx_t_38 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_37))) { - __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_37); - if (likely(__pyx_t_38)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37); - __Pyx_INCREF(__pyx_t_38); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_37, function); + __Pyx_DECREF_SET(__pyx_t_3, function); } } - if (!__pyx_t_38) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_37, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) + if (!__pyx_t_5) { + __pyx_t_45 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_45); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_37)) { - PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_t_4}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_37, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; - __Pyx_GOTREF(__pyx_t_5); + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_45 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_45); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_37)) { - PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_t_4}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_37, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; - __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_45 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_45); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_38); __pyx_t_38 = NULL; + __pyx_t_44 = PyTuple_New(1+1); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_44, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_37, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_45 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_44, NULL); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } } - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_s), __pyx_t_5); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_37) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_37, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 210, __pyx_L1_error) - __pyx_t_11 = ((PyArrayObject *)__pyx_t_37); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_s), __pyx_t_45); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t.rcbuffer->pybuffer); @@ -7352,45 +7395,45 @@ } } __pyx_pybuffernd_t.diminfo[0].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t.diminfo[0].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 210, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 212, __pyx_L1_error) } __pyx_t_11 = 0; - __pyx_v_t = ((PyArrayObject *)__pyx_t_37); - __pyx_t_37 = 0; + __pyx_v_t = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":211 + /* "yt/utilities/lib/alt_ray_tracers.pyx":213 * xyz = xyz[sinds] - * t = s/np.sqrt((dpcart**2).sum()) + * t = s/np.sqrt((dpcart*dpcart).sum()) * sinds = s.argsort() # <<<<<<<<<<<<<< * s = s[sinds] * t = t[sinds] */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_argsort); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && likely(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_t_45 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_argsort); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __pyx_t_44 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_45))) { + __pyx_t_44 = PyMethod_GET_SELF(__pyx_t_45); + if (likely(__pyx_t_44)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_45); + __Pyx_INCREF(__pyx_t_44); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); + __Pyx_DECREF_SET(__pyx_t_45, function); } } - if (__pyx_t_3) { - __pyx_t_37 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_44) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_45, __pyx_t_44); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } else { - __pyx_t_37 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_45); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) } - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_37) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_37, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 211, __pyx_L1_error) - __pyx_t_41 = ((PyArrayObject *)__pyx_t_37); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_48 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer, (PyObject*)__pyx_t_41, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer, (PyObject*)__pyx_v_sinds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { @@ -7401,23 +7444,23 @@ } } __pyx_pybuffernd_sinds.diminfo[0].strides = __pyx_pybuffernd_sinds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sinds.diminfo[0].shape = __pyx_pybuffernd_sinds.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 211, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 213, __pyx_L1_error) } - __pyx_t_41 = 0; - __Pyx_DECREF_SET(__pyx_v_sinds, ((PyArrayObject *)__pyx_t_37)); - __pyx_t_37 = 0; + __pyx_t_48 = 0; + __Pyx_DECREF_SET(__pyx_v_sinds, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":212 - * t = s/np.sqrt((dpcart**2).sum()) + /* "yt/utilities/lib/alt_ray_tracers.pyx":214 + * t = s/np.sqrt((dpcart*dpcart).sum()) * sinds = s.argsort() * s = s[sinds] # <<<<<<<<<<<<<< * t = t[sinds] * inds = inds[sinds] */ - __pyx_t_37 = PyObject_GetItem(((PyObject *)__pyx_v_s), ((PyObject *)__pyx_v_sinds)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - if (!(likely(((__pyx_t_37) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_37, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 212, __pyx_L1_error) - __pyx_t_11 = ((PyArrayObject *)__pyx_t_37); + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_s), ((PyObject *)__pyx_v_sinds)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_s.rcbuffer->pybuffer); @@ -7432,23 +7475,23 @@ } } __pyx_pybuffernd_s.diminfo[0].strides = __pyx_pybuffernd_s.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_s.diminfo[0].shape = __pyx_pybuffernd_s.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 212, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 214, __pyx_L1_error) } __pyx_t_11 = 0; - __Pyx_DECREF_SET(__pyx_v_s, ((PyArrayObject *)__pyx_t_37)); - __pyx_t_37 = 0; + __Pyx_DECREF_SET(__pyx_v_s, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":213 + /* "yt/utilities/lib/alt_ray_tracers.pyx":215 * sinds = s.argsort() * s = s[sinds] * t = t[sinds] # <<<<<<<<<<<<<< * inds = inds[sinds] * xyz = xyz[sinds] */ - __pyx_t_37 = PyObject_GetItem(((PyObject *)__pyx_v_t), ((PyObject *)__pyx_v_sinds)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - if (!(likely(((__pyx_t_37) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_37, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 213, __pyx_L1_error) - __pyx_t_11 = ((PyArrayObject *)__pyx_t_37); + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_t), ((PyObject *)__pyx_v_sinds)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t.rcbuffer->pybuffer); @@ -7463,27 +7506,27 @@ } } __pyx_pybuffernd_t.diminfo[0].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t.diminfo[0].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 213, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 215, __pyx_L1_error) } __pyx_t_11 = 0; - __Pyx_DECREF_SET(__pyx_v_t, ((PyArrayObject *)__pyx_t_37)); - __pyx_t_37 = 0; + __Pyx_DECREF_SET(__pyx_v_t, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":214 + /* "yt/utilities/lib/alt_ray_tracers.pyx":216 * s = s[sinds] * t = t[sinds] * inds = inds[sinds] # <<<<<<<<<<<<<< * xyz = xyz[sinds] - * rztheta = np.concatenate([np.sqrt(xyz[:,0]**2 + xyz[:,1]**2)[:,np.newaxis], + * rztheta = np.concatenate([np.sqrt(xyz[:,0] * xyz[:,0] + xyz[:,1] * xyz[:,1])[:,np.newaxis], */ - __pyx_t_37 = PyObject_GetItem(((PyObject *)__pyx_v_inds), ((PyObject *)__pyx_v_sinds)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - if (!(likely(((__pyx_t_37) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_37, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 214, __pyx_L1_error) - __pyx_t_41 = ((PyArrayObject *)__pyx_t_37); + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_inds), ((PyObject *)__pyx_v_sinds)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_48 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_41, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { @@ -7494,23 +7537,23 @@ } } __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 216, __pyx_L1_error) } - __pyx_t_41 = 0; - __Pyx_DECREF_SET(__pyx_v_inds, ((PyArrayObject *)__pyx_t_37)); - __pyx_t_37 = 0; + __pyx_t_48 = 0; + __Pyx_DECREF_SET(__pyx_v_inds, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":215 + /* "yt/utilities/lib/alt_ray_tracers.pyx":217 * t = t[sinds] * inds = inds[sinds] * xyz = xyz[sinds] # <<<<<<<<<<<<<< - * rztheta = np.concatenate([np.sqrt(xyz[:,0]**2 + xyz[:,1]**2)[:,np.newaxis], + * rztheta = np.concatenate([np.sqrt(xyz[:,0] * xyz[:,0] + xyz[:,1] * xyz[:,1])[:,np.newaxis], * xyz[:,2:3], */ - __pyx_t_37 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_sinds)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - if (!(likely(((__pyx_t_37) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_37, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 215, __pyx_L1_error) - __pyx_t_6 = ((PyArrayObject *)__pyx_t_37); + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_sinds)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xyz.rcbuffer->pybuffer); @@ -7525,248 +7568,254 @@ } } __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]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 215, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 217, __pyx_L1_error) } __pyx_t_6 = 0; - __Pyx_DECREF_SET(__pyx_v_xyz, ((PyArrayObject *)__pyx_t_37)); - __pyx_t_37 = 0; + __Pyx_DECREF_SET(__pyx_v_xyz, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":216 + /* "yt/utilities/lib/alt_ray_tracers.pyx":218 * inds = inds[sinds] * xyz = xyz[sinds] - * rztheta = np.concatenate([np.sqrt(xyz[:,0]**2 + xyz[:,1]**2)[:,np.newaxis], # <<<<<<<<<<<<<< + * rztheta = np.concatenate([np.sqrt(xyz[:,0] * xyz[:,0] + xyz[:,1] * xyz[:,1])[:,np.newaxis], # <<<<<<<<<<<<<< * xyz[:,2:3], * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) */ - __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_38 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_45 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_44 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_44, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __pyx_t_44 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__12); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_Multiply(__pyx_t_44, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_38, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_44 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__18); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_38 = PyNumber_Multiply(__pyx_t_5, __pyx_t_44); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __pyx_t_44 = PyNumber_Add(__pyx_t_2, __pyx_t_38); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __pyx_t_38 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_2)) { + __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_38)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_38); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } - if (!__pyx_t_2) { - __pyx_t_37 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_37); + if (!__pyx_t_38) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_44); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_37 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_t_44}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_37 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_temp[2] = {__pyx_t_38, __pyx_t_44}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; } else #endif { - __pyx_t_38 = PyTuple_New(1+1); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_38, 0, __pyx_t_2); __pyx_t_2 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_38, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_37 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_38, NULL); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_38); __pyx_t_38 = NULL; + __Pyx_GIVEREF(__pyx_t_44); + PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_44); + __pyx_t_44 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_slice__13); - __Pyx_GIVEREF(__pyx_slice__13); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__13); - __Pyx_GIVEREF(__pyx_t_38); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_38); - __pyx_t_38 = 0; - __pyx_t_38 = PyObject_GetItem(__pyx_t_37, __pyx_t_4); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_INCREF(__pyx_slice__19); + __Pyx_GIVEREF(__pyx_slice__19); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__19); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __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; - /* "yt/utilities/lib/alt_ray_tracers.pyx":217 + /* "yt/utilities/lib/alt_ray_tracers.pyx":219 * xyz = xyz[sinds] - * rztheta = np.concatenate([np.sqrt(xyz[:,0]**2 + xyz[:,1]**2)[:,np.newaxis], + * rztheta = np.concatenate([np.sqrt(xyz[:,0] * xyz[:,0] + xyz[:,1] * xyz[:,1])[:,np.newaxis], * xyz[:,2:3], # <<<<<<<<<<<<<< * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) * return t, s, rztheta, inds */ - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__22); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "yt/utilities/lib/alt_ray_tracers.pyx":218 - * rztheta = np.concatenate([np.sqrt(xyz[:,0]**2 + xyz[:,1]**2)[:,np.newaxis], + /* "yt/utilities/lib/alt_ray_tracers.pyx":220 + * rztheta = np.concatenate([np.sqrt(xyz[:,0] * xyz[:,0] + xyz[:,1] * xyz[:,1])[:,np.newaxis], * xyz[:,2:3], * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) # <<<<<<<<<<<<<< * return t, s, rztheta, inds * #rztheta[:,2] = 0.0 + (rztheta[:,2] - np.pi*3/2)%(2*np.pi) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arctan2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__18); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_31 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__20); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_31); + __pyx_t_44 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_44, __pyx_n_s_arctan2); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __pyx_t_44 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__24); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__26); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_38))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_38); if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_38, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_3, __pyx_t_31}; - __pyx_t_37 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 218, __pyx_L1_error) + if (PyFunction_Check(__pyx_t_38)) { + PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_44, __pyx_t_5}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_38, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __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_1, __pyx_t_3, __pyx_t_31}; - __pyx_t_37 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 218, __pyx_L1_error) + if (__Pyx_PyFastCFunction_Check(__pyx_t_38)) { + PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_44, __pyx_t_5}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_38, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_36 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); + __pyx_t_43 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); if (__pyx_t_1) { - __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_1); __pyx_t_1 = NULL; + __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_t_1); __pyx_t_1 = NULL; } - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_36, 0+__pyx_t_7, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_31); - PyTuple_SET_ITEM(__pyx_t_36, 1+__pyx_t_7, __pyx_t_31); - __pyx_t_3 = 0; - __pyx_t_31 = 0; - __pyx_t_37 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_36, NULL); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; + __Pyx_GIVEREF(__pyx_t_44); + PyTuple_SET_ITEM(__pyx_t_43, 0+__pyx_t_7, __pyx_t_44); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_43, 1+__pyx_t_7, __pyx_t_5); + __pyx_t_44 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_38, __pyx_t_43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 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, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_slice__21); - __Pyx_GIVEREF(__pyx_slice__21); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__21); - __Pyx_GIVEREF(__pyx_t_36); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_36); - __pyx_t_36 = 0; - __pyx_t_36 = PyObject_GetItem(__pyx_t_37, __pyx_t_2); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __pyx_t_38 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_38, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + __pyx_t_38 = PyTuple_New(2); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __Pyx_INCREF(__pyx_slice__27); + __Pyx_GIVEREF(__pyx_slice__27); + PyTuple_SET_ITEM(__pyx_t_38, 0, __pyx_slice__27); + __Pyx_GIVEREF(__pyx_t_43); + PyTuple_SET_ITEM(__pyx_t_38, 1, __pyx_t_43); + __pyx_t_43 = 0; + __pyx_t_43 = PyObject_GetItem(__pyx_t_3, __pyx_t_38); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":216 + /* "yt/utilities/lib/alt_ray_tracers.pyx":218 * inds = inds[sinds] * xyz = xyz[sinds] - * rztheta = np.concatenate([np.sqrt(xyz[:,0]**2 + xyz[:,1]**2)[:,np.newaxis], # <<<<<<<<<<<<<< + * rztheta = np.concatenate([np.sqrt(xyz[:,0] * xyz[:,0] + xyz[:,1] * xyz[:,1])[:,np.newaxis], # <<<<<<<<<<<<<< * xyz[:,2:3], * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) */ - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_38); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_38); - __Pyx_GIVEREF(__pyx_t_4); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_36); - PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_36); - __pyx_t_38 = 0; - __pyx_t_4 = 0; - __pyx_t_36 = 0; - __pyx_t_36 = PyTuple_New(1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); + __pyx_t_38 = PyList_New(3); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_2); + PyList_SET_ITEM(__pyx_t_38, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_38, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_43); + PyList_SET_ITEM(__pyx_t_38, 2, __pyx_t_43); __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_43 = 0; + __pyx_t_43 = PyTuple_New(1); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); + __Pyx_GIVEREF(__pyx_t_38); + PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_t_38); + __pyx_t_38 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":218 - * rztheta = np.concatenate([np.sqrt(xyz[:,0]**2 + xyz[:,1]**2)[:,np.newaxis], + /* "yt/utilities/lib/alt_ray_tracers.pyx":220 + * rztheta = np.concatenate([np.sqrt(xyz[:,0] * xyz[:,0] + xyz[:,1] * xyz[:,1])[:,np.newaxis], * xyz[:,2:3], * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) # <<<<<<<<<<<<<< * return t, s, rztheta, inds * #rztheta[:,2] = 0.0 + (rztheta[:,2] - np.pi*3/2)%(2*np.pi) */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_38 = PyDict_New(); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + if (PyDict_SetItem(__pyx_t_38, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 220, __pyx_L1_error) - /* "yt/utilities/lib/alt_ray_tracers.pyx":216 + /* "yt/utilities/lib/alt_ray_tracers.pyx":218 * inds = inds[sinds] * xyz = xyz[sinds] - * rztheta = np.concatenate([np.sqrt(xyz[:,0]**2 + xyz[:,1]**2)[:,np.newaxis], # <<<<<<<<<<<<<< + * rztheta = np.concatenate([np.sqrt(xyz[:,0] * xyz[:,0] + xyz[:,1] * xyz[:,1])[:,np.newaxis], # <<<<<<<<<<<<<< * xyz[:,2:3], * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_36, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_45, __pyx_t_43, __pyx_t_38); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 218, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7782,20 +7831,20 @@ } } __pyx_pybuffernd_rztheta.diminfo[0].strides = __pyx_pybuffernd_rztheta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rztheta.diminfo[0].shape = __pyx_pybuffernd_rztheta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rztheta.diminfo[1].strides = __pyx_pybuffernd_rztheta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rztheta.diminfo[1].shape = __pyx_pybuffernd_rztheta.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 216, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 218, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_rztheta = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/alt_ray_tracers.pyx":219 + /* "yt/utilities/lib/alt_ray_tracers.pyx":221 * xyz[:,2:3], * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) * return t, s, rztheta, inds # <<<<<<<<<<<<<< * #rztheta[:,2] = 0.0 + (rztheta[:,2] - np.pi*3/2)%(2*np.pi) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_t)); __Pyx_GIVEREF(((PyObject *)__pyx_v_t)); @@ -7828,12 +7877,12 @@ __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_31); - __Pyx_XDECREF(__pyx_t_36); - __Pyx_XDECREF(__pyx_t_37); __Pyx_XDECREF(__pyx_t_38); - __Pyx_XDECREF(__pyx_t_39); - __Pyx_XDECREF(__pyx_t_40); + __Pyx_XDECREF(__pyx_t_43); + __Pyx_XDECREF(__pyx_t_44); + __Pyx_XDECREF(__pyx_t_45); + __Pyx_XDECREF(__pyx_t_46); + __Pyx_XDECREF(__pyx_t_47); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -7939,6 +7988,7 @@ __Pyx_XDECREF(__pyx_v_tpmleft); __Pyx_XDECREF(__pyx_v_nans); __Pyx_XDECREF(__pyx_v_tmask); + __Pyx_XDECREF(__pyx_v_ret); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -8113,7 +8163,7 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8169,7 +8219,7 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8478,7 +8528,7 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9293,7 +9343,7 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9361,7 +9411,7 @@ * # 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__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9470,7 +9520,7 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -10125,7 +10175,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -10151,7 +10201,7 @@ * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -10173,7 +10223,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -10256,7 +10306,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -10282,7 +10332,7 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -10304,7 +10354,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -10387,7 +10437,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -10410,7 +10460,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -10432,7 +10482,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -10470,7 +10520,7 @@ PyModuleDef_HEAD_INIT, #endif "alt_ray_tracers", - __pyx_k__31, /* m_doc */ + __pyx_k__37, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ @@ -10488,7 +10538,6 @@ {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1}, @@ -10496,6 +10545,7 @@ {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1}, {&__pyx_n_s_argwhere, __pyx_k_argwhere, sizeof(__pyx_k_argwhere), 0, 0, 1, 1}, {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_b1, __pyx_k_b1, sizeof(__pyx_k_b1), 0, 0, 1, 1}, @@ -10504,6 +10554,7 @@ {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_cart_intersect, __pyx_k_cart_intersect, sizeof(__pyx_k_cart_intersect), 0, 0, 1, 1}, {&__pyx_n_s_cleft, __pyx_k_cleft, sizeof(__pyx_k_cleft), 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_concatenate, __pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 0, 1, 1}, {&__pyx_n_s_cright, __pyx_k_cright, sizeof(__pyx_k_cright), 0, 0, 1, 1}, {&__pyx_n_s_cross, __pyx_k_cross, sizeof(__pyx_k_cross), 0, 0, 1, 1}, @@ -10520,6 +10571,7 @@ {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_inds, __pyx_k_inds, sizeof(__pyx_k_inds), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, {&__pyx_n_s_intp, __pyx_k_intp, sizeof(__pyx_k_intp), 0, 0, 1, 1}, {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1}, {&__pyx_n_s_left_edges, __pyx_k_left_edges, sizeof(__pyx_k_left_edges), 0, 0, 1, 1}, @@ -10541,6 +10593,7 @@ {&__pyx_n_s_ptemp, __pyx_k_ptemp, sizeof(__pyx_k_ptemp), 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_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, {&__pyx_n_s_return_index, __pyx_k_return_index, sizeof(__pyx_k_return_index), 0, 0, 1, 1}, {&__pyx_n_s_right_edges, __pyx_k_right_edges, sizeof(__pyx_k_right_edges), 0, 0, 1, 1}, {&__pyx_n_s_rleft, __pyx_k_rleft, sizeof(__pyx_k_rleft), 0, 0, 1, 1}, @@ -10572,7 +10625,8 @@ {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xcart, __pyx_k_xcart, sizeof(__pyx_k_xcart), 0, 0, 1, 1}, {&__pyx_n_s_xyz, __pyx_k_xyz, sizeof(__pyx_k_xyz), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_alt_ray_tracers, __pyx_k_yt_utilities_lib_alt_ray_tracers, sizeof(__pyx_k_yt_utilities_lib_alt_ray_tracers), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_alt_ray_tracers, __pyx_k_yt_utilities_lib_alt_ray_tracers, sizeof(__pyx_k_yt_utilities_lib_alt_ray_tracers), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_alt_ray_tracers_2, __pyx_k_yt_utilities_lib_alt_ray_tracers_2, sizeof(__pyx_k_yt_utilities_lib_alt_ray_tracers_2), 0, 0, 1, 1}, {&__pyx_n_s_zleft, __pyx_k_zleft, sizeof(__pyx_k_zleft), 0, 0, 1, 1}, {&__pyx_n_s_zright, __pyx_k_zright, sizeof(__pyx_k_zright), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} @@ -10638,7 +10692,7 @@ * zleft = left_edges[:,1] * zright = right_edges[:,1] # <<<<<<<<<<<<<< * - * a = (dpcart[0]**2) + (dpcart[1]**2) + * a = dpcart[0] * dpcart[0] + dpcart[1] * dpcart[1] */ __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__7); @@ -10647,53 +10701,53 @@ __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "yt/utilities/lib/alt_ray_tracers.pyx":216 + /* "yt/utilities/lib/alt_ray_tracers.pyx":204 + * tmask = np.logical_and(0.0<=tsect, tsect<=1.0) + * ret = np.unique(tsect[tmask], return_index=True) + * tsect, tinds = ret[0], ret[1].astype('int64') # <<<<<<<<<<<<<< + * inds = inds[tmask][tinds] + * xyz = dsect[tmask][tinds] + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "yt/utilities/lib/alt_ray_tracers.pyx":209 + * s = np.sqrt(((xyz - p1cart) * (xyz - p1cart)).sum(axis=1)) + * ret = np.unique(s, return_index=True) + * s, sinds = ret[0], ret[1].astype('int64') # <<<<<<<<<<<<<< * inds = inds[sinds] * xyz = xyz[sinds] - * rztheta = np.concatenate([np.sqrt(xyz[:,0]**2 + xyz[:,1]**2)[:,np.newaxis], # <<<<<<<<<<<<<< - * xyz[:,2:3], - * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) */ - __pyx_slice__9 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__9)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__9); - __Pyx_GIVEREF(__pyx_slice__9); - __pyx_tuple__10 = PyTuple_Pack(2, __pyx_slice__9, __pyx_int_0); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_slice__11 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 216, __pyx_L1_error) + + /* "yt/utilities/lib/alt_ray_tracers.pyx":218 + * inds = inds[sinds] + * xyz = xyz[sinds] + * rztheta = np.concatenate([np.sqrt(xyz[:,0] * xyz[:,0] + xyz[:,1] * xyz[:,1])[:,np.newaxis], # <<<<<<<<<<<<<< + * xyz[:,2:3], + * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) + */ + __pyx_slice__11 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__11); __Pyx_GIVEREF(__pyx_slice__11); - __pyx_tuple__12 = PyTuple_Pack(2, __pyx_slice__11, __pyx_int_1); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(2, __pyx_slice__11, __pyx_int_0); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__13); __Pyx_GIVEREF(__pyx_slice__13); - - /* "yt/utilities/lib/alt_ray_tracers.pyx":217 - * xyz = xyz[sinds] - * rztheta = np.concatenate([np.sqrt(xyz[:,0]**2 + xyz[:,1]**2)[:,np.newaxis], - * xyz[:,2:3], # <<<<<<<<<<<<<< - * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) - * return t, s, rztheta, inds - */ - __pyx_slice__14 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__14); - __Pyx_GIVEREF(__pyx_slice__14); - __pyx_slice__15 = PySlice_New(__pyx_int_2, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(2, __pyx_slice__13, __pyx_int_0); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__15); __Pyx_GIVEREF(__pyx_slice__15); - __pyx_tuple__16 = PyTuple_Pack(2, __pyx_slice__14, __pyx_slice__15); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(2, __pyx_slice__15, __pyx_int_1); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - - /* "yt/utilities/lib/alt_ray_tracers.pyx":218 - * rztheta = np.concatenate([np.sqrt(xyz[:,0]**2 + xyz[:,1]**2)[:,np.newaxis], - * xyz[:,2:3], - * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) # <<<<<<<<<<<<<< - * return t, s, rztheta, inds - * #rztheta[:,2] = 0.0 + (rztheta[:,2] - np.pi*3/2)%(2*np.pi) - */ __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__17); __Pyx_GIVEREF(__pyx_slice__17); @@ -10703,12 +10757,46 @@ __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__19); __Pyx_GIVEREF(__pyx_slice__19); - __pyx_tuple__20 = PyTuple_Pack(2, __pyx_slice__19, __pyx_int_0); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 218, __pyx_L1_error) + + /* "yt/utilities/lib/alt_ray_tracers.pyx":219 + * xyz = xyz[sinds] + * rztheta = np.concatenate([np.sqrt(xyz[:,0] * xyz[:,0] + xyz[:,1] * xyz[:,1])[:,np.newaxis], + * xyz[:,2:3], # <<<<<<<<<<<<<< + * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) + * return t, s, rztheta, inds + */ + __pyx_slice__20 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__20); + __Pyx_GIVEREF(__pyx_slice__20); + __pyx_slice__21 = PySlice_New(__pyx_int_2, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__21); __Pyx_GIVEREF(__pyx_slice__21); + __pyx_tuple__22 = PyTuple_Pack(2, __pyx_slice__20, __pyx_slice__21); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "yt/utilities/lib/alt_ray_tracers.pyx":220 + * rztheta = np.concatenate([np.sqrt(xyz[:,0] * xyz[:,0] + xyz[:,1] * xyz[:,1])[:,np.newaxis], + * xyz[:,2:3], + * np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) # <<<<<<<<<<<<<< + * return t, s, rztheta, inds + * #rztheta[:,2] = 0.0 + (rztheta[:,2] - np.pi*3/2)%(2*np.pi) + */ + __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); + __pyx_tuple__24 = PyTuple_Pack(2, __pyx_slice__23, __pyx_int_1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + __pyx_tuple__26 = PyTuple_Pack(2, __pyx_slice__25, __pyx_int_0); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__27); + __Pyx_GIVEREF(__pyx_slice__27); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -10717,9 +10805,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -10728,9 +10816,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -10739,9 +10827,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -10750,9 +10838,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -10761,9 +10849,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -10772,9 +10860,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -10783,9 +10871,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -10794,18 +10882,18 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); /* "yt/utilities/lib/alt_ray_tracers.pyx":24 * @cython.wraparound(False) @@ -10814,10 +10902,10 @@ * """Converts points in cylindrical coordinates to cartesian points.""" * # NOTE this should be removed once the coord interface comes online */ - __pyx_tuple__32 = PyTuple_Pack(4, __pyx_n_s_x, __pyx_n_s_i, __pyx_n_s_I, __pyx_n_s_xcart); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_cyl2cart, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_x, __pyx_n_s_i, __pyx_n_s_I, __pyx_n_s_xcart); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_alt_ray_tracers, __pyx_n_s_cyl2cart, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 24, __pyx_L1_error) /* "yt/utilities/lib/alt_ray_tracers.pyx":40 * @cython.wraparound(False) @@ -10826,10 +10914,10 @@ * np.ndarray[np.float64_t, ndim=1] b, * np.ndarray[np.float64_t, ndim=2] c, */ - __pyx_tuple__34 = PyTuple_Pack(11, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c, __pyx_n_s_d, __pyx_n_s_i, __pyx_n_s_I, __pyx_n_s_r, __pyx_n_s_s, __pyx_n_s_t, __pyx_n_s_loc, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_cart_intersect, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(11, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c, __pyx_n_s_d, __pyx_n_s_i, __pyx_n_s_I, __pyx_n_s_r, __pyx_n_s_s, __pyx_n_s_t, __pyx_n_s_loc, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_alt_ray_tracers, __pyx_n_s_cart_intersect, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 40, __pyx_L1_error) /* "yt/utilities/lib/alt_ray_tracers.pyx":68 * @cython.wraparound(False) @@ -10838,10 +10926,10 @@ * np.ndarray[np.float64_t, ndim=1] p2, * np.ndarray[np.float64_t, ndim=2] left_edges, */ - __pyx_tuple__36 = PyTuple_Pack(43, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_i, __pyx_n_s_I, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_bsqrd, __pyx_n_s_twoa, __pyx_n_s_p1cart, __pyx_n_s_p2cart, __pyx_n_s_dpcart, __pyx_n_s_t, __pyx_n_s_s, __pyx_n_s_rleft, __pyx_n_s_rright, __pyx_n_s_zleft, __pyx_n_s_zright, __pyx_n_s_cleft, __pyx_n_s_cright, __pyx_n_s_thetaleft, __pyx_n_s_thetaright, __pyx_n_s_tmleft, __pyx_n_s_tpleft, __pyx_n_s_tmright, __pyx_n_s_tpright, __pyx_n_s_tsect, __pyx_n_s_inds, __pyx_n_s_tinds, __pyx_n_s_sinds, __pyx_n_s_xyz, __pyx_n_s_rztheta, __pyx_n_s_ptemp, __pyx_n_s_b1, __pyx_n_s_b2, __pyx_n_s_dsect, __pyx_n_s_tmmright, __pyx_n_s_tpmright, __pyx_n_s_tmmleft, __pyx_n_s_tpmleft, __pyx_n_s_nans, __pyx_n_s_tmask); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); - __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(4, 0, 43, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_cylindrical_ray_trace, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_tuple__42 = PyTuple_Pack(44, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_i, __pyx_n_s_I, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_bsqrd, __pyx_n_s_twoa, __pyx_n_s_p1cart, __pyx_n_s_p2cart, __pyx_n_s_dpcart, __pyx_n_s_t, __pyx_n_s_s, __pyx_n_s_rleft, __pyx_n_s_rright, __pyx_n_s_zleft, __pyx_n_s_zright, __pyx_n_s_cleft, __pyx_n_s_cright, __pyx_n_s_thetaleft, __pyx_n_s_thetaright, __pyx_n_s_tmleft, __pyx_n_s_tpleft, __pyx_n_s_tmright, __pyx_n_s_tpright, __pyx_n_s_tsect, __pyx_n_s_inds, __pyx_n_s_tinds, __pyx_n_s_sinds, __pyx_n_s_xyz, __pyx_n_s_rztheta, __pyx_n_s_ptemp, __pyx_n_s_b1, __pyx_n_s_b2, __pyx_n_s_dsect, __pyx_n_s_tmmright, __pyx_n_s_tpmright, __pyx_n_s_tmmleft, __pyx_n_s_tpmleft, __pyx_n_s_nans, __pyx_n_s_tmask, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(4, 0, 44, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_alt_ray_tracers, __pyx_n_s_cylindrical_ray_trace, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -10910,7 +10998,7 @@ #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("alt_ray_tracers", __pyx_methods, __pyx_k__31, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + __pyx_m = Py_InitModule4("alt_ray_tracers", __pyx_methods, __pyx_k__37, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -10918,6 +11006,7 @@ __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 @@ -10985,7 +11074,7 @@ * """Converts points in cylindrical coordinates to cartesian points.""" * # NOTE this should be removed once the coord interface comes online */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15alt_ray_tracers_1_cyl2cart, NULL, __pyx_n_s_yt_utilities_lib_alt_ray_tracers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15alt_ray_tracers_1_cyl2cart, NULL, __pyx_n_s_yt_utilities_lib_alt_ray_tracers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_cyl2cart, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10997,7 +11086,7 @@ * np.ndarray[np.float64_t, ndim=1] b, * np.ndarray[np.float64_t, ndim=2] c, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15alt_ray_tracers_3_cart_intersect, NULL, __pyx_n_s_yt_utilities_lib_alt_ray_tracers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15alt_ray_tracers_3_cart_intersect, NULL, __pyx_n_s_yt_utilities_lib_alt_ray_tracers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_cart_intersect, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11009,7 +11098,7 @@ * np.ndarray[np.float64_t, ndim=1] p2, * np.ndarray[np.float64_t, ndim=2] left_edges, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15alt_ray_tracers_5cylindrical_ray_trace, NULL, __pyx_n_s_yt_utilities_lib_alt_ray_tracers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15alt_ray_tracers_5cylindrical_ray_trace, NULL, __pyx_n_s_yt_utilities_lib_alt_ray_tracers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_cylindrical_ray_trace, __pyx_t_1) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11039,7 +11128,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.alt_ray_tracers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.alt_ray_tracers", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -11898,9 +11987,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -11913,9 +12005,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -12084,8 +12179,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL @@ -12093,17 +12188,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON @@ -12143,11 +12243,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -12170,7 +12266,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -12191,7 +12287,7 @@ #endif /* SetItemInt */ - static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); @@ -12239,20 +12335,20 @@ } /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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"); } /* IterFinish */ - static CYTHON_INLINE int __Pyx_IterFinish(void) { + static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; @@ -12287,7 +12383,7 @@ } /* UnpackItemEndCheck */ - static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); @@ -12299,7 +12395,7 @@ } /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -12462,12 +12558,12 @@ #endif /* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -12491,7 +12587,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -12501,7 +12597,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -12562,7 +12658,7 @@ } /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -12635,8 +12731,42 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -12716,7 +12846,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -12775,12 +12905,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -12817,8 +12950,8 @@ #endif - /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + /* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -12849,7 +12982,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -12880,7 +13013,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -12902,7 +13035,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -12932,8 +13065,39 @@ } } +/* 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); + } +} + /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -12953,7 +13117,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -13088,7 +13252,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -13108,7 +13272,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -13243,7 +13407,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -13274,7 +13438,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -13463,7 +13627,196 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -13652,7 +14005,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -13668,7 +14021,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -13686,7 +14039,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -13751,7 +14104,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -13776,6 +14129,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -13784,11 +14139,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/alt_ray_tracers.pyx yt-3.4.0/yt/utilities/lib/alt_ray_tracers.pyx --- yt-3.3.3/yt/utilities/lib/alt_ray_tracers.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/alt_ray_tracers.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -95,7 +95,7 @@ indexes into the grid cells which the ray crosses in order. """ - cdef int i, I + cdef np.int_t i, I cdef np.float64_t a, b, bsqrd, twoa cdef np.ndarray[np.float64_t, ndim=1] p1cart, p2cart, dpcart, t, s, \ rleft, rright, zleft, zright, \ @@ -117,12 +117,12 @@ zleft = left_edges[:,1] zright = right_edges[:,1] - a = (dpcart[0]**2) + (dpcart[1]**2) - b = (2*dpcart[0]*p1cart[0]) + (2*dpcart[1]*p1cart[1]) - cleft = ((p1cart[0]**2) + (p1cart[1]**2)) - rleft**2 - cright = ((p1cart[0]**2) + (p1cart[1]**2)) - rright**2 - twoa = 2*a - bsqrd = b**2 + a = dpcart[0] * dpcart[0] + dpcart[1] * dpcart[1] + b = 2 * dpcart[0] * p1cart[0] + 2 * dpcart[1] * p1cart[1] + cleft = p1cart[0] * p1cart[0] + p1cart[1] * p1cart[1] - rleft * rleft + cright = p1cart[0] * p1cart[0] + p1cart[1] * p1cart[1] - rright * rright + twoa = 2 * a + bsqrd = b * b # Compute positive and negative times and associated masks I = np.intp(left_edges.shape[0]) @@ -155,7 +155,7 @@ thetaleft = np.empty(I) thetaleft.fill(p1[2]) thetaright = np.empty(I) - thetaleft.fill(p2[2]) + thetaright.fill(p2[2]) else: rleft = rleft[inds] rright = rright[inds] @@ -200,20 +200,22 @@ # find intersections and compute return values tsect, dsect = _cart_intersect(p1cart, p2cart, _cyl2cart(b1), _cyl2cart(b2)) tmask = np.logical_and(0.0<=tsect, tsect<=1.0) - tsect, tinds = np.unique(tsect[tmask], return_index=True) + ret = np.unique(tsect[tmask], return_index=True) + tsect, tinds = ret[0], ret[1].astype('int64') inds = inds[tmask][tinds] xyz = dsect[tmask][tinds] - s = np.sqrt(((xyz - p1cart)**2).sum(axis=1)) - s, sinds = np.unique(s, return_index=True) + s = np.sqrt(((xyz - p1cart) * (xyz - p1cart)).sum(axis=1)) + ret = np.unique(s, return_index=True) + s, sinds = ret[0], ret[1].astype('int64') inds = inds[sinds] xyz = xyz[sinds] - t = s/np.sqrt((dpcart**2).sum()) + t = s/np.sqrt((dpcart*dpcart).sum()) sinds = s.argsort() s = s[sinds] t = t[sinds] inds = inds[sinds] xyz = xyz[sinds] - rztheta = np.concatenate([np.sqrt(xyz[:,0]**2 + xyz[:,1]**2)[:,np.newaxis], + rztheta = np.concatenate([np.sqrt(xyz[:,0] * xyz[:,0] + xyz[:,1] * xyz[:,1])[:,np.newaxis], xyz[:,2:3], np.arctan2(xyz[:,1], xyz[:,0])[:,np.newaxis]], axis=1) return t, s, rztheta, inds diff -Nru yt-3.3.3/yt/utilities/lib/amr_kdtools.c yt-3.4.0/yt/utilities/lib/amr_kdtools.c --- yt-3.3.3/yt/utilities/lib/amr_kdtools.c 2016-12-12 01:41:37.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/amr_kdtools.c 2017-08-10 18:20:25.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,6 +6,10 @@ "depends": [], "libraries": [ "m" + ], + "name": "yt.utilities.lib.amr_kdtools", + "sources": [ + "yt/utilities/lib/amr_kdtools.pyx" ] }, "module_name": "yt.utilities.lib.amr_kdtools" @@ -19,7 +23,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -41,6 +45,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -193,16 +198,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -329,6 +338,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -383,6 +398,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -492,8 +536,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -506,8 +550,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -629,10 +676,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -666,9 +715,9 @@ static const char *__pyx_f[] = { "yt/utilities/lib/amr_kdtools.pyx", + "stringsource", "yt/utilities/lib/amr_kdtools.pxd", "__init__.pxd", - "stringsource", "type.pxd", }; /* MemviewSliceStruct.proto */ @@ -1403,7 +1452,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* MemviewSliceInit.proto */ #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d @@ -1569,10 +1618,10 @@ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif -#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { @@ -1652,12 +1701,29 @@ /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); +/* 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) @@ -1722,9 +1788,22 @@ #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() + /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join @@ -1746,6 +1825,12 @@ /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -2170,6 +2255,7 @@ 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 PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; 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 }; @@ -2179,13 +2265,13 @@ /* Implementation of 'yt.utilities.lib.amr_kdtools' */ static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_Ellipsis; -static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_B[] = "B"; @@ -2197,11 +2283,11 @@ static const char __pyx_k_s[] = "(%s)"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_np[] = "np"; - static const char __pyx_k__37[] = "^"; - static const char __pyx_k__38[] = ""; - static const char __pyx_k__39[] = ":"; -static const char __pyx_k__40[] = "}"; -static const char __pyx_k__41[] = ","; + static const char __pyx_k__45[] = "^"; + static const char __pyx_k__46[] = ""; + static const char __pyx_k__47[] = ":"; +static const char __pyx_k__48[] = "}"; +static const char __pyx_k__49[] = ","; static const char __pyx_k_dim[] = "dim"; static const char __pyx_k_end[] = "end"; static const char __pyx_k_gid[] = "gid"; @@ -2209,10 +2295,12 @@ static const char __pyx_k_gre[] = "gre"; static const char __pyx_k_inf[] = "inf"; static const char __pyx_k_nan[] = "nan"; +static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_file[] = "file"; static const char __pyx_k_gids[] = "gids"; static const char __pyx_k_gles[] = "gles"; @@ -2255,8 +2343,11 @@ static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_ngrids[] = "ngrids"; static const char __pyx_k_parent[] = "parent"; +static const char __pyx_k_pickle[] = "pickle"; +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_current[] = "current"; static const char __pyx_k_float64[] = "float64"; static const char __pyx_k_fortran[] = "fortran"; @@ -2267,11 +2358,13 @@ static const char __pyx_k_le_e_e_e[] = "\t le: %e %e %e"; static const char __pyx_k_max_node[] = "max_node"; static const char __pyx_k_previous[] = "previous"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_re_e_e_e[] = "\t re: %e %e %e"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_add_grids[] = "add_grids"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_left_edge[] = "left_edge"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_viewpoint[] = "viewpoint"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; @@ -2280,18 +2373,26 @@ static const char __pyx_k_step_depth[] = "step_depth"; 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_kd_traverse[] = "kd_traverse"; 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_kd_node_check[] = "kd_node_check"; static const char __pyx_k_kd_sum_volume[] = "kd_sum_volume"; static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_depth_traverse[] = "depth_traverse"; static const char __pyx_k_step_viewpoint[] = "step_viewpoint"; +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_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Node_kd_traverse[] = "Node.kd_traverse"; static const char __pyx_k_breadth_traverse[] = "breadth_traverse"; static const char __pyx_k_depth_first_touch[] = "depth_first_touch"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_viewpoint_traverse[] = "viewpoint_traverse"; static const char __pyx_k_Node_depth_traverse[] = "Node.depth_traverse"; @@ -2311,7 +2412,6 @@ static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_yt_utilities_lib_amr_kdtools[] = "yt.utilities.lib.amr_kdtools"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/amr_kdtools.pyx"; 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)"; @@ -2319,6 +2419,7 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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"; @@ -2326,8 +2427,10 @@ 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_yt_utilities_lib_amr_kdtools_pyx[] = "yt/utilities/lib/amr_kdtools.pyx"; 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_n_s_B; @@ -2340,6 +2443,7 @@ 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; @@ -2356,17 +2460,18 @@ 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_n_s_RuntimeError; static PyObject *__pyx_kp_b_T; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_kp_b__37; -static PyObject *__pyx_kp_b__38; -static PyObject *__pyx_kp_b__39; -static PyObject *__pyx_kp_b__40; -static PyObject *__pyx_kp_u__41; +static PyObject *__pyx_n_s_View_MemoryView; +static PyObject *__pyx_kp_b__45; +static PyObject *__pyx_kp_b__46; +static PyObject *__pyx_kp_b__47; +static PyObject *__pyx_kp_b__48; +static PyObject *__pyx_kp_u__49; static PyObject *__pyx_n_s_add_grids; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_args; @@ -2375,6 +2480,7 @@ 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_n_s_close; static PyObject *__pyx_kp_s_contiguous_and_direct; static PyObject *__pyx_kp_s_contiguous_and_indirect; @@ -2382,6 +2488,7 @@ static PyObject *__pyx_n_s_d; static PyObject *__pyx_n_s_depth_first_touch; static PyObject *__pyx_n_s_depth_traverse; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dim; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_dtype_is_object; @@ -2427,7 +2534,9 @@ 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_ngrids; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_node_id; static PyObject *__pyx_n_s_np; static PyObject *__pyx_n_s_numpy; @@ -2436,20 +2545,28 @@ static PyObject *__pyx_n_s_obj; static PyObject *__pyx_n_s_pack; static PyObject *__pyx_n_s_parent; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_previous; static PyObject *__pyx_n_s_print; static PyObject *__pyx_n_s_prod; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_q; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_rank; static PyObject *__pyx_kp_s_re_e_e_e; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_right; static PyObject *__pyx_n_s_right_edge; static PyObject *__pyx_kp_u_s; static PyObject *__pyx_n_s_send; +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; @@ -2461,6 +2578,7 @@ 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_throw; @@ -2468,9 +2586,11 @@ 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 PyObject *__pyx_n_s_viewpoint; static PyObject *__pyx_n_s_viewpoint_traverse; static PyObject *__pyx_n_s_yt_utilities_lib_amr_kdtools; +static PyObject *__pyx_kp_s_yt_utilities_lib_amr_kdtools_pyx; static int __pyx_pf_2yt_9utilities_3lib_11amr_kdtools_4Node___cinit__(struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_self, struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_parent, struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_left, struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_right, __Pyx_memviewslice __pyx_v_left_edge, __Pyx_memviewslice __pyx_v_right_edge, int __pyx_v_grid, __pyx_t_5numpy_int64_t __pyx_v_node_id); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_11amr_kdtools_4Node_2print_me(struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_11amr_kdtools_4Node_4get_split_dim(struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_self); /* proto */ @@ -2513,6 +2633,8 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_11amr_kdtools_4Node_4data___get__(struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_11amr_kdtools_4Node_4data_2__set__(struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_11amr_kdtools_4Node_4data_4__del__(struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_11amr_kdtools_4Node_49__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_11amr_kdtools_4Node_51__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_11amr_kdtools_step_depth(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_current, struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_previous); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_11amr_kdtools_2step_viewpoint(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_current, struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_previous, PyObject *__pyx_v_viewpoint); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ @@ -2524,8 +2646,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -2547,8 +2673,13 @@ 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_2yt_9utilities_3lib_11amr_kdtools_Node(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_11amr_kdtools___pyx_scope_struct__kd_traverse(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_11amr_kdtools___pyx_scope_struct_1_depth_traverse(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -2564,6 +2695,7 @@ static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; 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; @@ -2574,9 +2706,9 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__33; -static PyObject *__pyx_slice__34; -static PyObject *__pyx_slice__35; +static PyObject *__pyx_slice__39; +static PyObject *__pyx_slice__40; +static PyObject *__pyx_slice__41; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -2600,16 +2732,26 @@ static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__44; -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__43; -static PyObject *__pyx_codeobj__45; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_codeobj__51; +static PyObject *__pyx_codeobj__53; +static PyObject *__pyx_codeobj__60; /* "yt/utilities/lib/amr_kdtools.pyx":29 * cdef class Node: @@ -2640,12 +2782,19 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -2654,31 +2803,37 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 1); __PYX_ERR(0, 29, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 2); __PYX_ERR(0, 29, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 3); __PYX_ERR(0, 29, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 4); __PYX_ERR(0, 29, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 5); __PYX_ERR(0, 29, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--; else { @@ -3407,7 +3562,9 @@ 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; } @@ -3416,6 +3573,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--; else { @@ -3966,6 +4124,7 @@ 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; } @@ -3983,6 +4142,7 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } @@ -4440,10 +4600,15 @@ 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; } @@ -4452,21 +4617,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gle)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gre)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_pygrid", 1, 5, 5, 1); __PYX_ERR(0, 119, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gid)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_pygrid", 1, 5, 5, 2); __PYX_ERR(0, 119, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_pygrid", 1, 5, 5, 3); __PYX_ERR(0, 119, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { @@ -6033,11 +6202,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -6046,26 +6221,31 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ngrids)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gles)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_grids", 1, 6, 6, 1); __PYX_ERR(0, 207, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gres)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_grids", 1, 6, 6, 2); __PYX_ERR(0, 207, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gids)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_grids", 1, 6, 6, 3); __PYX_ERR(0, 207, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_grids", 1, 6, 6, 4); __PYX_ERR(0, 207, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { @@ -6535,7 +6715,7 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1); __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("yt.utilities.lib.amr_kdtools.Node.insert_grids", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.amr_kdtools.Node.insert_grids", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } @@ -8198,7 +8378,7 @@ __Pyx_XDECREF(__pyx_t_21); __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1); - __Pyx_WriteUnraisable("yt.utilities.lib.amr_kdtools.Node.split_grids", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.amr_kdtools.Node.split_grids", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __PYX_XDEC_MEMVIEW(&__pyx_v_less_gles, 1); @@ -8934,7 +9114,7 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); - __Pyx_WriteUnraisable("yt.utilities.lib.amr_kdtools.Node.divide", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.amr_kdtools.Node.divide", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __PYX_XDEC_MEMVIEW(&__pyx_v_le, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_re, 1); @@ -9628,6 +9808,7 @@ 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; } @@ -9645,6 +9826,7 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } @@ -10046,6 +10228,7 @@ 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; } @@ -10063,6 +10246,7 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } @@ -11350,7 +11534,7 @@ __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node))))) __PYX_ERR(1, 23, __pyx_L1_error) + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node))))) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -11455,7 +11639,7 @@ __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node))))) __PYX_ERR(1, 24, __pyx_L1_error) + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node))))) __PYX_ERR(2, 24, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -11560,7 +11744,7 @@ __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node))))) __PYX_ERR(1, 25, __pyx_L1_error) + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node))))) __PYX_ERR(2, 25, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -11637,7 +11821,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->grid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 26, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->grid); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11672,7 +11856,7 @@ __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 26, __pyx_L1_error) __pyx_v_self->grid = __pyx_t_1; /* function exit code */ @@ -11713,7 +11897,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->dirty); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->dirty); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11748,7 +11932,7 @@ __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 27, __pyx_L1_error) __pyx_v_self->dirty = __pyx_t_1; /* function exit code */ @@ -11789,7 +11973,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->node_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->node_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11824,7 +12008,7 @@ __Pyx_RefNannyDeclarations __pyx_t_5numpy_int64_t __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 28, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(2, 28, __pyx_L1_error) __pyx_v_self->node_id = __pyx_t_1; /* function exit code */ @@ -11865,7 +12049,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->node_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->node_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11900,7 +12084,7 @@ __Pyx_RefNannyDeclarations __pyx_t_5numpy_int64_t __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 29, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(2, 29, __pyx_L1_error) __pyx_v_self->node_ind = __pyx_t_1; /* function exit code */ @@ -12009,6 +12193,113 @@ 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_2yt_9utilities_3lib_11amr_kdtools_4Node_50__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_11amr_kdtools_4Node_50__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_2yt_9utilities_3lib_11amr_kdtools_4Node_49__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_11amr_kdtools_4Node_49__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__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__14, 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("yt.utilities.lib.amr_kdtools.Node.__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_2yt_9utilities_3lib_11amr_kdtools_4Node_52__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_11amr_kdtools_4Node_52__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_2yt_9utilities_3lib_11amr_kdtools_4Node_51__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_11amr_kdtools_4Node_51__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__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__15, 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("yt.utilities.lib.amr_kdtools.Node.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/utilities/lib/amr_kdtools.pyx":658 * @cython.wraparound(False) * @cython.cdivision(True) @@ -12253,7 +12544,9 @@ 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; } @@ -12262,6 +12555,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_current)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_previous)) != 0)) kw_args--; else { @@ -12655,8 +12949,11 @@ 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; } @@ -12665,11 +12962,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_current)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_previous)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("step_viewpoint", 1, 3, 3, 1); __PYX_ERR(0, 714, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_viewpoint)) != 0)) kw_args--; else { @@ -13884,8 +14183,8 @@ * cdef np.ndarray[np.float64_t, ndim=1] tarr = np.empty(my_max, dtype='float64') */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_tuple__14); - __pyx_r = __pyx_tuple__14; + __Pyx_INCREF(__pyx_tuple__16); + __pyx_r = __pyx_tuple__16; goto __pyx_L0; /* "yt/utilities/lib/amr_kdtools.pyx":806 @@ -14489,11 +14788,11 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 218, __pyx_L1_error) + __PYX_ERR(3, 218, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 @@ -14545,11 +14844,11 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 222, __pyx_L1_error) + __PYX_ERR(3, 222, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") @@ -14854,11 +15153,11 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 259, __pyx_L1_error) + __PYX_ERR(3, 259, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: @@ -15065,22 +15364,22 @@ * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 278, __pyx_L1_error) + __PYX_ERR(3, 278, __pyx_L1_error) break; } @@ -15147,7 +15446,7 @@ * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 @@ -15306,7 +15605,7 @@ * 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, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -15353,7 +15652,7 @@ * 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, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -15400,7 +15699,7 @@ * 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, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -15447,7 +15746,7 @@ * 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, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -15494,7 +15793,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -15575,15 +15874,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(2, 794, __pyx_L1_error) + __PYX_ERR(3, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_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, 794, __pyx_L1_error) + __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(3, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -15598,11 +15897,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 795, __pyx_L1_error) + __PYX_ERR(3, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -15623,7 +15922,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 796, __pyx_L1_error) + __PYX_ERR(3, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -15631,15 +15930,15 @@ __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, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -15652,12 +15951,12 @@ * 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, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -15669,11 +15968,11 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 799, __pyx_L1_error) + __PYX_ERR(3, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -15737,11 +16036,11 @@ * # 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__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 803, __pyx_L1_error) + __PYX_ERR(3, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -15760,11 +16059,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -15824,7 +16123,7 @@ * 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, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -15846,11 +16145,11 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 823, __pyx_L1_error) + __PYX_ERR(3, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -15868,11 +16167,11 @@ * 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, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -15886,11 +16185,11 @@ * 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, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -15904,11 +16203,11 @@ * 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, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -15922,11 +16221,11 @@ * 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, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -15940,11 +16239,11 @@ * 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, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -15958,11 +16257,11 @@ * 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, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -15976,11 +16275,11 @@ * 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, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -15994,11 +16293,11 @@ * 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, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -16012,11 +16311,11 @@ * 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, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -16030,11 +16329,11 @@ * 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, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -16048,11 +16347,11 @@ * 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, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -16066,11 +16365,11 @@ * 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, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -16084,11 +16383,11 @@ * 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, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -16102,11 +16401,11 @@ * 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, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -16122,11 +16421,11 @@ * 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, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -16142,11 +16441,11 @@ * 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, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -16162,11 +16461,11 @@ * 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, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -16181,19 +16480,19 @@ * 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, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 844, __pyx_L1_error) + __PYX_ERR(3, 844, __pyx_L1_error) } __pyx_L15:; @@ -16224,7 +16523,7 @@ * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(3, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; @@ -16488,7 +16787,7 @@ * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 987, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 * # Cython code. @@ -16501,7 +16800,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -16515,7 +16814,7 @@ __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, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 988, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -16527,11 +16826,11 @@ * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 989, __pyx_L5_except_error) + __PYX_ERR(3, 989, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -16549,7 +16848,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -16619,7 +16918,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 993, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * @@ -16632,7 +16931,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -16646,7 +16945,7 @@ __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, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 994, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -16658,11 +16957,11 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 995, __pyx_L5_except_error) + __PYX_ERR(3, 995, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -16680,7 +16979,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -16750,7 +17049,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 999, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * @@ -16763,7 +17062,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -16776,7 +17075,7 @@ __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, 1000, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -16786,11 +17085,11 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 1001, __pyx_L5_except_error) + __PYX_ERR(3, 1001, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -16808,7 +17107,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -16862,10 +17161,15 @@ 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; } @@ -16874,21 +17178,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -16896,12 +17204,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -16910,11 +17220,11 @@ } } __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(3, 120, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 121, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) } else { /* "View.MemoryView":121 @@ -16929,15 +17239,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(3, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(3, 120, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __pyx_L1_error) } __pyx_r = __pyx_array___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); @@ -16988,9 +17298,9 @@ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(3, 127, __pyx_L1_error) + __PYX_ERR(1, 127, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 127, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 @@ -17019,11 +17329,11 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 131, __pyx_L1_error) + __PYX_ERR(1, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize @@ -17051,11 +17361,11 @@ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 134, __pyx_L1_error) + __PYX_ERR(1, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") @@ -17084,9 +17394,9 @@ * 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(3, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -17108,7 +17418,7 @@ * 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(3, 138, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) __pyx_t_5 = __pyx_v_format; __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -17124,7 +17434,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -17162,11 +17472,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 146, __pyx_L1_error) + __PYX_ERR(1, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim @@ -17189,12 +17499,12 @@ 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(3, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 149, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dim = __pyx_t_8; __pyx_v_idx = __pyx_t_7; @@ -17217,11 +17527,11 @@ * self._shape[idx] = dim * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); @@ -17229,20 +17539,20 @@ 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(3, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(3, 151, __pyx_L1_error) + __PYX_ERR(1, 151, __pyx_L1_error) /* "View.MemoryView":150 * @@ -17279,7 +17589,7 @@ * 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(3, 155, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":156 @@ -17321,7 +17631,7 @@ * 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(3, 158, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":159 @@ -17364,19 +17674,19 @@ * 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(3, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 162, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 162, __pyx_L1_error) + __PYX_ERR(1, 162, __pyx_L1_error) } __pyx_L10:; @@ -17405,8 +17715,8 @@ * if allocate_buffer: * */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 168, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; @@ -17446,11 +17756,11 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 174, __pyx_L1_error) + __PYX_ERR(1, 174, __pyx_L1_error) /* "View.MemoryView":173 * @@ -17489,11 +17799,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(3, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __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(3, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { @@ -17614,7 +17924,7 @@ * 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(3, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -17644,7 +17954,7 @@ * 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(3, 187, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { @@ -17684,11 +17994,11 @@ * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 190, __pyx_L1_error) + __PYX_ERR(1, 190, __pyx_L1_error) /* "View.MemoryView":189 * elif self.mode == u"fortran": @@ -18028,7 +18338,7 @@ * @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(3, 221, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18087,11 +18397,11 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 226, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -18102,7 +18412,7 @@ 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(3, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -18166,9 +18476,9 @@ * 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(3, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -18231,9 +18541,9 @@ * 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(3, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 233, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -18294,9 +18604,9 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(3, 236, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":235 @@ -18319,6 +18629,113 @@ 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__32, 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__33, 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":240 * * @cname("__pyx_array_new") @@ -18355,13 +18772,13 @@ * 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(3, 245, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -18375,7 +18792,7 @@ __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(3, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -18399,13 +18816,13 @@ * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -18427,9 +18844,9 @@ * result.data = buf * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 248, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(3, 248, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) /* "View.MemoryView":247 * result = array(shape, itemsize, format, mode.decode('ASCII')) @@ -18438,7 +18855,7 @@ * 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(3, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -18514,6 +18931,7 @@ 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; } @@ -18524,7 +18942,7 @@ 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(3, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -18535,7 +18953,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18633,6 +19051,293 @@ 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":294 * * @cname('__pyx_align_pointer') @@ -18741,8 +19446,11 @@ 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; } @@ -18751,11 +19459,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(3, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -18763,11 +19473,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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; @@ -18775,16 +19486,16 @@ } } __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(3, 341, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 341, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18855,7 +19566,7 @@ * 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 == -1)) __PYX_ERR(3, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) /* "View.MemoryView":346 * if type(self) is memoryview or obj is not None: @@ -18976,7 +19687,7 @@ * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(3, 357, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) /* "View.MemoryView":356 * if self.lock is NULL: @@ -19317,26 +20028,26 @@ __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(3, 389, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 389, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(3, 389, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(3, 389, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -19346,7 +20057,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 389, __pyx_L1_error) + else __PYX_ERR(1, 389, __pyx_L1_error) } break; } @@ -19364,8 +20075,8 @@ * * 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(3, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":389 @@ -19482,7 +20193,7 @@ * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 399, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -19494,7 +20205,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 399, __pyx_L1_error) + __PYX_ERR(1, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -19502,14 +20213,14 @@ __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(3, 399, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 399, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 399, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; @@ -19523,7 +20234,7 @@ * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":403 @@ -19534,7 +20245,7 @@ * 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(3, 403, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -19557,7 +20268,7 @@ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(3, 405, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":406 @@ -19568,7 +20279,7 @@ * 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(3, 406, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -19638,7 +20349,7 @@ * * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 409, __pyx_L1_error) + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; @@ -19650,7 +20361,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 409, __pyx_L1_error) + __PYX_ERR(1, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); @@ -19658,14 +20369,14 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 409, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 409, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 409, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; @@ -19679,7 +20390,7 @@ * obj = self.is_slice(value) * if obj: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":412 @@ -19689,7 +20400,7 @@ * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 412, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; @@ -19701,7 +20412,7 @@ * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":414 @@ -19711,9 +20422,9 @@ * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 414, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -19736,10 +20447,10 @@ * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 416, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19764,7 +20475,7 @@ * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 418, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -19852,7 +20563,7 @@ * 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(3, 423, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":424 @@ -19862,7 +20573,7 @@ * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 424, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":423 @@ -19872,7 +20583,7 @@ * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 423, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -19883,7 +20594,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(3, 423, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -19900,7 +20611,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -19917,7 +20628,7 @@ __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(3, 425, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); @@ -19960,7 +20671,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -20032,7 +20743,7 @@ * 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(3, 434, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":435 * @@ -20041,7 +20752,7 @@ * 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(3, 435, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) /* "View.MemoryView":436 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], @@ -20050,13 +20761,13 @@ * * 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(3, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":434 @@ -20066,7 +20777,7 @@ * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 434, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":430 * return obj @@ -20172,7 +20883,7 @@ * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(3, 450, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) /* "View.MemoryView":449 * if self.view.itemsize > sizeof(array): @@ -20260,7 +20971,7 @@ * */ /*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(3, 459, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 459, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -20283,7 +20994,7 @@ * 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(3, 464, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20398,7 +21109,7 @@ * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(3, 471, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":472 @@ -20408,7 +21119,7 @@ * * 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(3, 472, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20467,7 +21178,7 @@ * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -20479,7 +21190,7 @@ * 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(3, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -20507,9 +21218,9 @@ * 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(3, 482, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 482, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -20526,7 +21237,7 @@ #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(3, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -20535,14 +21246,14 @@ #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(3, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 482, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -20553,7 +21264,7 @@ __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(3, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -20590,7 +21301,7 @@ * */ __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(3, 487, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20632,13 +21343,13 @@ * raise ValueError("Unable to convert item to object") * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 483, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(3, 483, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); @@ -20650,11 +21361,11 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(3, 484, __pyx_L5_except_error) + __PYX_ERR(1, 484, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -20745,7 +21456,7 @@ * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -20768,26 +21479,26 @@ * 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(3, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(3, 499, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -20809,9 +21520,9 @@ * 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(3, 501, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -20828,7 +21539,7 @@ #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(3, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -20837,14 +21548,14 @@ #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(3, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 501, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -20855,12 +21566,12 @@ __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(3, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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(3, 501, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 501, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } @@ -20876,7 +21587,7 @@ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(3, 503, __pyx_L1_error) + __PYX_ERR(1, 503, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -21263,9 +21974,9 @@ * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 540, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(3, 540, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; @@ -21276,7 +21987,7 @@ * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(3, 541, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) /* "View.MemoryView":542 * cdef _memoryviewslice result = memoryview_copy(self) @@ -21403,18 +22114,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 550, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_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(3, 550, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 550, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 550, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; @@ -21491,11 +22202,11 @@ * * 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(3, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(3, 556, __pyx_L1_error) + __PYX_ERR(1, 556, __pyx_L1_error) /* "View.MemoryView":554 * @property @@ -21514,18 +22225,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 558, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_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(3, 558, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 558, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 558, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; @@ -21603,9 +22314,9 @@ * 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(3, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__32, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__36, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -21629,18 +22340,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 565, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 565, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(3, 565, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 565, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -21702,7 +22413,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21762,7 +22473,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21824,11 +22535,11 @@ * @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(3, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 577, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -21922,7 +22633,7 @@ __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(3, 584, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; @@ -21934,7 +22645,7 @@ * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 585, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; @@ -22112,12 +22823,12 @@ * */ __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(3, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -22128,12 +22839,12 @@ * * def __str__(self): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 599, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -22144,7 +22855,7 @@ * id(self)) * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -22152,7 +22863,7 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -22216,20 +22927,20 @@ * */ __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(3, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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(3, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -22302,7 +23013,7 @@ * 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(3, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22373,7 +23084,7 @@ * 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(3, 615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22453,7 +23164,7 @@ * 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(3, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":627 @@ -22464,7 +23175,7 @@ * 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(3, 627, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -22545,7 +23256,7 @@ * 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(3, 634, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":639 @@ -22556,7 +23267,7 @@ * */ __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(3, 639, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -22581,6 +23292,113 @@ 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__37, 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__38, 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":643 * * @cname('__pyx_memoryview_new') @@ -22605,11 +23423,11 @@ * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -22620,7 +23438,7 @@ 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(3, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); @@ -22757,7 +23575,7 @@ * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -22795,7 +23613,7 @@ * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 662, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -22831,26 +23649,26 @@ __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(3, 665, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(3, 665, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(3, 665, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -22860,7 +23678,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 665, __pyx_L1_error) + else __PYX_ERR(1, 665, __pyx_L1_error) } break; } @@ -22870,7 +23688,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(3, 665, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -22904,17 +23722,17 @@ * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 668, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__33); - __Pyx_GIVEREF(__pyx_slice__33); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__33); + __Pyx_INCREF(__pyx_slice__39); + __Pyx_GIVEREF(__pyx_slice__39); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__39); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":669 @@ -22944,7 +23762,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__34); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__40); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) } __pyx_L7:; @@ -22994,19 +23812,19 @@ * * 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(3, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 675, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(3, 675, __pyx_L1_error) + __PYX_ERR(1, 675, __pyx_L1_error) /* "View.MemoryView":674 * have_slices = True @@ -23043,7 +23861,7 @@ * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 678, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) } __pyx_L6:; @@ -23065,7 +23883,7 @@ * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 680, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":681 @@ -23085,16 +23903,16 @@ * * 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(3, 682, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__35); - __Pyx_GIVEREF(__pyx_slice__35); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__35); + __Pyx_INCREF(__pyx_slice__41); + __Pyx_GIVEREF(__pyx_slice__41); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__41); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":681 @@ -23116,20 +23934,20 @@ __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(3, 684, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 684, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 684, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 684, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -23215,11 +24033,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 689, __pyx_L1_error) + __PYX_ERR(1, 689, __pyx_L1_error) /* "View.MemoryView":688 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): @@ -23323,7 +24141,7 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(3, 708, __pyx_L1_error) + __PYX_ERR(1, 708, __pyx_L1_error) } } #endif @@ -23346,7 +24164,7 @@ * 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(3, 711, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -23442,26 +24260,26 @@ __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(3, 732, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 732, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(3, 732, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(3, 732, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -23471,7 +24289,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 732, __pyx_L1_error) + else __PYX_ERR(1, 732, __pyx_L1_error) } break; } @@ -23499,7 +24317,7 @@ * 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(3, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) /* "View.MemoryView":734 * for dim, index in enumerate(indices): @@ -23508,7 +24326,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 734, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) /* "View.MemoryView":733 * @@ -23585,13 +24403,13 @@ * 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(3, 746, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 746, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -23607,13 +24425,13 @@ * 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(3, 747, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 747, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -23629,13 +24447,13 @@ * * 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(3, 748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 748, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -23651,7 +24469,7 @@ * 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(3, 750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -23664,7 +24482,7 @@ * 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(3, 751, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -23677,7 +24495,7 @@ * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 752, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -23690,7 +24508,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 754, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) /* "View.MemoryView":760 * have_start, have_stop, have_step, @@ -23740,7 +24558,7 @@ * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 764, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } /* "View.MemoryView":765 * return memoryview_fromslice(dst, new_ndim, @@ -23749,7 +24567,7 @@ * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 765, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } /* "View.MemoryView":763 * @@ -23758,9 +24576,9 @@ * 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(3, 763, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 763, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -23791,7 +24609,7 @@ * * */ - __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(3, 768, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":768 @@ -23801,7 +24619,7 @@ * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -23904,7 +24722,7 @@ * 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 == -1)) __PYX_ERR(3, 818, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: @@ -23969,7 +24787,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 824, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) /* "View.MemoryView":823 * negative_step = have_step != 0 and step < 0 @@ -24541,7 +25359,7 @@ * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 885, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) } __pyx_L26:; @@ -24598,11 +25416,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -24670,11 +25488,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(3, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __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(3, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); @@ -24782,22 +25600,22 @@ * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(3, 914, __pyx_L1_error) + __PYX_ERR(1, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: @@ -24834,22 +25652,22 @@ * * resultp = bufp + index * stride */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 917, __pyx_L1_error) + __PYX_ERR(1, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) @@ -25049,7 +25867,7 @@ * * return 1 */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 943, __pyx_L1_error) + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] @@ -25083,11 +25901,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -25172,7 +25990,7 @@ * 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(3, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -25196,7 +26014,7 @@ */ /*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(3, 969, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -25255,7 +26073,7 @@ * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(3, 973, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) /* "View.MemoryView":972 * @@ -25275,7 +26093,7 @@ * @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(3, 975, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -25355,6 +26173,113 @@ 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__43, 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__44, 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":985 * * @cname('__pyx_memoryview_fromslice') @@ -25418,9 +26343,9 @@ * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 999, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -25431,7 +26356,7 @@ __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(3, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -25462,7 +26387,7 @@ * 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(3, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -25633,7 +26558,7 @@ __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(3, 1026, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; @@ -25645,12 +26570,12 @@ * * 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(3, 1027, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1027, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1027, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } @@ -25742,7 +26667,7 @@ * 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(3, 1039, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -25799,7 +26724,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -25963,7 +26888,7 @@ * @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(3, 1067, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26086,7 +27011,7 @@ * * */ - __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(3, 1084, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; @@ -26884,7 +27809,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) /* "View.MemoryView":1207 * @@ -27056,11 +27981,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -27084,7 +28009,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -27095,13 +28020,13 @@ * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -27120,20 +28045,20 @@ * (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(3, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1237, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 1237, __pyx_L1_error) + __PYX_ERR(1, 1237, __pyx_L1_error) /* "View.MemoryView":1235 * @@ -27153,7 +28078,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -27175,7 +28100,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -27187,11 +28112,11 @@ * * @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(3, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -27207,14 +28132,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #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(3, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -27223,20 +28148,20 @@ #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(3, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -27244,7 +28169,7 @@ __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(3, 1242, __pyx_L1_error) + __PYX_ERR(1, 1242, __pyx_L1_error) /* "View.MemoryView":1241 * @@ -27266,7 +28191,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -27289,7 +28214,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -27311,7 +28236,7 @@ * 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(3, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -27325,14 +28250,14 @@ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #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(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -27341,20 +28266,20 @@ #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(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -27362,7 +28287,7 @@ __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(3, 1247, __pyx_L1_error) + __PYX_ERR(1, 1247, __pyx_L1_error) /* "View.MemoryView":1246 * @cname('__pyx_memoryview_err') @@ -27382,7 +28307,7 @@ */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(3, 1249, __pyx_L1_error) + __PYX_ERR(1, 1249, __pyx_L1_error) } /* "View.MemoryView":1245 @@ -27405,7 +28330,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -27623,7 +28548,7 @@ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 1281, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) } __pyx_L7:; @@ -27653,7 +28578,7 @@ * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 1284, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) /* "View.MemoryView":1283 * _err_extents(i, dst.shape[i], src.shape[i]) @@ -27710,7 +28635,7 @@ * src = tmp * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(3, 1291, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1292 @@ -27894,7 +28819,7 @@ * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(3, 1313, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) /* "View.MemoryView":1314 * @@ -27903,7 +28828,7 @@ * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(3, 1314, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) /* "View.MemoryView":1310 * return 0 @@ -27972,11 +28897,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -28156,7 +29081,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -28180,7 +29105,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -28490,6 +29415,469 @@ /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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; +} + /* "BufferFormatFromTypeInfo":1447 * * @cname('__pyx_format_from_typeinfo') @@ -28550,7 +29938,7 @@ __pyx_L4_bool_binop_done:; if (unlikely(!__pyx_t_1)) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(3, 1453, __pyx_L1_error) + __PYX_ERR(1, 1453, __pyx_L1_error) } } #endif @@ -28572,8 +29960,8 @@ * else: * alignment = b'' */ - __Pyx_INCREF(__pyx_kp_b__37); - __pyx_v_alignment = __pyx_kp_b__37; + __Pyx_INCREF(__pyx_kp_b__45); + __pyx_v_alignment = __pyx_kp_b__45; /* "BufferFormatFromTypeInfo":1455 * assert type.fields != NULL and type.fields.type != NULL @@ -28593,8 +29981,8 @@ * parts = [b"T{"] */ /*else*/ { - __Pyx_INCREF(__pyx_kp_b__38); - __pyx_v_alignment = __pyx_kp_b__38; + __Pyx_INCREF(__pyx_kp_b__46); + __pyx_v_alignment = __pyx_kp_b__46; } __pyx_L6:; @@ -28605,7 +29993,7 @@ * field = type.fields * */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1460, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_b_T); __Pyx_GIVEREF(__pyx_kp_b_T); @@ -28641,7 +30029,7 @@ * parts.append(part + b':' + field.name + b':') * field += 1 */ - __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1464, __pyx_L1_error) + __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -28653,18 +30041,18 @@ * field += 1 * */ - __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__39); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1465, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__47); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1465, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1465, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__39); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1465, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__47); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 1465, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "BufferFormatFromTypeInfo":1466 @@ -28684,12 +30072,12 @@ * else: * fmt = __Pyx_TypeInfoToFormat(type) */ - __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__40); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1468, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__48); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 1468, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(1, 1468, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; @@ -28730,22 +30118,22 @@ * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string * else: */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1472, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __pyx_v_type->ndim; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; - __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1472, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1472, __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 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 1472, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 1472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_extents = ((PyObject*)__pyx_t_6); @@ -28758,21 +30146,21 @@ * else: * result = fmt.string */ - __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__41, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1473, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__49, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1473, __pyx_L1_error) + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1473, __pyx_L1_error) + __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1473, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1473, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 1473, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 1473, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -28794,7 +30182,7 @@ * return result */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1475, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -28865,7 +30253,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_11amr_kdtools_Node(PyObject *o) { struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *p = (struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -28889,13 +30277,13 @@ int e; struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *p = (struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *)o; if (p->left) { - e = (*v)(((PyObject*)p->left), a); if (e) return e; + e = (*v)(((PyObject *)p->left), a); if (e) return e; } if (p->right) { - e = (*v)(((PyObject*)p->right), a); if (e) return e; + e = (*v)(((PyObject *)p->right), a); if (e) return e; } if (p->parent) { - e = (*v)(((PyObject*)p->parent), a); if (e) return e; + e = (*v)(((PyObject *)p->parent), a); if (e) return e; } if (p->data) { e = (*v)(p->data, a); if (e) return e; @@ -29050,6 +30438,8 @@ {"breadth_traverse", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_11amr_kdtools_4Node_42breadth_traverse, METH_NOARGS, __pyx_doc_2yt_9utilities_3lib_11amr_kdtools_4Node_41breadth_traverse}, {"viewpoint_traverse", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_11amr_kdtools_4Node_45viewpoint_traverse, METH_O, __pyx_doc_2yt_9utilities_3lib_11amr_kdtools_4Node_44viewpoint_traverse}, {"find_node", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_11amr_kdtools_4Node_48find_node, METH_O, __pyx_doc_2yt_9utilities_3lib_11amr_kdtools_4Node_47find_node}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_11amr_kdtools_4Node_50__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_11amr_kdtools_4Node_52__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -29158,10 +30548,10 @@ int e; struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools___pyx_scope_struct__kd_traverse *p = (struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools___pyx_scope_struct__kd_traverse *)o; if (p->__pyx_v_node) { - e = (*v)(((PyObject*)p->__pyx_v_node), a); if (e) return e; + e = (*v)(((PyObject *)p->__pyx_v_node), a); if (e) return e; } if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_viewpoint) { e = (*v)(p->__pyx_v_viewpoint, a); if (e) return e; @@ -29292,7 +30682,7 @@ e = (*v)(p->__pyx_v_previous, a); if (e) return e; } if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } return 0; } @@ -29417,7 +30807,7 @@ e = (*v)(p->__pyx_v_previous, a); if (e) return e; } if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } return 0; } @@ -29538,7 +30928,7 @@ e = (*v)(p->__pyx_v_previous, a); if (e) return e; } if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } return 0; } @@ -29657,7 +31047,7 @@ e = (*v)(p->__pyx_v_previous, a); if (e) return e; } if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_viewpoint) { e = (*v)(p->__pyx_v_viewpoint, a); if (e) return e; @@ -29765,7 +31155,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -29815,6 +31205,8 @@ 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} }; @@ -29934,7 +31326,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -29962,6 +31354,8 @@ } 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} }; @@ -30049,7 +31443,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -30161,6 +31555,8 @@ {"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} }; @@ -30286,7 +31682,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -30330,6 +31726,8 @@ } 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} }; @@ -30438,6 +31836,7 @@ {&__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}, @@ -30454,17 +31853,18 @@ {&__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_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 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_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_b__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 0, 0, 0}, - {&__pyx_kp_b__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 0, 0, 0}, - {&__pyx_kp_b__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 0, 0, 0}, - {&__pyx_kp_b__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 0, 0, 0}, - {&__pyx_kp_u__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 1, 0, 0}, + {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, + {&__pyx_kp_b__45, __pyx_k__45, sizeof(__pyx_k__45), 0, 0, 0, 0}, + {&__pyx_kp_b__46, __pyx_k__46, sizeof(__pyx_k__46), 0, 0, 0, 0}, + {&__pyx_kp_b__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 0, 0, 0}, + {&__pyx_kp_b__48, __pyx_k__48, sizeof(__pyx_k__48), 0, 0, 0, 0}, + {&__pyx_kp_u__49, __pyx_k__49, sizeof(__pyx_k__49), 0, 1, 0, 0}, {&__pyx_n_s_add_grids, __pyx_k_add_grids, sizeof(__pyx_k_add_grids), 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_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, @@ -30473,6 +31873,7 @@ {&__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_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 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}, @@ -30480,6 +31881,7 @@ {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_depth_first_touch, __pyx_k_depth_first_touch, sizeof(__pyx_k_depth_first_touch), 0, 0, 1, 1}, {&__pyx_n_s_depth_traverse, __pyx_k_depth_traverse, sizeof(__pyx_k_depth_traverse), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 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}, @@ -30525,7 +31927,9 @@ {&__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_ngrids, __pyx_k_ngrids, sizeof(__pyx_k_ngrids), 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_node_id, __pyx_k_node_id, sizeof(__pyx_k_node_id), 0, 0, 1, 1}, {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, @@ -30534,20 +31938,28 @@ {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_previous, __pyx_k_previous, sizeof(__pyx_k_previous), 0, 0, 1, 1}, {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, {&__pyx_n_s_prod, __pyx_k_prod, sizeof(__pyx_k_prod), 0, 0, 1, 1}, + {&__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_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_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rank, __pyx_k_rank, sizeof(__pyx_k_rank), 0, 0, 1, 1}, {&__pyx_kp_s_re_e_e_e, __pyx_k_re_e_e_e, sizeof(__pyx_k_re_e_e_e), 0, 0, 1, 0}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 0, 0, 1, 1}, {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 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}, @@ -30559,6 +31971,7 @@ {&__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_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, @@ -30566,22 +31979,24 @@ {&__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}, {&__pyx_n_s_viewpoint, __pyx_k_viewpoint, sizeof(__pyx_k_viewpoint), 0, 0, 1, 1}, {&__pyx_n_s_viewpoint_traverse, __pyx_k_viewpoint_traverse, sizeof(__pyx_k_viewpoint_traverse), 0, 0, 1, 1}, {&__pyx_n_s_yt_utilities_lib_amr_kdtools, __pyx_k_yt_utilities_lib_amr_kdtools, sizeof(__pyx_k_yt_utilities_lib_amr_kdtools), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_amr_kdtools_pyx, __pyx_k_yt_utilities_lib_amr_kdtools_pyx, sizeof(__pyx_k_yt_utilities_lib_amr_kdtools_pyx), 0, 0, 1, 0}, {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, 42, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 799, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 146, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(3, 149, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(3, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(3, 425, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(3, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(3, 818, __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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -30734,6 +32149,25 @@ __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); + /* "(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__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "(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__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + /* "yt/utilities/lib/amr_kdtools.pyx":807 * my_split = (n_unique-1)/2 * if best_dim == -1: @@ -30741,9 +32175,9 @@ * # I recognize how lame this is. * cdef np.ndarray[np.float64_t, ndim=1] tarr = np.empty(my_max, dtype='float64') */ - __pyx_tuple__14 = PyTuple_Pack(4, __pyx_int_neg_1, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__16 = PyTuple_Pack(4, __pyx_int_neg_1, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -30752,9 +32186,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -30763,9 +32197,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -30774,9 +32208,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -30785,9 +32219,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -30796,9 +32230,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -30807,9 +32241,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -30818,9 +32252,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -30829,18 +32263,18 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(3, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "View.MemoryView":131 * @@ -30849,9 +32283,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "View.MemoryView":134 * @@ -30860,9 +32294,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(3, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); /* "View.MemoryView":137 * @@ -30871,9 +32305,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(3, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "View.MemoryView":146 * @@ -30882,9 +32316,9 @@ * * */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -30893,9 +32327,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -30904,9 +32338,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(3, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "(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__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "(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__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -30915,9 +32368,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(3, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -30926,9 +32379,9 @@ * * 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(3, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); /* "View.MemoryView":563 * def suboffsets(self): @@ -30937,12 +32390,31 @@ * * 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(3, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); + __pyx_tuple__36 = PyTuple_New(1); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); __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); + PyTuple_SET_ITEM(__pyx_tuple__36, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "(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__37 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "(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__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); /* "View.MemoryView":668 * if item is Ellipsis: @@ -30951,9 +32423,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__33 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) __PYX_ERR(3, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__33); - __Pyx_GIVEREF(__pyx_slice__33); + __pyx_slice__39 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__39)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__39); + __Pyx_GIVEREF(__pyx_slice__39); /* "View.MemoryView":671 * seen_ellipsis = True @@ -30962,9 +32434,9 @@ * have_slices = True * else: */ - __pyx_slice__34 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__34)) __PYX_ERR(3, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__34); - __Pyx_GIVEREF(__pyx_slice__34); + __pyx_slice__40 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__40)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__40); + __Pyx_GIVEREF(__pyx_slice__40); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -30973,9 +32445,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__35 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__35)) __PYX_ERR(3, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__35); - __Pyx_GIVEREF(__pyx_slice__35); + __pyx_slice__41 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__41)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__41); + __Pyx_GIVEREF(__pyx_slice__41); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -30984,9 +32456,28 @@ * * */ - __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(3, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "(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__43 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "(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__44 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); /* "yt/utilities/lib/amr_kdtools.pyx":684 * return 0 @@ -30995,10 +32486,10 @@ * ''' * Takes a single step in the depth-first traversal */ - __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_current, __pyx_n_s_previous); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); - __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_step_depth, 684, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_current, __pyx_n_s_previous); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_amr_kdtools_pyx, __pyx_n_s_step_depth, 684, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 684, __pyx_L1_error) /* "yt/utilities/lib/amr_kdtools.pyx":714 * return current, previous @@ -31007,10 +32498,10 @@ * Node previous, * viewpoint): */ - __pyx_tuple__44 = PyTuple_Pack(3, __pyx_n_s_current, __pyx_n_s_previous, __pyx_n_s_viewpoint); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); - __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_step_viewpoint, 714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_tuple__52 = PyTuple_Pack(3, __pyx_n_s_current, __pyx_n_s_previous, __pyx_n_s_viewpoint); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_amr_kdtools_pyx, __pyx_n_s_step_viewpoint, 714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 714, __pyx_L1_error) /* "View.MemoryView":282 * return self.name @@ -31019,9 +32510,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(3, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); /* "View.MemoryView":283 * @@ -31030,9 +32521,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(3, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -31041,9 +32532,9 @@ * * */ - __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(3, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); /* "View.MemoryView":287 * @@ -31052,9 +32543,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(3, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); /* "View.MemoryView":288 * @@ -31063,9 +32554,19 @@ * * */ - __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(3, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__59 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -31080,6 +32581,7 @@ __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_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:; @@ -31143,6 +32645,7 @@ __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 @@ -31193,6 +32696,7 @@ __pyx_type_2yt_9utilities_3lib_11amr_kdtools_Node.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_11amr_kdtools_Node.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_11amr_kdtools_Node) < 0) __PYX_ERR(0, 27, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "Node", (PyObject *)&__pyx_type_2yt_9utilities_3lib_11amr_kdtools_Node) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_11amr_kdtools_Node) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node = &__pyx_type_2yt_9utilities_3lib_11amr_kdtools_Node; if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_11amr_kdtools___pyx_scope_struct__kd_traverse) < 0) __PYX_ERR(0, 108, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_11amr_kdtools___pyx_scope_struct__kd_traverse.tp_print = 0; @@ -31211,12 +32715,14 @@ __pyx_ptype_2yt_9utilities_3lib_11amr_kdtools___pyx_scope_struct_4_viewpoint_traverse = &__pyx_type_2yt_9utilities_3lib_11amr_kdtools___pyx_scope_struct_4_viewpoint_traverse; __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(3, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(3, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(3, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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; @@ -31226,18 +32732,20 @@ __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(3, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(3, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -31247,11 +32755,11 @@ sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(4, 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, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 861, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -31312,9 +32820,9 @@ * * 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(3, 207, __pyx_L1_error) + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(3, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_array_type); @@ -31325,7 +32833,7 @@ * 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(3, 282, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_1); @@ -31339,7 +32847,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 283, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_1); @@ -31353,7 +32861,7 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 284, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_1); @@ -31367,7 +32875,7 @@ * 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(3, 287, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_1); @@ -31381,7 +32889,7 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 288, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); @@ -31421,9 +32929,9 @@ * * */ - __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 535, __pyx_L1_error) + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(3, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_memoryview_type); @@ -31434,12 +32942,22 @@ * * */ - __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 981, __pyx_L1_error) + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(3, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_memoryviewslice_type); + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import 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; + /* "BufferFormatFromTypeInfo":1447 * * @cname('__pyx_format_from_typeinfo') @@ -31455,7 +32973,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.amr_kdtools", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.amr_kdtools", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -32448,17 +33966,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -32577,8 +34100,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON @@ -32618,11 +34141,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -32645,7 +34164,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -32666,7 +34185,7 @@ #endif /* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -32679,12 +34198,12 @@ } /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -32695,9 +34214,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -32710,9 +34232,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -32765,7 +34290,7 @@ } /* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE + #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; @@ -32789,7 +34314,7 @@ #endif /* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + 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; @@ -32831,20 +34356,20 @@ } /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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"); } /* IterFinish */ - static CYTHON_INLINE int __Pyx_IterFinish(void) { + static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; @@ -32879,7 +34404,7 @@ } /* UnpackItemEndCheck */ - static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); @@ -32891,7 +34416,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { if (op1 == op2) { Py_RETURN_TRUE; @@ -32976,7 +34501,7 @@ #endif /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -33092,7 +34617,7 @@ #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -33255,12 +34780,12 @@ #endif /* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -33284,7 +34809,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -33294,7 +34819,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -33355,7 +34880,7 @@ } /* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -33373,7 +34898,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -33393,7 +34927,7 @@ } /* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -33433,6 +34967,21 @@ 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; @@ -33477,7 +35026,7 @@ } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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)); @@ -33485,7 +35034,7 @@ } /* GetAttr */ - static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) @@ -33498,7 +35047,7 @@ } /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -33530,8 +35079,23 @@ } } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -33556,7 +35120,7 @@ #endif /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -33630,22 +35194,54 @@ } /* None */ - static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + 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; } +/* 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; + } +} + /* StringJoin */ - #if !CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); } #endif /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -33662,8 +35258,107 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -33743,7 +35438,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -33802,12 +35497,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -33846,8 +35544,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -33870,7 +35568,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -33906,7 +35604,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -33919,7 +35617,7 @@ } /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -33960,7 +35658,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -34142,7 +35840,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -34165,7 +35863,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -34187,7 +35885,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -34210,7 +35908,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -34233,7 +35931,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + 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) { @@ -34264,7 +35962,7 @@ } /* Print */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); if (!f) { @@ -34370,7 +36068,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -34401,7 +36099,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -34432,7 +36130,7 @@ } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); } static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { @@ -34444,7 +36142,7 @@ } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) { + 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) { @@ -34456,7 +36154,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = (ptrdiff_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -34487,7 +36185,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -34507,7 +36205,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -34642,7 +36340,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -34662,7 +36360,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -34797,7 +36495,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -34828,7 +36526,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -34895,7 +36593,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -35084,7 +36782,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -35273,7 +36971,7 @@ } /* TypeInfoToFormat */ - static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) { + static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) { struct __pyx_typeinfo_string result = { {0} }; char *buf = (char *) result.string; size_t size = type->size; @@ -35317,7 +37015,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -35506,7 +37204,7 @@ } /* PrintOne */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static int __Pyx_PrintOne(PyObject* f, PyObject *o) { if (!f) { if (!(f = __Pyx_GetStdout())) @@ -35543,7 +37241,7 @@ #endif /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + 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 @@ -35732,7 +37430,7 @@ } /* FetchCommonType */ - static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); @@ -35771,7 +37469,7 @@ } /* PyObjectCallMethod1 */ - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto done; @@ -35817,7 +37515,7 @@ } /* CoroutineBase */ - #include + #include #include static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); @@ -36350,7 +38048,7 @@ } /* PatchModuleWithCoroutine */ - static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { + static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; @@ -36390,7 +38088,7 @@ } /* PatchGeneratorABC */ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( @@ -36444,7 +38142,7 @@ } /* Generator */ - static PyMethodDef __pyx_Generator_methods[] = { + static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, @@ -36533,7 +38231,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -36556,7 +38254,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -36579,7 +38277,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -36595,7 +38293,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -36613,7 +38311,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -36678,7 +38376,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -36703,6 +38401,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -36711,11 +38411,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/api.py yt-3.4.0/yt/utilities/lib/api.py --- yt-3.3.3/yt/utilities/lib/api.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -24,7 +24,6 @@ from .image_utilities import * from .points_in_volume import * from .quad_tree import * -from .ray_integrators import * from .marching_cubes import * from .write_array import * from .mesh_utilities import * diff -Nru yt-3.3.3/yt/utilities/lib/autogenerated_element_samplers.c yt-3.4.0/yt/utilities/lib/autogenerated_element_samplers.c --- yt-3.3.3/yt/utilities/lib/autogenerated_element_samplers.c 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/autogenerated_element_samplers.c 2017-08-10 18:20:26.000000000 +0000 @@ -0,0 +1,2673 @@ +/* Generated by Cython 0.26rc2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [], + "include_dirs": [ + "yt/utilities/lib/" + ], + "name": "yt.utilities.lib.autogenerated_element_samplers", + "sources": [ + "yt/utilities/lib/autogenerated_element_samplers.pyx" + ] + }, + "module_name": "yt.utilities.lib.autogenerated_element_samplers" +} +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 < 0x03020000) + #error Cython requires Python 2.6+ or Python 3.2+. +#else +#define CYTHON_ABI "0_26rc2" +#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 >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#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_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !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 < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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 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 +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#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 +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#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 + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#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; \ +} + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__yt__utilities__lib__autogenerated_element_samplers +#define __PYX_HAVE_API__yt__utilities__lib__autogenerated_element_samplers +#include +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_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) && defined (_M_X64) + #define __Pyx_sst_abs(value) _abs64(value) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE 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_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) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_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; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; +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; + + +static const char *__pyx_f[] = { + "yt/utilities/lib/autogenerated_element_samplers.pyx", +}; + +/*--- Type declarations ---*/ + +/* --- 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) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + +/* 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); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + + +/* Module declarations from 'cython' */ + +/* Module declarations from 'libc.math' */ + +/* Module declarations from 'yt.utilities.lib.autogenerated_element_samplers' */ +#define __Pyx_MODULE_NAME "yt.utilities.lib.autogenerated_element_samplers" +int __pyx_module_is_main_yt__utilities__lib__autogenerated_element_samplers = 0; + +/* Implementation of 'yt.utilities.lib.autogenerated_element_samplers' */ +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_test; + +/* "yt/utilities/lib/autogenerated_element_samplers.pyx":14 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Q1Function3D(double* fx, # <<<<<<<<<<<<<< + * double* x, + * double* vertices, + */ + +static void __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Function3D(double *__pyx_v_fx, double *__pyx_v_x, double *__pyx_v_vertices, double *__pyx_v_phys_x) { + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":18 + * double* vertices, + * double* phys_x) nogil: + * fx[0] = 0.125*(1 - x[0])*(1 - x[1])*(1 - x[2])*vertices[0] + 0.125*(1 - x[0])*(1 - x[1])*(1 + x[2])*vertices[12] + 0.125*(1 - x[0])*(1 + x[1])*(1 - x[2])*vertices[9] + 0.125*(1 - x[0])*(1 + x[1])*(1 + x[2])*vertices[21] + 0.125*(1 + x[0])*(1 - x[1])*(1 - x[2])*vertices[3] + 0.125*(1 + x[0])*(1 - x[1])*(1 + x[2])*vertices[15] + 0.125*(1 + x[0])*(1 + x[1])*(1 - x[2])*vertices[6] + 0.125*(1 + x[0])*(1 + x[1])*(1 + x[2])*vertices[18] - phys_x[0]; # <<<<<<<<<<<<<< + * fx[1] = 0.125*(1 - x[0])*(1 - x[1])*(1 - x[2])*vertices[1] + 0.125*(1 - x[0])*(1 - x[1])*(1 + x[2])*vertices[13] + 0.125*(1 - x[0])*(1 + x[1])*(1 - x[2])*vertices[10] + 0.125*(1 - x[0])*(1 + x[1])*(1 + x[2])*vertices[22] + 0.125*(1 + x[0])*(1 - x[1])*(1 - x[2])*vertices[4] + 0.125*(1 + x[0])*(1 - x[1])*(1 + x[2])*vertices[16] + 0.125*(1 + x[0])*(1 + x[1])*(1 - x[2])*vertices[7] + 0.125*(1 + x[0])*(1 + x[1])*(1 + x[2])*vertices[19] - phys_x[1]; + * fx[2] = 0.125*(1 - x[0])*(1 - x[1])*(1 - x[2])*vertices[2] + 0.125*(1 - x[0])*(1 - x[1])*(1 + x[2])*vertices[14] + 0.125*(1 - x[0])*(1 + x[1])*(1 - x[2])*vertices[11] + 0.125*(1 - x[0])*(1 + x[1])*(1 + x[2])*vertices[23] + 0.125*(1 + x[0])*(1 - x[1])*(1 - x[2])*vertices[5] + 0.125*(1 + x[0])*(1 - x[1])*(1 + x[2])*vertices[17] + 0.125*(1 + x[0])*(1 + x[1])*(1 - x[2])*vertices[8] + 0.125*(1 + x[0])*(1 + x[1])*(1 + x[2])*vertices[20] - phys_x[2]; + */ + (__pyx_v_fx[0]) = ((((((((((((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[0])) + ((((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[12]))) + ((((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[9]))) + ((((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[21]))) + ((((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[3]))) + ((((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[15]))) + ((((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[6]))) + ((((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[18]))) - (__pyx_v_phys_x[0])); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":19 + * double* phys_x) nogil: + * fx[0] = 0.125*(1 - x[0])*(1 - x[1])*(1 - x[2])*vertices[0] + 0.125*(1 - x[0])*(1 - x[1])*(1 + x[2])*vertices[12] + 0.125*(1 - x[0])*(1 + x[1])*(1 - x[2])*vertices[9] + 0.125*(1 - x[0])*(1 + x[1])*(1 + x[2])*vertices[21] + 0.125*(1 + x[0])*(1 - x[1])*(1 - x[2])*vertices[3] + 0.125*(1 + x[0])*(1 - x[1])*(1 + x[2])*vertices[15] + 0.125*(1 + x[0])*(1 + x[1])*(1 - x[2])*vertices[6] + 0.125*(1 + x[0])*(1 + x[1])*(1 + x[2])*vertices[18] - phys_x[0]; + * fx[1] = 0.125*(1 - x[0])*(1 - x[1])*(1 - x[2])*vertices[1] + 0.125*(1 - x[0])*(1 - x[1])*(1 + x[2])*vertices[13] + 0.125*(1 - x[0])*(1 + x[1])*(1 - x[2])*vertices[10] + 0.125*(1 - x[0])*(1 + x[1])*(1 + x[2])*vertices[22] + 0.125*(1 + x[0])*(1 - x[1])*(1 - x[2])*vertices[4] + 0.125*(1 + x[0])*(1 - x[1])*(1 + x[2])*vertices[16] + 0.125*(1 + x[0])*(1 + x[1])*(1 - x[2])*vertices[7] + 0.125*(1 + x[0])*(1 + x[1])*(1 + x[2])*vertices[19] - phys_x[1]; # <<<<<<<<<<<<<< + * fx[2] = 0.125*(1 - x[0])*(1 - x[1])*(1 - x[2])*vertices[2] + 0.125*(1 - x[0])*(1 - x[1])*(1 + x[2])*vertices[14] + 0.125*(1 - x[0])*(1 + x[1])*(1 - x[2])*vertices[11] + 0.125*(1 - x[0])*(1 + x[1])*(1 + x[2])*vertices[23] + 0.125*(1 + x[0])*(1 - x[1])*(1 - x[2])*vertices[5] + 0.125*(1 + x[0])*(1 - x[1])*(1 + x[2])*vertices[17] + 0.125*(1 + x[0])*(1 + x[1])*(1 - x[2])*vertices[8] + 0.125*(1 + x[0])*(1 + x[1])*(1 + x[2])*vertices[20] - phys_x[2]; + * + */ + (__pyx_v_fx[1]) = ((((((((((((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[1])) + ((((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[13]))) + ((((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[10]))) + ((((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[22]))) + ((((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[4]))) + ((((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[16]))) + ((((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[7]))) + ((((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[19]))) - (__pyx_v_phys_x[1])); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":20 + * fx[0] = 0.125*(1 - x[0])*(1 - x[1])*(1 - x[2])*vertices[0] + 0.125*(1 - x[0])*(1 - x[1])*(1 + x[2])*vertices[12] + 0.125*(1 - x[0])*(1 + x[1])*(1 - x[2])*vertices[9] + 0.125*(1 - x[0])*(1 + x[1])*(1 + x[2])*vertices[21] + 0.125*(1 + x[0])*(1 - x[1])*(1 - x[2])*vertices[3] + 0.125*(1 + x[0])*(1 - x[1])*(1 + x[2])*vertices[15] + 0.125*(1 + x[0])*(1 + x[1])*(1 - x[2])*vertices[6] + 0.125*(1 + x[0])*(1 + x[1])*(1 + x[2])*vertices[18] - phys_x[0]; + * fx[1] = 0.125*(1 - x[0])*(1 - x[1])*(1 - x[2])*vertices[1] + 0.125*(1 - x[0])*(1 - x[1])*(1 + x[2])*vertices[13] + 0.125*(1 - x[0])*(1 + x[1])*(1 - x[2])*vertices[10] + 0.125*(1 - x[0])*(1 + x[1])*(1 + x[2])*vertices[22] + 0.125*(1 + x[0])*(1 - x[1])*(1 - x[2])*vertices[4] + 0.125*(1 + x[0])*(1 - x[1])*(1 + x[2])*vertices[16] + 0.125*(1 + x[0])*(1 + x[1])*(1 - x[2])*vertices[7] + 0.125*(1 + x[0])*(1 + x[1])*(1 + x[2])*vertices[19] - phys_x[1]; + * fx[2] = 0.125*(1 - x[0])*(1 - x[1])*(1 - x[2])*vertices[2] + 0.125*(1 - x[0])*(1 - x[1])*(1 + x[2])*vertices[14] + 0.125*(1 - x[0])*(1 + x[1])*(1 - x[2])*vertices[11] + 0.125*(1 - x[0])*(1 + x[1])*(1 + x[2])*vertices[23] + 0.125*(1 + x[0])*(1 - x[1])*(1 - x[2])*vertices[5] + 0.125*(1 + x[0])*(1 - x[1])*(1 + x[2])*vertices[17] + 0.125*(1 + x[0])*(1 + x[1])*(1 - x[2])*vertices[8] + 0.125*(1 + x[0])*(1 + x[1])*(1 + x[2])*vertices[20] - phys_x[2]; # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_fx[2]) = ((((((((((((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[2])) + ((((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[14]))) + ((((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[11]))) + ((((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[23]))) + ((((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[5]))) + ((((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[17]))) + ((((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[8]))) + ((((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[20]))) - (__pyx_v_phys_x[2])); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":14 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Q1Function3D(double* fx, # <<<<<<<<<<<<<< + * double* x, + * double* vertices, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/autogenerated_element_samplers.pyx":26 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Q1Jacobian3D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* tcol, + */ + +static void __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Jacobian3D(double *__pyx_v_rcol, double *__pyx_v_scol, double *__pyx_v_tcol, double *__pyx_v_x, double *__pyx_v_vertices, CYTHON_UNUSED double *__pyx_v_phys_x) { + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":32 + * double* vertices, + * double* phys_x) nogil: + * rcol[0] = -0.125*(1 - x[1])*(1 - x[2])*vertices[0] + 0.125*(1 - x[1])*(1 - x[2])*vertices[3] - 0.125*(1 - x[1])*(1 + x[2])*vertices[12] + 0.125*(1 - x[1])*(1 + x[2])*vertices[15] + 0.125*(1 + x[1])*(1 - x[2])*vertices[6] - 0.125*(1 + x[1])*(1 - x[2])*vertices[9] + 0.125*(1 + x[1])*(1 + x[2])*vertices[18] - 0.125*(1 + x[1])*(1 + x[2])*vertices[21]; # <<<<<<<<<<<<<< + * scol[0] = -0.125*(1 - x[0])*(1 - x[2])*vertices[0] + 0.125*(1 - x[0])*(1 - x[2])*vertices[9] - 0.125*(1 - x[0])*(1 + x[2])*vertices[12] + 0.125*(1 - x[0])*(1 + x[2])*vertices[21] - 0.125*(1 + x[0])*(1 - x[2])*vertices[3] + 0.125*(1 + x[0])*(1 - x[2])*vertices[6] - 0.125*(1 + x[0])*(1 + x[2])*vertices[15] + 0.125*(1 + x[0])*(1 + x[2])*vertices[18]; + * tcol[0] = -0.125*(1 - x[0])*(1 - x[1])*vertices[0] + 0.125*(1 - x[0])*(1 - x[1])*vertices[12] - 0.125*(1 - x[0])*(1 + x[1])*vertices[9] + 0.125*(1 - x[0])*(1 + x[1])*vertices[21] - 0.125*(1 + x[0])*(1 - x[1])*vertices[3] + 0.125*(1 + x[0])*(1 - x[1])*vertices[15] - 0.125*(1 + x[0])*(1 + x[1])*vertices[6] + 0.125*(1 + x[0])*(1 + x[1])*vertices[18]; + */ + (__pyx_v_rcol[0]) = ((((((((((-0.125 * (1.0 - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[0])) + (((0.125 * (1.0 - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[3]))) - (((0.125 * (1.0 - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[12]))) + (((0.125 * (1.0 - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[15]))) + (((0.125 * (1.0 + (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[6]))) - (((0.125 * (1.0 + (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[9]))) + (((0.125 * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[18]))) - (((0.125 * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[21]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":33 + * double* phys_x) nogil: + * rcol[0] = -0.125*(1 - x[1])*(1 - x[2])*vertices[0] + 0.125*(1 - x[1])*(1 - x[2])*vertices[3] - 0.125*(1 - x[1])*(1 + x[2])*vertices[12] + 0.125*(1 - x[1])*(1 + x[2])*vertices[15] + 0.125*(1 + x[1])*(1 - x[2])*vertices[6] - 0.125*(1 + x[1])*(1 - x[2])*vertices[9] + 0.125*(1 + x[1])*(1 + x[2])*vertices[18] - 0.125*(1 + x[1])*(1 + x[2])*vertices[21]; + * scol[0] = -0.125*(1 - x[0])*(1 - x[2])*vertices[0] + 0.125*(1 - x[0])*(1 - x[2])*vertices[9] - 0.125*(1 - x[0])*(1 + x[2])*vertices[12] + 0.125*(1 - x[0])*(1 + x[2])*vertices[21] - 0.125*(1 + x[0])*(1 - x[2])*vertices[3] + 0.125*(1 + x[0])*(1 - x[2])*vertices[6] - 0.125*(1 + x[0])*(1 + x[2])*vertices[15] + 0.125*(1 + x[0])*(1 + x[2])*vertices[18]; # <<<<<<<<<<<<<< + * tcol[0] = -0.125*(1 - x[0])*(1 - x[1])*vertices[0] + 0.125*(1 - x[0])*(1 - x[1])*vertices[12] - 0.125*(1 - x[0])*(1 + x[1])*vertices[9] + 0.125*(1 - x[0])*(1 + x[1])*vertices[21] - 0.125*(1 + x[0])*(1 - x[1])*vertices[3] + 0.125*(1 + x[0])*(1 - x[1])*vertices[15] - 0.125*(1 + x[0])*(1 + x[1])*vertices[6] + 0.125*(1 + x[0])*(1 + x[1])*vertices[18]; + * rcol[1] = -0.125*(1 - x[1])*(1 - x[2])*vertices[1] + 0.125*(1 - x[1])*(1 - x[2])*vertices[4] - 0.125*(1 - x[1])*(1 + x[2])*vertices[13] + 0.125*(1 - x[1])*(1 + x[2])*vertices[16] + 0.125*(1 + x[1])*(1 - x[2])*vertices[7] - 0.125*(1 + x[1])*(1 - x[2])*vertices[10] + 0.125*(1 + x[1])*(1 + x[2])*vertices[19] - 0.125*(1 + x[1])*(1 + x[2])*vertices[22]; + */ + (__pyx_v_scol[0]) = ((((((((((-0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[0])) + (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[9]))) - (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[12]))) + (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[21]))) - (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[3]))) + (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[6]))) - (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[15]))) + (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[18]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":34 + * rcol[0] = -0.125*(1 - x[1])*(1 - x[2])*vertices[0] + 0.125*(1 - x[1])*(1 - x[2])*vertices[3] - 0.125*(1 - x[1])*(1 + x[2])*vertices[12] + 0.125*(1 - x[1])*(1 + x[2])*vertices[15] + 0.125*(1 + x[1])*(1 - x[2])*vertices[6] - 0.125*(1 + x[1])*(1 - x[2])*vertices[9] + 0.125*(1 + x[1])*(1 + x[2])*vertices[18] - 0.125*(1 + x[1])*(1 + x[2])*vertices[21]; + * scol[0] = -0.125*(1 - x[0])*(1 - x[2])*vertices[0] + 0.125*(1 - x[0])*(1 - x[2])*vertices[9] - 0.125*(1 - x[0])*(1 + x[2])*vertices[12] + 0.125*(1 - x[0])*(1 + x[2])*vertices[21] - 0.125*(1 + x[0])*(1 - x[2])*vertices[3] + 0.125*(1 + x[0])*(1 - x[2])*vertices[6] - 0.125*(1 + x[0])*(1 + x[2])*vertices[15] + 0.125*(1 + x[0])*(1 + x[2])*vertices[18]; + * tcol[0] = -0.125*(1 - x[0])*(1 - x[1])*vertices[0] + 0.125*(1 - x[0])*(1 - x[1])*vertices[12] - 0.125*(1 - x[0])*(1 + x[1])*vertices[9] + 0.125*(1 - x[0])*(1 + x[1])*vertices[21] - 0.125*(1 + x[0])*(1 - x[1])*vertices[3] + 0.125*(1 + x[0])*(1 - x[1])*vertices[15] - 0.125*(1 + x[0])*(1 + x[1])*vertices[6] + 0.125*(1 + x[0])*(1 + x[1])*vertices[18]; # <<<<<<<<<<<<<< + * rcol[1] = -0.125*(1 - x[1])*(1 - x[2])*vertices[1] + 0.125*(1 - x[1])*(1 - x[2])*vertices[4] - 0.125*(1 - x[1])*(1 + x[2])*vertices[13] + 0.125*(1 - x[1])*(1 + x[2])*vertices[16] + 0.125*(1 + x[1])*(1 - x[2])*vertices[7] - 0.125*(1 + x[1])*(1 - x[2])*vertices[10] + 0.125*(1 + x[1])*(1 + x[2])*vertices[19] - 0.125*(1 + x[1])*(1 + x[2])*vertices[22]; + * scol[1] = -0.125*(1 - x[0])*(1 - x[2])*vertices[1] + 0.125*(1 - x[0])*(1 - x[2])*vertices[10] - 0.125*(1 - x[0])*(1 + x[2])*vertices[13] + 0.125*(1 - x[0])*(1 + x[2])*vertices[22] - 0.125*(1 + x[0])*(1 - x[2])*vertices[4] + 0.125*(1 + x[0])*(1 - x[2])*vertices[7] - 0.125*(1 + x[0])*(1 + x[2])*vertices[16] + 0.125*(1 + x[0])*(1 + x[2])*vertices[19]; + */ + (__pyx_v_tcol[0]) = ((((((((((-0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[0])) + (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[12]))) - (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[9]))) + (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[21]))) - (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[3]))) + (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[15]))) - (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[6]))) + (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[18]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":35 + * scol[0] = -0.125*(1 - x[0])*(1 - x[2])*vertices[0] + 0.125*(1 - x[0])*(1 - x[2])*vertices[9] - 0.125*(1 - x[0])*(1 + x[2])*vertices[12] + 0.125*(1 - x[0])*(1 + x[2])*vertices[21] - 0.125*(1 + x[0])*(1 - x[2])*vertices[3] + 0.125*(1 + x[0])*(1 - x[2])*vertices[6] - 0.125*(1 + x[0])*(1 + x[2])*vertices[15] + 0.125*(1 + x[0])*(1 + x[2])*vertices[18]; + * tcol[0] = -0.125*(1 - x[0])*(1 - x[1])*vertices[0] + 0.125*(1 - x[0])*(1 - x[1])*vertices[12] - 0.125*(1 - x[0])*(1 + x[1])*vertices[9] + 0.125*(1 - x[0])*(1 + x[1])*vertices[21] - 0.125*(1 + x[0])*(1 - x[1])*vertices[3] + 0.125*(1 + x[0])*(1 - x[1])*vertices[15] - 0.125*(1 + x[0])*(1 + x[1])*vertices[6] + 0.125*(1 + x[0])*(1 + x[1])*vertices[18]; + * rcol[1] = -0.125*(1 - x[1])*(1 - x[2])*vertices[1] + 0.125*(1 - x[1])*(1 - x[2])*vertices[4] - 0.125*(1 - x[1])*(1 + x[2])*vertices[13] + 0.125*(1 - x[1])*(1 + x[2])*vertices[16] + 0.125*(1 + x[1])*(1 - x[2])*vertices[7] - 0.125*(1 + x[1])*(1 - x[2])*vertices[10] + 0.125*(1 + x[1])*(1 + x[2])*vertices[19] - 0.125*(1 + x[1])*(1 + x[2])*vertices[22]; # <<<<<<<<<<<<<< + * scol[1] = -0.125*(1 - x[0])*(1 - x[2])*vertices[1] + 0.125*(1 - x[0])*(1 - x[2])*vertices[10] - 0.125*(1 - x[0])*(1 + x[2])*vertices[13] + 0.125*(1 - x[0])*(1 + x[2])*vertices[22] - 0.125*(1 + x[0])*(1 - x[2])*vertices[4] + 0.125*(1 + x[0])*(1 - x[2])*vertices[7] - 0.125*(1 + x[0])*(1 + x[2])*vertices[16] + 0.125*(1 + x[0])*(1 + x[2])*vertices[19]; + * tcol[1] = -0.125*(1 - x[0])*(1 - x[1])*vertices[1] + 0.125*(1 - x[0])*(1 - x[1])*vertices[13] - 0.125*(1 - x[0])*(1 + x[1])*vertices[10] + 0.125*(1 - x[0])*(1 + x[1])*vertices[22] - 0.125*(1 + x[0])*(1 - x[1])*vertices[4] + 0.125*(1 + x[0])*(1 - x[1])*vertices[16] - 0.125*(1 + x[0])*(1 + x[1])*vertices[7] + 0.125*(1 + x[0])*(1 + x[1])*vertices[19]; + */ + (__pyx_v_rcol[1]) = ((((((((((-0.125 * (1.0 - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[1])) + (((0.125 * (1.0 - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[4]))) - (((0.125 * (1.0 - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[13]))) + (((0.125 * (1.0 - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[16]))) + (((0.125 * (1.0 + (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[7]))) - (((0.125 * (1.0 + (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[10]))) + (((0.125 * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[19]))) - (((0.125 * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[22]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":36 + * tcol[0] = -0.125*(1 - x[0])*(1 - x[1])*vertices[0] + 0.125*(1 - x[0])*(1 - x[1])*vertices[12] - 0.125*(1 - x[0])*(1 + x[1])*vertices[9] + 0.125*(1 - x[0])*(1 + x[1])*vertices[21] - 0.125*(1 + x[0])*(1 - x[1])*vertices[3] + 0.125*(1 + x[0])*(1 - x[1])*vertices[15] - 0.125*(1 + x[0])*(1 + x[1])*vertices[6] + 0.125*(1 + x[0])*(1 + x[1])*vertices[18]; + * rcol[1] = -0.125*(1 - x[1])*(1 - x[2])*vertices[1] + 0.125*(1 - x[1])*(1 - x[2])*vertices[4] - 0.125*(1 - x[1])*(1 + x[2])*vertices[13] + 0.125*(1 - x[1])*(1 + x[2])*vertices[16] + 0.125*(1 + x[1])*(1 - x[2])*vertices[7] - 0.125*(1 + x[1])*(1 - x[2])*vertices[10] + 0.125*(1 + x[1])*(1 + x[2])*vertices[19] - 0.125*(1 + x[1])*(1 + x[2])*vertices[22]; + * scol[1] = -0.125*(1 - x[0])*(1 - x[2])*vertices[1] + 0.125*(1 - x[0])*(1 - x[2])*vertices[10] - 0.125*(1 - x[0])*(1 + x[2])*vertices[13] + 0.125*(1 - x[0])*(1 + x[2])*vertices[22] - 0.125*(1 + x[0])*(1 - x[2])*vertices[4] + 0.125*(1 + x[0])*(1 - x[2])*vertices[7] - 0.125*(1 + x[0])*(1 + x[2])*vertices[16] + 0.125*(1 + x[0])*(1 + x[2])*vertices[19]; # <<<<<<<<<<<<<< + * tcol[1] = -0.125*(1 - x[0])*(1 - x[1])*vertices[1] + 0.125*(1 - x[0])*(1 - x[1])*vertices[13] - 0.125*(1 - x[0])*(1 + x[1])*vertices[10] + 0.125*(1 - x[0])*(1 + x[1])*vertices[22] - 0.125*(1 + x[0])*(1 - x[1])*vertices[4] + 0.125*(1 + x[0])*(1 - x[1])*vertices[16] - 0.125*(1 + x[0])*(1 + x[1])*vertices[7] + 0.125*(1 + x[0])*(1 + x[1])*vertices[19]; + * rcol[2] = -0.125*(1 - x[1])*(1 - x[2])*vertices[2] + 0.125*(1 - x[1])*(1 - x[2])*vertices[5] - 0.125*(1 - x[1])*(1 + x[2])*vertices[14] + 0.125*(1 - x[1])*(1 + x[2])*vertices[17] + 0.125*(1 + x[1])*(1 - x[2])*vertices[8] - 0.125*(1 + x[1])*(1 - x[2])*vertices[11] + 0.125*(1 + x[1])*(1 + x[2])*vertices[20] - 0.125*(1 + x[1])*(1 + x[2])*vertices[23]; + */ + (__pyx_v_scol[1]) = ((((((((((-0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[1])) + (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[10]))) - (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[13]))) + (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[22]))) - (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[4]))) + (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[7]))) - (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[16]))) + (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[19]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":37 + * rcol[1] = -0.125*(1 - x[1])*(1 - x[2])*vertices[1] + 0.125*(1 - x[1])*(1 - x[2])*vertices[4] - 0.125*(1 - x[1])*(1 + x[2])*vertices[13] + 0.125*(1 - x[1])*(1 + x[2])*vertices[16] + 0.125*(1 + x[1])*(1 - x[2])*vertices[7] - 0.125*(1 + x[1])*(1 - x[2])*vertices[10] + 0.125*(1 + x[1])*(1 + x[2])*vertices[19] - 0.125*(1 + x[1])*(1 + x[2])*vertices[22]; + * scol[1] = -0.125*(1 - x[0])*(1 - x[2])*vertices[1] + 0.125*(1 - x[0])*(1 - x[2])*vertices[10] - 0.125*(1 - x[0])*(1 + x[2])*vertices[13] + 0.125*(1 - x[0])*(1 + x[2])*vertices[22] - 0.125*(1 + x[0])*(1 - x[2])*vertices[4] + 0.125*(1 + x[0])*(1 - x[2])*vertices[7] - 0.125*(1 + x[0])*(1 + x[2])*vertices[16] + 0.125*(1 + x[0])*(1 + x[2])*vertices[19]; + * tcol[1] = -0.125*(1 - x[0])*(1 - x[1])*vertices[1] + 0.125*(1 - x[0])*(1 - x[1])*vertices[13] - 0.125*(1 - x[0])*(1 + x[1])*vertices[10] + 0.125*(1 - x[0])*(1 + x[1])*vertices[22] - 0.125*(1 + x[0])*(1 - x[1])*vertices[4] + 0.125*(1 + x[0])*(1 - x[1])*vertices[16] - 0.125*(1 + x[0])*(1 + x[1])*vertices[7] + 0.125*(1 + x[0])*(1 + x[1])*vertices[19]; # <<<<<<<<<<<<<< + * rcol[2] = -0.125*(1 - x[1])*(1 - x[2])*vertices[2] + 0.125*(1 - x[1])*(1 - x[2])*vertices[5] - 0.125*(1 - x[1])*(1 + x[2])*vertices[14] + 0.125*(1 - x[1])*(1 + x[2])*vertices[17] + 0.125*(1 + x[1])*(1 - x[2])*vertices[8] - 0.125*(1 + x[1])*(1 - x[2])*vertices[11] + 0.125*(1 + x[1])*(1 + x[2])*vertices[20] - 0.125*(1 + x[1])*(1 + x[2])*vertices[23]; + * scol[2] = -0.125*(1 - x[0])*(1 - x[2])*vertices[2] + 0.125*(1 - x[0])*(1 - x[2])*vertices[11] - 0.125*(1 - x[0])*(1 + x[2])*vertices[14] + 0.125*(1 - x[0])*(1 + x[2])*vertices[23] - 0.125*(1 + x[0])*(1 - x[2])*vertices[5] + 0.125*(1 + x[0])*(1 - x[2])*vertices[8] - 0.125*(1 + x[0])*(1 + x[2])*vertices[17] + 0.125*(1 + x[0])*(1 + x[2])*vertices[20]; + */ + (__pyx_v_tcol[1]) = ((((((((((-0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[1])) + (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[13]))) - (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[10]))) + (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[22]))) - (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[4]))) + (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[16]))) - (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[7]))) + (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[19]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":38 + * scol[1] = -0.125*(1 - x[0])*(1 - x[2])*vertices[1] + 0.125*(1 - x[0])*(1 - x[2])*vertices[10] - 0.125*(1 - x[0])*(1 + x[2])*vertices[13] + 0.125*(1 - x[0])*(1 + x[2])*vertices[22] - 0.125*(1 + x[0])*(1 - x[2])*vertices[4] + 0.125*(1 + x[0])*(1 - x[2])*vertices[7] - 0.125*(1 + x[0])*(1 + x[2])*vertices[16] + 0.125*(1 + x[0])*(1 + x[2])*vertices[19]; + * tcol[1] = -0.125*(1 - x[0])*(1 - x[1])*vertices[1] + 0.125*(1 - x[0])*(1 - x[1])*vertices[13] - 0.125*(1 - x[0])*(1 + x[1])*vertices[10] + 0.125*(1 - x[0])*(1 + x[1])*vertices[22] - 0.125*(1 + x[0])*(1 - x[1])*vertices[4] + 0.125*(1 + x[0])*(1 - x[1])*vertices[16] - 0.125*(1 + x[0])*(1 + x[1])*vertices[7] + 0.125*(1 + x[0])*(1 + x[1])*vertices[19]; + * rcol[2] = -0.125*(1 - x[1])*(1 - x[2])*vertices[2] + 0.125*(1 - x[1])*(1 - x[2])*vertices[5] - 0.125*(1 - x[1])*(1 + x[2])*vertices[14] + 0.125*(1 - x[1])*(1 + x[2])*vertices[17] + 0.125*(1 + x[1])*(1 - x[2])*vertices[8] - 0.125*(1 + x[1])*(1 - x[2])*vertices[11] + 0.125*(1 + x[1])*(1 + x[2])*vertices[20] - 0.125*(1 + x[1])*(1 + x[2])*vertices[23]; # <<<<<<<<<<<<<< + * scol[2] = -0.125*(1 - x[0])*(1 - x[2])*vertices[2] + 0.125*(1 - x[0])*(1 - x[2])*vertices[11] - 0.125*(1 - x[0])*(1 + x[2])*vertices[14] + 0.125*(1 - x[0])*(1 + x[2])*vertices[23] - 0.125*(1 + x[0])*(1 - x[2])*vertices[5] + 0.125*(1 + x[0])*(1 - x[2])*vertices[8] - 0.125*(1 + x[0])*(1 + x[2])*vertices[17] + 0.125*(1 + x[0])*(1 + x[2])*vertices[20]; + * tcol[2] = -0.125*(1 - x[0])*(1 - x[1])*vertices[2] + 0.125*(1 - x[0])*(1 - x[1])*vertices[14] - 0.125*(1 - x[0])*(1 + x[1])*vertices[11] + 0.125*(1 - x[0])*(1 + x[1])*vertices[23] - 0.125*(1 + x[0])*(1 - x[1])*vertices[5] + 0.125*(1 + x[0])*(1 - x[1])*vertices[17] - 0.125*(1 + x[0])*(1 + x[1])*vertices[8] + 0.125*(1 + x[0])*(1 + x[1])*vertices[20]; + */ + (__pyx_v_rcol[2]) = ((((((((((-0.125 * (1.0 - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[2])) + (((0.125 * (1.0 - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[5]))) - (((0.125 * (1.0 - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[14]))) + (((0.125 * (1.0 - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[17]))) + (((0.125 * (1.0 + (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[8]))) - (((0.125 * (1.0 + (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[11]))) + (((0.125 * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[20]))) - (((0.125 * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[23]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":39 + * tcol[1] = -0.125*(1 - x[0])*(1 - x[1])*vertices[1] + 0.125*(1 - x[0])*(1 - x[1])*vertices[13] - 0.125*(1 - x[0])*(1 + x[1])*vertices[10] + 0.125*(1 - x[0])*(1 + x[1])*vertices[22] - 0.125*(1 + x[0])*(1 - x[1])*vertices[4] + 0.125*(1 + x[0])*(1 - x[1])*vertices[16] - 0.125*(1 + x[0])*(1 + x[1])*vertices[7] + 0.125*(1 + x[0])*(1 + x[1])*vertices[19]; + * rcol[2] = -0.125*(1 - x[1])*(1 - x[2])*vertices[2] + 0.125*(1 - x[1])*(1 - x[2])*vertices[5] - 0.125*(1 - x[1])*(1 + x[2])*vertices[14] + 0.125*(1 - x[1])*(1 + x[2])*vertices[17] + 0.125*(1 + x[1])*(1 - x[2])*vertices[8] - 0.125*(1 + x[1])*(1 - x[2])*vertices[11] + 0.125*(1 + x[1])*(1 + x[2])*vertices[20] - 0.125*(1 + x[1])*(1 + x[2])*vertices[23]; + * scol[2] = -0.125*(1 - x[0])*(1 - x[2])*vertices[2] + 0.125*(1 - x[0])*(1 - x[2])*vertices[11] - 0.125*(1 - x[0])*(1 + x[2])*vertices[14] + 0.125*(1 - x[0])*(1 + x[2])*vertices[23] - 0.125*(1 + x[0])*(1 - x[2])*vertices[5] + 0.125*(1 + x[0])*(1 - x[2])*vertices[8] - 0.125*(1 + x[0])*(1 + x[2])*vertices[17] + 0.125*(1 + x[0])*(1 + x[2])*vertices[20]; # <<<<<<<<<<<<<< + * tcol[2] = -0.125*(1 - x[0])*(1 - x[1])*vertices[2] + 0.125*(1 - x[0])*(1 - x[1])*vertices[14] - 0.125*(1 - x[0])*(1 + x[1])*vertices[11] + 0.125*(1 - x[0])*(1 + x[1])*vertices[23] - 0.125*(1 + x[0])*(1 - x[1])*vertices[5] + 0.125*(1 + x[0])*(1 - x[1])*vertices[17] - 0.125*(1 + x[0])*(1 + x[1])*vertices[8] + 0.125*(1 + x[0])*(1 + x[1])*vertices[20]; + * + */ + (__pyx_v_scol[2]) = ((((((((((-0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[2])) + (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[11]))) - (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[14]))) + (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[23]))) - (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[5]))) + (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[8]))) - (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[17]))) + (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[20]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":40 + * rcol[2] = -0.125*(1 - x[1])*(1 - x[2])*vertices[2] + 0.125*(1 - x[1])*(1 - x[2])*vertices[5] - 0.125*(1 - x[1])*(1 + x[2])*vertices[14] + 0.125*(1 - x[1])*(1 + x[2])*vertices[17] + 0.125*(1 + x[1])*(1 - x[2])*vertices[8] - 0.125*(1 + x[1])*(1 - x[2])*vertices[11] + 0.125*(1 + x[1])*(1 + x[2])*vertices[20] - 0.125*(1 + x[1])*(1 + x[2])*vertices[23]; + * scol[2] = -0.125*(1 - x[0])*(1 - x[2])*vertices[2] + 0.125*(1 - x[0])*(1 - x[2])*vertices[11] - 0.125*(1 - x[0])*(1 + x[2])*vertices[14] + 0.125*(1 - x[0])*(1 + x[2])*vertices[23] - 0.125*(1 + x[0])*(1 - x[2])*vertices[5] + 0.125*(1 + x[0])*(1 - x[2])*vertices[8] - 0.125*(1 + x[0])*(1 + x[2])*vertices[17] + 0.125*(1 + x[0])*(1 + x[2])*vertices[20]; + * tcol[2] = -0.125*(1 - x[0])*(1 - x[1])*vertices[2] + 0.125*(1 - x[0])*(1 - x[1])*vertices[14] - 0.125*(1 - x[0])*(1 + x[1])*vertices[11] + 0.125*(1 - x[0])*(1 + x[1])*vertices[23] - 0.125*(1 + x[0])*(1 - x[1])*vertices[5] + 0.125*(1 + x[0])*(1 - x[1])*vertices[17] - 0.125*(1 + x[0])*(1 + x[1])*vertices[8] + 0.125*(1 + x[0])*(1 + x[1])*vertices[20]; # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_tcol[2]) = ((((((((((-0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[2])) + (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[14]))) - (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[11]))) + (((0.125 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[23]))) - (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[5]))) + (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[17]))) - (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[8]))) + (((0.125 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[20]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":26 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Q1Jacobian3D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* tcol, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/autogenerated_element_samplers.pyx":46 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Q1Function2D(double* fx, # <<<<<<<<<<<<<< + * double* x, + * double* vertices, + */ + +static void __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Function2D(double *__pyx_v_fx, double *__pyx_v_x, double *__pyx_v_vertices, double *__pyx_v_phys_x) { + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":50 + * double* vertices, + * double* phys_x) nogil: + * fx[0] = 0.25*(1 - x[0])*(1 - x[1])*vertices[0] + 0.25*(1 - x[0])*(1 + x[1])*vertices[6] + 0.25*(1 + x[0])*(1 - x[1])*vertices[2] + 0.25*(1 + x[0])*(1 + x[1])*vertices[4] - phys_x[0]; # <<<<<<<<<<<<<< + * fx[1] = 0.25*(1 - x[0])*(1 - x[1])*vertices[1] + 0.25*(1 - x[0])*(1 + x[1])*vertices[7] + 0.25*(1 + x[0])*(1 - x[1])*vertices[3] + 0.25*(1 + x[0])*(1 + x[1])*vertices[5] - phys_x[1]; + * + */ + (__pyx_v_fx[0]) = (((((((0.25 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[0])) + (((0.25 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[6]))) + (((0.25 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[2]))) + (((0.25 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[4]))) - (__pyx_v_phys_x[0])); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":51 + * double* phys_x) nogil: + * fx[0] = 0.25*(1 - x[0])*(1 - x[1])*vertices[0] + 0.25*(1 - x[0])*(1 + x[1])*vertices[6] + 0.25*(1 + x[0])*(1 - x[1])*vertices[2] + 0.25*(1 + x[0])*(1 + x[1])*vertices[4] - phys_x[0]; + * fx[1] = 0.25*(1 - x[0])*(1 - x[1])*vertices[1] + 0.25*(1 - x[0])*(1 + x[1])*vertices[7] + 0.25*(1 + x[0])*(1 - x[1])*vertices[3] + 0.25*(1 + x[0])*(1 + x[1])*vertices[5] - phys_x[1]; # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_fx[1]) = (((((((0.25 * (1.0 - (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[1])) + (((0.25 * (1.0 - (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[7]))) + (((0.25 * (1.0 + (__pyx_v_x[0]))) * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[3]))) + (((0.25 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[5]))) - (__pyx_v_phys_x[1])); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":46 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Q1Function2D(double* fx, # <<<<<<<<<<<<<< + * double* x, + * double* vertices, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/autogenerated_element_samplers.pyx":57 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Q1Jacobian2D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* x, + */ + +static void __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Jacobian2D(double *__pyx_v_rcol, double *__pyx_v_scol, double *__pyx_v_x, double *__pyx_v_vertices, CYTHON_UNUSED double *__pyx_v_phys_x) { + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":62 + * double* vertices, + * double* phys_x) nogil: + * rcol[0] = -0.25*(1 - x[1])*vertices[0] + 0.25*(1 - x[1])*vertices[2] + 0.25*(1 + x[1])*vertices[4] - 0.25*(1 + x[1])*vertices[6]; # <<<<<<<<<<<<<< + * scol[0] = -0.25*(1 - x[0])*vertices[0] + 0.25*(1 - x[0])*vertices[6] - 0.25*(1 + x[0])*vertices[2] + 0.25*(1 + x[0])*vertices[4]; + * rcol[1] = -0.25*(1 - x[1])*vertices[1] + 0.25*(1 - x[1])*vertices[3] + 0.25*(1 + x[1])*vertices[5] - 0.25*(1 + x[1])*vertices[7]; + */ + (__pyx_v_rcol[0]) = (((((-0.25 * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[0])) + ((0.25 * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[2]))) + ((0.25 * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[4]))) - ((0.25 * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[6]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":63 + * double* phys_x) nogil: + * rcol[0] = -0.25*(1 - x[1])*vertices[0] + 0.25*(1 - x[1])*vertices[2] + 0.25*(1 + x[1])*vertices[4] - 0.25*(1 + x[1])*vertices[6]; + * scol[0] = -0.25*(1 - x[0])*vertices[0] + 0.25*(1 - x[0])*vertices[6] - 0.25*(1 + x[0])*vertices[2] + 0.25*(1 + x[0])*vertices[4]; # <<<<<<<<<<<<<< + * rcol[1] = -0.25*(1 - x[1])*vertices[1] + 0.25*(1 - x[1])*vertices[3] + 0.25*(1 + x[1])*vertices[5] - 0.25*(1 + x[1])*vertices[7]; + * scol[1] = -0.25*(1 - x[0])*vertices[1] + 0.25*(1 - x[0])*vertices[7] - 0.25*(1 + x[0])*vertices[3] + 0.25*(1 + x[0])*vertices[5]; + */ + (__pyx_v_scol[0]) = (((((-0.25 * (1.0 - (__pyx_v_x[0]))) * (__pyx_v_vertices[0])) + ((0.25 * (1.0 - (__pyx_v_x[0]))) * (__pyx_v_vertices[6]))) - ((0.25 * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[2]))) + ((0.25 * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[4]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":64 + * rcol[0] = -0.25*(1 - x[1])*vertices[0] + 0.25*(1 - x[1])*vertices[2] + 0.25*(1 + x[1])*vertices[4] - 0.25*(1 + x[1])*vertices[6]; + * scol[0] = -0.25*(1 - x[0])*vertices[0] + 0.25*(1 - x[0])*vertices[6] - 0.25*(1 + x[0])*vertices[2] + 0.25*(1 + x[0])*vertices[4]; + * rcol[1] = -0.25*(1 - x[1])*vertices[1] + 0.25*(1 - x[1])*vertices[3] + 0.25*(1 + x[1])*vertices[5] - 0.25*(1 + x[1])*vertices[7]; # <<<<<<<<<<<<<< + * scol[1] = -0.25*(1 - x[0])*vertices[1] + 0.25*(1 - x[0])*vertices[7] - 0.25*(1 + x[0])*vertices[3] + 0.25*(1 + x[0])*vertices[5]; + * + */ + (__pyx_v_rcol[1]) = (((((-0.25 * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[1])) + ((0.25 * (1.0 - (__pyx_v_x[1]))) * (__pyx_v_vertices[3]))) + ((0.25 * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[5]))) - ((0.25 * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[7]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":65 + * scol[0] = -0.25*(1 - x[0])*vertices[0] + 0.25*(1 - x[0])*vertices[6] - 0.25*(1 + x[0])*vertices[2] + 0.25*(1 + x[0])*vertices[4]; + * rcol[1] = -0.25*(1 - x[1])*vertices[1] + 0.25*(1 - x[1])*vertices[3] + 0.25*(1 + x[1])*vertices[5] - 0.25*(1 + x[1])*vertices[7]; + * scol[1] = -0.25*(1 - x[0])*vertices[1] + 0.25*(1 - x[0])*vertices[7] - 0.25*(1 + x[0])*vertices[3] + 0.25*(1 + x[0])*vertices[5]; # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_scol[1]) = (((((-0.25 * (1.0 - (__pyx_v_x[0]))) * (__pyx_v_vertices[1])) + ((0.25 * (1.0 - (__pyx_v_x[0]))) * (__pyx_v_vertices[7]))) - ((0.25 * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[3]))) + ((0.25 * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[5]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":57 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Q1Jacobian2D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* x, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/autogenerated_element_samplers.pyx":71 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Q2Function2D(double* fx, # <<<<<<<<<<<<<< + * double* x, + * double* vertices, + */ + +static void __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q2Function2D(double *__pyx_v_fx, double *__pyx_v_x, double *__pyx_v_vertices, double *__pyx_v_phys_x) { + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":75 + * double* vertices, + * double* phys_x) nogil: + * fx[0] = (1 + x[0])*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[16] - 0.5*(1 + x[0])*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[8] - 0.5*(1 + x[0])*(-1 + x[0])*x[1]*(1 + x[1])*vertices[12] - phys_x[0] - 0.5*x[0]*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[14] + 0.25*x[0]*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[0] + 0.25*x[0]*(-1 + x[0])*x[1]*(1 + x[1])*vertices[6] - 0.5*x[0]*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[10] + 0.25*x[0]*(1 + x[0])*x[1]*(-1 + x[1])*vertices[2] + 0.25*x[0]*(1 + x[0])*x[1]*(1 + x[1])*vertices[4]; # <<<<<<<<<<<<<< + * fx[1] = (1 + x[0])*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] - 0.5*(1 + x[0])*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[9] - 0.5*(1 + x[0])*(-1 + x[0])*x[1]*(1 + x[1])*vertices[13] - phys_x[1] - 0.5*x[0]*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[15] + 0.25*x[0]*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[1] + 0.25*x[0]*(-1 + x[0])*x[1]*(1 + x[1])*vertices[7] - 0.5*x[0]*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[11] + 0.25*x[0]*(1 + x[0])*x[1]*(-1 + x[1])*vertices[3] + 0.25*x[0]*(1 + x[0])*x[1]*(1 + x[1])*vertices[5]; + * + */ + (__pyx_v_fx[0]) = ((((((((((((((1.0 + (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[16])) - (((((0.5 * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[8]))) - (((((0.5 * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[12]))) - (__pyx_v_phys_x[0])) - (((((0.5 * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[14]))) + (((((0.25 * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[0]))) + (((((0.25 * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[6]))) - (((((0.5 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[10]))) + (((((0.25 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[2]))) + (((((0.25 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[4]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":76 + * double* phys_x) nogil: + * fx[0] = (1 + x[0])*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[16] - 0.5*(1 + x[0])*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[8] - 0.5*(1 + x[0])*(-1 + x[0])*x[1]*(1 + x[1])*vertices[12] - phys_x[0] - 0.5*x[0]*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[14] + 0.25*x[0]*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[0] + 0.25*x[0]*(-1 + x[0])*x[1]*(1 + x[1])*vertices[6] - 0.5*x[0]*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[10] + 0.25*x[0]*(1 + x[0])*x[1]*(-1 + x[1])*vertices[2] + 0.25*x[0]*(1 + x[0])*x[1]*(1 + x[1])*vertices[4]; + * fx[1] = (1 + x[0])*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] - 0.5*(1 + x[0])*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[9] - 0.5*(1 + x[0])*(-1 + x[0])*x[1]*(1 + x[1])*vertices[13] - phys_x[1] - 0.5*x[0]*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[15] + 0.25*x[0]*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[1] + 0.25*x[0]*(-1 + x[0])*x[1]*(1 + x[1])*vertices[7] - 0.5*x[0]*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[11] + 0.25*x[0]*(1 + x[0])*x[1]*(-1 + x[1])*vertices[3] + 0.25*x[0]*(1 + x[0])*x[1]*(1 + x[1])*vertices[5]; # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_fx[1]) = ((((((((((((((1.0 + (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[17])) - (((((0.5 * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[9]))) - (((((0.5 * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[13]))) - (__pyx_v_phys_x[1])) - (((((0.5 * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[15]))) + (((((0.25 * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[1]))) + (((((0.25 * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[7]))) - (((((0.5 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[11]))) + (((((0.25 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[3]))) + (((((0.25 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[5]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":71 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Q2Function2D(double* fx, # <<<<<<<<<<<<<< + * double* x, + * double* vertices, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/autogenerated_element_samplers.pyx":82 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Q2Jacobian2D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* x, + */ + +static void __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q2Jacobian2D(double *__pyx_v_rcol, double *__pyx_v_scol, double *__pyx_v_x, double *__pyx_v_vertices, CYTHON_UNUSED double *__pyx_v_phys_x) { + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":87 + * double* vertices, + * double* phys_x) nogil: + * rcol[0] = -0.5*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[14] + (-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[16] + 0.25*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[0] - 0.5*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[8] + 0.25*(-1 + x[0])*x[1]*(1 + x[1])*vertices[6] - 0.5*(-1 + x[0])*x[1]*(1 + x[1])*vertices[12] - 0.5*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[10] + (1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[16] + 0.25*(1 + x[0])*x[1]*(-1 + x[1])*vertices[2] - 0.5*(1 + x[0])*x[1]*(-1 + x[1])*vertices[8] + 0.25*(1 + x[0])*x[1]*(1 + x[1])*vertices[4] - 0.5*(1 + x[0])*x[1]*(1 + x[1])*vertices[12] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[10] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[14] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[0] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[2] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[4] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[6]; # <<<<<<<<<<<<<< + * scol[0] = -0.5*(-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[8] + (-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[16] + 0.25*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[0] - 0.5*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[14] + 0.25*(-1 + x[1])*x[0]*(1 + x[0])*vertices[2] - 0.5*(-1 + x[1])*x[0]*(1 + x[0])*vertices[10] - 0.5*(1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[12] + (1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[16] + 0.25*(1 + x[1])*x[0]*(-1 + x[0])*vertices[6] - 0.5*(1 + x[1])*x[0]*(-1 + x[0])*vertices[14] + 0.25*(1 + x[1])*x[0]*(1 + x[0])*vertices[4] - 0.5*(1 + x[1])*x[0]*(1 + x[0])*vertices[10] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[8] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[12] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[0] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[6] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[2] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[4]; + * rcol[1] = -0.5*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[15] + (-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] + 0.25*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[1] - 0.5*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[9] + 0.25*(-1 + x[0])*x[1]*(1 + x[1])*vertices[7] - 0.5*(-1 + x[0])*x[1]*(1 + x[1])*vertices[13] - 0.5*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[11] + (1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] + 0.25*(1 + x[0])*x[1]*(-1 + x[1])*vertices[3] - 0.5*(1 + x[0])*x[1]*(-1 + x[1])*vertices[9] + 0.25*(1 + x[0])*x[1]*(1 + x[1])*vertices[5] - 0.5*(1 + x[0])*x[1]*(1 + x[1])*vertices[13] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[11] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[15] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[1] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[3] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[5] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[7]; + */ + (__pyx_v_rcol[0]) = (((((((((((((((((((((-0.5 * (-1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[14])) + ((((-1.0 + (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[16]))) + ((((0.25 * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[0]))) - ((((0.5 * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[8]))) + ((((0.25 * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[6]))) - ((((0.5 * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[12]))) - ((((0.5 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[10]))) + ((((1.0 + (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[16]))) + ((((0.25 * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[2]))) - ((((0.5 * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[8]))) + ((((0.25 * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[4]))) - ((((0.5 * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[12]))) - ((((0.5 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[10]))) - ((((0.5 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[14]))) + ((((0.25 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[0]))) + ((((0.25 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[2]))) + ((((0.25 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[4]))) + ((((0.25 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[6]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":88 + * double* phys_x) nogil: + * rcol[0] = -0.5*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[14] + (-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[16] + 0.25*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[0] - 0.5*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[8] + 0.25*(-1 + x[0])*x[1]*(1 + x[1])*vertices[6] - 0.5*(-1 + x[0])*x[1]*(1 + x[1])*vertices[12] - 0.5*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[10] + (1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[16] + 0.25*(1 + x[0])*x[1]*(-1 + x[1])*vertices[2] - 0.5*(1 + x[0])*x[1]*(-1 + x[1])*vertices[8] + 0.25*(1 + x[0])*x[1]*(1 + x[1])*vertices[4] - 0.5*(1 + x[0])*x[1]*(1 + x[1])*vertices[12] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[10] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[14] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[0] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[2] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[4] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[6]; + * scol[0] = -0.5*(-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[8] + (-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[16] + 0.25*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[0] - 0.5*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[14] + 0.25*(-1 + x[1])*x[0]*(1 + x[0])*vertices[2] - 0.5*(-1 + x[1])*x[0]*(1 + x[0])*vertices[10] - 0.5*(1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[12] + (1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[16] + 0.25*(1 + x[1])*x[0]*(-1 + x[0])*vertices[6] - 0.5*(1 + x[1])*x[0]*(-1 + x[0])*vertices[14] + 0.25*(1 + x[1])*x[0]*(1 + x[0])*vertices[4] - 0.5*(1 + x[1])*x[0]*(1 + x[0])*vertices[10] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[8] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[12] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[0] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[6] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[2] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[4]; # <<<<<<<<<<<<<< + * rcol[1] = -0.5*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[15] + (-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] + 0.25*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[1] - 0.5*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[9] + 0.25*(-1 + x[0])*x[1]*(1 + x[1])*vertices[7] - 0.5*(-1 + x[0])*x[1]*(1 + x[1])*vertices[13] - 0.5*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[11] + (1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] + 0.25*(1 + x[0])*x[1]*(-1 + x[1])*vertices[3] - 0.5*(1 + x[0])*x[1]*(-1 + x[1])*vertices[9] + 0.25*(1 + x[0])*x[1]*(1 + x[1])*vertices[5] - 0.5*(1 + x[0])*x[1]*(1 + x[1])*vertices[13] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[11] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[15] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[1] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[3] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[5] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[7]; + * scol[1] = -0.5*(-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[9] + (-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[17] + 0.25*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[1] - 0.5*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[15] + 0.25*(-1 + x[1])*x[0]*(1 + x[0])*vertices[3] - 0.5*(-1 + x[1])*x[0]*(1 + x[0])*vertices[11] - 0.5*(1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[13] + (1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[17] + 0.25*(1 + x[1])*x[0]*(-1 + x[0])*vertices[7] - 0.5*(1 + x[1])*x[0]*(-1 + x[0])*vertices[15] + 0.25*(1 + x[1])*x[0]*(1 + x[0])*vertices[5] - 0.5*(1 + x[1])*x[0]*(1 + x[0])*vertices[11] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[9] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[13] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[1] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[7] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[3] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[5]; + */ + (__pyx_v_scol[0]) = (((((((((((((((((((((-0.5 * (-1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[8])) + ((((-1.0 + (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[16]))) + ((((0.25 * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[0]))) - ((((0.5 * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[14]))) + ((((0.25 * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[2]))) - ((((0.5 * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[10]))) - ((((0.5 * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[12]))) + ((((1.0 + (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[16]))) + ((((0.25 * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[6]))) - ((((0.5 * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[14]))) + ((((0.25 * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[4]))) - ((((0.5 * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[10]))) - ((((0.5 * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[8]))) - ((((0.5 * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[12]))) + ((((0.25 * (__pyx_v_x[1])) * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[0]))) + ((((0.25 * (__pyx_v_x[1])) * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[6]))) + ((((0.25 * (__pyx_v_x[1])) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[2]))) + ((((0.25 * (__pyx_v_x[1])) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[4]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":89 + * rcol[0] = -0.5*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[14] + (-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[16] + 0.25*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[0] - 0.5*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[8] + 0.25*(-1 + x[0])*x[1]*(1 + x[1])*vertices[6] - 0.5*(-1 + x[0])*x[1]*(1 + x[1])*vertices[12] - 0.5*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[10] + (1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[16] + 0.25*(1 + x[0])*x[1]*(-1 + x[1])*vertices[2] - 0.5*(1 + x[0])*x[1]*(-1 + x[1])*vertices[8] + 0.25*(1 + x[0])*x[1]*(1 + x[1])*vertices[4] - 0.5*(1 + x[0])*x[1]*(1 + x[1])*vertices[12] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[10] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[14] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[0] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[2] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[4] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[6]; + * scol[0] = -0.5*(-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[8] + (-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[16] + 0.25*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[0] - 0.5*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[14] + 0.25*(-1 + x[1])*x[0]*(1 + x[0])*vertices[2] - 0.5*(-1 + x[1])*x[0]*(1 + x[0])*vertices[10] - 0.5*(1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[12] + (1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[16] + 0.25*(1 + x[1])*x[0]*(-1 + x[0])*vertices[6] - 0.5*(1 + x[1])*x[0]*(-1 + x[0])*vertices[14] + 0.25*(1 + x[1])*x[0]*(1 + x[0])*vertices[4] - 0.5*(1 + x[1])*x[0]*(1 + x[0])*vertices[10] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[8] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[12] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[0] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[6] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[2] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[4]; + * rcol[1] = -0.5*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[15] + (-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] + 0.25*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[1] - 0.5*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[9] + 0.25*(-1 + x[0])*x[1]*(1 + x[1])*vertices[7] - 0.5*(-1 + x[0])*x[1]*(1 + x[1])*vertices[13] - 0.5*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[11] + (1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] + 0.25*(1 + x[0])*x[1]*(-1 + x[1])*vertices[3] - 0.5*(1 + x[0])*x[1]*(-1 + x[1])*vertices[9] + 0.25*(1 + x[0])*x[1]*(1 + x[1])*vertices[5] - 0.5*(1 + x[0])*x[1]*(1 + x[1])*vertices[13] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[11] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[15] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[1] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[3] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[5] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[7]; # <<<<<<<<<<<<<< + * scol[1] = -0.5*(-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[9] + (-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[17] + 0.25*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[1] - 0.5*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[15] + 0.25*(-1 + x[1])*x[0]*(1 + x[0])*vertices[3] - 0.5*(-1 + x[1])*x[0]*(1 + x[0])*vertices[11] - 0.5*(1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[13] + (1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[17] + 0.25*(1 + x[1])*x[0]*(-1 + x[0])*vertices[7] - 0.5*(1 + x[1])*x[0]*(-1 + x[0])*vertices[15] + 0.25*(1 + x[1])*x[0]*(1 + x[0])*vertices[5] - 0.5*(1 + x[1])*x[0]*(1 + x[0])*vertices[11] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[9] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[13] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[1] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[7] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[3] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[5]; + * + */ + (__pyx_v_rcol[1]) = (((((((((((((((((((((-0.5 * (-1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[15])) + ((((-1.0 + (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[17]))) + ((((0.25 * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[1]))) - ((((0.5 * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[9]))) + ((((0.25 * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[7]))) - ((((0.5 * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[13]))) - ((((0.5 * (1.0 + (__pyx_v_x[0]))) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[11]))) + ((((1.0 + (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[17]))) + ((((0.25 * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[3]))) - ((((0.5 * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[9]))) + ((((0.25 * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[5]))) - ((((0.5 * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[13]))) - ((((0.5 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[11]))) - ((((0.5 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[1]))) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[15]))) + ((((0.25 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[1]))) + ((((0.25 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[3]))) + ((((0.25 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[5]))) + ((((0.25 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_vertices[7]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":90 + * scol[0] = -0.5*(-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[8] + (-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[16] + 0.25*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[0] - 0.5*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[14] + 0.25*(-1 + x[1])*x[0]*(1 + x[0])*vertices[2] - 0.5*(-1 + x[1])*x[0]*(1 + x[0])*vertices[10] - 0.5*(1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[12] + (1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[16] + 0.25*(1 + x[1])*x[0]*(-1 + x[0])*vertices[6] - 0.5*(1 + x[1])*x[0]*(-1 + x[0])*vertices[14] + 0.25*(1 + x[1])*x[0]*(1 + x[0])*vertices[4] - 0.5*(1 + x[1])*x[0]*(1 + x[0])*vertices[10] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[8] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[12] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[0] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[6] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[2] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[4]; + * rcol[1] = -0.5*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[15] + (-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] + 0.25*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[1] - 0.5*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[9] + 0.25*(-1 + x[0])*x[1]*(1 + x[1])*vertices[7] - 0.5*(-1 + x[0])*x[1]*(1 + x[1])*vertices[13] - 0.5*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[11] + (1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] + 0.25*(1 + x[0])*x[1]*(-1 + x[1])*vertices[3] - 0.5*(1 + x[0])*x[1]*(-1 + x[1])*vertices[9] + 0.25*(1 + x[0])*x[1]*(1 + x[1])*vertices[5] - 0.5*(1 + x[0])*x[1]*(1 + x[1])*vertices[13] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[11] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[15] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[1] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[3] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[5] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[7]; + * scol[1] = -0.5*(-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[9] + (-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[17] + 0.25*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[1] - 0.5*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[15] + 0.25*(-1 + x[1])*x[0]*(1 + x[0])*vertices[3] - 0.5*(-1 + x[1])*x[0]*(1 + x[0])*vertices[11] - 0.5*(1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[13] + (1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[17] + 0.25*(1 + x[1])*x[0]*(-1 + x[0])*vertices[7] - 0.5*(1 + x[1])*x[0]*(-1 + x[0])*vertices[15] + 0.25*(1 + x[1])*x[0]*(1 + x[0])*vertices[5] - 0.5*(1 + x[1])*x[0]*(1 + x[0])*vertices[11] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[9] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[13] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[1] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[7] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[3] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[5]; # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_scol[1]) = (((((((((((((((((((((-0.5 * (-1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[9])) + ((((-1.0 + (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[17]))) + ((((0.25 * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[1]))) - ((((0.5 * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[15]))) + ((((0.25 * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[3]))) - ((((0.5 * (-1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[11]))) - ((((0.5 * (1.0 + (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[13]))) + ((((1.0 + (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[17]))) + ((((0.25 * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[7]))) - ((((0.5 * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[15]))) + ((((0.25 * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[5]))) - ((((0.5 * (1.0 + (__pyx_v_x[1]))) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[11]))) - ((((0.5 * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[9]))) - ((((0.5 * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[0]))) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[13]))) + ((((0.25 * (__pyx_v_x[1])) * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[1]))) + ((((0.25 * (__pyx_v_x[1])) * (__pyx_v_x[0])) * (-1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[7]))) + ((((0.25 * (__pyx_v_x[1])) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[3]))) + ((((0.25 * (__pyx_v_x[1])) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[0]))) * (__pyx_v_vertices[5]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":82 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Q2Jacobian2D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* x, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/autogenerated_element_samplers.pyx":96 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Tet2Function3D(double* fx, # <<<<<<<<<<<<<< + * double* x, + * double* vertices, + */ + +static void __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Tet2Function3D(double *__pyx_v_fx, double *__pyx_v_x, double *__pyx_v_vertices, double *__pyx_v_phys_x) { + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":100 + * double* vertices, + * double* phys_x) nogil: + * fx[0] = (-x[0] + 2*pow(x[0], 2))*vertices[3] + (-x[1] + 2*pow(x[1], 2))*vertices[6] + (-x[2] + 2*pow(x[2], 2))*vertices[9] + (4*x[0] - 4*x[0]*x[1] - 4*x[0]*x[2] - 4*pow(x[0], 2))*vertices[12] + (4*x[1] - 4*x[1]*x[0] - 4*x[1]*x[2] - 4*pow(x[1], 2))*vertices[18] + (4*x[2] - 4*x[2]*x[0] - 4*x[2]*x[1] - 4*pow(x[2], 2))*vertices[21] + (1 - 3*x[0] + 4*x[0]*x[1] + 4*x[0]*x[2] + 2*pow(x[0], 2) - 3*x[1] + 4*x[1]*x[2] + 2*pow(x[1], 2) - 3*x[2] + 2*pow(x[2], 2))*vertices[0] - phys_x[0] + 4*x[0]*x[1]*vertices[15] + 4*x[0]*x[2]*vertices[24] + 4*x[1]*x[2]*vertices[27]; # <<<<<<<<<<<<<< + * fx[1] = (-x[0] + 2*pow(x[0], 2))*vertices[4] + (-x[1] + 2*pow(x[1], 2))*vertices[7] + (-x[2] + 2*pow(x[2], 2))*vertices[10] + (4*x[0] - 4*x[0]*x[1] - 4*x[0]*x[2] - 4*pow(x[0], 2))*vertices[13] + (4*x[1] - 4*x[1]*x[0] - 4*x[1]*x[2] - 4*pow(x[1], 2))*vertices[19] + (4*x[2] - 4*x[2]*x[0] - 4*x[2]*x[1] - 4*pow(x[2], 2))*vertices[22] + (1 - 3*x[0] + 4*x[0]*x[1] + 4*x[0]*x[2] + 2*pow(x[0], 2) - 3*x[1] + 4*x[1]*x[2] + 2*pow(x[1], 2) - 3*x[2] + 2*pow(x[2], 2))*vertices[1] - phys_x[1] + 4*x[0]*x[1]*vertices[16] + 4*x[0]*x[2]*vertices[25] + 4*x[1]*x[2]*vertices[28]; + * fx[2] = (-x[0] + 2*pow(x[0], 2))*vertices[5] + (-x[1] + 2*pow(x[1], 2))*vertices[8] + (-x[2] + 2*pow(x[2], 2))*vertices[11] + (4*x[0] - 4*x[0]*x[1] - 4*x[0]*x[2] - 4*pow(x[0], 2))*vertices[14] + (4*x[1] - 4*x[1]*x[0] - 4*x[1]*x[2] - 4*pow(x[1], 2))*vertices[20] + (4*x[2] - 4*x[2]*x[0] - 4*x[2]*x[1] - 4*pow(x[2], 2))*vertices[23] + (1 - 3*x[0] + 4*x[0]*x[1] + 4*x[0]*x[2] + 2*pow(x[0], 2) - 3*x[1] + 4*x[1]*x[2] + 2*pow(x[1], 2) - 3*x[2] + 2*pow(x[2], 2))*vertices[2] - phys_x[2] + 4*x[0]*x[1]*vertices[17] + 4*x[0]*x[2]*vertices[26] + 4*x[1]*x[2]*vertices[29]; + */ + (__pyx_v_fx[0]) = (((((((((((((-(__pyx_v_x[0])) + (2.0 * pow((__pyx_v_x[0]), 2.0))) * (__pyx_v_vertices[3])) + (((-(__pyx_v_x[1])) + (2.0 * pow((__pyx_v_x[1]), 2.0))) * (__pyx_v_vertices[6]))) + (((-(__pyx_v_x[2])) + (2.0 * pow((__pyx_v_x[2]), 2.0))) * (__pyx_v_vertices[9]))) + (((((4.0 * (__pyx_v_x[0])) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1]))) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[2]))) - (4.0 * pow((__pyx_v_x[0]), 2.0))) * (__pyx_v_vertices[12]))) + (((((4.0 * (__pyx_v_x[1])) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_x[0]))) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_x[2]))) - (4.0 * pow((__pyx_v_x[1]), 2.0))) * (__pyx_v_vertices[18]))) + (((((4.0 * (__pyx_v_x[2])) - ((4.0 * (__pyx_v_x[2])) * (__pyx_v_x[0]))) - ((4.0 * (__pyx_v_x[2])) * (__pyx_v_x[1]))) - (4.0 * pow((__pyx_v_x[2]), 2.0))) * (__pyx_v_vertices[21]))) + ((((((((((1.0 - (3.0 * (__pyx_v_x[0]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[2]))) + (2.0 * pow((__pyx_v_x[0]), 2.0))) - (3.0 * (__pyx_v_x[1]))) + ((4.0 * (__pyx_v_x[1])) * (__pyx_v_x[2]))) + (2.0 * pow((__pyx_v_x[1]), 2.0))) - (3.0 * (__pyx_v_x[2]))) + (2.0 * pow((__pyx_v_x[2]), 2.0))) * (__pyx_v_vertices[0]))) - (__pyx_v_phys_x[0])) + (((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (__pyx_v_vertices[15]))) + (((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[2])) * (__pyx_v_vertices[24]))) + (((4.0 * (__pyx_v_x[1])) * (__pyx_v_x[2])) * (__pyx_v_vertices[27]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":101 + * double* phys_x) nogil: + * fx[0] = (-x[0] + 2*pow(x[0], 2))*vertices[3] + (-x[1] + 2*pow(x[1], 2))*vertices[6] + (-x[2] + 2*pow(x[2], 2))*vertices[9] + (4*x[0] - 4*x[0]*x[1] - 4*x[0]*x[2] - 4*pow(x[0], 2))*vertices[12] + (4*x[1] - 4*x[1]*x[0] - 4*x[1]*x[2] - 4*pow(x[1], 2))*vertices[18] + (4*x[2] - 4*x[2]*x[0] - 4*x[2]*x[1] - 4*pow(x[2], 2))*vertices[21] + (1 - 3*x[0] + 4*x[0]*x[1] + 4*x[0]*x[2] + 2*pow(x[0], 2) - 3*x[1] + 4*x[1]*x[2] + 2*pow(x[1], 2) - 3*x[2] + 2*pow(x[2], 2))*vertices[0] - phys_x[0] + 4*x[0]*x[1]*vertices[15] + 4*x[0]*x[2]*vertices[24] + 4*x[1]*x[2]*vertices[27]; + * fx[1] = (-x[0] + 2*pow(x[0], 2))*vertices[4] + (-x[1] + 2*pow(x[1], 2))*vertices[7] + (-x[2] + 2*pow(x[2], 2))*vertices[10] + (4*x[0] - 4*x[0]*x[1] - 4*x[0]*x[2] - 4*pow(x[0], 2))*vertices[13] + (4*x[1] - 4*x[1]*x[0] - 4*x[1]*x[2] - 4*pow(x[1], 2))*vertices[19] + (4*x[2] - 4*x[2]*x[0] - 4*x[2]*x[1] - 4*pow(x[2], 2))*vertices[22] + (1 - 3*x[0] + 4*x[0]*x[1] + 4*x[0]*x[2] + 2*pow(x[0], 2) - 3*x[1] + 4*x[1]*x[2] + 2*pow(x[1], 2) - 3*x[2] + 2*pow(x[2], 2))*vertices[1] - phys_x[1] + 4*x[0]*x[1]*vertices[16] + 4*x[0]*x[2]*vertices[25] + 4*x[1]*x[2]*vertices[28]; # <<<<<<<<<<<<<< + * fx[2] = (-x[0] + 2*pow(x[0], 2))*vertices[5] + (-x[1] + 2*pow(x[1], 2))*vertices[8] + (-x[2] + 2*pow(x[2], 2))*vertices[11] + (4*x[0] - 4*x[0]*x[1] - 4*x[0]*x[2] - 4*pow(x[0], 2))*vertices[14] + (4*x[1] - 4*x[1]*x[0] - 4*x[1]*x[2] - 4*pow(x[1], 2))*vertices[20] + (4*x[2] - 4*x[2]*x[0] - 4*x[2]*x[1] - 4*pow(x[2], 2))*vertices[23] + (1 - 3*x[0] + 4*x[0]*x[1] + 4*x[0]*x[2] + 2*pow(x[0], 2) - 3*x[1] + 4*x[1]*x[2] + 2*pow(x[1], 2) - 3*x[2] + 2*pow(x[2], 2))*vertices[2] - phys_x[2] + 4*x[0]*x[1]*vertices[17] + 4*x[0]*x[2]*vertices[26] + 4*x[1]*x[2]*vertices[29]; + * + */ + (__pyx_v_fx[1]) = (((((((((((((-(__pyx_v_x[0])) + (2.0 * pow((__pyx_v_x[0]), 2.0))) * (__pyx_v_vertices[4])) + (((-(__pyx_v_x[1])) + (2.0 * pow((__pyx_v_x[1]), 2.0))) * (__pyx_v_vertices[7]))) + (((-(__pyx_v_x[2])) + (2.0 * pow((__pyx_v_x[2]), 2.0))) * (__pyx_v_vertices[10]))) + (((((4.0 * (__pyx_v_x[0])) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1]))) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[2]))) - (4.0 * pow((__pyx_v_x[0]), 2.0))) * (__pyx_v_vertices[13]))) + (((((4.0 * (__pyx_v_x[1])) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_x[0]))) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_x[2]))) - (4.0 * pow((__pyx_v_x[1]), 2.0))) * (__pyx_v_vertices[19]))) + (((((4.0 * (__pyx_v_x[2])) - ((4.0 * (__pyx_v_x[2])) * (__pyx_v_x[0]))) - ((4.0 * (__pyx_v_x[2])) * (__pyx_v_x[1]))) - (4.0 * pow((__pyx_v_x[2]), 2.0))) * (__pyx_v_vertices[22]))) + ((((((((((1.0 - (3.0 * (__pyx_v_x[0]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[2]))) + (2.0 * pow((__pyx_v_x[0]), 2.0))) - (3.0 * (__pyx_v_x[1]))) + ((4.0 * (__pyx_v_x[1])) * (__pyx_v_x[2]))) + (2.0 * pow((__pyx_v_x[1]), 2.0))) - (3.0 * (__pyx_v_x[2]))) + (2.0 * pow((__pyx_v_x[2]), 2.0))) * (__pyx_v_vertices[1]))) - (__pyx_v_phys_x[1])) + (((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (__pyx_v_vertices[16]))) + (((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[2])) * (__pyx_v_vertices[25]))) + (((4.0 * (__pyx_v_x[1])) * (__pyx_v_x[2])) * (__pyx_v_vertices[28]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":102 + * fx[0] = (-x[0] + 2*pow(x[0], 2))*vertices[3] + (-x[1] + 2*pow(x[1], 2))*vertices[6] + (-x[2] + 2*pow(x[2], 2))*vertices[9] + (4*x[0] - 4*x[0]*x[1] - 4*x[0]*x[2] - 4*pow(x[0], 2))*vertices[12] + (4*x[1] - 4*x[1]*x[0] - 4*x[1]*x[2] - 4*pow(x[1], 2))*vertices[18] + (4*x[2] - 4*x[2]*x[0] - 4*x[2]*x[1] - 4*pow(x[2], 2))*vertices[21] + (1 - 3*x[0] + 4*x[0]*x[1] + 4*x[0]*x[2] + 2*pow(x[0], 2) - 3*x[1] + 4*x[1]*x[2] + 2*pow(x[1], 2) - 3*x[2] + 2*pow(x[2], 2))*vertices[0] - phys_x[0] + 4*x[0]*x[1]*vertices[15] + 4*x[0]*x[2]*vertices[24] + 4*x[1]*x[2]*vertices[27]; + * fx[1] = (-x[0] + 2*pow(x[0], 2))*vertices[4] + (-x[1] + 2*pow(x[1], 2))*vertices[7] + (-x[2] + 2*pow(x[2], 2))*vertices[10] + (4*x[0] - 4*x[0]*x[1] - 4*x[0]*x[2] - 4*pow(x[0], 2))*vertices[13] + (4*x[1] - 4*x[1]*x[0] - 4*x[1]*x[2] - 4*pow(x[1], 2))*vertices[19] + (4*x[2] - 4*x[2]*x[0] - 4*x[2]*x[1] - 4*pow(x[2], 2))*vertices[22] + (1 - 3*x[0] + 4*x[0]*x[1] + 4*x[0]*x[2] + 2*pow(x[0], 2) - 3*x[1] + 4*x[1]*x[2] + 2*pow(x[1], 2) - 3*x[2] + 2*pow(x[2], 2))*vertices[1] - phys_x[1] + 4*x[0]*x[1]*vertices[16] + 4*x[0]*x[2]*vertices[25] + 4*x[1]*x[2]*vertices[28]; + * fx[2] = (-x[0] + 2*pow(x[0], 2))*vertices[5] + (-x[1] + 2*pow(x[1], 2))*vertices[8] + (-x[2] + 2*pow(x[2], 2))*vertices[11] + (4*x[0] - 4*x[0]*x[1] - 4*x[0]*x[2] - 4*pow(x[0], 2))*vertices[14] + (4*x[1] - 4*x[1]*x[0] - 4*x[1]*x[2] - 4*pow(x[1], 2))*vertices[20] + (4*x[2] - 4*x[2]*x[0] - 4*x[2]*x[1] - 4*pow(x[2], 2))*vertices[23] + (1 - 3*x[0] + 4*x[0]*x[1] + 4*x[0]*x[2] + 2*pow(x[0], 2) - 3*x[1] + 4*x[1]*x[2] + 2*pow(x[1], 2) - 3*x[2] + 2*pow(x[2], 2))*vertices[2] - phys_x[2] + 4*x[0]*x[1]*vertices[17] + 4*x[0]*x[2]*vertices[26] + 4*x[1]*x[2]*vertices[29]; # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_fx[2]) = (((((((((((((-(__pyx_v_x[0])) + (2.0 * pow((__pyx_v_x[0]), 2.0))) * (__pyx_v_vertices[5])) + (((-(__pyx_v_x[1])) + (2.0 * pow((__pyx_v_x[1]), 2.0))) * (__pyx_v_vertices[8]))) + (((-(__pyx_v_x[2])) + (2.0 * pow((__pyx_v_x[2]), 2.0))) * (__pyx_v_vertices[11]))) + (((((4.0 * (__pyx_v_x[0])) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1]))) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[2]))) - (4.0 * pow((__pyx_v_x[0]), 2.0))) * (__pyx_v_vertices[14]))) + (((((4.0 * (__pyx_v_x[1])) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_x[0]))) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_x[2]))) - (4.0 * pow((__pyx_v_x[1]), 2.0))) * (__pyx_v_vertices[20]))) + (((((4.0 * (__pyx_v_x[2])) - ((4.0 * (__pyx_v_x[2])) * (__pyx_v_x[0]))) - ((4.0 * (__pyx_v_x[2])) * (__pyx_v_x[1]))) - (4.0 * pow((__pyx_v_x[2]), 2.0))) * (__pyx_v_vertices[23]))) + ((((((((((1.0 - (3.0 * (__pyx_v_x[0]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[2]))) + (2.0 * pow((__pyx_v_x[0]), 2.0))) - (3.0 * (__pyx_v_x[1]))) + ((4.0 * (__pyx_v_x[1])) * (__pyx_v_x[2]))) + (2.0 * pow((__pyx_v_x[1]), 2.0))) - (3.0 * (__pyx_v_x[2]))) + (2.0 * pow((__pyx_v_x[2]), 2.0))) * (__pyx_v_vertices[2]))) - (__pyx_v_phys_x[2])) + (((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (__pyx_v_vertices[17]))) + (((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[2])) * (__pyx_v_vertices[26]))) + (((4.0 * (__pyx_v_x[1])) * (__pyx_v_x[2])) * (__pyx_v_vertices[29]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":96 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Tet2Function3D(double* fx, # <<<<<<<<<<<<<< + * double* x, + * double* vertices, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/autogenerated_element_samplers.pyx":108 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Tet2Jacobian3D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* tcol, + */ + +static void __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Tet2Jacobian3D(double *__pyx_v_rcol, double *__pyx_v_scol, double *__pyx_v_tcol, double *__pyx_v_x, double *__pyx_v_vertices, CYTHON_UNUSED double *__pyx_v_phys_x) { + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":114 + * double* vertices, + * double* phys_x) nogil: + * rcol[0] = (-1 + 4*x[0])*vertices[3] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[12] + 4*x[1]*vertices[15] - 4*x[1]*vertices[18] - 4*x[2]*vertices[21] + 4*x[2]*vertices[24]; # <<<<<<<<<<<<<< + * scol[0] = (-1 + 4*x[1])*vertices[6] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[18] - 4*x[0]*vertices[12] + 4*x[0]*vertices[15] - 4*x[2]*vertices[21] + 4*x[2]*vertices[27]; + * tcol[0] = (-1 + 4*x[2])*vertices[9] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[21] - 4*x[0]*vertices[12] + 4*x[0]*vertices[24] - 4*x[1]*vertices[18] + 4*x[1]*vertices[27]; + */ + (__pyx_v_rcol[0]) = ((((((((-1.0 + (4.0 * (__pyx_v_x[0]))) * (__pyx_v_vertices[3])) + ((((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) + (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[0]))) + ((((4.0 - (8.0 * (__pyx_v_x[0]))) - (4.0 * (__pyx_v_x[1]))) - (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[12]))) + ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[15]))) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[18]))) - ((4.0 * (__pyx_v_x[2])) * (__pyx_v_vertices[21]))) + ((4.0 * (__pyx_v_x[2])) * (__pyx_v_vertices[24]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":115 + * double* phys_x) nogil: + * rcol[0] = (-1 + 4*x[0])*vertices[3] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[12] + 4*x[1]*vertices[15] - 4*x[1]*vertices[18] - 4*x[2]*vertices[21] + 4*x[2]*vertices[24]; + * scol[0] = (-1 + 4*x[1])*vertices[6] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[18] - 4*x[0]*vertices[12] + 4*x[0]*vertices[15] - 4*x[2]*vertices[21] + 4*x[2]*vertices[27]; # <<<<<<<<<<<<<< + * tcol[0] = (-1 + 4*x[2])*vertices[9] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[21] - 4*x[0]*vertices[12] + 4*x[0]*vertices[24] - 4*x[1]*vertices[18] + 4*x[1]*vertices[27]; + * rcol[1] = (-1 + 4*x[0])*vertices[4] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[13] + 4*x[1]*vertices[16] - 4*x[1]*vertices[19] - 4*x[2]*vertices[22] + 4*x[2]*vertices[25]; + */ + (__pyx_v_scol[0]) = ((((((((-1.0 + (4.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[6])) + ((((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) + (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[0]))) + ((((4.0 - (4.0 * (__pyx_v_x[0]))) - (8.0 * (__pyx_v_x[1]))) - (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[18]))) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[12]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[15]))) - ((4.0 * (__pyx_v_x[2])) * (__pyx_v_vertices[21]))) + ((4.0 * (__pyx_v_x[2])) * (__pyx_v_vertices[27]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":116 + * rcol[0] = (-1 + 4*x[0])*vertices[3] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[12] + 4*x[1]*vertices[15] - 4*x[1]*vertices[18] - 4*x[2]*vertices[21] + 4*x[2]*vertices[24]; + * scol[0] = (-1 + 4*x[1])*vertices[6] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[18] - 4*x[0]*vertices[12] + 4*x[0]*vertices[15] - 4*x[2]*vertices[21] + 4*x[2]*vertices[27]; + * tcol[0] = (-1 + 4*x[2])*vertices[9] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[21] - 4*x[0]*vertices[12] + 4*x[0]*vertices[24] - 4*x[1]*vertices[18] + 4*x[1]*vertices[27]; # <<<<<<<<<<<<<< + * rcol[1] = (-1 + 4*x[0])*vertices[4] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[13] + 4*x[1]*vertices[16] - 4*x[1]*vertices[19] - 4*x[2]*vertices[22] + 4*x[2]*vertices[25]; + * scol[1] = (-1 + 4*x[1])*vertices[7] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[19] - 4*x[0]*vertices[13] + 4*x[0]*vertices[16] - 4*x[2]*vertices[22] + 4*x[2]*vertices[28]; + */ + (__pyx_v_tcol[0]) = ((((((((-1.0 + (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[9])) + ((((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) + (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[0]))) + ((((4.0 - (4.0 * (__pyx_v_x[0]))) - (4.0 * (__pyx_v_x[1]))) - (8.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[21]))) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[12]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[24]))) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[18]))) + ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[27]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":117 + * scol[0] = (-1 + 4*x[1])*vertices[6] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[18] - 4*x[0]*vertices[12] + 4*x[0]*vertices[15] - 4*x[2]*vertices[21] + 4*x[2]*vertices[27]; + * tcol[0] = (-1 + 4*x[2])*vertices[9] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[21] - 4*x[0]*vertices[12] + 4*x[0]*vertices[24] - 4*x[1]*vertices[18] + 4*x[1]*vertices[27]; + * rcol[1] = (-1 + 4*x[0])*vertices[4] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[13] + 4*x[1]*vertices[16] - 4*x[1]*vertices[19] - 4*x[2]*vertices[22] + 4*x[2]*vertices[25]; # <<<<<<<<<<<<<< + * scol[1] = (-1 + 4*x[1])*vertices[7] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[19] - 4*x[0]*vertices[13] + 4*x[0]*vertices[16] - 4*x[2]*vertices[22] + 4*x[2]*vertices[28]; + * tcol[1] = (-1 + 4*x[2])*vertices[10] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[22] - 4*x[0]*vertices[13] + 4*x[0]*vertices[25] - 4*x[1]*vertices[19] + 4*x[1]*vertices[28]; + */ + (__pyx_v_rcol[1]) = ((((((((-1.0 + (4.0 * (__pyx_v_x[0]))) * (__pyx_v_vertices[4])) + ((((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) + (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[1]))) + ((((4.0 - (8.0 * (__pyx_v_x[0]))) - (4.0 * (__pyx_v_x[1]))) - (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[13]))) + ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[16]))) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[19]))) - ((4.0 * (__pyx_v_x[2])) * (__pyx_v_vertices[22]))) + ((4.0 * (__pyx_v_x[2])) * (__pyx_v_vertices[25]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":118 + * tcol[0] = (-1 + 4*x[2])*vertices[9] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[21] - 4*x[0]*vertices[12] + 4*x[0]*vertices[24] - 4*x[1]*vertices[18] + 4*x[1]*vertices[27]; + * rcol[1] = (-1 + 4*x[0])*vertices[4] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[13] + 4*x[1]*vertices[16] - 4*x[1]*vertices[19] - 4*x[2]*vertices[22] + 4*x[2]*vertices[25]; + * scol[1] = (-1 + 4*x[1])*vertices[7] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[19] - 4*x[0]*vertices[13] + 4*x[0]*vertices[16] - 4*x[2]*vertices[22] + 4*x[2]*vertices[28]; # <<<<<<<<<<<<<< + * tcol[1] = (-1 + 4*x[2])*vertices[10] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[22] - 4*x[0]*vertices[13] + 4*x[0]*vertices[25] - 4*x[1]*vertices[19] + 4*x[1]*vertices[28]; + * rcol[2] = (-1 + 4*x[0])*vertices[5] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[14] + 4*x[1]*vertices[17] - 4*x[1]*vertices[20] - 4*x[2]*vertices[23] + 4*x[2]*vertices[26]; + */ + (__pyx_v_scol[1]) = ((((((((-1.0 + (4.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[7])) + ((((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) + (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[1]))) + ((((4.0 - (4.0 * (__pyx_v_x[0]))) - (8.0 * (__pyx_v_x[1]))) - (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[19]))) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[13]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[16]))) - ((4.0 * (__pyx_v_x[2])) * (__pyx_v_vertices[22]))) + ((4.0 * (__pyx_v_x[2])) * (__pyx_v_vertices[28]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":119 + * rcol[1] = (-1 + 4*x[0])*vertices[4] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[13] + 4*x[1]*vertices[16] - 4*x[1]*vertices[19] - 4*x[2]*vertices[22] + 4*x[2]*vertices[25]; + * scol[1] = (-1 + 4*x[1])*vertices[7] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[19] - 4*x[0]*vertices[13] + 4*x[0]*vertices[16] - 4*x[2]*vertices[22] + 4*x[2]*vertices[28]; + * tcol[1] = (-1 + 4*x[2])*vertices[10] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[22] - 4*x[0]*vertices[13] + 4*x[0]*vertices[25] - 4*x[1]*vertices[19] + 4*x[1]*vertices[28]; # <<<<<<<<<<<<<< + * rcol[2] = (-1 + 4*x[0])*vertices[5] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[14] + 4*x[1]*vertices[17] - 4*x[1]*vertices[20] - 4*x[2]*vertices[23] + 4*x[2]*vertices[26]; + * scol[2] = (-1 + 4*x[1])*vertices[8] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[20] - 4*x[0]*vertices[14] + 4*x[0]*vertices[17] - 4*x[2]*vertices[23] + 4*x[2]*vertices[29]; + */ + (__pyx_v_tcol[1]) = ((((((((-1.0 + (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[10])) + ((((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) + (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[1]))) + ((((4.0 - (4.0 * (__pyx_v_x[0]))) - (4.0 * (__pyx_v_x[1]))) - (8.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[22]))) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[13]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[25]))) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[19]))) + ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[28]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":120 + * scol[1] = (-1 + 4*x[1])*vertices[7] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[19] - 4*x[0]*vertices[13] + 4*x[0]*vertices[16] - 4*x[2]*vertices[22] + 4*x[2]*vertices[28]; + * tcol[1] = (-1 + 4*x[2])*vertices[10] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[22] - 4*x[0]*vertices[13] + 4*x[0]*vertices[25] - 4*x[1]*vertices[19] + 4*x[1]*vertices[28]; + * rcol[2] = (-1 + 4*x[0])*vertices[5] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[14] + 4*x[1]*vertices[17] - 4*x[1]*vertices[20] - 4*x[2]*vertices[23] + 4*x[2]*vertices[26]; # <<<<<<<<<<<<<< + * scol[2] = (-1 + 4*x[1])*vertices[8] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[20] - 4*x[0]*vertices[14] + 4*x[0]*vertices[17] - 4*x[2]*vertices[23] + 4*x[2]*vertices[29]; + * tcol[2] = (-1 + 4*x[2])*vertices[11] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[23] - 4*x[0]*vertices[14] + 4*x[0]*vertices[26] - 4*x[1]*vertices[20] + 4*x[1]*vertices[29]; + */ + (__pyx_v_rcol[2]) = ((((((((-1.0 + (4.0 * (__pyx_v_x[0]))) * (__pyx_v_vertices[5])) + ((((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) + (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[2]))) + ((((4.0 - (8.0 * (__pyx_v_x[0]))) - (4.0 * (__pyx_v_x[1]))) - (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[14]))) + ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[17]))) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[20]))) - ((4.0 * (__pyx_v_x[2])) * (__pyx_v_vertices[23]))) + ((4.0 * (__pyx_v_x[2])) * (__pyx_v_vertices[26]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":121 + * tcol[1] = (-1 + 4*x[2])*vertices[10] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[22] - 4*x[0]*vertices[13] + 4*x[0]*vertices[25] - 4*x[1]*vertices[19] + 4*x[1]*vertices[28]; + * rcol[2] = (-1 + 4*x[0])*vertices[5] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[14] + 4*x[1]*vertices[17] - 4*x[1]*vertices[20] - 4*x[2]*vertices[23] + 4*x[2]*vertices[26]; + * scol[2] = (-1 + 4*x[1])*vertices[8] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[20] - 4*x[0]*vertices[14] + 4*x[0]*vertices[17] - 4*x[2]*vertices[23] + 4*x[2]*vertices[29]; # <<<<<<<<<<<<<< + * tcol[2] = (-1 + 4*x[2])*vertices[11] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[23] - 4*x[0]*vertices[14] + 4*x[0]*vertices[26] - 4*x[1]*vertices[20] + 4*x[1]*vertices[29]; + * + */ + (__pyx_v_scol[2]) = ((((((((-1.0 + (4.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[8])) + ((((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) + (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[2]))) + ((((4.0 - (4.0 * (__pyx_v_x[0]))) - (8.0 * (__pyx_v_x[1]))) - (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[20]))) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[14]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[17]))) - ((4.0 * (__pyx_v_x[2])) * (__pyx_v_vertices[23]))) + ((4.0 * (__pyx_v_x[2])) * (__pyx_v_vertices[29]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":122 + * rcol[2] = (-1 + 4*x[0])*vertices[5] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[14] + 4*x[1]*vertices[17] - 4*x[1]*vertices[20] - 4*x[2]*vertices[23] + 4*x[2]*vertices[26]; + * scol[2] = (-1 + 4*x[1])*vertices[8] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[20] - 4*x[0]*vertices[14] + 4*x[0]*vertices[17] - 4*x[2]*vertices[23] + 4*x[2]*vertices[29]; + * tcol[2] = (-1 + 4*x[2])*vertices[11] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[23] - 4*x[0]*vertices[14] + 4*x[0]*vertices[26] - 4*x[1]*vertices[20] + 4*x[1]*vertices[29]; # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_tcol[2]) = ((((((((-1.0 + (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[11])) + ((((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) + (4.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[2]))) + ((((4.0 - (4.0 * (__pyx_v_x[0]))) - (4.0 * (__pyx_v_x[1]))) - (8.0 * (__pyx_v_x[2]))) * (__pyx_v_vertices[23]))) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[14]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[26]))) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[20]))) + ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[29]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":108 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void Tet2Jacobian3D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* tcol, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/autogenerated_element_samplers.pyx":128 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void T2Function2D(double* fx, # <<<<<<<<<<<<<< + * double* x, + * double* vertices, + */ + +static void __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_T2Function2D(double *__pyx_v_fx, double *__pyx_v_x, double *__pyx_v_vertices, double *__pyx_v_phys_x) { + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":132 + * double* vertices, + * double* phys_x) nogil: + * fx[0] = (-x[0] + 2*pow(x[0], 2))*vertices[2] + (-x[1] + 2*pow(x[1], 2))*vertices[4] + (-4*x[0]*x[1] + 4*x[1] - 4*pow(x[1], 2))*vertices[10] + (4*x[0] - 4*x[0]*x[1] - 4*pow(x[0], 2))*vertices[6] + (1 - 3*x[0] + 4*x[0]*x[1] + 2*pow(x[0], 2) - 3*x[1] + 2*pow(x[1], 2))*vertices[0] - phys_x[0] + 4*x[0]*x[1]*vertices[8]; # <<<<<<<<<<<<<< + * fx[1] = (-x[0] + 2*pow(x[0], 2))*vertices[3] + (-x[1] + 2*pow(x[1], 2))*vertices[5] + (-4*x[0]*x[1] + 4*x[1] - 4*pow(x[1], 2))*vertices[11] + (4*x[0] - 4*x[0]*x[1] - 4*pow(x[0], 2))*vertices[7] + (1 - 3*x[0] + 4*x[0]*x[1] + 2*pow(x[0], 2) - 3*x[1] + 2*pow(x[1], 2))*vertices[1] - phys_x[1] + 4*x[0]*x[1]*vertices[9]; + * + */ + (__pyx_v_fx[0]) = (((((((((-(__pyx_v_x[0])) + (2.0 * pow((__pyx_v_x[0]), 2.0))) * (__pyx_v_vertices[2])) + (((-(__pyx_v_x[1])) + (2.0 * pow((__pyx_v_x[1]), 2.0))) * (__pyx_v_vertices[4]))) + (((((-4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1])) + (4.0 * (__pyx_v_x[1]))) - (4.0 * pow((__pyx_v_x[1]), 2.0))) * (__pyx_v_vertices[10]))) + ((((4.0 * (__pyx_v_x[0])) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1]))) - (4.0 * pow((__pyx_v_x[0]), 2.0))) * (__pyx_v_vertices[6]))) + ((((((1.0 - (3.0 * (__pyx_v_x[0]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1]))) + (2.0 * pow((__pyx_v_x[0]), 2.0))) - (3.0 * (__pyx_v_x[1]))) + (2.0 * pow((__pyx_v_x[1]), 2.0))) * (__pyx_v_vertices[0]))) - (__pyx_v_phys_x[0])) + (((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (__pyx_v_vertices[8]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":133 + * double* phys_x) nogil: + * fx[0] = (-x[0] + 2*pow(x[0], 2))*vertices[2] + (-x[1] + 2*pow(x[1], 2))*vertices[4] + (-4*x[0]*x[1] + 4*x[1] - 4*pow(x[1], 2))*vertices[10] + (4*x[0] - 4*x[0]*x[1] - 4*pow(x[0], 2))*vertices[6] + (1 - 3*x[0] + 4*x[0]*x[1] + 2*pow(x[0], 2) - 3*x[1] + 2*pow(x[1], 2))*vertices[0] - phys_x[0] + 4*x[0]*x[1]*vertices[8]; + * fx[1] = (-x[0] + 2*pow(x[0], 2))*vertices[3] + (-x[1] + 2*pow(x[1], 2))*vertices[5] + (-4*x[0]*x[1] + 4*x[1] - 4*pow(x[1], 2))*vertices[11] + (4*x[0] - 4*x[0]*x[1] - 4*pow(x[0], 2))*vertices[7] + (1 - 3*x[0] + 4*x[0]*x[1] + 2*pow(x[0], 2) - 3*x[1] + 2*pow(x[1], 2))*vertices[1] - phys_x[1] + 4*x[0]*x[1]*vertices[9]; # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_fx[1]) = (((((((((-(__pyx_v_x[0])) + (2.0 * pow((__pyx_v_x[0]), 2.0))) * (__pyx_v_vertices[3])) + (((-(__pyx_v_x[1])) + (2.0 * pow((__pyx_v_x[1]), 2.0))) * (__pyx_v_vertices[5]))) + (((((-4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1])) + (4.0 * (__pyx_v_x[1]))) - (4.0 * pow((__pyx_v_x[1]), 2.0))) * (__pyx_v_vertices[11]))) + ((((4.0 * (__pyx_v_x[0])) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1]))) - (4.0 * pow((__pyx_v_x[0]), 2.0))) * (__pyx_v_vertices[7]))) + ((((((1.0 - (3.0 * (__pyx_v_x[0]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1]))) + (2.0 * pow((__pyx_v_x[0]), 2.0))) - (3.0 * (__pyx_v_x[1]))) + (2.0 * pow((__pyx_v_x[1]), 2.0))) * (__pyx_v_vertices[1]))) - (__pyx_v_phys_x[1])) + (((4.0 * (__pyx_v_x[0])) * (__pyx_v_x[1])) * (__pyx_v_vertices[9]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":128 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void T2Function2D(double* fx, # <<<<<<<<<<<<<< + * double* x, + * double* vertices, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/autogenerated_element_samplers.pyx":139 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void T2Jacobian2D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* x, + */ + +static void __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_T2Jacobian2D(double *__pyx_v_rcol, double *__pyx_v_scol, double *__pyx_v_x, double *__pyx_v_vertices, CYTHON_UNUSED double *__pyx_v_phys_x) { + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":144 + * double* vertices, + * double* phys_x) nogil: + * rcol[0] = (-1 + 4*x[0])*vertices[2] + (-3 + 4*x[0] + 4*x[1])*vertices[0] + (4 - 8*x[0] - 4*x[1])*vertices[6] + 4*x[1]*vertices[8] - 4*x[1]*vertices[10]; # <<<<<<<<<<<<<< + * scol[0] = (-1 + 4*x[1])*vertices[4] + (-3 + 4*x[0] + 4*x[1])*vertices[0] + (4 - 4*x[0] - 8*x[1])*vertices[10] - 4*x[0]*vertices[6] + 4*x[0]*vertices[8]; + * rcol[1] = (-1 + 4*x[0])*vertices[3] + (-3 + 4*x[0] + 4*x[1])*vertices[1] + (4 - 8*x[0] - 4*x[1])*vertices[7] + 4*x[1]*vertices[9] - 4*x[1]*vertices[11]; + */ + (__pyx_v_rcol[0]) = ((((((-1.0 + (4.0 * (__pyx_v_x[0]))) * (__pyx_v_vertices[2])) + (((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[0]))) + (((4.0 - (8.0 * (__pyx_v_x[0]))) - (4.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[6]))) + ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[8]))) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[10]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":145 + * double* phys_x) nogil: + * rcol[0] = (-1 + 4*x[0])*vertices[2] + (-3 + 4*x[0] + 4*x[1])*vertices[0] + (4 - 8*x[0] - 4*x[1])*vertices[6] + 4*x[1]*vertices[8] - 4*x[1]*vertices[10]; + * scol[0] = (-1 + 4*x[1])*vertices[4] + (-3 + 4*x[0] + 4*x[1])*vertices[0] + (4 - 4*x[0] - 8*x[1])*vertices[10] - 4*x[0]*vertices[6] + 4*x[0]*vertices[8]; # <<<<<<<<<<<<<< + * rcol[1] = (-1 + 4*x[0])*vertices[3] + (-3 + 4*x[0] + 4*x[1])*vertices[1] + (4 - 8*x[0] - 4*x[1])*vertices[7] + 4*x[1]*vertices[9] - 4*x[1]*vertices[11]; + * scol[1] = (-1 + 4*x[1])*vertices[5] + (-3 + 4*x[0] + 4*x[1])*vertices[1] + (4 - 4*x[0] - 8*x[1])*vertices[11] - 4*x[0]*vertices[7] + 4*x[0]*vertices[9]; + */ + (__pyx_v_scol[0]) = ((((((-1.0 + (4.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[4])) + (((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[0]))) + (((4.0 - (4.0 * (__pyx_v_x[0]))) - (8.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[10]))) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[6]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[8]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":146 + * rcol[0] = (-1 + 4*x[0])*vertices[2] + (-3 + 4*x[0] + 4*x[1])*vertices[0] + (4 - 8*x[0] - 4*x[1])*vertices[6] + 4*x[1]*vertices[8] - 4*x[1]*vertices[10]; + * scol[0] = (-1 + 4*x[1])*vertices[4] + (-3 + 4*x[0] + 4*x[1])*vertices[0] + (4 - 4*x[0] - 8*x[1])*vertices[10] - 4*x[0]*vertices[6] + 4*x[0]*vertices[8]; + * rcol[1] = (-1 + 4*x[0])*vertices[3] + (-3 + 4*x[0] + 4*x[1])*vertices[1] + (4 - 8*x[0] - 4*x[1])*vertices[7] + 4*x[1]*vertices[9] - 4*x[1]*vertices[11]; # <<<<<<<<<<<<<< + * scol[1] = (-1 + 4*x[1])*vertices[5] + (-3 + 4*x[0] + 4*x[1])*vertices[1] + (4 - 4*x[0] - 8*x[1])*vertices[11] - 4*x[0]*vertices[7] + 4*x[0]*vertices[9]; + * + */ + (__pyx_v_rcol[1]) = ((((((-1.0 + (4.0 * (__pyx_v_x[0]))) * (__pyx_v_vertices[3])) + (((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[1]))) + (((4.0 - (8.0 * (__pyx_v_x[0]))) - (4.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[7]))) + ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[9]))) - ((4.0 * (__pyx_v_x[1])) * (__pyx_v_vertices[11]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":147 + * scol[0] = (-1 + 4*x[1])*vertices[4] + (-3 + 4*x[0] + 4*x[1])*vertices[0] + (4 - 4*x[0] - 8*x[1])*vertices[10] - 4*x[0]*vertices[6] + 4*x[0]*vertices[8]; + * rcol[1] = (-1 + 4*x[0])*vertices[3] + (-3 + 4*x[0] + 4*x[1])*vertices[1] + (4 - 8*x[0] - 4*x[1])*vertices[7] + 4*x[1]*vertices[9] - 4*x[1]*vertices[11]; + * scol[1] = (-1 + 4*x[1])*vertices[5] + (-3 + 4*x[0] + 4*x[1])*vertices[1] + (4 - 4*x[0] - 8*x[1])*vertices[11] - 4*x[0]*vertices[7] + 4*x[0]*vertices[9]; # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_scol[1]) = ((((((-1.0 + (4.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[5])) + (((-3.0 + (4.0 * (__pyx_v_x[0]))) + (4.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[1]))) + (((4.0 - (4.0 * (__pyx_v_x[0]))) - (8.0 * (__pyx_v_x[1]))) * (__pyx_v_vertices[11]))) - ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[7]))) + ((4.0 * (__pyx_v_x[0])) * (__pyx_v_vertices[9]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":139 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void T2Jacobian2D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* x, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/autogenerated_element_samplers.pyx":153 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void W1Function3D(double* fx, # <<<<<<<<<<<<<< + * double* x, + * double* vertices, + */ + +static void __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_W1Function3D(double *__pyx_v_fx, double *__pyx_v_x, double *__pyx_v_vertices, double *__pyx_v_phys_x) { + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":157 + * double* vertices, + * double* phys_x) nogil: + * fx[0] = 0.5*(1 - x[0] - x[1])*(1 - x[2])*vertices[0] + 0.5*(1 - x[0] - x[1])*(1 + x[2])*vertices[9] - phys_x[0] + 0.5*x[0]*(1 - x[2])*vertices[3] + 0.5*x[0]*(1 + x[2])*vertices[12] + 0.5*x[1]*(1 - x[2])*vertices[6] + 0.5*x[1]*(1 + x[2])*vertices[15]; # <<<<<<<<<<<<<< + * fx[1] = 0.5*(1 - x[0] - x[1])*(1 - x[2])*vertices[1] + 0.5*(1 - x[0] - x[1])*(1 + x[2])*vertices[10] - phys_x[1] + 0.5*x[0]*(1 - x[2])*vertices[4] + 0.5*x[0]*(1 + x[2])*vertices[13] + 0.5*x[1]*(1 - x[2])*vertices[7] + 0.5*x[1]*(1 + x[2])*vertices[16]; + * fx[2] = 0.5*(1 - x[0] - x[1])*(1 - x[2])*vertices[2] + 0.5*(1 - x[0] - x[1])*(1 + x[2])*vertices[11] - phys_x[2] + 0.5*x[0]*(1 - x[2])*vertices[5] + 0.5*x[0]*(1 + x[2])*vertices[14] + 0.5*x[1]*(1 - x[2])*vertices[8] + 0.5*x[1]*(1 + x[2])*vertices[17]; + */ + (__pyx_v_fx[0]) = (((((((((0.5 * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[0])) + (((0.5 * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[9]))) - (__pyx_v_phys_x[0])) + (((0.5 * (__pyx_v_x[0])) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[3]))) + (((0.5 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[12]))) + (((0.5 * (__pyx_v_x[1])) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[6]))) + (((0.5 * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[15]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":158 + * double* phys_x) nogil: + * fx[0] = 0.5*(1 - x[0] - x[1])*(1 - x[2])*vertices[0] + 0.5*(1 - x[0] - x[1])*(1 + x[2])*vertices[9] - phys_x[0] + 0.5*x[0]*(1 - x[2])*vertices[3] + 0.5*x[0]*(1 + x[2])*vertices[12] + 0.5*x[1]*(1 - x[2])*vertices[6] + 0.5*x[1]*(1 + x[2])*vertices[15]; + * fx[1] = 0.5*(1 - x[0] - x[1])*(1 - x[2])*vertices[1] + 0.5*(1 - x[0] - x[1])*(1 + x[2])*vertices[10] - phys_x[1] + 0.5*x[0]*(1 - x[2])*vertices[4] + 0.5*x[0]*(1 + x[2])*vertices[13] + 0.5*x[1]*(1 - x[2])*vertices[7] + 0.5*x[1]*(1 + x[2])*vertices[16]; # <<<<<<<<<<<<<< + * fx[2] = 0.5*(1 - x[0] - x[1])*(1 - x[2])*vertices[2] + 0.5*(1 - x[0] - x[1])*(1 + x[2])*vertices[11] - phys_x[2] + 0.5*x[0]*(1 - x[2])*vertices[5] + 0.5*x[0]*(1 + x[2])*vertices[14] + 0.5*x[1]*(1 - x[2])*vertices[8] + 0.5*x[1]*(1 + x[2])*vertices[17]; + * + */ + (__pyx_v_fx[1]) = (((((((((0.5 * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[1])) + (((0.5 * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[10]))) - (__pyx_v_phys_x[1])) + (((0.5 * (__pyx_v_x[0])) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[4]))) + (((0.5 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[13]))) + (((0.5 * (__pyx_v_x[1])) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[7]))) + (((0.5 * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[16]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":159 + * fx[0] = 0.5*(1 - x[0] - x[1])*(1 - x[2])*vertices[0] + 0.5*(1 - x[0] - x[1])*(1 + x[2])*vertices[9] - phys_x[0] + 0.5*x[0]*(1 - x[2])*vertices[3] + 0.5*x[0]*(1 + x[2])*vertices[12] + 0.5*x[1]*(1 - x[2])*vertices[6] + 0.5*x[1]*(1 + x[2])*vertices[15]; + * fx[1] = 0.5*(1 - x[0] - x[1])*(1 - x[2])*vertices[1] + 0.5*(1 - x[0] - x[1])*(1 + x[2])*vertices[10] - phys_x[1] + 0.5*x[0]*(1 - x[2])*vertices[4] + 0.5*x[0]*(1 + x[2])*vertices[13] + 0.5*x[1]*(1 - x[2])*vertices[7] + 0.5*x[1]*(1 + x[2])*vertices[16]; + * fx[2] = 0.5*(1 - x[0] - x[1])*(1 - x[2])*vertices[2] + 0.5*(1 - x[0] - x[1])*(1 + x[2])*vertices[11] - phys_x[2] + 0.5*x[0]*(1 - x[2])*vertices[5] + 0.5*x[0]*(1 + x[2])*vertices[14] + 0.5*x[1]*(1 - x[2])*vertices[8] + 0.5*x[1]*(1 + x[2])*vertices[17]; # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_fx[2]) = (((((((((0.5 * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[2])) + (((0.5 * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[11]))) - (__pyx_v_phys_x[2])) + (((0.5 * (__pyx_v_x[0])) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[5]))) + (((0.5 * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[14]))) + (((0.5 * (__pyx_v_x[1])) * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[8]))) + (((0.5 * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[17]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":153 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void W1Function3D(double* fx, # <<<<<<<<<<<<<< + * double* x, + * double* vertices, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/autogenerated_element_samplers.pyx":165 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void W1Jacobian3D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* tcol, + */ + +static void __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_W1Jacobian3D(double *__pyx_v_rcol, double *__pyx_v_scol, double *__pyx_v_tcol, double *__pyx_v_x, double *__pyx_v_vertices, CYTHON_UNUSED double *__pyx_v_phys_x) { + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":171 + * double* vertices, + * double* phys_x) nogil: + * rcol[0] = -0.5*(1 - x[2])*vertices[0] + 0.5*(1 - x[2])*vertices[3] - 0.5*(1 + x[2])*vertices[9] + 0.5*(1 + x[2])*vertices[12]; # <<<<<<<<<<<<<< + * scol[0] = -0.5*(1 - x[2])*vertices[0] + 0.5*(1 - x[2])*vertices[6] - 0.5*(1 + x[2])*vertices[9] + 0.5*(1 + x[2])*vertices[15]; + * tcol[0] = -0.5*(1 - x[0] - x[1])*vertices[0] + 0.5*(1 - x[0] - x[1])*vertices[9] - 0.5*x[0]*vertices[3] + 0.5*x[0]*vertices[12] - 0.5*x[1]*vertices[6] + 0.5*x[1]*vertices[15]; + */ + (__pyx_v_rcol[0]) = (((((-0.5 * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[0])) + ((0.5 * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[3]))) - ((0.5 * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[9]))) + ((0.5 * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[12]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":172 + * double* phys_x) nogil: + * rcol[0] = -0.5*(1 - x[2])*vertices[0] + 0.5*(1 - x[2])*vertices[3] - 0.5*(1 + x[2])*vertices[9] + 0.5*(1 + x[2])*vertices[12]; + * scol[0] = -0.5*(1 - x[2])*vertices[0] + 0.5*(1 - x[2])*vertices[6] - 0.5*(1 + x[2])*vertices[9] + 0.5*(1 + x[2])*vertices[15]; # <<<<<<<<<<<<<< + * tcol[0] = -0.5*(1 - x[0] - x[1])*vertices[0] + 0.5*(1 - x[0] - x[1])*vertices[9] - 0.5*x[0]*vertices[3] + 0.5*x[0]*vertices[12] - 0.5*x[1]*vertices[6] + 0.5*x[1]*vertices[15]; + * rcol[1] = -0.5*(1 - x[2])*vertices[1] + 0.5*(1 - x[2])*vertices[4] - 0.5*(1 + x[2])*vertices[10] + 0.5*(1 + x[2])*vertices[13]; + */ + (__pyx_v_scol[0]) = (((((-0.5 * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[0])) + ((0.5 * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[6]))) - ((0.5 * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[9]))) + ((0.5 * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[15]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":173 + * rcol[0] = -0.5*(1 - x[2])*vertices[0] + 0.5*(1 - x[2])*vertices[3] - 0.5*(1 + x[2])*vertices[9] + 0.5*(1 + x[2])*vertices[12]; + * scol[0] = -0.5*(1 - x[2])*vertices[0] + 0.5*(1 - x[2])*vertices[6] - 0.5*(1 + x[2])*vertices[9] + 0.5*(1 + x[2])*vertices[15]; + * tcol[0] = -0.5*(1 - x[0] - x[1])*vertices[0] + 0.5*(1 - x[0] - x[1])*vertices[9] - 0.5*x[0]*vertices[3] + 0.5*x[0]*vertices[12] - 0.5*x[1]*vertices[6] + 0.5*x[1]*vertices[15]; # <<<<<<<<<<<<<< + * rcol[1] = -0.5*(1 - x[2])*vertices[1] + 0.5*(1 - x[2])*vertices[4] - 0.5*(1 + x[2])*vertices[10] + 0.5*(1 + x[2])*vertices[13]; + * scol[1] = -0.5*(1 - x[2])*vertices[1] + 0.5*(1 - x[2])*vertices[7] - 0.5*(1 + x[2])*vertices[10] + 0.5*(1 + x[2])*vertices[16]; + */ + (__pyx_v_tcol[0]) = (((((((-0.5 * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (__pyx_v_vertices[0])) + ((0.5 * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (__pyx_v_vertices[9]))) - ((0.5 * (__pyx_v_x[0])) * (__pyx_v_vertices[3]))) + ((0.5 * (__pyx_v_x[0])) * (__pyx_v_vertices[12]))) - ((0.5 * (__pyx_v_x[1])) * (__pyx_v_vertices[6]))) + ((0.5 * (__pyx_v_x[1])) * (__pyx_v_vertices[15]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":174 + * scol[0] = -0.5*(1 - x[2])*vertices[0] + 0.5*(1 - x[2])*vertices[6] - 0.5*(1 + x[2])*vertices[9] + 0.5*(1 + x[2])*vertices[15]; + * tcol[0] = -0.5*(1 - x[0] - x[1])*vertices[0] + 0.5*(1 - x[0] - x[1])*vertices[9] - 0.5*x[0]*vertices[3] + 0.5*x[0]*vertices[12] - 0.5*x[1]*vertices[6] + 0.5*x[1]*vertices[15]; + * rcol[1] = -0.5*(1 - x[2])*vertices[1] + 0.5*(1 - x[2])*vertices[4] - 0.5*(1 + x[2])*vertices[10] + 0.5*(1 + x[2])*vertices[13]; # <<<<<<<<<<<<<< + * scol[1] = -0.5*(1 - x[2])*vertices[1] + 0.5*(1 - x[2])*vertices[7] - 0.5*(1 + x[2])*vertices[10] + 0.5*(1 + x[2])*vertices[16]; + * tcol[1] = -0.5*(1 - x[0] - x[1])*vertices[1] + 0.5*(1 - x[0] - x[1])*vertices[10] - 0.5*x[0]*vertices[4] + 0.5*x[0]*vertices[13] - 0.5*x[1]*vertices[7] + 0.5*x[1]*vertices[16]; + */ + (__pyx_v_rcol[1]) = (((((-0.5 * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[1])) + ((0.5 * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[4]))) - ((0.5 * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[10]))) + ((0.5 * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[13]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":175 + * tcol[0] = -0.5*(1 - x[0] - x[1])*vertices[0] + 0.5*(1 - x[0] - x[1])*vertices[9] - 0.5*x[0]*vertices[3] + 0.5*x[0]*vertices[12] - 0.5*x[1]*vertices[6] + 0.5*x[1]*vertices[15]; + * rcol[1] = -0.5*(1 - x[2])*vertices[1] + 0.5*(1 - x[2])*vertices[4] - 0.5*(1 + x[2])*vertices[10] + 0.5*(1 + x[2])*vertices[13]; + * scol[1] = -0.5*(1 - x[2])*vertices[1] + 0.5*(1 - x[2])*vertices[7] - 0.5*(1 + x[2])*vertices[10] + 0.5*(1 + x[2])*vertices[16]; # <<<<<<<<<<<<<< + * tcol[1] = -0.5*(1 - x[0] - x[1])*vertices[1] + 0.5*(1 - x[0] - x[1])*vertices[10] - 0.5*x[0]*vertices[4] + 0.5*x[0]*vertices[13] - 0.5*x[1]*vertices[7] + 0.5*x[1]*vertices[16]; + * rcol[2] = -0.5*(1 - x[2])*vertices[2] + 0.5*(1 - x[2])*vertices[5] - 0.5*(1 + x[2])*vertices[11] + 0.5*(1 + x[2])*vertices[14]; + */ + (__pyx_v_scol[1]) = (((((-0.5 * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[1])) + ((0.5 * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[7]))) - ((0.5 * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[10]))) + ((0.5 * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[16]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":176 + * rcol[1] = -0.5*(1 - x[2])*vertices[1] + 0.5*(1 - x[2])*vertices[4] - 0.5*(1 + x[2])*vertices[10] + 0.5*(1 + x[2])*vertices[13]; + * scol[1] = -0.5*(1 - x[2])*vertices[1] + 0.5*(1 - x[2])*vertices[7] - 0.5*(1 + x[2])*vertices[10] + 0.5*(1 + x[2])*vertices[16]; + * tcol[1] = -0.5*(1 - x[0] - x[1])*vertices[1] + 0.5*(1 - x[0] - x[1])*vertices[10] - 0.5*x[0]*vertices[4] + 0.5*x[0]*vertices[13] - 0.5*x[1]*vertices[7] + 0.5*x[1]*vertices[16]; # <<<<<<<<<<<<<< + * rcol[2] = -0.5*(1 - x[2])*vertices[2] + 0.5*(1 - x[2])*vertices[5] - 0.5*(1 + x[2])*vertices[11] + 0.5*(1 + x[2])*vertices[14]; + * scol[2] = -0.5*(1 - x[2])*vertices[2] + 0.5*(1 - x[2])*vertices[8] - 0.5*(1 + x[2])*vertices[11] + 0.5*(1 + x[2])*vertices[17]; + */ + (__pyx_v_tcol[1]) = (((((((-0.5 * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (__pyx_v_vertices[1])) + ((0.5 * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (__pyx_v_vertices[10]))) - ((0.5 * (__pyx_v_x[0])) * (__pyx_v_vertices[4]))) + ((0.5 * (__pyx_v_x[0])) * (__pyx_v_vertices[13]))) - ((0.5 * (__pyx_v_x[1])) * (__pyx_v_vertices[7]))) + ((0.5 * (__pyx_v_x[1])) * (__pyx_v_vertices[16]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":177 + * scol[1] = -0.5*(1 - x[2])*vertices[1] + 0.5*(1 - x[2])*vertices[7] - 0.5*(1 + x[2])*vertices[10] + 0.5*(1 + x[2])*vertices[16]; + * tcol[1] = -0.5*(1 - x[0] - x[1])*vertices[1] + 0.5*(1 - x[0] - x[1])*vertices[10] - 0.5*x[0]*vertices[4] + 0.5*x[0]*vertices[13] - 0.5*x[1]*vertices[7] + 0.5*x[1]*vertices[16]; + * rcol[2] = -0.5*(1 - x[2])*vertices[2] + 0.5*(1 - x[2])*vertices[5] - 0.5*(1 + x[2])*vertices[11] + 0.5*(1 + x[2])*vertices[14]; # <<<<<<<<<<<<<< + * scol[2] = -0.5*(1 - x[2])*vertices[2] + 0.5*(1 - x[2])*vertices[8] - 0.5*(1 + x[2])*vertices[11] + 0.5*(1 + x[2])*vertices[17]; + * tcol[2] = -0.5*(1 - x[0] - x[1])*vertices[2] + 0.5*(1 - x[0] - x[1])*vertices[11] - 0.5*x[0]*vertices[5] + 0.5*x[0]*vertices[14] - 0.5*x[1]*vertices[8] + 0.5*x[1]*vertices[17]; + */ + (__pyx_v_rcol[2]) = (((((-0.5 * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[2])) + ((0.5 * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[5]))) - ((0.5 * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[11]))) + ((0.5 * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[14]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":178 + * tcol[1] = -0.5*(1 - x[0] - x[1])*vertices[1] + 0.5*(1 - x[0] - x[1])*vertices[10] - 0.5*x[0]*vertices[4] + 0.5*x[0]*vertices[13] - 0.5*x[1]*vertices[7] + 0.5*x[1]*vertices[16]; + * rcol[2] = -0.5*(1 - x[2])*vertices[2] + 0.5*(1 - x[2])*vertices[5] - 0.5*(1 + x[2])*vertices[11] + 0.5*(1 + x[2])*vertices[14]; + * scol[2] = -0.5*(1 - x[2])*vertices[2] + 0.5*(1 - x[2])*vertices[8] - 0.5*(1 + x[2])*vertices[11] + 0.5*(1 + x[2])*vertices[17]; # <<<<<<<<<<<<<< + * tcol[2] = -0.5*(1 - x[0] - x[1])*vertices[2] + 0.5*(1 - x[0] - x[1])*vertices[11] - 0.5*x[0]*vertices[5] + 0.5*x[0]*vertices[14] - 0.5*x[1]*vertices[8] + 0.5*x[1]*vertices[17]; + * + */ + (__pyx_v_scol[2]) = (((((-0.5 * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[2])) + ((0.5 * (1.0 - (__pyx_v_x[2]))) * (__pyx_v_vertices[8]))) - ((0.5 * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[11]))) + ((0.5 * (1.0 + (__pyx_v_x[2]))) * (__pyx_v_vertices[17]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":179 + * rcol[2] = -0.5*(1 - x[2])*vertices[2] + 0.5*(1 - x[2])*vertices[5] - 0.5*(1 + x[2])*vertices[11] + 0.5*(1 + x[2])*vertices[14]; + * scol[2] = -0.5*(1 - x[2])*vertices[2] + 0.5*(1 - x[2])*vertices[8] - 0.5*(1 + x[2])*vertices[11] + 0.5*(1 + x[2])*vertices[17]; + * tcol[2] = -0.5*(1 - x[0] - x[1])*vertices[2] + 0.5*(1 - x[0] - x[1])*vertices[11] - 0.5*x[0]*vertices[5] + 0.5*x[0]*vertices[14] - 0.5*x[1]*vertices[8] + 0.5*x[1]*vertices[17]; # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_tcol[2]) = (((((((-0.5 * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (__pyx_v_vertices[2])) + ((0.5 * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (__pyx_v_vertices[11]))) - ((0.5 * (__pyx_v_x[0])) * (__pyx_v_vertices[5]))) + ((0.5 * (__pyx_v_x[0])) * (__pyx_v_vertices[14]))) - ((0.5 * (__pyx_v_x[1])) * (__pyx_v_vertices[8]))) + ((0.5 * (__pyx_v_x[1])) * (__pyx_v_vertices[17]))); + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":165 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void W1Jacobian3D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* tcol, + */ + + /* function exit code */ +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + "autogenerated_element_samplers", + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + return 0; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initautogenerated_element_samplers(void); /*proto*/ +PyMODINIT_FUNC initautogenerated_element_samplers(void) +#else +PyMODINIT_FUNC PyInit_autogenerated_element_samplers(void); /*proto*/ +PyMODINIT_FUNC PyInit_autogenerated_element_samplers(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_autogenerated_element_samplers(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_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 PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("autogenerated_element_samplers", __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) + __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_yt__utilities__lib__autogenerated_element_samplers) { + 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, "yt.utilities.lib.autogenerated_element_samplers")) { + if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.autogenerated_element_samplers", __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 init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("Q1Function3D", (void (*)(void))__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Function3D, "void (double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("Q1Jacobian3D", (void (*)(void))__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Jacobian3D, "void (double *, double *, double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("Q1Function2D", (void (*)(void))__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Function2D, "void (double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("Q1Jacobian2D", (void (*)(void))__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Jacobian2D, "void (double *, double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("Q2Function2D", (void (*)(void))__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q2Function2D, "void (double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("Q2Jacobian2D", (void (*)(void))__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q2Jacobian2D, "void (double *, double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("Tet2Function3D", (void (*)(void))__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Tet2Function3D, "void (double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("Tet2Jacobian3D", (void (*)(void))__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Tet2Jacobian3D, "void (double *, double *, double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("T2Function2D", (void (*)(void))__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_T2Function2D, "void (double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("T2Jacobian2D", (void (*)(void))__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_T2Jacobian2D, "void (double *, double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("W1Function3D", (void (*)(void))__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_W1Function3D, "void (double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("W1Jacobian3D", (void (*)(void))__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_W1Jacobian3D, "void (double *, double *, double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "yt/utilities/lib/autogenerated_element_samplers.pyx":1 + * # This file contains auto-generated functions for sampling # <<<<<<<<<<<<<< + * # inside finite element solutions for various mesh types. + * # To see how the code generation works in detail, see + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init yt.utilities.lib.autogenerated_element_samplers", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib.autogenerated_element_samplers"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #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 + +/* CLineInTraceback */ +static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; + if (c_line) { + c_line = __Pyx_CLineForTraceback(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( + PyThreadState_GET(), /*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); +} + +/* 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); + } +} + +/* 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;\ + } + +/* 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; +} + +/* 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; +} + +/* 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) + PyErr_Clear(); + ++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); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else + if (__Pyx_PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +#endif + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (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 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 (PyInt_Check(x) || PyLong_Check(x)) +#else + if (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 = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } + #else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } + #endif +#else + res = PyNumber_Int(x); +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + 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_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff -Nru yt-3.3.3/yt/utilities/lib/autogenerated_element_samplers.pxd yt-3.4.0/yt/utilities/lib/autogenerated_element_samplers.pxd --- yt-3.3.3/yt/utilities/lib/autogenerated_element_samplers.pxd 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/autogenerated_element_samplers.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,81 @@ +cdef void Q1Function3D(double* fx, + double* x, + double* vertices, + double* phys_x) nogil + + +cdef void Q1Jacobian3D(double* rcol, + double* scol, + double* tcol, + double* x, + double* vertices, + double* phys_x) nogil + + +cdef void Q1Function2D(double* fx, + double* x, + double* vertices, + double* phys_x) nogil + + +cdef void Q1Jacobian2D(double* rcol, + double* scol, + double* x, + double* vertices, + double* phys_x) nogil + + +cdef void Q2Function2D(double* fx, + double* x, + double* vertices, + double* phys_x) nogil + + +cdef void Q2Jacobian2D(double* rcol, + double* scol, + double* x, + double* vertices, + double* phys_x) nogil + + +cdef void Tet2Function3D(double* fx, + double* x, + double* vertices, + double* phys_x) nogil + + +cdef void Tet2Jacobian3D(double* rcol, + double* scol, + double* tcol, + double* x, + double* vertices, + double* phys_x) nogil + + +cdef void T2Function2D(double* fx, + double* x, + double* vertices, + double* phys_x) nogil + + +cdef void T2Jacobian2D(double* rcol, + double* scol, + double* x, + double* vertices, + double* phys_x) nogil + + +cdef void W1Function3D(double* fx, + double* x, + double* vertices, + double* phys_x) nogil + + +cdef void W1Jacobian3D(double* rcol, + double* scol, + double* tcol, + double* x, + double* vertices, + double* phys_x) nogil + + diff -Nru yt-3.3.3/yt/utilities/lib/autogenerated_element_samplers.pyx yt-3.4.0/yt/utilities/lib/autogenerated_element_samplers.pyx --- yt-3.3.3/yt/utilities/lib/autogenerated_element_samplers.pyx 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/autogenerated_element_samplers.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,181 @@ +# This file contains auto-generated functions for sampling +# inside finite element solutions for various mesh types. +# To see how the code generation works in detail, see +# yt/utilities/mesh_code_generation.py. + + +cimport cython +from libc.math cimport pow + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void Q1Function3D(double* fx, + double* x, + double* vertices, + double* phys_x) nogil: + fx[0] = 0.125*(1 - x[0])*(1 - x[1])*(1 - x[2])*vertices[0] + 0.125*(1 - x[0])*(1 - x[1])*(1 + x[2])*vertices[12] + 0.125*(1 - x[0])*(1 + x[1])*(1 - x[2])*vertices[9] + 0.125*(1 - x[0])*(1 + x[1])*(1 + x[2])*vertices[21] + 0.125*(1 + x[0])*(1 - x[1])*(1 - x[2])*vertices[3] + 0.125*(1 + x[0])*(1 - x[1])*(1 + x[2])*vertices[15] + 0.125*(1 + x[0])*(1 + x[1])*(1 - x[2])*vertices[6] + 0.125*(1 + x[0])*(1 + x[1])*(1 + x[2])*vertices[18] - phys_x[0]; + fx[1] = 0.125*(1 - x[0])*(1 - x[1])*(1 - x[2])*vertices[1] + 0.125*(1 - x[0])*(1 - x[1])*(1 + x[2])*vertices[13] + 0.125*(1 - x[0])*(1 + x[1])*(1 - x[2])*vertices[10] + 0.125*(1 - x[0])*(1 + x[1])*(1 + x[2])*vertices[22] + 0.125*(1 + x[0])*(1 - x[1])*(1 - x[2])*vertices[4] + 0.125*(1 + x[0])*(1 - x[1])*(1 + x[2])*vertices[16] + 0.125*(1 + x[0])*(1 + x[1])*(1 - x[2])*vertices[7] + 0.125*(1 + x[0])*(1 + x[1])*(1 + x[2])*vertices[19] - phys_x[1]; + fx[2] = 0.125*(1 - x[0])*(1 - x[1])*(1 - x[2])*vertices[2] + 0.125*(1 - x[0])*(1 - x[1])*(1 + x[2])*vertices[14] + 0.125*(1 - x[0])*(1 + x[1])*(1 - x[2])*vertices[11] + 0.125*(1 - x[0])*(1 + x[1])*(1 + x[2])*vertices[23] + 0.125*(1 + x[0])*(1 - x[1])*(1 - x[2])*vertices[5] + 0.125*(1 + x[0])*(1 - x[1])*(1 + x[2])*vertices[17] + 0.125*(1 + x[0])*(1 + x[1])*(1 - x[2])*vertices[8] + 0.125*(1 + x[0])*(1 + x[1])*(1 + x[2])*vertices[20] - phys_x[2]; + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void Q1Jacobian3D(double* rcol, + double* scol, + double* tcol, + double* x, + double* vertices, + double* phys_x) nogil: + rcol[0] = -0.125*(1 - x[1])*(1 - x[2])*vertices[0] + 0.125*(1 - x[1])*(1 - x[2])*vertices[3] - 0.125*(1 - x[1])*(1 + x[2])*vertices[12] + 0.125*(1 - x[1])*(1 + x[2])*vertices[15] + 0.125*(1 + x[1])*(1 - x[2])*vertices[6] - 0.125*(1 + x[1])*(1 - x[2])*vertices[9] + 0.125*(1 + x[1])*(1 + x[2])*vertices[18] - 0.125*(1 + x[1])*(1 + x[2])*vertices[21]; + scol[0] = -0.125*(1 - x[0])*(1 - x[2])*vertices[0] + 0.125*(1 - x[0])*(1 - x[2])*vertices[9] - 0.125*(1 - x[0])*(1 + x[2])*vertices[12] + 0.125*(1 - x[0])*(1 + x[2])*vertices[21] - 0.125*(1 + x[0])*(1 - x[2])*vertices[3] + 0.125*(1 + x[0])*(1 - x[2])*vertices[6] - 0.125*(1 + x[0])*(1 + x[2])*vertices[15] + 0.125*(1 + x[0])*(1 + x[2])*vertices[18]; + tcol[0] = -0.125*(1 - x[0])*(1 - x[1])*vertices[0] + 0.125*(1 - x[0])*(1 - x[1])*vertices[12] - 0.125*(1 - x[0])*(1 + x[1])*vertices[9] + 0.125*(1 - x[0])*(1 + x[1])*vertices[21] - 0.125*(1 + x[0])*(1 - x[1])*vertices[3] + 0.125*(1 + x[0])*(1 - x[1])*vertices[15] - 0.125*(1 + x[0])*(1 + x[1])*vertices[6] + 0.125*(1 + x[0])*(1 + x[1])*vertices[18]; + rcol[1] = -0.125*(1 - x[1])*(1 - x[2])*vertices[1] + 0.125*(1 - x[1])*(1 - x[2])*vertices[4] - 0.125*(1 - x[1])*(1 + x[2])*vertices[13] + 0.125*(1 - x[1])*(1 + x[2])*vertices[16] + 0.125*(1 + x[1])*(1 - x[2])*vertices[7] - 0.125*(1 + x[1])*(1 - x[2])*vertices[10] + 0.125*(1 + x[1])*(1 + x[2])*vertices[19] - 0.125*(1 + x[1])*(1 + x[2])*vertices[22]; + scol[1] = -0.125*(1 - x[0])*(1 - x[2])*vertices[1] + 0.125*(1 - x[0])*(1 - x[2])*vertices[10] - 0.125*(1 - x[0])*(1 + x[2])*vertices[13] + 0.125*(1 - x[0])*(1 + x[2])*vertices[22] - 0.125*(1 + x[0])*(1 - x[2])*vertices[4] + 0.125*(1 + x[0])*(1 - x[2])*vertices[7] - 0.125*(1 + x[0])*(1 + x[2])*vertices[16] + 0.125*(1 + x[0])*(1 + x[2])*vertices[19]; + tcol[1] = -0.125*(1 - x[0])*(1 - x[1])*vertices[1] + 0.125*(1 - x[0])*(1 - x[1])*vertices[13] - 0.125*(1 - x[0])*(1 + x[1])*vertices[10] + 0.125*(1 - x[0])*(1 + x[1])*vertices[22] - 0.125*(1 + x[0])*(1 - x[1])*vertices[4] + 0.125*(1 + x[0])*(1 - x[1])*vertices[16] - 0.125*(1 + x[0])*(1 + x[1])*vertices[7] + 0.125*(1 + x[0])*(1 + x[1])*vertices[19]; + rcol[2] = -0.125*(1 - x[1])*(1 - x[2])*vertices[2] + 0.125*(1 - x[1])*(1 - x[2])*vertices[5] - 0.125*(1 - x[1])*(1 + x[2])*vertices[14] + 0.125*(1 - x[1])*(1 + x[2])*vertices[17] + 0.125*(1 + x[1])*(1 - x[2])*vertices[8] - 0.125*(1 + x[1])*(1 - x[2])*vertices[11] + 0.125*(1 + x[1])*(1 + x[2])*vertices[20] - 0.125*(1 + x[1])*(1 + x[2])*vertices[23]; + scol[2] = -0.125*(1 - x[0])*(1 - x[2])*vertices[2] + 0.125*(1 - x[0])*(1 - x[2])*vertices[11] - 0.125*(1 - x[0])*(1 + x[2])*vertices[14] + 0.125*(1 - x[0])*(1 + x[2])*vertices[23] - 0.125*(1 + x[0])*(1 - x[2])*vertices[5] + 0.125*(1 + x[0])*(1 - x[2])*vertices[8] - 0.125*(1 + x[0])*(1 + x[2])*vertices[17] + 0.125*(1 + x[0])*(1 + x[2])*vertices[20]; + tcol[2] = -0.125*(1 - x[0])*(1 - x[1])*vertices[2] + 0.125*(1 - x[0])*(1 - x[1])*vertices[14] - 0.125*(1 - x[0])*(1 + x[1])*vertices[11] + 0.125*(1 - x[0])*(1 + x[1])*vertices[23] - 0.125*(1 + x[0])*(1 - x[1])*vertices[5] + 0.125*(1 + x[0])*(1 - x[1])*vertices[17] - 0.125*(1 + x[0])*(1 + x[1])*vertices[8] + 0.125*(1 + x[0])*(1 + x[1])*vertices[20]; + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void Q1Function2D(double* fx, + double* x, + double* vertices, + double* phys_x) nogil: + fx[0] = 0.25*(1 - x[0])*(1 - x[1])*vertices[0] + 0.25*(1 - x[0])*(1 + x[1])*vertices[6] + 0.25*(1 + x[0])*(1 - x[1])*vertices[2] + 0.25*(1 + x[0])*(1 + x[1])*vertices[4] - phys_x[0]; + fx[1] = 0.25*(1 - x[0])*(1 - x[1])*vertices[1] + 0.25*(1 - x[0])*(1 + x[1])*vertices[7] + 0.25*(1 + x[0])*(1 - x[1])*vertices[3] + 0.25*(1 + x[0])*(1 + x[1])*vertices[5] - phys_x[1]; + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void Q1Jacobian2D(double* rcol, + double* scol, + double* x, + double* vertices, + double* phys_x) nogil: + rcol[0] = -0.25*(1 - x[1])*vertices[0] + 0.25*(1 - x[1])*vertices[2] + 0.25*(1 + x[1])*vertices[4] - 0.25*(1 + x[1])*vertices[6]; + scol[0] = -0.25*(1 - x[0])*vertices[0] + 0.25*(1 - x[0])*vertices[6] - 0.25*(1 + x[0])*vertices[2] + 0.25*(1 + x[0])*vertices[4]; + rcol[1] = -0.25*(1 - x[1])*vertices[1] + 0.25*(1 - x[1])*vertices[3] + 0.25*(1 + x[1])*vertices[5] - 0.25*(1 + x[1])*vertices[7]; + scol[1] = -0.25*(1 - x[0])*vertices[1] + 0.25*(1 - x[0])*vertices[7] - 0.25*(1 + x[0])*vertices[3] + 0.25*(1 + x[0])*vertices[5]; + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void Q2Function2D(double* fx, + double* x, + double* vertices, + double* phys_x) nogil: + fx[0] = (1 + x[0])*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[16] - 0.5*(1 + x[0])*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[8] - 0.5*(1 + x[0])*(-1 + x[0])*x[1]*(1 + x[1])*vertices[12] - phys_x[0] - 0.5*x[0]*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[14] + 0.25*x[0]*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[0] + 0.25*x[0]*(-1 + x[0])*x[1]*(1 + x[1])*vertices[6] - 0.5*x[0]*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[10] + 0.25*x[0]*(1 + x[0])*x[1]*(-1 + x[1])*vertices[2] + 0.25*x[0]*(1 + x[0])*x[1]*(1 + x[1])*vertices[4]; + fx[1] = (1 + x[0])*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] - 0.5*(1 + x[0])*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[9] - 0.5*(1 + x[0])*(-1 + x[0])*x[1]*(1 + x[1])*vertices[13] - phys_x[1] - 0.5*x[0]*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[15] + 0.25*x[0]*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[1] + 0.25*x[0]*(-1 + x[0])*x[1]*(1 + x[1])*vertices[7] - 0.5*x[0]*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[11] + 0.25*x[0]*(1 + x[0])*x[1]*(-1 + x[1])*vertices[3] + 0.25*x[0]*(1 + x[0])*x[1]*(1 + x[1])*vertices[5]; + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void Q2Jacobian2D(double* rcol, + double* scol, + double* x, + double* vertices, + double* phys_x) nogil: + rcol[0] = -0.5*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[14] + (-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[16] + 0.25*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[0] - 0.5*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[8] + 0.25*(-1 + x[0])*x[1]*(1 + x[1])*vertices[6] - 0.5*(-1 + x[0])*x[1]*(1 + x[1])*vertices[12] - 0.5*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[10] + (1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[16] + 0.25*(1 + x[0])*x[1]*(-1 + x[1])*vertices[2] - 0.5*(1 + x[0])*x[1]*(-1 + x[1])*vertices[8] + 0.25*(1 + x[0])*x[1]*(1 + x[1])*vertices[4] - 0.5*(1 + x[0])*x[1]*(1 + x[1])*vertices[12] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[10] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[14] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[0] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[2] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[4] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[6]; + scol[0] = -0.5*(-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[8] + (-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[16] + 0.25*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[0] - 0.5*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[14] + 0.25*(-1 + x[1])*x[0]*(1 + x[0])*vertices[2] - 0.5*(-1 + x[1])*x[0]*(1 + x[0])*vertices[10] - 0.5*(1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[12] + (1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[16] + 0.25*(1 + x[1])*x[0]*(-1 + x[0])*vertices[6] - 0.5*(1 + x[1])*x[0]*(-1 + x[0])*vertices[14] + 0.25*(1 + x[1])*x[0]*(1 + x[0])*vertices[4] - 0.5*(1 + x[1])*x[0]*(1 + x[0])*vertices[10] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[8] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[12] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[0] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[6] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[2] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[4]; + rcol[1] = -0.5*(-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[15] + (-1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] + 0.25*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[1] - 0.5*(-1 + x[0])*x[1]*(-1 + x[1])*vertices[9] + 0.25*(-1 + x[0])*x[1]*(1 + x[1])*vertices[7] - 0.5*(-1 + x[0])*x[1]*(1 + x[1])*vertices[13] - 0.5*(1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[11] + (1 + x[0])*(1 + x[1])*(-1 + x[1])*vertices[17] + 0.25*(1 + x[0])*x[1]*(-1 + x[1])*vertices[3] - 0.5*(1 + x[0])*x[1]*(-1 + x[1])*vertices[9] + 0.25*(1 + x[0])*x[1]*(1 + x[1])*vertices[5] - 0.5*(1 + x[0])*x[1]*(1 + x[1])*vertices[13] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[11] - 0.5*x[0]*(1 + x[1])*(-1 + x[1])*vertices[15] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[1] + 0.25*x[0]*x[1]*(-1 + x[1])*vertices[3] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[5] + 0.25*x[0]*x[1]*(1 + x[1])*vertices[7]; + scol[1] = -0.5*(-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[9] + (-1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[17] + 0.25*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[1] - 0.5*(-1 + x[1])*x[0]*(-1 + x[0])*vertices[15] + 0.25*(-1 + x[1])*x[0]*(1 + x[0])*vertices[3] - 0.5*(-1 + x[1])*x[0]*(1 + x[0])*vertices[11] - 0.5*(1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[13] + (1 + x[1])*(1 + x[0])*(-1 + x[0])*vertices[17] + 0.25*(1 + x[1])*x[0]*(-1 + x[0])*vertices[7] - 0.5*(1 + x[1])*x[0]*(-1 + x[0])*vertices[15] + 0.25*(1 + x[1])*x[0]*(1 + x[0])*vertices[5] - 0.5*(1 + x[1])*x[0]*(1 + x[0])*vertices[11] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[9] - 0.5*x[1]*(1 + x[0])*(-1 + x[0])*vertices[13] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[1] + 0.25*x[1]*x[0]*(-1 + x[0])*vertices[7] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[3] + 0.25*x[1]*x[0]*(1 + x[0])*vertices[5]; + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void Tet2Function3D(double* fx, + double* x, + double* vertices, + double* phys_x) nogil: + fx[0] = (-x[0] + 2*pow(x[0], 2))*vertices[3] + (-x[1] + 2*pow(x[1], 2))*vertices[6] + (-x[2] + 2*pow(x[2], 2))*vertices[9] + (4*x[0] - 4*x[0]*x[1] - 4*x[0]*x[2] - 4*pow(x[0], 2))*vertices[12] + (4*x[1] - 4*x[1]*x[0] - 4*x[1]*x[2] - 4*pow(x[1], 2))*vertices[18] + (4*x[2] - 4*x[2]*x[0] - 4*x[2]*x[1] - 4*pow(x[2], 2))*vertices[21] + (1 - 3*x[0] + 4*x[0]*x[1] + 4*x[0]*x[2] + 2*pow(x[0], 2) - 3*x[1] + 4*x[1]*x[2] + 2*pow(x[1], 2) - 3*x[2] + 2*pow(x[2], 2))*vertices[0] - phys_x[0] + 4*x[0]*x[1]*vertices[15] + 4*x[0]*x[2]*vertices[24] + 4*x[1]*x[2]*vertices[27]; + fx[1] = (-x[0] + 2*pow(x[0], 2))*vertices[4] + (-x[1] + 2*pow(x[1], 2))*vertices[7] + (-x[2] + 2*pow(x[2], 2))*vertices[10] + (4*x[0] - 4*x[0]*x[1] - 4*x[0]*x[2] - 4*pow(x[0], 2))*vertices[13] + (4*x[1] - 4*x[1]*x[0] - 4*x[1]*x[2] - 4*pow(x[1], 2))*vertices[19] + (4*x[2] - 4*x[2]*x[0] - 4*x[2]*x[1] - 4*pow(x[2], 2))*vertices[22] + (1 - 3*x[0] + 4*x[0]*x[1] + 4*x[0]*x[2] + 2*pow(x[0], 2) - 3*x[1] + 4*x[1]*x[2] + 2*pow(x[1], 2) - 3*x[2] + 2*pow(x[2], 2))*vertices[1] - phys_x[1] + 4*x[0]*x[1]*vertices[16] + 4*x[0]*x[2]*vertices[25] + 4*x[1]*x[2]*vertices[28]; + fx[2] = (-x[0] + 2*pow(x[0], 2))*vertices[5] + (-x[1] + 2*pow(x[1], 2))*vertices[8] + (-x[2] + 2*pow(x[2], 2))*vertices[11] + (4*x[0] - 4*x[0]*x[1] - 4*x[0]*x[2] - 4*pow(x[0], 2))*vertices[14] + (4*x[1] - 4*x[1]*x[0] - 4*x[1]*x[2] - 4*pow(x[1], 2))*vertices[20] + (4*x[2] - 4*x[2]*x[0] - 4*x[2]*x[1] - 4*pow(x[2], 2))*vertices[23] + (1 - 3*x[0] + 4*x[0]*x[1] + 4*x[0]*x[2] + 2*pow(x[0], 2) - 3*x[1] + 4*x[1]*x[2] + 2*pow(x[1], 2) - 3*x[2] + 2*pow(x[2], 2))*vertices[2] - phys_x[2] + 4*x[0]*x[1]*vertices[17] + 4*x[0]*x[2]*vertices[26] + 4*x[1]*x[2]*vertices[29]; + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void Tet2Jacobian3D(double* rcol, + double* scol, + double* tcol, + double* x, + double* vertices, + double* phys_x) nogil: + rcol[0] = (-1 + 4*x[0])*vertices[3] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[12] + 4*x[1]*vertices[15] - 4*x[1]*vertices[18] - 4*x[2]*vertices[21] + 4*x[2]*vertices[24]; + scol[0] = (-1 + 4*x[1])*vertices[6] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[18] - 4*x[0]*vertices[12] + 4*x[0]*vertices[15] - 4*x[2]*vertices[21] + 4*x[2]*vertices[27]; + tcol[0] = (-1 + 4*x[2])*vertices[9] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[0] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[21] - 4*x[0]*vertices[12] + 4*x[0]*vertices[24] - 4*x[1]*vertices[18] + 4*x[1]*vertices[27]; + rcol[1] = (-1 + 4*x[0])*vertices[4] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[13] + 4*x[1]*vertices[16] - 4*x[1]*vertices[19] - 4*x[2]*vertices[22] + 4*x[2]*vertices[25]; + scol[1] = (-1 + 4*x[1])*vertices[7] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[19] - 4*x[0]*vertices[13] + 4*x[0]*vertices[16] - 4*x[2]*vertices[22] + 4*x[2]*vertices[28]; + tcol[1] = (-1 + 4*x[2])*vertices[10] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[1] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[22] - 4*x[0]*vertices[13] + 4*x[0]*vertices[25] - 4*x[1]*vertices[19] + 4*x[1]*vertices[28]; + rcol[2] = (-1 + 4*x[0])*vertices[5] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 8*x[0] - 4*x[1] - 4*x[2])*vertices[14] + 4*x[1]*vertices[17] - 4*x[1]*vertices[20] - 4*x[2]*vertices[23] + 4*x[2]*vertices[26]; + scol[2] = (-1 + 4*x[1])*vertices[8] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 4*x[0] - 8*x[1] - 4*x[2])*vertices[20] - 4*x[0]*vertices[14] + 4*x[0]*vertices[17] - 4*x[2]*vertices[23] + 4*x[2]*vertices[29]; + tcol[2] = (-1 + 4*x[2])*vertices[11] + (-3 + 4*x[0] + 4*x[1] + 4*x[2])*vertices[2] + (4 - 4*x[0] - 4*x[1] - 8*x[2])*vertices[23] - 4*x[0]*vertices[14] + 4*x[0]*vertices[26] - 4*x[1]*vertices[20] + 4*x[1]*vertices[29]; + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void T2Function2D(double* fx, + double* x, + double* vertices, + double* phys_x) nogil: + fx[0] = (-x[0] + 2*pow(x[0], 2))*vertices[2] + (-x[1] + 2*pow(x[1], 2))*vertices[4] + (-4*x[0]*x[1] + 4*x[1] - 4*pow(x[1], 2))*vertices[10] + (4*x[0] - 4*x[0]*x[1] - 4*pow(x[0], 2))*vertices[6] + (1 - 3*x[0] + 4*x[0]*x[1] + 2*pow(x[0], 2) - 3*x[1] + 2*pow(x[1], 2))*vertices[0] - phys_x[0] + 4*x[0]*x[1]*vertices[8]; + fx[1] = (-x[0] + 2*pow(x[0], 2))*vertices[3] + (-x[1] + 2*pow(x[1], 2))*vertices[5] + (-4*x[0]*x[1] + 4*x[1] - 4*pow(x[1], 2))*vertices[11] + (4*x[0] - 4*x[0]*x[1] - 4*pow(x[0], 2))*vertices[7] + (1 - 3*x[0] + 4*x[0]*x[1] + 2*pow(x[0], 2) - 3*x[1] + 2*pow(x[1], 2))*vertices[1] - phys_x[1] + 4*x[0]*x[1]*vertices[9]; + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void T2Jacobian2D(double* rcol, + double* scol, + double* x, + double* vertices, + double* phys_x) nogil: + rcol[0] = (-1 + 4*x[0])*vertices[2] + (-3 + 4*x[0] + 4*x[1])*vertices[0] + (4 - 8*x[0] - 4*x[1])*vertices[6] + 4*x[1]*vertices[8] - 4*x[1]*vertices[10]; + scol[0] = (-1 + 4*x[1])*vertices[4] + (-3 + 4*x[0] + 4*x[1])*vertices[0] + (4 - 4*x[0] - 8*x[1])*vertices[10] - 4*x[0]*vertices[6] + 4*x[0]*vertices[8]; + rcol[1] = (-1 + 4*x[0])*vertices[3] + (-3 + 4*x[0] + 4*x[1])*vertices[1] + (4 - 8*x[0] - 4*x[1])*vertices[7] + 4*x[1]*vertices[9] - 4*x[1]*vertices[11]; + scol[1] = (-1 + 4*x[1])*vertices[5] + (-3 + 4*x[0] + 4*x[1])*vertices[1] + (4 - 4*x[0] - 8*x[1])*vertices[11] - 4*x[0]*vertices[7] + 4*x[0]*vertices[9]; + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void W1Function3D(double* fx, + double* x, + double* vertices, + double* phys_x) nogil: + fx[0] = 0.5*(1 - x[0] - x[1])*(1 - x[2])*vertices[0] + 0.5*(1 - x[0] - x[1])*(1 + x[2])*vertices[9] - phys_x[0] + 0.5*x[0]*(1 - x[2])*vertices[3] + 0.5*x[0]*(1 + x[2])*vertices[12] + 0.5*x[1]*(1 - x[2])*vertices[6] + 0.5*x[1]*(1 + x[2])*vertices[15]; + fx[1] = 0.5*(1 - x[0] - x[1])*(1 - x[2])*vertices[1] + 0.5*(1 - x[0] - x[1])*(1 + x[2])*vertices[10] - phys_x[1] + 0.5*x[0]*(1 - x[2])*vertices[4] + 0.5*x[0]*(1 + x[2])*vertices[13] + 0.5*x[1]*(1 - x[2])*vertices[7] + 0.5*x[1]*(1 + x[2])*vertices[16]; + fx[2] = 0.5*(1 - x[0] - x[1])*(1 - x[2])*vertices[2] + 0.5*(1 - x[0] - x[1])*(1 + x[2])*vertices[11] - phys_x[2] + 0.5*x[0]*(1 - x[2])*vertices[5] + 0.5*x[0]*(1 + x[2])*vertices[14] + 0.5*x[1]*(1 - x[2])*vertices[8] + 0.5*x[1]*(1 + x[2])*vertices[17]; + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void W1Jacobian3D(double* rcol, + double* scol, + double* tcol, + double* x, + double* vertices, + double* phys_x) nogil: + rcol[0] = -0.5*(1 - x[2])*vertices[0] + 0.5*(1 - x[2])*vertices[3] - 0.5*(1 + x[2])*vertices[9] + 0.5*(1 + x[2])*vertices[12]; + scol[0] = -0.5*(1 - x[2])*vertices[0] + 0.5*(1 - x[2])*vertices[6] - 0.5*(1 + x[2])*vertices[9] + 0.5*(1 + x[2])*vertices[15]; + tcol[0] = -0.5*(1 - x[0] - x[1])*vertices[0] + 0.5*(1 - x[0] - x[1])*vertices[9] - 0.5*x[0]*vertices[3] + 0.5*x[0]*vertices[12] - 0.5*x[1]*vertices[6] + 0.5*x[1]*vertices[15]; + rcol[1] = -0.5*(1 - x[2])*vertices[1] + 0.5*(1 - x[2])*vertices[4] - 0.5*(1 + x[2])*vertices[10] + 0.5*(1 + x[2])*vertices[13]; + scol[1] = -0.5*(1 - x[2])*vertices[1] + 0.5*(1 - x[2])*vertices[7] - 0.5*(1 + x[2])*vertices[10] + 0.5*(1 + x[2])*vertices[16]; + tcol[1] = -0.5*(1 - x[0] - x[1])*vertices[1] + 0.5*(1 - x[0] - x[1])*vertices[10] - 0.5*x[0]*vertices[4] + 0.5*x[0]*vertices[13] - 0.5*x[1]*vertices[7] + 0.5*x[1]*vertices[16]; + rcol[2] = -0.5*(1 - x[2])*vertices[2] + 0.5*(1 - x[2])*vertices[5] - 0.5*(1 + x[2])*vertices[11] + 0.5*(1 + x[2])*vertices[14]; + scol[2] = -0.5*(1 - x[2])*vertices[2] + 0.5*(1 - x[2])*vertices[8] - 0.5*(1 + x[2])*vertices[11] + 0.5*(1 + x[2])*vertices[17]; + tcol[2] = -0.5*(1 - x[0] - x[1])*vertices[2] + 0.5*(1 - x[0] - x[1])*vertices[11] - 0.5*x[0]*vertices[5] + 0.5*x[0]*vertices[14] - 0.5*x[1]*vertices[8] + 0.5*x[1]*vertices[17]; + + diff -Nru yt-3.3.3/yt/utilities/lib/basic_octree.c yt-3.4.0/yt/utilities/lib/basic_octree.c --- yt-3.3.3/yt/utilities/lib/basic_octree.c 2016-12-12 01:41:38.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/basic_octree.c 2017-08-10 18:20:26.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,8 +6,15 @@ "depends": [ "yt/utilities/lib/platform_dep.h" ], + "include_dirs": [ + "yt/utilities/lib" + ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.basic_octree", + "sources": [ + "yt/utilities/lib/basic_octree.pyx" ] }, "module_name": "yt.utilities.lib.basic_octree" @@ -21,7 +28,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -43,6 +50,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -195,16 +203,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -331,6 +343,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -385,6 +403,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -494,8 +541,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -508,8 +555,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -631,10 +681,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -668,6 +720,7 @@ static const char *__pyx_f[] = { "yt/utilities/lib/basic_octree.pyx", + "stringsource", "__init__.pxd", "type.pxd", }; @@ -1153,7 +1206,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* BufferIndexError.proto */ static void __Pyx_RaiseBufferIndexError(int axis); @@ -1310,9 +1363,15 @@ /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1555,11 +1614,11 @@ /* Module declarations from 'cython' */ /* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ /* Module declarations from 'yt.utilities.lib.basic_octree' */ @@ -1577,6 +1636,7 @@ /* Implementation of 'yt.utilities.lib.basic_octree' */ static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ImportError; @@ -1619,6 +1679,7 @@ static const char __pyx_k_root_dx[] = "root_dx"; static const char __pyx_k_treecode[] = "treecode"; static const char __pyx_k_truncate[] = "truncate"; +static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_Truncating[] = "Truncating..."; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_count_only[] = "count_only"; @@ -1629,7 +1690,10 @@ static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_pweight_vals[] = "pweight_vals"; static const char __pyx_k_opening_angle[] = "opening_angle"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_top_grid_dims[] = "top_grid_dims"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_ID_next_up_n_level_x_y_z[] = "ID\tnext\tup_n\tlevel\tx\ty\tz\t"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_weight_child_parent_children[] = "weight\t\tchild?\tparent?\tchildren"; @@ -1641,6 +1705,7 @@ 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_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_kp_s_; @@ -1655,7 +1720,9 @@ static PyObject *__pyx_kp_u_Prints_out_information_about_al; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_kp_s_Truncating; +static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_cm; static PyObject *__pyx_n_s_count_only; static PyObject *__pyx_kp_s_d; @@ -1675,6 +1742,7 @@ static PyObject *__pyx_n_s_main; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_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; @@ -1689,8 +1757,10 @@ static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_pzs; static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_root_dx; static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_start_index; static PyObject *__pyx_n_s_stderr; static PyObject *__pyx_n_s_stdout; @@ -1713,6 +1783,8 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_12basic_octree_6Octree_10find_binding_energy(struct __pyx_obj_2yt_9utilities_3lib_12basic_octree_Octree *__pyx_v_self, int __pyx_v_truncate, __pyx_t_5numpy_float64_t __pyx_v_kinetic, PyArrayObject *__pyx_v_root_dx, float __pyx_v_opening_angle); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_12basic_octree_6Octree_12print_all_nodes(struct __pyx_obj_2yt_9utilities_3lib_12basic_octree_Octree *__pyx_v_self); /* proto */ static void __pyx_pf_2yt_9utilities_3lib_12basic_octree_6Octree_14__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_12basic_octree_Octree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_12basic_octree_6Octree_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_12basic_octree_Octree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_12basic_octree_6Octree_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_12basic_octree_Octree *__pyx_v_self, CYTHON_UNUSED 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 PyObject *__pyx_tp_new_2yt_9utilities_3lib_12basic_octree_Octree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -1726,6 +1798,8 @@ static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; /* "yt/utilities/lib/basic_octree.pyx":35 * double sqrt(double x) @@ -2426,8 +2500,11 @@ 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; } @@ -2436,11 +2513,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_top_grid_dims)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nvals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 132, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_incremental); @@ -2453,6 +2532,7 @@ } 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; @@ -3046,7 +3126,7 @@ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.utilities.lib.basic_octree.Octree.add_to_position", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.basic_octree.Octree.add_to_position", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } @@ -3138,7 +3218,7 @@ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.utilities.lib.basic_octree.Octree.find_on_root_level", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.basic_octree.Octree.find_on_root_level", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -3174,12 +3254,19 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -3188,31 +3275,37 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pxs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_array_to_tree", 0, 6, 7, 1); __PYX_ERR(0, 201, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pys)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_array_to_tree", 0, 6, 7, 2); __PYX_ERR(0, 201, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pzs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_array_to_tree", 0, 6, 7, 3); __PYX_ERR(0, 201, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pvals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_array_to_tree", 0, 6, 7, 4); __PYX_ERR(0, 201, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pweight_vals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_array_to_tree", 0, 6, 7, 5); __PYX_ERR(0, 201, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_treecode); @@ -3225,6 +3318,7 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -3490,10 +3584,15 @@ 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; } @@ -3502,21 +3601,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_index)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_grid_to_tree", 1, 5, 5, 1); __PYX_ERR(0, 220, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pvals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_grid_to_tree", 1, 5, 5, 2); __PYX_ERR(0, 220, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wvals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_grid_to_tree", 1, 5, 5, 3); __PYX_ERR(0, 220, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cm)) != 0)) kw_args--; else { @@ -3664,7 +3767,9 @@ 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; } @@ -3673,6 +3778,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_count_only); @@ -3685,6 +3791,7 @@ } 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; @@ -5169,6 +5276,7 @@ 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; } @@ -5186,6 +5294,7 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } @@ -5887,7 +5996,7 @@ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.utilities.lib.basic_octree.Octree.fbe_main", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.basic_octree.Octree.fbe_main", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -5921,9 +6030,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -5932,16 +6045,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_truncate)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kinetic)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("find_binding_energy", 0, 3, 4, 1); __PYX_ERR(0, 483, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_root_dx)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("find_binding_energy", 0, 3, 4, 2); __PYX_ERR(0, 483, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_opening_angle); @@ -5954,6 +6070,7 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -6678,7 +6795,7 @@ __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("yt.utilities.lib.basic_octree.Octree.print_node_info", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.basic_octree.Octree.print_node_info", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF(__pyx_v_line); __Pyx_XDECREF(__pyx_v_nline); @@ -7239,1635 +7356,1251 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_12basic_octree_6Octree_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_12basic_octree_6Octree_17__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_2yt_9utilities_3lib_12basic_octree_6Octree_16__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_12basic_octree_Octree *)__pyx_v_self)); - /* "yt/utilities/lib/fp_utils.pxd":20 - * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * - */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: +static PyObject *__pyx_pf_2yt_9utilities_3lib_12basic_octree_6Octree_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_12basic_octree_Octree *__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_r = __pyx_v_i1; - goto __pyx_L0; + __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) - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "(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_L0:; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.basic_octree.Octree.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 +/* "(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__") */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_12basic_octree_6Octree_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_12basic_octree_6Octree_19__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_2yt_9utilities_3lib_12basic_octree_6Octree_18__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_12basic_octree_Octree *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "yt/utilities/lib/fp_utils.pxd":24 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 - * - */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< - * - * cdef inline int imin(int i0, int i1) nogil: +static PyObject *__pyx_pf_2yt_9utilities_3lib_12basic_octree_6Octree_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_12basic_octree_Octree *__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_r = __pyx_v_f1; - goto __pyx_L0; + __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) - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + /* "(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_L0:; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.basic_octree.Octree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 - * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "yt/utilities/lib/fp_utils.pxd":28 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * if info == NULL: return # <<<<<<<<<<<<<< * + * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; + __pyx_r = 0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 */ + __pyx_v_endian_detector = 1; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * ndim = PyArray_NDIM(self) */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":32 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ + __pyx_v_copy_shape = 1; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; + } -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); - if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; + /*else*/ { + __pyx_v_copy_shape = 0; } + __pyx_L4:; - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline int iclip(int i, int a, int b) nogil: + * 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_r = __pyx_v_f0; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + * 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") * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":40 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 218, __pyx_L1_error) - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * 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_r = __pyx_v_i; - goto __pyx_L0; + } - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":45 + * 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") * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fclip(np.float64_t f, + * info.buf = PyArray_DATA(self) */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 222, __pyx_L1_error) - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * 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") */ + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; - - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + __pyx_v_info->ndim = __pyx_v_ndim; - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":54 - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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]); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + goto __pyx_L11; } - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + /*else*/ { + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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; -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * - * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ - __pyx_v_endian_detector = 1; + __pyx_v_f = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * - * ndim = PyArray_NDIM(self) */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * if not hasfields and not copy_shape: */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< * else: - * copy_shape = 0 + * # need to call releasebuffer */ - __pyx_v_copy_shape = 1; + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - goto __pyx_L4; + goto __pyx_L14; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 * else: - * copy_shape = 0 # <<<<<<<<<<<<<< + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * if not hasfields: */ /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); } + __pyx_L14:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = 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 not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - } + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } + __pyx_L19_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 259, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - } + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * 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: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - goto __pyx_L11; - } + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ - __pyx_v_info->suboffsets = NULL; + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ - __pyx_v_f = NULL; + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - __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; + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(2, 278, __pyx_L1_error) + break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: */ - goto __pyx_L14; - } + __pyx_v_info->format = __pyx_v_f; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: + * info.format = stdlib.malloc(_buffer_format_string_len) */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; + (__pyx_v_info->format[0]) = '^'; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + __pyx_v_offset = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) */ - if (__pyx_t_1) { + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + (__pyx_v_f[0]) = '\x00'; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; +/* 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)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; + free(__pyx_v_info->format); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; + free(__pyx_v_info->strides); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; + __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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) */ -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { +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 - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + __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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) * - */ - free(__pyx_v_info->strides); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + * 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_MultiIterNew1(PyObject *__pyx_v_a) { +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_MultiIterNew1", 0); + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew2(a, b): + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) * - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * 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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * 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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * 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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) * */ @@ -8904,7 +8637,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8985,15 +8718,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) + __PYX_ERR(2, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + __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, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -9008,11 +8741,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) + __PYX_ERR(2, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -9033,7 +8766,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __pyx_L1_error) + __PYX_ERR(2, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -9041,15 +8774,15 @@ __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, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -9062,12 +8795,12 @@ * 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, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -9079,11 +8812,11 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) + __PYX_ERR(2, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -9147,11 +8880,11 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __PYX_ERR(2, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -9170,11 +8903,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -9234,7 +8967,7 @@ * 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, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -9256,11 +8989,11 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __PYX_ERR(2, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -9278,11 +9011,11 @@ * 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, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -9296,11 +9029,11 @@ * 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, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -9314,11 +9047,11 @@ * 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, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -9332,11 +9065,11 @@ * 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, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -9350,11 +9083,11 @@ * 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, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -9368,11 +9101,11 @@ * 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, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -9386,11 +9119,11 @@ * 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, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -9404,11 +9137,11 @@ * 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, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -9422,11 +9155,11 @@ * 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, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -9440,11 +9173,11 @@ * 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, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -9458,11 +9191,11 @@ * 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, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -9476,11 +9209,11 @@ * 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, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -9494,11 +9227,11 @@ * 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, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -9512,11 +9245,11 @@ * 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, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -9532,11 +9265,11 @@ * 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, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -9545,702 +9278,1193 @@ goto __pyx_L15; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + /*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, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 844, __pyx_L1_error) + } + __pyx_L15:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + goto __pyx_L13; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * 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; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - goto __pyx_L13; } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; + __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, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * - * 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. + * 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_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_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_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! - */ - __pyx_v_baseptr = NULL; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ - goto __pyx_L3; + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - /*else*/ { - Py_INCREF(__pyx_v_base); + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - Py_XDECREF(__pyx_v_arr->base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":24 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 * - * cdef inline object get_array_base(ndarray arr): */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + */ + __pyx_r = __pyx_v_f1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ /* function exit code */ - __Pyx_RefNannyFinishContext(); + __pyx_L0:; + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * 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); + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 * */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + */ + __pyx_r = __pyx_v_f1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ -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); +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/utilities/lib/fp_utils.pxd":36 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 + * */ - { - __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:*/ { + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + if (__pyx_t_1) { + __pyx_r = (-__pyx_v_f0); + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + */ + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":40 * - * cdef inline int import_umath() except -1: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + */ + __pyx_r = __pyx_v_i; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - { - __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:*/ { + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.float64_t fclip(np.float64_t f, */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_ufunc() except -1: + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * 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:*/ { + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":58 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_2yt_9utilities_3lib_12basic_octree_Octree __pyx_vtable_2yt_9utilities_3lib_12basic_octree_Octree; @@ -10265,7 +10489,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_12basic_octree_Octree(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + 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 @@ -10287,6 +10511,8 @@ {"finalize", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_12basic_octree_6Octree_9finalize, METH_VARARGS|METH_KEYWORDS, 0}, {"find_binding_energy", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_12basic_octree_6Octree_11find_binding_energy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_9utilities_3lib_12basic_octree_6Octree_10find_binding_energy}, {"print_all_nodes", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_12basic_octree_6Octree_13print_all_nodes, METH_NOARGS, __pyx_doc_2yt_9utilities_3lib_12basic_octree_6Octree_12print_all_nodes}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_12basic_octree_6Octree_17__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_12basic_octree_6Octree_19__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -10383,7 +10609,9 @@ {&__pyx_kp_u_Prints_out_information_about_al, __pyx_k_Prints_out_information_about_al, sizeof(__pyx_k_Prints_out_information_about_al), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_kp_s_Truncating, __pyx_k_Truncating, sizeof(__pyx_k_Truncating), 0, 0, 1, 0}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 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_cm, __pyx_k_cm, sizeof(__pyx_k_cm), 0, 0, 1, 1}, {&__pyx_n_s_count_only, __pyx_k_count_only, sizeof(__pyx_k_count_only), 0, 0, 1, 1}, {&__pyx_kp_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 0}, @@ -10403,6 +10631,7 @@ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_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}, @@ -10417,8 +10646,10 @@ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_pzs, __pyx_k_pzs, sizeof(__pyx_k_pzs), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 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_root_dx, __pyx_k_root_dx, sizeof(__pyx_k_root_dx), 0, 0, 1, 1}, {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_start_index, __pyx_k_start_index, sizeof(__pyx_k_start_index), 0, 0, 1, 1}, {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1}, @@ -10437,9 +10668,10 @@ }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 54, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -10449,6 +10681,25 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 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_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); 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("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__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): @@ -10456,9 +10707,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -10467,9 +10718,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -10478,9 +10729,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -10489,9 +10740,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -10500,9 +10751,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -10511,9 +10762,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -10522,9 +10773,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -10533,18 +10784,18 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -10616,6 +10867,7 @@ __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 @@ -10662,6 +10914,7 @@ __pyx_type_2yt_9utilities_3lib_12basic_octree_Octree.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_12basic_octree_Octree.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_12basic_octree_Octree) < 0) __PYX_ERR(0, 119, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "Octree", (PyObject *)&__pyx_type_2yt_9utilities_3lib_12basic_octree_Octree) < 0) __PYX_ERR(0, 119, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_12basic_octree_Octree) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_12basic_octree_Octree = &__pyx_type_2yt_9utilities_3lib_12basic_octree_Octree; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -10670,12 +10923,12 @@ #else sizeof(PyHeapTypeObject), #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + 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, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -10722,12 +10975,12 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /*--- Wrapped vars code ---*/ @@ -10737,7 +10990,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.basic_octree", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.basic_octree", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -11653,17 +11906,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -11782,8 +12040,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON @@ -11823,11 +12081,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -11850,7 +12104,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -11871,7 +12125,7 @@ #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -12034,25 +12288,25 @@ #endif /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -12076,7 +12330,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -12086,7 +12340,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -12147,7 +12401,7 @@ } /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -12164,8 +12418,73 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -12238,8 +12557,42 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -12319,7 +12672,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -12378,12 +12731,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -12420,8 +12776,8 @@ #endif - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + /* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -12443,7 +12799,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -12474,7 +12830,7 @@ } /* None */ - static CYTHON_INLINE long __Pyx_pow_long(long b, long e) { + static CYTHON_INLINE long __Pyx_pow_long(long b, long e) { long t = b; switch (e) { case 3: @@ -12499,7 +12855,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + 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) { @@ -12530,7 +12886,7 @@ } /* Print */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); if (!f) { @@ -12636,7 +12992,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -12656,7 +13012,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -12791,7 +13147,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -12811,7 +13167,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -12946,7 +13302,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -12977,7 +13333,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -13166,7 +13522,7 @@ } /* PrintOne */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static int __Pyx_PrintOne(PyObject* f, PyObject *o) { if (!f) { if (!(f = __Pyx_GetStdout())) @@ -13203,7 +13559,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -13234,7 +13590,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -13423,7 +13779,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -13439,7 +13795,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -13457,7 +13813,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -13522,7 +13878,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -13547,6 +13903,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -13555,11 +13913,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/bitarray.c yt-3.4.0/yt/utilities/lib/bitarray.c --- yt-3.3.3/yt/utilities/lib/bitarray.c 2016-12-12 01:41:39.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/bitarray.c 2017-08-10 18:20:27.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,6 +6,10 @@ "depends": [], "libraries": [ "m" + ], + "name": "yt.utilities.lib.bitarray", + "sources": [ + "yt/utilities/lib/bitarray.pyx" ] }, "module_name": "yt.utilities.lib.bitarray" @@ -19,7 +23,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -41,6 +45,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -193,16 +198,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -329,6 +338,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -383,6 +398,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -490,8 +534,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -504,8 +548,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -627,10 +674,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -664,6 +713,7 @@ static const char *__pyx_f[] = { "yt/utilities/lib/bitarray.pyx", + "stringsource", "__init__.pxd", "type.pxd", }; @@ -1172,7 +1222,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* BufferFallbackError.proto */ static void __Pyx_RaiseBufferFallbackError(void); @@ -1190,6 +1240,43 @@ const char *name, int exact); #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { @@ -1250,8 +1337,11 @@ /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); /* CodeObjectCache.proto */ typedef struct { @@ -1272,6 +1362,9 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value); + /* BufferStructDeclare.proto */ typedef struct { Py_ssize_t shape, strides, suboffsets; @@ -1300,10 +1393,10 @@ static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value); /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* RealImag.proto */ #if CYTHON_CCOMPLEX @@ -1416,13 +1509,10 @@ static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); @@ -1483,6 +1573,7 @@ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray = 0; static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_8bitarray_ba_set_value(__pyx_t_5numpy_uint8_t *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint8_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_9utilities_3lib_8bitarray_ba_get_value(__pyx_t_5numpy_uint8_t *, __pyx_t_5numpy_uint64_t); /*proto*/ +static PyObject *__pyx_f_2yt_9utilities_3lib_8bitarray___pyx_unpickle_bitarray__set_state(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *, PyObject *); /*proto*/ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; #define __Pyx_MODULE_NAME "yt.utilities.lib.bitarray" int __pyx_module_is_main_yt__utilities__lib__bitarray = 0; @@ -1495,8 +1586,10 @@ static const char __pyx_k_np[] = "np"; static const char __pyx_k_arr[] = "arr"; static const char __pyx_k_ind[] = "ind"; +static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_val[] = "val"; static const char __pyx_k_bool[] = "bool"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_test[] = "__test__"; @@ -1506,14 +1599,27 @@ static const char __pyx_k_zeros[] = "zeros"; static const char __pyx_k_astype[] = "astype"; static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_result[] = "result"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_PickleError[] = "PickleError"; 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_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_set_from_array[] = "set_from_array"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Bit_array_functions[] = "\nBit array functions\n\n\n\n"; +static const char __pyx_k_pyx_unpickle_bitarray[] = "__pyx_unpickle_bitarray"; static const char __pyx_k_bitarray___init___line_26[] = "bitarray.__init__ (line 26)"; +static const char __pyx_k_yt_utilities_lib_bitarray[] = "yt.utilities.lib.bitarray"; static const char __pyx_k_bitarray_set_value_line_126[] = "bitarray.set_value (line 126)"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_bitarray_query_value_line_151[] = "bitarray.query_value (line 151)"; @@ -1521,6 +1627,7 @@ 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"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xe5[] = "Incompatible checksums (%s vs 0xe5f0cd6 = (buf, buf_size, ibuf, size))"; static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; static const char __pyx_k_Query_the_on_off_value_of_a_give[] = "Query the on/off value of a given bit.\n\n Return the value encoded in a given index.\n\n Parameters\n ----------\n ind : int\n The index to query in the bitarray.\n\n Examples\n --------\n\n >>> arr_in = np.array([True, True, False])\n >>> a = ba.bitarray(arr = arr_in)\n >>> print a.query_value(2)\n\n "; static const char __pyx_k_This_is_a_bitarray_which_flips_i[] = "This is a bitarray, which flips individual bits to on/off inside a\n uint8 container array.\n\n By encoding on/off inside each bit in a uint8 array, we can compress\n boolean information down by up to a factor of 8. Either an input array\n or a size must be provided.\n\n Parameters\n ----------\n size : int\n The size we should pre-allocate.\n arr : array-like\n An input array to turn into a bitarray.\n\n Examples\n --------\n\n >>> arr_in1 = np.array([True, True, False])\n >>> arr_in2 = np.array([False, True, True])\n >>> a = ba.bitarray(arr = arr_in1)\n >>> b = ba.bitarray(arr = arr_in2)\n >>> print a & b\n >>> print (a & b).as_bool_array()\n\n "; @@ -1530,7 +1637,9 @@ 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_0xe5; static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_kp_u_Query_the_on_off_value_of_a_give; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_kp_u_Set_the_on_off_value_of_a_given; @@ -1543,23 +1652,37 @@ static PyObject *__pyx_kp_u_bitarray_query_value_line_151; static PyObject *__pyx_kp_u_bitarray_set_value_line_126; static PyObject *__pyx_n_s_bool; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_ind; static PyObject *__pyx_n_s_main; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_new; 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_pickle; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle_bitarray; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_set_from_array; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_size; +static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_uint8; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_yt_utilities_lib_bitarray; static PyObject *__pyx_n_s_zeros; static int __pyx_pf_2yt_9utilities_3lib_8bitarray_8bitarray___init__(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_arr); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_8bitarray_8bitarray_2set_from_array(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_v_self, PyArrayObject *__pyx_v_arr); /* proto */ @@ -1569,12 +1692,16 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_8bitarray_8bitarray_4ibuf___get__(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_8bitarray_8bitarray_4ibuf_2__set__(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_8bitarray_8bitarray_4ibuf_4__del__(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_8bitarray_8bitarray_10__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_8bitarray_8bitarray_12__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_8bitarray___pyx_unpickle_bitarray(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 PyObject *__pyx_tp_new_2yt_9utilities_3lib_8bitarray_bitarray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_3; static PyObject *__pyx_int_7; +static PyObject *__pyx_int_241110230; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; @@ -1586,6 +1713,8 @@ static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_codeobj__12; /* "yt/utilities/lib/bitarray.pyx":26 * @cython.wraparound(False) @@ -1617,7 +1746,9 @@ 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; } @@ -1628,6 +1759,7 @@ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); if (value) { values[0] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr); @@ -1640,7 +1772,9 @@ } 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); + CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } @@ -2692,7 +2826,9 @@ 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; } @@ -2701,6 +2837,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ind)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; else { @@ -2964,181 +3101,874 @@ return __pyx_r; } -/* "yt/utilities/lib/bitarray.pxd":20 - * cimport cython - * - * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, # <<<<<<<<<<<<<< - * np.uint8_t val) nogil: - * if val > 0: val = 1 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.buf, self.buf_size, self.ibuf, self.size) */ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_8bitarray_ba_set_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind, __pyx_t_5numpy_uint8_t __pyx_v_val) { - int __pyx_t_1; - __pyx_t_5numpy_uint64_t __pyx_t_2; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_8bitarray_8bitarray_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_8bitarray_8bitarray_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_2yt_9utilities_3lib_8bitarray_8bitarray_10__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)__pyx_v_self)); - /* "yt/utilities/lib/bitarray.pxd":22 - * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, - * np.uint8_t val) nogil: - * if val > 0: val = 1 # <<<<<<<<<<<<<< - * buf[ind >> 3] |= (val << (ind & 7)) - * + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_8bitarray_8bitarray_10__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *__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; + int __pyx_t_5; + int __pyx_t_6; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.buf, self.buf_size, self.ibuf, self.size) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_t_1 = ((__pyx_v_val > 0) != 0); - if (__pyx_t_1) { - __pyx_v_val = 1; - } + __pyx_t_1 = __Pyx_PyBytes_FromCString(__pyx_v_self->buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->buf_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->size); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __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_INCREF(__pyx_v_self->ibuf); + __Pyx_GIVEREF(__pyx_v_self->ibuf); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->ibuf); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_v_state = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* "yt/utilities/lib/bitarray.pxd":23 - * np.uint8_t val) nogil: - * if val > 0: val = 1 - * buf[ind >> 3] |= (val << (ind & 7)) # <<<<<<<<<<<<<< - * - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.buf, self.buf_size, self.ibuf, self.size) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, */ - __pyx_t_2 = (__pyx_v_ind >> 3); - (__pyx_v_buf[__pyx_t_2]) = ((__pyx_v_buf[__pyx_t_2]) | (__pyx_v_val << (__pyx_v_ind & 7))); + __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v__dict = __pyx_t_4; + __pyx_t_4 = 0; - /* "yt/utilities/lib/bitarray.pxd":20 - * cimport cython - * - * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, # <<<<<<<<<<<<<< - * np.uint8_t val) nogil: - * if val > 0: val = 1 + /* "(tree fragment)":5 + * state = (self.buf, self.buf_size, self.ibuf, self.size) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_5 = (__pyx_v__dict != Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* function exit code */ -} + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.ibuf is not None + */ + __pyx_v_use_setstate = 1; -/* "yt/utilities/lib/bitarray.pxd":25 - * buf[ind >> 3] |= (val << (ind & 7)) - * - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) - * if rv == 0: return 0 + /* "(tree fragment)":5 + * state = (self.buf, self.buf_size, self.ibuf, self.size) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ + goto __pyx_L3; + } -static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_9utilities_3lib_8bitarray_ba_get_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind) { - __pyx_t_5numpy_uint8_t __pyx_v_rv; - __pyx_t_5numpy_uint8_t __pyx_r; - int __pyx_t_1; + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = self.ibuf is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_bitarray, (type(self), 0xe5f0cd6, None), state + */ + /*else*/ { + __pyx_t_6 = (__pyx_v_self->ibuf != Py_None); + __pyx_v_use_setstate = __pyx_t_6; + } + __pyx_L3:; - /* "yt/utilities/lib/bitarray.pxd":26 - * - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) # <<<<<<<<<<<<<< - * if rv == 0: return 0 - * return 1 + /* "(tree fragment)":10 + * else: + * use_setstate = self.ibuf is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_bitarray, (type(self), 0xe5f0cd6, None), state + * else: */ - __pyx_v_rv = ((__pyx_v_buf[(__pyx_v_ind >> 3)]) & (1 << (__pyx_v_ind & 7))); + __pyx_t_6 = (__pyx_v_use_setstate != 0); + if (__pyx_t_6) { - /* "yt/utilities/lib/bitarray.pxd":27 - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) - * if rv == 0: return 0 # <<<<<<<<<<<<<< - * return 1 - * + /* "(tree fragment)":11 + * use_setstate = self.ibuf is not None + * if use_setstate: + * return __pyx_unpickle_bitarray, (type(self), 0xe5f0cd6, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_bitarray, (type(self), 0xe5f0cd6, state) */ - __pyx_t_1 = ((__pyx_v_rv == 0) != 0); - if (__pyx_t_1) { - __pyx_r = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_bitarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_241110230); + __Pyx_GIVEREF(__pyx_int_241110230); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_241110230); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = self.ibuf is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_bitarray, (type(self), 0xe5f0cd6, None), state + * else: + */ } - /* "yt/utilities/lib/bitarray.pxd":28 - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) - * if rv == 0: return 0 - * return 1 # <<<<<<<<<<<<<< - * - * cdef class bitarray: + /* "(tree fragment)":13 + * return __pyx_unpickle_bitarray, (type(self), 0xe5f0cd6, None), state + * else: + * return __pyx_unpickle_bitarray, (type(self), 0xe5f0cd6, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_bitarray__set_state(self, __pyx_state) */ - __pyx_r = 1; - goto __pyx_L0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_bitarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_241110230); + __Pyx_GIVEREF(__pyx_int_241110230); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_241110230); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } - /* "yt/utilities/lib/bitarray.pxd":25 - * buf[ind >> 3] |= (val << (ind & 7)) - * - * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< - * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) - * if rv == 0: return 0 + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.buf, self.buf_size, self.ibuf, self.size) */ /* 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("yt.utilities.lib.bitarray.bitarray.__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; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_bitarray, (type(self), 0xe5f0cd6, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_bitarray__set_state(self, __pyx_state) */ /* 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; +static PyObject *__pyx_pw_2yt_9utilities_3lib_8bitarray_8bitarray_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_8bitarray_8bitarray_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; __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)); + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_8bitarray_8bitarray_12__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; +static PyObject *__pyx_pf_2yt_9utilities_3lib_8bitarray_8bitarray_12__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim + /* "(tree fragment)":15 + * return __pyx_unpickle_bitarray, (type(self), 0xe5f0cd6, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_bitarray__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } + 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_2yt_9utilities_3lib_8bitarray___pyx_unpickle_bitarray__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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_bitarray, (type(self), 0xe5f0cd6, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_bitarray__set_state(self, __pyx_state) */ - __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.bitarray.bitarray.__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_bitarray(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xe5f0cd6: + * from pickle import PickleError + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_8bitarray_1__pyx_unpickle_bitarray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_8bitarray_1__pyx_unpickle_bitarray = {"__pyx_unpickle_bitarray", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_8bitarray_1__pyx_unpickle_bitarray, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_8bitarray_1__pyx_unpickle_bitarray(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_bitarray (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_bitarray", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_bitarray", 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_bitarray") < 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_bitarray", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.bitarray.__pyx_unpickle_bitarray", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_8bitarray___pyx_unpickle_bitarray(__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_2yt_9utilities_3lib_8bitarray___pyx_unpickle_bitarray(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_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_bitarray", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_bitarray(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xe5f0cd6: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xe5f0cd6 = (buf, buf_size, ibuf, size))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xe5f0cd6) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_bitarray(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xe5f0cd6: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xe5f0cd6 = (buf, buf_size, ibuf, size))" % __pyx_checksum) + * result = bitarray.__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_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 != 0xe5f0cd6: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xe5f0cd6 = (buf, buf_size, ibuf, size))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = bitarray.__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_0xe5, __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_PickleError); + __pyx_t_2 = __pyx_v_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_bitarray(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xe5f0cd6: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xe5f0cd6 = (buf, buf_size, ibuf, size))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xe5f0cd6 = (buf, buf_size, ibuf, size))" % __pyx_checksum) + * result = bitarray.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_bitarray__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray), __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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xe5f0cd6 = (buf, buf_size, ibuf, size))" % __pyx_checksum) + * result = bitarray.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_bitarray__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = bitarray.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_bitarray__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_bitarray__set_state(bitarray 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_2yt_9utilities_3lib_8bitarray___pyx_unpickle_bitarray__set_state(((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)__pyx_v_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 PickleError("Incompatible checksums (%s vs 0xe5f0cd6 = (buf, buf_size, ibuf, size))" % __pyx_checksum) + * result = bitarray.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_bitarray__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_bitarray__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_bitarray__set_state(bitarray result, tuple __pyx_state): + * result.buf = __pyx_state[0]; result.buf_size = __pyx_state[1]; result.ibuf = __pyx_state[2]; result.size = __pyx_state[3] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_bitarray(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xe5f0cd6: + * from pickle import 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("yt.utilities.lib.bitarray.__pyx_unpickle_bitarray", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_bitarray__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_bitarray__set_state(bitarray result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.buf = __pyx_state[0]; result.buf_size = __pyx_state[1]; result.ibuf = __pyx_state[2]; result.size = __pyx_state[3] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_f_2yt_9utilities_3lib_8bitarray___pyx_unpickle_bitarray__set_state(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __pyx_t_5numpy_uint8_t *__pyx_t_2; + __pyx_t_5numpy_uint64_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_bitarray__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_bitarray__set_state(bitarray result, tuple __pyx_state): + * result.buf = __pyx_state[0]; result.buf_size = __pyx_state[1]; result.ibuf = __pyx_state[2]; result.size = __pyx_state[3] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[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_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(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_AsWritableUString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_v_result->buf = __pyx_t_2; + __Pyx_DECREF(__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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->buf_size = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); 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_result->ibuf); + __Pyx_DECREF(__pyx_v_result->ibuf); + __pyx_v_result->ibuf = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->size = __pyx_t_3; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_bitarray__set_state(bitarray result, tuple __pyx_state): + * result.buf = __pyx_state[0]; result.buf_size = __pyx_state[1]; result.ibuf = __pyx_state[2]; result.size = __pyx_state[3] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[4]) + */ + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":12 + * result.buf = __pyx_state[0]; result.buf_size = __pyx_state[1]; result.ibuf = __pyx_state[2]; result.size = __pyx_state[3] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[4]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_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, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); 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_bitarray__set_state(bitarray result, tuple __pyx_state): + * result.buf = __pyx_state[0]; result.buf_size = __pyx_state[1]; result.ibuf = __pyx_state[2]; result.size = __pyx_state[3] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[4]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_bitarray__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_bitarray__set_state(bitarray result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.buf = __pyx_state[0]; result.buf_size = __pyx_state[1]; result.ibuf = __pyx_state[2]; result.size = __pyx_state[3] + * if hasattr(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("yt.utilities.lib.bitarray.__pyx_unpickle_bitarray__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * * ndim = PyArray_NDIM(self) @@ -3236,11 +4066,11 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + __PYX_ERR(2, 218, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 @@ -3292,11 +4122,11 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + __PYX_ERR(2, 222, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") @@ -3601,11 +4431,11 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + __PYX_ERR(2, 259, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: @@ -3812,22 +4642,22 @@ * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) + __PYX_ERR(2, 278, __pyx_L1_error) break; } @@ -3894,7 +4724,7 @@ * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 @@ -4053,7 +4883,7 @@ * 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, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4100,7 +4930,7 @@ * 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, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4147,7 +4977,7 @@ * 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, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4194,7 +5024,7 @@ * 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, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4241,7 +5071,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4322,15 +5152,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) + __PYX_ERR(2, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + __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, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -4345,11 +5175,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) + __PYX_ERR(2, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -4370,7 +5200,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __pyx_L1_error) + __PYX_ERR(2, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -4378,15 +5208,15 @@ __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, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -4399,12 +5229,12 @@ * 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, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -4416,11 +5246,11 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) + __PYX_ERR(2, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -4484,11 +5314,11 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __PYX_ERR(2, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -4507,11 +5337,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -4571,7 +5401,7 @@ * 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, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -4593,11 +5423,11 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __PYX_ERR(2, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -4615,11 +5445,11 @@ * 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, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -4633,11 +5463,11 @@ * 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, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -4651,11 +5481,11 @@ * 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, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -4669,11 +5499,11 @@ * 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, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -4687,11 +5517,11 @@ * 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, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -4705,11 +5535,11 @@ * 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, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -4723,11 +5553,11 @@ * 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, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -4741,11 +5571,11 @@ * 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, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -4759,11 +5589,11 @@ * 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, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -4777,11 +5607,11 @@ * 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, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -4795,11 +5625,11 @@ * 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, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -4813,11 +5643,11 @@ * 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, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -4831,11 +5661,11 @@ * 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, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -4849,11 +5679,11 @@ * 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, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -4869,11 +5699,11 @@ * 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, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -4889,11 +5719,11 @@ * 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, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -4909,11 +5739,11 @@ * 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, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -4928,19 +5758,19 @@ * 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, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) + __PYX_ERR(2, 844, __pyx_L1_error) } __pyx_L15:; @@ -4971,7 +5801,7 @@ * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; @@ -5235,7 +6065,7 @@ * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 * # Cython code. @@ -5248,7 +6078,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5262,7 +6092,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -5274,11 +6104,11 @@ * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) + __PYX_ERR(2, 989, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -5296,7 +6126,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -5366,7 +6196,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * @@ -5379,7 +6209,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5393,7 +6223,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -5405,11 +6235,11 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) + __PYX_ERR(2, 995, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -5427,7 +6257,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -5497,7 +6327,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * @@ -5510,7 +6340,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5523,7 +6353,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -5533,11 +6363,11 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) + __PYX_ERR(2, 1001, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -5555,7 +6385,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -5577,7 +6407,110 @@ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/bitarray.pxd":20 + * cimport cython + * + * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, # <<<<<<<<<<<<<< + * np.uint8_t val) nogil: + * if val > 0: val = 1 + */ + +static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_8bitarray_ba_set_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind, __pyx_t_5numpy_uint8_t __pyx_v_val) { + int __pyx_t_1; + __pyx_t_5numpy_uint64_t __pyx_t_2; + + /* "yt/utilities/lib/bitarray.pxd":22 + * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, + * np.uint8_t val) nogil: + * if val > 0: val = 1 # <<<<<<<<<<<<<< + * buf[ind >> 3] |= (val << (ind & 7)) + * + */ + __pyx_t_1 = ((__pyx_v_val > 0) != 0); + if (__pyx_t_1) { + __pyx_v_val = 1; + } + + /* "yt/utilities/lib/bitarray.pxd":23 + * np.uint8_t val) nogil: + * if val > 0: val = 1 + * buf[ind >> 3] |= (val << (ind & 7)) # <<<<<<<<<<<<<< + * + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: + */ + __pyx_t_2 = (__pyx_v_ind >> 3); + (__pyx_v_buf[__pyx_t_2]) = ((__pyx_v_buf[__pyx_t_2]) | (__pyx_v_val << (__pyx_v_ind & 7))); + + /* "yt/utilities/lib/bitarray.pxd":20 + * cimport cython + * + * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind, # <<<<<<<<<<<<<< + * np.uint8_t val) nogil: + * if val > 0: val = 1 + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/bitarray.pxd":25 + * buf[ind >> 3] |= (val << (ind & 7)) + * + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 + */ + +static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_9utilities_3lib_8bitarray_ba_get_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind) { + __pyx_t_5numpy_uint8_t __pyx_v_rv; + __pyx_t_5numpy_uint8_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/bitarray.pxd":26 + * + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) # <<<<<<<<<<<<<< + * if rv == 0: return 0 + * return 1 + */ + __pyx_v_rv = ((__pyx_v_buf[(__pyx_v_ind >> 3)]) & (1 << (__pyx_v_ind & 7))); + + /* "yt/utilities/lib/bitarray.pxd":27 + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 # <<<<<<<<<<<<<< + * return 1 + * + */ + __pyx_t_1 = ((__pyx_v_rv == 0) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "yt/utilities/lib/bitarray.pxd":28 + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 + * return 1 # <<<<<<<<<<<<<< + * + * cdef class bitarray: + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/bitarray.pxd":25 + * buf[ind >> 3] |= (val << (ind & 7)) + * + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 + */ + + /* function exit code */ + __pyx_L0:; return __pyx_r; } static struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray __pyx_vtable_2yt_9utilities_3lib_8bitarray_bitarray; @@ -5600,7 +6533,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_8bitarray_bitarray(PyObject *o) { struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *p = (struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -5645,6 +6578,8 @@ {"as_bool_array", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_8bitarray_8bitarray_5as_bool_array, METH_NOARGS, __pyx_doc_2yt_9utilities_3lib_8bitarray_8bitarray_4as_bool_array}, {"set_value", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_8bitarray_8bitarray_7set_value, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_9utilities_3lib_8bitarray_8bitarray_6set_value}, {"query_value", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_8bitarray_8bitarray_9query_value, METH_O, __pyx_doc_2yt_9utilities_3lib_8bitarray_8bitarray_8query_value}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_8bitarray_8bitarray_11__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_8bitarray_8bitarray_13__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -5737,7 +6672,9 @@ {&__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_0xe5, __pyx_k_Incompatible_checksums_s_vs_0xe5, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xe5), 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_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_kp_u_Query_the_on_off_value_of_a_give, __pyx_k_Query_the_on_off_value_of_a_give, sizeof(__pyx_k_Query_the_on_off_value_of_a_give), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_kp_u_Set_the_on_off_value_of_a_given, __pyx_k_Set_the_on_off_value_of_a_given, sizeof(__pyx_k_Set_the_on_off_value_of_a_given), 0, 1, 0, 0}, @@ -5750,31 +6687,45 @@ {&__pyx_kp_u_bitarray_query_value_line_151, __pyx_k_bitarray_query_value_line_151, sizeof(__pyx_k_bitarray_query_value_line_151), 0, 1, 0, 0}, {&__pyx_kp_u_bitarray_set_value_line_126, __pyx_k_bitarray_set_value_line_126, sizeof(__pyx_k_bitarray_set_value_line_126), 0, 1, 0, 0}, {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 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_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 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_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_bitarray, __pyx_k_pyx_unpickle_bitarray, sizeof(__pyx_k_pyx_unpickle_bitarray), 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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_set_from_array, __pyx_k_set_from_array, sizeof(__pyx_k_set_from_array), 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_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 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_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_yt_utilities_lib_bitarray, __pyx_k_yt_utilities_lib_bitarray, sizeof(__pyx_k_yt_utilities_lib_bitarray), 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_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 54, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 71, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -5802,7 +6753,7 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); @@ -5813,7 +6764,7 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 222, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); @@ -5824,7 +6775,7 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 259, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); @@ -5835,7 +6786,7 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); @@ -5846,7 +6797,7 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); @@ -5857,7 +6808,7 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); @@ -5868,7 +6819,7 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 989, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); @@ -5879,7 +6830,7 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 995, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); @@ -5888,9 +6839,19 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 1001, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); + + /* "(tree fragment)":1 + * def __pyx_unpickle_bitarray(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xe5f0cd6: + * from pickle import PickleError + */ + __pyx_tuple__11 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_bitarray, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -5903,6 +6864,7 @@ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __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_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_241110230 = PyInt_FromLong(241110230L); if (unlikely(!__pyx_int_241110230)) __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:; @@ -5965,6 +6927,7 @@ __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 @@ -6010,6 +6973,7 @@ #endif if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_8bitarray_bitarray.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray) < 0) __PYX_ERR(0, 21, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "bitarray", (PyObject *)&__pyx_type_2yt_9utilities_3lib_8bitarray_bitarray) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_8bitarray_bitarray) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray = &__pyx_type_2yt_9utilities_3lib_8bitarray_bitarray; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -6018,12 +6982,12 @@ #else sizeof(PyHeapTypeObject), #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + 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, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -6043,6 +7007,16 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "(tree fragment)":1 + * def __pyx_unpickle_bitarray(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xe5f0cd6: + * from pickle import PickleError + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_8bitarray_1__pyx_unpickle_bitarray, NULL, __pyx_n_s_yt_utilities_lib_bitarray); 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_bitarray, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "yt/utilities/lib/bitarray.pyx":1 * """ # <<<<<<<<<<<<<< * Bit array functions @@ -6056,12 +7030,12 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/bitarray.pxd":25 + * buf[ind >> 3] |= (val << (ind & 7)) * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil: # <<<<<<<<<<<<<< + * cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7))) + * if rv == 0: return 0 */ /*--- Wrapped vars code ---*/ @@ -6071,7 +7045,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.bitarray", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.bitarray", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -6873,8 +7847,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL @@ -6882,17 +7856,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON @@ -7521,11 +8500,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -7548,7 +8523,7 @@ #endif /* ArgTypeTest */ - static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); @@ -7574,26 +8549,247 @@ return 0; } +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + 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)); +} + +/* 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; + } +} + /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -7617,7 +8813,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -7627,7 +8823,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -7688,7 +8884,7 @@ } /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -7705,82 +8901,107 @@ return -1; } -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; + else if (PyObject_Not(use_cline) != 0) { + c_line = 0; + } + return c_line; +#endif } /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -7860,7 +9081,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -7919,12 +9140,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -7940,29 +9164,39 @@ Py_XDECREF(py_frame); } -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { - if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); - PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); - return -1; -} -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject *obj = view->obj; - if (!obj) return; - if (PyObject_CheckBuffer(obj)) { - PyBuffer_Release(view); - return; +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { + const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(npy_uint64) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_uint64) <= 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_uint64), + little, !is_unsigned); } - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } - Py_DECREF(obj); - view->obj = NULL; } -#endif - - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -7983,25 +9217,46 @@ return (target_type) value;\ } -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { - const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + Py_DECREF(obj); + view->obj = NULL; +} +#endif + + + /* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { - if (sizeof(npy_uint64) < sizeof(long)) { + if (sizeof(npy_uint8) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) { + } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { - if (sizeof(npy_uint64) <= sizeof(long)) { + if (sizeof(npy_uint8) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -8009,30 +9264,30 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(npy_uint64), + return _PyLong_FromByteArray(bytes, sizeof(npy_uint8), little, !is_unsigned); } } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) { - const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; + 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(npy_uint8) < sizeof(long)) { + if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) { + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { - if (sizeof(npy_uint8) <= sizeof(long)) { + if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -8040,13 +9295,13 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(npy_uint8), + return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -8066,7 +9321,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -8201,7 +9456,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -8221,7 +9476,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -8356,7 +9611,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -8387,7 +9642,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -8418,7 +9673,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { + static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -8607,7 +9862,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { + static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -8724,218 +9979,29 @@ break; case -4: if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) - 1 > 4 * PyLong_SHIFT) { - return (npy_uint8) (((npy_uint8)-1)*(((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) - 1 > 4 * PyLong_SHIFT) { - return (npy_uint8) ((((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); - } - } - break; - } -#endif - if (sizeof(npy_uint8) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, 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_uint8 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_uint8) -1; - } - } else { - npy_uint8 val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (npy_uint8) -1; - val = __Pyx_PyInt_As_npy_uint8(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to npy_uint8"); - return (npy_uint8) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to npy_uint8"); - return (npy_uint8) -1; -} - -/* 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]))); + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint8) (((npy_uint8)-1)*(((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); } } break; case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_uint8) > 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]))); + __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) - 1 > 4 * PyLong_SHIFT) { + return (npy_uint8) ((((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]))); } } break; } #endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + if (sizeof(npy_uint8) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, 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)) + } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -8944,7 +10010,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - int val; + npy_uint8 val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -8964,59 +10030,28 @@ return val; } #endif - return (int) -1; + return (npy_uint8) -1; } } else { - int val; + npy_uint8 val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + if (!tmp) return (npy_uint8) -1; + val = __Pyx_PyInt_As_npy_uint8(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; + "value too large to convert to npy_uint8"); + return (npy_uint8) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -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); - } + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -9204,8 +10239,197 @@ 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; +} + /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -9221,7 +10445,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -9239,7 +10463,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -9304,7 +10528,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -9329,6 +10553,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -9337,11 +10563,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/bounding_volume_hierarchy.c yt-3.4.0/yt/utilities/lib/bounding_volume_hierarchy.c --- yt-3.3.3/yt/utilities/lib/bounding_volume_hierarchy.c 2016-12-12 01:41:40.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/bounding_volume_hierarchy.c 2017-08-10 18:20:29.000000000 +0000 @@ -1,18 +1,22 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "yt/utilities/lib/kdtree.h", "yt/utilities/lib/mesh_triangulation.h", "yt/utilities/lib/platform_dep.h" ], "include_dirs": [ + "yt/utilities/lib", "yt/utilities/lib/" ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.bounding_volume_hierarchy", + "sources": [ + "yt/utilities/lib/bounding_volume_hierarchy.pyx" ] }, "module_name": "yt.utilities.lib.bounding_volume_hierarchy" @@ -26,7 +30,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -48,6 +52,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -200,16 +205,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -336,6 +345,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -390,6 +405,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -455,9 +499,7 @@ #include "numpy/ufuncobject.h" #include #include "mesh_triangulation.h" -#include "kdtree.h" #include "platform_dep.h" -#include "limits.h" #include "pythread.h" #include "pystate.h" #ifdef _OPENMP @@ -504,8 +546,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -518,8 +560,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -641,10 +686,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -678,8 +725,8 @@ static const char *__pyx_f[] = { "yt/utilities/lib/bounding_volume_hierarchy.pyx", - "__init__.pxd", "stringsource", + "__init__.pxd", "type.pxd", "yt/utilities/lib/element_mappings.pxd", "yt/utilities/lib/partitioned_grid.pxd", @@ -996,6 +1043,7 @@ /*--- Type declarations ---*/ struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler; +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; @@ -1004,6 +1052,9 @@ struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D; +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D; +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D; +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D; struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid; struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler; struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler; @@ -1053,7 +1104,7 @@ */ typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "yt/utilities/lib/element_mappings.pxd":81 +/* "yt/utilities/lib/element_mappings.pxd":96 * # once it is converged. * # * ctypedef void (*func_type)(double* fx, # <<<<<<<<<<<<<< @@ -1062,7 +1113,7 @@ */ typedef void (*__pyx_t_2yt_9utilities_3lib_16element_mappings_func_type)(double *, double *, double *, double *); -/* "yt/utilities/lib/element_mappings.pxd":101 +/* "yt/utilities/lib/element_mappings.pxd":116 * # tcol - the third column of the jaocobian * # * ctypedef void (*jac_type3D)(double* rcol, # <<<<<<<<<<<<<< @@ -1071,19 +1122,20 @@ */ typedef void (*__pyx_t_2yt_9utilities_3lib_16element_mappings_jac_type3D)(double *, double *, double *, double *, double *, double *); -/* "yt/utilities/lib/element_mappings.pxd":123 - * # The order of this array is [J11, J12, J21, J22] +/* "yt/utilities/lib/element_mappings.pxd":138 + * # scol - the second column of the jacobian * # - * ctypedef void (*jac_type2D)(double* A, # <<<<<<<<<<<<<< + * ctypedef void (*jac_type2D)(double* rcol, # <<<<<<<<<<<<<< + * double* scol, * double* x, - * double* vertices, */ -typedef void (*__pyx_t_2yt_9utilities_3lib_16element_mappings_jac_type2D)(double *, double *, double *, double *); +typedef void (*__pyx_t_2yt_9utilities_3lib_16element_mappings_jac_type2D)(double *, double *, double *, double *, double *); struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray; struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox; struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData; struct __pyx_t_2yt_9utilities_3lib_10primitives_Triangle; struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch; +struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch; /* "yt/utilities/lib/primitives.pxd":7 * from vec3_ops cimport dot, subtract, cross @@ -1154,6 +1206,18 @@ __pyx_t_5numpy_float64_t v[8][3]; __pyx_t_5numpy_int64_t elem_id; }; + +/* "yt/utilities/lib/primitives.pxd":82 + * BBox* bbox) nogil + * + * cdef struct TetPatch: # <<<<<<<<<<<<<< + * np.float64_t[6][3] v # 6 vertices per patch + * np.int64_t elem_id + */ +struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch { + __pyx_t_5numpy_float64_t v[6][3]; + __pyx_t_5numpy_int64_t elem_id; +}; struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer; /* "volume_container.pxd":19 @@ -1173,53 +1237,28 @@ __pyx_t_5numpy_float64_t idds[3]; int dims[3]; }; -struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer; - -/* "lenses.pxd":32 - * cdef int SHRT_MAX - * - * cdef struct ImageContainer: # <<<<<<<<<<<<<< - * np.float64_t[:,:,:] vp_pos - * np.float64_t[:,:,:] vp_dir - */ -struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer { - __Pyx_memviewslice vp_pos; - __Pyx_memviewslice vp_dir; - __pyx_t_5numpy_float64_t *center; - __Pyx_memviewslice image; - __Pyx_memviewslice zbuffer; - __Pyx_memviewslice image_used; - __Pyx_memviewslice mesh_lines; - __pyx_t_5numpy_float64_t pdx; - __pyx_t_5numpy_float64_t pdy; - __pyx_t_5numpy_float64_t bounds[4]; - __Pyx_memviewslice camera_data; - int nv[2]; - __pyx_t_5numpy_float64_t *x_vec; - __pyx_t_5numpy_float64_t *y_vec; -}; +struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator; -/* "lenses.pxd":48 - * +/* "image_samplers.pxd":30 + * cdef struct VolumeRenderAccumulator * - * ctypedef int calculate_extent_function(ImageContainer *image, # <<<<<<<<<<<<<< + * ctypedef int calculate_extent_function(ImageSampler image, # <<<<<<<<<<<<<< * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 * */ -typedef int __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *); +typedef int __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *); -/* "lenses.pxd":51 +/* "image_samplers.pxd":33 * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 * - * ctypedef void generate_vector_info_function(ImageContainer *im, # <<<<<<<<<<<<<< + * ctypedef void generate_vector_info_function(ImageSampler im, # <<<<<<<<<<<<<< * np.int64_t vi, np.int64_t vj, * np.float64_t width[2], */ -typedef void __pyx_t_2yt_9utilities_3lib_6lenses_generate_vector_info_function(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); -struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator; +typedef void __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); -/* "image_samplers.pxd":35 - * cdef struct VolumeRenderAccumulator +/* "image_samplers.pxd":38 + * np.float64_t v_dir[3], np.float64_t v_pos[3]) nogil * * cdef struct ImageAccumulator: # <<<<<<<<<<<<<< * np.float64_t rgba[Nch] @@ -1229,32 +1268,9 @@ __pyx_t_5numpy_float64_t rgba[4]; void *supp_data; }; -struct __pyx_opt_args_2yt_9utilities_3lib_14grid_traversal_walk_volume; - -/* "grid_traversal.pxd":23 - * from .volume_container cimport VolumeContainer, vc_index, vc_pos_index - * - * ctypedef void sampler_function( # <<<<<<<<<<<<<< - * VolumeContainer *vc, - * np.float64_t v_pos[3], - */ -typedef void __pyx_t_2yt_9utilities_3lib_14grid_traversal_sampler_function(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int *, void *); - -/* "grid_traversal.pxd":32 - * void *data) nogil - * - * cdef int walk_volume(VolumeContainer *vc, # <<<<<<<<<<<<<< - * np.float64_t v_pos[3], - * np.float64_t v_dir[3], - */ -struct __pyx_opt_args_2yt_9utilities_3lib_14grid_traversal_walk_volume { - int __pyx_n; - __pyx_t_5numpy_float64_t *return_t; - __pyx_t_5numpy_float64_t max_t; -}; struct __pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHNode; -/* "yt/utilities/lib/bounding_volume_hierarchy.pxd":23 +/* "yt/utilities/lib/bounding_volume_hierarchy.pxd":24 * * # node for the bounding volume hierarchy * cdef struct BVHNode: # <<<<<<<<<<<<<< @@ -1269,7 +1285,7 @@ struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox bbox; }; -/* "yt/utilities/lib/bounding_volume_hierarchy.pxd":31 +/* "yt/utilities/lib/bounding_volume_hierarchy.pxd":32 * * # pointer to function that computes primitive intersection * ctypedef np.int64_t (*intersect_func_type)(const void* primitives, # <<<<<<<<<<<<<< @@ -1278,7 +1294,7 @@ */ typedef __pyx_t_5numpy_int64_t (*__pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_intersect_func_type)(void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *); -/* "yt/utilities/lib/bounding_volume_hierarchy.pxd":36 +/* "yt/utilities/lib/bounding_volume_hierarchy.pxd":37 * * # pointer to function that computes primitive centroids * ctypedef void (*centroid_func_type)(const void *primitives, # <<<<<<<<<<<<<< @@ -1287,7 +1303,7 @@ */ typedef void (*__pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_centroid_func_type)(void const *, __pyx_t_5numpy_int64_t const , __pyx_t_5numpy_float64_t *); -/* "yt/utilities/lib/bounding_volume_hierarchy.pxd":41 +/* "yt/utilities/lib/bounding_volume_hierarchy.pxd":42 * * # pointer to function that computes primitive bounding boxes * ctypedef void (*bbox_func_type)(const void *primitives, # <<<<<<<<<<<<<< @@ -1314,6 +1330,18 @@ /* "yt/utilities/lib/element_mappings.pxd":36 * * + * cdef class P1Sampler1D(ElementSampler): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler __pyx_base; +}; + + +/* "yt/utilities/lib/element_mappings.pxd":51 + * + * * cdef class P1Sampler2D(ElementSampler): # <<<<<<<<<<<<<< * * cdef void map_real_to_unit(self, @@ -1323,7 +1351,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":51 +/* "yt/utilities/lib/element_mappings.pxd":66 * * * cdef class P1Sampler3D(ElementSampler): # <<<<<<<<<<<<<< @@ -1335,7 +1363,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":129 +/* "yt/utilities/lib/element_mappings.pxd":145 * * * cdef class NonlinearSolveSampler3D(ElementSampler): # <<<<<<<<<<<<<< @@ -1352,7 +1380,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":143 +/* "yt/utilities/lib/element_mappings.pxd":159 * * * cdef class Q1Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1364,7 +1392,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":160 +/* "yt/utilities/lib/element_mappings.pxd":176 * * * cdef class W1Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1376,7 +1404,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":178 +/* "yt/utilities/lib/element_mappings.pxd":194 * * * cdef class S2Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1388,7 +1416,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":196 +/* "yt/utilities/lib/element_mappings.pxd":212 * * * cdef class NonlinearSolveSampler2D(ElementSampler): # <<<<<<<<<<<<<< @@ -1405,7 +1433,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":210 +/* "yt/utilities/lib/element_mappings.pxd":226 * * * cdef class Q1Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< @@ -1417,6 +1445,42 @@ }; +/* "yt/utilities/lib/element_mappings.pxd":241 + * + * + * cdef class Q2Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_base; +}; + + +/* "yt/utilities/lib/element_mappings.pxd":256 + * + * + * cdef class T2Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_base; +}; + + +/* "yt/utilities/lib/element_mappings.pxd":270 + * cdef int check_inside(self, double* mapped_coord) nogil + * + * cdef class Tet2Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D __pyx_base; +}; + + /* "partitioned_grid.pxd":22 * from .volume_container cimport VolumeContainer * @@ -1439,17 +1503,30 @@ }; -/* "image_samplers.pxd":39 +/* "image_samplers.pxd":42 * void *supp_data * * cdef class ImageSampler: # <<<<<<<<<<<<<< - * cdef ImageContainer *image - * cdef public object acenter, aimage, ax_vec, ay_vec + * cdef np.float64_t[:,:,:] vp_pos + * cdef np.float64_t[:,:,:] vp_dir */ struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler { PyObject_HEAD struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtab; - struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *image; + __Pyx_memviewslice vp_pos; + __Pyx_memviewslice vp_dir; + __pyx_t_5numpy_float64_t *center; + __Pyx_memviewslice image; + __Pyx_memviewslice zbuffer; + __Pyx_memviewslice image_used; + __Pyx_memviewslice mesh_lines; + __pyx_t_5numpy_float64_t pdx; + __pyx_t_5numpy_float64_t pdy; + __pyx_t_5numpy_float64_t bounds[4]; + __Pyx_memviewslice camera_data; + int nv[2]; + __pyx_t_5numpy_float64_t *x_vec; + __pyx_t_5numpy_float64_t *y_vec; PyObject *acenter; PyObject *aimage; PyObject *ax_vec; @@ -1460,12 +1537,12 @@ void *supp_data; __pyx_t_5numpy_float64_t width[3]; PyObject *lens_type; - __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function *extent_function; - __pyx_t_2yt_9utilities_3lib_6lenses_generate_vector_info_function *vector_function; + __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function *extent_function; + __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function *vector_function; }; -/* "image_samplers.pxd":60 +/* "image_samplers.pxd":75 * void *data) nogil * * cdef class ProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1477,7 +1554,7 @@ }; -/* "image_samplers.pxd":63 +/* "image_samplers.pxd":78 * pass * * cdef class InterpolatedProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1492,7 +1569,7 @@ }; -/* "image_samplers.pxd":68 +/* "image_samplers.pxd":83 * cdef public object my_field_tables * * cdef class VolumeRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1504,12 +1581,11 @@ struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *vra; PyObject *tf_obj; PyObject *my_field_tables; - struct kdtree **trees; PyObject *tree_containers; }; -/* "image_samplers.pxd":75 +/* "image_samplers.pxd":89 * cdef object tree_containers * * cdef class LightSourceRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1524,7 +1600,7 @@ }; -/* "yt/utilities/lib/bounding_volume_hierarchy.pxd":46 +/* "yt/utilities/lib/bounding_volume_hierarchy.pxd":47 * * * cdef class BVH: # <<<<<<<<<<<<<< @@ -1554,7 +1630,7 @@ }; -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":391 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":436 * cast_rays(&image[0], &origins[0, 0], &direction[0], N, bvh) * * cdef class BVHMeshSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1665,6 +1741,20 @@ /* "yt/utilities/lib/element_mappings.pxd":36 * * + * cdef class P1Sampler1D(ElementSampler): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler1D { + struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler1D; + + +/* "yt/utilities/lib/element_mappings.pxd":51 + * + * * cdef class P1Sampler2D(ElementSampler): # <<<<<<<<<<<<<< * * cdef void map_real_to_unit(self, @@ -1676,7 +1766,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D; -/* "yt/utilities/lib/element_mappings.pxd":51 +/* "yt/utilities/lib/element_mappings.pxd":66 * * * cdef class P1Sampler3D(ElementSampler): # <<<<<<<<<<<<<< @@ -1690,7 +1780,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D; -/* "yt/utilities/lib/element_mappings.pxd":129 +/* "yt/utilities/lib/element_mappings.pxd":145 * * * cdef class NonlinearSolveSampler3D(ElementSampler): # <<<<<<<<<<<<<< @@ -1704,7 +1794,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; -/* "yt/utilities/lib/element_mappings.pxd":143 +/* "yt/utilities/lib/element_mappings.pxd":159 * * * cdef class Q1Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1718,7 +1808,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D; -/* "yt/utilities/lib/element_mappings.pxd":160 +/* "yt/utilities/lib/element_mappings.pxd":176 * * * cdef class W1Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1732,7 +1822,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D; -/* "yt/utilities/lib/element_mappings.pxd":178 +/* "yt/utilities/lib/element_mappings.pxd":194 * * * cdef class S2Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1746,7 +1836,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D; -/* "yt/utilities/lib/element_mappings.pxd":196 +/* "yt/utilities/lib/element_mappings.pxd":212 * * * cdef class NonlinearSolveSampler2D(ElementSampler): # <<<<<<<<<<<<<< @@ -1760,7 +1850,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; -/* "yt/utilities/lib/element_mappings.pxd":210 +/* "yt/utilities/lib/element_mappings.pxd":226 * * * cdef class Q1Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< @@ -1774,6 +1864,48 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D; +/* "yt/utilities/lib/element_mappings.pxd":241 + * + * + * cdef class Q2Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D { + struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D; + + +/* "yt/utilities/lib/element_mappings.pxd":256 + * + * + * cdef class T2Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_T2Sampler2D { + struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_T2Sampler2D; + + +/* "yt/utilities/lib/element_mappings.pxd":270 + * cdef int check_inside(self, double* mapped_coord) nogil + * + * cdef class Tet2Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D { + struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D; + + /* "partitioned_grid.pxd":22 * from .volume_container cimport VolumeContainer * @@ -1788,12 +1920,12 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid; -/* "image_samplers.pxd":39 +/* "image_samplers.pxd":42 * void *supp_data * * cdef class ImageSampler: # <<<<<<<<<<<<<< - * cdef ImageContainer *image - * cdef public object acenter, aimage, ax_vec, ay_vec + * cdef np.float64_t[:,:,:] vp_pos + * cdef np.float64_t[:,:,:] vp_dir */ struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler { @@ -1803,7 +1935,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler; -/* "image_samplers.pxd":60 +/* "image_samplers.pxd":75 * void *data) nogil * * cdef class ProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1817,7 +1949,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler; -/* "image_samplers.pxd":63 +/* "image_samplers.pxd":78 * pass * * cdef class InterpolatedProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1831,7 +1963,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler; -/* "image_samplers.pxd":68 +/* "image_samplers.pxd":83 * cdef public object my_field_tables * * cdef class VolumeRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1845,7 +1977,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler; -/* "image_samplers.pxd":75 +/* "image_samplers.pxd":89 * cdef object tree_containers * * cdef class LightSourceRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1859,7 +1991,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler; -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":44 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":52 * * * cdef class BVH: # <<<<<<<<<<<<<< @@ -1871,6 +2003,7 @@ __pyx_t_5numpy_int64_t (*_partition)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t); void (*_set_up_triangles)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, __Pyx_memviewslice, __Pyx_memviewslice); void (*_set_up_patches)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, __Pyx_memviewslice, __Pyx_memviewslice); + void (*_set_up_tet_patches)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, __Pyx_memviewslice, __Pyx_memviewslice); void (*intersect)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *); void (*_get_node_bbox)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, struct __pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHNode *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); void (*_recursive_intersect)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *, struct __pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHNode *); @@ -1880,7 +2013,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_vtabptr_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH; -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":391 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":436 * cast_rays(&image[0], &origins[0, 0], &direction[0], N, bvh) * * cdef class BVHMeshSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -2080,7 +2213,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* MemviewSliceInit.proto */ #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d @@ -2113,6 +2246,13 @@ int lineno, const char *filename, int full_traceback, int nogil); +/* 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() + /* ArgTypeTest.proto */ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); @@ -2209,12 +2349,32 @@ /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); +/* 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 *); + +/* GetModuleGlobalName.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) @@ -2336,6 +2496,12 @@ /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* CallNextTpDealloc.proto */ static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); @@ -2348,11 +2514,14 @@ /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); -/* GetModuleGlobalName.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); /* CodeObjectCache.proto */ typedef struct { @@ -2552,15 +2721,15 @@ /* CIntFromPy.proto */ static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(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 *); -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); @@ -2586,6 +2755,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static void __pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__set_up_patches(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_self, __Pyx_memviewslice __pyx_v_vertices, __Pyx_memviewslice __pyx_v_indices); /* proto*/ +static void __pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__set_up_tet_patches(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_self, __Pyx_memviewslice __pyx_v_vertices, __Pyx_memviewslice __pyx_v_indices); /* proto*/ static void __pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__set_up_triangles(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_self, __Pyx_memviewslice __pyx_v_vertices, __Pyx_memviewslice __pyx_v_indices); /* proto*/ static void __pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__recursive_free(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_self, struct __pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHNode *__pyx_v_node); /* proto*/ static __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__partition(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_begin, __pyx_t_5numpy_int64_t __pyx_v_end, __pyx_t_5numpy_int64_t __pyx_v_ax, __pyx_t_5numpy_float64_t __pyx_v_split); /* proto*/ @@ -2641,6 +2811,7 @@ /* Module declarations from 'yt.utilities.lib.element_mappings' */ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = 0; @@ -2649,6 +2820,9 @@ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D = 0; /* Module declarations from 'yt.utilities.lib.vec3_ops' */ @@ -2660,23 +2834,12 @@ static __pyx_t_5numpy_int64_t (*__pyx_f_2yt_9utilities_3lib_10primitives_ray_patch_intersect)(void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *); /*proto*/ static void (*__pyx_f_2yt_9utilities_3lib_10primitives_patch_centroid)(void const *, __pyx_t_5numpy_int64_t const , __pyx_t_5numpy_float64_t *); /*proto*/ static void (*__pyx_f_2yt_9utilities_3lib_10primitives_patch_bbox)(void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox *); /*proto*/ - -/* Module declarations from 'yt.utilities.lib.kdtree_utils' */ +static __pyx_t_5numpy_int64_t (*__pyx_f_2yt_9utilities_3lib_10primitives_ray_tet_patch_intersect)(void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_10primitives_tet_patch_centroid)(void const *, __pyx_t_5numpy_int64_t const , __pyx_t_5numpy_float64_t *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_10primitives_tet_patch_bbox)(void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox *); /*proto*/ /* Module declarations from 'yt.utilities.lib.volume_container' */ static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, int, int, int); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *); /*proto*/ - -/* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int, int); /*proto*/ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ - -/* Module declarations from 'yt.utilities.lib.lenses' */ /* Module declarations from 'yt.utilities.lib.partitioned_grid' */ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = 0; @@ -2688,8 +2851,6 @@ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = 0; -/* Module declarations from 'yt.utilities.lib.grid_traversal' */ - /* Module declarations from 'yt.utilities.lib.bounding_volume_hierarchy' */ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler = 0; @@ -2701,6 +2862,7 @@ static struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_P1Sampler = 0; static struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_W1Sampler = 0; static struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_S2Sampler = 0; +static struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_Tet2Sampler = 0; static __pyx_t_5numpy_float64_t __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_INF; static __pyx_t_5numpy_int64_t __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_LEAF_SIZE; static PyObject *generic = 0; @@ -2743,6 +2905,7 @@ 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_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 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 "yt.utilities.lib.bounding_volume_hierarchy" @@ -2751,13 +2914,13 @@ /* Implementation of 'yt.utilities.lib.bounding_volume_hierarchy' */ static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_Ellipsis; -static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_N[] = "N"; @@ -2767,8 +2930,10 @@ static const char __pyx_k_np[] = "np"; static const char __pyx_k_bvh[] = "bvh"; static const char __pyx_k_inf[] = "inf"; +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_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_name[] = "name"; @@ -2791,30 +2956,43 @@ 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_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_fortran[] = "fortran"; static const char __pyx_k_indices[] = "indices"; static const char __pyx_k_memview[] = "memview"; static const char __pyx_k_origins[] = "origins"; static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_vertices[] = "vertices"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_direction[] = "direction"; static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_field_data[] = "field_data"; 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_num_threads[] = "num_threads"; 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_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_test_ray_trace[] = "test_ray_trace"; +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_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_strided_and_indirect[] = ""; @@ -2827,7 +3005,6 @@ 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_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/bounding_volume_hierarchy.pyx"; 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)"; @@ -2836,6 +3013,7 @@ static const char __pyx_k_Could_not_determine_element_type[] = "Could not determine element type for nverts = %d. "; 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"; @@ -2843,10 +3021,13 @@ 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_center_self_extent_function[] = "self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec 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_yt_utilities_lib_bounding_volume[] = "yt.utilities.lib.bounding_volume_hierarchy"; +static const char __pyx_k_yt_utilities_lib_bounding_volume[] = "yt/utilities/lib/bounding_volume_hierarchy.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_utilities_lib_bounding_volume_2[] = "yt.utilities.lib.bounding_volume_hierarchy"; 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; @@ -2857,6 +3038,7 @@ 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; @@ -2869,19 +3051,22 @@ static PyObject *__pyx_n_s_NotImplementedError; 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_n_s_RuntimeError; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_base; static PyObject *__pyx_n_s_bvh; 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_direction; static PyObject *__pyx_n_s_dtype_is_object; static PyObject *__pyx_n_s_encode; @@ -2908,6 +3093,8 @@ 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_num_threads; static PyObject *__pyx_n_s_numpy; @@ -2916,9 +3103,18 @@ static PyObject *__pyx_n_s_obj; static PyObject *__pyx_n_s_origins; static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_cython; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_kp_s_self_center_self_extent_function; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_start; @@ -2927,6 +3123,7 @@ 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_test_ray_trace; @@ -2934,12 +3131,18 @@ 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 PyObject *__pyx_n_s_vertices; -static PyObject *__pyx_n_s_yt_utilities_lib_bounding_volume; +static PyObject *__pyx_kp_s_yt_utilities_lib_bounding_volume; +static PyObject *__pyx_n_s_yt_utilities_lib_bounding_volume_2; static int __pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH___cinit__(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_self, __Pyx_memviewslice __pyx_v_vertices, __Pyx_memviewslice __pyx_v_indices, __Pyx_memviewslice __pyx_v_field_data); /* proto */ static void __pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_2__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_test_ray_trace(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_origins, PyArrayObject *__pyx_v_direction, struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_bvh); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler___call__(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler *__pyx_v_self, struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_bvh, CYTHON_UNUSED int __pyx_v_num_threads); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler *__pyx_v_self, CYTHON_UNUSED 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 */ @@ -2949,8 +3152,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -2972,8 +3179,13 @@ 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_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -2982,6 +3194,7 @@ 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_184977713; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; @@ -2992,9 +3205,9 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__19; -static PyObject *__pyx_slice__20; -static PyObject *__pyx_slice__21; +static PyObject *__pyx_slice__27; +static PyObject *__pyx_slice__28; +static PyObject *__pyx_slice__29; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -3004,16 +3217,28 @@ 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_codeobj__24; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +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__34; +static PyObject *__pyx_codeobj__41; -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":74 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":82 * @cython.wraparound(False) * @cython.cdivision(True) * def __cinit__(self, # <<<<<<<<<<<<<< @@ -3038,8 +3263,11 @@ 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; } @@ -3048,19 +3276,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 74, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 82, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 74, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 82, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 74, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 82, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -3069,13 +3299,13 @@ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_vertices = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_vertices.memview)) __PYX_ERR(0, 75, __pyx_L3_error) - __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 76, __pyx_L3_error) - __pyx_v_field_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_field_data.memview)) __PYX_ERR(0, 77, __pyx_L3_error) + __pyx_v_vertices = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_vertices.memview)) __PYX_ERR(0, 83, __pyx_L3_error) + __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 84, __pyx_L3_error) + __pyx_v_field_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_field_data.memview)) __PYX_ERR(0, 85, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 74, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 82, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.bounding_volume_hierarchy.BVH.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3109,10 +3339,9 @@ __pyx_t_5numpy_int64_t __pyx_t_9; __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } }; __pyx_t_5numpy_int64_t __pyx_t_11; - int __pyx_t_12; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":79 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":87 * np.float64_t[:, :] field_data): * * self.num_elem = indices.shape[0] # <<<<<<<<<<<<<< @@ -3121,7 +3350,7 @@ */ __pyx_v_self->num_elem = (__pyx_v_indices.shape[0]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":80 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":88 * * self.num_elem = indices.shape[0] * self.num_verts_per_elem = indices.shape[1] # <<<<<<<<<<<<<< @@ -3130,7 +3359,7 @@ */ __pyx_v_self->num_verts_per_elem = (__pyx_v_indices.shape[1]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":81 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":89 * self.num_elem = indices.shape[0] * self.num_verts_per_elem = indices.shape[1] * self.num_field_per_elem = field_data.shape[1] # <<<<<<<<<<<<<< @@ -3139,7 +3368,7 @@ */ __pyx_v_self->num_field_per_elem = (__pyx_v_field_data.shape[1]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":84 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":92 * * # We need to figure out what kind of elements we've been handed. * if self.num_verts_per_elem == 8: # <<<<<<<<<<<<<< @@ -3149,7 +3378,7 @@ switch (__pyx_v_self->num_verts_per_elem) { case 8: - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":85 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":93 * # We need to figure out what kind of elements we've been handed. * if self.num_verts_per_elem == 8: * self.num_prim_per_elem = HEX_NT # <<<<<<<<<<<<<< @@ -3158,7 +3387,7 @@ */ __pyx_v_self->num_prim_per_elem = HEX_NT; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":86 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":94 * if self.num_verts_per_elem == 8: * self.num_prim_per_elem = HEX_NT * self.tri_array = triangulate_hex # <<<<<<<<<<<<<< @@ -3167,11 +3396,11 @@ */ if (unlikely((MAX_NUM_TRI) != (MAX_NUM_TRI))) { PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(MAX_NUM_TRI), (Py_ssize_t)(MAX_NUM_TRI)); - __PYX_ERR(0, 86, __pyx_L1_error) + __PYX_ERR(0, 94, __pyx_L1_error) } memcpy(&(__pyx_v_self->tri_array[0]), triangulate_hex, sizeof(__pyx_v_self->tri_array[0]) * (MAX_NUM_TRI)); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":87 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":95 * self.num_prim_per_elem = HEX_NT * self.tri_array = triangulate_hex * self.sampler = Q1Sampler # <<<<<<<<<<<<<< @@ -3184,7 +3413,7 @@ __Pyx_DECREF(((PyObject *)__pyx_v_self->sampler)); __pyx_v_self->sampler = __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_Q1Sampler; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":84 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":92 * * # We need to figure out what kind of elements we've been handed. * if self.num_verts_per_elem == 8: # <<<<<<<<<<<<<< @@ -3193,7 +3422,7 @@ */ break; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":88 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":96 * self.tri_array = triangulate_hex * self.sampler = Q1Sampler * elif self.num_verts_per_elem == 6: # <<<<<<<<<<<<<< @@ -3202,7 +3431,7 @@ */ case 6: - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":89 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":97 * self.sampler = Q1Sampler * elif self.num_verts_per_elem == 6: * self.num_prim_per_elem = WEDGE_NT # <<<<<<<<<<<<<< @@ -3211,7 +3440,7 @@ */ __pyx_v_self->num_prim_per_elem = WEDGE_NT; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":90 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":98 * elif self.num_verts_per_elem == 6: * self.num_prim_per_elem = WEDGE_NT * self.tri_array = triangulate_wedge # <<<<<<<<<<<<<< @@ -3220,11 +3449,11 @@ */ if (unlikely((MAX_NUM_TRI) != (MAX_NUM_TRI))) { PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(MAX_NUM_TRI), (Py_ssize_t)(MAX_NUM_TRI)); - __PYX_ERR(0, 90, __pyx_L1_error) + __PYX_ERR(0, 98, __pyx_L1_error) } memcpy(&(__pyx_v_self->tri_array[0]), triangulate_wedge, sizeof(__pyx_v_self->tri_array[0]) * (MAX_NUM_TRI)); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":91 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":99 * self.num_prim_per_elem = WEDGE_NT * self.tri_array = triangulate_wedge * self.sampler = W1Sampler # <<<<<<<<<<<<<< @@ -3237,7 +3466,7 @@ __Pyx_DECREF(((PyObject *)__pyx_v_self->sampler)); __pyx_v_self->sampler = __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_W1Sampler; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":88 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":96 * self.tri_array = triangulate_hex * self.sampler = Q1Sampler * elif self.num_verts_per_elem == 6: # <<<<<<<<<<<<<< @@ -3246,7 +3475,7 @@ */ break; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":92 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":100 * self.tri_array = triangulate_wedge * self.sampler = W1Sampler * elif self.num_verts_per_elem == 4: # <<<<<<<<<<<<<< @@ -3255,7 +3484,7 @@ */ case 4: - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":93 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":101 * self.sampler = W1Sampler * elif self.num_verts_per_elem == 4: * self.num_prim_per_elem = TETRA_NT # <<<<<<<<<<<<<< @@ -3264,7 +3493,7 @@ */ __pyx_v_self->num_prim_per_elem = TETRA_NT; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":94 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":102 * elif self.num_verts_per_elem == 4: * self.num_prim_per_elem = TETRA_NT * self.tri_array = triangulate_tetra # <<<<<<<<<<<<<< @@ -3273,11 +3502,11 @@ */ if (unlikely((MAX_NUM_TRI) != (MAX_NUM_TRI))) { PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(MAX_NUM_TRI), (Py_ssize_t)(MAX_NUM_TRI)); - __PYX_ERR(0, 94, __pyx_L1_error) + __PYX_ERR(0, 102, __pyx_L1_error) } memcpy(&(__pyx_v_self->tri_array[0]), triangulate_tetra, sizeof(__pyx_v_self->tri_array[0]) * (MAX_NUM_TRI)); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":95 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":103 * self.num_prim_per_elem = TETRA_NT * self.tri_array = triangulate_tetra * self.sampler = P1Sampler # <<<<<<<<<<<<<< @@ -3290,7 +3519,7 @@ __Pyx_DECREF(((PyObject *)__pyx_v_self->sampler)); __pyx_v_self->sampler = __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_P1Sampler; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":92 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":100 * self.tri_array = triangulate_wedge * self.sampler = W1Sampler * elif self.num_verts_per_elem == 4: # <<<<<<<<<<<<<< @@ -3299,7 +3528,7 @@ */ break; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":96 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":104 * self.tri_array = triangulate_tetra * self.sampler = P1Sampler * elif self.num_verts_per_elem == 20: # <<<<<<<<<<<<<< @@ -3308,21 +3537,21 @@ */ case 20: - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":97 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":105 * self.sampler = P1Sampler * elif self.num_verts_per_elem == 20: * self.num_prim_per_elem = 6 # <<<<<<<<<<<<<< * self.sampler = S2Sampler - * else: + * elif self.num_verts_per_elem == 10: */ __pyx_v_self->num_prim_per_elem = 6; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":98 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":106 * elif self.num_verts_per_elem == 20: * self.num_prim_per_elem = 6 * self.sampler = S2Sampler # <<<<<<<<<<<<<< - * else: - * raise NotImplementedError("Could not determine element type for " + * elif self.num_verts_per_elem == 10: + * self.num_prim_per_elem = 4 */ __Pyx_INCREF(((PyObject *)__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_S2Sampler)); __Pyx_GIVEREF(((PyObject *)__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_S2Sampler)); @@ -3330,7 +3559,7 @@ __Pyx_DECREF(((PyObject *)__pyx_v_self->sampler)); __pyx_v_self->sampler = __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_S2Sampler; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":96 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":104 * self.tri_array = triangulate_tetra * self.sampler = P1Sampler * elif self.num_verts_per_elem == 20: # <<<<<<<<<<<<<< @@ -3338,43 +3567,83 @@ * self.sampler = S2Sampler */ break; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":107 + * self.num_prim_per_elem = 6 + * self.sampler = S2Sampler + * elif self.num_verts_per_elem == 10: # <<<<<<<<<<<<<< + * self.num_prim_per_elem = 4 + * self.sampler = Tet2Sampler + */ + case 10: + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":108 + * self.sampler = S2Sampler + * elif self.num_verts_per_elem == 10: + * self.num_prim_per_elem = 4 # <<<<<<<<<<<<<< + * self.sampler = Tet2Sampler + * else: + */ + __pyx_v_self->num_prim_per_elem = 4; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":109 + * elif self.num_verts_per_elem == 10: + * self.num_prim_per_elem = 4 + * self.sampler = Tet2Sampler # <<<<<<<<<<<<<< + * else: + * raise NotImplementedError("Could not determine element type for " + */ + __Pyx_INCREF(((PyObject *)__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_Tet2Sampler)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_Tet2Sampler)); + __Pyx_GOTREF(__pyx_v_self->sampler); + __Pyx_DECREF(((PyObject *)__pyx_v_self->sampler)); + __pyx_v_self->sampler = __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_Tet2Sampler; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":107 + * self.num_prim_per_elem = 6 + * self.sampler = S2Sampler + * elif self.num_verts_per_elem == 10: # <<<<<<<<<<<<<< + * self.num_prim_per_elem = 4 + * self.sampler = Tet2Sampler + */ + break; default: - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":101 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":112 * else: * raise NotImplementedError("Could not determine element type for " * "nverts = %d. " % self.num_verts_per_elem) # <<<<<<<<<<<<<< * self.num_prim = self.num_prim_per_elem*self.num_elem * */ - __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->num_verts_per_elem); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->num_verts_per_elem); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Could_not_determine_element_type, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Could_not_determine_element_type, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":100 - * self.sampler = S2Sampler + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":111 + * self.sampler = Tet2Sampler * else: * raise NotImplementedError("Could not determine element type for " # <<<<<<<<<<<<<< * "nverts = %d. " % self.num_verts_per_elem) * self.num_prim = self.num_prim_per_elem*self.num_elem */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __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, 100, __pyx_L1_error) + __PYX_ERR(0, 111, __pyx_L1_error) break; } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":102 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":113 * raise NotImplementedError("Could not determine element type for " * "nverts = %d. " % self.num_verts_per_elem) * self.num_prim = self.num_prim_per_elem*self.num_elem # <<<<<<<<<<<<<< @@ -3383,7 +3652,7 @@ */ __pyx_v_self->num_prim = (__pyx_v_self->num_prim_per_elem * __pyx_v_self->num_elem); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":105 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":116 * * # allocate storage * cdef np.int64_t v_size = self.num_verts_per_elem * self.num_elem * 3 # <<<<<<<<<<<<<< @@ -3392,7 +3661,7 @@ */ __pyx_v_v_size = ((__pyx_v_self->num_verts_per_elem * __pyx_v_self->num_elem) * 3); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":106 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":117 * # allocate storage * cdef np.int64_t v_size = self.num_verts_per_elem * self.num_elem * 3 * self.vertices = malloc(v_size * sizeof(np.float64_t)) # <<<<<<<<<<<<<< @@ -3401,7 +3670,7 @@ */ __pyx_v_self->vertices = ((__pyx_t_5numpy_float64_t *)malloc((__pyx_v_v_size * (sizeof(__pyx_t_5numpy_float64_t))))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":107 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":118 * cdef np.int64_t v_size = self.num_verts_per_elem * self.num_elem * 3 * self.vertices = malloc(v_size * sizeof(np.float64_t)) * cdef np.int64_t f_size = self.num_field_per_elem * self.num_elem # <<<<<<<<<<<<<< @@ -3410,7 +3679,7 @@ */ __pyx_v_f_size = (__pyx_v_self->num_field_per_elem * __pyx_v_self->num_elem); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":108 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":119 * self.vertices = malloc(v_size * sizeof(np.float64_t)) * cdef np.int64_t f_size = self.num_field_per_elem * self.num_elem * self.field_data = malloc(f_size * sizeof(np.float64_t)) # <<<<<<<<<<<<<< @@ -3419,7 +3688,7 @@ */ __pyx_v_self->field_data = ((__pyx_t_5numpy_float64_t *)malloc((__pyx_v_f_size * (sizeof(__pyx_t_5numpy_float64_t))))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":109 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":120 * cdef np.int64_t f_size = self.num_field_per_elem * self.num_elem * self.field_data = malloc(f_size * sizeof(np.float64_t)) * self.prim_ids = malloc(self.num_prim * sizeof(np.int64_t)) # <<<<<<<<<<<<<< @@ -3428,7 +3697,7 @@ */ __pyx_v_self->prim_ids = ((__pyx_t_5numpy_int64_t *)malloc((__pyx_v_self->num_prim * (sizeof(__pyx_t_5numpy_int64_t))))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":110 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":121 * self.field_data = malloc(f_size * sizeof(np.float64_t)) * self.prim_ids = malloc(self.num_prim * sizeof(np.int64_t)) * self.centroids = malloc(self.num_prim * sizeof(np.float64_t*)) # <<<<<<<<<<<<<< @@ -3437,7 +3706,7 @@ */ __pyx_v_self->centroids = ((__pyx_t_5numpy_float64_t **)malloc((__pyx_v_self->num_prim * (sizeof(__pyx_t_5numpy_float64_t *))))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":112 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":123 * self.centroids = malloc(self.num_prim * sizeof(np.float64_t*)) * cdef np.int64_t i * for i in range(self.num_prim): # <<<<<<<<<<<<<< @@ -3448,7 +3717,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":113 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":124 * cdef np.int64_t i * for i in range(self.num_prim): * self.centroids[i] = malloc(3*sizeof(np.float64_t)) # <<<<<<<<<<<<<< @@ -3458,7 +3727,7 @@ (__pyx_v_self->centroids[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)malloc((3 * (sizeof(__pyx_t_5numpy_float64_t))))); } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":114 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":125 * for i in range(self.num_prim): * self.centroids[i] = malloc(3*sizeof(np.float64_t)) * self.bboxes = malloc(self.num_prim * sizeof(BBox)) # <<<<<<<<<<<<<< @@ -3467,7 +3736,7 @@ */ __pyx_v_self->bboxes = ((struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox *)malloc((__pyx_v_self->num_prim * (sizeof(struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox))))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":119 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":130 * cdef np.int64_t j, k * cdef np.int64_t field_offset, vertex_offset * for i in range(self.num_elem): # <<<<<<<<<<<<<< @@ -3478,7 +3747,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":120 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":131 * cdef np.int64_t field_offset, vertex_offset * for i in range(self.num_elem): * for j in range(self.num_verts_per_elem): # <<<<<<<<<<<<<< @@ -3489,7 +3758,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":121 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":132 * for i in range(self.num_elem): * for j in range(self.num_verts_per_elem): * vertex_offset = i*self.num_verts_per_elem*3 + j*3 # <<<<<<<<<<<<<< @@ -3498,7 +3767,7 @@ */ __pyx_v_vertex_offset = (((__pyx_v_i * __pyx_v_self->num_verts_per_elem) * 3) + (__pyx_v_j * 3)); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":122 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":133 * for j in range(self.num_verts_per_elem): * vertex_offset = i*self.num_verts_per_elem*3 + j*3 * for k in range(3): # <<<<<<<<<<<<<< @@ -3508,7 +3777,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) { __pyx_v_k = __pyx_t_7; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":123 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":134 * vertex_offset = i*self.num_verts_per_elem*3 + j*3 * for k in range(3): * self.vertices[vertex_offset + k] = vertices[indices[i,j]][k] # <<<<<<<<<<<<<< @@ -3528,7 +3797,7 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)"); - __PYX_ERR(0, 123, __pyx_L1_error) + __PYX_ERR(0, 134, __pyx_L1_error) } __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -3545,7 +3814,7 @@ } } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":124 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":135 * for k in range(3): * self.vertices[vertex_offset + k] = vertices[indices[i,j]][k] * field_offset = i*self.num_field_per_elem # <<<<<<<<<<<<<< @@ -3554,7 +3823,7 @@ */ __pyx_v_field_offset = (__pyx_v_i * __pyx_v_self->num_field_per_elem); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":125 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":136 * self.vertices[vertex_offset + k] = vertices[indices[i,j]][k] * field_offset = i*self.num_field_per_elem * for j in range(self.num_field_per_elem): # <<<<<<<<<<<<<< @@ -3565,7 +3834,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":126 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":137 * field_offset = i*self.num_field_per_elem * for j in range(self.num_field_per_elem): * self.field_data[field_offset + j] = field_data[i][j] # <<<<<<<<<<<<<< @@ -3583,7 +3852,7 @@ __pyx_tmp_idx += __pyx_tmp_shape; if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)"); - __PYX_ERR(0, 126, __pyx_L1_error) + __PYX_ERR(0, 137, __pyx_L1_error) } __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -3600,17 +3869,17 @@ } } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":129 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":140 * * # set up primitives * if self.num_verts_per_elem == 20: # <<<<<<<<<<<<<< * self.primitives = malloc(self.num_prim * sizeof(Patch)) * self.get_centroid = patch_centroid */ - __pyx_t_12 = ((__pyx_v_self->num_verts_per_elem == 20) != 0); - if (__pyx_t_12) { + switch (__pyx_v_self->num_verts_per_elem) { + case 20: - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":130 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":141 * # set up primitives * if self.num_verts_per_elem == 20: * self.primitives = malloc(self.num_prim * sizeof(Patch)) # <<<<<<<<<<<<<< @@ -3619,7 +3888,7 @@ */ __pyx_v_self->primitives = malloc((__pyx_v_self->num_prim * (sizeof(struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch)))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":131 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":142 * if self.num_verts_per_elem == 20: * self.primitives = malloc(self.num_prim * sizeof(Patch)) * self.get_centroid = patch_centroid # <<<<<<<<<<<<<< @@ -3628,7 +3897,7 @@ */ __pyx_v_self->get_centroid = __pyx_f_2yt_9utilities_3lib_10primitives_patch_centroid; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":132 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":143 * self.primitives = malloc(self.num_prim * sizeof(Patch)) * self.get_centroid = patch_centroid * self.get_bbox = patch_bbox # <<<<<<<<<<<<<< @@ -3637,45 +3906,107 @@ */ __pyx_v_self->get_bbox = __pyx_f_2yt_9utilities_3lib_10primitives_patch_bbox; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":133 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":144 * self.get_centroid = patch_centroid * self.get_bbox = patch_bbox * self.get_intersect = ray_patch_intersect # <<<<<<<<<<<<<< * self._set_up_patches(vertices, indices) - * else: + * elif self.num_verts_per_elem == 10: */ __pyx_v_self->get_intersect = __pyx_f_2yt_9utilities_3lib_10primitives_ray_patch_intersect; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":134 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":145 * self.get_bbox = patch_bbox * self.get_intersect = ray_patch_intersect * self._set_up_patches(vertices, indices) # <<<<<<<<<<<<<< - * else: - * self.primitives = malloc(self.num_prim * sizeof(Triangle)) + * elif self.num_verts_per_elem == 10: + * self.primitives = malloc(self.num_prim * sizeof(TetPatch)) */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_set_up_patches(__pyx_v_self, __pyx_v_vertices, __pyx_v_indices); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":129 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":140 * * # set up primitives * if self.num_verts_per_elem == 20: # <<<<<<<<<<<<<< * self.primitives = malloc(self.num_prim * sizeof(Patch)) * self.get_centroid = patch_centroid */ - goto __pyx_L13; - } + break; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":146 + * self.get_intersect = ray_patch_intersect + * self._set_up_patches(vertices, indices) + * elif self.num_verts_per_elem == 10: # <<<<<<<<<<<<<< + * self.primitives = malloc(self.num_prim * sizeof(TetPatch)) + * self.get_centroid = tet_patch_centroid + */ + case 10: - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":136 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":147 * self._set_up_patches(vertices, indices) + * elif self.num_verts_per_elem == 10: + * self.primitives = malloc(self.num_prim * sizeof(TetPatch)) # <<<<<<<<<<<<<< + * self.get_centroid = tet_patch_centroid + * self.get_bbox = tet_patch_bbox + */ + __pyx_v_self->primitives = malloc((__pyx_v_self->num_prim * (sizeof(struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch)))); + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":148 + * elif self.num_verts_per_elem == 10: + * self.primitives = malloc(self.num_prim * sizeof(TetPatch)) + * self.get_centroid = tet_patch_centroid # <<<<<<<<<<<<<< + * self.get_bbox = tet_patch_bbox + * self.get_intersect = ray_tet_patch_intersect + */ + __pyx_v_self->get_centroid = __pyx_f_2yt_9utilities_3lib_10primitives_tet_patch_centroid; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":149 + * self.primitives = malloc(self.num_prim * sizeof(TetPatch)) + * self.get_centroid = tet_patch_centroid + * self.get_bbox = tet_patch_bbox # <<<<<<<<<<<<<< + * self.get_intersect = ray_tet_patch_intersect + * self._set_up_tet_patches(vertices, indices) + */ + __pyx_v_self->get_bbox = __pyx_f_2yt_9utilities_3lib_10primitives_tet_patch_bbox; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":150 + * self.get_centroid = tet_patch_centroid + * self.get_bbox = tet_patch_bbox + * self.get_intersect = ray_tet_patch_intersect # <<<<<<<<<<<<<< + * self._set_up_tet_patches(vertices, indices) + * else: + */ + __pyx_v_self->get_intersect = __pyx_f_2yt_9utilities_3lib_10primitives_ray_tet_patch_intersect; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":151 + * self.get_bbox = tet_patch_bbox + * self.get_intersect = ray_tet_patch_intersect + * self._set_up_tet_patches(vertices, indices) # <<<<<<<<<<<<<< + * else: + * self.primitives = malloc(self.num_prim * sizeof(Triangle)) + */ + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_set_up_tet_patches(__pyx_v_self, __pyx_v_vertices, __pyx_v_indices); + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":146 + * self.get_intersect = ray_patch_intersect + * self._set_up_patches(vertices, indices) + * elif self.num_verts_per_elem == 10: # <<<<<<<<<<<<<< + * self.primitives = malloc(self.num_prim * sizeof(TetPatch)) + * self.get_centroid = tet_patch_centroid + */ + break; + default: + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":153 + * self._set_up_tet_patches(vertices, indices) * else: * self.primitives = malloc(self.num_prim * sizeof(Triangle)) # <<<<<<<<<<<<<< * self.get_centroid = triangle_centroid * self.get_bbox = triangle_bbox */ - /*else*/ { __pyx_v_self->primitives = malloc((__pyx_v_self->num_prim * (sizeof(struct __pyx_t_2yt_9utilities_3lib_10primitives_Triangle)))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":137 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":154 * else: * self.primitives = malloc(self.num_prim * sizeof(Triangle)) * self.get_centroid = triangle_centroid # <<<<<<<<<<<<<< @@ -3684,7 +4015,7 @@ */ __pyx_v_self->get_centroid = __pyx_f_2yt_9utilities_3lib_10primitives_triangle_centroid; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":138 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":155 * self.primitives = malloc(self.num_prim * sizeof(Triangle)) * self.get_centroid = triangle_centroid * self.get_bbox = triangle_bbox # <<<<<<<<<<<<<< @@ -3693,7 +4024,7 @@ */ __pyx_v_self->get_bbox = __pyx_f_2yt_9utilities_3lib_10primitives_triangle_bbox; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":139 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":156 * self.get_centroid = triangle_centroid * self.get_bbox = triangle_bbox * self.get_intersect = ray_triangle_intersect # <<<<<<<<<<<<<< @@ -3702,7 +4033,7 @@ */ __pyx_v_self->get_intersect = __pyx_f_2yt_9utilities_3lib_10primitives_ray_triangle_intersect; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":140 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":157 * self.get_bbox = triangle_bbox * self.get_intersect = ray_triangle_intersect * self._set_up_triangles(vertices, indices) # <<<<<<<<<<<<<< @@ -3710,10 +4041,10 @@ * self.root = self._recursive_build(0, self.num_prim) */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_set_up_triangles(__pyx_v_self, __pyx_v_vertices, __pyx_v_indices); + break; } - __pyx_L13:; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":142 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":159 * self._set_up_triangles(vertices, indices) * * self.root = self._recursive_build(0, self.num_prim) # <<<<<<<<<<<<<< @@ -3722,7 +4053,7 @@ */ __pyx_v_self->root = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_recursive_build(__pyx_v_self, 0, __pyx_v_self->num_prim); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":74 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":82 * @cython.wraparound(False) * @cython.cdivision(True) * def __cinit__(self, # <<<<<<<<<<<<<< @@ -3747,7 +4078,7 @@ return __pyx_r; } -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":147 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":164 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void _set_up_patches(self, np.float64_t[:, :] vertices, # <<<<<<<<<<<<<< @@ -3775,7 +4106,7 @@ __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; __pyx_t_5numpy_int64_t __pyx_t_10; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":152 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":169 * cdef np.int64_t i, j, k, ind, idim * cdef np.int64_t offset, prim_index * for i in range(self.num_elem): # <<<<<<<<<<<<<< @@ -3786,7 +4117,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":153 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":170 * cdef np.int64_t offset, prim_index * for i in range(self.num_elem): * offset = self.num_prim_per_elem*i # <<<<<<<<<<<<<< @@ -3795,7 +4126,7 @@ */ __pyx_v_offset = (__pyx_v_self->num_prim_per_elem * __pyx_v_i); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":154 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":171 * for i in range(self.num_elem): * offset = self.num_prim_per_elem*i * for j in range(self.num_prim_per_elem): # for each face # <<<<<<<<<<<<<< @@ -3806,7 +4137,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":155 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":172 * offset = self.num_prim_per_elem*i * for j in range(self.num_prim_per_elem): # for each face * prim_index = offset + j # <<<<<<<<<<<<<< @@ -3815,7 +4146,7 @@ */ __pyx_v_prim_index = (__pyx_v_offset + __pyx_v_j); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":156 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":173 * for j in range(self.num_prim_per_elem): # for each face * prim_index = offset + j * patch = &( self.primitives)[prim_index] # <<<<<<<<<<<<<< @@ -3824,7 +4155,7 @@ */ __pyx_v_patch = (&(((struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch *)__pyx_v_self->primitives)[__pyx_v_prim_index])); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":157 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":174 * prim_index = offset + j * patch = &( self.primitives)[prim_index] * self.prim_ids[prim_index] = prim_index # <<<<<<<<<<<<<< @@ -3833,7 +4164,7 @@ */ (__pyx_v_self->prim_ids[__pyx_v_prim_index]) = __pyx_v_prim_index; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":158 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":175 * patch = &( self.primitives)[prim_index] * self.prim_ids[prim_index] = prim_index * patch.elem_id = i # <<<<<<<<<<<<<< @@ -3842,7 +4173,7 @@ */ __pyx_v_patch->elem_id = __pyx_v_i; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":159 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":176 * self.prim_ids[prim_index] = prim_index * patch.elem_id = i * for k in range(8): # for each vertex # <<<<<<<<<<<<<< @@ -3852,7 +4183,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < 8; __pyx_t_5+=1) { __pyx_v_k = __pyx_t_5; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":160 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":177 * patch.elem_id = i * for k in range(8): # for each vertex * ind = hex20_faces[j][k] # <<<<<<<<<<<<<< @@ -3861,7 +4192,7 @@ */ __pyx_v_ind = ((hex20_faces[__pyx_v_j])[__pyx_v_k]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":161 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":178 * for k in range(8): # for each vertex * ind = hex20_faces[j][k] * for idim in range(3): # for each spatial dimension (yikes) # <<<<<<<<<<<<<< @@ -3871,7 +4202,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_idim = __pyx_t_6; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":162 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":179 * ind = hex20_faces[j][k] * for idim in range(3): # for each spatial dimension (yikes) * patch.v[k][idim] = vertices[indices[i, ind]][idim] # <<<<<<<<<<<<<< @@ -3897,7 +4228,7 @@ #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 162, __pyx_L1_error) + __PYX_ERR(0, 179, __pyx_L1_error) } __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -3914,7 +4245,7 @@ } } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":163 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":180 * for idim in range(3): # for each spatial dimension (yikes) * patch.v[k][idim] = vertices[indices[i, ind]][idim] * self.get_centroid(self.primitives, # <<<<<<<<<<<<<< @@ -3923,7 +4254,7 @@ */ __pyx_v_self->get_centroid(__pyx_v_self->primitives, __pyx_v_prim_index, (__pyx_v_self->centroids[__pyx_v_prim_index])); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":166 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":183 * prim_index, * self.centroids[prim_index]) * self.get_bbox(self.primitives, # <<<<<<<<<<<<<< @@ -3934,7 +4265,7 @@ } } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":147 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":164 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void _set_up_patches(self, np.float64_t[:, :] vertices, # <<<<<<<<<<<<<< @@ -3946,11 +4277,214 @@ goto __pyx_L0; __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); - __Pyx_WriteUnraisable("yt.utilities.lib.bounding_volume_hierarchy.BVH._set_up_patches", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1); + __Pyx_WriteUnraisable("yt.utilities.lib.bounding_volume_hierarchy.BVH._set_up_patches", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_L0:; +} + +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":190 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void _set_up_tet_patches(self, np.float64_t[:, :] vertices, # <<<<<<<<<<<<<< + * np.int64_t[:, :] indices) nogil: + * cdef TetPatch* tet_patch + */ + +static void __pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__set_up_tet_patches(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_self, __Pyx_memviewslice __pyx_v_vertices, __Pyx_memviewslice __pyx_v_indices) { + struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch *__pyx_v_tet_patch; + __pyx_t_5numpy_int64_t __pyx_v_i; + __pyx_t_5numpy_int64_t __pyx_v_j; + __pyx_t_5numpy_int64_t __pyx_v_k; + __pyx_t_5numpy_int64_t __pyx_v_ind; + __pyx_t_5numpy_int64_t __pyx_v_idim; + __pyx_t_5numpy_int64_t __pyx_v_offset; + __pyx_t_5numpy_int64_t __pyx_v_prim_index; + __pyx_t_5numpy_int64_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + __pyx_t_5numpy_int64_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + __pyx_t_5numpy_int64_t __pyx_t_6; + __pyx_t_5numpy_int64_t __pyx_t_7; + __pyx_t_5numpy_int64_t __pyx_t_8; + __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_10; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":195 + * cdef np.int64_t i, j, k, ind, idim + * cdef np.int64_t offset, prim_index + * for i in range(self.num_elem): # <<<<<<<<<<<<<< + * offset = self.num_prim_per_elem*i + * for j in range(self.num_prim_per_elem): # for each face + */ + __pyx_t_1 = __pyx_v_self->num_elem; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":196 + * cdef np.int64_t offset, prim_index + * for i in range(self.num_elem): + * offset = self.num_prim_per_elem*i # <<<<<<<<<<<<<< + * for j in range(self.num_prim_per_elem): # for each face + * prim_index = offset + j + */ + __pyx_v_offset = (__pyx_v_self->num_prim_per_elem * __pyx_v_i); + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":197 + * for i in range(self.num_elem): + * offset = self.num_prim_per_elem*i + * for j in range(self.num_prim_per_elem): # for each face # <<<<<<<<<<<<<< + * prim_index = offset + j + * tet_patch = &( self.primitives)[prim_index] + */ + __pyx_t_3 = __pyx_v_self->num_prim_per_elem; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_j = __pyx_t_4; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":198 + * offset = self.num_prim_per_elem*i + * for j in range(self.num_prim_per_elem): # for each face + * prim_index = offset + j # <<<<<<<<<<<<<< + * tet_patch = &( self.primitives)[prim_index] + * self.prim_ids[prim_index] = prim_index + */ + __pyx_v_prim_index = (__pyx_v_offset + __pyx_v_j); + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":199 + * for j in range(self.num_prim_per_elem): # for each face + * prim_index = offset + j + * tet_patch = &( self.primitives)[prim_index] # <<<<<<<<<<<<<< + * self.prim_ids[prim_index] = prim_index + * tet_patch.elem_id = i + */ + __pyx_v_tet_patch = (&(((struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch *)__pyx_v_self->primitives)[__pyx_v_prim_index])); + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":200 + * prim_index = offset + j + * tet_patch = &( self.primitives)[prim_index] + * self.prim_ids[prim_index] = prim_index # <<<<<<<<<<<<<< + * tet_patch.elem_id = i + * for k in range(6): # for each vertex + */ + (__pyx_v_self->prim_ids[__pyx_v_prim_index]) = __pyx_v_prim_index; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":201 + * tet_patch = &( self.primitives)[prim_index] + * self.prim_ids[prim_index] = prim_index + * tet_patch.elem_id = i # <<<<<<<<<<<<<< + * for k in range(6): # for each vertex + * ind = tet10_faces[j][k] + */ + __pyx_v_tet_patch->elem_id = __pyx_v_i; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":202 + * self.prim_ids[prim_index] = prim_index + * tet_patch.elem_id = i + * for k in range(6): # for each vertex # <<<<<<<<<<<<<< + * ind = tet10_faces[j][k] + * for idim in range(3): # for each spatial dimension (yikes) + */ + for (__pyx_t_5 = 0; __pyx_t_5 < 6; __pyx_t_5+=1) { + __pyx_v_k = __pyx_t_5; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":203 + * tet_patch.elem_id = i + * for k in range(6): # for each vertex + * ind = tet10_faces[j][k] # <<<<<<<<<<<<<< + * for idim in range(3): # for each spatial dimension (yikes) + * tet_patch.v[k][idim] = vertices[indices[i, ind]][idim] + */ + __pyx_v_ind = ((tet10_faces[__pyx_v_j])[__pyx_v_k]); + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":204 + * for k in range(6): # for each vertex + * ind = tet10_faces[j][k] + * for idim in range(3): # for each spatial dimension (yikes) # <<<<<<<<<<<<<< + * tet_patch.v[k][idim] = vertices[indices[i, ind]][idim] + * self.get_centroid(self.primitives, + */ + for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { + __pyx_v_idim = __pyx_t_6; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":205 + * ind = tet10_faces[j][k] + * for idim in range(3): # for each spatial dimension (yikes) + * tet_patch.v[k][idim] = vertices[indices[i, ind]][idim] # <<<<<<<<<<<<<< + * self.get_centroid(self.primitives, + * prim_index, + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_ind; + __pyx_t_9.data = __pyx_v_vertices.data; + __pyx_t_9.memview = __pyx_v_vertices.memview; + __PYX_INC_MEMVIEW(&__pyx_t_9, 0); + { + Py_ssize_t __pyx_tmp_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_7 * __pyx_v_indices.strides[0]) ) + __pyx_t_8 * __pyx_v_indices.strides[1]) ))); + Py_ssize_t __pyx_tmp_shape = __pyx_v_vertices.shape[0]; + Py_ssize_t __pyx_tmp_stride = __pyx_v_vertices.strides[0]; + if (0 && (__pyx_tmp_idx < 0)) + __pyx_tmp_idx += __pyx_tmp_shape; + if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 205, __pyx_L1_error) + } + __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_9.shape[0] = __pyx_v_vertices.shape[1]; +__pyx_t_9.strides[0] = __pyx_v_vertices.strides[1]; + __pyx_t_9.suboffsets[0] = -1; + +__pyx_t_10 = __pyx_v_idim; + ((__pyx_v_tet_patch->v[__pyx_v_k])[__pyx_v_idim]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_t_9.data + __pyx_t_10 * __pyx_t_9.strides[0]) ))); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); + __pyx_t_9.memview = NULL; + __pyx_t_9.data = NULL; + } + } + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":206 + * for idim in range(3): # for each spatial dimension (yikes) + * tet_patch.v[k][idim] = vertices[indices[i, ind]][idim] + * self.get_centroid(self.primitives, # <<<<<<<<<<<<<< + * prim_index, + * self.centroids[prim_index]) + */ + __pyx_v_self->get_centroid(__pyx_v_self->primitives, __pyx_v_prim_index, (__pyx_v_self->centroids[__pyx_v_prim_index])); + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":209 + * prim_index, + * self.centroids[prim_index]) + * self.get_bbox(self.primitives, # <<<<<<<<<<<<<< + * prim_index, + * &(self.bboxes[prim_index])) + */ + __pyx_v_self->get_bbox(__pyx_v_self->primitives, __pyx_v_prim_index, (&(__pyx_v_self->bboxes[__pyx_v_prim_index]))); + } + } + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":190 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void _set_up_tet_patches(self, np.float64_t[:, :] vertices, # <<<<<<<<<<<<<< + * np.int64_t[:, :] indices) nogil: + * cdef TetPatch* tet_patch + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.bounding_volume_hierarchy.BVH._set_up_tet_patches", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); __pyx_L0:; } -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":173 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":216 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void _set_up_triangles(self, np.float64_t[:, :] vertices, # <<<<<<<<<<<<<< @@ -3982,7 +4516,7 @@ __pyx_t_5numpy_int64_t __pyx_t_12; __pyx_t_5numpy_int64_t __pyx_t_13; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":180 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":223 * cdef Triangle* tri * cdef np.int64_t i, j, k * for i in range(self.num_elem): # <<<<<<<<<<<<<< @@ -3993,7 +4527,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":181 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":224 * cdef np.int64_t i, j, k * for i in range(self.num_elem): * offset = self.num_prim_per_elem*i # <<<<<<<<<<<<<< @@ -4002,7 +4536,7 @@ */ __pyx_v_offset = (__pyx_v_self->num_prim_per_elem * __pyx_v_i); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":182 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":225 * for i in range(self.num_elem): * offset = self.num_prim_per_elem*i * for j in range(self.num_prim_per_elem): # <<<<<<<<<<<<<< @@ -4013,7 +4547,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":183 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":226 * offset = self.num_prim_per_elem*i * for j in range(self.num_prim_per_elem): * tri_index = offset + j # <<<<<<<<<<<<<< @@ -4022,7 +4556,7 @@ */ __pyx_v_tri_index = (__pyx_v_offset + __pyx_v_j); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":184 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":227 * for j in range(self.num_prim_per_elem): * tri_index = offset + j * self.prim_ids[tri_index] = tri_index # <<<<<<<<<<<<<< @@ -4031,7 +4565,7 @@ */ (__pyx_v_self->prim_ids[__pyx_v_tri_index]) = __pyx_v_tri_index; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":185 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":228 * tri_index = offset + j * self.prim_ids[tri_index] = tri_index * tri = &( self.primitives)[tri_index] # <<<<<<<<<<<<<< @@ -4040,7 +4574,7 @@ */ __pyx_v_tri = (&(((struct __pyx_t_2yt_9utilities_3lib_10primitives_Triangle *)__pyx_v_self->primitives)[__pyx_v_tri_index])); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":186 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":229 * self.prim_ids[tri_index] = tri_index * tri = &( self.primitives)[tri_index] * tri.elem_id = i # <<<<<<<<<<<<<< @@ -4049,7 +4583,7 @@ */ __pyx_v_tri->elem_id = __pyx_v_i; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":187 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":230 * tri = &( self.primitives)[tri_index] * tri.elem_id = i * v0 = indices[i][self.tri_array[j][0]] # <<<<<<<<<<<<<< @@ -4073,7 +4607,7 @@ #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 187, __pyx_L1_error) + __PYX_ERR(0, 230, __pyx_L1_error) } __pyx_t_5.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -4088,7 +4622,7 @@ __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":188 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":231 * tri.elem_id = i * v0 = indices[i][self.tri_array[j][0]] * v1 = indices[i][self.tri_array[j][1]] # <<<<<<<<<<<<<< @@ -4112,7 +4646,7 @@ #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 188, __pyx_L1_error) + __PYX_ERR(0, 231, __pyx_L1_error) } __pyx_t_5.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -4127,7 +4661,7 @@ __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":189 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":232 * v0 = indices[i][self.tri_array[j][0]] * v1 = indices[i][self.tri_array[j][1]] * v2 = indices[i][self.tri_array[j][2]] # <<<<<<<<<<<<<< @@ -4151,7 +4685,7 @@ #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 189, __pyx_L1_error) + __PYX_ERR(0, 232, __pyx_L1_error) } __pyx_t_5.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -4166,7 +4700,7 @@ __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":190 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":233 * v1 = indices[i][self.tri_array[j][1]] * v2 = indices[i][self.tri_array[j][2]] * for k in range(3): # <<<<<<<<<<<<<< @@ -4176,7 +4710,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < 3; __pyx_t_9+=1) { __pyx_v_k = __pyx_t_9; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":191 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":234 * v2 = indices[i][self.tri_array[j][2]] * for k in range(3): * tri.p0[k] = vertices[v0][k] # <<<<<<<<<<<<<< @@ -4200,7 +4734,7 @@ #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 191, __pyx_L1_error) + __PYX_ERR(0, 234, __pyx_L1_error) } __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -4215,7 +4749,7 @@ __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":192 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":235 * for k in range(3): * tri.p0[k] = vertices[v0][k] * tri.p1[k] = vertices[v1][k] # <<<<<<<<<<<<<< @@ -4239,7 +4773,7 @@ #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 192, __pyx_L1_error) + __PYX_ERR(0, 235, __pyx_L1_error) } __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -4254,7 +4788,7 @@ __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":193 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":236 * tri.p0[k] = vertices[v0][k] * tri.p1[k] = vertices[v1][k] * tri.p2[k] = vertices[v2][k] # <<<<<<<<<<<<<< @@ -4278,7 +4812,7 @@ #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 193, __pyx_L1_error) + __PYX_ERR(0, 236, __pyx_L1_error) } __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -4294,7 +4828,7 @@ __pyx_t_10.data = NULL; } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":194 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":237 * tri.p1[k] = vertices[v1][k] * tri.p2[k] = vertices[v2][k] * self.get_centroid(self.primitives, # <<<<<<<<<<<<<< @@ -4303,7 +4837,7 @@ */ __pyx_v_self->get_centroid(__pyx_v_self->primitives, __pyx_v_tri_index, (__pyx_v_self->centroids[__pyx_v_tri_index])); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":197 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":240 * tri_index, * self.centroids[tri_index]) * self.get_bbox(self.primitives, # <<<<<<<<<<<<<< @@ -4314,7 +4848,7 @@ } } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":173 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":216 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void _set_up_triangles(self, np.float64_t[:, :] vertices, # <<<<<<<<<<<<<< @@ -4327,11 +4861,11 @@ __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0); __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0); - __Pyx_WriteUnraisable("yt.utilities.lib.bounding_volume_hierarchy.BVH._set_up_triangles", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1); + __Pyx_WriteUnraisable("yt.utilities.lib.bounding_volume_hierarchy.BVH._set_up_triangles", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); __pyx_L0:; } -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":201 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":244 * &(self.bboxes[tri_index])) * * cdef void _recursive_free(self, BVHNode* node) nogil: # <<<<<<<<<<<<<< @@ -4342,7 +4876,7 @@ static void __pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__recursive_free(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_self, struct __pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHNode *__pyx_v_node) { int __pyx_t_1; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":202 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":245 * * cdef void _recursive_free(self, BVHNode* node) nogil: * if node.end - node.begin > LEAF_SIZE: # <<<<<<<<<<<<<< @@ -4352,7 +4886,7 @@ __pyx_t_1 = (((__pyx_v_node->end - __pyx_v_node->begin) > __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_LEAF_SIZE) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":203 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":246 * cdef void _recursive_free(self, BVHNode* node) nogil: * if node.end - node.begin > LEAF_SIZE: * self._recursive_free(node.left) # <<<<<<<<<<<<<< @@ -4361,7 +4895,7 @@ */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_recursive_free(__pyx_v_self, __pyx_v_node->left); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":204 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":247 * if node.end - node.begin > LEAF_SIZE: * self._recursive_free(node.left) * self._recursive_free(node.right) # <<<<<<<<<<<<<< @@ -4370,7 +4904,7 @@ */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_recursive_free(__pyx_v_self, __pyx_v_node->right); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":202 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":245 * * cdef void _recursive_free(self, BVHNode* node) nogil: * if node.end - node.begin > LEAF_SIZE: # <<<<<<<<<<<<<< @@ -4379,7 +4913,7 @@ */ } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":205 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":248 * self._recursive_free(node.left) * self._recursive_free(node.right) * free(node) # <<<<<<<<<<<<<< @@ -4388,7 +4922,7 @@ */ free(__pyx_v_node); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":201 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":244 * &(self.bboxes[tri_index])) * * cdef void _recursive_free(self, BVHNode* node) nogil: # <<<<<<<<<<<<<< @@ -4399,12 +4933,12 @@ /* function exit code */ } -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":207 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":250 * free(node) * * def __dealloc__(self): # <<<<<<<<<<<<<< - * self._recursive_free(self.root) - * free(self.primitives) + * if self.root == NULL: + * return */ /* Python wrapper */ @@ -4421,21 +4955,50 @@ static void __pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_2__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_self) { __pyx_t_5numpy_int64_t __pyx_v_i; __Pyx_RefNannyDeclarations - __pyx_t_5numpy_int64_t __pyx_t_1; + int __pyx_t_1; __pyx_t_5numpy_int64_t __pyx_t_2; + __pyx_t_5numpy_int64_t __pyx_t_3; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":208 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":251 + * + * def __dealloc__(self): + * if self.root == NULL: # <<<<<<<<<<<<<< + * return + * self._recursive_free(self.root) + */ + __pyx_t_1 = ((__pyx_v_self->root == NULL) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":252 + * def __dealloc__(self): + * if self.root == NULL: + * return # <<<<<<<<<<<<<< + * self._recursive_free(self.root) + * free(self.primitives) + */ + goto __pyx_L0; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":251 * * def __dealloc__(self): + * if self.root == NULL: # <<<<<<<<<<<<<< + * return + * self._recursive_free(self.root) + */ + } + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":253 + * if self.root == NULL: + * return * self._recursive_free(self.root) # <<<<<<<<<<<<<< * free(self.primitives) * free(self.prim_ids) */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_recursive_free(__pyx_v_self, __pyx_v_self->root); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":209 - * def __dealloc__(self): + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":254 + * return * self._recursive_free(self.root) * free(self.primitives) # <<<<<<<<<<<<<< * free(self.prim_ids) @@ -4443,7 +5006,7 @@ */ free(__pyx_v_self->primitives); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":210 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":255 * self._recursive_free(self.root) * free(self.primitives) * free(self.prim_ids) # <<<<<<<<<<<<<< @@ -4452,18 +5015,18 @@ */ free(__pyx_v_self->prim_ids); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":211 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":256 * free(self.primitives) * free(self.prim_ids) * for i in range(self.num_prim): # <<<<<<<<<<<<<< * free(self.centroids[i]) * free(self.centroids) */ - __pyx_t_1 = __pyx_v_self->num_prim; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + __pyx_t_2 = __pyx_v_self->num_prim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":212 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":257 * free(self.prim_ids) * for i in range(self.num_prim): * free(self.centroids[i]) # <<<<<<<<<<<<<< @@ -4473,7 +5036,7 @@ free((__pyx_v_self->centroids[__pyx_v_i])); } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":213 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":258 * for i in range(self.num_prim): * free(self.centroids[i]) * free(self.centroids) # <<<<<<<<<<<<<< @@ -4482,7 +5045,7 @@ */ free(__pyx_v_self->centroids); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":214 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":259 * free(self.centroids[i]) * free(self.centroids) * free(self.bboxes) # <<<<<<<<<<<<<< @@ -4491,7 +5054,7 @@ */ free(__pyx_v_self->bboxes); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":215 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":260 * free(self.centroids) * free(self.bboxes) * free(self.field_data) # <<<<<<<<<<<<<< @@ -4500,7 +5063,7 @@ */ free(__pyx_v_self->field_data); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":216 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":261 * free(self.bboxes) * free(self.field_data) * free(self.vertices) # <<<<<<<<<<<<<< @@ -4509,19 +5072,20 @@ */ free(__pyx_v_self->vertices); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":207 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":250 * free(node) * * def __dealloc__(self): # <<<<<<<<<<<<<< - * self._recursive_free(self.root) - * free(self.primitives) + * if self.root == NULL: + * return */ /* function exit code */ + __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":221 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":266 * @cython.wraparound(False) * @cython.cdivision(True) * cdef np.int64_t _partition(self, np.int64_t begin, np.int64_t end, # <<<<<<<<<<<<<< @@ -4540,7 +5104,7 @@ struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox __pyx_t_6; struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox __pyx_t_7; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":227 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":272 * # along the direction "ax". All the primitives to the right of mid * # will have centroids *greater* than "split" along "ax". * cdef np.int64_t mid = begin # <<<<<<<<<<<<<< @@ -4549,7 +5113,7 @@ */ __pyx_v_mid = __pyx_v_begin; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":228 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":273 * # will have centroids *greater* than "split" along "ax". * cdef np.int64_t mid = begin * while (begin != end): # <<<<<<<<<<<<<< @@ -4560,7 +5124,7 @@ __pyx_t_1 = ((__pyx_v_begin != __pyx_v_end) != 0); if (!__pyx_t_1) break; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":229 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":274 * cdef np.int64_t mid = begin * while (begin != end): * if self.centroids[mid][ax] > split: # <<<<<<<<<<<<<< @@ -4570,7 +5134,7 @@ __pyx_t_1 = ((((__pyx_v_self->centroids[__pyx_v_mid])[__pyx_v_ax]) > __pyx_v_split) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":230 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":275 * while (begin != end): * if self.centroids[mid][ax] > split: * mid += 1 # <<<<<<<<<<<<<< @@ -4579,7 +5143,7 @@ */ __pyx_v_mid = (__pyx_v_mid + 1); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":229 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":274 * cdef np.int64_t mid = begin * while (begin != end): * if self.centroids[mid][ax] > split: # <<<<<<<<<<<<<< @@ -4589,7 +5153,7 @@ goto __pyx_L5; } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":231 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":276 * if self.centroids[mid][ax] > split: * mid += 1 * elif self.centroids[begin][ax] > split: # <<<<<<<<<<<<<< @@ -4599,7 +5163,7 @@ __pyx_t_1 = ((((__pyx_v_self->centroids[__pyx_v_begin])[__pyx_v_ax]) > __pyx_v_split) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":233 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":278 * elif self.centroids[begin][ax] > split: * self.prim_ids[mid], self.prim_ids[begin] = \ * self.prim_ids[begin], self.prim_ids[mid] # <<<<<<<<<<<<<< @@ -4609,7 +5173,7 @@ __pyx_t_2 = (__pyx_v_self->prim_ids[__pyx_v_begin]); __pyx_t_3 = (__pyx_v_self->prim_ids[__pyx_v_mid]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":232 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":277 * mid += 1 * elif self.centroids[begin][ax] > split: * self.prim_ids[mid], self.prim_ids[begin] = \ # <<<<<<<<<<<<<< @@ -4619,7 +5183,7 @@ (__pyx_v_self->prim_ids[__pyx_v_mid]) = __pyx_t_2; (__pyx_v_self->prim_ids[__pyx_v_begin]) = __pyx_t_3; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":235 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":280 * self.prim_ids[begin], self.prim_ids[mid] * self.centroids[mid], self.centroids[begin] = \ * self.centroids[begin], self.centroids[mid] # <<<<<<<<<<<<<< @@ -4629,7 +5193,7 @@ __pyx_t_4 = (__pyx_v_self->centroids[__pyx_v_begin]); __pyx_t_5 = (__pyx_v_self->centroids[__pyx_v_mid]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":234 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":279 * self.prim_ids[mid], self.prim_ids[begin] = \ * self.prim_ids[begin], self.prim_ids[mid] * self.centroids[mid], self.centroids[begin] = \ # <<<<<<<<<<<<<< @@ -4639,7 +5203,7 @@ (__pyx_v_self->centroids[__pyx_v_mid]) = __pyx_t_4; (__pyx_v_self->centroids[__pyx_v_begin]) = __pyx_t_5; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":237 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":282 * self.centroids[begin], self.centroids[mid] * self.bboxes[mid], self.bboxes[begin] = \ * self.bboxes[begin], self.bboxes[mid] # <<<<<<<<<<<<<< @@ -4649,7 +5213,7 @@ __pyx_t_6 = (__pyx_v_self->bboxes[__pyx_v_begin]); __pyx_t_7 = (__pyx_v_self->bboxes[__pyx_v_mid]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":236 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":281 * self.centroids[mid], self.centroids[begin] = \ * self.centroids[begin], self.centroids[mid] * self.bboxes[mid], self.bboxes[begin] = \ # <<<<<<<<<<<<<< @@ -4659,7 +5223,7 @@ (__pyx_v_self->bboxes[__pyx_v_mid]) = __pyx_t_6; (__pyx_v_self->bboxes[__pyx_v_begin]) = __pyx_t_7; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":238 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":283 * self.bboxes[mid], self.bboxes[begin] = \ * self.bboxes[begin], self.bboxes[mid] * mid += 1 # <<<<<<<<<<<<<< @@ -4668,7 +5232,7 @@ */ __pyx_v_mid = (__pyx_v_mid + 1); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":231 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":276 * if self.centroids[mid][ax] > split: * mid += 1 * elif self.centroids[begin][ax] > split: # <<<<<<<<<<<<<< @@ -4678,7 +5242,7 @@ } __pyx_L5:; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":239 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":284 * self.bboxes[begin], self.bboxes[mid] * mid += 1 * begin += 1 # <<<<<<<<<<<<<< @@ -4688,7 +5252,7 @@ __pyx_v_begin = (__pyx_v_begin + 1); } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":240 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":285 * mid += 1 * begin += 1 * return mid # <<<<<<<<<<<<<< @@ -4698,7 +5262,7 @@ __pyx_r = __pyx_v_mid; goto __pyx_L0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":221 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":266 * @cython.wraparound(False) * @cython.cdivision(True) * cdef np.int64_t _partition(self, np.int64_t begin, np.int64_t end, # <<<<<<<<<<<<<< @@ -4711,7 +5275,7 @@ return __pyx_r; } -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":245 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":290 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void _get_node_bbox(self, BVHNode* node, # <<<<<<<<<<<<<< @@ -4727,7 +5291,7 @@ __pyx_t_5numpy_int64_t __pyx_t_2; __pyx_t_5numpy_int64_t __pyx_t_3; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":248 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":293 * np.int64_t begin, np.int64_t end) nogil: * cdef np.int64_t i, j * cdef BBox box = self.bboxes[begin] # <<<<<<<<<<<<<< @@ -4736,7 +5300,7 @@ */ __pyx_v_box = (__pyx_v_self->bboxes[__pyx_v_begin]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":249 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":294 * cdef np.int64_t i, j * cdef BBox box = self.bboxes[begin] * for i in range(begin+1, end): # <<<<<<<<<<<<<< @@ -4747,7 +5311,7 @@ for (__pyx_t_2 = (__pyx_v_begin + 1); __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":250 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":295 * cdef BBox box = self.bboxes[begin] * for i in range(begin+1, end): * for j in range(3): # <<<<<<<<<<<<<< @@ -4757,7 +5321,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_j = __pyx_t_3; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":251 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":296 * for i in range(begin+1, end): * for j in range(3): * box.left_edge[j] = fmin(box.left_edge[j], # <<<<<<<<<<<<<< @@ -4766,7 +5330,7 @@ */ (__pyx_v_box.left_edge[__pyx_v_j]) = fmin((__pyx_v_box.left_edge[__pyx_v_j]), ((__pyx_v_self->bboxes[__pyx_v_i]).left_edge[__pyx_v_j])); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":253 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":298 * box.left_edge[j] = fmin(box.left_edge[j], * self.bboxes[i].left_edge[j]) * box.right_edge[j] = fmax(box.right_edge[j], # <<<<<<<<<<<<<< @@ -4777,7 +5341,7 @@ } } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":255 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":300 * box.right_edge[j] = fmax(box.right_edge[j], * self.bboxes[i].right_edge[j]) * node.bbox = box # <<<<<<<<<<<<<< @@ -4786,7 +5350,7 @@ */ __pyx_v_node->bbox = __pyx_v_box; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":245 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":290 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void _get_node_bbox(self, BVHNode* node, # <<<<<<<<<<<<<< @@ -4797,7 +5361,7 @@ /* function exit code */ } -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":260 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":305 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void intersect(self, Ray* ray) nogil: # <<<<<<<<<<<<<< @@ -4814,7 +5378,7 @@ int __pyx_t_1; __pyx_t_5numpy_int64_t __pyx_t_2; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":261 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":306 * @cython.cdivision(True) * cdef void intersect(self, Ray* ray) nogil: * self._recursive_intersect(ray, self.root) # <<<<<<<<<<<<<< @@ -4823,7 +5387,7 @@ */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_recursive_intersect(__pyx_v_self, __pyx_v_ray, __pyx_v_self->root); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":263 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":308 * self._recursive_intersect(ray, self.root) * * if ray.elem_id < 0: # <<<<<<<<<<<<<< @@ -4833,7 +5397,7 @@ __pyx_t_1 = ((__pyx_v_ray->elem_id < 0) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":264 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":309 * * if ray.elem_id < 0: * return # <<<<<<<<<<<<<< @@ -4842,7 +5406,7 @@ */ goto __pyx_L0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":263 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":308 * self._recursive_intersect(ray, self.root) * * if ray.elem_id < 0: # <<<<<<<<<<<<<< @@ -4851,7 +5415,7 @@ */ } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":268 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":313 * cdef np.float64_t[3] position * cdef np.int64_t i * for i in range(3): # <<<<<<<<<<<<<< @@ -4861,7 +5425,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":269 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":314 * cdef np.int64_t i * for i in range(3): * position[i] = ray.origin[i] + ray.t_far*ray.direction[i] # <<<<<<<<<<<<<< @@ -4871,7 +5435,7 @@ (__pyx_v_position[__pyx_v_i]) = ((__pyx_v_ray->origin[__pyx_v_i]) + (__pyx_v_ray->t_far * (__pyx_v_ray->direction[__pyx_v_i]))); } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":273 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":318 * cdef np.float64_t* vertex_ptr * cdef np.float64_t* field_ptr * vertex_ptr = self.vertices + ray.elem_id*self.num_verts_per_elem*3 # <<<<<<<<<<<<<< @@ -4880,7 +5444,7 @@ */ __pyx_v_vertex_ptr = (__pyx_v_self->vertices + ((__pyx_v_ray->elem_id * __pyx_v_self->num_verts_per_elem) * 3)); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":274 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":319 * cdef np.float64_t* field_ptr * vertex_ptr = self.vertices + ray.elem_id*self.num_verts_per_elem*3 * field_ptr = self.field_data + ray.elem_id*self.num_field_per_elem # <<<<<<<<<<<<<< @@ -4889,7 +5453,7 @@ */ __pyx_v_field_ptr = (__pyx_v_self->field_data + (__pyx_v_ray->elem_id * __pyx_v_self->num_field_per_elem)); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":277 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":322 * * cdef np.float64_t[4] mapped_coord * self.sampler.map_real_to_unit(mapped_coord, vertex_ptr, position) # <<<<<<<<<<<<<< @@ -4898,7 +5462,7 @@ */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_self->sampler->__pyx_vtab)->map_real_to_unit(__pyx_v_self->sampler, __pyx_v_mapped_coord, __pyx_v_vertex_ptr, __pyx_v_position); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":278 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":323 * cdef np.float64_t[4] mapped_coord * self.sampler.map_real_to_unit(mapped_coord, vertex_ptr, position) * if self.num_field_per_elem == 1: # <<<<<<<<<<<<<< @@ -4908,7 +5472,7 @@ __pyx_t_1 = ((__pyx_v_self->num_field_per_elem == 1) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":279 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":324 * self.sampler.map_real_to_unit(mapped_coord, vertex_ptr, position) * if self.num_field_per_elem == 1: * ray.data_val = field_ptr[0] # <<<<<<<<<<<<<< @@ -4917,7 +5481,7 @@ */ __pyx_v_ray->data_val = (__pyx_v_field_ptr[0]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":278 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":323 * cdef np.float64_t[4] mapped_coord * self.sampler.map_real_to_unit(mapped_coord, vertex_ptr, position) * if self.num_field_per_elem == 1: # <<<<<<<<<<<<<< @@ -4927,7 +5491,7 @@ goto __pyx_L6; } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":281 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":326 * ray.data_val = field_ptr[0] * else: * ray.data_val = self.sampler.sample_at_unit_point(mapped_coord, # <<<<<<<<<<<<<< @@ -4936,7 +5500,7 @@ */ /*else*/ { - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":282 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":327 * else: * ray.data_val = self.sampler.sample_at_unit_point(mapped_coord, * field_ptr) # <<<<<<<<<<<<<< @@ -4947,7 +5511,7 @@ } __pyx_L6:; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":283 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":328 * ray.data_val = self.sampler.sample_at_unit_point(mapped_coord, * field_ptr) * ray.near_boundary = self.sampler.check_mesh_lines(mapped_coord) # <<<<<<<<<<<<<< @@ -4956,7 +5520,7 @@ */ __pyx_v_ray->near_boundary = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_self->sampler->__pyx_vtab)->check_mesh_lines(__pyx_v_self->sampler, __pyx_v_mapped_coord); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":260 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":305 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void intersect(self, Ray* ray) nogil: # <<<<<<<<<<<<<< @@ -4968,7 +5532,7 @@ __pyx_L0:; } -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":288 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":333 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void _recursive_intersect(self, Ray* ray, BVHNode* node) nogil: # <<<<<<<<<<<<<< @@ -4983,7 +5547,7 @@ __pyx_t_5numpy_int64_t __pyx_t_2; __pyx_t_5numpy_int64_t __pyx_t_3; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":291 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":336 * * # check for bbox intersection: * if not ray_bbox_intersect(ray, node.bbox): # <<<<<<<<<<<<<< @@ -4993,7 +5557,7 @@ __pyx_t_1 = ((!(__pyx_f_2yt_9utilities_3lib_10primitives_ray_bbox_intersect(__pyx_v_ray, __pyx_v_node->bbox) != 0)) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":292 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":337 * # check for bbox intersection: * if not ray_bbox_intersect(ray, node.bbox): * return # <<<<<<<<<<<<<< @@ -5002,7 +5566,7 @@ */ goto __pyx_L0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":291 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":336 * * # check for bbox intersection: * if not ray_bbox_intersect(ray, node.bbox): # <<<<<<<<<<<<<< @@ -5011,7 +5575,7 @@ */ } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":296 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":341 * # check for leaf * cdef np.int64_t i, hit * if (node.end - node.begin) <= LEAF_SIZE: # <<<<<<<<<<<<<< @@ -5021,7 +5585,7 @@ __pyx_t_1 = (((__pyx_v_node->end - __pyx_v_node->begin) <= __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_LEAF_SIZE) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":297 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":342 * cdef np.int64_t i, hit * if (node.end - node.begin) <= LEAF_SIZE: * for i in range(node.begin, node.end): # <<<<<<<<<<<<<< @@ -5032,7 +5596,7 @@ for (__pyx_t_3 = __pyx_v_node->begin; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":298 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":343 * if (node.end - node.begin) <= LEAF_SIZE: * for i in range(node.begin, node.end): * hit = self.get_intersect(self.primitives, self.prim_ids[i], ray) # <<<<<<<<<<<<<< @@ -5042,7 +5606,7 @@ __pyx_v_hit = __pyx_v_self->get_intersect(__pyx_v_self->primitives, (__pyx_v_self->prim_ids[__pyx_v_i]), __pyx_v_ray); } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":299 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":344 * for i in range(node.begin, node.end): * hit = self.get_intersect(self.primitives, self.prim_ids[i], ray) * return # <<<<<<<<<<<<<< @@ -5051,7 +5615,7 @@ */ goto __pyx_L0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":296 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":341 * # check for leaf * cdef np.int64_t i, hit * if (node.end - node.begin) <= LEAF_SIZE: # <<<<<<<<<<<<<< @@ -5060,7 +5624,7 @@ */ } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":302 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":347 * * # if not leaf, intersect with left and right children * self._recursive_intersect(ray, node.left) # <<<<<<<<<<<<<< @@ -5069,7 +5633,7 @@ */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_recursive_intersect(__pyx_v_self, __pyx_v_ray, __pyx_v_node->left); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":303 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":348 * # if not leaf, intersect with left and right children * self._recursive_intersect(ray, node.left) * self._recursive_intersect(ray, node.right) # <<<<<<<<<<<<<< @@ -5078,7 +5642,7 @@ */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_recursive_intersect(__pyx_v_self, __pyx_v_ray, __pyx_v_node->right); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":288 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":333 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void _recursive_intersect(self, Ray* ray, BVHNode* node) nogil: # <<<<<<<<<<<<<< @@ -5090,7 +5654,7 @@ __pyx_L0:; } -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":308 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":353 * @cython.wraparound(False) * @cython.cdivision(True) * cdef BVHNode* _recursive_build(self, np.int64_t begin, np.int64_t end) nogil: # <<<<<<<<<<<<<< @@ -5108,7 +5672,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":309 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":354 * @cython.cdivision(True) * cdef BVHNode* _recursive_build(self, np.int64_t begin, np.int64_t end) nogil: * cdef BVHNode *node = malloc(sizeof(BVHNode)) # <<<<<<<<<<<<<< @@ -5117,7 +5681,7 @@ */ __pyx_v_node = ((struct __pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHNode *)malloc((sizeof(struct __pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHNode)))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":310 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":355 * cdef BVHNode* _recursive_build(self, np.int64_t begin, np.int64_t end) nogil: * cdef BVHNode *node = malloc(sizeof(BVHNode)) * node.begin = begin # <<<<<<<<<<<<<< @@ -5126,7 +5690,7 @@ */ __pyx_v_node->begin = __pyx_v_begin; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":311 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":356 * cdef BVHNode *node = malloc(sizeof(BVHNode)) * node.begin = begin * node.end = end # <<<<<<<<<<<<<< @@ -5135,7 +5699,7 @@ */ __pyx_v_node->end = __pyx_v_end; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":313 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":358 * node.end = end * * self._get_node_bbox(node, begin, end) # <<<<<<<<<<<<<< @@ -5144,7 +5708,7 @@ */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_get_node_bbox(__pyx_v_self, __pyx_v_node, __pyx_v_begin, __pyx_v_end); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":316 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":361 * * # check for leaf * if (end - begin) <= LEAF_SIZE: # <<<<<<<<<<<<<< @@ -5154,7 +5718,7 @@ __pyx_t_1 = (((__pyx_v_end - __pyx_v_begin) <= __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_LEAF_SIZE) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":317 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":362 * # check for leaf * if (end - begin) <= LEAF_SIZE: * return node # <<<<<<<<<<<<<< @@ -5164,7 +5728,7 @@ __pyx_r = __pyx_v_node; goto __pyx_L0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":316 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":361 * * # check for leaf * if (end - begin) <= LEAF_SIZE: # <<<<<<<<<<<<<< @@ -5173,7 +5737,7 @@ */ } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":323 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":368 * * # compute longest dimension * cdef np.int64_t ax = 0 # <<<<<<<<<<<<<< @@ -5182,7 +5746,7 @@ */ __pyx_v_ax = 0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":324 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":369 * # compute longest dimension * cdef np.int64_t ax = 0 * cdef np.float64_t d = fabs(node.bbox.right_edge[0] - # <<<<<<<<<<<<<< @@ -5191,7 +5755,7 @@ */ __pyx_v_d = fabs(((__pyx_v_node->bbox.right_edge[0]) - (__pyx_v_node->bbox.left_edge[0]))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":326 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":371 * cdef np.float64_t d = fabs(node.bbox.right_edge[0] - * node.bbox.left_edge[0]) * if fabs(node.bbox.right_edge[1] - node.bbox.left_edge[1]) > d: # <<<<<<<<<<<<<< @@ -5201,7 +5765,7 @@ __pyx_t_1 = ((fabs(((__pyx_v_node->bbox.right_edge[1]) - (__pyx_v_node->bbox.left_edge[1]))) > __pyx_v_d) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":327 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":372 * node.bbox.left_edge[0]) * if fabs(node.bbox.right_edge[1] - node.bbox.left_edge[1]) > d: * ax = 1 # <<<<<<<<<<<<<< @@ -5210,7 +5774,7 @@ */ __pyx_v_ax = 1; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":326 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":371 * cdef np.float64_t d = fabs(node.bbox.right_edge[0] - * node.bbox.left_edge[0]) * if fabs(node.bbox.right_edge[1] - node.bbox.left_edge[1]) > d: # <<<<<<<<<<<<<< @@ -5219,7 +5783,7 @@ */ } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":328 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":373 * if fabs(node.bbox.right_edge[1] - node.bbox.left_edge[1]) > d: * ax = 1 * if fabs(node.bbox.right_edge[2] - node.bbox.left_edge[2]) > d: # <<<<<<<<<<<<<< @@ -5229,7 +5793,7 @@ __pyx_t_1 = ((fabs(((__pyx_v_node->bbox.right_edge[2]) - (__pyx_v_node->bbox.left_edge[2]))) > __pyx_v_d) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":329 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":374 * ax = 1 * if fabs(node.bbox.right_edge[2] - node.bbox.left_edge[2]) > d: * ax = 2 # <<<<<<<<<<<<<< @@ -5238,7 +5802,7 @@ */ __pyx_v_ax = 2; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":328 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":373 * if fabs(node.bbox.right_edge[1] - node.bbox.left_edge[1]) > d: * ax = 1 * if fabs(node.bbox.right_edge[2] - node.bbox.left_edge[2]) > d: # <<<<<<<<<<<<<< @@ -5247,7 +5811,7 @@ */ } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":332 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":377 * * # split in half along that dimension * cdef np.float64_t split = 0.5*(node.bbox.right_edge[ax] + # <<<<<<<<<<<<<< @@ -5256,7 +5820,7 @@ */ __pyx_v_split = (0.5 * ((__pyx_v_node->bbox.right_edge[__pyx_v_ax]) + (__pyx_v_node->bbox.left_edge[__pyx_v_ax]))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":336 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":381 * * # sort triangle list * cdef np.int64_t mid = self._partition(begin, end, ax, split) # <<<<<<<<<<<<<< @@ -5265,7 +5829,7 @@ */ __pyx_v_mid = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_partition(__pyx_v_self, __pyx_v_begin, __pyx_v_end, __pyx_v_ax, __pyx_v_split); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":338 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":383 * cdef np.int64_t mid = self._partition(begin, end, ax, split) * * if(mid == begin or mid == end): # <<<<<<<<<<<<<< @@ -5283,7 +5847,7 @@ __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":339 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":384 * * if(mid == begin or mid == end): * mid = begin + (end-begin)/2 # <<<<<<<<<<<<<< @@ -5292,7 +5856,7 @@ */ __pyx_v_mid = (__pyx_v_begin + ((__pyx_v_end - __pyx_v_begin) / 2)); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":338 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":383 * cdef np.int64_t mid = self._partition(begin, end, ax, split) * * if(mid == begin or mid == end): # <<<<<<<<<<<<<< @@ -5301,7 +5865,7 @@ */ } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":342 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":387 * * # recursively build sub-trees * node.left = self._recursive_build(begin, mid) # <<<<<<<<<<<<<< @@ -5310,7 +5874,7 @@ */ __pyx_v_node->left = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_recursive_build(__pyx_v_self, __pyx_v_begin, __pyx_v_mid); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":343 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":388 * # recursively build sub-trees * node.left = self._recursive_build(begin, mid) * node.right = self._recursive_build(mid, end) # <<<<<<<<<<<<<< @@ -5319,7 +5883,7 @@ */ __pyx_v_node->right = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self->__pyx_vtab)->_recursive_build(__pyx_v_self, __pyx_v_mid, __pyx_v_end); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":345 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":390 * node.right = self._recursive_build(mid, end) * * return node # <<<<<<<<<<<<<< @@ -5329,7 +5893,7 @@ __pyx_r = __pyx_v_node; goto __pyx_L0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":308 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":353 * @cython.wraparound(False) * @cython.cdivision(True) * cdef BVHNode* _recursive_build(self, np.int64_t begin, np.int64_t end) nogil: # <<<<<<<<<<<<<< @@ -5342,36 +5906,144 @@ return __pyx_r; } -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":351 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef void cast_rays(np.float64_t* image, # <<<<<<<<<<<<<< - * const np.float64_t* origins, - * const np.float64_t* direction, +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -static void __pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_cast_rays(__pyx_t_5numpy_float64_t *__pyx_v_image, __pyx_t_5numpy_float64_t const *__pyx_v_origins, __pyx_t_5numpy_float64_t const *__pyx_v_direction, int const __pyx_v_N, struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_bvh) { - struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *__pyx_v_ray; - int __pyx_v_i; - int __pyx_v_j; - int __pyx_v_k; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __pyx_t_5numpy_float64_t __pyx_t_5; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_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_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_4__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self)); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":360 - * cdef int i, j, k - * - * with nogil, parallel(): # <<<<<<<<<<<<<< - * + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__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_, 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("yt.utilities.lib.bounding_volume_hierarchy.BVH.__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_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_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_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_6__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__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__2, 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("yt.utilities.lib.bounding_volume_hierarchy.BVH.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":396 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void cast_rays(np.float64_t* image, # <<<<<<<<<<<<<< + * const np.float64_t* origins, + * const np.float64_t* direction, + */ + +static void __pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_cast_rays(__pyx_t_5numpy_float64_t *__pyx_v_image, __pyx_t_5numpy_float64_t const *__pyx_v_origins, __pyx_t_5numpy_float64_t const *__pyx_v_direction, int const __pyx_v_N, struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *__pyx_v_bvh) { + struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *__pyx_v_ray; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_v_k; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":405 + * cdef int i, j, k + * + * with nogil, parallel(): # <<<<<<<<<<<<<< + * * ray = malloc(sizeof(Ray)) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { { @@ -5389,7 +6061,7 @@ __pyx_v_k = ((int)0xbad0bad0); __pyx_v_ray = ((struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *)1); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":362 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":407 * with nogil, parallel(): * * ray = malloc(sizeof(Ray)) # <<<<<<<<<<<<<< @@ -5398,7 +6070,7 @@ */ __pyx_v_ray = ((struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *)malloc((sizeof(struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray)))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":364 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":409 * ray = malloc(sizeof(Ray)) * * for k in range(3): # <<<<<<<<<<<<<< @@ -5408,7 +6080,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_k = __pyx_t_1; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":365 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":410 * * for k in range(3): * ray.direction[k] = direction[k] # <<<<<<<<<<<<<< @@ -5417,7 +6089,7 @@ */ (__pyx_v_ray->direction[__pyx_v_k]) = (__pyx_v_direction[__pyx_v_k]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":366 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":411 * for k in range(3): * ray.direction[k] = direction[k] * ray.inv_dir[k] = 1.0 / direction[k] # <<<<<<<<<<<<<< @@ -5427,7 +6099,7 @@ (__pyx_v_ray->inv_dir[__pyx_v_k]) = (1.0 / (__pyx_v_direction[__pyx_v_k])); } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":368 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":413 * ray.inv_dir[k] = 1.0 / direction[k] * * for i in prange(N): # <<<<<<<<<<<<<< @@ -5449,7 +6121,7 @@ /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":369 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":414 * * for i in prange(N): * for j in range(3): # <<<<<<<<<<<<<< @@ -5459,7 +6131,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":370 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":415 * for i in prange(N): * for j in range(3): * ray.origin[j] = origins[N*j + i] # <<<<<<<<<<<<<< @@ -5469,7 +6141,7 @@ (__pyx_v_ray->origin[__pyx_v_j]) = (__pyx_v_origins[((__pyx_v_N * __pyx_v_j) + __pyx_v_i)]); } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":371 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":416 * for j in range(3): * ray.origin[j] = origins[N*j + i] * ray.t_far = INF # <<<<<<<<<<<<<< @@ -5478,7 +6150,7 @@ */ __pyx_v_ray->t_far = __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_INF; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":372 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":417 * ray.origin[j] = origins[N*j + i] * ray.t_far = INF * ray.t_near = 0.0 # <<<<<<<<<<<<<< @@ -5487,7 +6159,7 @@ */ __pyx_v_ray->t_near = 0.0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":373 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":418 * ray.t_far = INF * ray.t_near = 0.0 * ray.data_val = 0 # <<<<<<<<<<<<<< @@ -5496,7 +6168,7 @@ */ __pyx_v_ray->data_val = 0.0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":374 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":419 * ray.t_near = 0.0 * ray.data_val = 0 * ray.elem_id = -1 # <<<<<<<<<<<<<< @@ -5505,7 +6177,7 @@ */ __pyx_v_ray->elem_id = -1LL; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":375 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":420 * ray.data_val = 0 * ray.elem_id = -1 * bvh.intersect(ray) # <<<<<<<<<<<<<< @@ -5514,7 +6186,7 @@ */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_bvh->__pyx_vtab)->intersect(__pyx_v_bvh, __pyx_v_ray); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":376 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":421 * ray.elem_id = -1 * bvh.intersect(ray) * image[i] = ray.data_val # <<<<<<<<<<<<<< @@ -5528,7 +6200,7 @@ } } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":378 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":423 * image[i] = ray.data_val * * free(ray) # <<<<<<<<<<<<<< @@ -5546,7 +6218,7 @@ #endif } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":360 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":405 * cdef int i, j, k * * with nogil, parallel(): # <<<<<<<<<<<<<< @@ -5556,6 +6228,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; @@ -5564,7 +6237,7 @@ } } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":351 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":396 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void cast_rays(np.float64_t* image, # <<<<<<<<<<<<<< @@ -5575,7 +6248,7 @@ /* function exit code */ } -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":383 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":428 * @cython.wraparound(False) * @cython.cdivision(True) * def test_ray_trace(np.ndarray[np.float64_t, ndim=1] image, # <<<<<<<<<<<<<< @@ -5602,9 +6275,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -5613,24 +6290,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_origins)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_ray_trace", 1, 4, 4, 1); __PYX_ERR(0, 383, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("test_ray_trace", 1, 4, 4, 1); __PYX_ERR(0, 428, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_direction)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_ray_trace", 1, 4, 4, 2); __PYX_ERR(0, 383, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("test_ray_trace", 1, 4, 4, 2); __PYX_ERR(0, 428, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bvh)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_ray_trace", 1, 4, 4, 3); __PYX_ERR(0, 383, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("test_ray_trace", 1, 4, 4, 3); __PYX_ERR(0, 428, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_ray_trace") < 0)) __PYX_ERR(0, 383, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_ray_trace") < 0)) __PYX_ERR(0, 428, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -5647,16 +6327,16 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("test_ray_trace", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 383, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("test_ray_trace", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 428, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.bounding_volume_hierarchy.test_ray_trace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 383, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_origins), __pyx_ptype_5numpy_ndarray, 1, "origins", 0))) __PYX_ERR(0, 384, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_direction), __pyx_ptype_5numpy_ndarray, 1, "direction", 0))) __PYX_ERR(0, 385, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bvh), __pyx_ptype_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH, 1, "bvh", 0))) __PYX_ERR(0, 386, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 428, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_origins), __pyx_ptype_5numpy_ndarray, 1, "origins", 0))) __PYX_ERR(0, 429, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_direction), __pyx_ptype_5numpy_ndarray, 1, "direction", 0))) __PYX_ERR(0, 430, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bvh), __pyx_ptype_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH, 1, "bvh", 0))) __PYX_ERR(0, 431, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_test_ray_trace(__pyx_self, __pyx_v_image, __pyx_v_origins, __pyx_v_direction, __pyx_v_bvh); /* function exit code */ @@ -5697,21 +6377,21 @@ __pyx_pybuffernd_direction.rcbuffer = &__pyx_pybuffer_direction; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 383, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 428, __pyx_L1_error) } __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_origins.rcbuffer->pybuffer, (PyObject*)__pyx_v_origins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 383, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_origins.rcbuffer->pybuffer, (PyObject*)__pyx_v_origins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 428, __pyx_L1_error) } __pyx_pybuffernd_origins.diminfo[0].strides = __pyx_pybuffernd_origins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_origins.diminfo[0].shape = __pyx_pybuffernd_origins.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_origins.diminfo[1].strides = __pyx_pybuffernd_origins.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_origins.diminfo[1].shape = __pyx_pybuffernd_origins.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_direction.rcbuffer->pybuffer, (PyObject*)__pyx_v_direction, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 383, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_direction.rcbuffer->pybuffer, (PyObject*)__pyx_v_direction, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 428, __pyx_L1_error) } __pyx_pybuffernd_direction.diminfo[0].strides = __pyx_pybuffernd_direction.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_direction.diminfo[0].shape = __pyx_pybuffernd_direction.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":388 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":433 * BVH bvh): * * cdef int N = origins.shape[0] # <<<<<<<<<<<<<< @@ -5720,7 +6400,7 @@ */ __pyx_v_N = (__pyx_v_origins->dimensions[0]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":389 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":434 * * cdef int N = origins.shape[0] * cast_rays(&image[0], &origins[0, 0], &direction[0], N, bvh) # <<<<<<<<<<<<<< @@ -5733,7 +6413,7 @@ __pyx_t_4 = 0; __pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_cast_rays((&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_image.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_origins.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_origins.diminfo[0].strides, __pyx_t_3, __pyx_pybuffernd_origins.diminfo[1].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_direction.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_direction.diminfo[0].strides))), __pyx_v_N, __pyx_v_bvh); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":383 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":428 * @cython.wraparound(False) * @cython.cdivision(True) * def test_ray_trace(np.ndarray[np.float64_t, ndim=1] image, # <<<<<<<<<<<<<< @@ -5766,7 +6446,7 @@ return __pyx_r; } -/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":396 +/* "yt/utilities/lib/bounding_volume_hierarchy.pyx":441 * @cython.wraparound(False) * @cython.cdivision(True) * def __call__(self, # <<<<<<<<<<<<<< @@ -5794,7 +6474,9 @@ 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; } @@ -5803,6 +6485,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bvh)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_threads); @@ -5810,11 +6493,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 396, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 441, __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; @@ -5822,20 +6506,20 @@ } __pyx_v_bvh = ((struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)values[0]); if (values[1]) { - __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L3_error) + __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 443, __pyx_L3_error) } else { __pyx_v_num_threads = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 396, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 441, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.bounding_volume_hierarchy.BVHMeshSampler.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bvh), __pyx_ptype_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH, 1, "bvh", 0))) __PYX_ERR(0, 397, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bvh), __pyx_ptype_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH, 1, "bvh", 0))) __PYX_ERR(0, 442, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler___call__(((struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler *)__pyx_v_self), __pyx_v_bvh, __pyx_v_num_threads); /* function exit code */ @@ -5852,7 +6536,6 @@ int __pyx_v_vj; int __pyx_v_i; int __pyx_v_j; - struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *__pyx_v_im; __pyx_t_5numpy_float64_t *__pyx_v_v_pos; __pyx_t_5numpy_float64_t *__pyx_v_v_dir; __pyx_t_5numpy_int64_t __pyx_v_nx; @@ -5862,82 +6545,71 @@ struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *__pyx_v_ray; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *__pyx_t_1; - int __pyx_t_2; + int __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; __pyx_t_5numpy_int64_t __pyx_t_3; __pyx_t_5numpy_int64_t __pyx_t_4; - __pyx_t_5numpy_int64_t __pyx_t_5; - __pyx_t_5numpy_float64_t __pyx_t_6; + __pyx_t_5numpy_float64_t __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_t_5numpy_int64_t __pyx_t_10; + __pyx_t_5numpy_int64_t __pyx_t_9; + Py_ssize_t __pyx_t_10; Py_ssize_t __pyx_t_11; Py_ssize_t __pyx_t_12; Py_ssize_t __pyx_t_13; Py_ssize_t __pyx_t_14; Py_ssize_t __pyx_t_15; - Py_ssize_t __pyx_t_16; __Pyx_RefNannySetupContext("__call__", 0); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":407 - * - * cdef int vi, vj, i, j - * cdef ImageContainer *im = self.image # <<<<<<<<<<<<<< - * cdef np.float64_t *v_pos - * cdef np.float64_t *v_dir - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.image; - __pyx_v_im = __pyx_t_1; - - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":412 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":456 * cdef np.int64_t nx, ny, size * cdef np.float64_t width[3] * for i in range(3): # <<<<<<<<<<<<<< * width[i] = self.width[i] - * nx = im.nv[0] + * nx = self.nv[0] */ - for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":413 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":457 * cdef np.float64_t width[3] * for i in range(3): * width[i] = self.width[i] # <<<<<<<<<<<<<< - * nx = im.nv[0] - * ny = im.nv[1] + * nx = self.nv[0] + * ny = self.nv[1] */ (__pyx_v_width[__pyx_v_i]) = (__pyx_v_self->__pyx_base.width[__pyx_v_i]); } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":414 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":458 * for i in range(3): * width[i] = self.width[i] - * nx = im.nv[0] # <<<<<<<<<<<<<< - * ny = im.nv[1] + * nx = self.nv[0] # <<<<<<<<<<<<<< + * ny = self.nv[1] * size = nx * ny */ - __pyx_v_nx = (__pyx_v_im->nv[0]); + __pyx_v_nx = (__pyx_v_self->__pyx_base.nv[0]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":415 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":459 * width[i] = self.width[i] - * nx = im.nv[0] - * ny = im.nv[1] # <<<<<<<<<<<<<< + * nx = self.nv[0] + * ny = self.nv[1] # <<<<<<<<<<<<<< * size = nx * ny * cdef Ray* ray */ - __pyx_v_ny = (__pyx_v_im->nv[1]); + __pyx_v_ny = (__pyx_v_self->__pyx_base.nv[1]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":416 - * nx = im.nv[0] - * ny = im.nv[1] + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":460 + * nx = self.nv[0] + * ny = self.nv[1] * size = nx * ny # <<<<<<<<<<<<<< * cdef Ray* ray * with nogil, parallel(): */ __pyx_v_size = (__pyx_v_nx * __pyx_v_ny); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":418 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":462 * size = nx * ny * cdef Ray* ray * with nogil, parallel(): # <<<<<<<<<<<<<< @@ -5948,6 +6620,7 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { { @@ -5962,12 +6635,12 @@ #define unlikely(x) (x) #endif #ifdef _OPENMP - #pragma omp parallel private(__pyx_v_ray, __pyx_v_v_dir, __pyx_v_v_pos) private(__pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9) private(__pyx_filename, __pyx_lineno, __pyx_clineno) shared(__pyx_parallel_why, __pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb) + #pragma omp parallel private(__pyx_v_ray, __pyx_v_v_dir, __pyx_v_v_pos) private(__pyx_t_1, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9) private(__pyx_filename, __pyx_lineno, __pyx_clineno) shared(__pyx_parallel_why, __pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb) #endif /* _OPENMP */ { #ifdef _OPENMP #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif Py_BEGIN_ALLOW_THREADS #endif /* _OPENMP */ @@ -5976,7 +6649,7 @@ __pyx_v_v_dir = ((__pyx_t_5numpy_float64_t *)1); __pyx_v_v_pos = ((__pyx_t_5numpy_float64_t *)1); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":419 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":463 * cdef Ray* ray * with nogil, parallel(): * ray = malloc(sizeof(Ray)) # <<<<<<<<<<<<<< @@ -5985,7 +6658,7 @@ */ __pyx_v_ray = ((struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *)malloc((sizeof(struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray)))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":420 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":464 * with nogil, parallel(): * ray = malloc(sizeof(Ray)) * v_pos = malloc(3 * sizeof(np.float64_t)) # <<<<<<<<<<<<<< @@ -5994,7 +6667,7 @@ */ __pyx_v_v_pos = ((__pyx_t_5numpy_float64_t *)malloc((3 * (sizeof(__pyx_t_5numpy_float64_t))))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":421 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":465 * ray = malloc(sizeof(Ray)) * v_pos = malloc(3 * sizeof(np.float64_t)) * v_dir = malloc(3 * sizeof(np.float64_t)) # <<<<<<<<<<<<<< @@ -6003,40 +6676,40 @@ */ __pyx_v_v_dir = ((__pyx_t_5numpy_float64_t *)malloc((3 * (sizeof(__pyx_t_5numpy_float64_t))))); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":422 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":466 * v_pos = malloc(3 * sizeof(np.float64_t)) * v_dir = malloc(3 * sizeof(np.float64_t)) * for j in prange(size): # <<<<<<<<<<<<<< * vj = j % ny * vi = (j - vj) / ny */ - __pyx_t_3 = __pyx_v_size; + __pyx_t_2 = __pyx_v_size; if (1 == 0) abort(); { - int __pyx_parallel_temp0 = 0xbad0bad0; - int __pyx_parallel_temp1 = 0xbad0bad0; - int __pyx_parallel_temp2 = 0xbad0bad0; - int __pyx_parallel_temp3 = 0xbad0bad0; + int __pyx_parallel_temp0 = ((int)0xbad0bad0); + int __pyx_parallel_temp1 = ((int)0xbad0bad0); + int __pyx_parallel_temp2 = ((int)0xbad0bad0); + int __pyx_parallel_temp3 = ((int)0xbad0bad0); const char *__pyx_parallel_filename = NULL; int __pyx_parallel_lineno = 0, __pyx_parallel_clineno = 0; PyObject *__pyx_parallel_exc_type = NULL, *__pyx_parallel_exc_value = NULL, *__pyx_parallel_exc_tb = NULL; int __pyx_parallel_why; __pyx_parallel_why = 0; - __pyx_t_5 = (__pyx_t_3 - 0 + 1 - 1/abs(1)) / 1; - if (__pyx_t_5 > 0) + __pyx_t_4 = (__pyx_t_2 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_4 > 0) { #ifdef _OPENMP #pragma omp for lastprivate(__pyx_v_i) firstprivate(__pyx_v_j) lastprivate(__pyx_v_j) lastprivate(__pyx_v_vi) lastprivate(__pyx_v_vj) #endif /* _OPENMP */ - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4++){ + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_4; __pyx_t_3++){ if (__pyx_parallel_why < 2) { - __pyx_v_j = (int)(0 + 1 * __pyx_t_4); + __pyx_v_j = (int)(0 + 1 * __pyx_t_3); /* Initialize private variables to invalid values */ __pyx_v_i = ((int)0xbad0bad0); __pyx_v_vi = ((int)0xbad0bad0); __pyx_v_vj = ((int)0xbad0bad0); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":423 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":467 * v_dir = malloc(3 * sizeof(np.float64_t)) * for j in prange(size): * vj = j % ny # <<<<<<<<<<<<<< @@ -6045,45 +6718,45 @@ */ __pyx_v_vj = (__pyx_v_j % __pyx_v_ny); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":424 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":468 * for j in prange(size): * vj = j % ny * vi = (j - vj) / ny # <<<<<<<<<<<<<< * vj = vj - * self.vector_function(im, vi, vj, width, v_dir, v_pos) + * self.vector_function(self, vi, vj, width, v_dir, v_pos) */ __pyx_v_vi = ((__pyx_v_j - __pyx_v_vj) / __pyx_v_ny); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":425 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":469 * vj = j % ny * vi = (j - vj) / ny * vj = vj # <<<<<<<<<<<<<< - * self.vector_function(im, vi, vj, width, v_dir, v_pos) + * self.vector_function(self, vi, vj, width, v_dir, v_pos) * for i in range(3): */ - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":426 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":470 * vi = (j - vj) / ny * vj = vj - * self.vector_function(im, vi, vj, width, v_dir, v_pos) # <<<<<<<<<<<<<< + * self.vector_function(self, vi, vj, width, v_dir, v_pos) # <<<<<<<<<<<<<< * for i in range(3): * ray.origin[i] = v_pos[i] */ - __pyx_v_self->__pyx_base.vector_function(__pyx_v_im, __pyx_v_vi, __pyx_v_vj, __pyx_v_width, __pyx_v_v_dir, __pyx_v_v_pos); + __pyx_v_self->__pyx_base.vector_function(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *)__pyx_v_self), __pyx_v_vi, __pyx_v_vj, __pyx_v_width, __pyx_v_v_dir, __pyx_v_v_pos); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":427 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":471 * vj = vj - * self.vector_function(im, vi, vj, width, v_dir, v_pos) + * self.vector_function(self, vi, vj, width, v_dir, v_pos) * for i in range(3): # <<<<<<<<<<<<<< * ray.origin[i] = v_pos[i] * ray.direction[i] = v_dir[i] */ - for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":428 - * self.vector_function(im, vi, vj, width, v_dir, v_pos) + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":472 + * self.vector_function(self, vi, vj, width, v_dir, v_pos) * for i in range(3): * ray.origin[i] = v_pos[i] # <<<<<<<<<<<<<< * ray.direction[i] = v_dir[i] @@ -6091,7 +6764,7 @@ */ (__pyx_v_ray->origin[__pyx_v_i]) = (__pyx_v_v_pos[__pyx_v_i]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":429 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":473 * for i in range(3): * ray.origin[i] = v_pos[i] * ray.direction[i] = v_dir[i] # <<<<<<<<<<<<<< @@ -6100,7 +6773,7 @@ */ (__pyx_v_ray->direction[__pyx_v_i]) = (__pyx_v_v_dir[__pyx_v_i]); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":430 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":474 * ray.origin[i] = v_pos[i] * ray.direction[i] = v_dir[i] * ray.inv_dir[i] = 1.0 / v_dir[i] # <<<<<<<<<<<<<< @@ -6110,7 +6783,7 @@ (__pyx_v_ray->inv_dir[__pyx_v_i]) = (1.0 / (__pyx_v_v_dir[__pyx_v_i])); } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":431 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":475 * ray.direction[i] = v_dir[i] * ray.inv_dir[i] = 1.0 / v_dir[i] * ray.t_far = 1e37 # <<<<<<<<<<<<<< @@ -6119,7 +6792,7 @@ */ __pyx_v_ray->t_far = 1e37; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":432 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":476 * ray.inv_dir[i] = 1.0 / v_dir[i] * ray.t_far = 1e37 * ray.t_near = 0.0 # <<<<<<<<<<<<<< @@ -6128,7 +6801,7 @@ */ __pyx_v_ray->t_near = 0.0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":433 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":477 * ray.t_far = 1e37 * ray.t_near = 0.0 * ray.data_val = 0 # <<<<<<<<<<<<<< @@ -6137,81 +6810,81 @@ */ __pyx_v_ray->data_val = 0.0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":434 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":478 * ray.t_near = 0.0 * ray.data_val = 0 * ray.elem_id = -1 # <<<<<<<<<<<<<< * bvh.intersect(ray) - * im.image[vi, vj, 0] = ray.data_val + * self.image[vi, vj, 0] = ray.data_val */ __pyx_v_ray->elem_id = -1LL; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":435 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":479 * ray.data_val = 0 * ray.elem_id = -1 * bvh.intersect(ray) # <<<<<<<<<<<<<< - * im.image[vi, vj, 0] = ray.data_val - * im.image_used[vi, vj] = ray.elem_id + * self.image[vi, vj, 0] = ray.data_val + * self.image_used[vi, vj] = ray.elem_id */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)__pyx_v_bvh->__pyx_vtab)->intersect(__pyx_v_bvh, __pyx_v_ray); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":436 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":480 * ray.elem_id = -1 * bvh.intersect(ray) - * im.image[vi, vj, 0] = ray.data_val # <<<<<<<<<<<<<< - * im.image_used[vi, vj] = ray.elem_id - * im.mesh_lines[vi, vj] = ray.near_boundary - */ - __pyx_t_6 = __pyx_v_ray->data_val; - if (unlikely(!__pyx_v_im->image.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 436, __pyx_L14_error)} - __pyx_t_7 = __pyx_v_vi; - __pyx_t_8 = __pyx_v_vj; - __pyx_t_9 = 0; - *((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->image.data + __pyx_t_7 * __pyx_v_im->image.strides[0]) ) + __pyx_t_8 * __pyx_v_im->image.strides[1]) ) + __pyx_t_9 * __pyx_v_im->image.strides[2]) )) = __pyx_t_6; + * self.image[vi, vj, 0] = ray.data_val # <<<<<<<<<<<<<< + * self.image_used[vi, vj] = ray.elem_id + * self.mesh_lines[vi, vj] = ray.near_boundary + */ + __pyx_t_5 = __pyx_v_ray->data_val; + if (unlikely(!__pyx_v_self->__pyx_base.image.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 480, __pyx_L14_error)} + __pyx_t_6 = __pyx_v_vi; + __pyx_t_7 = __pyx_v_vj; + __pyx_t_8 = 0; + *((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->__pyx_base.image.data + __pyx_t_6 * __pyx_v_self->__pyx_base.image.strides[0]) ) + __pyx_t_7 * __pyx_v_self->__pyx_base.image.strides[1]) ) + __pyx_t_8 * __pyx_v_self->__pyx_base.image.strides[2]) )) = __pyx_t_5; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":437 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":481 * bvh.intersect(ray) - * im.image[vi, vj, 0] = ray.data_val - * im.image_used[vi, vj] = ray.elem_id # <<<<<<<<<<<<<< - * im.mesh_lines[vi, vj] = ray.near_boundary - * im.zbuffer[vi, vj] = ray.t_far - */ - __pyx_t_10 = __pyx_v_ray->elem_id; - if (unlikely(!__pyx_v_im->image_used.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 437, __pyx_L14_error)} - __pyx_t_11 = __pyx_v_vi; - __pyx_t_12 = __pyx_v_vj; - *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->image_used.data + __pyx_t_11 * __pyx_v_im->image_used.strides[0]) ) + __pyx_t_12 * __pyx_v_im->image_used.strides[1]) )) = __pyx_t_10; - - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":438 - * im.image[vi, vj, 0] = ray.data_val - * im.image_used[vi, vj] = ray.elem_id - * im.mesh_lines[vi, vj] = ray.near_boundary # <<<<<<<<<<<<<< - * im.zbuffer[vi, vj] = ray.t_far + * self.image[vi, vj, 0] = ray.data_val + * self.image_used[vi, vj] = ray.elem_id # <<<<<<<<<<<<<< + * self.mesh_lines[vi, vj] = ray.near_boundary + * self.zbuffer[vi, vj] = ray.t_far + */ + __pyx_t_9 = __pyx_v_ray->elem_id; + if (unlikely(!__pyx_v_self->__pyx_base.image_used.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 481, __pyx_L14_error)} + __pyx_t_10 = __pyx_v_vi; + __pyx_t_11 = __pyx_v_vj; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->__pyx_base.image_used.data + __pyx_t_10 * __pyx_v_self->__pyx_base.image_used.strides[0]) ) + __pyx_t_11 * __pyx_v_self->__pyx_base.image_used.strides[1]) )) = __pyx_t_9; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":482 + * self.image[vi, vj, 0] = ray.data_val + * self.image_used[vi, vj] = ray.elem_id + * self.mesh_lines[vi, vj] = ray.near_boundary # <<<<<<<<<<<<<< + * self.zbuffer[vi, vj] = ray.t_far * free(v_pos) */ - __pyx_t_10 = __pyx_v_ray->near_boundary; - if (unlikely(!__pyx_v_im->mesh_lines.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 438, __pyx_L14_error)} - __pyx_t_13 = __pyx_v_vi; - __pyx_t_14 = __pyx_v_vj; - *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->mesh_lines.data + __pyx_t_13 * __pyx_v_im->mesh_lines.strides[0]) ) + __pyx_t_14 * __pyx_v_im->mesh_lines.strides[1]) )) = __pyx_t_10; - - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":439 - * im.image_used[vi, vj] = ray.elem_id - * im.mesh_lines[vi, vj] = ray.near_boundary - * im.zbuffer[vi, vj] = ray.t_far # <<<<<<<<<<<<<< + __pyx_t_9 = __pyx_v_ray->near_boundary; + if (unlikely(!__pyx_v_self->__pyx_base.mesh_lines.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 482, __pyx_L14_error)} + __pyx_t_12 = __pyx_v_vi; + __pyx_t_13 = __pyx_v_vj; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->__pyx_base.mesh_lines.data + __pyx_t_12 * __pyx_v_self->__pyx_base.mesh_lines.strides[0]) ) + __pyx_t_13 * __pyx_v_self->__pyx_base.mesh_lines.strides[1]) )) = __pyx_t_9; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":483 + * self.image_used[vi, vj] = ray.elem_id + * self.mesh_lines[vi, vj] = ray.near_boundary + * self.zbuffer[vi, vj] = ray.t_far # <<<<<<<<<<<<<< * free(v_pos) * free(v_dir) */ - __pyx_t_6 = __pyx_v_ray->t_far; - if (unlikely(!__pyx_v_im->zbuffer.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 439, __pyx_L14_error)} - __pyx_t_15 = __pyx_v_vi; - __pyx_t_16 = __pyx_v_vj; - *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->zbuffer.data + __pyx_t_15 * __pyx_v_im->zbuffer.strides[0]) ) + __pyx_t_16 * __pyx_v_im->zbuffer.strides[1]) )) = __pyx_t_6; + __pyx_t_5 = __pyx_v_ray->t_far; + if (unlikely(!__pyx_v_self->__pyx_base.zbuffer.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 483, __pyx_L14_error)} + __pyx_t_14 = __pyx_v_vi; + __pyx_t_15 = __pyx_v_vj; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->__pyx_base.zbuffer.data + __pyx_t_14 * __pyx_v_self->__pyx_base.zbuffer.strides[0]) ) + __pyx_t_15 * __pyx_v_self->__pyx_base.zbuffer.strides[1]) )) = __pyx_t_5; goto __pyx_L19; __pyx_L14_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif #ifdef _OPENMP #pragma omp flush(__pyx_parallel_exc_type) @@ -6222,7 +6895,7 @@ __Pyx_GOTREF(__pyx_parallel_exc_type); } #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_parallel_why = 4; @@ -6257,13 +6930,13 @@ case 4: { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_GIVEREF(__pyx_parallel_exc_type); __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb); __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno; #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } goto __pyx_L10_error; @@ -6271,24 +6944,24 @@ } } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":440 - * im.mesh_lines[vi, vj] = ray.near_boundary - * im.zbuffer[vi, vj] = ray.t_far + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":484 + * self.mesh_lines[vi, vj] = ray.near_boundary + * self.zbuffer[vi, vj] = ray.t_far * free(v_pos) # <<<<<<<<<<<<<< * free(v_dir) * free(ray) */ free(__pyx_v_v_pos); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":441 - * im.zbuffer[vi, vj] = ray.t_far + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":485 + * self.zbuffer[vi, vj] = ray.t_far * free(v_pos) * free(v_dir) # <<<<<<<<<<<<<< * free(ray) */ free(__pyx_v_v_dir); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":442 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":486 * free(v_pos) * free(v_dir) * free(ray) # <<<<<<<<<<<<<< @@ -6298,7 +6971,7 @@ __pyx_L10_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif #ifdef _OPENMP #pragma omp flush(__pyx_parallel_exc_type) @@ -6309,7 +6982,7 @@ __Pyx_GOTREF(__pyx_parallel_exc_type); } #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_parallel_why = 4; @@ -6320,12 +6993,12 @@ #else { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif #endif /* _OPENMP */ /* Clean up any temporaries */ #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif #ifndef _OPENMP } @@ -6340,13 +7013,13 @@ case 4: { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_GIVEREF(__pyx_parallel_exc_type); __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb); __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno; #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } goto __pyx_L6_error; @@ -6361,7 +7034,7 @@ #endif } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":418 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":462 * size = nx * ny * cdef Ray* ray * with nogil, parallel(): # <<<<<<<<<<<<<< @@ -6371,12 +7044,14 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L7; } __pyx_L6_error: { #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; @@ -6385,7 +7060,7 @@ } } - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":396 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":441 * @cython.wraparound(False) * @cython.cdivision(True) * def __call__(self, # <<<<<<<<<<<<<< @@ -6405,516 +7080,228 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler_3__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_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler *)__pyx_v_self)); - /* "yt/utilities/lib/fp_utils.pxd":20 - * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * - */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: +static PyObject *__pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler *__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.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, 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) - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ - __pyx_L0:; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.bounding_volume_hierarchy.BVHMeshSampler.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler_5__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_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "yt/utilities/lib/fp_utils.pxd":24 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 - * - */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< - * - * cdef inline int imin(int i0, int i1) nogil: +static PyObject *__pyx_pf_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler *__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.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, 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) - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") */ /* function exit code */ - __pyx_L0:; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.bounding_volume_hierarchy.BVHMeshSampler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 +/* "volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { int __pyx_r; - int __pyx_t_1; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("vc_index", 0); - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "volume_container.pxd":31 * - */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): + * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): */ - __pyx_r = __pyx_v_i1; + __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 */ /* function exit code */ __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 +/* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { + int __pyx_v_index[3]; + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + __Pyx_RefNannySetupContext("vc_pos_index", 0); - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "volume_container.pxd":36 + * cdef int index[3] + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "volume_container.pxd":37 + * cdef int i + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< + * return vc_index(vc, index[0], index[1], index[2]) * */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); } - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "volume_container.pxd":38 + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_r = __pyx_v_f1; + __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i */ /* function exit code */ __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 +/* "vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) { + float __pyx_r; - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 + /* "vec3_ops.pxd":11 + * cdef inline cython.floating dot(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< * - */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); - if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":40 - * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i - */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * - */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i - */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * - */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fclip(np.float64_t f, - */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; - - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 - */ - -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":54 - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * - */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * - */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] - */ - -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; - - /* "vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); + __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); goto __pyx_L0; /* "vec3_ops.pxd":9 @@ -7333,102 +7720,6 @@ return __pyx_r; } -/* "volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("vc_index", 0); - - /* "volume_container.pxd":31 - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): - * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): - */ - __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); - goto __pyx_L0; - - /* "volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { - int __pyx_v_index[3]; - int __pyx_v_i; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("vc_pos_index", 0); - - /* "volume_container.pxd":36 - * cdef int index[3] - * cdef int i - * for i in range(3): # <<<<<<<<<<<<<< - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "volume_container.pxd":37 - * cdef int i - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< - * return vc_index(vc, index[0], index[1], index[2]) - * - */ - (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); - } - - /* "volume_container.pxd":38 - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< - * - */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); - goto __pyx_L0; - - /* "volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. @@ -7598,11 +7889,11 @@ * * 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, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + __PYX_ERR(2, 218, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 @@ -7654,11 +7945,11 @@ * * 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, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + __PYX_ERR(2, 222, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") @@ -7963,11 +8254,11 @@ * 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, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + __PYX_ERR(2, 259, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: @@ -8174,22 +8465,22 @@ * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) + __PYX_ERR(2, 278, __pyx_L1_error) break; } @@ -8256,7 +8547,7 @@ * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 @@ -8415,7 +8706,7 @@ * 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, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8462,7 +8753,7 @@ * 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, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8509,7 +8800,7 @@ * 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, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8556,7 +8847,7 @@ * 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, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8603,7 +8894,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8684,15 +8975,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) + __PYX_ERR(2, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + __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, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -8707,11 +8998,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) + __PYX_ERR(2, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -8732,7 +9023,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __pyx_L1_error) + __PYX_ERR(2, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -8740,15 +9031,15 @@ __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, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -8761,12 +9052,12 @@ * 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, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -8778,11 +9069,11 @@ * * 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, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) + __PYX_ERR(2, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -8846,11 +9137,11 @@ * # 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, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __PYX_ERR(2, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -8869,11 +9160,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -8933,7 +9224,7 @@ * 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, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -8955,11 +9246,11 @@ * * # 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, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __PYX_ERR(2, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -8977,11 +9268,11 @@ * 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, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -8995,11 +9286,11 @@ * 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, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -9013,11 +9304,11 @@ * 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, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -9031,11 +9322,11 @@ * 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, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -9049,11 +9340,11 @@ * 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, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -9067,11 +9358,11 @@ * 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, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -9085,11 +9376,11 @@ * 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, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -9103,11 +9394,11 @@ * 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, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -9121,11 +9412,11 @@ * 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, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -9139,11 +9430,11 @@ * 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, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -9157,11 +9448,11 @@ * 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, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -9175,11 +9466,11 @@ * 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, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -9193,11 +9484,11 @@ * 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, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -9211,11 +9502,11 @@ * 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, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -9231,11 +9522,11 @@ * 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, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -9251,11 +9542,11 @@ * 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, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -9271,11 +9562,11 @@ * 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, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -9290,19 +9581,19 @@ * 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, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) + __PYX_ERR(2, 844, __pyx_L1_error) } __pyx_L15:; @@ -9333,7 +9624,7 @@ * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; @@ -9597,7 +9888,7 @@ * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 * # Cython code. @@ -9610,7 +9901,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -9624,7 +9915,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -9636,11 +9927,11 @@ * * 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, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) + __PYX_ERR(2, 989, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -9658,7 +9949,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -9728,7 +10019,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * @@ -9741,7 +10032,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -9755,7 +10046,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -9767,11 +10058,11 @@ * * 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, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) + __PYX_ERR(2, 995, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -9789,7 +10080,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -9859,7 +10150,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * @@ -9872,7 +10163,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -9885,7 +10176,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -9895,11 +10186,11 @@ * 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, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) + __PYX_ERR(2, 1001, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -9917,7 +10208,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -9971,10 +10262,15 @@ 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; } @@ -9983,21 +10279,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -10005,12 +10305,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -10019,11 +10321,11 @@ } } __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, 120, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) } else { /* "View.MemoryView":121 @@ -10038,15 +10340,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __pyx_L1_error) } __pyx_r = __pyx_array___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); @@ -10097,9 +10399,9 @@ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(2, 127, __pyx_L1_error) + __PYX_ERR(1, 127, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 @@ -10128,11 +10430,11 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 131, __pyx_L1_error) + __PYX_ERR(1, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize @@ -10160,11 +10462,11 @@ * * 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, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 134, __pyx_L1_error) + __PYX_ERR(1, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") @@ -10193,9 +10495,9 @@ * 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, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -10217,7 +10519,7 @@ * 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, 138, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) __pyx_t_5 = __pyx_v_format; __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -10233,7 +10535,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -10271,11 +10573,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 146, __pyx_L1_error) + __PYX_ERR(1, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim @@ -10298,12 +10600,12 @@ 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, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dim = __pyx_t_8; __pyx_v_idx = __pyx_t_7; @@ -10326,11 +10628,11 @@ * self._shape[idx] = dim * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); @@ -10338,20 +10640,20 @@ 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, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(2, 151, __pyx_L1_error) + __PYX_ERR(1, 151, __pyx_L1_error) /* "View.MemoryView":150 * @@ -10388,7 +10690,7 @@ * 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, 155, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":156 @@ -10430,7 +10732,7 @@ * 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, 158, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":159 @@ -10473,19 +10775,19 @@ * 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, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 162, __pyx_L1_error) + __PYX_ERR(1, 162, __pyx_L1_error) } __pyx_L10:; @@ -10514,8 +10816,8 @@ * if allocate_buffer: * */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; @@ -10555,11 +10857,11 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 174, __pyx_L1_error) + __PYX_ERR(1, 174, __pyx_L1_error) /* "View.MemoryView":173 * @@ -10598,11 +10900,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __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, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { @@ -10723,7 +11025,7 @@ * 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, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -10753,7 +11055,7 @@ * 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, 187, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { @@ -10793,11 +11095,11 @@ * 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, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 190, __pyx_L1_error) + __PYX_ERR(1, 190, __pyx_L1_error) /* "View.MemoryView":189 * elif self.mode == u"fortran": @@ -11137,7 +11439,7 @@ * @cname('get_memview') */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11196,11 +11498,11 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -11211,7 +11513,7 @@ 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, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -11275,9 +11577,9 @@ * 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, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -11340,9 +11642,9 @@ * 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, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -11403,9 +11705,9 @@ * * */ - __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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":235 @@ -11428,11 +11730,118 @@ return __pyx_r; } -/* "View.MemoryView":240 - * - * @cname("__pyx_array_new") - * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< - * char *mode, char *buf): +/* "(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__20, 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__21, 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":240 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): * cdef array result */ @@ -11464,13 +11873,13 @@ * 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, 245, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -11484,7 +11893,7 @@ __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, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -11508,13 +11917,13 @@ * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -11536,9 +11945,9 @@ * result.data = buf * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) /* "View.MemoryView":247 * result = array(shape, itemsize, format, mode.decode('ASCII')) @@ -11547,7 +11956,7 @@ * 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, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11623,6 +12032,7 @@ 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; } @@ -11633,7 +12043,7 @@ 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, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -11644,7 +12054,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -11742,6 +12152,293 @@ 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":294 * * @cname('__pyx_align_pointer') @@ -11850,8 +12547,11 @@ 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; } @@ -11860,11 +12560,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -11872,11 +12574,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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; @@ -11884,16 +12587,16 @@ } } __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, 341, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -11964,7 +12667,7 @@ * 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 == -1)) __PYX_ERR(2, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) /* "View.MemoryView":346 * if type(self) is memoryview or obj is not None: @@ -12085,7 +12788,7 @@ * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) /* "View.MemoryView":356 * if self.lock is NULL: @@ -12426,26 +13129,26 @@ __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, 389, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -12455,7 +13158,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 389, __pyx_L1_error) + else __PYX_ERR(1, 389, __pyx_L1_error) } break; } @@ -12473,8 +13176,8 @@ * * 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, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":389 @@ -12591,7 +13294,7 @@ * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -12603,7 +13306,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 399, __pyx_L1_error) + __PYX_ERR(1, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -12611,14 +13314,14 @@ __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, 399, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; @@ -12632,7 +13335,7 @@ * 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, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":403 @@ -12643,7 +13346,7 @@ * 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, 403, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -12666,7 +13369,7 @@ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 405, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":406 @@ -12677,7 +13380,7 @@ * 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, 406, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -12747,7 +13450,7 @@ * * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __pyx_L1_error) + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; @@ -12759,7 +13462,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 409, __pyx_L1_error) + __PYX_ERR(1, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); @@ -12767,14 +13470,14 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; @@ -12788,7 +13491,7 @@ * obj = self.is_slice(value) * if obj: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":412 @@ -12798,7 +13501,7 @@ * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 412, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; @@ -12810,7 +13513,7 @@ * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":414 @@ -12820,9 +13523,9 @@ * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -12845,10 +13548,10 @@ * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 416, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12873,7 +13576,7 @@ * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 418, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -12961,7 +13664,7 @@ * 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, 423, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":424 @@ -12971,7 +13674,7 @@ * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":423 @@ -12981,7 +13684,7 @@ * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -12992,7 +13695,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, 423, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -13009,7 +13712,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -13026,7 +13729,7 @@ __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, 425, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); @@ -13069,7 +13772,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -13141,7 +13844,7 @@ * 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, 434, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":435 * @@ -13150,7 +13853,7 @@ * 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, 435, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) /* "View.MemoryView":436 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], @@ -13159,13 +13862,13 @@ * * 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, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":434 @@ -13175,7 +13878,7 @@ * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 434, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":430 * return obj @@ -13281,7 +13984,7 @@ * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) /* "View.MemoryView":449 * if self.view.itemsize > sizeof(array): @@ -13369,7 +14072,7 @@ * */ /*else*/ { - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 459, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 459, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -13392,7 +14095,7 @@ * 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, 464, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -13507,7 +14210,7 @@ * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 471, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":472 @@ -13517,7 +14220,7 @@ * * 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, 472, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -13576,7 +14279,7 @@ * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -13588,7 +14291,7 @@ * 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, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -13616,9 +14319,9 @@ * 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, 482, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -13635,7 +14338,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -13644,14 +14347,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -13662,7 +14365,7 @@ __Pyx_GIVEREF(__pyx_v_bytesitem); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -13699,7 +14402,7 @@ * */ __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, 487, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -13741,13 +14444,13 @@ * raise ValueError("Unable to convert item to object") * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); @@ -13759,11 +14462,11 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 484, __pyx_L5_except_error) + __PYX_ERR(1, 484, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -13854,7 +14557,7 @@ * 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, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -13877,26 +14580,26 @@ * 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, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 499, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -13918,9 +14621,9 @@ * 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, 501, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -13937,7 +14640,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -13946,14 +14649,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -13964,12 +14667,12 @@ __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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, 501, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 501, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } @@ -13985,7 +14688,7 @@ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(2, 503, __pyx_L1_error) + __PYX_ERR(1, 503, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -14372,9 +15075,9 @@ * 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, 540, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; @@ -14385,7 +15088,7 @@ * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) /* "View.MemoryView":542 * cdef _memoryviewslice result = memoryview_copy(self) @@ -14512,18 +15215,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { __pyx_t_2 = __pyx_t_4; __pyx_v_length = (__pyx_t_2[0]); - __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; @@ -14600,11 +15303,11 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 556, __pyx_L1_error) + __PYX_ERR(1, 556, __pyx_L1_error) /* "View.MemoryView":554 * @property @@ -14623,18 +15326,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; __pyx_v_stride = (__pyx_t_3[0]); - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; @@ -14712,9 +15415,9 @@ * 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, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__18, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__24, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -14738,18 +15441,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -14811,7 +15514,7 @@ * @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, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14871,7 +15574,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14933,11 +15636,11 @@ * @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, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15031,7 +15734,7 @@ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; - __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; @@ -15043,7 +15746,7 @@ * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; @@ -15221,12 +15924,12 @@ * */ __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, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15237,12 +15940,12 @@ * * def __str__(self): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15253,7 +15956,7 @@ * id(self)) * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -15261,7 +15964,7 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -15325,20 +16028,20 @@ * */ __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, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -15411,7 +16114,7 @@ * 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, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -15482,7 +16185,7 @@ * 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, 615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -15562,7 +16265,7 @@ * 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, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":627 @@ -15573,7 +16276,7 @@ * 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, 627, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -15654,7 +16357,7 @@ * 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, 634, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":639 @@ -15665,7 +16368,7 @@ * */ __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, 639, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -15690,57 +16393,164 @@ return __pyx_r; } -/* "View.MemoryView":643 - * - * @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 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -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; +/* 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; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "View.MemoryView":644 - * @cname('__pyx_memoryview_new') - * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): - * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< - * result.typeinfo = typeinfo - * return result + /* "(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_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_o); - __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, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) - /* "View.MemoryView":645 - * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): - * cdef memoryview result = memoryview(o, flags, dtype_is_object) - * result.typeinfo = typeinfo # <<<<<<<<<<<<<< - * return result - * + /* "(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__26, 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":643 + * + * @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":644 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __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, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":645 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * */ __pyx_v_result->typeinfo = __pyx_v_typeinfo; @@ -15866,7 +16676,7 @@ * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -15904,7 +16714,7 @@ * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -15940,26 +16750,26 @@ __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, 665, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -15969,7 +16779,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 665, __pyx_L1_error) + else __PYX_ERR(1, 665, __pyx_L1_error) } break; } @@ -15979,7 +16789,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, 665, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -16013,17 +16823,17 @@ * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 668, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__19); - __Pyx_GIVEREF(__pyx_slice__19); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__19); + __Pyx_INCREF(__pyx_slice__27); + __Pyx_GIVEREF(__pyx_slice__27); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__27); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":669 @@ -16053,7 +16863,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__20); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__28); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) } __pyx_L7:; @@ -16103,19 +16913,19 @@ * * 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, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(2, 675, __pyx_L1_error) + __PYX_ERR(1, 675, __pyx_L1_error) /* "View.MemoryView":674 * have_slices = True @@ -16152,7 +16962,7 @@ * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) } __pyx_L6:; @@ -16174,7 +16984,7 @@ * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":681 @@ -16194,16 +17004,16 @@ * * 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, 682, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__21); - __Pyx_GIVEREF(__pyx_slice__21); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__21); + __Pyx_INCREF(__pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__29); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":681 @@ -16225,20 +17035,20 @@ __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, 684, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -16324,11 +17134,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 689, __pyx_L1_error) + __PYX_ERR(1, 689, __pyx_L1_error) /* "View.MemoryView":688 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): @@ -16432,7 +17242,7 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(2, 708, __pyx_L1_error) + __PYX_ERR(1, 708, __pyx_L1_error) } } #endif @@ -16455,7 +17265,7 @@ * 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, 711, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -16551,26 +17361,26 @@ __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, 732, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -16580,7 +17390,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 732, __pyx_L1_error) + else __PYX_ERR(1, 732, __pyx_L1_error) } break; } @@ -16608,7 +17418,7 @@ * 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, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) /* "View.MemoryView":734 * for dim, index in enumerate(indices): @@ -16617,7 +17427,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 734, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) /* "View.MemoryView":733 * @@ -16694,13 +17504,13 @@ * 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, 746, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -16716,13 +17526,13 @@ * 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, 747, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -16738,13 +17548,13 @@ * * 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, 748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -16760,7 +17570,7 @@ * 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, 750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -16773,7 +17583,7 @@ * 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, 751, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -16786,7 +17596,7 @@ * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -16799,7 +17609,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 754, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) /* "View.MemoryView":760 * have_start, have_stop, have_step, @@ -16849,7 +17659,7 @@ * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } /* "View.MemoryView":765 * return memoryview_fromslice(dst, new_ndim, @@ -16858,7 +17668,7 @@ * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } /* "View.MemoryView":763 * @@ -16867,9 +17677,9 @@ * 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, 763, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -16900,7 +17710,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 768, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":768 @@ -16910,7 +17720,7 @@ * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -17013,7 +17823,7 @@ * 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 == -1)) __PYX_ERR(2, 818, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: @@ -17078,7 +17888,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) /* "View.MemoryView":823 * negative_step = have_step != 0 and step < 0 @@ -17650,7 +18460,7 @@ * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) } __pyx_L26:; @@ -17707,11 +18517,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -17779,11 +18589,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __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, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); @@ -17891,22 +18701,22 @@ * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 914, __pyx_L1_error) + __PYX_ERR(1, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: @@ -17943,22 +18753,22 @@ * * resultp = bufp + index * stride */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 917, __pyx_L1_error) + __PYX_ERR(1, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) @@ -18158,7 +18968,7 @@ * * return 1 */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error) + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] @@ -18192,11 +19002,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -18281,7 +19091,7 @@ * 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, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -18305,7 +19115,7 @@ */ /*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, 969, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -18364,7 +19174,7 @@ * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) /* "View.MemoryView":972 * @@ -18384,7 +19194,7 @@ * @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, 975, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -18464,6 +19274,113 @@ 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__31, 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__32, 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":985 * * @cname('__pyx_memoryview_fromslice') @@ -18527,9 +19444,9 @@ * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -18540,7 +19457,7 @@ __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, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -18571,7 +19488,7 @@ * 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, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -18742,7 +19659,7 @@ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { __pyx_t_6 = __pyx_t_8; - __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1026, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; @@ -18754,12 +19671,12 @@ * * 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, 1027, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } @@ -18851,7 +19768,7 @@ * 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, 1039, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -18908,7 +19825,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -19072,7 +19989,7 @@ * @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, 1067, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -19195,7 +20112,7 @@ * * */ - __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1084, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; @@ -19993,7 +20910,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) /* "View.MemoryView":1207 * @@ -20165,11 +21082,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -20193,7 +21110,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -20204,13 +21121,13 @@ * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -20229,20 +21146,20 @@ * (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, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 1237, __pyx_L1_error) + __PYX_ERR(1, 1237, __pyx_L1_error) /* "View.MemoryView":1235 * @@ -20262,7 +21179,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -20284,7 +21201,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -20296,11 +21213,11 @@ * * @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, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -20316,14 +21233,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -20332,20 +21249,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -20353,7 +21270,7 @@ __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, 1242, __pyx_L1_error) + __PYX_ERR(1, 1242, __pyx_L1_error) /* "View.MemoryView":1241 * @@ -20375,7 +21292,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -20398,7 +21315,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -20420,7 +21337,7 @@ * 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, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -20434,14 +21351,14 @@ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -20450,20 +21367,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -20471,7 +21388,7 @@ __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, 1247, __pyx_L1_error) + __PYX_ERR(1, 1247, __pyx_L1_error) /* "View.MemoryView":1246 * @cname('__pyx_memoryview_err') @@ -20491,7 +21408,7 @@ */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(2, 1249, __pyx_L1_error) + __PYX_ERR(1, 1249, __pyx_L1_error) } /* "View.MemoryView":1245 @@ -20514,7 +21431,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -20732,7 +21649,7 @@ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1281, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) } __pyx_L7:; @@ -20762,7 +21679,7 @@ * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) /* "View.MemoryView":1283 * _err_extents(i, dst.shape[i], src.shape[i]) @@ -20819,7 +21736,7 @@ * src = tmp * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1291, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1292 @@ -21003,7 +21920,7 @@ * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) /* "View.MemoryView":1314 * @@ -21012,7 +21929,7 @@ * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) /* "View.MemoryView":1310 * return 0 @@ -21081,11 +21998,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -21265,7 +22182,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -21289,7 +22206,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -21598,67 +22515,532 @@ /* function exit code */ } -static struct __pyx_vtabstruct_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH __pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH; -static PyObject *__pyx_tp_new_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *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_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)o); - p->__pyx_vtab = __pyx_vtabptr_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH; - p->sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_1__cinit__(o, a, k) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; - return NULL; -} +/* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ -static void __pyx_tp_dealloc_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH(PyObject *o) { - struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *p = (struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); +/* 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); { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_3__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); + 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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]; } - Py_CLEAR(p->sampler); - (*Py_TYPE(o)->tp_free)(o); -} + 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); -static int __pyx_tp_traverse_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *p = (struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)o; - if (p->sampler) { - e = (*v)(((PyObject*)p->sampler), a); if (e) return e; - } - return 0; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static int __pyx_tp_clear_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *p = (struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)o; - tmp = ((PyObject*)p->sampler); - p->sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} +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_PickleError = NULL; + PyObject *__pyx_v_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); -static PyMethodDef __pyx_methods_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH[] = { - {0, 0, 0, 0} + /* "(tree fragment)":2 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH __pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH; + +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *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_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)o); + p->__pyx_vtab = __pyx_vtabptr_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH; + p->sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH(PyObject *o) { + struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *p = (struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)o; + #if PY_VERSION_HEX >= 0x030400a1 + 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_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->sampler); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *p = (struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)o; + if (p->sampler) { + e = (*v)(((PyObject *)p->sampler), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *p = (struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *)o; + tmp = ((PyObject*)p->sampler); + p->sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_7__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} }; static PyTypeObject __pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH = { @@ -21687,7 +23069,7 @@ 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*/ - "\n\n This class implements a bounding volume hierarchy (BVH), a spatial acceleration\n structure for fast ray-tracing. A BVH is like a kd-tree, except that instead of \n partitioning the *volume* of the parent to create the children, we partition the \n primitives themselves into 'left' or 'right' sub-trees. The bounding volume for a\n node is then determined by computing the bounding volume of the primitives that\n belong to it. This allows us to quickly discard primitives that are not close \n to intersecting a given ray.\n\n This class is currently used to provide software 3D rendering support for\n finite element datasets. For 1st-order meshes, every element of the mesh is\n triangulated, and this set of triangles forms the primitives that will be used\n for the ray-trace. The BVH can then quickly determine which element is hit by\n each ray associated with the image plane, and the appropriate interpolation can\n be performed to sample the finite element solution at that hit position.\n\n Currently, 2nd-order meshes are only supported for 20-node hexahedral elements.\n There, the primitive type is a bi-quadratic patch instead of a triangle, and\n each intersection involves computing a Netwon-Raphson solve.\n\n See yt/utilities/lib/primitives.pyx for the definitions of both of these primitive\n types.\n\n ", /*tp_doc*/ + "\n\n This class implements a bounding volume hierarchy (BVH), a spatial acceleration\n structure for fast ray-tracing. A BVH is like a kd-tree, except that instead of\n partitioning the *volume* of the parent to create the children, we partition the\n primitives themselves into 'left' or 'right' sub-trees. The bounding volume for a\n node is then determined by computing the bounding volume of the primitives that\n belong to it. This allows us to quickly discard primitives that are not close\n to intersecting a given ray.\n\n This class is currently used to provide software 3D rendering support for\n finite element datasets. For 1st-order meshes, every element of the mesh is\n triangulated, and this set of triangles forms the primitives that will be used\n for the ray-trace. The BVH can then quickly determine which element is hit by\n each ray associated with the image plane, and the appropriate interpolation can\n be performed to sample the finite element solution at that hit position.\n\n Currently, 2nd-order meshes are only supported for 20-node hexahedral elements.\n There, the primitive type is a bi-quadratic patch instead of a triangle, and\n each intersection involves computing a Netwon-Raphson solve.\n\n See yt/utilities/lib/primitives.pyx for the definitions of both of these primitive\n types.\n\n ", /*tp_doc*/ __pyx_tp_traverse_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH, /*tp_traverse*/ __pyx_tp_clear_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -21731,7 +23113,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -21752,6 +23134,8 @@ } static PyMethodDef __pyx_methods_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -21837,7 +23221,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -21887,6 +23271,8 @@ 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} }; @@ -22006,7 +23392,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -22034,6 +23420,8 @@ } 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} }; @@ -22121,7 +23509,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -22233,6 +23621,8 @@ {"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} }; @@ -22358,7 +23748,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -22402,6 +23792,8 @@ } 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} }; @@ -22509,6 +23901,7 @@ {&__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}, @@ -22521,19 +23914,22 @@ {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__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_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_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 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_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_bvh, __pyx_k_bvh, sizeof(__pyx_k_bvh), 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_direction, __pyx_k_direction, sizeof(__pyx_k_direction), 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}, @@ -22560,6 +23956,8 @@ {&__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_num_threads, __pyx_k_num_threads, sizeof(__pyx_k_num_threads), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, @@ -22568,9 +23966,18 @@ {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, {&__pyx_n_s_origins, __pyx_k_origins, sizeof(__pyx_k_origins), 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_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_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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_kp_s_self_center_self_extent_function, __pyx_k_self_center_self_extent_function, sizeof(__pyx_k_self_center_self_extent_function), 0, 0, 1, 0}, + {&__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_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, @@ -22579,6 +23986,7 @@ {&__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_test_ray_trace, __pyx_k_test_ray_trace, sizeof(__pyx_k_test_ray_trace), 0, 0, 1, 1}, @@ -22586,22 +23994,24 @@ {&__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}, {&__pyx_n_s_vertices, __pyx_k_vertices, sizeof(__pyx_k_vertices), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_bounding_volume, __pyx_k_yt_utilities_lib_bounding_volume, sizeof(__pyx_k_yt_utilities_lib_bounding_volume), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_bounding_volume, __pyx_k_yt_utilities_lib_bounding_volume, sizeof(__pyx_k_yt_utilities_lib_bounding_volume), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_bounding_volume_2, __pyx_k_yt_utilities_lib_bounding_volume_2, sizeof(__pyx_k_yt_utilities_lib_bounding_volume_2), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 100, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 112, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 425, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 123, __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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -22611,17 +24021,55 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + /* "(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_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); + /* "(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__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_self_center_self_extent_function); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "(tree fragment)":4 + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_center_self_extent_function); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): @@ -22629,9 +24077,9 @@ * * 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, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -22640,9 +24088,9 @@ * 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, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -22651,9 +24099,9 @@ * * 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, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -22662,9 +24110,9 @@ * # 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, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -22673,9 +24121,9 @@ * * # 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, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -22684,9 +24132,9 @@ * * 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, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -22695,18 +24143,18 @@ * * 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, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _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, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); /* "View.MemoryView":131 * @@ -22715,9 +24163,9 @@ * * 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, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); /* "View.MemoryView":134 * @@ -22726,9 +24174,9 @@ * * 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, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); /* "View.MemoryView":137 * @@ -22737,9 +24185,9 @@ * 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, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); /* "View.MemoryView":146 * @@ -22748,9 +24196,9 @@ * * */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -22759,9 +24207,9 @@ * * 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, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -22770,9 +24218,28 @@ * 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, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "(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__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "(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__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -22781,9 +24248,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -22792,9 +24259,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "View.MemoryView":563 * def suboffsets(self): @@ -22803,12 +24270,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__18 = PyTuple_New(1); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); + __pyx_tuple__24 = PyTuple_New(1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__18, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__18); + PyTuple_SET_ITEM(__pyx_tuple__24, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "(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__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "(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__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "View.MemoryView":668 * if item is Ellipsis: @@ -22817,9 +24303,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(2, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__19); - __Pyx_GIVEREF(__pyx_slice__19); + __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__27); + __Pyx_GIVEREF(__pyx_slice__27); /* "View.MemoryView":671 * seen_ellipsis = True @@ -22828,9 +24314,9 @@ * have_slices = True * else: */ - __pyx_slice__20 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(2, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); + __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__28); + __Pyx_GIVEREF(__pyx_slice__28); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -22839,9 +24325,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(2, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__21); - __Pyx_GIVEREF(__pyx_slice__21); + __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -22850,21 +24336,40 @@ * * */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "(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__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "(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__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":383 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":428 * @cython.wraparound(False) * @cython.cdivision(True) * def test_ray_trace(np.ndarray[np.float64_t, ndim=1] image, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] origins, * np.ndarray[np.float64_t, ndim=1] direction, */ - __pyx_tuple__23 = PyTuple_Pack(5, __pyx_n_s_image, __pyx_n_s_origins, __pyx_n_s_direction, __pyx_n_s_bvh, __pyx_n_s_N); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_test_ray_trace, 383, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_image, __pyx_n_s_origins, __pyx_n_s_direction, __pyx_n_s_bvh, __pyx_n_s_N); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_bounding_volume, __pyx_n_s_test_ray_trace, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 428, __pyx_L1_error) /* "View.MemoryView":282 * return self.name @@ -22873,9 +24378,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); /* "View.MemoryView":283 * @@ -22884,9 +24389,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -22895,9 +24400,9 @@ * * */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); /* "View.MemoryView":287 * @@ -22906,9 +24411,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); /* "View.MemoryView":288 * @@ -22917,9 +24422,19 @@ * * */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 288, __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 + */ + __pyx_tuple__40 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 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, 0, __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(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -22938,6 +24453,7 @@ 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_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:; @@ -23004,6 +24520,7 @@ __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 @@ -23033,6 +24550,7 @@ __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_P1Sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)Py_None); Py_INCREF(Py_None); __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_W1Sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)Py_None); Py_INCREF(Py_None); __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_S2Sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)Py_None); Py_INCREF(Py_None); + __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_Tet2Sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)Py_None); Py_INCREF(Py_None); generic = Py_None; Py_INCREF(Py_None); strided = Py_None; Py_INCREF(Py_None); indirect = Py_None; Py_INCREF(Py_None); @@ -23045,26 +24563,28 @@ __pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH._partition = (__pyx_t_5numpy_int64_t (*)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t))__pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__partition; __pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH._set_up_triangles = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, __Pyx_memviewslice, __Pyx_memviewslice))__pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__set_up_triangles; __pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH._set_up_patches = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, __Pyx_memviewslice, __Pyx_memviewslice))__pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__set_up_patches; + __pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH._set_up_tet_patches = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, __Pyx_memviewslice, __Pyx_memviewslice))__pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__set_up_tet_patches; __pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH.intersect = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *))__pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH_intersect; __pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH._get_node_bbox = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, struct __pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHNode *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t))__pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__get_node_bbox; __pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH._recursive_intersect = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *, struct __pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHNode *))__pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__recursive_intersect; __pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH._recursive_build = (struct __pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHNode *(*)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t))__pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__recursive_build; __pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH._recursive_free = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH *, struct __pyx_t_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHNode *))__pyx_f_2yt_9utilities_3lib_25bounding_volume_hierarchy_3BVH__recursive_free; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH) < 0) __PYX_ERR(0, 44, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "BVH", (PyObject *)&__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "BVH", (PyObject *)&__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH = &__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVH; __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ImageSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_vtabptr_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler = &__pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler; __pyx_vtable_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler; __pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler.tp_base = __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler) < 0) __PYX_ERR(0, 391, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler) < 0) __PYX_ERR(0, 436, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 391, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 436, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler___call__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler___call__.doc = __pyx_doc_2yt_9utilities_3lib_25bounding_volume_hierarchy_14BVHMeshSampler___call__; @@ -23072,17 +24592,20 @@ } } #endif - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler) < 0) __PYX_ERR(0, 391, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "BVHMeshSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler) < 0) __PYX_ERR(0, 391, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "BVHMeshSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler) < 0) __PYX_ERR(0, 436, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler = &__pyx_type_2yt_9utilities_3lib_25bounding_volume_hierarchy_BVHMeshSampler; __pyx_vtabptr_array = &__pyx_vtable_array; __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; - if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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; @@ -23092,18 +24615,20 @@ __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, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -23113,39 +24638,47 @@ 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, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(2, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler = __Pyx_ImportType("yt.utilities.lib.element_mappings", "ElementSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler)) __PYX_ERR(4, 7, __pyx_L1_error) __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler)) __PYX_ERR(4, 7, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "P1Sampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)) __PYX_ERR(4, 36, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)) __PYX_ERR(4, 36, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "P1Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)) __PYX_ERR(4, 51, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)) __PYX_ERR(4, 51, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "NonlinearSolveSampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)) __PYX_ERR(4, 129, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)) __PYX_ERR(4, 129, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "Q1Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)) __PYX_ERR(4, 143, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)) __PYX_ERR(4, 143, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "W1Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)) __PYX_ERR(4, 160, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_W1Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)) __PYX_ERR(4, 160, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "S2Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)) __PYX_ERR(4, 178, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_S2Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)) __PYX_ERR(4, 178, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "NonlinearSolveSampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)) __PYX_ERR(4, 196, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)) __PYX_ERR(4, 196, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "Q1Sampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)) __PYX_ERR(4, 210, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)) __PYX_ERR(4, 210, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "P1Sampler1D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D)) __PYX_ERR(4, 36, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler1D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler1D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler1D)) __PYX_ERR(4, 36, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "P1Sampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)) __PYX_ERR(4, 51, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)) __PYX_ERR(4, 51, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "P1Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)) __PYX_ERR(4, 66, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)) __PYX_ERR(4, 66, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "NonlinearSolveSampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)) __PYX_ERR(4, 145, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)) __PYX_ERR(4, 145, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "Q1Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)) __PYX_ERR(4, 159, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)) __PYX_ERR(4, 159, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "W1Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)) __PYX_ERR(4, 176, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_W1Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)) __PYX_ERR(4, 176, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "S2Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)) __PYX_ERR(4, 194, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_S2Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)) __PYX_ERR(4, 194, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "NonlinearSolveSampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)) __PYX_ERR(4, 212, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)) __PYX_ERR(4, 212, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "Q1Sampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "Q2Sampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D)) __PYX_ERR(4, 241, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D)) __PYX_ERR(4, 241, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "T2Sampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D)) __PYX_ERR(4, 256, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_T2Sampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_T2Sampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_T2Sampler2D)) __PYX_ERR(4, 256, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "Tet2Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D)) __PYX_ERR(4, 270, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D)) __PYX_ERR(4, 270, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = __Pyx_ImportType("yt.utilities.lib.partitioned_grid", "PartitionedGrid", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(5, 22, __pyx_L1_error) __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(5, 22, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(6, 60, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(6, 60, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "InterpolatedProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(6, 63, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(6, 63, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "VolumeRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(6, 68, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(6, 68, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "LightSourceRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(6, 75, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(6, 75, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(6, 75, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(6, 75, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "InterpolatedProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(6, 78, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(6, 78, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "VolumeRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(6, 83, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(6, 83, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "LightSourceRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(6, 89, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(6, 89, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("yt.utilities.lib.primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) @@ -23156,6 +24689,9 @@ if (__Pyx_ImportFunction(__pyx_t_1, "ray_patch_intersect", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_10primitives_ray_patch_intersect, "__pyx_t_5numpy_int64_t (void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_1, "patch_centroid", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_10primitives_patch_centroid, "void (void const *, __pyx_t_5numpy_int64_t const , __pyx_t_5numpy_float64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_1, "patch_bbox", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_10primitives_patch_bbox, "void (void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "ray_tet_patch_intersect", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_10primitives_ray_tet_patch_intersect, "__pyx_t_5numpy_int64_t (void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "tet_patch_centroid", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_10primitives_tet_patch_centroid, "void (void const *, __pyx_t_5numpy_int64_t const , __pyx_t_5numpy_float64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "tet_patch_bbox", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_10primitives_tet_patch_bbox, "void (void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) @@ -23173,79 +24709,93 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":30 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":37 * from yt.utilities.lib.vec3_ops cimport L2_norm * * cdef ElementSampler Q1Sampler = Q1Sampler3D() # <<<<<<<<<<<<<< * cdef ElementSampler P1Sampler = P1Sampler3D() * cdef ElementSampler W1Sampler = W1Sampler3D() */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(((PyObject *)__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_Q1Sampler)); __Pyx_DECREF_SET(__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_Q1Sampler, ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":31 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":38 * * cdef ElementSampler Q1Sampler = Q1Sampler3D() * cdef ElementSampler P1Sampler = P1Sampler3D() # <<<<<<<<<<<<<< * cdef ElementSampler W1Sampler = W1Sampler3D() * cdef ElementSampler S2Sampler = S2Sampler3D() */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(((PyObject *)__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_P1Sampler)); __Pyx_DECREF_SET(__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_P1Sampler, ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":32 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":39 * cdef ElementSampler Q1Sampler = Q1Sampler3D() * cdef ElementSampler P1Sampler = P1Sampler3D() * cdef ElementSampler W1Sampler = W1Sampler3D() # <<<<<<<<<<<<<< * cdef ElementSampler S2Sampler = S2Sampler3D() - * + * cdef ElementSampler Tet2Sampler = Tet2Sampler3D() */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(((PyObject *)__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_W1Sampler)); __Pyx_DECREF_SET(__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_W1Sampler, ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":33 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":40 * cdef ElementSampler P1Sampler = P1Sampler3D() * cdef ElementSampler W1Sampler = W1Sampler3D() * cdef ElementSampler S2Sampler = S2Sampler3D() # <<<<<<<<<<<<<< + * cdef ElementSampler Tet2Sampler = Tet2Sampler3D() * - * cdef extern from "platform_dep.h" nogil: */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(((PyObject *)__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_S2Sampler)); __Pyx_DECREF_SET(__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_S2Sampler, ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":40 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":41 + * cdef ElementSampler W1Sampler = W1Sampler3D() + * cdef ElementSampler S2Sampler = S2Sampler3D() + * cdef ElementSampler Tet2Sampler = Tet2Sampler3D() # <<<<<<<<<<<<<< + * + * cdef extern from "platform_dep.h" nogil: + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(((PyObject *)__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_Tet2Sampler)); + __Pyx_DECREF_SET(__pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_Tet2Sampler, ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":48 * * # define some constants * cdef np.float64_t INF = np.inf # <<<<<<<<<<<<<< * cdef np.int64_t LEAF_SIZE = 16 * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_INF = __pyx_t_4; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":41 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":49 * # define some constants * cdef np.float64_t INF = np.inf * cdef np.int64_t LEAF_SIZE = 16 # <<<<<<<<<<<<<< @@ -23254,16 +24804,16 @@ */ __pyx_v_2yt_9utilities_3lib_25bounding_volume_hierarchy_LEAF_SIZE = 16; - /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":383 + /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":428 * @cython.wraparound(False) * @cython.cdivision(True) * def test_ray_trace(np.ndarray[np.float64_t, ndim=1] image, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] origins, * np.ndarray[np.float64_t, ndim=1] direction, */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_25bounding_volume_hierarchy_1test_ray_trace, NULL, __pyx_n_s_yt_utilities_lib_bounding_volume); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_25bounding_volume_hierarchy_1test_ray_trace, NULL, __pyx_n_s_yt_utilities_lib_bounding_volume_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_ray_trace, __pyx_t_3) < 0) __PYX_ERR(0, 383, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_ray_trace, __pyx_t_3) < 0) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "yt/utilities/lib/bounding_volume_hierarchy.pyx":1 @@ -23283,9 +24833,9 @@ * * def __dealloc__(array self): */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) + __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(2, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_array_type); @@ -23296,7 +24846,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 282, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_3); @@ -23310,7 +24860,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 283, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_3); @@ -23324,7 +24874,7 @@ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 284, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_3); @@ -23338,7 +24888,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 287, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_3); @@ -23352,7 +24902,7 @@ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 288, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_3); @@ -23392,9 +24942,9 @@ * * */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 535, __pyx_L1_error) + __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(2, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_memoryview_type); @@ -23405,18 +24955,28 @@ * * */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 981, __pyx_L1_error) + __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(2, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -23428,7 +24988,7 @@ __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.bounding_volume_hierarchy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.bounding_volume_hierarchy", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -24723,7 +26283,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -24783,6 +26352,21 @@ 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; @@ -24880,8 +26464,41 @@ } } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +/* GetModuleGlobalName */ + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -24906,7 +26523,7 @@ #endif /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -24980,7 +26597,7 @@ } /* PyFunctionFastCall */ - #if CYTHON_FAST_PYCALL + #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { @@ -25096,29 +26713,34 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyCFunctionFastCall */ - #if CYTHON_FAST_PYCCALL + #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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -25129,9 +26751,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -25144,9 +26769,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -25199,7 +26827,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -25315,12 +26943,12 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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)); @@ -25328,7 +26956,7 @@ } /* PyObjectCallMethO */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; @@ -25348,7 +26976,7 @@ #endif /* PyObjectCallOneArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); @@ -25365,11 +26993,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -25391,6 +27015,38 @@ } #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; + } +} + /* CallNextTpDealloc */ static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { PyTypeObject* type = Py_TYPE(obj); @@ -25443,6 +27099,71 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* GetVTable */ static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; @@ -25463,26 +27184,42 @@ return NULL; } -/* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); } - return result; + 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; + } + return c_line; +#endif } /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -25562,7 +27299,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -25621,12 +27358,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -25665,8 +27405,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -25689,7 +27429,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -25725,7 +27465,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -25738,7 +27478,7 @@ } /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -25779,7 +27519,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -25961,7 +27701,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -25984,7 +27724,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -26007,7 +27747,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -26029,7 +27769,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + 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) { @@ -26060,7 +27800,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -26080,7 +27820,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -26215,7 +27955,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -26235,7 +27975,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -26370,7 +28110,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -26401,7 +28141,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -26432,7 +28172,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -26499,7 +28239,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -26688,7 +28428,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -26876,85 +28616,54 @@ return (npy_int64) -1; } -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +/* 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 (is_unsigned) { +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { 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 + __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 { - 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 + } 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 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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; @@ -26968,86 +28677,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (char) -1; + return (long) -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)) + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } 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 (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 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(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(char) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -27056,7 +28765,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - char val; + long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -27076,40 +28785,71 @@ return val; } #endif - return (char) -1; + return (long) -1; } } else { - char val; + long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (char) -1; - val = __Pyx_PyInt_As_char(tmp); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to char"); - return (char) -1; + "value too large to convert to long"); + return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to char"); - return (char) -1; + "can't convert negative value to long"); + return (long) -1; } -/* 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 (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(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (long) val; + return (char) val; } } else #endif @@ -27118,32 +28858,32 @@ #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 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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; @@ -27157,86 +28897,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (long) -1; + return (char) -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)) + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, 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)) + } 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 (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 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(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, 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)) + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -27245,7 +28985,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - long val; + char val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -27265,28 +29005,28 @@ return val; } #endif - return (long) -1; + return (char) -1; } } else { - long val; + char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; + "value too large to convert to char"); + return (char) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; + "can't convert negative value to char"); + return (char) -1; } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -27302,7 +29042,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -27320,7 +29060,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -27385,7 +29125,7 @@ #endif /* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction + #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; @@ -27439,7 +29179,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -27464,6 +29204,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -27472,11 +29214,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/bounding_volume_hierarchy.pxd yt-3.4.0/yt/utilities/lib/bounding_volume_hierarchy.pxd --- yt-3.3.3/yt/utilities/lib/bounding_volume_hierarchy.pxd 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/bounding_volume_hierarchy.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -1,4 +1,4 @@ -cimport cython +cimport cython import numpy as np cimport numpy as np from yt.utilities.lib.element_mappings cimport ElementSampler @@ -18,6 +18,7 @@ int triangulate_tetra[MAX_NUM_TRI][3] int triangulate_wedge[MAX_NUM_TRI][3] int hex20_faces[6][8] + int tet10_faces[4][6] # node for the bounding volume hierarchy cdef struct BVHNode: @@ -69,8 +70,11 @@ cdef void _set_up_patches(self, np.float64_t[:, :] vertices, np.int64_t[:, :] indices) nogil + cdef void _set_up_tet_patches(self, + np.float64_t[:, :] vertices, + np.int64_t[:, :] indices) nogil cdef void intersect(self, Ray* ray) nogil - cdef void _get_node_bbox(self, BVHNode* node, + cdef void _get_node_bbox(self, BVHNode* node, np.int64_t begin, np.int64_t end) nogil cdef void _recursive_intersect(self, Ray* ray, BVHNode* node) nogil cdef BVHNode* _recursive_build(self, np.int64_t begin, np.int64_t end) nogil diff -Nru yt-3.3.3/yt/utilities/lib/bounding_volume_hierarchy.pyx yt-3.4.0/yt/utilities/lib/bounding_volume_hierarchy.pyx --- yt-3.3.3/yt/utilities/lib/bounding_volume_hierarchy.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/bounding_volume_hierarchy.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -4,8 +4,8 @@ from libc.math cimport fabs from libc.stdlib cimport malloc, free from cython.parallel import parallel, prange -from grid_traversal cimport ImageSampler, \ - ImageContainer +from .image_samplers cimport ImageSampler + from yt.utilities.lib.primitives cimport \ BBox, \ @@ -18,19 +18,27 @@ Patch, \ ray_patch_intersect, \ patch_centroid, \ - patch_bbox + patch_bbox, \ + TetPatch, \ + ray_tet_patch_intersect, \ + tet_patch_centroid, \ + tet_patch_bbox + from yt.utilities.lib.element_mappings cimport \ ElementSampler, \ Q1Sampler3D, \ P1Sampler3D, \ W1Sampler3D, \ - S2Sampler3D + S2Sampler3D, \ + Tet2Sampler3D + from yt.utilities.lib.vec3_ops cimport L2_norm cdef ElementSampler Q1Sampler = Q1Sampler3D() cdef ElementSampler P1Sampler = P1Sampler3D() cdef ElementSampler W1Sampler = W1Sampler3D() cdef ElementSampler S2Sampler = S2Sampler3D() +cdef ElementSampler Tet2Sampler = Tet2Sampler3D() cdef extern from "platform_dep.h" nogil: double fmax(double x, double y) @@ -45,11 +53,11 @@ ''' This class implements a bounding volume hierarchy (BVH), a spatial acceleration - structure for fast ray-tracing. A BVH is like a kd-tree, except that instead of - partitioning the *volume* of the parent to create the children, we partition the + structure for fast ray-tracing. A BVH is like a kd-tree, except that instead of + partitioning the *volume* of the parent to create the children, we partition the primitives themselves into 'left' or 'right' sub-trees. The bounding volume for a node is then determined by computing the bounding volume of the primitives that - belong to it. This allows us to quickly discard primitives that are not close + belong to it. This allows us to quickly discard primitives that are not close to intersecting a given ray. This class is currently used to provide software 3D rendering support for @@ -96,6 +104,9 @@ elif self.num_verts_per_elem == 20: self.num_prim_per_elem = 6 self.sampler = S2Sampler + elif self.num_verts_per_elem == 10: + self.num_prim_per_elem = 4 + self.sampler = Tet2Sampler else: raise NotImplementedError("Could not determine element type for " "nverts = %d. " % self.num_verts_per_elem) @@ -123,7 +134,7 @@ self.vertices[vertex_offset + k] = vertices[indices[i,j]][k] field_offset = i*self.num_field_per_elem for j in range(self.num_field_per_elem): - self.field_data[field_offset + j] = field_data[i][j] + self.field_data[field_offset + j] = field_data[i][j] # set up primitives if self.num_verts_per_elem == 20: @@ -132,13 +143,19 @@ self.get_bbox = patch_bbox self.get_intersect = ray_patch_intersect self._set_up_patches(vertices, indices) + elif self.num_verts_per_elem == 10: + self.primitives = malloc(self.num_prim * sizeof(TetPatch)) + self.get_centroid = tet_patch_centroid + self.get_bbox = tet_patch_bbox + self.get_intersect = ray_tet_patch_intersect + self._set_up_tet_patches(vertices, indices) else: self.primitives = malloc(self.num_prim * sizeof(Triangle)) self.get_centroid = triangle_centroid self.get_bbox = triangle_bbox self.get_intersect = ray_triangle_intersect self._set_up_triangles(vertices, indices) - + self.root = self._recursive_build(0, self.num_prim) @cython.boundscheck(False) @@ -170,6 +187,32 @@ @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) + cdef void _set_up_tet_patches(self, np.float64_t[:, :] vertices, + np.int64_t[:, :] indices) nogil: + cdef TetPatch* tet_patch + cdef np.int64_t i, j, k, ind, idim + cdef np.int64_t offset, prim_index + for i in range(self.num_elem): + offset = self.num_prim_per_elem*i + for j in range(self.num_prim_per_elem): # for each face + prim_index = offset + j + tet_patch = &( self.primitives)[prim_index] + self.prim_ids[prim_index] = prim_index + tet_patch.elem_id = i + for k in range(6): # for each vertex + ind = tet10_faces[j][k] + for idim in range(3): # for each spatial dimension (yikes) + tet_patch.v[k][idim] = vertices[indices[i, ind]][idim] + self.get_centroid(self.primitives, + prim_index, + self.centroids[prim_index]) + self.get_bbox(self.primitives, + prim_index, + &(self.bboxes[prim_index])) + + @cython.boundscheck(False) + @cython.wraparound(False) + @cython.cdivision(True) cdef void _set_up_triangles(self, np.float64_t[:, :] vertices, np.int64_t[:, :] indices) nogil: # fill our array of primitives @@ -195,7 +238,7 @@ tri_index, self.centroids[tri_index]) self.get_bbox(self.primitives, - tri_index, + tri_index, &(self.bboxes[tri_index])) cdef void _recursive_free(self, BVHNode* node) nogil: @@ -205,6 +248,8 @@ free(node) def __dealloc__(self): + if self.root == NULL: + return self._recursive_free(self.root) free(self.primitives) free(self.prim_ids) @@ -238,11 +283,11 @@ mid += 1 begin += 1 return mid - + @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) - cdef void _get_node_bbox(self, BVHNode* node, + cdef void _get_node_bbox(self, BVHNode* node, np.int64_t begin, np.int64_t end) nogil: cdef np.int64_t i, j cdef BBox box = self.bboxes[begin] @@ -250,7 +295,7 @@ for j in range(3): box.left_edge[j] = fmin(box.left_edge[j], self.bboxes[i].left_edge[j]) - box.right_edge[j] = fmax(box.right_edge[j], + box.right_edge[j] = fmax(box.right_edge[j], self.bboxes[i].right_edge[j]) node.bbox = box @@ -259,7 +304,7 @@ @cython.cdivision(True) cdef void intersect(self, Ray* ray) nogil: self._recursive_intersect(ray, self.root) - + if ray.elem_id < 0: return @@ -267,7 +312,7 @@ cdef np.int64_t i for i in range(3): position[i] = ray.origin[i] + ray.t_far*ray.direction[i] - + cdef np.float64_t* vertex_ptr cdef np.float64_t* field_ptr vertex_ptr = self.vertices + ray.elem_id*self.num_verts_per_elem*3 @@ -311,17 +356,17 @@ node.end = end self._get_node_bbox(node, begin, end) - + # check for leaf if (end - begin) <= LEAF_SIZE: return node - + # we use the "split in the middle of the longest axis approach" # see: http://www.vadimkravcenko.com/bvh-tree-building/ # compute longest dimension cdef np.int64_t ax = 0 - cdef np.float64_t d = fabs(node.bbox.right_edge[0] - + cdef np.float64_t d = fabs(node.bbox.right_edge[0] - node.bbox.left_edge[0]) if fabs(node.bbox.right_edge[1] - node.bbox.left_edge[1]) > d: ax = 1 @@ -337,7 +382,7 @@ if(mid == begin or mid == end): mid = begin + (end-begin)/2 - + # recursively build sub-trees node.left = self._recursive_build(begin, mid) node.right = self._recursive_build(mid, end) @@ -351,16 +396,16 @@ cdef void cast_rays(np.float64_t* image, const np.float64_t* origins, const np.float64_t* direction, - const int N, + const int N, BVH bvh) nogil: - cdef Ray* ray + cdef Ray* ray cdef int i, j, k - + with nogil, parallel(): - + ray = malloc(sizeof(Ray)) - + for k in range(3): ray.direction[k] = direction[k] ray.inv_dir[k] = 1.0 / direction[k] @@ -380,11 +425,11 @@ @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) -def test_ray_trace(np.ndarray[np.float64_t, ndim=1] image, +def test_ray_trace(np.ndarray[np.float64_t, ndim=1] image, np.ndarray[np.float64_t, ndim=2] origins, np.ndarray[np.float64_t, ndim=1] direction, BVH bvh): - + cdef int N = origins.shape[0] cast_rays(&image[0], &origins[0, 0], &direction[0], N, bvh) @@ -404,15 +449,14 @@ ''' cdef int vi, vj, i, j - cdef ImageContainer *im = self.image cdef np.float64_t *v_pos cdef np.float64_t *v_dir cdef np.int64_t nx, ny, size cdef np.float64_t width[3] for i in range(3): width[i] = self.width[i] - nx = im.nv[0] - ny = im.nv[1] + nx = self.nv[0] + ny = self.nv[1] size = nx * ny cdef Ray* ray with nogil, parallel(): @@ -423,7 +467,7 @@ vj = j % ny vi = (j - vj) / ny vj = vj - self.vector_function(im, vi, vj, width, v_dir, v_pos) + self.vector_function(self, vi, vj, width, v_dir, v_pos) for i in range(3): ray.origin[i] = v_pos[i] ray.direction[i] = v_dir[i] @@ -433,10 +477,10 @@ ray.data_val = 0 ray.elem_id = -1 bvh.intersect(ray) - im.image[vi, vj, 0] = ray.data_val - im.image_used[vi, vj] = ray.elem_id - im.mesh_lines[vi, vj] = ray.near_boundary - im.zbuffer[vi, vj] = ray.t_far + self.image[vi, vj, 0] = ray.data_val + self.image_used[vi, vj] = ray.elem_id + self.mesh_lines[vi, vj] = ray.near_boundary + self.zbuffer[vi, vj] = ray.t_far free(v_pos) free(v_dir) free(ray) diff -Nru yt-3.3.3/yt/utilities/lib/contour_finding.c yt-3.4.0/yt/utilities/lib/contour_finding.c --- yt-3.3.3/yt/utilities/lib/contour_finding.c 2016-12-12 01:41:42.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/contour_finding.c 2017-08-10 18:20:31.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -12,6 +12,10 @@ ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.contour_finding", + "sources": [ + "yt/utilities/lib/contour_finding.pyx" ] }, "module_name": "yt.utilities.lib.contour_finding" @@ -25,7 +29,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -47,6 +51,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -199,16 +204,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -335,6 +344,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -389,6 +404,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -502,8 +546,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -516,8 +560,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -639,10 +686,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -676,11 +725,12 @@ static const char *__pyx_f[] = { "yt/utilities/lib/contour_finding.pyx", - "yt/geometry/selection_routines.pxd", - "__init__.pxd", "stringsource", + "__init__.pxd", + "yt/geometry/selection_routines.pxd", "type.pxd", "yt/geometry/oct_visitors.pxd", + "yt/utilities/lib/allocation_container.pxd", "yt/geometry/oct_container.pxd", "yt/utilities/lib/amr_kdtools.pxd", "yt/utilities/lib/partitioned_grid.pxd", @@ -1017,6 +1067,9 @@ struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject; struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector; +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool; +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool; struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer; struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer; @@ -1136,7 +1189,7 @@ __pyx_t_5numpy_float64_t right_edge_x; __pyx_t_5numpy_float64_t right_edge_y; __pyx_t_5numpy_float64_t right_edge_z; - __pyx_t_5numpy_int64_t children_pointers; + __pyx_t_5numpy_int_t children_pointers; __pyx_t_5numpy_int64_t start_index_x; __pyx_t_5numpy_int64_t start_index_y; __pyx_t_5numpy_int64_t start_index_z; @@ -1178,7 +1231,7 @@ struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid; struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells; -/* "yt/geometry/selection_routines.pxd":42 +/* "yt/geometry/selection_routines.pxd":38 * cdef np.int64_t _hash * * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -1190,7 +1243,7 @@ int visit_covered; }; -/* "yt/geometry/selection_routines.pxd":50 +/* "yt/geometry/selection_routines.pxd":46 * np.float64_t spos[3], np.float64_t sdds[3], * OctVisitor visitor, int i, int j, int k) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1202,7 +1255,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "yt/geometry/selection_routines.pxd":65 +/* "yt/geometry/selection_routines.pxd":61 * np.ndarray[np.uint8_t, ndim=3] mask, * int level) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -1213,14 +1266,43 @@ int __pyx_n; __pyx_t_5numpy_uint8_t *cached_mask; }; +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer; +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs; + +/* "yt/utilities/lib/allocation_container.pxd":19 + * from libc.stdlib cimport malloc, free, realloc + * + * cdef struct AllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + void *my_objs; +}; + +/* "yt/utilities/lib/allocation_container.pxd":30 + * cdef np.uint64_t n_con + * cdef AllocationContainer* containers + * cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except * # <<<<<<<<<<<<<< + * cdef void setup_objs(self, void *obj, np.uint64_t count, + * np.uint64_t offset, np.int64_t con_id) + */ +struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs { + int __pyx_n; + __pyx_t_5numpy_int64_t con_id; +}; struct __pyx_t_2yt_8geometry_13oct_container_OctKey; struct __pyx_t_2yt_8geometry_13oct_container_OctInfo; -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_t_2yt_8geometry_13oct_container_OctList; +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get; struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs; -/* "yt/geometry/oct_container.pxd":28 +/* "yt/geometry/oct_container.pxd":30 * cdef int ORDER_MAX * * cdef struct OctKey: # <<<<<<<<<<<<<< @@ -1232,7 +1314,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node; }; -/* "yt/geometry/oct_container.pxd":32 +/* "yt/geometry/oct_container.pxd":34 * Oct *node * * cdef struct OctInfo: # <<<<<<<<<<<<<< @@ -1246,25 +1328,9 @@ __pyx_t_5numpy_int32_t level; }; -/* "yt/geometry/oct_container.pxd":38 +/* "yt/geometry/oct_container.pxd":40 * np.int32_t level * - * cdef struct OctAllocationContainer # <<<<<<<<<<<<<< - * cdef struct OctAllocationContainer: - * np.int64_t n - */ -struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { - __pyx_t_5numpy_int64_t n; - __pyx_t_5numpy_int64_t n_assigned; - __pyx_t_5numpy_int64_t offset; - __pyx_t_5numpy_int64_t con_id; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *next; - struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_octs; -}; - -/* "yt/geometry/oct_container.pxd":47 - * Oct *my_octs - * * cdef struct OctList # <<<<<<<<<<<<<< * * cdef struct OctList: @@ -1274,7 +1340,22 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "yt/geometry/oct_container.pxd":69 +/* "yt/geometry/oct_container.pxd":48 + * # NOTE: This object *has* to be the same size as the AllocationContainer + * # object. There's an assert in the __cinit__ function. + * cdef struct OctAllocationContainer: # <<<<<<<<<<<<<< + * np.uint64_t n + * np.uint64_t n_assigned + */ +struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer { + __pyx_t_5numpy_uint64_t n; + __pyx_t_5numpy_uint64_t n_assigned; + __pyx_t_5numpy_uint64_t offset; + __pyx_t_5numpy_int64_t con_id; + struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs; +}; + +/* "yt/geometry/oct_container.pxd":74 * cdef public np.int64_t nocts * cdef public int num_domains * cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?, # <<<<<<<<<<<<<< @@ -1287,8 +1368,8 @@ int max_level; }; -/* "yt/geometry/oct_container.pxd":78 - * # OctAllocationContainer.offset if such a thing exists. +/* "yt/geometry/oct_container.pxd":83 + * # AllocationContainer.offset if such a thing exists. * cdef np.int64_t get_domain_offset(self, int domain_id) * cdef void visit_all_octs(self, # <<<<<<<<<<<<<< * selection_routines.SelectorObject selector, @@ -1658,12 +1739,12 @@ struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base; __Pyx_memviewslice ref_mask; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs; - __pyx_t_5numpy_int64_t *nocts; - __pyx_t_5numpy_int64_t *nfinest; + __pyx_t_5numpy_uint64_t *nocts; + __pyx_t_5numpy_uint64_t *nfinest; }; -/* "yt/geometry/selection_routines.pxd":33 +/* "yt/geometry/selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1683,7 +1764,7 @@ }; -/* "yt/geometry/selection_routines.pxd":71 +/* "yt/geometry/selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1695,7 +1776,7 @@ }; -/* "yt/geometry/selection_routines.pxd":74 +/* "yt/geometry/selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1709,18 +1790,59 @@ }; -/* "yt/geometry/oct_container.pxd":57 +/* "yt/geometry/selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2; +}; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ +struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool { + PyObject_HEAD + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab; + __pyx_t_5numpy_uint64_t itemsize; + __pyx_t_5numpy_uint64_t n_con; + struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers; +}; + + +/* "yt/geometry/oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ +struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; +}; + + +/* "yt/geometry/oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer { PyObject_HEAD struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *cont; - struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer **domains; + struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh; int partial_coverage; int level_offset; @@ -1734,7 +1856,7 @@ }; -/* "yt/geometry/oct_container.pxd":89 +/* "yt/geometry/oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -1750,7 +1872,7 @@ }; -/* "yt/geometry/oct_container.pxd":97 +/* "yt/geometry/oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -2219,7 +2341,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree; -/* "yt/geometry/selection_routines.pxd":33 +/* "yt/geometry/selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -2242,7 +2364,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; -/* "yt/geometry/selection_routines.pxd":71 +/* "yt/geometry/selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2256,7 +2378,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; -/* "yt/geometry/selection_routines.pxd":74 +/* "yt/geometry/selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -2270,12 +2392,58 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; -/* "yt/geometry/oct_container.pxd":57 +/* "yt/geometry/selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + + +/* "yt/utilities/lib/allocation_container.pxd":26 + * void *my_objs + * + * cdef class ObjectPool: # <<<<<<<<<<<<<< + * cdef public np.uint64_t itemsize + * cdef np.uint64_t n_con + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool { + void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args); + void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); + void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool; + + +/* "yt/geometry/oct_container.pxd":55 + * Oct *my_objs + * + * cdef class OctObjectPool(ObjectPool): # <<<<<<<<<<<<<< + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) + */ + +struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool { + struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base; + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); +}; +static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool; +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int); + + +/* "yt/geometry/oct_container.pxd":63 * cdef void OctList_delete(OctList *list) * * cdef class OctreeContainer: # <<<<<<<<<<<<<< - * cdef OctAllocationContainer *cont - * cdef OctAllocationContainer **domains + * cdef public OctObjectPool domains + * cdef Oct ****root_mesh */ struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer { @@ -2292,7 +2460,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer; -/* "yt/geometry/oct_container.pxd":89 +/* "yt/geometry/oct_container.pxd":94 * cdef public object fill_style * * cdef class SparseOctreeContainer(OctreeContainer): # <<<<<<<<<<<<<< @@ -2308,7 +2476,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer; -/* "yt/geometry/oct_container.pxd":97 +/* "yt/geometry/oct_container.pxd":102 * cdef np.int64_t ipos_to_key(self, int pos[3]) * * cdef class RAMSESOctreeContainer(SparseOctreeContainer): # <<<<<<<<<<<<<< @@ -2370,8 +2538,8 @@ */ struct __pyx_vtabstruct_2yt_9utilities_3lib_15contour_finding_ParticleContourTree { - void (*__pyx_fuse_0link_particles)(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **, __pyx_t_5numpy_float32_t *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); - void (*__pyx_fuse_1link_particles)(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); + void (*__pyx_fuse_0link_particles)(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **, float *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); + void (*__pyx_fuse_1link_particles)(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **, double *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); }; static struct __pyx_vtabstruct_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_vtabptr_2yt_9utilities_3lib_15contour_finding_ParticleContourTree; @@ -2524,7 +2692,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) /* PyThreadStateGet.proto */ @@ -2621,6 +2789,12 @@ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, 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) ?\ @@ -2738,36 +2912,6 @@ static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* SaveResetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -#else -#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) -#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) -#endif - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - -/* GetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); -#endif - /* PyDictContains.proto */ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { int result = PyDict_Contains(dict, item); @@ -2807,6 +2951,22 @@ #endif static long __Pyx__PyObject_Ord(PyObject* c); +/* 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 + /* SetItemInt.proto */ #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ @@ -2861,20 +3021,40 @@ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif -/* IncludeStringH.proto */ -#include +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); -/* StrEquals.proto */ -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +/* 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_PyString_Equals __Pyx_PyBytes_Equals +#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 /* None.proto */ @@ -2886,8 +3066,19 @@ 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 *); +/* 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( @@ -2950,6 +3141,13 @@ #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() + /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); @@ -2971,6 +3169,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); #endif +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); @@ -2996,6 +3197,9 @@ static int __pyx_FusedFunction_init(void); #define __Pyx_FusedFunction_USED +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -3015,6 +3219,12 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +/* IsLittleEndian.proto */ +static int __Pyx_Is_Little_Endian(void); + #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); static void __Pyx_ReleaseBuffer(Py_buffer *view); @@ -3069,17 +3279,14 @@ PyObject *original_obj); /* ObjectToMemviewSlice.proto */ -static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(PyObject *); +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *); /* ObjectToMemviewSlice.proto */ -static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *); +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *); /* 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); - /* Print.proto */ static int __Pyx_Print(PyObject*, PyObject *, int); #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 @@ -3194,6 +3401,9 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + /* MemviewSliceCopyTemplate.proto */ static __Pyx_memviewslice __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, @@ -3201,29 +3411,30 @@ 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 long __Pyx_PyInt_As_long(PyObject *); + /* TypeInfoToFormat.proto */ struct __pyx_typeinfo_string { char string[3]; }; static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type); -/* CIntFromPy.proto */ -static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - /* PrintOne.proto */ static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /* BytesContains.proto */ static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character); -/* CIntFromPy.proto */ -static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); +/* ImportNumPyArray.proto */ +static PyObject *__pyx_numpy_ndarray = NULL; +static PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void); /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); /* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *); @@ -3258,10 +3469,11 @@ /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); -static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_link_particles(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **__pyx_v_container, __pyx_t_5numpy_float32_t *__pyx_v_positions, __pyx_t_5numpy_int64_t *__pyx_v_pind, __pyx_t_5numpy_int64_t __pyx_v_pcount, __pyx_t_5numpy_int64_t __pyx_v_noffset, __pyx_t_5numpy_int64_t __pyx_v_pind0, __pyx_t_5numpy_int64_t __pyx_v_poffset); /* proto*/ -static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_link_particles(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **__pyx_v_container, __pyx_t_5numpy_float64_t *__pyx_v_positions, __pyx_t_5numpy_int64_t *__pyx_v_pind, __pyx_t_5numpy_int64_t __pyx_v_pcount, __pyx_t_5numpy_int64_t __pyx_v_noffset, __pyx_t_5numpy_int64_t __pyx_v_pind0, __pyx_t_5numpy_int64_t __pyx_v_poffset); /* proto*/ +static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_link_particles(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **__pyx_v_container, float *__pyx_v_positions, __pyx_t_5numpy_int64_t *__pyx_v_pind, __pyx_t_5numpy_int64_t __pyx_v_pcount, __pyx_t_5numpy_int64_t __pyx_v_noffset, __pyx_t_5numpy_int64_t __pyx_v_pind0, __pyx_t_5numpy_int64_t __pyx_v_poffset); /* proto*/ +static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_link_particles(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **__pyx_v_container, double *__pyx_v_positions, __pyx_t_5numpy_int64_t *__pyx_v_pind, __pyx_t_5numpy_int64_t __pyx_v_pcount, __pyx_t_5numpy_int64_t __pyx_v_noffset, __pyx_t_5numpy_int64_t __pyx_v_pind0, __pyx_t_5numpy_int64_t __pyx_v_poffset); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/ +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* 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*/ @@ -3336,15 +3548,20 @@ static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0; /* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ /* Module declarations from 'libc.math' */ +/* Module declarations from 'yt.utilities.lib.allocation_container' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0; + /* Module declarations from 'yt.geometry.oct_container' */ +static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0; @@ -3388,6 +3605,8 @@ static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_15contour_finding_spos_contained(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *); /*proto*/ static void __pyx_f_2yt_9utilities_3lib_15contour_finding_construct_boundary_relationships(struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *, struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ContourTree *, __pyx_t_5numpy_int64_t, PyArrayObject *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer **, PyArrayObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_15contour_finding_r2dist_early(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t (*)[3]); /*proto*/ +static PyObject *__pyx_f_2yt_9utilities_3lib_15contour_finding___pyx_unpickle_TileContourTree__set_state(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_TileContourTree *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_9utilities_3lib_15contour_finding___pyx_unpickle_FOFNode__set_state(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_FOFNode *, 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*/ @@ -3420,23 +3639,25 @@ 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 PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; #define __Pyx_MODULE_NAME "yt.utilities.lib.contour_finding" int __pyx_module_is_main_yt__utilities__lib__contour_finding = 0; /* Implementation of 'yt.utilities.lib.contour_finding' */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_sorted; -static PyObject *__pyx_builtin_ImportError; -static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_sorted; static PyObject *__pyx_builtin_zip; +static PyObject *__pyx_builtin_reversed; static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_Ellipsis; @@ -3449,9 +3670,11 @@ static const char __pyx_k_j[] = "j"; static const char __pyx_k_k[] = "k"; static const char __pyx_k_n[] = "n"; - static const char __pyx_k_s[] = "(%s)"; - static const char __pyx_k__3[] = "()"; - static const char __pyx_k__5[] = "|"; + static const char __pyx_k_s[] = "s"; + static const char __pyx_k__5[] = "<"; + static const char __pyx_k__6[] = ">"; + static const char __pyx_k__7[] = "()"; + static const char __pyx_k__9[] = "|"; static const char __pyx_k_c0[] = "c0"; static const char __pyx_k_ci[] = "ci"; static const char __pyx_k_cj[] = "cj"; @@ -3462,23 +3685,26 @@ static const char __pyx_k_np[] = "np"; static const char __pyx_k_oi[] = "oi"; static const char __pyx_k_pg[] = "pg"; - static const char __pyx_k__32[] = "^"; - static const char __pyx_k__33[] = ""; - static const char __pyx_k__34[] = ":"; -static const char __pyx_k__35[] = "}"; -static const char __pyx_k__36[] = ","; -static const char __pyx_k__37[] = "_"; + static const char __pyx_k__44[] = "^"; + static const char __pyx_k__45[] = ""; + static const char __pyx_k__46[] = ":"; +static const char __pyx_k__47[] = "}"; +static const char __pyx_k__48[] = ","; +static const char __pyx_k__49[] = "_"; static const char __pyx_k_end[] = "end"; static const char __pyx_k_key[] = "key"; +static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_oct[] = "oct"; static const char __pyx_k_pos[] = "pos"; +static const char __pyx_k_s_2[] = "(%s)"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_tag[] = "tag"; static const char __pyx_k_vcs[] = "vcs"; static const char __pyx_k_zip[] = "zip"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_doff[] = "doff"; static const char __pyx_k_file[] = "file"; static const char __pyx_k_fpos[] = "fpos"; @@ -3510,6 +3736,7 @@ static const char __pyx_k_empty[] = "empty"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_float[] = "float"; static const char __pyx_k_int64[] = "int64"; static const char __pyx_k_ipind[] = "ipind"; static const char __pyx_k_items[] = "items"; @@ -3528,6 +3755,7 @@ static const char __pyx_k_uint8[] = "uint8"; static const char __pyx_k_units[] = "units"; static const char __pyx_k_zeros[] = "zeros"; +static const char __pyx_k_double[] = "double"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; @@ -3536,10 +3764,13 @@ static const char __pyx_k_octree[] = "octree"; static const char __pyx_k_offset[] = "offset"; static const char __pyx_k_pcount[] = "pcount"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_result[] = "result"; static const char __pyx_k_sorted[] = "sorted"; static const char __pyx_k_stderr[] = "stderr"; 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_argsort[] = "argsort"; static const char __pyx_k_counter[] = "counter"; @@ -3549,7 +3780,7 @@ static const char __pyx_k_memview[] = "memview"; static const char __pyx_k_min_val[] = "min_val"; static const char __pyx_k_n_nodes[] = "n_nodes"; -static const char __pyx_k_ndarray[] = "ndarray"; +static const char __pyx_k_strides[] = "strides"; static const char __pyx_k_verbose[] = "verbose"; static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_contours[] = "contours"; @@ -3558,16 +3789,18 @@ static const char __pyx_k_itemsize[] = "itemsize"; static const char __pyx_k_node_ids[] = "node_ids"; static const char __pyx_k_node_ind[] = "node_ind"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_reversed[] = "reversed"; static const char __pyx_k_Inspected[] = " Inspected "; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_add_joins[] = "add_joins"; +static const char __pyx_k_byteorder[] = "byteorder"; static const char __pyx_k_container[] = "container"; static const char __pyx_k_domain_id[] = "domain_id"; static const char __pyx_k_enumerate[] = "enumerate"; -static const char __pyx_k_float32_t[] = "float32_t"; -static const char __pyx_k_float64_t[] = "float64_t"; static const char __pyx_k_neighbors[] = "neighbors"; static const char __pyx_k_positions[] = "positions"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_cull_joins[] = "cull_joins"; @@ -3576,26 +3809,35 @@ static const char __pyx_k_zeros_like[] = "zeros_like"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_code_length[] = "code_length"; static const char __pyx_k_contour_ids[] = "contour_ids"; static const char __pyx_k_final_joins[] = "final_joins"; static const char __pyx_k_periodicity[] = "periodicity"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_f_contiguous[] = "f_contiguous"; static const char __pyx_k_particle_ids[] = "particle_ids"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_update_joins[] = "update_joins"; static const char __pyx_k_Couldn_t_find[] = " Couldn't find "; static const char __pyx_k_domain_offset[] = "domain_offset"; static const char __pyx_k_minimum_count[] = "minimum_count"; static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; -static const char __pyx_k_AttributeError[] = "AttributeError"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_linking_length[] = "linking_length"; +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_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_convert_to_units[] = "convert_to_units"; static const char __pyx_k_FOF_ing_5_1f_done[] = "FOF-ing % 5.1f%% done"; static const char __pyx_k_identify_contours[] = "identify_contours"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_link_node_contours[] = "link_node_contours"; static const char __pyx_k_strided_and_direct[] = ""; +static const char __pyx_k_pyx_unpickle_FOFNode[] = "__pyx_unpickle_FOFNode"; 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[] = ""; @@ -3607,9 +3849,8 @@ static const char __pyx_k_No_matching_signature_found[] = "No matching signature found"; static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Expected_at_least_d_arguments[] = "Expected at least %d arguments"; +static const char __pyx_k_pyx_unpickle_TileContourTree[] = "__pyx_unpickle_TileContourTree"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/contour_finding.pyx"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_A_two_pass_contour_finding_algo[] = "\nA two-pass contour finding algorithm\n\n\n\n"; static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; @@ -3617,8 +3858,12 @@ static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static const char __pyx_k_Expected_at_least_d_argument_s_g[] = "Expected at least %d argument%s, got %d"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; static const char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types"; +static const char __pyx_k_Incompatible_checksums_s_vs_0x32[] = "Incompatible checksums (%s vs 0x327d0a5 = (max_val, min_val))"; +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_0xfe[] = "Incompatible checksums (%s vs 0xfeb1925 = (count, tag))"; 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"; @@ -3628,24 +3873,29 @@ 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_link_node_contours_locals_lambda[] = "link_node_contours.."; 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_first_self_last_cannot_be_c[] = "self.first,self.last 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_yt_utilities_lib_contour_finding[] = "yt.utilities.lib.contour_finding"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_utilities_lib_contour_finding_2[] = "yt/utilities/lib/contour_finding.pyx"; static PyObject *__pyx_n_s_ASCII; -static PyObject *__pyx_n_s_AttributeError; static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; static PyObject *__pyx_kp_s_Cannot_index_with_type_s; static PyObject *__pyx_kp_s_Couldn_t_find; static PyObject *__pyx_n_s_Ellipsis; static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; -static PyObject *__pyx_kp_s_Expected_at_least_d_arguments; +static PyObject *__pyx_kp_s_Expected_at_least_d_argument_s_g; static PyObject *__pyx_kp_s_FOF_ing_5_1f_done; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; static PyObject *__pyx_kp_s_Function_call_with_ambiguous_arg; static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x32; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xfe; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; static PyObject *__pyx_kp_s_Inspected; @@ -3659,26 +3909,30 @@ static PyObject *__pyx_n_b_O; static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; static PyObject *__pyx_n_s_ParticleContourTree_identify_con; +static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_kp_b_T; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_kp_s_Will_be_outputting_every; -static PyObject *__pyx_kp_s__3; -static PyObject *__pyx_kp_b__32; -static PyObject *__pyx_kp_b__33; -static PyObject *__pyx_kp_b__34; -static PyObject *__pyx_kp_b__35; -static PyObject *__pyx_kp_u__36; -static PyObject *__pyx_n_s__37; +static PyObject *__pyx_kp_b__44; +static PyObject *__pyx_kp_b__45; +static PyObject *__pyx_kp_b__46; +static PyObject *__pyx_kp_b__47; +static PyObject *__pyx_kp_u__48; +static PyObject *__pyx_n_s__49; static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_kp_s__7; +static PyObject *__pyx_kp_s__9; static PyObject *__pyx_n_s_add_joins; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_s_argsort; static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_byteorder; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_u_c; static PyObject *__pyx_n_s_c0; @@ -3688,6 +3942,7 @@ static PyObject *__pyx_n_s_ck; static PyObject *__pyx_n_s_class; static PyObject *__pyx_n_s_clear; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_code_length; static PyObject *__pyx_n_s_container; static PyObject *__pyx_kp_s_contiguous_and_direct; @@ -3699,10 +3954,12 @@ static PyObject *__pyx_n_s_counter; static PyObject *__pyx_n_s_cull_joins; static PyObject *__pyx_n_s_defaults; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_doff; static PyObject *__pyx_n_s_dom_ind; static PyObject *__pyx_n_s_domain_id; static PyObject *__pyx_n_s_domain_offset; +static PyObject *__pyx_n_s_double; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_dtype_is_object; static PyObject *__pyx_n_s_empty; @@ -3711,11 +3968,11 @@ static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_examined; +static PyObject *__pyx_n_s_f_contiguous; static PyObject *__pyx_n_s_file; static PyObject *__pyx_n_s_final_joins; static PyObject *__pyx_n_s_flags; -static PyObject *__pyx_n_s_float32_t; -static PyObject *__pyx_n_s_float64_t; +static PyObject *__pyx_n_s_float; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_fortran; static PyObject *__pyx_n_u_fortran; @@ -3753,15 +4010,16 @@ static PyObject *__pyx_n_s_n_nodes; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_name_2; -static PyObject *__pyx_n_s_ndarray; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; static PyObject *__pyx_n_s_ndim; static PyObject *__pyx_n_s_neighbors; +static PyObject *__pyx_n_s_new; static PyObject *__pyx_n_s_nf; static PyObject *__pyx_n_s_nind; static PyObject *__pyx_n_s_nj; static PyObject *__pyx_n_s_nneighbors; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_node_ids; static PyObject *__pyx_n_s_node_ind; static PyObject *__pyx_n_s_np; @@ -3781,16 +4039,29 @@ static PyObject *__pyx_n_s_pdoms; static PyObject *__pyx_n_s_periodicity; static PyObject *__pyx_n_s_pg; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_pind; static PyObject *__pyx_n_s_pind0; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_positions; static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_FOFNode; +static PyObject *__pyx_n_s_pyx_unpickle_TileContourTree; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_range; -static PyObject *__pyx_kp_u_s; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_reversed; +static PyObject *__pyx_n_s_s; +static PyObject *__pyx_kp_u_s_2; static PyObject *__pyx_n_s_self; +static PyObject *__pyx_kp_s_self_first_self_last_cannot_be_c; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_sorted; @@ -3802,6 +4073,8 @@ static PyObject *__pyx_kp_s_strided_and_direct; static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_n_s_strides; +static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_strip; static PyObject *__pyx_n_s_struct; static PyObject *__pyx_n_s_sys; @@ -3815,11 +4088,13 @@ static PyObject *__pyx_n_s_units; 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_update_joins; static PyObject *__pyx_n_s_values; static PyObject *__pyx_n_s_vcs; static PyObject *__pyx_n_s_verbose; static PyObject *__pyx_n_s_yt_utilities_lib_contour_finding; +static PyObject *__pyx_kp_s_yt_utilities_lib_contour_finding_2; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_n_s_zeros_like; static PyObject *__pyx_n_s_zip; @@ -3833,16 +4108,26 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_11ContourTree_14count(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ContourTree *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_11ContourTree_16export(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ContourTree *__pyx_v_self); /* proto */ static void __pyx_pf_2yt_9utilities_3lib_15contour_finding_11ContourTree_18__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ContourTree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_11ContourTree_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ContourTree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_11ContourTree_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ContourTree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_15contour_finding_15TileContourTree___init__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_TileContourTree *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_min_val, __pyx_t_5numpy_float64_t __pyx_v_max_val); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_15TileContourTree_2identify_contours(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_TileContourTree *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_contour_ids, PyArrayObject *__pyx_v_mask, __pyx_t_5numpy_int64_t __pyx_v_start); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_15TileContourTree_4__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_TileContourTree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_15TileContourTree_6__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_TileContourTree *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_link_node_contours(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node *__pyx_v_trunk, PyObject *__pyx_v_contours, struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ContourTree *__pyx_v_tree, PyArrayObject *__pyx_v_node_ids); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_2update_joins(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_joins, PyArrayObject *__pyx_v_contour_ids, PyArrayObject *__pyx_v_final_joins); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_15contour_finding_7FOFNode___init__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_FOFNode *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_tag); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_7FOFNode_2__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_FOFNode *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_7FOFNode_4__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_FOFNode *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree___init__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, PyObject *__pyx_v_linking_length, PyObject *__pyx_v_periodicity, int __pyx_v_minimum_count); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_2identify_contours(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_4identify_contours(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, PyArrayObject *__pyx_v_dom_ind, PyArrayObject *__pyx_v_positions, PyArrayObject *__pyx_v_particle_ids, int __pyx_v_domain_id, int __pyx_v_domain_offset); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_6identify_contours(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_octree, PyArrayObject *__pyx_v_dom_ind, PyArrayObject *__pyx_v_positions, PyArrayObject *__pyx_v_particle_ids, int __pyx_v_domain_id, int __pyx_v_domain_offset); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_4__pyx_unpickle_TileContourTree(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_2yt_9utilities_3lib_15contour_finding_6__pyx_unpickle_FOFNode(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 */ @@ -3852,8 +4137,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -3875,8 +4164,13 @@ 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_2yt_9utilities_3lib_15contour_finding_ContourTree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_15contour_finding_TileContourTree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_15contour_finding_FOFNode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3888,17 +4182,19 @@ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; +static PyObject *__pyx_int_7; +static PyObject *__pyx_int_52940965; +static PyObject *__pyx_int_184977713; +static PyObject *__pyx_int_267065637; static PyObject *__pyx_int_neg_1; -static PyObject *__pyx_slice_; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_slice__3; static PyObject *__pyx_tuple__2; 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__28; -static PyObject *__pyx_slice__29; -static PyObject *__pyx_slice__30; +static PyObject *__pyx_slice__38; +static PyObject *__pyx_slice__39; +static PyObject *__pyx_slice__40; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -3917,18 +4213,36 @@ 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__38; -static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__41; static PyObject *__pyx_tuple__42; -static PyObject *__pyx_tuple__44; -static PyObject *__pyx_tuple__45; -static PyObject *__pyx_tuple__46; -static PyObject *__pyx_tuple__47; -static PyObject *__pyx_tuple__48; -static PyObject *__pyx_codeobj__39; -static PyObject *__pyx_codeobj__41; -static PyObject *__pyx_codeobj__43; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__64; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_codeobj__51; +static PyObject *__pyx_codeobj__53; +static PyObject *__pyx_codeobj__55; +static PyObject *__pyx_codeobj__57; +static PyObject *__pyx_codeobj__59; +static PyObject *__pyx_codeobj__66; /* "yt/utilities/lib/contour_finding.pyx":35 * import sys @@ -6792,11 +7106,118 @@ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("yt.utilities.lib.contour_finding.ContourTree.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.contour_finding.ContourTree.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_11ContourTree_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_11ContourTree_21__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_2yt_9utilities_3lib_15contour_finding_11ContourTree_20__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ContourTree *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_11ContourTree_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ContourTree *__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.first,self.last cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, 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.first,self.last 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("yt.utilities.lib.contour_finding.ContourTree.__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.first,self.last cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_11ContourTree_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_11ContourTree_23__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_2yt_9utilities_3lib_15contour_finding_11ContourTree_22__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ContourTree *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_11ContourTree_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ContourTree *__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.first,self.last cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, 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.first,self.last cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.contour_finding.ContourTree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/utilities/lib/contour_finding.pyx":299 * cdef np.float64_t max_val * @@ -6821,7 +7242,9 @@ 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; } @@ -6830,6 +7253,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_val)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_val)) != 0)) kw_args--; else { @@ -6926,9 +7350,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -6937,16 +7365,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_contour_ids)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("identify_contours", 1, 4, 4, 1); __PYX_ERR(0, 305, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("identify_contours", 1, 4, 4, 2); __PYX_ERR(0, 305, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else { @@ -7647,6 +8078,299 @@ return __pyx_r; } +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.max_val, self.min_val) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_15TileContourTree_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_15TileContourTree_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_2yt_9utilities_3lib_15contour_finding_15TileContourTree_4__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_TileContourTree *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_15TileContourTree_4__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_TileContourTree *__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; + int __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.max_val, self.min_val) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->max_val); 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->min_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __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_v_state = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.max_val, self.min_val) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v__dict = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":5 + * state = (self.max_val, self.min_val) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_4 = (__pyx_v__dict != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 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.max_val, self.min_val) + * _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_TileContourTree, (type(self), 0x327d0a5, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_TileContourTree, (type(self), 0x327d0a5, None), state + * else: + */ + __pyx_t_5 = (__pyx_v_use_setstate != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_TileContourTree, (type(self), 0x327d0a5, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_TileContourTree, (type(self), 0x327d0a5, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_TileContourTree); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_52940965); + __Pyx_GIVEREF(__pyx_int_52940965); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_52940965); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_TileContourTree, (type(self), 0x327d0a5, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_TileContourTree, (type(self), 0x327d0a5, None), state + * else: + * return __pyx_unpickle_TileContourTree, (type(self), 0x327d0a5, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_TileContourTree__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_TileContourTree); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_52940965); + __Pyx_GIVEREF(__pyx_int_52940965); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_52940965); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.max_val, self.min_val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.contour_finding.TileContourTree.__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_TileContourTree, (type(self), 0x327d0a5, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_TileContourTree__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_15TileContourTree_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_15TileContourTree_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_2yt_9utilities_3lib_15contour_finding_15TileContourTree_6__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_TileContourTree *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_15TileContourTree_6__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_TileContourTree *__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_TileContourTree, (type(self), 0x327d0a5, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_TileContourTree__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_2yt_9utilities_3lib_15contour_finding___pyx_unpickle_TileContourTree__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_TileContourTree, (type(self), 0x327d0a5, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_TileContourTree__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("yt.utilities.lib.contour_finding.TileContourTree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/utilities/lib/contour_finding.pyx":368 * @cython.boundscheck(False) * @cython.wraparound(False) @@ -7674,9 +8398,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -7685,16 +8413,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trunk)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_contours)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("link_node_contours", 1, 4, 4, 1); __PYX_ERR(0, 368, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tree)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("link_node_contours", 1, 4, 4, 2); __PYX_ERR(0, 368, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_node_ids)) != 0)) kw_args--; else { @@ -9133,9 +9864,9 @@ __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_slice_); - __Pyx_GIVEREF(__pyx_slice_); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice_); + __Pyx_INCREF(__pyx_slice__3); + __Pyx_GIVEREF(__pyx_slice__3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__3); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_joins), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -9268,7 +9999,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_examined.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_joins.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.utilities.lib.contour_finding.construct_boundary_relationships", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.contour_finding.construct_boundary_relationships", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_examined.rcbuffer->pybuffer); @@ -9306,8 +10037,11 @@ 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; } @@ -9316,11 +10050,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_joins)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_contour_ids)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("update_joins", 1, 3, 3, 1); __PYX_ERR(0, 476, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final_joins)) != 0)) kw_args--; else { @@ -9679,6 +10415,7 @@ 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; } @@ -9750,107 +10487,407 @@ return __pyx_r; } -/* "yt/utilities/lib/contour_finding.pyx":510 - * cdef int minimum_count - * - * def __init__(self, linking_length, periodicity = (True, True, True), # <<<<<<<<<<<<<< - * int minimum_count = 8): - * cdef int i +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.count, self.tag) */ /* Python wrapper */ -static int __pyx_pw_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_linking_length = 0; - PyObject *__pyx_v_periodicity = 0; - int __pyx_v_minimum_count; - int __pyx_r; +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_7FOFNode_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_7FOFNode_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_linking_length,&__pyx_n_s_periodicity,&__pyx_n_s_minimum_count,0}; - PyObject* values[3] = {0,0,0}; - values[1] = ((PyObject *)__pyx_tuple__2); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_linking_length)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periodicity); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minimum_count); - if (value) { values[2] = 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, 510, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_linking_length = values[0]; - __pyx_v_periodicity = values[1]; - if (values[2]) { - __pyx_v_minimum_count = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minimum_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 511, __pyx_L3_error) - } else { - __pyx_v_minimum_count = ((int)8); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 510, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.contour_finding.ParticleContourTree.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree___init__(((struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *)__pyx_v_self), __pyx_v_linking_length, __pyx_v_periodicity, __pyx_v_minimum_count); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_15contour_finding_7FOFNode_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_FOFNode *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree___init__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, PyObject *__pyx_v_linking_length, PyObject *__pyx_v_periodicity, int __pyx_v_minimum_count) { - int __pyx_v_i; - int __pyx_r; +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_7FOFNode_2__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_FOFNode *__pyx_v_self) { + int __pyx_v_use_setstate; + PyObject *__pyx_v_state = NULL; + PyObject *__pyx_v__dict = NULL; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __pyx_t_5numpy_float64_t __pyx_t_1; + PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; + PyObject *__pyx_t_3 = NULL; int __pyx_t_4; - __Pyx_RefNannySetupContext("__init__", 0); + int __pyx_t_5; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "yt/utilities/lib/contour_finding.pyx":513 - * int minimum_count = 8): - * cdef int i - * self.linking_length = linking_length # <<<<<<<<<<<<<< - * self.linking_length2 = linking_length * linking_length - * self.first = self.last = NULL + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.count, self.tag) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_linking_length); if (unlikely((__pyx_t_1 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L1_error) - __pyx_v_self->linking_length = __pyx_t_1; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __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_v_state = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.count, self.tag) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v__dict = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":5 + * state = (self.count, self.tag) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_4 = (__pyx_v__dict != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 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.count, self.tag) + * _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_FOFNode, (type(self), 0xfeb1925, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FOFNode, (type(self), 0xfeb1925, None), state + * else: + */ + __pyx_t_5 = (__pyx_v_use_setstate != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_FOFNode, (type(self), 0xfeb1925, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_FOFNode, (type(self), 0xfeb1925, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FOFNode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_267065637); + __Pyx_GIVEREF(__pyx_int_267065637); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_267065637); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FOFNode, (type(self), 0xfeb1925, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_FOFNode, (type(self), 0xfeb1925, None), state + * else: + * return __pyx_unpickle_FOFNode, (type(self), 0xfeb1925, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FOFNode__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FOFNode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_267065637); + __Pyx_GIVEREF(__pyx_int_267065637); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_267065637); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.count, self.tag) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.contour_finding.FOFNode.__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_FOFNode, (type(self), 0xfeb1925, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FOFNode__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_7FOFNode_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_7FOFNode_5__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_2yt_9utilities_3lib_15contour_finding_7FOFNode_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_FOFNode *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_7FOFNode_4__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_FOFNode *__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_FOFNode, (type(self), 0xfeb1925, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FOFNode__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_2yt_9utilities_3lib_15contour_finding___pyx_unpickle_FOFNode__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_FOFNode, (type(self), 0xfeb1925, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FOFNode__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("yt.utilities.lib.contour_finding.FOFNode.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/contour_finding.pyx":510 + * cdef int minimum_count + * + * def __init__(self, linking_length, periodicity = (True, True, True), # <<<<<<<<<<<<<< + * int minimum_count = 8): + * cdef int i + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_linking_length = 0; + PyObject *__pyx_v_periodicity = 0; + int __pyx_v_minimum_count; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_linking_length,&__pyx_n_s_periodicity,&__pyx_n_s_minimum_count,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_tuple__4); + 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_linking_length)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periodicity); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minimum_count); + if (value) { values[2] = 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, 510, __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); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_linking_length = values[0]; + __pyx_v_periodicity = values[1]; + if (values[2]) { + __pyx_v_minimum_count = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minimum_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 511, __pyx_L3_error) + } else { + __pyx_v_minimum_count = ((int)8); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 510, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.contour_finding.ParticleContourTree.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree___init__(((struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *)__pyx_v_self), __pyx_v_linking_length, __pyx_v_periodicity, __pyx_v_minimum_count); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree___init__(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, PyObject *__pyx_v_linking_length, PyObject *__pyx_v_periodicity, int __pyx_v_minimum_count) { + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_float64_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "yt/utilities/lib/contour_finding.pyx":513 + * int minimum_count = 8): + * cdef int i + * self.linking_length = linking_length # <<<<<<<<<<<<<< + * self.linking_length2 = linking_length * linking_length + * self.first = self.last = NULL + */ + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_linking_length); if (unlikely((__pyx_t_1 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_v_self->linking_length = __pyx_t_1; /* "yt/utilities/lib/contour_finding.pyx":514 * cdef int i @@ -9933,7 +10970,7 @@ * @cython.wraparound(False) * def identify_contours(self, OctreeContainer octree, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] dom_ind, - * np.ndarray[anyfloat, ndim=2] positions, + * np.ndarray[floating, ndim=2] positions, */ /* Python wrapper */ @@ -9954,8 +10991,11 @@ 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; } @@ -9964,11 +11004,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, 1); __PYX_ERR(0, 523, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { @@ -10006,43 +11048,46 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_2identify_contours(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) { PyObject *__pyx_v_dest_sig = NULL; + Py_ssize_t __pyx_v_i; PyTypeObject *__pyx_v_ndarray = 0; - PyObject *__pyx_v_numpy = NULL; __Pyx_memviewslice __pyx_v_memslice; Py_ssize_t __pyx_v_itemsize; CYTHON_UNUSED int __pyx_v_dtype_signed; char __pyx_v_kind; + int __pyx_v_arg_is_pythran_compatible; PyObject *__pyx_v_arg = NULL; PyObject *__pyx_v_dtype = NULL; PyObject *__pyx_v_arg_base = NULL; + PyObject *__pyx_v_byteorder = NULL; + PyObject *__pyx_v_cur_stride = NULL; + PyObject *__pyx_v_dim = NULL; + PyObject *__pyx_v_stride = NULL; PyObject *__pyx_v_candidates = NULL; PyObject *__pyx_v_sig = NULL; int __pyx_v_match_found; - PyObject *__pyx_v_src_type = NULL; + PyObject *__pyx_v_src_sig = NULL; PyObject *__pyx_v_dst_type = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; + long __pyx_t_7; + int __pyx_t_8; PyObject *__pyx_t_9 = NULL; - Py_ssize_t __pyx_t_10; - long __pyx_t_11; - __Pyx_memviewslice __pyx_t_12; - Py_ssize_t __pyx_t_13; - int __pyx_t_14; + PyObject *(*__pyx_t_10)(PyObject *); + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + __Pyx_memviewslice __pyx_t_14; Py_ssize_t __pyx_t_15; - PyObject *(*__pyx_t_16)(PyObject *); - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - PyObject *(*__pyx_t_20)(PyObject *); - int __pyx_t_21; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; __Pyx_RefNannySetupContext("identify_contours", 0); __Pyx_INCREF(__pyx_v_kwargs); __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) @@ -10052,128 +11097,105 @@ PyList_SET_ITEM(__pyx_t_1, 0, Py_None); __pyx_v_dest_sig = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = (__pyx_v_kwargs == Py_None); - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_v_kwargs != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; } - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - /*try:*/ { - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_numpy = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 523, __pyx_L4_error) - __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); - __pyx_t_1 = 0; - } - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L11_try_end; - __pyx_L4_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); - if (__pyx_t_7) { - __Pyx_AddTraceback("yt.utilities.lib.contour_finding.ParticleContourTree.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 523, __pyx_L6_except_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(Py_None); - __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L5_exception_handled; - } - goto __pyx_L6_except_error; - __pyx_L6_except_error:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); - goto __pyx_L1_error; - __pyx_L5_exception_handled:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); - __pyx_L11_try_end:; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_3 = ((!__pyx_t_4) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + __Pyx_INCREF(Py_None); + __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); + __pyx_t_1 = 0; __pyx_v_itemsize = -1L; + __pyx_v_arg_is_pythran_compatible = 0; if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 523, __pyx_L1_error) } - __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 523, __pyx_L1_error) - __pyx_t_3 = ((3 < __pyx_t_10) != 0); - if (__pyx_t_3) { + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_2 = ((3 < __pyx_t_5) != 0); + if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 523, __pyx_L1_error) } - __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 3); - __Pyx_INCREF(__pyx_t_9); - __pyx_v_arg = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L14; + __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 3); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_arg = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6; + } + __pyx_t_3 = (__pyx_v_kwargs != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L7_bool_binop_done; } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 523, __pyx_L1_error) } - __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_positions, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_positions, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 523, __pyx_L1_error) } - __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_positions); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_v_arg = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L14; + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_positions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_arg = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6; } /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 523, __pyx_L1_error) } - __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 523, __pyx_L1_error) - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_int_7); + __Pyx_GIVEREF(__pyx_int_7); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_7); + __Pyx_INCREF(__pyx_n_s_s); + __Pyx_GIVEREF(__pyx_n_s_s); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_s); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 523, __pyx_L1_error) } - __pyx_L14:; + __pyx_L6:; while (1) { __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None)); __pyx_t_3 = (__pyx_t_2 != 0); @@ -10181,93 +11203,293 @@ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_dtype = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L18; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_dtype = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_arg_is_pythran_compatible = 1; + goto __pyx_L12; } __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_arg_base = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_arg_base = __pyx_t_1; + __pyx_t_1 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_dtype = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L19; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_dtype = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L13; } /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_dtype = Py_None; } - __pyx_L19:; - goto __pyx_L18; + __pyx_L13:; + goto __pyx_L12; } /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_dtype = Py_None; } - __pyx_L18:; + __pyx_L12:; __pyx_v_itemsize = -1L; __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_itemsize = __pyx_t_10; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_kind = __pyx_t_11; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_itemsize = __pyx_t_5; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_1); if (unlikely(__pyx_t_7 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_kind = __pyx_t_7; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_byteorder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_byteorder = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_byteorder, __pyx_kp_s__5, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_8 = __Pyx_Is_Little_Endian(); + __pyx_t_2 = ((!(__pyx_t_8 != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L16_bool_binop_done:; + if (__pyx_t_3) { + __pyx_v_arg_is_pythran_compatible = 0; + } + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_byteorder, __pyx_kp_s__6, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_8 = __Pyx_Is_Little_Endian(); + __pyx_t_2 = (__pyx_t_8 != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L19_bool_binop_done:; + if (__pyx_t_3) { + __pyx_v_arg_is_pythran_compatible = 0; + } __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); + __pyx_t_3 = (__pyx_v_arg_is_pythran_compatible != 0); + if (__pyx_t_3) { + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cur_stride = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_reversed, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_strides); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_reversed, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_9 = __pyx_t_6; __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 523, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_9))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_10(__pyx_t_9); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 523, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 523, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_11 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_11); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L24_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L24_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_unpacking_done; + __pyx_L24_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_L25_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_6 = PyObject_RichCompare(__pyx_v_stride, __pyx_v_cur_stride, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { + __pyx_v_arg_is_pythran_compatible = 0; + goto __pyx_L23_break; + } + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_cur_stride, __pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_cur_stride, __pyx_t_6); + __pyx_t_6 = 0; + } + /*else*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L28_bool_binop_done; + } + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_11, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = __pyx_t_2; + __pyx_L28_bool_binop_done:; + __pyx_v_arg_is_pythran_compatible = (!__pyx_t_3); + } + __pyx_L23_break:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } switch (__pyx_v_kind) { case 'i': case 'u': break; case 'f': - __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0); + __pyx_t_2 = (((sizeof(float)) == __pyx_v_itemsize) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L22_bool_binop_done; + goto __pyx_L31_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L22_bool_binop_done:; + __pyx_L31_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 523, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + goto __pyx_L10_break; } - __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize) != 0); + __pyx_t_2 = (((sizeof(double)) == __pyx_v_itemsize) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L25_bool_binop_done; + goto __pyx_L34_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L25_bool_binop_done:; + __pyx_L34_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 523, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + goto __pyx_L10_break; } break; case 'c': @@ -10282,19 +11504,19 @@ if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L28_bool_binop_done; + goto __pyx_L37_bool_binop_done; } - __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0); + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(float))) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L28_bool_binop_done:; + __pyx_L37_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg); - __pyx_v_memslice = __pyx_t_12; + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(__pyx_v_arg); + __pyx_v_memslice = __pyx_t_14; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 523, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); @@ -10304,207 +11526,113 @@ if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L32_bool_binop_done; + goto __pyx_L41_bool_binop_done; } - __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0); + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(double))) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L32_bool_binop_done:; + __pyx_L41_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg); - __pyx_v_memslice = __pyx_t_12; + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_v_arg); + __pyx_v_memslice = __pyx_t_14; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 523, __pyx_L1_error) - goto __pyx_L16_break; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 523, __pyx_L1_error) - goto __pyx_L16_break; + goto __pyx_L10_break; } - __pyx_L16_break:; - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_candidates = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_10 = 0; + __pyx_L10_break:; + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_candidates = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_5 = 0; if (unlikely(((PyObject *)__pyx_v_signatures) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 523, __pyx_L1_error) } - __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); - __pyx_t_8 = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_15), (&__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __pyx_t_9 = __pyx_t_6; + __pyx_t_6 = 0; while (1) { - __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7); - if (unlikely(__pyx_t_14 == 0)) break; - if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_15, &__pyx_t_5, &__pyx_t_6, NULL, NULL, __pyx_t_8); + if (unlikely(__pyx_t_16 == 0)) break; + if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_6); + __pyx_t_6 = 0; __pyx_v_match_found = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); - __Pyx_INCREF(__pyx_v_dest_sig); - __Pyx_GIVEREF(__pyx_v_dest_sig); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0; - __pyx_t_16 = NULL; - } else { - __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 523, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_16)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { - if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_16(__pyx_t_9); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 523, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 523, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_17 = PyList_GET_ITEM(sequence, 0); - __pyx_t_18 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_17); - __Pyx_INCREF(__pyx_t_18); - #else - __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_18); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_19); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; - index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L39_unpacking_failed; - __Pyx_GOTREF(__pyx_t_17); - index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L39_unpacking_failed; - __Pyx_GOTREF(__pyx_t_18); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - __pyx_t_20 = NULL; - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - goto __pyx_L40_unpacking_done; - __pyx_L39_unpacking_failed:; - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_20 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 523, __pyx_L1_error) - __pyx_L40_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17); - __pyx_t_17 = 0; - __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18); - __pyx_t_18 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_17 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 523, __pyx_L1_error) + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_i = __pyx_t_18; + __pyx_t_11 = PyList_GET_ITEM(__pyx_v_dest_sig, __pyx_v_i); + __Pyx_INCREF(__pyx_t_11); + __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_11); + __pyx_t_11 = 0; __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_11, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; - goto __pyx_L42; + goto __pyx_L49; } /*else*/ { __pyx_v_match_found = 0; - goto __pyx_L38_break; + goto __pyx_L47_break; } - __pyx_L42:; + __pyx_L49:; } } - __pyx_L38_break:; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_L47_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 523, __pyx_L1_error) } } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 523, __pyx_L1_error) } - __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 523, __pyx_L1_error) - __pyx_t_3 = ((__pyx_t_13 > 1) != 0); + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_15 > 1) != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 523, __pyx_L1_error) } /*else*/ { @@ -10513,33 +11641,35 @@ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 523, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; goto __pyx_L0; } /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_17); - __Pyx_XDECREF(__pyx_t_18); - __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("yt.utilities.lib.contour_finding.ParticleContourTree.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dest_sig); __Pyx_XDECREF(__pyx_v_ndarray); - __Pyx_XDECREF(__pyx_v_numpy); __Pyx_XDECREF(__pyx_v_arg); __Pyx_XDECREF(__pyx_v_dtype); __Pyx_XDECREF(__pyx_v_arg_base); + __Pyx_XDECREF(__pyx_v_byteorder); + __Pyx_XDECREF(__pyx_v_cur_stride); + __Pyx_XDECREF(__pyx_v_dim); + __Pyx_XDECREF(__pyx_v_stride); __Pyx_XDECREF(__pyx_v_candidates); __Pyx_XDECREF(__pyx_v_sig); - __Pyx_XDECREF(__pyx_v_src_type); + __Pyx_XDECREF(__pyx_v_src_sig); __Pyx_XDECREF(__pyx_v_dst_type); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_XGIVEREF(__pyx_r); @@ -10568,11 +11698,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -10581,26 +11717,31 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_octree)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dom_ind)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("identify_contours", 1, 6, 6, 1); __PYX_ERR(0, 523, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("identify_contours", 1, 6, 6, 2); __PYX_ERR(0, 523, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_particle_ids)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("identify_contours", 1, 6, 6, 3); __PYX_ERR(0, 523, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("identify_contours", 1, 6, 6, 4); __PYX_ERR(0, 523, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_offset)) != 0)) kw_args--; else { @@ -10672,7 +11813,7 @@ int __pyx_v_verbose; struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **__pyx_v_container; __pyx_t_5numpy_int64_t *__pyx_v_ipind; - __pyx_t_5numpy_float32_t *__pyx_v_fpos; + float *__pyx_v_fpos; int __pyx_v_nsize; __pyx_t_5numpy_int64_t *__pyx_v_nind; __pyx_t_5numpy_int64_t __pyx_v_frac; @@ -10774,7 +11915,7 @@ __pyx_pybuffernd_dom_ind.diminfo[0].strides = __pyx_pybuffernd_dom_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dom_ind.diminfo[0].shape = __pyx_pybuffernd_dom_ind.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_positions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 523, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_positions, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 523, __pyx_L1_error) } __pyx_pybuffernd_positions.diminfo[0].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_positions.diminfo[0].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_positions.diminfo[1].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_positions.diminfo[1].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[1]; { @@ -11169,7 +12310,7 @@ */ __pyx_t_13 = __pyx_v_i; __pyx_t_14 = __pyx_v_j; - (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_positions.diminfo[1].strides)); + (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_positions.diminfo[1].strides)); } /* "yt/utilities/lib/contour_finding.pyx":555 @@ -11262,7 +12403,7 @@ * pdoms[i] = offset * pind = np.argsort(pdoms) # <<<<<<<<<<<<<< * cdef np.int64_t *ipind = pind.data - * cdef anyfloat *fpos = positions.data + * cdef floating *fpos = positions.data */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -11338,7 +12479,7 @@ * pdoms[i] = offset * pind = np.argsort(pdoms) * cdef np.int64_t *ipind = pind.data # <<<<<<<<<<<<<< - * cdef anyfloat *fpos = positions.data + * cdef floating *fpos = positions.data * # pind is now the pointer into the position and particle_ids array. */ __pyx_v_ipind = ((__pyx_t_5numpy_int64_t *)__pyx_v_pind->data); @@ -11346,14 +12487,14 @@ /* "yt/utilities/lib/contour_finding.pyx":563 * pind = np.argsort(pdoms) * cdef np.int64_t *ipind = pind.data - * cdef anyfloat *fpos = positions.data # <<<<<<<<<<<<<< + * cdef floating *fpos = positions.data # <<<<<<<<<<<<<< * # pind is now the pointer into the position and particle_ids array. * for i in range(positions.shape[0]): */ - __pyx_v_fpos = ((__pyx_t_5numpy_float32_t *)__pyx_v_positions->data); + __pyx_v_fpos = ((float *)__pyx_v_positions->data); /* "yt/utilities/lib/contour_finding.pyx":565 - * cdef anyfloat *fpos = positions.data + * cdef floating *fpos = positions.data * # pind is now the pointer into the position and particle_ids array. * for i in range(positions.shape[0]): # <<<<<<<<<<<<<< * offset = pdoms[pind[i]] @@ -11606,7 +12747,7 @@ */ __pyx_t_28 = __pyx_v_offset; __pyx_t_29 = __pyx_v_j; - (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_positions.diminfo[1].strides)); + (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_positions.diminfo[1].strides)); } /* "yt/utilities/lib/contour_finding.pyx":586 @@ -12097,7 +13238,7 @@ * @cython.wraparound(False) * def identify_contours(self, OctreeContainer octree, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] dom_ind, - * np.ndarray[anyfloat, ndim=2] positions, + * np.ndarray[floating, ndim=2] positions, */ /* function exit code */ @@ -12163,11 +13304,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -12176,26 +13323,31 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_octree)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dom_ind)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("identify_contours", 1, 6, 6, 1); __PYX_ERR(0, 523, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("identify_contours", 1, 6, 6, 2); __PYX_ERR(0, 523, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_particle_ids)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("identify_contours", 1, 6, 6, 3); __PYX_ERR(0, 523, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("identify_contours", 1, 6, 6, 4); __PYX_ERR(0, 523, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_offset)) != 0)) kw_args--; else { @@ -12267,7 +13419,7 @@ int __pyx_v_verbose; struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **__pyx_v_container; __pyx_t_5numpy_int64_t *__pyx_v_ipind; - __pyx_t_5numpy_float64_t *__pyx_v_fpos; + double *__pyx_v_fpos; int __pyx_v_nsize; __pyx_t_5numpy_int64_t *__pyx_v_nind; __pyx_t_5numpy_int64_t __pyx_v_frac; @@ -12369,7 +13521,7 @@ __pyx_pybuffernd_dom_ind.diminfo[0].strides = __pyx_pybuffernd_dom_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dom_ind.diminfo[0].shape = __pyx_pybuffernd_dom_ind.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_positions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 523, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_positions, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 523, __pyx_L1_error) } __pyx_pybuffernd_positions.diminfo[0].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_positions.diminfo[0].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_positions.diminfo[1].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_positions.diminfo[1].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[1]; { @@ -12764,7 +13916,7 @@ */ __pyx_t_13 = __pyx_v_i; __pyx_t_14 = __pyx_v_j; - (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_positions.diminfo[1].strides)); + (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(double *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_positions.diminfo[1].strides)); } /* "yt/utilities/lib/contour_finding.pyx":555 @@ -12857,7 +14009,7 @@ * pdoms[i] = offset * pind = np.argsort(pdoms) # <<<<<<<<<<<<<< * cdef np.int64_t *ipind = pind.data - * cdef anyfloat *fpos = positions.data + * cdef floating *fpos = positions.data */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -12933,7 +14085,7 @@ * pdoms[i] = offset * pind = np.argsort(pdoms) * cdef np.int64_t *ipind = pind.data # <<<<<<<<<<<<<< - * cdef anyfloat *fpos = positions.data + * cdef floating *fpos = positions.data * # pind is now the pointer into the position and particle_ids array. */ __pyx_v_ipind = ((__pyx_t_5numpy_int64_t *)__pyx_v_pind->data); @@ -12941,14 +14093,14 @@ /* "yt/utilities/lib/contour_finding.pyx":563 * pind = np.argsort(pdoms) * cdef np.int64_t *ipind = pind.data - * cdef anyfloat *fpos = positions.data # <<<<<<<<<<<<<< + * cdef floating *fpos = positions.data # <<<<<<<<<<<<<< * # pind is now the pointer into the position and particle_ids array. * for i in range(positions.shape[0]): */ - __pyx_v_fpos = ((__pyx_t_5numpy_float64_t *)__pyx_v_positions->data); + __pyx_v_fpos = ((double *)__pyx_v_positions->data); /* "yt/utilities/lib/contour_finding.pyx":565 - * cdef anyfloat *fpos = positions.data + * cdef floating *fpos = positions.data * # pind is now the pointer into the position and particle_ids array. * for i in range(positions.shape[0]): # <<<<<<<<<<<<<< * offset = pdoms[pind[i]] @@ -13201,7 +14353,7 @@ */ __pyx_t_28 = __pyx_v_offset; __pyx_t_29 = __pyx_v_j; - (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_positions.diminfo[1].strides)); + (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(double *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_positions.diminfo[1].strides)); } /* "yt/utilities/lib/contour_finding.pyx":586 @@ -13692,7 +14844,7 @@ * @cython.wraparound(False) * def identify_contours(self, OctreeContainer octree, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] dom_ind, - * np.ndarray[anyfloat, ndim=2] positions, + * np.ndarray[floating, ndim=2] positions, */ /* function exit code */ @@ -13741,11 +14893,11 @@ * @cython.boundscheck(False) * @cython.wraparound(False) * cdef void link_particles(self, ContourID **container, # <<<<<<<<<<<<<< - * anyfloat *positions, + * floating *positions, * np.int64_t *pind, */ -static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_link_particles(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **__pyx_v_container, __pyx_t_5numpy_float32_t *__pyx_v_positions, __pyx_t_5numpy_int64_t *__pyx_v_pind, __pyx_t_5numpy_int64_t __pyx_v_pcount, __pyx_t_5numpy_int64_t __pyx_v_noffset, __pyx_t_5numpy_int64_t __pyx_v_pind0, __pyx_t_5numpy_int64_t __pyx_v_poffset) { +static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_link_particles(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **__pyx_v_container, float *__pyx_v_positions, __pyx_t_5numpy_int64_t *__pyx_v_pind, __pyx_t_5numpy_int64_t __pyx_v_pcount, __pyx_t_5numpy_int64_t __pyx_v_noffset, __pyx_t_5numpy_int64_t __pyx_v_pind0, __pyx_t_5numpy_int64_t __pyx_v_poffset) { __pyx_t_5numpy_float64_t __pyx_v_pos0[3]; __pyx_t_5numpy_float64_t __pyx_v_pos1[3]; __pyx_t_5numpy_float64_t __pyx_v_edges[2][3]; @@ -14140,7 +15292,7 @@ * @cython.boundscheck(False) * @cython.wraparound(False) * cdef void link_particles(self, ContourID **container, # <<<<<<<<<<<<<< - * anyfloat *positions, + * floating *positions, * np.int64_t *pind, */ @@ -14148,7 +15300,7 @@ __Pyx_RefNannyFinishContext(); } -static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_link_particles(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **__pyx_v_container, __pyx_t_5numpy_float64_t *__pyx_v_positions, __pyx_t_5numpy_int64_t *__pyx_v_pind, __pyx_t_5numpy_int64_t __pyx_v_pcount, __pyx_t_5numpy_int64_t __pyx_v_noffset, __pyx_t_5numpy_int64_t __pyx_v_pind0, __pyx_t_5numpy_int64_t __pyx_v_poffset) { +static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_link_particles(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__pyx_v_self, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **__pyx_v_container, double *__pyx_v_positions, __pyx_t_5numpy_int64_t *__pyx_v_pind, __pyx_t_5numpy_int64_t __pyx_v_pcount, __pyx_t_5numpy_int64_t __pyx_v_noffset, __pyx_t_5numpy_int64_t __pyx_v_pind0, __pyx_t_5numpy_int64_t __pyx_v_poffset) { __pyx_t_5numpy_float64_t __pyx_v_pos0[3]; __pyx_t_5numpy_float64_t __pyx_v_pos1[3]; __pyx_t_5numpy_float64_t __pyx_v_edges[2][3]; @@ -14543,7 +15695,7 @@ * @cython.boundscheck(False) * @cython.wraparound(False) * cdef void link_particles(self, ContourID **container, # <<<<<<<<<<<<<< - * anyfloat *positions, + * floating *positions, * np.int64_t *pind, */ @@ -14551,6 +15703,113 @@ __Pyx_RefNannyFinishContext(); } +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_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_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_10__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__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.first,self.last cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, 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.first,self.last 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("yt.utilities.lib.contour_finding.ParticleContourTree.__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.first,self.last cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_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_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_12__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *__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.first,self.last cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, 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.first,self.last cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.contour_finding.ParticleContourTree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/utilities/lib/contour_finding.pyx":702 * @cython.boundscheck(False) * @cython.wraparound(False) @@ -14780,12 +16039,1050 @@ return __pyx_r; } -/* "oct_visitors.pxd":51 - * cdef void visit(self, Oct*, np.uint8_t selected) - * - * cdef inline int oind(self): # <<<<<<<<<<<<<< - * cdef int d = (1 << self.oref) - * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) +/* "(tree fragment)":1 + * def __pyx_unpickle_TileContourTree(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x327d0a5: + * from pickle import PickleError + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_5__pyx_unpickle_TileContourTree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_15contour_finding_5__pyx_unpickle_TileContourTree = {"__pyx_unpickle_TileContourTree", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_5__pyx_unpickle_TileContourTree, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_5__pyx_unpickle_TileContourTree(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_TileContourTree (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TileContourTree", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TileContourTree", 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_TileContourTree") < 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_TileContourTree", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.contour_finding.__pyx_unpickle_TileContourTree", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_15contour_finding_4__pyx_unpickle_TileContourTree(__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_2yt_9utilities_3lib_15contour_finding_4__pyx_unpickle_TileContourTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_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_TileContourTree", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_TileContourTree(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x327d0a5: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x327d0a5 = (max_val, min_val))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x327d0a5) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_TileContourTree(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x327d0a5: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0x327d0a5 = (max_val, min_val))" % __pyx_checksum) + * result = TileContourTree.__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_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 != 0x327d0a5: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x327d0a5 = (max_val, min_val))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = TileContourTree.__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_0x32, __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_PickleError); + __pyx_t_2 = __pyx_v_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_TileContourTree(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x327d0a5: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x327d0a5 = (max_val, min_val))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0x327d0a5 = (max_val, min_val))" % __pyx_checksum) + * result = TileContourTree.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_TileContourTree__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_15contour_finding_TileContourTree), __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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0x327d0a5 = (max_val, min_val))" % __pyx_checksum) + * result = TileContourTree.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_TileContourTree__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = TileContourTree.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_TileContourTree__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_TileContourTree__set_state(TileContourTree 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_2yt_9utilities_3lib_15contour_finding___pyx_unpickle_TileContourTree__set_state(((struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_TileContourTree *)__pyx_v_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 PickleError("Incompatible checksums (%s vs 0x327d0a5 = (max_val, min_val))" % __pyx_checksum) + * result = TileContourTree.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_TileContourTree__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_TileContourTree__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_TileContourTree__set_state(TileContourTree result, tuple __pyx_state): + * result.max_val = __pyx_state[0]; result.min_val = __pyx_state[1] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_TileContourTree(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x327d0a5: + * from pickle import 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("yt.utilities.lib.contour_finding.__pyx_unpickle_TileContourTree", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_TileContourTree__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_TileContourTree__set_state(TileContourTree result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.max_val = __pyx_state[0]; result.min_val = __pyx_state[1] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_f_2yt_9utilities_3lib_15contour_finding___pyx_unpickle_TileContourTree__set_state(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_TileContourTree *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __pyx_t_5numpy_float64_t __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; + __Pyx_RefNannySetupContext("__pyx_unpickle_TileContourTree__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_TileContourTree__set_state(TileContourTree result, tuple __pyx_state): + * result.max_val = __pyx_state[0]; result.min_val = __pyx_state[1] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[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_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(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->max_val = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->min_val = __pyx_t_2; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_TileContourTree__set_state(TileContourTree result, tuple __pyx_state): + * result.max_val = __pyx_state[0]; result.min_val = __pyx_state[1] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[2]) + */ + __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "(tree fragment)":12 + * result.max_val = __pyx_state[0]; result.min_val = __pyx_state[1] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<< + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + if (!__pyx_t_7) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 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_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_TileContourTree__set_state(TileContourTree result, tuple __pyx_state): + * result.max_val = __pyx_state[0]; result.min_val = __pyx_state[1] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[2]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_TileContourTree__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_TileContourTree__set_state(TileContourTree result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.max_val = __pyx_state[0]; result.min_val = __pyx_state[1] + * if hasattr(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_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("yt.utilities.lib.contour_finding.__pyx_unpickle_TileContourTree__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_FOFNode(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xfeb1925: + * from pickle import PickleError + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_7__pyx_unpickle_FOFNode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_15contour_finding_7__pyx_unpickle_FOFNode = {"__pyx_unpickle_FOFNode", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_7__pyx_unpickle_FOFNode, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_15contour_finding_7__pyx_unpickle_FOFNode(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_FOFNode (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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FOFNode", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FOFNode", 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_FOFNode") < 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_FOFNode", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.contour_finding.__pyx_unpickle_FOFNode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_15contour_finding_6__pyx_unpickle_FOFNode(__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_2yt_9utilities_3lib_15contour_finding_6__pyx_unpickle_FOFNode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_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_FOFNode", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_FOFNode(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xfeb1925: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xfeb1925 = (count, tag))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xfeb1925) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_FOFNode(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xfeb1925: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xfeb1925 = (count, tag))" % __pyx_checksum) + * result = FOFNode.__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_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 != 0xfeb1925: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xfeb1925 = (count, tag))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = FOFNode.__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_0xfe, __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_PickleError); + __pyx_t_2 = __pyx_v_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_FOFNode(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xfeb1925: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xfeb1925 = (count, tag))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xfeb1925 = (count, tag))" % __pyx_checksum) + * result = FOFNode.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_FOFNode__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_15contour_finding_FOFNode), __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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xfeb1925 = (count, tag))" % __pyx_checksum) + * result = FOFNode.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_FOFNode__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = FOFNode.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_FOFNode__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_FOFNode__set_state(FOFNode 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_2yt_9utilities_3lib_15contour_finding___pyx_unpickle_FOFNode__set_state(((struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_FOFNode *)__pyx_v_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 PickleError("Incompatible checksums (%s vs 0xfeb1925 = (count, tag))" % __pyx_checksum) + * result = FOFNode.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_FOFNode__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_FOFNode__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_FOFNode__set_state(FOFNode result, tuple __pyx_state): + * result.count = __pyx_state[0]; result.tag = __pyx_state[1] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_FOFNode(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xfeb1925: + * from pickle import 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("yt.utilities.lib.contour_finding.__pyx_unpickle_FOFNode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_FOFNode__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_FOFNode__set_state(FOFNode result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.count = __pyx_state[0]; result.tag = __pyx_state[1] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_f_2yt_9utilities_3lib_15contour_finding___pyx_unpickle_FOFNode__set_state(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_FOFNode *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __pyx_t_5numpy_int64_t __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; + __Pyx_RefNannySetupContext("__pyx_unpickle_FOFNode__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_FOFNode__set_state(FOFNode result, tuple __pyx_state): + * result.count = __pyx_state[0]; result.tag = __pyx_state[1] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[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_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(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->count = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->tag = __pyx_t_2; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_FOFNode__set_state(FOFNode result, tuple __pyx_state): + * result.count = __pyx_state[0]; result.tag = __pyx_state[1] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[2]) + */ + __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "(tree fragment)":12 + * result.count = __pyx_state[0]; result.tag = __pyx_state[1] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<< + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + if (!__pyx_t_7) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 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_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_FOFNode__set_state(FOFNode result, tuple __pyx_state): + * result.count = __pyx_state[0]; result.tag = __pyx_state[1] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[2]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_FOFNode__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_FOFNode__set_state(FOFNode result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.count = __pyx_state[0]; result.tag = __pyx_state[1] + * if hasattr(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_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("yt.utilities.lib.contour_finding.__pyx_unpickle_FOFNode__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + */ + +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("vc_index", 0); + + /* "volume_container.pxd":31 + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): + * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< + * + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): + */ + __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); + goto __pyx_L0; + + /* "volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i + */ + +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { + int __pyx_v_index[3]; + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("vc_pos_index", 0); + + /* "volume_container.pxd":36 + * cdef int index[3] + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "volume_container.pxd":37 + * cdef int i + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< + * return vc_index(vc, index[0], index[1], index[2]) + * + */ + (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); + } + + /* "volume_container.pxd":38 + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< + * + */ + __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); + goto __pyx_L0; + + /* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oct_visitors.pxd":51 + * cdef void visit(self, Oct*, np.uint8_t selected) + * + * cdef inline int oind(self): # <<<<<<<<<<<<<< + * cdef int d = (1 << self.oref) + * return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2]) */ static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) { @@ -14875,7 +17172,7 @@ } /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -14897,7 +17194,7 @@ goto __pyx_L0; /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -14913,18 +17210,18 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":20 * - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -14936,7 +17233,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -14948,7 +17245,7 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ @@ -14988,7 +17285,7 @@ * if f0 > f1: return f0 * return f1 # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ __pyx_r = __pyx_v_f1; goto __pyx_L0; @@ -15009,18 +17306,18 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":28 * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -15032,7 +17329,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -15044,7 +17341,7 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ @@ -15132,7 +17429,7 @@ * if f0 < 0.0: return -f0 * return f0 # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_f0; goto __pyx_L0; @@ -15153,18 +17450,18 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":40 * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -15176,7 +17473,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -15193,7 +17490,7 @@ * if i > b: return b * return i # <<<<<<<<<<<<<< * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_i; goto __pyx_L0; @@ -15201,7 +17498,7 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -15214,18 +17511,18 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -15237,7 +17534,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -15262,7 +17559,7 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -15341,393 +17638,59 @@ __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * - */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("vc_index", 0); - - /* "volume_container.pxd":31 - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): - * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): - */ - __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); - goto __pyx_L0; - - /* "volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { - int __pyx_v_index[3]; - int __pyx_v_i; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("vc_pos_index", 0); - - /* "volume_container.pxd":36 - * cdef int index[3] - * cdef int i - * for i in range(3): # <<<<<<<<<<<<<< - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "volume_container.pxd":37 - * cdef int i - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< - * return vc_index(vc, index[0], index[1], index[2]) - * - */ - (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); - } - - /* "volume_container.pxd":38 - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< - * - */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); - goto __pyx_L0; - - /* "volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/geometry/selection_routines.pxd":26 - * np.float64_t - * - * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): - */ - -static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_ensure_code", 0); - - /* "yt/geometry/selection_routines.pxd":27 - * - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): # <<<<<<<<<<<<<< - * if "code_length" == str(arr.units): - * return arr - */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 27, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "yt/geometry/selection_routines.pxd":28 - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< - * return arr - * arr.convert_to_units("code_length") - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 28, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 28, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { - - /* "yt/geometry/selection_routines.pxd":29 - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): - * return arr # <<<<<<<<<<<<<< - * arr.convert_to_units("code_length") - * return arr - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_arr); - __pyx_r = __pyx_v_arr; - goto __pyx_L0; - - /* "yt/geometry/selection_routines.pxd":28 - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< - * return arr - * arr.convert_to_units("code_length") - */ - } - - /* "yt/geometry/selection_routines.pxd":30 - * if "code_length" == str(arr.units): - * return arr - * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< - * return arr - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "yt/geometry/selection_routines.pxd":27 - * - * cdef inline _ensure_code(arr): - * if hasattr(arr, "units"): # <<<<<<<<<<<<<< - * if "code_length" == str(arr.units): - * return arr - */ - } - - /* "yt/geometry/selection_routines.pxd":31 - * return arr - * arr.convert_to_units("code_length") - * return arr # <<<<<<<<<<<<<< - * - * cdef class SelectorObject: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_arr); - __pyx_r = __pyx_v_arr; - goto __pyx_L0; - - /* "yt/geometry/selection_routines.pxd":26 - * np.float64_t - * - * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< - * if hasattr(arr, "units"): - * if "code_length" == str(arr.units): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/geometry/selection_routines.pxd":78 - * cdef public np.int64_t domain_id - * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) { - __pyx_t_5numpy_float64_t __pyx_v_rel; - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/geometry/selection_routines.pxd":80 - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< - * if not periodic: return rel - * if rel > dw * 0.5: - */ - __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); - - /* "yt/geometry/selection_routines.pxd":81 - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel # <<<<<<<<<<<<<< - * if rel > dw * 0.5: - * rel -= dw - */ - __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_rel; - goto __pyx_L0; - } - - /* "yt/geometry/selection_routines.pxd":82 - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel - * if rel > dw * 0.5: # <<<<<<<<<<<<<< - * rel -= dw - * elif rel < -dw * 0.5: - */ - __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0); - if (__pyx_t_1) { - - /* "yt/geometry/selection_routines.pxd":83 - * if not periodic: return rel - * if rel > dw * 0.5: - * rel -= dw # <<<<<<<<<<<<<< - * elif rel < -dw * 0.5: - * rel += dw - */ - __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw); - - /* "yt/geometry/selection_routines.pxd":82 - * cdef np.float64_t rel = x1 - x2 - * if not periodic: return rel - * if rel > dw * 0.5: # <<<<<<<<<<<<<< - * rel -= dw - * elif rel < -dw * 0.5: - */ - goto __pyx_L4; - } - - /* "yt/geometry/selection_routines.pxd":84 - * if rel > dw * 0.5: - * rel -= dw - * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< - * rel += dw - * return rel + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0); - if (__pyx_t_1) { - /* "yt/geometry/selection_routines.pxd":85 - * rel -= dw - * elif rel < -dw * 0.5: - * rel += dw # <<<<<<<<<<<<<< - * return rel + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw); - /* "yt/geometry/selection_routines.pxd":84 - * if rel > dw * 0.5: - * rel -= dw - * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< - * rel += dw - * return rel +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":58 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - __pyx_L4:; - /* "yt/geometry/selection_routines.pxd":86 - * elif rel < -dw * 0.5: - * rel += dw - * return rel # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * */ - __pyx_r = __pyx_v_rel; + __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "yt/geometry/selection_routines.pxd":78 - * cdef public np.int64_t domain_id + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< - * np.float64_t dw, bint periodic) nogil: - * cdef np.float64_t rel = x1 - x2 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* function exit code */ @@ -15904,7 +17867,7 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -15960,7 +17923,7 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -16269,7 +18232,7 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -17084,7 +19047,7 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -17152,7 +19115,7 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -17261,7 +19224,7 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -17916,7 +19879,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -17942,7 +19905,7 @@ * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -17964,7 +19927,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -18047,7 +20010,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -18073,7 +20036,7 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -18095,7 +20058,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -18178,7 +20141,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -18201,7 +20164,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -18223,7 +20186,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -18249,6 +20212,244 @@ return __pyx_r; } +/* "yt/geometry/selection_routines.pxd":22 + * grid_visitor_function, check_child_masked + * + * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): + */ + +static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_ensure_code", 0); + + /* "yt/geometry/selection_routines.pxd":23 + * + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): # <<<<<<<<<<<<<< + * if "code_length" == str(arr.units): + * return arr + */ + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 23, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "yt/geometry/selection_routines.pxd":24 + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< + * return arr + * arr.convert_to_units("code_length") + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 24, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "yt/geometry/selection_routines.pxd":25 + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): + * return arr # <<<<<<<<<<<<<< + * arr.convert_to_units("code_length") + * return arr + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + + /* "yt/geometry/selection_routines.pxd":24 + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< + * return arr + * arr.convert_to_units("code_length") + */ + } + + /* "yt/geometry/selection_routines.pxd":26 + * if "code_length" == str(arr.units): + * return arr + * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "yt/geometry/selection_routines.pxd":23 + * + * cdef inline _ensure_code(arr): + * if hasattr(arr, "units"): # <<<<<<<<<<<<<< + * if "code_length" == str(arr.units): + * return arr + */ + } + + /* "yt/geometry/selection_routines.pxd":27 + * return arr + * arr.convert_to_units("code_length") + * return arr # <<<<<<<<<<<<<< + * + * cdef class SelectorObject: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + + /* "yt/geometry/selection_routines.pxd":22 + * grid_visitor_function, check_child_masked + * + * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< + * if hasattr(arr, "units"): + * if "code_length" == str(arr.units): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/geometry/selection_routines.pxd":78 + * cdef public SelectorObject sel2 + * + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) { + __pyx_t_5numpy_float64_t __pyx_v_rel; + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/geometry/selection_routines.pxd":80 + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 # <<<<<<<<<<<<<< + * if not periodic: return rel + * if rel > dw * 0.5: + */ + __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2); + + /* "yt/geometry/selection_routines.pxd":81 + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel # <<<<<<<<<<<<<< + * if rel > dw * 0.5: + * rel -= dw + */ + __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_rel; + goto __pyx_L0; + } + + /* "yt/geometry/selection_routines.pxd":82 + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel + * if rel > dw * 0.5: # <<<<<<<<<<<<<< + * rel -= dw + * elif rel < -dw * 0.5: + */ + __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0); + if (__pyx_t_1) { + + /* "yt/geometry/selection_routines.pxd":83 + * if not periodic: return rel + * if rel > dw * 0.5: + * rel -= dw # <<<<<<<<<<<<<< + * elif rel < -dw * 0.5: + * rel += dw + */ + __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw); + + /* "yt/geometry/selection_routines.pxd":82 + * cdef np.float64_t rel = x1 - x2 + * if not periodic: return rel + * if rel > dw * 0.5: # <<<<<<<<<<<<<< + * rel -= dw + * elif rel < -dw * 0.5: + */ + goto __pyx_L4; + } + + /* "yt/geometry/selection_routines.pxd":84 + * if rel > dw * 0.5: + * rel -= dw + * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< + * rel += dw + * return rel + */ + __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0); + if (__pyx_t_1) { + + /* "yt/geometry/selection_routines.pxd":85 + * rel -= dw + * elif rel < -dw * 0.5: + * rel += dw # <<<<<<<<<<<<<< + * return rel + */ + __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw); + + /* "yt/geometry/selection_routines.pxd":84 + * if rel > dw * 0.5: + * rel -= dw + * elif rel < -dw * 0.5: # <<<<<<<<<<<<<< + * rel += dw + * return rel + */ + } + __pyx_L4:; + + /* "yt/geometry/selection_routines.pxd":86 + * elif rel < -dw * 0.5: + * rel += dw + * return rel # <<<<<<<<<<<<<< + */ + __pyx_r = __pyx_v_rel; + goto __pyx_L0; + + /* "yt/geometry/selection_routines.pxd":78 + * cdef public SelectorObject sel2 + * + * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< + * np.float64_t dw, bint periodic) nogil: + * cdef np.float64_t rel = x1 - x2 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + /* "yt/utilities/lib/contour_finding.pxd":20 * cimport cython * @@ -18351,6 +20552,43 @@ return __pyx_r; } +/* "yt/geometry/oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) + * + */ + +static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) { + struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_cont", 0); + + /* "yt/geometry/oct_container.pxd":57 + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): + * return (&self.containers[i]) # <<<<<<<<<<<<<< + * + * cdef OctList *OctList_append(OctList *list, Oct *o) + */ + __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i]))); + goto __pyx_L0; + + /* "yt/geometry/oct_container.pxd":56 + * + * cdef class OctObjectPool(ObjectPool): + * cdef inline OctAllocationContainer *get_cont(self, int i): # <<<<<<<<<<<<<< + * return (&self.containers[i]) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "View.MemoryView":120 * cdef bint dtype_is_object * @@ -18379,10 +20617,15 @@ 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; } @@ -18391,21 +20634,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -18413,12 +20660,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -18427,11 +20676,11 @@ } } __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(3, 120, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 121, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) } else { /* "View.MemoryView":121 @@ -18446,15 +20695,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(3, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(3, 120, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __pyx_L1_error) } __pyx_r = __pyx_array___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); @@ -18505,9 +20754,9 @@ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(3, 127, __pyx_L1_error) + __PYX_ERR(1, 127, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 127, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 @@ -18536,11 +20785,11 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 131, __pyx_L1_error) + __PYX_ERR(1, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize @@ -18568,11 +20817,11 @@ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 134, __pyx_L1_error) + __PYX_ERR(1, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") @@ -18601,9 +20850,9 @@ * 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(3, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -18625,7 +20874,7 @@ * 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(3, 138, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) __pyx_t_5 = __pyx_v_format; __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -18641,7 +20890,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -18679,11 +20928,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 146, __pyx_L1_error) + __PYX_ERR(1, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim @@ -18706,12 +20955,12 @@ 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(3, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 149, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dim = __pyx_t_8; __pyx_v_idx = __pyx_t_7; @@ -18734,11 +20983,11 @@ * self._shape[idx] = dim * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); @@ -18746,20 +20995,20 @@ 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(3, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(3, 151, __pyx_L1_error) + __PYX_ERR(1, 151, __pyx_L1_error) /* "View.MemoryView":150 * @@ -18796,7 +21045,7 @@ * 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(3, 155, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":156 @@ -18838,7 +21087,7 @@ * 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(3, 158, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":159 @@ -18881,19 +21130,19 @@ * 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(3, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 162, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 162, __pyx_L1_error) + __PYX_ERR(1, 162, __pyx_L1_error) } __pyx_L10:; @@ -18922,8 +21171,8 @@ * if allocate_buffer: * */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 168, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; @@ -18963,11 +21212,11 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 174, __pyx_L1_error) + __PYX_ERR(1, 174, __pyx_L1_error) /* "View.MemoryView":173 * @@ -19006,11 +21255,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(3, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __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(3, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { @@ -19131,7 +21380,7 @@ * 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(3, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -19161,7 +21410,7 @@ * 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(3, 187, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { @@ -19201,11 +21450,11 @@ * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 190, __pyx_L1_error) + __PYX_ERR(1, 190, __pyx_L1_error) /* "View.MemoryView":189 * elif self.mode == u"fortran": @@ -19545,7 +21794,7 @@ * @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(3, 221, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -19604,11 +21853,11 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 226, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -19619,7 +21868,7 @@ 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(3, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -19683,9 +21932,9 @@ * 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(3, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -19748,9 +21997,9 @@ * 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(3, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 233, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -19811,9 +22060,9 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(3, 236, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":235 @@ -19836,6 +22085,113 @@ 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__31, 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__32, 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":240 * * @cname("__pyx_array_new") @@ -19872,13 +22228,13 @@ * 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(3, 245, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -19892,7 +22248,7 @@ __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(3, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -19916,13 +22272,13 @@ * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -19944,9 +22300,9 @@ * result.data = buf * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 248, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(3, 248, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) /* "View.MemoryView":247 * result = array(shape, itemsize, format, mode.decode('ASCII')) @@ -19955,7 +22311,7 @@ * 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(3, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -20031,6 +22387,7 @@ 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; } @@ -20041,7 +22398,7 @@ 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(3, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -20052,7 +22409,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -20060,90 +22417,377 @@ __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; -} + /* 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":278 + * 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":277 + * 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":279 + * 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":280 + * 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":279 + * 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; -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); + /* "(tree fragment)":10 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + } - /* "View.MemoryView":278 - * cdef object name - * def __init__(self, name): - * self.name = name # <<<<<<<<<<<<<< - * def __repr__(self): - * return self.name + /* "(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) */ - __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; + /*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; + } - /* "View.MemoryView":277 - * cdef class Enum(object): - * cdef object name - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * def __repr__(self): + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.name,) */ /* function exit code */ - __pyx_r = 0; + __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; } -/* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * +/* "(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_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { +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("__repr__ (wrapper)", 0); - __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + __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_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { +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 - __Pyx_RefNannySetupContext("__repr__", 0); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "View.MemoryView":280 - * self.name = name - * def __repr__(self): - * return self.name # <<<<<<<<<<<<<< - * - * cdef generic = Enum("") + /* "(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) # <<<<<<<<<<<<<< */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->name); - __pyx_r = __pyx_v_self->name; - goto __pyx_L0; + 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; - /* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * + /* "(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(); @@ -20258,8 +22902,11 @@ 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; } @@ -20268,11 +22915,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(3, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -20280,11 +22929,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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; @@ -20292,16 +22942,16 @@ } } __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(3, 341, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 341, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -20372,7 +23022,7 @@ * 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 == -1)) __PYX_ERR(3, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) /* "View.MemoryView":346 * if type(self) is memoryview or obj is not None: @@ -20493,7 +23143,7 @@ * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(3, 357, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) /* "View.MemoryView":356 * if self.lock is NULL: @@ -20834,26 +23484,26 @@ __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(3, 389, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 389, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(3, 389, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(3, 389, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -20863,7 +23513,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 389, __pyx_L1_error) + else __PYX_ERR(1, 389, __pyx_L1_error) } break; } @@ -20881,8 +23531,8 @@ * * 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(3, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":389 @@ -20999,7 +23649,7 @@ * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 399, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -21011,7 +23661,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 399, __pyx_L1_error) + __PYX_ERR(1, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -21019,14 +23669,14 @@ __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(3, 399, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 399, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 399, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; @@ -21040,7 +23690,7 @@ * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":403 @@ -21051,7 +23701,7 @@ * 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(3, 403, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -21074,7 +23724,7 @@ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(3, 405, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":406 @@ -21085,7 +23735,7 @@ * 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(3, 406, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -21155,7 +23805,7 @@ * * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 409, __pyx_L1_error) + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; @@ -21167,7 +23817,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 409, __pyx_L1_error) + __PYX_ERR(1, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); @@ -21175,14 +23825,14 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 409, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 409, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 409, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; @@ -21196,7 +23846,7 @@ * obj = self.is_slice(value) * if obj: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":412 @@ -21206,7 +23856,7 @@ * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 412, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; @@ -21218,7 +23868,7 @@ * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":414 @@ -21228,9 +23878,9 @@ * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 414, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -21253,10 +23903,10 @@ * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 416, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -21281,7 +23931,7 @@ * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 418, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -21369,7 +24019,7 @@ * 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(3, 423, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":424 @@ -21379,7 +24029,7 @@ * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 424, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":423 @@ -21389,7 +24039,7 @@ * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 423, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -21400,7 +24050,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(3, 423, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -21417,7 +24067,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -21434,7 +24084,7 @@ __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(3, 425, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); @@ -21477,7 +24127,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -21549,7 +24199,7 @@ * 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(3, 434, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":435 * @@ -21558,7 +24208,7 @@ * 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(3, 435, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) /* "View.MemoryView":436 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], @@ -21567,13 +24217,13 @@ * * 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(3, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":434 @@ -21583,7 +24233,7 @@ * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 434, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":430 * return obj @@ -21689,7 +24339,7 @@ * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(3, 450, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) /* "View.MemoryView":449 * if self.view.itemsize > sizeof(array): @@ -21777,7 +24427,7 @@ * */ /*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(3, 459, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 459, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -21800,7 +24450,7 @@ * 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(3, 464, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -21915,7 +24565,7 @@ * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(3, 471, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":472 @@ -21925,7 +24575,7 @@ * * 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(3, 472, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -21984,7 +24634,7 @@ * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -21996,7 +24646,7 @@ * 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(3, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -22024,9 +24674,9 @@ * 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(3, 482, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 482, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -22043,7 +24693,7 @@ #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(3, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -22052,14 +24702,14 @@ #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(3, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 482, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -22070,7 +24720,7 @@ __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(3, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -22107,7 +24757,7 @@ * */ __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(3, 487, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22149,13 +24799,13 @@ * raise ValueError("Unable to convert item to object") * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 483, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(3, 483, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); @@ -22167,11 +24817,11 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(3, 484, __pyx_L5_except_error) + __PYX_ERR(1, 484, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -22262,7 +24912,7 @@ * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -22285,26 +24935,26 @@ * 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(3, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(3, 499, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -22326,9 +24976,9 @@ * 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(3, 501, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -22345,7 +24995,7 @@ #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(3, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -22354,14 +25004,14 @@ #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(3, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 501, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -22372,12 +25022,12 @@ __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(3, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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(3, 501, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 501, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } @@ -22393,7 +25043,7 @@ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(3, 503, __pyx_L1_error) + __PYX_ERR(1, 503, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -22780,9 +25430,9 @@ * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 540, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(3, 540, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; @@ -22793,7 +25443,7 @@ * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(3, 541, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) /* "View.MemoryView":542 * cdef _memoryviewslice result = memoryview_copy(self) @@ -22920,18 +25570,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 550, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_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(3, 550, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 550, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 550, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; @@ -23008,11 +25658,11 @@ * * 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(3, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(3, 556, __pyx_L1_error) + __PYX_ERR(1, 556, __pyx_L1_error) /* "View.MemoryView":554 * @property @@ -23031,18 +25681,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 558, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_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(3, 558, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 558, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 558, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; @@ -23120,9 +25770,9 @@ * 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(3, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__27, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__35, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -23146,18 +25796,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 565, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 565, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(3, 565, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 565, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -23219,7 +25869,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -23279,7 +25929,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -23341,11 +25991,11 @@ * @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(3, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 577, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23439,7 +26089,7 @@ __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(3, 584, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; @@ -23451,7 +26101,7 @@ * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 585, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; @@ -23629,12 +26279,12 @@ * */ __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(3, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23645,12 +26295,12 @@ * * def __str__(self): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 599, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23661,7 +26311,7 @@ * id(self)) * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -23669,7 +26319,7 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -23733,20 +26383,20 @@ * */ __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(3, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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(3, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -23819,7 +26469,7 @@ * 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(3, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -23890,7 +26540,7 @@ * 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(3, 615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -23970,7 +26620,7 @@ * 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(3, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":627 @@ -23981,7 +26631,7 @@ * 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(3, 627, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -24062,7 +26712,7 @@ * 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(3, 634, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":639 @@ -24073,7 +26723,7 @@ * */ __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(3, 639, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -24098,6 +26748,113 @@ 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__36, 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__37, 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":643 * * @cname('__pyx_memoryview_new') @@ -24122,11 +26879,11 @@ * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -24137,7 +26894,7 @@ 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(3, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); @@ -24274,7 +27031,7 @@ * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -24312,7 +27069,7 @@ * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 662, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -24348,26 +27105,26 @@ __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(3, 665, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(3, 665, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(3, 665, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -24377,7 +27134,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 665, __pyx_L1_error) + else __PYX_ERR(1, 665, __pyx_L1_error) } break; } @@ -24387,7 +27144,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(3, 665, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -24421,17 +27178,17 @@ * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 668, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__28); - __Pyx_GIVEREF(__pyx_slice__28); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__28); + __Pyx_INCREF(__pyx_slice__38); + __Pyx_GIVEREF(__pyx_slice__38); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__38); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":669 @@ -24461,7 +27218,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__29); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__39); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) } __pyx_L7:; @@ -24511,19 +27268,19 @@ * * 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(3, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 675, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(3, 675, __pyx_L1_error) + __PYX_ERR(1, 675, __pyx_L1_error) /* "View.MemoryView":674 * have_slices = True @@ -24560,7 +27317,7 @@ * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 678, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) } __pyx_L6:; @@ -24582,7 +27339,7 @@ * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 680, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":681 @@ -24602,16 +27359,16 @@ * * 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(3, 682, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__30); - __Pyx_GIVEREF(__pyx_slice__30); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__30); + __Pyx_INCREF(__pyx_slice__40); + __Pyx_GIVEREF(__pyx_slice__40); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__40); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":681 @@ -24633,20 +27390,20 @@ __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(3, 684, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 684, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 684, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 684, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -24732,11 +27489,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 689, __pyx_L1_error) + __PYX_ERR(1, 689, __pyx_L1_error) /* "View.MemoryView":688 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): @@ -24840,7 +27597,7 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(3, 708, __pyx_L1_error) + __PYX_ERR(1, 708, __pyx_L1_error) } } #endif @@ -24863,7 +27620,7 @@ * 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(3, 711, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -24959,26 +27716,26 @@ __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(3, 732, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 732, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(3, 732, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(3, 732, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -24988,7 +27745,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 732, __pyx_L1_error) + else __PYX_ERR(1, 732, __pyx_L1_error) } break; } @@ -25016,7 +27773,7 @@ * 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(3, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) /* "View.MemoryView":734 * for dim, index in enumerate(indices): @@ -25025,7 +27782,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 734, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) /* "View.MemoryView":733 * @@ -25102,13 +27859,13 @@ * 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(3, 746, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 746, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -25124,13 +27881,13 @@ * 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(3, 747, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 747, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -25146,13 +27903,13 @@ * * 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(3, 748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 748, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -25168,7 +27925,7 @@ * 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(3, 750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -25181,7 +27938,7 @@ * 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(3, 751, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -25194,7 +27951,7 @@ * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 752, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -25207,7 +27964,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 754, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) /* "View.MemoryView":760 * have_start, have_stop, have_step, @@ -25257,7 +28014,7 @@ * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 764, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } /* "View.MemoryView":765 * return memoryview_fromslice(dst, new_ndim, @@ -25266,7 +28023,7 @@ * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 765, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } /* "View.MemoryView":763 * @@ -25275,9 +28032,9 @@ * 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(3, 763, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 763, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -25308,7 +28065,7 @@ * * */ - __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(3, 768, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":768 @@ -25318,7 +28075,7 @@ * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -25421,7 +28178,7 @@ * 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 == -1)) __PYX_ERR(3, 818, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: @@ -25486,7 +28243,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 824, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) /* "View.MemoryView":823 * negative_step = have_step != 0 and step < 0 @@ -26058,7 +28815,7 @@ * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 885, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) } __pyx_L26:; @@ -26115,11 +28872,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -26187,11 +28944,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(3, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __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(3, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); @@ -26299,22 +29056,22 @@ * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(3, 914, __pyx_L1_error) + __PYX_ERR(1, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: @@ -26351,22 +29108,22 @@ * * resultp = bufp + index * stride */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 917, __pyx_L1_error) + __PYX_ERR(1, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) @@ -26566,7 +29323,7 @@ * * return 1 */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 943, __pyx_L1_error) + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] @@ -26600,11 +29357,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -26689,7 +29446,7 @@ * 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(3, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -26713,7 +29470,7 @@ */ /*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(3, 969, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -26772,7 +29529,7 @@ * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(3, 973, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) /* "View.MemoryView":972 * @@ -26792,7 +29549,7 @@ * @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(3, 975, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -26872,6 +29629,113 @@ 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__42, 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__43, 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":985 * * @cname('__pyx_memoryview_fromslice') @@ -26935,9 +29799,9 @@ * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 999, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -26948,7 +29812,7 @@ __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(3, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -26979,7 +29843,7 @@ * 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(3, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -27150,7 +30014,7 @@ __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(3, 1026, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; @@ -27162,12 +30026,12 @@ * * 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(3, 1027, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1027, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1027, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } @@ -27259,7 +30123,7 @@ * 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(3, 1039, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -27316,7 +30180,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -27480,7 +30344,7 @@ * @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(3, 1067, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -27603,7 +30467,7 @@ * * */ - __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(3, 1084, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; @@ -28401,7 +31265,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) /* "View.MemoryView":1207 * @@ -28573,11 +31437,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -28601,7 +31465,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -28612,13 +31476,13 @@ * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -28637,20 +31501,20 @@ * (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(3, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1237, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 1237, __pyx_L1_error) + __PYX_ERR(1, 1237, __pyx_L1_error) /* "View.MemoryView":1235 * @@ -28670,7 +31534,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -28692,7 +31556,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -28704,11 +31568,11 @@ * * @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(3, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -28724,14 +31588,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #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(3, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -28740,20 +31604,20 @@ #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(3, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -28761,7 +31625,7 @@ __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(3, 1242, __pyx_L1_error) + __PYX_ERR(1, 1242, __pyx_L1_error) /* "View.MemoryView":1241 * @@ -28783,7 +31647,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -28806,7 +31670,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -28828,7 +31692,7 @@ * 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(3, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -28842,14 +31706,14 @@ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #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(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -28858,20 +31722,20 @@ #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(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -28879,7 +31743,7 @@ __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(3, 1247, __pyx_L1_error) + __PYX_ERR(1, 1247, __pyx_L1_error) /* "View.MemoryView":1246 * @cname('__pyx_memoryview_err') @@ -28899,7 +31763,7 @@ */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(3, 1249, __pyx_L1_error) + __PYX_ERR(1, 1249, __pyx_L1_error) } /* "View.MemoryView":1245 @@ -28922,7 +31786,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -29140,7 +32004,7 @@ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 1281, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) } __pyx_L7:; @@ -29170,7 +32034,7 @@ * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 1284, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) /* "View.MemoryView":1283 * _err_extents(i, dst.shape[i], src.shape[i]) @@ -29227,7 +32091,7 @@ * src = tmp * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(3, 1291, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1292 @@ -29411,7 +32275,7 @@ * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(3, 1313, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) /* "View.MemoryView":1314 * @@ -29420,7 +32284,7 @@ * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(3, 1314, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) /* "View.MemoryView":1310 * return 0 @@ -29489,11 +32353,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -29673,7 +32537,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -29697,7 +32561,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -30007,6 +32871,469 @@ /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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; +} + /* "BufferFormatFromTypeInfo":1447 * * @cname('__pyx_format_from_typeinfo') @@ -30067,7 +33394,7 @@ __pyx_L4_bool_binop_done:; if (unlikely(!__pyx_t_1)) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(3, 1453, __pyx_L1_error) + __PYX_ERR(1, 1453, __pyx_L1_error) } } #endif @@ -30089,8 +33416,8 @@ * else: * alignment = b'' */ - __Pyx_INCREF(__pyx_kp_b__32); - __pyx_v_alignment = __pyx_kp_b__32; + __Pyx_INCREF(__pyx_kp_b__44); + __pyx_v_alignment = __pyx_kp_b__44; /* "BufferFormatFromTypeInfo":1455 * assert type.fields != NULL and type.fields.type != NULL @@ -30110,8 +33437,8 @@ * parts = [b"T{"] */ /*else*/ { - __Pyx_INCREF(__pyx_kp_b__33); - __pyx_v_alignment = __pyx_kp_b__33; + __Pyx_INCREF(__pyx_kp_b__45); + __pyx_v_alignment = __pyx_kp_b__45; } __pyx_L6:; @@ -30122,7 +33449,7 @@ * field = type.fields * */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1460, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_b_T); __Pyx_GIVEREF(__pyx_kp_b_T); @@ -30158,7 +33485,7 @@ * parts.append(part + b':' + field.name + b':') * field += 1 */ - __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1464, __pyx_L1_error) + __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -30170,18 +33497,18 @@ * field += 1 * */ - __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__34); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1465, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__46); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1465, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1465, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__34); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1465, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__46); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 1465, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 1465, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "BufferFormatFromTypeInfo":1466 @@ -30201,12 +33528,12 @@ * else: * fmt = __Pyx_TypeInfoToFormat(type) */ - __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__35); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1468, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__47); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 1468, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(1, 1468, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; @@ -30247,22 +33574,22 @@ * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string * else: */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1472, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __pyx_v_type->ndim; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; - __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1472, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1472, __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 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 1472, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 1472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_extents = ((PyObject*)__pyx_t_6); @@ -30275,21 +33602,21 @@ * else: * result = fmt.string */ - __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__36, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1473, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__48, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1473, __pyx_L1_error) + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1473, __pyx_L1_error) + __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1473, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1473, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 1473, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 1473, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -30311,7 +33638,7 @@ * return result */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1475, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -30369,7 +33696,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_15contour_finding_ContourTree(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + 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 @@ -30393,6 +33720,8 @@ {"add_joins", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_11ContourTree_13add_joins, METH_O, 0}, {"count", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_11ContourTree_15count, METH_NOARGS, 0}, {"export", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_11ContourTree_17export, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_11ContourTree_21__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_11ContourTree_23__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -30467,7 +33796,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_15contour_finding_TileContourTree(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + 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 @@ -30476,6 +33805,8 @@ static PyMethodDef __pyx_methods_2yt_9utilities_3lib_15contour_finding_TileContourTree[] = { {"identify_contours", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_15TileContourTree_3identify_contours, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_15TileContourTree_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_15TileContourTree_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -30550,7 +33881,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_15contour_finding_FOFNode(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + 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 @@ -30558,6 +33889,8 @@ } static PyMethodDef __pyx_methods_2yt_9utilities_3lib_15contour_finding_FOFNode[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_7FOFNode_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_7FOFNode_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -30632,6 +33965,8 @@ static PyMethodDef __pyx_methods_2yt_9utilities_3lib_15contour_finding_ParticleContourTree[] = { {"__pyx_fuse_0identify_contours", (PyCFunction)__pyx_fuse_0__pyx_pw_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_5identify_contours, METH_VARARGS|METH_KEYWORDS, 0}, {"__pyx_fuse_1identify_contours", (PyCFunction)__pyx_fuse_1__pyx_pw_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_7identify_contours, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_11__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_13__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -30717,7 +34052,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -30767,6 +34102,8 @@ 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} }; @@ -30886,7 +34223,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -30914,6 +34251,8 @@ } 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} }; @@ -31001,7 +34340,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -31113,6 +34452,8 @@ {"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} }; @@ -31238,7 +34579,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -31282,6 +34623,8 @@ } 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} }; @@ -31380,19 +34723,21 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, - {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, {&__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_Couldn_t_find, __pyx_k_Couldn_t_find, sizeof(__pyx_k_Couldn_t_find), 0, 0, 1, 0}, {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, - {&__pyx_kp_s_Expected_at_least_d_arguments, __pyx_k_Expected_at_least_d_arguments, sizeof(__pyx_k_Expected_at_least_d_arguments), 0, 0, 1, 0}, + {&__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_k_Expected_at_least_d_argument_s_g, sizeof(__pyx_k_Expected_at_least_d_argument_s_g), 0, 0, 1, 0}, {&__pyx_kp_s_FOF_ing_5_1f_done, __pyx_k_FOF_ing_5_1f_done, sizeof(__pyx_k_FOF_ing_5_1f_done), 0, 0, 1, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, {&__pyx_kp_s_Function_call_with_ambiguous_arg, __pyx_k_Function_call_with_ambiguous_arg, sizeof(__pyx_k_Function_call_with_ambiguous_arg), 0, 0, 1, 0}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0x32, __pyx_k_Incompatible_checksums_s_vs_0x32, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x32), 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_0xfe, __pyx_k_Incompatible_checksums_s_vs_0xfe, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xfe), 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_Inspected, __pyx_k_Inspected, sizeof(__pyx_k_Inspected), 0, 0, 1, 0}, @@ -31406,26 +34751,30 @@ {&__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_ParticleContourTree_identify_con, __pyx_k_ParticleContourTree_identify_con, sizeof(__pyx_k_ParticleContourTree_identify_con), 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_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 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_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 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_kp_s_Will_be_outputting_every, __pyx_k_Will_be_outputting_every, sizeof(__pyx_k_Will_be_outputting_every), 0, 0, 1, 0}, - {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, - {&__pyx_kp_b__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 0, 0}, - {&__pyx_kp_b__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 0, 0}, - {&__pyx_kp_b__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 0, 0}, - {&__pyx_kp_b__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 0, 0, 0}, - {&__pyx_kp_u__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 1, 0, 0}, - {&__pyx_n_s__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 0, 1, 1}, + {&__pyx_kp_b__44, __pyx_k__44, sizeof(__pyx_k__44), 0, 0, 0, 0}, + {&__pyx_kp_b__45, __pyx_k__45, sizeof(__pyx_k__45), 0, 0, 0, 0}, + {&__pyx_kp_b__46, __pyx_k__46, sizeof(__pyx_k__46), 0, 0, 0, 0}, + {&__pyx_kp_b__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 0, 0, 0}, + {&__pyx_kp_u__48, __pyx_k__48, sizeof(__pyx_k__48), 0, 1, 0, 0}, + {&__pyx_n_s__49, __pyx_k__49, sizeof(__pyx_k__49), 0, 0, 1, 1}, {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0}, + {&__pyx_kp_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 0}, {&__pyx_n_s_add_joins, __pyx_k_add_joins, sizeof(__pyx_k_add_joins), 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_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_byteorder, __pyx_k_byteorder, sizeof(__pyx_k_byteorder), 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_c0, __pyx_k_c0, sizeof(__pyx_k_c0), 0, 0, 1, 1}, @@ -31435,6 +34784,7 @@ {&__pyx_n_s_ck, __pyx_k_ck, sizeof(__pyx_k_ck), 0, 0, 1, 1}, {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 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_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 0, 0, 1, 1}, {&__pyx_n_s_container, __pyx_k_container, sizeof(__pyx_k_container), 0, 0, 1, 1}, {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, @@ -31446,10 +34796,12 @@ {&__pyx_n_s_counter, __pyx_k_counter, sizeof(__pyx_k_counter), 0, 0, 1, 1}, {&__pyx_n_s_cull_joins, __pyx_k_cull_joins, sizeof(__pyx_k_cull_joins), 0, 0, 1, 1}, {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_doff, __pyx_k_doff, sizeof(__pyx_k_doff), 0, 0, 1, 1}, {&__pyx_n_s_dom_ind, __pyx_k_dom_ind, sizeof(__pyx_k_dom_ind), 0, 0, 1, 1}, {&__pyx_n_s_domain_id, __pyx_k_domain_id, sizeof(__pyx_k_domain_id), 0, 0, 1, 1}, {&__pyx_n_s_domain_offset, __pyx_k_domain_offset, sizeof(__pyx_k_domain_offset), 0, 0, 1, 1}, + {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, @@ -31458,11 +34810,11 @@ {&__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_examined, __pyx_k_examined, sizeof(__pyx_k_examined), 0, 0, 1, 1}, + {&__pyx_n_s_f_contiguous, __pyx_k_f_contiguous, sizeof(__pyx_k_f_contiguous), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_final_joins, __pyx_k_final_joins, sizeof(__pyx_k_final_joins), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, - {&__pyx_n_s_float32_t, __pyx_k_float32_t, sizeof(__pyx_k_float32_t), 0, 0, 1, 1}, - {&__pyx_n_s_float64_t, __pyx_k_float64_t, sizeof(__pyx_k_float64_t), 0, 0, 1, 1}, + {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__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}, @@ -31500,15 +34852,16 @@ {&__pyx_n_s_n_nodes, __pyx_k_n_nodes, sizeof(__pyx_k_n_nodes), 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_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1}, {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, {&__pyx_n_s_neighbors, __pyx_k_neighbors, sizeof(__pyx_k_neighbors), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_nf, __pyx_k_nf, sizeof(__pyx_k_nf), 0, 0, 1, 1}, {&__pyx_n_s_nind, __pyx_k_nind, sizeof(__pyx_k_nind), 0, 0, 1, 1}, {&__pyx_n_s_nj, __pyx_k_nj, sizeof(__pyx_k_nj), 0, 0, 1, 1}, {&__pyx_n_s_nneighbors, __pyx_k_nneighbors, sizeof(__pyx_k_nneighbors), 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_node_ids, __pyx_k_node_ids, sizeof(__pyx_k_node_ids), 0, 0, 1, 1}, {&__pyx_n_s_node_ind, __pyx_k_node_ind, sizeof(__pyx_k_node_ind), 0, 0, 1, 1}, {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, @@ -31528,16 +34881,29 @@ {&__pyx_n_s_pdoms, __pyx_k_pdoms, sizeof(__pyx_k_pdoms), 0, 0, 1, 1}, {&__pyx_n_s_periodicity, __pyx_k_periodicity, sizeof(__pyx_k_periodicity), 0, 0, 1, 1}, {&__pyx_n_s_pg, __pyx_k_pg, sizeof(__pyx_k_pg), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_pind, __pyx_k_pind, sizeof(__pyx_k_pind), 0, 0, 1, 1}, {&__pyx_n_s_pind0, __pyx_k_pind0, sizeof(__pyx_k_pind0), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_positions, __pyx_k_positions, sizeof(__pyx_k_positions), 0, 0, 1, 1}, {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 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_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_FOFNode, __pyx_k_pyx_unpickle_FOFNode, sizeof(__pyx_k_pyx_unpickle_FOFNode), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_TileContourTree, __pyx_k_pyx_unpickle_TileContourTree, sizeof(__pyx_k_pyx_unpickle_TileContourTree), 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_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, + {&__pyx_kp_u_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0, 0}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_kp_s_self_first_self_last_cannot_be_c, __pyx_k_self_first_self_last_cannot_be_c, sizeof(__pyx_k_self_first_self_last_cannot_be_c), 0, 0, 1, 0}, + {&__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_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1}, @@ -31549,6 +34915,8 @@ {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_strides, __pyx_k_strides, sizeof(__pyx_k_strides), 0, 0, 1, 1}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, @@ -31562,11 +34930,13 @@ {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 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_update_joins, __pyx_k_update_joins, sizeof(__pyx_k_update_joins), 0, 0, 1, 1}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_n_s_vcs, __pyx_k_vcs, sizeof(__pyx_k_vcs), 0, 0, 1, 1}, {&__pyx_n_s_verbose, __pyx_k_verbose, sizeof(__pyx_k_verbose), 0, 0, 1, 1}, {&__pyx_n_s_yt_utilities_lib_contour_finding, __pyx_k_yt_utilities_lib_contour_finding, sizeof(__pyx_k_yt_utilities_lib_contour_finding), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_contour_finding_2, __pyx_k_yt_utilities_lib_contour_finding_2, sizeof(__pyx_k_yt_utilities_lib_contour_finding_2), 0, 0, 1, 0}, {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, {&__pyx_n_s_zeros_like, __pyx_k_zeros_like, sizeof(__pyx_k_zeros_like), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, @@ -31575,17 +34945,17 @@ static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 158, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 261, __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_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 380, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 523, __pyx_L1_error) - __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 523, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 523, __pyx_L1_error) __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 523, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 146, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(3, 149, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(3, 396, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(3, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(3, 818, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -31595,6 +34965,25 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_first_self_last_cannot_be_c); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(tree fragment)":4 + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_first_self_last_cannot_be_c); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + /* "yt/utilities/lib/contour_finding.pyx":471 * * if ti == 0: return @@ -31602,9 +34991,9 @@ * tree.add_joins(new_joins) * */ - __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice_); - __Pyx_GIVEREF(__pyx_slice_); + __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__3); + __Pyx_GIVEREF(__pyx_slice__3); /* "yt/utilities/lib/contour_finding.pyx":510 * cdef int minimum_count @@ -31613,40 +35002,48 @@ * int minimum_count = 8): * cdef int i */ - __pyx_tuple__2 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__4 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); /* "yt/utilities/lib/contour_finding.pyx":523 * @cython.boundscheck(False) * @cython.wraparound(False) * def identify_contours(self, OctreeContainer octree, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] dom_ind, - * np.ndarray[anyfloat, ndim=2] positions, + * np.ndarray[floating, ndim=2] positions, */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s__3); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s__7); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s__9); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); - /* "yt/geometry/selection_routines.pxd":30 - * if "code_length" == str(arr.units): - * return arr - * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< - * return arr - * + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_first_self_last_cannot_be_c); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "(tree fragment)":4 + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.first,self.last cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_self_first_self_last_cannot_be_c); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -31655,9 +35052,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -31666,9 +35063,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -31677,9 +35074,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -31688,9 +35085,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -31699,9 +35096,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -31710,9 +35107,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -31721,9 +35118,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -31732,18 +35129,29 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "yt/geometry/selection_routines.pxd":26 + * if "code_length" == str(arr.units): + * return arr + * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "View.MemoryView":131 * @@ -31752,9 +35160,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "View.MemoryView":134 * @@ -31763,9 +35171,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "View.MemoryView":137 * @@ -31774,9 +35182,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(3, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); /* "View.MemoryView":146 * @@ -31785,9 +35193,9 @@ * * */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(3, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -31796,9 +35204,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -31807,9 +35215,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "(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__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "(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__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -31818,9 +35245,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(3, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -31829,9 +35256,9 @@ * * 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(3, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); /* "View.MemoryView":563 * def suboffsets(self): @@ -31840,12 +35267,31 @@ * * 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(3, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); + __pyx_tuple__35 = PyTuple_New(1); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); __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); + PyTuple_SET_ITEM(__pyx_tuple__35, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "(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__36 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "(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__37 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); /* "View.MemoryView":668 * if item is Ellipsis: @@ -31854,9 +35300,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(3, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__28); - __Pyx_GIVEREF(__pyx_slice__28); + __pyx_slice__38 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__38)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__38); + __Pyx_GIVEREF(__pyx_slice__38); /* "View.MemoryView":671 * seen_ellipsis = True @@ -31865,9 +35311,9 @@ * have_slices = True * else: */ - __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(3, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__29); - __Pyx_GIVEREF(__pyx_slice__29); + __pyx_slice__39 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__39)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__39); + __Pyx_GIVEREF(__pyx_slice__39); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -31876,9 +35322,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(3, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__30); - __Pyx_GIVEREF(__pyx_slice__30); + __pyx_slice__40 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__40)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__40); + __Pyx_GIVEREF(__pyx_slice__40); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -31887,9 +35333,28 @@ * * */ - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(3, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "(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__42 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "(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__43 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); /* "yt/utilities/lib/contour_finding.pyx":368 * @cython.boundscheck(False) @@ -31898,10 +35363,10 @@ * np.ndarray[np.int64_t, ndim=1] node_ids): * cdef int n_nodes = node_ids.shape[0] */ - __pyx_tuple__38 = PyTuple_Pack(12, __pyx_n_s_trunk, __pyx_n_s_contours, __pyx_n_s_tree, __pyx_n_s_node_ids, __pyx_n_s_n_nodes, __pyx_n_s_node_ind, __pyx_n_s_vcs, __pyx_n_s_i, __pyx_n_s_pg, __pyx_n_s_examined, __pyx_n_s__37, __pyx_n_s_cinfo); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_link_node_contours, 368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_tuple__50 = PyTuple_Pack(12, __pyx_n_s_trunk, __pyx_n_s_contours, __pyx_n_s_tree, __pyx_n_s_node_ids, __pyx_n_s_n_nodes, __pyx_n_s_node_ind, __pyx_n_s_vcs, __pyx_n_s_i, __pyx_n_s_pg, __pyx_n_s_examined, __pyx_n_s__49, __pyx_n_s_cinfo); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_contour_finding_2, __pyx_n_s_link_node_contours, 368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 368, __pyx_L1_error) /* "yt/utilities/lib/contour_finding.pyx":476 * @cython.boundscheck(False) @@ -31910,22 +35375,36 @@ * np.ndarray[np.int64_t, ndim=3] contour_ids, * np.ndarray[np.int64_t, ndim=1] final_joins): */ - __pyx_tuple__40 = PyTuple_Pack(9, __pyx_n_s_joins, __pyx_n_s_contour_ids, __pyx_n_s_final_joins, __pyx_n_s_j, __pyx_n_s_nj, __pyx_n_s_nf, __pyx_n_s_ci, __pyx_n_s_cj, __pyx_n_s_ck); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); - __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_update_joins, 476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_tuple__52 = PyTuple_Pack(9, __pyx_n_s_joins, __pyx_n_s_contour_ids, __pyx_n_s_final_joins, __pyx_n_s_j, __pyx_n_s_nj, __pyx_n_s_nf, __pyx_n_s_ci, __pyx_n_s_cj, __pyx_n_s_ck); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_contour_finding_2, __pyx_n_s_update_joins, 476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 476, __pyx_L1_error) /* "yt/utilities/lib/contour_finding.pyx":523 * @cython.boundscheck(False) * @cython.wraparound(False) * def identify_contours(self, OctreeContainer octree, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] dom_ind, - * np.ndarray[anyfloat, ndim=2] positions, + * np.ndarray[floating, ndim=2] positions, */ - __pyx_tuple__42 = PyTuple_Pack(33, __pyx_n_s_self, __pyx_n_s_octree, __pyx_n_s_dom_ind, __pyx_n_s_positions, __pyx_n_s_particle_ids, __pyx_n_s_domain_id, __pyx_n_s_domain_offset, __pyx_n_s_pdoms, __pyx_n_s_pcount, __pyx_n_s_pind, __pyx_n_s_doff, __pyx_n_s_pos, __pyx_n_s_oct, __pyx_n_s_neighbors, __pyx_n_s_oi, __pyx_n_s_c0, __pyx_n_s_moff, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_nneighbors, __pyx_n_s_pind0, __pyx_n_s_offset, __pyx_n_s_counter, __pyx_n_s_verbose, __pyx_n_s_container, __pyx_n_s_ipind, __pyx_n_s_fpos, __pyx_n_s_nsize, __pyx_n_s_nind, __pyx_n_s_frac, __pyx_n_s_contour_ids); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); - __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(7, 0, 33, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_identify_contours, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_tuple__54 = PyTuple_Pack(33, __pyx_n_s_self, __pyx_n_s_octree, __pyx_n_s_dom_ind, __pyx_n_s_positions, __pyx_n_s_particle_ids, __pyx_n_s_domain_id, __pyx_n_s_domain_offset, __pyx_n_s_pdoms, __pyx_n_s_pcount, __pyx_n_s_pind, __pyx_n_s_doff, __pyx_n_s_pos, __pyx_n_s_oct, __pyx_n_s_neighbors, __pyx_n_s_oi, __pyx_n_s_c0, __pyx_n_s_moff, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_nneighbors, __pyx_n_s_pind0, __pyx_n_s_offset, __pyx_n_s_counter, __pyx_n_s_verbose, __pyx_n_s_container, __pyx_n_s_ipind, __pyx_n_s_fpos, __pyx_n_s_nsize, __pyx_n_s_nind, __pyx_n_s_frac, __pyx_n_s_contour_ids); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(7, 0, 33, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_contour_finding_2, __pyx_n_s_identify_contours, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 523, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __pyx_unpickle_TileContourTree(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x327d0a5: + * from pickle import PickleError + */ + __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_TileContourTree, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_FOFNode, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(1, 1, __pyx_L1_error) /* "View.MemoryView":282 * return self.name @@ -31934,9 +35413,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(3, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); /* "View.MemoryView":283 * @@ -31945,9 +35424,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(3, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -31956,9 +35435,9 @@ * * */ - __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(3, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); /* "View.MemoryView":287 * @@ -31967,9 +35446,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(3, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); /* "View.MemoryView":288 * @@ -31978,9 +35457,19 @@ * * */ - __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(3, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__65 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -31993,6 +35482,10 @@ __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_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_52940965 = PyInt_FromLong(52940965L); if (unlikely(!__pyx_int_52940965)) __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_267065637 = PyInt_FromLong(267065637L); if (unlikely(!__pyx_int_267065637)) __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:; @@ -32060,6 +35553,7 @@ __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 @@ -32102,32 +35596,38 @@ if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_15contour_finding_ContourTree) < 0) __PYX_ERR(0, 115, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_15contour_finding_ContourTree.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "ContourTree", (PyObject *)&__pyx_type_2yt_9utilities_3lib_15contour_finding_ContourTree) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_15contour_finding_ContourTree) < 0) __PYX_ERR(0, 115, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_15contour_finding_ContourTree = &__pyx_type_2yt_9utilities_3lib_15contour_finding_ContourTree; if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_15contour_finding_TileContourTree) < 0) __PYX_ERR(0, 295, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_15contour_finding_TileContourTree.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "TileContourTree", (PyObject *)&__pyx_type_2yt_9utilities_3lib_15contour_finding_TileContourTree) < 0) __PYX_ERR(0, 295, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_15contour_finding_TileContourTree) < 0) __PYX_ERR(0, 295, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_15contour_finding_TileContourTree = &__pyx_type_2yt_9utilities_3lib_15contour_finding_TileContourTree; if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_15contour_finding_FOFNode) < 0) __PYX_ERR(0, 496, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_15contour_finding_FOFNode.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "FOFNode", (PyObject *)&__pyx_type_2yt_9utilities_3lib_15contour_finding_FOFNode) < 0) __PYX_ERR(0, 496, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_15contour_finding_FOFNode) < 0) __PYX_ERR(0, 496, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_15contour_finding_FOFNode = &__pyx_type_2yt_9utilities_3lib_15contour_finding_FOFNode; __pyx_vtabptr_2yt_9utilities_3lib_15contour_finding_ParticleContourTree = &__pyx_vtable_2yt_9utilities_3lib_15contour_finding_ParticleContourTree; - __pyx_vtable_2yt_9utilities_3lib_15contour_finding_ParticleContourTree.__pyx_fuse_0link_particles = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **, __pyx_t_5numpy_float32_t *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t))__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_link_particles; - __pyx_vtable_2yt_9utilities_3lib_15contour_finding_ParticleContourTree.__pyx_fuse_1link_particles = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t))__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_link_particles; + __pyx_vtable_2yt_9utilities_3lib_15contour_finding_ParticleContourTree.__pyx_fuse_0link_particles = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **, float *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t))__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_link_particles; + __pyx_vtable_2yt_9utilities_3lib_15contour_finding_ParticleContourTree.__pyx_fuse_1link_particles = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_15contour_finding_ParticleContourTree *, struct __pyx_t_2yt_9utilities_3lib_15contour_finding_ContourID **, double *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t))__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_link_particles; __pyx_type_2yt_9utilities_3lib_15contour_finding_ParticleContourTree.tp_base = __pyx_ptype_2yt_9utilities_3lib_15contour_finding_ContourTree; if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_15contour_finding_ParticleContourTree) < 0) __PYX_ERR(0, 502, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_15contour_finding_ParticleContourTree.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_15contour_finding_ParticleContourTree.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_15contour_finding_ParticleContourTree) < 0) __PYX_ERR(0, 502, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "ParticleContourTree", (PyObject *)&__pyx_type_2yt_9utilities_3lib_15contour_finding_ParticleContourTree) < 0) __PYX_ERR(0, 502, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_15contour_finding_ParticleContourTree) < 0) __PYX_ERR(0, 502, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_15contour_finding_ParticleContourTree = &__pyx_type_2yt_9utilities_3lib_15contour_finding_ParticleContourTree; __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(3, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(3, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(3, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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; @@ -32137,18 +35637,20 @@ __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(3, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(3, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -32201,22 +35703,28 @@ __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(5, 114, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType("yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(5, 117, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(5, 117, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(1, 33, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(1, 33, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(1, 71, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(1, 71, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(1, 74, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(1, 74, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(6, 57, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(6, 57, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(6, 89, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(6, 89, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(6, 97, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(6, 97, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node = __Pyx_ImportType("yt.utilities.lib.amr_kdtools", "Node", sizeof(struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node)) __PYX_ERR(7, 22, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_11amr_kdtools_Node = (struct __pyx_vtabstruct_2yt_9utilities_3lib_11amr_kdtools_Node*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_11amr_kdtools_Node)) __PYX_ERR(7, 22, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = __Pyx_ImportType("yt.utilities.lib.partitioned_grid", "PartitionedGrid", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(8, 22, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(8, 22, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(3, 29, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(3, 29, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(3, 67, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(3, 67, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(3, 70, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(3, 70, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType("yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(3, 74, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(3, 74, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = __Pyx_ImportType("yt.utilities.lib.allocation_container", "ObjectPool", sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(6, 26, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(6, 26, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = __Pyx_ImportType("yt.geometry.oct_container", "OctObjectPool", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(7, 55, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(7, 55, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(7, 63, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(7, 63, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(7, 94, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(7, 94, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(7, 102, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(7, 102, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node = __Pyx_ImportType("yt.utilities.lib.amr_kdtools", "Node", sizeof(struct __pyx_obj_2yt_9utilities_3lib_11amr_kdtools_Node), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node)) __PYX_ERR(8, 22, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_11amr_kdtools_Node = (struct __pyx_vtabstruct_2yt_9utilities_3lib_11amr_kdtools_Node*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_11amr_kdtools_Node->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_11amr_kdtools_Node)) __PYX_ERR(8, 22, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = __Pyx_ImportType("yt.utilities.lib.partitioned_grid", "PartitionedGrid", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(9, 22, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(9, 22, __pyx_L1_error) /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportVoidPtr(__pyx_t_1, "ORDER_MAX", (void **)&__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -32283,21 +35791,21 @@ * @cython.wraparound(False) * def identify_contours(self, OctreeContainer octree, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] dom_ind, - * np.ndarray[anyfloat, ndim=2] positions, + * np.ndarray[floating, ndim=2] positions, */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_5identify_contours, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ParticleContourTree_identify_con, NULL, __pyx_n_s_yt_utilities_lib_contour_finding, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_5identify_contours, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ParticleContourTree_identify_con, NULL, __pyx_n_s_yt_utilities_lib_contour_finding, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_float32_t, __pyx_t_4) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_float, __pyx_t_4) < 0) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_7identify_contours, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ParticleContourTree_identify_con, NULL, __pyx_n_s_yt_utilities_lib_contour_finding, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_7identify_contours, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ParticleContourTree_identify_con, NULL, __pyx_n_s_yt_utilities_lib_contour_finding, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_float64_t, __pyx_t_4) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_double, __pyx_t_4) < 0) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_3identify_contours, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ParticleContourTree_identify_con, NULL, __pyx_n_s_yt_utilities_lib_contour_finding, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15contour_finding_19ParticleContourTree_3identify_contours, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ParticleContourTree_identify_con, NULL, __pyx_n_s_yt_utilities_lib_contour_finding, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_4)->__signatures__ = __pyx_t_3; @@ -32306,6 +35814,28 @@ PyType_Modified(__pyx_ptype_2yt_9utilities_3lib_15contour_finding_ParticleContourTree); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* "(tree fragment)":1 + * def __pyx_unpickle_TileContourTree(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x327d0a5: + * from pickle import PickleError + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15contour_finding_5__pyx_unpickle_TileContourTree, NULL, __pyx_n_s_yt_utilities_lib_contour_finding); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_TileContourTree, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_TileContourTree__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_TileContourTree__set_state(TileContourTree result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.max_val = __pyx_state[0]; result.min_val = __pyx_state[1] + * if hasattr(result, '__dict__'): + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15contour_finding_7__pyx_unpickle_FOFNode, NULL, __pyx_n_s_yt_utilities_lib_contour_finding); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FOFNode, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* "yt/utilities/lib/contour_finding.pyx":1 * """ # <<<<<<<<<<<<<< * A two-pass contour finding algorithm @@ -32323,9 +35853,9 @@ * * def __dealloc__(array self): */ - __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 207, __pyx_L1_error) + __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) __PYX_ERR(3, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_array_type); @@ -32336,7 +35866,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 282, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_5); @@ -32350,7 +35880,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 283, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_5); @@ -32364,7 +35894,7 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 284, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_5); @@ -32378,7 +35908,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 287, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_5); @@ -32392,7 +35922,7 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 288, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_5); @@ -32432,9 +35962,9 @@ * * */ - __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 535, __pyx_L1_error) + __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) __PYX_ERR(3, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_memoryview_type); @@ -32445,12 +35975,22 @@ * * */ - __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 981, __pyx_L1_error) + __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) __PYX_ERR(3, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* "BufferFormatFromTypeInfo":1447 * * @cname('__pyx_format_from_typeinfo') @@ -32470,7 +36010,7 @@ __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.contour_finding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.contour_finding", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -33416,17 +36956,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -33545,8 +37090,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON @@ -33586,11 +37131,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -33613,7 +37154,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -33634,7 +37175,7 @@ #endif /* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + 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; @@ -33676,7 +37217,7 @@ } /* RaiseDoubleKeywords */ - static void __Pyx_RaiseDoubleKeywordsError( + static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { @@ -33690,7 +37231,7 @@ } /* ParseKeywords */ - static int __Pyx_ParseOptionalKeywords( + static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, @@ -33791,8 +37332,36 @@ return -1; } +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -33803,9 +37372,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -33818,9 +37390,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -33873,7 +37448,7 @@ } /* FetchCommonType */ - static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); @@ -33912,7 +37487,7 @@ } /* CythonFunction */ - static PyObject * + static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { @@ -34495,20 +38070,20 @@ } /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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"); } /* IterFinish */ - static CYTHON_INLINE int __Pyx_IterFinish(void) { + static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; @@ -34543,7 +38118,7 @@ } /* UnpackItemEndCheck */ - static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); @@ -34555,7 +38130,7 @@ } /* MemviewSliceInit */ - static int + static int __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, @@ -34689,177 +38264,8 @@ } } -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -#endif - -/* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { - PyObject *exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; - return PyErr_GivenExceptionMatches(exc_type, err); -} -#endif - -/* GetException */ - #if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { -#endif - PyObject *local_type, *local_value, *local_tb; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - /* UnicodeAsUCS4 */ - static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { + static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { Py_ssize_t length; #if CYTHON_PEP393_ENABLED length = PyUnicode_GET_LENGTH(x); @@ -34890,7 +38296,7 @@ } /* object_ord */ - static long __Pyx__PyObject_Ord(PyObject* c) { + static long __Pyx__PyObject_Ord(PyObject* c) { Py_ssize_t size; if (PyBytes_Check(c)) { size = PyBytes_GET_SIZE(c); @@ -34918,8 +38324,154 @@ return (long)(Py_UCS4)-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_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 +} + /* SetItemInt */ - static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); @@ -34967,7 +38519,7 @@ } /* PyObjectCallMethod0 */ - static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; @@ -34989,12 +38541,12 @@ } /* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ - static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { @@ -35005,7 +38557,7 @@ } /* UnpackTuple2 */ - static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int is_tuple, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; @@ -35052,17 +38604,32 @@ } /* dict_iter */ - static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; -#if !CYTHON_COMPILING_IN_PYPY if (is_dict) { +#if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; - } +#elif PY_MAJOR_VERSION >= 3 + static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; + const char *name = PyUnicode_AsUTF8(method_name); + PyObject **pp = NULL; + if (strcmp(name, "iteritems") == 0) pp = &py_items; + else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; + else if (strcmp(name, "itervalues") == 0) pp = &py_values; + if (pp) { + if (!*pp) { + *pp = PyUnicode_FromString(name + 4); + if (!*pp) + return NULL; + } + method_name = *pp; + } #endif + } *p_orig_length = 0; if (method_name) { PyObject* iter; @@ -35148,7 +38715,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { @@ -35259,155 +38826,221 @@ PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } - return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); + return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); +} +#endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* 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; } -#endif -/* 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 = 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); +/* 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 { - 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; + Py_DECREF(r); + return 1; } +} + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} #endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); } +#endif -/* 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); +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { #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); - } + 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 - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; + 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; } -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); + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); #endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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_COMPILING_IN_CPYTHON -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); -} - /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -35440,7 +39073,7 @@ } /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -35465,7 +39098,7 @@ #endif /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -35581,12 +39214,12 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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)); @@ -35594,14 +39227,79 @@ } /* StringJoin */ - #if !CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); } #endif +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -35619,7 +39317,7 @@ } /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -35639,7 +39337,7 @@ } /* FusedFunction */ - static PyObject * + static PyObject * __pyx_FusedFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject *qualname, PyObject *self, PyObject *module, PyObject *globals, @@ -35963,8 +39661,42 @@ return 0; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -36044,7 +39776,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -36103,12 +39835,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -36124,6 +39859,70 @@ Py_XDECREF(py_frame); } +/* 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;\ + } + +/* IsLittleEndian */ + static int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + #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); @@ -36147,8 +39946,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -36171,7 +39970,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -36207,7 +40006,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -36220,7 +40019,7 @@ } /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -36261,7 +40060,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -36443,7 +40242,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -36454,7 +40253,7 @@ } retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, PyBUF_RECORDS, 2, - &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, stack, + &__Pyx_TypeInfo_float, stack, &result, obj); if (unlikely(retcode == -1)) goto __pyx_fail; @@ -36466,7 +40265,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -36477,7 +40276,7 @@ } retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, PyBUF_RECORDS, 2, - &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack, + &__Pyx_TypeInfo_double, stack, &result, obj); if (unlikely(retcode == -1)) goto __pyx_fail; @@ -36488,30 +40287,8 @@ 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;\ - } - /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -36541,39 +40318,8 @@ } } -/* 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); - } -} - /* Print */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); if (!f) { @@ -36679,7 +40425,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -36710,7 +40456,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -36741,7 +40487,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -36761,7 +40507,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -36896,7 +40642,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -36916,7 +40662,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -37021,179 +40767,68 @@ 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; -} - -/* TypeInfoToFormat */ - static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) { - struct __pyx_typeinfo_string result = { {0} }; - char *buf = (char *) result.string; - size_t size = type->size; - switch (type->typegroup) { - case 'H': - *buf = 'c'; - break; - case 'I': - case 'U': - if (size == 1) - *buf = (type->is_unsigned) ? 'B' : 'b'; - else if (size == 2) - *buf = (type->is_unsigned) ? 'H' : 'h'; - else if (size == 4) - *buf = (type->is_unsigned) ? 'I' : 'i'; - else if (size == 8) - *buf = (type->is_unsigned) ? 'Q' : 'q'; - break; - case 'P': - *buf = 'P'; - break; - case 'C': - { - __Pyx_TypeInfo complex_type = *type; - complex_type.typegroup = 'R'; - complex_type.size /= 2; - *buf++ = 'Z'; - *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0]; - break; - } - case 'R': - if (size == 4) - *buf = 'f'; - else if (size == 8) - *buf = 'd'; - else - *buf = 'g'; - break; + } + 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); } - return result; } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -37381,8 +41016,75 @@ return (npy_int64) -1; } +/* MemviewSliceCopyTemplate */ + static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) +{ + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (from_mvs->suboffsets[i] >= 0) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } + } + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; + } + } + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; + } + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; +} + /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -37570,64 +41272,20 @@ return (int) -1; } -/* PrintOne */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 -static int __Pyx_PrintOne(PyObject* f, PyObject *o) { - if (!f) { - if (!(f = __Pyx_GetStdout())) - return -1; - } - Py_INCREF(f); - if (PyFile_SoftSpace(f, 0)) { - if (PyFile_WriteString(" ", f) < 0) - goto error; - } - if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) - goto error; - if (PyFile_WriteString("\n", f) < 0) - goto error; - Py_DECREF(f); - return 0; -error: - Py_DECREF(f); - return -1; - /* the line below is just to avoid C compiler - * warnings about unused functions */ - return __Pyx_Print(f, NULL, 0); -} -#else -static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { - int res; - PyObject* arg_tuple = PyTuple_Pack(1, o); - if (unlikely(!arg_tuple)) - return -1; - res = __Pyx_Print(stream, arg_tuple, 1); - Py_DECREF(arg_tuple); - return res; -} -#endif - -/* BytesContains */ - static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character) { - const Py_ssize_t length = PyBytes_GET_SIZE(bytes); - char* char_start = PyBytes_AS_STRING(bytes); - return memchr(char_start, (unsigned char)character, (size_t)length) != NULL; -} - /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { - const char neg_one = (char) -1, const_zero = (char) 0; + 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(char) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (char) val; + return (long) val; } } else #endif @@ -37636,32 +41294,32 @@ #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 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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; @@ -37675,86 +41333,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (char) -1; + return (long) -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)) + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } 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 (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 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(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(char) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -37763,7 +41421,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - char val; + long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -37783,40 +41441,154 @@ return val; } #endif - return (char) -1; + return (long) -1; } } else { - char val; + long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (char) -1; - val = __Pyx_PyInt_As_char(tmp); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to char"); - return (char) -1; + "value too large to convert to long"); + return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to char"); - return (char) -1; + "can't convert negative value to long"); + return (long) -1; +} + +/* TypeInfoToFormat */ + static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) { + struct __pyx_typeinfo_string result = { {0} }; + char *buf = (char *) result.string; + size_t size = type->size; + switch (type->typegroup) { + case 'H': + *buf = 'c'; + break; + case 'I': + case 'U': + if (size == 1) + *buf = (type->is_unsigned) ? 'B' : 'b'; + else if (size == 2) + *buf = (type->is_unsigned) ? 'H' : 'h'; + else if (size == 4) + *buf = (type->is_unsigned) ? 'I' : 'i'; + else if (size == 8) + *buf = (type->is_unsigned) ? 'Q' : 'q'; + break; + case 'P': + *buf = 'P'; + break; + case 'C': + { + __Pyx_TypeInfo complex_type = *type; + complex_type.typegroup = 'R'; + complex_type.size /= 2; + *buf++ = 'Z'; + *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0]; + break; + } + case 'R': + if (size == 4) + *buf = 'f'; + else if (size == 8) + *buf = 'd'; + else + *buf = 'g'; + break; + } + return result; +} + +/* PrintOne */ + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +/* BytesContains */ + static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character) { + const Py_ssize_t length = PyBytes_GET_SIZE(bytes); + char* char_start = PyBytes_AS_STRING(bytes); + return memchr(char_start, (unsigned char)character, (size_t)length) != NULL; +} + +/* ImportNumPyArray */ + static PyObject* __Pyx__ImportNumPyArray(void) { + PyObject *numpy_module, *ndarray_object = NULL; + numpy_module = __Pyx_Import(__pyx_n_s_numpy, NULL, 0); + if (likely(numpy_module)) { + ndarray_object = PyObject_GetAttrString(numpy_module, "ndarray"); + Py_DECREF(numpy_module); + } + if (unlikely(!ndarray_object)) { + PyErr_Clear(); + } + if (unlikely(!ndarray_object || !PyObject_TypeCheck(ndarray_object, &PyType_Type))) { + Py_XDECREF(ndarray_object); + Py_INCREF(Py_None); + ndarray_object = Py_None; + } + return ndarray_object; +} +static CYTHON_INLINE PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void) { + if (unlikely(!__pyx_numpy_ndarray)) { + __pyx_numpy_ndarray = __Pyx__ImportNumPyArray(); + } + Py_INCREF(__pyx_numpy_ndarray); + return __pyx_numpy_ndarray; } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; + static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = (char) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (long) val; + return (char) val; } } else #endif @@ -37825,32 +41597,32 @@ #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 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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])); + __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; @@ -37864,86 +41636,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (long) -1; + return (char) -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)) + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, 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)) + } 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 (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 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(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) - 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]))); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) > 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]))); + __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(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, 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)) + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -37952,7 +41724,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - long val; + char val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -37972,28 +41744,28 @@ return val; } #endif - return (long) -1; + return (char) -1; } } else { - long val; + char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; + "value too large to convert to char"); + return (char) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; + "can't convert negative value to char"); + return (char) -1; } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -38016,7 +41788,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -38032,7 +41804,7 @@ } /* FunctionExport */ - static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { @@ -38069,7 +41841,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -38087,7 +41859,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -38152,7 +41924,7 @@ #endif /* VoidPtrImport */ - #ifndef __PYX_HAVE_RT_ImportVoidPtr + #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; @@ -38201,7 +41973,7 @@ #endif /* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction + #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; @@ -38255,7 +42027,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -38280,6 +42052,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -38288,11 +42062,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/contour_finding.pyx yt-3.4.0/yt/utilities/lib/contour_finding.pyx --- yt-3.3.3/yt/utilities/lib/contour_finding.pyx 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/contour_finding.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -16,10 +16,10 @@ import numpy as np cimport numpy as np cimport cython +from cython cimport floating from libc.stdlib cimport malloc, free, realloc from yt.geometry.selection_routines cimport \ - SelectorObject, AlwaysSelector, OctreeSubsetSelector, \ - anyfloat + SelectorObject, AlwaysSelector, OctreeSubsetSelector from yt.utilities.lib.fp_utils cimport imax from yt.geometry.oct_container cimport \ OctreeContainer, OctInfo @@ -522,7 +522,7 @@ @cython.wraparound(False) def identify_contours(self, OctreeContainer octree, np.ndarray[np.int64_t, ndim=1] dom_ind, - np.ndarray[anyfloat, ndim=2] positions, + np.ndarray[floating, ndim=2] positions, np.ndarray[np.int64_t, ndim=1] particle_ids, int domain_id, int domain_offset): cdef np.ndarray[np.int64_t, ndim=1] pdoms, pcount, pind, doff @@ -560,7 +560,7 @@ pdoms[i] = offset pind = np.argsort(pdoms) cdef np.int64_t *ipind = pind.data - cdef anyfloat *fpos = positions.data + cdef floating *fpos = positions.data # pind is now the pointer into the position and particle_ids array. for i in range(positions.shape[0]): offset = pdoms[pind[i]] @@ -642,7 +642,7 @@ @cython.boundscheck(False) @cython.wraparound(False) cdef void link_particles(self, ContourID **container, - anyfloat *positions, + floating *positions, np.int64_t *pind, np.int64_t pcount, np.int64_t noffset, diff -Nru yt-3.3.3/yt/utilities/lib/cosmology_time.c yt-3.4.0/yt/utilities/lib/cosmology_time.c --- yt-3.3.3/yt/utilities/lib/cosmology_time.c 2016-12-12 01:41:43.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/cosmology_time.c 2017-08-10 18:20:31.000000000 +0000 @@ -1,9 +1,13 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { "distutils": { - "depends": [] + "depends": [], + "name": "yt.utilities.lib.cosmology_time", + "sources": [ + "yt/utilities/lib/cosmology_time.pyx" + ] }, "module_name": "yt.utilities.lib.cosmology_time" } @@ -16,7 +20,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -38,6 +42,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -190,16 +195,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -326,6 +335,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -380,6 +395,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -443,6 +487,7 @@ #include #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" +#include #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -487,8 +532,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -501,8 +546,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -624,10 +672,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1110,7 +1160,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); @@ -1223,6 +1273,9 @@ /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1433,6 +1486,8 @@ 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 'yt.utilities.lib.cosmology_time' */ static double __pyx_f_2yt_9utilities_3lib_14cosmology_time_dadtau(double, double, double, double); /*proto*/ static double __pyx_f_2yt_9utilities_3lib_14cosmology_time_dadt(double, double, double, double); /*proto*/ @@ -1474,6 +1529,7 @@ static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; 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)"; @@ -1493,6 +1549,7 @@ static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_ages; static PyObject *__pyx_n_s_array; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_dtau; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_import; @@ -1533,14 +1590,15 @@ static PyObject *__pyx_tuple__9; /* "yt/utilities/lib/cosmology_time.pyx":5 - * + * from libc.math cimport sqrt * * cdef double dadtau(double aexp_tau,double O_mat_0,double O_vac_0,double O_k_0): # <<<<<<<<<<<<<< - * return ( aexp_tau**3 * (O_mat_0 + O_vac_0*aexp_tau**3 + O_k_0*aexp_tau) )**0.5 - * + * cdef double aexp_tau3 = aexp_tau * aexp_tau * aexp_tau + * return sqrt( aexp_tau3 * (O_mat_0 + O_vac_0*aexp_tau3 + O_k_0*aexp_tau) ) */ static double __pyx_f_2yt_9utilities_3lib_14cosmology_time_dadtau(double __pyx_v_aexp_tau, double __pyx_v_O_mat_0, double __pyx_v_O_vac_0, double __pyx_v_O_k_0) { + double __pyx_v_aexp_tau3; double __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dadtau", 0); @@ -1548,19 +1606,28 @@ /* "yt/utilities/lib/cosmology_time.pyx":6 * * cdef double dadtau(double aexp_tau,double O_mat_0,double O_vac_0,double O_k_0): - * return ( aexp_tau**3 * (O_mat_0 + O_vac_0*aexp_tau**3 + O_k_0*aexp_tau) )**0.5 # <<<<<<<<<<<<<< + * cdef double aexp_tau3 = aexp_tau * aexp_tau * aexp_tau # <<<<<<<<<<<<<< + * return sqrt( aexp_tau3 * (O_mat_0 + O_vac_0*aexp_tau3 + O_k_0*aexp_tau) ) + * + */ + __pyx_v_aexp_tau3 = ((__pyx_v_aexp_tau * __pyx_v_aexp_tau) * __pyx_v_aexp_tau); + + /* "yt/utilities/lib/cosmology_time.pyx":7 + * cdef double dadtau(double aexp_tau,double O_mat_0,double O_vac_0,double O_k_0): + * cdef double aexp_tau3 = aexp_tau * aexp_tau * aexp_tau + * return sqrt( aexp_tau3 * (O_mat_0 + O_vac_0*aexp_tau3 + O_k_0*aexp_tau) ) # <<<<<<<<<<<<<< * * cdef double dadt(double aexp_t,double O_mat_0,double O_vac_0,double O_k_0): */ - __pyx_r = pow((pow(__pyx_v_aexp_tau, 3.0) * ((__pyx_v_O_mat_0 + (__pyx_v_O_vac_0 * pow(__pyx_v_aexp_tau, 3.0))) + (__pyx_v_O_k_0 * __pyx_v_aexp_tau))), 0.5); + __pyx_r = sqrt((__pyx_v_aexp_tau3 * ((__pyx_v_O_mat_0 + (__pyx_v_O_vac_0 * __pyx_v_aexp_tau3)) + (__pyx_v_O_k_0 * __pyx_v_aexp_tau)))); goto __pyx_L0; /* "yt/utilities/lib/cosmology_time.pyx":5 - * + * from libc.math cimport sqrt * * cdef double dadtau(double aexp_tau,double O_mat_0,double O_vac_0,double O_k_0): # <<<<<<<<<<<<<< - * return ( aexp_tau**3 * (O_mat_0 + O_vac_0*aexp_tau**3 + O_k_0*aexp_tau) )**0.5 - * + * cdef double aexp_tau3 = aexp_tau * aexp_tau * aexp_tau + * return sqrt( aexp_tau3 * (O_mat_0 + O_vac_0*aexp_tau3 + O_k_0*aexp_tau) ) */ /* function exit code */ @@ -1569,51 +1636,61 @@ return __pyx_r; } -/* "yt/utilities/lib/cosmology_time.pyx":8 - * return ( aexp_tau**3 * (O_mat_0 + O_vac_0*aexp_tau**3 + O_k_0*aexp_tau) )**0.5 +/* "yt/utilities/lib/cosmology_time.pyx":9 + * return sqrt( aexp_tau3 * (O_mat_0 + O_vac_0*aexp_tau3 + O_k_0*aexp_tau) ) * * cdef double dadt(double aexp_t,double O_mat_0,double O_vac_0,double O_k_0): # <<<<<<<<<<<<<< - * return ( (1./aexp_t)*(O_mat_0 + O_vac_0*aexp_t**3 + O_k_0*aexp_t) )**0.5 - * + * cdef double aexp_t3 = aexp_t * aexp_t * aexp_t + * return sqrt( (1./aexp_t)*(O_mat_0 + O_vac_0*aexp_t3 + O_k_0*aexp_t) ) */ static double __pyx_f_2yt_9utilities_3lib_14cosmology_time_dadt(double __pyx_v_aexp_t, double __pyx_v_O_mat_0, double __pyx_v_O_vac_0, double __pyx_v_O_k_0) { + double __pyx_v_aexp_t3; double __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dadt", 0); - /* "yt/utilities/lib/cosmology_time.pyx":9 + /* "yt/utilities/lib/cosmology_time.pyx":10 * * cdef double dadt(double aexp_t,double O_mat_0,double O_vac_0,double O_k_0): - * return ( (1./aexp_t)*(O_mat_0 + O_vac_0*aexp_t**3 + O_k_0*aexp_t) )**0.5 # <<<<<<<<<<<<<< + * cdef double aexp_t3 = aexp_t * aexp_t * aexp_t # <<<<<<<<<<<<<< + * return sqrt( (1./aexp_t)*(O_mat_0 + O_vac_0*aexp_t3 + O_k_0*aexp_t) ) + * + */ + __pyx_v_aexp_t3 = ((__pyx_v_aexp_t * __pyx_v_aexp_t) * __pyx_v_aexp_t); + + /* "yt/utilities/lib/cosmology_time.pyx":11 + * cdef double dadt(double aexp_t,double O_mat_0,double O_vac_0,double O_k_0): + * cdef double aexp_t3 = aexp_t * aexp_t * aexp_t + * return sqrt( (1./aexp_t)*(O_mat_0 + O_vac_0*aexp_t3 + O_k_0*aexp_t) ) # <<<<<<<<<<<<<< * * */ if (unlikely(__pyx_v_aexp_t == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 9, __pyx_L1_error) + __PYX_ERR(0, 11, __pyx_L1_error) } - __pyx_r = pow(((1. / __pyx_v_aexp_t) * ((__pyx_v_O_mat_0 + (__pyx_v_O_vac_0 * pow(__pyx_v_aexp_t, 3.0))) + (__pyx_v_O_k_0 * __pyx_v_aexp_t))), 0.5); + __pyx_r = sqrt(((1. / __pyx_v_aexp_t) * ((__pyx_v_O_mat_0 + (__pyx_v_O_vac_0 * __pyx_v_aexp_t3)) + (__pyx_v_O_k_0 * __pyx_v_aexp_t)))); goto __pyx_L0; - /* "yt/utilities/lib/cosmology_time.pyx":8 - * return ( aexp_tau**3 * (O_mat_0 + O_vac_0*aexp_tau**3 + O_k_0*aexp_tau) )**0.5 + /* "yt/utilities/lib/cosmology_time.pyx":9 + * return sqrt( aexp_tau3 * (O_mat_0 + O_vac_0*aexp_tau3 + O_k_0*aexp_tau) ) * * cdef double dadt(double aexp_t,double O_mat_0,double O_vac_0,double O_k_0): # <<<<<<<<<<<<<< - * return ( (1./aexp_t)*(O_mat_0 + O_vac_0*aexp_t**3 + O_k_0*aexp_t) )**0.5 - * + * cdef double aexp_t3 = aexp_t * aexp_t * aexp_t + * return sqrt( (1./aexp_t)*(O_mat_0 + O_vac_0*aexp_t3 + O_k_0*aexp_t) ) */ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.utilities.lib.cosmology_time.dadt", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.cosmology_time.dadt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/cosmology_time.pyx":12 +/* "yt/utilities/lib/cosmology_time.pyx":14 * * * cdef step_cosmo(double alpha,double tau,double aexp_tau,double t,double aexp_t,double O_mat_0,double O_vac_0,double O_k_0): # <<<<<<<<<<<<<< @@ -1637,7 +1714,7 @@ PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("step_cosmo", 0); - /* "yt/utilities/lib/cosmology_time.pyx":15 + /* "yt/utilities/lib/cosmology_time.pyx":17 * cdef double dtau,aexp_tau_pre,dt,aexp_t_pre * * dtau = alpha * aexp_tau / dadtau(aexp_tau,O_mat_0,O_vac_0,O_k_0) # <<<<<<<<<<<<<< @@ -1648,11 +1725,11 @@ __pyx_t_2 = __pyx_f_2yt_9utilities_3lib_14cosmology_time_dadtau(__pyx_v_aexp_tau, __pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0); if (unlikely(__pyx_t_2 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 15, __pyx_L1_error) + __PYX_ERR(0, 17, __pyx_L1_error) } __pyx_v_dtau = (__pyx_t_1 / __pyx_t_2); - /* "yt/utilities/lib/cosmology_time.pyx":16 + /* "yt/utilities/lib/cosmology_time.pyx":18 * * dtau = alpha * aexp_tau / dadtau(aexp_tau,O_mat_0,O_vac_0,O_k_0) * aexp_tau_pre = aexp_tau - dadtau(aexp_tau,O_mat_0,O_vac_0,O_k_0)*dtau/2.0 # <<<<<<<<<<<<<< @@ -1661,7 +1738,7 @@ */ __pyx_v_aexp_tau_pre = (__pyx_v_aexp_tau - ((__pyx_f_2yt_9utilities_3lib_14cosmology_time_dadtau(__pyx_v_aexp_tau, __pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0) * __pyx_v_dtau) / 2.0)); - /* "yt/utilities/lib/cosmology_time.pyx":17 + /* "yt/utilities/lib/cosmology_time.pyx":19 * dtau = alpha * aexp_tau / dadtau(aexp_tau,O_mat_0,O_vac_0,O_k_0) * aexp_tau_pre = aexp_tau - dadtau(aexp_tau,O_mat_0,O_vac_0,O_k_0)*dtau/2.0 * aexp_tau = aexp_tau - dadtau(aexp_tau_pre,O_mat_0,O_vac_0,O_k_0)*dtau # <<<<<<<<<<<<<< @@ -1670,7 +1747,7 @@ */ __pyx_v_aexp_tau = (__pyx_v_aexp_tau - (__pyx_f_2yt_9utilities_3lib_14cosmology_time_dadtau(__pyx_v_aexp_tau_pre, __pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0) * __pyx_v_dtau)); - /* "yt/utilities/lib/cosmology_time.pyx":18 + /* "yt/utilities/lib/cosmology_time.pyx":20 * aexp_tau_pre = aexp_tau - dadtau(aexp_tau,O_mat_0,O_vac_0,O_k_0)*dtau/2.0 * aexp_tau = aexp_tau - dadtau(aexp_tau_pre,O_mat_0,O_vac_0,O_k_0)*dtau * tau = tau - dtau # <<<<<<<<<<<<<< @@ -1679,7 +1756,7 @@ */ __pyx_v_tau = (__pyx_v_tau - __pyx_v_dtau); - /* "yt/utilities/lib/cosmology_time.pyx":20 + /* "yt/utilities/lib/cosmology_time.pyx":22 * tau = tau - dtau * * dt = alpha * aexp_t / dadt(aexp_t,O_mat_0,O_vac_0,O_k_0) # <<<<<<<<<<<<<< @@ -1690,11 +1767,11 @@ __pyx_t_1 = __pyx_f_2yt_9utilities_3lib_14cosmology_time_dadt(__pyx_v_aexp_t, __pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0); if (unlikely(__pyx_t_1 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 20, __pyx_L1_error) + __PYX_ERR(0, 22, __pyx_L1_error) } __pyx_v_dt = (__pyx_t_2 / __pyx_t_1); - /* "yt/utilities/lib/cosmology_time.pyx":21 + /* "yt/utilities/lib/cosmology_time.pyx":23 * * dt = alpha * aexp_t / dadt(aexp_t,O_mat_0,O_vac_0,O_k_0) * aexp_t_pre = aexp_t - dadt(aexp_t,O_mat_0,O_vac_0,O_k_0)*dt/2.0 # <<<<<<<<<<<<<< @@ -1703,7 +1780,7 @@ */ __pyx_v_aexp_t_pre = (__pyx_v_aexp_t - ((__pyx_f_2yt_9utilities_3lib_14cosmology_time_dadt(__pyx_v_aexp_t, __pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0) * __pyx_v_dt) / 2.0)); - /* "yt/utilities/lib/cosmology_time.pyx":22 + /* "yt/utilities/lib/cosmology_time.pyx":24 * dt = alpha * aexp_t / dadt(aexp_t,O_mat_0,O_vac_0,O_k_0) * aexp_t_pre = aexp_t - dadt(aexp_t,O_mat_0,O_vac_0,O_k_0)*dt/2.0 * aexp_t = aexp_t - dadt(aexp_t_pre,O_mat_0,O_vac_0,O_k_0)*dt # <<<<<<<<<<<<<< @@ -1712,7 +1789,7 @@ */ __pyx_v_aexp_t = (__pyx_v_aexp_t - (__pyx_f_2yt_9utilities_3lib_14cosmology_time_dadt(__pyx_v_aexp_t_pre, __pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0) * __pyx_v_dt)); - /* "yt/utilities/lib/cosmology_time.pyx":23 + /* "yt/utilities/lib/cosmology_time.pyx":25 * aexp_t_pre = aexp_t - dadt(aexp_t,O_mat_0,O_vac_0,O_k_0)*dt/2.0 * aexp_t = aexp_t - dadt(aexp_t_pre,O_mat_0,O_vac_0,O_k_0)*dt * t = t - dt # <<<<<<<<<<<<<< @@ -1721,7 +1798,7 @@ */ __pyx_v_t = (__pyx_v_t - __pyx_v_dt); - /* "yt/utilities/lib/cosmology_time.pyx":25 + /* "yt/utilities/lib/cosmology_time.pyx":27 * t = t - dt * * return tau,aexp_tau,t,aexp_t # <<<<<<<<<<<<<< @@ -1729,15 +1806,15 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_tau); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_tau); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_aexp_tau); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_aexp_tau); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_aexp_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_aexp_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -1755,7 +1832,7 @@ __pyx_t_7 = 0; goto __pyx_L0; - /* "yt/utilities/lib/cosmology_time.pyx":12 + /* "yt/utilities/lib/cosmology_time.pyx":14 * * * cdef step_cosmo(double alpha,double tau,double aexp_tau,double t,double aexp_t,double O_mat_0,double O_vac_0,double O_k_0): # <<<<<<<<<<<<<< @@ -1778,7 +1855,7 @@ return __pyx_r; } -/* "yt/utilities/lib/cosmology_time.pyx":28 +/* "yt/utilities/lib/cosmology_time.pyx":30 * * * cpdef friedman(double O_mat_0,double O_vac_0,double O_k_0): # <<<<<<<<<<<<<< @@ -1841,7 +1918,7 @@ __pyx_pybuffernd_tau_out.data = NULL; __pyx_pybuffernd_tau_out.rcbuffer = &__pyx_pybuffer_tau_out; - /* "yt/utilities/lib/cosmology_time.pyx":29 + /* "yt/utilities/lib/cosmology_time.pyx":31 * * cpdef friedman(double O_mat_0,double O_vac_0,double O_k_0): * cdef double alpha=1.e-5,aexp_min=1.e-3,aexp_tau=1.,aexp_t=1.,tau=0.,t=0. # <<<<<<<<<<<<<< @@ -1855,7 +1932,7 @@ __pyx_v_tau = 0.; __pyx_v_t = 0.; - /* "yt/utilities/lib/cosmology_time.pyx":30 + /* "yt/utilities/lib/cosmology_time.pyx":32 * cpdef friedman(double O_mat_0,double O_vac_0,double O_k_0): * cdef double alpha=1.e-5,aexp_min=1.e-3,aexp_tau=1.,aexp_t=1.,tau=0.,t=0. * cdef int nstep=0,ntable=1000,n_out # <<<<<<<<<<<<<< @@ -1865,21 +1942,21 @@ __pyx_v_nstep = 0; __pyx_v_ntable = 0x3E8; - /* "yt/utilities/lib/cosmology_time.pyx":31 + /* "yt/utilities/lib/cosmology_time.pyx":33 * cdef double alpha=1.e-5,aexp_min=1.e-3,aexp_tau=1.,aexp_t=1.,tau=0.,t=0. * cdef int nstep=0,ntable=1000,n_out * cdef np.ndarray[double,mode='c'] t_out=np.zeros([ntable+1]),tau_out=np.zeros([ntable+1]) # <<<<<<<<<<<<<< * cdef double age_tot,delta_tau,next_tau * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_ntable + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_ntable + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -1895,14 +1972,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __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(0, 31, __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, 33, __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; @@ -1911,46 +1988,46 @@ #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(0, 31, __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, 33, __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(0, 31, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __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(0, 31, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 31, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_t_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_t_out.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 31, __pyx_L1_error) + __PYX_ERR(0, 33, __pyx_L1_error) } else {__pyx_pybuffernd_t_out.diminfo[0].strides = __pyx_pybuffernd_t_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t_out.diminfo[0].shape = __pyx_pybuffernd_t_out.rcbuffer->pybuffer.shape[0]; } } __pyx_t_6 = 0; __pyx_v_t_out = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_ntable + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_ntable + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); @@ -1966,14 +2043,14 @@ } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __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_5)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -1982,32 +2059,32 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __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_4); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 31, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_tau_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_tau_out.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 31, __pyx_L1_error) + __PYX_ERR(0, 33, __pyx_L1_error) } else {__pyx_pybuffernd_tau_out.diminfo[0].strides = __pyx_pybuffernd_tau_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau_out.diminfo[0].shape = __pyx_pybuffernd_tau_out.rcbuffer->pybuffer.shape[0]; } } @@ -2015,7 +2092,7 @@ __pyx_v_tau_out = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/cosmology_time.pyx":34 + /* "yt/utilities/lib/cosmology_time.pyx":36 * cdef double age_tot,delta_tau,next_tau * * while aexp_tau >= aexp_min or aexp_t >= aexp_min: # <<<<<<<<<<<<<< @@ -2034,7 +2111,7 @@ __pyx_L5_bool_binop_done:; if (!__pyx_t_7) break; - /* "yt/utilities/lib/cosmology_time.pyx":35 + /* "yt/utilities/lib/cosmology_time.pyx":37 * * while aexp_tau >= aexp_min or aexp_t >= aexp_min: * nstep = nstep + 1 # <<<<<<<<<<<<<< @@ -2043,14 +2120,14 @@ */ __pyx_v_nstep = (__pyx_v_nstep + 1); - /* "yt/utilities/lib/cosmology_time.pyx":36 + /* "yt/utilities/lib/cosmology_time.pyx":38 * while aexp_tau >= aexp_min or aexp_t >= aexp_min: * nstep = nstep + 1 * tau,aexp_tau,t,aexp_t = step_cosmo(alpha,tau,aexp_tau,t,aexp_t,O_mat_0,O_vac_0,O_k_0) # <<<<<<<<<<<<<< * * age_tot=-t */ - __pyx_t_1 = __pyx_f_2yt_9utilities_3lib_14cosmology_time_step_cosmo(__pyx_v_alpha, __pyx_v_tau, __pyx_v_aexp_tau, __pyx_v_t, __pyx_v_aexp_t, __pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_9utilities_3lib_14cosmology_time_step_cosmo(__pyx_v_alpha, __pyx_v_tau, __pyx_v_aexp_tau, __pyx_v_t, __pyx_v_aexp_t, __pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -2062,7 +2139,7 @@ if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 36, __pyx_L1_error) + __PYX_ERR(0, 38, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -2085,7 +2162,7 @@ Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_2,&__pyx_t_4,&__pyx_t_3}; for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 36, __pyx_L1_error) + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -2095,7 +2172,7 @@ } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_2,&__pyx_t_4,&__pyx_t_3}; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; @@ -2104,7 +2181,7 @@ __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 4) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 4) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -2112,16 +2189,16 @@ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 36, __pyx_L1_error) + __PYX_ERR(0, 38, __pyx_L1_error) __pyx_L8_unpacking_done:; } - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tau = __pyx_t_11; __pyx_v_aexp_tau = __pyx_t_12; @@ -2129,7 +2206,7 @@ __pyx_v_aexp_t = __pyx_t_14; } - /* "yt/utilities/lib/cosmology_time.pyx":38 + /* "yt/utilities/lib/cosmology_time.pyx":40 * tau,aexp_tau,t,aexp_t = step_cosmo(alpha,tau,aexp_tau,t,aexp_t,O_mat_0,O_vac_0,O_k_0) * * age_tot=-t # <<<<<<<<<<<<<< @@ -2138,7 +2215,7 @@ */ __pyx_v_age_tot = (-__pyx_v_t); - /* "yt/utilities/lib/cosmology_time.pyx":39 + /* "yt/utilities/lib/cosmology_time.pyx":41 * * age_tot=-t * if nstep < ntable : # <<<<<<<<<<<<<< @@ -2148,7 +2225,7 @@ __pyx_t_7 = ((__pyx_v_nstep < __pyx_v_ntable) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/cosmology_time.pyx":40 + /* "yt/utilities/lib/cosmology_time.pyx":42 * age_tot=-t * if nstep < ntable : * ntable = nstep # <<<<<<<<<<<<<< @@ -2157,7 +2234,7 @@ */ __pyx_v_ntable = __pyx_v_nstep; - /* "yt/utilities/lib/cosmology_time.pyx":41 + /* "yt/utilities/lib/cosmology_time.pyx":43 * if nstep < ntable : * ntable = nstep * alpha = alpha / 2. # <<<<<<<<<<<<<< @@ -2166,7 +2243,7 @@ */ __pyx_v_alpha = (__pyx_v_alpha / 2.); - /* "yt/utilities/lib/cosmology_time.pyx":39 + /* "yt/utilities/lib/cosmology_time.pyx":41 * * age_tot=-t * if nstep < ntable : # <<<<<<<<<<<<<< @@ -2175,7 +2252,7 @@ */ } - /* "yt/utilities/lib/cosmology_time.pyx":43 + /* "yt/utilities/lib/cosmology_time.pyx":45 * alpha = alpha / 2. * * delta_tau = 20.*tau/ntable/11. # <<<<<<<<<<<<<< @@ -2185,11 +2262,11 @@ __pyx_t_14 = (20. * __pyx_v_tau); if (unlikely(__pyx_v_ntable == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 43, __pyx_L1_error) + __PYX_ERR(0, 45, __pyx_L1_error) } __pyx_v_delta_tau = ((__pyx_t_14 / __pyx_v_ntable) / 11.); - /* "yt/utilities/lib/cosmology_time.pyx":45 + /* "yt/utilities/lib/cosmology_time.pyx":47 * delta_tau = 20.*tau/ntable/11. * * aexp_tau = 1. # <<<<<<<<<<<<<< @@ -2198,7 +2275,7 @@ */ __pyx_v_aexp_tau = 1.; - /* "yt/utilities/lib/cosmology_time.pyx":46 + /* "yt/utilities/lib/cosmology_time.pyx":48 * * aexp_tau = 1. * aexp_t = 1. # <<<<<<<<<<<<<< @@ -2207,7 +2284,7 @@ */ __pyx_v_aexp_t = 1.; - /* "yt/utilities/lib/cosmology_time.pyx":47 + /* "yt/utilities/lib/cosmology_time.pyx":49 * aexp_tau = 1. * aexp_t = 1. * tau = 0. # <<<<<<<<<<<<<< @@ -2216,7 +2293,7 @@ */ __pyx_v_tau = 0.; - /* "yt/utilities/lib/cosmology_time.pyx":48 + /* "yt/utilities/lib/cosmology_time.pyx":50 * aexp_t = 1. * tau = 0. * t = 0. # <<<<<<<<<<<<<< @@ -2225,7 +2302,7 @@ */ __pyx_v_t = 0.; - /* "yt/utilities/lib/cosmology_time.pyx":50 + /* "yt/utilities/lib/cosmology_time.pyx":52 * t = 0. * * n_out = 0 # <<<<<<<<<<<<<< @@ -2234,7 +2311,7 @@ */ __pyx_v_n_out = 0; - /* "yt/utilities/lib/cosmology_time.pyx":51 + /* "yt/utilities/lib/cosmology_time.pyx":53 * * n_out = 0 * t_out[n_out] = t # <<<<<<<<<<<<<< @@ -2249,11 +2326,11 @@ } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_t_out.diminfo[0].shape)) __pyx_t_16 = 0; if (unlikely(__pyx_t_16 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_16); - __PYX_ERR(0, 51, __pyx_L1_error) + __PYX_ERR(0, 53, __pyx_L1_error) } *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_t_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_t_out.diminfo[0].strides) = __pyx_v_t; - /* "yt/utilities/lib/cosmology_time.pyx":52 + /* "yt/utilities/lib/cosmology_time.pyx":54 * n_out = 0 * t_out[n_out] = t * tau_out[n_out] = tau # <<<<<<<<<<<<<< @@ -2268,11 +2345,11 @@ } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_tau_out.diminfo[0].shape)) __pyx_t_16 = 0; if (unlikely(__pyx_t_16 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_16); - __PYX_ERR(0, 52, __pyx_L1_error) + __PYX_ERR(0, 54, __pyx_L1_error) } *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_tau_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_tau_out.diminfo[0].strides) = __pyx_v_tau; - /* "yt/utilities/lib/cosmology_time.pyx":54 + /* "yt/utilities/lib/cosmology_time.pyx":56 * tau_out[n_out] = tau * * next_tau = tau + delta_tau/10. # <<<<<<<<<<<<<< @@ -2281,7 +2358,7 @@ */ __pyx_v_next_tau = (__pyx_v_tau + (__pyx_v_delta_tau / 10.)); - /* "yt/utilities/lib/cosmology_time.pyx":56 + /* "yt/utilities/lib/cosmology_time.pyx":58 * next_tau = tau + delta_tau/10. * * while n_out < ntable/2 : # <<<<<<<<<<<<<< @@ -2292,14 +2369,14 @@ __pyx_t_7 = ((__pyx_v_n_out < __Pyx_div_long(__pyx_v_ntable, 2)) != 0); if (!__pyx_t_7) break; - /* "yt/utilities/lib/cosmology_time.pyx":57 + /* "yt/utilities/lib/cosmology_time.pyx":59 * * while n_out < ntable/2 : * tau,aexp_tau,t,aexp_t = step_cosmo(alpha,tau,aexp_tau,t,aexp_t,O_mat_0,O_vac_0,O_k_0) # <<<<<<<<<<<<<< * * if tau < next_tau: */ - __pyx_t_1 = __pyx_f_2yt_9utilities_3lib_14cosmology_time_step_cosmo(__pyx_v_alpha, __pyx_v_tau, __pyx_v_aexp_tau, __pyx_v_t, __pyx_v_aexp_t, __pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_9utilities_3lib_14cosmology_time_step_cosmo(__pyx_v_alpha, __pyx_v_tau, __pyx_v_aexp_tau, __pyx_v_t, __pyx_v_aexp_t, __pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -2311,7 +2388,7 @@ if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 57, __pyx_L1_error) + __PYX_ERR(0, 59, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -2334,7 +2411,7 @@ Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_2,&__pyx_t_5}; for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 57, __pyx_L1_error) + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -2344,7 +2421,7 @@ } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_2,&__pyx_t_5}; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; @@ -2353,7 +2430,7 @@ __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 4) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 4) < 0) __PYX_ERR(0, 59, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L13_unpacking_done; @@ -2361,23 +2438,23 @@ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 57, __pyx_L1_error) + __PYX_ERR(0, 59, __pyx_L1_error) __pyx_L13_unpacking_done:; } - __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_tau = __pyx_t_14; __pyx_v_aexp_tau = __pyx_t_13; __pyx_v_t = __pyx_t_12; __pyx_v_aexp_t = __pyx_t_11; - /* "yt/utilities/lib/cosmology_time.pyx":59 + /* "yt/utilities/lib/cosmology_time.pyx":61 * tau,aexp_tau,t,aexp_t = step_cosmo(alpha,tau,aexp_tau,t,aexp_t,O_mat_0,O_vac_0,O_k_0) * * if tau < next_tau: # <<<<<<<<<<<<<< @@ -2387,7 +2464,7 @@ __pyx_t_7 = ((__pyx_v_tau < __pyx_v_next_tau) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/cosmology_time.pyx":60 + /* "yt/utilities/lib/cosmology_time.pyx":62 * * if tau < next_tau: * n_out = n_out + 1 # <<<<<<<<<<<<<< @@ -2396,7 +2473,7 @@ */ __pyx_v_n_out = (__pyx_v_n_out + 1); - /* "yt/utilities/lib/cosmology_time.pyx":61 + /* "yt/utilities/lib/cosmology_time.pyx":63 * if tau < next_tau: * n_out = n_out + 1 * t_out[n_out] = t # <<<<<<<<<<<<<< @@ -2411,11 +2488,11 @@ } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_t_out.diminfo[0].shape)) __pyx_t_16 = 0; if (unlikely(__pyx_t_16 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_16); - __PYX_ERR(0, 61, __pyx_L1_error) + __PYX_ERR(0, 63, __pyx_L1_error) } *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_t_out.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_t_out.diminfo[0].strides) = __pyx_v_t; - /* "yt/utilities/lib/cosmology_time.pyx":62 + /* "yt/utilities/lib/cosmology_time.pyx":64 * n_out = n_out + 1 * t_out[n_out] = t * tau_out[n_out] = tau # <<<<<<<<<<<<<< @@ -2430,11 +2507,11 @@ } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_tau_out.diminfo[0].shape)) __pyx_t_16 = 0; if (unlikely(__pyx_t_16 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_16); - __PYX_ERR(0, 62, __pyx_L1_error) + __PYX_ERR(0, 64, __pyx_L1_error) } *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_tau_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_tau_out.diminfo[0].strides) = __pyx_v_tau; - /* "yt/utilities/lib/cosmology_time.pyx":63 + /* "yt/utilities/lib/cosmology_time.pyx":65 * t_out[n_out] = t * tau_out[n_out] = tau * next_tau = next_tau + delta_tau/10. # <<<<<<<<<<<<<< @@ -2443,7 +2520,7 @@ */ __pyx_v_next_tau = (__pyx_v_next_tau + (__pyx_v_delta_tau / 10.)); - /* "yt/utilities/lib/cosmology_time.pyx":59 + /* "yt/utilities/lib/cosmology_time.pyx":61 * tau,aexp_tau,t,aexp_t = step_cosmo(alpha,tau,aexp_tau,t,aexp_t,O_mat_0,O_vac_0,O_k_0) * * if tau < next_tau: # <<<<<<<<<<<<<< @@ -2453,7 +2530,7 @@ } } - /* "yt/utilities/lib/cosmology_time.pyx":65 + /* "yt/utilities/lib/cosmology_time.pyx":67 * next_tau = next_tau + delta_tau/10. * * while aexp_tau >= aexp_min or aexp_t >= aexp_min: # <<<<<<<<<<<<<< @@ -2472,14 +2549,14 @@ __pyx_L17_bool_binop_done:; if (!__pyx_t_7) break; - /* "yt/utilities/lib/cosmology_time.pyx":66 + /* "yt/utilities/lib/cosmology_time.pyx":68 * * while aexp_tau >= aexp_min or aexp_t >= aexp_min: * tau,aexp_tau,t,aexp_t = step_cosmo(alpha,tau,aexp_tau,t,aexp_t,O_mat_0,O_vac_0,O_k_0) # <<<<<<<<<<<<<< * * if tau < next_tau: */ - __pyx_t_1 = __pyx_f_2yt_9utilities_3lib_14cosmology_time_step_cosmo(__pyx_v_alpha, __pyx_v_tau, __pyx_v_aexp_tau, __pyx_v_t, __pyx_v_aexp_t, __pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_9utilities_3lib_14cosmology_time_step_cosmo(__pyx_v_alpha, __pyx_v_tau, __pyx_v_aexp_tau, __pyx_v_t, __pyx_v_aexp_t, __pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -2491,7 +2568,7 @@ if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 66, __pyx_L1_error) + __PYX_ERR(0, 68, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -2514,7 +2591,7 @@ Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_2,&__pyx_t_4,&__pyx_t_3}; for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 66, __pyx_L1_error) + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -2524,7 +2601,7 @@ } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_2,&__pyx_t_4,&__pyx_t_3}; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; @@ -2533,7 +2610,7 @@ __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 4) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 4) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L20_unpacking_done; @@ -2541,23 +2618,23 @@ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 66, __pyx_L1_error) + __PYX_ERR(0, 68, __pyx_L1_error) __pyx_L20_unpacking_done:; } - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tau = __pyx_t_11; __pyx_v_aexp_tau = __pyx_t_12; __pyx_v_t = __pyx_t_13; __pyx_v_aexp_t = __pyx_t_14; - /* "yt/utilities/lib/cosmology_time.pyx":68 + /* "yt/utilities/lib/cosmology_time.pyx":70 * tau,aexp_tau,t,aexp_t = step_cosmo(alpha,tau,aexp_tau,t,aexp_t,O_mat_0,O_vac_0,O_k_0) * * if tau < next_tau: # <<<<<<<<<<<<<< @@ -2567,7 +2644,7 @@ __pyx_t_7 = ((__pyx_v_tau < __pyx_v_next_tau) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/cosmology_time.pyx":69 + /* "yt/utilities/lib/cosmology_time.pyx":71 * * if tau < next_tau: * n_out = n_out + 1 # <<<<<<<<<<<<<< @@ -2576,7 +2653,7 @@ */ __pyx_v_n_out = (__pyx_v_n_out + 1); - /* "yt/utilities/lib/cosmology_time.pyx":70 + /* "yt/utilities/lib/cosmology_time.pyx":72 * if tau < next_tau: * n_out = n_out + 1 * t_out[n_out] = t # <<<<<<<<<<<<<< @@ -2591,11 +2668,11 @@ } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_t_out.diminfo[0].shape)) __pyx_t_16 = 0; if (unlikely(__pyx_t_16 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_16); - __PYX_ERR(0, 70, __pyx_L1_error) + __PYX_ERR(0, 72, __pyx_L1_error) } *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_t_out.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_t_out.diminfo[0].strides) = __pyx_v_t; - /* "yt/utilities/lib/cosmology_time.pyx":71 + /* "yt/utilities/lib/cosmology_time.pyx":73 * n_out = n_out + 1 * t_out[n_out] = t * tau_out[n_out] = tau # <<<<<<<<<<<<<< @@ -2610,11 +2687,11 @@ } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_tau_out.diminfo[0].shape)) __pyx_t_16 = 0; if (unlikely(__pyx_t_16 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_16); - __PYX_ERR(0, 71, __pyx_L1_error) + __PYX_ERR(0, 73, __pyx_L1_error) } *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_tau_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_tau_out.diminfo[0].strides) = __pyx_v_tau; - /* "yt/utilities/lib/cosmology_time.pyx":72 + /* "yt/utilities/lib/cosmology_time.pyx":74 * t_out[n_out] = t * tau_out[n_out] = tau * next_tau = next_tau + delta_tau # <<<<<<<<<<<<<< @@ -2623,7 +2700,7 @@ */ __pyx_v_next_tau = (__pyx_v_next_tau + __pyx_v_delta_tau); - /* "yt/utilities/lib/cosmology_time.pyx":68 + /* "yt/utilities/lib/cosmology_time.pyx":70 * tau,aexp_tau,t,aexp_t = step_cosmo(alpha,tau,aexp_tau,t,aexp_t,O_mat_0,O_vac_0,O_k_0) * * if tau < next_tau: # <<<<<<<<<<<<<< @@ -2633,7 +2710,7 @@ } } - /* "yt/utilities/lib/cosmology_time.pyx":74 + /* "yt/utilities/lib/cosmology_time.pyx":76 * next_tau = next_tau + delta_tau * * n_out = ntable # <<<<<<<<<<<<<< @@ -2642,7 +2719,7 @@ */ __pyx_v_n_out = __pyx_v_ntable; - /* "yt/utilities/lib/cosmology_time.pyx":75 + /* "yt/utilities/lib/cosmology_time.pyx":77 * * n_out = ntable * t_out[n_out] = t # <<<<<<<<<<<<<< @@ -2657,11 +2734,11 @@ } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_t_out.diminfo[0].shape)) __pyx_t_16 = 0; if (unlikely(__pyx_t_16 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_16); - __PYX_ERR(0, 75, __pyx_L1_error) + __PYX_ERR(0, 77, __pyx_L1_error) } *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_t_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_t_out.diminfo[0].strides) = __pyx_v_t; - /* "yt/utilities/lib/cosmology_time.pyx":76 + /* "yt/utilities/lib/cosmology_time.pyx":78 * n_out = ntable * t_out[n_out] = t * tau_out[n_out] = tau # <<<<<<<<<<<<<< @@ -2676,11 +2753,11 @@ } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_tau_out.diminfo[0].shape)) __pyx_t_16 = 0; if (unlikely(__pyx_t_16 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_16); - __PYX_ERR(0, 76, __pyx_L1_error) + __PYX_ERR(0, 78, __pyx_L1_error) } *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_tau_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_tau_out.diminfo[0].strides) = __pyx_v_tau; - /* "yt/utilities/lib/cosmology_time.pyx":78 + /* "yt/utilities/lib/cosmology_time.pyx":80 * tau_out[n_out] = tau * * return tau_out,t_out,delta_tau,ntable,age_tot # <<<<<<<<<<<<<< @@ -2688,13 +2765,13 @@ * cpdef get_ramses_ages(np.ndarray[double,mode='c'] tf, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_delta_tau); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_delta_tau); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ntable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ntable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_age_tot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_age_tot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_tau_out)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tau_out)); @@ -2715,7 +2792,7 @@ __pyx_t_2 = 0; goto __pyx_L0; - /* "yt/utilities/lib/cosmology_time.pyx":28 + /* "yt/utilities/lib/cosmology_time.pyx":30 * * * cpdef friedman(double O_mat_0,double O_vac_0,double O_k_0): # <<<<<<<<<<<<<< @@ -2769,8 +2846,11 @@ 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; } @@ -2779,19 +2859,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_O_mat_0)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_O_vac_0)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("friedman", 1, 3, 3, 1); __PYX_ERR(0, 28, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("friedman", 1, 3, 3, 1); __PYX_ERR(0, 30, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_O_k_0)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("friedman", 1, 3, 3, 2); __PYX_ERR(0, 28, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("friedman", 1, 3, 3, 2); __PYX_ERR(0, 30, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "friedman") < 0)) __PYX_ERR(0, 28, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "friedman") < 0)) __PYX_ERR(0, 30, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -2800,13 +2882,13 @@ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_O_mat_0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_O_mat_0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error) - __pyx_v_O_vac_0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_O_vac_0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error) - __pyx_v_O_k_0 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_O_k_0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error) + __pyx_v_O_mat_0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_O_mat_0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error) + __pyx_v_O_vac_0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_O_vac_0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error) + __pyx_v_O_k_0 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_O_k_0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("friedman", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 28, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("friedman", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 30, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.cosmology_time.friedman", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2825,7 +2907,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("friedman", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_2yt_9utilities_3lib_14cosmology_time_friedman(__pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_9utilities_3lib_14cosmology_time_friedman(__pyx_v_O_mat_0, __pyx_v_O_vac_0, __pyx_v_O_k_0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2842,7 +2924,7 @@ return __pyx_r; } -/* "yt/utilities/lib/cosmology_time.pyx":80 +/* "yt/utilities/lib/cosmology_time.pyx":82 * return tau_out,t_out,delta_tau,ntable,age_tot * * cpdef get_ramses_ages(np.ndarray[double,mode='c'] tf, # <<<<<<<<<<<<<< @@ -2908,39 +2990,39 @@ __pyx_pybuffernd_ages.rcbuffer = &__pyx_pybuffer_ages; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tf.rcbuffer->pybuffer, (PyObject*)__pyx_v_tf, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tf.rcbuffer->pybuffer, (PyObject*)__pyx_v_tf, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 82, __pyx_L1_error) } __pyx_pybuffernd_tf.diminfo[0].strides = __pyx_pybuffernd_tf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tf.diminfo[0].shape = __pyx_pybuffernd_tf.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tauf.rcbuffer->pybuffer, (PyObject*)__pyx_v_tauf, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tauf.rcbuffer->pybuffer, (PyObject*)__pyx_v_tauf, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 82, __pyx_L1_error) } __pyx_pybuffernd_tauf.diminfo[0].strides = __pyx_pybuffernd_tauf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tauf.diminfo[0].shape = __pyx_pybuffernd_tauf.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ages.rcbuffer->pybuffer, (PyObject*)__pyx_v_ages, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ages.rcbuffer->pybuffer, (PyObject*)__pyx_v_ages, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 82, __pyx_L1_error) } __pyx_pybuffernd_ages.diminfo[0].strides = __pyx_pybuffernd_ages.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ages.diminfo[0].shape = __pyx_pybuffernd_ages.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/cosmology_time.pyx":93 + /* "yt/utilities/lib/cosmology_time.pyx":95 * cdef np.ndarray[int,mode='c'] iage * * dage = 1 + (10*ages/dtau) # <<<<<<<<<<<<<< * dage = np.minimum(dage, nOver2 + (dage - nOver2)/10.) * iage = np.array(dage,dtype=np.int32) */ - __pyx_t_1 = PyNumber_Multiply(__pyx_int_10, ((PyObject *)__pyx_v_ages)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_int_10, ((PyObject *)__pyx_v_ages)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_dtau); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_dtau); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_3, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_3, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 93, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 95, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2956,35 +3038,35 @@ } } __pyx_pybuffernd_dage.diminfo[0].strides = __pyx_pybuffernd_dage.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dage.diminfo[0].shape = __pyx_pybuffernd_dage.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 93, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 95, __pyx_L1_error) } __pyx_t_4 = 0; __pyx_v_dage = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/cosmology_time.pyx":94 + /* "yt/utilities/lib/cosmology_time.pyx":96 * * dage = 1 + (10*ages/dtau) * dage = np.minimum(dage, nOver2 + (dage - nOver2)/10.) # <<<<<<<<<<<<<< * iage = np.array(dage,dtype=np.int32) * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_minimum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_minimum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nOver2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nOver2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nOver2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nOver2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyNumber_Subtract(((PyObject *)__pyx_v_dage), __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_10 = PyNumber_Subtract(((PyObject *)__pyx_v_dage), __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyFloat_DivideObjC(__pyx_t_10, __pyx_float_10_, 10., 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyFloat_DivideObjC(__pyx_t_10, __pyx_float_10_, 10., 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_10 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -3003,7 +3085,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_dage), __pyx_t_10}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -3012,14 +3094,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_dage), __pyx_t_10}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -3030,12 +3112,12 @@ __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __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; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 94, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3051,44 +3133,44 @@ } } __pyx_pybuffernd_dage.diminfo[0].strides = __pyx_pybuffernd_dage.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dage.diminfo[0].shape = __pyx_pybuffernd_dage.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 94, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 96, __pyx_L1_error) } __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_dage, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "yt/utilities/lib/cosmology_time.pyx":95 + /* "yt/utilities/lib/cosmology_time.pyx":97 * dage = 1 + (10*ages/dtau) * dage = np.minimum(dage, nOver2 + (dage - nOver2)/10.) * iage = np.array(dage,dtype=np.int32) # <<<<<<<<<<<<<< * * t = (tf[iage]*(ages - tauf[iage - 1]) / (tauf[iage] - tauf[iage - 1])) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __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(0, 95, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_dage)); __Pyx_GIVEREF(((PyObject *)__pyx_v_dage)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_dage)); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 95, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __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; - if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 95, __pyx_L1_error) + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 97, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_9); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3104,49 +3186,49 @@ } } __pyx_pybuffernd_iage.diminfo[0].strides = __pyx_pybuffernd_iage.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iage.diminfo[0].shape = __pyx_pybuffernd_iage.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) } __pyx_t_11 = 0; __pyx_v_iage = ((PyArrayObject *)__pyx_t_9); __pyx_t_9 = 0; - /* "yt/utilities/lib/cosmology_time.pyx":97 + /* "yt/utilities/lib/cosmology_time.pyx":99 * iage = np.array(dage,dtype=np.int32) * * t = (tf[iage]*(ages - tauf[iage - 1]) / (tauf[iage] - tauf[iage - 1])) # <<<<<<<<<<<<<< * t = t + (tf[iage-1]*(ages-tauf[iage]) / (tauf[iage-1]-tauf[iage])) * return (tsim - t)*t_scale */ - __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_tf), ((PyObject *)__pyx_v_iage)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_tf), ((PyObject *)__pyx_v_iage)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyNumber_Subtract(((PyObject *)__pyx_v_iage), __pyx_int_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(((PyObject *)__pyx_v_iage), __pyx_int_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_tauf), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_tauf), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(((PyObject *)__pyx_v_ages), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(((PyObject *)__pyx_v_ages), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_tauf), ((PyObject *)__pyx_v_iage)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_tauf), ((PyObject *)__pyx_v_iage)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyNumber_Subtract(((PyObject *)__pyx_v_iage), __pyx_int_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(((PyObject *)__pyx_v_iage), __pyx_int_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_tauf), __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_tauf), __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 97, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3162,52 +3244,52 @@ } } __pyx_pybuffernd_t.diminfo[0].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t.diminfo[0].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 99, __pyx_L1_error) } __pyx_t_12 = 0; __pyx_v_t = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/cosmology_time.pyx":98 + /* "yt/utilities/lib/cosmology_time.pyx":100 * * t = (tf[iage]*(ages - tauf[iage - 1]) / (tauf[iage] - tauf[iage - 1])) * t = t + (tf[iage-1]*(ages-tauf[iage]) / (tauf[iage-1]-tauf[iage])) # <<<<<<<<<<<<<< * return (tsim - t)*t_scale * */ - __pyx_t_1 = PyNumber_Subtract(((PyObject *)__pyx_v_iage), __pyx_int_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(((PyObject *)__pyx_v_iage), __pyx_int_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_tf), __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_tf), __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_tauf), ((PyObject *)__pyx_v_iage)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_tauf), ((PyObject *)__pyx_v_iage)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(((PyObject *)__pyx_v_ages), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(((PyObject *)__pyx_v_ages), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Multiply(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(((PyObject *)__pyx_v_iage), __pyx_int_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(((PyObject *)__pyx_v_iage), __pyx_int_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_tauf), __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_tauf), __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_tauf), ((PyObject *)__pyx_v_iage)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_tauf), ((PyObject *)__pyx_v_iage)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_t), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_t), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 98, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3223,27 +3305,27 @@ } } __pyx_pybuffernd_t.diminfo[0].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t.diminfo[0].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 98, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 100, __pyx_L1_error) } __pyx_t_12 = 0; __Pyx_DECREF_SET(__pyx_v_t, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "yt/utilities/lib/cosmology_time.pyx":99 + /* "yt/utilities/lib/cosmology_time.pyx":101 * t = (tf[iage]*(ages - tauf[iage - 1]) / (tauf[iage] - tauf[iage - 1])) * t = t + (tf[iage-1]*(ages-tauf[iage]) / (tauf[iage-1]-tauf[iage])) * return (tsim - t)*t_scale # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_tsim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_tsim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, ((PyObject *)__pyx_v_t)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, ((PyObject *)__pyx_v_t)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_t_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_t_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3251,7 +3333,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/utilities/lib/cosmology_time.pyx":80 + /* "yt/utilities/lib/cosmology_time.pyx":82 * return tau_out,t_out,delta_tau,ntable,age_tot * * cpdef get_ramses_ages(np.ndarray[double,mode='c'] tf, # <<<<<<<<<<<<<< @@ -3318,13 +3400,21 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -3333,44 +3423,51 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tf)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tauf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 1); __PYX_ERR(0, 80, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 1); __PYX_ERR(0, 82, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtau)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 2); __PYX_ERR(0, 80, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 2); __PYX_ERR(0, 82, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tsim)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 3); __PYX_ERR(0, 80, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 3); __PYX_ERR(0, 82, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t_scale)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 4); __PYX_ERR(0, 80, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 4); __PYX_ERR(0, 82, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ages)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 5); __PYX_ERR(0, 80, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 5); __PYX_ERR(0, 82, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nOver2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 6); __PYX_ERR(0, 80, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 6); __PYX_ERR(0, 82, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ntot)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 7); __PYX_ERR(0, 80, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, 7); __PYX_ERR(0, 82, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_ramses_ages") < 0)) __PYX_ERR(0, 80, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_ramses_ages") < 0)) __PYX_ERR(0, 82, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; @@ -3386,24 +3483,24 @@ } __pyx_v_tf = ((PyArrayObject *)values[0]); __pyx_v_tauf = ((PyArrayObject *)values[1]); - __pyx_v_dtau = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dtau == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) - __pyx_v_tsim = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_tsim == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error) - __pyx_v_t_scale = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_t_scale == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) + __pyx_v_dtau = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dtau == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) + __pyx_v_tsim = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_tsim == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error) + __pyx_v_t_scale = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_t_scale == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) __pyx_v_ages = ((PyArrayObject *)values[5]); - __pyx_v_nOver2 = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nOver2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) - __pyx_v_ntot = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ntot == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) + __pyx_v_nOver2 = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nOver2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error) + __pyx_v_ntot = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ntot == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 80, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_ramses_ages", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 82, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.cosmology_time.get_ramses_ages", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tf), __pyx_ptype_5numpy_ndarray, 1, "tf", 0))) __PYX_ERR(0, 80, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tauf), __pyx_ptype_5numpy_ndarray, 1, "tauf", 0))) __PYX_ERR(0, 81, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ages), __pyx_ptype_5numpy_ndarray, 1, "ages", 0))) __PYX_ERR(0, 85, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tf), __pyx_ptype_5numpy_ndarray, 1, "tf", 0))) __PYX_ERR(0, 82, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tauf), __pyx_ptype_5numpy_ndarray, 1, "tauf", 0))) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ages), __pyx_ptype_5numpy_ndarray, 1, "ages", 0))) __PYX_ERR(0, 87, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14cosmology_time_2get_ramses_ages(__pyx_self, __pyx_v_tf, __pyx_v_tauf, __pyx_v_dtau, __pyx_v_tsim, __pyx_v_t_scale, __pyx_v_ages, __pyx_v_nOver2, __pyx_v_ntot); /* function exit code */ @@ -3440,21 +3537,21 @@ __pyx_pybuffernd_ages.rcbuffer = &__pyx_pybuffer_ages; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tf.rcbuffer->pybuffer, (PyObject*)__pyx_v_tf, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tf.rcbuffer->pybuffer, (PyObject*)__pyx_v_tf, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 82, __pyx_L1_error) } __pyx_pybuffernd_tf.diminfo[0].strides = __pyx_pybuffernd_tf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tf.diminfo[0].shape = __pyx_pybuffernd_tf.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tauf.rcbuffer->pybuffer, (PyObject*)__pyx_v_tauf, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tauf.rcbuffer->pybuffer, (PyObject*)__pyx_v_tauf, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 82, __pyx_L1_error) } __pyx_pybuffernd_tauf.diminfo[0].strides = __pyx_pybuffernd_tauf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tauf.diminfo[0].shape = __pyx_pybuffernd_tauf.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ages.rcbuffer->pybuffer, (PyObject*)__pyx_v_ages, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ages.rcbuffer->pybuffer, (PyObject*)__pyx_v_ages, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 82, __pyx_L1_error) } __pyx_pybuffernd_ages.diminfo[0].strides = __pyx_pybuffernd_ages.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ages.diminfo[0].shape = __pyx_pybuffernd_ages.rcbuffer->pybuffer.shape[0]; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_2yt_9utilities_3lib_14cosmology_time_get_ramses_ages(__pyx_v_tf, __pyx_v_tauf, __pyx_v_dtau, __pyx_v_tsim, __pyx_v_t_scale, __pyx_v_ages, __pyx_v_nOver2, __pyx_v_ntot, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_1 = __pyx_f_2yt_9utilities_3lib_14cosmology_time_get_ramses_ages(__pyx_v_tf, __pyx_v_tauf, __pyx_v_dtau, __pyx_v_tsim, __pyx_v_t_scale, __pyx_v_ages, __pyx_v_nOver2, __pyx_v_ntot, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5665,7 +5762,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5713,7 +5810,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -5796,7 +5893,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5844,7 +5941,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -5927,7 +6024,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5972,7 +6069,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -6034,6 +6131,7 @@ {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_ages, __pyx_k_ages, sizeof(__pyx_k_ages), 0, 0, 1, 1}, {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 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_dtau, __pyx_k_dtau, sizeof(__pyx_k_dtau), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, @@ -6241,6 +6339,7 @@ __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 @@ -6292,7 +6391,7 @@ /* "yt/utilities/lib/cosmology_time.pyx":2 * cimport numpy as np * import 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, 2, __pyx_L1_error) @@ -6303,7 +6402,7 @@ /* "yt/utilities/lib/cosmology_time.pyx":1 * cimport numpy as np # <<<<<<<<<<<<<< * import numpy as np - * + * from libc.math cimport sqrt */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -6325,7 +6424,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.cosmology_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.cosmology_time", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -6462,17 +6561,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -6591,8 +6695,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON @@ -6652,11 +6756,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -6679,7 +6779,7 @@ #endif /* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -6692,7 +6792,7 @@ } /* BufferFormatCheck */ - static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; } @@ -7242,20 +7342,20 @@ } /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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"); } /* IterFinish */ - static CYTHON_INLINE int __Pyx_IterFinish(void) { + static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; @@ -7290,7 +7390,7 @@ } /* UnpackItemEndCheck */ - static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); @@ -7302,13 +7402,13 @@ } /* BufferIndexError */ - static void __Pyx_RaiseBufferIndexError(int axis) { + static void __Pyx_RaiseBufferIndexError(int axis) { PyErr_Format(PyExc_IndexError, "Out of bounds on buffer access (axis %d)", axis); } /* None */ - static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + 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)); @@ -7316,7 +7416,7 @@ } /* RaiseArgTupleInvalid */ - static void __Pyx_RaiseArgtupleInvalid( + static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, @@ -7342,7 +7442,7 @@ } /* RaiseDoubleKeywords */ - static void __Pyx_RaiseDoubleKeywordsError( + static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { @@ -7356,7 +7456,7 @@ } /* ParseKeywords */ - static int __Pyx_ParseOptionalKeywords( + static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, @@ -7458,7 +7558,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { @@ -7574,13 +7674,13 @@ #endif /* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { + static void __Pyx_RaiseBufferFallbackError(void) { PyErr_SetString(PyExc_ValueError, "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); } /* PyFloatBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) { const double b = floatval; double a, result; @@ -7604,7 +7704,7 @@ case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -2) a = -a; break; @@ -7614,7 +7714,7 @@ case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -3) a = -a; break; @@ -7624,7 +7724,7 @@ case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -4) a = -a; break; @@ -7648,7 +7748,7 @@ #endif /* ArgTypeTest */ - static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); @@ -7675,7 +7775,7 @@ } /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -7838,12 +7938,12 @@ #endif /* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -7867,7 +7967,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -7877,7 +7977,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -7938,7 +8038,7 @@ } /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -8011,8 +8111,42 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -8092,7 +8226,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -8151,12 +8285,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -8193,8 +8330,8 @@ #endif - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + /* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -8216,7 +8353,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -8247,7 +8384,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -8278,7 +8415,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -8298,7 +8435,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -8433,7 +8570,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -8453,7 +8590,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -8588,7 +8725,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -8619,7 +8756,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -8808,7 +8945,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -8997,7 +9134,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -9013,7 +9150,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -9031,7 +9168,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -9096,7 +9233,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -9121,6 +9258,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -9129,11 +9268,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/cosmology_time.pyx yt-3.4.0/yt/utilities/lib/cosmology_time.pyx --- yt-3.3.3/yt/utilities/lib/cosmology_time.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/cosmology_time.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -1,12 +1,14 @@ cimport numpy as np import numpy as np - +from libc.math cimport sqrt cdef double dadtau(double aexp_tau,double O_mat_0,double O_vac_0,double O_k_0): - return ( aexp_tau**3 * (O_mat_0 + O_vac_0*aexp_tau**3 + O_k_0*aexp_tau) )**0.5 + cdef double aexp_tau3 = aexp_tau * aexp_tau * aexp_tau + return sqrt( aexp_tau3 * (O_mat_0 + O_vac_0*aexp_tau3 + O_k_0*aexp_tau) ) cdef double dadt(double aexp_t,double O_mat_0,double O_vac_0,double O_k_0): - return ( (1./aexp_t)*(O_mat_0 + O_vac_0*aexp_t**3 + O_k_0*aexp_t) )**0.5 + cdef double aexp_t3 = aexp_t * aexp_t * aexp_t + return sqrt( (1./aexp_t)*(O_mat_0 + O_vac_0*aexp_t3 + O_k_0*aexp_t) ) cdef step_cosmo(double alpha,double tau,double aexp_tau,double t,double aexp_t,double O_mat_0,double O_vac_0,double O_k_0): diff -Nru yt-3.3.3/yt/utilities/lib/depth_first_octree.c yt-3.4.0/yt/utilities/lib/depth_first_octree.c --- yt-3.3.3/yt/utilities/lib/depth_first_octree.c 2016-12-12 01:41:43.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/depth_first_octree.c 2017-08-10 18:20:32.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,6 +6,10 @@ "depends": [], "libraries": [ "m" + ], + "name": "yt.utilities.lib.depth_first_octree", + "sources": [ + "yt/utilities/lib/depth_first_octree.pyx" ] }, "module_name": "yt.utilities.lib.depth_first_octree" @@ -19,7 +23,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -41,6 +45,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -193,16 +198,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -329,6 +338,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -383,6 +398,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -490,8 +534,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -504,8 +548,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -627,10 +674,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -663,6 +712,7 @@ static const char *__pyx_f[] = { + "stringsource", "yt/utilities/lib/depth_first_octree.pyx", "__init__.pxd", "type.pxd", @@ -1094,26 +1144,12 @@ /* KeywordStringCheck.proto */ static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); -/* 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); - -/* ArgTypeTest.proto */ -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); - -/* BufferFormatCheck.proto */ -static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, - __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO +/* 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 /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE @@ -1139,6 +1175,30 @@ #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); + +/* 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); + +/* ArgTypeTest.proto */ +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); + +/* BufferFormatCheck.proto */ +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + /* 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) ?\ @@ -1191,17 +1251,7 @@ #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2) -/* 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) { @@ -1259,9 +1309,15 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1493,6 +1549,7 @@ int __pyx_module_is_main_yt__utilities__lib__depth_first_octree = 0; /* Implementation of 'yt.utilities.lib.depth_first_octree' */ +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; @@ -1537,6 +1594,7 @@ static const char __pyx_k_corners[] = "corners"; static const char __pyx_k_refined[] = "refined"; static const char __pyx_k_child_dx[] = "child_dx"; +static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_genealogy[] = "genealogy"; static const char __pyx_k_leftedges[] = "leftedges"; static const char __pyx_k_ValueError[] = "ValueError"; @@ -1546,20 +1604,24 @@ static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_child_indices[] = "child_indices"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_child_leftedges[] = "child_leftedges"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_RecurseOctreeByLevels[] = "RecurseOctreeByLevels"; static const char __pyx_k_RecurseOctreeDepthFirst[] = "RecurseOctreeDepthFirst"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/depth_first_octree.pyx"; static const char __pyx_k_This_is_a_recursive_function_to[] = "\nThis is a recursive function to return a depth-first octree\n\n\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"; static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_utilities_lib_depth_first_oct[] = "yt.utilities.lib.depth_first_octree"; +static const char __pyx_k_yt_utilities_lib_depth_first_oct[] = "yt/utilities/lib/depth_first_octree.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_utilities_lib_depth_first_oct_2[] = "yt.utilities.lib.depth_first_octree"; 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; @@ -1567,7 +1629,7 @@ static PyObject *__pyx_n_s_RecurseOctreeByLevels; static PyObject *__pyx_n_s_RecurseOctreeDepthFirst; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; +static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_child_dx; static PyObject *__pyx_n_s_child_grid; @@ -1577,6 +1639,7 @@ static PyObject *__pyx_n_s_child_k; static PyObject *__pyx_n_s_child_leftedges; static PyObject *__pyx_n_s_ci; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_corners; static PyObject *__pyx_n_s_cp; static PyObject *__pyx_n_s_curpos; @@ -1610,6 +1673,7 @@ static PyObject *__pyx_n_s_main; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_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; @@ -1617,16 +1681,21 @@ static PyObject *__pyx_n_s_offset; static PyObject *__pyx_n_s_output; static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_refined; static PyObject *__pyx_n_s_s; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_test; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; -static PyObject *__pyx_n_s_yt_utilities_lib_depth_first_oct; +static PyObject *__pyx_kp_s_yt_utilities_lib_depth_first_oct; +static PyObject *__pyx_n_s_yt_utilities_lib_depth_first_oct_2; static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyArrayObject *__pyx_v_child_indices, PyArrayObject *__pyx_v_fields, PyArrayObject *__pyx_v_left_edges, PyArrayObject *__pyx_v_dimensions, PyArrayObject *__pyx_v_dx, int __pyx_v_level, int __pyx_v_offset); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ @@ -1647,11 +1716,15 @@ static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self, PyObject *__pyx_v_grids); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_2__getitem__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self, int __pyx_v_item); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_RecurseOctreeDepthFirst(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_i_i, int __pyx_v_j_i, int __pyx_v_k_i, int __pyx_v_i_f, int __pyx_v_j_f, int __pyx_v_k_f, struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_curpos, int __pyx_v_gi, PyArrayObject *__pyx_v_output, PyArrayObject *__pyx_v_refined, struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_grids); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_2RecurseOctreeByLevels(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_i_i, int __pyx_v_j_i, int __pyx_v_k_i, int __pyx_v_i_f, int __pyx_v_j_f, int __pyx_v_k_f, PyArrayObject *__pyx_v_curpos, int __pyx_v_gi, PyArrayObject *__pyx_v_output, PyArrayObject *__pyx_v_genealogy, PyArrayObject *__pyx_v_corners, struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_grids); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ @@ -1671,9 +1744,15 @@ static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; -static PyObject *__pyx_codeobj__11; -static PyObject *__pyx_codeobj__13; +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_codeobj__17; +static PyObject *__pyx_codeobj__19; /* "yt/utilities/lib/depth_first_octree.pyx":22 * cdef class position: @@ -1763,7 +1842,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->output_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->output_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1798,7 +1877,7 @@ __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error) __pyx_v_self->output_pos = __pyx_t_1; /* function exit code */ @@ -1831,7 +1910,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->refined_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->refined_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1866,7 +1945,7 @@ __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error) __pyx_v_self->refined_pos = __pyx_t_1; /* function exit code */ @@ -1880,6 +1959,113 @@ 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_2yt_9utilities_3lib_18depth_first_octree_8position_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_3__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_2yt_9utilities_3lib_18depth_first_octree_8position_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__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_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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("yt.utilities.lib.depth_first_octree.position.__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_2yt_9utilities_3lib_18depth_first_octree_8position_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_5__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_2yt_9utilities_3lib_18depth_first_octree_8position_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__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__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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("yt.utilities.lib.depth_first_octree.position.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/utilities/lib/depth_first_octree.pyx":29 * cdef public object child_indices, fields, left_edges, dimensions, dx * cdef public int level, offset @@ -1909,12 +2095,19 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -1923,39 +2116,45 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_child_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 1); __PYX_ERR(0, 29, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 1); __PYX_ERR(1, 29, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 2); __PYX_ERR(0, 29, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 2); __PYX_ERR(1, 29, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dimensions)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 3); __PYX_ERR(0, 29, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 3); __PYX_ERR(1, 29, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 4); __PYX_ERR(0, 29, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 4); __PYX_ERR(1, 29, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 5); __PYX_ERR(0, 29, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 5); __PYX_ERR(1, 29, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 6); __PYX_ERR(0, 29, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 6); __PYX_ERR(1, 29, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 29, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 29, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; @@ -1973,22 +2172,22 @@ __pyx_v_left_edges = ((PyArrayObject *)values[2]); __pyx_v_dimensions = ((PyArrayObject *)values[3]); __pyx_v_dx = ((PyArrayObject *)values[4]); - __pyx_v_level = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error) - __pyx_v_offset = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error) + __pyx_v_level = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 35, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 35, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 29, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 29, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGrid.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_child_indices), __pyx_ptype_5numpy_ndarray, 1, "child_indices", 0))) __PYX_ERR(0, 30, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fields), __pyx_ptype_5numpy_ndarray, 1, "fields", 0))) __PYX_ERR(0, 31, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 32, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dimensions), __pyx_ptype_5numpy_ndarray, 1, "dimensions", 0))) __PYX_ERR(0, 33, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dx), __pyx_ptype_5numpy_ndarray, 1, "dx", 0))) __PYX_ERR(0, 34, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_child_indices), __pyx_ptype_5numpy_ndarray, 1, "child_indices", 0))) __PYX_ERR(1, 30, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fields), __pyx_ptype_5numpy_ndarray, 1, "fields", 0))) __PYX_ERR(1, 31, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(1, 32, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dimensions), __pyx_ptype_5numpy_ndarray, 1, "dimensions", 0))) __PYX_ERR(1, 33, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dx), __pyx_ptype_5numpy_ndarray, 1, "dx", 0))) __PYX_ERR(1, 34, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self), __pyx_v_child_indices, __pyx_v_fields, __pyx_v_left_edges, __pyx_v_dimensions, __pyx_v_dx, __pyx_v_level, __pyx_v_offset); /* function exit code */ @@ -2036,27 +2235,27 @@ __pyx_pybuffernd_dx.rcbuffer = &__pyx_pybuffer_dx; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_child_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_child_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(1, 29, __pyx_L1_error) } __pyx_pybuffernd_child_indices.diminfo[0].strides = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_indices.diminfo[0].shape = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_child_indices.diminfo[1].strides = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_child_indices.diminfo[1].shape = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_child_indices.diminfo[2].strides = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_child_indices.diminfo[2].shape = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fields.rcbuffer->pybuffer, (PyObject*)__pyx_v_fields, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fields.rcbuffer->pybuffer, (PyObject*)__pyx_v_fields, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(1, 29, __pyx_L1_error) } __pyx_pybuffernd_fields.diminfo[0].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fields.diminfo[0].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fields.diminfo[1].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fields.diminfo[1].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_fields.diminfo[2].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_fields.diminfo[2].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_fields.diminfo[3].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_fields.diminfo[3].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[3]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 29, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer, (PyObject*)__pyx_v_dimensions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer, (PyObject*)__pyx_v_dimensions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 29, __pyx_L1_error) } __pyx_pybuffernd_dimensions.diminfo[0].strides = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dimensions.diminfo[0].shape = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dx.rcbuffer->pybuffer, (PyObject*)__pyx_v_dx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dx.rcbuffer->pybuffer, (PyObject*)__pyx_v_dx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 29, __pyx_L1_error) } __pyx_pybuffernd_dx.diminfo[0].strides = __pyx_pybuffernd_dx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dx.diminfo[0].shape = __pyx_pybuffernd_dx.rcbuffer->pybuffer.shape[0]; @@ -2649,7 +2848,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->level); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2684,7 +2883,7 @@ __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 28, __pyx_L1_error) __pyx_v_self->level = __pyx_t_1; /* function exit code */ @@ -2717,7 +2916,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2752,7 +2951,7 @@ __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 28, __pyx_L1_error) __pyx_v_self->offset = __pyx_t_1; /* function exit code */ @@ -2766,6 +2965,113 @@ 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_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_3__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_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__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__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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("yt.utilities.lib.depth_first_octree.OctreeGrid.__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_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5__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_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__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__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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("yt.utilities.lib.depth_first_octree.OctreeGrid.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/utilities/lib/depth_first_octree.pyx":46 * cdef class OctreeGridList: * cdef public object grids @@ -2789,6 +3095,7 @@ 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; } @@ -2799,7 +3106,7 @@ else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 46, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 46, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -2810,7 +3117,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 46, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 46, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGridList.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2871,7 +3178,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); assert(__pyx_arg_item); { - __pyx_v_item = __Pyx_PyInt_As_int(__pyx_arg_item); if (unlikely((__pyx_v_item == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L3_error) + __pyx_v_item = __Pyx_PyInt_As_int(__pyx_arg_item); if (unlikely((__pyx_v_item == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 49, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -2900,7 +3207,7 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->grids, __pyx_v_item, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->grids, __pyx_v_item, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3020,6 +3327,113 @@ 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_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_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_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_4__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__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__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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("yt.utilities.lib.depth_first_octree.OctreeGridList.__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_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_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_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_6__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__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__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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("yt.utilities.lib.depth_first_octree.OctreeGridList.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/utilities/lib/depth_first_octree.pyx":53 * * @cython.boundscheck(False) @@ -3054,16 +3468,27 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -3072,59 +3497,69 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_i)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_j_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 1); __PYX_ERR(0, 53, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 1); __PYX_ERR(1, 53, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 2); __PYX_ERR(0, 53, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 2); __PYX_ERR(1, 53, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_f)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 3); __PYX_ERR(0, 53, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 3); __PYX_ERR(1, 53, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_j_f)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 4); __PYX_ERR(0, 53, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 4); __PYX_ERR(1, 53, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k_f)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 5); __PYX_ERR(0, 53, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 5); __PYX_ERR(1, 53, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_curpos)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 6); __PYX_ERR(0, 53, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 6); __PYX_ERR(1, 53, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gi)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 7); __PYX_ERR(0, 53, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 7); __PYX_ERR(1, 53, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 8); __PYX_ERR(0, 53, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 8); __PYX_ERR(1, 53, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_refined)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 9); __PYX_ERR(0, 53, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 9); __PYX_ERR(1, 53, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 10); __PYX_ERR(0, 53, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 10); __PYX_ERR(1, 53, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "RecurseOctreeDepthFirst") < 0)) __PYX_ERR(0, 53, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "RecurseOctreeDepthFirst") < 0)) __PYX_ERR(1, 53, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 11) { goto __pyx_L5_argtuple_error; @@ -3141,30 +3576,30 @@ values[9] = PyTuple_GET_ITEM(__pyx_args, 9); values[10] = PyTuple_GET_ITEM(__pyx_args, 10); } - __pyx_v_i_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L3_error) - __pyx_v_j_i = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_j_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L3_error) - __pyx_v_k_i = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L3_error) - __pyx_v_i_f = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_i_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - __pyx_v_j_f = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_j_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - __pyx_v_k_f = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + __pyx_v_i_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L3_error) + __pyx_v_j_i = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_j_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L3_error) + __pyx_v_k_i = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L3_error) + __pyx_v_i_f = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_i_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 54, __pyx_L3_error) + __pyx_v_j_f = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_j_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 54, __pyx_L3_error) + __pyx_v_k_f = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 54, __pyx_L3_error) __pyx_v_curpos = ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *)values[6]); - __pyx_v_gi = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_gi == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) + __pyx_v_gi = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_gi == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L3_error) __pyx_v_output = ((PyArrayObject *)values[8]); __pyx_v_refined = ((PyArrayObject *)values[9]); __pyx_v_grids = ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)values[10]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 53, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 53, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.RecurseOctreeDepthFirst", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curpos), __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_position, 1, "curpos", 0))) __PYX_ERR(0, 55, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output), __pyx_ptype_5numpy_ndarray, 1, "output", 0))) __PYX_ERR(0, 56, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_refined), __pyx_ptype_5numpy_ndarray, 1, "refined", 0))) __PYX_ERR(0, 57, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grids), __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, 1, "grids", 0))) __PYX_ERR(0, 58, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curpos), __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_position, 1, "curpos", 0))) __PYX_ERR(1, 55, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output), __pyx_ptype_5numpy_ndarray, 1, "output", 0))) __PYX_ERR(1, 56, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_refined), __pyx_ptype_5numpy_ndarray, 1, "refined", 0))) __PYX_ERR(1, 57, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grids), __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, 1, "grids", 0))) __PYX_ERR(1, 58, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_RecurseOctreeDepthFirst(__pyx_self, __pyx_v_i_i, __pyx_v_j_i, __pyx_v_k_i, __pyx_v_i_f, __pyx_v_j_f, __pyx_v_k_f, __pyx_v_curpos, __pyx_v_gi, __pyx_v_output, __pyx_v_refined, __pyx_v_grids); /* function exit code */ @@ -3268,12 +3703,12 @@ __pyx_pybuffernd_refined.rcbuffer = &__pyx_pybuffer_refined; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 53, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 53, __pyx_L1_error) } __pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_output.diminfo[1].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_output.diminfo[1].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_refined.rcbuffer->pybuffer, (PyObject*)__pyx_v_refined, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 53, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_refined.rcbuffer->pybuffer, (PyObject*)__pyx_v_refined, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 53, __pyx_L1_error) } __pyx_pybuffernd_refined.diminfo[0].strides = __pyx_pybuffernd_refined.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_refined.diminfo[0].shape = __pyx_pybuffernd_refined.rcbuffer->pybuffer.shape[0]; @@ -3284,9 +3719,9 @@ * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges */ - __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_v_gi, int, 1, __Pyx_PyInt_From_int, 0, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_v_gi, int, 1, __Pyx_PyInt_From_int, 0, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid))))) __PYX_ERR(0, 63, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid))))) __PYX_ERR(1, 63, __pyx_L1_error) __pyx_v_grid = ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_t_1); __pyx_t_1 = 0; @@ -3297,14 +3732,14 @@ * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges * cdef np.float64_t dx = grid.dx[0] */ - if (!(likely(((__pyx_v_grid->fields) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->fields, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 64, __pyx_L1_error) + if (!(likely(((__pyx_v_grid->fields) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->fields, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 64, __pyx_L1_error) __pyx_t_1 = __pyx_v_grid->fields; __Pyx_INCREF(__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fields.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) { __pyx_v_fields = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fields.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 64, __pyx_L1_error) + __PYX_ERR(1, 64, __pyx_L1_error) } else {__pyx_pybuffernd_fields.diminfo[0].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fields.diminfo[0].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fields.diminfo[1].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fields.diminfo[1].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_fields.diminfo[2].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_fields.diminfo[2].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_fields.diminfo[3].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_fields.diminfo[3].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[3]; } } @@ -3318,14 +3753,14 @@ * cdef np.float64_t dx = grid.dx[0] * cdef np.float64_t child_dx */ - if (!(likely(((__pyx_v_grid->left_edges) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->left_edges, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 65, __pyx_L1_error) + if (!(likely(((__pyx_v_grid->left_edges) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->left_edges, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 65, __pyx_L1_error) __pyx_t_1 = __pyx_v_grid->left_edges; __Pyx_INCREF(__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_leftedges.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_leftedges = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 65, __pyx_L1_error) + __PYX_ERR(1, 65, __pyx_L1_error) } else {__pyx_pybuffernd_leftedges.diminfo[0].strides = __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_leftedges.diminfo[0].shape = __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.shape[0]; } } @@ -3339,9 +3774,9 @@ * cdef np.float64_t child_dx * cdef np.ndarray[np.float64_t, ndim=1] child_leftedges */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_grid->dx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_grid->dx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dx = __pyx_t_2; @@ -3445,13 +3880,13 @@ * if ci == -1: * for fi in range(fields.shape[0]): */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1); @@ -3462,10 +3897,10 @@ __pyx_t_1 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; - __pyx_t_13 = PyObject_GetItem(__pyx_v_grid->child_indices, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_13 = PyObject_GetItem(__pyx_v_grid->child_indices, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_13); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_13); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_v_ci = __pyx_t_15; @@ -3580,9 +4015,9 @@ * child_leftedges = child_grid.left_edges */ __pyx_t_15 = (__pyx_v_ci - __pyx_v_grid->offset); - __pyx_t_13 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_t_15, int, 1, __Pyx_PyInt_From_int, 0, 1, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_t_15, int, 1, __Pyx_PyInt_From_int, 0, 1, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid))))) __PYX_ERR(0, 94, __pyx_L1_error) + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid))))) __PYX_ERR(1, 94, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child_grid, ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_t_13)); __pyx_t_13 = 0; @@ -3593,9 +4028,9 @@ * child_leftedges = child_grid.left_edges * child_i = int((cx - child_leftedges[0])/child_dx) */ - __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_child_grid->dx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_child_grid->dx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_v_child_dx = __pyx_t_2; @@ -3606,7 +4041,7 @@ * child_i = int((cx - child_leftedges[0])/child_dx) * child_j = int((cy - child_leftedges[1])/child_dx) */ - if (!(likely(((__pyx_v_child_grid->left_edges) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_child_grid->left_edges, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 96, __pyx_L1_error) + if (!(likely(((__pyx_v_child_grid->left_edges) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_child_grid->left_edges, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 96, __pyx_L1_error) __pyx_t_13 = __pyx_v_child_grid->left_edges; __Pyx_INCREF(__pyx_t_13); { @@ -3623,7 +4058,7 @@ } } __pyx_pybuffernd_child_leftedges.diminfo[0].strides = __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_leftedges.diminfo[0].shape = __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(1, 96, __pyx_L1_error) } __Pyx_XDECREF_SET(__pyx_v_child_leftedges, ((PyArrayObject *)__pyx_t_13)); __pyx_t_13 = 0; @@ -3640,7 +4075,7 @@ __pyx_t_2 = (__pyx_v_cx - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_child_leftedges.diminfo[0].strides))); if (unlikely(__pyx_v_child_dx == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 97, __pyx_L1_error) + __PYX_ERR(1, 97, __pyx_L1_error) } __pyx_v_child_i = ((int)(__pyx_t_2 / __pyx_v_child_dx)); @@ -3656,7 +4091,7 @@ __pyx_t_2 = (__pyx_v_cy - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_child_leftedges.diminfo[0].strides))); if (unlikely(__pyx_v_child_dx == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 98, __pyx_L1_error) + __PYX_ERR(1, 98, __pyx_L1_error) } __pyx_v_child_j = ((int)(__pyx_t_2 / __pyx_v_child_dx)); @@ -3672,7 +4107,7 @@ __pyx_t_2 = (__pyx_v_cz - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_child_leftedges.diminfo[0].strides))); if (unlikely(__pyx_v_child_dx == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 99, __pyx_L1_error) + __PYX_ERR(1, 99, __pyx_L1_error) } __pyx_v_child_k = ((int)(__pyx_t_2 / __pyx_v_child_dx)); @@ -3683,13 +4118,13 @@ * curpos, ci - grid.offset, output, refined, grids) * */ - __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_RecurseOctreeDepthFirst); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_RecurseOctreeDepthFirst); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_child_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_child_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_child_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_child_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_child_k); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_child_k); if (unlikely(!__pyx_t_32)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_32); /* "yt/utilities/lib/depth_first_octree.pyx":102 @@ -3699,7 +4134,7 @@ * * @cython.boundscheck(False) */ - __pyx_t_33 = __Pyx_PyInt_From_int((__pyx_v_ci - __pyx_v_grid->offset)); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_33 = __Pyx_PyInt_From_int((__pyx_v_ci - __pyx_v_grid->offset)); if (unlikely(!__pyx_t_33)) __PYX_ERR(1, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __pyx_t_34 = NULL; __pyx_t_15 = 0; @@ -3716,7 +4151,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_14)) { PyObject *__pyx_temp[12] = {__pyx_t_34, __pyx_t_12, __pyx_t_1, __pyx_t_32, __pyx_int_2, __pyx_int_2, __pyx_int_2, ((PyObject *)__pyx_v_curpos), __pyx_t_33, ((PyObject *)__pyx_v_output), ((PyObject *)__pyx_v_refined), ((PyObject *)__pyx_v_grids)}; - __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_15, 11+__pyx_t_15); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_15, 11+__pyx_t_15); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -3728,7 +4163,7 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) { PyObject *__pyx_temp[12] = {__pyx_t_34, __pyx_t_12, __pyx_t_1, __pyx_t_32, __pyx_int_2, __pyx_int_2, __pyx_int_2, ((PyObject *)__pyx_v_curpos), __pyx_t_33, ((PyObject *)__pyx_v_output), ((PyObject *)__pyx_v_refined), ((PyObject *)__pyx_v_grids)}; - __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_15, 11+__pyx_t_15); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_15, 11+__pyx_t_15); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -3738,7 +4173,7 @@ } else #endif { - __pyx_t_35 = PyTuple_New(11+__pyx_t_15); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_35 = PyTuple_New(11+__pyx_t_15); if (unlikely(!__pyx_t_35)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_35); if (__pyx_t_34) { __Pyx_GIVEREF(__pyx_t_34); PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_34); __pyx_t_34 = NULL; @@ -3776,7 +4211,7 @@ __pyx_t_1 = 0; __pyx_t_32 = 0; __pyx_t_33 = 0; - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_35, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_35, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0; } @@ -3873,17 +4308,29 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -3892,64 +4339,75 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_i)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_j_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 1); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 1); __PYX_ERR(1, 105, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 2); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 2); __PYX_ERR(1, 105, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_f)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 3); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 3); __PYX_ERR(1, 105, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_j_f)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 4); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 4); __PYX_ERR(1, 105, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k_f)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 5); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 5); __PYX_ERR(1, 105, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_curpos)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 6); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 6); __PYX_ERR(1, 105, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gi)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 7); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 7); __PYX_ERR(1, 105, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 8); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 8); __PYX_ERR(1, 105, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_genealogy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 9); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 9); __PYX_ERR(1, 105, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_corners)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 10); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 10); __PYX_ERR(1, 105, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 11: if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 11); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 11); __PYX_ERR(1, 105, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "RecurseOctreeByLevels") < 0)) __PYX_ERR(0, 105, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "RecurseOctreeByLevels") < 0)) __PYX_ERR(1, 105, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 12) { goto __pyx_L5_argtuple_error; @@ -3967,14 +4425,14 @@ values[10] = PyTuple_GET_ITEM(__pyx_args, 10); values[11] = PyTuple_GET_ITEM(__pyx_args, 11); } - __pyx_v_i_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) - __pyx_v_j_i = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_j_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) - __pyx_v_k_i = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) - __pyx_v_i_f = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_i_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) - __pyx_v_j_f = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_j_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) - __pyx_v_k_f = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) + __pyx_v_i_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 105, __pyx_L3_error) + __pyx_v_j_i = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_j_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 105, __pyx_L3_error) + __pyx_v_k_i = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 105, __pyx_L3_error) + __pyx_v_i_f = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_i_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L3_error) + __pyx_v_j_f = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_j_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L3_error) + __pyx_v_k_f = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L3_error) __pyx_v_curpos = ((PyArrayObject *)values[6]); - __pyx_v_gi = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_gi == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) + __pyx_v_gi = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_gi == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 108, __pyx_L3_error) __pyx_v_output = ((PyArrayObject *)values[8]); __pyx_v_genealogy = ((PyArrayObject *)values[9]); __pyx_v_corners = ((PyArrayObject *)values[10]); @@ -3982,17 +4440,17 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 105, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.RecurseOctreeByLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curpos), __pyx_ptype_5numpy_ndarray, 1, "curpos", 0))) __PYX_ERR(0, 107, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output), __pyx_ptype_5numpy_ndarray, 1, "output", 0))) __PYX_ERR(0, 109, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_genealogy), __pyx_ptype_5numpy_ndarray, 1, "genealogy", 0))) __PYX_ERR(0, 110, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_corners), __pyx_ptype_5numpy_ndarray, 1, "corners", 0))) __PYX_ERR(0, 111, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grids), __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, 1, "grids", 0))) __PYX_ERR(0, 112, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curpos), __pyx_ptype_5numpy_ndarray, 1, "curpos", 0))) __PYX_ERR(1, 107, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output), __pyx_ptype_5numpy_ndarray, 1, "output", 0))) __PYX_ERR(1, 109, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_genealogy), __pyx_ptype_5numpy_ndarray, 1, "genealogy", 0))) __PYX_ERR(1, 110, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_corners), __pyx_ptype_5numpy_ndarray, 1, "corners", 0))) __PYX_ERR(1, 111, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grids), __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, 1, "grids", 0))) __PYX_ERR(1, 112, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_2RecurseOctreeByLevels(__pyx_self, __pyx_v_i_i, __pyx_v_j_i, __pyx_v_k_i, __pyx_v_i_f, __pyx_v_j_f, __pyx_v_k_f, __pyx_v_curpos, __pyx_v_gi, __pyx_v_output, __pyx_v_genealogy, __pyx_v_corners, __pyx_v_grids); /* function exit code */ @@ -4137,22 +4595,22 @@ __pyx_pybuffernd_corners.rcbuffer = &__pyx_pybuffer_corners; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_curpos.rcbuffer->pybuffer, (PyObject*)__pyx_v_curpos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_curpos.rcbuffer->pybuffer, (PyObject*)__pyx_v_curpos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 105, __pyx_L1_error) } __pyx_pybuffernd_curpos.diminfo[0].strides = __pyx_pybuffernd_curpos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_curpos.diminfo[0].shape = __pyx_pybuffernd_curpos.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 105, __pyx_L1_error) } __pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_output.diminfo[1].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_output.diminfo[1].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_genealogy.rcbuffer->pybuffer, (PyObject*)__pyx_v_genealogy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_genealogy.rcbuffer->pybuffer, (PyObject*)__pyx_v_genealogy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 105, __pyx_L1_error) } __pyx_pybuffernd_genealogy.diminfo[0].strides = __pyx_pybuffernd_genealogy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_genealogy.diminfo[0].shape = __pyx_pybuffernd_genealogy.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_genealogy.diminfo[1].strides = __pyx_pybuffernd_genealogy.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_genealogy.diminfo[1].shape = __pyx_pybuffernd_genealogy.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_corners.rcbuffer->pybuffer, (PyObject*)__pyx_v_corners, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_corners.rcbuffer->pybuffer, (PyObject*)__pyx_v_corners, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 105, __pyx_L1_error) } __pyx_pybuffernd_corners.diminfo[0].strides = __pyx_pybuffernd_corners.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_corners.diminfo[0].shape = __pyx_pybuffernd_corners.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_corners.diminfo[1].strides = __pyx_pybuffernd_corners.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_corners.diminfo[1].shape = __pyx_pybuffernd_corners.rcbuffer->pybuffer.shape[1]; @@ -4164,9 +4622,9 @@ * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices */ __pyx_t_1 = (__pyx_v_gi - 1); - __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid))))) __PYX_ERR(0, 116, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid))))) __PYX_ERR(1, 116, __pyx_L1_error) __pyx_v_grid = ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_t_2); __pyx_t_2 = 0; @@ -4187,14 +4645,14 @@ * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges */ - if (!(likely(((__pyx_v_grid->child_indices) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->child_indices, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 118, __pyx_L1_error) + if (!(likely(((__pyx_v_grid->child_indices) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->child_indices, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 118, __pyx_L1_error) __pyx_t_2 = __pyx_v_grid->child_indices; __Pyx_INCREF(__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_indices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) { __pyx_v_child_indices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 118, __pyx_L1_error) + __PYX_ERR(1, 118, __pyx_L1_error) } else {__pyx_pybuffernd_child_indices.diminfo[0].strides = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_indices.diminfo[0].shape = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_child_indices.diminfo[1].strides = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_child_indices.diminfo[1].shape = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_child_indices.diminfo[2].strides = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_child_indices.diminfo[2].shape = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.shape[2]; } } @@ -4208,14 +4666,14 @@ * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges * cdef np.float64_t dx = grid.dx[0] */ - if (!(likely(((__pyx_v_grid->fields) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->fields, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 119, __pyx_L1_error) + if (!(likely(((__pyx_v_grid->fields) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->fields, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 119, __pyx_L1_error) __pyx_t_2 = __pyx_v_grid->fields; __Pyx_INCREF(__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fields.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) { __pyx_v_fields = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fields.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 119, __pyx_L1_error) + __PYX_ERR(1, 119, __pyx_L1_error) } else {__pyx_pybuffernd_fields.diminfo[0].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fields.diminfo[0].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fields.diminfo[1].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fields.diminfo[1].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_fields.diminfo[2].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_fields.diminfo[2].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_fields.diminfo[3].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_fields.diminfo[3].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[3]; } } @@ -4229,14 +4687,14 @@ * cdef np.float64_t dx = grid.dx[0] * cdef np.float64_t child_dx */ - if (!(likely(((__pyx_v_grid->left_edges) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->left_edges, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 120, __pyx_L1_error) + if (!(likely(((__pyx_v_grid->left_edges) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->left_edges, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 120, __pyx_L1_error) __pyx_t_2 = __pyx_v_grid->left_edges; __Pyx_INCREF(__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_leftedges.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_leftedges = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 120, __pyx_L1_error) + __PYX_ERR(1, 120, __pyx_L1_error) } else {__pyx_pybuffernd_leftedges.diminfo[0].strides = __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_leftedges.diminfo[0].shape = __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.shape[0]; } } @@ -4250,9 +4708,9 @@ * cdef np.float64_t child_dx * cdef np.ndarray[np.float64_t, ndim=1] child_leftedges */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_grid->dx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_grid->dx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dx = __pyx_t_4; @@ -4490,9 +4948,9 @@ * child_leftedges = child_grid.left_edges */ __pyx_t_1 = (__pyx_v_ci - 1); - __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid))))) __PYX_ERR(0, 146, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid))))) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child_grid, ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_t_2)); __pyx_t_2 = 0; @@ -4503,9 +4961,9 @@ * child_leftedges = child_grid.left_edges * child_i = int((cx-child_leftedges[0])/child_dx) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_child_grid->dx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_child_grid->dx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_child_dx = __pyx_t_4; @@ -4516,7 +4974,7 @@ * child_i = int((cx-child_leftedges[0])/child_dx) * child_j = int((cy-child_leftedges[1])/child_dx) */ - if (!(likely(((__pyx_v_child_grid->left_edges) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_child_grid->left_edges, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 148, __pyx_L1_error) + if (!(likely(((__pyx_v_child_grid->left_edges) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_child_grid->left_edges, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 148, __pyx_L1_error) __pyx_t_2 = __pyx_v_child_grid->left_edges; __Pyx_INCREF(__pyx_t_2); { @@ -4533,7 +4991,7 @@ } } __pyx_pybuffernd_child_leftedges.diminfo[0].strides = __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_leftedges.diminfo[0].shape = __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_35 < 0)) __PYX_ERR(0, 148, __pyx_L1_error) + if (unlikely(__pyx_t_35 < 0)) __PYX_ERR(1, 148, __pyx_L1_error) } __Pyx_XDECREF_SET(__pyx_v_child_leftedges, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; @@ -4550,7 +5008,7 @@ __pyx_t_4 = (__pyx_v_cx - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_child_leftedges.diminfo[0].strides))); if (unlikely(__pyx_v_child_dx == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 149, __pyx_L1_error) + __PYX_ERR(1, 149, __pyx_L1_error) } __pyx_v_child_i = ((int)(__pyx_t_4 / __pyx_v_child_dx)); @@ -4566,7 +5024,7 @@ __pyx_t_4 = (__pyx_v_cy - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_child_leftedges.diminfo[0].strides))); if (unlikely(__pyx_v_child_dx == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 150, __pyx_L1_error) + __PYX_ERR(1, 150, __pyx_L1_error) } __pyx_v_child_j = ((int)(__pyx_t_4 / __pyx_v_child_dx)); @@ -4582,7 +5040,7 @@ __pyx_t_4 = (__pyx_v_cz - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_child_leftedges.diminfo[0].strides))); if (unlikely(__pyx_v_child_dx == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 151, __pyx_L1_error) + __PYX_ERR(1, 151, __pyx_L1_error) } __pyx_v_child_k = ((int)(__pyx_t_4 / __pyx_v_child_dx)); @@ -4608,21 +5066,21 @@ * s = RecurseOctreeByLevels(child_i, child_j, child_k, 2, 2, 2, * curpos, ci, output, genealogy, */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_cp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_cp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_45 = (__pyx_v_level + 1); if (__pyx_t_45 < 0) __pyx_t_45 += __pyx_pybuffernd_curpos.diminfo[0].shape; - __pyx_t_46 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_curpos.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_curpos.diminfo[0].strides))); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_46 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_curpos.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_curpos.diminfo[0].strides))); if (unlikely(!__pyx_t_46)) __PYX_ERR(1, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_46); __pyx_t_47 = (__pyx_v_level + 1); if (__pyx_t_47 < 0) __pyx_t_47 += __pyx_pybuffernd_curpos.diminfo[0].shape; - __pyx_t_48 = __Pyx_PyInt_From_long(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_curpos.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_curpos.diminfo[0].strides)) + 8)); if (unlikely(!__pyx_t_48)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_48 = __Pyx_PyInt_From_long(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_curpos.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_curpos.diminfo[0].strides)) + 8)); if (unlikely(!__pyx_t_48)) __PYX_ERR(1, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_48); - __pyx_t_49 = PySlice_New(__pyx_t_46, __pyx_t_48, Py_None); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_49 = PySlice_New(__pyx_t_46, __pyx_t_48, Py_None); if (unlikely(!__pyx_t_49)) __PYX_ERR(1, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_49); __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0; __Pyx_DECREF(__pyx_t_48); __pyx_t_48 = 0; - __pyx_t_48 = PyTuple_New(2); if (unlikely(!__pyx_t_48)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_48 = PyTuple_New(2); if (unlikely(!__pyx_t_48)) __PYX_ERR(1, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_48); __Pyx_GIVEREF(__pyx_t_49); PyTuple_SET_ITEM(__pyx_t_48, 0, __pyx_t_49); @@ -4630,7 +5088,7 @@ __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_48, 1, __pyx_int_1); __pyx_t_49 = 0; - if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_genealogy), __pyx_t_48, __pyx_t_2) < 0)) __PYX_ERR(0, 155, __pyx_L1_error) + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_genealogy), __pyx_t_48, __pyx_t_2) < 0)) __PYX_ERR(1, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_48); __pyx_t_48 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4641,13 +5099,13 @@ * curpos, ci, output, genealogy, * corners, grids) */ - __pyx_t_48 = __Pyx_GetModuleGlobalName(__pyx_n_s_RecurseOctreeByLevels); if (unlikely(!__pyx_t_48)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_48 = __Pyx_GetModuleGlobalName(__pyx_n_s_RecurseOctreeByLevels); if (unlikely(!__pyx_t_48)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_48); - __pyx_t_49 = __Pyx_PyInt_From_int(__pyx_v_child_i); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_49 = __Pyx_PyInt_From_int(__pyx_v_child_i); if (unlikely(!__pyx_t_49)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_49); - __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_child_j); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_child_j); if (unlikely(!__pyx_t_46)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_46); - __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_v_child_k); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_v_child_k); if (unlikely(!__pyx_t_50)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_50); /* "yt/utilities/lib/depth_first_octree.pyx":157 @@ -4657,7 +5115,7 @@ * corners, grids) * curpos[level] += 1 */ - __pyx_t_51 = __Pyx_PyInt_From_npy_int32(__pyx_v_ci); if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_51 = __Pyx_PyInt_From_npy_int32(__pyx_v_ci); if (unlikely(!__pyx_t_51)) __PYX_ERR(1, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_51); /* "yt/utilities/lib/depth_first_octree.pyx":158 @@ -4682,7 +5140,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_48)) { PyObject *__pyx_temp[13] = {__pyx_t_52, __pyx_t_49, __pyx_t_46, __pyx_t_50, __pyx_int_2, __pyx_int_2, __pyx_int_2, ((PyObject *)__pyx_v_curpos), __pyx_t_51, ((PyObject *)__pyx_v_output), ((PyObject *)__pyx_v_genealogy), ((PyObject *)__pyx_v_corners), ((PyObject *)__pyx_v_grids)}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_48, __pyx_temp+1-__pyx_t_35, 12+__pyx_t_35); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_48, __pyx_temp+1-__pyx_t_35, 12+__pyx_t_35); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_52); __pyx_t_52 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0; @@ -4694,7 +5152,7 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_48)) { PyObject *__pyx_temp[13] = {__pyx_t_52, __pyx_t_49, __pyx_t_46, __pyx_t_50, __pyx_int_2, __pyx_int_2, __pyx_int_2, ((PyObject *)__pyx_v_curpos), __pyx_t_51, ((PyObject *)__pyx_v_output), ((PyObject *)__pyx_v_genealogy), ((PyObject *)__pyx_v_corners), ((PyObject *)__pyx_v_grids)}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_48, __pyx_temp+1-__pyx_t_35, 12+__pyx_t_35); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_48, __pyx_temp+1-__pyx_t_35, 12+__pyx_t_35); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_52); __pyx_t_52 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0; @@ -4704,7 +5162,7 @@ } else #endif { - __pyx_t_53 = PyTuple_New(12+__pyx_t_35); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_53 = PyTuple_New(12+__pyx_t_35); if (unlikely(!__pyx_t_53)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_53); if (__pyx_t_52) { __Pyx_GIVEREF(__pyx_t_52); PyTuple_SET_ITEM(__pyx_t_53, 0, __pyx_t_52); __pyx_t_52 = NULL; @@ -4745,7 +5203,7 @@ __pyx_t_46 = 0; __pyx_t_50 = 0; __pyx_t_51 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_48, __pyx_t_53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_48, __pyx_t_53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0; } @@ -5012,11 +5470,11 @@ * * 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, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + __PYX_ERR(2, 218, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 @@ -5068,11 +5526,11 @@ * * 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, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + __PYX_ERR(2, 222, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") @@ -5377,11 +5835,11 @@ * 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, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + __PYX_ERR(2, 259, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: @@ -5588,22 +6046,22 @@ * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) + __PYX_ERR(2, 278, __pyx_L1_error) break; } @@ -5670,7 +6128,7 @@ * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 @@ -5829,7 +6287,7 @@ * 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, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5876,7 +6334,7 @@ * 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, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5923,7 +6381,7 @@ * 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, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5970,7 +6428,7 @@ * 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, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6017,7 +6475,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6098,15 +6556,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) + __PYX_ERR(2, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + __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, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -6121,11 +6579,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) + __PYX_ERR(2, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -6146,7 +6604,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __pyx_L1_error) + __PYX_ERR(2, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -6154,15 +6612,15 @@ __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, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -6175,12 +6633,12 @@ * 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, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -6192,11 +6650,11 @@ * * 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, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) + __PYX_ERR(2, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -6260,11 +6718,11 @@ * # 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, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __PYX_ERR(2, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -6283,11 +6741,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -6347,7 +6805,7 @@ * 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, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -6369,11 +6827,11 @@ * * # 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, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __PYX_ERR(2, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -6391,11 +6849,11 @@ * 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, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -6409,11 +6867,11 @@ * 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, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -6427,11 +6885,11 @@ * 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, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -6445,11 +6903,11 @@ * 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, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -6463,11 +6921,11 @@ * 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, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -6481,11 +6939,11 @@ * 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, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -6499,11 +6957,11 @@ * 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, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -6517,11 +6975,11 @@ * 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, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -6535,11 +6993,11 @@ * 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, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -6553,11 +7011,11 @@ * 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, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -6571,11 +7029,11 @@ * 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, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -6589,11 +7047,11 @@ * 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, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -6607,11 +7065,11 @@ * 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, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -6625,11 +7083,11 @@ * 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, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -6645,11 +7103,11 @@ * 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, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -6665,11 +7123,11 @@ * 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, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -6685,11 +7143,11 @@ * 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, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -6704,19 +7162,19 @@ * 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, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) + __PYX_ERR(2, 844, __pyx_L1_error) } __pyx_L15:; @@ -6747,7 +7205,7 @@ * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; @@ -7011,7 +7469,7 @@ * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 * # Cython code. @@ -7024,7 +7482,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7038,7 +7496,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -7050,11 +7508,11 @@ * * 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, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) + __PYX_ERR(2, 989, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -7072,7 +7530,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -7142,7 +7600,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * @@ -7155,7 +7613,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7169,7 +7627,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -7181,11 +7639,11 @@ * * 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, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) + __PYX_ERR(2, 995, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -7203,7 +7661,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -7273,7 +7731,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * @@ -7286,7 +7744,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7299,7 +7757,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -7309,11 +7767,11 @@ * 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, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) + __PYX_ERR(2, 1001, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -7331,7 +7789,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -7374,7 +7832,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_18depth_first_octree_position(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + 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 @@ -7410,6 +7868,8 @@ } static PyMethodDef __pyx_methods_2yt_9utilities_3lib_18depth_first_octree_position[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -7502,7 +7962,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid(PyObject *o) { struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *p = (struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -7651,6 +8111,8 @@ } static PyMethodDef __pyx_methods_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -7744,7 +8206,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList(PyObject *o) { struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *p = (struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -7792,6 +8254,8 @@ } static PyMethodDef __pyx_methods_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -7907,7 +8371,7 @@ {&__pyx_n_s_RecurseOctreeByLevels, __pyx_k_RecurseOctreeByLevels, sizeof(__pyx_k_RecurseOctreeByLevels), 0, 0, 1, 1}, {&__pyx_n_s_RecurseOctreeDepthFirst, __pyx_k_RecurseOctreeDepthFirst, sizeof(__pyx_k_RecurseOctreeDepthFirst), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_child_dx, __pyx_k_child_dx, sizeof(__pyx_k_child_dx), 0, 0, 1, 1}, {&__pyx_n_s_child_grid, __pyx_k_child_grid, sizeof(__pyx_k_child_grid), 0, 0, 1, 1}, @@ -7917,6 +8381,7 @@ {&__pyx_n_s_child_k, __pyx_k_child_k, sizeof(__pyx_k_child_k), 0, 0, 1, 1}, {&__pyx_n_s_child_leftedges, __pyx_k_child_leftedges, sizeof(__pyx_k_child_leftedges), 0, 0, 1, 1}, {&__pyx_n_s_ci, __pyx_k_ci, sizeof(__pyx_k_ci), 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_corners, __pyx_k_corners, sizeof(__pyx_k_corners), 0, 0, 1, 1}, {&__pyx_n_s_cp, __pyx_k_cp, sizeof(__pyx_k_cp), 0, 0, 1, 1}, {&__pyx_n_s_curpos, __pyx_k_curpos, sizeof(__pyx_k_curpos), 0, 0, 1, 1}, @@ -7950,6 +8415,7 @@ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_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}, @@ -7957,18 +8423,22 @@ {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 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_refined, __pyx_k_refined, sizeof(__pyx_k_refined), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 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_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, - {&__pyx_n_s_yt_utilities_lib_depth_first_oct, __pyx_k_yt_utilities_lib_depth_first_oct, sizeof(__pyx_k_yt_utilities_lib_depth_first_oct), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_depth_first_oct, __pyx_k_yt_utilities_lib_depth_first_oct, sizeof(__pyx_k_yt_utilities_lib_depth_first_oct), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_depth_first_oct_2, __pyx_k_yt_utilities_lib_depth_first_oct_2, sizeof(__pyx_k_yt_utilities_lib_depth_first_oct_2), 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, 75, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 75, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -7978,16 +8448,73 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + /* "(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_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(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__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "(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__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "(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__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "(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__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "(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__6 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -7996,9 +8523,9 @@ * * 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, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -8007,9 +8534,9 @@ * 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, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -8018,9 +8545,9 @@ * * 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, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -8029,9 +8556,9 @@ * # 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, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -8040,9 +8567,9 @@ * * # 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, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -8051,9 +8578,9 @@ * * 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, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -8062,18 +8589,18 @@ * * 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, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _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, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); /* "yt/utilities/lib/depth_first_octree.pyx":53 * @@ -8082,10 +8609,10 @@ * int i_f, int j_f, int k_f, * position curpos, int gi, */ - __pyx_tuple__10 = PyTuple_Pack(32, __pyx_n_s_i_i, __pyx_n_s_j_i, __pyx_n_s_k_i, __pyx_n_s_i_f, __pyx_n_s_j_f, __pyx_n_s_k_f, __pyx_n_s_curpos, __pyx_n_s_gi, __pyx_n_s_output, __pyx_n_s_refined, __pyx_n_s_grids, __pyx_n_s_i, __pyx_n_s_i_off, __pyx_n_s_j, __pyx_n_s_j_off, __pyx_n_s_k, __pyx_n_s_k_off, __pyx_n_s_ci, __pyx_n_s_fi, __pyx_n_s_child_i, __pyx_n_s_child_j, __pyx_n_s_child_k, __pyx_n_s_child_grid, __pyx_n_s_grid, __pyx_n_s_fields, __pyx_n_s_leftedges, __pyx_n_s_dx, __pyx_n_s_child_dx, __pyx_n_s_child_leftedges, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_cz); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(11, 0, 32, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_RecurseOctreeDepthFirst, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(32, __pyx_n_s_i_i, __pyx_n_s_j_i, __pyx_n_s_k_i, __pyx_n_s_i_f, __pyx_n_s_j_f, __pyx_n_s_k_f, __pyx_n_s_curpos, __pyx_n_s_gi, __pyx_n_s_output, __pyx_n_s_refined, __pyx_n_s_grids, __pyx_n_s_i, __pyx_n_s_i_off, __pyx_n_s_j, __pyx_n_s_j_off, __pyx_n_s_k, __pyx_n_s_k_off, __pyx_n_s_ci, __pyx_n_s_fi, __pyx_n_s_child_i, __pyx_n_s_child_j, __pyx_n_s_child_k, __pyx_n_s_child_grid, __pyx_n_s_grid, __pyx_n_s_fields, __pyx_n_s_leftedges, __pyx_n_s_dx, __pyx_n_s_child_dx, __pyx_n_s_child_leftedges, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_cz); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(11, 0, 32, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_depth_first_oct, __pyx_n_s_RecurseOctreeDepthFirst, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 53, __pyx_L1_error) /* "yt/utilities/lib/depth_first_octree.pyx":105 * @@ -8094,10 +8621,10 @@ * int i_f, int j_f, int k_f, * np.ndarray[np.int32_t, ndim=1] curpos, */ - __pyx_tuple__12 = PyTuple_Pack(37, __pyx_n_s_i_i, __pyx_n_s_j_i, __pyx_n_s_k_i, __pyx_n_s_i_f, __pyx_n_s_j_f, __pyx_n_s_k_f, __pyx_n_s_curpos, __pyx_n_s_gi, __pyx_n_s_output, __pyx_n_s_genealogy, __pyx_n_s_corners, __pyx_n_s_grids, __pyx_n_s_i, __pyx_n_s_i_off, __pyx_n_s_j, __pyx_n_s_j_off, __pyx_n_s_k, __pyx_n_s_k_off, __pyx_n_s_ci, __pyx_n_s_fi, __pyx_n_s_child_i, __pyx_n_s_child_j, __pyx_n_s_child_k, __pyx_n_s_child_grid, __pyx_n_s_grid, __pyx_n_s_level, __pyx_n_s_child_indices, __pyx_n_s_fields, __pyx_n_s_leftedges, __pyx_n_s_dx, __pyx_n_s_child_dx, __pyx_n_s_child_leftedges, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_cz, __pyx_n_s_cp, __pyx_n_s_s); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(12, 0, 37, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_RecurseOctreeByLevels, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_tuple__18 = PyTuple_Pack(37, __pyx_n_s_i_i, __pyx_n_s_j_i, __pyx_n_s_k_i, __pyx_n_s_i_f, __pyx_n_s_j_f, __pyx_n_s_k_f, __pyx_n_s_curpos, __pyx_n_s_gi, __pyx_n_s_output, __pyx_n_s_genealogy, __pyx_n_s_corners, __pyx_n_s_grids, __pyx_n_s_i, __pyx_n_s_i_off, __pyx_n_s_j, __pyx_n_s_j_off, __pyx_n_s_k, __pyx_n_s_k_off, __pyx_n_s_ci, __pyx_n_s_fi, __pyx_n_s_child_i, __pyx_n_s_child_j, __pyx_n_s_child_k, __pyx_n_s_child_grid, __pyx_n_s_grid, __pyx_n_s_level, __pyx_n_s_child_indices, __pyx_n_s_fields, __pyx_n_s_leftedges, __pyx_n_s_dx, __pyx_n_s_child_dx, __pyx_n_s_child_leftedges, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_cz, __pyx_n_s_cp, __pyx_n_s_s); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(12, 0, 37, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_depth_first_oct, __pyx_n_s_RecurseOctreeByLevels, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 105, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -8106,9 +8633,9 @@ } static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 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) + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -8134,24 +8661,24 @@ } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_depth_first_octree(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) + if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -8166,49 +8693,53 @@ #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 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_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 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); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 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) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_yt__utilities__lib__depth_first_octree) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "yt.utilities.lib.depth_first_octree")) { - if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.depth_first_octree", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.depth_first_octree", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_position) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_position) < 0) __PYX_ERR(1, 20, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_18depth_first_octree_position.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "position", (PyObject *)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_position) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "position", (PyObject *)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_position) < 0) __PYX_ERR(1, 20, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_position) < 0) __PYX_ERR(1, 20, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_position = &__pyx_type_2yt_9utilities_3lib_18depth_first_octree_position; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid) < 0) __PYX_ERR(1, 26, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "OctreeGrid", (PyObject *)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "OctreeGrid", (PyObject *)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid) < 0) __PYX_ERR(1, 26, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid) < 0) __PYX_ERR(1, 26, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid = &__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList) < 0) __PYX_ERR(1, 44, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "OctreeGridList", (PyObject *)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "OctreeGridList", (PyObject *)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList) < 0) __PYX_ERR(1, 44, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList) < 0) __PYX_ERR(1, 44, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList = &__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -8217,17 +8748,17 @@ #else sizeof(PyHeapTypeObject), #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + 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, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "yt/utilities/lib/depth_first_octree.pyx":16 @@ -8237,9 +8768,9 @@ * cimport numpy as np * cimport cython */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "yt/utilities/lib/depth_first_octree.pyx":53 @@ -8249,9 +8780,9 @@ * int i_f, int j_f, int k_f, * position curpos, int gi, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18depth_first_octree_1RecurseOctreeDepthFirst, NULL, __pyx_n_s_yt_utilities_lib_depth_first_oct); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18depth_first_octree_1RecurseOctreeDepthFirst, NULL, __pyx_n_s_yt_utilities_lib_depth_first_oct_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RecurseOctreeDepthFirst, __pyx_t_1) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RecurseOctreeDepthFirst, __pyx_t_1) < 0) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "yt/utilities/lib/depth_first_octree.pyx":105 @@ -8261,9 +8792,9 @@ * int i_f, int j_f, int k_f, * np.ndarray[np.int32_t, ndim=1] curpos, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18depth_first_octree_3RecurseOctreeByLevels, NULL, __pyx_n_s_yt_utilities_lib_depth_first_oct); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18depth_first_octree_3RecurseOctreeByLevels, NULL, __pyx_n_s_yt_utilities_lib_depth_first_oct_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RecurseOctreeByLevels, __pyx_t_1) < 0) __PYX_ERR(0, 105, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RecurseOctreeByLevels, __pyx_t_1) < 0) __PYX_ERR(1, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "yt/utilities/lib/depth_first_octree.pyx":1 @@ -8271,9 +8802,9 @@ * This is a recursive function to return a depth-first octree * */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); 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_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -8291,7 +8822,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.depth_first_octree", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.depth_first_octree", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -8404,8 +8935,215 @@ return 0; } +/* 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 + +/* 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 PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + /* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( + static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { @@ -8419,7 +9157,7 @@ } /* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( + static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, @@ -8521,7 +9259,7 @@ } /* ArgTypeTest */ -static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); @@ -8548,7 +9286,7 @@ } /* BufferFormatCheck */ -static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; } @@ -9097,32 +9835,8 @@ __Pyx_ReleaseBuffer(info); } -/* 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 - /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -9133,9 +9847,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -9148,9 +9865,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -9203,7 +9923,7 @@ } /* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -9216,13 +9936,13 @@ } /* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { + static void __Pyx_RaiseBufferFallbackError(void) { PyErr_SetString(PyExc_ValueError, "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); } /* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); @@ -9240,7 +9960,7 @@ } /* PyFunctionFastCall */ - #if CYTHON_FAST_PYCALL + #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { @@ -9356,207 +10076,29 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyCFunctionFastCall */ - #if CYTHON_FAST_PYCCALL + #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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); -} -#endif // CYTHON_FAST_PYCCALL - -/* PyObjectCall */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - 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 - -/* 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; - } - } + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL); } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); + return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; } #endif @@ -9673,6 +10215,71 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; @@ -9747,6 +10354,40 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; @@ -9887,12 +10528,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -11108,6 +11752,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -11116,11 +11762,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/distance_queue.c yt-3.4.0/yt/utilities/lib/distance_queue.c --- yt-3.3.3/yt/utilities/lib/distance_queue.c 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/distance_queue.c 2017-08-10 18:20:34.000000000 +0000 @@ -0,0 +1,25388 @@ +/* Generated by Cython 0.26rc2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [], + "libraries": [ + "m" + ], + "name": "yt.utilities.lib.distance_queue", + "sources": [ + "yt/utilities/lib/distance_queue.pyx" + ] + }, + "module_name": "yt.utilities.lib.distance_queue" +} +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 < 0x03020000) + #error Cython requires Python 2.6+ or Python 3.2+. +#else +#define CYTHON_ABI "0_26rc2" +#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 >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#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_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !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 < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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 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 +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#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 +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#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 + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#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; \ +} + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__yt__utilities__lib__distance_queue +#define __PYX_HAVE_API__yt__utilities__lib__distance_queue +#include +#include +#include +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "pythread.h" +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_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) && defined (_M_X64) + #define __Pyx_sst_abs(value) _abs64(value) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE 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_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) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_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; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; +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[] = { + "yt/utilities/lib/distance_queue.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; + +/* 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; + +/* 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 + + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":726 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":727 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":728 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":732 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":733 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":734 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":735 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":739 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":740 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":749 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":750 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":751 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":753 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":754 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":755 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":757 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":758 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":760 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":761 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":762 + * 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_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue; +struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue; +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":765 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":766 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":768 + * 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_2yt_9utilities_3lib_14distance_queue_ItemList; +struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList; + +/* "yt/utilities/lib/distance_queue.pxd":25 + * # THESE TWO STRUCTS MUST BE EQUIVALENT + * + * cdef struct ItemList: # <<<<<<<<<<<<<< + * np.int64_t ind + * np.float64_t value + */ +struct __pyx_t_2yt_9utilities_3lib_14distance_queue_ItemList { + __pyx_t_5numpy_int64_t ind; + __pyx_t_5numpy_float64_t value; +}; + +/* "yt/utilities/lib/distance_queue.pxd":29 + * np.float64_t value + * + * cdef struct NeighborList: # <<<<<<<<<<<<<< + * np.int64_t pn # Particle number + * np.float64_t r2 # radius**2 + */ +struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList { + __pyx_t_5numpy_int64_t pn; + __pyx_t_5numpy_float64_t r2; +}; + +/* "yt/utilities/lib/distance_queue.pxd":40 + * np.float64_t max_dist2) + * + * cdef class PriorityQueue: # <<<<<<<<<<<<<< + * cdef int maxn + * cdef int curn + */ +struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue { + PyObject_HEAD + struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_vtab; + int maxn; + int curn; + struct __pyx_t_2yt_9utilities_3lib_14distance_queue_ItemList *items; +}; + + +/* "yt/utilities/lib/distance_queue.pxd":47 + * cdef int item_insert(self, np.int64_t i, np.float64_t value) + * + * cdef class DistanceQueue(PriorityQueue): # <<<<<<<<<<<<<< + * cdef np.float64_t DW[3] + * cdef bint periodicity[3] + */ +struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue { + struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue __pyx_base; + __pyx_t_5numpy_float64_t DW[3]; + int periodicity[3]; + struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList *neighbors; +}; + + +/* "View.MemoryView":103 + * + * @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":275 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":326 + * + * @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":951 + * + * @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 *); +}; + + + +/* "yt/utilities/lib/distance_queue.pyx":59 + * return r2 + * + * cdef class PriorityQueue: # <<<<<<<<<<<<<< + * """This class acts as a "priority-queue." It was extracted from the + * DistanceQueue object so that it could serve as a general-purpose method for + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue { + void (*item_reset)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *); + int (*item_insert)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_PriorityQueue; + + +/* "yt/utilities/lib/distance_queue.pyx":111 + * return di + 1 + * + * cdef class DistanceQueue: # <<<<<<<<<<<<<< + * """This is a distance queue object, designed to incrementally evaluate N + * positions against a reference point. It is initialized with the maximum + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue { + struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue __pyx_base; + void (*_setup)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *, __pyx_t_5numpy_float64_t *, int *); + void (*neighbor_eval)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); + void (*neighbor_reset)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *); +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_DistanceQueue; + + +/* "View.MemoryView":103 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_array { + PyObject *(*get_memview)(struct __pyx_array_obj *); +}; +static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; + + +/* "View.MemoryView":326 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * 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":951 + * + * @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) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* 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); + +/* 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 + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* BufferIndexError.proto */ +static void __Pyx_RaiseBufferIndexError(int axis); + +/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* BufferFormatCheck.proto */ +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* 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); + +/* GetModuleGlobalName.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + +/* SetItemInt.proto */ +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ + __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck); + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* ArgTypeTest.proto */ +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); + +/* IncludeStringH.proto */ +#include + +/* 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 *); + +/* 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); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +/* 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 + +/* 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); + +/* 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() + +/* 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); + +/* 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); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + +/* 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; + +/* None.proto */ +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, + char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* TypeInfoCompare.proto */ +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +/* MemviewSliceValidateAndInit.proto */ +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + 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_float64_t(PyObject *); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 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_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 long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +/* 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 void __pyx_f_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_item_reset(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_v_self); /* proto*/ +static int __pyx_f_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_item_insert(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_ind, __pyx_t_5numpy_float64_t __pyx_v_value); /* proto*/ +static void __pyx_f_2yt_9utilities_3lib_14distance_queue_13DistanceQueue__setup(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_DW, int *__pyx_v_periodicity); /* proto*/ +static void __pyx_f_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_neighbor_eval(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_pn, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __pyx_t_5numpy_float64_t *__pyx_v_cpos); /* proto*/ +static void __pyx_f_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_neighbor_reset(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self); /* 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 '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 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'yt.utilities.lib.distance_queue' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14distance_queue_PriorityQueue = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue = 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_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_14distance_queue_r2dist(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, __pyx_t_5numpy_float64_t); /*proto*/ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ +static void *__pyx_align_pointer(void *, size_t); /*proto*/ +static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ +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_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +#define __Pyx_MODULE_NAME "yt.utilities.lib.distance_queue" +int __pyx_module_is_main_yt__utilities__lib__distance_queue = 0; + +/* Implementation of 'yt.utilities.lib.distance_queue' */ +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_MemoryError; +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_O[] = "O"; +static const char __pyx_k_c[] = "c"; +static const char __pyx_k_DW[] = "DW"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_np[] = "np"; +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_main[] = "__main__"; +static const char __pyx_k_maxn[] = "maxn"; +static const char __pyx_k_mode[] = "mode"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_ndim[] = "ndim"; +static const char __pyx_k_pack[] = "pack"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_step[] = "step"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_ASCII[] = "ASCII"; +static const char __pyx_k_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_int64[] = "int64"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_shape[] = "shape"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_center[] = "center"; +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_points[] = "points"; +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_fortran[] = "fortran"; +static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_Ellipsis[] = "Ellipsis"; +static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +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_IndexError[] = "IndexError"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_periodicity[] = "periodicity"; +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_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_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +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_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_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_Distance_queue_implementation[] = "\nDistance queue implementation\n\n\n\n\n"; +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_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_index_with_type_s; +static PyObject *__pyx_n_s_DW; +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_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_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_allocate_buffer; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_center; +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_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_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +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_maxn; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_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_pack; +static PyObject *__pyx_n_s_periodicity; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_points; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_getbuffer; +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_cython; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_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_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_2yt_9utilities_3lib_14distance_queue_13PriorityQueue___cinit__(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_v_self, int __pyx_v_maxn); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue___cinit__(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self, CYTHON_UNUSED int __pyx_v_maxn); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_2setup(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self, __Pyx_memviewslice __pyx_v_DW, PyObject *__pyx_v_periodicity); /* proto */ +static void __pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_4__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_6find_nearest(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self, __Pyx_memviewslice __pyx_v_center, __Pyx_memviewslice __pyx_v_points); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self, CYTHON_UNUSED 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 PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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_2yt_9utilities_3lib_14distance_queue_PriorityQueue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_14distance_queue_DistanceQueue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_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__27; +static PyObject *__pyx_slice__28; +static PyObject *__pyx_slice__29; +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__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_codeobj__39; + +/* "yt/utilities/lib/distance_queue.pyx":20 + * cimport cython + * + * cdef int Neighbor_compare(void *on1, void *on2) nogil: # <<<<<<<<<<<<<< + * cdef NeighborList *n1 + * cdef NeighborList *n2 + */ + +static int __pyx_f_2yt_9utilities_3lib_14distance_queue_Neighbor_compare(void *__pyx_v_on1, void *__pyx_v_on2) { + struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList *__pyx_v_n1; + struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList *__pyx_v_n2; + int __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/distance_queue.pyx":23 + * cdef NeighborList *n1 + * cdef NeighborList *n2 + * n1 = on1 # <<<<<<<<<<<<<< + * n2 = on2 + * # Note that we set this up so that "greatest" evaluates to the *end* of the + */ + __pyx_v_n1 = ((struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList *)__pyx_v_on1); + + /* "yt/utilities/lib/distance_queue.pyx":24 + * cdef NeighborList *n2 + * n1 = on1 + * n2 = on2 # <<<<<<<<<<<<<< + * # Note that we set this up so that "greatest" evaluates to the *end* of the + * # list, so we can do standard radius comparisons. + */ + __pyx_v_n2 = ((struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList *)__pyx_v_on2); + + /* "yt/utilities/lib/distance_queue.pyx":27 + * # Note that we set this up so that "greatest" evaluates to the *end* of the + * # list, so we can do standard radius comparisons. + * if n1.r2 < n2.r2: # <<<<<<<<<<<<<< + * return -1 + * elif n1.r2 == n2.r2: + */ + __pyx_t_1 = ((__pyx_v_n1->r2 < __pyx_v_n2->r2) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/distance_queue.pyx":28 + * # list, so we can do standard radius comparisons. + * if n1.r2 < n2.r2: + * return -1 # <<<<<<<<<<<<<< + * elif n1.r2 == n2.r2: + * return 0 + */ + __pyx_r = -1; + goto __pyx_L0; + + /* "yt/utilities/lib/distance_queue.pyx":27 + * # Note that we set this up so that "greatest" evaluates to the *end* of the + * # list, so we can do standard radius comparisons. + * if n1.r2 < n2.r2: # <<<<<<<<<<<<<< + * return -1 + * elif n1.r2 == n2.r2: + */ + } + + /* "yt/utilities/lib/distance_queue.pyx":29 + * if n1.r2 < n2.r2: + * return -1 + * elif n1.r2 == n2.r2: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + __pyx_t_1 = ((__pyx_v_n1->r2 == __pyx_v_n2->r2) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/distance_queue.pyx":30 + * return -1 + * elif n1.r2 == n2.r2: + * return 0 # <<<<<<<<<<<<<< + * else: + * return 1 + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/distance_queue.pyx":29 + * if n1.r2 < n2.r2: + * return -1 + * elif n1.r2 == n2.r2: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + } + + /* "yt/utilities/lib/distance_queue.pyx":32 + * return 0 + * else: + * return 1 # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 1; + goto __pyx_L0; + } + + /* "yt/utilities/lib/distance_queue.pyx":20 + * cimport cython + * + * cdef int Neighbor_compare(void *on1, void *on2) nogil: # <<<<<<<<<<<<<< + * cdef NeighborList *n1 + * cdef NeighborList *n2 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/distance_queue.pyx":38 + * @cython.wraparound(False) + * @cython.initializedcheck(False) + * cdef np.float64_t r2dist(np.float64_t ppos[3], # <<<<<<<<<<<<<< + * np.float64_t cpos[3], + * np.float64_t DW[3], + */ + +static __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_14distance_queue_r2dist(__pyx_t_5numpy_float64_t *__pyx_v_ppos, __pyx_t_5numpy_float64_t *__pyx_v_cpos, __pyx_t_5numpy_float64_t *__pyx_v_DW, int *__pyx_v_periodicity, __pyx_t_5numpy_float64_t __pyx_v_max_dist2) { + int __pyx_v_i; + __pyx_t_5numpy_float64_t __pyx_v_r2; + __pyx_t_5numpy_float64_t __pyx_v_DR; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("r2dist", 0); + + /* "yt/utilities/lib/distance_queue.pyx":45 + * cdef int i + * cdef np.float64_t r2, DR + * r2 = 0.0 # <<<<<<<<<<<<<< + * for i in range(3): + * DR = (ppos[i] - cpos[i]) + */ + __pyx_v_r2 = 0.0; + + /* "yt/utilities/lib/distance_queue.pyx":46 + * cdef np.float64_t r2, DR + * r2 = 0.0 + * for i in range(3): # <<<<<<<<<<<<<< + * DR = (ppos[i] - cpos[i]) + * if not periodicity[i]: + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/distance_queue.pyx":47 + * r2 = 0.0 + * for i in range(3): + * DR = (ppos[i] - cpos[i]) # <<<<<<<<<<<<<< + * if not periodicity[i]: + * pass + */ + __pyx_v_DR = ((__pyx_v_ppos[__pyx_v_i]) - (__pyx_v_cpos[__pyx_v_i])); + + /* "yt/utilities/lib/distance_queue.pyx":48 + * for i in range(3): + * DR = (ppos[i] - cpos[i]) + * if not periodicity[i]: # <<<<<<<<<<<<<< + * pass + * elif (DR > DW[i]/2.0): + */ + __pyx_t_2 = ((!((__pyx_v_periodicity[__pyx_v_i]) != 0)) != 0); + if (__pyx_t_2) { + goto __pyx_L5; + } + + /* "yt/utilities/lib/distance_queue.pyx":50 + * if not periodicity[i]: + * pass + * elif (DR > DW[i]/2.0): # <<<<<<<<<<<<<< + * DR -= DW[i] + * elif (DR < -DW[i]/2.0): + */ + __pyx_t_2 = ((__pyx_v_DR > ((__pyx_v_DW[__pyx_v_i]) / 2.0)) != 0); + if (__pyx_t_2) { + + /* "yt/utilities/lib/distance_queue.pyx":51 + * pass + * elif (DR > DW[i]/2.0): + * DR -= DW[i] # <<<<<<<<<<<<<< + * elif (DR < -DW[i]/2.0): + * DR += DW[i] + */ + __pyx_v_DR = (__pyx_v_DR - (__pyx_v_DW[__pyx_v_i])); + + /* "yt/utilities/lib/distance_queue.pyx":50 + * if not periodicity[i]: + * pass + * elif (DR > DW[i]/2.0): # <<<<<<<<<<<<<< + * DR -= DW[i] + * elif (DR < -DW[i]/2.0): + */ + goto __pyx_L5; + } + + /* "yt/utilities/lib/distance_queue.pyx":52 + * elif (DR > DW[i]/2.0): + * DR -= DW[i] + * elif (DR < -DW[i]/2.0): # <<<<<<<<<<<<<< + * DR += DW[i] + * r2 += DR * DR + */ + __pyx_t_2 = ((__pyx_v_DR < ((-(__pyx_v_DW[__pyx_v_i])) / 2.0)) != 0); + if (__pyx_t_2) { + + /* "yt/utilities/lib/distance_queue.pyx":53 + * DR -= DW[i] + * elif (DR < -DW[i]/2.0): + * DR += DW[i] # <<<<<<<<<<<<<< + * r2 += DR * DR + * if max_dist2 >= 0.0 and r2 > max_dist2: + */ + __pyx_v_DR = (__pyx_v_DR + (__pyx_v_DW[__pyx_v_i])); + + /* "yt/utilities/lib/distance_queue.pyx":52 + * elif (DR > DW[i]/2.0): + * DR -= DW[i] + * elif (DR < -DW[i]/2.0): # <<<<<<<<<<<<<< + * DR += DW[i] + * r2 += DR * DR + */ + } + __pyx_L5:; + + /* "yt/utilities/lib/distance_queue.pyx":54 + * elif (DR < -DW[i]/2.0): + * DR += DW[i] + * r2 += DR * DR # <<<<<<<<<<<<<< + * if max_dist2 >= 0.0 and r2 > max_dist2: + * return -1.0 + */ + __pyx_v_r2 = (__pyx_v_r2 + (__pyx_v_DR * __pyx_v_DR)); + + /* "yt/utilities/lib/distance_queue.pyx":55 + * DR += DW[i] + * r2 += DR * DR + * if max_dist2 >= 0.0 and r2 > max_dist2: # <<<<<<<<<<<<<< + * return -1.0 + * return r2 + */ + __pyx_t_3 = ((__pyx_v_max_dist2 >= 0.0) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_r2 > __pyx_v_max_dist2) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L7_bool_binop_done:; + if (__pyx_t_2) { + + /* "yt/utilities/lib/distance_queue.pyx":56 + * r2 += DR * DR + * if max_dist2 >= 0.0 and r2 > max_dist2: + * return -1.0 # <<<<<<<<<<<<<< + * return r2 + * + */ + __pyx_r = -1.0; + goto __pyx_L0; + + /* "yt/utilities/lib/distance_queue.pyx":55 + * DR += DW[i] + * r2 += DR * DR + * if max_dist2 >= 0.0 and r2 > max_dist2: # <<<<<<<<<<<<<< + * return -1.0 + * return r2 + */ + } + } + + /* "yt/utilities/lib/distance_queue.pyx":57 + * if max_dist2 >= 0.0 and r2 > max_dist2: + * return -1.0 + * return r2 # <<<<<<<<<<<<<< + * + * cdef class PriorityQueue: + */ + __pyx_r = __pyx_v_r2; + goto __pyx_L0; + + /* "yt/utilities/lib/distance_queue.pyx":38 + * @cython.wraparound(False) + * @cython.initializedcheck(False) + * cdef np.float64_t r2dist(np.float64_t ppos[3], # <<<<<<<<<<<<<< + * np.float64_t cpos[3], + * np.float64_t DW[3], + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/distance_queue.pyx":70 + * is because our typical use case is to store radii. + * """ + * def __cinit__(self, int maxn): # <<<<<<<<<<<<<< + * cdef int i + * self.maxn = maxn + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_maxn; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxn,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxn)) != 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, "__cinit__") < 0)) __PYX_ERR(0, 70, __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_maxn = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_maxn == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 70, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.distance_queue.PriorityQueue.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_14distance_queue_13PriorityQueue___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *)__pyx_v_self), __pyx_v_maxn); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_14distance_queue_13PriorityQueue___cinit__(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_v_self, int __pyx_v_maxn) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "yt/utilities/lib/distance_queue.pyx":72 + * def __cinit__(self, int maxn): + * cdef int i + * self.maxn = maxn # <<<<<<<<<<<<<< + * self.curn = 0 + * self.items = malloc( + */ + __pyx_v_self->maxn = __pyx_v_maxn; + + /* "yt/utilities/lib/distance_queue.pyx":73 + * cdef int i + * self.maxn = maxn + * self.curn = 0 # <<<<<<<<<<<<<< + * self.items = malloc( + * sizeof(ItemList) * self.maxn) + */ + __pyx_v_self->curn = 0; + + /* "yt/utilities/lib/distance_queue.pyx":74 + * self.maxn = maxn + * self.curn = 0 + * self.items = malloc( # <<<<<<<<<<<<<< + * sizeof(ItemList) * self.maxn) + * + */ + __pyx_v_self->items = ((struct __pyx_t_2yt_9utilities_3lib_14distance_queue_ItemList *)malloc(((sizeof(struct __pyx_t_2yt_9utilities_3lib_14distance_queue_ItemList)) * __pyx_v_self->maxn))); + + /* "yt/utilities/lib/distance_queue.pyx":70 + * is because our typical use case is to store radii. + * """ + * def __cinit__(self, int maxn): # <<<<<<<<<<<<<< + * cdef int i + * self.maxn = maxn + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/distance_queue.pyx":77 + * sizeof(ItemList) * self.maxn) + * + * cdef void item_reset(self): # <<<<<<<<<<<<<< + * for i in range(self.maxn): + * self.items[i].value = 1e300 + */ + +static void __pyx_f_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_item_reset(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_v_self) { + int __pyx_v_i; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("item_reset", 0); + + /* "yt/utilities/lib/distance_queue.pyx":78 + * + * cdef void item_reset(self): + * for i in range(self.maxn): # <<<<<<<<<<<<<< + * self.items[i].value = 1e300 + * self.items[i].ind = -1 + */ + __pyx_t_1 = __pyx_v_self->maxn; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/utilities/lib/distance_queue.pyx":79 + * cdef void item_reset(self): + * for i in range(self.maxn): + * self.items[i].value = 1e300 # <<<<<<<<<<<<<< + * self.items[i].ind = -1 + * self.curn = 0 + */ + (__pyx_v_self->items[__pyx_v_i]).value = 1e300; + + /* "yt/utilities/lib/distance_queue.pyx":80 + * for i in range(self.maxn): + * self.items[i].value = 1e300 + * self.items[i].ind = -1 # <<<<<<<<<<<<<< + * self.curn = 0 + * + */ + (__pyx_v_self->items[__pyx_v_i]).ind = -1LL; + } + + /* "yt/utilities/lib/distance_queue.pyx":81 + * self.items[i].value = 1e300 + * self.items[i].ind = -1 + * self.curn = 0 # <<<<<<<<<<<<<< + * + * cdef int item_insert(self, np.int64_t ind, np.float64_t value): + */ + __pyx_v_self->curn = 0; + + /* "yt/utilities/lib/distance_queue.pyx":77 + * sizeof(ItemList) * self.maxn) + * + * cdef void item_reset(self): # <<<<<<<<<<<<<< + * for i in range(self.maxn): + * self.items[i].value = 1e300 + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "yt/utilities/lib/distance_queue.pyx":83 + * self.curn = 0 + * + * cdef int item_insert(self, np.int64_t ind, np.float64_t value): # <<<<<<<<<<<<<< + * cdef int i, di + * if self.curn == 0: + */ + +static int __pyx_f_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_item_insert(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_ind, __pyx_t_5numpy_float64_t __pyx_v_value) { + int __pyx_v_i; + int __pyx_v_di; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("item_insert", 0); + + /* "yt/utilities/lib/distance_queue.pyx":85 + * cdef int item_insert(self, np.int64_t ind, np.float64_t value): + * cdef int i, di + * if self.curn == 0: # <<<<<<<<<<<<<< + * self.items[0].value = value + * self.items[0].ind = ind + */ + __pyx_t_1 = ((__pyx_v_self->curn == 0) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/distance_queue.pyx":86 + * cdef int i, di + * if self.curn == 0: + * self.items[0].value = value # <<<<<<<<<<<<<< + * self.items[0].ind = ind + * self.curn += 1 + */ + (__pyx_v_self->items[0]).value = __pyx_v_value; + + /* "yt/utilities/lib/distance_queue.pyx":87 + * if self.curn == 0: + * self.items[0].value = value + * self.items[0].ind = ind # <<<<<<<<<<<<<< + * self.curn += 1 + * return 0 + */ + (__pyx_v_self->items[0]).ind = __pyx_v_ind; + + /* "yt/utilities/lib/distance_queue.pyx":88 + * self.items[0].value = value + * self.items[0].ind = ind + * self.curn += 1 # <<<<<<<<<<<<<< + * return 0 + * # Now insert in a sorted way + */ + __pyx_v_self->curn = (__pyx_v_self->curn + 1); + + /* "yt/utilities/lib/distance_queue.pyx":89 + * self.items[0].ind = ind + * self.curn += 1 + * return 0 # <<<<<<<<<<<<<< + * # Now insert in a sorted way + * di = -1 + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/distance_queue.pyx":85 + * cdef int item_insert(self, np.int64_t ind, np.float64_t value): + * cdef int i, di + * if self.curn == 0: # <<<<<<<<<<<<<< + * self.items[0].value = value + * self.items[0].ind = ind + */ + } + + /* "yt/utilities/lib/distance_queue.pyx":91 + * return 0 + * # Now insert in a sorted way + * di = -1 # <<<<<<<<<<<<<< + * for i in range(self.curn - 1, -1, -1): + * # We are checking if i is less than us, to see if we should insert + */ + __pyx_v_di = -1; + + /* "yt/utilities/lib/distance_queue.pyx":92 + * # Now insert in a sorted way + * di = -1 + * for i in range(self.curn - 1, -1, -1): # <<<<<<<<<<<<<< + * # We are checking if i is less than us, to see if we should insert + * # to the right (i.e., i+1). + */ + for (__pyx_t_2 = (__pyx_v_self->curn - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/utilities/lib/distance_queue.pyx":95 + * # We are checking if i is less than us, to see if we should insert + * # to the right (i.e., i+1). + * if self.items[i].value < value: # <<<<<<<<<<<<<< + * di = i + * break + */ + __pyx_t_1 = (((__pyx_v_self->items[__pyx_v_i]).value < __pyx_v_value) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/distance_queue.pyx":96 + * # to the right (i.e., i+1). + * if self.items[i].value < value: + * di = i # <<<<<<<<<<<<<< + * break + * # The outermost one is already too small. + */ + __pyx_v_di = __pyx_v_i; + + /* "yt/utilities/lib/distance_queue.pyx":97 + * if self.items[i].value < value: + * di = i + * break # <<<<<<<<<<<<<< + * # The outermost one is already too small. + * if di == self.maxn - 1: + */ + goto __pyx_L5_break; + + /* "yt/utilities/lib/distance_queue.pyx":95 + * # We are checking if i is less than us, to see if we should insert + * # to the right (i.e., i+1). + * if self.items[i].value < value: # <<<<<<<<<<<<<< + * di = i + * break + */ + } + } + __pyx_L5_break:; + + /* "yt/utilities/lib/distance_queue.pyx":99 + * break + * # The outermost one is already too small. + * if di == self.maxn - 1: # <<<<<<<<<<<<<< + * return -1 + * if (self.maxn - (di + 2)) > 0: + */ + __pyx_t_1 = ((__pyx_v_di == (__pyx_v_self->maxn - 1)) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/distance_queue.pyx":100 + * # The outermost one is already too small. + * if di == self.maxn - 1: + * return -1 # <<<<<<<<<<<<<< + * if (self.maxn - (di + 2)) > 0: + * memmove( (self.items + di + 2), + */ + __pyx_r = -1; + goto __pyx_L0; + + /* "yt/utilities/lib/distance_queue.pyx":99 + * break + * # The outermost one is already too small. + * if di == self.maxn - 1: # <<<<<<<<<<<<<< + * return -1 + * if (self.maxn - (di + 2)) > 0: + */ + } + + /* "yt/utilities/lib/distance_queue.pyx":101 + * if di == self.maxn - 1: + * return -1 + * if (self.maxn - (di + 2)) > 0: # <<<<<<<<<<<<<< + * memmove( (self.items + di + 2), + * (self.items + di + 1), + */ + __pyx_t_1 = (((__pyx_v_self->maxn - (__pyx_v_di + 2)) > 0) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/distance_queue.pyx":102 + * return -1 + * if (self.maxn - (di + 2)) > 0: + * memmove( (self.items + di + 2), # <<<<<<<<<<<<<< + * (self.items + di + 1), + * sizeof(ItemList) * (self.maxn - (di + 2))) + */ + memmove(((void *)((__pyx_v_self->items + __pyx_v_di) + 2)), ((void *)((__pyx_v_self->items + __pyx_v_di) + 1)), ((sizeof(struct __pyx_t_2yt_9utilities_3lib_14distance_queue_ItemList)) * (__pyx_v_self->maxn - (__pyx_v_di + 2)))); + + /* "yt/utilities/lib/distance_queue.pyx":101 + * if di == self.maxn - 1: + * return -1 + * if (self.maxn - (di + 2)) > 0: # <<<<<<<<<<<<<< + * memmove( (self.items + di + 2), + * (self.items + di + 1), + */ + } + + /* "yt/utilities/lib/distance_queue.pyx":105 + * (self.items + di + 1), + * sizeof(ItemList) * (self.maxn - (di + 2))) + * self.items[di + 1].value = value # <<<<<<<<<<<<<< + * self.items[di + 1].ind = ind + * if self.curn < self.maxn: + */ + (__pyx_v_self->items[(__pyx_v_di + 1)]).value = __pyx_v_value; + + /* "yt/utilities/lib/distance_queue.pyx":106 + * sizeof(ItemList) * (self.maxn - (di + 2))) + * self.items[di + 1].value = value + * self.items[di + 1].ind = ind # <<<<<<<<<<<<<< + * if self.curn < self.maxn: + * self.curn += 1 + */ + (__pyx_v_self->items[(__pyx_v_di + 1)]).ind = __pyx_v_ind; + + /* "yt/utilities/lib/distance_queue.pyx":107 + * self.items[di + 1].value = value + * self.items[di + 1].ind = ind + * if self.curn < self.maxn: # <<<<<<<<<<<<<< + * self.curn += 1 + * return di + 1 + */ + __pyx_t_1 = ((__pyx_v_self->curn < __pyx_v_self->maxn) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/distance_queue.pyx":108 + * self.items[di + 1].ind = ind + * if self.curn < self.maxn: + * self.curn += 1 # <<<<<<<<<<<<<< + * return di + 1 + * + */ + __pyx_v_self->curn = (__pyx_v_self->curn + 1); + + /* "yt/utilities/lib/distance_queue.pyx":107 + * self.items[di + 1].value = value + * self.items[di + 1].ind = ind + * if self.curn < self.maxn: # <<<<<<<<<<<<<< + * self.curn += 1 + * return di + 1 + */ + } + + /* "yt/utilities/lib/distance_queue.pyx":109 + * if self.curn < self.maxn: + * self.curn += 1 + * return di + 1 # <<<<<<<<<<<<<< + * + * cdef class DistanceQueue: + */ + __pyx_r = (__pyx_v_di + 1); + goto __pyx_L0; + + /* "yt/utilities/lib/distance_queue.pyx":83 + * self.curn = 0 + * + * cdef int item_insert(self, np.int64_t ind, np.float64_t value): # <<<<<<<<<<<<<< + * cdef int i, di + * if self.curn == 0: + */ + + /* function exit code */ + __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_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_3__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_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__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_, 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("yt.utilities.lib.distance_queue.PriorityQueue.__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_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_5__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_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *__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__2, 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("yt.utilities.lib.distance_queue.PriorityQueue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/distance_queue.pyx":115 + * positions against a reference point. It is initialized with the maximum + * number that are to be retained (i.e., maxn-nearest neighbors).""" + * def __cinit__(self, int maxn): # <<<<<<<<<<<<<< + * if sizeof(ItemList) != sizeof(NeighborList): + * # This should almost never, ever happen unless we do something very + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED int __pyx_v_maxn; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxn,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxn)) != 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, "__cinit__") < 0)) __PYX_ERR(0, 115, __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_maxn = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_maxn == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.distance_queue.DistanceQueue.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_self), __pyx_v_maxn); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue___cinit__(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self, CYTHON_UNUSED int __pyx_v_maxn) { + long __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + long __pyx_t_2; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "yt/utilities/lib/distance_queue.pyx":116 + * number that are to be retained (i.e., maxn-nearest neighbors).""" + * def __cinit__(self, int maxn): + * if sizeof(ItemList) != sizeof(NeighborList): # <<<<<<<<<<<<<< + * # This should almost never, ever happen unless we do something very + * # wrong, and must be broken at compile time. + */ + __pyx_t_1 = (((sizeof(struct __pyx_t_2yt_9utilities_3lib_14distance_queue_ItemList)) != (sizeof(struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList))) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/distance_queue.pyx":119 + * # This should almost never, ever happen unless we do something very + * # wrong, and must be broken at compile time. + * raise RuntimeError # <<<<<<<<<<<<<< + * self.neighbors = self.items + * self.neighbor_reset() + */ + __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); + __PYX_ERR(0, 119, __pyx_L1_error) + + /* "yt/utilities/lib/distance_queue.pyx":116 + * number that are to be retained (i.e., maxn-nearest neighbors).""" + * def __cinit__(self, int maxn): + * if sizeof(ItemList) != sizeof(NeighborList): # <<<<<<<<<<<<<< + * # This should almost never, ever happen unless we do something very + * # wrong, and must be broken at compile time. + */ + } + + /* "yt/utilities/lib/distance_queue.pyx":120 + * # wrong, and must be broken at compile time. + * raise RuntimeError + * self.neighbors = self.items # <<<<<<<<<<<<<< + * self.neighbor_reset() + * for i in range(3): + */ + __pyx_v_self->neighbors = ((struct __pyx_t_2yt_9utilities_3lib_14distance_queue_NeighborList *)__pyx_v_self->__pyx_base.items); + + /* "yt/utilities/lib/distance_queue.pyx":121 + * raise RuntimeError + * self.neighbors = self.items + * self.neighbor_reset() # <<<<<<<<<<<<<< + * for i in range(3): + * self.DW[i] = 0 + */ + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->neighbor_reset(__pyx_v_self); + + /* "yt/utilities/lib/distance_queue.pyx":122 + * self.neighbors = self.items + * self.neighbor_reset() + * for i in range(3): # <<<<<<<<<<<<<< + * self.DW[i] = 0 + * self.periodicity[i] = False + */ + for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/utilities/lib/distance_queue.pyx":123 + * self.neighbor_reset() + * for i in range(3): + * self.DW[i] = 0 # <<<<<<<<<<<<<< + * self.periodicity[i] = False + * + */ + (__pyx_v_self->DW[__pyx_v_i]) = 0.0; + + /* "yt/utilities/lib/distance_queue.pyx":124 + * for i in range(3): + * self.DW[i] = 0 + * self.periodicity[i] = False # <<<<<<<<<<<<<< + * + * cdef void _setup(self, np.float64_t DW[3], bint periodicity[3]): + */ + (__pyx_v_self->periodicity[__pyx_v_i]) = 0; + } + + /* "yt/utilities/lib/distance_queue.pyx":115 + * positions against a reference point. It is initialized with the maximum + * number that are to be retained (i.e., maxn-nearest neighbors).""" + * def __cinit__(self, int maxn): # <<<<<<<<<<<<<< + * if sizeof(ItemList) != sizeof(NeighborList): + * # This should almost never, ever happen unless we do something very + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("yt.utilities.lib.distance_queue.DistanceQueue.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/distance_queue.pyx":126 + * self.periodicity[i] = False + * + * cdef void _setup(self, np.float64_t DW[3], bint periodicity[3]): # <<<<<<<<<<<<<< + * for i in range(3): + * self.DW[i] = DW[i] + */ + +static void __pyx_f_2yt_9utilities_3lib_14distance_queue_13DistanceQueue__setup(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_DW, int *__pyx_v_periodicity) { + long __pyx_v_i; + __Pyx_RefNannyDeclarations + long __pyx_t_1; + __Pyx_RefNannySetupContext("_setup", 0); + + /* "yt/utilities/lib/distance_queue.pyx":127 + * + * cdef void _setup(self, np.float64_t DW[3], bint periodicity[3]): + * for i in range(3): # <<<<<<<<<<<<<< + * self.DW[i] = DW[i] + * self.periodicity[i] = periodicity[i] + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/distance_queue.pyx":128 + * cdef void _setup(self, np.float64_t DW[3], bint periodicity[3]): + * for i in range(3): + * self.DW[i] = DW[i] # <<<<<<<<<<<<<< + * self.periodicity[i] = periodicity[i] + * + */ + (__pyx_v_self->DW[__pyx_v_i]) = (__pyx_v_DW[__pyx_v_i]); + + /* "yt/utilities/lib/distance_queue.pyx":129 + * for i in range(3): + * self.DW[i] = DW[i] + * self.periodicity[i] = periodicity[i] # <<<<<<<<<<<<<< + * + * def setup(self, np.float64_t[:] DW, periodicity): + */ + (__pyx_v_self->periodicity[__pyx_v_i]) = (__pyx_v_periodicity[__pyx_v_i]); + } + + /* "yt/utilities/lib/distance_queue.pyx":126 + * self.periodicity[i] = False + * + * cdef void _setup(self, np.float64_t DW[3], bint periodicity[3]): # <<<<<<<<<<<<<< + * for i in range(3): + * self.DW[i] = DW[i] + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "yt/utilities/lib/distance_queue.pyx":131 + * self.periodicity[i] = periodicity[i] + * + * def setup(self, np.float64_t[:] DW, periodicity): # <<<<<<<<<<<<<< + * for i in range(3): + * self.DW[i] = DW[i] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_3setup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_3setup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_DW = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_periodicity = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("setup (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_DW,&__pyx_n_s_periodicity,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_DW)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periodicity)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("setup", 1, 2, 2, 1); __PYX_ERR(0, 131, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setup") < 0)) __PYX_ERR(0, 131, __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_DW = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_DW.memview)) __PYX_ERR(0, 131, __pyx_L3_error) + __pyx_v_periodicity = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("setup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 131, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.distance_queue.DistanceQueue.setup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_2setup(((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_self), __pyx_v_DW, __pyx_v_periodicity); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_2setup(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self, __Pyx_memviewslice __pyx_v_DW, PyObject *__pyx_v_periodicity) { + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + long __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("setup", 0); + + /* "yt/utilities/lib/distance_queue.pyx":132 + * + * def setup(self, np.float64_t[:] DW, periodicity): + * for i in range(3): # <<<<<<<<<<<<<< + * self.DW[i] = DW[i] + * self.periodicity[i] = periodicity[i] + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/distance_queue.pyx":133 + * def setup(self, np.float64_t[:] DW, periodicity): + * for i in range(3): + * self.DW[i] = DW[i] # <<<<<<<<<<<<<< + * self.periodicity[i] = periodicity[i] + * + */ + __pyx_t_2 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_2 < 0) { + __pyx_t_2 += __pyx_v_DW.shape[0]; + if (unlikely(__pyx_t_2 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_2 >= __pyx_v_DW.shape[0])) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + __PYX_ERR(0, 133, __pyx_L1_error) + } + (__pyx_v_self->DW[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_DW.data + __pyx_t_2 * __pyx_v_DW.strides[0]) ))); + + /* "yt/utilities/lib/distance_queue.pyx":134 + * for i in range(3): + * self.DW[i] = DW[i] + * self.periodicity[i] = periodicity[i] # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_periodicity, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + (__pyx_v_self->periodicity[__pyx_v_i]) = __pyx_t_5; + } + + /* "yt/utilities/lib/distance_queue.pyx":131 + * self.periodicity[i] = periodicity[i] + * + * def setup(self, np.float64_t[:] DW, periodicity): # <<<<<<<<<<<<<< + * for i in range(3): + * self.DW[i] = DW[i] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("yt.utilities.lib.distance_queue.DistanceQueue.setup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_DW, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/distance_queue.pyx":136 + * self.periodicity[i] = periodicity[i] + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.neighbors) + * + */ + +/* Python wrapper */ +static void __pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_5__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_4__dealloc__(((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_4__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "yt/utilities/lib/distance_queue.pyx":137 + * + * def __dealloc__(self): + * free(self.neighbors) # <<<<<<<<<<<<<< + * + * cdef void neighbor_eval(self, np.int64_t pn, np.float64_t ppos[3], + */ + free(__pyx_v_self->neighbors); + + /* "yt/utilities/lib/distance_queue.pyx":136 + * self.periodicity[i] = periodicity[i] + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.neighbors) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "yt/utilities/lib/distance_queue.pyx":139 + * free(self.neighbors) + * + * cdef void neighbor_eval(self, np.int64_t pn, np.float64_t ppos[3], # <<<<<<<<<<<<<< + * np.float64_t cpos[3]): + * # Here's a python+numpy simulator of this: + */ + +static void __pyx_f_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_neighbor_eval(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_pn, __pyx_t_5numpy_float64_t *__pyx_v_ppos, __pyx_t_5numpy_float64_t *__pyx_v_cpos) { + __pyx_t_5numpy_float64_t __pyx_v_r2; + __pyx_t_5numpy_float64_t __pyx_v_r2_trunc; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + __Pyx_RefNannySetupContext("neighbor_eval", 0); + + /* "yt/utilities/lib/distance_queue.pyx":144 + * # http://paste.yt-project.org/show/5445/ + * cdef np.float64_t r2, r2_trunc + * if self.curn == self.maxn: # <<<<<<<<<<<<<< + * # Truncate calculation if it's bigger than this in any dimension + * r2_trunc = self.neighbors[self.curn - 1].r2 + */ + __pyx_t_1 = ((__pyx_v_self->__pyx_base.curn == __pyx_v_self->__pyx_base.maxn) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/distance_queue.pyx":146 + * if self.curn == self.maxn: + * # Truncate calculation if it's bigger than this in any dimension + * r2_trunc = self.neighbors[self.curn - 1].r2 # <<<<<<<<<<<<<< + * else: + * # Don't truncate our calculation + */ + __pyx_t_2 = (__pyx_v_self->neighbors[(__pyx_v_self->__pyx_base.curn - 1)]).r2; + __pyx_v_r2_trunc = __pyx_t_2; + + /* "yt/utilities/lib/distance_queue.pyx":144 + * # http://paste.yt-project.org/show/5445/ + * cdef np.float64_t r2, r2_trunc + * if self.curn == self.maxn: # <<<<<<<<<<<<<< + * # Truncate calculation if it's bigger than this in any dimension + * r2_trunc = self.neighbors[self.curn - 1].r2 + */ + goto __pyx_L3; + } + + /* "yt/utilities/lib/distance_queue.pyx":149 + * else: + * # Don't truncate our calculation + * r2_trunc = -1 # <<<<<<<<<<<<<< + * r2 = r2dist(ppos, cpos, self.DW, self.periodicity, r2_trunc) + * if r2 == -1: + */ + /*else*/ { + __pyx_v_r2_trunc = -1.0; + } + __pyx_L3:; + + /* "yt/utilities/lib/distance_queue.pyx":150 + * # Don't truncate our calculation + * r2_trunc = -1 + * r2 = r2dist(ppos, cpos, self.DW, self.periodicity, r2_trunc) # <<<<<<<<<<<<<< + * if r2 == -1: + * return + */ + __pyx_v_r2 = __pyx_f_2yt_9utilities_3lib_14distance_queue_r2dist(__pyx_v_ppos, __pyx_v_cpos, __pyx_v_self->DW, __pyx_v_self->periodicity, __pyx_v_r2_trunc); + + /* "yt/utilities/lib/distance_queue.pyx":151 + * r2_trunc = -1 + * r2 = r2dist(ppos, cpos, self.DW, self.periodicity, r2_trunc) + * if r2 == -1: # <<<<<<<<<<<<<< + * return + * self.item_insert(pn, r2) + */ + __pyx_t_1 = ((__pyx_v_r2 == -1.0) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/distance_queue.pyx":152 + * r2 = r2dist(ppos, cpos, self.DW, self.periodicity, r2_trunc) + * if r2 == -1: + * return # <<<<<<<<<<<<<< + * self.item_insert(pn, r2) + * + */ + goto __pyx_L0; + + /* "yt/utilities/lib/distance_queue.pyx":151 + * r2_trunc = -1 + * r2 = r2dist(ppos, cpos, self.DW, self.periodicity, r2_trunc) + * if r2 == -1: # <<<<<<<<<<<<<< + * return + * self.item_insert(pn, r2) + */ + } + + /* "yt/utilities/lib/distance_queue.pyx":153 + * if r2 == -1: + * return + * self.item_insert(pn, r2) # <<<<<<<<<<<<<< + * + * cdef void neighbor_reset(self): + */ + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.item_insert(((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *)__pyx_v_self), __pyx_v_pn, __pyx_v_r2); + + /* "yt/utilities/lib/distance_queue.pyx":139 + * free(self.neighbors) + * + * cdef void neighbor_eval(self, np.int64_t pn, np.float64_t ppos[3], # <<<<<<<<<<<<<< + * np.float64_t cpos[3]): + * # Here's a python+numpy simulator of this: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + +/* "yt/utilities/lib/distance_queue.pyx":155 + * self.item_insert(pn, r2) + * + * cdef void neighbor_reset(self): # <<<<<<<<<<<<<< + * self.item_reset() + * + */ + +static void __pyx_f_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_neighbor_reset(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("neighbor_reset", 0); + + /* "yt/utilities/lib/distance_queue.pyx":156 + * + * cdef void neighbor_reset(self): + * self.item_reset() # <<<<<<<<<<<<<< + * + * def find_nearest(self, np.float64_t[:] center, np.float64_t[:,:] points): + */ + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.item_reset(((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *)__pyx_v_self)); + + /* "yt/utilities/lib/distance_queue.pyx":155 + * self.item_insert(pn, r2) + * + * cdef void neighbor_reset(self): # <<<<<<<<<<<<<< + * self.item_reset() + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "yt/utilities/lib/distance_queue.pyx":158 + * self.item_reset() + * + * def find_nearest(self, np.float64_t[:] center, np.float64_t[:,:] points): # <<<<<<<<<<<<<< + * """This function accepts a center and a set of [N,3] points, and it + * will return the indices into the points array of the maxn closest + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_7find_nearest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_6find_nearest[] = "This function accepts a center and a set of [N,3] points, and it\n will return the indices into the points array of the maxn closest\n neighbors."; +static PyObject *__pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_7find_nearest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_center = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_points = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("find_nearest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_center,&__pyx_n_s_points,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_center)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("find_nearest", 1, 2, 2, 1); __PYX_ERR(0, 158, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_nearest") < 0)) __PYX_ERR(0, 158, __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_center = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_center.memview)) __PYX_ERR(0, 158, __pyx_L3_error) + __pyx_v_points = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_points.memview)) __PYX_ERR(0, 158, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("find_nearest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 158, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.distance_queue.DistanceQueue.find_nearest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_6find_nearest(((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_self), __pyx_v_center, __pyx_v_points); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_6find_nearest(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__pyx_v_self, __Pyx_memviewslice __pyx_v_center, __Pyx_memviewslice __pyx_v_points) { + int __pyx_v_i; + int __pyx_v_j; + __pyx_t_5numpy_float64_t __pyx_v_ppos[3]; + __pyx_t_5numpy_float64_t __pyx_v_cpos[3]; + PyObject *__pyx_v_rv = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __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; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + __Pyx_RefNannySetupContext("find_nearest", 0); + + /* "yt/utilities/lib/distance_queue.pyx":165 + * cdef np.float64_t ppos[3] + * cdef np.float64_t cpos[3] + * self.neighbor_reset() # <<<<<<<<<<<<<< + * for i in range(3): + * cpos[i] = center[i] + */ + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->neighbor_reset(__pyx_v_self); + + /* "yt/utilities/lib/distance_queue.pyx":166 + * cdef np.float64_t cpos[3] + * self.neighbor_reset() + * for i in range(3): # <<<<<<<<<<<<<< + * cpos[i] = center[i] + * for j in range(points.shape[0]): + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/distance_queue.pyx":167 + * self.neighbor_reset() + * for i in range(3): + * cpos[i] = center[i] # <<<<<<<<<<<<<< + * for j in range(points.shape[0]): + * for i in range(3): + */ + __pyx_t_2 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_2 < 0) { + __pyx_t_2 += __pyx_v_center.shape[0]; + if (unlikely(__pyx_t_2 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_2 >= __pyx_v_center.shape[0])) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + __PYX_ERR(0, 167, __pyx_L1_error) + } + (__pyx_v_cpos[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_center.data + __pyx_t_2 * __pyx_v_center.strides[0]) ))); + } + + /* "yt/utilities/lib/distance_queue.pyx":168 + * for i in range(3): + * cpos[i] = center[i] + * for j in range(points.shape[0]): # <<<<<<<<<<<<<< + * for i in range(3): + * ppos[i] = points[j,i] + */ + __pyx_t_4 = (__pyx_v_points.shape[0]); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { + __pyx_v_j = __pyx_t_1; + + /* "yt/utilities/lib/distance_queue.pyx":169 + * cpos[i] = center[i] + * for j in range(points.shape[0]): + * for i in range(3): # <<<<<<<<<<<<<< + * ppos[i] = points[j,i] + * self.neighbor_eval(j, ppos, cpos) + */ + for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "yt/utilities/lib/distance_queue.pyx":170 + * for j in range(points.shape[0]): + * for i in range(3): + * ppos[i] = points[j,i] # <<<<<<<<<<<<<< + * self.neighbor_eval(j, ppos, cpos) + * rv = np.empty(self.curn, dtype="int64") + */ + __pyx_t_5 = __pyx_v_j; + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_points.shape[0]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_v_points.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_points.shape[1]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_6 >= __pyx_v_points.shape[1])) __pyx_t_7 = 1; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 170, __pyx_L1_error) + } + (__pyx_v_ppos[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_points.data + __pyx_t_5 * __pyx_v_points.strides[0]) ) + __pyx_t_6 * __pyx_v_points.strides[1]) ))); + } + + /* "yt/utilities/lib/distance_queue.pyx":171 + * for i in range(3): + * ppos[i] = points[j,i] + * self.neighbor_eval(j, ppos, cpos) # <<<<<<<<<<<<<< + * rv = np.empty(self.curn, dtype="int64") + * for i in range(self.curn): + */ + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->neighbor_eval(__pyx_v_self, __pyx_v_j, __pyx_v_ppos, __pyx_v_cpos); + } + + /* "yt/utilities/lib/distance_queue.pyx":172 + * ppos[i] = points[j,i] + * self.neighbor_eval(j, ppos, cpos) + * rv = np.empty(self.curn, dtype="int64") # <<<<<<<<<<<<<< + * for i in range(self.curn): + * rv[i] = self.neighbors[i].pn + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.curn); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_rv = __pyx_t_11; + __pyx_t_11 = 0; + + /* "yt/utilities/lib/distance_queue.pyx":173 + * self.neighbor_eval(j, ppos, cpos) + * rv = np.empty(self.curn, dtype="int64") + * for i in range(self.curn): # <<<<<<<<<<<<<< + * rv[i] = self.neighbors[i].pn + * return rv + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.curn; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "yt/utilities/lib/distance_queue.pyx":174 + * rv = np.empty(self.curn, dtype="int64") + * for i in range(self.curn): + * rv[i] = self.neighbors[i].pn # <<<<<<<<<<<<<< + * return rv + */ + __pyx_t_11 = __Pyx_PyInt_From_npy_int64((__pyx_v_self->neighbors[__pyx_v_i]).pn); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (unlikely(__Pyx_SetItemInt(__pyx_v_rv, __pyx_v_i, __pyx_t_11, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + + /* "yt/utilities/lib/distance_queue.pyx":175 + * for i in range(self.curn): + * rv[i] = self.neighbors[i].pn + * return rv # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_rv); + __pyx_r = __pyx_v_rv; + goto __pyx_L0; + + /* "yt/utilities/lib/distance_queue.pyx":158 + * self.item_reset() + * + * def find_nearest(self, np.float64_t[:] center, np.float64_t[:,:] points): # <<<<<<<<<<<<<< + * """This function accepts a center and a set of [N,3] points, and it + * will return the indices into the points array of the maxn closest + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("yt.utilities.lib.distance_queue.DistanceQueue.find_nearest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rv); + __PYX_XDEC_MEMVIEW(&__pyx_v_center, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_points, 1); + __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_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_9__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_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_8__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__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__3, 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("yt.utilities.lib.distance_queue.DistanceQueue.__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_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_11__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_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_10__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *__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__4, 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("yt.utilities.lib.distance_queue.DistanceQueue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + goto __pyx_L4; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 218, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 222, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + goto __pyx_L11; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * 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)); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset + */ + __pyx_v_f = NULL; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * 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; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + goto __pyx_L14; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L14:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 259, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(2, 278, __pyx_L1_error) + break; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + */ + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = '\x00'; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * 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, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * 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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + * + * 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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * 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, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + long __pyx_t_8; + char *__pyx_t_9; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(2, 794, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_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, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * 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, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 796, __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 799, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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") + * + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 803, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 0x78; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(2, 823, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + /*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, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 844, __pyx_L1_error) + } + __pyx_L15:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + goto __pyx_L13; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * 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; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":120 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __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, 120, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) + } else { + + /* "View.MemoryView":121 + * + * 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, 120, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __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":120 + * 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; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":127 + * 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, 127, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":128 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":131 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 131, __pyx_L1_error) + + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + } + + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":134 + * + * 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__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 134, __pyx_L1_error) + + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + } + + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":137 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + } + + /* "View.MemoryView":138 + * if not isinstance(format, bytes): + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) + __pyx_t_5 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":139 + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_6; + + /* "View.MemoryView":142 + * + * + * 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":143 + * + * 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":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":146 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 146, __pyx_L1_error) + + /* "View.MemoryView":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + } + + /* "View.MemoryView":149 + * + * + * 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, 149, __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, 149, __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, 149, __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":150 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":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_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __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, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __PYX_ERR(1, 151, __pyx_L1_error) + + /* "View.MemoryView":150 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + } + + /* "View.MemoryView":152 + * 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":149 + * + * + * 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":155 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":156 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":157 + * 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":155 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":159 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":160 + * 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":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":162 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + /*else*/ { + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 162, __pyx_L1_error) + } + __pyx_L10:; + + /* "View.MemoryView":164 + * 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":167 + * 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":168 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":169 + * 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":172 + * + * + * 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":173 + * + * 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 (__pyx_t_4) { + + /* "View.MemoryView":174 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 174, __pyx_L1_error) + + /* "View.MemoryView":173 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + } + + /* "View.MemoryView":176 + * 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":177 + * + * 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":178 + * 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, 178, __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, 178, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":179 + * 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":180 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + + /* "View.MemoryView":176 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + } + + /* "View.MemoryView":169 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":120 + * 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":183 + * + * @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; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":184 + * @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":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":186 + * 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":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + goto __pyx_L3; + } + + /* "View.MemoryView":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":188 + * 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":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; + + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 190, __pyx_L1_error) + + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + } + + /* "View.MemoryView":191 + * 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":192 + * 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":193 + * 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":194 + * 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":195 + * 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":196 + * 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":197 + * 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":198 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":200 + * 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":201 + * + * 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":200 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":203 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":205 + * 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":183 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":209 + * __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":210 + * + * 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":211 + * 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":210 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":214 + * 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":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } + + /* "View.MemoryView":216 + * 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":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + } + __pyx_L3:; + + /* "View.MemoryView":217 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":209 + * __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":220 + * + * @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":221 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":220 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":224 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_memview", 0); + + /* "View.MemoryView":225 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":226 + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __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, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":224 + * + * @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 + * + * + * 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_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":230 + * + * 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, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":229 + * + * + * 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":232 + * 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_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":233 + * + * 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, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __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 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":235 + * 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_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":236 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":235 + * 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__20, 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__21, 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":240 + * + * @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":244 + * 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":245 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __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, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":244 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __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":248 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":249 + * 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":251 + * 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":240 + * + * @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":277 + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __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, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___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":278 + * 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":277 + * 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":279 + * 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":280 + * 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":279 + * 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":294 + * + * @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":296 + * 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":300 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":302 + * 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":303 + * + * 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":302 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":305 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":294 + * + * @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":341 + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __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, 341, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___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":342 + * + * 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":343 + * 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":344 + * 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":345 + * 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 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) + + /* "View.MemoryView":346 + * 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":347 + * __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":348 + * 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":346 + * 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":344 + * 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":351 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":352 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":353 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":351 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + } + + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":355 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":357 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) + + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } + + /* "View.MemoryView":359 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":360 + * + * 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":359 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + goto __pyx_L10; + } + + /* "View.MemoryView":362 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; + + /* "View.MemoryView":364 + * 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":366 + * 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":341 + * 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":368 + * 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; + PyThread_type_lock __pyx_t_5; + PyThread_type_lock __pyx_t_6; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":369 + * + * 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":370 + * 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":369 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + } + + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * 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":375 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":377 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":380 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":379 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; + + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":381 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":383 + * break + * else: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + } + __pyx_L6_break:; + + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":368 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":385 + * 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":387 + * 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":389 + * 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, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 389, __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":390 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":389 + * 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":392 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":385 + * 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":395 + * + * + * 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":396 + * + * 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":397 + * 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":396 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + } + + /* "View.MemoryView":399 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 399, __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, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":402 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) + if (__pyx_t_2) { + + /* "View.MemoryView":403 + * 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, 403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":402 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + } + + /* "View.MemoryView":405 + * 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 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":406 + * 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, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":395 + * + * + * 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":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___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 + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":409 + * + * def __setitem__(memoryview self, object index, object value): + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 409, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":412 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_obj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":414 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":416 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":418 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":420 + * 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":421 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_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":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":424 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __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, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":425 + * 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, 425, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":426 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":421 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + } + + /* "View.MemoryView":428 + * 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":420 + * 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":430 + * 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":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) + + /* "View.MemoryView":435 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) + + /* "View.MemoryView":436 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) + + /* "View.MemoryView":430 + * 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":438 + * 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":440 + * 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":445 + * 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":447 + * 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":448 + * + * 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":449 + * 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 (__pyx_t_1) { + + /* "View.MemoryView":450 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) + + /* "View.MemoryView":449 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":451 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":447 + * 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":453 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":455 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":456 + * + * 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":457 + * 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":456 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":459 + * ( 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, 459, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":463 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":464 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":463 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + } + + /* "View.MemoryView":465 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * 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":468 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __pyx_L6_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __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); + } + __Pyx_PyThreadState_assign + 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":438 + * 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":470 + * 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":471 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":472 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":470 + * 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":474 + * 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":477 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":480 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __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":482 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __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, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } + + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":487 + * 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(1, 487, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; + + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } + + /* "View.MemoryView":488 + * 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_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":483 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); + + /* "View.MemoryView":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 484, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } + + /* "View.MemoryView":474 + * 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":490 + * 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":493 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":498 + * 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":499 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __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 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":498 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":501 + * 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, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __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, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __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, 501, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":503 + * 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, 503, __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":504 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":503 + * 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":504 + * + * 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":490 + * 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":507 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___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; + Py_ssize_t *__pyx_t_2; + char *__pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":509 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_2 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_2; + + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":511 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":513 + * 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":514 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_2 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_2; + + /* "View.MemoryView":513 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":516 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L4:; + + /* "View.MemoryView":518 + * 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":519 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_2 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_2; + + /* "View.MemoryView":518 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":521 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":523 + * 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":524 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_3 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_3; + + /* "View.MemoryView":523 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":526 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":528 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_4 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":529 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_5 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_5; + + /* "View.MemoryView":530 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = 0 + */ + __pyx_t_6 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_6; + + /* "View.MemoryView":531 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.obj = self + */ + __pyx_t_6 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_6; + + /* "View.MemoryView":532 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":533 + * info.len = self.view.len + * info.readonly = 0 + * 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":507 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + + /* function exit code */ + __pyx_r = 0; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":539 + * + * @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":540 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":541 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) + + /* "View.MemoryView":542 + * 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":539 + * + * @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":545 + * + * @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":546 + * @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":545 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":549 + * + * @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":550 + * @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, 550, __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, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":549 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_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":553 + * + * @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":554 + * @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 (__pyx_t_1) { + + /* "View.MemoryView":556 + * 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__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 556, __pyx_L1_error) + + /* "View.MemoryView":554 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + } + + /* "View.MemoryView":558 + * 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, 558, __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, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "View.MemoryView":553 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_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":561 + * + * @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":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__24, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + } + + /* "View.MemoryView":565 + * 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, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":561 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_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":568 + * + * @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":569 + * @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, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":568 + * + * @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":572 + * + * @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":573 + * @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, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":572 + * + * @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":576 + * + * @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":577 + * @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, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":576 + * + * @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":580 + * + * @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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":582 + * 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":584 + * 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, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":585 + * + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":587 + * 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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":589 + * 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":580 + * + * @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":591 + * 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":592 + * + * 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":593 + * 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":592 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":595 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":591 + * 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":597 + * 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":598 + * + * 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, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":599 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":598 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":597 + * 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":601 + * 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":602 + * + * 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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":601 + * 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":605 + * + * + * 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":608 + * 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":609 + * 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, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":605 + * + * + * 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":611 + * 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":614 + * 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":615 + * 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, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":611 + * 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":617 + * 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":619 + * 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":621 + * 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":622 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":627 + * 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, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":617 + * 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":629 + * 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":631 + * 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":633 + * 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":634 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":639 + * 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, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":629 + * 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__25, 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__26, 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":643 + * + * @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":644 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __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, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":645 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":646 + * 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":643 + * + * @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":649 + * + * @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":650 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":649 + * + * @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":652 + * 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":657 + * 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":658 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":657 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":660 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":662 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":663 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":664 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":665 + * 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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 665, __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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__27); + __Pyx_GIVEREF(__pyx_slice__27); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__27); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":669 + * 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":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__28); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":672 + * 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":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":675 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(1, 675, __pyx_L1_error) + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":677 + * 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":678 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":665 + * 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":680 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__29); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":684 + * 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, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "View.MemoryView":652 + * 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":686 + * 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":687 + * + * 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":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":689 + * 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__30, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 689, __pyx_L1_error) + + /* "View.MemoryView":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":686 + * 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":696 + * + * @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":697 + * @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":704 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + + /* "View.MemoryView":708 + * 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, 708, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":711 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":712 + * 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":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":714 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":715 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":721 + * + * + * 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":722 + * + * 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":727 + * + * + * 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":728 + * + * 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":732 + * 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, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 732, __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":733 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":737 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) + + /* "View.MemoryView":734 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) + + /* "View.MemoryView":733 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":741 + * 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":742 + * 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":743 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":744 + * 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":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":746 + * 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, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":747 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":748 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":750 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":751 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":752 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":754 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) + + /* "View.MemoryView":760 + * 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":732 + * 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":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":763 + * + * 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":764 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } + + /* "View.MemoryView":765 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } + + /* "View.MemoryView":763 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":769 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":696 + * + * @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":793 + * + * @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":813 + * 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":815 + * 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":816 + * + * 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":815 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_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":818 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":813 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":821 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __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":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_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":824 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) + + /* "View.MemoryView":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + } + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":828 + * + * 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":829 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":830 + * 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":831 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":830 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":828 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":832 + * 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":833 + * 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":834 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":833 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":836 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":832 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":839 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":841 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":844 + * + * 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":845 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":846 + * 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":847 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":846 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":844 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":848 + * 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":849 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":848 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":852 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":854 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":857 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":861 + * + * 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":863 + * 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":864 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":863 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":866 + * 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":867 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":866 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":870 + * + * + * 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":871 + * + * 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":872 + * 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":875 + * + * + * 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":876 + * + * 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":875 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":878 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":880 + * 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":881 + * + * 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":882 + * 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":883 + * 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":882 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":885 + * 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":886 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":881 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":888 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":880 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":890 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":793 + * + * @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":896 + * + * @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":898 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":899 + * 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":902 + * 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":903 + * + * 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, 903, __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, 903, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":904 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":902 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":906 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":907 + * 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":908 + * 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":909 + * 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":908 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":911 + * 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":912 + * + * 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":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":914 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 914, __pyx_L1_error) + + /* "View.MemoryView":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":911 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":917 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 917, __pyx_L1_error) + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":919 + * 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":920 + * + * 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":921 + * 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":920 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":923 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":896 + * + * @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":929 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + + /* "View.MemoryView":930 + * @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":932 + * 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":933 + * + * 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":937 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":938 + * 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":939 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":940 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L6_bool_binop_done:; + if (__pyx_t_6) { + + /* "View.MemoryView":943 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + } + } + + /* "View.MemoryView":945 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":929 + * + * @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":962 + * 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":963 + * + * 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":962 + * 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":965 + * __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":966 + * + * 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":967 + * 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, 967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":966 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":969 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":965 + * __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":971 + * 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":972 + * + * 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":973 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) + + /* "View.MemoryView":972 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":975 + * 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, 975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":971 + * 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":978 + * + * @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":979 + * @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":978 + * + * @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__31, 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__32, 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":985 + * + * @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":993 + * 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":994 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "View.MemoryView":993 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":999 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __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, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1001 + * 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":1002 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1004 + * __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, 1004, __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":1005 + * + * 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":1007 + * 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":1008 + * + * 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":1009 + * 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":1010 + * 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":1011 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * result.flags = PyBUF_RECORDS + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":1013 + * Py_INCREF(Py_None) + * + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1015 + * result.flags = PyBUF_RECORDS + * + * 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":1016 + * + * 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":1019 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1020 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1022 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":1023 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L5_break; + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L5_break:; + + /* "View.MemoryView":1025 + * 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":1026 + * + * 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, 1026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1027 + * 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, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1029 + * 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":1030 + * + * 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":1032 + * 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":985 + * + * @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":1035 + * + * @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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1039 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1040 + * 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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1042 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1043 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1035 + * + * @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":1046 + * + * @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; + Py_ssize_t __pyx_t_4; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1050 + * 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":1051 + * + * 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":1052 + * 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":1054 + * 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":1055 + * + * 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":1057 + * 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; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_dim = __pyx_t_3; + + /* "View.MemoryView":1058 + * + * 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":1059 + * 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":1060 + * 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_4 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_4 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4; + } + + /* "View.MemoryView":1046 + * + * @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":1063 + * + * @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":1066 + * "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":1067 + * 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, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1063 + * + * @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":1070 + * + * @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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1078 + * + * 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":1079 + * 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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1081 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1082 + * 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":1084 + * 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":1086 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1070 + * + * @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":1092 + * + * + * 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":1093 + * + * 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":1094 + * 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":1093 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1096 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1092 + * + * + * 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":1099 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1104 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1105 + * 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":1107 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1108 + * + * 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":1109 + * 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":1110 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1108 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1112 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1113 + * + * 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":1114 + * 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":1115 + * 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":1113 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1117 + * 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":1118 + * + * 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":1117 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1120 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1099 + * + * @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":1123 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + + /* "View.MemoryView":1130 + * + * 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":1131 + * 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":1132 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1133 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1135 + * 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":1136 + * + * 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":1137 + * 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":1136 + * + * 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":1138 + * 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): + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + + /* "View.MemoryView":1136 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1140 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1141 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + + /* "View.MemoryView":1142 + * 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":1143 + * 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":1135 + * 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":1145 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1146 + * 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":1150 + * 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":1151 + * 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":1123 + * + * @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":1153 + * 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":1156 + * __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":1153 + * 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":1160 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1163 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1165 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1166 + * + * 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":1168 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1160 + * + * @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":1171 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1180 + * 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":1181 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "View.MemoryView":1182 + * 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":1183 + * 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":1180 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1185 + * 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 > -1L; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1186 + * 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":1187 + * 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":1189 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1171 + * + * @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":1192 + * + * @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; + + /* "View.MemoryView":1203 + * 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":1204 + * + * 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":1206 + * 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":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1208 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) + + /* "View.MemoryView":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1211 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1212 + * + * 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":1213 + * 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; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1214 + * 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":1215 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1217 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + + /* "View.MemoryView":1221 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1222 + * + * 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":1223 + * 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":1222 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1225 + * 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":1226 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + + /* "View.MemoryView":1225 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1228 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1230 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1192 + * + * @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":1235 + * + * @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":1238 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __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":1237 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 1237, __pyx_L1_error) + + /* "View.MemoryView":1235 + * + * @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":1241 + * + * @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":1242 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_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, 1242, __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, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 1242, __pyx_L1_error) + + /* "View.MemoryView":1241 + * + * @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":1245 + * + * @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":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1247 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_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, 1247, __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, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 1247, __pyx_L1_error) + + /* "View.MemoryView":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1249 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(1, 1249, __pyx_L1_error) + } + + /* "View.MemoryView":1245 + * + * @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":1252 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + + /* "View.MemoryView":1260 + * 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":1261 + * """ + * 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":1263 + * 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":1264 + * 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":1265 + * 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":1268 + * 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":1269 + * + * 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":1268 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1271 + * 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":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1273 + * 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":1275 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1276 + * + * 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":1277 + * 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":1278 + * 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":1279 + * 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":1277 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1281 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1276 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1284 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + } + } + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1289 + * + * 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":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1291 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_6; + + /* "View.MemoryView":1292 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1298 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1302 + * 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":1304 + * 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":1305 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + + /* "View.MemoryView":1306 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1307 + * 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":1308 + * 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":1302 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_7 = (__pyx_t_2 != 0); + if (__pyx_t_7) { + + /* "View.MemoryView":1313 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) + + /* "View.MemoryView":1314 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1316 + * 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":1317 + * + * 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":1318 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1320 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1321 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1252 + * + * @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":1324 + * + * @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; + + /* "View.MemoryView":1328 + * 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":1330 + * 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 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1331 + * + * 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":1332 + * 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":1333 + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1335 + * 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; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1336 + * + * for i in range(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":1337 + * 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":1338 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1324 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1346 + * + * @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":1350 + * + * + * 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":1351 + * + * 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":1350 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1346 + * + * @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":1355 + * + * @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":1358 + * 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":1355 + * + * @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":1361 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1365 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_3 = (__pyx_v_inc != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1368 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1370 + * 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":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1372 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1373 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1375 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1361 + * + * @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":1381 + * + * @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":1384 + * 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":1385 + * 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":1387 + * _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":1381 + * + * @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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "View.MemoryView":1395 + * 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":1396 + * 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":1398 + * 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":1399 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1400 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1401 + * 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":1398 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1403 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1404 + * 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":1406 + * _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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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_2yt_9utilities_3lib_14distance_queue_PriorityQueue __pyx_vtable_2yt_9utilities_3lib_14distance_queue_PriorityQueue; + +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_14distance_queue_PriorityQueue(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *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_2yt_9utilities_3lib_14distance_queue_PriorityQueue *)o); + p->__pyx_vtab = __pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_PriorityQueue; + if (unlikely(__pyx_pw_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_2yt_9utilities_3lib_14distance_queue_PriorityQueue(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + 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_2yt_9utilities_3lib_14distance_queue_PriorityQueue[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_5__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_9utilities_3lib_14distance_queue_PriorityQueue = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.distance_queue.PriorityQueue", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_9utilities_3lib_14distance_queue_PriorityQueue, /*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*/ + "This class acts as a \"priority-queue.\" It was extracted from the\n DistanceQueue object so that it could serve as a general-purpose method for\n storing the N-most \"valuable\" objects. It's relatively simple, in that it\n provides storage for a single int64 (which is usually an 'index' into an\n external array or list) and a single float64 \"value\" associated with them.\n You can insert new objects, and then if it's already at maxn objects in it,\n it'll bump the least valuable one off the end. Of particular note is that\n *lower* values are considered to be *more valuable* than higher ones; this\n is because our typical use case is to store radii.\n ", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_9utilities_3lib_14distance_queue_PriorityQueue, /*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*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_9utilities_3lib_14distance_queue_PriorityQueue, /*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_2yt_9utilities_3lib_14distance_queue_DistanceQueue __pyx_vtable_2yt_9utilities_3lib_14distance_queue_DistanceQueue; + +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_14distance_queue_DistanceQueue(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *p; + PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_14distance_queue_PriorityQueue(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14distance_queue_PriorityQueue*)__pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_DistanceQueue; + if (unlikely(__pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_2yt_9utilities_3lib_14distance_queue_DistanceQueue(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + 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_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_5__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + __pyx_tp_dealloc_2yt_9utilities_3lib_14distance_queue_PriorityQueue(o); +} + +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_14distance_queue_DistanceQueue[] = { + {"setup", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_3setup, METH_VARARGS|METH_KEYWORDS, 0}, + {"find_nearest", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_7find_nearest, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_6find_nearest}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_9__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_11__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_9utilities_3lib_14distance_queue_DistanceQueue = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.distance_queue.DistanceQueue", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_9utilities_3lib_14distance_queue_DistanceQueue, /*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*/ + "This is a distance queue object, designed to incrementally evaluate N\n positions against a reference point. It is initialized with the maximum\n number that are to be retained (i.e., maxn-nearest neighbors).", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_9utilities_3lib_14distance_queue_DistanceQueue, /*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*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_9utilities_3lib_14distance_queue_DistanceQueue, /*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 PY_VERSION_HEX >= 0x030400a1 + 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 = 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 = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + 0, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.distance_queue.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.distance_queue.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.distance_queue.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.distance_queue._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 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + "distance_queue", + __pyx_k_Distance_queue_implementation, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_DW, __pyx_k_DW, sizeof(__pyx_k_DW), 0, 0, 1, 1}, + {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, + {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_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_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_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_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 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_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_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_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_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_maxn, __pyx_k_maxn, sizeof(__pyx_k_maxn), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_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_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_periodicity, __pyx_k_periodicity, sizeof(__pyx_k_periodicity), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 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_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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 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_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_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, 46, __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_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 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_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(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__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "(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__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "(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__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "View.MemoryView":131 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "View.MemoryView":134 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "View.MemoryView":137 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "View.MemoryView":146 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "View.MemoryView":174 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "(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__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "(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__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "View.MemoryView":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "View.MemoryView":556 + * 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__23 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __pyx_tuple__24 = PyTuple_New(1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__24, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "(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__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "(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__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "View.MemoryView":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__27); + __Pyx_GIVEREF(__pyx_slice__27); + + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__28); + __Pyx_GIVEREF(__pyx_slice__28); + + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); + + /* "View.MemoryView":689 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "(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__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "(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__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "View.MemoryView":282 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "View.MemoryView":283 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "View.MemoryView":284 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "View.MemoryView":287 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "View.MemoryView":288 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__38 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __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_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_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; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initdistance_queue(void); /*proto*/ +PyMODINIT_FUNC initdistance_queue(void) +#else +PyMODINIT_FUNC PyInit_distance_queue(void); /*proto*/ +PyMODINIT_FUNC PyInit_distance_queue(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + static PyThread_type_lock __pyx_t_2[8]; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_distance_queue(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_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 PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("distance_queue", __pyx_methods, __pyx_k_Distance_queue_implementation, 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) + __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_yt__utilities__lib__distance_queue) { + 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, "yt.utilities.lib.distance_queue")) { + if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.distance_queue", __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 init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("Neighbor_compare", (void (*)(void))__pyx_f_2yt_9utilities_3lib_14distance_queue_Neighbor_compare, "int (void *, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("r2dist", (void (*)(void))__pyx_f_2yt_9utilities_3lib_14distance_queue_r2dist, "__pyx_t_5numpy_float64_t (__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, __pyx_t_5numpy_float64_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Type init code ---*/ + __pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_PriorityQueue = &__pyx_vtable_2yt_9utilities_3lib_14distance_queue_PriorityQueue; + __pyx_vtable_2yt_9utilities_3lib_14distance_queue_PriorityQueue.item_reset = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *))__pyx_f_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_item_reset; + __pyx_vtable_2yt_9utilities_3lib_14distance_queue_PriorityQueue.item_insert = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_PriorityQueue *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t))__pyx_f_2yt_9utilities_3lib_14distance_queue_13PriorityQueue_item_insert; + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14distance_queue_PriorityQueue) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_type_2yt_9utilities_3lib_14distance_queue_PriorityQueue.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_14distance_queue_PriorityQueue.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_PriorityQueue) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "PriorityQueue", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14distance_queue_PriorityQueue) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_14distance_queue_PriorityQueue) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14distance_queue_PriorityQueue = &__pyx_type_2yt_9utilities_3lib_14distance_queue_PriorityQueue; + __pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_DistanceQueue = &__pyx_vtable_2yt_9utilities_3lib_14distance_queue_DistanceQueue; + __pyx_vtable_2yt_9utilities_3lib_14distance_queue_DistanceQueue.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_PriorityQueue; + __pyx_vtable_2yt_9utilities_3lib_14distance_queue_DistanceQueue._setup = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *, __pyx_t_5numpy_float64_t *, int *))__pyx_f_2yt_9utilities_3lib_14distance_queue_13DistanceQueue__setup; + __pyx_vtable_2yt_9utilities_3lib_14distance_queue_DistanceQueue.neighbor_eval = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_neighbor_eval; + __pyx_vtable_2yt_9utilities_3lib_14distance_queue_DistanceQueue.neighbor_reset = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_14distance_queue_DistanceQueue *))__pyx_f_2yt_9utilities_3lib_14distance_queue_13DistanceQueue_neighbor_reset; + __pyx_type_2yt_9utilities_3lib_14distance_queue_DistanceQueue.tp_base = __pyx_ptype_2yt_9utilities_3lib_14distance_queue_PriorityQueue; + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14distance_queue_DistanceQueue) < 0) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_type_2yt_9utilities_3lib_14distance_queue_DistanceQueue.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_14distance_queue_DistanceQueue.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_14distance_queue_DistanceQueue) < 0) __PYX_ERR(0, 111, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "DistanceQueue", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14distance_queue_DistanceQueue) < 0) __PYX_ERR(0, 111, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_14distance_queue_DistanceQueue) < 0) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14distance_queue_DistanceQueue = &__pyx_type_2yt_9utilities_3lib_14distance_queue_DistanceQueue; + __pyx_vtabptr_array = &__pyx_vtable_array; + __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + __pyx_type___pyx_array.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) + __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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, 326, __pyx_L1_error) + __pyx_type___pyx_memoryview.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + 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, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "yt/utilities/lib/distance_queue.pyx":17 + * #----------------------------------------------------------------------------- + * cimport numpy as np + * import numpy as np # <<<<<<<<<<<<<< + * cimport cython + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/distance_queue.pyx":1 + * """ # <<<<<<<<<<<<<< + * Distance queue implementation + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":207 + * 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, 207, __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, 207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":282 + * 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__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":283 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":284 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":287 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":288 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":312 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":313 + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_2[0] = PyThread_allocate_lock(); + __pyx_t_2[1] = PyThread_allocate_lock(); + __pyx_t_2[2] = PyThread_allocate_lock(); + __pyx_t_2[3] = PyThread_allocate_lock(); + __pyx_t_2[4] = PyThread_allocate_lock(); + __pyx_t_2[5] = PyThread_allocate_lock(); + __pyx_t_2[6] = PyThread_allocate_lock(); + __pyx_t_2[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":535 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__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, 535, __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, 535, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":981 + * 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, 981, __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, 981, __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 + */ + __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( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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 yt.utilities.lib.distance_queue", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib.distance_queue"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #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 + +/* 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; +} + +/* 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); +} + +/* 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 + +/* 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 PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* BufferIndexError */ + static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +/* GetItemInt */ + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + 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)); +} + +/* BufferFormatCheck */ + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +/* 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; +} +static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + Py_FatalError(msg); + va_end(vargs); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview || (PyObject *) memview == Py_None) + return; + if (__pyx_get_slice_count(memview) < 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (first_time) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview ) { + return; + } else if ((PyObject *) memview == Py_None) { + memslice->memview = NULL; + return; + } + if (__pyx_get_slice_count(memview) <= 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (last_time) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +/* GetModuleGlobalName */ + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +/* SetItemInt */ + static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, + CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return -1; + PyErr_Clear(); + } + } + return m->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { +#else + if (is_list || PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +/* 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(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { +#endif + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* ArgTypeTest */ + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +/* 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_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_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* 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 CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL +#include "frameobject.h" +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = PyThreadState_GET(); + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyCFunctionFastCall */ + #if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + 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 + +/* PyIntBinop */ + #if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + x = (long)((unsigned long)a + b); + if (likely((x^a) >= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* None */ + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* 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 +} + +/* 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 + +/* 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; + } +} + +/* 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 */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; + if (c_line) { + c_line = __Pyx_CLineForTraceback(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( + PyThreadState_GET(), /*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 (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + Py_DECREF(obj); + view->obj = NULL; +} +#endif + + + /* MemviewSliceIsContig */ + static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, + char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) + return 0; + itemsize *= mvs.shape[index]; + } + return 1; +} + +/* OverlappingSlices */ + static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +/* Capsule */ + static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* TypeInfoCompare */ + static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + 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_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__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, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_long(long value) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_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); + } +} + +/* 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 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; +} + +/* 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) + PyErr_Clear(); + ++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); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else + if (__Pyx_PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +#endif + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (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 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 (PyInt_Check(x) || PyLong_Check(x)) +#else + if (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 = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } + #else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } + #endif +#else + res = PyNumber_Int(x); +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + 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_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff -Nru yt-3.3.3/yt/utilities/lib/distance_queue.pxd yt-3.4.0/yt/utilities/lib/distance_queue.pxd --- yt-3.3.3/yt/utilities/lib/distance_queue.pxd 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/distance_queue.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,54 @@ +""" +A queue for evaluating distances to discrete points + + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2016, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +cimport cython +cimport numpy as np +import numpy as np +from libc.stdlib cimport malloc, free +from libc.string cimport memmove + +# THESE TWO STRUCTS MUST BE EQUIVALENT + +cdef struct ItemList: + np.int64_t ind + np.float64_t value + +cdef struct NeighborList: + np.int64_t pn # Particle number + np.float64_t r2 # radius**2 + +cdef int Neighbor_compare(void *on1, void *on2) nogil +cdef np.float64_t r2dist(np.float64_t ppos[3], + np.float64_t cpos[3], + np.float64_t DW[3], + bint periodicity[3], + np.float64_t max_dist2) + +cdef class PriorityQueue: + cdef int maxn + cdef int curn + cdef ItemList* items + cdef void item_reset(self) + cdef int item_insert(self, np.int64_t i, np.float64_t value) + +cdef class DistanceQueue(PriorityQueue): + cdef np.float64_t DW[3] + cdef bint periodicity[3] + cdef NeighborList* neighbors # flat array + cdef void _setup(self, np.float64_t DW[3], bint periodicity[3]) + cdef void neighbor_eval(self, np.int64_t pn, np.float64_t ppos[3], + np.float64_t cpos[3]) + cdef void neighbor_reset(self) diff -Nru yt-3.3.3/yt/utilities/lib/distance_queue.pyx yt-3.4.0/yt/utilities/lib/distance_queue.pyx --- yt-3.3.3/yt/utilities/lib/distance_queue.pyx 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/distance_queue.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,175 @@ +""" +Distance queue implementation + + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2016, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- +cimport numpy as np +import numpy as np +cimport cython + +cdef int Neighbor_compare(void *on1, void *on2) nogil: + cdef NeighborList *n1 + cdef NeighborList *n2 + n1 = on1 + n2 = on2 + # Note that we set this up so that "greatest" evaluates to the *end* of the + # list, so we can do standard radius comparisons. + if n1.r2 < n2.r2: + return -1 + elif n1.r2 == n2.r2: + return 0 + else: + return 1 + +@cython.cdivision(True) +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.initializedcheck(False) +cdef np.float64_t r2dist(np.float64_t ppos[3], + np.float64_t cpos[3], + np.float64_t DW[3], + bint periodicity[3], + np.float64_t max_dist2): + cdef int i + cdef np.float64_t r2, DR + r2 = 0.0 + for i in range(3): + DR = (ppos[i] - cpos[i]) + if not periodicity[i]: + pass + elif (DR > DW[i]/2.0): + DR -= DW[i] + elif (DR < -DW[i]/2.0): + DR += DW[i] + r2 += DR * DR + if max_dist2 >= 0.0 and r2 > max_dist2: + return -1.0 + return r2 + +cdef class PriorityQueue: + """This class acts as a "priority-queue." It was extracted from the + DistanceQueue object so that it could serve as a general-purpose method for + storing the N-most "valuable" objects. It's relatively simple, in that it + provides storage for a single int64 (which is usually an 'index' into an + external array or list) and a single float64 "value" associated with them. + You can insert new objects, and then if it's already at maxn objects in it, + it'll bump the least valuable one off the end. Of particular note is that + *lower* values are considered to be *more valuable* than higher ones; this + is because our typical use case is to store radii. + """ + def __cinit__(self, int maxn): + cdef int i + self.maxn = maxn + self.curn = 0 + self.items = malloc( + sizeof(ItemList) * self.maxn) + + cdef void item_reset(self): + for i in range(self.maxn): + self.items[i].value = 1e300 + self.items[i].ind = -1 + self.curn = 0 + + cdef int item_insert(self, np.int64_t ind, np.float64_t value): + cdef int i, di + if self.curn == 0: + self.items[0].value = value + self.items[0].ind = ind + self.curn += 1 + return 0 + # Now insert in a sorted way + di = -1 + for i in range(self.curn - 1, -1, -1): + # We are checking if i is less than us, to see if we should insert + # to the right (i.e., i+1). + if self.items[i].value < value: + di = i + break + # The outermost one is already too small. + if di == self.maxn - 1: + return -1 + if (self.maxn - (di + 2)) > 0: + memmove( (self.items + di + 2), + (self.items + di + 1), + sizeof(ItemList) * (self.maxn - (di + 2))) + self.items[di + 1].value = value + self.items[di + 1].ind = ind + if self.curn < self.maxn: + self.curn += 1 + return di + 1 + +cdef class DistanceQueue: + """This is a distance queue object, designed to incrementally evaluate N + positions against a reference point. It is initialized with the maximum + number that are to be retained (i.e., maxn-nearest neighbors).""" + def __cinit__(self, int maxn): + if sizeof(ItemList) != sizeof(NeighborList): + # This should almost never, ever happen unless we do something very + # wrong, and must be broken at compile time. + raise RuntimeError + self.neighbors = self.items + self.neighbor_reset() + for i in range(3): + self.DW[i] = 0 + self.periodicity[i] = False + + cdef void _setup(self, np.float64_t DW[3], bint periodicity[3]): + for i in range(3): + self.DW[i] = DW[i] + self.periodicity[i] = periodicity[i] + + def setup(self, np.float64_t[:] DW, periodicity): + for i in range(3): + self.DW[i] = DW[i] + self.periodicity[i] = periodicity[i] + + def __dealloc__(self): + free(self.neighbors) + + cdef void neighbor_eval(self, np.int64_t pn, np.float64_t ppos[3], + np.float64_t cpos[3]): + # Here's a python+numpy simulator of this: + # http://paste.yt-project.org/show/5445/ + cdef np.float64_t r2, r2_trunc + if self.curn == self.maxn: + # Truncate calculation if it's bigger than this in any dimension + r2_trunc = self.neighbors[self.curn - 1].r2 + else: + # Don't truncate our calculation + r2_trunc = -1 + r2 = r2dist(ppos, cpos, self.DW, self.periodicity, r2_trunc) + if r2 == -1: + return + self.item_insert(pn, r2) + + cdef void neighbor_reset(self): + self.item_reset() + + def find_nearest(self, np.float64_t[:] center, np.float64_t[:,:] points): + """This function accepts a center and a set of [N,3] points, and it + will return the indices into the points array of the maxn closest + neighbors.""" + cdef int i, j + cdef np.float64_t ppos[3] + cdef np.float64_t cpos[3] + self.neighbor_reset() + for i in range(3): + cpos[i] = center[i] + for j in range(points.shape[0]): + for i in range(3): + ppos[i] = points[j,i] + self.neighbor_eval(j, ppos, cpos) + rv = np.empty(self.curn, dtype="int64") + for i in range(self.curn): + rv[i] = self.neighbors[i].pn + return rv diff -Nru yt-3.3.3/yt/utilities/lib/element_mappings.c yt-3.4.0/yt/utilities/lib/element_mappings.c --- yt-3.3.3/yt/utilities/lib/element_mappings.c 2016-12-12 01:41:44.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/element_mappings.c 2017-08-10 18:20:35.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,8 +6,15 @@ "depends": [ "yt/utilities/lib/platform_dep.h" ], + "include_dirs": [ + "yt/utilities/lib" + ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.element_mappings", + "sources": [ + "yt/utilities/lib/element_mappings.pyx" ] }, "module_name": "yt.utilities.lib.element_mappings" @@ -21,7 +28,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -43,6 +50,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -195,16 +203,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -331,6 +343,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -385,6 +403,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -494,8 +541,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -508,8 +555,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -631,10 +681,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -668,6 +720,7 @@ static const char *__pyx_f[] = { "yt/utilities/lib/element_mappings.pyx", + "stringsource", "__init__.pxd", "type.pxd", }; @@ -923,6 +976,7 @@ /*--- Type declarations ---*/ struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler; +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; @@ -931,6 +985,9 @@ struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D; +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D; +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D; +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_longdouble longdouble_t @@ -968,7 +1025,7 @@ */ typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "yt/utilities/lib/element_mappings.pxd":81 +/* "yt/utilities/lib/element_mappings.pxd":96 * # once it is converged. * # * ctypedef void (*func_type)(double* fx, # <<<<<<<<<<<<<< @@ -977,7 +1034,7 @@ */ typedef void (*__pyx_t_2yt_9utilities_3lib_16element_mappings_func_type)(double *, double *, double *, double *); -/* "yt/utilities/lib/element_mappings.pxd":101 +/* "yt/utilities/lib/element_mappings.pxd":116 * # tcol - the third column of the jaocobian * # * ctypedef void (*jac_type3D)(double* rcol, # <<<<<<<<<<<<<< @@ -986,14 +1043,14 @@ */ typedef void (*__pyx_t_2yt_9utilities_3lib_16element_mappings_jac_type3D)(double *, double *, double *, double *, double *, double *); -/* "yt/utilities/lib/element_mappings.pxd":123 - * # The order of this array is [J11, J12, J21, J22] +/* "yt/utilities/lib/element_mappings.pxd":138 + * # scol - the second column of the jacobian * # - * ctypedef void (*jac_type2D)(double* A, # <<<<<<<<<<<<<< + * ctypedef void (*jac_type2D)(double* rcol, # <<<<<<<<<<<<<< + * double* scol, * double* x, - * double* vertices, */ -typedef void (*__pyx_t_2yt_9utilities_3lib_16element_mappings_jac_type2D)(double *, double *, double *, double *); +typedef void (*__pyx_t_2yt_9utilities_3lib_16element_mappings_jac_type2D)(double *, double *, double *, double *, double *); /* "yt/utilities/lib/element_mappings.pxd":7 * from libc.math cimport fabs, fmax @@ -1013,6 +1070,18 @@ /* "yt/utilities/lib/element_mappings.pxd":36 * * + * cdef class P1Sampler1D(ElementSampler): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler __pyx_base; +}; + + +/* "yt/utilities/lib/element_mappings.pxd":51 + * + * * cdef class P1Sampler2D(ElementSampler): # <<<<<<<<<<<<<< * * cdef void map_real_to_unit(self, @@ -1022,7 +1091,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":51 +/* "yt/utilities/lib/element_mappings.pxd":66 * * * cdef class P1Sampler3D(ElementSampler): # <<<<<<<<<<<<<< @@ -1034,7 +1103,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":129 +/* "yt/utilities/lib/element_mappings.pxd":145 * * * cdef class NonlinearSolveSampler3D(ElementSampler): # <<<<<<<<<<<<<< @@ -1051,7 +1120,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":143 +/* "yt/utilities/lib/element_mappings.pxd":159 * * * cdef class Q1Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1063,7 +1132,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":160 +/* "yt/utilities/lib/element_mappings.pxd":176 * * * cdef class W1Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1075,7 +1144,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":178 +/* "yt/utilities/lib/element_mappings.pxd":194 * * * cdef class S2Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1087,7 +1156,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":196 +/* "yt/utilities/lib/element_mappings.pxd":212 * * * cdef class NonlinearSolveSampler2D(ElementSampler): # <<<<<<<<<<<<<< @@ -1104,7 +1173,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":210 +/* "yt/utilities/lib/element_mappings.pxd":226 * * * cdef class Q1Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< @@ -1116,8 +1185,44 @@ }; +/* "yt/utilities/lib/element_mappings.pxd":241 + * + * + * cdef class Q2Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_base; +}; + + +/* "yt/utilities/lib/element_mappings.pxd":256 + * + * + * cdef class T2Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_base; +}; + + +/* "yt/utilities/lib/element_mappings.pxd":270 + * cdef int check_inside(self, double* mapped_coord) nogil + * + * cdef class Tet2Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D __pyx_base; +}; + + -/* "yt/utilities/lib/element_mappings.pyx":49 +/* "yt/utilities/lib/element_mappings.pyx":62 * * * cdef class ElementSampler: # <<<<<<<<<<<<<< @@ -1135,7 +1240,21 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler; -/* "yt/utilities/lib/element_mappings.pyx":107 +/* "yt/utilities/lib/element_mappings.pyx":120 + * + * + * cdef class P1Sampler1D(ElementSampler): # <<<<<<<<<<<<<< + * ''' + * + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler1D { + struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler1D; + + +/* "yt/utilities/lib/element_mappings.pyx":155 * * * cdef class P1Sampler2D(ElementSampler): # <<<<<<<<<<<<<< @@ -1149,7 +1268,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D; -/* "yt/utilities/lib/element_mappings.pyx":177 +/* "yt/utilities/lib/element_mappings.pyx":226 * * * cdef class P1Sampler3D(ElementSampler): # <<<<<<<<<<<<<< @@ -1163,7 +1282,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D; -/* "yt/utilities/lib/element_mappings.pyx":271 +/* "yt/utilities/lib/element_mappings.pyx":320 * * * cdef class NonlinearSolveSampler3D(ElementSampler): # <<<<<<<<<<<<<< @@ -1177,7 +1296,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; -/* "yt/utilities/lib/element_mappings.pyx":334 +/* "yt/utilities/lib/element_mappings.pyx":427 * * * cdef class Q1Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1191,7 +1310,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D; -/* "yt/utilities/lib/element_mappings.pyx":674 +/* "yt/utilities/lib/element_mappings.pyx":703 * * * cdef class W1Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1205,7 +1324,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D; -/* "yt/utilities/lib/element_mappings.pyx":459 +/* "yt/utilities/lib/element_mappings.pyx":488 * * * cdef class S2Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1219,7 +1338,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D; -/* "yt/utilities/lib/element_mappings.pyx":794 +/* "yt/utilities/lib/element_mappings.pyx":777 * * * cdef class NonlinearSolveSampler2D(ElementSampler): # <<<<<<<<<<<<<< @@ -1233,7 +1352,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; -/* "yt/utilities/lib/element_mappings.pyx":856 +/* "yt/utilities/lib/element_mappings.pyx":877 * * * cdef class Q1Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< @@ -1246,6 +1365,48 @@ }; static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D; + +/* "yt/utilities/lib/element_mappings.pyx":917 + * return 1 + * + * cdef class Q2Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< + * + * ''' + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D { + struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D; + + +/* "yt/utilities/lib/element_mappings.pyx":974 + * + * + * cdef class T2Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< + * + * ''' + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_T2Sampler2D { + struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_T2Sampler2D; + + +/* "yt/utilities/lib/element_mappings.pyx":1023 + * return 1 + * + * cdef class Tet2Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< + * + * ''' + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D { + struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D; + /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY @@ -1336,6 +1497,15 @@ /* KeywordStringCheck.proto */ static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* 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); @@ -1376,27 +1546,6 @@ #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif -/* 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); - -/* ArgTypeTest.proto */ -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); - -/* BufferFormatCheck.proto */ -static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, - __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO - /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; @@ -1424,6 +1573,58 @@ /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); +/* 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); + +/* ArgTypeTest.proto */ +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); + +/* BufferFormatCheck.proto */ +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { @@ -1487,8 +1688,11 @@ /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); /* CodeObjectCache.proto */ typedef struct { @@ -1509,6 +1713,9 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + /* BufferStructDeclare.proto */ typedef struct { Py_ssize_t shape, strides, suboffsets; @@ -1537,7 +1744,7 @@ static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* RealImag.proto */ #if CYTHON_CCOMPLEX @@ -1643,9 +1850,6 @@ /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); @@ -1667,6 +1871,9 @@ /* 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); @@ -1675,6 +1882,9 @@ static int __pyx_f_2yt_9utilities_3lib_16element_mappings_14ElementSampler_check_inside(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_self, CYTHON_UNUSED double *__pyx_v_mapped_coord); /* proto*/ static int __pyx_f_2yt_9utilities_3lib_16element_mappings_14ElementSampler_check_mesh_lines(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_self, CYTHON_UNUSED double *__pyx_v_mapped_coord); /* proto*/ static double __pyx_f_2yt_9utilities_3lib_16element_mappings_14ElementSampler_sample_at_real_point(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_self, double *__pyx_v_vertices, double *__pyx_v_field_values, double *__pyx_v_physical_x); /* proto*/ +static void __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_map_real_to_unit(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_v_self, double *__pyx_v_mapped_x, double *__pyx_v_vertices, double *__pyx_v_physical_x); /* proto*/ +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals); /* proto*/ +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_v_self, double *__pyx_v_mapped_coord); /* proto*/ static void __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_map_real_to_unit(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self, double *__pyx_v_mapped_x, double *__pyx_v_vertices, double *__pyx_v_physical_x); /* proto*/ static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals); /* proto*/ static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self, double *__pyx_v_mapped_coord); /* proto*/ @@ -1695,6 +1905,13 @@ static void __pyx_f_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_map_real_to_unit(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__pyx_v_self, double *__pyx_v_mapped_x, double *__pyx_v_vertices, double *__pyx_v_physical_x); /* proto*/ static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals); /* proto*/ static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_self, double *__pyx_v_mapped_coord); /* proto*/ +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals); /* proto*/ +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__pyx_v_self, double *__pyx_v_mapped_coord); /* proto*/ +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals); /* proto*/ +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__pyx_v_self, double *__pyx_v_mapped_coord); /* proto*/ +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals); /* proto*/ +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord); /* proto*/ +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_check_mesh_lines(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord); /* proto*/ /* Module declarations from 'cpython.buffer' */ @@ -1729,8 +1946,23 @@ /* Module declarations from 'libc.math' */ +/* Module declarations from 'yt.utilities.lib.autogenerated_element_samplers' */ +static void (*__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Function3D)(double *, double *, double *, double *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Jacobian3D)(double *, double *, double *, double *, double *, double *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Function2D)(double *, double *, double *, double *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Jacobian2D)(double *, double *, double *, double *, double *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q2Function2D)(double *, double *, double *, double *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q2Jacobian2D)(double *, double *, double *, double *, double *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Tet2Function3D)(double *, double *, double *, double *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Tet2Jacobian3D)(double *, double *, double *, double *, double *, double *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_T2Function2D)(double *, double *, double *, double *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_T2Jacobian2D)(double *, double *, double *, double *, double *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_W1Function3D)(double *, double *, double *, double *); /*proto*/ +static void (*__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_W1Jacobian3D)(double *, double *, double *, double *, double *, double *); /*proto*/ + /* Module declarations from 'yt.utilities.lib.element_mappings' */ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = 0; @@ -1739,16 +1971,17 @@ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D = 0; static double __pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(double *, double *, double *); /*proto*/ static double __pyx_f_2yt_9utilities_3lib_16element_mappings_maxnorm(double *, int); /*proto*/ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_Q1Function3D(double *, double *, double *, double *); /*proto*/ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_Q1Jacobian3D(double *, double *, double *, double *, double *, double *); /*proto*/ static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_S2Function3D(double *, double *, double *, double *); /*proto*/ static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_S2Jacobian3D(double *, double *, double *, double *, double *, double *); /*proto*/ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_W1Function3D(double *, double *, double *, double *); /*proto*/ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_W1Jacobian3D(double *, double *, double *, double *, double *, double *); /*proto*/ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_Q1Jacobian2D(double *, double *, double *, double *); /*proto*/ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_Q1Function2D(double *, double *, double *, double *); /*proto*/ +static PyObject *__pyx_f_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_ElementSampler__set_state(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_P1Sampler1D__set_state(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_P1Sampler2D__set_state(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *, PyObject *); /*proto*/ +static PyObject *__pyx_f_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_P1Sampler3D__set_state(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *, PyObject *); /*proto*/ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; #define __Pyx_MODULE_NAME "yt.utilities.lib.element_mappings" int __pyx_module_is_main_yt__utilities__lib__element_mappings = 0; @@ -1756,11 +1989,14 @@ /* Implementation of 'yt.utilities.lib.element_mappings' */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_super; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ImportError; static const char __pyx_k_np[] = "np"; +static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_val[] = "val"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_test[] = "__test__"; @@ -1768,82 +2004,167 @@ static const char __pyx_k_range[] = "range"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_result[] = "result"; +static const char __pyx_k_update[] = "update"; static const char __pyx_k_sampler[] = "sampler"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_vertices[] = "vertices"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_physical_x[] = "physical_x"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_field_values[] = "field_values"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_test_hex_sampler[] = "test_hex_sampler"; static const char __pyx_k_test_tri_sampler[] = "test_tri_sampler"; static const char __pyx_k_test_quad_sampler[] = "test_quad_sampler"; +static const char __pyx_k_test_tet2_sampler[] = "test_tet2_sampler"; +static const char __pyx_k_test_tri2_sampler[] = "test_tri2_sampler"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_test_hex20_sampler[] = "test_hex20_sampler"; +static const char __pyx_k_test_quad2_sampler[] = "test_quad2_sampler"; static const char __pyx_k_test_tetra_sampler[] = "test_tetra_sampler"; static const char __pyx_k_test_wedge_sampler[] = "test_wedge_sampler"; +static const char __pyx_k_test_linear1D_sampler[] = "test_linear1D_sampler"; +static const char __pyx_k_pyx_unpickle_P1Sampler1D[] = "__pyx_unpickle_P1Sampler1D"; +static const char __pyx_k_pyx_unpickle_P1Sampler2D[] = "__pyx_unpickle_P1Sampler2D"; +static const char __pyx_k_pyx_unpickle_P1Sampler3D[] = "__pyx_unpickle_P1Sampler3D"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/element_mappings.pyx"; -static const char __pyx_k_This_file_contains_coordinate_m[] = "\nThis file contains coordinate mappings between physical coordinates and those\ndefined on unit elements, as well as doing the corresponding intracell \ninterpolation on finite element data.\n\n\n"; +static const char __pyx_k_pyx_unpickle_ElementSampler[] = "__pyx_unpickle_ElementSampler"; +static const char __pyx_k_This_file_contains_coordinate_m[] = "\nThis file contains coordinate mappings between physical coordinates and those\ndefined on unit elements, as well as doing the corresponding intracell\ninterpolation on finite element data.\n\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"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xa3[] = "Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))"; static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_utilities_lib_element_mapping[] = "yt.utilities.lib.element_mappings"; +static const char __pyx_k_self_func_self_jac_cannot_be_con[] = "self.func,self.jac cannot be converted to a Python object for pickling"; +static const char __pyx_k_yt_utilities_lib_element_mapping[] = "yt/utilities/lib/element_mappings.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_utilities_lib_element_mapping_2[] = "yt.utilities.lib.element_mappings"; 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_0xa3; static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; +static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_field_values; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_main; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_new; 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_physical_x; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle_ElementSampler; +static PyObject *__pyx_n_s_pyx_unpickle_P1Sampler1D; +static PyObject *__pyx_n_s_pyx_unpickle_P1Sampler2D; +static PyObject *__pyx_n_s_pyx_unpickle_P1Sampler3D; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_sampler; +static PyObject *__pyx_kp_s_self_func_self_jac_cannot_be_con; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_super; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_test_hex20_sampler; static PyObject *__pyx_n_s_test_hex_sampler; +static PyObject *__pyx_n_s_test_linear1D_sampler; +static PyObject *__pyx_n_s_test_quad2_sampler; static PyObject *__pyx_n_s_test_quad_sampler; +static PyObject *__pyx_n_s_test_tet2_sampler; static PyObject *__pyx_n_s_test_tetra_sampler; +static PyObject *__pyx_n_s_test_tri2_sampler; static PyObject *__pyx_n_s_test_tri_sampler; static PyObject *__pyx_n_s_test_wedge_sampler; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_val; static PyObject *__pyx_n_s_vertices; -static PyObject *__pyx_n_s_yt_utilities_lib_element_mapping; +static PyObject *__pyx_kp_s_yt_utilities_lib_element_mapping; +static PyObject *__pyx_n_s_yt_utilities_lib_element_mapping_2; static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_14ElementSampler___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_14ElementSampler_2__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_14ElementSampler_4__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_2__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_4__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_2__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_4__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_2__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_4__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_test_hex_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_2test_hex20_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_4test_tetra_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_6test_wedge_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_8test_tri_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_10test_quad_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_8test_linear1D_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_10test_tri_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_12test_quad_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_14test_quad2_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_16test_tri2_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_18test_tet2_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_20__pyx_unpickle_ElementSampler(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_2yt_9utilities_3lib_16element_mappings_22__pyx_unpickle_P1Sampler1D(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_2yt_9utilities_3lib_16element_mappings_24__pyx_unpickle_P1Sampler2D(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_2yt_9utilities_3lib_16element_mappings_26__pyx_unpickle_P1Sampler3D(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 PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_ElementSampler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_P1Sampler1D(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_P1Sampler2D(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_P1Sampler3D(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -1852,6 +2173,10 @@ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_S2Sampler3D(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_T2Sampler2D(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_171418803; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; @@ -1862,19 +2187,53 @@ static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; 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_codeobj__11; -static PyObject *__pyx_codeobj__13; -static PyObject *__pyx_codeobj__15; -static PyObject *__pyx_codeobj__17; -static PyObject *__pyx_codeobj__19; -static PyObject *__pyx_codeobj__21; +static PyObject *__pyx_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__30; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_codeobj__29; +static PyObject *__pyx_codeobj__31; +static PyObject *__pyx_codeobj__33; +static PyObject *__pyx_codeobj__35; +static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__43; +static PyObject *__pyx_codeobj__45; +static PyObject *__pyx_codeobj__47; +static PyObject *__pyx_codeobj__49; +static PyObject *__pyx_codeobj__51; +static PyObject *__pyx_codeobj__53; +static PyObject *__pyx_codeobj__55; -/* "yt/utilities/lib/element_mappings.pyx":29 +/* "yt/utilities/lib/element_mappings.pyx":42 * @cython.wraparound(False) * @cython.cdivision(True) * cdef double determinant_3x3(double* col0, # <<<<<<<<<<<<<< @@ -1885,7 +2244,7 @@ static double __pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(double *__pyx_v_col0, double *__pyx_v_col1, double *__pyx_v_col2) { double __pyx_r; - /* "yt/utilities/lib/element_mappings.pyx":34 + /* "yt/utilities/lib/element_mappings.pyx":47 * return col0[0]*col1[1]*col2[2] - col0[0]*col1[2]*col2[1] - \ * col0[1]*col1[0]*col2[2] + col0[1]*col1[2]*col2[0] + \ * col0[2]*col1[0]*col2[1] - col0[2]*col1[1]*col2[0] # <<<<<<<<<<<<<< @@ -1895,7 +2254,7 @@ __pyx_r = ((((((((__pyx_v_col0[0]) * (__pyx_v_col1[1])) * (__pyx_v_col2[2])) - (((__pyx_v_col0[0]) * (__pyx_v_col1[2])) * (__pyx_v_col2[1]))) - (((__pyx_v_col0[1]) * (__pyx_v_col1[0])) * (__pyx_v_col2[2]))) + (((__pyx_v_col0[1]) * (__pyx_v_col1[2])) * (__pyx_v_col2[0]))) + (((__pyx_v_col0[2]) * (__pyx_v_col1[0])) * (__pyx_v_col2[1]))) - (((__pyx_v_col0[2]) * (__pyx_v_col1[1])) * (__pyx_v_col2[0]))); goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":29 + /* "yt/utilities/lib/element_mappings.pyx":42 * @cython.wraparound(False) * @cython.cdivision(True) * cdef double determinant_3x3(double* col0, # <<<<<<<<<<<<<< @@ -1908,7 +2267,7 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":40 +/* "yt/utilities/lib/element_mappings.pyx":53 * @cython.wraparound(False) * @cython.cdivision(True) * cdef double maxnorm(double* f, int dim) nogil: # <<<<<<<<<<<<<< @@ -1923,7 +2282,7 @@ int __pyx_t_1; int __pyx_t_2; - /* "yt/utilities/lib/element_mappings.pyx":43 + /* "yt/utilities/lib/element_mappings.pyx":56 * cdef double err * cdef int i * err = fabs(f[0]) # <<<<<<<<<<<<<< @@ -1932,7 +2291,7 @@ */ __pyx_v_err = fabs((__pyx_v_f[0])); - /* "yt/utilities/lib/element_mappings.pyx":44 + /* "yt/utilities/lib/element_mappings.pyx":57 * cdef int i * err = fabs(f[0]) * for i in range(1, dim): # <<<<<<<<<<<<<< @@ -1943,7 +2302,7 @@ for (__pyx_t_2 = 1; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/element_mappings.pyx":45 + /* "yt/utilities/lib/element_mappings.pyx":58 * err = fabs(f[0]) * for i in range(1, dim): * err = fmax(err, fabs(f[i])) # <<<<<<<<<<<<<< @@ -1953,7 +2312,7 @@ __pyx_v_err = fmax(__pyx_v_err, fabs((__pyx_v_f[__pyx_v_i]))); } - /* "yt/utilities/lib/element_mappings.pyx":46 + /* "yt/utilities/lib/element_mappings.pyx":59 * for i in range(1, dim): * err = fmax(err, fabs(f[i])) * return err # <<<<<<<<<<<<<< @@ -1963,7 +2322,7 @@ __pyx_r = __pyx_v_err; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":40 + /* "yt/utilities/lib/element_mappings.pyx":53 * @cython.wraparound(False) * @cython.cdivision(True) * cdef double maxnorm(double* f, int dim) nogil: # <<<<<<<<<<<<<< @@ -1976,7 +2335,7 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":60 +/* "yt/utilities/lib/element_mappings.pyx":73 * ''' * * def __init__(self): # <<<<<<<<<<<<<< @@ -2005,7 +2364,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/utilities/lib/element_mappings.pyx":61 + /* "yt/utilities/lib/element_mappings.pyx":74 * * def __init__(self): * self.inclusion_tol = 1.0e-8 # <<<<<<<<<<<<<< @@ -2014,7 +2373,7 @@ */ __pyx_v_self->inclusion_tol = 1.0e-8; - /* "yt/utilities/lib/element_mappings.pyx":60 + /* "yt/utilities/lib/element_mappings.pyx":73 * ''' * * def __init__(self): # <<<<<<<<<<<<<< @@ -2028,7 +2387,7 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":66 +/* "yt/utilities/lib/element_mappings.pyx":79 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void map_real_to_unit(self, # <<<<<<<<<<<<<< @@ -2041,7 +2400,7 @@ /* function exit code */ } -/* "yt/utilities/lib/element_mappings.pyx":75 +/* "yt/utilities/lib/element_mappings.pyx":88 * @cython.wraparound(False) * @cython.cdivision(True) * cdef double sample_at_unit_point(self, # <<<<<<<<<<<<<< @@ -2057,7 +2416,7 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":83 +/* "yt/utilities/lib/element_mappings.pyx":96 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< @@ -2073,7 +2432,7 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":89 +/* "yt/utilities/lib/element_mappings.pyx":102 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< @@ -2089,7 +2448,7 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":95 +/* "yt/utilities/lib/element_mappings.pyx":108 * @cython.wraparound(False) * @cython.cdivision(True) * cdef double sample_at_real_point(self, # <<<<<<<<<<<<<< @@ -2102,7 +2461,7 @@ double __pyx_v_mapped_coord[4]; double __pyx_r; - /* "yt/utilities/lib/element_mappings.pyx":102 + /* "yt/utilities/lib/element_mappings.pyx":115 * cdef double mapped_coord[4] * * self.map_real_to_unit(mapped_coord, vertices, physical_x) # <<<<<<<<<<<<<< @@ -2111,7 +2470,7 @@ */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_self->__pyx_vtab)->map_real_to_unit(__pyx_v_self, __pyx_v_mapped_coord, __pyx_v_vertices, __pyx_v_physical_x); - /* "yt/utilities/lib/element_mappings.pyx":103 + /* "yt/utilities/lib/element_mappings.pyx":116 * * self.map_real_to_unit(mapped_coord, vertices, physical_x) * val = self.sample_at_unit_point(mapped_coord, field_values) # <<<<<<<<<<<<<< @@ -2120,7 +2479,7 @@ */ __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_self->__pyx_vtab)->sample_at_unit_point(__pyx_v_self, __pyx_v_mapped_coord, __pyx_v_field_values); - /* "yt/utilities/lib/element_mappings.pyx":104 + /* "yt/utilities/lib/element_mappings.pyx":117 * self.map_real_to_unit(mapped_coord, vertices, physical_x) * val = self.sample_at_unit_point(mapped_coord, field_values) * return val # <<<<<<<<<<<<<< @@ -2130,7 +2489,7 @@ __pyx_r = __pyx_v_val; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":95 + /* "yt/utilities/lib/element_mappings.pyx":108 * @cython.wraparound(False) * @cython.cdivision(True) * cdef double sample_at_real_point(self, # <<<<<<<<<<<<<< @@ -2143,253 +2502,434 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":115 - * ''' - * - * def __init__(self): # <<<<<<<<<<<<<< - * super(P1Sampler2D, self).__init__() - * self.num_mapped_coords = 3 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) */ /* Python wrapper */ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_14ElementSampler_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_14ElementSampler_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} - if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *)__pyx_v_self)); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_14ElementSampler_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self) { - int __pyx_r; +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_14ElementSampler_2__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__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; - __Pyx_RefNannySetupContext("__init__", 0); + int __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "yt/utilities/lib/element_mappings.pyx":116 - * - * def __init__(self): - * super(P1Sampler2D, self).__init__() # <<<<<<<<<<<<<< - * self.num_mapped_coords = 3 - * + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->inclusion_tol); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->num_mapped_coords); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); 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_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - 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); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __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_v_state = __pyx_t_3; + __pyx_t_3 = 0; - /* "yt/utilities/lib/element_mappings.pyx":117 - * def __init__(self): - * super(P1Sampler2D, self).__init__() - * self.num_mapped_coords = 3 # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, */ - __pyx_v_self->__pyx_base.num_mapped_coords = 3; + __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v__dict = __pyx_t_3; + __pyx_t_3 = 0; - /* "yt/utilities/lib/element_mappings.pyx":115 - * ''' - * - * def __init__(self): # <<<<<<<<<<<<<< - * super(P1Sampler2D, self).__init__() - * self.num_mapped_coords = 3 + /* "(tree fragment)":5 + * state = (self.inclusion_tol, self.num_mapped_coords) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_4 = (__pyx_v__dict != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.P1Sampler2D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; -/* "yt/utilities/lib/element_mappings.pyx":123 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef void map_real_to_unit(self, double* mapped_x, # <<<<<<<<<<<<<< - * double* vertices, double* physical_x) nogil: - * + /* "(tree fragment)":5 + * state = (self.inclusion_tol, self.num_mapped_coords) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ + goto __pyx_L3; + } -static void __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_map_real_to_unit(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self, double *__pyx_v_mapped_x, double *__pyx_v_vertices, double *__pyx_v_physical_x) { - double __pyx_v_col0[3]; - double __pyx_v_col1[3]; - double __pyx_v_col2[3]; - double __pyx_v_det; + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_ElementSampler, (type(self), 0xa37a4b3, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; - /* "yt/utilities/lib/element_mappings.pyx":130 - * cdef double[3] col2 - * - * col0[0] = vertices[0] # <<<<<<<<<<<<<< - * col0[1] = vertices[1] - * col0[2] = 1.0 + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_ElementSampler, (type(self), 0xa37a4b3, None), state + * else: */ - (__pyx_v_col0[0]) = (__pyx_v_vertices[0]); + __pyx_t_5 = (__pyx_v_use_setstate != 0); + if (__pyx_t_5) { - /* "yt/utilities/lib/element_mappings.pyx":131 - * - * col0[0] = vertices[0] - * col0[1] = vertices[1] # <<<<<<<<<<<<<< - * col0[2] = 1.0 - * + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_ElementSampler, (type(self), 0xa37a4b3, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_ElementSampler, (type(self), 0xa37a4b3, state) */ - (__pyx_v_col0[1]) = (__pyx_v_vertices[1]); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_ElementSampler); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_171418803); + __Pyx_GIVEREF(__pyx_int_171418803); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_171418803); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":132 - * col0[0] = vertices[0] - * col0[1] = vertices[1] - * col0[2] = 1.0 # <<<<<<<<<<<<<< - * - * col1[0] = vertices[2] + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_ElementSampler, (type(self), 0xa37a4b3, None), state + * else: */ - (__pyx_v_col0[2]) = 1.0; + } - /* "yt/utilities/lib/element_mappings.pyx":134 - * col0[2] = 1.0 - * - * col1[0] = vertices[2] # <<<<<<<<<<<<<< - * col1[1] = vertices[3] - * col1[2] = 1.0 + /* "(tree fragment)":13 + * return __pyx_unpickle_ElementSampler, (type(self), 0xa37a4b3, None), state + * else: + * return __pyx_unpickle_ElementSampler, (type(self), 0xa37a4b3, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_ElementSampler__set_state(self, __pyx_state) */ - (__pyx_v_col1[0]) = (__pyx_v_vertices[2]); + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_ElementSampler); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_171418803); + __Pyx_GIVEREF(__pyx_int_171418803); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_171418803); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } - /* "yt/utilities/lib/element_mappings.pyx":135 - * - * col1[0] = vertices[2] - * col1[1] = vertices[3] # <<<<<<<<<<<<<< - * col1[2] = 1.0 - * + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) */ - (__pyx_v_col1[1]) = (__pyx_v_vertices[3]); - /* "yt/utilities/lib/element_mappings.pyx":136 - * col1[0] = vertices[2] - * col1[1] = vertices[3] - * col1[2] = 1.0 # <<<<<<<<<<<<<< - * - * col2[0] = vertices[4] + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.ElementSampler.__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_ElementSampler, (type(self), 0xa37a4b3, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_ElementSampler__set_state(self, __pyx_state) */ - (__pyx_v_col1[2]) = 1.0; - /* "yt/utilities/lib/element_mappings.pyx":138 - * col1[2] = 1.0 - * - * col2[0] = vertices[4] # <<<<<<<<<<<<<< - * col2[1] = vertices[5] - * col2[2] = 1.0 +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_14ElementSampler_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_14ElementSampler_5__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_2yt_9utilities_3lib_16element_mappings_14ElementSampler_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_14ElementSampler_4__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__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_ElementSampler, (type(self), 0xa37a4b3, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_ElementSampler__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - (__pyx_v_col2[0]) = (__pyx_v_vertices[4]); + 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_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_ElementSampler__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; - /* "yt/utilities/lib/element_mappings.pyx":139 - * - * col2[0] = vertices[4] - * col2[1] = vertices[5] # <<<<<<<<<<<<<< - * col2[2] = 1.0 - * + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_ElementSampler, (type(self), 0xa37a4b3, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_ElementSampler__set_state(self, __pyx_state) */ - (__pyx_v_col2[1]) = (__pyx_v_vertices[5]); - /* "yt/utilities/lib/element_mappings.pyx":140 - * col2[0] = vertices[4] - * col2[1] = vertices[5] - * col2[2] = 1.0 # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.ElementSampler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":127 + * ''' * - * det = determinant_3x3(col0, col1, col2) + * def __init__(self): # <<<<<<<<<<<<<< + * super(P1Sampler1D, self).__init__() + * self.num_mapped_coords = 1 */ - (__pyx_v_col2[2]) = 1.0; - /* "yt/utilities/lib/element_mappings.pyx":142 - * col2[2] = 1.0 +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "yt/utilities/lib/element_mappings.pyx":128 * - * det = determinant_3x3(col0, col1, col2) # <<<<<<<<<<<<<< + * def __init__(self): + * super(P1Sampler1D, self).__init__() # <<<<<<<<<<<<<< + * self.num_mapped_coords = 1 * - * mapped_x[0] = ((vertices[3] - vertices[5])*physical_x[0] + \ */ - __pyx_v_det = __pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_col0, __pyx_v_col1, __pyx_v_col2); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/element_mappings.pyx":144 - * det = determinant_3x3(col0, col1, col2) + /* "yt/utilities/lib/element_mappings.pyx":129 + * def __init__(self): + * super(P1Sampler1D, self).__init__() + * self.num_mapped_coords = 1 # <<<<<<<<<<<<<< * - * mapped_x[0] = ((vertices[3] - vertices[5])*physical_x[0] + \ # <<<<<<<<<<<<<< - * (vertices[4] - vertices[2])*physical_x[1] + \ - * (vertices[2]*vertices[5] - vertices[4]*vertices[3])) / det + * @cython.boundscheck(False) */ - (__pyx_v_mapped_x[0]) = ((((((__pyx_v_vertices[3]) - (__pyx_v_vertices[5])) * (__pyx_v_physical_x[0])) + (((__pyx_v_vertices[4]) - (__pyx_v_vertices[2])) * (__pyx_v_physical_x[1]))) + (((__pyx_v_vertices[2]) * (__pyx_v_vertices[5])) - ((__pyx_v_vertices[4]) * (__pyx_v_vertices[3])))) / __pyx_v_det); + __pyx_v_self->__pyx_base.num_mapped_coords = 1; - /* "yt/utilities/lib/element_mappings.pyx":148 - * (vertices[2]*vertices[5] - vertices[4]*vertices[3])) / det + /* "yt/utilities/lib/element_mappings.pyx":127 + * ''' * - * mapped_x[1] = ((vertices[5] - vertices[1])*physical_x[0] + \ # <<<<<<<<<<<<<< - * (vertices[0] - vertices[4])*physical_x[1] + \ - * (vertices[4]*vertices[1] - vertices[0]*vertices[5])) / det + * def __init__(self): # <<<<<<<<<<<<<< + * super(P1Sampler1D, self).__init__() + * self.num_mapped_coords = 1 */ - (__pyx_v_mapped_x[1]) = ((((((__pyx_v_vertices[5]) - (__pyx_v_vertices[1])) * (__pyx_v_physical_x[0])) + (((__pyx_v_vertices[0]) - (__pyx_v_vertices[4])) * (__pyx_v_physical_x[1]))) + (((__pyx_v_vertices[4]) * (__pyx_v_vertices[1])) - ((__pyx_v_vertices[0]) * (__pyx_v_vertices[5])))) / __pyx_v_det); - /* "yt/utilities/lib/element_mappings.pyx":152 - * (vertices[4]*vertices[1] - vertices[0]*vertices[5])) / det - * - * mapped_x[2] = 1.0 - mapped_x[1] - mapped_x[0] # <<<<<<<<<<<<<< - * + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.P1Sampler1D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":134 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void map_real_to_unit(self, double* mapped_x, # <<<<<<<<<<<<<< + * double* vertices, double* physical_x) nogil: + * mapped_x[0] = -1.0 + 2.0*(physical_x[0] - vertices[0]) / (vertices[1] - vertices[0]) + */ + +static void __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_map_real_to_unit(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_v_self, double *__pyx_v_mapped_x, double *__pyx_v_vertices, double *__pyx_v_physical_x) { + + /* "yt/utilities/lib/element_mappings.pyx":136 + * cdef void map_real_to_unit(self, double* mapped_x, + * double* vertices, double* physical_x) nogil: + * mapped_x[0] = -1.0 + 2.0*(physical_x[0] - vertices[0]) / (vertices[1] - vertices[0]) # <<<<<<<<<<<<<< * + * @cython.boundscheck(False) */ - (__pyx_v_mapped_x[2]) = ((1.0 - (__pyx_v_mapped_x[1])) - (__pyx_v_mapped_x[0])); + (__pyx_v_mapped_x[0]) = (-1.0 + ((2.0 * ((__pyx_v_physical_x[0]) - (__pyx_v_vertices[0]))) / ((__pyx_v_vertices[1]) - (__pyx_v_vertices[0])))); - /* "yt/utilities/lib/element_mappings.pyx":123 + /* "yt/utilities/lib/element_mappings.pyx":134 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void map_real_to_unit(self, double* mapped_x, # <<<<<<<<<<<<<< * double* vertices, double* physical_x) nogil: - * + * mapped_x[0] = -1.0 + 2.0*(physical_x[0] - vertices[0]) / (vertices[1] - vertices[0]) */ /* function exit code */ } -/* "yt/utilities/lib/element_mappings.pyx":158 +/* "yt/utilities/lib/element_mappings.pyx":141 * @cython.wraparound(False) * @cython.cdivision(True) * cdef double sample_at_unit_point(self, # <<<<<<<<<<<<<< @@ -2397,20 +2937,20 @@ * double* vals) nogil: */ -static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { double __pyx_r; - /* "yt/utilities/lib/element_mappings.pyx":161 + /* "yt/utilities/lib/element_mappings.pyx":144 * double* coord, * double* vals) nogil: - * return vals[0]*coord[0] + vals[1]*coord[1] + vals[2]*coord[2] # <<<<<<<<<<<<<< + * return vals[0] * (1 - coord[0]) / 2.0 + vals[1] * (1.0 + coord[0]) / 2.0 # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_r = ((((__pyx_v_vals[0]) * (__pyx_v_coord[0])) + ((__pyx_v_vals[1]) * (__pyx_v_coord[1]))) + ((__pyx_v_vals[2]) * (__pyx_v_coord[2]))); + __pyx_r = ((((__pyx_v_vals[0]) * (1.0 - (__pyx_v_coord[0]))) / 2.0) + (((__pyx_v_vals[1]) * (1.0 + (__pyx_v_coord[0]))) / 2.0)); goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":158 + /* "yt/utilities/lib/element_mappings.pyx":141 * @cython.wraparound(False) * @cython.cdivision(True) * cdef double sample_at_unit_point(self, # <<<<<<<<<<<<<< @@ -2423,88 +2963,50 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":166 +/* "yt/utilities/lib/element_mappings.pyx":149 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * # for triangles, we check whether all mapped_coords are - * # between 0 and 1, to within the inclusion tolerance + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol): + * return 0 */ -static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self, double *__pyx_v_mapped_coord) { - int __pyx_v_i; +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_v_self, double *__pyx_v_mapped_coord) { int __pyx_r; int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - /* "yt/utilities/lib/element_mappings.pyx":170 - * # between 0 and 1, to within the inclusion tolerance - * cdef int i - * for i in range(3): # <<<<<<<<<<<<<< - * if (mapped_coord[i] < -self.inclusion_tol or - * mapped_coord[i] - 1.0 > self.inclusion_tol): + /* "yt/utilities/lib/element_mappings.pyx":150 + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 + * return 1 */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + __pyx_t_1 = (((fabs((__pyx_v_mapped_coord[0])) - 1.0) > __pyx_v_self->__pyx_base.inclusion_tol) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/element_mappings.pyx":171 - * cdef int i - * for i in range(3): - * if (mapped_coord[i] < -self.inclusion_tol or # <<<<<<<<<<<<<< - * mapped_coord[i] - 1.0 > self.inclusion_tol): - * return 0 + /* "yt/utilities/lib/element_mappings.pyx":151 + * cdef int check_inside(self, double* mapped_coord) nogil: + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol): + * return 0 # <<<<<<<<<<<<<< + * return 1 + * */ - __pyx_t_3 = (((__pyx_v_mapped_coord[__pyx_v_i]) < (-__pyx_v_self->__pyx_base.inclusion_tol)) != 0); - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L6_bool_binop_done; - } - - /* "yt/utilities/lib/element_mappings.pyx":172 - * for i in range(3): - * if (mapped_coord[i] < -self.inclusion_tol or - * mapped_coord[i] - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< - * return 0 - * return 1 - */ - __pyx_t_3 = ((((__pyx_v_mapped_coord[__pyx_v_i]) - 1.0) > __pyx_v_self->__pyx_base.inclusion_tol) != 0); - __pyx_t_2 = __pyx_t_3; - __pyx_L6_bool_binop_done:; - - /* "yt/utilities/lib/element_mappings.pyx":171 - * cdef int i - * for i in range(3): - * if (mapped_coord[i] < -self.inclusion_tol or # <<<<<<<<<<<<<< - * mapped_coord[i] - 1.0 > self.inclusion_tol): - * return 0 - */ - if (__pyx_t_2) { + __pyx_r = 0; + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":173 - * if (mapped_coord[i] < -self.inclusion_tol or - * mapped_coord[i] - 1.0 > self.inclusion_tol): - * return 0 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":150 + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 * return 1 - * - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "yt/utilities/lib/element_mappings.pyx":171 - * cdef int i - * for i in range(3): - * if (mapped_coord[i] < -self.inclusion_tol or # <<<<<<<<<<<<<< - * mapped_coord[i] - 1.0 > self.inclusion_tol): - * return 0 */ - } } - /* "yt/utilities/lib/element_mappings.pyx":174 - * mapped_coord[i] - 1.0 > self.inclusion_tol): - * return 0 + /* "yt/utilities/lib/element_mappings.pyx":152 + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol): + * return 0 * return 1 # <<<<<<<<<<<<<< * * @@ -2512,12 +3014,12 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":166 + /* "yt/utilities/lib/element_mappings.pyx":149 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * # for triangles, we check whether all mapped_coords are - * # between 0 and 1, to within the inclusion tolerance + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol): + * return 0 */ /* function exit code */ @@ -2525,31 +3027,324 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":186 - * +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_3__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_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_2__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__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; + int __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.inclusion_tol); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.num_mapped_coords); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __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_v_state = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, + */ + __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v__dict = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":5 + * state = (self.inclusion_tol, self.num_mapped_coords) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_4 = (__pyx_v__dict != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 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.inclusion_tol, self.num_mapped_coords) + * _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_P1Sampler1D, (type(self), 0xa37a4b3, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_P1Sampler1D, (type(self), 0xa37a4b3, None), state + * else: + */ + __pyx_t_5 = (__pyx_v_use_setstate != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_P1Sampler1D, (type(self), 0xa37a4b3, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_P1Sampler1D, (type(self), 0xa37a4b3, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_P1Sampler1D); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_171418803); + __Pyx_GIVEREF(__pyx_int_171418803); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_171418803); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_P1Sampler1D, (type(self), 0xa37a4b3, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_P1Sampler1D, (type(self), 0xa37a4b3, None), state + * else: + * return __pyx_unpickle_P1Sampler1D, (type(self), 0xa37a4b3, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_P1Sampler1D__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_P1Sampler1D); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_171418803); + __Pyx_GIVEREF(__pyx_int_171418803); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_171418803); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.P1Sampler1D.__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_P1Sampler1D, (type(self), 0xa37a4b3, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_P1Sampler1D__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_5__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_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_4__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__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_P1Sampler1D, (type(self), 0xa37a4b3, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_P1Sampler1D__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_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_P1Sampler1D__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_P1Sampler1D, (type(self), 0xa37a4b3, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_P1Sampler1D__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("yt.utilities.lib.element_mappings.P1Sampler1D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":164 + * ''' * * def __init__(self): # <<<<<<<<<<<<<< - * super(P1Sampler3D, self).__init__() - * self.num_mapped_coords = 4 + * super(P1Sampler2D, self).__init__() + * self.num_mapped_coords = 3 */ /* Python wrapper */ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *)__pyx_v_self)); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self) { +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -2557,25 +3352,25 @@ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/utilities/lib/element_mappings.pyx":187 + /* "yt/utilities/lib/element_mappings.pyx":165 * * def __init__(self): - * super(P1Sampler3D, self).__init__() # <<<<<<<<<<<<<< - * self.num_mapped_coords = 4 + * super(P1Sampler2D, self).__init__() # <<<<<<<<<<<<<< + * self.num_mapped_coords = 3 * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)); + __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -2589,30 +3384,30 @@ } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/element_mappings.pyx":188 + /* "yt/utilities/lib/element_mappings.pyx":166 * def __init__(self): - * super(P1Sampler3D, self).__init__() - * self.num_mapped_coords = 4 # <<<<<<<<<<<<<< + * super(P1Sampler2D, self).__init__() + * self.num_mapped_coords = 3 # <<<<<<<<<<<<<< + * * - * @cython.boundscheck(False) */ - __pyx_v_self->__pyx_base.num_mapped_coords = 4; + __pyx_v_self->__pyx_base.num_mapped_coords = 3; - /* "yt/utilities/lib/element_mappings.pyx":186 - * + /* "yt/utilities/lib/element_mappings.pyx":164 + * ''' * * def __init__(self): # <<<<<<<<<<<<<< - * super(P1Sampler3D, self).__init__() - * self.num_mapped_coords = 4 + * super(P1Sampler2D, self).__init__() + * self.num_mapped_coords = 3 */ /* function exit code */ @@ -2622,14 +3417,14 @@ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.P1Sampler3D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.P1Sampler2D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":193 +/* "yt/utilities/lib/element_mappings.pyx":172 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void map_real_to_unit(self, double* mapped_x, # <<<<<<<<<<<<<< @@ -2637,108 +3432,130 @@ * */ -static void __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_map_real_to_unit(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_x, double *__pyx_v_vertices, double *__pyx_v_physical_x) { - int __pyx_v_i; - double __pyx_v_d; - double __pyx_v_bvec[3]; +static void __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_map_real_to_unit(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self, double *__pyx_v_mapped_x, double *__pyx_v_vertices, double *__pyx_v_physical_x) { double __pyx_v_col0[3]; double __pyx_v_col1[3]; double __pyx_v_col2[3]; - int __pyx_t_1; + double __pyx_v_det; - /* "yt/utilities/lib/element_mappings.pyx":205 - * # here, we express positions relative to the 4th element, - * # which is selected by vertices[9] - * for i in range(3): # <<<<<<<<<<<<<< - * bvec[i] = physical_x[i] - vertices[9 + i] - * col0[i] = vertices[0 + i] - vertices[9 + i] + /* "yt/utilities/lib/element_mappings.pyx":179 + * cdef double[3] col2 + * + * col0[0] = vertices[0] # <<<<<<<<<<<<<< + * col0[1] = vertices[1] + * col0[2] = 1.0 */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + (__pyx_v_col0[0]) = (__pyx_v_vertices[0]); - /* "yt/utilities/lib/element_mappings.pyx":206 - * # which is selected by vertices[9] - * for i in range(3): - * bvec[i] = physical_x[i] - vertices[9 + i] # <<<<<<<<<<<<<< - * col0[i] = vertices[0 + i] - vertices[9 + i] - * col1[i] = vertices[3 + i] - vertices[9 + i] + /* "yt/utilities/lib/element_mappings.pyx":180 + * + * col0[0] = vertices[0] + * col0[1] = vertices[1] # <<<<<<<<<<<<<< + * col0[2] = 1.0 + * */ - (__pyx_v_bvec[__pyx_v_i]) = ((__pyx_v_physical_x[__pyx_v_i]) - (__pyx_v_vertices[(9 + __pyx_v_i)])); + (__pyx_v_col0[1]) = (__pyx_v_vertices[1]); - /* "yt/utilities/lib/element_mappings.pyx":207 - * for i in range(3): - * bvec[i] = physical_x[i] - vertices[9 + i] - * col0[i] = vertices[0 + i] - vertices[9 + i] # <<<<<<<<<<<<<< - * col1[i] = vertices[3 + i] - vertices[9 + i] - * col2[i] = vertices[6 + i] - vertices[9 + i] + /* "yt/utilities/lib/element_mappings.pyx":181 + * col0[0] = vertices[0] + * col0[1] = vertices[1] + * col0[2] = 1.0 # <<<<<<<<<<<<<< + * + * col1[0] = vertices[2] */ - (__pyx_v_col0[__pyx_v_i]) = ((__pyx_v_vertices[(0 + __pyx_v_i)]) - (__pyx_v_vertices[(9 + __pyx_v_i)])); + (__pyx_v_col0[2]) = 1.0; - /* "yt/utilities/lib/element_mappings.pyx":208 - * bvec[i] = physical_x[i] - vertices[9 + i] - * col0[i] = vertices[0 + i] - vertices[9 + i] - * col1[i] = vertices[3 + i] - vertices[9 + i] # <<<<<<<<<<<<<< - * col2[i] = vertices[6 + i] - vertices[9 + i] + /* "yt/utilities/lib/element_mappings.pyx":183 + * col0[2] = 1.0 * + * col1[0] = vertices[2] # <<<<<<<<<<<<<< + * col1[1] = vertices[3] + * col1[2] = 1.0 */ - (__pyx_v_col1[__pyx_v_i]) = ((__pyx_v_vertices[(3 + __pyx_v_i)]) - (__pyx_v_vertices[(9 + __pyx_v_i)])); + (__pyx_v_col1[0]) = (__pyx_v_vertices[2]); - /* "yt/utilities/lib/element_mappings.pyx":209 - * col0[i] = vertices[0 + i] - vertices[9 + i] - * col1[i] = vertices[3 + i] - vertices[9 + i] - * col2[i] = vertices[6 + i] - vertices[9 + i] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":184 + * + * col1[0] = vertices[2] + * col1[1] = vertices[3] # <<<<<<<<<<<<<< + * col1[2] = 1.0 * - * d = determinant_3x3(col0, col1, col2) */ - (__pyx_v_col2[__pyx_v_i]) = ((__pyx_v_vertices[(6 + __pyx_v_i)]) - (__pyx_v_vertices[(9 + __pyx_v_i)])); - } + (__pyx_v_col1[1]) = (__pyx_v_vertices[3]); - /* "yt/utilities/lib/element_mappings.pyx":211 - * col2[i] = vertices[6 + i] - vertices[9 + i] + /* "yt/utilities/lib/element_mappings.pyx":185 + * col1[0] = vertices[2] + * col1[1] = vertices[3] + * col1[2] = 1.0 # <<<<<<<<<<<<<< * - * d = determinant_3x3(col0, col1, col2) # <<<<<<<<<<<<<< - * mapped_x[0] = determinant_3x3(bvec, col1, col2)/d - * mapped_x[1] = determinant_3x3(col0, bvec, col2)/d + * col2[0] = vertices[4] */ - __pyx_v_d = __pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_col0, __pyx_v_col1, __pyx_v_col2); + (__pyx_v_col1[2]) = 1.0; - /* "yt/utilities/lib/element_mappings.pyx":212 + /* "yt/utilities/lib/element_mappings.pyx":187 + * col1[2] = 1.0 * - * d = determinant_3x3(col0, col1, col2) - * mapped_x[0] = determinant_3x3(bvec, col1, col2)/d # <<<<<<<<<<<<<< - * mapped_x[1] = determinant_3x3(col0, bvec, col2)/d - * mapped_x[2] = determinant_3x3(col0, col1, bvec)/d + * col2[0] = vertices[4] # <<<<<<<<<<<<<< + * col2[1] = vertices[5] + * col2[2] = 1.0 */ - (__pyx_v_mapped_x[0]) = (__pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_bvec, __pyx_v_col1, __pyx_v_col2) / __pyx_v_d); + (__pyx_v_col2[0]) = (__pyx_v_vertices[4]); - /* "yt/utilities/lib/element_mappings.pyx":213 - * d = determinant_3x3(col0, col1, col2) - * mapped_x[0] = determinant_3x3(bvec, col1, col2)/d - * mapped_x[1] = determinant_3x3(col0, bvec, col2)/d # <<<<<<<<<<<<<< - * mapped_x[2] = determinant_3x3(col0, col1, bvec)/d - * mapped_x[3] = 1.0 - mapped_x[0] - mapped_x[1] - mapped_x[2] + /* "yt/utilities/lib/element_mappings.pyx":188 + * + * col2[0] = vertices[4] + * col2[1] = vertices[5] # <<<<<<<<<<<<<< + * col2[2] = 1.0 + * */ - (__pyx_v_mapped_x[1]) = (__pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_col0, __pyx_v_bvec, __pyx_v_col2) / __pyx_v_d); + (__pyx_v_col2[1]) = (__pyx_v_vertices[5]); - /* "yt/utilities/lib/element_mappings.pyx":214 - * mapped_x[0] = determinant_3x3(bvec, col1, col2)/d - * mapped_x[1] = determinant_3x3(col0, bvec, col2)/d - * mapped_x[2] = determinant_3x3(col0, col1, bvec)/d # <<<<<<<<<<<<<< - * mapped_x[3] = 1.0 - mapped_x[0] - mapped_x[1] - mapped_x[2] + /* "yt/utilities/lib/element_mappings.pyx":189 + * col2[0] = vertices[4] + * col2[1] = vertices[5] + * col2[2] = 1.0 # <<<<<<<<<<<<<< * + * det = determinant_3x3(col0, col1, col2) */ - (__pyx_v_mapped_x[2]) = (__pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_col0, __pyx_v_col1, __pyx_v_bvec) / __pyx_v_d); + (__pyx_v_col2[2]) = 1.0; - /* "yt/utilities/lib/element_mappings.pyx":215 - * mapped_x[1] = determinant_3x3(col0, bvec, col2)/d - * mapped_x[2] = determinant_3x3(col0, col1, bvec)/d - * mapped_x[3] = 1.0 - mapped_x[0] - mapped_x[1] - mapped_x[2] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":191 + * col2[2] = 1.0 * - * @cython.boundscheck(False) + * det = determinant_3x3(col0, col1, col2) # <<<<<<<<<<<<<< + * + * mapped_x[0] = ((vertices[3] - vertices[5])*physical_x[0] + \ */ - (__pyx_v_mapped_x[3]) = (((1.0 - (__pyx_v_mapped_x[0])) - (__pyx_v_mapped_x[1])) - (__pyx_v_mapped_x[2])); + __pyx_v_det = __pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_col0, __pyx_v_col1, __pyx_v_col2); /* "yt/utilities/lib/element_mappings.pyx":193 + * det = determinant_3x3(col0, col1, col2) + * + * mapped_x[0] = ((vertices[3] - vertices[5])*physical_x[0] + \ # <<<<<<<<<<<<<< + * (vertices[4] - vertices[2])*physical_x[1] + \ + * (vertices[2]*vertices[5] - vertices[4]*vertices[3])) / det + */ + (__pyx_v_mapped_x[0]) = ((((((__pyx_v_vertices[3]) - (__pyx_v_vertices[5])) * (__pyx_v_physical_x[0])) + (((__pyx_v_vertices[4]) - (__pyx_v_vertices[2])) * (__pyx_v_physical_x[1]))) + (((__pyx_v_vertices[2]) * (__pyx_v_vertices[5])) - ((__pyx_v_vertices[4]) * (__pyx_v_vertices[3])))) / __pyx_v_det); + + /* "yt/utilities/lib/element_mappings.pyx":197 + * (vertices[2]*vertices[5] - vertices[4]*vertices[3])) / det + * + * mapped_x[1] = ((vertices[5] - vertices[1])*physical_x[0] + \ # <<<<<<<<<<<<<< + * (vertices[0] - vertices[4])*physical_x[1] + \ + * (vertices[4]*vertices[1] - vertices[0]*vertices[5])) / det + */ + (__pyx_v_mapped_x[1]) = ((((((__pyx_v_vertices[5]) - (__pyx_v_vertices[1])) * (__pyx_v_physical_x[0])) + (((__pyx_v_vertices[0]) - (__pyx_v_vertices[4])) * (__pyx_v_physical_x[1]))) + (((__pyx_v_vertices[4]) * (__pyx_v_vertices[1])) - ((__pyx_v_vertices[0]) * (__pyx_v_vertices[5])))) / __pyx_v_det); + + /* "yt/utilities/lib/element_mappings.pyx":201 + * (vertices[4]*vertices[1] - vertices[0]*vertices[5])) / det + * + * mapped_x[2] = 1.0 - mapped_x[1] - mapped_x[0] # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mapped_x[2]) = ((1.0 - (__pyx_v_mapped_x[1])) - (__pyx_v_mapped_x[0])); + + /* "yt/utilities/lib/element_mappings.pyx":172 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void map_real_to_unit(self, double* mapped_x, # <<<<<<<<<<<<<< @@ -2749,7 +3566,7 @@ /* function exit code */ } -/* "yt/utilities/lib/element_mappings.pyx":220 +/* "yt/utilities/lib/element_mappings.pyx":207 * @cython.wraparound(False) * @cython.cdivision(True) * cdef double sample_at_unit_point(self, # <<<<<<<<<<<<<< @@ -2757,20 +3574,20 @@ * double* vals) nogil: */ -static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { double __pyx_r; - /* "yt/utilities/lib/element_mappings.pyx":224 + /* "yt/utilities/lib/element_mappings.pyx":210 + * double* coord, * double* vals) nogil: - * return vals[0]*coord[0] + vals[1]*coord[1] + \ - * vals[2]*coord[2] + vals[3]*coord[3] # <<<<<<<<<<<<<< + * return vals[0]*coord[0] + vals[1]*coord[1] + vals[2]*coord[2] # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_r = (((((__pyx_v_vals[0]) * (__pyx_v_coord[0])) + ((__pyx_v_vals[1]) * (__pyx_v_coord[1]))) + ((__pyx_v_vals[2]) * (__pyx_v_coord[2]))) + ((__pyx_v_vals[3]) * (__pyx_v_coord[3]))); + __pyx_r = ((((__pyx_v_vals[0]) * (__pyx_v_coord[0])) + ((__pyx_v_vals[1]) * (__pyx_v_coord[1]))) + ((__pyx_v_vals[2]) * (__pyx_v_coord[2]))); goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":220 + /* "yt/utilities/lib/element_mappings.pyx":207 * @cython.wraparound(False) * @cython.cdivision(True) * cdef double sample_at_unit_point(self, # <<<<<<<<<<<<<< @@ -2783,34 +3600,34 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":229 +/* "yt/utilities/lib/element_mappings.pyx":215 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * # for tetrahedra, we check whether all mapped coordinates - * # are within 0 and 1, to within the inclusion tolerance + * # for triangles, we check whether all mapped_coords are + * # between 0 and 1, to within the inclusion tolerance */ -static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self, double *__pyx_v_mapped_coord) { int __pyx_v_i; int __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; - /* "yt/utilities/lib/element_mappings.pyx":233 - * # are within 0 and 1, to within the inclusion tolerance + /* "yt/utilities/lib/element_mappings.pyx":219 + * # between 0 and 1, to within the inclusion tolerance * cdef int i - * for i in range(4): # <<<<<<<<<<<<<< + * for i in range(3): # <<<<<<<<<<<<<< * if (mapped_coord[i] < -self.inclusion_tol or * mapped_coord[i] - 1.0 > self.inclusion_tol): */ - for (__pyx_t_1 = 0; __pyx_t_1 < 4; __pyx_t_1+=1) { + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/element_mappings.pyx":234 + /* "yt/utilities/lib/element_mappings.pyx":220 * cdef int i - * for i in range(4): + * for i in range(3): * if (mapped_coord[i] < -self.inclusion_tol or # <<<<<<<<<<<<<< * mapped_coord[i] - 1.0 > self.inclusion_tol): * return 0 @@ -2822,8 +3639,8 @@ goto __pyx_L6_bool_binop_done; } - /* "yt/utilities/lib/element_mappings.pyx":235 - * for i in range(4): + /* "yt/utilities/lib/element_mappings.pyx":221 + * for i in range(3): * if (mapped_coord[i] < -self.inclusion_tol or * mapped_coord[i] - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< * return 0 @@ -2833,16 +3650,16 @@ __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; - /* "yt/utilities/lib/element_mappings.pyx":234 + /* "yt/utilities/lib/element_mappings.pyx":220 * cdef int i - * for i in range(4): + * for i in range(3): * if (mapped_coord[i] < -self.inclusion_tol or # <<<<<<<<<<<<<< * mapped_coord[i] - 1.0 > self.inclusion_tol): * return 0 */ if (__pyx_t_2) { - /* "yt/utilities/lib/element_mappings.pyx":236 + /* "yt/utilities/lib/element_mappings.pyx":222 * if (mapped_coord[i] < -self.inclusion_tol or * mapped_coord[i] - 1.0 > self.inclusion_tol): * return 0 # <<<<<<<<<<<<<< @@ -2852,9 +3669,9 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":234 + /* "yt/utilities/lib/element_mappings.pyx":220 * cdef int i - * for i in range(4): + * for i in range(3): * if (mapped_coord[i] < -self.inclusion_tol or # <<<<<<<<<<<<<< * mapped_coord[i] - 1.0 > self.inclusion_tol): * return 0 @@ -2862,22 +3679,22 @@ } } - /* "yt/utilities/lib/element_mappings.pyx":237 + /* "yt/utilities/lib/element_mappings.pyx":223 * mapped_coord[i] - 1.0 > self.inclusion_tol): * return 0 * return 1 # <<<<<<<<<<<<<< * - * @cython.boundscheck(False) + * */ __pyx_r = 1; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":229 + /* "yt/utilities/lib/element_mappings.pyx":215 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * # for tetrahedra, we check whether all mapped coordinates - * # are within 0 and 1, to within the inclusion tolerance + * # for triangles, we check whether all mapped_coords are + * # between 0 and 1, to within the inclusion tolerance */ /* function exit code */ @@ -2885,360 +3702,324 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":242 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * cdef double u, v, w - * cdef double thresh = 2.0e-2 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) */ -static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_check_mesh_lines(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { - double __pyx_v_u; - double __pyx_v_v; - double __pyx_v_w; - double __pyx_v_thresh; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_3__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_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *)__pyx_v_self)); - /* "yt/utilities/lib/element_mappings.pyx":244 - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: - * cdef double u, v, w - * cdef double thresh = 2.0e-2 # <<<<<<<<<<<<<< - * if mapped_coord[0] == 0: - * u = mapped_coord[1] - */ - __pyx_v_thresh = 2.0e-2; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/element_mappings.pyx":245 - * cdef double u, v, w - * cdef double thresh = 2.0e-2 - * if mapped_coord[0] == 0: # <<<<<<<<<<<<<< - * u = mapped_coord[1] - * v = mapped_coord[2] +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_2__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__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; + int __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_t_1 = (((__pyx_v_mapped_coord[0]) == 0.0) != 0); - if (__pyx_t_1) { + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.inclusion_tol); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.num_mapped_coords); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __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_v_state = __pyx_t_3; + __pyx_t_3 = 0; - /* "yt/utilities/lib/element_mappings.pyx":246 - * cdef double thresh = 2.0e-2 - * if mapped_coord[0] == 0: - * u = mapped_coord[1] # <<<<<<<<<<<<<< - * v = mapped_coord[2] - * w = mapped_coord[3] + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, */ - __pyx_v_u = (__pyx_v_mapped_coord[1]); + __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v__dict = __pyx_t_3; + __pyx_t_3 = 0; - /* "yt/utilities/lib/element_mappings.pyx":247 - * if mapped_coord[0] == 0: - * u = mapped_coord[1] - * v = mapped_coord[2] # <<<<<<<<<<<<<< - * w = mapped_coord[3] - * elif mapped_coord[1] == 0: + /* "(tree fragment)":5 + * state = (self.inclusion_tol, self.num_mapped_coords) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_4 = (__pyx_v__dict != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ - __pyx_v_v = (__pyx_v_mapped_coord[2]); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; - /* "yt/utilities/lib/element_mappings.pyx":248 - * u = mapped_coord[1] - * v = mapped_coord[2] - * w = mapped_coord[3] # <<<<<<<<<<<<<< - * elif mapped_coord[1] == 0: - * u = mapped_coord[2] + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False */ - __pyx_v_w = (__pyx_v_mapped_coord[3]); + __pyx_v_use_setstate = 1; - /* "yt/utilities/lib/element_mappings.pyx":245 - * cdef double u, v, w - * cdef double thresh = 2.0e-2 - * if mapped_coord[0] == 0: # <<<<<<<<<<<<<< - * u = mapped_coord[1] - * v = mapped_coord[2] + /* "(tree fragment)":5 + * state = (self.inclusion_tol, self.num_mapped_coords) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ goto __pyx_L3; } - /* "yt/utilities/lib/element_mappings.pyx":249 - * v = mapped_coord[2] - * w = mapped_coord[3] - * elif mapped_coord[1] == 0: # <<<<<<<<<<<<<< - * u = mapped_coord[2] - * v = mapped_coord[3] + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_P1Sampler2D, (type(self), 0xa37a4b3, None), state */ - __pyx_t_1 = (((__pyx_v_mapped_coord[1]) == 0.0) != 0); - if (__pyx_t_1) { + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; - /* "yt/utilities/lib/element_mappings.pyx":250 - * w = mapped_coord[3] - * elif mapped_coord[1] == 0: - * u = mapped_coord[2] # <<<<<<<<<<<<<< - * v = mapped_coord[3] - * w = mapped_coord[0] + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_P1Sampler2D, (type(self), 0xa37a4b3, None), state + * else: */ - __pyx_v_u = (__pyx_v_mapped_coord[2]); + __pyx_t_5 = (__pyx_v_use_setstate != 0); + if (__pyx_t_5) { - /* "yt/utilities/lib/element_mappings.pyx":251 - * elif mapped_coord[1] == 0: - * u = mapped_coord[2] - * v = mapped_coord[3] # <<<<<<<<<<<<<< - * w = mapped_coord[0] - * elif mapped_coord[2] == 0: + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_P1Sampler2D, (type(self), 0xa37a4b3, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_P1Sampler2D, (type(self), 0xa37a4b3, state) */ - __pyx_v_v = (__pyx_v_mapped_coord[3]); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_P1Sampler2D); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_171418803); + __Pyx_GIVEREF(__pyx_int_171418803); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_171418803); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":252 - * u = mapped_coord[2] - * v = mapped_coord[3] - * w = mapped_coord[0] # <<<<<<<<<<<<<< - * elif mapped_coord[2] == 0: - * u = mapped_coord[1] + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_P1Sampler2D, (type(self), 0xa37a4b3, None), state + * else: */ - __pyx_v_w = (__pyx_v_mapped_coord[0]); + } - /* "yt/utilities/lib/element_mappings.pyx":249 - * v = mapped_coord[2] - * w = mapped_coord[3] - * elif mapped_coord[1] == 0: # <<<<<<<<<<<<<< - * u = mapped_coord[2] - * v = mapped_coord[3] - */ - goto __pyx_L3; - } - - /* "yt/utilities/lib/element_mappings.pyx":253 - * v = mapped_coord[3] - * w = mapped_coord[0] - * elif mapped_coord[2] == 0: # <<<<<<<<<<<<<< - * u = mapped_coord[1] - * v = mapped_coord[3] - */ - __pyx_t_1 = (((__pyx_v_mapped_coord[2]) == 0.0) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/lib/element_mappings.pyx":254 - * w = mapped_coord[0] - * elif mapped_coord[2] == 0: - * u = mapped_coord[1] # <<<<<<<<<<<<<< - * v = mapped_coord[3] - * w = mapped_coord[0] - */ - __pyx_v_u = (__pyx_v_mapped_coord[1]); - - /* "yt/utilities/lib/element_mappings.pyx":255 - * elif mapped_coord[2] == 0: - * u = mapped_coord[1] - * v = mapped_coord[3] # <<<<<<<<<<<<<< - * w = mapped_coord[0] - * else: - */ - __pyx_v_v = (__pyx_v_mapped_coord[3]); - - /* "yt/utilities/lib/element_mappings.pyx":256 - * u = mapped_coord[1] - * v = mapped_coord[3] - * w = mapped_coord[0] # <<<<<<<<<<<<<< - * else: - * u = mapped_coord[1] - */ - __pyx_v_w = (__pyx_v_mapped_coord[0]); - - /* "yt/utilities/lib/element_mappings.pyx":253 - * v = mapped_coord[3] - * w = mapped_coord[0] - * elif mapped_coord[2] == 0: # <<<<<<<<<<<<<< - * u = mapped_coord[1] - * v = mapped_coord[3] - */ - goto __pyx_L3; - } - - /* "yt/utilities/lib/element_mappings.pyx":258 - * w = mapped_coord[0] - * else: - * u = mapped_coord[1] # <<<<<<<<<<<<<< - * v = mapped_coord[2] - * w = mapped_coord[0] + /* "(tree fragment)":13 + * return __pyx_unpickle_P1Sampler2D, (type(self), 0xa37a4b3, None), state + * else: + * return __pyx_unpickle_P1Sampler2D, (type(self), 0xa37a4b3, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_P1Sampler2D__set_state(self, __pyx_state) */ /*else*/ { - __pyx_v_u = (__pyx_v_mapped_coord[1]); - - /* "yt/utilities/lib/element_mappings.pyx":259 - * else: - * u = mapped_coord[1] - * v = mapped_coord[2] # <<<<<<<<<<<<<< - * w = mapped_coord[0] - * if ((u < thresh) or - */ - __pyx_v_v = (__pyx_v_mapped_coord[2]); - - /* "yt/utilities/lib/element_mappings.pyx":260 - * u = mapped_coord[1] - * v = mapped_coord[2] - * w = mapped_coord[0] # <<<<<<<<<<<<<< - * if ((u < thresh) or - * (v < thresh) or - */ - __pyx_v_w = (__pyx_v_mapped_coord[0]); - } - __pyx_L3:; - - /* "yt/utilities/lib/element_mappings.pyx":261 - * v = mapped_coord[2] - * w = mapped_coord[0] - * if ((u < thresh) or # <<<<<<<<<<<<<< - * (v < thresh) or - * (w < thresh) or - */ - __pyx_t_2 = ((__pyx_v_u < __pyx_v_thresh) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L5_bool_binop_done; - } - - /* "yt/utilities/lib/element_mappings.pyx":262 - * w = mapped_coord[0] - * if ((u < thresh) or - * (v < thresh) or # <<<<<<<<<<<<<< - * (w < thresh) or - * (fabs(u - 1) < thresh) or - */ - __pyx_t_2 = ((__pyx_v_v < __pyx_v_thresh) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L5_bool_binop_done; - } - - /* "yt/utilities/lib/element_mappings.pyx":263 - * if ((u < thresh) or - * (v < thresh) or - * (w < thresh) or # <<<<<<<<<<<<<< - * (fabs(u - 1) < thresh) or - * (fabs(v - 1) < thresh) or - */ - __pyx_t_2 = ((__pyx_v_w < __pyx_v_thresh) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L5_bool_binop_done; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_P1Sampler2D); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_171418803); + __Pyx_GIVEREF(__pyx_int_171418803); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_171418803); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; } - /* "yt/utilities/lib/element_mappings.pyx":264 - * (v < thresh) or - * (w < thresh) or - * (fabs(u - 1) < thresh) or # <<<<<<<<<<<<<< - * (fabs(v - 1) < thresh) or - * (fabs(w - 1) < thresh)): + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) */ - __pyx_t_2 = ((fabs((__pyx_v_u - 1.0)) < __pyx_v_thresh) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L5_bool_binop_done; - } - /* "yt/utilities/lib/element_mappings.pyx":265 - * (w < thresh) or - * (fabs(u - 1) < thresh) or - * (fabs(v - 1) < thresh) or # <<<<<<<<<<<<<< - * (fabs(w - 1) < thresh)): - * return 1 - */ - __pyx_t_2 = ((fabs((__pyx_v_v - 1.0)) < __pyx_v_thresh) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L5_bool_binop_done; - } + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.P1Sampler2D.__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; +} - /* "yt/utilities/lib/element_mappings.pyx":266 - * (fabs(u - 1) < thresh) or - * (fabs(v - 1) < thresh) or - * (fabs(w - 1) < thresh)): # <<<<<<<<<<<<<< - * return 1 - * return -1 +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_P1Sampler2D, (type(self), 0xa37a4b3, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_P1Sampler2D__set_state(self, __pyx_state) */ - __pyx_t_2 = ((fabs((__pyx_v_w - 1.0)) < __pyx_v_thresh) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L5_bool_binop_done:; - /* "yt/utilities/lib/element_mappings.pyx":261 - * v = mapped_coord[2] - * w = mapped_coord[0] - * if ((u < thresh) or # <<<<<<<<<<<<<< - * (v < thresh) or - * (w < thresh) or - */ - if (__pyx_t_1) { +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_5__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_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "yt/utilities/lib/element_mappings.pyx":267 - * (fabs(v - 1) < thresh) or - * (fabs(w - 1) < thresh)): - * return 1 # <<<<<<<<<<<<<< - * return -1 - * - */ - __pyx_r = 1; - goto __pyx_L0; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/element_mappings.pyx":261 - * v = mapped_coord[2] - * w = mapped_coord[0] - * if ((u < thresh) or # <<<<<<<<<<<<<< - * (v < thresh) or - * (w < thresh) or - */ - } +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_4__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "yt/utilities/lib/element_mappings.pyx":268 - * (fabs(w - 1) < thresh)): - * return 1 - * return -1 # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":15 + * return __pyx_unpickle_P1Sampler2D, (type(self), 0xa37a4b3, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_P1Sampler2D__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_r = -1; - goto __pyx_L0; + 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_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_P1Sampler2D__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; - /* "yt/utilities/lib/element_mappings.pyx":242 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * cdef double u, v, w - * cdef double thresh = 2.0e-2 + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_P1Sampler2D, (type(self), 0xa37a4b3, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_P1Sampler2D__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("yt.utilities.lib.element_mappings.P1Sampler2D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":284 - * ''' +/* "yt/utilities/lib/element_mappings.pyx":235 + * * * def __init__(self): # <<<<<<<<<<<<<< - * super(NonlinearSolveSampler3D, self).__init__() - * self.tolerance = 1.0e-9 + * super(P1Sampler3D, self).__init__() + * self.num_mapped_coords = 4 */ /* Python wrapper */ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *)__pyx_v_self)); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *__pyx_v_self) { +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -3246,25 +4027,25 @@ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/utilities/lib/element_mappings.pyx":285 + /* "yt/utilities/lib/element_mappings.pyx":236 * * def __init__(self): - * super(NonlinearSolveSampler3D, self).__init__() # <<<<<<<<<<<<<< - * self.tolerance = 1.0e-9 - * self.max_iter = 10 + * super(P1Sampler3D, self).__init__() # <<<<<<<<<<<<<< + * self.num_mapped_coords = 4 + * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)); + __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -3278,39 +4059,30 @@ } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/element_mappings.pyx":286 + /* "yt/utilities/lib/element_mappings.pyx":237 * def __init__(self): - * super(NonlinearSolveSampler3D, self).__init__() - * self.tolerance = 1.0e-9 # <<<<<<<<<<<<<< - * self.max_iter = 10 + * super(P1Sampler3D, self).__init__() + * self.num_mapped_coords = 4 # <<<<<<<<<<<<<< * + * @cython.boundscheck(False) */ - __pyx_v_self->tolerance = 1.0e-9; + __pyx_v_self->__pyx_base.num_mapped_coords = 4; - /* "yt/utilities/lib/element_mappings.pyx":287 - * super(NonlinearSolveSampler3D, self).__init__() - * self.tolerance = 1.0e-9 - * self.max_iter = 10 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":235 * - * @cython.boundscheck(False) - */ - __pyx_v_self->max_iter = 10; - - /* "yt/utilities/lib/element_mappings.pyx":284 - * ''' * * def __init__(self): # <<<<<<<<<<<<<< - * super(NonlinearSolveSampler3D, self).__init__() - * self.tolerance = 1.0e-9 + * super(P1Sampler3D, self).__init__() + * self.num_mapped_coords = 4 */ /* function exit code */ @@ -3320,579 +4092,591 @@ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.NonlinearSolveSampler3D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.P1Sampler3D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":292 +/* "yt/utilities/lib/element_mappings.pyx":242 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void map_real_to_unit(self, # <<<<<<<<<<<<<< - * double* mapped_x, - * double* vertices, + * cdef void map_real_to_unit(self, double* mapped_x, # <<<<<<<<<<<<<< + * double* vertices, double* physical_x) nogil: + * */ -static void __pyx_f_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_map_real_to_unit(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *__pyx_v_self, double *__pyx_v_mapped_x, double *__pyx_v_vertices, double *__pyx_v_physical_x) { +static void __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_map_real_to_unit(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_x, double *__pyx_v_vertices, double *__pyx_v_physical_x) { int __pyx_v_i; double __pyx_v_d; - double __pyx_v_f[3]; - double __pyx_v_r[3]; - double __pyx_v_s[3]; - double __pyx_v_t[3]; - double __pyx_v_x[3]; - int __pyx_v_iterations; - double __pyx_v_err; + double __pyx_v_bvec[3]; + double __pyx_v_col0[3]; + double __pyx_v_col1[3]; + double __pyx_v_col2[3]; int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - - /* "yt/utilities/lib/element_mappings.pyx":303 - * cdef double[3] t - * cdef double[3] x - * cdef int iterations = 0 # <<<<<<<<<<<<<< - * cdef double err - * - */ - __pyx_v_iterations = 0; - /* "yt/utilities/lib/element_mappings.pyx":307 - * - * # initial guess + /* "yt/utilities/lib/element_mappings.pyx":254 + * # here, we express positions relative to the 4th element, + * # which is selected by vertices[9] * for i in range(3): # <<<<<<<<<<<<<< - * x[i] = 0.0 - * + * bvec[i] = physical_x[i] - vertices[9 + i] + * col0[i] = vertices[0 + i] - vertices[9 + i] */ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/element_mappings.pyx":308 - * # initial guess + /* "yt/utilities/lib/element_mappings.pyx":255 + * # which is selected by vertices[9] * for i in range(3): - * x[i] = 0.0 # <<<<<<<<<<<<<< - * - * # initial error norm + * bvec[i] = physical_x[i] - vertices[9 + i] # <<<<<<<<<<<<<< + * col0[i] = vertices[0 + i] - vertices[9 + i] + * col1[i] = vertices[3 + i] - vertices[9 + i] */ - (__pyx_v_x[__pyx_v_i]) = 0.0; - } + (__pyx_v_bvec[__pyx_v_i]) = ((__pyx_v_physical_x[__pyx_v_i]) - (__pyx_v_vertices[(9 + __pyx_v_i)])); - /* "yt/utilities/lib/element_mappings.pyx":311 - * - * # initial error norm - * self.func(f, x, vertices, physical_x) # <<<<<<<<<<<<<< - * err = maxnorm(f, 3) - * + /* "yt/utilities/lib/element_mappings.pyx":256 + * for i in range(3): + * bvec[i] = physical_x[i] - vertices[9 + i] + * col0[i] = vertices[0 + i] - vertices[9 + i] # <<<<<<<<<<<<<< + * col1[i] = vertices[3 + i] - vertices[9 + i] + * col2[i] = vertices[6 + i] - vertices[9 + i] */ - __pyx_v_self->func(__pyx_v_f, __pyx_v_x, __pyx_v_vertices, __pyx_v_physical_x); + (__pyx_v_col0[__pyx_v_i]) = ((__pyx_v_vertices[(0 + __pyx_v_i)]) - (__pyx_v_vertices[(9 + __pyx_v_i)])); - /* "yt/utilities/lib/element_mappings.pyx":312 - * # initial error norm - * self.func(f, x, vertices, physical_x) - * err = maxnorm(f, 3) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":257 + * bvec[i] = physical_x[i] - vertices[9 + i] + * col0[i] = vertices[0 + i] - vertices[9 + i] + * col1[i] = vertices[3 + i] - vertices[9 + i] # <<<<<<<<<<<<<< + * col2[i] = vertices[6 + i] - vertices[9 + i] * - * # begin Newton iteration */ - __pyx_v_err = __pyx_f_2yt_9utilities_3lib_16element_mappings_maxnorm(__pyx_v_f, 3); + (__pyx_v_col1[__pyx_v_i]) = ((__pyx_v_vertices[(3 + __pyx_v_i)]) - (__pyx_v_vertices[(9 + __pyx_v_i)])); - /* "yt/utilities/lib/element_mappings.pyx":315 + /* "yt/utilities/lib/element_mappings.pyx":258 + * col0[i] = vertices[0 + i] - vertices[9 + i] + * col1[i] = vertices[3 + i] - vertices[9 + i] + * col2[i] = vertices[6 + i] - vertices[9 + i] # <<<<<<<<<<<<<< * - * # begin Newton iteration - * while (err > self.tolerance and iterations < self.max_iter): # <<<<<<<<<<<<<< - * self.jac(r, s, t, x, vertices, physical_x) - * d = determinant_3x3(r, s, t) - */ - while (1) { - __pyx_t_3 = ((__pyx_v_err > __pyx_v_self->tolerance) != 0); - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_3 = ((__pyx_v_iterations < __pyx_v_self->max_iter) != 0); - __pyx_t_2 = __pyx_t_3; - __pyx_L7_bool_binop_done:; - if (!__pyx_t_2) break; - - /* "yt/utilities/lib/element_mappings.pyx":316 - * # begin Newton iteration - * while (err > self.tolerance and iterations < self.max_iter): - * self.jac(r, s, t, x, vertices, physical_x) # <<<<<<<<<<<<<< - * d = determinant_3x3(r, s, t) - * x[0] = x[0] - (determinant_3x3(f, s, t)/d) + * d = determinant_3x3(col0, col1, col2) */ - __pyx_v_self->jac(__pyx_v_r, __pyx_v_s, __pyx_v_t, __pyx_v_x, __pyx_v_vertices, __pyx_v_physical_x); + (__pyx_v_col2[__pyx_v_i]) = ((__pyx_v_vertices[(6 + __pyx_v_i)]) - (__pyx_v_vertices[(9 + __pyx_v_i)])); + } - /* "yt/utilities/lib/element_mappings.pyx":317 - * while (err > self.tolerance and iterations < self.max_iter): - * self.jac(r, s, t, x, vertices, physical_x) - * d = determinant_3x3(r, s, t) # <<<<<<<<<<<<<< - * x[0] = x[0] - (determinant_3x3(f, s, t)/d) - * x[1] = x[1] - (determinant_3x3(r, f, t)/d) + /* "yt/utilities/lib/element_mappings.pyx":260 + * col2[i] = vertices[6 + i] - vertices[9 + i] + * + * d = determinant_3x3(col0, col1, col2) # <<<<<<<<<<<<<< + * mapped_x[0] = determinant_3x3(bvec, col1, col2)/d + * mapped_x[1] = determinant_3x3(col0, bvec, col2)/d */ - __pyx_v_d = __pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_r, __pyx_v_s, __pyx_v_t); + __pyx_v_d = __pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_col0, __pyx_v_col1, __pyx_v_col2); - /* "yt/utilities/lib/element_mappings.pyx":318 - * self.jac(r, s, t, x, vertices, physical_x) - * d = determinant_3x3(r, s, t) - * x[0] = x[0] - (determinant_3x3(f, s, t)/d) # <<<<<<<<<<<<<< - * x[1] = x[1] - (determinant_3x3(r, f, t)/d) - * x[2] = x[2] - (determinant_3x3(r, s, f)/d) + /* "yt/utilities/lib/element_mappings.pyx":261 + * + * d = determinant_3x3(col0, col1, col2) + * mapped_x[0] = determinant_3x3(bvec, col1, col2)/d # <<<<<<<<<<<<<< + * mapped_x[1] = determinant_3x3(col0, bvec, col2)/d + * mapped_x[2] = determinant_3x3(col0, col1, bvec)/d */ - (__pyx_v_x[0]) = ((__pyx_v_x[0]) - (__pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_f, __pyx_v_s, __pyx_v_t) / __pyx_v_d)); + (__pyx_v_mapped_x[0]) = (__pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_bvec, __pyx_v_col1, __pyx_v_col2) / __pyx_v_d); - /* "yt/utilities/lib/element_mappings.pyx":319 - * d = determinant_3x3(r, s, t) - * x[0] = x[0] - (determinant_3x3(f, s, t)/d) - * x[1] = x[1] - (determinant_3x3(r, f, t)/d) # <<<<<<<<<<<<<< - * x[2] = x[2] - (determinant_3x3(r, s, f)/d) - * self.func(f, x, vertices, physical_x) - */ - (__pyx_v_x[1]) = ((__pyx_v_x[1]) - (__pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_r, __pyx_v_f, __pyx_v_t) / __pyx_v_d)); - - /* "yt/utilities/lib/element_mappings.pyx":320 - * x[0] = x[0] - (determinant_3x3(f, s, t)/d) - * x[1] = x[1] - (determinant_3x3(r, f, t)/d) - * x[2] = x[2] - (determinant_3x3(r, s, f)/d) # <<<<<<<<<<<<<< - * self.func(f, x, vertices, physical_x) - * err = maxnorm(f, 3) - */ - (__pyx_v_x[2]) = ((__pyx_v_x[2]) - (__pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_r, __pyx_v_s, __pyx_v_f) / __pyx_v_d)); - - /* "yt/utilities/lib/element_mappings.pyx":321 - * x[1] = x[1] - (determinant_3x3(r, f, t)/d) - * x[2] = x[2] - (determinant_3x3(r, s, f)/d) - * self.func(f, x, vertices, physical_x) # <<<<<<<<<<<<<< - * err = maxnorm(f, 3) - * iterations += 1 + /* "yt/utilities/lib/element_mappings.pyx":262 + * d = determinant_3x3(col0, col1, col2) + * mapped_x[0] = determinant_3x3(bvec, col1, col2)/d + * mapped_x[1] = determinant_3x3(col0, bvec, col2)/d # <<<<<<<<<<<<<< + * mapped_x[2] = determinant_3x3(col0, col1, bvec)/d + * mapped_x[3] = 1.0 - mapped_x[0] - mapped_x[1] - mapped_x[2] */ - __pyx_v_self->func(__pyx_v_f, __pyx_v_x, __pyx_v_vertices, __pyx_v_physical_x); + (__pyx_v_mapped_x[1]) = (__pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_col0, __pyx_v_bvec, __pyx_v_col2) / __pyx_v_d); - /* "yt/utilities/lib/element_mappings.pyx":322 - * x[2] = x[2] - (determinant_3x3(r, s, f)/d) - * self.func(f, x, vertices, physical_x) - * err = maxnorm(f, 3) # <<<<<<<<<<<<<< - * iterations += 1 + /* "yt/utilities/lib/element_mappings.pyx":263 + * mapped_x[0] = determinant_3x3(bvec, col1, col2)/d + * mapped_x[1] = determinant_3x3(col0, bvec, col2)/d + * mapped_x[2] = determinant_3x3(col0, col1, bvec)/d # <<<<<<<<<<<<<< + * mapped_x[3] = 1.0 - mapped_x[0] - mapped_x[1] - mapped_x[2] * */ - __pyx_v_err = __pyx_f_2yt_9utilities_3lib_16element_mappings_maxnorm(__pyx_v_f, 3); + (__pyx_v_mapped_x[2]) = (__pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_col0, __pyx_v_col1, __pyx_v_bvec) / __pyx_v_d); - /* "yt/utilities/lib/element_mappings.pyx":323 - * self.func(f, x, vertices, physical_x) - * err = maxnorm(f, 3) - * iterations += 1 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":264 + * mapped_x[1] = determinant_3x3(col0, bvec, col2)/d + * mapped_x[2] = determinant_3x3(col0, col1, bvec)/d + * mapped_x[3] = 1.0 - mapped_x[0] - mapped_x[1] - mapped_x[2] # <<<<<<<<<<<<<< * - * if (err > self.tolerance): + * @cython.boundscheck(False) */ - __pyx_v_iterations = (__pyx_v_iterations + 1); - } + (__pyx_v_mapped_x[3]) = (((1.0 - (__pyx_v_mapped_x[0])) - (__pyx_v_mapped_x[1])) - (__pyx_v_mapped_x[2])); - /* "yt/utilities/lib/element_mappings.pyx":325 - * iterations += 1 + /* "yt/utilities/lib/element_mappings.pyx":242 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void map_real_to_unit(self, double* mapped_x, # <<<<<<<<<<<<<< + * double* vertices, double* physical_x) nogil: * - * if (err > self.tolerance): # <<<<<<<<<<<<<< - * # we did not converge, set bogus value - * for i in range(3): - */ - __pyx_t_2 = ((__pyx_v_err > __pyx_v_self->tolerance) != 0); - if (__pyx_t_2) { - - /* "yt/utilities/lib/element_mappings.pyx":327 - * if (err > self.tolerance): - * # we did not converge, set bogus value - * for i in range(3): # <<<<<<<<<<<<<< - * mapped_x[i] = -99.0 - * else: */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/element_mappings.pyx":328 - * # we did not converge, set bogus value - * for i in range(3): - * mapped_x[i] = -99.0 # <<<<<<<<<<<<<< - * else: - * for i in range(3): - */ - (__pyx_v_mapped_x[__pyx_v_i]) = -99.0; - } + /* function exit code */ +} - /* "yt/utilities/lib/element_mappings.pyx":325 - * iterations += 1 - * - * if (err > self.tolerance): # <<<<<<<<<<<<<< - * # we did not converge, set bogus value - * for i in range(3): +/* "yt/utilities/lib/element_mappings.pyx":269 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, # <<<<<<<<<<<<<< + * double* coord, + * double* vals) nogil: */ - goto __pyx_L9; - } - /* "yt/utilities/lib/element_mappings.pyx":330 - * mapped_x[i] = -99.0 - * else: - * for i in range(3): # <<<<<<<<<<<<<< - * mapped_x[i] = x[i] - * - */ - /*else*/ { - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { + double __pyx_r; - /* "yt/utilities/lib/element_mappings.pyx":331 - * else: - * for i in range(3): - * mapped_x[i] = x[i] # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/element_mappings.pyx":273 + * double* vals) nogil: + * return vals[0]*coord[0] + vals[1]*coord[1] + \ + * vals[2]*coord[2] + vals[3]*coord[3] # <<<<<<<<<<<<<< * + * @cython.boundscheck(False) */ - (__pyx_v_mapped_x[__pyx_v_i]) = (__pyx_v_x[__pyx_v_i]); - } - } - __pyx_L9:; + __pyx_r = (((((__pyx_v_vals[0]) * (__pyx_v_coord[0])) + ((__pyx_v_vals[1]) * (__pyx_v_coord[1]))) + ((__pyx_v_vals[2]) * (__pyx_v_coord[2]))) + ((__pyx_v_vals[3]) * (__pyx_v_coord[3]))); + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":292 + /* "yt/utilities/lib/element_mappings.pyx":269 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void map_real_to_unit(self, # <<<<<<<<<<<<<< - * double* mapped_x, - * double* vertices, + * cdef double sample_at_unit_point(self, # <<<<<<<<<<<<<< + * double* coord, + * double* vals) nogil: */ /* function exit code */ + __pyx_L0:; + return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":342 - * ''' - * - * def __init__(self): # <<<<<<<<<<<<<< - * super(Q1Sampler3D, self).__init__() - * self.num_mapped_coords = 3 +/* "yt/utilities/lib/element_mappings.pyx":278 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for tetrahedra, we check whether all mapped coordinates + * # are within 0 and 1, to within the inclusion tolerance */ -/* Python wrapper */ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { + int __pyx_v_i; int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} - if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; -static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__init__", 0); + /* "yt/utilities/lib/element_mappings.pyx":282 + * # are within 0 and 1, to within the inclusion tolerance + * cdef int i + * for i in range(4): # <<<<<<<<<<<<<< + * if (mapped_coord[i] < -self.inclusion_tol or + * mapped_coord[i] - 1.0 > self.inclusion_tol): + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 4; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/element_mappings.pyx":343 - * - * def __init__(self): - * super(Q1Sampler3D, self).__init__() # <<<<<<<<<<<<<< - * self.num_mapped_coords = 3 - * self.dim = 3 + /* "yt/utilities/lib/element_mappings.pyx":283 + * cdef int i + * for i in range(4): + * if (mapped_coord[i] < -self.inclusion_tol or # <<<<<<<<<<<<<< + * mapped_coord[i] - 1.0 > self.inclusion_tol): + * return 0 */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - 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_3 = (((__pyx_v_mapped_coord[__pyx_v_i]) < (-__pyx_v_self->__pyx_base.inclusion_tol)) != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L6_bool_binop_done; } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/element_mappings.pyx":344 - * def __init__(self): - * super(Q1Sampler3D, self).__init__() - * self.num_mapped_coords = 3 # <<<<<<<<<<<<<< - * self.dim = 3 - * self.func = Q1Function3D + /* "yt/utilities/lib/element_mappings.pyx":284 + * for i in range(4): + * if (mapped_coord[i] < -self.inclusion_tol or + * mapped_coord[i] - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 + * return 1 */ - __pyx_v_self->__pyx_base.__pyx_base.num_mapped_coords = 3; + __pyx_t_3 = ((((__pyx_v_mapped_coord[__pyx_v_i]) - 1.0) > __pyx_v_self->__pyx_base.inclusion_tol) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L6_bool_binop_done:; - /* "yt/utilities/lib/element_mappings.pyx":345 - * super(Q1Sampler3D, self).__init__() - * self.num_mapped_coords = 3 - * self.dim = 3 # <<<<<<<<<<<<<< - * self.func = Q1Function3D - * self.jac = Q1Jacobian3D + /* "yt/utilities/lib/element_mappings.pyx":283 + * cdef int i + * for i in range(4): + * if (mapped_coord[i] < -self.inclusion_tol or # <<<<<<<<<<<<<< + * mapped_coord[i] - 1.0 > self.inclusion_tol): + * return 0 */ - __pyx_v_self->__pyx_base.dim = 3; + if (__pyx_t_2) { - /* "yt/utilities/lib/element_mappings.pyx":346 - * self.num_mapped_coords = 3 - * self.dim = 3 - * self.func = Q1Function3D # <<<<<<<<<<<<<< - * self.jac = Q1Jacobian3D + /* "yt/utilities/lib/element_mappings.pyx":285 + * if (mapped_coord[i] < -self.inclusion_tol or + * mapped_coord[i] - 1.0 > self.inclusion_tol): + * return 0 # <<<<<<<<<<<<<< + * return 1 * */ - __pyx_v_self->__pyx_base.func = __pyx_f_2yt_9utilities_3lib_16element_mappings_Q1Function3D; + __pyx_r = 0; + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":347 - * self.dim = 3 - * self.func = Q1Function3D - * self.jac = Q1Jacobian3D # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":283 + * cdef int i + * for i in range(4): + * if (mapped_coord[i] < -self.inclusion_tol or # <<<<<<<<<<<<<< + * mapped_coord[i] - 1.0 > self.inclusion_tol): + * return 0 + */ + } + } + + /* "yt/utilities/lib/element_mappings.pyx":286 + * mapped_coord[i] - 1.0 > self.inclusion_tol): + * return 0 + * return 1 # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_v_self->__pyx_base.jac = __pyx_f_2yt_9utilities_3lib_16element_mappings_Q1Jacobian3D; + __pyx_r = 1; + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":342 - * ''' - * - * def __init__(self): # <<<<<<<<<<<<<< - * super(Q1Sampler3D, self).__init__() - * self.num_mapped_coords = 3 + /* "yt/utilities/lib/element_mappings.pyx":278 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for tetrahedra, we check whether all mapped coordinates + * # are within 0 and 1, to within the inclusion tolerance */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.Q1Sampler3D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":352 +/* "yt/utilities/lib/element_mappings.pyx":291 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< - * cdef double F, rm, rp, sm, sp, tm, tp - * + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * cdef double u, v, w + * cdef double thresh = 2.0e-2 */ -static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { - double __pyx_v_F; - double __pyx_v_rm; - double __pyx_v_rp; - double __pyx_v_sm; - double __pyx_v_sp; - double __pyx_v_tm; - double __pyx_v_tp; - double __pyx_r; +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_check_mesh_lines(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { + double __pyx_v_u; + double __pyx_v_v; + double __pyx_v_w; + double __pyx_v_thresh; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; - /* "yt/utilities/lib/element_mappings.pyx":355 - * cdef double F, rm, rp, sm, sp, tm, tp - * - * rm = 1.0 - coord[0] # <<<<<<<<<<<<<< - * rp = 1.0 + coord[0] - * sm = 1.0 - coord[1] + /* "yt/utilities/lib/element_mappings.pyx":293 + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: + * cdef double u, v, w + * cdef double thresh = 2.0e-2 # <<<<<<<<<<<<<< + * if mapped_coord[0] == 0: + * u = mapped_coord[1] */ - __pyx_v_rm = (1.0 - (__pyx_v_coord[0])); + __pyx_v_thresh = 2.0e-2; - /* "yt/utilities/lib/element_mappings.pyx":356 - * - * rm = 1.0 - coord[0] - * rp = 1.0 + coord[0] # <<<<<<<<<<<<<< - * sm = 1.0 - coord[1] - * sp = 1.0 + coord[1] + /* "yt/utilities/lib/element_mappings.pyx":294 + * cdef double u, v, w + * cdef double thresh = 2.0e-2 + * if mapped_coord[0] == 0: # <<<<<<<<<<<<<< + * u = mapped_coord[1] + * v = mapped_coord[2] */ - __pyx_v_rp = (1.0 + (__pyx_v_coord[0])); + __pyx_t_1 = (((__pyx_v_mapped_coord[0]) == 0.0) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/element_mappings.pyx":357 - * rm = 1.0 - coord[0] - * rp = 1.0 + coord[0] - * sm = 1.0 - coord[1] # <<<<<<<<<<<<<< - * sp = 1.0 + coord[1] - * tm = 1.0 - coord[2] + /* "yt/utilities/lib/element_mappings.pyx":295 + * cdef double thresh = 2.0e-2 + * if mapped_coord[0] == 0: + * u = mapped_coord[1] # <<<<<<<<<<<<<< + * v = mapped_coord[2] + * w = mapped_coord[3] */ - __pyx_v_sm = (1.0 - (__pyx_v_coord[1])); + __pyx_v_u = (__pyx_v_mapped_coord[1]); - /* "yt/utilities/lib/element_mappings.pyx":358 - * rp = 1.0 + coord[0] - * sm = 1.0 - coord[1] - * sp = 1.0 + coord[1] # <<<<<<<<<<<<<< - * tm = 1.0 - coord[2] - * tp = 1.0 + coord[2] + /* "yt/utilities/lib/element_mappings.pyx":296 + * if mapped_coord[0] == 0: + * u = mapped_coord[1] + * v = mapped_coord[2] # <<<<<<<<<<<<<< + * w = mapped_coord[3] + * elif mapped_coord[1] == 0: */ - __pyx_v_sp = (1.0 + (__pyx_v_coord[1])); + __pyx_v_v = (__pyx_v_mapped_coord[2]); - /* "yt/utilities/lib/element_mappings.pyx":359 - * sm = 1.0 - coord[1] - * sp = 1.0 + coord[1] - * tm = 1.0 - coord[2] # <<<<<<<<<<<<<< - * tp = 1.0 + coord[2] - * + /* "yt/utilities/lib/element_mappings.pyx":297 + * u = mapped_coord[1] + * v = mapped_coord[2] + * w = mapped_coord[3] # <<<<<<<<<<<<<< + * elif mapped_coord[1] == 0: + * u = mapped_coord[2] */ - __pyx_v_tm = (1.0 - (__pyx_v_coord[2])); + __pyx_v_w = (__pyx_v_mapped_coord[3]); - /* "yt/utilities/lib/element_mappings.pyx":360 - * sp = 1.0 + coord[1] - * tm = 1.0 - coord[2] - * tp = 1.0 + coord[2] # <<<<<<<<<<<<<< - * - * F = vals[0]*rm*sm*tm + vals[1]*rp*sm*tm + vals[2]*rp*sp*tm + vals[3]*rm*sp*tm + \ + /* "yt/utilities/lib/element_mappings.pyx":294 + * cdef double u, v, w + * cdef double thresh = 2.0e-2 + * if mapped_coord[0] == 0: # <<<<<<<<<<<<<< + * u = mapped_coord[1] + * v = mapped_coord[2] */ - __pyx_v_tp = (1.0 + (__pyx_v_coord[2])); + goto __pyx_L3; + } - /* "yt/utilities/lib/element_mappings.pyx":363 - * - * F = vals[0]*rm*sm*tm + vals[1]*rp*sm*tm + vals[2]*rp*sp*tm + vals[3]*rm*sp*tm + \ - * vals[4]*rm*sm*tp + vals[5]*rp*sm*tp + vals[6]*rp*sp*tp + vals[7]*rm*sp*tp # <<<<<<<<<<<<<< - * return 0.125*F - * + /* "yt/utilities/lib/element_mappings.pyx":298 + * v = mapped_coord[2] + * w = mapped_coord[3] + * elif mapped_coord[1] == 0: # <<<<<<<<<<<<<< + * u = mapped_coord[2] + * v = mapped_coord[3] */ - __pyx_v_F = (((((((((((__pyx_v_vals[0]) * __pyx_v_rm) * __pyx_v_sm) * __pyx_v_tm) + ((((__pyx_v_vals[1]) * __pyx_v_rp) * __pyx_v_sm) * __pyx_v_tm)) + ((((__pyx_v_vals[2]) * __pyx_v_rp) * __pyx_v_sp) * __pyx_v_tm)) + ((((__pyx_v_vals[3]) * __pyx_v_rm) * __pyx_v_sp) * __pyx_v_tm)) + ((((__pyx_v_vals[4]) * __pyx_v_rm) * __pyx_v_sm) * __pyx_v_tp)) + ((((__pyx_v_vals[5]) * __pyx_v_rp) * __pyx_v_sm) * __pyx_v_tp)) + ((((__pyx_v_vals[6]) * __pyx_v_rp) * __pyx_v_sp) * __pyx_v_tp)) + ((((__pyx_v_vals[7]) * __pyx_v_rm) * __pyx_v_sp) * __pyx_v_tp)); + __pyx_t_1 = (((__pyx_v_mapped_coord[1]) == 0.0) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/element_mappings.pyx":364 - * F = vals[0]*rm*sm*tm + vals[1]*rp*sm*tm + vals[2]*rp*sp*tm + vals[3]*rm*sp*tm + \ - * vals[4]*rm*sm*tp + vals[5]*rp*sm*tp + vals[6]*rp*sp*tp + vals[7]*rm*sp*tp - * return 0.125*F # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) + /* "yt/utilities/lib/element_mappings.pyx":299 + * w = mapped_coord[3] + * elif mapped_coord[1] == 0: + * u = mapped_coord[2] # <<<<<<<<<<<<<< + * v = mapped_coord[3] + * w = mapped_coord[0] */ - __pyx_r = (0.125 * __pyx_v_F); - goto __pyx_L0; + __pyx_v_u = (__pyx_v_mapped_coord[2]); - /* "yt/utilities/lib/element_mappings.pyx":352 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< - * cdef double F, rm, rp, sm, sp, tm, tp - * + /* "yt/utilities/lib/element_mappings.pyx":300 + * elif mapped_coord[1] == 0: + * u = mapped_coord[2] + * v = mapped_coord[3] # <<<<<<<<<<<<<< + * w = mapped_coord[0] + * elif mapped_coord[2] == 0: */ + __pyx_v_v = (__pyx_v_mapped_coord[3]); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "yt/utilities/lib/element_mappings.pyx":301 + * u = mapped_coord[2] + * v = mapped_coord[3] + * w = mapped_coord[0] # <<<<<<<<<<<<<< + * elif mapped_coord[2] == 0: + * u = mapped_coord[1] + */ + __pyx_v_w = (__pyx_v_mapped_coord[0]); -/* "yt/utilities/lib/element_mappings.pyx":369 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * # for hexes, the mapped coordinates all go from -1 to 1 - * # if we are inside the element. + /* "yt/utilities/lib/element_mappings.pyx":298 + * v = mapped_coord[2] + * w = mapped_coord[3] + * elif mapped_coord[1] == 0: # <<<<<<<<<<<<<< + * u = mapped_coord[2] + * v = mapped_coord[3] */ + goto __pyx_L3; + } -static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; + /* "yt/utilities/lib/element_mappings.pyx":302 + * v = mapped_coord[3] + * w = mapped_coord[0] + * elif mapped_coord[2] == 0: # <<<<<<<<<<<<<< + * u = mapped_coord[1] + * v = mapped_coord[3] + */ + __pyx_t_1 = (((__pyx_v_mapped_coord[2]) == 0.0) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/element_mappings.pyx":372 - * # for hexes, the mapped coordinates all go from -1 to 1 - * # if we are inside the element. - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + /* "yt/utilities/lib/element_mappings.pyx":303 + * w = mapped_coord[0] + * elif mapped_coord[2] == 0: + * u = mapped_coord[1] # <<<<<<<<<<<<<< + * v = mapped_coord[3] + * w = mapped_coord[0] */ - __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[0])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + __pyx_v_u = (__pyx_v_mapped_coord[1]); + + /* "yt/utilities/lib/element_mappings.pyx":304 + * elif mapped_coord[2] == 0: + * u = mapped_coord[1] + * v = mapped_coord[3] # <<<<<<<<<<<<<< + * w = mapped_coord[0] + * else: + */ + __pyx_v_v = (__pyx_v_mapped_coord[3]); + + /* "yt/utilities/lib/element_mappings.pyx":305 + * u = mapped_coord[1] + * v = mapped_coord[3] + * w = mapped_coord[0] # <<<<<<<<<<<<<< + * else: + * u = mapped_coord[1] + */ + __pyx_v_w = (__pyx_v_mapped_coord[0]); + + /* "yt/utilities/lib/element_mappings.pyx":302 + * v = mapped_coord[3] + * w = mapped_coord[0] + * elif mapped_coord[2] == 0: # <<<<<<<<<<<<<< + * u = mapped_coord[1] + * v = mapped_coord[3] + */ + goto __pyx_L3; + } + + /* "yt/utilities/lib/element_mappings.pyx":307 + * w = mapped_coord[0] + * else: + * u = mapped_coord[1] # <<<<<<<<<<<<<< + * v = mapped_coord[2] + * w = mapped_coord[0] + */ + /*else*/ { + __pyx_v_u = (__pyx_v_mapped_coord[1]); + + /* "yt/utilities/lib/element_mappings.pyx":308 + * else: + * u = mapped_coord[1] + * v = mapped_coord[2] # <<<<<<<<<<<<<< + * w = mapped_coord[0] + * if ((u < thresh) or + */ + __pyx_v_v = (__pyx_v_mapped_coord[2]); + + /* "yt/utilities/lib/element_mappings.pyx":309 + * u = mapped_coord[1] + * v = mapped_coord[2] + * w = mapped_coord[0] # <<<<<<<<<<<<<< + * if ((u < thresh) or + * (v < thresh) or + */ + __pyx_v_w = (__pyx_v_mapped_coord[0]); + } + __pyx_L3:; + + /* "yt/utilities/lib/element_mappings.pyx":310 + * v = mapped_coord[2] + * w = mapped_coord[0] + * if ((u < thresh) or # <<<<<<<<<<<<<< + * (v < thresh) or + * (w < thresh) or + */ + __pyx_t_2 = ((__pyx_v_u < __pyx_v_thresh) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; + goto __pyx_L5_bool_binop_done; } - /* "yt/utilities/lib/element_mappings.pyx":373 - * # if we are inside the element. - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): - * return 0 + /* "yt/utilities/lib/element_mappings.pyx":311 + * w = mapped_coord[0] + * if ((u < thresh) or + * (v < thresh) or # <<<<<<<<<<<<<< + * (w < thresh) or + * (fabs(u - 1) < thresh) or */ - __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[1])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + __pyx_t_2 = ((__pyx_v_v < __pyx_v_thresh) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; + goto __pyx_L5_bool_binop_done; } - /* "yt/utilities/lib/element_mappings.pyx":374 - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< - * return 0 - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":312 + * if ((u < thresh) or + * (v < thresh) or + * (w < thresh) or # <<<<<<<<<<<<<< + * (fabs(u - 1) < thresh) or + * (fabs(v - 1) < thresh) or */ - __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[2])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + __pyx_t_2 = ((__pyx_v_w < __pyx_v_thresh) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":313 + * (v < thresh) or + * (w < thresh) or + * (fabs(u - 1) < thresh) or # <<<<<<<<<<<<<< + * (fabs(v - 1) < thresh) or + * (fabs(w - 1) < thresh)): + */ + __pyx_t_2 = ((fabs((__pyx_v_u - 1.0)) < __pyx_v_thresh) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":314 + * (w < thresh) or + * (fabs(u - 1) < thresh) or + * (fabs(v - 1) < thresh) or # <<<<<<<<<<<<<< + * (fabs(w - 1) < thresh)): + * return 1 + */ + __pyx_t_2 = ((fabs((__pyx_v_v - 1.0)) < __pyx_v_thresh) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":315 + * (fabs(u - 1) < thresh) or + * (fabs(v - 1) < thresh) or + * (fabs(w - 1) < thresh)): # <<<<<<<<<<<<<< + * return 1 + * return -1 + */ + __pyx_t_2 = ((fabs((__pyx_v_w - 1.0)) < __pyx_v_thresh) != 0); __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; + __pyx_L5_bool_binop_done:; - /* "yt/utilities/lib/element_mappings.pyx":372 - * # for hexes, the mapped coordinates all go from -1 to 1 - * # if we are inside the element. - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + /* "yt/utilities/lib/element_mappings.pyx":310 + * v = mapped_coord[2] + * w = mapped_coord[0] + * if ((u < thresh) or # <<<<<<<<<<<<<< + * (v < thresh) or + * (w < thresh) or */ if (__pyx_t_1) { - /* "yt/utilities/lib/element_mappings.pyx":375 - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): - * return 0 # <<<<<<<<<<<<<< - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":316 + * (fabs(v - 1) < thresh) or + * (fabs(w - 1) < thresh)): + * return 1 # <<<<<<<<<<<<<< + * return -1 * */ - __pyx_r = 0; + __pyx_r = 1; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":372 - * # for hexes, the mapped coordinates all go from -1 to 1 - * # if we are inside the element. - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + /* "yt/utilities/lib/element_mappings.pyx":310 + * v = mapped_coord[2] + * w = mapped_coord[0] + * if ((u < thresh) or # <<<<<<<<<<<<<< + * (v < thresh) or + * (w < thresh) or */ } - /* "yt/utilities/lib/element_mappings.pyx":376 - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): - * return 0 - * return 1 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":317 + * (fabs(w - 1) < thresh)): + * return 1 + * return -1 # <<<<<<<<<<<<<< + * * - * @cython.boundscheck(False) */ - __pyx_r = 1; + __pyx_r = -1; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":369 + /* "yt/utilities/lib/element_mappings.pyx":291 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * # for hexes, the mapped coordinates all go from -1 to 1 - * # if we are inside the element. + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * cdef double u, v, w + * cdef double thresh = 2.0e-2 */ /* function exit code */ @@ -3900,452 +4684,324 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":381 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) */ -static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_check_mesh_lines(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_3__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_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *)__pyx_v_self)); - /* "yt/utilities/lib/element_mappings.pyx":382 - * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 - */ - __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[0])) - 1.0)) < 1e-1) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "yt/utilities/lib/element_mappings.pyx":383 - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): # <<<<<<<<<<<<<< - * return 1 - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - */ - __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[1])) - 1.0)) < 1e-1) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; - - /* "yt/utilities/lib/element_mappings.pyx":382 - * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 - */ - if (__pyx_t_1) { - - /* "yt/utilities/lib/element_mappings.pyx":384 - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 # <<<<<<<<<<<<<< - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - */ - __pyx_r = 1; - goto __pyx_L0; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/element_mappings.pyx":382 - * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 - */ - } +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_2__reduce_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__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; + int __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "yt/utilities/lib/element_mappings.pyx":385 - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[0])) - 1.0)) < 1e-1) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.inclusion_tol); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.num_mapped_coords); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __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_v_state = __pyx_t_3; + __pyx_t_3 = 0; - /* "yt/utilities/lib/element_mappings.pyx":386 - * return 1 - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): # <<<<<<<<<<<<<< - * return 1 - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, */ - __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[2])) - 1.0)) < 1e-1) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v__dict = __pyx_t_3; + __pyx_t_3 = 0; - /* "yt/utilities/lib/element_mappings.pyx":385 - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 + /* "(tree fragment)":5 + * state = (self.inclusion_tol, self.num_mapped_coords) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True + */ + __pyx_t_4 = (__pyx_v__dict != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ - if (__pyx_t_1) { + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; - /* "yt/utilities/lib/element_mappings.pyx":387 - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 # <<<<<<<<<<<<<< - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + /* "(tree fragment)":7 + * if _dict is not None: + * state += _dict, + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False */ - __pyx_r = 1; - goto __pyx_L0; + __pyx_v_use_setstate = 1; - /* "yt/utilities/lib/element_mappings.pyx":385 - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 + /* "(tree fragment)":5 + * state = (self.inclusion_tol, self.num_mapped_coords) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ + goto __pyx_L3; } - /* "yt/utilities/lib/element_mappings.pyx":388 - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_P1Sampler3D, (type(self), 0xa37a4b3, None), state */ - __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[1])) - 1.0)) < 1e-1) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L8_bool_binop_done; + /*else*/ { + __pyx_v_use_setstate = 0; } + __pyx_L3:; - /* "yt/utilities/lib/element_mappings.pyx":389 - * return 1 - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): # <<<<<<<<<<<<<< - * return 1 - * else: - */ - __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[2])) - 1.0)) < 1e-1) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L8_bool_binop_done:; - - /* "yt/utilities/lib/element_mappings.pyx":388 - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_P1Sampler3D, (type(self), 0xa37a4b3, None), state + * else: */ - if (__pyx_t_1) { + __pyx_t_5 = (__pyx_v_use_setstate != 0); + if (__pyx_t_5) { - /* "yt/utilities/lib/element_mappings.pyx":390 - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 # <<<<<<<<<<<<<< - * else: - * return -1 + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_P1Sampler3D, (type(self), 0xa37a4b3, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_P1Sampler3D, (type(self), 0xa37a4b3, state) */ - __pyx_r = 1; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_P1Sampler3D); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_171418803); + __Pyx_GIVEREF(__pyx_int_171418803); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_171418803); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":388 - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_P1Sampler3D, (type(self), 0xa37a4b3, None), state + * else: */ } - /* "yt/utilities/lib/element_mappings.pyx":392 - * return 1 - * else: - * return -1 # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":13 + * return __pyx_unpickle_P1Sampler3D, (type(self), 0xa37a4b3, None), state + * else: + * return __pyx_unpickle_P1Sampler3D, (type(self), 0xa37a4b3, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_P1Sampler3D__set_state(self, __pyx_state) */ /*else*/ { - __pyx_r = -1; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_P1Sampler3D); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_171418803); + __Pyx_GIVEREF(__pyx_int_171418803); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_171418803); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; } - /* "yt/utilities/lib/element_mappings.pyx":381 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.inclusion_tol, self.num_mapped_coords) */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.P1Sampler3D.__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; } -/* "yt/utilities/lib/element_mappings.pyx":399 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void Q1Function3D(double* fx, # <<<<<<<<<<<<<< - * double* x, - * double* vertices, - */ - -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_Q1Function3D(double *__pyx_v_fx, double *__pyx_v_x, double *__pyx_v_vertices, double *__pyx_v_phys_x) { - int __pyx_v_i; - double __pyx_v_rm; - double __pyx_v_rp; - double __pyx_v_sm; - double __pyx_v_sp; - double __pyx_v_tm; - double __pyx_v_tp; - int __pyx_t_1; - - /* "yt/utilities/lib/element_mappings.pyx":406 - * cdef double rm, rp, sm, sp, tm, tp - * - * rm = 1.0 - x[0] # <<<<<<<<<<<<<< - * rp = 1.0 + x[0] - * sm = 1.0 - x[1] +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_P1Sampler3D, (type(self), 0xa37a4b3, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_P1Sampler3D__set_state(self, __pyx_state) */ - __pyx_v_rm = (1.0 - (__pyx_v_x[0])); - /* "yt/utilities/lib/element_mappings.pyx":407 - * - * rm = 1.0 - x[0] - * rp = 1.0 + x[0] # <<<<<<<<<<<<<< - * sm = 1.0 - x[1] - * sp = 1.0 + x[1] - */ - __pyx_v_rp = (1.0 + (__pyx_v_x[0])); +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_5__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_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "yt/utilities/lib/element_mappings.pyx":408 - * rm = 1.0 - x[0] - * rp = 1.0 + x[0] - * sm = 1.0 - x[1] # <<<<<<<<<<<<<< - * sp = 1.0 + x[1] - * tm = 1.0 - x[2] - */ - __pyx_v_sm = (1.0 - (__pyx_v_x[1])); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/element_mappings.pyx":409 - * rp = 1.0 + x[0] - * sm = 1.0 - x[1] - * sp = 1.0 + x[1] # <<<<<<<<<<<<<< - * tm = 1.0 - x[2] - * tp = 1.0 + x[2] - */ - __pyx_v_sp = (1.0 + (__pyx_v_x[1])); +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_4__setstate_cython__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "yt/utilities/lib/element_mappings.pyx":410 - * sm = 1.0 - x[1] - * sp = 1.0 + x[1] - * tm = 1.0 - x[2] # <<<<<<<<<<<<<< - * tp = 1.0 + x[2] - * + /* "(tree fragment)":15 + * return __pyx_unpickle_P1Sampler3D, (type(self), 0xa37a4b3, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_P1Sampler3D__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - __pyx_v_tm = (1.0 - (__pyx_v_x[2])); + 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_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_P1Sampler3D__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; - /* "yt/utilities/lib/element_mappings.pyx":411 - * sp = 1.0 + x[1] - * tm = 1.0 - x[2] - * tp = 1.0 + x[2] # <<<<<<<<<<<<<< - * - * for i in range(3): + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_P1Sampler3D, (type(self), 0xa37a4b3, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_P1Sampler3D__set_state(self, __pyx_state) */ - __pyx_v_tp = (1.0 + (__pyx_v_x[2])); - /* "yt/utilities/lib/element_mappings.pyx":413 - * tp = 1.0 + x[2] - * - * for i in range(3): # <<<<<<<<<<<<<< - * fx[i] = vertices[0 + i]*rm*sm*tm \ - * + vertices[3 + i]*rp*sm*tm \ - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.P1Sampler3D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/element_mappings.pyx":414 +/* "yt/utilities/lib/element_mappings.pyx":333 + * ''' * - * for i in range(3): - * fx[i] = vertices[0 + i]*rm*sm*tm \ # <<<<<<<<<<<<<< - * + vertices[3 + i]*rp*sm*tm \ - * + vertices[6 + i]*rp*sp*tm \ + * def __init__(self): # <<<<<<<<<<<<<< + * super(NonlinearSolveSampler3D, self).__init__() + * self.tolerance = 1.0e-9 */ - (__pyx_v_fx[__pyx_v_i]) = ((((((((((((__pyx_v_vertices[(0 + __pyx_v_i)]) * __pyx_v_rm) * __pyx_v_sm) * __pyx_v_tm) + ((((__pyx_v_vertices[(3 + __pyx_v_i)]) * __pyx_v_rp) * __pyx_v_sm) * __pyx_v_tm)) + ((((__pyx_v_vertices[(6 + __pyx_v_i)]) * __pyx_v_rp) * __pyx_v_sp) * __pyx_v_tm)) + ((((__pyx_v_vertices[(9 + __pyx_v_i)]) * __pyx_v_rm) * __pyx_v_sp) * __pyx_v_tm)) + ((((__pyx_v_vertices[(12 + __pyx_v_i)]) * __pyx_v_rm) * __pyx_v_sm) * __pyx_v_tp)) + ((((__pyx_v_vertices[(15 + __pyx_v_i)]) * __pyx_v_rp) * __pyx_v_sm) * __pyx_v_tp)) + ((((__pyx_v_vertices[(18 + __pyx_v_i)]) * __pyx_v_rp) * __pyx_v_sp) * __pyx_v_tp)) + ((((__pyx_v_vertices[(21 + __pyx_v_i)]) * __pyx_v_rm) * __pyx_v_sp) * __pyx_v_tp)) - (8.0 * (__pyx_v_phys_x[__pyx_v_i]))); - } - /* "yt/utilities/lib/element_mappings.pyx":399 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void Q1Function3D(double* fx, # <<<<<<<<<<<<<< - * double* x, - * double* vertices, - */ +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *)__pyx_v_self)); /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":428 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void Q1Jacobian3D(double* rcol, # <<<<<<<<<<<<<< - * double* scol, - * double* tcol, - */ - -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_Q1Jacobian3D(double *__pyx_v_rcol, double *__pyx_v_scol, double *__pyx_v_tcol, double *__pyx_v_x, double *__pyx_v_vertices, CYTHON_UNUSED double *__pyx_v_phys_x) { - int __pyx_v_i; - double __pyx_v_rm; - double __pyx_v_rp; - double __pyx_v_sm; - double __pyx_v_sp; - double __pyx_v_tm; - double __pyx_v_tp; - int __pyx_t_1; - - /* "yt/utilities/lib/element_mappings.pyx":437 - * cdef double rm, rp, sm, sp, tm, tp - * - * rm = 1.0 - x[0] # <<<<<<<<<<<<<< - * rp = 1.0 + x[0] - * sm = 1.0 - x[1] - */ - __pyx_v_rm = (1.0 - (__pyx_v_x[0])); - - /* "yt/utilities/lib/element_mappings.pyx":438 - * - * rm = 1.0 - x[0] - * rp = 1.0 + x[0] # <<<<<<<<<<<<<< - * sm = 1.0 - x[1] - * sp = 1.0 + x[1] - */ - __pyx_v_rp = (1.0 + (__pyx_v_x[0])); - - /* "yt/utilities/lib/element_mappings.pyx":439 - * rm = 1.0 - x[0] - * rp = 1.0 + x[0] - * sm = 1.0 - x[1] # <<<<<<<<<<<<<< - * sp = 1.0 + x[1] - * tm = 1.0 - x[2] - */ - __pyx_v_sm = (1.0 - (__pyx_v_x[1])); - - /* "yt/utilities/lib/element_mappings.pyx":440 - * rp = 1.0 + x[0] - * sm = 1.0 - x[1] - * sp = 1.0 + x[1] # <<<<<<<<<<<<<< - * tm = 1.0 - x[2] - * tp = 1.0 + x[2] - */ - __pyx_v_sp = (1.0 + (__pyx_v_x[1])); - - /* "yt/utilities/lib/element_mappings.pyx":441 - * sm = 1.0 - x[1] - * sp = 1.0 + x[1] - * tm = 1.0 - x[2] # <<<<<<<<<<<<<< - * tp = 1.0 + x[2] - * - */ - __pyx_v_tm = (1.0 - (__pyx_v_x[2])); - - /* "yt/utilities/lib/element_mappings.pyx":442 - * sp = 1.0 + x[1] - * tm = 1.0 - x[2] - * tp = 1.0 + x[2] # <<<<<<<<<<<<<< - * - * for i in range(3): - */ - __pyx_v_tp = (1.0 + (__pyx_v_x[2])); - - /* "yt/utilities/lib/element_mappings.pyx":444 - * tp = 1.0 + x[2] - * - * for i in range(3): # <<<<<<<<<<<<<< - * rcol[i] = -sm*tm*vertices[0 + i] + sm*tm*vertices[3 + i] + \ - * sp*tm*vertices[6 + i] - sp*tm*vertices[9 + i] - \ - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "yt/utilities/lib/element_mappings.pyx":445 - * - * for i in range(3): - * rcol[i] = -sm*tm*vertices[0 + i] + sm*tm*vertices[3 + i] + \ # <<<<<<<<<<<<<< - * sp*tm*vertices[6 + i] - sp*tm*vertices[9 + i] - \ - * sm*tp*vertices[12 + i] + sm*tp*vertices[15 + i] + \ - */ - (__pyx_v_rcol[__pyx_v_i]) = ((((((((((-__pyx_v_sm) * __pyx_v_tm) * (__pyx_v_vertices[(0 + __pyx_v_i)])) + ((__pyx_v_sm * __pyx_v_tm) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) + ((__pyx_v_sp * __pyx_v_tm) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) - ((__pyx_v_sp * __pyx_v_tm) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) - ((__pyx_v_sm * __pyx_v_tp) * (__pyx_v_vertices[(12 + __pyx_v_i)]))) + ((__pyx_v_sm * __pyx_v_tp) * (__pyx_v_vertices[(15 + __pyx_v_i)]))) + ((__pyx_v_sp * __pyx_v_tp) * (__pyx_v_vertices[(18 + __pyx_v_i)]))) - ((__pyx_v_sp * __pyx_v_tp) * (__pyx_v_vertices[(21 + __pyx_v_i)]))); - - /* "yt/utilities/lib/element_mappings.pyx":449 - * sm*tp*vertices[12 + i] + sm*tp*vertices[15 + i] + \ - * sp*tp*vertices[18 + i] - sp*tp*vertices[21 + i] - * scol[i] = -rm*tm*vertices[0 + i] - rp*tm*vertices[3 + i] + \ # <<<<<<<<<<<<<< - * rp*tm*vertices[6 + i] + rm*tm*vertices[9 + i] - \ - * rm*tp*vertices[12 + i] - rp*tp*vertices[15 + i] + \ - */ - (__pyx_v_scol[__pyx_v_i]) = ((((((((((-__pyx_v_rm) * __pyx_v_tm) * (__pyx_v_vertices[(0 + __pyx_v_i)])) - ((__pyx_v_rp * __pyx_v_tm) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) + ((__pyx_v_rp * __pyx_v_tm) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) + ((__pyx_v_rm * __pyx_v_tm) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) - ((__pyx_v_rm * __pyx_v_tp) * (__pyx_v_vertices[(12 + __pyx_v_i)]))) - ((__pyx_v_rp * __pyx_v_tp) * (__pyx_v_vertices[(15 + __pyx_v_i)]))) + ((__pyx_v_rp * __pyx_v_tp) * (__pyx_v_vertices[(18 + __pyx_v_i)]))) + ((__pyx_v_rm * __pyx_v_tp) * (__pyx_v_vertices[(21 + __pyx_v_i)]))); - - /* "yt/utilities/lib/element_mappings.pyx":453 - * rm*tp*vertices[12 + i] - rp*tp*vertices[15 + i] + \ - * rp*tp*vertices[18 + i] + rm*tp*vertices[21 + i] - * tcol[i] = -rm*sm*vertices[0 + i] - rp*sm*vertices[3 + i] - \ # <<<<<<<<<<<<<< - * rp*sp*vertices[6 + i] - rm*sp*vertices[9 + i] + \ - * rm*sm*vertices[12 + i] + rp*sm*vertices[15 + i] + \ - */ - (__pyx_v_tcol[__pyx_v_i]) = ((((((((((-__pyx_v_rm) * __pyx_v_sm) * (__pyx_v_vertices[(0 + __pyx_v_i)])) - ((__pyx_v_rp * __pyx_v_sm) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) - ((__pyx_v_rp * __pyx_v_sp) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) - ((__pyx_v_rm * __pyx_v_sp) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) + ((__pyx_v_rm * __pyx_v_sm) * (__pyx_v_vertices[(12 + __pyx_v_i)]))) + ((__pyx_v_rp * __pyx_v_sm) * (__pyx_v_vertices[(15 + __pyx_v_i)]))) + ((__pyx_v_rp * __pyx_v_sp) * (__pyx_v_vertices[(18 + __pyx_v_i)]))) + ((__pyx_v_rm * __pyx_v_sp) * (__pyx_v_vertices[(21 + __pyx_v_i)]))); - } - - /* "yt/utilities/lib/element_mappings.pyx":428 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void Q1Jacobian3D(double* rcol, # <<<<<<<<<<<<<< - * double* scol, - * double* tcol, - */ - - /* function exit code */ -} - -/* "yt/utilities/lib/element_mappings.pyx":467 - * ''' - * - * def __init__(self): # <<<<<<<<<<<<<< - * super(S2Sampler3D, self).__init__() - * self.num_mapped_coords = 3 - */ - -/* Python wrapper */ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} - if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_self) { +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -4353,25 +5009,25 @@ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "yt/utilities/lib/element_mappings.pyx":468 + /* "yt/utilities/lib/element_mappings.pyx":334 * * def __init__(self): - * super(S2Sampler3D, self).__init__() # <<<<<<<<<<<<<< - * self.num_mapped_coords = 3 - * self.dim = 3 + * super(NonlinearSolveSampler3D, self).__init__() # <<<<<<<<<<<<<< + * self.tolerance = 1.0e-9 + * self.max_iter = 10 */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)); + __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -4385,57 +5041,39 @@ } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/element_mappings.pyx":469 + /* "yt/utilities/lib/element_mappings.pyx":335 * def __init__(self): - * super(S2Sampler3D, self).__init__() - * self.num_mapped_coords = 3 # <<<<<<<<<<<<<< - * self.dim = 3 - * self.func = S2Function3D - */ - __pyx_v_self->__pyx_base.__pyx_base.num_mapped_coords = 3; - - /* "yt/utilities/lib/element_mappings.pyx":470 - * super(S2Sampler3D, self).__init__() - * self.num_mapped_coords = 3 - * self.dim = 3 # <<<<<<<<<<<<<< - * self.func = S2Function3D - * self.jac = S2Jacobian3D - */ - __pyx_v_self->__pyx_base.dim = 3; - - /* "yt/utilities/lib/element_mappings.pyx":471 - * self.num_mapped_coords = 3 - * self.dim = 3 - * self.func = S2Function3D # <<<<<<<<<<<<<< - * self.jac = S2Jacobian3D + * super(NonlinearSolveSampler3D, self).__init__() + * self.tolerance = 1.0e-9 # <<<<<<<<<<<<<< + * self.max_iter = 10 * */ - __pyx_v_self->__pyx_base.func = __pyx_f_2yt_9utilities_3lib_16element_mappings_S2Function3D; + __pyx_v_self->tolerance = 1.0e-9; - /* "yt/utilities/lib/element_mappings.pyx":472 - * self.dim = 3 - * self.func = S2Function3D - * self.jac = S2Jacobian3D # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":336 + * super(NonlinearSolveSampler3D, self).__init__() + * self.tolerance = 1.0e-9 + * self.max_iter = 10 # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_v_self->__pyx_base.jac = __pyx_f_2yt_9utilities_3lib_16element_mappings_S2Jacobian3D; + __pyx_v_self->max_iter = 10; - /* "yt/utilities/lib/element_mappings.pyx":467 + /* "yt/utilities/lib/element_mappings.pyx":333 * ''' * * def __init__(self): # <<<<<<<<<<<<<< - * super(S2Sampler3D, self).__init__() - * self.num_mapped_coords = 3 + * super(NonlinearSolveSampler3D, self).__init__() + * self.tolerance = 1.0e-9 */ /* function exit code */ @@ -4445,899 +5083,1053 @@ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.S2Sampler3D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.NonlinearSolveSampler3D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":477 +/* "yt/utilities/lib/element_mappings.pyx":341 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< - * cdef double F, r, s, t, rm, rp, sm, sp, tm, tp - * + * cdef void map_real_to_unit(self, # <<<<<<<<<<<<<< + * double* mapped_x, + * double* vertices, */ -static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { - double __pyx_v_F; - double __pyx_v_r; - double __pyx_v_s; - double __pyx_v_t; - double __pyx_v_rm; - double __pyx_v_rp; - double __pyx_v_sm; - double __pyx_v_sp; - double __pyx_v_tm; - double __pyx_v_tp; - double __pyx_r; +static void __pyx_f_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_map_real_to_unit(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *__pyx_v_self, double *__pyx_v_mapped_x, double *__pyx_v_vertices, double *__pyx_v_physical_x) { + int __pyx_v_i; + double __pyx_v_d; + double __pyx_v_lam; + double __pyx_v_f[3]; + double __pyx_v_r[3]; + double __pyx_v_s[3]; + double __pyx_v_t[3]; + double __pyx_v_x[3]; + double __pyx_v_xk[3]; + double __pyx_v_s_n[3]; + int __pyx_v_iterations; + double __pyx_v_err_c; + double __pyx_v_err_plus; + double __pyx_v_alpha; + double __pyx_v_min_lam; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; - /* "yt/utilities/lib/element_mappings.pyx":480 - * cdef double F, r, s, t, rm, rp, sm, sp, tm, tp - * - * r = coord[0] # <<<<<<<<<<<<<< - * rm = 1.0 - r - * rp = 1.0 + r + /* "yt/utilities/lib/element_mappings.pyx":376 + * cdef double[3] t + * cdef double[3] x, xk, s_n + * cdef int iterations = 0 # <<<<<<<<<<<<<< + * cdef double err_c, err_plus + * cdef double alpha = 1e-4 */ - __pyx_v_r = (__pyx_v_coord[0]); + __pyx_v_iterations = 0; - /* "yt/utilities/lib/element_mappings.pyx":481 + /* "yt/utilities/lib/element_mappings.pyx":378 + * cdef int iterations = 0 + * cdef double err_c, err_plus + * cdef double alpha = 1e-4 # <<<<<<<<<<<<<< + * cdef double min_lam = 1e-6 * - * r = coord[0] - * rm = 1.0 - r # <<<<<<<<<<<<<< - * rp = 1.0 + r + */ + __pyx_v_alpha = 1e-4; + + /* "yt/utilities/lib/element_mappings.pyx":379 + * cdef double err_c, err_plus + * cdef double alpha = 1e-4 + * cdef double min_lam = 1e-6 # <<<<<<<<<<<<<< * + * # initial guess */ - __pyx_v_rm = (1.0 - __pyx_v_r); + __pyx_v_min_lam = 1e-6; - /* "yt/utilities/lib/element_mappings.pyx":482 - * r = coord[0] - * rm = 1.0 - r - * rp = 1.0 + r # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":382 + * + * # initial guess + * for i in range(3): # <<<<<<<<<<<<<< + * x[i] = 0.0 * - * s = coord[1] */ - __pyx_v_rp = (1.0 + __pyx_v_r); + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/element_mappings.pyx":484 - * rp = 1.0 + r + /* "yt/utilities/lib/element_mappings.pyx":383 + * # initial guess + * for i in range(3): + * x[i] = 0.0 # <<<<<<<<<<<<<< * - * s = coord[1] # <<<<<<<<<<<<<< - * sm = 1.0 - s - * sp = 1.0 + s + * # initial error norm */ - __pyx_v_s = (__pyx_v_coord[1]); + (__pyx_v_x[__pyx_v_i]) = 0.0; + } - /* "yt/utilities/lib/element_mappings.pyx":485 + /* "yt/utilities/lib/element_mappings.pyx":386 * - * s = coord[1] - * sm = 1.0 - s # <<<<<<<<<<<<<< - * sp = 1.0 + s + * # initial error norm + * self.func(f, x, vertices, physical_x) # <<<<<<<<<<<<<< + * err_c = maxnorm(f, 3) * */ - __pyx_v_sm = (1.0 - __pyx_v_s); + __pyx_v_self->func(__pyx_v_f, __pyx_v_x, __pyx_v_vertices, __pyx_v_physical_x); - /* "yt/utilities/lib/element_mappings.pyx":486 - * s = coord[1] - * sm = 1.0 - s - * sp = 1.0 + s # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":387 + * # initial error norm + * self.func(f, x, vertices, physical_x) + * err_c = maxnorm(f, 3) # <<<<<<<<<<<<<< * - * t = coord[2] + * # begin Newton iteration */ - __pyx_v_sp = (1.0 + __pyx_v_s); + __pyx_v_err_c = __pyx_f_2yt_9utilities_3lib_16element_mappings_maxnorm(__pyx_v_f, 3); - /* "yt/utilities/lib/element_mappings.pyx":488 - * sp = 1.0 + s + /* "yt/utilities/lib/element_mappings.pyx":390 * - * t = coord[2] # <<<<<<<<<<<<<< - * tm = 1.0 - t - * tp = 1.0 + t + * # begin Newton iteration + * while (err_c > self.tolerance and iterations < self.max_iter): # <<<<<<<<<<<<<< + * self.jac(r, s, t, x, vertices, physical_x) + * d = determinant_3x3(r, s, t) */ - __pyx_v_t = (__pyx_v_coord[2]); + while (1) { + __pyx_t_3 = ((__pyx_v_err_c > __pyx_v_self->tolerance) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_iterations < __pyx_v_self->max_iter) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L7_bool_binop_done:; + if (!__pyx_t_2) break; - /* "yt/utilities/lib/element_mappings.pyx":489 - * - * t = coord[2] - * tm = 1.0 - t # <<<<<<<<<<<<<< - * tp = 1.0 + t + /* "yt/utilities/lib/element_mappings.pyx":391 + * # begin Newton iteration + * while (err_c > self.tolerance and iterations < self.max_iter): + * self.jac(r, s, t, x, vertices, physical_x) # <<<<<<<<<<<<<< + * d = determinant_3x3(r, s, t) * */ - __pyx_v_tm = (1.0 - __pyx_v_t); + __pyx_v_self->jac(__pyx_v_r, __pyx_v_s, __pyx_v_t, __pyx_v_x, __pyx_v_vertices, __pyx_v_physical_x); - /* "yt/utilities/lib/element_mappings.pyx":490 - * t = coord[2] - * tm = 1.0 - t - * tp = 1.0 + t # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":392 + * while (err_c > self.tolerance and iterations < self.max_iter): + * self.jac(r, s, t, x, vertices, physical_x) + * d = determinant_3x3(r, s, t) # <<<<<<<<<<<<<< * - * F = rm*sm*tm*(-r - s - t - 2.0)*vals[0] \ + * s_n[0] = - (determinant_3x3(f, s, t)/d) */ - __pyx_v_tp = (1.0 + __pyx_v_t); + __pyx_v_d = __pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_r, __pyx_v_s, __pyx_v_t); - /* "yt/utilities/lib/element_mappings.pyx":511 - * + 2.0*rp*(1.0 - s**2)*tp*vals[17] \ - * + 2.0*(1.0 - r**2)*sp*tp*vals[18] \ - * + 2.0*rm*(1.0 - s**2)*tp*vals[19] # <<<<<<<<<<<<<< - * return 0.125*F + /* "yt/utilities/lib/element_mappings.pyx":394 + * d = determinant_3x3(r, s, t) * + * s_n[0] = - (determinant_3x3(f, s, t)/d) # <<<<<<<<<<<<<< + * s_n[1] = - (determinant_3x3(r, f, t)/d) + * s_n[2] = - (determinant_3x3(r, s, f)/d) */ - __pyx_v_F = (((((((((((((((((((((((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tm) * ((((-__pyx_v_r) - __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vals[0])) + ((((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tm) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vals[1]))) + ((((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tm) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vals[2]))) + ((((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tm) * ((((-__pyx_v_r) + __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vals[3]))) + ((((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tp) * ((((-__pyx_v_r) - __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vals[4]))) + ((((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tp) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vals[5]))) + ((((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tp) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vals[6]))) + ((((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tp) * ((((-__pyx_v_r) + __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vals[7]))) + ((((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_sm) * __pyx_v_tm) * (__pyx_v_vals[8]))) + ((((2.0 * __pyx_v_rp) * (1.0 - pow(__pyx_v_s, 2.0))) * __pyx_v_tm) * (__pyx_v_vals[9]))) + ((((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_sp) * __pyx_v_tm) * (__pyx_v_vals[10]))) + ((((2.0 * __pyx_v_rm) * (1.0 - pow(__pyx_v_s, 2.0))) * __pyx_v_tm) * (__pyx_v_vals[11]))) + ((((2.0 * __pyx_v_rm) * __pyx_v_sm) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vals[12]))) + ((((2.0 * __pyx_v_rp) * __pyx_v_sm) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vals[13]))) + ((((2.0 * __pyx_v_rp) * __pyx_v_sp) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vals[14]))) + ((((2.0 * __pyx_v_rm) * __pyx_v_sp) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vals[15]))) + ((((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_sm) * __pyx_v_tp) * (__pyx_v_vals[16]))) + ((((2.0 * __pyx_v_rp) * (1.0 - pow(__pyx_v_s, 2.0))) * __pyx_v_tp) * (__pyx_v_vals[17]))) + ((((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_sp) * __pyx_v_tp) * (__pyx_v_vals[18]))) + ((((2.0 * __pyx_v_rm) * (1.0 - pow(__pyx_v_s, 2.0))) * __pyx_v_tp) * (__pyx_v_vals[19]))); + (__pyx_v_s_n[0]) = (-(__pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_f, __pyx_v_s, __pyx_v_t) / __pyx_v_d)); - /* "yt/utilities/lib/element_mappings.pyx":512 - * + 2.0*(1.0 - r**2)*sp*tp*vals[18] \ - * + 2.0*rm*(1.0 - s**2)*tp*vals[19] - * return 0.125*F # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":395 * - * @cython.boundscheck(False) + * s_n[0] = - (determinant_3x3(f, s, t)/d) + * s_n[1] = - (determinant_3x3(r, f, t)/d) # <<<<<<<<<<<<<< + * s_n[2] = - (determinant_3x3(r, s, f)/d) + * xk[0] = x[0] + s_n[0] */ - __pyx_r = (0.125 * __pyx_v_F); - goto __pyx_L0; + (__pyx_v_s_n[1]) = (-(__pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_r, __pyx_v_f, __pyx_v_t) / __pyx_v_d)); - /* "yt/utilities/lib/element_mappings.pyx":477 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< - * cdef double F, r, s, t, rm, rp, sm, sp, tm, tp - * - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/element_mappings.pyx":517 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + /* "yt/utilities/lib/element_mappings.pyx":396 + * s_n[0] = - (determinant_3x3(f, s, t)/d) + * s_n[1] = - (determinant_3x3(r, f, t)/d) + * s_n[2] = - (determinant_3x3(r, s, f)/d) # <<<<<<<<<<<<<< + * xk[0] = x[0] + s_n[0] + * xk[1] = x[1] + s_n[1] */ + (__pyx_v_s_n[2]) = (-(__pyx_f_2yt_9utilities_3lib_16element_mappings_determinant_3x3(__pyx_v_r, __pyx_v_s, __pyx_v_f) / __pyx_v_d)); -static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - - /* "yt/utilities/lib/element_mappings.pyx":518 - * @cython.cdivision(True) - * cdef int check_inside(self, double* mapped_coord) nogil: - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): - */ - __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[0])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "yt/utilities/lib/element_mappings.pyx":519 - * cdef int check_inside(self, double* mapped_coord) nogil: - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): - * return 0 + /* "yt/utilities/lib/element_mappings.pyx":397 + * s_n[1] = - (determinant_3x3(r, f, t)/d) + * s_n[2] = - (determinant_3x3(r, s, f)/d) + * xk[0] = x[0] + s_n[0] # <<<<<<<<<<<<<< + * xk[1] = x[1] + s_n[1] + * xk[2] = x[2] + s_n[2] */ - __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[1])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } + (__pyx_v_xk[0]) = ((__pyx_v_x[0]) + (__pyx_v_s_n[0])); - /* "yt/utilities/lib/element_mappings.pyx":520 - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< - * return 0 - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":398 + * s_n[2] = - (determinant_3x3(r, s, f)/d) + * xk[0] = x[0] + s_n[0] + * xk[1] = x[1] + s_n[1] # <<<<<<<<<<<<<< + * xk[2] = x[2] + s_n[2] + * self.func(f, xk, vertices, physical_x) */ - __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[2])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; + (__pyx_v_xk[1]) = ((__pyx_v_x[1]) + (__pyx_v_s_n[1])); - /* "yt/utilities/lib/element_mappings.pyx":518 - * @cython.cdivision(True) - * cdef int check_inside(self, double* mapped_coord) nogil: - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + /* "yt/utilities/lib/element_mappings.pyx":399 + * xk[0] = x[0] + s_n[0] + * xk[1] = x[1] + s_n[1] + * xk[2] = x[2] + s_n[2] # <<<<<<<<<<<<<< + * self.func(f, xk, vertices, physical_x) + * err_plus = maxnorm(f, 3) */ - if (__pyx_t_1) { + (__pyx_v_xk[2]) = ((__pyx_v_x[2]) + (__pyx_v_s_n[2])); - /* "yt/utilities/lib/element_mappings.pyx":521 - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): - * return 0 # <<<<<<<<<<<<<< - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":400 + * xk[1] = x[1] + s_n[1] + * xk[2] = x[2] + s_n[2] + * self.func(f, xk, vertices, physical_x) # <<<<<<<<<<<<<< + * err_plus = maxnorm(f, 3) * */ - __pyx_r = 0; - goto __pyx_L0; + __pyx_v_self->func(__pyx_v_f, __pyx_v_xk, __pyx_v_vertices, __pyx_v_physical_x); - /* "yt/utilities/lib/element_mappings.pyx":518 - * @cython.cdivision(True) - * cdef int check_inside(self, double* mapped_coord) nogil: - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + /* "yt/utilities/lib/element_mappings.pyx":401 + * xk[2] = x[2] + s_n[2] + * self.func(f, xk, vertices, physical_x) + * err_plus = maxnorm(f, 3) # <<<<<<<<<<<<<< + * + * lam = 1 */ - } + __pyx_v_err_plus = __pyx_f_2yt_9utilities_3lib_16element_mappings_maxnorm(__pyx_v_f, 3); - /* "yt/utilities/lib/element_mappings.pyx":522 - * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): - * return 0 - * return 1 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":403 + * err_plus = maxnorm(f, 3) * - * @cython.boundscheck(False) + * lam = 1 # <<<<<<<<<<<<<< + * while err_plus > err_c * (1. - alpha * lam) and lam > min_lam: + * lam = lam / 2 */ - __pyx_r = 1; - goto __pyx_L0; + __pyx_v_lam = 1.0; - /* "yt/utilities/lib/element_mappings.pyx":517 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + /* "yt/utilities/lib/element_mappings.pyx":404 + * + * lam = 1 + * while err_plus > err_c * (1. - alpha * lam) and lam > min_lam: # <<<<<<<<<<<<<< + * lam = lam / 2 + * xk[0] = x[0] + lam * s_n[0] */ + while (1) { + __pyx_t_3 = ((__pyx_v_err_plus > (__pyx_v_err_c * (1. - (__pyx_v_alpha * __pyx_v_lam)))) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_lam > __pyx_v_min_lam) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L11_bool_binop_done:; + if (!__pyx_t_2) break; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/element_mappings.pyx":527 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + /* "yt/utilities/lib/element_mappings.pyx":405 + * lam = 1 + * while err_plus > err_c * (1. - alpha * lam) and lam > min_lam: + * lam = lam / 2 # <<<<<<<<<<<<<< + * xk[0] = x[0] + lam * s_n[0] + * xk[1] = x[1] + lam * s_n[1] */ + __pyx_v_lam = (__pyx_v_lam / 2.0); -static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_check_mesh_lines(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - - /* "yt/utilities/lib/element_mappings.pyx":528 - * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":406 + * while err_plus > err_c * (1. - alpha * lam) and lam > min_lam: + * lam = lam / 2 + * xk[0] = x[0] + lam * s_n[0] # <<<<<<<<<<<<<< + * xk[1] = x[1] + lam * s_n[1] + * xk[2] = x[2] + lam * s_n[2] */ - __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[0])) - 1.0)) < 1e-1) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } + (__pyx_v_xk[0]) = ((__pyx_v_x[0]) + (__pyx_v_lam * (__pyx_v_s_n[0]))); - /* "yt/utilities/lib/element_mappings.pyx":529 - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): # <<<<<<<<<<<<<< - * return 1 - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + /* "yt/utilities/lib/element_mappings.pyx":407 + * lam = lam / 2 + * xk[0] = x[0] + lam * s_n[0] + * xk[1] = x[1] + lam * s_n[1] # <<<<<<<<<<<<<< + * xk[2] = x[2] + lam * s_n[2] + * self.func(f, xk, vertices, physical_x) */ - __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[1])) - 1.0)) < 1e-1) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; + (__pyx_v_xk[1]) = ((__pyx_v_x[1]) + (__pyx_v_lam * (__pyx_v_s_n[1]))); - /* "yt/utilities/lib/element_mappings.pyx":528 - * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":408 + * xk[0] = x[0] + lam * s_n[0] + * xk[1] = x[1] + lam * s_n[1] + * xk[2] = x[2] + lam * s_n[2] # <<<<<<<<<<<<<< + * self.func(f, xk, vertices, physical_x) + * err_plus = maxnorm(f, 3) */ - if (__pyx_t_1) { + (__pyx_v_xk[2]) = ((__pyx_v_x[2]) + (__pyx_v_lam * (__pyx_v_s_n[2]))); - /* "yt/utilities/lib/element_mappings.pyx":530 - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 # <<<<<<<<<<<<<< - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + /* "yt/utilities/lib/element_mappings.pyx":409 + * xk[1] = x[1] + lam * s_n[1] + * xk[2] = x[2] + lam * s_n[2] + * self.func(f, xk, vertices, physical_x) # <<<<<<<<<<<<<< + * err_plus = maxnorm(f, 3) + * */ - __pyx_r = 1; - goto __pyx_L0; + __pyx_v_self->func(__pyx_v_f, __pyx_v_xk, __pyx_v_vertices, __pyx_v_physical_x); - /* "yt/utilities/lib/element_mappings.pyx":528 - * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":410 + * xk[2] = x[2] + lam * s_n[2] + * self.func(f, xk, vertices, physical_x) + * err_plus = maxnorm(f, 3) # <<<<<<<<<<<<<< + * + * x[0] = xk[0] */ - } + __pyx_v_err_plus = __pyx_f_2yt_9utilities_3lib_16element_mappings_maxnorm(__pyx_v_f, 3); + } - /* "yt/utilities/lib/element_mappings.pyx":531 - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":412 + * err_plus = maxnorm(f, 3) + * + * x[0] = xk[0] # <<<<<<<<<<<<<< + * x[1] = xk[1] + * x[2] = xk[2] */ - __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[0])) - 1.0)) < 1e-1) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } + (__pyx_v_x[0]) = (__pyx_v_xk[0]); - /* "yt/utilities/lib/element_mappings.pyx":532 - * return 1 - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): # <<<<<<<<<<<<<< - * return 1 - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and + /* "yt/utilities/lib/element_mappings.pyx":413 + * + * x[0] = xk[0] + * x[1] = xk[1] # <<<<<<<<<<<<<< + * x[2] = xk[2] + * err_c = err_plus */ - __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[2])) - 1.0)) < 1e-1) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + (__pyx_v_x[1]) = (__pyx_v_xk[1]); - /* "yt/utilities/lib/element_mappings.pyx":531 - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":414 + * x[0] = xk[0] + * x[1] = xk[1] + * x[2] = xk[2] # <<<<<<<<<<<<<< + * err_c = err_plus + * iterations += 1 */ - if (__pyx_t_1) { + (__pyx_v_x[2]) = (__pyx_v_xk[2]); - /* "yt/utilities/lib/element_mappings.pyx":533 - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 # <<<<<<<<<<<<<< - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + /* "yt/utilities/lib/element_mappings.pyx":415 + * x[1] = xk[1] + * x[2] = xk[2] + * err_c = err_plus # <<<<<<<<<<<<<< + * iterations += 1 + * */ - __pyx_r = 1; - goto __pyx_L0; + __pyx_v_err_c = __pyx_v_err_plus; - /* "yt/utilities/lib/element_mappings.pyx":531 - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): - * return 1 - * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":416 + * x[2] = xk[2] + * err_c = err_plus + * iterations += 1 # <<<<<<<<<<<<<< + * + * if (err_c > self.tolerance): */ + __pyx_v_iterations = (__pyx_v_iterations + 1); } - /* "yt/utilities/lib/element_mappings.pyx":534 - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":418 + * iterations += 1 + * + * if (err_c > self.tolerance): # <<<<<<<<<<<<<< + * # we did not converge, set bogus value + * for i in range(3): */ - __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[1])) - 1.0)) < 1e-1) != 0); + __pyx_t_2 = ((__pyx_v_err_c > __pyx_v_self->tolerance) != 0); if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L8_bool_binop_done; - } - /* "yt/utilities/lib/element_mappings.pyx":535 - * return 1 - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): # <<<<<<<<<<<<<< - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":420 + * if (err_c > self.tolerance): + * # we did not converge, set bogus value + * for i in range(3): # <<<<<<<<<<<<<< + * mapped_x[i] = -99.0 * else: */ - __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[2])) - 1.0)) < 1e-1) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L8_bool_binop_done:; - - /* "yt/utilities/lib/element_mappings.pyx":534 - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 - */ - if (__pyx_t_1) { + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/element_mappings.pyx":536 - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":421 + * # we did not converge, set bogus value + * for i in range(3): + * mapped_x[i] = -99.0 # <<<<<<<<<<<<<< * else: - * return -1 + * for i in range(3): */ - __pyx_r = 1; - goto __pyx_L0; + (__pyx_v_mapped_x[__pyx_v_i]) = -99.0; + } - /* "yt/utilities/lib/element_mappings.pyx":534 - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 - * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< - * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":418 + * iterations += 1 + * + * if (err_c > self.tolerance): # <<<<<<<<<<<<<< + * # we did not converge, set bogus value + * for i in range(3): */ + goto __pyx_L13; } - /* "yt/utilities/lib/element_mappings.pyx":538 - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":423 + * mapped_x[i] = -99.0 * else: - * return -1 # <<<<<<<<<<<<<< - * + * for i in range(3): # <<<<<<<<<<<<<< + * mapped_x[i] = x[i] * */ /*else*/ { - __pyx_r = -1; - goto __pyx_L0; + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/element_mappings.pyx":424 + * else: + * for i in range(3): + * mapped_x[i] = x[i] # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mapped_x[__pyx_v_i]) = (__pyx_v_x[__pyx_v_i]); + } } + __pyx_L13:; - /* "yt/utilities/lib/element_mappings.pyx":527 + /* "yt/utilities/lib/element_mappings.pyx":341 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and - * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * cdef void map_real_to_unit(self, # <<<<<<<<<<<<<< + * double* mapped_x, + * double* vertices, */ /* function exit code */ - __pyx_L0:; - return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":544 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void S2Function3D(double* fx, # <<<<<<<<<<<<<< - * double* x, - * double* vertices, +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_S2Function3D(double *__pyx_v_fx, double *__pyx_v_x, double *__pyx_v_vertices, double *__pyx_v_phys_x) { - int __pyx_v_i; - double __pyx_v_r; - double __pyx_v_s; - double __pyx_v_t; - double __pyx_v_rm; - double __pyx_v_rp; - double __pyx_v_sm; - double __pyx_v_sp; - double __pyx_v_tm; - double __pyx_v_tp; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_3__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_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *)__pyx_v_self)); - /* "yt/utilities/lib/element_mappings.pyx":551 - * cdef double r, s, t, rm, rp, sm, sp, tm, tp - * - * r = x[0] # <<<<<<<<<<<<<< - * rm = 1.0 - r - * rp = 1.0 + r + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *__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.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") */ - __pyx_v_r = (__pyx_v_x[0]); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, 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) - /* "yt/utilities/lib/element_mappings.pyx":552 - * - * r = x[0] - * rm = 1.0 - r # <<<<<<<<<<<<<< - * rp = 1.0 + r - * + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_v_rm = (1.0 - __pyx_v_r); - /* "yt/utilities/lib/element_mappings.pyx":553 - * r = x[0] - * rm = 1.0 - r - * rp = 1.0 + r # <<<<<<<<<<<<<< - * - * s = x[1] + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.NonlinearSolveSampler3D.__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") */ - __pyx_v_rp = (1.0 + __pyx_v_r); - /* "yt/utilities/lib/element_mappings.pyx":555 - * rp = 1.0 + r - * - * s = x[1] # <<<<<<<<<<<<<< - * sm = 1.0 - s - * sp = 1.0 + s +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_5__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_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - __pyx_v_s = (__pyx_v_x[1]); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, 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) - /* "yt/utilities/lib/element_mappings.pyx":556 - * - * s = x[1] - * sm = 1.0 - s # <<<<<<<<<<<<<< - * sp = 1.0 + s - * + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") */ - __pyx_v_sm = (1.0 - __pyx_v_s); - /* "yt/utilities/lib/element_mappings.pyx":557 - * s = x[1] - * sm = 1.0 - s - * sp = 1.0 + s # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.NonlinearSolveSampler3D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":435 + * ''' * - * t = x[2] + * def __init__(self): # <<<<<<<<<<<<<< + * super(Q1Sampler3D, self).__init__() + * self.num_mapped_coords = 3 */ - __pyx_v_sp = (1.0 + __pyx_v_s); - /* "yt/utilities/lib/element_mappings.pyx":559 - * sp = 1.0 + s +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "yt/utilities/lib/element_mappings.pyx":436 * - * t = x[2] # <<<<<<<<<<<<<< - * tm = 1.0 - t - * tp = 1.0 + t + * def __init__(self): + * super(Q1Sampler3D, self).__init__() # <<<<<<<<<<<<<< + * self.num_mapped_coords = 3 + * self.dim = 3 */ - __pyx_v_t = (__pyx_v_x[2]); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/element_mappings.pyx":560 - * - * t = x[2] - * tm = 1.0 - t # <<<<<<<<<<<<<< - * tp = 1.0 + t - * + /* "yt/utilities/lib/element_mappings.pyx":437 + * def __init__(self): + * super(Q1Sampler3D, self).__init__() + * self.num_mapped_coords = 3 # <<<<<<<<<<<<<< + * self.dim = 3 + * self.func = Q1Function3D */ - __pyx_v_tm = (1.0 - __pyx_v_t); + __pyx_v_self->__pyx_base.__pyx_base.num_mapped_coords = 3; - /* "yt/utilities/lib/element_mappings.pyx":561 - * t = x[2] - * tm = 1.0 - t - * tp = 1.0 + t # <<<<<<<<<<<<<< - * - * for i in range(3): + /* "yt/utilities/lib/element_mappings.pyx":438 + * super(Q1Sampler3D, self).__init__() + * self.num_mapped_coords = 3 + * self.dim = 3 # <<<<<<<<<<<<<< + * self.func = Q1Function3D + * self.jac = Q1Jacobian3D */ - __pyx_v_tp = (1.0 + __pyx_v_t); + __pyx_v_self->__pyx_base.dim = 3; - /* "yt/utilities/lib/element_mappings.pyx":563 - * tp = 1.0 + t + /* "yt/utilities/lib/element_mappings.pyx":439 + * self.num_mapped_coords = 3 + * self.dim = 3 + * self.func = Q1Function3D # <<<<<<<<<<<<<< + * self.jac = Q1Jacobian3D * - * for i in range(3): # <<<<<<<<<<<<<< - * fx[i] = rm*sm*tm*(-r - s - t - 2.0)*vertices[0 + i] \ - * + rp*sm*tm*( r - s - t - 2.0)*vertices[3 + i] \ */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + __pyx_v_self->__pyx_base.func = __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Function3D; - /* "yt/utilities/lib/element_mappings.pyx":564 + /* "yt/utilities/lib/element_mappings.pyx":440 + * self.dim = 3 + * self.func = Q1Function3D + * self.jac = Q1Jacobian3D # <<<<<<<<<<<<<< * - * for i in range(3): - * fx[i] = rm*sm*tm*(-r - s - t - 2.0)*vertices[0 + i] \ # <<<<<<<<<<<<<< - * + rp*sm*tm*( r - s - t - 2.0)*vertices[3 + i] \ - * + rp*sp*tm*( r + s - t - 2.0)*vertices[6 + i] \ + * @cython.boundscheck(False) */ - (__pyx_v_fx[__pyx_v_i]) = ((((((((((((((((((((((((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tm) * ((((-__pyx_v_r) - __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(0 + __pyx_v_i)])) + ((((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tm) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tm) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) + ((((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tm) * ((((-__pyx_v_r) + __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) + ((((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tp) * ((((-__pyx_v_r) - __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(12 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tp) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(15 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tp) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(18 + __pyx_v_i)]))) + ((((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tp) * ((((-__pyx_v_r) + __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(21 + __pyx_v_i)]))) + ((((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_sm) * __pyx_v_tm) * (__pyx_v_vertices[(24 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rp) * (1.0 - pow(__pyx_v_s, 2.0))) * __pyx_v_tm) * (__pyx_v_vertices[(27 + __pyx_v_i)]))) + ((((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_sp) * __pyx_v_tm) * (__pyx_v_vertices[(30 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rm) * (1.0 - pow(__pyx_v_s, 2.0))) * __pyx_v_tm) * (__pyx_v_vertices[(33 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rm) * __pyx_v_sm) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vertices[(36 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rp) * __pyx_v_sm) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vertices[(39 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rp) * __pyx_v_sp) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vertices[(42 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rm) * __pyx_v_sp) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vertices[(45 + __pyx_v_i)]))) + ((((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_sm) * __pyx_v_tp) * (__pyx_v_vertices[(48 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rp) * (1.0 - pow(__pyx_v_s, 2.0))) * __pyx_v_tp) * (__pyx_v_vertices[(51 + __pyx_v_i)]))) + ((((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_sp) * __pyx_v_tp) * (__pyx_v_vertices[(54 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rm) * (1.0 - pow(__pyx_v_s, 2.0))) * __pyx_v_tp) * (__pyx_v_vertices[(57 + __pyx_v_i)]))) - (8.0 * (__pyx_v_phys_x[__pyx_v_i]))); - } + __pyx_v_self->__pyx_base.jac = __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Jacobian3D; - /* "yt/utilities/lib/element_mappings.pyx":544 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void S2Function3D(double* fx, # <<<<<<<<<<<<<< - * double* x, - * double* vertices, + /* "yt/utilities/lib/element_mappings.pyx":435 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(Q1Sampler3D, self).__init__() + * self.num_mapped_coords = 3 */ /* function exit code */ -} - -/* "yt/utilities/lib/element_mappings.pyx":590 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void S2Jacobian3D(double* rcol, # <<<<<<<<<<<<<< - * double* scol, - * double* tcol, - */ - -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_S2Jacobian3D(double *__pyx_v_rcol, double *__pyx_v_scol, double *__pyx_v_tcol, double *__pyx_v_x, double *__pyx_v_vertices, CYTHON_UNUSED double *__pyx_v_phys_x) { - int __pyx_v_i; - double __pyx_v_r; - double __pyx_v_s; - double __pyx_v_t; + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.Q1Sampler3D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":445 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double F, rm, rp, sm, sp, tm, tp + * + */ + +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { + double __pyx_v_F; double __pyx_v_rm; double __pyx_v_rp; double __pyx_v_sm; double __pyx_v_sp; double __pyx_v_tm; double __pyx_v_tp; - int __pyx_t_1; - - /* "yt/utilities/lib/element_mappings.pyx":599 - * cdef double r, s, t, rm, rp, sm, sp, tm, tp - * - * r = x[0] # <<<<<<<<<<<<<< - * rm = 1.0 - r - * rp = 1.0 + r - */ - __pyx_v_r = (__pyx_v_x[0]); + double __pyx_r; - /* "yt/utilities/lib/element_mappings.pyx":600 - * - * r = x[0] - * rm = 1.0 - r # <<<<<<<<<<<<<< - * rp = 1.0 + r + /* "yt/utilities/lib/element_mappings.pyx":448 + * cdef double F, rm, rp, sm, sp, tm, tp * + * rm = 1.0 - coord[0] # <<<<<<<<<<<<<< + * rp = 1.0 + coord[0] + * sm = 1.0 - coord[1] */ - __pyx_v_rm = (1.0 - __pyx_v_r); + __pyx_v_rm = (1.0 - (__pyx_v_coord[0])); - /* "yt/utilities/lib/element_mappings.pyx":601 - * r = x[0] - * rm = 1.0 - r - * rp = 1.0 + r # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":449 * - * s = x[1] + * rm = 1.0 - coord[0] + * rp = 1.0 + coord[0] # <<<<<<<<<<<<<< + * sm = 1.0 - coord[1] + * sp = 1.0 + coord[1] */ - __pyx_v_rp = (1.0 + __pyx_v_r); + __pyx_v_rp = (1.0 + (__pyx_v_coord[0])); - /* "yt/utilities/lib/element_mappings.pyx":603 - * rp = 1.0 + r - * - * s = x[1] # <<<<<<<<<<<<<< - * sm = 1.0 - s - * sp = 1.0 + s + /* "yt/utilities/lib/element_mappings.pyx":450 + * rm = 1.0 - coord[0] + * rp = 1.0 + coord[0] + * sm = 1.0 - coord[1] # <<<<<<<<<<<<<< + * sp = 1.0 + coord[1] + * tm = 1.0 - coord[2] */ - __pyx_v_s = (__pyx_v_x[1]); + __pyx_v_sm = (1.0 - (__pyx_v_coord[1])); - /* "yt/utilities/lib/element_mappings.pyx":604 - * - * s = x[1] - * sm = 1.0 - s # <<<<<<<<<<<<<< - * sp = 1.0 + s - * + /* "yt/utilities/lib/element_mappings.pyx":451 + * rp = 1.0 + coord[0] + * sm = 1.0 - coord[1] + * sp = 1.0 + coord[1] # <<<<<<<<<<<<<< + * tm = 1.0 - coord[2] + * tp = 1.0 + coord[2] */ - __pyx_v_sm = (1.0 - __pyx_v_s); + __pyx_v_sp = (1.0 + (__pyx_v_coord[1])); - /* "yt/utilities/lib/element_mappings.pyx":605 - * s = x[1] - * sm = 1.0 - s - * sp = 1.0 + s # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":452 + * sm = 1.0 - coord[1] + * sp = 1.0 + coord[1] + * tm = 1.0 - coord[2] # <<<<<<<<<<<<<< + * tp = 1.0 + coord[2] * - * t = x[2] */ - __pyx_v_sp = (1.0 + __pyx_v_s); + __pyx_v_tm = (1.0 - (__pyx_v_coord[2])); - /* "yt/utilities/lib/element_mappings.pyx":607 - * sp = 1.0 + s + /* "yt/utilities/lib/element_mappings.pyx":453 + * sp = 1.0 + coord[1] + * tm = 1.0 - coord[2] + * tp = 1.0 + coord[2] # <<<<<<<<<<<<<< * - * t = x[2] # <<<<<<<<<<<<<< - * tm = 1.0 - t - * tp = 1.0 + t + * F = vals[0]*rm*sm*tm + vals[1]*rp*sm*tm + vals[2]*rp*sp*tm + vals[3]*rm*sp*tm + \ */ - __pyx_v_t = (__pyx_v_x[2]); + __pyx_v_tp = (1.0 + (__pyx_v_coord[2])); - /* "yt/utilities/lib/element_mappings.pyx":608 + /* "yt/utilities/lib/element_mappings.pyx":456 * - * t = x[2] - * tm = 1.0 - t # <<<<<<<<<<<<<< - * tp = 1.0 + t + * F = vals[0]*rm*sm*tm + vals[1]*rp*sm*tm + vals[2]*rp*sp*tm + vals[3]*rm*sp*tm + \ + * vals[4]*rm*sm*tp + vals[5]*rp*sm*tp + vals[6]*rp*sp*tp + vals[7]*rm*sp*tp # <<<<<<<<<<<<<< + * return 0.125*F * */ - __pyx_v_tm = (1.0 - __pyx_v_t); + __pyx_v_F = (((((((((((__pyx_v_vals[0]) * __pyx_v_rm) * __pyx_v_sm) * __pyx_v_tm) + ((((__pyx_v_vals[1]) * __pyx_v_rp) * __pyx_v_sm) * __pyx_v_tm)) + ((((__pyx_v_vals[2]) * __pyx_v_rp) * __pyx_v_sp) * __pyx_v_tm)) + ((((__pyx_v_vals[3]) * __pyx_v_rm) * __pyx_v_sp) * __pyx_v_tm)) + ((((__pyx_v_vals[4]) * __pyx_v_rm) * __pyx_v_sm) * __pyx_v_tp)) + ((((__pyx_v_vals[5]) * __pyx_v_rp) * __pyx_v_sm) * __pyx_v_tp)) + ((((__pyx_v_vals[6]) * __pyx_v_rp) * __pyx_v_sp) * __pyx_v_tp)) + ((((__pyx_v_vals[7]) * __pyx_v_rm) * __pyx_v_sp) * __pyx_v_tp)); - /* "yt/utilities/lib/element_mappings.pyx":609 - * t = x[2] - * tm = 1.0 - t - * tp = 1.0 + t # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":457 + * F = vals[0]*rm*sm*tm + vals[1]*rp*sm*tm + vals[2]*rp*sp*tm + vals[3]*rm*sp*tm + \ + * vals[4]*rm*sm*tp + vals[5]*rp*sm*tp + vals[6]*rp*sp*tp + vals[7]*rm*sp*tp + * return 0.125*F # <<<<<<<<<<<<<< * - * for i in range(3): + * @cython.boundscheck(False) */ - __pyx_v_tp = (1.0 + __pyx_v_t); + __pyx_r = (0.125 * __pyx_v_F); + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":611 - * tp = 1.0 + t + /* "yt/utilities/lib/element_mappings.pyx":445 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double F, rm, rp, sm, sp, tm, tp * - * for i in range(3): # <<<<<<<<<<<<<< - * rcol[i] = (sm*tm*(r + s + t + 2.0) - rm*sm*tm)*vertices[0 + i] \ - * + (sm*tm*(r - s - t - 2.0) + rp*sm*tm)*vertices[3 + i] \ */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/element_mappings.pyx":612 - * - * for i in range(3): - * rcol[i] = (sm*tm*(r + s + t + 2.0) - rm*sm*tm)*vertices[0 + i] \ # <<<<<<<<<<<<<< - * + (sm*tm*(r - s - t - 2.0) + rp*sm*tm)*vertices[3 + i] \ - * + (sp*tm*(r + s - t - 2.0) + rp*sp*tm)*vertices[6 + i] \ + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":462 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for hexes, the mapped coordinates all go from -1 to 1 + * # if we are inside the element. */ - (__pyx_v_rcol[__pyx_v_i]) = (((((((((((((((((((((((__pyx_v_sm * __pyx_v_tm) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tm)) * (__pyx_v_vertices[(0 + __pyx_v_i)])) + ((((__pyx_v_sm * __pyx_v_tm) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tm)) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) + ((((__pyx_v_sp * __pyx_v_tm) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tm)) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) + ((((__pyx_v_sp * __pyx_v_tm) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tm)) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) + ((((__pyx_v_sm * __pyx_v_tp) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tp)) * (__pyx_v_vertices[(12 + __pyx_v_i)]))) + ((((__pyx_v_sm * __pyx_v_tp) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tp)) * (__pyx_v_vertices[(15 + __pyx_v_i)]))) + ((((__pyx_v_sp * __pyx_v_tp) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tp)) * (__pyx_v_vertices[(18 + __pyx_v_i)]))) + ((((__pyx_v_sp * __pyx_v_tp) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tp)) * (__pyx_v_vertices[(21 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_r) * __pyx_v_sm) * __pyx_v_tm) * (__pyx_v_vertices[(24 + __pyx_v_i)]))) + (((2.0 * (1.0 - pow(__pyx_v_s, 2.0))) * __pyx_v_tm) * (__pyx_v_vertices[(27 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_r) * __pyx_v_sp) * __pyx_v_tm) * (__pyx_v_vertices[(30 + __pyx_v_i)]))) - (((2.0 * (1.0 - pow(__pyx_v_s, 2.0))) * __pyx_v_tm) * (__pyx_v_vertices[(33 + __pyx_v_i)]))) - (((2.0 * __pyx_v_sm) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vertices[(36 + __pyx_v_i)]))) + (((2.0 * __pyx_v_sm) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vertices[(39 + __pyx_v_i)]))) + (((2.0 * __pyx_v_sp) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vertices[(42 + __pyx_v_i)]))) - (((2.0 * __pyx_v_sp) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vertices[(45 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_r) * __pyx_v_sm) * __pyx_v_tp) * (__pyx_v_vertices[(48 + __pyx_v_i)]))) + (((2.0 * (1.0 - pow(__pyx_v_s, 2.0))) * __pyx_v_tp) * (__pyx_v_vertices[(51 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_r) * __pyx_v_sp) * __pyx_v_tp) * (__pyx_v_vertices[(54 + __pyx_v_i)]))) - (((2.0 * (1.0 - pow(__pyx_v_s, 2.0))) * __pyx_v_tp) * (__pyx_v_vertices[(57 + __pyx_v_i)]))); - /* "yt/utilities/lib/element_mappings.pyx":632 - * - 4.0*r*sp*tp*vertices[54 + i] \ - * - 2.0*(1.0 - s**2)*tp*vertices[57 + i] - * scol[i] = ( rm*tm*(r + s + t + 2.0) - rm*sm*tm)*vertices[0 + i] \ # <<<<<<<<<<<<<< - * + (-rp*tm*(r - s - t - 2.0) - rp*sm*tm)*vertices[3 + i] \ - * + ( rp*tm*(r + s - t - 2.0) + rp*sp*tm)*vertices[6 + i] \ +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + + /* "yt/utilities/lib/element_mappings.pyx":465 + * # for hexes, the mapped coordinates all go from -1 to 1 + * # if we are inside the element. + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): */ - (__pyx_v_scol[__pyx_v_i]) = (((((((((((((((((((((((__pyx_v_rm * __pyx_v_tm) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tm)) * (__pyx_v_vertices[(0 + __pyx_v_i)])) + (((((-__pyx_v_rp) * __pyx_v_tm) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) - 2.0)) - ((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tm)) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_tm) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tm)) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) + (((((-__pyx_v_rm) * __pyx_v_tm) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) + 2.0)) + ((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tm)) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) + ((((__pyx_v_rm * __pyx_v_tp) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tp)) * (__pyx_v_vertices[(12 + __pyx_v_i)]))) + (((((-__pyx_v_rp) * __pyx_v_tp) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) - 2.0)) - ((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tp)) * (__pyx_v_vertices[(15 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_tp) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tp)) * (__pyx_v_vertices[(18 + __pyx_v_i)]))) + (((((-__pyx_v_rm) * __pyx_v_tp) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) + 2.0)) + ((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tp)) * (__pyx_v_vertices[(21 + __pyx_v_i)]))) - (((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_tm) * (__pyx_v_vertices[(24 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rp) * __pyx_v_s) * __pyx_v_tm) * (__pyx_v_vertices[(27 + __pyx_v_i)]))) + (((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_tm) * (__pyx_v_vertices[(30 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rm) * __pyx_v_s) * __pyx_v_tm) * (__pyx_v_vertices[(33 + __pyx_v_i)]))) - (((2.0 * __pyx_v_rm) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vertices[(36 + __pyx_v_i)]))) - (((2.0 * __pyx_v_rp) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vertices[(39 + __pyx_v_i)]))) + (((2.0 * __pyx_v_rp) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vertices[(42 + __pyx_v_i)]))) + (((2.0 * __pyx_v_rm) * (1.0 - pow(__pyx_v_t, 2.0))) * (__pyx_v_vertices[(45 + __pyx_v_i)]))) - (((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_tp) * (__pyx_v_vertices[(48 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rp) * __pyx_v_s) * __pyx_v_tp) * (__pyx_v_vertices[(51 + __pyx_v_i)]))) + (((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_tp) * (__pyx_v_vertices[(54 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rm) * __pyx_v_s) * __pyx_v_tp) * (__pyx_v_vertices[(57 + __pyx_v_i)]))); + __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[0])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } - /* "yt/utilities/lib/element_mappings.pyx":652 - * + 2.0*(1.0 - r**2)*tp*vertices[54 + i] \ - * - 4.0*rm*s*tp*vertices[57 + i] - * tcol[i] = ( rm*sm*(r + s + t + 2.0) - rm*sm*tm)*vertices[0 + i] \ # <<<<<<<<<<<<<< - * + (-rp*sm*(r - s - t - 2.0) - rp*sm*tm)*vertices[3 + i] \ - * + (-rp*sp*(r + s - t - 2.0) - rp*sp*tm)*vertices[6 + i] \ + /* "yt/utilities/lib/element_mappings.pyx":466 + * # if we are inside the element. + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + * return 0 */ - (__pyx_v_tcol[__pyx_v_i]) = (((((((((((((((((((((((__pyx_v_rm * __pyx_v_sm) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tm)) * (__pyx_v_vertices[(0 + __pyx_v_i)])) + (((((-__pyx_v_rp) * __pyx_v_sm) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) - 2.0)) - ((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tm)) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) + (((((-__pyx_v_rp) * __pyx_v_sp) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) - 2.0)) - ((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tm)) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) + ((((__pyx_v_rm * __pyx_v_sp) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tm)) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) + (((((-__pyx_v_rm) * __pyx_v_sm) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) + 2.0)) + ((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tp)) * (__pyx_v_vertices[(12 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_sm) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tp)) * (__pyx_v_vertices[(15 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_sp) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tp)) * (__pyx_v_vertices[(18 + __pyx_v_i)]))) + (((((-__pyx_v_rm) * __pyx_v_sp) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) + 2.0)) + ((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tp)) * (__pyx_v_vertices[(21 + __pyx_v_i)]))) - (((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_sm) * (__pyx_v_vertices[(24 + __pyx_v_i)]))) - (((2.0 * __pyx_v_rp) * (1.0 - pow(__pyx_v_s, 2.0))) * (__pyx_v_vertices[(27 + __pyx_v_i)]))) - (((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_sp) * (__pyx_v_vertices[(30 + __pyx_v_i)]))) - (((2.0 * __pyx_v_rm) * (1.0 - pow(__pyx_v_s, 2.0))) * (__pyx_v_vertices[(33 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rm) * __pyx_v_sm) * __pyx_v_t) * (__pyx_v_vertices[(36 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rp) * __pyx_v_sm) * __pyx_v_t) * (__pyx_v_vertices[(39 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rp) * __pyx_v_sp) * __pyx_v_t) * (__pyx_v_vertices[(42 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rm) * __pyx_v_sp) * __pyx_v_t) * (__pyx_v_vertices[(45 + __pyx_v_i)]))) + (((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_sm) * (__pyx_v_vertices[(48 + __pyx_v_i)]))) + (((2.0 * __pyx_v_rp) * (1.0 - pow(__pyx_v_s, 2.0))) * (__pyx_v_vertices[(51 + __pyx_v_i)]))) + (((2.0 * (1.0 - pow(__pyx_v_r, 2.0))) * __pyx_v_sp) * (__pyx_v_vertices[(54 + __pyx_v_i)]))) + (((2.0 * __pyx_v_rm) * (1.0 - pow(__pyx_v_s, 2.0))) * (__pyx_v_vertices[(57 + __pyx_v_i)]))); + __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[1])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; } - /* "yt/utilities/lib/element_mappings.pyx":590 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void S2Jacobian3D(double* rcol, # <<<<<<<<<<<<<< - * double* scol, - * double* tcol, + /* "yt/utilities/lib/element_mappings.pyx":467 + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 + * return 1 + */ + __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[2])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + + /* "yt/utilities/lib/element_mappings.pyx":465 + * # for hexes, the mapped coordinates all go from -1 to 1 + * # if we are inside the element. + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): */ + if (__pyx_t_1) { - /* function exit code */ -} + /* "yt/utilities/lib/element_mappings.pyx":468 + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + * return 0 # <<<<<<<<<<<<<< + * return 1 + * + */ + __pyx_r = 0; + goto __pyx_L0; -/* "yt/utilities/lib/element_mappings.pyx":682 - * ''' + /* "yt/utilities/lib/element_mappings.pyx":465 + * # for hexes, the mapped coordinates all go from -1 to 1 + * # if we are inside the element. + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":469 + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + * return 0 + * return 1 # <<<<<<<<<<<<<< * - * def __init__(self): # <<<<<<<<<<<<<< - * super(W1Sampler3D, self).__init__() - * self.num_mapped_coords = 3 + * @cython.boundscheck(False) */ + __pyx_r = 1; + goto __pyx_L0; -/* Python wrapper */ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} - if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *)__pyx_v_self)); + /* "yt/utilities/lib/element_mappings.pyx":462 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for hexes, the mapped coordinates all go from -1 to 1 + * # if we are inside the element. + */ /* function exit code */ - __Pyx_RefNannyFinishContext(); + __pyx_L0:; return __pyx_r; } -static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__init__", 0); +/* "yt/utilities/lib/element_mappings.pyx":474 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + */ - /* "yt/utilities/lib/element_mappings.pyx":683 - * - * def __init__(self): - * super(W1Sampler3D, self).__init__() # <<<<<<<<<<<<<< - * self.num_mapped_coords = 3 - * self.dim = 3 +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_check_mesh_lines(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + + /* "yt/utilities/lib/element_mappings.pyx":475 + * @cython.cdivision(True) + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - 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_2 = ((fabs((fabs((__pyx_v_mapped_coord[0])) - 1.0)) < 1e-1) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":476 + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): # <<<<<<<<<<<<<< + * return 1 + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + */ + __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[1])) - 1.0)) < 1e-1) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + + /* "yt/utilities/lib/element_mappings.pyx":475 + * @cython.cdivision(True) + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 + */ + if (__pyx_t_1) { + + /* "yt/utilities/lib/element_mappings.pyx":477 + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 # <<<<<<<<<<<<<< + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":475 + * @cython.cdivision(True) + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":478 + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 + */ + __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[0])) - 1.0)) < 1e-1) != 0); + if (__pyx_t_2) { } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/element_mappings.pyx":684 - * def __init__(self): - * super(W1Sampler3D, self).__init__() - * self.num_mapped_coords = 3 # <<<<<<<<<<<<<< - * self.dim = 3 - * self.func = W1Function3D + /* "yt/utilities/lib/element_mappings.pyx":479 + * return 1 + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): # <<<<<<<<<<<<<< + * return 1 + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and */ - __pyx_v_self->__pyx_base.__pyx_base.num_mapped_coords = 3; + __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[2])) - 1.0)) < 1e-1) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "yt/utilities/lib/element_mappings.pyx":685 - * super(W1Sampler3D, self).__init__() - * self.num_mapped_coords = 3 - * self.dim = 3 # <<<<<<<<<<<<<< - * self.func = W1Function3D - * self.jac = W1Jacobian3D + /* "yt/utilities/lib/element_mappings.pyx":478 + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 */ - __pyx_v_self->__pyx_base.dim = 3; + if (__pyx_t_1) { - /* "yt/utilities/lib/element_mappings.pyx":686 - * self.num_mapped_coords = 3 - * self.dim = 3 - * self.func = W1Function3D # <<<<<<<<<<<<<< - * self.jac = W1Jacobian3D - * + /* "yt/utilities/lib/element_mappings.pyx":480 + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 # <<<<<<<<<<<<<< + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): */ - __pyx_v_self->__pyx_base.func = __pyx_f_2yt_9utilities_3lib_16element_mappings_W1Function3D; + __pyx_r = 1; + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":687 - * self.dim = 3 - * self.func = W1Function3D - * self.jac = W1Jacobian3D # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) + /* "yt/utilities/lib/element_mappings.pyx":478 + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 */ - __pyx_v_self->__pyx_base.jac = __pyx_f_2yt_9utilities_3lib_16element_mappings_W1Jacobian3D; + } - /* "yt/utilities/lib/element_mappings.pyx":682 - * ''' - * - * def __init__(self): # <<<<<<<<<<<<<< - * super(W1Sampler3D, self).__init__() - * self.num_mapped_coords = 3 + /* "yt/utilities/lib/element_mappings.pyx":481 + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 */ + __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[1])) - 1.0)) < 1e-1) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L8_bool_binop_done; + } - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.W1Sampler3D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "yt/utilities/lib/element_mappings.pyx":482 + * return 1 + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): # <<<<<<<<<<<<<< + * return 1 + * else: + */ + __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[2])) - 1.0)) < 1e-1) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L8_bool_binop_done:; -/* "yt/utilities/lib/element_mappings.pyx":692 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< - * cdef double F - * + /* "yt/utilities/lib/element_mappings.pyx":481 + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 */ + if (__pyx_t_1) { -static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { - double __pyx_v_F; - double __pyx_r; + /* "yt/utilities/lib/element_mappings.pyx":483 + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 # <<<<<<<<<<<<<< + * else: + * return -1 + */ + __pyx_r = 1; + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":699 - * vals[2]*coord[1]*(1.0 - coord[2]) + \ - * vals[3]*(1.0 - coord[0] - coord[1])*(1.0 + coord[2]) + \ - * vals[4]*coord[0]*(1.0 + coord[2]) + \ # <<<<<<<<<<<<<< - * vals[5]*coord[1]*(1.0 + coord[2]) - * + /* "yt/utilities/lib/element_mappings.pyx":481 + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 */ - __pyx_v_F = ((((((((__pyx_v_vals[0]) * ((1.0 - (__pyx_v_coord[0])) - (__pyx_v_coord[1]))) * (1.0 - (__pyx_v_coord[2]))) + (((__pyx_v_vals[1]) * (__pyx_v_coord[0])) * (1.0 - (__pyx_v_coord[2])))) + (((__pyx_v_vals[2]) * (__pyx_v_coord[1])) * (1.0 - (__pyx_v_coord[2])))) + (((__pyx_v_vals[3]) * ((1.0 - (__pyx_v_coord[0])) - (__pyx_v_coord[1]))) * (1.0 + (__pyx_v_coord[2])))) + (((__pyx_v_vals[4]) * (__pyx_v_coord[0])) * (1.0 + (__pyx_v_coord[2])))) + (((__pyx_v_vals[5]) * (__pyx_v_coord[1])) * (1.0 + (__pyx_v_coord[2])))); + } - /* "yt/utilities/lib/element_mappings.pyx":702 - * vals[5]*coord[1]*(1.0 + coord[2]) + /* "yt/utilities/lib/element_mappings.pyx":485 + * return 1 + * else: + * return -1 # <<<<<<<<<<<<<< * - * return F / 2.0 # <<<<<<<<<<<<<< * - * @cython.boundscheck(False) */ - __pyx_r = (__pyx_v_F / 2.0); - goto __pyx_L0; + /*else*/ { + __pyx_r = -1; + goto __pyx_L0; + } - /* "yt/utilities/lib/element_mappings.pyx":692 + /* "yt/utilities/lib/element_mappings.pyx":474 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< - * cdef double F - * + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): */ /* function exit code */ @@ -5345,375 +6137,371 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":707 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * # for wedges the bounds of the mapped coordinates are: - * # 0 <= mapped_coord[0] <= 1 - mapped_coord[1] +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ -static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_3__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_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *)__pyx_v_self)); - /* "yt/utilities/lib/element_mappings.pyx":712 - * # 0 <= mapped_coord[1] - * # -1 <= mapped_coord[2] <= 1 - * if (mapped_coord[0] < -self.inclusion_tol or # <<<<<<<<<<<<<< - * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): - * return 0 - */ - __pyx_t_2 = (((__pyx_v_mapped_coord[0]) < (-__pyx_v_self->__pyx_base.__pyx_base.inclusion_tol)) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/element_mappings.pyx":713 - * # -1 <= mapped_coord[2] <= 1 - * if (mapped_coord[0] < -self.inclusion_tol or - * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< - * return 0 - * if (mapped_coord[1] < -self.inclusion_tol): +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__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.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") */ - __pyx_t_2 = (((((__pyx_v_mapped_coord[0]) + (__pyx_v_mapped_coord[1])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, 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) - /* "yt/utilities/lib/element_mappings.pyx":712 - * # 0 <= mapped_coord[1] - * # -1 <= mapped_coord[2] <= 1 - * if (mapped_coord[0] < -self.inclusion_tol or # <<<<<<<<<<<<<< - * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): - * return 0 + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ - if (__pyx_t_1) { - /* "yt/utilities/lib/element_mappings.pyx":714 - * if (mapped_coord[0] < -self.inclusion_tol or - * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): - * return 0 # <<<<<<<<<<<<<< - * if (mapped_coord[1] < -self.inclusion_tol): - * return 0 + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.Q1Sampler3D.__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") */ - __pyx_r = 0; - goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":712 - * # 0 <= mapped_coord[1] - * # -1 <= mapped_coord[2] <= 1 - * if (mapped_coord[0] < -self.inclusion_tol or # <<<<<<<<<<<<<< - * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): - * return 0 +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_5__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_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac 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, 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) - /* "yt/utilities/lib/element_mappings.pyx":715 - * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): - * return 0 - * if (mapped_coord[1] < -self.inclusion_tol): # <<<<<<<<<<<<<< - * return 0 - * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") */ - __pyx_t_1 = (((__pyx_v_mapped_coord[1]) < (-__pyx_v_self->__pyx_base.__pyx_base.inclusion_tol)) != 0); - if (__pyx_t_1) { - /* "yt/utilities/lib/element_mappings.pyx":716 - * return 0 - * if (mapped_coord[1] < -self.inclusion_tol): - * return 0 # <<<<<<<<<<<<<< - * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): - * return 0 + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.Q1Sampler3D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":496 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(S2Sampler3D, self).__init__() + * self.num_mapped_coords = 3 */ - __pyx_r = 0; - goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":715 - * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): - * return 0 - * if (mapped_coord[1] < -self.inclusion_tol): # <<<<<<<<<<<<<< - * return 0 - * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "yt/utilities/lib/element_mappings.pyx":497 + * + * def __init__(self): + * super(S2Sampler3D, self).__init__() # <<<<<<<<<<<<<< + * self.num_mapped_coords = 3 + * self.dim = 3 */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/element_mappings.pyx":717 - * if (mapped_coord[1] < -self.inclusion_tol): - * return 0 - * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< - * return 0 - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":498 + * def __init__(self): + * super(S2Sampler3D, self).__init__() + * self.num_mapped_coords = 3 # <<<<<<<<<<<<<< + * self.dim = 3 + * self.func = S2Function3D */ - __pyx_t_1 = (((fabs((__pyx_v_mapped_coord[2])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); - if (__pyx_t_1) { + __pyx_v_self->__pyx_base.__pyx_base.num_mapped_coords = 3; - /* "yt/utilities/lib/element_mappings.pyx":718 - * return 0 - * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): - * return 0 # <<<<<<<<<<<<<< - * return 1 - * + /* "yt/utilities/lib/element_mappings.pyx":499 + * super(S2Sampler3D, self).__init__() + * self.num_mapped_coords = 3 + * self.dim = 3 # <<<<<<<<<<<<<< + * self.func = S2Function3D + * self.jac = S2Jacobian3D */ - __pyx_r = 0; - goto __pyx_L0; + __pyx_v_self->__pyx_base.dim = 3; - /* "yt/utilities/lib/element_mappings.pyx":717 - * if (mapped_coord[1] < -self.inclusion_tol): - * return 0 - * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< - * return 0 - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":500 + * self.num_mapped_coords = 3 + * self.dim = 3 + * self.func = S2Function3D # <<<<<<<<<<<<<< + * self.jac = S2Jacobian3D + * */ - } + __pyx_v_self->__pyx_base.func = __pyx_f_2yt_9utilities_3lib_16element_mappings_S2Function3D; - /* "yt/utilities/lib/element_mappings.pyx":719 - * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): - * return 0 - * return 1 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":501 + * self.dim = 3 + * self.func = S2Function3D + * self.jac = S2Jacobian3D # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_r = 1; - goto __pyx_L0; + __pyx_v_self->__pyx_base.jac = __pyx_f_2yt_9utilities_3lib_16element_mappings_S2Jacobian3D; - /* "yt/utilities/lib/element_mappings.pyx":707 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * # for wedges the bounds of the mapped coordinates are: - * # 0 <= mapped_coord[0] <= 1 - mapped_coord[1] + /* "yt/utilities/lib/element_mappings.pyx":496 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(S2Sampler3D, self).__init__() + * self.num_mapped_coords = 3 */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.S2Sampler3D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":724 +/* "yt/utilities/lib/element_mappings.pyx":506 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * cdef double r, s, t - * cdef double thresh = 5.0e-2 + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double F, r, s, t, rm, rp, sm, sp, tm, tp + * */ -static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_check_mesh_lines(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { + double __pyx_v_F; double __pyx_v_r; double __pyx_v_s; - CYTHON_UNUSED double __pyx_v_t; - double __pyx_v_thresh; - int __pyx_v_near_edge_r; - int __pyx_v_near_edge_s; - int __pyx_v_near_edge_t; - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; + double __pyx_v_t; + double __pyx_v_rm; + double __pyx_v_rp; + double __pyx_v_sm; + double __pyx_v_sp; + double __pyx_v_tm; + double __pyx_v_tp; + double __pyx_r; - /* "yt/utilities/lib/element_mappings.pyx":726 - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: - * cdef double r, s, t - * cdef double thresh = 5.0e-2 # <<<<<<<<<<<<<< - * r = mapped_coord[0] - * s = mapped_coord[1] - */ - __pyx_v_thresh = 5.0e-2; - - /* "yt/utilities/lib/element_mappings.pyx":727 - * cdef double r, s, t - * cdef double thresh = 5.0e-2 - * r = mapped_coord[0] # <<<<<<<<<<<<<< - * s = mapped_coord[1] - * t = mapped_coord[2] - */ - __pyx_v_r = (__pyx_v_mapped_coord[0]); - - /* "yt/utilities/lib/element_mappings.pyx":728 - * cdef double thresh = 5.0e-2 - * r = mapped_coord[0] - * s = mapped_coord[1] # <<<<<<<<<<<<<< - * t = mapped_coord[2] + /* "yt/utilities/lib/element_mappings.pyx":509 + * cdef double F, r, s, t, rm, rp, sm, sp, tm, tp * + * r = coord[0] # <<<<<<<<<<<<<< + * rm = 1.0 - r + * rp = 1.0 + r */ - __pyx_v_s = (__pyx_v_mapped_coord[1]); + __pyx_v_r = (__pyx_v_coord[0]); - /* "yt/utilities/lib/element_mappings.pyx":729 - * r = mapped_coord[0] - * s = mapped_coord[1] - * t = mapped_coord[2] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":510 * - * cdef int near_edge_r, near_edge_s, near_edge_t - */ - __pyx_v_t = (__pyx_v_mapped_coord[2]); - - /* "yt/utilities/lib/element_mappings.pyx":732 + * r = coord[0] + * rm = 1.0 - r # <<<<<<<<<<<<<< + * rp = 1.0 + r * - * cdef int near_edge_r, near_edge_s, near_edge_t - * near_edge_r = (r < thresh) or (fabs(r + s - 1.0) < thresh) # <<<<<<<<<<<<<< - * near_edge_s = (s < thresh) - * near_edge_t = fabs(fabs(mapped_coord[2]) - 1.0) < thresh */ - __pyx_t_2 = (__pyx_v_r < __pyx_v_thresh); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_2 = (fabs(((__pyx_v_r + __pyx_v_s) - 1.0)) < __pyx_v_thresh); - __pyx_t_1 = __pyx_t_2; - __pyx_L3_bool_binop_done:; - __pyx_v_near_edge_r = __pyx_t_1; + __pyx_v_rm = (1.0 - __pyx_v_r); - /* "yt/utilities/lib/element_mappings.pyx":733 - * cdef int near_edge_r, near_edge_s, near_edge_t - * near_edge_r = (r < thresh) or (fabs(r + s - 1.0) < thresh) - * near_edge_s = (s < thresh) # <<<<<<<<<<<<<< - * near_edge_t = fabs(fabs(mapped_coord[2]) - 1.0) < thresh + /* "yt/utilities/lib/element_mappings.pyx":511 + * r = coord[0] + * rm = 1.0 - r + * rp = 1.0 + r # <<<<<<<<<<<<<< * + * s = coord[1] */ - __pyx_v_near_edge_s = (__pyx_v_s < __pyx_v_thresh); + __pyx_v_rp = (1.0 + __pyx_v_r); - /* "yt/utilities/lib/element_mappings.pyx":734 - * near_edge_r = (r < thresh) or (fabs(r + s - 1.0) < thresh) - * near_edge_s = (s < thresh) - * near_edge_t = fabs(fabs(mapped_coord[2]) - 1.0) < thresh # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":513 + * rp = 1.0 + r * - * # we use ray.instID to pass back whether the ray is near the - */ - __pyx_v_near_edge_t = (fabs((fabs((__pyx_v_mapped_coord[2])) - 1.0)) < __pyx_v_thresh); - - /* "yt/utilities/lib/element_mappings.pyx":738 - * # we use ray.instID to pass back whether the ray is near the - * # element boundary or not (used to annotate mesh lines) - * if (near_edge_r and near_edge_s): # <<<<<<<<<<<<<< - * return 1 - * elif (near_edge_r and near_edge_t): - */ - __pyx_t_3 = (__pyx_v_near_edge_r != 0); - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_3 = (__pyx_v_near_edge_s != 0); - __pyx_t_2 = __pyx_t_3; - __pyx_L6_bool_binop_done:; - if (__pyx_t_2) { - - /* "yt/utilities/lib/element_mappings.pyx":739 - * # element boundary or not (used to annotate mesh lines) - * if (near_edge_r and near_edge_s): - * return 1 # <<<<<<<<<<<<<< - * elif (near_edge_r and near_edge_t): - * return 1 - */ - __pyx_r = 1; - goto __pyx_L0; - - /* "yt/utilities/lib/element_mappings.pyx":738 - * # we use ray.instID to pass back whether the ray is near the - * # element boundary or not (used to annotate mesh lines) - * if (near_edge_r and near_edge_s): # <<<<<<<<<<<<<< - * return 1 - * elif (near_edge_r and near_edge_t): + * s = coord[1] # <<<<<<<<<<<<<< + * sm = 1.0 - s + * sp = 1.0 + s */ - } + __pyx_v_s = (__pyx_v_coord[1]); - /* "yt/utilities/lib/element_mappings.pyx":740 - * if (near_edge_r and near_edge_s): - * return 1 - * elif (near_edge_r and near_edge_t): # <<<<<<<<<<<<<< - * return 1 - * elif (near_edge_s and near_edge_t): + /* "yt/utilities/lib/element_mappings.pyx":514 + * + * s = coord[1] + * sm = 1.0 - s # <<<<<<<<<<<<<< + * sp = 1.0 + s + * */ - __pyx_t_3 = (__pyx_v_near_edge_r != 0); - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L8_bool_binop_done; - } - __pyx_t_3 = (__pyx_v_near_edge_t != 0); - __pyx_t_2 = __pyx_t_3; - __pyx_L8_bool_binop_done:; - if (__pyx_t_2) { + __pyx_v_sm = (1.0 - __pyx_v_s); - /* "yt/utilities/lib/element_mappings.pyx":741 - * return 1 - * elif (near_edge_r and near_edge_t): - * return 1 # <<<<<<<<<<<<<< - * elif (near_edge_s and near_edge_t): - * return 1 + /* "yt/utilities/lib/element_mappings.pyx":515 + * s = coord[1] + * sm = 1.0 - s + * sp = 1.0 + s # <<<<<<<<<<<<<< + * + * t = coord[2] */ - __pyx_r = 1; - goto __pyx_L0; + __pyx_v_sp = (1.0 + __pyx_v_s); - /* "yt/utilities/lib/element_mappings.pyx":740 - * if (near_edge_r and near_edge_s): - * return 1 - * elif (near_edge_r and near_edge_t): # <<<<<<<<<<<<<< - * return 1 - * elif (near_edge_s and near_edge_t): + /* "yt/utilities/lib/element_mappings.pyx":517 + * sp = 1.0 + s + * + * t = coord[2] # <<<<<<<<<<<<<< + * tm = 1.0 - t + * tp = 1.0 + t */ - } + __pyx_v_t = (__pyx_v_coord[2]); - /* "yt/utilities/lib/element_mappings.pyx":742 - * elif (near_edge_r and near_edge_t): - * return 1 - * elif (near_edge_s and near_edge_t): # <<<<<<<<<<<<<< - * return 1 - * else: + /* "yt/utilities/lib/element_mappings.pyx":518 + * + * t = coord[2] + * tm = 1.0 - t # <<<<<<<<<<<<<< + * tp = 1.0 + t + * */ - __pyx_t_3 = (__pyx_v_near_edge_s != 0); - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L10_bool_binop_done; - } - __pyx_t_3 = (__pyx_v_near_edge_t != 0); - __pyx_t_2 = __pyx_t_3; - __pyx_L10_bool_binop_done:; - if (__pyx_t_2) { + __pyx_v_tm = (1.0 - __pyx_v_t); - /* "yt/utilities/lib/element_mappings.pyx":743 - * return 1 - * elif (near_edge_s and near_edge_t): - * return 1 # <<<<<<<<<<<<<< - * else: - * return -1 + /* "yt/utilities/lib/element_mappings.pyx":519 + * t = coord[2] + * tm = 1.0 - t + * tp = 1.0 + t # <<<<<<<<<<<<<< + * + * F = rm*sm*tm*(-r - s - t - 2.0)*vals[0] \ */ - __pyx_r = 1; - goto __pyx_L0; + __pyx_v_tp = (1.0 + __pyx_v_t); - /* "yt/utilities/lib/element_mappings.pyx":742 - * elif (near_edge_r and near_edge_t): - * return 1 - * elif (near_edge_s and near_edge_t): # <<<<<<<<<<<<<< - * return 1 - * else: + /* "yt/utilities/lib/element_mappings.pyx":540 + * + 2.0*rp*(1.0 - s*s)*tp*vals[17] \ + * + 2.0*(1.0 - r*r)*sp*tp*vals[18] \ + * + 2.0*rm*(1.0 - s*s)*tp*vals[19] # <<<<<<<<<<<<<< + * return 0.125*F + * */ - } + __pyx_v_F = (((((((((((((((((((((((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tm) * ((((-__pyx_v_r) - __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vals[0])) + ((((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tm) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vals[1]))) + ((((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tm) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vals[2]))) + ((((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tm) * ((((-__pyx_v_r) + __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vals[3]))) + ((((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tp) * ((((-__pyx_v_r) - __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vals[4]))) + ((((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tp) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vals[5]))) + ((((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tp) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vals[6]))) + ((((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tp) * ((((-__pyx_v_r) + __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vals[7]))) + ((((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_sm) * __pyx_v_tm) * (__pyx_v_vals[8]))) + ((((2.0 * __pyx_v_rp) * (1.0 - (__pyx_v_s * __pyx_v_s))) * __pyx_v_tm) * (__pyx_v_vals[9]))) + ((((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_sp) * __pyx_v_tm) * (__pyx_v_vals[10]))) + ((((2.0 * __pyx_v_rm) * (1.0 - (__pyx_v_s * __pyx_v_s))) * __pyx_v_tm) * (__pyx_v_vals[11]))) + ((((2.0 * __pyx_v_rm) * __pyx_v_sm) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vals[12]))) + ((((2.0 * __pyx_v_rp) * __pyx_v_sm) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vals[13]))) + ((((2.0 * __pyx_v_rp) * __pyx_v_sp) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vals[14]))) + ((((2.0 * __pyx_v_rm) * __pyx_v_sp) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vals[15]))) + ((((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_sm) * __pyx_v_tp) * (__pyx_v_vals[16]))) + ((((2.0 * __pyx_v_rp) * (1.0 - (__pyx_v_s * __pyx_v_s))) * __pyx_v_tp) * (__pyx_v_vals[17]))) + ((((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_sp) * __pyx_v_tp) * (__pyx_v_vals[18]))) + ((((2.0 * __pyx_v_rm) * (1.0 - (__pyx_v_s * __pyx_v_s))) * __pyx_v_tp) * (__pyx_v_vals[19]))); - /* "yt/utilities/lib/element_mappings.pyx":745 - * return 1 - * else: - * return -1 # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/element_mappings.pyx":541 + * + 2.0*(1.0 - r*r)*sp*tp*vals[18] \ + * + 2.0*rm*(1.0 - s*s)*tp*vals[19] + * return 0.125*F # <<<<<<<<<<<<<< * + * @cython.boundscheck(False) */ - /*else*/ { - __pyx_r = -1; - goto __pyx_L0; - } + __pyx_r = (0.125 * __pyx_v_F); + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":724 + /* "yt/utilities/lib/element_mappings.pyx":506 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * cdef double r, s, t - * cdef double thresh = 5.0e-2 + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double F, r, s, t, rm, rp, sm, sp, tm, tp + * */ /* function exit code */ @@ -5721,844 +6509,539 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":751 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void W1Function3D(double* fx, # <<<<<<<<<<<<<< - * double* x, - * double* vertices, +/* "yt/utilities/lib/element_mappings.pyx":546 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or */ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_W1Function3D(double *__pyx_v_fx, double *__pyx_v_x, double *__pyx_v_vertices, double *__pyx_v_phys_x) { - int __pyx_v_i; +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { + int __pyx_r; int __pyx_t_1; + int __pyx_t_2; - /* "yt/utilities/lib/element_mappings.pyx":756 - * double* phys_x) nogil: - * cdef int i - * for i in range(3): # <<<<<<<<<<<<<< - * fx[i] = vertices[0 + i]*(1.0 - x[0] - x[1])*(1.0 - x[2]) \ - * + vertices[3 + i]*x[0]*(1.0 - x[2]) \ + /* "yt/utilities/lib/element_mappings.pyx":547 + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[0])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } - /* "yt/utilities/lib/element_mappings.pyx":757 - * cdef int i - * for i in range(3): - * fx[i] = vertices[0 + i]*(1.0 - x[0] - x[1])*(1.0 - x[2]) \ # <<<<<<<<<<<<<< - * + vertices[3 + i]*x[0]*(1.0 - x[2]) \ - * + vertices[6 + i]*x[1]*(1.0 - x[2]) \ + /* "yt/utilities/lib/element_mappings.pyx":548 + * cdef int check_inside(self, double* mapped_coord) nogil: + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + * return 0 */ - (__pyx_v_fx[__pyx_v_i]) = (((((((((__pyx_v_vertices[(0 + __pyx_v_i)]) * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (1.0 - (__pyx_v_x[2]))) + (((__pyx_v_vertices[(3 + __pyx_v_i)]) * (__pyx_v_x[0])) * (1.0 - (__pyx_v_x[2])))) + (((__pyx_v_vertices[(6 + __pyx_v_i)]) * (__pyx_v_x[1])) * (1.0 - (__pyx_v_x[2])))) + (((__pyx_v_vertices[(9 + __pyx_v_i)]) * ((1.0 - (__pyx_v_x[0])) - (__pyx_v_x[1]))) * (1.0 + (__pyx_v_x[2])))) + (((__pyx_v_vertices[(12 + __pyx_v_i)]) * (__pyx_v_x[0])) * (1.0 + (__pyx_v_x[2])))) + (((__pyx_v_vertices[(15 + __pyx_v_i)]) * (__pyx_v_x[1])) * (1.0 + (__pyx_v_x[2])))) - (2.0 * (__pyx_v_phys_x[__pyx_v_i]))); + __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[1])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; } - /* "yt/utilities/lib/element_mappings.pyx":751 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void W1Function3D(double* fx, # <<<<<<<<<<<<<< - * double* x, - * double* vertices, - */ - - /* function exit code */ -} - -/* "yt/utilities/lib/element_mappings.pyx":769 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void W1Jacobian3D(double* rcol, # <<<<<<<<<<<<<< - * double* scol, - * double* tcol, - */ - -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_W1Jacobian3D(double *__pyx_v_rcol, double *__pyx_v_scol, double *__pyx_v_tcol, double *__pyx_v_x, double *__pyx_v_vertices, CYTHON_UNUSED double *__pyx_v_phys_x) { - int __pyx_v_i; - int __pyx_t_1; - - /* "yt/utilities/lib/element_mappings.pyx":777 - * - * cdef int i - * for i in range(3): # <<<<<<<<<<<<<< - * rcol[i] = (x[2] - 1.0) * vertices[0 + i] \ - * - (x[2] - 1.0) * vertices[3 + i] \ - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "yt/utilities/lib/element_mappings.pyx":778 - * cdef int i - * for i in range(3): - * rcol[i] = (x[2] - 1.0) * vertices[0 + i] \ # <<<<<<<<<<<<<< - * - (x[2] - 1.0) * vertices[3 + i] \ - * - (x[2] + 1.0) * vertices[9 + i] \ - */ - (__pyx_v_rcol[__pyx_v_i]) = ((((((__pyx_v_x[2]) - 1.0) * (__pyx_v_vertices[(0 + __pyx_v_i)])) - (((__pyx_v_x[2]) - 1.0) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) - (((__pyx_v_x[2]) + 1.0) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) + (((__pyx_v_x[2]) + 1.0) * (__pyx_v_vertices[(12 + __pyx_v_i)]))); - - /* "yt/utilities/lib/element_mappings.pyx":782 - * - (x[2] + 1.0) * vertices[9 + i] \ - * + (x[2] + 1.0) * vertices[12 + i] - * scol[i] = (x[2] - 1.0) * vertices[0 + i] \ # <<<<<<<<<<<<<< - * - (x[2] - 1.0) * vertices[6 + i] \ - * - (x[2] + 1.0) * vertices[9 + i] \ - */ - (__pyx_v_scol[__pyx_v_i]) = ((((((__pyx_v_x[2]) - 1.0) * (__pyx_v_vertices[(0 + __pyx_v_i)])) - (((__pyx_v_x[2]) - 1.0) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) - (((__pyx_v_x[2]) + 1.0) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) + (((__pyx_v_x[2]) + 1.0) * (__pyx_v_vertices[(15 + __pyx_v_i)]))); - - /* "yt/utilities/lib/element_mappings.pyx":786 - * - (x[2] + 1.0) * vertices[9 + i] \ - * + (x[2] + 1.0) * vertices[15 + i] - * tcol[i] = (x[0] + x[1] - 1.0) * vertices[0 + i] \ # <<<<<<<<<<<<<< - * - x[0] * vertices[3 + i] \ - * - x[1] * vertices[6 + i] \ + /* "yt/utilities/lib/element_mappings.pyx":549 + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 + * return 1 */ - (__pyx_v_tcol[__pyx_v_i]) = (((((((((__pyx_v_x[0]) + (__pyx_v_x[1])) - 1.0) * (__pyx_v_vertices[(0 + __pyx_v_i)])) - ((__pyx_v_x[0]) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) - ((__pyx_v_x[1]) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) - ((((__pyx_v_x[0]) + (__pyx_v_x[1])) - 1.0) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) + ((__pyx_v_x[0]) * (__pyx_v_vertices[(12 + __pyx_v_i)]))) + ((__pyx_v_x[1]) * (__pyx_v_vertices[(15 + __pyx_v_i)]))); - } + __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[2])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; - /* "yt/utilities/lib/element_mappings.pyx":769 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void W1Jacobian3D(double* rcol, # <<<<<<<<<<<<<< - * double* scol, - * double* tcol, + /* "yt/utilities/lib/element_mappings.pyx":547 + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): */ + if (__pyx_t_1) { - /* function exit code */ -} - -/* "yt/utilities/lib/element_mappings.pyx":807 - * ''' + /* "yt/utilities/lib/element_mappings.pyx":550 + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + * return 0 # <<<<<<<<<<<<<< + * return 1 * - * def __init__(self): # <<<<<<<<<<<<<< - * super(NonlinearSolveSampler2D, self).__init__() - * self.tolerance = 1.0e-9 */ + __pyx_r = 0; + goto __pyx_L0; -/* Python wrapper */ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} - if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "yt/utilities/lib/element_mappings.pyx":808 - * - * def __init__(self): - * super(NonlinearSolveSampler2D, self).__init__() # <<<<<<<<<<<<<< - * self.tolerance = 1.0e-9 - * self.max_iter = 10 + /* "yt/utilities/lib/element_mappings.pyx":547 + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - 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); - } } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/lib/element_mappings.pyx":809 - * def __init__(self): - * super(NonlinearSolveSampler2D, self).__init__() - * self.tolerance = 1.0e-9 # <<<<<<<<<<<<<< - * self.max_iter = 10 - * - */ - __pyx_v_self->tolerance = 1.0e-9; - /* "yt/utilities/lib/element_mappings.pyx":810 - * super(NonlinearSolveSampler2D, self).__init__() - * self.tolerance = 1.0e-9 - * self.max_iter = 10 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":551 + * fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + * return 0 + * return 1 # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_v_self->max_iter = 10; + __pyx_r = 1; + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":807 - * ''' - * - * def __init__(self): # <<<<<<<<<<<<<< - * super(NonlinearSolveSampler2D, self).__init__() - * self.tolerance = 1.0e-9 + /* "yt/utilities/lib/element_mappings.pyx":546 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.NonlinearSolveSampler2D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":815 +/* "yt/utilities/lib/element_mappings.pyx":556 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void map_real_to_unit(self, # <<<<<<<<<<<<<< - * double* mapped_x, - * double* vertices, + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): */ -static void __pyx_f_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_map_real_to_unit(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__pyx_v_self, double *__pyx_v_mapped_x, double *__pyx_v_vertices, double *__pyx_v_physical_x) { - int __pyx_v_i; - double __pyx_v_d; - double __pyx_v_f[2]; - double __pyx_v_x[2]; - double __pyx_v_A[4]; - int __pyx_v_iterations; - double __pyx_v_err; +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_check_mesh_lines(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { + int __pyx_r; int __pyx_t_1; int __pyx_t_2; - int __pyx_t_3; - long __pyx_t_4; - /* "yt/utilities/lib/element_mappings.pyx":824 - * cdef double[2] x - * cdef double[4] A - * cdef int iterations = 0 # <<<<<<<<<<<<<< - * cdef double err - * + /* "yt/utilities/lib/element_mappings.pyx":557 + * @cython.cdivision(True) + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 */ - __pyx_v_iterations = 0; + __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[0])) - 1.0)) < 1e-1) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } - /* "yt/utilities/lib/element_mappings.pyx":828 - * - * # initial guess - * for i in range(2): # <<<<<<<<<<<<<< - * x[i] = 0.0 - * + /* "yt/utilities/lib/element_mappings.pyx":558 + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): # <<<<<<<<<<<<<< + * return 1 + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and */ - for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[1])) - 1.0)) < 1e-1) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; - /* "yt/utilities/lib/element_mappings.pyx":829 - * # initial guess - * for i in range(2): - * x[i] = 0.0 # <<<<<<<<<<<<<< - * - * # initial error norm + /* "yt/utilities/lib/element_mappings.pyx":557 + * @cython.cdivision(True) + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 */ - (__pyx_v_x[__pyx_v_i]) = 0.0; - } + if (__pyx_t_1) { - /* "yt/utilities/lib/element_mappings.pyx":832 - * - * # initial error norm - * self.func(f, x, vertices, physical_x) # <<<<<<<<<<<<<< - * err = maxnorm(f, 2) - * + /* "yt/utilities/lib/element_mappings.pyx":559 + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 # <<<<<<<<<<<<<< + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): */ - __pyx_v_self->func(__pyx_v_f, __pyx_v_x, __pyx_v_vertices, __pyx_v_physical_x); + __pyx_r = 1; + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":833 - * # initial error norm - * self.func(f, x, vertices, physical_x) - * err = maxnorm(f, 2) # <<<<<<<<<<<<<< - * - * # begin Newton iteration + /* "yt/utilities/lib/element_mappings.pyx":557 + * @cython.cdivision(True) + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 */ - __pyx_v_err = __pyx_f_2yt_9utilities_3lib_16element_mappings_maxnorm(__pyx_v_f, 2); + } - /* "yt/utilities/lib/element_mappings.pyx":836 - * - * # begin Newton iteration - * while (err > self.tolerance and iterations < self.max_iter): # <<<<<<<<<<<<<< - * self.jac(A, x, vertices, physical_x) - * d = (A[0]*A[3] - A[1]*A[2]) + /* "yt/utilities/lib/element_mappings.pyx":560 + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 */ - while (1) { - __pyx_t_3 = ((__pyx_v_err > __pyx_v_self->tolerance) != 0); - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_3 = ((__pyx_v_iterations < __pyx_v_self->max_iter) != 0); - __pyx_t_2 = __pyx_t_3; - __pyx_L7_bool_binop_done:; - if (!__pyx_t_2) break; - - /* "yt/utilities/lib/element_mappings.pyx":837 - * # begin Newton iteration - * while (err > self.tolerance and iterations < self.max_iter): - * self.jac(A, x, vertices, physical_x) # <<<<<<<<<<<<<< - * d = (A[0]*A[3] - A[1]*A[2]) - * - */ - __pyx_v_self->jac(__pyx_v_A, __pyx_v_x, __pyx_v_vertices, __pyx_v_physical_x); - - /* "yt/utilities/lib/element_mappings.pyx":838 - * while (err > self.tolerance and iterations < self.max_iter): - * self.jac(A, x, vertices, physical_x) - * d = (A[0]*A[3] - A[1]*A[2]) # <<<<<<<<<<<<<< - * - * x[0] -= ( A[3]*f[0] - A[1]*f[1]) / d - */ - __pyx_v_d = (((__pyx_v_A[0]) * (__pyx_v_A[3])) - ((__pyx_v_A[1]) * (__pyx_v_A[2]))); - - /* "yt/utilities/lib/element_mappings.pyx":840 - * d = (A[0]*A[3] - A[1]*A[2]) - * - * x[0] -= ( A[3]*f[0] - A[1]*f[1]) / d # <<<<<<<<<<<<<< - * x[1] -= (-A[2]*f[0] + A[0]*f[1]) / d - * - */ - __pyx_t_4 = 0; - (__pyx_v_x[__pyx_t_4]) = ((__pyx_v_x[__pyx_t_4]) - ((((__pyx_v_A[3]) * (__pyx_v_f[0])) - ((__pyx_v_A[1]) * (__pyx_v_f[1]))) / __pyx_v_d)); + __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[0])) - 1.0)) < 1e-1) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } - /* "yt/utilities/lib/element_mappings.pyx":841 - * - * x[0] -= ( A[3]*f[0] - A[1]*f[1]) / d - * x[1] -= (-A[2]*f[0] + A[0]*f[1]) / d # <<<<<<<<<<<<<< - * - * self.func(f, x, vertices, physical_x) + /* "yt/utilities/lib/element_mappings.pyx":561 + * return 1 + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): # <<<<<<<<<<<<<< + * return 1 + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and */ - __pyx_t_4 = 1; - (__pyx_v_x[__pyx_t_4]) = ((__pyx_v_x[__pyx_t_4]) - ((((-(__pyx_v_A[2])) * (__pyx_v_f[0])) + ((__pyx_v_A[0]) * (__pyx_v_f[1]))) / __pyx_v_d)); + __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[2])) - 1.0)) < 1e-1) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "yt/utilities/lib/element_mappings.pyx":843 - * x[1] -= (-A[2]*f[0] + A[0]*f[1]) / d - * - * self.func(f, x, vertices, physical_x) # <<<<<<<<<<<<<< - * err = maxnorm(f, 2) - * iterations += 1 + /* "yt/utilities/lib/element_mappings.pyx":560 + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 */ - __pyx_v_self->func(__pyx_v_f, __pyx_v_x, __pyx_v_vertices, __pyx_v_physical_x); + if (__pyx_t_1) { - /* "yt/utilities/lib/element_mappings.pyx":844 - * - * self.func(f, x, vertices, physical_x) - * err = maxnorm(f, 2) # <<<<<<<<<<<<<< - * iterations += 1 - * + /* "yt/utilities/lib/element_mappings.pyx":562 + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 # <<<<<<<<<<<<<< + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): */ - __pyx_v_err = __pyx_f_2yt_9utilities_3lib_16element_mappings_maxnorm(__pyx_v_f, 2); + __pyx_r = 1; + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":845 - * self.func(f, x, vertices, physical_x) - * err = maxnorm(f, 2) - * iterations += 1 # <<<<<<<<<<<<<< - * - * if (err > self.tolerance): + /* "yt/utilities/lib/element_mappings.pyx":560 + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): + * return 1 + * elif (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 */ - __pyx_v_iterations = (__pyx_v_iterations + 1); } - /* "yt/utilities/lib/element_mappings.pyx":847 - * iterations += 1 - * - * if (err > self.tolerance): # <<<<<<<<<<<<<< - * # we did not converge, set bogus value - * for i in range(2): + /* "yt/utilities/lib/element_mappings.pyx":563 + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 */ - __pyx_t_2 = ((__pyx_v_err > __pyx_v_self->tolerance) != 0); + __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[1])) - 1.0)) < 1e-1) != 0); if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L8_bool_binop_done; + } - /* "yt/utilities/lib/element_mappings.pyx":849 - * if (err > self.tolerance): - * # we did not converge, set bogus value - * for i in range(2): # <<<<<<<<<<<<<< - * mapped_x[i] = -99.0 + /* "yt/utilities/lib/element_mappings.pyx":564 + * return 1 + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): # <<<<<<<<<<<<<< + * return 1 * else: */ - for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + __pyx_t_2 = ((fabs((fabs((__pyx_v_mapped_coord[2])) - 1.0)) < 1e-1) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L8_bool_binop_done:; - /* "yt/utilities/lib/element_mappings.pyx":850 - * # we did not converge, set bogus value - * for i in range(2): - * mapped_x[i] = -99.0 # <<<<<<<<<<<<<< - * else: - * for i in range(2): + /* "yt/utilities/lib/element_mappings.pyx":563 + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 */ - (__pyx_v_mapped_x[__pyx_v_i]) = -99.0; - } + if (__pyx_t_1) { - /* "yt/utilities/lib/element_mappings.pyx":847 - * iterations += 1 - * - * if (err > self.tolerance): # <<<<<<<<<<<<<< - * # we did not converge, set bogus value - * for i in range(2): + /* "yt/utilities/lib/element_mappings.pyx":565 + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 # <<<<<<<<<<<<<< + * else: + * return -1 */ - goto __pyx_L9; - } + __pyx_r = 1; + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":852 - * mapped_x[i] = -99.0 - * else: - * for i in range(2): # <<<<<<<<<<<<<< - * mapped_x[i] = x[i] - * + /* "yt/utilities/lib/element_mappings.pyx":563 + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 + * elif (fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1 and # <<<<<<<<<<<<<< + * fabs(fabs(mapped_coord[2]) - 1.0) < 1e-1): + * return 1 */ - /*else*/ { - for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + } - /* "yt/utilities/lib/element_mappings.pyx":853 + /* "yt/utilities/lib/element_mappings.pyx":567 + * return 1 * else: - * for i in range(2): - * mapped_x[i] = x[i] # <<<<<<<<<<<<<< + * return -1 # <<<<<<<<<<<<<< * * */ - (__pyx_v_mapped_x[__pyx_v_i]) = (__pyx_v_x[__pyx_v_i]); - } + /*else*/ { + __pyx_r = -1; + goto __pyx_L0; } - __pyx_L9:; - /* "yt/utilities/lib/element_mappings.pyx":815 + /* "yt/utilities/lib/element_mappings.pyx":556 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void map_real_to_unit(self, # <<<<<<<<<<<<<< - * double* mapped_x, - * double* vertices, + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * if (fabs(fabs(mapped_coord[0]) - 1.0) < 1e-1 and + * fabs(fabs(mapped_coord[1]) - 1.0) < 1e-1): */ /* function exit code */ + __pyx_L0:; + return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":864 - * ''' - * - * def __init__(self): # <<<<<<<<<<<<<< - * super(Q1Sampler2D, self).__init__() - * self.num_mapped_coords = 2 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} - if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *)__pyx_v_self)); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_self) { - int __pyx_r; +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__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("__init__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "yt/utilities/lib/element_mappings.pyx":865 - * - * def __init__(self): - * super(Q1Sampler2D, self).__init__() # <<<<<<<<<<<<<< - * self.num_mapped_coords = 2 - * self.dim = 2 + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - 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); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error) - } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) - /* "yt/utilities/lib/element_mappings.pyx":866 - * def __init__(self): - * super(Q1Sampler2D, self).__init__() - * self.num_mapped_coords = 2 # <<<<<<<<<<<<<< - * self.dim = 2 - * self.func = Q1Function2D - */ - __pyx_v_self->__pyx_base.__pyx_base.num_mapped_coords = 2; - - /* "yt/utilities/lib/element_mappings.pyx":867 - * super(Q1Sampler2D, self).__init__() - * self.num_mapped_coords = 2 - * self.dim = 2 # <<<<<<<<<<<<<< - * self.func = Q1Function2D - * self.jac = Q1Jacobian2D - */ - __pyx_v_self->__pyx_base.dim = 2; - - /* "yt/utilities/lib/element_mappings.pyx":868 - * self.num_mapped_coords = 2 - * self.dim = 2 - * self.func = Q1Function2D # <<<<<<<<<<<<<< - * self.jac = Q1Jacobian2D - * - */ - __pyx_v_self->__pyx_base.func = __pyx_f_2yt_9utilities_3lib_16element_mappings_Q1Function2D; - - /* "yt/utilities/lib/element_mappings.pyx":869 - * self.dim = 2 - * self.func = Q1Function2D - * self.jac = Q1Jacobian2D # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) - */ - __pyx_v_self->__pyx_base.jac = __pyx_f_2yt_9utilities_3lib_16element_mappings_Q1Jacobian2D; - - /* "yt/utilities/lib/element_mappings.pyx":864 - * ''' - * - * def __init__(self): # <<<<<<<<<<<<<< - * super(Q1Sampler2D, self).__init__() - * self.num_mapped_coords = 2 + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.Q1Sampler2D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.S2Sampler3D.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":874 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< - * cdef double F, rm, rp, sm, sp - * +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") */ -static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { - double __pyx_v_F; - double __pyx_v_rm; - double __pyx_v_rp; - double __pyx_v_sm; - double __pyx_v_sp; - double __pyx_r; - - /* "yt/utilities/lib/element_mappings.pyx":877 - * cdef double F, rm, rp, sm, sp - * - * rm = 1.0 - coord[0] # <<<<<<<<<<<<<< - * rp = 1.0 + coord[0] - * sm = 1.0 - coord[1] - */ - __pyx_v_rm = (1.0 - (__pyx_v_coord[0])); - - /* "yt/utilities/lib/element_mappings.pyx":878 - * - * rm = 1.0 - coord[0] - * rp = 1.0 + coord[0] # <<<<<<<<<<<<<< - * sm = 1.0 - coord[1] - * sp = 1.0 + coord[1] - */ - __pyx_v_rp = (1.0 + (__pyx_v_coord[0])); - - /* "yt/utilities/lib/element_mappings.pyx":879 - * rm = 1.0 - coord[0] - * rp = 1.0 + coord[0] - * sm = 1.0 - coord[1] # <<<<<<<<<<<<<< - * sp = 1.0 + coord[1] - * - */ - __pyx_v_sm = (1.0 - (__pyx_v_coord[1])); - - /* "yt/utilities/lib/element_mappings.pyx":880 - * rp = 1.0 + coord[0] - * sm = 1.0 - coord[1] - * sp = 1.0 + coord[1] # <<<<<<<<<<<<<< - * - * F = vals[0]*rm*sm + vals[1]*rp*sm + vals[2]*rp*sp + vals[3]*rm*sp - */ - __pyx_v_sp = (1.0 + (__pyx_v_coord[1])); - - /* "yt/utilities/lib/element_mappings.pyx":882 - * sp = 1.0 + coord[1] - * - * F = vals[0]*rm*sm + vals[1]*rp*sm + vals[2]*rp*sp + vals[3]*rm*sp # <<<<<<<<<<<<<< - * return 0.25*F - * - */ - __pyx_v_F = ((((((__pyx_v_vals[0]) * __pyx_v_rm) * __pyx_v_sm) + (((__pyx_v_vals[1]) * __pyx_v_rp) * __pyx_v_sm)) + (((__pyx_v_vals[2]) * __pyx_v_rp) * __pyx_v_sp)) + (((__pyx_v_vals[3]) * __pyx_v_rm) * __pyx_v_sp)); - - /* "yt/utilities/lib/element_mappings.pyx":883 - * - * F = vals[0]*rm*sm + vals[1]*rp*sm + vals[2]*rp*sp + vals[3]*rm*sp - * return 0.25*F # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) - */ - __pyx_r = (0.25 * __pyx_v_F); - goto __pyx_L0; - - /* "yt/utilities/lib/element_mappings.pyx":874 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< - * cdef double F, rm, rp, sm, sp - * - */ +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_5__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_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ - __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":888 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * # for quads, we check whether the mapped_coord is between - * # -1 and 1 in both directions. - */ - -static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_self, double *__pyx_v_mapped_coord) { - int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - - /* "yt/utilities/lib/element_mappings.pyx":891 - * # for quads, we check whether the mapped_coord is between - * # -1 and 1 in both directions. - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): - * return 0 - */ - __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[0])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "yt/utilities/lib/element_mappings.pyx":892 - * # -1 and 1 in both directions. - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< - * return 0 - * return 1 - */ - __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[1])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; - - /* "yt/utilities/lib/element_mappings.pyx":891 - * # for quads, we check whether the mapped_coord is between - * # -1 and 1 in both directions. - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): - * return 0 - */ - if (__pyx_t_1) { - - /* "yt/utilities/lib/element_mappings.pyx":893 - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): - * return 0 # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "yt/utilities/lib/element_mappings.pyx":891 - * # for quads, we check whether the mapped_coord is between - * # -1 and 1 in both directions. - * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): - * return 0 - */ - } +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__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); - /* "yt/utilities/lib/element_mappings.pyx":894 - * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): - * return 0 - * return 1 # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) + /* "(tree fragment)":4 + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - __pyx_r = 1; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, 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) - /* "yt/utilities/lib/element_mappings.pyx":888 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< - * # for quads, we check whether the mapped_coord is between - * # -1 and 1 in both directions. + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") */ /* function exit code */ - __pyx_L0:; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.S2Sampler3D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":899 +/* "yt/utilities/lib/element_mappings.pyx":573 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef inline void Q1Jacobian2D(double* A, # <<<<<<<<<<<<<< + * cdef inline void S2Function3D(double* fx, # <<<<<<<<<<<<<< * double* x, * double* vertices, */ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_Q1Jacobian2D(double *__pyx_v_A, double *__pyx_v_x, double *__pyx_v_vertices, CYTHON_UNUSED double *__pyx_v_phys_x) { +static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_S2Function3D(double *__pyx_v_fx, double *__pyx_v_x, double *__pyx_v_vertices, double *__pyx_v_phys_x) { + int __pyx_v_i; + double __pyx_v_r; + double __pyx_v_s; + double __pyx_v_t; double __pyx_v_rm; double __pyx_v_rp; double __pyx_v_sm; double __pyx_v_sp; + double __pyx_v_tm; + double __pyx_v_tp; + int __pyx_t_1; - /* "yt/utilities/lib/element_mappings.pyx":905 - * cdef double rm, rp, sm, sp + /* "yt/utilities/lib/element_mappings.pyx":580 + * cdef double r, s, t, rm, rp, sm, sp, tm, tp * - * rm = 1.0 - x[0] # <<<<<<<<<<<<<< - * rp = 1.0 + x[0] - * sm = 1.0 - x[1] + * r = x[0] # <<<<<<<<<<<<<< + * rm = 1.0 - r + * rp = 1.0 + r */ - __pyx_v_rm = (1.0 - (__pyx_v_x[0])); + __pyx_v_r = (__pyx_v_x[0]); - /* "yt/utilities/lib/element_mappings.pyx":906 + /* "yt/utilities/lib/element_mappings.pyx":581 + * + * r = x[0] + * rm = 1.0 - r # <<<<<<<<<<<<<< + * rp = 1.0 + r * - * rm = 1.0 - x[0] - * rp = 1.0 + x[0] # <<<<<<<<<<<<<< - * sm = 1.0 - x[1] - * sp = 1.0 + x[1] */ - __pyx_v_rp = (1.0 + (__pyx_v_x[0])); + __pyx_v_rm = (1.0 - __pyx_v_r); - /* "yt/utilities/lib/element_mappings.pyx":907 - * rm = 1.0 - x[0] - * rp = 1.0 + x[0] - * sm = 1.0 - x[1] # <<<<<<<<<<<<<< - * sp = 1.0 + x[1] + /* "yt/utilities/lib/element_mappings.pyx":582 + * r = x[0] + * rm = 1.0 - r + * rp = 1.0 + r # <<<<<<<<<<<<<< * + * s = x[1] */ - __pyx_v_sm = (1.0 - (__pyx_v_x[1])); + __pyx_v_rp = (1.0 + __pyx_v_r); - /* "yt/utilities/lib/element_mappings.pyx":908 - * rp = 1.0 + x[0] - * sm = 1.0 - x[1] - * sp = 1.0 + x[1] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":584 + * rp = 1.0 + r * - * A[0] = -sm*vertices[0] + sm*vertices[2] + sp*vertices[4] - sp*vertices[6] + * s = x[1] # <<<<<<<<<<<<<< + * sm = 1.0 - s + * sp = 1.0 + s */ - __pyx_v_sp = (1.0 + (__pyx_v_x[1])); + __pyx_v_s = (__pyx_v_x[1]); - /* "yt/utilities/lib/element_mappings.pyx":910 - * sp = 1.0 + x[1] + /* "yt/utilities/lib/element_mappings.pyx":585 + * + * s = x[1] + * sm = 1.0 - s # <<<<<<<<<<<<<< + * sp = 1.0 + s * - * A[0] = -sm*vertices[0] + sm*vertices[2] + sp*vertices[4] - sp*vertices[6] # <<<<<<<<<<<<<< - * A[1] = -rm*vertices[0] - rp*vertices[2] + rp*vertices[4] + rm*vertices[6] - * A[2] = -sm*vertices[1] + sm*vertices[3] + sp*vertices[5] - sp*vertices[7] */ - (__pyx_v_A[0]) = (((((-__pyx_v_sm) * (__pyx_v_vertices[0])) + (__pyx_v_sm * (__pyx_v_vertices[2]))) + (__pyx_v_sp * (__pyx_v_vertices[4]))) - (__pyx_v_sp * (__pyx_v_vertices[6]))); + __pyx_v_sm = (1.0 - __pyx_v_s); - /* "yt/utilities/lib/element_mappings.pyx":911 + /* "yt/utilities/lib/element_mappings.pyx":586 + * s = x[1] + * sm = 1.0 - s + * sp = 1.0 + s # <<<<<<<<<<<<<< * - * A[0] = -sm*vertices[0] + sm*vertices[2] + sp*vertices[4] - sp*vertices[6] - * A[1] = -rm*vertices[0] - rp*vertices[2] + rp*vertices[4] + rm*vertices[6] # <<<<<<<<<<<<<< - * A[2] = -sm*vertices[1] + sm*vertices[3] + sp*vertices[5] - sp*vertices[7] - * A[3] = -rm*vertices[1] - rp*vertices[3] + rp*vertices[5] + rm*vertices[7] + * t = x[2] */ - (__pyx_v_A[1]) = (((((-__pyx_v_rm) * (__pyx_v_vertices[0])) - (__pyx_v_rp * (__pyx_v_vertices[2]))) + (__pyx_v_rp * (__pyx_v_vertices[4]))) + (__pyx_v_rm * (__pyx_v_vertices[6]))); + __pyx_v_sp = (1.0 + __pyx_v_s); - /* "yt/utilities/lib/element_mappings.pyx":912 - * A[0] = -sm*vertices[0] + sm*vertices[2] + sp*vertices[4] - sp*vertices[6] - * A[1] = -rm*vertices[0] - rp*vertices[2] + rp*vertices[4] + rm*vertices[6] - * A[2] = -sm*vertices[1] + sm*vertices[3] + sp*vertices[5] - sp*vertices[7] # <<<<<<<<<<<<<< - * A[3] = -rm*vertices[1] - rp*vertices[3] + rp*vertices[5] + rm*vertices[7] + /* "yt/utilities/lib/element_mappings.pyx":588 + * sp = 1.0 + s + * + * t = x[2] # <<<<<<<<<<<<<< + * tm = 1.0 - t + * tp = 1.0 + t + */ + __pyx_v_t = (__pyx_v_x[2]); + + /* "yt/utilities/lib/element_mappings.pyx":589 + * + * t = x[2] + * tm = 1.0 - t # <<<<<<<<<<<<<< + * tp = 1.0 + t * */ - (__pyx_v_A[2]) = (((((-__pyx_v_sm) * (__pyx_v_vertices[1])) + (__pyx_v_sm * (__pyx_v_vertices[3]))) + (__pyx_v_sp * (__pyx_v_vertices[5]))) - (__pyx_v_sp * (__pyx_v_vertices[7]))); + __pyx_v_tm = (1.0 - __pyx_v_t); - /* "yt/utilities/lib/element_mappings.pyx":913 - * A[1] = -rm*vertices[0] - rp*vertices[2] + rp*vertices[4] + rm*vertices[6] - * A[2] = -sm*vertices[1] + sm*vertices[3] + sp*vertices[5] - sp*vertices[7] - * A[3] = -rm*vertices[1] - rp*vertices[3] + rp*vertices[5] + rm*vertices[7] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/element_mappings.pyx":590 + * t = x[2] + * tm = 1.0 - t + * tp = 1.0 + t # <<<<<<<<<<<<<< * + * for i in range(3): + */ + __pyx_v_tp = (1.0 + __pyx_v_t); + + /* "yt/utilities/lib/element_mappings.pyx":592 + * tp = 1.0 + t * + * for i in range(3): # <<<<<<<<<<<<<< + * fx[i] = rm*sm*tm*(-r - s - t - 2.0)*vertices[0 + i] \ + * + rp*sm*tm*( r - s - t - 2.0)*vertices[3 + i] \ */ - (__pyx_v_A[3]) = (((((-__pyx_v_rm) * (__pyx_v_vertices[1])) - (__pyx_v_rp * (__pyx_v_vertices[3]))) + (__pyx_v_rp * (__pyx_v_vertices[5]))) + (__pyx_v_rm * (__pyx_v_vertices[7]))); + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/element_mappings.pyx":899 + /* "yt/utilities/lib/element_mappings.pyx":593 + * + * for i in range(3): + * fx[i] = rm*sm*tm*(-r - s - t - 2.0)*vertices[0 + i] \ # <<<<<<<<<<<<<< + * + rp*sm*tm*( r - s - t - 2.0)*vertices[3 + i] \ + * + rp*sp*tm*( r + s - t - 2.0)*vertices[6 + i] \ + */ + (__pyx_v_fx[__pyx_v_i]) = ((((((((((((((((((((((((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tm) * ((((-__pyx_v_r) - __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(0 + __pyx_v_i)])) + ((((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tm) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tm) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) + ((((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tm) * ((((-__pyx_v_r) + __pyx_v_s) - __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) + ((((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tp) * ((((-__pyx_v_r) - __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(12 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tp) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(15 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tp) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(18 + __pyx_v_i)]))) + ((((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tp) * ((((-__pyx_v_r) + __pyx_v_s) + __pyx_v_t) - 2.0)) * (__pyx_v_vertices[(21 + __pyx_v_i)]))) + ((((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_sm) * __pyx_v_tm) * (__pyx_v_vertices[(24 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rp) * (1.0 - (__pyx_v_s * __pyx_v_s))) * __pyx_v_tm) * (__pyx_v_vertices[(27 + __pyx_v_i)]))) + ((((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_sp) * __pyx_v_tm) * (__pyx_v_vertices[(30 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rm) * (1.0 - (__pyx_v_s * __pyx_v_s))) * __pyx_v_tm) * (__pyx_v_vertices[(33 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rm) * __pyx_v_sm) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vertices[(36 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rp) * __pyx_v_sm) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vertices[(39 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rp) * __pyx_v_sp) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vertices[(42 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rm) * __pyx_v_sp) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vertices[(45 + __pyx_v_i)]))) + ((((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_sm) * __pyx_v_tp) * (__pyx_v_vertices[(48 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rp) * (1.0 - (__pyx_v_s * __pyx_v_s))) * __pyx_v_tp) * (__pyx_v_vertices[(51 + __pyx_v_i)]))) + ((((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_sp) * __pyx_v_tp) * (__pyx_v_vertices[(54 + __pyx_v_i)]))) + ((((2.0 * __pyx_v_rm) * (1.0 - (__pyx_v_s * __pyx_v_s))) * __pyx_v_tp) * (__pyx_v_vertices[(57 + __pyx_v_i)]))) - (8.0 * (__pyx_v_phys_x[__pyx_v_i]))); + } + + /* "yt/utilities/lib/element_mappings.pyx":573 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef inline void Q1Jacobian2D(double* A, # <<<<<<<<<<<<<< + * cdef inline void S2Function3D(double* fx, # <<<<<<<<<<<<<< * double* x, * double* vertices, */ @@ -6566,107 +7049,5204 @@ /* function exit code */ } -/* "yt/utilities/lib/element_mappings.pyx":919 +/* "yt/utilities/lib/element_mappings.pyx":619 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef inline void Q1Function2D(double* fx, # <<<<<<<<<<<<<< - * double* x, - * double* vertices, + * cdef inline void S2Jacobian3D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* tcol, */ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_Q1Function2D(double *__pyx_v_fx, double *__pyx_v_x, double *__pyx_v_vertices, double *__pyx_v_phys_x) { +static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16element_mappings_S2Jacobian3D(double *__pyx_v_rcol, double *__pyx_v_scol, double *__pyx_v_tcol, double *__pyx_v_x, double *__pyx_v_vertices, CYTHON_UNUSED double *__pyx_v_phys_x) { int __pyx_v_i; + double __pyx_v_r; + double __pyx_v_s; + double __pyx_v_t; double __pyx_v_rm; double __pyx_v_rp; double __pyx_v_sm; double __pyx_v_sp; + double __pyx_v_tm; + double __pyx_v_tp; int __pyx_t_1; - /* "yt/utilities/lib/element_mappings.pyx":926 - * cdef double rm, rp, sm, sp + /* "yt/utilities/lib/element_mappings.pyx":628 + * cdef double r, s, t, rm, rp, sm, sp, tm, tp * - * rm = 1.0 - x[0] # <<<<<<<<<<<<<< - * rp = 1.0 + x[0] - * sm = 1.0 - x[1] + * r = x[0] # <<<<<<<<<<<<<< + * rm = 1.0 - r + * rp = 1.0 + r */ - __pyx_v_rm = (1.0 - (__pyx_v_x[0])); + __pyx_v_r = (__pyx_v_x[0]); - /* "yt/utilities/lib/element_mappings.pyx":927 + /* "yt/utilities/lib/element_mappings.pyx":629 + * + * r = x[0] + * rm = 1.0 - r # <<<<<<<<<<<<<< + * rp = 1.0 + r * - * rm = 1.0 - x[0] - * rp = 1.0 + x[0] # <<<<<<<<<<<<<< - * sm = 1.0 - x[1] - * sp = 1.0 + x[1] */ - __pyx_v_rp = (1.0 + (__pyx_v_x[0])); + __pyx_v_rm = (1.0 - __pyx_v_r); + + /* "yt/utilities/lib/element_mappings.pyx":630 + * r = x[0] + * rm = 1.0 - r + * rp = 1.0 + r # <<<<<<<<<<<<<< + * + * s = x[1] + */ + __pyx_v_rp = (1.0 + __pyx_v_r); + + /* "yt/utilities/lib/element_mappings.pyx":632 + * rp = 1.0 + r + * + * s = x[1] # <<<<<<<<<<<<<< + * sm = 1.0 - s + * sp = 1.0 + s + */ + __pyx_v_s = (__pyx_v_x[1]); + + /* "yt/utilities/lib/element_mappings.pyx":633 + * + * s = x[1] + * sm = 1.0 - s # <<<<<<<<<<<<<< + * sp = 1.0 + s + * + */ + __pyx_v_sm = (1.0 - __pyx_v_s); + + /* "yt/utilities/lib/element_mappings.pyx":634 + * s = x[1] + * sm = 1.0 - s + * sp = 1.0 + s # <<<<<<<<<<<<<< + * + * t = x[2] + */ + __pyx_v_sp = (1.0 + __pyx_v_s); + + /* "yt/utilities/lib/element_mappings.pyx":636 + * sp = 1.0 + s + * + * t = x[2] # <<<<<<<<<<<<<< + * tm = 1.0 - t + * tp = 1.0 + t + */ + __pyx_v_t = (__pyx_v_x[2]); + + /* "yt/utilities/lib/element_mappings.pyx":637 + * + * t = x[2] + * tm = 1.0 - t # <<<<<<<<<<<<<< + * tp = 1.0 + t + * + */ + __pyx_v_tm = (1.0 - __pyx_v_t); + + /* "yt/utilities/lib/element_mappings.pyx":638 + * t = x[2] + * tm = 1.0 - t + * tp = 1.0 + t # <<<<<<<<<<<<<< + * + * for i in range(3): + */ + __pyx_v_tp = (1.0 + __pyx_v_t); + + /* "yt/utilities/lib/element_mappings.pyx":640 + * tp = 1.0 + t + * + * for i in range(3): # <<<<<<<<<<<<<< + * rcol[i] = (sm*tm*(r + s + t + 2.0) - rm*sm*tm)*vertices[0 + i] \ + * + (sm*tm*(r - s - t - 2.0) + rp*sm*tm)*vertices[3 + i] \ + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/element_mappings.pyx":641 + * + * for i in range(3): + * rcol[i] = (sm*tm*(r + s + t + 2.0) - rm*sm*tm)*vertices[0 + i] \ # <<<<<<<<<<<<<< + * + (sm*tm*(r - s - t - 2.0) + rp*sm*tm)*vertices[3 + i] \ + * + (sp*tm*(r + s - t - 2.0) + rp*sp*tm)*vertices[6 + i] \ + */ + (__pyx_v_rcol[__pyx_v_i]) = (((((((((((((((((((((((__pyx_v_sm * __pyx_v_tm) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tm)) * (__pyx_v_vertices[(0 + __pyx_v_i)])) + ((((__pyx_v_sm * __pyx_v_tm) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tm)) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) + ((((__pyx_v_sp * __pyx_v_tm) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tm)) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) + ((((__pyx_v_sp * __pyx_v_tm) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tm)) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) + ((((__pyx_v_sm * __pyx_v_tp) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tp)) * (__pyx_v_vertices[(12 + __pyx_v_i)]))) + ((((__pyx_v_sm * __pyx_v_tp) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tp)) * (__pyx_v_vertices[(15 + __pyx_v_i)]))) + ((((__pyx_v_sp * __pyx_v_tp) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tp)) * (__pyx_v_vertices[(18 + __pyx_v_i)]))) + ((((__pyx_v_sp * __pyx_v_tp) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tp)) * (__pyx_v_vertices[(21 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_r) * __pyx_v_sm) * __pyx_v_tm) * (__pyx_v_vertices[(24 + __pyx_v_i)]))) + (((2.0 * (1.0 - (__pyx_v_s * __pyx_v_s))) * __pyx_v_tm) * (__pyx_v_vertices[(27 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_r) * __pyx_v_sp) * __pyx_v_tm) * (__pyx_v_vertices[(30 + __pyx_v_i)]))) - (((2.0 * (1.0 - (__pyx_v_s * __pyx_v_s))) * __pyx_v_tm) * (__pyx_v_vertices[(33 + __pyx_v_i)]))) - (((2.0 * __pyx_v_sm) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vertices[(36 + __pyx_v_i)]))) + (((2.0 * __pyx_v_sm) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vertices[(39 + __pyx_v_i)]))) + (((2.0 * __pyx_v_sp) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vertices[(42 + __pyx_v_i)]))) - (((2.0 * __pyx_v_sp) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vertices[(45 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_r) * __pyx_v_sm) * __pyx_v_tp) * (__pyx_v_vertices[(48 + __pyx_v_i)]))) + (((2.0 * (1.0 - (__pyx_v_s * __pyx_v_s))) * __pyx_v_tp) * (__pyx_v_vertices[(51 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_r) * __pyx_v_sp) * __pyx_v_tp) * (__pyx_v_vertices[(54 + __pyx_v_i)]))) - (((2.0 * (1.0 - (__pyx_v_s * __pyx_v_s))) * __pyx_v_tp) * (__pyx_v_vertices[(57 + __pyx_v_i)]))); + + /* "yt/utilities/lib/element_mappings.pyx":661 + * - 4.0*r*sp*tp*vertices[54 + i] \ + * - 2.0*(1.0 - s*s)*tp*vertices[57 + i] + * scol[i] = ( rm*tm*(r + s + t + 2.0) - rm*sm*tm)*vertices[0 + i] \ # <<<<<<<<<<<<<< + * + (-rp*tm*(r - s - t - 2.0) - rp*sm*tm)*vertices[3 + i] \ + * + ( rp*tm*(r + s - t - 2.0) + rp*sp*tm)*vertices[6 + i] \ + */ + (__pyx_v_scol[__pyx_v_i]) = (((((((((((((((((((((((__pyx_v_rm * __pyx_v_tm) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tm)) * (__pyx_v_vertices[(0 + __pyx_v_i)])) + (((((-__pyx_v_rp) * __pyx_v_tm) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) - 2.0)) - ((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tm)) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_tm) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tm)) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) + (((((-__pyx_v_rm) * __pyx_v_tm) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) + 2.0)) + ((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tm)) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) + ((((__pyx_v_rm * __pyx_v_tp) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tp)) * (__pyx_v_vertices[(12 + __pyx_v_i)]))) + (((((-__pyx_v_rp) * __pyx_v_tp) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) - 2.0)) - ((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tp)) * (__pyx_v_vertices[(15 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_tp) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tp)) * (__pyx_v_vertices[(18 + __pyx_v_i)]))) + (((((-__pyx_v_rm) * __pyx_v_tp) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) + 2.0)) + ((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tp)) * (__pyx_v_vertices[(21 + __pyx_v_i)]))) - (((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_tm) * (__pyx_v_vertices[(24 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rp) * __pyx_v_s) * __pyx_v_tm) * (__pyx_v_vertices[(27 + __pyx_v_i)]))) + (((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_tm) * (__pyx_v_vertices[(30 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rm) * __pyx_v_s) * __pyx_v_tm) * (__pyx_v_vertices[(33 + __pyx_v_i)]))) - (((2.0 * __pyx_v_rm) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vertices[(36 + __pyx_v_i)]))) - (((2.0 * __pyx_v_rp) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vertices[(39 + __pyx_v_i)]))) + (((2.0 * __pyx_v_rp) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vertices[(42 + __pyx_v_i)]))) + (((2.0 * __pyx_v_rm) * (1.0 - (__pyx_v_t * __pyx_v_t))) * (__pyx_v_vertices[(45 + __pyx_v_i)]))) - (((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_tp) * (__pyx_v_vertices[(48 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rp) * __pyx_v_s) * __pyx_v_tp) * (__pyx_v_vertices[(51 + __pyx_v_i)]))) + (((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_tp) * (__pyx_v_vertices[(54 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rm) * __pyx_v_s) * __pyx_v_tp) * (__pyx_v_vertices[(57 + __pyx_v_i)]))); + + /* "yt/utilities/lib/element_mappings.pyx":681 + * + 2.0*(1.0 - r*r)*tp*vertices[54 + i] \ + * - 4.0*rm*s*tp*vertices[57 + i] + * tcol[i] = ( rm*sm*(r + s + t + 2.0) - rm*sm*tm)*vertices[0 + i] \ # <<<<<<<<<<<<<< + * + (-rp*sm*(r - s - t - 2.0) - rp*sm*tm)*vertices[3 + i] \ + * + (-rp*sp*(r + s - t - 2.0) - rp*sp*tm)*vertices[6 + i] \ + */ + (__pyx_v_tcol[__pyx_v_i]) = (((((((((((((((((((((((__pyx_v_rm * __pyx_v_sm) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tm)) * (__pyx_v_vertices[(0 + __pyx_v_i)])) + (((((-__pyx_v_rp) * __pyx_v_sm) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) - 2.0)) - ((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tm)) * (__pyx_v_vertices[(3 + __pyx_v_i)]))) + (((((-__pyx_v_rp) * __pyx_v_sp) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) - 2.0)) - ((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tm)) * (__pyx_v_vertices[(6 + __pyx_v_i)]))) + ((((__pyx_v_rm * __pyx_v_sp) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) + 2.0)) - ((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tm)) * (__pyx_v_vertices[(9 + __pyx_v_i)]))) + (((((-__pyx_v_rm) * __pyx_v_sm) * (((__pyx_v_r + __pyx_v_s) - __pyx_v_t) + 2.0)) + ((__pyx_v_rm * __pyx_v_sm) * __pyx_v_tp)) * (__pyx_v_vertices[(12 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_sm) * (((__pyx_v_r - __pyx_v_s) + __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sm) * __pyx_v_tp)) * (__pyx_v_vertices[(15 + __pyx_v_i)]))) + ((((__pyx_v_rp * __pyx_v_sp) * (((__pyx_v_r + __pyx_v_s) + __pyx_v_t) - 2.0)) + ((__pyx_v_rp * __pyx_v_sp) * __pyx_v_tp)) * (__pyx_v_vertices[(18 + __pyx_v_i)]))) + (((((-__pyx_v_rm) * __pyx_v_sp) * (((__pyx_v_r - __pyx_v_s) - __pyx_v_t) + 2.0)) + ((__pyx_v_rm * __pyx_v_sp) * __pyx_v_tp)) * (__pyx_v_vertices[(21 + __pyx_v_i)]))) - (((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_sm) * (__pyx_v_vertices[(24 + __pyx_v_i)]))) - (((2.0 * __pyx_v_rp) * (1.0 - (__pyx_v_s * __pyx_v_s))) * (__pyx_v_vertices[(27 + __pyx_v_i)]))) - (((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_sp) * (__pyx_v_vertices[(30 + __pyx_v_i)]))) - (((2.0 * __pyx_v_rm) * (1.0 - (__pyx_v_s * __pyx_v_s))) * (__pyx_v_vertices[(33 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rm) * __pyx_v_sm) * __pyx_v_t) * (__pyx_v_vertices[(36 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rp) * __pyx_v_sm) * __pyx_v_t) * (__pyx_v_vertices[(39 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rp) * __pyx_v_sp) * __pyx_v_t) * (__pyx_v_vertices[(42 + __pyx_v_i)]))) - ((((4.0 * __pyx_v_rm) * __pyx_v_sp) * __pyx_v_t) * (__pyx_v_vertices[(45 + __pyx_v_i)]))) + (((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_sm) * (__pyx_v_vertices[(48 + __pyx_v_i)]))) + (((2.0 * __pyx_v_rp) * (1.0 - (__pyx_v_s * __pyx_v_s))) * (__pyx_v_vertices[(51 + __pyx_v_i)]))) + (((2.0 * (1.0 - (__pyx_v_r * __pyx_v_r))) * __pyx_v_sp) * (__pyx_v_vertices[(54 + __pyx_v_i)]))) + (((2.0 * __pyx_v_rm) * (1.0 - (__pyx_v_s * __pyx_v_s))) * (__pyx_v_vertices[(57 + __pyx_v_i)]))); + } + + /* "yt/utilities/lib/element_mappings.pyx":619 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void S2Jacobian3D(double* rcol, # <<<<<<<<<<<<<< + * double* scol, + * double* tcol, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/element_mappings.pyx":711 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(W1Sampler3D, self).__init__() + * self.num_mapped_coords = 3 + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "yt/utilities/lib/element_mappings.pyx":712 + * + * def __init__(self): + * super(W1Sampler3D, self).__init__() # <<<<<<<<<<<<<< + * self.num_mapped_coords = 3 + * self.dim = 3 + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":713 + * def __init__(self): + * super(W1Sampler3D, self).__init__() + * self.num_mapped_coords = 3 # <<<<<<<<<<<<<< + * self.dim = 3 + * self.func = W1Function3D + */ + __pyx_v_self->__pyx_base.__pyx_base.num_mapped_coords = 3; + + /* "yt/utilities/lib/element_mappings.pyx":714 + * super(W1Sampler3D, self).__init__() + * self.num_mapped_coords = 3 + * self.dim = 3 # <<<<<<<<<<<<<< + * self.func = W1Function3D + * self.jac = W1Jacobian3D + */ + __pyx_v_self->__pyx_base.dim = 3; + + /* "yt/utilities/lib/element_mappings.pyx":715 + * self.num_mapped_coords = 3 + * self.dim = 3 + * self.func = W1Function3D # <<<<<<<<<<<<<< + * self.jac = W1Jacobian3D + * + */ + __pyx_v_self->__pyx_base.func = __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_W1Function3D; + + /* "yt/utilities/lib/element_mappings.pyx":716 + * self.dim = 3 + * self.func = W1Function3D + * self.jac = W1Jacobian3D # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_v_self->__pyx_base.jac = __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_W1Jacobian3D; + + /* "yt/utilities/lib/element_mappings.pyx":711 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(W1Sampler3D, self).__init__() + * self.num_mapped_coords = 3 + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.W1Sampler3D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":721 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double F + * + */ + +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { + double __pyx_v_F; + double __pyx_r; + + /* "yt/utilities/lib/element_mappings.pyx":728 + * vals[2]*coord[1]*(1.0 - coord[2]) + \ + * vals[3]*(1.0 - coord[0] - coord[1])*(1.0 + coord[2]) + \ + * vals[4]*coord[0]*(1.0 + coord[2]) + \ # <<<<<<<<<<<<<< + * vals[5]*coord[1]*(1.0 + coord[2]) + * + */ + __pyx_v_F = ((((((((__pyx_v_vals[0]) * ((1.0 - (__pyx_v_coord[0])) - (__pyx_v_coord[1]))) * (1.0 - (__pyx_v_coord[2]))) + (((__pyx_v_vals[1]) * (__pyx_v_coord[0])) * (1.0 - (__pyx_v_coord[2])))) + (((__pyx_v_vals[2]) * (__pyx_v_coord[1])) * (1.0 - (__pyx_v_coord[2])))) + (((__pyx_v_vals[3]) * ((1.0 - (__pyx_v_coord[0])) - (__pyx_v_coord[1]))) * (1.0 + (__pyx_v_coord[2])))) + (((__pyx_v_vals[4]) * (__pyx_v_coord[0])) * (1.0 + (__pyx_v_coord[2])))) + (((__pyx_v_vals[5]) * (__pyx_v_coord[1])) * (1.0 + (__pyx_v_coord[2])))); + + /* "yt/utilities/lib/element_mappings.pyx":731 + * vals[5]*coord[1]*(1.0 + coord[2]) + * + * return F / 2.0 # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = (__pyx_v_F / 2.0); + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":721 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double F + * + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":736 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for wedges the bounds of the mapped coordinates are: + * # 0 <= mapped_coord[0] <= 1 - mapped_coord[1] + */ + +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + + /* "yt/utilities/lib/element_mappings.pyx":741 + * # 0 <= mapped_coord[1] + * # -1 <= mapped_coord[2] <= 1 + * if (mapped_coord[0] < -self.inclusion_tol or # <<<<<<<<<<<<<< + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + * return 0 + */ + __pyx_t_2 = (((__pyx_v_mapped_coord[0]) < (-__pyx_v_self->__pyx_base.__pyx_base.inclusion_tol)) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":742 + * # -1 <= mapped_coord[2] <= 1 + * if (mapped_coord[0] < -self.inclusion_tol or + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 + * if (mapped_coord[1] < -self.inclusion_tol): + */ + __pyx_t_2 = (((((__pyx_v_mapped_coord[0]) + (__pyx_v_mapped_coord[1])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + + /* "yt/utilities/lib/element_mappings.pyx":741 + * # 0 <= mapped_coord[1] + * # -1 <= mapped_coord[2] <= 1 + * if (mapped_coord[0] < -self.inclusion_tol or # <<<<<<<<<<<<<< + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + * return 0 + */ + if (__pyx_t_1) { + + /* "yt/utilities/lib/element_mappings.pyx":743 + * if (mapped_coord[0] < -self.inclusion_tol or + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + * return 0 # <<<<<<<<<<<<<< + * if (mapped_coord[1] < -self.inclusion_tol): + * return 0 + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":741 + * # 0 <= mapped_coord[1] + * # -1 <= mapped_coord[2] <= 1 + * if (mapped_coord[0] < -self.inclusion_tol or # <<<<<<<<<<<<<< + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + * return 0 + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":744 + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + * return 0 + * if (mapped_coord[1] < -self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 + * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + */ + __pyx_t_1 = (((__pyx_v_mapped_coord[1]) < (-__pyx_v_self->__pyx_base.__pyx_base.inclusion_tol)) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/element_mappings.pyx":745 + * return 0 + * if (mapped_coord[1] < -self.inclusion_tol): + * return 0 # <<<<<<<<<<<<<< + * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + * return 0 + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":744 + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + * return 0 + * if (mapped_coord[1] < -self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 + * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":746 + * if (mapped_coord[1] < -self.inclusion_tol): + * return 0 + * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 + * return 1 + */ + __pyx_t_1 = (((fabs((__pyx_v_mapped_coord[2])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/element_mappings.pyx":747 + * return 0 + * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + * return 0 # <<<<<<<<<<<<<< + * return 1 + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":746 + * if (mapped_coord[1] < -self.inclusion_tol): + * return 0 + * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 + * return 1 + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":748 + * if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): + * return 0 + * return 1 # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":736 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for wedges the bounds of the mapped coordinates are: + * # 0 <= mapped_coord[0] <= 1 - mapped_coord[1] + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":753 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * cdef double r, s, t + * cdef double thresh = 5.0e-2 + */ + +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_check_mesh_lines(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { + double __pyx_v_r; + double __pyx_v_s; + CYTHON_UNUSED double __pyx_v_t; + double __pyx_v_thresh; + int __pyx_v_near_edge_r; + int __pyx_v_near_edge_s; + int __pyx_v_near_edge_t; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "yt/utilities/lib/element_mappings.pyx":755 + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: + * cdef double r, s, t + * cdef double thresh = 5.0e-2 # <<<<<<<<<<<<<< + * r = mapped_coord[0] + * s = mapped_coord[1] + */ + __pyx_v_thresh = 5.0e-2; + + /* "yt/utilities/lib/element_mappings.pyx":756 + * cdef double r, s, t + * cdef double thresh = 5.0e-2 + * r = mapped_coord[0] # <<<<<<<<<<<<<< + * s = mapped_coord[1] + * t = mapped_coord[2] + */ + __pyx_v_r = (__pyx_v_mapped_coord[0]); + + /* "yt/utilities/lib/element_mappings.pyx":757 + * cdef double thresh = 5.0e-2 + * r = mapped_coord[0] + * s = mapped_coord[1] # <<<<<<<<<<<<<< + * t = mapped_coord[2] + * + */ + __pyx_v_s = (__pyx_v_mapped_coord[1]); + + /* "yt/utilities/lib/element_mappings.pyx":758 + * r = mapped_coord[0] + * s = mapped_coord[1] + * t = mapped_coord[2] # <<<<<<<<<<<<<< + * + * cdef int near_edge_r, near_edge_s, near_edge_t + */ + __pyx_v_t = (__pyx_v_mapped_coord[2]); + + /* "yt/utilities/lib/element_mappings.pyx":761 + * + * cdef int near_edge_r, near_edge_s, near_edge_t + * near_edge_r = (r < thresh) or (fabs(r + s - 1.0) < thresh) # <<<<<<<<<<<<<< + * near_edge_s = (s < thresh) + * near_edge_t = fabs(fabs(mapped_coord[2]) - 1.0) < thresh + */ + __pyx_t_2 = (__pyx_v_r < __pyx_v_thresh); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_2 = (fabs(((__pyx_v_r + __pyx_v_s) - 1.0)) < __pyx_v_thresh); + __pyx_t_1 = __pyx_t_2; + __pyx_L3_bool_binop_done:; + __pyx_v_near_edge_r = __pyx_t_1; + + /* "yt/utilities/lib/element_mappings.pyx":762 + * cdef int near_edge_r, near_edge_s, near_edge_t + * near_edge_r = (r < thresh) or (fabs(r + s - 1.0) < thresh) + * near_edge_s = (s < thresh) # <<<<<<<<<<<<<< + * near_edge_t = fabs(fabs(mapped_coord[2]) - 1.0) < thresh + * + */ + __pyx_v_near_edge_s = (__pyx_v_s < __pyx_v_thresh); + + /* "yt/utilities/lib/element_mappings.pyx":763 + * near_edge_r = (r < thresh) or (fabs(r + s - 1.0) < thresh) + * near_edge_s = (s < thresh) + * near_edge_t = fabs(fabs(mapped_coord[2]) - 1.0) < thresh # <<<<<<<<<<<<<< + * + * # we use ray.instID to pass back whether the ray is near the + */ + __pyx_v_near_edge_t = (fabs((fabs((__pyx_v_mapped_coord[2])) - 1.0)) < __pyx_v_thresh); + + /* "yt/utilities/lib/element_mappings.pyx":767 + * # we use ray.instID to pass back whether the ray is near the + * # element boundary or not (used to annotate mesh lines) + * if (near_edge_r and near_edge_s): # <<<<<<<<<<<<<< + * return 1 + * elif (near_edge_r and near_edge_t): + */ + __pyx_t_3 = (__pyx_v_near_edge_r != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_near_edge_s != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L6_bool_binop_done:; + if (__pyx_t_2) { + + /* "yt/utilities/lib/element_mappings.pyx":768 + * # element boundary or not (used to annotate mesh lines) + * if (near_edge_r and near_edge_s): + * return 1 # <<<<<<<<<<<<<< + * elif (near_edge_r and near_edge_t): + * return 1 + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":767 + * # we use ray.instID to pass back whether the ray is near the + * # element boundary or not (used to annotate mesh lines) + * if (near_edge_r and near_edge_s): # <<<<<<<<<<<<<< + * return 1 + * elif (near_edge_r and near_edge_t): + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":769 + * if (near_edge_r and near_edge_s): + * return 1 + * elif (near_edge_r and near_edge_t): # <<<<<<<<<<<<<< + * return 1 + * elif (near_edge_s and near_edge_t): + */ + __pyx_t_3 = (__pyx_v_near_edge_r != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_near_edge_t != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L8_bool_binop_done:; + if (__pyx_t_2) { + + /* "yt/utilities/lib/element_mappings.pyx":770 + * return 1 + * elif (near_edge_r and near_edge_t): + * return 1 # <<<<<<<<<<<<<< + * elif (near_edge_s and near_edge_t): + * return 1 + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":769 + * if (near_edge_r and near_edge_s): + * return 1 + * elif (near_edge_r and near_edge_t): # <<<<<<<<<<<<<< + * return 1 + * elif (near_edge_s and near_edge_t): + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":771 + * elif (near_edge_r and near_edge_t): + * return 1 + * elif (near_edge_s and near_edge_t): # <<<<<<<<<<<<<< + * return 1 + * else: + */ + __pyx_t_3 = (__pyx_v_near_edge_s != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L10_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_near_edge_t != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L10_bool_binop_done:; + if (__pyx_t_2) { + + /* "yt/utilities/lib/element_mappings.pyx":772 + * return 1 + * elif (near_edge_s and near_edge_t): + * return 1 # <<<<<<<<<<<<<< + * else: + * return -1 + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":771 + * elif (near_edge_r and near_edge_t): + * return 1 + * elif (near_edge_s and near_edge_t): # <<<<<<<<<<<<<< + * return 1 + * else: + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":774 + * return 1 + * else: + * return -1 # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_r = -1; + goto __pyx_L0; + } + + /* "yt/utilities/lib/element_mappings.pyx":753 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * cdef double r, s, t + * cdef double thresh = 5.0e-2 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_3__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_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__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.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, 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.func,self.jac 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("yt.utilities.lib.element_mappings.W1Sampler3D.__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_5__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_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, 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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.W1Sampler3D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":790 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(NonlinearSolveSampler2D, self).__init__() + * self.tolerance = 1.0e-9 + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "yt/utilities/lib/element_mappings.pyx":791 + * + * def __init__(self): + * super(NonlinearSolveSampler2D, self).__init__() # <<<<<<<<<<<<<< + * self.tolerance = 1.0e-9 + * self.max_iter = 10 + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":792 + * def __init__(self): + * super(NonlinearSolveSampler2D, self).__init__() + * self.tolerance = 1.0e-9 # <<<<<<<<<<<<<< + * self.max_iter = 10 + * + */ + __pyx_v_self->tolerance = 1.0e-9; + + /* "yt/utilities/lib/element_mappings.pyx":793 + * super(NonlinearSolveSampler2D, self).__init__() + * self.tolerance = 1.0e-9 + * self.max_iter = 10 # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_v_self->max_iter = 10; + + /* "yt/utilities/lib/element_mappings.pyx":790 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(NonlinearSolveSampler2D, self).__init__() + * self.tolerance = 1.0e-9 + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.NonlinearSolveSampler2D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":798 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void map_real_to_unit(self, # <<<<<<<<<<<<<< + * double* mapped_x, + * double* vertices, + */ + +static void __pyx_f_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_map_real_to_unit(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__pyx_v_self, double *__pyx_v_mapped_x, double *__pyx_v_vertices, double *__pyx_v_physical_x) { + int __pyx_v_i; + double __pyx_v_d; + double __pyx_v_lam; + double __pyx_v_f[2]; + double __pyx_v_x[2]; + double __pyx_v_xk[2]; + double __pyx_v_s_n[2]; + double __pyx_v_A[4]; + int __pyx_v_iterations; + double __pyx_v_err_c; + double __pyx_v_err_plus; + double __pyx_v_alpha; + double __pyx_v_min_lam; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "yt/utilities/lib/element_mappings.pyx":830 + * cdef double[2] x, xk, s_n + * cdef double[4] A + * cdef int iterations = 0 # <<<<<<<<<<<<<< + * cdef double err_c, err_plus + * cdef double alpha = 1e-4 + */ + __pyx_v_iterations = 0; + + /* "yt/utilities/lib/element_mappings.pyx":832 + * cdef int iterations = 0 + * cdef double err_c, err_plus + * cdef double alpha = 1e-4 # <<<<<<<<<<<<<< + * cdef double min_lam = 1e-6 + * + */ + __pyx_v_alpha = 1e-4; + + /* "yt/utilities/lib/element_mappings.pyx":833 + * cdef double err_c, err_plus + * cdef double alpha = 1e-4 + * cdef double min_lam = 1e-6 # <<<<<<<<<<<<<< + * + * # initial guess + */ + __pyx_v_min_lam = 1e-6; + + /* "yt/utilities/lib/element_mappings.pyx":836 + * + * # initial guess + * for i in range(2): # <<<<<<<<<<<<<< + * x[i] = 0.0 + * + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/element_mappings.pyx":837 + * # initial guess + * for i in range(2): + * x[i] = 0.0 # <<<<<<<<<<<<<< + * + * # initial error norm + */ + (__pyx_v_x[__pyx_v_i]) = 0.0; + } + + /* "yt/utilities/lib/element_mappings.pyx":840 + * + * # initial error norm + * self.func(f, x, vertices, physical_x) # <<<<<<<<<<<<<< + * err_c = maxnorm(f, 2) + * + */ + __pyx_v_self->func(__pyx_v_f, __pyx_v_x, __pyx_v_vertices, __pyx_v_physical_x); + + /* "yt/utilities/lib/element_mappings.pyx":841 + * # initial error norm + * self.func(f, x, vertices, physical_x) + * err_c = maxnorm(f, 2) # <<<<<<<<<<<<<< + * + * # begin Newton iteration + */ + __pyx_v_err_c = __pyx_f_2yt_9utilities_3lib_16element_mappings_maxnorm(__pyx_v_f, 2); + + /* "yt/utilities/lib/element_mappings.pyx":844 + * + * # begin Newton iteration + * while (err_c > self.tolerance and iterations < self.max_iter): # <<<<<<<<<<<<<< + * self.jac(&A[0], &A[2], x, vertices, physical_x) + * d = (A[0]*A[3] - A[1]*A[2]) + */ + while (1) { + __pyx_t_3 = ((__pyx_v_err_c > __pyx_v_self->tolerance) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_iterations < __pyx_v_self->max_iter) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L7_bool_binop_done:; + if (!__pyx_t_2) break; + + /* "yt/utilities/lib/element_mappings.pyx":845 + * # begin Newton iteration + * while (err_c > self.tolerance and iterations < self.max_iter): + * self.jac(&A[0], &A[2], x, vertices, physical_x) # <<<<<<<<<<<<<< + * d = (A[0]*A[3] - A[1]*A[2]) + * + */ + __pyx_v_self->jac((&(__pyx_v_A[0])), (&(__pyx_v_A[2])), __pyx_v_x, __pyx_v_vertices, __pyx_v_physical_x); + + /* "yt/utilities/lib/element_mappings.pyx":846 + * while (err_c > self.tolerance and iterations < self.max_iter): + * self.jac(&A[0], &A[2], x, vertices, physical_x) + * d = (A[0]*A[3] - A[1]*A[2]) # <<<<<<<<<<<<<< + * + * s_n[0] = -( A[3]*f[0] - A[2]*f[1]) / d + */ + __pyx_v_d = (((__pyx_v_A[0]) * (__pyx_v_A[3])) - ((__pyx_v_A[1]) * (__pyx_v_A[2]))); + + /* "yt/utilities/lib/element_mappings.pyx":848 + * d = (A[0]*A[3] - A[1]*A[2]) + * + * s_n[0] = -( A[3]*f[0] - A[2]*f[1]) / d # <<<<<<<<<<<<<< + * s_n[1] = -(-A[1]*f[0] + A[0]*f[1]) / d + * xk[0] = x[0] + s_n[0] + */ + (__pyx_v_s_n[0]) = ((-(((__pyx_v_A[3]) * (__pyx_v_f[0])) - ((__pyx_v_A[2]) * (__pyx_v_f[1])))) / __pyx_v_d); + + /* "yt/utilities/lib/element_mappings.pyx":849 + * + * s_n[0] = -( A[3]*f[0] - A[2]*f[1]) / d + * s_n[1] = -(-A[1]*f[0] + A[0]*f[1]) / d # <<<<<<<<<<<<<< + * xk[0] = x[0] + s_n[0] + * xk[1] = x[1] + s_n[1] + */ + (__pyx_v_s_n[1]) = ((-(((-(__pyx_v_A[1])) * (__pyx_v_f[0])) + ((__pyx_v_A[0]) * (__pyx_v_f[1])))) / __pyx_v_d); + + /* "yt/utilities/lib/element_mappings.pyx":850 + * s_n[0] = -( A[3]*f[0] - A[2]*f[1]) / d + * s_n[1] = -(-A[1]*f[0] + A[0]*f[1]) / d + * xk[0] = x[0] + s_n[0] # <<<<<<<<<<<<<< + * xk[1] = x[1] + s_n[1] + * self.func(f, xk, vertices, physical_x) + */ + (__pyx_v_xk[0]) = ((__pyx_v_x[0]) + (__pyx_v_s_n[0])); + + /* "yt/utilities/lib/element_mappings.pyx":851 + * s_n[1] = -(-A[1]*f[0] + A[0]*f[1]) / d + * xk[0] = x[0] + s_n[0] + * xk[1] = x[1] + s_n[1] # <<<<<<<<<<<<<< + * self.func(f, xk, vertices, physical_x) + * err_plus = maxnorm(f, 2) + */ + (__pyx_v_xk[1]) = ((__pyx_v_x[1]) + (__pyx_v_s_n[1])); + + /* "yt/utilities/lib/element_mappings.pyx":852 + * xk[0] = x[0] + s_n[0] + * xk[1] = x[1] + s_n[1] + * self.func(f, xk, vertices, physical_x) # <<<<<<<<<<<<<< + * err_plus = maxnorm(f, 2) + * + */ + __pyx_v_self->func(__pyx_v_f, __pyx_v_xk, __pyx_v_vertices, __pyx_v_physical_x); + + /* "yt/utilities/lib/element_mappings.pyx":853 + * xk[1] = x[1] + s_n[1] + * self.func(f, xk, vertices, physical_x) + * err_plus = maxnorm(f, 2) # <<<<<<<<<<<<<< + * + * lam = 1 + */ + __pyx_v_err_plus = __pyx_f_2yt_9utilities_3lib_16element_mappings_maxnorm(__pyx_v_f, 2); + + /* "yt/utilities/lib/element_mappings.pyx":855 + * err_plus = maxnorm(f, 2) + * + * lam = 1 # <<<<<<<<<<<<<< + * while err_plus > err_c * (1. - alpha * lam) and lam > min_lam: + * lam = lam / 2 + */ + __pyx_v_lam = 1.0; + + /* "yt/utilities/lib/element_mappings.pyx":856 + * + * lam = 1 + * while err_plus > err_c * (1. - alpha * lam) and lam > min_lam: # <<<<<<<<<<<<<< + * lam = lam / 2 + * xk[0] = x[0] + lam * s_n[0] + */ + while (1) { + __pyx_t_3 = ((__pyx_v_err_plus > (__pyx_v_err_c * (1. - (__pyx_v_alpha * __pyx_v_lam)))) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_lam > __pyx_v_min_lam) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L11_bool_binop_done:; + if (!__pyx_t_2) break; + + /* "yt/utilities/lib/element_mappings.pyx":857 + * lam = 1 + * while err_plus > err_c * (1. - alpha * lam) and lam > min_lam: + * lam = lam / 2 # <<<<<<<<<<<<<< + * xk[0] = x[0] + lam * s_n[0] + * xk[1] = x[1] + lam * s_n[1] + */ + __pyx_v_lam = (__pyx_v_lam / 2.0); + + /* "yt/utilities/lib/element_mappings.pyx":858 + * while err_plus > err_c * (1. - alpha * lam) and lam > min_lam: + * lam = lam / 2 + * xk[0] = x[0] + lam * s_n[0] # <<<<<<<<<<<<<< + * xk[1] = x[1] + lam * s_n[1] + * self.func(f, xk, vertices, physical_x) + */ + (__pyx_v_xk[0]) = ((__pyx_v_x[0]) + (__pyx_v_lam * (__pyx_v_s_n[0]))); + + /* "yt/utilities/lib/element_mappings.pyx":859 + * lam = lam / 2 + * xk[0] = x[0] + lam * s_n[0] + * xk[1] = x[1] + lam * s_n[1] # <<<<<<<<<<<<<< + * self.func(f, xk, vertices, physical_x) + * err_plus = maxnorm(f, 2) + */ + (__pyx_v_xk[1]) = ((__pyx_v_x[1]) + (__pyx_v_lam * (__pyx_v_s_n[1]))); + + /* "yt/utilities/lib/element_mappings.pyx":860 + * xk[0] = x[0] + lam * s_n[0] + * xk[1] = x[1] + lam * s_n[1] + * self.func(f, xk, vertices, physical_x) # <<<<<<<<<<<<<< + * err_plus = maxnorm(f, 2) + * + */ + __pyx_v_self->func(__pyx_v_f, __pyx_v_xk, __pyx_v_vertices, __pyx_v_physical_x); + + /* "yt/utilities/lib/element_mappings.pyx":861 + * xk[1] = x[1] + lam * s_n[1] + * self.func(f, xk, vertices, physical_x) + * err_plus = maxnorm(f, 2) # <<<<<<<<<<<<<< + * + * x[0] = xk[0] + */ + __pyx_v_err_plus = __pyx_f_2yt_9utilities_3lib_16element_mappings_maxnorm(__pyx_v_f, 2); + } + + /* "yt/utilities/lib/element_mappings.pyx":863 + * err_plus = maxnorm(f, 2) + * + * x[0] = xk[0] # <<<<<<<<<<<<<< + * x[1] = xk[1] + * err_c = err_plus + */ + (__pyx_v_x[0]) = (__pyx_v_xk[0]); + + /* "yt/utilities/lib/element_mappings.pyx":864 + * + * x[0] = xk[0] + * x[1] = xk[1] # <<<<<<<<<<<<<< + * err_c = err_plus + * iterations += 1 + */ + (__pyx_v_x[1]) = (__pyx_v_xk[1]); + + /* "yt/utilities/lib/element_mappings.pyx":865 + * x[0] = xk[0] + * x[1] = xk[1] + * err_c = err_plus # <<<<<<<<<<<<<< + * iterations += 1 + * + */ + __pyx_v_err_c = __pyx_v_err_plus; + + /* "yt/utilities/lib/element_mappings.pyx":866 + * x[1] = xk[1] + * err_c = err_plus + * iterations += 1 # <<<<<<<<<<<<<< + * + * if (err_c > self.tolerance): + */ + __pyx_v_iterations = (__pyx_v_iterations + 1); + } + + /* "yt/utilities/lib/element_mappings.pyx":868 + * iterations += 1 + * + * if (err_c > self.tolerance): # <<<<<<<<<<<<<< + * # we did not converge, set bogus value + * for i in range(2): + */ + __pyx_t_2 = ((__pyx_v_err_c > __pyx_v_self->tolerance) != 0); + if (__pyx_t_2) { + + /* "yt/utilities/lib/element_mappings.pyx":870 + * if (err_c > self.tolerance): + * # we did not converge, set bogus value + * for i in range(2): # <<<<<<<<<<<<<< + * mapped_x[i] = -99.0 + * else: + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/element_mappings.pyx":871 + * # we did not converge, set bogus value + * for i in range(2): + * mapped_x[i] = -99.0 # <<<<<<<<<<<<<< + * else: + * for i in range(2): + */ + (__pyx_v_mapped_x[__pyx_v_i]) = -99.0; + } + + /* "yt/utilities/lib/element_mappings.pyx":868 + * iterations += 1 + * + * if (err_c > self.tolerance): # <<<<<<<<<<<<<< + * # we did not converge, set bogus value + * for i in range(2): + */ + goto __pyx_L13; + } + + /* "yt/utilities/lib/element_mappings.pyx":873 + * mapped_x[i] = -99.0 + * else: + * for i in range(2): # <<<<<<<<<<<<<< + * mapped_x[i] = x[i] + * + */ + /*else*/ { + for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/element_mappings.pyx":874 + * else: + * for i in range(2): + * mapped_x[i] = x[i] # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mapped_x[__pyx_v_i]) = (__pyx_v_x[__pyx_v_i]); + } + } + __pyx_L13:; + + /* "yt/utilities/lib/element_mappings.pyx":798 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void map_real_to_unit(self, # <<<<<<<<<<<<<< + * double* mapped_x, + * double* vertices, + */ + + /* function exit code */ +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_3__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_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__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.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, 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.func,self.jac 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("yt.utilities.lib.element_mappings.NonlinearSolveSampler2D.__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_5__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_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, 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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.NonlinearSolveSampler2D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":885 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(Q1Sampler2D, self).__init__() + * self.num_mapped_coords = 2 + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "yt/utilities/lib/element_mappings.pyx":886 + * + * def __init__(self): + * super(Q1Sampler2D, self).__init__() # <<<<<<<<<<<<<< + * self.num_mapped_coords = 2 + * self.dim = 2 + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":887 + * def __init__(self): + * super(Q1Sampler2D, self).__init__() + * self.num_mapped_coords = 2 # <<<<<<<<<<<<<< + * self.dim = 2 + * self.func = Q1Function2D + */ + __pyx_v_self->__pyx_base.__pyx_base.num_mapped_coords = 2; + + /* "yt/utilities/lib/element_mappings.pyx":888 + * super(Q1Sampler2D, self).__init__() + * self.num_mapped_coords = 2 + * self.dim = 2 # <<<<<<<<<<<<<< + * self.func = Q1Function2D + * self.jac = Q1Jacobian2D + */ + __pyx_v_self->__pyx_base.dim = 2; + + /* "yt/utilities/lib/element_mappings.pyx":889 + * self.num_mapped_coords = 2 + * self.dim = 2 + * self.func = Q1Function2D # <<<<<<<<<<<<<< + * self.jac = Q1Jacobian2D + * + */ + __pyx_v_self->__pyx_base.func = __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Function2D; + + /* "yt/utilities/lib/element_mappings.pyx":890 + * self.dim = 2 + * self.func = Q1Function2D + * self.jac = Q1Jacobian2D # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_v_self->__pyx_base.jac = __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Jacobian2D; + + /* "yt/utilities/lib/element_mappings.pyx":885 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(Q1Sampler2D, self).__init__() + * self.num_mapped_coords = 2 + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.Q1Sampler2D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":895 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double F, rm, rp, sm, sp + * + */ + +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { + double __pyx_v_F; + double __pyx_v_rm; + double __pyx_v_rp; + double __pyx_v_sm; + double __pyx_v_sp; + double __pyx_r; + + /* "yt/utilities/lib/element_mappings.pyx":898 + * cdef double F, rm, rp, sm, sp + * + * rm = 1.0 - coord[0] # <<<<<<<<<<<<<< + * rp = 1.0 + coord[0] + * sm = 1.0 - coord[1] + */ + __pyx_v_rm = (1.0 - (__pyx_v_coord[0])); + + /* "yt/utilities/lib/element_mappings.pyx":899 + * + * rm = 1.0 - coord[0] + * rp = 1.0 + coord[0] # <<<<<<<<<<<<<< + * sm = 1.0 - coord[1] + * sp = 1.0 + coord[1] + */ + __pyx_v_rp = (1.0 + (__pyx_v_coord[0])); + + /* "yt/utilities/lib/element_mappings.pyx":900 + * rm = 1.0 - coord[0] + * rp = 1.0 + coord[0] + * sm = 1.0 - coord[1] # <<<<<<<<<<<<<< + * sp = 1.0 + coord[1] + * + */ + __pyx_v_sm = (1.0 - (__pyx_v_coord[1])); + + /* "yt/utilities/lib/element_mappings.pyx":901 + * rp = 1.0 + coord[0] + * sm = 1.0 - coord[1] + * sp = 1.0 + coord[1] # <<<<<<<<<<<<<< + * + * F = vals[0]*rm*sm + vals[1]*rp*sm + vals[2]*rp*sp + vals[3]*rm*sp + */ + __pyx_v_sp = (1.0 + (__pyx_v_coord[1])); + + /* "yt/utilities/lib/element_mappings.pyx":903 + * sp = 1.0 + coord[1] + * + * F = vals[0]*rm*sm + vals[1]*rp*sm + vals[2]*rp*sp + vals[3]*rm*sp # <<<<<<<<<<<<<< + * return 0.25*F + * + */ + __pyx_v_F = ((((((__pyx_v_vals[0]) * __pyx_v_rm) * __pyx_v_sm) + (((__pyx_v_vals[1]) * __pyx_v_rp) * __pyx_v_sm)) + (((__pyx_v_vals[2]) * __pyx_v_rp) * __pyx_v_sp)) + (((__pyx_v_vals[3]) * __pyx_v_rm) * __pyx_v_sp)); + + /* "yt/utilities/lib/element_mappings.pyx":904 + * + * F = vals[0]*rm*sm + vals[1]*rp*sm + vals[2]*rp*sp + vals[3]*rm*sp + * return 0.25*F # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = (0.25 * __pyx_v_F); + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":895 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double F, rm, rp, sm, sp + * + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":909 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for quads, we check whether the mapped_coord is between + * # -1 and 1 in both directions. + */ + +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_self, double *__pyx_v_mapped_coord) { + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + + /* "yt/utilities/lib/element_mappings.pyx":912 + * # for quads, we check whether the mapped_coord is between + * # -1 and 1 in both directions. + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): + * return 0 + */ + __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[0])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":913 + * # -1 and 1 in both directions. + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 + * return 1 + */ + __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[1])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + + /* "yt/utilities/lib/element_mappings.pyx":912 + * # for quads, we check whether the mapped_coord is between + * # -1 and 1 in both directions. + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): + * return 0 + */ + if (__pyx_t_1) { + + /* "yt/utilities/lib/element_mappings.pyx":914 + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): + * return 0 # <<<<<<<<<<<<<< + * return 1 + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":912 + * # for quads, we check whether the mapped_coord is between + * # -1 and 1 in both directions. + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): + * return 0 + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":915 + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): + * return 0 + * return 1 # <<<<<<<<<<<<<< + * + * cdef class Q2Sampler2D(NonlinearSolveSampler2D): + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":909 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for quads, we check whether the mapped_coord is between + * # -1 and 1 in both directions. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_3__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_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__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.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, 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.func,self.jac 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("yt.utilities.lib.element_mappings.Q1Sampler2D.__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_5__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_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, 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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.Q1Sampler2D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":925 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(Q2Sampler2D, self).__init__() + * self.num_mapped_coords = 2 + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "yt/utilities/lib/element_mappings.pyx":926 + * + * def __init__(self): + * super(Q2Sampler2D, self).__init__() # <<<<<<<<<<<<<< + * self.num_mapped_coords = 2 + * self.dim = 2 + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":927 + * def __init__(self): + * super(Q2Sampler2D, self).__init__() + * self.num_mapped_coords = 2 # <<<<<<<<<<<<<< + * self.dim = 2 + * self.func = Q2Function2D + */ + __pyx_v_self->__pyx_base.__pyx_base.num_mapped_coords = 2; + + /* "yt/utilities/lib/element_mappings.pyx":928 + * super(Q2Sampler2D, self).__init__() + * self.num_mapped_coords = 2 + * self.dim = 2 # <<<<<<<<<<<<<< + * self.func = Q2Function2D + * self.jac = Q2Jacobian2D + */ + __pyx_v_self->__pyx_base.dim = 2; + + /* "yt/utilities/lib/element_mappings.pyx":929 + * self.num_mapped_coords = 2 + * self.dim = 2 + * self.func = Q2Function2D # <<<<<<<<<<<<<< + * self.jac = Q2Jacobian2D + * + */ + __pyx_v_self->__pyx_base.func = __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q2Function2D; + + /* "yt/utilities/lib/element_mappings.pyx":930 + * self.dim = 2 + * self.func = Q2Function2D + * self.jac = Q2Jacobian2D # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_v_self->__pyx_base.jac = __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q2Jacobian2D; + + /* "yt/utilities/lib/element_mappings.pyx":925 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(Q2Sampler2D, self).__init__() + * self.num_mapped_coords = 2 + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.Q2Sampler2D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":935 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double F, rm, rp, sm, sp + * cdef double[9] phi + */ + +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { + double __pyx_v_phi[9]; + double __pyx_v_rv; + double __pyx_v_zet; + double __pyx_v_eta; + double __pyx_v_zetm; + double __pyx_v_zetp; + double __pyx_v_etam; + double __pyx_v_etap; + long __pyx_v_i; + double __pyx_r; + long __pyx_t_1; + + /* "yt/utilities/lib/element_mappings.pyx":938 + * cdef double F, rm, rp, sm, sp + * cdef double[9] phi + * cdef double rv = 0 # <<<<<<<<<<<<<< + * + * zet = coord[0] + */ + __pyx_v_rv = 0.0; + + /* "yt/utilities/lib/element_mappings.pyx":940 + * cdef double rv = 0 + * + * zet = coord[0] # <<<<<<<<<<<<<< + * eta = coord[1] + * zetm = coord[0] - 1. + */ + __pyx_v_zet = (__pyx_v_coord[0]); + + /* "yt/utilities/lib/element_mappings.pyx":941 + * + * zet = coord[0] + * eta = coord[1] # <<<<<<<<<<<<<< + * zetm = coord[0] - 1. + * zetp = coord[0] + 1. + */ + __pyx_v_eta = (__pyx_v_coord[1]); + + /* "yt/utilities/lib/element_mappings.pyx":942 + * zet = coord[0] + * eta = coord[1] + * zetm = coord[0] - 1. # <<<<<<<<<<<<<< + * zetp = coord[0] + 1. + * etam = coord[1] - 1. + */ + __pyx_v_zetm = ((__pyx_v_coord[0]) - 1.); + + /* "yt/utilities/lib/element_mappings.pyx":943 + * eta = coord[1] + * zetm = coord[0] - 1. + * zetp = coord[0] + 1. # <<<<<<<<<<<<<< + * etam = coord[1] - 1. + * etap = coord[1] + 1. + */ + __pyx_v_zetp = ((__pyx_v_coord[0]) + 1.); + + /* "yt/utilities/lib/element_mappings.pyx":944 + * zetm = coord[0] - 1. + * zetp = coord[0] + 1. + * etam = coord[1] - 1. # <<<<<<<<<<<<<< + * etap = coord[1] + 1. + * + */ + __pyx_v_etam = ((__pyx_v_coord[1]) - 1.); + + /* "yt/utilities/lib/element_mappings.pyx":945 + * zetp = coord[0] + 1. + * etam = coord[1] - 1. + * etap = coord[1] + 1. # <<<<<<<<<<<<<< + * + * phi[0] = zet * zetm * eta * etam / 4. + */ + __pyx_v_etap = ((__pyx_v_coord[1]) + 1.); + + /* "yt/utilities/lib/element_mappings.pyx":947 + * etap = coord[1] + 1. + * + * phi[0] = zet * zetm * eta * etam / 4. # <<<<<<<<<<<<<< + * phi[1] = zet * zetp * eta * etam / 4. + * phi[2] = zet * zetp * eta * etap / 4. + */ + (__pyx_v_phi[0]) = ((((__pyx_v_zet * __pyx_v_zetm) * __pyx_v_eta) * __pyx_v_etam) / 4.); + + /* "yt/utilities/lib/element_mappings.pyx":948 + * + * phi[0] = zet * zetm * eta * etam / 4. + * phi[1] = zet * zetp * eta * etam / 4. # <<<<<<<<<<<<<< + * phi[2] = zet * zetp * eta * etap / 4. + * phi[3] = zet * zetm * eta * etap / 4. + */ + (__pyx_v_phi[1]) = ((((__pyx_v_zet * __pyx_v_zetp) * __pyx_v_eta) * __pyx_v_etam) / 4.); + + /* "yt/utilities/lib/element_mappings.pyx":949 + * phi[0] = zet * zetm * eta * etam / 4. + * phi[1] = zet * zetp * eta * etam / 4. + * phi[2] = zet * zetp * eta * etap / 4. # <<<<<<<<<<<<<< + * phi[3] = zet * zetm * eta * etap / 4. + * phi[4] = zetp * zetm * eta * etam / -2. + */ + (__pyx_v_phi[2]) = ((((__pyx_v_zet * __pyx_v_zetp) * __pyx_v_eta) * __pyx_v_etap) / 4.); + + /* "yt/utilities/lib/element_mappings.pyx":950 + * phi[1] = zet * zetp * eta * etam / 4. + * phi[2] = zet * zetp * eta * etap / 4. + * phi[3] = zet * zetm * eta * etap / 4. # <<<<<<<<<<<<<< + * phi[4] = zetp * zetm * eta * etam / -2. + * phi[5] = zet * zetp * etap * etam / -2. + */ + (__pyx_v_phi[3]) = ((((__pyx_v_zet * __pyx_v_zetm) * __pyx_v_eta) * __pyx_v_etap) / 4.); + + /* "yt/utilities/lib/element_mappings.pyx":951 + * phi[2] = zet * zetp * eta * etap / 4. + * phi[3] = zet * zetm * eta * etap / 4. + * phi[4] = zetp * zetm * eta * etam / -2. # <<<<<<<<<<<<<< + * phi[5] = zet * zetp * etap * etam / -2. + * phi[6] = zetp * zetm * eta * etap / -2. + */ + (__pyx_v_phi[4]) = ((((__pyx_v_zetp * __pyx_v_zetm) * __pyx_v_eta) * __pyx_v_etam) / -2.); + + /* "yt/utilities/lib/element_mappings.pyx":952 + * phi[3] = zet * zetm * eta * etap / 4. + * phi[4] = zetp * zetm * eta * etam / -2. + * phi[5] = zet * zetp * etap * etam / -2. # <<<<<<<<<<<<<< + * phi[6] = zetp * zetm * eta * etap / -2. + * phi[7] = zet * zetm * etap * etam / -2. + */ + (__pyx_v_phi[5]) = ((((__pyx_v_zet * __pyx_v_zetp) * __pyx_v_etap) * __pyx_v_etam) / -2.); + + /* "yt/utilities/lib/element_mappings.pyx":953 + * phi[4] = zetp * zetm * eta * etam / -2. + * phi[5] = zet * zetp * etap * etam / -2. + * phi[6] = zetp * zetm * eta * etap / -2. # <<<<<<<<<<<<<< + * phi[7] = zet * zetm * etap * etam / -2. + * phi[8] = zetp * zetm * etap * etam + */ + (__pyx_v_phi[6]) = ((((__pyx_v_zetp * __pyx_v_zetm) * __pyx_v_eta) * __pyx_v_etap) / -2.); + + /* "yt/utilities/lib/element_mappings.pyx":954 + * phi[5] = zet * zetp * etap * etam / -2. + * phi[6] = zetp * zetm * eta * etap / -2. + * phi[7] = zet * zetm * etap * etam / -2. # <<<<<<<<<<<<<< + * phi[8] = zetp * zetm * etap * etam + * + */ + (__pyx_v_phi[7]) = ((((__pyx_v_zet * __pyx_v_zetm) * __pyx_v_etap) * __pyx_v_etam) / -2.); + + /* "yt/utilities/lib/element_mappings.pyx":955 + * phi[6] = zetp * zetm * eta * etap / -2. + * phi[7] = zet * zetm * etap * etam / -2. + * phi[8] = zetp * zetm * etap * etam # <<<<<<<<<<<<<< + * + * for i in range(9): + */ + (__pyx_v_phi[8]) = (((__pyx_v_zetp * __pyx_v_zetm) * __pyx_v_etap) * __pyx_v_etam); + + /* "yt/utilities/lib/element_mappings.pyx":957 + * phi[8] = zetp * zetm * etap * etam + * + * for i in range(9): # <<<<<<<<<<<<<< + * rv += vals[i] * phi[i] + * + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 9; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/element_mappings.pyx":958 + * + * for i in range(9): + * rv += vals[i] * phi[i] # <<<<<<<<<<<<<< + * + * return rv + */ + __pyx_v_rv = (__pyx_v_rv + ((__pyx_v_vals[__pyx_v_i]) * (__pyx_v_phi[__pyx_v_i]))); + } + + /* "yt/utilities/lib/element_mappings.pyx":960 + * rv += vals[i] * phi[i] + * + * return rv # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = __pyx_v_rv; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":935 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double F, rm, rp, sm, sp + * cdef double[9] phi + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":965 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for quads, we check whether the mapped_coord is between + * # -1 and 1 in both directions. + */ + +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__pyx_v_self, double *__pyx_v_mapped_coord) { + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + + /* "yt/utilities/lib/element_mappings.pyx":968 + * # for quads, we check whether the mapped_coord is between + * # -1 and 1 in both directions. + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): + * return 0 + */ + __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[0])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":969 + * # -1 and 1 in both directions. + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 + * return 1 + */ + __pyx_t_2 = (((fabs((__pyx_v_mapped_coord[1])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + + /* "yt/utilities/lib/element_mappings.pyx":968 + * # for quads, we check whether the mapped_coord is between + * # -1 and 1 in both directions. + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): + * return 0 + */ + if (__pyx_t_1) { + + /* "yt/utilities/lib/element_mappings.pyx":970 + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): + * return 0 # <<<<<<<<<<<<<< + * return 1 + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":968 + * # for quads, we check whether the mapped_coord is between + * # -1 and 1 in both directions. + * if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or # <<<<<<<<<<<<<< + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): + * return 0 + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":971 + * fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): + * return 0 + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":965 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for quads, we check whether the mapped_coord is between + * # -1 and 1 in both directions. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_3__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_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__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.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, 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.func,self.jac 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("yt.utilities.lib.element_mappings.Q2Sampler2D.__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_5__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_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, 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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.Q2Sampler2D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":983 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(T2Sampler2D, self).__init__() + * self.num_mapped_coords = 2 + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "yt/utilities/lib/element_mappings.pyx":984 + * + * def __init__(self): + * super(T2Sampler2D, self).__init__() # <<<<<<<<<<<<<< + * self.num_mapped_coords = 2 + * self.dim = 2 + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":985 + * def __init__(self): + * super(T2Sampler2D, self).__init__() + * self.num_mapped_coords = 2 # <<<<<<<<<<<<<< + * self.dim = 2 + * self.func = T2Function2D + */ + __pyx_v_self->__pyx_base.__pyx_base.num_mapped_coords = 2; + + /* "yt/utilities/lib/element_mappings.pyx":986 + * super(T2Sampler2D, self).__init__() + * self.num_mapped_coords = 2 + * self.dim = 2 # <<<<<<<<<<<<<< + * self.func = T2Function2D + * self.jac = T2Jacobian2D + */ + __pyx_v_self->__pyx_base.dim = 2; + + /* "yt/utilities/lib/element_mappings.pyx":987 + * self.num_mapped_coords = 2 + * self.dim = 2 + * self.func = T2Function2D # <<<<<<<<<<<<<< + * self.jac = T2Jacobian2D + * + */ + __pyx_v_self->__pyx_base.func = __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_T2Function2D; + + /* "yt/utilities/lib/element_mappings.pyx":988 + * self.dim = 2 + * self.func = T2Function2D + * self.jac = T2Jacobian2D # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_v_self->__pyx_base.jac = __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_T2Jacobian2D; + + /* "yt/utilities/lib/element_mappings.pyx":983 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(T2Sampler2D, self).__init__() + * self.num_mapped_coords = 2 + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.T2Sampler2D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":993 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double phi0, phi1, phi2, phi3, phi4, phi5, c0sq, c1sq, c0c1 + * + */ + +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { + double __pyx_v_phi0; + double __pyx_v_phi1; + double __pyx_v_phi2; + double __pyx_v_phi3; + double __pyx_v_phi4; + double __pyx_v_phi5; + double __pyx_v_c0sq; + double __pyx_v_c1sq; + double __pyx_v_c0c1; + double __pyx_r; + + /* "yt/utilities/lib/element_mappings.pyx":996 + * cdef double phi0, phi1, phi2, phi3, phi4, phi5, c0sq, c1sq, c0c1 + * + * c0sq = coord[0] * coord[0] # <<<<<<<<<<<<<< + * c1sq = coord[1] * coord[1] + * c0c1 = coord[0] * coord[1] + */ + __pyx_v_c0sq = ((__pyx_v_coord[0]) * (__pyx_v_coord[0])); + + /* "yt/utilities/lib/element_mappings.pyx":997 + * + * c0sq = coord[0] * coord[0] + * c1sq = coord[1] * coord[1] # <<<<<<<<<<<<<< + * c0c1 = coord[0] * coord[1] + * + */ + __pyx_v_c1sq = ((__pyx_v_coord[1]) * (__pyx_v_coord[1])); + + /* "yt/utilities/lib/element_mappings.pyx":998 + * c0sq = coord[0] * coord[0] + * c1sq = coord[1] * coord[1] + * c0c1 = coord[0] * coord[1] # <<<<<<<<<<<<<< + * + * phi0 = 1 - 3 * coord[0] + 2 * c0sq - 3 * coord[1] + \ + */ + __pyx_v_c0c1 = ((__pyx_v_coord[0]) * (__pyx_v_coord[1])); + + /* "yt/utilities/lib/element_mappings.pyx":1001 + * + * phi0 = 1 - 3 * coord[0] + 2 * c0sq - 3 * coord[1] + \ + * 2 * c1sq + 4 * c0c1 # <<<<<<<<<<<<<< + * phi1 = -coord[0] + 2 * c0sq + * phi2 = -coord[1] + 2 * c1sq + */ + __pyx_v_phi0 = (((((1.0 - (3.0 * (__pyx_v_coord[0]))) + (2.0 * __pyx_v_c0sq)) - (3.0 * (__pyx_v_coord[1]))) + (2.0 * __pyx_v_c1sq)) + (4.0 * __pyx_v_c0c1)); + + /* "yt/utilities/lib/element_mappings.pyx":1002 + * phi0 = 1 - 3 * coord[0] + 2 * c0sq - 3 * coord[1] + \ + * 2 * c1sq + 4 * c0c1 + * phi1 = -coord[0] + 2 * c0sq # <<<<<<<<<<<<<< + * phi2 = -coord[1] + 2 * c1sq + * phi3 = 4 * coord[0] - 4 * c0sq - 4 * c0c1 + */ + __pyx_v_phi1 = ((-(__pyx_v_coord[0])) + (2.0 * __pyx_v_c0sq)); + + /* "yt/utilities/lib/element_mappings.pyx":1003 + * 2 * c1sq + 4 * c0c1 + * phi1 = -coord[0] + 2 * c0sq + * phi2 = -coord[1] + 2 * c1sq # <<<<<<<<<<<<<< + * phi3 = 4 * coord[0] - 4 * c0sq - 4 * c0c1 + * phi4 = 4 * c0c1 + */ + __pyx_v_phi2 = ((-(__pyx_v_coord[1])) + (2.0 * __pyx_v_c1sq)); + + /* "yt/utilities/lib/element_mappings.pyx":1004 + * phi1 = -coord[0] + 2 * c0sq + * phi2 = -coord[1] + 2 * c1sq + * phi3 = 4 * coord[0] - 4 * c0sq - 4 * c0c1 # <<<<<<<<<<<<<< + * phi4 = 4 * c0c1 + * phi5 = 4 * coord[1] - 4 * c1sq - 4 * c0c1 + */ + __pyx_v_phi3 = (((4.0 * (__pyx_v_coord[0])) - (4.0 * __pyx_v_c0sq)) - (4.0 * __pyx_v_c0c1)); + + /* "yt/utilities/lib/element_mappings.pyx":1005 + * phi2 = -coord[1] + 2 * c1sq + * phi3 = 4 * coord[0] - 4 * c0sq - 4 * c0c1 + * phi4 = 4 * c0c1 # <<<<<<<<<<<<<< + * phi5 = 4 * coord[1] - 4 * c1sq - 4 * c0c1 + * + */ + __pyx_v_phi4 = (4.0 * __pyx_v_c0c1); + + /* "yt/utilities/lib/element_mappings.pyx":1006 + * phi3 = 4 * coord[0] - 4 * c0sq - 4 * c0c1 + * phi4 = 4 * c0c1 + * phi5 = 4 * coord[1] - 4 * c1sq - 4 * c0c1 # <<<<<<<<<<<<<< + * + * return vals[0]*phi0 + vals[1]*phi1 + vals[2]*phi2 + vals[3]*phi3 + \ + */ + __pyx_v_phi5 = (((4.0 * (__pyx_v_coord[1])) - (4.0 * __pyx_v_c1sq)) - (4.0 * __pyx_v_c0c1)); + + /* "yt/utilities/lib/element_mappings.pyx":1009 + * + * return vals[0]*phi0 + vals[1]*phi1 + vals[2]*phi2 + vals[3]*phi3 + \ + * vals[4]*phi4 + vals[5]*phi5 # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = (((((((__pyx_v_vals[0]) * __pyx_v_phi0) + ((__pyx_v_vals[1]) * __pyx_v_phi1)) + ((__pyx_v_vals[2]) * __pyx_v_phi2)) + ((__pyx_v_vals[3]) * __pyx_v_phi3)) + ((__pyx_v_vals[4]) * __pyx_v_phi4)) + ((__pyx_v_vals[5]) * __pyx_v_phi5)); + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":993 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double phi0, phi1, phi2, phi3, phi4, phi5, c0sq, c1sq, c0c1 + * + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1014 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for canonical tris, we check whether the mapped_coords are between + * # 0 and 1. + */ + +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__pyx_v_self, double *__pyx_v_mapped_coord) { + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + + /* "yt/utilities/lib/element_mappings.pyx":1017 + * # for canonical tris, we check whether the mapped_coords are between + * # 0 and 1. + * if (mapped_coord[0] < -self.inclusion_tol or \ # <<<<<<<<<<<<<< + * mapped_coord[1] < -self.inclusion_tol or \ + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + */ + __pyx_t_2 = (((__pyx_v_mapped_coord[0]) < (-__pyx_v_self->__pyx_base.__pyx_base.inclusion_tol)) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":1018 + * # 0 and 1. + * if (mapped_coord[0] < -self.inclusion_tol or \ + * mapped_coord[1] < -self.inclusion_tol or \ # <<<<<<<<<<<<<< + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + * return 0 + */ + __pyx_t_2 = (((__pyx_v_mapped_coord[1]) < (-__pyx_v_self->__pyx_base.__pyx_base.inclusion_tol)) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":1019 + * if (mapped_coord[0] < -self.inclusion_tol or \ + * mapped_coord[1] < -self.inclusion_tol or \ + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): # <<<<<<<<<<<<<< + * return 0 + * return 1 + */ + __pyx_t_2 = (((((__pyx_v_mapped_coord[0]) + (__pyx_v_mapped_coord[1])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + + /* "yt/utilities/lib/element_mappings.pyx":1017 + * # for canonical tris, we check whether the mapped_coords are between + * # 0 and 1. + * if (mapped_coord[0] < -self.inclusion_tol or \ # <<<<<<<<<<<<<< + * mapped_coord[1] < -self.inclusion_tol or \ + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + */ + if (__pyx_t_1) { + + /* "yt/utilities/lib/element_mappings.pyx":1020 + * mapped_coord[1] < -self.inclusion_tol or \ + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + * return 0 # <<<<<<<<<<<<<< + * return 1 + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1017 + * # for canonical tris, we check whether the mapped_coords are between + * # 0 and 1. + * if (mapped_coord[0] < -self.inclusion_tol or \ # <<<<<<<<<<<<<< + * mapped_coord[1] < -self.inclusion_tol or \ + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":1021 + * mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + * return 0 + * return 1 # <<<<<<<<<<<<<< + * + * cdef class Tet2Sampler3D(NonlinearSolveSampler3D): + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1014 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for canonical tris, we check whether the mapped_coords are between + * # 0 and 1. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_3__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_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__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.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, 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.func,self.jac 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("yt.utilities.lib.element_mappings.T2Sampler2D.__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_5__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_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, 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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.T2Sampler2D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1032 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(Tet2Sampler3D, self).__init__() + * self.num_mapped_coords = 3 + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D___init__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D___init__(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "yt/utilities/lib/element_mappings.pyx":1033 + * + * def __init__(self): + * super(Tet2Sampler3D, self).__init__() # <<<<<<<<<<<<<< + * self.num_mapped_coords = 3 + * self.dim = 3 + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + 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); + } + } + if (__pyx_t_3) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":1034 + * def __init__(self): + * super(Tet2Sampler3D, self).__init__() + * self.num_mapped_coords = 3 # <<<<<<<<<<<<<< + * self.dim = 3 + * self.func = Tet2Function3D + */ + __pyx_v_self->__pyx_base.__pyx_base.num_mapped_coords = 3; + + /* "yt/utilities/lib/element_mappings.pyx":1035 + * super(Tet2Sampler3D, self).__init__() + * self.num_mapped_coords = 3 + * self.dim = 3 # <<<<<<<<<<<<<< + * self.func = Tet2Function3D + * self.jac = Tet2Jacobian3D + */ + __pyx_v_self->__pyx_base.dim = 3; + + /* "yt/utilities/lib/element_mappings.pyx":1036 + * self.num_mapped_coords = 3 + * self.dim = 3 + * self.func = Tet2Function3D # <<<<<<<<<<<<<< + * self.jac = Tet2Jacobian3D + * + */ + __pyx_v_self->__pyx_base.func = __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Tet2Function3D; + + /* "yt/utilities/lib/element_mappings.pyx":1037 + * self.dim = 3 + * self.func = Tet2Function3D + * self.jac = Tet2Jacobian3D # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_v_self->__pyx_base.jac = __pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Tet2Jacobian3D; + + /* "yt/utilities/lib/element_mappings.pyx":1032 + * ''' + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(Tet2Sampler3D, self).__init__() + * self.num_mapped_coords = 3 + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.Tet2Sampler3D.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1042 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double[10] phi + * cdef double coordsq[3] + */ + +static double __pyx_f_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_sample_at_unit_point(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_v_self, double *__pyx_v_coord, double *__pyx_v_vals) { + double __pyx_v_phi[10]; + double __pyx_v_coordsq[3]; + int __pyx_v_i; + double __pyx_v_return_value; + double __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/element_mappings.pyx":1046 + * cdef double coordsq[3] + * cdef int i + * cdef double return_value = 0 # <<<<<<<<<<<<<< + * + * for i in range(3): + */ + __pyx_v_return_value = 0.0; + + /* "yt/utilities/lib/element_mappings.pyx":1048 + * cdef double return_value = 0 + * + * for i in range(3): # <<<<<<<<<<<<<< + * coordsq[i] = coord[i] * coord[i] + * + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/element_mappings.pyx":1049 + * + * for i in range(3): + * coordsq[i] = coord[i] * coord[i] # <<<<<<<<<<<<<< + * + * phi[0] = 1 - 3 * coord[0] + 2 * coordsq[0] - 3 * coord[1] + \ + */ + (__pyx_v_coordsq[__pyx_v_i]) = ((__pyx_v_coord[__pyx_v_i]) * (__pyx_v_coord[__pyx_v_i])); + } + + /* "yt/utilities/lib/element_mappings.pyx":1051 + * coordsq[i] = coord[i] * coord[i] + * + * phi[0] = 1 - 3 * coord[0] + 2 * coordsq[0] - 3 * coord[1] + \ # <<<<<<<<<<<<<< + * 2 * coordsq[1] - 3 * coord[2] + 2 * coordsq[2] + \ + * 4 * coord[0] * coord[1] + 4 * coord[0] * coord[2] + \ + */ + (__pyx_v_phi[0]) = (((((((((1.0 - (3.0 * (__pyx_v_coord[0]))) + (2.0 * (__pyx_v_coordsq[0]))) - (3.0 * (__pyx_v_coord[1]))) + (2.0 * (__pyx_v_coordsq[1]))) - (3.0 * (__pyx_v_coord[2]))) + (2.0 * (__pyx_v_coordsq[2]))) + ((4.0 * (__pyx_v_coord[0])) * (__pyx_v_coord[1]))) + ((4.0 * (__pyx_v_coord[0])) * (__pyx_v_coord[2]))) + ((4.0 * (__pyx_v_coord[1])) * (__pyx_v_coord[2]))); + + /* "yt/utilities/lib/element_mappings.pyx":1055 + * 4 * coord[0] * coord[1] + 4 * coord[0] * coord[2] + \ + * 4 * coord[1] * coord[2] + * phi[1] = -coord[0] + 2 * coordsq[0] # <<<<<<<<<<<<<< + * phi[2] = -coord[1] + 2 * coordsq[1] + * phi[3] = -coord[2] + 2 * coordsq[2] + */ + (__pyx_v_phi[1]) = ((-(__pyx_v_coord[0])) + (2.0 * (__pyx_v_coordsq[0]))); + + /* "yt/utilities/lib/element_mappings.pyx":1056 + * 4 * coord[1] * coord[2] + * phi[1] = -coord[0] + 2 * coordsq[0] + * phi[2] = -coord[1] + 2 * coordsq[1] # <<<<<<<<<<<<<< + * phi[3] = -coord[2] + 2 * coordsq[2] + * phi[4] = 4 * coord[0] - 4 * coordsq[0] - 4 * coord[0] * coord[1] - \ + */ + (__pyx_v_phi[2]) = ((-(__pyx_v_coord[1])) + (2.0 * (__pyx_v_coordsq[1]))); + + /* "yt/utilities/lib/element_mappings.pyx":1057 + * phi[1] = -coord[0] + 2 * coordsq[0] + * phi[2] = -coord[1] + 2 * coordsq[1] + * phi[3] = -coord[2] + 2 * coordsq[2] # <<<<<<<<<<<<<< + * phi[4] = 4 * coord[0] - 4 * coordsq[0] - 4 * coord[0] * coord[1] - \ + * 4 * coord[0] * coord[2] + */ + (__pyx_v_phi[3]) = ((-(__pyx_v_coord[2])) + (2.0 * (__pyx_v_coordsq[2]))); + + /* "yt/utilities/lib/element_mappings.pyx":1058 + * phi[2] = -coord[1] + 2 * coordsq[1] + * phi[3] = -coord[2] + 2 * coordsq[2] + * phi[4] = 4 * coord[0] - 4 * coordsq[0] - 4 * coord[0] * coord[1] - \ # <<<<<<<<<<<<<< + * 4 * coord[0] * coord[2] + * phi[5] = 4 * coord[0] * coord[1] + */ + (__pyx_v_phi[4]) = ((((4.0 * (__pyx_v_coord[0])) - (4.0 * (__pyx_v_coordsq[0]))) - ((4.0 * (__pyx_v_coord[0])) * (__pyx_v_coord[1]))) - ((4.0 * (__pyx_v_coord[0])) * (__pyx_v_coord[2]))); + + /* "yt/utilities/lib/element_mappings.pyx":1060 + * phi[4] = 4 * coord[0] - 4 * coordsq[0] - 4 * coord[0] * coord[1] - \ + * 4 * coord[0] * coord[2] + * phi[5] = 4 * coord[0] * coord[1] # <<<<<<<<<<<<<< + * phi[6] = 4 * coord[1] - 4 * coordsq[1] - 4 * coord[0] * coord[1] - \ + * 4 * coord[1] * coord[2] + */ + (__pyx_v_phi[5]) = ((4.0 * (__pyx_v_coord[0])) * (__pyx_v_coord[1])); + + /* "yt/utilities/lib/element_mappings.pyx":1061 + * 4 * coord[0] * coord[2] + * phi[5] = 4 * coord[0] * coord[1] + * phi[6] = 4 * coord[1] - 4 * coordsq[1] - 4 * coord[0] * coord[1] - \ # <<<<<<<<<<<<<< + * 4 * coord[1] * coord[2] + * phi[7] = 4 * coord[2] - 4 * coordsq[2] - 4 * coord[2] * coord[0] - \ + */ + (__pyx_v_phi[6]) = ((((4.0 * (__pyx_v_coord[1])) - (4.0 * (__pyx_v_coordsq[1]))) - ((4.0 * (__pyx_v_coord[0])) * (__pyx_v_coord[1]))) - ((4.0 * (__pyx_v_coord[1])) * (__pyx_v_coord[2]))); + + /* "yt/utilities/lib/element_mappings.pyx":1063 + * phi[6] = 4 * coord[1] - 4 * coordsq[1] - 4 * coord[0] * coord[1] - \ + * 4 * coord[1] * coord[2] + * phi[7] = 4 * coord[2] - 4 * coordsq[2] - 4 * coord[2] * coord[0] - \ # <<<<<<<<<<<<<< + * 4 * coord[2] * coord[1] + * phi[8] = 4 * coord[0] * coord[2] + */ + (__pyx_v_phi[7]) = ((((4.0 * (__pyx_v_coord[2])) - (4.0 * (__pyx_v_coordsq[2]))) - ((4.0 * (__pyx_v_coord[2])) * (__pyx_v_coord[0]))) - ((4.0 * (__pyx_v_coord[2])) * (__pyx_v_coord[1]))); + + /* "yt/utilities/lib/element_mappings.pyx":1065 + * phi[7] = 4 * coord[2] - 4 * coordsq[2] - 4 * coord[2] * coord[0] - \ + * 4 * coord[2] * coord[1] + * phi[8] = 4 * coord[0] * coord[2] # <<<<<<<<<<<<<< + * phi[9] = 4 * coord[1] * coord[2] + * + */ + (__pyx_v_phi[8]) = ((4.0 * (__pyx_v_coord[0])) * (__pyx_v_coord[2])); + + /* "yt/utilities/lib/element_mappings.pyx":1066 + * 4 * coord[2] * coord[1] + * phi[8] = 4 * coord[0] * coord[2] + * phi[9] = 4 * coord[1] * coord[2] # <<<<<<<<<<<<<< + * + * for i in range(10): + */ + (__pyx_v_phi[9]) = ((4.0 * (__pyx_v_coord[1])) * (__pyx_v_coord[2])); + + /* "yt/utilities/lib/element_mappings.pyx":1068 + * phi[9] = 4 * coord[1] * coord[2] + * + * for i in range(10): # <<<<<<<<<<<<<< + * return_value += phi[i] * vals[i] + * + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 10; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/element_mappings.pyx":1069 + * + * for i in range(10): + * return_value += phi[i] * vals[i] # <<<<<<<<<<<<<< + * + * return return_value + */ + __pyx_v_return_value = (__pyx_v_return_value + ((__pyx_v_phi[__pyx_v_i]) * (__pyx_v_vals[__pyx_v_i]))); + } + + /* "yt/utilities/lib/element_mappings.pyx":1071 + * return_value += phi[i] * vals[i] + * + * return return_value # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = __pyx_v_return_value; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1042 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: # <<<<<<<<<<<<<< + * cdef double[10] phi + * cdef double coordsq[3] + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1076 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for canonical tets, we check whether the mapped_coords are between + * # 0 and 1. + */ + +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_check_inside(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + + /* "yt/utilities/lib/element_mappings.pyx":1079 + * # for canonical tets, we check whether the mapped_coords are between + * # 0 and 1. + * if (mapped_coord[0] < -self.inclusion_tol or \ # <<<<<<<<<<<<<< + * mapped_coord[1] < -self.inclusion_tol or \ + * mapped_coord[2] < -self.inclusion_tol or \ + */ + __pyx_t_2 = (((__pyx_v_mapped_coord[0]) < (-__pyx_v_self->__pyx_base.__pyx_base.inclusion_tol)) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":1080 + * # 0 and 1. + * if (mapped_coord[0] < -self.inclusion_tol or \ + * mapped_coord[1] < -self.inclusion_tol or \ # <<<<<<<<<<<<<< + * mapped_coord[2] < -self.inclusion_tol or \ + * mapped_coord[0] + mapped_coord[1] + mapped_coord[2] - 1.0 > \ + */ + __pyx_t_2 = (((__pyx_v_mapped_coord[1]) < (-__pyx_v_self->__pyx_base.__pyx_base.inclusion_tol)) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":1081 + * if (mapped_coord[0] < -self.inclusion_tol or \ + * mapped_coord[1] < -self.inclusion_tol or \ + * mapped_coord[2] < -self.inclusion_tol or \ # <<<<<<<<<<<<<< + * mapped_coord[0] + mapped_coord[1] + mapped_coord[2] - 1.0 > \ + * self.inclusion_tol): + */ + __pyx_t_2 = (((__pyx_v_mapped_coord[2]) < (-__pyx_v_self->__pyx_base.__pyx_base.inclusion_tol)) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":1082 + * mapped_coord[1] < -self.inclusion_tol or \ + * mapped_coord[2] < -self.inclusion_tol or \ + * mapped_coord[0] + mapped_coord[1] + mapped_coord[2] - 1.0 > \ # <<<<<<<<<<<<<< + * self.inclusion_tol): + * return 0 + */ + __pyx_t_2 = ((((((__pyx_v_mapped_coord[0]) + (__pyx_v_mapped_coord[1])) + (__pyx_v_mapped_coord[2])) - 1.0) > __pyx_v_self->__pyx_base.__pyx_base.inclusion_tol) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + + /* "yt/utilities/lib/element_mappings.pyx":1079 + * # for canonical tets, we check whether the mapped_coords are between + * # 0 and 1. + * if (mapped_coord[0] < -self.inclusion_tol or \ # <<<<<<<<<<<<<< + * mapped_coord[1] < -self.inclusion_tol or \ + * mapped_coord[2] < -self.inclusion_tol or \ + */ + if (__pyx_t_1) { + + /* "yt/utilities/lib/element_mappings.pyx":1084 + * mapped_coord[0] + mapped_coord[1] + mapped_coord[2] - 1.0 > \ + * self.inclusion_tol): + * return 0 # <<<<<<<<<<<<<< + * return 1 + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1079 + * # for canonical tets, we check whether the mapped_coords are between + * # 0 and 1. + * if (mapped_coord[0] < -self.inclusion_tol or \ # <<<<<<<<<<<<<< + * mapped_coord[1] < -self.inclusion_tol or \ + * mapped_coord[2] < -self.inclusion_tol or \ + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":1085 + * self.inclusion_tol): + * return 0 + * return 1 # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1076 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_inside(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * # for canonical tets, we check whether the mapped_coords are between + * # 0 and 1. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1090 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * cdef double u, v + * cdef double thresh = 2.0e-2 + */ + +static int __pyx_f_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_check_mesh_lines(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_v_self, double *__pyx_v_mapped_coord) { + double __pyx_v_u; + double __pyx_v_v; + double __pyx_v_thresh; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + + /* "yt/utilities/lib/element_mappings.pyx":1092 + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: + * cdef double u, v + * cdef double thresh = 2.0e-2 # <<<<<<<<<<<<<< + * if mapped_coord[0] == 0: + * u = mapped_coord[1] + */ + __pyx_v_thresh = 2.0e-2; + + /* "yt/utilities/lib/element_mappings.pyx":1093 + * cdef double u, v + * cdef double thresh = 2.0e-2 + * if mapped_coord[0] == 0: # <<<<<<<<<<<<<< + * u = mapped_coord[1] + * v = mapped_coord[2] + */ + __pyx_t_1 = (((__pyx_v_mapped_coord[0]) == 0.0) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/element_mappings.pyx":1094 + * cdef double thresh = 2.0e-2 + * if mapped_coord[0] == 0: + * u = mapped_coord[1] # <<<<<<<<<<<<<< + * v = mapped_coord[2] + * elif mapped_coord[1] == 0: + */ + __pyx_v_u = (__pyx_v_mapped_coord[1]); + + /* "yt/utilities/lib/element_mappings.pyx":1095 + * if mapped_coord[0] == 0: + * u = mapped_coord[1] + * v = mapped_coord[2] # <<<<<<<<<<<<<< + * elif mapped_coord[1] == 0: + * u = mapped_coord[2] + */ + __pyx_v_v = (__pyx_v_mapped_coord[2]); + + /* "yt/utilities/lib/element_mappings.pyx":1093 + * cdef double u, v + * cdef double thresh = 2.0e-2 + * if mapped_coord[0] == 0: # <<<<<<<<<<<<<< + * u = mapped_coord[1] + * v = mapped_coord[2] + */ + goto __pyx_L3; + } + + /* "yt/utilities/lib/element_mappings.pyx":1096 + * u = mapped_coord[1] + * v = mapped_coord[2] + * elif mapped_coord[1] == 0: # <<<<<<<<<<<<<< + * u = mapped_coord[2] + * v = mapped_coord[0] + */ + __pyx_t_1 = (((__pyx_v_mapped_coord[1]) == 0.0) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/element_mappings.pyx":1097 + * v = mapped_coord[2] + * elif mapped_coord[1] == 0: + * u = mapped_coord[2] # <<<<<<<<<<<<<< + * v = mapped_coord[0] + * elif mapped_coord[2] == 0: + */ + __pyx_v_u = (__pyx_v_mapped_coord[2]); + + /* "yt/utilities/lib/element_mappings.pyx":1098 + * elif mapped_coord[1] == 0: + * u = mapped_coord[2] + * v = mapped_coord[0] # <<<<<<<<<<<<<< + * elif mapped_coord[2] == 0: + * u = mapped_coord[1] + */ + __pyx_v_v = (__pyx_v_mapped_coord[0]); + + /* "yt/utilities/lib/element_mappings.pyx":1096 + * u = mapped_coord[1] + * v = mapped_coord[2] + * elif mapped_coord[1] == 0: # <<<<<<<<<<<<<< + * u = mapped_coord[2] + * v = mapped_coord[0] + */ + goto __pyx_L3; + } + + /* "yt/utilities/lib/element_mappings.pyx":1099 + * u = mapped_coord[2] + * v = mapped_coord[0] + * elif mapped_coord[2] == 0: # <<<<<<<<<<<<<< + * u = mapped_coord[1] + * v = mapped_coord[0] + */ + __pyx_t_1 = (((__pyx_v_mapped_coord[2]) == 0.0) != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/element_mappings.pyx":1100 + * v = mapped_coord[0] + * elif mapped_coord[2] == 0: + * u = mapped_coord[1] # <<<<<<<<<<<<<< + * v = mapped_coord[0] + * else: + */ + __pyx_v_u = (__pyx_v_mapped_coord[1]); + + /* "yt/utilities/lib/element_mappings.pyx":1101 + * elif mapped_coord[2] == 0: + * u = mapped_coord[1] + * v = mapped_coord[0] # <<<<<<<<<<<<<< + * else: + * u = mapped_coord[1] + */ + __pyx_v_v = (__pyx_v_mapped_coord[0]); + + /* "yt/utilities/lib/element_mappings.pyx":1099 + * u = mapped_coord[2] + * v = mapped_coord[0] + * elif mapped_coord[2] == 0: # <<<<<<<<<<<<<< + * u = mapped_coord[1] + * v = mapped_coord[0] + */ + goto __pyx_L3; + } + + /* "yt/utilities/lib/element_mappings.pyx":1103 + * v = mapped_coord[0] + * else: + * u = mapped_coord[1] # <<<<<<<<<<<<<< + * v = mapped_coord[2] + * if ((u < thresh) or + */ + /*else*/ { + __pyx_v_u = (__pyx_v_mapped_coord[1]); + + /* "yt/utilities/lib/element_mappings.pyx":1104 + * else: + * u = mapped_coord[1] + * v = mapped_coord[2] # <<<<<<<<<<<<<< + * if ((u < thresh) or + * (v < thresh) or + */ + __pyx_v_v = (__pyx_v_mapped_coord[2]); + } + __pyx_L3:; + + /* "yt/utilities/lib/element_mappings.pyx":1105 + * u = mapped_coord[1] + * v = mapped_coord[2] + * if ((u < thresh) or # <<<<<<<<<<<<<< + * (v < thresh) or + * (fabs(u - 1) < thresh) or + */ + __pyx_t_2 = ((__pyx_v_u < __pyx_v_thresh) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":1106 + * v = mapped_coord[2] + * if ((u < thresh) or + * (v < thresh) or # <<<<<<<<<<<<<< + * (fabs(u - 1) < thresh) or + * (fabs(v - 1) < thresh)): + */ + __pyx_t_2 = ((__pyx_v_v < __pyx_v_thresh) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":1107 + * if ((u < thresh) or + * (v < thresh) or + * (fabs(u - 1) < thresh) or # <<<<<<<<<<<<<< + * (fabs(v - 1) < thresh)): + * return 1 + */ + __pyx_t_2 = ((fabs((__pyx_v_u - 1.0)) < __pyx_v_thresh) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "yt/utilities/lib/element_mappings.pyx":1108 + * (v < thresh) or + * (fabs(u - 1) < thresh) or + * (fabs(v - 1) < thresh)): # <<<<<<<<<<<<<< + * return 1 + * return -1 + */ + __pyx_t_2 = ((fabs((__pyx_v_v - 1.0)) < __pyx_v_thresh) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L5_bool_binop_done:; + + /* "yt/utilities/lib/element_mappings.pyx":1105 + * u = mapped_coord[1] + * v = mapped_coord[2] + * if ((u < thresh) or # <<<<<<<<<<<<<< + * (v < thresh) or + * (fabs(u - 1) < thresh) or + */ + if (__pyx_t_1) { + + /* "yt/utilities/lib/element_mappings.pyx":1109 + * (fabs(u - 1) < thresh) or + * (fabs(v - 1) < thresh)): + * return 1 # <<<<<<<<<<<<<< + * return -1 + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1105 + * u = mapped_coord[1] + * v = mapped_coord[2] + * if ((u < thresh) or # <<<<<<<<<<<<<< + * (v < thresh) or + * (fabs(u - 1) < thresh) or + */ + } + + /* "yt/utilities/lib/element_mappings.pyx":1110 + * (fabs(v - 1) < thresh)): + * return 1 + * return -1 # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = -1; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1090 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef int check_mesh_lines(self, double* mapped_coord) nogil: # <<<<<<<<<<<<<< + * cdef double u, v + * cdef double thresh = 2.0e-2 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_3__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_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__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.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, 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.func,self.jac 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("yt.utilities.lib.element_mappings.Tet2Sampler3D.__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_5__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_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, 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.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.Tet2Sampler3D.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1115 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_hex_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_1test_hex_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_1test_hex_sampler = {"test_hex_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_1test_hex_sampler, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_1test_hex_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vertices = 0; + PyArrayObject *__pyx_v_field_values = 0; + PyArrayObject *__pyx_v_physical_x = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("test_hex_sampler (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_hex_sampler", 1, 3, 3, 1); __PYX_ERR(0, 1115, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_hex_sampler", 1, 3, 3, 2); __PYX_ERR(0, 1115, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_hex_sampler") < 0)) __PYX_ERR(0, 1115, __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_vertices = ((PyArrayObject *)values[0]); + __pyx_v_field_values = ((PyArrayObject *)values[1]); + __pyx_v_physical_x = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("test_hex_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1115, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_hex_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 1115, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 1116, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 1117, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_test_hex_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_test_hex_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { + double __pyx_v_val; + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_sampler = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; + __Pyx_Buffer __pyx_pybuffer_field_values; + __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; + __Pyx_Buffer __pyx_pybuffer_physical_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_vertices; + __Pyx_Buffer __pyx_pybuffer_vertices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("test_hex_sampler", 0); + __pyx_pybuffer_vertices.pybuffer.buf = NULL; + __pyx_pybuffer_vertices.refcount = 0; + __pyx_pybuffernd_vertices.data = NULL; + __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; + __pyx_pybuffer_field_values.pybuffer.buf = NULL; + __pyx_pybuffer_field_values.refcount = 0; + __pyx_pybuffernd_field_values.data = NULL; + __pyx_pybuffernd_field_values.rcbuffer = &__pyx_pybuffer_field_values; + __pyx_pybuffer_physical_x.pybuffer.buf = NULL; + __pyx_pybuffer_physical_x.refcount = 0; + __pyx_pybuffernd_physical_x.data = NULL; + __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1115, __pyx_L1_error) + } + __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1115, __pyx_L1_error) + } + __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1115, __pyx_L1_error) + } + __pyx_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; + + /* "yt/utilities/lib/element_mappings.pyx":1121 + * cdef double val + * + * cdef Q1Sampler3D sampler = Q1Sampler3D() # <<<<<<<<<<<<<< + * + * val = sampler.sample_at_real_point( vertices.data, + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":1123 + * cdef Q1Sampler3D sampler = Q1Sampler3D() + * + * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< + * field_values.data, + * physical_x.data) + */ + __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *)__pyx_v_sampler->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + + /* "yt/utilities/lib/element_mappings.pyx":1126 + * field_values.data, + * physical_x.data) + * return val # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1115 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_hex_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_hex_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sampler); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1132 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_hex20_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_3test_hex20_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_3test_hex20_sampler = {"test_hex20_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_3test_hex20_sampler, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_3test_hex20_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vertices = 0; + PyArrayObject *__pyx_v_field_values = 0; + PyArrayObject *__pyx_v_physical_x = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("test_hex20_sampler (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_hex20_sampler", 1, 3, 3, 1); __PYX_ERR(0, 1132, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_hex20_sampler", 1, 3, 3, 2); __PYX_ERR(0, 1132, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_hex20_sampler") < 0)) __PYX_ERR(0, 1132, __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_vertices = ((PyArrayObject *)values[0]); + __pyx_v_field_values = ((PyArrayObject *)values[1]); + __pyx_v_physical_x = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("test_hex20_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1132, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_hex20_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 1132, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 1133, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 1134, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_2test_hex20_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_2test_hex20_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { + double __pyx_v_val; + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_sampler = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; + __Pyx_Buffer __pyx_pybuffer_field_values; + __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; + __Pyx_Buffer __pyx_pybuffer_physical_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_vertices; + __Pyx_Buffer __pyx_pybuffer_vertices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("test_hex20_sampler", 0); + __pyx_pybuffer_vertices.pybuffer.buf = NULL; + __pyx_pybuffer_vertices.refcount = 0; + __pyx_pybuffernd_vertices.data = NULL; + __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; + __pyx_pybuffer_field_values.pybuffer.buf = NULL; + __pyx_pybuffer_field_values.refcount = 0; + __pyx_pybuffernd_field_values.data = NULL; + __pyx_pybuffernd_field_values.rcbuffer = &__pyx_pybuffer_field_values; + __pyx_pybuffer_physical_x.pybuffer.buf = NULL; + __pyx_pybuffer_physical_x.refcount = 0; + __pyx_pybuffernd_physical_x.data = NULL; + __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1132, __pyx_L1_error) + } + __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1132, __pyx_L1_error) + } + __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1132, __pyx_L1_error) + } + __pyx_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; + + /* "yt/utilities/lib/element_mappings.pyx":1138 + * cdef double val + * + * cdef S2Sampler3D sampler = S2Sampler3D() # <<<<<<<<<<<<<< + * + * val = sampler.sample_at_real_point( vertices.data, + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":1140 + * cdef S2Sampler3D sampler = S2Sampler3D() + * + * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< + * field_values.data, + * physical_x.data) + */ + __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *)__pyx_v_sampler->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + + /* "yt/utilities/lib/element_mappings.pyx":1143 + * field_values.data, + * physical_x.data) + * return val # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1132 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_hex20_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_hex20_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sampler); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1149 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_tetra_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_5test_tetra_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_5test_tetra_sampler = {"test_tetra_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_5test_tetra_sampler, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_5test_tetra_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vertices = 0; + PyArrayObject *__pyx_v_field_values = 0; + PyArrayObject *__pyx_v_physical_x = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("test_tetra_sampler (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_tetra_sampler", 1, 3, 3, 1); __PYX_ERR(0, 1149, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_tetra_sampler", 1, 3, 3, 2); __PYX_ERR(0, 1149, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_tetra_sampler") < 0)) __PYX_ERR(0, 1149, __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_vertices = ((PyArrayObject *)values[0]); + __pyx_v_field_values = ((PyArrayObject *)values[1]); + __pyx_v_physical_x = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("test_tetra_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1149, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_tetra_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 1149, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 1150, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 1151, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_4test_tetra_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_4test_tetra_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { + double __pyx_v_val; + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_sampler = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; + __Pyx_Buffer __pyx_pybuffer_field_values; + __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; + __Pyx_Buffer __pyx_pybuffer_physical_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_vertices; + __Pyx_Buffer __pyx_pybuffer_vertices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("test_tetra_sampler", 0); + __pyx_pybuffer_vertices.pybuffer.buf = NULL; + __pyx_pybuffer_vertices.refcount = 0; + __pyx_pybuffernd_vertices.data = NULL; + __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; + __pyx_pybuffer_field_values.pybuffer.buf = NULL; + __pyx_pybuffer_field_values.refcount = 0; + __pyx_pybuffernd_field_values.data = NULL; + __pyx_pybuffernd_field_values.rcbuffer = &__pyx_pybuffer_field_values; + __pyx_pybuffer_physical_x.pybuffer.buf = NULL; + __pyx_pybuffer_physical_x.refcount = 0; + __pyx_pybuffernd_physical_x.data = NULL; + __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1149, __pyx_L1_error) + } + __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1149, __pyx_L1_error) + } + __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1149, __pyx_L1_error) + } + __pyx_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; + + /* "yt/utilities/lib/element_mappings.pyx":1155 + * cdef double val + * + * sampler = P1Sampler3D() # <<<<<<<<<<<<<< + * + * val = sampler.sample_at_real_point( vertices.data, + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":1157 + * sampler = P1Sampler3D() + * + * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< + * field_values.data, + * physical_x.data) + */ + __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *)__pyx_v_sampler->__pyx_base.__pyx_vtab)->__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + + /* "yt/utilities/lib/element_mappings.pyx":1161 + * physical_x.data) + * + * return val # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1149 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_tetra_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_tetra_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sampler); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1167 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_wedge_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_7test_wedge_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_7test_wedge_sampler = {"test_wedge_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_7test_wedge_sampler, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_7test_wedge_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vertices = 0; + PyArrayObject *__pyx_v_field_values = 0; + PyArrayObject *__pyx_v_physical_x = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("test_wedge_sampler (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_wedge_sampler", 1, 3, 3, 1); __PYX_ERR(0, 1167, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_wedge_sampler", 1, 3, 3, 2); __PYX_ERR(0, 1167, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_wedge_sampler") < 0)) __PYX_ERR(0, 1167, __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_vertices = ((PyArrayObject *)values[0]); + __pyx_v_field_values = ((PyArrayObject *)values[1]); + __pyx_v_physical_x = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("test_wedge_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1167, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_wedge_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 1167, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 1168, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 1169, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_6test_wedge_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_6test_wedge_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { + double __pyx_v_val; + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_sampler = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; + __Pyx_Buffer __pyx_pybuffer_field_values; + __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; + __Pyx_Buffer __pyx_pybuffer_physical_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_vertices; + __Pyx_Buffer __pyx_pybuffer_vertices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("test_wedge_sampler", 0); + __pyx_pybuffer_vertices.pybuffer.buf = NULL; + __pyx_pybuffer_vertices.refcount = 0; + __pyx_pybuffernd_vertices.data = NULL; + __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; + __pyx_pybuffer_field_values.pybuffer.buf = NULL; + __pyx_pybuffer_field_values.refcount = 0; + __pyx_pybuffernd_field_values.data = NULL; + __pyx_pybuffernd_field_values.rcbuffer = &__pyx_pybuffer_field_values; + __pyx_pybuffer_physical_x.pybuffer.buf = NULL; + __pyx_pybuffer_physical_x.refcount = 0; + __pyx_pybuffernd_physical_x.data = NULL; + __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1167, __pyx_L1_error) + } + __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1167, __pyx_L1_error) + } + __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1167, __pyx_L1_error) + } + __pyx_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; + + /* "yt/utilities/lib/element_mappings.pyx":1173 + * cdef double val + * + * cdef W1Sampler3D sampler = W1Sampler3D() # <<<<<<<<<<<<<< + * + * val = sampler.sample_at_real_point( vertices.data, + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":1175 + * cdef W1Sampler3D sampler = W1Sampler3D() + * + * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< + * field_values.data, + * physical_x.data) + */ + __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *)__pyx_v_sampler->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + + /* "yt/utilities/lib/element_mappings.pyx":1178 + * field_values.data, + * physical_x.data) + * return val # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1167 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_wedge_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_wedge_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sampler); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1184 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_linear1D_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_9test_linear1D_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_9test_linear1D_sampler = {"test_linear1D_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_9test_linear1D_sampler, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_9test_linear1D_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vertices = 0; + PyArrayObject *__pyx_v_field_values = 0; + PyArrayObject *__pyx_v_physical_x = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("test_linear1D_sampler (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_linear1D_sampler", 1, 3, 3, 1); __PYX_ERR(0, 1184, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_linear1D_sampler", 1, 3, 3, 2); __PYX_ERR(0, 1184, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_linear1D_sampler") < 0)) __PYX_ERR(0, 1184, __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_vertices = ((PyArrayObject *)values[0]); + __pyx_v_field_values = ((PyArrayObject *)values[1]); + __pyx_v_physical_x = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("test_linear1D_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1184, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_linear1D_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 1184, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 1185, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 1186, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_8test_linear1D_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_8test_linear1D_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { + double __pyx_v_val; + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_v_sampler = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; + __Pyx_Buffer __pyx_pybuffer_field_values; + __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; + __Pyx_Buffer __pyx_pybuffer_physical_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_vertices; + __Pyx_Buffer __pyx_pybuffer_vertices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("test_linear1D_sampler", 0); + __pyx_pybuffer_vertices.pybuffer.buf = NULL; + __pyx_pybuffer_vertices.refcount = 0; + __pyx_pybuffernd_vertices.data = NULL; + __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; + __pyx_pybuffer_field_values.pybuffer.buf = NULL; + __pyx_pybuffer_field_values.refcount = 0; + __pyx_pybuffernd_field_values.data = NULL; + __pyx_pybuffernd_field_values.rcbuffer = &__pyx_pybuffer_field_values; + __pyx_pybuffer_physical_x.pybuffer.buf = NULL; + __pyx_pybuffer_physical_x.refcount = 0; + __pyx_pybuffernd_physical_x.data = NULL; + __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1184, __pyx_L1_error) + } + __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1184, __pyx_L1_error) + } + __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1184, __pyx_L1_error) + } + __pyx_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; + + /* "yt/utilities/lib/element_mappings.pyx":1190 + * cdef double val + * + * sampler = P1Sampler1D() # <<<<<<<<<<<<<< + * + * val = sampler.sample_at_real_point( vertices.data, + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":1192 + * sampler = P1Sampler1D() + * + * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< + * field_values.data, + * physical_x.data) + */ + __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *)__pyx_v_sampler->__pyx_base.__pyx_vtab)->__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + + /* "yt/utilities/lib/element_mappings.pyx":1196 + * physical_x.data) + * + * return val # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1196, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1184 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_linear1D_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_linear1D_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sampler); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1202 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_tri_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11test_tri_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_11test_tri_sampler = {"test_tri_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11test_tri_sampler, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11test_tri_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vertices = 0; + PyArrayObject *__pyx_v_field_values = 0; + PyArrayObject *__pyx_v_physical_x = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("test_tri_sampler (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_tri_sampler", 1, 3, 3, 1); __PYX_ERR(0, 1202, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_tri_sampler", 1, 3, 3, 2); __PYX_ERR(0, 1202, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_tri_sampler") < 0)) __PYX_ERR(0, 1202, __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_vertices = ((PyArrayObject *)values[0]); + __pyx_v_field_values = ((PyArrayObject *)values[1]); + __pyx_v_physical_x = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("test_tri_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1202, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_tri_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 1202, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 1203, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 1204, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_10test_tri_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_10test_tri_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { + double __pyx_v_val; + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_sampler = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; + __Pyx_Buffer __pyx_pybuffer_field_values; + __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; + __Pyx_Buffer __pyx_pybuffer_physical_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_vertices; + __Pyx_Buffer __pyx_pybuffer_vertices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("test_tri_sampler", 0); + __pyx_pybuffer_vertices.pybuffer.buf = NULL; + __pyx_pybuffer_vertices.refcount = 0; + __pyx_pybuffernd_vertices.data = NULL; + __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; + __pyx_pybuffer_field_values.pybuffer.buf = NULL; + __pyx_pybuffer_field_values.refcount = 0; + __pyx_pybuffernd_field_values.data = NULL; + __pyx_pybuffernd_field_values.rcbuffer = &__pyx_pybuffer_field_values; + __pyx_pybuffer_physical_x.pybuffer.buf = NULL; + __pyx_pybuffer_physical_x.refcount = 0; + __pyx_pybuffernd_physical_x.data = NULL; + __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1202, __pyx_L1_error) + } + __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1202, __pyx_L1_error) + } + __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1202, __pyx_L1_error) + } + __pyx_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; + + /* "yt/utilities/lib/element_mappings.pyx":1208 + * cdef double val + * + * sampler = P1Sampler2D() # <<<<<<<<<<<<<< + * + * val = sampler.sample_at_real_point( vertices.data, + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":1210 + * sampler = P1Sampler2D() + * + * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< + * field_values.data, + * physical_x.data) + */ + __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *)__pyx_v_sampler->__pyx_base.__pyx_vtab)->__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + + /* "yt/utilities/lib/element_mappings.pyx":1214 + * physical_x.data) + * + * return val # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1202 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_tri_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_tri_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sampler); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1220 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_quad_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_13test_quad_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_13test_quad_sampler = {"test_quad_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_13test_quad_sampler, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_13test_quad_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vertices = 0; + PyArrayObject *__pyx_v_field_values = 0; + PyArrayObject *__pyx_v_physical_x = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("test_quad_sampler (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_quad_sampler", 1, 3, 3, 1); __PYX_ERR(0, 1220, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_quad_sampler", 1, 3, 3, 2); __PYX_ERR(0, 1220, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_quad_sampler") < 0)) __PYX_ERR(0, 1220, __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_vertices = ((PyArrayObject *)values[0]); + __pyx_v_field_values = ((PyArrayObject *)values[1]); + __pyx_v_physical_x = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("test_quad_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1220, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_quad_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 1220, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 1221, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 1222, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_12test_quad_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_12test_quad_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { + double __pyx_v_val; + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_sampler = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; + __Pyx_Buffer __pyx_pybuffer_field_values; + __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; + __Pyx_Buffer __pyx_pybuffer_physical_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_vertices; + __Pyx_Buffer __pyx_pybuffer_vertices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("test_quad_sampler", 0); + __pyx_pybuffer_vertices.pybuffer.buf = NULL; + __pyx_pybuffer_vertices.refcount = 0; + __pyx_pybuffernd_vertices.data = NULL; + __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; + __pyx_pybuffer_field_values.pybuffer.buf = NULL; + __pyx_pybuffer_field_values.refcount = 0; + __pyx_pybuffernd_field_values.data = NULL; + __pyx_pybuffernd_field_values.rcbuffer = &__pyx_pybuffer_field_values; + __pyx_pybuffer_physical_x.pybuffer.buf = NULL; + __pyx_pybuffer_physical_x.refcount = 0; + __pyx_pybuffernd_physical_x.data = NULL; + __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1220, __pyx_L1_error) + } + __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1220, __pyx_L1_error) + } + __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1220, __pyx_L1_error) + } + __pyx_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; + + /* "yt/utilities/lib/element_mappings.pyx":1226 + * cdef double val + * + * sampler = Q1Sampler2D() # <<<<<<<<<<<<<< + * + * val = sampler.sample_at_real_point( vertices.data, + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":1228 + * sampler = Q1Sampler2D() + * + * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< + * field_values.data, + * physical_x.data) + */ + __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *)__pyx_v_sampler->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + + /* "yt/utilities/lib/element_mappings.pyx":1232 + * physical_x.data) + * + * return val # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/element_mappings.pyx":1220 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_quad_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_quad_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sampler); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/element_mappings.pyx":1237 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_quad2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_15test_quad2_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_15test_quad2_sampler = {"test_quad2_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_15test_quad2_sampler, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_15test_quad2_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vertices = 0; + PyArrayObject *__pyx_v_field_values = 0; + PyArrayObject *__pyx_v_physical_x = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("test_quad2_sampler (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_quad2_sampler", 1, 3, 3, 1); __PYX_ERR(0, 1237, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("test_quad2_sampler", 1, 3, 3, 2); __PYX_ERR(0, 1237, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_quad2_sampler") < 0)) __PYX_ERR(0, 1237, __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_vertices = ((PyArrayObject *)values[0]); + __pyx_v_field_values = ((PyArrayObject *)values[1]); + __pyx_v_physical_x = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("test_quad2_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1237, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_quad2_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 1237, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 1238, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 1239, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_14test_quad2_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_14test_quad2_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { + double __pyx_v_val; + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__pyx_v_sampler = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; + __Pyx_Buffer __pyx_pybuffer_field_values; + __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; + __Pyx_Buffer __pyx_pybuffer_physical_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_vertices; + __Pyx_Buffer __pyx_pybuffer_vertices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("test_quad2_sampler", 0); + __pyx_pybuffer_vertices.pybuffer.buf = NULL; + __pyx_pybuffer_vertices.refcount = 0; + __pyx_pybuffernd_vertices.data = NULL; + __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; + __pyx_pybuffer_field_values.pybuffer.buf = NULL; + __pyx_pybuffer_field_values.refcount = 0; + __pyx_pybuffernd_field_values.data = NULL; + __pyx_pybuffernd_field_values.rcbuffer = &__pyx_pybuffer_field_values; + __pyx_pybuffer_physical_x.pybuffer.buf = NULL; + __pyx_pybuffer_physical_x.refcount = 0; + __pyx_pybuffernd_physical_x.data = NULL; + __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1237, __pyx_L1_error) + } + __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1237, __pyx_L1_error) + } + __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1237, __pyx_L1_error) + } + __pyx_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/element_mappings.pyx":928 - * rm = 1.0 - x[0] - * rp = 1.0 + x[0] - * sm = 1.0 - x[1] # <<<<<<<<<<<<<< - * sp = 1.0 + x[1] + /* "yt/utilities/lib/element_mappings.pyx":1243 + * cdef double val * - */ - __pyx_v_sm = (1.0 - (__pyx_v_x[1])); - - /* "yt/utilities/lib/element_mappings.pyx":929 - * rp = 1.0 + x[0] - * sm = 1.0 - x[1] - * sp = 1.0 + x[1] # <<<<<<<<<<<<<< + * sampler = Q2Sampler2D() # <<<<<<<<<<<<<< * - * for i in range(2): + * val = sampler.sample_at_real_point( vertices.data, */ - __pyx_v_sp = (1.0 + (__pyx_v_x[1])); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *)__pyx_t_1); + __pyx_t_1 = 0; - /* "yt/utilities/lib/element_mappings.pyx":931 - * sp = 1.0 + x[1] + /* "yt/utilities/lib/element_mappings.pyx":1245 + * sampler = Q2Sampler2D() * - * for i in range(2): # <<<<<<<<<<<<<< - * fx[i] = vertices[0 + i]*rm*sm \ - * + vertices[2 + i]*rp*sm \ + * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< + * field_values.data, + * physical_x.data) */ - for (__pyx_t_1 = 0; __pyx_t_1 < 2; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *)__pyx_v_sampler->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); - /* "yt/utilities/lib/element_mappings.pyx":932 + /* "yt/utilities/lib/element_mappings.pyx":1249 + * physical_x.data) + * + * return val # <<<<<<<<<<<<<< * - * for i in range(2): - * fx[i] = vertices[0 + i]*rm*sm \ # <<<<<<<<<<<<<< - * + vertices[2 + i]*rp*sm \ - * + vertices[4 + i]*rp*sp \ + * @cython.boundscheck(False) */ - (__pyx_v_fx[__pyx_v_i]) = (((((((__pyx_v_vertices[(0 + __pyx_v_i)]) * __pyx_v_rm) * __pyx_v_sm) + (((__pyx_v_vertices[(2 + __pyx_v_i)]) * __pyx_v_rp) * __pyx_v_sm)) + (((__pyx_v_vertices[(4 + __pyx_v_i)]) * __pyx_v_rp) * __pyx_v_sp)) + (((__pyx_v_vertices[(6 + __pyx_v_i)]) * __pyx_v_rm) * __pyx_v_sp)) - (4.0 * (__pyx_v_phys_x[__pyx_v_i]))); - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":919 + /* "yt/utilities/lib/element_mappings.pyx":1237 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef inline void Q1Function2D(double* fx, # <<<<<<<<<<<<<< - * double* x, - * double* vertices, + * def test_quad2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_quad2_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sampler); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":942 +/* "yt/utilities/lib/element_mappings.pyx":1254 * @cython.wraparound(False) * @cython.cdivision(True) - * def test_hex_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): + * def test_tri2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_1test_hex_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_1test_hex_sampler = {"test_hex_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_1test_hex_sampler, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_1test_hex_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_17test_tri2_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_17test_tri2_sampler = {"test_tri2_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_17test_tri2_sampler, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_17test_tri2_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_vertices = 0; PyArrayObject *__pyx_v_field_values = 0; PyArrayObject *__pyx_v_physical_x = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("test_hex_sampler (wrapper)", 0); + __Pyx_RefNannySetupContext("test_tri2_sampler (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,0}; PyObject* values[3] = {0,0,0}; @@ -6675,8 +12255,11 @@ 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; } @@ -6685,19 +12268,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_hex_sampler", 1, 3, 3, 1); __PYX_ERR(0, 942, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("test_tri2_sampler", 1, 3, 3, 1); __PYX_ERR(0, 1254, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_hex_sampler", 1, 3, 3, 2); __PYX_ERR(0, 942, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("test_tri2_sampler", 1, 3, 3, 2); __PYX_ERR(0, 1254, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_hex_sampler") < 0)) __PYX_ERR(0, 942, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_tri2_sampler") < 0)) __PYX_ERR(0, 1254, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -6712,16 +12297,16 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("test_hex_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 942, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("test_tri2_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1254, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_hex_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_tri2_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 942, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 943, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 944, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_test_hex_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 1254, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 1255, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 1256, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_16test_tri2_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); /* function exit code */ goto __pyx_L0; @@ -6732,9 +12317,9 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_test_hex_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_16test_tri2_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { double __pyx_v_val; - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_v_sampler = 0; + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__pyx_v_sampler = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; __Pyx_Buffer __pyx_pybuffer_field_values; __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; @@ -6744,7 +12329,7 @@ PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("test_hex_sampler", 0); + __Pyx_RefNannySetupContext("test_tri2_sampler", 0); __pyx_pybuffer_vertices.pybuffer.buf = NULL; __pyx_pybuffer_vertices.refcount = 0; __pyx_pybuffernd_vertices.data = NULL; @@ -6759,61 +12344,61 @@ __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 942, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1254, __pyx_L1_error) } __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 942, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1254, __pyx_L1_error) } __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 942, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1254, __pyx_L1_error) } __pyx_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/element_mappings.pyx":948 + /* "yt/utilities/lib/element_mappings.pyx":1260 * cdef double val * - * cdef Q1Sampler3D sampler = Q1Sampler3D() # <<<<<<<<<<<<<< + * sampler = T2Sampler2D() # <<<<<<<<<<<<<< * * val = sampler.sample_at_real_point( vertices.data, */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *)__pyx_t_1); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/element_mappings.pyx":950 - * cdef Q1Sampler3D sampler = Q1Sampler3D() + /* "yt/utilities/lib/element_mappings.pyx":1262 + * sampler = T2Sampler2D() * * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< * field_values.data, * physical_x.data) */ - __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *)__pyx_v_sampler->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *)__pyx_v_sampler->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); - /* "yt/utilities/lib/element_mappings.pyx":953 - * field_values.data, + /* "yt/utilities/lib/element_mappings.pyx":1266 * physical_x.data) - * return val # <<<<<<<<<<<<<< * + * return val # <<<<<<<<<<<<<< * + * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":942 + /* "yt/utilities/lib/element_mappings.pyx":1254 * @cython.wraparound(False) * @cython.cdivision(True) - * def test_hex_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): + * def test_tri2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): */ /* function exit code */ @@ -6827,7 +12412,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_hex_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_tri2_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -6841,24 +12426,24 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":959 +/* "yt/utilities/lib/element_mappings.pyx":1271 * @cython.wraparound(False) * @cython.cdivision(True) - * def test_hex20_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): + * def test_tet2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_3test_hex20_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_3test_hex20_sampler = {"test_hex20_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_3test_hex20_sampler, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_3test_hex20_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_19test_tet2_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_19test_tet2_sampler = {"test_tet2_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_19test_tet2_sampler, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_19test_tet2_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_vertices = 0; PyArrayObject *__pyx_v_field_values = 0; PyArrayObject *__pyx_v_physical_x = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("test_hex20_sampler (wrapper)", 0); + __Pyx_RefNannySetupContext("test_tet2_sampler (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,0}; PyObject* values[3] = {0,0,0}; @@ -6867,8 +12452,11 @@ 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; } @@ -6877,19 +12465,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_hex20_sampler", 1, 3, 3, 1); __PYX_ERR(0, 959, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("test_tet2_sampler", 1, 3, 3, 1); __PYX_ERR(0, 1271, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_hex20_sampler", 1, 3, 3, 2); __PYX_ERR(0, 959, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("test_tet2_sampler", 1, 3, 3, 2); __PYX_ERR(0, 1271, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_hex20_sampler") < 0)) __PYX_ERR(0, 959, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_tet2_sampler") < 0)) __PYX_ERR(0, 1271, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -6904,16 +12494,16 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("test_hex20_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 959, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("test_tet2_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1271, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_hex20_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_tet2_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 959, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 960, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 961, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_2test_hex20_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 1271, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 1272, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 1273, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_18test_tet2_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); /* function exit code */ goto __pyx_L0; @@ -6924,9 +12514,9 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_2test_hex20_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_18test_tet2_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { double __pyx_v_val; - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_v_sampler = 0; + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_v_sampler = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; __Pyx_Buffer __pyx_pybuffer_field_values; __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; @@ -6936,7 +12526,7 @@ PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("test_hex20_sampler", 0); + __Pyx_RefNannySetupContext("test_tet2_sampler", 0); __pyx_pybuffer_vertices.pybuffer.buf = NULL; __pyx_pybuffer_vertices.refcount = 0; __pyx_pybuffernd_vertices.data = NULL; @@ -6951,61 +12541,59 @@ __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 959, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1271, __pyx_L1_error) } __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 959, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1271, __pyx_L1_error) } __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 959, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1271, __pyx_L1_error) } __pyx_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/element_mappings.pyx":965 + /* "yt/utilities/lib/element_mappings.pyx":1277 * cdef double val * - * cdef S2Sampler3D sampler = S2Sampler3D() # <<<<<<<<<<<<<< + * sampler = Tet2Sampler3D() # <<<<<<<<<<<<<< * * val = sampler.sample_at_real_point( vertices.data, */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *)__pyx_t_1); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/element_mappings.pyx":967 - * cdef S2Sampler3D sampler = S2Sampler3D() + /* "yt/utilities/lib/element_mappings.pyx":1279 + * sampler = Tet2Sampler3D() * * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< * field_values.data, * physical_x.data) */ - __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *)__pyx_v_sampler->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *)__pyx_v_sampler->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); - /* "yt/utilities/lib/element_mappings.pyx":970 - * field_values.data, + /* "yt/utilities/lib/element_mappings.pyx":1283 * physical_x.data) - * return val # <<<<<<<<<<<<<< - * * + * return val # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":959 + /* "yt/utilities/lib/element_mappings.pyx":1271 * @cython.wraparound(False) * @cython.cdivision(True) - * def test_hex20_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): + * def test_tet2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): */ /* function exit code */ @@ -7019,7 +12607,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_hex20_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_tet2_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -7033,55 +12621,58 @@ return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":976 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def test_tetra_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): +/* "(tree fragment)":1 + * def __pyx_unpickle_ElementSampler(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_5test_tetra_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_5test_tetra_sampler = {"test_tetra_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_5test_tetra_sampler, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_5test_tetra_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_vertices = 0; - PyArrayObject *__pyx_v_field_values = 0; - PyArrayObject *__pyx_v_physical_x = 0; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_21__pyx_unpickle_ElementSampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_21__pyx_unpickle_ElementSampler = {"__pyx_unpickle_ElementSampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_21__pyx_unpickle_ElementSampler, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_21__pyx_unpickle_ElementSampler(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("test_tetra_sampler (wrapper)", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_ElementSampler (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_tetra_sampler", 1, 3, 3, 1); __PYX_ERR(0, 976, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ElementSampler", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_tetra_sampler", 1, 3, 3, 2); __PYX_ERR(0, 976, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ElementSampler", 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, "test_tetra_sampler") < 0)) __PYX_ERR(0, 976, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_ElementSampler") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -7090,190 +12681,470 @@ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_vertices = ((PyArrayObject *)values[0]); - __pyx_v_field_values = ((PyArrayObject *)values[1]); - __pyx_v_physical_x = ((PyArrayObject *)values[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("test_tetra_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 976, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ElementSampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_tetra_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.__pyx_unpickle_ElementSampler", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 976, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 977, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 978, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_4test_tetra_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_20__pyx_unpickle_ElementSampler(__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_2yt_9utilities_3lib_16element_mappings_20__pyx_unpickle_ElementSampler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_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_ElementSampler", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_ElementSampler(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xa37a4b3: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xa37a4b3) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_ElementSampler(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = ElementSampler.__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_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 != 0xa37a4b3: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = ElementSampler.__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_0xa3, __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_PickleError); + __pyx_t_2 = __pyx_v_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_ElementSampler(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xa37a4b3: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = ElementSampler.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_ElementSampler__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler), __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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = ElementSampler.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_ElementSampler__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = ElementSampler.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_ElementSampler__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_ElementSampler__set_state(ElementSampler 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_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_ElementSampler__set_state(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_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 PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = ElementSampler.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_ElementSampler__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_ElementSampler__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_ElementSampler__set_state(ElementSampler result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_ElementSampler(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xa37a4b3: + * from pickle import 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("yt.utilities.lib.element_mappings.__pyx_unpickle_ElementSampler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_4test_tetra_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { - double __pyx_v_val; - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_sampler = NULL; - __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; - __Pyx_Buffer __pyx_pybuffer_field_values; - __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; - __Pyx_Buffer __pyx_pybuffer_physical_x; - __Pyx_LocalBuf_ND __pyx_pybuffernd_vertices; - __Pyx_Buffer __pyx_pybuffer_vertices; +/* "(tree fragment)":9 + * __pyx_unpickle_ElementSampler__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_ElementSampler__set_state(ElementSampler result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_f_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_ElementSampler__set_state(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("test_tetra_sampler", 0); - __pyx_pybuffer_vertices.pybuffer.buf = NULL; - __pyx_pybuffer_vertices.refcount = 0; - __pyx_pybuffernd_vertices.data = NULL; - __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; - __pyx_pybuffer_field_values.pybuffer.buf = NULL; - __pyx_pybuffer_field_values.refcount = 0; - __pyx_pybuffernd_field_values.data = NULL; - __pyx_pybuffernd_field_values.rcbuffer = &__pyx_pybuffer_field_values; - __pyx_pybuffer_physical_x.pybuffer.buf = NULL; - __pyx_pybuffer_physical_x.refcount = 0; - __pyx_pybuffernd_physical_x.data = NULL; - __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 976, __pyx_L1_error) - } - __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 976, __pyx_L1_error) - } - __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 976, __pyx_L1_error) - } - __pyx_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; + __pyx_t_5numpy_float64_t __pyx_t_2; + int __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_ElementSampler__set_state", 0); - /* "yt/utilities/lib/element_mappings.pyx":982 - * cdef double val - * - * sampler = P1Sampler3D() # <<<<<<<<<<<<<< - * - * val = sampler.sample_at_real_point( vertices.data, - */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error) + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_ElementSampler__set_state(ElementSampler result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[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_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(1, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->inclusion_tol = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->num_mapped_coords = __pyx_t_3; - /* "yt/utilities/lib/element_mappings.pyx":984 - * sampler = P1Sampler3D() - * - * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< - * field_values.data, - * physical_x.data) - */ - __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *)__pyx_v_sampler->__pyx_base.__pyx_vtab)->__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + /* "(tree fragment)":11 + * cdef __pyx_unpickle_ElementSampler__set_state(ElementSampler result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[2]) + */ + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":12 + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_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, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); 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; - /* "yt/utilities/lib/element_mappings.pyx":988 - * physical_x.data) - * - * return val # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":11 + * cdef __pyx_unpickle_ElementSampler__set_state(ElementSampler result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[2]) */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + } - /* "yt/utilities/lib/element_mappings.pyx":976 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def test_tetra_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): + /* "(tree fragment)":9 + * __pyx_unpickle_ElementSampler__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_ElementSampler__set_state(ElementSampler result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_tetra_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.__pyx_unpickle_ElementSampler__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_sampler); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":994 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def test_wedge_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): +/* "(tree fragment)":1 + * def __pyx_unpickle_P1Sampler1D(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_7test_wedge_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_7test_wedge_sampler = {"test_wedge_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_7test_wedge_sampler, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_7test_wedge_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_vertices = 0; - PyArrayObject *__pyx_v_field_values = 0; - PyArrayObject *__pyx_v_physical_x = 0; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_23__pyx_unpickle_P1Sampler1D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_23__pyx_unpickle_P1Sampler1D = {"__pyx_unpickle_P1Sampler1D", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_23__pyx_unpickle_P1Sampler1D, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_23__pyx_unpickle_P1Sampler1D(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("test_wedge_sampler (wrapper)", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_P1Sampler1D (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_wedge_sampler", 1, 3, 3, 1); __PYX_ERR(0, 994, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_P1Sampler1D", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_wedge_sampler", 1, 3, 3, 2); __PYX_ERR(0, 994, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_P1Sampler1D", 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, "test_wedge_sampler") < 0)) __PYX_ERR(0, 994, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_P1Sampler1D") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -7282,190 +13153,470 @@ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_vertices = ((PyArrayObject *)values[0]); - __pyx_v_field_values = ((PyArrayObject *)values[1]); - __pyx_v_physical_x = ((PyArrayObject *)values[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("test_wedge_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 994, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_P1Sampler1D", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_wedge_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.__pyx_unpickle_P1Sampler1D", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 994, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 995, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 996, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_6test_wedge_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_22__pyx_unpickle_P1Sampler1D(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_6test_wedge_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { - double __pyx_v_val; - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_v_sampler = 0; - __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; - __Pyx_Buffer __pyx_pybuffer_field_values; - __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; - __Pyx_Buffer __pyx_pybuffer_physical_x; - __Pyx_LocalBuf_ND __pyx_pybuffernd_vertices; - __Pyx_Buffer __pyx_pybuffer_vertices; +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_22__pyx_unpickle_P1Sampler1D(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("test_wedge_sampler", 0); - __pyx_pybuffer_vertices.pybuffer.buf = NULL; - __pyx_pybuffer_vertices.refcount = 0; - __pyx_pybuffernd_vertices.data = NULL; - __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; - __pyx_pybuffer_field_values.pybuffer.buf = NULL; - __pyx_pybuffer_field_values.refcount = 0; - __pyx_pybuffernd_field_values.data = NULL; - __pyx_pybuffernd_field_values.rcbuffer = &__pyx_pybuffer_field_values; - __pyx_pybuffer_physical_x.pybuffer.buf = NULL; - __pyx_pybuffer_physical_x.refcount = 0; - __pyx_pybuffernd_physical_x.data = NULL; - __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 994, __pyx_L1_error) + 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_P1Sampler1D", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_P1Sampler1D(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xa37a4b3: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xa37a4b3) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_P1Sampler1D(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = P1Sampler1D.__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_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 != 0xa37a4b3: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = P1Sampler1D.__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_0xa3, __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_PickleError); + __pyx_t_2 = __pyx_v_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_P1Sampler1D(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xa37a4b3: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + */ } - __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 994, __pyx_L1_error) + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = P1Sampler1D.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_P1Sampler1D__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D), __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); + } } - __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 994, __pyx_L1_error) + 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_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "yt/utilities/lib/element_mappings.pyx":1000 - * cdef double val - * - * cdef W1Sampler3D sampler = W1Sampler3D() # <<<<<<<<<<<<<< - * - * val = sampler.sample_at_real_point( vertices.data, + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = P1Sampler1D.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_P1Sampler1D__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = P1Sampler1D.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_P1Sampler1D__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_P1Sampler1D__set_state(P1Sampler1D result, tuple __pyx_state): */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *)__pyx_t_1); - __pyx_t_1 = 0; + 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_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_P1Sampler1D__set_state(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *)__pyx_v_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; - /* "yt/utilities/lib/element_mappings.pyx":1002 - * cdef W1Sampler3D sampler = W1Sampler3D() - * - * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< - * field_values.data, - * physical_x.data) + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = P1Sampler1D.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_P1Sampler1D__set_state( result, __pyx_state) + * return result */ - __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *)__pyx_v_sampler->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + } - /* "yt/utilities/lib/element_mappings.pyx":1005 - * field_values.data, - * physical_x.data) - * return val # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_P1Sampler1D__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_P1Sampler1D__set_state(P1Sampler1D result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":994 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def test_wedge_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): + /* "(tree fragment)":1 + * def __pyx_unpickle_P1Sampler1D(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xa37a4b3: + * from pickle import 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("yt.utilities.lib.element_mappings.__pyx_unpickle_P1Sampler1D", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_P1Sampler1D__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_P1Sampler1D__set_state(P1Sampler1D result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_f_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_P1Sampler1D__set_state(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_2; + int __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_P1Sampler1D__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_P1Sampler1D__set_state(P1Sampler1D result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[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_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(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.inclusion_tol = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.num_mapped_coords = __pyx_t_3; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_P1Sampler1D__set_state(P1Sampler1D result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[2]) + */ + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":12 + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_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, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); 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_P1Sampler1D__set_state(P1Sampler1D result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[2]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_P1Sampler1D__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_P1Sampler1D__set_state(P1Sampler1D result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_wedge_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.__pyx_unpickle_P1Sampler1D__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_sampler); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":1011 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def test_tri_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): +/* "(tree fragment)":1 + * def __pyx_unpickle_P1Sampler2D(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_9test_tri_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_9test_tri_sampler = {"test_tri_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_9test_tri_sampler, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_9test_tri_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_vertices = 0; - PyArrayObject *__pyx_v_field_values = 0; - PyArrayObject *__pyx_v_physical_x = 0; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_25__pyx_unpickle_P1Sampler2D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_25__pyx_unpickle_P1Sampler2D = {"__pyx_unpickle_P1Sampler2D", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_25__pyx_unpickle_P1Sampler2D, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_25__pyx_unpickle_P1Sampler2D(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("test_tri_sampler (wrapper)", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_P1Sampler2D (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_tri_sampler", 1, 3, 3, 1); __PYX_ERR(0, 1011, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_P1Sampler2D", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_tri_sampler", 1, 3, 3, 2); __PYX_ERR(0, 1011, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_P1Sampler2D", 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, "test_tri_sampler") < 0)) __PYX_ERR(0, 1011, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_P1Sampler2D") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -7474,190 +13625,470 @@ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_vertices = ((PyArrayObject *)values[0]); - __pyx_v_field_values = ((PyArrayObject *)values[1]); - __pyx_v_physical_x = ((PyArrayObject *)values[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("test_tri_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1011, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_P1Sampler2D", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_tri_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.__pyx_unpickle_P1Sampler2D", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 1011, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 1012, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 1013, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_8test_tri_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_24__pyx_unpickle_P1Sampler2D(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_8test_tri_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { - double __pyx_v_val; - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_sampler = NULL; - __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; - __Pyx_Buffer __pyx_pybuffer_field_values; - __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; - __Pyx_Buffer __pyx_pybuffer_physical_x; - __Pyx_LocalBuf_ND __pyx_pybuffernd_vertices; - __Pyx_Buffer __pyx_pybuffer_vertices; +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_24__pyx_unpickle_P1Sampler2D(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("test_tri_sampler", 0); - __pyx_pybuffer_vertices.pybuffer.buf = NULL; - __pyx_pybuffer_vertices.refcount = 0; - __pyx_pybuffernd_vertices.data = NULL; - __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; - __pyx_pybuffer_field_values.pybuffer.buf = NULL; - __pyx_pybuffer_field_values.refcount = 0; - __pyx_pybuffernd_field_values.data = NULL; - __pyx_pybuffernd_field_values.rcbuffer = &__pyx_pybuffer_field_values; - __pyx_pybuffer_physical_x.pybuffer.buf = NULL; - __pyx_pybuffer_physical_x.refcount = 0; - __pyx_pybuffernd_physical_x.data = NULL; - __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1011, __pyx_L1_error) + 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_P1Sampler2D", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_P1Sampler2D(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xa37a4b3: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xa37a4b3) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_P1Sampler2D(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = P1Sampler2D.__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_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 != 0xa37a4b3: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = P1Sampler2D.__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_0xa3, __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_PickleError); + __pyx_t_2 = __pyx_v_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_P1Sampler2D(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xa37a4b3: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + */ } - __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1011, __pyx_L1_error) + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = P1Sampler2D.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_P1Sampler2D__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D), __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); + } } - __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1011, __pyx_L1_error) + 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_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "yt/utilities/lib/element_mappings.pyx":1017 - * cdef double val - * - * sampler = P1Sampler2D() # <<<<<<<<<<<<<< - * - * val = sampler.sample_at_real_point( vertices.data, + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = P1Sampler2D.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_P1Sampler2D__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = P1Sampler2D.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_P1Sampler2D__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_P1Sampler2D__set_state(P1Sampler2D result, tuple __pyx_state): */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *)__pyx_t_1); - __pyx_t_1 = 0; + 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_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_P1Sampler2D__set_state(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *)__pyx_v_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; - /* "yt/utilities/lib/element_mappings.pyx":1019 - * sampler = P1Sampler2D() - * - * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< - * field_values.data, - * physical_x.data) + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = P1Sampler2D.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_P1Sampler2D__set_state( result, __pyx_state) + * return result */ - __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *)__pyx_v_sampler->__pyx_base.__pyx_vtab)->__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + } - /* "yt/utilities/lib/element_mappings.pyx":1023 - * physical_x.data) - * - * return val # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_P1Sampler2D__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_P1Sampler2D__set_state(P1Sampler2D result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":1011 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def test_tri_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): + /* "(tree fragment)":1 + * def __pyx_unpickle_P1Sampler2D(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_tri_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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("yt.utilities.lib.element_mappings.__pyx_unpickle_P1Sampler2D", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - goto __pyx_L2; __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_sampler); + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/element_mappings.pyx":1029 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def test_quad_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): +/* "(tree fragment)":9 + * __pyx_unpickle_P1Sampler2D__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_P1Sampler2D__set_state(P1Sampler2D result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_f_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_P1Sampler2D__set_state(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_2; + int __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_P1Sampler2D__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_P1Sampler2D__set_state(P1Sampler2D result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[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_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(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.inclusion_tol = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.num_mapped_coords = __pyx_t_3; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_P1Sampler2D__set_state(P1Sampler2D result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[2]) + */ + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":12 + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_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, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); 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_P1Sampler2D__set_state(P1Sampler2D result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[2]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_P1Sampler2D__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_P1Sampler2D__set_state(P1Sampler2D result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(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("yt.utilities.lib.element_mappings.__pyx_unpickle_P1Sampler2D__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_P1Sampler3D(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11test_quad_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_11test_quad_sampler = {"test_quad_sampler", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11test_quad_sampler, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_11test_quad_sampler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_vertices = 0; - PyArrayObject *__pyx_v_field_values = 0; - PyArrayObject *__pyx_v_physical_x = 0; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_27__pyx_unpickle_P1Sampler3D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_16element_mappings_27__pyx_unpickle_P1Sampler3D = {"__pyx_unpickle_P1Sampler3D", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_27__pyx_unpickle_P1Sampler3D, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_16element_mappings_27__pyx_unpickle_P1Sampler3D(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("test_quad_sampler (wrapper)", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_P1Sampler3D (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_field_values,&__pyx_n_s_physical_x,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_values)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_quad_sampler", 1, 3, 3, 1); __PYX_ERR(0, 1029, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_P1Sampler3D", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_x)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("test_quad_sampler", 1, 3, 3, 2); __PYX_ERR(0, 1029, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_P1Sampler3D", 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, "test_quad_sampler") < 0)) __PYX_ERR(0, 1029, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_P1Sampler3D") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -7666,134 +14097,413 @@ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_vertices = ((PyArrayObject *)values[0]); - __pyx_v_field_values = ((PyArrayObject *)values[1]); - __pyx_v_physical_x = ((PyArrayObject *)values[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("test_quad_sampler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1029, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_P1Sampler3D", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_quad_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.element_mappings.__pyx_unpickle_P1Sampler3D", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) __PYX_ERR(0, 1029, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_values), __pyx_ptype_5numpy_ndarray, 1, "field_values", 0))) __PYX_ERR(0, 1030, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_physical_x), __pyx_ptype_5numpy_ndarray, 1, "physical_x", 0))) __PYX_ERR(0, 1031, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_10test_quad_sampler(__pyx_self, __pyx_v_vertices, __pyx_v_field_values, __pyx_v_physical_x); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16element_mappings_26__pyx_unpickle_P1Sampler3D(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_10test_quad_sampler(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertices, PyArrayObject *__pyx_v_field_values, PyArrayObject *__pyx_v_physical_x) { - double __pyx_v_val; - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_v_sampler = NULL; - __Pyx_LocalBuf_ND __pyx_pybuffernd_field_values; - __Pyx_Buffer __pyx_pybuffer_field_values; - __Pyx_LocalBuf_ND __pyx_pybuffernd_physical_x; - __Pyx_Buffer __pyx_pybuffer_physical_x; - __Pyx_LocalBuf_ND __pyx_pybuffernd_vertices; - __Pyx_Buffer __pyx_pybuffer_vertices; +static PyObject *__pyx_pf_2yt_9utilities_3lib_16element_mappings_26__pyx_unpickle_P1Sampler3D(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v_PickleError = NULL; + PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("test_quad_sampler", 0); - __pyx_pybuffer_vertices.pybuffer.buf = NULL; - __pyx_pybuffer_vertices.refcount = 0; - __pyx_pybuffernd_vertices.data = NULL; - __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; - __pyx_pybuffer_field_values.pybuffer.buf = NULL; - __pyx_pybuffer_field_values.refcount = 0; - __pyx_pybuffernd_field_values.data = NULL; - __pyx_pybuffernd_field_values.rcbuffer = &__pyx_pybuffer_field_values; - __pyx_pybuffer_physical_x.pybuffer.buf = NULL; - __pyx_pybuffer_physical_x.refcount = 0; - __pyx_pybuffernd_physical_x.data = NULL; - __pyx_pybuffernd_physical_x.rcbuffer = &__pyx_pybuffer_physical_x; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1029, __pyx_L1_error) + 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_P1Sampler3D", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_P1Sampler3D(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xa37a4b3: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xa37a4b3) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_P1Sampler3D(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = P1Sampler3D.__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_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 != 0xa37a4b3: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) # <<<<<<<<<<<<<< + * result = P1Sampler3D.__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_0xa3, __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_PickleError); + __pyx_t_2 = __pyx_v_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_P1Sampler3D(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xa37a4b3: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + */ } - __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_field_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1029, __pyx_L1_error) + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = P1Sampler3D.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_P1Sampler3D__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D), __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); + } } - __pyx_pybuffernd_field_values.diminfo[0].strides = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field_values.diminfo[0].shape = __pyx_pybuffernd_field_values.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_physical_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1029, __pyx_L1_error) + 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_pybuffernd_physical_x.diminfo[0].strides = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_physical_x.diminfo[0].shape = __pyx_pybuffernd_physical_x.rcbuffer->pybuffer.shape[0]; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "yt/utilities/lib/element_mappings.pyx":1035 - * cdef double val - * - * sampler = Q1Sampler2D() # <<<<<<<<<<<<<< - * - * val = sampler.sample_at_real_point( vertices.data, + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = P1Sampler3D.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_P1Sampler3D__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = P1Sampler3D.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_P1Sampler3D__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_P1Sampler3D__set_state(P1Sampler3D result, tuple __pyx_state): */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *)__pyx_t_1); - __pyx_t_1 = 0; + 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_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_P1Sampler3D__set_state(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *)__pyx_v_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; - /* "yt/utilities/lib/element_mappings.pyx":1037 - * sampler = Q1Sampler2D() - * - * val = sampler.sample_at_real_point( vertices.data, # <<<<<<<<<<<<<< - * field_values.data, - * physical_x.data) + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xa37a4b3 = (inclusion_tol, num_mapped_coords))" % __pyx_checksum) + * result = P1Sampler3D.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_P1Sampler3D__set_state( result, __pyx_state) + * return result */ - __pyx_v_val = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *)__pyx_v_sampler->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.sample_at_real_point(((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler), ((double *)__pyx_v_vertices->data), ((double *)__pyx_v_field_values->data), ((double *)__pyx_v_physical_x->data)); + } - /* "yt/utilities/lib/element_mappings.pyx":1041 - * physical_x.data) - * - * return val # <<<<<<<<<<<<<< + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_P1Sampler3D__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_P1Sampler3D__set_state(P1Sampler3D result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "yt/utilities/lib/element_mappings.pyx":1029 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def test_quad_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): + /* "(tree fragment)":1 + * def __pyx_unpickle_P1Sampler3D(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.element_mappings.test_quad_sampler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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("yt.utilities.lib.element_mappings.__pyx_unpickle_P1Sampler3D", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - goto __pyx_L2; __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field_values.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_physical_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_sampler); + __Pyx_XDECREF(__pyx_v_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_P1Sampler3D__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_P1Sampler3D__set_state(P1Sampler3D result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_f_2yt_9utilities_3lib_16element_mappings___pyx_unpickle_P1Sampler3D__set_state(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_2; + int __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_P1Sampler3D__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_P1Sampler3D__set_state(P1Sampler3D result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[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_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(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.inclusion_tol = __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_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result->__pyx_base.num_mapped_coords = __pyx_t_3; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_P1Sampler3D__set_state(P1Sampler3D result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[2]) + */ + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":12 + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_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, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); 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_P1Sampler3D__set_state(P1Sampler3D result, tuple __pyx_state): + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[2]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_P1Sampler3D__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_P1Sampler3D__set_state(P1Sampler3D result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(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("yt.utilities.lib.element_mappings.__pyx_unpickle_P1Sampler3D__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -7968,11 +14678,11 @@ * * 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, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + __PYX_ERR(2, 218, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 @@ -8024,11 +14734,11 @@ * * 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, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + __PYX_ERR(2, 222, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") @@ -8333,11 +15043,11 @@ * 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, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + __PYX_ERR(2, 259, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: @@ -8544,22 +15254,22 @@ * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) + __PYX_ERR(2, 278, __pyx_L1_error) break; } @@ -8626,7 +15336,7 @@ * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 @@ -8785,7 +15495,7 @@ * 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, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8832,7 +15542,7 @@ * 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, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8879,7 +15589,7 @@ * 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, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8926,7 +15636,7 @@ * 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, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8973,7 +15683,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9054,15 +15764,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) + __PYX_ERR(2, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + __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, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -9077,11 +15787,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) + __PYX_ERR(2, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -9102,7 +15812,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __pyx_L1_error) + __PYX_ERR(2, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -9110,15 +15820,15 @@ __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, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -9131,12 +15841,12 @@ * 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, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -9148,11 +15858,11 @@ * * 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, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) + __PYX_ERR(2, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -9216,11 +15926,11 @@ * # 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, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __PYX_ERR(2, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -9239,11 +15949,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -9303,7 +16013,7 @@ * 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, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -9325,11 +16035,11 @@ * * # 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, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __PYX_ERR(2, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -9347,11 +16057,11 @@ * 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, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -9365,11 +16075,11 @@ * 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, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -9383,11 +16093,11 @@ * 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, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -9401,11 +16111,11 @@ * 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, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -9419,11 +16129,11 @@ * 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, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -9437,11 +16147,11 @@ * 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, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -9455,11 +16165,11 @@ * 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, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -9473,11 +16183,11 @@ * 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, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -9491,11 +16201,11 @@ * 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, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -9509,11 +16219,11 @@ * 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, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -9527,11 +16237,11 @@ * 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, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -9545,11 +16255,11 @@ * 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, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -9563,11 +16273,11 @@ * 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, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -9581,11 +16291,11 @@ * 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, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -9601,11 +16311,11 @@ * 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, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -9621,11 +16331,11 @@ * 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, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -9641,11 +16351,11 @@ * 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, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -9660,19 +16370,19 @@ * 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, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) + __PYX_ERR(2, 844, __pyx_L1_error) } __pyx_L15:; @@ -9703,7 +16413,7 @@ * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; @@ -9967,7 +16677,7 @@ * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 * # Cython code. @@ -9980,7 +16690,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -9994,7 +16704,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -10006,11 +16716,11 @@ * * 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, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) + __PYX_ERR(2, 989, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -10028,7 +16738,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -10098,7 +16808,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * @@ -10111,7 +16821,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -10125,7 +16835,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -10137,11 +16847,11 @@ * * 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, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) + __PYX_ERR(2, 995, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -10159,7 +16869,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -10229,7 +16939,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * @@ -10242,7 +16952,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -10255,7 +16965,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -10265,11 +16975,11 @@ * 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, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) + __PYX_ERR(2, 1001, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -10287,7 +16997,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -10314,37 +17024,113 @@ } static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler __pyx_vtable_2yt_9utilities_3lib_16element_mappings_ElementSampler; -static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_ElementSampler(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *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); - } +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_ElementSampler(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *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_2yt_9utilities_3lib_16element_mappings_ElementSampler *)o); + p->__pyx_vtab = __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler; + return o; +} + +static void __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + 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_2yt_9utilities_3lib_16element_mappings_ElementSampler[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_14ElementSampler_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_14ElementSampler_5__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_ElementSampler = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.element_mappings.ElementSampler", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*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*/ + "\n\n This is a base class for sampling the value of a finite element solution\n at an arbitrary point inside a mesh element. In general, this will be done\n by transforming the requested physical coordinate into a mapped coordinate\n system, sampling the solution in mapped coordinates, and returning the result.\n This is not to be used directly; use one of the subclasses instead.\n\n ", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*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_2yt_9utilities_3lib_16element_mappings_14ElementSampler_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*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_2yt_9utilities_3lib_16element_mappings_P1Sampler1D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler1D; + +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_P1Sampler1D(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *p; + PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_ElementSampler(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)o); - p->__pyx_vtab = __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler; + p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler1D; return o; } -static void __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler(PyObject *o) { - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - (*Py_TYPE(o)->tp_free)(o); -} - -static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_ElementSampler[] = { +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_P1Sampler1D[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_ElementSampler = { +static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler1D = { PyVarObject_HEAD_INIT(0, 0) - "yt.utilities.lib.element_mappings.ElementSampler", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler), /*tp_basicsize*/ + "yt.utilities.lib.element_mappings.P1Sampler1D", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*tp_dealloc*/ 0, /*tp_print*/ @@ -10367,14 +17153,14 @@ 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*/ - "\n\n This is a base class for sampling the value of a finite element solution\n at an arbitrary point inside a mesh element. In general, this will be done\n by transforming the requested physical coordinate into a mapped coordinate \n system, sampling the solution in mapped coordinates, and returning the result.\n This is not to be used directly; use one of the subclasses instead.\n\n ", /*tp_doc*/ + "\n\n This implements sampling inside a linear, 1D element.\n\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*tp_methods*/ + __pyx_methods_2yt_9utilities_3lib_16element_mappings_P1Sampler1D, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -10382,9 +17168,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_9utilities_3lib_16element_mappings_14ElementSampler_1__init__, /*tp_init*/ + __pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*tp_new*/ + __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_P1Sampler1D, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10410,6 +17196,8 @@ } static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_P1Sampler2D[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -10439,7 +17227,7 @@ 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*/ - "\n\n This implements sampling inside a linear, triangular mesh element.\n This mapping is linear and can be inverted easily.\n\n ", /*tp_doc*/ + "\n\n This implements sampling inside a linear, triangular mesh element.\n This mapping is linear and can be inverted easily. Note that this\n implementation uses triangular (or barycentric) coordinates.\n\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -10482,6 +17270,8 @@ } static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_P1Sampler3D[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -10554,13 +17344,237 @@ } static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = { PyVarObject_HEAD_INIT(0, 0) - "yt.utilities.lib.element_mappings.NonlinearSolveSampler3D", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D), /*tp_basicsize*/ + "yt.utilities.lib.element_mappings.NonlinearSolveSampler3D", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*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*/ + "\n\n This is a base class for handling element samplers that require\n a nonlinear solve to invert the mapping between coordinate systems.\n To do this, we perform Newton-Raphson iteration using a specified\n system of equations with an analytic Jacobian matrix. This solver\n is hard-coded for 3D for reasons of efficiency. This is not to be\n used directly, use one of the subclasses instead.\n\n ", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D, /*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_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D, /*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_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D; + +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *p; + PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D; + return o; +} + +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_5__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.element_mappings.Q1Sampler3D", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*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*/ + "\n\n This implements sampling inside a 3D, linear, hexahedral mesh element.\n\n ", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D, /*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_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D, /*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_2yt_9utilities_3lib_16element_mappings_W1Sampler3D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_W1Sampler3D; + +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_W1Sampler3D(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *p; + PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D; + return o; +} + +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_W1Sampler3D[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_5__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_W1Sampler3D = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.element_mappings.W1Sampler3D", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*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*/ + "\n\n This implements sampling inside a 3D, linear, wedge mesh element.\n\n ", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_9utilities_3lib_16element_mappings_W1Sampler3D, /*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_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_W1Sampler3D, /*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_2yt_9utilities_3lib_16element_mappings_S2Sampler3D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_S2Sampler3D; + +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_S2Sampler3D(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *p; + PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D; + return o; +} + +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_S2Sampler3D[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_5__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.element_mappings.S2Sampler3D", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*tp_dealloc*/ 0, /*tp_print*/ @@ -10583,14 +17597,14 @@ 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*/ - "\n\n This is a base class for handling element samplers that require\n a nonlinear solve to invert the mapping between coordinate systems.\n To do this, we perform Newton-Raphson iteration using a specified \n system of equations with an analytic Jacobian matrix. This solver\n is hard-coded for 3D for reasons of efficiency. This is not to be\n used directly, use one of the subclasses instead.\n\n ", /*tp_doc*/ + "\n\n This implements sampling inside a 3D, 20-node hexahedral mesh element.\n\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D, /*tp_methods*/ + __pyx_methods_2yt_9utilities_3lib_16element_mappings_S2Sampler3D, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -10598,9 +17612,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_1__init__, /*tp_init*/ + __pyx_pw_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D, /*tp_new*/ + __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_S2Sampler3D, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10614,25 +17628,27 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; -static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *p; - PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D(t, a, k); +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *p; + PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_ElementSampler(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D; + p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; return o; } -static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D[] = { +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D = { +static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = { PyVarObject_HEAD_INIT(0, 0) - "yt.utilities.lib.element_mappings.Q1Sampler3D", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), /*tp_basicsize*/ + "yt.utilities.lib.element_mappings.NonlinearSolveSampler2D", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*tp_dealloc*/ 0, /*tp_print*/ @@ -10655,14 +17671,14 @@ 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*/ - " \n\n This implements sampling inside a 3D, linear, hexahedral mesh element.\n\n ", /*tp_doc*/ + "\n\n This is a base class for handling element samplers that require\n a nonlinear solve to invert the mapping between coordinate systems.\n To do this, we perform Newton-Raphson iteration using a specified\n system of equations with an analytic Jacobian matrix. This solver\n is hard-coded for 2D for reasons of efficiency. This is not to be\n used directly, use one of the subclasses instead.\n\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D, /*tp_methods*/ + __pyx_methods_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -10670,9 +17686,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_1__init__, /*tp_init*/ + __pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D, /*tp_new*/ + __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10686,25 +17702,27 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_W1Sampler3D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_W1Sampler3D; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D; -static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_W1Sampler3D(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *p; - PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D(t, a, k); +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *p; + PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D; + p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D; return o; } -static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_W1Sampler3D[] = { +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_W1Sampler3D = { +static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = { PyVarObject_HEAD_INIT(0, 0) - "yt.utilities.lib.element_mappings.W1Sampler3D", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), /*tp_basicsize*/ + "yt.utilities.lib.element_mappings.Q1Sampler2D", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*tp_dealloc*/ 0, /*tp_print*/ @@ -10727,14 +17745,14 @@ 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*/ - " \n\n This implements sampling inside a 3D, linear, wedge mesh element.\n\n ", /*tp_doc*/ + "\n\n This implements sampling inside a 2D, linear, quadrilateral mesh element.\n\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_9utilities_3lib_16element_mappings_W1Sampler3D, /*tp_methods*/ + __pyx_methods_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -10742,9 +17760,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_1__init__, /*tp_init*/ + __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_W1Sampler3D, /*tp_new*/ + __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10758,25 +17776,27 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_S2Sampler3D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_S2Sampler3D; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D; -static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_S2Sampler3D(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *p; - PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D(t, a, k); +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *p; + PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D; + p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D; return o; } -static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_S2Sampler3D[] = { +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = { +static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D = { PyVarObject_HEAD_INIT(0, 0) - "yt.utilities.lib.element_mappings.S2Sampler3D", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), /*tp_basicsize*/ + "yt.utilities.lib.element_mappings.Q2Sampler2D", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*tp_dealloc*/ 0, /*tp_print*/ @@ -10799,14 +17819,14 @@ 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*/ - " \n\n This implements sampling inside a 3D, 20-node hexahedral mesh element.\n\n ", /*tp_doc*/ + "\n\n This implements sampling inside a 2D, quadratic, quadrilateral mesh element.\n\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_9utilities_3lib_16element_mappings_S2Sampler3D, /*tp_methods*/ + __pyx_methods_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -10814,9 +17834,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_1__init__, /*tp_init*/ + __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_S2Sampler3D, /*tp_new*/ + __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10830,25 +17850,27 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_T2Sampler2D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_T2Sampler2D; -static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *p; - PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_ElementSampler(t, a, k); +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_T2Sampler2D(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *p; + PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; + p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_T2Sampler2D; return o; } -static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D[] = { +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_T2Sampler2D[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = { +static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_T2Sampler2D = { PyVarObject_HEAD_INIT(0, 0) - "yt.utilities.lib.element_mappings.NonlinearSolveSampler2D", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D), /*tp_basicsize*/ + "yt.utilities.lib.element_mappings.T2Sampler2D", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*tp_dealloc*/ 0, /*tp_print*/ @@ -10871,14 +17893,14 @@ 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*/ - "\n\n This is a base class for handling element samplers that require\n a nonlinear solve to invert the mapping between coordinate systems.\n To do this, we perform Newton-Raphson iteration using a specified \n system of equations with an analytic Jacobian matrix. This solver\n is hard-coded for 2D for reasons of efficiency. This is not to be\n used directly, use one of the subclasses instead.\n\n ", /*tp_doc*/ + "\n\n This implements sampling inside a 2D, quadratic, triangular mesh\n element. Note that this implementation uses canonical coordinates.\n\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D, /*tp_methods*/ + __pyx_methods_2yt_9utilities_3lib_16element_mappings_T2Sampler2D, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -10886,9 +17908,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_1__init__, /*tp_init*/ + __pyx_pw_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D, /*tp_new*/ + __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_T2Sampler2D, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10902,25 +17924,27 @@ 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D; -static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *p; - PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D(t, a, k); +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *p; + PyObject *o = __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D; + p = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D; return o; } -static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D[] = { +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = { +static PyTypeObject __pyx_type_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D = { PyVarObject_HEAD_INIT(0, 0) - "yt.utilities.lib.element_mappings.Q1Sampler2D", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D), /*tp_basicsize*/ + "yt.utilities.lib.element_mappings.Tet2Sampler3D", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_2yt_9utilities_3lib_16element_mappings_ElementSampler, /*tp_dealloc*/ 0, /*tp_print*/ @@ -10943,14 +17967,14 @@ 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*/ - " \n\n This implements sampling inside a 2D, linear, quadrilateral mesh element.\n\n ", /*tp_doc*/ + "\n\n This implements sampling inside a 3D, quadratic, tetrahedral mesh\n element. Note that this implementation uses canonical coordinates.\n\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D, /*tp_methods*/ + __pyx_methods_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -10958,9 +17982,9 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_1__init__, /*tp_init*/ + __pyx_pw_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D, /*tp_new*/ + __pyx_tp_new_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -11001,44 +18025,69 @@ {&__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_0xa3, __pyx_k_Incompatible_checksums_s_vs_0xa3, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xa3), 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_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_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 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_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_field_values, __pyx_k_field_values, sizeof(__pyx_k_field_values), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, {&__pyx_n_s_physical_x, __pyx_k_physical_x, sizeof(__pyx_k_physical_x), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 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_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_ElementSampler, __pyx_k_pyx_unpickle_ElementSampler, sizeof(__pyx_k_pyx_unpickle_ElementSampler), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_P1Sampler1D, __pyx_k_pyx_unpickle_P1Sampler1D, sizeof(__pyx_k_pyx_unpickle_P1Sampler1D), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_P1Sampler2D, __pyx_k_pyx_unpickle_P1Sampler2D, sizeof(__pyx_k_pyx_unpickle_P1Sampler2D), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_P1Sampler3D, __pyx_k_pyx_unpickle_P1Sampler3D, sizeof(__pyx_k_pyx_unpickle_P1Sampler3D), 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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_sampler, __pyx_k_sampler, sizeof(__pyx_k_sampler), 0, 0, 1, 1}, + {&__pyx_kp_s_self_func_self_jac_cannot_be_con, __pyx_k_self_func_self_jac_cannot_be_con, sizeof(__pyx_k_self_func_self_jac_cannot_be_con), 0, 0, 1, 0}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_test_hex20_sampler, __pyx_k_test_hex20_sampler, sizeof(__pyx_k_test_hex20_sampler), 0, 0, 1, 1}, {&__pyx_n_s_test_hex_sampler, __pyx_k_test_hex_sampler, sizeof(__pyx_k_test_hex_sampler), 0, 0, 1, 1}, + {&__pyx_n_s_test_linear1D_sampler, __pyx_k_test_linear1D_sampler, sizeof(__pyx_k_test_linear1D_sampler), 0, 0, 1, 1}, + {&__pyx_n_s_test_quad2_sampler, __pyx_k_test_quad2_sampler, sizeof(__pyx_k_test_quad2_sampler), 0, 0, 1, 1}, {&__pyx_n_s_test_quad_sampler, __pyx_k_test_quad_sampler, sizeof(__pyx_k_test_quad_sampler), 0, 0, 1, 1}, + {&__pyx_n_s_test_tet2_sampler, __pyx_k_test_tet2_sampler, sizeof(__pyx_k_test_tet2_sampler), 0, 0, 1, 1}, {&__pyx_n_s_test_tetra_sampler, __pyx_k_test_tetra_sampler, sizeof(__pyx_k_test_tetra_sampler), 0, 0, 1, 1}, + {&__pyx_n_s_test_tri2_sampler, __pyx_k_test_tri2_sampler, sizeof(__pyx_k_test_tri2_sampler), 0, 0, 1, 1}, {&__pyx_n_s_test_tri_sampler, __pyx_k_test_tri_sampler, sizeof(__pyx_k_test_tri_sampler), 0, 0, 1, 1}, {&__pyx_n_s_test_wedge_sampler, __pyx_k_test_wedge_sampler, sizeof(__pyx_k_test_wedge_sampler), 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_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, {&__pyx_n_s_vertices, __pyx_k_vertices, sizeof(__pyx_k_vertices), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_element_mapping, __pyx_k_yt_utilities_lib_element_mapping, sizeof(__pyx_k_yt_utilities_lib_element_mapping), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_element_mapping, __pyx_k_yt_utilities_lib_element_mapping, sizeof(__pyx_k_yt_utilities_lib_element_mapping), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_element_mapping_2, __pyx_k_yt_utilities_lib_element_mapping_2, sizeof(__pyx_k_yt_utilities_lib_element_mapping_2), 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, 44, __pyx_L1_error) - __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 116, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 128, __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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -11048,6 +18097,177 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(tree fragment)":4 + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "(tree fragment)":4 + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "(tree fragment)":4 + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "(tree fragment)":4 + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "(tree fragment)":4 + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "(tree fragment)":4 + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "(tree fragment)":4 + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "(tree fragment)":4 + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "(tree fragment)":4 + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.func,self.jac cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_self_func_self_jac_cannot_be_con); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): @@ -11055,9 +18275,9 @@ * * 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, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -11066,9 +18286,9 @@ * * 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, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -11077,9 +18297,9 @@ * 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, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -11088,9 +18308,9 @@ * * 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, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -11099,9 +18319,9 @@ * # 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, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -11110,9 +18330,9 @@ * * # 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, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -11121,9 +18341,9 @@ * * 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, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -11132,90 +18352,160 @@ * * 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, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _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, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); - /* "yt/utilities/lib/element_mappings.pyx":942 + /* "yt/utilities/lib/element_mappings.pyx":1115 * @cython.wraparound(False) * @cython.cdivision(True) * def test_hex_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] field_values, * np.ndarray[np.float64_t, ndim=1] physical_x): */ - __pyx_tuple__10 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 942, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_test_hex_sampler, 942, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_element_mapping, __pyx_n_s_test_hex_sampler, 1115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 1115, __pyx_L1_error) - /* "yt/utilities/lib/element_mappings.pyx":959 + /* "yt/utilities/lib/element_mappings.pyx":1132 * @cython.wraparound(False) * @cython.cdivision(True) * def test_hex20_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] field_values, * np.ndarray[np.float64_t, ndim=1] physical_x): */ - __pyx_tuple__12 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_test_hex20_sampler, 959, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_tuple__30 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_element_mapping, __pyx_n_s_test_hex20_sampler, 1132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 1132, __pyx_L1_error) - /* "yt/utilities/lib/element_mappings.pyx":976 + /* "yt/utilities/lib/element_mappings.pyx":1149 * @cython.wraparound(False) * @cython.cdivision(True) * def test_tetra_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] field_values, * np.ndarray[np.float64_t, ndim=1] physical_x): */ - __pyx_tuple__14 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_test_tetra_sampler, 976, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_tuple__32 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_element_mapping, __pyx_n_s_test_tetra_sampler, 1149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 1149, __pyx_L1_error) - /* "yt/utilities/lib/element_mappings.pyx":994 + /* "yt/utilities/lib/element_mappings.pyx":1167 * @cython.wraparound(False) * @cython.cdivision(True) * def test_wedge_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] field_values, * np.ndarray[np.float64_t, ndim=1] physical_x): */ - __pyx_tuple__16 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 994, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_test_wedge_sampler, 994, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 994, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 1167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_element_mapping, __pyx_n_s_test_wedge_sampler, 1167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 1167, __pyx_L1_error) + + /* "yt/utilities/lib/element_mappings.pyx":1184 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_linear1D_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_element_mapping, __pyx_n_s_test_linear1D_sampler, 1184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 1184, __pyx_L1_error) - /* "yt/utilities/lib/element_mappings.pyx":1011 + /* "yt/utilities/lib/element_mappings.pyx":1202 * @cython.wraparound(False) * @cython.cdivision(True) * def test_tri_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] field_values, * np.ndarray[np.float64_t, ndim=1] physical_x): */ - __pyx_tuple__18 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1011, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_test_tri_sampler, 1011, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 1011, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_element_mapping, __pyx_n_s_test_tri_sampler, 1202, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 1202, __pyx_L1_error) - /* "yt/utilities/lib/element_mappings.pyx":1029 + /* "yt/utilities/lib/element_mappings.pyx":1220 * @cython.wraparound(False) * @cython.cdivision(True) * def test_quad_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] field_values, * np.ndarray[np.float64_t, ndim=1] physical_x): */ - __pyx_tuple__20 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_test_quad_sampler, 1029, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 1220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_element_mapping, __pyx_n_s_test_quad_sampler, 1220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 1220, __pyx_L1_error) + + /* "yt/utilities/lib/element_mappings.pyx":1237 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_quad2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_element_mapping, __pyx_n_s_test_quad2_sampler, 1237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 1237, __pyx_L1_error) + + /* "yt/utilities/lib/element_mappings.pyx":1254 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_tri2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + __pyx_tuple__44 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_element_mapping, __pyx_n_s_test_tri2_sampler, 1254, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 1254, __pyx_L1_error) + + /* "yt/utilities/lib/element_mappings.pyx":1271 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_tet2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + __pyx_tuple__46 = PyTuple_Pack(5, __pyx_n_s_vertices, __pyx_n_s_field_values, __pyx_n_s_physical_x, __pyx_n_s_val, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_element_mapping, __pyx_n_s_test_tet2_sampler, 1271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 1271, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __pyx_unpickle_ElementSampler(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError + */ + __pyx_tuple__48 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ElementSampler, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_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, 0, __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_P1Sampler1D, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_P1Sampler2D, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_P1Sampler3D, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -11225,6 +18515,7 @@ static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_171418803 = PyInt_FromLong(171418803L); if (unlikely(!__pyx_int_171418803)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -11239,6 +18530,7 @@ #endif { PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -11286,6 +18578,7 @@ __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 @@ -11320,21 +18613,35 @@ __pyx_vtable_2yt_9utilities_3lib_16element_mappings_ElementSampler.sample_at_real_point = (double (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *, double *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_14ElementSampler_sample_at_real_point; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_ElementSampler.check_inside = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_14ElementSampler_check_inside; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_ElementSampler.check_mesh_lines = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_14ElementSampler_check_mesh_lines; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_ElementSampler) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_ElementSampler) < 0) __PYX_ERR(0, 62, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_16element_mappings_ElementSampler.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_ElementSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler) < 0) __PYX_ERR(0, 49, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "ElementSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_ElementSampler) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_ElementSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ElementSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_ElementSampler) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_ElementSampler) < 0) __PYX_ERR(0, 62, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler = &__pyx_type_2yt_9utilities_3lib_16element_mappings_ElementSampler; + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler1D = &__pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler1D; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler1D.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler1D.__pyx_base.map_real_to_unit = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *, double *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_map_real_to_unit; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler1D.__pyx_base.sample_at_unit_point = (double (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_sample_at_unit_point; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler1D.__pyx_base.check_inside = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler1D_check_inside; + __pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler1D.tp_base = __pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler; + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler1D) < 0) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler1D.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler1D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler1D) < 0) __PYX_ERR(0, 120, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "P1Sampler1D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler1D) < 0) __PYX_ERR(0, 120, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler1D) < 0) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D = &__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler1D; __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = &__pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler2D; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler2D.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler2D.__pyx_base.map_real_to_unit = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *, double *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_map_real_to_unit; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler2D.__pyx_base.sample_at_unit_point = (double (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_sample_at_unit_point; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler2D.__pyx_base.check_inside = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler2D_check_inside; __pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler2D.tp_base = __pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler2D) < 0) __PYX_ERR(0, 107, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler2D) < 0) __PYX_ERR(0, 155, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler2D.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler2D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D) < 0) __PYX_ERR(0, 107, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "P1Sampler2D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler2D) < 0) __PYX_ERR(0, 107, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler2D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D) < 0) __PYX_ERR(0, 155, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "P1Sampler2D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler2D) < 0) __PYX_ERR(0, 155, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler2D) < 0) __PYX_ERR(0, 155, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = &__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler2D; __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = &__pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler3D; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler3D.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler; @@ -11343,19 +18650,21 @@ __pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler3D.__pyx_base.check_inside = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_check_inside; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_P1Sampler3D.__pyx_base.check_mesh_lines = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11P1Sampler3D_check_mesh_lines; __pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler3D.tp_base = __pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler3D) < 0) __PYX_ERR(0, 177, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler3D) < 0) __PYX_ERR(0, 226, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler3D.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler3D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D) < 0) __PYX_ERR(0, 177, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "P1Sampler3D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler3D) < 0) __PYX_ERR(0, 177, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler3D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D) < 0) __PYX_ERR(0, 226, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "P1Sampler3D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler3D) < 0) __PYX_ERR(0, 226, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler3D) < 0) __PYX_ERR(0, 226, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = &__pyx_type_2yt_9utilities_3lib_16element_mappings_P1Sampler3D; __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = &__pyx_vtable_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D.__pyx_base.map_real_to_unit = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *, double *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler3D_map_real_to_unit; __pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D.tp_base = __pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D) < 0) __PYX_ERR(0, 271, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D) < 0) __PYX_ERR(0, 320, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D) < 0) __PYX_ERR(0, 271, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "NonlinearSolveSampler3D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D) < 0) __PYX_ERR(0, 271, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D) < 0) __PYX_ERR(0, 320, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "NonlinearSolveSampler3D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D) < 0) __PYX_ERR(0, 320, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D) < 0) __PYX_ERR(0, 320, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = &__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D = &__pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; @@ -11363,10 +18672,11 @@ __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D.__pyx_base.__pyx_base.check_inside = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_check_inside; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D.__pyx_base.__pyx_base.check_mesh_lines = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler3D_check_mesh_lines; __pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D.tp_base = __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D) < 0) __PYX_ERR(0, 334, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D) < 0) __PYX_ERR(0, 427, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D) < 0) __PYX_ERR(0, 334, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "Q1Sampler3D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D) < 0) __PYX_ERR(0, 334, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D) < 0) __PYX_ERR(0, 427, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Q1Sampler3D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D) < 0) __PYX_ERR(0, 427, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D) < 0) __PYX_ERR(0, 427, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D = &__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D; __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D = &__pyx_vtable_2yt_9utilities_3lib_16element_mappings_W1Sampler3D; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_W1Sampler3D.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; @@ -11374,10 +18684,11 @@ __pyx_vtable_2yt_9utilities_3lib_16element_mappings_W1Sampler3D.__pyx_base.__pyx_base.check_inside = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_check_inside; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_W1Sampler3D.__pyx_base.__pyx_base.check_mesh_lines = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11W1Sampler3D_check_mesh_lines; __pyx_type_2yt_9utilities_3lib_16element_mappings_W1Sampler3D.tp_base = __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_W1Sampler3D) < 0) __PYX_ERR(0, 674, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_W1Sampler3D) < 0) __PYX_ERR(0, 703, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_16element_mappings_W1Sampler3D.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_W1Sampler3D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D) < 0) __PYX_ERR(0, 674, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "W1Sampler3D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_W1Sampler3D) < 0) __PYX_ERR(0, 674, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_W1Sampler3D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D) < 0) __PYX_ERR(0, 703, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "W1Sampler3D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_W1Sampler3D) < 0) __PYX_ERR(0, 703, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_W1Sampler3D) < 0) __PYX_ERR(0, 703, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D = &__pyx_type_2yt_9utilities_3lib_16element_mappings_W1Sampler3D; __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = &__pyx_vtable_2yt_9utilities_3lib_16element_mappings_S2Sampler3D; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_S2Sampler3D.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; @@ -11385,30 +18696,67 @@ __pyx_vtable_2yt_9utilities_3lib_16element_mappings_S2Sampler3D.__pyx_base.__pyx_base.check_inside = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_check_inside; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_S2Sampler3D.__pyx_base.__pyx_base.check_mesh_lines = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11S2Sampler3D_check_mesh_lines; __pyx_type_2yt_9utilities_3lib_16element_mappings_S2Sampler3D.tp_base = __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_S2Sampler3D) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_S2Sampler3D) < 0) __PYX_ERR(0, 488, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_16element_mappings_S2Sampler3D.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_S2Sampler3D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D) < 0) __PYX_ERR(0, 459, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "S2Sampler3D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_S2Sampler3D) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_S2Sampler3D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D) < 0) __PYX_ERR(0, 488, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "S2Sampler3D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_S2Sampler3D) < 0) __PYX_ERR(0, 488, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_S2Sampler3D) < 0) __PYX_ERR(0, 488, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = &__pyx_type_2yt_9utilities_3lib_16element_mappings_S2Sampler3D; __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = &__pyx_vtable_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D.__pyx_base.map_real_to_unit = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *, double *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_23NonlinearSolveSampler2D_map_real_to_unit; __pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D.tp_base = __pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D) < 0) __PYX_ERR(0, 794, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D) < 0) __PYX_ERR(0, 777, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D) < 0) __PYX_ERR(0, 794, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "NonlinearSolveSampler2D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D) < 0) __PYX_ERR(0, 794, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D) < 0) __PYX_ERR(0, 777, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "NonlinearSolveSampler2D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D) < 0) __PYX_ERR(0, 777, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D) < 0) __PYX_ERR(0, 777, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = &__pyx_type_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = &__pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D.__pyx_base.__pyx_base.sample_at_unit_point = (double (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_sample_at_unit_point; __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D.__pyx_base.__pyx_base.check_inside = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11Q1Sampler2D_check_inside; __pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D.tp_base = __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D) < 0) __PYX_ERR(0, 856, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D) < 0) __PYX_ERR(0, 877, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D) < 0) __PYX_ERR(0, 856, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "Q1Sampler2D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D) < 0) __PYX_ERR(0, 856, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D) < 0) __PYX_ERR(0, 877, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Q1Sampler2D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D) < 0) __PYX_ERR(0, 877, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D) < 0) __PYX_ERR(0, 877, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = &__pyx_type_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D; + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D = &__pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D.__pyx_base.__pyx_base.sample_at_unit_point = (double (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_sample_at_unit_point; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D.__pyx_base.__pyx_base.check_inside = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11Q2Sampler2D_check_inside; + __pyx_type_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D.tp_base = __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D) < 0) __PYX_ERR(0, 917, __pyx_L1_error) + __pyx_type_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D) < 0) __PYX_ERR(0, 917, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Q2Sampler2D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D) < 0) __PYX_ERR(0, 917, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D) < 0) __PYX_ERR(0, 917, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D = &__pyx_type_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D; + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_T2Sampler2D = &__pyx_vtable_2yt_9utilities_3lib_16element_mappings_T2Sampler2D; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_T2Sampler2D.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_T2Sampler2D.__pyx_base.__pyx_base.sample_at_unit_point = (double (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_sample_at_unit_point; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_T2Sampler2D.__pyx_base.__pyx_base.check_inside = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_11T2Sampler2D_check_inside; + __pyx_type_2yt_9utilities_3lib_16element_mappings_T2Sampler2D.tp_base = __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_T2Sampler2D) < 0) __PYX_ERR(0, 974, __pyx_L1_error) + __pyx_type_2yt_9utilities_3lib_16element_mappings_T2Sampler2D.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_T2Sampler2D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_T2Sampler2D) < 0) __PYX_ERR(0, 974, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "T2Sampler2D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_T2Sampler2D) < 0) __PYX_ERR(0, 974, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_T2Sampler2D) < 0) __PYX_ERR(0, 974, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D = &__pyx_type_2yt_9utilities_3lib_16element_mappings_T2Sampler2D; + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D = &__pyx_vtable_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D.__pyx_base.__pyx_base.sample_at_unit_point = (double (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_sample_at_unit_point; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D.__pyx_base.__pyx_base.check_inside = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_check_inside; + __pyx_vtable_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D.__pyx_base.__pyx_base.check_mesh_lines = (int (*)(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *, double *))__pyx_f_2yt_9utilities_3lib_16element_mappings_13Tet2Sampler3D_check_mesh_lines; + __pyx_type_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D.tp_base = __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D) < 0) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_type_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D) < 0) __PYX_ERR(0, 1023, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Tet2Sampler3D", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D) < 0) __PYX_ERR(0, 1023, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D) < 0) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D = &__pyx_type_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", #if CYTHON_COMPILING_IN_PYPY @@ -11416,14 +18764,28 @@ #else sizeof(PyHeapTypeObject), #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + 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, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ + __pyx_t_1 = __Pyx_ImportModule("yt.utilities.lib.autogenerated_element_samplers"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "Q1Function3D", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Function3D, "void (double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "Q1Jacobian3D", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Jacobian3D, "void (double *, double *, double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "Q1Function2D", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Function2D, "void (double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "Q1Jacobian2D", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q1Jacobian2D, "void (double *, double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "Q2Function2D", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q2Function2D, "void (double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "Q2Jacobian2D", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Q2Jacobian2D, "void (double *, double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "Tet2Function3D", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Tet2Function3D, "void (double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "Tet2Jacobian3D", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_Tet2Jacobian3D, "void (double *, double *, double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "T2Function2D", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_T2Function2D, "void (double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "T2Jacobian2D", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_T2Jacobian2D, "void (double *, double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "W1Function3D", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_W1Function3D, "void (double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "W1Jacobian3D", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_30autogenerated_element_samplers_W1Jacobian3D, "void (double *, double *, double *, double *, double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -11434,94 +18796,186 @@ * cimport cython * import numpy as np # <<<<<<<<<<<<<< * from libc.math cimport fabs - * + * from yt.utilities.lib.autogenerated_element_samplers cimport \ */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/element_mappings.pyx":942 + /* "yt/utilities/lib/element_mappings.pyx":1115 * @cython.wraparound(False) * @cython.cdivision(True) * def test_hex_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] field_values, * np.ndarray[np.float64_t, ndim=1] physical_x): */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_1test_hex_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_hex_sampler, __pyx_t_1) < 0) __PYX_ERR(0, 942, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_1test_hex_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_hex_sampler, __pyx_t_2) < 0) __PYX_ERR(0, 1115, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/element_mappings.pyx":959 + /* "yt/utilities/lib/element_mappings.pyx":1132 * @cython.wraparound(False) * @cython.cdivision(True) * def test_hex20_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] field_values, * np.ndarray[np.float64_t, ndim=1] physical_x): */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_3test_hex20_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_hex20_sampler, __pyx_t_1) < 0) __PYX_ERR(0, 959, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_3test_hex20_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_hex20_sampler, __pyx_t_2) < 0) __PYX_ERR(0, 1132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":1149 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_tetra_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_5test_tetra_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_tetra_sampler, __pyx_t_2) < 0) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":1167 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_wedge_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_7test_wedge_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_wedge_sampler, __pyx_t_2) < 0) __PYX_ERR(0, 1167, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":1184 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_linear1D_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_9test_linear1D_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_linear1D_sampler, __pyx_t_2) < 0) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/element_mappings.pyx":1202 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def test_tri_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_11test_tri_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_tri_sampler, __pyx_t_2) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/element_mappings.pyx":976 + /* "yt/utilities/lib/element_mappings.pyx":1220 * @cython.wraparound(False) * @cython.cdivision(True) - * def test_tetra_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): + * def test_quad_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_5test_tetra_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_tetra_sampler, __pyx_t_1) < 0) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_13test_quad_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_quad_sampler, __pyx_t_2) < 0) __PYX_ERR(0, 1220, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/element_mappings.pyx":994 + /* "yt/utilities/lib/element_mappings.pyx":1237 * @cython.wraparound(False) * @cython.cdivision(True) - * def test_wedge_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * def test_quad2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] field_values, * np.ndarray[np.float64_t, ndim=1] physical_x): */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_7test_wedge_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_wedge_sampler, __pyx_t_1) < 0) __PYX_ERR(0, 994, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_15test_quad2_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_quad2_sampler, __pyx_t_2) < 0) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/element_mappings.pyx":1011 + /* "yt/utilities/lib/element_mappings.pyx":1254 * @cython.wraparound(False) * @cython.cdivision(True) - * def test_tri_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] field_values, - * np.ndarray[np.float64_t, ndim=1] physical_x): + * def test_tri2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] field_values, + * np.ndarray[np.float64_t, ndim=1] physical_x): */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_9test_tri_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_tri_sampler, __pyx_t_1) < 0) __PYX_ERR(0, 1011, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_17test_tri2_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_tri2_sampler, __pyx_t_2) < 0) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/element_mappings.pyx":1029 + /* "yt/utilities/lib/element_mappings.pyx":1271 * @cython.wraparound(False) * @cython.cdivision(True) - * def test_quad_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< + * def test_tet2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] field_values, * np.ndarray[np.float64_t, ndim=1] physical_x): */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_11test_quad_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_quad_sampler, __pyx_t_1) < 0) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_19test_tet2_sampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_tet2_sampler, __pyx_t_2) < 0) __PYX_ERR(0, 1271, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_ElementSampler(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_21__pyx_unpickle_ElementSampler, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ElementSampler, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_ElementSampler__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_ElementSampler__set_state(ElementSampler result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_23__pyx_unpickle_P1Sampler1D, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_P1Sampler1D, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_P1Sampler2D(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xa37a4b3: + * from pickle import PickleError + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_25__pyx_unpickle_P1Sampler2D, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_P1Sampler2D, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_P1Sampler2D__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_P1Sampler2D__set_state(P1Sampler2D result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.inclusion_tol = __pyx_state[0]; result.num_mapped_coords = __pyx_state[1] + * if hasattr(result, '__dict__'): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16element_mappings_27__pyx_unpickle_P1Sampler3D, NULL, __pyx_n_s_yt_utilities_lib_element_mapping_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_P1Sampler3D, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "yt/utilities/lib/element_mappings.pyx":1 * """ # <<<<<<<<<<<<<< * This file contains coordinate mappings between physical coordinates and those * defined on unit elements, as well as doing the corresponding intracell */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 * raise ImportError("numpy.core.umath failed to import") @@ -11536,9 +18990,10 @@ 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 yt.utilities.lib.element_mappings", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.element_mappings", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -11651,8 +19106,54 @@ return 0; } -/* PyObjectCall */ +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +/* GetModuleGlobalName */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +/* 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; @@ -11672,25 +19173,30 @@ #endif /* PyCFunctionFastCall */ -#if CYTHON_FAST_PYCCALL + #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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL + #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { @@ -11806,11 +19312,11 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCallMethO */ -#if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; @@ -11830,7 +19336,7 @@ #endif /* PyObjectCallOneArg */ -#if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); @@ -11847,11 +19353,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -11880,22 +19382,209 @@ if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } -#endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { +#else + if (likely(PyCFunction_Check(func))) { +#endif + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* 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 PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); } +#endif } - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +bad: + Py_XDECREF(owned_instance); + return; } #endif /* RaiseDoubleKeywords */ - static void __Pyx_RaiseDoubleKeywordsError( + static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { @@ -11909,7 +19598,7 @@ } /* ParseKeywords */ - static int __Pyx_ParseOptionalKeywords( + static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, @@ -12011,7 +19700,7 @@ } /* ArgTypeTest */ - static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); @@ -12038,7 +19727,7 @@ } /* BufferFormatCheck */ - static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; } @@ -12587,192 +20276,198 @@ __Pyx_ReleaseBuffer(info); } -/* 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; +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; else { - 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; - } + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; } - __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"); + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) 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)) { + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) goto bad; - } else { - type = instance_class; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); } } + level = 0; } - 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)); + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) goto bad; - } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); +bad: + #if PY_VERSION_HEX < 0x03030000 + 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 } - 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); + return value; +} + +/* GetItemInt */ + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + 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 - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } + 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; } -bad: - Py_XDECREF(owned_instance); - return; + 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)); +} + +/* 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; + } +} /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { @@ -12918,78 +20613,103 @@ return -1; } -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (ret < 0) goto BAD; } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif + PyType_Modified((PyTypeObject*)type_obj); } } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; + goto GOOD; +BAD: + if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +GOOD: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif } /* CodeObjectCache */ @@ -13132,12 +20852,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -13153,28 +20876,7 @@ Py_XDECREF(py_frame); } -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { - if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); - PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); - return -1; -} -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject *obj = view->obj; - if (!obj) return; - if (PyObject_CheckBuffer(obj)) { - PyBuffer_Release(view); - return; - } - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } - Py_DECREF(obj); - view->obj = NULL; -} -#endif - - - /* CIntToPy */ +/* 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; @@ -13227,6 +20929,58 @@ return (target_type) value;\ } +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + Py_DECREF(obj); + view->obj = NULL; +} +#endif + + + /* 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 @@ -13757,37 +21511,6 @@ return (int) -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 long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; @@ -14076,6 +21799,60 @@ } #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) { @@ -14102,6 +21879,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -14110,11 +21889,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/element_mappings.pxd yt-3.4.0/yt/utilities/lib/element_mappings.pxd --- yt-3.3.3/yt/utilities/lib/element_mappings.pxd 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/element_mappings.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -13,7 +13,7 @@ cdef int num_mapped_coords cdef void map_real_to_unit(self, - double* mapped_x, + double* mapped_x, double* vertices, double* physical_x) nogil @@ -21,7 +21,7 @@ cdef double sample_at_unit_point(self, double* coord, double* vals) nogil - + cdef double sample_at_real_point(self, double* vertices, @@ -33,10 +33,25 @@ cdef int check_mesh_lines(self, double* mapped_coord) nogil +cdef class P1Sampler1D(ElementSampler): + + cdef void map_real_to_unit(self, + double* mapped_x, + double* vertices, + double* physical_x) nogil + + + cdef double sample_at_unit_point(self, + double* coord, + double* vals) nogil + + cdef int check_inside(self, double* mapped_coord) nogil + + cdef class P1Sampler2D(ElementSampler): cdef void map_real_to_unit(self, - double* mapped_x, + double* mapped_x, double* vertices, double* physical_x) nogil @@ -51,7 +66,7 @@ cdef class P1Sampler3D(ElementSampler): cdef void map_real_to_unit(self, - double* mapped_x, + double* mapped_x, double* vertices, double* physical_x) nogil @@ -67,7 +82,7 @@ # This typedef defines a function pointer that defines the system # of equations that will be solved by the NonlinearSolveSamplers. -# +# # inputs: # x - pointer to the mapped coordinate # vertices - pointer to the element vertices @@ -78,15 +93,15 @@ # fx - the result of solving the system, should be close to 0 # once it is converged. # -ctypedef void (*func_type)(double* fx, - double* x, - double* vertices, +ctypedef void (*func_type)(double* fx, + double* x, + double* vertices, double* phys_x) nogil # This typedef defines a function pointer that defines the Jacobian -# matrix used by the NonlinearSolveSampler3D. Subclasses needed to +# matrix used by the NonlinearSolveSampler3D. Subclasses needed to # define a Jacobian function in this form. -# +# # inputs: # x - pointer to the mapped coordinate # vertices - pointer to the element vertices @@ -98,18 +113,18 @@ # scol - the second column of the jacobian # tcol - the third column of the jaocobian # -ctypedef void (*jac_type3D)(double* rcol, - double* scol, - double* tcol, - double* x, - double* vertices, +ctypedef void (*jac_type3D)(double* rcol, + double* scol, + double* tcol, + double* x, + double* vertices, double* phys_x) nogil # This typedef defines a function pointer that defines the Jacobian -# matrix used by the NonlinearSolveSampler2D. Subclasses needed to +# matrix used by the NonlinearSolveSampler2D. Subclasses needed to # define a Jacobian function in this form. -# +# # inputs: # x - pointer to the mapped coordinate # vertices - pointer to the element vertices @@ -117,10 +132,11 @@ # # outputs: # -# A - A flattened array storing the Jacobian matrix -# The order of this array is [J11, J12, J21, J22] +# rcol - the first column of the jacobian +# scol - the second column of the jacobian # -ctypedef void (*jac_type2D)(double* A, +ctypedef void (*jac_type2D)(double* rcol, + double* scol, double* x, double* vertices, double* phys_x) nogil @@ -131,19 +147,19 @@ cdef int dim cdef int max_iter cdef np.float64_t tolerance - cdef func_type func + cdef func_type func cdef jac_type3D jac cdef void map_real_to_unit(self, - double* mapped_x, + double* mapped_x, double* vertices, double* physical_x) nogil - + cdef class Q1Sampler3D(NonlinearSolveSampler3D): cdef void map_real_to_unit(self, - double* mapped_x, + double* mapped_x, double* vertices, double* physical_x) nogil @@ -160,7 +176,7 @@ cdef class W1Sampler3D(NonlinearSolveSampler3D): cdef void map_real_to_unit(self, - double* mapped_x, + double* mapped_x, double* vertices, double* physical_x) nogil @@ -178,7 +194,7 @@ cdef class S2Sampler3D(NonlinearSolveSampler3D): cdef void map_real_to_unit(self, - double* mapped_x, + double* mapped_x, double* vertices, double* physical_x) nogil @@ -198,19 +214,63 @@ cdef int dim cdef int max_iter cdef np.float64_t tolerance - cdef func_type func + cdef func_type func cdef jac_type2D jac cdef void map_real_to_unit(self, - double* mapped_x, + double* mapped_x, double* vertices, double* physical_x) nogil - + cdef class Q1Sampler2D(NonlinearSolveSampler2D): cdef void map_real_to_unit(self, - double* mapped_x, + double* mapped_x, + double* vertices, + double* physical_x) nogil + + + cdef double sample_at_unit_point(self, + double* coord, + double* vals) nogil + + cdef int check_inside(self, double* mapped_coord) nogil + + +cdef class Q2Sampler2D(NonlinearSolveSampler2D): + + cdef void map_real_to_unit(self, + double* mapped_x, + double* vertices, + double* physical_x) nogil + + + cdef double sample_at_unit_point(self, + double* coord, + double* vals) nogil + + cdef int check_inside(self, double* mapped_coord) nogil + + +cdef class T2Sampler2D(NonlinearSolveSampler2D): + + cdef void map_real_to_unit(self, + double* mapped_x, + double* vertices, + double* physical_x) nogil + + + cdef double sample_at_unit_point(self, + double* coord, + double* vals) nogil + + cdef int check_inside(self, double* mapped_coord) nogil + +cdef class Tet2Sampler3D(NonlinearSolveSampler3D): + + cdef void map_real_to_unit(self, + double* mapped_x, double* vertices, double* physical_x) nogil diff -Nru yt-3.3.3/yt/utilities/lib/element_mappings.pyx yt-3.4.0/yt/utilities/lib/element_mappings.pyx --- yt-3.3.3/yt/utilities/lib/element_mappings.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/element_mappings.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -1,6 +1,6 @@ """ This file contains coordinate mappings between physical coordinates and those -defined on unit elements, as well as doing the corresponding intracell +defined on unit elements, as well as doing the corresponding intracell interpolation on finite element data. @@ -19,6 +19,19 @@ cimport cython import numpy as np from libc.math cimport fabs +from yt.utilities.lib.autogenerated_element_samplers cimport \ + Q1Function3D, \ + Q1Jacobian3D, \ + Q1Function2D, \ + Q1Jacobian2D, \ + Q2Function2D, \ + Q2Jacobian2D, \ + W1Function3D, \ + W1Jacobian3D, \ + T2Function2D, \ + T2Jacobian2D, \ + Tet2Function3D, \ + Tet2Jacobian3D cdef extern from "platform_dep.h": double fmax(double x, double y) nogil @@ -26,8 +39,8 @@ @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) -cdef double determinant_3x3(double* col0, - double* col1, +cdef double determinant_3x3(double* col0, + double* col1, double* col2) nogil: return col0[0]*col1[1]*col2[2] - col0[0]*col1[2]*col2[1] - \ col0[1]*col1[0]*col2[2] + col0[1]*col1[2]*col2[0] + \ @@ -42,7 +55,7 @@ cdef int i err = fabs(f[0]) for i in range(1, dim): - err = fmax(err, fabs(f[i])) + err = fmax(err, fabs(f[i])) return err @@ -51,7 +64,7 @@ This is a base class for sampling the value of a finite element solution at an arbitrary point inside a mesh element. In general, this will be done - by transforming the requested physical coordinate into a mapped coordinate + by transforming the requested physical coordinate into a mapped coordinate system, sampling the solution in mapped coordinates, and returning the result. This is not to be used directly; use one of the subclasses instead. @@ -64,11 +77,11 @@ @cython.wraparound(False) @cython.cdivision(True) cdef void map_real_to_unit(self, - double* mapped_x, + double* mapped_x, double* vertices, double* physical_x) nogil: pass - + @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) @@ -104,11 +117,47 @@ return val +cdef class P1Sampler1D(ElementSampler): + ''' + + This implements sampling inside a linear, 1D element. + + ''' + + def __init__(self): + super(P1Sampler1D, self).__init__() + self.num_mapped_coords = 1 + + @cython.boundscheck(False) + @cython.wraparound(False) + @cython.cdivision(True) + cdef void map_real_to_unit(self, double* mapped_x, + double* vertices, double* physical_x) nogil: + mapped_x[0] = -1.0 + 2.0*(physical_x[0] - vertices[0]) / (vertices[1] - vertices[0]) + + @cython.boundscheck(False) + @cython.wraparound(False) + @cython.cdivision(True) + cdef double sample_at_unit_point(self, + double* coord, + double* vals) nogil: + return vals[0] * (1 - coord[0]) / 2.0 + vals[1] * (1.0 + coord[0]) / 2.0 + + @cython.boundscheck(False) + @cython.wraparound(False) + @cython.cdivision(True) + cdef int check_inside(self, double* mapped_coord) nogil: + if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol): + return 0 + return 1 + + cdef class P1Sampler2D(ElementSampler): ''' This implements sampling inside a linear, triangular mesh element. - This mapping is linear and can be inverted easily. + This mapping is linear and can be inverted easily. Note that this + implementation uses triangular (or barycentric) coordinates. ''' @@ -120,43 +169,43 @@ @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) - cdef void map_real_to_unit(self, double* mapped_x, + cdef void map_real_to_unit(self, double* mapped_x, double* vertices, double* physical_x) nogil: - + cdef double[3] col0 cdef double[3] col1 cdef double[3] col2 - + col0[0] = vertices[0] col0[1] = vertices[1] col0[2] = 1.0 - + col1[0] = vertices[2] col1[1] = vertices[3] col1[2] = 1.0 - + col2[0] = vertices[4] col2[1] = vertices[5] col2[2] = 1.0 - + det = determinant_3x3(col0, col1, col2) - + mapped_x[0] = ((vertices[3] - vertices[5])*physical_x[0] + \ (vertices[4] - vertices[2])*physical_x[1] + \ (vertices[2]*vertices[5] - vertices[4]*vertices[3])) / det - + mapped_x[1] = ((vertices[5] - vertices[1])*physical_x[0] + \ (vertices[0] - vertices[4])*physical_x[1] + \ (vertices[4]*vertices[1] - vertices[0]*vertices[5])) / det - + mapped_x[2] = 1.0 - mapped_x[1] - mapped_x[0] - + @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) cdef double sample_at_unit_point(self, - double* coord, + double* coord, double* vals) nogil: return vals[0]*coord[0] + vals[1]*coord[1] + vals[2]*coord[2] @@ -190,16 +239,16 @@ @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) - cdef void map_real_to_unit(self, double* mapped_x, + cdef void map_real_to_unit(self, double* mapped_x, double* vertices, double* physical_x) nogil: - + cdef int i cdef double d cdef double[3] bvec cdef double[3] col0 cdef double[3] col1 cdef double[3] col2 - + # here, we express positions relative to the 4th element, # which is selected by vertices[9] for i in range(3): @@ -207,7 +256,7 @@ col0[i] = vertices[0 + i] - vertices[9 + i] col1[i] = vertices[3 + i] - vertices[9 + i] col2[i] = vertices[6 + i] - vertices[9 + i] - + d = determinant_3x3(col0, col1, col2) mapped_x[0] = determinant_3x3(bvec, col1, col2)/d mapped_x[1] = determinant_3x3(col0, bvec, col2)/d @@ -218,7 +267,7 @@ @cython.wraparound(False) @cython.cdivision(True) cdef double sample_at_unit_point(self, - double* coord, + double* coord, double* vals) nogil: return vals[0]*coord[0] + vals[1]*coord[1] + \ vals[2]*coord[2] + vals[3]*coord[3] @@ -258,11 +307,11 @@ u = mapped_coord[1] v = mapped_coord[2] w = mapped_coord[0] - if ((u < thresh) or - (v < thresh) or + if ((u < thresh) or + (v < thresh) or (w < thresh) or - (fabs(u - 1) < thresh) or - (fabs(v - 1) < thresh) or + (fabs(u - 1) < thresh) or + (fabs(v - 1) < thresh) or (fabs(w - 1) < thresh)): return 1 return -1 @@ -274,7 +323,7 @@ This is a base class for handling element samplers that require a nonlinear solve to invert the mapping between coordinate systems. - To do this, we perform Newton-Raphson iteration using a specified + To do this, we perform Newton-Raphson iteration using a specified system of equations with an analytic Jacobian matrix. This solver is hard-coded for 3D for reasons of efficiency. This is not to be used directly, use one of the subclasses instead. @@ -293,36 +342,80 @@ double* mapped_x, double* vertices, double* physical_x) nogil: + ''' + + A thorough description of Newton's method and modifications for global + convergence can be found in Dennis's text "Numerical Methods for + Unconstrained Optimization and Nonlinear Equations." + + x: solution vector; holds unit/mapped coordinates + xk: temporary vector for holding solution of current iteration + f: residual vector + r, s, t: three columns of Jacobian matrix corresponding to unit/mapped + coordinates r, s, and t + d: Jacobian determinant + s_n: Newton step vector + lam: fraction of Newton step by which to change x + alpha: constant proportional to how much residual required to decrease. + 1e-4 is value of alpha recommended by Dennis + err_c: Error of current iteration + err_plus: Error of next iteration + min_lam: minimum fraction of Newton step that the line search is allowed + to take. General experience suggests that lambda values smaller + than 1e-3 will not significantly reduce the residual, but we + set to 1e-6 just to be safe + ''' + cdef int i - cdef double d - cdef double[3] f + cdef double d, lam + cdef double[3] f cdef double[3] r cdef double[3] s cdef double[3] t - cdef double[3] x + cdef double[3] x, xk, s_n cdef int iterations = 0 - cdef double err + cdef double err_c, err_plus + cdef double alpha = 1e-4 + cdef double min_lam = 1e-6 # initial guess for i in range(3): x[i] = 0.0 - + # initial error norm self.func(f, x, vertices, physical_x) - err = maxnorm(f, 3) - + err_c = maxnorm(f, 3) + # begin Newton iteration - while (err > self.tolerance and iterations < self.max_iter): + while (err_c > self.tolerance and iterations < self.max_iter): self.jac(r, s, t, x, vertices, physical_x) d = determinant_3x3(r, s, t) - x[0] = x[0] - (determinant_3x3(f, s, t)/d) - x[1] = x[1] - (determinant_3x3(r, f, t)/d) - x[2] = x[2] - (determinant_3x3(r, s, f)/d) - self.func(f, x, vertices, physical_x) - err = maxnorm(f, 3) + + s_n[0] = - (determinant_3x3(f, s, t)/d) + s_n[1] = - (determinant_3x3(r, f, t)/d) + s_n[2] = - (determinant_3x3(r, s, f)/d) + xk[0] = x[0] + s_n[0] + xk[1] = x[1] + s_n[1] + xk[2] = x[2] + s_n[2] + self.func(f, xk, vertices, physical_x) + err_plus = maxnorm(f, 3) + + lam = 1 + while err_plus > err_c * (1. - alpha * lam) and lam > min_lam: + lam = lam / 2 + xk[0] = x[0] + lam * s_n[0] + xk[1] = x[1] + lam * s_n[1] + xk[2] = x[2] + lam * s_n[2] + self.func(f, xk, vertices, physical_x) + err_plus = maxnorm(f, 3) + + x[0] = xk[0] + x[1] = xk[1] + x[2] = xk[2] + err_c = err_plus iterations += 1 - if (err > self.tolerance): + if (err_c > self.tolerance): # we did not converge, set bogus value for i in range(3): mapped_x[i] = -99.0 @@ -333,7 +426,7 @@ cdef class Q1Sampler3D(NonlinearSolveSampler3D): - ''' + ''' This implements sampling inside a 3D, linear, hexahedral mesh element. @@ -351,14 +444,14 @@ @cython.cdivision(True) cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: cdef double F, rm, rp, sm, sp, tm, tp - + rm = 1.0 - coord[0] rp = 1.0 + coord[0] sm = 1.0 - coord[1] sp = 1.0 + coord[1] tm = 1.0 - coord[2] tp = 1.0 + coord[2] - + F = vals[0]*rm*sm*tm + vals[1]*rp*sm*tm + vals[2]*rp*sp*tm + vals[3]*rm*sp*tm + \ vals[4]*rm*sm*tp + vals[5]*rp*sm*tp + vals[6]*rp*sp*tp + vals[7]*rm*sp*tp return 0.125*F @@ -367,10 +460,10 @@ @cython.wraparound(False) @cython.cdivision(True) cdef int check_inside(self, double* mapped_coord) nogil: - # for hexes, the mapped coordinates all go from -1 to 1 + # for hexes, the mapped coordinates all go from -1 to 1 # if we are inside the element. if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or - fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): return 0 return 1 @@ -392,73 +485,9 @@ return -1 - -@cython.boundscheck(False) -@cython.wraparound(False) -@cython.cdivision(True) -cdef inline void Q1Function3D(double* fx, - double* x, - double* vertices, - double* phys_x) nogil: - cdef int i - cdef double rm, rp, sm, sp, tm, tp - - rm = 1.0 - x[0] - rp = 1.0 + x[0] - sm = 1.0 - x[1] - sp = 1.0 + x[1] - tm = 1.0 - x[2] - tp = 1.0 + x[2] - - for i in range(3): - fx[i] = vertices[0 + i]*rm*sm*tm \ - + vertices[3 + i]*rp*sm*tm \ - + vertices[6 + i]*rp*sp*tm \ - + vertices[9 + i]*rm*sp*tm \ - + vertices[12 + i]*rm*sm*tp \ - + vertices[15 + i]*rp*sm*tp \ - + vertices[18 + i]*rp*sp*tp \ - + vertices[21 + i]*rm*sp*tp \ - - 8.0*phys_x[i] - - -@cython.boundscheck(False) -@cython.wraparound(False) -@cython.cdivision(True) -cdef inline void Q1Jacobian3D(double* rcol, - double* scol, - double* tcol, - double* x, - double* vertices, - double* phys_x) nogil: - cdef int i - cdef double rm, rp, sm, sp, tm, tp - - rm = 1.0 - x[0] - rp = 1.0 + x[0] - sm = 1.0 - x[1] - sp = 1.0 + x[1] - tm = 1.0 - x[2] - tp = 1.0 + x[2] - - for i in range(3): - rcol[i] = -sm*tm*vertices[0 + i] + sm*tm*vertices[3 + i] + \ - sp*tm*vertices[6 + i] - sp*tm*vertices[9 + i] - \ - sm*tp*vertices[12 + i] + sm*tp*vertices[15 + i] + \ - sp*tp*vertices[18 + i] - sp*tp*vertices[21 + i] - scol[i] = -rm*tm*vertices[0 + i] - rp*tm*vertices[3 + i] + \ - rp*tm*vertices[6 + i] + rm*tm*vertices[9 + i] - \ - rm*tp*vertices[12 + i] - rp*tp*vertices[15 + i] + \ - rp*tp*vertices[18 + i] + rm*tp*vertices[21 + i] - tcol[i] = -rm*sm*vertices[0 + i] - rp*sm*vertices[3 + i] - \ - rp*sp*vertices[6 + i] - rm*sp*vertices[9 + i] + \ - rm*sm*vertices[12 + i] + rp*sm*vertices[15 + i] + \ - rp*sp*vertices[18 + i] + rm*sp*vertices[21 + i] - - cdef class S2Sampler3D(NonlinearSolveSampler3D): - ''' + ''' This implements sampling inside a 3D, 20-node hexahedral mesh element. @@ -497,18 +526,18 @@ + rp*sm*tp*( r - s + t - 2.0)*vals[5] \ + rp*sp*tp*( r + s + t - 2.0)*vals[6] \ + rm*sp*tp*(-r + s + t - 2.0)*vals[7] \ - + 2.0*(1.0 - r**2)*sm*tm*vals[8] \ - + 2.0*rp*(1.0 - s**2)*tm*vals[9] \ - + 2.0*(1.0 - r**2)*sp*tm*vals[10] \ - + 2.0*rm*(1.0 - s**2)*tm*vals[11] \ - + 2.0*rm*sm*(1.0 - t**2)*vals[12] \ - + 2.0*rp*sm*(1.0 - t**2)*vals[13] \ - + 2.0*rp*sp*(1.0 - t**2)*vals[14] \ - + 2.0*rm*sp*(1.0 - t**2)*vals[15] \ - + 2.0*(1.0 - r**2)*sm*tp*vals[16] \ - + 2.0*rp*(1.0 - s**2)*tp*vals[17] \ - + 2.0*(1.0 - r**2)*sp*tp*vals[18] \ - + 2.0*rm*(1.0 - s**2)*tp*vals[19] + + 2.0*(1.0 - r*r)*sm*tm*vals[8] \ + + 2.0*rp*(1.0 - s*s)*tm*vals[9] \ + + 2.0*(1.0 - r*r)*sp*tm*vals[10] \ + + 2.0*rm*(1.0 - s*s)*tm*vals[11] \ + + 2.0*rm*sm*(1.0 - t*t)*vals[12] \ + + 2.0*rp*sm*(1.0 - t*t)*vals[13] \ + + 2.0*rp*sp*(1.0 - t*t)*vals[14] \ + + 2.0*rm*sp*(1.0 - t*t)*vals[15] \ + + 2.0*(1.0 - r*r)*sm*tp*vals[16] \ + + 2.0*rp*(1.0 - s*s)*tp*vals[17] \ + + 2.0*(1.0 - r*r)*sp*tp*vals[18] \ + + 2.0*rm*(1.0 - s*s)*tp*vals[19] return 0.125*F @cython.boundscheck(False) @@ -516,7 +545,7 @@ @cython.cdivision(True) cdef int check_inside(self, double* mapped_coord) nogil: if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or - fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or + fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol or fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): return 0 return 1 @@ -542,8 +571,8 @@ @cython.wraparound(False) @cython.cdivision(True) cdef inline void S2Function3D(double* fx, - double* x, - double* vertices, + double* x, + double* vertices, double* phys_x) nogil: cdef int i cdef double r, s, t, rm, rp, sm, sp, tm, tp @@ -569,18 +598,18 @@ + rp*sm*tp*( r - s + t - 2.0)*vertices[15 + i] \ + rp*sp*tp*( r + s + t - 2.0)*vertices[18 + i] \ + rm*sp*tp*(-r + s + t - 2.0)*vertices[21 + i] \ - + 2.0*(1.0 - r**2)*sm*tm*vertices[24 + i] \ - + 2.0*rp*(1.0 - s**2)*tm*vertices[27 + i] \ - + 2.0*(1.0 - r**2)*sp*tm*vertices[30 + i] \ - + 2.0*rm*(1.0 - s**2)*tm*vertices[33 + i] \ - + 2.0*rm*sm*(1.0 - t**2)*vertices[36 + i] \ - + 2.0*rp*sm*(1.0 - t**2)*vertices[39 + i] \ - + 2.0*rp*sp*(1.0 - t**2)*vertices[42 + i] \ - + 2.0*rm*sp*(1.0 - t**2)*vertices[45 + i] \ - + 2.0*(1.0 - r**2)*sm*tp*vertices[48 + i] \ - + 2.0*rp*(1.0 - s**2)*tp*vertices[51 + i] \ - + 2.0*(1.0 - r**2)*sp*tp*vertices[54 + i] \ - + 2.0*rm*(1.0 - s**2)*tp*vertices[57 + i] \ + + 2.0*(1.0 - r*r)*sm*tm*vertices[24 + i] \ + + 2.0*rp*(1.0 - s*s)*tm*vertices[27 + i] \ + + 2.0*(1.0 - r*r)*sp*tm*vertices[30 + i] \ + + 2.0*rm*(1.0 - s*s)*tm*vertices[33 + i] \ + + 2.0*rm*sm*(1.0 - t*t)*vertices[36 + i] \ + + 2.0*rp*sm*(1.0 - t*t)*vertices[39 + i] \ + + 2.0*rp*sp*(1.0 - t*t)*vertices[42 + i] \ + + 2.0*rm*sp*(1.0 - t*t)*vertices[45 + i] \ + + 2.0*(1.0 - r*r)*sm*tp*vertices[48 + i] \ + + 2.0*rp*(1.0 - s*s)*tp*vertices[51 + i] \ + + 2.0*(1.0 - r*r)*sp*tp*vertices[54 + i] \ + + 2.0*rm*(1.0 - s*s)*tp*vertices[57 + i] \ - 8.0*phys_x[i] @@ -590,9 +619,9 @@ cdef inline void S2Jacobian3D(double* rcol, double* scol, double* tcol, - double* x, - double* vertices, - double* phys_x) nogil: + double* x, + double* vertices, + double* phys_x) nogil: cdef int i cdef double r, s, t, rm, rp, sm, sp, tm, tp @@ -618,17 +647,17 @@ + (sp*tp*(r + s + t - 2.0) + rp*sp*tp)*vertices[18 + i] \ + (sp*tp*(r - s - t + 2.0) - rm*sp*tp)*vertices[21 + i] \ - 4.0*r*sm*tm*vertices[24 + i] \ - + 2.0*(1.0 - s**2)*tm*vertices[27 + i] \ + + 2.0*(1.0 - s*s)*tm*vertices[27 + i] \ - 4.0*r*sp*tm*vertices[30 + i] \ - - 2.0*(1.0 - s**2)*tm*vertices[33 + i] \ - - 2.0*sm*(1.0 - t**2)*vertices[36 + i] \ - + 2.0*sm*(1.0 - t**2)*vertices[39 + i] \ - + 2.0*sp*(1.0 - t**2)*vertices[42 + i] \ - - 2.0*sp*(1.0 - t**2)*vertices[45 + i] \ + - 2.0*(1.0 - s*s)*tm*vertices[33 + i] \ + - 2.0*sm*(1.0 - t*t)*vertices[36 + i] \ + + 2.0*sm*(1.0 - t*t)*vertices[39 + i] \ + + 2.0*sp*(1.0 - t*t)*vertices[42 + i] \ + - 2.0*sp*(1.0 - t*t)*vertices[45 + i] \ - 4.0*r*sm*tp*vertices[48 + i] \ - + 2.0*(1.0 - s**2)*tp*vertices[51 + i] \ + + 2.0*(1.0 - s*s)*tp*vertices[51 + i] \ - 4.0*r*sp*tp*vertices[54 + i] \ - - 2.0*(1.0 - s**2)*tp*vertices[57 + i] + - 2.0*(1.0 - s*s)*tp*vertices[57 + i] scol[i] = ( rm*tm*(r + s + t + 2.0) - rm*sm*tm)*vertices[0 + i] \ + (-rp*tm*(r - s - t - 2.0) - rp*sm*tm)*vertices[3 + i] \ + ( rp*tm*(r + s - t - 2.0) + rp*sp*tm)*vertices[6 + i] \ @@ -637,17 +666,17 @@ + (-rp*tp*(r - s + t - 2.0) - rp*sm*tp)*vertices[15 + i] \ + ( rp*tp*(r + s + t - 2.0) + rp*sp*tp)*vertices[18 + i] \ + (-rm*tp*(r - s - t + 2.0) + rm*sp*tp)*vertices[21 + i] \ - - 2.0*(1.0 - r**2)*tm*vertices[24 + i] \ + - 2.0*(1.0 - r*r)*tm*vertices[24 + i] \ - 4.0*rp*s*tm*vertices[27 + i] \ - + 2.0*(1.0 - r**2)*tm*vertices[30 + i] \ + + 2.0*(1.0 - r*r)*tm*vertices[30 + i] \ - 4.0*rm*s*tm*vertices[33 + i] \ - - 2.0*rm*(1.0 - t**2)*vertices[36 + i] \ - - 2.0*rp*(1.0 - t**2)*vertices[39 + i] \ - + 2.0*rp*(1.0 - t**2)*vertices[42 + i] \ - + 2.0*rm*(1.0 - t**2)*vertices[45 + i] \ - - 2.0*(1.0 - r**2)*tp*vertices[48 + i] \ + - 2.0*rm*(1.0 - t*t)*vertices[36 + i] \ + - 2.0*rp*(1.0 - t*t)*vertices[39 + i] \ + + 2.0*rp*(1.0 - t*t)*vertices[42 + i] \ + + 2.0*rm*(1.0 - t*t)*vertices[45 + i] \ + - 2.0*(1.0 - r*r)*tp*vertices[48 + i] \ - 4.0*rp*s*tp*vertices[51 + i] \ - + 2.0*(1.0 - r**2)*tp*vertices[54 + i] \ + + 2.0*(1.0 - r*r)*tp*vertices[54 + i] \ - 4.0*rm*s*tp*vertices[57 + i] tcol[i] = ( rm*sm*(r + s + t + 2.0) - rm*sm*tm)*vertices[0 + i] \ + (-rp*sm*(r - s - t - 2.0) - rp*sm*tm)*vertices[3 + i] \ @@ -657,23 +686,23 @@ + ( rp*sm*(r - s + t - 2.0) + rp*sm*tp)*vertices[15 + i] \ + ( rp*sp*(r + s + t - 2.0) + rp*sp*tp)*vertices[18 + i] \ + (-rm*sp*(r - s - t + 2.0) + rm*sp*tp)*vertices[21 + i] \ - - 2.0*(1.0 - r**2)*sm*vertices[24 + i] \ - - 2.0*rp*(1.0 - s**2)*vertices[27 + i] \ - - 2.0*(1.0 - r**2)*sp*vertices[30 + i] \ - - 2.0*rm*(1.0 - s**2)*vertices[33 + i] \ + - 2.0*(1.0 - r*r)*sm*vertices[24 + i] \ + - 2.0*rp*(1.0 - s*s)*vertices[27 + i] \ + - 2.0*(1.0 - r*r)*sp*vertices[30 + i] \ + - 2.0*rm*(1.0 - s*s)*vertices[33 + i] \ - 4.0*rm*sm*t*vertices[36 + i] \ - 4.0*rp*sm*t*vertices[39 + i] \ - 4.0*rp*sp*t*vertices[42 + i] \ - 4.0*rm*sp*t*vertices[45 + i] \ - + 2.0*(1.0 - r**2)*sm*vertices[48 + i] \ - + 2.0*rp*(1.0 - s**2)*vertices[51 + i] \ - + 2.0*(1.0 - r**2)*sp*vertices[54 + i] \ - + 2.0*rm*(1.0 - s**2)*vertices[57 + i] + + 2.0*(1.0 - r*r)*sm*vertices[48 + i] \ + + 2.0*rp*(1.0 - s*s)*vertices[51 + i] \ + + 2.0*(1.0 - r*r)*sp*vertices[54 + i] \ + + 2.0*rm*(1.0 - s*s)*vertices[57 + i] cdef class W1Sampler3D(NonlinearSolveSampler3D): - ''' + ''' This implements sampling inside a 3D, linear, wedge mesh element. @@ -705,15 +734,15 @@ @cython.wraparound(False) @cython.cdivision(True) cdef int check_inside(self, double* mapped_coord) nogil: - # for wedges the bounds of the mapped coordinates are: + # for wedges the bounds of the mapped coordinates are: # 0 <= mapped_coord[0] <= 1 - mapped_coord[1] # 0 <= mapped_coord[1] # -1 <= mapped_coord[2] <= 1 if (mapped_coord[0] < -self.inclusion_tol or mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): - return 0 + return 0 if (mapped_coord[1] < -self.inclusion_tol): - return 0 + return 0 if (fabs(mapped_coord[2]) - 1.0 > self.inclusion_tol): return 0 return 1 @@ -732,7 +761,7 @@ near_edge_r = (r < thresh) or (fabs(r + s - 1.0) < thresh) near_edge_s = (s < thresh) near_edge_t = fabs(fabs(mapped_coord[2]) - 1.0) < thresh - + # we use ray.instID to pass back whether the ray is near the # element boundary or not (used to annotate mesh lines) if (near_edge_r and near_edge_s): @@ -745,59 +774,13 @@ return -1 -@cython.boundscheck(False) -@cython.wraparound(False) -@cython.cdivision(True) -cdef inline void W1Function3D(double* fx, - double* x, - double* vertices, - double* phys_x) nogil: - cdef int i - for i in range(3): - fx[i] = vertices[0 + i]*(1.0 - x[0] - x[1])*(1.0 - x[2]) \ - + vertices[3 + i]*x[0]*(1.0 - x[2]) \ - + vertices[6 + i]*x[1]*(1.0 - x[2]) \ - + vertices[9 + i]*(1.0 - x[0] - x[1])*(1.0 + x[2]) \ - + vertices[12 + i]*x[0]*(1.0 + x[2]) \ - + vertices[15 + i]*x[1]*(1.0 + x[2]) \ - - 2.0*phys_x[i] - - -@cython.boundscheck(False) -@cython.wraparound(False) -@cython.cdivision(True) -cdef inline void W1Jacobian3D(double* rcol, - double* scol, - double* tcol, - double* x, - double* vertices, - double* phys_x) nogil: - - cdef int i - for i in range(3): - rcol[i] = (x[2] - 1.0) * vertices[0 + i] \ - - (x[2] - 1.0) * vertices[3 + i] \ - - (x[2] + 1.0) * vertices[9 + i] \ - + (x[2] + 1.0) * vertices[12 + i] - scol[i] = (x[2] - 1.0) * vertices[0 + i] \ - - (x[2] - 1.0) * vertices[6 + i] \ - - (x[2] + 1.0) * vertices[9 + i] \ - + (x[2] + 1.0) * vertices[15 + i] - tcol[i] = (x[0] + x[1] - 1.0) * vertices[0 + i] \ - - x[0] * vertices[3 + i] \ - - x[1] * vertices[6 + i] \ - - (x[0] + x[1] - 1.0) * vertices[9 + i] \ - + x[0] * vertices[12 + i] \ - + x[1] * vertices[15 + i] - - cdef class NonlinearSolveSampler2D(ElementSampler): ''' This is a base class for handling element samplers that require a nonlinear solve to invert the mapping between coordinate systems. - To do this, we perform Newton-Raphson iteration using a specified + To do this, we perform Newton-Raphson iteration using a specified system of equations with an analytic Jacobian matrix. This solver is hard-coded for 2D for reasons of efficiency. This is not to be used directly, use one of the subclasses instead. @@ -816,35 +799,73 @@ double* mapped_x, double* vertices, double* physical_x) nogil: + ''' + + A thorough description of Newton's method and modifications for global + convergence can be found in Dennis's text "Numerical Methods for + Unconstrained Optimization and Nonlinear Equations." + + x: solution vector; holds unit/mapped coordinates + xk: temporary vector for holding solution of current iteration + f: residual vector + A: Jacobian matrix (derivative of residual vector wrt x) + d: Jacobian determinant + s_n: Newton step vector + lam: fraction of Newton step by which to change x + alpha: constant proportional to how much residual required to decrease. + 1e-4 is value of alpha recommended by Dennis + err_c: Error of current iteration + err_plus: Error of next iteration + min_lam: minimum fraction of Newton step that the line search is allowed + to take. General experience suggests that lambda values smaller + than 1e-3 will not significantly reduce the residual, but we + set to 1e-6 just to be safe + ''' + cdef int i - cdef double d + cdef double d, lam cdef double[2] f - cdef double[2] x + cdef double[2] x, xk, s_n cdef double[4] A cdef int iterations = 0 - cdef double err + cdef double err_c, err_plus + cdef double alpha = 1e-4 + cdef double min_lam = 1e-6 # initial guess for i in range(2): x[i] = 0.0 - + # initial error norm self.func(f, x, vertices, physical_x) - err = maxnorm(f, 2) - + err_c = maxnorm(f, 2) + # begin Newton iteration - while (err > self.tolerance and iterations < self.max_iter): - self.jac(A, x, vertices, physical_x) + while (err_c > self.tolerance and iterations < self.max_iter): + self.jac(&A[0], &A[2], x, vertices, physical_x) d = (A[0]*A[3] - A[1]*A[2]) - - x[0] -= ( A[3]*f[0] - A[1]*f[1]) / d - x[1] -= (-A[2]*f[0] + A[0]*f[1]) / d - self.func(f, x, vertices, physical_x) - err = maxnorm(f, 2) + s_n[0] = -( A[3]*f[0] - A[2]*f[1]) / d + s_n[1] = -(-A[1]*f[0] + A[0]*f[1]) / d + xk[0] = x[0] + s_n[0] + xk[1] = x[1] + s_n[1] + self.func(f, xk, vertices, physical_x) + err_plus = maxnorm(f, 2) + + lam = 1 + while err_plus > err_c * (1. - alpha * lam) and lam > min_lam: + lam = lam / 2 + xk[0] = x[0] + lam * s_n[0] + xk[1] = x[1] + lam * s_n[1] + self.func(f, xk, vertices, physical_x) + err_plus = maxnorm(f, 2) + + x[0] = xk[0] + x[1] = xk[1] + err_c = err_plus iterations += 1 - if (err > self.tolerance): + if (err_c > self.tolerance): # we did not converge, set bogus value for i in range(2): mapped_x[i] = -99.0 @@ -855,7 +876,7 @@ cdef class Q1Sampler2D(NonlinearSolveSampler2D): - ''' + ''' This implements sampling inside a 2D, linear, quadrilateral mesh element. @@ -873,12 +894,12 @@ @cython.cdivision(True) cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: cdef double F, rm, rp, sm, sp - + rm = 1.0 - coord[0] rp = 1.0 + coord[0] sm = 1.0 - coord[1] sp = 1.0 + coord[1] - + F = vals[0]*rm*sm + vals[1]*rp*sm + vals[2]*rp*sp + vals[3]*rm*sp return 0.25*F @@ -893,48 +914,200 @@ return 0 return 1 -@cython.boundscheck(False) -@cython.wraparound(False) -@cython.cdivision(True) -cdef inline void Q1Jacobian2D(double* A, - double* x, - double* vertices, - double* phys_x) nogil: - cdef double rm, rp, sm, sp +cdef class Q2Sampler2D(NonlinearSolveSampler2D): + + ''' + + This implements sampling inside a 2D, quadratic, quadrilateral mesh element. + + ''' + + def __init__(self): + super(Q2Sampler2D, self).__init__() + self.num_mapped_coords = 2 + self.dim = 2 + self.func = Q2Function2D + self.jac = Q2Jacobian2D + + @cython.boundscheck(False) + @cython.wraparound(False) + @cython.cdivision(True) + cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: + cdef double F, rm, rp, sm, sp + cdef double[9] phi + cdef double rv = 0 + + zet = coord[0] + eta = coord[1] + zetm = coord[0] - 1. + zetp = coord[0] + 1. + etam = coord[1] - 1. + etap = coord[1] + 1. + + phi[0] = zet * zetm * eta * etam / 4. + phi[1] = zet * zetp * eta * etam / 4. + phi[2] = zet * zetp * eta * etap / 4. + phi[3] = zet * zetm * eta * etap / 4. + phi[4] = zetp * zetm * eta * etam / -2. + phi[5] = zet * zetp * etap * etam / -2. + phi[6] = zetp * zetm * eta * etap / -2. + phi[7] = zet * zetm * etap * etam / -2. + phi[8] = zetp * zetm * etap * etam + + for i in range(9): + rv += vals[i] * phi[i] + + return rv + + @cython.boundscheck(False) + @cython.wraparound(False) + @cython.cdivision(True) + cdef int check_inside(self, double* mapped_coord) nogil: + # for quads, we check whether the mapped_coord is between + # -1 and 1 in both directions. + if (fabs(mapped_coord[0]) - 1.0 > self.inclusion_tol or + fabs(mapped_coord[1]) - 1.0 > self.inclusion_tol): + return 0 + return 1 - rm = 1.0 - x[0] - rp = 1.0 + x[0] - sm = 1.0 - x[1] - sp = 1.0 + x[1] - - A[0] = -sm*vertices[0] + sm*vertices[2] + sp*vertices[4] - sp*vertices[6] - A[1] = -rm*vertices[0] - rp*vertices[2] + rp*vertices[4] + rm*vertices[6] - A[2] = -sm*vertices[1] + sm*vertices[3] + sp*vertices[5] - sp*vertices[7] - A[3] = -rm*vertices[1] - rp*vertices[3] + rp*vertices[5] + rm*vertices[7] - -@cython.boundscheck(False) -@cython.wraparound(False) -@cython.cdivision(True) -cdef inline void Q1Function2D(double* fx, - double* x, - double* vertices, - double* phys_x) nogil: - cdef int i - cdef double rm, rp, sm, sp +cdef class T2Sampler2D(NonlinearSolveSampler2D): + + ''' - rm = 1.0 - x[0] - rp = 1.0 + x[0] - sm = 1.0 - x[1] - sp = 1.0 + x[1] - - for i in range(2): - fx[i] = vertices[0 + i]*rm*sm \ - + vertices[2 + i]*rp*sm \ - + vertices[4 + i]*rp*sp \ - + vertices[6 + i]*rm*sp \ - - 4.0*phys_x[i] + This implements sampling inside a 2D, quadratic, triangular mesh + element. Note that this implementation uses canonical coordinates. + ''' + + def __init__(self): + super(T2Sampler2D, self).__init__() + self.num_mapped_coords = 2 + self.dim = 2 + self.func = T2Function2D + self.jac = T2Jacobian2D + + @cython.boundscheck(False) + @cython.wraparound(False) + @cython.cdivision(True) + cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: + cdef double phi0, phi1, phi2, phi3, phi4, phi5, c0sq, c1sq, c0c1 + + c0sq = coord[0] * coord[0] + c1sq = coord[1] * coord[1] + c0c1 = coord[0] * coord[1] + + phi0 = 1 - 3 * coord[0] + 2 * c0sq - 3 * coord[1] + \ + 2 * c1sq + 4 * c0c1 + phi1 = -coord[0] + 2 * c0sq + phi2 = -coord[1] + 2 * c1sq + phi3 = 4 * coord[0] - 4 * c0sq - 4 * c0c1 + phi4 = 4 * c0c1 + phi5 = 4 * coord[1] - 4 * c1sq - 4 * c0c1 + + return vals[0]*phi0 + vals[1]*phi1 + vals[2]*phi2 + vals[3]*phi3 + \ + vals[4]*phi4 + vals[5]*phi5 + + @cython.boundscheck(False) + @cython.wraparound(False) + @cython.cdivision(True) + cdef int check_inside(self, double* mapped_coord) nogil: + # for canonical tris, we check whether the mapped_coords are between + # 0 and 1. + if (mapped_coord[0] < -self.inclusion_tol or \ + mapped_coord[1] < -self.inclusion_tol or \ + mapped_coord[0] + mapped_coord[1] - 1.0 > self.inclusion_tol): + return 0 + return 1 + +cdef class Tet2Sampler3D(NonlinearSolveSampler3D): + + ''' + + This implements sampling inside a 3D, quadratic, tetrahedral mesh + element. Note that this implementation uses canonical coordinates. + + ''' + + def __init__(self): + super(Tet2Sampler3D, self).__init__() + self.num_mapped_coords = 3 + self.dim = 3 + self.func = Tet2Function3D + self.jac = Tet2Jacobian3D + + @cython.boundscheck(False) + @cython.wraparound(False) + @cython.cdivision(True) + cdef double sample_at_unit_point(self, double* coord, double* vals) nogil: + cdef double[10] phi + cdef double coordsq[3] + cdef int i + cdef double return_value = 0 + + for i in range(3): + coordsq[i] = coord[i] * coord[i] + + phi[0] = 1 - 3 * coord[0] + 2 * coordsq[0] - 3 * coord[1] + \ + 2 * coordsq[1] - 3 * coord[2] + 2 * coordsq[2] + \ + 4 * coord[0] * coord[1] + 4 * coord[0] * coord[2] + \ + 4 * coord[1] * coord[2] + phi[1] = -coord[0] + 2 * coordsq[0] + phi[2] = -coord[1] + 2 * coordsq[1] + phi[3] = -coord[2] + 2 * coordsq[2] + phi[4] = 4 * coord[0] - 4 * coordsq[0] - 4 * coord[0] * coord[1] - \ + 4 * coord[0] * coord[2] + phi[5] = 4 * coord[0] * coord[1] + phi[6] = 4 * coord[1] - 4 * coordsq[1] - 4 * coord[0] * coord[1] - \ + 4 * coord[1] * coord[2] + phi[7] = 4 * coord[2] - 4 * coordsq[2] - 4 * coord[2] * coord[0] - \ + 4 * coord[2] * coord[1] + phi[8] = 4 * coord[0] * coord[2] + phi[9] = 4 * coord[1] * coord[2] + + for i in range(10): + return_value += phi[i] * vals[i] + + return return_value + + @cython.boundscheck(False) + @cython.wraparound(False) + @cython.cdivision(True) + cdef int check_inside(self, double* mapped_coord) nogil: + # for canonical tets, we check whether the mapped_coords are between + # 0 and 1. + if (mapped_coord[0] < -self.inclusion_tol or \ + mapped_coord[1] < -self.inclusion_tol or \ + mapped_coord[2] < -self.inclusion_tol or \ + mapped_coord[0] + mapped_coord[1] + mapped_coord[2] - 1.0 > \ + self.inclusion_tol): + return 0 + return 1 + + @cython.boundscheck(False) + @cython.wraparound(False) + @cython.cdivision(True) + cdef int check_mesh_lines(self, double* mapped_coord) nogil: + cdef double u, v + cdef double thresh = 2.0e-2 + if mapped_coord[0] == 0: + u = mapped_coord[1] + v = mapped_coord[2] + elif mapped_coord[1] == 0: + u = mapped_coord[2] + v = mapped_coord[0] + elif mapped_coord[2] == 0: + u = mapped_coord[1] + v = mapped_coord[0] + else: + u = mapped_coord[1] + v = mapped_coord[2] + if ((u < thresh) or + (v < thresh) or + (fabs(u - 1) < thresh) or + (fabs(v - 1) < thresh)): + return 1 + return -1 @cython.boundscheck(False) @cython.wraparound(False) @@ -1008,6 +1181,24 @@ @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) +def test_linear1D_sampler(np.ndarray[np.float64_t, ndim=2] vertices, + np.ndarray[np.float64_t, ndim=1] field_values, + np.ndarray[np.float64_t, ndim=1] physical_x): + + cdef double val + + sampler = P1Sampler1D() + + val = sampler.sample_at_real_point( vertices.data, + field_values.data, + physical_x.data) + + return val + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) def test_tri_sampler(np.ndarray[np.float64_t, ndim=2] vertices, np.ndarray[np.float64_t, ndim=1] field_values, np.ndarray[np.float64_t, ndim=1] physical_x): @@ -1036,6 +1227,57 @@ val = sampler.sample_at_real_point( vertices.data, field_values.data, + physical_x.data) + + return val + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +def test_quad2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, + np.ndarray[np.float64_t, ndim=1] field_values, + np.ndarray[np.float64_t, ndim=1] physical_x): + + cdef double val + + sampler = Q2Sampler2D() + + val = sampler.sample_at_real_point( vertices.data, + field_values.data, + physical_x.data) + + return val + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +def test_tri2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, + np.ndarray[np.float64_t, ndim=1] field_values, + np.ndarray[np.float64_t, ndim=1] physical_x): + + cdef double val + + sampler = T2Sampler2D() + + val = sampler.sample_at_real_point( vertices.data, + field_values.data, + physical_x.data) + + return val + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +def test_tet2_sampler(np.ndarray[np.float64_t, ndim=2] vertices, + np.ndarray[np.float64_t, ndim=1] field_values, + np.ndarray[np.float64_t, ndim=1] physical_x): + + cdef double val + + sampler = Tet2Sampler3D() + + val = sampler.sample_at_real_point( vertices.data, + field_values.data, physical_x.data) return val diff -Nru yt-3.3.3/yt/utilities/lib/fixed_interpolator.h yt-3.4.0/yt/utilities/lib/fixed_interpolator.h --- yt-3.3.3/yt/utilities/lib/fixed_interpolator.h 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/fixed_interpolator.h 2017-08-10 17:56:56.000000000 +0000 @@ -29,6 +29,8 @@ void eval_gradient(int ds[3], npy_float64 dp[3], npy_float64 *data, npy_float64 *grad); +void offset_fill(int *ds, npy_float64 *data, npy_float64 *gridval); + void vertex_interp(npy_float64 v1, npy_float64 v2, npy_float64 isovalue, npy_float64 vl[3], npy_float64 dds[3], npy_float64 x, npy_float64 y, npy_float64 z, diff -Nru yt-3.3.3/yt/utilities/lib/fixed_interpolator.pxd yt-3.4.0/yt/utilities/lib/fixed_interpolator.pxd --- yt-3.3.3/yt/utilities/lib/fixed_interpolator.pxd 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/fixed_interpolator.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -30,4 +30,3 @@ np.float64_t vl[3], np.float64_t dds[3], np.float64_t x, np.float64_t y, np.float64_t z, int vind1, int vind2) nogil - diff -Nru yt-3.3.3/yt/utilities/lib/fnv_hash.c yt-3.4.0/yt/utilities/lib/fnv_hash.c --- yt-3.3.3/yt/utilities/lib/fnv_hash.c 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/fnv_hash.c 2017-08-10 18:20:36.000000000 +0000 @@ -0,0 +1,23323 @@ +/* Generated by Cython 0.26rc2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [], + "include_dirs": [ + "yt/utilities/lib/" + ], + "libraries": [ + "m" + ], + "name": "yt.utilities.lib.fnv_hash", + "sources": [ + "yt/utilities/lib/fnv_hash.pyx" + ] + }, + "module_name": "yt.utilities.lib.fnv_hash" +} +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 < 0x03020000) + #error Cython requires Python 2.6+ or Python 3.2+. +#else +#define CYTHON_ABI "0_26rc2" +#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 >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#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_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !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 < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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 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 +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#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 +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#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 + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#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; \ +} + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__yt__utilities__lib__fnv_hash +#define __PYX_HAVE_API__yt__utilities__lib__fnv_hash +#include +#include +#include +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "pythread.h" +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_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) && defined (_M_X64) + #define __Pyx_sst_abs(value) _abs64(value) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE 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_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) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_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; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; +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[] = { + "yt/utilities/lib/fnv_hash.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; + +/* 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; + +/* 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 + + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":726 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":727 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":728 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":732 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":733 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":734 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":735 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":739 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":740 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":749 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":750 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":751 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":753 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":754 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":755 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":757 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":758 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":760 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":761 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":762 + * 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; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":765 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":766 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":768 + * 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":103 + * + * @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":275 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":326 + * + * @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":951 + * + * @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":103 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_array { + PyObject *(*get_memview)(struct __pyx_array_obj *); +}; +static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; + + +/* "View.MemoryView":326 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * 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":951 + * + * @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) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* BufferFormatCheck.proto */ +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* 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); + +/* 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 + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* 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); + +/* ArgTypeTest.proto */ +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); + +/* 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 + +/* 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 *); + +/* 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 *); + +/* GetModuleGlobalName.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + +/* 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); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +/* 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 + +/* 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); + +/* 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() + +/* 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); + +/* 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); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + +/* 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; + +/* None.proto */ +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, + char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 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 int __Pyx_PyInt_As_int(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 *); + +/* 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_unsigned_char(PyObject *); + +/* 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 '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 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'cython.view' */ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'yt.utilities.lib.fnv_hash' */ +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_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fnv_hash_c_fnv_hash(__Pyx_memviewslice); /*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_unsigned_char = { "unsigned char", NULL, sizeof(unsigned char), { 0 }, 0, IS_UNSIGNED(unsigned char) ? 'U' : 'I', IS_UNSIGNED(unsigned char), 0 }; +#define __Pyx_MODULE_NAME "yt.utilities.lib.fnv_hash" +int __pyx_module_is_main_yt__utilities__lib__fnv_hash = 0; + +/* Implementation of 'yt.utilities.lib.fnv_hash' */ +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_IndexError; +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_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_main[] = "__main__"; +static const char __pyx_k_mode[] = "mode"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_ndim[] = "ndim"; +static const char __pyx_k_pack[] = "pack"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_step[] = "step"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_ASCII[] = "ASCII"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_error[] = "error"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_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_octets[] = "octets"; +static const char __pyx_k_pickle[] = "pickle"; +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_fortran[] = "fortran"; +static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_Ellipsis[] = "Ellipsis"; +static const char __pyx_k_fnv_hash[] = "fnv_hash"; +static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +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_IndexError[] = "IndexError"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; +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_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_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +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_Fast_hashing_routines[] = "\nFast hashing routines\n\n\n"; +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_yt_utilities_lib_fnv_hash[] = "yt.utilities.lib.fnv_hash"; +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_yt_utilities_lib_fnv_hash_pyx[] = "yt/utilities/lib/fnv_hash.pyx"; +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_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_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_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_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_allocate_buffer; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_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_dtype_is_object; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_fnv_hash; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +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_memview; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_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_octets; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_getbuffer; +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_cython; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_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_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 PyObject *__pyx_n_s_yt_utilities_lib_fnv_hash; +static PyObject *__pyx_kp_s_yt_utilities_lib_fnv_hash_pyx; +static PyObject *__pyx_pf_2yt_9utilities_3lib_8fnv_hash_fnv_hash(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_octets); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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_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__23; +static PyObject *__pyx_slice__24; +static PyObject *__pyx_slice__25; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +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__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__37; + +/* "yt/utilities/lib/fnv_hash.pyx":22 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cdef np.int64_t c_fnv_hash(unsigned char[:] octets) nogil: # <<<<<<<<<<<<<< + * # https://bitbucket.org/yt_analysis/yt/issues/1052/field-access-tests-fail-under-python3 + * # FNV hash cf. http://www.isthe.com/chongo/tech/comp/fnv/index.html + */ + +static __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fnv_hash_c_fnv_hash(__Pyx_memviewslice __pyx_v_octets) { + __pyx_t_5numpy_int64_t __pyx_v_hash_val; + int __pyx_v_i; + __pyx_t_5numpy_int64_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "yt/utilities/lib/fnv_hash.pyx":25 + * # https://bitbucket.org/yt_analysis/yt/issues/1052/field-access-tests-fail-under-python3 + * # FNV hash cf. http://www.isthe.com/chongo/tech/comp/fnv/index.html + * cdef np.int64_t hash_val = 2166136261 # <<<<<<<<<<<<<< + * cdef unsigned char octet + * cdef int i + */ + __pyx_v_hash_val = 0x811C9DC5; + + /* "yt/utilities/lib/fnv_hash.pyx":28 + * cdef unsigned char octet + * cdef int i + * for i in range(octets.shape[0]): # <<<<<<<<<<<<<< + * hash_val = hash_val ^ octets[i] + * hash_val = hash_val * 16777619 + */ + __pyx_t_1 = (__pyx_v_octets.shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/utilities/lib/fnv_hash.pyx":29 + * cdef int i + * for i in range(octets.shape[0]): + * hash_val = hash_val ^ octets[i] # <<<<<<<<<<<<<< + * hash_val = hash_val * 16777619 + * return hash_val + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_hash_val = (__pyx_v_hash_val ^ (*((unsigned char *) ( /* dim=0 */ (__pyx_v_octets.data + __pyx_t_3 * __pyx_v_octets.strides[0]) )))); + + /* "yt/utilities/lib/fnv_hash.pyx":30 + * for i in range(octets.shape[0]): + * hash_val = hash_val ^ octets[i] + * hash_val = hash_val * 16777619 # <<<<<<<<<<<<<< + * return hash_val + * + */ + __pyx_v_hash_val = (__pyx_v_hash_val * 0x1000193); + } + + /* "yt/utilities/lib/fnv_hash.pyx":31 + * hash_val = hash_val ^ octets[i] + * hash_val = hash_val * 16777619 + * return hash_val # <<<<<<<<<<<<<< + * + * def fnv_hash(octets): + */ + __pyx_r = __pyx_v_hash_val; + goto __pyx_L0; + + /* "yt/utilities/lib/fnv_hash.pyx":22 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cdef np.int64_t c_fnv_hash(unsigned char[:] octets) nogil: # <<<<<<<<<<<<<< + * # https://bitbucket.org/yt_analysis/yt/issues/1052/field-access-tests-fail-under-python3 + * # FNV hash cf. http://www.isthe.com/chongo/tech/comp/fnv/index.html + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fnv_hash.pyx":33 + * return hash_val + * + * def fnv_hash(octets): # <<<<<<<<<<<<<< + * """ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_8fnv_hash_1fnv_hash(PyObject *__pyx_self, PyObject *__pyx_v_octets); /*proto*/ +static char __pyx_doc_2yt_9utilities_3lib_8fnv_hash_fnv_hash[] = "\n \n Create a FNV hash from a bytestring.\n Info: http://www.isthe.com/chongo/tech/comp/fnv/index.html\n \n Parameters\n ----------\n octets : bytestring\n The string of bytes to generate a hash from. \n "; +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_8fnv_hash_1fnv_hash = {"fnv_hash", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_8fnv_hash_1fnv_hash, METH_O, __pyx_doc_2yt_9utilities_3lib_8fnv_hash_fnv_hash}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_8fnv_hash_1fnv_hash(PyObject *__pyx_self, PyObject *__pyx_v_octets) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fnv_hash (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_8fnv_hash_fnv_hash(__pyx_self, ((PyObject *)__pyx_v_octets)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_8fnv_hash_fnv_hash(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_octets) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("fnv_hash", 0); + + /* "yt/utilities/lib/fnv_hash.pyx":44 + * The string of bytes to generate a hash from. + * """ + * return c_fnv_hash(octets) # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_v_octets); + if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_f_2yt_9utilities_3lib_8fnv_hash_c_fnv_hash(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); + __pyx_t_1.memview = NULL; + __pyx_t_1.data = NULL; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/fnv_hash.pyx":33 + * return hash_val + * + * def fnv_hash(octets): # <<<<<<<<<<<<<< + * """ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("yt.utilities.lib.fnv_hash.fnv_hash", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + goto __pyx_L4; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 218, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 222, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + goto __pyx_L11; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * 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)); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset + */ + __pyx_v_f = NULL; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * 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; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + goto __pyx_L14; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L14:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 259, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 278, __pyx_L1_error) + break; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + */ + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = '\x00'; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * 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, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * 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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + * + * 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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * 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, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + long __pyx_t_8; + char *__pyx_t_9; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(1, 794, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * 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, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 799, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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") + * + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 803, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 0x78; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 823, __pyx_L1_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + /*else*/ { + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 844, __pyx_L1_error) + } + __pyx_L15:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + goto __pyx_L13; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * 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; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":120 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __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, 120, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error) + } else { + + /* "View.MemoryView":121 + * + * 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, 120, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __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":120 + * 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; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":127 + * 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, 127, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":128 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":131 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 131, __pyx_L1_error) + + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + } + + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":134 + * + * 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, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 134, __pyx_L1_error) + + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + } + + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":137 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + } + + /* "View.MemoryView":138 + * if not isinstance(format, bytes): + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 138, __pyx_L1_error) + __pyx_t_5 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":139 + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_6; + + /* "View.MemoryView":142 + * + * + * 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":143 + * + * 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":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":146 + * + * 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, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 146, __pyx_L1_error) + + /* "View.MemoryView":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + } + + /* "View.MemoryView":149 + * + * + * 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, 149, __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, 149, __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, 149, __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":150 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":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_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __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, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __PYX_ERR(2, 151, __pyx_L1_error) + + /* "View.MemoryView":150 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + } + + /* "View.MemoryView":152 + * 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":149 + * + * + * 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":155 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 155, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":156 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":157 + * 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":155 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":159 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":160 + * 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":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":162 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + /*else*/ { + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 162, __pyx_L1_error) + } + __pyx_L10:; + + /* "View.MemoryView":164 + * 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":167 + * 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":168 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":169 + * 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":172 + * + * + * 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":173 + * + * 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 (__pyx_t_4) { + + /* "View.MemoryView":174 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 174, __pyx_L1_error) + + /* "View.MemoryView":173 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + } + + /* "View.MemoryView":176 + * 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":177 + * + * 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":178 + * 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, 178, __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, 178, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":179 + * 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":180 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + + /* "View.MemoryView":176 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + } + + /* "View.MemoryView":169 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":120 + * 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":183 + * + * @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; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":184 + * @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":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 185, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":186 + * 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":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + goto __pyx_L3; + } + + /* "View.MemoryView":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 187, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":188 + * 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":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; + + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 190, __pyx_L1_error) + + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + } + + /* "View.MemoryView":191 + * 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":192 + * 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":193 + * 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":194 + * 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":195 + * 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":196 + * 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":197 + * 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":198 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":200 + * 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":201 + * + * 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":200 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":203 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":205 + * 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":183 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":209 + * __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":210 + * + * 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":211 + * 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":210 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":214 + * 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":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } + + /* "View.MemoryView":216 + * 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":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + } + __pyx_L3:; + + /* "View.MemoryView":217 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":209 + * __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":220 + * + * @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":221 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":220 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":224 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_memview", 0); + + /* "View.MemoryView":225 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":226 + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __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, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":224 + * + * @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 + * + * + * 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_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":230 + * + * 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, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":229 + * + * + * 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":232 + * 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_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":233 + * + * 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, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __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 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":235 + * 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_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":236 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":235 + * 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":240 + * + * @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":244 + * 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":245 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __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, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":244 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __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":248 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error) + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":249 + * 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":251 + * 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":240 + * + * @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":277 + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 277, __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, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___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":278 + * 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":277 + * 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":279 + * 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":280 + * 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":279 + * 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":294 + * + * @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":296 + * 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":300 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":302 + * 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":303 + * + * 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":302 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":305 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":294 + * + * @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":341 + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __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, 341, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___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":342 + * + * 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":343 + * 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":344 + * 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":345 + * 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 == -1)) __PYX_ERR(2, 345, __pyx_L1_error) + + /* "View.MemoryView":346 + * 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":347 + * __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":348 + * 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":346 + * 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":344 + * 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":351 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":352 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":353 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":351 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + } + + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":355 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":357 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error) + + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } + + /* "View.MemoryView":359 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":360 + * + * 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":359 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + goto __pyx_L10; + } + + /* "View.MemoryView":362 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; + + /* "View.MemoryView":364 + * 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":366 + * 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":341 + * 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":368 + * 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; + PyThread_type_lock __pyx_t_5; + PyThread_type_lock __pyx_t_6; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":369 + * + * 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":370 + * 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":369 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + } + + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * 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":375 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":377 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":380 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":379 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; + + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":381 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":383 + * break + * else: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + } + __pyx_L6_break:; + + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":368 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":385 + * 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":387 + * 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":389 + * 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, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 389, __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":390 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":389 + * 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":392 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":385 + * 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":395 + * + * + * 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":396 + * + * 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":397 + * 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":396 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + } + + /* "View.MemoryView":399 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 399, __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, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":402 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 402, __pyx_L1_error) + if (__pyx_t_2) { + + /* "View.MemoryView":403 + * 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, 403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":402 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + } + + /* "View.MemoryView":405 + * 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 == NULL)) __PYX_ERR(2, 405, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":406 + * 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, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":395 + * + * + * 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":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___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 + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":409 + * + * def __setitem__(memoryview self, object index, object value): + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 409, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":412 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_obj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":414 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":416 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":418 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":420 + * 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":421 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_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":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":424 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __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, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":425 + * 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, 425, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":426 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":421 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + } + + /* "View.MemoryView":428 + * 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":420 + * 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":430 + * 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":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 434, __pyx_L1_error) + + /* "View.MemoryView":435 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 435, __pyx_L1_error) + + /* "View.MemoryView":436 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 434, __pyx_L1_error) + + /* "View.MemoryView":430 + * 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":438 + * 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":440 + * 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":445 + * 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":447 + * 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":448 + * + * 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":449 + * 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 (__pyx_t_1) { + + /* "View.MemoryView":450 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error) + + /* "View.MemoryView":449 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":451 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":447 + * 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":453 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":455 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":456 + * + * 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":457 + * 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":456 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":459 + * ( 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, 459, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":463 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":464 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 464, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":463 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + } + + /* "View.MemoryView":465 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * 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":468 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __pyx_L6_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __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); + } + __Pyx_PyThreadState_assign + 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":438 + * 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":470 + * 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":471 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 471, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":472 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":470 + * 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":474 + * 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":477 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":480 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __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":482 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __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, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } + + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":487 + * 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, 487, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; + + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } + + /* "View.MemoryView":488 + * 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_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":483 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); + + /* "View.MemoryView":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(2, 484, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } + + /* "View.MemoryView":474 + * 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":490 + * 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":493 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":498 + * 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":499 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __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 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":498 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":501 + * 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, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __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, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __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, 501, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":503 + * 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, 503, __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":504 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":503 + * 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":504 + * + * 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":490 + * 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":507 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___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; + Py_ssize_t *__pyx_t_2; + char *__pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":509 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_2 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_2; + + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":511 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":513 + * 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":514 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_2 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_2; + + /* "View.MemoryView":513 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":516 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L4:; + + /* "View.MemoryView":518 + * 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":519 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_2 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_2; + + /* "View.MemoryView":518 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":521 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":523 + * 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":524 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_3 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_3; + + /* "View.MemoryView":523 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":526 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":528 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_4 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":529 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_5 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_5; + + /* "View.MemoryView":530 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = 0 + */ + __pyx_t_6 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_6; + + /* "View.MemoryView":531 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.obj = self + */ + __pyx_t_6 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_6; + + /* "View.MemoryView":532 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":533 + * info.len = self.view.len + * info.readonly = 0 + * 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":507 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + + /* function exit code */ + __pyx_r = 0; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":539 + * + * @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":540 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":541 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error) + + /* "View.MemoryView":542 + * 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":539 + * + * @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":545 + * + * @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":546 + * @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":545 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":549 + * + * @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":550 + * @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, 550, __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, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":549 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_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":553 + * + * @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":554 + * @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 (__pyx_t_1) { + + /* "View.MemoryView":556 + * 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__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 556, __pyx_L1_error) + + /* "View.MemoryView":554 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + } + + /* "View.MemoryView":558 + * 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, 558, __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, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "View.MemoryView":553 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_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":561 + * + * @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":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + } + + /* "View.MemoryView":565 + * 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, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":561 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_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":568 + * + * @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":569 + * @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, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":568 + * + * @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":572 + * + * @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":573 + * @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, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":572 + * + * @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":576 + * + * @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":577 + * @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, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":576 + * + * @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":580 + * + * @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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":582 + * 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":584 + * 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, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":585 + * + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":587 + * 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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":589 + * 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":580 + * + * @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":591 + * 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":592 + * + * 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":593 + * 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":592 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":595 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":591 + * 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":597 + * 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":598 + * + * 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, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":599 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":598 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":597 + * 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":601 + * 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":602 + * + * 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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":601 + * 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":605 + * + * + * 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":608 + * 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":609 + * 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, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":605 + * + * + * 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":611 + * 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":614 + * 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":615 + * 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, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":611 + * 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":617 + * 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":619 + * 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":621 + * 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":622 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 622, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":627 + * 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, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":617 + * 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":629 + * 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":631 + * 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":633 + * 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":634 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 634, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":639 + * 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, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":629 + * 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__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.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__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.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":643 + * + * @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":644 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __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, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":645 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":646 + * 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":643 + * + * @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":649 + * + * @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":650 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":649 + * + * @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":652 + * 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":657 + * 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":658 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":657 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":660 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":662 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":663 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":664 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":665 + * 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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 665, __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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__23); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":669 + * 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":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__24); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":672 + * 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":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":675 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(2, 675, __pyx_L1_error) + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":677 + * 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":678 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":665 + * 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":680 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__25); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":684 + * 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, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "View.MemoryView":652 + * 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":686 + * 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":687 + * + * 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":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":689 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 689, __pyx_L1_error) + + /* "View.MemoryView":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":686 + * 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":696 + * + * @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":697 + * @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":704 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + + /* "View.MemoryView":708 + * 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, 708, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":711 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 711, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":712 + * 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":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":714 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":715 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":721 + * + * + * 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":722 + * + * 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":727 + * + * + * 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":728 + * + * 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":732 + * 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, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 732, __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":733 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":737 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 737, __pyx_L1_error) + + /* "View.MemoryView":734 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 734, __pyx_L1_error) + + /* "View.MemoryView":733 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":741 + * 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":742 + * 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":743 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":744 + * 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":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":746 + * 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, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":747 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":748 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":750 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":751 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":752 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":754 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 754, __pyx_L1_error) + + /* "View.MemoryView":760 + * 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":732 + * 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":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":763 + * + * 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":764 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) } + + /* "View.MemoryView":765 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) } + + /* "View.MemoryView":763 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":769 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":696 + * + * @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":793 + * + * @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":813 + * 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":815 + * 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":816 + * + * 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":815 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_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":818 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 818, __pyx_L1_error) + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":813 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":821 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __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":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_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":824 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error) + + /* "View.MemoryView":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + } + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":828 + * + * 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":829 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":830 + * 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":831 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":830 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":828 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":832 + * 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":833 + * 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":834 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":833 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":836 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":832 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":839 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":841 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":844 + * + * 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":845 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":846 + * 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":847 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":846 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":844 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":848 + * 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":849 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":848 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":852 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":854 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":857 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":861 + * + * 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":863 + * 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":864 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":863 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":866 + * 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":867 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":866 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":870 + * + * + * 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":871 + * + * 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":872 + * 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":875 + * + * + * 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":876 + * + * 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":875 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":878 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":880 + * 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":881 + * + * 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":882 + * 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":883 + * 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":882 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":885 + * 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":886 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":881 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":888 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":880 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":890 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":793 + * + * @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":896 + * + * @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":898 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":899 + * 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":902 + * 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":903 + * + * 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, 903, __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, 903, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":904 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":902 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":906 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":907 + * 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":908 + * 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":909 + * 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":908 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":911 + * 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":912 + * + * 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":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":914 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(2, 914, __pyx_L1_error) + + /* "View.MemoryView":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":911 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":917 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 917, __pyx_L1_error) + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":919 + * 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":920 + * + * 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":921 + * 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":920 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":923 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":896 + * + * @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":929 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + + /* "View.MemoryView":930 + * @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":932 + * 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":933 + * + * 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":937 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":938 + * 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":939 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":940 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L6_bool_binop_done:; + if (__pyx_t_6) { + + /* "View.MemoryView":943 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error) + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + } + } + + /* "View.MemoryView":945 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":929 + * + * @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":962 + * 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":963 + * + * 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":962 + * 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":965 + * __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":966 + * + * 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":967 + * 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, 967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":966 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":969 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 969, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":965 + * __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":971 + * 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":972 + * + * 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":973 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error) + + /* "View.MemoryView":972 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":975 + * 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, 975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":971 + * 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":978 + * + * @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":979 + * @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":978 + * + * @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__27, 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__28, 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":985 + * + * @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":993 + * 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":994 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "View.MemoryView":993 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":999 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __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, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1001 + * 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":1002 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1004 + * __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, 1004, __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":1005 + * + * 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":1007 + * 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":1008 + * + * 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":1009 + * 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":1010 + * 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":1011 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * result.flags = PyBUF_RECORDS + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":1013 + * Py_INCREF(Py_None) + * + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1015 + * result.flags = PyBUF_RECORDS + * + * 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":1016 + * + * 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":1019 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1020 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1022 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":1023 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L5_break; + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L5_break:; + + /* "View.MemoryView":1025 + * 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":1026 + * + * 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, 1026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1027 + * 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, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1029 + * 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":1030 + * + * 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":1032 + * 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":985 + * + * @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":1035 + * + * @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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1039 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1039, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1040 + * 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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1042 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1043 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1035 + * + * @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":1046 + * + * @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; + Py_ssize_t __pyx_t_4; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1050 + * 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":1051 + * + * 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":1052 + * 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":1054 + * 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":1055 + * + * 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":1057 + * 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; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_dim = __pyx_t_3; + + /* "View.MemoryView":1058 + * + * 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":1059 + * 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":1060 + * 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_4 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_4 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4; + } + + /* "View.MemoryView":1046 + * + * @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":1063 + * + * @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":1066 + * "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":1067 + * 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, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1063 + * + * @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":1070 + * + * @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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1078 + * + * 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":1079 + * 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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1081 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1082 + * 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":1084 + * 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":1086 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1070 + * + * @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":1092 + * + * + * 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":1093 + * + * 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":1094 + * 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":1093 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1096 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1092 + * + * + * 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":1099 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1104 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1105 + * 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":1107 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1108 + * + * 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":1109 + * 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":1110 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1108 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1112 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1113 + * + * 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":1114 + * 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":1115 + * 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":1113 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1117 + * 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":1118 + * + * 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":1117 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1120 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1099 + * + * @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":1123 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + + /* "View.MemoryView":1130 + * + * 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":1131 + * 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":1132 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1133 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1135 + * 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":1136 + * + * 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":1137 + * 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":1136 + * + * 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":1138 + * 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): + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + + /* "View.MemoryView":1136 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1140 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1141 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + + /* "View.MemoryView":1142 + * 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":1143 + * 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":1135 + * 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":1145 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1146 + * 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":1150 + * 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":1151 + * 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":1123 + * + * @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":1153 + * 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":1156 + * __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":1153 + * 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":1160 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1163 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1165 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1166 + * + * 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":1168 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1160 + * + * @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":1171 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1180 + * 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":1181 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "View.MemoryView":1182 + * 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":1183 + * 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":1180 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1185 + * 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 > -1L; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1186 + * 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":1187 + * 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":1189 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1171 + * + * @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":1192 + * + * @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; + + /* "View.MemoryView":1203 + * 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":1204 + * + * 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":1206 + * 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":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1208 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error) + + /* "View.MemoryView":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1211 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1212 + * + * 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":1213 + * 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; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1214 + * 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":1215 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1217 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + + /* "View.MemoryView":1221 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1222 + * + * 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":1223 + * 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":1222 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1225 + * 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":1226 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + + /* "View.MemoryView":1225 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1228 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1230 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1192 + * + * @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":1235 + * + * @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":1238 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __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":1237 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 1237, __pyx_L1_error) + + /* "View.MemoryView":1235 + * + * @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":1241 + * + * @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":1242 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_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, 1242, __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, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 1242, __pyx_L1_error) + + /* "View.MemoryView":1241 + * + * @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":1245 + * + * @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":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1247 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_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, 1247, __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, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1247, __pyx_L1_error) + + /* "View.MemoryView":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1249 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(2, 1249, __pyx_L1_error) + } + + /* "View.MemoryView":1245 + * + * @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":1252 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + + /* "View.MemoryView":1260 + * 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":1261 + * """ + * 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":1263 + * 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":1264 + * 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":1265 + * 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":1268 + * 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":1269 + * + * 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":1268 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1271 + * 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":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1273 + * 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":1275 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1276 + * + * 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":1277 + * 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":1278 + * 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":1279 + * 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":1277 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1281 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1281, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1276 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1284 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error) + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + } + } + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1289 + * + * 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":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1291 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1291, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_6; + + /* "View.MemoryView":1292 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1298 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1302 + * 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":1304 + * 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":1305 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + + /* "View.MemoryView":1306 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1307 + * 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":1308 + * 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":1302 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_7 = (__pyx_t_2 != 0); + if (__pyx_t_7) { + + /* "View.MemoryView":1313 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error) + + /* "View.MemoryView":1314 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error) + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1316 + * 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":1317 + * + * 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":1318 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1320 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1321 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1252 + * + * @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":1324 + * + * @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; + + /* "View.MemoryView":1328 + * 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":1330 + * 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 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1331 + * + * 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":1332 + * 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":1333 + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1335 + * 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; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1336 + * + * for i in range(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":1337 + * 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":1338 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1324 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1346 + * + * @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":1350 + * + * + * 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":1351 + * + * 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":1350 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1346 + * + * @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":1355 + * + * @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":1358 + * 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":1355 + * + * @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":1361 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1365 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_3 = (__pyx_v_inc != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1368 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1370 + * 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":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1372 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1373 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1375 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1361 + * + * @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":1381 + * + * @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":1384 + * 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":1385 + * 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":1387 + * _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":1381 + * + * @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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "View.MemoryView":1395 + * 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":1396 + * 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":1398 + * 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":1399 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1400 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1401 + * 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":1398 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1403 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1404 + * 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":1406 + * _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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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 PY_VERSION_HEX >= 0x030400a1 + 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 = 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 = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + 0, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.fnv_hash.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.fnv_hash.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.fnv_hash.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.fnv_hash._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 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + "fnv_hash", + __pyx_k_Fast_hashing_routines, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__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_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_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_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_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_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_fnv_hash, __pyx_k_fnv_hash, sizeof(__pyx_k_fnv_hash), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_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_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_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_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_octets, __pyx_k_octets, sizeof(__pyx_k_octets), 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_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_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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 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_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_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}, + {&__pyx_n_s_yt_utilities_lib_fnv_hash, __pyx_k_yt_utilities_lib_fnv_hash, sizeof(__pyx_k_yt_utilities_lib_fnv_hash), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_fnv_hash_pyx, __pyx_k_yt_utilities_lib_fnv_hash_pyx, sizeof(__pyx_k_yt_utilities_lib_fnv_hash_pyx), 0, 0, 1, 0}, + {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, 28, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _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, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "View.MemoryView":131 + * + * 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, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "View.MemoryView":134 + * + * 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, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "View.MemoryView":137 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "View.MemoryView":146 + * + * 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, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "View.MemoryView":174 + * 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, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 190, __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":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "View.MemoryView":556 + * 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__19 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __pyx_tuple__20 = PyTuple_New(1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__20, 0, __pyx_int_neg_1); + __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":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); + + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(2, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); + + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + + /* "View.MemoryView":689 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "(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__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "(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__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "yt/utilities/lib/fnv_hash.pyx":33 + * return hash_val + * + * def fnv_hash(octets): # <<<<<<<<<<<<<< + * """ + * + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_octets); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_fnv_hash_pyx, __pyx_n_s_fnv_hash, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 33, __pyx_L1_error) + + /* "View.MemoryView":282 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "View.MemoryView":283 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "View.MemoryView":284 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "View.MemoryView":287 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "View.MemoryView":288 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __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_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; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initfnv_hash(void); /*proto*/ +PyMODINIT_FUNC initfnv_hash(void) +#else +PyMODINIT_FUNC PyInit_fnv_hash(void); /*proto*/ +PyMODINIT_FUNC PyInit_fnv_hash(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + static PyThread_type_lock __pyx_t_2[8]; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_fnv_hash(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_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 PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("fnv_hash", __pyx_methods, __pyx_k_Fast_hashing_routines, 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) + __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_yt__utilities__lib__fnv_hash) { + 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, "yt.utilities.lib.fnv_hash")) { + if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.fnv_hash", __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 init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("c_fnv_hash", (void (*)(void))__pyx_f_2yt_9utilities_3lib_8fnv_hash_c_fnv_hash, "__pyx_t_5numpy_int64_t (__Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- 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, 103, __pyx_L1_error) + __pyx_type___pyx_array.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error) + __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __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, 326, __pyx_L1_error) + __pyx_type___pyx_memoryview.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + 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, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "yt/utilities/lib/fnv_hash.pyx":15 + * #----------------------------------------------------------------------------- + * + * import numpy as np # <<<<<<<<<<<<<< + * cimport numpy as np + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/fnv_hash.pyx":33 + * return hash_val + * + * def fnv_hash(octets): # <<<<<<<<<<<<<< + * """ + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_8fnv_hash_1fnv_hash, NULL, __pyx_n_s_yt_utilities_lib_fnv_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fnv_hash, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/fnv_hash.pyx":1 + * """ # <<<<<<<<<<<<<< + * Fast hashing routines + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":207 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __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(2, 207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":282 + * 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__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":283 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":284 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":287 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":288 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":312 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":313 + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_2[0] = PyThread_allocate_lock(); + __pyx_t_2[1] = PyThread_allocate_lock(); + __pyx_t_2[2] = PyThread_allocate_lock(); + __pyx_t_2[3] = PyThread_allocate_lock(); + __pyx_t_2[4] = PyThread_allocate_lock(); + __pyx_t_2[5] = PyThread_allocate_lock(); + __pyx_t_2[6] = PyThread_allocate_lock(); + __pyx_t_2[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":535 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 535, __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(2, 535, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":981 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 981, __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(2, 981, __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 + */ + __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(2, 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(2, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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 yt.utilities.lib.fnv_hash", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib.fnv_hash"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #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 + +/* 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; +} + +/* BufferFormatCheck */ +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +/* 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; +} +static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + Py_FatalError(msg); + va_end(vargs); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview || (PyObject *) memview == Py_None) + return; + if (__pyx_get_slice_count(memview) < 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (first_time) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview ) { + return; + } else if ((PyObject *) memview == Py_None) { + memslice->memview = NULL; + return; + } + if (__pyx_get_slice_count(memview) <= 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (last_time) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +/* 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 + +/* 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 PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* 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(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { +#endif + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* 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; +} + +/* ArgTypeTest */ + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +/* 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_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_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* 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 CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +/* GetModuleGlobalName */ + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL +#include "frameobject.h" +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = PyThreadState_GET(); + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyCFunctionFastCall */ + #if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + 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 + +/* GetItemInt */ + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + 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)); +} + +/* PyIntBinop */ + #if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + x = (long)((unsigned long)a + b); + if (likely((x^a) >= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* None */ + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* 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 +} + +/* 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 + +/* 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; + } +} + +/* 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 */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; + if (c_line) { + c_line = __Pyx_CLineForTraceback(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( + PyThreadState_GET(), /*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 (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + Py_DECREF(obj); + view->obj = NULL; +} +#endif + + + /* MemviewSliceIsContig */ + static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, + char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) + return 0; + itemsize *= mvs.shape[index]; + } + return 1; +} + +/* OverlappingSlices */ + static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +/* Capsule */ + static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +/* 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_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); + } +} + +/* 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 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 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; +} + +/* 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_unsigned_char(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_unsigned_char, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* 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) + PyErr_Clear(); + ++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); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else + if (__Pyx_PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +#endif + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (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 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 (PyInt_Check(x) || PyLong_Check(x)) +#else + if (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 = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } + #else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } + #endif +#else + res = PyNumber_Int(x); +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + 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_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff -Nru yt-3.3.3/yt/utilities/lib/fnv_hash.pxd yt-3.4.0/yt/utilities/lib/fnv_hash.pxd --- yt-3.3.3/yt/utilities/lib/fnv_hash.pxd 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/fnv_hash.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,21 @@ +""" +Definitions for fnv_hash + + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + + +import numpy as np +cimport numpy as np + +cdef np.int64_t c_fnv_hash(unsigned unsigned char[:] octets) nogil diff -Nru yt-3.3.3/yt/utilities/lib/fnv_hash.pyx yt-3.4.0/yt/utilities/lib/fnv_hash.pyx --- yt-3.3.3/yt/utilities/lib/fnv_hash.pyx 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/fnv_hash.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,44 @@ +""" +Fast hashing routines + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import numpy as np +cimport numpy as np + +cimport cython + +@cython.wraparound(False) +@cython.boundscheck(False) +cdef np.int64_t c_fnv_hash(unsigned char[:] octets) nogil: + # https://bitbucket.org/yt_analysis/yt/issues/1052/field-access-tests-fail-under-python3 + # FNV hash cf. http://www.isthe.com/chongo/tech/comp/fnv/index.html + cdef np.int64_t hash_val = 2166136261 + cdef unsigned char octet + cdef int i + for i in range(octets.shape[0]): + hash_val = hash_val ^ octets[i] + hash_val = hash_val * 16777619 + return hash_val + +def fnv_hash(octets): + """ + + Create a FNV hash from a bytestring. + Info: http://www.isthe.com/chongo/tech/comp/fnv/index.html + + Parameters + ---------- + octets : bytestring + The string of bytes to generate a hash from. + """ + return c_fnv_hash(octets) \ No newline at end of file diff -Nru yt-3.3.3/yt/utilities/lib/fortran_reader.c yt-3.4.0/yt/utilities/lib/fortran_reader.c --- yt-3.3.3/yt/utilities/lib/fortran_reader.c 2016-12-12 01:41:45.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/fortran_reader.c 2017-08-10 18:20:37.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -7,8 +7,15 @@ "yt/utilities/lib/endian_swap.h", "yt/utilities/lib/platform_dep.h" ], + "include_dirs": [ + "yt/utilities/lib" + ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.fortran_reader", + "sources": [ + "yt/utilities/lib/fortran_reader.pyx" ] }, "module_name": "yt.utilities.lib.fortran_reader" @@ -22,7 +29,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -44,6 +51,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -196,16 +204,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -332,6 +344,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -386,6 +404,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -496,8 +543,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -510,8 +557,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -633,10 +683,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1126,7 +1178,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* BufferIndexError.proto */ static void __Pyx_RaiseBufferIndexError(int axis); @@ -1214,12 +1266,6 @@ /* BufferFallbackError.proto */ static void __Pyx_RaiseBufferFallbackError(void); -/* 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); - #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2) #define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3) /* RaiseException.proto */ @@ -1285,6 +1331,9 @@ /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1635,18 +1684,19 @@ static const char __pyx_k_fill_child_mask[] = "fill_child_mask"; static const char __pyx_k_cell_record_size[] = "cell_record_size"; static const char __pyx_k_root_grid_offset[] = "root_grid_offset"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_read_art_root_vars[] = "read_art_root_vars"; static const char __pyx_k_component_grid_info[] = "component_grid_info"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/fortran_reader.pyx"; static const char __pyx_k_Simple_readers_for_fortran_unfo[] = "\nSimple readers for fortran unformatted data, specifically for the Tiger code.\n\n\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_yt_utilities_lib_fortran_reader[] = "yt.utilities.lib.fortran_reader"; +static const char __pyx_k_yt_utilities_lib_fortran_reader[] = "yt/utilities/lib/fortran_reader.pyx"; 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_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_utilities_lib_fortran_reader_2[] = "yt.utilities.lib.fortran_reader"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; @@ -1655,7 +1705,6 @@ static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_kp_s_Record_size_is; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s__13; static PyObject *__pyx_n_s_append; @@ -1666,6 +1715,7 @@ static PyObject *__pyx_n_s_cell_record_size; static PyObject *__pyx_n_s_child_mask; static PyObject *__pyx_n_s_child_record; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_component_grid_info; static PyObject *__pyx_n_s_count_art_octs; static PyObject *__pyx_n_s_data; @@ -1767,7 +1817,8 @@ static PyObject *__pyx_n_s_varindex; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_y; -static PyObject *__pyx_n_s_yt_utilities_lib_fortran_reader; +static PyObject *__pyx_kp_s_yt_utilities_lib_fortran_reader; +static PyObject *__pyx_n_s_yt_utilities_lib_fortran_reader_2; static PyObject *__pyx_n_s_z; static PyObject *__pyx_pf_2yt_9utilities_3lib_14fortran_reader_read_and_seek(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_filename, __pyx_t_5numpy_int64_t __pyx_v_offset1, __pyx_t_5numpy_int64_t __pyx_v_offset2, PyArrayObject *__pyx_v_buffer, int __pyx_v_bytes); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14fortran_reader_2count_art_octs(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_fn, long __pyx_v_offset, int __pyx_v_min_level, int __pyx_v_max_level, int __pyx_v_nhydro_vars, PyObject *__pyx_v_level_info); /* proto */ @@ -1833,10 +1884,15 @@ 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; } @@ -1845,21 +1901,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_and_seek", 1, 5, 5, 1); __PYX_ERR(0, 46, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_and_seek", 1, 5, 5, 2); __PYX_ERR(0, 46, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_and_seek", 1, 5, 5, 3); __PYX_ERR(0, 46, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bytes)) != 0)) kw_args--; else { @@ -1878,7 +1938,7 @@ values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } - __pyx_v_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L3_error) + __pyx_v_filename = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L3_error) __pyx_v_offset1 = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_offset1 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L3_error) __pyx_v_offset2 = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_offset2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) __pyx_v_buffer = ((PyArrayObject *)values[3]); @@ -2029,11 +2089,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -2042,26 +2108,31 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fn)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("count_art_octs", 1, 6, 6, 1); __PYX_ERR(0, 58, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_level)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("count_art_octs", 1, 6, 6, 2); __PYX_ERR(0, 58, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_level)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("count_art_octs", 1, 6, 6, 3); __PYX_ERR(0, 58, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nhydro_vars)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("count_art_octs", 1, 6, 6, 4); __PYX_ERR(0, 58, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level_info)) != 0)) kw_args--; else { @@ -2081,7 +2152,7 @@ values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } - __pyx_v_fn = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_fn) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L3_error) + __pyx_v_fn = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_fn) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L3_error) __pyx_v_offset = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_offset == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L3_error) __pyx_v_min_level = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_min_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) __pyx_v_max_level = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_max_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) @@ -2402,12 +2473,19 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -2416,31 +2494,37 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fn)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_tree", 1, 7, 7, 1); __PYX_ERR(0, 91, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_level)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_tree", 1, 7, 7, 2); __PYX_ERR(0, 91, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_level)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_tree", 1, 7, 7, 3); __PYX_ERR(0, 91, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oct_indices)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_tree", 1, 7, 7, 4); __PYX_ERR(0, 91, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oct_levels)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_tree", 1, 7, 7, 5); __PYX_ERR(0, 91, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oct_info)) != 0)) kw_args--; else { @@ -2461,7 +2545,7 @@ values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } - __pyx_v_fn = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_fn) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error) + __pyx_v_fn = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_fn) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error) __pyx_v_offset = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_offset == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error) __pyx_v_min_level = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_min_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) __pyx_v_max_level = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_max_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) @@ -3250,16 +3334,27 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -3268,51 +3363,61 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fn)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_root_grid_offset)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_root_vars", 1, 11, 11, 1); __PYX_ERR(0, 186, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nhydro_vars)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_root_vars", 1, 11, 11, 2); __PYX_ERR(0, 186, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nx)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_root_vars", 1, 11, 11, 3); __PYX_ERR(0, 186, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ny)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_root_vars", 1, 11, 11, 4); __PYX_ERR(0, 186, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nz)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_root_vars", 1, 11, 11, 5); __PYX_ERR(0, 186, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ix)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_root_vars", 1, 11, 11, 6); __PYX_ERR(0, 186, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iy)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_root_vars", 1, 11, 11, 7); __PYX_ERR(0, 186, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iz)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_root_vars", 1, 11, 11, 8); __PYX_ERR(0, 186, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_root_vars", 1, 11, 11, 9); __PYX_ERR(0, 186, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var)) != 0)) kw_args--; else { @@ -3337,7 +3442,7 @@ values[9] = PyTuple_GET_ITEM(__pyx_args, 9); values[10] = PyTuple_GET_ITEM(__pyx_args, 10); } - __pyx_v_fn = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_fn) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error) + __pyx_v_fn = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_fn) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error) __pyx_v_root_grid_offset = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_root_grid_offset == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error) __pyx_v_nhydro_vars = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nhydro_vars == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L3_error) __pyx_v_nx = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nx == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L3_error) @@ -3809,7 +3914,7 @@ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_level_offsets.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.utilities.lib.fortran_reader.read_art_vars", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.fortran_reader.read_art_vars", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_level_offsets.rcbuffer->pybuffer); @@ -3850,14 +3955,23 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -3866,41 +3980,49 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_varindex)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_index)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_grid", 1, 9, 9, 1); __PYX_ERR(0, 241, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid_dims)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_grid", 1, 9, 9, 2); __PYX_ERR(0, 241, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_grid", 1, 9, 9, 3); __PYX_ERR(0, 241, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filled)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_grid", 1, 9, 9, 4); __PYX_ERR(0, 241, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level_data)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_grid", 1, 9, 9, 5); __PYX_ERR(0, 241, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_grid", 1, 9, 9, 6); __PYX_ERR(0, 241, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref_factor)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_art_grid", 1, 9, 9, 7); __PYX_ERR(0, 241, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_component_grid_info)) != 0)) kw_args--; else { @@ -4188,7 +4310,7 @@ * for i in range(2*ref_factor): * di = i + og_start_index[0] * ref_factor */ - __pyx_t_5 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_ogrid_info), 3, 6, NULL, NULL, &__pyx_slice_, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_ogrid_info), __pyx_slice_); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 266, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_5); @@ -4628,9 +4750,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -4639,16 +4765,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_locations)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid_le)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fill_child_mask", 1, 4, 4, 1); __PYX_ERR(0, 306, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_art_child_masks)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fill_child_mask", 1, 4, 4, 2); __PYX_ERR(0, 306, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_child_mask)) != 0)) kw_args--; else { @@ -7207,7 +7336,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7255,7 +7384,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -7338,7 +7467,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7386,7 +7515,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -7469,7 +7598,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7514,7 +7643,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -7570,7 +7699,6 @@ {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_kp_s_Record_size_is, __pyx_k_Record_size_is, sizeof(__pyx_k_Record_size_is), 0, 0, 1, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, @@ -7581,6 +7709,7 @@ {&__pyx_n_s_cell_record_size, __pyx_k_cell_record_size, sizeof(__pyx_k_cell_record_size), 0, 0, 1, 1}, {&__pyx_n_s_child_mask, __pyx_k_child_mask, sizeof(__pyx_k_child_mask), 0, 0, 1, 1}, {&__pyx_n_s_child_record, __pyx_k_child_record, sizeof(__pyx_k_child_record), 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_component_grid_info, __pyx_k_component_grid_info, sizeof(__pyx_k_component_grid_info), 0, 0, 1, 1}, {&__pyx_n_s_count_art_octs, __pyx_k_count_art_octs, sizeof(__pyx_k_count_art_octs), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, @@ -7682,7 +7811,8 @@ {&__pyx_n_s_varindex, __pyx_k_varindex, sizeof(__pyx_k_varindex), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_fortran_reader, __pyx_k_yt_utilities_lib_fortran_reader, sizeof(__pyx_k_yt_utilities_lib_fortran_reader), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_fortran_reader, __pyx_k_yt_utilities_lib_fortran_reader, sizeof(__pyx_k_yt_utilities_lib_fortran_reader), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_fortran_reader_2, __pyx_k_yt_utilities_lib_fortran_reader_2, sizeof(__pyx_k_yt_utilities_lib_fortran_reader_2), 0, 0, 1, 1}, {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; @@ -7818,7 +7948,7 @@ __pyx_tuple__11 = PyTuple_Pack(9, __pyx_n_s_filename, __pyx_n_s_offset1, __pyx_n_s_offset2, __pyx_n_s_buffer, __pyx_n_s_bytes, __pyx_n_s_f, __pyx_n_s_buf, __pyx_n_s_line, __pyx_n_s_n); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_read_and_seek, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_fortran_reader, __pyx_n_s_read_and_seek, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 46, __pyx_L1_error) /* "yt/utilities/lib/fortran_reader.pyx":58 * fclose(f) @@ -7830,7 +7960,7 @@ __pyx_tuple__14 = PyTuple_Pack(13, __pyx_n_s_fn, __pyx_n_s_offset, __pyx_n_s_min_level, __pyx_n_s_max_level, __pyx_n_s_nhydro_vars, __pyx_n_s_level_info, __pyx_n_s_nchild, __pyx_n_s_next_record, __pyx_n_s_nLevel, __pyx_n_s_dummy_records, __pyx_n_s_readin, __pyx_n_s_f, __pyx_n_s__13); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_count_art_octs, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_fortran_reader, __pyx_n_s_count_art_octs, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 58, __pyx_L1_error) /* "yt/utilities/lib/fortran_reader.pyx":91 * fclose(f) @@ -7842,7 +7972,7 @@ __pyx_tuple__16 = PyTuple_Pack(23, __pyx_n_s_fn, __pyx_n_s_offset, __pyx_n_s_min_level, __pyx_n_s_max_level, __pyx_n_s_oct_indices, __pyx_n_s_oct_levels, __pyx_n_s_oct_info, __pyx_n_s_nchild, __pyx_n_s_iOct, __pyx_n_s_nLevel, __pyx_n_s_ic1, __pyx_n_s_next_record, __pyx_n_s_child_record, __pyx_n_s_iOctPs, __pyx_n_s_dummy_records, __pyx_n_s_readin, __pyx_n_s_f, __pyx_n_s_Level, __pyx_n_s_iNOLL, __pyx_n_s_iHOLL, __pyx_n_s_iOctMax, __pyx_n_s_level_offsets, __pyx_n_s__13); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(7, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_read_art_tree, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(7, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_fortran_reader, __pyx_n_s_read_art_tree, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 91, __pyx_L1_error) /* "yt/utilities/lib/fortran_reader.pyx":186 * return level_offsets @@ -7854,7 +7984,7 @@ __pyx_tuple__18 = PyTuple_Pack(17, __pyx_n_s_fn, __pyx_n_s_root_grid_offset, __pyx_n_s_nhydro_vars, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nz, __pyx_n_s_ix, __pyx_n_s_iy, __pyx_n_s_iz, __pyx_n_s_fields, __pyx_n_s_var, __pyx_n_s_f, __pyx_n_s_j, __pyx_n_s_l, __pyx_n_s_cell_record_size, __pyx_n_s_temp, __pyx_n_s_my_offset); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(11, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_read_art_root_vars, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(11, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_fortran_reader, __pyx_n_s_read_art_root_vars, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 186, __pyx_L1_error) /* "yt/utilities/lib/fortran_reader.pyx":241 * @cython.boundscheck(False) @@ -7866,7 +7996,7 @@ __pyx_tuple__20 = PyTuple_Pack(32, __pyx_n_s_varindex, __pyx_n_s_start_index, __pyx_n_s_grid_dims, __pyx_n_s_data, __pyx_n_s_filled, __pyx_n_s_level_data, __pyx_n_s_level, __pyx_n_s_ref_factor, __pyx_n_s_component_grid_info, __pyx_n_s_gi, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_grid_id, __pyx_n_s_ir, __pyx_n_s_jr, __pyx_n_s_kr, __pyx_n_s_offi, __pyx_n_s_offj, __pyx_n_s_offk, __pyx_n_s_odind, __pyx_n_s_di, __pyx_n_s_dj, __pyx_n_s_dk, __pyx_n_s_ogrid_info, __pyx_n_s_og_start_index, __pyx_n_s_temp_data, __pyx_n_s_end_index, __pyx_n_s_kr_offset, __pyx_n_s_jr_offset, __pyx_n_s_ir_offset, __pyx_n_s_to_fill); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(9, 0, 32, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_read_art_grid, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(9, 0, 32, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_fortran_reader, __pyx_n_s_read_art_grid, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 241, __pyx_L1_error) /* "yt/utilities/lib/fortran_reader.pyx":306 * @cython.boundscheck(True) @@ -7878,7 +8008,7 @@ __pyx_tuple__22 = PyTuple_Pack(13, __pyx_n_s_file_locations, __pyx_n_s_grid_le, __pyx_n_s_art_child_masks, __pyx_n_s_child_mask, __pyx_n_s_i, __pyx_n_s_ioct, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_nocts, __pyx_n_s_lex, __pyx_n_s_ley, __pyx_n_s_lez); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_fill_child_mask, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_fortran_reader, __pyx_n_s_fill_child_mask, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -7954,6 +8084,7 @@ __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 @@ -8021,7 +8152,7 @@ * np.int64_t offset2, np.ndarray buffer, int bytes): * cdef FILE *f = fopen(filename, "rb") */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14fortran_reader_1read_and_seek, NULL, __pyx_n_s_yt_utilities_lib_fortran_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14fortran_reader_1read_and_seek, NULL, __pyx_n_s_yt_utilities_lib_fortran_reader_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_and_seek, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8033,7 +8164,7 @@ * int min_level, int max_level, * int nhydro_vars, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14fortran_reader_3count_art_octs, NULL, __pyx_n_s_yt_utilities_lib_fortran_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14fortran_reader_3count_art_octs, NULL, __pyx_n_s_yt_utilities_lib_fortran_reader_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_count_art_octs, __pyx_t_1) < 0) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8045,7 +8176,7 @@ * int min_level, int max_level, * np.ndarray[np.int64_t, ndim=2] oct_indices, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14fortran_reader_5read_art_tree, NULL, __pyx_n_s_yt_utilities_lib_fortran_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14fortran_reader_5read_art_tree, NULL, __pyx_n_s_yt_utilities_lib_fortran_reader_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_art_tree, __pyx_t_1) < 0) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8057,7 +8188,7 @@ * int nhydro_vars, int nx, int ny, int nz, * int ix, int iy, int iz, fields, var): */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14fortran_reader_7read_art_root_vars, NULL, __pyx_n_s_yt_utilities_lib_fortran_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14fortran_reader_7read_art_root_vars, NULL, __pyx_n_s_yt_utilities_lib_fortran_reader_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_art_root_vars, __pyx_t_1) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8069,7 +8200,7 @@ * np.ndarray[np.int64_t, ndim=1] start_index, * np.ndarray[np.int32_t, ndim=1] grid_dims, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14fortran_reader_9read_art_grid, NULL, __pyx_n_s_yt_utilities_lib_fortran_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14fortran_reader_9read_art_grid, NULL, __pyx_n_s_yt_utilities_lib_fortran_reader_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_art_grid, __pyx_t_1) < 0) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8081,7 +8212,7 @@ * np.ndarray[np.int64_t, ndim=1] grid_le, * np.ndarray[np.uint8_t, ndim=4] art_child_masks, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14fortran_reader_11fill_child_mask, NULL, __pyx_n_s_yt_utilities_lib_fortran_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14fortran_reader_11fill_child_mask, NULL, __pyx_n_s_yt_utilities_lib_fortran_reader_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_fill_child_mask, __pyx_t_1) < 0) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8111,7 +8242,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.fortran_reader", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.fortran_reader", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -8333,17 +8464,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -8462,8 +8598,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON @@ -8523,11 +8659,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -8550,7 +8682,7 @@ #endif /* PyObjectCallMethod1 */ - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto done; @@ -8596,7 +8728,7 @@ } /* append */ - static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { @@ -8609,7 +8741,7 @@ } /* None */ - static CYTHON_INLINE long __Pyx_div_long(long a, long b) { +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)); @@ -8617,7 +8749,7 @@ } /* BufferFormatCheck */ - static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; } @@ -9167,13 +9299,13 @@ } /* BufferIndexError */ - static void __Pyx_RaiseBufferIndexError(int axis) { + static void __Pyx_RaiseBufferIndexError(int axis) { PyErr_Format(PyExc_IndexError, "Out of bounds on buffer access (axis %d)", axis); } /* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE + #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; @@ -9197,7 +9329,7 @@ #endif /* SetItemInt */ - static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); @@ -9245,7 +9377,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -9361,7 +9493,7 @@ #endif /* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + 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; @@ -9403,7 +9535,7 @@ } /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -9414,9 +9546,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -9429,9 +9564,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -9484,7 +9622,7 @@ } /* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -9497,110 +9635,13 @@ } /* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { + static void __Pyx_RaiseBufferFallbackError(void) { PyErr_SetString(PyExc_ValueError, "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); } -/* 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; -} - /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -9763,25 +9804,25 @@ #endif /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -9805,7 +9846,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -9815,7 +9856,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -9876,7 +9917,7 @@ } /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -9949,8 +9990,42 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -10030,7 +10105,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -10089,12 +10164,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -10131,8 +10209,8 @@ #endif - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + /* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -10154,7 +10232,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -10185,7 +10263,7 @@ } /* Print */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); if (!f) { @@ -10291,7 +10369,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -10322,7 +10400,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + 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) { @@ -10353,7 +10431,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -10373,7 +10451,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -10508,7 +10586,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -10528,7 +10606,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -10663,7 +10741,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -10694,7 +10772,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -10883,7 +10961,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -11072,7 +11150,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -11261,7 +11339,7 @@ } /* PrintOne */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static int __Pyx_PrintOne(PyObject* f, PyObject *o) { if (!f) { if (!(f = __Pyx_GetStdout())) @@ -11298,7 +11376,7 @@ #endif /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -11314,7 +11392,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -11332,7 +11410,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -11397,7 +11475,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -11422,6 +11500,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -11430,11 +11510,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/fp_utils.pxd yt-3.4.0/yt/utilities/lib/fp_utils.pxd --- yt-3.3.3/yt/utilities/lib/fp_utils.pxd 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/fp_utils.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -16,7 +16,7 @@ cimport numpy as np cimport cython -cdef inline int imax(int i0, int i1) nogil: +cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: if i0 > i1: return i0 return i1 @@ -24,7 +24,7 @@ if f0 > f1: return f0 return f1 -cdef inline int imin(int i0, int i1) nogil: +cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: if i0 < i1: return i0 return i1 @@ -36,12 +36,12 @@ if f0 < 0.0: return -f0 return f0 -cdef inline int iclip(int i, int a, int b) nogil: +cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: if i < a: return a if i > b: return b return i -cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: +cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: if i < a: return a if i > b: return b return i diff -Nru yt-3.3.3/yt/utilities/lib/geometry_utils.c yt-3.4.0/yt/utilities/lib/geometry_utils.c --- yt-3.3.3/yt/utilities/lib/geometry_utils.c 2016-12-12 01:41:45.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/geometry_utils.c 2017-08-10 18:20:38.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,8 +6,15 @@ "depends": [ "yt/utilities/lib/platform_dep.h" ], + "include_dirs": [ + "yt/utilities/lib" + ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.geometry_utils", + "sources": [ + "yt/utilities/lib/geometry_utils.pyx" ] }, "module_name": "yt.utilities.lib.geometry_utils" @@ -21,7 +28,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -43,6 +50,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -195,16 +203,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -331,6 +343,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -385,6 +403,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -495,8 +542,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -509,8 +556,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -632,10 +682,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -961,7 +1013,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; struct __pyx_t_2yt_9utilities_3lib_14geometry_utils_PointSet; -/* "yt/utilities/lib/geometry_utils.pyx":480 +/* "yt/utilities/lib/geometry_utils.pyx":477 * return rvg * * cdef struct PointSet # <<<<<<<<<<<<<< @@ -970,7 +1022,7 @@ */ struct __pyx_t_2yt_9utilities_3lib_14geometry_utils_PointSet { int count; - __pyx_t_5numpy_float64_t points[3][3]; + __pyx_t_5numpy_float64_t points[2][3]; struct __pyx_t_2yt_9utilities_3lib_14geometry_utils_PointSet *next; }; @@ -1080,7 +1132,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); @@ -1255,6 +1307,9 @@ /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1489,7 +1544,7 @@ /* Module declarations from 'yt.utilities.lib.fp_utils' */ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ /* Module declarations from 'libc.math' */ @@ -1527,7 +1582,8 @@ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t = { "uint64_t", NULL, sizeof(__pyx_t_5numpy_uint64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint64_t), 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; #define __Pyx_MODULE_NAME "yt.utilities.lib.geometry_utils" int __pyx_module_is_main_yt__utilities__lib__geometry_utils = 0; @@ -1535,8 +1591,8 @@ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_NotImplementedError; -static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_ImportError; static const char __pyx_k_c[] = "c"; static const char __pyx_k_i[] = "i"; @@ -1558,7 +1614,7 @@ static const char __pyx_k_np[] = "np"; static const char __pyx_k_p0[] = "p0"; static const char __pyx_k_p1[] = "p1"; -static const char __pyx_k_p3[] = "p3"; +static const char __pyx_k_p2[] = "p2"; static const char __pyx_k_rf[] = "rf"; static const char __pyx_k_rg[] = "rg"; static const char __pyx_k_rv[] = "rv"; @@ -1652,6 +1708,7 @@ static const char __pyx_k_YTDomainOverflow[] = "YTDomainOverflow"; static const char __pyx_k_domain_left_edge[] = "domain_left_edge"; static const char __pyx_k_domain_right_edge[] = "domain_right_edge"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_get_hilbert_points[] = "get_hilbert_points"; static const char __pyx_k_get_morton_indices[] = "get_morton_indices"; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; @@ -1663,15 +1720,16 @@ static const char __pyx_k_triangle_plane_intersect[] = "triangle_plane_intersect"; static const char __pyx_k_get_morton_indices_unravel[] = "get_morton_indices_unravel"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/geometry_utils.pyx"; static const char __pyx_k_Simple_integrators_for_the_radi[] = "\nSimple integrators for the radiative transfer equation\n\n\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_yt_utilities_lib_geometry_utils[] = "yt.utilities.lib.geometry_utils"; +static const char __pyx_k_yt_utilities_lib_geometry_utils[] = "yt/utilities/lib/geometry_utils.pyx"; 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_It_should_be_geometrically_impos[] = "It should be geometrically impossible for a plane toto intersect all three legs of a triangle. Please contactyt developers with your mesh"; static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_utilities_lib_geometry_utils_2[] = "yt.utilities.lib.geometry_utils"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_kp_s_Could_not_identify_dtype; static PyObject *__pyx_n_s_DLE; @@ -1681,11 +1739,11 @@ 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_It_should_be_geometrically_impos; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_NotImplementedError; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_YTDomainOverflow; static PyObject *__pyx_n_s_astype; @@ -1694,6 +1752,7 @@ static PyObject *__pyx_n_s_bv; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_s_center; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_compute_morton; static PyObject *__pyx_n_s_coord; static PyObject *__pyx_n_s_count; @@ -1763,7 +1822,7 @@ static PyObject *__pyx_n_s_p; static PyObject *__pyx_n_s_p0; static PyObject *__pyx_n_s_p1; -static PyObject *__pyx_n_s_p3; +static PyObject *__pyx_n_s_p2; static PyObject *__pyx_n_s_plane_norm; static PyObject *__pyx_n_s_point; static PyObject *__pyx_n_s_points; @@ -1802,7 +1861,8 @@ static PyObject *__pyx_n_s_yf; static PyObject *__pyx_n_s_yg; static PyObject *__pyx_n_s_yt_utilities_exceptions; -static PyObject *__pyx_n_s_yt_utilities_lib_geometry_utils; +static PyObject *__pyx_kp_s_yt_utilities_lib_geometry_utils; +static PyObject *__pyx_n_s_yt_utilities_lib_geometry_utils_2; static PyObject *__pyx_n_s_z; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_n_s_zf; @@ -1839,25 +1899,26 @@ static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; -static PyObject *__pyx_tuple__21; -static PyObject *__pyx_tuple__23; -static PyObject *__pyx_tuple__25; -static PyObject *__pyx_tuple__27; -static PyObject *__pyx_tuple__29; -static PyObject *__pyx_tuple__31; -static PyObject *__pyx_tuple__33; -static PyObject *__pyx_tuple__35; -static PyObject *__pyx_codeobj__20; -static PyObject *__pyx_codeobj__22; -static PyObject *__pyx_codeobj__24; -static PyObject *__pyx_codeobj__26; -static PyObject *__pyx_codeobj__28; -static PyObject *__pyx_codeobj__30; -static PyObject *__pyx_codeobj__32; -static PyObject *__pyx_codeobj__34; -static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_codeobj__21; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__27; +static PyObject *__pyx_codeobj__29; +static PyObject *__pyx_codeobj__31; +static PyObject *__pyx_codeobj__33; +static PyObject *__pyx_codeobj__35; +static PyObject *__pyx_codeobj__37; -/* "yt/utilities/lib/geometry_utils.pyx":43 +/* "yt/utilities/lib/geometry_utils.pyx":44 * @cython.boundscheck(False) * @cython.wraparound(False) * def find_values_at_point(np.ndarray[np.float64_t, ndim=1] point, # <<<<<<<<<<<<<< @@ -1886,11 +1947,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -1899,34 +1966,39 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 1); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 1); __PYX_ERR(0, 44, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 2); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 2); __PYX_ERR(0, 44, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dimensions)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 3); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 3); __PYX_ERR(0, 44, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_names)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 4); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 4); __PYX_ERR(0, 44, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid_objects)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 5); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 5); __PYX_ERR(0, 44, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_values_at_point") < 0)) __PYX_ERR(0, 43, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_values_at_point") < 0)) __PYX_ERR(0, 44, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -1947,16 +2019,16 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.geometry_utils.find_values_at_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_point), __pyx_ptype_5numpy_ndarray, 1, "point", 0))) __PYX_ERR(0, 43, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 44, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 45, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dimensions), __pyx_ptype_5numpy_ndarray, 1, "dimensions", 0))) __PYX_ERR(0, 46, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_point), __pyx_ptype_5numpy_ndarray, 1, "point", 0))) __PYX_ERR(0, 44, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 45, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 46, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dimensions), __pyx_ptype_5numpy_ndarray, 1, "dimensions", 0))) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14geometry_utils_find_values_at_point(__pyx_self, __pyx_v_point, __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_dimensions, __pyx_v_field_names, __pyx_v_grid_objects); /* function exit code */ @@ -2065,69 +2137,69 @@ __pyx_pybuffernd_dimensions.rcbuffer = &__pyx_pybuffer_dimensions; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_point.rcbuffer->pybuffer, (PyObject*)__pyx_v_point, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_point.rcbuffer->pybuffer, (PyObject*)__pyx_v_point, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 44, __pyx_L1_error) } __pyx_pybuffernd_point.diminfo[0].strides = __pyx_pybuffernd_point.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_point.diminfo[0].shape = __pyx_pybuffernd_point.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 44, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 44, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer, (PyObject*)__pyx_v_dimensions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer, (PyObject*)__pyx_v_dimensions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 44, __pyx_L1_error) } __pyx_pybuffernd_dimensions.diminfo[0].strides = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dimensions.diminfo[0].shape = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dimensions.diminfo[1].strides = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dimensions.diminfo[1].shape = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/geometry_utils.pyx":54 + /* "yt/utilities/lib/geometry_utils.pyx":55 * # strings and whatnot, but they should not be terribly slow. * cdef int ind[3] * cdef int gi, fi, nf = len(field_names) # <<<<<<<<<<<<<< * cdef np.float64_t dds * cdef np.ndarray[np.float64_t, ndim=3] field */ - __pyx_t_1 = PyObject_Length(__pyx_v_field_names); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_1 = PyObject_Length(__pyx_v_field_names); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 55, __pyx_L1_error) __pyx_v_nf = __pyx_t_1; - /* "yt/utilities/lib/geometry_utils.pyx":57 + /* "yt/utilities/lib/geometry_utils.pyx":58 * cdef np.float64_t dds * cdef np.ndarray[np.float64_t, ndim=3] field * cdef np.ndarray[np.float64_t, ndim=1] rv = np.zeros(nf, dtype='float64') # <<<<<<<<<<<<<< * for gi in range(left_edges.shape[0]): * if not ((left_edges[gi,0] < point[0] < right_edges[gi,0]) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 57, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_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, 57, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 58, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rv.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_rv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_rv.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 57, __pyx_L1_error) + __PYX_ERR(0, 58, __pyx_L1_error) } else {__pyx_pybuffernd_rv.diminfo[0].strides = __pyx_pybuffernd_rv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rv.diminfo[0].shape = __pyx_pybuffernd_rv.rcbuffer->pybuffer.shape[0]; } } @@ -2135,7 +2207,7 @@ __pyx_v_rv = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":58 + /* "yt/utilities/lib/geometry_utils.pyx":59 * cdef np.ndarray[np.float64_t, ndim=3] field * cdef np.ndarray[np.float64_t, ndim=1] rv = np.zeros(nf, dtype='float64') * for gi in range(left_edges.shape[0]): # <<<<<<<<<<<<<< @@ -2146,7 +2218,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_gi = __pyx_t_8; - /* "yt/utilities/lib/geometry_utils.pyx":59 + /* "yt/utilities/lib/geometry_utils.pyx":60 * cdef np.ndarray[np.float64_t, ndim=1] rv = np.zeros(nf, dtype='float64') * for gi in range(left_edges.shape[0]): * if not ((left_edges[gi,0] < point[0] < right_edges[gi,0]) # <<<<<<<<<<<<<< @@ -2170,7 +2242,7 @@ goto __pyx_L6_bool_binop_done; } - /* "yt/utilities/lib/geometry_utils.pyx":60 + /* "yt/utilities/lib/geometry_utils.pyx":61 * for gi in range(left_edges.shape[0]): * if not ((left_edges[gi,0] < point[0] < right_edges[gi,0]) * and (left_edges[gi,1] < point[1] < right_edges[gi,1]) # <<<<<<<<<<<<<< @@ -2194,7 +2266,7 @@ goto __pyx_L6_bool_binop_done; } - /* "yt/utilities/lib/geometry_utils.pyx":61 + /* "yt/utilities/lib/geometry_utils.pyx":62 * if not ((left_edges[gi,0] < point[0] < right_edges[gi,0]) * and (left_edges[gi,1] < point[1] < right_edges[gi,1]) * and (left_edges[gi,2] < point[2] < right_edges[gi,2])): # <<<<<<<<<<<<<< @@ -2215,7 +2287,7 @@ __pyx_t_9 = __pyx_t_17; __pyx_L6_bool_binop_done:; - /* "yt/utilities/lib/geometry_utils.pyx":59 + /* "yt/utilities/lib/geometry_utils.pyx":60 * cdef np.ndarray[np.float64_t, ndim=1] rv = np.zeros(nf, dtype='float64') * for gi in range(left_edges.shape[0]): * if not ((left_edges[gi,0] < point[0] < right_edges[gi,0]) # <<<<<<<<<<<<<< @@ -2225,7 +2297,7 @@ __pyx_t_17 = ((!__pyx_t_9) != 0); if (__pyx_t_17) { - /* "yt/utilities/lib/geometry_utils.pyx":62 + /* "yt/utilities/lib/geometry_utils.pyx":63 * and (left_edges[gi,1] < point[1] < right_edges[gi,1]) * and (left_edges[gi,2] < point[2] < right_edges[gi,2])): * continue # <<<<<<<<<<<<<< @@ -2234,7 +2306,7 @@ */ goto __pyx_L3_continue; - /* "yt/utilities/lib/geometry_utils.pyx":59 + /* "yt/utilities/lib/geometry_utils.pyx":60 * cdef np.ndarray[np.float64_t, ndim=1] rv = np.zeros(nf, dtype='float64') * for gi in range(left_edges.shape[0]): * if not ((left_edges[gi,0] < point[0] < right_edges[gi,0]) # <<<<<<<<<<<<<< @@ -2243,7 +2315,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":64 + /* "yt/utilities/lib/geometry_utils.pyx":65 * continue * # We found our grid! * for fi in range(3): # <<<<<<<<<<<<<< @@ -2253,7 +2325,7 @@ for (__pyx_t_28 = 0; __pyx_t_28 < 3; __pyx_t_28+=1) { __pyx_v_fi = __pyx_t_28; - /* "yt/utilities/lib/geometry_utils.pyx":65 + /* "yt/utilities/lib/geometry_utils.pyx":66 * # We found our grid! * for fi in range(3): * dds = ((right_edges[gi,fi] - left_edges[gi,fi])/ # <<<<<<<<<<<<<< @@ -2265,7 +2337,7 @@ __pyx_t_31 = __pyx_v_gi; __pyx_t_32 = __pyx_v_fi; - /* "yt/utilities/lib/geometry_utils.pyx":66 + /* "yt/utilities/lib/geometry_utils.pyx":67 * for fi in range(3): * dds = ((right_edges[gi,fi] - left_edges[gi,fi])/ * ( dimensions[gi,fi])) # <<<<<<<<<<<<<< @@ -2275,7 +2347,7 @@ __pyx_t_33 = __pyx_v_gi; __pyx_t_34 = __pyx_v_fi; - /* "yt/utilities/lib/geometry_utils.pyx":65 + /* "yt/utilities/lib/geometry_utils.pyx":66 * # We found our grid! * for fi in range(3): * dds = ((right_edges[gi,fi] - left_edges[gi,fi])/ # <<<<<<<<<<<<<< @@ -2284,7 +2356,7 @@ */ __pyx_v_dds = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right_edges.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_right_edges.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_left_edges.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_left_edges.diminfo[1].strides))) / ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_dimensions.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_dimensions.diminfo[1].strides)))); - /* "yt/utilities/lib/geometry_utils.pyx":67 + /* "yt/utilities/lib/geometry_utils.pyx":68 * dds = ((right_edges[gi,fi] - left_edges[gi,fi])/ * ( dimensions[gi,fi])) * ind[fi] = ((point[fi] - left_edges[gi,fi])/dds) # <<<<<<<<<<<<<< @@ -2297,19 +2369,19 @@ (__pyx_v_ind[__pyx_v_fi]) = ((int)(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_point.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_point.diminfo[0].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left_edges.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_left_edges.diminfo[1].strides))) / __pyx_v_dds)); } - /* "yt/utilities/lib/geometry_utils.pyx":68 + /* "yt/utilities/lib/geometry_utils.pyx":69 * ( dimensions[gi,fi])) * ind[fi] = ((point[fi] - left_edges[gi,fi])/dds) * grid = grid_objects[gi] # <<<<<<<<<<<<<< * for fi in range(nf): * field = grid[field_names[fi]] */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_grid_objects, __pyx_v_gi, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_grid_objects, __pyx_v_gi, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_grid = __pyx_t_5; __pyx_t_5 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":69 + /* "yt/utilities/lib/geometry_utils.pyx":70 * ind[fi] = ((point[fi] - left_edges[gi,fi])/dds) * grid = grid_objects[gi] * for fi in range(nf): # <<<<<<<<<<<<<< @@ -2320,19 +2392,19 @@ for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_28; __pyx_t_38+=1) { __pyx_v_fi = __pyx_t_38; - /* "yt/utilities/lib/geometry_utils.pyx":70 + /* "yt/utilities/lib/geometry_utils.pyx":71 * grid = grid_objects[gi] * for fi in range(nf): * field = grid[field_names[fi]] # <<<<<<<<<<<<<< * rv[fi] = field[ind[0], ind[1], ind[2]] * return rv */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_field_names, __pyx_v_fi, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_field_names, __pyx_v_fi, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_GetItem(__pyx_v_grid, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_grid, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 70, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_t_39 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2348,13 +2420,13 @@ } } __pyx_pybuffernd_field.diminfo[0].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field.diminfo[0].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_field.diminfo[1].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_field.diminfo[1].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_field.diminfo[2].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_field.diminfo[2].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_40 < 0)) __PYX_ERR(0, 70, __pyx_L1_error) + if (unlikely(__pyx_t_40 < 0)) __PYX_ERR(0, 71, __pyx_L1_error) } __pyx_t_39 = 0; __Pyx_XDECREF_SET(__pyx_v_field, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":71 + /* "yt/utilities/lib/geometry_utils.pyx":72 * for fi in range(nf): * field = grid[field_names[fi]] * rv[fi] = field[ind[0], ind[1], ind[2]] # <<<<<<<<<<<<<< @@ -2368,7 +2440,7 @@ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rv.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_rv.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_field.diminfo[1].strides, __pyx_t_46, __pyx_pybuffernd_field.diminfo[2].strides)); } - /* "yt/utilities/lib/geometry_utils.pyx":72 + /* "yt/utilities/lib/geometry_utils.pyx":73 * field = grid[field_names[fi]] * rv[fi] = field[ind[0], ind[1], ind[2]] * return rv # <<<<<<<<<<<<<< @@ -2382,7 +2454,7 @@ __pyx_L3_continue:; } - /* "yt/utilities/lib/geometry_utils.pyx":73 + /* "yt/utilities/lib/geometry_utils.pyx":74 * rv[fi] = field[ind[0], ind[1], ind[2]] * return rv * raise KeyError # <<<<<<<<<<<<<< @@ -2390,9 +2462,9 @@ * @cython.cdivision(True) */ __Pyx_Raise(__pyx_builtin_KeyError, 0, 0, 0); - __PYX_ERR(0, 73, __pyx_L1_error) + __PYX_ERR(0, 74, __pyx_L1_error) - /* "yt/utilities/lib/geometry_utils.pyx":43 + /* "yt/utilities/lib/geometry_utils.pyx":44 * @cython.boundscheck(False) * @cython.wraparound(False) * def find_values_at_point(np.ndarray[np.float64_t, ndim=1] point, # <<<<<<<<<<<<<< @@ -2436,7 +2508,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":78 +/* "yt/utilities/lib/geometry_utils.pyx":79 * @cython.boundscheck(False) * @cython.wraparound(False) * def obtain_rvec(data, ftype="gas"): # <<<<<<<<<<<<<< @@ -2462,7 +2534,9 @@ 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; } @@ -2471,6 +2545,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ftype); @@ -2478,11 +2553,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "obtain_rvec") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "obtain_rvec") < 0)) __PYX_ERR(0, 79, __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; @@ -2493,7 +2569,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("obtain_rvec", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("obtain_rvec", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 79, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.geometry_utils.obtain_rvec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2628,52 +2704,52 @@ __pyx_pybuffernd_rg.data = NULL; __pyx_pybuffernd_rg.rcbuffer = &__pyx_pybuffer_rg; - /* "yt/utilities/lib/geometry_utils.pyx":91 + /* "yt/utilities/lib/geometry_utils.pyx":92 * cdef np.float64_t c[3] * cdef int i, j, k * center = data.get_field_parameter("center") # <<<<<<<<<<<<<< * c[0] = center[0]; c[1] = center[1]; c[2] = center[2] * if len(data[ftype, 'x'].shape) == 1: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_get_field_parameter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_get_field_parameter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_center = __pyx_t_2; __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":92 + /* "yt/utilities/lib/geometry_utils.pyx":93 * cdef int i, j, k * center = data.get_field_parameter("center") * c[0] = center[0]; c[1] = center[1]; c[2] = center[2] # <<<<<<<<<<<<<< * if len(data[ftype, 'x'].shape) == 1: * # One dimensional data */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_c[0]) = __pyx_t_3; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_c[1]) = __pyx_t_3; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_c[2]) = __pyx_t_3; - /* "yt/utilities/lib/geometry_utils.pyx":93 + /* "yt/utilities/lib/geometry_utils.pyx":94 * center = data.get_field_parameter("center") * c[0] = center[0]; c[1] = center[1]; c[2] = center[2] * if len(data[ftype, 'x'].shape) == 1: # <<<<<<<<<<<<<< * # One dimensional data * xf = data[ftype, 'x'] */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -2681,25 +2757,25 @@ __Pyx_INCREF(__pyx_n_s_x); __Pyx_GIVEREF(__pyx_n_s_x); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_x); - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = ((__pyx_t_4 == 1) != 0); if (__pyx_t_5) { - /* "yt/utilities/lib/geometry_utils.pyx":95 + /* "yt/utilities/lib/geometry_utils.pyx":96 * if len(data[ftype, 'x'].shape) == 1: * # One dimensional data * xf = data[ftype, 'x'] # <<<<<<<<<<<<<< * yf = data[ftype, 'y'] * zf = data[ftype, 'z'] */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -2707,10 +2783,10 @@ __Pyx_INCREF(__pyx_n_s_x); __Pyx_GIVEREF(__pyx_n_s_x); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_x); - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __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, 95, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2726,20 +2802,20 @@ } } __pyx_pybuffernd_xf.diminfo[0].strides = __pyx_pybuffernd_xf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xf.diminfo[0].shape = __pyx_pybuffernd_xf.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 96, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_xf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":96 + /* "yt/utilities/lib/geometry_utils.pyx":97 * # One dimensional data * xf = data[ftype, 'x'] * yf = data[ftype, 'y'] # <<<<<<<<<<<<<< * zf = data[ftype, 'z'] * rf = np.empty((3, xf.shape[0]), 'float64') */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -2747,10 +2823,10 @@ __Pyx_INCREF(__pyx_n_s_y); __Pyx_GIVEREF(__pyx_n_s_y); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_y); - __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 96, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 97, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2766,20 +2842,20 @@ } } __pyx_pybuffernd_yf.diminfo[0].strides = __pyx_pybuffernd_yf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yf.diminfo[0].shape = __pyx_pybuffernd_yf.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) } __pyx_t_11 = 0; __pyx_v_yf = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":97 + /* "yt/utilities/lib/geometry_utils.pyx":98 * xf = data[ftype, 'x'] * yf = data[ftype, 'y'] * zf = data[ftype, 'z'] # <<<<<<<<<<<<<< * rf = np.empty((3, xf.shape[0]), 'float64') * for i in range(xf.shape[0]): */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -2787,10 +2863,10 @@ __Pyx_INCREF(__pyx_n_s_z); __Pyx_GIVEREF(__pyx_n_s_z); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_z); - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __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, 97, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2806,27 +2882,27 @@ } } __pyx_pybuffernd_zf.diminfo[0].strides = __pyx_pybuffernd_zf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_zf.diminfo[0].shape = __pyx_pybuffernd_zf.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 98, __pyx_L1_error) } __pyx_t_12 = 0; __pyx_v_zf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":98 + /* "yt/utilities/lib/geometry_utils.pyx":99 * yf = data[ftype, 'y'] * zf = data[ftype, 'z'] * rf = np.empty((3, xf.shape[0]), 'float64') # <<<<<<<<<<<<<< * for i in range(xf.shape[0]): * rf[0, i] = xf[i] - c[0] */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xf->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xf->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); @@ -2849,7 +2925,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_14, __pyx_n_s_float64}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; @@ -2858,14 +2934,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_14, __pyx_n_s_float64}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif { - __pyx_t_15 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -2876,12 +2952,12 @@ __Pyx_GIVEREF(__pyx_n_s_float64); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_7, __pyx_n_s_float64); __pyx_t_14 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 98, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_t_16 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2897,13 +2973,13 @@ } } __pyx_pybuffernd_rf.diminfo[0].strides = __pyx_pybuffernd_rf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rf.diminfo[0].shape = __pyx_pybuffernd_rf.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rf.diminfo[1].strides = __pyx_pybuffernd_rf.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rf.diminfo[1].shape = __pyx_pybuffernd_rf.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 98, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 99, __pyx_L1_error) } __pyx_t_16 = 0; __pyx_v_rf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":99 + /* "yt/utilities/lib/geometry_utils.pyx":100 * zf = data[ftype, 'z'] * rf = np.empty((3, xf.shape[0]), 'float64') * for i in range(xf.shape[0]): # <<<<<<<<<<<<<< @@ -2914,7 +2990,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_17; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/geometry_utils.pyx":100 + /* "yt/utilities/lib/geometry_utils.pyx":101 * rf = np.empty((3, xf.shape[0]), 'float64') * for i in range(xf.shape[0]): * rf[0, i] = xf[i] - c[0] # <<<<<<<<<<<<<< @@ -2926,7 +3002,7 @@ __pyx_t_20 = __pyx_v_i; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rf.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_rf.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_rf.diminfo[1].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_xf.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_xf.diminfo[0].strides)) - (__pyx_v_c[0])); - /* "yt/utilities/lib/geometry_utils.pyx":101 + /* "yt/utilities/lib/geometry_utils.pyx":102 * for i in range(xf.shape[0]): * rf[0, i] = xf[i] - c[0] * rf[1, i] = yf[i] - c[1] # <<<<<<<<<<<<<< @@ -2938,7 +3014,7 @@ __pyx_t_23 = __pyx_v_i; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rf.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rf.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_rf.diminfo[1].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_yf.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_yf.diminfo[0].strides)) - (__pyx_v_c[1])); - /* "yt/utilities/lib/geometry_utils.pyx":102 + /* "yt/utilities/lib/geometry_utils.pyx":103 * rf[0, i] = xf[i] - c[0] * rf[1, i] = yf[i] - c[1] * rf[2, i] = zf[i] - c[2] # <<<<<<<<<<<<<< @@ -2951,7 +3027,7 @@ *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rf.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_rf.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_rf.diminfo[1].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zf.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_zf.diminfo[0].strides)) - (__pyx_v_c[2])); } - /* "yt/utilities/lib/geometry_utils.pyx":103 + /* "yt/utilities/lib/geometry_utils.pyx":104 * rf[1, i] = yf[i] - c[1] * rf[2, i] = zf[i] - c[2] * return rf # <<<<<<<<<<<<<< @@ -2963,7 +3039,7 @@ __pyx_r = ((PyObject *)__pyx_v_rf); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":93 + /* "yt/utilities/lib/geometry_utils.pyx":94 * center = data.get_field_parameter("center") * c[0] = center[0]; c[1] = center[1]; c[2] = center[2] * if len(data[ftype, 'x'].shape) == 1: # <<<<<<<<<<<<<< @@ -2972,7 +3048,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":106 + /* "yt/utilities/lib/geometry_utils.pyx":107 * else: * # Three dimensional data * xg = data[ftype, 'x'] # <<<<<<<<<<<<<< @@ -2980,7 +3056,7 @@ * zg = data[ftype, 'z'] */ /*else*/ { - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -2988,10 +3064,10 @@ __Pyx_INCREF(__pyx_n_s_x); __Pyx_GIVEREF(__pyx_n_s_x); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_x); - __pyx_t_13 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_13 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 106, __pyx_L1_error) + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 107, __pyx_L1_error) __pyx_t_27 = ((PyArrayObject *)__pyx_t_13); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3007,20 +3083,20 @@ } } __pyx_pybuffernd_xg.diminfo[0].strides = __pyx_pybuffernd_xg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xg.diminfo[0].shape = __pyx_pybuffernd_xg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_xg.diminfo[1].strides = __pyx_pybuffernd_xg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_xg.diminfo[1].shape = __pyx_pybuffernd_xg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_xg.diminfo[2].strides = __pyx_pybuffernd_xg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_xg.diminfo[2].shape = __pyx_pybuffernd_xg.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 106, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_t_27 = 0; __pyx_v_xg = ((PyArrayObject *)__pyx_t_13); __pyx_t_13 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":107 + /* "yt/utilities/lib/geometry_utils.pyx":108 * # Three dimensional data * xg = data[ftype, 'x'] * yg = data[ftype, 'y'] # <<<<<<<<<<<<<< * zg = data[ftype, 'z'] * rg = np.empty((3, xg.shape[0], xg.shape[1], xg.shape[2]), 'float64') */ - __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -3028,10 +3104,10 @@ __Pyx_INCREF(__pyx_n_s_y); __Pyx_GIVEREF(__pyx_n_s_y); PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_y); - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 107, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 108, __pyx_L1_error) __pyx_t_28 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3047,20 +3123,20 @@ } } __pyx_pybuffernd_yg.diminfo[0].strides = __pyx_pybuffernd_yg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yg.diminfo[0].shape = __pyx_pybuffernd_yg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_yg.diminfo[1].strides = __pyx_pybuffernd_yg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_yg.diminfo[1].shape = __pyx_pybuffernd_yg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_yg.diminfo[2].strides = __pyx_pybuffernd_yg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_yg.diminfo[2].shape = __pyx_pybuffernd_yg.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 107, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 108, __pyx_L1_error) } __pyx_t_28 = 0; __pyx_v_yg = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":108 + /* "yt/utilities/lib/geometry_utils.pyx":109 * xg = data[ftype, 'x'] * yg = data[ftype, 'y'] * zg = data[ftype, 'z'] # <<<<<<<<<<<<<< * rg = np.empty((3, xg.shape[0], xg.shape[1], xg.shape[2]), 'float64') * for i in range(xg.shape[0]): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -3068,10 +3144,10 @@ __Pyx_INCREF(__pyx_n_s_z); __Pyx_GIVEREF(__pyx_n_s_z); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_z); - __pyx_t_13 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_13 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 108, __pyx_L1_error) + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 109, __pyx_L1_error) __pyx_t_29 = ((PyArrayObject *)__pyx_t_13); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3087,31 +3163,31 @@ } } __pyx_pybuffernd_zg.diminfo[0].strides = __pyx_pybuffernd_zg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_zg.diminfo[0].shape = __pyx_pybuffernd_zg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_zg.diminfo[1].strides = __pyx_pybuffernd_zg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_zg.diminfo[1].shape = __pyx_pybuffernd_zg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_zg.diminfo[2].strides = __pyx_pybuffernd_zg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_zg.diminfo[2].shape = __pyx_pybuffernd_zg.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 108, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 109, __pyx_L1_error) } __pyx_t_29 = 0; __pyx_v_zg = ((PyArrayObject *)__pyx_t_13); __pyx_t_13 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":109 + /* "yt/utilities/lib/geometry_utils.pyx":110 * yg = data[ftype, 'y'] * zg = data[ftype, 'z'] * rg = np.empty((3, xg.shape[0], xg.shape[1], xg.shape[2]), 'float64') # <<<<<<<<<<<<<< * for i in range(xg.shape[0]): * for j in range(xg.shape[1]): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xg->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xg->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xg->dimensions[1])); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xg->dimensions[1])); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xg->dimensions[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xg->dimensions[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_30 = PyTuple_New(4); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_30 = PyTuple_New(4); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_30); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); @@ -3140,7 +3216,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_30, __pyx_n_s_float64}; - __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0; @@ -3149,14 +3225,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_30, __pyx_n_s_float64}; - __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0; } else #endif { - __pyx_t_14 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -3167,12 +3243,12 @@ __Pyx_GIVEREF(__pyx_n_s_float64); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_7, __pyx_n_s_float64); __pyx_t_30 = 0; - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 109, __pyx_L1_error) + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 110, __pyx_L1_error) __pyx_t_31 = ((PyArrayObject *)__pyx_t_13); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3188,13 +3264,13 @@ } } __pyx_pybuffernd_rg.diminfo[0].strides = __pyx_pybuffernd_rg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rg.diminfo[0].shape = __pyx_pybuffernd_rg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rg.diminfo[1].strides = __pyx_pybuffernd_rg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rg.diminfo[1].shape = __pyx_pybuffernd_rg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_rg.diminfo[2].strides = __pyx_pybuffernd_rg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_rg.diminfo[2].shape = __pyx_pybuffernd_rg.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_rg.diminfo[3].strides = __pyx_pybuffernd_rg.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_rg.diminfo[3].shape = __pyx_pybuffernd_rg.rcbuffer->pybuffer.shape[3]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 109, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 110, __pyx_L1_error) } __pyx_t_31 = 0; __pyx_v_rg = ((PyArrayObject *)__pyx_t_13); __pyx_t_13 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":110 + /* "yt/utilities/lib/geometry_utils.pyx":111 * zg = data[ftype, 'z'] * rg = np.empty((3, xg.shape[0], xg.shape[1], xg.shape[2]), 'float64') * for i in range(xg.shape[0]): # <<<<<<<<<<<<<< @@ -3205,7 +3281,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_17; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/geometry_utils.pyx":111 + /* "yt/utilities/lib/geometry_utils.pyx":112 * rg = np.empty((3, xg.shape[0], xg.shape[1], xg.shape[2]), 'float64') * for i in range(xg.shape[0]): * for j in range(xg.shape[1]): # <<<<<<<<<<<<<< @@ -3216,7 +3292,7 @@ for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) { __pyx_v_j = __pyx_t_33; - /* "yt/utilities/lib/geometry_utils.pyx":112 + /* "yt/utilities/lib/geometry_utils.pyx":113 * for i in range(xg.shape[0]): * for j in range(xg.shape[1]): * for k in range(xg.shape[2]): # <<<<<<<<<<<<<< @@ -3227,7 +3303,7 @@ for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { __pyx_v_k = __pyx_t_35; - /* "yt/utilities/lib/geometry_utils.pyx":113 + /* "yt/utilities/lib/geometry_utils.pyx":114 * for j in range(xg.shape[1]): * for k in range(xg.shape[2]): * rg[0,i,j,k] = xg[i,j,k] - c[0] # <<<<<<<<<<<<<< @@ -3243,7 +3319,7 @@ __pyx_t_42 = __pyx_v_k; *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rg.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rg.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_rg.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_rg.diminfo[2].strides, __pyx_t_42, __pyx_pybuffernd_rg.diminfo[3].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_xg.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_xg.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_xg.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_xg.diminfo[2].strides)) - (__pyx_v_c[0])); - /* "yt/utilities/lib/geometry_utils.pyx":114 + /* "yt/utilities/lib/geometry_utils.pyx":115 * for k in range(xg.shape[2]): * rg[0,i,j,k] = xg[i,j,k] - c[0] * rg[1,i,j,k] = yg[i,j,k] - c[1] # <<<<<<<<<<<<<< @@ -3259,7 +3335,7 @@ __pyx_t_49 = __pyx_v_k; *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rg.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_rg.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_rg.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_rg.diminfo[2].strides, __pyx_t_49, __pyx_pybuffernd_rg.diminfo[3].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_yg.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_yg.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_yg.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_yg.diminfo[2].strides)) - (__pyx_v_c[1])); - /* "yt/utilities/lib/geometry_utils.pyx":115 + /* "yt/utilities/lib/geometry_utils.pyx":116 * rg[0,i,j,k] = xg[i,j,k] - c[0] * rg[1,i,j,k] = yg[i,j,k] - c[1] * rg[2,i,j,k] = zg[i,j,k] - c[2] # <<<<<<<<<<<<<< @@ -3278,7 +3354,7 @@ } } - /* "yt/utilities/lib/geometry_utils.pyx":116 + /* "yt/utilities/lib/geometry_utils.pyx":117 * rg[1,i,j,k] = yg[i,j,k] - c[1] * rg[2,i,j,k] = zg[i,j,k] - c[2] * return rg # <<<<<<<<<<<<<< @@ -3291,7 +3367,7 @@ goto __pyx_L0; } - /* "yt/utilities/lib/geometry_utils.pyx":78 + /* "yt/utilities/lib/geometry_utils.pyx":79 * @cython.boundscheck(False) * @cython.wraparound(False) * def obtain_rvec(data, ftype="gas"): # <<<<<<<<<<<<<< @@ -3347,7 +3423,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":121 +/* "yt/utilities/lib/geometry_utils.pyx":122 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t graycode(np.int64_t x): # <<<<<<<<<<<<<< @@ -3360,7 +3436,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("graycode", 0); - /* "yt/utilities/lib/geometry_utils.pyx":122 + /* "yt/utilities/lib/geometry_utils.pyx":123 * @cython.wraparound(False) * cdef np.int64_t graycode(np.int64_t x): * return x^(x>>1) # <<<<<<<<<<<<<< @@ -3370,7 +3446,7 @@ __pyx_r = (__pyx_v_x ^ (__pyx_v_x >> 1)); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":121 + /* "yt/utilities/lib/geometry_utils.pyx":122 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t graycode(np.int64_t x): # <<<<<<<<<<<<<< @@ -3384,7 +3460,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":127 +/* "yt/utilities/lib/geometry_utils.pyx":128 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t igraycode(np.int64_t x): # <<<<<<<<<<<<<< @@ -3403,7 +3479,7 @@ __pyx_t_5numpy_int64_t __pyx_t_3; __Pyx_RefNannySetupContext("igraycode", 0); - /* "yt/utilities/lib/geometry_utils.pyx":129 + /* "yt/utilities/lib/geometry_utils.pyx":130 * cdef np.int64_t igraycode(np.int64_t x): * cdef np.int64_t i, j * if x == 0: # <<<<<<<<<<<<<< @@ -3413,7 +3489,7 @@ __pyx_t_1 = ((__pyx_v_x == 0) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/geometry_utils.pyx":130 + /* "yt/utilities/lib/geometry_utils.pyx":131 * cdef np.int64_t i, j * if x == 0: * return x # <<<<<<<<<<<<<< @@ -3423,7 +3499,7 @@ __pyx_r = __pyx_v_x; goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":129 + /* "yt/utilities/lib/geometry_utils.pyx":130 * cdef np.int64_t igraycode(np.int64_t x): * cdef np.int64_t i, j * if x == 0: # <<<<<<<<<<<<<< @@ -3432,7 +3508,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":131 + /* "yt/utilities/lib/geometry_utils.pyx":132 * if x == 0: * return x * m = ceil(log2(x)) + 1 # <<<<<<<<<<<<<< @@ -3441,7 +3517,7 @@ */ __pyx_v_m = (((__pyx_t_5numpy_int64_t)ceil(log2(__pyx_v_x))) + 1); - /* "yt/utilities/lib/geometry_utils.pyx":132 + /* "yt/utilities/lib/geometry_utils.pyx":133 * return x * m = ceil(log2(x)) + 1 * i, j = x, 1 # <<<<<<<<<<<<<< @@ -3453,7 +3529,7 @@ __pyx_v_i = __pyx_t_2; __pyx_v_j = __pyx_t_3; - /* "yt/utilities/lib/geometry_utils.pyx":133 + /* "yt/utilities/lib/geometry_utils.pyx":134 * m = ceil(log2(x)) + 1 * i, j = x, 1 * while j < m: # <<<<<<<<<<<<<< @@ -3464,7 +3540,7 @@ __pyx_t_1 = ((__pyx_v_j < __pyx_v_m) != 0); if (!__pyx_t_1) break; - /* "yt/utilities/lib/geometry_utils.pyx":134 + /* "yt/utilities/lib/geometry_utils.pyx":135 * i, j = x, 1 * while j < m: * i = i ^ (x>>j) # <<<<<<<<<<<<<< @@ -3473,7 +3549,7 @@ */ __pyx_v_i = (__pyx_v_i ^ (__pyx_v_x >> __pyx_v_j)); - /* "yt/utilities/lib/geometry_utils.pyx":135 + /* "yt/utilities/lib/geometry_utils.pyx":136 * while j < m: * i = i ^ (x>>j) * j += 1 # <<<<<<<<<<<<<< @@ -3483,7 +3559,7 @@ __pyx_v_j = (__pyx_v_j + 1); } - /* "yt/utilities/lib/geometry_utils.pyx":136 + /* "yt/utilities/lib/geometry_utils.pyx":137 * i = i ^ (x>>j) * j += 1 * return i # <<<<<<<<<<<<<< @@ -3493,7 +3569,7 @@ __pyx_r = __pyx_v_i; goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":127 + /* "yt/utilities/lib/geometry_utils.pyx":128 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t igraycode(np.int64_t x): # <<<<<<<<<<<<<< @@ -3507,7 +3583,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":141 +/* "yt/utilities/lib/geometry_utils.pyx":142 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t direction(np.int64_t x, np.int64_t n): # <<<<<<<<<<<<<< @@ -3521,7 +3597,7 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("direction", 0); - /* "yt/utilities/lib/geometry_utils.pyx":143 + /* "yt/utilities/lib/geometry_utils.pyx":144 * cdef np.int64_t direction(np.int64_t x, np.int64_t n): * #assert x < 2**n * if x == 0: # <<<<<<<<<<<<<< @@ -3531,7 +3607,7 @@ __pyx_t_1 = ((__pyx_v_x == 0) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/geometry_utils.pyx":144 + /* "yt/utilities/lib/geometry_utils.pyx":145 * #assert x < 2**n * if x == 0: * return 0 # <<<<<<<<<<<<<< @@ -3541,7 +3617,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":143 + /* "yt/utilities/lib/geometry_utils.pyx":144 * cdef np.int64_t direction(np.int64_t x, np.int64_t n): * #assert x < 2**n * if x == 0: # <<<<<<<<<<<<<< @@ -3550,7 +3626,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":145 + /* "yt/utilities/lib/geometry_utils.pyx":146 * if x == 0: * return 0 * elif x%2 == 0: # <<<<<<<<<<<<<< @@ -3560,7 +3636,7 @@ __pyx_t_1 = (((__pyx_v_x % 2) == 0) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/geometry_utils.pyx":146 + /* "yt/utilities/lib/geometry_utils.pyx":147 * return 0 * elif x%2 == 0: * return tsb(x-1, n)%n # <<<<<<<<<<<<<< @@ -3570,7 +3646,7 @@ __pyx_r = (__pyx_f_2yt_9utilities_3lib_14geometry_utils_tsb((__pyx_v_x - 1), __pyx_v_n) % __pyx_v_n); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":145 + /* "yt/utilities/lib/geometry_utils.pyx":146 * if x == 0: * return 0 * elif x%2 == 0: # <<<<<<<<<<<<<< @@ -3579,7 +3655,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":148 + /* "yt/utilities/lib/geometry_utils.pyx":149 * return tsb(x-1, n)%n * else: * return tsb(x, n)%n # <<<<<<<<<<<<<< @@ -3591,7 +3667,7 @@ goto __pyx_L0; } - /* "yt/utilities/lib/geometry_utils.pyx":141 + /* "yt/utilities/lib/geometry_utils.pyx":142 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t direction(np.int64_t x, np.int64_t n): # <<<<<<<<<<<<<< @@ -3605,7 +3681,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":153 +/* "yt/utilities/lib/geometry_utils.pyx":154 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t tsb(np.int64_t x, np.int64_t width): # <<<<<<<<<<<<<< @@ -3621,7 +3697,7 @@ int __pyx_t_2; __Pyx_RefNannySetupContext("tsb", 0); - /* "yt/utilities/lib/geometry_utils.pyx":155 + /* "yt/utilities/lib/geometry_utils.pyx":156 * cdef np.int64_t tsb(np.int64_t x, np.int64_t width): * #assert x < 2**width * cdef np.int64_t i = 0 # <<<<<<<<<<<<<< @@ -3630,7 +3706,7 @@ */ __pyx_v_i = 0; - /* "yt/utilities/lib/geometry_utils.pyx":156 + /* "yt/utilities/lib/geometry_utils.pyx":157 * #assert x < 2**width * cdef np.int64_t i = 0 * while x&1 and i <= width: # <<<<<<<<<<<<<< @@ -3649,7 +3725,7 @@ __pyx_L5_bool_binop_done:; if (!__pyx_t_1) break; - /* "yt/utilities/lib/geometry_utils.pyx":157 + /* "yt/utilities/lib/geometry_utils.pyx":158 * cdef np.int64_t i = 0 * while x&1 and i <= width: * x = x >> 1 # <<<<<<<<<<<<<< @@ -3658,7 +3734,7 @@ */ __pyx_v_x = (__pyx_v_x >> 1); - /* "yt/utilities/lib/geometry_utils.pyx":158 + /* "yt/utilities/lib/geometry_utils.pyx":159 * while x&1 and i <= width: * x = x >> 1 * i += 1 # <<<<<<<<<<<<<< @@ -3668,7 +3744,7 @@ __pyx_v_i = (__pyx_v_i + 1); } - /* "yt/utilities/lib/geometry_utils.pyx":159 + /* "yt/utilities/lib/geometry_utils.pyx":160 * x = x >> 1 * i += 1 * return i # <<<<<<<<<<<<<< @@ -3678,7 +3754,7 @@ __pyx_r = __pyx_v_i; goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":153 + /* "yt/utilities/lib/geometry_utils.pyx":154 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t tsb(np.int64_t x, np.int64_t width): # <<<<<<<<<<<<<< @@ -3692,7 +3768,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":164 +/* "yt/utilities/lib/geometry_utils.pyx":165 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t bitrange(np.int64_t x, np.int64_t width, # <<<<<<<<<<<<<< @@ -3705,7 +3781,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bitrange", 0); - /* "yt/utilities/lib/geometry_utils.pyx":166 + /* "yt/utilities/lib/geometry_utils.pyx":167 * cdef np.int64_t bitrange(np.int64_t x, np.int64_t width, * np.int64_t start, np.int64_t end): * return x >> (width-end) & ((2**(end-start))-1) # <<<<<<<<<<<<<< @@ -3715,7 +3791,7 @@ __pyx_r = ((__pyx_v_x >> (__pyx_v_width - __pyx_v_end)) & (__Pyx_pow___pyx_t_5numpy_int64_t(2, (__pyx_v_end - __pyx_v_start)) - 1)); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":164 + /* "yt/utilities/lib/geometry_utils.pyx":165 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t bitrange(np.int64_t x, np.int64_t width, # <<<<<<<<<<<<<< @@ -3729,7 +3805,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":171 +/* "yt/utilities/lib/geometry_utils.pyx":172 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t rrot(np.int64_t x, np.int64_t i, np.int64_t width): # <<<<<<<<<<<<<< @@ -3742,7 +3818,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rrot", 0); - /* "yt/utilities/lib/geometry_utils.pyx":172 + /* "yt/utilities/lib/geometry_utils.pyx":173 * @cython.wraparound(False) * cdef np.int64_t rrot(np.int64_t x, np.int64_t i, np.int64_t width): * i = i%width # <<<<<<<<<<<<<< @@ -3751,7 +3827,7 @@ */ __pyx_v_i = (__pyx_v_i % __pyx_v_width); - /* "yt/utilities/lib/geometry_utils.pyx":173 + /* "yt/utilities/lib/geometry_utils.pyx":174 * cdef np.int64_t rrot(np.int64_t x, np.int64_t i, np.int64_t width): * i = i%width * x = (x>>i) | (x<> __pyx_v_i) | (__pyx_v_x << (__pyx_v_width - __pyx_v_i))); - /* "yt/utilities/lib/geometry_utils.pyx":174 + /* "yt/utilities/lib/geometry_utils.pyx":175 * i = i%width * x = (x>>i) | (x<>width-i) # <<<<<<<<<<<<<< @@ -3815,7 +3891,7 @@ */ __pyx_v_x = ((__pyx_v_x << __pyx_v_i) | (__pyx_v_x >> (__pyx_v_width - __pyx_v_i))); - /* "yt/utilities/lib/geometry_utils.pyx":182 + /* "yt/utilities/lib/geometry_utils.pyx":183 * i = i%width * x = (x<>width-i) * return x&(2**width-1) # <<<<<<<<<<<<<< @@ -3825,7 +3901,7 @@ __pyx_r = (__pyx_v_x & (__Pyx_pow___pyx_t_5numpy_int64_t(2, __pyx_v_width) - 1)); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":179 + /* "yt/utilities/lib/geometry_utils.pyx":180 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t lrot(np.int64_t x, np.int64_t i, np.int64_t width): # <<<<<<<<<<<<<< @@ -3839,7 +3915,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":187 +/* "yt/utilities/lib/geometry_utils.pyx":188 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t transform(np.int64_t entry, np.int64_t direction, # <<<<<<<<<<<<<< @@ -3852,7 +3928,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transform", 0); - /* "yt/utilities/lib/geometry_utils.pyx":189 + /* "yt/utilities/lib/geometry_utils.pyx":190 * cdef np.int64_t transform(np.int64_t entry, np.int64_t direction, * np.int64_t width, np.int64_t x): * return rrot((x^entry), direction + 1, width) # <<<<<<<<<<<<<< @@ -3862,7 +3938,7 @@ __pyx_r = __pyx_f_2yt_9utilities_3lib_14geometry_utils_rrot((__pyx_v_x ^ __pyx_v_entry), (__pyx_v_direction + 1), __pyx_v_width); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":187 + /* "yt/utilities/lib/geometry_utils.pyx":188 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t transform(np.int64_t entry, np.int64_t direction, # <<<<<<<<<<<<<< @@ -3876,7 +3952,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":194 +/* "yt/utilities/lib/geometry_utils.pyx":195 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t entry(np.int64_t x): # <<<<<<<<<<<<<< @@ -3890,7 +3966,7 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("entry", 0); - /* "yt/utilities/lib/geometry_utils.pyx":195 + /* "yt/utilities/lib/geometry_utils.pyx":196 * @cython.wraparound(False) * cdef np.int64_t entry(np.int64_t x): * if x == 0: return 0 # <<<<<<<<<<<<<< @@ -3903,7 +3979,7 @@ goto __pyx_L0; } - /* "yt/utilities/lib/geometry_utils.pyx":196 + /* "yt/utilities/lib/geometry_utils.pyx":197 * cdef np.int64_t entry(np.int64_t x): * if x == 0: return 0 * return graycode(2*((x-1)/2)) # <<<<<<<<<<<<<< @@ -3913,7 +3989,7 @@ __pyx_r = __pyx_f_2yt_9utilities_3lib_14geometry_utils_graycode((2 * ((__pyx_v_x - 1) / 2))); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":194 + /* "yt/utilities/lib/geometry_utils.pyx":195 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t entry(np.int64_t x): # <<<<<<<<<<<<<< @@ -3927,7 +4003,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":201 +/* "yt/utilities/lib/geometry_utils.pyx":202 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t setbit(np.int64_t x, np.int64_t w, np.int64_t i, np.int64_t b): # <<<<<<<<<<<<<< @@ -3940,7 +4016,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setbit", 0); - /* "yt/utilities/lib/geometry_utils.pyx":202 + /* "yt/utilities/lib/geometry_utils.pyx":203 * @cython.wraparound(False) * cdef np.int64_t setbit(np.int64_t x, np.int64_t w, np.int64_t i, np.int64_t b): * if b == 1: # <<<<<<<<<<<<<< @@ -3950,7 +4026,7 @@ switch (__pyx_v_b) { case 1: - /* "yt/utilities/lib/geometry_utils.pyx":203 + /* "yt/utilities/lib/geometry_utils.pyx":204 * cdef np.int64_t setbit(np.int64_t x, np.int64_t w, np.int64_t i, np.int64_t b): * if b == 1: * return x | 2**(w-i-1) # <<<<<<<<<<<<<< @@ -3960,7 +4036,7 @@ __pyx_r = (__pyx_v_x | __Pyx_pow___pyx_t_5numpy_int64_t(2, ((__pyx_v_w - __pyx_v_i) - 1))); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":202 + /* "yt/utilities/lib/geometry_utils.pyx":203 * @cython.wraparound(False) * cdef np.int64_t setbit(np.int64_t x, np.int64_t w, np.int64_t i, np.int64_t b): * if b == 1: # <<<<<<<<<<<<<< @@ -3969,7 +4045,7 @@ */ break; - /* "yt/utilities/lib/geometry_utils.pyx":204 + /* "yt/utilities/lib/geometry_utils.pyx":205 * if b == 1: * return x | 2**(w-i-1) * elif b == 0: # <<<<<<<<<<<<<< @@ -3978,7 +4054,7 @@ */ case 0: - /* "yt/utilities/lib/geometry_utils.pyx":205 + /* "yt/utilities/lib/geometry_utils.pyx":206 * return x | 2**(w-i-1) * elif b == 0: * return x & ~2**(w-i-1) # <<<<<<<<<<<<<< @@ -3988,7 +4064,7 @@ __pyx_r = (__pyx_v_x & (~__Pyx_pow___pyx_t_5numpy_int64_t(2, ((__pyx_v_w - __pyx_v_i) - 1)))); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":204 + /* "yt/utilities/lib/geometry_utils.pyx":205 * if b == 1: * return x | 2**(w-i-1) * elif b == 0: # <<<<<<<<<<<<<< @@ -3999,7 +4075,7 @@ default: break; } - /* "yt/utilities/lib/geometry_utils.pyx":201 + /* "yt/utilities/lib/geometry_utils.pyx":202 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t setbit(np.int64_t x, np.int64_t w, np.int64_t i, np.int64_t b): # <<<<<<<<<<<<<< @@ -4014,7 +4090,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":210 +/* "yt/utilities/lib/geometry_utils.pyx":211 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef np.int64_t point_to_hilbert(int order, np.int64_t p[3]): # <<<<<<<<<<<<<< @@ -4038,7 +4114,7 @@ __pyx_t_5numpy_int64_t __pyx_t_3; __Pyx_RefNannySetupContext("point_to_hilbert", 0); - /* "yt/utilities/lib/geometry_utils.pyx":212 + /* "yt/utilities/lib/geometry_utils.pyx":213 * cdef np.int64_t point_to_hilbert(int order, np.int64_t p[3]): * cdef np.int64_t h, e, d, l, b, w, i, x * h = e = d = 0 # <<<<<<<<<<<<<< @@ -4049,7 +4125,7 @@ __pyx_v_e = 0; __pyx_v_d = 0; - /* "yt/utilities/lib/geometry_utils.pyx":213 + /* "yt/utilities/lib/geometry_utils.pyx":214 * cdef np.int64_t h, e, d, l, b, w, i, x * h = e = d = 0 * for i in range(order): # <<<<<<<<<<<<<< @@ -4060,7 +4136,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/geometry_utils.pyx":214 + /* "yt/utilities/lib/geometry_utils.pyx":215 * h = e = d = 0 * for i in range(order): * l = 0 # <<<<<<<<<<<<<< @@ -4069,7 +4145,7 @@ */ __pyx_v_l = 0; - /* "yt/utilities/lib/geometry_utils.pyx":215 + /* "yt/utilities/lib/geometry_utils.pyx":216 * for i in range(order): * l = 0 * for x in range(3): # <<<<<<<<<<<<<< @@ -4079,7 +4155,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_x = __pyx_t_3; - /* "yt/utilities/lib/geometry_utils.pyx":216 + /* "yt/utilities/lib/geometry_utils.pyx":217 * l = 0 * for x in range(3): * b = bitrange(p[3-x-1], order, i, i+1) # <<<<<<<<<<<<<< @@ -4088,7 +4164,7 @@ */ __pyx_v_b = __pyx_f_2yt_9utilities_3lib_14geometry_utils_bitrange((__pyx_v_p[((3 - __pyx_v_x) - 1)]), __pyx_v_order, __pyx_v_i, (__pyx_v_i + 1)); - /* "yt/utilities/lib/geometry_utils.pyx":217 + /* "yt/utilities/lib/geometry_utils.pyx":218 * for x in range(3): * b = bitrange(p[3-x-1], order, i, i+1) * l |= (b< 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_hilbert_indices") < 0)) __PYX_ERR(0, 270, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_hilbert_indices") < 0)) __PYX_ERR(0, 271, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4360,18 +4439,18 @@ values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_order = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_order == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L3_error) + __pyx_v_order = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_order == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) __pyx_v_left_index = ((PyArrayObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_hilbert_indices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 270, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_hilbert_indices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.geometry_utils.get_hilbert_indices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_index), __pyx_ptype_5numpy_ndarray, 1, "left_index", 0))) __PYX_ERR(0, 270, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_index), __pyx_ptype_5numpy_ndarray, 1, "left_index", 0))) __PYX_ERR(0, 271, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14geometry_utils_4get_hilbert_indices(__pyx_self, __pyx_v_order, __pyx_v_left_index); /* function exit code */ @@ -4422,23 +4501,23 @@ __pyx_pybuffernd_left_index.rcbuffer = &__pyx_pybuffer_left_index; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 270, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error) } __pyx_pybuffernd_left_index.diminfo[0].strides = __pyx_pybuffernd_left_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_index.diminfo[0].shape = __pyx_pybuffernd_left_index.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_index.diminfo[1].strides = __pyx_pybuffernd_left_index.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_index.diminfo[1].shape = __pyx_pybuffernd_left_index.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/geometry_utils.pyx":275 + /* "yt/utilities/lib/geometry_utils.pyx":276 * cdef np.int64_t p[3] * cdef np.ndarray[np.int64_t, ndim=1] hilbert_indices * hilbert_indices = np.zeros(left_index.shape[0], 'int64') # <<<<<<<<<<<<<< * for i in range(left_index.shape[0]): * p[0] = left_index[i, 0] */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_left_index->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_left_index->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -4455,7 +4534,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_n_s_int64}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __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; @@ -4464,14 +4543,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_n_s_int64}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -4482,12 +4561,12 @@ __Pyx_GIVEREF(__pyx_n_s_int64); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_n_s_int64); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 275, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 276, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4503,13 +4582,13 @@ } } __pyx_pybuffernd_hilbert_indices.diminfo[0].strides = __pyx_pybuffernd_hilbert_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_hilbert_indices.diminfo[0].shape = __pyx_pybuffernd_hilbert_indices.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 275, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) } __pyx_t_7 = 0; __pyx_v_hilbert_indices = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":276 + /* "yt/utilities/lib/geometry_utils.pyx":277 * cdef np.ndarray[np.int64_t, ndim=1] hilbert_indices * hilbert_indices = np.zeros(left_index.shape[0], 'int64') * for i in range(left_index.shape[0]): # <<<<<<<<<<<<<< @@ -4520,7 +4599,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_11; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "yt/utilities/lib/geometry_utils.pyx":277 + /* "yt/utilities/lib/geometry_utils.pyx":278 * hilbert_indices = np.zeros(left_index.shape[0], 'int64') * for i in range(left_index.shape[0]): * p[0] = left_index[i, 0] # <<<<<<<<<<<<<< @@ -4531,7 +4610,7 @@ __pyx_t_13 = 0; (__pyx_v_p[0]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_left_index.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_left_index.diminfo[1].strides)); - /* "yt/utilities/lib/geometry_utils.pyx":278 + /* "yt/utilities/lib/geometry_utils.pyx":279 * for i in range(left_index.shape[0]): * p[0] = left_index[i, 0] * p[1] = left_index[i, 1] # <<<<<<<<<<<<<< @@ -4542,7 +4621,7 @@ __pyx_t_15 = 1; (__pyx_v_p[1]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left_index.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_left_index.diminfo[1].strides)); - /* "yt/utilities/lib/geometry_utils.pyx":279 + /* "yt/utilities/lib/geometry_utils.pyx":280 * p[0] = left_index[i, 0] * p[1] = left_index[i, 1] * p[2] = left_index[i, 2] # <<<<<<<<<<<<<< @@ -4553,7 +4632,7 @@ __pyx_t_17 = 2; (__pyx_v_p[2]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_left_index.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_left_index.diminfo[1].strides)); - /* "yt/utilities/lib/geometry_utils.pyx":280 + /* "yt/utilities/lib/geometry_utils.pyx":281 * p[1] = left_index[i, 1] * p[2] = left_index[i, 2] * hilbert_indices[i] = point_to_hilbert(order, p) # <<<<<<<<<<<<<< @@ -4564,7 +4643,7 @@ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_hilbert_indices.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_hilbert_indices.diminfo[0].strides) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_point_to_hilbert(__pyx_v_order, __pyx_v_p); } - /* "yt/utilities/lib/geometry_utils.pyx":281 + /* "yt/utilities/lib/geometry_utils.pyx":282 * p[2] = left_index[i, 2] * hilbert_indices[i] = point_to_hilbert(order, p) * return hilbert_indices # <<<<<<<<<<<<<< @@ -4576,7 +4655,7 @@ __pyx_r = ((PyObject *)__pyx_v_hilbert_indices); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":270 + /* "yt/utilities/lib/geometry_utils.pyx":271 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_hilbert_indices(int order, np.ndarray[np.int64_t, ndim=2] left_index): # <<<<<<<<<<<<<< @@ -4611,7 +4690,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":286 +/* "yt/utilities/lib/geometry_utils.pyx":287 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_hilbert_points(int order, np.ndarray[np.int64_t, ndim=1] indices): # <<<<<<<<<<<<<< @@ -4636,7 +4715,9 @@ 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; } @@ -4645,14 +4726,15 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_order)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_hilbert_points", 1, 2, 2, 1); __PYX_ERR(0, 286, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_hilbert_points", 1, 2, 2, 1); __PYX_ERR(0, 287, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_hilbert_points") < 0)) __PYX_ERR(0, 286, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_hilbert_points") < 0)) __PYX_ERR(0, 287, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4660,18 +4742,18 @@ values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_order = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_order == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 286, __pyx_L3_error) + __pyx_v_order = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_order == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L3_error) __pyx_v_indices = ((PyArrayObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_hilbert_points", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 286, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_hilbert_points", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 287, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.geometry_utils.get_hilbert_points", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) __PYX_ERR(0, 286, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) __PYX_ERR(0, 287, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14geometry_utils_6get_hilbert_points(__pyx_self, __pyx_v_order, __pyx_v_indices); /* function exit code */ @@ -4720,25 +4802,25 @@ __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 286, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 287, __pyx_L1_error) } __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/geometry_utils.pyx":291 + /* "yt/utilities/lib/geometry_utils.pyx":292 * cdef np.int64_t p[3] * cdef np.ndarray[np.int64_t, ndim=2] positions * positions = np.zeros((indices.shape[0], 3), 'int64') # <<<<<<<<<<<<<< * for i in range(indices.shape[0]): * hilbert_to_point(order, indices[i], p) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_indices->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_indices->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -4761,7 +4843,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_n_s_int64}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __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; @@ -4770,14 +4852,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_n_s_int64}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __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_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -4788,12 +4870,12 @@ __Pyx_GIVEREF(__pyx_n_s_int64); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_n_s_int64); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 291, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 292, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4809,13 +4891,13 @@ } } __pyx_pybuffernd_positions.diminfo[0].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_positions.diminfo[0].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_positions.diminfo[1].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_positions.diminfo[1].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 291, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 292, __pyx_L1_error) } __pyx_t_7 = 0; __pyx_v_positions = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":292 + /* "yt/utilities/lib/geometry_utils.pyx":293 * cdef np.ndarray[np.int64_t, ndim=2] positions * positions = np.zeros((indices.shape[0], 3), 'int64') * for i in range(indices.shape[0]): # <<<<<<<<<<<<<< @@ -4826,7 +4908,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_11; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "yt/utilities/lib/geometry_utils.pyx":293 + /* "yt/utilities/lib/geometry_utils.pyx":294 * positions = np.zeros((indices.shape[0], 3), 'int64') * for i in range(indices.shape[0]): * hilbert_to_point(order, indices[i], p) # <<<<<<<<<<<<<< @@ -4836,7 +4918,7 @@ __pyx_t_12 = __pyx_v_i; __pyx_f_2yt_9utilities_3lib_14geometry_utils_hilbert_to_point(__pyx_v_order, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_indices.diminfo[0].strides)), __pyx_v_p); - /* "yt/utilities/lib/geometry_utils.pyx":294 + /* "yt/utilities/lib/geometry_utils.pyx":295 * for i in range(indices.shape[0]): * hilbert_to_point(order, indices[i], p) * for j in range(3): # <<<<<<<<<<<<<< @@ -4846,7 +4928,7 @@ for (__pyx_t_13 = 0; __pyx_t_13 < 3; __pyx_t_13+=1) { __pyx_v_j = __pyx_t_13; - /* "yt/utilities/lib/geometry_utils.pyx":295 + /* "yt/utilities/lib/geometry_utils.pyx":296 * hilbert_to_point(order, indices[i], p) * for j in range(3): * positions[i, j] = p[j] # <<<<<<<<<<<<<< @@ -4859,7 +4941,7 @@ } } - /* "yt/utilities/lib/geometry_utils.pyx":296 + /* "yt/utilities/lib/geometry_utils.pyx":297 * for j in range(3): * positions[i, j] = p[j] * return positions # <<<<<<<<<<<<<< @@ -4871,7 +4953,7 @@ __pyx_r = ((PyObject *)__pyx_v_positions); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":286 + /* "yt/utilities/lib/geometry_utils.pyx":287 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_hilbert_points(int order, np.ndarray[np.int64_t, ndim=1] indices): # <<<<<<<<<<<<<< @@ -4906,7 +4988,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":309 +/* "yt/utilities/lib/geometry_utils.pyx":310 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline np.uint64_t spread_bits(np.uint64_t x): # <<<<<<<<<<<<<< @@ -4919,7 +5001,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("spread_bits", 0); - /* "yt/utilities/lib/geometry_utils.pyx":311 + /* "yt/utilities/lib/geometry_utils.pyx":312 * cdef inline np.uint64_t spread_bits(np.uint64_t x): * # This magic comes from http://stackoverflow.com/questions/1024754/how-to-compute-a-3d-morton-number-interleave-the-bits-of-3-ints * x=(x|(x<<20))&_const20 # <<<<<<<<<<<<<< @@ -4928,7 +5010,7 @@ */ __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 20)) & __pyx_v_2yt_9utilities_3lib_14geometry_utils__const20); - /* "yt/utilities/lib/geometry_utils.pyx":312 + /* "yt/utilities/lib/geometry_utils.pyx":313 * # This magic comes from http://stackoverflow.com/questions/1024754/how-to-compute-a-3d-morton-number-interleave-the-bits-of-3-ints * x=(x|(x<<20))&_const20 * x=(x|(x<<10))&_const10 # <<<<<<<<<<<<<< @@ -4937,7 +5019,7 @@ */ __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 10)) & __pyx_v_2yt_9utilities_3lib_14geometry_utils__const10); - /* "yt/utilities/lib/geometry_utils.pyx":313 + /* "yt/utilities/lib/geometry_utils.pyx":314 * x=(x|(x<<20))&_const20 * x=(x|(x<<10))&_const10 * x=(x|(x<<4))&_const04 # <<<<<<<<<<<<<< @@ -4946,7 +5028,7 @@ */ __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 4)) & __pyx_v_2yt_9utilities_3lib_14geometry_utils__const04); - /* "yt/utilities/lib/geometry_utils.pyx":314 + /* "yt/utilities/lib/geometry_utils.pyx":315 * x=(x|(x<<10))&_const10 * x=(x|(x<<4))&_const04 * x=(x|(x<<2))&_const2a # <<<<<<<<<<<<<< @@ -4955,7 +5037,7 @@ */ __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & __pyx_v_2yt_9utilities_3lib_14geometry_utils__const2a); - /* "yt/utilities/lib/geometry_utils.pyx":315 + /* "yt/utilities/lib/geometry_utils.pyx":316 * x=(x|(x<<4))&_const04 * x=(x|(x<<2))&_const2a * x=(x|(x<<2))&_const2b # <<<<<<<<<<<<<< @@ -4964,7 +5046,7 @@ */ __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & __pyx_v_2yt_9utilities_3lib_14geometry_utils__const2b); - /* "yt/utilities/lib/geometry_utils.pyx":316 + /* "yt/utilities/lib/geometry_utils.pyx":317 * x=(x|(x<<2))&_const2a * x=(x|(x<<2))&_const2b * x=(x|(x<<2))&_const2c # <<<<<<<<<<<<<< @@ -4973,7 +5055,7 @@ */ __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & __pyx_v_2yt_9utilities_3lib_14geometry_utils__const2c); - /* "yt/utilities/lib/geometry_utils.pyx":317 + /* "yt/utilities/lib/geometry_utils.pyx":318 * x=(x|(x<<2))&_const2b * x=(x|(x<<2))&_const2c * return x # <<<<<<<<<<<<<< @@ -4983,7 +5065,7 @@ __pyx_r = __pyx_v_x; goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":309 + /* "yt/utilities/lib/geometry_utils.pyx":310 * @cython.boundscheck(False) * @cython.wraparound(False) * cdef inline np.uint64_t spread_bits(np.uint64_t x): # <<<<<<<<<<<<<< @@ -4997,7 +5079,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":322 +/* "yt/utilities/lib/geometry_utils.pyx":323 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_morton_indices(np.ndarray[np.uint64_t, ndim=2] left_index): # <<<<<<<<<<<<<< @@ -5012,7 +5094,7 @@ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_morton_indices (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_index), __pyx_ptype_5numpy_ndarray, 1, "left_index", 0))) __PYX_ERR(0, 322, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_index), __pyx_ptype_5numpy_ndarray, 1, "left_index", 0))) __PYX_ERR(0, 323, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14geometry_utils_8get_morton_indices(__pyx_self, ((PyArrayObject *)__pyx_v_left_index)); /* function exit code */ @@ -5064,23 +5146,23 @@ __pyx_pybuffernd_left_index.rcbuffer = &__pyx_pybuffer_left_index; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 322, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 323, __pyx_L1_error) } __pyx_pybuffernd_left_index.diminfo[0].strides = __pyx_pybuffernd_left_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_index.diminfo[0].shape = __pyx_pybuffernd_left_index.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_index.diminfo[1].strides = __pyx_pybuffernd_left_index.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_index.diminfo[1].shape = __pyx_pybuffernd_left_index.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/geometry_utils.pyx":325 + /* "yt/utilities/lib/geometry_utils.pyx":326 * cdef np.int64_t i, mi * cdef np.ndarray[np.uint64_t, ndim=1] morton_indices * morton_indices = np.zeros(left_index.shape[0], 'uint64') # <<<<<<<<<<<<<< * for i in range(left_index.shape[0]): * mi = 0 */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_left_index->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_left_index->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -5097,7 +5179,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_n_s_uint64}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __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; @@ -5106,14 +5188,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_n_s_uint64}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -5124,12 +5206,12 @@ __Pyx_GIVEREF(__pyx_n_s_uint64); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_n_s_uint64); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 325, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 326, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5145,13 +5227,13 @@ } } __pyx_pybuffernd_morton_indices.diminfo[0].strides = __pyx_pybuffernd_morton_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_morton_indices.diminfo[0].shape = __pyx_pybuffernd_morton_indices.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 325, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 326, __pyx_L1_error) } __pyx_t_7 = 0; __pyx_v_morton_indices = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":326 + /* "yt/utilities/lib/geometry_utils.pyx":327 * cdef np.ndarray[np.uint64_t, ndim=1] morton_indices * morton_indices = np.zeros(left_index.shape[0], 'uint64') * for i in range(left_index.shape[0]): # <<<<<<<<<<<<<< @@ -5162,7 +5244,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "yt/utilities/lib/geometry_utils.pyx":327 + /* "yt/utilities/lib/geometry_utils.pyx":328 * morton_indices = np.zeros(left_index.shape[0], 'uint64') * for i in range(left_index.shape[0]): * mi = 0 # <<<<<<<<<<<<<< @@ -5171,7 +5253,7 @@ */ __pyx_v_mi = 0; - /* "yt/utilities/lib/geometry_utils.pyx":328 + /* "yt/utilities/lib/geometry_utils.pyx":329 * for i in range(left_index.shape[0]): * mi = 0 * mi |= spread_bits(left_index[i,2])<<0 # <<<<<<<<<<<<<< @@ -5182,7 +5264,7 @@ __pyx_t_14 = 2; __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_bits((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_left_index.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_left_index.diminfo[1].strides))) << 0)); - /* "yt/utilities/lib/geometry_utils.pyx":329 + /* "yt/utilities/lib/geometry_utils.pyx":330 * mi = 0 * mi |= spread_bits(left_index[i,2])<<0 * mi |= spread_bits(left_index[i,1])<<1 # <<<<<<<<<<<<<< @@ -5193,7 +5275,7 @@ __pyx_t_16 = 1; __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_bits((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_left_index.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_left_index.diminfo[1].strides))) << 1)); - /* "yt/utilities/lib/geometry_utils.pyx":330 + /* "yt/utilities/lib/geometry_utils.pyx":331 * mi |= spread_bits(left_index[i,2])<<0 * mi |= spread_bits(left_index[i,1])<<1 * mi |= spread_bits(left_index[i,0])<<2 # <<<<<<<<<<<<<< @@ -5204,7 +5286,7 @@ __pyx_t_18 = 0; __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_bits((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_left_index.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_left_index.diminfo[1].strides))) << 2)); - /* "yt/utilities/lib/geometry_utils.pyx":331 + /* "yt/utilities/lib/geometry_utils.pyx":332 * mi |= spread_bits(left_index[i,1])<<1 * mi |= spread_bits(left_index[i,0])<<2 * morton_indices[i] = mi # <<<<<<<<<<<<<< @@ -5215,7 +5297,7 @@ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_morton_indices.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_morton_indices.diminfo[0].strides) = __pyx_v_mi; } - /* "yt/utilities/lib/geometry_utils.pyx":332 + /* "yt/utilities/lib/geometry_utils.pyx":333 * mi |= spread_bits(left_index[i,0])<<2 * morton_indices[i] = mi * return morton_indices # <<<<<<<<<<<<<< @@ -5227,7 +5309,7 @@ __pyx_r = ((PyObject *)__pyx_v_morton_indices); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":322 + /* "yt/utilities/lib/geometry_utils.pyx":323 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_morton_indices(np.ndarray[np.uint64_t, ndim=2] left_index): # <<<<<<<<<<<<<< @@ -5262,7 +5344,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":337 +/* "yt/utilities/lib/geometry_utils.pyx":338 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_morton_indices_unravel(np.ndarray[np.uint64_t, ndim=1] left_x, # <<<<<<<<<<<<<< @@ -5288,8 +5370,11 @@ 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; } @@ -5298,19 +5383,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_morton_indices_unravel", 1, 3, 3, 1); __PYX_ERR(0, 337, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_morton_indices_unravel", 1, 3, 3, 1); __PYX_ERR(0, 338, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_morton_indices_unravel", 1, 3, 3, 2); __PYX_ERR(0, 337, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_morton_indices_unravel", 1, 3, 3, 2); __PYX_ERR(0, 338, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_morton_indices_unravel") < 0)) __PYX_ERR(0, 337, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_morton_indices_unravel") < 0)) __PYX_ERR(0, 338, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -5325,15 +5412,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_morton_indices_unravel", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_morton_indices_unravel", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 338, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.geometry_utils.get_morton_indices_unravel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_x), __pyx_ptype_5numpy_ndarray, 1, "left_x", 0))) __PYX_ERR(0, 337, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_y), __pyx_ptype_5numpy_ndarray, 1, "left_y", 0))) __PYX_ERR(0, 338, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_z), __pyx_ptype_5numpy_ndarray, 1, "left_z", 0))) __PYX_ERR(0, 339, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_x), __pyx_ptype_5numpy_ndarray, 1, "left_x", 0))) __PYX_ERR(0, 338, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_y), __pyx_ptype_5numpy_ndarray, 1, "left_y", 0))) __PYX_ERR(0, 339, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_z), __pyx_ptype_5numpy_ndarray, 1, "left_z", 0))) __PYX_ERR(0, 340, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14geometry_utils_10get_morton_indices_unravel(__pyx_self, __pyx_v_left_x, __pyx_v_left_y, __pyx_v_left_z); /* function exit code */ @@ -5394,33 +5481,33 @@ __pyx_pybuffernd_left_z.rcbuffer = &__pyx_pybuffer_left_z; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 338, __pyx_L1_error) } __pyx_pybuffernd_left_x.diminfo[0].strides = __pyx_pybuffernd_left_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_x.diminfo[0].shape = __pyx_pybuffernd_left_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 338, __pyx_L1_error) } __pyx_pybuffernd_left_y.diminfo[0].strides = __pyx_pybuffernd_left_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_y.diminfo[0].shape = __pyx_pybuffernd_left_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 338, __pyx_L1_error) } __pyx_pybuffernd_left_z.diminfo[0].strides = __pyx_pybuffernd_left_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_z.diminfo[0].shape = __pyx_pybuffernd_left_z.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/geometry_utils.pyx":342 + /* "yt/utilities/lib/geometry_utils.pyx":343 * cdef np.int64_t i, mi * cdef np.ndarray[np.uint64_t, ndim=1] morton_indices * morton_indices = np.zeros(left_x.shape[0], 'uint64') # <<<<<<<<<<<<<< * for i in range(left_x.shape[0]): * mi = 0 */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_left_x->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_left_x->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -5437,7 +5524,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_n_s_uint64}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __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; @@ -5446,14 +5533,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_n_s_uint64}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -5464,12 +5551,12 @@ __Pyx_GIVEREF(__pyx_n_s_uint64); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_n_s_uint64); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 342, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 343, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5485,13 +5572,13 @@ } } __pyx_pybuffernd_morton_indices.diminfo[0].strides = __pyx_pybuffernd_morton_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_morton_indices.diminfo[0].shape = __pyx_pybuffernd_morton_indices.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 342, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 343, __pyx_L1_error) } __pyx_t_7 = 0; __pyx_v_morton_indices = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":343 + /* "yt/utilities/lib/geometry_utils.pyx":344 * cdef np.ndarray[np.uint64_t, ndim=1] morton_indices * morton_indices = np.zeros(left_x.shape[0], 'uint64') * for i in range(left_x.shape[0]): # <<<<<<<<<<<<<< @@ -5502,7 +5589,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "yt/utilities/lib/geometry_utils.pyx":344 + /* "yt/utilities/lib/geometry_utils.pyx":345 * morton_indices = np.zeros(left_x.shape[0], 'uint64') * for i in range(left_x.shape[0]): * mi = 0 # <<<<<<<<<<<<<< @@ -5511,7 +5598,7 @@ */ __pyx_v_mi = 0; - /* "yt/utilities/lib/geometry_utils.pyx":345 + /* "yt/utilities/lib/geometry_utils.pyx":346 * for i in range(left_x.shape[0]): * mi = 0 * mi |= spread_bits(left_z[i])<<0 # <<<<<<<<<<<<<< @@ -5521,7 +5608,7 @@ __pyx_t_13 = __pyx_v_i; __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_bits((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_left_z.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_left_z.diminfo[0].strides))) << 0)); - /* "yt/utilities/lib/geometry_utils.pyx":346 + /* "yt/utilities/lib/geometry_utils.pyx":347 * mi = 0 * mi |= spread_bits(left_z[i])<<0 * mi |= spread_bits(left_y[i])<<1 # <<<<<<<<<<<<<< @@ -5531,7 +5618,7 @@ __pyx_t_14 = __pyx_v_i; __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_bits((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_left_y.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left_y.diminfo[0].strides))) << 1)); - /* "yt/utilities/lib/geometry_utils.pyx":347 + /* "yt/utilities/lib/geometry_utils.pyx":348 * mi |= spread_bits(left_z[i])<<0 * mi |= spread_bits(left_y[i])<<1 * mi |= spread_bits(left_x[i])<<2 # <<<<<<<<<<<<<< @@ -5541,7 +5628,7 @@ __pyx_t_15 = __pyx_v_i; __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_bits((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_left_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_left_x.diminfo[0].strides))) << 2)); - /* "yt/utilities/lib/geometry_utils.pyx":348 + /* "yt/utilities/lib/geometry_utils.pyx":349 * mi |= spread_bits(left_y[i])<<1 * mi |= spread_bits(left_x[i])<<2 * morton_indices[i] = mi # <<<<<<<<<<<<<< @@ -5552,19 +5639,19 @@ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_morton_indices.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_morton_indices.diminfo[0].strides) = __pyx_v_mi; } - /* "yt/utilities/lib/geometry_utils.pyx":349 + /* "yt/utilities/lib/geometry_utils.pyx":350 * mi |= spread_bits(left_x[i])<<2 * morton_indices[i] = mi * return morton_indices # <<<<<<<<<<<<<< * - * ctypedef fused anyfloat: + * @cython.cdivision(True) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_morton_indices)); __pyx_r = ((PyObject *)__pyx_v_morton_indices); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":337 + /* "yt/utilities/lib/geometry_utils.pyx":338 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_morton_indices_unravel(np.ndarray[np.uint64_t, ndim=1] left_x, # <<<<<<<<<<<<<< @@ -5603,12 +5690,12 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":358 +/* "yt/utilities/lib/geometry_utils.pyx":355 * @cython.boundscheck(False) * @cython.wraparound(False) - * cdef np.int64_t position_to_morton(np.ndarray[anyfloat, ndim=1] pos_x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] pos_y, - * np.ndarray[anyfloat, ndim=1] pos_z, + * cdef np.int64_t position_to_morton(np.ndarray[floating, ndim=1] pos_x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] pos_y, + * np.ndarray[floating, ndim=1] pos_z, */ static __pyx_t_5numpy_int64_t __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_14geometry_utils_position_to_morton(PyArrayObject *__pyx_v_pos_x, PyArrayObject *__pyx_v_pos_y, PyArrayObject *__pyx_v_pos_z, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_DRE, PyArrayObject *__pyx_v_ind, int __pyx_v_filter) { @@ -5658,26 +5745,26 @@ __pyx_pybuffernd_ind.rcbuffer = &__pyx_pybuffer_ind; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_x, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 355, __pyx_L1_error) } __pyx_pybuffernd_pos_x.diminfo[0].strides = __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_x.diminfo[0].shape = __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_y, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 355, __pyx_L1_error) } __pyx_pybuffernd_pos_y.diminfo[0].strides = __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_y.diminfo[0].shape = __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_z, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 355, __pyx_L1_error) } __pyx_pybuffernd_pos_z.diminfo[0].strides = __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_z.diminfo[0].shape = __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 355, __pyx_L1_error) } __pyx_pybuffernd_ind.diminfo[0].strides = __pyx_pybuffernd_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ind.diminfo[0].shape = __pyx_pybuffernd_ind.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/geometry_utils.pyx":370 + /* "yt/utilities/lib/geometry_utils.pyx":367 * cdef np.int64_t i, j, use * cdef np.uint64_t DD[3] * cdef np.uint64_t FLAG = ~(0) # <<<<<<<<<<<<<< @@ -5686,7 +5773,7 @@ */ __pyx_v_FLAG = (~((__pyx_t_5numpy_uint64_t)0)); - /* "yt/utilities/lib/geometry_utils.pyx":371 + /* "yt/utilities/lib/geometry_utils.pyx":368 * cdef np.uint64_t DD[3] * cdef np.uint64_t FLAG = ~(0) * for i in range(3): # <<<<<<<<<<<<<< @@ -5696,7 +5783,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/geometry_utils.pyx":372 + /* "yt/utilities/lib/geometry_utils.pyx":369 * cdef np.uint64_t FLAG = ~(0) * for i in range(3): * DD[i] = ((DRE[i] - DLE[i]) / dds[i]) # <<<<<<<<<<<<<< @@ -5706,7 +5793,7 @@ (__pyx_v_DD[__pyx_v_i]) = ((__pyx_t_5numpy_uint64_t)(((__pyx_v_DRE[__pyx_v_i]) - (__pyx_v_DLE[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))); } - /* "yt/utilities/lib/geometry_utils.pyx":373 + /* "yt/utilities/lib/geometry_utils.pyx":370 * for i in range(3): * DD[i] = ((DRE[i] - DLE[i]) / dds[i]) * for i in range(pos_x.shape[0]): # <<<<<<<<<<<<<< @@ -5717,7 +5804,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_2; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/geometry_utils.pyx":374 + /* "yt/utilities/lib/geometry_utils.pyx":371 * DD[i] = ((DRE[i] - DLE[i]) / dds[i]) * for i in range(pos_x.shape[0]): * use = 1 # <<<<<<<<<<<<<< @@ -5726,7 +5813,7 @@ */ __pyx_v_use = 1; - /* "yt/utilities/lib/geometry_utils.pyx":375 + /* "yt/utilities/lib/geometry_utils.pyx":372 * for i in range(pos_x.shape[0]): * use = 1 * p[0] = pos_x[i] # <<<<<<<<<<<<<< @@ -5734,9 +5821,9 @@ * p[2] = pos_z[i] */ __pyx_t_3 = __pyx_v_i; - (__pyx_v_p[0]) = ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_pos_x.diminfo[0].strides))); + (__pyx_v_p[0]) = ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_pos_x.diminfo[0].strides))); - /* "yt/utilities/lib/geometry_utils.pyx":376 + /* "yt/utilities/lib/geometry_utils.pyx":373 * use = 1 * p[0] = pos_x[i] * p[1] = pos_y[i] # <<<<<<<<<<<<<< @@ -5744,9 +5831,9 @@ * for j in range(3): */ __pyx_t_4 = __pyx_v_i; - (__pyx_v_p[1]) = ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_pos_y.diminfo[0].strides))); + (__pyx_v_p[1]) = ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_pos_y.diminfo[0].strides))); - /* "yt/utilities/lib/geometry_utils.pyx":377 + /* "yt/utilities/lib/geometry_utils.pyx":374 * p[0] = pos_x[i] * p[1] = pos_y[i] * p[2] = pos_z[i] # <<<<<<<<<<<<<< @@ -5754,9 +5841,9 @@ * if p[j] < DLE[j] or p[j] > DRE[j]: */ __pyx_t_5 = __pyx_v_i; - (__pyx_v_p[2]) = ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_pos_z.diminfo[0].strides))); + (__pyx_v_p[2]) = ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_pos_z.diminfo[0].strides))); - /* "yt/utilities/lib/geometry_utils.pyx":378 + /* "yt/utilities/lib/geometry_utils.pyx":375 * p[1] = pos_y[i] * p[2] = pos_z[i] * for j in range(3): # <<<<<<<<<<<<<< @@ -5766,7 +5853,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "yt/utilities/lib/geometry_utils.pyx":379 + /* "yt/utilities/lib/geometry_utils.pyx":376 * p[2] = pos_z[i] * for j in range(3): * if p[j] < DLE[j] or p[j] > DRE[j]: # <<<<<<<<<<<<<< @@ -5784,7 +5871,7 @@ __pyx_L10_bool_binop_done:; if (__pyx_t_7) { - /* "yt/utilities/lib/geometry_utils.pyx":380 + /* "yt/utilities/lib/geometry_utils.pyx":377 * for j in range(3): * if p[j] < DLE[j] or p[j] > DRE[j]: * if filter == 1: # <<<<<<<<<<<<<< @@ -5794,7 +5881,7 @@ __pyx_t_7 = ((__pyx_v_filter == 1) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/geometry_utils.pyx":382 + /* "yt/utilities/lib/geometry_utils.pyx":379 * if filter == 1: * # We only allow 20 levels, so this is inaccessible * use = 0 # <<<<<<<<<<<<<< @@ -5803,7 +5890,7 @@ */ __pyx_v_use = 0; - /* "yt/utilities/lib/geometry_utils.pyx":383 + /* "yt/utilities/lib/geometry_utils.pyx":380 * # We only allow 20 levels, so this is inaccessible * use = 0 * break # <<<<<<<<<<<<<< @@ -5812,7 +5899,7 @@ */ goto __pyx_L8_break; - /* "yt/utilities/lib/geometry_utils.pyx":380 + /* "yt/utilities/lib/geometry_utils.pyx":377 * for j in range(3): * if p[j] < DLE[j] or p[j] > DRE[j]: * if filter == 1: # <<<<<<<<<<<<<< @@ -5821,7 +5908,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":384 + /* "yt/utilities/lib/geometry_utils.pyx":381 * use = 0 * break * return i # <<<<<<<<<<<<<< @@ -5831,7 +5918,7 @@ __pyx_r = __pyx_v_i; goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":379 + /* "yt/utilities/lib/geometry_utils.pyx":376 * p[2] = pos_z[i] * for j in range(3): * if p[j] < DLE[j] or p[j] > DRE[j]: # <<<<<<<<<<<<<< @@ -5840,7 +5927,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":385 + /* "yt/utilities/lib/geometry_utils.pyx":382 * break * return i * ii[j] = ((p[j] - DLE[j])/dds[j]) # <<<<<<<<<<<<<< @@ -5849,7 +5936,7 @@ */ (__pyx_v_ii[__pyx_v_j]) = ((__pyx_t_5numpy_uint64_t)(((__pyx_v_p[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (__pyx_v_dds[__pyx_v_j]))); - /* "yt/utilities/lib/geometry_utils.pyx":386 + /* "yt/utilities/lib/geometry_utils.pyx":383 * return i * ii[j] = ((p[j] - DLE[j])/dds[j]) * ii[j] = i64clip(ii[j], 0, DD[j] - 1) # <<<<<<<<<<<<<< @@ -5860,7 +5947,7 @@ } __pyx_L8_break:; - /* "yt/utilities/lib/geometry_utils.pyx":387 + /* "yt/utilities/lib/geometry_utils.pyx":384 * ii[j] = ((p[j] - DLE[j])/dds[j]) * ii[j] = i64clip(ii[j], 0, DD[j] - 1) * if use == 0: # <<<<<<<<<<<<<< @@ -5870,7 +5957,7 @@ __pyx_t_7 = ((__pyx_v_use == 0) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/geometry_utils.pyx":388 + /* "yt/utilities/lib/geometry_utils.pyx":385 * ii[j] = i64clip(ii[j], 0, DD[j] - 1) * if use == 0: * ind[i] = FLAG # <<<<<<<<<<<<<< @@ -5880,7 +5967,7 @@ __pyx_t_6 = __pyx_v_i; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_ind.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_ind.diminfo[0].strides) = __pyx_v_FLAG; - /* "yt/utilities/lib/geometry_utils.pyx":389 + /* "yt/utilities/lib/geometry_utils.pyx":386 * if use == 0: * ind[i] = FLAG * continue # <<<<<<<<<<<<<< @@ -5889,7 +5976,7 @@ */ goto __pyx_L5_continue; - /* "yt/utilities/lib/geometry_utils.pyx":387 + /* "yt/utilities/lib/geometry_utils.pyx":384 * ii[j] = ((p[j] - DLE[j])/dds[j]) * ii[j] = i64clip(ii[j], 0, DD[j] - 1) * if use == 0: # <<<<<<<<<<<<<< @@ -5898,7 +5985,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":390 + /* "yt/utilities/lib/geometry_utils.pyx":387 * ind[i] = FLAG * continue * mi = 0 # <<<<<<<<<<<<<< @@ -5907,7 +5994,7 @@ */ __pyx_v_mi = 0; - /* "yt/utilities/lib/geometry_utils.pyx":391 + /* "yt/utilities/lib/geometry_utils.pyx":388 * continue * mi = 0 * mi |= spread_bits(ii[2])<<0 # <<<<<<<<<<<<<< @@ -5916,7 +6003,7 @@ */ __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_bits((__pyx_v_ii[2])) << 0)); - /* "yt/utilities/lib/geometry_utils.pyx":392 + /* "yt/utilities/lib/geometry_utils.pyx":389 * mi = 0 * mi |= spread_bits(ii[2])<<0 * mi |= spread_bits(ii[1])<<1 # <<<<<<<<<<<<<< @@ -5925,7 +6012,7 @@ */ __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_bits((__pyx_v_ii[1])) << 1)); - /* "yt/utilities/lib/geometry_utils.pyx":393 + /* "yt/utilities/lib/geometry_utils.pyx":390 * mi |= spread_bits(ii[2])<<0 * mi |= spread_bits(ii[1])<<1 * mi |= spread_bits(ii[0])<<2 # <<<<<<<<<<<<<< @@ -5934,7 +6021,7 @@ */ __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_bits((__pyx_v_ii[0])) << 2)); - /* "yt/utilities/lib/geometry_utils.pyx":394 + /* "yt/utilities/lib/geometry_utils.pyx":391 * mi |= spread_bits(ii[1])<<1 * mi |= spread_bits(ii[0])<<2 * ind[i] = mi # <<<<<<<<<<<<<< @@ -5946,7 +6033,7 @@ __pyx_L5_continue:; } - /* "yt/utilities/lib/geometry_utils.pyx":395 + /* "yt/utilities/lib/geometry_utils.pyx":392 * mi |= spread_bits(ii[0])<<2 * ind[i] = mi * return pos_x.shape[0] # <<<<<<<<<<<<<< @@ -5956,12 +6043,12 @@ __pyx_r = (__pyx_v_pos_x->dimensions[0]); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":358 + /* "yt/utilities/lib/geometry_utils.pyx":355 * @cython.boundscheck(False) * @cython.wraparound(False) - * cdef np.int64_t position_to_morton(np.ndarray[anyfloat, ndim=1] pos_x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] pos_y, - * np.ndarray[anyfloat, ndim=1] pos_z, + * cdef np.int64_t position_to_morton(np.ndarray[floating, ndim=1] pos_x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] pos_y, + * np.ndarray[floating, ndim=1] pos_z, */ /* function exit code */ @@ -5975,7 +6062,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.utilities.lib.geometry_utils.position_to_morton", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.geometry_utils.position_to_morton", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; goto __pyx_L2; __pyx_L0:; @@ -6035,26 +6122,26 @@ __pyx_pybuffernd_ind.rcbuffer = &__pyx_pybuffer_ind; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 355, __pyx_L1_error) } __pyx_pybuffernd_pos_x.diminfo[0].strides = __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_x.diminfo[0].shape = __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_y, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 355, __pyx_L1_error) } __pyx_pybuffernd_pos_y.diminfo[0].strides = __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_y.diminfo[0].shape = __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_z, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 355, __pyx_L1_error) } __pyx_pybuffernd_pos_z.diminfo[0].strides = __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_z.diminfo[0].shape = __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 355, __pyx_L1_error) } __pyx_pybuffernd_ind.diminfo[0].strides = __pyx_pybuffernd_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ind.diminfo[0].shape = __pyx_pybuffernd_ind.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/geometry_utils.pyx":370 + /* "yt/utilities/lib/geometry_utils.pyx":367 * cdef np.int64_t i, j, use * cdef np.uint64_t DD[3] * cdef np.uint64_t FLAG = ~(0) # <<<<<<<<<<<<<< @@ -6063,7 +6150,7 @@ */ __pyx_v_FLAG = (~((__pyx_t_5numpy_uint64_t)0)); - /* "yt/utilities/lib/geometry_utils.pyx":371 + /* "yt/utilities/lib/geometry_utils.pyx":368 * cdef np.uint64_t DD[3] * cdef np.uint64_t FLAG = ~(0) * for i in range(3): # <<<<<<<<<<<<<< @@ -6073,7 +6160,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/geometry_utils.pyx":372 + /* "yt/utilities/lib/geometry_utils.pyx":369 * cdef np.uint64_t FLAG = ~(0) * for i in range(3): * DD[i] = ((DRE[i] - DLE[i]) / dds[i]) # <<<<<<<<<<<<<< @@ -6083,7 +6170,7 @@ (__pyx_v_DD[__pyx_v_i]) = ((__pyx_t_5numpy_uint64_t)(((__pyx_v_DRE[__pyx_v_i]) - (__pyx_v_DLE[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))); } - /* "yt/utilities/lib/geometry_utils.pyx":373 + /* "yt/utilities/lib/geometry_utils.pyx":370 * for i in range(3): * DD[i] = ((DRE[i] - DLE[i]) / dds[i]) * for i in range(pos_x.shape[0]): # <<<<<<<<<<<<<< @@ -6094,7 +6181,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_2; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/geometry_utils.pyx":374 + /* "yt/utilities/lib/geometry_utils.pyx":371 * DD[i] = ((DRE[i] - DLE[i]) / dds[i]) * for i in range(pos_x.shape[0]): * use = 1 # <<<<<<<<<<<<<< @@ -6103,7 +6190,7 @@ */ __pyx_v_use = 1; - /* "yt/utilities/lib/geometry_utils.pyx":375 + /* "yt/utilities/lib/geometry_utils.pyx":372 * for i in range(pos_x.shape[0]): * use = 1 * p[0] = pos_x[i] # <<<<<<<<<<<<<< @@ -6111,9 +6198,9 @@ * p[2] = pos_z[i] */ __pyx_t_3 = __pyx_v_i; - (__pyx_v_p[0]) = ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_pos_x.diminfo[0].strides))); + (__pyx_v_p[0]) = ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_pos_x.diminfo[0].strides))); - /* "yt/utilities/lib/geometry_utils.pyx":376 + /* "yt/utilities/lib/geometry_utils.pyx":373 * use = 1 * p[0] = pos_x[i] * p[1] = pos_y[i] # <<<<<<<<<<<<<< @@ -6121,9 +6208,9 @@ * for j in range(3): */ __pyx_t_4 = __pyx_v_i; - (__pyx_v_p[1]) = ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_pos_y.diminfo[0].strides))); + (__pyx_v_p[1]) = ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_pos_y.diminfo[0].strides))); - /* "yt/utilities/lib/geometry_utils.pyx":377 + /* "yt/utilities/lib/geometry_utils.pyx":374 * p[0] = pos_x[i] * p[1] = pos_y[i] * p[2] = pos_z[i] # <<<<<<<<<<<<<< @@ -6131,9 +6218,9 @@ * if p[j] < DLE[j] or p[j] > DRE[j]: */ __pyx_t_5 = __pyx_v_i; - (__pyx_v_p[2]) = ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_pos_z.diminfo[0].strides))); + (__pyx_v_p[2]) = ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_pos_z.diminfo[0].strides))); - /* "yt/utilities/lib/geometry_utils.pyx":378 + /* "yt/utilities/lib/geometry_utils.pyx":375 * p[1] = pos_y[i] * p[2] = pos_z[i] * for j in range(3): # <<<<<<<<<<<<<< @@ -6143,7 +6230,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "yt/utilities/lib/geometry_utils.pyx":379 + /* "yt/utilities/lib/geometry_utils.pyx":376 * p[2] = pos_z[i] * for j in range(3): * if p[j] < DLE[j] or p[j] > DRE[j]: # <<<<<<<<<<<<<< @@ -6161,7 +6248,7 @@ __pyx_L10_bool_binop_done:; if (__pyx_t_7) { - /* "yt/utilities/lib/geometry_utils.pyx":380 + /* "yt/utilities/lib/geometry_utils.pyx":377 * for j in range(3): * if p[j] < DLE[j] or p[j] > DRE[j]: * if filter == 1: # <<<<<<<<<<<<<< @@ -6171,7 +6258,7 @@ __pyx_t_7 = ((__pyx_v_filter == 1) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/geometry_utils.pyx":382 + /* "yt/utilities/lib/geometry_utils.pyx":379 * if filter == 1: * # We only allow 20 levels, so this is inaccessible * use = 0 # <<<<<<<<<<<<<< @@ -6180,7 +6267,7 @@ */ __pyx_v_use = 0; - /* "yt/utilities/lib/geometry_utils.pyx":383 + /* "yt/utilities/lib/geometry_utils.pyx":380 * # We only allow 20 levels, so this is inaccessible * use = 0 * break # <<<<<<<<<<<<<< @@ -6189,7 +6276,7 @@ */ goto __pyx_L8_break; - /* "yt/utilities/lib/geometry_utils.pyx":380 + /* "yt/utilities/lib/geometry_utils.pyx":377 * for j in range(3): * if p[j] < DLE[j] or p[j] > DRE[j]: * if filter == 1: # <<<<<<<<<<<<<< @@ -6198,7 +6285,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":384 + /* "yt/utilities/lib/geometry_utils.pyx":381 * use = 0 * break * return i # <<<<<<<<<<<<<< @@ -6208,7 +6295,7 @@ __pyx_r = __pyx_v_i; goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":379 + /* "yt/utilities/lib/geometry_utils.pyx":376 * p[2] = pos_z[i] * for j in range(3): * if p[j] < DLE[j] or p[j] > DRE[j]: # <<<<<<<<<<<<<< @@ -6217,7 +6304,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":385 + /* "yt/utilities/lib/geometry_utils.pyx":382 * break * return i * ii[j] = ((p[j] - DLE[j])/dds[j]) # <<<<<<<<<<<<<< @@ -6226,7 +6313,7 @@ */ (__pyx_v_ii[__pyx_v_j]) = ((__pyx_t_5numpy_uint64_t)(((__pyx_v_p[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (__pyx_v_dds[__pyx_v_j]))); - /* "yt/utilities/lib/geometry_utils.pyx":386 + /* "yt/utilities/lib/geometry_utils.pyx":383 * return i * ii[j] = ((p[j] - DLE[j])/dds[j]) * ii[j] = i64clip(ii[j], 0, DD[j] - 1) # <<<<<<<<<<<<<< @@ -6237,7 +6324,7 @@ } __pyx_L8_break:; - /* "yt/utilities/lib/geometry_utils.pyx":387 + /* "yt/utilities/lib/geometry_utils.pyx":384 * ii[j] = ((p[j] - DLE[j])/dds[j]) * ii[j] = i64clip(ii[j], 0, DD[j] - 1) * if use == 0: # <<<<<<<<<<<<<< @@ -6247,7 +6334,7 @@ __pyx_t_7 = ((__pyx_v_use == 0) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/geometry_utils.pyx":388 + /* "yt/utilities/lib/geometry_utils.pyx":385 * ii[j] = i64clip(ii[j], 0, DD[j] - 1) * if use == 0: * ind[i] = FLAG # <<<<<<<<<<<<<< @@ -6257,7 +6344,7 @@ __pyx_t_6 = __pyx_v_i; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint64_t *, __pyx_pybuffernd_ind.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_ind.diminfo[0].strides) = __pyx_v_FLAG; - /* "yt/utilities/lib/geometry_utils.pyx":389 + /* "yt/utilities/lib/geometry_utils.pyx":386 * if use == 0: * ind[i] = FLAG * continue # <<<<<<<<<<<<<< @@ -6266,7 +6353,7 @@ */ goto __pyx_L5_continue; - /* "yt/utilities/lib/geometry_utils.pyx":387 + /* "yt/utilities/lib/geometry_utils.pyx":384 * ii[j] = ((p[j] - DLE[j])/dds[j]) * ii[j] = i64clip(ii[j], 0, DD[j] - 1) * if use == 0: # <<<<<<<<<<<<<< @@ -6275,7 +6362,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":390 + /* "yt/utilities/lib/geometry_utils.pyx":387 * ind[i] = FLAG * continue * mi = 0 # <<<<<<<<<<<<<< @@ -6284,7 +6371,7 @@ */ __pyx_v_mi = 0; - /* "yt/utilities/lib/geometry_utils.pyx":391 + /* "yt/utilities/lib/geometry_utils.pyx":388 * continue * mi = 0 * mi |= spread_bits(ii[2])<<0 # <<<<<<<<<<<<<< @@ -6293,7 +6380,7 @@ */ __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_bits((__pyx_v_ii[2])) << 0)); - /* "yt/utilities/lib/geometry_utils.pyx":392 + /* "yt/utilities/lib/geometry_utils.pyx":389 * mi = 0 * mi |= spread_bits(ii[2])<<0 * mi |= spread_bits(ii[1])<<1 # <<<<<<<<<<<<<< @@ -6302,7 +6389,7 @@ */ __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_bits((__pyx_v_ii[1])) << 1)); - /* "yt/utilities/lib/geometry_utils.pyx":393 + /* "yt/utilities/lib/geometry_utils.pyx":390 * mi |= spread_bits(ii[2])<<0 * mi |= spread_bits(ii[1])<<1 * mi |= spread_bits(ii[0])<<2 # <<<<<<<<<<<<<< @@ -6311,7 +6398,7 @@ */ __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_bits((__pyx_v_ii[0])) << 2)); - /* "yt/utilities/lib/geometry_utils.pyx":394 + /* "yt/utilities/lib/geometry_utils.pyx":391 * mi |= spread_bits(ii[1])<<1 * mi |= spread_bits(ii[0])<<2 * ind[i] = mi # <<<<<<<<<<<<<< @@ -6323,7 +6410,7 @@ __pyx_L5_continue:; } - /* "yt/utilities/lib/geometry_utils.pyx":395 + /* "yt/utilities/lib/geometry_utils.pyx":392 * mi |= spread_bits(ii[0])<<2 * ind[i] = mi * return pos_x.shape[0] # <<<<<<<<<<<<<< @@ -6333,12 +6420,12 @@ __pyx_r = (__pyx_v_pos_x->dimensions[0]); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":358 + /* "yt/utilities/lib/geometry_utils.pyx":355 * @cython.boundscheck(False) * @cython.wraparound(False) - * cdef np.int64_t position_to_morton(np.ndarray[anyfloat, ndim=1] pos_x, # <<<<<<<<<<<<<< - * np.ndarray[anyfloat, ndim=1] pos_y, - * np.ndarray[anyfloat, ndim=1] pos_z, + * cdef np.int64_t position_to_morton(np.ndarray[floating, ndim=1] pos_x, # <<<<<<<<<<<<<< + * np.ndarray[floating, ndim=1] pos_y, + * np.ndarray[floating, ndim=1] pos_z, */ /* function exit code */ @@ -6352,7 +6439,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.utilities.lib.geometry_utils.position_to_morton", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.geometry_utils.position_to_morton", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; goto __pyx_L2; __pyx_L0:; @@ -6365,7 +6452,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":399 +/* "yt/utilities/lib/geometry_utils.pyx":396 * DEF ORDER_MAX=20 * * def compute_morton(np.ndarray pos_x, np.ndarray pos_y, np.ndarray pos_z, # <<<<<<<<<<<<<< @@ -6390,7 +6477,7 @@ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos_x,&__pyx_n_s_pos_y,&__pyx_n_s_pos_z,&__pyx_n_s_domain_left_edge,&__pyx_n_s_domain_right_edge,&__pyx_n_s_filter_bbox,0}; PyObject* values[6] = {0,0,0,0,0,0}; - /* "yt/utilities/lib/geometry_utils.pyx":400 + /* "yt/utilities/lib/geometry_utils.pyx":397 * * def compute_morton(np.ndarray pos_x, np.ndarray pos_y, np.ndarray pos_z, * domain_left_edge, domain_right_edge, filter_bbox = False): # <<<<<<<<<<<<<< @@ -6403,11 +6490,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -6416,26 +6509,31 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_morton", 0, 5, 6, 1); __PYX_ERR(0, 399, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_morton", 0, 5, 6, 1); __PYX_ERR(0, 396, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_morton", 0, 5, 6, 2); __PYX_ERR(0, 399, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_morton", 0, 5, 6, 2); __PYX_ERR(0, 396, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_left_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_morton", 0, 5, 6, 3); __PYX_ERR(0, 399, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_morton", 0, 5, 6, 3); __PYX_ERR(0, 396, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_right_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_morton", 0, 5, 6, 4); __PYX_ERR(0, 399, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_morton", 0, 5, 6, 4); __PYX_ERR(0, 396, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filter_bbox); @@ -6443,11 +6541,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_morton") < 0)) __PYX_ERR(0, 399, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_morton") < 0)) __PYX_ERR(0, 396, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -6466,18 +6565,18 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compute_morton", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 399, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_morton", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 396, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.geometry_utils.compute_morton", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_x), __pyx_ptype_5numpy_ndarray, 1, "pos_x", 0))) __PYX_ERR(0, 399, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_y), __pyx_ptype_5numpy_ndarray, 1, "pos_y", 0))) __PYX_ERR(0, 399, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_z), __pyx_ptype_5numpy_ndarray, 1, "pos_z", 0))) __PYX_ERR(0, 399, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_x), __pyx_ptype_5numpy_ndarray, 1, "pos_x", 0))) __PYX_ERR(0, 396, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_y), __pyx_ptype_5numpy_ndarray, 1, "pos_y", 0))) __PYX_ERR(0, 396, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_z), __pyx_ptype_5numpy_ndarray, 1, "pos_z", 0))) __PYX_ERR(0, 396, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14geometry_utils_12compute_morton(__pyx_self, __pyx_v_pos_x, __pyx_v_pos_y, __pyx_v_pos_z, __pyx_v_domain_left_edge, __pyx_v_domain_right_edge, __pyx_v_filter_bbox); - /* "yt/utilities/lib/geometry_utils.pyx":399 + /* "yt/utilities/lib/geometry_utils.pyx":396 * DEF ORDER_MAX=20 * * def compute_morton(np.ndarray pos_x, np.ndarray pos_y, np.ndarray pos_z, # <<<<<<<<<<<<<< @@ -6526,17 +6625,17 @@ __pyx_pybuffernd_ind.data = NULL; __pyx_pybuffernd_ind.rcbuffer = &__pyx_pybuffer_ind; - /* "yt/utilities/lib/geometry_utils.pyx":403 + /* "yt/utilities/lib/geometry_utils.pyx":400 * cdef int i * cdef int filter * if filter_bbox: # <<<<<<<<<<<<<< * filter = 1 * else: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_filter_bbox); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_filter_bbox); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 400, __pyx_L1_error) if (__pyx_t_1) { - /* "yt/utilities/lib/geometry_utils.pyx":404 + /* "yt/utilities/lib/geometry_utils.pyx":401 * cdef int filter * if filter_bbox: * filter = 1 # <<<<<<<<<<<<<< @@ -6545,7 +6644,7 @@ */ __pyx_v_filter = 1; - /* "yt/utilities/lib/geometry_utils.pyx":403 + /* "yt/utilities/lib/geometry_utils.pyx":400 * cdef int i * cdef int filter * if filter_bbox: # <<<<<<<<<<<<<< @@ -6555,7 +6654,7 @@ goto __pyx_L3; } - /* "yt/utilities/lib/geometry_utils.pyx":406 + /* "yt/utilities/lib/geometry_utils.pyx":403 * filter = 1 * else: * filter = 0 # <<<<<<<<<<<<<< @@ -6567,7 +6666,7 @@ } __pyx_L3:; - /* "yt/utilities/lib/geometry_utils.pyx":410 + /* "yt/utilities/lib/geometry_utils.pyx":407 * cdef np.float64_t DLE[3] * cdef np.float64_t DRE[3] * for i in range(3): # <<<<<<<<<<<<<< @@ -6577,33 +6676,33 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/geometry_utils.pyx":411 + /* "yt/utilities/lib/geometry_utils.pyx":408 * cdef np.float64_t DRE[3] * for i in range(3): * DLE[i] = domain_left_edge[i] # <<<<<<<<<<<<<< * DRE[i] = domain_right_edge[i] * dds[i] = (DRE[i] - DLE[i]) / (1 << ORDER_MAX) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_DLE[__pyx_v_i]) = __pyx_t_4; - /* "yt/utilities/lib/geometry_utils.pyx":412 + /* "yt/utilities/lib/geometry_utils.pyx":409 * for i in range(3): * DLE[i] = domain_left_edge[i] * DRE[i] = domain_right_edge[i] # <<<<<<<<<<<<<< * dds[i] = (DRE[i] - DLE[i]) / (1 << ORDER_MAX) * cdef np.ndarray[np.uint64_t, ndim=1] ind */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_DRE[__pyx_v_i]) = __pyx_t_4; - /* "yt/utilities/lib/geometry_utils.pyx":413 + /* "yt/utilities/lib/geometry_utils.pyx":410 * DLE[i] = domain_left_edge[i] * DRE[i] = domain_right_edge[i] * dds[i] = (DRE[i] - DLE[i]) / (1 << ORDER_MAX) # <<<<<<<<<<<<<< @@ -6613,34 +6712,34 @@ (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_DRE[__pyx_v_i]) - (__pyx_v_DLE[__pyx_v_i])) / 1048576.0); } - /* "yt/utilities/lib/geometry_utils.pyx":415 + /* "yt/utilities/lib/geometry_utils.pyx":412 * dds[i] = (DRE[i] - DLE[i]) / (1 << ORDER_MAX) * cdef np.ndarray[np.uint64_t, ndim=1] ind * ind = np.zeros(pos_x.shape[0], dtype="uint64") # <<<<<<<<<<<<<< * cdef np.int64_t rv * if pos_x.dtype == np.float32: */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_pos_x->dimensions[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_pos_x->dimensions[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_uint64) < 0) __PYX_ERR(0, 415, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_uint64) < 0) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 415, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 412, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6656,34 +6755,34 @@ } } __pyx_pybuffernd_ind.diminfo[0].strides = __pyx_pybuffernd_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ind.diminfo[0].shape = __pyx_pybuffernd_ind.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 415, __pyx_L1_error) + if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 412, __pyx_L1_error) } __pyx_t_8 = 0; __pyx_v_ind = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":417 + /* "yt/utilities/lib/geometry_utils.pyx":414 * ind = np.zeros(pos_x.shape[0], dtype="uint64") * cdef np.int64_t rv * if pos_x.dtype == np.float32: # <<<<<<<<<<<<<< * rv = position_to_morton[np.float32_t]( * pos_x, pos_y, pos_z, dds, DLE, DRE, ind, */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_x), __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_x), __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "yt/utilities/lib/geometry_utils.pyx":418 + /* "yt/utilities/lib/geometry_utils.pyx":415 * cdef np.int64_t rv * if pos_x.dtype == np.float32: * rv = position_to_morton[np.float32_t]( # <<<<<<<<<<<<<< @@ -6692,7 +6791,7 @@ */ __pyx_v_rv = __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_14geometry_utils_position_to_morton(((PyArrayObject *)__pyx_v_pos_x), ((PyArrayObject *)__pyx_v_pos_y), ((PyArrayObject *)__pyx_v_pos_z), __pyx_v_dds, __pyx_v_DLE, __pyx_v_DRE, ((PyArrayObject *)__pyx_v_ind), __pyx_v_filter); - /* "yt/utilities/lib/geometry_utils.pyx":417 + /* "yt/utilities/lib/geometry_utils.pyx":414 * ind = np.zeros(pos_x.shape[0], dtype="uint64") * cdef np.int64_t rv * if pos_x.dtype == np.float32: # <<<<<<<<<<<<<< @@ -6702,28 +6801,28 @@ goto __pyx_L6; } - /* "yt/utilities/lib/geometry_utils.pyx":421 + /* "yt/utilities/lib/geometry_utils.pyx":418 * pos_x, pos_y, pos_z, dds, DLE, DRE, ind, * filter) * elif pos_x.dtype == np.float64: # <<<<<<<<<<<<<< * rv = position_to_morton[np.float64_t]( * pos_x, pos_y, pos_z, dds, DLE, DRE, ind, */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_x), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_x), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { - /* "yt/utilities/lib/geometry_utils.pyx":422 + /* "yt/utilities/lib/geometry_utils.pyx":419 * filter) * elif pos_x.dtype == np.float64: * rv = position_to_morton[np.float64_t]( # <<<<<<<<<<<<<< @@ -6732,7 +6831,7 @@ */ __pyx_v_rv = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_14geometry_utils_position_to_morton(((PyArrayObject *)__pyx_v_pos_x), ((PyArrayObject *)__pyx_v_pos_y), ((PyArrayObject *)__pyx_v_pos_z), __pyx_v_dds, __pyx_v_DLE, __pyx_v_DRE, ((PyArrayObject *)__pyx_v_ind), __pyx_v_filter); - /* "yt/utilities/lib/geometry_utils.pyx":421 + /* "yt/utilities/lib/geometry_utils.pyx":418 * pos_x, pos_y, pos_z, dds, DLE, DRE, ind, * filter) * elif pos_x.dtype == np.float64: # <<<<<<<<<<<<<< @@ -6742,7 +6841,7 @@ goto __pyx_L6; } - /* "yt/utilities/lib/geometry_utils.pyx":426 + /* "yt/utilities/lib/geometry_utils.pyx":423 * filter) * else: * print "Could not identify dtype.", pos_x.dtype # <<<<<<<<<<<<<< @@ -6750,9 +6849,9 @@ * if rv < pos_x.shape[0]: */ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_x), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_x), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_kp_s_Could_not_identify_dtype); __Pyx_GIVEREF(__pyx_kp_s_Could_not_identify_dtype); @@ -6760,10 +6859,10 @@ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_Print(0, __pyx_t_7, 1) < 0) __PYX_ERR(0, 426, __pyx_L1_error) + if (__Pyx_Print(0, __pyx_t_7, 1) < 0) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":427 + /* "yt/utilities/lib/geometry_utils.pyx":424 * else: * print "Could not identify dtype.", pos_x.dtype * raise NotImplementedError # <<<<<<<<<<<<<< @@ -6771,11 +6870,11 @@ * mis = (pos_x.min(), pos_y.min(), pos_z.min()) */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 427, __pyx_L1_error) + __PYX_ERR(0, 424, __pyx_L1_error) } __pyx_L6:; - /* "yt/utilities/lib/geometry_utils.pyx":428 + /* "yt/utilities/lib/geometry_utils.pyx":425 * print "Could not identify dtype.", pos_x.dtype * raise NotImplementedError * if rv < pos_x.shape[0]: # <<<<<<<<<<<<<< @@ -6785,14 +6884,14 @@ __pyx_t_1 = ((__pyx_v_rv < (__pyx_v_pos_x->dimensions[0])) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/geometry_utils.pyx":429 + /* "yt/utilities/lib/geometry_utils.pyx":426 * raise NotImplementedError * if rv < pos_x.shape[0]: * mis = (pos_x.min(), pos_y.min(), pos_z.min()) # <<<<<<<<<<<<<< * mas = (pos_x.max(), pos_y.max(), pos_z.max()) * raise YTDomainOverflow(mis, mas, */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_x), __pyx_n_s_min); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_x), __pyx_n_s_min); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -6805,14 +6904,14 @@ } } if (__pyx_t_3) { - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_y), __pyx_n_s_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_y), __pyx_n_s_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -6825,14 +6924,14 @@ } } if (__pyx_t_5) { - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_z), __pyx_n_s_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_z), __pyx_n_s_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -6845,14 +6944,14 @@ } } if (__pyx_t_12) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); @@ -6866,14 +6965,14 @@ __pyx_v_mis = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":430 + /* "yt/utilities/lib/geometry_utils.pyx":427 * if rv < pos_x.shape[0]: * mis = (pos_x.min(), pos_y.min(), pos_z.min()) * mas = (pos_x.max(), pos_y.max(), pos_z.max()) # <<<<<<<<<<<<<< * raise YTDomainOverflow(mis, mas, * domain_left_edge, domain_right_edge) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_x), __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_x), __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -6886,14 +6985,14 @@ } } if (__pyx_t_6) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { - __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 427, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_y), __pyx_n_s_max); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_y), __pyx_n_s_max); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -6906,14 +7005,14 @@ } } if (__pyx_t_7) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_z), __pyx_n_s_max); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pos_z), __pyx_n_s_max); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { @@ -6926,14 +7025,14 @@ } } if (__pyx_t_12) { - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { - __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); @@ -6947,17 +7046,17 @@ __pyx_v_mas = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":431 + /* "yt/utilities/lib/geometry_utils.pyx":428 * mis = (pos_x.min(), pos_y.min(), pos_z.min()) * mas = (pos_x.max(), pos_y.max(), pos_z.max()) * raise YTDomainOverflow(mis, mas, # <<<<<<<<<<<<<< * domain_left_edge, domain_right_edge) * return ind */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTDomainOverflow); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTDomainOverflow); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "yt/utilities/lib/geometry_utils.pyx":432 + /* "yt/utilities/lib/geometry_utils.pyx":429 * mas = (pos_x.max(), pos_y.max(), pos_z.max()) * raise YTDomainOverflow(mis, mas, * domain_left_edge, domain_right_edge) # <<<<<<<<<<<<<< @@ -6979,7 +7078,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_mis, __pyx_v_mas, __pyx_v_domain_left_edge, __pyx_v_domain_right_edge}; - __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 4+__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 4+__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_7); } else @@ -6987,13 +7086,13 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_mis, __pyx_v_mas, __pyx_v_domain_left_edge, __pyx_v_domain_right_edge}; - __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 4+__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 4+__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_7); } else #endif { - __pyx_t_5 = PyTuple_New(4+__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4+__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __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; @@ -7010,16 +7109,16 @@ __Pyx_INCREF(__pyx_v_domain_right_edge); __Pyx_GIVEREF(__pyx_v_domain_right_edge); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_2, __pyx_v_domain_right_edge); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __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_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 431, __pyx_L1_error) + __PYX_ERR(0, 428, __pyx_L1_error) - /* "yt/utilities/lib/geometry_utils.pyx":428 + /* "yt/utilities/lib/geometry_utils.pyx":425 * print "Could not identify dtype.", pos_x.dtype * raise NotImplementedError * if rv < pos_x.shape[0]: # <<<<<<<<<<<<<< @@ -7028,7 +7127,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":433 + /* "yt/utilities/lib/geometry_utils.pyx":430 * raise YTDomainOverflow(mis, mas, * domain_left_edge, domain_right_edge) * return ind # <<<<<<<<<<<<<< @@ -7040,7 +7139,7 @@ __pyx_r = ((PyObject *)__pyx_v_ind); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":399 + /* "yt/utilities/lib/geometry_utils.pyx":396 * DEF ORDER_MAX=20 * * def compute_morton(np.ndarray pos_x, np.ndarray pos_y, np.ndarray pos_z, # <<<<<<<<<<<<<< @@ -7075,7 +7174,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":438 +/* "yt/utilities/lib/geometry_utils.pyx":435 * @cython.wraparound(False) * @cython.cdivision(True) * def obtain_rv_vec(data, ftype="gas"): # <<<<<<<<<<<<<< @@ -7101,7 +7200,9 @@ 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; } @@ -7110,6 +7211,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ftype); @@ -7117,11 +7219,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "obtain_rv_vec") < 0)) __PYX_ERR(0, 438, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "obtain_rv_vec") < 0)) __PYX_ERR(0, 435, __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; @@ -7132,7 +7235,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("obtain_rv_vec", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 438, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("obtain_rv_vec", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 435, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.geometry_utils.obtain_rv_vec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7267,52 +7370,52 @@ __pyx_pybuffernd_rvg.data = NULL; __pyx_pybuffernd_rvg.rcbuffer = &__pyx_pybuffer_rvg; - /* "yt/utilities/lib/geometry_utils.pyx":451 + /* "yt/utilities/lib/geometry_utils.pyx":448 * cdef np.float64_t bv[3] * cdef int i, j, k * bulk_velocity = data.get_field_parameter("bulk_velocity") # <<<<<<<<<<<<<< * if bulk_velocity == None: * bulk_velocity = np.zeros(3) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_get_field_parameter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_get_field_parameter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_bulk_velocity = __pyx_t_2; __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":452 + /* "yt/utilities/lib/geometry_utils.pyx":449 * cdef int i, j, k * bulk_velocity = data.get_field_parameter("bulk_velocity") * if bulk_velocity == None: # <<<<<<<<<<<<<< * bulk_velocity = np.zeros(3) * bv[0] = bulk_velocity[0]; bv[1] = bulk_velocity[1]; bv[2] = bulk_velocity[2] */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_bulk_velocity, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_bulk_velocity, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "yt/utilities/lib/geometry_utils.pyx":453 + /* "yt/utilities/lib/geometry_utils.pyx":450 * bulk_velocity = data.get_field_parameter("bulk_velocity") * if bulk_velocity == None: * bulk_velocity = np.zeros(3) # <<<<<<<<<<<<<< * bv[0] = bulk_velocity[0]; bv[1] = bulk_velocity[1]; bv[2] = bulk_velocity[2] * if len(data[ftype, 'velocity_x'].shape) == 1: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_bulk_velocity, __pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":452 + /* "yt/utilities/lib/geometry_utils.pyx":449 * cdef int i, j, k * bulk_velocity = data.get_field_parameter("bulk_velocity") * if bulk_velocity == None: # <<<<<<<<<<<<<< @@ -7321,37 +7424,37 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":454 + /* "yt/utilities/lib/geometry_utils.pyx":451 * if bulk_velocity == None: * bulk_velocity = np.zeros(3) * bv[0] = bulk_velocity[0]; bv[1] = bulk_velocity[1]; bv[2] = bulk_velocity[2] # <<<<<<<<<<<<<< * if len(data[ftype, 'velocity_x'].shape) == 1: * # One dimensional data */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bulk_velocity, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bulk_velocity, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_bv[0]) = __pyx_t_4; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bulk_velocity, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bulk_velocity, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_bv[1]) = __pyx_t_4; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bulk_velocity, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bulk_velocity, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_bv[2]) = __pyx_t_4; - /* "yt/utilities/lib/geometry_utils.pyx":455 + /* "yt/utilities/lib/geometry_utils.pyx":452 * bulk_velocity = np.zeros(3) * bv[0] = bulk_velocity[0]; bv[1] = bulk_velocity[1]; bv[2] = bulk_velocity[2] * if len(data[ftype, 'velocity_x'].shape) == 1: # <<<<<<<<<<<<<< * # One dimensional data * vxf = data[ftype, 'velocity_x'].astype("float64") */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -7359,25 +7462,25 @@ __Pyx_INCREF(__pyx_n_s_velocity_x); __Pyx_GIVEREF(__pyx_n_s_velocity_x); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_velocity_x); - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = ((__pyx_t_5 == 1) != 0); if (__pyx_t_3) { - /* "yt/utilities/lib/geometry_utils.pyx":457 + /* "yt/utilities/lib/geometry_utils.pyx":454 * if len(data[ftype, 'velocity_x'].shape) == 1: * # One dimensional data * vxf = data[ftype, 'velocity_x'].astype("float64") # <<<<<<<<<<<<<< * vyf = data[ftype, 'velocity_y'].astype("float64") * vzf = data[ftype, 'velocity_z'].astype("float64") */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -7385,16 +7488,16 @@ __Pyx_INCREF(__pyx_n_s_velocity_x); __Pyx_GIVEREF(__pyx_n_s_velocity_x); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_velocity_x); - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __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__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __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, 457, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 454, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7410,20 +7513,20 @@ } } __pyx_pybuffernd_vxf.diminfo[0].strides = __pyx_pybuffernd_vxf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vxf.diminfo[0].shape = __pyx_pybuffernd_vxf.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 457, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 454, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_vxf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":458 + /* "yt/utilities/lib/geometry_utils.pyx":455 * # One dimensional data * vxf = data[ftype, 'velocity_x'].astype("float64") * vyf = data[ftype, 'velocity_y'].astype("float64") # <<<<<<<<<<<<<< * vzf = data[ftype, 'velocity_z'].astype("float64") * rvf = np.empty((3, vxf.shape[0]), 'float64') */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -7431,16 +7534,16 @@ __Pyx_INCREF(__pyx_n_s_velocity_y); __Pyx_GIVEREF(__pyx_n_s_velocity_y); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_velocity_y); - __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __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_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 458, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 455, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7456,20 +7559,20 @@ } } __pyx_pybuffernd_vyf.diminfo[0].strides = __pyx_pybuffernd_vyf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vyf.diminfo[0].shape = __pyx_pybuffernd_vyf.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 455, __pyx_L1_error) } __pyx_t_11 = 0; __pyx_v_vyf = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":459 + /* "yt/utilities/lib/geometry_utils.pyx":456 * vxf = data[ftype, 'velocity_x'].astype("float64") * vyf = data[ftype, 'velocity_y'].astype("float64") * vzf = data[ftype, 'velocity_z'].astype("float64") # <<<<<<<<<<<<<< * rvf = np.empty((3, vxf.shape[0]), 'float64') * for i in range(vxf.shape[0]): */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -7477,16 +7580,16 @@ __Pyx_INCREF(__pyx_n_s_velocity_z); __Pyx_GIVEREF(__pyx_n_s_velocity_z); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_velocity_z); - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __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__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __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, 459, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 456, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7502,27 +7605,27 @@ } } __pyx_pybuffernd_vzf.diminfo[0].strides = __pyx_pybuffernd_vzf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vzf.diminfo[0].shape = __pyx_pybuffernd_vzf.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 456, __pyx_L1_error) } __pyx_t_12 = 0; __pyx_v_vzf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":460 + /* "yt/utilities/lib/geometry_utils.pyx":457 * vyf = data[ftype, 'velocity_y'].astype("float64") * vzf = data[ftype, 'velocity_z'].astype("float64") * rvf = np.empty((3, vxf.shape[0]), 'float64') # <<<<<<<<<<<<<< * for i in range(vxf.shape[0]): * rvf[0, i] = vxf[i] - bv[0] */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxf->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxf->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); @@ -7545,7 +7648,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_14, __pyx_n_s_float64}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; @@ -7554,14 +7657,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_14, __pyx_n_s_float64}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif { - __pyx_t_15 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -7572,12 +7675,12 @@ __Pyx_GIVEREF(__pyx_n_s_float64); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_7, __pyx_n_s_float64); __pyx_t_14 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 460, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 457, __pyx_L1_error) __pyx_t_16 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7593,13 +7696,13 @@ } } __pyx_pybuffernd_rvf.diminfo[0].strides = __pyx_pybuffernd_rvf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rvf.diminfo[0].shape = __pyx_pybuffernd_rvf.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rvf.diminfo[1].strides = __pyx_pybuffernd_rvf.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rvf.diminfo[1].shape = __pyx_pybuffernd_rvf.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 460, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 457, __pyx_L1_error) } __pyx_t_16 = 0; __pyx_v_rvf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":461 + /* "yt/utilities/lib/geometry_utils.pyx":458 * vzf = data[ftype, 'velocity_z'].astype("float64") * rvf = np.empty((3, vxf.shape[0]), 'float64') * for i in range(vxf.shape[0]): # <<<<<<<<<<<<<< @@ -7610,7 +7713,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_17; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/geometry_utils.pyx":462 + /* "yt/utilities/lib/geometry_utils.pyx":459 * rvf = np.empty((3, vxf.shape[0]), 'float64') * for i in range(vxf.shape[0]): * rvf[0, i] = vxf[i] - bv[0] # <<<<<<<<<<<<<< @@ -7622,7 +7725,7 @@ __pyx_t_20 = __pyx_v_i; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rvf.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_rvf.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_rvf.diminfo[1].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vxf.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_vxf.diminfo[0].strides)) - (__pyx_v_bv[0])); - /* "yt/utilities/lib/geometry_utils.pyx":463 + /* "yt/utilities/lib/geometry_utils.pyx":460 * for i in range(vxf.shape[0]): * rvf[0, i] = vxf[i] - bv[0] * rvf[1, i] = vyf[i] - bv[1] # <<<<<<<<<<<<<< @@ -7634,7 +7737,7 @@ __pyx_t_23 = __pyx_v_i; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rvf.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rvf.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_rvf.diminfo[1].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vyf.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_vyf.diminfo[0].strides)) - (__pyx_v_bv[1])); - /* "yt/utilities/lib/geometry_utils.pyx":464 + /* "yt/utilities/lib/geometry_utils.pyx":461 * rvf[0, i] = vxf[i] - bv[0] * rvf[1, i] = vyf[i] - bv[1] * rvf[2, i] = vzf[i] - bv[2] # <<<<<<<<<<<<<< @@ -7647,7 +7750,7 @@ *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rvf.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_rvf.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_rvf.diminfo[1].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vzf.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_vzf.diminfo[0].strides)) - (__pyx_v_bv[2])); } - /* "yt/utilities/lib/geometry_utils.pyx":465 + /* "yt/utilities/lib/geometry_utils.pyx":462 * rvf[1, i] = vyf[i] - bv[1] * rvf[2, i] = vzf[i] - bv[2] * return rvf # <<<<<<<<<<<<<< @@ -7659,7 +7762,7 @@ __pyx_r = ((PyObject *)__pyx_v_rvf); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":455 + /* "yt/utilities/lib/geometry_utils.pyx":452 * bulk_velocity = np.zeros(3) * bv[0] = bulk_velocity[0]; bv[1] = bulk_velocity[1]; bv[2] = bulk_velocity[2] * if len(data[ftype, 'velocity_x'].shape) == 1: # <<<<<<<<<<<<<< @@ -7668,7 +7771,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":468 + /* "yt/utilities/lib/geometry_utils.pyx":465 * else: * # Three dimensional data * vxg = data[ftype, 'velocity_x'].astype("float64") # <<<<<<<<<<<<<< @@ -7676,7 +7779,7 @@ * vzg = data[ftype, 'velocity_z'].astype("float64") */ /*else*/ { - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -7684,16 +7787,16 @@ __Pyx_INCREF(__pyx_n_s_velocity_x); __Pyx_GIVEREF(__pyx_n_s_velocity_x); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_velocity_x); - __pyx_t_13 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_13 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 468, __pyx_L1_error) + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 465, __pyx_L1_error) __pyx_t_27 = ((PyArrayObject *)__pyx_t_13); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7709,20 +7812,20 @@ } } __pyx_pybuffernd_vxg.diminfo[0].strides = __pyx_pybuffernd_vxg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vxg.diminfo[0].shape = __pyx_pybuffernd_vxg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vxg.diminfo[1].strides = __pyx_pybuffernd_vxg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vxg.diminfo[1].shape = __pyx_pybuffernd_vxg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_vxg.diminfo[2].strides = __pyx_pybuffernd_vxg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_vxg.diminfo[2].shape = __pyx_pybuffernd_vxg.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 465, __pyx_L1_error) } __pyx_t_27 = 0; __pyx_v_vxg = ((PyArrayObject *)__pyx_t_13); __pyx_t_13 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":469 + /* "yt/utilities/lib/geometry_utils.pyx":466 * # Three dimensional data * vxg = data[ftype, 'velocity_x'].astype("float64") * vyg = data[ftype, 'velocity_y'].astype("float64") # <<<<<<<<<<<<<< * vzg = data[ftype, 'velocity_z'].astype("float64") * rvg = np.empty((3, vxg.shape[0], vxg.shape[1], vxg.shape[2]), 'float64') */ - __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -7730,16 +7833,16 @@ __Pyx_INCREF(__pyx_n_s_velocity_y); __Pyx_GIVEREF(__pyx_n_s_velocity_y); PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_velocity_y); - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 469, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 466, __pyx_L1_error) __pyx_t_28 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7755,20 +7858,20 @@ } } __pyx_pybuffernd_vyg.diminfo[0].strides = __pyx_pybuffernd_vyg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vyg.diminfo[0].shape = __pyx_pybuffernd_vyg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vyg.diminfo[1].strides = __pyx_pybuffernd_vyg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vyg.diminfo[1].shape = __pyx_pybuffernd_vyg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_vyg.diminfo[2].strides = __pyx_pybuffernd_vyg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_vyg.diminfo[2].shape = __pyx_pybuffernd_vyg.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 469, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 466, __pyx_L1_error) } __pyx_t_28 = 0; __pyx_v_vyg = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":470 + /* "yt/utilities/lib/geometry_utils.pyx":467 * vxg = data[ftype, 'velocity_x'].astype("float64") * vyg = data[ftype, 'velocity_y'].astype("float64") * vzg = data[ftype, 'velocity_z'].astype("float64") # <<<<<<<<<<<<<< * rvg = np.empty((3, vxg.shape[0], vxg.shape[1], vxg.shape[2]), 'float64') * for i in range(vxg.shape[0]): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ftype); __Pyx_GIVEREF(__pyx_v_ftype); @@ -7776,16 +7879,16 @@ __Pyx_INCREF(__pyx_n_s_velocity_z); __Pyx_GIVEREF(__pyx_n_s_velocity_z); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_velocity_z); - __pyx_t_13 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_13 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 470, __pyx_L1_error) + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 467, __pyx_L1_error) __pyx_t_29 = ((PyArrayObject *)__pyx_t_13); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7801,31 +7904,31 @@ } } __pyx_pybuffernd_vzg.diminfo[0].strides = __pyx_pybuffernd_vzg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vzg.diminfo[0].shape = __pyx_pybuffernd_vzg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vzg.diminfo[1].strides = __pyx_pybuffernd_vzg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vzg.diminfo[1].shape = __pyx_pybuffernd_vzg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_vzg.diminfo[2].strides = __pyx_pybuffernd_vzg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_vzg.diminfo[2].shape = __pyx_pybuffernd_vzg.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 470, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 467, __pyx_L1_error) } __pyx_t_29 = 0; __pyx_v_vzg = ((PyArrayObject *)__pyx_t_13); __pyx_t_13 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":471 + /* "yt/utilities/lib/geometry_utils.pyx":468 * vyg = data[ftype, 'velocity_y'].astype("float64") * vzg = data[ftype, 'velocity_z'].astype("float64") * rvg = np.empty((3, vxg.shape[0], vxg.shape[1], vxg.shape[2]), 'float64') # <<<<<<<<<<<<<< * for i in range(vxg.shape[0]): * for j in range(vxg.shape[1]): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxg->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxg->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxg->dimensions[1])); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxg->dimensions[1])); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxg->dimensions[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxg->dimensions[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_30 = PyTuple_New(4); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_30 = PyTuple_New(4); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_30); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); @@ -7854,7 +7957,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_30, __pyx_n_s_float64}; - __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0; @@ -7863,14 +7966,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_30, __pyx_n_s_float64}; - __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0; } else #endif { - __pyx_t_14 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -7881,12 +7984,12 @@ __Pyx_GIVEREF(__pyx_n_s_float64); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_7, __pyx_n_s_float64); __pyx_t_30 = 0; - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 471, __pyx_L1_error) + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 468, __pyx_L1_error) __pyx_t_31 = ((PyArrayObject *)__pyx_t_13); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7902,13 +8005,13 @@ } } __pyx_pybuffernd_rvg.diminfo[0].strides = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rvg.diminfo[0].shape = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rvg.diminfo[1].strides = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rvg.diminfo[1].shape = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_rvg.diminfo[2].strides = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_rvg.diminfo[2].shape = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_rvg.diminfo[3].strides = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_rvg.diminfo[3].shape = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.shape[3]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 471, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 468, __pyx_L1_error) } __pyx_t_31 = 0; __pyx_v_rvg = ((PyArrayObject *)__pyx_t_13); __pyx_t_13 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":472 + /* "yt/utilities/lib/geometry_utils.pyx":469 * vzg = data[ftype, 'velocity_z'].astype("float64") * rvg = np.empty((3, vxg.shape[0], vxg.shape[1], vxg.shape[2]), 'float64') * for i in range(vxg.shape[0]): # <<<<<<<<<<<<<< @@ -7919,7 +8022,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_17; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/geometry_utils.pyx":473 + /* "yt/utilities/lib/geometry_utils.pyx":470 * rvg = np.empty((3, vxg.shape[0], vxg.shape[1], vxg.shape[2]), 'float64') * for i in range(vxg.shape[0]): * for j in range(vxg.shape[1]): # <<<<<<<<<<<<<< @@ -7930,7 +8033,7 @@ for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) { __pyx_v_j = __pyx_t_33; - /* "yt/utilities/lib/geometry_utils.pyx":474 + /* "yt/utilities/lib/geometry_utils.pyx":471 * for i in range(vxg.shape[0]): * for j in range(vxg.shape[1]): * for k in range(vxg.shape[2]): # <<<<<<<<<<<<<< @@ -7941,7 +8044,7 @@ for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { __pyx_v_k = __pyx_t_35; - /* "yt/utilities/lib/geometry_utils.pyx":475 + /* "yt/utilities/lib/geometry_utils.pyx":472 * for j in range(vxg.shape[1]): * for k in range(vxg.shape[2]): * rvg[0,i,j,k] = vxg[i,j,k] - bv[0] # <<<<<<<<<<<<<< @@ -7957,7 +8060,7 @@ __pyx_t_42 = __pyx_v_k; *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rvg.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rvg.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_rvg.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_rvg.diminfo[2].strides, __pyx_t_42, __pyx_pybuffernd_rvg.diminfo[3].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vxg.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_vxg.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_vxg.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_vxg.diminfo[2].strides)) - (__pyx_v_bv[0])); - /* "yt/utilities/lib/geometry_utils.pyx":476 + /* "yt/utilities/lib/geometry_utils.pyx":473 * for k in range(vxg.shape[2]): * rvg[0,i,j,k] = vxg[i,j,k] - bv[0] * rvg[1,i,j,k] = vyg[i,j,k] - bv[1] # <<<<<<<<<<<<<< @@ -7973,7 +8076,7 @@ __pyx_t_49 = __pyx_v_k; *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rvg.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_rvg.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_rvg.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_rvg.diminfo[2].strides, __pyx_t_49, __pyx_pybuffernd_rvg.diminfo[3].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vyg.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_vyg.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_vyg.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_vyg.diminfo[2].strides)) - (__pyx_v_bv[1])); - /* "yt/utilities/lib/geometry_utils.pyx":477 + /* "yt/utilities/lib/geometry_utils.pyx":474 * rvg[0,i,j,k] = vxg[i,j,k] - bv[0] * rvg[1,i,j,k] = vyg[i,j,k] - bv[1] * rvg[2,i,j,k] = vzg[i,j,k] - bv[2] # <<<<<<<<<<<<<< @@ -7992,7 +8095,7 @@ } } - /* "yt/utilities/lib/geometry_utils.pyx":478 + /* "yt/utilities/lib/geometry_utils.pyx":475 * rvg[1,i,j,k] = vyg[i,j,k] - bv[1] * rvg[2,i,j,k] = vzg[i,j,k] - bv[2] * return rvg # <<<<<<<<<<<<<< @@ -8005,7 +8108,7 @@ goto __pyx_L0; } - /* "yt/utilities/lib/geometry_utils.pyx":438 + /* "yt/utilities/lib/geometry_utils.pyx":435 * @cython.wraparound(False) * @cython.cdivision(True) * def obtain_rv_vec(data, ftype="gas"): # <<<<<<<<<<<<<< @@ -8061,7 +8164,7 @@ return __pyx_r; } -/* "yt/utilities/lib/geometry_utils.pyx":487 +/* "yt/utilities/lib/geometry_utils.pyx":484 * PointSet *next * * cdef inline void get_intersection(np.float64_t p0[3], np.float64_t p1[3], # <<<<<<<<<<<<<< @@ -8079,7 +8182,7 @@ __pyx_t_5numpy_float64_t __pyx_t_3; __Pyx_RefNannySetupContext("get_intersection", 0); - /* "yt/utilities/lib/geometry_utils.pyx":491 + /* "yt/utilities/lib/geometry_utils.pyx":488 * cdef np.float64_t vec[3] * cdef np.float64_t t * for j in range(3): # <<<<<<<<<<<<<< @@ -8089,7 +8192,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_j = __pyx_t_1; - /* "yt/utilities/lib/geometry_utils.pyx":492 + /* "yt/utilities/lib/geometry_utils.pyx":489 * cdef np.float64_t t * for j in range(3): * vec[j] = p1[j] - p0[j] # <<<<<<<<<<<<<< @@ -8099,7 +8202,7 @@ (__pyx_v_vec[__pyx_v_j]) = ((__pyx_v_p1[__pyx_v_j]) - (__pyx_v_p0[__pyx_v_j])); } - /* "yt/utilities/lib/geometry_utils.pyx":493 + /* "yt/utilities/lib/geometry_utils.pyx":490 * for j in range(3): * vec[j] = p1[j] - p0[j] * if vec[ax] == 0.0: # <<<<<<<<<<<<<< @@ -8109,7 +8212,7 @@ __pyx_t_2 = (((__pyx_v_vec[__pyx_v_ax]) == 0.0) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/geometry_utils.pyx":494 + /* "yt/utilities/lib/geometry_utils.pyx":491 * vec[j] = p1[j] - p0[j] * if vec[ax] == 0.0: * return # bail if the line is in the plane # <<<<<<<<<<<<<< @@ -8118,7 +8221,7 @@ */ goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":493 + /* "yt/utilities/lib/geometry_utils.pyx":490 * for j in range(3): * vec[j] = p1[j] - p0[j] * if vec[ax] == 0.0: # <<<<<<<<<<<<<< @@ -8127,7 +8230,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":495 + /* "yt/utilities/lib/geometry_utils.pyx":492 * if vec[ax] == 0.0: * return # bail if the line is in the plane * t = (coord - p0[ax])/vec[ax] # <<<<<<<<<<<<<< @@ -8137,11 +8240,11 @@ __pyx_t_3 = (__pyx_v_coord - (__pyx_v_p0[__pyx_v_ax])); if (unlikely((__pyx_v_vec[__pyx_v_ax]) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 495, __pyx_L1_error) + __PYX_ERR(0, 492, __pyx_L1_error) } __pyx_v_t = (__pyx_t_3 / (__pyx_v_vec[__pyx_v_ax])); - /* "yt/utilities/lib/geometry_utils.pyx":498 + /* "yt/utilities/lib/geometry_utils.pyx":495 * # We know that if they're on opposite sides, it has to intersect. And we * # won't get called otherwise. * for j in range(3): # <<<<<<<<<<<<<< @@ -8151,7 +8254,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_j = __pyx_t_1; - /* "yt/utilities/lib/geometry_utils.pyx":499 + /* "yt/utilities/lib/geometry_utils.pyx":496 * # won't get called otherwise. * for j in range(3): * p.points[p.count][j] = p0[j] + vec[j] * t # <<<<<<<<<<<<<< @@ -8161,7 +8264,7 @@ ((__pyx_v_p->points[__pyx_v_p->count])[__pyx_v_j]) = ((__pyx_v_p0[__pyx_v_j]) + ((__pyx_v_vec[__pyx_v_j]) * __pyx_v_t)); } - /* "yt/utilities/lib/geometry_utils.pyx":500 + /* "yt/utilities/lib/geometry_utils.pyx":497 * for j in range(3): * p.points[p.count][j] = p0[j] + vec[j] * t * p.count += 1 # <<<<<<<<<<<<<< @@ -8170,7 +8273,7 @@ */ __pyx_v_p->count = (__pyx_v_p->count + 1); - /* "yt/utilities/lib/geometry_utils.pyx":487 + /* "yt/utilities/lib/geometry_utils.pyx":484 * PointSet *next * * cdef inline void get_intersection(np.float64_t p0[3], np.float64_t p1[3], # <<<<<<<<<<<<<< @@ -8181,12 +8284,12 @@ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.utilities.lib.geometry_utils.get_intersection", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.geometry_utils.get_intersection", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/geometry_utils.pyx":503 +/* "yt/utilities/lib/geometry_utils.pyx":500 * * @cython.cdivision(True) * def triangle_plane_intersect(int ax, np.float64_t coord, # <<<<<<<<<<<<<< @@ -8212,8 +8315,11 @@ 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; } @@ -8222,19 +8328,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ax)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coord)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("triangle_plane_intersect", 1, 3, 3, 1); __PYX_ERR(0, 503, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("triangle_plane_intersect", 1, 3, 3, 1); __PYX_ERR(0, 500, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_triangles)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("triangle_plane_intersect", 1, 3, 3, 2); __PYX_ERR(0, 503, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("triangle_plane_intersect", 1, 3, 3, 2); __PYX_ERR(0, 500, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "triangle_plane_intersect") < 0)) __PYX_ERR(0, 503, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "triangle_plane_intersect") < 0)) __PYX_ERR(0, 500, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -8243,19 +8351,19 @@ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_ax = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_ax == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L3_error) - __pyx_v_coord = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_coord == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L3_error) + __pyx_v_ax = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_ax == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L3_error) + __pyx_v_coord = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_coord == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L3_error) __pyx_v_triangles = ((PyArrayObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("triangle_plane_intersect", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 503, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("triangle_plane_intersect", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 500, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.geometry_utils.triangle_plane_intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_triangles), __pyx_ptype_5numpy_ndarray, 1, "triangles", 0))) __PYX_ERR(0, 504, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_triangles), __pyx_ptype_5numpy_ndarray, 1, "triangles", 0))) __PYX_ERR(0, 501, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14geometry_utils_16triangle_plane_intersect(__pyx_self, __pyx_v_ax, __pyx_v_coord, __pyx_v_triangles); /* function exit code */ @@ -8270,7 +8378,7 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_14geometry_utils_16triangle_plane_intersect(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_ax, __pyx_t_5numpy_float64_t __pyx_v_coord, PyArrayObject *__pyx_v_triangles) { __pyx_t_5numpy_float64_t __pyx_v_p0[3]; __pyx_t_5numpy_float64_t __pyx_v_p1[3]; - __pyx_t_5numpy_float64_t __pyx_v_p3[3]; + __pyx_t_5numpy_float64_t __pyx_v_p2[3]; __pyx_t_5numpy_float64_t __pyx_v_E0[3]; __pyx_t_5numpy_float64_t __pyx_v_E1[3]; __pyx_t_5numpy_float64_t __pyx_v_tri_norm[3]; @@ -8309,7 +8417,7 @@ 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_18 = NULL; Py_ssize_t __pyx_t_19; Py_ssize_t __pyx_t_20; Py_ssize_t __pyx_t_21; @@ -8327,7 +8435,7 @@ Py_ssize_t __pyx_t_33; Py_ssize_t __pyx_t_34; Py_ssize_t __pyx_t_35; - PyObject *__pyx_t_36 = NULL; + Py_ssize_t __pyx_t_36; PyObject *__pyx_t_37 = NULL; PyObject *__pyx_t_38 = NULL; PyObject *__pyx_t_39 = NULL; @@ -8341,13 +8449,7 @@ Py_ssize_t __pyx_t_47; Py_ssize_t __pyx_t_48; Py_ssize_t __pyx_t_49; - Py_ssize_t __pyx_t_50; - Py_ssize_t __pyx_t_51; - Py_ssize_t __pyx_t_52; - Py_ssize_t __pyx_t_53; - Py_ssize_t __pyx_t_54; - Py_ssize_t __pyx_t_55; - struct __pyx_t_2yt_9utilities_3lib_14geometry_utils_PointSet *__pyx_t_56; + struct __pyx_t_2yt_9utilities_3lib_14geometry_utils_PointSet *__pyx_t_50; __Pyx_RefNannySetupContext("triangle_plane_intersect", 0); __pyx_pybuffer_line_segments.pybuffer.buf = NULL; __pyx_pybuffer_line_segments.refcount = 0; @@ -8359,11 +8461,11 @@ __pyx_pybuffernd_triangles.rcbuffer = &__pyx_pybuffer_triangles; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_triangles.rcbuffer->pybuffer, (PyObject*)__pyx_v_triangles, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 503, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_triangles.rcbuffer->pybuffer, (PyObject*)__pyx_v_triangles, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 500, __pyx_L1_error) } __pyx_pybuffernd_triangles.diminfo[0].strides = __pyx_pybuffernd_triangles.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_triangles.diminfo[0].shape = __pyx_pybuffernd_triangles.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_triangles.diminfo[1].strides = __pyx_pybuffernd_triangles.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_triangles.diminfo[1].shape = __pyx_pybuffernd_triangles.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_triangles.diminfo[2].strides = __pyx_pybuffernd_triangles.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_triangles.diminfo[2].shape = __pyx_pybuffernd_triangles.rcbuffer->pybuffer.shape[2]; - /* "yt/utilities/lib/geometry_utils.pyx":514 + /* "yt/utilities/lib/geometry_utils.pyx":511 * cdef np.float64_t dp * cdef int i, j, k, count, ntri, nlines * nlines = 0 # <<<<<<<<<<<<<< @@ -8372,7 +8474,7 @@ */ __pyx_v_nlines = 0; - /* "yt/utilities/lib/geometry_utils.pyx":515 + /* "yt/utilities/lib/geometry_utils.pyx":512 * cdef int i, j, k, count, ntri, nlines * nlines = 0 * ntri = triangles.shape[0] # <<<<<<<<<<<<<< @@ -8381,7 +8483,7 @@ */ __pyx_v_ntri = (__pyx_v_triangles->dimensions[0]); - /* "yt/utilities/lib/geometry_utils.pyx":519 + /* "yt/utilities/lib/geometry_utils.pyx":516 * cdef PointSet *last * cdef PointSet *points * first = last = points = NULL # <<<<<<<<<<<<<< @@ -8392,7 +8494,7 @@ __pyx_v_last = NULL; __pyx_v_points = NULL; - /* "yt/utilities/lib/geometry_utils.pyx":520 + /* "yt/utilities/lib/geometry_utils.pyx":517 * cdef PointSet *points * first = last = points = NULL * for i in range(ntri): # <<<<<<<<<<<<<< @@ -8403,18 +8505,18 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/geometry_utils.pyx":521 + /* "yt/utilities/lib/geometry_utils.pyx":518 * first = last = points = NULL * for i in range(ntri): * count = 0 # <<<<<<<<<<<<<< * - * # skip if triangle is close to being parallel to plane + * # Here p0 holds the triangle's zeroth node coordinates, */ __pyx_v_count = 0; - /* "yt/utilities/lib/geometry_utils.pyx":524 - * - * # skip if triangle is close to being parallel to plane + /* "yt/utilities/lib/geometry_utils.pyx":523 + * # p1 holds the first node's coordinates, and + * # p2 holds the second node's coordinates * for j in range(3): # <<<<<<<<<<<<<< * p0[j] = triangles[i, 0, j] * p1[j] = triangles[i, 1, j] @@ -8422,12 +8524,12 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_j = __pyx_t_3; - /* "yt/utilities/lib/geometry_utils.pyx":525 - * # skip if triangle is close to being parallel to plane + /* "yt/utilities/lib/geometry_utils.pyx":524 + * # p2 holds the second node's coordinates * for j in range(3): * p0[j] = triangles[i, 0, j] # <<<<<<<<<<<<<< * p1[j] = triangles[i, 1, j] - * p3[j] = triangles[i, 2, j] + * p2[j] = triangles[i, 2, j] */ __pyx_t_4 = __pyx_v_i; __pyx_t_5 = 0; @@ -8447,15 +8549,15 @@ } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 525, __pyx_L1_error) + __PYX_ERR(0, 524, __pyx_L1_error) } (__pyx_v_p0[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_6, __pyx_pybuffernd_triangles.diminfo[2].strides)); - /* "yt/utilities/lib/geometry_utils.pyx":526 + /* "yt/utilities/lib/geometry_utils.pyx":525 * for j in range(3): * p0[j] = triangles[i, 0, j] * p1[j] = triangles[i, 1, j] # <<<<<<<<<<<<<< - * p3[j] = triangles[i, 2, j] + * p2[j] = triangles[i, 2, j] * plane_norm[j] = 0.0 */ __pyx_t_8 = __pyx_v_i; @@ -8476,14 +8578,14 @@ } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 526, __pyx_L1_error) + __PYX_ERR(0, 525, __pyx_L1_error) } (__pyx_v_p1[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_triangles.diminfo[2].strides)); - /* "yt/utilities/lib/geometry_utils.pyx":527 + /* "yt/utilities/lib/geometry_utils.pyx":526 * p0[j] = triangles[i, 0, j] * p1[j] = triangles[i, 1, j] - * p3[j] = triangles[i, 2, j] # <<<<<<<<<<<<<< + * p2[j] = triangles[i, 2, j] # <<<<<<<<<<<<<< * plane_norm[j] = 0.0 * plane_norm[ax] = 1.0 */ @@ -8505,13 +8607,13 @@ } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 527, __pyx_L1_error) + __PYX_ERR(0, 526, __pyx_L1_error) } - (__pyx_v_p3[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_triangles.diminfo[2].strides)); + (__pyx_v_p2[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_triangles.diminfo[2].strides)); - /* "yt/utilities/lib/geometry_utils.pyx":528 + /* "yt/utilities/lib/geometry_utils.pyx":527 * p1[j] = triangles[i, 1, j] - * p3[j] = triangles[i, 2, j] + * p2[j] = triangles[i, 2, j] * plane_norm[j] = 0.0 # <<<<<<<<<<<<<< * plane_norm[ax] = 1.0 * subtract(p1, p0, E0) @@ -8519,63 +8621,63 @@ (__pyx_v_plane_norm[__pyx_v_j]) = 0.0; } - /* "yt/utilities/lib/geometry_utils.pyx":529 - * p3[j] = triangles[i, 2, j] + /* "yt/utilities/lib/geometry_utils.pyx":528 + * p2[j] = triangles[i, 2, j] * plane_norm[j] = 0.0 * plane_norm[ax] = 1.0 # <<<<<<<<<<<<<< * subtract(p1, p0, E0) - * subtract(p3, p0, E1) + * subtract(p2, p0, E1) */ (__pyx_v_plane_norm[__pyx_v_ax]) = 1.0; - /* "yt/utilities/lib/geometry_utils.pyx":530 + /* "yt/utilities/lib/geometry_utils.pyx":529 * plane_norm[j] = 0.0 * plane_norm[ax] = 1.0 * subtract(p1, p0, E0) # <<<<<<<<<<<<<< - * subtract(p3, p0, E1) + * subtract(p2, p0, E1) * cross(E0, E1, tri_norm) */ __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(__pyx_v_p1, __pyx_v_p0, __pyx_v_E0); - /* "yt/utilities/lib/geometry_utils.pyx":531 + /* "yt/utilities/lib/geometry_utils.pyx":530 * plane_norm[ax] = 1.0 * subtract(p1, p0, E0) - * subtract(p3, p0, E1) # <<<<<<<<<<<<<< + * subtract(p2, p0, E1) # <<<<<<<<<<<<<< * cross(E0, E1, tri_norm) * dp = dot(tri_norm, plane_norm) */ - __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(__pyx_v_p3, __pyx_v_p0, __pyx_v_E1); + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(__pyx_v_p2, __pyx_v_p0, __pyx_v_E1); - /* "yt/utilities/lib/geometry_utils.pyx":532 + /* "yt/utilities/lib/geometry_utils.pyx":531 * subtract(p1, p0, E0) - * subtract(p3, p0, E1) + * subtract(p2, p0, E1) * cross(E0, E1, tri_norm) # <<<<<<<<<<<<<< * dp = dot(tri_norm, plane_norm) * dp /= L2_norm(tri_norm) */ __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(__pyx_v_E0, __pyx_v_E1, __pyx_v_tri_norm); - /* "yt/utilities/lib/geometry_utils.pyx":533 - * subtract(p3, p0, E1) + /* "yt/utilities/lib/geometry_utils.pyx":532 + * subtract(p2, p0, E1) * cross(E0, E1, tri_norm) * dp = dot(tri_norm, plane_norm) # <<<<<<<<<<<<<< * dp /= L2_norm(tri_norm) - * if (fabs(dp) > 0.995): + * # Skip if triangle is close to being parallel to plane. */ __pyx_v_dp = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_tri_norm, __pyx_v_plane_norm); - /* "yt/utilities/lib/geometry_utils.pyx":534 + /* "yt/utilities/lib/geometry_utils.pyx":533 * cross(E0, E1, tri_norm) * dp = dot(tri_norm, plane_norm) * dp /= L2_norm(tri_norm) # <<<<<<<<<<<<<< + * # Skip if triangle is close to being parallel to plane. * if (fabs(dp) > 0.995): - * continue */ __pyx_v_dp = (__pyx_v_dp / __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(__pyx_v_tri_norm)); /* "yt/utilities/lib/geometry_utils.pyx":535 - * dp = dot(tri_norm, plane_norm) * dp /= L2_norm(tri_norm) + * # Skip if triangle is close to being parallel to plane. * if (fabs(dp) > 0.995): # <<<<<<<<<<<<<< * continue * @@ -8584,7 +8686,7 @@ if (__pyx_t_14) { /* "yt/utilities/lib/geometry_utils.pyx":536 - * dp /= L2_norm(tri_norm) + * # Skip if triangle is close to being parallel to plane. * if (fabs(dp) > 0.995): * continue # <<<<<<<<<<<<<< * @@ -8593,30 +8695,30 @@ goto __pyx_L3_continue; /* "yt/utilities/lib/geometry_utils.pyx":535 - * dp = dot(tri_norm, plane_norm) * dp /= L2_norm(tri_norm) + * # Skip if triangle is close to being parallel to plane. * if (fabs(dp) > 0.995): # <<<<<<<<<<<<<< * continue * */ } - /* "yt/utilities/lib/geometry_utils.pyx":540 - * # Now for each line segment (01, 12, 20) we check to see how many cross - * # the coordinate. + /* "yt/utilities/lib/geometry_utils.pyx":543 + * # node's coordinate corresponding to the slice axis is greater than the + * # coordinate of the slice. p2[0] -> node 0; p2[1] -> node 1; p2[2] -> node2 * for j in range(3): # <<<<<<<<<<<<<< - * p3[j] = copysign(1.0, triangles[i, j, ax] - coord) - * if p3[0] * p3[1] < 0: count += 1 + * # Add 0 so that any -0s become +0s. Necessary for consistent determination + * # of plane intersection */ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_j = __pyx_t_3; - /* "yt/utilities/lib/geometry_utils.pyx":541 - * # the coordinate. - * for j in range(3): - * p3[j] = copysign(1.0, triangles[i, j, ax] - coord) # <<<<<<<<<<<<<< - * if p3[0] * p3[1] < 0: count += 1 - * if p3[1] * p3[2] < 0: count += 1 + /* "yt/utilities/lib/geometry_utils.pyx":546 + * # Add 0 so that any -0s become +0s. Necessary for consistent determination + * # of plane intersection + * p2[j] = copysign(1.0, triangles[i, j, ax] - coord + 0) # <<<<<<<<<<<<<< + * if p2[0] * p2[1] < 0: count += 1 + * if p2[1] * p2[2] < 0: count += 1 */ __pyx_t_15 = __pyx_v_i; __pyx_t_16 = __pyx_v_j; @@ -8636,50 +8738,50 @@ } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 541, __pyx_L1_error) + __PYX_ERR(0, 546, __pyx_L1_error) } - (__pyx_v_p3[__pyx_v_j]) = copysign(1.0, ((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_triangles.diminfo[2].strides)) - __pyx_v_coord)); + (__pyx_v_p2[__pyx_v_j]) = copysign(1.0, (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_triangles.diminfo[2].strides)) - __pyx_v_coord) + 0.0)); } - /* "yt/utilities/lib/geometry_utils.pyx":542 - * for j in range(3): - * p3[j] = copysign(1.0, triangles[i, j, ax] - coord) - * if p3[0] * p3[1] < 0: count += 1 # <<<<<<<<<<<<<< - * if p3[1] * p3[2] < 0: count += 1 - * if p3[2] * p3[0] < 0: count += 1 + /* "yt/utilities/lib/geometry_utils.pyx":547 + * # of plane intersection + * p2[j] = copysign(1.0, triangles[i, j, ax] - coord + 0) + * if p2[0] * p2[1] < 0: count += 1 # <<<<<<<<<<<<<< + * if p2[1] * p2[2] < 0: count += 1 + * if p2[2] * p2[0] < 0: count += 1 */ - __pyx_t_14 = ((((__pyx_v_p3[0]) * (__pyx_v_p3[1])) < 0.0) != 0); + __pyx_t_14 = ((((__pyx_v_p2[0]) * (__pyx_v_p2[1])) < 0.0) != 0); if (__pyx_t_14) { __pyx_v_count = (__pyx_v_count + 1); } - /* "yt/utilities/lib/geometry_utils.pyx":543 - * p3[j] = copysign(1.0, triangles[i, j, ax] - coord) - * if p3[0] * p3[1] < 0: count += 1 - * if p3[1] * p3[2] < 0: count += 1 # <<<<<<<<<<<<<< - * if p3[2] * p3[0] < 0: count += 1 + /* "yt/utilities/lib/geometry_utils.pyx":548 + * p2[j] = copysign(1.0, triangles[i, j, ax] - coord + 0) + * if p2[0] * p2[1] < 0: count += 1 + * if p2[1] * p2[2] < 0: count += 1 # <<<<<<<<<<<<<< + * if p2[2] * p2[0] < 0: count += 1 * if count == 2: */ - __pyx_t_14 = ((((__pyx_v_p3[1]) * (__pyx_v_p3[2])) < 0.0) != 0); + __pyx_t_14 = ((((__pyx_v_p2[1]) * (__pyx_v_p2[2])) < 0.0) != 0); if (__pyx_t_14) { __pyx_v_count = (__pyx_v_count + 1); } - /* "yt/utilities/lib/geometry_utils.pyx":544 - * if p3[0] * p3[1] < 0: count += 1 - * if p3[1] * p3[2] < 0: count += 1 - * if p3[2] * p3[0] < 0: count += 1 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/geometry_utils.pyx":549 + * if p2[0] * p2[1] < 0: count += 1 + * if p2[1] * p2[2] < 0: count += 1 + * if p2[2] * p2[0] < 0: count += 1 # <<<<<<<<<<<<<< * if count == 2: * nlines += 1 */ - __pyx_t_14 = ((((__pyx_v_p3[2]) * (__pyx_v_p3[0])) < 0.0) != 0); + __pyx_t_14 = ((((__pyx_v_p2[2]) * (__pyx_v_p2[0])) < 0.0) != 0); if (__pyx_t_14) { __pyx_v_count = (__pyx_v_count + 1); } - /* "yt/utilities/lib/geometry_utils.pyx":545 - * if p3[1] * p3[2] < 0: count += 1 - * if p3[2] * p3[0] < 0: count += 1 + /* "yt/utilities/lib/geometry_utils.pyx":550 + * if p2[1] * p2[2] < 0: count += 1 + * if p2[2] * p2[0] < 0: count += 1 * if count == 2: # <<<<<<<<<<<<<< * nlines += 1 * elif count == 3: @@ -8687,54 +8789,58 @@ switch (__pyx_v_count) { case 2: - /* "yt/utilities/lib/geometry_utils.pyx":546 - * if p3[2] * p3[0] < 0: count += 1 + /* "yt/utilities/lib/geometry_utils.pyx":551 + * if p2[2] * p2[0] < 0: count += 1 * if count == 2: * nlines += 1 # <<<<<<<<<<<<<< * elif count == 3: - * nlines += 2 + * raise RuntimeError("It should be geometrically impossible for a plane to" */ __pyx_v_nlines = (__pyx_v_nlines + 1); - /* "yt/utilities/lib/geometry_utils.pyx":545 - * if p3[1] * p3[2] < 0: count += 1 - * if p3[2] * p3[0] < 0: count += 1 + /* "yt/utilities/lib/geometry_utils.pyx":550 + * if p2[1] * p2[2] < 0: count += 1 + * if p2[2] * p2[0] < 0: count += 1 * if count == 2: # <<<<<<<<<<<<<< * nlines += 1 * elif count == 3: */ break; - /* "yt/utilities/lib/geometry_utils.pyx":547 + /* "yt/utilities/lib/geometry_utils.pyx":552 * if count == 2: * nlines += 1 * elif count == 3: # <<<<<<<<<<<<<< - * nlines += 2 - * else: + * raise RuntimeError("It should be geometrically impossible for a plane to" + * "to intersect all three legs of a triangle. Please contact" */ case 3: - /* "yt/utilities/lib/geometry_utils.pyx":548 + /* "yt/utilities/lib/geometry_utils.pyx":553 * nlines += 1 * elif count == 3: - * nlines += 2 # <<<<<<<<<<<<<< - * else: - * continue - */ - __pyx_v_nlines = (__pyx_v_nlines + 2); + * raise RuntimeError("It should be geometrically impossible for a plane to" # <<<<<<<<<<<<<< + * "to intersect all three legs of a triangle. Please contact" + * "yt developers with your mesh") + */ + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_Raise(__pyx_t_18, 0, 0, 0); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __PYX_ERR(0, 553, __pyx_L1_error) - /* "yt/utilities/lib/geometry_utils.pyx":547 + /* "yt/utilities/lib/geometry_utils.pyx":552 * if count == 2: * nlines += 1 * elif count == 3: # <<<<<<<<<<<<<< - * nlines += 2 - * else: + * raise RuntimeError("It should be geometrically impossible for a plane to" + * "to intersect all three legs of a triangle. Please contact" */ break; default: - /* "yt/utilities/lib/geometry_utils.pyx":550 - * nlines += 2 + /* "yt/utilities/lib/geometry_utils.pyx":557 + * "yt developers with your mesh") * else: * continue # <<<<<<<<<<<<<< * points = malloc(sizeof(PointSet)) @@ -8744,7 +8850,7 @@ break; } - /* "yt/utilities/lib/geometry_utils.pyx":551 + /* "yt/utilities/lib/geometry_utils.pyx":558 * else: * continue * points = malloc(sizeof(PointSet)) # <<<<<<<<<<<<<< @@ -8753,37 +8859,37 @@ */ __pyx_v_points = ((struct __pyx_t_2yt_9utilities_3lib_14geometry_utils_PointSet *)malloc((sizeof(struct __pyx_t_2yt_9utilities_3lib_14geometry_utils_PointSet)))); - /* "yt/utilities/lib/geometry_utils.pyx":552 + /* "yt/utilities/lib/geometry_utils.pyx":559 * continue * points = malloc(sizeof(PointSet)) * points.count = 0 # <<<<<<<<<<<<<< * points.next = NULL - * if p3[0] * p3[1] < 0: + * */ __pyx_v_points->count = 0; - /* "yt/utilities/lib/geometry_utils.pyx":553 + /* "yt/utilities/lib/geometry_utils.pyx":560 * points = malloc(sizeof(PointSet)) * points.count = 0 * points.next = NULL # <<<<<<<<<<<<<< - * if p3[0] * p3[1] < 0: - * for j in range(3): + * + * # Here p0 and p1 again hold node coordinates */ __pyx_v_points->next = NULL; - /* "yt/utilities/lib/geometry_utils.pyx":554 - * points.count = 0 - * points.next = NULL - * if p3[0] * p3[1] < 0: # <<<<<<<<<<<<<< + /* "yt/utilities/lib/geometry_utils.pyx":563 + * + * # Here p0 and p1 again hold node coordinates + * if p2[0] * p2[1] < 0: # <<<<<<<<<<<<<< + * # intersection of 01 triangle segment with plane * for j in range(3): - * p0[j] = triangles[i, 0, j] */ - __pyx_t_14 = ((((__pyx_v_p3[0]) * (__pyx_v_p3[1])) < 0.0) != 0); + __pyx_t_14 = ((((__pyx_v_p2[0]) * (__pyx_v_p2[1])) < 0.0) != 0); if (__pyx_t_14) { - /* "yt/utilities/lib/geometry_utils.pyx":555 - * points.next = NULL - * if p3[0] * p3[1] < 0: + /* "yt/utilities/lib/geometry_utils.pyx":565 + * if p2[0] * p2[1] < 0: + * # intersection of 01 triangle segment with plane * for j in range(3): # <<<<<<<<<<<<<< * p0[j] = triangles[i, 0, j] * p1[j] = triangles[i, 1, j] @@ -8791,96 +8897,96 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_j = __pyx_t_3; - /* "yt/utilities/lib/geometry_utils.pyx":556 - * if p3[0] * p3[1] < 0: + /* "yt/utilities/lib/geometry_utils.pyx":566 + * # intersection of 01 triangle segment with plane * for j in range(3): * p0[j] = triangles[i, 0, j] # <<<<<<<<<<<<<< * p1[j] = triangles[i, 1, j] * get_intersection(p0, p1, ax, coord, points) */ - __pyx_t_18 = __pyx_v_i; - __pyx_t_19 = 0; - __pyx_t_20 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = 0; + __pyx_t_21 = __pyx_v_j; __pyx_t_7 = -1; - if (__pyx_t_18 < 0) { - __pyx_t_18 += __pyx_pybuffernd_triangles.diminfo[0].shape; - if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_triangles.diminfo[0].shape)) __pyx_t_7 = 0; if (__pyx_t_19 < 0) { - __pyx_t_19 += __pyx_pybuffernd_triangles.diminfo[1].shape; - if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 1; - } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_triangles.diminfo[1].shape)) __pyx_t_7 = 1; + __pyx_t_19 += __pyx_pybuffernd_triangles.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_triangles.diminfo[0].shape)) __pyx_t_7 = 0; if (__pyx_t_20 < 0) { - __pyx_t_20 += __pyx_pybuffernd_triangles.diminfo[2].shape; - if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 2; - } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; + __pyx_t_20 += __pyx_pybuffernd_triangles.diminfo[1].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_triangles.diminfo[1].shape)) __pyx_t_7 = 1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_triangles.diminfo[2].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 556, __pyx_L1_error) + __PYX_ERR(0, 566, __pyx_L1_error) } - (__pyx_v_p0[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_triangles.diminfo[2].strides)); + (__pyx_v_p0[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_triangles.diminfo[2].strides)); - /* "yt/utilities/lib/geometry_utils.pyx":557 + /* "yt/utilities/lib/geometry_utils.pyx":567 * for j in range(3): * p0[j] = triangles[i, 0, j] * p1[j] = triangles[i, 1, j] # <<<<<<<<<<<<<< * get_intersection(p0, p1, ax, coord, points) - * if p3[1] * p3[2] < 0: + * if p2[1] * p2[2] < 0: */ - __pyx_t_21 = __pyx_v_i; - __pyx_t_22 = 1; - __pyx_t_23 = __pyx_v_j; + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = 1; + __pyx_t_24 = __pyx_v_j; __pyx_t_7 = -1; - if (__pyx_t_21 < 0) { - __pyx_t_21 += __pyx_pybuffernd_triangles.diminfo[0].shape; - if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_triangles.diminfo[0].shape)) __pyx_t_7 = 0; if (__pyx_t_22 < 0) { - __pyx_t_22 += __pyx_pybuffernd_triangles.diminfo[1].shape; - if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 1; - } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_triangles.diminfo[1].shape)) __pyx_t_7 = 1; + __pyx_t_22 += __pyx_pybuffernd_triangles.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_triangles.diminfo[0].shape)) __pyx_t_7 = 0; if (__pyx_t_23 < 0) { - __pyx_t_23 += __pyx_pybuffernd_triangles.diminfo[2].shape; - if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 2; - } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; + __pyx_t_23 += __pyx_pybuffernd_triangles.diminfo[1].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_triangles.diminfo[1].shape)) __pyx_t_7 = 1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_triangles.diminfo[2].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 557, __pyx_L1_error) + __PYX_ERR(0, 567, __pyx_L1_error) } - (__pyx_v_p1[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_triangles.diminfo[2].strides)); + (__pyx_v_p1[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_triangles.diminfo[2].strides)); } - /* "yt/utilities/lib/geometry_utils.pyx":558 + /* "yt/utilities/lib/geometry_utils.pyx":568 * p0[j] = triangles[i, 0, j] * p1[j] = triangles[i, 1, j] * get_intersection(p0, p1, ax, coord, points) # <<<<<<<<<<<<<< - * if p3[1] * p3[2] < 0: - * for j in range(3): + * if p2[1] * p2[2] < 0: + * # intersection of 12 triangle segment with plane */ __pyx_f_2yt_9utilities_3lib_14geometry_utils_get_intersection(__pyx_v_p0, __pyx_v_p1, __pyx_v_ax, __pyx_v_coord, __pyx_v_points); - /* "yt/utilities/lib/geometry_utils.pyx":554 - * points.count = 0 - * points.next = NULL - * if p3[0] * p3[1] < 0: # <<<<<<<<<<<<<< + /* "yt/utilities/lib/geometry_utils.pyx":563 + * + * # Here p0 and p1 again hold node coordinates + * if p2[0] * p2[1] < 0: # <<<<<<<<<<<<<< + * # intersection of 01 triangle segment with plane * for j in range(3): - * p0[j] = triangles[i, 0, j] */ } - /* "yt/utilities/lib/geometry_utils.pyx":559 + /* "yt/utilities/lib/geometry_utils.pyx":569 * p1[j] = triangles[i, 1, j] * get_intersection(p0, p1, ax, coord, points) - * if p3[1] * p3[2] < 0: # <<<<<<<<<<<<<< + * if p2[1] * p2[2] < 0: # <<<<<<<<<<<<<< + * # intersection of 12 triangle segment with plane * for j in range(3): - * p0[j] = triangles[i, 1, j] */ - __pyx_t_14 = ((((__pyx_v_p3[1]) * (__pyx_v_p3[2])) < 0.0) != 0); + __pyx_t_14 = ((((__pyx_v_p2[1]) * (__pyx_v_p2[2])) < 0.0) != 0); if (__pyx_t_14) { - /* "yt/utilities/lib/geometry_utils.pyx":560 - * get_intersection(p0, p1, ax, coord, points) - * if p3[1] * p3[2] < 0: + /* "yt/utilities/lib/geometry_utils.pyx":571 + * if p2[1] * p2[2] < 0: + * # intersection of 12 triangle segment with plane * for j in range(3): # <<<<<<<<<<<<<< * p0[j] = triangles[i, 1, j] * p1[j] = triangles[i, 2, j] @@ -8888,96 +8994,96 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_j = __pyx_t_3; - /* "yt/utilities/lib/geometry_utils.pyx":561 - * if p3[1] * p3[2] < 0: + /* "yt/utilities/lib/geometry_utils.pyx":572 + * # intersection of 12 triangle segment with plane * for j in range(3): * p0[j] = triangles[i, 1, j] # <<<<<<<<<<<<<< * p1[j] = triangles[i, 2, j] * get_intersection(p0, p1, ax, coord, points) */ - __pyx_t_24 = __pyx_v_i; - __pyx_t_25 = 1; - __pyx_t_26 = __pyx_v_j; + __pyx_t_25 = __pyx_v_i; + __pyx_t_26 = 1; + __pyx_t_27 = __pyx_v_j; __pyx_t_7 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_pybuffernd_triangles.diminfo[0].shape; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_triangles.diminfo[0].shape)) __pyx_t_7 = 0; if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_pybuffernd_triangles.diminfo[1].shape; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 1; - } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_triangles.diminfo[1].shape)) __pyx_t_7 = 1; + __pyx_t_25 += __pyx_pybuffernd_triangles.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_triangles.diminfo[0].shape)) __pyx_t_7 = 0; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_pybuffernd_triangles.diminfo[2].shape; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 2; - } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; + __pyx_t_26 += __pyx_pybuffernd_triangles.diminfo[1].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_triangles.diminfo[1].shape)) __pyx_t_7 = 1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_triangles.diminfo[2].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 561, __pyx_L1_error) + __PYX_ERR(0, 572, __pyx_L1_error) } - (__pyx_v_p0[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_26, __pyx_pybuffernd_triangles.diminfo[2].strides)); + (__pyx_v_p0[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_triangles.diminfo[2].strides)); - /* "yt/utilities/lib/geometry_utils.pyx":562 + /* "yt/utilities/lib/geometry_utils.pyx":573 * for j in range(3): * p0[j] = triangles[i, 1, j] * p1[j] = triangles[i, 2, j] # <<<<<<<<<<<<<< * get_intersection(p0, p1, ax, coord, points) - * if p3[2] * p3[0] < 0: + * if p2[2] * p2[0] < 0: */ - __pyx_t_27 = __pyx_v_i; - __pyx_t_28 = 2; - __pyx_t_29 = __pyx_v_j; + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = 2; + __pyx_t_30 = __pyx_v_j; __pyx_t_7 = -1; - if (__pyx_t_27 < 0) { - __pyx_t_27 += __pyx_pybuffernd_triangles.diminfo[0].shape; - if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_triangles.diminfo[0].shape)) __pyx_t_7 = 0; if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_pybuffernd_triangles.diminfo[1].shape; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 1; - } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_triangles.diminfo[1].shape)) __pyx_t_7 = 1; + __pyx_t_28 += __pyx_pybuffernd_triangles.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_triangles.diminfo[0].shape)) __pyx_t_7 = 0; if (__pyx_t_29 < 0) { - __pyx_t_29 += __pyx_pybuffernd_triangles.diminfo[2].shape; - if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 2; - } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; + __pyx_t_29 += __pyx_pybuffernd_triangles.diminfo[1].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_triangles.diminfo[1].shape)) __pyx_t_7 = 1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_triangles.diminfo[2].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 562, __pyx_L1_error) + __PYX_ERR(0, 573, __pyx_L1_error) } - (__pyx_v_p1[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_triangles.diminfo[2].strides)); + (__pyx_v_p1[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_triangles.diminfo[2].strides)); } - /* "yt/utilities/lib/geometry_utils.pyx":563 + /* "yt/utilities/lib/geometry_utils.pyx":574 * p0[j] = triangles[i, 1, j] * p1[j] = triangles[i, 2, j] * get_intersection(p0, p1, ax, coord, points) # <<<<<<<<<<<<<< - * if p3[2] * p3[0] < 0: - * for j in range(3): + * if p2[2] * p2[0] < 0: + * # intersection of 20 triangle segment with plane */ __pyx_f_2yt_9utilities_3lib_14geometry_utils_get_intersection(__pyx_v_p0, __pyx_v_p1, __pyx_v_ax, __pyx_v_coord, __pyx_v_points); - /* "yt/utilities/lib/geometry_utils.pyx":559 + /* "yt/utilities/lib/geometry_utils.pyx":569 * p1[j] = triangles[i, 1, j] * get_intersection(p0, p1, ax, coord, points) - * if p3[1] * p3[2] < 0: # <<<<<<<<<<<<<< + * if p2[1] * p2[2] < 0: # <<<<<<<<<<<<<< + * # intersection of 12 triangle segment with plane * for j in range(3): - * p0[j] = triangles[i, 1, j] */ } - /* "yt/utilities/lib/geometry_utils.pyx":564 + /* "yt/utilities/lib/geometry_utils.pyx":575 * p1[j] = triangles[i, 2, j] * get_intersection(p0, p1, ax, coord, points) - * if p3[2] * p3[0] < 0: # <<<<<<<<<<<<<< + * if p2[2] * p2[0] < 0: # <<<<<<<<<<<<<< + * # intersection of 20 triangle segment with plane * for j in range(3): - * p0[j] = triangles[i, 2, j] */ - __pyx_t_14 = ((((__pyx_v_p3[2]) * (__pyx_v_p3[0])) < 0.0) != 0); + __pyx_t_14 = ((((__pyx_v_p2[2]) * (__pyx_v_p2[0])) < 0.0) != 0); if (__pyx_t_14) { - /* "yt/utilities/lib/geometry_utils.pyx":565 - * get_intersection(p0, p1, ax, coord, points) - * if p3[2] * p3[0] < 0: + /* "yt/utilities/lib/geometry_utils.pyx":577 + * if p2[2] * p2[0] < 0: + * # intersection of 20 triangle segment with plane * for j in range(3): # <<<<<<<<<<<<<< * p0[j] = triangles[i, 2, j] * p1[j] = triangles[i, 0, j] @@ -8985,66 +9091,66 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_j = __pyx_t_3; - /* "yt/utilities/lib/geometry_utils.pyx":566 - * if p3[2] * p3[0] < 0: + /* "yt/utilities/lib/geometry_utils.pyx":578 + * # intersection of 20 triangle segment with plane * for j in range(3): * p0[j] = triangles[i, 2, j] # <<<<<<<<<<<<<< * p1[j] = triangles[i, 0, j] * get_intersection(p0, p1, ax, coord, points) */ - __pyx_t_30 = __pyx_v_i; - __pyx_t_31 = 2; - __pyx_t_32 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = 2; + __pyx_t_33 = __pyx_v_j; __pyx_t_7 = -1; - if (__pyx_t_30 < 0) { - __pyx_t_30 += __pyx_pybuffernd_triangles.diminfo[0].shape; - if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_triangles.diminfo[0].shape)) __pyx_t_7 = 0; if (__pyx_t_31 < 0) { - __pyx_t_31 += __pyx_pybuffernd_triangles.diminfo[1].shape; - if (unlikely(__pyx_t_31 < 0)) __pyx_t_7 = 1; - } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_triangles.diminfo[1].shape)) __pyx_t_7 = 1; + __pyx_t_31 += __pyx_pybuffernd_triangles.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_triangles.diminfo[0].shape)) __pyx_t_7 = 0; if (__pyx_t_32 < 0) { - __pyx_t_32 += __pyx_pybuffernd_triangles.diminfo[2].shape; - if (unlikely(__pyx_t_32 < 0)) __pyx_t_7 = 2; - } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; + __pyx_t_32 += __pyx_pybuffernd_triangles.diminfo[1].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_triangles.diminfo[1].shape)) __pyx_t_7 = 1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_triangles.diminfo[2].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 566, __pyx_L1_error) + __PYX_ERR(0, 578, __pyx_L1_error) } - (__pyx_v_p0[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_triangles.diminfo[2].strides)); + (__pyx_v_p0[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_triangles.diminfo[2].strides)); - /* "yt/utilities/lib/geometry_utils.pyx":567 + /* "yt/utilities/lib/geometry_utils.pyx":579 * for j in range(3): * p0[j] = triangles[i, 2, j] * p1[j] = triangles[i, 0, j] # <<<<<<<<<<<<<< * get_intersection(p0, p1, ax, coord, points) * if last != NULL: */ - __pyx_t_33 = __pyx_v_i; - __pyx_t_34 = 0; - __pyx_t_35 = __pyx_v_j; + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = 0; + __pyx_t_36 = __pyx_v_j; __pyx_t_7 = -1; - if (__pyx_t_33 < 0) { - __pyx_t_33 += __pyx_pybuffernd_triangles.diminfo[0].shape; - if (unlikely(__pyx_t_33 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_triangles.diminfo[0].shape)) __pyx_t_7 = 0; if (__pyx_t_34 < 0) { - __pyx_t_34 += __pyx_pybuffernd_triangles.diminfo[1].shape; - if (unlikely(__pyx_t_34 < 0)) __pyx_t_7 = 1; - } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_triangles.diminfo[1].shape)) __pyx_t_7 = 1; + __pyx_t_34 += __pyx_pybuffernd_triangles.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_triangles.diminfo[0].shape)) __pyx_t_7 = 0; if (__pyx_t_35 < 0) { - __pyx_t_35 += __pyx_pybuffernd_triangles.diminfo[2].shape; - if (unlikely(__pyx_t_35 < 0)) __pyx_t_7 = 2; - } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; + __pyx_t_35 += __pyx_pybuffernd_triangles.diminfo[1].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_triangles.diminfo[1].shape)) __pyx_t_7 = 1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_triangles.diminfo[2].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_triangles.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 567, __pyx_L1_error) + __PYX_ERR(0, 579, __pyx_L1_error) } - (__pyx_v_p1[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_triangles.diminfo[2].strides)); + (__pyx_v_p1[__pyx_v_j]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_triangles.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_triangles.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_triangles.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_triangles.diminfo[2].strides)); } - /* "yt/utilities/lib/geometry_utils.pyx":568 + /* "yt/utilities/lib/geometry_utils.pyx":580 * p0[j] = triangles[i, 2, j] * p1[j] = triangles[i, 0, j] * get_intersection(p0, p1, ax, coord, points) # <<<<<<<<<<<<<< @@ -9053,16 +9159,16 @@ */ __pyx_f_2yt_9utilities_3lib_14geometry_utils_get_intersection(__pyx_v_p0, __pyx_v_p1, __pyx_v_ax, __pyx_v_coord, __pyx_v_points); - /* "yt/utilities/lib/geometry_utils.pyx":564 + /* "yt/utilities/lib/geometry_utils.pyx":575 * p1[j] = triangles[i, 2, j] * get_intersection(p0, p1, ax, coord, points) - * if p3[2] * p3[0] < 0: # <<<<<<<<<<<<<< + * if p2[2] * p2[0] < 0: # <<<<<<<<<<<<<< + * # intersection of 20 triangle segment with plane * for j in range(3): - * p0[j] = triangles[i, 2, j] */ } - /* "yt/utilities/lib/geometry_utils.pyx":569 + /* "yt/utilities/lib/geometry_utils.pyx":581 * p1[j] = triangles[i, 0, j] * get_intersection(p0, p1, ax, coord, points) * if last != NULL: # <<<<<<<<<<<<<< @@ -9072,7 +9178,7 @@ __pyx_t_14 = ((__pyx_v_last != NULL) != 0); if (__pyx_t_14) { - /* "yt/utilities/lib/geometry_utils.pyx":570 + /* "yt/utilities/lib/geometry_utils.pyx":582 * get_intersection(p0, p1, ax, coord, points) * if last != NULL: * last.next = points # <<<<<<<<<<<<<< @@ -9081,7 +9187,7 @@ */ __pyx_v_last->next = __pyx_v_points; - /* "yt/utilities/lib/geometry_utils.pyx":569 + /* "yt/utilities/lib/geometry_utils.pyx":581 * p1[j] = triangles[i, 0, j] * get_intersection(p0, p1, ax, coord, points) * if last != NULL: # <<<<<<<<<<<<<< @@ -9090,7 +9196,7 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":571 + /* "yt/utilities/lib/geometry_utils.pyx":583 * if last != NULL: * last.next = points * if first == NULL: # <<<<<<<<<<<<<< @@ -9100,16 +9206,16 @@ __pyx_t_14 = ((__pyx_v_first == NULL) != 0); if (__pyx_t_14) { - /* "yt/utilities/lib/geometry_utils.pyx":572 + /* "yt/utilities/lib/geometry_utils.pyx":584 * last.next = points * if first == NULL: * first = points # <<<<<<<<<<<<<< * last = points - * points = first + * */ __pyx_v_first = __pyx_v_points; - /* "yt/utilities/lib/geometry_utils.pyx":571 + /* "yt/utilities/lib/geometry_utils.pyx":583 * if last != NULL: * last.next = points * if first == NULL: # <<<<<<<<<<<<<< @@ -9118,65 +9224,65 @@ */ } - /* "yt/utilities/lib/geometry_utils.pyx":573 + /* "yt/utilities/lib/geometry_utils.pyx":585 * if first == NULL: * first = points * last = points # <<<<<<<<<<<<<< + * * points = first - * cdef np.ndarray[np.float64_t, ndim=3] line_segments */ __pyx_v_last = __pyx_v_points; __pyx_L3_continue:; } - /* "yt/utilities/lib/geometry_utils.pyx":574 - * first = points + /* "yt/utilities/lib/geometry_utils.pyx":587 * last = points + * * points = first # <<<<<<<<<<<<<< * cdef np.ndarray[np.float64_t, ndim=3] line_segments * line_segments = np.empty((nlines, 2, 3), dtype="float64") */ __pyx_v_points = __pyx_v_first; - /* "yt/utilities/lib/geometry_utils.pyx":576 + /* "yt/utilities/lib/geometry_utils.pyx":589 * points = first * cdef np.ndarray[np.float64_t, ndim=3] line_segments * line_segments = np.empty((nlines, 2, 3), dtype="float64") # <<<<<<<<<<<<<< * k = 0 * while points != NULL: */ - __pyx_t_36 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 576, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_empty); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_empty); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __pyx_t_36 = __Pyx_PyInt_From_int(__pyx_v_nlines); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 576, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); - __pyx_t_38 = PyTuple_New(3); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_nlines); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_38 = PyTuple_New(3); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_38); - __Pyx_GIVEREF(__pyx_t_36); - PyTuple_SET_ITEM(__pyx_t_38, 0, __pyx_t_36); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_38, 0, __pyx_t_18); __Pyx_INCREF(__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); PyTuple_SET_ITEM(__pyx_t_38, 1, __pyx_int_2); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_38, 2, __pyx_int_3); - __pyx_t_36 = 0; - __pyx_t_36 = PyTuple_New(1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 576, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); + __pyx_t_18 = 0; + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); __Pyx_GIVEREF(__pyx_t_38); - PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_38); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_38); __pyx_t_38 = 0; - __pyx_t_38 = PyDict_New(); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_38 = PyDict_New(); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_38); - if (PyDict_SetItem(__pyx_t_38, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 576, __pyx_L1_error) - __pyx_t_39 = __Pyx_PyObject_Call(__pyx_t_37, __pyx_t_36, __pyx_t_38); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 576, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_38, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_39 = __Pyx_PyObject_Call(__pyx_t_37, __pyx_t_18, __pyx_t_38); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_39); __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - if (!(likely(((__pyx_t_39) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_39, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 576, __pyx_L1_error) + if (!(likely(((__pyx_t_39) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_39, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 589, __pyx_L1_error) __pyx_t_40 = ((PyArrayObject *)__pyx_t_39); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -9192,13 +9298,13 @@ } } __pyx_pybuffernd_line_segments.diminfo[0].strides = __pyx_pybuffernd_line_segments.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_line_segments.diminfo[0].shape = __pyx_pybuffernd_line_segments.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_line_segments.diminfo[1].strides = __pyx_pybuffernd_line_segments.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_line_segments.diminfo[1].shape = __pyx_pybuffernd_line_segments.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_line_segments.diminfo[2].strides = __pyx_pybuffernd_line_segments.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_line_segments.diminfo[2].shape = __pyx_pybuffernd_line_segments.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 576, __pyx_L1_error) + if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 589, __pyx_L1_error) } __pyx_t_40 = 0; __pyx_v_line_segments = ((PyArrayObject *)__pyx_t_39); __pyx_t_39 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":577 + /* "yt/utilities/lib/geometry_utils.pyx":590 * cdef np.ndarray[np.float64_t, ndim=3] line_segments * line_segments = np.empty((nlines, 2, 3), dtype="float64") * k = 0 # <<<<<<<<<<<<<< @@ -9207,7 +9313,7 @@ */ __pyx_v_k = 0; - /* "yt/utilities/lib/geometry_utils.pyx":578 + /* "yt/utilities/lib/geometry_utils.pyx":591 * line_segments = np.empty((nlines, 2, 3), dtype="float64") * k = 0 * while points != NULL: # <<<<<<<<<<<<<< @@ -9218,7 +9324,7 @@ __pyx_t_14 = ((__pyx_v_points != NULL) != 0); if (!__pyx_t_14) break; - /* "yt/utilities/lib/geometry_utils.pyx":579 + /* "yt/utilities/lib/geometry_utils.pyx":592 * k = 0 * while points != NULL: * for j in range(3): # <<<<<<<<<<<<<< @@ -9228,7 +9334,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_j = __pyx_t_1; - /* "yt/utilities/lib/geometry_utils.pyx":580 + /* "yt/utilities/lib/geometry_utils.pyx":593 * while points != NULL: * for j in range(3): * line_segments[k, 0, j] = points.points[0][j] # <<<<<<<<<<<<<< @@ -9253,16 +9359,16 @@ } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_line_segments.diminfo[2].shape)) __pyx_t_2 = 2; if (unlikely(__pyx_t_2 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_2); - __PYX_ERR(0, 580, __pyx_L1_error) + __PYX_ERR(0, 593, __pyx_L1_error) } *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_line_segments.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_line_segments.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_line_segments.diminfo[1].strides, __pyx_t_46, __pyx_pybuffernd_line_segments.diminfo[2].strides) = ((__pyx_v_points->points[0])[__pyx_v_j]); - /* "yt/utilities/lib/geometry_utils.pyx":581 + /* "yt/utilities/lib/geometry_utils.pyx":594 * for j in range(3): * line_segments[k, 0, j] = points.points[0][j] * line_segments[k, 1, j] = points.points[1][j] # <<<<<<<<<<<<<< * k += 1 - * if points.count == 3: + * last = points */ __pyx_t_47 = __pyx_v_k; __pyx_t_48 = 1; @@ -9282,137 +9388,40 @@ } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_line_segments.diminfo[2].shape)) __pyx_t_2 = 2; if (unlikely(__pyx_t_2 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_2); - __PYX_ERR(0, 581, __pyx_L1_error) + __PYX_ERR(0, 594, __pyx_L1_error) } *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_line_segments.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_line_segments.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_line_segments.diminfo[1].strides, __pyx_t_49, __pyx_pybuffernd_line_segments.diminfo[2].strides) = ((__pyx_v_points->points[1])[__pyx_v_j]); } - /* "yt/utilities/lib/geometry_utils.pyx":582 + /* "yt/utilities/lib/geometry_utils.pyx":595 * line_segments[k, 0, j] = points.points[0][j] * line_segments[k, 1, j] = points.points[1][j] * k += 1 # <<<<<<<<<<<<<< - * if points.count == 3: - * for j in range(3): - */ - __pyx_v_k = (__pyx_v_k + 1); - - /* "yt/utilities/lib/geometry_utils.pyx":583 - * line_segments[k, 1, j] = points.points[1][j] - * k += 1 - * if points.count == 3: # <<<<<<<<<<<<<< - * for j in range(3): - * line_segments[k, 0, j] = points.points[1][j] - */ - __pyx_t_14 = ((__pyx_v_points->count == 3) != 0); - if (__pyx_t_14) { - - /* "yt/utilities/lib/geometry_utils.pyx":584 - * k += 1 - * if points.count == 3: - * for j in range(3): # <<<<<<<<<<<<<< - * line_segments[k, 0, j] = points.points[1][j] - * line_segments[k, 1, j] = points.points[2][j] - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_j = __pyx_t_1; - - /* "yt/utilities/lib/geometry_utils.pyx":585 - * if points.count == 3: - * for j in range(3): - * line_segments[k, 0, j] = points.points[1][j] # <<<<<<<<<<<<<< - * line_segments[k, 1, j] = points.points[2][j] - * k += 1 - */ - __pyx_t_50 = __pyx_v_k; - __pyx_t_51 = 0; - __pyx_t_52 = __pyx_v_j; - __pyx_t_2 = -1; - if (__pyx_t_50 < 0) { - __pyx_t_50 += __pyx_pybuffernd_line_segments.diminfo[0].shape; - if (unlikely(__pyx_t_50 < 0)) __pyx_t_2 = 0; - } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_line_segments.diminfo[0].shape)) __pyx_t_2 = 0; - if (__pyx_t_51 < 0) { - __pyx_t_51 += __pyx_pybuffernd_line_segments.diminfo[1].shape; - if (unlikely(__pyx_t_51 < 0)) __pyx_t_2 = 1; - } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_line_segments.diminfo[1].shape)) __pyx_t_2 = 1; - if (__pyx_t_52 < 0) { - __pyx_t_52 += __pyx_pybuffernd_line_segments.diminfo[2].shape; - if (unlikely(__pyx_t_52 < 0)) __pyx_t_2 = 2; - } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_line_segments.diminfo[2].shape)) __pyx_t_2 = 2; - if (unlikely(__pyx_t_2 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_2); - __PYX_ERR(0, 585, __pyx_L1_error) - } - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_line_segments.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_line_segments.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_line_segments.diminfo[1].strides, __pyx_t_52, __pyx_pybuffernd_line_segments.diminfo[2].strides) = ((__pyx_v_points->points[1])[__pyx_v_j]); - - /* "yt/utilities/lib/geometry_utils.pyx":586 - * for j in range(3): - * line_segments[k, 0, j] = points.points[1][j] - * line_segments[k, 1, j] = points.points[2][j] # <<<<<<<<<<<<<< - * k += 1 - * last = points - */ - __pyx_t_53 = __pyx_v_k; - __pyx_t_54 = 1; - __pyx_t_55 = __pyx_v_j; - __pyx_t_2 = -1; - if (__pyx_t_53 < 0) { - __pyx_t_53 += __pyx_pybuffernd_line_segments.diminfo[0].shape; - if (unlikely(__pyx_t_53 < 0)) __pyx_t_2 = 0; - } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_line_segments.diminfo[0].shape)) __pyx_t_2 = 0; - if (__pyx_t_54 < 0) { - __pyx_t_54 += __pyx_pybuffernd_line_segments.diminfo[1].shape; - if (unlikely(__pyx_t_54 < 0)) __pyx_t_2 = 1; - } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_line_segments.diminfo[1].shape)) __pyx_t_2 = 1; - if (__pyx_t_55 < 0) { - __pyx_t_55 += __pyx_pybuffernd_line_segments.diminfo[2].shape; - if (unlikely(__pyx_t_55 < 0)) __pyx_t_2 = 2; - } else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_line_segments.diminfo[2].shape)) __pyx_t_2 = 2; - if (unlikely(__pyx_t_2 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_2); - __PYX_ERR(0, 586, __pyx_L1_error) - } - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_line_segments.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_line_segments.diminfo[0].strides, __pyx_t_54, __pyx_pybuffernd_line_segments.diminfo[1].strides, __pyx_t_55, __pyx_pybuffernd_line_segments.diminfo[2].strides) = ((__pyx_v_points->points[2])[__pyx_v_j]); - } - - /* "yt/utilities/lib/geometry_utils.pyx":587 - * line_segments[k, 0, j] = points.points[1][j] - * line_segments[k, 1, j] = points.points[2][j] - * k += 1 # <<<<<<<<<<<<<< * last = points * points = points.next */ - __pyx_v_k = (__pyx_v_k + 1); + __pyx_v_k = (__pyx_v_k + 1); - /* "yt/utilities/lib/geometry_utils.pyx":583 + /* "yt/utilities/lib/geometry_utils.pyx":596 * line_segments[k, 1, j] = points.points[1][j] * k += 1 - * if points.count == 3: # <<<<<<<<<<<<<< - * for j in range(3): - * line_segments[k, 0, j] = points.points[1][j] - */ - } - - /* "yt/utilities/lib/geometry_utils.pyx":588 - * line_segments[k, 1, j] = points.points[2][j] - * k += 1 * last = points # <<<<<<<<<<<<<< * points = points.next * free(last) */ __pyx_v_last = __pyx_v_points; - /* "yt/utilities/lib/geometry_utils.pyx":589 - * k += 1 + /* "yt/utilities/lib/geometry_utils.pyx":597 + * k += 1 * last = points * points = points.next # <<<<<<<<<<<<<< * free(last) * return line_segments */ - __pyx_t_56 = __pyx_v_points->next; - __pyx_v_points = __pyx_t_56; + __pyx_t_50 = __pyx_v_points->next; + __pyx_v_points = __pyx_t_50; - /* "yt/utilities/lib/geometry_utils.pyx":590 + /* "yt/utilities/lib/geometry_utils.pyx":598 * last = points * points = points.next * free(last) # <<<<<<<<<<<<<< @@ -9421,7 +9430,7 @@ free(__pyx_v_last); } - /* "yt/utilities/lib/geometry_utils.pyx":591 + /* "yt/utilities/lib/geometry_utils.pyx":599 * points = points.next * free(last) * return line_segments # <<<<<<<<<<<<<< @@ -9431,7 +9440,7 @@ __pyx_r = ((PyObject *)__pyx_v_line_segments); goto __pyx_L0; - /* "yt/utilities/lib/geometry_utils.pyx":503 + /* "yt/utilities/lib/geometry_utils.pyx":500 * * @cython.cdivision(True) * def triangle_plane_intersect(int ax, np.float64_t coord, # <<<<<<<<<<<<<< @@ -9441,7 +9450,7 @@ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_36); + __Pyx_XDECREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_37); __Pyx_XDECREF(__pyx_t_38); __Pyx_XDECREF(__pyx_t_39); @@ -9465,3445 +9474,3445 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "yt/utilities/lib/fp_utils.pxd":20 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * if info == NULL: return # <<<<<<<<<<<<<< * + * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; + __pyx_r = 0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_v_endian_detector = 1; - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + * ndim = PyArray_NDIM(self) */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":24 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * - * cdef inline int imin(int i0, int i1) nogil: + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_v_copy_shape = 1; - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; } - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * 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(1, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 218, __pyx_L1_error) -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * 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_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + * 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") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * info.buf = PyArray_DATA(self) */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 222, __pyx_L1_error) - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * 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") */ + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":40 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_v_info->ndim = __pyx_v_ndim; - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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]); - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; + goto __pyx_L11; } - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fclip(np.float64_t f, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + /*else*/ { + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; - - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + * cdef int t */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ + __pyx_v_f = NULL; -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":54 - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + __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; - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + goto __pyx_L14; } - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * + * if not hasfields: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L14:; - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; - - /* "yt/utilities/lib/vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); - goto __pyx_L0; + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* "yt/utilities/lib/vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double *__pyx_v_a, double *__pyx_v_b) { - double __pyx_r; - - /* "yt/utilities/lib/vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); - goto __pyx_L0; + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* "yt/utilities/lib/vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 259, __pyx_L1_error) -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - - /* "yt/utilities/lib/vec3_ops.pxd":20 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); + } - /* "yt/utilities/lib/vec3_ops.pxd":21 - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< - * c[2] = a[0]*b[1] - a[1]*b[0] - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "yt/utilities/lib/vec3_ops.pxd":22 - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "yt/utilities/lib/vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - */ - - /* function exit code */ -} - -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "yt/utilities/lib/vec3_ops.pxd":20 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "yt/utilities/lib/vec3_ops.pxd":21 - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< - * c[2] = a[0]*b[1] - a[1]*b[0] - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "yt/utilities/lib/vec3_ops.pxd":22 - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ - (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "yt/utilities/lib/vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* function exit code */ -} - -/* "yt/utilities/lib/vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - - /* "yt/utilities/lib/vec3_ops.pxd":31 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "yt/utilities/lib/vec3_ops.pxd":32 - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< - * c[2] = a[2] - b[2] - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "yt/utilities/lib/vec3_ops.pxd":33 - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ - (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* "yt/utilities/lib/vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* function exit code */ -} - -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "yt/utilities/lib/vec3_ops.pxd":31 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ - (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; - /* "yt/utilities/lib/vec3_ops.pxd":32 - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< - * c[2] = a[2] - b[2] - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "yt/utilities/lib/vec3_ops.pxd":33 - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "yt/utilities/lib/vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* function exit code */ -} - -/* "yt/utilities/lib/vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; - - /* "yt/utilities/lib/vec3_ops.pxd":41 - * cdef inline cython.floating distance(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_r = sqrt(((powf(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + powf(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + powf(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); - goto __pyx_L0; - - /* "yt/utilities/lib/vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 278, __pyx_L1_error) + break; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(double *__pyx_v_a, double *__pyx_v_b) { - double __pyx_r; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; - /* "yt/utilities/lib/vec3_ops.pxd":41 - * cdef inline cython.floating distance(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_r = sqrt(((pow(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + pow(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + pow(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); - goto __pyx_L0; + } - /* "yt/utilities/lib/vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, */ + (__pyx_v_info->format[0]) = '^'; -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(float const __pyx_v_f, float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - - /* "yt/utilities/lib/vec3_ops.pxd":51 - * const cython.floating[3] b, - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ - (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); + __pyx_v_offset = 0; - /* "yt/utilities/lib/vec3_ops.pxd":52 - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< - * c[2] = f * a[2] + b[2] - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) */ - (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "yt/utilities/lib/vec3_ops.pxd":53 - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< * + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); + (__pyx_v_f[0]) = '\x00'; + } - /* "yt/utilities/lib/vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const __pyx_v_f, double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "yt/utilities/lib/vec3_ops.pxd":51 - * const cython.floating[3] b, - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] - */ - (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); - - /* "yt/utilities/lib/vec3_ops.pxd":52 - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< - * c[2] = f * a[2] + b[2] - * - */ - (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); - - /* "yt/utilities/lib/vec3_ops.pxd":53 - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< - * +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); - /* "yt/utilities/lib/vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, - */ +/* 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(); } -/* "yt/utilities/lib/vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) - */ - -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(float *__pyx_v_a) { - float __pyx_r; +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); - /* "yt/utilities/lib/vec3_ops.pxd":60 - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_r = sqrt(((((__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; + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) */ + free(__pyx_v_info->format); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + } -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *__pyx_v_a) { - double __pyx_r; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/vec3_ops.pxd":60 - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * */ - __pyx_r = sqrt(((((__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; + free(__pyx_v_info->strides); - /* "yt/utilities/lib/vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ /* function exit code */ - __pyx_L0:; - return __pyx_r; + __Pyx_RefNannyFinishContext(); } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ -/* 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; +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; __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)); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * 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, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * 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; } -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) * - * if info == NULL: return # <<<<<<<<<<<<<< + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) * - * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< * + * cdef inline object PyArray_MultiIterNew3(a, b, c): */ - __pyx_v_endian_detector = 1; + __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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) * - * ndim = PyArray_NDIM(self) */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + * 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_v_copy_shape = 1; + __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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: */ - goto __pyx_L4; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 * - * 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") + * 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_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + __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, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") */ - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 * - * 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") + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 * - * 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") + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ - if (__pyx_t_1) { + __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields * - * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * 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") + * 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, 794, __pyx_L1_error) } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + * if (end - f) - (new_offset - offset[0]) < 15: */ - __pyx_v_info->ndim = __pyx_v_ndim; + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 799, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * 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: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + __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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply */ - goto __pyx_L11; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 803, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 */ - __pyx_v_info->suboffsets = NULL; + (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 * */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< * - * cdef int t + * offset[0] += child.itemsize */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): */ - __pyx_v_f = NULL; + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 * - * if not hasfields and not copy_shape: + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + * # Until ticket #99 is fixed, use integers to avoid warnings */ - goto __pyx_L14; - } + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 823, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * if not hasfields: */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * # 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_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" */ - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_v_info->format = __pyx_v_f; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: - * info.format = stdlib.malloc(_buffer_format_string_len) */ - __pyx_r = 0; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - } + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); + /*else*/ { + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 844, __pyx_L1_error) + } + __pyx_L15:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), */ - (__pyx_v_info->format[0]) = '^'; + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __pyx_v_offset = 0; + goto __pyx_L13; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * def __releasebuffer__(ndarray self, Py_buffer* info): + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - (__pyx_v_f[0]) = '\x00'; } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ -/* 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) { +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; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! */ - free(__pyx_v_info->format); + __pyx_v_baseptr = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ + goto __pyx_L3; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + /*else*/ { + Py_INCREF(__pyx_v_base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr * */ - free(__pyx_v_info->strides); + Py_XDECREF(__pyx_v_arr->base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): */ - } + __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< * - * 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, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { - PyObject *__pyx_r = NULL; +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * cdef inline int import_ufunc() except -1: */ - __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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -static CYTHON_INLINE 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; +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __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, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { - PyArray_Descr *__pyx_v_child = 0; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - PyObject *__pyx_v_fields = 0; - PyObject *__pyx_v_childname = NULL; - PyObject *__pyx_v_new_offset = NULL; - PyObject *__pyx_v_t = NULL; - char *__pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - long __pyx_t_8; - char *__pyx_t_9; - __Pyx_RefNannySetupContext("_util_dtypestring", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * +/* "yt/utilities/lib/vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) { + float __pyx_r; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "yt/utilities/lib/vec3_ops.pxd":11 + * cdef inline cython.floating dot(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< * - * 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, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; + __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: + /* "yt/utilities/lib/vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double *__pyx_v_a, double *__pyx_v_b) { + double __pyx_r; + + /* "yt/utilities/lib/vec3_ops.pxd":11 + * cdef inline cython.floating dot(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< * - * 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, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { + __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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 + /* "yt/utilities/lib/vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/vec3_ops.pxd":17 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") +static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { + + /* "yt/utilities/lib/vec3_ops.pxd":20 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] */ - __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:; + (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "yt/utilities/lib/vec3_ops.pxd":21 + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< + * c[2] = a[0]*b[1] - a[1]*b[0] * - * 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:; + (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + /* "yt/utilities/lib/vec3_ops.pxd":22 + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< + * * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") */ - if (__pyx_t_6) { + (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply + /* "yt/utilities/lib/vec3_ops.pxd":17 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + /* function exit code */ +} + +static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { + + /* "yt/utilities/lib/vec3_ops.pxd":20 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] + */ + (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); + + /* "yt/utilities/lib/vec3_ops.pxd":21 + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< + * c[2] = a[0]*b[1] - a[1]*b[0] * - * 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_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "yt/utilities/lib/vec3_ops.pxd":22 + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< + * * - * # 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, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; + (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 + /* "yt/utilities/lib/vec3_ops.pxd":17 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ - (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f = (__pyx_v_f + 1); + /* function exit code */ +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize +/* "yt/utilities/lib/vec3_ops.pxd":28 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): +static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { + + /* "yt/utilities/lib/vec3_ops.pxd":31 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* "yt/utilities/lib/vec3_ops.pxd":32 + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< + * c[2] = a[2] - b[2] * - * 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) { + (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "yt/utilities/lib/vec3_ops.pxd":33 + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< + * * - * 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, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; + (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * + /* "yt/utilities/lib/vec3_ops.pxd":28 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings + /* function exit code */ +} + +static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { + + /* "yt/utilities/lib/vec3_ops.pxd":31 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* "yt/utilities/lib/vec3_ops.pxd":32 + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< + * c[2] = a[2] - b[2] * */ - } + (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "yt/utilities/lib/vec3_ops.pxd":33 + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< + * * - * # 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, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } + (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" + /* "yt/utilities/lib/vec3_ops.pxd":28 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" + /* function exit code */ +} + +/* "yt/utilities/lib/vec3_ops.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(float *__pyx_v_a, float *__pyx_v_b) { + float __pyx_r; + + /* "yt/utilities/lib/vec3_ops.pxd":41 + * cdef inline cython.floating distance(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< + * + * */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } + __pyx_r = sqrt(((powf(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + powf(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + powf(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" + /* "yt/utilities/lib/vec3_ops.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(double *__pyx_v_a, double *__pyx_v_b) { + double __pyx_r; + + /* "yt/utilities/lib/vec3_ops.pxd":41 + * cdef inline cython.floating distance(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< + * + * */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } + __pyx_r = sqrt(((pow(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + pow(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + pow(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" + /* "yt/utilities/lib/vec3_ops.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/vec3_ops.pxd":47 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< + * const cython.floating[3] a, + * const cython.floating[3] b, */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" +static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(float const __pyx_v_f, float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { + + /* "yt/utilities/lib/vec3_ops.pxd":51 + * const cython.floating[3] b, + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } + (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" + /* "yt/utilities/lib/vec3_ops.pxd":52 + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< + * c[2] = f * a[2] + b[2] + * */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } + (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + /* "yt/utilities/lib/vec3_ops.pxd":53 + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< + * + * */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } + (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + /* "yt/utilities/lib/vec3_ops.pxd":47 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< + * const cython.floating[3] a, + * const cython.floating[3] b, */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + /* function exit code */ +} + +static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const __pyx_v_f, double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { + + /* "yt/utilities/lib/vec3_ops.pxd":51 + * const cython.floating[3] b, + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } + (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + /* "yt/utilities/lib/vec3_ops.pxd":52 + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< + * c[2] = f * a[2] + b[2] + * */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" + /* "yt/utilities/lib/vec3_ops.pxd":53 + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); + + /* "yt/utilities/lib/vec3_ops.pxd":47 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< + * const cython.floating[3] a, + * const cython.floating[3] b, */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: + /* function exit code */ +} + +/* "yt/utilities/lib/vec3_ops.pxd":59 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(float *__pyx_v_a) { + float __pyx_r; + + /* "yt/utilities/lib/vec3_ops.pxd":60 + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } + __pyx_r = sqrt(((((__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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: + /* "yt/utilities/lib/vec3_ops.pxd":59 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *__pyx_v_a) { + double __pyx_r; + + /* "yt/utilities/lib/vec3_ops.pxd":60 + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_r = sqrt(((((__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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + /* "yt/utilities/lib/vec3_ops.pxd":59 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) */ - goto __pyx_L13; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields */ + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_r = __pyx_v_f; + __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * 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. + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! + /* "yt/utilities/lib/fp_utils.pxd":24 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 + * */ - __pyx_v_baseptr = NULL; + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - goto __pyx_L3; - } + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - /*else*/ { - Py_INCREF(__pyx_v_base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * 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:; + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - Py_XDECREF(__pyx_v_arr->base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * cdef inline object get_array_base(ndarray arr): */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* function exit code */ - __Pyx_RefNannyFinishContext(); + __pyx_L0:; + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 * - * 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); + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":36 * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 * */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + if (__pyx_t_1) { + __pyx_r = (-__pyx_v_f0); goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + */ + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/utilities/lib/fp_utils.pxd":40 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - { - __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:*/ { + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * + */ + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int import_umath() except -1: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fclip(np.float64_t f, + */ + __pyx_r = __pyx_v_i; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ -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); +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_ufunc() except -1: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":58 * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* 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; } @@ -12938,11 +12947,11 @@ {&__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_It_should_be_geometrically_impos, __pyx_k_It_should_be_geometrically_impos, sizeof(__pyx_k_It_should_be_geometrically_impos), 0, 0, 1, 0}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 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_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_YTDomainOverflow, __pyx_k_YTDomainOverflow, sizeof(__pyx_k_YTDomainOverflow), 0, 0, 1, 1}, {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, @@ -12951,6 +12960,7 @@ {&__pyx_n_s_bv, __pyx_k_bv, sizeof(__pyx_k_bv), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 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_compute_morton, __pyx_k_compute_morton, sizeof(__pyx_k_compute_morton), 0, 0, 1, 1}, {&__pyx_n_s_coord, __pyx_k_coord, sizeof(__pyx_k_coord), 0, 0, 1, 1}, {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, @@ -13020,7 +13030,7 @@ {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, {&__pyx_n_s_p0, __pyx_k_p0, sizeof(__pyx_k_p0), 0, 0, 1, 1}, {&__pyx_n_s_p1, __pyx_k_p1, sizeof(__pyx_k_p1), 0, 0, 1, 1}, - {&__pyx_n_s_p3, __pyx_k_p3, sizeof(__pyx_k_p3), 0, 0, 1, 1}, + {&__pyx_n_s_p2, __pyx_k_p2, sizeof(__pyx_k_p2), 0, 0, 1, 1}, {&__pyx_n_s_plane_norm, __pyx_k_plane_norm, sizeof(__pyx_k_plane_norm), 0, 0, 1, 1}, {&__pyx_n_s_point, __pyx_k_point, sizeof(__pyx_k_point), 0, 0, 1, 1}, {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 0, 0, 1, 1}, @@ -13059,7 +13069,8 @@ {&__pyx_n_s_yf, __pyx_k_yf, sizeof(__pyx_k_yf), 0, 0, 1, 1}, {&__pyx_n_s_yg, __pyx_k_yg, sizeof(__pyx_k_yg), 0, 0, 1, 1}, {&__pyx_n_s_yt_utilities_exceptions, __pyx_k_yt_utilities_exceptions, sizeof(__pyx_k_yt_utilities_exceptions), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_geometry_utils, __pyx_k_yt_utilities_lib_geometry_utils, sizeof(__pyx_k_yt_utilities_lib_geometry_utils), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_geometry_utils, __pyx_k_yt_utilities_lib_geometry_utils, sizeof(__pyx_k_yt_utilities_lib_geometry_utils), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_geometry_utils_2, __pyx_k_yt_utilities_lib_geometry_utils_2, sizeof(__pyx_k_yt_utilities_lib_geometry_utils_2), 0, 0, 1, 1}, {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, {&__pyx_n_s_zf, __pyx_k_zf, sizeof(__pyx_k_zf), 0, 0, 1, 1}, @@ -13067,11 +13078,11 @@ {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, 58, __pyx_L1_error) - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 73, __pyx_L1_error) - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 553, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -13082,105 +13093,116 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "yt/utilities/lib/geometry_utils.pyx":91 + /* "yt/utilities/lib/geometry_utils.pyx":92 * cdef np.float64_t c[3] * cdef int i, j, k * center = data.get_field_parameter("center") # <<<<<<<<<<<<<< * c[0] = center[0]; c[1] = center[1]; c[2] = center[2] * if len(data[ftype, 'x'].shape) == 1: */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_center); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_center); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "yt/utilities/lib/geometry_utils.pyx":451 + /* "yt/utilities/lib/geometry_utils.pyx":448 * cdef np.float64_t bv[3] * cdef int i, j, k * bulk_velocity = data.get_field_parameter("bulk_velocity") # <<<<<<<<<<<<<< * if bulk_velocity == None: * bulk_velocity = np.zeros(3) */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_bulk_velocity); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_bulk_velocity); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "yt/utilities/lib/geometry_utils.pyx":453 + /* "yt/utilities/lib/geometry_utils.pyx":450 * bulk_velocity = data.get_field_parameter("bulk_velocity") * if bulk_velocity == None: * bulk_velocity = np.zeros(3) # <<<<<<<<<<<<<< * bv[0] = bulk_velocity[0]; bv[1] = bulk_velocity[1]; bv[2] = bulk_velocity[2] * if len(data[ftype, 'velocity_x'].shape) == 1: */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "yt/utilities/lib/geometry_utils.pyx":457 + /* "yt/utilities/lib/geometry_utils.pyx":454 * if len(data[ftype, 'velocity_x'].shape) == 1: * # One dimensional data * vxf = data[ftype, 'velocity_x'].astype("float64") # <<<<<<<<<<<<<< * vyf = data[ftype, 'velocity_y'].astype("float64") * vzf = data[ftype, 'velocity_z'].astype("float64") */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "yt/utilities/lib/geometry_utils.pyx":458 + /* "yt/utilities/lib/geometry_utils.pyx":455 * # One dimensional data * vxf = data[ftype, 'velocity_x'].astype("float64") * vyf = data[ftype, 'velocity_y'].astype("float64") # <<<<<<<<<<<<<< * vzf = data[ftype, 'velocity_z'].astype("float64") * rvf = np.empty((3, vxf.shape[0]), 'float64') */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "yt/utilities/lib/geometry_utils.pyx":459 + /* "yt/utilities/lib/geometry_utils.pyx":456 * vxf = data[ftype, 'velocity_x'].astype("float64") * vyf = data[ftype, 'velocity_y'].astype("float64") * vzf = data[ftype, 'velocity_z'].astype("float64") # <<<<<<<<<<<<<< * rvf = np.empty((3, vxf.shape[0]), 'float64') * for i in range(vxf.shape[0]): */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "yt/utilities/lib/geometry_utils.pyx":468 + /* "yt/utilities/lib/geometry_utils.pyx":465 * else: * # Three dimensional data * vxg = data[ftype, 'velocity_x'].astype("float64") # <<<<<<<<<<<<<< * vyg = data[ftype, 'velocity_y'].astype("float64") * vzg = data[ftype, 'velocity_z'].astype("float64") */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "yt/utilities/lib/geometry_utils.pyx":469 + /* "yt/utilities/lib/geometry_utils.pyx":466 * # Three dimensional data * vxg = data[ftype, 'velocity_x'].astype("float64") * vyg = data[ftype, 'velocity_y'].astype("float64") # <<<<<<<<<<<<<< * vzg = data[ftype, 'velocity_z'].astype("float64") * rvg = np.empty((3, vxg.shape[0], vxg.shape[1], vxg.shape[2]), 'float64') */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "yt/utilities/lib/geometry_utils.pyx":470 + /* "yt/utilities/lib/geometry_utils.pyx":467 * vxg = data[ftype, 'velocity_x'].astype("float64") * vyg = data[ftype, 'velocity_y'].astype("float64") * vzg = data[ftype, 'velocity_z'].astype("float64") # <<<<<<<<<<<<<< * rvg = np.empty((3, vxg.shape[0], vxg.shape[1], vxg.shape[2]), 'float64') * for i in range(vxg.shape[0]): */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); + /* "yt/utilities/lib/geometry_utils.pyx":553 + * nlines += 1 + * elif count == 3: + * raise RuntimeError("It should be geometrically impossible for a plane to" # <<<<<<<<<<<<<< + * "to intersect all three legs of a triangle. Please contact" + * "yt developers with your mesh") + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_It_should_be_geometrically_impos); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): @@ -13188,9 +13210,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -13199,9 +13221,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -13210,9 +13232,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -13221,9 +13243,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -13232,9 +13254,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -13243,9 +13265,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -13254,9 +13276,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -13265,126 +13287,126 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); - /* "yt/utilities/lib/geometry_utils.pyx":43 + /* "yt/utilities/lib/geometry_utils.pyx":44 * @cython.boundscheck(False) * @cython.wraparound(False) * def find_values_at_point(np.ndarray[np.float64_t, ndim=1] point, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] left_edges, * np.ndarray[np.float64_t, ndim=2] right_edges, */ - __pyx_tuple__19 = PyTuple_Pack(14, __pyx_n_s_point, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_dimensions, __pyx_n_s_field_names, __pyx_n_s_grid_objects, __pyx_n_s_ind, __pyx_n_s_gi, __pyx_n_s_fi, __pyx_n_s_nf, __pyx_n_s_dds, __pyx_n_s_field, __pyx_n_s_rv, __pyx_n_s_grid); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(6, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_find_values_at_point, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_tuple__20 = PyTuple_Pack(14, __pyx_n_s_point, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_dimensions, __pyx_n_s_field_names, __pyx_n_s_grid_objects, __pyx_n_s_ind, __pyx_n_s_gi, __pyx_n_s_fi, __pyx_n_s_nf, __pyx_n_s_dds, __pyx_n_s_field, __pyx_n_s_rv, __pyx_n_s_grid); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(6, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_geometry_utils, __pyx_n_s_find_values_at_point, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 44, __pyx_L1_error) - /* "yt/utilities/lib/geometry_utils.pyx":78 + /* "yt/utilities/lib/geometry_utils.pyx":79 * @cython.boundscheck(False) * @cython.wraparound(False) * def obtain_rvec(data, ftype="gas"): # <<<<<<<<<<<<<< * # This is just to let the pointers exist and whatnot. We can't cdef them * # inside conditionals. */ - __pyx_tuple__21 = PyTuple_Pack(15, __pyx_n_s_data, __pyx_n_s_ftype, __pyx_n_s_xf, __pyx_n_s_yf, __pyx_n_s_zf, __pyx_n_s_rf, __pyx_n_s_xg, __pyx_n_s_yg, __pyx_n_s_zg, __pyx_n_s_rg, __pyx_n_s_c, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_center); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_obtain_rvec, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(15, __pyx_n_s_data, __pyx_n_s_ftype, __pyx_n_s_xf, __pyx_n_s_yf, __pyx_n_s_zf, __pyx_n_s_rf, __pyx_n_s_xg, __pyx_n_s_yg, __pyx_n_s_zg, __pyx_n_s_rg, __pyx_n_s_c, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_center); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_geometry_utils, __pyx_n_s_obtain_rvec, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 79, __pyx_L1_error) - /* "yt/utilities/lib/geometry_utils.pyx":270 + /* "yt/utilities/lib/geometry_utils.pyx":271 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_hilbert_indices(int order, np.ndarray[np.int64_t, ndim=2] left_index): # <<<<<<<<<<<<<< * # This is inspired by the scurve package by user cortesi on GH. * cdef int i */ - __pyx_tuple__23 = PyTuple_Pack(5, __pyx_n_s_order, __pyx_n_s_left_index, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_hilbert_indices); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_get_hilbert_indices, 270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(5, __pyx_n_s_order, __pyx_n_s_left_index, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_hilbert_indices); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_geometry_utils, __pyx_n_s_get_hilbert_indices, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 271, __pyx_L1_error) - /* "yt/utilities/lib/geometry_utils.pyx":286 + /* "yt/utilities/lib/geometry_utils.pyx":287 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_hilbert_points(int order, np.ndarray[np.int64_t, ndim=1] indices): # <<<<<<<<<<<<<< * # This is inspired by the scurve package by user cortesi on GH. * cdef int i, j */ - __pyx_tuple__25 = PyTuple_Pack(6, __pyx_n_s_order, __pyx_n_s_indices, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_p, __pyx_n_s_positions); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_get_hilbert_points, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(6, __pyx_n_s_order, __pyx_n_s_indices, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_p, __pyx_n_s_positions); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_geometry_utils, __pyx_n_s_get_hilbert_points, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 287, __pyx_L1_error) - /* "yt/utilities/lib/geometry_utils.pyx":322 + /* "yt/utilities/lib/geometry_utils.pyx":323 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_morton_indices(np.ndarray[np.uint64_t, ndim=2] left_index): # <<<<<<<<<<<<<< * cdef np.int64_t i, mi * cdef np.ndarray[np.uint64_t, ndim=1] morton_indices */ - __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_left_index, __pyx_n_s_i, __pyx_n_s_mi, __pyx_n_s_morton_indices); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_get_morton_indices, 322, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_Pack(4, __pyx_n_s_left_index, __pyx_n_s_i, __pyx_n_s_mi, __pyx_n_s_morton_indices); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_geometry_utils, __pyx_n_s_get_morton_indices, 323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 323, __pyx_L1_error) - /* "yt/utilities/lib/geometry_utils.pyx":337 + /* "yt/utilities/lib/geometry_utils.pyx":338 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_morton_indices_unravel(np.ndarray[np.uint64_t, ndim=1] left_x, # <<<<<<<<<<<<<< * np.ndarray[np.uint64_t, ndim=1] left_y, * np.ndarray[np.uint64_t, ndim=1] left_z,): */ - __pyx_tuple__29 = PyTuple_Pack(6, __pyx_n_s_left_x, __pyx_n_s_left_y, __pyx_n_s_left_z, __pyx_n_s_i, __pyx_n_s_mi, __pyx_n_s_morton_indices); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_get_morton_indices_unravel, 337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_tuple__30 = PyTuple_Pack(6, __pyx_n_s_left_x, __pyx_n_s_left_y, __pyx_n_s_left_z, __pyx_n_s_i, __pyx_n_s_mi, __pyx_n_s_morton_indices); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_geometry_utils, __pyx_n_s_get_morton_indices_unravel, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 338, __pyx_L1_error) - /* "yt/utilities/lib/geometry_utils.pyx":399 + /* "yt/utilities/lib/geometry_utils.pyx":396 * DEF ORDER_MAX=20 * * def compute_morton(np.ndarray pos_x, np.ndarray pos_y, np.ndarray pos_z, # <<<<<<<<<<<<<< * domain_left_edge, domain_right_edge, filter_bbox = False): * cdef int i */ - __pyx_tuple__31 = PyTuple_Pack(15, __pyx_n_s_pos_x, __pyx_n_s_pos_y, __pyx_n_s_pos_z, __pyx_n_s_domain_left_edge, __pyx_n_s_domain_right_edge, __pyx_n_s_filter_bbox, __pyx_n_s_i, __pyx_n_s_filter, __pyx_n_s_dds, __pyx_n_s_DLE, __pyx_n_s_DRE, __pyx_n_s_ind, __pyx_n_s_rv, __pyx_n_s_mis, __pyx_n_s_mas); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(6, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_compute_morton, 399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_tuple__32 = PyTuple_Pack(15, __pyx_n_s_pos_x, __pyx_n_s_pos_y, __pyx_n_s_pos_z, __pyx_n_s_domain_left_edge, __pyx_n_s_domain_right_edge, __pyx_n_s_filter_bbox, __pyx_n_s_i, __pyx_n_s_filter, __pyx_n_s_dds, __pyx_n_s_DLE, __pyx_n_s_DRE, __pyx_n_s_ind, __pyx_n_s_rv, __pyx_n_s_mis, __pyx_n_s_mas); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(6, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_geometry_utils, __pyx_n_s_compute_morton, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 396, __pyx_L1_error) - /* "yt/utilities/lib/geometry_utils.pyx":438 + /* "yt/utilities/lib/geometry_utils.pyx":435 * @cython.wraparound(False) * @cython.cdivision(True) * def obtain_rv_vec(data, ftype="gas"): # <<<<<<<<<<<<<< * # This is just to let the pointers exist and whatnot. We can't cdef them * # inside conditionals. */ - __pyx_tuple__33 = PyTuple_Pack(15, __pyx_n_s_data, __pyx_n_s_ftype, __pyx_n_s_vxf, __pyx_n_s_vyf, __pyx_n_s_vzf, __pyx_n_s_rvf, __pyx_n_s_vxg, __pyx_n_s_vyg, __pyx_n_s_vzg, __pyx_n_s_rvg, __pyx_n_s_bv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_bulk_velocity); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_obtain_rv_vec, 438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(15, __pyx_n_s_data, __pyx_n_s_ftype, __pyx_n_s_vxf, __pyx_n_s_vyf, __pyx_n_s_vzf, __pyx_n_s_rvf, __pyx_n_s_vxg, __pyx_n_s_vyg, __pyx_n_s_vzg, __pyx_n_s_rvg, __pyx_n_s_bv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_bulk_velocity); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_geometry_utils, __pyx_n_s_obtain_rv_vec, 435, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 435, __pyx_L1_error) - /* "yt/utilities/lib/geometry_utils.pyx":503 + /* "yt/utilities/lib/geometry_utils.pyx":500 * * @cython.cdivision(True) * def triangle_plane_intersect(int ax, np.float64_t coord, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=3] triangles): * cdef np.float64_t p0[3] */ - __pyx_tuple__35 = PyTuple_Pack(21, __pyx_n_s_ax, __pyx_n_s_coord, __pyx_n_s_triangles, __pyx_n_s_p0, __pyx_n_s_p1, __pyx_n_s_p3, __pyx_n_s_E0, __pyx_n_s_E1, __pyx_n_s_tri_norm, __pyx_n_s_plane_norm, __pyx_n_s_dp, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_count, __pyx_n_s_ntri, __pyx_n_s_nlines, __pyx_n_s_first, __pyx_n_s_last, __pyx_n_s_points, __pyx_n_s_line_segments); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); - __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_triangle_plane_intersect, 503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_tuple__36 = PyTuple_Pack(21, __pyx_n_s_ax, __pyx_n_s_coord, __pyx_n_s_triangles, __pyx_n_s_p0, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_E0, __pyx_n_s_E1, __pyx_n_s_tri_norm, __pyx_n_s_plane_norm, __pyx_n_s_dp, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_count, __pyx_n_s_ntri, __pyx_n_s_nlines, __pyx_n_s_first, __pyx_n_s_last, __pyx_n_s_points, __pyx_n_s_line_segments); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_geometry_utils, __pyx_n_s_triangle_plane_intersect, 500, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -13458,6 +13480,7 @@ __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 @@ -13518,76 +13541,76 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":22 + /* "yt/utilities/lib/geometry_utils.pyx":23 * from yt.utilities.lib.fp_utils cimport fclip, i64clip * from libc.math cimport copysign, fabs * from yt.utilities.exceptions import YTDomainOverflow # <<<<<<<<<<<<<< * from yt.utilities.lib.vec3_ops cimport subtract, cross, dot, L2_norm * */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_YTDomainOverflow); __Pyx_GIVEREF(__pyx_n_s_YTDomainOverflow); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_YTDomainOverflow); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_yt_utilities_exceptions, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_n_s_yt_utilities_exceptions, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __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_YTDomainOverflow); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_YTDomainOverflow); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_YTDomainOverflow, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_YTDomainOverflow, __pyx_t_1) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":43 + /* "yt/utilities/lib/geometry_utils.pyx":44 * @cython.boundscheck(False) * @cython.wraparound(False) * def find_values_at_point(np.ndarray[np.float64_t, ndim=1] point, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] left_edges, * np.ndarray[np.float64_t, ndim=2] right_edges, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_1find_values_at_point, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_1find_values_at_point, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_values_at_point, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_values_at_point, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":78 + /* "yt/utilities/lib/geometry_utils.pyx":79 * @cython.boundscheck(False) * @cython.wraparound(False) * def obtain_rvec(data, ftype="gas"): # <<<<<<<<<<<<<< * # This is just to let the pointers exist and whatnot. We can't cdef them * # inside conditionals. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_3obtain_rvec, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_3obtain_rvec, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_obtain_rvec, __pyx_t_2) < 0) __PYX_ERR(0, 78, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_obtain_rvec, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":270 + /* "yt/utilities/lib/geometry_utils.pyx":271 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_hilbert_indices(int order, np.ndarray[np.int64_t, ndim=2] left_index): # <<<<<<<<<<<<<< * # This is inspired by the scurve package by user cortesi on GH. * cdef int i */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_5get_hilbert_indices, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_5get_hilbert_indices, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hilbert_indices, __pyx_t_2) < 0) __PYX_ERR(0, 270, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hilbert_indices, __pyx_t_2) < 0) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":286 + /* "yt/utilities/lib/geometry_utils.pyx":287 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_hilbert_points(int order, np.ndarray[np.int64_t, ndim=1] indices): # <<<<<<<<<<<<<< * # This is inspired by the scurve package by user cortesi on GH. * cdef int i, j */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_7get_hilbert_points, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_7get_hilbert_points, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hilbert_points, __pyx_t_2) < 0) __PYX_ERR(0, 286, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hilbert_points, __pyx_t_2) < 0) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":299 + /* "yt/utilities/lib/geometry_utils.pyx":300 * * # yt did not invent these! :) * cdef np.uint64_t _const20 = 0x000001FFC00003FF # <<<<<<<<<<<<<< @@ -13596,7 +13619,7 @@ */ __pyx_v_2yt_9utilities_3lib_14geometry_utils__const20 = 0x000001FFC00003FF; - /* "yt/utilities/lib/geometry_utils.pyx":300 + /* "yt/utilities/lib/geometry_utils.pyx":301 * # yt did not invent these! :) * cdef np.uint64_t _const20 = 0x000001FFC00003FF * cdef np.uint64_t _const10 = 0x0007E007C00F801F # <<<<<<<<<<<<<< @@ -13605,7 +13628,7 @@ */ __pyx_v_2yt_9utilities_3lib_14geometry_utils__const10 = 0x0007E007C00F801F; - /* "yt/utilities/lib/geometry_utils.pyx":301 + /* "yt/utilities/lib/geometry_utils.pyx":302 * cdef np.uint64_t _const20 = 0x000001FFC00003FF * cdef np.uint64_t _const10 = 0x0007E007C00F801F * cdef np.uint64_t _const04 = 0x00786070C0E181C3 # <<<<<<<<<<<<<< @@ -13614,7 +13637,7 @@ */ __pyx_v_2yt_9utilities_3lib_14geometry_utils__const04 = 0x00786070C0E181C3; - /* "yt/utilities/lib/geometry_utils.pyx":302 + /* "yt/utilities/lib/geometry_utils.pyx":303 * cdef np.uint64_t _const10 = 0x0007E007C00F801F * cdef np.uint64_t _const04 = 0x00786070C0E181C3 * cdef np.uint64_t _const2a = 0x0199219243248649 # <<<<<<<<<<<<<< @@ -13623,7 +13646,7 @@ */ __pyx_v_2yt_9utilities_3lib_14geometry_utils__const2a = 0x0199219243248649; - /* "yt/utilities/lib/geometry_utils.pyx":303 + /* "yt/utilities/lib/geometry_utils.pyx":304 * cdef np.uint64_t _const04 = 0x00786070C0E181C3 * cdef np.uint64_t _const2a = 0x0199219243248649 * cdef np.uint64_t _const2b = 0x0649249249249249 # <<<<<<<<<<<<<< @@ -13632,7 +13655,7 @@ */ __pyx_v_2yt_9utilities_3lib_14geometry_utils__const2b = 0x0649249249249249; - /* "yt/utilities/lib/geometry_utils.pyx":304 + /* "yt/utilities/lib/geometry_utils.pyx":305 * cdef np.uint64_t _const2a = 0x0199219243248649 * cdef np.uint64_t _const2b = 0x0649249249249249 * cdef np.uint64_t _const2c = 0x1249249249249249 # <<<<<<<<<<<<<< @@ -13641,64 +13664,64 @@ */ __pyx_v_2yt_9utilities_3lib_14geometry_utils__const2c = 0x1249249249249249; - /* "yt/utilities/lib/geometry_utils.pyx":322 + /* "yt/utilities/lib/geometry_utils.pyx":323 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_morton_indices(np.ndarray[np.uint64_t, ndim=2] left_index): # <<<<<<<<<<<<<< * cdef np.int64_t i, mi * cdef np.ndarray[np.uint64_t, ndim=1] morton_indices */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_9get_morton_indices, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_9get_morton_indices, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_morton_indices, __pyx_t_2) < 0) __PYX_ERR(0, 322, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_morton_indices, __pyx_t_2) < 0) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":337 + /* "yt/utilities/lib/geometry_utils.pyx":338 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_morton_indices_unravel(np.ndarray[np.uint64_t, ndim=1] left_x, # <<<<<<<<<<<<<< * np.ndarray[np.uint64_t, ndim=1] left_y, * np.ndarray[np.uint64_t, ndim=1] left_z,): */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_11get_morton_indices_unravel, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_11get_morton_indices_unravel, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_morton_indices_unravel, __pyx_t_2) < 0) __PYX_ERR(0, 337, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_morton_indices_unravel, __pyx_t_2) < 0) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":399 + /* "yt/utilities/lib/geometry_utils.pyx":396 * DEF ORDER_MAX=20 * * def compute_morton(np.ndarray pos_x, np.ndarray pos_y, np.ndarray pos_z, # <<<<<<<<<<<<<< * domain_left_edge, domain_right_edge, filter_bbox = False): * cdef int i */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_13compute_morton, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_13compute_morton, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_compute_morton, __pyx_t_2) < 0) __PYX_ERR(0, 399, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_compute_morton, __pyx_t_2) < 0) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":438 + /* "yt/utilities/lib/geometry_utils.pyx":435 * @cython.wraparound(False) * @cython.cdivision(True) * def obtain_rv_vec(data, ftype="gas"): # <<<<<<<<<<<<<< * # This is just to let the pointers exist and whatnot. We can't cdef them * # inside conditionals. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_15obtain_rv_vec, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_15obtain_rv_vec, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_obtain_rv_vec, __pyx_t_2) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_obtain_rv_vec, __pyx_t_2) < 0) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/geometry_utils.pyx":503 + /* "yt/utilities/lib/geometry_utils.pyx":500 * * @cython.cdivision(True) * def triangle_plane_intersect(int ax, np.float64_t coord, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=3] triangles): * cdef np.float64_t p0[3] */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_17triangle_plane_intersect, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14geometry_utils_17triangle_plane_intersect, NULL, __pyx_n_s_yt_utilities_lib_geometry_utils_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_triangle_plane_intersect, __pyx_t_2) < 0) __PYX_ERR(0, 503, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_triangle_plane_intersect, __pyx_t_2) < 0) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "yt/utilities/lib/geometry_utils.pyx":1 @@ -13711,12 +13734,12 @@ 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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /*--- Wrapped vars code ---*/ @@ -13727,7 +13750,7 @@ __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.geometry_utils", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.geometry_utils", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -14556,9 +14579,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -14571,9 +14597,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -14935,8 +14964,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL @@ -14944,17 +14973,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, @@ -15036,11 +15070,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -15063,7 +15093,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -15084,31 +15114,31 @@ #endif /* BufferIndexError */ - static void __Pyx_RaiseBufferIndexError(int axis) { + static void __Pyx_RaiseBufferIndexError(int axis) { PyErr_Format(PyExc_IndexError, "Out of bounds on buffer access (axis %d)", axis); } /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -15132,7 +15162,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -15142,7 +15172,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -15203,7 +15233,7 @@ } /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -15277,7 +15307,7 @@ } /* ImportFrom */ - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + 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, @@ -15290,8 +15320,42 @@ return value; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -15371,7 +15435,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -15430,12 +15494,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -15472,8 +15539,8 @@ #endif - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + /* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -15495,7 +15562,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -15526,7 +15593,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -15557,7 +15624,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -15588,7 +15655,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + 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) { @@ -15619,7 +15686,7 @@ } /* None */ - static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_pow___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t b, __pyx_t_5numpy_int64_t e) { + static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_pow___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t b, __pyx_t_5numpy_int64_t e) { __pyx_t_5numpy_int64_t t = b; switch (e) { case 3: @@ -15644,7 +15711,7 @@ } /* Print */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); if (!f) { @@ -15750,7 +15817,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -15770,7 +15837,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -15905,7 +15972,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -15925,7 +15992,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -16060,7 +16127,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -16091,7 +16158,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -16280,7 +16347,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -16469,7 +16536,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -16658,7 +16725,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -16674,7 +16741,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -16692,7 +16759,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -16757,7 +16824,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -16782,6 +16849,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -16790,11 +16859,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/geometry_utils.pyx yt-3.4.0/yt/utilities/lib/geometry_utils.pyx --- yt-3.3.3/yt/utilities/lib/geometry_utils.pyx 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/geometry_utils.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -16,6 +16,7 @@ import numpy as np cimport numpy as np cimport cython +from cython cimport floating from libc.stdlib cimport malloc, free from yt.utilities.lib.fp_utils cimport fclip, i64clip from libc.math cimport copysign, fabs @@ -348,16 +349,12 @@ morton_indices[i] = mi return morton_indices -ctypedef fused anyfloat: - np.float32_t - np.float64_t - @cython.cdivision(True) @cython.boundscheck(False) @cython.wraparound(False) -cdef np.int64_t position_to_morton(np.ndarray[anyfloat, ndim=1] pos_x, - np.ndarray[anyfloat, ndim=1] pos_y, - np.ndarray[anyfloat, ndim=1] pos_z, +cdef np.int64_t position_to_morton(np.ndarray[floating, ndim=1] pos_x, + np.ndarray[floating, ndim=1] pos_y, + np.ndarray[floating, ndim=1] pos_z, np.float64_t dds[3], np.float64_t DLE[3], np.float64_t DRE[3], np.ndarray[np.uint64_t, ndim=1] ind, @@ -481,7 +478,7 @@ cdef struct PointSet: int count # First index is point index, second is xyz - np.float64_t points[3][3] + np.float64_t points[2][3] PointSet *next cdef inline void get_intersection(np.float64_t p0[3], np.float64_t p1[3], @@ -504,7 +501,7 @@ np.ndarray[np.float64_t, ndim=3] triangles): cdef np.float64_t p0[3] cdef np.float64_t p1[3] - cdef np.float64_t p3[3] + cdef np.float64_t p2[3] cdef np.float64_t E0[3] cdef np.float64_t E1[3] cdef np.float64_t tri_norm[3] @@ -520,48 +517,63 @@ for i in range(ntri): count = 0 - # skip if triangle is close to being parallel to plane + # Here p0 holds the triangle's zeroth node coordinates, + # p1 holds the first node's coordinates, and + # p2 holds the second node's coordinates for j in range(3): p0[j] = triangles[i, 0, j] p1[j] = triangles[i, 1, j] - p3[j] = triangles[i, 2, j] + p2[j] = triangles[i, 2, j] plane_norm[j] = 0.0 plane_norm[ax] = 1.0 subtract(p1, p0, E0) - subtract(p3, p0, E1) + subtract(p2, p0, E1) cross(E0, E1, tri_norm) dp = dot(tri_norm, plane_norm) dp /= L2_norm(tri_norm) + # Skip if triangle is close to being parallel to plane. if (fabs(dp) > 0.995): continue - + # Now for each line segment (01, 12, 20) we check to see how many cross - # the coordinate. + # the coordinate of the slice. + # Here, the components of p2 are either +1 or -1 depending on whether the + # node's coordinate corresponding to the slice axis is greater than the + # coordinate of the slice. p2[0] -> node 0; p2[1] -> node 1; p2[2] -> node2 for j in range(3): - p3[j] = copysign(1.0, triangles[i, j, ax] - coord) - if p3[0] * p3[1] < 0: count += 1 - if p3[1] * p3[2] < 0: count += 1 - if p3[2] * p3[0] < 0: count += 1 + # Add 0 so that any -0s become +0s. Necessary for consistent determination + # of plane intersection + p2[j] = copysign(1.0, triangles[i, j, ax] - coord + 0) + if p2[0] * p2[1] < 0: count += 1 + if p2[1] * p2[2] < 0: count += 1 + if p2[2] * p2[0] < 0: count += 1 if count == 2: nlines += 1 elif count == 3: - nlines += 2 + raise RuntimeError("It should be geometrically impossible for a plane to" + "to intersect all three legs of a triangle. Please contact" + "yt developers with your mesh") else: continue points = malloc(sizeof(PointSet)) points.count = 0 points.next = NULL - if p3[0] * p3[1] < 0: + + # Here p0 and p1 again hold node coordinates + if p2[0] * p2[1] < 0: + # intersection of 01 triangle segment with plane for j in range(3): p0[j] = triangles[i, 0, j] p1[j] = triangles[i, 1, j] get_intersection(p0, p1, ax, coord, points) - if p3[1] * p3[2] < 0: + if p2[1] * p2[2] < 0: + # intersection of 12 triangle segment with plane for j in range(3): p0[j] = triangles[i, 1, j] p1[j] = triangles[i, 2, j] get_intersection(p0, p1, ax, coord, points) - if p3[2] * p3[0] < 0: + if p2[2] * p2[0] < 0: + # intersection of 20 triangle segment with plane for j in range(3): p0[j] = triangles[i, 2, j] p1[j] = triangles[i, 0, j] @@ -571,6 +583,7 @@ if first == NULL: first = points last = points + points = first cdef np.ndarray[np.float64_t, ndim=3] line_segments line_segments = np.empty((nlines, 2, 3), dtype="float64") @@ -580,11 +593,6 @@ line_segments[k, 0, j] = points.points[0][j] line_segments[k, 1, j] = points.points[1][j] k += 1 - if points.count == 3: - for j in range(3): - line_segments[k, 0, j] = points.points[1][j] - line_segments[k, 1, j] = points.points[2][j] - k += 1 last = points points = points.next free(last) diff -Nru yt-3.3.3/yt/utilities/lib/grid_traversal.c yt-3.4.0/yt/utilities/lib/grid_traversal.c --- yt-3.3.3/yt/utilities/lib/grid_traversal.c 2016-12-12 01:41:47.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/grid_traversal.c 2017-08-10 18:20:39.000000000 +0000 @@ -1,18 +1,22 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "yt/utilities/lib/fixed_interpolator.h", - "yt/utilities/lib/kdtree.h", - "yt/utilities/lib/platform_dep.h" + "yt/utilities/lib/fixed_interpolator.h" ], "include_dirs": [ + "./yt/utilities/lib", "yt/utilities/lib/" ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.grid_traversal", + "sources": [ + "yt/utilities/lib/grid_traversal.pyx", + "yt/utilities/lib/fixed_interpolator.c" ] }, "module_name": "yt.utilities.lib.grid_traversal" @@ -26,7 +30,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -48,6 +52,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -200,16 +205,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -336,6 +345,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -390,6 +405,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -453,10 +497,7 @@ #include #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" -#include "kdtree.h" #include -#include "platform_dep.h" -#include "limits.h" #include "fixed_interpolator.h" #include "pythread.h" #include "pystate.h" @@ -504,8 +545,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -518,8 +559,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -641,10 +685,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1059,53 +1105,28 @@ __pyx_t_5numpy_float64_t idds[3]; int dims[3]; }; -struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer; - -/* "lenses.pxd":32 - * cdef int SHRT_MAX - * - * cdef struct ImageContainer: # <<<<<<<<<<<<<< - * np.float64_t[:,:,:] vp_pos - * np.float64_t[:,:,:] vp_dir - */ -struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer { - __Pyx_memviewslice vp_pos; - __Pyx_memviewslice vp_dir; - __pyx_t_5numpy_float64_t *center; - __Pyx_memviewslice image; - __Pyx_memviewslice zbuffer; - __Pyx_memviewslice image_used; - __Pyx_memviewslice mesh_lines; - __pyx_t_5numpy_float64_t pdx; - __pyx_t_5numpy_float64_t pdy; - __pyx_t_5numpy_float64_t bounds[4]; - __Pyx_memviewslice camera_data; - int nv[2]; - __pyx_t_5numpy_float64_t *x_vec; - __pyx_t_5numpy_float64_t *y_vec; -}; +struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator; -/* "lenses.pxd":48 - * +/* "image_samplers.pxd":30 + * cdef struct VolumeRenderAccumulator * - * ctypedef int calculate_extent_function(ImageContainer *image, # <<<<<<<<<<<<<< + * ctypedef int calculate_extent_function(ImageSampler image, # <<<<<<<<<<<<<< * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 * */ -typedef int __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *); +typedef int __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *); -/* "lenses.pxd":51 +/* "image_samplers.pxd":33 * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 * - * ctypedef void generate_vector_info_function(ImageContainer *im, # <<<<<<<<<<<<<< + * ctypedef void generate_vector_info_function(ImageSampler im, # <<<<<<<<<<<<<< * np.int64_t vi, np.int64_t vj, * np.float64_t width[2], */ -typedef void __pyx_t_2yt_9utilities_3lib_6lenses_generate_vector_info_function(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); -struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator; +typedef void __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); -/* "image_samplers.pxd":35 - * cdef struct VolumeRenderAccumulator +/* "image_samplers.pxd":38 + * np.float64_t v_dir[3], np.float64_t v_pos[3]) nogil * * cdef struct ImageAccumulator: # <<<<<<<<<<<<<< * np.float64_t rgba[Nch] @@ -1182,17 +1203,30 @@ }; -/* "image_samplers.pxd":39 +/* "image_samplers.pxd":42 * void *supp_data * * cdef class ImageSampler: # <<<<<<<<<<<<<< - * cdef ImageContainer *image - * cdef public object acenter, aimage, ax_vec, ay_vec + * cdef np.float64_t[:,:,:] vp_pos + * cdef np.float64_t[:,:,:] vp_dir */ struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler { PyObject_HEAD struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtab; - struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *image; + __Pyx_memviewslice vp_pos; + __Pyx_memviewslice vp_dir; + __pyx_t_5numpy_float64_t *center; + __Pyx_memviewslice image; + __Pyx_memviewslice zbuffer; + __Pyx_memviewslice image_used; + __Pyx_memviewslice mesh_lines; + __pyx_t_5numpy_float64_t pdx; + __pyx_t_5numpy_float64_t pdy; + __pyx_t_5numpy_float64_t bounds[4]; + __Pyx_memviewslice camera_data; + int nv[2]; + __pyx_t_5numpy_float64_t *x_vec; + __pyx_t_5numpy_float64_t *y_vec; PyObject *acenter; PyObject *aimage; PyObject *ax_vec; @@ -1203,12 +1237,12 @@ void *supp_data; __pyx_t_5numpy_float64_t width[3]; PyObject *lens_type; - __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function *extent_function; - __pyx_t_2yt_9utilities_3lib_6lenses_generate_vector_info_function *vector_function; + __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function *extent_function; + __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function *vector_function; }; -/* "image_samplers.pxd":60 +/* "image_samplers.pxd":75 * void *data) nogil * * cdef class ProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1220,7 +1254,7 @@ }; -/* "image_samplers.pxd":63 +/* "image_samplers.pxd":78 * pass * * cdef class InterpolatedProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1235,7 +1269,7 @@ }; -/* "image_samplers.pxd":68 +/* "image_samplers.pxd":83 * cdef public object my_field_tables * * cdef class VolumeRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1247,12 +1281,11 @@ struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *vra; PyObject *tf_obj; PyObject *my_field_tables; - struct kdtree **trees; PyObject *tree_containers; }; -/* "image_samplers.pxd":75 +/* "image_samplers.pxd":89 * cdef object tree_containers * * cdef class LightSourceRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1359,12 +1392,12 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid; -/* "image_samplers.pxd":39 +/* "image_samplers.pxd":42 * void *supp_data * * cdef class ImageSampler: # <<<<<<<<<<<<<< - * cdef ImageContainer *image - * cdef public object acenter, aimage, ax_vec, ay_vec + * cdef np.float64_t[:,:,:] vp_pos + * cdef np.float64_t[:,:,:] vp_dir */ struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler { @@ -1374,7 +1407,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler; -/* "image_samplers.pxd":60 +/* "image_samplers.pxd":75 * void *data) nogil * * cdef class ProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1388,7 +1421,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler; -/* "image_samplers.pxd":63 +/* "image_samplers.pxd":78 * pass * * cdef class InterpolatedProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1402,7 +1435,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler; -/* "image_samplers.pxd":68 +/* "image_samplers.pxd":83 * cdef public object my_field_tables * * cdef class VolumeRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1416,7 +1449,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler; -/* "image_samplers.pxd":75 +/* "image_samplers.pxd":89 * cdef object tree_containers * * cdef class LightSourceRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1610,7 +1643,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* PyFloatBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY @@ -1728,12 +1761,29 @@ /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); +/* 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) @@ -1849,6 +1899,13 @@ #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() + /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); @@ -1865,12 +1922,24 @@ /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1920,9 +1989,6 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - /* MemviewSliceIsContig.proto */ static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim); @@ -2036,6 +2102,9 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); @@ -2146,28 +2215,10 @@ /* Module declarations from 'cython' */ -/* Module declarations from 'yt.utilities.lib.kdtree_utils' */ - /* Module declarations from 'yt.utilities.lib.volume_container' */ static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, int, int, int); /*proto*/ static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *); /*proto*/ -/* Module declarations from 'libc.math' */ - -/* Module declarations from 'yt.utilities.lib.vec3_ops' */ - -/* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int, int); /*proto*/ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ - -/* Module declarations from 'yt.utilities.lib.lenses' */ - /* Module declarations from 'yt.utilities.lib.partitioned_grid' */ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = 0; @@ -2178,6 +2229,18 @@ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = 0; +/* Module declarations from 'libc.math' */ + +/* Module declarations from 'yt.utilities.lib.fp_utils' */ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ + /* Module declarations from 'yt.utilities.lib.field_interpolation_tables' */ static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_initialize_table(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *, int, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int, int, int); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *, __pyx_t_5numpy_float64_t *); /*proto*/ @@ -2186,8 +2249,6 @@ /* Module declarations from 'yt.utilities.lib.fixed_interpolator' */ -/* Module declarations from 'cpython.exc' */ - /* Module declarations from 'yt.utilities.lib.grid_traversal' */ static PyTypeObject *__pyx_array_type = 0; static PyTypeObject *__pyx_MemviewEnum_type = 0; @@ -2232,6 +2293,7 @@ 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_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; #define __Pyx_MODULE_NAME "yt.utilities.lib.grid_traversal" @@ -2245,8 +2307,8 @@ static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; -static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_O[] = "O"; @@ -2266,10 +2328,12 @@ static const char __pyx_k_py[] = "py"; static const char __pyx_k_vp[] = "vp"; static const char __pyx_k_fov[] = "fov"; +static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_phi[] = "phi"; static const char __pyx_k_aphi[] = "aphi"; static const char __pyx_k_base[] = "base"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_ipix[] = "ipix"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; @@ -2306,8 +2370,11 @@ static const char __pyx_k_ipnest[] = "ipnest"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_ntheta[] = "ntheta"; +static const char __pyx_k_pickle[] = "pickle"; +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_aipnest[] = "aipnest"; static const char __pyx_k_float64[] = "float64"; @@ -2317,30 +2384,40 @@ static const char __pyx_k_off_phi[] = "off_phi"; static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_irotation[] = "irotation"; static const char __pyx_k_off_theta[] = "off_theta"; static const char __pyx_k_pix_image[] = "pix_image"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_resolution[] = "resolution"; 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_pyx_checksum[] = "__pyx_checksum"; +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_hp_ang2pix_nest[] = "hp_ang2pix_nest"; static const char __pyx_k_hp_pix2ang_nest[] = "hp_pix2ang_nest"; static const char __pyx_k_hp_pix2vec_nest[] = "hp_pix2vec_nest"; static const char __pyx_k_hp_vec2pix_nest[] = "hp_vec2pix_nest"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_arr_ang2pix_nest[] = "arr_ang2pix_nest"; static const char __pyx_k_arr_pix2ang_nest[] = "arr_pix2ang_nest"; static const char __pyx_k_arr_pix2vec_nest[] = "arr_pix2vec_nest"; static const char __pyx_k_arr_vec2pix_nest[] = "arr_vec2pix_nest"; static const char __pyx_k_pixelize_healpix[] = "pixelize_healpix"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_arr_fisheye_vectors[] = "arr_fisheye_vectors"; @@ -2355,16 +2432,16 @@ 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_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/grid_traversal.pyx"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_Simple_integrators_for_the_radi[] = "\nSimple integrators for the radiative transfer equation\n\n\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_yt_utilities_lib_grid_traversal[] = "yt.utilities.lib.grid_traversal"; +static const char __pyx_k_yt_utilities_lib_grid_traversal[] = "yt/utilities/lib/grid_traversal.pyx"; static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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"; @@ -2372,8 +2449,10 @@ 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_yt_utilities_lib_grid_traversal_2[] = "yt.utilities.lib.grid_traversal"; 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; @@ -2384,6 +2463,7 @@ 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; @@ -2395,11 +2475,12 @@ static PyObject *__pyx_n_s_NotImplementedError; 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_n_s_RuntimeError; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_n_s_aipix; static PyObject *__pyx_n_s_aipnest; static PyObject *__pyx_n_s_allocate_buffer; @@ -2414,8 +2495,10 @@ 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_dtype; static PyObject *__pyx_n_s_dtype_is_object; static PyObject *__pyx_n_s_encode; @@ -2452,10 +2535,12 @@ 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_nimi; static PyObject *__pyx_n_s_nimj; static PyObject *__pyx_n_s_nimx; static PyObject *__pyx_n_s_nimy; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_np; static PyObject *__pyx_n_s_nphi; static PyObject *__pyx_n_s_nside; @@ -2471,15 +2556,23 @@ static PyObject *__pyx_n_s_pack; static PyObject *__pyx_n_s_phi; static PyObject *__pyx_n_s_pi; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_pix_image; static PyObject *__pyx_n_s_pixelize_healpix; static PyObject *__pyx_n_s_px; static PyObject *__pyx_n_s_py; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_reduce_cython; static PyObject *__pyx_n_s_resolution; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_start; @@ -2488,6 +2581,7 @@ 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_theta; @@ -2495,11 +2589,13 @@ 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 PyObject *__pyx_n_s_values; static PyObject *__pyx_n_s_vp; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_y; -static PyObject *__pyx_n_s_yt_utilities_lib_grid_traversal; +static PyObject *__pyx_kp_s_yt_utilities_lib_grid_traversal; +static PyObject *__pyx_n_s_yt_utilities_lib_grid_traversal_2; static PyObject *__pyx_n_s_z; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_2yt_9utilities_3lib_14grid_traversal_hp_pix2vec_nest(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED long __pyx_v_nside, CYTHON_UNUSED long __pyx_v_ipix); /* proto */ @@ -2522,8 +2618,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -2545,8 +2645,13 @@ 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*/ @@ -2555,6 +2660,7 @@ 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; @@ -2565,9 +2671,9 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__19; -static PyObject *__pyx_slice__20; -static PyObject *__pyx_slice__21; +static PyObject *__pyx_slice__23; +static PyObject *__pyx_slice__24; +static PyObject *__pyx_slice__25; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -2577,10 +2683,13 @@ 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__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__31; static PyObject *__pyx_tuple__33; @@ -2590,13 +2699,14 @@ 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_codeobj__24; -static PyObject *__pyx_codeobj__26; -static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; static PyObject *__pyx_codeobj__30; static PyObject *__pyx_codeobj__32; static PyObject *__pyx_codeobj__34; @@ -2605,8 +2715,12 @@ static PyObject *__pyx_codeobj__40; static PyObject *__pyx_codeobj__42; static PyObject *__pyx_codeobj__44; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__50; +static PyObject *__pyx_codeobj__57; -/* "yt/utilities/lib/grid_traversal.pyx":42 +/* "yt/utilities/lib/grid_traversal.pyx":34 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int walk_volume(VolumeContainer *vc, # <<<<<<<<<<<<<< @@ -2616,7 +2730,7 @@ static int __pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_v_dir, __pyx_t_2yt_9utilities_3lib_14grid_traversal_sampler_function *__pyx_v_sample, void *__pyx_v_data, struct __pyx_opt_args_2yt_9utilities_3lib_14grid_traversal_walk_volume *__pyx_optional_args) { - /* "yt/utilities/lib/grid_traversal.pyx":47 + /* "yt/utilities/lib/grid_traversal.pyx":39 * sampler_function *sample, * void *data, * np.float64_t *return_t = NULL, # <<<<<<<<<<<<<< @@ -2655,7 +2769,7 @@ } } - /* "yt/utilities/lib/grid_traversal.pyx":52 + /* "yt/utilities/lib/grid_traversal.pyx":44 * cdef int step[3] * cdef int x, y, i, hit, direction * cdef np.float64_t intersect_t = 1.1 # <<<<<<<<<<<<<< @@ -2664,7 +2778,7 @@ */ __pyx_v_intersect_t = 1.1; - /* "yt/utilities/lib/grid_traversal.pyx":56 + /* "yt/utilities/lib/grid_traversal.pyx":48 * cdef np.float64_t tmax[3] * cdef np.float64_t tdelta[3] * cdef np.float64_t exit_t = -1.0, enter_t = -1.0 # <<<<<<<<<<<<<< @@ -2674,7 +2788,7 @@ __pyx_v_exit_t = -1.0; __pyx_v_enter_t = -1.0; - /* "yt/utilities/lib/grid_traversal.pyx":57 + /* "yt/utilities/lib/grid_traversal.pyx":49 * cdef np.float64_t tdelta[3] * cdef np.float64_t exit_t = -1.0, enter_t = -1.0 * cdef np.float64_t tl, temp_x, temp_y = -1 # <<<<<<<<<<<<<< @@ -2683,7 +2797,7 @@ */ __pyx_v_temp_y = -1.0; - /* "yt/utilities/lib/grid_traversal.pyx":58 + /* "yt/utilities/lib/grid_traversal.pyx":50 * cdef np.float64_t exit_t = -1.0, enter_t = -1.0 * cdef np.float64_t tl, temp_x, temp_y = -1 * if max_t > 1.0: max_t = 1.0 # <<<<<<<<<<<<<< @@ -2695,7 +2809,7 @@ __pyx_v_max_t = 1.0; } - /* "yt/utilities/lib/grid_traversal.pyx":59 + /* "yt/utilities/lib/grid_traversal.pyx":51 * cdef np.float64_t tl, temp_x, temp_y = -1 * if max_t > 1.0: max_t = 1.0 * direction = -1 # <<<<<<<<<<<<<< @@ -2704,7 +2818,7 @@ */ __pyx_v_direction = -1; - /* "yt/utilities/lib/grid_traversal.pyx":60 + /* "yt/utilities/lib/grid_traversal.pyx":52 * if max_t > 1.0: max_t = 1.0 * direction = -1 * if vc.left_edge[0] <= v_pos[0] and v_pos[0] < vc.right_edge[0] and \ # <<<<<<<<<<<<<< @@ -2724,7 +2838,7 @@ goto __pyx_L5_bool_binop_done; } - /* "yt/utilities/lib/grid_traversal.pyx":61 + /* "yt/utilities/lib/grid_traversal.pyx":53 * direction = -1 * if vc.left_edge[0] <= v_pos[0] and v_pos[0] < vc.right_edge[0] and \ * vc.left_edge[1] <= v_pos[1] and v_pos[1] < vc.right_edge[1] and \ # <<<<<<<<<<<<<< @@ -2744,7 +2858,7 @@ goto __pyx_L5_bool_binop_done; } - /* "yt/utilities/lib/grid_traversal.pyx":62 + /* "yt/utilities/lib/grid_traversal.pyx":54 * if vc.left_edge[0] <= v_pos[0] and v_pos[0] < vc.right_edge[0] and \ * vc.left_edge[1] <= v_pos[1] and v_pos[1] < vc.right_edge[1] and \ * vc.left_edge[2] <= v_pos[2] and v_pos[2] < vc.right_edge[2]: # <<<<<<<<<<<<<< @@ -2761,7 +2875,7 @@ __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:; - /* "yt/utilities/lib/grid_traversal.pyx":60 + /* "yt/utilities/lib/grid_traversal.pyx":52 * if max_t > 1.0: max_t = 1.0 * direction = -1 * if vc.left_edge[0] <= v_pos[0] and v_pos[0] < vc.right_edge[0] and \ # <<<<<<<<<<<<<< @@ -2770,7 +2884,7 @@ */ if (__pyx_t_1) { - /* "yt/utilities/lib/grid_traversal.pyx":63 + /* "yt/utilities/lib/grid_traversal.pyx":55 * vc.left_edge[1] <= v_pos[1] and v_pos[1] < vc.right_edge[1] and \ * vc.left_edge[2] <= v_pos[2] and v_pos[2] < vc.right_edge[2]: * intersect_t = 0.0 # <<<<<<<<<<<<<< @@ -2779,7 +2893,7 @@ */ __pyx_v_intersect_t = 0.0; - /* "yt/utilities/lib/grid_traversal.pyx":64 + /* "yt/utilities/lib/grid_traversal.pyx":56 * vc.left_edge[2] <= v_pos[2] and v_pos[2] < vc.right_edge[2]: * intersect_t = 0.0 * direction = 3 # <<<<<<<<<<<<<< @@ -2788,7 +2902,7 @@ */ __pyx_v_direction = 3; - /* "yt/utilities/lib/grid_traversal.pyx":60 + /* "yt/utilities/lib/grid_traversal.pyx":52 * if max_t > 1.0: max_t = 1.0 * direction = -1 * if vc.left_edge[0] <= v_pos[0] and v_pos[0] < vc.right_edge[0] and \ # <<<<<<<<<<<<<< @@ -2797,7 +2911,7 @@ */ } - /* "yt/utilities/lib/grid_traversal.pyx":65 + /* "yt/utilities/lib/grid_traversal.pyx":57 * intersect_t = 0.0 * direction = 3 * for i in range(3): # <<<<<<<<<<<<<< @@ -2807,7 +2921,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/utilities/lib/grid_traversal.pyx":66 + /* "yt/utilities/lib/grid_traversal.pyx":58 * direction = 3 * for i in range(3): * if (v_dir[i] < 0): # <<<<<<<<<<<<<< @@ -2817,7 +2931,7 @@ __pyx_t_1 = (((__pyx_v_v_dir[__pyx_v_i]) < 0.0) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/grid_traversal.pyx":67 + /* "yt/utilities/lib/grid_traversal.pyx":59 * for i in range(3): * if (v_dir[i] < 0): * step[i] = -1 # <<<<<<<<<<<<<< @@ -2826,7 +2940,7 @@ */ (__pyx_v_step[__pyx_v_i]) = -1; - /* "yt/utilities/lib/grid_traversal.pyx":66 + /* "yt/utilities/lib/grid_traversal.pyx":58 * direction = 3 * for i in range(3): * if (v_dir[i] < 0): # <<<<<<<<<<<<<< @@ -2836,7 +2950,7 @@ goto __pyx_L13; } - /* "yt/utilities/lib/grid_traversal.pyx":68 + /* "yt/utilities/lib/grid_traversal.pyx":60 * if (v_dir[i] < 0): * step[i] = -1 * elif (v_dir[i] == 0.0): # <<<<<<<<<<<<<< @@ -2846,7 +2960,7 @@ __pyx_t_1 = (((__pyx_v_v_dir[__pyx_v_i]) == 0.0) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/grid_traversal.pyx":69 + /* "yt/utilities/lib/grid_traversal.pyx":61 * step[i] = -1 * elif (v_dir[i] == 0.0): * step[i] = 0 # <<<<<<<<<<<<<< @@ -2855,7 +2969,7 @@ */ (__pyx_v_step[__pyx_v_i]) = 0; - /* "yt/utilities/lib/grid_traversal.pyx":70 + /* "yt/utilities/lib/grid_traversal.pyx":62 * elif (v_dir[i] == 0.0): * step[i] = 0 * continue # <<<<<<<<<<<<<< @@ -2864,7 +2978,7 @@ */ goto __pyx_L11_continue; - /* "yt/utilities/lib/grid_traversal.pyx":68 + /* "yt/utilities/lib/grid_traversal.pyx":60 * if (v_dir[i] < 0): * step[i] = -1 * elif (v_dir[i] == 0.0): # <<<<<<<<<<<<<< @@ -2873,7 +2987,7 @@ */ } - /* "yt/utilities/lib/grid_traversal.pyx":72 + /* "yt/utilities/lib/grid_traversal.pyx":64 * continue * else: * step[i] = 1 # <<<<<<<<<<<<<< @@ -2885,7 +2999,7 @@ } __pyx_L13:; - /* "yt/utilities/lib/grid_traversal.pyx":73 + /* "yt/utilities/lib/grid_traversal.pyx":65 * else: * step[i] = 1 * iv_dir[i] = 1.0/v_dir[i] # <<<<<<<<<<<<<< @@ -2894,7 +3008,7 @@ */ (__pyx_v_iv_dir[__pyx_v_i]) = (1.0 / (__pyx_v_v_dir[__pyx_v_i])); - /* "yt/utilities/lib/grid_traversal.pyx":74 + /* "yt/utilities/lib/grid_traversal.pyx":66 * step[i] = 1 * iv_dir[i] = 1.0/v_dir[i] * if direction == 3: continue # <<<<<<<<<<<<<< @@ -2906,7 +3020,7 @@ goto __pyx_L11_continue; } - /* "yt/utilities/lib/grid_traversal.pyx":75 + /* "yt/utilities/lib/grid_traversal.pyx":67 * iv_dir[i] = 1.0/v_dir[i] * if direction == 3: continue * x = (i+1) % 3 # <<<<<<<<<<<<<< @@ -2915,7 +3029,7 @@ */ __pyx_v_x = ((__pyx_v_i + 1) % 3); - /* "yt/utilities/lib/grid_traversal.pyx":76 + /* "yt/utilities/lib/grid_traversal.pyx":68 * if direction == 3: continue * x = (i+1) % 3 * y = (i+2) % 3 # <<<<<<<<<<<<<< @@ -2924,7 +3038,7 @@ */ __pyx_v_y = ((__pyx_v_i + 2) % 3); - /* "yt/utilities/lib/grid_traversal.pyx":77 + /* "yt/utilities/lib/grid_traversal.pyx":69 * x = (i+1) % 3 * y = (i+2) % 3 * if step[i] > 0: # <<<<<<<<<<<<<< @@ -2934,7 +3048,7 @@ __pyx_t_1 = (((__pyx_v_step[__pyx_v_i]) > 0) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/grid_traversal.pyx":78 + /* "yt/utilities/lib/grid_traversal.pyx":70 * y = (i+2) % 3 * if step[i] > 0: * tl = (vc.left_edge[i] - v_pos[i])*iv_dir[i] # <<<<<<<<<<<<<< @@ -2943,7 +3057,7 @@ */ __pyx_v_tl = (((__pyx_v_vc->left_edge[__pyx_v_i]) - (__pyx_v_v_pos[__pyx_v_i])) * (__pyx_v_iv_dir[__pyx_v_i])); - /* "yt/utilities/lib/grid_traversal.pyx":77 + /* "yt/utilities/lib/grid_traversal.pyx":69 * x = (i+1) % 3 * y = (i+2) % 3 * if step[i] > 0: # <<<<<<<<<<<<<< @@ -2953,7 +3067,7 @@ goto __pyx_L15; } - /* "yt/utilities/lib/grid_traversal.pyx":80 + /* "yt/utilities/lib/grid_traversal.pyx":72 * tl = (vc.left_edge[i] - v_pos[i])*iv_dir[i] * else: * tl = (vc.right_edge[i] - v_pos[i])*iv_dir[i] # <<<<<<<<<<<<<< @@ -2965,7 +3079,7 @@ } __pyx_L15:; - /* "yt/utilities/lib/grid_traversal.pyx":81 + /* "yt/utilities/lib/grid_traversal.pyx":73 * else: * tl = (vc.right_edge[i] - v_pos[i])*iv_dir[i] * temp_x = (v_pos[x] + tl*v_dir[x]) # <<<<<<<<<<<<<< @@ -2974,7 +3088,7 @@ */ __pyx_v_temp_x = ((__pyx_v_v_pos[__pyx_v_x]) + (__pyx_v_tl * (__pyx_v_v_dir[__pyx_v_x]))); - /* "yt/utilities/lib/grid_traversal.pyx":82 + /* "yt/utilities/lib/grid_traversal.pyx":74 * tl = (vc.right_edge[i] - v_pos[i])*iv_dir[i] * temp_x = (v_pos[x] + tl*v_dir[x]) * temp_y = (v_pos[y] + tl*v_dir[y]) # <<<<<<<<<<<<<< @@ -2983,7 +3097,7 @@ */ __pyx_v_temp_y = ((__pyx_v_v_pos[__pyx_v_y]) + (__pyx_v_tl * (__pyx_v_v_dir[__pyx_v_y]))); - /* "yt/utilities/lib/grid_traversal.pyx":83 + /* "yt/utilities/lib/grid_traversal.pyx":75 * temp_x = (v_pos[x] + tl*v_dir[x]) * temp_y = (v_pos[y] + tl*v_dir[y]) * if fabs(temp_x - vc.left_edge[x]) < 1e-10*vc.dds[x]: # <<<<<<<<<<<<<< @@ -2993,7 +3107,7 @@ __pyx_t_1 = ((fabs((__pyx_v_temp_x - (__pyx_v_vc->left_edge[__pyx_v_x]))) < (1e-10 * (__pyx_v_vc->dds[__pyx_v_x]))) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/grid_traversal.pyx":84 + /* "yt/utilities/lib/grid_traversal.pyx":76 * temp_y = (v_pos[y] + tl*v_dir[y]) * if fabs(temp_x - vc.left_edge[x]) < 1e-10*vc.dds[x]: * temp_x = vc.left_edge[x] # <<<<<<<<<<<<<< @@ -3002,7 +3116,7 @@ */ __pyx_v_temp_x = (__pyx_v_vc->left_edge[__pyx_v_x]); - /* "yt/utilities/lib/grid_traversal.pyx":83 + /* "yt/utilities/lib/grid_traversal.pyx":75 * temp_x = (v_pos[x] + tl*v_dir[x]) * temp_y = (v_pos[y] + tl*v_dir[y]) * if fabs(temp_x - vc.left_edge[x]) < 1e-10*vc.dds[x]: # <<<<<<<<<<<<<< @@ -3012,7 +3126,7 @@ goto __pyx_L16; } - /* "yt/utilities/lib/grid_traversal.pyx":85 + /* "yt/utilities/lib/grid_traversal.pyx":77 * if fabs(temp_x - vc.left_edge[x]) < 1e-10*vc.dds[x]: * temp_x = vc.left_edge[x] * elif fabs(temp_x - vc.right_edge[x]) < 1e-10*vc.dds[x]: # <<<<<<<<<<<<<< @@ -3022,7 +3136,7 @@ __pyx_t_1 = ((fabs((__pyx_v_temp_x - (__pyx_v_vc->right_edge[__pyx_v_x]))) < (1e-10 * (__pyx_v_vc->dds[__pyx_v_x]))) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/grid_traversal.pyx":86 + /* "yt/utilities/lib/grid_traversal.pyx":78 * temp_x = vc.left_edge[x] * elif fabs(temp_x - vc.right_edge[x]) < 1e-10*vc.dds[x]: * temp_x = vc.right_edge[x] # <<<<<<<<<<<<<< @@ -3031,7 +3145,7 @@ */ __pyx_v_temp_x = (__pyx_v_vc->right_edge[__pyx_v_x]); - /* "yt/utilities/lib/grid_traversal.pyx":85 + /* "yt/utilities/lib/grid_traversal.pyx":77 * if fabs(temp_x - vc.left_edge[x]) < 1e-10*vc.dds[x]: * temp_x = vc.left_edge[x] * elif fabs(temp_x - vc.right_edge[x]) < 1e-10*vc.dds[x]: # <<<<<<<<<<<<<< @@ -3041,7 +3155,7 @@ } __pyx_L16:; - /* "yt/utilities/lib/grid_traversal.pyx":87 + /* "yt/utilities/lib/grid_traversal.pyx":79 * elif fabs(temp_x - vc.right_edge[x]) < 1e-10*vc.dds[x]: * temp_x = vc.right_edge[x] * if fabs(temp_y - vc.left_edge[y]) < 1e-10*vc.dds[y]: # <<<<<<<<<<<<<< @@ -3051,7 +3165,7 @@ __pyx_t_1 = ((fabs((__pyx_v_temp_y - (__pyx_v_vc->left_edge[__pyx_v_y]))) < (1e-10 * (__pyx_v_vc->dds[__pyx_v_y]))) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/grid_traversal.pyx":88 + /* "yt/utilities/lib/grid_traversal.pyx":80 * temp_x = vc.right_edge[x] * if fabs(temp_y - vc.left_edge[y]) < 1e-10*vc.dds[y]: * temp_y = vc.left_edge[y] # <<<<<<<<<<<<<< @@ -3060,7 +3174,7 @@ */ __pyx_v_temp_y = (__pyx_v_vc->left_edge[__pyx_v_y]); - /* "yt/utilities/lib/grid_traversal.pyx":87 + /* "yt/utilities/lib/grid_traversal.pyx":79 * elif fabs(temp_x - vc.right_edge[x]) < 1e-10*vc.dds[x]: * temp_x = vc.right_edge[x] * if fabs(temp_y - vc.left_edge[y]) < 1e-10*vc.dds[y]: # <<<<<<<<<<<<<< @@ -3070,7 +3184,7 @@ goto __pyx_L17; } - /* "yt/utilities/lib/grid_traversal.pyx":89 + /* "yt/utilities/lib/grid_traversal.pyx":81 * if fabs(temp_y - vc.left_edge[y]) < 1e-10*vc.dds[y]: * temp_y = vc.left_edge[y] * elif fabs(temp_y - vc.right_edge[y]) < 1e-10*vc.dds[y]: # <<<<<<<<<<<<<< @@ -3080,7 +3194,7 @@ __pyx_t_1 = ((fabs((__pyx_v_temp_y - (__pyx_v_vc->right_edge[__pyx_v_y]))) < (1e-10 * (__pyx_v_vc->dds[__pyx_v_y]))) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/grid_traversal.pyx":90 + /* "yt/utilities/lib/grid_traversal.pyx":82 * temp_y = vc.left_edge[y] * elif fabs(temp_y - vc.right_edge[y]) < 1e-10*vc.dds[y]: * temp_y = vc.right_edge[y] # <<<<<<<<<<<<<< @@ -3089,7 +3203,7 @@ */ __pyx_v_temp_y = (__pyx_v_vc->right_edge[__pyx_v_y]); - /* "yt/utilities/lib/grid_traversal.pyx":89 + /* "yt/utilities/lib/grid_traversal.pyx":81 * if fabs(temp_y - vc.left_edge[y]) < 1e-10*vc.dds[y]: * temp_y = vc.left_edge[y] * elif fabs(temp_y - vc.right_edge[y]) < 1e-10*vc.dds[y]: # <<<<<<<<<<<<<< @@ -3099,7 +3213,7 @@ } __pyx_L17:; - /* "yt/utilities/lib/grid_traversal.pyx":91 + /* "yt/utilities/lib/grid_traversal.pyx":83 * elif fabs(temp_y - vc.right_edge[y]) < 1e-10*vc.dds[y]: * temp_y = vc.right_edge[y] * if vc.left_edge[x] <= temp_x and temp_x <= vc.right_edge[x] and \ # <<<<<<<<<<<<<< @@ -3119,7 +3233,7 @@ goto __pyx_L19_bool_binop_done; } - /* "yt/utilities/lib/grid_traversal.pyx":92 + /* "yt/utilities/lib/grid_traversal.pyx":84 * temp_y = vc.right_edge[y] * if vc.left_edge[x] <= temp_x and temp_x <= vc.right_edge[x] and \ * vc.left_edge[y] <= temp_y and temp_y <= vc.right_edge[y] and \ # <<<<<<<<<<<<<< @@ -3139,7 +3253,7 @@ goto __pyx_L19_bool_binop_done; } - /* "yt/utilities/lib/grid_traversal.pyx":93 + /* "yt/utilities/lib/grid_traversal.pyx":85 * if vc.left_edge[x] <= temp_x and temp_x <= vc.right_edge[x] and \ * vc.left_edge[y] <= temp_y and temp_y <= vc.right_edge[y] and \ * 0.0 <= tl and tl < intersect_t: # <<<<<<<<<<<<<< @@ -3156,7 +3270,7 @@ __pyx_t_1 = __pyx_t_2; __pyx_L19_bool_binop_done:; - /* "yt/utilities/lib/grid_traversal.pyx":91 + /* "yt/utilities/lib/grid_traversal.pyx":83 * elif fabs(temp_y - vc.right_edge[y]) < 1e-10*vc.dds[y]: * temp_y = vc.right_edge[y] * if vc.left_edge[x] <= temp_x and temp_x <= vc.right_edge[x] and \ # <<<<<<<<<<<<<< @@ -3165,7 +3279,7 @@ */ if (__pyx_t_1) { - /* "yt/utilities/lib/grid_traversal.pyx":94 + /* "yt/utilities/lib/grid_traversal.pyx":86 * vc.left_edge[y] <= temp_y and temp_y <= vc.right_edge[y] and \ * 0.0 <= tl and tl < intersect_t: * direction = i # <<<<<<<<<<<<<< @@ -3174,7 +3288,7 @@ */ __pyx_v_direction = __pyx_v_i; - /* "yt/utilities/lib/grid_traversal.pyx":95 + /* "yt/utilities/lib/grid_traversal.pyx":87 * 0.0 <= tl and tl < intersect_t: * direction = i * intersect_t = tl # <<<<<<<<<<<<<< @@ -3183,7 +3297,7 @@ */ __pyx_v_intersect_t = __pyx_v_tl; - /* "yt/utilities/lib/grid_traversal.pyx":91 + /* "yt/utilities/lib/grid_traversal.pyx":83 * elif fabs(temp_y - vc.right_edge[y]) < 1e-10*vc.dds[y]: * temp_y = vc.right_edge[y] * if vc.left_edge[x] <= temp_x and temp_x <= vc.right_edge[x] and \ # <<<<<<<<<<<<<< @@ -3194,7 +3308,7 @@ __pyx_L11_continue:; } - /* "yt/utilities/lib/grid_traversal.pyx":96 + /* "yt/utilities/lib/grid_traversal.pyx":88 * direction = i * intersect_t = tl * if enter_t >= 0.0: intersect_t = enter_t # <<<<<<<<<<<<<< @@ -3206,7 +3320,7 @@ __pyx_v_intersect_t = __pyx_v_enter_t; } - /* "yt/utilities/lib/grid_traversal.pyx":97 + /* "yt/utilities/lib/grid_traversal.pyx":89 * intersect_t = tl * if enter_t >= 0.0: intersect_t = enter_t * if not ((0.0 <= intersect_t) and (intersect_t < max_t)): return 0 # <<<<<<<<<<<<<< @@ -3228,7 +3342,7 @@ goto __pyx_L0; } - /* "yt/utilities/lib/grid_traversal.pyx":98 + /* "yt/utilities/lib/grid_traversal.pyx":90 * if enter_t >= 0.0: intersect_t = enter_t * if not ((0.0 <= intersect_t) and (intersect_t < max_t)): return 0 * for i in range(3): # <<<<<<<<<<<<<< @@ -3238,7 +3352,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/utilities/lib/grid_traversal.pyx":102 + /* "yt/utilities/lib/grid_traversal.pyx":94 * # cur_ind[i], the current index of the grid cell the ray is in * # tmax[i], the 't' until it crosses out of the grid cell * tdelta[i] = step[i] * iv_dir[i] * vc.dds[i] # <<<<<<<<<<<<<< @@ -3247,7 +3361,7 @@ */ (__pyx_v_tdelta[__pyx_v_i]) = (((__pyx_v_step[__pyx_v_i]) * (__pyx_v_iv_dir[__pyx_v_i])) * (__pyx_v_vc->dds[__pyx_v_i])); - /* "yt/utilities/lib/grid_traversal.pyx":103 + /* "yt/utilities/lib/grid_traversal.pyx":95 * # tmax[i], the 't' until it crosses out of the grid cell * tdelta[i] = step[i] * iv_dir[i] * vc.dds[i] * if i == direction and step[i] > 0: # <<<<<<<<<<<<<< @@ -3265,7 +3379,7 @@ __pyx_L32_bool_binop_done:; if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":105 + /* "yt/utilities/lib/grid_traversal.pyx":97 * if i == direction and step[i] > 0: * # Intersection with the left face in this direction * cur_ind[i] = 0 # <<<<<<<<<<<<<< @@ -3274,7 +3388,7 @@ */ (__pyx_v_cur_ind[__pyx_v_i]) = 0; - /* "yt/utilities/lib/grid_traversal.pyx":103 + /* "yt/utilities/lib/grid_traversal.pyx":95 * # tmax[i], the 't' until it crosses out of the grid cell * tdelta[i] = step[i] * iv_dir[i] * vc.dds[i] * if i == direction and step[i] > 0: # <<<<<<<<<<<<<< @@ -3284,7 +3398,7 @@ goto __pyx_L31; } - /* "yt/utilities/lib/grid_traversal.pyx":106 + /* "yt/utilities/lib/grid_traversal.pyx":98 * # Intersection with the left face in this direction * cur_ind[i] = 0 * elif i == direction and step[i] < 0: # <<<<<<<<<<<<<< @@ -3302,7 +3416,7 @@ __pyx_L34_bool_binop_done:; if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":108 + /* "yt/utilities/lib/grid_traversal.pyx":100 * elif i == direction and step[i] < 0: * # Intersection with the right face in this direction * cur_ind[i] = vc.dims[i] - 1 # <<<<<<<<<<<<<< @@ -3311,7 +3425,7 @@ */ (__pyx_v_cur_ind[__pyx_v_i]) = ((__pyx_v_vc->dims[__pyx_v_i]) - 1); - /* "yt/utilities/lib/grid_traversal.pyx":106 + /* "yt/utilities/lib/grid_traversal.pyx":98 * # Intersection with the left face in this direction * cur_ind[i] = 0 * elif i == direction and step[i] < 0: # <<<<<<<<<<<<<< @@ -3321,7 +3435,7 @@ goto __pyx_L31; } - /* "yt/utilities/lib/grid_traversal.pyx":111 + /* "yt/utilities/lib/grid_traversal.pyx":103 * else: * # We are somewhere in the middle of the face * temp_x = intersect_t * v_dir[i] + v_pos[i] # current position # <<<<<<<<<<<<<< @@ -3331,7 +3445,7 @@ /*else*/ { __pyx_v_temp_x = ((__pyx_v_intersect_t * (__pyx_v_v_dir[__pyx_v_i])) + (__pyx_v_v_pos[__pyx_v_i])); - /* "yt/utilities/lib/grid_traversal.pyx":112 + /* "yt/utilities/lib/grid_traversal.pyx":104 * # We are somewhere in the middle of the face * temp_x = intersect_t * v_dir[i] + v_pos[i] # current position * temp_y = ((temp_x - vc.left_edge[i])*vc.idds[i]) # <<<<<<<<<<<<<< @@ -3340,7 +3454,7 @@ */ __pyx_v_temp_y = ((__pyx_v_temp_x - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i])); - /* "yt/utilities/lib/grid_traversal.pyx":116 + /* "yt/utilities/lib/grid_traversal.pyx":108 * # least significant places of the edge, and this helps prevent * # killing the calculation through a segfault in those cases. * if -1 < temp_y < 0 and step[i] > 0: # <<<<<<<<<<<<<< @@ -3362,7 +3476,7 @@ __pyx_L37_bool_binop_done:; if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":117 + /* "yt/utilities/lib/grid_traversal.pyx":109 * # killing the calculation through a segfault in those cases. * if -1 < temp_y < 0 and step[i] > 0: * temp_y = 0.0 # <<<<<<<<<<<<<< @@ -3371,7 +3485,7 @@ */ __pyx_v_temp_y = 0.0; - /* "yt/utilities/lib/grid_traversal.pyx":116 + /* "yt/utilities/lib/grid_traversal.pyx":108 * # least significant places of the edge, and this helps prevent * # killing the calculation through a segfault in those cases. * if -1 < temp_y < 0 and step[i] > 0: # <<<<<<<<<<<<<< @@ -3381,7 +3495,7 @@ goto __pyx_L36; } - /* "yt/utilities/lib/grid_traversal.pyx":118 + /* "yt/utilities/lib/grid_traversal.pyx":110 * if -1 < temp_y < 0 and step[i] > 0: * temp_y = 0.0 * elif vc.dims[i] - 1 < temp_y < vc.dims[i] and step[i] < 0: # <<<<<<<<<<<<<< @@ -3403,7 +3517,7 @@ __pyx_L39_bool_binop_done:; if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":119 + /* "yt/utilities/lib/grid_traversal.pyx":111 * temp_y = 0.0 * elif vc.dims[i] - 1 < temp_y < vc.dims[i] and step[i] < 0: * temp_y = vc.dims[i] - 1 # <<<<<<<<<<<<<< @@ -3412,7 +3526,7 @@ */ __pyx_v_temp_y = ((__pyx_v_vc->dims[__pyx_v_i]) - 1); - /* "yt/utilities/lib/grid_traversal.pyx":118 + /* "yt/utilities/lib/grid_traversal.pyx":110 * if -1 < temp_y < 0 and step[i] > 0: * temp_y = 0.0 * elif vc.dims[i] - 1 < temp_y < vc.dims[i] and step[i] < 0: # <<<<<<<<<<<<<< @@ -3422,7 +3536,7 @@ } __pyx_L36:; - /* "yt/utilities/lib/grid_traversal.pyx":120 + /* "yt/utilities/lib/grid_traversal.pyx":112 * elif vc.dims[i] - 1 < temp_y < vc.dims[i] and step[i] < 0: * temp_y = vc.dims[i] - 1 * cur_ind[i] = (floor(temp_y)) # <<<<<<<<<<<<<< @@ -3433,7 +3547,7 @@ } __pyx_L31:; - /* "yt/utilities/lib/grid_traversal.pyx":121 + /* "yt/utilities/lib/grid_traversal.pyx":113 * temp_y = vc.dims[i] - 1 * cur_ind[i] = (floor(temp_y)) * if step[i] > 0: # <<<<<<<<<<<<<< @@ -3443,7 +3557,7 @@ __pyx_t_2 = (((__pyx_v_step[__pyx_v_i]) > 0) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":122 + /* "yt/utilities/lib/grid_traversal.pyx":114 * cur_ind[i] = (floor(temp_y)) * if step[i] > 0: * temp_y = (cur_ind[i] + 1) * vc.dds[i] + vc.left_edge[i] # <<<<<<<<<<<<<< @@ -3452,7 +3566,7 @@ */ __pyx_v_temp_y = ((((__pyx_v_cur_ind[__pyx_v_i]) + 1) * (__pyx_v_vc->dds[__pyx_v_i])) + (__pyx_v_vc->left_edge[__pyx_v_i])); - /* "yt/utilities/lib/grid_traversal.pyx":121 + /* "yt/utilities/lib/grid_traversal.pyx":113 * temp_y = vc.dims[i] - 1 * cur_ind[i] = (floor(temp_y)) * if step[i] > 0: # <<<<<<<<<<<<<< @@ -3462,7 +3576,7 @@ goto __pyx_L41; } - /* "yt/utilities/lib/grid_traversal.pyx":123 + /* "yt/utilities/lib/grid_traversal.pyx":115 * if step[i] > 0: * temp_y = (cur_ind[i] + 1) * vc.dds[i] + vc.left_edge[i] * elif step[i] < 0: # <<<<<<<<<<<<<< @@ -3472,7 +3586,7 @@ __pyx_t_2 = (((__pyx_v_step[__pyx_v_i]) < 0) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":124 + /* "yt/utilities/lib/grid_traversal.pyx":116 * temp_y = (cur_ind[i] + 1) * vc.dds[i] + vc.left_edge[i] * elif step[i] < 0: * temp_y = cur_ind[i] * vc.dds[i] + vc.left_edge[i] # <<<<<<<<<<<<<< @@ -3481,7 +3595,7 @@ */ __pyx_v_temp_y = (((__pyx_v_cur_ind[__pyx_v_i]) * (__pyx_v_vc->dds[__pyx_v_i])) + (__pyx_v_vc->left_edge[__pyx_v_i])); - /* "yt/utilities/lib/grid_traversal.pyx":123 + /* "yt/utilities/lib/grid_traversal.pyx":115 * if step[i] > 0: * temp_y = (cur_ind[i] + 1) * vc.dds[i] + vc.left_edge[i] * elif step[i] < 0: # <<<<<<<<<<<<<< @@ -3491,7 +3605,7 @@ } __pyx_L41:; - /* "yt/utilities/lib/grid_traversal.pyx":125 + /* "yt/utilities/lib/grid_traversal.pyx":117 * elif step[i] < 0: * temp_y = cur_ind[i] * vc.dds[i] + vc.left_edge[i] * tmax[i] = (temp_y - v_pos[i]) * iv_dir[i] # <<<<<<<<<<<<<< @@ -3500,7 +3614,7 @@ */ (__pyx_v_tmax[__pyx_v_i]) = ((__pyx_v_temp_y - (__pyx_v_v_pos[__pyx_v_i])) * (__pyx_v_iv_dir[__pyx_v_i])); - /* "yt/utilities/lib/grid_traversal.pyx":126 + /* "yt/utilities/lib/grid_traversal.pyx":118 * temp_y = cur_ind[i] * vc.dds[i] + vc.left_edge[i] * tmax[i] = (temp_y - v_pos[i]) * iv_dir[i] * if step[i] == 0: # <<<<<<<<<<<<<< @@ -3510,7 +3624,7 @@ __pyx_t_2 = (((__pyx_v_step[__pyx_v_i]) == 0) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":127 + /* "yt/utilities/lib/grid_traversal.pyx":119 * tmax[i] = (temp_y - v_pos[i]) * iv_dir[i] * if step[i] == 0: * tmax[i] = 1e60 # <<<<<<<<<<<<<< @@ -3519,7 +3633,7 @@ */ (__pyx_v_tmax[__pyx_v_i]) = 1e60; - /* "yt/utilities/lib/grid_traversal.pyx":126 + /* "yt/utilities/lib/grid_traversal.pyx":118 * temp_y = cur_ind[i] * vc.dds[i] + vc.left_edge[i] * tmax[i] = (temp_y - v_pos[i]) * iv_dir[i] * if step[i] == 0: # <<<<<<<<<<<<<< @@ -3529,7 +3643,7 @@ } } - /* "yt/utilities/lib/grid_traversal.pyx":129 + /* "yt/utilities/lib/grid_traversal.pyx":121 * tmax[i] = 1e60 * # We have to jumpstart our calculation * for i in range(3): # <<<<<<<<<<<<<< @@ -3539,7 +3653,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/utilities/lib/grid_traversal.pyx":130 + /* "yt/utilities/lib/grid_traversal.pyx":122 * # We have to jumpstart our calculation * for i in range(3): * if cur_ind[i] == vc.dims[i] and step[i] >= 0: # <<<<<<<<<<<<<< @@ -3557,7 +3671,7 @@ __pyx_L46_bool_binop_done:; if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":131 + /* "yt/utilities/lib/grid_traversal.pyx":123 * for i in range(3): * if cur_ind[i] == vc.dims[i] and step[i] >= 0: * return 0 # <<<<<<<<<<<<<< @@ -3567,7 +3681,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/grid_traversal.pyx":130 + /* "yt/utilities/lib/grid_traversal.pyx":122 * # We have to jumpstart our calculation * for i in range(3): * if cur_ind[i] == vc.dims[i] and step[i] >= 0: # <<<<<<<<<<<<<< @@ -3576,7 +3690,7 @@ */ } - /* "yt/utilities/lib/grid_traversal.pyx":132 + /* "yt/utilities/lib/grid_traversal.pyx":124 * if cur_ind[i] == vc.dims[i] and step[i] >= 0: * return 0 * if cur_ind[i] == -1 and step[i] <= -1: # <<<<<<<<<<<<<< @@ -3594,7 +3708,7 @@ __pyx_L49_bool_binop_done:; if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":133 + /* "yt/utilities/lib/grid_traversal.pyx":125 * return 0 * if cur_ind[i] == -1 and step[i] <= -1: * return 0 # <<<<<<<<<<<<<< @@ -3604,7 +3718,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/grid_traversal.pyx":132 + /* "yt/utilities/lib/grid_traversal.pyx":124 * if cur_ind[i] == vc.dims[i] and step[i] >= 0: * return 0 * if cur_ind[i] == -1 and step[i] <= -1: # <<<<<<<<<<<<<< @@ -3614,7 +3728,7 @@ } } - /* "yt/utilities/lib/grid_traversal.pyx":134 + /* "yt/utilities/lib/grid_traversal.pyx":126 * if cur_ind[i] == -1 and step[i] <= -1: * return 0 * enter_t = intersect_t # <<<<<<<<<<<<<< @@ -3623,7 +3737,7 @@ */ __pyx_v_enter_t = __pyx_v_intersect_t; - /* "yt/utilities/lib/grid_traversal.pyx":135 + /* "yt/utilities/lib/grid_traversal.pyx":127 * return 0 * enter_t = intersect_t * hit = 0 # <<<<<<<<<<<<<< @@ -3632,7 +3746,7 @@ */ __pyx_v_hit = 0; - /* "yt/utilities/lib/grid_traversal.pyx":136 + /* "yt/utilities/lib/grid_traversal.pyx":128 * enter_t = intersect_t * hit = 0 * while 1: # <<<<<<<<<<<<<< @@ -3641,7 +3755,7 @@ */ while (1) { - /* "yt/utilities/lib/grid_traversal.pyx":137 + /* "yt/utilities/lib/grid_traversal.pyx":129 * hit = 0 * while 1: * hit += 1 # <<<<<<<<<<<<<< @@ -3650,7 +3764,7 @@ */ __pyx_v_hit = (__pyx_v_hit + 1); - /* "yt/utilities/lib/grid_traversal.pyx":138 + /* "yt/utilities/lib/grid_traversal.pyx":130 * while 1: * hit += 1 * if tmax[0] < tmax[1]: # <<<<<<<<<<<<<< @@ -3660,7 +3774,7 @@ __pyx_t_2 = (((__pyx_v_tmax[0]) < (__pyx_v_tmax[1])) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":139 + /* "yt/utilities/lib/grid_traversal.pyx":131 * hit += 1 * if tmax[0] < tmax[1]: * if tmax[0] < tmax[2]: # <<<<<<<<<<<<<< @@ -3670,7 +3784,7 @@ __pyx_t_2 = (((__pyx_v_tmax[0]) < (__pyx_v_tmax[2])) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":140 + /* "yt/utilities/lib/grid_traversal.pyx":132 * if tmax[0] < tmax[1]: * if tmax[0] < tmax[2]: * i = 0 # <<<<<<<<<<<<<< @@ -3679,7 +3793,7 @@ */ __pyx_v_i = 0; - /* "yt/utilities/lib/grid_traversal.pyx":139 + /* "yt/utilities/lib/grid_traversal.pyx":131 * hit += 1 * if tmax[0] < tmax[1]: * if tmax[0] < tmax[2]: # <<<<<<<<<<<<<< @@ -3689,7 +3803,7 @@ goto __pyx_L54; } - /* "yt/utilities/lib/grid_traversal.pyx":142 + /* "yt/utilities/lib/grid_traversal.pyx":134 * i = 0 * else: * i = 2 # <<<<<<<<<<<<<< @@ -3701,7 +3815,7 @@ } __pyx_L54:; - /* "yt/utilities/lib/grid_traversal.pyx":138 + /* "yt/utilities/lib/grid_traversal.pyx":130 * while 1: * hit += 1 * if tmax[0] < tmax[1]: # <<<<<<<<<<<<<< @@ -3711,7 +3825,7 @@ goto __pyx_L53; } - /* "yt/utilities/lib/grid_traversal.pyx":144 + /* "yt/utilities/lib/grid_traversal.pyx":136 * i = 2 * else: * if tmax[1] < tmax[2]: # <<<<<<<<<<<<<< @@ -3722,7 +3836,7 @@ __pyx_t_2 = (((__pyx_v_tmax[1]) < (__pyx_v_tmax[2])) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":145 + /* "yt/utilities/lib/grid_traversal.pyx":137 * else: * if tmax[1] < tmax[2]: * i = 1 # <<<<<<<<<<<<<< @@ -3731,7 +3845,7 @@ */ __pyx_v_i = 1; - /* "yt/utilities/lib/grid_traversal.pyx":144 + /* "yt/utilities/lib/grid_traversal.pyx":136 * i = 2 * else: * if tmax[1] < tmax[2]: # <<<<<<<<<<<<<< @@ -3741,7 +3855,7 @@ goto __pyx_L55; } - /* "yt/utilities/lib/grid_traversal.pyx":147 + /* "yt/utilities/lib/grid_traversal.pyx":139 * i = 1 * else: * i = 2 # <<<<<<<<<<<<<< @@ -3755,7 +3869,7 @@ } __pyx_L53:; - /* "yt/utilities/lib/grid_traversal.pyx":148 + /* "yt/utilities/lib/grid_traversal.pyx":140 * else: * i = 2 * exit_t = fmin(tmax[i], max_t) # <<<<<<<<<<<<<< @@ -3764,7 +3878,7 @@ */ __pyx_v_exit_t = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin((__pyx_v_tmax[__pyx_v_i]), __pyx_v_max_t); - /* "yt/utilities/lib/grid_traversal.pyx":149 + /* "yt/utilities/lib/grid_traversal.pyx":141 * i = 2 * exit_t = fmin(tmax[i], max_t) * sample(vc, v_pos, v_dir, enter_t, exit_t, cur_ind, data) # <<<<<<<<<<<<<< @@ -3773,7 +3887,7 @@ */ __pyx_v_sample(__pyx_v_vc, __pyx_v_v_pos, __pyx_v_v_dir, __pyx_v_enter_t, __pyx_v_exit_t, __pyx_v_cur_ind, __pyx_v_data); - /* "yt/utilities/lib/grid_traversal.pyx":150 + /* "yt/utilities/lib/grid_traversal.pyx":142 * exit_t = fmin(tmax[i], max_t) * sample(vc, v_pos, v_dir, enter_t, exit_t, cur_ind, data) * cur_ind[i] += step[i] # <<<<<<<<<<<<<< @@ -3783,7 +3897,7 @@ __pyx_t_3 = __pyx_v_i; (__pyx_v_cur_ind[__pyx_t_3]) = ((__pyx_v_cur_ind[__pyx_t_3]) + (__pyx_v_step[__pyx_v_i])); - /* "yt/utilities/lib/grid_traversal.pyx":151 + /* "yt/utilities/lib/grid_traversal.pyx":143 * sample(vc, v_pos, v_dir, enter_t, exit_t, cur_ind, data) * cur_ind[i] += step[i] * enter_t = tmax[i] # <<<<<<<<<<<<<< @@ -3792,7 +3906,7 @@ */ __pyx_v_enter_t = (__pyx_v_tmax[__pyx_v_i]); - /* "yt/utilities/lib/grid_traversal.pyx":152 + /* "yt/utilities/lib/grid_traversal.pyx":144 * cur_ind[i] += step[i] * enter_t = tmax[i] * tmax[i] += tdelta[i] # <<<<<<<<<<<<<< @@ -3802,7 +3916,7 @@ __pyx_t_3 = __pyx_v_i; (__pyx_v_tmax[__pyx_t_3]) = ((__pyx_v_tmax[__pyx_t_3]) + (__pyx_v_tdelta[__pyx_v_i])); - /* "yt/utilities/lib/grid_traversal.pyx":153 + /* "yt/utilities/lib/grid_traversal.pyx":145 * enter_t = tmax[i] * tmax[i] += tdelta[i] * if cur_ind[i] < 0 or cur_ind[i] >= vc.dims[i] or enter_t >= max_t: # <<<<<<<<<<<<<< @@ -3826,7 +3940,7 @@ __pyx_L57_bool_binop_done:; if (__pyx_t_2) { - /* "yt/utilities/lib/grid_traversal.pyx":154 + /* "yt/utilities/lib/grid_traversal.pyx":146 * tmax[i] += tdelta[i] * if cur_ind[i] < 0 or cur_ind[i] >= vc.dims[i] or enter_t >= max_t: * break # <<<<<<<<<<<<<< @@ -3835,7 +3949,7 @@ */ goto __pyx_L52_break; - /* "yt/utilities/lib/grid_traversal.pyx":153 + /* "yt/utilities/lib/grid_traversal.pyx":145 * enter_t = tmax[i] * tmax[i] += tdelta[i] * if cur_ind[i] < 0 or cur_ind[i] >= vc.dims[i] or enter_t >= max_t: # <<<<<<<<<<<<<< @@ -3846,7 +3960,7 @@ } __pyx_L52_break:; - /* "yt/utilities/lib/grid_traversal.pyx":155 + /* "yt/utilities/lib/grid_traversal.pyx":147 * if cur_ind[i] < 0 or cur_ind[i] >= vc.dims[i] or enter_t >= max_t: * break * if return_t != NULL: return_t[0] = exit_t # <<<<<<<<<<<<<< @@ -3858,7 +3972,7 @@ (__pyx_v_return_t[0]) = __pyx_v_exit_t; } - /* "yt/utilities/lib/grid_traversal.pyx":156 + /* "yt/utilities/lib/grid_traversal.pyx":148 * break * if return_t != NULL: return_t[0] = exit_t * return hit # <<<<<<<<<<<<<< @@ -3868,7 +3982,7 @@ __pyx_r = __pyx_v_hit; goto __pyx_L0; - /* "yt/utilities/lib/grid_traversal.pyx":42 + /* "yt/utilities/lib/grid_traversal.pyx":34 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int walk_volume(VolumeContainer *vc, # <<<<<<<<<<<<<< @@ -3881,7 +3995,7 @@ return __pyx_r; } -/* "yt/utilities/lib/grid_traversal.pyx":158 +/* "yt/utilities/lib/grid_traversal.pyx":150 * return hit * * def hp_pix2vec_nest(long nside, long ipix): # <<<<<<<<<<<<<< @@ -3906,7 +4020,9 @@ 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; } @@ -3915,14 +4031,15 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nside)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ipix)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("hp_pix2vec_nest", 1, 2, 2, 1); __PYX_ERR(0, 158, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("hp_pix2vec_nest", 1, 2, 2, 1); __PYX_ERR(0, 150, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hp_pix2vec_nest") < 0)) __PYX_ERR(0, 158, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hp_pix2vec_nest") < 0)) __PYX_ERR(0, 150, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3930,12 +4047,12 @@ values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error) - __pyx_v_ipix = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_ipix == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error) + __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) + __pyx_v_ipix = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_ipix == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("hp_pix2vec_nest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 158, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("hp_pix2vec_nest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 150, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.grid_traversal.hp_pix2vec_nest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3953,7 +4070,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hp_pix2vec_nest", 0); - /* "yt/utilities/lib/grid_traversal.pyx":159 + /* "yt/utilities/lib/grid_traversal.pyx":151 * * def hp_pix2vec_nest(long nside, long ipix): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -3961,9 +4078,9 @@ * # healpix_interface.pix2vec_nest(nside, ipix, v) */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 159, __pyx_L1_error) + __PYX_ERR(0, 151, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":158 + /* "yt/utilities/lib/grid_traversal.pyx":150 * return hit * * def hp_pix2vec_nest(long nside, long ipix): # <<<<<<<<<<<<<< @@ -3980,7 +4097,7 @@ return __pyx_r; } -/* "yt/utilities/lib/grid_traversal.pyx":168 +/* "yt/utilities/lib/grid_traversal.pyx":160 * # return tr * * def arr_pix2vec_nest(long nside, # <<<<<<<<<<<<<< @@ -4005,7 +4122,9 @@ 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; } @@ -4014,14 +4133,15 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nside)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_aipix)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("arr_pix2vec_nest", 1, 2, 2, 1); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_pix2vec_nest", 1, 2, 2, 1); __PYX_ERR(0, 160, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arr_pix2vec_nest") < 0)) __PYX_ERR(0, 168, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arr_pix2vec_nest") < 0)) __PYX_ERR(0, 160, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4029,18 +4149,18 @@ values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L3_error) + __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L3_error) __pyx_v_aipix = ((PyArrayObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("arr_pix2vec_nest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_pix2vec_nest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 160, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.grid_traversal.arr_pix2vec_nest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aipix), __pyx_ptype_5numpy_ndarray, 1, "aipix", 0))) __PYX_ERR(0, 169, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aipix), __pyx_ptype_5numpy_ndarray, 1, "aipix", 0))) __PYX_ERR(0, 161, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14grid_traversal_2arr_pix2vec_nest(__pyx_self, __pyx_v_nside, __pyx_v_aipix); /* function exit code */ @@ -4064,11 +4184,11 @@ __pyx_pybuffernd_aipix.rcbuffer = &__pyx_pybuffer_aipix; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_aipix.rcbuffer->pybuffer, (PyObject*)__pyx_v_aipix, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_aipix.rcbuffer->pybuffer, (PyObject*)__pyx_v_aipix, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 160, __pyx_L1_error) } __pyx_pybuffernd_aipix.diminfo[0].strides = __pyx_pybuffernd_aipix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_aipix.diminfo[0].shape = __pyx_pybuffernd_aipix.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/grid_traversal.pyx":170 + /* "yt/utilities/lib/grid_traversal.pyx":162 * def arr_pix2vec_nest(long nside, * np.ndarray[np.int64_t, ndim=1] aipix): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -4076,9 +4196,9 @@ * # cdef int i */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 170, __pyx_L1_error) + __PYX_ERR(0, 162, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":168 + /* "yt/utilities/lib/grid_traversal.pyx":160 * # return tr * * def arr_pix2vec_nest(long nside, # <<<<<<<<<<<<<< @@ -4104,7 +4224,7 @@ return __pyx_r; } -/* "yt/utilities/lib/grid_traversal.pyx":184 +/* "yt/utilities/lib/grid_traversal.pyx":176 * # return tr * * def hp_vec2pix_nest(long nside, double x, double y, double z): # <<<<<<<<<<<<<< @@ -4131,9 +4251,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -4142,24 +4266,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nside)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("hp_vec2pix_nest", 1, 4, 4, 1); __PYX_ERR(0, 184, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("hp_vec2pix_nest", 1, 4, 4, 1); __PYX_ERR(0, 176, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("hp_vec2pix_nest", 1, 4, 4, 2); __PYX_ERR(0, 184, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("hp_vec2pix_nest", 1, 4, 4, 2); __PYX_ERR(0, 176, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("hp_vec2pix_nest", 1, 4, 4, 3); __PYX_ERR(0, 184, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("hp_vec2pix_nest", 1, 4, 4, 3); __PYX_ERR(0, 176, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hp_vec2pix_nest") < 0)) __PYX_ERR(0, 184, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hp_vec2pix_nest") < 0)) __PYX_ERR(0, 176, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -4169,14 +4296,14 @@ values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } - __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L3_error) - __pyx_v_x = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L3_error) - __pyx_v_y = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_y == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L3_error) + __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L3_error) + __pyx_v_x = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L3_error) + __pyx_v_y = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_y == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("hp_vec2pix_nest", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 184, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("hp_vec2pix_nest", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 176, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.grid_traversal.hp_vec2pix_nest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4194,7 +4321,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hp_vec2pix_nest", 0); - /* "yt/utilities/lib/grid_traversal.pyx":185 + /* "yt/utilities/lib/grid_traversal.pyx":177 * * def hp_vec2pix_nest(long nside, double x, double y, double z): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -4202,9 +4329,9 @@ * # v[0] = x */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 185, __pyx_L1_error) + __PYX_ERR(0, 177, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":184 + /* "yt/utilities/lib/grid_traversal.pyx":176 * # return tr * * def hp_vec2pix_nest(long nside, double x, double y, double z): # <<<<<<<<<<<<<< @@ -4221,7 +4348,7 @@ return __pyx_r; } -/* "yt/utilities/lib/grid_traversal.pyx":194 +/* "yt/utilities/lib/grid_traversal.pyx":186 * # return ipix * * def arr_vec2pix_nest(long nside, # <<<<<<<<<<<<<< @@ -4248,9 +4375,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -4259,24 +4390,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nside)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("arr_vec2pix_nest", 1, 4, 4, 1); __PYX_ERR(0, 194, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_vec2pix_nest", 1, 4, 4, 1); __PYX_ERR(0, 186, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("arr_vec2pix_nest", 1, 4, 4, 2); __PYX_ERR(0, 194, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_vec2pix_nest", 1, 4, 4, 2); __PYX_ERR(0, 186, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("arr_vec2pix_nest", 1, 4, 4, 3); __PYX_ERR(0, 194, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_vec2pix_nest", 1, 4, 4, 3); __PYX_ERR(0, 186, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arr_vec2pix_nest") < 0)) __PYX_ERR(0, 194, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arr_vec2pix_nest") < 0)) __PYX_ERR(0, 186, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -4286,22 +4420,22 @@ values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } - __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error) + __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error) __pyx_v_x = ((PyArrayObject *)values[1]); __pyx_v_y = ((PyArrayObject *)values[2]); __pyx_v_z = ((PyArrayObject *)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("arr_vec2pix_nest", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 194, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_vec2pix_nest", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 186, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.grid_traversal.arr_vec2pix_nest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 195, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 196, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 197, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 187, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 188, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 189, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14grid_traversal_6arr_vec2pix_nest(__pyx_self, __pyx_v_nside, __pyx_v_x, __pyx_v_y, __pyx_v_z); /* function exit code */ @@ -4337,21 +4471,21 @@ __pyx_pybuffernd_z.rcbuffer = &__pyx_pybuffer_z; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 194, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 186, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 194, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 186, __pyx_L1_error) } __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 194, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 186, __pyx_L1_error) } __pyx_pybuffernd_z.diminfo[0].strides = __pyx_pybuffernd_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z.diminfo[0].shape = __pyx_pybuffernd_z.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/grid_traversal.pyx":198 + /* "yt/utilities/lib/grid_traversal.pyx":190 * np.ndarray[np.float64_t, ndim=1] y, * np.ndarray[np.float64_t, ndim=1] z): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -4359,9 +4493,9 @@ * # cdef int i */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 198, __pyx_L1_error) + __PYX_ERR(0, 190, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":194 + /* "yt/utilities/lib/grid_traversal.pyx":186 * # return ipix * * def arr_vec2pix_nest(long nside, # <<<<<<<<<<<<<< @@ -4391,7 +4525,7 @@ return __pyx_r; } -/* "yt/utilities/lib/grid_traversal.pyx":212 +/* "yt/utilities/lib/grid_traversal.pyx":204 * # return tr * * def hp_pix2ang_nest(long nside, long ipnest): # <<<<<<<<<<<<<< @@ -4416,7 +4550,9 @@ 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; } @@ -4425,14 +4561,15 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nside)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ipnest)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("hp_pix2ang_nest", 1, 2, 2, 1); __PYX_ERR(0, 212, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("hp_pix2ang_nest", 1, 2, 2, 1); __PYX_ERR(0, 204, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hp_pix2ang_nest") < 0)) __PYX_ERR(0, 212, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hp_pix2ang_nest") < 0)) __PYX_ERR(0, 204, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4440,12 +4577,12 @@ values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_ipnest = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_ipnest == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) + __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L3_error) + __pyx_v_ipnest = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_ipnest == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("hp_pix2ang_nest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("hp_pix2ang_nest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 204, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.grid_traversal.hp_pix2ang_nest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4463,7 +4600,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hp_pix2ang_nest", 0); - /* "yt/utilities/lib/grid_traversal.pyx":213 + /* "yt/utilities/lib/grid_traversal.pyx":205 * * def hp_pix2ang_nest(long nside, long ipnest): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -4471,9 +4608,9 @@ * # healpix_interface.pix2ang_nest(nside, ipnest, &theta, &phi) */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 213, __pyx_L1_error) + __PYX_ERR(0, 205, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":212 + /* "yt/utilities/lib/grid_traversal.pyx":204 * # return tr * * def hp_pix2ang_nest(long nside, long ipnest): # <<<<<<<<<<<<<< @@ -4490,7 +4627,7 @@ return __pyx_r; } -/* "yt/utilities/lib/grid_traversal.pyx":218 +/* "yt/utilities/lib/grid_traversal.pyx":210 * # return (theta, phi) * * def arr_pix2ang_nest(long nside, np.ndarray[np.int64_t, ndim=1] aipnest): # <<<<<<<<<<<<<< @@ -4515,7 +4652,9 @@ 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; } @@ -4524,14 +4663,15 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nside)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_aipnest)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("arr_pix2ang_nest", 1, 2, 2, 1); __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_pix2ang_nest", 1, 2, 2, 1); __PYX_ERR(0, 210, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arr_pix2ang_nest") < 0)) __PYX_ERR(0, 218, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arr_pix2ang_nest") < 0)) __PYX_ERR(0, 210, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4539,18 +4679,18 @@ values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L3_error) + __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L3_error) __pyx_v_aipnest = ((PyArrayObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("arr_pix2ang_nest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_pix2ang_nest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 210, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.grid_traversal.arr_pix2ang_nest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aipnest), __pyx_ptype_5numpy_ndarray, 1, "aipnest", 0))) __PYX_ERR(0, 218, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aipnest), __pyx_ptype_5numpy_ndarray, 1, "aipnest", 0))) __PYX_ERR(0, 210, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14grid_traversal_10arr_pix2ang_nest(__pyx_self, __pyx_v_nside, __pyx_v_aipnest); /* function exit code */ @@ -4574,11 +4714,11 @@ __pyx_pybuffernd_aipnest.rcbuffer = &__pyx_pybuffer_aipnest; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_aipnest.rcbuffer->pybuffer, (PyObject*)__pyx_v_aipnest, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 218, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_aipnest.rcbuffer->pybuffer, (PyObject*)__pyx_v_aipnest, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 210, __pyx_L1_error) } __pyx_pybuffernd_aipnest.diminfo[0].strides = __pyx_pybuffernd_aipnest.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_aipnest.diminfo[0].shape = __pyx_pybuffernd_aipnest.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/grid_traversal.pyx":219 + /* "yt/utilities/lib/grid_traversal.pyx":211 * * def arr_pix2ang_nest(long nside, np.ndarray[np.int64_t, ndim=1] aipnest): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -4586,9 +4726,9 @@ * # cdef int i */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 219, __pyx_L1_error) + __PYX_ERR(0, 211, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":218 + /* "yt/utilities/lib/grid_traversal.pyx":210 * # return (theta, phi) * * def arr_pix2ang_nest(long nside, np.ndarray[np.int64_t, ndim=1] aipnest): # <<<<<<<<<<<<<< @@ -4614,7 +4754,7 @@ return __pyx_r; } -/* "yt/utilities/lib/grid_traversal.pyx":232 +/* "yt/utilities/lib/grid_traversal.pyx":224 * # return tr * * def hp_ang2pix_nest(long nside, double theta, double phi): # <<<<<<<<<<<<<< @@ -4640,8 +4780,11 @@ 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; } @@ -4650,19 +4793,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nside)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("hp_ang2pix_nest", 1, 3, 3, 1); __PYX_ERR(0, 232, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("hp_ang2pix_nest", 1, 3, 3, 1); __PYX_ERR(0, 224, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("hp_ang2pix_nest", 1, 3, 3, 2); __PYX_ERR(0, 232, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("hp_ang2pix_nest", 1, 3, 3, 2); __PYX_ERR(0, 224, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hp_ang2pix_nest") < 0)) __PYX_ERR(0, 232, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hp_ang2pix_nest") < 0)) __PYX_ERR(0, 224, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -4671,13 +4816,13 @@ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L3_error) - __pyx_v_theta = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_theta == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L3_error) - __pyx_v_phi = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_phi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L3_error) + __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error) + __pyx_v_theta = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_theta == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error) + __pyx_v_phi = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_phi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("hp_ang2pix_nest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 232, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("hp_ang2pix_nest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.grid_traversal.hp_ang2pix_nest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4695,7 +4840,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hp_ang2pix_nest", 0); - /* "yt/utilities/lib/grid_traversal.pyx":233 + /* "yt/utilities/lib/grid_traversal.pyx":225 * * def hp_ang2pix_nest(long nside, double theta, double phi): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -4703,9 +4848,9 @@ * # healpix_interface.ang2pix_nest(nside, theta, phi, &ipix) */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 233, __pyx_L1_error) + __PYX_ERR(0, 225, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":232 + /* "yt/utilities/lib/grid_traversal.pyx":224 * # return tr * * def hp_ang2pix_nest(long nside, double theta, double phi): # <<<<<<<<<<<<<< @@ -4722,7 +4867,7 @@ return __pyx_r; } -/* "yt/utilities/lib/grid_traversal.pyx":238 +/* "yt/utilities/lib/grid_traversal.pyx":230 * # return ipix * * def arr_ang2pix_nest(long nside, # <<<<<<<<<<<<<< @@ -4748,8 +4893,11 @@ 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; } @@ -4758,19 +4906,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nside)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_atheta)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("arr_ang2pix_nest", 1, 3, 3, 1); __PYX_ERR(0, 238, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_ang2pix_nest", 1, 3, 3, 1); __PYX_ERR(0, 230, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_aphi)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("arr_ang2pix_nest", 1, 3, 3, 2); __PYX_ERR(0, 238, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_ang2pix_nest", 1, 3, 3, 2); __PYX_ERR(0, 230, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arr_ang2pix_nest") < 0)) __PYX_ERR(0, 238, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arr_ang2pix_nest") < 0)) __PYX_ERR(0, 230, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -4779,20 +4929,20 @@ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) + __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error) __pyx_v_atheta = ((PyArrayObject *)values[1]); __pyx_v_aphi = ((PyArrayObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("arr_ang2pix_nest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 238, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_ang2pix_nest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 230, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.grid_traversal.arr_ang2pix_nest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_atheta), __pyx_ptype_5numpy_ndarray, 1, "atheta", 0))) __PYX_ERR(0, 239, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aphi), __pyx_ptype_5numpy_ndarray, 1, "aphi", 0))) __PYX_ERR(0, 240, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_atheta), __pyx_ptype_5numpy_ndarray, 1, "atheta", 0))) __PYX_ERR(0, 231, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aphi), __pyx_ptype_5numpy_ndarray, 1, "aphi", 0))) __PYX_ERR(0, 232, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14grid_traversal_14arr_ang2pix_nest(__pyx_self, __pyx_v_nside, __pyx_v_atheta, __pyx_v_aphi); /* function exit code */ @@ -4822,16 +4972,16 @@ __pyx_pybuffernd_aphi.rcbuffer = &__pyx_pybuffer_aphi; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_atheta.rcbuffer->pybuffer, (PyObject*)__pyx_v_atheta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 238, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_atheta.rcbuffer->pybuffer, (PyObject*)__pyx_v_atheta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 230, __pyx_L1_error) } __pyx_pybuffernd_atheta.diminfo[0].strides = __pyx_pybuffernd_atheta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_atheta.diminfo[0].shape = __pyx_pybuffernd_atheta.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_aphi.rcbuffer->pybuffer, (PyObject*)__pyx_v_aphi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 238, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_aphi.rcbuffer->pybuffer, (PyObject*)__pyx_v_aphi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 230, __pyx_L1_error) } __pyx_pybuffernd_aphi.diminfo[0].strides = __pyx_pybuffernd_aphi.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_aphi.diminfo[0].shape = __pyx_pybuffernd_aphi.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/grid_traversal.pyx":241 + /* "yt/utilities/lib/grid_traversal.pyx":233 * np.ndarray[np.float64_t, ndim=1] atheta, * np.ndarray[np.float64_t, ndim=1] aphi): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -4839,9 +4989,9 @@ * # cdef int i */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 241, __pyx_L1_error) + __PYX_ERR(0, 233, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":238 + /* "yt/utilities/lib/grid_traversal.pyx":230 * # return ipix * * def arr_ang2pix_nest(long nside, # <<<<<<<<<<<<<< @@ -4869,7 +5019,7 @@ return __pyx_r; } -/* "yt/utilities/lib/grid_traversal.pyx":257 +/* "yt/utilities/lib/grid_traversal.pyx":249 * @cython.cdivision(False) * @cython.wraparound(False) * def pixelize_healpix(long nside, # <<<<<<<<<<<<<< @@ -4897,10 +5047,15 @@ 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; } @@ -4909,29 +5064,33 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nside)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_healpix", 1, 5, 5, 1); __PYX_ERR(0, 257, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_healpix", 1, 5, 5, 1); __PYX_ERR(0, 249, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ntheta)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_healpix", 1, 5, 5, 2); __PYX_ERR(0, 257, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_healpix", 1, 5, 5, 2); __PYX_ERR(0, 249, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nphi)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_healpix", 1, 5, 5, 3); __PYX_ERR(0, 257, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_healpix", 1, 5, 5, 3); __PYX_ERR(0, 249, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_irotation)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_healpix", 1, 5, 5, 4); __PYX_ERR(0, 257, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_healpix", 1, 5, 5, 4); __PYX_ERR(0, 249, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_healpix") < 0)) __PYX_ERR(0, 257, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_healpix") < 0)) __PYX_ERR(0, 249, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -4942,22 +5101,22 @@ values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } - __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 257, __pyx_L3_error) + __pyx_v_nside = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 249, __pyx_L3_error) __pyx_v_values = ((PyArrayObject *)values[1]); - __pyx_v_ntheta = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_ntheta == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L3_error) - __pyx_v_nphi = __Pyx_PyInt_As_long(values[3]); if (unlikely((__pyx_v_nphi == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L3_error) + __pyx_v_ntheta = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_ntheta == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L3_error) + __pyx_v_nphi = __Pyx_PyInt_As_long(values[3]); if (unlikely((__pyx_v_nphi == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L3_error) __pyx_v_irotation = ((PyArrayObject *)values[4]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pixelize_healpix", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 257, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_healpix", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 249, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.grid_traversal.pixelize_healpix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) __PYX_ERR(0, 258, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_irotation), __pyx_ptype_5numpy_ndarray, 1, "irotation", 0))) __PYX_ERR(0, 260, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) __PYX_ERR(0, 250, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_irotation), __pyx_ptype_5numpy_ndarray, 1, "irotation", 0))) __PYX_ERR(0, 252, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14grid_traversal_16pixelize_healpix(__pyx_self, __pyx_v_nside, __pyx_v_values, __pyx_v_ntheta, __pyx_v_nphi, __pyx_v_irotation); /* function exit code */ @@ -4987,16 +5146,16 @@ __pyx_pybuffernd_irotation.rcbuffer = &__pyx_pybuffer_irotation; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 257, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 249, __pyx_L1_error) } __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_irotation.rcbuffer->pybuffer, (PyObject*)__pyx_v_irotation, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 257, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_irotation.rcbuffer->pybuffer, (PyObject*)__pyx_v_irotation, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 249, __pyx_L1_error) } __pyx_pybuffernd_irotation.diminfo[0].strides = __pyx_pybuffernd_irotation.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_irotation.diminfo[0].shape = __pyx_pybuffernd_irotation.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_irotation.diminfo[1].strides = __pyx_pybuffernd_irotation.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_irotation.diminfo[1].shape = __pyx_pybuffernd_irotation.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/grid_traversal.pyx":261 + /* "yt/utilities/lib/grid_traversal.pyx":253 * long ntheta, long nphi, * np.ndarray[np.float64_t, ndim=2] irotation): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -5004,9 +5163,9 @@ * # cdef int i, j, thetai, phii */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 261, __pyx_L1_error) + __PYX_ERR(0, 253, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":257 + /* "yt/utilities/lib/grid_traversal.pyx":249 * @cython.cdivision(False) * @cython.wraparound(False) * def pixelize_healpix(long nside, # <<<<<<<<<<<<<< @@ -5034,7 +5193,7 @@ return __pyx_r; } -/* "yt/utilities/lib/grid_traversal.pyx":299 +/* "yt/utilities/lib/grid_traversal.pyx":291 * # return results, count * * def healpix_aitoff_proj(np.ndarray[np.float64_t, ndim=1] pix_image, # <<<<<<<<<<<<<< @@ -5061,9 +5220,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -5072,24 +5235,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pix_image)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nside)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("healpix_aitoff_proj", 1, 4, 4, 1); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("healpix_aitoff_proj", 1, 4, 4, 1); __PYX_ERR(0, 291, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("healpix_aitoff_proj", 1, 4, 4, 2); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("healpix_aitoff_proj", 1, 4, 4, 2); __PYX_ERR(0, 291, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_irotation)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("healpix_aitoff_proj", 1, 4, 4, 3); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("healpix_aitoff_proj", 1, 4, 4, 3); __PYX_ERR(0, 291, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "healpix_aitoff_proj") < 0)) __PYX_ERR(0, 299, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "healpix_aitoff_proj") < 0)) __PYX_ERR(0, 291, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -5100,21 +5266,21 @@ values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_pix_image = ((PyArrayObject *)values[0]); - __pyx_v_nside = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error) + __pyx_v_nside = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_nside == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 292, __pyx_L3_error) __pyx_v_image = ((PyArrayObject *)values[2]); __pyx_v_irotation = ((PyArrayObject *)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("healpix_aitoff_proj", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("healpix_aitoff_proj", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 291, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.grid_traversal.healpix_aitoff_proj", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pix_image), __pyx_ptype_5numpy_ndarray, 1, "pix_image", 0))) __PYX_ERR(0, 299, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 301, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_irotation), __pyx_ptype_5numpy_ndarray, 1, "irotation", 0))) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pix_image), __pyx_ptype_5numpy_ndarray, 1, "pix_image", 0))) __PYX_ERR(0, 291, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 293, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_irotation), __pyx_ptype_5numpy_ndarray, 1, "irotation", 0))) __PYX_ERR(0, 294, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14grid_traversal_18healpix_aitoff_proj(__pyx_self, __pyx_v_pix_image, __pyx_v_nside, __pyx_v_image, __pyx_v_irotation); /* function exit code */ @@ -5150,21 +5316,21 @@ __pyx_pybuffernd_irotation.rcbuffer = &__pyx_pybuffer_irotation; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pix_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_pix_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 299, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pix_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_pix_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 291, __pyx_L1_error) } __pyx_pybuffernd_pix_image.diminfo[0].strides = __pyx_pybuffernd_pix_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pix_image.diminfo[0].shape = __pyx_pybuffernd_pix_image.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 299, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 291, __pyx_L1_error) } __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_image.diminfo[1].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_image.diminfo[1].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_irotation.rcbuffer->pybuffer, (PyObject*)__pyx_v_irotation, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 299, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_irotation.rcbuffer->pybuffer, (PyObject*)__pyx_v_irotation, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 291, __pyx_L1_error) } __pyx_pybuffernd_irotation.diminfo[0].strides = __pyx_pybuffernd_irotation.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_irotation.diminfo[0].shape = __pyx_pybuffernd_irotation.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_irotation.diminfo[1].strides = __pyx_pybuffernd_irotation.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_irotation.diminfo[1].shape = __pyx_pybuffernd_irotation.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/grid_traversal.pyx":303 + /* "yt/utilities/lib/grid_traversal.pyx":295 * np.ndarray[np.float64_t, ndim=2] image, * np.ndarray[np.float64_t, ndim=2] irotation): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -5172,9 +5338,9 @@ * # cdef int i, j, k, l */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 303, __pyx_L1_error) + __PYX_ERR(0, 295, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":299 + /* "yt/utilities/lib/grid_traversal.pyx":291 * # return results, count * * def healpix_aitoff_proj(np.ndarray[np.float64_t, ndim=1] pix_image, # <<<<<<<<<<<<<< @@ -5204,7 +5370,7 @@ return __pyx_r; } -/* "yt/utilities/lib/grid_traversal.pyx":338 +/* "yt/utilities/lib/grid_traversal.pyx":330 * # image[j, i] = pix_image[ipix] * * def arr_fisheye_vectors(int resolution, np.float64_t fov, int nimx=1, int # <<<<<<<<<<<<<< @@ -5235,13 +5401,21 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -5250,36 +5424,43 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_resolution)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fov)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("arr_fisheye_vectors", 0, 2, 8, 1); __PYX_ERR(0, 338, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_fisheye_vectors", 0, 2, 8, 1); __PYX_ERR(0, 330, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nimx); if (value) { values[2] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nimy); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nimi); if (value) { values[4] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nimj); if (value) { values[5] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_off_theta); if (value) { values[6] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_off_phi); @@ -5287,58 +5468,64 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arr_fisheye_vectors") < 0)) __PYX_ERR(0, 338, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arr_fisheye_vectors") < 0)) __PYX_ERR(0, 330, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } - __pyx_v_resolution = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_resolution == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error) - __pyx_v_fov = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fov == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error) + __pyx_v_resolution = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_resolution == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error) + __pyx_v_fov = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fov == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error) if (values[2]) { - __pyx_v_nimx = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nimx == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error) + __pyx_v_nimx = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nimx == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error) } else { __pyx_v_nimx = ((int)1); } if (values[3]) { - __pyx_v_nimy = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nimy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error) + __pyx_v_nimy = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nimy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error) } else { __pyx_v_nimy = ((int)1); } if (values[4]) { - __pyx_v_nimi = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_nimi == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error) + __pyx_v_nimi = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_nimi == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L3_error) } else { __pyx_v_nimi = ((int)0); } if (values[5]) { - __pyx_v_nimj = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nimj == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error) + __pyx_v_nimj = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nimj == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L3_error) } else { __pyx_v_nimj = ((int)0); } if (values[6]) { - __pyx_v_off_theta = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_off_theta == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error) + __pyx_v_off_theta = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_off_theta == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L3_error) } else { __pyx_v_off_theta = ((__pyx_t_5numpy_float64_t)0.0); } if (values[7]) { - __pyx_v_off_phi = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_off_phi == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error) + __pyx_v_off_phi = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_off_phi == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L3_error) } else { __pyx_v_off_phi = ((__pyx_t_5numpy_float64_t)0.0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("arr_fisheye_vectors", 0, 2, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 338, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("arr_fisheye_vectors", 0, 2, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 330, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.grid_traversal.arr_fisheye_vectors", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5407,32 +5594,32 @@ __pyx_pybuffernd_vp.data = NULL; __pyx_pybuffernd_vp.rcbuffer = &__pyx_pybuffer_vp; - /* "yt/utilities/lib/grid_traversal.pyx":347 + /* "yt/utilities/lib/grid_traversal.pyx":339 * cdef int i, j * cdef np.float64_t r, phi, theta, px, py * cdef np.float64_t fov_rad = fov * np.pi / 180.0 # <<<<<<<<<<<<<< * cdef int nx = resolution/nimx * cdef int ny = resolution/nimy */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_fov); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_fov); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __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, 347, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_t_2, __pyx_float_180_0, 180.0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_t_2, __pyx_float_180_0, 180.0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_fov_rad = __pyx_t_4; - /* "yt/utilities/lib/grid_traversal.pyx":348 + /* "yt/utilities/lib/grid_traversal.pyx":340 * cdef np.float64_t r, phi, theta, px, py * cdef np.float64_t fov_rad = fov * np.pi / 180.0 * cdef int nx = resolution/nimx # <<<<<<<<<<<<<< @@ -5441,15 +5628,15 @@ */ if (unlikely(__pyx_v_nimx == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 348, __pyx_L1_error) + __PYX_ERR(0, 340, __pyx_L1_error) } else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_nimx == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_resolution))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(0, 348, __pyx_L1_error) + __PYX_ERR(0, 340, __pyx_L1_error) } __pyx_v_nx = __Pyx_div_int(__pyx_v_resolution, __pyx_v_nimx); - /* "yt/utilities/lib/grid_traversal.pyx":349 + /* "yt/utilities/lib/grid_traversal.pyx":341 * cdef np.float64_t fov_rad = fov * np.pi / 180.0 * cdef int nx = resolution/nimx * cdef int ny = resolution/nimy # <<<<<<<<<<<<<< @@ -5458,31 +5645,31 @@ */ if (unlikely(__pyx_v_nimy == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 349, __pyx_L1_error) + __PYX_ERR(0, 341, __pyx_L1_error) } else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_nimy == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_resolution))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(0, 349, __pyx_L1_error) + __PYX_ERR(0, 341, __pyx_L1_error) } __pyx_v_ny = __Pyx_div_int(__pyx_v_resolution, __pyx_v_nimy); - /* "yt/utilities/lib/grid_traversal.pyx":350 + /* "yt/utilities/lib/grid_traversal.pyx":342 * cdef int nx = resolution/nimx * cdef int ny = resolution/nimy * vp = np.zeros((nx,ny, 3), dtype="float64") # <<<<<<<<<<<<<< * for i in range(nx): * px = (2.0 * (nimi*nx + i)) / resolution - 1.0 */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); @@ -5493,20 +5680,20 @@ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_3); __pyx_t_3 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 350, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 350, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 342, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5522,13 +5709,13 @@ } } __pyx_pybuffernd_vp.diminfo[0].strides = __pyx_pybuffernd_vp.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vp.diminfo[0].shape = __pyx_pybuffernd_vp.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vp.diminfo[1].strides = __pyx_pybuffernd_vp.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vp.diminfo[1].shape = __pyx_pybuffernd_vp.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_vp.diminfo[2].strides = __pyx_pybuffernd_vp.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_vp.diminfo[2].shape = __pyx_pybuffernd_vp.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 350, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 342, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_vp = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/grid_traversal.pyx":351 + /* "yt/utilities/lib/grid_traversal.pyx":343 * cdef int ny = resolution/nimy * vp = np.zeros((nx,ny, 3), dtype="float64") * for i in range(nx): # <<<<<<<<<<<<<< @@ -5539,7 +5726,7 @@ for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "yt/utilities/lib/grid_traversal.pyx":352 + /* "yt/utilities/lib/grid_traversal.pyx":344 * vp = np.zeros((nx,ny, 3), dtype="float64") * for i in range(nx): * px = (2.0 * (nimi*nx + i)) / resolution - 1.0 # <<<<<<<<<<<<<< @@ -5549,47 +5736,47 @@ __pyx_t_12 = (2.0 * ((__pyx_v_nimi * __pyx_v_nx) + __pyx_v_i)); if (unlikely(__pyx_v_resolution == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 352, __pyx_L1_error) + __PYX_ERR(0, 344, __pyx_L1_error) } __pyx_v_px = ((__pyx_t_12 / __pyx_v_resolution) - 1.0); - /* "yt/utilities/lib/grid_traversal.pyx":353 + /* "yt/utilities/lib/grid_traversal.pyx":345 * for i in range(nx): * px = (2.0 * (nimi*nx + i)) / resolution - 1.0 * for j in range(ny): # <<<<<<<<<<<<<< * py = (2.0 * (nimj*ny + j)) / resolution - 1.0 - * r = (px*px + py*py)**0.5 + * r = sqrt(px*px + py*py) */ __pyx_t_13 = __pyx_v_ny; for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "yt/utilities/lib/grid_traversal.pyx":354 + /* "yt/utilities/lib/grid_traversal.pyx":346 * px = (2.0 * (nimi*nx + i)) / resolution - 1.0 * for j in range(ny): * py = (2.0 * (nimj*ny + j)) / resolution - 1.0 # <<<<<<<<<<<<<< - * r = (px*px + py*py)**0.5 + * r = sqrt(px*px + py*py) * if r > 1.01: */ __pyx_t_12 = (2.0 * ((__pyx_v_nimj * __pyx_v_ny) + __pyx_v_j)); if (unlikely(__pyx_v_resolution == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 354, __pyx_L1_error) + __PYX_ERR(0, 346, __pyx_L1_error) } __pyx_v_py = ((__pyx_t_12 / __pyx_v_resolution) - 1.0); - /* "yt/utilities/lib/grid_traversal.pyx":355 + /* "yt/utilities/lib/grid_traversal.pyx":347 * for j in range(ny): * py = (2.0 * (nimj*ny + j)) / resolution - 1.0 - * r = (px*px + py*py)**0.5 # <<<<<<<<<<<<<< + * r = sqrt(px*px + py*py) # <<<<<<<<<<<<<< * if r > 1.01: * vp[i,j,0] = vp[i,j,1] = vp[i,j,2] = 0.0 */ - __pyx_v_r = pow(((__pyx_v_px * __pyx_v_px) + (__pyx_v_py * __pyx_v_py)), ((__pyx_t_5numpy_float64_t)0.5)); + __pyx_v_r = sqrt(((__pyx_v_px * __pyx_v_px) + (__pyx_v_py * __pyx_v_py))); - /* "yt/utilities/lib/grid_traversal.pyx":356 + /* "yt/utilities/lib/grid_traversal.pyx":348 * py = (2.0 * (nimj*ny + j)) / resolution - 1.0 - * r = (px*px + py*py)**0.5 + * r = sqrt(px*px + py*py) * if r > 1.01: # <<<<<<<<<<<<<< * vp[i,j,0] = vp[i,j,1] = vp[i,j,2] = 0.0 * continue @@ -5597,8 +5784,8 @@ __pyx_t_15 = ((__pyx_v_r > 1.01) != 0); if (__pyx_t_15) { - /* "yt/utilities/lib/grid_traversal.pyx":357 - * r = (px*px + py*py)**0.5 + /* "yt/utilities/lib/grid_traversal.pyx":349 + * r = sqrt(px*px + py*py) * if r > 1.01: * vp[i,j,0] = vp[i,j,1] = vp[i,j,2] = 0.0 # <<<<<<<<<<<<<< * continue @@ -5622,7 +5809,7 @@ } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_vp.diminfo[2].shape)) __pyx_t_19 = 2; if (unlikely(__pyx_t_19 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_19); - __PYX_ERR(0, 357, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) } *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vp.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_vp.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_vp.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_vp.diminfo[2].strides) = 0.0; __pyx_t_20 = __pyx_v_i; @@ -5643,7 +5830,7 @@ } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_vp.diminfo[2].shape)) __pyx_t_19 = 2; if (unlikely(__pyx_t_19 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_19); - __PYX_ERR(0, 357, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) } *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vp.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_vp.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_vp.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_vp.diminfo[2].strides) = 0.0; __pyx_t_23 = __pyx_v_i; @@ -5664,11 +5851,11 @@ } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_vp.diminfo[2].shape)) __pyx_t_19 = 2; if (unlikely(__pyx_t_19 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_19); - __PYX_ERR(0, 357, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) } *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vp.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_vp.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_vp.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_vp.diminfo[2].strides) = 0.0; - /* "yt/utilities/lib/grid_traversal.pyx":358 + /* "yt/utilities/lib/grid_traversal.pyx":350 * if r > 1.01: * vp[i,j,0] = vp[i,j,1] = vp[i,j,2] = 0.0 * continue # <<<<<<<<<<<<<< @@ -5677,16 +5864,16 @@ */ goto __pyx_L5_continue; - /* "yt/utilities/lib/grid_traversal.pyx":356 + /* "yt/utilities/lib/grid_traversal.pyx":348 * py = (2.0 * (nimj*ny + j)) / resolution - 1.0 - * r = (px*px + py*py)**0.5 + * r = sqrt(px*px + py*py) * if r > 1.01: # <<<<<<<<<<<<<< * vp[i,j,0] = vp[i,j,1] = vp[i,j,2] = 0.0 * continue */ } - /* "yt/utilities/lib/grid_traversal.pyx":359 + /* "yt/utilities/lib/grid_traversal.pyx":351 * vp[i,j,0] = vp[i,j,1] = vp[i,j,2] = 0.0 * continue * phi = atan2(py, px) # <<<<<<<<<<<<<< @@ -5695,7 +5882,7 @@ */ __pyx_v_phi = atan2(__pyx_v_py, __pyx_v_px); - /* "yt/utilities/lib/grid_traversal.pyx":360 + /* "yt/utilities/lib/grid_traversal.pyx":352 * continue * phi = atan2(py, px) * theta = r * fov_rad / 2.0 # <<<<<<<<<<<<<< @@ -5704,7 +5891,7 @@ */ __pyx_v_theta = ((__pyx_v_r * __pyx_v_fov_rad) / 2.0); - /* "yt/utilities/lib/grid_traversal.pyx":361 + /* "yt/utilities/lib/grid_traversal.pyx":353 * phi = atan2(py, px) * theta = r * fov_rad / 2.0 * theta += off_theta # <<<<<<<<<<<<<< @@ -5713,7 +5900,7 @@ */ __pyx_v_theta = (__pyx_v_theta + __pyx_v_off_theta); - /* "yt/utilities/lib/grid_traversal.pyx":362 + /* "yt/utilities/lib/grid_traversal.pyx":354 * theta = r * fov_rad / 2.0 * theta += off_theta * phi += off_phi # <<<<<<<<<<<<<< @@ -5722,7 +5909,7 @@ */ __pyx_v_phi = (__pyx_v_phi + __pyx_v_off_phi); - /* "yt/utilities/lib/grid_traversal.pyx":363 + /* "yt/utilities/lib/grid_traversal.pyx":355 * theta += off_theta * phi += off_phi * vp[i,j,0] = sin(theta) * cos(phi) # <<<<<<<<<<<<<< @@ -5747,11 +5934,11 @@ } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_vp.diminfo[2].shape)) __pyx_t_19 = 2; if (unlikely(__pyx_t_19 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_19); - __PYX_ERR(0, 363, __pyx_L1_error) + __PYX_ERR(0, 355, __pyx_L1_error) } *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vp.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_vp.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_vp.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_vp.diminfo[2].strides) = (sin(__pyx_v_theta) * cos(__pyx_v_phi)); - /* "yt/utilities/lib/grid_traversal.pyx":364 + /* "yt/utilities/lib/grid_traversal.pyx":356 * phi += off_phi * vp[i,j,0] = sin(theta) * cos(phi) * vp[i,j,1] = sin(theta) * sin(phi) # <<<<<<<<<<<<<< @@ -5776,11 +5963,11 @@ } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_vp.diminfo[2].shape)) __pyx_t_19 = 2; if (unlikely(__pyx_t_19 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_19); - __PYX_ERR(0, 364, __pyx_L1_error) + __PYX_ERR(0, 356, __pyx_L1_error) } *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vp.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_vp.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_vp.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_vp.diminfo[2].strides) = (sin(__pyx_v_theta) * sin(__pyx_v_phi)); - /* "yt/utilities/lib/grid_traversal.pyx":365 + /* "yt/utilities/lib/grid_traversal.pyx":357 * vp[i,j,0] = sin(theta) * cos(phi) * vp[i,j,1] = sin(theta) * sin(phi) * vp[i,j,2] = cos(theta) # <<<<<<<<<<<<<< @@ -5805,14 +5992,14 @@ } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_vp.diminfo[2].shape)) __pyx_t_19 = 2; if (unlikely(__pyx_t_19 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_19); - __PYX_ERR(0, 365, __pyx_L1_error) + __PYX_ERR(0, 357, __pyx_L1_error) } *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vp.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_vp.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_vp.diminfo[1].strides, __pyx_t_34, __pyx_pybuffernd_vp.diminfo[2].strides) = cos(__pyx_v_theta); __pyx_L5_continue:; } } - /* "yt/utilities/lib/grid_traversal.pyx":366 + /* "yt/utilities/lib/grid_traversal.pyx":358 * vp[i,j,1] = sin(theta) * sin(phi) * vp[i,j,2] = cos(theta) * return vp # <<<<<<<<<<<<<< @@ -5824,7 +6011,7 @@ __pyx_r = ((PyObject *)__pyx_v_vp); goto __pyx_L0; - /* "yt/utilities/lib/grid_traversal.pyx":338 + /* "yt/utilities/lib/grid_traversal.pyx":330 * # image[j, i] = pix_image[ipix] * * def arr_fisheye_vectors(int resolution, np.float64_t fov, int nimx=1, int # <<<<<<<<<<<<<< @@ -5856,85 +6043,181 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython +/* "volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { int __pyx_r; - int __pyx_t_1; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("vc_index", 0); - /* "yt/utilities/lib/fp_utils.pxd":20 - * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "volume_container.pxd":31 * - */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): + * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): */ - __pyx_r = __pyx_v_i1; + __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython + /* "volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ /* function exit code */ __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 +/* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { + int __pyx_v_index[3]; + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + __Pyx_RefNannySetupContext("vc_pos_index", 0); - /* "yt/utilities/lib/fp_utils.pxd":24 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 - * + /* "volume_container.pxd":36 + * cdef int index[3] + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "volume_container.pxd":37 + * cdef int i + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< + * return vc_index(vc, index[0], index[1], index[2]) + * + */ + (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); + } + + /* "volume_container.pxd":38 + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< + * + */ + __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); + goto __pyx_L0; + + /* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * + */ + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":24 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 + * + */ + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } /* "yt/utilities/lib/fp_utils.pxd":25 * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: * if f0 > f1: return f0 * return f1 # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ __pyx_r = __pyx_v_f1; goto __pyx_L0; @@ -5955,18 +6238,18 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":28 * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -5978,7 +6261,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -5990,7 +6273,7 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ @@ -6078,7 +6361,7 @@ * if f0 < 0.0: return -f0 * return f0 # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_f0; goto __pyx_L0; @@ -6099,18 +6382,18 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":40 * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -6122,7 +6405,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -6139,7 +6422,7 @@ * if i > b: return b * return i # <<<<<<<<<<<<<< * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_i; goto __pyx_L0; @@ -6147,7 +6430,7 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -6160,18 +6443,18 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -6183,7 +6466,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -6208,7 +6491,7 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -6347,3760 +6630,3227 @@ return __pyx_r; } -/* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] - */ - -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; - - /* "vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< - * - * +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); - goto __pyx_L0; - /* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] - */ +/* 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_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double *__pyx_v_a, double *__pyx_v_b) { - double __pyx_r; +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * + * if info == NULL: return # <<<<<<<<<<<<<< * + * cdef int copy_shape, i, ndim */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); - goto __pyx_L0; + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * */ + __pyx_v_endian_detector = 1; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, 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); -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - - /* "vec3_ops.pxd":20 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "vec3_ops.pxd":21 - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "vec3_ops.pxd":22 - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ - (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + __pyx_v_copy_shape = 1; - /* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; + } - /* function exit code */ -} - -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "vec3_ops.pxd":20 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; - /* "vec3_ops.pxd":21 - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } - /* "vec3_ops.pxd":22 - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") * */ - (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ + if (__pyx_t_1) { - /* function exit code */ -} - -/* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 218, __pyx_L1_error) -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - - /* "vec3_ops.pxd":31 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); + } - /* "vec3_ops.pxd":32 - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< - * c[2] = a[2] - b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } - /* "vec3_ops.pxd":33 - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") * */ - (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; - /* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + if (__pyx_t_1) { - /* function exit code */ -} - -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "vec3_ops.pxd":31 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) */ - (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 222, __pyx_L1_error) - /* "vec3_ops.pxd":32 - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< - * c[2] = a[2] - b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); + } - /* "vec3_ops.pxd":33 - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ - (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ + __pyx_v_info->ndim = __pyx_v_ndim; - /* function exit code */ -} - -/* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; - - /* "vec3_ops.pxd":41 - * cdef inline cython.floating distance(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - __pyx_r = sqrt(((powf(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + powf(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + powf(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); - goto __pyx_L0; + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(double *__pyx_v_a, double *__pyx_v_b) { - double __pyx_r; - - /* "vec3_ops.pxd":41 - * cdef inline cython.floating distance(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ - __pyx_r = sqrt(((pow(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + pow(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + pow(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); - goto __pyx_L0; + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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]); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } -/* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ + goto __pyx_L11; + } -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(float const __pyx_v_f, float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * 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)); - /* "vec3_ops.pxd":51 - * const cython.floating[3] b, - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) */ - (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L11:; - /* "vec3_ops.pxd":52 - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< - * c[2] = f * a[2] + b[2] - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); + __pyx_v_info->suboffsets = NULL; - /* "vec3_ops.pxd":53 - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * */ - (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * 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)); - /* function exit code */ -} - -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const __pyx_v_f, double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "vec3_ops.pxd":51 - * const cython.floating[3] b, - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ - (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); + __pyx_v_f = NULL; - /* "vec3_ops.pxd":52 - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< - * c[2] = f * a[2] + b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * */ - (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); + __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; - /* "vec3_ops.pxd":53 - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< * + * if not hasfields and not copy_shape: */ - (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { - /* function exit code */ -} - -/* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(float *__pyx_v_a) { - float __pyx_r; - - /* "vec3_ops.pxd":60 - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - __pyx_r = sqrt(((((__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; + goto __pyx_L14; + } - /* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: */ + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L14:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *__pyx_v_a) { - double __pyx_r; - - /* "vec3_ops.pxd":60 - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_r = sqrt(((((__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; + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { - /* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "field_interpolation_tables.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void FIT_initialize_table(FieldInterpolationTable *fit, int nbins, # <<<<<<<<<<<<<< - * np.float64_t *values, np.float64_t bounds1, np.float64_t bounds2, - * int field_id, int weight_field_id, int weight_table_id) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_initialize_table(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fit, int __pyx_v_nbins, __pyx_t_5numpy_float64_t *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_bounds1, __pyx_t_5numpy_float64_t __pyx_v_bounds2, int __pyx_v_field_id, int __pyx_v_weight_field_id, int __pyx_v_weight_table_id) { - int __pyx_v_i; - long __pyx_t_1; - int __pyx_t_2; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* "field_interpolation_tables.pxd":43 - * int field_id, int weight_field_id, int weight_table_id) nogil: - * cdef int i - * fit.bounds[0] = bounds1; fit.bounds[1] = bounds2 # <<<<<<<<<<<<<< - * fit.nbins = nbins - * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - (__pyx_v_fit->bounds[0]) = __pyx_v_bounds1; - (__pyx_v_fit->bounds[1]) = __pyx_v_bounds2; + if (__pyx_t_1) { - /* "field_interpolation_tables.pxd":44 - * cdef int i - * fit.bounds[0] = bounds1; fit.bounds[1] = bounds2 - * fit.nbins = nbins # <<<<<<<<<<<<<< - * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) - * fit.idbin = 1.0/fit.dbin + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - __pyx_v_fit->nbins = __pyx_v_nbins; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 259, __pyx_L1_error) - /* "field_interpolation_tables.pxd":45 - * fit.bounds[0] = bounds1; fit.bounds[1] = bounds2 - * fit.nbins = nbins - * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) # <<<<<<<<<<<<<< - * fit.idbin = 1.0/fit.dbin - * # Better not pull this out from under us, yo + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_fit->dbin = (((__pyx_v_fit->bounds[1]) - (__pyx_v_fit->bounds[0])) / (__pyx_v_fit->nbins - 1)); + } - /* "field_interpolation_tables.pxd":46 - * fit.nbins = nbins - * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) - * fit.idbin = 1.0/fit.dbin # <<<<<<<<<<<<<< - * # Better not pull this out from under us, yo - * fit.values = values + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - __pyx_v_fit->idbin = (1.0 / __pyx_v_fit->dbin); + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "field_interpolation_tables.pxd":48 - * fit.idbin = 1.0/fit.dbin - * # Better not pull this out from under us, yo - * fit.values = values # <<<<<<<<<<<<<< - * fit.d0 = malloc(sizeof(np.float64_t) * nbins) - * fit.dy = malloc(sizeof(np.float64_t) * nbins) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - __pyx_v_fit->values = __pyx_v_values; + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "field_interpolation_tables.pxd":49 - * # Better not pull this out from under us, yo - * fit.values = values - * fit.d0 = malloc(sizeof(np.float64_t) * nbins) # <<<<<<<<<<<<<< - * fit.dy = malloc(sizeof(np.float64_t) * nbins) - * for i in range(nbins-1): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - __pyx_v_fit->d0 = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_nbins))); + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "field_interpolation_tables.pxd":50 - * fit.values = values - * fit.d0 = malloc(sizeof(np.float64_t) * nbins) - * fit.dy = malloc(sizeof(np.float64_t) * nbins) # <<<<<<<<<<<<<< - * for i in range(nbins-1): - * fit.d0[i] = fit.bounds[0] + i * fit.dbin + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - __pyx_v_fit->dy = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_nbins))); + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "field_interpolation_tables.pxd":51 - * fit.d0 = malloc(sizeof(np.float64_t) * nbins) - * fit.dy = malloc(sizeof(np.float64_t) * nbins) - * for i in range(nbins-1): # <<<<<<<<<<<<<< - * fit.d0[i] = fit.bounds[0] + i * fit.dbin - * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ - __pyx_t_1 = (__pyx_v_nbins - 1); - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "field_interpolation_tables.pxd":52 - * fit.dy = malloc(sizeof(np.float64_t) * nbins) - * for i in range(nbins-1): - * fit.d0[i] = fit.bounds[0] + i * fit.dbin # <<<<<<<<<<<<<< - * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin - * fit.field_id = field_id + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ - (__pyx_v_fit->d0[__pyx_v_i]) = ((__pyx_v_fit->bounds[0]) + (__pyx_v_i * __pyx_v_fit->dbin)); + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* "field_interpolation_tables.pxd":53 - * for i in range(nbins-1): - * fit.d0[i] = fit.bounds[0] + i * fit.dbin - * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin # <<<<<<<<<<<<<< - * fit.field_id = field_id - * fit.weight_field_id = weight_field_id + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ - (__pyx_v_fit->dy[__pyx_v_i]) = (((__pyx_v_fit->values[(__pyx_v_i + 1)]) - (__pyx_v_fit->values[__pyx_v_i])) * __pyx_v_fit->idbin); - } + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; - /* "field_interpolation_tables.pxd":54 - * fit.d0[i] = fit.bounds[0] + i * fit.dbin - * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin - * fit.field_id = field_id # <<<<<<<<<<<<<< - * fit.weight_field_id = weight_field_id - * fit.weight_table_id = weight_table_id + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - __pyx_v_fit->field_id = __pyx_v_field_id; + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "field_interpolation_tables.pxd":55 - * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin - * fit.field_id = field_id - * fit.weight_field_id = weight_field_id # <<<<<<<<<<<<<< - * fit.weight_table_id = weight_table_id - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - __pyx_v_fit->weight_field_id = __pyx_v_weight_field_id; + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "field_interpolation_tables.pxd":56 - * fit.field_id = field_id - * fit.weight_field_id = weight_field_id - * fit.weight_table_id = weight_table_id # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ - __pyx_v_fit->weight_table_id = __pyx_v_weight_table_id; + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* "field_interpolation_tables.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void FIT_initialize_table(FieldInterpolationTable *fit, int nbins, # <<<<<<<<<<<<<< - * np.float64_t *values, np.float64_t bounds1, np.float64_t bounds2, - * int field_id, int weight_field_id, int weight_table_id) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* function exit code */ -} - -/* "field_interpolation_tables.pxd":61 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline np.float64_t FIT_get_value(FieldInterpolationTable *fit, # <<<<<<<<<<<<<< - * np.float64_t dvs[6]) nogil: - * cdef np.float64_t dd, dout + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fit, __pyx_t_5numpy_float64_t *__pyx_v_dvs) { - __pyx_t_5numpy_float64_t __pyx_v_dd; - __pyx_t_5numpy_float64_t __pyx_v_dout; - int __pyx_v_bin_id; - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - - /* "field_interpolation_tables.pxd":65 - * cdef np.float64_t dd, dout - * cdef int bin_id - * if dvs[fit.field_id] >= fit.bounds[1] or dvs[fit.field_id] <= fit.bounds[0]: return 0.0 # <<<<<<<<<<<<<< - * if not isnormal(dvs[fit.field_id]): return 0.0 - * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_t_2 = (((__pyx_v_dvs[__pyx_v_fit->field_id]) >= (__pyx_v_fit->bounds[1])) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (((__pyx_v_dvs[__pyx_v_fit->field_id]) <= (__pyx_v_fit->bounds[0])) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; - if (__pyx_t_1) { - __pyx_r = 0.0; - goto __pyx_L0; - } + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "field_interpolation_tables.pxd":66 - * cdef int bin_id - * if dvs[fit.field_id] >= fit.bounds[1] or dvs[fit.field_id] <= fit.bounds[0]: return 0.0 - * if not isnormal(dvs[fit.field_id]): return 0.0 # <<<<<<<<<<<<<< - * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) - * bin_id = iclip(bin_id, 0, fit.nbins-2) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - __pyx_t_1 = ((!(isnormal((__pyx_v_dvs[__pyx_v_fit->field_id])) != 0)) != 0); - if (__pyx_t_1) { - __pyx_r = 0.0; - goto __pyx_L0; - } + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "field_interpolation_tables.pxd":67 - * if dvs[fit.field_id] >= fit.bounds[1] or dvs[fit.field_id] <= fit.bounds[0]: return 0.0 - * if not isnormal(dvs[fit.field_id]): return 0.0 - * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) # <<<<<<<<<<<<<< - * bin_id = iclip(bin_id, 0, fit.nbins-2) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ - __pyx_v_bin_id = ((int)(((__pyx_v_dvs[__pyx_v_fit->field_id]) - (__pyx_v_fit->bounds[0])) * __pyx_v_fit->idbin)); + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "field_interpolation_tables.pxd":68 - * if not isnormal(dvs[fit.field_id]): return 0.0 - * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) - * bin_id = iclip(bin_id, 0, fit.nbins-2) # <<<<<<<<<<<<<< - * - * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - __pyx_v_bin_id = __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_v_bin_id, 0, (__pyx_v_fit->nbins - 2)); + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "field_interpolation_tables.pxd":70 - * bin_id = iclip(bin_id, 0, fit.nbins-2) - * - * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 # <<<<<<<<<<<<<< - * dout = fit.values[bin_id] + dd * fit.dy[bin_id] - * if fit.weight_field_id != -1: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_v_dd = ((__pyx_v_dvs[__pyx_v_fit->field_id]) - (__pyx_v_fit->d0[__pyx_v_bin_id])); + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: - /* "field_interpolation_tables.pxd":71 - * - * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 - * dout = fit.values[bin_id] + dd * fit.dy[bin_id] # <<<<<<<<<<<<<< - * if fit.weight_field_id != -1: - * dout *= dvs[fit.weight_field_id] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return */ - __pyx_v_dout = ((__pyx_v_fit->values[__pyx_v_bin_id]) + (__pyx_v_dd * (__pyx_v_fit->dy[__pyx_v_bin_id]))); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 278, __pyx_L1_error) + break; + } - /* "field_interpolation_tables.pxd":72 - * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 - * dout = fit.values[bin_id] + dd * fit.dy[bin_id] - * if fit.weight_field_id != -1: # <<<<<<<<<<<<<< - * dout *= dvs[fit.weight_field_id] - * return dout + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: */ - __pyx_t_1 = ((__pyx_v_fit->weight_field_id != -1L) != 0); - if (__pyx_t_1) { + __pyx_v_info->format = __pyx_v_f; - /* "field_interpolation_tables.pxd":73 - * dout = fit.values[bin_id] + dd * fit.dy[bin_id] - * if fit.weight_field_id != -1: - * dout *= dvs[fit.weight_field_id] # <<<<<<<<<<<<<< - * return dout - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) */ - __pyx_v_dout = (__pyx_v_dout * (__pyx_v_dvs[__pyx_v_fit->weight_field_id])); + __pyx_r = 0; + goto __pyx_L0; - /* "field_interpolation_tables.pxd":72 - * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 - * dout = fit.values[bin_id] + dd * fit.dy[bin_id] - * if fit.weight_field_id != -1: # <<<<<<<<<<<<<< - * dout *= dvs[fit.weight_field_id] - * return dout + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ } - /* "field_interpolation_tables.pxd":74 - * if fit.weight_field_id != -1: - * dout *= dvs[fit.weight_field_id] - * return dout # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + */ + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< * - * @cython.boundscheck(False) + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - __pyx_r = __pyx_v_dout; - goto __pyx_L0; + (__pyx_v_f[0]) = '\x00'; + } - /* "field_interpolation_tables.pxd":61 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline np.float64_t FIT_get_value(FieldInterpolationTable *fit, # <<<<<<<<<<<<<< - * np.float64_t dvs[6]) nogil: - * cdef np.float64_t dd, dout + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "field_interpolation_tables.pxd":79 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void FIT_eval_transfer(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< - * np.float64_t *rgba, int n_fits, - * FieldInterpolationTable fits[6], +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_eval_transfer(__pyx_t_5numpy_float64_t __pyx_v_dt, __pyx_t_5numpy_float64_t *__pyx_v_dvs, __pyx_t_5numpy_float64_t *__pyx_v_rgba, int __pyx_v_n_fits, struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fits, int *__pyx_v_field_table_ids, int __pyx_v_grey_opacity) { - int __pyx_v_i; - int __pyx_v_fid; - __pyx_t_5numpy_float64_t __pyx_v_ta; - __pyx_t_5numpy_float64_t __pyx_v_istorage[6]; - __pyx_t_5numpy_float64_t __pyx_v_trgba[6]; +/* 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; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "field_interpolation_tables.pxd":87 - * cdef np.float64_t istorage[6] - * cdef np.float64_t trgba[6] - * for i in range(6): istorage[i] = 0.0 # <<<<<<<<<<<<<< - * for i in range(n_fits): - * istorage[i] = FIT_get_value(&fits[i], dvs) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - (__pyx_v_istorage[__pyx_v_i]) = 0.0; - } + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { - /* "field_interpolation_tables.pxd":88 - * cdef np.float64_t trgba[6] - * for i in range(6): istorage[i] = 0.0 - * for i in range(n_fits): # <<<<<<<<<<<<<< - * istorage[i] = FIT_get_value(&fits[i], dvs) - * for i in range(n_fits): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) */ - __pyx_t_1 = __pyx_v_n_fits; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + free(__pyx_v_info->format); - /* "field_interpolation_tables.pxd":89 - * for i in range(6): istorage[i] = 0.0 - * for i in range(n_fits): - * istorage[i] = FIT_get_value(&fits[i], dvs) # <<<<<<<<<<<<<< - * for i in range(n_fits): - * fid = fits[i].weight_table_id + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - (__pyx_v_istorage[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value((&(__pyx_v_fits[__pyx_v_i])), __pyx_v_dvs); } - /* "field_interpolation_tables.pxd":90 - * for i in range(n_fits): - * istorage[i] = FIT_get_value(&fits[i], dvs) - * for i in range(n_fits): # <<<<<<<<<<<<<< - * fid = fits[i].weight_table_id - * if fid != -1: istorage[i] *= istorage[fid] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - __pyx_t_1 = __pyx_v_n_fits; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "field_interpolation_tables.pxd":91 - * istorage[i] = FIT_get_value(&fits[i], dvs) - * for i in range(n_fits): - * fid = fits[i].weight_table_id # <<<<<<<<<<<<<< - * if fid != -1: istorage[i] *= istorage[fid] - * for i in range(6): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * */ - __pyx_t_3 = (__pyx_v_fits[__pyx_v_i]).weight_table_id; - __pyx_v_fid = __pyx_t_3; + free(__pyx_v_info->strides); - /* "field_interpolation_tables.pxd":92 - * for i in range(n_fits): - * fid = fits[i].weight_table_id - * if fid != -1: istorage[i] *= istorage[fid] # <<<<<<<<<<<<<< - * for i in range(6): - * trgba[i] = istorage[field_table_ids[i]] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - __pyx_t_4 = ((__pyx_v_fid != -1L) != 0); - if (__pyx_t_4) { - __pyx_t_3 = __pyx_v_i; - (__pyx_v_istorage[__pyx_t_3]) = ((__pyx_v_istorage[__pyx_t_3]) * (__pyx_v_istorage[__pyx_v_fid])); - } } - /* "field_interpolation_tables.pxd":93 - * fid = fits[i].weight_table_id - * if fid != -1: istorage[i] *= istorage[fid] - * for i in range(6): # <<<<<<<<<<<<<< - * trgba[i] = istorage[field_table_ids[i]] - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - /* "field_interpolation_tables.pxd":94 - * if fid != -1: istorage[i] *= istorage[fid] - * for i in range(6): - * trgba[i] = istorage[field_table_ids[i]] # <<<<<<<<<<<<<< + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) * - * if grey_opacity == 1: */ - (__pyx_v_trgba[__pyx_v_i]) = (__pyx_v_istorage[(__pyx_v_field_table_ids[__pyx_v_i])]); - } - /* "field_interpolation_tables.pxd":96 - * trgba[i] = istorage[field_table_ids[i]] +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 * - * if grey_opacity == 1: # <<<<<<<<<<<<<< - * ta = fmax(1.0 - dt*trgba[3],0.0) - * for i in range(4): + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - __pyx_t_4 = ((__pyx_v_grey_opacity == 1) != 0); - if (__pyx_t_4) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "field_interpolation_tables.pxd":97 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) * - * if grey_opacity == 1: - * ta = fmax(1.0 - dt*trgba[3],0.0) # <<<<<<<<<<<<<< - * for i in range(4): - * rgba[i] = dt*trgba[i] + ta*rgba[i] */ - __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (__pyx_v_trgba[3]))), 0.0); - /* "field_interpolation_tables.pxd":98 - * if grey_opacity == 1: - * ta = fmax(1.0 - dt*trgba[3],0.0) - * for i in range(4): # <<<<<<<<<<<<<< - * rgba[i] = dt*trgba[i] + ta*rgba[i] - * else: - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 4; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + /* 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; +} - /* "field_interpolation_tables.pxd":99 - * ta = fmax(1.0 - dt*trgba[3],0.0) - * for i in range(4): - * rgba[i] = dt*trgba[i] + ta*rgba[i] # <<<<<<<<<<<<<< - * else: - * for i in range(3): +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - (__pyx_v_rgba[__pyx_v_i]) = ((__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i])) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); - } - /* "field_interpolation_tables.pxd":96 - * trgba[i] = istorage[field_table_ids[i]] +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 * - * if grey_opacity == 1: # <<<<<<<<<<<<<< - * ta = fmax(1.0 - dt*trgba[3],0.0) - * for i in range(4): + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): */ - goto __pyx_L12; - } + __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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "field_interpolation_tables.pxd":101 - * rgba[i] = dt*trgba[i] + ta*rgba[i] - * else: - * for i in range(3): # <<<<<<<<<<<<<< - * ta = fmax(1.0-dt*trgba[i], 0.0) - * rgba[i] = dt*trgba[i] + ta*rgba[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - /*else*/ { - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - /* "field_interpolation_tables.pxd":102 - * else: - * for i in range(3): - * ta = fmax(1.0-dt*trgba[i], 0.0) # <<<<<<<<<<<<<< - * rgba[i] = dt*trgba[i] + ta*rgba[i] + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * */ - __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i]))), 0.0); - /* "field_interpolation_tables.pxd":103 - * for i in range(3): - * ta = fmax(1.0-dt*trgba[i], 0.0) - * rgba[i] = dt*trgba[i] + ta*rgba[i] # <<<<<<<<<<<<<< +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 * - * @cython.boundscheck(False) + * 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_v_rgba[__pyx_v_i]) = ((__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i])) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); - } - } - __pyx_L12:; + __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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "field_interpolation_tables.pxd":79 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void FIT_eval_transfer(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< - * np.float64_t *rgba, int n_fits, - * FieldInterpolationTable fits[6], + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * 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; } -/* "field_interpolation_tables.pxd":108 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void FIT_eval_transfer_with_light(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< - * np.float64_t *grad, np.float64_t *l_dir, np.float64_t *l_rgba, - * np.float64_t *rgba, int n_fits, +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * 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 void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_eval_transfer_with_light(__pyx_t_5numpy_float64_t __pyx_v_dt, __pyx_t_5numpy_float64_t *__pyx_v_dvs, __pyx_t_5numpy_float64_t *__pyx_v_grad, __pyx_t_5numpy_float64_t *__pyx_v_l_dir, __pyx_t_5numpy_float64_t *__pyx_v_l_rgba, __pyx_t_5numpy_float64_t *__pyx_v_rgba, int __pyx_v_n_fits, struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fits, int *__pyx_v_field_table_ids, int __pyx_v_grey_opacity) { - int __pyx_v_i; - int __pyx_v_fid; - __pyx_t_5numpy_float64_t __pyx_v_ta; - __pyx_t_5numpy_float64_t __pyx_v_dot_prod; - __pyx_t_5numpy_float64_t __pyx_v_istorage[6]; - __pyx_t_5numpy_float64_t __pyx_v_trgba[6]; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - - /* "field_interpolation_tables.pxd":117 - * cdef np.float64_t istorage[6] - * cdef np.float64_t trgba[6] - * dot_prod = 0.0 # <<<<<<<<<<<<<< - * for i in range(3): - * dot_prod += l_dir[i]*grad[i] - */ - __pyx_v_dot_prod = 0.0; +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); - /* "field_interpolation_tables.pxd":118 - * cdef np.float64_t trgba[6] - * dot_prod = 0.0 - * for i in range(3): # <<<<<<<<<<<<<< - * dot_prod += l_dir[i]*grad[i] - * #dot_prod = fmax(0.0, dot_prod) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * 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): */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + __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, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "field_interpolation_tables.pxd":119 - * dot_prod = 0.0 - * for i in range(3): - * dot_prod += l_dir[i]*grad[i] # <<<<<<<<<<<<<< - * #dot_prod = fmax(0.0, dot_prod) - * for i in range(6): istorage[i] = 0.0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - __pyx_v_dot_prod = (__pyx_v_dot_prod + ((__pyx_v_l_dir[__pyx_v_i]) * (__pyx_v_grad[__pyx_v_i]))); - } - /* "field_interpolation_tables.pxd":121 - * dot_prod += l_dir[i]*grad[i] - * #dot_prod = fmax(0.0, dot_prod) - * for i in range(6): istorage[i] = 0.0 # <<<<<<<<<<<<<< - * for i in range(n_fits): - * istorage[i] = FIT_get_value(&fits[i], dvs) - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - (__pyx_v_istorage[__pyx_v_i]) = 0.0; - } + /* 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; +} - /* "field_interpolation_tables.pxd":122 - * #dot_prod = fmax(0.0, dot_prod) - * for i in range(6): istorage[i] = 0.0 - * for i in range(n_fits): # <<<<<<<<<<<<<< - * istorage[i] = FIT_get_value(&fits[i], dvs) - * for i in range(n_fits): +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) + * */ - __pyx_t_1 = __pyx_v_n_fits; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; - /* "field_interpolation_tables.pxd":123 - * for i in range(6): istorage[i] = 0.0 - * for i in range(n_fits): - * istorage[i] = FIT_get_value(&fits[i], dvs) # <<<<<<<<<<<<<< - * for i in range(n_fits): - * fid = fits[i].weight_table_id - */ - (__pyx_v_istorage[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value((&(__pyx_v_fits[__pyx_v_i])), __pyx_v_dvs); - } +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); - /* "field_interpolation_tables.pxd":124 - * for i in range(n_fits): - * istorage[i] = FIT_get_value(&fits[i], dvs) - * for i in range(n_fits): # <<<<<<<<<<<<<< - * fid = fits[i].weight_table_id - * if fid != -1: istorage[i] *= istorage[fid] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - __pyx_t_1 = __pyx_v_n_fits; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + __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, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "field_interpolation_tables.pxd":125 - * istorage[i] = FIT_get_value(&fits[i], dvs) - * for i in range(n_fits): - * fid = fits[i].weight_table_id # <<<<<<<<<<<<<< - * if fid != -1: istorage[i] *= istorage[fid] - * for i in range(6): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) + * */ - __pyx_t_3 = (__pyx_v_fits[__pyx_v_i]).weight_table_id; - __pyx_v_fid = __pyx_t_3; - /* "field_interpolation_tables.pxd":126 - * for i in range(n_fits): - * fid = fits[i].weight_table_id - * if fid != -1: istorage[i] *= istorage[fid] # <<<<<<<<<<<<<< - * for i in range(6): - * trgba[i] = istorage[field_table_ids[i]] - */ - __pyx_t_4 = ((__pyx_v_fid != -1L) != 0); - if (__pyx_t_4) { - __pyx_t_3 = __pyx_v_i; - (__pyx_v_istorage[__pyx_t_3]) = ((__pyx_v_istorage[__pyx_t_3]) * (__pyx_v_istorage[__pyx_v_fid])); - } - } + /* 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; +} - /* "field_interpolation_tables.pxd":127 - * fid = fits[i].weight_table_id - * if fid != -1: istorage[i] *= istorage[fid] - * for i in range(6): # <<<<<<<<<<<<<< - * trgba[i] = istorage[field_table_ids[i]] - * if grey_opacity == 1: +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ - for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - /* "field_interpolation_tables.pxd":128 - * if fid != -1: istorage[i] *= istorage[fid] - * for i in range(6): - * trgba[i] = istorage[field_table_ids[i]] # <<<<<<<<<<<<<< - * if grey_opacity == 1: - * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) - */ - (__pyx_v_trgba[__pyx_v_i]) = (__pyx_v_istorage[(__pyx_v_field_table_ids[__pyx_v_i])]); - } +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); - /* "field_interpolation_tables.pxd":129 - * for i in range(6): - * trgba[i] = istorage[field_table_ids[i]] - * if grey_opacity == 1: # <<<<<<<<<<<<<< - * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) - * for i in range(3): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ - __pyx_t_4 = ((__pyx_v_grey_opacity == 1) != 0); - if (__pyx_t_4) { + __pyx_v_endian_detector = 1; - /* "field_interpolation_tables.pxd":130 - * trgba[i] = istorage[field_table_ids[i]] - * if grey_opacity == 1: - * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) # <<<<<<<<<<<<<< - * for i in range(3): - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * */ - __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (((__pyx_v_trgba[0]) + (__pyx_v_trgba[1])) + (__pyx_v_trgba[2])))), 0.0); + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "field_interpolation_tables.pxd":131 - * if grey_opacity == 1: - * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) - * for i in range(3): # <<<<<<<<<<<<<< - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(1, 794, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; - /* "field_interpolation_tables.pxd":132 - * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) - * for i in range(3): - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] # <<<<<<<<<<<<<< - * else: - * for i in range(3): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * */ - (__pyx_v_rgba[__pyx_v_i]) = ((((1. - __pyx_v_ta) * (__pyx_v_trgba[__pyx_v_i])) * (1. + (__pyx_v_dot_prod * (__pyx_v_l_rgba[__pyx_v_i])))) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 795, __pyx_L1_error) } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* "field_interpolation_tables.pxd":129 - * for i in range(6): - * trgba[i] = istorage[field_table_ids[i]] - * if grey_opacity == 1: # <<<<<<<<<<<<<< - * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) - * for i in range(3): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: */ - goto __pyx_L14; - } - - /* "field_interpolation_tables.pxd":134 - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] - * else: - * for i in range(3): # <<<<<<<<<<<<<< - * ta = fmax(1.0-dt*trgba[i], 0.0) - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] - */ - /*else*/ { - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; - /* "field_interpolation_tables.pxd":135 - * else: - * for i in range(3): - * ta = fmax(1.0-dt*trgba[i], 0.0) # <<<<<<<<<<<<<< - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - */ - __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i]))), 0.0); - - /* "field_interpolation_tables.pxd":136 - * for i in range(3): - * ta = fmax(1.0-dt*trgba[i], 0.0) - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] # <<<<<<<<<<<<<< + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - (__pyx_v_rgba[__pyx_v_i]) = ((((1. - __pyx_v_ta) * (__pyx_v_trgba[__pyx_v_i])) * (1. + (__pyx_v_dot_prod * (__pyx_v_l_rgba[__pyx_v_i])))) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); - } - } - __pyx_L14:; - - /* "field_interpolation_tables.pxd":108 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void FIT_eval_transfer_with_light(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< - * np.float64_t *grad, np.float64_t *l_dir, np.float64_t *l_rgba, - * np.float64_t *rgba, int n_fits, - */ - - /* function exit code */ -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * - * if info == NULL: return # <<<<<<<<<<<<<< + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * - * cdef int copy_shape, i, ndim + * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 799, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_v_endian_detector = 1; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * ndim = PyArray_NDIM(self) + * 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_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * 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_v_ndim = PyArray_NDIM(__pyx_v_self); + __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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + * 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_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply */ - __pyx_v_copy_shape = 1; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 803, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - goto __pyx_L4; - } + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } + (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 * */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< * - * 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") + * offset[0] += child.itemsize */ - if (__pyx_t_1) { + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 * - * 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, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + * offset[0] += child.itemsize # <<<<<<<<<<<<<< * - * 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 not PyDataType_HASFIELDS(child): */ - } + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * - * 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 not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") */ - if (__pyx_t_1) { + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * - * info.buf = PyArray_DATA(self) + * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 823, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") */ - } + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: + * # 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_v_info->buf = PyArray_DATA(__pyx_v_self); + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_v_info->ndim = __pyx_v_ndim; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * 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: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - goto __pyx_L11; - } + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_v_info->suboffsets = NULL; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_v_f = NULL; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset - * + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: */ - __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { + /*else*/ { + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 844, __pyx_L1_error) + } + __pyx_L15:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 * else: - * # need to call releasebuffer + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - goto __pyx_L14; - } + goto __pyx_L13; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f * - * if not hasfields: */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + __pyx_r = __pyx_v_f; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - } + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; + __pyx_v_baseptr = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; + /*else*/ { + Py_INCREF(__pyx_v_base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; + Py_XDECREF(__pyx_v_arr->base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; + __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + * + * */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_v_info->format = __pyx_v_f; + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __pyx_r = 0; - goto __pyx_L0; + } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, */ - __pyx_v_offset = 0; + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - (__pyx_v_f[0]) = '\x00'; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -/* 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) { +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - free(__pyx_v_info->format); + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * 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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * + * cdef inline int import_ufunc() except -1: */ - free(__pyx_v_info->strides); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { - PyObject *__pyx_r = NULL; +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * cdef inline object PyArray_MultiIterNew2(a, b): + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * 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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * +/* "field_interpolation_tables.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void FIT_initialize_table(FieldInterpolationTable *fit, int nbins, # <<<<<<<<<<<<<< + * np.float64_t *values, np.float64_t bounds1, np.float64_t bounds2, + * int field_id, int weight_field_id, int weight_table_id) nogil: */ -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * 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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; +static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_initialize_table(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fit, int __pyx_v_nbins, __pyx_t_5numpy_float64_t *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_bounds1, __pyx_t_5numpy_float64_t __pyx_v_bounds2, int __pyx_v_field_id, int __pyx_v_weight_field_id, int __pyx_v_weight_table_id) { + int __pyx_v_i; + long __pyx_t_1; + int __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * + /* "field_interpolation_tables.pxd":43 + * int field_id, int weight_field_id, int weight_table_id) nogil: + * cdef int i + * fit.bounds[0] = bounds1; fit.bounds[1] = bounds2 # <<<<<<<<<<<<<< + * fit.nbins = nbins + * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) */ + (__pyx_v_fit->bounds[0]) = __pyx_v_bounds1; + (__pyx_v_fit->bounds[1]) = __pyx_v_bounds2; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) - * + /* "field_interpolation_tables.pxd":44 + * cdef int i + * fit.bounds[0] = bounds1; fit.bounds[1] = bounds2 + * fit.nbins = nbins # <<<<<<<<<<<<<< + * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) + * fit.idbin = 1.0/fit.dbin */ + __pyx_v_fit->nbins = __pyx_v_nbins; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + /* "field_interpolation_tables.pxd":45 + * fit.bounds[0] = bounds1; fit.bounds[1] = bounds2 + * fit.nbins = nbins + * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) # <<<<<<<<<<<<<< + * fit.idbin = 1.0/fit.dbin + * # Better not pull this out from under us, yo */ - __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, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_v_fit->dbin = (((__pyx_v_fit->bounds[1]) - (__pyx_v_fit->bounds[0])) / (__pyx_v_fit->nbins - 1)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) - * + /* "field_interpolation_tables.pxd":46 + * fit.nbins = nbins + * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) + * fit.idbin = 1.0/fit.dbin # <<<<<<<<<<<<<< + * # Better not pull this out from under us, yo + * fit.values = values */ + __pyx_v_fit->idbin = (1.0 / __pyx_v_fit->dbin); - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. + /* "field_interpolation_tables.pxd":48 + * fit.idbin = 1.0/fit.dbin + * # Better not pull this out from under us, yo + * fit.values = values # <<<<<<<<<<<<<< + * fit.d0 = malloc(sizeof(np.float64_t) * nbins) + * fit.dy = malloc(sizeof(np.float64_t) * nbins) */ + __pyx_v_fit->values = __pyx_v_values; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * 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, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: - */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); - if (!__pyx_t_7) { - goto __pyx_L8_next_or; - } else { - } - __pyx_t_7 = (__pyx_v_little_endian != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_L8_next_or:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 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:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 - */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 0x78; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; + /* "field_interpolation_tables.pxd":49 + * # Better not pull this out from under us, yo + * fit.values = values + * fit.d0 = malloc(sizeof(np.float64_t) * nbins) # <<<<<<<<<<<<<< + * fit.dy = malloc(sizeof(np.float64_t) * nbins) + * for i in range(nbins-1): + */ + __pyx_v_fit->d0 = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_nbins))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), + /* "field_interpolation_tables.pxd":50 + * fit.values = values + * fit.d0 = malloc(sizeof(np.float64_t) * nbins) + * fit.dy = malloc(sizeof(np.float64_t) * nbins) # <<<<<<<<<<<<<< + * for i in range(nbins-1): + * fit.d0[i] = fit.bounds[0] + i * fit.dbin */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_fit->dy = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_nbins))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + /* "field_interpolation_tables.pxd":51 + * fit.d0 = malloc(sizeof(np.float64_t) * nbins) + * fit.dy = malloc(sizeof(np.float64_t) * nbins) + * for i in range(nbins-1): # <<<<<<<<<<<<<< + * fit.d0[i] = fit.bounds[0] + i * fit.dbin + * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin */ - goto __pyx_L13; - } + __pyx_t_1 = (__pyx_v_nbins - 1); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * + /* "field_interpolation_tables.pxd":52 + * fit.dy = malloc(sizeof(np.float64_t) * nbins) + * for i in range(nbins-1): + * fit.d0[i] = fit.bounds[0] + i * fit.dbin # <<<<<<<<<<<<<< + * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin + * fit.field_id = field_id */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; + (__pyx_v_fit->d0[__pyx_v_i]) = ((__pyx_v_fit->bounds[0]) + (__pyx_v_i * __pyx_v_fit->dbin)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + /* "field_interpolation_tables.pxd":53 + * for i in range(nbins-1): + * fit.d0[i] = fit.bounds[0] + i * fit.dbin + * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin # <<<<<<<<<<<<<< + * fit.field_id = field_id + * fit.weight_field_id = weight_field_id */ + (__pyx_v_fit->dy[__pyx_v_i]) = (((__pyx_v_fit->values[(__pyx_v_i + 1)]) - (__pyx_v_fit->values[__pyx_v_i])) * __pyx_v_fit->idbin); } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * + /* "field_interpolation_tables.pxd":54 + * fit.d0[i] = fit.bounds[0] + i * fit.dbin + * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin + * fit.field_id = field_id # <<<<<<<<<<<<<< + * fit.weight_field_id = weight_field_id + * fit.weight_table_id = weight_table_id + */ + __pyx_v_fit->field_id = __pyx_v_field_id; + + /* "field_interpolation_tables.pxd":55 + * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin + * fit.field_id = field_id + * fit.weight_field_id = weight_field_id # <<<<<<<<<<<<<< + * fit.weight_table_id = weight_table_id * */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; + __pyx_v_fit->weight_field_id = __pyx_v_weight_field_id; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "field_interpolation_tables.pxd":56 + * fit.field_id = field_id + * fit.weight_field_id = weight_field_id + * fit.weight_table_id = weight_table_id # <<<<<<<<<<<<<< * - * 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. + * @cython.boundscheck(False) + */ + __pyx_v_fit->weight_table_id = __pyx_v_weight_table_id; + + /* "field_interpolation_tables.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void FIT_initialize_table(FieldInterpolationTable *fit, int nbins, # <<<<<<<<<<<<<< + * np.float64_t *values, np.float64_t bounds1, np.float64_t bounds2, + * int field_id, int weight_field_id, int weight_table_id) nogil: */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: +/* "field_interpolation_tables.pxd":61 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline np.float64_t FIT_get_value(FieldInterpolationTable *fit, # <<<<<<<<<<<<<< + * np.float64_t dvs[6]) nogil: + * cdef np.float64_t dd, dout */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fit, __pyx_t_5numpy_float64_t *__pyx_v_dvs) { + __pyx_t_5numpy_float64_t __pyx_v_dd; + __pyx_t_5numpy_float64_t __pyx_v_dout; + int __pyx_v_bin_id; + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! - */ - __pyx_v_baseptr = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "field_interpolation_tables.pxd":65 + * cdef np.float64_t dd, dout + * cdef int bin_id + * if dvs[fit.field_id] >= fit.bounds[1] or dvs[fit.field_id] <= fit.bounds[0]: return 0.0 # <<<<<<<<<<<<<< + * if not isnormal(dvs[fit.field_id]): return 0.0 + * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) */ - goto __pyx_L3; + __pyx_t_2 = (((__pyx_v_dvs[__pyx_v_fit->field_id]) >= (__pyx_v_fit->bounds[1])) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * 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_t_2 = (((__pyx_v_dvs[__pyx_v_fit->field_id]) <= (__pyx_v_fit->bounds[0])) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + __pyx_r = 0.0; + goto __pyx_L0; } - __pyx_L3:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * 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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): + /* "field_interpolation_tables.pxd":66 + * cdef int bin_id + * if dvs[fit.field_id] >= fit.bounds[1] or dvs[fit.field_id] <= fit.bounds[0]: return 0.0 + * if not isnormal(dvs[fit.field_id]): return 0.0 # <<<<<<<<<<<<<< + * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) + * bin_id = iclip(bin_id, 0, fit.nbins-2) */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_t_1 = ((!(isnormal((__pyx_v_dvs[__pyx_v_fit->field_id])) != 0)) != 0); + if (__pyx_t_1) { + __pyx_r = 0.0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * + /* "field_interpolation_tables.pxd":67 + * if dvs[fit.field_id] >= fit.bounds[1] or dvs[fit.field_id] <= fit.bounds[0]: return 0.0 + * if not isnormal(dvs[fit.field_id]): return 0.0 + * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) # <<<<<<<<<<<<<< + * bin_id = iclip(bin_id, 0, fit.nbins-2) * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: */ + __pyx_v_bin_id = ((int)(((__pyx_v_dvs[__pyx_v_fit->field_id]) - (__pyx_v_fit->bounds[0])) * __pyx_v_fit->idbin)); - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "field_interpolation_tables.pxd":68 + * if not isnormal(dvs[fit.field_id]): return 0.0 + * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) + * bin_id = iclip(bin_id, 0, fit.nbins-2) # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 */ + __pyx_v_bin_id = __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_v_bin_id, 0, (__pyx_v_fit->nbins - 2)); -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); + /* "field_interpolation_tables.pxd":70 + * bin_id = iclip(bin_id, 0, fit.nbins-2) + * + * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 # <<<<<<<<<<<<<< + * dout = fit.values[bin_id] + dd * fit.dy[bin_id] + * if fit.weight_field_id != -1: + */ + __pyx_v_dd = ((__pyx_v_dvs[__pyx_v_fit->field_id]) - (__pyx_v_fit->d0[__pyx_v_bin_id])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "field_interpolation_tables.pxd":71 * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: + * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 + * dout = fit.values[bin_id] + dd * fit.dy[bin_id] # <<<<<<<<<<<<<< + * if fit.weight_field_id != -1: + * dout *= dvs[fit.weight_field_id] */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { + __pyx_v_dout = ((__pyx_v_fit->values[__pyx_v_bin_id]) + (__pyx_v_dd * (__pyx_v_fit->dy[__pyx_v_bin_id]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base + /* "field_interpolation_tables.pxd":72 + * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 + * dout = fit.values[bin_id] + dd * fit.dy[bin_id] + * if fit.weight_field_id != -1: # <<<<<<<<<<<<<< + * dout *= dvs[fit.weight_field_id] + * return dout */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + __pyx_t_1 = ((__pyx_v_fit->weight_field_id != -1L) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "field_interpolation_tables.pxd":73 + * dout = fit.values[bin_id] + dd * fit.dy[bin_id] + * if fit.weight_field_id != -1: + * dout *= dvs[fit.weight_field_id] # <<<<<<<<<<<<<< + * return dout * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: */ - } + __pyx_v_dout = (__pyx_v_dout * (__pyx_v_dvs[__pyx_v_fit->weight_field_id])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - * - * + /* "field_interpolation_tables.pxd":72 + * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 + * dout = fit.values[bin_id] + dd * fit.dy[bin_id] + * if fit.weight_field_id != -1: # <<<<<<<<<<<<<< + * dout *= dvs[fit.weight_field_id] + * return dout */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "field_interpolation_tables.pxd":74 + * if fit.weight_field_id != -1: + * dout *= dvs[fit.weight_field_id] + * return dout # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * @cython.boundscheck(False) + */ + __pyx_r = __pyx_v_dout; + goto __pyx_L0; + + /* "field_interpolation_tables.pxd":61 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline np.float64_t FIT_get_value(FieldInterpolationTable *fit, # <<<<<<<<<<<<<< + * np.float64_t dvs[6]) nogil: + * cdef np.float64_t dd, dout */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() +/* "field_interpolation_tables.pxd":79 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void FIT_eval_transfer(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< + * np.float64_t *rgba, int n_fits, + * FieldInterpolationTable fits[6], */ -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; +static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_eval_transfer(__pyx_t_5numpy_float64_t __pyx_v_dt, __pyx_t_5numpy_float64_t *__pyx_v_dvs, __pyx_t_5numpy_float64_t *__pyx_v_rgba, int __pyx_v_n_fits, struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fits, int *__pyx_v_field_table_ids, int __pyx_v_grey_opacity) { + int __pyx_v_i; + int __pyx_v_fid; + __pyx_t_5numpy_float64_t __pyx_v_ta; + __pyx_t_5numpy_float64_t __pyx_v_istorage[6]; + __pyx_t_5numpy_float64_t __pyx_v_trgba[6]; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "field_interpolation_tables.pxd":87 + * cdef np.float64_t istorage[6] + * cdef np.float64_t trgba[6] + * for i in range(6): istorage[i] = 0.0 # <<<<<<<<<<<<<< + * for i in range(n_fits): + * istorage[i] = FIT_get_value(&fits[i], dvs) */ - { - __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:*/ { + for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + (__pyx_v_istorage[__pyx_v_i]) = 0.0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") + /* "field_interpolation_tables.pxd":88 + * cdef np.float64_t trgba[6] + * for i in range(6): istorage[i] = 0.0 + * for i in range(n_fits): # <<<<<<<<<<<<<< + * istorage[i] = FIT_get_value(&fits[i], dvs) + * for i in range(n_fits): */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_t_1 = __pyx_v_n_fits; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "field_interpolation_tables.pxd":89 + * for i in range(6): istorage[i] = 0.0 + * for i in range(n_fits): + * istorage[i] = FIT_get_value(&fits[i], dvs) # <<<<<<<<<<<<<< + * for i in range(n_fits): + * fid = fits[i].weight_table_id */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + (__pyx_v_istorage[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value((&(__pyx_v_fits[__pyx_v_i])), __pyx_v_dvs); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") - * + /* "field_interpolation_tables.pxd":90 + * for i in range(n_fits): + * istorage[i] = FIT_get_value(&fits[i], dvs) + * for i in range(n_fits): # <<<<<<<<<<<<<< + * fid = fits[i].weight_table_id + * if fid != -1: istorage[i] *= istorage[fid] */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __pyx_v_n_fits; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: + /* "field_interpolation_tables.pxd":91 + * istorage[i] = FIT_get_value(&fits[i], dvs) + * for i in range(n_fits): + * fid = fits[i].weight_table_id # <<<<<<<<<<<<<< + * if fid != -1: istorage[i] *= istorage[fid] + * for i in range(6): */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_3 = (__pyx_v_fits[__pyx_v_i]).weight_table_id; + __pyx_v_fid = __pyx_t_3; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + /* "field_interpolation_tables.pxd":92 + * for i in range(n_fits): + * fid = fits[i].weight_table_id + * if fid != -1: istorage[i] *= istorage[fid] # <<<<<<<<<<<<<< + * for i in range(6): + * trgba[i] = istorage[field_table_ids[i]] + */ + __pyx_t_4 = ((__pyx_v_fid != -1L) != 0); + if (__pyx_t_4) { + __pyx_t_3 = __pyx_v_i; + (__pyx_v_istorage[__pyx_t_3]) = ((__pyx_v_istorage[__pyx_t_3]) * (__pyx_v_istorage[__pyx_v_fid])); + } } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "field_interpolation_tables.pxd":93 + * fid = fits[i].weight_table_id + * if fid != -1: istorage[i] *= istorage[fid] + * for i in range(6): # <<<<<<<<<<<<<< + * trgba[i] = istorage[field_table_ids[i]] + * */ + for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") + /* "field_interpolation_tables.pxd":94 + * if fid != -1: istorage[i] *= istorage[fid] + * for i in range(6): + * trgba[i] = istorage[field_table_ids[i]] # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * if grey_opacity == 1: */ + (__pyx_v_trgba[__pyx_v_i]) = (__pyx_v_istorage[(__pyx_v_field_table_ids[__pyx_v_i])]); + } -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); + /* "field_interpolation_tables.pxd":96 + * trgba[i] = istorage[field_table_ids[i]] + * + * if grey_opacity == 1: # <<<<<<<<<<<<<< + * ta = fmax(1.0 - dt*trgba[3],0.0) + * for i in range(4): + */ + __pyx_t_4 = ((__pyx_v_grey_opacity == 1) != 0); + if (__pyx_t_4) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "field_interpolation_tables.pxd":97 * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * if grey_opacity == 1: + * ta = fmax(1.0 - dt*trgba[3],0.0) # <<<<<<<<<<<<<< + * for i in range(4): + * rgba[i] = dt*trgba[i] + ta*rgba[i] */ - { - __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:*/ { + __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (__pyx_v_trgba[3]))), 0.0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "field_interpolation_tables.pxd":98 + * if grey_opacity == 1: + * ta = fmax(1.0 - dt*trgba[3],0.0) + * for i in range(4): # <<<<<<<<<<<<<< + * rgba[i] = dt*trgba[i] + ta*rgba[i] + * else: */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + for (__pyx_t_1 = 0; __pyx_t_1 < 4; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "field_interpolation_tables.pxd":99 + * ta = fmax(1.0 - dt*trgba[3],0.0) + * for i in range(4): + * rgba[i] = dt*trgba[i] + ta*rgba[i] # <<<<<<<<<<<<<< + * else: + * for i in range(3): */ + (__pyx_v_rgba[__pyx_v_i]) = ((__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i])) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "field_interpolation_tables.pxd":96 + * trgba[i] = istorage[field_table_ids[i]] * + * if grey_opacity == 1: # <<<<<<<<<<<<<< + * ta = fmax(1.0 - dt*trgba[3],0.0) + * for i in range(4): */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + goto __pyx_L12; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "field_interpolation_tables.pxd":101 + * rgba[i] = dt*trgba[i] + ta*rgba[i] + * else: + * for i in range(3): # <<<<<<<<<<<<<< + * ta = fmax(1.0-dt*trgba[i], 0.0) + * rgba[i] = dt*trgba[i] + ta*rgba[i] + */ + /*else*/ { + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "field_interpolation_tables.pxd":102 + * else: + * for i in range(3): + * ta = fmax(1.0-dt*trgba[i], 0.0) # <<<<<<<<<<<<<< + * rgba[i] = dt*trgba[i] + ta*rgba[i] * - * 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, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i]))), 0.0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "field_interpolation_tables.pxd":103 + * for i in range(3): + * ta = fmax(1.0-dt*trgba[i], 0.0) + * rgba[i] = dt*trgba[i] + ta*rgba[i] # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * @cython.boundscheck(False) */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + (__pyx_v_rgba[__pyx_v_i]) = ((__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i])) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); + } } + __pyx_L12:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + /* "field_interpolation_tables.pxd":79 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void FIT_eval_transfer(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< + * np.float64_t *rgba, int n_fits, + * FieldInterpolationTable fits[6], */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() +/* "field_interpolation_tables.pxd":108 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void FIT_eval_transfer_with_light(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< + * np.float64_t *grad, np.float64_t *l_dir, np.float64_t *l_rgba, + * np.float64_t *rgba, int n_fits, */ -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; +static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_eval_transfer_with_light(__pyx_t_5numpy_float64_t __pyx_v_dt, __pyx_t_5numpy_float64_t *__pyx_v_dvs, __pyx_t_5numpy_float64_t *__pyx_v_grad, __pyx_t_5numpy_float64_t *__pyx_v_l_dir, __pyx_t_5numpy_float64_t *__pyx_v_l_rgba, __pyx_t_5numpy_float64_t *__pyx_v_rgba, int __pyx_v_n_fits, struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fits, int *__pyx_v_field_table_ids, int __pyx_v_grey_opacity) { + int __pyx_v_i; + int __pyx_v_fid; + __pyx_t_5numpy_float64_t __pyx_v_ta; + __pyx_t_5numpy_float64_t __pyx_v_dot_prod; + __pyx_t_5numpy_float64_t __pyx_v_istorage[6]; + __pyx_t_5numpy_float64_t __pyx_v_trgba[6]; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "field_interpolation_tables.pxd":117 + * cdef np.float64_t istorage[6] + * cdef np.float64_t trgba[6] + * dot_prod = 0.0 # <<<<<<<<<<<<<< + * for i in range(3): + * dot_prod += l_dir[i]*grad[i] */ - { - __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:*/ { + __pyx_v_dot_prod = 0.0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "field_interpolation_tables.pxd":118 + * cdef np.float64_t trgba[6] + * dot_prod = 0.0 + * for i in range(3): # <<<<<<<<<<<<<< + * dot_prod += l_dir[i]*grad[i] + * #dot_prod = fmax(0.0, dot_prod) */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "field_interpolation_tables.pxd":119 + * dot_prod = 0.0 + * for i in range(3): + * dot_prod += l_dir[i]*grad[i] # <<<<<<<<<<<<<< + * #dot_prod = fmax(0.0, dot_prod) + * for i in range(6): istorage[i] = 0.0 */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_v_dot_prod = (__pyx_v_dot_prod + ((__pyx_v_l_dir[__pyx_v_i]) * (__pyx_v_grad[__pyx_v_i]))); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "field_interpolation_tables.pxd":121 + * dot_prod += l_dir[i]*grad[i] + * #dot_prod = fmax(0.0, dot_prod) + * for i in range(6): istorage[i] = 0.0 # <<<<<<<<<<<<<< + * for i in range(n_fits): + * istorage[i] = FIT_get_value(&fits[i], dvs) */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + (__pyx_v_istorage[__pyx_v_i]) = 0.0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "field_interpolation_tables.pxd":122 + * #dot_prod = fmax(0.0, dot_prod) + * for i in range(6): istorage[i] = 0.0 + * for i in range(n_fits): # <<<<<<<<<<<<<< + * istorage[i] = FIT_get_value(&fits[i], dvs) + * for i in range(n_fits): */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = __pyx_v_n_fits; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "field_interpolation_tables.pxd":123 + * for i in range(6): istorage[i] = 0.0 + * for i in range(n_fits): + * istorage[i] = FIT_get_value(&fits[i], dvs) # <<<<<<<<<<<<<< + * for i in range(n_fits): + * fid = fits[i].weight_table_id */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + (__pyx_v_istorage[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value((&(__pyx_v_fits[__pyx_v_i])), __pyx_v_dvs); } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + /* "field_interpolation_tables.pxd":124 + * for i in range(n_fits): + * istorage[i] = FIT_get_value(&fits[i], dvs) + * for i in range(n_fits): # <<<<<<<<<<<<<< + * fid = fits[i].weight_table_id + * if fid != -1: istorage[i] *= istorage[fid] */ + __pyx_t_1 = __pyx_v_n_fits; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* 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; -} + /* "field_interpolation_tables.pxd":125 + * istorage[i] = FIT_get_value(&fits[i], dvs) + * for i in range(n_fits): + * fid = fits[i].weight_table_id # <<<<<<<<<<<<<< + * if fid != -1: istorage[i] *= istorage[fid] + * for i in range(6): + */ + __pyx_t_3 = (__pyx_v_fits[__pyx_v_i]).weight_table_id; + __pyx_v_fid = __pyx_t_3; -/* "volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * + /* "field_interpolation_tables.pxd":126 + * for i in range(n_fits): + * fid = fits[i].weight_table_id + * if fid != -1: istorage[i] *= istorage[fid] # <<<<<<<<<<<<<< + * for i in range(6): + * trgba[i] = istorage[field_table_ids[i]] */ + __pyx_t_4 = ((__pyx_v_fid != -1L) != 0); + if (__pyx_t_4) { + __pyx_t_3 = __pyx_v_i; + (__pyx_v_istorage[__pyx_t_3]) = ((__pyx_v_istorage[__pyx_t_3]) * (__pyx_v_istorage[__pyx_v_fid])); + } + } -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("vc_index", 0); + /* "field_interpolation_tables.pxd":127 + * fid = fits[i].weight_table_id + * if fid != -1: istorage[i] *= istorage[fid] + * for i in range(6): # <<<<<<<<<<<<<< + * trgba[i] = istorage[field_table_ids[i]] + * if grey_opacity == 1: + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "volume_container.pxd":31 - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): - * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): + /* "field_interpolation_tables.pxd":128 + * if fid != -1: istorage[i] *= istorage[fid] + * for i in range(6): + * trgba[i] = istorage[field_table_ids[i]] # <<<<<<<<<<<<<< + * if grey_opacity == 1: + * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) */ - __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); - goto __pyx_L0; + (__pyx_v_trgba[__pyx_v_i]) = (__pyx_v_istorage[(__pyx_v_field_table_ids[__pyx_v_i])]); + } - /* "volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * + /* "field_interpolation_tables.pxd":129 + * for i in range(6): + * trgba[i] = istorage[field_table_ids[i]] + * if grey_opacity == 1: # <<<<<<<<<<<<<< + * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) + * for i in range(3): */ + __pyx_t_4 = ((__pyx_v_grey_opacity == 1) != 0); + if (__pyx_t_4) { - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "field_interpolation_tables.pxd":130 + * trgba[i] = istorage[field_table_ids[i]] + * if grey_opacity == 1: + * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) # <<<<<<<<<<<<<< + * for i in range(3): + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] + */ + __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (((__pyx_v_trgba[0]) + (__pyx_v_trgba[1])) + (__pyx_v_trgba[2])))), 0.0); -/* "volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i + /* "field_interpolation_tables.pxd":131 + * if grey_opacity == 1: + * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) + * for i in range(3): # <<<<<<<<<<<<<< + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] + * else: */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { - int __pyx_v_index[3]; - int __pyx_v_i; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("vc_pos_index", 0); + /* "field_interpolation_tables.pxd":132 + * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) + * for i in range(3): + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] # <<<<<<<<<<<<<< + * else: + * for i in range(3): + */ + (__pyx_v_rgba[__pyx_v_i]) = ((((1. - __pyx_v_ta) * (__pyx_v_trgba[__pyx_v_i])) * (1. + (__pyx_v_dot_prod * (__pyx_v_l_rgba[__pyx_v_i])))) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); + } + + /* "field_interpolation_tables.pxd":129 + * for i in range(6): + * trgba[i] = istorage[field_table_ids[i]] + * if grey_opacity == 1: # <<<<<<<<<<<<<< + * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) + * for i in range(3): + */ + goto __pyx_L14; + } - /* "volume_container.pxd":36 - * cdef int index[3] - * cdef int i - * for i in range(3): # <<<<<<<<<<<<<< - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) + /* "field_interpolation_tables.pxd":134 + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] + * else: + * for i in range(3): # <<<<<<<<<<<<<< + * ta = fmax(1.0-dt*trgba[i], 0.0) + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + /*else*/ { + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "volume_container.pxd":37 - * cdef int i - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< - * return vc_index(vc, index[0], index[1], index[2]) + /* "field_interpolation_tables.pxd":135 + * else: + * for i in range(3): + * ta = fmax(1.0-dt*trgba[i], 0.0) # <<<<<<<<<<<<<< + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] * */ - (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); - } + __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i]))), 0.0); - /* "volume_container.pxd":38 - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< + /* "field_interpolation_tables.pxd":136 + * for i in range(3): + * ta = fmax(1.0-dt*trgba[i], 0.0) + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] # <<<<<<<<<<<<<< * */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); - goto __pyx_L0; + (__pyx_v_rgba[__pyx_v_i]) = ((((1. - __pyx_v_ta) * (__pyx_v_trgba[__pyx_v_i])) * (1. + (__pyx_v_dot_prod * (__pyx_v_l_rgba[__pyx_v_i])))) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); + } + } + __pyx_L14:; - /* "volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i + /* "field_interpolation_tables.pxd":108 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void FIT_eval_transfer_with_light(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< + * np.float64_t *grad, np.float64_t *l_dir, np.float64_t *l_rgba, + * np.float64_t *rgba, int n_fits, */ /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; } /* "View.MemoryView":120 @@ -10131,10 +9881,15 @@ 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; } @@ -10143,21 +9898,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -10170,7 +9929,9 @@ } 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); @@ -10393,7 +10154,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -11588,6 +11349,113 @@ 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":240 * * @cname("__pyx_array_new") @@ -11783,6 +11651,7 @@ 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; } @@ -11802,100 +11671,387 @@ } __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, 277, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___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":278 + * 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":277 + * 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":279 + * 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":280 + * 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":279 + * 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; + } - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "(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:; -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); + /* "(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) { - /* "View.MemoryView":278 - * cdef object name - * def __init__(self, name): - * self.name = name # <<<<<<<<<<<<<< - * def __repr__(self): - * return self.name + /* "(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_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; + __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; - /* "View.MemoryView":277 - * cdef class Enum(object): - * cdef object name - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * def __repr__(self): + /* "(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_r = 0; + __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; } -/* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * +/* "(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_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { +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("__repr__ (wrapper)", 0); - __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + __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_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { +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 - __Pyx_RefNannySetupContext("__repr__", 0); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "View.MemoryView":280 - * self.name = name - * def __repr__(self): - * return self.name # <<<<<<<<<<<<<< - * - * cdef generic = Enum("") + /* "(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) # <<<<<<<<<<<<<< */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->name); - __pyx_r = __pyx_v_self->name; - goto __pyx_L0; + 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; - /* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * + /* "(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(); @@ -12010,8 +12166,11 @@ 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; } @@ -12020,11 +12179,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -12037,6 +12198,7 @@ } 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; @@ -13169,7 +13331,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -13229,7 +13391,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -13919,7 +14081,7 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -14760,7 +14922,7 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -14874,7 +15036,7 @@ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__18, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -15850,6 +16012,113 @@ 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__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.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__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.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "View.MemoryView":643 * * @cname('__pyx_memoryview_new') @@ -16178,9 +16447,9 @@ __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__19); - __Pyx_GIVEREF(__pyx_slice__19); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__19); + __Pyx_INCREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__23); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) @@ -16213,7 +16482,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__20); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__24); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) } __pyx_L7:; @@ -16358,9 +16627,9 @@ __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__21); - __Pyx_GIVEREF(__pyx_slice__21); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__21); + __Pyx_INCREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__25); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error) @@ -16484,7 +16753,7 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -17867,11 +18136,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -18352,11 +18621,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -18609,16 +18878,123 @@ __pyx_r = __pyx_v_self->from_object; goto __pyx_L0; - /* "View.MemoryView":978 - * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.from_object - * + /* "View.MemoryView":978 + * + * @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__27, 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__28, 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_L0:; + __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; @@ -19068,7 +19444,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -20325,11 +20701,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -20353,7 +20729,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -20422,7 +20798,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -20444,7 +20820,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -20535,7 +20911,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -20558,7 +20934,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -20674,7 +21050,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -21241,11 +21617,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -21425,7 +21801,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -21449,7 +21825,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -21736,27 +22112,490 @@ */ __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":1406 - * _slice_assign_scalar(data, shape + 1, strides + 1, - * ndim - 1, itemsize, item) - * data += stride # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":1406 + * _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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) */ - __pyx_v_data = (__pyx_v_data + __pyx_v_stride); - } } - __pyx_L3:; - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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; @@ -21783,7 +22622,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -21833,6 +22672,8 @@ 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} }; @@ -21952,7 +22793,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -21980,6 +22821,8 @@ } 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} }; @@ -22067,7 +22910,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -22179,6 +23022,8 @@ {"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} }; @@ -22304,7 +23149,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -22348,6 +23193,8 @@ } 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} }; @@ -22454,6 +23301,7 @@ {&__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}, @@ -22465,11 +23313,12 @@ {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__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_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_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 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_aipix, __pyx_k_aipix, sizeof(__pyx_k_aipix), 0, 0, 1, 1}, {&__pyx_n_s_aipnest, __pyx_k_aipnest, sizeof(__pyx_k_aipnest), 0, 0, 1, 1}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, @@ -22484,8 +23333,10 @@ {&__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_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}, @@ -22522,10 +23373,12 @@ {&__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_nimi, __pyx_k_nimi, sizeof(__pyx_k_nimi), 0, 0, 1, 1}, {&__pyx_n_s_nimj, __pyx_k_nimj, sizeof(__pyx_k_nimj), 0, 0, 1, 1}, {&__pyx_n_s_nimx, __pyx_k_nimx, sizeof(__pyx_k_nimx), 0, 0, 1, 1}, {&__pyx_n_s_nimy, __pyx_k_nimy, sizeof(__pyx_k_nimy), 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_nphi, __pyx_k_nphi, sizeof(__pyx_k_nphi), 0, 0, 1, 1}, {&__pyx_n_s_nside, __pyx_k_nside, sizeof(__pyx_k_nside), 0, 0, 1, 1}, @@ -22541,15 +23394,23 @@ {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_phi, __pyx_k_phi, sizeof(__pyx_k_phi), 0, 0, 1, 1}, {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_pix_image, __pyx_k_pix_image, sizeof(__pyx_k_pix_image), 0, 0, 1, 1}, {&__pyx_n_s_pixelize_healpix, __pyx_k_pixelize_healpix, sizeof(__pyx_k_pixelize_healpix), 0, 0, 1, 1}, {&__pyx_n_s_px, __pyx_k_px, sizeof(__pyx_k_px), 0, 0, 1, 1}, {&__pyx_n_s_py, __pyx_k_py, sizeof(__pyx_k_py), 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_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_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_resolution, __pyx_k_resolution, sizeof(__pyx_k_resolution), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 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_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, @@ -22558,6 +23419,7 @@ {&__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_theta, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 0, 1, 1}, @@ -22565,25 +23427,27 @@ {&__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}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_n_s_vp, __pyx_k_vp, sizeof(__pyx_k_vp), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_grid_traversal, __pyx_k_yt_utilities_lib_grid_traversal, sizeof(__pyx_k_yt_utilities_lib_grid_traversal), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_grid_traversal, __pyx_k_yt_utilities_lib_grid_traversal, sizeof(__pyx_k_yt_utilities_lib_grid_traversal), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_grid_traversal_2, __pyx_k_yt_utilities_lib_grid_traversal_2, sizeof(__pyx_k_yt_utilities_lib_grid_traversal_2), 0, 0, 1, 1}, {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 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, 65, __pyx_L1_error) - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 151, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 425, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error) return 0; @@ -22758,6 +23622,25 @@ __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":484 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: @@ -22765,9 +23648,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -22776,9 +23659,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "View.MemoryView":563 * def suboffsets(self): @@ -22787,12 +23670,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__18 = PyTuple_New(1); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); + __pyx_tuple__20 = PyTuple_New(1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__18, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__18); + PyTuple_SET_ITEM(__pyx_tuple__20, 0, __pyx_int_neg_1); + __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":668 * if item is Ellipsis: @@ -22801,9 +23703,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(2, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__19); - __Pyx_GIVEREF(__pyx_slice__19); + __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); /* "View.MemoryView":671 * seen_ellipsis = True @@ -22812,9 +23714,9 @@ * have_slices = True * else: */ - __pyx_slice__20 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(2, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); + __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(2, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -22823,9 +23725,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(2, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__21); - __Pyx_GIVEREF(__pyx_slice__21); + __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -22834,141 +23736,160 @@ * * */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "(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__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "(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__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); - /* "yt/utilities/lib/grid_traversal.pyx":158 + /* "yt/utilities/lib/grid_traversal.pyx":150 * return hit * * def hp_pix2vec_nest(long nside, long ipix): # <<<<<<<<<<<<<< * raise NotImplementedError * # cdef double v[3] */ - __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_nside, __pyx_n_s_ipix); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_hp_pix2vec_nest, 158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_nside, __pyx_n_s_ipix); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_grid_traversal, __pyx_n_s_hp_pix2vec_nest, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 150, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":168 + /* "yt/utilities/lib/grid_traversal.pyx":160 * # return tr * * def arr_pix2vec_nest(long nside, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] aipix): * raise NotImplementedError */ - __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_nside, __pyx_n_s_aipix); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_arr_pix2vec_nest, 168, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_nside, __pyx_n_s_aipix); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_grid_traversal, __pyx_n_s_arr_pix2vec_nest, 160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 160, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":184 + /* "yt/utilities/lib/grid_traversal.pyx":176 * # return tr * * def hp_vec2pix_nest(long nside, double x, double y, double z): # <<<<<<<<<<<<<< * raise NotImplementedError * # cdef double v[3] */ - __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_nside, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_hp_vec2pix_nest, 184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_tuple__33 = PyTuple_Pack(4, __pyx_n_s_nside, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_grid_traversal, __pyx_n_s_hp_vec2pix_nest, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 176, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":194 + /* "yt/utilities/lib/grid_traversal.pyx":186 * # return ipix * * def arr_vec2pix_nest(long nside, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] x, * np.ndarray[np.float64_t, ndim=1] y, */ - __pyx_tuple__29 = PyTuple_Pack(4, __pyx_n_s_nside, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_arr_vec2pix_nest, 194, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_tuple__35 = PyTuple_Pack(4, __pyx_n_s_nside, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_grid_traversal, __pyx_n_s_arr_vec2pix_nest, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 186, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":212 + /* "yt/utilities/lib/grid_traversal.pyx":204 * # return tr * * def hp_pix2ang_nest(long nside, long ipnest): # <<<<<<<<<<<<<< * raise NotImplementedError * # cdef double theta, phi */ - __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_nside, __pyx_n_s_ipnest); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_hp_pix2ang_nest, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_nside, __pyx_n_s_ipnest); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_grid_traversal, __pyx_n_s_hp_pix2ang_nest, 204, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 204, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":218 + /* "yt/utilities/lib/grid_traversal.pyx":210 * # return (theta, phi) * * def arr_pix2ang_nest(long nside, np.ndarray[np.int64_t, ndim=1] aipnest): # <<<<<<<<<<<<<< * raise NotImplementedError * # cdef int n = aipnest.shape[0] */ - __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_nside, __pyx_n_s_aipnest); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_arr_pix2ang_nest, 218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_nside, __pyx_n_s_aipnest); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_grid_traversal, __pyx_n_s_arr_pix2ang_nest, 210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 210, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":232 + /* "yt/utilities/lib/grid_traversal.pyx":224 * # return tr * * def hp_ang2pix_nest(long nside, double theta, double phi): # <<<<<<<<<<<<<< * raise NotImplementedError * # cdef long ipix */ - __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_nside, __pyx_n_s_theta, __pyx_n_s_phi); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); - __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_hp_ang2pix_nest, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_tuple__41 = PyTuple_Pack(3, __pyx_n_s_nside, __pyx_n_s_theta, __pyx_n_s_phi); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_grid_traversal, __pyx_n_s_hp_ang2pix_nest, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 224, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":238 + /* "yt/utilities/lib/grid_traversal.pyx":230 * # return ipix * * def arr_ang2pix_nest(long nside, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] atheta, * np.ndarray[np.float64_t, ndim=1] aphi): */ - __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_s_nside, __pyx_n_s_atheta, __pyx_n_s_aphi); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_arr_ang2pix_nest, 238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_tuple__43 = PyTuple_Pack(3, __pyx_n_s_nside, __pyx_n_s_atheta, __pyx_n_s_aphi); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_grid_traversal, __pyx_n_s_arr_ang2pix_nest, 230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 230, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":257 + /* "yt/utilities/lib/grid_traversal.pyx":249 * @cython.cdivision(False) * @cython.wraparound(False) * def pixelize_healpix(long nside, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] values, * long ntheta, long nphi, */ - __pyx_tuple__39 = PyTuple_Pack(5, __pyx_n_s_nside, __pyx_n_s_values, __pyx_n_s_ntheta, __pyx_n_s_nphi, __pyx_n_s_irotation); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_pixelize_healpix, 257, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_tuple__45 = PyTuple_Pack(5, __pyx_n_s_nside, __pyx_n_s_values, __pyx_n_s_ntheta, __pyx_n_s_nphi, __pyx_n_s_irotation); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_grid_traversal, __pyx_n_s_pixelize_healpix, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 249, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":299 + /* "yt/utilities/lib/grid_traversal.pyx":291 * # return results, count * * def healpix_aitoff_proj(np.ndarray[np.float64_t, ndim=1] pix_image, # <<<<<<<<<<<<<< * long nside, * np.ndarray[np.float64_t, ndim=2] image, */ - __pyx_tuple__41 = PyTuple_Pack(4, __pyx_n_s_pix_image, __pyx_n_s_nside, __pyx_n_s_image, __pyx_n_s_irotation); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_healpix_aitoff_proj, 299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 299, __pyx_L1_error) + __pyx_tuple__47 = PyTuple_Pack(4, __pyx_n_s_pix_image, __pyx_n_s_nside, __pyx_n_s_image, __pyx_n_s_irotation); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_grid_traversal, __pyx_n_s_healpix_aitoff_proj, 291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 291, __pyx_L1_error) - /* "yt/utilities/lib/grid_traversal.pyx":338 + /* "yt/utilities/lib/grid_traversal.pyx":330 * # image[j, i] = pix_image[ipix] * * def arr_fisheye_vectors(int resolution, np.float64_t fov, int nimx=1, int # <<<<<<<<<<<<<< * nimy=1, int nimi=0, int nimj=0, np.float64_t off_theta=0.0, np.float64_t * off_phi=0.0): */ - __pyx_tuple__43 = PyTuple_Pack(19, __pyx_n_s_resolution, __pyx_n_s_fov, __pyx_n_s_nimx, __pyx_n_s_nimy, __pyx_n_s_nimi, __pyx_n_s_nimj, __pyx_n_s_off_theta, __pyx_n_s_off_phi, __pyx_n_s_vp, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_r, __pyx_n_s_phi, __pyx_n_s_theta, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_fov_rad, __pyx_n_s_nx, __pyx_n_s_ny); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); - __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(8, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_arr_fisheye_vectors, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 338, __pyx_L1_error) + __pyx_tuple__49 = PyTuple_Pack(19, __pyx_n_s_resolution, __pyx_n_s_fov, __pyx_n_s_nimx, __pyx_n_s_nimy, __pyx_n_s_nimi, __pyx_n_s_nimj, __pyx_n_s_off_theta, __pyx_n_s_off_phi, __pyx_n_s_vp, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_r, __pyx_n_s_phi, __pyx_n_s_theta, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_fov_rad, __pyx_n_s_nx, __pyx_n_s_ny); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(8, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_grid_traversal, __pyx_n_s_arr_fisheye_vectors, 330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 330, __pyx_L1_error) /* "View.MemoryView":282 * return self.name @@ -22977,9 +23898,9 @@ * 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(2, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); /* "View.MemoryView":283 * @@ -22988,9 +23909,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(2, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -22999,9 +23920,9 @@ * * */ - __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); /* "View.MemoryView":287 * @@ -23010,9 +23931,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(2, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); /* "View.MemoryView":288 * @@ -23021,9 +23942,19 @@ * * */ - __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -23032,18 +23963,12 @@ } static int __Pyx_InitGlobals(void) { - /* InitThreads.init */ - #ifdef WITH_THREAD -PyEval_InitThreads(); -#endif - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_180_0 = PyFloat_FromDouble(180.0); if (unlikely(!__pyx_float_180_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:; @@ -23107,6 +24032,7 @@ __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 @@ -23146,9 +24072,11 @@ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __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; @@ -23161,6 +24089,7 @@ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; @@ -23170,6 +24099,7 @@ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -23186,16 +24116,16 @@ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = __Pyx_ImportType("yt.utilities.lib.partitioned_grid", "PartitionedGrid", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(4, 22, __pyx_L1_error) __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(4, 22, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ImageSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(5, 39, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(5, 39, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(5, 60, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(5, 60, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "InterpolatedProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(5, 63, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(5, 63, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "VolumeRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(5, 68, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(5, 68, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "LightSourceRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(5, 75, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(5, 75, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ImageSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(5, 42, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(5, 42, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(5, 75, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(5, 75, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "InterpolatedProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(5, 78, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(5, 78, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "VolumeRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(5, 83, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(5, 83, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "LightSourceRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(5, 89, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(5, 89, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -23215,136 +24145,136 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/grid_traversal.pyx":158 + /* "yt/utilities/lib/grid_traversal.pyx":150 * return hit * * def hp_pix2vec_nest(long nside, long ipix): # <<<<<<<<<<<<<< * raise NotImplementedError * # cdef double v[3] */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_1hp_pix2vec_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_1hp_pix2vec_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal_2); 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_hp_pix2vec_nest, __pyx_t_1) < 0) __PYX_ERR(0, 158, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_hp_pix2vec_nest, __pyx_t_1) < 0) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/grid_traversal.pyx":168 + /* "yt/utilities/lib/grid_traversal.pyx":160 * # return tr * * def arr_pix2vec_nest(long nside, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] aipix): * raise NotImplementedError */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_3arr_pix2vec_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_3arr_pix2vec_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal_2); 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_arr_pix2vec_nest, __pyx_t_1) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arr_pix2vec_nest, __pyx_t_1) < 0) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/grid_traversal.pyx":184 + /* "yt/utilities/lib/grid_traversal.pyx":176 * # return tr * * def hp_vec2pix_nest(long nside, double x, double y, double z): # <<<<<<<<<<<<<< * raise NotImplementedError * # cdef double v[3] */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_5hp_vec2pix_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_5hp_vec2pix_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_hp_vec2pix_nest, __pyx_t_1) < 0) __PYX_ERR(0, 184, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_hp_vec2pix_nest, __pyx_t_1) < 0) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/grid_traversal.pyx":194 + /* "yt/utilities/lib/grid_traversal.pyx":186 * # return ipix * * def arr_vec2pix_nest(long nside, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] x, * np.ndarray[np.float64_t, ndim=1] y, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_7arr_vec2pix_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_7arr_vec2pix_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_arr_vec2pix_nest, __pyx_t_1) < 0) __PYX_ERR(0, 194, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arr_vec2pix_nest, __pyx_t_1) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/grid_traversal.pyx":212 + /* "yt/utilities/lib/grid_traversal.pyx":204 * # return tr * * def hp_pix2ang_nest(long nside, long ipnest): # <<<<<<<<<<<<<< * raise NotImplementedError * # cdef double theta, phi */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_9hp_pix2ang_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_9hp_pix2ang_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_hp_pix2ang_nest, __pyx_t_1) < 0) __PYX_ERR(0, 212, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_hp_pix2ang_nest, __pyx_t_1) < 0) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/grid_traversal.pyx":218 + /* "yt/utilities/lib/grid_traversal.pyx":210 * # return (theta, phi) * * def arr_pix2ang_nest(long nside, np.ndarray[np.int64_t, ndim=1] aipnest): # <<<<<<<<<<<<<< * raise NotImplementedError * # cdef int n = aipnest.shape[0] */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_11arr_pix2ang_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_11arr_pix2ang_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_arr_pix2ang_nest, __pyx_t_1) < 0) __PYX_ERR(0, 218, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arr_pix2ang_nest, __pyx_t_1) < 0) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/grid_traversal.pyx":232 + /* "yt/utilities/lib/grid_traversal.pyx":224 * # return tr * * def hp_ang2pix_nest(long nside, double theta, double phi): # <<<<<<<<<<<<<< * raise NotImplementedError * # cdef long ipix */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_13hp_ang2pix_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_13hp_ang2pix_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_hp_ang2pix_nest, __pyx_t_1) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_hp_ang2pix_nest, __pyx_t_1) < 0) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/grid_traversal.pyx":238 + /* "yt/utilities/lib/grid_traversal.pyx":230 * # return ipix * * def arr_ang2pix_nest(long nside, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] atheta, * np.ndarray[np.float64_t, ndim=1] aphi): */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_15arr_ang2pix_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_15arr_ang2pix_nest, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_arr_ang2pix_nest, __pyx_t_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arr_ang2pix_nest, __pyx_t_1) < 0) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/grid_traversal.pyx":257 + /* "yt/utilities/lib/grid_traversal.pyx":249 * @cython.cdivision(False) * @cython.wraparound(False) * def pixelize_healpix(long nside, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] values, * long ntheta, long nphi, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_17pixelize_healpix, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_17pixelize_healpix, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_healpix, __pyx_t_1) < 0) __PYX_ERR(0, 257, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_healpix, __pyx_t_1) < 0) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/grid_traversal.pyx":299 + /* "yt/utilities/lib/grid_traversal.pyx":291 * # return results, count * * def healpix_aitoff_proj(np.ndarray[np.float64_t, ndim=1] pix_image, # <<<<<<<<<<<<<< * long nside, * np.ndarray[np.float64_t, ndim=2] image, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_19healpix_aitoff_proj, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_19healpix_aitoff_proj, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_healpix_aitoff_proj, __pyx_t_1) < 0) __PYX_ERR(0, 299, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_healpix_aitoff_proj, __pyx_t_1) < 0) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/grid_traversal.pyx":338 + /* "yt/utilities/lib/grid_traversal.pyx":330 * # image[j, i] = pix_image[ipix] * * def arr_fisheye_vectors(int resolution, np.float64_t fov, int nimx=1, int # <<<<<<<<<<<<<< * nimy=1, int nimi=0, int nimj=0, np.float64_t off_theta=0.0, np.float64_t * off_phi=0.0): */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_21arr_fisheye_vectors, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14grid_traversal_21arr_fisheye_vectors, NULL, __pyx_n_s_yt_utilities_lib_grid_traversal_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_arr_fisheye_vectors, __pyx_t_1) < 0) __PYX_ERR(0, 338, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arr_fisheye_vectors, __pyx_t_1) < 0) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "yt/utilities/lib/grid_traversal.pyx":1 @@ -23366,7 +24296,7 @@ */ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_array_type); @@ -23377,7 +24307,7 @@ * 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(2, 282, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_1); @@ -23391,7 +24321,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 283, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_1); @@ -23405,7 +24335,7 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 284, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_1); @@ -23419,7 +24349,7 @@ * 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(2, 287, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_1); @@ -23433,7 +24363,7 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); @@ -23475,7 +24405,7 @@ */ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_memoryview_type); @@ -23488,16 +24418,26 @@ */ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import 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(2, 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(2, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -23507,7 +24447,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.grid_traversal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.grid_traversal", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -24485,7 +25425,7 @@ case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -2) a = -a; break; @@ -24495,7 +25435,7 @@ case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -3) a = -a; break; @@ -24505,7 +25445,7 @@ case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -4) a = -a; break; @@ -24731,7 +25671,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -24791,6 +25740,21 @@ 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; @@ -24888,6 +25852,21 @@ } } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { @@ -25104,8 +26083,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL @@ -25113,17 +26092,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* GetItemInt */ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { @@ -25137,9 +26121,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -25152,9 +26139,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -25415,11 +26405,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -25441,8 +26427,40 @@ } #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; + } +} + /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -25459,8 +26477,73 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -25479,8 +26562,42 @@ return NULL; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -25560,7 +26677,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -25619,12 +26736,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -25663,8 +26783,8 @@ #endif - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + /* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -25686,7 +26806,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -25716,39 +26836,8 @@ } } -/* 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); - } -} - /* MemviewSliceIsContig */ - static int + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -25771,7 +26860,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -25807,7 +26896,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -25820,7 +26909,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -25840,7 +26929,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -25975,7 +27064,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -25995,7 +27084,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -26130,7 +27219,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -26160,8 +27249,39 @@ } } +/* 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 long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -26350,7 +27470,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -26539,7 +27659,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -26606,7 +27726,7 @@ } /* MemviewSliceInit */ - static int + static int __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, @@ -26741,7 +27861,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + 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 @@ -26930,7 +28050,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -26946,7 +28066,7 @@ } /* FunctionExport */ - static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { @@ -26983,7 +28103,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -27001,7 +28121,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -27066,7 +28186,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -27091,6 +28211,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -27099,11 +28221,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/grid_traversal.pxd yt-3.4.0/yt/utilities/lib/grid_traversal.pxd --- yt-3.3.3/yt/utilities/lib/grid_traversal.pxd 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/grid_traversal.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -17,7 +17,7 @@ import numpy as np cimport numpy as np cimport cython -from .image_samplers cimport ImageContainer, ImageSampler +from .image_samplers cimport ImageSampler from .volume_container cimport VolumeContainer, vc_index, vc_pos_index ctypedef void sampler_function( diff -Nru yt-3.3.3/yt/utilities/lib/grid_traversal.pyx yt-3.4.0/yt/utilities/lib/grid_traversal.pyx --- yt-3.3.3/yt/utilities/lib/grid_traversal.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/grid_traversal.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -19,21 +19,13 @@ #cimport healpix_interface from libc.stdlib cimport malloc, calloc, free, abs from libc.math cimport exp, floor, log2, \ - fabs, atan, atan2, asin, cos, sin, sqrt, acos, M_PI + fabs, atan, atan2, asin, cos, sin, sqrt, acos, M_PI, sqrt from yt.utilities.lib.fp_utils cimport imax, fmax, imin, fmin, iclip, fclip, i64clip from field_interpolation_tables cimport \ FieldInterpolationTable, FIT_initialize_table, FIT_eval_transfer,\ FIT_eval_transfer_with_light from fixed_interpolator cimport * -from cython.parallel import prange, parallel, threadid -from cpython.exc cimport PyErr_CheckSignals - -from .image_samplers cimport \ - ImageSampler, \ - ImageContainer, \ - VolumeRenderAccumulator - DEF Nch = 4 @cython.boundscheck(False) @@ -317,7 +309,7 @@ # zb = (x*x/8.0 + y*y/2.0 - 1.0) # if zb > 0: continue # z = (1.0 - (x/4.0)**2.0 - (y/2.0)**2.0) - # z = z**0.5 + # z = sqrt(z) # # Longitude # phi = (2.0*atan(z*x/(2.0 * (2.0*z*z-1.0))) + pi) # # Latitude @@ -352,7 +344,7 @@ px = (2.0 * (nimi*nx + i)) / resolution - 1.0 for j in range(ny): py = (2.0 * (nimj*ny + j)) / resolution - 1.0 - r = (px*px + py*py)**0.5 + r = sqrt(px*px + py*py) if r > 1.01: vp[i,j,0] = vp[i,j,1] = vp[i,j,2] = 0.0 continue diff -Nru yt-3.3.3/yt/utilities/lib/image_samplers.c yt-3.4.0/yt/utilities/lib/image_samplers.c --- yt-3.3.3/yt/utilities/lib/image_samplers.c 2016-12-12 01:41:49.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/image_samplers.c 2017-08-10 18:20:42.000000000 +0000 @@ -1,18 +1,24 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "yt/utilities/lib/fixed_interpolator.h", - "yt/utilities/lib/kdtree.h", "yt/utilities/lib/platform_dep.h" ], "include_dirs": [ + "yt/utilities/lib", + "./yt/utilities/lib", "yt/utilities/lib/" ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.image_samplers", + "sources": [ + "yt/utilities/lib/image_samplers.pyx", + "yt/utilities/lib/fixed_interpolator.c" ] }, "module_name": "yt.utilities.lib.image_samplers" @@ -26,7 +32,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -48,6 +54,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -200,16 +207,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -336,6 +347,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -390,6 +407,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -453,7 +499,6 @@ #include #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" -#include "kdtree.h" #include #include "platform_dep.h" #include "limits.h" @@ -504,8 +549,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -518,8 +563,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -641,10 +689,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -678,8 +728,8 @@ static const char *__pyx_f[] = { "yt/utilities/lib/image_samplers.pyx", - "__init__.pxd", "stringsource", + "__init__.pxd", "type.pxd", "yt/utilities/lib/partitioned_grid.pxd", }; @@ -1060,49 +1110,6 @@ __pyx_t_5numpy_float64_t idds[3]; int dims[3]; }; -struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer; - -/* "lenses.pxd":32 - * cdef int SHRT_MAX - * - * cdef struct ImageContainer: # <<<<<<<<<<<<<< - * np.float64_t[:,:,:] vp_pos - * np.float64_t[:,:,:] vp_dir - */ -struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer { - __Pyx_memviewslice vp_pos; - __Pyx_memviewslice vp_dir; - __pyx_t_5numpy_float64_t *center; - __Pyx_memviewslice image; - __Pyx_memviewslice zbuffer; - __Pyx_memviewslice image_used; - __Pyx_memviewslice mesh_lines; - __pyx_t_5numpy_float64_t pdx; - __pyx_t_5numpy_float64_t pdy; - __pyx_t_5numpy_float64_t bounds[4]; - __Pyx_memviewslice camera_data; - int nv[2]; - __pyx_t_5numpy_float64_t *x_vec; - __pyx_t_5numpy_float64_t *y_vec; -}; - -/* "lenses.pxd":48 - * - * - * ctypedef int calculate_extent_function(ImageContainer *image, # <<<<<<<<<<<<<< - * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 - * - */ -typedef int __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *); - -/* "lenses.pxd":51 - * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 - * - * ctypedef void generate_vector_info_function(ImageContainer *im, # <<<<<<<<<<<<<< - * np.int64_t vi, np.int64_t vj, - * np.float64_t width[2], - */ -typedef void __pyx_t_2yt_9utilities_3lib_6lenses_generate_vector_info_function(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable; /* "field_interpolation_tables.pxd":22 @@ -1150,9 +1157,27 @@ struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator; struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator; -/* "yt/utilities/lib/image_samplers.pxd":35 +/* "yt/utilities/lib/image_samplers.pxd":30 * cdef struct VolumeRenderAccumulator * + * ctypedef int calculate_extent_function(ImageSampler image, # <<<<<<<<<<<<<< + * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 + * + */ +typedef int __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *); + +/* "yt/utilities/lib/image_samplers.pxd":33 + * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 + * + * ctypedef void generate_vector_info_function(ImageSampler im, # <<<<<<<<<<<<<< + * np.int64_t vi, np.int64_t vj, + * np.float64_t width[2], + */ +typedef void __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); + +/* "yt/utilities/lib/image_samplers.pxd":38 + * np.float64_t v_dir[3], np.float64_t v_pos[3]) nogil + * * cdef struct ImageAccumulator: # <<<<<<<<<<<<<< * np.float64_t rgba[Nch] * void *supp_data @@ -1162,12 +1187,12 @@ void *supp_data; }; -/* "yt/utilities/lib/image_samplers.pxd":33 +/* "yt/utilities/lib/image_samplers.pxd":28 * # breaks a bunch of C++ interop. Maybe some day it won't. So, we just forward * # declare. * cdef struct VolumeRenderAccumulator # <<<<<<<<<<<<<< * - * cdef struct ImageAccumulator: + * ctypedef int calculate_extent_function(ImageSampler image, */ struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator { int n_fits; @@ -1177,7 +1202,6 @@ __pyx_t_5numpy_float64_t star_coeff; __pyx_t_5numpy_float64_t star_er; __pyx_t_5numpy_float64_t star_sigma_num; - struct kdtree *star_list; __pyx_t_5numpy_float64_t *light_dir; __pyx_t_5numpy_float64_t *light_rgba; int grey_opacity; @@ -1205,17 +1229,30 @@ }; -/* "yt/utilities/lib/image_samplers.pxd":39 +/* "yt/utilities/lib/image_samplers.pxd":42 * void *supp_data * * cdef class ImageSampler: # <<<<<<<<<<<<<< - * cdef ImageContainer *image - * cdef public object acenter, aimage, ax_vec, ay_vec + * cdef np.float64_t[:,:,:] vp_pos + * cdef np.float64_t[:,:,:] vp_dir */ struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler { PyObject_HEAD struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtab; - struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *image; + __Pyx_memviewslice vp_pos; + __Pyx_memviewslice vp_dir; + __pyx_t_5numpy_float64_t *center; + __Pyx_memviewslice image; + __Pyx_memviewslice zbuffer; + __Pyx_memviewslice image_used; + __Pyx_memviewslice mesh_lines; + __pyx_t_5numpy_float64_t pdx; + __pyx_t_5numpy_float64_t pdy; + __pyx_t_5numpy_float64_t bounds[4]; + __Pyx_memviewslice camera_data; + int nv[2]; + __pyx_t_5numpy_float64_t *x_vec; + __pyx_t_5numpy_float64_t *y_vec; PyObject *acenter; PyObject *aimage; PyObject *ax_vec; @@ -1226,12 +1263,12 @@ void *supp_data; __pyx_t_5numpy_float64_t width[3]; PyObject *lens_type; - __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function *extent_function; - __pyx_t_2yt_9utilities_3lib_6lenses_generate_vector_info_function *vector_function; + __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function *extent_function; + __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function *vector_function; }; -/* "yt/utilities/lib/image_samplers.pxd":60 +/* "yt/utilities/lib/image_samplers.pxd":75 * void *data) nogil * * cdef class ProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1243,7 +1280,7 @@ }; -/* "yt/utilities/lib/image_samplers.pxd":63 +/* "yt/utilities/lib/image_samplers.pxd":78 * pass * * cdef class InterpolatedProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1258,7 +1295,7 @@ }; -/* "yt/utilities/lib/image_samplers.pxd":68 +/* "yt/utilities/lib/image_samplers.pxd":83 * cdef public object my_field_tables * * cdef class VolumeRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1270,12 +1307,11 @@ struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *vra; PyObject *tf_obj; PyObject *my_field_tables; - struct kdtree **trees; PyObject *tree_containers; }; -/* "yt/utilities/lib/image_samplers.pxd":75 +/* "yt/utilities/lib/image_samplers.pxd":89 * cdef object tree_containers * * cdef class LightSourceRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1290,7 +1326,7 @@ }; -/* "yt/utilities/lib/image_samplers.pyx":203 +/* "yt/utilities/lib/image_samplers.pyx":200 * return * * def ensure_code_unit_params(self, params): # <<<<<<<<<<<<<< @@ -1303,7 +1339,7 @@ }; -/* "yt/utilities/lib/image_samplers.pyx":210 +/* "yt/utilities/lib/image_samplers.pyx":207 * bounds = params['bounds'] * if hasattr(bounds[0], 'units'): * params['bounds'] = tuple(b.in_units('code_length').d for b in bounds) # <<<<<<<<<<<<<< @@ -1412,7 +1448,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid; -/* "yt/utilities/lib/image_samplers.pyx":60 +/* "yt/utilities/lib/image_samplers.pyx":59 * * * cdef class ImageSampler: # <<<<<<<<<<<<<< @@ -1427,8 +1463,8 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler; -/* "yt/utilities/lib/image_samplers.pyx":223 - * free(self.image) +/* "yt/utilities/lib/image_samplers.pyx":211 + * return params * * cdef class ProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< * @@ -1441,7 +1477,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler; -/* "yt/utilities/lib/image_samplers.pyx":242 +/* "yt/utilities/lib/image_samplers.pyx":230 * * * cdef class InterpolatedProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1455,7 +1491,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler; -/* "yt/utilities/lib/image_samplers.pyx":298 +/* "yt/utilities/lib/image_samplers.pyx":286 * * * cdef class VolumeRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1469,7 +1505,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler; -/* "yt/utilities/lib/image_samplers.pyx":386 +/* "yt/utilities/lib/image_samplers.pyx":374 * free(self.vra) * * cdef class LightSourceRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1636,7 +1672,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -1735,6 +1771,14 @@ /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + /* 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) ?\ @@ -1761,6 +1805,13 @@ static void __Pyx_RaiseBufferIndexError(int axis); #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +/* 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() + /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 @@ -1769,14 +1820,12 @@ /* None.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); -/* WriteUnraisableException.proto */ -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename, - int full_traceback, int nogil); - /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); @@ -1803,14 +1852,6 @@ #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #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); - /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); @@ -1883,6 +1924,20 @@ 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*/ +/* 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, @@ -1945,12 +2000,26 @@ /* 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); + /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -2029,23 +2098,15 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); -/* MemviewDtypeToObject.proto */ -static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp); -static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj); - -/* 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_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + /* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -2158,10 +2219,10 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); @@ -2292,42 +2353,40 @@ /* Module declarations from 'cython' */ -/* Module declarations from 'yt.utilities.lib.kdtree_utils' */ - /* Module declarations from 'yt.utilities.lib.volume_container' */ static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, int, int, int); /*proto*/ static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *); /*proto*/ -/* Module declarations from 'libc.math' */ +/* Module declarations from 'yt.utilities.lib.partitioned_grid' */ +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = 0; -/* Module declarations from 'yt.utilities.lib.vec3_ops' */ +/* Module declarations from 'libc.math' */ /* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -/* Module declarations from 'yt.utilities.lib.lenses' */ -static __pyx_t_2yt_9utilities_3lib_6lenses_generate_vector_info_function *__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_plane_parallel; /*proto*/ -static __pyx_t_2yt_9utilities_3lib_6lenses_generate_vector_info_function *__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_null; /*proto*/ -static __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function *__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_plane_parallel; /*proto*/ -static __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function *__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_perspective; /*proto*/ -static __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function *__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_null; /*proto*/ - -/* Module declarations from 'yt.utilities.lib.partitioned_grid' */ -static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = 0; - /* Module declarations from 'yt.utilities.lib.field_interpolation_tables' */ static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_initialize_table(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *, int, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int, int, int); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *, __pyx_t_5numpy_float64_t *); /*proto*/ static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_eval_transfer(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int, struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *, int *, int); /*proto*/ static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_eval_transfer_with_light(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int, struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *, int *, int); /*proto*/ +/* Module declarations from 'yt.utilities.lib.vec3_ops' */ + +/* Module declarations from 'yt.utilities.lib.lenses' */ +static __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function *__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_plane_parallel; /*proto*/ +static __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function *__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_null; /*proto*/ +static __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function *__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_plane_parallel; /*proto*/ +static __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function *__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_perspective; /*proto*/ +static __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function *__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_null; /*proto*/ + /* Module declarations from 'yt.utilities.lib.grid_traversal' */ static int (*__pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume)(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_2yt_9utilities_3lib_14grid_traversal_sampler_function *, void *, struct __pyx_opt_args_2yt_9utilities_3lib_14grid_traversal_walk_volume *__pyx_optional_args); /*proto*/ @@ -2386,6 +2445,7 @@ 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_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 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 "yt.utilities.lib.image_samplers" @@ -2394,12 +2454,12 @@ /* Implementation of 'yt.utilities.lib.image_samplers' */ static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_Ellipsis; -static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_O[] = "O"; @@ -2409,10 +2469,12 @@ static const char __pyx_k_id[] = "id"; static const char __pyx_k_np[] = "np"; static const char __pyx_k_pg[] = "pg"; +static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; @@ -2450,12 +2512,16 @@ 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_result[] = "result"; static const char __pyx_k_struct[] = "struct"; static const char __pyx_k_tables[] = "tables"; static const char __pyx_k_tf_obj[] = "tf_obj"; static const char __pyx_k_unpack[] = "unpack"; +static const char __pyx_k_update[] = "update"; static const char __pyx_k_vp_dir[] = "vp_dir"; static const char __pyx_k_vp_pos[] = "vp_pos"; +static const char __pyx_k_asarray[] = "asarray"; static const char __pyx_k_float64[] = "float64"; static const char __pyx_k_fortran[] = "fortran"; static const char __pyx_k_genexpr[] = "genexpr"; @@ -2464,6 +2530,7 @@ static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_in_units[] = "in_units"; static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_x_bounds[] = "x_bounds"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_enumerate[] = "enumerate"; @@ -2471,27 +2538,35 @@ static const char __pyx_k_lens_type[] = "lens_type"; static const char __pyx_k_light_dir[] = "light_dir"; static const char __pyx_k_n_samples[] = "n_samples"; -static const char __pyx_k_star_list[] = "star_list"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_light_rgba[] = "light_rgba"; 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_camera_data[] = "camera_data"; static const char __pyx_k_code_length[] = "code_length"; static const char __pyx_k_num_threads[] = "num_threads"; static const char __pyx_k_perspective[] = "perspective"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_grey_opacity[] = "grey_opacity"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +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_n_field_tables[] = "n_field_tables"; static const char __pyx_k_plane_parallel[] = "plane-parallel"; +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_field_table_ids[] = "field_table_ids"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_weight_field_ids[] = "weight_field_ids"; static const char __pyx_k_weight_table_ids[] = "weight_table_ids"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +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_contiguous_and_direct[] = ""; @@ -2514,6 +2589,7 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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"; @@ -2522,7 +2598,9 @@ static const char __pyx_k_ensure_code_unit_params_locals_g[] = "ensure_code_unit_params..genexpr"; 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_center_self_extent_function[] = "self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec 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_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_n_s_ASCII; @@ -2535,6 +2613,7 @@ 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; @@ -2545,14 +2624,17 @@ 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_n_s_RuntimeError; static PyObject *__pyx_kp_s_Shapes_s_s_s_and_s_s_s; 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_allocate_buffer; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_asarray; static PyObject *__pyx_n_s_base; static PyObject *__pyx_n_s_bounds; static PyObject *__pyx_n_s_c; @@ -2560,11 +2642,13 @@ static PyObject *__pyx_n_s_camera_data; static PyObject *__pyx_n_s_center; static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_s_code_length; static PyObject *__pyx_kp_s_contiguous_and_direct; static PyObject *__pyx_kp_s_contiguous_and_indirect; static PyObject *__pyx_n_s_d; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dtype_is_object; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_ensure_code_unit_params_locals_g; @@ -2601,6 +2685,8 @@ 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_num_threads; static PyObject *__pyx_n_s_numpy; @@ -2611,22 +2697,31 @@ static PyObject *__pyx_n_s_pack; static PyObject *__pyx_n_s_perspective; static PyObject *__pyx_n_s_pg; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_kp_s_plane_parallel; static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_cython; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_kp_s_self_center_self_extent_function; static PyObject *__pyx_n_s_send; +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_star_list; 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_tables; static PyObject *__pyx_n_s_test; @@ -2637,6 +2732,7 @@ static PyObject *__pyx_n_s_units; 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_vp_dir; static PyObject *__pyx_n_s_vp_pos; static PyObject *__pyx_n_s_weight_field_ids; @@ -2653,7 +2749,6 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_2__call__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self, struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_pg, int __pyx_v_num_threads); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_23ensure_code_unit_params_genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_4ensure_code_unit_params(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self, PyObject *__pyx_v_params); /* proto */ -static void __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_6__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7acenter___get__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7acenter_2__set__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7acenter_4__del__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self); /* proto */ @@ -2678,6 +2773,10 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_9lens_type___get__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_9lens_type_2__set__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_9lens_type_4__del__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler___cinit__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_v_self, PyArrayObject *__pyx_v_vp_pos, PyArrayObject *__pyx_v_vp_dir, PyArrayObject *__pyx_v_center, PyObject *__pyx_v_bounds, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_x_vec, PyArrayObject *__pyx_v_y_vec, PyArrayObject *__pyx_v_width, PyObject *__pyx_v_n_samples, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_6tf_obj___get__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_6tf_obj_2__set__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ @@ -2685,7 +2784,9 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_15my_field_tables___get__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_15my_field_tables_2__set__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_15my_field_tables_4__del__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_v_self); /* proto */ -static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler___cinit__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_v_self, PyArrayObject *__pyx_v_vp_pos, PyArrayObject *__pyx_v_vp_dir, PyArrayObject *__pyx_v_center, PyObject *__pyx_v_bounds, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_x_vec, PyArrayObject *__pyx_v_y_vec, PyArrayObject *__pyx_v_width, PyObject *__pyx_v_tf_obj, PyObject *__pyx_v_n_samples, CYTHON_UNUSED PyObject *__pyx_v_star_list, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler___cinit__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_v_self, PyArrayObject *__pyx_v_vp_pos, PyArrayObject *__pyx_v_vp_dir, PyArrayObject *__pyx_v_center, PyObject *__pyx_v_bounds, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_x_vec, PyArrayObject *__pyx_v_y_vec, PyArrayObject *__pyx_v_width, PyObject *__pyx_v_tf_obj, PyObject *__pyx_v_n_samples, PyObject *__pyx_v_kwargs); /* proto */ static void __pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_2__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_6tf_obj___get__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_6tf_obj_2__set__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ @@ -2693,6 +2794,8 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_15my_field_tables___get__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_15my_field_tables_2__set__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_15my_field_tables_4__del__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler___cinit__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__pyx_v_self, PyArrayObject *__pyx_v_vp_pos, PyArrayObject *__pyx_v_vp_dir, PyArrayObject *__pyx_v_center, PyObject *__pyx_v_bounds, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_x_vec, PyArrayObject *__pyx_v_y_vec, PyArrayObject *__pyx_v_width, PyObject *__pyx_v_tf_obj, PyObject *__pyx_v_n_samples, PyObject *__pyx_v_light_dir, PyObject *__pyx_v_light_rgba, PyObject *__pyx_v_kwargs); /* proto */ static void __pyx_pf_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_2__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_6tf_obj___get__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__pyx_v_self); /* proto */ @@ -2701,6 +2804,8 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_15my_field_tables___get__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_15my_field_tables_2__set__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_15my_field_tables_4__del__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__pyx_v_self, CYTHON_UNUSED 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 */ @@ -2710,8 +2815,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -2733,8 +2842,13 @@ 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_2yt_9utilities_3lib_14image_samplers_ImageSampler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_14image_samplers_ProjectionSampler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -2749,28 +2863,28 @@ static PyObject *__pyx_float_1_; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; -static PyObject *__pyx_int_2; static PyObject *__pyx_int_10; +static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; -static PyObject *__pyx_k__7; -static PyObject *__pyx_k__8; +static PyObject *__pyx_k__15; +static PyObject *__pyx_k__16; 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__27; -static PyObject *__pyx_slice__28; -static PyObject *__pyx_slice__29; +static PyObject *__pyx_slice__41; +static PyObject *__pyx_slice__42; +static PyObject *__pyx_slice__43; 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; @@ -2781,14 +2895,32 @@ static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_codeobj__53; -/* "yt/utilities/lib/image_samplers.pyx":61 +/* "yt/utilities/lib/image_samplers.pyx":60 * * cdef class ImageSampler: * def __init__(self, # <<<<<<<<<<<<<< @@ -2834,13 +2966,21 @@ switch (pos_args) { default: case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } kw_args = PyDict_Size(__pyx_kwds); @@ -2848,45 +2988,52 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vp_pos)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vp_dir)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 1); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 1); __PYX_ERR(0, 60, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_center)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 2); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 2); __PYX_ERR(0, 60, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 3); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 3); __PYX_ERR(0, 60, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 4); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 4); __PYX_ERR(0, 60, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_vec)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 5); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 5); __PYX_ERR(0, 60, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_vec)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 6); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 6); __PYX_ERR(0, 60, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 7); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, 7); __PYX_ERR(0, 60, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 8) ? pos_args : 8; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 61, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 60, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 8) { goto __pyx_L5_argtuple_error; @@ -2900,8 +3047,8 @@ values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); } - __pyx_v_vp_pos = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_vp_pos.memview)) __PYX_ERR(0, 62, __pyx_L3_error) - __pyx_v_vp_dir = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_vp_dir.memview)) __PYX_ERR(0, 63, __pyx_L3_error) + __pyx_v_vp_pos = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_vp_pos.memview)) __PYX_ERR(0, 61, __pyx_L3_error) + __pyx_v_vp_dir = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_vp_dir.memview)) __PYX_ERR(0, 62, __pyx_L3_error) __pyx_v_center = ((PyArrayObject *)values[2]); __pyx_v_bounds = values[3]; __pyx_v_image = ((PyArrayObject *)values[4]); @@ -2911,7 +3058,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 60, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; @@ -2919,11 +3066,11 @@ __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_center), __pyx_ptype_5numpy_ndarray, 1, "center", 0))) __PYX_ERR(0, 64, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 66, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x_vec), __pyx_ptype_5numpy_ndarray, 1, "x_vec", 0))) __PYX_ERR(0, 67, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_vec), __pyx_ptype_5numpy_ndarray, 1, "y_vec", 0))) __PYX_ERR(0, 68, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), __pyx_ptype_5numpy_ndarray, 1, "width", 0))) __PYX_ERR(0, 69, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_center), __pyx_ptype_5numpy_ndarray, 1, "center", 0))) __PYX_ERR(0, 63, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 65, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x_vec), __pyx_ptype_5numpy_ndarray, 1, "x_vec", 0))) __PYX_ERR(0, 66, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_vec), __pyx_ptype_5numpy_ndarray, 1, "y_vec", 0))) __PYX_ERR(0, 67, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), __pyx_ptype_5numpy_ndarray, 1, "width", 0))) __PYX_ERR(0, 68, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler___init__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *)__pyx_v_self), __pyx_v_vp_pos, __pyx_v_vp_dir, __pyx_v_center, __pyx_v_bounds, __pyx_v_image, __pyx_v_x_vec, __pyx_v_y_vec, __pyx_v_width, __pyx_v_args, __pyx_v_kwargs); /* function exit code */ @@ -2938,11 +3085,11 @@ } static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler___init__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self, __Pyx_memviewslice __pyx_v_vp_pos, __Pyx_memviewslice __pyx_v_vp_dir, PyArrayObject *__pyx_v_center, PyObject *__pyx_v_bounds, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_x_vec, PyArrayObject *__pyx_v_y_vec, PyArrayObject *__pyx_v_width, CYTHON_UNUSED PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { - __Pyx_memviewslice __pyx_v_zbuffer = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_image_used = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_mesh_lines = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_camera_data = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_v_i; + PyObject *__pyx_v_camera_data = NULL; + PyObject *__pyx_v_zbuffer = NULL; + PyObject *__pyx_v_image_used = NULL; + PyObject *__pyx_v_mesh_lines = NULL; PyObject *__pyx_v_msg = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_center; __Pyx_Buffer __pyx_pybuffer_center; @@ -2958,17 +3105,17 @@ __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_3; int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; int __pyx_t_10; - int __pyx_t_11; + PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; + __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } }; __pyx_t_5numpy_float64_t __pyx_t_15; Py_ssize_t __pyx_t_16; @@ -2996,197 +3143,180 @@ __pyx_pybuffernd_width.rcbuffer = &__pyx_pybuffer_width; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_center.rcbuffer->pybuffer, (PyObject*)__pyx_v_center, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 61, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_center.rcbuffer->pybuffer, (PyObject*)__pyx_v_center, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 60, __pyx_L1_error) } __pyx_pybuffernd_center.diminfo[0].strides = __pyx_pybuffernd_center.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_center.diminfo[0].shape = __pyx_pybuffernd_center.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 61, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 60, __pyx_L1_error) } __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_image.diminfo[1].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_image.diminfo[1].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_image.diminfo[2].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_image.diminfo[2].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_x_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 61, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_x_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 60, __pyx_L1_error) } __pyx_pybuffernd_x_vec.diminfo[0].strides = __pyx_pybuffernd_x_vec.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x_vec.diminfo[0].shape = __pyx_pybuffernd_x_vec.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_y_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 61, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_y_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 60, __pyx_L1_error) } __pyx_pybuffernd_y_vec.diminfo[0].strides = __pyx_pybuffernd_y_vec.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y_vec.diminfo[0].shape = __pyx_pybuffernd_y_vec.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_width.rcbuffer->pybuffer, (PyObject*)__pyx_v_width, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 61, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_width.rcbuffer->pybuffer, (PyObject*)__pyx_v_width, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 60, __pyx_L1_error) } __pyx_pybuffernd_width.diminfo[0].strides = __pyx_pybuffernd_width.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_width.diminfo[0].shape = __pyx_pybuffernd_width.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/image_samplers.pyx":71 - * np.ndarray[np.float64_t, ndim=1] width, - * *args, **kwargs): - * self.image = calloc(sizeof(ImageContainer), 1) # <<<<<<<<<<<<<< - * cdef np.float64_t[:,:] zbuffer - * cdef np.int64_t[:,:] image_used - */ - __pyx_v_self->image = ((struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *)calloc((sizeof(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer)), 1)); - - /* "yt/utilities/lib/image_samplers.pyx":78 + /* "yt/utilities/lib/image_samplers.pyx":72 * cdef int i * * camera_data = kwargs.pop("camera_data", None) # <<<<<<<<<<<<<< * if camera_data is not None: - * self.image.camera_data = camera_data + * self.camera_data = camera_data */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); 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_3 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_t_2); - if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_camera_data = __pyx_t_3; - __pyx_t_3.memview = NULL; - __pyx_t_3.data = NULL; + __pyx_v_camera_data = __pyx_t_2; + __pyx_t_2 = 0; - /* "yt/utilities/lib/image_samplers.pyx":79 + /* "yt/utilities/lib/image_samplers.pyx":73 * * camera_data = kwargs.pop("camera_data", None) * if camera_data is not None: # <<<<<<<<<<<<<< - * self.image.camera_data = camera_data + * self.camera_data = camera_data * */ - __pyx_t_4 = ((((PyObject *) __pyx_v_camera_data.memview) != Py_None) != 0); + __pyx_t_3 = (__pyx_v_camera_data != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "yt/utilities/lib/image_samplers.pyx":80 + /* "yt/utilities/lib/image_samplers.pyx":74 * camera_data = kwargs.pop("camera_data", None) * if camera_data is not None: - * self.image.camera_data = camera_data # <<<<<<<<<<<<<< + * self.camera_data = camera_data # <<<<<<<<<<<<<< * * zbuffer = kwargs.pop("zbuffer", None) */ - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->camera_data, 0); - __PYX_INC_MEMVIEW(&__pyx_v_camera_data, 0); - __pyx_v_self->image->camera_data = __pyx_v_camera_data; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_v_camera_data); + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 74, __pyx_L1_error) + __PYX_XDEC_MEMVIEW(&__pyx_v_self->camera_data, 0); + __pyx_v_self->camera_data = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; - /* "yt/utilities/lib/image_samplers.pyx":79 + /* "yt/utilities/lib/image_samplers.pyx":73 * * camera_data = kwargs.pop("camera_data", None) * if camera_data is not None: # <<<<<<<<<<<<<< - * self.image.camera_data = camera_data + * self.camera_data = camera_data * */ } - /* "yt/utilities/lib/image_samplers.pyx":82 - * self.image.camera_data = camera_data + /* "yt/utilities/lib/image_samplers.pyx":76 + * self.camera_data = camera_data * * zbuffer = kwargs.pop("zbuffer", None) # <<<<<<<<<<<<<< * if zbuffer is None: * zbuffer = np.ones((image.shape[0], image.shape[1]), "float64") */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_zbuffer = __pyx_t_3; - __pyx_t_3.memview = NULL; - __pyx_t_3.data = NULL; + __pyx_v_zbuffer = __pyx_t_1; + __pyx_t_1 = 0; - /* "yt/utilities/lib/image_samplers.pyx":83 + /* "yt/utilities/lib/image_samplers.pyx":77 * * zbuffer = kwargs.pop("zbuffer", None) * if zbuffer is None: # <<<<<<<<<<<<<< * zbuffer = np.ones((image.shape[0], image.shape[1]), "float64") * */ - __pyx_t_4 = ((((PyObject *) __pyx_v_zbuffer.memview) == Py_None) != 0); - if (__pyx_t_4) { + __pyx_t_4 = (__pyx_v_zbuffer == Py_None); + __pyx_t_3 = (__pyx_t_4 != 0); + if (__pyx_t_3) { - /* "yt/utilities/lib/image_samplers.pyx":84 + /* "yt/utilities/lib/image_samplers.pyx":78 * zbuffer = kwargs.pop("zbuffer", None) * if zbuffer is None: * zbuffer = np.ones((image.shape[0], image.shape[1]), "float64") # <<<<<<<<<<<<<< * * image_used = np.zeros((image.shape[0], image.shape[1]), "int64") */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ones); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ones); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[1])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_2 = 0; - __pyx_t_6 = 0; - __pyx_t_6 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = 0; + __pyx_t_7 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_n_s_float64}; - __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(0, 84, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_n_s_float64}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_n_s_float64}; - __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(0, 84, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_n_s_float64}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_2 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__pyx_t_6) { - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __pyx_t_6 = NULL; + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL; } - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_9, __pyx_t_8); __Pyx_INCREF(__pyx_n_s_float64); __Pyx_GIVEREF(__pyx_n_s_float64); - PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_n_s_float64); - __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_9, __pyx_n_s_float64); + __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_XDEC_MEMVIEW(&__pyx_v_zbuffer, 1); - __pyx_v_zbuffer = __pyx_t_3; - __pyx_t_3.memview = NULL; - __pyx_t_3.data = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_zbuffer, __pyx_t_1); + __pyx_t_1 = 0; - /* "yt/utilities/lib/image_samplers.pyx":83 + /* "yt/utilities/lib/image_samplers.pyx":77 * * zbuffer = kwargs.pop("zbuffer", None) * if zbuffer is None: # <<<<<<<<<<<<<< @@ -3195,191 +3325,183 @@ */ } - /* "yt/utilities/lib/image_samplers.pyx":86 + /* "yt/utilities/lib/image_samplers.pyx":80 * zbuffer = np.ones((image.shape[0], image.shape[1]), "float64") * * image_used = np.zeros((image.shape[0], image.shape[1]), "int64") # <<<<<<<<<<<<<< * mesh_lines = np.zeros((image.shape[0], image.shape[1]), "int64") * */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[1])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); - __pyx_t_5 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = NULL; + __pyx_t_8 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[1])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8); + __pyx_t_6 = 0; __pyx_t_8 = 0; + __pyx_t_8 = NULL; + __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_7)) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_8 = 1; + __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_n_s_int64}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_n_s_int64}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __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; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_n_s_int64}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_n_s_int64}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __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; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; + __pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_8) { + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL; } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_n_s_int64); __Pyx_GIVEREF(__pyx_n_s_int64); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_n_s_int64); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_n_s_int64); + __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_t_1); - if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_image_used = __pyx_t_9; - __pyx_t_9.memview = NULL; - __pyx_t_9.data = NULL; + __pyx_v_image_used = __pyx_t_1; + __pyx_t_1 = 0; - /* "yt/utilities/lib/image_samplers.pyx":87 + /* "yt/utilities/lib/image_samplers.pyx":81 * * image_used = np.zeros((image.shape[0], image.shape[1]), "int64") * mesh_lines = np.zeros((image.shape[0], image.shape[1]), "int64") # <<<<<<<<<<<<<< * * self.lens_type = kwargs.pop("lens_type", None) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[1])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_2 = 0; - __pyx_t_6 = 0; - __pyx_t_6 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = 0; + __pyx_t_7 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_n_s_int64}; - __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(0, 87, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_n_s_int64}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_n_s_int64}; - __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(0, 87, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_n_s_int64}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_2 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__pyx_t_6) { - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __pyx_t_6 = NULL; + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL; } - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_9, __pyx_t_8); __Pyx_INCREF(__pyx_n_s_int64); __Pyx_GIVEREF(__pyx_n_s_int64); - PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_n_s_int64); - __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_9, __pyx_n_s_int64); + __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_t_1); - if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_mesh_lines = __pyx_t_9; - __pyx_t_9.memview = NULL; - __pyx_t_9.data = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_mesh_lines = __pyx_t_1; + __pyx_t_1 = 0; - /* "yt/utilities/lib/image_samplers.pyx":89 + /* "yt/utilities/lib/image_samplers.pyx":83 * mesh_lines = np.zeros((image.shape[0], image.shape[1]), "int64") * * self.lens_type = kwargs.pop("lens_type", None) # <<<<<<<<<<<<<< * if self.lens_type == "plane-parallel": * self.extent_function = lenses.calculate_extent_plane_parallel */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->lens_type); __Pyx_DECREF(__pyx_v_self->lens_type); - __pyx_v_self->lens_type = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_self->lens_type = __pyx_t_6; + __pyx_t_6 = 0; - /* "yt/utilities/lib/image_samplers.pyx":90 + /* "yt/utilities/lib/image_samplers.pyx":84 * * self.lens_type = kwargs.pop("lens_type", None) * if self.lens_type == "plane-parallel": # <<<<<<<<<<<<<< * self.extent_function = lenses.calculate_extent_plane_parallel * self.vector_function = lenses.generate_vector_info_plane_parallel */ - __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_self->lens_type, __pyx_kp_s_plane_parallel, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 90, __pyx_L1_error) - if (__pyx_t_4) { + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_self->lens_type, __pyx_kp_s_plane_parallel, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 84, __pyx_L1_error) + if (__pyx_t_3) { - /* "yt/utilities/lib/image_samplers.pyx":91 + /* "yt/utilities/lib/image_samplers.pyx":85 * self.lens_type = kwargs.pop("lens_type", None) * if self.lens_type == "plane-parallel": * self.extent_function = lenses.calculate_extent_plane_parallel # <<<<<<<<<<<<<< @@ -3388,7 +3510,7 @@ */ __pyx_v_self->extent_function = __pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_plane_parallel; - /* "yt/utilities/lib/image_samplers.pyx":92 + /* "yt/utilities/lib/image_samplers.pyx":86 * if self.lens_type == "plane-parallel": * self.extent_function = lenses.calculate_extent_plane_parallel * self.vector_function = lenses.generate_vector_info_plane_parallel # <<<<<<<<<<<<<< @@ -3397,7 +3519,7 @@ */ __pyx_v_self->vector_function = __pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_plane_parallel; - /* "yt/utilities/lib/image_samplers.pyx":90 + /* "yt/utilities/lib/image_samplers.pyx":84 * * self.lens_type = kwargs.pop("lens_type", None) * if self.lens_type == "plane-parallel": # <<<<<<<<<<<<<< @@ -3407,7 +3529,7 @@ goto __pyx_L5; } - /* "yt/utilities/lib/image_samplers.pyx":94 + /* "yt/utilities/lib/image_samplers.pyx":88 * self.vector_function = lenses.generate_vector_info_plane_parallel * else: * if not (vp_pos.shape[0] == vp_dir.shape[0] == image.shape[0]) or \ # <<<<<<<<<<<<<< @@ -3415,145 +3537,145 @@ * msg = "Bad lens shape / direction for %s\n" % (self.lens_type) */ /*else*/ { - __pyx_t_10 = ((__pyx_v_vp_pos.shape[0]) == (__pyx_v_vp_dir.shape[0])); - if (__pyx_t_10) { - __pyx_t_10 = ((__pyx_v_vp_dir.shape[0]) == (__pyx_v_image->dimensions[0])); + __pyx_t_4 = ((__pyx_v_vp_pos.shape[0]) == (__pyx_v_vp_dir.shape[0])); + if (__pyx_t_4) { + __pyx_t_4 = ((__pyx_v_vp_dir.shape[0]) == (__pyx_v_image->dimensions[0])); } - __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); - if (!__pyx_t_11) { + __pyx_t_10 = ((!(__pyx_t_4 != 0)) != 0); + if (!__pyx_t_10) { } else { - __pyx_t_4 = __pyx_t_11; + __pyx_t_3 = __pyx_t_10; goto __pyx_L7_bool_binop_done; } - /* "yt/utilities/lib/image_samplers.pyx":95 + /* "yt/utilities/lib/image_samplers.pyx":89 * else: * if not (vp_pos.shape[0] == vp_dir.shape[0] == image.shape[0]) or \ * not (vp_pos.shape[1] == vp_dir.shape[1] == image.shape[1]): # <<<<<<<<<<<<<< * msg = "Bad lens shape / direction for %s\n" % (self.lens_type) * msg += "Shapes: (%s - %s - %s) and (%s - %s - %s)" % ( */ - __pyx_t_11 = ((__pyx_v_vp_pos.shape[1]) == (__pyx_v_vp_dir.shape[1])); - if (__pyx_t_11) { - __pyx_t_11 = ((__pyx_v_vp_dir.shape[1]) == (__pyx_v_image->dimensions[1])); + __pyx_t_10 = ((__pyx_v_vp_pos.shape[1]) == (__pyx_v_vp_dir.shape[1])); + if (__pyx_t_10) { + __pyx_t_10 = ((__pyx_v_vp_dir.shape[1]) == (__pyx_v_image->dimensions[1])); } - __pyx_t_10 = ((!(__pyx_t_11 != 0)) != 0); - __pyx_t_4 = __pyx_t_10; + __pyx_t_4 = ((!(__pyx_t_10 != 0)) != 0); + __pyx_t_3 = __pyx_t_4; __pyx_L7_bool_binop_done:; - /* "yt/utilities/lib/image_samplers.pyx":94 + /* "yt/utilities/lib/image_samplers.pyx":88 * self.vector_function = lenses.generate_vector_info_plane_parallel * else: * if not (vp_pos.shape[0] == vp_dir.shape[0] == image.shape[0]) or \ # <<<<<<<<<<<<<< * not (vp_pos.shape[1] == vp_dir.shape[1] == image.shape[1]): * msg = "Bad lens shape / direction for %s\n" % (self.lens_type) */ - if (__pyx_t_4) { + if (__pyx_t_3) { - /* "yt/utilities/lib/image_samplers.pyx":96 + /* "yt/utilities/lib/image_samplers.pyx":90 * if not (vp_pos.shape[0] == vp_dir.shape[0] == image.shape[0]) or \ * not (vp_pos.shape[1] == vp_dir.shape[1] == image.shape[1]): * msg = "Bad lens shape / direction for %s\n" % (self.lens_type) # <<<<<<<<<<<<<< * msg += "Shapes: (%s - %s - %s) and (%s - %s - %s)" % ( * vp_pos.shape[0], vp_dir.shape[0], image.shape[0], */ - __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Bad_lens_shape_direction_for_s, __pyx_v_self->lens_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_v_msg = ((PyObject*)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Bad_lens_shape_direction_for_s, __pyx_v_self->lens_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_msg = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; - /* "yt/utilities/lib/image_samplers.pyx":98 + /* "yt/utilities/lib/image_samplers.pyx":92 * msg = "Bad lens shape / direction for %s\n" % (self.lens_type) * msg += "Shapes: (%s - %s - %s) and (%s - %s - %s)" % ( * vp_pos.shape[0], vp_dir.shape[0], image.shape[0], # <<<<<<<<<<<<<< * vp_pos.shape[1], vp_dir.shape[1], image.shape[1]) * raise RuntimeError(msg) */ - __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_vp_pos.shape[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_vp_dir.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_vp_pos.shape[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_vp_dir.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "yt/utilities/lib/image_samplers.pyx":99 + /* "yt/utilities/lib/image_samplers.pyx":93 * msg += "Shapes: (%s - %s - %s) and (%s - %s - %s)" % ( * vp_pos.shape[0], vp_dir.shape[0], image.shape[0], * vp_pos.shape[1], vp_dir.shape[1], image.shape[1]) # <<<<<<<<<<<<<< * raise RuntimeError(msg) * */ - __pyx_t_7 = PyInt_FromSsize_t((__pyx_v_vp_pos.shape[1])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_8 = PyInt_FromSsize_t((__pyx_v_vp_pos.shape[1])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyInt_FromSsize_t((__pyx_v_vp_dir.shape[1])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_vp_dir.shape[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[1])); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_image->dimensions[1])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); - /* "yt/utilities/lib/image_samplers.pyx":98 + /* "yt/utilities/lib/image_samplers.pyx":92 * msg = "Bad lens shape / direction for %s\n" % (self.lens_type) * msg += "Shapes: (%s - %s - %s) and (%s - %s - %s)" % ( * vp_pos.shape[0], vp_dir.shape[0], image.shape[0], # <<<<<<<<<<<<<< * vp_pos.shape[1], vp_dir.shape[1], image.shape[1]) * raise RuntimeError(msg) */ - __pyx_t_13 = PyTuple_New(6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_5); + __pyx_t_12 = PyTuple_New(6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_12); - __pyx_t_5 = 0; + PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_11); + __pyx_t_6 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0; + __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_6 = 0; - __pyx_t_12 = 0; + __pyx_t_11 = 0; - /* "yt/utilities/lib/image_samplers.pyx":97 + /* "yt/utilities/lib/image_samplers.pyx":91 * not (vp_pos.shape[1] == vp_dir.shape[1] == image.shape[1]): * msg = "Bad lens shape / direction for %s\n" % (self.lens_type) * msg += "Shapes: (%s - %s - %s) and (%s - %s - %s)" % ( # <<<<<<<<<<<<<< * vp_pos.shape[0], vp_dir.shape[0], image.shape[0], * vp_pos.shape[1], vp_dir.shape[1], image.shape[1]) */ - __pyx_t_12 = __Pyx_PyString_Format(__pyx_kp_s_Shapes_s_s_s_and_s_s_s, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = __Pyx_PyString_Format(__pyx_kp_s_Shapes_s_s_s_and_s_s_s, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_13)); - __pyx_t_13 = 0; + __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_12)); + __pyx_t_12 = 0; - /* "yt/utilities/lib/image_samplers.pyx":100 + /* "yt/utilities/lib/image_samplers.pyx":94 * vp_pos.shape[0], vp_dir.shape[0], image.shape[0], * vp_pos.shape[1], vp_dir.shape[1], image.shape[1]) * raise RuntimeError(msg) # <<<<<<<<<<<<<< * * if camera_data is not None and self.lens_type == 'perspective': */ - __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); - PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_msg); - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_Raise(__pyx_t_12, 0, 0, 0); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_msg); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_Raise(__pyx_t_11, 0, 0, 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __PYX_ERR(0, 94, __pyx_L1_error) - /* "yt/utilities/lib/image_samplers.pyx":94 + /* "yt/utilities/lib/image_samplers.pyx":88 * self.vector_function = lenses.generate_vector_info_plane_parallel * else: * if not (vp_pos.shape[0] == vp_dir.shape[0] == image.shape[0]) or \ # <<<<<<<<<<<<<< @@ -3562,25 +3684,26 @@ */ } - /* "yt/utilities/lib/image_samplers.pyx":102 + /* "yt/utilities/lib/image_samplers.pyx":96 * raise RuntimeError(msg) * * if camera_data is not None and self.lens_type == 'perspective': # <<<<<<<<<<<<<< * self.extent_function = lenses.calculate_extent_perspective * else: */ - __pyx_t_10 = ((((PyObject *) __pyx_v_camera_data.memview) != Py_None) != 0); + __pyx_t_4 = (__pyx_v_camera_data != Py_None); + __pyx_t_10 = (__pyx_t_4 != 0); if (__pyx_t_10) { } else { - __pyx_t_4 = __pyx_t_10; + __pyx_t_3 = __pyx_t_10; goto __pyx_L10_bool_binop_done; } - __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_self->lens_type, __pyx_n_s_perspective, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 102, __pyx_L1_error) - __pyx_t_4 = __pyx_t_10; + __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_self->lens_type, __pyx_n_s_perspective, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_3 = __pyx_t_10; __pyx_L10_bool_binop_done:; - if (__pyx_t_4) { + if (__pyx_t_3) { - /* "yt/utilities/lib/image_samplers.pyx":103 + /* "yt/utilities/lib/image_samplers.pyx":97 * * if camera_data is not None and self.lens_type == 'perspective': * self.extent_function = lenses.calculate_extent_perspective # <<<<<<<<<<<<<< @@ -3589,7 +3712,7 @@ */ __pyx_v_self->extent_function = __pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_perspective; - /* "yt/utilities/lib/image_samplers.pyx":102 + /* "yt/utilities/lib/image_samplers.pyx":96 * raise RuntimeError(msg) * * if camera_data is not None and self.lens_type == 'perspective': # <<<<<<<<<<<<<< @@ -3599,7 +3722,7 @@ goto __pyx_L9; } - /* "yt/utilities/lib/image_samplers.pyx":105 + /* "yt/utilities/lib/image_samplers.pyx":99 * self.extent_function = lenses.calculate_extent_perspective * else: * self.extent_function = lenses.calculate_extent_null # <<<<<<<<<<<<<< @@ -3611,7 +3734,7 @@ } __pyx_L9:; - /* "yt/utilities/lib/image_samplers.pyx":106 + /* "yt/utilities/lib/image_samplers.pyx":100 * else: * self.extent_function = lenses.calculate_extent_null * self.\ # <<<<<<<<<<<<<< @@ -3622,54 +3745,54 @@ } __pyx_L5:; - /* "yt/utilities/lib/image_samplers.pyx":113 + /* "yt/utilities/lib/image_samplers.pyx":107 * # "atleast_3d" versions. Also, note that we re-assign the input * # arguments. - * self.image.vp_pos = vp_pos # <<<<<<<<<<<<<< - * self.image.vp_dir = vp_dir - * self.image.image = self.aimage = image + * self.vp_pos = vp_pos # <<<<<<<<<<<<<< + * self.vp_dir = vp_dir + * self.image = self.aimage = image */ - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->vp_pos, 0); + __PYX_XDEC_MEMVIEW(&__pyx_v_self->vp_pos, 0); __PYX_INC_MEMVIEW(&__pyx_v_vp_pos, 0); - __pyx_v_self->image->vp_pos = __pyx_v_vp_pos; + __pyx_v_self->vp_pos = __pyx_v_vp_pos; - /* "yt/utilities/lib/image_samplers.pyx":114 + /* "yt/utilities/lib/image_samplers.pyx":108 * # arguments. - * self.image.vp_pos = vp_pos - * self.image.vp_dir = vp_dir # <<<<<<<<<<<<<< - * self.image.image = self.aimage = image + * self.vp_pos = vp_pos + * self.vp_dir = vp_dir # <<<<<<<<<<<<<< + * self.image = self.aimage = image * self.acenter = center */ - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->vp_dir, 0); + __PYX_XDEC_MEMVIEW(&__pyx_v_self->vp_dir, 0); __PYX_INC_MEMVIEW(&__pyx_v_vp_dir, 0); - __pyx_v_self->image->vp_dir = __pyx_v_vp_dir; + __pyx_v_self->vp_dir = __pyx_v_vp_dir; - /* "yt/utilities/lib/image_samplers.pyx":115 - * self.image.vp_pos = vp_pos - * self.image.vp_dir = vp_dir - * self.image.image = self.aimage = image # <<<<<<<<<<<<<< + /* "yt/utilities/lib/image_samplers.pyx":109 + * self.vp_pos = vp_pos + * self.vp_dir = vp_dir + * self.image = self.aimage = image # <<<<<<<<<<<<<< * self.acenter = center - * self.image.center = center.data + * self.center = center.data */ - __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_image)); - if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 115, __pyx_L1_error) - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->image, 0); - __PYX_INC_MEMVIEW(&__pyx_t_14, 0); - __pyx_v_self->image->image = __pyx_t_14; + __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_image)); + if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 109, __pyx_L1_error) + __PYX_XDEC_MEMVIEW(&__pyx_v_self->image, 0); + __PYX_INC_MEMVIEW(&__pyx_t_13, 0); + __pyx_v_self->image = __pyx_t_13; __Pyx_INCREF(((PyObject *)__pyx_v_image)); __Pyx_GIVEREF(((PyObject *)__pyx_v_image)); __Pyx_GOTREF(__pyx_v_self->aimage); __Pyx_DECREF(__pyx_v_self->aimage); __pyx_v_self->aimage = ((PyObject *)__pyx_v_image); - __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); - __pyx_t_14.memview = NULL; - __pyx_t_14.data = NULL; - - /* "yt/utilities/lib/image_samplers.pyx":116 - * self.image.vp_dir = vp_dir - * self.image.image = self.aimage = image + __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1); + __pyx_t_13.memview = NULL; + __pyx_t_13.data = NULL; + + /* "yt/utilities/lib/image_samplers.pyx":110 + * self.vp_dir = vp_dir + * self.image = self.aimage = image * self.acenter = center # <<<<<<<<<<<<<< - * self.image.center = center.data + * self.center = center.data * self.ax_vec = x_vec */ __Pyx_INCREF(((PyObject *)__pyx_v_center)); @@ -3678,20 +3801,20 @@ __Pyx_DECREF(__pyx_v_self->acenter); __pyx_v_self->acenter = ((PyObject *)__pyx_v_center); - /* "yt/utilities/lib/image_samplers.pyx":117 - * self.image.image = self.aimage = image + /* "yt/utilities/lib/image_samplers.pyx":111 + * self.image = self.aimage = image * self.acenter = center - * self.image.center = center.data # <<<<<<<<<<<<<< + * self.center = center.data # <<<<<<<<<<<<<< * self.ax_vec = x_vec - * self.image.x_vec = x_vec.data + * self.x_vec = x_vec.data */ - __pyx_v_self->image->center = ((__pyx_t_5numpy_float64_t *)__pyx_v_center->data); + __pyx_v_self->center = ((__pyx_t_5numpy_float64_t *)__pyx_v_center->data); - /* "yt/utilities/lib/image_samplers.pyx":118 + /* "yt/utilities/lib/image_samplers.pyx":112 * self.acenter = center - * self.image.center = center.data + * self.center = center.data * self.ax_vec = x_vec # <<<<<<<<<<<<<< - * self.image.x_vec = x_vec.data + * self.x_vec = x_vec.data * self.ay_vec = y_vec */ __Pyx_INCREF(((PyObject *)__pyx_v_x_vec)); @@ -3700,21 +3823,21 @@ __Pyx_DECREF(__pyx_v_self->ax_vec); __pyx_v_self->ax_vec = ((PyObject *)__pyx_v_x_vec); - /* "yt/utilities/lib/image_samplers.pyx":119 - * self.image.center = center.data + /* "yt/utilities/lib/image_samplers.pyx":113 + * self.center = center.data * self.ax_vec = x_vec - * self.image.x_vec = x_vec.data # <<<<<<<<<<<<<< + * self.x_vec = x_vec.data # <<<<<<<<<<<<<< * self.ay_vec = y_vec - * self.image.y_vec = y_vec.data + * self.y_vec = y_vec.data */ - __pyx_v_self->image->x_vec = ((__pyx_t_5numpy_float64_t *)__pyx_v_x_vec->data); + __pyx_v_self->x_vec = ((__pyx_t_5numpy_float64_t *)__pyx_v_x_vec->data); - /* "yt/utilities/lib/image_samplers.pyx":120 + /* "yt/utilities/lib/image_samplers.pyx":114 * self.ax_vec = x_vec - * self.image.x_vec = x_vec.data + * self.x_vec = x_vec.data * self.ay_vec = y_vec # <<<<<<<<<<<<<< - * self.image.y_vec = y_vec.data - * self.image.zbuffer = self.azbuffer = zbuffer + * self.y_vec = y_vec.data + * self.zbuffer = zbuffer */ __Pyx_INCREF(((PyObject *)__pyx_v_y_vec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_y_vec)); @@ -3722,168 +3845,336 @@ __Pyx_DECREF(__pyx_v_self->ay_vec); __pyx_v_self->ay_vec = ((PyObject *)__pyx_v_y_vec); - /* "yt/utilities/lib/image_samplers.pyx":121 - * self.image.x_vec = x_vec.data + /* "yt/utilities/lib/image_samplers.pyx":115 + * self.x_vec = x_vec.data * self.ay_vec = y_vec - * self.image.y_vec = y_vec.data # <<<<<<<<<<<<<< - * self.image.zbuffer = self.azbuffer = zbuffer - * self.image.image_used = self.aimage_used = image_used + * self.y_vec = y_vec.data # <<<<<<<<<<<<<< + * self.zbuffer = zbuffer + * self.azbuffer = np.asarray(zbuffer) */ - __pyx_v_self->image->y_vec = ((__pyx_t_5numpy_float64_t *)__pyx_v_y_vec->data); + __pyx_v_self->y_vec = ((__pyx_t_5numpy_float64_t *)__pyx_v_y_vec->data); - /* "yt/utilities/lib/image_samplers.pyx":122 + /* "yt/utilities/lib/image_samplers.pyx":116 * self.ay_vec = y_vec - * self.image.y_vec = y_vec.data - * self.image.zbuffer = self.azbuffer = zbuffer # <<<<<<<<<<<<<< - * self.image.image_used = self.aimage_used = image_used - * self.image.mesh_lines = self.amesh_lines = mesh_lines + * self.y_vec = y_vec.data + * self.zbuffer = zbuffer # <<<<<<<<<<<<<< + * self.azbuffer = np.asarray(zbuffer) + * self.image_used = image_used + */ + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_v_zbuffer); + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 116, __pyx_L1_error) + __PYX_XDEC_MEMVIEW(&__pyx_v_self->zbuffer, 0); + __pyx_v_self->zbuffer = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "yt/utilities/lib/image_samplers.pyx":117 + * self.y_vec = y_vec.data + * self.zbuffer = zbuffer + * self.azbuffer = np.asarray(zbuffer) # <<<<<<<<<<<<<< + * self.image_used = image_used + * self.aimage_used = np.asarray(image_used) */ - __pyx_t_12 = __pyx_memoryview_fromslice(__pyx_v_zbuffer, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->zbuffer, 0); - __PYX_INC_MEMVIEW(&__pyx_v_zbuffer, 0); - __pyx_v_self->image->zbuffer = __pyx_v_zbuffer; - __Pyx_INCREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + if (!__pyx_t_12) { + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_zbuffer); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_zbuffer}; + __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_11); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_zbuffer}; + __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_11); + } else + #endif + { + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); __pyx_t_12 = NULL; + __Pyx_INCREF(__pyx_v_zbuffer); + __Pyx_GIVEREF(__pyx_v_zbuffer); + PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_zbuffer); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GIVEREF(__pyx_t_11); __Pyx_GOTREF(__pyx_v_self->azbuffer); __Pyx_DECREF(__pyx_v_self->azbuffer); - __pyx_v_self->azbuffer = __pyx_t_12; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_self->azbuffer = __pyx_t_11; + __pyx_t_11 = 0; - /* "yt/utilities/lib/image_samplers.pyx":123 - * self.image.y_vec = y_vec.data - * self.image.zbuffer = self.azbuffer = zbuffer - * self.image.image_used = self.aimage_used = image_used # <<<<<<<<<<<<<< - * self.image.mesh_lines = self.amesh_lines = mesh_lines - * self.image.nv[0] = image.shape[0] + /* "yt/utilities/lib/image_samplers.pyx":118 + * self.zbuffer = zbuffer + * self.azbuffer = np.asarray(zbuffer) + * self.image_used = image_used # <<<<<<<<<<<<<< + * self.aimage_used = np.asarray(image_used) + * self.mesh_lines = mesh_lines + */ + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_v_image_used); + if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 118, __pyx_L1_error) + __PYX_XDEC_MEMVIEW(&__pyx_v_self->image_used, 0); + __pyx_v_self->image_used = __pyx_t_14; + __pyx_t_14.memview = NULL; + __pyx_t_14.data = NULL; + + /* "yt/utilities/lib/image_samplers.pyx":119 + * self.azbuffer = np.asarray(zbuffer) + * self.image_used = image_used + * self.aimage_used = np.asarray(image_used) # <<<<<<<<<<<<<< + * self.mesh_lines = mesh_lines + * self.amesh_lines = np.asarray(mesh_lines) */ - __pyx_t_12 = __pyx_memoryview_fromslice(__pyx_v_image_used, 2, (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_12)) __PYX_ERR(0, 123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->image_used, 0); - __PYX_INC_MEMVIEW(&__pyx_v_image_used, 0); - __pyx_v_self->image->image_used = __pyx_v_image_used; - __Pyx_INCREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + if (!__pyx_t_7) { + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_image_used); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_image_used}; + __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_11); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_image_used}; + __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_11); + } else + #endif + { + __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL; + __Pyx_INCREF(__pyx_v_image_used); + __Pyx_GIVEREF(__pyx_v_image_used); + PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_image_used); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GIVEREF(__pyx_t_11); __Pyx_GOTREF(__pyx_v_self->aimage_used); __Pyx_DECREF(__pyx_v_self->aimage_used); - __pyx_v_self->aimage_used = __pyx_t_12; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_self->aimage_used = __pyx_t_11; + __pyx_t_11 = 0; - /* "yt/utilities/lib/image_samplers.pyx":124 - * self.image.zbuffer = self.azbuffer = zbuffer - * self.image.image_used = self.aimage_used = image_used - * self.image.mesh_lines = self.amesh_lines = mesh_lines # <<<<<<<<<<<<<< - * self.image.nv[0] = image.shape[0] - * self.image.nv[1] = image.shape[1] - */ - __pyx_t_12 = __pyx_memoryview_fromslice(__pyx_v_mesh_lines, 2, (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_12)) __PYX_ERR(0, 124, __pyx_L1_error) + /* "yt/utilities/lib/image_samplers.pyx":120 + * self.image_used = image_used + * self.aimage_used = np.asarray(image_used) + * self.mesh_lines = mesh_lines # <<<<<<<<<<<<<< + * self.amesh_lines = np.asarray(mesh_lines) + * self.nv[0] = image.shape[0] + */ + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_v_mesh_lines); + if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 120, __pyx_L1_error) + __PYX_XDEC_MEMVIEW(&__pyx_v_self->mesh_lines, 0); + __pyx_v_self->mesh_lines = __pyx_t_14; + __pyx_t_14.memview = NULL; + __pyx_t_14.data = NULL; + + /* "yt/utilities/lib/image_samplers.pyx":121 + * self.aimage_used = np.asarray(image_used) + * self.mesh_lines = mesh_lines + * self.amesh_lines = np.asarray(mesh_lines) # <<<<<<<<<<<<<< + * self.nv[0] = image.shape[0] + * self.nv[1] = image.shape[1] + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->mesh_lines, 0); - __PYX_INC_MEMVIEW(&__pyx_v_mesh_lines, 0); - __pyx_v_self->image->mesh_lines = __pyx_v_mesh_lines; - __Pyx_INCREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + if (!__pyx_t_8) { + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_mesh_lines); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_12)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_mesh_lines}; + __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_11); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_mesh_lines}; + __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_11); + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL; + __Pyx_INCREF(__pyx_v_mesh_lines); + __Pyx_GIVEREF(__pyx_v_mesh_lines); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_mesh_lines); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GIVEREF(__pyx_t_11); __Pyx_GOTREF(__pyx_v_self->amesh_lines); __Pyx_DECREF(__pyx_v_self->amesh_lines); - __pyx_v_self->amesh_lines = __pyx_t_12; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_self->amesh_lines = __pyx_t_11; + __pyx_t_11 = 0; - /* "yt/utilities/lib/image_samplers.pyx":125 - * self.image.image_used = self.aimage_used = image_used - * self.image.mesh_lines = self.amesh_lines = mesh_lines - * self.image.nv[0] = image.shape[0] # <<<<<<<<<<<<<< - * self.image.nv[1] = image.shape[1] - * for i in range(4): self.image.bounds[i] = bounds[i] + /* "yt/utilities/lib/image_samplers.pyx":122 + * self.mesh_lines = mesh_lines + * self.amesh_lines = np.asarray(mesh_lines) + * self.nv[0] = image.shape[0] # <<<<<<<<<<<<<< + * self.nv[1] = image.shape[1] + * for i in range(4): self.bounds[i] = bounds[i] */ - (__pyx_v_self->image->nv[0]) = (__pyx_v_image->dimensions[0]); + (__pyx_v_self->nv[0]) = (__pyx_v_image->dimensions[0]); - /* "yt/utilities/lib/image_samplers.pyx":126 - * self.image.mesh_lines = self.amesh_lines = mesh_lines - * self.image.nv[0] = image.shape[0] - * self.image.nv[1] = image.shape[1] # <<<<<<<<<<<<<< - * for i in range(4): self.image.bounds[i] = bounds[i] - * self.image.pdx = (bounds[1] - bounds[0])/self.image.nv[0] + /* "yt/utilities/lib/image_samplers.pyx":123 + * self.amesh_lines = np.asarray(mesh_lines) + * self.nv[0] = image.shape[0] + * self.nv[1] = image.shape[1] # <<<<<<<<<<<<<< + * for i in range(4): self.bounds[i] = bounds[i] + * self.pdx = (bounds[1] - bounds[0])/self.nv[0] */ - (__pyx_v_self->image->nv[1]) = (__pyx_v_image->dimensions[1]); + (__pyx_v_self->nv[1]) = (__pyx_v_image->dimensions[1]); - /* "yt/utilities/lib/image_samplers.pyx":127 - * self.image.nv[0] = image.shape[0] - * self.image.nv[1] = image.shape[1] - * for i in range(4): self.image.bounds[i] = bounds[i] # <<<<<<<<<<<<<< - * self.image.pdx = (bounds[1] - bounds[0])/self.image.nv[0] - * self.image.pdy = (bounds[3] - bounds[2])/self.image.nv[1] - */ - for (__pyx_t_8 = 0; __pyx_t_8 < 4; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_bounds, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - (__pyx_v_self->image->bounds[__pyx_v_i]) = __pyx_t_15; - } - - /* "yt/utilities/lib/image_samplers.pyx":128 - * self.image.nv[1] = image.shape[1] - * for i in range(4): self.image.bounds[i] = bounds[i] - * self.image.pdx = (bounds[1] - bounds[0])/self.image.nv[0] # <<<<<<<<<<<<<< - * self.image.pdy = (bounds[3] - bounds[2])/self.image.nv[1] + /* "yt/utilities/lib/image_samplers.pyx":124 + * self.nv[0] = image.shape[0] + * self.nv[1] = image.shape[1] + * for i in range(4): self.bounds[i] = bounds[i] # <<<<<<<<<<<<<< + * self.pdx = (bounds[1] - bounds[0])/self.nv[0] + * self.pdy = (bounds[3] - bounds[2])/self.nv[1] + */ + for (__pyx_t_9 = 0; __pyx_t_9 < 4; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_bounds, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + (__pyx_v_self->bounds[__pyx_v_i]) = __pyx_t_15; + } + + /* "yt/utilities/lib/image_samplers.pyx":125 + * self.nv[1] = image.shape[1] + * for i in range(4): self.bounds[i] = bounds[i] + * self.pdx = (bounds[1] - bounds[0])/self.nv[0] # <<<<<<<<<<<<<< + * self.pdy = (bounds[3] - bounds[2])/self.nv[1] * for i in range(3): */ - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_bounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_bounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_bounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_bounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Subtract(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyInt_From_int((__pyx_v_self->image->nv[0])); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_From_int((__pyx_v_self->nv[0])); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_v_self->image->pdx = __pyx_t_15; + __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_self->pdx = __pyx_t_15; - /* "yt/utilities/lib/image_samplers.pyx":129 - * for i in range(4): self.image.bounds[i] = bounds[i] - * self.image.pdx = (bounds[1] - bounds[0])/self.image.nv[0] - * self.image.pdy = (bounds[3] - bounds[2])/self.image.nv[1] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/image_samplers.pyx":126 + * for i in range(4): self.bounds[i] = bounds[i] + * self.pdx = (bounds[1] - bounds[0])/self.nv[0] + * self.pdy = (bounds[3] - bounds[2])/self.nv[1] # <<<<<<<<<<<<<< * for i in range(3): * self.width[i] = width[i] */ - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_bounds, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_bounds, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_bounds, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_bounds, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Subtract(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyInt_From_int((__pyx_v_self->image->nv[1])); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_From_int((__pyx_v_self->nv[1])); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_v_self->image->pdy = __pyx_t_15; + __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_self->pdy = __pyx_t_15; - /* "yt/utilities/lib/image_samplers.pyx":130 - * self.image.pdx = (bounds[1] - bounds[0])/self.image.nv[0] - * self.image.pdy = (bounds[3] - bounds[2])/self.image.nv[1] + /* "yt/utilities/lib/image_samplers.pyx":127 + * self.pdx = (bounds[1] - bounds[0])/self.nv[0] + * self.pdy = (bounds[3] - bounds[2])/self.nv[1] * for i in range(3): # <<<<<<<<<<<<<< * self.width[i] = width[i] * */ - for (__pyx_t_8 = 0; __pyx_t_8 < 3; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; + for (__pyx_t_9 = 0; __pyx_t_9 < 3; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; - /* "yt/utilities/lib/image_samplers.pyx":131 - * self.image.pdy = (bounds[3] - bounds[2])/self.image.nv[1] + /* "yt/utilities/lib/image_samplers.pyx":128 + * self.pdy = (bounds[3] - bounds[2])/self.nv[1] * for i in range(3): * self.width[i] = width[i] # <<<<<<<<<<<<<< * @@ -3897,12 +4188,12 @@ } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_width.diminfo[0].shape)) __pyx_t_17 = 0; if (unlikely(__pyx_t_17 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_17); - __PYX_ERR(0, 131, __pyx_L1_error) + __PYX_ERR(0, 128, __pyx_L1_error) } (__pyx_v_self->width[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_width.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_width.diminfo[0].strides)); } - /* "yt/utilities/lib/image_samplers.pyx":61 + /* "yt/utilities/lib/image_samplers.pyx":60 * * cdef class ImageSampler: * def __init__(self, # <<<<<<<<<<<<<< @@ -3916,13 +4207,13 @@ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1); - __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_13); + __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare @@ -3944,10 +4235,10 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_vec.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y_vec.rcbuffer->pybuffer); __pyx_L2:; - __PYX_XDEC_MEMVIEW(&__pyx_v_zbuffer, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_image_used, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_mesh_lines, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_camera_data, 1); + __Pyx_XDECREF(__pyx_v_camera_data); + __Pyx_XDECREF(__pyx_v_zbuffer); + __Pyx_XDECREF(__pyx_v_image_used); + __Pyx_XDECREF(__pyx_v_mesh_lines); __Pyx_XDECREF(__pyx_v_msg); __PYX_XDEC_MEMVIEW(&__pyx_v_vp_pos, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_vp_dir, 1); @@ -3955,7 +4246,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pyx":136 +/* "yt/utilities/lib/image_samplers.pyx":133 * @cython.wraparound(False) * @cython.cdivision(True) * def __call__(self, PartitionedGrid pg, int num_threads = 0): # <<<<<<<<<<<<<< @@ -3979,7 +4270,9 @@ 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; } @@ -3988,6 +4281,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pg)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_threads); @@ -3995,11 +4289,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 136, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 133, __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; @@ -4007,20 +4302,20 @@ } __pyx_v_pg = ((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)values[0]); if (values[1]) { - __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L3_error) + __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) } else { __pyx_v_num_threads = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 133, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.image_samplers.ImageSampler.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pg), __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid, 1, "pg", 0))) __PYX_ERR(0, 136, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pg), __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid, 1, "pg", 0))) __PYX_ERR(0, 133, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_2__call__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *)__pyx_v_self), __pyx_v_pg, __pyx_v_num_threads); /* function exit code */ @@ -4040,7 +4335,6 @@ int __pyx_v_j; __pyx_t_5numpy_int64_t __pyx_v_iter[4]; struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc; - struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *__pyx_v_im; __pyx_t_5numpy_float64_t *__pyx_v_v_pos; __pyx_t_5numpy_float64_t *__pyx_v_v_dir; __pyx_t_5numpy_float64_t __pyx_v_max_t; @@ -4053,120 +4347,109 @@ PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_t_1; - struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *__pyx_t_2; - int __pyx_t_3; - void *__pyx_t_4; + int __pyx_t_2; + void *__pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; __pyx_t_5numpy_int64_t __pyx_t_5; __pyx_t_5numpy_int64_t __pyx_t_6; - __pyx_t_5numpy_int64_t __pyx_t_7; - int __pyx_t_8; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; Py_ssize_t __pyx_t_10; Py_ssize_t __pyx_t_11; Py_ssize_t __pyx_t_12; - Py_ssize_t __pyx_t_13; - struct __pyx_opt_args_2yt_9utilities_3lib_14grid_traversal_walk_volume __pyx_t_14; - int __pyx_t_15; + struct __pyx_opt_args_2yt_9utilities_3lib_14grid_traversal_walk_volume __pyx_t_13; + 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; - PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_18 = NULL; __Pyx_RefNannySetupContext("__call__", 0); - /* "yt/utilities/lib/image_samplers.pyx":142 + /* "yt/utilities/lib/image_samplers.pyx":139 * cdef int vi, vj, hit, i, j * cdef np.int64_t iter[4] * cdef VolumeContainer *vc = pg.container # <<<<<<<<<<<<<< - * cdef ImageContainer *im = self.image * self.setup(pg) + * cdef np.float64_t *v_pos */ __pyx_t_1 = __pyx_v_pg->container; __pyx_v_vc = __pyx_t_1; - /* "yt/utilities/lib/image_samplers.pyx":143 + /* "yt/utilities/lib/image_samplers.pyx":140 * cdef np.int64_t iter[4] * cdef VolumeContainer *vc = pg.container - * cdef ImageContainer *im = self.image # <<<<<<<<<<<<<< - * self.setup(pg) - * cdef np.float64_t *v_pos - */ - __pyx_t_2 = __pyx_v_self->image; - __pyx_v_im = __pyx_t_2; - - /* "yt/utilities/lib/image_samplers.pyx":144 - * cdef VolumeContainer *vc = pg.container - * cdef ImageContainer *im = self.image * self.setup(pg) # <<<<<<<<<<<<<< * cdef np.float64_t *v_pos * cdef np.float64_t *v_dir */ ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *)__pyx_v_self->__pyx_vtab)->setup(__pyx_v_self, __pyx_v_pg); - /* "yt/utilities/lib/image_samplers.pyx":148 + /* "yt/utilities/lib/image_samplers.pyx":144 * cdef np.float64_t *v_dir * cdef np.float64_t max_t * hit = 0 # <<<<<<<<<<<<<< * cdef np.int64_t nx, ny, size - * self.extent_function(self.image, vc, iter) + * self.extent_function(self, vc, iter) */ __pyx_v_hit = 0; - /* "yt/utilities/lib/image_samplers.pyx":150 + /* "yt/utilities/lib/image_samplers.pyx":146 * hit = 0 * cdef np.int64_t nx, ny, size - * self.extent_function(self.image, vc, iter) # <<<<<<<<<<<<<< - * iter[0] = i64clip(iter[0]-1, 0, im.nv[0]) - * iter[1] = i64clip(iter[1]+1, 0, im.nv[0]) + * self.extent_function(self, vc, iter) # <<<<<<<<<<<<<< + * iter[0] = i64clip(iter[0]-1, 0, self.nv[0]) + * iter[1] = i64clip(iter[1]+1, 0, self.nv[0]) */ - __pyx_t_3 = __pyx_v_self->extent_function(__pyx_v_self->image, __pyx_v_vc, __pyx_v_iter); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->extent_function(__pyx_v_self, __pyx_v_vc, __pyx_v_iter); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 146, __pyx_L1_error) - /* "yt/utilities/lib/image_samplers.pyx":151 + /* "yt/utilities/lib/image_samplers.pyx":147 * cdef np.int64_t nx, ny, size - * self.extent_function(self.image, vc, iter) - * iter[0] = i64clip(iter[0]-1, 0, im.nv[0]) # <<<<<<<<<<<<<< - * iter[1] = i64clip(iter[1]+1, 0, im.nv[0]) - * iter[2] = i64clip(iter[2]-1, 0, im.nv[1]) - */ - (__pyx_v_iter[0]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(((__pyx_v_iter[0]) - 1), 0, (__pyx_v_im->nv[0])); - - /* "yt/utilities/lib/image_samplers.pyx":152 - * self.extent_function(self.image, vc, iter) - * iter[0] = i64clip(iter[0]-1, 0, im.nv[0]) - * iter[1] = i64clip(iter[1]+1, 0, im.nv[0]) # <<<<<<<<<<<<<< - * iter[2] = i64clip(iter[2]-1, 0, im.nv[1]) - * iter[3] = i64clip(iter[3]+1, 0, im.nv[1]) + * self.extent_function(self, vc, iter) + * iter[0] = i64clip(iter[0]-1, 0, self.nv[0]) # <<<<<<<<<<<<<< + * iter[1] = i64clip(iter[1]+1, 0, self.nv[0]) + * iter[2] = i64clip(iter[2]-1, 0, self.nv[1]) */ - (__pyx_v_iter[1]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(((__pyx_v_iter[1]) + 1), 0, (__pyx_v_im->nv[0])); + (__pyx_v_iter[0]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(((__pyx_v_iter[0]) - 1), 0, (__pyx_v_self->nv[0])); - /* "yt/utilities/lib/image_samplers.pyx":153 - * iter[0] = i64clip(iter[0]-1, 0, im.nv[0]) - * iter[1] = i64clip(iter[1]+1, 0, im.nv[0]) - * iter[2] = i64clip(iter[2]-1, 0, im.nv[1]) # <<<<<<<<<<<<<< - * iter[3] = i64clip(iter[3]+1, 0, im.nv[1]) + /* "yt/utilities/lib/image_samplers.pyx":148 + * self.extent_function(self, vc, iter) + * iter[0] = i64clip(iter[0]-1, 0, self.nv[0]) + * iter[1] = i64clip(iter[1]+1, 0, self.nv[0]) # <<<<<<<<<<<<<< + * iter[2] = i64clip(iter[2]-1, 0, self.nv[1]) + * iter[3] = i64clip(iter[3]+1, 0, self.nv[1]) + */ + (__pyx_v_iter[1]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(((__pyx_v_iter[1]) + 1), 0, (__pyx_v_self->nv[0])); + + /* "yt/utilities/lib/image_samplers.pyx":149 + * iter[0] = i64clip(iter[0]-1, 0, self.nv[0]) + * iter[1] = i64clip(iter[1]+1, 0, self.nv[0]) + * iter[2] = i64clip(iter[2]-1, 0, self.nv[1]) # <<<<<<<<<<<<<< + * iter[3] = i64clip(iter[3]+1, 0, self.nv[1]) * nx = (iter[1] - iter[0]) */ - (__pyx_v_iter[2]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(((__pyx_v_iter[2]) - 1), 0, (__pyx_v_im->nv[1])); + (__pyx_v_iter[2]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(((__pyx_v_iter[2]) - 1), 0, (__pyx_v_self->nv[1])); - /* "yt/utilities/lib/image_samplers.pyx":154 - * iter[1] = i64clip(iter[1]+1, 0, im.nv[0]) - * iter[2] = i64clip(iter[2]-1, 0, im.nv[1]) - * iter[3] = i64clip(iter[3]+1, 0, im.nv[1]) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/image_samplers.pyx":150 + * iter[1] = i64clip(iter[1]+1, 0, self.nv[0]) + * iter[2] = i64clip(iter[2]-1, 0, self.nv[1]) + * iter[3] = i64clip(iter[3]+1, 0, self.nv[1]) # <<<<<<<<<<<<<< * nx = (iter[1] - iter[0]) * ny = (iter[3] - iter[2]) */ - (__pyx_v_iter[3]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(((__pyx_v_iter[3]) + 1), 0, (__pyx_v_im->nv[1])); + (__pyx_v_iter[3]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(((__pyx_v_iter[3]) + 1), 0, (__pyx_v_self->nv[1])); - /* "yt/utilities/lib/image_samplers.pyx":155 - * iter[2] = i64clip(iter[2]-1, 0, im.nv[1]) - * iter[3] = i64clip(iter[3]+1, 0, im.nv[1]) + /* "yt/utilities/lib/image_samplers.pyx":151 + * iter[2] = i64clip(iter[2]-1, 0, self.nv[1]) + * iter[3] = i64clip(iter[3]+1, 0, self.nv[1]) * nx = (iter[1] - iter[0]) # <<<<<<<<<<<<<< * ny = (iter[3] - iter[2]) * size = nx * ny */ __pyx_v_nx = ((__pyx_v_iter[1]) - (__pyx_v_iter[0])); - /* "yt/utilities/lib/image_samplers.pyx":156 - * iter[3] = i64clip(iter[3]+1, 0, im.nv[1]) + /* "yt/utilities/lib/image_samplers.pyx":152 + * iter[3] = i64clip(iter[3]+1, 0, self.nv[1]) * nx = (iter[1] - iter[0]) * ny = (iter[3] - iter[2]) # <<<<<<<<<<<<<< * size = nx * ny @@ -4174,7 +4457,7 @@ */ __pyx_v_ny = ((__pyx_v_iter[3]) - (__pyx_v_iter[2])); - /* "yt/utilities/lib/image_samplers.pyx":157 + /* "yt/utilities/lib/image_samplers.pyx":153 * nx = (iter[1] - iter[0]) * ny = (iter[3] - iter[2]) * size = nx * ny # <<<<<<<<<<<<<< @@ -4183,7 +4466,7 @@ */ __pyx_v_size = (__pyx_v_nx * __pyx_v_ny); - /* "yt/utilities/lib/image_samplers.pyx":160 + /* "yt/utilities/lib/image_samplers.pyx":156 * cdef ImageAccumulator *idata * cdef np.float64_t width[3] * cdef int chunksize = 100 # <<<<<<<<<<<<<< @@ -4192,17 +4475,17 @@ */ __pyx_v_chunksize = 0x64; - /* "yt/utilities/lib/image_samplers.pyx":161 + /* "yt/utilities/lib/image_samplers.pyx":157 * cdef np.float64_t width[3] * cdef int chunksize = 100 * for i in range(3): # <<<<<<<<<<<<<< * width[i] = self.width[i] * with nogil, parallel(num_threads = num_threads): */ - for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/image_samplers.pyx":162 + /* "yt/utilities/lib/image_samplers.pyx":158 * cdef int chunksize = 100 * for i in range(3): * width[i] = self.width[i] # <<<<<<<<<<<<<< @@ -4212,7 +4495,7 @@ (__pyx_v_width[__pyx_v_i]) = (__pyx_v_self->width[__pyx_v_i]); } - /* "yt/utilities/lib/image_samplers.pyx":163 + /* "yt/utilities/lib/image_samplers.pyx":159 * for i in range(3): * width[i] = self.width[i] * with nogil, parallel(num_threads = num_threads): # <<<<<<<<<<<<<< @@ -4223,6 +4506,7 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { { @@ -4237,12 +4521,12 @@ #define unlikely(x) (x) #endif #ifdef _OPENMP - #pragma omp parallel private(__pyx_v_idata, __pyx_v_v_dir, __pyx_v_v_pos) private(__pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9) private(__pyx_filename, __pyx_lineno, __pyx_clineno) shared(__pyx_parallel_why, __pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb) num_threads(__pyx_v_num_threads) + #pragma omp parallel private(__pyx_v_idata, __pyx_v_v_dir, __pyx_v_v_pos) private(__pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9) private(__pyx_filename, __pyx_lineno, __pyx_clineno) shared(__pyx_parallel_why, __pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb) num_threads(__pyx_v_num_threads) #endif /* _OPENMP */ { #ifdef _OPENMP #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif Py_BEGIN_ALLOW_THREADS #endif /* _OPENMP */ @@ -4251,7 +4535,7 @@ __pyx_v_v_dir = ((__pyx_t_5numpy_float64_t *)1); __pyx_v_v_pos = ((__pyx_t_5numpy_float64_t *)1); - /* "yt/utilities/lib/image_samplers.pyx":164 + /* "yt/utilities/lib/image_samplers.pyx":160 * width[i] = self.width[i] * with nogil, parallel(num_threads = num_threads): * idata = malloc(sizeof(ImageAccumulator)) # <<<<<<<<<<<<<< @@ -4260,17 +4544,17 @@ */ __pyx_v_idata = ((struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator *)malloc((sizeof(struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator)))); - /* "yt/utilities/lib/image_samplers.pyx":165 + /* "yt/utilities/lib/image_samplers.pyx":161 * with nogil, parallel(num_threads = num_threads): * idata = malloc(sizeof(ImageAccumulator)) * idata.supp_data = self.supp_data # <<<<<<<<<<<<<< * v_pos = malloc(3 * sizeof(np.float64_t)) * v_dir = malloc(3 * sizeof(np.float64_t)) */ - __pyx_t_4 = __pyx_v_self->supp_data; - __pyx_v_idata->supp_data = __pyx_t_4; + __pyx_t_3 = __pyx_v_self->supp_data; + __pyx_v_idata->supp_data = __pyx_t_3; - /* "yt/utilities/lib/image_samplers.pyx":166 + /* "yt/utilities/lib/image_samplers.pyx":162 * idata = malloc(sizeof(ImageAccumulator)) * idata.supp_data = self.supp_data * v_pos = malloc(3 * sizeof(np.float64_t)) # <<<<<<<<<<<<<< @@ -4279,7 +4563,7 @@ */ __pyx_v_v_pos = ((__pyx_t_5numpy_float64_t *)malloc((3 * (sizeof(__pyx_t_5numpy_float64_t))))); - /* "yt/utilities/lib/image_samplers.pyx":167 + /* "yt/utilities/lib/image_samplers.pyx":163 * idata.supp_data = self.supp_data * v_pos = malloc(3 * sizeof(np.float64_t)) * v_dir = malloc(3 * sizeof(np.float64_t)) # <<<<<<<<<<<<<< @@ -4288,43 +4572,43 @@ */ __pyx_v_v_dir = ((__pyx_t_5numpy_float64_t *)malloc((3 * (sizeof(__pyx_t_5numpy_float64_t))))); - /* "yt/utilities/lib/image_samplers.pyx":168 + /* "yt/utilities/lib/image_samplers.pyx":164 * v_pos = malloc(3 * sizeof(np.float64_t)) * v_dir = malloc(3 * sizeof(np.float64_t)) * for j in prange(size, schedule="static", chunksize=chunksize): # <<<<<<<<<<<<<< * vj = j % ny * vi = (j - vj) / ny + iter[0] */ - __pyx_t_5 = __pyx_v_size; + __pyx_t_4 = __pyx_v_size; if (1 == 0) abort(); { - int __pyx_parallel_temp0 = 0xbad0bad0; - int __pyx_parallel_temp1 = 0xbad0bad0; - __pyx_t_5numpy_float64_t __pyx_parallel_temp2 = __PYX_NAN(); - int __pyx_parallel_temp3 = 0xbad0bad0; - int __pyx_parallel_temp4 = 0xbad0bad0; + int __pyx_parallel_temp0 = ((int)0xbad0bad0); + int __pyx_parallel_temp1 = ((int)0xbad0bad0); + __pyx_t_5numpy_float64_t __pyx_parallel_temp2 = ((__pyx_t_5numpy_float64_t)__PYX_NAN()); + int __pyx_parallel_temp3 = ((int)0xbad0bad0); + int __pyx_parallel_temp4 = ((int)0xbad0bad0); const char *__pyx_parallel_filename = NULL; int __pyx_parallel_lineno = 0, __pyx_parallel_clineno = 0; PyObject *__pyx_parallel_exc_type = NULL, *__pyx_parallel_exc_value = NULL, *__pyx_parallel_exc_tb = NULL; int __pyx_parallel_why; __pyx_parallel_why = 0; - __pyx_t_3 = __pyx_v_chunksize; - __pyx_t_7 = (__pyx_t_5 - 0 + 1 - 1/abs(1)) / 1; - if (__pyx_t_7 > 0) + __pyx_t_2 = __pyx_v_chunksize; + __pyx_t_6 = (__pyx_t_4 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_6 > 0) { #ifdef _OPENMP - #pragma omp for lastprivate(__pyx_v_i) firstprivate(__pyx_v_j) lastprivate(__pyx_v_j) lastprivate(__pyx_v_max_t) lastprivate(__pyx_v_vi) lastprivate(__pyx_v_vj) schedule(static, __pyx_t_3) + #pragma omp for lastprivate(__pyx_v_i) firstprivate(__pyx_v_j) lastprivate(__pyx_v_j) lastprivate(__pyx_v_max_t) lastprivate(__pyx_v_vi) lastprivate(__pyx_v_vj) schedule(static, __pyx_t_2) #endif /* _OPENMP */ - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6++){ + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_6; __pyx_t_5++){ if (__pyx_parallel_why < 2) { - __pyx_v_j = (int)(0 + 1 * __pyx_t_6); + __pyx_v_j = (int)(0 + 1 * __pyx_t_5); /* Initialize private variables to invalid values */ __pyx_v_i = ((int)0xbad0bad0); __pyx_v_max_t = ((__pyx_t_5numpy_float64_t)__PYX_NAN()); __pyx_v_vi = ((int)0xbad0bad0); __pyx_v_vj = ((int)0xbad0bad0); - /* "yt/utilities/lib/image_samplers.pyx":169 + /* "yt/utilities/lib/image_samplers.pyx":165 * v_dir = malloc(3 * sizeof(np.float64_t)) * for j in prange(size, schedule="static", chunksize=chunksize): * vj = j % ny # <<<<<<<<<<<<<< @@ -4333,7 +4617,7 @@ */ __pyx_v_vj = (__pyx_v_j % __pyx_v_ny); - /* "yt/utilities/lib/image_samplers.pyx":170 + /* "yt/utilities/lib/image_samplers.pyx":166 * for j in prange(size, schedule="static", chunksize=chunksize): * vj = j % ny * vi = (j - vj) / ny + iter[0] # <<<<<<<<<<<<<< @@ -4342,83 +4626,83 @@ */ __pyx_v_vi = (((__pyx_v_j - __pyx_v_vj) / __pyx_v_ny) + (__pyx_v_iter[0])); - /* "yt/utilities/lib/image_samplers.pyx":171 + /* "yt/utilities/lib/image_samplers.pyx":167 * vj = j % ny * vi = (j - vj) / ny + iter[0] * vj = vj + iter[2] # <<<<<<<<<<<<<< * # Dynamically calculate the position - * self.vector_function(im, vi, vj, width, v_dir, v_pos) + * self.vector_function(self, vi, vj, width, v_dir, v_pos) */ __pyx_v_vj = (__pyx_v_vj + (__pyx_v_iter[2])); - /* "yt/utilities/lib/image_samplers.pyx":173 + /* "yt/utilities/lib/image_samplers.pyx":169 * vj = vj + iter[2] * # Dynamically calculate the position - * self.vector_function(im, vi, vj, width, v_dir, v_pos) # <<<<<<<<<<<<<< + * self.vector_function(self, vi, vj, width, v_dir, v_pos) # <<<<<<<<<<<<<< * for i in range(Nch): - * idata.rgba[i] = im.image[vi, vj, i] + * idata.rgba[i] = self.image[vi, vj, i] */ - __pyx_v_self->vector_function(__pyx_v_im, __pyx_v_vi, __pyx_v_vj, __pyx_v_width, __pyx_v_v_dir, __pyx_v_v_pos); + __pyx_v_self->vector_function(__pyx_v_self, __pyx_v_vi, __pyx_v_vj, __pyx_v_width, __pyx_v_v_dir, __pyx_v_v_pos); - /* "yt/utilities/lib/image_samplers.pyx":174 + /* "yt/utilities/lib/image_samplers.pyx":170 * # Dynamically calculate the position - * self.vector_function(im, vi, vj, width, v_dir, v_pos) + * self.vector_function(self, vi, vj, width, v_dir, v_pos) * for i in range(Nch): # <<<<<<<<<<<<<< - * idata.rgba[i] = im.image[vi, vj, i] - * max_t = fclip(im.zbuffer[vi, vj], 0.0, 1.0) + * idata.rgba[i] = self.image[vi, vj, i] + * max_t = fclip(self.zbuffer[vi, vj], 0.0, 1.0) */ - for (__pyx_t_8 = 0; __pyx_t_8 < 4; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; + for (__pyx_t_7 = 0; __pyx_t_7 < 4; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/image_samplers.pyx":175 - * self.vector_function(im, vi, vj, width, v_dir, v_pos) + /* "yt/utilities/lib/image_samplers.pyx":171 + * self.vector_function(self, vi, vj, width, v_dir, v_pos) * for i in range(Nch): - * idata.rgba[i] = im.image[vi, vj, i] # <<<<<<<<<<<<<< - * max_t = fclip(im.zbuffer[vi, vj], 0.0, 1.0) + * idata.rgba[i] = self.image[vi, vj, i] # <<<<<<<<<<<<<< + * max_t = fclip(self.zbuffer[vi, vj], 0.0, 1.0) * walk_volume(vc, v_pos, v_dir, self.sample, */ - if (unlikely(!__pyx_v_im->image.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 175, __pyx_L14_error)} - __pyx_t_9 = __pyx_v_vi; - __pyx_t_10 = __pyx_v_vj; - __pyx_t_11 = __pyx_v_i; - (__pyx_v_idata->rgba[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->image.data + __pyx_t_9 * __pyx_v_im->image.strides[0]) ) + __pyx_t_10 * __pyx_v_im->image.strides[1]) ) + __pyx_t_11 * __pyx_v_im->image.strides[2]) ))); + if (unlikely(!__pyx_v_self->image.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 171, __pyx_L14_error)} + __pyx_t_8 = __pyx_v_vi; + __pyx_t_9 = __pyx_v_vj; + __pyx_t_10 = __pyx_v_i; + (__pyx_v_idata->rgba[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->image.data + __pyx_t_8 * __pyx_v_self->image.strides[0]) ) + __pyx_t_9 * __pyx_v_self->image.strides[1]) ) + __pyx_t_10 * __pyx_v_self->image.strides[2]) ))); } - /* "yt/utilities/lib/image_samplers.pyx":176 + /* "yt/utilities/lib/image_samplers.pyx":172 * for i in range(Nch): - * idata.rgba[i] = im.image[vi, vj, i] - * max_t = fclip(im.zbuffer[vi, vj], 0.0, 1.0) # <<<<<<<<<<<<<< + * idata.rgba[i] = self.image[vi, vj, i] + * max_t = fclip(self.zbuffer[vi, vj], 0.0, 1.0) # <<<<<<<<<<<<<< * walk_volume(vc, v_pos, v_dir, self.sample, * ( idata), NULL, max_t) */ - if (unlikely(!__pyx_v_im->zbuffer.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 176, __pyx_L14_error)} - __pyx_t_12 = __pyx_v_vi; - __pyx_t_13 = __pyx_v_vj; - __pyx_v_max_t = __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->zbuffer.data + __pyx_t_12 * __pyx_v_im->zbuffer.strides[0]) ) + __pyx_t_13 * __pyx_v_im->zbuffer.strides[1]) ))), 0.0, 1.0); - - /* "yt/utilities/lib/image_samplers.pyx":177 - * idata.rgba[i] = im.image[vi, vj, i] - * max_t = fclip(im.zbuffer[vi, vj], 0.0, 1.0) + if (unlikely(!__pyx_v_self->zbuffer.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 172, __pyx_L14_error)} + __pyx_t_11 = __pyx_v_vi; + __pyx_t_12 = __pyx_v_vj; + __pyx_v_max_t = __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->zbuffer.data + __pyx_t_11 * __pyx_v_self->zbuffer.strides[0]) ) + __pyx_t_12 * __pyx_v_self->zbuffer.strides[1]) ))), 0.0, 1.0); + + /* "yt/utilities/lib/image_samplers.pyx":173 + * idata.rgba[i] = self.image[vi, vj, i] + * max_t = fclip(self.zbuffer[vi, vj], 0.0, 1.0) * walk_volume(vc, v_pos, v_dir, self.sample, # <<<<<<<<<<<<<< * ( idata), NULL, max_t) * if (j % (10*chunksize)) == 0: */ - __pyx_t_14.__pyx_n = 2; - __pyx_t_14.return_t = NULL; - __pyx_t_14.max_t = __pyx_v_max_t; - __pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume(__pyx_v_vc, __pyx_v_v_pos, __pyx_v_v_dir, ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *)__pyx_v_self->__pyx_vtab)->sample, ((void *)__pyx_v_idata), &__pyx_t_14); + __pyx_t_13.__pyx_n = 2; + __pyx_t_13.return_t = NULL; + __pyx_t_13.max_t = __pyx_v_max_t; + __pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume(__pyx_v_vc, __pyx_v_v_pos, __pyx_v_v_dir, ((struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *)__pyx_v_self->__pyx_vtab)->sample, ((void *)__pyx_v_idata), &__pyx_t_13); - /* "yt/utilities/lib/image_samplers.pyx":179 + /* "yt/utilities/lib/image_samplers.pyx":175 * walk_volume(vc, v_pos, v_dir, self.sample, * ( idata), NULL, max_t) * if (j % (10*chunksize)) == 0: # <<<<<<<<<<<<<< * with gil: * PyErr_CheckSignals() */ - __pyx_t_15 = (((__pyx_v_j % (10 * __pyx_v_chunksize)) == 0) != 0); - if (__pyx_t_15) { + __pyx_t_14 = (((__pyx_v_j % (10 * __pyx_v_chunksize)) == 0) != 0); + if (__pyx_t_14) { - /* "yt/utilities/lib/image_samplers.pyx":180 + /* "yt/utilities/lib/image_samplers.pyx":176 * ( idata), NULL, max_t) * if (j % (10*chunksize)) == 0: * with gil: # <<<<<<<<<<<<<< @@ -4427,21 +4711,21 @@ */ { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - /* "yt/utilities/lib/image_samplers.pyx":181 + /* "yt/utilities/lib/image_samplers.pyx":177 * if (j % (10*chunksize)) == 0: * with gil: * PyErr_CheckSignals() # <<<<<<<<<<<<<< * for i in range(Nch): - * im.image[vi, vj, i] = idata.rgba[i] + * self.image[vi, vj, i] = idata.rgba[i] */ - __pyx_t_8 = PyErr_CheckSignals(); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 181, __pyx_L22_error) + __pyx_t_7 = PyErr_CheckSignals(); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 177, __pyx_L22_error) } - /* "yt/utilities/lib/image_samplers.pyx":180 + /* "yt/utilities/lib/image_samplers.pyx":176 * ( idata), NULL, max_t) * if (j % (10*chunksize)) == 0: * with gil: # <<<<<<<<<<<<<< @@ -4451,13 +4735,13 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif goto __pyx_L23; } __pyx_L22_error: { #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif goto __pyx_L14_error; } @@ -4465,7 +4749,7 @@ } } - /* "yt/utilities/lib/image_samplers.pyx":179 + /* "yt/utilities/lib/image_samplers.pyx":175 * walk_volume(vc, v_pos, v_dir, self.sample, * ( idata), NULL, max_t) * if (j % (10*chunksize)) == 0: # <<<<<<<<<<<<<< @@ -4474,34 +4758,34 @@ */ } - /* "yt/utilities/lib/image_samplers.pyx":182 + /* "yt/utilities/lib/image_samplers.pyx":178 * with gil: * PyErr_CheckSignals() * for i in range(Nch): # <<<<<<<<<<<<<< - * im.image[vi, vj, i] = idata.rgba[i] - * free(idata) + * self.image[vi, vj, i] = idata.rgba[i] + * idata.supp_data = NULL */ - for (__pyx_t_8 = 0; __pyx_t_8 < 4; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; + for (__pyx_t_7 = 0; __pyx_t_7 < 4; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/image_samplers.pyx":183 + /* "yt/utilities/lib/image_samplers.pyx":179 * PyErr_CheckSignals() * for i in range(Nch): - * im.image[vi, vj, i] = idata.rgba[i] # <<<<<<<<<<<<<< + * self.image[vi, vj, i] = idata.rgba[i] # <<<<<<<<<<<<<< + * idata.supp_data = NULL * free(idata) - * free(v_pos) */ - if (unlikely(!__pyx_v_im->image.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 183, __pyx_L14_error)} - __pyx_t_16 = __pyx_v_vi; - __pyx_t_17 = __pyx_v_vj; - __pyx_t_18 = __pyx_v_i; - *((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->image.data + __pyx_t_16 * __pyx_v_im->image.strides[0]) ) + __pyx_t_17 * __pyx_v_im->image.strides[1]) ) + __pyx_t_18 * __pyx_v_im->image.strides[2]) )) = (__pyx_v_idata->rgba[__pyx_v_i]); + if (unlikely(!__pyx_v_self->image.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 179, __pyx_L14_error)} + __pyx_t_15 = __pyx_v_vi; + __pyx_t_16 = __pyx_v_vj; + __pyx_t_17 = __pyx_v_i; + *((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->image.data + __pyx_t_15 * __pyx_v_self->image.strides[0]) ) + __pyx_t_16 * __pyx_v_self->image.strides[1]) ) + __pyx_t_17 * __pyx_v_self->image.strides[2]) )) = (__pyx_v_idata->rgba[__pyx_v_i]); } goto __pyx_L27; __pyx_L14_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif #ifdef _OPENMP #pragma omp flush(__pyx_parallel_exc_type) @@ -4512,7 +4796,7 @@ __Pyx_GOTREF(__pyx_parallel_exc_type); } #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_parallel_why = 4; @@ -4549,13 +4833,13 @@ case 4: { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_GIVEREF(__pyx_parallel_exc_type); __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb); __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno; #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } goto __pyx_L10_error; @@ -4563,17 +4847,26 @@ } } - /* "yt/utilities/lib/image_samplers.pyx":184 + /* "yt/utilities/lib/image_samplers.pyx":180 * for i in range(Nch): - * im.image[vi, vj, i] = idata.rgba[i] + * self.image[vi, vj, i] = idata.rgba[i] + * idata.supp_data = NULL # <<<<<<<<<<<<<< + * free(idata) + * free(v_pos) + */ + __pyx_v_idata->supp_data = NULL; + + /* "yt/utilities/lib/image_samplers.pyx":181 + * self.image[vi, vj, i] = idata.rgba[i] + * idata.supp_data = NULL * free(idata) # <<<<<<<<<<<<<< * free(v_pos) * free(v_dir) */ free(__pyx_v_idata); - /* "yt/utilities/lib/image_samplers.pyx":185 - * im.image[vi, vj, i] = idata.rgba[i] + /* "yt/utilities/lib/image_samplers.pyx":182 + * idata.supp_data = NULL * free(idata) * free(v_pos) # <<<<<<<<<<<<<< * free(v_dir) @@ -4581,7 +4874,7 @@ */ free(__pyx_v_v_pos); - /* "yt/utilities/lib/image_samplers.pyx":186 + /* "yt/utilities/lib/image_samplers.pyx":183 * free(idata) * free(v_pos) * free(v_dir) # <<<<<<<<<<<<<< @@ -4593,7 +4886,7 @@ __pyx_L10_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif #ifdef _OPENMP #pragma omp flush(__pyx_parallel_exc_type) @@ -4604,7 +4897,7 @@ __Pyx_GOTREF(__pyx_parallel_exc_type); } #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_parallel_why = 4; @@ -4615,12 +4908,12 @@ #else { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif #endif /* _OPENMP */ /* Clean up any temporaries */ #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif #ifndef _OPENMP } @@ -4635,13 +4928,13 @@ case 4: { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_GIVEREF(__pyx_parallel_exc_type); __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb); __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno; #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } goto __pyx_L6_error; @@ -4656,7 +4949,7 @@ #endif } - /* "yt/utilities/lib/image_samplers.pyx":163 + /* "yt/utilities/lib/image_samplers.pyx":159 * for i in range(3): * width[i] = self.width[i] * with nogil, parallel(num_threads = num_threads): # <<<<<<<<<<<<<< @@ -4666,12 +4959,14 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L7; } __pyx_L6_error: { #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; @@ -4680,7 +4975,7 @@ } } - /* "yt/utilities/lib/image_samplers.pyx":187 + /* "yt/utilities/lib/image_samplers.pyx":184 * free(v_pos) * free(v_dir) * return hit # <<<<<<<<<<<<<< @@ -4688,13 +4983,13 @@ * cdef void setup(self, PartitionedGrid pg): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_hit); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_19); - __pyx_r = __pyx_t_19; - __pyx_t_19 = 0; + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_hit); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_r = __pyx_t_18; + __pyx_t_18 = 0; goto __pyx_L0; - /* "yt/utilities/lib/image_samplers.pyx":136 + /* "yt/utilities/lib/image_samplers.pyx":133 * @cython.wraparound(False) * @cython.cdivision(True) * def __call__(self, PartitionedGrid pg, int num_threads = 0): # <<<<<<<<<<<<<< @@ -4704,7 +4999,7 @@ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_18); __Pyx_AddTraceback("yt.utilities.lib.image_samplers.ImageSampler.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -4713,7 +5008,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pyx":189 +/* "yt/utilities/lib/image_samplers.pyx":186 * return hit * * cdef void setup(self, PartitionedGrid pg): # <<<<<<<<<<<<<< @@ -4725,7 +5020,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setup", 0); - /* "yt/utilities/lib/image_samplers.pyx":190 + /* "yt/utilities/lib/image_samplers.pyx":187 * * cdef void setup(self, PartitionedGrid pg): * return # <<<<<<<<<<<<<< @@ -4734,7 +5029,7 @@ */ goto __pyx_L0; - /* "yt/utilities/lib/image_samplers.pyx":189 + /* "yt/utilities/lib/image_samplers.pyx":186 * return hit * * cdef void setup(self, PartitionedGrid pg): # <<<<<<<<<<<<<< @@ -4747,7 +5042,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/image_samplers.pyx":193 +/* "yt/utilities/lib/image_samplers.pyx":190 * * @staticmethod * cdef void sample( # <<<<<<<<<<<<<< @@ -4757,7 +5052,7 @@ static void __pyx_f_2yt_9utilities_3lib_14image_samplers_12ImageSampler_sample(CYTHON_UNUSED struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_v_dir, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_enter_t, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_exit_t, CYTHON_UNUSED int *__pyx_v_index, CYTHON_UNUSED void *__pyx_v_data) { - /* "yt/utilities/lib/image_samplers.pyx":201 + /* "yt/utilities/lib/image_samplers.pyx":198 * int index[3], * void *data) nogil: * return # <<<<<<<<<<<<<< @@ -4766,7 +5061,7 @@ */ goto __pyx_L0; - /* "yt/utilities/lib/image_samplers.pyx":193 + /* "yt/utilities/lib/image_samplers.pyx":190 * * @staticmethod * cdef void sample( # <<<<<<<<<<<<<< @@ -4778,7 +5073,7 @@ __pyx_L0:; } -/* "yt/utilities/lib/image_samplers.pyx":203 +/* "yt/utilities/lib/image_samplers.pyx":200 * return * * def ensure_code_unit_params(self, params): # <<<<<<<<<<<<<< @@ -4800,7 +5095,7 @@ } static PyObject *__pyx_gb_2yt_9utilities_3lib_14image_samplers_12ImageSampler_23ensure_code_unit_params_2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "yt/utilities/lib/image_samplers.pyx":210 +/* "yt/utilities/lib/image_samplers.pyx":207 * bounds = params['bounds'] * if hasattr(bounds[0], 'units'): * params['bounds'] = tuple(b.in_units('code_length').d for b in bounds) # <<<<<<<<<<<<<< @@ -4817,7 +5112,7 @@ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 210, __pyx_L1_error) + __PYX_ERR(0, 207, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -4825,7 +5120,7 @@ __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_2yt_9utilities_3lib_14image_samplers_12ImageSampler_23ensure_code_unit_params_2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ensure_code_unit_params_locals_g, __pyx_n_s_yt_utilities_lib_image_samplers); if (unlikely(!gen)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_2yt_9utilities_3lib_14image_samplers_12ImageSampler_23ensure_code_unit_params_2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ensure_code_unit_params_locals_g, __pyx_n_s_yt_utilities_lib_image_samplers); if (unlikely(!gen)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -4860,32 +5155,32 @@ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 210, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bounds)) { __Pyx_RaiseClosureNameError("bounds"); __PYX_ERR(0, 210, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 207, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bounds)) { __Pyx_RaiseClosureNameError("bounds"); __PYX_ERR(0, 207, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bounds)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bounds)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_bounds; __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_bounds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bounds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __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, 210, __pyx_L1_error) + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __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, 210, __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, 207, __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, 210, __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, 207, __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, 210, __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, 207, __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, 210, __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, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -4895,7 +5190,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 210, __pyx_L1_error) + else __PYX_ERR(0, 207, __pyx_L1_error) } break; } @@ -4905,12 +5200,12 @@ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_b, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_b, __pyx_n_s_in_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_b, __pyx_n_s_in_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; @@ -4930,7 +5225,7 @@ __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, 210, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 207, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -4951,7 +5246,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pyx":203 +/* "yt/utilities/lib/image_samplers.pyx":200 * return * * def ensure_code_unit_params(self, params): # <<<<<<<<<<<<<< @@ -4976,12 +5271,12 @@ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct__ensure_code_unit_params *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 203, __pyx_L1_error) + __PYX_ERR(0, 200, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } - /* "yt/utilities/lib/image_samplers.pyx":204 + /* "yt/utilities/lib/image_samplers.pyx":201 * * def ensure_code_unit_params(self, params): * for param_name in ['center', 'vp_pos', 'vp_dir', 'width']: # <<<<<<<<<<<<<< @@ -4992,53 +5287,53 @@ for (;;) { if (__pyx_t_2 >= 4) 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(0, 204, __pyx_L1_error) + __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(0, 201, __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(0, 204, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_param_name, __pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":205 + /* "yt/utilities/lib/image_samplers.pyx":202 * def ensure_code_unit_params(self, params): * for param_name in ['center', 'vp_pos', 'vp_dir', 'width']: * param = params[param_name] # <<<<<<<<<<<<<< * if hasattr(param, 'in_units'): * params[param_name] = param.in_units('code_length') */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_params, __pyx_v_param_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(__pyx_v_params, __pyx_v_param_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":206 + /* "yt/utilities/lib/image_samplers.pyx":203 * for param_name in ['center', 'vp_pos', 'vp_dir', 'width']: * param = params[param_name] * if hasattr(param, 'in_units'): # <<<<<<<<<<<<<< * params[param_name] = param.in_units('code_length') * bounds = params['bounds'] */ - __pyx_t_4 = PyObject_HasAttr(__pyx_v_param, __pyx_n_s_in_units); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_4 = __Pyx_HasAttr(__pyx_v_param, __pyx_n_s_in_units); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { - /* "yt/utilities/lib/image_samplers.pyx":207 + /* "yt/utilities/lib/image_samplers.pyx":204 * param = params[param_name] * if hasattr(param, 'in_units'): * params[param_name] = param.in_units('code_length') # <<<<<<<<<<<<<< * bounds = params['bounds'] * if hasattr(bounds[0], 'units'): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_in_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_in_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_params, __pyx_v_param_name, __pyx_t_6) < 0)) __PYX_ERR(0, 207, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_params, __pyx_v_param_name, __pyx_t_6) < 0)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "yt/utilities/lib/image_samplers.pyx":206 + /* "yt/utilities/lib/image_samplers.pyx":203 * for param_name in ['center', 'vp_pos', 'vp_dir', 'width']: * param = params[param_name] * if hasattr(param, 'in_units'): # <<<<<<<<<<<<<< @@ -5047,7 +5342,7 @@ */ } - /* "yt/utilities/lib/image_samplers.pyx":204 + /* "yt/utilities/lib/image_samplers.pyx":201 * * def ensure_code_unit_params(self, params): * for param_name in ['center', 'vp_pos', 'vp_dir', 'width']: # <<<<<<<<<<<<<< @@ -5057,49 +5352,49 @@ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/image_samplers.pyx":208 + /* "yt/utilities/lib/image_samplers.pyx":205 * if hasattr(param, 'in_units'): * params[param_name] = param.in_units('code_length') * bounds = params['bounds'] # <<<<<<<<<<<<<< * if hasattr(bounds[0], 'units'): * params['bounds'] = tuple(b.in_units('code_length').d for b in bounds) */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_params, __pyx_n_s_bounds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_params, __pyx_n_s_bounds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_bounds = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/utilities/lib/image_samplers.pyx":209 + /* "yt/utilities/lib/image_samplers.pyx":206 * params[param_name] = param.in_units('code_length') * bounds = params['bounds'] * if hasattr(bounds[0], 'units'): # <<<<<<<<<<<<<< * params['bounds'] = tuple(b.in_units('code_length').d for b in bounds) * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_bounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_bounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_HasAttr(__pyx_t_1, __pyx_n_s_units); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_s_units); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { - /* "yt/utilities/lib/image_samplers.pyx":210 + /* "yt/utilities/lib/image_samplers.pyx":207 * bounds = params['bounds'] * if hasattr(bounds[0], 'units'): * params['bounds'] = tuple(b.in_units('code_length').d for b in bounds) # <<<<<<<<<<<<<< * * return params */ - __pyx_t_1 = __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_23ensure_code_unit_params_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_23ensure_code_unit_params_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_6 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_params, __pyx_n_s_bounds, __pyx_t_6) < 0)) __PYX_ERR(0, 210, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_params, __pyx_n_s_bounds, __pyx_t_6) < 0)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "yt/utilities/lib/image_samplers.pyx":209 + /* "yt/utilities/lib/image_samplers.pyx":206 * params[param_name] = param.in_units('code_length') * bounds = params['bounds'] * if hasattr(bounds[0], 'units'): # <<<<<<<<<<<<<< @@ -5108,19 +5403,19 @@ */ } - /* "yt/utilities/lib/image_samplers.pyx":212 + /* "yt/utilities/lib/image_samplers.pyx":209 * params['bounds'] = tuple(b.in_units('code_length').d for b in bounds) * * return params # <<<<<<<<<<<<<< * - * def __dealloc__(self): + * cdef class ProjectionSampler(ImageSampler): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_params); __pyx_r = __pyx_v_params; goto __pyx_L0; - /* "yt/utilities/lib/image_samplers.pyx":203 + /* "yt/utilities/lib/image_samplers.pyx":200 * return * * def ensure_code_unit_params(self, params): # <<<<<<<<<<<<<< @@ -5144,173 +5439,35 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pyx":214 - * return params - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * self.image.image = None - * self.image.vp_pos = None +/* "yt/utilities/lib/image_samplers.pxd":56 + * cdef np.float64_t *x_vec + * cdef np.float64_t *y_vec + * cdef public object acenter, aimage, ax_vec, ay_vec # <<<<<<<<<<<<<< + * cdef public object azbuffer + * cdef public object aimage_used */ /* Python wrapper */ -static void __pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7__dealloc__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7acenter_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7acenter_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_6__dealloc__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *)__pyx_v_self)); + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7acenter___get__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static void __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_6__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self) { +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7acenter___get__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_RefNannySetupContext("__dealloc__", 0); - - /* "yt/utilities/lib/image_samplers.pyx":215 - * - * def __dealloc__(self): - * self.image.image = None # <<<<<<<<<<<<<< - * self.image.vp_pos = None - * self.image.vp_dir = None - */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(Py_None); - if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 215, __pyx_L1_error) - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->image, 0); - __pyx_v_self->image->image = __pyx_t_1; - __pyx_t_1.memview = NULL; - __pyx_t_1.data = NULL; - - /* "yt/utilities/lib/image_samplers.pyx":216 - * def __dealloc__(self): - * self.image.image = None - * self.image.vp_pos = None # <<<<<<<<<<<<<< - * self.image.vp_dir = None - * self.image.zbuffer = None - */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(Py_None); - if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 216, __pyx_L1_error) - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->vp_pos, 0); - __pyx_v_self->image->vp_pos = __pyx_t_1; - __pyx_t_1.memview = NULL; - __pyx_t_1.data = NULL; - - /* "yt/utilities/lib/image_samplers.pyx":217 - * self.image.image = None - * self.image.vp_pos = None - * self.image.vp_dir = None # <<<<<<<<<<<<<< - * self.image.zbuffer = None - * self.image.camera_data = None - */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(Py_None); - if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 217, __pyx_L1_error) - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->vp_dir, 0); - __pyx_v_self->image->vp_dir = __pyx_t_1; - __pyx_t_1.memview = NULL; - __pyx_t_1.data = NULL; - - /* "yt/utilities/lib/image_samplers.pyx":218 - * self.image.vp_pos = None - * self.image.vp_dir = None - * self.image.zbuffer = None # <<<<<<<<<<<<<< - * self.image.camera_data = None - * self.image.image_used = None - */ - __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(Py_None); - if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 218, __pyx_L1_error) - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->zbuffer, 0); - __pyx_v_self->image->zbuffer = __pyx_t_2; - __pyx_t_2.memview = NULL; - __pyx_t_2.data = NULL; - - /* "yt/utilities/lib/image_samplers.pyx":219 - * self.image.vp_dir = None - * self.image.zbuffer = None - * self.image.camera_data = None # <<<<<<<<<<<<<< - * self.image.image_used = None - * free(self.image) - */ - __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(Py_None); - if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 219, __pyx_L1_error) - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->camera_data, 0); - __pyx_v_self->image->camera_data = __pyx_t_2; - __pyx_t_2.memview = NULL; - __pyx_t_2.data = NULL; - - /* "yt/utilities/lib/image_samplers.pyx":220 - * self.image.zbuffer = None - * self.image.camera_data = None - * self.image.image_used = None # <<<<<<<<<<<<<< - * free(self.image) - * - */ - __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(Py_None); - if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 220, __pyx_L1_error) - __PYX_XDEC_MEMVIEW(&__pyx_v_self->image->image_used, 0); - __pyx_v_self->image->image_used = __pyx_t_3; - __pyx_t_3.memview = NULL; - __pyx_t_3.data = NULL; - - /* "yt/utilities/lib/image_samplers.pyx":221 - * self.image.camera_data = None - * self.image.image_used = None - * free(self.image) # <<<<<<<<<<<<<< - * - * cdef class ProjectionSampler(ImageSampler): - */ - free(__pyx_v_self->image); - - /* "yt/utilities/lib/image_samplers.pyx":214 - * return params - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * self.image.image = None - * self.image.vp_pos = None - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1); - __Pyx_WriteUnraisable("yt.utilities.lib.image_samplers.ImageSampler.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_L0:; - __Pyx_RefNannyFinishContext(); -} - -/* "yt/utilities/lib/image_samplers.pxd":41 - * cdef class ImageSampler: - * cdef ImageContainer *image - * cdef public object acenter, aimage, ax_vec, ay_vec # <<<<<<<<<<<<<< - * cdef public object azbuffer - * cdef public object aimage_used - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7acenter_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7acenter_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7acenter___get__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7acenter___get__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->acenter); - __pyx_r = __pyx_v_self->acenter; - goto __pyx_L0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->acenter); + __pyx_r = __pyx_v_self->acenter; + goto __pyx_L0; /* function exit code */ __pyx_L0:; @@ -5638,8 +5795,8 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pxd":42 - * cdef ImageContainer *image +/* "yt/utilities/lib/image_samplers.pxd":57 + * cdef np.float64_t *y_vec * cdef public object acenter, aimage, ax_vec, ay_vec * cdef public object azbuffer # <<<<<<<<<<<<<< * cdef public object aimage_used @@ -5733,7 +5890,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pxd":43 +/* "yt/utilities/lib/image_samplers.pxd":58 * cdef public object acenter, aimage, ax_vec, ay_vec * cdef public object azbuffer * cdef public object aimage_used # <<<<<<<<<<<<<< @@ -5828,7 +5985,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pxd":44 +/* "yt/utilities/lib/image_samplers.pxd":59 * cdef public object azbuffer * cdef public object aimage_used * cdef public object amesh_lines # <<<<<<<<<<<<<< @@ -5923,7 +6080,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pxd":47 +/* "yt/utilities/lib/image_samplers.pxd":62 * cdef void *supp_data * cdef np.float64_t width[3] * cdef public object lens_type # <<<<<<<<<<<<<< @@ -6018,7 +6175,114 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pyx":226 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_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_2yt_9utilities_3lib_14image_samplers_12ImageSampler_6__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__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.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, 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.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec 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("yt.utilities.lib.image_samplers.ImageSampler.__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.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_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_2yt_9utilities_3lib_14image_samplers_12ImageSampler_8__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_12ImageSampler_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__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.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, 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.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.image_samplers.ImageSampler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/image_samplers.pyx":214 * * @staticmethod * cdef void sample( # <<<<<<<<<<<<<< @@ -6031,11 +6295,11 @@ int __pyx_v_i; __pyx_t_5numpy_float64_t __pyx_v_dl; int __pyx_v_di; - int __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_1; int __pyx_t_2; int __pyx_t_3; - /* "yt/utilities/lib/image_samplers.pyx":234 + /* "yt/utilities/lib/image_samplers.pyx":222 * int index[3], * void *data) nogil: * cdef ImageAccumulator *im = data # <<<<<<<<<<<<<< @@ -6044,7 +6308,7 @@ */ __pyx_v_im = ((struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator *)__pyx_v_data); - /* "yt/utilities/lib/image_samplers.pyx":236 + /* "yt/utilities/lib/image_samplers.pyx":224 * cdef ImageAccumulator *im = data * cdef int i * cdef np.float64_t dl = (exit_t - enter_t) # <<<<<<<<<<<<<< @@ -6053,7 +6317,7 @@ */ __pyx_v_dl = (__pyx_v_exit_t - __pyx_v_enter_t); - /* "yt/utilities/lib/image_samplers.pyx":237 + /* "yt/utilities/lib/image_samplers.pyx":225 * cdef int i * cdef np.float64_t dl = (exit_t - enter_t) * cdef int di = (index[0]*vc.dims[1]+index[1])*vc.dims[2]+index[2] # <<<<<<<<<<<<<< @@ -6062,7 +6326,7 @@ */ __pyx_v_di = (((((__pyx_v_index[0]) * (__pyx_v_vc->dims[1])) + (__pyx_v_index[1])) * (__pyx_v_vc->dims[2])) + (__pyx_v_index[2])); - /* "yt/utilities/lib/image_samplers.pyx":238 + /* "yt/utilities/lib/image_samplers.pyx":226 * cdef np.float64_t dl = (exit_t - enter_t) * cdef int di = (index[0]*vc.dims[1]+index[1])*vc.dims[2]+index[2] * for i in range(imin(4, vc.n_fields)): # <<<<<<<<<<<<<< @@ -6073,7 +6337,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/image_samplers.pyx":239 + /* "yt/utilities/lib/image_samplers.pyx":227 * cdef int di = (index[0]*vc.dims[1]+index[1])*vc.dims[2]+index[2] * for i in range(imin(4, vc.n_fields)): * im.rgba[i] += vc.data[i][di] * dl # <<<<<<<<<<<<<< @@ -6084,7 +6348,7 @@ (__pyx_v_im->rgba[__pyx_t_3]) = ((__pyx_v_im->rgba[__pyx_t_3]) + (((__pyx_v_vc->data[__pyx_v_i])[__pyx_v_di]) * __pyx_v_dl)); } - /* "yt/utilities/lib/image_samplers.pyx":226 + /* "yt/utilities/lib/image_samplers.pyx":214 * * @staticmethod * cdef void sample( # <<<<<<<<<<<<<< @@ -6095,7 +6359,114 @@ /* function exit code */ } -/* "yt/utilities/lib/image_samplers.pyx":243 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler_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_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler___reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *__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.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, 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.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec 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("yt.utilities.lib.image_samplers.ProjectionSampler.__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.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler_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_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler_2__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *__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.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, 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.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.image_samplers.ProjectionSampler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/image_samplers.pyx":231 * * cdef class InterpolatedProjectionSampler(ImageSampler): * def __cinit__(self, # <<<<<<<<<<<<<< @@ -6130,14 +6501,23 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -6146,41 +6526,49 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vp_pos)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vp_dir)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 1); __PYX_ERR(0, 243, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 1); __PYX_ERR(0, 231, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_center)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 2); __PYX_ERR(0, 243, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 2); __PYX_ERR(0, 231, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 3); __PYX_ERR(0, 243, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 3); __PYX_ERR(0, 231, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 4); __PYX_ERR(0, 243, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 4); __PYX_ERR(0, 231, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_vec)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 5); __PYX_ERR(0, 243, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 5); __PYX_ERR(0, 231, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_vec)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 6); __PYX_ERR(0, 243, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 6); __PYX_ERR(0, 231, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 7); __PYX_ERR(0, 243, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, 7); __PYX_ERR(0, 231, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_samples); @@ -6188,11 +6576,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 243, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 231, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); @@ -6217,20 +6606,20 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 243, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 231, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("yt.utilities.lib.image_samplers.InterpolatedProjectionSampler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vp_pos), __pyx_ptype_5numpy_ndarray, 1, "vp_pos", 0))) __PYX_ERR(0, 244, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vp_dir), __pyx_ptype_5numpy_ndarray, 1, "vp_dir", 0))) __PYX_ERR(0, 245, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_center), __pyx_ptype_5numpy_ndarray, 1, "center", 0))) __PYX_ERR(0, 246, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 248, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x_vec), __pyx_ptype_5numpy_ndarray, 1, "x_vec", 0))) __PYX_ERR(0, 249, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_vec), __pyx_ptype_5numpy_ndarray, 1, "y_vec", 0))) __PYX_ERR(0, 250, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), __pyx_ptype_5numpy_ndarray, 1, "width", 0))) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vp_pos), __pyx_ptype_5numpy_ndarray, 1, "vp_pos", 0))) __PYX_ERR(0, 232, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vp_dir), __pyx_ptype_5numpy_ndarray, 1, "vp_dir", 0))) __PYX_ERR(0, 233, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_center), __pyx_ptype_5numpy_ndarray, 1, "center", 0))) __PYX_ERR(0, 234, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 236, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x_vec), __pyx_ptype_5numpy_ndarray, 1, "x_vec", 0))) __PYX_ERR(0, 237, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_vec), __pyx_ptype_5numpy_ndarray, 1, "y_vec", 0))) __PYX_ERR(0, 238, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), __pyx_ptype_5numpy_ndarray, 1, "width", 0))) __PYX_ERR(0, 239, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *)__pyx_v_self), __pyx_v_vp_pos, __pyx_v_vp_dir, __pyx_v_center, __pyx_v_bounds, __pyx_v_image, __pyx_v_x_vec, __pyx_v_y_vec, __pyx_v_width, __pyx_v_n_samples, __pyx_v_kwargs); /* function exit code */ @@ -6283,48 +6672,48 @@ __pyx_pybuffernd_width.rcbuffer = &__pyx_pybuffer_width; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_center.rcbuffer->pybuffer, (PyObject*)__pyx_v_center, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_center.rcbuffer->pybuffer, (PyObject*)__pyx_v_center, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 231, __pyx_L1_error) } __pyx_pybuffernd_center.diminfo[0].strides = __pyx_pybuffernd_center.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_center.diminfo[0].shape = __pyx_pybuffernd_center.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 231, __pyx_L1_error) } __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_image.diminfo[1].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_image.diminfo[1].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_image.diminfo[2].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_image.diminfo[2].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_x_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_x_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 231, __pyx_L1_error) } __pyx_pybuffernd_x_vec.diminfo[0].strides = __pyx_pybuffernd_x_vec.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x_vec.diminfo[0].shape = __pyx_pybuffernd_x_vec.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_y_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_y_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 231, __pyx_L1_error) } __pyx_pybuffernd_y_vec.diminfo[0].strides = __pyx_pybuffernd_y_vec.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y_vec.diminfo[0].shape = __pyx_pybuffernd_y_vec.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_width.rcbuffer->pybuffer, (PyObject*)__pyx_v_width, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_width.rcbuffer->pybuffer, (PyObject*)__pyx_v_width, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 231, __pyx_L1_error) } __pyx_pybuffernd_width.diminfo[0].strides = __pyx_pybuffernd_width.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_width.diminfo[0].shape = __pyx_pybuffernd_width.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/image_samplers.pyx":253 + /* "yt/utilities/lib/image_samplers.pyx":241 * np.ndarray[np.float64_t, ndim=1] width, * n_samples = 10, **kwargs): * ImageSampler.__init__(self, vp_pos, vp_dir, center, bounds, image, # <<<<<<<<<<<<<< * x_vec, y_vec, width, **kwargs) * # Now we handle tf_obj */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "yt/utilities/lib/image_samplers.pyx":254 + /* "yt/utilities/lib/image_samplers.pyx":242 * n_samples = 10, **kwargs): * ImageSampler.__init__(self, vp_pos, vp_dir, center, bounds, image, * x_vec, y_vec, width, **kwargs) # <<<<<<<<<<<<<< * # Now we handle tf_obj * self.vra = \ */ - __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -6354,20 +6743,20 @@ __Pyx_GIVEREF(((PyObject *)__pyx_v_width)); PyTuple_SET_ITEM(__pyx_t_2, 8, ((PyObject *)__pyx_v_width)); - /* "yt/utilities/lib/image_samplers.pyx":253 + /* "yt/utilities/lib/image_samplers.pyx":241 * np.ndarray[np.float64_t, ndim=1] width, * n_samples = 10, **kwargs): * ImageSampler.__init__(self, vp_pos, vp_dir, center, bounds, image, # <<<<<<<<<<<<<< * x_vec, y_vec, width, **kwargs) * # Now we handle tf_obj */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":256 + /* "yt/utilities/lib/image_samplers.pyx":244 * x_vec, y_vec, width, **kwargs) * # Now we handle tf_obj * self.vra = \ # <<<<<<<<<<<<<< @@ -6376,17 +6765,17 @@ */ __pyx_v_self->vra = ((struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *)malloc((sizeof(struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator)))); - /* "yt/utilities/lib/image_samplers.pyx":258 + /* "yt/utilities/lib/image_samplers.pyx":246 * self.vra = \ * malloc(sizeof(VolumeRenderAccumulator)) * self.vra.n_samples = n_samples # <<<<<<<<<<<<<< * self.supp_data = self.vra * */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_n_samples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_n_samples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error) __pyx_v_self->vra->n_samples = __pyx_t_4; - /* "yt/utilities/lib/image_samplers.pyx":259 + /* "yt/utilities/lib/image_samplers.pyx":247 * malloc(sizeof(VolumeRenderAccumulator)) * self.vra.n_samples = n_samples * self.supp_data = self.vra # <<<<<<<<<<<<<< @@ -6395,7 +6784,7 @@ */ __pyx_v_self->__pyx_base.supp_data = ((void *)__pyx_v_self->vra); - /* "yt/utilities/lib/image_samplers.pyx":243 + /* "yt/utilities/lib/image_samplers.pyx":231 * * cdef class InterpolatedProjectionSampler(ImageSampler): * def __cinit__(self, # <<<<<<<<<<<<<< @@ -6434,7 +6823,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pyx":265 +/* "yt/utilities/lib/image_samplers.pyx":253 * @cython.cdivision(True) * @staticmethod * cdef void sample( # <<<<<<<<<<<<<< @@ -6451,14 +6840,16 @@ __pyx_t_5numpy_float64_t __pyx_v_dt; __pyx_t_5numpy_float64_t __pyx_v_dvs[6]; long __pyx_v_i; - long __pyx_v_j; + __pyx_t_5numpy_int64_t __pyx_v_j; long __pyx_t_1; long __pyx_t_2; int __pyx_t_3; int __pyx_t_4; - long __pyx_t_5; + __pyx_t_5numpy_int64_t __pyx_t_5; + __pyx_t_5numpy_int64_t __pyx_t_6; + __pyx_t_5numpy_int64_t __pyx_t_7; - /* "yt/utilities/lib/image_samplers.pyx":273 + /* "yt/utilities/lib/image_samplers.pyx":261 * int index[3], * void *data) nogil: * cdef ImageAccumulator *im = data # <<<<<<<<<<<<<< @@ -6467,7 +6858,7 @@ */ __pyx_v_im = ((struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator *)__pyx_v_data); - /* "yt/utilities/lib/image_samplers.pyx":274 + /* "yt/utilities/lib/image_samplers.pyx":262 * void *data) nogil: * cdef ImageAccumulator *im = data * cdef VolumeRenderAccumulator *vri = \ # <<<<<<<<<<<<<< @@ -6476,7 +6867,7 @@ */ __pyx_v_vri = ((struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *)__pyx_v_im->supp_data); - /* "yt/utilities/lib/image_samplers.pyx":278 + /* "yt/utilities/lib/image_samplers.pyx":266 * # we assume this has vertex-centered data. * cdef int offset = index[0] * (vc.dims[1] + 1) * (vc.dims[2] + 1) \ * + index[1] * (vc.dims[2] + 1) + index[2] # <<<<<<<<<<<<<< @@ -6485,7 +6876,7 @@ */ __pyx_v_offset = (((((__pyx_v_index[0]) * ((__pyx_v_vc->dims[1]) + 1)) * ((__pyx_v_vc->dims[2]) + 1)) + ((__pyx_v_index[1]) * ((__pyx_v_vc->dims[2]) + 1))) + (__pyx_v_index[2])); - /* "yt/utilities/lib/image_samplers.pyx":281 + /* "yt/utilities/lib/image_samplers.pyx":269 * cdef np.float64_t dp[3] * cdef np.float64_t ds[3] * cdef np.float64_t dt = (exit_t - enter_t) / vri.n_samples # <<<<<<<<<<<<<< @@ -6494,7 +6885,7 @@ */ __pyx_v_dt = ((__pyx_v_exit_t - __pyx_v_enter_t) / __pyx_v_vri->n_samples); - /* "yt/utilities/lib/image_samplers.pyx":283 + /* "yt/utilities/lib/image_samplers.pyx":271 * cdef np.float64_t dt = (exit_t - enter_t) / vri.n_samples * cdef np.float64_t dvs[6] * for i in range(3): # <<<<<<<<<<<<<< @@ -6504,7 +6895,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/image_samplers.pyx":284 + /* "yt/utilities/lib/image_samplers.pyx":272 * cdef np.float64_t dvs[6] * for i in range(3): * dp[i] = (enter_t + 0.5 * dt) * v_dir[i] + v_pos[i] # <<<<<<<<<<<<<< @@ -6513,7 +6904,7 @@ */ (__pyx_v_dp[__pyx_v_i]) = (((__pyx_v_enter_t + (0.5 * __pyx_v_dt)) * (__pyx_v_v_dir[__pyx_v_i])) + (__pyx_v_v_pos[__pyx_v_i])); - /* "yt/utilities/lib/image_samplers.pyx":285 + /* "yt/utilities/lib/image_samplers.pyx":273 * for i in range(3): * dp[i] = (enter_t + 0.5 * dt) * v_dir[i] + v_pos[i] * dp[i] -= index[i] * vc.dds[i] + vc.left_edge[i] # <<<<<<<<<<<<<< @@ -6523,7 +6914,7 @@ __pyx_t_2 = __pyx_v_i; (__pyx_v_dp[__pyx_t_2]) = ((__pyx_v_dp[__pyx_t_2]) - (((__pyx_v_index[__pyx_v_i]) * (__pyx_v_vc->dds[__pyx_v_i])) + (__pyx_v_vc->left_edge[__pyx_v_i]))); - /* "yt/utilities/lib/image_samplers.pyx":286 + /* "yt/utilities/lib/image_samplers.pyx":274 * dp[i] = (enter_t + 0.5 * dt) * v_dir[i] + v_pos[i] * dp[i] -= index[i] * vc.dds[i] + vc.left_edge[i] * dp[i] *= vc.idds[i] # <<<<<<<<<<<<<< @@ -6533,7 +6924,7 @@ __pyx_t_2 = __pyx_v_i; (__pyx_v_dp[__pyx_t_2]) = ((__pyx_v_dp[__pyx_t_2]) * (__pyx_v_vc->idds[__pyx_v_i])); - /* "yt/utilities/lib/image_samplers.pyx":287 + /* "yt/utilities/lib/image_samplers.pyx":275 * dp[i] -= index[i] * vc.dds[i] + vc.left_edge[i] * dp[i] *= vc.idds[i] * ds[i] = v_dir[i] * vc.idds[i] * dt # <<<<<<<<<<<<<< @@ -6543,7 +6934,7 @@ (__pyx_v_ds[__pyx_v_i]) = (((__pyx_v_v_dir[__pyx_v_i]) * (__pyx_v_vc->idds[__pyx_v_i])) * __pyx_v_dt); } - /* "yt/utilities/lib/image_samplers.pyx":288 + /* "yt/utilities/lib/image_samplers.pyx":276 * dp[i] *= vc.idds[i] * ds[i] = v_dir[i] * vc.idds[i] * dt * for i in range(vri.n_samples): # <<<<<<<<<<<<<< @@ -6554,7 +6945,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/image_samplers.pyx":289 + /* "yt/utilities/lib/image_samplers.pyx":277 * ds[i] = v_dir[i] * vc.idds[i] * dt * for i in range(vri.n_samples): * for j in range(vc.n_fields): # <<<<<<<<<<<<<< @@ -6562,10 +6953,10 @@ * vc.data[j] + offset) */ __pyx_t_4 = __pyx_v_vc->n_fields; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_4; __pyx_t_2+=1) { - __pyx_v_j = __pyx_t_2; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_j = __pyx_t_5; - /* "yt/utilities/lib/image_samplers.pyx":290 + /* "yt/utilities/lib/image_samplers.pyx":278 * for i in range(vri.n_samples): * for j in range(vc.n_fields): * dvs[j] = offset_interpolate(vc.dims, dp, # <<<<<<<<<<<<<< @@ -6575,51 +6966,51 @@ (__pyx_v_dvs[__pyx_v_j]) = offset_interpolate(__pyx_v_vc->dims, __pyx_v_dp, ((__pyx_v_vc->data[__pyx_v_j]) + __pyx_v_offset)); } - /* "yt/utilities/lib/image_samplers.pyx":292 + /* "yt/utilities/lib/image_samplers.pyx":280 * dvs[j] = offset_interpolate(vc.dims, dp, * vc.data[j] + offset) * for j in range(imin(3, vc.n_fields)): # <<<<<<<<<<<<<< * im.rgba[j] += dvs[j] * dt * for j in range(3): */ - __pyx_t_4 = __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(3, __pyx_v_vc->n_fields); - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_4; __pyx_t_2+=1) { - __pyx_v_j = __pyx_t_2; + __pyx_t_5 = __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(3, __pyx_v_vc->n_fields); + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; - /* "yt/utilities/lib/image_samplers.pyx":293 + /* "yt/utilities/lib/image_samplers.pyx":281 * vc.data[j] + offset) * for j in range(imin(3, vc.n_fields)): * im.rgba[j] += dvs[j] * dt # <<<<<<<<<<<<<< * for j in range(3): * dp[j] += ds[j] */ - __pyx_t_5 = __pyx_v_j; - (__pyx_v_im->rgba[__pyx_t_5]) = ((__pyx_v_im->rgba[__pyx_t_5]) + ((__pyx_v_dvs[__pyx_v_j]) * __pyx_v_dt)); + __pyx_t_7 = __pyx_v_j; + (__pyx_v_im->rgba[__pyx_t_7]) = ((__pyx_v_im->rgba[__pyx_t_7]) + ((__pyx_v_dvs[__pyx_v_j]) * __pyx_v_dt)); } - /* "yt/utilities/lib/image_samplers.pyx":294 + /* "yt/utilities/lib/image_samplers.pyx":282 * for j in range(imin(3, vc.n_fields)): * im.rgba[j] += dvs[j] * dt * for j in range(3): # <<<<<<<<<<<<<< * dp[j] += ds[j] * */ - for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { - __pyx_v_j = __pyx_t_2; + for (__pyx_t_5 = 0; __pyx_t_5 < 3; __pyx_t_5+=1) { + __pyx_v_j = __pyx_t_5; - /* "yt/utilities/lib/image_samplers.pyx":295 + /* "yt/utilities/lib/image_samplers.pyx":283 * im.rgba[j] += dvs[j] * dt * for j in range(3): * dp[j] += ds[j] # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __pyx_v_j; - (__pyx_v_dp[__pyx_t_5]) = ((__pyx_v_dp[__pyx_t_5]) + (__pyx_v_ds[__pyx_v_j])); + __pyx_t_6 = __pyx_v_j; + (__pyx_v_dp[__pyx_t_6]) = ((__pyx_v_dp[__pyx_t_6]) + (__pyx_v_ds[__pyx_v_j])); } } - /* "yt/utilities/lib/image_samplers.pyx":265 + /* "yt/utilities/lib/image_samplers.pyx":253 * @cython.cdivision(True) * @staticmethod * cdef void sample( # <<<<<<<<<<<<<< @@ -6630,7 +7021,7 @@ /* function exit code */ } -/* "yt/utilities/lib/image_samplers.pxd":65 +/* "yt/utilities/lib/image_samplers.pxd":80 * cdef class InterpolatedProjectionSampler(ImageSampler): * cdef VolumeRenderAccumulator *vra * cdef public object tf_obj # <<<<<<<<<<<<<< @@ -6725,7 +7116,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pxd":66 +/* "yt/utilities/lib/image_samplers.pxd":81 * cdef VolumeRenderAccumulator *vra * cdef public object tf_obj * cdef public object my_field_tables # <<<<<<<<<<<<<< @@ -6820,128 +7211,238 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pyx":299 - * - * cdef class VolumeRenderSampler(ImageSampler): - * def __cinit__(self, # <<<<<<<<<<<<<< - * np.ndarray vp_pos, - * np.ndarray vp_dir, +/* "(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 int __pyx_pw_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_vp_pos = 0; - PyArrayObject *__pyx_v_vp_dir = 0; - PyArrayObject *__pyx_v_center = 0; - PyObject *__pyx_v_bounds = 0; - PyArrayObject *__pyx_v_image = 0; - PyArrayObject *__pyx_v_x_vec = 0; - PyArrayObject *__pyx_v_y_vec = 0; - PyArrayObject *__pyx_v_width = 0; - PyObject *__pyx_v_tf_obj = 0; - PyObject *__pyx_v_n_samples = 0; - CYTHON_UNUSED PyObject *__pyx_v_star_list = 0; - PyObject *__pyx_v_kwargs = 0; - int __pyx_r; +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; - __Pyx_GOTREF(__pyx_v_kwargs); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vp_pos,&__pyx_n_s_vp_dir,&__pyx_n_s_center,&__pyx_n_s_bounds,&__pyx_n_s_image,&__pyx_n_s_x_vec,&__pyx_n_s_y_vec,&__pyx_n_s_width,&__pyx_n_s_tf_obj,&__pyx_n_s_n_samples,&__pyx_n_s_star_list,0}; - PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0}; - values[9] = ((PyObject *)__pyx_int_10); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *)__pyx_v_self)); - /* "yt/utilities/lib/image_samplers.pyx":309 - * np.ndarray[np.float64_t, ndim=1] width, - * tf_obj, n_samples = 10, - * star_list = None, **kwargs): # <<<<<<<<<<<<<< - * ImageSampler.__init__(self, vp_pos, vp_dir, center, bounds, image, - * x_vec, y_vec, width, **kwargs) + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__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__") */ - values[10] = ((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 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); - case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, 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("yt.utilities.lib.image_samplers.InterpolatedProjectionSampler.__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_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_5__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_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__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__12, 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("yt.utilities.lib.image_samplers.InterpolatedProjectionSampler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/image_samplers.pyx":287 + * + * cdef class VolumeRenderSampler(ImageSampler): + * def __cinit__(self, # <<<<<<<<<<<<<< + * np.ndarray vp_pos, + * np.ndarray vp_dir, + */ + +/* Python wrapper */ +static int __pyx_pw_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vp_pos = 0; + PyArrayObject *__pyx_v_vp_dir = 0; + PyArrayObject *__pyx_v_center = 0; + PyObject *__pyx_v_bounds = 0; + PyArrayObject *__pyx_v_image = 0; + PyArrayObject *__pyx_v_x_vec = 0; + PyArrayObject *__pyx_v_y_vec = 0; + PyArrayObject *__pyx_v_width = 0; + PyObject *__pyx_v_tf_obj = 0; + PyObject *__pyx_v_n_samples = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; + __Pyx_GOTREF(__pyx_v_kwargs); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vp_pos,&__pyx_n_s_vp_dir,&__pyx_n_s_center,&__pyx_n_s_bounds,&__pyx_n_s_image,&__pyx_n_s_x_vec,&__pyx_n_s_y_vec,&__pyx_n_s_width,&__pyx_n_s_tf_obj,&__pyx_n_s_n_samples,0}; + PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; + values[9] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vp_pos)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vp_dir)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 11, 1); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 10, 1); __PYX_ERR(0, 287, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_center)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 11, 2); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 10, 2); __PYX_ERR(0, 287, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 11, 3); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 10, 3); __PYX_ERR(0, 287, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 11, 4); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 10, 4); __PYX_ERR(0, 287, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_vec)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 11, 5); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 10, 5); __PYX_ERR(0, 287, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_vec)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 11, 6); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 10, 6); __PYX_ERR(0, 287, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 11, 7); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 10, 7); __PYX_ERR(0, 287, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tf_obj)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 11, 8); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 10, 8); __PYX_ERR(0, 287, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_samples); if (value) { values[9] = value; kw_args--; } } - case 10: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_star_list); - if (value) { values[10] = value; kw_args--; } - } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 299, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 287, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { - case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); @@ -6965,33 +7466,24 @@ __pyx_v_width = ((PyArrayObject *)values[7]); __pyx_v_tf_obj = values[8]; __pyx_v_n_samples = values[9]; - __pyx_v_star_list = values[10]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 299, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 287, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("yt.utilities.lib.image_samplers.VolumeRenderSampler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vp_pos), __pyx_ptype_5numpy_ndarray, 1, "vp_pos", 0))) __PYX_ERR(0, 300, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vp_dir), __pyx_ptype_5numpy_ndarray, 1, "vp_dir", 0))) __PYX_ERR(0, 301, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_center), __pyx_ptype_5numpy_ndarray, 1, "center", 0))) __PYX_ERR(0, 302, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 304, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x_vec), __pyx_ptype_5numpy_ndarray, 1, "x_vec", 0))) __PYX_ERR(0, 305, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_vec), __pyx_ptype_5numpy_ndarray, 1, "y_vec", 0))) __PYX_ERR(0, 306, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), __pyx_ptype_5numpy_ndarray, 1, "width", 0))) __PYX_ERR(0, 307, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *)__pyx_v_self), __pyx_v_vp_pos, __pyx_v_vp_dir, __pyx_v_center, __pyx_v_bounds, __pyx_v_image, __pyx_v_x_vec, __pyx_v_y_vec, __pyx_v_width, __pyx_v_tf_obj, __pyx_v_n_samples, __pyx_v_star_list, __pyx_v_kwargs); - - /* "yt/utilities/lib/image_samplers.pyx":299 - * - * cdef class VolumeRenderSampler(ImageSampler): - * def __cinit__(self, # <<<<<<<<<<<<<< - * np.ndarray vp_pos, - * np.ndarray vp_dir, - */ + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vp_pos), __pyx_ptype_5numpy_ndarray, 1, "vp_pos", 0))) __PYX_ERR(0, 288, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vp_dir), __pyx_ptype_5numpy_ndarray, 1, "vp_dir", 0))) __PYX_ERR(0, 289, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_center), __pyx_ptype_5numpy_ndarray, 1, "center", 0))) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 292, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x_vec), __pyx_ptype_5numpy_ndarray, 1, "x_vec", 0))) __PYX_ERR(0, 293, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_vec), __pyx_ptype_5numpy_ndarray, 1, "y_vec", 0))) __PYX_ERR(0, 294, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), __pyx_ptype_5numpy_ndarray, 1, "width", 0))) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *)__pyx_v_self), __pyx_v_vp_pos, __pyx_v_vp_dir, __pyx_v_center, __pyx_v_bounds, __pyx_v_image, __pyx_v_x_vec, __pyx_v_y_vec, __pyx_v_width, __pyx_v_tf_obj, __pyx_v_n_samples, __pyx_v_kwargs); /* function exit code */ goto __pyx_L0; @@ -7003,7 +7495,7 @@ return __pyx_r; } -static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler___cinit__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_v_self, PyArrayObject *__pyx_v_vp_pos, PyArrayObject *__pyx_v_vp_dir, PyArrayObject *__pyx_v_center, PyObject *__pyx_v_bounds, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_x_vec, PyArrayObject *__pyx_v_y_vec, PyArrayObject *__pyx_v_width, PyObject *__pyx_v_tf_obj, PyObject *__pyx_v_n_samples, CYTHON_UNUSED PyObject *__pyx_v_star_list, PyObject *__pyx_v_kwargs) { +static int __pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler___cinit__(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_v_self, PyArrayObject *__pyx_v_vp_pos, PyArrayObject *__pyx_v_vp_dir, PyArrayObject *__pyx_v_center, PyObject *__pyx_v_bounds, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_x_vec, PyArrayObject *__pyx_v_y_vec, PyArrayObject *__pyx_v_width, PyObject *__pyx_v_tf_obj, PyObject *__pyx_v_n_samples, PyObject *__pyx_v_kwargs) { int __pyx_v_i; PyArrayObject *__pyx_v_temp = 0; __Pyx_LocalBuf_ND __pyx_pybuffernd_center; @@ -7062,48 +7554,48 @@ __pyx_pybuffernd_width.rcbuffer = &__pyx_pybuffer_width; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_center.rcbuffer->pybuffer, (PyObject*)__pyx_v_center, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 299, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_center.rcbuffer->pybuffer, (PyObject*)__pyx_v_center, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 287, __pyx_L1_error) } __pyx_pybuffernd_center.diminfo[0].strides = __pyx_pybuffernd_center.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_center.diminfo[0].shape = __pyx_pybuffernd_center.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 299, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 287, __pyx_L1_error) } __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_image.diminfo[1].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_image.diminfo[1].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_image.diminfo[2].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_image.diminfo[2].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_x_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 299, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_x_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 287, __pyx_L1_error) } __pyx_pybuffernd_x_vec.diminfo[0].strides = __pyx_pybuffernd_x_vec.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x_vec.diminfo[0].shape = __pyx_pybuffernd_x_vec.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_y_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 299, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_y_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 287, __pyx_L1_error) } __pyx_pybuffernd_y_vec.diminfo[0].strides = __pyx_pybuffernd_y_vec.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y_vec.diminfo[0].shape = __pyx_pybuffernd_y_vec.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_width.rcbuffer->pybuffer, (PyObject*)__pyx_v_width, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 299, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_width.rcbuffer->pybuffer, (PyObject*)__pyx_v_width, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 287, __pyx_L1_error) } __pyx_pybuffernd_width.diminfo[0].strides = __pyx_pybuffernd_width.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_width.diminfo[0].shape = __pyx_pybuffernd_width.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/image_samplers.pyx":310 + /* "yt/utilities/lib/image_samplers.pyx":298 * tf_obj, n_samples = 10, - * star_list = None, **kwargs): + * **kwargs): * ImageSampler.__init__(self, vp_pos, vp_dir, center, bounds, image, # <<<<<<<<<<<<<< * x_vec, y_vec, width, **kwargs) * cdef int i */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "yt/utilities/lib/image_samplers.pyx":311 - * star_list = None, **kwargs): + /* "yt/utilities/lib/image_samplers.pyx":299 + * **kwargs): * ImageSampler.__init__(self, vp_pos, vp_dir, center, bounds, image, * x_vec, y_vec, width, **kwargs) # <<<<<<<<<<<<<< * cdef int i * cdef np.ndarray[np.float64_t, ndim=1] temp */ - __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -7133,20 +7625,20 @@ __Pyx_GIVEREF(((PyObject *)__pyx_v_width)); PyTuple_SET_ITEM(__pyx_t_2, 8, ((PyObject *)__pyx_v_width)); - /* "yt/utilities/lib/image_samplers.pyx":310 + /* "yt/utilities/lib/image_samplers.pyx":298 * tf_obj, n_samples = 10, - * star_list = None, **kwargs): + * **kwargs): * ImageSampler.__init__(self, vp_pos, vp_dir, center, bounds, image, # <<<<<<<<<<<<<< * x_vec, y_vec, width, **kwargs) * cdef int i */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":315 + /* "yt/utilities/lib/image_samplers.pyx":303 * cdef np.ndarray[np.float64_t, ndim=1] temp * # Now we handle tf_obj * self.vra = \ # <<<<<<<<<<<<<< @@ -7155,7 +7647,7 @@ */ __pyx_v_self->vra = ((struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *)malloc((sizeof(struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator)))); - /* "yt/utilities/lib/image_samplers.pyx":317 + /* "yt/utilities/lib/image_samplers.pyx":305 * self.vra = \ * malloc(sizeof(VolumeRenderAccumulator)) * self.vra.fits = \ # <<<<<<<<<<<<<< @@ -7164,20 +7656,20 @@ */ __pyx_v_self->vra->fits = ((struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *)malloc(((sizeof(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable)) * 6))); - /* "yt/utilities/lib/image_samplers.pyx":319 + /* "yt/utilities/lib/image_samplers.pyx":307 * self.vra.fits = \ * malloc(sizeof(FieldInterpolationTable) * 6) * self.vra.n_fits = tf_obj.n_field_tables # <<<<<<<<<<<<<< * assert(self.vra.n_fits <= 6) * self.vra.grey_opacity = getattr(tf_obj, "grey_opacity", 0) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_n_field_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_n_field_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->vra->n_fits = __pyx_t_4; - /* "yt/utilities/lib/image_samplers.pyx":320 + /* "yt/utilities/lib/image_samplers.pyx":308 * malloc(sizeof(FieldInterpolationTable) * 6) * self.vra.n_fits = tf_obj.n_field_tables * assert(self.vra.n_fits <= 6) # <<<<<<<<<<<<<< @@ -7188,42 +7680,42 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_self->vra->n_fits <= 6) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 320, __pyx_L1_error) + __PYX_ERR(0, 308, __pyx_L1_error) } } #endif - /* "yt/utilities/lib/image_samplers.pyx":321 + /* "yt/utilities/lib/image_samplers.pyx":309 * self.vra.n_fits = tf_obj.n_field_tables * assert(self.vra.n_fits <= 6) * self.vra.grey_opacity = getattr(tf_obj, "grey_opacity", 0) # <<<<<<<<<<<<<< * self.vra.n_samples = n_samples * self.my_field_tables = [] */ - __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_tf_obj, __pyx_n_s_grey_opacity, __pyx_int_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_tf_obj, __pyx_n_s_grey_opacity, __pyx_int_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->vra->grey_opacity = __pyx_t_4; - /* "yt/utilities/lib/image_samplers.pyx":322 + /* "yt/utilities/lib/image_samplers.pyx":310 * assert(self.vra.n_fits <= 6) * self.vra.grey_opacity = getattr(tf_obj, "grey_opacity", 0) * self.vra.n_samples = n_samples # <<<<<<<<<<<<<< * self.my_field_tables = [] * for i in range(self.vra.n_fits): */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_n_samples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_n_samples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L1_error) __pyx_v_self->vra->n_samples = __pyx_t_4; - /* "yt/utilities/lib/image_samplers.pyx":323 + /* "yt/utilities/lib/image_samplers.pyx":311 * self.vra.grey_opacity = getattr(tf_obj, "grey_opacity", 0) * self.vra.n_samples = n_samples * self.my_field_tables = [] # <<<<<<<<<<<<<< * for i in range(self.vra.n_fits): * temp = tf_obj.tables[i].y */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->my_field_tables); @@ -7231,7 +7723,7 @@ __pyx_v_self->my_field_tables = __pyx_t_3; __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":324 + /* "yt/utilities/lib/image_samplers.pyx":312 * self.vra.n_samples = n_samples * self.my_field_tables = [] * for i in range(self.vra.n_fits): # <<<<<<<<<<<<<< @@ -7242,22 +7734,22 @@ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "yt/utilities/lib/image_samplers.pyx":325 + /* "yt/utilities/lib/image_samplers.pyx":313 * self.my_field_tables = [] * for i in range(self.vra.n_fits): * temp = tf_obj.tables[i].y # <<<<<<<<<<<<<< * FIT_initialize_table(&self.vra.fits[i], * temp.shape[0], */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 325, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 313, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -7273,92 +7765,92 @@ } } __pyx_pybuffernd_temp.diminfo[0].strides = __pyx_pybuffernd_temp.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_temp.diminfo[0].shape = __pyx_pybuffernd_temp.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 325, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 313, __pyx_L1_error) } __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_temp, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":329 + /* "yt/utilities/lib/image_samplers.pyx":317 * temp.shape[0], * temp.data, * tf_obj.tables[i].x_bounds[0], # <<<<<<<<<<<<<< * tf_obj.tables[i].x_bounds[1], * tf_obj.field_ids[i], tf_obj.weight_field_ids[i], */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_x_bounds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_x_bounds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/image_samplers.pyx":330 + /* "yt/utilities/lib/image_samplers.pyx":318 * temp.data, * tf_obj.tables[i].x_bounds[0], * tf_obj.tables[i].x_bounds[1], # <<<<<<<<<<<<<< * tf_obj.field_ids[i], tf_obj.weight_field_ids[i], * tf_obj.weight_table_ids[i]) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_x_bounds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_x_bounds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":331 + /* "yt/utilities/lib/image_samplers.pyx":319 * tf_obj.tables[i].x_bounds[0], * tf_obj.tables[i].x_bounds[1], * tf_obj.field_ids[i], tf_obj.weight_field_ids[i], # <<<<<<<<<<<<<< * tf_obj.weight_table_ids[i]) * self.my_field_tables.append((tf_obj.tables[i], */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_field_ids); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_field_ids); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_weight_field_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_weight_field_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":332 + /* "yt/utilities/lib/image_samplers.pyx":320 * tf_obj.tables[i].x_bounds[1], * tf_obj.field_ids[i], tf_obj.weight_field_ids[i], * tf_obj.weight_table_ids[i]) # <<<<<<<<<<<<<< * self.my_field_tables.append((tf_obj.tables[i], * tf_obj.tables[i].y)) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_weight_table_ids); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_weight_table_ids); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/image_samplers.pyx":326 + /* "yt/utilities/lib/image_samplers.pyx":314 * for i in range(self.vra.n_fits): * temp = tf_obj.tables[i].y * FIT_initialize_table(&self.vra.fits[i], # <<<<<<<<<<<<<< @@ -7367,43 +7859,43 @@ */ __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_initialize_table((&(__pyx_v_self->vra->fits[__pyx_v_i])), (__pyx_v_temp->dimensions[0]), ((__pyx_t_5numpy_float64_t *)__pyx_v_temp->data), __pyx_t_11, __pyx_t_12, __pyx_t_7, __pyx_t_13, __pyx_t_14); - /* "yt/utilities/lib/image_samplers.pyx":333 + /* "yt/utilities/lib/image_samplers.pyx":321 * tf_obj.field_ids[i], tf_obj.weight_field_ids[i], * tf_obj.weight_table_ids[i]) * self.my_field_tables.append((tf_obj.tables[i], # <<<<<<<<<<<<<< * tf_obj.tables[i].y)) * for i in range(6): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/image_samplers.pyx":334 + /* "yt/utilities/lib/image_samplers.pyx":322 * tf_obj.weight_table_ids[i]) * self.my_field_tables.append((tf_obj.tables[i], * tf_obj.tables[i].y)) # <<<<<<<<<<<<<< * for i in range(6): * self.vra.field_table_ids[i] = tf_obj.field_table_ids[i] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/image_samplers.pyx":333 + /* "yt/utilities/lib/image_samplers.pyx":321 * tf_obj.field_ids[i], tf_obj.weight_field_ids[i], * tf_obj.weight_table_ids[i]) * self.my_field_tables.append((tf_obj.tables[i], # <<<<<<<<<<<<<< * tf_obj.tables[i].y)) * for i in range(6): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); @@ -7411,11 +7903,11 @@ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; - __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_self->my_field_tables, __pyx_t_1); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_self->my_field_tables, __pyx_t_1); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "yt/utilities/lib/image_samplers.pyx":335 + /* "yt/utilities/lib/image_samplers.pyx":323 * self.my_field_tables.append((tf_obj.tables[i], * tf_obj.tables[i].y)) * for i in range(6): # <<<<<<<<<<<<<< @@ -7425,24 +7917,24 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 6; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/utilities/lib/image_samplers.pyx":336 + /* "yt/utilities/lib/image_samplers.pyx":324 * tf_obj.tables[i].y)) * for i in range(6): * self.vra.field_table_ids[i] = tf_obj.field_table_ids[i] # <<<<<<<<<<<<<< * self.supp_data = self.vra * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_field_table_ids); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_field_table_ids); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_self->vra->field_table_ids[__pyx_v_i]) = __pyx_t_5; } - /* "yt/utilities/lib/image_samplers.pyx":337 + /* "yt/utilities/lib/image_samplers.pyx":325 * for i in range(6): * self.vra.field_table_ids[i] = tf_obj.field_table_ids[i] * self.supp_data = self.vra # <<<<<<<<<<<<<< @@ -7451,7 +7943,7 @@ */ __pyx_v_self->__pyx_base.supp_data = ((void *)__pyx_v_self->vra); - /* "yt/utilities/lib/image_samplers.pyx":299 + /* "yt/utilities/lib/image_samplers.pyx":287 * * cdef class VolumeRenderSampler(ImageSampler): * def __cinit__(self, # <<<<<<<<<<<<<< @@ -7493,7 +7985,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pyx":343 +/* "yt/utilities/lib/image_samplers.pyx":331 * @cython.cdivision(True) * @staticmethod * cdef void sample( # <<<<<<<<<<<<<< @@ -7519,7 +8011,7 @@ int __pyx_t_5; long __pyx_t_6; - /* "yt/utilities/lib/image_samplers.pyx":351 + /* "yt/utilities/lib/image_samplers.pyx":339 * int index[3], * void *data) nogil: * cdef ImageAccumulator *im = data # <<<<<<<<<<<<<< @@ -7528,7 +8020,7 @@ */ __pyx_v_im = ((struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator *)__pyx_v_data); - /* "yt/utilities/lib/image_samplers.pyx":352 + /* "yt/utilities/lib/image_samplers.pyx":340 * void *data) nogil: * cdef ImageAccumulator *im = data * cdef VolumeRenderAccumulator *vri = \ # <<<<<<<<<<<<<< @@ -7537,7 +8029,7 @@ */ __pyx_v_vri = ((struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *)__pyx_v_im->supp_data); - /* "yt/utilities/lib/image_samplers.pyx":356 + /* "yt/utilities/lib/image_samplers.pyx":344 * # we assume this has vertex-centered data. * cdef int offset = index[0] * (vc.dims[1] + 1) * (vc.dims[2] + 1) \ * + index[1] * (vc.dims[2] + 1) + index[2] # <<<<<<<<<<<<<< @@ -7546,7 +8038,7 @@ */ __pyx_v_offset = (((((__pyx_v_index[0]) * ((__pyx_v_vc->dims[1]) + 1)) * ((__pyx_v_vc->dims[2]) + 1)) + ((__pyx_v_index[1]) * ((__pyx_v_vc->dims[2]) + 1))) + (__pyx_v_index[2])); - /* "yt/utilities/lib/image_samplers.pyx":358 + /* "yt/utilities/lib/image_samplers.pyx":346 * + index[1] * (vc.dims[2] + 1) + index[2] * cdef int cell_offset = index[0] * (vc.dims[1]) * (vc.dims[2]) \ * + index[1] * (vc.dims[2]) + index[2] # <<<<<<<<<<<<<< @@ -7555,7 +8047,7 @@ */ __pyx_v_cell_offset = (((((__pyx_v_index[0]) * (__pyx_v_vc->dims[1])) * (__pyx_v_vc->dims[2])) + ((__pyx_v_index[1]) * (__pyx_v_vc->dims[2]))) + (__pyx_v_index[2])); - /* "yt/utilities/lib/image_samplers.pyx":359 + /* "yt/utilities/lib/image_samplers.pyx":347 * cdef int cell_offset = index[0] * (vc.dims[1]) * (vc.dims[2]) \ * + index[1] * (vc.dims[2]) + index[2] * if vc.mask[cell_offset] != 1: # <<<<<<<<<<<<<< @@ -7565,7 +8057,7 @@ __pyx_t_1 = (((__pyx_v_vc->mask[__pyx_v_cell_offset]) != 1) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/image_samplers.pyx":360 + /* "yt/utilities/lib/image_samplers.pyx":348 * + index[1] * (vc.dims[2]) + index[2] * if vc.mask[cell_offset] != 1: * return # <<<<<<<<<<<<<< @@ -7574,7 +8066,7 @@ */ goto __pyx_L0; - /* "yt/utilities/lib/image_samplers.pyx":359 + /* "yt/utilities/lib/image_samplers.pyx":347 * cdef int cell_offset = index[0] * (vc.dims[1]) * (vc.dims[2]) \ * + index[1] * (vc.dims[2]) + index[2] * if vc.mask[cell_offset] != 1: # <<<<<<<<<<<<<< @@ -7583,7 +8075,7 @@ */ } - /* "yt/utilities/lib/image_samplers.pyx":363 + /* "yt/utilities/lib/image_samplers.pyx":351 * cdef np.float64_t dp[3] * cdef np.float64_t ds[3] * cdef np.float64_t dt = (exit_t - enter_t) / vri.n_samples # <<<<<<<<<<<<<< @@ -7592,7 +8084,7 @@ */ __pyx_v_dt = ((__pyx_v_exit_t - __pyx_v_enter_t) / __pyx_v_vri->n_samples); - /* "yt/utilities/lib/image_samplers.pyx":365 + /* "yt/utilities/lib/image_samplers.pyx":353 * cdef np.float64_t dt = (exit_t - enter_t) / vri.n_samples * cdef np.float64_t dvs[6] * for i in range(3): # <<<<<<<<<<<<<< @@ -7602,7 +8094,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/image_samplers.pyx":366 + /* "yt/utilities/lib/image_samplers.pyx":354 * cdef np.float64_t dvs[6] * for i in range(3): * dp[i] = (enter_t + 0.5 * dt) * v_dir[i] + v_pos[i] # <<<<<<<<<<<<<< @@ -7611,7 +8103,7 @@ */ (__pyx_v_dp[__pyx_v_i]) = (((__pyx_v_enter_t + (0.5 * __pyx_v_dt)) * (__pyx_v_v_dir[__pyx_v_i])) + (__pyx_v_v_pos[__pyx_v_i])); - /* "yt/utilities/lib/image_samplers.pyx":367 + /* "yt/utilities/lib/image_samplers.pyx":355 * for i in range(3): * dp[i] = (enter_t + 0.5 * dt) * v_dir[i] + v_pos[i] * dp[i] -= index[i] * vc.dds[i] + vc.left_edge[i] # <<<<<<<<<<<<<< @@ -7621,7 +8113,7 @@ __pyx_t_3 = __pyx_v_i; (__pyx_v_dp[__pyx_t_3]) = ((__pyx_v_dp[__pyx_t_3]) - (((__pyx_v_index[__pyx_v_i]) * (__pyx_v_vc->dds[__pyx_v_i])) + (__pyx_v_vc->left_edge[__pyx_v_i]))); - /* "yt/utilities/lib/image_samplers.pyx":368 + /* "yt/utilities/lib/image_samplers.pyx":356 * dp[i] = (enter_t + 0.5 * dt) * v_dir[i] + v_pos[i] * dp[i] -= index[i] * vc.dds[i] + vc.left_edge[i] * dp[i] *= vc.idds[i] # <<<<<<<<<<<<<< @@ -7631,7 +8123,7 @@ __pyx_t_3 = __pyx_v_i; (__pyx_v_dp[__pyx_t_3]) = ((__pyx_v_dp[__pyx_t_3]) * (__pyx_v_vc->idds[__pyx_v_i])); - /* "yt/utilities/lib/image_samplers.pyx":369 + /* "yt/utilities/lib/image_samplers.pyx":357 * dp[i] -= index[i] * vc.dds[i] + vc.left_edge[i] * dp[i] *= vc.idds[i] * ds[i] = v_dir[i] * vc.idds[i] * dt # <<<<<<<<<<<<<< @@ -7641,7 +8133,7 @@ (__pyx_v_ds[__pyx_v_i]) = (((__pyx_v_v_dir[__pyx_v_i]) * (__pyx_v_vc->idds[__pyx_v_i])) * __pyx_v_dt); } - /* "yt/utilities/lib/image_samplers.pyx":370 + /* "yt/utilities/lib/image_samplers.pyx":358 * dp[i] *= vc.idds[i] * ds[i] = v_dir[i] * vc.idds[i] * dt * for i in range(vri.n_samples): # <<<<<<<<<<<<<< @@ -7652,7 +8144,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_4; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/image_samplers.pyx":371 + /* "yt/utilities/lib/image_samplers.pyx":359 * ds[i] = v_dir[i] * vc.idds[i] * dt * for i in range(vri.n_samples): * for j in range(vc.n_fields): # <<<<<<<<<<<<<< @@ -7663,7 +8155,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { __pyx_v_j = __pyx_t_3; - /* "yt/utilities/lib/image_samplers.pyx":372 + /* "yt/utilities/lib/image_samplers.pyx":360 * for i in range(vri.n_samples): * for j in range(vc.n_fields): * dvs[j] = offset_interpolate(vc.dims, dp, # <<<<<<<<<<<<<< @@ -7673,7 +8165,7 @@ (__pyx_v_dvs[__pyx_v_j]) = offset_interpolate(__pyx_v_vc->dims, __pyx_v_dp, ((__pyx_v_vc->data[__pyx_v_j]) + __pyx_v_offset)); } - /* "yt/utilities/lib/image_samplers.pyx":374 + /* "yt/utilities/lib/image_samplers.pyx":362 * dvs[j] = offset_interpolate(vc.dims, dp, * vc.data[j] + offset) * FIT_eval_transfer(dt, dvs, im.rgba, vri.n_fits, # <<<<<<<<<<<<<< @@ -7682,7 +8174,7 @@ */ __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_eval_transfer(__pyx_v_dt, __pyx_v_dvs, __pyx_v_im->rgba, __pyx_v_vri->n_fits, __pyx_v_vri->fits, __pyx_v_vri->field_table_ids, __pyx_v_vri->grey_opacity); - /* "yt/utilities/lib/image_samplers.pyx":376 + /* "yt/utilities/lib/image_samplers.pyx":364 * FIT_eval_transfer(dt, dvs, im.rgba, vri.n_fits, * vri.fits, vri.field_table_ids, vri.grey_opacity) * for j in range(3): # <<<<<<<<<<<<<< @@ -7692,7 +8184,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_j = __pyx_t_3; - /* "yt/utilities/lib/image_samplers.pyx":377 + /* "yt/utilities/lib/image_samplers.pyx":365 * vri.fits, vri.field_table_ids, vri.grey_opacity) * for j in range(3): * dp[j] += ds[j] # <<<<<<<<<<<<<< @@ -7704,7 +8196,7 @@ } } - /* "yt/utilities/lib/image_samplers.pyx":343 + /* "yt/utilities/lib/image_samplers.pyx":331 * @cython.cdivision(True) * @staticmethod * cdef void sample( # <<<<<<<<<<<<<< @@ -7716,7 +8208,7 @@ __pyx_L0:; } -/* "yt/utilities/lib/image_samplers.pyx":379 +/* "yt/utilities/lib/image_samplers.pyx":367 * dp[j] += ds[j] * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -7742,7 +8234,7 @@ int __pyx_t_2; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "yt/utilities/lib/image_samplers.pyx":380 + /* "yt/utilities/lib/image_samplers.pyx":368 * * def __dealloc__(self): * for i in range(self.vra.n_fits): # <<<<<<<<<<<<<< @@ -7753,7 +8245,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/image_samplers.pyx":381 + /* "yt/utilities/lib/image_samplers.pyx":369 * def __dealloc__(self): * for i in range(self.vra.n_fits): * free(self.vra.fits[i].d0) # <<<<<<<<<<<<<< @@ -7762,7 +8254,7 @@ */ free((__pyx_v_self->vra->fits[__pyx_v_i]).d0); - /* "yt/utilities/lib/image_samplers.pyx":382 + /* "yt/utilities/lib/image_samplers.pyx":370 * for i in range(self.vra.n_fits): * free(self.vra.fits[i].d0) * free(self.vra.fits[i].dy) # <<<<<<<<<<<<<< @@ -7772,7 +8264,7 @@ free((__pyx_v_self->vra->fits[__pyx_v_i]).dy); } - /* "yt/utilities/lib/image_samplers.pyx":383 + /* "yt/utilities/lib/image_samplers.pyx":371 * free(self.vra.fits[i].d0) * free(self.vra.fits[i].dy) * free(self.vra.fits) # <<<<<<<<<<<<<< @@ -7781,7 +8273,7 @@ */ free(__pyx_v_self->vra->fits); - /* "yt/utilities/lib/image_samplers.pyx":384 + /* "yt/utilities/lib/image_samplers.pyx":372 * free(self.vra.fits[i].dy) * free(self.vra.fits) * free(self.vra) # <<<<<<<<<<<<<< @@ -7790,7 +8282,7 @@ */ free(__pyx_v_self->vra); - /* "yt/utilities/lib/image_samplers.pyx":379 + /* "yt/utilities/lib/image_samplers.pyx":367 * dp[j] += ds[j] * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -7802,12 +8294,12 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/image_samplers.pxd":70 +/* "yt/utilities/lib/image_samplers.pxd":85 * cdef class VolumeRenderSampler(ImageSampler): * cdef VolumeRenderAccumulator *vra * cdef public object tf_obj # <<<<<<<<<<<<<< * cdef public object my_field_tables - * cdef kdtree_utils.kdtree **trees + * cdef object tree_containers */ /* Python wrapper */ @@ -7897,12 +8389,12 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pxd":71 +/* "yt/utilities/lib/image_samplers.pxd":86 * cdef VolumeRenderAccumulator *vra * cdef public object tf_obj * cdef public object my_field_tables # <<<<<<<<<<<<<< - * cdef kdtree_utils.kdtree **trees * cdef object tree_containers + * */ /* Python wrapper */ @@ -7992,7 +8484,114 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pyx":387 +/* "(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_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_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_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_4__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__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__13, 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("yt.utilities.lib.image_samplers.VolumeRenderSampler.__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_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_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_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_6__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__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__14, 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("yt.utilities.lib.image_samplers.VolumeRenderSampler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/image_samplers.pyx":375 * * cdef class LightSourceRenderSampler(ImageSampler): * def __cinit__(self, # <<<<<<<<<<<<<< @@ -8025,24 +8624,36 @@ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vp_pos,&__pyx_n_s_vp_dir,&__pyx_n_s_center,&__pyx_n_s_bounds,&__pyx_n_s_image,&__pyx_n_s_x_vec,&__pyx_n_s_y_vec,&__pyx_n_s_width,&__pyx_n_s_tf_obj,&__pyx_n_s_n_samples,&__pyx_n_s_light_dir,&__pyx_n_s_light_rgba,0}; PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0}; values[9] = ((PyObject *)__pyx_int_10); - values[10] = __pyx_k__7; - values[11] = __pyx_k__8; + values[10] = __pyx_k__15; + values[11] = __pyx_k__16; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -8051,56 +8662,67 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vp_pos)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vp_dir)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 1); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 1); __PYX_ERR(0, 375, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_center)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 2); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 2); __PYX_ERR(0, 375, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 3); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 3); __PYX_ERR(0, 375, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 4); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 4); __PYX_ERR(0, 375, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_vec)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 5); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 5); __PYX_ERR(0, 375, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_vec)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 6); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 6); __PYX_ERR(0, 375, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 7); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 7); __PYX_ERR(0, 375, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tf_obj)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 8); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 8); __PYX_ERR(0, 375, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_samples); if (value) { values[9] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_light_dir); if (value) { values[10] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_light_rgba); @@ -8108,13 +8730,16 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 375, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); @@ -8143,20 +8768,20 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 375, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("yt.utilities.lib.image_samplers.LightSourceRenderSampler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vp_pos), __pyx_ptype_5numpy_ndarray, 1, "vp_pos", 0))) __PYX_ERR(0, 388, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vp_dir), __pyx_ptype_5numpy_ndarray, 1, "vp_dir", 0))) __PYX_ERR(0, 389, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_center), __pyx_ptype_5numpy_ndarray, 1, "center", 0))) __PYX_ERR(0, 390, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 392, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x_vec), __pyx_ptype_5numpy_ndarray, 1, "x_vec", 0))) __PYX_ERR(0, 393, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_vec), __pyx_ptype_5numpy_ndarray, 1, "y_vec", 0))) __PYX_ERR(0, 394, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), __pyx_ptype_5numpy_ndarray, 1, "width", 0))) __PYX_ERR(0, 395, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vp_pos), __pyx_ptype_5numpy_ndarray, 1, "vp_pos", 0))) __PYX_ERR(0, 376, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vp_dir), __pyx_ptype_5numpy_ndarray, 1, "vp_dir", 0))) __PYX_ERR(0, 377, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_center), __pyx_ptype_5numpy_ndarray, 1, "center", 0))) __PYX_ERR(0, 378, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 380, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x_vec), __pyx_ptype_5numpy_ndarray, 1, "x_vec", 0))) __PYX_ERR(0, 381, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_vec), __pyx_ptype_5numpy_ndarray, 1, "y_vec", 0))) __PYX_ERR(0, 382, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), __pyx_ptype_5numpy_ndarray, 1, "width", 0))) __PYX_ERR(0, 383, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *)__pyx_v_self), __pyx_v_vp_pos, __pyx_v_vp_dir, __pyx_v_center, __pyx_v_bounds, __pyx_v_image, __pyx_v_x_vec, __pyx_v_y_vec, __pyx_v_width, __pyx_v_tf_obj, __pyx_v_n_samples, __pyx_v_light_dir, __pyx_v_light_rgba, __pyx_v_kwargs); /* function exit code */ @@ -8192,17 +8817,18 @@ int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_7; - int __pyx_t_8; - PyArrayObject *__pyx_t_9 = NULL; - int __pyx_t_10; - PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_7 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_8; + int __pyx_t_9; + PyArrayObject *__pyx_t_10 = NULL; + int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_14; - int __pyx_t_15; + PyObject *__pyx_t_14 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_15; int __pyx_t_16; int __pyx_t_17; + int __pyx_t_18; __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_light_dir); __pyx_pybuffer_temp.pybuffer.buf = NULL; @@ -8231,48 +8857,48 @@ __pyx_pybuffernd_width.rcbuffer = &__pyx_pybuffer_width; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_center.rcbuffer->pybuffer, (PyObject*)__pyx_v_center, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_center.rcbuffer->pybuffer, (PyObject*)__pyx_v_center, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 375, __pyx_L1_error) } __pyx_pybuffernd_center.diminfo[0].strides = __pyx_pybuffernd_center.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_center.diminfo[0].shape = __pyx_pybuffernd_center.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 375, __pyx_L1_error) } __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_image.diminfo[1].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_image.diminfo[1].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_image.diminfo[2].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_image.diminfo[2].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_x_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_x_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 375, __pyx_L1_error) } __pyx_pybuffernd_x_vec.diminfo[0].strides = __pyx_pybuffernd_x_vec.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x_vec.diminfo[0].shape = __pyx_pybuffernd_x_vec.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_y_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_y_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 375, __pyx_L1_error) } __pyx_pybuffernd_y_vec.diminfo[0].strides = __pyx_pybuffernd_y_vec.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y_vec.diminfo[0].shape = __pyx_pybuffernd_y_vec.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_width.rcbuffer->pybuffer, (PyObject*)__pyx_v_width, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_width.rcbuffer->pybuffer, (PyObject*)__pyx_v_width, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 375, __pyx_L1_error) } __pyx_pybuffernd_width.diminfo[0].strides = __pyx_pybuffernd_width.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_width.diminfo[0].shape = __pyx_pybuffernd_width.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/image_samplers.pyx":400 + /* "yt/utilities/lib/image_samplers.pyx":388 * light_rgba=[1.,1.,1.,1.], * **kwargs): * ImageSampler.__init__(self, vp_pos, vp_dir, center, bounds, image, # <<<<<<<<<<<<<< * x_vec, y_vec, width, **kwargs) * cdef int i */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "yt/utilities/lib/image_samplers.pyx":401 + /* "yt/utilities/lib/image_samplers.pyx":389 * **kwargs): * ImageSampler.__init__(self, vp_pos, vp_dir, center, bounds, image, * x_vec, y_vec, width, **kwargs) # <<<<<<<<<<<<<< * cdef int i * cdef np.ndarray[np.float64_t, ndim=1] temp */ - __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -8302,20 +8928,20 @@ __Pyx_GIVEREF(((PyObject *)__pyx_v_width)); PyTuple_SET_ITEM(__pyx_t_2, 8, ((PyObject *)__pyx_v_width)); - /* "yt/utilities/lib/image_samplers.pyx":400 + /* "yt/utilities/lib/image_samplers.pyx":388 * light_rgba=[1.,1.,1.,1.], * **kwargs): * ImageSampler.__init__(self, vp_pos, vp_dir, center, bounds, image, # <<<<<<<<<<<<<< * x_vec, y_vec, width, **kwargs) * cdef int i */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":405 + /* "yt/utilities/lib/image_samplers.pyx":393 * cdef np.ndarray[np.float64_t, ndim=1] temp * # Now we handle tf_obj * self.vra = \ # <<<<<<<<<<<<<< @@ -8324,7 +8950,7 @@ */ __pyx_v_self->vra = ((struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *)malloc((sizeof(struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator)))); - /* "yt/utilities/lib/image_samplers.pyx":407 + /* "yt/utilities/lib/image_samplers.pyx":395 * self.vra = \ * malloc(sizeof(VolumeRenderAccumulator)) * self.vra.fits = \ # <<<<<<<<<<<<<< @@ -8333,20 +8959,20 @@ */ __pyx_v_self->vra->fits = ((struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *)malloc(((sizeof(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable)) * 6))); - /* "yt/utilities/lib/image_samplers.pyx":409 + /* "yt/utilities/lib/image_samplers.pyx":397 * self.vra.fits = \ * malloc(sizeof(FieldInterpolationTable) * 6) * self.vra.n_fits = tf_obj.n_field_tables # <<<<<<<<<<<<<< * assert(self.vra.n_fits <= 6) * self.vra.grey_opacity = getattr(tf_obj, "grey_opacity", 0) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_n_field_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_n_field_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->vra->n_fits = __pyx_t_4; - /* "yt/utilities/lib/image_samplers.pyx":410 + /* "yt/utilities/lib/image_samplers.pyx":398 * malloc(sizeof(FieldInterpolationTable) * 6) * self.vra.n_fits = tf_obj.n_field_tables * assert(self.vra.n_fits <= 6) # <<<<<<<<<<<<<< @@ -8357,84 +8983,125 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_self->vra->n_fits <= 6) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 410, __pyx_L1_error) + __PYX_ERR(0, 398, __pyx_L1_error) } } #endif - /* "yt/utilities/lib/image_samplers.pyx":411 + /* "yt/utilities/lib/image_samplers.pyx":399 * self.vra.n_fits = tf_obj.n_field_tables * assert(self.vra.n_fits <= 6) * self.vra.grey_opacity = getattr(tf_obj, "grey_opacity", 0) # <<<<<<<<<<<<<< * self.vra.n_samples = n_samples * self.vra.light_dir = malloc(sizeof(np.float64_t) * 3) */ - __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_tf_obj, __pyx_n_s_grey_opacity, __pyx_int_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_tf_obj, __pyx_n_s_grey_opacity, __pyx_int_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->vra->grey_opacity = __pyx_t_4; - /* "yt/utilities/lib/image_samplers.pyx":412 + /* "yt/utilities/lib/image_samplers.pyx":400 * assert(self.vra.n_fits <= 6) * self.vra.grey_opacity = getattr(tf_obj, "grey_opacity", 0) * self.vra.n_samples = n_samples # <<<<<<<<<<<<<< * self.vra.light_dir = malloc(sizeof(np.float64_t) * 3) * self.vra.light_rgba = malloc(sizeof(np.float64_t) * 4) */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_n_samples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_n_samples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) __pyx_v_self->vra->n_samples = __pyx_t_4; - /* "yt/utilities/lib/image_samplers.pyx":413 + /* "yt/utilities/lib/image_samplers.pyx":401 * self.vra.grey_opacity = getattr(tf_obj, "grey_opacity", 0) * self.vra.n_samples = n_samples * self.vra.light_dir = malloc(sizeof(np.float64_t) * 3) # <<<<<<<<<<<<<< * self.vra.light_rgba = malloc(sizeof(np.float64_t) * 4) - * light_dir /= np.sqrt(light_dir[0]**2 + light_dir[1]**2 + light_dir[2]**2) + * light_dir /= np.sqrt(light_dir[0] * light_dir[0] + */ __pyx_v_self->vra->light_dir = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * 3))); - /* "yt/utilities/lib/image_samplers.pyx":414 + /* "yt/utilities/lib/image_samplers.pyx":402 * self.vra.n_samples = n_samples * self.vra.light_dir = malloc(sizeof(np.float64_t) * 3) * self.vra.light_rgba = malloc(sizeof(np.float64_t) * 4) # <<<<<<<<<<<<<< - * light_dir /= np.sqrt(light_dir[0]**2 + light_dir[1]**2 + light_dir[2]**2) - * for i in range(3): + * light_dir /= np.sqrt(light_dir[0] * light_dir[0] + + * light_dir[1] * light_dir[1] + */ __pyx_v_self->vra->light_rgba = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * 4))); - /* "yt/utilities/lib/image_samplers.pyx":415 + /* "yt/utilities/lib/image_samplers.pyx":403 * self.vra.light_dir = malloc(sizeof(np.float64_t) * 3) * self.vra.light_rgba = malloc(sizeof(np.float64_t) * 4) - * light_dir /= np.sqrt(light_dir[0]**2 + light_dir[1]**2 + light_dir[2]**2) # <<<<<<<<<<<<<< - * for i in range(3): - * self.vra.light_dir[i] = light_dir[i] + * light_dir /= np.sqrt(light_dir[0] * light_dir[0] + # <<<<<<<<<<<<<< + * light_dir[1] * light_dir[1] + + * light_dir[2] * light_dir[2]) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_light_dir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_light_dir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_light_dir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_light_dir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "yt/utilities/lib/image_samplers.pyx":404 + * self.vra.light_rgba = malloc(sizeof(np.float64_t) * 4) + * light_dir /= np.sqrt(light_dir[0] * light_dir[0] + + * light_dir[1] * light_dir[1] + # <<<<<<<<<<<<<< + * light_dir[2] * light_dir[2]) + * for i in range(3): + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_light_dir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_light_dir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/image_samplers.pyx":403 + * self.vra.light_dir = malloc(sizeof(np.float64_t) * 3) + * self.vra.light_rgba = malloc(sizeof(np.float64_t) * 4) + * light_dir /= np.sqrt(light_dir[0] * light_dir[0] + # <<<<<<<<<<<<<< + * light_dir[1] * light_dir[1] + + * light_dir[2] * light_dir[2]) + */ + __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_light_dir, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "yt/utilities/lib/image_samplers.pyx":405 + * light_dir /= np.sqrt(light_dir[0] * light_dir[0] + + * light_dir[1] * light_dir[1] + + * light_dir[2] * light_dir[2]) # <<<<<<<<<<<<<< + * for i in range(3): + * self.vra.light_dir[i] = light_dir[i] + */ + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_light_dir, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_light_dir, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error) + + /* "yt/utilities/lib/image_samplers.pyx":404 + * self.vra.light_rgba = malloc(sizeof(np.float64_t) * 4) + * light_dir /= np.sqrt(light_dir[0] * light_dir[0] + + * light_dir[1] * light_dir[1] + # <<<<<<<<<<<<<< + * light_dir[2] * light_dir[2]) + * for i in range(3): + */ + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 404, __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; @@ -8449,14 +9116,14 @@ } } if (!__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -8465,34 +9132,42 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __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, 415, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_light_dir, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) + + /* "yt/utilities/lib/image_samplers.pyx":403 + * self.vra.light_dir = malloc(sizeof(np.float64_t) * 3) + * self.vra.light_rgba = malloc(sizeof(np.float64_t) * 4) + * light_dir /= np.sqrt(light_dir[0] * light_dir[0] + # <<<<<<<<<<<<<< + * light_dir[1] * light_dir[1] + + * light_dir[2] * light_dir[2]) + */ + __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_light_dir, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_light_dir, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/image_samplers.pyx":416 - * self.vra.light_rgba = malloc(sizeof(np.float64_t) * 4) - * light_dir /= np.sqrt(light_dir[0]**2 + light_dir[1]**2 + light_dir[2]**2) + /* "yt/utilities/lib/image_samplers.pyx":406 + * light_dir[1] * light_dir[1] + + * light_dir[2] * light_dir[2]) * for i in range(3): # <<<<<<<<<<<<<< * self.vra.light_dir[i] = light_dir[i] * for i in range(4): @@ -8500,21 +9175,21 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/utilities/lib/image_samplers.pyx":417 - * light_dir /= np.sqrt(light_dir[0]**2 + light_dir[1]**2 + light_dir[2]**2) + /* "yt/utilities/lib/image_samplers.pyx":407 + * light_dir[2] * light_dir[2]) * for i in range(3): * self.vra.light_dir[i] = light_dir[i] # <<<<<<<<<<<<<< * for i in range(4): * self.vra.light_rgba[i] = light_rgba[i] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_light_dir, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_light_dir, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - (__pyx_v_self->vra->light_dir[__pyx_v_i]) = __pyx_t_7; + (__pyx_v_self->vra->light_dir[__pyx_v_i]) = __pyx_t_8; } - /* "yt/utilities/lib/image_samplers.pyx":418 + /* "yt/utilities/lib/image_samplers.pyx":408 * for i in range(3): * self.vra.light_dir[i] = light_dir[i] * for i in range(4): # <<<<<<<<<<<<<< @@ -8524,28 +9199,28 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 4; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/utilities/lib/image_samplers.pyx":419 + /* "yt/utilities/lib/image_samplers.pyx":409 * self.vra.light_dir[i] = light_dir[i] * for i in range(4): * self.vra.light_rgba[i] = light_rgba[i] # <<<<<<<<<<<<<< * self.my_field_tables = [] * for i in range(self.vra.n_fits): */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_light_rgba, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_light_rgba, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - (__pyx_v_self->vra->light_rgba[__pyx_v_i]) = __pyx_t_7; + (__pyx_v_self->vra->light_rgba[__pyx_v_i]) = __pyx_t_8; } - /* "yt/utilities/lib/image_samplers.pyx":420 + /* "yt/utilities/lib/image_samplers.pyx":410 * for i in range(4): * self.vra.light_rgba[i] = light_rgba[i] * self.my_field_tables = [] # <<<<<<<<<<<<<< * for i in range(self.vra.n_fits): * temp = tf_obj.tables[i].y */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->my_field_tables); @@ -8553,7 +9228,7 @@ __pyx_v_self->my_field_tables = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/utilities/lib/image_samplers.pyx":421 + /* "yt/utilities/lib/image_samplers.pyx":411 * self.vra.light_rgba[i] = light_rgba[i] * self.my_field_tables = [] * for i in range(self.vra.n_fits): # <<<<<<<<<<<<<< @@ -8561,171 +9236,171 @@ * FIT_initialize_table(&self.vra.fits[i], */ __pyx_t_4 = __pyx_v_self->vra->n_fits; - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_4; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_4; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; - /* "yt/utilities/lib/image_samplers.pyx":422 + /* "yt/utilities/lib/image_samplers.pyx":412 * self.my_field_tables = [] * for i in range(self.vra.n_fits): * temp = tf_obj.tables[i].y # <<<<<<<<<<<<<< * FIT_initialize_table(&self.vra.fits[i], * temp.shape[0], */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 422, __pyx_L1_error) - __pyx_t_9 = ((PyArrayObject *)__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_temp.rcbuffer->pybuffer); - __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_temp.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_10 < 0)) { - PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_temp.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_temp.rcbuffer->pybuffer, (PyObject*)__pyx_v_temp, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); } } __pyx_pybuffernd_temp.diminfo[0].strides = __pyx_pybuffernd_temp.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_temp.diminfo[0].shape = __pyx_pybuffernd_temp.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 422, __pyx_L1_error) + if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 412, __pyx_L1_error) } - __pyx_t_9 = 0; + __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_v_temp, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "yt/utilities/lib/image_samplers.pyx":426 + /* "yt/utilities/lib/image_samplers.pyx":416 * temp.shape[0], * temp.data, * tf_obj.tables[i].x_bounds[0], # <<<<<<<<<<<<<< * tf_obj.tables[i].x_bounds[1], * tf_obj.field_ids[i], tf_obj.weight_field_ids[i], */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_x_bounds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_x_bounds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":427 + /* "yt/utilities/lib/image_samplers.pyx":417 * temp.data, * tf_obj.tables[i].x_bounds[0], * tf_obj.tables[i].x_bounds[1], # <<<<<<<<<<<<<< * tf_obj.field_ids[i], tf_obj.weight_field_ids[i], * tf_obj.weight_table_ids[i]) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_x_bounds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_x_bounds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_14 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/image_samplers.pyx":428 + /* "yt/utilities/lib/image_samplers.pyx":418 * tf_obj.tables[i].x_bounds[0], * tf_obj.tables[i].x_bounds[1], * tf_obj.field_ids[i], tf_obj.weight_field_ids[i], # <<<<<<<<<<<<<< * tf_obj.weight_table_ids[i]) * self.my_field_tables.append((tf_obj.tables[i], */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_field_ids); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_field_ids); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_weight_field_ids); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_weight_field_ids); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/image_samplers.pyx":429 + /* "yt/utilities/lib/image_samplers.pyx":419 * tf_obj.tables[i].x_bounds[1], * tf_obj.field_ids[i], tf_obj.weight_field_ids[i], * tf_obj.weight_table_ids[i]) # <<<<<<<<<<<<<< * self.my_field_tables.append((tf_obj.tables[i], * tf_obj.tables[i].y)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_weight_table_ids); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_weight_table_ids); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":423 + /* "yt/utilities/lib/image_samplers.pyx":413 * for i in range(self.vra.n_fits): * temp = tf_obj.tables[i].y * FIT_initialize_table(&self.vra.fits[i], # <<<<<<<<<<<<<< * temp.shape[0], * temp.data, */ - __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_initialize_table((&(__pyx_v_self->vra->fits[__pyx_v_i])), (__pyx_v_temp->dimensions[0]), ((__pyx_t_5numpy_float64_t *)__pyx_v_temp->data), __pyx_t_7, __pyx_t_14, __pyx_t_10, __pyx_t_15, __pyx_t_16); + __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_initialize_table((&(__pyx_v_self->vra->fits[__pyx_v_i])), (__pyx_v_temp->dimensions[0]), ((__pyx_t_5numpy_float64_t *)__pyx_v_temp->data), __pyx_t_8, __pyx_t_15, __pyx_t_11, __pyx_t_16, __pyx_t_17); - /* "yt/utilities/lib/image_samplers.pyx":430 + /* "yt/utilities/lib/image_samplers.pyx":420 * tf_obj.field_ids[i], tf_obj.weight_field_ids[i], * tf_obj.weight_table_ids[i]) * self.my_field_tables.append((tf_obj.tables[i], # <<<<<<<<<<<<<< * tf_obj.tables[i].y)) * for i in range(6): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":431 + /* "yt/utilities/lib/image_samplers.pyx":421 * tf_obj.weight_table_ids[i]) * self.my_field_tables.append((tf_obj.tables[i], * tf_obj.tables[i].y)) # <<<<<<<<<<<<<< * for i in range(6): * self.vra.field_table_ids[i] = tf_obj.field_table_ids[i] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/image_samplers.pyx":430 + /* "yt/utilities/lib/image_samplers.pyx":420 * tf_obj.field_ids[i], tf_obj.weight_field_ids[i], * tf_obj.weight_table_ids[i]) * self.my_field_tables.append((tf_obj.tables[i], # <<<<<<<<<<<<<< * tf_obj.tables[i].y)) * for i in range(6): */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -8733,11 +9408,11 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_17 = __Pyx_PyObject_Append(__pyx_v_self->my_field_tables, __pyx_t_2); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_Append(__pyx_v_self->my_field_tables, __pyx_t_2); if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "yt/utilities/lib/image_samplers.pyx":432 + /* "yt/utilities/lib/image_samplers.pyx":422 * self.my_field_tables.append((tf_obj.tables[i], * tf_obj.tables[i].y)) * for i in range(6): # <<<<<<<<<<<<<< @@ -8747,24 +9422,24 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 6; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/utilities/lib/image_samplers.pyx":433 + /* "yt/utilities/lib/image_samplers.pyx":423 * tf_obj.tables[i].y)) * for i in range(6): * self.vra.field_table_ids[i] = tf_obj.field_table_ids[i] # <<<<<<<<<<<<<< * self.supp_data = self.vra * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_field_table_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tf_obj, __pyx_n_s_field_table_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - (__pyx_v_self->vra->field_table_ids[__pyx_v_i]) = __pyx_t_8; + (__pyx_v_self->vra->field_table_ids[__pyx_v_i]) = __pyx_t_9; } - /* "yt/utilities/lib/image_samplers.pyx":434 + /* "yt/utilities/lib/image_samplers.pyx":424 * for i in range(6): * self.vra.field_table_ids[i] = tf_obj.field_table_ids[i] * self.supp_data = self.vra # <<<<<<<<<<<<<< @@ -8773,7 +9448,7 @@ */ __pyx_v_self->__pyx_base.supp_data = ((void *)__pyx_v_self->vra); - /* "yt/utilities/lib/image_samplers.pyx":387 + /* "yt/utilities/lib/image_samplers.pyx":375 * * cdef class LightSourceRenderSampler(ImageSampler): * def __cinit__(self, # <<<<<<<<<<<<<< @@ -8790,6 +9465,7 @@ __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -8818,7 +9494,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pyx":440 +/* "yt/utilities/lib/image_samplers.pyx":430 * @cython.cdivision(True) * @staticmethod * cdef void sample( # <<<<<<<<<<<<<< @@ -8843,7 +9519,7 @@ int __pyx_t_4; long __pyx_t_5; - /* "yt/utilities/lib/image_samplers.pyx":448 + /* "yt/utilities/lib/image_samplers.pyx":438 * int index[3], * void *data) nogil: * cdef ImageAccumulator *im = data # <<<<<<<<<<<<<< @@ -8852,7 +9528,7 @@ */ __pyx_v_im = ((struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator *)__pyx_v_data); - /* "yt/utilities/lib/image_samplers.pyx":449 + /* "yt/utilities/lib/image_samplers.pyx":439 * void *data) nogil: * cdef ImageAccumulator *im = data * cdef VolumeRenderAccumulator *vri = \ # <<<<<<<<<<<<<< @@ -8861,7 +9537,7 @@ */ __pyx_v_vri = ((struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *)__pyx_v_im->supp_data); - /* "yt/utilities/lib/image_samplers.pyx":453 + /* "yt/utilities/lib/image_samplers.pyx":443 * # we assume this has vertex-centered data. * cdef int offset = index[0] * (vc.dims[1] + 1) * (vc.dims[2] + 1) \ * + index[1] * (vc.dims[2] + 1) + index[2] # <<<<<<<<<<<<<< @@ -8870,7 +9546,7 @@ */ __pyx_v_offset = (((((__pyx_v_index[0]) * ((__pyx_v_vc->dims[1]) + 1)) * ((__pyx_v_vc->dims[2]) + 1)) + ((__pyx_v_index[1]) * ((__pyx_v_vc->dims[2]) + 1))) + (__pyx_v_index[2])); - /* "yt/utilities/lib/image_samplers.pyx":456 + /* "yt/utilities/lib/image_samplers.pyx":446 * cdef np.float64_t dp[3] * cdef np.float64_t ds[3] * cdef np.float64_t dt = (exit_t - enter_t) / vri.n_samples # <<<<<<<<<<<<<< @@ -8879,7 +9555,7 @@ */ __pyx_v_dt = ((__pyx_v_exit_t - __pyx_v_enter_t) / __pyx_v_vri->n_samples); - /* "yt/utilities/lib/image_samplers.pyx":459 + /* "yt/utilities/lib/image_samplers.pyx":449 * cdef np.float64_t dvs[6] * cdef np.float64_t *grad * grad = malloc(3 * sizeof(np.float64_t)) # <<<<<<<<<<<<<< @@ -8888,7 +9564,7 @@ */ __pyx_v_grad = ((__pyx_t_5numpy_float64_t *)malloc((3 * (sizeof(__pyx_t_5numpy_float64_t))))); - /* "yt/utilities/lib/image_samplers.pyx":460 + /* "yt/utilities/lib/image_samplers.pyx":450 * cdef np.float64_t *grad * grad = malloc(3 * sizeof(np.float64_t)) * for i in range(3): # <<<<<<<<<<<<<< @@ -8898,7 +9574,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/image_samplers.pyx":461 + /* "yt/utilities/lib/image_samplers.pyx":451 * grad = malloc(3 * sizeof(np.float64_t)) * for i in range(3): * dp[i] = (enter_t + 0.5 * dt) * v_dir[i] + v_pos[i] # <<<<<<<<<<<<<< @@ -8907,7 +9583,7 @@ */ (__pyx_v_dp[__pyx_v_i]) = (((__pyx_v_enter_t + (0.5 * __pyx_v_dt)) * (__pyx_v_v_dir[__pyx_v_i])) + (__pyx_v_v_pos[__pyx_v_i])); - /* "yt/utilities/lib/image_samplers.pyx":462 + /* "yt/utilities/lib/image_samplers.pyx":452 * for i in range(3): * dp[i] = (enter_t + 0.5 * dt) * v_dir[i] + v_pos[i] * dp[i] -= index[i] * vc.dds[i] + vc.left_edge[i] # <<<<<<<<<<<<<< @@ -8917,7 +9593,7 @@ __pyx_t_2 = __pyx_v_i; (__pyx_v_dp[__pyx_t_2]) = ((__pyx_v_dp[__pyx_t_2]) - (((__pyx_v_index[__pyx_v_i]) * (__pyx_v_vc->dds[__pyx_v_i])) + (__pyx_v_vc->left_edge[__pyx_v_i]))); - /* "yt/utilities/lib/image_samplers.pyx":463 + /* "yt/utilities/lib/image_samplers.pyx":453 * dp[i] = (enter_t + 0.5 * dt) * v_dir[i] + v_pos[i] * dp[i] -= index[i] * vc.dds[i] + vc.left_edge[i] * dp[i] *= vc.idds[i] # <<<<<<<<<<<<<< @@ -8927,7 +9603,7 @@ __pyx_t_2 = __pyx_v_i; (__pyx_v_dp[__pyx_t_2]) = ((__pyx_v_dp[__pyx_t_2]) * (__pyx_v_vc->idds[__pyx_v_i])); - /* "yt/utilities/lib/image_samplers.pyx":464 + /* "yt/utilities/lib/image_samplers.pyx":454 * dp[i] -= index[i] * vc.dds[i] + vc.left_edge[i] * dp[i] *= vc.idds[i] * ds[i] = v_dir[i] * vc.idds[i] * dt # <<<<<<<<<<<<<< @@ -8937,7 +9613,7 @@ (__pyx_v_ds[__pyx_v_i]) = (((__pyx_v_v_dir[__pyx_v_i]) * (__pyx_v_vc->idds[__pyx_v_i])) * __pyx_v_dt); } - /* "yt/utilities/lib/image_samplers.pyx":465 + /* "yt/utilities/lib/image_samplers.pyx":455 * dp[i] *= vc.idds[i] * ds[i] = v_dir[i] * vc.idds[i] * dt * for i in range(vri.n_samples): # <<<<<<<<<<<<<< @@ -8948,7 +9624,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/image_samplers.pyx":466 + /* "yt/utilities/lib/image_samplers.pyx":456 * ds[i] = v_dir[i] * vc.idds[i] * dt * for i in range(vri.n_samples): * for j in range(vc.n_fields): # <<<<<<<<<<<<<< @@ -8959,7 +9635,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_4; __pyx_t_2+=1) { __pyx_v_j = __pyx_t_2; - /* "yt/utilities/lib/image_samplers.pyx":467 + /* "yt/utilities/lib/image_samplers.pyx":457 * for i in range(vri.n_samples): * for j in range(vc.n_fields): * dvs[j] = offset_interpolate(vc.dims, dp, # <<<<<<<<<<<<<< @@ -8969,7 +9645,7 @@ (__pyx_v_dvs[__pyx_v_j]) = offset_interpolate(__pyx_v_vc->dims, __pyx_v_dp, ((__pyx_v_vc->data[__pyx_v_j]) + __pyx_v_offset)); } - /* "yt/utilities/lib/image_samplers.pyx":469 + /* "yt/utilities/lib/image_samplers.pyx":459 * dvs[j] = offset_interpolate(vc.dims, dp, * vc.data[j] + offset) * eval_gradient(vc.dims, dp, vc.data[0] + offset, grad) # <<<<<<<<<<<<<< @@ -8978,7 +9654,7 @@ */ eval_gradient(__pyx_v_vc->dims, __pyx_v_dp, ((__pyx_v_vc->data[0]) + __pyx_v_offset), __pyx_v_grad); - /* "yt/utilities/lib/image_samplers.pyx":470 + /* "yt/utilities/lib/image_samplers.pyx":460 * vc.data[j] + offset) * eval_gradient(vc.dims, dp, vc.data[0] + offset, grad) * FIT_eval_transfer_with_light(dt, dvs, grad, # <<<<<<<<<<<<<< @@ -8987,7 +9663,7 @@ */ __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_eval_transfer_with_light(__pyx_v_dt, __pyx_v_dvs, __pyx_v_grad, __pyx_v_vri->light_dir, __pyx_v_vri->light_rgba, __pyx_v_im->rgba, __pyx_v_vri->n_fits, __pyx_v_vri->fits, __pyx_v_vri->field_table_ids, __pyx_v_vri->grey_opacity); - /* "yt/utilities/lib/image_samplers.pyx":474 + /* "yt/utilities/lib/image_samplers.pyx":464 * im.rgba, vri.n_fits, * vri.fits, vri.field_table_ids, vri.grey_opacity) * for j in range(3): # <<<<<<<<<<<<<< @@ -8997,7 +9673,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_j = __pyx_t_2; - /* "yt/utilities/lib/image_samplers.pyx":475 + /* "yt/utilities/lib/image_samplers.pyx":465 * vri.fits, vri.field_table_ids, vri.grey_opacity) * for j in range(3): * dp[j] += ds[j] # <<<<<<<<<<<<<< @@ -9009,7 +9685,7 @@ } } - /* "yt/utilities/lib/image_samplers.pyx":476 + /* "yt/utilities/lib/image_samplers.pyx":466 * for j in range(3): * dp[j] += ds[j] * free(grad) # <<<<<<<<<<<<<< @@ -9018,7 +9694,7 @@ */ free(__pyx_v_grad); - /* "yt/utilities/lib/image_samplers.pyx":440 + /* "yt/utilities/lib/image_samplers.pyx":430 * @cython.cdivision(True) * @staticmethod * cdef void sample( # <<<<<<<<<<<<<< @@ -9029,7 +9705,7 @@ /* function exit code */ } -/* "yt/utilities/lib/image_samplers.pyx":479 +/* "yt/utilities/lib/image_samplers.pyx":469 * * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -9055,7 +9731,7 @@ int __pyx_t_2; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "yt/utilities/lib/image_samplers.pyx":480 + /* "yt/utilities/lib/image_samplers.pyx":470 * * def __dealloc__(self): * for i in range(self.vra.n_fits): # <<<<<<<<<<<<<< @@ -9066,7 +9742,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/image_samplers.pyx":481 + /* "yt/utilities/lib/image_samplers.pyx":471 * def __dealloc__(self): * for i in range(self.vra.n_fits): * free(self.vra.fits[i].d0) # <<<<<<<<<<<<<< @@ -9075,7 +9751,7 @@ */ free((__pyx_v_self->vra->fits[__pyx_v_i]).d0); - /* "yt/utilities/lib/image_samplers.pyx":482 + /* "yt/utilities/lib/image_samplers.pyx":472 * for i in range(self.vra.n_fits): * free(self.vra.fits[i].d0) * free(self.vra.fits[i].dy) # <<<<<<<<<<<<<< @@ -9085,7 +9761,7 @@ free((__pyx_v_self->vra->fits[__pyx_v_i]).dy); } - /* "yt/utilities/lib/image_samplers.pyx":483 + /* "yt/utilities/lib/image_samplers.pyx":473 * free(self.vra.fits[i].d0) * free(self.vra.fits[i].dy) * free(self.vra.light_dir) # <<<<<<<<<<<<<< @@ -9094,7 +9770,7 @@ */ free(__pyx_v_self->vra->light_dir); - /* "yt/utilities/lib/image_samplers.pyx":484 + /* "yt/utilities/lib/image_samplers.pyx":474 * free(self.vra.fits[i].dy) * free(self.vra.light_dir) * free(self.vra.light_rgba) # <<<<<<<<<<<<<< @@ -9103,7 +9779,7 @@ */ free(__pyx_v_self->vra->light_rgba); - /* "yt/utilities/lib/image_samplers.pyx":485 + /* "yt/utilities/lib/image_samplers.pyx":475 * free(self.vra.light_dir) * free(self.vra.light_rgba) * free(self.vra.fits) # <<<<<<<<<<<<<< @@ -9111,14 +9787,14 @@ */ free(__pyx_v_self->vra->fits); - /* "yt/utilities/lib/image_samplers.pyx":486 + /* "yt/utilities/lib/image_samplers.pyx":476 * free(self.vra.light_rgba) * free(self.vra.fits) * free(self.vra) # <<<<<<<<<<<<<< */ free(__pyx_v_self->vra); - /* "yt/utilities/lib/image_samplers.pyx":479 + /* "yt/utilities/lib/image_samplers.pyx":469 * * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -9130,7 +9806,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/image_samplers.pxd":77 +/* "yt/utilities/lib/image_samplers.pxd":91 * cdef class LightSourceRenderSampler(ImageSampler): * cdef VolumeRenderAccumulator *vra * cdef public object tf_obj # <<<<<<<<<<<<<< @@ -9224,7 +9900,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_samplers.pxd":78 +/* "yt/utilities/lib/image_samplers.pxd":92 * cdef VolumeRenderAccumulator *vra * cdef public object tf_obj * cdef public object my_field_tables # <<<<<<<<<<<<<< @@ -9317,21 +9993,224 @@ 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_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_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_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_4__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__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__17, 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("yt.utilities.lib.image_samplers.LightSourceRenderSampler.__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_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_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_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_6__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__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__18, 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("yt.utilities.lib.image_samplers.LightSourceRenderSampler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + */ + +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("vc_index", 0); + + /* "volume_container.pxd":31 + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): + * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< + * + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): + */ + __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); + goto __pyx_L0; + + /* "volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i + */ + +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { + int __pyx_v_index[3]; + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("vc_pos_index", 0); + + /* "volume_container.pxd":36 + * cdef int index[3] + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "volume_container.pxd":37 + * cdef int i + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< + * return vc_index(vc, index[0], index[1], index[2]) + * + */ + (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); + } + + /* "volume_container.pxd":38 + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< + * + */ + __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); + goto __pyx_L0; + + /* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":20 * - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -9343,7 +10222,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -9355,7 +10234,7 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ @@ -9395,7 +10274,7 @@ * if f0 > f1: return f0 * return f1 # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ __pyx_r = __pyx_v_f1; goto __pyx_L0; @@ -9416,18 +10295,18 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":28 * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -9439,7 +10318,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -9451,7 +10330,7 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ @@ -9539,7 +10418,7 @@ * if f0 < 0.0: return -f0 * return f0 # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_f0; goto __pyx_L0; @@ -9560,18 +10439,18 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":40 * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -9583,7 +10462,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -9600,7 +10479,7 @@ * if i > b: return b * return i # <<<<<<<<<<<<<< * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_i; goto __pyx_L0; @@ -9608,7 +10487,7 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -9621,18 +10500,18 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -9644,7 +10523,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -9669,7 +10548,7 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -9808,3760 +10687,3664 @@ return __pyx_r; } -/* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] - */ - -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; - - /* "vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< - * - * +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); - goto __pyx_L0; - /* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] - */ +/* 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_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double *__pyx_v_a, double *__pyx_v_b) { - double __pyx_r; +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * + * if info == NULL: return # <<<<<<<<<<<<<< * + * cdef int copy_shape, i, ndim */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); - goto __pyx_L0; + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * */ + __pyx_v_endian_detector = 1; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, 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); -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - - /* "vec3_ops.pxd":20 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "vec3_ops.pxd":21 - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "vec3_ops.pxd":22 - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ - (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + __pyx_v_copy_shape = 1; - /* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; + } - /* function exit code */ -} - -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "vec3_ops.pxd":20 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; - /* "vec3_ops.pxd":21 - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } - /* "vec3_ops.pxd":22 - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") * */ - (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ + if (__pyx_t_1) { - /* function exit code */ -} - -/* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 218, __pyx_L1_error) -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - - /* "vec3_ops.pxd":31 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); + } - /* "vec3_ops.pxd":32 - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< - * c[2] = a[2] - b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } - /* "vec3_ops.pxd":33 - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") * */ - (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; - /* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + if (__pyx_t_1) { - /* function exit code */ -} - -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "vec3_ops.pxd":31 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) */ - (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 222, __pyx_L1_error) - /* "vec3_ops.pxd":32 - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< - * c[2] = a[2] - b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); + } - /* "vec3_ops.pxd":33 - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ - (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ + __pyx_v_info->ndim = __pyx_v_ndim; - /* function exit code */ -} - -/* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; - - /* "vec3_ops.pxd":41 - * cdef inline cython.floating distance(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - __pyx_r = sqrt(((powf(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + powf(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + powf(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); - goto __pyx_L0; + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(double *__pyx_v_a, double *__pyx_v_b) { - double __pyx_r; - - /* "vec3_ops.pxd":41 - * cdef inline cython.floating distance(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ - __pyx_r = sqrt(((pow(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + pow(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + pow(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); - goto __pyx_L0; + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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]); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } -/* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ + goto __pyx_L11; + } -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(float const __pyx_v_f, float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * 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)); - /* "vec3_ops.pxd":51 - * const cython.floating[3] b, - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) */ - (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L11:; - /* "vec3_ops.pxd":52 - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< - * c[2] = f * a[2] + b[2] - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); + __pyx_v_info->suboffsets = NULL; - /* "vec3_ops.pxd":53 - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * */ - (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * 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)); - /* function exit code */ -} - -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const __pyx_v_f, double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "vec3_ops.pxd":51 - * const cython.floating[3] b, - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ - (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); + __pyx_v_f = NULL; - /* "vec3_ops.pxd":52 - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< - * c[2] = f * a[2] + b[2] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * */ - (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); + __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; - /* "vec3_ops.pxd":53 - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< * + * if not hasfields and not copy_shape: */ - (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); - - /* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, - */ - - /* function exit code */ -} + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); -/* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(float *__pyx_v_a) { - float __pyx_r; - - /* "vec3_ops.pxd":60 - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer */ - __pyx_r = sqrt(((((__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; + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + goto __pyx_L14; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *__pyx_v_a) { - double __pyx_r; - - /* "vec3_ops.pxd":60 - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: */ - __pyx_r = sqrt(((((__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; + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L14:; - /* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "field_interpolation_tables.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void FIT_initialize_table(FieldInterpolationTable *fit, int nbins, # <<<<<<<<<<<<<< - * np.float64_t *values, np.float64_t bounds1, np.float64_t bounds2, - * int field_id, int weight_field_id, int weight_table_id) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_initialize_table(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fit, int __pyx_v_nbins, __pyx_t_5numpy_float64_t *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_bounds1, __pyx_t_5numpy_float64_t __pyx_v_bounds2, int __pyx_v_field_id, int __pyx_v_weight_field_id, int __pyx_v_weight_table_id) { - int __pyx_v_i; - long __pyx_t_1; - int __pyx_t_2; - - /* "field_interpolation_tables.pxd":43 - * int field_id, int weight_field_id, int weight_table_id) nogil: - * cdef int i - * fit.bounds[0] = bounds1; fit.bounds[1] = bounds2 # <<<<<<<<<<<<<< - * fit.nbins = nbins - * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - (__pyx_v_fit->bounds[0]) = __pyx_v_bounds1; - (__pyx_v_fit->bounds[1]) = __pyx_v_bounds2; + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; - /* "field_interpolation_tables.pxd":44 - * cdef int i - * fit.bounds[0] = bounds1; fit.bounds[1] = bounds2 - * fit.nbins = nbins # <<<<<<<<<<<<<< - * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) - * fit.idbin = 1.0/fit.dbin + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ - __pyx_v_fit->nbins = __pyx_v_nbins; + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* "field_interpolation_tables.pxd":45 - * fit.bounds[0] = bounds1; fit.bounds[1] = bounds2 - * fit.nbins = nbins - * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) # <<<<<<<<<<<<<< - * fit.idbin = 1.0/fit.dbin - * # Better not pull this out from under us, yo + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_fit->dbin = (((__pyx_v_fit->bounds[1]) - (__pyx_v_fit->bounds[0])) / (__pyx_v_fit->nbins - 1)); + if (__pyx_t_1) { - /* "field_interpolation_tables.pxd":46 - * fit.nbins = nbins - * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) - * fit.idbin = 1.0/fit.dbin # <<<<<<<<<<<<<< - * # Better not pull this out from under us, yo - * fit.values = values + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - __pyx_v_fit->idbin = (1.0 / __pyx_v_fit->dbin); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 259, __pyx_L1_error) - /* "field_interpolation_tables.pxd":48 - * fit.idbin = 1.0/fit.dbin - * # Better not pull this out from under us, yo - * fit.values = values # <<<<<<<<<<<<<< - * fit.d0 = malloc(sizeof(np.float64_t) * nbins) - * fit.dy = malloc(sizeof(np.float64_t) * nbins) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_fit->values = __pyx_v_values; + } - /* "field_interpolation_tables.pxd":49 - * # Better not pull this out from under us, yo - * fit.values = values - * fit.d0 = malloc(sizeof(np.float64_t) * nbins) # <<<<<<<<<<<<<< - * fit.dy = malloc(sizeof(np.float64_t) * nbins) - * for i in range(nbins-1): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - __pyx_v_fit->d0 = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_nbins))); + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "field_interpolation_tables.pxd":50 - * fit.values = values - * fit.d0 = malloc(sizeof(np.float64_t) * nbins) - * fit.dy = malloc(sizeof(np.float64_t) * nbins) # <<<<<<<<<<<<<< - * for i in range(nbins-1): - * fit.d0[i] = fit.bounds[0] + i * fit.dbin + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - __pyx_v_fit->dy = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_nbins))); + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "field_interpolation_tables.pxd":51 - * fit.d0 = malloc(sizeof(np.float64_t) * nbins) - * fit.dy = malloc(sizeof(np.float64_t) * nbins) - * for i in range(nbins-1): # <<<<<<<<<<<<<< - * fit.d0[i] = fit.bounds[0] + i * fit.dbin - * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - __pyx_t_1 = (__pyx_v_nbins - 1); - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "field_interpolation_tables.pxd":52 - * fit.dy = malloc(sizeof(np.float64_t) * nbins) - * for i in range(nbins-1): - * fit.d0[i] = fit.bounds[0] + i * fit.dbin # <<<<<<<<<<<<<< - * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin - * fit.field_id = field_id + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - (__pyx_v_fit->d0[__pyx_v_i]) = ((__pyx_v_fit->bounds[0]) + (__pyx_v_i * __pyx_v_fit->dbin)); + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "field_interpolation_tables.pxd":53 - * for i in range(nbins-1): - * fit.d0[i] = fit.bounds[0] + i * fit.dbin - * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin # <<<<<<<<<<<<<< - * fit.field_id = field_id - * fit.weight_field_id = weight_field_id + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ - (__pyx_v_fit->dy[__pyx_v_i]) = (((__pyx_v_fit->values[(__pyx_v_i + 1)]) - (__pyx_v_fit->values[__pyx_v_i])) * __pyx_v_fit->idbin); - } + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "field_interpolation_tables.pxd":54 - * fit.d0[i] = fit.bounds[0] + i * fit.dbin - * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin - * fit.field_id = field_id # <<<<<<<<<<<<<< - * fit.weight_field_id = weight_field_id - * fit.weight_table_id = weight_table_id + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ - __pyx_v_fit->field_id = __pyx_v_field_id; + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* "field_interpolation_tables.pxd":55 - * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin - * fit.field_id = field_id - * fit.weight_field_id = weight_field_id # <<<<<<<<<<<<<< - * fit.weight_table_id = weight_table_id - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ - __pyx_v_fit->weight_field_id = __pyx_v_weight_field_id; + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; - /* "field_interpolation_tables.pxd":56 - * fit.field_id = field_id - * fit.weight_field_id = weight_field_id - * fit.weight_table_id = weight_table_id # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - __pyx_v_fit->weight_table_id = __pyx_v_weight_table_id; + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "field_interpolation_tables.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void FIT_initialize_table(FieldInterpolationTable *fit, int nbins, # <<<<<<<<<<<<<< - * np.float64_t *values, np.float64_t bounds1, np.float64_t bounds2, - * int field_id, int weight_field_id, int weight_table_id) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* function exit code */ -} - -/* "field_interpolation_tables.pxd":61 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline np.float64_t FIT_get_value(FieldInterpolationTable *fit, # <<<<<<<<<<<<<< - * np.float64_t dvs[6]) nogil: - * cdef np.float64_t dd, dout + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fit, __pyx_t_5numpy_float64_t *__pyx_v_dvs) { - __pyx_t_5numpy_float64_t __pyx_v_dd; - __pyx_t_5numpy_float64_t __pyx_v_dout; - int __pyx_v_bin_id; - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - - /* "field_interpolation_tables.pxd":65 - * cdef np.float64_t dd, dout - * cdef int bin_id - * if dvs[fit.field_id] >= fit.bounds[1] or dvs[fit.field_id] <= fit.bounds[0]: return 0.0 # <<<<<<<<<<<<<< - * if not isnormal(dvs[fit.field_id]): return 0.0 - * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ - __pyx_t_2 = (((__pyx_v_dvs[__pyx_v_fit->field_id]) >= (__pyx_v_fit->bounds[1])) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (((__pyx_v_dvs[__pyx_v_fit->field_id]) <= (__pyx_v_fit->bounds[0])) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; - if (__pyx_t_1) { - __pyx_r = 0.0; - goto __pyx_L0; - } + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* "field_interpolation_tables.pxd":66 - * cdef int bin_id - * if dvs[fit.field_id] >= fit.bounds[1] or dvs[fit.field_id] <= fit.bounds[0]: return 0.0 - * if not isnormal(dvs[fit.field_id]): return 0.0 # <<<<<<<<<<<<<< - * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) - * bin_id = iclip(bin_id, 0, fit.nbins-2) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ - __pyx_t_1 = ((!(isnormal((__pyx_v_dvs[__pyx_v_fit->field_id])) != 0)) != 0); - if (__pyx_t_1) { - __pyx_r = 0.0; - goto __pyx_L0; - } + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; - /* "field_interpolation_tables.pxd":67 - * if dvs[fit.field_id] >= fit.bounds[1] or dvs[fit.field_id] <= fit.bounds[0]: return 0.0 - * if not isnormal(dvs[fit.field_id]): return 0.0 - * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) # <<<<<<<<<<<<<< - * bin_id = iclip(bin_id, 0, fit.nbins-2) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_v_bin_id = ((int)(((__pyx_v_dvs[__pyx_v_fit->field_id]) - (__pyx_v_fit->bounds[0])) * __pyx_v_fit->idbin)); + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "field_interpolation_tables.pxd":68 - * if not isnormal(dvs[fit.field_id]): return 0.0 - * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) - * bin_id = iclip(bin_id, 0, fit.nbins-2) # <<<<<<<<<<<<<< - * - * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - __pyx_v_bin_id = __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_v_bin_id, 0, (__pyx_v_fit->nbins - 2)); + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "field_interpolation_tables.pxd":70 - * bin_id = iclip(bin_id, 0, fit.nbins-2) - * - * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 # <<<<<<<<<<<<<< - * dout = fit.values[bin_id] + dd * fit.dy[bin_id] - * if fit.weight_field_id != -1: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ - __pyx_v_dd = ((__pyx_v_dvs[__pyx_v_fit->field_id]) - (__pyx_v_fit->d0[__pyx_v_bin_id])); + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "field_interpolation_tables.pxd":71 - * - * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 - * dout = fit.values[bin_id] + dd * fit.dy[bin_id] # <<<<<<<<<<<<<< - * if fit.weight_field_id != -1: - * dout *= dvs[fit.weight_field_id] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - __pyx_v_dout = ((__pyx_v_fit->values[__pyx_v_bin_id]) + (__pyx_v_dd * (__pyx_v_fit->dy[__pyx_v_bin_id]))); + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "field_interpolation_tables.pxd":72 - * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 - * dout = fit.values[bin_id] + dd * fit.dy[bin_id] - * if fit.weight_field_id != -1: # <<<<<<<<<<<<<< - * dout *= dvs[fit.weight_field_id] - * return dout + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_1 = ((__pyx_v_fit->weight_field_id != -1L) != 0); - if (__pyx_t_1) { - - /* "field_interpolation_tables.pxd":73 - * dout = fit.values[bin_id] + dd * fit.dy[bin_id] - * if fit.weight_field_id != -1: - * dout *= dvs[fit.weight_field_id] # <<<<<<<<<<<<<< - * return dout - * - */ - __pyx_v_dout = (__pyx_v_dout * (__pyx_v_dvs[__pyx_v_fit->weight_field_id])); - - /* "field_interpolation_tables.pxd":72 - * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 - * dout = fit.values[bin_id] + dd * fit.dy[bin_id] - * if fit.weight_field_id != -1: # <<<<<<<<<<<<<< - * dout *= dvs[fit.weight_field_id] - * return dout - */ - } + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: - /* "field_interpolation_tables.pxd":74 - * if fit.weight_field_id != -1: - * dout *= dvs[fit.weight_field_id] - * return dout # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return */ - __pyx_r = __pyx_v_dout; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(2, 278, __pyx_L1_error) + break; + } - /* "field_interpolation_tables.pxd":61 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline np.float64_t FIT_get_value(FieldInterpolationTable *fit, # <<<<<<<<<<<<<< - * np.float64_t dvs[6]) nogil: - * cdef np.float64_t dd, dout + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: */ + __pyx_v_info->format = __pyx_v_f; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "field_interpolation_tables.pxd":79 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void FIT_eval_transfer(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< - * np.float64_t *rgba, int n_fits, - * FieldInterpolationTable fits[6], + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) */ + __pyx_r = 0; + goto __pyx_L0; -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_eval_transfer(__pyx_t_5numpy_float64_t __pyx_v_dt, __pyx_t_5numpy_float64_t *__pyx_v_dvs, __pyx_t_5numpy_float64_t *__pyx_v_rgba, int __pyx_v_n_fits, struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fits, int *__pyx_v_field_table_ids, int __pyx_v_grey_opacity) { - int __pyx_v_i; - int __pyx_v_fid; - __pyx_t_5numpy_float64_t __pyx_v_ta; - __pyx_t_5numpy_float64_t __pyx_v_istorage[6]; - __pyx_t_5numpy_float64_t __pyx_v_trgba[6]; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - - /* "field_interpolation_tables.pxd":87 - * cdef np.float64_t istorage[6] - * cdef np.float64_t trgba[6] - * for i in range(6): istorage[i] = 0.0 # <<<<<<<<<<<<<< - * for i in range(n_fits): - * istorage[i] = FIT_get_value(&fits[i], dvs) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - (__pyx_v_istorage[__pyx_v_i]) = 0.0; } - /* "field_interpolation_tables.pxd":88 - * cdef np.float64_t trgba[6] - * for i in range(6): istorage[i] = 0.0 - * for i in range(n_fits): # <<<<<<<<<<<<<< - * istorage[i] = FIT_get_value(&fits[i], dvs) - * for i in range(n_fits): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ - __pyx_t_1 = __pyx_v_n_fits; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "field_interpolation_tables.pxd":89 - * for i in range(6): istorage[i] = 0.0 - * for i in range(n_fits): - * istorage[i] = FIT_get_value(&fits[i], dvs) # <<<<<<<<<<<<<< - * for i in range(n_fits): - * fid = fits[i].weight_table_id + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, */ - (__pyx_v_istorage[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value((&(__pyx_v_fits[__pyx_v_i])), __pyx_v_dvs); - } + (__pyx_v_info->format[0]) = '^'; - /* "field_interpolation_tables.pxd":90 - * for i in range(n_fits): - * istorage[i] = FIT_get_value(&fits[i], dvs) - * for i in range(n_fits): # <<<<<<<<<<<<<< - * fid = fits[i].weight_table_id - * if fid != -1: istorage[i] *= istorage[fid] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ - __pyx_t_1 = __pyx_v_n_fits; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + __pyx_v_offset = 0; - /* "field_interpolation_tables.pxd":91 - * istorage[i] = FIT_get_value(&fits[i], dvs) - * for i in range(n_fits): - * fid = fits[i].weight_table_id # <<<<<<<<<<<<<< - * if fid != -1: istorage[i] *= istorage[fid] - * for i in range(6): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) */ - __pyx_t_3 = (__pyx_v_fits[__pyx_v_i]).weight_table_id; - __pyx_v_fid = __pyx_t_3; + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "field_interpolation_tables.pxd":92 - * for i in range(n_fits): - * fid = fits[i].weight_table_id - * if fid != -1: istorage[i] *= istorage[fid] # <<<<<<<<<<<<<< - * for i in range(6): - * trgba[i] = istorage[field_table_ids[i]] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - __pyx_t_4 = ((__pyx_v_fid != -1L) != 0); - if (__pyx_t_4) { - __pyx_t_3 = __pyx_v_i; - (__pyx_v_istorage[__pyx_t_3]) = ((__pyx_v_istorage[__pyx_t_3]) * (__pyx_v_istorage[__pyx_v_fid])); - } + (__pyx_v_f[0]) = '\x00'; } - /* "field_interpolation_tables.pxd":93 - * fid = fits[i].weight_table_id - * if fid != -1: istorage[i] *= istorage[fid] - * for i in range(6): # <<<<<<<<<<<<<< - * trgba[i] = istorage[field_table_ids[i]] - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - /* "field_interpolation_tables.pxd":94 - * if fid != -1: istorage[i] *= istorage[fid] - * for i in range(6): - * trgba[i] = istorage[field_table_ids[i]] # <<<<<<<<<<<<<< - * - * if grey_opacity == 1: - */ - (__pyx_v_trgba[__pyx_v_i]) = (__pyx_v_istorage[(__pyx_v_field_table_ids[__pyx_v_i])]); + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "field_interpolation_tables.pxd":96 - * trgba[i] = istorage[field_table_ids[i]] +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * if grey_opacity == 1: # <<<<<<<<<<<<<< - * ta = fmax(1.0 - dt*trgba[3],0.0) - * for i in range(4): + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_t_4 = ((__pyx_v_grey_opacity == 1) != 0); - if (__pyx_t_4) { - /* "field_interpolation_tables.pxd":97 - * - * if grey_opacity == 1: - * ta = fmax(1.0 - dt*trgba[3],0.0) # <<<<<<<<<<<<<< - * for i in range(4): - * rgba[i] = dt*trgba[i] + ta*rgba[i] - */ - __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (__pyx_v_trgba[3]))), 0.0); +/* 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)); - /* "field_interpolation_tables.pxd":98 - * if grey_opacity == 1: - * ta = fmax(1.0 - dt*trgba[3],0.0) - * for i in range(4): # <<<<<<<<<<<<<< - * rgba[i] = dt*trgba[i] + ta*rgba[i] - * else: + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - for (__pyx_t_1 = 0; __pyx_t_1 < 4; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { - /* "field_interpolation_tables.pxd":99 - * ta = fmax(1.0 - dt*trgba[3],0.0) - * for i in range(4): - * rgba[i] = dt*trgba[i] + ta*rgba[i] # <<<<<<<<<<<<<< - * else: - * for i in range(3): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) */ - (__pyx_v_rgba[__pyx_v_i]) = ((__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i])) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); - } + free(__pyx_v_info->format); - /* "field_interpolation_tables.pxd":96 - * trgba[i] = istorage[field_table_ids[i]] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * if grey_opacity == 1: # <<<<<<<<<<<<<< - * ta = fmax(1.0 - dt*trgba[3],0.0) - * for i in range(4): + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - goto __pyx_L12; } - /* "field_interpolation_tables.pxd":101 - * rgba[i] = dt*trgba[i] + ta*rgba[i] - * else: - * for i in range(3): # <<<<<<<<<<<<<< - * ta = fmax(1.0-dt*trgba[i], 0.0) - * rgba[i] = dt*trgba[i] + ta*rgba[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - /*else*/ { - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "field_interpolation_tables.pxd":102 - * else: - * for i in range(3): - * ta = fmax(1.0-dt*trgba[i], 0.0) # <<<<<<<<<<<<<< - * rgba[i] = dt*trgba[i] + ta*rgba[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block * */ - __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i]))), 0.0); + free(__pyx_v_info->strides); - /* "field_interpolation_tables.pxd":103 - * for i in range(3): - * ta = fmax(1.0-dt*trgba[i], 0.0) - * rgba[i] = dt*trgba[i] + ta*rgba[i] # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - (__pyx_v_rgba[__pyx_v_i]) = ((__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i])) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); - } } - __pyx_L12:; - /* "field_interpolation_tables.pxd":79 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void FIT_eval_transfer(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< - * np.float64_t *rgba, int n_fits, - * FieldInterpolationTable fits[6], + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ /* function exit code */ + __Pyx_RefNannyFinishContext(); } -/* "field_interpolation_tables.pxd":108 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void FIT_eval_transfer_with_light(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< - * np.float64_t *grad, np.float64_t *l_dir, np.float64_t *l_rgba, - * np.float64_t *rgba, int n_fits, +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ -static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_eval_transfer_with_light(__pyx_t_5numpy_float64_t __pyx_v_dt, __pyx_t_5numpy_float64_t *__pyx_v_dvs, __pyx_t_5numpy_float64_t *__pyx_v_grad, __pyx_t_5numpy_float64_t *__pyx_v_l_dir, __pyx_t_5numpy_float64_t *__pyx_v_l_rgba, __pyx_t_5numpy_float64_t *__pyx_v_rgba, int __pyx_v_n_fits, struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fits, int *__pyx_v_field_table_ids, int __pyx_v_grey_opacity) { - int __pyx_v_i; - int __pyx_v_fid; - __pyx_t_5numpy_float64_t __pyx_v_ta; - __pyx_t_5numpy_float64_t __pyx_v_dot_prod; - __pyx_t_5numpy_float64_t __pyx_v_istorage[6]; - __pyx_t_5numpy_float64_t __pyx_v_trgba[6]; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; +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); - /* "field_interpolation_tables.pxd":117 - * cdef np.float64_t istorage[6] - * cdef np.float64_t trgba[6] - * dot_prod = 0.0 # <<<<<<<<<<<<<< - * for i in range(3): - * dot_prod += l_dir[i]*grad[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - __pyx_v_dot_prod = 0.0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "field_interpolation_tables.pxd":118 - * cdef np.float64_t trgba[6] - * dot_prod = 0.0 - * for i in range(3): # <<<<<<<<<<<<<< - * dot_prod += l_dir[i]*grad[i] - * #dot_prod = fmax(0.0, dot_prod) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - /* "field_interpolation_tables.pxd":119 - * dot_prod = 0.0 - * for i in range(3): - * dot_prod += l_dir[i]*grad[i] # <<<<<<<<<<<<<< - * #dot_prod = fmax(0.0, dot_prod) - * for i in range(6): istorage[i] = 0.0 - */ - __pyx_v_dot_prod = (__pyx_v_dot_prod + ((__pyx_v_l_dir[__pyx_v_i]) * (__pyx_v_grad[__pyx_v_i]))); - } + /* 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; +} - /* "field_interpolation_tables.pxd":121 - * dot_prod += l_dir[i]*grad[i] - * #dot_prod = fmax(0.0, dot_prod) - * for i in range(6): istorage[i] = 0.0 # <<<<<<<<<<<<<< - * for i in range(n_fits): - * istorage[i] = FIT_get_value(&fits[i], dvs) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - (__pyx_v_istorage[__pyx_v_i]) = 0.0; - } - /* "field_interpolation_tables.pxd":122 - * #dot_prod = fmax(0.0, dot_prod) - * for i in range(6): istorage[i] = 0.0 - * for i in range(n_fits): # <<<<<<<<<<<<<< - * istorage[i] = FIT_get_value(&fits[i], dvs) - * for i in range(n_fits): - */ - __pyx_t_1 = __pyx_v_n_fits; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; +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); - /* "field_interpolation_tables.pxd":123 - * for i in range(6): istorage[i] = 0.0 - * for i in range(n_fits): - * istorage[i] = FIT_get_value(&fits[i], dvs) # <<<<<<<<<<<<<< - * for i in range(n_fits): - * fid = fits[i].weight_table_id + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): */ - (__pyx_v_istorage[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value((&(__pyx_v_fits[__pyx_v_i])), __pyx_v_dvs); - } + __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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "field_interpolation_tables.pxd":124 - * for i in range(n_fits): - * istorage[i] = FIT_get_value(&fits[i], dvs) - * for i in range(n_fits): # <<<<<<<<<<<<<< - * fid = fits[i].weight_table_id - * if fid != -1: istorage[i] *= istorage[fid] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - __pyx_t_1 = __pyx_v_n_fits; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; - /* "field_interpolation_tables.pxd":125 - * istorage[i] = FIT_get_value(&fits[i], dvs) - * for i in range(n_fits): - * fid = fits[i].weight_table_id # <<<<<<<<<<<<<< - * if fid != -1: istorage[i] *= istorage[fid] - * for i in range(6): - */ - __pyx_t_3 = (__pyx_v_fits[__pyx_v_i]).weight_table_id; - __pyx_v_fid = __pyx_t_3; - - /* "field_interpolation_tables.pxd":126 - * for i in range(n_fits): - * fid = fits[i].weight_table_id - * if fid != -1: istorage[i] *= istorage[fid] # <<<<<<<<<<<<<< - * for i in range(6): - * trgba[i] = istorage[field_table_ids[i]] - */ - __pyx_t_4 = ((__pyx_v_fid != -1L) != 0); - if (__pyx_t_4) { - __pyx_t_3 = __pyx_v_i; - (__pyx_v_istorage[__pyx_t_3]) = ((__pyx_v_istorage[__pyx_t_3]) * (__pyx_v_istorage[__pyx_v_fid])); - } - } - - /* "field_interpolation_tables.pxd":127 - * fid = fits[i].weight_table_id - * if fid != -1: istorage[i] *= istorage[fid] - * for i in range(6): # <<<<<<<<<<<<<< - * trgba[i] = istorage[field_table_ids[i]] - * if grey_opacity == 1: - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + /* 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; +} - /* "field_interpolation_tables.pxd":128 - * if fid != -1: istorage[i] *= istorage[fid] - * for i in range(6): - * trgba[i] = istorage[field_table_ids[i]] # <<<<<<<<<<<<<< - * if grey_opacity == 1: - * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - (__pyx_v_trgba[__pyx_v_i]) = (__pyx_v_istorage[(__pyx_v_field_table_ids[__pyx_v_i])]); - } - /* "field_interpolation_tables.pxd":129 - * for i in range(6): - * trgba[i] = istorage[field_table_ids[i]] - * if grey_opacity == 1: # <<<<<<<<<<<<<< - * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) - * for i in range(3): - */ - __pyx_t_4 = ((__pyx_v_grey_opacity == 1) != 0); - if (__pyx_t_4) { +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); - /* "field_interpolation_tables.pxd":130 - * trgba[i] = istorage[field_table_ids[i]] - * if grey_opacity == 1: - * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) # <<<<<<<<<<<<<< - * for i in range(3): - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + * + * 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_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (((__pyx_v_trgba[0]) + (__pyx_v_trgba[1])) + (__pyx_v_trgba[2])))), 0.0); + __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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "field_interpolation_tables.pxd":131 - * if grey_opacity == 1: - * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) - * for i in range(3): # <<<<<<<<<<<<<< - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - /* "field_interpolation_tables.pxd":132 - * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) - * for i in range(3): - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] # <<<<<<<<<<<<<< - * else: - * for i in range(3): - */ - (__pyx_v_rgba[__pyx_v_i]) = ((((1. - __pyx_v_ta) * (__pyx_v_trgba[__pyx_v_i])) * (1. + (__pyx_v_dot_prod * (__pyx_v_l_rgba[__pyx_v_i])))) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); - } + /* 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; +} - /* "field_interpolation_tables.pxd":129 - * for i in range(6): - * trgba[i] = istorage[field_table_ids[i]] - * if grey_opacity == 1: # <<<<<<<<<<<<<< - * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) - * for i in range(3): +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - goto __pyx_L14; - } - /* "field_interpolation_tables.pxd":134 - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] - * else: - * for i in range(3): # <<<<<<<<<<<<<< - * ta = fmax(1.0-dt*trgba[i], 0.0) - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] - */ - /*else*/ { - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; +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); - /* "field_interpolation_tables.pxd":135 - * else: - * for i in range(3): - * ta = fmax(1.0-dt*trgba[i], 0.0) # <<<<<<<<<<<<<< - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 * - */ - __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i]))), 0.0); - - /* "field_interpolation_tables.pxd":136 - * for i in range(3): - * ta = fmax(1.0-dt*trgba[i], 0.0) - * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] # <<<<<<<<<<<<<< + * 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_v_rgba[__pyx_v_i]) = ((((1. - __pyx_v_ta) * (__pyx_v_trgba[__pyx_v_i])) * (1. + (__pyx_v_dot_prod * (__pyx_v_l_rgba[__pyx_v_i])))) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); - } - } - __pyx_L14:; + __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, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "field_interpolation_tables.pxd":108 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void FIT_eval_transfer_with_light(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< - * np.float64_t *grad, np.float64_t *l_dir, np.float64_t *l_rgba, - * np.float64_t *rgba, int n_fits, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * 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; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) + * */ -/* 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; +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 - __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)); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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; } -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; int __pyx_v_endian_detector; int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; + 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 - int __pyx_t_1; - int __pyx_t_2; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; + PyObject *__pyx_t_4 = NULL; int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim - */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } + int __pyx_t_6; + int __pyx_t_7; + long __pyx_t_8; + char *__pyx_t_9; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields * - * ndim = PyArray_NDIM(self) */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(2, 794, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_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, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 */ - __pyx_v_copy_shape = 1; + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + * if (end - f) - (new_offset - offset[0]) < 15: */ - goto __pyx_L4; - } + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 796, __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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") * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * - * 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 (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_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 799, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - * 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 (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * 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 ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - if (__pyx_t_1) { + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * 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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + __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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * 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 ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - } + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 803, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * - * 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") + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ - if (__pyx_t_1) { + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 * - * 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_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: + * offset[0] += child.itemsize */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): */ - __pyx_v_info->ndim = __pyx_v_ndim; + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(2, 823, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * 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: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" */ - goto __pyx_L11; - } + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * 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_L11:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * 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; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset - */ - __pyx_v_f = NULL; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * 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; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" */ - goto __pyx_L14; - } + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __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, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" + /*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, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 844, __pyx_L1_error) + } + __pyx_L15:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; + goto __pyx_L13; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; + __pyx_r = __pyx_v_f; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; + __pyx_v_baseptr = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: + /*else*/ { + Py_INCREF(__pyx_v_base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * */ - __pyx_v_info->format = __pyx_v_f; + Py_XDECREF(__pyx_v_arr->base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): */ - __pyx_r = 0; - goto __pyx_L0; + __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: */ - (__pyx_v_info->format[0]) = '^'; + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base */ - __pyx_v_offset = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + * * - * def __releasebuffer__(ndarray self, Py_buffer* info): */ - (__pyx_v_f[0]) = '\x00'; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ -/* 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) { +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - free(__pyx_v_info->format); + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * 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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + __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, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * + * cdef inline int import_ufunc() except -1: */ - free(__pyx_v_info->strides); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { - PyObject *__pyx_r = NULL; +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * cdef inline object PyArray_MultiIterNew2(a, b): + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * cdef inline object PyArray_MultiIterNew3(a, b, c): + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * +/* "vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] */ -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); +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) { + float __pyx_r; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "vec3_ops.pxd":11 + * cdef inline cython.floating dot(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< * - * 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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * + /* "vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * 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); +static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double *__pyx_v_a, double *__pyx_v_b) { + double __pyx_r; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "vec3_ops.pxd":11 + * cdef inline cython.floating dot(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< * - * 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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * + /* "vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) - * +/* "vec3_ops.pxd":17 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ -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); +static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + /* "vec3_ops.pxd":20 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] */ - __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, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) + /* "vec3_ops.pxd":21 + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< + * c[2] = a[0]*b[1] - a[1]*b[0] * */ + (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "vec3_ops.pxd":22 + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< + * * - * 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. */ + (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields + /* "vec3_ops.pxd":17 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ - __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * + /* function exit code */ +} + +static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { + + /* "vec3_ops.pxd":20 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields + /* "vec3_ops.pxd":21 + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< + * c[2] = a[0]*b[1] - a[1]*b[0] * - * 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, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; + (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "vec3_ops.pxd":22 + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< * - * 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, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; + (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: + /* "vec3_ops.pxd":17 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { + /* function exit code */ +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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 +/* "vec3_ops.pxd":28 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * +static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { + + /* "vec3_ops.pxd":31 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] */ - } + (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + /* "vec3_ops.pxd":32 + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< + * c[2] = a[2] - b[2] * - * 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:; + (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "vec3_ops.pxd":33 + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< + * * - * 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:; + (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "vec3_ops.pxd":28 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ - if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply + /* function exit code */ +} + +static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { + + /* "vec3_ops.pxd":31 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + /* "vec3_ops.pxd":32 + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< + * c[2] = a[2] - b[2] * - * 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_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "vec3_ops.pxd":33 + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< + * * - * # 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, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; + (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + + /* "vec3_ops.pxd":28 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + */ + + /* function exit code */ +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 +/* "vec3_ops.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) */ - (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(float *__pyx_v_a, float *__pyx_v_b) { + float __pyx_r; + + /* "vec3_ops.pxd":41 + * cdef inline cython.floating distance(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< + * * */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_r = sqrt(((powf(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + powf(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + powf(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize + /* "vec3_ops.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(double *__pyx_v_a, double *__pyx_v_b) { + double __pyx_r; + + /* "vec3_ops.pxd":41 + * cdef inline cython.floating distance(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< * - * 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); + __pyx_r = sqrt(((pow(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + pow(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + pow(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + /* "vec3_ops.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "vec3_ops.pxd":47 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< + * const cython.floating[3] a, + * const cython.floating[3] b, */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * +static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(float const __pyx_v_f, float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { + + /* "vec3_ops.pxd":51 + * const cython.floating[3] b, + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { + (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + /* "vec3_ops.pxd":52 + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< + * c[2] = f * a[2] + b[2] * - * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* "vec3_ops.pxd":53 + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< + * * */ - } + (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" + /* "vec3_ops.pxd":47 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< + * const cython.floating[3] a, + * const cython.floating[3] b, */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" + /* function exit code */ +} + +static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const __pyx_v_f, double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { + + /* "vec3_ops.pxd":51 + * const cython.floating[3] b, + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } + (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" + /* "vec3_ops.pxd":52 + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< + * c[2] = f * a[2] + b[2] + * */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } + (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" + /* "vec3_ops.pxd":53 + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< + * + * */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } + (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" + /* "vec3_ops.pxd":47 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< + * const cython.floating[3] a, + * const cython.floating[3] b, */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" + /* function exit code */ +} + +/* "vec3_ops.pxd":59 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(float *__pyx_v_a) { + float __pyx_r; + + /* "vec3_ops.pxd":60 + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } + __pyx_r = sqrt(((((__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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + /* "vec3_ops.pxd":59 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *__pyx_v_a) { + double __pyx_r; + + /* "vec3_ops.pxd":60 + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } + __pyx_r = sqrt(((((__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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" + /* "vec3_ops.pxd":59 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "field_interpolation_tables.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void FIT_initialize_table(FieldInterpolationTable *fit, int nbins, # <<<<<<<<<<<<<< + * np.float64_t *values, np.float64_t bounds1, np.float64_t bounds2, + * int field_id, int weight_field_id, int weight_table_id) nogil: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf +static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_initialize_table(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fit, int __pyx_v_nbins, __pyx_t_5numpy_float64_t *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_bounds1, __pyx_t_5numpy_float64_t __pyx_v_bounds2, int __pyx_v_field_id, int __pyx_v_weight_field_id, int __pyx_v_weight_table_id) { + int __pyx_v_i; + long __pyx_t_1; + int __pyx_t_2; + + /* "field_interpolation_tables.pxd":43 + * int field_id, int weight_field_id, int weight_table_id) nogil: + * cdef int i + * fit.bounds[0] = bounds1; fit.bounds[1] = bounds2 # <<<<<<<<<<<<<< + * fit.nbins = nbins + * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } + (__pyx_v_fit->bounds[0]) = __pyx_v_bounds1; + (__pyx_v_fit->bounds[1]) = __pyx_v_bounds2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + /* "field_interpolation_tables.pxd":44 + * cdef int i + * fit.bounds[0] = bounds1; fit.bounds[1] = bounds2 + * fit.nbins = nbins # <<<<<<<<<<<<<< + * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) + * fit.idbin = 1.0/fit.dbin */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } + __pyx_v_fit->nbins = __pyx_v_nbins; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + /* "field_interpolation_tables.pxd":45 + * fit.bounds[0] = bounds1; fit.bounds[1] = bounds2 + * fit.nbins = nbins + * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) # <<<<<<<<<<<<<< + * fit.idbin = 1.0/fit.dbin + * # Better not pull this out from under us, yo */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_v_fit->dbin = (((__pyx_v_fit->bounds[1]) - (__pyx_v_fit->bounds[0])) / (__pyx_v_fit->nbins - 1)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" + /* "field_interpolation_tables.pxd":46 + * fit.nbins = nbins + * fit.dbin = (fit.bounds[1] - fit.bounds[0])/(fit.nbins-1) + * fit.idbin = 1.0/fit.dbin # <<<<<<<<<<<<<< + * # Better not pull this out from under us, yo + * fit.values = values */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_v_fit->idbin = (1.0 / __pyx_v_fit->dbin); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: + /* "field_interpolation_tables.pxd":48 + * fit.idbin = 1.0/fit.dbin + * # Better not pull this out from under us, yo + * fit.values = values # <<<<<<<<<<<<<< + * fit.d0 = malloc(sizeof(np.float64_t) * nbins) + * fit.dy = malloc(sizeof(np.float64_t) * nbins) */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_v_fit->values = __pyx_v_values; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "field_interpolation_tables.pxd":49 + * # Better not pull this out from under us, yo + * fit.values = values + * fit.d0 = malloc(sizeof(np.float64_t) * nbins) # <<<<<<<<<<<<<< + * fit.dy = malloc(sizeof(np.float64_t) * nbins) + * for i in range(nbins-1): */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } + __pyx_v_fit->d0 = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_nbins))); + + /* "field_interpolation_tables.pxd":50 + * fit.values = values + * fit.d0 = malloc(sizeof(np.float64_t) * nbins) + * fit.dy = malloc(sizeof(np.float64_t) * nbins) # <<<<<<<<<<<<<< + * for i in range(nbins-1): + * fit.d0[i] = fit.bounds[0] + i * fit.dbin + */ + __pyx_v_fit->dy = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_nbins))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: + /* "field_interpolation_tables.pxd":51 + * fit.d0 = malloc(sizeof(np.float64_t) * nbins) + * fit.dy = malloc(sizeof(np.float64_t) * nbins) + * for i in range(nbins-1): # <<<<<<<<<<<<<< + * fit.d0[i] = fit.bounds[0] + i * fit.dbin + * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; + __pyx_t_1 = (__pyx_v_nbins - 1); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), + /* "field_interpolation_tables.pxd":52 + * fit.dy = malloc(sizeof(np.float64_t) * nbins) + * for i in range(nbins-1): + * fit.d0[i] = fit.bounds[0] + i * fit.dbin # <<<<<<<<<<<<<< + * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin + * fit.field_id = field_id */ - __pyx_v_f = (__pyx_v_f + 1); + (__pyx_v_fit->d0[__pyx_v_i]) = ((__pyx_v_fit->bounds[0]) + (__pyx_v_i * __pyx_v_fit->dbin)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + /* "field_interpolation_tables.pxd":53 + * for i in range(nbins-1): + * fit.d0[i] = fit.bounds[0] + i * fit.dbin + * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin # <<<<<<<<<<<<<< + * fit.field_id = field_id + * fit.weight_field_id = weight_field_id */ - goto __pyx_L13; - } + (__pyx_v_fit->dy[__pyx_v_i]) = (((__pyx_v_fit->values[(__pyx_v_i + 1)]) - (__pyx_v_fit->values[__pyx_v_i])) * __pyx_v_fit->idbin); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * + /* "field_interpolation_tables.pxd":54 + * fit.d0[i] = fit.bounds[0] + i * fit.dbin + * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin + * fit.field_id = field_id # <<<<<<<<<<<<<< + * fit.weight_field_id = weight_field_id + * fit.weight_table_id = weight_table_id */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; + __pyx_v_fit->field_id = __pyx_v_field_id; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields + /* "field_interpolation_tables.pxd":55 + * fit.dy[i] = (fit.values[i + 1] - fit.values[i]) * fit.idbin + * fit.field_id = field_id + * fit.weight_field_id = weight_field_id # <<<<<<<<<<<<<< + * fit.weight_table_id = weight_table_id * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_fit->weight_field_id = __pyx_v_weight_field_id; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * + /* "field_interpolation_tables.pxd":56 + * fit.field_id = field_id + * fit.weight_field_id = weight_field_id + * fit.weight_table_id = weight_table_id # <<<<<<<<<<<<<< * + * @cython.boundscheck(False) */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; + __pyx_v_fit->weight_table_id = __pyx_v_weight_table_id; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. + /* "field_interpolation_tables.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void FIT_initialize_table(FieldInterpolationTable *fit, int nbins, # <<<<<<<<<<<<<< + * np.float64_t *values, np.float64_t bounds1, np.float64_t bounds2, + * int field_id, int weight_field_id, int weight_table_id) nogil: */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: +/* "field_interpolation_tables.pxd":61 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline np.float64_t FIT_get_value(FieldInterpolationTable *fit, # <<<<<<<<<<<<<< + * np.float64_t dvs[6]) nogil: + * cdef np.float64_t dd, dout */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value(struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fit, __pyx_t_5numpy_float64_t *__pyx_v_dvs) { + __pyx_t_5numpy_float64_t __pyx_v_dd; + __pyx_t_5numpy_float64_t __pyx_v_dout; + int __pyx_v_bin_id; + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! - */ - __pyx_v_baseptr = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "field_interpolation_tables.pxd":65 + * cdef np.float64_t dd, dout + * cdef int bin_id + * if dvs[fit.field_id] >= fit.bounds[1] or dvs[fit.field_id] <= fit.bounds[0]: return 0.0 # <<<<<<<<<<<<<< + * if not isnormal(dvs[fit.field_id]): return 0.0 + * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) */ - goto __pyx_L3; + __pyx_t_2 = (((__pyx_v_dvs[__pyx_v_fit->field_id]) >= (__pyx_v_fit->bounds[1])) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * 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_t_2 = (((__pyx_v_dvs[__pyx_v_fit->field_id]) <= (__pyx_v_fit->bounds[0])) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + __pyx_r = 0.0; + goto __pyx_L0; } - __pyx_L3:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * 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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): + /* "field_interpolation_tables.pxd":66 + * cdef int bin_id + * if dvs[fit.field_id] >= fit.bounds[1] or dvs[fit.field_id] <= fit.bounds[0]: return 0.0 + * if not isnormal(dvs[fit.field_id]): return 0.0 # <<<<<<<<<<<<<< + * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) + * bin_id = iclip(bin_id, 0, fit.nbins-2) */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_t_1 = ((!(isnormal((__pyx_v_dvs[__pyx_v_fit->field_id])) != 0)) != 0); + if (__pyx_t_1) { + __pyx_r = 0.0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * + /* "field_interpolation_tables.pxd":67 + * if dvs[fit.field_id] >= fit.bounds[1] or dvs[fit.field_id] <= fit.bounds[0]: return 0.0 + * if not isnormal(dvs[fit.field_id]): return 0.0 + * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) # <<<<<<<<<<<<<< + * bin_id = iclip(bin_id, 0, fit.nbins-2) * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: */ + __pyx_v_bin_id = ((int)(((__pyx_v_dvs[__pyx_v_fit->field_id]) - (__pyx_v_fit->bounds[0])) * __pyx_v_fit->idbin)); - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "field_interpolation_tables.pxd":68 + * if not isnormal(dvs[fit.field_id]): return 0.0 + * bin_id = ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin) + * bin_id = iclip(bin_id, 0, fit.nbins-2) # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 */ + __pyx_v_bin_id = __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_v_bin_id, 0, (__pyx_v_fit->nbins - 2)); -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); + /* "field_interpolation_tables.pxd":70 + * bin_id = iclip(bin_id, 0, fit.nbins-2) + * + * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 # <<<<<<<<<<<<<< + * dout = fit.values[bin_id] + dd * fit.dy[bin_id] + * if fit.weight_field_id != -1: + */ + __pyx_v_dd = ((__pyx_v_dvs[__pyx_v_fit->field_id]) - (__pyx_v_fit->d0[__pyx_v_bin_id])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "field_interpolation_tables.pxd":71 * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: + * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 + * dout = fit.values[bin_id] + dd * fit.dy[bin_id] # <<<<<<<<<<<<<< + * if fit.weight_field_id != -1: + * dout *= dvs[fit.weight_field_id] */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { + __pyx_v_dout = ((__pyx_v_fit->values[__pyx_v_bin_id]) + (__pyx_v_dd * (__pyx_v_fit->dy[__pyx_v_bin_id]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base + /* "field_interpolation_tables.pxd":72 + * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 + * dout = fit.values[bin_id] + dd * fit.dy[bin_id] + * if fit.weight_field_id != -1: # <<<<<<<<<<<<<< + * dout *= dvs[fit.weight_field_id] + * return dout */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + __pyx_t_1 = ((__pyx_v_fit->weight_field_id != -1L) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "field_interpolation_tables.pxd":73 + * dout = fit.values[bin_id] + dd * fit.dy[bin_id] + * if fit.weight_field_id != -1: + * dout *= dvs[fit.weight_field_id] # <<<<<<<<<<<<<< + * return dout * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: */ - } + __pyx_v_dout = (__pyx_v_dout * (__pyx_v_dvs[__pyx_v_fit->weight_field_id])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - * - * + /* "field_interpolation_tables.pxd":72 + * dd = dvs[fit.field_id] - fit.d0[bin_id] # x - x0 + * dout = fit.values[bin_id] + dd * fit.dy[bin_id] + * if fit.weight_field_id != -1: # <<<<<<<<<<<<<< + * dout *= dvs[fit.weight_field_id] + * return dout */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "field_interpolation_tables.pxd":74 + * if fit.weight_field_id != -1: + * dout *= dvs[fit.weight_field_id] + * return dout # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * @cython.boundscheck(False) + */ + __pyx_r = __pyx_v_dout; + goto __pyx_L0; + + /* "field_interpolation_tables.pxd":61 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline np.float64_t FIT_get_value(FieldInterpolationTable *fit, # <<<<<<<<<<<<<< + * np.float64_t dvs[6]) nogil: + * cdef np.float64_t dd, dout */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() +/* "field_interpolation_tables.pxd":79 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void FIT_eval_transfer(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< + * np.float64_t *rgba, int n_fits, + * FieldInterpolationTable fits[6], */ -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; +static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_eval_transfer(__pyx_t_5numpy_float64_t __pyx_v_dt, __pyx_t_5numpy_float64_t *__pyx_v_dvs, __pyx_t_5numpy_float64_t *__pyx_v_rgba, int __pyx_v_n_fits, struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fits, int *__pyx_v_field_table_ids, int __pyx_v_grey_opacity) { + int __pyx_v_i; + int __pyx_v_fid; + __pyx_t_5numpy_float64_t __pyx_v_ta; + __pyx_t_5numpy_float64_t __pyx_v_istorage[6]; + __pyx_t_5numpy_float64_t __pyx_v_trgba[6]; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "field_interpolation_tables.pxd":87 + * cdef np.float64_t istorage[6] + * cdef np.float64_t trgba[6] + * for i in range(6): istorage[i] = 0.0 # <<<<<<<<<<<<<< + * for i in range(n_fits): + * istorage[i] = FIT_get_value(&fits[i], dvs) */ - { - __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:*/ { + for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + (__pyx_v_istorage[__pyx_v_i]) = 0.0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") + /* "field_interpolation_tables.pxd":88 + * cdef np.float64_t trgba[6] + * for i in range(6): istorage[i] = 0.0 + * for i in range(n_fits): # <<<<<<<<<<<<<< + * istorage[i] = FIT_get_value(&fits[i], dvs) + * for i in range(n_fits): */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_t_1 = __pyx_v_n_fits; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "field_interpolation_tables.pxd":89 + * for i in range(6): istorage[i] = 0.0 + * for i in range(n_fits): + * istorage[i] = FIT_get_value(&fits[i], dvs) # <<<<<<<<<<<<<< + * for i in range(n_fits): + * fid = fits[i].weight_table_id */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + (__pyx_v_istorage[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value((&(__pyx_v_fits[__pyx_v_i])), __pyx_v_dvs); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") - * + /* "field_interpolation_tables.pxd":90 + * for i in range(n_fits): + * istorage[i] = FIT_get_value(&fits[i], dvs) + * for i in range(n_fits): # <<<<<<<<<<<<<< + * fid = fits[i].weight_table_id + * if fid != -1: istorage[i] *= istorage[fid] */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __pyx_v_n_fits; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: + /* "field_interpolation_tables.pxd":91 + * istorage[i] = FIT_get_value(&fits[i], dvs) + * for i in range(n_fits): + * fid = fits[i].weight_table_id # <<<<<<<<<<<<<< + * if fid != -1: istorage[i] *= istorage[fid] + * for i in range(6): */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_3 = (__pyx_v_fits[__pyx_v_i]).weight_table_id; + __pyx_v_fid = __pyx_t_3; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "field_interpolation_tables.pxd":92 + * for i in range(n_fits): + * fid = fits[i].weight_table_id + * if fid != -1: istorage[i] *= istorage[fid] # <<<<<<<<<<<<<< + * for i in range(6): + * trgba[i] = istorage[field_table_ids[i]] */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_t_4 = ((__pyx_v_fid != -1L) != 0); + if (__pyx_t_4) { + __pyx_t_3 = __pyx_v_i; + (__pyx_v_istorage[__pyx_t_3]) = ((__pyx_v_istorage[__pyx_t_3]) * (__pyx_v_istorage[__pyx_v_fid])); + } } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "field_interpolation_tables.pxd":93 + * fid = fits[i].weight_table_id + * if fid != -1: istorage[i] *= istorage[fid] + * for i in range(6): # <<<<<<<<<<<<<< + * trgba[i] = istorage[field_table_ids[i]] + * */ + for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") + /* "field_interpolation_tables.pxd":94 + * if fid != -1: istorage[i] *= istorage[fid] + * for i in range(6): + * trgba[i] = istorage[field_table_ids[i]] # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * if grey_opacity == 1: */ + (__pyx_v_trgba[__pyx_v_i]) = (__pyx_v_istorage[(__pyx_v_field_table_ids[__pyx_v_i])]); + } -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); + /* "field_interpolation_tables.pxd":96 + * trgba[i] = istorage[field_table_ids[i]] + * + * if grey_opacity == 1: # <<<<<<<<<<<<<< + * ta = fmax(1.0 - dt*trgba[3],0.0) + * for i in range(4): + */ + __pyx_t_4 = ((__pyx_v_grey_opacity == 1) != 0); + if (__pyx_t_4) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "field_interpolation_tables.pxd":97 * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * if grey_opacity == 1: + * ta = fmax(1.0 - dt*trgba[3],0.0) # <<<<<<<<<<<<<< + * for i in range(4): + * rgba[i] = dt*trgba[i] + ta*rgba[i] */ - { - __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:*/ { + __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (__pyx_v_trgba[3]))), 0.0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "field_interpolation_tables.pxd":98 + * if grey_opacity == 1: + * ta = fmax(1.0 - dt*trgba[3],0.0) + * for i in range(4): # <<<<<<<<<<<<<< + * rgba[i] = dt*trgba[i] + ta*rgba[i] + * else: */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + for (__pyx_t_1 = 0; __pyx_t_1 < 4; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "field_interpolation_tables.pxd":99 + * ta = fmax(1.0 - dt*trgba[3],0.0) + * for i in range(4): + * rgba[i] = dt*trgba[i] + ta*rgba[i] # <<<<<<<<<<<<<< + * else: + * for i in range(3): */ + (__pyx_v_rgba[__pyx_v_i]) = ((__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i])) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "field_interpolation_tables.pxd":96 + * trgba[i] = istorage[field_table_ids[i]] * + * if grey_opacity == 1: # <<<<<<<<<<<<<< + * ta = fmax(1.0 - dt*trgba[3],0.0) + * for i in range(4): */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + goto __pyx_L12; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "field_interpolation_tables.pxd":101 + * rgba[i] = dt*trgba[i] + ta*rgba[i] + * else: + * for i in range(3): # <<<<<<<<<<<<<< + * ta = fmax(1.0-dt*trgba[i], 0.0) + * rgba[i] = dt*trgba[i] + ta*rgba[i] + */ + /*else*/ { + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "field_interpolation_tables.pxd":102 + * else: + * for i in range(3): + * ta = fmax(1.0-dt*trgba[i], 0.0) # <<<<<<<<<<<<<< + * rgba[i] = dt*trgba[i] + ta*rgba[i] * - * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i]))), 0.0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "field_interpolation_tables.pxd":103 + * for i in range(3): + * ta = fmax(1.0-dt*trgba[i], 0.0) + * rgba[i] = dt*trgba[i] + ta*rgba[i] # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * @cython.boundscheck(False) */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + (__pyx_v_rgba[__pyx_v_i]) = ((__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i])) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); + } } + __pyx_L12:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + /* "field_interpolation_tables.pxd":79 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void FIT_eval_transfer(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< + * np.float64_t *rgba, int n_fits, + * FieldInterpolationTable fits[6], */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() +/* "field_interpolation_tables.pxd":108 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void FIT_eval_transfer_with_light(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< + * np.float64_t *grad, np.float64_t *l_dir, np.float64_t *l_rgba, + * np.float64_t *rgba, int n_fits, */ -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; +static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_eval_transfer_with_light(__pyx_t_5numpy_float64_t __pyx_v_dt, __pyx_t_5numpy_float64_t *__pyx_v_dvs, __pyx_t_5numpy_float64_t *__pyx_v_grad, __pyx_t_5numpy_float64_t *__pyx_v_l_dir, __pyx_t_5numpy_float64_t *__pyx_v_l_rgba, __pyx_t_5numpy_float64_t *__pyx_v_rgba, int __pyx_v_n_fits, struct __pyx_t_2yt_9utilities_3lib_26field_interpolation_tables_FieldInterpolationTable *__pyx_v_fits, int *__pyx_v_field_table_ids, int __pyx_v_grey_opacity) { + int __pyx_v_i; + int __pyx_v_fid; + __pyx_t_5numpy_float64_t __pyx_v_ta; + __pyx_t_5numpy_float64_t __pyx_v_dot_prod; + __pyx_t_5numpy_float64_t __pyx_v_istorage[6]; + __pyx_t_5numpy_float64_t __pyx_v_trgba[6]; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { + /* "field_interpolation_tables.pxd":117 + * cdef np.float64_t istorage[6] + * cdef np.float64_t trgba[6] + * dot_prod = 0.0 # <<<<<<<<<<<<<< + * for i in range(3): + * dot_prod += l_dir[i]*grad[i] + */ + __pyx_v_dot_prod = 0.0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "field_interpolation_tables.pxd":118 + * cdef np.float64_t trgba[6] + * dot_prod = 0.0 + * for i in range(3): # <<<<<<<<<<<<<< + * dot_prod += l_dir[i]*grad[i] + * #dot_prod = fmax(0.0, dot_prod) */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "field_interpolation_tables.pxd":119 + * dot_prod = 0.0 + * for i in range(3): + * dot_prod += l_dir[i]*grad[i] # <<<<<<<<<<<<<< + * #dot_prod = fmax(0.0, dot_prod) + * for i in range(6): istorage[i] = 0.0 */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_v_dot_prod = (__pyx_v_dot_prod + ((__pyx_v_l_dir[__pyx_v_i]) * (__pyx_v_grad[__pyx_v_i]))); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "field_interpolation_tables.pxd":121 + * dot_prod += l_dir[i]*grad[i] + * #dot_prod = fmax(0.0, dot_prod) + * for i in range(6): istorage[i] = 0.0 # <<<<<<<<<<<<<< + * for i in range(n_fits): + * istorage[i] = FIT_get_value(&fits[i], dvs) */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + (__pyx_v_istorage[__pyx_v_i]) = 0.0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "field_interpolation_tables.pxd":122 + * #dot_prod = fmax(0.0, dot_prod) + * for i in range(6): istorage[i] = 0.0 + * for i in range(n_fits): # <<<<<<<<<<<<<< + * istorage[i] = FIT_get_value(&fits[i], dvs) + * for i in range(n_fits): */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = __pyx_v_n_fits; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "field_interpolation_tables.pxd":123 + * for i in range(6): istorage[i] = 0.0 + * for i in range(n_fits): + * istorage[i] = FIT_get_value(&fits[i], dvs) # <<<<<<<<<<<<<< + * for i in range(n_fits): + * fid = fits[i].weight_table_id */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + (__pyx_v_istorage[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_26field_interpolation_tables_FIT_get_value((&(__pyx_v_fits[__pyx_v_i])), __pyx_v_dvs); } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + /* "field_interpolation_tables.pxd":124 + * for i in range(n_fits): + * istorage[i] = FIT_get_value(&fits[i], dvs) + * for i in range(n_fits): # <<<<<<<<<<<<<< + * fid = fits[i].weight_table_id + * if fid != -1: istorage[i] *= istorage[fid] */ + __pyx_t_1 = __pyx_v_n_fits; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; - /* 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; -} + /* "field_interpolation_tables.pxd":125 + * istorage[i] = FIT_get_value(&fits[i], dvs) + * for i in range(n_fits): + * fid = fits[i].weight_table_id # <<<<<<<<<<<<<< + * if fid != -1: istorage[i] *= istorage[fid] + * for i in range(6): + */ + __pyx_t_3 = (__pyx_v_fits[__pyx_v_i]).weight_table_id; + __pyx_v_fid = __pyx_t_3; -/* "volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * + /* "field_interpolation_tables.pxd":126 + * for i in range(n_fits): + * fid = fits[i].weight_table_id + * if fid != -1: istorage[i] *= istorage[fid] # <<<<<<<<<<<<<< + * for i in range(6): + * trgba[i] = istorage[field_table_ids[i]] */ + __pyx_t_4 = ((__pyx_v_fid != -1L) != 0); + if (__pyx_t_4) { + __pyx_t_3 = __pyx_v_i; + (__pyx_v_istorage[__pyx_t_3]) = ((__pyx_v_istorage[__pyx_t_3]) * (__pyx_v_istorage[__pyx_v_fid])); + } + } -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("vc_index", 0); + /* "field_interpolation_tables.pxd":127 + * fid = fits[i].weight_table_id + * if fid != -1: istorage[i] *= istorage[fid] + * for i in range(6): # <<<<<<<<<<<<<< + * trgba[i] = istorage[field_table_ids[i]] + * if grey_opacity == 1: + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "volume_container.pxd":31 - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): - * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): + /* "field_interpolation_tables.pxd":128 + * if fid != -1: istorage[i] *= istorage[fid] + * for i in range(6): + * trgba[i] = istorage[field_table_ids[i]] # <<<<<<<<<<<<<< + * if grey_opacity == 1: + * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) */ - __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); - goto __pyx_L0; + (__pyx_v_trgba[__pyx_v_i]) = (__pyx_v_istorage[(__pyx_v_field_table_ids[__pyx_v_i])]); + } - /* "volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * + /* "field_interpolation_tables.pxd":129 + * for i in range(6): + * trgba[i] = istorage[field_table_ids[i]] + * if grey_opacity == 1: # <<<<<<<<<<<<<< + * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) + * for i in range(3): */ + __pyx_t_4 = ((__pyx_v_grey_opacity == 1) != 0); + if (__pyx_t_4) { - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "field_interpolation_tables.pxd":130 + * trgba[i] = istorage[field_table_ids[i]] + * if grey_opacity == 1: + * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) # <<<<<<<<<<<<<< + * for i in range(3): + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] + */ + __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (((__pyx_v_trgba[0]) + (__pyx_v_trgba[1])) + (__pyx_v_trgba[2])))), 0.0); -/* "volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i + /* "field_interpolation_tables.pxd":131 + * if grey_opacity == 1: + * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) + * for i in range(3): # <<<<<<<<<<<<<< + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] + * else: */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { - int __pyx_v_index[3]; - int __pyx_v_i; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("vc_pos_index", 0); + /* "field_interpolation_tables.pxd":132 + * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) + * for i in range(3): + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] # <<<<<<<<<<<<<< + * else: + * for i in range(3): + */ + (__pyx_v_rgba[__pyx_v_i]) = ((((1. - __pyx_v_ta) * (__pyx_v_trgba[__pyx_v_i])) * (1. + (__pyx_v_dot_prod * (__pyx_v_l_rgba[__pyx_v_i])))) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); + } - /* "volume_container.pxd":36 - * cdef int index[3] - * cdef int i - * for i in range(3): # <<<<<<<<<<<<<< - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) + /* "field_interpolation_tables.pxd":129 + * for i in range(6): + * trgba[i] = istorage[field_table_ids[i]] + * if grey_opacity == 1: # <<<<<<<<<<<<<< + * ta = fmax(1.0-dt*(trgba[0] + trgba[1] + trgba[2]), 0.0) + * for i in range(3): + */ + goto __pyx_L14; + } + + /* "field_interpolation_tables.pxd":134 + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] + * else: + * for i in range(3): # <<<<<<<<<<<<<< + * ta = fmax(1.0-dt*trgba[i], 0.0) + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + /*else*/ { + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "volume_container.pxd":37 - * cdef int i - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< - * return vc_index(vc, index[0], index[1], index[2]) + /* "field_interpolation_tables.pxd":135 + * else: + * for i in range(3): + * ta = fmax(1.0-dt*trgba[i], 0.0) # <<<<<<<<<<<<<< + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] * */ - (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); - } + __pyx_v_ta = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((1.0 - (__pyx_v_dt * (__pyx_v_trgba[__pyx_v_i]))), 0.0); - /* "volume_container.pxd":38 - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< + /* "field_interpolation_tables.pxd":136 + * for i in range(3): + * ta = fmax(1.0-dt*trgba[i], 0.0) + * rgba[i] = (1.-ta)*trgba[i]*(1. + dot_prod*l_rgba[i]) + ta * rgba[i] # <<<<<<<<<<<<<< * */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); - goto __pyx_L0; + (__pyx_v_rgba[__pyx_v_i]) = ((((1. - __pyx_v_ta) * (__pyx_v_trgba[__pyx_v_i])) * (1. + (__pyx_v_dot_prod * (__pyx_v_l_rgba[__pyx_v_i])))) + (__pyx_v_ta * (__pyx_v_rgba[__pyx_v_i]))); + } + } + __pyx_L14:; - /* "volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i + /* "field_interpolation_tables.pxd":108 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void FIT_eval_transfer_with_light(np.float64_t dt, np.float64_t *dvs, # <<<<<<<<<<<<<< + * np.float64_t *grad, np.float64_t *l_dir, np.float64_t *l_rgba, + * np.float64_t *rgba, int n_fits, */ /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; } /* "View.MemoryView":120 @@ -13592,10 +14375,15 @@ 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; } @@ -13604,21 +14392,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -13626,12 +14418,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -13640,11 +14434,11 @@ } } __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, 120, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) } else { /* "View.MemoryView":121 @@ -13659,15 +14453,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __pyx_L1_error) } __pyx_r = __pyx_array___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); @@ -13718,9 +14512,9 @@ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(2, 127, __pyx_L1_error) + __PYX_ERR(1, 127, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 @@ -13749,11 +14543,11 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 131, __pyx_L1_error) + __PYX_ERR(1, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize @@ -13781,11 +14575,11 @@ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 134, __pyx_L1_error) + __PYX_ERR(1, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") @@ -13814,9 +14608,9 @@ * 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, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -13838,7 +14632,7 @@ * 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, 138, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) __pyx_t_5 = __pyx_v_format; __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -13854,7 +14648,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -13892,11 +14686,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 146, __pyx_L1_error) + __PYX_ERR(1, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim @@ -13919,12 +14713,12 @@ 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, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dim = __pyx_t_8; __pyx_v_idx = __pyx_t_7; @@ -13947,11 +14741,11 @@ * self._shape[idx] = dim * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); @@ -13959,20 +14753,20 @@ 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, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(2, 151, __pyx_L1_error) + __PYX_ERR(1, 151, __pyx_L1_error) /* "View.MemoryView":150 * @@ -14009,7 +14803,7 @@ * 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, 155, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":156 @@ -14051,7 +14845,7 @@ * 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, 158, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":159 @@ -14094,19 +14888,19 @@ * 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, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 162, __pyx_L1_error) + __PYX_ERR(1, 162, __pyx_L1_error) } __pyx_L10:; @@ -14135,8 +14929,8 @@ * if allocate_buffer: * */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; @@ -14176,11 +14970,11 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 174, __pyx_L1_error) + __PYX_ERR(1, 174, __pyx_L1_error) /* "View.MemoryView":173 * @@ -14219,11 +15013,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __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, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { @@ -14344,7 +15138,7 @@ * 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, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -14374,7 +15168,7 @@ * 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, 187, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { @@ -14414,11 +15208,11 @@ * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 190, __pyx_L1_error) + __PYX_ERR(1, 190, __pyx_L1_error) /* "View.MemoryView":189 * elif self.mode == u"fortran": @@ -14758,7 +15552,7 @@ * @cname('get_memview') */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14817,11 +15611,11 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -14832,7 +15626,7 @@ 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, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -14896,9 +15690,9 @@ * 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, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -14961,9 +15755,9 @@ * 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, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -15024,9 +15818,9 @@ * * */ - __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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":235 @@ -15049,6 +15843,113 @@ 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__34, 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__35, 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":240 * * @cname("__pyx_array_new") @@ -15085,13 +15986,13 @@ * 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, 245, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -15105,7 +16006,7 @@ __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, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -15129,13 +16030,13 @@ * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -15157,9 +16058,9 @@ * result.data = buf * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) /* "View.MemoryView":247 * result = array(shape, itemsize, format, mode.decode('ASCII')) @@ -15168,7 +16069,7 @@ * 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, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -15244,6 +16145,7 @@ 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; } @@ -15254,7 +16156,7 @@ 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, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -15263,100 +16165,387 @@ } __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, 277, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___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":278 + * 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":277 + * 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":279 + * 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":280 + * 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":279 + * 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; + } - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "(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:; -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); + /* "(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) { - /* "View.MemoryView":278 - * cdef object name - * def __init__(self, name): - * self.name = name # <<<<<<<<<<<<<< - * def __repr__(self): - * return self.name + /* "(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_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; + __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; - /* "View.MemoryView":277 - * cdef class Enum(object): - * cdef object name - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * def __repr__(self): + /* "(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_r = 0; + __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; } -/* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * +/* "(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_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { +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("__repr__ (wrapper)", 0); - __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + __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_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { +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 - __Pyx_RefNannySetupContext("__repr__", 0); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "View.MemoryView":280 - * self.name = name - * def __repr__(self): - * return self.name # <<<<<<<<<<<<<< - * - * cdef generic = Enum("") + /* "(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) # <<<<<<<<<<<<<< */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->name); - __pyx_r = __pyx_v_self->name; - goto __pyx_L0; + 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; - /* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * + /* "(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(); @@ -15471,8 +16660,11 @@ 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; } @@ -15481,11 +16673,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -15493,11 +16687,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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; @@ -15505,16 +16700,16 @@ } } __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, 341, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -15585,7 +16780,7 @@ * 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 == -1)) __PYX_ERR(2, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) /* "View.MemoryView":346 * if type(self) is memoryview or obj is not None: @@ -15706,7 +16901,7 @@ * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) /* "View.MemoryView":356 * if self.lock is NULL: @@ -16047,26 +17242,26 @@ __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, 389, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -16076,7 +17271,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 389, __pyx_L1_error) + else __PYX_ERR(1, 389, __pyx_L1_error) } break; } @@ -16094,8 +17289,8 @@ * * 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, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":389 @@ -16212,7 +17407,7 @@ * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -16224,7 +17419,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 399, __pyx_L1_error) + __PYX_ERR(1, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -16232,14 +17427,14 @@ __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, 399, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; @@ -16253,7 +17448,7 @@ * 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, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":403 @@ -16264,7 +17459,7 @@ * 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, 403, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -16287,7 +17482,7 @@ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 405, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":406 @@ -16298,7 +17493,7 @@ * 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, 406, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -16368,7 +17563,7 @@ * * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __pyx_L1_error) + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; @@ -16380,7 +17575,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 409, __pyx_L1_error) + __PYX_ERR(1, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); @@ -16388,14 +17583,14 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; @@ -16409,7 +17604,7 @@ * obj = self.is_slice(value) * if obj: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":412 @@ -16419,7 +17614,7 @@ * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 412, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; @@ -16431,7 +17626,7 @@ * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":414 @@ -16441,9 +17636,9 @@ * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -16466,10 +17661,10 @@ * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 416, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -16494,7 +17689,7 @@ * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 418, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -16582,7 +17777,7 @@ * 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, 423, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":424 @@ -16592,7 +17787,7 @@ * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":423 @@ -16602,7 +17797,7 @@ * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -16613,7 +17808,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, 423, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -16630,7 +17825,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -16647,7 +17842,7 @@ __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, 425, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); @@ -16690,7 +17885,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -16762,7 +17957,7 @@ * 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, 434, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":435 * @@ -16771,7 +17966,7 @@ * 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, 435, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) /* "View.MemoryView":436 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], @@ -16780,13 +17975,13 @@ * * 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, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":434 @@ -16796,7 +17991,7 @@ * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 434, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":430 * return obj @@ -16902,7 +18097,7 @@ * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) /* "View.MemoryView":449 * if self.view.itemsize > sizeof(array): @@ -16990,7 +18185,7 @@ * */ /*else*/ { - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 459, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 459, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -17013,7 +18208,7 @@ * 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, 464, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -17128,7 +18323,7 @@ * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 471, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":472 @@ -17138,7 +18333,7 @@ * * 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, 472, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -17197,7 +18392,7 @@ * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -17209,7 +18404,7 @@ * 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, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -17237,9 +18432,9 @@ * 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, 482, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -17256,7 +18451,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -17265,14 +18460,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -17283,7 +18478,7 @@ __Pyx_GIVEREF(__pyx_v_bytesitem); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -17320,7 +18515,7 @@ * */ __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, 487, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -17362,13 +18557,13 @@ * raise ValueError("Unable to convert item to object") * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); @@ -17380,11 +18575,11 @@ * 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, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 484, __pyx_L5_except_error) + __PYX_ERR(1, 484, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -17475,7 +18670,7 @@ * 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, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -17498,26 +18693,26 @@ * 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, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 499, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -17539,9 +18734,9 @@ * 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, 501, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -17558,7 +18753,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -17567,14 +18762,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -17585,12 +18780,12 @@ __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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, 501, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 501, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } @@ -17606,7 +18801,7 @@ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(2, 503, __pyx_L1_error) + __PYX_ERR(1, 503, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -17993,9 +19188,9 @@ * 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, 540, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; @@ -18006,7 +19201,7 @@ * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) /* "View.MemoryView":542 * cdef _memoryviewslice result = memoryview_copy(self) @@ -18133,18 +19328,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { __pyx_t_2 = __pyx_t_4; __pyx_v_length = (__pyx_t_2[0]); - __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; @@ -18221,11 +19416,11 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 556, __pyx_L1_error) + __PYX_ERR(1, 556, __pyx_L1_error) /* "View.MemoryView":554 * @property @@ -18244,18 +19439,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; __pyx_v_stride = (__pyx_t_3[0]); - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; @@ -18333,9 +19528,9 @@ * 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, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__26, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__38, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -18359,18 +19554,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -18432,7 +19627,7 @@ * @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, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18492,7 +19687,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18554,11 +19749,11 @@ * @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, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -18652,7 +19847,7 @@ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; - __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; @@ -18664,7 +19859,7 @@ * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; @@ -18842,12 +20037,12 @@ * */ __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, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -18858,12 +20053,12 @@ * * def __str__(self): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -18874,7 +20069,7 @@ * id(self)) * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -18882,7 +20077,7 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -18946,20 +20141,20 @@ * */ __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, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -19032,7 +20227,7 @@ * 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, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -19103,7 +20298,7 @@ * 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, 615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -19183,7 +20378,7 @@ * 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, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":627 @@ -19194,7 +20389,7 @@ * 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, 627, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -19275,7 +20470,7 @@ * 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, 634, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":639 @@ -19286,7 +20481,7 @@ * */ __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, 639, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -19311,6 +20506,113 @@ 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__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.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__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.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "View.MemoryView":643 * * @cname('__pyx_memoryview_new') @@ -19335,11 +20637,11 @@ * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -19350,7 +20652,7 @@ 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, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); @@ -19487,7 +20789,7 @@ * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -19525,7 +20827,7 @@ * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -19561,26 +20863,26 @@ __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, 665, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -19590,7 +20892,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 665, __pyx_L1_error) + else __PYX_ERR(1, 665, __pyx_L1_error) } break; } @@ -19600,7 +20902,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, 665, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -19634,17 +20936,17 @@ * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 668, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__27); - __Pyx_GIVEREF(__pyx_slice__27); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__27); + __Pyx_INCREF(__pyx_slice__41); + __Pyx_GIVEREF(__pyx_slice__41); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__41); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":669 @@ -19674,7 +20976,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__28); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__42); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) } __pyx_L7:; @@ -19724,19 +21026,19 @@ * * 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, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(2, 675, __pyx_L1_error) + __PYX_ERR(1, 675, __pyx_L1_error) /* "View.MemoryView":674 * have_slices = True @@ -19773,7 +21075,7 @@ * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) } __pyx_L6:; @@ -19795,7 +21097,7 @@ * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":681 @@ -19815,16 +21117,16 @@ * * 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, 682, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__29); - __Pyx_GIVEREF(__pyx_slice__29); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__29); + __Pyx_INCREF(__pyx_slice__43); + __Pyx_GIVEREF(__pyx_slice__43); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__43); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":681 @@ -19846,20 +21148,20 @@ __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, 684, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -19945,11 +21247,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 689, __pyx_L1_error) + __PYX_ERR(1, 689, __pyx_L1_error) /* "View.MemoryView":688 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): @@ -20053,7 +21355,7 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(2, 708, __pyx_L1_error) + __PYX_ERR(1, 708, __pyx_L1_error) } } #endif @@ -20076,7 +21378,7 @@ * 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, 711, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -20172,26 +21474,26 @@ __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, 732, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -20201,7 +21503,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 732, __pyx_L1_error) + else __PYX_ERR(1, 732, __pyx_L1_error) } break; } @@ -20229,7 +21531,7 @@ * 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, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) /* "View.MemoryView":734 * for dim, index in enumerate(indices): @@ -20238,7 +21540,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 734, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) /* "View.MemoryView":733 * @@ -20315,13 +21617,13 @@ * 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, 746, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -20337,13 +21639,13 @@ * 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, 747, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -20359,13 +21661,13 @@ * * 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, 748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -20381,7 +21683,7 @@ * 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, 750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -20394,7 +21696,7 @@ * 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, 751, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -20407,7 +21709,7 @@ * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -20420,7 +21722,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 754, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) /* "View.MemoryView":760 * have_start, have_stop, have_step, @@ -20470,7 +21772,7 @@ * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } /* "View.MemoryView":765 * return memoryview_fromslice(dst, new_ndim, @@ -20479,7 +21781,7 @@ * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } /* "View.MemoryView":763 * @@ -20488,9 +21790,9 @@ * 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, 763, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -20521,7 +21823,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 768, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":768 @@ -20531,7 +21833,7 @@ * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -20634,7 +21936,7 @@ * 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 == -1)) __PYX_ERR(2, 818, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: @@ -20699,7 +22001,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) /* "View.MemoryView":823 * negative_step = have_step != 0 and step < 0 @@ -21271,7 +22573,7 @@ * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) } __pyx_L26:; @@ -21328,11 +22630,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -21400,11 +22702,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __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, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); @@ -21512,22 +22814,22 @@ * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 914, __pyx_L1_error) + __PYX_ERR(1, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: @@ -21564,22 +22866,22 @@ * * resultp = bufp + index * stride */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 917, __pyx_L1_error) + __PYX_ERR(1, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) @@ -21779,7 +23081,7 @@ * * return 1 */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error) + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] @@ -21813,11 +23115,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -21902,7 +23204,7 @@ * 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, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -21926,7 +23228,7 @@ */ /*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, 969, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -21985,7 +23287,7 @@ * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) /* "View.MemoryView":972 * @@ -22005,7 +23307,7 @@ * @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, 975, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -22065,21 +23367,128 @@ * * __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; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->from_object); + __pyx_r = __pyx_v_self->from_object; + goto __pyx_L0; + + /* "View.MemoryView":978 + * + * @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__45, 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__46, 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) - /* "View.MemoryView":978 - * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.from_object - * + /* "(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_L0:; + __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; @@ -22148,9 +23557,9 @@ * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -22161,7 +23570,7 @@ __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, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -22192,7 +23601,7 @@ * 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, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -22363,7 +23772,7 @@ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { __pyx_t_6 = __pyx_t_8; - __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1026, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; @@ -22375,12 +23784,12 @@ * * 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, 1027, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } @@ -22472,7 +23881,7 @@ * 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, 1039, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -22529,7 +23938,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -22693,7 +24102,7 @@ * @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, 1067, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22816,7 +24225,7 @@ * * */ - __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1084, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; @@ -23614,7 +25023,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) /* "View.MemoryView":1207 * @@ -23786,11 +25195,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -23814,7 +25223,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -23825,13 +25234,13 @@ * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -23850,20 +25259,20 @@ * (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, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 1237, __pyx_L1_error) + __PYX_ERR(1, 1237, __pyx_L1_error) /* "View.MemoryView":1235 * @@ -23883,7 +25292,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -23905,7 +25314,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -23917,11 +25326,11 @@ * * @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, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -23937,14 +25346,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -23953,20 +25362,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -23974,7 +25383,7 @@ __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, 1242, __pyx_L1_error) + __PYX_ERR(1, 1242, __pyx_L1_error) /* "View.MemoryView":1241 * @@ -23996,7 +25405,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -24019,7 +25428,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -24041,7 +25450,7 @@ * 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, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -24055,14 +25464,14 @@ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -24071,20 +25480,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -24092,7 +25501,7 @@ __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, 1247, __pyx_L1_error) + __PYX_ERR(1, 1247, __pyx_L1_error) /* "View.MemoryView":1246 * @cname('__pyx_memoryview_err') @@ -24112,7 +25521,7 @@ */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(2, 1249, __pyx_L1_error) + __PYX_ERR(1, 1249, __pyx_L1_error) } /* "View.MemoryView":1245 @@ -24135,7 +25544,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -24353,7 +25762,7 @@ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1281, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) } __pyx_L7:; @@ -24383,7 +25792,7 @@ * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) /* "View.MemoryView":1283 * _err_extents(i, dst.shape[i], src.shape[i]) @@ -24440,7 +25849,7 @@ * src = tmp * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1291, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1292 @@ -24624,7 +26033,7 @@ * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) /* "View.MemoryView":1314 * @@ -24633,7 +26042,7 @@ * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) /* "View.MemoryView":1310 * return 0 @@ -24702,11 +26111,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -24886,7 +26295,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -24910,7 +26319,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -25197,27 +26606,490 @@ */ __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":1406 - * _slice_assign_scalar(data, shape + 1, strides + 1, - * ndim - 1, itemsize, item) - * data += stride # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":1406 + * _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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) */ - __pyx_v_data = (__pyx_v_data + __pyx_v_stride); - } } - __pyx_L3:; - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_vtable_2yt_9utilities_3lib_14image_samplers_ImageSampler; @@ -25240,25 +27112,31 @@ p->aimage_used = Py_None; Py_INCREF(Py_None); p->amesh_lines = Py_None; Py_INCREF(Py_None); p->lens_type = Py_None; Py_INCREF(Py_None); + p->vp_pos.data = NULL; + p->vp_pos.memview = NULL; + p->vp_dir.data = NULL; + p->vp_dir.memview = NULL; + p->image.data = NULL; + p->image.memview = NULL; + p->zbuffer.data = NULL; + p->zbuffer.memview = NULL; + p->image_used.data = NULL; + p->image_used.memview = NULL; + p->mesh_lines.data = NULL; + p->mesh_lines.memview = NULL; + p->camera_data.data = NULL; + p->camera_data.memview = NULL; return o; } static void __pyx_tp_dealloc_2yt_9utilities_3lib_14image_samplers_ImageSampler(PyObject *o) { struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *p = (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } Py_CLEAR(p->acenter); Py_CLEAR(p->aimage); Py_CLEAR(p->ax_vec); @@ -25267,6 +27145,13 @@ Py_CLEAR(p->aimage_used); Py_CLEAR(p->amesh_lines); Py_CLEAR(p->lens_type); + __PYX_XDEC_MEMVIEW(&p->vp_pos, 1); + __PYX_XDEC_MEMVIEW(&p->vp_dir, 1); + __PYX_XDEC_MEMVIEW(&p->image, 1); + __PYX_XDEC_MEMVIEW(&p->zbuffer, 1); + __PYX_XDEC_MEMVIEW(&p->image_used, 1); + __PYX_XDEC_MEMVIEW(&p->mesh_lines, 1); + __PYX_XDEC_MEMVIEW(&p->camera_data, 1); (*Py_TYPE(o)->tp_free)(o); } @@ -25436,6 +27321,8 @@ static PyMethodDef __pyx_methods_2yt_9utilities_3lib_14image_samplers_ImageSampler[] = { {"ensure_code_unit_params", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_5ensure_code_unit_params, METH_O, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14image_samplers_12ImageSampler_9__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -25519,6 +27406,12 @@ return o; } +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_14image_samplers_ProjectionSampler[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + static PyTypeObject __pyx_type_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = { PyVarObject_HEAD_INIT(0, 0) "yt.utilities.lib.image_samplers.ProjectionSampler", /*tp_name*/ @@ -25556,7 +27449,7 @@ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - 0, /*tp_methods*/ + __pyx_methods_2yt_9utilities_3lib_14image_samplers_ProjectionSampler, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -25604,7 +27497,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler(PyObject *o) { struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *p = (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -25668,6 +27561,8 @@ } static PyMethodDef __pyx_methods_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -25763,7 +27658,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler(PyObject *o) { struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *p = (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -25842,6 +27737,8 @@ } static PyMethodDef __pyx_methods_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -25936,7 +27833,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler(PyObject *o) { struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *p = (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -26008,6 +27905,8 @@ } static PyMethodDef __pyx_methods_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -26221,7 +28120,7 @@ int e; struct __pyx_obj_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct_1_genexpr *)o; if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_b) { e = (*v)(p->__pyx_v_b, a); if (e) return e; @@ -26329,7 +28228,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -26379,6 +28278,8 @@ 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} }; @@ -26498,7 +28399,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -26526,6 +28427,8 @@ } 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} }; @@ -26613,7 +28516,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -26725,6 +28628,8 @@ {"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} }; @@ -26850,7 +28755,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -26894,6 +28799,8 @@ } 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} }; @@ -27001,6 +28908,7 @@ {&__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}, @@ -27011,14 +28919,17 @@ {&__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_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_kp_s_Shapes_s_s_s_and_s_s_s, __pyx_k_Shapes_s_s_s_and_s_s_s, sizeof(__pyx_k_Shapes_s_s_s_and_s_s_s), 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_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_bounds, __pyx_k_bounds, sizeof(__pyx_k_bounds), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, @@ -27026,11 +28937,13 @@ {&__pyx_n_s_camera_data, __pyx_k_camera_data, sizeof(__pyx_k_camera_data), 0, 0, 1, 1}, {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 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_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 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_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 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_ensure_code_unit_params_locals_g, __pyx_k_ensure_code_unit_params_locals_g, sizeof(__pyx_k_ensure_code_unit_params_locals_g), 0, 0, 1, 1}, @@ -27067,6 +28980,8 @@ {&__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_num_threads, __pyx_k_num_threads, sizeof(__pyx_k_num_threads), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, @@ -27077,22 +28992,31 @@ {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_perspective, __pyx_k_perspective, sizeof(__pyx_k_perspective), 0, 0, 1, 1}, {&__pyx_n_s_pg, __pyx_k_pg, sizeof(__pyx_k_pg), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_kp_s_plane_parallel, __pyx_k_plane_parallel, sizeof(__pyx_k_plane_parallel), 0, 0, 1, 0}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 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_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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_kp_s_self_center_self_extent_function, __pyx_k_self_center_self_extent_function, sizeof(__pyx_k_self_center_self_extent_function), 0, 0, 1, 0}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 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_star_list, __pyx_k_star_list, sizeof(__pyx_k_star_list), 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_tables, __pyx_k_tables, sizeof(__pyx_k_tables), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, @@ -27103,6 +29027,7 @@ {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 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_vp_dir, __pyx_k_vp_dir, sizeof(__pyx_k_vp_dir), 0, 0, 1, 1}, {&__pyx_n_s_vp_pos, __pyx_k_vp_pos, sizeof(__pyx_k_vp_pos), 0, 0, 1, 1}, {&__pyx_n_s_weight_field_ids, __pyx_k_weight_field_ids, sizeof(__pyx_k_weight_field_ids), 0, 0, 1, 1}, @@ -27118,16 +29043,16 @@ {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 100, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 127, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 425, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 124, __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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -27137,72 +29062,167 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "yt/utilities/lib/image_samplers.pyx":78 + /* "yt/utilities/lib/image_samplers.pyx":72 * cdef int i * * camera_data = kwargs.pop("camera_data", None) # <<<<<<<<<<<<<< * if camera_data is not None: - * self.image.camera_data = camera_data + * self.camera_data = camera_data */ - __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_camera_data, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_camera_data, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "yt/utilities/lib/image_samplers.pyx":82 - * self.image.camera_data = camera_data + /* "yt/utilities/lib/image_samplers.pyx":76 + * self.camera_data = camera_data * * zbuffer = kwargs.pop("zbuffer", None) # <<<<<<<<<<<<<< * if zbuffer is None: * zbuffer = np.ones((image.shape[0], image.shape[1]), "float64") */ - __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_zbuffer, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_zbuffer, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "yt/utilities/lib/image_samplers.pyx":89 + /* "yt/utilities/lib/image_samplers.pyx":83 * mesh_lines = np.zeros((image.shape[0], image.shape[1]), "int64") * * self.lens_type = kwargs.pop("lens_type", None) # <<<<<<<<<<<<<< * if self.lens_type == "plane-parallel": * self.extent_function = lenses.calculate_extent_plane_parallel */ - __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_lens_type, Py_None); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_lens_type, Py_None); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "yt/utilities/lib/image_samplers.pyx":210 + /* "yt/utilities/lib/image_samplers.pyx":207 * bounds = params['bounds'] * if hasattr(bounds[0], 'units'): * params['bounds'] = tuple(b.in_units('code_length').d for b in bounds) # <<<<<<<<<<<<<< * * return params */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "yt/utilities/lib/image_samplers.pyx":204 + /* "yt/utilities/lib/image_samplers.pyx":201 * * def ensure_code_unit_params(self, params): * for param_name in ['center', 'vp_pos', 'vp_dir', 'width']: # <<<<<<<<<<<<<< * param = params[param_name] * if hasattr(param, 'in_units'): */ - __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_center, __pyx_n_s_vp_pos, __pyx_n_s_vp_dir, __pyx_n_s_width); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_center, __pyx_n_s_vp_pos, __pyx_n_s_vp_dir, __pyx_n_s_width); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "yt/utilities/lib/image_samplers.pyx":207 + /* "yt/utilities/lib/image_samplers.pyx":204 * param = params[param_name] * if hasattr(param, 'in_units'): * params[param_name] = param.in_units('code_length') # <<<<<<<<<<<<<< * bounds = params['bounds'] * if hasattr(bounds[0], 'units'): */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_self_center_self_extent_function); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "(tree fragment)":4 + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_self_center_self_extent_function); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_self_center_self_extent_function); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "(tree fragment)":4 + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.center,self.extent_function,self.supp_data,self.vector_function,self.x_vec,self.y_vec cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_self_center_self_extent_function); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "(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__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "(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__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "(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__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "(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__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "(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__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "(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__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): @@ -27210,9 +29230,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -27221,9 +29241,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -27232,9 +29252,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -27243,9 +29263,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -27254,9 +29274,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -27265,9 +29285,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -27276,9 +29296,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -27287,18 +29307,18 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); /* "View.MemoryView":131 * @@ -27307,9 +29327,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "View.MemoryView":134 * @@ -27318,9 +29338,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "View.MemoryView":137 * @@ -27329,9 +29349,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); /* "View.MemoryView":146 * @@ -27340,9 +29360,9 @@ * * */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -27351,9 +29371,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -27362,9 +29382,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 190, __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(1, 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(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -27373,9 +29412,9 @@ * 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, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -27384,9 +29423,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); /* "View.MemoryView":563 * def suboffsets(self): @@ -27395,12 +29434,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__26 = PyTuple_New(1); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); + __pyx_tuple__38 = PyTuple_New(1); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__26, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__26); + PyTuple_SET_ITEM(__pyx_tuple__38, 0, __pyx_int_neg_1); + __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); /* "View.MemoryView":668 * if item is Ellipsis: @@ -27409,9 +29467,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(2, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__27); - __Pyx_GIVEREF(__pyx_slice__27); + __pyx_slice__41 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__41)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__41); + __Pyx_GIVEREF(__pyx_slice__41); /* "View.MemoryView":671 * seen_ellipsis = True @@ -27420,9 +29478,9 @@ * have_slices = True * else: */ - __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(2, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__28); - __Pyx_GIVEREF(__pyx_slice__28); + __pyx_slice__42 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__42)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__42); + __Pyx_GIVEREF(__pyx_slice__42); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -27431,9 +29489,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(2, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__29); - __Pyx_GIVEREF(__pyx_slice__29); + __pyx_slice__43 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__43)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__43); + __Pyx_GIVEREF(__pyx_slice__43); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -27442,9 +29500,28 @@ * * */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "(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__45 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "(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__46 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); /* "View.MemoryView":282 * return self.name @@ -27453,9 +29530,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); /* "View.MemoryView":283 * @@ -27464,9 +29541,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -27475,9 +29552,9 @@ * * */ - __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); /* "View.MemoryView":287 * @@ -27486,9 +29563,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); /* "View.MemoryView":288 * @@ -27497,9 +29574,19 @@ * * */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -27519,8 +29606,8 @@ __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __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:; @@ -27586,6 +29673,7 @@ __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 @@ -27622,61 +29710,68 @@ __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler = &__pyx_vtable_2yt_9utilities_3lib_14image_samplers_ImageSampler; __pyx_vtable_2yt_9utilities_3lib_14image_samplers_ImageSampler.setup = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *))__pyx_f_2yt_9utilities_3lib_14image_samplers_12ImageSampler_setup; __pyx_vtable_2yt_9utilities_3lib_14image_samplers_ImageSampler.sample = (void (*)(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int *, void *))__pyx_f_2yt_9utilities_3lib_14image_samplers_12ImageSampler_sample; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers_ImageSampler) < 0) __PYX_ERR(0, 60, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers_ImageSampler) < 0) __PYX_ERR(0, 59, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_14image_samplers_ImageSampler.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_14image_samplers_ImageSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler) < 0) __PYX_ERR(0, 60, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "ImageSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14image_samplers_ImageSampler) < 0) __PYX_ERR(0, 60, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_14image_samplers_ImageSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ImageSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14image_samplers_ImageSampler) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_14image_samplers_ImageSampler) < 0) __PYX_ERR(0, 59, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler = &__pyx_type_2yt_9utilities_3lib_14image_samplers_ImageSampler; __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = &__pyx_vtable_2yt_9utilities_3lib_14image_samplers_ProjectionSampler; __pyx_vtable_2yt_9utilities_3lib_14image_samplers_ProjectionSampler.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler; __pyx_vtable_2yt_9utilities_3lib_14image_samplers_ProjectionSampler.__pyx_base.sample = (void (*)(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int *, void *))__pyx_f_2yt_9utilities_3lib_14image_samplers_17ProjectionSampler_sample; __pyx_type_2yt_9utilities_3lib_14image_samplers_ProjectionSampler.tp_base = __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers_ProjectionSampler) < 0) __PYX_ERR(0, 223, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers_ProjectionSampler) < 0) __PYX_ERR(0, 211, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_14image_samplers_ProjectionSampler.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_14image_samplers_ProjectionSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler) < 0) __PYX_ERR(0, 223, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "ProjectionSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14image_samplers_ProjectionSampler) < 0) __PYX_ERR(0, 223, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_14image_samplers_ProjectionSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler) < 0) __PYX_ERR(0, 211, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "ProjectionSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14image_samplers_ProjectionSampler) < 0) __PYX_ERR(0, 211, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_14image_samplers_ProjectionSampler) < 0) __PYX_ERR(0, 211, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = &__pyx_type_2yt_9utilities_3lib_14image_samplers_ProjectionSampler; __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = &__pyx_vtable_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler; __pyx_vtable_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler; __pyx_vtable_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler.__pyx_base.sample = (void (*)(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int *, void *))__pyx_f_2yt_9utilities_3lib_14image_samplers_29InterpolatedProjectionSampler_sample; __pyx_type_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler.tp_base = __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler) < 0) __PYX_ERR(0, 242, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler) < 0) __PYX_ERR(0, 230, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler) < 0) __PYX_ERR(0, 242, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "InterpolatedProjectionSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler) < 0) __PYX_ERR(0, 242, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler) < 0) __PYX_ERR(0, 230, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "InterpolatedProjectionSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler) < 0) __PYX_ERR(0, 230, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler) < 0) __PYX_ERR(0, 230, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = &__pyx_type_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler; __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = &__pyx_vtable_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler; __pyx_vtable_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler; __pyx_vtable_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler.__pyx_base.sample = (void (*)(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int *, void *))__pyx_f_2yt_9utilities_3lib_14image_samplers_19VolumeRenderSampler_sample; __pyx_type_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler.tp_base = __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler) < 0) __PYX_ERR(0, 298, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler) < 0) __PYX_ERR(0, 286, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler) < 0) __PYX_ERR(0, 298, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "VolumeRenderSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler) < 0) __PYX_ERR(0, 298, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler) < 0) __PYX_ERR(0, 286, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "VolumeRenderSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler) < 0) __PYX_ERR(0, 286, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler) < 0) __PYX_ERR(0, 286, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = &__pyx_type_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler; __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = &__pyx_vtable_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler; __pyx_vtable_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler; __pyx_vtable_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler.__pyx_base.sample = (void (*)(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int *, void *))__pyx_f_2yt_9utilities_3lib_14image_samplers_24LightSourceRenderSampler_sample; __pyx_type_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler.tp_base = __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler) < 0) __PYX_ERR(0, 386, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler) < 0) __PYX_ERR(0, 374, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler) < 0) __PYX_ERR(0, 386, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "LightSourceRenderSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler) < 0) __PYX_ERR(0, 386, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler) < 0) __PYX_ERR(0, 374, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "LightSourceRenderSampler", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler) < 0) __PYX_ERR(0, 374, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler) < 0) __PYX_ERR(0, 374, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = &__pyx_type_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct__ensure_code_unit_params) < 0) __PYX_ERR(0, 203, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct__ensure_code_unit_params) < 0) __PYX_ERR(0, 200, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct__ensure_code_unit_params.tp_print = 0; __pyx_ptype_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct__ensure_code_unit_params = &__pyx_type_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct__ensure_code_unit_params; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 210, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 207, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct_1_genexpr.tp_print = 0; __pyx_ptype_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct_1_genexpr = &__pyx_type_2yt_9utilities_3lib_14image_samplers___pyx_scope_struct_1_genexpr; __pyx_vtabptr_array = &__pyx_vtable_array; __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; - if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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; @@ -27686,18 +29781,20 @@ __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, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -27707,21 +29804,21 @@ 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, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(2, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = __Pyx_ImportType("yt.utilities.lib.partitioned_grid", "PartitionedGrid", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(4, 22, __pyx_L1_error) __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(4, 22, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("yt.utilities.lib.lenses"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "generate_vector_info_plane_parallel", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_plane_parallel, "void (struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "generate_vector_info_null", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_null, "void (struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "calculate_extent_plane_parallel", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_plane_parallel, "int (struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "calculate_extent_perspective", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_perspective, "int (struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "calculate_extent_null", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_null, "int (struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "generate_vector_info_plane_parallel", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_plane_parallel, "void (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "generate_vector_info_null", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_null, "void (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "calculate_extent_plane_parallel", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_plane_parallel, "int (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "calculate_extent_perspective", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_perspective, "int (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "calculate_extent_null", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_null, "int (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_ImportModule("yt.utilities.lib.grid_traversal"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_2, "walk_volume", (void (**)(void))&__pyx_f_2yt_9utilities_3lib_14grid_traversal_walk_volume, "int (struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_2yt_9utilities_3lib_14grid_traversal_sampler_function *, void *, struct __pyx_opt_args_2yt_9utilities_3lib_14grid_traversal_walk_volume *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -27743,14 +29840,14 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":397 + /* "yt/utilities/lib/image_samplers.pyx":385 * np.ndarray[np.float64_t, ndim=1] width, * tf_obj, n_samples = 10, * light_dir=[1.,1.,1.], # <<<<<<<<<<<<<< * light_rgba=[1.,1.,1.,1.], * **kwargs): */ - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_float_1_); __Pyx_GIVEREF(__pyx_float_1_); @@ -27761,18 +29858,18 @@ __Pyx_INCREF(__pyx_float_1_); __Pyx_GIVEREF(__pyx_float_1_); PyList_SET_ITEM(__pyx_t_3, 2, __pyx_float_1_); - __pyx_k__7 = __pyx_t_3; + __pyx_k__15 = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/image_samplers.pyx":398 + /* "yt/utilities/lib/image_samplers.pyx":386 * tf_obj, n_samples = 10, * light_dir=[1.,1.,1.], * light_rgba=[1.,1.,1.,1.], # <<<<<<<<<<<<<< * **kwargs): * ImageSampler.__init__(self, vp_pos, vp_dir, center, bounds, image, */ - __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_float_1_); __Pyx_GIVEREF(__pyx_float_1_); @@ -27786,7 +29883,7 @@ __Pyx_INCREF(__pyx_float_1_); __Pyx_GIVEREF(__pyx_float_1_); PyList_SET_ITEM(__pyx_t_3, 3, __pyx_float_1_); - __pyx_k__8 = __pyx_t_3; + __pyx_k__16 = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; @@ -27807,9 +29904,9 @@ * * def __dealloc__(array self): */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) + __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(2, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_array_type); @@ -27820,7 +29917,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 282, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_3); @@ -27834,7 +29931,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 283, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_3); @@ -27848,7 +29945,7 @@ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 284, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_3); @@ -27862,7 +29959,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 287, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_3); @@ -27876,7 +29973,7 @@ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 288, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_3); @@ -27916,9 +30013,9 @@ * * */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 535, __pyx_L1_error) + __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(2, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_memoryview_type); @@ -27929,18 +30026,28 @@ * * */ - __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 981, __pyx_L1_error) + __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(2, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -27952,7 +30059,7 @@ __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.image_samplers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.image_samplers", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -29008,8 +31115,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL @@ -29017,17 +31124,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { @@ -29048,7 +31160,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -29108,6 +31229,21 @@ 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; @@ -29332,9 +31468,69 @@ } #endif } -bad: - Py_XDECREF(owned_instance); - return; +bad: + Py_XDECREF(owned_instance); + return; +} +#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 @@ -29350,9 +31546,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -29365,9 +31564,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -29430,48 +31632,6 @@ PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } -/* 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 -} - /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_COMPILING_IN_CPYTHON @@ -29485,6 +31645,24 @@ return PyObject_GetAttr(o, n); } +/* 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; + } +} + /* GetAttr3 */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r = __Pyx_GetAttr(o, n); @@ -29519,72 +31697,8 @@ "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); } -/* 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 -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); -#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 - /* PyObjectCallMethod1 */ - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto done; @@ -29630,7 +31744,7 @@ } /* append */ - static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { @@ -29643,25 +31757,25 @@ } /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -29685,7 +31799,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -29695,7 +31809,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -29756,7 +31870,7 @@ } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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)); @@ -29764,7 +31878,7 @@ } /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -29797,7 +31911,7 @@ } /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -29822,7 +31936,7 @@ #endif /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -29896,7 +32010,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -30012,20 +32126,76 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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; +} + /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -30042,8 +32212,73 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -30062,8 +32297,42 @@ return NULL; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -30143,7 +32412,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -30202,12 +32471,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -30246,8 +32518,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -30270,7 +32542,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -30306,7 +32578,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -30319,7 +32591,7 @@ } /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -30360,7 +32632,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -30542,7 +32814,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -30565,7 +32837,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -30587,7 +32859,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -30617,37 +32889,25 @@ } } -/* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { - return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); -} -static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { - __pyx_t_5numpy_float64_t value = __pyx_PyFloat_AsDouble(obj); - if ((value == ((npy_float64)-1)) && PyErr_Occurred()) - return 0; - *(__pyx_t_5numpy_float64_t *) itemp = value; - return 1; -} - /* 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; + 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(npy_int64) < sizeof(long)) { + if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) { + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { - if (sizeof(npy_int64) <= sizeof(long)) { + if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -30655,42 +32915,30 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + return _PyLong_FromByteArray(bytes, sizeof(int), 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; -} - /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; + 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(int) < sizeof(long)) { + if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { + } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { - if (sizeof(int) <= sizeof(long)) { + if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -30698,30 +32946,30 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), + return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; + 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(long) < sizeof(long)) { + if (sizeof(npy_int64) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { - if (sizeof(long) <= sizeof(long)) { + if (sizeof(npy_int64) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -30729,13 +32977,13 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), little, !is_unsigned); } } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -30755,7 +33003,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -30890,7 +33138,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -30910,7 +33158,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -31045,7 +33293,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -31076,7 +33324,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -31143,7 +33391,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -31332,19 +33580,19 @@ } /* 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; + 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(npy_int64) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x)) + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (npy_int64) val; + return (long) val; } } else #endif @@ -31353,32 +33601,32 @@ #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 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: - if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(npy_int64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(npy_int64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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; @@ -31392,86 +33640,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (npy_int64) -1; + return (long) -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)) + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } 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 (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 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(npy_int64) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(npy_int64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(npy_int64) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(npy_int64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(npy_int64) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(npy_int64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(npy_int64) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x)) + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -31480,7 +33728,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - npy_int64 val; + long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -31500,40 +33748,40 @@ return val; } #endif - return (npy_int64) -1; + return (long) -1; } } else { - npy_int64 val; + long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (npy_int64) -1; - val = __Pyx_PyInt_As_npy_int64(tmp); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to npy_int64"); - return (npy_int64) -1; + "value too large to convert to long"); + return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to npy_int64"); - return (npy_int64) -1; + "can't convert negative value to long"); + return (long) -1; } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; + 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(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(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 (long) val; + return (npy_int64) val; } } else #endif @@ -31542,32 +33790,32 @@ #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 0: return (npy_int64) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0]) case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 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])); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 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])); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 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])); + __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; @@ -31581,86 +33829,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (long) -1; + return (npy_int64) -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)) + 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(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } 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 (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 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(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) - 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]))); + __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(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 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]))); + __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(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) - 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]))); + __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(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 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]))); + __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(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) - 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]))); + __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(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(npy_int64) > 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]))); + __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(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, 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)) + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -31669,7 +33917,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - long val; + npy_int64 val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -31689,28 +33937,28 @@ return val; } #endif - return (long) -1; + return (npy_int64) -1; } } else { - long val; + npy_int64 val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + 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 long"); - return (long) -1; + "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 long"); - return (long) -1; + "can't convert negative value to npy_int64"); + return (npy_int64) -1; } /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + 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 @@ -31899,7 +34147,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -31922,7 +34170,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -31945,7 +34193,7 @@ } /* FetchCommonType */ - static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); @@ -31984,7 +34232,7 @@ } /* CoroutineBase */ - #include + #include #include static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); @@ -32517,7 +34765,7 @@ } /* PatchModuleWithCoroutine */ - static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { + static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; @@ -32557,7 +34805,7 @@ } /* PatchGeneratorABC */ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( @@ -32611,7 +34859,7 @@ } /* Generator */ - static PyMethodDef __pyx_Generator_methods[] = { + static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, @@ -32700,7 +34948,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -32716,7 +34964,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -32734,7 +34982,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -32799,7 +35047,7 @@ #endif /* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction + #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; @@ -32853,7 +35101,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -32878,6 +35126,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -32886,11 +35136,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/image_samplers.pxd yt-3.4.0/yt/utilities/lib/image_samplers.pxd --- yt-3.3.3/yt/utilities/lib/image_samplers.pxd 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/image_samplers.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -17,12 +17,7 @@ import numpy as np cimport numpy as np cimport cython -cimport kdtree_utils from .volume_container cimport VolumeContainer -from .lenses cimport \ - calculate_extent_function, \ - generate_vector_info_function, \ - ImageContainer from .partitioned_grid cimport PartitionedGrid DEF Nch = 4 @@ -32,12 +27,32 @@ # declare. cdef struct VolumeRenderAccumulator +ctypedef int calculate_extent_function(ImageSampler image, + VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 + +ctypedef void generate_vector_info_function(ImageSampler im, + np.int64_t vi, np.int64_t vj, + np.float64_t width[2], + np.float64_t v_dir[3], np.float64_t v_pos[3]) nogil + cdef struct ImageAccumulator: np.float64_t rgba[Nch] void *supp_data cdef class ImageSampler: - cdef ImageContainer *image + cdef np.float64_t[:,:,:] vp_pos + cdef np.float64_t[:,:,:] vp_dir + cdef np.float64_t *center + cdef np.float64_t[:,:,:] image + cdef np.float64_t[:,:] zbuffer + cdef np.int64_t[:,:] image_used + cdef np.int64_t[:,:] mesh_lines + cdef np.float64_t pdx, pdy + cdef np.float64_t bounds[4] + cdef np.float64_t[:,:] camera_data # position, width, unit_vec[0,2] + cdef int nv[2] + cdef np.float64_t *x_vec + cdef np.float64_t *y_vec cdef public object acenter, aimage, ax_vec, ay_vec cdef public object azbuffer cdef public object aimage_used @@ -69,7 +84,6 @@ cdef VolumeRenderAccumulator *vra cdef public object tf_obj cdef public object my_field_tables - cdef kdtree_utils.kdtree **trees cdef object tree_containers cdef class LightSourceRenderSampler(ImageSampler): diff -Nru yt-3.3.3/yt/utilities/lib/image_samplers.pyx yt-3.4.0/yt/utilities/lib/image_samplers.pyx --- yt-3.3.3/yt/utilities/lib/image_samplers.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/image_samplers.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -51,7 +51,6 @@ np.float64_t star_coeff np.float64_t star_er np.float64_t star_sigma_num - kdtree_utils.kdtree *star_list np.float64_t *light_dir np.float64_t *light_rgba int grey_opacity @@ -68,16 +67,11 @@ np.ndarray[np.float64_t, ndim=1] y_vec, np.ndarray[np.float64_t, ndim=1] width, *args, **kwargs): - self.image = calloc(sizeof(ImageContainer), 1) - cdef np.float64_t[:,:] zbuffer - cdef np.int64_t[:,:] image_used - cdef np.int64_t[:,:] mesh_lines - cdef np.float64_t[:,:] camera_data cdef int i camera_data = kwargs.pop("camera_data", None) if camera_data is not None: - self.image.camera_data = camera_data + self.camera_data = camera_data zbuffer = kwargs.pop("zbuffer", None) if zbuffer is None: @@ -110,23 +104,26 @@ # de-allocation from reference counts. Note that we do this to the # "atleast_3d" versions. Also, note that we re-assign the input # arguments. - self.image.vp_pos = vp_pos - self.image.vp_dir = vp_dir - self.image.image = self.aimage = image + self.vp_pos = vp_pos + self.vp_dir = vp_dir + self.image = self.aimage = image self.acenter = center - self.image.center = center.data + self.center = center.data self.ax_vec = x_vec - self.image.x_vec = x_vec.data + self.x_vec = x_vec.data self.ay_vec = y_vec - self.image.y_vec = y_vec.data - self.image.zbuffer = self.azbuffer = zbuffer - self.image.image_used = self.aimage_used = image_used - self.image.mesh_lines = self.amesh_lines = mesh_lines - self.image.nv[0] = image.shape[0] - self.image.nv[1] = image.shape[1] - for i in range(4): self.image.bounds[i] = bounds[i] - self.image.pdx = (bounds[1] - bounds[0])/self.image.nv[0] - self.image.pdy = (bounds[3] - bounds[2])/self.image.nv[1] + self.y_vec = y_vec.data + self.zbuffer = zbuffer + self.azbuffer = np.asarray(zbuffer) + self.image_used = image_used + self.aimage_used = np.asarray(image_used) + self.mesh_lines = mesh_lines + self.amesh_lines = np.asarray(mesh_lines) + self.nv[0] = image.shape[0] + self.nv[1] = image.shape[1] + for i in range(4): self.bounds[i] = bounds[i] + self.pdx = (bounds[1] - bounds[0])/self.nv[0] + self.pdy = (bounds[3] - bounds[2])/self.nv[1] for i in range(3): self.width[i] = width[i] @@ -140,18 +137,17 @@ cdef int vi, vj, hit, i, j cdef np.int64_t iter[4] cdef VolumeContainer *vc = pg.container - cdef ImageContainer *im = self.image self.setup(pg) cdef np.float64_t *v_pos cdef np.float64_t *v_dir cdef np.float64_t max_t hit = 0 cdef np.int64_t nx, ny, size - self.extent_function(self.image, vc, iter) - iter[0] = i64clip(iter[0]-1, 0, im.nv[0]) - iter[1] = i64clip(iter[1]+1, 0, im.nv[0]) - iter[2] = i64clip(iter[2]-1, 0, im.nv[1]) - iter[3] = i64clip(iter[3]+1, 0, im.nv[1]) + self.extent_function(self, vc, iter) + iter[0] = i64clip(iter[0]-1, 0, self.nv[0]) + iter[1] = i64clip(iter[1]+1, 0, self.nv[0]) + iter[2] = i64clip(iter[2]-1, 0, self.nv[1]) + iter[3] = i64clip(iter[3]+1, 0, self.nv[1]) nx = (iter[1] - iter[0]) ny = (iter[3] - iter[2]) size = nx * ny @@ -170,17 +166,18 @@ vi = (j - vj) / ny + iter[0] vj = vj + iter[2] # Dynamically calculate the position - self.vector_function(im, vi, vj, width, v_dir, v_pos) + self.vector_function(self, vi, vj, width, v_dir, v_pos) for i in range(Nch): - idata.rgba[i] = im.image[vi, vj, i] - max_t = fclip(im.zbuffer[vi, vj], 0.0, 1.0) + idata.rgba[i] = self.image[vi, vj, i] + max_t = fclip(self.zbuffer[vi, vj], 0.0, 1.0) walk_volume(vc, v_pos, v_dir, self.sample, ( idata), NULL, max_t) if (j % (10*chunksize)) == 0: with gil: PyErr_CheckSignals() for i in range(Nch): - im.image[vi, vj, i] = idata.rgba[i] + self.image[vi, vj, i] = idata.rgba[i] + idata.supp_data = NULL free(idata) free(v_pos) free(v_dir) @@ -211,15 +208,6 @@ return params - def __dealloc__(self): - self.image.image = None - self.image.vp_pos = None - self.image.vp_dir = None - self.image.zbuffer = None - self.image.camera_data = None - self.image.image_used = None - free(self.image) - cdef class ProjectionSampler(ImageSampler): @staticmethod @@ -306,7 +294,7 @@ np.ndarray[np.float64_t, ndim=1] y_vec, np.ndarray[np.float64_t, ndim=1] width, tf_obj, n_samples = 10, - star_list = None, **kwargs): + **kwargs): ImageSampler.__init__(self, vp_pos, vp_dir, center, bounds, image, x_vec, y_vec, width, **kwargs) cdef int i @@ -412,7 +400,9 @@ self.vra.n_samples = n_samples self.vra.light_dir = malloc(sizeof(np.float64_t) * 3) self.vra.light_rgba = malloc(sizeof(np.float64_t) * 4) - light_dir /= np.sqrt(light_dir[0]**2 + light_dir[1]**2 + light_dir[2]**2) + light_dir /= np.sqrt(light_dir[0] * light_dir[0] + + light_dir[1] * light_dir[1] + + light_dir[2] * light_dir[2]) for i in range(3): self.vra.light_dir[i] = light_dir[i] for i in range(4): diff -Nru yt-3.3.3/yt/utilities/lib/image_utilities.c yt-3.4.0/yt/utilities/lib/image_utilities.c --- yt-3.3.3/yt/utilities/lib/image_utilities.c 2016-12-12 01:41:49.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/image_utilities.c 2017-08-10 18:20:42.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,6 +6,10 @@ "depends": [], "libraries": [ "m" + ], + "name": "yt.utilities.lib.image_utilities", + "sources": [ + "yt/utilities/lib/image_utilities.pyx" ] }, "module_name": "yt.utilities.lib.image_utilities" @@ -19,7 +23,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -41,6 +45,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -193,16 +198,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -329,6 +338,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -383,6 +398,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -490,8 +534,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -504,8 +548,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -627,10 +674,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1061,7 +1110,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* BufferIndexError.proto */ static void __Pyx_RaiseBufferIndexError(int axis); @@ -1166,6 +1215,9 @@ /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1381,10 +1433,11 @@ /* Module declarations from 'yt.utilities.lib.fp_utils' */ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ /* Module declarations from 'yt.utilities.lib.image_utilities' */ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; #define __Pyx_MODULE_NAME "yt.utilities.lib.image_utilities" int __pyx_module_is_main_yt__utilities__lib__image_utilities = 0; @@ -1415,32 +1468,35 @@ static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_buffer_mask[] = "buffer_mask"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_add_points_to_image[] = "add_points_to_image"; static const char __pyx_k_Utilities_for_images[] = "\nUtilities for images\n"; static const char __pyx_k_add_rgba_points_to_image[] = "add_rgba_points_to_image"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_add_points_to_greyscale_image[] = "add_points_to_greyscale_image"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/image_utilities.pyx"; 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"; static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_utilities_lib_image_utilities[] = "yt.utilities.lib.image_utilities"; +static const char __pyx_k_yt_utilities_lib_image_utilities[] = "yt/utilities/lib/image_utilities.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_utilities_lib_image_utilities_2[] = "yt.utilities.lib.image_utilities"; 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_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_add_points_to_greyscale_image; static PyObject *__pyx_n_s_add_points_to_image; static PyObject *__pyx_n_s_add_rgba_points_to_image; static PyObject *__pyx_n_s_buffer; +static PyObject *__pyx_n_s_buffer_mask; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_j; @@ -1464,8 +1520,9 @@ static PyObject *__pyx_n_s_v; static PyObject *__pyx_n_s_xs; static PyObject *__pyx_n_s_ys; -static PyObject *__pyx_n_s_yt_utilities_lib_image_utilities; -static PyObject *__pyx_pf_2yt_9utilities_3lib_15image_utilities_add_points_to_greyscale_image(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_buffer, PyArrayObject *__pyx_v_px, PyArrayObject *__pyx_v_py, PyArrayObject *__pyx_v_pv); /* proto */ +static PyObject *__pyx_kp_s_yt_utilities_lib_image_utilities; +static PyObject *__pyx_n_s_yt_utilities_lib_image_utilities_2; +static PyObject *__pyx_pf_2yt_9utilities_3lib_15image_utilities_add_points_to_greyscale_image(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_buffer, PyArrayObject *__pyx_v_buffer_mask, PyArrayObject *__pyx_v_px, PyArrayObject *__pyx_v_py, PyArrayObject *__pyx_v_pv); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_15image_utilities_2add_points_to_image(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_buffer, PyArrayObject *__pyx_v_px, PyArrayObject *__pyx_v_py, __pyx_t_5numpy_float64_t __pyx_v_pv); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_15image_utilities_4add_rgba_points_to_image(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_buffer, PyArrayObject *__pyx_v_px, PyArrayObject *__pyx_v_py, PyArrayObject *__pyx_v_rgba); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ @@ -1491,7 +1548,7 @@ * * def add_points_to_greyscale_image( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] buffer, - * np.ndarray[np.float64_t, ndim=1] px, + * np.ndarray[np.int_t, ndim=2] buffer_mask, */ /* Python wrapper */ @@ -1499,6 +1556,7 @@ static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_15image_utilities_1add_points_to_greyscale_image = {"add_points_to_greyscale_image", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15image_utilities_1add_points_to_greyscale_image, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_2yt_9utilities_3lib_15image_utilities_1add_points_to_greyscale_image(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_buffer = 0; + PyArrayObject *__pyx_v_buffer_mask = 0; PyArrayObject *__pyx_v_px = 0; PyArrayObject *__pyx_v_py = 0; PyArrayObject *__pyx_v_pv = 0; @@ -1506,16 +1564,22 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_points_to_greyscale_image (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buffer,&__pyx_n_s_px,&__pyx_n_s_py,&__pyx_n_s_pv,0}; - PyObject* values[4] = {0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buffer,&__pyx_n_s_buffer_mask,&__pyx_n_s_px,&__pyx_n_s_py,&__pyx_n_s_pv,0}; + PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + 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; } @@ -1524,51 +1588,63 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer_mask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_points_to_greyscale_image", 1, 4, 4, 1); __PYX_ERR(0, 18, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_points_to_greyscale_image", 1, 5, 5, 1); __PYX_ERR(0, 18, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_points_to_greyscale_image", 1, 4, 4, 2); __PYX_ERR(0, 18, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_points_to_greyscale_image", 1, 5, 5, 2); __PYX_ERR(0, 18, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pv)) != 0)) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("add_points_to_greyscale_image", 1, 5, 5, 3); __PYX_ERR(0, 18, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pv)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_points_to_greyscale_image", 1, 4, 4, 3); __PYX_ERR(0, 18, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_points_to_greyscale_image", 1, 5, 5, 4); __PYX_ERR(0, 18, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_points_to_greyscale_image") < 0)) __PYX_ERR(0, 18, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_buffer = ((PyArrayObject *)values[0]); - __pyx_v_px = ((PyArrayObject *)values[1]); - __pyx_v_py = ((PyArrayObject *)values[2]); - __pyx_v_pv = ((PyArrayObject *)values[3]); + __pyx_v_buffer_mask = ((PyArrayObject *)values[1]); + __pyx_v_px = ((PyArrayObject *)values[2]); + __pyx_v_py = ((PyArrayObject *)values[3]); + __pyx_v_pv = ((PyArrayObject *)values[4]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_points_to_greyscale_image", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 18, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_points_to_greyscale_image", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 18, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.image_utilities.add_points_to_greyscale_image", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buffer), __pyx_ptype_5numpy_ndarray, 1, "buffer", 0))) __PYX_ERR(0, 19, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_px), __pyx_ptype_5numpy_ndarray, 1, "px", 0))) __PYX_ERR(0, 20, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_py), __pyx_ptype_5numpy_ndarray, 1, "py", 0))) __PYX_ERR(0, 21, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pv), __pyx_ptype_5numpy_ndarray, 1, "pv", 0))) __PYX_ERR(0, 22, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_15image_utilities_add_points_to_greyscale_image(__pyx_self, __pyx_v_buffer, __pyx_v_px, __pyx_v_py, __pyx_v_pv); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buffer_mask), __pyx_ptype_5numpy_ndarray, 1, "buffer_mask", 0))) __PYX_ERR(0, 20, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_px), __pyx_ptype_5numpy_ndarray, 1, "px", 0))) __PYX_ERR(0, 21, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_py), __pyx_ptype_5numpy_ndarray, 1, "py", 0))) __PYX_ERR(0, 22, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pv), __pyx_ptype_5numpy_ndarray, 1, "pv", 0))) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_15image_utilities_add_points_to_greyscale_image(__pyx_self, __pyx_v_buffer, __pyx_v_buffer_mask, __pyx_v_px, __pyx_v_py, __pyx_v_pv); /* function exit code */ goto __pyx_L0; @@ -1579,7 +1655,7 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_15image_utilities_add_points_to_greyscale_image(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_buffer, PyArrayObject *__pyx_v_px, PyArrayObject *__pyx_v_py, PyArrayObject *__pyx_v_pv) { +static PyObject *__pyx_pf_2yt_9utilities_3lib_15image_utilities_add_points_to_greyscale_image(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_buffer, PyArrayObject *__pyx_v_buffer_mask, PyArrayObject *__pyx_v_px, PyArrayObject *__pyx_v_py, PyArrayObject *__pyx_v_pv) { int __pyx_v_i; int __pyx_v_j; int __pyx_v_pi; @@ -1588,6 +1664,8 @@ int __pyx_v_ys; __Pyx_LocalBuf_ND __pyx_pybuffernd_buffer; __Pyx_Buffer __pyx_pybuffer_buffer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_buffer_mask; + __Pyx_Buffer __pyx_pybuffer_buffer_mask; __Pyx_LocalBuf_ND __pyx_pybuffernd_pv; __Pyx_Buffer __pyx_pybuffer_pv; __Pyx_LocalBuf_ND __pyx_pybuffernd_px; @@ -1604,11 +1682,17 @@ 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; __Pyx_RefNannySetupContext("add_points_to_greyscale_image", 0); __pyx_pybuffer_buffer.pybuffer.buf = NULL; __pyx_pybuffer_buffer.refcount = 0; __pyx_pybuffernd_buffer.data = NULL; __pyx_pybuffernd_buffer.rcbuffer = &__pyx_pybuffer_buffer; + __pyx_pybuffer_buffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_buffer_mask.refcount = 0; + __pyx_pybuffernd_buffer_mask.data = NULL; + __pyx_pybuffernd_buffer_mask.rcbuffer = &__pyx_pybuffer_buffer_mask; __pyx_pybuffer_px.pybuffer.buf = NULL; __pyx_pybuffer_px.refcount = 0; __pyx_pybuffernd_px.data = NULL; @@ -1628,6 +1712,11 @@ __pyx_pybuffernd_buffer.diminfo[0].strides = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_buffer.diminfo[0].shape = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_buffer.diminfo[1].strides = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_buffer.diminfo[1].shape = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buffer_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_buffer_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error) + } + __pyx_pybuffernd_buffer_mask.diminfo[0].strides = __pyx_pybuffernd_buffer_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_buffer_mask.diminfo[0].shape = __pyx_pybuffernd_buffer_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_buffer_mask.diminfo[1].strides = __pyx_pybuffernd_buffer_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_buffer_mask.diminfo[1].shape = __pyx_pybuffernd_buffer_mask.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_px.rcbuffer->pybuffer, (PyObject*)__pyx_v_px, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error) } __pyx_pybuffernd_px.diminfo[0].strides = __pyx_pybuffernd_px.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_px.diminfo[0].shape = __pyx_pybuffernd_px.rcbuffer->pybuffer.shape[0]; @@ -1642,7 +1731,7 @@ } __pyx_pybuffernd_pv.diminfo[0].strides = __pyx_pybuffernd_pv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pv.diminfo[0].shape = __pyx_pybuffernd_pv.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/image_utilities.pyx":24 + /* "yt/utilities/lib/image_utilities.pyx":25 * np.ndarray[np.float64_t, ndim=1] pv): * cdef int i, j, pi * cdef int np = px.shape[0] # <<<<<<<<<<<<<< @@ -1651,7 +1740,7 @@ */ __pyx_v_np = (__pyx_v_px->dimensions[0]); - /* "yt/utilities/lib/image_utilities.pyx":25 + /* "yt/utilities/lib/image_utilities.pyx":26 * cdef int i, j, pi * cdef int np = px.shape[0] * cdef int xs = buffer.shape[0] # <<<<<<<<<<<<<< @@ -1660,7 +1749,7 @@ */ __pyx_v_xs = (__pyx_v_buffer->dimensions[0]); - /* "yt/utilities/lib/image_utilities.pyx":26 + /* "yt/utilities/lib/image_utilities.pyx":27 * cdef int np = px.shape[0] * cdef int xs = buffer.shape[0] * cdef int ys = buffer.shape[1] # <<<<<<<<<<<<<< @@ -1669,7 +1758,7 @@ */ __pyx_v_ys = (__pyx_v_buffer->dimensions[1]); - /* "yt/utilities/lib/image_utilities.pyx":27 + /* "yt/utilities/lib/image_utilities.pyx":28 * cdef int xs = buffer.shape[0] * cdef int ys = buffer.shape[1] * for pi in range(np): # <<<<<<<<<<<<<< @@ -1680,7 +1769,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_pi = __pyx_t_2; - /* "yt/utilities/lib/image_utilities.pyx":28 + /* "yt/utilities/lib/image_utilities.pyx":29 * cdef int ys = buffer.shape[1] * for pi in range(np): * j = (xs * px[pi]) # <<<<<<<<<<<<<< @@ -1695,16 +1784,16 @@ } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_px.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 28, __pyx_L1_error) + __PYX_ERR(0, 29, __pyx_L1_error) } __pyx_v_j = ((int)(__pyx_v_xs * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_px.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_px.diminfo[0].strides)))); - /* "yt/utilities/lib/image_utilities.pyx":29 + /* "yt/utilities/lib/image_utilities.pyx":30 * for pi in range(np): * j = (xs * px[pi]) * i = (ys * py[pi]) # <<<<<<<<<<<<<< * buffer[i, j] += pv[pi] - * return + * buffer_mask[i, j] = 1 */ __pyx_t_5 = __pyx_v_pi; __pyx_t_4 = -1; @@ -1714,16 +1803,16 @@ } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_py.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 29, __pyx_L1_error) + __PYX_ERR(0, 30, __pyx_L1_error) } __pyx_v_i = ((int)(__pyx_v_ys * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_py.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_py.diminfo[0].strides)))); - /* "yt/utilities/lib/image_utilities.pyx":30 + /* "yt/utilities/lib/image_utilities.pyx":31 * j = (xs * px[pi]) * i = (ys * py[pi]) * buffer[i, j] += pv[pi] # <<<<<<<<<<<<<< + * buffer_mask[i, j] = 1 * return - * */ __pyx_t_6 = __pyx_v_pi; __pyx_t_4 = -1; @@ -1733,7 +1822,7 @@ } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_pv.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 30, __pyx_L1_error) + __PYX_ERR(0, 31, __pyx_L1_error) } __pyx_t_7 = __pyx_v_i; __pyx_t_8 = __pyx_v_j; @@ -1748,14 +1837,38 @@ } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_buffer.diminfo[1].shape)) __pyx_t_4 = 1; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 30, __pyx_L1_error) + __PYX_ERR(0, 31, __pyx_L1_error) } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_buffer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_buffer.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_buffer.diminfo[1].strides) += (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pv.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_pv.diminfo[0].strides)); - } - /* "yt/utilities/lib/image_utilities.pyx":31 + /* "yt/utilities/lib/image_utilities.pyx":32 * i = (ys * py[pi]) * buffer[i, j] += pv[pi] + * buffer_mask[i, j] = 1 # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_buffer_mask.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_buffer_mask.diminfo[0].shape)) __pyx_t_4 = 0; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_buffer_mask.diminfo[1].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_4 = 1; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_buffer_mask.diminfo[1].shape)) __pyx_t_4 = 1; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + __PYX_ERR(0, 32, __pyx_L1_error) + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_buffer_mask.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_buffer_mask.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_buffer_mask.diminfo[1].strides) = 1; + } + + /* "yt/utilities/lib/image_utilities.pyx":33 + * buffer[i, j] += pv[pi] + * buffer_mask[i, j] = 1 * return # <<<<<<<<<<<<<< * * def add_points_to_image( @@ -1769,7 +1882,7 @@ * * def add_points_to_greyscale_image( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] buffer, - * np.ndarray[np.float64_t, ndim=1] px, + * np.ndarray[np.int_t, ndim=2] buffer_mask, */ /* function exit code */ @@ -1779,6 +1892,7 @@ __Pyx_PyThreadState_assign __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buffer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buffer_mask.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pv.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_px.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_py.rcbuffer->pybuffer); @@ -1788,6 +1902,7 @@ goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buffer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buffer_mask.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pv.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_px.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_py.rcbuffer->pybuffer); @@ -1797,7 +1912,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_utilities.pyx":33 +/* "yt/utilities/lib/image_utilities.pyx":35 * return * * def add_points_to_image( # <<<<<<<<<<<<<< @@ -1824,9 +1939,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -1835,24 +1954,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_points_to_image", 1, 4, 4, 1); __PYX_ERR(0, 33, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_points_to_image", 1, 4, 4, 1); __PYX_ERR(0, 35, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_points_to_image", 1, 4, 4, 2); __PYX_ERR(0, 33, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_points_to_image", 1, 4, 4, 2); __PYX_ERR(0, 35, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pv)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_points_to_image", 1, 4, 4, 3); __PYX_ERR(0, 33, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_points_to_image", 1, 4, 4, 3); __PYX_ERR(0, 35, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_points_to_image") < 0)) __PYX_ERR(0, 33, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_points_to_image") < 0)) __PYX_ERR(0, 35, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -1865,19 +1987,19 @@ __pyx_v_buffer = ((PyArrayObject *)values[0]); __pyx_v_px = ((PyArrayObject *)values[1]); __pyx_v_py = ((PyArrayObject *)values[2]); - __pyx_v_pv = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_pv == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) + __pyx_v_pv = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_pv == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_points_to_image", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 33, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_points_to_image", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.image_utilities.add_points_to_image", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buffer), __pyx_ptype_5numpy_ndarray, 1, "buffer", 0))) __PYX_ERR(0, 34, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_px), __pyx_ptype_5numpy_ndarray, 1, "px", 0))) __PYX_ERR(0, 35, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_py), __pyx_ptype_5numpy_ndarray, 1, "py", 0))) __PYX_ERR(0, 36, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buffer), __pyx_ptype_5numpy_ndarray, 1, "buffer", 0))) __PYX_ERR(0, 36, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_px), __pyx_ptype_5numpy_ndarray, 1, "px", 0))) __PYX_ERR(0, 37, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_py), __pyx_ptype_5numpy_ndarray, 1, "py", 0))) __PYX_ERR(0, 38, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_15image_utilities_2add_points_to_image(__pyx_self, __pyx_v_buffer, __pyx_v_px, __pyx_v_py, __pyx_v_pv); /* function exit code */ @@ -1933,21 +2055,21 @@ __pyx_pybuffernd_py.rcbuffer = &__pyx_pybuffer_py; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_buffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 33, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_buffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 35, __pyx_L1_error) } __pyx_pybuffernd_buffer.diminfo[0].strides = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_buffer.diminfo[0].shape = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_buffer.diminfo[1].strides = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_buffer.diminfo[1].shape = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_buffer.diminfo[2].strides = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_buffer.diminfo[2].shape = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_px.rcbuffer->pybuffer, (PyObject*)__pyx_v_px, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 33, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_px.rcbuffer->pybuffer, (PyObject*)__pyx_v_px, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 35, __pyx_L1_error) } __pyx_pybuffernd_px.diminfo[0].strides = __pyx_pybuffernd_px.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_px.diminfo[0].shape = __pyx_pybuffernd_px.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_py.rcbuffer->pybuffer, (PyObject*)__pyx_v_py, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 33, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_py.rcbuffer->pybuffer, (PyObject*)__pyx_v_py, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 35, __pyx_L1_error) } __pyx_pybuffernd_py.diminfo[0].strides = __pyx_pybuffernd_py.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_py.diminfo[0].shape = __pyx_pybuffernd_py.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/image_utilities.pyx":39 + /* "yt/utilities/lib/image_utilities.pyx":41 * np.float64_t pv): * cdef int i, j, k, pi * cdef int np = px.shape[0] # <<<<<<<<<<<<<< @@ -1956,7 +2078,7 @@ */ __pyx_v_np = (__pyx_v_px->dimensions[0]); - /* "yt/utilities/lib/image_utilities.pyx":40 + /* "yt/utilities/lib/image_utilities.pyx":42 * cdef int i, j, k, pi * cdef int np = px.shape[0] * cdef int xs = buffer.shape[0] # <<<<<<<<<<<<<< @@ -1965,7 +2087,7 @@ */ __pyx_v_xs = (__pyx_v_buffer->dimensions[0]); - /* "yt/utilities/lib/image_utilities.pyx":41 + /* "yt/utilities/lib/image_utilities.pyx":43 * cdef int np = px.shape[0] * cdef int xs = buffer.shape[0] * cdef int ys = buffer.shape[1] # <<<<<<<<<<<<<< @@ -1974,7 +2096,7 @@ */ __pyx_v_ys = (__pyx_v_buffer->dimensions[1]); - /* "yt/utilities/lib/image_utilities.pyx":43 + /* "yt/utilities/lib/image_utilities.pyx":45 * cdef int ys = buffer.shape[1] * cdef int v * v = iclip((pv * 255), 0, 255) # <<<<<<<<<<<<<< @@ -1983,7 +2105,7 @@ */ __pyx_v_v = __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(((int)(__pyx_v_pv * 255.0)), 0, 0xFF); - /* "yt/utilities/lib/image_utilities.pyx":44 + /* "yt/utilities/lib/image_utilities.pyx":46 * cdef int v * v = iclip((pv * 255), 0, 255) * for pi in range(np): # <<<<<<<<<<<<<< @@ -1994,7 +2116,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_pi = __pyx_t_2; - /* "yt/utilities/lib/image_utilities.pyx":45 + /* "yt/utilities/lib/image_utilities.pyx":47 * v = iclip((pv * 255), 0, 255) * for pi in range(np): * j = (xs * px[pi]) # <<<<<<<<<<<<<< @@ -2009,11 +2131,11 @@ } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_px.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 45, __pyx_L1_error) + __PYX_ERR(0, 47, __pyx_L1_error) } __pyx_v_j = ((int)(__pyx_v_xs * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_px.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_px.diminfo[0].strides)))); - /* "yt/utilities/lib/image_utilities.pyx":46 + /* "yt/utilities/lib/image_utilities.pyx":48 * for pi in range(np): * j = (xs * px[pi]) * i = (ys * py[pi]) # <<<<<<<<<<<<<< @@ -2028,11 +2150,11 @@ } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_py.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 46, __pyx_L1_error) + __PYX_ERR(0, 48, __pyx_L1_error) } __pyx_v_i = ((int)(__pyx_v_ys * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_py.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_py.diminfo[0].strides)))); - /* "yt/utilities/lib/image_utilities.pyx":47 + /* "yt/utilities/lib/image_utilities.pyx":49 * j = (xs * px[pi]) * i = (ys * py[pi]) * for k in range(3): # <<<<<<<<<<<<<< @@ -2042,7 +2164,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { __pyx_v_k = __pyx_t_4; - /* "yt/utilities/lib/image_utilities.pyx":48 + /* "yt/utilities/lib/image_utilities.pyx":50 * i = (ys * py[pi]) * for k in range(3): * buffer[i, j, k] = v # <<<<<<<<<<<<<< @@ -2067,12 +2189,12 @@ } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_buffer.diminfo[2].shape)) __pyx_t_9 = 2; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 48, __pyx_L1_error) + __PYX_ERR(0, 50, __pyx_L1_error) } *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_buffer.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_buffer.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_buffer.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_buffer.diminfo[2].strides) = __pyx_v_v; } - /* "yt/utilities/lib/image_utilities.pyx":49 + /* "yt/utilities/lib/image_utilities.pyx":51 * for k in range(3): * buffer[i, j, k] = v * buffer[i, j, 3] = 255 # <<<<<<<<<<<<<< @@ -2097,12 +2219,12 @@ } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_buffer.diminfo[2].shape)) __pyx_t_4 = 2; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 49, __pyx_L1_error) + __PYX_ERR(0, 51, __pyx_L1_error) } *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_buffer.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_buffer.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_buffer.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_buffer.diminfo[2].strides) = 0xFF; } - /* "yt/utilities/lib/image_utilities.pyx":50 + /* "yt/utilities/lib/image_utilities.pyx":52 * buffer[i, j, k] = v * buffer[i, j, 3] = 255 * return # <<<<<<<<<<<<<< @@ -2113,7 +2235,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/utilities/lib/image_utilities.pyx":33 + /* "yt/utilities/lib/image_utilities.pyx":35 * return * * def add_points_to_image( # <<<<<<<<<<<<<< @@ -2144,7 +2266,7 @@ return __pyx_r; } -/* "yt/utilities/lib/image_utilities.pyx":52 +/* "yt/utilities/lib/image_utilities.pyx":54 * return * * def add_rgba_points_to_image( # <<<<<<<<<<<<<< @@ -2172,9 +2294,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -2183,24 +2309,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_rgba_points_to_image", 1, 4, 4, 1); __PYX_ERR(0, 52, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_rgba_points_to_image", 1, 4, 4, 1); __PYX_ERR(0, 54, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_rgba_points_to_image", 1, 4, 4, 2); __PYX_ERR(0, 52, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_rgba_points_to_image", 1, 4, 4, 2); __PYX_ERR(0, 54, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rgba)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_rgba_points_to_image", 1, 4, 4, 3); __PYX_ERR(0, 52, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_rgba_points_to_image", 1, 4, 4, 3); __PYX_ERR(0, 54, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_rgba_points_to_image") < 0)) __PYX_ERR(0, 52, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_rgba_points_to_image") < 0)) __PYX_ERR(0, 54, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -2217,16 +2346,16 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_rgba_points_to_image", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_rgba_points_to_image", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 54, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.image_utilities.add_rgba_points_to_image", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buffer), __pyx_ptype_5numpy_ndarray, 1, "buffer", 0))) __PYX_ERR(0, 53, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_px), __pyx_ptype_5numpy_ndarray, 1, "px", 0))) __PYX_ERR(0, 54, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_py), __pyx_ptype_5numpy_ndarray, 1, "py", 0))) __PYX_ERR(0, 55, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rgba), __pyx_ptype_5numpy_ndarray, 1, "rgba", 0))) __PYX_ERR(0, 56, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buffer), __pyx_ptype_5numpy_ndarray, 1, "buffer", 0))) __PYX_ERR(0, 55, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_px), __pyx_ptype_5numpy_ndarray, 1, "px", 0))) __PYX_ERR(0, 56, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_py), __pyx_ptype_5numpy_ndarray, 1, "py", 0))) __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rgba), __pyx_ptype_5numpy_ndarray, 1, "rgba", 0))) __PYX_ERR(0, 58, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_15image_utilities_4add_rgba_points_to_image(__pyx_self, __pyx_v_buffer, __pyx_v_px, __pyx_v_py, __pyx_v_rgba); /* function exit code */ @@ -2288,26 +2417,26 @@ __pyx_pybuffernd_rgba.rcbuffer = &__pyx_pybuffer_rgba; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_buffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 52, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_buffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 54, __pyx_L1_error) } __pyx_pybuffernd_buffer.diminfo[0].strides = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_buffer.diminfo[0].shape = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_buffer.diminfo[1].strides = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_buffer.diminfo[1].shape = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_buffer.diminfo[2].strides = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_buffer.diminfo[2].shape = __pyx_pybuffernd_buffer.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_px.rcbuffer->pybuffer, (PyObject*)__pyx_v_px, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 52, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_px.rcbuffer->pybuffer, (PyObject*)__pyx_v_px, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 54, __pyx_L1_error) } __pyx_pybuffernd_px.diminfo[0].strides = __pyx_pybuffernd_px.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_px.diminfo[0].shape = __pyx_pybuffernd_px.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_py.rcbuffer->pybuffer, (PyObject*)__pyx_v_py, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 52, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_py.rcbuffer->pybuffer, (PyObject*)__pyx_v_py, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 54, __pyx_L1_error) } __pyx_pybuffernd_py.diminfo[0].strides = __pyx_pybuffernd_py.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_py.diminfo[0].shape = __pyx_pybuffernd_py.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rgba.rcbuffer->pybuffer, (PyObject*)__pyx_v_rgba, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 52, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rgba.rcbuffer->pybuffer, (PyObject*)__pyx_v_rgba, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 54, __pyx_L1_error) } __pyx_pybuffernd_rgba.diminfo[0].strides = __pyx_pybuffernd_rgba.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rgba.diminfo[0].shape = __pyx_pybuffernd_rgba.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rgba.diminfo[1].strides = __pyx_pybuffernd_rgba.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rgba.diminfo[1].shape = __pyx_pybuffernd_rgba.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/image_utilities.pyx":67 + /* "yt/utilities/lib/image_utilities.pyx":69 * """ * cdef int i, j, k, pi * cdef int npart = px.shape[0] # <<<<<<<<<<<<<< @@ -2316,7 +2445,7 @@ */ __pyx_v_npart = (__pyx_v_px->dimensions[0]); - /* "yt/utilities/lib/image_utilities.pyx":68 + /* "yt/utilities/lib/image_utilities.pyx":70 * cdef int i, j, k, pi * cdef int npart = px.shape[0] * cdef int xs = buffer.shape[0] # <<<<<<<<<<<<<< @@ -2325,7 +2454,7 @@ */ __pyx_v_xs = (__pyx_v_buffer->dimensions[0]); - /* "yt/utilities/lib/image_utilities.pyx":69 + /* "yt/utilities/lib/image_utilities.pyx":71 * cdef int npart = px.shape[0] * cdef int xs = buffer.shape[0] * cdef int ys = buffer.shape[1] # <<<<<<<<<<<<<< @@ -2334,7 +2463,7 @@ */ __pyx_v_ys = (__pyx_v_buffer->dimensions[1]); - /* "yt/utilities/lib/image_utilities.pyx":71 + /* "yt/utilities/lib/image_utilities.pyx":73 * cdef int ys = buffer.shape[1] * #iv = iclip((pv * 255), 0, 255) * for pi in range(npart): # <<<<<<<<<<<<<< @@ -2345,7 +2474,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_pi = __pyx_t_2; - /* "yt/utilities/lib/image_utilities.pyx":72 + /* "yt/utilities/lib/image_utilities.pyx":74 * #iv = iclip((pv * 255), 0, 255) * for pi in range(npart): * j = (xs * px[pi]) # <<<<<<<<<<<<<< @@ -2360,11 +2489,11 @@ } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_px.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 72, __pyx_L1_error) + __PYX_ERR(0, 74, __pyx_L1_error) } __pyx_v_j = ((int)(__pyx_v_xs * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_px.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_px.diminfo[0].strides)))); - /* "yt/utilities/lib/image_utilities.pyx":73 + /* "yt/utilities/lib/image_utilities.pyx":75 * for pi in range(npart): * j = (xs * px[pi]) * i = (ys * py[pi]) # <<<<<<<<<<<<<< @@ -2379,11 +2508,11 @@ } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_py.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 73, __pyx_L1_error) + __PYX_ERR(0, 75, __pyx_L1_error) } __pyx_v_i = ((int)(__pyx_v_ys * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_py.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_py.diminfo[0].strides)))); - /* "yt/utilities/lib/image_utilities.pyx":74 + /* "yt/utilities/lib/image_utilities.pyx":76 * j = (xs * px[pi]) * i = (ys * py[pi]) * if i < 0 or j < 0 or i >= xs or j >= ys: # <<<<<<<<<<<<<< @@ -2413,7 +2542,7 @@ __pyx_L6_bool_binop_done:; if (__pyx_t_6) { - /* "yt/utilities/lib/image_utilities.pyx":75 + /* "yt/utilities/lib/image_utilities.pyx":77 * i = (ys * py[pi]) * if i < 0 or j < 0 or i >= xs or j >= ys: * continue # <<<<<<<<<<<<<< @@ -2422,7 +2551,7 @@ */ goto __pyx_L3_continue; - /* "yt/utilities/lib/image_utilities.pyx":74 + /* "yt/utilities/lib/image_utilities.pyx":76 * j = (xs * px[pi]) * i = (ys * py[pi]) * if i < 0 or j < 0 or i >= xs or j >= ys: # <<<<<<<<<<<<<< @@ -2431,7 +2560,7 @@ */ } - /* "yt/utilities/lib/image_utilities.pyx":76 + /* "yt/utilities/lib/image_utilities.pyx":78 * if i < 0 or j < 0 or i >= xs or j >= ys: * continue * for k in range(4): # <<<<<<<<<<<<<< @@ -2441,7 +2570,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 4; __pyx_t_4+=1) { __pyx_v_k = __pyx_t_4; - /* "yt/utilities/lib/image_utilities.pyx":77 + /* "yt/utilities/lib/image_utilities.pyx":79 * continue * for k in range(4): * buffer[i, j, k] += rgba[pi, k] # <<<<<<<<<<<<<< @@ -2460,7 +2589,7 @@ } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_rgba.diminfo[1].shape)) __pyx_t_10 = 1; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 77, __pyx_L1_error) + __PYX_ERR(0, 79, __pyx_L1_error) } __pyx_t_11 = __pyx_v_i; __pyx_t_12 = __pyx_v_j; @@ -2480,14 +2609,14 @@ } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_buffer.diminfo[2].shape)) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 77, __pyx_L1_error) + __PYX_ERR(0, 79, __pyx_L1_error) } *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_buffer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_buffer.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_buffer.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_buffer.diminfo[2].strides) += (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rgba.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_rgba.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_rgba.diminfo[1].strides)); } __pyx_L3_continue:; } - /* "yt/utilities/lib/image_utilities.pyx":78 + /* "yt/utilities/lib/image_utilities.pyx":80 * for k in range(4): * buffer[i, j, k] += rgba[pi, k] * return # <<<<<<<<<<<<<< @@ -2496,7 +2625,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/utilities/lib/image_utilities.pyx":52 + /* "yt/utilities/lib/image_utilities.pyx":54 * return * * def add_rgba_points_to_image( # <<<<<<<<<<<<<< @@ -2529,3008 +2658,3008 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "yt/utilities/lib/fp_utils.pxd":20 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * if info == NULL: return # <<<<<<<<<<<<<< * + * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; + __pyx_r = 0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ + __pyx_v_endian_detector = 1; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * ndim = PyArray_NDIM(self) */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":24 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline int imin(int i0, int i1) nogil: + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ + __pyx_v_copy_shape = 1; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; + } -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + /*else*/ { + __pyx_v_copy_shape = 0; } + __pyx_L4:; - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * 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_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + * 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") * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * 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, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 218, __pyx_L1_error) - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * 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") */ + } -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); - if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; } - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 * - * cdef inline int iclip(int i, int a, int b) nogil: - */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + * 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") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + if (__pyx_t_1) { -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":40 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + * info.buf = PyArray_DATA(self) */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 222, __pyx_L1_error) - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ + __pyx_v_info->ndim = __pyx_v_ndim; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fclip(np.float64_t f, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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_r = __pyx_v_i; - goto __pyx_L0; + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + goto __pyx_L11; + } -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * 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)); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + __pyx_v_info->suboffsets = NULL; - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + * cdef int t */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":54 - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + __pyx_v_f = NULL; - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __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; - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + goto __pyx_L14; } - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * + * if not hasfields: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L14:; - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ - __pyx_v_endian_detector = 1; + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - __pyx_v_copy_shape = 1; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 259, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - goto __pyx_L4; - } + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - if (__pyx_t_1) { + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ - if (__pyx_t_1) { + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - } + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ - __pyx_v_info->ndim = __pyx_v_ndim; + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * 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: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return */ - goto __pyx_L11; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * 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)); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 278, __pyx_L1_error) + break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return * 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_L11:; + __pyx_v_info->format = __pyx_v_f; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) */ - __pyx_v_info->suboffsets = NULL; + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, */ - __pyx_v_f = NULL; + (__pyx_v_info->format[0]) = '^'; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ - __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_offset = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; + (__pyx_v_f[0]) = '\x00'; } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - goto __pyx_L14; + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * if not hasfields: + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + free(__pyx_v_info->format); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * */ - if (__pyx_t_1) { + free(__pyx_v_info->strides); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; + __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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; + __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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * 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_v_info->format = __pyx_v_f; + __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, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - __pyx_r = 0; - goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - (__pyx_v_info->format[0]) = '^'; + __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, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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_r = 0; - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * 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. */ -/* 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) { +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 - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); + 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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * */ - free(__pyx_v_info->format); + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * 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, 794, __pyx_L1_error) } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< * + * if (end - f) - (new_offset - offset[0]) < 15: */ - free(__pyx_v_info->strides); + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * 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, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 799, __pyx_L1_error) - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ + } -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * cdef inline object PyArray_MultiIterNew2(a, b): + * 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_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 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:; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + if (__pyx_t_6) { -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 803, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * cdef inline object PyArray_MultiIterNew3(a, b, c): + * 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_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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 0x78; -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 * */ + __pyx_v_f = (__pyx_v_f + 1); -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * offset[0] += child.itemsize */ - __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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + * 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); - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ - __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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * + * # Until ticket #99 is fixed, use integers to avoid warnings */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 823, __pyx_L1_error) -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_v_endian_detector = 1; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" */ - if (unlikely(__pyx_v_descr->fields == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_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:; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_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:; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - if (__pyx_t_6) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - } + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - (__pyx_v_f[0]) = 0x78; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize + * else: */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } + /*else*/ { + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 844, __pyx_L1_error) + } + __pyx_L15:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< * t = child.type_num * if end - f < 5: */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { + goto __pyx_L13; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f * - * 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, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * * - * # 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, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_r = __pyx_v_f; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * # 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" + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } + __pyx_v_baseptr = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * 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; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } + } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } + } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: + /* 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; +} + +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - goto __pyx_L13; - } + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":24 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields */ + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_r = __pyx_v_f; + __pyx_r = __pyx_v_f1; goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * - * 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. + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_v_baseptr = NULL; + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - goto __pyx_L3; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * 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); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 * */ - Py_XDECREF(__pyx_v_arr->base); + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ /* function exit code */ - __Pyx_RefNannyFinishContext(); + __pyx_L0:; + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/utilities/lib/fp_utils.pxd":36 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 * - * 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); + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; + __pyx_r = (-__pyx_v_f0); goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } + __pyx_r = __pyx_v_f0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_array", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":40 * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * - * 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, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - { - __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:*/ { + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.float64_t fclip(np.float64_t f, */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_ufunc() except -1: + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * 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:*/ { + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":58 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* 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; } @@ -5562,12 +5691,13 @@ {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_add_points_to_greyscale_image, __pyx_k_add_points_to_greyscale_image, sizeof(__pyx_k_add_points_to_greyscale_image), 0, 0, 1, 1}, {&__pyx_n_s_add_points_to_image, __pyx_k_add_points_to_image, sizeof(__pyx_k_add_points_to_image), 0, 0, 1, 1}, {&__pyx_n_s_add_rgba_points_to_image, __pyx_k_add_rgba_points_to_image, sizeof(__pyx_k_add_rgba_points_to_image), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_buffer_mask, __pyx_k_buffer_mask, sizeof(__pyx_k_buffer_mask), 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_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, @@ -5591,11 +5721,12 @@ {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, {&__pyx_n_s_xs, __pyx_k_xs, sizeof(__pyx_k_xs), 0, 0, 1, 1}, {&__pyx_n_s_ys, __pyx_k_ys, sizeof(__pyx_k_ys), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_image_utilities, __pyx_k_yt_utilities_lib_image_utilities, sizeof(__pyx_k_yt_utilities_lib_image_utilities), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_image_utilities, __pyx_k_yt_utilities_lib_image_utilities, sizeof(__pyx_k_yt_utilities_lib_image_utilities), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_image_utilities_2, __pyx_k_yt_utilities_lib_image_utilities_2, sizeof(__pyx_k_yt_utilities_lib_image_utilities_2), 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, 27, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) @@ -5710,36 +5841,36 @@ * * def add_points_to_greyscale_image( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] buffer, - * np.ndarray[np.float64_t, ndim=1] px, + * np.ndarray[np.int_t, ndim=2] buffer_mask, */ - __pyx_tuple__10 = PyTuple_Pack(10, __pyx_n_s_buffer, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_pi, __pyx_n_s_np, __pyx_n_s_xs, __pyx_n_s_ys); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(11, __pyx_n_s_buffer, __pyx_n_s_buffer_mask, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_pi, __pyx_n_s_np, __pyx_n_s_xs, __pyx_n_s_ys); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_add_points_to_greyscale_image, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_image_utilities, __pyx_n_s_add_points_to_greyscale_image, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 18, __pyx_L1_error) - /* "yt/utilities/lib/image_utilities.pyx":33 + /* "yt/utilities/lib/image_utilities.pyx":35 * return * * def add_points_to_image( # <<<<<<<<<<<<<< * np.ndarray[np.uint8_t, ndim=3] buffer, * np.ndarray[np.float64_t, ndim=1] px, */ - __pyx_tuple__12 = PyTuple_Pack(12, __pyx_n_s_buffer, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_pi, __pyx_n_s_np, __pyx_n_s_xs, __pyx_n_s_ys, __pyx_n_s_v); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(12, __pyx_n_s_buffer, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_pi, __pyx_n_s_np, __pyx_n_s_xs, __pyx_n_s_ys, __pyx_n_s_v); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_add_points_to_image, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_image_utilities, __pyx_n_s_add_points_to_image, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 35, __pyx_L1_error) - /* "yt/utilities/lib/image_utilities.pyx":52 + /* "yt/utilities/lib/image_utilities.pyx":54 * return * * def add_rgba_points_to_image( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=3] buffer, * np.ndarray[np.float64_t, ndim=1] px, */ - __pyx_tuple__14 = PyTuple_Pack(11, __pyx_n_s_buffer, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_rgba, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_pi, __pyx_n_s_npart, __pyx_n_s_xs, __pyx_n_s_ys); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(11, __pyx_n_s_buffer, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_rgba, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_pi, __pyx_n_s_npart, __pyx_n_s_xs, __pyx_n_s_ys); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_add_rgba_points_to_image, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_image_utilities, __pyx_n_s_add_rgba_points_to_image, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -5810,6 +5941,7 @@ __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 @@ -5875,35 +6007,35 @@ * * def add_points_to_greyscale_image( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] buffer, - * np.ndarray[np.float64_t, ndim=1] px, + * np.ndarray[np.int_t, ndim=2] buffer_mask, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15image_utilities_1add_points_to_greyscale_image, NULL, __pyx_n_s_yt_utilities_lib_image_utilities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15image_utilities_1add_points_to_greyscale_image, NULL, __pyx_n_s_yt_utilities_lib_image_utilities_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_points_to_greyscale_image, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/image_utilities.pyx":33 + /* "yt/utilities/lib/image_utilities.pyx":35 * return * * def add_points_to_image( # <<<<<<<<<<<<<< * np.ndarray[np.uint8_t, ndim=3] buffer, * np.ndarray[np.float64_t, ndim=1] px, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15image_utilities_3add_points_to_image, NULL, __pyx_n_s_yt_utilities_lib_image_utilities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15image_utilities_3add_points_to_image, NULL, __pyx_n_s_yt_utilities_lib_image_utilities_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_points_to_image, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_points_to_image, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/image_utilities.pyx":52 + /* "yt/utilities/lib/image_utilities.pyx":54 * return * * def add_rgba_points_to_image( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=3] buffer, * np.ndarray[np.float64_t, ndim=1] px, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15image_utilities_5add_rgba_points_to_image, NULL, __pyx_n_s_yt_utilities_lib_image_utilities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15image_utilities_5add_rgba_points_to_image, NULL, __pyx_n_s_yt_utilities_lib_image_utilities_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_rgba_points_to_image, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_rgba_points_to_image, __pyx_t_1) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "yt/utilities/lib/image_utilities.pyx":1 @@ -5916,12 +6048,12 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /*--- Wrapped vars code ---*/ @@ -5931,7 +6063,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.image_utilities", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.image_utilities", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -7110,6 +7242,40 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; @@ -7250,12 +7416,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -8220,6 +8389,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -8228,11 +8399,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/image_utilities.pyx yt-3.4.0/yt/utilities/lib/image_utilities.pyx --- yt-3.3.3/yt/utilities/lib/image_utilities.pyx 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/image_utilities.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -17,6 +17,7 @@ def add_points_to_greyscale_image( np.ndarray[np.float64_t, ndim=2] buffer, + np.ndarray[np.int_t, ndim=2] buffer_mask, np.ndarray[np.float64_t, ndim=1] px, np.ndarray[np.float64_t, ndim=1] py, np.ndarray[np.float64_t, ndim=1] pv): @@ -28,6 +29,7 @@ j = (xs * px[pi]) i = (ys * py[pi]) buffer[i, j] += pv[pi] + buffer_mask[i, j] = 1 return def add_points_to_image( diff -Nru yt-3.3.3/yt/utilities/lib/interpolators.c yt-3.4.0/yt/utilities/lib/interpolators.c --- yt-3.3.3/yt/utilities/lib/interpolators.c 2016-12-12 01:41:50.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/interpolators.c 2017-08-10 18:20:42.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,6 +6,10 @@ "depends": [], "libraries": [ "m" + ], + "name": "yt.utilities.lib.interpolators", + "sources": [ + "yt/utilities/lib/interpolators.pyx" ] }, "module_name": "yt.utilities.lib.interpolators" @@ -19,7 +23,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -41,6 +45,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -193,16 +198,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -329,6 +338,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -383,6 +398,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -490,8 +534,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -504,8 +548,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -627,10 +674,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1061,7 +1110,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) /* PyThreadStateGet.proto */ @@ -1163,6 +1212,9 @@ /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1379,11 +1431,11 @@ /* Module declarations from 'cython' */ /* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ /* Module declarations from 'yt.utilities.lib.interpolators' */ @@ -1451,13 +1503,13 @@ static const char __pyx_k_output_left[] = "output_left"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_output_field[] = "output_field"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Simple_interpolators[] = "\nSimple interpolators\n\n\n\n"; static const char __pyx_k_BilinearlyInterpolate[] = "BilinearlyInterpolate"; static const char __pyx_k_TrilinearlyInterpolate[] = "TrilinearlyInterpolate"; static const char __pyx_k_UnilinearlyInterpolate[] = "UnilinearlyInterpolate"; static const char __pyx_k_ghost_zone_interpolate[] = "ghost_zone_interpolate"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/interpolators.pyx"; static const char __pyx_k_yt_utilities_lib_interpolators[] = "yt.utilities.lib.interpolators"; 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)"; @@ -1465,6 +1517,7 @@ static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_utilities_lib_interpolators_p[] = "yt/utilities/lib/interpolators.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_n_s_BilinearlyInterpolate; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; @@ -1474,8 +1527,8 @@ static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_TrilinearlyInterpolate; static PyObject *__pyx_n_s_UnilinearlyInterpolate; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_dx_inv; static PyObject *__pyx_n_s_dy_inv; static PyObject *__pyx_n_s_dz_inv; @@ -1526,6 +1579,7 @@ static PyObject *__pyx_n_s_ym; static PyObject *__pyx_n_s_yp; static PyObject *__pyx_n_s_yt_utilities_lib_interpolators; +static PyObject *__pyx_kp_s_yt_utilities_lib_interpolators_p; static PyObject *__pyx_n_s_z; static PyObject *__pyx_n_s_z_bins; static PyObject *__pyx_n_s_z_i; @@ -1585,10 +1639,15 @@ 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; } @@ -1597,21 +1656,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_vals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("UnilinearlyInterpolate", 1, 5, 5, 1); __PYX_ERR(0, 24, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_bins)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("UnilinearlyInterpolate", 1, 5, 5, 2); __PYX_ERR(0, 24, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_is)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("UnilinearlyInterpolate", 1, 5, 5, 3); __PYX_ERR(0, 24, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output)) != 0)) kw_args--; else { @@ -1919,13 +1982,21 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -1934,36 +2005,43 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_vals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("BilinearlyInterpolate", 1, 8, 8, 1); __PYX_ERR(0, 43, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_vals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("BilinearlyInterpolate", 1, 8, 8, 2); __PYX_ERR(0, 43, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_bins)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("BilinearlyInterpolate", 1, 8, 8, 3); __PYX_ERR(0, 43, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_bins)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("BilinearlyInterpolate", 1, 8, 8, 4); __PYX_ERR(0, 43, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_is)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("BilinearlyInterpolate", 1, 8, 8, 5); __PYX_ERR(0, 43, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_is)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("BilinearlyInterpolate", 1, 8, 8, 6); __PYX_ERR(0, 43, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output)) != 0)) kw_args--; else { @@ -2389,16 +2467,27 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -2407,51 +2496,61 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_vals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("TrilinearlyInterpolate", 1, 11, 11, 1); __PYX_ERR(0, 74, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_vals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("TrilinearlyInterpolate", 1, 11, 11, 2); __PYX_ERR(0, 74, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z_vals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("TrilinearlyInterpolate", 1, 11, 11, 3); __PYX_ERR(0, 74, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_bins)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("TrilinearlyInterpolate", 1, 11, 11, 4); __PYX_ERR(0, 74, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_bins)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("TrilinearlyInterpolate", 1, 11, 11, 5); __PYX_ERR(0, 74, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z_bins)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("TrilinearlyInterpolate", 1, 11, 11, 6); __PYX_ERR(0, 74, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_is)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("TrilinearlyInterpolate", 1, 11, 11, 7); __PYX_ERR(0, 74, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_is)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("TrilinearlyInterpolate", 1, 11, 11, 8); __PYX_ERR(0, 74, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z_is)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("TrilinearlyInterpolate", 1, 11, 11, 9); __PYX_ERR(0, 74, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output)) != 0)) kw_args--; else { @@ -3045,10 +3144,15 @@ 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; } @@ -3057,21 +3161,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rf)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ghost_zone_interpolate", 1, 5, 5, 1); __PYX_ERR(0, 118, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_left)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ghost_zone_interpolate", 1, 5, 5, 2); __PYX_ERR(0, 118, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ghost_zone_interpolate", 1, 5, 5, 3); __PYX_ERR(0, 118, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_left)) != 0)) kw_args--; else { @@ -3630,3008 +3738,3008 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "yt/utilities/lib/fp_utils.pxd":20 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * if info == NULL: return # <<<<<<<<<<<<<< * + * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; + __pyx_r = 0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_v_endian_detector = 1; - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + * ndim = PyArray_NDIM(self) */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":24 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * - * cdef inline int imin(int i0, int i1) nogil: + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_v_copy_shape = 1; - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; } - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * 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, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 218, __pyx_L1_error) -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * 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_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + * 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") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * info.buf = PyArray_DATA(self) */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 222, __pyx_L1_error) - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * 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") */ + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":40 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_v_info->ndim = __pyx_v_ndim; - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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]); - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; + goto __pyx_L11; } - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fclip(np.float64_t f, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + /*else*/ { + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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; -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; - - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * cdef int t */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ + __pyx_v_f = NULL; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ + __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; -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":54 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< * + * if not hasfields and not copy_shape: */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + goto __pyx_L14; + } -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * + * if not hasfields: */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); } + __pyx_L14:; - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; -/* 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)); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (__pyx_t_1) { -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 259, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_endian_detector = 1; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - __pyx_v_copy_shape = 1; + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ - goto __pyx_L4; - } + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - if (__pyx_t_1) { + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ - } + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ - } + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - __pyx_v_info->ndim = __pyx_v_ndim; + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 278, __pyx_L1_error) + break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return * else: */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + __pyx_v_info->format = __pyx_v_f; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< * else: - * info.strides = PyArray_STRIDES(self) + * info.format = stdlib.malloc(_buffer_format_string_len) */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - goto __pyx_L11; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; + (__pyx_v_info->format[0]) = '^'; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ - __pyx_v_info->suboffsets = NULL; + __pyx_v_offset = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< * - * cdef int t + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + (__pyx_v_f[0]) = '\x00'; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - __pyx_v_f = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * if not hasfields and not copy_shape: + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None */ - goto __pyx_L14; + free(__pyx_v_info->strides); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * if not hasfields: + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * 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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; + __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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * 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): */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; + __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, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) + * */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; + __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, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) + * */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ - __pyx_v_info->format = __pyx_v_f; + __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * */ - __pyx_r = 0; - goto __pyx_L0; + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * 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, 794, __pyx_L1_error) } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) */ + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * 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_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 799, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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") + * */ - free(__pyx_v_info->format); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - } + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + __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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - free(__pyx_v_info->strides); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply */ - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 803, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + } - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 * */ + __pyx_v_f = (__pyx_v_f + 1); - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< * + * offset[0] += child.itemsize */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * offset[0] += child.itemsize # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew3(a, b, c): + * if not PyDataType_HASFIELDS(child): */ - __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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * 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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * + * # Until ticket #99 is fixed, use integers to avoid warnings */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 823, __pyx_L1_error) - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * */ + } -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * # 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_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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" */ - __Pyx_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, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_v_endian_detector = 1; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - if (unlikely(__pyx_v_descr->fields == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); - if (!__pyx_t_7) { - goto __pyx_L8_next_or; - } else { - } - __pyx_t_7 = (__pyx_v_little_endian != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_L8_next_or:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 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:; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - if (__pyx_t_6) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - } + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 0x78; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize + * else: */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } + /*else*/ { + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 844, __pyx_L1_error) + } + __pyx_L15:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< * t = child.type_num * if end - f < 5: */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { + goto __pyx_L13; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f * - * 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, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * * - * # 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, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_r = __pyx_v_f; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * # 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" + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } + __pyx_v_baseptr = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } + /*else*/ { + Py_INCREF(__pyx_v_base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } + Py_XDECREF(__pyx_v_arr->base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } + __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * 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; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } + } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* 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; +} + +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - goto __pyx_L13; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":24 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields */ + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_r = __pyx_v_f; + __pyx_r = __pyx_v_f1; goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * - * 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. + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_v_baseptr = NULL; + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - goto __pyx_L3; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * 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); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 * */ - Py_XDECREF(__pyx_v_arr->base); + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ /* function exit code */ - __Pyx_RefNannyFinishContext(); + __pyx_L0:; + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/utilities/lib/fp_utils.pxd":36 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 * - * 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); + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; + __pyx_r = (-__pyx_v_f0); goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } + __pyx_r = __pyx_v_f0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_array", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":40 * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * - * 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, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - { - __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:*/ { + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.float64_t fclip(np.float64_t f, */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b + */ - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_ufunc() except -1: + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * 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:*/ { + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":58 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* 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; } @@ -6666,8 +6774,8 @@ {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_TrilinearlyInterpolate, __pyx_k_TrilinearlyInterpolate, sizeof(__pyx_k_TrilinearlyInterpolate), 0, 0, 1, 1}, {&__pyx_n_s_UnilinearlyInterpolate, __pyx_k_UnilinearlyInterpolate, sizeof(__pyx_k_UnilinearlyInterpolate), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 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_dx_inv, __pyx_k_dx_inv, sizeof(__pyx_k_dx_inv), 0, 0, 1, 1}, {&__pyx_n_s_dy_inv, __pyx_k_dy_inv, sizeof(__pyx_k_dy_inv), 0, 0, 1, 1}, {&__pyx_n_s_dz_inv, __pyx_k_dz_inv, sizeof(__pyx_k_dz_inv), 0, 0, 1, 1}, @@ -6718,6 +6826,7 @@ {&__pyx_n_s_ym, __pyx_k_ym, sizeof(__pyx_k_ym), 0, 0, 1, 1}, {&__pyx_n_s_yp, __pyx_k_yp, sizeof(__pyx_k_yp), 0, 0, 1, 1}, {&__pyx_n_s_yt_utilities_lib_interpolators, __pyx_k_yt_utilities_lib_interpolators, sizeof(__pyx_k_yt_utilities_lib_interpolators), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_interpolators_p, __pyx_k_yt_utilities_lib_interpolators_p, sizeof(__pyx_k_yt_utilities_lib_interpolators_p), 0, 0, 1, 0}, {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, {&__pyx_n_s_z_bins, __pyx_k_z_bins, sizeof(__pyx_k_z_bins), 0, 0, 1, 1}, {&__pyx_n_s_z_i, __pyx_k_z_i, sizeof(__pyx_k_z_i), 0, 0, 1, 1}, @@ -6848,7 +6957,7 @@ __pyx_tuple__10 = PyTuple_Pack(11, __pyx_n_s_table, __pyx_n_s_x_vals, __pyx_n_s_x_bins, __pyx_n_s_x_is, __pyx_n_s_output, __pyx_n_s_x, __pyx_n_s_xp, __pyx_n_s_xm, __pyx_n_s_i, __pyx_n_s_x_i, __pyx_n_s_dx_inv); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_UnilinearlyInterpolate, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_interpolators_p, __pyx_n_s_UnilinearlyInterpolate, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 24, __pyx_L1_error) /* "yt/utilities/lib/interpolators.pyx":43 * @cython.wraparound(False) @@ -6860,7 +6969,7 @@ __pyx_tuple__12 = PyTuple_Pack(19, __pyx_n_s_table, __pyx_n_s_x_vals, __pyx_n_s_y_vals, __pyx_n_s_x_bins, __pyx_n_s_y_bins, __pyx_n_s_x_is, __pyx_n_s_y_is, __pyx_n_s_output, __pyx_n_s_x, __pyx_n_s_xp, __pyx_n_s_xm, __pyx_n_s_y, __pyx_n_s_yp, __pyx_n_s_ym, __pyx_n_s_dx_inv, __pyx_n_s_dy_inv, __pyx_n_s_i, __pyx_n_s_x_i, __pyx_n_s_y_i); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(8, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_BilinearlyInterpolate, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(8, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_interpolators_p, __pyx_n_s_BilinearlyInterpolate, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 43, __pyx_L1_error) /* "yt/utilities/lib/interpolators.pyx":74 * @cython.wraparound(False) @@ -6872,7 +6981,7 @@ __pyx_tuple__14 = PyTuple_Pack(27, __pyx_n_s_table, __pyx_n_s_x_vals, __pyx_n_s_y_vals, __pyx_n_s_z_vals, __pyx_n_s_x_bins, __pyx_n_s_y_bins, __pyx_n_s_z_bins, __pyx_n_s_x_is, __pyx_n_s_y_is, __pyx_n_s_z_is, __pyx_n_s_output, __pyx_n_s_x, __pyx_n_s_xp, __pyx_n_s_xm, __pyx_n_s_y, __pyx_n_s_yp, __pyx_n_s_ym, __pyx_n_s_z, __pyx_n_s_zp, __pyx_n_s_zm, __pyx_n_s_dx_inv, __pyx_n_s_dy_inv, __pyx_n_s_dz_inv, __pyx_n_s_i, __pyx_n_s_x_i, __pyx_n_s_y_i, __pyx_n_s_z_i); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(11, 0, 27, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_TrilinearlyInterpolate, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(11, 0, 27, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_interpolators_p, __pyx_n_s_TrilinearlyInterpolate, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 74, __pyx_L1_error) /* "yt/utilities/lib/interpolators.pyx":118 * @cython.wraparound(False) @@ -6884,7 +6993,7 @@ __pyx_tuple__16 = PyTuple_Pack(24, __pyx_n_s_rf, __pyx_n_s_input_field, __pyx_n_s_input_left, __pyx_n_s_output_field, __pyx_n_s_output_left, __pyx_n_s_oi, __pyx_n_s_oj, __pyx_n_s_ok, __pyx_n_s_ii, __pyx_n_s_ij, __pyx_n_s_ik, __pyx_n_s_xp, __pyx_n_s_xm, __pyx_n_s_yp, __pyx_n_s_ym, __pyx_n_s_zp, __pyx_n_s_zm, __pyx_n_s_temp, __pyx_n_s_ods, __pyx_n_s_ids, __pyx_n_s_iids, __pyx_n_s_opos, __pyx_n_s_ropos, __pyx_n_s_i); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(5, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_ghost_zone_interpolate, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(5, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_interpolators_p, __pyx_n_s_ghost_zone_interpolate, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -6955,6 +7064,7 @@ __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 @@ -7073,12 +7183,12 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /*--- Wrapped vars code ---*/ @@ -7088,7 +7198,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.interpolators", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.interpolators", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -8261,6 +8371,40 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; @@ -8401,12 +8545,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -9402,6 +9549,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -9410,11 +9559,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/kdtree.c yt-3.4.0/yt/utilities/lib/kdtree.c --- yt-3.3.3/yt/utilities/lib/kdtree.c 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/kdtree.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,761 +0,0 @@ -/* -This file is part of ``kdtree'', a library for working with kd-trees. -Copyright (C) 2007-2011 John Tsiombikas - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY -OF SUCH DAMAGE. -*/ -/* single nearest neighbor search written by Tamas Nepusz */ -#include -#include -#include -#include -#include "kdtree.h" - -#ifdef MS_WIN32 -#include -#endif - -#ifdef USE_LIST_NODE_ALLOCATOR - -#ifndef NO_PTHREADS -#include -#else - -#ifndef I_WANT_THREAD_BUGS -#error "You are compiling with the fast list node allocator, with pthreads disabled! This WILL break if used from multiple threads." -#endif /* I want thread bugs */ - -#endif /* pthread support */ -#endif /* use list node allocator */ - -struct kdhyperrect { - int dim; - npy_float64 *min, *max; /* minimum/maximum coords */ -}; - -struct kdnode { - npy_float64 *pos; - int dir; - void *data; - - struct kdnode *left, *right; /* negative/positive side */ -}; - -struct res_node { - struct kdnode *item; - npy_float64 dist_sq; - struct res_node *next; -}; - -struct kdtree { - int dim; - struct kdnode *root; - struct kdhyperrect *rect; - void (*destr)(void*); -}; - -struct kdres { - struct kdtree *tree; - struct res_node *rlist, *riter; - int size; -}; - -#define SQ(x) ((x) * (x)) - - -static void clear_rec(struct kdnode *node, void (*destr)(void*)); -static int insert_rec(struct kdnode **node, const npy_float64 *pos, void *data, int dir, int dim); -static int rlist_insert(struct res_node *list, struct kdnode *item, npy_float64 dist_sq); -static void clear_results(struct kdres *set); - -static struct kdhyperrect* hyperrect_create(int dim, const npy_float64 *min, const npy_float64 *max); -static void hyperrect_free(struct kdhyperrect *rect); -static struct kdhyperrect* hyperrect_duplicate(const struct kdhyperrect *rect); -static void hyperrect_extend(struct kdhyperrect *rect, const npy_float64 *pos); -static npy_float64 hyperrect_dist_sq(struct kdhyperrect *rect, const npy_float64 *pos); - -#ifdef USE_LIST_NODE_ALLOCATOR -static struct res_node *alloc_resnode(void); -static void free_resnode(struct res_node*); -#else -#define alloc_resnode() malloc(sizeof(struct res_node)) -#define free_resnode(n) free(n) -#endif - - - -struct kdtree *kd_create(int k) -{ - struct kdtree *tree; - - if(!(tree = malloc(sizeof *tree))) { - return 0; - } - - tree->dim = k; - tree->root = 0; - tree->destr = 0; - tree->rect = 0; - - return tree; -} - -void kd_free(struct kdtree *tree) -{ - if(tree) { - kd_clear(tree); - free(tree); - } -} - -static void clear_rec(struct kdnode *node, void (*destr)(void*)) -{ - if(!node) return; - - clear_rec(node->left, destr); - clear_rec(node->right, destr); - - if(destr) { - destr(node->data); - } - free(node->pos); - free(node); -} - -void kd_clear(struct kdtree *tree) -{ - clear_rec(tree->root, tree->destr); - tree->root = 0; - - if (tree->rect) { - hyperrect_free(tree->rect); - tree->rect = 0; - } -} - -void kd_data_destructor(struct kdtree *tree, void (*destr)(void*)) -{ - tree->destr = destr; -} - - -static int insert_rec(struct kdnode **nptr, const npy_float64 *pos, void *data, int dir, int dim) -{ - int new_dir; - struct kdnode *node; - - if(!*nptr) { - if(!(node = malloc(sizeof *node))) { - return -1; - } - if(!(node->pos = malloc(dim * sizeof *node->pos))) { - free(node); - return -1; - } - memcpy(node->pos, pos, dim * sizeof *node->pos); - node->data = data; - node->dir = dir; - node->left = node->right = 0; - *nptr = node; - return 0; - } - - node = *nptr; - new_dir = (node->dir + 1) % dim; - if(pos[node->dir] < node->pos[node->dir]) { - return insert_rec(&(*nptr)->left, pos, data, new_dir, dim); - } - return insert_rec(&(*nptr)->right, pos, data, new_dir, dim); -} - -int kd_insert(struct kdtree *tree, const npy_float64 *pos, void *data) -{ - if (insert_rec(&tree->root, pos, data, 0, tree->dim)) { - return -1; - } - - if (tree->rect == 0) { - tree->rect = hyperrect_create(tree->dim, pos, pos); - } else { - hyperrect_extend(tree->rect, pos); - } - - return 0; -} - -int kd_insertf(struct kdtree *tree, const float *pos, void *data) -{ - static npy_float64 sbuf[16]; - npy_float64 *bptr, *buf = 0; - int res, dim = tree->dim; - - if(dim > 16) { -#ifndef NO_ALLOCA - if(dim <= 256) - bptr = buf = alloca(dim * sizeof *bptr); - else -#endif - if(!(bptr = buf = malloc(dim * sizeof *bptr))) { - return -1; - } - } else { - bptr = sbuf; - } - - while(dim-- > 0) { - *bptr++ = *pos++; - } - - res = kd_insert(tree, buf, data); -#ifndef NO_ALLOCA - if(tree->dim > 256) -#else - if(tree->dim > 16) -#endif - free(buf); - return res; -} - -int kd_insert3(struct kdtree *tree, npy_float64 x, npy_float64 y, npy_float64 z, void *data) -{ - npy_float64 buf[3]; - buf[0] = x; - buf[1] = y; - buf[2] = z; - return kd_insert(tree, buf, data); -} - -int kd_insert3f(struct kdtree *tree, float x, float y, float z, void *data) -{ - npy_float64 buf[3]; - buf[0] = x; - buf[1] = y; - buf[2] = z; - return kd_insert(tree, buf, data); -} - -static int find_nearest(struct kdnode *node, const npy_float64 *pos, npy_float64 range, struct res_node *list, int ordered, int dim) -{ - npy_float64 dist_sq, dx; - int i, ret, added_res = 0; - - if(!node) return 0; - - dist_sq = 0; - for(i=0; ipos[i] - pos[i]); - } - if(dist_sq <= SQ(range)) { - if(rlist_insert(list, node, ordered ? dist_sq : -1.0) == -1) { - return -1; - } - added_res = 1; - } - - dx = pos[node->dir] - node->pos[node->dir]; - - ret = find_nearest(dx <= 0.0 ? node->left : node->right, pos, range, list, ordered, dim); - if(ret >= 0 && fabs(dx) < range) { - added_res += ret; - ret = find_nearest(dx <= 0.0 ? node->right : node->left, pos, range, list, ordered, dim); - } - if(ret == -1) { - return -1; - } - added_res += ret; - - return added_res; -} - -static void kd_nearest_i(struct kdnode *node, const npy_float64 *pos, struct kdnode **result, npy_float64 *result_dist_sq, struct kdhyperrect* rect) -{ - int dir = node->dir; - int i, side; - npy_float64 dummy, dist_sq; - struct kdnode *nearer_subtree, *farther_subtree; - npy_float64 *nearer_hyperrect_coord, *farther_hyperrect_coord; - - /* Decide whether to go left or right in the tree */ - dummy = pos[dir] - node->pos[dir]; - if (dummy <= 0) { - nearer_subtree = node->left; - farther_subtree = node->right; - nearer_hyperrect_coord = rect->max + dir; - farther_hyperrect_coord = rect->min + dir; - side = 0; - } else { - nearer_subtree = node->right; - farther_subtree = node->left; - nearer_hyperrect_coord = rect->min + dir; - farther_hyperrect_coord = rect->max + dir; - side = 1; - } - - if (nearer_subtree) { - /* Slice the hyperrect to get the hyperrect of the nearer subtree */ - dummy = *nearer_hyperrect_coord; - *nearer_hyperrect_coord = node->pos[dir]; - /* Recurse down into nearer subtree */ - kd_nearest_i(nearer_subtree, pos, result, result_dist_sq, rect); - /* Undo the slice */ - *nearer_hyperrect_coord = dummy; - } - - /* Check the distance of the point at the current node, compare it - * with our best so far */ - dist_sq = 0; - for(i=0; i < rect->dim; i++) { - dist_sq += SQ(node->pos[i] - pos[i]); - } - if (dist_sq < *result_dist_sq) { - *result = node; - *result_dist_sq = dist_sq; - } - - if (farther_subtree) { - /* Get the hyperrect of the farther subtree */ - dummy = *farther_hyperrect_coord; - *farther_hyperrect_coord = node->pos[dir]; - /* Check if we have to recurse down by calculating the closest - * point of the hyperrect and see if it's closer than our - * minimum distance in result_dist_sq. */ - if (hyperrect_dist_sq(rect, pos) < *result_dist_sq) { - /* Recurse down into farther subtree */ - kd_nearest_i(farther_subtree, pos, result, result_dist_sq, rect); - } - /* Undo the slice on the hyperrect */ - *farther_hyperrect_coord = dummy; - } -} - -struct kdres *kd_nearest(struct kdtree *kd, const npy_float64 *pos) -{ - struct kdhyperrect *rect; - struct kdnode *result; - struct kdres *rset; - npy_float64 dist_sq; - int i; - - if (!kd) return 0; - if (!kd->rect) return 0; - - /* Allocate result set */ - if(!(rset = malloc(sizeof *rset))) { - return 0; - } - if(!(rset->rlist = alloc_resnode())) { - free(rset); - return 0; - } - rset->rlist->next = 0; - rset->tree = kd; - - /* Duplicate the bounding hyperrectangle, we will work on the copy */ - if (!(rect = hyperrect_duplicate(kd->rect))) { - kd_res_free(rset); - return 0; - } - - /* Our first guesstimate is the root node */ - result = kd->root; - dist_sq = 0; - for (i = 0; i < kd->dim; i++) - dist_sq += SQ(result->pos[i] - pos[i]); - - /* Search for the nearest neighbour recursively */ - kd_nearest_i(kd->root, pos, &result, &dist_sq, rect); - - /* Free the copy of the hyperrect */ - hyperrect_free(rect); - - /* Store the result */ - if (result) { - if (rlist_insert(rset->rlist, result, -1.0) == -1) { - kd_res_free(rset); - return 0; - } - rset->size = 1; - kd_res_rewind(rset); - return rset; - } else { - kd_res_free(rset); - return 0; - } -} - -struct kdres *kd_nearestf(struct kdtree *tree, const float *pos) -{ - static npy_float64 sbuf[16]; - npy_float64 *bptr, *buf = 0; - int dim = tree->dim; - struct kdres *res; - - if(dim > 16) { -#ifndef NO_ALLOCA - if(dim <= 256) - bptr = buf = alloca(dim * sizeof *bptr); - else -#endif - if(!(bptr = buf = malloc(dim * sizeof *bptr))) { - return 0; - } - } else { - bptr = sbuf; - } - - while(dim-- > 0) { - *bptr++ = *pos++; - } - - res = kd_nearest(tree, buf); -#ifndef NO_ALLOCA - if(tree->dim > 256) -#else - if(tree->dim > 16) -#endif - free(buf); - return res; -} - -struct kdres *kd_nearest3(struct kdtree *tree, npy_float64 x, npy_float64 y, npy_float64 z) -{ - npy_float64 pos[3]; - pos[0] = x; - pos[1] = y; - pos[2] = z; - return kd_nearest(tree, pos); -} - -struct kdres *kd_nearest3f(struct kdtree *tree, float x, float y, float z) -{ - npy_float64 pos[3]; - pos[0] = x; - pos[1] = y; - pos[2] = z; - return kd_nearest(tree, pos); -} - -struct kdres *kd_nearest_range(struct kdtree *kd, const npy_float64 *pos, npy_float64 range) -{ - int ret; - struct kdres *rset; - - if(!(rset = malloc(sizeof *rset))) { - return 0; - } - if(!(rset->rlist = alloc_resnode())) { - free(rset); - return 0; - } - rset->rlist->next = 0; - rset->tree = kd; - - if((ret = find_nearest(kd->root, pos, range, rset->rlist, 0, kd->dim)) == -1) { - kd_res_free(rset); - return 0; - } - rset->size = ret; - kd_res_rewind(rset); - return rset; -} - -struct kdres *kd_nearest_rangef(struct kdtree *kd, const float *pos, float range) -{ - static npy_float64 sbuf[16]; - npy_float64 *bptr, *buf = 0; - int dim = kd->dim; - struct kdres *res; - - if(dim > 16) { -#ifndef NO_ALLOCA - if(dim <= 256) - bptr = buf = alloca(dim * sizeof *bptr); - else -#endif - if(!(bptr = buf = malloc(dim * sizeof *bptr))) { - return 0; - } - } else { - bptr = sbuf; - } - - while(dim-- > 0) { - *bptr++ = *pos++; - } - - res = kd_nearest_range(kd, buf, range); -#ifndef NO_ALLOCA - if(kd->dim > 256) -#else - if(kd->dim > 16) -#endif - free(buf); - return res; -} - -struct kdres *kd_nearest_range3(struct kdtree *tree, npy_float64 x, npy_float64 y, npy_float64 z, npy_float64 range) -{ - npy_float64 buf[3]; - buf[0] = x; - buf[1] = y; - buf[2] = z; - return kd_nearest_range(tree, buf, range); -} - -struct kdres *kd_nearest_range3f(struct kdtree *tree, float x, float y, float z, float range) -{ - npy_float64 buf[3]; - buf[0] = x; - buf[1] = y; - buf[2] = z; - return kd_nearest_range(tree, buf, range); -} - -void kd_res_free(struct kdres *rset) -{ - clear_results(rset); - free_resnode(rset->rlist); - free(rset); -} - -int kd_res_size(struct kdres *set) -{ - return (set->size); -} - -void kd_res_rewind(struct kdres *rset) -{ - rset->riter = rset->rlist->next; -} - -int kd_res_end(struct kdres *rset) -{ - return rset->riter == 0; -} - -int kd_res_next(struct kdres *rset) -{ - rset->riter = rset->riter->next; - return rset->riter != 0; -} - -void *kd_res_item(struct kdres *rset, npy_float64 *pos) -{ - if(rset->riter) { - if(pos) { - memcpy(pos, rset->riter->item->pos, rset->tree->dim * sizeof *pos); - } - return rset->riter->item->data; - } - return 0; -} - -void *kd_res_itemf(struct kdres *rset, float *pos) -{ - if(rset->riter) { - if(pos) { - int i; - for(i=0; itree->dim; i++) { - pos[i] = rset->riter->item->pos[i]; - } - } - return rset->riter->item->data; - } - return 0; -} - -void *kd_res_item3(struct kdres *rset, npy_float64 *x, npy_float64 *y, npy_float64 *z) -{ - if(rset->riter) { - if(*x) *x = rset->riter->item->pos[0]; - if(*y) *y = rset->riter->item->pos[1]; - if(*z) *z = rset->riter->item->pos[2]; - } - return 0; -} - -void *kd_res_item3f(struct kdres *rset, float *x, float *y, float *z) -{ - if(rset->riter) { - if(*x) *x = rset->riter->item->pos[0]; - if(*y) *y = rset->riter->item->pos[1]; - if(*z) *z = rset->riter->item->pos[2]; - } - return 0; -} - -void *kd_res_item_data(struct kdres *set) -{ - return kd_res_item(set, 0); -} - -/* ---- hyperrectangle helpers ---- */ -static struct kdhyperrect* hyperrect_create(int dim, const npy_float64 *min, const npy_float64 *max) -{ - size_t size = dim * sizeof(npy_float64); - struct kdhyperrect* rect = 0; - - if (!(rect = malloc(sizeof(struct kdhyperrect)))) { - return 0; - } - - rect->dim = dim; - if (!(rect->min = malloc(size))) { - free(rect); - return 0; - } - if (!(rect->max = malloc(size))) { - free(rect->min); - free(rect); - return 0; - } - memcpy(rect->min, min, size); - memcpy(rect->max, max, size); - - return rect; -} - -static void hyperrect_free(struct kdhyperrect *rect) -{ - free(rect->min); - free(rect->max); - free(rect); -} - -static struct kdhyperrect* hyperrect_duplicate(const struct kdhyperrect *rect) -{ - return hyperrect_create(rect->dim, rect->min, rect->max); -} - -static void hyperrect_extend(struct kdhyperrect *rect, const npy_float64 *pos) -{ - int i; - - for (i=0; i < rect->dim; i++) { - if (pos[i] < rect->min[i]) { - rect->min[i] = pos[i]; - } - if (pos[i] > rect->max[i]) { - rect->max[i] = pos[i]; - } - } -} - -static npy_float64 hyperrect_dist_sq(struct kdhyperrect *rect, const npy_float64 *pos) -{ - int i; - npy_float64 result = 0; - - for (i=0; i < rect->dim; i++) { - if (pos[i] < rect->min[i]) { - result += SQ(rect->min[i] - pos[i]); - } else if (pos[i] > rect->max[i]) { - result += SQ(rect->max[i] - pos[i]); - } - } - - return result; -} - -/* ---- static helpers ---- */ - -#ifdef USE_LIST_NODE_ALLOCATOR -/* special list node allocators. */ -static struct res_node *free_nodes; - -#ifndef NO_PTHREADS -static pthread_mutex_t alloc_mutex = PTHREAD_MUTEX_INITIALIZER; -#endif - -static struct res_node *alloc_resnode(void) -{ - struct res_node *node; - -#ifndef NO_PTHREADS - pthread_mutex_lock(&alloc_mutex); -#endif - - if(!free_nodes) { - node = malloc(sizeof *node); - } else { - node = free_nodes; - free_nodes = free_nodes->next; - node->next = 0; - } - -#ifndef NO_PTHREADS - pthread_mutex_unlock(&alloc_mutex); -#endif - - return node; -} - -static void free_resnode(struct res_node *node) -{ -#ifndef NO_PTHREADS - pthread_mutex_lock(&alloc_mutex); -#endif - - node->next = free_nodes; - free_nodes = node; - -#ifndef NO_PTHREADS - pthread_mutex_unlock(&alloc_mutex); -#endif -} -#endif /* list node allocator or not */ - - -/* inserts the item. if dist_sq is >= 0, then do an ordered insert */ -static int rlist_insert(struct res_node *list, struct kdnode *item, npy_float64 dist_sq) -{ - struct res_node *rnode; - - if(!(rnode = alloc_resnode())) { - return -1; - } - rnode->item = item; - rnode->dist_sq = dist_sq; - - if(dist_sq >= 0.0) { - while(list->next && list->next->dist_sq < dist_sq) { - list = list->next; - } - } - rnode->next = list->next; - list->next = rnode; - return 0; -} - -static void clear_results(struct kdres *rset) -{ - struct res_node *tmp, *node = rset->rlist->next; - - while(node) { - tmp = node; - node = node->next; - free_resnode(tmp); - } - - rset->rlist->next = 0; -} diff -Nru yt-3.3.3/yt/utilities/lib/kdtree.h yt-3.4.0/yt/utilities/lib/kdtree.h --- yt-3.3.3/yt/utilities/lib/kdtree.h 2016-09-22 03:28:40.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/kdtree.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -/* -This file is part of ``kdtree'', a library for working with kd-trees. -Copyright (C) 2007-2011 John Tsiombikas - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY -OF SUCH DAMAGE. -*/ -#ifndef _KDTREE_H_ -#define _KDTREE_H_ -#include "Python.h" -#include "numpy/ndarrayobject.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct kdtree; -struct kdres; - - -/* create a kd-tree for "k"-dimensional data */ -struct kdtree *kd_create(int k); - -/* free the struct kdtree */ -void kd_free(struct kdtree *tree); - -/* remove all the elements from the tree */ -void kd_clear(struct kdtree *tree); - -/* if called with non-null 2nd argument, the function provided - * will be called on data pointers (see kd_insert) when nodes - * are to be removed from the tree. - */ -void kd_data_destructor(struct kdtree *tree, void (*destr)(void*)); - -/* insert a node, specifying its position, and optional data */ -int kd_insert(struct kdtree *tree, const npy_float64 *pos, void *data); -int kd_insertf(struct kdtree *tree, const float *pos, void *data); -int kd_insert3(struct kdtree *tree, npy_float64 x, npy_float64 y, npy_float64 z, void *data); -int kd_insert3f(struct kdtree *tree, float x, float y, float z, void *data); - -/* Find one of the nearest nodes from the specified point. - * - * This function returns a pointer to a result set with at most one element. - */ -struct kdres *kd_nearest(struct kdtree *tree, const npy_float64 *pos); -struct kdres *kd_nearestf(struct kdtree *tree, const float *pos); -struct kdres *kd_nearest3(struct kdtree *tree, npy_float64 x, npy_float64 y, npy_float64 z); -struct kdres *kd_nearest3f(struct kdtree *tree, float x, float y, float z); - -/* Find any nearest nodes from the specified point within a range. - * - * This function returns a pointer to a result set, which can be manipulated - * by the kd_res_* functions. - * The returned pointer can be null as an indication of an error. Otherwise - * a valid result set is always returned which may contain 0 or more elements. - * The result set must be deallocated with kd_res_free, after use. - */ -struct kdres *kd_nearest_range(struct kdtree *tree, const npy_float64 *pos, npy_float64 range); -struct kdres *kd_nearest_rangef(struct kdtree *tree, const float *pos, float range); -struct kdres *kd_nearest_range3(struct kdtree *tree, npy_float64 x, npy_float64 y, npy_float64 z, npy_float64 range); -struct kdres *kd_nearest_range3f(struct kdtree *tree, float x, float y, float z, float range); - -/* frees a result set returned by kd_nearest_range() */ -void kd_res_free(struct kdres *set); - -/* returns the size of the result set (in elements) */ -int kd_res_size(struct kdres *set); - -/* rewinds the result set iterator */ -void kd_res_rewind(struct kdres *set); - -/* returns non-zero if the set iterator reached the end after the last element */ -int kd_res_end(struct kdres *set); - -/* advances the result set iterator, returns non-zero on success, zero if - * there are no more elements in the result set. - */ -int kd_res_next(struct kdres *set); - -/* returns the data pointer (can be null) of the current result set item - * and optionally sets its position to the pointers(s) if not null. - */ -void *kd_res_item(struct kdres *set, npy_float64 *pos); -void *kd_res_itemf(struct kdres *set, float *pos); -void *kd_res_item3(struct kdres *set, npy_float64 *x, npy_float64 *y, npy_float64 *z); -void *kd_res_item3f(struct kdres *set, float *x, float *y, float *z); - -/* equivalent to kd_res_item(set, 0) */ -void *kd_res_item_data(struct kdres *set); - - -#ifdef __cplusplus -} -#endif - -#endif /* _KDTREE_H_ */ diff -Nru yt-3.3.3/yt/utilities/lib/kdtree_utils.pxd yt-3.4.0/yt/utilities/lib/kdtree_utils.pxd --- yt-3.3.3/yt/utilities/lib/kdtree_utils.pxd 2016-09-22 03:28:40.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/kdtree_utils.pxd 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -""" -A light interface to kdtree, from http://code.google.com/p/kdtree/ - - - -""" - -#----------------------------------------------------------------------------- -# Copyright (c) 2013, yt Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- - -import numpy as np -cimport numpy as np -cimport cython - -cdef extern from "kdtree.h": - struct kdtree - struct kdres - - kdtree *kd_create(int k) - void kd_free(kdtree *tree) - - int kd_insert3(kdtree *tree, np.float64_t x, np.float64_t y, np.float64_t z, void *data) - kdres *kd_nearest3(kdtree *tree, np.float64_t x, np.float64_t y, - np.float64_t z) nogil - - kdres *kd_nearest_range3(kdtree *tree, np.float64_t x, np.float64_t y, np.float64_t z, - np.float64_t range) nogil - - void kd_res_free(kdres *set) nogil - int kd_res_size(kdres *set) nogil - int kd_res_next(kdres *set) nogil - void kd_res_rewind(kdres *set) nogil - - void kd_res_item3(kdres *set, np.float64_t *x, np.float64_t *y, - np.float64_t *z) nogil - void *kd_res_item_data(kdres *set) nogil - - void kd_data_destructor(kdtree *tree, void (*destr)(void*)) diff -Nru yt-3.3.3/yt/utilities/lib/lenses.c yt-3.4.0/yt/utilities/lib/lenses.c --- yt-3.3.3/yt/utilities/lib/lenses.c 2016-12-12 01:41:51.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/lenses.c 2017-08-10 18:20:44.000000000 +0000 @@ -1,14 +1,21 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "yt/utilities/lib/kdtree.h", "yt/utilities/lib/platform_dep.h" ], + "include_dirs": [ + "./yt/utilities/lib", + "yt/utilities/lib" + ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.lenses", + "sources": [ + "yt/utilities/lib/lenses.pyx" ] }, "module_name": "yt.utilities.lib.lenses" @@ -22,7 +29,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -44,6 +51,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -196,16 +204,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -332,6 +344,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -386,6 +404,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -452,7 +499,6 @@ #include #include "platform_dep.h" #include "limits.h" -#include "kdtree.h" #include "pythread.h" #include "pystate.h" #ifdef _OPENMP @@ -499,8 +545,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -513,8 +559,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -636,10 +685,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1056,60 +1107,35 @@ }; struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator; -/* "image_samplers.pxd":35 +/* "image_samplers.pxd":30 * cdef struct VolumeRenderAccumulator * - * cdef struct ImageAccumulator: # <<<<<<<<<<<<<< - * np.float64_t rgba[Nch] - * void *supp_data - */ -struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator { - __pyx_t_5numpy_float64_t rgba[4]; - void *supp_data; -}; -struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer; - -/* "yt/utilities/lib/lenses.pxd":32 - * cdef int SHRT_MAX - * - * cdef struct ImageContainer: # <<<<<<<<<<<<<< - * np.float64_t[:,:,:] vp_pos - * np.float64_t[:,:,:] vp_dir - */ -struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer { - __Pyx_memviewslice vp_pos; - __Pyx_memviewslice vp_dir; - __pyx_t_5numpy_float64_t *center; - __Pyx_memviewslice image; - __Pyx_memviewslice zbuffer; - __Pyx_memviewslice image_used; - __Pyx_memviewslice mesh_lines; - __pyx_t_5numpy_float64_t pdx; - __pyx_t_5numpy_float64_t pdy; - __pyx_t_5numpy_float64_t bounds[4]; - __Pyx_memviewslice camera_data; - int nv[2]; - __pyx_t_5numpy_float64_t *x_vec; - __pyx_t_5numpy_float64_t *y_vec; -}; - -/* "yt/utilities/lib/lenses.pxd":48 - * - * - * ctypedef int calculate_extent_function(ImageContainer *image, # <<<<<<<<<<<<<< + * ctypedef int calculate_extent_function(ImageSampler image, # <<<<<<<<<<<<<< * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 * */ -typedef int __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *); +typedef int __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *); -/* "yt/utilities/lib/lenses.pxd":51 +/* "image_samplers.pxd":33 * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 * - * ctypedef void generate_vector_info_function(ImageContainer *im, # <<<<<<<<<<<<<< + * ctypedef void generate_vector_info_function(ImageSampler im, # <<<<<<<<<<<<<< * np.int64_t vi, np.int64_t vj, * np.float64_t width[2], */ -typedef void __pyx_t_2yt_9utilities_3lib_6lenses_generate_vector_info_function(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); +typedef void __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); + +/* "image_samplers.pxd":38 + * np.float64_t v_dir[3], np.float64_t v_pos[3]) nogil + * + * cdef struct ImageAccumulator: # <<<<<<<<<<<<<< + * np.float64_t rgba[Nch] + * void *supp_data + */ +struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator { + __pyx_t_5numpy_float64_t rgba[4]; + void *supp_data; +}; /* "partitioned_grid.pxd":22 * from .volume_container cimport VolumeContainer @@ -1133,17 +1159,30 @@ }; -/* "image_samplers.pxd":39 +/* "image_samplers.pxd":42 * void *supp_data * * cdef class ImageSampler: # <<<<<<<<<<<<<< - * cdef ImageContainer *image - * cdef public object acenter, aimage, ax_vec, ay_vec + * cdef np.float64_t[:,:,:] vp_pos + * cdef np.float64_t[:,:,:] vp_dir */ struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler { PyObject_HEAD struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtab; - struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *image; + __Pyx_memviewslice vp_pos; + __Pyx_memviewslice vp_dir; + __pyx_t_5numpy_float64_t *center; + __Pyx_memviewslice image; + __Pyx_memviewslice zbuffer; + __Pyx_memviewslice image_used; + __Pyx_memviewslice mesh_lines; + __pyx_t_5numpy_float64_t pdx; + __pyx_t_5numpy_float64_t pdy; + __pyx_t_5numpy_float64_t bounds[4]; + __Pyx_memviewslice camera_data; + int nv[2]; + __pyx_t_5numpy_float64_t *x_vec; + __pyx_t_5numpy_float64_t *y_vec; PyObject *acenter; PyObject *aimage; PyObject *ax_vec; @@ -1154,12 +1193,12 @@ void *supp_data; __pyx_t_5numpy_float64_t width[3]; PyObject *lens_type; - __pyx_t_2yt_9utilities_3lib_6lenses_calculate_extent_function *extent_function; - __pyx_t_2yt_9utilities_3lib_6lenses_generate_vector_info_function *vector_function; + __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function *extent_function; + __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function *vector_function; }; -/* "image_samplers.pxd":60 +/* "image_samplers.pxd":75 * void *data) nogil * * cdef class ProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1171,7 +1210,7 @@ }; -/* "image_samplers.pxd":63 +/* "image_samplers.pxd":78 * pass * * cdef class InterpolatedProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1186,7 +1225,7 @@ }; -/* "image_samplers.pxd":68 +/* "image_samplers.pxd":83 * cdef public object my_field_tables * * cdef class VolumeRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1198,12 +1237,11 @@ struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *vra; PyObject *tf_obj; PyObject *my_field_tables; - struct kdtree **trees; PyObject *tree_containers; }; -/* "image_samplers.pxd":75 +/* "image_samplers.pxd":89 * cdef object tree_containers * * cdef class LightSourceRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1310,12 +1348,12 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid; -/* "image_samplers.pxd":39 +/* "image_samplers.pxd":42 * void *supp_data * * cdef class ImageSampler: # <<<<<<<<<<<<<< - * cdef ImageContainer *image - * cdef public object acenter, aimage, ax_vec, ay_vec + * cdef np.float64_t[:,:,:] vp_pos + * cdef np.float64_t[:,:,:] vp_dir */ struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler { @@ -1325,7 +1363,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler; -/* "image_samplers.pxd":60 +/* "image_samplers.pxd":75 * void *data) nogil * * cdef class ProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1339,7 +1377,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler; -/* "image_samplers.pxd":63 +/* "image_samplers.pxd":78 * pass * * cdef class InterpolatedProjectionSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1353,7 +1391,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler; -/* "image_samplers.pxd":68 +/* "image_samplers.pxd":83 * cdef public object my_field_tables * * cdef class VolumeRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1367,7 +1405,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler; -/* "image_samplers.pxd":75 +/* "image_samplers.pxd":89 * cdef object tree_containers * * cdef class LightSourceRenderSampler(ImageSampler): # <<<<<<<<<<<<<< @@ -1516,6 +1554,13 @@ #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() + /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; @@ -1659,12 +1704,32 @@ /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); +/* 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 *); + +/* GetModuleGlobalName.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) @@ -1786,12 +1851,24 @@ /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1811,45 +1888,6 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); -#if PY_MAJOR_VERSION < 3 - static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); - static void __Pyx_ReleaseBuffer(Py_buffer *view); -#else - #define __Pyx_GetBuffer PyObject_GetBuffer - #define __Pyx_ReleaseBuffer PyBuffer_Release -#endif - - -/* BufferStructDeclare.proto */ -typedef struct { - Py_ssize_t shape, strides, suboffsets; -} __Pyx_Buf_DimInfo; -typedef struct { - size_t refcount; - Py_buffer pybuffer; -} __Pyx_Buffer; -typedef struct { - __Pyx_Buffer *rcbuffer; - char *data; - __Pyx_Buf_DimInfo diminfo[8]; -} __Pyx_LocalBuf_ND; - -/* None.proto */ -static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; -static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; - -/* MemviewSliceIsContig.proto */ -static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, - char order, int ndim); - -/* OverlappingSlices.proto */ -static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, - __Pyx_memviewslice *slice2, - int ndim, size_t itemsize); - -/* Capsule.proto */ -static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); - /* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -1954,6 +1992,48 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +/* BufferStructDeclare.proto */ +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +/* None.proto */ +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, + char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + /* MemviewSliceCopyTemplate.proto */ static __Pyx_memviewslice __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, @@ -1968,7 +2048,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* MemviewSliceInit.proto */ #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d @@ -1997,7 +2077,7 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); @@ -2005,9 +2085,6 @@ /* CIntFromPy.proto */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); @@ -2088,16 +2165,14 @@ static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *); /*proto*/ /* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -/* Module declarations from 'yt.utilities.lib.kdtree_utils' */ - /* Module declarations from 'yt.utilities.lib.partitioned_grid' */ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = 0; @@ -2152,6 +2227,7 @@ 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*/ #define __Pyx_MODULE_NAME "yt.utilities.lib.lenses" int __pyx_module_is_main_yt__utilities__lib__lenses = 0; @@ -2162,16 +2238,18 @@ static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; -static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; 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_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_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_name[] = "name"; @@ -2193,23 +2271,36 @@ 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_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_fortran[] = "fortran"; static const char __pyx_k_memview[] = "memview"; static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; 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_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; 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_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_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +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_contiguous_and_direct[] = ""; @@ -2229,6 +2320,7 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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"; @@ -2236,6 +2328,7 @@ 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."; @@ -2248,6 +2341,7 @@ 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; @@ -2258,17 +2352,21 @@ 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_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_allocate_buffer; static PyObject *__pyx_n_s_base; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_u_c; static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_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_dtype_is_object; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_enumerate; @@ -2290,15 +2388,25 @@ 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_pack; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_cython; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_start; @@ -2307,12 +2415,14 @@ 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_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_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 */ @@ -2322,8 +2432,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -2345,14 +2459,20 @@ 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_184977713; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; @@ -2363,9 +2483,9 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__19; -static PyObject *__pyx_slice__20; -static PyObject *__pyx_slice__21; +static PyObject *__pyx_slice__23; +static PyObject *__pyx_slice__24; +static PyObject *__pyx_slice__25; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -2375,22 +2495,30 @@ 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_codeobj__35; /* "yt/utilities/lib/lenses.pyx":24 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef int calculate_extent_plane_parallel(ImageContainer *image, # <<<<<<<<<<<<<< + * cdef int calculate_extent_plane_parallel(ImageSampler image, # <<<<<<<<<<<<<< * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1: * # We do this for all eight corners */ -static int __pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_plane_parallel(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *__pyx_v_image, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_int64_t *__pyx_v_rv) { +static int __pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_plane_parallel(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_image, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_int64_t *__pyx_v_rv) { __pyx_t_5numpy_float64_t __pyx_v_temp; __pyx_t_5numpy_float64_t *__pyx_v_edges[2]; __pyx_t_5numpy_float64_t __pyx_v_cx; @@ -2661,7 +2789,7 @@ /* "yt/utilities/lib/lenses.pyx":24 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef int calculate_extent_plane_parallel(ImageContainer *image, # <<<<<<<<<<<<<< + * cdef int calculate_extent_plane_parallel(ImageSampler image, # <<<<<<<<<<<<<< * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1: * # We do this for all eight corners */ @@ -2674,12 +2802,12 @@ /* "yt/utilities/lib/lenses.pyx":62 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef int calculate_extent_perspective(ImageContainer *image, # <<<<<<<<<<<<<< + * cdef int calculate_extent_perspective(ImageSampler image, # <<<<<<<<<<<<<< * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1: * */ -static int __pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_perspective(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *__pyx_v_image, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_int64_t *__pyx_v_rv) { +static int __pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_perspective(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_image, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_int64_t *__pyx_v_rv) { __pyx_t_5numpy_float64_t __pyx_v_cam_pos[3]; __pyx_t_5numpy_float64_t __pyx_v_cam_width[3]; __pyx_t_5numpy_float64_t __pyx_v_north_vector[3]; @@ -3200,7 +3328,7 @@ * if acos(sight_angle_cos) < 0.5 * M_PI and sight_angle_cos != 0.0: * sight_length = cam_width[2] / sight_angle_cos # <<<<<<<<<<<<<< * else: - * sight_length = sqrt(cam_width[0]**2 + cam_width[1]**2) + * sight_length = sqrt(cam_width[0] * cam_width[0] + */ __pyx_v_sight_length = ((__pyx_v_cam_width[2]) / __pyx_v_sight_angle_cos); @@ -3217,26 +3345,34 @@ /* "yt/utilities/lib/lenses.pyx":143 * sight_length = cam_width[2] / sight_angle_cos * else: - * sight_length = sqrt(cam_width[0]**2 + cam_width[1]**2) # <<<<<<<<<<<<<< - * sight_length = sight_length / sqrt(1.0 - sight_angle_cos**2) - * + * sight_length = sqrt(cam_width[0] * cam_width[0] + # <<<<<<<<<<<<<< + * cam_width[1] * cam_width[1]) + * sight_length /= sqrt(1.0 - sight_angle_cos * sight_angle_cos) */ /*else*/ { - __pyx_v_sight_length = sqrt((pow((__pyx_v_cam_width[0]), 2.0) + pow((__pyx_v_cam_width[1]), 2.0))); /* "yt/utilities/lib/lenses.pyx":144 * else: - * sight_length = sqrt(cam_width[0]**2 + cam_width[1]**2) - * sight_length = sight_length / sqrt(1.0 - sight_angle_cos**2) # <<<<<<<<<<<<<< + * sight_length = sqrt(cam_width[0] * cam_width[0] + + * cam_width[1] * cam_width[1]) # <<<<<<<<<<<<<< + * sight_length /= sqrt(1.0 - sight_angle_cos * sight_angle_cos) + * + */ + __pyx_v_sight_length = sqrt((((__pyx_v_cam_width[0]) * (__pyx_v_cam_width[0])) + ((__pyx_v_cam_width[1]) * (__pyx_v_cam_width[1])))); + + /* "yt/utilities/lib/lenses.pyx":145 + * sight_length = sqrt(cam_width[0] * cam_width[0] + + * cam_width[1] * cam_width[1]) + * sight_length /= sqrt(1.0 - sight_angle_cos * sight_angle_cos) # <<<<<<<<<<<<<< * * fma(sight_length, sight_vector, cam_pos, pos1) */ - __pyx_v_sight_length = (__pyx_v_sight_length / sqrt((1.0 - powf(__pyx_v_sight_angle_cos, 2.0)))); + __pyx_v_sight_length = (__pyx_v_sight_length / sqrt((1.0 - (__pyx_v_sight_angle_cos * __pyx_v_sight_angle_cos)))); } __pyx_L10:; - /* "yt/utilities/lib/lenses.pyx":146 - * sight_length = sight_length / sqrt(1.0 - sight_angle_cos**2) + /* "yt/utilities/lib/lenses.pyx":147 + * sight_length /= sqrt(1.0 - sight_angle_cos * sight_angle_cos) * * fma(sight_length, sight_vector, cam_pos, pos1) # <<<<<<<<<<<<<< * subtract(pos1, sight_center, pos1) @@ -3244,7 +3380,7 @@ */ __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(__pyx_v_sight_length, __pyx_v_sight_vector, __pyx_v_cam_pos, __pyx_v_pos1); - /* "yt/utilities/lib/lenses.pyx":147 + /* "yt/utilities/lib/lenses.pyx":148 * * fma(sight_length, sight_vector, cam_pos, pos1) * subtract(pos1, sight_center, pos1) # <<<<<<<<<<<<<< @@ -3253,7 +3389,7 @@ */ __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(__pyx_v_pos1, __pyx_v_sight_center, __pyx_v_pos1); - /* "yt/utilities/lib/lenses.pyx":148 + /* "yt/utilities/lib/lenses.pyx":149 * fma(sight_length, sight_vector, cam_pos, pos1) * subtract(pos1, sight_center, pos1) * dx = dot(pos1, east_vector) # <<<<<<<<<<<<<< @@ -3262,7 +3398,7 @@ */ __pyx_v_dx = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_pos1, __pyx_v_east_vector); - /* "yt/utilities/lib/lenses.pyx":149 + /* "yt/utilities/lib/lenses.pyx":150 * subtract(pos1, sight_center, pos1) * dx = dot(pos1, east_vector) * dy = dot(pos1, north_vector) # <<<<<<<<<<<<<< @@ -3271,7 +3407,7 @@ */ __pyx_v_dy = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_pos1, __pyx_v_north_vector); - /* "yt/utilities/lib/lenses.pyx":151 + /* "yt/utilities/lib/lenses.pyx":152 * dy = dot(pos1, north_vector) * * px = int(image.nv[0] * 0.5 + image.nv[0] / cam_width[0] * dx) # <<<<<<<<<<<<<< @@ -3280,7 +3416,7 @@ */ __pyx_v_px = ((int)(((__pyx_v_image->nv[0]) * 0.5) + (((__pyx_v_image->nv[0]) / (__pyx_v_cam_width[0])) * __pyx_v_dx))); - /* "yt/utilities/lib/lenses.pyx":152 + /* "yt/utilities/lib/lenses.pyx":153 * * px = int(image.nv[0] * 0.5 + image.nv[0] / cam_width[0] * dx) * py = int(image.nv[1] * 0.5 + image.nv[1] / cam_width[1] * dy) # <<<<<<<<<<<<<< @@ -3289,7 +3425,7 @@ */ __pyx_v_py = ((int)(((__pyx_v_image->nv[1]) * 0.5) + (((__pyx_v_image->nv[1]) / (__pyx_v_cam_width[1])) * __pyx_v_dy))); - /* "yt/utilities/lib/lenses.pyx":153 + /* "yt/utilities/lib/lenses.pyx":154 * px = int(image.nv[0] * 0.5 + image.nv[0] / cam_width[0] * dx) * py = int(image.nv[1] * 0.5 + image.nv[1] / cam_width[1] * dy) * min_px = min(min_px, px) # <<<<<<<<<<<<<< @@ -3305,7 +3441,7 @@ } __pyx_v_min_px = __pyx_t_16; - /* "yt/utilities/lib/lenses.pyx":154 + /* "yt/utilities/lib/lenses.pyx":155 * py = int(image.nv[1] * 0.5 + image.nv[1] / cam_width[1] * dy) * min_px = min(min_px, px) * max_px = max(max_px, px) # <<<<<<<<<<<<<< @@ -3321,7 +3457,7 @@ } __pyx_v_max_px = __pyx_t_14; - /* "yt/utilities/lib/lenses.pyx":155 + /* "yt/utilities/lib/lenses.pyx":156 * min_px = min(min_px, px) * max_px = max(max_px, px) * min_py = min(min_py, py) # <<<<<<<<<<<<<< @@ -3337,7 +3473,7 @@ } __pyx_v_min_py = __pyx_t_13; - /* "yt/utilities/lib/lenses.pyx":156 + /* "yt/utilities/lib/lenses.pyx":157 * max_px = max(max_px, px) * min_py = min(min_py, py) * max_py = max(max_py, py) # <<<<<<<<<<<<<< @@ -3354,7 +3490,7 @@ __pyx_v_max_py = __pyx_t_16; } - /* "yt/utilities/lib/lenses.pyx":158 + /* "yt/utilities/lib/lenses.pyx":159 * max_py = max(max_py, py) * * rv[0] = max(min_px, 0) # <<<<<<<<<<<<<< @@ -3370,7 +3506,7 @@ } (__pyx_v_rv[0]) = __pyx_t_18; - /* "yt/utilities/lib/lenses.pyx":159 + /* "yt/utilities/lib/lenses.pyx":160 * * rv[0] = max(min_px, 0) * rv[1] = min(max_px, image.nv[0]) # <<<<<<<<<<<<<< @@ -3386,7 +3522,7 @@ } (__pyx_v_rv[1]) = __pyx_t_13; - /* "yt/utilities/lib/lenses.pyx":160 + /* "yt/utilities/lib/lenses.pyx":161 * rv[0] = max(min_px, 0) * rv[1] = min(max_px, image.nv[0]) * rv[2] = max(min_py, 0) # <<<<<<<<<<<<<< @@ -3402,7 +3538,7 @@ } (__pyx_v_rv[2]) = __pyx_t_17; - /* "yt/utilities/lib/lenses.pyx":161 + /* "yt/utilities/lib/lenses.pyx":162 * rv[1] = min(max_px, image.nv[0]) * rv[2] = max(min_py, 0) * rv[3] = min(max_py, image.nv[1]) # <<<<<<<<<<<<<< @@ -3418,7 +3554,7 @@ } (__pyx_v_rv[3]) = __pyx_t_16; - /* "yt/utilities/lib/lenses.pyx":162 + /* "yt/utilities/lib/lenses.pyx":163 * rv[2] = max(min_py, 0) * rv[3] = min(max_py, image.nv[1]) * return 0 # <<<<<<<<<<<<<< @@ -3431,7 +3567,7 @@ /* "yt/utilities/lib/lenses.pyx":62 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef int calculate_extent_perspective(ImageContainer *image, # <<<<<<<<<<<<<< + * cdef int calculate_extent_perspective(ImageSampler image, # <<<<<<<<<<<<<< * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1: * */ @@ -3440,11 +3576,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("yt.utilities.lib.lenses.calculate_extent_perspective", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -3452,19 +3588,19 @@ return __pyx_r; } -/* "yt/utilities/lib/lenses.pyx":170 +/* "yt/utilities/lib/lenses.pyx":171 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef int calculate_extent_null(ImageContainer *image, # <<<<<<<<<<<<<< + * cdef int calculate_extent_null(ImageSampler image, # <<<<<<<<<<<<<< * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1: * rv[0] = 0 */ -static int __pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_null(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *__pyx_v_image, CYTHON_UNUSED struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_int64_t *__pyx_v_rv) { +static int __pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_null(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_image, CYTHON_UNUSED struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_int64_t *__pyx_v_rv) { int __pyx_r; - /* "yt/utilities/lib/lenses.pyx":172 - * cdef int calculate_extent_null(ImageContainer *image, + /* "yt/utilities/lib/lenses.pyx":173 + * cdef int calculate_extent_null(ImageSampler image, * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1: * rv[0] = 0 # <<<<<<<<<<<<<< * rv[1] = image.nv[0] @@ -3472,7 +3608,7 @@ */ (__pyx_v_rv[0]) = 0; - /* "yt/utilities/lib/lenses.pyx":173 + /* "yt/utilities/lib/lenses.pyx":174 * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1: * rv[0] = 0 * rv[1] = image.nv[0] # <<<<<<<<<<<<<< @@ -3481,7 +3617,7 @@ */ (__pyx_v_rv[1]) = (__pyx_v_image->nv[0]); - /* "yt/utilities/lib/lenses.pyx":174 + /* "yt/utilities/lib/lenses.pyx":175 * rv[0] = 0 * rv[1] = image.nv[0] * rv[2] = 0 # <<<<<<<<<<<<<< @@ -3490,7 +3626,7 @@ */ (__pyx_v_rv[2]) = 0; - /* "yt/utilities/lib/lenses.pyx":175 + /* "yt/utilities/lib/lenses.pyx":176 * rv[1] = image.nv[0] * rv[2] = 0 * rv[3] = image.nv[1] # <<<<<<<<<<<<<< @@ -3499,7 +3635,7 @@ */ (__pyx_v_rv[3]) = (__pyx_v_image->nv[1]); - /* "yt/utilities/lib/lenses.pyx":176 + /* "yt/utilities/lib/lenses.pyx":177 * rv[2] = 0 * rv[3] = image.nv[1] * return 0 # <<<<<<<<<<<<<< @@ -3509,10 +3645,10 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/lenses.pyx":170 + /* "yt/utilities/lib/lenses.pyx":171 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef int calculate_extent_null(ImageContainer *image, # <<<<<<<<<<<<<< + * cdef int calculate_extent_null(ImageSampler image, # <<<<<<<<<<<<<< * VolumeContainer *vc, np.int64_t rv[4]) nogil except -1: * rv[0] = 0 */ @@ -3522,15 +3658,15 @@ return __pyx_r; } -/* "yt/utilities/lib/lenses.pyx":180 +/* "yt/utilities/lib/lenses.pyx":181 * @cython.boundscheck(False) * @cython.wraparound(False) - * cdef void generate_vector_info_plane_parallel(ImageContainer *im, # <<<<<<<<<<<<<< + * cdef void generate_vector_info_plane_parallel(ImageSampler im, # <<<<<<<<<<<<<< * np.int64_t vi, np.int64_t vj, * np.float64_t width[2], */ -static void __pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_plane_parallel(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *__pyx_v_im, __pyx_t_5numpy_int64_t __pyx_v_vi, __pyx_t_5numpy_int64_t __pyx_v_vj, __pyx_t_5numpy_float64_t *__pyx_v_width, __pyx_t_5numpy_float64_t *__pyx_v_v_dir, __pyx_t_5numpy_float64_t *__pyx_v_v_pos) { +static void __pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_plane_parallel(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_im, __pyx_t_5numpy_int64_t __pyx_v_vi, __pyx_t_5numpy_int64_t __pyx_v_vj, __pyx_t_5numpy_float64_t *__pyx_v_width, __pyx_t_5numpy_float64_t *__pyx_v_v_dir, __pyx_t_5numpy_float64_t *__pyx_v_v_pos) { int __pyx_v_i; __pyx_t_5numpy_float64_t __pyx_v_px; __pyx_t_5numpy_float64_t __pyx_v_py; @@ -3568,7 +3704,7 @@ Py_ssize_t __pyx_t_32; Py_ssize_t __pyx_t_33; - /* "yt/utilities/lib/lenses.pyx":187 + /* "yt/utilities/lib/lenses.pyx":188 * cdef int i * cdef np.float64_t px, py * px = width[0] * (vi)/(im.nv[0]-1) - width[0]/2.0 # <<<<<<<<<<<<<< @@ -3579,17 +3715,17 @@ __pyx_t_2 = (((__pyx_t_5numpy_float64_t)(__pyx_v_im->nv[0])) - 1.0); if (unlikely(__pyx_t_2 == 0)) { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 187, __pyx_L1_error) + __PYX_ERR(0, 188, __pyx_L1_error) } __pyx_v_px = ((__pyx_t_1 / __pyx_t_2) - ((__pyx_v_width[0]) / 2.0)); - /* "yt/utilities/lib/lenses.pyx":188 + /* "yt/utilities/lib/lenses.pyx":189 * cdef np.float64_t px, py * px = width[0] * (vi)/(im.nv[0]-1) - width[0]/2.0 * py = width[1] * (vj)/(im.nv[1]-1) - width[1]/2.0 # <<<<<<<<<<<<<< @@ -3600,80 +3736,80 @@ __pyx_t_1 = (((__pyx_t_5numpy_float64_t)(__pyx_v_im->nv[1])) - 1.0); if (unlikely(__pyx_t_1 == 0)) { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 188, __pyx_L1_error) + __PYX_ERR(0, 189, __pyx_L1_error) } __pyx_v_py = ((__pyx_t_2 / __pyx_t_1) - ((__pyx_v_width[1]) / 2.0)); - /* "yt/utilities/lib/lenses.pyx":190 + /* "yt/utilities/lib/lenses.pyx":191 * py = width[1] * (vj)/(im.nv[1]-1) - width[1]/2.0 * # atleast_3d will add to beginning and end * v_pos[0] = im.vp_pos[0,0,0]*px + im.vp_pos[0,3,0]*py + im.vp_pos[0,9,0] # <<<<<<<<<<<<<< * v_pos[1] = im.vp_pos[0,1,0]*px + im.vp_pos[0,4,0]*py + im.vp_pos[0,10,0] * v_pos[2] = im.vp_pos[0,2,0]*px + im.vp_pos[0,5,0]*py + im.vp_pos[0,11,0] */ - if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 190, __pyx_L1_error)} + if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 191, __pyx_L1_error)} __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; - if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 190, __pyx_L1_error)} + if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 191, __pyx_L1_error)} __pyx_t_6 = 0; __pyx_t_7 = 3; __pyx_t_8 = 0; - if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 190, __pyx_L1_error)} + if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 191, __pyx_L1_error)} __pyx_t_9 = 0; __pyx_t_10 = 9; __pyx_t_11 = 0; (__pyx_v_v_pos[0]) = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_3 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_4 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_5 * __pyx_v_im->vp_pos.strides[2]) ))) * __pyx_v_px) + ((*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_6 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_7 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_8 * __pyx_v_im->vp_pos.strides[2]) ))) * __pyx_v_py)) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_9 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_10 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_11 * __pyx_v_im->vp_pos.strides[2]) )))); - /* "yt/utilities/lib/lenses.pyx":191 + /* "yt/utilities/lib/lenses.pyx":192 * # atleast_3d will add to beginning and end * v_pos[0] = im.vp_pos[0,0,0]*px + im.vp_pos[0,3,0]*py + im.vp_pos[0,9,0] * v_pos[1] = im.vp_pos[0,1,0]*px + im.vp_pos[0,4,0]*py + im.vp_pos[0,10,0] # <<<<<<<<<<<<<< * v_pos[2] = im.vp_pos[0,2,0]*px + im.vp_pos[0,5,0]*py + im.vp_pos[0,11,0] * for i in range(3): v_dir[i] = im.vp_dir[0,i,0] */ - if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 191, __pyx_L1_error)} + if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 192, __pyx_L1_error)} __pyx_t_12 = 0; __pyx_t_13 = 1; __pyx_t_14 = 0; - if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 191, __pyx_L1_error)} + if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 192, __pyx_L1_error)} __pyx_t_15 = 0; __pyx_t_16 = 4; __pyx_t_17 = 0; - if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 191, __pyx_L1_error)} + if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 192, __pyx_L1_error)} __pyx_t_18 = 0; __pyx_t_19 = 10; __pyx_t_20 = 0; (__pyx_v_v_pos[1]) = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_12 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_13 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_14 * __pyx_v_im->vp_pos.strides[2]) ))) * __pyx_v_px) + ((*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_15 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_16 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_17 * __pyx_v_im->vp_pos.strides[2]) ))) * __pyx_v_py)) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_18 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_19 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_20 * __pyx_v_im->vp_pos.strides[2]) )))); - /* "yt/utilities/lib/lenses.pyx":192 + /* "yt/utilities/lib/lenses.pyx":193 * v_pos[0] = im.vp_pos[0,0,0]*px + im.vp_pos[0,3,0]*py + im.vp_pos[0,9,0] * v_pos[1] = im.vp_pos[0,1,0]*px + im.vp_pos[0,4,0]*py + im.vp_pos[0,10,0] * v_pos[2] = im.vp_pos[0,2,0]*px + im.vp_pos[0,5,0]*py + im.vp_pos[0,11,0] # <<<<<<<<<<<<<< * for i in range(3): v_dir[i] = im.vp_dir[0,i,0] * */ - if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 192, __pyx_L1_error)} + if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 193, __pyx_L1_error)} __pyx_t_21 = 0; __pyx_t_22 = 2; __pyx_t_23 = 0; - if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 192, __pyx_L1_error)} + if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 193, __pyx_L1_error)} __pyx_t_24 = 0; __pyx_t_25 = 5; __pyx_t_26 = 0; - if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 192, __pyx_L1_error)} + if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 193, __pyx_L1_error)} __pyx_t_27 = 0; __pyx_t_28 = 11; __pyx_t_29 = 0; (__pyx_v_v_pos[2]) = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_21 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_22 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_23 * __pyx_v_im->vp_pos.strides[2]) ))) * __pyx_v_px) + ((*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_24 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_25 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_26 * __pyx_v_im->vp_pos.strides[2]) ))) * __pyx_v_py)) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_27 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_28 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_29 * __pyx_v_im->vp_pos.strides[2]) )))); - /* "yt/utilities/lib/lenses.pyx":193 + /* "yt/utilities/lib/lenses.pyx":194 * v_pos[1] = im.vp_pos[0,1,0]*px + im.vp_pos[0,4,0]*py + im.vp_pos[0,10,0] * v_pos[2] = im.vp_pos[0,2,0]*px + im.vp_pos[0,5,0]*py + im.vp_pos[0,11,0] * for i in range(3): v_dir[i] = im.vp_dir[0,i,0] # <<<<<<<<<<<<<< @@ -3682,17 +3818,17 @@ */ for (__pyx_t_30 = 0; __pyx_t_30 < 3; __pyx_t_30+=1) { __pyx_v_i = __pyx_t_30; - if (unlikely(!__pyx_v_im->vp_dir.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 193, __pyx_L1_error)} + if (unlikely(!__pyx_v_im->vp_dir.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 194, __pyx_L1_error)} __pyx_t_31 = 0; __pyx_t_32 = __pyx_v_i; __pyx_t_33 = 0; (__pyx_v_v_dir[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_dir.data + __pyx_t_31 * __pyx_v_im->vp_dir.strides[0]) ) + __pyx_t_32 * __pyx_v_im->vp_dir.strides[1]) ) + __pyx_t_33 * __pyx_v_im->vp_dir.strides[2]) ))); } - /* "yt/utilities/lib/lenses.pyx":180 + /* "yt/utilities/lib/lenses.pyx":181 * @cython.boundscheck(False) * @cython.wraparound(False) - * cdef void generate_vector_info_plane_parallel(ImageContainer *im, # <<<<<<<<<<<<<< + * cdef void generate_vector_info_plane_parallel(ImageSampler im, # <<<<<<<<<<<<<< * np.int64_t vi, np.int64_t vj, * np.float64_t width[2], */ @@ -3700,19 +3836,19 @@ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.utilities.lib.lenses.generate_vector_info_plane_parallel", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1); + __Pyx_WriteUnraisable("yt.utilities.lib.lenses.generate_vector_info_plane_parallel", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); __pyx_L0:; } -/* "yt/utilities/lib/lenses.pyx":197 +/* "yt/utilities/lib/lenses.pyx":198 * @cython.boundscheck(False) * @cython.wraparound(False) - * cdef void generate_vector_info_null(ImageContainer *im, # <<<<<<<<<<<<<< + * cdef void generate_vector_info_null(ImageSampler im, # <<<<<<<<<<<<<< * np.int64_t vi, np.int64_t vj, * np.float64_t width[2], */ -static void __pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_null(struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *__pyx_v_im, __pyx_t_5numpy_int64_t __pyx_v_vi, __pyx_t_5numpy_int64_t __pyx_v_vj, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_width, __pyx_t_5numpy_float64_t *__pyx_v_v_dir, __pyx_t_5numpy_float64_t *__pyx_v_v_pos) { +static void __pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_null(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_im, __pyx_t_5numpy_int64_t __pyx_v_vi, __pyx_t_5numpy_int64_t __pyx_v_vj, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_width, __pyx_t_5numpy_float64_t *__pyx_v_v_dir, __pyx_t_5numpy_float64_t *__pyx_v_v_pos) { int __pyx_v_i; int __pyx_t_1; __pyx_t_5numpy_int64_t __pyx_t_2; @@ -3722,7 +3858,7 @@ __pyx_t_5numpy_int64_t __pyx_t_6; Py_ssize_t __pyx_t_7; - /* "yt/utilities/lib/lenses.pyx":203 + /* "yt/utilities/lib/lenses.pyx":204 * np.float64_t v_dir[3], np.float64_t v_pos[3]) nogil: * cdef int i * for i in range(3): # <<<<<<<<<<<<<< @@ -3732,36 +3868,36 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/lenses.pyx":207 + /* "yt/utilities/lib/lenses.pyx":208 * # flattened. That means that im.nv will be a better one-d offset, * # since vp_pos has funny strides. * v_pos[i] = im.vp_pos[vi, vj, i] # <<<<<<<<<<<<<< * v_dir[i] = im.vp_dir[vi, vj, i] * */ - if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 207, __pyx_L1_error)} + if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 208, __pyx_L1_error)} __pyx_t_2 = __pyx_v_vi; __pyx_t_3 = __pyx_v_vj; __pyx_t_4 = __pyx_v_i; (__pyx_v_v_pos[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_2 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_3 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_4 * __pyx_v_im->vp_pos.strides[2]) ))); - /* "yt/utilities/lib/lenses.pyx":208 + /* "yt/utilities/lib/lenses.pyx":209 * # since vp_pos has funny strides. * v_pos[i] = im.vp_pos[vi, vj, i] * v_dir[i] = im.vp_dir[vi, vj, i] # <<<<<<<<<<<<<< * */ - if (unlikely(!__pyx_v_im->vp_dir.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 208, __pyx_L1_error)} + if (unlikely(!__pyx_v_im->vp_dir.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 209, __pyx_L1_error)} __pyx_t_5 = __pyx_v_vi; __pyx_t_6 = __pyx_v_vj; __pyx_t_7 = __pyx_v_i; (__pyx_v_v_dir[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_dir.data + __pyx_t_5 * __pyx_v_im->vp_dir.strides[0]) ) + __pyx_t_6 * __pyx_v_im->vp_dir.strides[1]) ) + __pyx_t_7 * __pyx_v_im->vp_dir.strides[2]) ))); } - /* "yt/utilities/lib/lenses.pyx":197 + /* "yt/utilities/lib/lenses.pyx":198 * @cython.boundscheck(False) * @cython.wraparound(False) - * cdef void generate_vector_info_null(ImageContainer *im, # <<<<<<<<<<<<<< + * cdef void generate_vector_info_null(ImageSampler im, # <<<<<<<<<<<<<< * np.int64_t vi, np.int64_t vj, * np.float64_t width[2], */ @@ -3769,147 +3905,133 @@ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.utilities.lib.lenses.generate_vector_info_null", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1); + __Pyx_WriteUnraisable("yt.utilities.lib.lenses.generate_vector_info_null", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); __pyx_L0:; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython +/* "volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { int __pyx_r; - int __pyx_t_1; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("vc_index", 0); - /* "yt/utilities/lib/fp_utils.pxd":20 + /* "volume_container.pxd":31 * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): + * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< * + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - */ - __pyx_r = __pyx_v_i1; + __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython + /* "volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ /* function exit code */ __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 +/* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { + int __pyx_v_index[3]; + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + __Pyx_RefNannySetupContext("vc_pos_index", 0); - /* "yt/utilities/lib/fp_utils.pxd":24 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "volume_container.pxd":36 + * cdef int index[3] + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "volume_container.pxd":37 + * cdef int i + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< + * return vc_index(vc, index[0], index[1], index[2]) * */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); } - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "volume_container.pxd":38 + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: */ - __pyx_r = __pyx_v_f1; + __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i */ /* function exit code */ __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 - * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 +/* "vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) { + float __pyx_r; - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "vec3_ops.pxd":11 + * cdef inline cython.floating dot(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< * - */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_r = __pyx_v_i1; + __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 - * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] */ /* function exit code */ @@ -3917,47 +4039,25 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double *__pyx_v_a, double *__pyx_v_b) { + double __pyx_r; - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "vec3_ops.pxd":11 + * cdef inline cython.floating dot(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< * - */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_r = __pyx_v_f1; + __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + /* "vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] */ /* function exit code */ @@ -3965,251 +4065,209 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 +/* "vec3_ops.pxd":17 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 - * + /* "vec3_ops.pxd":20 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); - if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; - } + (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< + /* "vec3_ops.pxd":21 + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< + * c[2] = a[0]*b[1] - a[1]*b[0] * - * cdef inline int iclip(int i, int a, int b) nogil: */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "vec3_ops.pxd":22 + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * + */ + (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + + /* "vec3_ops.pxd":17 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ /* function exit code */ - __pyx_L0:; - return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; +static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - /* "yt/utilities/lib/fp_utils.pxd":40 - * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "vec3_ops.pxd":20 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i + /* "vec3_ops.pxd":21 + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< + * c[2] = a[0]*b[1] - a[1]*b[0] * */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } + (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< + /* "vec3_ops.pxd":22 + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< + * * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "vec3_ops.pxd":17 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ /* function exit code */ - __pyx_L0:; - return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b +/* "vec3_ops.pxd":28 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; +static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "vec3_ops.pxd":31 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i + /* "vec3_ops.pxd":32 + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< + * c[2] = a[2] - b[2] * */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } + (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< + /* "vec3_ops.pxd":33 + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< + * * - * cdef inline np.float64_t fclip(np.float64_t f, */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "vec3_ops.pxd":28 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ /* function exit code */ - __pyx_L0:; - return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) - */ +static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; + /* "vec3_ops.pxd":31 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] + */ + (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + /* "vec3_ops.pxd":32 + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< + * c[2] = a[2] - b[2] * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "vec3_ops.pxd":33 + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + * + */ + (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + + /* "vec3_ops.pxd":28 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ /* function exit code */ - __pyx_L0:; - return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "vec3_ops.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) */ -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(float *__pyx_v_a, float *__pyx_v_b) { + float __pyx_r; - /* "yt/utilities/lib/fp_utils.pxd":54 - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "vec3_ops.pxd":41 + * cdef inline cython.floating distance(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< * - */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_r = __pyx_v_i1; + __pyx_r = sqrt(((powf(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + powf(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + powf(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "vec3_ops.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) */ /* function exit code */ @@ -4217,46 +4275,25 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; +static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(double *__pyx_v_a, double *__pyx_v_b) { + double __pyx_r; - /* "yt/utilities/lib/fp_utils.pxd":58 + /* "vec3_ops.pxd":41 + * cdef inline cython.floating distance(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 * */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - */ - __pyx_r = __pyx_v_i1; + __pyx_r = sqrt(((pow(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + pow(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + pow(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "vec3_ops.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) */ /* function exit code */ @@ -4264,269 +4301,332 @@ return __pyx_r; } -/* "vec3_ops.pxd":9 +/* "vec3_ops.pxd":47 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< + * const cython.floating[3] a, + * const cython.floating[3] b, */ -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; +static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(float const __pyx_v_f, float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - /* "vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< + /* "vec3_ops.pxd":51 + * const cython.floating[3] b, + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] + */ + (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); + + /* "vec3_ops.pxd":52 + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< + * c[2] = f * a[2] + b[2] + * + */ + (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); + + /* "vec3_ops.pxd":53 + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< * * */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); - goto __pyx_L0; + (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); - /* "vec3_ops.pxd":9 + /* "vec3_ops.pxd":47 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< + * const cython.floating[3] a, + * const cython.floating[3] b, */ /* function exit code */ - __pyx_L0:; - return __pyx_r; } -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double *__pyx_v_a, double *__pyx_v_b) { - double __pyx_r; +static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const __pyx_v_f, double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - /* "vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< + /* "vec3_ops.pxd":51 + * const cython.floating[3] b, + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] + */ + (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); + + /* "vec3_ops.pxd":52 + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< + * c[2] = f * a[2] + b[2] + * + */ + (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); + + /* "vec3_ops.pxd":53 + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< * * */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); - goto __pyx_L0; + (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); - /* "vec3_ops.pxd":9 + /* "vec3_ops.pxd":47 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< + * const cython.floating[3] a, + * const cython.floating[3] b, */ /* function exit code */ - __pyx_L0:; - return __pyx_r; } -/* "vec3_ops.pxd":17 +/* "vec3_ops.pxd":59 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) */ -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(float *__pyx_v_a) { + float __pyx_r; - /* "vec3_ops.pxd":20 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "vec3_ops.pxd":60 + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< */ - (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); + __pyx_r = sqrt(((((__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; - /* "vec3_ops.pxd":21 - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< - * c[2] = a[0]*b[1] - a[1]*b[0] - * + /* "vec3_ops.pxd":59 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) */ - (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); - /* "vec3_ops.pxd":22 - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< - * - * + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *__pyx_v_a) { + double __pyx_r; + + /* "vec3_ops.pxd":60 + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< */ - (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + __pyx_r = sqrt(((((__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; - /* "vec3_ops.pxd":17 + /* "vec3_ops.pxd":59 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) */ /* function exit code */ + __pyx_L0:; + return __pyx_r; } -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "vec3_ops.pxd":20 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); - /* "vec3_ops.pxd":21 - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< - * c[2] = a[0]*b[1] - a[1]*b[0] +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * */ - (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "vec3_ops.pxd":22 - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ /* function exit code */ + __pyx_L0:; + return __pyx_r; } -/* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; - /* "vec3_ops.pxd":31 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] - */ - (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); - - /* "vec3_ops.pxd":32 - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< - * c[2] = a[2] - b[2] + /* "yt/utilities/lib/fp_utils.pxd":24 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 * */ - (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "vec3_ops.pxd":33 - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ /* function exit code */ + __pyx_L0:; + return __pyx_r; } -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "vec3_ops.pxd":31 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); - /* "vec3_ops.pxd":32 - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< - * c[2] = a[2] - b[2] +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * */ - (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "vec3_ops.pxd":33 - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* function exit code */ + __pyx_L0:; + return __pyx_r; } -/* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; - /* "vec3_ops.pxd":41 - * cdef inline cython.floating distance(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":32 * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 * */ - __pyx_r = sqrt(((powf(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + powf(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + powf(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + */ + __pyx_r = __pyx_v_f1; goto __pyx_L0; - /* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ /* function exit code */ @@ -4534,25 +4634,47 @@ return __pyx_r; } -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(double *__pyx_v_a, double *__pyx_v_b) { - double __pyx_r; +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 + */ - /* "vec3_ops.pxd":41 - * cdef inline cython.floating distance(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":36 * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 * */ - __pyx_r = sqrt(((pow(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + pow(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + pow(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + if (__pyx_t_1) { + __pyx_r = (-__pyx_v_f0); + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + */ + __pyx_r = __pyx_v_f0; goto __pyx_L0; - /* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ /* function exit code */ @@ -4560,117 +4682,203 @@ return __pyx_r; } -/* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(float const __pyx_v_f, float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "vec3_ops.pxd":51 - * const cython.floating[3] b, - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] + /* "yt/utilities/lib/fp_utils.pxd":40 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "vec3_ops.pxd":52 - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< - * c[2] = f * a[2] + b[2] + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * */ - (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "vec3_ops.pxd":53 - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* function exit code */ + __pyx_L0:; + return __pyx_r; } -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const __pyx_v_f, double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b + */ - /* "vec3_ops.pxd":51 - * const cython.floating[3] b, - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":45 + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "vec3_ops.pxd":52 - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< - * c[2] = f * a[2] + b[2] + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * + */ + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fclip(np.float64_t f, + */ + __pyx_r = __pyx_v_i; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); - /* "vec3_ops.pxd":53 - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< - * +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; - /* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i + * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ /* function exit code */ + __pyx_L0:; + return __pyx_r; } -/* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(float *__pyx_v_a) { - float __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "vec3_ops.pxd":60 - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ - __pyx_r = sqrt(((((__pyx_v_a[0]) * (__pyx_v_a[0])) + ((__pyx_v_a[1]) * (__pyx_v_a[1]))) + ((__pyx_v_a[2]) * (__pyx_v_a[2])))); + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + */ + __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ /* function exit code */ @@ -4678,22 +4886,46 @@ return __pyx_r; } -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *__pyx_v_a) { - double __pyx_r; +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 + */ - /* "vec3_ops.pxd":60 - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":58 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ - __pyx_r = sqrt(((((__pyx_v_a[0]) * (__pyx_v_a[0])) + ((__pyx_v_a[1]) * (__pyx_v_a[1]))) + ((__pyx_v_a[2]) * (__pyx_v_a[2])))); + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + */ + __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* function exit code */ @@ -6882,7 +7114,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -6930,7 +7162,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -7013,7 +7245,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7061,7 +7293,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -7144,7 +7376,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7159,153 +7391,57 @@ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("vc_index", 0); - - /* "volume_container.pxd":31 - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): - * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): - */ - __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); - goto __pyx_L0; - - /* "volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { - int __pyx_v_index[3]; - int __pyx_v_i; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("vc_pos_index", 0); - - /* "volume_container.pxd":36 - * cdef int index[3] - * cdef int i - * for i in range(3): # <<<<<<<<<<<<<< - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "volume_container.pxd":37 - * cdef int i - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< - * return vc_index(vc, index[0], index[1], index[2]) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); - } + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "volume_container.pxd":38 - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); - goto __pyx_L0; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i + * 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; @@ -7339,10 +7475,15 @@ 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; } @@ -7351,21 +7492,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -7378,7 +7523,9 @@ } 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); @@ -7601,7 +7748,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -8796,6 +8943,113 @@ 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":240 * * @cname("__pyx_array_new") @@ -8991,6 +9245,7 @@ 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; } @@ -9010,100 +9265,387 @@ } __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, 277, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___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":278 + * 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":277 + * 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":279 + * 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":280 + * 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":279 + * 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; + } - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "(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:; -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); + /* "(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) { - /* "View.MemoryView":278 - * cdef object name - * def __init__(self, name): - * self.name = name # <<<<<<<<<<<<<< - * def __repr__(self): - * return self.name + /* "(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_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; + __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; - /* "View.MemoryView":277 - * cdef class Enum(object): - * cdef object name - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * def __repr__(self): + /* "(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_r = 0; + __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; } -/* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * +/* "(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_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { +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("__repr__ (wrapper)", 0); - __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + __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_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { +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 - __Pyx_RefNannySetupContext("__repr__", 0); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "View.MemoryView":280 - * self.name = name - * def __repr__(self): - * return self.name # <<<<<<<<<<<<<< - * - * cdef generic = Enum("") + /* "(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) # <<<<<<<<<<<<<< */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->name); - __pyx_r = __pyx_v_self->name; - goto __pyx_L0; + 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; - /* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * + /* "(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(); @@ -9218,8 +9760,11 @@ 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; } @@ -9228,11 +9773,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -9245,6 +9792,7 @@ } 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; @@ -10377,7 +10925,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -10437,7 +10985,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -11127,7 +11675,7 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -11968,7 +12516,7 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12082,7 +12630,7 @@ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__18, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -13058,6 +13606,113 @@ 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__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.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__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.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "View.MemoryView":643 * * @cname('__pyx_memoryview_new') @@ -13386,9 +14041,9 @@ __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__19); - __Pyx_GIVEREF(__pyx_slice__19); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__19); + __Pyx_INCREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__23); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) @@ -13421,7 +14076,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__20); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__24); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) } __pyx_L7:; @@ -13566,9 +14221,9 @@ __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__21); - __Pyx_GIVEREF(__pyx_slice__21); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__21); + __Pyx_INCREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__25); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error) @@ -13692,7 +14347,7 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -15075,11 +15730,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -15560,11 +16215,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -15817,16 +16472,123 @@ __pyx_r = __pyx_v_self->from_object; goto __pyx_L0; - /* "View.MemoryView":978 - * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.from_object - * + /* "View.MemoryView":978 + * + * @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__27, 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__28, 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_L0:; + __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; @@ -16276,7 +17038,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -17533,11 +18295,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -17561,7 +18323,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -17630,7 +18392,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -17652,7 +18414,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -17743,7 +18505,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -17766,7 +18528,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -17882,7 +18644,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -18449,11 +19211,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -18633,7 +19395,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -18657,7 +19419,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -18954,17 +19716,480 @@ __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } } - __pyx_L3:; + __pyx_L3:; + + /* "View.MemoryView":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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; @@ -18991,7 +20216,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -19041,6 +20266,8 @@ 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} }; @@ -19160,7 +20387,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -19188,6 +20415,8 @@ } 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} }; @@ -19275,7 +20504,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -19387,6 +20616,8 @@ {"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} }; @@ -19512,7 +20743,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -19556,6 +20787,8 @@ } 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} }; @@ -19662,6 +20895,7 @@ {&__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}, @@ -19672,17 +20906,21 @@ {&__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_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_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_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_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, @@ -19704,15 +20942,25 @@ {&__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_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_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_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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 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_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, @@ -19721,12 +20969,14 @@ {&__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_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) { @@ -19736,8 +20986,8 @@ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 425, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error) return 0; @@ -19912,6 +21162,25 @@ __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":484 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: @@ -19919,9 +21188,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -19930,9 +21199,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "View.MemoryView":563 * def suboffsets(self): @@ -19941,12 +21210,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__18 = PyTuple_New(1); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); + __pyx_tuple__20 = PyTuple_New(1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__18, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__18); + PyTuple_SET_ITEM(__pyx_tuple__20, 0, __pyx_int_neg_1); + __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":668 * if item is Ellipsis: @@ -19955,9 +21243,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(2, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__19); - __Pyx_GIVEREF(__pyx_slice__19); + __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); /* "View.MemoryView":671 * seen_ellipsis = True @@ -19966,9 +21254,9 @@ * have_slices = True * else: */ - __pyx_slice__20 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(2, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); + __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(2, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -19977,9 +21265,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(2, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__21); - __Pyx_GIVEREF(__pyx_slice__21); + __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -19988,9 +21276,28 @@ * * */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "(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__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "(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__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "View.MemoryView":282 * return self.name @@ -19999,9 +21306,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "View.MemoryView":283 * @@ -20010,9 +21317,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -20021,9 +21328,9 @@ * * */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); /* "View.MemoryView":287 * @@ -20032,9 +21339,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); /* "View.MemoryView":288 * @@ -20043,9 +21350,19 @@ * * */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__34 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -20057,6 +21374,7 @@ 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_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:; @@ -20120,6 +21438,7 @@ __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 @@ -20152,20 +21471,22 @@ indirect_contiguous = Py_None; Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ - if (__Pyx_ExportFunction("generate_vector_info_plane_parallel", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_plane_parallel, "void (struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("generate_vector_info_null", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_null, "void (struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("calculate_extent_plane_parallel", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_plane_parallel, "int (struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("calculate_extent_perspective", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_perspective, "int (struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("calculate_extent_null", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_null, "int (struct __pyx_t_2yt_9utilities_3lib_6lenses_ImageContainer *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("generate_vector_info_plane_parallel", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_plane_parallel, "void (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("generate_vector_info_null", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_null, "void (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("calculate_extent_plane_parallel", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_plane_parallel, "int (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("calculate_extent_perspective", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_perspective, "int (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("calculate_extent_null", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_null, "int (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- 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, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __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; @@ -20178,6 +21499,7 @@ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; @@ -20187,6 +21509,7 @@ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -20203,16 +21526,16 @@ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = __Pyx_ImportType("yt.utilities.lib.partitioned_grid", "PartitionedGrid", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(4, 22, __pyx_L1_error) __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(4, 22, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ImageSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(5, 39, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(5, 39, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(5, 60, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(5, 60, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "InterpolatedProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(5, 63, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(5, 63, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "VolumeRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(5, 68, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(5, 68, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "LightSourceRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(5, 75, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(5, 75, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ImageSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(5, 42, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(5, 42, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "ProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(5, 75, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(5, 75, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "InterpolatedProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(5, 78, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(5, 78, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "VolumeRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(5, 83, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(5, 83, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = __Pyx_ImportType("yt.utilities.lib.image_samplers", "LightSourceRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(5, 89, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(5, 89, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -20251,7 +21574,7 @@ */ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_array_type); @@ -20262,7 +21585,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 282, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_1); @@ -20276,7 +21599,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 283, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_1); @@ -20290,7 +21613,7 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 284, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_1); @@ -20304,7 +21627,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, 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__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_1); @@ -20318,7 +21641,7 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); @@ -20360,7 +21683,7 @@ */ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_memoryview_type); @@ -20373,16 +21696,26 @@ */ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import 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(2, 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(2, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -20392,7 +21725,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.lenses", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.lenses", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -21002,7 +22335,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -21062,6 +22404,21 @@ 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; @@ -21159,8 +22516,41 @@ } } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +/* GetModuleGlobalName */ + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -21185,7 +22575,7 @@ #endif /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -21259,7 +22649,7 @@ } /* PyFunctionFastCall */ - #if CYTHON_FAST_PYCALL + #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { @@ -21375,29 +22765,34 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyCFunctionFastCall */ - #if CYTHON_FAST_PYCCALL + #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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -21408,9 +22803,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -21423,9 +22821,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -21478,7 +22879,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -21594,12 +22995,12 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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)); @@ -21607,7 +23008,7 @@ } /* PyObjectCallMethO */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; @@ -21627,7 +23028,7 @@ #endif /* PyObjectCallOneArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); @@ -21644,11 +23045,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -21670,6 +23067,38 @@ } #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; + } +} + /* SetVTable */ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 @@ -21688,6 +23117,71 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* GetVTable */ static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; @@ -21708,6 +23202,40 @@ return NULL; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; @@ -21848,120 +23376,28 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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( - PyThreadState_GET(), /*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 (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); - if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); - if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); - PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); - return -1; -} -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject *obj = view->obj; - if (!obj) return; - if (PyObject_CheckBuffer(obj)) { - PyBuffer_Release(view); - return; - } - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } - Py_DECREF(obj); - view->obj = NULL; -} -#endif - - - /* MemviewSliceIsContig */ - static int -__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, - char order, int ndim) -{ - int i, index, step, start; - Py_ssize_t itemsize = mvs.memview->view.itemsize; - if (order == 'F') { - step = 1; - start = 0; - } else { - step = -1; - start = ndim - 1; - } - for (i = 0; i < ndim; i++) { - index = start + step * i; - if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) - return 0; - itemsize *= mvs.shape[index]; - } - return 1; -} - -/* OverlappingSlices */ - static void -__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, - void **out_start, void **out_end, - int ndim, size_t itemsize) -{ - char *start, *end; - int i; - start = end = slice->data; - for (i = 0; i < ndim; i++) { - Py_ssize_t stride = slice->strides[i]; - Py_ssize_t extent = slice->shape[i]; - if (extent == 0) { - *out_start = *out_end = start; - return; - } else { - if (stride > 0) - end += stride * (extent - 1); - else - start += stride * (extent - 1); - } - } - *out_start = start; - *out_end = end + itemsize; -} -static int -__pyx_slices_overlap(__Pyx_memviewslice *slice1, - __Pyx_memviewslice *slice2, - int ndim, size_t itemsize) -{ - void *start1, *end1, *start2, *end2; - __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); - __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); - return (start1 < end2) && (start2 < end1); -} - -/* Capsule */ - static CYTHON_INLINE PyObject * -__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) -{ - PyObject *cobj; -#if PY_VERSION_HEX >= 0x02070000 - cobj = PyCapsule_New(p, sig, NULL); -#else - cobj = PyCObject_FromVoidPtr(p, NULL); -#endif - return cobj; + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); } /* CIntFromPyVerify */ @@ -22268,94 +23704,378 @@ 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); + 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); + } +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + Py_DECREF(obj); + view->obj = NULL; +} +#endif + + + /* MemviewSliceIsContig */ + static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, + char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) + return 0; + itemsize *= mvs.shape[index]; + } + return 1; +} + +/* OverlappingSlices */ + static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +/* Capsule */ + static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +/* 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; } - 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); + 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)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } 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 (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); + } + } 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 - } - } - { - 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); + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #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); + { +#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; } - { - 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); - } +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; } /* MemviewSliceCopyTemplate */ @@ -23111,19 +24831,19 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; + 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(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (int) val; + return (long) val; } } else #endif @@ -23132,32 +24852,32 @@ #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 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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])); + __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; @@ -23171,86 +24891,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (int) -1; + return (long) -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)) + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } 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 (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 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(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) - 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]))); + __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(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(long) > 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]))); + __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(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, 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)) + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -23259,7 +24979,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - int val; + long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -23279,24 +24999,24 @@ return val; } #endif - return (int) -1; + return (long) -1; } } else { - int val; + long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; + "value too large to convert to long"); + return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; + "can't convert negative value to long"); + return (long) -1; } /* CIntToPy */ @@ -23519,195 +25239,6 @@ return (char) -1; } -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - 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; -} - /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; @@ -23870,6 +25401,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -23878,11 +25411,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/lenses.pxd yt-3.4.0/yt/utilities/lib/lenses.pxd --- yt-3.3.3/yt/utilities/lib/lenses.pxd 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/lenses.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -22,6 +22,10 @@ from libc.math cimport exp, floor, log2, \ fabs, atan, atan2, asin, cos, sin, sqrt, acos, M_PI from yt.utilities.lib.fp_utils cimport imax, fmax, imin, fmin, iclip, fclip, i64clip +from .image_samplers cimport \ + ImageSampler, \ + calculate_extent_function, \ + generate_vector_info_function cdef extern from "platform_dep.h": long int lrint(double x) nogil @@ -29,30 +33,6 @@ cdef extern from "limits.h": cdef int SHRT_MAX -cdef struct ImageContainer: - np.float64_t[:,:,:] vp_pos - np.float64_t[:,:,:] vp_dir - np.float64_t *center - np.float64_t[:,:,:] image - np.float64_t[:,:] zbuffer - np.int64_t[:,:] image_used - np.int64_t[:,:] mesh_lines - np.float64_t pdx, pdy - np.float64_t bounds[4] - np.float64_t[:,:] camera_data # position, width, unit_vec[0,2] - int nv[2] - np.float64_t *x_vec - np.float64_t *y_vec - - -ctypedef int calculate_extent_function(ImageContainer *image, - VolumeContainer *vc, np.int64_t rv[4]) nogil except -1 - -ctypedef void generate_vector_info_function(ImageContainer *im, - np.int64_t vi, np.int64_t vj, - np.float64_t width[2], - np.float64_t v_dir[3], np.float64_t v_pos[3]) nogil - cdef generate_vector_info_function generate_vector_info_plane_parallel cdef generate_vector_info_function generate_vector_info_null cdef calculate_extent_function calculate_extent_plane_parallel diff -Nru yt-3.3.3/yt/utilities/lib/lenses.pyx yt-3.4.0/yt/utilities/lib/lenses.pyx --- yt-3.3.3/yt/utilities/lib/lenses.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/lenses.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -16,12 +16,12 @@ import numpy as np cimport numpy as np cimport cython -from .image_samplers cimport ImageContainer +from .image_samplers cimport ImageSampler @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) -cdef int calculate_extent_plane_parallel(ImageContainer *image, +cdef int calculate_extent_plane_parallel(ImageSampler image, VolumeContainer *vc, np.int64_t rv[4]) nogil except -1: # We do this for all eight corners cdef np.float64_t temp @@ -59,7 +59,7 @@ @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) -cdef int calculate_extent_perspective(ImageContainer *image, +cdef int calculate_extent_perspective(ImageSampler image, VolumeContainer *vc, np.int64_t rv[4]) nogil except -1: cdef np.float64_t cam_pos[3] @@ -140,8 +140,9 @@ if acos(sight_angle_cos) < 0.5 * M_PI and sight_angle_cos != 0.0: sight_length = cam_width[2] / sight_angle_cos else: - sight_length = sqrt(cam_width[0]**2 + cam_width[1]**2) - sight_length = sight_length / sqrt(1.0 - sight_angle_cos**2) + sight_length = sqrt(cam_width[0] * cam_width[0] + + cam_width[1] * cam_width[1]) + sight_length /= sqrt(1.0 - sight_angle_cos * sight_angle_cos) fma(sight_length, sight_vector, cam_pos, pos1) subtract(pos1, sight_center, pos1) @@ -167,7 +168,7 @@ @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) -cdef int calculate_extent_null(ImageContainer *image, +cdef int calculate_extent_null(ImageSampler image, VolumeContainer *vc, np.int64_t rv[4]) nogil except -1: rv[0] = 0 rv[1] = image.nv[0] @@ -177,7 +178,7 @@ @cython.boundscheck(False) @cython.wraparound(False) -cdef void generate_vector_info_plane_parallel(ImageContainer *im, +cdef void generate_vector_info_plane_parallel(ImageSampler im, np.int64_t vi, np.int64_t vj, np.float64_t width[2], # Now outbound @@ -194,7 +195,7 @@ @cython.boundscheck(False) @cython.wraparound(False) -cdef void generate_vector_info_null(ImageContainer *im, +cdef void generate_vector_info_null(ImageSampler im, np.int64_t vi, np.int64_t vj, np.float64_t width[2], # Now outbound diff -Nru yt-3.3.3/yt/utilities/lib/line_integral_convolution.c yt-3.4.0/yt/utilities/lib/line_integral_convolution.c --- yt-3.3.3/yt/utilities/lib/line_integral_convolution.c 2016-12-12 01:41:52.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/line_integral_convolution.c 2017-08-10 18:20:45.000000000 +0000 @@ -1,9 +1,13 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { "distutils": { - "depends": [] + "depends": [], + "name": "yt.utilities.lib.line_integral_convolution", + "sources": [ + "yt/utilities/lib/line_integral_convolution.pyx" + ] }, "module_name": "yt.utilities.lib.line_integral_convolution" } @@ -16,7 +20,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -38,6 +42,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -190,16 +195,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -326,6 +335,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -380,6 +395,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -487,8 +531,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -501,8 +545,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -624,10 +671,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1058,7 +1107,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); @@ -1205,6 +1254,9 @@ /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1456,9 +1508,9 @@ static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_line_integral_convolution_2d[] = "line_integral_convolution_2d"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/line_integral_convolution.pyx"; static const char __pyx_k_Utilities_for_line_integral_con[] = "\nUtilities for line integral convolution annotation\n\n\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)"; @@ -1466,15 +1518,16 @@ static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_utilities_lib_line_integral_c[] = "yt.utilities.lib.line_integral_convolution"; +static const char __pyx_k_yt_utilities_lib_line_integral_c[] = "yt/utilities/lib/line_integral_convolution.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_utilities_lib_line_integral_c_2[] = "yt.utilities.lib.line_integral_convolution"; 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_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_double; static PyObject *__pyx_n_s_dtype; @@ -1505,7 +1558,8 @@ static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_y; -static PyObject *__pyx_n_s_yt_utilities_lib_line_integral_c; +static PyObject *__pyx_kp_s_yt_utilities_lib_line_integral_c; +static PyObject *__pyx_n_s_yt_utilities_lib_line_integral_c_2; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_2yt_9utilities_3lib_25line_integral_convolution_line_integral_convolution_2d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vectors, PyArrayObject *__pyx_v_texture, PyArrayObject *__pyx_v_kernel); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ @@ -1938,8 +1992,11 @@ 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; } @@ -1948,11 +2005,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vectors)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_texture)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line_integral_convolution_2d", 1, 3, 3, 1); __PYX_ERR(0, 64, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel)) != 0)) kw_args--; else { @@ -4887,7 +4946,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -4935,7 +4994,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -5018,7 +5077,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5066,7 +5125,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -5149,7 +5208,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5194,7 +5253,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -5248,8 +5307,8 @@ {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 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_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, @@ -5280,7 +5339,8 @@ {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_line_integral_c, __pyx_k_yt_utilities_lib_line_integral_c, sizeof(__pyx_k_yt_utilities_lib_line_integral_c), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_line_integral_c, __pyx_k_yt_utilities_lib_line_integral_c, sizeof(__pyx_k_yt_utilities_lib_line_integral_c), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_line_integral_c_2, __pyx_k_yt_utilities_lib_line_integral_c_2, sizeof(__pyx_k_yt_utilities_lib_line_integral_c_2), 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} }; @@ -5419,7 +5479,7 @@ __pyx_tuple__12 = PyTuple_Pack(15, __pyx_n_s_vectors, __pyx_n_s_texture, __pyx_n_s_kernel, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_l, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_h, __pyx_n_s_w, __pyx_n_s_kernellen, __pyx_n_s_fx, __pyx_n_s_fy, __pyx_n_s_result, __pyx_n_s_t); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_line_integral_convolution_2d, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_line_integral_c, __pyx_n_s_line_integral_convolution_2d, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -5491,6 +5551,7 @@ __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 @@ -5558,7 +5619,7 @@ * np.ndarray[double, ndim=3] vectors, * np.ndarray[double, ndim=2] texture, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_25line_integral_convolution_1line_integral_convolution_2d, NULL, __pyx_n_s_yt_utilities_lib_line_integral_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_25line_integral_convolution_1line_integral_convolution_2d, NULL, __pyx_n_s_yt_utilities_lib_line_integral_c_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_line_integral_convolution_2d, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5588,7 +5649,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.line_integral_convolution", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.line_integral_convolution", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -6417,17 +6478,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -6546,8 +6612,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON @@ -6587,11 +6653,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -6614,7 +6676,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -6635,7 +6697,7 @@ #endif /* None */ - static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + 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)); @@ -6643,13 +6705,13 @@ } /* BufferIndexError */ - static void __Pyx_RaiseBufferIndexError(int axis) { + static void __Pyx_RaiseBufferIndexError(int axis) { PyErr_Format(PyExc_IndexError, "Out of bounds on buffer access (axis %d)", axis); } /* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE + #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; @@ -6673,7 +6735,7 @@ #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -6836,25 +6898,25 @@ #endif /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -6878,7 +6940,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -6888,7 +6950,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -6949,7 +7011,7 @@ } /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -7022,8 +7084,42 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -7103,7 +7199,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -7162,12 +7258,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -7204,8 +7303,8 @@ #endif - /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + /* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -7236,7 +7335,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -7258,7 +7357,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -7278,7 +7377,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -7413,7 +7512,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -7433,7 +7532,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -7568,7 +7667,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -7599,7 +7698,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -7788,7 +7887,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -7819,7 +7918,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -8008,7 +8107,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -8024,7 +8123,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -8042,7 +8141,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -8107,7 +8206,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -8132,6 +8231,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -8140,11 +8241,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/marching_cubes.c yt-3.4.0/yt/utilities/lib/marching_cubes.c --- yt-3.3.3/yt/utilities/lib/marching_cubes.c 2016-12-12 01:41:52.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/marching_cubes.c 2017-08-10 18:20:45.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -8,10 +8,17 @@ "yt/utilities/lib/marching_cubes.h" ], "include_dirs": [ + "yt/utilities/lib", + "./yt/utilities/lib", "yt/utilities/lib/" ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.marching_cubes", + "sources": [ + "yt/utilities/lib/marching_cubes.pyx", + "yt/utilities/lib/fixed_interpolator.c" ] }, "module_name": "yt.utilities.lib.marching_cubes" @@ -25,7 +32,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -47,6 +54,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -199,16 +207,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -335,6 +347,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -389,6 +407,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -452,6 +499,7 @@ #include #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" +#include #include "fixed_interpolator.h" #include "marching_cubes.h" #ifdef _OPENMP @@ -498,8 +546,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -512,8 +560,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -635,10 +686,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -966,7 +1019,7 @@ struct __pyx_t_2yt_9utilities_3lib_14marching_cubes_TriangleCollection; struct __pyx_opt_args_2yt_9utilities_3lib_14marching_cubes_FillTriangleValues; -/* "yt/utilities/lib/marching_cubes.pyx":27 +/* "yt/utilities/lib/marching_cubes.pyx":34 * int edge_table[256] * * cdef struct Triangle: # <<<<<<<<<<<<<< @@ -979,7 +1032,7 @@ __pyx_t_5numpy_float64_t val[3]; }; -/* "yt/utilities/lib/marching_cubes.pyx":32 +/* "yt/utilities/lib/marching_cubes.pyx":39 * np.float64_t val[3] # Usually only use one value * * cdef struct TriangleCollection: # <<<<<<<<<<<<<< @@ -992,7 +1045,7 @@ struct __pyx_t_2yt_9utilities_3lib_14marching_cubes_Triangle *current; }; -/* "yt/utilities/lib/marching_cubes.pyx":60 +/* "yt/utilities/lib/marching_cubes.pyx":67 * return count * * cdef void FillTriangleValues(np.ndarray[np.float64_t, ndim=1] values, # <<<<<<<<<<<<<< @@ -1094,7 +1147,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* BufferIndexError.proto */ static void __Pyx_RaiseBufferIndexError(int axis); @@ -1163,6 +1216,30 @@ #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); @@ -1226,6 +1303,12 @@ /* 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 */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1439,13 +1522,15 @@ /* Module declarations from 'cython' */ /* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +/* Module declarations from 'libc.math' */ + /* Module declarations from 'yt.utilities.lib.fixed_interpolator' */ /* Module declarations from 'yt.utilities.lib.marching_cubes' */ @@ -1498,6 +1583,7 @@ static const char __pyx_k_point[] = "point"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_sdata[] = "sdata"; +static const char __pyx_k_units[] = "units"; static const char __pyx_k_zeros[] = "zeros"; static const char __pyx_k_center[] = "center"; static const char __pyx_k_import[] = "__import__"; @@ -1508,6 +1594,7 @@ static const char __pyx_k_v2data[] = "v2data"; static const char __pyx_k_v3data[] = "v3data"; static const char __pyx_k_values[] = "values"; +static const char __pyx_k_YTArray[] = "YTArray"; static const char __pyx_k_current[] = "current"; static const char __pyx_k_float64[] = "float64"; static const char __pyx_k_intdata[] = "intdata"; @@ -1525,28 +1612,31 @@ static const char __pyx_k_sample_type[] = "sample_type"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_march_cubes_grid[] = "march_cubes_grid"; +static const char __pyx_k_yt_units_yt_array[] = "yt.units.yt_array"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_march_cubes_grid_flux[] = "march_cubes_grid_flux"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_Marching_cubes_implementation[] = "\nMarching cubes implementation\n\n\n\n"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/marching_cubes.pyx"; 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_yt_utilities_lib_marching_cubes[] = "yt.utilities.lib.marching_cubes"; +static const char __pyx_k_yt_utilities_lib_marching_cubes[] = "yt/utilities/lib/marching_cubes.pyx"; 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_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_utilities_lib_marching_cubes_2[] = "yt.utilities.lib.marching_cubes"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; 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_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_YTArray; static PyObject *__pyx_n_s_area; static PyObject *__pyx_n_s_cell_pos; static PyObject *__pyx_n_s_center; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_current; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_dds; @@ -1597,6 +1687,7 @@ static PyObject *__pyx_n_s_temp; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_triangles; +static PyObject *__pyx_n_s_units; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; static PyObject *__pyx_n_s_v1; static PyObject *__pyx_n_s_v1data; @@ -1607,7 +1698,9 @@ static PyObject *__pyx_n_s_values; static PyObject *__pyx_n_s_vertices; static PyObject *__pyx_n_s_wval; -static PyObject *__pyx_n_s_yt_utilities_lib_marching_cubes; +static PyObject *__pyx_n_s_yt_units_yt_array; +static PyObject *__pyx_kp_s_yt_utilities_lib_marching_cubes; +static PyObject *__pyx_n_s_yt_utilities_lib_marching_cubes_2; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_2yt_9utilities_3lib_14marching_cubes_march_cubes_grid(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_float64_t __pyx_v_isovalue, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_dxs, PyObject *__pyx_v_obj_sample, int __pyx_v_sample_type); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14marching_cubes_2march_cubes_grid_flux(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_float64_t __pyx_v_isovalue, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_v1, PyArrayObject *__pyx_v_v2, PyArrayObject *__pyx_v_v3, PyArrayObject *__pyx_v_flux_field, PyArrayObject *__pyx_v_mask, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_dxs); /* proto */ @@ -1629,7 +1722,7 @@ static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; -/* "yt/utilities/lib/marching_cubes.pyx":37 +/* "yt/utilities/lib/marching_cubes.pyx":44 * Triangle *current * * cdef Triangle *AddTriangle(Triangle *self, # <<<<<<<<<<<<<< @@ -1646,7 +1739,7 @@ int __pyx_t_2; __Pyx_RefNannySetupContext("AddTriangle", 0); - /* "yt/utilities/lib/marching_cubes.pyx":39 + /* "yt/utilities/lib/marching_cubes.pyx":46 * cdef Triangle *AddTriangle(Triangle *self, * np.float64_t p0[3], np.float64_t p1[3], np.float64_t p2[3]): * cdef Triangle *nn = malloc(sizeof(Triangle)) # <<<<<<<<<<<<<< @@ -1655,7 +1748,7 @@ */ __pyx_v_nn = ((struct __pyx_t_2yt_9utilities_3lib_14marching_cubes_Triangle *)malloc((sizeof(struct __pyx_t_2yt_9utilities_3lib_14marching_cubes_Triangle)))); - /* "yt/utilities/lib/marching_cubes.pyx":40 + /* "yt/utilities/lib/marching_cubes.pyx":47 * np.float64_t p0[3], np.float64_t p1[3], np.float64_t p2[3]): * cdef Triangle *nn = malloc(sizeof(Triangle)) * if self != NULL: # <<<<<<<<<<<<<< @@ -1665,7 +1758,7 @@ __pyx_t_1 = ((__pyx_v_self != NULL) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/marching_cubes.pyx":41 + /* "yt/utilities/lib/marching_cubes.pyx":48 * cdef Triangle *nn = malloc(sizeof(Triangle)) * if self != NULL: * self.next = nn # <<<<<<<<<<<<<< @@ -1674,7 +1767,7 @@ */ __pyx_v_self->next = __pyx_v_nn; - /* "yt/utilities/lib/marching_cubes.pyx":40 + /* "yt/utilities/lib/marching_cubes.pyx":47 * np.float64_t p0[3], np.float64_t p1[3], np.float64_t p2[3]): * cdef Triangle *nn = malloc(sizeof(Triangle)) * if self != NULL: # <<<<<<<<<<<<<< @@ -1683,7 +1776,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":43 + /* "yt/utilities/lib/marching_cubes.pyx":50 * self.next = nn * cdef int i * for i in range(3): # <<<<<<<<<<<<<< @@ -1693,7 +1786,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/marching_cubes.pyx":44 + /* "yt/utilities/lib/marching_cubes.pyx":51 * cdef int i * for i in range(3): * nn.p[0][i] = p0[i] # <<<<<<<<<<<<<< @@ -1703,7 +1796,7 @@ ((__pyx_v_nn->p[0])[__pyx_v_i]) = (__pyx_v_p0[__pyx_v_i]); } - /* "yt/utilities/lib/marching_cubes.pyx":45 + /* "yt/utilities/lib/marching_cubes.pyx":52 * for i in range(3): * nn.p[0][i] = p0[i] * for i in range(3): # <<<<<<<<<<<<<< @@ -1713,7 +1806,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/marching_cubes.pyx":46 + /* "yt/utilities/lib/marching_cubes.pyx":53 * nn.p[0][i] = p0[i] * for i in range(3): * nn.p[1][i] = p1[i] # <<<<<<<<<<<<<< @@ -1723,7 +1816,7 @@ ((__pyx_v_nn->p[1])[__pyx_v_i]) = (__pyx_v_p1[__pyx_v_i]); } - /* "yt/utilities/lib/marching_cubes.pyx":47 + /* "yt/utilities/lib/marching_cubes.pyx":54 * for i in range(3): * nn.p[1][i] = p1[i] * for i in range(3): # <<<<<<<<<<<<<< @@ -1733,7 +1826,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/marching_cubes.pyx":48 + /* "yt/utilities/lib/marching_cubes.pyx":55 * nn.p[1][i] = p1[i] * for i in range(3): * nn.p[2][i] = p2[i] # <<<<<<<<<<<<<< @@ -1743,7 +1836,7 @@ ((__pyx_v_nn->p[2])[__pyx_v_i]) = (__pyx_v_p2[__pyx_v_i]); } - /* "yt/utilities/lib/marching_cubes.pyx":49 + /* "yt/utilities/lib/marching_cubes.pyx":56 * for i in range(3): * nn.p[2][i] = p2[i] * nn.next = NULL # <<<<<<<<<<<<<< @@ -1752,7 +1845,7 @@ */ __pyx_v_nn->next = NULL; - /* "yt/utilities/lib/marching_cubes.pyx":50 + /* "yt/utilities/lib/marching_cubes.pyx":57 * nn.p[2][i] = p2[i] * nn.next = NULL * return nn # <<<<<<<<<<<<<< @@ -1762,7 +1855,7 @@ __pyx_r = __pyx_v_nn; goto __pyx_L0; - /* "yt/utilities/lib/marching_cubes.pyx":37 + /* "yt/utilities/lib/marching_cubes.pyx":44 * Triangle *current * * cdef Triangle *AddTriangle(Triangle *self, # <<<<<<<<<<<<<< @@ -1776,7 +1869,7 @@ return __pyx_r; } -/* "yt/utilities/lib/marching_cubes.pyx":52 +/* "yt/utilities/lib/marching_cubes.pyx":59 * return nn * * cdef int CountTriangles(Triangle *first): # <<<<<<<<<<<<<< @@ -1793,7 +1886,7 @@ struct __pyx_t_2yt_9utilities_3lib_14marching_cubes_Triangle *__pyx_t_2; __Pyx_RefNannySetupContext("CountTriangles", 0); - /* "yt/utilities/lib/marching_cubes.pyx":53 + /* "yt/utilities/lib/marching_cubes.pyx":60 * * cdef int CountTriangles(Triangle *first): * cdef int count = 0 # <<<<<<<<<<<<<< @@ -1802,7 +1895,7 @@ */ __pyx_v_count = 0; - /* "yt/utilities/lib/marching_cubes.pyx":54 + /* "yt/utilities/lib/marching_cubes.pyx":61 * cdef int CountTriangles(Triangle *first): * cdef int count = 0 * cdef Triangle *this = first # <<<<<<<<<<<<<< @@ -1811,7 +1904,7 @@ */ __pyx_v_this = __pyx_v_first; - /* "yt/utilities/lib/marching_cubes.pyx":55 + /* "yt/utilities/lib/marching_cubes.pyx":62 * cdef int count = 0 * cdef Triangle *this = first * while this != NULL: # <<<<<<<<<<<<<< @@ -1822,7 +1915,7 @@ __pyx_t_1 = ((__pyx_v_this != NULL) != 0); if (!__pyx_t_1) break; - /* "yt/utilities/lib/marching_cubes.pyx":56 + /* "yt/utilities/lib/marching_cubes.pyx":63 * cdef Triangle *this = first * while this != NULL: * count += 1 # <<<<<<<<<<<<<< @@ -1831,7 +1924,7 @@ */ __pyx_v_count = (__pyx_v_count + 1); - /* "yt/utilities/lib/marching_cubes.pyx":57 + /* "yt/utilities/lib/marching_cubes.pyx":64 * while this != NULL: * count += 1 * this = this.next # <<<<<<<<<<<<<< @@ -1842,7 +1935,7 @@ __pyx_v_this = __pyx_t_2; } - /* "yt/utilities/lib/marching_cubes.pyx":58 + /* "yt/utilities/lib/marching_cubes.pyx":65 * count += 1 * this = this.next * return count # <<<<<<<<<<<<<< @@ -1852,7 +1945,7 @@ __pyx_r = __pyx_v_count; goto __pyx_L0; - /* "yt/utilities/lib/marching_cubes.pyx":52 + /* "yt/utilities/lib/marching_cubes.pyx":59 * return nn * * cdef int CountTriangles(Triangle *first): # <<<<<<<<<<<<<< @@ -1866,7 +1959,7 @@ return __pyx_r; } -/* "yt/utilities/lib/marching_cubes.pyx":60 +/* "yt/utilities/lib/marching_cubes.pyx":67 * return count * * cdef void FillTriangleValues(np.ndarray[np.float64_t, ndim=1] values, # <<<<<<<<<<<<<< @@ -1900,11 +1993,11 @@ __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 60, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 67, __pyx_L1_error) } __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/marching_cubes.pyx":62 + /* "yt/utilities/lib/marching_cubes.pyx":69 * cdef void FillTriangleValues(np.ndarray[np.float64_t, ndim=1] values, * Triangle *first, int nskip = 1): * cdef Triangle *this = first # <<<<<<<<<<<<<< @@ -1913,7 +2006,7 @@ */ __pyx_v_this = __pyx_v_first; - /* "yt/utilities/lib/marching_cubes.pyx":63 + /* "yt/utilities/lib/marching_cubes.pyx":70 * Triangle *first, int nskip = 1): * cdef Triangle *this = first * cdef int i = 0 # <<<<<<<<<<<<<< @@ -1922,7 +2015,7 @@ */ __pyx_v_i = 0; - /* "yt/utilities/lib/marching_cubes.pyx":65 + /* "yt/utilities/lib/marching_cubes.pyx":72 * cdef int i = 0 * cdef int j * while this != NULL: # <<<<<<<<<<<<<< @@ -1933,7 +2026,7 @@ __pyx_t_1 = ((__pyx_v_this != NULL) != 0); if (!__pyx_t_1) break; - /* "yt/utilities/lib/marching_cubes.pyx":66 + /* "yt/utilities/lib/marching_cubes.pyx":73 * cdef int j * while this != NULL: * for j in range(nskip): # <<<<<<<<<<<<<< @@ -1944,7 +2037,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_j = __pyx_t_3; - /* "yt/utilities/lib/marching_cubes.pyx":67 + /* "yt/utilities/lib/marching_cubes.pyx":74 * while this != NULL: * for j in range(nskip): * values[i*nskip + j] = this.val[j] # <<<<<<<<<<<<<< @@ -1959,12 +2052,12 @@ } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 67, __pyx_L1_error) + __PYX_ERR(0, 74, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides) = (__pyx_v_this->val[__pyx_v_j]); } - /* "yt/utilities/lib/marching_cubes.pyx":68 + /* "yt/utilities/lib/marching_cubes.pyx":75 * for j in range(nskip): * values[i*nskip + j] = this.val[j] * i += 1 # <<<<<<<<<<<<<< @@ -1973,7 +2066,7 @@ */ __pyx_v_i = (__pyx_v_i + 1); - /* "yt/utilities/lib/marching_cubes.pyx":69 + /* "yt/utilities/lib/marching_cubes.pyx":76 * values[i*nskip + j] = this.val[j] * i += 1 * this = this.next # <<<<<<<<<<<<<< @@ -1984,7 +2077,7 @@ __pyx_v_this = __pyx_t_6; } - /* "yt/utilities/lib/marching_cubes.pyx":60 + /* "yt/utilities/lib/marching_cubes.pyx":67 * return count * * cdef void FillTriangleValues(np.ndarray[np.float64_t, ndim=1] values, # <<<<<<<<<<<<<< @@ -2001,7 +2094,7 @@ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.utilities.lib.marching_cubes.FillTriangleValues", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.marching_cubes.FillTriangleValues", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); @@ -2009,7 +2102,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/marching_cubes.pyx":71 +/* "yt/utilities/lib/marching_cubes.pyx":78 * this = this.next * * cdef void WipeTriangles(Triangle *first): # <<<<<<<<<<<<<< @@ -2025,7 +2118,7 @@ struct __pyx_t_2yt_9utilities_3lib_14marching_cubes_Triangle *__pyx_t_2; __Pyx_RefNannySetupContext("WipeTriangles", 0); - /* "yt/utilities/lib/marching_cubes.pyx":72 + /* "yt/utilities/lib/marching_cubes.pyx":79 * * cdef void WipeTriangles(Triangle *first): * cdef Triangle *this = first # <<<<<<<<<<<<<< @@ -2034,7 +2127,7 @@ */ __pyx_v_this = __pyx_v_first; - /* "yt/utilities/lib/marching_cubes.pyx":74 + /* "yt/utilities/lib/marching_cubes.pyx":81 * cdef Triangle *this = first * cdef Triangle *last * while this != NULL: # <<<<<<<<<<<<<< @@ -2045,7 +2138,7 @@ __pyx_t_1 = ((__pyx_v_this != NULL) != 0); if (!__pyx_t_1) break; - /* "yt/utilities/lib/marching_cubes.pyx":75 + /* "yt/utilities/lib/marching_cubes.pyx":82 * cdef Triangle *last * while this != NULL: * last = this # <<<<<<<<<<<<<< @@ -2054,7 +2147,7 @@ */ __pyx_v_last = __pyx_v_this; - /* "yt/utilities/lib/marching_cubes.pyx":76 + /* "yt/utilities/lib/marching_cubes.pyx":83 * while this != NULL: * last = this * this = this.next # <<<<<<<<<<<<<< @@ -2064,7 +2157,7 @@ __pyx_t_2 = __pyx_v_this->next; __pyx_v_this = __pyx_t_2; - /* "yt/utilities/lib/marching_cubes.pyx":77 + /* "yt/utilities/lib/marching_cubes.pyx":84 * last = this * this = this.next * free(last) # <<<<<<<<<<<<<< @@ -2074,7 +2167,7 @@ free(__pyx_v_last); } - /* "yt/utilities/lib/marching_cubes.pyx":71 + /* "yt/utilities/lib/marching_cubes.pyx":78 * this = this.next * * cdef void WipeTriangles(Triangle *first): # <<<<<<<<<<<<<< @@ -2086,7 +2179,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/marching_cubes.pyx":79 +/* "yt/utilities/lib/marching_cubes.pyx":86 * free(last) * * cdef void FillAndWipeTriangles(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< @@ -2117,11 +2210,11 @@ __pyx_pybuffernd_vertices.rcbuffer = &__pyx_pybuffer_vertices; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 79, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 86, __pyx_L1_error) } __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/marching_cubes.pyx":81 + /* "yt/utilities/lib/marching_cubes.pyx":88 * cdef void FillAndWipeTriangles(np.ndarray[np.float64_t, ndim=2] vertices, * Triangle *first): * cdef int count = 0 # <<<<<<<<<<<<<< @@ -2130,7 +2223,7 @@ */ __pyx_v_count = 0; - /* "yt/utilities/lib/marching_cubes.pyx":82 + /* "yt/utilities/lib/marching_cubes.pyx":89 * Triangle *first): * cdef int count = 0 * cdef Triangle *this = first # <<<<<<<<<<<<<< @@ -2139,7 +2232,7 @@ */ __pyx_v_this = __pyx_v_first; - /* "yt/utilities/lib/marching_cubes.pyx":85 + /* "yt/utilities/lib/marching_cubes.pyx":92 * cdef Triangle *last * cdef int i, j * while this != NULL: # <<<<<<<<<<<<<< @@ -2150,7 +2243,7 @@ __pyx_t_1 = ((__pyx_v_this != NULL) != 0); if (!__pyx_t_1) break; - /* "yt/utilities/lib/marching_cubes.pyx":86 + /* "yt/utilities/lib/marching_cubes.pyx":93 * cdef int i, j * while this != NULL: * for i in range(3): # <<<<<<<<<<<<<< @@ -2160,7 +2253,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/marching_cubes.pyx":87 + /* "yt/utilities/lib/marching_cubes.pyx":94 * while this != NULL: * for i in range(3): * for j in range(3): # <<<<<<<<<<<<<< @@ -2170,7 +2263,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_j = __pyx_t_3; - /* "yt/utilities/lib/marching_cubes.pyx":88 + /* "yt/utilities/lib/marching_cubes.pyx":95 * for i in range(3): * for j in range(3): * vertices[count, j] = this.p[i][j] # <<<<<<<<<<<<<< @@ -2190,12 +2283,12 @@ } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_vertices.diminfo[1].shape)) __pyx_t_6 = 1; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 88, __pyx_L1_error) + __PYX_ERR(0, 95, __pyx_L1_error) } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vertices.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_vertices.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_vertices.diminfo[1].strides) = ((__pyx_v_this->p[__pyx_v_i])[__pyx_v_j]); } - /* "yt/utilities/lib/marching_cubes.pyx":89 + /* "yt/utilities/lib/marching_cubes.pyx":96 * for j in range(3): * vertices[count, j] = this.p[i][j] * count += 1 # Do it at the end because it's an index # <<<<<<<<<<<<<< @@ -2205,7 +2298,7 @@ __pyx_v_count = (__pyx_v_count + 1); } - /* "yt/utilities/lib/marching_cubes.pyx":90 + /* "yt/utilities/lib/marching_cubes.pyx":97 * vertices[count, j] = this.p[i][j] * count += 1 # Do it at the end because it's an index * last = this # <<<<<<<<<<<<<< @@ -2214,7 +2307,7 @@ */ __pyx_v_last = __pyx_v_this; - /* "yt/utilities/lib/marching_cubes.pyx":91 + /* "yt/utilities/lib/marching_cubes.pyx":98 * count += 1 # Do it at the end because it's an index * last = this * this = this.next # <<<<<<<<<<<<<< @@ -2224,7 +2317,7 @@ __pyx_t_7 = __pyx_v_this->next; __pyx_v_this = __pyx_t_7; - /* "yt/utilities/lib/marching_cubes.pyx":92 + /* "yt/utilities/lib/marching_cubes.pyx":99 * last = this * this = this.next * free(last) # <<<<<<<<<<<<<< @@ -2234,7 +2327,7 @@ free(__pyx_v_last); } - /* "yt/utilities/lib/marching_cubes.pyx":79 + /* "yt/utilities/lib/marching_cubes.pyx":86 * free(last) * * cdef void FillAndWipeTriangles(np.ndarray[np.float64_t, ndim=2] vertices, # <<<<<<<<<<<<<< @@ -2251,7 +2344,7 @@ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.utilities.lib.marching_cubes.FillAndWipeTriangles", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.marching_cubes.FillAndWipeTriangles", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vertices.rcbuffer->pybuffer); @@ -2259,7 +2352,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/marching_cubes.pyx":97 +/* "yt/utilities/lib/marching_cubes.pyx":104 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int march_cubes( # <<<<<<<<<<<<<< @@ -2279,7 +2372,7 @@ struct __pyx_t_2yt_9utilities_3lib_14marching_cubes_Triangle *__pyx_t_3; __Pyx_RefNannySetupContext("march_cubes", 0); - /* "yt/utilities/lib/marching_cubes.pyx":104 + /* "yt/utilities/lib/marching_cubes.pyx":111 * * cdef np.float64_t vertlist[12][3] * cdef int cubeindex = 0 # <<<<<<<<<<<<<< @@ -2288,7 +2381,7 @@ */ __pyx_v_cubeindex = 0; - /* "yt/utilities/lib/marching_cubes.pyx":106 + /* "yt/utilities/lib/marching_cubes.pyx":113 * cdef int cubeindex = 0 * cdef int n * cdef int nt = 0 # <<<<<<<<<<<<<< @@ -2297,7 +2390,7 @@ */ __pyx_v_nt = 0; - /* "yt/utilities/lib/marching_cubes.pyx":107 + /* "yt/utilities/lib/marching_cubes.pyx":114 * cdef int n * cdef int nt = 0 * for n in range(8): # <<<<<<<<<<<<<< @@ -2307,7 +2400,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 8; __pyx_t_1+=1) { __pyx_v_n = __pyx_t_1; - /* "yt/utilities/lib/marching_cubes.pyx":108 + /* "yt/utilities/lib/marching_cubes.pyx":115 * cdef int nt = 0 * for n in range(8): * if gv[n] < isovalue: # <<<<<<<<<<<<<< @@ -2317,7 +2410,7 @@ __pyx_t_2 = (((__pyx_v_gv[__pyx_v_n]) < __pyx_v_isovalue) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":109 + /* "yt/utilities/lib/marching_cubes.pyx":116 * for n in range(8): * if gv[n] < isovalue: * cubeindex |= (1 << n) # <<<<<<<<<<<<<< @@ -2326,7 +2419,7 @@ */ __pyx_v_cubeindex = (__pyx_v_cubeindex | (1 << __pyx_v_n)); - /* "yt/utilities/lib/marching_cubes.pyx":108 + /* "yt/utilities/lib/marching_cubes.pyx":115 * cdef int nt = 0 * for n in range(8): * if gv[n] < isovalue: # <<<<<<<<<<<<<< @@ -2336,7 +2429,7 @@ } } - /* "yt/utilities/lib/marching_cubes.pyx":110 + /* "yt/utilities/lib/marching_cubes.pyx":117 * if gv[n] < isovalue: * cubeindex |= (1 << n) * if edge_table[cubeindex] == 0: # <<<<<<<<<<<<<< @@ -2346,7 +2439,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) == 0) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":111 + /* "yt/utilities/lib/marching_cubes.pyx":118 * cubeindex |= (1 << n) * if edge_table[cubeindex] == 0: * return 0 # <<<<<<<<<<<<<< @@ -2356,7 +2449,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/marching_cubes.pyx":110 + /* "yt/utilities/lib/marching_cubes.pyx":117 * if gv[n] < isovalue: * cubeindex |= (1 << n) * if edge_table[cubeindex] == 0: # <<<<<<<<<<<<<< @@ -2365,7 +2458,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":112 + /* "yt/utilities/lib/marching_cubes.pyx":119 * if edge_table[cubeindex] == 0: * return 0 * if (edge_table[cubeindex] & 1): # 0,0,0 with 1,0,0 # <<<<<<<<<<<<<< @@ -2375,7 +2468,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) & 1) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":113 + /* "yt/utilities/lib/marching_cubes.pyx":120 * return 0 * if (edge_table[cubeindex] & 1): # 0,0,0 with 1,0,0 * vertex_interp(gv[0], gv[1], isovalue, vertlist[0], # <<<<<<<<<<<<<< @@ -2384,7 +2477,7 @@ */ vertex_interp((__pyx_v_gv[0]), (__pyx_v_gv[1]), __pyx_v_isovalue, (__pyx_v_vertlist[0]), __pyx_v_dds, __pyx_v_x, __pyx_v_y, __pyx_v_z, 0, 1); - /* "yt/utilities/lib/marching_cubes.pyx":112 + /* "yt/utilities/lib/marching_cubes.pyx":119 * if edge_table[cubeindex] == 0: * return 0 * if (edge_table[cubeindex] & 1): # 0,0,0 with 1,0,0 # <<<<<<<<<<<<<< @@ -2393,7 +2486,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":115 + /* "yt/utilities/lib/marching_cubes.pyx":122 * vertex_interp(gv[0], gv[1], isovalue, vertlist[0], * dds, x, y, z, 0, 1) * if (edge_table[cubeindex] & 2): # 1,0,0 with 1,1,0 # <<<<<<<<<<<<<< @@ -2403,7 +2496,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) & 2) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":116 + /* "yt/utilities/lib/marching_cubes.pyx":123 * dds, x, y, z, 0, 1) * if (edge_table[cubeindex] & 2): # 1,0,0 with 1,1,0 * vertex_interp(gv[1], gv[2], isovalue, vertlist[1], # <<<<<<<<<<<<<< @@ -2412,7 +2505,7 @@ */ vertex_interp((__pyx_v_gv[1]), (__pyx_v_gv[2]), __pyx_v_isovalue, (__pyx_v_vertlist[1]), __pyx_v_dds, __pyx_v_x, __pyx_v_y, __pyx_v_z, 1, 2); - /* "yt/utilities/lib/marching_cubes.pyx":115 + /* "yt/utilities/lib/marching_cubes.pyx":122 * vertex_interp(gv[0], gv[1], isovalue, vertlist[0], * dds, x, y, z, 0, 1) * if (edge_table[cubeindex] & 2): # 1,0,0 with 1,1,0 # <<<<<<<<<<<<<< @@ -2421,7 +2514,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":118 + /* "yt/utilities/lib/marching_cubes.pyx":125 * vertex_interp(gv[1], gv[2], isovalue, vertlist[1], * dds, x, y, z, 1, 2) * if (edge_table[cubeindex] & 4): # 1,1,0 with 0,1,0 # <<<<<<<<<<<<<< @@ -2431,7 +2524,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) & 4) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":119 + /* "yt/utilities/lib/marching_cubes.pyx":126 * dds, x, y, z, 1, 2) * if (edge_table[cubeindex] & 4): # 1,1,0 with 0,1,0 * vertex_interp(gv[2], gv[3], isovalue, vertlist[2], # <<<<<<<<<<<<<< @@ -2440,7 +2533,7 @@ */ vertex_interp((__pyx_v_gv[2]), (__pyx_v_gv[3]), __pyx_v_isovalue, (__pyx_v_vertlist[2]), __pyx_v_dds, __pyx_v_x, __pyx_v_y, __pyx_v_z, 2, 3); - /* "yt/utilities/lib/marching_cubes.pyx":118 + /* "yt/utilities/lib/marching_cubes.pyx":125 * vertex_interp(gv[1], gv[2], isovalue, vertlist[1], * dds, x, y, z, 1, 2) * if (edge_table[cubeindex] & 4): # 1,1,0 with 0,1,0 # <<<<<<<<<<<<<< @@ -2449,7 +2542,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":121 + /* "yt/utilities/lib/marching_cubes.pyx":128 * vertex_interp(gv[2], gv[3], isovalue, vertlist[2], * dds, x, y, z, 2, 3) * if (edge_table[cubeindex] & 8): # 0,1,0 with 0,0,0 # <<<<<<<<<<<<<< @@ -2459,7 +2552,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) & 8) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":122 + /* "yt/utilities/lib/marching_cubes.pyx":129 * dds, x, y, z, 2, 3) * if (edge_table[cubeindex] & 8): # 0,1,0 with 0,0,0 * vertex_interp(gv[3], gv[0], isovalue, vertlist[3], # <<<<<<<<<<<<<< @@ -2468,7 +2561,7 @@ */ vertex_interp((__pyx_v_gv[3]), (__pyx_v_gv[0]), __pyx_v_isovalue, (__pyx_v_vertlist[3]), __pyx_v_dds, __pyx_v_x, __pyx_v_y, __pyx_v_z, 3, 0); - /* "yt/utilities/lib/marching_cubes.pyx":121 + /* "yt/utilities/lib/marching_cubes.pyx":128 * vertex_interp(gv[2], gv[3], isovalue, vertlist[2], * dds, x, y, z, 2, 3) * if (edge_table[cubeindex] & 8): # 0,1,0 with 0,0,0 # <<<<<<<<<<<<<< @@ -2477,7 +2570,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":124 + /* "yt/utilities/lib/marching_cubes.pyx":131 * vertex_interp(gv[3], gv[0], isovalue, vertlist[3], * dds, x, y, z, 3, 0) * if (edge_table[cubeindex] & 16): # 0,0,1 with 1,0,1 # <<<<<<<<<<<<<< @@ -2487,7 +2580,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) & 16) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":125 + /* "yt/utilities/lib/marching_cubes.pyx":132 * dds, x, y, z, 3, 0) * if (edge_table[cubeindex] & 16): # 0,0,1 with 1,0,1 * vertex_interp(gv[4], gv[5], isovalue, vertlist[4], # <<<<<<<<<<<<<< @@ -2496,7 +2589,7 @@ */ vertex_interp((__pyx_v_gv[4]), (__pyx_v_gv[5]), __pyx_v_isovalue, (__pyx_v_vertlist[4]), __pyx_v_dds, __pyx_v_x, __pyx_v_y, __pyx_v_z, 4, 5); - /* "yt/utilities/lib/marching_cubes.pyx":124 + /* "yt/utilities/lib/marching_cubes.pyx":131 * vertex_interp(gv[3], gv[0], isovalue, vertlist[3], * dds, x, y, z, 3, 0) * if (edge_table[cubeindex] & 16): # 0,0,1 with 1,0,1 # <<<<<<<<<<<<<< @@ -2505,7 +2598,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":127 + /* "yt/utilities/lib/marching_cubes.pyx":134 * vertex_interp(gv[4], gv[5], isovalue, vertlist[4], * dds, x, y, z, 4, 5) * if (edge_table[cubeindex] & 32): # 1,0,1 with 1,1,1 # <<<<<<<<<<<<<< @@ -2515,7 +2608,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) & 32) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":128 + /* "yt/utilities/lib/marching_cubes.pyx":135 * dds, x, y, z, 4, 5) * if (edge_table[cubeindex] & 32): # 1,0,1 with 1,1,1 * vertex_interp(gv[5], gv[6], isovalue, vertlist[5], # <<<<<<<<<<<<<< @@ -2524,7 +2617,7 @@ */ vertex_interp((__pyx_v_gv[5]), (__pyx_v_gv[6]), __pyx_v_isovalue, (__pyx_v_vertlist[5]), __pyx_v_dds, __pyx_v_x, __pyx_v_y, __pyx_v_z, 5, 6); - /* "yt/utilities/lib/marching_cubes.pyx":127 + /* "yt/utilities/lib/marching_cubes.pyx":134 * vertex_interp(gv[4], gv[5], isovalue, vertlist[4], * dds, x, y, z, 4, 5) * if (edge_table[cubeindex] & 32): # 1,0,1 with 1,1,1 # <<<<<<<<<<<<<< @@ -2533,7 +2626,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":130 + /* "yt/utilities/lib/marching_cubes.pyx":137 * vertex_interp(gv[5], gv[6], isovalue, vertlist[5], * dds, x, y, z, 5, 6) * if (edge_table[cubeindex] & 64): # 1,1,1 with 0,1,1 # <<<<<<<<<<<<<< @@ -2543,7 +2636,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) & 64) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":131 + /* "yt/utilities/lib/marching_cubes.pyx":138 * dds, x, y, z, 5, 6) * if (edge_table[cubeindex] & 64): # 1,1,1 with 0,1,1 * vertex_interp(gv[6], gv[7], isovalue, vertlist[6], # <<<<<<<<<<<<<< @@ -2552,7 +2645,7 @@ */ vertex_interp((__pyx_v_gv[6]), (__pyx_v_gv[7]), __pyx_v_isovalue, (__pyx_v_vertlist[6]), __pyx_v_dds, __pyx_v_x, __pyx_v_y, __pyx_v_z, 6, 7); - /* "yt/utilities/lib/marching_cubes.pyx":130 + /* "yt/utilities/lib/marching_cubes.pyx":137 * vertex_interp(gv[5], gv[6], isovalue, vertlist[5], * dds, x, y, z, 5, 6) * if (edge_table[cubeindex] & 64): # 1,1,1 with 0,1,1 # <<<<<<<<<<<<<< @@ -2561,7 +2654,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":133 + /* "yt/utilities/lib/marching_cubes.pyx":140 * vertex_interp(gv[6], gv[7], isovalue, vertlist[6], * dds, x, y, z, 6, 7) * if (edge_table[cubeindex] & 128): # 0,1,1 with 0,0,1 # <<<<<<<<<<<<<< @@ -2571,7 +2664,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) & 0x80) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":134 + /* "yt/utilities/lib/marching_cubes.pyx":141 * dds, x, y, z, 6, 7) * if (edge_table[cubeindex] & 128): # 0,1,1 with 0,0,1 * vertex_interp(gv[7], gv[4], isovalue, vertlist[7], # <<<<<<<<<<<<<< @@ -2580,7 +2673,7 @@ */ vertex_interp((__pyx_v_gv[7]), (__pyx_v_gv[4]), __pyx_v_isovalue, (__pyx_v_vertlist[7]), __pyx_v_dds, __pyx_v_x, __pyx_v_y, __pyx_v_z, 7, 4); - /* "yt/utilities/lib/marching_cubes.pyx":133 + /* "yt/utilities/lib/marching_cubes.pyx":140 * vertex_interp(gv[6], gv[7], isovalue, vertlist[6], * dds, x, y, z, 6, 7) * if (edge_table[cubeindex] & 128): # 0,1,1 with 0,0,1 # <<<<<<<<<<<<<< @@ -2589,7 +2682,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":136 + /* "yt/utilities/lib/marching_cubes.pyx":143 * vertex_interp(gv[7], gv[4], isovalue, vertlist[7], * dds, x, y, z, 7, 4) * if (edge_table[cubeindex] & 256): # 0,0,0 with 0,0,1 # <<<<<<<<<<<<<< @@ -2599,7 +2692,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) & 0x100) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":137 + /* "yt/utilities/lib/marching_cubes.pyx":144 * dds, x, y, z, 7, 4) * if (edge_table[cubeindex] & 256): # 0,0,0 with 0,0,1 * vertex_interp(gv[0], gv[4], isovalue, vertlist[8], # <<<<<<<<<<<<<< @@ -2608,7 +2701,7 @@ */ vertex_interp((__pyx_v_gv[0]), (__pyx_v_gv[4]), __pyx_v_isovalue, (__pyx_v_vertlist[8]), __pyx_v_dds, __pyx_v_x, __pyx_v_y, __pyx_v_z, 0, 4); - /* "yt/utilities/lib/marching_cubes.pyx":136 + /* "yt/utilities/lib/marching_cubes.pyx":143 * vertex_interp(gv[7], gv[4], isovalue, vertlist[7], * dds, x, y, z, 7, 4) * if (edge_table[cubeindex] & 256): # 0,0,0 with 0,0,1 # <<<<<<<<<<<<<< @@ -2617,7 +2710,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":139 + /* "yt/utilities/lib/marching_cubes.pyx":146 * vertex_interp(gv[0], gv[4], isovalue, vertlist[8], * dds, x, y, z, 0, 4) * if (edge_table[cubeindex] & 512): # 1,0,0 with 1,0,1 # <<<<<<<<<<<<<< @@ -2627,7 +2720,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) & 0x200) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":140 + /* "yt/utilities/lib/marching_cubes.pyx":147 * dds, x, y, z, 0, 4) * if (edge_table[cubeindex] & 512): # 1,0,0 with 1,0,1 * vertex_interp(gv[1], gv[5], isovalue, vertlist[9], # <<<<<<<<<<<<<< @@ -2636,7 +2729,7 @@ */ vertex_interp((__pyx_v_gv[1]), (__pyx_v_gv[5]), __pyx_v_isovalue, (__pyx_v_vertlist[9]), __pyx_v_dds, __pyx_v_x, __pyx_v_y, __pyx_v_z, 1, 5); - /* "yt/utilities/lib/marching_cubes.pyx":139 + /* "yt/utilities/lib/marching_cubes.pyx":146 * vertex_interp(gv[0], gv[4], isovalue, vertlist[8], * dds, x, y, z, 0, 4) * if (edge_table[cubeindex] & 512): # 1,0,0 with 1,0,1 # <<<<<<<<<<<<<< @@ -2645,7 +2738,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":142 + /* "yt/utilities/lib/marching_cubes.pyx":149 * vertex_interp(gv[1], gv[5], isovalue, vertlist[9], * dds, x, y, z, 1, 5) * if (edge_table[cubeindex] & 1024): # 1,1,0 with 1,1,1 # <<<<<<<<<<<<<< @@ -2655,7 +2748,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) & 0x400) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":143 + /* "yt/utilities/lib/marching_cubes.pyx":150 * dds, x, y, z, 1, 5) * if (edge_table[cubeindex] & 1024): # 1,1,0 with 1,1,1 * vertex_interp(gv[2], gv[6], isovalue, vertlist[10], # <<<<<<<<<<<<<< @@ -2664,7 +2757,7 @@ */ vertex_interp((__pyx_v_gv[2]), (__pyx_v_gv[6]), __pyx_v_isovalue, (__pyx_v_vertlist[10]), __pyx_v_dds, __pyx_v_x, __pyx_v_y, __pyx_v_z, 2, 6); - /* "yt/utilities/lib/marching_cubes.pyx":142 + /* "yt/utilities/lib/marching_cubes.pyx":149 * vertex_interp(gv[1], gv[5], isovalue, vertlist[9], * dds, x, y, z, 1, 5) * if (edge_table[cubeindex] & 1024): # 1,1,0 with 1,1,1 # <<<<<<<<<<<<<< @@ -2673,7 +2766,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":145 + /* "yt/utilities/lib/marching_cubes.pyx":152 * vertex_interp(gv[2], gv[6], isovalue, vertlist[10], * dds, x, y, z, 2, 6) * if (edge_table[cubeindex] & 2048): # 0,1,0 with 0,1,1 # <<<<<<<<<<<<<< @@ -2683,7 +2776,7 @@ __pyx_t_2 = (((edge_table[__pyx_v_cubeindex]) & 0x800) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":146 + /* "yt/utilities/lib/marching_cubes.pyx":153 * dds, x, y, z, 2, 6) * if (edge_table[cubeindex] & 2048): # 0,1,0 with 0,1,1 * vertex_interp(gv[3], gv[7], isovalue, vertlist[11], # <<<<<<<<<<<<<< @@ -2692,7 +2785,7 @@ */ vertex_interp((__pyx_v_gv[3]), (__pyx_v_gv[7]), __pyx_v_isovalue, (__pyx_v_vertlist[11]), __pyx_v_dds, __pyx_v_x, __pyx_v_y, __pyx_v_z, 3, 7); - /* "yt/utilities/lib/marching_cubes.pyx":145 + /* "yt/utilities/lib/marching_cubes.pyx":152 * vertex_interp(gv[2], gv[6], isovalue, vertlist[10], * dds, x, y, z, 2, 6) * if (edge_table[cubeindex] & 2048): # 0,1,0 with 0,1,1 # <<<<<<<<<<<<<< @@ -2701,7 +2794,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":148 + /* "yt/utilities/lib/marching_cubes.pyx":155 * vertex_interp(gv[3], gv[7], isovalue, vertlist[11], * dds, x, y, z, 3, 7) * n = 0 # <<<<<<<<<<<<<< @@ -2710,7 +2803,7 @@ */ __pyx_v_n = 0; - /* "yt/utilities/lib/marching_cubes.pyx":149 + /* "yt/utilities/lib/marching_cubes.pyx":156 * dds, x, y, z, 3, 7) * n = 0 * while 1: # <<<<<<<<<<<<<< @@ -2719,7 +2812,7 @@ */ while (1) { - /* "yt/utilities/lib/marching_cubes.pyx":150 + /* "yt/utilities/lib/marching_cubes.pyx":157 * n = 0 * while 1: * triangles.current = AddTriangle(triangles.current, # <<<<<<<<<<<<<< @@ -2728,7 +2821,7 @@ */ __pyx_v_triangles->current = __pyx_f_2yt_9utilities_3lib_14marching_cubes_AddTriangle(__pyx_v_triangles->current, (__pyx_v_vertlist[((tri_table[__pyx_v_cubeindex])[__pyx_v_n])]), (__pyx_v_vertlist[((tri_table[__pyx_v_cubeindex])[(__pyx_v_n + 1)])]), (__pyx_v_vertlist[((tri_table[__pyx_v_cubeindex])[(__pyx_v_n + 2)])])); - /* "yt/utilities/lib/marching_cubes.pyx":154 + /* "yt/utilities/lib/marching_cubes.pyx":161 * vertlist[tri_table[cubeindex][n+1]], * vertlist[tri_table[cubeindex][n+2]]) * triangles.count += 1 # <<<<<<<<<<<<<< @@ -2737,7 +2830,7 @@ */ __pyx_v_triangles->count = (__pyx_v_triangles->count + 1); - /* "yt/utilities/lib/marching_cubes.pyx":155 + /* "yt/utilities/lib/marching_cubes.pyx":162 * vertlist[tri_table[cubeindex][n+2]]) * triangles.count += 1 * nt += 1 # <<<<<<<<<<<<<< @@ -2746,7 +2839,7 @@ */ __pyx_v_nt = (__pyx_v_nt + 1); - /* "yt/utilities/lib/marching_cubes.pyx":156 + /* "yt/utilities/lib/marching_cubes.pyx":163 * triangles.count += 1 * nt += 1 * if triangles.first == NULL: # <<<<<<<<<<<<<< @@ -2756,7 +2849,7 @@ __pyx_t_2 = ((__pyx_v_triangles->first == NULL) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":157 + /* "yt/utilities/lib/marching_cubes.pyx":164 * nt += 1 * if triangles.first == NULL: * triangles.first = triangles.current # <<<<<<<<<<<<<< @@ -2766,7 +2859,7 @@ __pyx_t_3 = __pyx_v_triangles->current; __pyx_v_triangles->first = __pyx_t_3; - /* "yt/utilities/lib/marching_cubes.pyx":156 + /* "yt/utilities/lib/marching_cubes.pyx":163 * triangles.count += 1 * nt += 1 * if triangles.first == NULL: # <<<<<<<<<<<<<< @@ -2775,7 +2868,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":158 + /* "yt/utilities/lib/marching_cubes.pyx":165 * if triangles.first == NULL: * triangles.first = triangles.current * n += 3 # <<<<<<<<<<<<<< @@ -2784,7 +2877,7 @@ */ __pyx_v_n = (__pyx_v_n + 3); - /* "yt/utilities/lib/marching_cubes.pyx":159 + /* "yt/utilities/lib/marching_cubes.pyx":166 * triangles.first = triangles.current * n += 3 * if tri_table[cubeindex][n] == -1: break # <<<<<<<<<<<<<< @@ -2798,7 +2891,7 @@ } __pyx_L20_break:; - /* "yt/utilities/lib/marching_cubes.pyx":160 + /* "yt/utilities/lib/marching_cubes.pyx":167 * n += 3 * if tri_table[cubeindex][n] == -1: break * return nt # <<<<<<<<<<<<<< @@ -2808,7 +2901,7 @@ __pyx_r = __pyx_v_nt; goto __pyx_L0; - /* "yt/utilities/lib/marching_cubes.pyx":97 + /* "yt/utilities/lib/marching_cubes.pyx":104 * @cython.wraparound(False) * @cython.cdivision(True) * cdef int march_cubes( # <<<<<<<<<<<<<< @@ -2822,7 +2915,7 @@ return __pyx_r; } -/* "yt/utilities/lib/marching_cubes.pyx":165 +/* "yt/utilities/lib/marching_cubes.pyx":172 * @cython.wraparound(False) * @cython.cdivision(True) * def march_cubes_grid(np.float64_t isovalue, # <<<<<<<<<<<<<< @@ -2848,7 +2941,7 @@ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isovalue,&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_left_edge,&__pyx_n_s_dxs,&__pyx_n_s_obj_sample,&__pyx_n_s_sample_type,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; - /* "yt/utilities/lib/marching_cubes.pyx":170 + /* "yt/utilities/lib/marching_cubes.pyx":177 * np.ndarray[np.float64_t, ndim=1] left_edge, * np.ndarray[np.float64_t, ndim=1] dxs, * obj_sample = None, int sample_type = 1): # <<<<<<<<<<<<<< @@ -2861,12 +2954,19 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -2875,31 +2975,37 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isovalue)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("march_cubes_grid", 0, 5, 7, 1); __PYX_ERR(0, 165, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid", 0, 5, 7, 1); __PYX_ERR(0, 172, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("march_cubes_grid", 0, 5, 7, 2); __PYX_ERR(0, 165, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid", 0, 5, 7, 2); __PYX_ERR(0, 172, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("march_cubes_grid", 0, 5, 7, 3); __PYX_ERR(0, 165, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid", 0, 5, 7, 3); __PYX_ERR(0, 172, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dxs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("march_cubes_grid", 0, 5, 7, 4); __PYX_ERR(0, 165, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid", 0, 5, 7, 4); __PYX_ERR(0, 172, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj_sample); if (value) { values[5] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sample_type); @@ -2907,12 +3013,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "march_cubes_grid") < 0)) __PYX_ERR(0, 165, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "march_cubes_grid") < 0)) __PYX_ERR(0, 172, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -2922,33 +3030,33 @@ default: goto __pyx_L5_argtuple_error; } } - __pyx_v_isovalue = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_isovalue == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L3_error) + __pyx_v_isovalue = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_isovalue == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L3_error) __pyx_v_values = ((PyArrayObject *)values[1]); __pyx_v_mask = ((PyArrayObject *)values[2]); __pyx_v_left_edge = ((PyArrayObject *)values[3]); __pyx_v_dxs = ((PyArrayObject *)values[4]); __pyx_v_obj_sample = values[5]; if (values[6]) { - __pyx_v_sample_type = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_sample_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L3_error) + __pyx_v_sample_type = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_sample_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error) } else { __pyx_v_sample_type = ((int)1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("march_cubes_grid", 0, 5, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid", 0, 5, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 172, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.marching_cubes.march_cubes_grid", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) __PYX_ERR(0, 166, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 167, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 168, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dxs), __pyx_ptype_5numpy_ndarray, 1, "dxs", 0))) __PYX_ERR(0, 169, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) __PYX_ERR(0, 173, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 174, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 175, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dxs), __pyx_ptype_5numpy_ndarray, 1, "dxs", 0))) __PYX_ERR(0, 176, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14marching_cubes_march_cubes_grid(__pyx_self, __pyx_v_isovalue, __pyx_v_values, __pyx_v_mask, __pyx_v_left_edge, __pyx_v_dxs, __pyx_v_obj_sample, __pyx_v_sample_type); - /* "yt/utilities/lib/marching_cubes.pyx":165 + /* "yt/utilities/lib/marching_cubes.pyx":172 * @cython.wraparound(False) * @cython.cdivision(True) * def march_cubes_grid(np.float64_t isovalue, # <<<<<<<<<<<<<< @@ -3036,6 +3144,7 @@ PyArrayObject *__pyx_t_28 = NULL; PyArrayObject *__pyx_t_29 = NULL; struct __pyx_opt_args_2yt_9utilities_3lib_14marching_cubes_FillTriangleValues __pyx_t_30; + PyObject *__pyx_t_31 = NULL; __Pyx_RefNannySetupContext("march_cubes_grid", 0); __pyx_pybuffer_sample.pybuffer.buf = NULL; __pyx_pybuffer_sample.refcount = 0; @@ -3067,26 +3176,26 @@ __pyx_pybuffernd_dxs.rcbuffer = &__pyx_pybuffer_dxs; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 172, __pyx_L1_error) } __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_values.diminfo[2].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_values.diminfo[2].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 172, __pyx_L1_error) } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 172, __pyx_L1_error) } __pyx_pybuffernd_left_edge.diminfo[0].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edge.diminfo[0].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dxs.rcbuffer->pybuffer, (PyObject*)__pyx_v_dxs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dxs.rcbuffer->pybuffer, (PyObject*)__pyx_v_dxs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 172, __pyx_L1_error) } __pyx_pybuffernd_dxs.diminfo[0].strides = __pyx_pybuffernd_dxs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dxs.diminfo[0].shape = __pyx_pybuffernd_dxs.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/marching_cubes.pyx":178 + /* "yt/utilities/lib/marching_cubes.pyx":185 * cdef np.float64_t point[3] * cdef np.float64_t idds[3] * cdef np.float64_t *intdata = NULL # <<<<<<<<<<<<<< @@ -3095,7 +3204,7 @@ */ __pyx_v_intdata = NULL; - /* "yt/utilities/lib/marching_cubes.pyx":179 + /* "yt/utilities/lib/marching_cubes.pyx":186 * cdef np.float64_t idds[3] * cdef np.float64_t *intdata = NULL * cdef np.float64_t *sdata = NULL # <<<<<<<<<<<<<< @@ -3104,7 +3213,7 @@ */ __pyx_v_sdata = NULL; - /* "yt/utilities/lib/marching_cubes.pyx":186 + /* "yt/utilities/lib/marching_cubes.pyx":193 * cdef Triangle *last * cdef Triangle *current * if obj_sample is not None: # <<<<<<<<<<<<<< @@ -3115,14 +3224,14 @@ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":187 + /* "yt/utilities/lib/marching_cubes.pyx":194 * cdef Triangle *current * if obj_sample is not None: * sample = obj_sample # <<<<<<<<<<<<<< * sdata = sample.data * do_sample = sample_type # 1 for face, 2 for vertex */ - if (!(likely(((__pyx_v_obj_sample) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj_sample, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 187, __pyx_L1_error) + if (!(likely(((__pyx_v_obj_sample) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj_sample, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_t_3 = __pyx_v_obj_sample; __Pyx_INCREF(__pyx_t_3); { @@ -3139,12 +3248,12 @@ } } __pyx_pybuffernd_sample.diminfo[0].strides = __pyx_pybuffernd_sample.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sample.diminfo[0].shape = __pyx_pybuffernd_sample.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sample.diminfo[1].strides = __pyx_pybuffernd_sample.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sample.diminfo[1].shape = __pyx_pybuffernd_sample.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_sample.diminfo[2].strides = __pyx_pybuffernd_sample.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_sample.diminfo[2].shape = __pyx_pybuffernd_sample.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 187, __pyx_L1_error) + if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 194, __pyx_L1_error) } __pyx_v_sample = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/marching_cubes.pyx":188 + /* "yt/utilities/lib/marching_cubes.pyx":195 * if obj_sample is not None: * sample = obj_sample * sdata = sample.data # <<<<<<<<<<<<<< @@ -3153,7 +3262,7 @@ */ __pyx_v_sdata = ((__pyx_t_5numpy_float64_t *)__pyx_v_sample->data); - /* "yt/utilities/lib/marching_cubes.pyx":189 + /* "yt/utilities/lib/marching_cubes.pyx":196 * sample = obj_sample * sdata = sample.data * do_sample = sample_type # 1 for face, 2 for vertex # <<<<<<<<<<<<<< @@ -3162,7 +3271,7 @@ */ __pyx_v_do_sample = __pyx_v_sample_type; - /* "yt/utilities/lib/marching_cubes.pyx":186 + /* "yt/utilities/lib/marching_cubes.pyx":193 * cdef Triangle *last * cdef Triangle *current * if obj_sample is not None: # <<<<<<<<<<<<<< @@ -3172,7 +3281,7 @@ goto __pyx_L3; } - /* "yt/utilities/lib/marching_cubes.pyx":191 + /* "yt/utilities/lib/marching_cubes.pyx":198 * do_sample = sample_type # 1 for face, 2 for vertex * else: * do_sample = 0 # <<<<<<<<<<<<<< @@ -3184,7 +3293,7 @@ } __pyx_L3:; - /* "yt/utilities/lib/marching_cubes.pyx":192 + /* "yt/utilities/lib/marching_cubes.pyx":199 * else: * do_sample = 0 * for i in range(3): # <<<<<<<<<<<<<< @@ -3194,7 +3303,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/utilities/lib/marching_cubes.pyx":193 + /* "yt/utilities/lib/marching_cubes.pyx":200 * do_sample = 0 * for i in range(3): * dims[i] = values.shape[i] - 1 # <<<<<<<<<<<<<< @@ -3203,7 +3312,7 @@ */ (__pyx_v_dims[__pyx_v_i]) = ((__pyx_v_values->dimensions[__pyx_v_i]) - 1); - /* "yt/utilities/lib/marching_cubes.pyx":194 + /* "yt/utilities/lib/marching_cubes.pyx":201 * for i in range(3): * dims[i] = values.shape[i] - 1 * idds[i] = 1.0 / dxs[i] # <<<<<<<<<<<<<< @@ -3214,7 +3323,7 @@ (__pyx_v_idds[__pyx_v_i]) = (1.0 / (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dxs.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dxs.diminfo[0].strides))); } - /* "yt/utilities/lib/marching_cubes.pyx":195 + /* "yt/utilities/lib/marching_cubes.pyx":202 * dims[i] = values.shape[i] - 1 * idds[i] = 1.0 / dxs[i] * triangles.first = triangles.current = NULL # <<<<<<<<<<<<<< @@ -3224,7 +3333,7 @@ __pyx_v_triangles.first = NULL; __pyx_v_triangles.current = NULL; - /* "yt/utilities/lib/marching_cubes.pyx":196 + /* "yt/utilities/lib/marching_cubes.pyx":203 * idds[i] = 1.0 / dxs[i] * triangles.first = triangles.current = NULL * last = current = NULL # <<<<<<<<<<<<<< @@ -3234,7 +3343,7 @@ __pyx_v_last = NULL; __pyx_v_current = NULL; - /* "yt/utilities/lib/marching_cubes.pyx":197 + /* "yt/utilities/lib/marching_cubes.pyx":204 * triangles.first = triangles.current = NULL * last = current = NULL * triangles.count = 0 # <<<<<<<<<<<<<< @@ -3243,7 +3352,7 @@ */ __pyx_v_triangles.count = 0; - /* "yt/utilities/lib/marching_cubes.pyx":198 + /* "yt/utilities/lib/marching_cubes.pyx":205 * last = current = NULL * triangles.count = 0 * cdef np.float64_t *data = values.data # <<<<<<<<<<<<<< @@ -3252,7 +3361,7 @@ */ __pyx_v_data = ((__pyx_t_5numpy_float64_t *)__pyx_v_values->data); - /* "yt/utilities/lib/marching_cubes.pyx":199 + /* "yt/utilities/lib/marching_cubes.pyx":206 * triangles.count = 0 * cdef np.float64_t *data = values.data * cdef np.float64_t *dds = dxs.data # <<<<<<<<<<<<<< @@ -3261,7 +3370,7 @@ */ __pyx_v_dds = ((__pyx_t_5numpy_float64_t *)__pyx_v_dxs->data); - /* "yt/utilities/lib/marching_cubes.pyx":200 + /* "yt/utilities/lib/marching_cubes.pyx":207 * cdef np.float64_t *data = values.data * cdef np.float64_t *dds = dxs.data * pos[0] = left_edge[0] # <<<<<<<<<<<<<< @@ -3271,7 +3380,7 @@ __pyx_t_9 = 0; (__pyx_v_pos[0]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_left_edge.diminfo[0].strides)); - /* "yt/utilities/lib/marching_cubes.pyx":201 + /* "yt/utilities/lib/marching_cubes.pyx":208 * cdef np.float64_t *dds = dxs.data * pos[0] = left_edge[0] * for i in range(dims[0]): # <<<<<<<<<<<<<< @@ -3282,7 +3391,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_4; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "yt/utilities/lib/marching_cubes.pyx":202 + /* "yt/utilities/lib/marching_cubes.pyx":209 * pos[0] = left_edge[0] * for i in range(dims[0]): * pos[1] = left_edge[1] # <<<<<<<<<<<<<< @@ -3292,7 +3401,7 @@ __pyx_t_11 = 1; (__pyx_v_pos[1]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_left_edge.diminfo[0].strides)); - /* "yt/utilities/lib/marching_cubes.pyx":203 + /* "yt/utilities/lib/marching_cubes.pyx":210 * for i in range(dims[0]): * pos[1] = left_edge[1] * for j in range(dims[1]): # <<<<<<<<<<<<<< @@ -3303,7 +3412,7 @@ for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_j = __pyx_t_13; - /* "yt/utilities/lib/marching_cubes.pyx":204 + /* "yt/utilities/lib/marching_cubes.pyx":211 * pos[1] = left_edge[1] * for j in range(dims[1]): * pos[2] = left_edge[2] # <<<<<<<<<<<<<< @@ -3313,7 +3422,7 @@ __pyx_t_14 = 2; (__pyx_v_pos[2]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left_edge.diminfo[0].strides)); - /* "yt/utilities/lib/marching_cubes.pyx":205 + /* "yt/utilities/lib/marching_cubes.pyx":212 * for j in range(dims[1]): * pos[2] = left_edge[2] * for k in range(dims[2]): # <<<<<<<<<<<<<< @@ -3324,7 +3433,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_k = __pyx_t_16; - /* "yt/utilities/lib/marching_cubes.pyx":206 + /* "yt/utilities/lib/marching_cubes.pyx":213 * pos[2] = left_edge[2] * for k in range(dims[2]): * if mask[i,j,k] == 1: # <<<<<<<<<<<<<< @@ -3337,7 +3446,7 @@ __pyx_t_2 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_mask.diminfo[2].strides)) == 1) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":208 + /* "yt/utilities/lib/marching_cubes.pyx":215 * if mask[i,j,k] == 1: * offset = i * (dims[1] + 1) * (dims[2] + 1) \ * + j * (dims[2] + 1) + k # <<<<<<<<<<<<<< @@ -3346,7 +3455,7 @@ */ __pyx_v_offset = ((((__pyx_v_i * ((__pyx_v_dims[1]) + 1)) * ((__pyx_v_dims[2]) + 1)) + (__pyx_v_j * ((__pyx_v_dims[2]) + 1))) + __pyx_v_k); - /* "yt/utilities/lib/marching_cubes.pyx":209 + /* "yt/utilities/lib/marching_cubes.pyx":216 * offset = i * (dims[1] + 1) * (dims[2] + 1) \ * + j * (dims[2] + 1) + k * intdata = data + offset # <<<<<<<<<<<<<< @@ -3355,7 +3464,7 @@ */ __pyx_v_intdata = (__pyx_v_data + __pyx_v_offset); - /* "yt/utilities/lib/marching_cubes.pyx":210 + /* "yt/utilities/lib/marching_cubes.pyx":217 * + j * (dims[2] + 1) + k * intdata = data + offset * offset_fill(dims, intdata, gv) # <<<<<<<<<<<<<< @@ -3364,7 +3473,7 @@ */ offset_fill(__pyx_v_dims, __pyx_v_intdata, __pyx_v_gv); - /* "yt/utilities/lib/marching_cubes.pyx":211 + /* "yt/utilities/lib/marching_cubes.pyx":218 * intdata = data + offset * offset_fill(dims, intdata, gv) * nt = march_cubes(gv, isovalue, dds, pos[0], pos[1], pos[2], # <<<<<<<<<<<<<< @@ -3373,7 +3482,7 @@ */ __pyx_v_nt = __pyx_f_2yt_9utilities_3lib_14marching_cubes_march_cubes(__pyx_v_gv, __pyx_v_isovalue, __pyx_v_dds, (__pyx_v_pos[0]), (__pyx_v_pos[1]), (__pyx_v_pos[2]), (&__pyx_v_triangles)); - /* "yt/utilities/lib/marching_cubes.pyx":213 + /* "yt/utilities/lib/marching_cubes.pyx":220 * nt = march_cubes(gv, isovalue, dds, pos[0], pos[1], pos[2], * &triangles) * if nt == 0 or do_sample == 0: # <<<<<<<<<<<<<< @@ -3391,7 +3500,7 @@ __pyx_L14_bool_binop_done:; if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":214 + /* "yt/utilities/lib/marching_cubes.pyx":221 * &triangles) * if nt == 0 or do_sample == 0: * pos[2] += dds[2] # <<<<<<<<<<<<<< @@ -3401,7 +3510,7 @@ __pyx_t_20 = 2; (__pyx_v_pos[__pyx_t_20]) = ((__pyx_v_pos[__pyx_t_20]) + (__pyx_v_dds[2])); - /* "yt/utilities/lib/marching_cubes.pyx":215 + /* "yt/utilities/lib/marching_cubes.pyx":222 * if nt == 0 or do_sample == 0: * pos[2] += dds[2] * continue # <<<<<<<<<<<<<< @@ -3410,7 +3519,7 @@ */ goto __pyx_L10_continue; - /* "yt/utilities/lib/marching_cubes.pyx":213 + /* "yt/utilities/lib/marching_cubes.pyx":220 * nt = march_cubes(gv, isovalue, dds, pos[0], pos[1], pos[2], * &triangles) * if nt == 0 or do_sample == 0: # <<<<<<<<<<<<<< @@ -3419,7 +3528,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":216 + /* "yt/utilities/lib/marching_cubes.pyx":223 * pos[2] += dds[2] * continue * if last == NULL and triangles.first != NULL: # <<<<<<<<<<<<<< @@ -3437,7 +3546,7 @@ __pyx_L17_bool_binop_done:; if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":217 + /* "yt/utilities/lib/marching_cubes.pyx":224 * continue * if last == NULL and triangles.first != NULL: * current = triangles.first # <<<<<<<<<<<<<< @@ -3447,7 +3556,7 @@ __pyx_t_21 = __pyx_v_triangles.first; __pyx_v_current = __pyx_t_21; - /* "yt/utilities/lib/marching_cubes.pyx":218 + /* "yt/utilities/lib/marching_cubes.pyx":225 * if last == NULL and triangles.first != NULL: * current = triangles.first * last = NULL # <<<<<<<<<<<<<< @@ -3456,7 +3565,7 @@ */ __pyx_v_last = NULL; - /* "yt/utilities/lib/marching_cubes.pyx":216 + /* "yt/utilities/lib/marching_cubes.pyx":223 * pos[2] += dds[2] * continue * if last == NULL and triangles.first != NULL: # <<<<<<<<<<<<<< @@ -3466,7 +3575,7 @@ goto __pyx_L16; } - /* "yt/utilities/lib/marching_cubes.pyx":219 + /* "yt/utilities/lib/marching_cubes.pyx":226 * current = triangles.first * last = NULL * elif last != NULL: # <<<<<<<<<<<<<< @@ -3476,7 +3585,7 @@ __pyx_t_2 = ((__pyx_v_last != NULL) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":220 + /* "yt/utilities/lib/marching_cubes.pyx":227 * last = NULL * elif last != NULL: * current = last.next # <<<<<<<<<<<<<< @@ -3486,7 +3595,7 @@ __pyx_t_21 = __pyx_v_last->next; __pyx_v_current = __pyx_t_21; - /* "yt/utilities/lib/marching_cubes.pyx":219 + /* "yt/utilities/lib/marching_cubes.pyx":226 * current = triangles.first * last = NULL * elif last != NULL: # <<<<<<<<<<<<<< @@ -3496,7 +3605,7 @@ } __pyx_L16:; - /* "yt/utilities/lib/marching_cubes.pyx":221 + /* "yt/utilities/lib/marching_cubes.pyx":228 * elif last != NULL: * current = last.next * if do_sample == 1: # <<<<<<<<<<<<<< @@ -3506,7 +3615,7 @@ __pyx_t_2 = ((__pyx_v_do_sample == 1.0) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":223 + /* "yt/utilities/lib/marching_cubes.pyx":230 * if do_sample == 1: * # At each triangle's center, sample our secondary field * while current != NULL: # <<<<<<<<<<<<<< @@ -3517,7 +3626,7 @@ __pyx_t_2 = ((__pyx_v_current != NULL) != 0); if (!__pyx_t_2) break; - /* "yt/utilities/lib/marching_cubes.pyx":224 + /* "yt/utilities/lib/marching_cubes.pyx":231 * # At each triangle's center, sample our secondary field * while current != NULL: * for n in range(3): # <<<<<<<<<<<<<< @@ -3527,7 +3636,7 @@ for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) { __pyx_v_n = __pyx_t_22; - /* "yt/utilities/lib/marching_cubes.pyx":225 + /* "yt/utilities/lib/marching_cubes.pyx":232 * while current != NULL: * for n in range(3): * point[n] = 0.0 # <<<<<<<<<<<<<< @@ -3537,7 +3646,7 @@ (__pyx_v_point[__pyx_v_n]) = 0.0; } - /* "yt/utilities/lib/marching_cubes.pyx":226 + /* "yt/utilities/lib/marching_cubes.pyx":233 * for n in range(3): * point[n] = 0.0 * for n in range(3): # <<<<<<<<<<<<<< @@ -3547,7 +3656,7 @@ for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) { __pyx_v_n = __pyx_t_22; - /* "yt/utilities/lib/marching_cubes.pyx":227 + /* "yt/utilities/lib/marching_cubes.pyx":234 * point[n] = 0.0 * for n in range(3): * for m in range(3): # <<<<<<<<<<<<<< @@ -3557,7 +3666,7 @@ for (__pyx_t_23 = 0; __pyx_t_23 < 3; __pyx_t_23+=1) { __pyx_v_m = __pyx_t_23; - /* "yt/utilities/lib/marching_cubes.pyx":228 + /* "yt/utilities/lib/marching_cubes.pyx":235 * for n in range(3): * for m in range(3): * point[m] += (current.p[n][m]-pos[m])*idds[m] # <<<<<<<<<<<<<< @@ -3569,7 +3678,7 @@ } } - /* "yt/utilities/lib/marching_cubes.pyx":229 + /* "yt/utilities/lib/marching_cubes.pyx":236 * for m in range(3): * point[m] += (current.p[n][m]-pos[m])*idds[m] * for n in range(3): # <<<<<<<<<<<<<< @@ -3579,7 +3688,7 @@ for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) { __pyx_v_n = __pyx_t_22; - /* "yt/utilities/lib/marching_cubes.pyx":230 + /* "yt/utilities/lib/marching_cubes.pyx":237 * point[m] += (current.p[n][m]-pos[m])*idds[m] * for n in range(3): * point[n] /= 3.0 # <<<<<<<<<<<<<< @@ -3590,7 +3699,7 @@ (__pyx_v_point[__pyx_t_23]) = ((__pyx_v_point[__pyx_t_23]) / 3.0); } - /* "yt/utilities/lib/marching_cubes.pyx":231 + /* "yt/utilities/lib/marching_cubes.pyx":238 * for n in range(3): * point[n] /= 3.0 * current.val[0] = offset_interpolate(dims, point, # <<<<<<<<<<<<<< @@ -3599,7 +3708,7 @@ */ (__pyx_v_current->val[0]) = offset_interpolate(__pyx_v_dims, __pyx_v_point, (__pyx_v_sdata + __pyx_v_offset)); - /* "yt/utilities/lib/marching_cubes.pyx":233 + /* "yt/utilities/lib/marching_cubes.pyx":240 * current.val[0] = offset_interpolate(dims, point, * sdata + offset) * last = current # <<<<<<<<<<<<<< @@ -3608,7 +3717,7 @@ */ __pyx_v_last = __pyx_v_current; - /* "yt/utilities/lib/marching_cubes.pyx":234 + /* "yt/utilities/lib/marching_cubes.pyx":241 * sdata + offset) * last = current * if current.next == NULL: break # <<<<<<<<<<<<<< @@ -3620,7 +3729,7 @@ goto __pyx_L21_break; } - /* "yt/utilities/lib/marching_cubes.pyx":235 + /* "yt/utilities/lib/marching_cubes.pyx":242 * last = current * if current.next == NULL: break * current = current.next # <<<<<<<<<<<<<< @@ -3632,7 +3741,7 @@ } __pyx_L21_break:; - /* "yt/utilities/lib/marching_cubes.pyx":221 + /* "yt/utilities/lib/marching_cubes.pyx":228 * elif last != NULL: * current = last.next * if do_sample == 1: # <<<<<<<<<<<<<< @@ -3642,7 +3751,7 @@ goto __pyx_L19; } - /* "yt/utilities/lib/marching_cubes.pyx":236 + /* "yt/utilities/lib/marching_cubes.pyx":243 * if current.next == NULL: break * current = current.next * elif do_sample == 2: # <<<<<<<<<<<<<< @@ -3652,7 +3761,7 @@ __pyx_t_2 = ((__pyx_v_do_sample == 2.0) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":237 + /* "yt/utilities/lib/marching_cubes.pyx":244 * current = current.next * elif do_sample == 2: * while current != NULL: # <<<<<<<<<<<<<< @@ -3663,7 +3772,7 @@ __pyx_t_2 = ((__pyx_v_current != NULL) != 0); if (!__pyx_t_2) break; - /* "yt/utilities/lib/marching_cubes.pyx":238 + /* "yt/utilities/lib/marching_cubes.pyx":245 * elif do_sample == 2: * while current != NULL: * for n in range(3): # <<<<<<<<<<<<<< @@ -3673,7 +3782,7 @@ for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) { __pyx_v_n = __pyx_t_22; - /* "yt/utilities/lib/marching_cubes.pyx":239 + /* "yt/utilities/lib/marching_cubes.pyx":246 * while current != NULL: * for n in range(3): * for m in range(3): # <<<<<<<<<<<<<< @@ -3683,7 +3792,7 @@ for (__pyx_t_23 = 0; __pyx_t_23 < 3; __pyx_t_23+=1) { __pyx_v_m = __pyx_t_23; - /* "yt/utilities/lib/marching_cubes.pyx":240 + /* "yt/utilities/lib/marching_cubes.pyx":247 * for n in range(3): * for m in range(3): * point[m] = (current.p[n][m]-pos[m])*idds[m] # <<<<<<<<<<<<<< @@ -3693,7 +3802,7 @@ (__pyx_v_point[__pyx_v_m]) = ((((__pyx_v_current->p[__pyx_v_n])[__pyx_v_m]) - (__pyx_v_pos[__pyx_v_m])) * (__pyx_v_idds[__pyx_v_m])); } - /* "yt/utilities/lib/marching_cubes.pyx":241 + /* "yt/utilities/lib/marching_cubes.pyx":248 * for m in range(3): * point[m] = (current.p[n][m]-pos[m])*idds[m] * current.val[n] = offset_interpolate(dims, # <<<<<<<<<<<<<< @@ -3703,7 +3812,7 @@ (__pyx_v_current->val[__pyx_v_n]) = offset_interpolate(__pyx_v_dims, __pyx_v_point, (__pyx_v_sdata + __pyx_v_offset)); } - /* "yt/utilities/lib/marching_cubes.pyx":243 + /* "yt/utilities/lib/marching_cubes.pyx":250 * current.val[n] = offset_interpolate(dims, * point, sdata + offset) * last = current # <<<<<<<<<<<<<< @@ -3712,7 +3821,7 @@ */ __pyx_v_last = __pyx_v_current; - /* "yt/utilities/lib/marching_cubes.pyx":244 + /* "yt/utilities/lib/marching_cubes.pyx":251 * point, sdata + offset) * last = current * if current.next == NULL: break # <<<<<<<<<<<<<< @@ -3724,7 +3833,7 @@ goto __pyx_L32_break; } - /* "yt/utilities/lib/marching_cubes.pyx":245 + /* "yt/utilities/lib/marching_cubes.pyx":252 * last = current * if current.next == NULL: break * current = current.next # <<<<<<<<<<<<<< @@ -3736,7 +3845,7 @@ } __pyx_L32_break:; - /* "yt/utilities/lib/marching_cubes.pyx":236 + /* "yt/utilities/lib/marching_cubes.pyx":243 * if current.next == NULL: break * current = current.next * elif do_sample == 2: # <<<<<<<<<<<<<< @@ -3746,7 +3855,7 @@ } __pyx_L19:; - /* "yt/utilities/lib/marching_cubes.pyx":206 + /* "yt/utilities/lib/marching_cubes.pyx":213 * pos[2] = left_edge[2] * for k in range(dims[2]): * if mask[i,j,k] == 1: # <<<<<<<<<<<<<< @@ -3755,7 +3864,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":246 + /* "yt/utilities/lib/marching_cubes.pyx":253 * if current.next == NULL: break * current = current.next * pos[2] += dds[2] # <<<<<<<<<<<<<< @@ -3767,7 +3876,7 @@ __pyx_L10_continue:; } - /* "yt/utilities/lib/marching_cubes.pyx":247 + /* "yt/utilities/lib/marching_cubes.pyx":254 * current = current.next * pos[2] += dds[2] * pos[1] += dds[1] # <<<<<<<<<<<<<< @@ -3778,7 +3887,7 @@ (__pyx_v_pos[__pyx_t_20]) = ((__pyx_v_pos[__pyx_t_20]) + (__pyx_v_dds[1])); } - /* "yt/utilities/lib/marching_cubes.pyx":248 + /* "yt/utilities/lib/marching_cubes.pyx":255 * pos[2] += dds[2] * pos[1] += dds[1] * pos[0] += dds[0] # <<<<<<<<<<<<<< @@ -3789,21 +3898,21 @@ (__pyx_v_pos[__pyx_t_20]) = ((__pyx_v_pos[__pyx_t_20]) + (__pyx_v_dds[0])); } - /* "yt/utilities/lib/marching_cubes.pyx":251 + /* "yt/utilities/lib/marching_cubes.pyx":258 * # Hallo, we are all done. * cdef np.ndarray[np.float64_t, ndim=2] vertices * vertices = np.zeros((triangles.count*3,3), dtype='float64') # <<<<<<<<<<<<<< * if do_sample == 0: * FillAndWipeTriangles(vertices, triangles.first) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_25 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_25 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_triangles.count * 3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_triangles.count * 3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_26 = PyTuple_New(2); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_26 = PyTuple_New(2); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_3); @@ -3811,20 +3920,20 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_int_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_26); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = PyDict_New(); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_26 = PyDict_New(); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - if (PyDict_SetItem(__pyx_t_26, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 251, __pyx_L1_error) - __pyx_t_27 = __Pyx_PyObject_Call(__pyx_t_25, __pyx_t_3, __pyx_t_26); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 251, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_26, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_27 = __Pyx_PyObject_Call(__pyx_t_25, __pyx_t_3, __pyx_t_26); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - if (!(likely(((__pyx_t_27) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_27, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 251, __pyx_L1_error) + if (!(likely(((__pyx_t_27) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_27, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 258, __pyx_L1_error) __pyx_t_28 = ((PyArrayObject *)__pyx_t_27); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3840,13 +3949,13 @@ } } __pyx_pybuffernd_vertices.diminfo[0].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertices.diminfo[0].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertices.diminfo[1].strides = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertices.diminfo[1].shape = __pyx_pybuffernd_vertices.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 258, __pyx_L1_error) } __pyx_t_28 = 0; __pyx_v_vertices = ((PyArrayObject *)__pyx_t_27); __pyx_t_27 = 0; - /* "yt/utilities/lib/marching_cubes.pyx":252 + /* "yt/utilities/lib/marching_cubes.pyx":259 * cdef np.ndarray[np.float64_t, ndim=2] vertices * vertices = np.zeros((triangles.count*3,3), dtype='float64') * if do_sample == 0: # <<<<<<<<<<<<<< @@ -3856,7 +3965,7 @@ __pyx_t_2 = ((__pyx_v_do_sample == 0.0) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":253 + /* "yt/utilities/lib/marching_cubes.pyx":260 * vertices = np.zeros((triangles.count*3,3), dtype='float64') * if do_sample == 0: * FillAndWipeTriangles(vertices, triangles.first) # <<<<<<<<<<<<<< @@ -3865,7 +3974,7 @@ */ __pyx_f_2yt_9utilities_3lib_14marching_cubes_FillAndWipeTriangles(((PyArrayObject *)__pyx_v_vertices), __pyx_v_triangles.first); - /* "yt/utilities/lib/marching_cubes.pyx":254 + /* "yt/utilities/lib/marching_cubes.pyx":261 * if do_sample == 0: * FillAndWipeTriangles(vertices, triangles.first) * return vertices # <<<<<<<<<<<<<< @@ -3877,7 +3986,7 @@ __pyx_r = ((PyObject *)__pyx_v_vertices); goto __pyx_L0; - /* "yt/utilities/lib/marching_cubes.pyx":252 + /* "yt/utilities/lib/marching_cubes.pyx":259 * cdef np.ndarray[np.float64_t, ndim=2] vertices * vertices = np.zeros((triangles.count*3,3), dtype='float64') * if do_sample == 0: # <<<<<<<<<<<<<< @@ -3886,7 +3995,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":255 + /* "yt/utilities/lib/marching_cubes.pyx":262 * FillAndWipeTriangles(vertices, triangles.first) * return vertices * cdef int nskip = 0 # <<<<<<<<<<<<<< @@ -3895,7 +4004,7 @@ */ __pyx_v_nskip = 0; - /* "yt/utilities/lib/marching_cubes.pyx":256 + /* "yt/utilities/lib/marching_cubes.pyx":263 * return vertices * cdef int nskip = 0 * if do_sample == 1: # <<<<<<<<<<<<<< @@ -3905,7 +4014,7 @@ __pyx_t_2 = ((__pyx_v_do_sample == 1.0) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":257 + /* "yt/utilities/lib/marching_cubes.pyx":264 * cdef int nskip = 0 * if do_sample == 1: * nskip = 1 # <<<<<<<<<<<<<< @@ -3914,7 +4023,7 @@ */ __pyx_v_nskip = 1; - /* "yt/utilities/lib/marching_cubes.pyx":256 + /* "yt/utilities/lib/marching_cubes.pyx":263 * return vertices * cdef int nskip = 0 * if do_sample == 1: # <<<<<<<<<<<<<< @@ -3924,7 +4033,7 @@ goto __pyx_L39; } - /* "yt/utilities/lib/marching_cubes.pyx":258 + /* "yt/utilities/lib/marching_cubes.pyx":265 * if do_sample == 1: * nskip = 1 * elif do_sample == 2: # <<<<<<<<<<<<<< @@ -3934,7 +4043,7 @@ __pyx_t_2 = ((__pyx_v_do_sample == 2.0) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/marching_cubes.pyx":259 + /* "yt/utilities/lib/marching_cubes.pyx":266 * nskip = 1 * elif do_sample == 2: * nskip = 3 # <<<<<<<<<<<<<< @@ -3943,7 +4052,7 @@ */ __pyx_v_nskip = 3; - /* "yt/utilities/lib/marching_cubes.pyx":258 + /* "yt/utilities/lib/marching_cubes.pyx":265 * if do_sample == 1: * nskip = 1 * elif do_sample == 2: # <<<<<<<<<<<<<< @@ -3953,34 +4062,34 @@ } __pyx_L39:; - /* "yt/utilities/lib/marching_cubes.pyx":260 + /* "yt/utilities/lib/marching_cubes.pyx":267 * elif do_sample == 2: * nskip = 3 * sampled = np.zeros(triangles.count * nskip, dtype='float64') # <<<<<<<<<<<<<< * FillTriangleValues(sampled, triangles.first, nskip) * FillAndWipeTriangles(vertices, triangles.first) */ - __pyx_t_27 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_27 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); - __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_zeros); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_zeros); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; - __pyx_t_27 = __Pyx_PyInt_From_int((__pyx_v_triangles.count * __pyx_v_nskip)); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_27 = __Pyx_PyInt_From_int((__pyx_v_triangles.count * __pyx_v_nskip)); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_27); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_27); __pyx_t_27 = 0; - __pyx_t_27 = PyDict_New(); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_27 = PyDict_New(); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); - if (PyDict_SetItem(__pyx_t_27, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 260, __pyx_L1_error) - __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_26, __pyx_t_3, __pyx_t_27); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 260, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_27, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_26, __pyx_t_3, __pyx_t_27); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; - if (!(likely(((__pyx_t_25) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_25, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 260, __pyx_L1_error) + if (!(likely(((__pyx_t_25) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_25, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 267, __pyx_L1_error) __pyx_t_29 = ((PyArrayObject *)__pyx_t_25); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3996,41 +4105,141 @@ } } __pyx_pybuffernd_sampled.diminfo[0].strides = __pyx_pybuffernd_sampled.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sampled.diminfo[0].shape = __pyx_pybuffernd_sampled.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 260, __pyx_L1_error) + if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 267, __pyx_L1_error) } __pyx_t_29 = 0; __pyx_v_sampled = ((PyArrayObject *)__pyx_t_25); __pyx_t_25 = 0; - /* "yt/utilities/lib/marching_cubes.pyx":261 + /* "yt/utilities/lib/marching_cubes.pyx":268 * nskip = 3 * sampled = np.zeros(triangles.count * nskip, dtype='float64') * FillTriangleValues(sampled, triangles.first, nskip) # <<<<<<<<<<<<<< * FillAndWipeTriangles(vertices, triangles.first) - * return vertices, sampled + * if hasattr(obj_sample, 'units'): */ __pyx_t_30.__pyx_n = 1; __pyx_t_30.nskip = __pyx_v_nskip; __pyx_f_2yt_9utilities_3lib_14marching_cubes_FillTriangleValues(((PyArrayObject *)__pyx_v_sampled), __pyx_v_triangles.first, &__pyx_t_30); - /* "yt/utilities/lib/marching_cubes.pyx":262 + /* "yt/utilities/lib/marching_cubes.pyx":269 * sampled = np.zeros(triangles.count * nskip, dtype='float64') * FillTriangleValues(sampled, triangles.first, nskip) * FillAndWipeTriangles(vertices, triangles.first) # <<<<<<<<<<<<<< + * if hasattr(obj_sample, 'units'): + * sampled = YTArray(sampled, obj_sample.units) + */ + __pyx_f_2yt_9utilities_3lib_14marching_cubes_FillAndWipeTriangles(((PyArrayObject *)__pyx_v_vertices), __pyx_v_triangles.first); + + /* "yt/utilities/lib/marching_cubes.pyx":270 + * FillTriangleValues(sampled, triangles.first, nskip) + * FillAndWipeTriangles(vertices, triangles.first) + * if hasattr(obj_sample, 'units'): # <<<<<<<<<<<<<< + * sampled = YTArray(sampled, obj_sample.units) + * return vertices, sampled + */ + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_obj_sample, __pyx_n_s_units); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "yt/utilities/lib/marching_cubes.pyx":271 + * FillAndWipeTriangles(vertices, triangles.first) + * if hasattr(obj_sample, 'units'): + * sampled = YTArray(sampled, obj_sample.units) # <<<<<<<<<<<<<< * return vertices, sampled * */ - __pyx_f_2yt_9utilities_3lib_14marching_cubes_FillAndWipeTriangles(((PyArrayObject *)__pyx_v_vertices), __pyx_v_triangles.first); + __pyx_t_27 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTArray); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_27); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj_sample, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_26 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_27))) { + __pyx_t_26 = PyMethod_GET_SELF(__pyx_t_27); + if (likely(__pyx_t_26)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_27); + __Pyx_INCREF(__pyx_t_26); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_27, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_27)) { + PyObject *__pyx_temp[3] = {__pyx_t_26, ((PyObject *)__pyx_v_sampled), __pyx_t_3}; + __pyx_t_25 = __Pyx_PyFunction_FastCall(__pyx_t_27, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0; + __Pyx_GOTREF(__pyx_t_25); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_27)) { + PyObject *__pyx_temp[3] = {__pyx_t_26, ((PyObject *)__pyx_v_sampled), __pyx_t_3}; + __pyx_t_25 = __Pyx_PyCFunction_FastCall(__pyx_t_27, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0; + __Pyx_GOTREF(__pyx_t_25); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_31 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_31); + if (__pyx_t_26) { + __Pyx_GIVEREF(__pyx_t_26); PyTuple_SET_ITEM(__pyx_t_31, 0, __pyx_t_26); __pyx_t_26 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_sampled)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_sampled)); + PyTuple_SET_ITEM(__pyx_t_31, 0+__pyx_t_4, ((PyObject *)__pyx_v_sampled)); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_31, 1+__pyx_t_4, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_27, __pyx_t_31, NULL); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_25); + __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; + } + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + if (!(likely(((__pyx_t_25) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_25, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_29 = ((PyArrayObject *)__pyx_t_25); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sampled.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sampled.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sampled.rcbuffer->pybuffer, (PyObject*)__pyx_v_sampled, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5); + } + } + __pyx_pybuffernd_sampled.diminfo[0].strides = __pyx_pybuffernd_sampled.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sampled.diminfo[0].shape = __pyx_pybuffernd_sampled.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 271, __pyx_L1_error) + } + __pyx_t_29 = 0; + __Pyx_DECREF_SET(__pyx_v_sampled, ((PyArrayObject *)__pyx_t_25)); + __pyx_t_25 = 0; - /* "yt/utilities/lib/marching_cubes.pyx":263 + /* "yt/utilities/lib/marching_cubes.pyx":270 * FillTriangleValues(sampled, triangles.first, nskip) * FillAndWipeTriangles(vertices, triangles.first) + * if hasattr(obj_sample, 'units'): # <<<<<<<<<<<<<< + * sampled = YTArray(sampled, obj_sample.units) + * return vertices, sampled + */ + } + + /* "yt/utilities/lib/marching_cubes.pyx":272 + * if hasattr(obj_sample, 'units'): + * sampled = YTArray(sampled, obj_sample.units) * return vertices, sampled # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_25 = PyTuple_New(2); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_25 = PyTuple_New(2); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_INCREF(((PyObject *)__pyx_v_vertices)); __Pyx_GIVEREF(((PyObject *)__pyx_v_vertices)); @@ -4042,7 +4251,7 @@ __pyx_t_25 = 0; goto __pyx_L0; - /* "yt/utilities/lib/marching_cubes.pyx":165 + /* "yt/utilities/lib/marching_cubes.pyx":172 * @cython.wraparound(False) * @cython.cdivision(True) * def march_cubes_grid(np.float64_t isovalue, # <<<<<<<<<<<<<< @@ -4056,6 +4265,7 @@ __Pyx_XDECREF(__pyx_t_25); __Pyx_XDECREF(__pyx_t_26); __Pyx_XDECREF(__pyx_t_27); + __Pyx_XDECREF(__pyx_t_31); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -4088,7 +4298,7 @@ return __pyx_r; } -/* "yt/utilities/lib/marching_cubes.pyx":268 +/* "yt/utilities/lib/marching_cubes.pyx":277 * @cython.wraparound(False) * @cython.cdivision(True) * def march_cubes_grid_flux( # <<<<<<<<<<<<<< @@ -4120,14 +4330,23 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -4136,49 +4355,57 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isovalue)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 1); __PYX_ERR(0, 268, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 1); __PYX_ERR(0, 277, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 2); __PYX_ERR(0, 268, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 2); __PYX_ERR(0, 277, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 3); __PYX_ERR(0, 268, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 3); __PYX_ERR(0, 277, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v3)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 4); __PYX_ERR(0, 268, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 4); __PYX_ERR(0, 277, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flux_field)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 5); __PYX_ERR(0, 268, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 5); __PYX_ERR(0, 277, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 6); __PYX_ERR(0, 268, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 6); __PYX_ERR(0, 277, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 7); __PYX_ERR(0, 268, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 7); __PYX_ERR(0, 277, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dxs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 8); __PYX_ERR(0, 268, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, 8); __PYX_ERR(0, 277, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "march_cubes_grid_flux") < 0)) __PYX_ERR(0, 268, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "march_cubes_grid_flux") < 0)) __PYX_ERR(0, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; @@ -4193,7 +4420,7 @@ values[7] = PyTuple_GET_ITEM(__pyx_args, 7); values[8] = PyTuple_GET_ITEM(__pyx_args, 8); } - __pyx_v_isovalue = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_isovalue == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L3_error) + __pyx_v_isovalue = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_isovalue == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L3_error) __pyx_v_values = ((PyArrayObject *)values[1]); __pyx_v_v1 = ((PyArrayObject *)values[2]); __pyx_v_v2 = ((PyArrayObject *)values[3]); @@ -4205,20 +4432,20 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("march_cubes_grid_flux", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.marching_cubes.march_cubes_grid_flux", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) __PYX_ERR(0, 270, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v1), __pyx_ptype_5numpy_ndarray, 1, "v1", 0))) __PYX_ERR(0, 271, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v2), __pyx_ptype_5numpy_ndarray, 1, "v2", 0))) __PYX_ERR(0, 272, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v3), __pyx_ptype_5numpy_ndarray, 1, "v3", 0))) __PYX_ERR(0, 273, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux_field), __pyx_ptype_5numpy_ndarray, 1, "flux_field", 0))) __PYX_ERR(0, 274, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 275, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 276, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dxs), __pyx_ptype_5numpy_ndarray, 1, "dxs", 0))) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v1), __pyx_ptype_5numpy_ndarray, 1, "v1", 0))) __PYX_ERR(0, 280, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v2), __pyx_ptype_5numpy_ndarray, 1, "v2", 0))) __PYX_ERR(0, 281, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v3), __pyx_ptype_5numpy_ndarray, 1, "v3", 0))) __PYX_ERR(0, 282, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux_field), __pyx_ptype_5numpy_ndarray, 1, "flux_field", 0))) __PYX_ERR(0, 283, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 284, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 285, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dxs), __pyx_ptype_5numpy_ndarray, 1, "dxs", 0))) __PYX_ERR(0, 286, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14marching_cubes_2march_cubes_grid_flux(__pyx_self, __pyx_v_isovalue, __pyx_v_values, __pyx_v_v1, __pyx_v_v2, __pyx_v_v3, __pyx_v_flux_field, __pyx_v_mask, __pyx_v_left_edge, __pyx_v_dxs); /* function exit code */ @@ -4336,46 +4563,46 @@ __pyx_pybuffernd_dxs.rcbuffer = &__pyx_pybuffer_dxs; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 277, __pyx_L1_error) } __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_values.diminfo[2].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_values.diminfo[2].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 277, __pyx_L1_error) } __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v1.diminfo[1].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v1.diminfo[1].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v1.diminfo[2].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v1.diminfo[2].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v2.rcbuffer->pybuffer, (PyObject*)__pyx_v_v2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v2.rcbuffer->pybuffer, (PyObject*)__pyx_v_v2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 277, __pyx_L1_error) } __pyx_pybuffernd_v2.diminfo[0].strides = __pyx_pybuffernd_v2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v2.diminfo[0].shape = __pyx_pybuffernd_v2.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v2.diminfo[1].strides = __pyx_pybuffernd_v2.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v2.diminfo[1].shape = __pyx_pybuffernd_v2.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v2.diminfo[2].strides = __pyx_pybuffernd_v2.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v2.diminfo[2].shape = __pyx_pybuffernd_v2.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v3.rcbuffer->pybuffer, (PyObject*)__pyx_v_v3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v3.rcbuffer->pybuffer, (PyObject*)__pyx_v_v3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 277, __pyx_L1_error) } __pyx_pybuffernd_v3.diminfo[0].strides = __pyx_pybuffernd_v3.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v3.diminfo[0].shape = __pyx_pybuffernd_v3.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v3.diminfo[1].strides = __pyx_pybuffernd_v3.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v3.diminfo[1].shape = __pyx_pybuffernd_v3.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v3.diminfo[2].strides = __pyx_pybuffernd_v3.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v3.diminfo[2].shape = __pyx_pybuffernd_v3.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_flux_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_flux_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_flux_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_flux_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 277, __pyx_L1_error) } __pyx_pybuffernd_flux_field.diminfo[0].strides = __pyx_pybuffernd_flux_field.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_flux_field.diminfo[0].shape = __pyx_pybuffernd_flux_field.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_flux_field.diminfo[1].strides = __pyx_pybuffernd_flux_field.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_flux_field.diminfo[1].shape = __pyx_pybuffernd_flux_field.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_flux_field.diminfo[2].strides = __pyx_pybuffernd_flux_field.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_flux_field.diminfo[2].shape = __pyx_pybuffernd_flux_field.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 277, __pyx_L1_error) } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 277, __pyx_L1_error) } __pyx_pybuffernd_left_edge.diminfo[0].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edge.diminfo[0].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dxs.rcbuffer->pybuffer, (PyObject*)__pyx_v_dxs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dxs.rcbuffer->pybuffer, (PyObject*)__pyx_v_dxs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 277, __pyx_L1_error) } __pyx_pybuffernd_dxs.diminfo[0].strides = __pyx_pybuffernd_dxs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dxs.diminfo[0].shape = __pyx_pybuffernd_dxs.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/marching_cubes.pyx":282 + /* "yt/utilities/lib/marching_cubes.pyx":291 * cdef int offset * cdef np.float64_t gv[8] * cdef np.float64_t *intdata = NULL # <<<<<<<<<<<<<< @@ -4384,7 +4611,7 @@ */ __pyx_v_intdata = NULL; - /* "yt/utilities/lib/marching_cubes.pyx":284 + /* "yt/utilities/lib/marching_cubes.pyx":293 * cdef np.float64_t *intdata = NULL * cdef TriangleCollection triangles * cdef Triangle *current = NULL # <<<<<<<<<<<<<< @@ -4393,7 +4620,7 @@ */ __pyx_v_current = NULL; - /* "yt/utilities/lib/marching_cubes.pyx":285 + /* "yt/utilities/lib/marching_cubes.pyx":294 * cdef TriangleCollection triangles * cdef Triangle *current = NULL * cdef Triangle *last = NULL # <<<<<<<<<<<<<< @@ -4402,7 +4629,7 @@ */ __pyx_v_last = NULL; - /* "yt/utilities/lib/marching_cubes.pyx":286 + /* "yt/utilities/lib/marching_cubes.pyx":295 * cdef Triangle *current = NULL * cdef Triangle *last = NULL * cdef np.float64_t *data = values.data # <<<<<<<<<<<<<< @@ -4411,7 +4638,7 @@ */ __pyx_v_data = ((__pyx_t_5numpy_float64_t *)__pyx_v_values->data); - /* "yt/utilities/lib/marching_cubes.pyx":287 + /* "yt/utilities/lib/marching_cubes.pyx":296 * cdef Triangle *last = NULL * cdef np.float64_t *data = values.data * cdef np.float64_t *v1data = v1.data # <<<<<<<<<<<<<< @@ -4420,7 +4647,7 @@ */ __pyx_v_v1data = ((__pyx_t_5numpy_float64_t *)__pyx_v_v1->data); - /* "yt/utilities/lib/marching_cubes.pyx":288 + /* "yt/utilities/lib/marching_cubes.pyx":297 * cdef np.float64_t *data = values.data * cdef np.float64_t *v1data = v1.data * cdef np.float64_t *v2data = v2.data # <<<<<<<<<<<<<< @@ -4429,7 +4656,7 @@ */ __pyx_v_v2data = ((__pyx_t_5numpy_float64_t *)__pyx_v_v2->data); - /* "yt/utilities/lib/marching_cubes.pyx":289 + /* "yt/utilities/lib/marching_cubes.pyx":298 * cdef np.float64_t *v1data = v1.data * cdef np.float64_t *v2data = v2.data * cdef np.float64_t *v3data = v3.data # <<<<<<<<<<<<<< @@ -4438,7 +4665,7 @@ */ __pyx_v_v3data = ((__pyx_t_5numpy_float64_t *)__pyx_v_v3->data); - /* "yt/utilities/lib/marching_cubes.pyx":290 + /* "yt/utilities/lib/marching_cubes.pyx":299 * cdef np.float64_t *v2data = v2.data * cdef np.float64_t *v3data = v3.data * cdef np.float64_t *fdata = flux_field.data # <<<<<<<<<<<<<< @@ -4447,7 +4674,7 @@ */ __pyx_v_fdata = ((__pyx_t_5numpy_float64_t *)__pyx_v_flux_field->data); - /* "yt/utilities/lib/marching_cubes.pyx":291 + /* "yt/utilities/lib/marching_cubes.pyx":300 * cdef np.float64_t *v3data = v3.data * cdef np.float64_t *fdata = flux_field.data * cdef np.float64_t *dds = dxs.data # <<<<<<<<<<<<<< @@ -4456,7 +4683,7 @@ */ __pyx_v_dds = ((__pyx_t_5numpy_float64_t *)__pyx_v_dxs->data); - /* "yt/utilities/lib/marching_cubes.pyx":292 + /* "yt/utilities/lib/marching_cubes.pyx":301 * cdef np.float64_t *fdata = flux_field.data * cdef np.float64_t *dds = dxs.data * cdef np.float64_t flux = 0.0 # <<<<<<<<<<<<<< @@ -4465,7 +4692,7 @@ */ __pyx_v_flux = 0.0; - /* "yt/utilities/lib/marching_cubes.pyx":300 + /* "yt/utilities/lib/marching_cubes.pyx":309 * cdef np.float64_t idds[3] * cdef np.float64_t normal[3] * for i in range(3): # <<<<<<<<<<<<<< @@ -4475,7 +4702,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/marching_cubes.pyx":301 + /* "yt/utilities/lib/marching_cubes.pyx":310 * cdef np.float64_t normal[3] * for i in range(3): * dims[i] = values.shape[i] - 1 # <<<<<<<<<<<<<< @@ -4484,7 +4711,7 @@ */ (__pyx_v_dims[__pyx_v_i]) = ((__pyx_v_values->dimensions[__pyx_v_i]) - 1); - /* "yt/utilities/lib/marching_cubes.pyx":302 + /* "yt/utilities/lib/marching_cubes.pyx":311 * for i in range(3): * dims[i] = values.shape[i] - 1 * idds[i] = 1.0 / dds[i] # <<<<<<<<<<<<<< @@ -4494,7 +4721,7 @@ (__pyx_v_idds[__pyx_v_i]) = (1.0 / (__pyx_v_dds[__pyx_v_i])); } - /* "yt/utilities/lib/marching_cubes.pyx":303 + /* "yt/utilities/lib/marching_cubes.pyx":312 * dims[i] = values.shape[i] - 1 * idds[i] = 1.0 / dds[i] * triangles.first = triangles.current = NULL # <<<<<<<<<<<<<< @@ -4504,7 +4731,7 @@ __pyx_v_triangles.first = NULL; __pyx_v_triangles.current = NULL; - /* "yt/utilities/lib/marching_cubes.pyx":304 + /* "yt/utilities/lib/marching_cubes.pyx":313 * idds[i] = 1.0 / dds[i] * triangles.first = triangles.current = NULL * triangles.count = 0 # <<<<<<<<<<<<<< @@ -4513,7 +4740,7 @@ */ __pyx_v_triangles.count = 0; - /* "yt/utilities/lib/marching_cubes.pyx":305 + /* "yt/utilities/lib/marching_cubes.pyx":314 * triangles.first = triangles.current = NULL * triangles.count = 0 * cell_pos[0] = left_edge[0] # <<<<<<<<<<<<<< @@ -4523,7 +4750,7 @@ __pyx_t_2 = 0; (__pyx_v_cell_pos[0]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_left_edge.diminfo[0].strides)); - /* "yt/utilities/lib/marching_cubes.pyx":306 + /* "yt/utilities/lib/marching_cubes.pyx":315 * triangles.count = 0 * cell_pos[0] = left_edge[0] * for i in range(dims[0]): # <<<<<<<<<<<<<< @@ -4534,7 +4761,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/utilities/lib/marching_cubes.pyx":307 + /* "yt/utilities/lib/marching_cubes.pyx":316 * cell_pos[0] = left_edge[0] * for i in range(dims[0]): * cell_pos[1] = left_edge[1] # <<<<<<<<<<<<<< @@ -4544,7 +4771,7 @@ __pyx_t_4 = 1; (__pyx_v_cell_pos[1]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_left_edge.diminfo[0].strides)); - /* "yt/utilities/lib/marching_cubes.pyx":308 + /* "yt/utilities/lib/marching_cubes.pyx":317 * for i in range(dims[0]): * cell_pos[1] = left_edge[1] * for j in range(dims[1]): # <<<<<<<<<<<<<< @@ -4555,7 +4782,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "yt/utilities/lib/marching_cubes.pyx":309 + /* "yt/utilities/lib/marching_cubes.pyx":318 * cell_pos[1] = left_edge[1] * for j in range(dims[1]): * cell_pos[2] = left_edge[2] # <<<<<<<<<<<<<< @@ -4565,7 +4792,7 @@ __pyx_t_7 = 2; (__pyx_v_cell_pos[2]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left_edge.diminfo[0].strides)); - /* "yt/utilities/lib/marching_cubes.pyx":310 + /* "yt/utilities/lib/marching_cubes.pyx":319 * for j in range(dims[1]): * cell_pos[2] = left_edge[2] * for k in range(dims[2]): # <<<<<<<<<<<<<< @@ -4576,7 +4803,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_k = __pyx_t_9; - /* "yt/utilities/lib/marching_cubes.pyx":311 + /* "yt/utilities/lib/marching_cubes.pyx":320 * cell_pos[2] = left_edge[2] * for k in range(dims[2]): * if mask[i,j,k] == 1: # <<<<<<<<<<<<<< @@ -4589,7 +4816,7 @@ __pyx_t_13 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_mask.diminfo[2].strides)) == 1) != 0); if (__pyx_t_13) { - /* "yt/utilities/lib/marching_cubes.pyx":313 + /* "yt/utilities/lib/marching_cubes.pyx":322 * if mask[i,j,k] == 1: * offset = i * (dims[1] + 1) * (dims[2] + 1) \ * + j * (dims[2] + 1) + k # <<<<<<<<<<<<<< @@ -4598,7 +4825,7 @@ */ __pyx_v_offset = ((((__pyx_v_i * ((__pyx_v_dims[1]) + 1)) * ((__pyx_v_dims[2]) + 1)) + (__pyx_v_j * ((__pyx_v_dims[2]) + 1))) + __pyx_v_k); - /* "yt/utilities/lib/marching_cubes.pyx":314 + /* "yt/utilities/lib/marching_cubes.pyx":323 * offset = i * (dims[1] + 1) * (dims[2] + 1) \ * + j * (dims[2] + 1) + k * intdata = data + offset # <<<<<<<<<<<<<< @@ -4607,7 +4834,7 @@ */ __pyx_v_intdata = (__pyx_v_data + __pyx_v_offset); - /* "yt/utilities/lib/marching_cubes.pyx":315 + /* "yt/utilities/lib/marching_cubes.pyx":324 * + j * (dims[2] + 1) + k * intdata = data + offset * offset_fill(dims, intdata, gv) # <<<<<<<<<<<<<< @@ -4616,7 +4843,7 @@ */ offset_fill(__pyx_v_dims, __pyx_v_intdata, __pyx_v_gv); - /* "yt/utilities/lib/marching_cubes.pyx":316 + /* "yt/utilities/lib/marching_cubes.pyx":325 * intdata = data + offset * offset_fill(dims, intdata, gv) * march_cubes(gv, isovalue, dds, # <<<<<<<<<<<<<< @@ -4625,7 +4852,7 @@ */ __pyx_f_2yt_9utilities_3lib_14marching_cubes_march_cubes(__pyx_v_gv, __pyx_v_isovalue, __pyx_v_dds, (__pyx_v_cell_pos[0]), (__pyx_v_cell_pos[1]), (__pyx_v_cell_pos[2]), (&__pyx_v_triangles)); - /* "yt/utilities/lib/marching_cubes.pyx":321 + /* "yt/utilities/lib/marching_cubes.pyx":330 * # Now our triangles collection has a bunch. We now * # calculate fluxes for each. * if last == NULL and triangles.first != NULL: # <<<<<<<<<<<<<< @@ -4643,7 +4870,7 @@ __pyx_L13_bool_binop_done:; if (__pyx_t_13) { - /* "yt/utilities/lib/marching_cubes.pyx":322 + /* "yt/utilities/lib/marching_cubes.pyx":331 * # calculate fluxes for each. * if last == NULL and triangles.first != NULL: * current = triangles.first # <<<<<<<<<<<<<< @@ -4653,7 +4880,7 @@ __pyx_t_15 = __pyx_v_triangles.first; __pyx_v_current = __pyx_t_15; - /* "yt/utilities/lib/marching_cubes.pyx":323 + /* "yt/utilities/lib/marching_cubes.pyx":332 * if last == NULL and triangles.first != NULL: * current = triangles.first * last = NULL # <<<<<<<<<<<<<< @@ -4662,7 +4889,7 @@ */ __pyx_v_last = NULL; - /* "yt/utilities/lib/marching_cubes.pyx":321 + /* "yt/utilities/lib/marching_cubes.pyx":330 * # Now our triangles collection has a bunch. We now * # calculate fluxes for each. * if last == NULL and triangles.first != NULL: # <<<<<<<<<<<<<< @@ -4672,7 +4899,7 @@ goto __pyx_L12; } - /* "yt/utilities/lib/marching_cubes.pyx":324 + /* "yt/utilities/lib/marching_cubes.pyx":333 * current = triangles.first * last = NULL * elif last != NULL: # <<<<<<<<<<<<<< @@ -4682,7 +4909,7 @@ __pyx_t_13 = ((__pyx_v_last != NULL) != 0); if (__pyx_t_13) { - /* "yt/utilities/lib/marching_cubes.pyx":325 + /* "yt/utilities/lib/marching_cubes.pyx":334 * last = NULL * elif last != NULL: * current = last.next # <<<<<<<<<<<<<< @@ -4692,7 +4919,7 @@ __pyx_t_15 = __pyx_v_last->next; __pyx_v_current = __pyx_t_15; - /* "yt/utilities/lib/marching_cubes.pyx":324 + /* "yt/utilities/lib/marching_cubes.pyx":333 * current = triangles.first * last = NULL * elif last != NULL: # <<<<<<<<<<<<<< @@ -4702,7 +4929,7 @@ } __pyx_L12:; - /* "yt/utilities/lib/marching_cubes.pyx":326 + /* "yt/utilities/lib/marching_cubes.pyx":335 * elif last != NULL: * current = last.next * while current != NULL: # <<<<<<<<<<<<<< @@ -4713,7 +4940,7 @@ __pyx_t_13 = ((__pyx_v_current != NULL) != 0); if (!__pyx_t_13) break; - /* "yt/utilities/lib/marching_cubes.pyx":328 + /* "yt/utilities/lib/marching_cubes.pyx":337 * while current != NULL: * # Calculate the center of the triangle * wval = 0.0 # <<<<<<<<<<<<<< @@ -4723,7 +4950,7 @@ __Pyx_INCREF(__pyx_float_0_0); __Pyx_XDECREF_SET(__pyx_v_wval, __pyx_float_0_0); - /* "yt/utilities/lib/marching_cubes.pyx":329 + /* "yt/utilities/lib/marching_cubes.pyx":338 * # Calculate the center of the triangle * wval = 0.0 * for n in range(3): # <<<<<<<<<<<<<< @@ -4733,7 +4960,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_n = __pyx_t_16; - /* "yt/utilities/lib/marching_cubes.pyx":330 + /* "yt/utilities/lib/marching_cubes.pyx":339 * wval = 0.0 * for n in range(3): * center[n] = 0.0 # <<<<<<<<<<<<<< @@ -4743,7 +4970,7 @@ (__pyx_v_center[__pyx_v_n]) = 0.0; } - /* "yt/utilities/lib/marching_cubes.pyx":331 + /* "yt/utilities/lib/marching_cubes.pyx":340 * for n in range(3): * center[n] = 0.0 * for n in range(3): # <<<<<<<<<<<<<< @@ -4753,7 +4980,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_n = __pyx_t_16; - /* "yt/utilities/lib/marching_cubes.pyx":332 + /* "yt/utilities/lib/marching_cubes.pyx":341 * center[n] = 0.0 * for n in range(3): * for m in range(3): # <<<<<<<<<<<<<< @@ -4763,7 +4990,7 @@ for (__pyx_t_17 = 0; __pyx_t_17 < 3; __pyx_t_17+=1) { __pyx_v_m = __pyx_t_17; - /* "yt/utilities/lib/marching_cubes.pyx":333 + /* "yt/utilities/lib/marching_cubes.pyx":342 * for n in range(3): * for m in range(3): * point[m] = (current.p[n][m]-cell_pos[m])*idds[m] # <<<<<<<<<<<<<< @@ -4773,7 +5000,7 @@ (__pyx_v_point[__pyx_v_m]) = ((((__pyx_v_current->p[__pyx_v_n])[__pyx_v_m]) - (__pyx_v_cell_pos[__pyx_v_m])) * (__pyx_v_idds[__pyx_v_m])); } - /* "yt/utilities/lib/marching_cubes.pyx":335 + /* "yt/utilities/lib/marching_cubes.pyx":344 * point[m] = (current.p[n][m]-cell_pos[m])*idds[m] * # Now we calculate the value at this point * temp = offset_interpolate(dims, point, intdata) # <<<<<<<<<<<<<< @@ -4782,22 +5009,22 @@ */ __pyx_v_temp = offset_interpolate(__pyx_v_dims, __pyx_v_point, __pyx_v_intdata); - /* "yt/utilities/lib/marching_cubes.pyx":337 + /* "yt/utilities/lib/marching_cubes.pyx":346 * temp = offset_interpolate(dims, point, intdata) * #print "something", temp, point[0], point[1], point[2] * wval += temp # <<<<<<<<<<<<<< * for m in range(3): * center[m] += temp * point[m] */ - __pyx_t_18 = PyFloat_FromDouble(__pyx_v_temp); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_18 = PyFloat_FromDouble(__pyx_v_temp); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = PyNumber_InPlaceAdd(__pyx_v_wval, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_19 = PyNumber_InPlaceAdd(__pyx_v_wval, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF_SET(__pyx_v_wval, __pyx_t_19); __pyx_t_19 = 0; - /* "yt/utilities/lib/marching_cubes.pyx":338 + /* "yt/utilities/lib/marching_cubes.pyx":347 * #print "something", temp, point[0], point[1], point[2] * wval += temp * for m in range(3): # <<<<<<<<<<<<<< @@ -4807,7 +5034,7 @@ for (__pyx_t_17 = 0; __pyx_t_17 < 3; __pyx_t_17+=1) { __pyx_v_m = __pyx_t_17; - /* "yt/utilities/lib/marching_cubes.pyx":339 + /* "yt/utilities/lib/marching_cubes.pyx":348 * wval += temp * for m in range(3): * center[m] += temp * point[m] # <<<<<<<<<<<<<< @@ -4819,7 +5046,7 @@ } } - /* "yt/utilities/lib/marching_cubes.pyx":341 + /* "yt/utilities/lib/marching_cubes.pyx":350 * center[m] += temp * point[m] * # Now we divide by our normalizing factor * for n in range(3): # <<<<<<<<<<<<<< @@ -4829,7 +5056,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_n = __pyx_t_16; - /* "yt/utilities/lib/marching_cubes.pyx":342 + /* "yt/utilities/lib/marching_cubes.pyx":351 * # Now we divide by our normalizing factor * for n in range(3): * center[n] /= wval # <<<<<<<<<<<<<< @@ -4837,17 +5064,17 @@ * # coordinates. So now we interpolate our three */ __pyx_t_17 = __pyx_v_n; - __pyx_t_19 = PyFloat_FromDouble((__pyx_v_center[__pyx_t_17])); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_19 = PyFloat_FromDouble((__pyx_v_center[__pyx_t_17])); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_18 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_19, __pyx_v_wval); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_19, __pyx_v_wval); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_18); if (unlikely((__pyx_t_21 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_18); if (unlikely((__pyx_t_21 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; (__pyx_v_center[__pyx_t_17]) = __pyx_t_21; } - /* "yt/utilities/lib/marching_cubes.pyx":346 + /* "yt/utilities/lib/marching_cubes.pyx":355 * # coordinates. So now we interpolate our three * # fields. * fv[0] = offset_interpolate(dims, center, v1data + offset) # <<<<<<<<<<<<<< @@ -4856,7 +5083,7 @@ */ (__pyx_v_fv[0]) = offset_interpolate(__pyx_v_dims, __pyx_v_center, (__pyx_v_v1data + __pyx_v_offset)); - /* "yt/utilities/lib/marching_cubes.pyx":347 + /* "yt/utilities/lib/marching_cubes.pyx":356 * # fields. * fv[0] = offset_interpolate(dims, center, v1data + offset) * fv[1] = offset_interpolate(dims, center, v2data + offset) # <<<<<<<<<<<<<< @@ -4865,7 +5092,7 @@ */ (__pyx_v_fv[1]) = offset_interpolate(__pyx_v_dims, __pyx_v_center, (__pyx_v_v2data + __pyx_v_offset)); - /* "yt/utilities/lib/marching_cubes.pyx":348 + /* "yt/utilities/lib/marching_cubes.pyx":357 * fv[0] = offset_interpolate(dims, center, v1data + offset) * fv[1] = offset_interpolate(dims, center, v2data + offset) * fv[2] = offset_interpolate(dims, center, v3data + offset) # <<<<<<<<<<<<<< @@ -4874,19 +5101,19 @@ */ (__pyx_v_fv[2]) = offset_interpolate(__pyx_v_dims, __pyx_v_center, (__pyx_v_v3data + __pyx_v_offset)); - /* "yt/utilities/lib/marching_cubes.pyx":350 + /* "yt/utilities/lib/marching_cubes.pyx":359 * fv[2] = offset_interpolate(dims, center, v3data + offset) * # We interpolate again the actual value data * wval = offset_interpolate(dims, center, fdata + offset) # <<<<<<<<<<<<<< * # Now we have our flux vector and our field value! * # We just need a normal vector with which we can */ - __pyx_t_18 = PyFloat_FromDouble(offset_interpolate(__pyx_v_dims, __pyx_v_center, (__pyx_v_fdata + __pyx_v_offset))); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_18 = PyFloat_FromDouble(offset_interpolate(__pyx_v_dims, __pyx_v_center, (__pyx_v_fdata + __pyx_v_offset))); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF_SET(__pyx_v_wval, __pyx_t_18); __pyx_t_18 = 0; - /* "yt/utilities/lib/marching_cubes.pyx":355 + /* "yt/utilities/lib/marching_cubes.pyx":364 * # dot it. The normal should be equal to the gradient * # in the center of the triangle, or thereabouts. * eval_gradient(dims, center, intdata, normal) # <<<<<<<<<<<<<< @@ -4895,7 +5122,7 @@ */ eval_gradient(__pyx_v_dims, __pyx_v_center, __pyx_v_intdata, __pyx_v_normal); - /* "yt/utilities/lib/marching_cubes.pyx":356 + /* "yt/utilities/lib/marching_cubes.pyx":365 * # in the center of the triangle, or thereabouts. * eval_gradient(dims, center, intdata, normal) * temp = 0.0 # <<<<<<<<<<<<<< @@ -4904,7 +5131,7 @@ */ __pyx_v_temp = 0.0; - /* "yt/utilities/lib/marching_cubes.pyx":357 + /* "yt/utilities/lib/marching_cubes.pyx":366 * eval_gradient(dims, center, intdata, normal) * temp = 0.0 * for n in range(3): # <<<<<<<<<<<<<< @@ -4914,64 +5141,64 @@ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_n = __pyx_t_16; - /* "yt/utilities/lib/marching_cubes.pyx":358 + /* "yt/utilities/lib/marching_cubes.pyx":367 * temp = 0.0 * for n in range(3): * temp += normal[n]*normal[n] # <<<<<<<<<<<<<< * # Take the negative, to ensure it points inwardly - * temp = -(temp**0.5) + * temp = -sqrt(temp) */ __pyx_v_temp = (__pyx_v_temp + ((__pyx_v_normal[__pyx_v_n]) * (__pyx_v_normal[__pyx_v_n]))); } - /* "yt/utilities/lib/marching_cubes.pyx":360 + /* "yt/utilities/lib/marching_cubes.pyx":369 * temp += normal[n]*normal[n] * # Take the negative, to ensure it points inwardly - * temp = -(temp**0.5) # <<<<<<<<<<<<<< + * temp = -sqrt(temp) # <<<<<<<<<<<<<< * # Dump this somewhere for now * temp = wval * (fv[0] * normal[0] + */ - __pyx_v_temp = (-pow(__pyx_v_temp, ((__pyx_t_5numpy_float64_t)0.5))); + __pyx_v_temp = (-sqrt(__pyx_v_temp)); - /* "yt/utilities/lib/marching_cubes.pyx":363 + /* "yt/utilities/lib/marching_cubes.pyx":372 * # Dump this somewhere for now * temp = wval * (fv[0] * normal[0] + * fv[1] * normal[1] + # <<<<<<<<<<<<<< * fv[2] * normal[2])/temp * # Now we need the area of the triangle. This will take */ - __pyx_t_18 = PyFloat_FromDouble(((((__pyx_v_fv[0]) * (__pyx_v_normal[0])) + ((__pyx_v_fv[1]) * (__pyx_v_normal[1]))) + ((__pyx_v_fv[2]) * (__pyx_v_normal[2])))); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_18 = PyFloat_FromDouble(((((__pyx_v_fv[0]) * (__pyx_v_normal[0])) + ((__pyx_v_fv[1]) * (__pyx_v_normal[1]))) + ((__pyx_v_fv[2]) * (__pyx_v_normal[2])))); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - /* "yt/utilities/lib/marching_cubes.pyx":362 - * temp = -(temp**0.5) + /* "yt/utilities/lib/marching_cubes.pyx":371 + * temp = -sqrt(temp) * # Dump this somewhere for now * temp = wval * (fv[0] * normal[0] + # <<<<<<<<<<<<<< * fv[1] * normal[1] + * fv[2] * normal[2])/temp */ - __pyx_t_19 = PyNumber_Multiply(__pyx_v_wval, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_19 = PyNumber_Multiply(__pyx_v_wval, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - /* "yt/utilities/lib/marching_cubes.pyx":364 + /* "yt/utilities/lib/marching_cubes.pyx":373 * temp = wval * (fv[0] * normal[0] + * fv[1] * normal[1] + * fv[2] * normal[2])/temp # <<<<<<<<<<<<<< * # Now we need the area of the triangle. This will take * # a lot of time to calculate compared to the rest. */ - __pyx_t_18 = PyFloat_FromDouble(__pyx_v_temp); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_18 = PyFloat_FromDouble(__pyx_v_temp); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_22 = __Pyx_PyNumber_Divide(__pyx_t_19, __pyx_t_18); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyNumber_Divide(__pyx_t_19, __pyx_t_18); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_22); if (unlikely((__pyx_t_21 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_22); if (unlikely((__pyx_t_21 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __pyx_v_temp = __pyx_t_21; - /* "yt/utilities/lib/marching_cubes.pyx":368 + /* "yt/utilities/lib/marching_cubes.pyx":377 * # a lot of time to calculate compared to the rest. * # We use Heron's formula. * for n in range(3): # <<<<<<<<<<<<<< @@ -4981,124 +5208,124 @@ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_n = __pyx_t_16; - /* "yt/utilities/lib/marching_cubes.pyx":369 + /* "yt/utilities/lib/marching_cubes.pyx":378 * # We use Heron's formula. * for n in range(3): * fv[n] = 0.0 # <<<<<<<<<<<<<< * for n in range(3): - * fv[0] += (current.p[0][n] - current.p[2][n])**2.0 + * fv[0] += (current.p[0][n] - current.p[2][n]) * (current.p[0][n] - current.p[2][n]) */ (__pyx_v_fv[__pyx_v_n]) = 0.0; } - /* "yt/utilities/lib/marching_cubes.pyx":370 + /* "yt/utilities/lib/marching_cubes.pyx":379 * for n in range(3): * fv[n] = 0.0 * for n in range(3): # <<<<<<<<<<<<<< - * fv[0] += (current.p[0][n] - current.p[2][n])**2.0 - * fv[1] += (current.p[1][n] - current.p[0][n])**2.0 + * fv[0] += (current.p[0][n] - current.p[2][n]) * (current.p[0][n] - current.p[2][n]) + * fv[1] += (current.p[1][n] - current.p[0][n]) * (current.p[1][n] - current.p[0][n]) */ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_n = __pyx_t_16; - /* "yt/utilities/lib/marching_cubes.pyx":371 + /* "yt/utilities/lib/marching_cubes.pyx":380 * fv[n] = 0.0 * for n in range(3): - * fv[0] += (current.p[0][n] - current.p[2][n])**2.0 # <<<<<<<<<<<<<< - * fv[1] += (current.p[1][n] - current.p[0][n])**2.0 - * fv[2] += (current.p[2][n] - current.p[1][n])**2.0 + * fv[0] += (current.p[0][n] - current.p[2][n]) * (current.p[0][n] - current.p[2][n]) # <<<<<<<<<<<<<< + * fv[1] += (current.p[1][n] - current.p[0][n]) * (current.p[1][n] - current.p[0][n]) + * fv[2] += (current.p[2][n] - current.p[1][n]) * (current.p[2][n] - current.p[1][n]) */ __pyx_t_23 = 0; - (__pyx_v_fv[__pyx_t_23]) = ((__pyx_v_fv[__pyx_t_23]) + pow((((__pyx_v_current->p[0])[__pyx_v_n]) - ((__pyx_v_current->p[2])[__pyx_v_n])), ((__pyx_t_5numpy_float64_t)2.0))); + (__pyx_v_fv[__pyx_t_23]) = ((__pyx_v_fv[__pyx_t_23]) + ((((__pyx_v_current->p[0])[__pyx_v_n]) - ((__pyx_v_current->p[2])[__pyx_v_n])) * (((__pyx_v_current->p[0])[__pyx_v_n]) - ((__pyx_v_current->p[2])[__pyx_v_n])))); - /* "yt/utilities/lib/marching_cubes.pyx":372 + /* "yt/utilities/lib/marching_cubes.pyx":381 * for n in range(3): - * fv[0] += (current.p[0][n] - current.p[2][n])**2.0 - * fv[1] += (current.p[1][n] - current.p[0][n])**2.0 # <<<<<<<<<<<<<< - * fv[2] += (current.p[2][n] - current.p[1][n])**2.0 + * fv[0] += (current.p[0][n] - current.p[2][n]) * (current.p[0][n] - current.p[2][n]) + * fv[1] += (current.p[1][n] - current.p[0][n]) * (current.p[1][n] - current.p[0][n]) # <<<<<<<<<<<<<< + * fv[2] += (current.p[2][n] - current.p[1][n]) * (current.p[2][n] - current.p[1][n]) * s = 0.0 */ __pyx_t_23 = 1; - (__pyx_v_fv[__pyx_t_23]) = ((__pyx_v_fv[__pyx_t_23]) + pow((((__pyx_v_current->p[1])[__pyx_v_n]) - ((__pyx_v_current->p[0])[__pyx_v_n])), ((__pyx_t_5numpy_float64_t)2.0))); + (__pyx_v_fv[__pyx_t_23]) = ((__pyx_v_fv[__pyx_t_23]) + ((((__pyx_v_current->p[1])[__pyx_v_n]) - ((__pyx_v_current->p[0])[__pyx_v_n])) * (((__pyx_v_current->p[1])[__pyx_v_n]) - ((__pyx_v_current->p[0])[__pyx_v_n])))); - /* "yt/utilities/lib/marching_cubes.pyx":373 - * fv[0] += (current.p[0][n] - current.p[2][n])**2.0 - * fv[1] += (current.p[1][n] - current.p[0][n])**2.0 - * fv[2] += (current.p[2][n] - current.p[1][n])**2.0 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/marching_cubes.pyx":382 + * fv[0] += (current.p[0][n] - current.p[2][n]) * (current.p[0][n] - current.p[2][n]) + * fv[1] += (current.p[1][n] - current.p[0][n]) * (current.p[1][n] - current.p[0][n]) + * fv[2] += (current.p[2][n] - current.p[1][n]) * (current.p[2][n] - current.p[1][n]) # <<<<<<<<<<<<<< * s = 0.0 * for n in range(3): */ __pyx_t_23 = 2; - (__pyx_v_fv[__pyx_t_23]) = ((__pyx_v_fv[__pyx_t_23]) + pow((((__pyx_v_current->p[2])[__pyx_v_n]) - ((__pyx_v_current->p[1])[__pyx_v_n])), ((__pyx_t_5numpy_float64_t)2.0))); + (__pyx_v_fv[__pyx_t_23]) = ((__pyx_v_fv[__pyx_t_23]) + ((((__pyx_v_current->p[2])[__pyx_v_n]) - ((__pyx_v_current->p[1])[__pyx_v_n])) * (((__pyx_v_current->p[2])[__pyx_v_n]) - ((__pyx_v_current->p[1])[__pyx_v_n])))); } - /* "yt/utilities/lib/marching_cubes.pyx":374 - * fv[1] += (current.p[1][n] - current.p[0][n])**2.0 - * fv[2] += (current.p[2][n] - current.p[1][n])**2.0 + /* "yt/utilities/lib/marching_cubes.pyx":383 + * fv[1] += (current.p[1][n] - current.p[0][n]) * (current.p[1][n] - current.p[0][n]) + * fv[2] += (current.p[2][n] - current.p[1][n]) * (current.p[2][n] - current.p[1][n]) * s = 0.0 # <<<<<<<<<<<<<< * for n in range(3): - * fv[n] = fv[n]**0.5 + * fv[n] = sqrt(fv[n]) */ __pyx_v_s = 0.0; - /* "yt/utilities/lib/marching_cubes.pyx":375 - * fv[2] += (current.p[2][n] - current.p[1][n])**2.0 + /* "yt/utilities/lib/marching_cubes.pyx":384 + * fv[2] += (current.p[2][n] - current.p[1][n]) * (current.p[2][n] - current.p[1][n]) * s = 0.0 * for n in range(3): # <<<<<<<<<<<<<< - * fv[n] = fv[n]**0.5 + * fv[n] = sqrt(fv[n]) * s += 0.5 * fv[n] */ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_n = __pyx_t_16; - /* "yt/utilities/lib/marching_cubes.pyx":376 + /* "yt/utilities/lib/marching_cubes.pyx":385 * s = 0.0 * for n in range(3): - * fv[n] = fv[n]**0.5 # <<<<<<<<<<<<<< + * fv[n] = sqrt(fv[n]) # <<<<<<<<<<<<<< * s += 0.5 * fv[n] * area = (s*(s-fv[0])*(s-fv[1])*(s-fv[2])) */ - (__pyx_v_fv[__pyx_v_n]) = pow((__pyx_v_fv[__pyx_v_n]), ((__pyx_t_5numpy_float64_t)0.5)); + (__pyx_v_fv[__pyx_v_n]) = sqrt((__pyx_v_fv[__pyx_v_n])); - /* "yt/utilities/lib/marching_cubes.pyx":377 + /* "yt/utilities/lib/marching_cubes.pyx":386 * for n in range(3): - * fv[n] = fv[n]**0.5 + * fv[n] = sqrt(fv[n]) * s += 0.5 * fv[n] # <<<<<<<<<<<<<< * area = (s*(s-fv[0])*(s-fv[1])*(s-fv[2])) - * area = area**0.5 + * area = sqrt(area) */ __pyx_v_s = (__pyx_v_s + (0.5 * (__pyx_v_fv[__pyx_v_n]))); } - /* "yt/utilities/lib/marching_cubes.pyx":378 - * fv[n] = fv[n]**0.5 + /* "yt/utilities/lib/marching_cubes.pyx":387 + * fv[n] = sqrt(fv[n]) * s += 0.5 * fv[n] * area = (s*(s-fv[0])*(s-fv[1])*(s-fv[2])) # <<<<<<<<<<<<<< - * area = area**0.5 + * area = sqrt(area) * flux += temp*area */ __pyx_v_area = (((__pyx_v_s * (__pyx_v_s - (__pyx_v_fv[0]))) * (__pyx_v_s - (__pyx_v_fv[1]))) * (__pyx_v_s - (__pyx_v_fv[2]))); - /* "yt/utilities/lib/marching_cubes.pyx":379 + /* "yt/utilities/lib/marching_cubes.pyx":388 * s += 0.5 * fv[n] * area = (s*(s-fv[0])*(s-fv[1])*(s-fv[2])) - * area = area**0.5 # <<<<<<<<<<<<<< + * area = sqrt(area) # <<<<<<<<<<<<<< * flux += temp*area * last = current */ - __pyx_v_area = pow(__pyx_v_area, ((__pyx_t_5numpy_float64_t)0.5)); + __pyx_v_area = sqrt(__pyx_v_area); - /* "yt/utilities/lib/marching_cubes.pyx":380 + /* "yt/utilities/lib/marching_cubes.pyx":389 * area = (s*(s-fv[0])*(s-fv[1])*(s-fv[2])) - * area = area**0.5 + * area = sqrt(area) * flux += temp*area # <<<<<<<<<<<<<< * last = current * if current.next == NULL: break */ __pyx_v_flux = (__pyx_v_flux + (__pyx_v_temp * __pyx_v_area)); - /* "yt/utilities/lib/marching_cubes.pyx":381 - * area = area**0.5 + /* "yt/utilities/lib/marching_cubes.pyx":390 + * area = sqrt(area) * flux += temp*area * last = current # <<<<<<<<<<<<<< * if current.next == NULL: break @@ -5106,7 +5333,7 @@ */ __pyx_v_last = __pyx_v_current; - /* "yt/utilities/lib/marching_cubes.pyx":382 + /* "yt/utilities/lib/marching_cubes.pyx":391 * flux += temp*area * last = current * if current.next == NULL: break # <<<<<<<<<<<<<< @@ -5118,7 +5345,7 @@ goto __pyx_L16_break; } - /* "yt/utilities/lib/marching_cubes.pyx":383 + /* "yt/utilities/lib/marching_cubes.pyx":392 * last = current * if current.next == NULL: break * current = current.next # <<<<<<<<<<<<<< @@ -5130,7 +5357,7 @@ } __pyx_L16_break:; - /* "yt/utilities/lib/marching_cubes.pyx":311 + /* "yt/utilities/lib/marching_cubes.pyx":320 * cell_pos[2] = left_edge[2] * for k in range(dims[2]): * if mask[i,j,k] == 1: # <<<<<<<<<<<<<< @@ -5139,7 +5366,7 @@ */ } - /* "yt/utilities/lib/marching_cubes.pyx":384 + /* "yt/utilities/lib/marching_cubes.pyx":393 * if current.next == NULL: break * current = current.next * cell_pos[2] += dds[2] # <<<<<<<<<<<<<< @@ -5150,7 +5377,7 @@ (__pyx_v_cell_pos[__pyx_t_23]) = ((__pyx_v_cell_pos[__pyx_t_23]) + (__pyx_v_dds[2])); } - /* "yt/utilities/lib/marching_cubes.pyx":385 + /* "yt/utilities/lib/marching_cubes.pyx":394 * current = current.next * cell_pos[2] += dds[2] * cell_pos[1] += dds[1] # <<<<<<<<<<<<<< @@ -5161,7 +5388,7 @@ (__pyx_v_cell_pos[__pyx_t_23]) = ((__pyx_v_cell_pos[__pyx_t_23]) + (__pyx_v_dds[1])); } - /* "yt/utilities/lib/marching_cubes.pyx":386 + /* "yt/utilities/lib/marching_cubes.pyx":395 * cell_pos[2] += dds[2] * cell_pos[1] += dds[1] * cell_pos[0] += dds[0] # <<<<<<<<<<<<<< @@ -5172,7 +5399,7 @@ (__pyx_v_cell_pos[__pyx_t_23]) = ((__pyx_v_cell_pos[__pyx_t_23]) + (__pyx_v_dds[0])); } - /* "yt/utilities/lib/marching_cubes.pyx":388 + /* "yt/utilities/lib/marching_cubes.pyx":397 * cell_pos[0] += dds[0] * # Hallo, we are all done. * WipeTriangles(triangles.first) # <<<<<<<<<<<<<< @@ -5181,20 +5408,20 @@ */ __pyx_f_2yt_9utilities_3lib_14marching_cubes_WipeTriangles(__pyx_v_triangles.first); - /* "yt/utilities/lib/marching_cubes.pyx":389 + /* "yt/utilities/lib/marching_cubes.pyx":398 * # Hallo, we are all done. * WipeTriangles(triangles.first) * return flux # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_22 = PyFloat_FromDouble(__pyx_v_flux); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_22 = PyFloat_FromDouble(__pyx_v_flux); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); __pyx_r = __pyx_t_22; __pyx_t_22 = 0; goto __pyx_L0; - /* "yt/utilities/lib/marching_cubes.pyx":268 + /* "yt/utilities/lib/marching_cubes.pyx":277 * @cython.wraparound(False) * @cython.cdivision(True) * def march_cubes_grid_flux( # <<<<<<<<<<<<<< @@ -5239,3008 +5466,3008 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "yt/utilities/lib/fp_utils.pxd":20 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * if info == NULL: return # <<<<<<<<<<<<<< * + * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; + __pyx_r = 0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ + __pyx_v_endian_detector = 1; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * ndim = PyArray_NDIM(self) */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":24 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline int imin(int i0, int i1) nogil: + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ + __pyx_v_copy_shape = 1; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; + } -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + /*else*/ { + __pyx_v_copy_shape = 0; } + __pyx_L4:; - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * 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_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + * 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") * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 218, __pyx_L1_error) - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * 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") */ + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":36 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") * */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * info.buf = PyArray_DATA(self) */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 222, __pyx_L1_error) - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * 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") */ + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":40 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_v_info->ndim = __pyx_v_ndim; - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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]); - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; + goto __pyx_L11; } - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fclip(np.float64_t f, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + /*else*/ { + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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; -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; - - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * cdef int t */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ + __pyx_v_f = NULL; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ + __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; -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":54 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< * + * if not hasfields and not copy_shape: */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + goto __pyx_L14; + } -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * + * if not hasfields: */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); } + __pyx_L14:; - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_endian_detector = 1; + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 259, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - __pyx_v_copy_shape = 1; + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - goto __pyx_L4; - } + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ - if (__pyx_t_1) { + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - } + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ - if (__pyx_t_1) { + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - } + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 278, __pyx_L1_error) + break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return * else: */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + __pyx_v_info->format = __pyx_v_f; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< * else: - * info.strides = PyArray_STRIDES(self) + * info.format = stdlib.malloc(_buffer_format_string_len) */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - goto __pyx_L11; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; + (__pyx_v_info->format[0]) = '^'; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ - __pyx_v_info->suboffsets = NULL; + __pyx_v_offset = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< * - * cdef int t + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + (__pyx_v_f[0]) = '\x00'; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - __pyx_v_f = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * 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; + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * if not hasfields and not copy_shape: + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { +/* 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)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - goto __pyx_L14; - } + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * if not hasfields: + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); } - __pyx_L14:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + free(__pyx_v_info->strides); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_1) { + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; + __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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; + __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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * 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): */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; + __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, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) + * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< * - * def __releasebuffer__(ndarray self, Py_buffer* info): + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - (__pyx_v_f[0]) = '\x00'; - } + __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, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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_r = 0; - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * 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. */ -/* 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) { +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 - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); + 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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * */ - free(__pyx_v_info->format); + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * 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, 794, __pyx_L1_error) } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields * */ - free(__pyx_v_info->strides); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - } + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * if (end - f) - (new_offset - offset[0]) < 15: */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + * 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, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew2(a, b): + * if ((child.byteorder == c'>' and little_endian) or */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 799, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 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:; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 * - * cdef inline object PyArray_MultiIterNew3(a, b, c): + * 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_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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + if (__pyx_t_6) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 803, __pyx_L1_error) -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * 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_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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 */ + (__pyx_v_f[0]) = 0x78; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 * - * 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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< * + * offset[0] += child.itemsize */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) + * 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); -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __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, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * 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. */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields + * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_v_endian_detector = 1; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 823, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + * # 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" */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" */ - if (unlikely(__pyx_v_descr->fields == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_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:; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_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:; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - if (__pyx_t_6) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - } + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 0x78; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; + (__pyx_v_f[0]) = 0x66; goto __pyx_L15; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; + (__pyx_v_f[0]) = 0x64; goto __pyx_L15; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; + (__pyx_v_f[0]) = 0x67; goto __pyx_L15; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L15; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L15; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L15; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; + (__pyx_v_f[0]) = 79; goto __pyx_L15; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; + /*else*/ { + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 844, __pyx_L1_error) } + __pyx_L15:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } + goto __pyx_L13; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } + __pyx_r = __pyx_v_f; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } + __pyx_v_baseptr = NULL; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * 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; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - goto __pyx_L13; } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * - * 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. + * 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_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_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_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_v_baseptr = NULL; + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - goto __pyx_L3; + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":24 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 + * + */ + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - /*else*/ { - Py_INCREF(__pyx_v_base); + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - Py_XDECREF(__pyx_v_arr->base); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * cdef inline object get_array_base(ndarray arr): */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* function exit code */ - __Pyx_RefNannyFinishContext(); + __pyx_L0:; + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 * - * 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); + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":36 * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 * */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + if (__pyx_t_1) { + __pyx_r = (-__pyx_v_f0); goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + */ + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/utilities/lib/fp_utils.pxd":40 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - { - __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:*/ { + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * + */ + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int import_umath() except -1: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fclip(np.float64_t f, + */ + __pyx_r = __pyx_v_i; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ -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); +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_ufunc() except -1: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":58 * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* 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; } @@ -8272,11 +8499,12 @@ {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_YTArray, __pyx_k_YTArray, sizeof(__pyx_k_YTArray), 0, 0, 1, 1}, {&__pyx_n_s_area, __pyx_k_area, sizeof(__pyx_k_area), 0, 0, 1, 1}, {&__pyx_n_s_cell_pos, __pyx_k_cell_pos, sizeof(__pyx_k_cell_pos), 0, 0, 1, 1}, {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 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_current, __pyx_k_current, sizeof(__pyx_k_current), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_dds, __pyx_k_dds, sizeof(__pyx_k_dds), 0, 0, 1, 1}, @@ -8327,6 +8555,7 @@ {&__pyx_n_s_temp, __pyx_k_temp, sizeof(__pyx_k_temp), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_triangles, __pyx_k_triangles, sizeof(__pyx_k_triangles), 0, 0, 1, 1}, + {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 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_v1, __pyx_k_v1, sizeof(__pyx_k_v1), 0, 0, 1, 1}, {&__pyx_n_s_v1data, __pyx_k_v1data, sizeof(__pyx_k_v1data), 0, 0, 1, 1}, @@ -8337,12 +8566,14 @@ {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_n_s_vertices, __pyx_k_vertices, sizeof(__pyx_k_vertices), 0, 0, 1, 1}, {&__pyx_n_s_wval, __pyx_k_wval, sizeof(__pyx_k_wval), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_marching_cubes, __pyx_k_yt_utilities_lib_marching_cubes, sizeof(__pyx_k_yt_utilities_lib_marching_cubes), 0, 0, 1, 1}, + {&__pyx_n_s_yt_units_yt_array, __pyx_k_yt_units_yt_array, sizeof(__pyx_k_yt_units_yt_array), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_marching_cubes, __pyx_k_yt_utilities_lib_marching_cubes, sizeof(__pyx_k_yt_utilities_lib_marching_cubes), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_marching_cubes_2, __pyx_k_yt_utilities_lib_marching_cubes_2, sizeof(__pyx_k_yt_utilities_lib_marching_cubes_2), 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, 43, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 50, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) @@ -8452,29 +8683,29 @@ __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "yt/utilities/lib/marching_cubes.pyx":165 + /* "yt/utilities/lib/marching_cubes.pyx":172 * @cython.wraparound(False) * @cython.cdivision(True) * def march_cubes_grid(np.float64_t isovalue, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=3] values, * np.ndarray[np.uint8_t, ndim=3, cast=True] mask, */ - __pyx_tuple__10 = PyTuple_Pack(31, __pyx_n_s_isovalue, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_left_edge, __pyx_n_s_dxs, __pyx_n_s_obj_sample, __pyx_n_s_sample_type, __pyx_n_s_dims, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_nt, __pyx_n_s_offset, __pyx_n_s_gv, __pyx_n_s_pos, __pyx_n_s_point, __pyx_n_s_idds, __pyx_n_s_intdata, __pyx_n_s_sdata, __pyx_n_s_do_sample, __pyx_n_s_sample, __pyx_n_s_sampled, __pyx_n_s_triangles, __pyx_n_s_last, __pyx_n_s_current, __pyx_n_s_data, __pyx_n_s_dds, __pyx_n_s_vertices, __pyx_n_s_nskip); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(31, __pyx_n_s_isovalue, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_left_edge, __pyx_n_s_dxs, __pyx_n_s_obj_sample, __pyx_n_s_sample_type, __pyx_n_s_dims, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_nt, __pyx_n_s_offset, __pyx_n_s_gv, __pyx_n_s_pos, __pyx_n_s_point, __pyx_n_s_idds, __pyx_n_s_intdata, __pyx_n_s_sdata, __pyx_n_s_do_sample, __pyx_n_s_sample, __pyx_n_s_sampled, __pyx_n_s_triangles, __pyx_n_s_last, __pyx_n_s_current, __pyx_n_s_data, __pyx_n_s_dds, __pyx_n_s_vertices, __pyx_n_s_nskip); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(7, 0, 31, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_march_cubes_grid, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(7, 0, 31, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_marching_cubes, __pyx_n_s_march_cubes_grid, 172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 172, __pyx_L1_error) - /* "yt/utilities/lib/marching_cubes.pyx":268 + /* "yt/utilities/lib/marching_cubes.pyx":277 * @cython.wraparound(False) * @cython.cdivision(True) * def march_cubes_grid_flux( # <<<<<<<<<<<<<< * np.float64_t isovalue, * np.ndarray[np.float64_t, ndim=3] values, */ - __pyx_tuple__12 = PyTuple_Pack(38, __pyx_n_s_isovalue, __pyx_n_s_values, __pyx_n_s_v1, __pyx_n_s_v2, __pyx_n_s_v3, __pyx_n_s_flux_field, __pyx_n_s_mask, __pyx_n_s_left_edge, __pyx_n_s_dxs, __pyx_n_s_dims, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_offset, __pyx_n_s_gv, __pyx_n_s_intdata, __pyx_n_s_triangles, __pyx_n_s_current, __pyx_n_s_last, __pyx_n_s_data, __pyx_n_s_v1data, __pyx_n_s_v2data, __pyx_n_s_v3data, __pyx_n_s_fdata, __pyx_n_s_dds, __pyx_n_s_flux, __pyx_n_s_temp, __pyx_n_s_area, __pyx_n_s_s, __pyx_n_s_center, __pyx_n_s_point, __pyx_n_s_cell_pos, __pyx_n_s_fv, __pyx_n_s_idds, __pyx_n_s_normal, __pyx_n_s_wval); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(38, __pyx_n_s_isovalue, __pyx_n_s_values, __pyx_n_s_v1, __pyx_n_s_v2, __pyx_n_s_v3, __pyx_n_s_flux_field, __pyx_n_s_mask, __pyx_n_s_left_edge, __pyx_n_s_dxs, __pyx_n_s_dims, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_offset, __pyx_n_s_gv, __pyx_n_s_intdata, __pyx_n_s_triangles, __pyx_n_s_current, __pyx_n_s_last, __pyx_n_s_data, __pyx_n_s_v1data, __pyx_n_s_v2data, __pyx_n_s_v3data, __pyx_n_s_fdata, __pyx_n_s_dds, __pyx_n_s_flux, __pyx_n_s_temp, __pyx_n_s_area, __pyx_n_s_s, __pyx_n_s_center, __pyx_n_s_point, __pyx_n_s_cell_pos, __pyx_n_s_fv, __pyx_n_s_idds, __pyx_n_s_normal, __pyx_n_s_wval); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(9, 0, 38, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_march_cubes_grid_flux, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(9, 0, 38, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_marching_cubes, __pyx_n_s_march_cubes_grid_flux, 277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -8500,6 +8731,7 @@ #endif { PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -8547,6 +8779,7 @@ __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 @@ -8607,46 +8840,67 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/marching_cubes.pyx":165 + /* "yt/utilities/lib/marching_cubes.pyx":28 + * vertex_interp + * + * from yt.units.yt_array import YTArray # <<<<<<<<<<<<<< + * + * cdef extern from "marching_cubes.h": + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_YTArray); + __Pyx_GIVEREF(__pyx_n_s_YTArray); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_YTArray); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_yt_units_yt_array, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __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_YTArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_YTArray, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/marching_cubes.pyx":172 * @cython.wraparound(False) * @cython.cdivision(True) * def march_cubes_grid(np.float64_t isovalue, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=3] values, * np.ndarray[np.uint8_t, ndim=3, cast=True] mask, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14marching_cubes_1march_cubes_grid, NULL, __pyx_n_s_yt_utilities_lib_marching_cubes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_march_cubes_grid, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14marching_cubes_1march_cubes_grid, NULL, __pyx_n_s_yt_utilities_lib_marching_cubes_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_march_cubes_grid, __pyx_t_2) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/marching_cubes.pyx":268 + /* "yt/utilities/lib/marching_cubes.pyx":277 * @cython.wraparound(False) * @cython.cdivision(True) * def march_cubes_grid_flux( # <<<<<<<<<<<<<< * np.float64_t isovalue, * np.ndarray[np.float64_t, ndim=3] values, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14marching_cubes_3march_cubes_grid_flux, NULL, __pyx_n_s_yt_utilities_lib_marching_cubes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_march_cubes_grid_flux, __pyx_t_1) < 0) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14marching_cubes_3march_cubes_grid_flux, NULL, __pyx_n_s_yt_utilities_lib_marching_cubes_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_march_cubes_grid_flux, __pyx_t_2) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "yt/utilities/lib/marching_cubes.pyx":1 * """ # <<<<<<<<<<<<<< * Marching cubes implementation * */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /*--- Wrapped vars code ---*/ @@ -8654,9 +8908,10 @@ 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 yt.utilities.lib.marching_cubes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.marching_cubes", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -9551,6 +9806,180 @@ } #endif +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* 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; + } +} + +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL +#include "frameobject.h" +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = PyThreadState_GET(); + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyCFunctionFastCall */ + #if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + 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 + /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, @@ -9901,6 +10330,54 @@ 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 */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; @@ -10041,12 +10518,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -11011,6 +11491,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -11019,11 +11501,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/marching_cubes.pyx yt-3.4.0/yt/utilities/lib/marching_cubes.pyx --- yt-3.3.3/yt/utilities/lib/marching_cubes.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/marching_cubes.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -18,7 +18,14 @@ import numpy as np from yt.utilities.lib.fp_utils cimport imax, fmax, imin, fmin, iclip, fclip from libc.stdlib cimport malloc, free, abs -from fixed_interpolator cimport * +from libc.math cimport sqrt +from fixed_interpolator cimport \ + eval_gradient, \ + offset_fill, \ + offset_interpolate, \ + vertex_interp + +from yt.units.yt_array import YTArray cdef extern from "marching_cubes.h": int tri_table[256][16] @@ -260,6 +267,8 @@ sampled = np.zeros(triangles.count * nskip, dtype='float64') FillTriangleValues(sampled, triangles.first, nskip) FillAndWipeTriangles(vertices, triangles.first) + if hasattr(obj_sample, 'units'): + sampled = YTArray(sampled, obj_sample.units) return vertices, sampled @cython.boundscheck(False) @@ -357,7 +366,7 @@ for n in range(3): temp += normal[n]*normal[n] # Take the negative, to ensure it points inwardly - temp = -(temp**0.5) + temp = -sqrt(temp) # Dump this somewhere for now temp = wval * (fv[0] * normal[0] + fv[1] * normal[1] + @@ -368,15 +377,15 @@ for n in range(3): fv[n] = 0.0 for n in range(3): - fv[0] += (current.p[0][n] - current.p[2][n])**2.0 - fv[1] += (current.p[1][n] - current.p[0][n])**2.0 - fv[2] += (current.p[2][n] - current.p[1][n])**2.0 + fv[0] += (current.p[0][n] - current.p[2][n]) * (current.p[0][n] - current.p[2][n]) + fv[1] += (current.p[1][n] - current.p[0][n]) * (current.p[1][n] - current.p[0][n]) + fv[2] += (current.p[2][n] - current.p[1][n]) * (current.p[2][n] - current.p[1][n]) s = 0.0 for n in range(3): - fv[n] = fv[n]**0.5 + fv[n] = sqrt(fv[n]) s += 0.5 * fv[n] area = (s*(s-fv[0])*(s-fv[1])*(s-fv[2])) - area = area**0.5 + area = sqrt(area) flux += temp*area last = current if current.next == NULL: break diff -Nru yt-3.3.3/yt/utilities/lib/mesh_construction.pxd yt-3.4.0/yt/utilities/lib/mesh_construction.pxd --- yt-3.3.3/yt/utilities/lib/mesh_construction.pxd 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/mesh_construction.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -18,3 +18,9 @@ unsigned int geomID np.float64_t* vertices np.float64_t* field_data + +ctypedef struct Tet_Patch: + float[6][3] v + unsigned int geomID + np.float64_t* vertices + np.float64_t* field_data diff -Nru yt-3.3.3/yt/utilities/lib/mesh_construction.pyx yt-3.4.0/yt/utilities/lib/mesh_construction.pyx --- yt-3.3.3/yt/utilities/lib/mesh_construction.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/mesh_construction.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -1,5 +1,5 @@ """ -This file contains the ElementMesh classes, which represent the target that the +This file contains the ElementMesh classes, which represent the target that the rays will be cast at when rendering finite element data. This class handles the interface between the internal representation of the mesh and the pyembree representation. @@ -22,7 +22,7 @@ from libc.math cimport fmax, sqrt cimport numpy as np -cimport pyembree.rtcore as rtc +cimport pyembree.rtcore as rtc cimport pyembree.rtcore_geometry as rtcg cimport pyembree.rtcore_ray as rtcr cimport pyembree.rtcore_geometry_user as rtcgu @@ -38,13 +38,15 @@ sample_wedge from mesh_intersection cimport \ patchIntersectFunc, \ - patchBoundsFunc + patchBoundsFunc, \ + tet_patchIntersectFunc, \ + tet_patchBoundsFunc from yt.utilities.exceptions import YTElementTypeNotRecognized cdef extern from "mesh_triangulation.h": enum: MAX_NUM_TRI - + int HEX_NV int HEX_NT int TETRA_NV @@ -55,13 +57,14 @@ int triangulate_tetra[MAX_NUM_TRI][3] int triangulate_wedge[MAX_NUM_TRI][3] int hex20_faces[6][8] + int tet10_faces[4][6] cdef class LinearElementMesh: r''' This creates a 1st-order mesh to be ray-traced with embree. - Currently, we handle non-triangular mesh types by converting them + Currently, we handle non-triangular mesh types by converting them to triangular meshes. This class performs this transformation. Currently, this is implemented for hexahedral and tetrahedral meshes. @@ -72,21 +75,21 @@ scene : EmbreeScene This is the scene to which the constructed polygons will be added. - vertices : a np.ndarray of floats. - This specifies the x, y, and z coordinates of the vertices in - the polygon mesh. This should either have the shape - (num_vertices, 3). For example, vertices[2][1] should give the + vertices : a np.ndarray of floats. + This specifies the x, y, and z coordinates of the vertices in + the polygon mesh. This should either have the shape + (num_vertices, 3). For example, vertices[2][1] should give the y-coordinate of the 3rd vertex in the mesh. indices : a np.ndarray of ints - This should either have the shape (num_elements, 4) or - (num_elements, 8) for tetrahedral and hexahedral meshes, - respectively. For tetrahedral meshes, each element will + This should either have the shape (num_elements, 4) or + (num_elements, 8) for tetrahedral and hexahedral meshes, + respectively. For tetrahedral meshes, each element will be represented by four triangles in the scene. For hex meshes, - each element will be represented by 12 triangles, 2 for each + each element will be represented by 12 triangles, 2 for each face. For hex meshes, we assume that the node ordering is as - defined here: + defined here: http://homepages.cae.wisc.edu/~tautges/papers/cnmev3.pdf - + ''' cdef Vertex* vertices @@ -94,7 +97,7 @@ cdef unsigned int mesh cdef double* field_data cdef rtcg.RTCFilterFunc filter_func - # triangles per element, vertices per element, and field points per + # triangles per element, vertices per element, and field points per # element, respectively: cdef int tpe, vpe, fpe cdef int[MAX_NUM_TRI][3] tri_array @@ -102,7 +105,7 @@ cdef MeshDataContainer datac def __init__(self, YTEmbreeScene scene, - np.ndarray vertices, + np.ndarray vertices, np.ndarray indices, np.ndarray data): @@ -120,7 +123,7 @@ self.tpe = TETRA_NT self.tri_array = triangulate_tetra else: - raise YTElementTypeNotRecognized(vertices.shape[1], + raise YTElementTypeNotRecognized(vertices.shape[1], indices.shape[1]) self._build_from_indices(scene, vertices, indices) @@ -143,7 +146,7 @@ for i in range(nv): vertices[i].x = vertices_in[i, 0] vertices[i].y = vertices_in[i, 1] - vertices[i].z = vertices_in[i, 2] + vertices[i].z = vertices_in[i, 2] rtcg.rtcSetBuffer(scene.scene_i, mesh, rtcg.RTC_VERTEX_BUFFER, vertices, 0, sizeof(Vertex)) @@ -157,7 +160,7 @@ rtcg.rtcSetBuffer(scene.scene_i, mesh, rtcg.RTC_INDEX_BUFFER, triangles, 0, sizeof(Triangle)) - cdef int* element_indices = malloc(ne * self.vpe * sizeof(int)) + cdef int* element_indices = malloc(ne * self.vpe * sizeof(int)) for i in range(ne): for j in range(self.vpe): element_indices[i*self.vpe + j] = indices_in[i][j] @@ -190,7 +193,7 @@ datac.vpe = self.vpe datac.fpe = self.fpe self.datac = datac - + rtcg.rtcSetUserData(scene.scene_i, self.mesh, &self.datac) cdef void _set_sampler_type(self, YTEmbreeScene scene): @@ -207,7 +210,7 @@ rtcg.rtcSetIntersectionFilterFunction(scene.scene_i, self.mesh, self.filter_func) - + def __dealloc__(self): free(self.field_data) free(self.element_indices) @@ -228,84 +231,137 @@ scene : EmbreeScene This is the scene to which the constructed patches will be added. - vertices : a np.ndarray of floats. - This specifies the x, y, and z coordinates of the vertices in - the mesh. This should either have the shape - (num_vertices, 3). For example, vertices[2][1] should give the + vertices : a np.ndarray of floats. + This specifies the x, y, and z coordinates of the vertices in + the mesh. This should either have the shape + (num_vertices, 3). For example, vertices[2][1] should give the y-coordinate of the 3rd vertex in the mesh. indices : a np.ndarray of ints This should have the shape (num_elements, 20). Each hex will be - represented in the scene by 6 bi-quadratic patches. We assume that - the node ordering is as defined here: + represented in the scene by 6 bi-quadratic patches. We assume that + the node ordering is as defined here: http://homepages.cae.wisc.edu/~tautges/papers/cnmev3.pdf - + ''' - cdef Patch* patches + cdef void* patches cdef np.float64_t* vertices cdef np.float64_t* field_data cdef unsigned int mesh - # patches per element, vertices per element, and field points per - # element, respectively: - cdef int ppe, vpe, fpe + # patches per element, vertices per element, vertices per face, + # and field points per element, respectively: + cdef int ppe, vpe, vpf, fpe def __init__(self, YTEmbreeScene scene, - np.ndarray vertices, + np.ndarray vertices, np.ndarray indices, np.ndarray field_data): + cdef int i, j - # only 20-point hexes are supported right now. + # 20-point hexes if indices.shape[1] == 20: self.vpe = 20 + self.ppe = 6 + self.vpf = 8 + self._build_from_indices_hex20(scene, vertices, indices, field_data) + # 10-point tets + elif indices.shape[1] == 10: + self.vpe = 10 + self.ppe = 4 + self.vpf = 6 + self._build_from_indices_tet10(scene, vertices, indices, field_data) else: raise NotImplementedError - self._build_from_indices(scene, vertices, indices, field_data) - - cdef void _build_from_indices(self, YTEmbreeScene scene, + cdef void _build_from_indices_hex20(self, YTEmbreeScene scene, np.ndarray vertices_in, np.ndarray indices_in, np.ndarray field_data): - cdef int i, j, ind, idim + cdef int i, j, k, ind, idim cdef int ne = indices_in.shape[0] cdef int nv = vertices_in.shape[0] - cdef int npatch = 6*ne; + cdef int npatch = self.ppe*ne; cdef unsigned int mesh = rtcgu.rtcNewUserGeometry(scene.scene_i, npatch) cdef np.ndarray[np.float64_t, ndim=2] element_vertices cdef Patch* patches = malloc(npatch * sizeof(Patch)) - self.vertices = malloc(20 * ne * 3 * sizeof(np.float64_t)) - self.field_data = malloc(20 * ne * sizeof(np.float64_t)) + self.vertices = malloc(self.vpe * ne * 3 * sizeof(np.float64_t)) + self.field_data = malloc(self.vpe * ne * sizeof(np.float64_t)) for i in range(ne): element_vertices = vertices_in[indices_in[i]] - for j in range(20): - self.field_data[i*20 + j] = field_data[i][j] + for j in range(self.vpe): + self.field_data[i*self.vpe + j] = field_data[i][j] for k in range(3): - self.vertices[i*20*3 + j*3 + k] = element_vertices[j][k] + self.vertices[i*self.vpe*3 + j*3 + k] = element_vertices[j][k] cdef Patch* patch for i in range(ne): # for each element element_vertices = vertices_in[indices_in[i]] - for j in range(6): # for each face - patch = &(patches[i*6+j]) + for j in range(self.ppe): # for each face + patch = &(patches[i*self.ppe+j]) patch.geomID = mesh - for k in range(8): # for each vertex + for k in range(self.vpf): # for each vertex ind = hex20_faces[j][k] for idim in range(3): # for each spatial dimension (yikes) patch.v[k][idim] = element_vertices[ind][idim] - patch.vertices = self.vertices + i*20*3 - patch.field_data = self.field_data + i*20 + patch.vertices = self.vertices + i*self.vpe*3 + patch.field_data = self.field_data + i*self.vpe self.patches = patches self.mesh = mesh - rtcg.rtcSetUserData(scene.scene_i, self.mesh, self.patches) + rtcg.rtcSetUserData(scene.scene_i, self.mesh, patches) rtcgu.rtcSetBoundsFunction(scene.scene_i, self.mesh, patchBoundsFunc) rtcgu.rtcSetIntersectFunction(scene.scene_i, self.mesh, patchIntersectFunc) + cdef void _build_from_indices_tet10(self, YTEmbreeScene scene, + np.ndarray vertices_in, + np.ndarray indices_in, + np.ndarray field_data): + cdef int i, j, k, ind, idim + cdef int ne = indices_in.shape[0] + cdef int nv = vertices_in.shape[0] + cdef int npatch = self.ppe*ne; + + cdef unsigned int mesh = rtcgu.rtcNewUserGeometry(scene.scene_i, npatch) + cdef np.ndarray[np.float64_t, ndim=2] element_vertices + cdef Tet_Patch* patches = malloc(npatch * sizeof(Tet_Patch)) + self.vertices = malloc(self.vpe * ne * 3 * sizeof(np.float64_t)) + self.field_data = malloc(self.vpe * ne * sizeof(np.float64_t)) + + for i in range(ne): + element_vertices = vertices_in[indices_in[i]] + for j in range(self.vpe): + self.field_data[i*self.vpe + j] = field_data[i][j] + for k in range(3): + self.vertices[i*self.vpe*3 + j*3 + k] = element_vertices[j][k] + + cdef Tet_Patch* patch + for i in range(ne): # for each element + element_vertices = vertices_in[indices_in[i]] + for j in range(self.ppe): # for each face + patch = &(patches[i*self.ppe+j]) + patch.geomID = mesh + for k in range(self.vpf): # for each vertex + ind = tet10_faces[j][k] + for idim in range(3): # for each spatial dimension (yikes) + patch.v[k][idim] = element_vertices[ind][idim] + patch.vertices = self.vertices + i*self.vpe*3 + patch.field_data = self.field_data + i*self.vpe + + self.patches = patches + self.mesh = mesh + + rtcg.rtcSetUserData(scene.scene_i, self.mesh, patches) + rtcgu.rtcSetBoundsFunction(scene.scene_i, self.mesh, + tet_patchBoundsFunc) + rtcgu.rtcSetIntersectFunction(scene.scene_i, self.mesh, + tet_patchIntersectFunc) + + def __dealloc__(self): free(self.patches) free(self.vertices) diff -Nru yt-3.3.3/yt/utilities/lib/mesh_intersection.pxd yt-3.4.0/yt/utilities/lib/mesh_intersection.pxd --- yt-3.3.3/yt/utilities/lib/mesh_intersection.pxd 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/mesh_intersection.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -1,7 +1,7 @@ cimport pyembree.rtcore as rtc cimport pyembree.rtcore_ray as rtcr cimport pyembree.rtcore_geometry as rtcg -from yt.utilities.lib.mesh_construction cimport Patch +from yt.utilities.lib.mesh_construction cimport Patch, Tet_Patch cimport cython cdef void patchIntersectFunc(Patch* patches, @@ -11,3 +11,11 @@ cdef void patchBoundsFunc(Patch* patches, size_t item, rtcg.RTCBounds* bounds_o) nogil + +cdef void tet_patchIntersectFunc(Tet_Patch* tet_patches, + rtcr.RTCRay& ray, + size_t item) nogil + +cdef void tet_patchBoundsFunc(Tet_Patch* tet_patches, + size_t item, + rtcg.RTCBounds* bounds_o) nogil diff -Nru yt-3.3.3/yt/utilities/lib/mesh_intersection.pyx yt-3.4.0/yt/utilities/lib/mesh_intersection.pyx --- yt-3.3.3/yt/utilities/lib/mesh_intersection.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/mesh_intersection.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -21,26 +21,30 @@ cimport numpy as np cimport cython from libc.math cimport fabs, fmin, fmax, sqrt -from yt.utilities.lib.mesh_samplers cimport sample_hex20 +from yt.utilities.lib.mesh_samplers cimport sample_hex20, sample_tet10 from yt.utilities.lib.bounding_volume_hierarchy cimport BBox from yt.utilities.lib.primitives cimport \ patchSurfaceFunc, \ patchSurfaceDerivU, \ patchSurfaceDerivV, \ RayHitData, \ - compute_patch_hit + compute_patch_hit, \ + tet_patchSurfaceFunc, \ + tet_patchSurfaceDerivU, \ + tet_patchSurfaceDerivV, \ + compute_tet_patch_hit from vec3_ops cimport dot, subtract, cross, distance @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) -cdef void patchBoundsFunc(Patch* patches, +cdef void patchBoundsFunc(Patch* patches, size_t item, rtcg.RTCBounds* bounds_o) nogil: cdef Patch patch = patches[item] - + cdef float lo_x = 1.0e300 cdef float lo_y = 1.0e300 cdef float lo_z = 1.0e300 @@ -89,8 +93,71 @@ ray.geomID = patch.geomID ray.primID = item ray.Ng[0] = hd.t - + # sample the solution at the calculated point sample_hex20(patches, ray) return + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void tet_patchBoundsFunc(Tet_Patch* tet_patches, + size_t item, + rtcg.RTCBounds* bounds_o) nogil: + + cdef Tet_Patch tet_patch = tet_patches[item] + + cdef float lo_x = 1.0e300 + cdef float lo_y = 1.0e300 + cdef float lo_z = 1.0e300 + + cdef float hi_x = -1.0e300 + cdef float hi_y = -1.0e300 + cdef float hi_z = -1.0e300 + + cdef int i + for i in range(6): + lo_x = fmin(lo_x, tet_patch.v[i][0]) + lo_y = fmin(lo_y, tet_patch.v[i][1]) + lo_z = fmin(lo_z, tet_patch.v[i][2]) + hi_x = fmax(hi_x, tet_patch.v[i][0]) + hi_y = fmax(hi_y, tet_patch.v[i][1]) + hi_z = fmax(hi_z, tet_patch.v[i][2]) + + bounds_o.lower_x = lo_x + bounds_o.lower_y = lo_y + bounds_o.lower_z = lo_z + bounds_o.upper_x = hi_x + bounds_o.upper_y = hi_y + bounds_o.upper_z = hi_z + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void tet_patchIntersectFunc(Tet_Patch* tet_patches, + rtcr.RTCRay& ray, + size_t item) nogil: + + cdef Tet_Patch tet_patch = tet_patches[item] + + cdef RayHitData hd = compute_tet_patch_hit(tet_patch.v, ray.org, ray.dir) + + # only count this is it's the closest hit + if (hd.t < ray.tnear or hd.t > ray.Ng[0]): + return + + if (hd.converged and 0 <= hd.u and 0 <= hd.v and hd.u + hd.v <= 1): + + # we have a hit, so update ray information + ray.u = hd.u + ray.v = hd.v + ray.geomID = tet_patch.geomID + ray.primID = item + ray.Ng[0] = hd.t + + # sample the solution at the calculated point + sample_tet10(tet_patches, ray) + + return diff -Nru yt-3.3.3/yt/utilities/lib/mesh_samplers.pxd yt-3.4.0/yt/utilities/lib/mesh_samplers.pxd --- yt-3.3.3/yt/utilities/lib/mesh_samplers.pxd 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/mesh_samplers.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -13,3 +13,6 @@ cdef void sample_hex20(void* userPtr, rtcr.RTCRay& ray) nogil + +cdef void sample_tet10(void* userPtr, + rtcr.RTCRay& ray) nogil diff -Nru yt-3.3.3/yt/utilities/lib/mesh_samplers.pyx yt-3.4.0/yt/utilities/lib/mesh_samplers.pyx --- yt-3.3.3/yt/utilities/lib/mesh_samplers.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/mesh_samplers.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -19,14 +19,16 @@ from pyembree.rtcore cimport Vec3f, Triangle, Vertex from yt.utilities.lib.mesh_construction cimport \ MeshDataContainer, \ - Patch -from yt.utilities.lib.primitives cimport patchSurfaceFunc + Patch, \ + Tet_Patch +from yt.utilities.lib.primitives cimport patchSurfaceFunc, tet_patchSurfaceFunc from yt.utilities.lib.element_mappings cimport \ ElementSampler, \ P1Sampler3D, \ Q1Sampler3D, \ S2Sampler3D, \ - W1Sampler3D + W1Sampler3D, \ + Tet2Sampler3D cimport numpy as np cimport cython from libc.math cimport fabs, fmax @@ -35,6 +37,7 @@ cdef ElementSampler P1Sampler = P1Sampler3D() cdef ElementSampler S2Sampler = S2Sampler3D() cdef ElementSampler W1Sampler = W1Sampler3D() +cdef ElementSampler Tet2Sampler = Tet2Sampler3D() @cython.boundscheck(False) @@ -95,7 +98,7 @@ elem_id = ray_id / data.tpe get_hit_position(position, userPtr, ray) - + for i in range(8): element_indices[i] = data.element_indices[elem_id*8+i] @@ -105,7 +108,7 @@ for i in range(8): vertices[i*3] = data.vertices[element_indices[i]].x vertices[i*3 + 1] = data.vertices[element_indices[i]].y - vertices[i*3 + 2] = data.vertices[element_indices[i]].z + vertices[i*3 + 2] = data.vertices[element_indices[i]].z # we use ray.time to pass the value of the field cdef double mapped_coord[3] @@ -146,7 +149,7 @@ elem_id = ray_id / data.tpe get_hit_position(position, userPtr, ray) - + for i in range(6): element_indices[i] = data.element_indices[elem_id*6+i] @@ -156,7 +159,7 @@ for i in range(6): vertices[i*3] = data.vertices[element_indices[i]].x vertices[i*3 + 1] = data.vertices[element_indices[i]].y - vertices[i*3 + 2] = data.vertices[element_indices[i]].z + vertices[i*3 + 2] = data.vertices[element_indices[i]].z # we use ray.time to pass the value of the field cdef double mapped_coord[3] @@ -196,14 +199,14 @@ patchSurfaceFunc(data[ray_id].v, ray.u, ray.v, pos) for i in range(3): position[i] = pos[i] - + # we use ray.time to pass the value of the field cdef double mapped_coord[3] S2Sampler.map_real_to_unit(mapped_coord, patch.vertices, position) val = S2Sampler.sample_at_unit_point(mapped_coord, patch.field_data) ray.time = val ray.instID = S2Sampler.check_mesh_lines(mapped_coord) - + @cython.boundscheck(False) @cython.wraparound(False) @@ -229,14 +232,14 @@ # ray_id records the id number of the hit according to # embree, in which the primitives are triangles. Here, # we convert this to the element id by dividing by the - # number of triangles per element. + # number of triangles per element. elem_id = ray_id / data.tpe for i in range(4): element_indices[i] = data.element_indices[elem_id*4+i] vertices[i*3] = data.vertices[element_indices[i]].x vertices[i*3 + 1] = data.vertices[element_indices[i]].y - vertices[i*3 + 2] = data.vertices[element_indices[i]].z + vertices[i*3 + 2] = data.vertices[element_indices[i]].z for i in range(data.fpe): field_data[i] = data.field_data[elem_id*data.fpe+i] @@ -250,3 +253,39 @@ val = P1Sampler.sample_at_unit_point(mapped_coord, field_data) ray.time = val ray.instID = P1Sampler.check_mesh_lines(mapped_coord) + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.initializedcheck(False) +@cython.cdivision(True) +cdef void sample_tet10(void* userPtr, + rtcr.RTCRay& ray) nogil: + cdef int ray_id, elem_id, i + cdef double val + cdef double[3] position + cdef float[3] pos + cdef Tet_Patch* data + + data = userPtr + ray_id = ray.primID + if ray_id == -1: + return + cdef Tet_Patch tet_patch = data[ray_id] + + # ray_id records the id number of the hit according to + # embree, in which the primitives are patches. Here, + # we convert this to the element id by dividing by the + # number of patches per element. + elem_id = ray_id / 4 + + # fills "position" with the physical position of the hit + tet_patchSurfaceFunc(data[ray_id].v, ray.u, ray.v, pos) + for i in range(3): + position[i] = pos[i] + + # we use ray.time to pass the value of the field + cdef double mapped_coord[3] + Tet2Sampler.map_real_to_unit(mapped_coord, tet_patch.vertices, position) + val = Tet2Sampler.sample_at_unit_point(mapped_coord, tet_patch.field_data) + ray.time = val + ray.instID = Tet2Sampler.check_mesh_lines(mapped_coord) diff -Nru yt-3.3.3/yt/utilities/lib/mesh_traversal.pyx yt-3.4.0/yt/utilities/lib/mesh_traversal.pyx --- yt-3.3.3/yt/utilities/lib/mesh_traversal.pyx 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/mesh_traversal.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -23,8 +23,6 @@ cimport pyembree.rtcore_scene as rtcs from .image_samplers cimport \ ImageSampler -from .lenses cimport \ - ImageContainer from cython.parallel import prange, parallel, threadid from yt.visualization.image_writer import apply_colormap from yt.utilities.lib.bounding_volume_hierarchy cimport BVH, Ray @@ -63,15 +61,14 @@ rtcs.rtcCommit(scene.scene_i) cdef int vi, vj, i, j - cdef ImageContainer *im = self.image cdef np.float64_t *v_pos cdef np.float64_t *v_dir cdef np.int64_t nx, ny, size cdef np.float64_t width[3] for i in range(3): width[i] = self.width[i] - nx = im.nv[0] - ny = im.nv[1] + nx = self.nv[0] + ny = self.nv[1] size = nx * ny cdef rtcr.RTCRay ray v_pos = malloc(3 * sizeof(np.float64_t)) @@ -80,7 +77,7 @@ vj = j % ny vi = (j - vj) / ny vj = vj - self.vector_function(im, vi, vj, width, v_dir, v_pos) + self.vector_function(self, vi, vj, width, v_dir, v_pos) for i in range(3): ray.org[i] = v_pos[i] ray.dir[i] = v_dir[i] @@ -93,9 +90,9 @@ ray.time = 0 ray.Ng[0] = 1e37 # we use this to track the hit distance rtcs.rtcIntersect(scene.scene_i, ray) - im.image[vi, vj, 0] = ray.time - im.image_used[vi, vj] = ray.primID - im.mesh_lines[vi, vj] = ray.instID - im.zbuffer[vi, vj] = ray.tfar + self.image[vi, vj, 0] = ray.time + self.image_used[vi, vj] = ray.primID + self.mesh_lines[vi, vj] = ray.instID + self.zbuffer[vi, vj] = ray.tfar free(v_pos) free(v_dir) diff -Nru yt-3.3.3/yt/utilities/lib/mesh_triangulation.c yt-3.4.0/yt/utilities/lib/mesh_triangulation.c --- yt-3.3.3/yt/utilities/lib/mesh_triangulation.c 2016-12-12 01:41:54.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/mesh_triangulation.c 2017-08-10 18:20:47.000000000 +0000 @@ -1,10 +1,17 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "yt/utilities/lib/mesh_triangulation.h" + ], + "include_dirs": [ + "yt/utilities/lib" + ], + "name": "yt.utilities.lib.mesh_triangulation", + "sources": [ + "yt/utilities/lib/mesh_triangulation.pyx" ] }, "module_name": "yt.utilities.lib.mesh_triangulation" @@ -18,7 +25,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -40,6 +47,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -192,16 +200,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -328,6 +340,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -382,6 +400,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -492,8 +539,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -506,8 +553,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -629,10 +679,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -666,8 +718,8 @@ static const char *__pyx_f[] = { "yt/utilities/lib/mesh_triangulation.pyx", - "__init__.pxd", "stringsource", + "__init__.pxd", "type.pxd", }; /* MemviewSliceStruct.proto */ @@ -1024,8 +1076,8 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; struct __pyx_t_2yt_9utilities_3lib_18mesh_triangulation_TriNode; -/* "yt/utilities/lib/mesh_triangulation.pyx":37 - * int hex20_faces[6][8] +/* "yt/utilities/lib/mesh_triangulation.pyx":38 + * int tet10_faces[4][6] * * cdef struct TriNode: # <<<<<<<<<<<<<< * np.uint64_t key @@ -1038,7 +1090,7 @@ struct __pyx_t_2yt_9utilities_3lib_18mesh_triangulation_TriNode *next_node; }; -/* "yt/utilities/lib/mesh_triangulation.pyx":64 +/* "yt/utilities/lib/mesh_triangulation.pyx":65 * cdef np.int64_t TABLE_SIZE = 2**24 * * cdef class TriSet: # <<<<<<<<<<<<<< @@ -1053,7 +1105,7 @@ }; -/* "yt/utilities/lib/mesh_triangulation.pyx":176 +/* "yt/utilities/lib/mesh_triangulation.pyx":177 * * * cdef class MeshInfoHolder: # <<<<<<<<<<<<<< @@ -1149,7 +1201,7 @@ -/* "yt/utilities/lib/mesh_triangulation.pyx":64 +/* "yt/utilities/lib/mesh_triangulation.pyx":65 * cdef np.int64_t TABLE_SIZE = 2**24 * * cdef class TriSet: # <<<<<<<<<<<<<< @@ -1318,7 +1370,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* MemviewSliceInit.proto */ #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d @@ -1346,6 +1398,33 @@ 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 = PyThreadState_GET(); +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); @@ -1375,33 +1454,6 @@ #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); @@ -1512,12 +1564,29 @@ /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); +/* 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) @@ -1615,6 +1684,13 @@ #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() + /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); @@ -1623,11 +1699,20 @@ 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 *); + /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); /* CodeObjectCache.proto */ typedef struct { @@ -1702,6 +1787,9 @@ PyObject *original_obj); /* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int_t(PyObject *); + +/* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(PyObject *); /* ObjectToMemviewSlice.proto */ @@ -1732,6 +1820,13 @@ static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp); static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_long(npy_long value); + +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int_t(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int_t(const char *itemp, PyObject *obj); + /* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -1853,6 +1948,9 @@ static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); /* CIntFromPy.proto */ +static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *); + +/* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ @@ -1986,6 +2084,8 @@ 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_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 }; @@ -1995,13 +2095,13 @@ /* Implementation of 'yt.utilities.lib.mesh_triangulation' */ static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_Ellipsis; -static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_O[] = "O"; @@ -2013,10 +2113,13 @@ static const char __pyx_k_s[] = "s"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_np[] = "np"; +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_tri[] = "tri"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_data[] = "data"; +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"; @@ -2046,8 +2149,11 @@ 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_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_float32[] = "float32"; static const char __pyx_k_fortran[] = "fortran"; static const char __pyx_k_indices[] = "indices"; @@ -2055,10 +2161,12 @@ static const char __pyx_k_num_tri[] = "num_tri"; static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_tri_data[] = "tri_data"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_num_verts[] = "num_verts"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_num_coords[] = "num_coords"; @@ -2067,17 +2175,25 @@ static const char __pyx_k_vert_index[] = "vert_index"; 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_element_map[] = "element_map"; static const char __pyx_k_tri_indices[] = "tri_indices"; static const char __pyx_k_vertex_data[] = "vertex_data"; 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_exterior_tris[] = "exterior_tris"; 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_get_vertex_data[] = "get_vertex_data"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_triangulate_mesh[] = "triangulate_mesh"; static const char __pyx_k_get_exterior_tris[] = "get_exterior_tris"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_triangulate_indices[] = "triangulate_indices"; static const char __pyx_k_strided_and_indirect[] = ""; @@ -2093,7 +2209,6 @@ 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_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/mesh_triangulation.pyx"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_This_file_contains_code_for_tri[] = "\n\nThis file contains code for triangulating unstructured meshes. That is, for\nevery element in the mesh, it breaks up the element into some number of\ntriangles, returning a triangle mesh instead.\n\nIt also contains code for removing duplicate triangles from the resulting\nmesh using a hash-table approach, so that we don't waste time rendering\nimpossible-to-see triangles.\n\nThis code is currently used by the OpenGL-accelerated unstructured mesh\nrenderer, as well as when annotating mesh lines on regular slices.\n\n"; static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; @@ -2102,6 +2217,7 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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"; @@ -2109,10 +2225,12 @@ 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_yt_utilities_lib_mesh_triangulat[] = "yt.utilities.lib.mesh_triangulation"; +static const char __pyx_k_yt_utilities_lib_mesh_triangulat[] = "yt/utilities/lib/mesh_triangulation.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_utilities_lib_mesh_triangulat_2[] = "yt.utilities.lib.mesh_triangulation"; 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; @@ -2122,6 +2240,7 @@ 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; @@ -2132,11 +2251,12 @@ 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_n_s_RuntimeError; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_n_s_YTElementTypeNotRecognized; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_array; @@ -2145,11 +2265,13 @@ 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_n_s_cull_interior_triangles; static PyObject *__pyx_n_s_data; +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_element_map; @@ -2170,6 +2292,7 @@ static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_indices; +static PyObject *__pyx_n_s_int; static PyObject *__pyx_n_s_int32; static PyObject *__pyx_n_s_int64; static PyObject *__pyx_n_s_itemsize; @@ -2185,6 +2308,8 @@ 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_num_coords; static PyObject *__pyx_n_s_num_tri; @@ -2194,10 +2319,18 @@ static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; static PyObject *__pyx_n_s_obj; static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_cython; +static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_s; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_start; @@ -2206,6 +2339,7 @@ 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_tri; @@ -2218,15 +2352,21 @@ 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 PyObject *__pyx_n_s_vert_index; static PyObject *__pyx_n_s_vertex_data; static PyObject *__pyx_n_s_yt_utilities_exceptions; -static PyObject *__pyx_n_s_yt_utilities_lib_mesh_triangulat; +static PyObject *__pyx_kp_s_yt_utilities_lib_mesh_triangulat; +static PyObject *__pyx_n_s_yt_utilities_lib_mesh_triangulat_2; static PyObject *__pyx_n_s_zeros; static int __pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_6TriSet___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *__pyx_v_self); /* proto */ static void __pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_2__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_4get_exterior_tris(struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder *__pyx_v_self, __Pyx_memviewslice __pyx_v_indices); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_cull_interior_triangles(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_indices); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_2get_vertex_data(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_indices); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_4triangulate_mesh(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_coords, PyArrayObject *__pyx_v_data, __Pyx_memviewslice __pyx_v_indices); /* proto */ @@ -2240,8 +2380,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -2263,8 +2407,13 @@ 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_2yt_9utilities_3lib_18mesh_triangulation_TriSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -2274,6 +2423,7 @@ 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; @@ -2284,9 +2434,9 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__20; -static PyObject *__pyx_slice__21; -static PyObject *__pyx_slice__22; +static PyObject *__pyx_slice__28; +static PyObject *__pyx_slice__29; +static PyObject *__pyx_slice__30; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -2297,22 +2447,34 @@ 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__28; -static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; -static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; -static PyObject *__pyx_codeobj__25; -static PyObject *__pyx_codeobj__27; -static PyObject *__pyx_codeobj__29; -static PyObject *__pyx_codeobj__31; +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__35; +static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__48; -/* "yt/utilities/lib/mesh_triangulation.pyx":43 +/* "yt/utilities/lib/mesh_triangulation.pyx":44 * TriNode* next_node * * cdef np.int64_t triangles_are_equal(np.int64_t tri1[3], np.int64_t tri2[3]) nogil: # <<<<<<<<<<<<<< @@ -2329,7 +2491,7 @@ long __pyx_t_2; int __pyx_t_3; - /* "yt/utilities/lib/mesh_triangulation.pyx":45 + /* "yt/utilities/lib/mesh_triangulation.pyx":46 * cdef np.int64_t triangles_are_equal(np.int64_t tri1[3], np.int64_t tri2[3]) nogil: * cdef np.int64_t found * for i in range(3): # <<<<<<<<<<<<<< @@ -2339,7 +2501,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/mesh_triangulation.pyx":46 + /* "yt/utilities/lib/mesh_triangulation.pyx":47 * cdef np.int64_t found * for i in range(3): * found = False # <<<<<<<<<<<<<< @@ -2348,7 +2510,7 @@ */ __pyx_v_found = 0; - /* "yt/utilities/lib/mesh_triangulation.pyx":47 + /* "yt/utilities/lib/mesh_triangulation.pyx":48 * for i in range(3): * found = False * for j in range(3): # <<<<<<<<<<<<<< @@ -2358,7 +2520,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_j = __pyx_t_2; - /* "yt/utilities/lib/mesh_triangulation.pyx":48 + /* "yt/utilities/lib/mesh_triangulation.pyx":49 * found = False * for j in range(3): * if tri1[i] == tri2[j]: # <<<<<<<<<<<<<< @@ -2368,7 +2530,7 @@ __pyx_t_3 = (((__pyx_v_tri1[__pyx_v_i]) == (__pyx_v_tri2[__pyx_v_j])) != 0); if (__pyx_t_3) { - /* "yt/utilities/lib/mesh_triangulation.pyx":49 + /* "yt/utilities/lib/mesh_triangulation.pyx":50 * for j in range(3): * if tri1[i] == tri2[j]: * found = True # <<<<<<<<<<<<<< @@ -2377,7 +2539,7 @@ */ __pyx_v_found = 1; - /* "yt/utilities/lib/mesh_triangulation.pyx":48 + /* "yt/utilities/lib/mesh_triangulation.pyx":49 * found = False * for j in range(3): * if tri1[i] == tri2[j]: # <<<<<<<<<<<<<< @@ -2387,7 +2549,7 @@ } } - /* "yt/utilities/lib/mesh_triangulation.pyx":50 + /* "yt/utilities/lib/mesh_triangulation.pyx":51 * if tri1[i] == tri2[j]: * found = True * if not found: # <<<<<<<<<<<<<< @@ -2397,7 +2559,7 @@ __pyx_t_3 = ((!(__pyx_v_found != 0)) != 0); if (__pyx_t_3) { - /* "yt/utilities/lib/mesh_triangulation.pyx":51 + /* "yt/utilities/lib/mesh_triangulation.pyx":52 * found = True * if not found: * return 0 # <<<<<<<<<<<<<< @@ -2407,7 +2569,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":50 + /* "yt/utilities/lib/mesh_triangulation.pyx":51 * if tri1[i] == tri2[j]: * found = True * if not found: # <<<<<<<<<<<<<< @@ -2417,7 +2579,7 @@ } } - /* "yt/utilities/lib/mesh_triangulation.pyx":52 + /* "yt/utilities/lib/mesh_triangulation.pyx":53 * if not found: * return 0 * return 1 # <<<<<<<<<<<<<< @@ -2427,7 +2589,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":43 + /* "yt/utilities/lib/mesh_triangulation.pyx":44 * TriNode* next_node * * cdef np.int64_t triangles_are_equal(np.int64_t tri1[3], np.int64_t tri2[3]) nogil: # <<<<<<<<<<<<<< @@ -2440,7 +2602,7 @@ return __pyx_r; } -/* "yt/utilities/lib/mesh_triangulation.pyx":54 +/* "yt/utilities/lib/mesh_triangulation.pyx":55 * return 1 * * cdef np.uint64_t triangle_hash(np.int64_t tri[3]) nogil: # <<<<<<<<<<<<<< @@ -2454,7 +2616,7 @@ __pyx_t_5numpy_uint64_t __pyx_r; long __pyx_t_1; - /* "yt/utilities/lib/mesh_triangulation.pyx":56 + /* "yt/utilities/lib/mesh_triangulation.pyx":57 * cdef np.uint64_t triangle_hash(np.int64_t tri[3]) nogil: * # http://stackoverflow.com/questions/1536393/good-hash-function-for-permutations * cdef np.uint64_t h = 1 # <<<<<<<<<<<<<< @@ -2463,7 +2625,7 @@ */ __pyx_v_h = 1; - /* "yt/utilities/lib/mesh_triangulation.pyx":57 + /* "yt/utilities/lib/mesh_triangulation.pyx":58 * # http://stackoverflow.com/questions/1536393/good-hash-function-for-permutations * cdef np.uint64_t h = 1 * for i in range(3): # <<<<<<<<<<<<<< @@ -2473,7 +2635,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/mesh_triangulation.pyx":58 + /* "yt/utilities/lib/mesh_triangulation.pyx":59 * cdef np.uint64_t h = 1 * for i in range(3): * h *= (1779033703 + 2*tri[i]) # <<<<<<<<<<<<<< @@ -2483,7 +2645,7 @@ __pyx_v_h = (__pyx_v_h * (0x6A09E667 + (2 * (__pyx_v_tri[__pyx_v_i])))); } - /* "yt/utilities/lib/mesh_triangulation.pyx":59 + /* "yt/utilities/lib/mesh_triangulation.pyx":60 * for i in range(3): * h *= (1779033703 + 2*tri[i]) * return h / 2 # <<<<<<<<<<<<<< @@ -2493,7 +2655,7 @@ __pyx_r = (__pyx_v_h / 2); goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":54 + /* "yt/utilities/lib/mesh_triangulation.pyx":55 * return 1 * * cdef np.uint64_t triangle_hash(np.int64_t tri[3]) nogil: # <<<<<<<<<<<<<< @@ -2506,7 +2668,7 @@ return __pyx_r; } -/* "yt/utilities/lib/mesh_triangulation.pyx":77 +/* "yt/utilities/lib/mesh_triangulation.pyx":78 * cdef np.uint64_t num_items * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -2538,7 +2700,7 @@ __pyx_t_5numpy_int64_t __pyx_t_2; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "yt/utilities/lib/mesh_triangulation.pyx":78 + /* "yt/utilities/lib/mesh_triangulation.pyx":79 * * def __cinit__(self): * self.table = malloc(TABLE_SIZE * sizeof(TriNode*)) # <<<<<<<<<<<<<< @@ -2547,7 +2709,7 @@ */ __pyx_v_self->table = ((struct __pyx_t_2yt_9utilities_3lib_18mesh_triangulation_TriNode **)malloc((__pyx_v_2yt_9utilities_3lib_18mesh_triangulation_TABLE_SIZE * (sizeof(struct __pyx_t_2yt_9utilities_3lib_18mesh_triangulation_TriNode *))))); - /* "yt/utilities/lib/mesh_triangulation.pyx":79 + /* "yt/utilities/lib/mesh_triangulation.pyx":80 * def __cinit__(self): * self.table = malloc(TABLE_SIZE * sizeof(TriNode*)) * for i in range(TABLE_SIZE): # <<<<<<<<<<<<<< @@ -2558,7 +2720,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/mesh_triangulation.pyx":80 + /* "yt/utilities/lib/mesh_triangulation.pyx":81 * self.table = malloc(TABLE_SIZE * sizeof(TriNode*)) * for i in range(TABLE_SIZE): * self.table[i] = NULL # <<<<<<<<<<<<<< @@ -2568,7 +2730,7 @@ (__pyx_v_self->table[__pyx_v_i]) = NULL; } - /* "yt/utilities/lib/mesh_triangulation.pyx":81 + /* "yt/utilities/lib/mesh_triangulation.pyx":82 * for i in range(TABLE_SIZE): * self.table[i] = NULL * self.num_items = 0 # <<<<<<<<<<<<<< @@ -2577,7 +2739,7 @@ */ __pyx_v_self->num_items = 0; - /* "yt/utilities/lib/mesh_triangulation.pyx":77 + /* "yt/utilities/lib/mesh_triangulation.pyx":78 * cdef np.uint64_t num_items * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -2591,7 +2753,7 @@ return __pyx_r; } -/* "yt/utilities/lib/mesh_triangulation.pyx":83 +/* "yt/utilities/lib/mesh_triangulation.pyx":84 * self.num_items = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2621,7 +2783,7 @@ struct __pyx_t_2yt_9utilities_3lib_18mesh_triangulation_TriNode *__pyx_t_4; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "yt/utilities/lib/mesh_triangulation.pyx":87 + /* "yt/utilities/lib/mesh_triangulation.pyx":88 * cdef TriNode *node * cdef TriNode *delete_node * for i in range(TABLE_SIZE): # <<<<<<<<<<<<<< @@ -2632,7 +2794,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/mesh_triangulation.pyx":88 + /* "yt/utilities/lib/mesh_triangulation.pyx":89 * cdef TriNode *delete_node * for i in range(TABLE_SIZE): * node = self.table[i] # <<<<<<<<<<<<<< @@ -2641,7 +2803,7 @@ */ __pyx_v_node = (__pyx_v_self->table[__pyx_v_i]); - /* "yt/utilities/lib/mesh_triangulation.pyx":89 + /* "yt/utilities/lib/mesh_triangulation.pyx":90 * for i in range(TABLE_SIZE): * node = self.table[i] * while (node != NULL): # <<<<<<<<<<<<<< @@ -2652,7 +2814,7 @@ __pyx_t_3 = ((__pyx_v_node != NULL) != 0); if (!__pyx_t_3) break; - /* "yt/utilities/lib/mesh_triangulation.pyx":90 + /* "yt/utilities/lib/mesh_triangulation.pyx":91 * node = self.table[i] * while (node != NULL): * delete_node = node # <<<<<<<<<<<<<< @@ -2661,7 +2823,7 @@ */ __pyx_v_delete_node = __pyx_v_node; - /* "yt/utilities/lib/mesh_triangulation.pyx":91 + /* "yt/utilities/lib/mesh_triangulation.pyx":92 * while (node != NULL): * delete_node = node * node = node.next_node # <<<<<<<<<<<<<< @@ -2671,7 +2833,7 @@ __pyx_t_4 = __pyx_v_node->next_node; __pyx_v_node = __pyx_t_4; - /* "yt/utilities/lib/mesh_triangulation.pyx":92 + /* "yt/utilities/lib/mesh_triangulation.pyx":93 * delete_node = node * node = node.next_node * free(delete_node) # <<<<<<<<<<<<<< @@ -2681,7 +2843,7 @@ free(__pyx_v_delete_node); } - /* "yt/utilities/lib/mesh_triangulation.pyx":93 + /* "yt/utilities/lib/mesh_triangulation.pyx":94 * node = node.next_node * free(delete_node) * self.table[i] = NULL # <<<<<<<<<<<<<< @@ -2691,7 +2853,7 @@ (__pyx_v_self->table[__pyx_v_i]) = NULL; } - /* "yt/utilities/lib/mesh_triangulation.pyx":94 + /* "yt/utilities/lib/mesh_triangulation.pyx":95 * free(delete_node) * self.table[i] = NULL * free(self.table) # <<<<<<<<<<<<<< @@ -2700,7 +2862,7 @@ */ free(__pyx_v_self->table); - /* "yt/utilities/lib/mesh_triangulation.pyx":83 + /* "yt/utilities/lib/mesh_triangulation.pyx":84 * self.num_items = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2712,7 +2874,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/mesh_triangulation.pyx":98 +/* "yt/utilities/lib/mesh_triangulation.pyx":99 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_exterior_tris(self): # <<<<<<<<<<<<<< @@ -2759,21 +2921,21 @@ struct __pyx_t_2yt_9utilities_3lib_18mesh_triangulation_TriNode *__pyx_t_14; __Pyx_RefNannySetupContext("get_exterior_tris", 0); - /* "yt/utilities/lib/mesh_triangulation.pyx":106 + /* "yt/utilities/lib/mesh_triangulation.pyx":107 * ''' * * cdef np.int64_t[:, ::1] tri_indices = np.empty((self.num_items, 3), dtype="int64") # <<<<<<<<<<<<<< * cdef np.int64_t[::1] element_map = np.empty(self.num_items, dtype="int64") * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __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, 106, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -2781,61 +2943,61 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 106, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_4); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 106, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_tri_indices = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/utilities/lib/mesh_triangulation.pyx":107 + /* "yt/utilities/lib/mesh_triangulation.pyx":108 * * cdef np.int64_t[:, ::1] tri_indices = np.empty((self.num_items, 3), dtype="int64") * cdef np.int64_t[::1] element_map = np.empty(self.num_items, dtype="int64") # <<<<<<<<<<<<<< * * cdef TriNode* node */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->num_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_npy_uint64(__pyx_v_self->num_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 107, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_2); - if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 107, __pyx_L1_error) + if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_element_map = __pyx_t_6; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL; - /* "yt/utilities/lib/mesh_triangulation.pyx":110 + /* "yt/utilities/lib/mesh_triangulation.pyx":111 * * cdef TriNode* node * cdef np.int64_t counter = 0 # <<<<<<<<<<<<<< @@ -2844,7 +3006,7 @@ */ __pyx_v_counter = 0; - /* "yt/utilities/lib/mesh_triangulation.pyx":112 + /* "yt/utilities/lib/mesh_triangulation.pyx":113 * cdef np.int64_t counter = 0 * cdef np.int64_t i, j * for i in range(TABLE_SIZE): # <<<<<<<<<<<<<< @@ -2855,7 +3017,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "yt/utilities/lib/mesh_triangulation.pyx":113 + /* "yt/utilities/lib/mesh_triangulation.pyx":114 * cdef np.int64_t i, j * for i in range(TABLE_SIZE): * node = self.table[i] # <<<<<<<<<<<<<< @@ -2864,7 +3026,7 @@ */ __pyx_v_node = (__pyx_v_self->table[__pyx_v_i]); - /* "yt/utilities/lib/mesh_triangulation.pyx":114 + /* "yt/utilities/lib/mesh_triangulation.pyx":115 * for i in range(TABLE_SIZE): * node = self.table[i] * while node != NULL: # <<<<<<<<<<<<<< @@ -2875,7 +3037,7 @@ __pyx_t_9 = ((__pyx_v_node != NULL) != 0); if (!__pyx_t_9) break; - /* "yt/utilities/lib/mesh_triangulation.pyx":115 + /* "yt/utilities/lib/mesh_triangulation.pyx":116 * node = self.table[i] * while node != NULL: * for j in range(3): # <<<<<<<<<<<<<< @@ -2885,7 +3047,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { __pyx_v_j = __pyx_t_10; - /* "yt/utilities/lib/mesh_triangulation.pyx":116 + /* "yt/utilities/lib/mesh_triangulation.pyx":117 * while node != NULL: * for j in range(3): * tri_indices[counter, j] = node.tri[j] # <<<<<<<<<<<<<< @@ -2897,7 +3059,7 @@ *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_tri_indices.data + __pyx_t_11 * __pyx_v_tri_indices.strides[0]) )) + __pyx_t_12)) )) = (__pyx_v_node->tri[__pyx_v_j]); } - /* "yt/utilities/lib/mesh_triangulation.pyx":117 + /* "yt/utilities/lib/mesh_triangulation.pyx":118 * for j in range(3): * tri_indices[counter, j] = node.tri[j] * element_map[counter] = node.elem # <<<<<<<<<<<<<< @@ -2908,7 +3070,7 @@ __pyx_t_13 = __pyx_v_counter; *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int64_t *) __pyx_v_element_map.data) + __pyx_t_13)) )) = __pyx_t_10; - /* "yt/utilities/lib/mesh_triangulation.pyx":118 + /* "yt/utilities/lib/mesh_triangulation.pyx":119 * tri_indices[counter, j] = node.tri[j] * element_map[counter] = node.elem * counter += 1 # <<<<<<<<<<<<<< @@ -2917,7 +3079,7 @@ */ __pyx_v_counter = (__pyx_v_counter + 1); - /* "yt/utilities/lib/mesh_triangulation.pyx":119 + /* "yt/utilities/lib/mesh_triangulation.pyx":120 * element_map[counter] = node.elem * counter += 1 * node = node.next_node # <<<<<<<<<<<<<< @@ -2929,7 +3091,7 @@ } } - /* "yt/utilities/lib/mesh_triangulation.pyx":121 + /* "yt/utilities/lib/mesh_triangulation.pyx":122 * node = node.next_node * * return tri_indices, element_map # <<<<<<<<<<<<<< @@ -2937,11 +3099,11 @@ * cdef TriNode* _allocate_new_node(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_tri_indices, 2, (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, 121, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_tri_indices, 2, (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, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_element_map, 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_4)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_element_map, 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_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -2953,7 +3115,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":98 + /* "yt/utilities/lib/mesh_triangulation.pyx":99 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_exterior_tris(self): # <<<<<<<<<<<<<< @@ -2979,7 +3141,7 @@ return __pyx_r; } -/* "yt/utilities/lib/mesh_triangulation.pyx":123 +/* "yt/utilities/lib/mesh_triangulation.pyx":124 * return tri_indices, element_map * * cdef TriNode* _allocate_new_node(self, # <<<<<<<<<<<<<< @@ -2991,7 +3153,7 @@ struct __pyx_t_2yt_9utilities_3lib_18mesh_triangulation_TriNode *__pyx_v_new_node; struct __pyx_t_2yt_9utilities_3lib_18mesh_triangulation_TriNode *__pyx_r; - /* "yt/utilities/lib/mesh_triangulation.pyx":127 + /* "yt/utilities/lib/mesh_triangulation.pyx":128 * np.uint64_t key, * np.int64_t elem) nogil: * cdef TriNode* new_node = malloc(sizeof(TriNode)) # <<<<<<<<<<<<<< @@ -3000,7 +3162,7 @@ */ __pyx_v_new_node = ((struct __pyx_t_2yt_9utilities_3lib_18mesh_triangulation_TriNode *)malloc((sizeof(struct __pyx_t_2yt_9utilities_3lib_18mesh_triangulation_TriNode)))); - /* "yt/utilities/lib/mesh_triangulation.pyx":128 + /* "yt/utilities/lib/mesh_triangulation.pyx":129 * np.int64_t elem) nogil: * cdef TriNode* new_node = malloc(sizeof(TriNode)) * new_node.key = key # <<<<<<<<<<<<<< @@ -3009,7 +3171,7 @@ */ __pyx_v_new_node->key = __pyx_v_key; - /* "yt/utilities/lib/mesh_triangulation.pyx":129 + /* "yt/utilities/lib/mesh_triangulation.pyx":130 * cdef TriNode* new_node = malloc(sizeof(TriNode)) * new_node.key = key * new_node.elem = elem # <<<<<<<<<<<<<< @@ -3018,7 +3180,7 @@ */ __pyx_v_new_node->elem = __pyx_v_elem; - /* "yt/utilities/lib/mesh_triangulation.pyx":130 + /* "yt/utilities/lib/mesh_triangulation.pyx":131 * new_node.key = key * new_node.elem = elem * new_node.tri[0] = tri[0] # <<<<<<<<<<<<<< @@ -3027,7 +3189,7 @@ */ (__pyx_v_new_node->tri[0]) = (__pyx_v_tri[0]); - /* "yt/utilities/lib/mesh_triangulation.pyx":131 + /* "yt/utilities/lib/mesh_triangulation.pyx":132 * new_node.elem = elem * new_node.tri[0] = tri[0] * new_node.tri[1] = tri[1] # <<<<<<<<<<<<<< @@ -3036,7 +3198,7 @@ */ (__pyx_v_new_node->tri[1]) = (__pyx_v_tri[1]); - /* "yt/utilities/lib/mesh_triangulation.pyx":132 + /* "yt/utilities/lib/mesh_triangulation.pyx":133 * new_node.tri[0] = tri[0] * new_node.tri[1] = tri[1] * new_node.tri[2] = tri[2] # <<<<<<<<<<<<<< @@ -3045,7 +3207,7 @@ */ (__pyx_v_new_node->tri[2]) = (__pyx_v_tri[2]); - /* "yt/utilities/lib/mesh_triangulation.pyx":133 + /* "yt/utilities/lib/mesh_triangulation.pyx":134 * new_node.tri[1] = tri[1] * new_node.tri[2] = tri[2] * new_node.next_node = NULL # <<<<<<<<<<<<<< @@ -3054,7 +3216,7 @@ */ __pyx_v_new_node->next_node = NULL; - /* "yt/utilities/lib/mesh_triangulation.pyx":134 + /* "yt/utilities/lib/mesh_triangulation.pyx":135 * new_node.tri[2] = tri[2] * new_node.next_node = NULL * self.num_items += 1 # <<<<<<<<<<<<<< @@ -3063,7 +3225,7 @@ */ __pyx_v_self->num_items = (__pyx_v_self->num_items + 1); - /* "yt/utilities/lib/mesh_triangulation.pyx":135 + /* "yt/utilities/lib/mesh_triangulation.pyx":136 * new_node.next_node = NULL * self.num_items += 1 * return new_node # <<<<<<<<<<<<<< @@ -3073,7 +3235,7 @@ __pyx_r = __pyx_v_new_node; goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":123 + /* "yt/utilities/lib/mesh_triangulation.pyx":124 * return tri_indices, element_map * * cdef TriNode* _allocate_new_node(self, # <<<<<<<<<<<<<< @@ -3086,7 +3248,7 @@ return __pyx_r; } -/* "yt/utilities/lib/mesh_triangulation.pyx":138 +/* "yt/utilities/lib/mesh_triangulation.pyx":139 * * @cython.cdivision(True) * cdef void update(self, np.int64_t tri[3], np.int64_t elem) nogil: # <<<<<<<<<<<<<< @@ -3103,7 +3265,7 @@ int __pyx_t_2; struct __pyx_t_2yt_9utilities_3lib_18mesh_triangulation_TriNode *__pyx_t_3; - /* "yt/utilities/lib/mesh_triangulation.pyx":139 + /* "yt/utilities/lib/mesh_triangulation.pyx":140 * @cython.cdivision(True) * cdef void update(self, np.int64_t tri[3], np.int64_t elem) nogil: * cdef np.uint64_t key = triangle_hash(tri) # <<<<<<<<<<<<<< @@ -3112,7 +3274,7 @@ */ __pyx_v_key = __pyx_f_2yt_9utilities_3lib_18mesh_triangulation_triangle_hash(__pyx_v_tri); - /* "yt/utilities/lib/mesh_triangulation.pyx":140 + /* "yt/utilities/lib/mesh_triangulation.pyx":141 * cdef void update(self, np.int64_t tri[3], np.int64_t elem) nogil: * cdef np.uint64_t key = triangle_hash(tri) * cdef np.uint64_t index = key % TABLE_SIZE # <<<<<<<<<<<<<< @@ -3121,7 +3283,7 @@ */ __pyx_v_index = (__pyx_v_key % __pyx_v_2yt_9utilities_3lib_18mesh_triangulation_TABLE_SIZE); - /* "yt/utilities/lib/mesh_triangulation.pyx":141 + /* "yt/utilities/lib/mesh_triangulation.pyx":142 * cdef np.uint64_t key = triangle_hash(tri) * cdef np.uint64_t index = key % TABLE_SIZE * cdef TriNode *node = self.table[index] # <<<<<<<<<<<<<< @@ -3130,7 +3292,7 @@ */ __pyx_v_node = (__pyx_v_self->table[__pyx_v_index]); - /* "yt/utilities/lib/mesh_triangulation.pyx":143 + /* "yt/utilities/lib/mesh_triangulation.pyx":144 * cdef TriNode *node = self.table[index] * * if node == NULL: # <<<<<<<<<<<<<< @@ -3140,7 +3302,7 @@ __pyx_t_1 = ((__pyx_v_node == NULL) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/mesh_triangulation.pyx":144 + /* "yt/utilities/lib/mesh_triangulation.pyx":145 * * if node == NULL: * self.table[index] = self._allocate_new_node(tri, key, elem) # <<<<<<<<<<<<<< @@ -3149,7 +3311,7 @@ */ (__pyx_v_self->table[__pyx_v_index]) = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_18mesh_triangulation_TriSet *)__pyx_v_self->__pyx_vtab)->_allocate_new_node(__pyx_v_self, __pyx_v_tri, __pyx_v_key, __pyx_v_elem); - /* "yt/utilities/lib/mesh_triangulation.pyx":145 + /* "yt/utilities/lib/mesh_triangulation.pyx":146 * if node == NULL: * self.table[index] = self._allocate_new_node(tri, key, elem) * return # <<<<<<<<<<<<<< @@ -3158,7 +3320,7 @@ */ goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":143 + /* "yt/utilities/lib/mesh_triangulation.pyx":144 * cdef TriNode *node = self.table[index] * * if node == NULL: # <<<<<<<<<<<<<< @@ -3167,7 +3329,7 @@ */ } - /* "yt/utilities/lib/mesh_triangulation.pyx":147 + /* "yt/utilities/lib/mesh_triangulation.pyx":148 * return * * if key == node.key and triangles_are_equal(node.tri, tri): # <<<<<<<<<<<<<< @@ -3185,7 +3347,7 @@ __pyx_L5_bool_binop_done:; if (__pyx_t_1) { - /* "yt/utilities/lib/mesh_triangulation.pyx":149 + /* "yt/utilities/lib/mesh_triangulation.pyx":150 * if key == node.key and triangles_are_equal(node.tri, tri): * # this triangle is already here, delete it * self.table[index] = node.next_node # <<<<<<<<<<<<<< @@ -3195,7 +3357,7 @@ __pyx_t_3 = __pyx_v_node->next_node; (__pyx_v_self->table[__pyx_v_index]) = __pyx_t_3; - /* "yt/utilities/lib/mesh_triangulation.pyx":150 + /* "yt/utilities/lib/mesh_triangulation.pyx":151 * # this triangle is already here, delete it * self.table[index] = node.next_node * free(node) # <<<<<<<<<<<<<< @@ -3204,7 +3366,7 @@ */ free(__pyx_v_node); - /* "yt/utilities/lib/mesh_triangulation.pyx":151 + /* "yt/utilities/lib/mesh_triangulation.pyx":152 * self.table[index] = node.next_node * free(node) * self.num_items -= 1 # <<<<<<<<<<<<<< @@ -3213,7 +3375,7 @@ */ __pyx_v_self->num_items = (__pyx_v_self->num_items - 1); - /* "yt/utilities/lib/mesh_triangulation.pyx":152 + /* "yt/utilities/lib/mesh_triangulation.pyx":153 * free(node) * self.num_items -= 1 * return # <<<<<<<<<<<<<< @@ -3222,7 +3384,7 @@ */ goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":147 + /* "yt/utilities/lib/mesh_triangulation.pyx":148 * return * * if key == node.key and triangles_are_equal(node.tri, tri): # <<<<<<<<<<<<<< @@ -3231,7 +3393,7 @@ */ } - /* "yt/utilities/lib/mesh_triangulation.pyx":154 + /* "yt/utilities/lib/mesh_triangulation.pyx":155 * return * * elif node.next_node == NULL: # <<<<<<<<<<<<<< @@ -3241,7 +3403,7 @@ __pyx_t_1 = ((__pyx_v_node->next_node == NULL) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/mesh_triangulation.pyx":155 + /* "yt/utilities/lib/mesh_triangulation.pyx":156 * * elif node.next_node == NULL: * node.next_node = self._allocate_new_node(tri, key, elem) # <<<<<<<<<<<<<< @@ -3250,7 +3412,7 @@ */ __pyx_v_node->next_node = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_18mesh_triangulation_TriSet *)__pyx_v_self->__pyx_vtab)->_allocate_new_node(__pyx_v_self, __pyx_v_tri, __pyx_v_key, __pyx_v_elem); - /* "yt/utilities/lib/mesh_triangulation.pyx":156 + /* "yt/utilities/lib/mesh_triangulation.pyx":157 * elif node.next_node == NULL: * node.next_node = self._allocate_new_node(tri, key, elem) * return # <<<<<<<<<<<<<< @@ -3259,7 +3421,7 @@ */ goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":154 + /* "yt/utilities/lib/mesh_triangulation.pyx":155 * return * * elif node.next_node == NULL: # <<<<<<<<<<<<<< @@ -3268,7 +3430,7 @@ */ } - /* "yt/utilities/lib/mesh_triangulation.pyx":159 + /* "yt/utilities/lib/mesh_triangulation.pyx":160 * * # walk through node list * cdef TriNode* prev = node # <<<<<<<<<<<<<< @@ -3277,7 +3439,7 @@ */ __pyx_v_prev = __pyx_v_node; - /* "yt/utilities/lib/mesh_triangulation.pyx":160 + /* "yt/utilities/lib/mesh_triangulation.pyx":161 * # walk through node list * cdef TriNode* prev = node * node = node.next_node # <<<<<<<<<<<<<< @@ -3287,7 +3449,7 @@ __pyx_t_3 = __pyx_v_node->next_node; __pyx_v_node = __pyx_t_3; - /* "yt/utilities/lib/mesh_triangulation.pyx":161 + /* "yt/utilities/lib/mesh_triangulation.pyx":162 * cdef TriNode* prev = node * node = node.next_node * while node != NULL: # <<<<<<<<<<<<<< @@ -3298,7 +3460,7 @@ __pyx_t_1 = ((__pyx_v_node != NULL) != 0); if (!__pyx_t_1) break; - /* "yt/utilities/lib/mesh_triangulation.pyx":162 + /* "yt/utilities/lib/mesh_triangulation.pyx":163 * node = node.next_node * while node != NULL: * if key == node.key and triangles_are_equal(node.tri, tri): # <<<<<<<<<<<<<< @@ -3316,7 +3478,7 @@ __pyx_L10_bool_binop_done:; if (__pyx_t_1) { - /* "yt/utilities/lib/mesh_triangulation.pyx":164 + /* "yt/utilities/lib/mesh_triangulation.pyx":165 * if key == node.key and triangles_are_equal(node.tri, tri): * # this triangle is already here, delete it * prev.next_node = node.next_node # <<<<<<<<<<<<<< @@ -3326,7 +3488,7 @@ __pyx_t_3 = __pyx_v_node->next_node; __pyx_v_prev->next_node = __pyx_t_3; - /* "yt/utilities/lib/mesh_triangulation.pyx":165 + /* "yt/utilities/lib/mesh_triangulation.pyx":166 * # this triangle is already here, delete it * prev.next_node = node.next_node * free(node) # <<<<<<<<<<<<<< @@ -3335,7 +3497,7 @@ */ free(__pyx_v_node); - /* "yt/utilities/lib/mesh_triangulation.pyx":166 + /* "yt/utilities/lib/mesh_triangulation.pyx":167 * prev.next_node = node.next_node * free(node) * self.num_items -= 1 # <<<<<<<<<<<<<< @@ -3344,7 +3506,7 @@ */ __pyx_v_self->num_items = (__pyx_v_self->num_items - 1); - /* "yt/utilities/lib/mesh_triangulation.pyx":167 + /* "yt/utilities/lib/mesh_triangulation.pyx":168 * free(node) * self.num_items -= 1 * return # <<<<<<<<<<<<<< @@ -3353,7 +3515,7 @@ */ goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":162 + /* "yt/utilities/lib/mesh_triangulation.pyx":163 * node = node.next_node * while node != NULL: * if key == node.key and triangles_are_equal(node.tri, tri): # <<<<<<<<<<<<<< @@ -3362,7 +3524,7 @@ */ } - /* "yt/utilities/lib/mesh_triangulation.pyx":168 + /* "yt/utilities/lib/mesh_triangulation.pyx":169 * self.num_items -= 1 * return * if node.next_node == NULL: # <<<<<<<<<<<<<< @@ -3372,7 +3534,7 @@ __pyx_t_1 = ((__pyx_v_node->next_node == NULL) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/mesh_triangulation.pyx":170 + /* "yt/utilities/lib/mesh_triangulation.pyx":171 * if node.next_node == NULL: * # we have reached the end; add new node * node.next_node = self._allocate_new_node(tri, key, elem) # <<<<<<<<<<<<<< @@ -3381,7 +3543,7 @@ */ __pyx_v_node->next_node = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_18mesh_triangulation_TriSet *)__pyx_v_self->__pyx_vtab)->_allocate_new_node(__pyx_v_self, __pyx_v_tri, __pyx_v_key, __pyx_v_elem); - /* "yt/utilities/lib/mesh_triangulation.pyx":171 + /* "yt/utilities/lib/mesh_triangulation.pyx":172 * # we have reached the end; add new node * node.next_node = self._allocate_new_node(tri, key, elem) * return # <<<<<<<<<<<<<< @@ -3390,7 +3552,7 @@ */ goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":168 + /* "yt/utilities/lib/mesh_triangulation.pyx":169 * self.num_items -= 1 * return * if node.next_node == NULL: # <<<<<<<<<<<<<< @@ -3399,7 +3561,7 @@ */ } - /* "yt/utilities/lib/mesh_triangulation.pyx":172 + /* "yt/utilities/lib/mesh_triangulation.pyx":173 * node.next_node = self._allocate_new_node(tri, key, elem) * return * prev = node # <<<<<<<<<<<<<< @@ -3408,7 +3570,7 @@ */ __pyx_v_prev = __pyx_v_node; - /* "yt/utilities/lib/mesh_triangulation.pyx":173 + /* "yt/utilities/lib/mesh_triangulation.pyx":174 * return * prev = node * node = node.next_node # <<<<<<<<<<<<<< @@ -3419,7 +3581,7 @@ __pyx_v_node = __pyx_t_3; } - /* "yt/utilities/lib/mesh_triangulation.pyx":138 + /* "yt/utilities/lib/mesh_triangulation.pyx":139 * * @cython.cdivision(True) * cdef void update(self, np.int64_t tri[3], np.int64_t elem) nogil: # <<<<<<<<<<<<<< @@ -3431,10 +3593,117 @@ __pyx_L0:; } -/* "yt/utilities/lib/mesh_triangulation.pyx":184 +/* "(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_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_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_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_6__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *__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_, 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("yt.utilities.lib.mesh_triangulation.TriSet.__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_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_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_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_8__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *__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__2, 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("yt.utilities.lib.mesh_triangulation.TriSet.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/mesh_triangulation.pyx":185 * cdef int[MAX_NUM_TRI][3] tri_array * - * def __cinit__(self, np.int64_t[:, ::1] indices): # <<<<<<<<<<<<<< + * def __cinit__(self, np.int_t[:, ::1] indices): # <<<<<<<<<<<<<< * ''' * */ @@ -3454,6 +3723,7 @@ 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; } @@ -3464,18 +3734,18 @@ else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 184, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 185, __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_indices = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 184, __pyx_L3_error) + __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int_t(values[0]); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 185, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 184, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 185, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.mesh_triangulation.MeshInfoHolder.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3499,7 +3769,7 @@ PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "yt/utilities/lib/mesh_triangulation.pyx":191 + /* "yt/utilities/lib/mesh_triangulation.pyx":192 * ''' * * self.num_elem = indices.shape[0] # <<<<<<<<<<<<<< @@ -3508,7 +3778,7 @@ */ __pyx_v_self->num_elem = (__pyx_v_indices.shape[0]); - /* "yt/utilities/lib/mesh_triangulation.pyx":192 + /* "yt/utilities/lib/mesh_triangulation.pyx":193 * * self.num_elem = indices.shape[0] * self.VPE = indices.shape[1] # <<<<<<<<<<<<<< @@ -3517,7 +3787,7 @@ */ __pyx_v_self->VPE = (__pyx_v_indices.shape[1]); - /* "yt/utilities/lib/mesh_triangulation.pyx":194 + /* "yt/utilities/lib/mesh_triangulation.pyx":195 * self.VPE = indices.shape[1] * * if (self.VPE == 8 or self.VPE == 20 or self.VPE == 27): # <<<<<<<<<<<<<< @@ -3529,29 +3799,29 @@ case 20: case 27: - /* "yt/utilities/lib/mesh_triangulation.pyx":195 + /* "yt/utilities/lib/mesh_triangulation.pyx":196 * * if (self.VPE == 8 or self.VPE == 20 or self.VPE == 27): * self.TPE = HEX_NT # <<<<<<<<<<<<<< * self.tri_array = triangulate_hex - * elif self.VPE == 4: + * elif (self.VPE == 4 or self.VPE == 10): */ __pyx_v_self->TPE = HEX_NT; - /* "yt/utilities/lib/mesh_triangulation.pyx":196 + /* "yt/utilities/lib/mesh_triangulation.pyx":197 * if (self.VPE == 8 or self.VPE == 20 or self.VPE == 27): * self.TPE = HEX_NT * self.tri_array = triangulate_hex # <<<<<<<<<<<<<< - * elif self.VPE == 4: + * elif (self.VPE == 4 or self.VPE == 10): * self.TPE = TETRA_NT */ if (unlikely((MAX_NUM_TRI) != (MAX_NUM_TRI))) { PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(MAX_NUM_TRI), (Py_ssize_t)(MAX_NUM_TRI)); - __PYX_ERR(0, 196, __pyx_L1_error) + __PYX_ERR(0, 197, __pyx_L1_error) } memcpy(&(__pyx_v_self->tri_array[0]), triangulate_hex, sizeof(__pyx_v_self->tri_array[0]) * (MAX_NUM_TRI)); - /* "yt/utilities/lib/mesh_triangulation.pyx":194 + /* "yt/utilities/lib/mesh_triangulation.pyx":195 * self.VPE = indices.shape[1] * * if (self.VPE == 8 or self.VPE == 20 or self.VPE == 27): # <<<<<<<<<<<<<< @@ -3560,26 +3830,27 @@ */ break; - /* "yt/utilities/lib/mesh_triangulation.pyx":197 + /* "yt/utilities/lib/mesh_triangulation.pyx":198 * self.TPE = HEX_NT * self.tri_array = triangulate_hex - * elif self.VPE == 4: # <<<<<<<<<<<<<< + * elif (self.VPE == 4 or self.VPE == 10): # <<<<<<<<<<<<<< * self.TPE = TETRA_NT * self.tri_array = triangulate_tetra */ case 4: + case 10: - /* "yt/utilities/lib/mesh_triangulation.pyx":198 + /* "yt/utilities/lib/mesh_triangulation.pyx":199 * self.tri_array = triangulate_hex - * elif self.VPE == 4: + * elif (self.VPE == 4 or self.VPE == 10): * self.TPE = TETRA_NT # <<<<<<<<<<<<<< * self.tri_array = triangulate_tetra * elif self.VPE == 6: */ __pyx_v_self->TPE = TETRA_NT; - /* "yt/utilities/lib/mesh_triangulation.pyx":199 - * elif self.VPE == 4: + /* "yt/utilities/lib/mesh_triangulation.pyx":200 + * elif (self.VPE == 4 or self.VPE == 10): * self.TPE = TETRA_NT * self.tri_array = triangulate_tetra # <<<<<<<<<<<<<< * elif self.VPE == 6: @@ -3587,20 +3858,20 @@ */ if (unlikely((MAX_NUM_TRI) != (MAX_NUM_TRI))) { PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(MAX_NUM_TRI), (Py_ssize_t)(MAX_NUM_TRI)); - __PYX_ERR(0, 199, __pyx_L1_error) + __PYX_ERR(0, 200, __pyx_L1_error) } memcpy(&(__pyx_v_self->tri_array[0]), triangulate_tetra, sizeof(__pyx_v_self->tri_array[0]) * (MAX_NUM_TRI)); - /* "yt/utilities/lib/mesh_triangulation.pyx":197 + /* "yt/utilities/lib/mesh_triangulation.pyx":198 * self.TPE = HEX_NT * self.tri_array = triangulate_hex - * elif self.VPE == 4: # <<<<<<<<<<<<<< + * elif (self.VPE == 4 or self.VPE == 10): # <<<<<<<<<<<<<< * self.TPE = TETRA_NT * self.tri_array = triangulate_tetra */ break; - /* "yt/utilities/lib/mesh_triangulation.pyx":200 + /* "yt/utilities/lib/mesh_triangulation.pyx":201 * self.TPE = TETRA_NT * self.tri_array = triangulate_tetra * elif self.VPE == 6: # <<<<<<<<<<<<<< @@ -3609,7 +3880,7 @@ */ case 6: - /* "yt/utilities/lib/mesh_triangulation.pyx":201 + /* "yt/utilities/lib/mesh_triangulation.pyx":202 * self.tri_array = triangulate_tetra * elif self.VPE == 6: * self.TPE = WEDGE_NT # <<<<<<<<<<<<<< @@ -3618,7 +3889,7 @@ */ __pyx_v_self->TPE = WEDGE_NT; - /* "yt/utilities/lib/mesh_triangulation.pyx":202 + /* "yt/utilities/lib/mesh_triangulation.pyx":203 * elif self.VPE == 6: * self.TPE = WEDGE_NT * self.tri_array = triangulate_wedge # <<<<<<<<<<<<<< @@ -3627,11 +3898,11 @@ */ if (unlikely((MAX_NUM_TRI) != (MAX_NUM_TRI))) { PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(MAX_NUM_TRI), (Py_ssize_t)(MAX_NUM_TRI)); - __PYX_ERR(0, 202, __pyx_L1_error) + __PYX_ERR(0, 203, __pyx_L1_error) } memcpy(&(__pyx_v_self->tri_array[0]), triangulate_wedge, sizeof(__pyx_v_self->tri_array[0]) * (MAX_NUM_TRI)); - /* "yt/utilities/lib/mesh_triangulation.pyx":200 + /* "yt/utilities/lib/mesh_triangulation.pyx":201 * self.TPE = TETRA_NT * self.tri_array = triangulate_tetra * elif self.VPE == 6: # <<<<<<<<<<<<<< @@ -3641,16 +3912,16 @@ break; default: - /* "yt/utilities/lib/mesh_triangulation.pyx":204 + /* "yt/utilities/lib/mesh_triangulation.pyx":205 * self.tri_array = triangulate_wedge * else: * raise YTElementTypeNotRecognized(3, self.VPE) # <<<<<<<<<<<<<< * * self.num_tri = self.TPE * self.num_elem */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTElementTypeNotRecognized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTElementTypeNotRecognized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->VPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->VPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -3667,7 +3938,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_int_3, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __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; @@ -3676,14 +3947,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_int_3, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -3694,18 +3965,18 @@ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 204, __pyx_L1_error) + __PYX_ERR(0, 205, __pyx_L1_error) break; } - /* "yt/utilities/lib/mesh_triangulation.pyx":206 + /* "yt/utilities/lib/mesh_triangulation.pyx":207 * raise YTElementTypeNotRecognized(3, self.VPE) * * self.num_tri = self.TPE * self.num_elem # <<<<<<<<<<<<<< @@ -3714,7 +3985,7 @@ */ __pyx_v_self->num_tri = (__pyx_v_self->TPE * __pyx_v_self->num_elem); - /* "yt/utilities/lib/mesh_triangulation.pyx":207 + /* "yt/utilities/lib/mesh_triangulation.pyx":208 * * self.num_tri = self.TPE * self.num_elem * self.num_verts = self.num_tri * 3 # <<<<<<<<<<<<<< @@ -3723,10 +3994,10 @@ */ __pyx_v_self->num_verts = (__pyx_v_self->num_tri * 3); - /* "yt/utilities/lib/mesh_triangulation.pyx":184 + /* "yt/utilities/lib/mesh_triangulation.pyx":185 * cdef int[MAX_NUM_TRI][3] tri_array * - * def __cinit__(self, np.int64_t[:, ::1] indices): # <<<<<<<<<<<<<< + * def __cinit__(self, np.int_t[:, ::1] indices): # <<<<<<<<<<<<<< * ''' * */ @@ -3748,7 +4019,114 @@ return __pyx_r; } -/* "yt/utilities/lib/mesh_triangulation.pyx":211 +/* "(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_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_3__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_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder *__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__3, 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("yt.utilities.lib.mesh_triangulation.MeshInfoHolder.__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_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_5__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_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder *__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__4, 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("yt.utilities.lib.mesh_triangulation.MeshInfoHolder.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/mesh_triangulation.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def cull_interior_triangles(np.int64_t[:, ::1] indices): # <<<<<<<<<<<<<< @@ -3766,7 +4144,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cull_interior_triangles (wrapper)", 0); assert(__pyx_arg_indices); { - __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(__pyx_arg_indices); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 211, __pyx_L3_error) + __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(__pyx_arg_indices); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 212, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3802,39 +4180,39 @@ PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("cull_interior_triangles", 0); - /* "yt/utilities/lib/mesh_triangulation.pyx":219 + /* "yt/utilities/lib/mesh_triangulation.pyx":220 * ''' * * cdef MeshInfoHolder m = MeshInfoHolder(indices) # <<<<<<<<<<<<<< * * cdef TriSet s = TriSet() */ - __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indices, 2, (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, 219, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indices, 2, (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, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __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_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_m = ((struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/mesh_triangulation.pyx":221 + /* "yt/utilities/lib/mesh_triangulation.pyx":222 * cdef MeshInfoHolder m = MeshInfoHolder(indices) * * cdef TriSet s = TriSet() # <<<<<<<<<<<<<< * cdef np.int64_t i, j, k * cdef np.int64_t tri[3] */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_18mesh_triangulation_TriSet), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_18mesh_triangulation_TriSet), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_s = ((struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/mesh_triangulation.pyx":224 + /* "yt/utilities/lib/mesh_triangulation.pyx":225 * cdef np.int64_t i, j, k * cdef np.int64_t tri[3] * for i in range(m.num_elem): # <<<<<<<<<<<<<< @@ -3845,7 +4223,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/utilities/lib/mesh_triangulation.pyx":225 + /* "yt/utilities/lib/mesh_triangulation.pyx":226 * cdef np.int64_t tri[3] * for i in range(m.num_elem): * for j in range(m.TPE): # <<<<<<<<<<<<<< @@ -3856,7 +4234,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "yt/utilities/lib/mesh_triangulation.pyx":226 + /* "yt/utilities/lib/mesh_triangulation.pyx":227 * for i in range(m.num_elem): * for j in range(m.TPE): * for k in range(3): # <<<<<<<<<<<<<< @@ -3866,7 +4244,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) { __pyx_v_k = __pyx_t_7; - /* "yt/utilities/lib/mesh_triangulation.pyx":227 + /* "yt/utilities/lib/mesh_triangulation.pyx":228 * for j in range(m.TPE): * for k in range(3): * tri[k] = indices[i, m.tri_array[j][k]] # <<<<<<<<<<<<<< @@ -3878,7 +4256,7 @@ (__pyx_v_tri[__pyx_v_k]) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_8 * __pyx_v_indices.strides[0]) )) + __pyx_t_9)) ))); } - /* "yt/utilities/lib/mesh_triangulation.pyx":228 + /* "yt/utilities/lib/mesh_triangulation.pyx":229 * for k in range(3): * tri[k] = indices[i, m.tri_array[j][k]] * s.update(tri, i) # <<<<<<<<<<<<<< @@ -3889,7 +4267,7 @@ } } - /* "yt/utilities/lib/mesh_triangulation.pyx":230 + /* "yt/utilities/lib/mesh_triangulation.pyx":231 * s.update(tri, i) * * return s.get_exterior_tris() # <<<<<<<<<<<<<< @@ -3897,7 +4275,7 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_get_exterior_tris); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_get_exterior_tris); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -3910,10 +4288,10 @@ } } if (__pyx_t_10) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3921,7 +4299,7 @@ __pyx_t_1 = 0; goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":211 + /* "yt/utilities/lib/mesh_triangulation.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def cull_interior_triangles(np.int64_t[:, ::1] indices): # <<<<<<<<<<<<<< @@ -3945,7 +4323,7 @@ return __pyx_r; } -/* "yt/utilities/lib/mesh_triangulation.pyx":234 +/* "yt/utilities/lib/mesh_triangulation.pyx":235 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_vertex_data(np.float64_t[:, ::1] coords, # <<<<<<<<<<<<<< @@ -3972,8 +4350,11 @@ 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; } @@ -3982,19 +4363,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_vertex_data", 1, 3, 3, 1); __PYX_ERR(0, 234, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_vertex_data", 1, 3, 3, 1); __PYX_ERR(0, 235, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_vertex_data", 1, 3, 3, 2); __PYX_ERR(0, 234, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_vertex_data", 1, 3, 3, 2); __PYX_ERR(0, 235, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_vertex_data") < 0)) __PYX_ERR(0, 234, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_vertex_data") < 0)) __PYX_ERR(0, 235, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -4003,13 +4386,13 @@ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_coords = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_coords.memview)) __PYX_ERR(0, 234, __pyx_L3_error) - __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 235, __pyx_L3_error) - __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 236, __pyx_L3_error) + __pyx_v_coords = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_coords.memview)) __PYX_ERR(0, 235, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 236, __pyx_L3_error) + __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 237, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_vertex_data", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 234, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_vertex_data", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 235, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.mesh_triangulation.get_vertex_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4046,27 +4429,27 @@ __pyx_t_5numpy_int64_t __pyx_t_14; __Pyx_RefNannySetupContext("get_vertex_data", 0); - /* "yt/utilities/lib/mesh_triangulation.pyx":245 + /* "yt/utilities/lib/mesh_triangulation.pyx":246 * ''' * * cdef MeshInfoHolder m = MeshInfoHolder(indices) # <<<<<<<<<<<<<< * cdef np.int64_t num_verts = coords.shape[0] * cdef np.float32_t[:] vertex_data = np.zeros(num_verts, dtype="float32") */ - __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indices, 2, (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, 245, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indices, 2, (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, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __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_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_m = ((struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/mesh_triangulation.pyx":246 + /* "yt/utilities/lib/mesh_triangulation.pyx":247 * * cdef MeshInfoHolder m = MeshInfoHolder(indices) * cdef np.int64_t num_verts = coords.shape[0] # <<<<<<<<<<<<<< @@ -4075,41 +4458,41 @@ */ __pyx_v_num_verts = (__pyx_v_coords.shape[0]); - /* "yt/utilities/lib/mesh_triangulation.pyx":247 + /* "yt/utilities/lib/mesh_triangulation.pyx":248 * cdef MeshInfoHolder m = MeshInfoHolder(indices) * cdef np.int64_t num_verts = coords.shape[0] * cdef np.float32_t[:] vertex_data = np.zeros(num_verts, dtype="float32") # <<<<<<<<<<<<<< * * cdef np.int64_t i, j */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __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, 247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_verts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_verts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float32) < 0) __PYX_ERR(0, 247, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float32) < 0) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_t_4); - if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 247, __pyx_L1_error) + if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_vertex_data = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "yt/utilities/lib/mesh_triangulation.pyx":250 + /* "yt/utilities/lib/mesh_triangulation.pyx":251 * * cdef np.int64_t i, j * for i in range(m.num_elem): # <<<<<<<<<<<<<< @@ -4120,7 +4503,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/mesh_triangulation.pyx":251 + /* "yt/utilities/lib/mesh_triangulation.pyx":252 * cdef np.int64_t i, j * for i in range(m.num_elem): * for j in range(m.VPE): # <<<<<<<<<<<<<< @@ -4131,7 +4514,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_j = __pyx_t_9; - /* "yt/utilities/lib/mesh_triangulation.pyx":252 + /* "yt/utilities/lib/mesh_triangulation.pyx":253 * for i in range(m.num_elem): * for j in range(m.VPE): * vertex_data[indices[i, j]] = data[i, j] # <<<<<<<<<<<<<< @@ -4147,7 +4530,7 @@ } } - /* "yt/utilities/lib/mesh_triangulation.pyx":253 + /* "yt/utilities/lib/mesh_triangulation.pyx":254 * for j in range(m.VPE): * vertex_data[indices[i, j]] = data[i, j] * return vertex_data # <<<<<<<<<<<<<< @@ -4155,13 +4538,13 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vertex_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vertex_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":234 + /* "yt/utilities/lib/mesh_triangulation.pyx":235 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_vertex_data(np.float64_t[:, ::1] coords, # <<<<<<<<<<<<<< @@ -4189,7 +4572,7 @@ return __pyx_r; } -/* "yt/utilities/lib/mesh_triangulation.pyx":258 +/* "yt/utilities/lib/mesh_triangulation.pyx":259 * @cython.boundscheck(False) * @cython.wraparound(False) * def triangulate_mesh(np.float64_t[:, ::1] coords, # <<<<<<<<<<<<<< @@ -4216,8 +4599,11 @@ 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; } @@ -4226,19 +4612,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("triangulate_mesh", 1, 3, 3, 1); __PYX_ERR(0, 258, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("triangulate_mesh", 1, 3, 3, 1); __PYX_ERR(0, 259, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("triangulate_mesh", 1, 3, 3, 2); __PYX_ERR(0, 258, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("triangulate_mesh", 1, 3, 3, 2); __PYX_ERR(0, 259, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "triangulate_mesh") < 0)) __PYX_ERR(0, 258, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "triangulate_mesh") < 0)) __PYX_ERR(0, 259, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -4247,19 +4635,19 @@ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_coords = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_coords.memview)) __PYX_ERR(0, 258, __pyx_L3_error) + __pyx_v_coords = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_coords.memview)) __PYX_ERR(0, 259, __pyx_L3_error) __pyx_v_data = ((PyArrayObject *)values[1]); - __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 260, __pyx_L3_error) + __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 261, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("triangulate_mesh", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 258, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("triangulate_mesh", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 259, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.mesh_triangulation.triangulate_mesh", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 259, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 260, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_4triangulate_mesh(__pyx_self, __pyx_v_coords, __pyx_v_data, __pyx_v_indices); /* function exit code */ @@ -4320,16 +4708,16 @@ PyObject *__pyx_t_31 = NULL; __Pyx_RefNannySetupContext("triangulate_mesh", 0); - /* "yt/utilities/lib/mesh_triangulation.pyx":269 + /* "yt/utilities/lib/mesh_triangulation.pyx":270 * cdef np.int64_t[:, ::1] exterior_tris * cdef np.int64_t[::1] element_map * exterior_tris, element_map = cull_interior_triangles(indices) # <<<<<<<<<<<<<< * * cdef np.int64_t num_tri = exterior_tris.shape[0] */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cull_interior_triangles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cull_interior_triangles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_indices, 2, (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_3)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_indices, 2, (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_3)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -4342,14 +4730,14 @@ } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __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, 269, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __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; @@ -4358,20 +4746,20 @@ #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, 269, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __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, 269, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __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, 269, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -4387,7 +4775,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 269, __pyx_L1_error) + __PYX_ERR(0, 270, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -4400,15 +4788,15 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; @@ -4416,7 +4804,7 @@ __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 2) < 0) __PYX_ERR(0, 269, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 2) < 0) __PYX_ERR(0, 270, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; @@ -4424,14 +4812,14 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 269, __pyx_L1_error) + __PYX_ERR(0, 270, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_2); - if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 269, __pyx_L1_error) + if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_5); - if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 269, __pyx_L1_error) + if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_exterior_tris = __pyx_t_7; __pyx_t_7.memview = NULL; @@ -4440,7 +4828,7 @@ __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "yt/utilities/lib/mesh_triangulation.pyx":271 + /* "yt/utilities/lib/mesh_triangulation.pyx":272 * exterior_tris, element_map = cull_interior_triangles(indices) * * cdef np.int64_t num_tri = exterior_tris.shape[0] # <<<<<<<<<<<<<< @@ -4449,7 +4837,7 @@ */ __pyx_v_num_tri = (__pyx_v_exterior_tris.shape[0]); - /* "yt/utilities/lib/mesh_triangulation.pyx":272 + /* "yt/utilities/lib/mesh_triangulation.pyx":273 * * cdef np.int64_t num_tri = exterior_tris.shape[0] * cdef np.int64_t num_verts = 3 * num_tri # <<<<<<<<<<<<<< @@ -4458,7 +4846,7 @@ */ __pyx_v_num_verts = (3 * __pyx_v_num_tri); - /* "yt/utilities/lib/mesh_triangulation.pyx":273 + /* "yt/utilities/lib/mesh_triangulation.pyx":274 * cdef np.int64_t num_tri = exterior_tris.shape[0] * cdef np.int64_t num_verts = 3 * num_tri * cdef np.int64_t num_coords = 3 * num_verts # <<<<<<<<<<<<<< @@ -4467,7 +4855,7 @@ */ __pyx_v_num_coords = (3 * __pyx_v_num_verts); - /* "yt/utilities/lib/mesh_triangulation.pyx":276 + /* "yt/utilities/lib/mesh_triangulation.pyx":277 * * cdef np.float32_t[:] vertex_data * if data.ndim == 2: # <<<<<<<<<<<<<< @@ -4477,18 +4865,18 @@ __pyx_t_9 = ((__pyx_v_data->nd == 2) != 0); if (__pyx_t_9) { - /* "yt/utilities/lib/mesh_triangulation.pyx":277 + /* "yt/utilities/lib/mesh_triangulation.pyx":278 * cdef np.float32_t[:] vertex_data * if data.ndim == 2: * vertex_data = get_vertex_data(coords, data, indices) # <<<<<<<<<<<<<< * else: * vertex_data = data.astype("float32") */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_vertex_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_vertex_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_indices, 2, (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_3)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_indices, 2, (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_3)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_10 = 0; @@ -4505,7 +4893,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_2, ((PyObject *)__pyx_v_data), __pyx_t_3}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __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; @@ -4515,7 +4903,7 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_2, ((PyObject *)__pyx_v_data), __pyx_t_3}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __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; @@ -4523,7 +4911,7 @@ } else #endif { - __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -4537,19 +4925,19 @@ PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_t_1); - if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_vertex_data = __pyx_t_12; __pyx_t_12.memview = NULL; __pyx_t_12.data = NULL; - /* "yt/utilities/lib/mesh_triangulation.pyx":276 + /* "yt/utilities/lib/mesh_triangulation.pyx":277 * * cdef np.float32_t[:] vertex_data * if data.ndim == 2: # <<<<<<<<<<<<<< @@ -4559,7 +4947,7 @@ goto __pyx_L5; } - /* "yt/utilities/lib/mesh_triangulation.pyx":279 + /* "yt/utilities/lib/mesh_triangulation.pyx":280 * vertex_data = get_vertex_data(coords, data, indices) * else: * vertex_data = data.astype("float32") # <<<<<<<<<<<<<< @@ -4567,13 +4955,13 @@ * cdef np.int32_t[:] tri_indices = np.empty(num_verts, dtype=np.int32) */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_t_5); - if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_vertex_data = __pyx_t_12; __pyx_t_12.memview = NULL; @@ -4581,127 +4969,127 @@ } __pyx_L5:; - /* "yt/utilities/lib/mesh_triangulation.pyx":281 + /* "yt/utilities/lib/mesh_triangulation.pyx":282 * vertex_data = data.astype("float32") * * cdef np.int32_t[:] tri_indices = np.empty(num_verts, dtype=np.int32) # <<<<<<<<<<<<<< * cdef np.float32_t[:] tri_data = np.empty(num_verts, dtype=np.float32) * cdef np.float32_t[:] tri_coords = np.empty(num_coords, dtype=np.float32) */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_verts); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_verts); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 281, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2); - if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 281, __pyx_L1_error) + if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tri_indices = __pyx_t_13; __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; - /* "yt/utilities/lib/mesh_triangulation.pyx":282 + /* "yt/utilities/lib/mesh_triangulation.pyx":283 * * cdef np.int32_t[:] tri_indices = np.empty(num_verts, dtype=np.int32) * cdef np.float32_t[:] tri_data = np.empty(num_verts, dtype=np.float32) # <<<<<<<<<<<<<< * cdef np.float32_t[:] tri_coords = np.empty(num_coords, dtype=np.float32) * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_verts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_verts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 282, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_t_3); - if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 282, __pyx_L1_error) + if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tri_data = __pyx_t_12; __pyx_t_12.memview = NULL; __pyx_t_12.data = NULL; - /* "yt/utilities/lib/mesh_triangulation.pyx":283 + /* "yt/utilities/lib/mesh_triangulation.pyx":284 * cdef np.int32_t[:] tri_indices = np.empty(num_verts, dtype=np.int32) * cdef np.float32_t[:] tri_data = np.empty(num_verts, dtype=np.float32) * cdef np.float32_t[:] tri_coords = np.empty(num_coords, dtype=np.float32) # <<<<<<<<<<<<<< * * cdef np.int64_t vert_index, i, j, k */ - __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, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_coords); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_coords); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 283, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_t_1); - if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 283, __pyx_L1_error) + if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tri_coords = __pyx_t_12; __pyx_t_12.memview = NULL; __pyx_t_12.data = NULL; - /* "yt/utilities/lib/mesh_triangulation.pyx":286 + /* "yt/utilities/lib/mesh_triangulation.pyx":287 * * cdef np.int64_t vert_index, i, j, k * for i in range(num_tri): # <<<<<<<<<<<<<< @@ -4712,7 +5100,7 @@ for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { __pyx_v_i = __pyx_t_15; - /* "yt/utilities/lib/mesh_triangulation.pyx":287 + /* "yt/utilities/lib/mesh_triangulation.pyx":288 * cdef np.int64_t vert_index, i, j, k * for i in range(num_tri): * for j in range(3): # <<<<<<<<<<<<<< @@ -4722,7 +5110,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_j = __pyx_t_16; - /* "yt/utilities/lib/mesh_triangulation.pyx":288 + /* "yt/utilities/lib/mesh_triangulation.pyx":289 * for i in range(num_tri): * for j in range(3): * vert_index = i*3 + j # <<<<<<<<<<<<<< @@ -4731,7 +5119,7 @@ */ __pyx_v_vert_index = ((__pyx_v_i * 3) + __pyx_v_j); - /* "yt/utilities/lib/mesh_triangulation.pyx":289 + /* "yt/utilities/lib/mesh_triangulation.pyx":290 * for j in range(3): * vert_index = i*3 + j * if data.ndim == 1: # <<<<<<<<<<<<<< @@ -4741,7 +5129,7 @@ __pyx_t_9 = ((__pyx_v_data->nd == 1) != 0); if (__pyx_t_9) { - /* "yt/utilities/lib/mesh_triangulation.pyx":290 + /* "yt/utilities/lib/mesh_triangulation.pyx":291 * vert_index = i*3 + j * if data.ndim == 1: * tri_data[vert_index] = vertex_data[element_map[i]] # <<<<<<<<<<<<<< @@ -4753,7 +5141,7 @@ __pyx_t_19 = __pyx_v_vert_index; *((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_tri_data.data + __pyx_t_19 * __pyx_v_tri_data.strides[0]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_vertex_data.data + __pyx_t_18 * __pyx_v_vertex_data.strides[0]) ))); - /* "yt/utilities/lib/mesh_triangulation.pyx":289 + /* "yt/utilities/lib/mesh_triangulation.pyx":290 * for j in range(3): * vert_index = i*3 + j * if data.ndim == 1: # <<<<<<<<<<<<<< @@ -4763,7 +5151,7 @@ goto __pyx_L10; } - /* "yt/utilities/lib/mesh_triangulation.pyx":292 + /* "yt/utilities/lib/mesh_triangulation.pyx":293 * tri_data[vert_index] = vertex_data[element_map[i]] * else: * tri_data[vert_index] = vertex_data[exterior_tris[i, j]] # <<<<<<<<<<<<<< @@ -4779,7 +5167,7 @@ } __pyx_L10:; - /* "yt/utilities/lib/mesh_triangulation.pyx":293 + /* "yt/utilities/lib/mesh_triangulation.pyx":294 * else: * tri_data[vert_index] = vertex_data[exterior_tris[i, j]] * tri_indices[vert_index] = vert_index # <<<<<<<<<<<<<< @@ -4789,7 +5177,7 @@ __pyx_t_24 = __pyx_v_vert_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_tri_indices.data + __pyx_t_24 * __pyx_v_tri_indices.strides[0]) )) = __pyx_v_vert_index; - /* "yt/utilities/lib/mesh_triangulation.pyx":294 + /* "yt/utilities/lib/mesh_triangulation.pyx":295 * tri_data[vert_index] = vertex_data[exterior_tris[i, j]] * tri_indices[vert_index] = vert_index * for k in range(3): # <<<<<<<<<<<<<< @@ -4799,7 +5187,7 @@ for (__pyx_t_25 = 0; __pyx_t_25 < 3; __pyx_t_25+=1) { __pyx_v_k = __pyx_t_25; - /* "yt/utilities/lib/mesh_triangulation.pyx":295 + /* "yt/utilities/lib/mesh_triangulation.pyx":296 * tri_indices[vert_index] = vert_index * for k in range(3): * tri_coords[vert_index*3 + k] = coords[exterior_tris[i, j], k] # <<<<<<<<<<<<<< @@ -4816,7 +5204,7 @@ } } - /* "yt/utilities/lib/mesh_triangulation.pyx":297 + /* "yt/utilities/lib/mesh_triangulation.pyx":298 * tri_coords[vert_index*3 + k] = coords[exterior_tris[i, j], k] * * return np.array(tri_coords), np.array(tri_data), np.array(tri_indices) # <<<<<<<<<<<<<< @@ -4824,12 +5212,12 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_tri_coords, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_tri_coords, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { @@ -4842,14 +5230,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __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_11)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __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; @@ -4858,31 +5246,31 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __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_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __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_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_tri_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_tri_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -4895,14 +5283,14 @@ } } if (!__pyx_t_2) { - __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_11); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5}; - __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4911,31 +5299,31 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5}; - __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __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_5); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_tri_indices, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_tri_indices, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -4948,14 +5336,14 @@ } } if (!__pyx_t_2) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __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_5)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -4964,26 +5352,26 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_31 = PyTuple_New(1+1); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_31 = PyTuple_New(1+1); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_31); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_31, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_31, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); @@ -4998,7 +5386,7 @@ __pyx_t_5 = 0; goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":258 + /* "yt/utilities/lib/mesh_triangulation.pyx":259 * @cython.boundscheck(False) * @cython.wraparound(False) * def triangulate_mesh(np.float64_t[:, ::1] coords, # <<<<<<<<<<<<<< @@ -5035,10 +5423,10 @@ return __pyx_r; } -/* "yt/utilities/lib/mesh_triangulation.pyx":301 +/* "yt/utilities/lib/mesh_triangulation.pyx":302 * @cython.boundscheck(False) * @cython.wraparound(False) - * def triangulate_indices(np.int64_t[:, ::1] indices): # <<<<<<<<<<<<<< + * def triangulate_indices(np.int_t[:, ::1] indices): # <<<<<<<<<<<<<< * ''' * */ @@ -5053,7 +5441,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("triangulate_indices (wrapper)", 0); assert(__pyx_arg_indices); { - __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(__pyx_arg_indices); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 301, __pyx_L3_error) + __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int_t(__pyx_arg_indices); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 302, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5071,9 +5459,9 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_18mesh_triangulation_6triangulate_indices(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_indices) { struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder *__pyx_v_m = 0; __Pyx_memviewslice __pyx_v_tri_indices = { 0, 0, { 0 }, { 0 }, { 0 } }; - __pyx_t_5numpy_int64_t __pyx_v_i; - __pyx_t_5numpy_int64_t __pyx_v_j; - __pyx_t_5numpy_int64_t __pyx_v_k; + __pyx_t_5numpy_int_t __pyx_v_i; + __pyx_t_5numpy_int_t __pyx_v_j; + __pyx_t_5numpy_int_t __pyx_v_k; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -5083,51 +5471,51 @@ PyObject *__pyx_t_5 = NULL; __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; __pyx_t_5numpy_int64_t __pyx_t_7; - __pyx_t_5numpy_int64_t __pyx_t_8; + __pyx_t_5numpy_int_t __pyx_t_8; __pyx_t_5numpy_int64_t __pyx_t_9; - __pyx_t_5numpy_int64_t __pyx_t_10; - __pyx_t_5numpy_int64_t __pyx_t_11; - __pyx_t_5numpy_int64_t __pyx_t_12; + __pyx_t_5numpy_int_t __pyx_t_10; + __pyx_t_5numpy_int_t __pyx_t_11; + Py_ssize_t __pyx_t_12; Py_ssize_t __pyx_t_13; __pyx_t_5numpy_int64_t __pyx_t_14; - __pyx_t_5numpy_int64_t __pyx_t_15; + Py_ssize_t __pyx_t_15; __Pyx_RefNannySetupContext("triangulate_indices", 0); - /* "yt/utilities/lib/mesh_triangulation.pyx":310 + /* "yt/utilities/lib/mesh_triangulation.pyx":311 * ''' * * cdef MeshInfoHolder m = MeshInfoHolder(indices) # <<<<<<<<<<<<<< - * cdef np.int64_t[:, ::1] tri_indices = np.empty((m.num_tri, 3), dtype=np.int64) + * cdef np.int_t[:, ::1] tri_indices = np.empty((m.num_tri, 3), dtype=np.int_) * */ - __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indices, 2, (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, 310, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indices, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __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_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_m = ((struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/mesh_triangulation.pyx":311 + /* "yt/utilities/lib/mesh_triangulation.pyx":312 * * cdef MeshInfoHolder m = MeshInfoHolder(indices) - * cdef np.int64_t[:, ::1] tri_indices = np.empty((m.num_tri, 3), dtype=np.int64) # <<<<<<<<<<<<<< + * cdef np.int_t[:, ::1] tri_indices = np.empty((m.num_tri, 3), dtype=np.int_) # <<<<<<<<<<<<<< * - * cdef np.int64_t i, j, k + * cdef np.int_t i, j, k */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __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, 311, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_m->num_tri); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_m->num_tri); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -5135,35 +5523,35 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __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, 311, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __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, 311, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 312, __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, 311, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __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_d_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_5); - if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int_t(__pyx_t_5); + if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_tri_indices = __pyx_t_6; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL; - /* "yt/utilities/lib/mesh_triangulation.pyx":314 + /* "yt/utilities/lib/mesh_triangulation.pyx":315 * - * cdef np.int64_t i, j, k + * cdef np.int_t i, j, k * for i in range(m.num_elem): # <<<<<<<<<<<<<< * for j in range(m.TPE): * for k in range(3): @@ -5172,8 +5560,8 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "yt/utilities/lib/mesh_triangulation.pyx":315 - * cdef np.int64_t i, j, k + /* "yt/utilities/lib/mesh_triangulation.pyx":316 + * cdef np.int_t i, j, k * for i in range(m.num_elem): * for j in range(m.TPE): # <<<<<<<<<<<<<< * for k in range(3): @@ -5183,7 +5571,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_j = __pyx_t_10; - /* "yt/utilities/lib/mesh_triangulation.pyx":316 + /* "yt/utilities/lib/mesh_triangulation.pyx":317 * for i in range(m.num_elem): * for j in range(m.TPE): * for k in range(3): # <<<<<<<<<<<<<< @@ -5193,7 +5581,7 @@ for (__pyx_t_11 = 0; __pyx_t_11 < 3; __pyx_t_11+=1) { __pyx_v_k = __pyx_t_11; - /* "yt/utilities/lib/mesh_triangulation.pyx":317 + /* "yt/utilities/lib/mesh_triangulation.pyx":318 * for j in range(m.TPE): * for k in range(3): * tri_indices[i*m.TPE + j, k] = indices[i, m.tri_array[j][k]] # <<<<<<<<<<<<<< @@ -5203,23 +5591,23 @@ __pyx_t_13 = ((__pyx_v_m->tri_array[__pyx_v_j])[__pyx_v_k]); __pyx_t_14 = ((__pyx_v_i * __pyx_v_m->TPE) + __pyx_v_j); __pyx_t_15 = __pyx_v_k; - *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_tri_indices.data + __pyx_t_14 * __pyx_v_tri_indices.strides[0]) )) + __pyx_t_15)) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_12 * __pyx_v_indices.strides[0]) )) + __pyx_t_13)) ))); + *((__pyx_t_5numpy_int_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_tri_indices.data + __pyx_t_14 * __pyx_v_tri_indices.strides[0]) )) + __pyx_t_15)) )) = (*((__pyx_t_5numpy_int_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_12 * __pyx_v_indices.strides[0]) )) + __pyx_t_13)) ))); } } } - /* "yt/utilities/lib/mesh_triangulation.pyx":318 + /* "yt/utilities/lib/mesh_triangulation.pyx":319 * for k in range(3): * tri_indices[i*m.TPE + j, k] = indices[i, m.tri_array[j][k]] * return np.array(tri_indices) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_tri_indices, 2, (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_3)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_tri_indices, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -5232,14 +5620,14 @@ } } if (!__pyx_t_2) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __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, 318, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __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; @@ -5248,20 +5636,20 @@ #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, 318, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __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, 318, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __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, 318, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -5271,10 +5659,10 @@ __pyx_t_5 = 0; goto __pyx_L0; - /* "yt/utilities/lib/mesh_triangulation.pyx":301 + /* "yt/utilities/lib/mesh_triangulation.pyx":302 * @cython.boundscheck(False) * @cython.wraparound(False) - * def triangulate_indices(np.int64_t[:, ::1] indices): # <<<<<<<<<<<<<< + * def triangulate_indices(np.int_t[:, ::1] indices): # <<<<<<<<<<<<<< * ''' * */ @@ -5467,11 +5855,11 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + __PYX_ERR(2, 218, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 @@ -5523,11 +5911,11 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + __PYX_ERR(2, 222, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") @@ -5832,11 +6220,11 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + __PYX_ERR(2, 259, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: @@ -6043,22 +6431,22 @@ * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) + __PYX_ERR(2, 278, __pyx_L1_error) break; } @@ -6125,7 +6513,7 @@ * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 @@ -6284,7 +6672,7 @@ * 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, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6331,7 +6719,7 @@ * 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, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6378,7 +6766,7 @@ * 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, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6425,7 +6813,7 @@ * 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, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6472,7 +6860,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6553,15 +6941,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) + __PYX_ERR(2, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + __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, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -6576,11 +6964,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) + __PYX_ERR(2, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -6601,7 +6989,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __pyx_L1_error) + __PYX_ERR(2, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -6609,15 +6997,15 @@ __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, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -6630,12 +7018,12 @@ * 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, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -6647,11 +7035,11 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) + __PYX_ERR(2, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -6715,11 +7103,11 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __PYX_ERR(2, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -6738,11 +7126,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -6802,7 +7190,7 @@ * 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, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -6824,11 +7212,11 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __PYX_ERR(2, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -6846,11 +7234,11 @@ * 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, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -6864,11 +7252,11 @@ * 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, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -6882,11 +7270,11 @@ * 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, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -6900,11 +7288,11 @@ * 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, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -6918,11 +7306,11 @@ * 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, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -6936,11 +7324,11 @@ * 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, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -6954,11 +7342,11 @@ * 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, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -6972,11 +7360,11 @@ * 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, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -6990,11 +7378,11 @@ * 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, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -7008,11 +7396,11 @@ * 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, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -7026,11 +7414,11 @@ * 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, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -7044,11 +7432,11 @@ * 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, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -7062,11 +7450,11 @@ * 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, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -7080,11 +7468,11 @@ * 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, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -7100,11 +7488,11 @@ * 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, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -7120,11 +7508,11 @@ * 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, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -7140,11 +7528,11 @@ * 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, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -7159,19 +7547,19 @@ * 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, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) + __PYX_ERR(2, 844, __pyx_L1_error) } __pyx_L15:; @@ -7202,7 +7590,7 @@ * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; @@ -7466,7 +7854,7 @@ * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 * # Cython code. @@ -7479,7 +7867,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7493,7 +7881,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -7505,11 +7893,11 @@ * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) + __PYX_ERR(2, 989, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -7527,7 +7915,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -7597,7 +7985,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * @@ -7610,7 +7998,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7624,7 +8012,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -7636,11 +8024,11 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) + __PYX_ERR(2, 995, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -7658,7 +8046,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -7728,7 +8116,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * @@ -7741,7 +8129,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7754,7 +8142,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -7764,11 +8152,11 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) + __PYX_ERR(2, 1001, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -7786,7 +8174,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -7840,10 +8228,15 @@ 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; } @@ -7852,21 +8245,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -7874,12 +8271,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -7888,11 +8287,11 @@ } } __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, 120, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) } else { /* "View.MemoryView":121 @@ -7907,15 +8306,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __pyx_L1_error) } __pyx_r = __pyx_array___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); @@ -7966,9 +8365,9 @@ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(2, 127, __pyx_L1_error) + __PYX_ERR(1, 127, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 @@ -7997,11 +8396,11 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 131, __pyx_L1_error) + __PYX_ERR(1, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize @@ -8029,11 +8428,11 @@ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 134, __pyx_L1_error) + __PYX_ERR(1, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") @@ -8062,9 +8461,9 @@ * 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, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -8086,7 +8485,7 @@ * 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, 138, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) __pyx_t_5 = __pyx_v_format; __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -8102,7 +8501,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -8140,11 +8539,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 146, __pyx_L1_error) + __PYX_ERR(1, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim @@ -8167,12 +8566,12 @@ 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, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dim = __pyx_t_8; __pyx_v_idx = __pyx_t_7; @@ -8195,11 +8594,11 @@ * self._shape[idx] = dim * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); @@ -8207,20 +8606,20 @@ 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, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(2, 151, __pyx_L1_error) + __PYX_ERR(1, 151, __pyx_L1_error) /* "View.MemoryView":150 * @@ -8257,7 +8656,7 @@ * 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, 155, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":156 @@ -8299,7 +8698,7 @@ * 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, 158, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":159 @@ -8342,19 +8741,19 @@ * 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, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 162, __pyx_L1_error) + __PYX_ERR(1, 162, __pyx_L1_error) } __pyx_L10:; @@ -8383,8 +8782,8 @@ * if allocate_buffer: * */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; @@ -8424,11 +8823,11 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 174, __pyx_L1_error) + __PYX_ERR(1, 174, __pyx_L1_error) /* "View.MemoryView":173 * @@ -8467,11 +8866,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __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, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { @@ -8592,7 +8991,7 @@ * 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, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -8622,7 +9021,7 @@ * 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, 187, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { @@ -8662,11 +9061,11 @@ * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 190, __pyx_L1_error) + __PYX_ERR(1, 190, __pyx_L1_error) /* "View.MemoryView":189 * elif self.mode == u"fortran": @@ -9006,7 +9405,7 @@ * @cname('get_memview') */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9065,11 +9464,11 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -9080,7 +9479,7 @@ 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, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -9144,9 +9543,9 @@ * 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, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -9209,9 +9608,9 @@ * 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, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -9272,9 +9671,9 @@ * * */ - __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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":235 @@ -9297,6 +9696,113 @@ 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(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__22, 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":240 * * @cname("__pyx_array_new") @@ -9333,13 +9839,13 @@ * 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, 245, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -9353,7 +9859,7 @@ __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, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -9377,13 +9883,13 @@ * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -9405,9 +9911,9 @@ * result.data = buf * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) /* "View.MemoryView":247 * result = array(shape, itemsize, format, mode.decode('ASCII')) @@ -9416,7 +9922,7 @@ * 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, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9492,6 +9998,7 @@ 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; } @@ -9502,7 +10009,7 @@ 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, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -9513,7 +10020,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -9611,78 +10118,365 @@ return __pyx_r; } -/* "View.MemoryView":294 - * - * @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 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.name,) */ -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; +/* 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)); - /* "View.MemoryView":296 - * cdef void *align_pointer(void *memory, size_t alignment) nogil: - * "Align pointer memory on a given boundary" - * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< - * cdef size_t offset - * + /* 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_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); + __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; - /* "View.MemoryView":300 - * - * with cython.cdivision(True): - * offset = aligned_p % alignment # <<<<<<<<<<<<<< - * - * if offset > 0: + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += _dict, */ - __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + __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; - /* "View.MemoryView":302 - * offset = aligned_p % alignment - * - * if offset > 0: # <<<<<<<<<<<<<< - * aligned_p += alignment - offset - * + /* "(tree fragment)":5 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - __pyx_t_1 = ((__pyx_v_offset > 0) != 0); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { - /* "View.MemoryView":303 - * - * if offset > 0: - * aligned_p += alignment - offset # <<<<<<<<<<<<<< - * - * return aligned_p + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += _dict, # <<<<<<<<<<<<<< + * use_setstate = True + * else: */ - __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); + __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; - /* "View.MemoryView":302 - * offset = aligned_p % alignment - * - * if offset > 0: # <<<<<<<<<<<<<< - * aligned_p += alignment - offset - * + /* "(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; - /* "View.MemoryView":305 - * aligned_p += alignment - offset - * - * return aligned_p # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":5 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += _dict, + * use_setstate = True */ - __pyx_r = ((void *)__pyx_v_aligned_p); - goto __pyx_L0; + goto __pyx_L3; + } - /* "View.MemoryView":294 - * + /* "(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":294 + * + * @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":296 + * 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":300 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":302 + * 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":303 + * + * 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":302 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":305 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":294 + * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< * "Align pointer memory on a given boundary" @@ -9719,8 +10513,11 @@ 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; } @@ -9729,11 +10526,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -9741,11 +10540,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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; @@ -9753,16 +10553,16 @@ } } __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, 341, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -9833,7 +10633,7 @@ * 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 == -1)) __PYX_ERR(2, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) /* "View.MemoryView":346 * if type(self) is memoryview or obj is not None: @@ -9954,7 +10754,7 @@ * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) /* "View.MemoryView":356 * if self.lock is NULL: @@ -10295,26 +11095,26 @@ __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, 389, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -10324,7 +11124,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 389, __pyx_L1_error) + else __PYX_ERR(1, 389, __pyx_L1_error) } break; } @@ -10342,8 +11142,8 @@ * * 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, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":389 @@ -10460,7 +11260,7 @@ * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -10472,7 +11272,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 399, __pyx_L1_error) + __PYX_ERR(1, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -10480,14 +11280,14 @@ __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, 399, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; @@ -10501,7 +11301,7 @@ * 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, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":403 @@ -10512,7 +11312,7 @@ * 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, 403, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -10535,7 +11335,7 @@ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 405, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":406 @@ -10546,7 +11346,7 @@ * 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, 406, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -10616,7 +11416,7 @@ * * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __pyx_L1_error) + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; @@ -10628,7 +11428,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 409, __pyx_L1_error) + __PYX_ERR(1, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); @@ -10636,14 +11436,14 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; @@ -10657,7 +11457,7 @@ * obj = self.is_slice(value) * if obj: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":412 @@ -10667,7 +11467,7 @@ * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 412, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; @@ -10679,7 +11479,7 @@ * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":414 @@ -10689,9 +11489,9 @@ * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -10714,10 +11514,10 @@ * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 416, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10742,7 +11542,7 @@ * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 418, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -10830,7 +11630,7 @@ * 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, 423, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":424 @@ -10840,7 +11640,7 @@ * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":423 @@ -10850,7 +11650,7 @@ * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -10861,7 +11661,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, 423, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -10878,7 +11678,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -10895,7 +11695,7 @@ __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, 425, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); @@ -10938,7 +11738,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -11010,7 +11810,7 @@ * 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, 434, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":435 * @@ -11019,7 +11819,7 @@ * 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, 435, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) /* "View.MemoryView":436 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], @@ -11028,13 +11828,13 @@ * * 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, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":434 @@ -11044,7 +11844,7 @@ * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 434, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":430 * return obj @@ -11150,7 +11950,7 @@ * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) /* "View.MemoryView":449 * if self.view.itemsize > sizeof(array): @@ -11238,7 +12038,7 @@ * */ /*else*/ { - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 459, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 459, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -11261,7 +12061,7 @@ * 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, 464, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11376,7 +12176,7 @@ * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 471, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":472 @@ -11386,7 +12186,7 @@ * * 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, 472, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11445,7 +12245,7 @@ * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -11457,7 +12257,7 @@ * 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, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -11485,9 +12285,9 @@ * 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, 482, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -11504,7 +12304,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -11513,14 +12313,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -11531,7 +12331,7 @@ __Pyx_GIVEREF(__pyx_v_bytesitem); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -11568,7 +12368,7 @@ * */ __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, 487, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11610,13 +12410,13 @@ * raise ValueError("Unable to convert item to object") * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); @@ -11628,11 +12428,11 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 484, __pyx_L5_except_error) + __PYX_ERR(1, 484, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -11723,7 +12523,7 @@ * 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, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -11746,26 +12546,26 @@ * 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, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 499, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -11787,9 +12587,9 @@ * 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, 501, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -11806,7 +12606,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11815,14 +12615,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -11833,12 +12633,12 @@ __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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, 501, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 501, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } @@ -11854,7 +12654,7 @@ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(2, 503, __pyx_L1_error) + __PYX_ERR(1, 503, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -12241,9 +13041,9 @@ * 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, 540, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; @@ -12254,7 +13054,7 @@ * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) /* "View.MemoryView":542 * cdef _memoryviewslice result = memoryview_copy(self) @@ -12381,18 +13181,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { __pyx_t_2 = __pyx_t_4; __pyx_v_length = (__pyx_t_2[0]); - __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; @@ -12469,11 +13269,11 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 556, __pyx_L1_error) + __PYX_ERR(1, 556, __pyx_L1_error) /* "View.MemoryView":554 * @property @@ -12492,18 +13292,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; __pyx_v_stride = (__pyx_t_3[0]); - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; @@ -12581,9 +13381,9 @@ * 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, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__19, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__25, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -12607,18 +13407,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -12680,7 +13480,7 @@ * @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, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -12740,7 +13540,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -12802,11 +13602,11 @@ * @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, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12900,7 +13700,7 @@ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; - __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; @@ -12912,7 +13712,7 @@ * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; @@ -13090,12 +13890,12 @@ * */ __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, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -13106,12 +13906,12 @@ * * def __str__(self): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -13122,7 +13922,7 @@ * id(self)) * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -13130,7 +13930,7 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -13194,20 +13994,20 @@ * */ __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, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -13280,7 +14080,7 @@ * 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, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -13351,7 +14151,7 @@ * 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, 615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -13431,7 +14231,7 @@ * 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, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":627 @@ -13442,7 +14242,7 @@ * 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, 627, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -13523,7 +14323,7 @@ * 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, 634, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":639 @@ -13534,7 +14334,7 @@ * */ __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, 639, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -13559,6 +14359,113 @@ 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__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.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__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.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "View.MemoryView":643 * * @cname('__pyx_memoryview_new') @@ -13583,11 +14490,11 @@ * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -13598,7 +14505,7 @@ 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, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); @@ -13735,7 +14642,7 @@ * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -13773,7 +14680,7 @@ * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -13809,26 +14716,26 @@ __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, 665, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -13838,7 +14745,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 665, __pyx_L1_error) + else __PYX_ERR(1, 665, __pyx_L1_error) } break; } @@ -13848,7 +14755,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, 665, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -13882,17 +14789,17 @@ * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 668, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__20); + __Pyx_INCREF(__pyx_slice__28); + __Pyx_GIVEREF(__pyx_slice__28); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__28); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":669 @@ -13922,7 +14829,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__21); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__29); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) } __pyx_L7:; @@ -13972,19 +14879,19 @@ * * 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, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(2, 675, __pyx_L1_error) + __PYX_ERR(1, 675, __pyx_L1_error) /* "View.MemoryView":674 * have_slices = True @@ -14021,7 +14928,7 @@ * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) } __pyx_L6:; @@ -14043,7 +14950,7 @@ * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":681 @@ -14063,16 +14970,16 @@ * * 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, 682, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__22); - __Pyx_GIVEREF(__pyx_slice__22); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__22); + __Pyx_INCREF(__pyx_slice__30); + __Pyx_GIVEREF(__pyx_slice__30); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__30); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":681 @@ -14094,20 +15001,20 @@ __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, 684, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -14193,11 +15100,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 689, __pyx_L1_error) + __PYX_ERR(1, 689, __pyx_L1_error) /* "View.MemoryView":688 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): @@ -14301,7 +15208,7 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(2, 708, __pyx_L1_error) + __PYX_ERR(1, 708, __pyx_L1_error) } } #endif @@ -14324,7 +15231,7 @@ * 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, 711, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -14420,26 +15327,26 @@ __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, 732, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -14449,7 +15356,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 732, __pyx_L1_error) + else __PYX_ERR(1, 732, __pyx_L1_error) } break; } @@ -14477,7 +15384,7 @@ * 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, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) /* "View.MemoryView":734 * for dim, index in enumerate(indices): @@ -14486,7 +15393,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 734, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) /* "View.MemoryView":733 * @@ -14563,13 +15470,13 @@ * 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, 746, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -14585,13 +15492,13 @@ * 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, 747, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -14607,13 +15514,13 @@ * * 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, 748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -14629,7 +15536,7 @@ * 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, 750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -14642,7 +15549,7 @@ * 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, 751, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -14655,7 +15562,7 @@ * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -14668,7 +15575,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 754, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) /* "View.MemoryView":760 * have_start, have_stop, have_step, @@ -14718,7 +15625,7 @@ * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } /* "View.MemoryView":765 * return memoryview_fromslice(dst, new_ndim, @@ -14727,7 +15634,7 @@ * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } /* "View.MemoryView":763 * @@ -14736,9 +15643,9 @@ * 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, 763, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -14769,7 +15676,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 768, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":768 @@ -14779,7 +15686,7 @@ * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -14882,7 +15789,7 @@ * 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 == -1)) __PYX_ERR(2, 818, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: @@ -14947,7 +15854,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) /* "View.MemoryView":823 * negative_step = have_step != 0 and step < 0 @@ -15519,7 +16426,7 @@ * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) } __pyx_L26:; @@ -15576,11 +16483,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -15648,11 +16555,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __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, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); @@ -15760,22 +16667,22 @@ * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 914, __pyx_L1_error) + __PYX_ERR(1, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: @@ -15812,22 +16719,22 @@ * * resultp = bufp + index * stride */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 917, __pyx_L1_error) + __PYX_ERR(1, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) @@ -16027,7 +16934,7 @@ * * return 1 */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error) + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] @@ -16061,11 +16968,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -16150,7 +17057,7 @@ * 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, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -16174,7 +17081,7 @@ */ /*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, 969, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -16233,7 +17140,7 @@ * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) /* "View.MemoryView":972 * @@ -16253,7 +17160,7 @@ * @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, 975, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -16333,36 +17240,143 @@ return __pyx_r; } -/* "View.MemoryView":985 - * - * @cname('__pyx_memoryview_fromslice') - * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< - * int ndim, - * object (*to_object_func)(char *), +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -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; +/* 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 - 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); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); - /* "View.MemoryView":993 - * cdef _memoryviewslice result - * - * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< - * return None + /* 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__32, 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__33, 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":985 + * + * @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":993 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None * */ __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); @@ -16396,9 +17410,9 @@ * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -16409,7 +17423,7 @@ __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, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -16440,7 +17454,7 @@ * 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, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -16611,7 +17625,7 @@ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { __pyx_t_6 = __pyx_t_8; - __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1026, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; @@ -16623,12 +17637,12 @@ * * 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, 1027, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } @@ -16720,7 +17734,7 @@ * 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, 1039, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -16777,7 +17791,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -16941,7 +17955,7 @@ * @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, 1067, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -17064,7 +18078,7 @@ * * */ - __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1084, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; @@ -17862,7 +18876,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) /* "View.MemoryView":1207 * @@ -18034,11 +19048,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -18062,7 +19076,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -18073,13 +19087,13 @@ * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -18098,20 +19112,20 @@ * (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, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 1237, __pyx_L1_error) + __PYX_ERR(1, 1237, __pyx_L1_error) /* "View.MemoryView":1235 * @@ -18131,7 +19145,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -18153,7 +19167,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -18165,11 +19179,11 @@ * * @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, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -18185,14 +19199,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -18201,20 +19215,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -18222,7 +19236,7 @@ __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, 1242, __pyx_L1_error) + __PYX_ERR(1, 1242, __pyx_L1_error) /* "View.MemoryView":1241 * @@ -18244,7 +19258,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -18267,7 +19281,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -18289,7 +19303,7 @@ * 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, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -18303,14 +19317,14 @@ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -18319,20 +19333,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -18340,7 +19354,7 @@ __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, 1247, __pyx_L1_error) + __PYX_ERR(1, 1247, __pyx_L1_error) /* "View.MemoryView":1246 * @cname('__pyx_memoryview_err') @@ -18360,7 +19374,7 @@ */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(2, 1249, __pyx_L1_error) + __PYX_ERR(1, 1249, __pyx_L1_error) } /* "View.MemoryView":1245 @@ -18383,7 +19397,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -18601,7 +19615,7 @@ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1281, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) } __pyx_L7:; @@ -18631,7 +19645,7 @@ * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) /* "View.MemoryView":1283 * _err_extents(i, dst.shape[i], src.shape[i]) @@ -18688,7 +19702,7 @@ * src = tmp * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1291, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1292 @@ -18872,7 +19886,7 @@ * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) /* "View.MemoryView":1314 * @@ -18881,7 +19895,7 @@ * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) /* "View.MemoryView":1310 * return 0 @@ -18950,11 +19964,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -19134,7 +20148,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -19158,7 +20172,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -19467,133 +20481,600 @@ /* function exit code */ } -static struct __pyx_vtabstruct_2yt_9utilities_3lib_18mesh_triangulation_TriSet __pyx_vtable_2yt_9utilities_3lib_18mesh_triangulation_TriSet; -static PyObject *__pyx_tp_new_2yt_9utilities_3lib_18mesh_triangulation_TriSet(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *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_2yt_9utilities_3lib_18mesh_triangulation_TriSet *)o); - p->__pyx_vtab = __pyx_vtabptr_2yt_9utilities_3lib_18mesh_triangulation_TriSet; - if (unlikely(__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; - return NULL; -} +/* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ -static void __pyx_tp_dealloc_2yt_9utilities_3lib_18mesh_triangulation_TriSet(PyObject *o) { - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif +/* 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); { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_3__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - (*Py_TYPE(o)->tp_free)(o); -} - -static PyMethodDef __pyx_methods_2yt_9utilities_3lib_18mesh_triangulation_TriSet[] = { - {"get_exterior_tris", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_5get_exterior_tris, METH_NOARGS, __pyx_doc_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_4get_exterior_tris}, - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_2yt_9utilities_3lib_18mesh_triangulation_TriSet = { - PyVarObject_HEAD_INIT(0, 0) - "yt.utilities.lib.mesh_triangulation.TriSet", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_9utilities_3lib_18mesh_triangulation_TriSet, /*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*/ - "\n\n This is a hash table data structure for rapidly identifying the exterior\n triangles in a polygon mesh. We loop over each triangle in each element and\n update the TriSet for each one. We keep only the triangles that appear once,\n as these make up the exterior of the mesh.\n\n ", /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_2yt_9utilities_3lib_18mesh_triangulation_TriSet, /*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*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_9utilities_3lib_18mesh_triangulation_TriSet, /*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_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder(PyTypeObject *t, PyObject *a, PyObject *k) { - 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); + 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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]; } - if (unlikely(!o)) return 0; - if (unlikely(__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_1__cinit__(o, a, k) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; + 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); -static void __pyx_tp_dealloc_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder(PyObject *o) { - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - (*Py_TYPE(o)->tp_free)(o); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static PyMethodDef __pyx_methods_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder[] = { - {0, 0, 0, 0} -}; +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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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_2yt_9utilities_3lib_18mesh_triangulation_TriSet __pyx_vtable_2yt_9utilities_3lib_18mesh_triangulation_TriSet; + +static PyObject *__pyx_tp_new_2yt_9utilities_3lib_18mesh_triangulation_TriSet(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *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_2yt_9utilities_3lib_18mesh_triangulation_TriSet *)o); + p->__pyx_vtab = __pyx_vtabptr_2yt_9utilities_3lib_18mesh_triangulation_TriSet; + if (unlikely(__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_2yt_9utilities_3lib_18mesh_triangulation_TriSet(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + 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_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_2yt_9utilities_3lib_18mesh_triangulation_TriSet[] = { + {"get_exterior_tris", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_5get_exterior_tris, METH_NOARGS, __pyx_doc_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_4get_exterior_tris}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_9__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_2yt_9utilities_3lib_18mesh_triangulation_TriSet = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.mesh_triangulation.TriSet", /*tp_name*/ + sizeof(struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_2yt_9utilities_3lib_18mesh_triangulation_TriSet, /*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*/ + "\n\n This is a hash table data structure for rapidly identifying the exterior\n triangles in a polygon mesh. We loop over each triangle in each element and\n update the TriSet for each one. We keep only the triangles that appear once,\n as these make up the exterior of the mesh.\n\n ", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_2yt_9utilities_3lib_18mesh_triangulation_TriSet, /*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*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_2yt_9utilities_3lib_18mesh_triangulation_TriSet, /*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_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder(PyTypeObject *t, PyObject *a, PyObject *k) { + 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; + if (unlikely(__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + 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_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18mesh_triangulation_14MeshInfoHolder_5__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; static PyTypeObject __pyx_type_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder = { PyVarObject_HEAD_INIT(0, 0) @@ -19677,7 +21158,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -19727,6 +21208,8 @@ 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} }; @@ -19846,7 +21329,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -19874,6 +21357,8 @@ } 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} }; @@ -19961,7 +21446,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -20073,6 +21558,8 @@ {"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} }; @@ -20198,7 +21685,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -20242,6 +21729,8 @@ } 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} }; @@ -20348,6 +21837,7 @@ {&__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}, @@ -20358,11 +21848,12 @@ {&__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_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_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 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_YTElementTypeNotRecognized, __pyx_k_YTElementTypeNotRecognized, sizeof(__pyx_k_YTElementTypeNotRecognized), 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}, @@ -20371,11 +21862,13 @@ {&__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_n_s_cull_interior_triangles, __pyx_k_cull_interior_triangles, sizeof(__pyx_k_cull_interior_triangles), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 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_element_map, __pyx_k_element_map, sizeof(__pyx_k_element_map), 0, 0, 1, 1}, @@ -20396,6 +21889,7 @@ {&__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_int, __pyx_k_int, sizeof(__pyx_k_int), 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_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, @@ -20411,6 +21905,8 @@ {&__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_num_coords, __pyx_k_num_coords, sizeof(__pyx_k_num_coords), 0, 0, 1, 1}, {&__pyx_n_s_num_tri, __pyx_k_num_tri, sizeof(__pyx_k_num_tri), 0, 0, 1, 1}, @@ -20420,10 +21916,18 @@ {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 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_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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 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_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, @@ -20432,6 +21936,7 @@ {&__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_tri, __pyx_k_tri, sizeof(__pyx_k_tri), 0, 0, 1, 1}, @@ -20444,24 +21949,26 @@ {&__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}, {&__pyx_n_s_vert_index, __pyx_k_vert_index, sizeof(__pyx_k_vert_index), 0, 0, 1, 1}, {&__pyx_n_s_vertex_data, __pyx_k_vertex_data, sizeof(__pyx_k_vertex_data), 0, 0, 1, 1}, {&__pyx_n_s_yt_utilities_exceptions, __pyx_k_yt_utilities_exceptions, sizeof(__pyx_k_yt_utilities_exceptions), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_mesh_triangulat, __pyx_k_yt_utilities_lib_mesh_triangulat, sizeof(__pyx_k_yt_utilities_lib_mesh_triangulat), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_mesh_triangulat, __pyx_k_yt_utilities_lib_mesh_triangulat, sizeof(__pyx_k_yt_utilities_lib_mesh_triangulat), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_mesh_triangulat_2, __pyx_k_yt_utilities_lib_mesh_triangulat_2, sizeof(__pyx_k_yt_utilities_lib_mesh_triangulat_2), 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, 45, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 425, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 46, __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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -20471,16 +21978,54 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "yt/utilities/lib/mesh_triangulation.pyx":279 + /* "(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_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(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__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "(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__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "(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__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "yt/utilities/lib/mesh_triangulation.pyx":280 * vertex_data = get_vertex_data(coords, data, indices) * else: * vertex_data = data.astype("float32") # <<<<<<<<<<<<<< * * cdef np.int32_t[:] tri_indices = np.empty(num_verts, dtype=np.int32) */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_float32); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_float32); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -20489,9 +22034,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -20500,9 +22045,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -20511,9 +22056,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -20522,9 +22067,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -20533,9 +22078,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -20544,9 +22089,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -20555,9 +22100,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -20566,18 +22111,18 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); /* "View.MemoryView":131 * @@ -20586,9 +22131,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); /* "View.MemoryView":134 * @@ -20597,9 +22142,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); /* "View.MemoryView":137 * @@ -20608,9 +22153,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "View.MemoryView":146 * @@ -20619,9 +22164,9 @@ * * */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -20630,9 +22175,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -20641,9 +22186,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 190, __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(1, 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(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -20652,9 +22216,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -20663,9 +22227,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "View.MemoryView":563 * def suboffsets(self): @@ -20674,12 +22238,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__19 = PyTuple_New(1); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); + __pyx_tuple__25 = PyTuple_New(1); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__19, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__19); + PyTuple_SET_ITEM(__pyx_tuple__25, 0, __pyx_int_neg_1); + __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":668 * if item is Ellipsis: @@ -20688,9 +22271,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__20 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(2, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); + __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__28); + __Pyx_GIVEREF(__pyx_slice__28); /* "View.MemoryView":671 * seen_ellipsis = True @@ -20699,9 +22282,9 @@ * have_slices = True * else: */ - __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(2, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__21); - __Pyx_GIVEREF(__pyx_slice__21); + __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -20710,9 +22293,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(2, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__22); - __Pyx_GIVEREF(__pyx_slice__22); + __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__30); + __Pyx_GIVEREF(__pyx_slice__30); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -20721,57 +22304,76 @@ * * */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "(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__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "(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__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); - /* "yt/utilities/lib/mesh_triangulation.pyx":211 + /* "yt/utilities/lib/mesh_triangulation.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def cull_interior_triangles(np.int64_t[:, ::1] indices): # <<<<<<<<<<<<<< * ''' * */ - __pyx_tuple__24 = PyTuple_Pack(8, __pyx_n_s_indices, __pyx_n_s_indices, __pyx_n_s_m, __pyx_n_s_s, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_tri); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_cull_interior_triangles, 211, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(8, __pyx_n_s_indices, __pyx_n_s_indices, __pyx_n_s_m, __pyx_n_s_s, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_tri); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_mesh_triangulat, __pyx_n_s_cull_interior_triangles, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 212, __pyx_L1_error) - /* "yt/utilities/lib/mesh_triangulation.pyx":234 + /* "yt/utilities/lib/mesh_triangulation.pyx":235 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_vertex_data(np.float64_t[:, ::1] coords, # <<<<<<<<<<<<<< * np.float64_t[:, ::1] data, * np.int64_t[:, ::1] indices): */ - __pyx_tuple__26 = PyTuple_Pack(8, __pyx_n_s_coords, __pyx_n_s_data, __pyx_n_s_indices, __pyx_n_s_m, __pyx_n_s_num_verts, __pyx_n_s_vertex_data, __pyx_n_s_i, __pyx_n_s_j); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_get_vertex_data, 234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_tuple__36 = PyTuple_Pack(8, __pyx_n_s_coords, __pyx_n_s_data, __pyx_n_s_indices, __pyx_n_s_m, __pyx_n_s_num_verts, __pyx_n_s_vertex_data, __pyx_n_s_i, __pyx_n_s_j); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_mesh_triangulat, __pyx_n_s_get_vertex_data, 235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 235, __pyx_L1_error) - /* "yt/utilities/lib/mesh_triangulation.pyx":258 + /* "yt/utilities/lib/mesh_triangulation.pyx":259 * @cython.boundscheck(False) * @cython.wraparound(False) * def triangulate_mesh(np.float64_t[:, ::1] coords, # <<<<<<<<<<<<<< * np.ndarray data, * np.int64_t[:, ::1] indices): */ - __pyx_tuple__28 = PyTuple_Pack(16, __pyx_n_s_coords, __pyx_n_s_data, __pyx_n_s_indices, __pyx_n_s_exterior_tris, __pyx_n_s_element_map, __pyx_n_s_num_tri, __pyx_n_s_num_verts, __pyx_n_s_num_coords, __pyx_n_s_vertex_data, __pyx_n_s_tri_indices, __pyx_n_s_tri_data, __pyx_n_s_tri_coords, __pyx_n_s_vert_index, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_triangulate_mesh, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(16, __pyx_n_s_coords, __pyx_n_s_data, __pyx_n_s_indices, __pyx_n_s_exterior_tris, __pyx_n_s_element_map, __pyx_n_s_num_tri, __pyx_n_s_num_verts, __pyx_n_s_num_coords, __pyx_n_s_vertex_data, __pyx_n_s_tri_indices, __pyx_n_s_tri_data, __pyx_n_s_tri_coords, __pyx_n_s_vert_index, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_mesh_triangulat, __pyx_n_s_triangulate_mesh, 259, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 259, __pyx_L1_error) - /* "yt/utilities/lib/mesh_triangulation.pyx":301 + /* "yt/utilities/lib/mesh_triangulation.pyx":302 * @cython.boundscheck(False) * @cython.wraparound(False) - * def triangulate_indices(np.int64_t[:, ::1] indices): # <<<<<<<<<<<<<< + * def triangulate_indices(np.int_t[:, ::1] indices): # <<<<<<<<<<<<<< * ''' * */ - __pyx_tuple__30 = PyTuple_Pack(7, __pyx_n_s_indices, __pyx_n_s_indices, __pyx_n_s_m, __pyx_n_s_tri_indices, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); - __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_triangulate_indices, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(7, __pyx_n_s_indices, __pyx_n_s_indices, __pyx_n_s_m, __pyx_n_s_tri_indices, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_mesh_triangulat, __pyx_n_s_triangulate_indices, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 302, __pyx_L1_error) /* "View.MemoryView":282 * return self.name @@ -20780,9 +22382,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); /* "View.MemoryView":283 * @@ -20791,9 +22393,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -20802,9 +22404,9 @@ * * */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); /* "View.MemoryView":287 * @@ -20813,9 +22415,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); /* "View.MemoryView":288 * @@ -20824,9 +22426,19 @@ * * */ - __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 288, __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 + */ + __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 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, 0, __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(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -20839,6 +22451,7 @@ __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:; @@ -20903,6 +22516,7 @@ __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 @@ -20939,23 +22553,27 @@ __pyx_vtabptr_2yt_9utilities_3lib_18mesh_triangulation_TriSet = &__pyx_vtable_2yt_9utilities_3lib_18mesh_triangulation_TriSet; __pyx_vtable_2yt_9utilities_3lib_18mesh_triangulation_TriSet._allocate_new_node = (struct __pyx_t_2yt_9utilities_3lib_18mesh_triangulation_TriNode *(*)(struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t))__pyx_f_2yt_9utilities_3lib_18mesh_triangulation_6TriSet__allocate_new_node; __pyx_vtable_2yt_9utilities_3lib_18mesh_triangulation_TriSet.update = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_18mesh_triangulation_TriSet *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t))__pyx_f_2yt_9utilities_3lib_18mesh_triangulation_6TriSet_update; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_TriSet) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_TriSet) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_18mesh_triangulation_TriSet.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_TriSet.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_18mesh_triangulation_TriSet) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "TriSet", (PyObject *)&__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_TriSet) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_TriSet.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_18mesh_triangulation_TriSet) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "TriSet", (PyObject *)&__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_TriSet) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_TriSet) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_18mesh_triangulation_TriSet = &__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_TriSet; - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder) < 0) __PYX_ERR(0, 176, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "MeshInfoHolder", (PyObject *)&__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder) < 0) __PYX_ERR(0, 176, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "MeshInfoHolder", (PyObject *)&__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder) < 0) __PYX_ERR(0, 177, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder = &__pyx_type_2yt_9utilities_3lib_18mesh_triangulation_MeshInfoHolder; __pyx_vtabptr_array = &__pyx_vtable_array; __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; - if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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; @@ -20965,18 +22583,20 @@ __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, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -20986,11 +22606,11 @@ 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, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(2, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -21031,7 +22651,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/mesh_triangulation.pyx":62 + /* "yt/utilities/lib/mesh_triangulation.pyx":63 * * # should be enough, consider dynamic resizing in the future * cdef np.int64_t TABLE_SIZE = 2**24 # <<<<<<<<<<<<<< @@ -21040,52 +22660,52 @@ */ __pyx_v_2yt_9utilities_3lib_18mesh_triangulation_TABLE_SIZE = 0x1000000; - /* "yt/utilities/lib/mesh_triangulation.pyx":211 + /* "yt/utilities/lib/mesh_triangulation.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def cull_interior_triangles(np.int64_t[:, ::1] indices): # <<<<<<<<<<<<<< * ''' * */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18mesh_triangulation_1cull_interior_triangles, NULL, __pyx_n_s_yt_utilities_lib_mesh_triangulat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18mesh_triangulation_1cull_interior_triangles, NULL, __pyx_n_s_yt_utilities_lib_mesh_triangulat_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_cull_interior_triangles, __pyx_t_2) < 0) __PYX_ERR(0, 211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cull_interior_triangles, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/mesh_triangulation.pyx":234 + /* "yt/utilities/lib/mesh_triangulation.pyx":235 * @cython.boundscheck(False) * @cython.wraparound(False) * def get_vertex_data(np.float64_t[:, ::1] coords, # <<<<<<<<<<<<<< * np.float64_t[:, ::1] data, * np.int64_t[:, ::1] indices): */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18mesh_triangulation_3get_vertex_data, NULL, __pyx_n_s_yt_utilities_lib_mesh_triangulat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18mesh_triangulation_3get_vertex_data, NULL, __pyx_n_s_yt_utilities_lib_mesh_triangulat_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_vertex_data, __pyx_t_2) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_vertex_data, __pyx_t_2) < 0) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/mesh_triangulation.pyx":258 + /* "yt/utilities/lib/mesh_triangulation.pyx":259 * @cython.boundscheck(False) * @cython.wraparound(False) * def triangulate_mesh(np.float64_t[:, ::1] coords, # <<<<<<<<<<<<<< * np.ndarray data, * np.int64_t[:, ::1] indices): */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18mesh_triangulation_5triangulate_mesh, NULL, __pyx_n_s_yt_utilities_lib_mesh_triangulat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18mesh_triangulation_5triangulate_mesh, NULL, __pyx_n_s_yt_utilities_lib_mesh_triangulat_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_triangulate_mesh, __pyx_t_2) < 0) __PYX_ERR(0, 258, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_triangulate_mesh, __pyx_t_2) < 0) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/mesh_triangulation.pyx":301 + /* "yt/utilities/lib/mesh_triangulation.pyx":302 * @cython.boundscheck(False) * @cython.wraparound(False) - * def triangulate_indices(np.int64_t[:, ::1] indices): # <<<<<<<<<<<<<< + * def triangulate_indices(np.int_t[:, ::1] indices): # <<<<<<<<<<<<<< * ''' * */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18mesh_triangulation_7triangulate_indices, NULL, __pyx_n_s_yt_utilities_lib_mesh_triangulat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18mesh_triangulation_7triangulate_indices, NULL, __pyx_n_s_yt_utilities_lib_mesh_triangulat_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_triangulate_indices, __pyx_t_2) < 0) __PYX_ERR(0, 301, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_triangulate_indices, __pyx_t_2) < 0) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "yt/utilities/lib/mesh_triangulation.pyx":1 @@ -21105,9 +22725,9 @@ * * 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, 207, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_array_type); @@ -21118,7 +22738,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 282, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_2); @@ -21132,7 +22752,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 283, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_2); @@ -21146,7 +22766,7 @@ * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 284, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_2); @@ -21160,7 +22780,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_2); @@ -21174,7 +22794,7 @@ * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); @@ -21214,9 +22834,9 @@ * * */ - __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 535, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_memoryview_type); @@ -21227,18 +22847,28 @@ * * */ - __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import 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(1, 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(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -21249,7 +22879,7 @@ __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.mesh_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.mesh_triangulation", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -22051,42 +23681,229 @@ if (have_gil) { Py_INCREF((PyObject *) memview); } else { - PyGILState_STATE _gilstate = PyGILState_Ensure(); - Py_INCREF((PyObject *) memview); - PyGILState_Release(_gilstate); + 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 PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; } + PyException_SetCause(value, fixed_cause); } -} -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); + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); } - } else { - memslice->memview = NULL; +#endif } +bad: + Py_XDECREF(owned_instance); + return; } +#endif /* RaiseDoubleKeywords */ - static void __Pyx_RaiseDoubleKeywordsError( + static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { @@ -22100,7 +23917,7 @@ } /* ParseKeywords */ - static int __Pyx_ParseOptionalKeywords( + static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, @@ -22202,7 +24019,7 @@ } /* PyFunctionFastCall */ - #if CYTHON_FAST_PYCALL + #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { @@ -22318,211 +24135,29 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyCFunctionFastCall */ - #if CYTHON_FAST_PYCCALL + #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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); -} -#endif // CYTHON_FAST_PYCCALL - -/* 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; - } - } + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL); } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif + return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); } -bad: - Py_XDECREF(owned_instance); - return; } #endif @@ -22564,11 +24199,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -22591,7 +24222,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -22612,7 +24243,7 @@ #endif /* ArgTypeTest */ - static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); @@ -22639,20 +24270,20 @@ } /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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"); } /* IterFinish */ - static CYTHON_INLINE int __Pyx_IterFinish(void) { + static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; @@ -22687,7 +24318,7 @@ } /* UnpackItemEndCheck */ - static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); @@ -22699,12 +24330,12 @@ } /* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + 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) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -22717,7 +24348,7 @@ } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -22741,7 +24372,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -22751,7 +24382,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -22812,7 +24443,7 @@ } /* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -22830,7 +24461,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -22850,7 +24490,7 @@ } /* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -22890,6 +24530,21 @@ 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; @@ -22934,7 +24589,7 @@ } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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)); @@ -22942,7 +24597,7 @@ } /* GetAttr */ - static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) @@ -22955,7 +24610,7 @@ } /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -22987,8 +24642,23 @@ } } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -23013,7 +24683,7 @@ #endif /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -23087,7 +24757,7 @@ } /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -23098,9 +24768,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -23113,9 +24786,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -23168,7 +24844,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -23284,12 +24960,12 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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)); @@ -23297,7 +24973,7 @@ } /* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + 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; @@ -23338,8 +25014,40 @@ #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; + } +} + /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -23356,22 +25064,107 @@ return -1; } -/* 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 +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (ret < 0) goto BAD; + } + PyType_Modified((PyTypeObject*)type_obj); + } } - return value; + goto GOOD; +BAD: + if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +GOOD: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif } /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -23451,7 +25244,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -23510,12 +25303,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -23554,8 +25350,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -23578,7 +25374,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -23614,7 +25410,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -23627,7 +25423,7 @@ } /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -23668,7 +25464,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -23850,7 +25646,30 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG, + (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_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_d_dc_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) }; @@ -23873,7 +25692,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) }; @@ -23896,7 +25715,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -23918,7 +25737,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + 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) { @@ -23949,7 +25768,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -23980,7 +25799,7 @@ } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) { + 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) { @@ -23992,7 +25811,7 @@ } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float32_t(const char *itemp) { + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float32_t(const char *itemp) { return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float32_t *) itemp); } static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float32_t(const char *itemp, PyObject *obj) { @@ -24004,7 +25823,7 @@ } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); } static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { @@ -24016,7 +25835,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -24047,7 +25866,7 @@ } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp) { + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp) { return (PyObject *) __Pyx_PyInt_From_npy_int32(*(__pyx_t_5numpy_int32_t *) itemp); } static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj) { @@ -24058,8 +25877,51 @@ return 1; } +/* 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); + } +} + +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_long(*(__pyx_t_5numpy_int_t *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_int_t value = __Pyx_PyInt_As_npy_long(obj); + if ((value == ((npy_long)-1)) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_int_t *) itemp = value; + return 1; +} + /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -24079,7 +25941,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -24214,7 +26076,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -24234,7 +26096,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -24369,7 +26231,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -24400,7 +26262,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -24431,7 +26293,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -24498,7 +26360,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -24687,7 +26549,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -24876,7 +26738,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -25065,7 +26927,196 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 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 @@ -25254,7 +27305,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -25285,7 +27336,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + 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 @@ -25474,7 +27525,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) }; @@ -25497,7 +27548,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -25520,7 +27571,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -25543,7 +27594,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -25559,7 +27610,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -25577,7 +27628,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -25642,7 +27693,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -25667,6 +27718,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -25675,11 +27728,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/mesh_triangulation.h yt-3.4.0/yt/utilities/lib/mesh_triangulation.h --- yt-3.3.3/yt/utilities/lib/mesh_triangulation.h 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/mesh_triangulation.h 2017-08-10 18:02:57.000000000 +0000 @@ -12,7 +12,7 @@ // here: http://homepages.cae.wisc.edu/~tautges/papers/cnmev3.pdf // Note that this is the case for Exodus II data. int triangulate_hex[MAX_NUM_TRI][3] = { - {0, 2, 1}, {0, 3, 2}, // Face is 3 2 1 0 + {0, 2, 1}, {0, 3, 2}, // Face is 3 2 1 0 {4, 5, 6}, {4, 6, 7}, // Face is 4 5 6 7 {0, 1, 5}, {0, 5, 4}, // Face is 0 1 5 4 {1, 2, 6}, {1, 6, 5}, // Face is 1 2 6 5 @@ -22,7 +22,7 @@ // Similarly, this is used to triangulate the tetrahedral cells int triangulate_tetra[MAX_NUM_TRI][3] = { - {0, 1, 3}, + {0, 1, 3}, {2, 3, 1}, {0, 3, 2}, {0, 2, 1}, @@ -57,10 +57,18 @@ // This is used to select faces from a 20-sided hex element int hex20_faces[6][8] = { - {0, 1, 5, 4, 12, 8, 13, 16}, + {0, 1, 5, 4, 12, 8, 13, 16}, {1, 2, 6, 5, 13, 9, 14, 17}, {3, 2, 6, 7, 15, 10, 14, 18}, {0, 3, 7, 4, 12, 11, 15, 19}, {4, 5, 6, 7, 19, 16, 17, 18}, {0, 1, 2, 3, 11, 8, 9, 10} }; + +// This is used to select faces from a second-order tet element +int tet10_faces[4][6] = { + {0, 1, 3, 4, 8, 7}, + {2, 3, 1, 9, 8, 5}, + {0, 3, 2, 7, 9, 6}, + {0, 2, 1, 6, 5, 4} +}; diff -Nru yt-3.3.3/yt/utilities/lib/mesh_triangulation.pyx yt-3.4.0/yt/utilities/lib/mesh_triangulation.pyx --- yt-3.3.3/yt/utilities/lib/mesh_triangulation.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/mesh_triangulation.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -33,6 +33,7 @@ int triangulate_tetra[MAX_NUM_TRI][3] int triangulate_wedge[MAX_NUM_TRI][3] int hex20_faces[6][8] + int tet10_faces[4][6] cdef struct TriNode: np.uint64_t key @@ -50,7 +51,7 @@ if not found: return 0 return 1 - + cdef np.uint64_t triangle_hash(np.int64_t tri[3]) nogil: # http://stackoverflow.com/questions/1536393/good-hash-function-for-permutations cdef np.uint64_t h = 1 @@ -73,13 +74,13 @@ cdef TriNode **table cdef np.uint64_t num_items - + def __cinit__(self): self.table = malloc(TABLE_SIZE * sizeof(TriNode*)) for i in range(TABLE_SIZE): self.table[i] = NULL self.num_items = 0 - + def __dealloc__(self): cdef np.int64_t i cdef TriNode *node @@ -92,7 +93,7 @@ free(delete_node) self.table[i] = NULL free(self.table) - + @cython.boundscheck(False) @cython.wraparound(False) def get_exterior_tris(self): @@ -117,7 +118,7 @@ element_map[counter] = node.elem counter += 1 node = node.next_node - + return tri_indices, element_map cdef TriNode* _allocate_new_node(self, @@ -133,13 +134,13 @@ new_node.next_node = NULL self.num_items += 1 return new_node - + @cython.cdivision(True) cdef void update(self, np.int64_t tri[3], np.int64_t elem) nogil: cdef np.uint64_t key = triangle_hash(tri) cdef np.uint64_t index = key % TABLE_SIZE cdef TriNode *node = self.table[index] - + if node == NULL: self.table[index] = self._allocate_new_node(tri, key, elem) return @@ -154,7 +155,7 @@ elif node.next_node == NULL: node.next_node = self._allocate_new_node(tri, key, elem) return - + # walk through node list cdef TriNode* prev = node node = node.next_node @@ -180,8 +181,8 @@ cdef np.int64_t VPE # num verts per element cdef np.int64_t TPE # num tris per element cdef int[MAX_NUM_TRI][3] tri_array - - def __cinit__(self, np.int64_t[:, ::1] indices): + + def __cinit__(self, np.int_t[:, ::1] indices): ''' This class is used to store metadata about the type of mesh being used. @@ -194,7 +195,7 @@ if (self.VPE == 8 or self.VPE == 20 or self.VPE == 27): self.TPE = HEX_NT self.tri_array = triangulate_hex - elif self.VPE == 4: + elif (self.VPE == 4 or self.VPE == 10): self.TPE = TETRA_NT self.tri_array = triangulate_tetra elif self.VPE == 6: @@ -205,7 +206,7 @@ self.num_tri = self.TPE * self.num_elem self.num_verts = self.num_tri * 3 - + @cython.boundscheck(False) @cython.wraparound(False) def cull_interior_triangles(np.int64_t[:, ::1] indices): @@ -228,7 +229,7 @@ s.update(tri, i) return s.get_exterior_tris() - + @cython.boundscheck(False) @cython.wraparound(False) def get_vertex_data(np.float64_t[:, ::1] coords, @@ -245,7 +246,7 @@ cdef MeshInfoHolder m = MeshInfoHolder(indices) cdef np.int64_t num_verts = coords.shape[0] cdef np.float32_t[:] vertex_data = np.zeros(num_verts, dtype="float32") - + cdef np.int64_t i, j for i in range(m.num_elem): for j in range(m.VPE): @@ -271,17 +272,17 @@ cdef np.int64_t num_tri = exterior_tris.shape[0] cdef np.int64_t num_verts = 3 * num_tri cdef np.int64_t num_coords = 3 * num_verts - + cdef np.float32_t[:] vertex_data if data.ndim == 2: vertex_data = get_vertex_data(coords, data, indices) else: vertex_data = data.astype("float32") - + cdef np.int32_t[:] tri_indices = np.empty(num_verts, dtype=np.int32) cdef np.float32_t[:] tri_data = np.empty(num_verts, dtype=np.float32) cdef np.float32_t[:] tri_coords = np.empty(num_coords, dtype=np.float32) - + cdef np.int64_t vert_index, i, j, k for i in range(num_tri): for j in range(3): @@ -293,12 +294,12 @@ tri_indices[vert_index] = vert_index for k in range(3): tri_coords[vert_index*3 + k] = coords[exterior_tris[i, j], k] - + return np.array(tri_coords), np.array(tri_data), np.array(tri_indices) @cython.boundscheck(False) @cython.wraparound(False) -def triangulate_indices(np.int64_t[:, ::1] indices): +def triangulate_indices(np.int_t[:, ::1] indices): ''' This is like triangulate_mesh, except it only considers the @@ -306,11 +307,11 @@ coordinates and the data values. ''' - + cdef MeshInfoHolder m = MeshInfoHolder(indices) - cdef np.int64_t[:, ::1] tri_indices = np.empty((m.num_tri, 3), dtype=np.int64) - - cdef np.int64_t i, j, k + cdef np.int_t[:, ::1] tri_indices = np.empty((m.num_tri, 3), dtype=np.int_) + + cdef np.int_t i, j, k for i in range(m.num_elem): for j in range(m.TPE): for k in range(3): diff -Nru yt-3.3.3/yt/utilities/lib/mesh_utilities.c yt-3.4.0/yt/utilities/lib/mesh_utilities.c --- yt-3.3.3/yt/utilities/lib/mesh_utilities.c 2016-12-12 01:41:54.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/mesh_utilities.c 2017-08-10 18:20:48.000000000 +0000 @@ -1,11 +1,20 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { "distutils": { - "depends": [], + "depends": [ + "yt/utilities/lib/platform_dep.h" + ], + "include_dirs": [ + "yt/utilities/lib" + ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.mesh_utilities", + "sources": [ + "yt/utilities/lib/mesh_utilities.pyx" ] }, "module_name": "yt.utilities.lib.mesh_utilities" @@ -19,7 +28,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -41,6 +50,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -193,16 +203,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -329,6 +343,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -383,6 +403,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -446,6 +495,9 @@ #include #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" +#include "platform_dep.h" +#include "pythread.h" +#include "pystate.h" #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -490,8 +542,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -504,8 +556,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -627,10 +682,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -665,6 +722,7 @@ static const char *__pyx_f[] = { "yt/utilities/lib/mesh_utilities.pyx", "__init__.pxd", + "stringsource", "type.pxd", }; /* BufferFormatStructs.proto */ @@ -703,6 +761,65 @@ char is_valid_array; } __Pyx_BufFmt_Context; +/* 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; + +/* 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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 * # in Cython to enable them only on the right systems. @@ -918,6 +1035,10 @@ /*--- Type declarations ---*/ +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_longdouble longdouble_t @@ -955,6 +1076,131 @@ */ typedef npy_cdouble __pyx_t_5numpy_complex_t; +/* "View.MemoryView":103 + * + * @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":275 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":326 + * + * @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":951 + * + * @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":103 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_array { + PyObject *(*get_memview)(struct __pyx_array_obj *); +}; +static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; + + +/* "View.MemoryView":326 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * 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":951 + * + * @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 @@ -1061,7 +1307,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); @@ -1107,6 +1353,32 @@ /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); +/* 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); + /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { @@ -1164,9 +1436,210 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #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 + +/* 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 *); + +/* 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); +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +/* 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 + +/* 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); + +/* 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() + +/* 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); + +/* 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); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1186,6 +1659,15 @@ 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; @@ -1200,22 +1682,45 @@ __Pyx_Buf_DimInfo diminfo[8]; } __Pyx_LocalBuf_ND; -#if PY_MAJOR_VERSION < 3 - static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); - static void __Pyx_ReleaseBuffer(Py_buffer *view); -#else - #define __Pyx_GetBuffer PyObject_GetBuffer - #define __Pyx_ReleaseBuffer PyBuffer_Release -#endif - - /* None.proto */ static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, + char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* TypeInfoCompare.proto */ +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +/* MemviewSliceValidateAndInit.proto */ +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + 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_float64_t(PyObject *); + /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); + /* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -1317,14 +1822,27 @@ /* 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 Py_intptr_t __Pyx_PyInt_As_Py_intptr_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 long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); @@ -1347,6 +1865,16 @@ /* 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 'cpython.buffer' */ @@ -1377,18 +1905,64 @@ static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ +/* Module declarations from 'cython.view' */ + /* Module declarations from 'cython' */ /* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ /* Module declarations from 'yt.utilities.lib.mesh_utilities' */ +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 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_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 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 "yt.utilities.lib.mesh_utilities" @@ -1400,93 +1974,311 @@ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_IndexError; +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_k[] = "k"; static const char __pyx_k_LE[] = "LE"; static const char __pyx_k_RE[] = "RE"; +static const char __pyx_k_id[] = "id"; static const char __pyx_k_nc[] = "nc"; static const char __pyx_k_np[] = "np"; static const char __pyx_k_nv[] = "nv"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_obj[] = "obj"; +static const char __pyx_k_pdx[] = "pdx"; static const char __pyx_k_pos[] = "pos"; +static const char __pyx_k_base[] = "base"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_edge[] = "edge"; static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_mode[] = "mode"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_ndim[] = "ndim"; +static const char __pyx_k_pack[] = "pack"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_step[] = "step"; +static const char __pyx_k_stop[] = "stop"; static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_ASCII[] = "ASCII"; +static const char __pyx_k_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_numpy[] = "numpy"; +static const char __pyx_k_pleft[] = "pleft"; 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_coords[] = "coords"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_format[] = "format"; static const char __pyx_k_fwidth[] = "fwidth"; static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_offset[] = "offset"; +static const char __pyx_k_pickle[] = "pickle"; +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_YTArray[] = "YTArray"; static const char __pyx_k_fcoords[] = "fcoords"; static const char __pyx_k_float64[] = "float64"; +static const char __pyx_k_fortran[] = "fortran"; static const char __pyx_k_fwidths[] = "fwidths"; static const char __pyx_k_indices[] = "indices"; +static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_Ellipsis[] = "Ellipsis"; +static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +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_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_clamp_edges[] = "clamp_edges"; +static const char __pyx_k_start_index[] = "start_index"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_fill_fcoords[] = "fill_fcoords"; static const char __pyx_k_fill_fwidths[] = "fill_fwidths"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_integer_index[] = "integer_index"; +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_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_smallest_fwidth[] = "smallest_fwidth"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_yt_units_yt_array[] = "yt.units.yt_array"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; +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_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_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/mesh_utilities.pyx"; +static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static const char __pyx_k_Utilities_for_unstructured_and[] = "\nUtilities for unstructured and semi-structured meshes\n\n\n\n"; +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_yt_utilities_lib_mesh_utilities[] = "yt.utilities.lib.mesh_utilities"; +static const char __pyx_k_yt_utilities_lib_mesh_utilities[] = "yt/utilities/lib/mesh_utilities.pyx"; +static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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_yt_utilities_lib_mesh_utilities_2[] = "yt.utilities.lib.mesh_utilities"; 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_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_LE; +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_s_NotImplementedError; +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_n_s_RE; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; +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_YTArray; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_clamp_edges; +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_n_s_dict; static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; +static PyObject *__pyx_n_s_edge; 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_fcoords; static PyObject *__pyx_n_s_fill_fcoords; static PyObject *__pyx_n_s_fill_fwidths; +static PyObject *__pyx_n_s_flags; static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; static PyObject *__pyx_n_s_fwidth; static PyObject *__pyx_n_s_fwidths; +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_indices; +static PyObject *__pyx_n_s_integer_index; +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_k; static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; static PyObject *__pyx_n_s_nc; 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_nv; +static PyObject *__pyx_n_s_obj; static PyObject *__pyx_n_s_offset; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pdx; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_pleft; static PyObject *__pyx_n_s_pos; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_getbuffer; +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_cython; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_smallest_fwidth; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_start_index; +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_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_yt_utilities_lib_mesh_utilities; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_n_s_yt_units_yt_array; +static PyObject *__pyx_kp_s_yt_utilities_lib_mesh_utilities; +static PyObject *__pyx_n_s_yt_utilities_lib_mesh_utilities_2; static PyObject *__pyx_pf_2yt_9utilities_3lib_14mesh_utilities_fill_fcoords(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords, PyArrayObject *__pyx_v_indices, int __pyx_v_offset); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14mesh_utilities_2fill_fwidths(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords, PyArrayObject *__pyx_v_indices, int __pyx_v_offset); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14mesh_utilities_4smallest_fwidth(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords, PyArrayObject *__pyx_v_indices, int __pyx_v_offset); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14mesh_utilities_6clamp_edges(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_edge, __Pyx_memviewslice __pyx_v_pleft, __Pyx_memviewslice __pyx_v_pdx); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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; @@ -1496,14 +2288,42 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__23; +static PyObject *__pyx_slice__24; +static PyObject *__pyx_slice__25; static PyObject *__pyx_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_codeobj__11; -static PyObject *__pyx_codeobj__13; -static PyObject *__pyx_codeobj__15; +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__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__43; -/* "yt/utilities/lib/mesh_utilities.pyx":25 +/* "yt/utilities/lib/mesh_utilities.pyx":29 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_fcoords(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< @@ -1529,8 +2349,11 @@ 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; } @@ -1539,11 +2362,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_fcoords", 0, 2, 3, 1); __PYX_ERR(0, 25, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_fcoords", 0, 2, 3, 1); __PYX_ERR(0, 29, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); @@ -1551,11 +2376,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_fcoords") < 0)) __PYX_ERR(0, 25, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_fcoords") < 0)) __PYX_ERR(0, 29, __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; @@ -1565,21 +2391,21 @@ __pyx_v_coords = ((PyArrayObject *)values[0]); __pyx_v_indices = ((PyArrayObject *)values[1]); if (values[2]) { - __pyx_v_offset = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error) } else { __pyx_v_offset = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fill_fcoords", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 25, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_fcoords", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 29, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.mesh_utilities.fill_fcoords", __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, 25, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) __PYX_ERR(0, 26, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_5numpy_ndarray, 1, "coords", 0))) __PYX_ERR(0, 29, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) __PYX_ERR(0, 30, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14mesh_utilities_fill_fcoords(__pyx_self, __pyx_v_coords, __pyx_v_indices, __pyx_v_offset); /* function exit code */ @@ -1642,16 +2468,16 @@ __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 25, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error) } __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 25, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error) } __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indices.diminfo[1].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indices.diminfo[1].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/mesh_utilities.pyx":29 + /* "yt/utilities/lib/mesh_utilities.pyx":33 * int offset = 0): * cdef np.ndarray[np.float64_t, ndim=2] fcoords * cdef int nc = indices.shape[0] # <<<<<<<<<<<<<< @@ -1660,7 +2486,7 @@ */ __pyx_v_nc = (__pyx_v_indices->dimensions[0]); - /* "yt/utilities/lib/mesh_utilities.pyx":30 + /* "yt/utilities/lib/mesh_utilities.pyx":34 * cdef np.ndarray[np.float64_t, ndim=2] fcoords * cdef int nc = indices.shape[0] * cdef int nv = indices.shape[1] # <<<<<<<<<<<<<< @@ -1669,21 +2495,21 @@ */ __pyx_v_nv = (__pyx_v_indices->dimensions[1]); - /* "yt/utilities/lib/mesh_utilities.pyx":33 + /* "yt/utilities/lib/mesh_utilities.pyx":37 * cdef np.float64_t pos[3] * cdef int i, j, k * fcoords = np.empty((nc, 3), dtype="float64") # <<<<<<<<<<<<<< * for i in range(nc): * for j in range(3): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __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, 33, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __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_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -1691,20 +2517,20 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 33, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 33, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 37, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -1720,13 +2546,13 @@ } } __pyx_pybuffernd_fcoords.diminfo[0].strides = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fcoords.diminfo[0].shape = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fcoords.diminfo[1].strides = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fcoords.diminfo[1].shape = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 33, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 37, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_fcoords = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/mesh_utilities.pyx":34 + /* "yt/utilities/lib/mesh_utilities.pyx":38 * cdef int i, j, k * fcoords = np.empty((nc, 3), dtype="float64") * for i in range(nc): # <<<<<<<<<<<<<< @@ -1737,7 +2563,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_6; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "yt/utilities/lib/mesh_utilities.pyx":35 + /* "yt/utilities/lib/mesh_utilities.pyx":39 * fcoords = np.empty((nc, 3), dtype="float64") * for i in range(nc): * for j in range(3): # <<<<<<<<<<<<<< @@ -1747,7 +2573,7 @@ for (__pyx_t_11 = 0; __pyx_t_11 < 3; __pyx_t_11+=1) { __pyx_v_j = __pyx_t_11; - /* "yt/utilities/lib/mesh_utilities.pyx":36 + /* "yt/utilities/lib/mesh_utilities.pyx":40 * for i in range(nc): * for j in range(3): * pos[j] = 0.0 # <<<<<<<<<<<<<< @@ -1757,7 +2583,7 @@ (__pyx_v_pos[__pyx_v_j]) = 0.0; } - /* "yt/utilities/lib/mesh_utilities.pyx":37 + /* "yt/utilities/lib/mesh_utilities.pyx":41 * for j in range(3): * pos[j] = 0.0 * for j in range(nv): # <<<<<<<<<<<<<< @@ -1768,7 +2594,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_j = __pyx_t_12; - /* "yt/utilities/lib/mesh_utilities.pyx":38 + /* "yt/utilities/lib/mesh_utilities.pyx":42 * pos[j] = 0.0 * for j in range(nv): * for k in range(3): # <<<<<<<<<<<<<< @@ -1778,7 +2604,7 @@ for (__pyx_t_13 = 0; __pyx_t_13 < 3; __pyx_t_13+=1) { __pyx_v_k = __pyx_t_13; - /* "yt/utilities/lib/mesh_utilities.pyx":39 + /* "yt/utilities/lib/mesh_utilities.pyx":43 * for j in range(nv): * for k in range(3): * pos[k] += coords[indices[i, j] - offset, k] # <<<<<<<<<<<<<< @@ -1794,7 +2620,7 @@ } } - /* "yt/utilities/lib/mesh_utilities.pyx":40 + /* "yt/utilities/lib/mesh_utilities.pyx":44 * for k in range(3): * pos[k] += coords[indices[i, j] - offset, k] * for j in range(3): # <<<<<<<<<<<<<< @@ -1804,7 +2630,7 @@ for (__pyx_t_11 = 0; __pyx_t_11 < 3; __pyx_t_11+=1) { __pyx_v_j = __pyx_t_11; - /* "yt/utilities/lib/mesh_utilities.pyx":41 + /* "yt/utilities/lib/mesh_utilities.pyx":45 * pos[k] += coords[indices[i, j] - offset, k] * for j in range(3): * pos[j] /= nv # <<<<<<<<<<<<<< @@ -1814,7 +2640,7 @@ __pyx_t_12 = __pyx_v_j; (__pyx_v_pos[__pyx_t_12]) = ((__pyx_v_pos[__pyx_t_12]) / __pyx_v_nv); - /* "yt/utilities/lib/mesh_utilities.pyx":42 + /* "yt/utilities/lib/mesh_utilities.pyx":46 * for j in range(3): * pos[j] /= nv * fcoords[i, j] = pos[j] # <<<<<<<<<<<<<< @@ -1827,7 +2653,7 @@ } } - /* "yt/utilities/lib/mesh_utilities.pyx":43 + /* "yt/utilities/lib/mesh_utilities.pyx":47 * pos[j] /= nv * fcoords[i, j] = pos[j] * return fcoords # <<<<<<<<<<<<<< @@ -1839,7 +2665,7 @@ __pyx_r = ((PyObject *)__pyx_v_fcoords); goto __pyx_L0; - /* "yt/utilities/lib/mesh_utilities.pyx":25 + /* "yt/utilities/lib/mesh_utilities.pyx":29 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_fcoords(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< @@ -1875,7 +2701,7 @@ return __pyx_r; } -/* "yt/utilities/lib/mesh_utilities.pyx":48 +/* "yt/utilities/lib/mesh_utilities.pyx":52 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_fwidths(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< @@ -1901,8 +2727,11 @@ 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; } @@ -1911,11 +2740,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_fwidths", 0, 2, 3, 1); __PYX_ERR(0, 48, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_fwidths", 0, 2, 3, 1); __PYX_ERR(0, 52, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); @@ -1923,11 +2754,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_fwidths") < 0)) __PYX_ERR(0, 48, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_fwidths") < 0)) __PYX_ERR(0, 52, __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; @@ -1937,21 +2769,21 @@ __pyx_v_coords = ((PyArrayObject *)values[0]); __pyx_v_indices = ((PyArrayObject *)values[1]); if (values[2]) { - __pyx_v_offset = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 50, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) } else { __pyx_v_offset = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fill_fwidths", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 48, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_fwidths", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.mesh_utilities.fill_fwidths", __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, 48, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) __PYX_ERR(0, 49, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_5numpy_ndarray, 1, "coords", 0))) __PYX_ERR(0, 52, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14mesh_utilities_2fill_fwidths(__pyx_self, __pyx_v_coords, __pyx_v_indices, __pyx_v_offset); /* function exit code */ @@ -2016,16 +2848,16 @@ __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 48, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 52, __pyx_L1_error) } __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 48, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 52, __pyx_L1_error) } __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indices.diminfo[1].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indices.diminfo[1].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/mesh_utilities.pyx":52 + /* "yt/utilities/lib/mesh_utilities.pyx":56 * int offset = 0): * cdef np.ndarray[np.float64_t, ndim=2] fwidths * cdef int nc = indices.shape[0] # <<<<<<<<<<<<<< @@ -2034,7 +2866,7 @@ */ __pyx_v_nc = (__pyx_v_indices->dimensions[0]); - /* "yt/utilities/lib/mesh_utilities.pyx":53 + /* "yt/utilities/lib/mesh_utilities.pyx":57 * cdef np.ndarray[np.float64_t, ndim=2] fwidths * cdef int nc = indices.shape[0] * cdef int nv = indices.shape[1] # <<<<<<<<<<<<<< @@ -2043,7 +2875,7 @@ */ __pyx_v_nv = (__pyx_v_indices->dimensions[1]); - /* "yt/utilities/lib/mesh_utilities.pyx":54 + /* "yt/utilities/lib/mesh_utilities.pyx":58 * cdef int nc = indices.shape[0] * cdef int nv = indices.shape[1] * if nv != 8: # <<<<<<<<<<<<<< @@ -2053,7 +2885,7 @@ __pyx_t_1 = ((__pyx_v_nv != 8) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/mesh_utilities.pyx":55 + /* "yt/utilities/lib/mesh_utilities.pyx":59 * cdef int nv = indices.shape[1] * if nv != 8: * raise NotImplementedError # <<<<<<<<<<<<<< @@ -2061,9 +2893,9 @@ * cdef np.float64_t RE[3] */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 55, __pyx_L1_error) + __PYX_ERR(0, 59, __pyx_L1_error) - /* "yt/utilities/lib/mesh_utilities.pyx":54 + /* "yt/utilities/lib/mesh_utilities.pyx":58 * cdef int nc = indices.shape[0] * cdef int nv = indices.shape[1] * if nv != 8: # <<<<<<<<<<<<<< @@ -2072,21 +2904,21 @@ */ } - /* "yt/utilities/lib/mesh_utilities.pyx":60 + /* "yt/utilities/lib/mesh_utilities.pyx":64 * cdef int i, j, k * cdef np.float64_t pos * fwidths = np.empty((nc, 3), dtype="float64") # <<<<<<<<<<<<<< * for i in range(nc): * for j in range(3): */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -2094,20 +2926,20 @@ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_3); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __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 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 60, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 60, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 64, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2123,13 +2955,13 @@ } } __pyx_pybuffernd_fwidths.diminfo[0].strides = __pyx_pybuffernd_fwidths.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fwidths.diminfo[0].shape = __pyx_pybuffernd_fwidths.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fwidths.diminfo[1].strides = __pyx_pybuffernd_fwidths.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fwidths.diminfo[1].shape = __pyx_pybuffernd_fwidths.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 60, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 64, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_fwidths = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/utilities/lib/mesh_utilities.pyx":61 + /* "yt/utilities/lib/mesh_utilities.pyx":65 * cdef np.float64_t pos * fwidths = np.empty((nc, 3), dtype="float64") * for i in range(nc): # <<<<<<<<<<<<<< @@ -2140,7 +2972,7 @@ for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "yt/utilities/lib/mesh_utilities.pyx":62 + /* "yt/utilities/lib/mesh_utilities.pyx":66 * fwidths = np.empty((nc, 3), dtype="float64") * for i in range(nc): * for j in range(3): # <<<<<<<<<<<<<< @@ -2150,7 +2982,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < 3; __pyx_t_12+=1) { __pyx_v_j = __pyx_t_12; - /* "yt/utilities/lib/mesh_utilities.pyx":63 + /* "yt/utilities/lib/mesh_utilities.pyx":67 * for i in range(nc): * for j in range(3): * LE[j] = 1e60 # <<<<<<<<<<<<<< @@ -2159,7 +2991,7 @@ */ (__pyx_v_LE[__pyx_v_j]) = 1e60; - /* "yt/utilities/lib/mesh_utilities.pyx":64 + /* "yt/utilities/lib/mesh_utilities.pyx":68 * for j in range(3): * LE[j] = 1e60 * RE[j] = -1e60 # <<<<<<<<<<<<<< @@ -2169,7 +3001,7 @@ (__pyx_v_RE[__pyx_v_j]) = -1e60; } - /* "yt/utilities/lib/mesh_utilities.pyx":65 + /* "yt/utilities/lib/mesh_utilities.pyx":69 * LE[j] = 1e60 * RE[j] = -1e60 * for j in range(nv): # <<<<<<<<<<<<<< @@ -2180,7 +3012,7 @@ for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_j = __pyx_t_13; - /* "yt/utilities/lib/mesh_utilities.pyx":66 + /* "yt/utilities/lib/mesh_utilities.pyx":70 * RE[j] = -1e60 * for j in range(nv): * for k in range(3): # <<<<<<<<<<<<<< @@ -2190,7 +3022,7 @@ for (__pyx_t_14 = 0; __pyx_t_14 < 3; __pyx_t_14+=1) { __pyx_v_k = __pyx_t_14; - /* "yt/utilities/lib/mesh_utilities.pyx":67 + /* "yt/utilities/lib/mesh_utilities.pyx":71 * for j in range(nv): * for k in range(3): * pos = coords[indices[i, j] - offset, k] # <<<<<<<<<<<<<< @@ -2203,7 +3035,7 @@ __pyx_t_18 = __pyx_v_k; __pyx_v_pos = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_coords.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_coords.diminfo[1].strides)); - /* "yt/utilities/lib/mesh_utilities.pyx":68 + /* "yt/utilities/lib/mesh_utilities.pyx":72 * for k in range(3): * pos = coords[indices[i, j] - offset, k] * LE[k] = fmin(pos, LE[k]) # <<<<<<<<<<<<<< @@ -2212,7 +3044,7 @@ */ (__pyx_v_LE[__pyx_v_k]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_pos, (__pyx_v_LE[__pyx_v_k])); - /* "yt/utilities/lib/mesh_utilities.pyx":69 + /* "yt/utilities/lib/mesh_utilities.pyx":73 * pos = coords[indices[i, j] - offset, k] * LE[k] = fmin(pos, LE[k]) * RE[k] = fmax(pos, RE[k]) # <<<<<<<<<<<<<< @@ -2223,7 +3055,7 @@ } } - /* "yt/utilities/lib/mesh_utilities.pyx":70 + /* "yt/utilities/lib/mesh_utilities.pyx":74 * LE[k] = fmin(pos, LE[k]) * RE[k] = fmax(pos, RE[k]) * for j in range(3): # <<<<<<<<<<<<<< @@ -2233,7 +3065,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < 3; __pyx_t_12+=1) { __pyx_v_j = __pyx_t_12; - /* "yt/utilities/lib/mesh_utilities.pyx":71 + /* "yt/utilities/lib/mesh_utilities.pyx":75 * RE[k] = fmax(pos, RE[k]) * for j in range(3): * fwidths[i, j] = RE[j] - LE[j] # <<<<<<<<<<<<<< @@ -2246,7 +3078,7 @@ } } - /* "yt/utilities/lib/mesh_utilities.pyx":72 + /* "yt/utilities/lib/mesh_utilities.pyx":76 * for j in range(3): * fwidths[i, j] = RE[j] - LE[j] * return fwidths # <<<<<<<<<<<<<< @@ -2258,7 +3090,7 @@ __pyx_r = ((PyObject *)__pyx_v_fwidths); goto __pyx_L0; - /* "yt/utilities/lib/mesh_utilities.pyx":48 + /* "yt/utilities/lib/mesh_utilities.pyx":52 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_fwidths(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< @@ -2294,7 +3126,7 @@ return __pyx_r; } -/* "yt/utilities/lib/mesh_utilities.pyx":77 +/* "yt/utilities/lib/mesh_utilities.pyx":81 * @cython.wraparound(False) * @cython.cdivision(True) * def smallest_fwidth(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< @@ -2320,8 +3152,11 @@ 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; } @@ -2330,11 +3165,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("smallest_fwidth", 0, 2, 3, 1); __PYX_ERR(0, 77, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("smallest_fwidth", 0, 2, 3, 1); __PYX_ERR(0, 81, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); @@ -2342,11 +3179,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "smallest_fwidth") < 0)) __PYX_ERR(0, 77, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "smallest_fwidth") < 0)) __PYX_ERR(0, 81, __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; @@ -2356,21 +3194,21 @@ __pyx_v_coords = ((PyArrayObject *)values[0]); __pyx_v_indices = ((PyArrayObject *)values[1]); if (values[2]) { - __pyx_v_offset = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error) } else { __pyx_v_offset = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("smallest_fwidth", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 77, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("smallest_fwidth", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 81, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.mesh_utilities.smallest_fwidth", __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, 77, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_5numpy_ndarray, 1, "coords", 0))) __PYX_ERR(0, 81, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14mesh_utilities_4smallest_fwidth(__pyx_self, __pyx_v_coords, __pyx_v_indices, __pyx_v_offset); /* function exit code */ @@ -2420,16 +3258,16 @@ __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 77, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 81, __pyx_L1_error) } __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 77, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 81, __pyx_L1_error) } __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indices.diminfo[1].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indices.diminfo[1].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/mesh_utilities.pyx":80 + /* "yt/utilities/lib/mesh_utilities.pyx":84 * np.ndarray[np.int64_t, ndim=2] indices, * int offset = 0): * cdef np.float64_t fwidth = 1e60, pos # <<<<<<<<<<<<<< @@ -2438,7 +3276,7 @@ */ __pyx_v_fwidth = 1e60; - /* "yt/utilities/lib/mesh_utilities.pyx":81 + /* "yt/utilities/lib/mesh_utilities.pyx":85 * int offset = 0): * cdef np.float64_t fwidth = 1e60, pos * cdef int nc = indices.shape[0] # <<<<<<<<<<<<<< @@ -2447,7 +3285,7 @@ */ __pyx_v_nc = (__pyx_v_indices->dimensions[0]); - /* "yt/utilities/lib/mesh_utilities.pyx":82 + /* "yt/utilities/lib/mesh_utilities.pyx":86 * cdef np.float64_t fwidth = 1e60, pos * cdef int nc = indices.shape[0] * cdef int nv = indices.shape[1] # <<<<<<<<<<<<<< @@ -2456,7 +3294,7 @@ */ __pyx_v_nv = (__pyx_v_indices->dimensions[1]); - /* "yt/utilities/lib/mesh_utilities.pyx":83 + /* "yt/utilities/lib/mesh_utilities.pyx":87 * cdef int nc = indices.shape[0] * cdef int nv = indices.shape[1] * if nv != 8: # <<<<<<<<<<<<<< @@ -2466,7 +3304,7 @@ __pyx_t_1 = ((__pyx_v_nv != 8) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/mesh_utilities.pyx":84 + /* "yt/utilities/lib/mesh_utilities.pyx":88 * cdef int nv = indices.shape[1] * if nv != 8: * raise NotImplementedError # <<<<<<<<<<<<<< @@ -2474,9 +3312,9 @@ * cdef np.float64_t RE[3] */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 84, __pyx_L1_error) + __PYX_ERR(0, 88, __pyx_L1_error) - /* "yt/utilities/lib/mesh_utilities.pyx":83 + /* "yt/utilities/lib/mesh_utilities.pyx":87 * cdef int nc = indices.shape[0] * cdef int nv = indices.shape[1] * if nv != 8: # <<<<<<<<<<<<<< @@ -2485,7 +3323,7 @@ */ } - /* "yt/utilities/lib/mesh_utilities.pyx":88 + /* "yt/utilities/lib/mesh_utilities.pyx":92 * cdef np.float64_t RE[3] * cdef int i, j, k * for i in range(nc): # <<<<<<<<<<<<<< @@ -2496,7 +3334,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/utilities/lib/mesh_utilities.pyx":89 + /* "yt/utilities/lib/mesh_utilities.pyx":93 * cdef int i, j, k * for i in range(nc): * for j in range(3): # <<<<<<<<<<<<<< @@ -2506,7 +3344,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/utilities/lib/mesh_utilities.pyx":90 + /* "yt/utilities/lib/mesh_utilities.pyx":94 * for i in range(nc): * for j in range(3): * LE[j] = 1e60 # <<<<<<<<<<<<<< @@ -2515,7 +3353,7 @@ */ (__pyx_v_LE[__pyx_v_j]) = 1e60; - /* "yt/utilities/lib/mesh_utilities.pyx":91 + /* "yt/utilities/lib/mesh_utilities.pyx":95 * for j in range(3): * LE[j] = 1e60 * RE[j] = -1e60 # <<<<<<<<<<<<<< @@ -2525,7 +3363,7 @@ (__pyx_v_RE[__pyx_v_j]) = -1e60; } - /* "yt/utilities/lib/mesh_utilities.pyx":92 + /* "yt/utilities/lib/mesh_utilities.pyx":96 * LE[j] = 1e60 * RE[j] = -1e60 * for j in range(nv): # <<<<<<<<<<<<<< @@ -2536,7 +3374,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_j = __pyx_t_5; - /* "yt/utilities/lib/mesh_utilities.pyx":93 + /* "yt/utilities/lib/mesh_utilities.pyx":97 * RE[j] = -1e60 * for j in range(nv): * for k in range(3): # <<<<<<<<<<<<<< @@ -2546,7 +3384,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "yt/utilities/lib/mesh_utilities.pyx":94 + /* "yt/utilities/lib/mesh_utilities.pyx":98 * for j in range(nv): * for k in range(3): * pos = coords[indices[i, j] - offset, k] # <<<<<<<<<<<<<< @@ -2559,7 +3397,7 @@ __pyx_t_10 = __pyx_v_k; __pyx_v_pos = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_coords.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_coords.diminfo[1].strides)); - /* "yt/utilities/lib/mesh_utilities.pyx":95 + /* "yt/utilities/lib/mesh_utilities.pyx":99 * for k in range(3): * pos = coords[indices[i, j] - offset, k] * LE[k] = fmin(pos, LE[k]) # <<<<<<<<<<<<<< @@ -2568,7 +3406,7 @@ */ (__pyx_v_LE[__pyx_v_k]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_pos, (__pyx_v_LE[__pyx_v_k])); - /* "yt/utilities/lib/mesh_utilities.pyx":96 + /* "yt/utilities/lib/mesh_utilities.pyx":100 * pos = coords[indices[i, j] - offset, k] * LE[k] = fmin(pos, LE[k]) * RE[k] = fmax(pos, RE[k]) # <<<<<<<<<<<<<< @@ -2579,7 +3417,7 @@ } } - /* "yt/utilities/lib/mesh_utilities.pyx":97 + /* "yt/utilities/lib/mesh_utilities.pyx":101 * LE[k] = fmin(pos, LE[k]) * RE[k] = fmax(pos, RE[k]) * for j in range(3): # <<<<<<<<<<<<<< @@ -2589,7 +3427,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/utilities/lib/mesh_utilities.pyx":98 + /* "yt/utilities/lib/mesh_utilities.pyx":102 * RE[k] = fmax(pos, RE[k]) * for j in range(3): * fwidth = fmin(fwidth, RE[j] - LE[j]) # <<<<<<<<<<<<<< @@ -2600,20 +3438,21 @@ } } - /* "yt/utilities/lib/mesh_utilities.pyx":99 + /* "yt/utilities/lib/mesh_utilities.pyx":103 * for j in range(3): * fwidth = fmin(fwidth, RE[j] - LE[j]) * return fwidth # <<<<<<<<<<<<<< * + * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = PyFloat_FromDouble(__pyx_v_fwidth); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_fwidth); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_r = __pyx_t_11; __pyx_t_11 = 0; goto __pyx_L0; - /* "yt/utilities/lib/mesh_utilities.pyx":77 + /* "yt/utilities/lib/mesh_utilities.pyx":81 * @cython.wraparound(False) * @cython.cdivision(True) * def smallest_fwidth(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< @@ -2643,1542 +3482,1219 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "yt/utilities/lib/mesh_utilities.pyx":108 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def clamp_edges(np.float64_t[:] edge, np.float64_t[:] pleft, # <<<<<<<<<<<<<< + * np.float64_t[:] pdx): + * """Clamp edge to pleft + pdx*n where n is the closest integer */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14mesh_utilities_7clamp_edges(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_2yt_9utilities_3lib_14mesh_utilities_6clamp_edges[] = "Clamp edge to pleft + pdx*n where n is the closest integer\n\n Note that edge is modified in-place.\n "; +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_14mesh_utilities_7clamp_edges = {"clamp_edges", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14mesh_utilities_7clamp_edges, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_9utilities_3lib_14mesh_utilities_6clamp_edges}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_14mesh_utilities_7clamp_edges(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_edge = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_pleft = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_pdx = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clamp_edges (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edge,&__pyx_n_s_pleft,&__pyx_n_s_pdx,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_edge)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pleft)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("clamp_edges", 1, 3, 3, 1); __PYX_ERR(0, 108, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdx)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("clamp_edges", 1, 3, 3, 2); __PYX_ERR(0, 108, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clamp_edges") < 0)) __PYX_ERR(0, 108, __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_edge = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_edge.memview)) __PYX_ERR(0, 108, __pyx_L3_error) + __pyx_v_pleft = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_pleft.memview)) __PYX_ERR(0, 108, __pyx_L3_error) + __pyx_v_pdx = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_pdx.memview)) __PYX_ERR(0, 109, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("clamp_edges", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 108, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.mesh_utilities.clamp_edges", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_14mesh_utilities_6clamp_edges(__pyx_self, __pyx_v_edge, __pyx_v_pleft, __pyx_v_pdx); - /* "yt/utilities/lib/fp_utils.pxd":20 - * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * - */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14mesh_utilities_6clamp_edges(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_edge, __Pyx_memviewslice __pyx_v_pleft, __Pyx_memviewslice __pyx_v_pdx) { + __pyx_t_5numpy_float64_t __pyx_v_start_index; + __pyx_t_5numpy_float64_t __pyx_v_integer_index; + __pyx_t_5numpy_intp_t __pyx_v_shape; + __pyx_t_5numpy_intp_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_intp_t __pyx_t_1; + __pyx_t_5numpy_intp_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + __Pyx_RefNannySetupContext("clamp_edges", 0); + + /* "yt/utilities/lib/mesh_utilities.pyx":116 + * cdef np.float64_t start_index + * cdef np.float64_t integer_index + * cdef np.intp_t shape = edge.shape[0] # <<<<<<<<<<<<<< + * for i in range(shape): + * start_index = (edge[i] - pleft[i]) / pdx[i] + */ + __pyx_v_shape = (__pyx_v_edge.shape[0]); + + /* "yt/utilities/lib/mesh_utilities.pyx":117 + * cdef np.float64_t integer_index + * cdef np.intp_t shape = edge.shape[0] + * for i in range(shape): # <<<<<<<<<<<<<< + * start_index = (edge[i] - pleft[i]) / pdx[i] + * integer_index = rint(start_index) + */ + __pyx_t_1 = __pyx_v_shape; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "yt/utilities/lib/mesh_utilities.pyx":118 + * cdef np.intp_t shape = edge.shape[0] + * for i in range(shape): + * start_index = (edge[i] - pleft[i]) / pdx[i] # <<<<<<<<<<<<<< + * integer_index = rint(start_index) + * edge[i] = integer_index * pdx[i] + pleft[i] + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = __pyx_v_i; + __pyx_v_start_index = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_edge.data + __pyx_t_3 * __pyx_v_edge.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pleft.data + __pyx_t_4 * __pyx_v_pleft.strides[0]) )))) / (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdx.data + __pyx_t_5 * __pyx_v_pdx.strides[0]) )))); + + /* "yt/utilities/lib/mesh_utilities.pyx":119 + * for i in range(shape): + * start_index = (edge[i] - pleft[i]) / pdx[i] + * integer_index = rint(start_index) # <<<<<<<<<<<<<< + * edge[i] = integer_index * pdx[i] + pleft[i] + */ + __pyx_v_integer_index = rint(__pyx_v_start_index); + + /* "yt/utilities/lib/mesh_utilities.pyx":120 + * start_index = (edge[i] - pleft[i]) / pdx[i] + * integer_index = rint(start_index) + * edge[i] = integer_index * pdx[i] + pleft[i] # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_i; + *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_edge.data + __pyx_t_8 * __pyx_v_edge.strides[0]) )) = ((__pyx_v_integer_index * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdx.data + __pyx_t_6 * __pyx_v_pdx.strides[0]) )))) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pleft.data + __pyx_t_7 * __pyx_v_pleft.strides[0]) )))); } - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "yt/utilities/lib/mesh_utilities.pyx":108 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def clamp_edges(np.float64_t[:] edge, np.float64_t[:] pleft, # <<<<<<<<<<<<<< + * np.float64_t[:] pdx): + * """Clamp edge to pleft + pdx*n where n is the closest integer */ /* function exit code */ - __pyx_L0:; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __PYX_XDEC_MEMVIEW(&__pyx_v_edge, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_pleft, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_pdx, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":24 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 - * - */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< - * - * cdef inline int imin(int i0, int i1) nogil: +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 - */ +/* 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_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 - * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "yt/utilities/lib/fp_utils.pxd":28 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * if info == NULL: return # <<<<<<<<<<<<<< * + * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; + __pyx_r = 0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_v_endian_detector = 1; - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * ndim = PyArray_NDIM(self) */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_v_copy_shape = 1; - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); - if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; } - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline int iclip(int i, int a, int b) nogil: */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * 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, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 218, __pyx_L1_error) -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":40 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; } - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + * 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") * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + if (__pyx_t_1) { -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":45 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + * info.buf = PyArray_DATA(self) */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 222, __pyx_L1_error) - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") * - * cdef inline np.float64_t fclip(np.float64_t f, + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ + __pyx_v_info->ndim = __pyx_v_ndim; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; - - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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]); -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } - /* "yt/utilities/lib/fp_utils.pxd":54 - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + goto __pyx_L11; } - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * 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)); -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); } + __pyx_L11:; - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_v_info->suboffsets = NULL; - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * - * cdef int copy_shape, i, ndim + * cdef int t */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ - __pyx_v_endian_detector = 1; + __pyx_v_f = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * - * ndim = PyArray_NDIM(self) */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * if not hasfields and not copy_shape: */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< * else: - * copy_shape = 0 + * # need to call releasebuffer */ - __pyx_v_copy_shape = 1; + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - goto __pyx_L4; + goto __pyx_L14; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 * else: - * copy_shape = 0 # <<<<<<<<<<<<<< + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * if not hasfields: */ /*else*/ { - __pyx_v_copy_shape = 0; + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); } - __pyx_L4:; + __pyx_L14:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = 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_L6_bool_binop_done; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - } + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; + __pyx_L19_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - if (__pyx_t_1) { + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 259, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - } + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - __pyx_v_info->ndim = __pyx_v_ndim; + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * 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: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - goto __pyx_L11; - } + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ - __pyx_v_info->suboffsets = NULL; + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ - __pyx_v_f = NULL; + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - __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; + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 278, __pyx_L1_error) + break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None */ - goto __pyx_L14; - } + __pyx_v_info->format = __pyx_v_f; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: + * info.format = stdlib.malloc(_buffer_format_string_len) */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; + (__pyx_v_info->format[0]) = '^'; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + __pyx_v_offset = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) */ - if (__pyx_t_1) { + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + (__pyx_v_f[0]) = '\x00'; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; +/* 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)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; + free(__pyx_v_info->format); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; + free(__pyx_v_info->strides); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - __pyx_v_info->format = __pyx_v_f; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * 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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * 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, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * 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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ /* function exit code */ @@ -5315,7 +5831,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5363,7 +5879,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -5446,7 +5962,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5494,7 +6010,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -5577,7 +6093,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5622,7 +6138,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -5648,437 +6164,14937 @@ return __pyx_r; } -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 + */ -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "mesh_utilities", - __pyx_k_Utilities_for_unstructured_and, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, - {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, - {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, - {&__pyx_n_s_LE, __pyx_k_LE, sizeof(__pyx_k_LE), 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_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, - {&__pyx_n_s_RE, __pyx_k_RE, sizeof(__pyx_k_RE), 0, 0, 1, 1}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1}, - {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, - {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, - {&__pyx_n_s_fcoords, __pyx_k_fcoords, sizeof(__pyx_k_fcoords), 0, 0, 1, 1}, - {&__pyx_n_s_fill_fcoords, __pyx_k_fill_fcoords, sizeof(__pyx_k_fill_fcoords), 0, 0, 1, 1}, - {&__pyx_n_s_fill_fwidths, __pyx_k_fill_fwidths, sizeof(__pyx_k_fill_fwidths), 0, 0, 1, 1}, - {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, - {&__pyx_n_s_fwidth, __pyx_k_fwidth, sizeof(__pyx_k_fwidth), 0, 0, 1, 1}, - {&__pyx_n_s_fwidths, __pyx_k_fwidths, sizeof(__pyx_k_fwidths), 0, 0, 1, 1}, - {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1}, - {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, - {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1}, - {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, - {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, - {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_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_nv, __pyx_k_nv, sizeof(__pyx_k_nv), 0, 0, 1, 1}, - {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, - {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_smallest_fwidth, __pyx_k_smallest_fwidth, sizeof(__pyx_k_smallest_fwidth), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, - {&__pyx_n_s_yt_utilities_lib_mesh_utilities, __pyx_k_yt_utilities_lib_mesh_utilities, sizeof(__pyx_k_yt_utilities_lib_mesh_utilities), 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, 34, __pyx_L1_error) - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 55, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * + */ + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * info.buf = PyArray_DATA(self) + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":24 * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 * - * 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, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * - * # Until ticket #99 is fixed, use integers to avoid warnings + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * cdef inline int import_umath() except -1: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * 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, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "yt/utilities/lib/mesh_utilities.pyx":25 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def fill_fcoords(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< - * np.ndarray[np.int64_t, ndim=2] indices, - * int offset = 0): + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_tuple__10 = PyTuple_Pack(10, __pyx_n_s_coords, __pyx_n_s_indices, __pyx_n_s_offset, __pyx_n_s_fcoords, __pyx_n_s_nc, __pyx_n_s_nv, __pyx_n_s_pos, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_fill_fcoords, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 25, __pyx_L1_error) - /* "yt/utilities/lib/mesh_utilities.pyx":48 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def fill_fwidths(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< - * np.ndarray[np.int64_t, ndim=2] indices, - * int offset = 0): + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - __pyx_tuple__12 = PyTuple_Pack(12, __pyx_n_s_coords, __pyx_n_s_indices, __pyx_n_s_offset, __pyx_n_s_fwidths, __pyx_n_s_nc, __pyx_n_s_nv, __pyx_n_s_LE, __pyx_n_s_RE, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_fill_fwidths, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 48, __pyx_L1_error) - /* "yt/utilities/lib/mesh_utilities.pyx":77 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def smallest_fwidth(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< - * np.ndarray[np.int64_t, ndim=2] indices, - * int offset = 0): - */ - __pyx_tuple__14 = PyTuple_Pack(12, __pyx_n_s_coords, __pyx_n_s_indices, __pyx_n_s_offset, __pyx_n_s_fwidth, __pyx_n_s_pos, __pyx_n_s_nc, __pyx_n_s_nv, __pyx_n_s_LE, __pyx_n_s_RE, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_smallest_fwidth, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 77, __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_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initmesh_utilities(void); /*proto*/ -PyMODINIT_FUNC initmesh_utilities(void) -#else -PyMODINIT_FUNC PyInit_mesh_utilities(void); /*proto*/ -PyMODINIT_FUNC PyInit_mesh_utilities(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mesh_utilities(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_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 PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("mesh_utilities", __pyx_methods, __pyx_k_Utilities_for_unstructured_and, 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) - __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) - #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_yt__utilities__lib__mesh_utilities) { - 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, "yt.utilities.lib.mesh_utilities")) { - if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.mesh_utilities", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - } + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 + * + */ + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; } - #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 init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", - #if CYTHON_COMPILING_IN_PYPY - sizeof(PyTypeObject), - #else - sizeof(PyHeapTypeObject), - #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /* "yt/utilities/lib/mesh_utilities.pyx":16 - * #----------------------------------------------------------------------------- + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< * - * import numpy as np # <<<<<<<<<<<<<< - * cimport numpy as np - * cimport cython + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "yt/utilities/lib/mesh_utilities.pyx":25 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def fill_fcoords(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< - * np.ndarray[np.int64_t, ndim=2] indices, - * int offset = 0): + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14mesh_utilities_1fill_fcoords, NULL, __pyx_n_s_yt_utilities_lib_mesh_utilities); 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_fill_fcoords, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/mesh_utilities.pyx":48 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def fill_fwidths(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< - * np.ndarray[np.int64_t, ndim=2] indices, - * int offset = 0): - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14mesh_utilities_3fill_fwidths, NULL, __pyx_n_s_yt_utilities_lib_mesh_utilities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_fill_fwidths, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "yt/utilities/lib/mesh_utilities.pyx":77 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def smallest_fwidth(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< - * np.ndarray[np.int64_t, ndim=2] indices, - * int offset = 0): +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14mesh_utilities_5smallest_fwidth, NULL, __pyx_n_s_yt_utilities_lib_mesh_utilities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_smallest_fwidth, __pyx_t_1) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/mesh_utilities.pyx":1 - * """ # <<<<<<<<<<<<<< - * Utilities for unstructured and semi-structured meshes +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":36 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 * */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + if (__pyx_t_1) { + __pyx_r = (-__pyx_v_f0); + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ + __pyx_r = __pyx_v_f0; + goto __pyx_L0; - /*--- Wrapped vars code ---*/ + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 + */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.mesh_utilities", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib.mesh_utilities"); - } + /* function exit code */ __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif + return __pyx_r; } -/* --- 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: +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":40 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i + */ + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * + */ + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + */ + __pyx_r = __pyx_v_i; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":45 + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i + */ + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * + */ + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fclip(np.float64_t f, + */ + __pyx_r = __pyx_v_i; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i + * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + */ + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i + * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * + */ + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":58 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * + */ + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":120 + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __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, 120, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error) + } else { + + /* "View.MemoryView":121 + * + * 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, 120, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __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":120 + * 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; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":127 + * 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, 127, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":128 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":131 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 131, __pyx_L1_error) + + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + } + + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":134 + * + * 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, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 134, __pyx_L1_error) + + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + } + + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":137 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + } + + /* "View.MemoryView":138 + * if not isinstance(format, bytes): + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 138, __pyx_L1_error) + __pyx_t_5 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":139 + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_6; + + /* "View.MemoryView":142 + * + * + * 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":143 + * + * 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":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":146 + * + * 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, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 146, __pyx_L1_error) + + /* "View.MemoryView":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + } + + /* "View.MemoryView":149 + * + * + * 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, 149, __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, 149, __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, 149, __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":150 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":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_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __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, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __PYX_ERR(2, 151, __pyx_L1_error) + + /* "View.MemoryView":150 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + } + + /* "View.MemoryView":152 + * 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":149 + * + * + * 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":155 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 155, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":156 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":157 + * 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":155 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":159 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":160 + * 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":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":162 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + /*else*/ { + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 162, __pyx_L1_error) + } + __pyx_L10:; + + /* "View.MemoryView":164 + * 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":167 + * 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":168 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":169 + * 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":172 + * + * + * 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":173 + * + * 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 (__pyx_t_4) { + + /* "View.MemoryView":174 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 174, __pyx_L1_error) + + /* "View.MemoryView":173 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + } + + /* "View.MemoryView":176 + * 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":177 + * + * 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":178 + * 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, 178, __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, 178, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":179 + * 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":180 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + + /* "View.MemoryView":176 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + } + + /* "View.MemoryView":169 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":120 + * 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":183 + * + * @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; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":184 + * @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":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 185, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":186 + * 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":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + goto __pyx_L3; + } + + /* "View.MemoryView":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 187, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":188 + * 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":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; + + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 190, __pyx_L1_error) + + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + } + + /* "View.MemoryView":191 + * 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":192 + * 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":193 + * 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":194 + * 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":195 + * 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":196 + * 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":197 + * 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":198 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":200 + * 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":201 + * + * 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":200 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":203 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":205 + * 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":183 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":209 + * __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":210 + * + * 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":211 + * 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":210 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":214 + * 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":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } + + /* "View.MemoryView":216 + * 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":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + } + __pyx_L3:; + + /* "View.MemoryView":217 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":209 + * __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":220 + * + * @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":221 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":220 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":224 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_memview", 0); + + /* "View.MemoryView":225 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":226 + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __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, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":224 + * + * @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 + * + * + * 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_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":230 + * + * 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, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":229 + * + * + * 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":232 + * 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_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":233 + * + * 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, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __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 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":235 + * 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_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":236 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":235 + * 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":240 + * + * @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":244 + * 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":245 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __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, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":244 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __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":248 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error) + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":249 + * 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":251 + * 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":240 + * + * @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":277 + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 277, __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, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___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":278 + * 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":277 + * 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":279 + * 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":280 + * 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":279 + * 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":294 + * + * @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":296 + * 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":300 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":302 + * 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":303 + * + * 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":302 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":305 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":294 + * + * @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":341 + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __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, 341, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___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":342 + * + * 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":343 + * 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":344 + * 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":345 + * 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 == -1)) __PYX_ERR(2, 345, __pyx_L1_error) + + /* "View.MemoryView":346 + * 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":347 + * __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":348 + * 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":346 + * 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":344 + * 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":351 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":352 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":353 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":351 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + } + + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":355 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":357 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error) + + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } + + /* "View.MemoryView":359 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":360 + * + * 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":359 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + goto __pyx_L10; + } + + /* "View.MemoryView":362 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; + + /* "View.MemoryView":364 + * 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":366 + * 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":341 + * 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":368 + * 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; + PyThread_type_lock __pyx_t_5; + PyThread_type_lock __pyx_t_6; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":369 + * + * 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":370 + * 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":369 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + } + + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * 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":375 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":377 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":380 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":379 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; + + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":381 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":383 + * break + * else: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + } + __pyx_L6_break:; + + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":368 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":385 + * 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":387 + * 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":389 + * 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, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 389, __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":390 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":389 + * 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":392 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":385 + * 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":395 + * + * + * 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":396 + * + * 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":397 + * 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":396 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + } + + /* "View.MemoryView":399 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 399, __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, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":402 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 402, __pyx_L1_error) + if (__pyx_t_2) { + + /* "View.MemoryView":403 + * 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, 403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":402 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + } + + /* "View.MemoryView":405 + * 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 == NULL)) __PYX_ERR(2, 405, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":406 + * 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, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":395 + * + * + * 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":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___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 + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":409 + * + * def __setitem__(memoryview self, object index, object value): + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 409, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":412 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_obj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":414 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":416 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":418 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":420 + * 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":421 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_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":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":424 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __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, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":425 + * 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, 425, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":426 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":421 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + } + + /* "View.MemoryView":428 + * 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":420 + * 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":430 + * 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":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 434, __pyx_L1_error) + + /* "View.MemoryView":435 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 435, __pyx_L1_error) + + /* "View.MemoryView":436 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 434, __pyx_L1_error) + + /* "View.MemoryView":430 + * 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":438 + * 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":440 + * 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":445 + * 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":447 + * 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":448 + * + * 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":449 + * 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 (__pyx_t_1) { + + /* "View.MemoryView":450 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error) + + /* "View.MemoryView":449 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":451 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":447 + * 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":453 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":455 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":456 + * + * 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":457 + * 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":456 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":459 + * ( 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, 459, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":463 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":464 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 464, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":463 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + } + + /* "View.MemoryView":465 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * 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":468 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __pyx_L6_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __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); + } + __Pyx_PyThreadState_assign + 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":438 + * 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":470 + * 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":471 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 471, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":472 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":470 + * 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":474 + * 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":477 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":480 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __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":482 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __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, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } + + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":487 + * 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, 487, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; + + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } + + /* "View.MemoryView":488 + * 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_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":483 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); + + /* "View.MemoryView":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(2, 484, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } + + /* "View.MemoryView":474 + * 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":490 + * 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":493 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":498 + * 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":499 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __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 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":498 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":501 + * 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, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __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, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __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, 501, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":503 + * 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, 503, __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":504 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":503 + * 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":504 + * + * 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":490 + * 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":507 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___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; + Py_ssize_t *__pyx_t_2; + char *__pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":509 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_2 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_2; + + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":511 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":513 + * 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":514 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_2 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_2; + + /* "View.MemoryView":513 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":516 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L4:; + + /* "View.MemoryView":518 + * 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":519 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_2 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_2; + + /* "View.MemoryView":518 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":521 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":523 + * 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":524 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_3 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_3; + + /* "View.MemoryView":523 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":526 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":528 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_4 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":529 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_5 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_5; + + /* "View.MemoryView":530 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = 0 + */ + __pyx_t_6 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_6; + + /* "View.MemoryView":531 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.obj = self + */ + __pyx_t_6 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_6; + + /* "View.MemoryView":532 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":533 + * info.len = self.view.len + * info.readonly = 0 + * 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":507 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + + /* function exit code */ + __pyx_r = 0; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":539 + * + * @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":540 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":541 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error) + + /* "View.MemoryView":542 + * 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":539 + * + * @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":545 + * + * @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":546 + * @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":545 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":549 + * + * @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":550 + * @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, 550, __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, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":549 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_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":553 + * + * @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":554 + * @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 (__pyx_t_1) { + + /* "View.MemoryView":556 + * 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__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 556, __pyx_L1_error) + + /* "View.MemoryView":554 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + } + + /* "View.MemoryView":558 + * 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, 558, __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, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "View.MemoryView":553 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_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":561 + * + * @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":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + } + + /* "View.MemoryView":565 + * 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, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":561 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_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":568 + * + * @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":569 + * @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, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":568 + * + * @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":572 + * + * @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":573 + * @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, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":572 + * + * @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":576 + * + * @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":577 + * @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, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":576 + * + * @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":580 + * + * @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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":582 + * 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":584 + * 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, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":585 + * + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":587 + * 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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":589 + * 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":580 + * + * @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":591 + * 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":592 + * + * 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":593 + * 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":592 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":595 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":591 + * 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":597 + * 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":598 + * + * 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, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":599 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":598 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":597 + * 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":601 + * 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":602 + * + * 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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":601 + * 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":605 + * + * + * 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":608 + * 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":609 + * 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, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":605 + * + * + * 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":611 + * 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":614 + * 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":615 + * 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, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":611 + * 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":617 + * 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":619 + * 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":621 + * 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":622 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 622, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":627 + * 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, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":617 + * 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":629 + * 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":631 + * 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":633 + * 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":634 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 634, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":639 + * 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, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":629 + * 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__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.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__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.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":643 + * + * @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":644 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __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, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":645 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":646 + * 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":643 + * + * @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":649 + * + * @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":650 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":649 + * + * @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":652 + * 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":657 + * 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":658 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":657 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":660 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":662 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":663 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":664 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":665 + * 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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 665, __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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__23); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":669 + * 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":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__24); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":672 + * 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":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":675 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(2, 675, __pyx_L1_error) + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":677 + * 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":678 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":665 + * 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":680 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__25); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":684 + * 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, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "View.MemoryView":652 + * 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":686 + * 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":687 + * + * 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":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":689 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 689, __pyx_L1_error) + + /* "View.MemoryView":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":686 + * 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":696 + * + * @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":697 + * @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":704 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + + /* "View.MemoryView":708 + * 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, 708, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":711 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 711, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":712 + * 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":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":714 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":715 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":721 + * + * + * 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":722 + * + * 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":727 + * + * + * 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":728 + * + * 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":732 + * 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, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 732, __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":733 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":737 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 737, __pyx_L1_error) + + /* "View.MemoryView":734 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 734, __pyx_L1_error) + + /* "View.MemoryView":733 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":741 + * 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":742 + * 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":743 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":744 + * 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":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":746 + * 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, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":747 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":748 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":750 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":751 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":752 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":754 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 754, __pyx_L1_error) + + /* "View.MemoryView":760 + * 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":732 + * 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":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":763 + * + * 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":764 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) } + + /* "View.MemoryView":765 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) } + + /* "View.MemoryView":763 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":769 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":696 + * + * @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":793 + * + * @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":813 + * 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":815 + * 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":816 + * + * 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":815 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_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":818 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 818, __pyx_L1_error) + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":813 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":821 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __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":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_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":824 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error) + + /* "View.MemoryView":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + } + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":828 + * + * 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":829 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":830 + * 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":831 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":830 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":828 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":832 + * 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":833 + * 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":834 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":833 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":836 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":832 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":839 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":841 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":844 + * + * 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":845 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":846 + * 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":847 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":846 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":844 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":848 + * 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":849 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":848 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":852 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":854 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":857 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":861 + * + * 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":863 + * 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":864 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":863 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":866 + * 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":867 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":866 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":870 + * + * + * 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":871 + * + * 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":872 + * 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":875 + * + * + * 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":876 + * + * 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":875 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":878 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":880 + * 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":881 + * + * 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":882 + * 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":883 + * 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":882 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":885 + * 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":886 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":881 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":888 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":880 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":890 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":793 + * + * @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":896 + * + * @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":898 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":899 + * 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":902 + * 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":903 + * + * 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, 903, __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, 903, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":904 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":902 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":906 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":907 + * 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":908 + * 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":909 + * 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":908 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":911 + * 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":912 + * + * 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":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":914 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(2, 914, __pyx_L1_error) + + /* "View.MemoryView":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":911 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":917 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 917, __pyx_L1_error) + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":919 + * 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":920 + * + * 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":921 + * 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":920 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":923 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":896 + * + * @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":929 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + + /* "View.MemoryView":930 + * @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":932 + * 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":933 + * + * 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":937 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":938 + * 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":939 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":940 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L6_bool_binop_done:; + if (__pyx_t_6) { + + /* "View.MemoryView":943 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error) + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + } + } + + /* "View.MemoryView":945 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":929 + * + * @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":962 + * 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":963 + * + * 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":962 + * 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":965 + * __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":966 + * + * 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":967 + * 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, 967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":966 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":969 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 969, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":965 + * __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":971 + * 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":972 + * + * 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":973 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error) + + /* "View.MemoryView":972 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":975 + * 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, 975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":971 + * 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":978 + * + * @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":979 + * @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":978 + * + * @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__27, 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__28, 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":985 + * + * @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":993 + * 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":994 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "View.MemoryView":993 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":999 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __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, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1001 + * 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":1002 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1004 + * __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, 1004, __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":1005 + * + * 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":1007 + * 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":1008 + * + * 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":1009 + * 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":1010 + * 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":1011 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * result.flags = PyBUF_RECORDS + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":1013 + * Py_INCREF(Py_None) + * + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1015 + * result.flags = PyBUF_RECORDS + * + * 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":1016 + * + * 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":1019 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1020 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1022 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":1023 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L5_break; + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L5_break:; + + /* "View.MemoryView":1025 + * 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":1026 + * + * 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, 1026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1027 + * 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, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1029 + * 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":1030 + * + * 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":1032 + * 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":985 + * + * @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":1035 + * + * @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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1039 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1039, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1040 + * 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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1042 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1043 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1035 + * + * @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":1046 + * + * @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; + Py_ssize_t __pyx_t_4; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1050 + * 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":1051 + * + * 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":1052 + * 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":1054 + * 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":1055 + * + * 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":1057 + * 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; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_dim = __pyx_t_3; + + /* "View.MemoryView":1058 + * + * 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":1059 + * 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":1060 + * 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_4 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_4 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4; + } + + /* "View.MemoryView":1046 + * + * @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":1063 + * + * @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":1066 + * "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":1067 + * 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, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1063 + * + * @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":1070 + * + * @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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1078 + * + * 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":1079 + * 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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1081 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1082 + * 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":1084 + * 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":1086 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1070 + * + * @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":1092 + * + * + * 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":1093 + * + * 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":1094 + * 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":1093 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1096 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1092 + * + * + * 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":1099 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1104 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1105 + * 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":1107 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1108 + * + * 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":1109 + * 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":1110 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1108 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1112 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1113 + * + * 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":1114 + * 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":1115 + * 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":1113 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1117 + * 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":1118 + * + * 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":1117 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1120 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1099 + * + * @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":1123 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + + /* "View.MemoryView":1130 + * + * 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":1131 + * 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":1132 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1133 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1135 + * 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":1136 + * + * 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":1137 + * 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":1136 + * + * 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":1138 + * 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): + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + + /* "View.MemoryView":1136 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1140 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1141 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + + /* "View.MemoryView":1142 + * 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":1143 + * 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":1135 + * 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":1145 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1146 + * 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":1150 + * 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":1151 + * 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":1123 + * + * @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":1153 + * 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":1156 + * __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":1153 + * 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":1160 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1163 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1165 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1166 + * + * 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":1168 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1160 + * + * @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":1171 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1180 + * 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":1181 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "View.MemoryView":1182 + * 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":1183 + * 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":1180 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1185 + * 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 > -1L; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1186 + * 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":1187 + * 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":1189 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1171 + * + * @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":1192 + * + * @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; + + /* "View.MemoryView":1203 + * 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":1204 + * + * 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":1206 + * 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":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1208 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error) + + /* "View.MemoryView":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1211 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1212 + * + * 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":1213 + * 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; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1214 + * 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":1215 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1217 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + + /* "View.MemoryView":1221 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1222 + * + * 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":1223 + * 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":1222 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1225 + * 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":1226 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + + /* "View.MemoryView":1225 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1228 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1230 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1192 + * + * @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":1235 + * + * @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":1238 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __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":1237 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 1237, __pyx_L1_error) + + /* "View.MemoryView":1235 + * + * @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":1241 + * + * @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":1242 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_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, 1242, __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, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 1242, __pyx_L1_error) + + /* "View.MemoryView":1241 + * + * @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":1245 + * + * @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":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1247 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_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, 1247, __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, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1247, __pyx_L1_error) + + /* "View.MemoryView":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1249 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(2, 1249, __pyx_L1_error) + } + + /* "View.MemoryView":1245 + * + * @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":1252 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + + /* "View.MemoryView":1260 + * 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":1261 + * """ + * 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":1263 + * 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":1264 + * 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":1265 + * 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":1268 + * 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":1269 + * + * 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":1268 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1271 + * 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":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1273 + * 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":1275 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1276 + * + * 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":1277 + * 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":1278 + * 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":1279 + * 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":1277 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1281 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1281, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1276 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1284 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error) + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + } + } + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1289 + * + * 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":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1291 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1291, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_6; + + /* "View.MemoryView":1292 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1298 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1302 + * 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":1304 + * 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":1305 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + + /* "View.MemoryView":1306 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1307 + * 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":1308 + * 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":1302 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_7 = (__pyx_t_2 != 0); + if (__pyx_t_7) { + + /* "View.MemoryView":1313 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error) + + /* "View.MemoryView":1314 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error) + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1316 + * 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":1317 + * + * 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":1318 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1320 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1321 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1252 + * + * @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":1324 + * + * @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; + + /* "View.MemoryView":1328 + * 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":1330 + * 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 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1331 + * + * 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":1332 + * 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":1333 + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1335 + * 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; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1336 + * + * for i in range(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":1337 + * 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":1338 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1324 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1346 + * + * @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":1350 + * + * + * 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":1351 + * + * 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":1350 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1346 + * + * @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":1355 + * + * @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":1358 + * 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":1355 + * + * @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":1361 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1365 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_3 = (__pyx_v_inc != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1368 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1370 + * 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":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1372 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1373 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1375 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1361 + * + * @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":1381 + * + * @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":1384 + * 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":1385 + * 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":1387 + * _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":1381 + * + * @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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "View.MemoryView":1395 + * 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":1396 + * 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":1398 + * 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":1399 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1400 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1401 + * 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":1398 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1403 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1404 + * 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":1406 + * _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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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 PY_VERSION_HEX >= 0x030400a1 + 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 = 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 = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + 0, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.mesh_utilities.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.mesh_utilities.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.mesh_utilities.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.mesh_utilities._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 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + "mesh_utilities", + __pyx_k_Utilities_for_unstructured_and, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__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_LE, __pyx_k_LE, sizeof(__pyx_k_LE), 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_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__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_n_s_RE, __pyx_k_RE, sizeof(__pyx_k_RE), 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_YTArray, __pyx_k_YTArray, sizeof(__pyx_k_YTArray), 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_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_clamp_edges, __pyx_k_clamp_edges, sizeof(__pyx_k_clamp_edges), 0, 0, 1, 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_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_edge, __pyx_k_edge, sizeof(__pyx_k_edge), 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_fcoords, __pyx_k_fcoords, sizeof(__pyx_k_fcoords), 0, 0, 1, 1}, + {&__pyx_n_s_fill_fcoords, __pyx_k_fill_fcoords, sizeof(__pyx_k_fill_fcoords), 0, 0, 1, 1}, + {&__pyx_n_s_fill_fwidths, __pyx_k_fill_fwidths, sizeof(__pyx_k_fill_fwidths), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__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_fwidth, __pyx_k_fwidth, sizeof(__pyx_k_fwidth), 0, 0, 1, 1}, + {&__pyx_n_s_fwidths, __pyx_k_fwidths, sizeof(__pyx_k_fwidths), 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_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1}, + {&__pyx_n_s_integer_index, __pyx_k_integer_index, sizeof(__pyx_k_integer_index), 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_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 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_nv, __pyx_k_nv, sizeof(__pyx_k_nv), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_pdx, __pyx_k_pdx, sizeof(__pyx_k_pdx), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_s_pleft, __pyx_k_pleft, sizeof(__pyx_k_pleft), 0, 0, 1, 1}, + {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 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_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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 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_smallest_fwidth, __pyx_k_smallest_fwidth, sizeof(__pyx_k_smallest_fwidth), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_start_index, __pyx_k_start_index, sizeof(__pyx_k_start_index), 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_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}, + {&__pyx_n_s_yt_units_yt_array, __pyx_k_yt_units_yt_array, sizeof(__pyx_k_yt_units_yt_array), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_mesh_utilities, __pyx_k_yt_utilities_lib_mesh_utilities, sizeof(__pyx_k_yt_utilities_lib_mesh_utilities), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_mesh_utilities_2, __pyx_k_yt_utilities_lib_mesh_utilities_2, sizeof(__pyx_k_yt_utilities_lib_mesh_utilities_2), 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, 38, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _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, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "View.MemoryView":131 + * + * 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, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "View.MemoryView":134 + * + * 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, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "View.MemoryView":137 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "View.MemoryView":146 + * + * 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, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "View.MemoryView":174 + * 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, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 190, __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":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "View.MemoryView":556 + * 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__19 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __pyx_tuple__20 = PyTuple_New(1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__20, 0, __pyx_int_neg_1); + __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":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); + + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(2, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); + + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + + /* "View.MemoryView":689 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "(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__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "(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__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "yt/utilities/lib/mesh_utilities.pyx":29 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def fill_fcoords(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< + * np.ndarray[np.int64_t, ndim=2] indices, + * int offset = 0): + */ + __pyx_tuple__29 = PyTuple_Pack(10, __pyx_n_s_coords, __pyx_n_s_indices, __pyx_n_s_offset, __pyx_n_s_fcoords, __pyx_n_s_nc, __pyx_n_s_nv, __pyx_n_s_pos, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_mesh_utilities, __pyx_n_s_fill_fcoords, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 29, __pyx_L1_error) + + /* "yt/utilities/lib/mesh_utilities.pyx":52 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def fill_fwidths(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< + * np.ndarray[np.int64_t, ndim=2] indices, + * int offset = 0): + */ + __pyx_tuple__31 = PyTuple_Pack(12, __pyx_n_s_coords, __pyx_n_s_indices, __pyx_n_s_offset, __pyx_n_s_fwidths, __pyx_n_s_nc, __pyx_n_s_nv, __pyx_n_s_LE, __pyx_n_s_RE, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_mesh_utilities, __pyx_n_s_fill_fwidths, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 52, __pyx_L1_error) + + /* "yt/utilities/lib/mesh_utilities.pyx":81 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def smallest_fwidth(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< + * np.ndarray[np.int64_t, ndim=2] indices, + * int offset = 0): + */ + __pyx_tuple__33 = PyTuple_Pack(12, __pyx_n_s_coords, __pyx_n_s_indices, __pyx_n_s_offset, __pyx_n_s_fwidth, __pyx_n_s_pos, __pyx_n_s_nc, __pyx_n_s_nv, __pyx_n_s_LE, __pyx_n_s_RE, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_mesh_utilities, __pyx_n_s_smallest_fwidth, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 81, __pyx_L1_error) + + /* "yt/utilities/lib/mesh_utilities.pyx":108 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def clamp_edges(np.float64_t[:] edge, np.float64_t[:] pleft, # <<<<<<<<<<<<<< + * np.float64_t[:] pdx): + * """Clamp edge to pleft + pdx*n where n is the closest integer + */ + __pyx_tuple__35 = PyTuple_Pack(7, __pyx_n_s_edge, __pyx_n_s_pleft, __pyx_n_s_pdx, __pyx_n_s_start_index, __pyx_n_s_integer_index, __pyx_n_s_shape, __pyx_n_s_i); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_mesh_utilities, __pyx_n_s_clamp_edges, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 108, __pyx_L1_error) + + /* "View.MemoryView":282 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "View.MemoryView":283 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(2, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "View.MemoryView":284 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "View.MemoryView":287 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "View.MemoryView":288 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __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; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initmesh_utilities(void); /*proto*/ +PyMODINIT_FUNC initmesh_utilities(void) +#else +PyMODINIT_FUNC PyInit_mesh_utilities(void); /*proto*/ +PyMODINIT_FUNC PyInit_mesh_utilities(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + static PyThread_type_lock __pyx_t_3[8]; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mesh_utilities(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_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 PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("mesh_utilities", __pyx_methods, __pyx_k_Utilities_for_unstructured_and, 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) + __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_yt__utilities__lib__mesh_utilities) { + 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, "yt.utilities.lib.mesh_utilities")) { + if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.mesh_utilities", __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 init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + __pyx_vtabptr_array = &__pyx_vtable_array; + __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + __pyx_type___pyx_array.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error) + __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __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, 326, __pyx_L1_error) + __pyx_type___pyx_memoryview.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + 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, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "yt/utilities/lib/mesh_utilities.pyx":16 + * #----------------------------------------------------------------------------- + * + * import numpy as np # <<<<<<<<<<<<<< + * cimport numpy as np + * cimport cython + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/mesh_utilities.pyx":21 + * from libc.stdlib cimport malloc, free, abs + * from yt.utilities.lib.fp_utils cimport imax, fmax, imin, fmin, iclip, fclip, i64clip + * from yt.units.yt_array import YTArray # <<<<<<<<<<<<<< + * + * cdef extern from "platform_dep.h": + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_YTArray); + __Pyx_GIVEREF(__pyx_n_s_YTArray); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_YTArray); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_yt_units_yt_array, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __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_YTArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_YTArray, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/mesh_utilities.pyx":29 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def fill_fcoords(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< + * np.ndarray[np.int64_t, ndim=2] indices, + * int offset = 0): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14mesh_utilities_1fill_fcoords, NULL, __pyx_n_s_yt_utilities_lib_mesh_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fill_fcoords, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/mesh_utilities.pyx":52 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def fill_fwidths(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< + * np.ndarray[np.int64_t, ndim=2] indices, + * int offset = 0): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14mesh_utilities_3fill_fwidths, NULL, __pyx_n_s_yt_utilities_lib_mesh_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fill_fwidths, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/mesh_utilities.pyx":81 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def smallest_fwidth(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< + * np.ndarray[np.int64_t, ndim=2] indices, + * int offset = 0): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14mesh_utilities_5smallest_fwidth, NULL, __pyx_n_s_yt_utilities_lib_mesh_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_smallest_fwidth, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/mesh_utilities.pyx":108 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def clamp_edges(np.float64_t[:] edge, np.float64_t[:] pleft, # <<<<<<<<<<<<<< + * np.float64_t[:] pdx): + * """Clamp edge to pleft + pdx*n where n is the closest integer + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14mesh_utilities_7clamp_edges, NULL, __pyx_n_s_yt_utilities_lib_mesh_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_clamp_edges, __pyx_t_2) < 0) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/mesh_utilities.pyx":1 + * """ # <<<<<<<<<<<<<< + * Utilities for unstructured and semi-structured meshes + * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":207 + * 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, 207, __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, 207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":282 + * 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__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":283 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":284 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":287 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":288 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":312 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":313 + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_3[0] = PyThread_allocate_lock(); + __pyx_t_3[1] = PyThread_allocate_lock(); + __pyx_t_3[2] = PyThread_allocate_lock(); + __pyx_t_3[3] = PyThread_allocate_lock(); + __pyx_t_3[4] = PyThread_allocate_lock(); + __pyx_t_3[5] = PyThread_allocate_lock(); + __pyx_t_3[6] = PyThread_allocate_lock(); + __pyx_t_3[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":535 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__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, 535, __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, 535, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":981 + * 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, 981, __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, 981, __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 + */ + __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( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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 yt.utilities.lib.mesh_utilities", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib.mesh_utilities"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #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; @@ -6589,664 +21605,1649 @@ break; } } - } while (ctx->enc_count); - ctx->enc_type = 0; - ctx->is_complex = 0; - return 0; + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +/* GetModuleGlobalName */ + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +/* 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; } -static CYTHON_INLINE PyObject * -__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) -{ - const char *ts = *tsp; - int i = 0, number; - int ndim = ctx->head->field->type->ndim; -; - ++ts; - if (ctx->new_count != 1) { - PyErr_SetString(PyExc_ValueError, - "Cannot handle repeated arrays in format string"); - return NULL; +#endif + +/* ExtTypeTest */ + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; } - 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; + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* BufferFallbackError */ + static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +/* 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; } - 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 (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - if (ctx->head != NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; } - return ts; - case ' ': - case '\r': - case '\n': - ++ts; - break; - case '<': - if (!__Pyx_IsLittleEndian()) { - PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); - return NULL; + 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; } - ctx->new_packmode = '='; - ++ts; - break; - case '>': - case '!': - if (__Pyx_IsLittleEndian()) { - PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); - return NULL; + } + __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; } - 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; + 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; + } } - 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); - } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; } - 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; + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); } - 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; +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#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]; } - 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 { + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; } } - } + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } + } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + Py_FatalError(msg); + va_end(vargs); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; } -static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { - buf->buf = NULL; - buf->obj = NULL; - buf->strides = __Pyx_zeros; - buf->shape = __Pyx_zeros; - buf->suboffsets = __Pyx_minusones; +static CYTHON_INLINE int +__pyx_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 int __Pyx_GetBufferAndValidate( - Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, - int nd, int cast, __Pyx_BufFmt_StackElem* stack) +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) { - if (obj == Py_None || obj == NULL) { - __Pyx_ZeroBuffer(buf); + 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; + } +} + +/* 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) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { +#endif + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { - PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - nd, buf->ndim); - goto fail; - } - if (!cast) { - __Pyx_BufFmt_Context ctx; - __Pyx_BufFmt_Init(&ctx, stack, dtype); - if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; - } - if ((unsigned)buf->itemsize != dtype->size) { - PyErr_Format(PyExc_ValueError, - "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", - buf->itemsize, (buf->itemsize > 1) ? "s" : "", - dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); - goto fail; - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; -} -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { - if (info->buf == NULL) return; - if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; - __Pyx_ReleaseBuffer(info); +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; } -/* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { +/* 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 - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); + 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 = __Pyx_GetBuiltinName(name); + 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; } - return result; +#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"); +/* 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; } - return result; + 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_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_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); #endif + return PyObject_GetAttr(o, n); +} -/* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; +/* 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); } - if (likely(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; } -/* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { - PyErr_SetString(PyExc_ValueError, - "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; } -/* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - 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); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; } -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; +#else +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 -/* 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; +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL +#include "frameobject.h" +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = PyThreadState_GET(); + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; } } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; + 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 - PyErr_NormalizeException(&type, &value, &tb); + 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 + +/* 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 { - 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; - } + return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; } +#endif + +/* GetItemInt */ + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + 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 -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; + 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; } - 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; + 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; } - 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 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 { - type = instance_class; + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); } } + return m->sq_item(o, i); } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { #else - if (cause && cause != Py_None) { + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } #endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* 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); } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); #endif + + } -bad: - Py_XDECREF(owned_instance); - return; + #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 -/* 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"); +/* 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 } -/* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); +/* 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 -/* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { - PyObject *exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; - return PyErr_GivenExceptionMatches(exc_type, err); +/* 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 - -/* 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); + 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 - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} #else - if (unlikely(PyErr_Occurred())) +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 - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; + +/* 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 } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); + 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; + } +} + +/* SetVTable */ + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); #else - PyErr_SetExcInfo(local_type, local_value, local_tb); + 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: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); + Py_XDECREF(ob); return -1; } -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (ret < 0) goto BAD; } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif + PyType_Modified((PyTypeObject*)type_obj); } } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; + goto GOOD; +BAD: + if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +GOOD: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif } /* CodeObjectCache */ @@ -7389,12 +23390,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -7414,6 +23418,8 @@ static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); return -1; } @@ -7424,34 +23430,352 @@ PyBuffer_Release(view); return; } - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } - Py_DECREF(obj); - view->obj = NULL; + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + Py_DECREF(obj); + view->obj = NULL; +} +#endif + + + /* MemviewSliceIsContig */ + static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, + char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) + return 0; + itemsize *= mvs.shape[index]; + } + return 1; +} + +/* OverlappingSlices */ + static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +/* Capsule */ + static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* TypeInfoCompare */ + static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + 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; } -#endif - - - /* 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_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_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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) { @@ -7484,6 +23808,37 @@ } } +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(Py_intptr_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(Py_intptr_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(Py_intptr_t) <= 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(Py_intptr_t), + little, !is_unsigned); + } +} + /* Declarations */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -7825,20 +24180,276 @@ } } +/* 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 int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; + static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + if (sizeof(Py_intptr_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (int) val; + return (Py_intptr_t) val; } } else #endif @@ -7847,32 +24458,32 @@ #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 0: return (Py_intptr_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0]) case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) > 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])); + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) { + return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])); } } break; case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) > 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])); + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) { + return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])); } } break; case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) > 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])); + __PYX_VERIFY_RETURN_INT(Py_intptr_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(Py_intptr_t) >= 4 * PyLong_SHIFT) { + return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])); } } break; @@ -7886,86 +24497,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (int) -1; + return (Py_intptr_t) -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)) + if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, 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)) + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_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 (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 0: return (Py_intptr_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0]) case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) - 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]))); + __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { + return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]))); } } break; case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) > 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]))); + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { + return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]))); } } break; case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) - 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]))); + __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { + return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]))); } } break; case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) > 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]))); + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { + return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]))); } } break; case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) - 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]))); + __PYX_VERIFY_RETURN_INT(Py_intptr_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(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) { + return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]))); } } break; case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) > 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]))); + __PYX_VERIFY_RETURN_INT(Py_intptr_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(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) { + return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]))); } } break; } #endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + if (sizeof(Py_intptr_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, 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)) + } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -7974,7 +24585,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - int val; + Py_intptr_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -7994,55 +24605,24 @@ return val; } #endif - return (int) -1; + return (Py_intptr_t) -1; } } else { - int val; + Py_intptr_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + if (!tmp) return (Py_intptr_t) -1; + val = __Pyx_PyInt_As_Py_intptr_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; + "value too large to convert to Py_intptr_t"); + return (Py_intptr_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -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); - } + "can't convert negative value to Py_intptr_t"); + return (Py_intptr_t) -1; } /* CIntFromPy */ @@ -8234,6 +24814,226 @@ 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]; @@ -8359,6 +25159,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -8367,11 +25169,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/mesh_utilities.pyx yt-3.4.0/yt/utilities/lib/mesh_utilities.pyx --- yt-3.3.3/yt/utilities/lib/mesh_utilities.pyx 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/mesh_utilities.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -18,6 +18,10 @@ cimport cython from libc.stdlib cimport malloc, free, abs from yt.utilities.lib.fp_utils cimport imax, fmax, imin, fmin, iclip, fclip, i64clip +from yt.units.yt_array import YTArray + +cdef extern from "platform_dep.h": + double rint(double x) @cython.boundscheck(False) @cython.wraparound(False) @@ -98,3 +102,19 @@ fwidth = fmin(fwidth, RE[j] - LE[j]) return fwidth +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +def clamp_edges(np.float64_t[:] edge, np.float64_t[:] pleft, + np.float64_t[:] pdx): + """Clamp edge to pleft + pdx*n where n is the closest integer + + Note that edge is modified in-place. + """ + cdef np.float64_t start_index + cdef np.float64_t integer_index + cdef np.intp_t shape = edge.shape[0] + for i in range(shape): + start_index = (edge[i] - pleft[i]) / pdx[i] + integer_index = rint(start_index) + edge[i] = integer_index * pdx[i] + pleft[i] diff -Nru yt-3.3.3/yt/utilities/lib/misc_utilities.c yt-3.4.0/yt/utilities/lib/misc_utilities.c --- yt-3.3.3/yt/utilities/lib/misc_utilities.c 2016-12-12 01:41:57.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/misc_utilities.c 2017-08-10 18:20:51.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,8 +6,15 @@ "depends": [ "yt/utilities/lib/platform_dep.h" ], + "include_dirs": [ + "yt/utilities/lib" + ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.misc_utilities", + "sources": [ + "yt/utilities/lib/misc_utilities.pyx" ] }, "module_name": "yt.utilities.lib.misc_utilities" @@ -21,7 +28,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -43,6 +50,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -195,16 +203,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -331,6 +343,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -385,6 +403,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -496,8 +543,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -510,8 +557,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -633,10 +683,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -670,9 +722,9 @@ static const char *__pyx_f[] = { "yt/utilities/lib/misc_utilities.pyx", + "stringsource", "__init__.pxd", "yt/geometry/selection_routines.pxd", - "stringsource", "type.pxd", "bool.pxd", "complex.pxd", @@ -1010,6 +1062,7 @@ struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject; struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector; struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector; struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect; struct __pyx_array_obj; struct __pyx_MemviewEnum_obj; @@ -1121,7 +1174,7 @@ __pyx_t_5numpy_float64_t right_edge_x; __pyx_t_5numpy_float64_t right_edge_y; __pyx_t_5numpy_float64_t right_edge_z; - __pyx_t_5numpy_int64_t children_pointers; + __pyx_t_5numpy_int_t children_pointers; __pyx_t_5numpy_int64_t start_index_x; __pyx_t_5numpy_int64_t start_index_y; __pyx_t_5numpy_int64_t start_index_z; @@ -1163,7 +1216,7 @@ struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid; struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells; -/* "yt/geometry/selection_routines.pxd":42 +/* "yt/geometry/selection_routines.pxd":38 * cdef np.int64_t _hash * * cdef void recursively_visit_octs(self, Oct *root, # <<<<<<<<<<<<<< @@ -1175,7 +1228,7 @@ int visit_covered; }; -/* "yt/geometry/selection_routines.pxd":50 +/* "yt/geometry/selection_routines.pxd":46 * np.float64_t spos[3], np.float64_t sdds[3], * OctVisitor visitor, int i, int j, int k) * cdef int select_grid(self, np.float64_t left_edge[3], # <<<<<<<<<<<<<< @@ -1187,7 +1240,7 @@ struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o; }; -/* "yt/geometry/selection_routines.pxd":65 +/* "yt/geometry/selection_routines.pxd":61 * np.ndarray[np.uint8_t, ndim=3] mask, * int level) * cdef void visit_grid_cells(self, GridVisitorData *data, # <<<<<<<<<<<<<< @@ -1457,12 +1510,12 @@ struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base; __Pyx_memviewslice ref_mask; struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs; - __pyx_t_5numpy_int64_t *nocts; - __pyx_t_5numpy_int64_t *nfinest; + __pyx_t_5numpy_uint64_t *nocts; + __pyx_t_5numpy_uint64_t *nfinest; }; -/* "yt/geometry/selection_routines.pxd":33 +/* "yt/geometry/selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1482,7 +1535,7 @@ }; -/* "yt/geometry/selection_routines.pxd":71 +/* "yt/geometry/selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1494,7 +1547,7 @@ }; -/* "yt/geometry/selection_routines.pxd":74 +/* "yt/geometry/selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1508,7 +1561,21 @@ }; -/* "yt/utilities/lib/misc_utilities.pyx":1035 +/* "yt/geometry/selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ +struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1; + struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2; +}; + + +/* "yt/utilities/lib/misc_utilities.pyx":1055 * # This is under the CC-BY-SA license. * * cdef class OnceIndirect: # <<<<<<<<<<<<<< @@ -1913,7 +1980,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree; -/* "yt/geometry/selection_routines.pxd":33 +/* "yt/geometry/selection_routines.pxd":29 * return arr * * cdef class SelectorObject: # <<<<<<<<<<<<<< @@ -1936,7 +2003,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject; -/* "yt/geometry/selection_routines.pxd":71 +/* "yt/geometry/selection_routines.pxd":67 * cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil * * cdef class AlwaysSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1950,7 +2017,7 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector; -/* "yt/geometry/selection_routines.pxd":74 +/* "yt/geometry/selection_routines.pxd":70 * pass * * cdef class OctreeSubsetSelector(SelectorObject): # <<<<<<<<<<<<<< @@ -1964,6 +2031,20 @@ static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector; +/* "yt/geometry/selection_routines.pxd":74 + * cdef public np.int64_t domain_id + * + * cdef class BooleanSelector(SelectorObject): # <<<<<<<<<<<<<< + * cdef public SelectorObject sel1 + * cdef public SelectorObject sel2 + */ + +struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector { + struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector; + + /* "View.MemoryView":951 * * @cname('__pyx_memoryviewslice') @@ -2083,7 +2164,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) @@ -2149,12 +2230,6 @@ #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif -/* BufferIndexError.proto */ -static void __Pyx_RaiseBufferIndexError(int axis); - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); @@ -2181,6 +2256,19 @@ /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); +/* BufferIndexError.proto */ +static void __Pyx_RaiseBufferIndexError(int axis); + +/* 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() + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); @@ -2216,6 +2304,12 @@ /* BufferFallbackError.proto */ static void __Pyx_RaiseBufferFallbackError(void); +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { @@ -2339,8 +2433,19 @@ 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 *); +/* 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( @@ -2348,6 +2453,9 @@ 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) @@ -2414,14 +2522,20 @@ int lineno, const char *filename, int full_traceback, int nogil); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); /* CodeObjectCache.proto */ typedef struct { @@ -2516,8 +2630,9 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); -/* None.proto */ -static CYTHON_INLINE long __Pyx_pow_long(long, long); +/* 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); @@ -2824,6 +2939,7 @@ static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0; static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0; +static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0; static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *); /*proto*/ /* Module declarations from 'yt.utilities.lib.misc_utilities' */ @@ -2872,6 +2988,7 @@ 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_intp_t = { "intp_t", NULL, sizeof(__pyx_t_5numpy_intp_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_intp_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_intp_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; @@ -2884,12 +3001,12 @@ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_Ellipsis; -static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_O[] = "O"; @@ -2900,6 +3017,7 @@ static const char __pyx_k_k[] = "k"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_p[] = "p"; +static const char __pyx_k_r[] = "r"; static const char __pyx_k_v[] = "v"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; @@ -2913,6 +3031,9 @@ static const char __pyx_k_fi[] = "fi"; static const char __pyx_k_gi[] = "gi"; static const char __pyx_k_id[] = "id"; +static const char __pyx_k_ks[] = "ks"; +static const char __pyx_k_kx[] = "kx"; +static const char __pyx_k_ky[] = "ky"; static const char __pyx_k_ld[] = "ld"; static const char __pyx_k_ma[] = "ma"; static const char __pyx_k_mi[] = "mi"; @@ -2930,6 +3051,7 @@ static const char __pyx_k_ok[] = "ok"; static const char __pyx_k_px[] = "px"; static const char __pyx_k_py[] = "py"; +static const char __pyx_k_r2[] = "r2"; static const char __pyx_k_rf[] = "rf"; static const char __pyx_k_rg[] = "rg"; static const char __pyx_k_rv[] = "rv"; @@ -2958,7 +3080,7 @@ static const char __pyx_k_zg[] = "zg"; static const char __pyx_k_zi[] = "zi"; static const char __pyx_k_zs[] = "zs"; -static const char __pyx_k__55[] = "_"; +static const char __pyx_k__63[] = "_"; static const char __pyx_k_bin[] = "bin"; static const char __pyx_k_dds[] = "dds"; static const char __pyx_k_dim[] = "dim"; @@ -2967,9 +3089,11 @@ static const char __pyx_k_dzy[] = "dzy"; static const char __pyx_k_eps[] = "eps"; static const char __pyx_k_err[] = "err"; +static const char __pyx_k_idx[] = "idx"; static const char __pyx_k_ind[] = "ind"; static const char __pyx_k_lfd[] = "lfd"; static const char __pyx_k_n_q[] = "n_q"; +static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_off[] = "off"; static const char __pyx_k_osp[] = "osp"; @@ -3001,6 +3125,7 @@ static const char __pyx_k_crop[] = "crop"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_dest[] = "dest"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_dims[] = "dims"; static const char __pyx_k_flip[] = "flip"; static const char __pyx_k_grid[] = "grid"; @@ -3043,6 +3168,7 @@ static const char __pyx_k_finfo[] = "finfo"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_image[] = "image"; +static const char __pyx_k_int64[] = "int64"; static const char __pyx_k_leftx[] = "leftx"; static const char __pyx_k_lefty[] = "lefty"; static const char __pyx_k_level[] = "level"; @@ -3052,6 +3178,7 @@ static const char __pyx_k_numpy[] = "numpy"; static const char __pyx_k_oldwr[] = "oldwr"; static const char __pyx_k_point[] = "point"; +static const char __pyx_k_radii[] = "radii"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_shape[] = "shape"; static const char __pyx_k_split[] = "split"; @@ -3062,6 +3189,7 @@ static const char __pyx_k_value[] = "value"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_zeros[] = "zeros"; +static const char __pyx_k_arange[] = "arange"; static const char __pyx_k_astype[] = "astype"; static const char __pyx_k_bins_x[] = "bins_x"; static const char __pyx_k_bins_y[] = "bins_y"; @@ -3084,6 +3212,8 @@ static const char __pyx_k_nfield[] = "nfield"; static const char __pyx_k_ofield[] = "ofield"; static const char __pyx_k_period[] = "period"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_result[] = "result"; static const char __pyx_k_rightx[] = "rightx"; static const char __pyx_k_righty[] = "righty"; static const char __pyx_k_skipit[] = "skipit"; @@ -3093,6 +3223,7 @@ static const char __pyx_k_update[] = "update"; static const char __pyx_k_zlines[] = "zlines"; static const char __pyx_k_YTArray[] = "YTArray"; +static const char __pyx_k_argsort[] = "argsort"; static const char __pyx_k_box_dds[] = "box_dds"; static const char __pyx_k_bresult[] = "bresult"; static const char __pyx_k_bsource[] = "bsource"; @@ -3128,6 +3259,7 @@ static const char __pyx_k_my_split[] = "my_split"; static const char __pyx_k_n_unique[] = "n_unique"; static const char __pyx_k_no_color[] = "no_color"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_r_corner[] = "r_corner"; static const char __pyx_k_truncate[] = "truncate"; static const char __pyx_k_yt_funcs[] = "yt.funcs"; @@ -3139,6 +3271,7 @@ static const char __pyx_k_left_edge[] = "left_edge"; static const char __pyx_k_min_index[] = "min_index"; static const char __pyx_k_min_level[] = "min_level"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_refine_by[] = "refine_by"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; @@ -3156,6 +3289,7 @@ static const char __pyx_k_zeros_like[] = "zeros_like"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_bulk_vector[] = "bulk_vector"; static const char __pyx_k_code_length[] = "code_length"; static const char __pyx_k_field_names[] = "field_names"; @@ -3165,10 +3299,13 @@ static const char __pyx_k_right_edges[] = "right_edges"; static const char __pyx_k_want_format[] = "want_format"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_bval_mresult[] = "bval_mresult"; static const char __pyx_k_check_period[] = "check_period"; static const char __pyx_k_grid_objects[] = "grid_objects"; static const char __pyx_k_input_fields[] = "input_fields"; static const char __pyx_k_output_level[] = "output_level"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_bin_profile1d[] = "bin_profile1d"; static const char __pyx_k_bin_profile2d[] = "bin_profile2d"; static const char __pyx_k_bin_profile3d[] = "bin_profile3d"; @@ -3177,13 +3314,16 @@ static const char __pyx_k_obtain_rv_vec[] = "obtain_rv_vec"; static const char __pyx_k_output_fields[] = "output_fields"; static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_want_writable[] = "want_writable"; static const char __pyx_k_allow_indirect[] = "allow_indirect"; static const char __pyx_k_box_right_edge[] = "box_right_edge"; static const char __pyx_k_rotate_vectors[] = "rotate_vectors"; static const char __pyx_k_this_potential[] = "this_potential"; +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_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_total_potential[] = "total_potential"; static const char __pyx_k_convert_to_units[] = "convert_to_units"; static const char __pyx_k_get_color_bounds[] = "get_color_bounds"; @@ -3192,7 +3332,9 @@ static const char __pyx_k_new_bin_profile1d[] = "new_bin_profile1d"; static const char __pyx_k_new_bin_profile2d[] = "new_bin_profile2d"; static const char __pyx_k_new_bin_profile3d[] = "new_bin_profile3d"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; static const char __pyx_k_yt_units_yt_array[] = "yt.units.yt_array"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_kdtree_get_choices[] = "kdtree_get_choices"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_get_box_grids_level[] = "get_box_grids_level"; @@ -3212,17 +3354,17 @@ static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_gravitational_binding_energy[] = "gravitational_binding_energy"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/misc_utilities.pyx"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_Simple_utilities_that_don_t_fit[] = "\nSimple utilities that don't fit anywhere else\n\n\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_yt_utilities_lib_misc_utilities[] = "yt.utilities.lib.misc_utilities"; +static const char __pyx_k_yt_utilities_lib_misc_utilities[] = "yt/utilities/lib/misc_utilities.pyx"; static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Calculating_potential_for_d_cell[] = "Calculating potential for %d cells"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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"; @@ -3232,8 +3374,10 @@ static const char __pyx_k_couldn_t_provide_writable_you_sh[] = "couldn't provide writable, you should have demanded it earlier"; 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_yt_utilities_lib_misc_utilities_2[] = "yt.utilities.lib.misc_utilities"; 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; @@ -3245,6 +3389,7 @@ 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; @@ -3257,19 +3402,22 @@ 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_n_s_R; static PyObject *__pyx_n_s_RE; 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_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_n_s_YTArray; -static PyObject *__pyx_n_s__55; +static PyObject *__pyx_n_s__63; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_allow_indirect; static PyObject *__pyx_n_s_alpha; static PyObject *__pyx_n_s_antialias; +static PyObject *__pyx_n_s_arange; +static PyObject *__pyx_n_s_argsort; static PyObject *__pyx_n_s_astype; static PyObject *__pyx_n_s_base; static PyObject *__pyx_n_s_best_dim; @@ -3297,11 +3445,13 @@ static PyObject *__pyx_n_s_bulk_velocity; static PyObject *__pyx_n_s_bv; static PyObject *__pyx_n_s_bval; +static PyObject *__pyx_n_s_bval_mresult; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_u_c; static PyObject *__pyx_n_s_center; static PyObject *__pyx_n_s_check_period; static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_code_length; static PyObject *__pyx_n_s_colors; static PyObject *__pyx_kp_s_contiguous_and_direct; @@ -3313,6 +3463,7 @@ static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_dds; static PyObject *__pyx_n_s_dest; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dim; static PyObject *__pyx_n_s_dimensions; static PyObject *__pyx_n_s_dims; @@ -3365,6 +3516,7 @@ static PyObject *__pyx_n_s_has_alpha; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_idx; static PyObject *__pyx_n_s_ifield; static PyObject *__pyx_n_s_iind; static PyObject *__pyx_n_s_image; @@ -3373,6 +3525,7 @@ static PyObject *__pyx_n_s_ind; static PyObject *__pyx_n_s_input_fields; static PyObject *__pyx_n_s_inside; +static PyObject *__pyx_n_s_int64; static PyObject *__pyx_n_s_ipos; static PyObject *__pyx_n_s_ires; static PyObject *__pyx_n_s_itemsize; @@ -3381,6 +3534,9 @@ static PyObject *__pyx_n_s_k; static PyObject *__pyx_n_s_kdtree_get_choices; static PyObject *__pyx_n_s_kinetic; +static PyObject *__pyx_n_s_ks; +static PyObject *__pyx_n_s_kx; +static PyObject *__pyx_n_s_ky; static PyObject *__pyx_n_s_l_corner; static PyObject *__pyx_n_s_ld; static PyObject *__pyx_n_s_left_edge; @@ -3420,6 +3576,7 @@ 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_new_bin_profile1d; static PyObject *__pyx_n_s_new_bin_profile2d; static PyObject *__pyx_n_s_new_bin_profile3d; @@ -3430,6 +3587,7 @@ static PyObject *__pyx_n_s_nk; static PyObject *__pyx_n_s_nl; static PyObject *__pyx_n_s_no_color; +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; @@ -3460,18 +3618,28 @@ static PyObject *__pyx_n_s_pdx; static PyObject *__pyx_n_s_pdy; static PyObject *__pyx_n_s_period; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_point; static PyObject *__pyx_n_s_points_per_color; static PyObject *__pyx_n_s_px; static PyObject *__pyx_n_s_py; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_q_inner; static PyObject *__pyx_n_s_q_outer; static PyObject *__pyx_n_s_qresult; +static PyObject *__pyx_n_s_r; +static PyObject *__pyx_n_s_r2; static PyObject *__pyx_n_s_r_corner; +static PyObject *__pyx_n_s_radii; static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_refine_by; +static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_rf; static PyObject *__pyx_n_s_rg; static PyObject *__pyx_n_s_right_edge; @@ -3484,6 +3652,7 @@ static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_rvf; static PyObject *__pyx_n_s_rvg; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_skipit; @@ -3497,6 +3666,7 @@ static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; static PyObject *__pyx_kp_s_strided_and_indirect; static PyObject *__pyx_n_s_strides; +static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_struct; static PyObject *__pyx_n_s_suboffsets; static PyObject *__pyx_n_s_sx; @@ -3564,7 +3734,8 @@ static PyObject *__pyx_n_s_ys; static PyObject *__pyx_n_s_yt_funcs; static PyObject *__pyx_n_s_yt_units_yt_array; -static PyObject *__pyx_n_s_yt_utilities_lib_misc_utilities; +static PyObject *__pyx_kp_s_yt_utilities_lib_misc_utilities; +static PyObject *__pyx_n_s_yt_utilities_lib_misc_utilities_2; static PyObject *__pyx_n_s_z; static PyObject *__pyx_n_s_z0; static PyObject *__pyx_n_s_z1; @@ -3587,7 +3758,7 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_10bin_profile3d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_bins_x, PyArrayObject *__pyx_v_bins_y, PyArrayObject *__pyx_v_bins_z, PyArrayObject *__pyx_v_wsource, PyArrayObject *__pyx_v_bsource, PyArrayObject *__pyx_v_wresult, PyArrayObject *__pyx_v_bresult, PyArrayObject *__pyx_v_mresult, PyArrayObject *__pyx_v_qresult, PyArrayObject *__pyx_v_used); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_12lines(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_image, __Pyx_memviewslice __pyx_v_xs, __Pyx_memviewslice __pyx_v_ys, __Pyx_memviewslice __pyx_v_colors, int __pyx_v_points_per_color, int __pyx_v_thick, int __pyx_v_flip, int __pyx_v_crop); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_14zlines(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_zbuffer, PyArrayObject *__pyx_v_xs, PyArrayObject *__pyx_v_ys, PyArrayObject *__pyx_v_zs, PyArrayObject *__pyx_v_colors, int __pyx_v_points_per_color, int __pyx_v_thick, int __pyx_v_flip, int __pyx_v_crop); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_16zpoints(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_zbuffer, PyArrayObject *__pyx_v_xs, PyArrayObject *__pyx_v_ys, PyArrayObject *__pyx_v_zs, PyArrayObject *__pyx_v_colors, int __pyx_v_points_per_color, CYTHON_UNUSED int __pyx_v_thick, int __pyx_v_flip); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_16zpoints(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_zbuffer, PyArrayObject *__pyx_v_xs, PyArrayObject *__pyx_v_ys, PyArrayObject *__pyx_v_zs, PyArrayObject *__pyx_v_colors, PyArrayObject *__pyx_v_radii, int __pyx_v_points_per_color, CYTHON_UNUSED int __pyx_v_thick, int __pyx_v_flip); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_18rotate_vectors(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vecs, PyArrayObject *__pyx_v_R); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_20get_color_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_px, PyArrayObject *__pyx_v_py, PyArrayObject *__pyx_v_pdx, PyArrayObject *__pyx_v_pdy, PyArrayObject *__pyx_v_value, __pyx_t_5numpy_float64_t __pyx_v_leftx, __pyx_t_5numpy_float64_t __pyx_v_rightx, __pyx_t_5numpy_float64_t __pyx_v_lefty, __pyx_t_5numpy_float64_t __pyx_v_righty, __pyx_t_5numpy_float64_t __pyx_v_mindx, __pyx_t_5numpy_float64_t __pyx_v_maxdx); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_22kdtree_get_choices(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_l_corner, PyArrayObject *__pyx_v_r_corner); /* proto */ @@ -3597,12 +3768,14 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_30obtain_rvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_32obtain_rv_vec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_field_names, PyObject *__pyx_v_bulk_vector); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_34grow_flagging_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_oofield); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_36fill_region(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input_fields, PyObject *__pyx_v_output_fields, __pyx_t_5numpy_int32_t __pyx_v_output_level, PyArrayObject *__pyx_v_left_index, PyArrayObject *__pyx_v_ipos, PyArrayObject *__pyx_v_ires, PyArrayObject *__pyx_v_level_dims, __pyx_t_5numpy_int64_t __pyx_v_refine_by); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_36fill_region(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input_fields, PyObject *__pyx_v_output_fields, __pyx_t_5numpy_int32_t __pyx_v_output_level, PyArrayObject *__pyx_v_left_index, PyArrayObject *__pyx_v_ipos, PyArrayObject *__pyx_v_ires, PyArrayObject *__pyx_v_level_dims, PyArrayObject *__pyx_v_refine_by); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_38fill_region_float(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_fcoords, PyArrayObject *__pyx_v_fwidth, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_box_left_edge, PyArrayObject *__pyx_v_box_right_edge, PyArrayObject *__pyx_v_dest, int __pyx_v_antialias, PyObject *__pyx_v_period, int __pyx_v_check_period); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_40gravitational_binding_energy(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_mass, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_y, __Pyx_memviewslice __pyx_v_z, int __pyx_v_truncate, __pyx_t_5numpy_float64_t __pyx_v_kinetic); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect___cinit__(struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_want_writable, PyObject *__pyx_v_want_format, PyObject *__pyx_v_allow_indirect); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_2__getbuffer__(struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect *__pyx_v_self, Py_buffer *__pyx_v_buff, int __pyx_v_flags); /* proto */ static void __pyx_pf_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_4__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect *__pyx_v_self, CYTHON_UNUSED 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 */ @@ -3612,8 +3785,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -3635,8 +3812,13 @@ 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_2yt_9utilities_3lib_14misc_utilities_OnceIndirect(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*/ @@ -3646,6 +3828,7 @@ static PyObject *__pyx_int_1; static PyObject *__pyx_int_3; static PyObject *__pyx_int_4; +static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; @@ -3656,9 +3839,9 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__37; -static PyObject *__pyx_slice__38; -static PyObject *__pyx_slice__39; +static PyObject *__pyx_slice__43; +static PyObject *__pyx_slice__44; +static PyObject *__pyx_slice__45; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -3686,18 +3869,22 @@ static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; static PyObject *__pyx_tuple__40; static PyObject *__pyx_tuple__41; -static PyObject *__pyx_tuple__43; -static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__46; static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__53; -static PyObject *__pyx_tuple__56; -static PyObject *__pyx_tuple__58; -static PyObject *__pyx_tuple__60; -static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__61; static PyObject *__pyx_tuple__64; static PyObject *__pyx_tuple__66; static PyObject *__pyx_tuple__68; @@ -3709,21 +3896,22 @@ static PyObject *__pyx_tuple__80; static PyObject *__pyx_tuple__82; static PyObject *__pyx_tuple__84; -static PyObject *__pyx_tuple__85; static PyObject *__pyx_tuple__86; -static PyObject *__pyx_tuple__87; static PyObject *__pyx_tuple__88; -static PyObject *__pyx_codeobj__42; -static PyObject *__pyx_codeobj__44; -static PyObject *__pyx_codeobj__46; -static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__93; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__96; +static PyObject *__pyx_tuple__97; static PyObject *__pyx_codeobj__50; static PyObject *__pyx_codeobj__52; static PyObject *__pyx_codeobj__54; -static PyObject *__pyx_codeobj__57; -static PyObject *__pyx_codeobj__59; -static PyObject *__pyx_codeobj__61; -static PyObject *__pyx_codeobj__63; +static PyObject *__pyx_codeobj__56; +static PyObject *__pyx_codeobj__58; +static PyObject *__pyx_codeobj__60; +static PyObject *__pyx_codeobj__62; static PyObject *__pyx_codeobj__65; static PyObject *__pyx_codeobj__67; static PyObject *__pyx_codeobj__69; @@ -3734,6 +3922,11 @@ static PyObject *__pyx_codeobj__79; static PyObject *__pyx_codeobj__81; static PyObject *__pyx_codeobj__83; +static PyObject *__pyx_codeobj__85; +static PyObject *__pyx_codeobj__87; +static PyObject *__pyx_codeobj__89; +static PyObject *__pyx_codeobj__91; +static PyObject *__pyx_codeobj__98; /* "yt/utilities/lib/misc_utilities.pyx":41 * @cython.wraparound(False) @@ -3766,13 +3959,21 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -3781,36 +3982,43 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wsource)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("new_bin_profile1d", 1, 8, 8, 1); __PYX_ERR(0, 41, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bsource)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("new_bin_profile1d", 1, 8, 8, 2); __PYX_ERR(0, 41, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wresult)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("new_bin_profile1d", 1, 8, 8, 3); __PYX_ERR(0, 41, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bresult)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("new_bin_profile1d", 1, 8, 8, 4); __PYX_ERR(0, 41, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mresult)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("new_bin_profile1d", 1, 8, 8, 5); __PYX_ERR(0, 41, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qresult)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("new_bin_profile1d", 1, 8, 8, 6); __PYX_ERR(0, 41, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_used)) != 0)) kw_args--; else { @@ -3875,6 +4083,7 @@ __pyx_t_5numpy_float64_t __pyx_v_wval; __pyx_t_5numpy_float64_t __pyx_v_bval; __pyx_t_5numpy_float64_t __pyx_v_oldwr; + __pyx_t_5numpy_float64_t __pyx_v_bval_mresult; int __pyx_v_nb; int __pyx_v_nf; __Pyx_LocalBuf_ND __pyx_pybuffernd_bins_x; @@ -3915,8 +4124,6 @@ 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; __Pyx_RefNannySetupContext("new_bin_profile1d", 0); __pyx_pybuffer_bins_x.pybuffer.buf = NULL; __pyx_pybuffer_bins_x.refcount = 0; @@ -3993,7 +4200,7 @@ /* "yt/utilities/lib/misc_utilities.pyx":51 * cdef int n, fi, bin - * cdef np.float64_t wval, bval, oldwr + * cdef np.float64_t wval, bval, oldwr, bval_mresult * cdef int nb = bins_x.shape[0] # <<<<<<<<<<<<<< * cdef int nf = bsource.shape[1] * for n in range(nb): @@ -4001,7 +4208,7 @@ __pyx_v_nb = (__pyx_v_bins_x->dimensions[0]); /* "yt/utilities/lib/misc_utilities.pyx":52 - * cdef np.float64_t wval, bval, oldwr + * cdef np.float64_t wval, bval, oldwr, bval_mresult * cdef int nb = bins_x.shape[0] * cdef int nf = bsource.shape[1] # <<<<<<<<<<<<<< * for n in range(nb): @@ -4065,7 +4272,7 @@ * wresult[bin] += wval * for fi in range(nf): # <<<<<<<<<<<<<< * bval = bsource[n,fi] - * # qresult has to have the previous wresult + * bval_mresult = bval - mresult[bin,fi] */ __pyx_t_7 = __pyx_v_nf; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { @@ -4075,73 +4282,72 @@ * wresult[bin] += wval * for fi in range(nf): * bval = bsource[n,fi] # <<<<<<<<<<<<<< + * bval_mresult = bval - mresult[bin,fi] * # qresult has to have the previous wresult - * qresult[bin,fi] += (oldwr * wval * (bval - mresult[bin,fi])**2) / \ */ __pyx_t_9 = __pyx_v_n; __pyx_t_10 = __pyx_v_fi; __pyx_v_bval = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_bsource.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bsource.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_bsource.diminfo[1].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":61 + /* "yt/utilities/lib/misc_utilities.pyx":60 + * for fi in range(nf): * bval = bsource[n,fi] + * bval_mresult = bval - mresult[bin,fi] # <<<<<<<<<<<<<< * # qresult has to have the previous wresult - * qresult[bin,fi] += (oldwr * wval * (bval - mresult[bin,fi])**2) / \ # <<<<<<<<<<<<<< - * (oldwr + wval) - * bresult[bin,fi] += wval*bval + * qresult[bin,fi] += oldwr * wval * bval_mresult * bval_mresult / \ */ __pyx_t_11 = __pyx_v_bin; __pyx_t_12 = __pyx_v_fi; + __pyx_v_bval_mresult = (__pyx_v_bval - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_mresult.diminfo[1].strides))); /* "yt/utilities/lib/misc_utilities.pyx":62 + * bval_mresult = bval - mresult[bin,fi] * # qresult has to have the previous wresult - * qresult[bin,fi] += (oldwr * wval * (bval - mresult[bin,fi])**2) / \ - * (oldwr + wval) # <<<<<<<<<<<<<< + * qresult[bin,fi] += oldwr * wval * bval_mresult * bval_mresult / \ # <<<<<<<<<<<<<< + * (oldwr + wval) * bresult[bin,fi] += wval*bval - * # mresult needs the new wresult */ __pyx_t_13 = __pyx_v_bin; __pyx_t_14 = __pyx_v_fi; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_qresult.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_qresult.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_qresult.diminfo[1].strides) += (((__pyx_v_oldwr * __pyx_v_wval) * pow((__pyx_v_bval - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_mresult.diminfo[1].strides))), 2.0)) / (__pyx_v_oldwr + __pyx_v_wval)); + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_qresult.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_qresult.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_qresult.diminfo[1].strides) += ((((__pyx_v_oldwr * __pyx_v_wval) * __pyx_v_bval_mresult) * __pyx_v_bval_mresult) / (__pyx_v_oldwr + __pyx_v_wval)); - /* "yt/utilities/lib/misc_utilities.pyx":63 - * qresult[bin,fi] += (oldwr * wval * (bval - mresult[bin,fi])**2) / \ + /* "yt/utilities/lib/misc_utilities.pyx":64 + * qresult[bin,fi] += oldwr * wval * bval_mresult * bval_mresult / \ * (oldwr + wval) * bresult[bin,fi] += wval*bval # <<<<<<<<<<<<<< * # mresult needs the new wresult - * mresult[bin,fi] += wval * (bval - mresult[bin,fi]) / wresult[bin] + * mresult[bin,fi] += wval * bval_mresult / wresult[bin] */ __pyx_t_15 = __pyx_v_bin; __pyx_t_16 = __pyx_v_fi; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_bresult.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bresult.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_bresult.diminfo[1].strides) += (__pyx_v_wval * __pyx_v_bval); - /* "yt/utilities/lib/misc_utilities.pyx":65 + /* "yt/utilities/lib/misc_utilities.pyx":66 * bresult[bin,fi] += wval*bval * # mresult needs the new wresult - * mresult[bin,fi] += wval * (bval - mresult[bin,fi]) / wresult[bin] # <<<<<<<<<<<<<< + * mresult[bin,fi] += wval * bval_mresult / wresult[bin] # <<<<<<<<<<<<<< * used[bin] = 1 * return */ __pyx_t_17 = __pyx_v_bin; - __pyx_t_18 = __pyx_v_fi; - __pyx_t_19 = __pyx_v_bin; - __pyx_t_20 = __pyx_v_bin; - __pyx_t_21 = __pyx_v_fi; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_mresult.diminfo[1].strides) += ((__pyx_v_wval * (__pyx_v_bval - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_mresult.diminfo[1].strides)))) / (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_wresult.diminfo[0].strides))); + __pyx_t_18 = __pyx_v_bin; + __pyx_t_19 = __pyx_v_fi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_mresult.diminfo[1].strides) += ((__pyx_v_wval * __pyx_v_bval_mresult) / (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_wresult.diminfo[0].strides))); } - /* "yt/utilities/lib/misc_utilities.pyx":66 + /* "yt/utilities/lib/misc_utilities.pyx":67 * # mresult needs the new wresult - * mresult[bin,fi] += wval * (bval - mresult[bin,fi]) / wresult[bin] + * mresult[bin,fi] += wval * bval_mresult / wresult[bin] * used[bin] = 1 # <<<<<<<<<<<<<< * return * */ - __pyx_t_22 = __pyx_v_bin; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_used.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_used.diminfo[0].strides) = 1; + __pyx_t_20 = __pyx_v_bin; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_used.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_used.diminfo[0].strides) = 1; } - /* "yt/utilities/lib/misc_utilities.pyx":67 - * mresult[bin,fi] += wval * (bval - mresult[bin,fi]) / wresult[bin] + /* "yt/utilities/lib/misc_utilities.pyx":68 + * mresult[bin,fi] += wval * bval_mresult / wresult[bin] * used[bin] = 1 * return # <<<<<<<<<<<<<< * @@ -4192,7 +4398,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":72 +/* "yt/utilities/lib/misc_utilities.pyx":73 * @cython.wraparound(False) * @cython.cdivision(True) * def new_bin_profile2d(np.ndarray[np.intp_t, ndim=1] bins_x, # <<<<<<<<<<<<<< @@ -4224,14 +4430,23 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -4240,49 +4455,57 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 1); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 1); __PYX_ERR(0, 73, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wsource)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 2); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 2); __PYX_ERR(0, 73, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bsource)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 3); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 3); __PYX_ERR(0, 73, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 4); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 4); __PYX_ERR(0, 73, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 5); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 5); __PYX_ERR(0, 73, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 6); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 6); __PYX_ERR(0, 73, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 7); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 7); __PYX_ERR(0, 73, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_used)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 8); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, 8); __PYX_ERR(0, 73, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "new_bin_profile2d") < 0)) __PYX_ERR(0, 72, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "new_bin_profile2d") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; @@ -4309,21 +4532,21 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile2d", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.new_bin_profile2d", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_x), __pyx_ptype_5numpy_ndarray, 1, "bins_x", 0))) __PYX_ERR(0, 72, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_y), __pyx_ptype_5numpy_ndarray, 1, "bins_y", 0))) __PYX_ERR(0, 73, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wsource), __pyx_ptype_5numpy_ndarray, 1, "wsource", 0))) __PYX_ERR(0, 74, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bsource), __pyx_ptype_5numpy_ndarray, 1, "bsource", 0))) __PYX_ERR(0, 75, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wresult), __pyx_ptype_5numpy_ndarray, 1, "wresult", 0))) __PYX_ERR(0, 76, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bresult), __pyx_ptype_5numpy_ndarray, 1, "bresult", 0))) __PYX_ERR(0, 77, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mresult), __pyx_ptype_5numpy_ndarray, 1, "mresult", 0))) __PYX_ERR(0, 78, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qresult), __pyx_ptype_5numpy_ndarray, 1, "qresult", 0))) __PYX_ERR(0, 79, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_used), __pyx_ptype_5numpy_ndarray, 1, "used", 0))) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_x), __pyx_ptype_5numpy_ndarray, 1, "bins_x", 0))) __PYX_ERR(0, 73, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_y), __pyx_ptype_5numpy_ndarray, 1, "bins_y", 0))) __PYX_ERR(0, 74, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wsource), __pyx_ptype_5numpy_ndarray, 1, "wsource", 0))) __PYX_ERR(0, 75, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bsource), __pyx_ptype_5numpy_ndarray, 1, "bsource", 0))) __PYX_ERR(0, 76, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wresult), __pyx_ptype_5numpy_ndarray, 1, "wresult", 0))) __PYX_ERR(0, 77, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bresult), __pyx_ptype_5numpy_ndarray, 1, "bresult", 0))) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mresult), __pyx_ptype_5numpy_ndarray, 1, "mresult", 0))) __PYX_ERR(0, 79, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qresult), __pyx_ptype_5numpy_ndarray, 1, "qresult", 0))) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_used), __pyx_ptype_5numpy_ndarray, 1, "used", 0))) __PYX_ERR(0, 81, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_2new_bin_profile2d(__pyx_self, __pyx_v_bins_x, __pyx_v_bins_y, __pyx_v_wsource, __pyx_v_bsource, __pyx_v_wresult, __pyx_v_bresult, __pyx_v_mresult, __pyx_v_qresult, __pyx_v_used); /* function exit code */ @@ -4343,6 +4566,7 @@ __pyx_t_5numpy_float64_t __pyx_v_wval; __pyx_t_5numpy_float64_t __pyx_v_bval; __pyx_t_5numpy_float64_t __pyx_v_oldwr; + __pyx_t_5numpy_float64_t __pyx_v_bval_mresult; int __pyx_v_nb; int __pyx_v_nf; __Pyx_LocalBuf_ND __pyx_pybuffernd_bins_x; @@ -4394,9 +4618,6 @@ Py_ssize_t __pyx_t_27; Py_ssize_t __pyx_t_28; Py_ssize_t __pyx_t_29; - Py_ssize_t __pyx_t_30; - Py_ssize_t __pyx_t_31; - Py_ssize_t __pyx_t_32; __Pyx_RefNannySetupContext("new_bin_profile2d", 0); __pyx_pybuffer_bins_x.pybuffer.buf = NULL; __pyx_pybuffer_bins_x.refcount = 0; @@ -4436,61 +4657,61 @@ __pyx_pybuffernd_used.rcbuffer = &__pyx_pybuffer_used; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 72, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 73, __pyx_L1_error) } __pyx_pybuffernd_bins_x.diminfo[0].strides = __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins_x.diminfo[0].shape = __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 72, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 73, __pyx_L1_error) } __pyx_pybuffernd_bins_y.diminfo[0].strides = __pyx_pybuffernd_bins_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins_y.diminfo[0].shape = __pyx_pybuffernd_bins_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_wsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 72, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_wsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 73, __pyx_L1_error) } __pyx_pybuffernd_wsource.diminfo[0].strides = __pyx_pybuffernd_wsource.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_wsource.diminfo[0].shape = __pyx_pybuffernd_wsource.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_bsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 72, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_bsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 73, __pyx_L1_error) } __pyx_pybuffernd_bsource.diminfo[0].strides = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bsource.diminfo[0].shape = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_bsource.diminfo[1].strides = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_bsource.diminfo[1].shape = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_wresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 72, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_wresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 73, __pyx_L1_error) } __pyx_pybuffernd_wresult.diminfo[0].strides = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_wresult.diminfo[0].shape = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_wresult.diminfo[1].strides = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_wresult.diminfo[1].shape = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_bresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 72, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_bresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 73, __pyx_L1_error) } __pyx_pybuffernd_bresult.diminfo[0].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bresult.diminfo[0].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_bresult.diminfo[1].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_bresult.diminfo[1].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_bresult.diminfo[2].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_bresult.diminfo[2].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_mresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 72, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_mresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 73, __pyx_L1_error) } __pyx_pybuffernd_mresult.diminfo[0].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mresult.diminfo[0].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mresult.diminfo[1].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mresult.diminfo[1].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mresult.diminfo[2].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mresult.diminfo[2].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_qresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 72, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_qresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 73, __pyx_L1_error) } __pyx_pybuffernd_qresult.diminfo[0].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qresult.diminfo[0].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_qresult.diminfo[1].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_qresult.diminfo[1].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_qresult.diminfo[2].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_qresult.diminfo[2].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_used.rcbuffer->pybuffer, (PyObject*)__pyx_v_used, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 72, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_used.rcbuffer->pybuffer, (PyObject*)__pyx_v_used, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 73, __pyx_L1_error) } __pyx_pybuffernd_used.diminfo[0].strides = __pyx_pybuffernd_used.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_used.diminfo[0].shape = __pyx_pybuffernd_used.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_used.diminfo[1].strides = __pyx_pybuffernd_used.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_used.diminfo[1].shape = __pyx_pybuffernd_used.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/misc_utilities.pyx":83 + /* "yt/utilities/lib/misc_utilities.pyx":84 * cdef int n, fi, bin_x, bin_y - * cdef np.float64_t wval, bval, oldwr + * cdef np.float64_t wval, bval, oldwr, bval_mresult * cdef int nb = bins_x.shape[0] # <<<<<<<<<<<<<< * cdef int nf = bsource.shape[1] * for n in range(nb): */ __pyx_v_nb = (__pyx_v_bins_x->dimensions[0]); - /* "yt/utilities/lib/misc_utilities.pyx":84 - * cdef np.float64_t wval, bval, oldwr + /* "yt/utilities/lib/misc_utilities.pyx":85 + * cdef np.float64_t wval, bval, oldwr, bval_mresult * cdef int nb = bins_x.shape[0] * cdef int nf = bsource.shape[1] # <<<<<<<<<<<<<< * for n in range(nb): @@ -4498,7 +4719,7 @@ */ __pyx_v_nf = (__pyx_v_bsource->dimensions[1]); - /* "yt/utilities/lib/misc_utilities.pyx":85 + /* "yt/utilities/lib/misc_utilities.pyx":86 * cdef int nb = bins_x.shape[0] * cdef int nf = bsource.shape[1] * for n in range(nb): # <<<<<<<<<<<<<< @@ -4509,7 +4730,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_n = __pyx_t_2; - /* "yt/utilities/lib/misc_utilities.pyx":86 + /* "yt/utilities/lib/misc_utilities.pyx":87 * cdef int nf = bsource.shape[1] * for n in range(nb): * bin_x = bins_x[n] # <<<<<<<<<<<<<< @@ -4519,7 +4740,7 @@ __pyx_t_3 = __pyx_v_n; __pyx_v_bin_x = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_intp_t *, __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_bins_x.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":87 + /* "yt/utilities/lib/misc_utilities.pyx":88 * for n in range(nb): * bin_x = bins_x[n] * bin_y = bins_y[n] # <<<<<<<<<<<<<< @@ -4529,7 +4750,7 @@ __pyx_t_4 = __pyx_v_n; __pyx_v_bin_y = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_intp_t *, __pyx_pybuffernd_bins_y.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_bins_y.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":88 + /* "yt/utilities/lib/misc_utilities.pyx":89 * bin_x = bins_x[n] * bin_y = bins_y[n] * wval = wsource[n] # <<<<<<<<<<<<<< @@ -4539,7 +4760,7 @@ __pyx_t_5 = __pyx_v_n; __pyx_v_wval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wsource.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_wsource.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":89 + /* "yt/utilities/lib/misc_utilities.pyx":90 * bin_y = bins_y[n] * wval = wsource[n] * oldwr = wresult[bin_x, bin_y] # <<<<<<<<<<<<<< @@ -4550,7 +4771,7 @@ __pyx_t_7 = __pyx_v_bin_y; __pyx_v_oldwr = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_wresult.diminfo[1].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":90 + /* "yt/utilities/lib/misc_utilities.pyx":91 * wval = wsource[n] * oldwr = wresult[bin_x, bin_y] * wresult[bin_x,bin_y] += wval # <<<<<<<<<<<<<< @@ -4561,95 +4782,93 @@ __pyx_t_9 = __pyx_v_bin_y; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_wresult.diminfo[1].strides) += __pyx_v_wval; - /* "yt/utilities/lib/misc_utilities.pyx":91 + /* "yt/utilities/lib/misc_utilities.pyx":92 * oldwr = wresult[bin_x, bin_y] * wresult[bin_x,bin_y] += wval * for fi in range(nf): # <<<<<<<<<<<<<< * bval = bsource[n,fi] - * # qresult has to have the previous wresult + * bval_mresult = bval - mresult[bin_x,bin_y,fi] */ __pyx_t_10 = __pyx_v_nf; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_fi = __pyx_t_11; - /* "yt/utilities/lib/misc_utilities.pyx":92 + /* "yt/utilities/lib/misc_utilities.pyx":93 * wresult[bin_x,bin_y] += wval * for fi in range(nf): * bval = bsource[n,fi] # <<<<<<<<<<<<<< + * bval_mresult = bval - mresult[bin_x,bin_y,fi] * # qresult has to have the previous wresult - * qresult[bin_x,bin_y,fi] += (oldwr * wval * (bval - mresult[bin_x,bin_y,fi])**2) / \ */ __pyx_t_12 = __pyx_v_n; __pyx_t_13 = __pyx_v_fi; __pyx_v_bval = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_bsource.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_bsource.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_bsource.diminfo[1].strides)); /* "yt/utilities/lib/misc_utilities.pyx":94 + * for fi in range(nf): * bval = bsource[n,fi] + * bval_mresult = bval - mresult[bin_x,bin_y,fi] # <<<<<<<<<<<<<< * # qresult has to have the previous wresult - * qresult[bin_x,bin_y,fi] += (oldwr * wval * (bval - mresult[bin_x,bin_y,fi])**2) / \ # <<<<<<<<<<<<<< - * (oldwr + wval) - * bresult[bin_x,bin_y,fi] += wval*bval + * qresult[bin_x,bin_y,fi] += oldwr * wval * bval_mresult * bval_mresult / \ */ __pyx_t_14 = __pyx_v_bin_x; __pyx_t_15 = __pyx_v_bin_y; __pyx_t_16 = __pyx_v_fi; + __pyx_v_bval_mresult = (__pyx_v_bval - (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_mresult.diminfo[2].strides))); - /* "yt/utilities/lib/misc_utilities.pyx":95 + /* "yt/utilities/lib/misc_utilities.pyx":96 + * bval_mresult = bval - mresult[bin_x,bin_y,fi] * # qresult has to have the previous wresult - * qresult[bin_x,bin_y,fi] += (oldwr * wval * (bval - mresult[bin_x,bin_y,fi])**2) / \ - * (oldwr + wval) # <<<<<<<<<<<<<< + * qresult[bin_x,bin_y,fi] += oldwr * wval * bval_mresult * bval_mresult / \ # <<<<<<<<<<<<<< + * (oldwr + wval) * bresult[bin_x,bin_y,fi] += wval*bval - * # mresult needs the new wresult */ __pyx_t_17 = __pyx_v_bin_x; __pyx_t_18 = __pyx_v_bin_y; __pyx_t_19 = __pyx_v_fi; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_qresult.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qresult.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_qresult.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_qresult.diminfo[2].strides) += (((__pyx_v_oldwr * __pyx_v_wval) * pow((__pyx_v_bval - (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_mresult.diminfo[2].strides))), 2.0)) / (__pyx_v_oldwr + __pyx_v_wval)); + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_qresult.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qresult.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_qresult.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_qresult.diminfo[2].strides) += ((((__pyx_v_oldwr * __pyx_v_wval) * __pyx_v_bval_mresult) * __pyx_v_bval_mresult) / (__pyx_v_oldwr + __pyx_v_wval)); - /* "yt/utilities/lib/misc_utilities.pyx":96 - * qresult[bin_x,bin_y,fi] += (oldwr * wval * (bval - mresult[bin_x,bin_y,fi])**2) / \ + /* "yt/utilities/lib/misc_utilities.pyx":98 + * qresult[bin_x,bin_y,fi] += oldwr * wval * bval_mresult * bval_mresult / \ * (oldwr + wval) * bresult[bin_x,bin_y,fi] += wval*bval # <<<<<<<<<<<<<< * # mresult needs the new wresult - * mresult[bin_x,bin_y,fi] += wval * (bval - mresult[bin_x,bin_y,fi]) / wresult[bin_x,bin_y] + * mresult[bin_x,bin_y,fi] += wval * bval_mresult / wresult[bin_x,bin_y] */ __pyx_t_20 = __pyx_v_bin_x; __pyx_t_21 = __pyx_v_bin_y; __pyx_t_22 = __pyx_v_fi; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_bresult.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bresult.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_bresult.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_bresult.diminfo[2].strides) += (__pyx_v_wval * __pyx_v_bval); - /* "yt/utilities/lib/misc_utilities.pyx":98 + /* "yt/utilities/lib/misc_utilities.pyx":100 * bresult[bin_x,bin_y,fi] += wval*bval * # mresult needs the new wresult - * mresult[bin_x,bin_y,fi] += wval * (bval - mresult[bin_x,bin_y,fi]) / wresult[bin_x,bin_y] # <<<<<<<<<<<<<< + * mresult[bin_x,bin_y,fi] += wval * bval_mresult / wresult[bin_x,bin_y] # <<<<<<<<<<<<<< * used[bin_x,bin_y] = 1 * return */ __pyx_t_23 = __pyx_v_bin_x; __pyx_t_24 = __pyx_v_bin_y; - __pyx_t_25 = __pyx_v_fi; - __pyx_t_26 = __pyx_v_bin_x; - __pyx_t_27 = __pyx_v_bin_y; - __pyx_t_28 = __pyx_v_bin_x; - __pyx_t_29 = __pyx_v_bin_y; - __pyx_t_30 = __pyx_v_fi; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_mresult.diminfo[2].strides) += ((__pyx_v_wval * (__pyx_v_bval - (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_mresult.diminfo[2].strides)))) / (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_wresult.diminfo[1].strides))); + __pyx_t_25 = __pyx_v_bin_x; + __pyx_t_26 = __pyx_v_bin_y; + __pyx_t_27 = __pyx_v_fi; + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_mresult.diminfo[2].strides) += ((__pyx_v_wval * __pyx_v_bval_mresult) / (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_wresult.diminfo[1].strides))); } - /* "yt/utilities/lib/misc_utilities.pyx":99 + /* "yt/utilities/lib/misc_utilities.pyx":101 * # mresult needs the new wresult - * mresult[bin_x,bin_y,fi] += wval * (bval - mresult[bin_x,bin_y,fi]) / wresult[bin_x,bin_y] + * mresult[bin_x,bin_y,fi] += wval * bval_mresult / wresult[bin_x,bin_y] * used[bin_x,bin_y] = 1 # <<<<<<<<<<<<<< * return * */ - __pyx_t_31 = __pyx_v_bin_x; - __pyx_t_32 = __pyx_v_bin_y; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_used.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_used.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_used.diminfo[1].strides) = 1; + __pyx_t_28 = __pyx_v_bin_x; + __pyx_t_29 = __pyx_v_bin_y; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_used.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_used.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_used.diminfo[1].strides) = 1; } - /* "yt/utilities/lib/misc_utilities.pyx":100 - * mresult[bin_x,bin_y,fi] += wval * (bval - mresult[bin_x,bin_y,fi]) / wresult[bin_x,bin_y] + /* "yt/utilities/lib/misc_utilities.pyx":102 + * mresult[bin_x,bin_y,fi] += wval * bval_mresult / wresult[bin_x,bin_y] * used[bin_x,bin_y] = 1 * return # <<<<<<<<<<<<<< * @@ -4659,7 +4878,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":72 + /* "yt/utilities/lib/misc_utilities.pyx":73 * @cython.wraparound(False) * @cython.cdivision(True) * def new_bin_profile2d(np.ndarray[np.intp_t, ndim=1] bins_x, # <<<<<<<<<<<<<< @@ -4702,7 +4921,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":105 +/* "yt/utilities/lib/misc_utilities.pyx":107 * @cython.wraparound(False) * @cython.cdivision(True) * def new_bin_profile3d(np.ndarray[np.intp_t, ndim=1] bins_x, # <<<<<<<<<<<<<< @@ -4735,15 +4954,25 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -4752,54 +4981,63 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 1); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 1); __PYX_ERR(0, 107, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 2); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 2); __PYX_ERR(0, 107, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wsource)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 3); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 3); __PYX_ERR(0, 107, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bsource)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 4); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 4); __PYX_ERR(0, 107, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 5); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 5); __PYX_ERR(0, 107, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 6); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 6); __PYX_ERR(0, 107, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 7); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 7); __PYX_ERR(0, 107, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 8); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 8); __PYX_ERR(0, 107, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_used)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 9); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, 9); __PYX_ERR(0, 107, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "new_bin_profile3d") < 0)) __PYX_ERR(0, 105, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "new_bin_profile3d") < 0)) __PYX_ERR(0, 107, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 10) { goto __pyx_L5_argtuple_error; @@ -4828,22 +5066,22 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_bin_profile3d", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 107, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.new_bin_profile3d", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_x), __pyx_ptype_5numpy_ndarray, 1, "bins_x", 0))) __PYX_ERR(0, 105, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_y), __pyx_ptype_5numpy_ndarray, 1, "bins_y", 0))) __PYX_ERR(0, 106, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_z), __pyx_ptype_5numpy_ndarray, 1, "bins_z", 0))) __PYX_ERR(0, 107, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wsource), __pyx_ptype_5numpy_ndarray, 1, "wsource", 0))) __PYX_ERR(0, 108, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bsource), __pyx_ptype_5numpy_ndarray, 1, "bsource", 0))) __PYX_ERR(0, 109, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wresult), __pyx_ptype_5numpy_ndarray, 1, "wresult", 0))) __PYX_ERR(0, 110, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bresult), __pyx_ptype_5numpy_ndarray, 1, "bresult", 0))) __PYX_ERR(0, 111, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mresult), __pyx_ptype_5numpy_ndarray, 1, "mresult", 0))) __PYX_ERR(0, 112, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qresult), __pyx_ptype_5numpy_ndarray, 1, "qresult", 0))) __PYX_ERR(0, 113, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_used), __pyx_ptype_5numpy_ndarray, 1, "used", 0))) __PYX_ERR(0, 114, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_x), __pyx_ptype_5numpy_ndarray, 1, "bins_x", 0))) __PYX_ERR(0, 107, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_y), __pyx_ptype_5numpy_ndarray, 1, "bins_y", 0))) __PYX_ERR(0, 108, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_z), __pyx_ptype_5numpy_ndarray, 1, "bins_z", 0))) __PYX_ERR(0, 109, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wsource), __pyx_ptype_5numpy_ndarray, 1, "wsource", 0))) __PYX_ERR(0, 110, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bsource), __pyx_ptype_5numpy_ndarray, 1, "bsource", 0))) __PYX_ERR(0, 111, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wresult), __pyx_ptype_5numpy_ndarray, 1, "wresult", 0))) __PYX_ERR(0, 112, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bresult), __pyx_ptype_5numpy_ndarray, 1, "bresult", 0))) __PYX_ERR(0, 113, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mresult), __pyx_ptype_5numpy_ndarray, 1, "mresult", 0))) __PYX_ERR(0, 114, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qresult), __pyx_ptype_5numpy_ndarray, 1, "qresult", 0))) __PYX_ERR(0, 115, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_used), __pyx_ptype_5numpy_ndarray, 1, "used", 0))) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_4new_bin_profile3d(__pyx_self, __pyx_v_bins_x, __pyx_v_bins_y, __pyx_v_bins_z, __pyx_v_wsource, __pyx_v_bsource, __pyx_v_wresult, __pyx_v_bresult, __pyx_v_mresult, __pyx_v_qresult, __pyx_v_used); /* function exit code */ @@ -4864,6 +5102,7 @@ __pyx_t_5numpy_float64_t __pyx_v_wval; __pyx_t_5numpy_float64_t __pyx_v_bval; __pyx_t_5numpy_float64_t __pyx_v_oldwr; + __pyx_t_5numpy_float64_t __pyx_v_bval_mresult; int __pyx_v_nb; int __pyx_v_nf; __Pyx_LocalBuf_ND __pyx_pybuffernd_bins_x; @@ -4926,10 +5165,6 @@ Py_ssize_t __pyx_t_36; Py_ssize_t __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; __Pyx_RefNannySetupContext("new_bin_profile3d", 0); __pyx_pybuffer_bins_x.pybuffer.buf = NULL; __pyx_pybuffer_bins_x.refcount = 0; @@ -4973,66 +5208,66 @@ __pyx_pybuffernd_used.rcbuffer = &__pyx_pybuffer_used; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_pybuffernd_bins_x.diminfo[0].strides = __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins_x.diminfo[0].shape = __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_pybuffernd_bins_y.diminfo[0].strides = __pyx_pybuffernd_bins_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins_y.diminfo[0].shape = __pyx_pybuffernd_bins_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_pybuffernd_bins_z.diminfo[0].strides = __pyx_pybuffernd_bins_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins_z.diminfo[0].shape = __pyx_pybuffernd_bins_z.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_wsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_wsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_pybuffernd_wsource.diminfo[0].strides = __pyx_pybuffernd_wsource.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_wsource.diminfo[0].shape = __pyx_pybuffernd_wsource.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_bsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_bsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_pybuffernd_bsource.diminfo[0].strides = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bsource.diminfo[0].shape = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_bsource.diminfo[1].strides = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_bsource.diminfo[1].shape = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_wresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_wresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_pybuffernd_wresult.diminfo[0].strides = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_wresult.diminfo[0].shape = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_wresult.diminfo[1].strides = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_wresult.diminfo[1].shape = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_wresult.diminfo[2].strides = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_wresult.diminfo[2].shape = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_bresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_bresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_pybuffernd_bresult.diminfo[0].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bresult.diminfo[0].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_bresult.diminfo[1].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_bresult.diminfo[1].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_bresult.diminfo[2].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_bresult.diminfo[2].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_bresult.diminfo[3].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_bresult.diminfo[3].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[3]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_mresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_mresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_pybuffernd_mresult.diminfo[0].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mresult.diminfo[0].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mresult.diminfo[1].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mresult.diminfo[1].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mresult.diminfo[2].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mresult.diminfo[2].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_mresult.diminfo[3].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_mresult.diminfo[3].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[3]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_qresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_qresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_pybuffernd_qresult.diminfo[0].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qresult.diminfo[0].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_qresult.diminfo[1].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_qresult.diminfo[1].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_qresult.diminfo[2].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_qresult.diminfo[2].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_qresult.diminfo[3].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_qresult.diminfo[3].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[3]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_used.rcbuffer->pybuffer, (PyObject*)__pyx_v_used, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_used.rcbuffer->pybuffer, (PyObject*)__pyx_v_used, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_pybuffernd_used.diminfo[0].strides = __pyx_pybuffernd_used.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_used.diminfo[0].shape = __pyx_pybuffernd_used.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_used.diminfo[1].strides = __pyx_pybuffernd_used.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_used.diminfo[1].shape = __pyx_pybuffernd_used.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_used.diminfo[2].strides = __pyx_pybuffernd_used.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_used.diminfo[2].shape = __pyx_pybuffernd_used.rcbuffer->pybuffer.shape[2]; - /* "yt/utilities/lib/misc_utilities.pyx":117 + /* "yt/utilities/lib/misc_utilities.pyx":119 * cdef int n, fi, bin_x, bin_y, bin_z - * cdef np.float64_t wval, bval, oldwr + * cdef np.float64_t wval, bval, oldwr, bval_mresult * cdef int nb = bins_x.shape[0] # <<<<<<<<<<<<<< * cdef int nf = bsource.shape[1] * for n in range(nb): */ __pyx_v_nb = (__pyx_v_bins_x->dimensions[0]); - /* "yt/utilities/lib/misc_utilities.pyx":118 - * cdef np.float64_t wval, bval, oldwr + /* "yt/utilities/lib/misc_utilities.pyx":120 + * cdef np.float64_t wval, bval, oldwr, bval_mresult * cdef int nb = bins_x.shape[0] * cdef int nf = bsource.shape[1] # <<<<<<<<<<<<<< * for n in range(nb): @@ -5040,7 +5275,7 @@ */ __pyx_v_nf = (__pyx_v_bsource->dimensions[1]); - /* "yt/utilities/lib/misc_utilities.pyx":119 + /* "yt/utilities/lib/misc_utilities.pyx":121 * cdef int nb = bins_x.shape[0] * cdef int nf = bsource.shape[1] * for n in range(nb): # <<<<<<<<<<<<<< @@ -5051,7 +5286,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_n = __pyx_t_2; - /* "yt/utilities/lib/misc_utilities.pyx":120 + /* "yt/utilities/lib/misc_utilities.pyx":122 * cdef int nf = bsource.shape[1] * for n in range(nb): * bin_x = bins_x[n] # <<<<<<<<<<<<<< @@ -5061,7 +5296,7 @@ __pyx_t_3 = __pyx_v_n; __pyx_v_bin_x = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_intp_t *, __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_bins_x.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":121 + /* "yt/utilities/lib/misc_utilities.pyx":123 * for n in range(nb): * bin_x = bins_x[n] * bin_y = bins_y[n] # <<<<<<<<<<<<<< @@ -5071,7 +5306,7 @@ __pyx_t_4 = __pyx_v_n; __pyx_v_bin_y = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_intp_t *, __pyx_pybuffernd_bins_y.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_bins_y.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":122 + /* "yt/utilities/lib/misc_utilities.pyx":124 * bin_x = bins_x[n] * bin_y = bins_y[n] * bin_z = bins_z[n] # <<<<<<<<<<<<<< @@ -5081,7 +5316,7 @@ __pyx_t_5 = __pyx_v_n; __pyx_v_bin_z = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_intp_t *, __pyx_pybuffernd_bins_z.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_bins_z.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":123 + /* "yt/utilities/lib/misc_utilities.pyx":125 * bin_y = bins_y[n] * bin_z = bins_z[n] * wval = wsource[n] # <<<<<<<<<<<<<< @@ -5091,7 +5326,7 @@ __pyx_t_6 = __pyx_v_n; __pyx_v_wval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wsource.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_wsource.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":124 + /* "yt/utilities/lib/misc_utilities.pyx":126 * bin_z = bins_z[n] * wval = wsource[n] * oldwr = wresult[bin_x, bin_y, bin_z] # <<<<<<<<<<<<<< @@ -5103,7 +5338,7 @@ __pyx_t_9 = __pyx_v_bin_z; __pyx_v_oldwr = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_wresult.diminfo[1].strides, __pyx_t_9, __pyx_pybuffernd_wresult.diminfo[2].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":125 + /* "yt/utilities/lib/misc_utilities.pyx":127 * wval = wsource[n] * oldwr = wresult[bin_x, bin_y, bin_z] * wresult[bin_x,bin_y,bin_z] += wval # <<<<<<<<<<<<<< @@ -5115,59 +5350,60 @@ __pyx_t_12 = __pyx_v_bin_z; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_wresult.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_wresult.diminfo[2].strides) += __pyx_v_wval; - /* "yt/utilities/lib/misc_utilities.pyx":126 + /* "yt/utilities/lib/misc_utilities.pyx":128 * oldwr = wresult[bin_x, bin_y, bin_z] * wresult[bin_x,bin_y,bin_z] += wval * for fi in range(nf): # <<<<<<<<<<<<<< * bval = bsource[n,fi] - * # qresult has to have the previous wresult + * bval_mresult = bval - mresult[bin_x,bin_y,bin_z,fi] */ __pyx_t_13 = __pyx_v_nf; for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_fi = __pyx_t_14; - /* "yt/utilities/lib/misc_utilities.pyx":127 + /* "yt/utilities/lib/misc_utilities.pyx":129 * wresult[bin_x,bin_y,bin_z] += wval * for fi in range(nf): * bval = bsource[n,fi] # <<<<<<<<<<<<<< + * bval_mresult = bval - mresult[bin_x,bin_y,bin_z,fi] * # qresult has to have the previous wresult - * qresult[bin_x,bin_y,bin_z,fi] += \ */ __pyx_t_15 = __pyx_v_n; __pyx_t_16 = __pyx_v_fi; __pyx_v_bval = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_bsource.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bsource.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_bsource.diminfo[1].strides)); /* "yt/utilities/lib/misc_utilities.pyx":130 + * for fi in range(nf): + * bval = bsource[n,fi] + * bval_mresult = bval - mresult[bin_x,bin_y,bin_z,fi] # <<<<<<<<<<<<<< * # qresult has to have the previous wresult * qresult[bin_x,bin_y,bin_z,fi] += \ - * (oldwr * wval * (bval - mresult[bin_x,bin_y,bin_z,fi])**2) / \ # <<<<<<<<<<<<<< - * (oldwr + wval) - * bresult[bin_x,bin_y,bin_z,fi] += wval*bval */ __pyx_t_17 = __pyx_v_bin_x; __pyx_t_18 = __pyx_v_bin_y; __pyx_t_19 = __pyx_v_bin_z; __pyx_t_20 = __pyx_v_fi; + __pyx_v_bval_mresult = (__pyx_v_bval - (*__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_mresult.diminfo[2].strides, __pyx_t_20, __pyx_pybuffernd_mresult.diminfo[3].strides))); - /* "yt/utilities/lib/misc_utilities.pyx":129 - * bval = bsource[n,fi] + /* "yt/utilities/lib/misc_utilities.pyx":132 + * bval_mresult = bval - mresult[bin_x,bin_y,bin_z,fi] * # qresult has to have the previous wresult * qresult[bin_x,bin_y,bin_z,fi] += \ # <<<<<<<<<<<<<< - * (oldwr * wval * (bval - mresult[bin_x,bin_y,bin_z,fi])**2) / \ + * oldwr * wval * bval_mresult * bval_mresult / \ * (oldwr + wval) */ __pyx_t_21 = __pyx_v_bin_x; __pyx_t_22 = __pyx_v_bin_y; __pyx_t_23 = __pyx_v_bin_z; __pyx_t_24 = __pyx_v_fi; - *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_qresult.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_qresult.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_qresult.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_qresult.diminfo[2].strides, __pyx_t_24, __pyx_pybuffernd_qresult.diminfo[3].strides) += (((__pyx_v_oldwr * __pyx_v_wval) * pow((__pyx_v_bval - (*__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_mresult.diminfo[2].strides, __pyx_t_20, __pyx_pybuffernd_mresult.diminfo[3].strides))), 2.0)) / (__pyx_v_oldwr + __pyx_v_wval)); + *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_qresult.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_qresult.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_qresult.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_qresult.diminfo[2].strides, __pyx_t_24, __pyx_pybuffernd_qresult.diminfo[3].strides) += ((((__pyx_v_oldwr * __pyx_v_wval) * __pyx_v_bval_mresult) * __pyx_v_bval_mresult) / (__pyx_v_oldwr + __pyx_v_wval)); - /* "yt/utilities/lib/misc_utilities.pyx":132 - * (oldwr * wval * (bval - mresult[bin_x,bin_y,bin_z,fi])**2) / \ + /* "yt/utilities/lib/misc_utilities.pyx":135 + * oldwr * wval * bval_mresult * bval_mresult / \ * (oldwr + wval) * bresult[bin_x,bin_y,bin_z,fi] += wval*bval # <<<<<<<<<<<<<< * # mresult needs the new wresult - * mresult[bin_x,bin_y,bin_z,fi] += wval * \ + * mresult[bin_x,bin_y,bin_z,fi] += wval * bval_mresult / \ */ __pyx_t_25 = __pyx_v_bin_x; __pyx_t_26 = __pyx_v_bin_y; @@ -5175,57 +5411,45 @@ __pyx_t_28 = __pyx_v_fi; *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_bresult.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_bresult.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_bresult.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_bresult.diminfo[2].strides, __pyx_t_28, __pyx_pybuffernd_bresult.diminfo[3].strides) += (__pyx_v_wval * __pyx_v_bval); - /* "yt/utilities/lib/misc_utilities.pyx":135 + /* "yt/utilities/lib/misc_utilities.pyx":138 * # mresult needs the new wresult - * mresult[bin_x,bin_y,bin_z,fi] += wval * \ - * (bval - mresult[bin_x,bin_y,bin_z,fi]) / \ # <<<<<<<<<<<<<< - * wresult[bin_x,bin_y,bin_z] + * mresult[bin_x,bin_y,bin_z,fi] += wval * bval_mresult / \ + * wresult[bin_x,bin_y,bin_z] # <<<<<<<<<<<<<< * used[bin_x,bin_y,bin_z] = 1 + * return */ __pyx_t_29 = __pyx_v_bin_x; __pyx_t_30 = __pyx_v_bin_y; __pyx_t_31 = __pyx_v_bin_z; - __pyx_t_32 = __pyx_v_fi; - - /* "yt/utilities/lib/misc_utilities.pyx":136 - * mresult[bin_x,bin_y,bin_z,fi] += wval * \ - * (bval - mresult[bin_x,bin_y,bin_z,fi]) / \ - * wresult[bin_x,bin_y,bin_z] # <<<<<<<<<<<<<< - * used[bin_x,bin_y,bin_z] = 1 - * return - */ - __pyx_t_33 = __pyx_v_bin_x; - __pyx_t_34 = __pyx_v_bin_y; - __pyx_t_35 = __pyx_v_bin_z; - /* "yt/utilities/lib/misc_utilities.pyx":134 + /* "yt/utilities/lib/misc_utilities.pyx":137 * bresult[bin_x,bin_y,bin_z,fi] += wval*bval * # mresult needs the new wresult - * mresult[bin_x,bin_y,bin_z,fi] += wval * \ # <<<<<<<<<<<<<< - * (bval - mresult[bin_x,bin_y,bin_z,fi]) / \ + * mresult[bin_x,bin_y,bin_z,fi] += wval * bval_mresult / \ # <<<<<<<<<<<<<< * wresult[bin_x,bin_y,bin_z] + * used[bin_x,bin_y,bin_z] = 1 */ - __pyx_t_36 = __pyx_v_bin_x; - __pyx_t_37 = __pyx_v_bin_y; - __pyx_t_38 = __pyx_v_bin_z; - __pyx_t_39 = __pyx_v_fi; - *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_mresult.diminfo[2].strides, __pyx_t_39, __pyx_pybuffernd_mresult.diminfo[3].strides) += ((__pyx_v_wval * (__pyx_v_bval - (*__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_mresult.diminfo[2].strides, __pyx_t_32, __pyx_pybuffernd_mresult.diminfo[3].strides)))) / (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_wresult.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_wresult.diminfo[2].strides))); + __pyx_t_32 = __pyx_v_bin_x; + __pyx_t_33 = __pyx_v_bin_y; + __pyx_t_34 = __pyx_v_bin_z; + __pyx_t_35 = __pyx_v_fi; + *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_34, __pyx_pybuffernd_mresult.diminfo[2].strides, __pyx_t_35, __pyx_pybuffernd_mresult.diminfo[3].strides) += ((__pyx_v_wval * __pyx_v_bval_mresult) / (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_wresult.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_wresult.diminfo[2].strides))); } - /* "yt/utilities/lib/misc_utilities.pyx":137 - * (bval - mresult[bin_x,bin_y,bin_z,fi]) / \ + /* "yt/utilities/lib/misc_utilities.pyx":139 + * mresult[bin_x,bin_y,bin_z,fi] += wval * bval_mresult / \ * wresult[bin_x,bin_y,bin_z] * used[bin_x,bin_y,bin_z] = 1 # <<<<<<<<<<<<<< * return * */ - __pyx_t_40 = __pyx_v_bin_x; - __pyx_t_41 = __pyx_v_bin_y; - __pyx_t_42 = __pyx_v_bin_z; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_used.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_used.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_used.diminfo[1].strides, __pyx_t_42, __pyx_pybuffernd_used.diminfo[2].strides) = 1; + __pyx_t_36 = __pyx_v_bin_x; + __pyx_t_37 = __pyx_v_bin_y; + __pyx_t_38 = __pyx_v_bin_z; + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_used.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_used.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_used.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_used.diminfo[2].strides) = 1; } - /* "yt/utilities/lib/misc_utilities.pyx":138 + /* "yt/utilities/lib/misc_utilities.pyx":140 * wresult[bin_x,bin_y,bin_z] * used[bin_x,bin_y,bin_z] = 1 * return # <<<<<<<<<<<<<< @@ -5236,7 +5460,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":105 + /* "yt/utilities/lib/misc_utilities.pyx":107 * @cython.wraparound(False) * @cython.cdivision(True) * def new_bin_profile3d(np.ndarray[np.intp_t, ndim=1] bins_x, # <<<<<<<<<<<<<< @@ -5281,7 +5505,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":143 +/* "yt/utilities/lib/misc_utilities.pyx":145 * @cython.wraparound(False) * @cython.cdivision(True) * def bin_profile1d(np.ndarray[np.int64_t, ndim=1] bins_x, # <<<<<<<<<<<<<< @@ -5312,13 +5536,21 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -5327,44 +5559,51 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wsource)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 1); __PYX_ERR(0, 143, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 1); __PYX_ERR(0, 145, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bsource)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 2); __PYX_ERR(0, 143, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 2); __PYX_ERR(0, 145, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 3); __PYX_ERR(0, 143, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 3); __PYX_ERR(0, 145, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 4); __PYX_ERR(0, 143, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 4); __PYX_ERR(0, 145, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 5); __PYX_ERR(0, 143, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 5); __PYX_ERR(0, 145, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 6); __PYX_ERR(0, 143, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 6); __PYX_ERR(0, 145, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_used)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 7); __PYX_ERR(0, 143, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, 7); __PYX_ERR(0, 145, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bin_profile1d") < 0)) __PYX_ERR(0, 143, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bin_profile1d") < 0)) __PYX_ERR(0, 145, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; @@ -5389,20 +5628,20 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 143, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile1d", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 145, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.bin_profile1d", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_x), __pyx_ptype_5numpy_ndarray, 1, "bins_x", 0))) __PYX_ERR(0, 143, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wsource), __pyx_ptype_5numpy_ndarray, 1, "wsource", 0))) __PYX_ERR(0, 144, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bsource), __pyx_ptype_5numpy_ndarray, 1, "bsource", 0))) __PYX_ERR(0, 145, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wresult), __pyx_ptype_5numpy_ndarray, 1, "wresult", 0))) __PYX_ERR(0, 146, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bresult), __pyx_ptype_5numpy_ndarray, 1, "bresult", 0))) __PYX_ERR(0, 147, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mresult), __pyx_ptype_5numpy_ndarray, 1, "mresult", 0))) __PYX_ERR(0, 148, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qresult), __pyx_ptype_5numpy_ndarray, 1, "qresult", 0))) __PYX_ERR(0, 149, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_used), __pyx_ptype_5numpy_ndarray, 1, "used", 0))) __PYX_ERR(0, 150, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_x), __pyx_ptype_5numpy_ndarray, 1, "bins_x", 0))) __PYX_ERR(0, 145, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wsource), __pyx_ptype_5numpy_ndarray, 1, "wsource", 0))) __PYX_ERR(0, 146, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bsource), __pyx_ptype_5numpy_ndarray, 1, "bsource", 0))) __PYX_ERR(0, 147, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wresult), __pyx_ptype_5numpy_ndarray, 1, "wresult", 0))) __PYX_ERR(0, 148, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bresult), __pyx_ptype_5numpy_ndarray, 1, "bresult", 0))) __PYX_ERR(0, 149, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mresult), __pyx_ptype_5numpy_ndarray, 1, "mresult", 0))) __PYX_ERR(0, 150, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qresult), __pyx_ptype_5numpy_ndarray, 1, "qresult", 0))) __PYX_ERR(0, 151, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_used), __pyx_ptype_5numpy_ndarray, 1, "used", 0))) __PYX_ERR(0, 152, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_6bin_profile1d(__pyx_self, __pyx_v_bins_x, __pyx_v_wsource, __pyx_v_bsource, __pyx_v_wresult, __pyx_v_bresult, __pyx_v_mresult, __pyx_v_qresult, __pyx_v_used); /* function exit code */ @@ -5419,6 +5658,7 @@ int __pyx_v_bin; __pyx_t_5numpy_float64_t __pyx_v_wval; __pyx_t_5numpy_float64_t __pyx_v_bval; + __pyx_t_5numpy_float64_t __pyx_v_bval_mresult; __Pyx_LocalBuf_ND __pyx_pybuffernd_bins_x; __Pyx_Buffer __pyx_pybuffer_bins_x; __Pyx_LocalBuf_ND __pyx_pybuffernd_bresult; @@ -5451,7 +5691,6 @@ 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("bin_profile1d", 0); __pyx_pybuffer_bins_x.pybuffer.buf = NULL; __pyx_pybuffer_bins_x.refcount = 0; @@ -5487,48 +5726,48 @@ __pyx_pybuffernd_used.rcbuffer = &__pyx_pybuffer_used; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 145, __pyx_L1_error) } __pyx_pybuffernd_bins_x.diminfo[0].strides = __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins_x.diminfo[0].shape = __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_wsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_wsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 145, __pyx_L1_error) } __pyx_pybuffernd_wsource.diminfo[0].strides = __pyx_pybuffernd_wsource.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_wsource.diminfo[0].shape = __pyx_pybuffernd_wsource.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_bsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_bsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 145, __pyx_L1_error) } __pyx_pybuffernd_bsource.diminfo[0].strides = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bsource.diminfo[0].shape = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_wresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_wresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 145, __pyx_L1_error) } __pyx_pybuffernd_wresult.diminfo[0].strides = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_wresult.diminfo[0].shape = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_bresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_bresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 145, __pyx_L1_error) } __pyx_pybuffernd_bresult.diminfo[0].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bresult.diminfo[0].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_mresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_mresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 145, __pyx_L1_error) } __pyx_pybuffernd_mresult.diminfo[0].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mresult.diminfo[0].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_qresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_qresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 145, __pyx_L1_error) } __pyx_pybuffernd_qresult.diminfo[0].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qresult.diminfo[0].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_used.rcbuffer->pybuffer, (PyObject*)__pyx_v_used, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_used.rcbuffer->pybuffer, (PyObject*)__pyx_v_used, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 145, __pyx_L1_error) } __pyx_pybuffernd_used.diminfo[0].strides = __pyx_pybuffernd_used.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_used.diminfo[0].shape = __pyx_pybuffernd_used.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/misc_utilities.pyx":153 + /* "yt/utilities/lib/misc_utilities.pyx":155 * cdef int n, bin - * cdef np.float64_t wval, bval + * cdef np.float64_t wval, bval, bval_mresult * for n in range(bins_x.shape[0]): # <<<<<<<<<<<<<< * bin = bins_x[n] * bval = bsource[n] @@ -5537,8 +5776,8 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_n = __pyx_t_2; - /* "yt/utilities/lib/misc_utilities.pyx":154 - * cdef np.float64_t wval, bval + /* "yt/utilities/lib/misc_utilities.pyx":156 + * cdef np.float64_t wval, bval, bval_mresult * for n in range(bins_x.shape[0]): * bin = bins_x[n] # <<<<<<<<<<<<<< * bval = bsource[n] @@ -5547,100 +5786,108 @@ __pyx_t_3 = __pyx_v_n; __pyx_v_bin = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_bins_x.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":155 + /* "yt/utilities/lib/misc_utilities.pyx":157 * for n in range(bins_x.shape[0]): * bin = bins_x[n] * bval = bsource[n] # <<<<<<<<<<<<<< * wval = wsource[n] - * qresult[bin] += (wresult[bin] * wval * (bval - mresult[bin])**2) / \ + * bval_mresult = bval - mresult[bin] */ __pyx_t_4 = __pyx_v_n; __pyx_v_bval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_bsource.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_bsource.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":156 + /* "yt/utilities/lib/misc_utilities.pyx":158 * bin = bins_x[n] * bval = bsource[n] * wval = wsource[n] # <<<<<<<<<<<<<< - * qresult[bin] += (wresult[bin] * wval * (bval - mresult[bin])**2) / \ - * (wresult[bin] + wval) + * bval_mresult = bval - mresult[bin] + * qresult[bin] += wresult[bin] * wval * bval_mresult * bval_mresult / \ */ __pyx_t_5 = __pyx_v_n; __pyx_v_wval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wsource.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_wsource.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":157 + /* "yt/utilities/lib/misc_utilities.pyx":159 * bval = bsource[n] * wval = wsource[n] - * qresult[bin] += (wresult[bin] * wval * (bval - mresult[bin])**2) / \ # <<<<<<<<<<<<<< + * bval_mresult = bval - mresult[bin] # <<<<<<<<<<<<<< + * qresult[bin] += wresult[bin] * wval * bval_mresult * bval_mresult / \ * (wresult[bin] + wval) - * wresult[bin] += wval */ __pyx_t_6 = __pyx_v_bin; - __pyx_t_7 = __pyx_v_bin; + __pyx_v_bval_mresult = (__pyx_v_bval - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_mresult.diminfo[0].strides))); - /* "yt/utilities/lib/misc_utilities.pyx":158 + /* "yt/utilities/lib/misc_utilities.pyx":160 * wval = wsource[n] - * qresult[bin] += (wresult[bin] * wval * (bval - mresult[bin])**2) / \ + * bval_mresult = bval - mresult[bin] + * qresult[bin] += wresult[bin] * wval * bval_mresult * bval_mresult / \ # <<<<<<<<<<<<<< + * (wresult[bin] + wval) + * wresult[bin] += wval + */ + __pyx_t_7 = __pyx_v_bin; + + /* "yt/utilities/lib/misc_utilities.pyx":161 + * bval_mresult = bval - mresult[bin] + * qresult[bin] += wresult[bin] * wval * bval_mresult * bval_mresult / \ * (wresult[bin] + wval) # <<<<<<<<<<<<<< * wresult[bin] += wval * bresult[bin] += wval*bval */ __pyx_t_8 = __pyx_v_bin; - /* "yt/utilities/lib/misc_utilities.pyx":157 - * bval = bsource[n] + /* "yt/utilities/lib/misc_utilities.pyx":160 * wval = wsource[n] - * qresult[bin] += (wresult[bin] * wval * (bval - mresult[bin])**2) / \ # <<<<<<<<<<<<<< + * bval_mresult = bval - mresult[bin] + * qresult[bin] += wresult[bin] * wval * bval_mresult * bval_mresult / \ # <<<<<<<<<<<<<< * (wresult[bin] + wval) * wresult[bin] += wval */ __pyx_t_9 = __pyx_v_bin; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_qresult.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_qresult.diminfo[0].strides) += ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_wresult.diminfo[0].strides)) * __pyx_v_wval) * pow((__pyx_v_bval - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mresult.diminfo[0].strides))), 2.0)) / ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_wresult.diminfo[0].strides)) + __pyx_v_wval)); + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_qresult.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_qresult.diminfo[0].strides) += (((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_wresult.diminfo[0].strides)) * __pyx_v_wval) * __pyx_v_bval_mresult) * __pyx_v_bval_mresult) / ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_wresult.diminfo[0].strides)) + __pyx_v_wval)); - /* "yt/utilities/lib/misc_utilities.pyx":159 - * qresult[bin] += (wresult[bin] * wval * (bval - mresult[bin])**2) / \ + /* "yt/utilities/lib/misc_utilities.pyx":162 + * qresult[bin] += wresult[bin] * wval * bval_mresult * bval_mresult / \ * (wresult[bin] + wval) * wresult[bin] += wval # <<<<<<<<<<<<<< * bresult[bin] += wval*bval - * mresult[bin] += wval * (bval - mresult[bin]) / wresult[bin] + * mresult[bin] += wval * bval_mresult / wresult[bin] */ __pyx_t_10 = __pyx_v_bin; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_wresult.diminfo[0].strides) += __pyx_v_wval; - /* "yt/utilities/lib/misc_utilities.pyx":160 + /* "yt/utilities/lib/misc_utilities.pyx":163 * (wresult[bin] + wval) * wresult[bin] += wval * bresult[bin] += wval*bval # <<<<<<<<<<<<<< - * mresult[bin] += wval * (bval - mresult[bin]) / wresult[bin] + * mresult[bin] += wval * bval_mresult / wresult[bin] * used[bin] = 1 */ __pyx_t_11 = __pyx_v_bin; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_bresult.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bresult.diminfo[0].strides) += (__pyx_v_wval * __pyx_v_bval); - /* "yt/utilities/lib/misc_utilities.pyx":161 + /* "yt/utilities/lib/misc_utilities.pyx":164 * wresult[bin] += wval * bresult[bin] += wval*bval - * mresult[bin] += wval * (bval - mresult[bin]) / wresult[bin] # <<<<<<<<<<<<<< + * mresult[bin] += wval * bval_mresult / wresult[bin] # <<<<<<<<<<<<<< * used[bin] = 1 * return */ __pyx_t_12 = __pyx_v_bin; __pyx_t_13 = __pyx_v_bin; - __pyx_t_14 = __pyx_v_bin; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mresult.diminfo[0].strides) += ((__pyx_v_wval * (__pyx_v_bval - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_mresult.diminfo[0].strides)))) / (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_wresult.diminfo[0].strides))); + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_mresult.diminfo[0].strides) += ((__pyx_v_wval * __pyx_v_bval_mresult) / (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_wresult.diminfo[0].strides))); - /* "yt/utilities/lib/misc_utilities.pyx":162 + /* "yt/utilities/lib/misc_utilities.pyx":165 * bresult[bin] += wval*bval - * mresult[bin] += wval * (bval - mresult[bin]) / wresult[bin] + * mresult[bin] += wval * bval_mresult / wresult[bin] * used[bin] = 1 # <<<<<<<<<<<<<< * return * */ - __pyx_t_15 = __pyx_v_bin; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_used.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_used.diminfo[0].strides) = 1.0; + __pyx_t_14 = __pyx_v_bin; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_used.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_used.diminfo[0].strides) = 1.0; } - /* "yt/utilities/lib/misc_utilities.pyx":163 - * mresult[bin] += wval * (bval - mresult[bin]) / wresult[bin] + /* "yt/utilities/lib/misc_utilities.pyx":166 + * mresult[bin] += wval * bval_mresult / wresult[bin] * used[bin] = 1 * return # <<<<<<<<<<<<<< * @@ -5650,7 +5897,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":143 + /* "yt/utilities/lib/misc_utilities.pyx":145 * @cython.wraparound(False) * @cython.cdivision(True) * def bin_profile1d(np.ndarray[np.int64_t, ndim=1] bins_x, # <<<<<<<<<<<<<< @@ -5691,7 +5938,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":168 +/* "yt/utilities/lib/misc_utilities.pyx":171 * @cython.wraparound(False) * @cython.cdivision(True) * def bin_profile2d(np.ndarray[np.int64_t, ndim=1] bins_x, # <<<<<<<<<<<<<< @@ -5723,14 +5970,23 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -5739,49 +5995,57 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 1); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 1); __PYX_ERR(0, 171, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wsource)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 2); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 2); __PYX_ERR(0, 171, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bsource)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 3); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 3); __PYX_ERR(0, 171, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 4); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 4); __PYX_ERR(0, 171, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 5); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 5); __PYX_ERR(0, 171, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 6); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 6); __PYX_ERR(0, 171, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 7); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 7); __PYX_ERR(0, 171, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_used)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 8); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, 8); __PYX_ERR(0, 171, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bin_profile2d") < 0)) __PYX_ERR(0, 168, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bin_profile2d") < 0)) __PYX_ERR(0, 171, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; @@ -5808,21 +6072,21 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile2d", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 171, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.bin_profile2d", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_x), __pyx_ptype_5numpy_ndarray, 1, "bins_x", 0))) __PYX_ERR(0, 168, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_y), __pyx_ptype_5numpy_ndarray, 1, "bins_y", 0))) __PYX_ERR(0, 169, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wsource), __pyx_ptype_5numpy_ndarray, 1, "wsource", 0))) __PYX_ERR(0, 170, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bsource), __pyx_ptype_5numpy_ndarray, 1, "bsource", 0))) __PYX_ERR(0, 171, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wresult), __pyx_ptype_5numpy_ndarray, 1, "wresult", 0))) __PYX_ERR(0, 172, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bresult), __pyx_ptype_5numpy_ndarray, 1, "bresult", 0))) __PYX_ERR(0, 173, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mresult), __pyx_ptype_5numpy_ndarray, 1, "mresult", 0))) __PYX_ERR(0, 174, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qresult), __pyx_ptype_5numpy_ndarray, 1, "qresult", 0))) __PYX_ERR(0, 175, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_used), __pyx_ptype_5numpy_ndarray, 1, "used", 0))) __PYX_ERR(0, 176, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_x), __pyx_ptype_5numpy_ndarray, 1, "bins_x", 0))) __PYX_ERR(0, 171, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_y), __pyx_ptype_5numpy_ndarray, 1, "bins_y", 0))) __PYX_ERR(0, 172, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wsource), __pyx_ptype_5numpy_ndarray, 1, "wsource", 0))) __PYX_ERR(0, 173, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bsource), __pyx_ptype_5numpy_ndarray, 1, "bsource", 0))) __PYX_ERR(0, 174, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wresult), __pyx_ptype_5numpy_ndarray, 1, "wresult", 0))) __PYX_ERR(0, 175, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bresult), __pyx_ptype_5numpy_ndarray, 1, "bresult", 0))) __PYX_ERR(0, 176, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mresult), __pyx_ptype_5numpy_ndarray, 1, "mresult", 0))) __PYX_ERR(0, 177, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qresult), __pyx_ptype_5numpy_ndarray, 1, "qresult", 0))) __PYX_ERR(0, 178, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_used), __pyx_ptype_5numpy_ndarray, 1, "used", 0))) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_8bin_profile2d(__pyx_self, __pyx_v_bins_x, __pyx_v_bins_y, __pyx_v_wsource, __pyx_v_bsource, __pyx_v_wresult, __pyx_v_bresult, __pyx_v_mresult, __pyx_v_qresult, __pyx_v_used); /* function exit code */ @@ -5840,6 +6104,7 @@ int __pyx_v_binj; __pyx_t_5numpy_float64_t __pyx_v_wval; __pyx_t_5numpy_float64_t __pyx_v_bval; + __pyx_t_5numpy_float64_t __pyx_v_bval_mresult; __Pyx_LocalBuf_ND __pyx_pybuffernd_bins_x; __Pyx_Buffer __pyx_pybuffer_bins_x; __Pyx_LocalBuf_ND __pyx_pybuffernd_bins_y; @@ -5884,8 +6149,6 @@ 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; __Pyx_RefNannySetupContext("bin_profile2d", 0); __pyx_pybuffer_bins_x.pybuffer.buf = NULL; __pyx_pybuffer_bins_x.refcount = 0; @@ -5925,53 +6188,53 @@ __pyx_pybuffernd_used.rcbuffer = &__pyx_pybuffer_used; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) } __pyx_pybuffernd_bins_x.diminfo[0].strides = __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins_x.diminfo[0].shape = __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) } __pyx_pybuffernd_bins_y.diminfo[0].strides = __pyx_pybuffernd_bins_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins_y.diminfo[0].shape = __pyx_pybuffernd_bins_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_wsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_wsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) } __pyx_pybuffernd_wsource.diminfo[0].strides = __pyx_pybuffernd_wsource.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_wsource.diminfo[0].shape = __pyx_pybuffernd_wsource.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_bsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_bsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) } __pyx_pybuffernd_bsource.diminfo[0].strides = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bsource.diminfo[0].shape = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_wresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_wresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) } __pyx_pybuffernd_wresult.diminfo[0].strides = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_wresult.diminfo[0].shape = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_wresult.diminfo[1].strides = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_wresult.diminfo[1].shape = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_bresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_bresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) } __pyx_pybuffernd_bresult.diminfo[0].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bresult.diminfo[0].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_bresult.diminfo[1].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_bresult.diminfo[1].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_mresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_mresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) } __pyx_pybuffernd_mresult.diminfo[0].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mresult.diminfo[0].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mresult.diminfo[1].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mresult.diminfo[1].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_qresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_qresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) } __pyx_pybuffernd_qresult.diminfo[0].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qresult.diminfo[0].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_qresult.diminfo[1].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_qresult.diminfo[1].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_used.rcbuffer->pybuffer, (PyObject*)__pyx_v_used, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_used.rcbuffer->pybuffer, (PyObject*)__pyx_v_used, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) } __pyx_pybuffernd_used.diminfo[0].strides = __pyx_pybuffernd_used.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_used.diminfo[0].shape = __pyx_pybuffernd_used.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_used.diminfo[1].strides = __pyx_pybuffernd_used.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_used.diminfo[1].shape = __pyx_pybuffernd_used.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/misc_utilities.pyx":179 + /* "yt/utilities/lib/misc_utilities.pyx":182 * cdef int n, bini, binj - * cdef np.float64_t wval, bval + * cdef np.float64_t wval, bval, bval_mresult * for n in range(bins_x.shape[0]): # <<<<<<<<<<<<<< * bini = bins_x[n] * binj = bins_y[n] @@ -5980,8 +6243,8 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_n = __pyx_t_2; - /* "yt/utilities/lib/misc_utilities.pyx":180 - * cdef np.float64_t wval, bval + /* "yt/utilities/lib/misc_utilities.pyx":183 + * cdef np.float64_t wval, bval, bval_mresult * for n in range(bins_x.shape[0]): * bini = bins_x[n] # <<<<<<<<<<<<<< * binj = bins_y[n] @@ -5990,7 +6253,7 @@ __pyx_t_3 = __pyx_v_n; __pyx_v_bini = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_bins_x.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":181 + /* "yt/utilities/lib/misc_utilities.pyx":184 * for n in range(bins_x.shape[0]): * bini = bins_x[n] * binj = bins_y[n] # <<<<<<<<<<<<<< @@ -6000,41 +6263,50 @@ __pyx_t_4 = __pyx_v_n; __pyx_v_binj = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins_y.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_bins_y.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":182 + /* "yt/utilities/lib/misc_utilities.pyx":185 * bini = bins_x[n] * binj = bins_y[n] * bval = bsource[n] # <<<<<<<<<<<<<< * wval = wsource[n] - * qresult[bini, binj] += (wresult[bini, binj] * wval * (bval - mresult[bini, binj])**2) / \ + * bval_mresult = bval - mresult[bini, binj] */ __pyx_t_5 = __pyx_v_n; __pyx_v_bval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_bsource.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_bsource.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":183 + /* "yt/utilities/lib/misc_utilities.pyx":186 * binj = bins_y[n] * bval = bsource[n] * wval = wsource[n] # <<<<<<<<<<<<<< - * qresult[bini, binj] += (wresult[bini, binj] * wval * (bval - mresult[bini, binj])**2) / \ - * (wresult[bini, binj] + wval) + * bval_mresult = bval - mresult[bini, binj] + * qresult[bini, binj] += wresult[bini, binj] * wval * bval_mresult * bval_mresult / \ */ __pyx_t_6 = __pyx_v_n; __pyx_v_wval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wsource.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_wsource.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":184 + /* "yt/utilities/lib/misc_utilities.pyx":187 * bval = bsource[n] * wval = wsource[n] - * qresult[bini, binj] += (wresult[bini, binj] * wval * (bval - mresult[bini, binj])**2) / \ # <<<<<<<<<<<<<< + * bval_mresult = bval - mresult[bini, binj] # <<<<<<<<<<<<<< + * qresult[bini, binj] += wresult[bini, binj] * wval * bval_mresult * bval_mresult / \ * (wresult[bini, binj] + wval) - * wresult[bini, binj] += wval */ __pyx_t_7 = __pyx_v_bini; __pyx_t_8 = __pyx_v_binj; + __pyx_v_bval_mresult = (__pyx_v_bval - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_mresult.diminfo[1].strides))); + + /* "yt/utilities/lib/misc_utilities.pyx":188 + * wval = wsource[n] + * bval_mresult = bval - mresult[bini, binj] + * qresult[bini, binj] += wresult[bini, binj] * wval * bval_mresult * bval_mresult / \ # <<<<<<<<<<<<<< + * (wresult[bini, binj] + wval) + * wresult[bini, binj] += wval + */ __pyx_t_9 = __pyx_v_bini; __pyx_t_10 = __pyx_v_binj; - /* "yt/utilities/lib/misc_utilities.pyx":185 - * wval = wsource[n] - * qresult[bini, binj] += (wresult[bini, binj] * wval * (bval - mresult[bini, binj])**2) / \ + /* "yt/utilities/lib/misc_utilities.pyx":189 + * bval_mresult = bval - mresult[bini, binj] + * qresult[bini, binj] += wresult[bini, binj] * wval * bval_mresult * bval_mresult / \ * (wresult[bini, binj] + wval) # <<<<<<<<<<<<<< * wresult[bini, binj] += wval * bresult[bini, binj] += wval*bval @@ -6042,43 +6314,43 @@ __pyx_t_11 = __pyx_v_bini; __pyx_t_12 = __pyx_v_binj; - /* "yt/utilities/lib/misc_utilities.pyx":184 - * bval = bsource[n] + /* "yt/utilities/lib/misc_utilities.pyx":188 * wval = wsource[n] - * qresult[bini, binj] += (wresult[bini, binj] * wval * (bval - mresult[bini, binj])**2) / \ # <<<<<<<<<<<<<< + * bval_mresult = bval - mresult[bini, binj] + * qresult[bini, binj] += wresult[bini, binj] * wval * bval_mresult * bval_mresult / \ # <<<<<<<<<<<<<< * (wresult[bini, binj] + wval) * wresult[bini, binj] += wval */ __pyx_t_13 = __pyx_v_bini; __pyx_t_14 = __pyx_v_binj; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_qresult.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_qresult.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_qresult.diminfo[1].strides) += ((((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_wresult.diminfo[1].strides)) * __pyx_v_wval) * pow((__pyx_v_bval - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_mresult.diminfo[1].strides))), 2.0)) / ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_wresult.diminfo[1].strides)) + __pyx_v_wval)); + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_qresult.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_qresult.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_qresult.diminfo[1].strides) += (((((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_wresult.diminfo[1].strides)) * __pyx_v_wval) * __pyx_v_bval_mresult) * __pyx_v_bval_mresult) / ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_wresult.diminfo[1].strides)) + __pyx_v_wval)); - /* "yt/utilities/lib/misc_utilities.pyx":186 - * qresult[bini, binj] += (wresult[bini, binj] * wval * (bval - mresult[bini, binj])**2) / \ + /* "yt/utilities/lib/misc_utilities.pyx":190 + * qresult[bini, binj] += wresult[bini, binj] * wval * bval_mresult * bval_mresult / \ * (wresult[bini, binj] + wval) * wresult[bini, binj] += wval # <<<<<<<<<<<<<< * bresult[bini, binj] += wval*bval - * mresult[bini, binj] += wval * (bval - mresult[bini, binj]) / wresult[bini, binj] + * mresult[bini, binj] += wval * bval_mresult / wresult[bini, binj] */ __pyx_t_15 = __pyx_v_bini; __pyx_t_16 = __pyx_v_binj; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_wresult.diminfo[1].strides) += __pyx_v_wval; - /* "yt/utilities/lib/misc_utilities.pyx":187 + /* "yt/utilities/lib/misc_utilities.pyx":191 * (wresult[bini, binj] + wval) * wresult[bini, binj] += wval * bresult[bini, binj] += wval*bval # <<<<<<<<<<<<<< - * mresult[bini, binj] += wval * (bval - mresult[bini, binj]) / wresult[bini, binj] + * mresult[bini, binj] += wval * bval_mresult / wresult[bini, binj] * used[bini, binj] = 1 */ __pyx_t_17 = __pyx_v_bini; __pyx_t_18 = __pyx_v_binj; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_bresult.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_bresult.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_bresult.diminfo[1].strides) += (__pyx_v_wval * __pyx_v_bval); - /* "yt/utilities/lib/misc_utilities.pyx":188 + /* "yt/utilities/lib/misc_utilities.pyx":192 * wresult[bini, binj] += wval * bresult[bini, binj] += wval*bval - * mresult[bini, binj] += wval * (bval - mresult[bini, binj]) / wresult[bini, binj] # <<<<<<<<<<<<<< + * mresult[bini, binj] += wval * bval_mresult / wresult[bini, binj] # <<<<<<<<<<<<<< * used[bini, binj] = 1 * return */ @@ -6086,24 +6358,22 @@ __pyx_t_20 = __pyx_v_binj; __pyx_t_21 = __pyx_v_bini; __pyx_t_22 = __pyx_v_binj; - __pyx_t_23 = __pyx_v_bini; - __pyx_t_24 = __pyx_v_binj; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_mresult.diminfo[1].strides) += ((__pyx_v_wval * (__pyx_v_bval - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_mresult.diminfo[1].strides)))) / (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_wresult.diminfo[1].strides))); + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_mresult.diminfo[1].strides) += ((__pyx_v_wval * __pyx_v_bval_mresult) / (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_wresult.diminfo[1].strides))); - /* "yt/utilities/lib/misc_utilities.pyx":189 + /* "yt/utilities/lib/misc_utilities.pyx":193 * bresult[bini, binj] += wval*bval - * mresult[bini, binj] += wval * (bval - mresult[bini, binj]) / wresult[bini, binj] + * mresult[bini, binj] += wval * bval_mresult / wresult[bini, binj] * used[bini, binj] = 1 # <<<<<<<<<<<<<< * return * */ - __pyx_t_25 = __pyx_v_bini; - __pyx_t_26 = __pyx_v_binj; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_used.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_used.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_used.diminfo[1].strides) = 1.0; + __pyx_t_23 = __pyx_v_bini; + __pyx_t_24 = __pyx_v_binj; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_used.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_used.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_used.diminfo[1].strides) = 1.0; } - /* "yt/utilities/lib/misc_utilities.pyx":190 - * mresult[bini, binj] += wval * (bval - mresult[bini, binj]) / wresult[bini, binj] + /* "yt/utilities/lib/misc_utilities.pyx":194 + * mresult[bini, binj] += wval * bval_mresult / wresult[bini, binj] * used[bini, binj] = 1 * return # <<<<<<<<<<<<<< * @@ -6113,7 +6383,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":168 + /* "yt/utilities/lib/misc_utilities.pyx":171 * @cython.wraparound(False) * @cython.cdivision(True) * def bin_profile2d(np.ndarray[np.int64_t, ndim=1] bins_x, # <<<<<<<<<<<<<< @@ -6156,7 +6426,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":195 +/* "yt/utilities/lib/misc_utilities.pyx":199 * @cython.wraparound(False) * @cython.cdivision(True) * def bin_profile3d(np.ndarray[np.int64_t, ndim=1] bins_x, # <<<<<<<<<<<<<< @@ -6189,15 +6459,25 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -6206,54 +6486,63 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 1); __PYX_ERR(0, 195, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 1); __PYX_ERR(0, 199, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 2); __PYX_ERR(0, 195, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 2); __PYX_ERR(0, 199, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wsource)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 3); __PYX_ERR(0, 195, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 3); __PYX_ERR(0, 199, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bsource)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 4); __PYX_ERR(0, 195, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 4); __PYX_ERR(0, 199, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 5); __PYX_ERR(0, 195, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 5); __PYX_ERR(0, 199, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 6); __PYX_ERR(0, 195, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 6); __PYX_ERR(0, 199, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 7); __PYX_ERR(0, 195, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 7); __PYX_ERR(0, 199, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qresult)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 8); __PYX_ERR(0, 195, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 8); __PYX_ERR(0, 199, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_used)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 9); __PYX_ERR(0, 195, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, 9); __PYX_ERR(0, 199, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bin_profile3d") < 0)) __PYX_ERR(0, 195, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bin_profile3d") < 0)) __PYX_ERR(0, 199, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 10) { goto __pyx_L5_argtuple_error; @@ -6282,22 +6571,22 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 195, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bin_profile3d", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 199, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.bin_profile3d", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_x), __pyx_ptype_5numpy_ndarray, 1, "bins_x", 0))) __PYX_ERR(0, 195, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_y), __pyx_ptype_5numpy_ndarray, 1, "bins_y", 0))) __PYX_ERR(0, 196, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_z), __pyx_ptype_5numpy_ndarray, 1, "bins_z", 0))) __PYX_ERR(0, 197, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wsource), __pyx_ptype_5numpy_ndarray, 1, "wsource", 0))) __PYX_ERR(0, 198, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bsource), __pyx_ptype_5numpy_ndarray, 1, "bsource", 0))) __PYX_ERR(0, 199, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wresult), __pyx_ptype_5numpy_ndarray, 1, "wresult", 0))) __PYX_ERR(0, 200, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bresult), __pyx_ptype_5numpy_ndarray, 1, "bresult", 0))) __PYX_ERR(0, 201, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mresult), __pyx_ptype_5numpy_ndarray, 1, "mresult", 0))) __PYX_ERR(0, 202, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qresult), __pyx_ptype_5numpy_ndarray, 1, "qresult", 0))) __PYX_ERR(0, 203, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_used), __pyx_ptype_5numpy_ndarray, 1, "used", 0))) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_x), __pyx_ptype_5numpy_ndarray, 1, "bins_x", 0))) __PYX_ERR(0, 199, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_y), __pyx_ptype_5numpy_ndarray, 1, "bins_y", 0))) __PYX_ERR(0, 200, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins_z), __pyx_ptype_5numpy_ndarray, 1, "bins_z", 0))) __PYX_ERR(0, 201, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wsource), __pyx_ptype_5numpy_ndarray, 1, "wsource", 0))) __PYX_ERR(0, 202, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bsource), __pyx_ptype_5numpy_ndarray, 1, "bsource", 0))) __PYX_ERR(0, 203, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_wresult), __pyx_ptype_5numpy_ndarray, 1, "wresult", 0))) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bresult), __pyx_ptype_5numpy_ndarray, 1, "bresult", 0))) __PYX_ERR(0, 205, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mresult), __pyx_ptype_5numpy_ndarray, 1, "mresult", 0))) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qresult), __pyx_ptype_5numpy_ndarray, 1, "qresult", 0))) __PYX_ERR(0, 207, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_used), __pyx_ptype_5numpy_ndarray, 1, "used", 0))) __PYX_ERR(0, 208, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_10bin_profile3d(__pyx_self, __pyx_v_bins_x, __pyx_v_bins_y, __pyx_v_bins_z, __pyx_v_wsource, __pyx_v_bsource, __pyx_v_wresult, __pyx_v_bresult, __pyx_v_mresult, __pyx_v_qresult, __pyx_v_used); /* function exit code */ @@ -6316,6 +6605,7 @@ int __pyx_v_bink; __pyx_t_5numpy_float64_t __pyx_v_wval; __pyx_t_5numpy_float64_t __pyx_v_bval; + __pyx_t_5numpy_float64_t __pyx_v_bval_mresult; __Pyx_LocalBuf_ND __pyx_pybuffernd_bins_x; __Pyx_Buffer __pyx_pybuffer_bins_x; __Pyx_LocalBuf_ND __pyx_pybuffernd_bins_y; @@ -6372,9 +6662,6 @@ Py_ssize_t __pyx_t_32; Py_ssize_t __pyx_t_33; Py_ssize_t __pyx_t_34; - Py_ssize_t __pyx_t_35; - Py_ssize_t __pyx_t_36; - Py_ssize_t __pyx_t_37; __Pyx_RefNannySetupContext("bin_profile3d", 0); __pyx_pybuffer_bins_x.pybuffer.buf = NULL; __pyx_pybuffer_bins_x.refcount = 0; @@ -6418,58 +6705,58 @@ __pyx_pybuffernd_used.rcbuffer = &__pyx_pybuffer_used; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 199, __pyx_L1_error) } __pyx_pybuffernd_bins_x.diminfo[0].strides = __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins_x.diminfo[0].shape = __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 199, __pyx_L1_error) } __pyx_pybuffernd_bins_y.diminfo[0].strides = __pyx_pybuffernd_bins_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins_y.diminfo[0].shape = __pyx_pybuffernd_bins_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 199, __pyx_L1_error) } __pyx_pybuffernd_bins_z.diminfo[0].strides = __pyx_pybuffernd_bins_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins_z.diminfo[0].shape = __pyx_pybuffernd_bins_z.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_wsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_wsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 199, __pyx_L1_error) } __pyx_pybuffernd_wsource.diminfo[0].strides = __pyx_pybuffernd_wsource.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_wsource.diminfo[0].shape = __pyx_pybuffernd_wsource.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_bsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bsource.rcbuffer->pybuffer, (PyObject*)__pyx_v_bsource, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 199, __pyx_L1_error) } __pyx_pybuffernd_bsource.diminfo[0].strides = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bsource.diminfo[0].shape = __pyx_pybuffernd_bsource.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_wresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_wresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 199, __pyx_L1_error) } __pyx_pybuffernd_wresult.diminfo[0].strides = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_wresult.diminfo[0].shape = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_wresult.diminfo[1].strides = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_wresult.diminfo[1].shape = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_wresult.diminfo[2].strides = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_wresult.diminfo[2].shape = __pyx_pybuffernd_wresult.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_bresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_bresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 199, __pyx_L1_error) } __pyx_pybuffernd_bresult.diminfo[0].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bresult.diminfo[0].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_bresult.diminfo[1].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_bresult.diminfo[1].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_bresult.diminfo[2].strides = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_bresult.diminfo[2].shape = __pyx_pybuffernd_bresult.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_mresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_mresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 199, __pyx_L1_error) } __pyx_pybuffernd_mresult.diminfo[0].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mresult.diminfo[0].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mresult.diminfo[1].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mresult.diminfo[1].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mresult.diminfo[2].strides = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mresult.diminfo[2].shape = __pyx_pybuffernd_mresult.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_qresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_qresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 199, __pyx_L1_error) } __pyx_pybuffernd_qresult.diminfo[0].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qresult.diminfo[0].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_qresult.diminfo[1].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_qresult.diminfo[1].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_qresult.diminfo[2].strides = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_qresult.diminfo[2].shape = __pyx_pybuffernd_qresult.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_used.rcbuffer->pybuffer, (PyObject*)__pyx_v_used, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_used.rcbuffer->pybuffer, (PyObject*)__pyx_v_used, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 199, __pyx_L1_error) } __pyx_pybuffernd_used.diminfo[0].strides = __pyx_pybuffernd_used.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_used.diminfo[0].shape = __pyx_pybuffernd_used.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_used.diminfo[1].strides = __pyx_pybuffernd_used.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_used.diminfo[1].shape = __pyx_pybuffernd_used.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_used.diminfo[2].strides = __pyx_pybuffernd_used.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_used.diminfo[2].shape = __pyx_pybuffernd_used.rcbuffer->pybuffer.shape[2]; - /* "yt/utilities/lib/misc_utilities.pyx":207 + /* "yt/utilities/lib/misc_utilities.pyx":211 * cdef int n, bini, binj, bink - * cdef np.float64_t wval, bval + * cdef np.float64_t wval, bval, bval_mresult * for n in range(bins_x.shape[0]): # <<<<<<<<<<<<<< * bini = bins_x[n] * binj = bins_y[n] @@ -6478,8 +6765,8 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_n = __pyx_t_2; - /* "yt/utilities/lib/misc_utilities.pyx":208 - * cdef np.float64_t wval, bval + /* "yt/utilities/lib/misc_utilities.pyx":212 + * cdef np.float64_t wval, bval, bval_mresult * for n in range(bins_x.shape[0]): * bini = bins_x[n] # <<<<<<<<<<<<<< * binj = bins_y[n] @@ -6488,7 +6775,7 @@ __pyx_t_3 = __pyx_v_n; __pyx_v_bini = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins_x.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_bins_x.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":209 + /* "yt/utilities/lib/misc_utilities.pyx":213 * for n in range(bins_x.shape[0]): * bini = bins_x[n] * binj = bins_y[n] # <<<<<<<<<<<<<< @@ -6498,7 +6785,7 @@ __pyx_t_4 = __pyx_v_n; __pyx_v_binj = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins_y.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_bins_y.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":210 + /* "yt/utilities/lib/misc_utilities.pyx":214 * bini = bins_x[n] * binj = bins_y[n] * bink = bins_z[n] # <<<<<<<<<<<<<< @@ -6508,43 +6795,52 @@ __pyx_t_5 = __pyx_v_n; __pyx_v_bink = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins_z.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_bins_z.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":211 + /* "yt/utilities/lib/misc_utilities.pyx":215 * binj = bins_y[n] * bink = bins_z[n] * bval = bsource[n] # <<<<<<<<<<<<<< * wval = wsource[n] - * qresult[bini, binj, bink] += (wresult[bini, binj, bink] * wval * (bval - mresult[bini, binj, bink])**2) / \ + * bval_mresult = bval - mresult[bini, binj, bink] */ __pyx_t_6 = __pyx_v_n; __pyx_v_bval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_bsource.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_bsource.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":212 + /* "yt/utilities/lib/misc_utilities.pyx":216 * bink = bins_z[n] * bval = bsource[n] * wval = wsource[n] # <<<<<<<<<<<<<< - * qresult[bini, binj, bink] += (wresult[bini, binj, bink] * wval * (bval - mresult[bini, binj, bink])**2) / \ - * (wresult[bini, binj, bink] + wval) + * bval_mresult = bval - mresult[bini, binj, bink] + * qresult[bini, binj, bink] += wresult[bini, binj, bink] * wval * bval_mresult * bval_mresult / \ */ __pyx_t_7 = __pyx_v_n; __pyx_v_wval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wsource.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_wsource.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":213 + /* "yt/utilities/lib/misc_utilities.pyx":217 * bval = bsource[n] * wval = wsource[n] - * qresult[bini, binj, bink] += (wresult[bini, binj, bink] * wval * (bval - mresult[bini, binj, bink])**2) / \ # <<<<<<<<<<<<<< + * bval_mresult = bval - mresult[bini, binj, bink] # <<<<<<<<<<<<<< + * qresult[bini, binj, bink] += wresult[bini, binj, bink] * wval * bval_mresult * bval_mresult / \ * (wresult[bini, binj, bink] + wval) - * wresult[bini, binj, bink] += wval */ __pyx_t_8 = __pyx_v_bini; __pyx_t_9 = __pyx_v_binj; __pyx_t_10 = __pyx_v_bink; + __pyx_v_bval_mresult = (__pyx_v_bval - (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_mresult.diminfo[2].strides))); + + /* "yt/utilities/lib/misc_utilities.pyx":218 + * wval = wsource[n] + * bval_mresult = bval - mresult[bini, binj, bink] + * qresult[bini, binj, bink] += wresult[bini, binj, bink] * wval * bval_mresult * bval_mresult / \ # <<<<<<<<<<<<<< + * (wresult[bini, binj, bink] + wval) + * wresult[bini, binj, bink] += wval + */ __pyx_t_11 = __pyx_v_bini; __pyx_t_12 = __pyx_v_binj; __pyx_t_13 = __pyx_v_bink; - /* "yt/utilities/lib/misc_utilities.pyx":214 - * wval = wsource[n] - * qresult[bini, binj, bink] += (wresult[bini, binj, bink] * wval * (bval - mresult[bini, binj, bink])**2) / \ + /* "yt/utilities/lib/misc_utilities.pyx":219 + * bval_mresult = bval - mresult[bini, binj, bink] + * qresult[bini, binj, bink] += wresult[bini, binj, bink] * wval * bval_mresult * bval_mresult / \ * (wresult[bini, binj, bink] + wval) # <<<<<<<<<<<<<< * wresult[bini, binj, bink] += wval * bresult[bini, binj, bink] += wval*bval @@ -6553,35 +6849,35 @@ __pyx_t_15 = __pyx_v_binj; __pyx_t_16 = __pyx_v_bink; - /* "yt/utilities/lib/misc_utilities.pyx":213 - * bval = bsource[n] + /* "yt/utilities/lib/misc_utilities.pyx":218 * wval = wsource[n] - * qresult[bini, binj, bink] += (wresult[bini, binj, bink] * wval * (bval - mresult[bini, binj, bink])**2) / \ # <<<<<<<<<<<<<< + * bval_mresult = bval - mresult[bini, binj, bink] + * qresult[bini, binj, bink] += wresult[bini, binj, bink] * wval * bval_mresult * bval_mresult / \ # <<<<<<<<<<<<<< * (wresult[bini, binj, bink] + wval) * wresult[bini, binj, bink] += wval */ __pyx_t_17 = __pyx_v_bini; __pyx_t_18 = __pyx_v_binj; __pyx_t_19 = __pyx_v_bink; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_qresult.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qresult.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_qresult.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_qresult.diminfo[2].strides) += ((((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_wresult.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_wresult.diminfo[2].strides)) * __pyx_v_wval) * pow((__pyx_v_bval - (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_mresult.diminfo[2].strides))), 2.0)) / ((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_wresult.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_wresult.diminfo[2].strides)) + __pyx_v_wval)); + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_qresult.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qresult.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_qresult.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_qresult.diminfo[2].strides) += (((((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_wresult.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_wresult.diminfo[2].strides)) * __pyx_v_wval) * __pyx_v_bval_mresult) * __pyx_v_bval_mresult) / ((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_wresult.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_wresult.diminfo[2].strides)) + __pyx_v_wval)); - /* "yt/utilities/lib/misc_utilities.pyx":215 - * qresult[bini, binj, bink] += (wresult[bini, binj, bink] * wval * (bval - mresult[bini, binj, bink])**2) / \ + /* "yt/utilities/lib/misc_utilities.pyx":220 + * qresult[bini, binj, bink] += wresult[bini, binj, bink] * wval * bval_mresult * bval_mresult / \ * (wresult[bini, binj, bink] + wval) * wresult[bini, binj, bink] += wval # <<<<<<<<<<<<<< * bresult[bini, binj, bink] += wval*bval - * mresult[bini, binj, bink] += wval * (bval - mresult[bini, binj, bink]) / wresult[bini, binj, bink] + * mresult[bini, binj, bink] += wval * bval_mresult / wresult[bini, binj, bink] */ __pyx_t_20 = __pyx_v_bini; __pyx_t_21 = __pyx_v_binj; __pyx_t_22 = __pyx_v_bink; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_wresult.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_wresult.diminfo[2].strides) += __pyx_v_wval; - /* "yt/utilities/lib/misc_utilities.pyx":216 + /* "yt/utilities/lib/misc_utilities.pyx":221 * (wresult[bini, binj, bink] + wval) * wresult[bini, binj, bink] += wval * bresult[bini, binj, bink] += wval*bval # <<<<<<<<<<<<<< - * mresult[bini, binj, bink] += wval * (bval - mresult[bini, binj, bink]) / wresult[bini, binj, bink] + * mresult[bini, binj, bink] += wval * bval_mresult / wresult[bini, binj, bink] * used[bini, binj, bink] = 1 */ __pyx_t_23 = __pyx_v_bini; @@ -6589,10 +6885,10 @@ __pyx_t_25 = __pyx_v_bink; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_bresult.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_bresult.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_bresult.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_bresult.diminfo[2].strides) += (__pyx_v_wval * __pyx_v_bval); - /* "yt/utilities/lib/misc_utilities.pyx":217 + /* "yt/utilities/lib/misc_utilities.pyx":222 * wresult[bini, binj, bink] += wval * bresult[bini, binj, bink] += wval*bval - * mresult[bini, binj, bink] += wval * (bval - mresult[bini, binj, bink]) / wresult[bini, binj, bink] # <<<<<<<<<<<<<< + * mresult[bini, binj, bink] += wval * bval_mresult / wresult[bini, binj, bink] # <<<<<<<<<<<<<< * used[bini, binj, bink] = 1 * return */ @@ -6602,26 +6898,23 @@ __pyx_t_29 = __pyx_v_bini; __pyx_t_30 = __pyx_v_binj; __pyx_t_31 = __pyx_v_bink; - __pyx_t_32 = __pyx_v_bini; - __pyx_t_33 = __pyx_v_binj; - __pyx_t_34 = __pyx_v_bink; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_34, __pyx_pybuffernd_mresult.diminfo[2].strides) += ((__pyx_v_wval * (__pyx_v_bval - (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_mresult.diminfo[2].strides)))) / (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_wresult.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_wresult.diminfo[2].strides))); + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mresult.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_mresult.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_mresult.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_mresult.diminfo[2].strides) += ((__pyx_v_wval * __pyx_v_bval_mresult) / (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_wresult.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_wresult.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_wresult.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_wresult.diminfo[2].strides))); - /* "yt/utilities/lib/misc_utilities.pyx":218 + /* "yt/utilities/lib/misc_utilities.pyx":223 * bresult[bini, binj, bink] += wval*bval - * mresult[bini, binj, bink] += wval * (bval - mresult[bini, binj, bink]) / wresult[bini, binj, bink] + * mresult[bini, binj, bink] += wval * bval_mresult / wresult[bini, binj, bink] * used[bini, binj, bink] = 1 # <<<<<<<<<<<<<< * return * */ - __pyx_t_35 = __pyx_v_bini; - __pyx_t_36 = __pyx_v_binj; - __pyx_t_37 = __pyx_v_bink; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_used.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_used.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_used.diminfo[1].strides, __pyx_t_37, __pyx_pybuffernd_used.diminfo[2].strides) = 1.0; + __pyx_t_32 = __pyx_v_bini; + __pyx_t_33 = __pyx_v_binj; + __pyx_t_34 = __pyx_v_bink; + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_used.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_used.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_used.diminfo[1].strides, __pyx_t_34, __pyx_pybuffernd_used.diminfo[2].strides) = 1.0; } - /* "yt/utilities/lib/misc_utilities.pyx":219 - * mresult[bini, binj, bink] += wval * (bval - mresult[bini, binj, bink]) / wresult[bini, binj, bink] + /* "yt/utilities/lib/misc_utilities.pyx":224 + * mresult[bini, binj, bink] += wval * bval_mresult / wresult[bini, binj, bink] * used[bini, binj, bink] = 1 * return # <<<<<<<<<<<<<< * @@ -6631,7 +6924,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":195 + /* "yt/utilities/lib/misc_utilities.pyx":199 * @cython.wraparound(False) * @cython.cdivision(True) * def bin_profile3d(np.ndarray[np.int64_t, ndim=1] bins_x, # <<<<<<<<<<<<<< @@ -6676,7 +6969,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":224 +/* "yt/utilities/lib/misc_utilities.pyx":229 * @cython.wraparound(False) * @cython.cdivision(True) * def lines(np.float64_t[:,:,:] image, # <<<<<<<<<<<<<< @@ -6707,13 +7000,21 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -6722,36 +7023,43 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 8, 1); __PYX_ERR(0, 224, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 8, 1); __PYX_ERR(0, 229, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 8, 2); __PYX_ERR(0, 224, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 8, 2); __PYX_ERR(0, 229, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_colors)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 8, 3); __PYX_ERR(0, 224, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 8, 3); __PYX_ERR(0, 229, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points_per_color); if (value) { values[4] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thick); if (value) { values[5] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flip); if (value) { values[6] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_crop); @@ -6759,14 +7067,18 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lines") < 0)) __PYX_ERR(0, 224, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lines") < 0)) __PYX_ERR(0, 229, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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); @@ -6775,34 +7087,34 @@ default: goto __pyx_L5_argtuple_error; } } - __pyx_v_image = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_image.memview)) __PYX_ERR(0, 224, __pyx_L3_error) - __pyx_v_xs = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_xs.memview)) __PYX_ERR(0, 225, __pyx_L3_error) - __pyx_v_ys = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_ys.memview)) __PYX_ERR(0, 226, __pyx_L3_error) - __pyx_v_colors = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_colors.memview)) __PYX_ERR(0, 227, __pyx_L3_error) + __pyx_v_image = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_image.memview)) __PYX_ERR(0, 229, __pyx_L3_error) + __pyx_v_xs = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_xs.memview)) __PYX_ERR(0, 230, __pyx_L3_error) + __pyx_v_ys = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_ys.memview)) __PYX_ERR(0, 231, __pyx_L3_error) + __pyx_v_colors = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_colors.memview)) __PYX_ERR(0, 232, __pyx_L3_error) if (values[4]) { - __pyx_v_points_per_color = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_points_per_color == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) + __pyx_v_points_per_color = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_points_per_color == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L3_error) } else { __pyx_v_points_per_color = ((int)1); } if (values[5]) { - __pyx_v_thick = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_thick == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L3_error) + __pyx_v_thick = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_thick == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L3_error) } else { __pyx_v_thick = ((int)1); } if (values[6]) { - __pyx_v_flip = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_flip == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error) + __pyx_v_flip = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_flip == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 235, __pyx_L3_error) } else { __pyx_v_flip = ((int)0); } if (values[7]) { - __pyx_v_crop = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_crop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L3_error) + __pyx_v_crop = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_crop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 236, __pyx_L3_error) } else { __pyx_v_crop = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 229, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.lines", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6893,7 +7205,7 @@ Py_ssize_t __pyx_t_51; __Pyx_RefNannySetupContext("lines", 0); - /* "yt/utilities/lib/misc_utilities.pyx":233 + /* "yt/utilities/lib/misc_utilities.pyx":238 * int crop = 0): * * cdef int nx = image.shape[0] # <<<<<<<<<<<<<< @@ -6902,7 +7214,7 @@ */ __pyx_v_nx = (__pyx_v_image.shape[0]); - /* "yt/utilities/lib/misc_utilities.pyx":234 + /* "yt/utilities/lib/misc_utilities.pyx":239 * * cdef int nx = image.shape[0] * cdef int ny = image.shape[1] # <<<<<<<<<<<<<< @@ -6911,7 +7223,7 @@ */ __pyx_v_ny = (__pyx_v_image.shape[1]); - /* "yt/utilities/lib/misc_utilities.pyx":235 + /* "yt/utilities/lib/misc_utilities.pyx":240 * cdef int nx = image.shape[0] * cdef int ny = image.shape[1] * cdef int nl = xs.shape[0] # <<<<<<<<<<<<<< @@ -6920,7 +7232,7 @@ */ __pyx_v_nl = (__pyx_v_xs.shape[0]); - /* "yt/utilities/lib/misc_utilities.pyx":241 + /* "yt/utilities/lib/misc_utilities.pyx":246 * cdef int dx, dy, sx, sy, e2, err * cdef np.int64_t x0, x1, y0, y1 * cdef int has_alpha = (image.shape[2] == 4) # <<<<<<<<<<<<<< @@ -6929,7 +7241,7 @@ */ __pyx_v_has_alpha = ((__pyx_v_image.shape[2]) == 4); - /* "yt/utilities/lib/misc_utilities.pyx":242 + /* "yt/utilities/lib/misc_utilities.pyx":247 * cdef np.int64_t x0, x1, y0, y1 * cdef int has_alpha = (image.shape[2] == 4) * cdef int no_color = (image.shape[2] < 3) # <<<<<<<<<<<<<< @@ -6938,7 +7250,7 @@ */ __pyx_v_no_color = ((__pyx_v_image.shape[2]) < 3); - /* "yt/utilities/lib/misc_utilities.pyx":243 + /* "yt/utilities/lib/misc_utilities.pyx":248 * cdef int has_alpha = (image.shape[2] == 4) * cdef int no_color = (image.shape[2] < 3) * for j in range(0, nl, 2): # <<<<<<<<<<<<<< @@ -6949,7 +7261,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=2) { __pyx_v_j = __pyx_t_2; - /* "yt/utilities/lib/misc_utilities.pyx":245 + /* "yt/utilities/lib/misc_utilities.pyx":250 * for j in range(0, nl, 2): * # From wikipedia http://en.wikipedia.org/wiki/Bresenham's_line_algorithm * x0 = xs[j] # <<<<<<<<<<<<<< @@ -6959,7 +7271,7 @@ __pyx_t_3 = __pyx_v_j; __pyx_v_x0 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_xs.data + __pyx_t_3 * __pyx_v_xs.strides[0]) ))); - /* "yt/utilities/lib/misc_utilities.pyx":246 + /* "yt/utilities/lib/misc_utilities.pyx":251 * # From wikipedia http://en.wikipedia.org/wiki/Bresenham's_line_algorithm * x0 = xs[j] * y0 = ys[j] # <<<<<<<<<<<<<< @@ -6969,7 +7281,7 @@ __pyx_t_4 = __pyx_v_j; __pyx_v_y0 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_ys.data + __pyx_t_4 * __pyx_v_ys.strides[0]) ))); - /* "yt/utilities/lib/misc_utilities.pyx":247 + /* "yt/utilities/lib/misc_utilities.pyx":252 * x0 = xs[j] * y0 = ys[j] * x1 = xs[j+1] # <<<<<<<<<<<<<< @@ -6979,7 +7291,7 @@ __pyx_t_5 = (__pyx_v_j + 1); __pyx_v_x1 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_xs.data + __pyx_t_5 * __pyx_v_xs.strides[0]) ))); - /* "yt/utilities/lib/misc_utilities.pyx":248 + /* "yt/utilities/lib/misc_utilities.pyx":253 * y0 = ys[j] * x1 = xs[j+1] * y1 = ys[j+1] # <<<<<<<<<<<<<< @@ -6989,39 +7301,39 @@ __pyx_t_6 = (__pyx_v_j + 1); __pyx_v_y1 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_ys.data + __pyx_t_6 * __pyx_v_ys.strides[0]) ))); - /* "yt/utilities/lib/misc_utilities.pyx":249 + /* "yt/utilities/lib/misc_utilities.pyx":254 * x1 = xs[j+1] * y1 = ys[j+1] * dx = abs(x1-x0) # <<<<<<<<<<<<<< * dy = abs(y1-y0) * if crop == 1 and (dx > nx/2.0 or dy > ny/2.0): */ - __pyx_t_7 = __Pyx_PyInt_From_npy_int64((__pyx_v_x1 - __pyx_v_x0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_npy_int64((__pyx_v_x1 - __pyx_v_x0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyNumber_Absolute(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_8 = PyNumber_Absolute(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_dx = __pyx_t_9; - /* "yt/utilities/lib/misc_utilities.pyx":250 + /* "yt/utilities/lib/misc_utilities.pyx":255 * y1 = ys[j+1] * dx = abs(x1-x0) * dy = abs(y1-y0) # <<<<<<<<<<<<<< * if crop == 1 and (dx > nx/2.0 or dy > ny/2.0): * continue */ - __pyx_t_8 = __Pyx_PyInt_From_npy_int64((__pyx_v_y1 - __pyx_v_y0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_npy_int64((__pyx_v_y1 - __pyx_v_y0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyNumber_Absolute(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_7 = PyNumber_Absolute(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_dy = __pyx_t_9; - /* "yt/utilities/lib/misc_utilities.pyx":251 + /* "yt/utilities/lib/misc_utilities.pyx":256 * dx = abs(x1-x0) * dy = abs(y1-y0) * if crop == 1 and (dx > nx/2.0 or dy > ny/2.0): # <<<<<<<<<<<<<< @@ -7045,7 +7357,7 @@ __pyx_L6_bool_binop_done:; if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":252 + /* "yt/utilities/lib/misc_utilities.pyx":257 * dy = abs(y1-y0) * if crop == 1 and (dx > nx/2.0 or dy > ny/2.0): * continue # <<<<<<<<<<<<<< @@ -7054,7 +7366,7 @@ */ goto __pyx_L3_continue; - /* "yt/utilities/lib/misc_utilities.pyx":251 + /* "yt/utilities/lib/misc_utilities.pyx":256 * dx = abs(x1-x0) * dy = abs(y1-y0) * if crop == 1 and (dx > nx/2.0 or dy > ny/2.0): # <<<<<<<<<<<<<< @@ -7063,7 +7375,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":253 + /* "yt/utilities/lib/misc_utilities.pyx":258 * if crop == 1 and (dx > nx/2.0 or dy > ny/2.0): * continue * err = dx - dy # <<<<<<<<<<<<<< @@ -7072,7 +7384,7 @@ */ __pyx_v_err = (__pyx_v_dx - __pyx_v_dy); - /* "yt/utilities/lib/misc_utilities.pyx":255 + /* "yt/utilities/lib/misc_utilities.pyx":260 * err = dx - dy * * if no_color: # <<<<<<<<<<<<<< @@ -7082,7 +7394,7 @@ __pyx_t_10 = (__pyx_v_no_color != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":256 + /* "yt/utilities/lib/misc_utilities.pyx":261 * * if no_color: * for i in range(4): # <<<<<<<<<<<<<< @@ -7092,7 +7404,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < 4; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; - /* "yt/utilities/lib/misc_utilities.pyx":257 + /* "yt/utilities/lib/misc_utilities.pyx":262 * if no_color: * for i in range(4): * alpha[i] = colors[j, 0] # <<<<<<<<<<<<<< @@ -7104,7 +7416,7 @@ (__pyx_v_alpha[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_colors.data + __pyx_t_12 * __pyx_v_colors.strides[0]) ) + __pyx_t_13 * __pyx_v_colors.strides[1]) ))); } - /* "yt/utilities/lib/misc_utilities.pyx":255 + /* "yt/utilities/lib/misc_utilities.pyx":260 * err = dx - dy * * if no_color: # <<<<<<<<<<<<<< @@ -7114,7 +7426,7 @@ goto __pyx_L9; } - /* "yt/utilities/lib/misc_utilities.pyx":258 + /* "yt/utilities/lib/misc_utilities.pyx":263 * for i in range(4): * alpha[i] = colors[j, 0] * elif has_alpha: # <<<<<<<<<<<<<< @@ -7124,7 +7436,7 @@ __pyx_t_10 = (__pyx_v_has_alpha != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":259 + /* "yt/utilities/lib/misc_utilities.pyx":264 * alpha[i] = colors[j, 0] * elif has_alpha: * for i in range(4): # <<<<<<<<<<<<<< @@ -7134,7 +7446,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < 4; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; - /* "yt/utilities/lib/misc_utilities.pyx":260 + /* "yt/utilities/lib/misc_utilities.pyx":265 * elif has_alpha: * for i in range(4): * alpha[i] = colors[j/points_per_color,i] # <<<<<<<<<<<<<< @@ -7146,7 +7458,7 @@ (__pyx_v_alpha[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_colors.data + __pyx_t_14 * __pyx_v_colors.strides[0]) ) + __pyx_t_15 * __pyx_v_colors.strides[1]) ))); } - /* "yt/utilities/lib/misc_utilities.pyx":258 + /* "yt/utilities/lib/misc_utilities.pyx":263 * for i in range(4): * alpha[i] = colors[j, 0] * elif has_alpha: # <<<<<<<<<<<<<< @@ -7156,7 +7468,7 @@ goto __pyx_L9; } - /* "yt/utilities/lib/misc_utilities.pyx":262 + /* "yt/utilities/lib/misc_utilities.pyx":267 * alpha[i] = colors[j/points_per_color,i] * else: * for i in range(3): # <<<<<<<<<<<<<< @@ -7167,7 +7479,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < 3; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; - /* "yt/utilities/lib/misc_utilities.pyx":263 + /* "yt/utilities/lib/misc_utilities.pyx":268 * else: * for i in range(3): * alpha[i] = colors[j/points_per_color,3]*\ # <<<<<<<<<<<<<< @@ -7177,7 +7489,7 @@ __pyx_t_16 = (__pyx_v_j / __pyx_v_points_per_color); __pyx_t_17 = 3; - /* "yt/utilities/lib/misc_utilities.pyx":264 + /* "yt/utilities/lib/misc_utilities.pyx":269 * for i in range(3): * alpha[i] = colors[j/points_per_color,3]*\ * colors[j/points_per_color,i] # <<<<<<<<<<<<<< @@ -7187,7 +7499,7 @@ __pyx_t_18 = (__pyx_v_j / __pyx_v_points_per_color); __pyx_t_19 = __pyx_v_i; - /* "yt/utilities/lib/misc_utilities.pyx":263 + /* "yt/utilities/lib/misc_utilities.pyx":268 * else: * for i in range(3): * alpha[i] = colors[j/points_per_color,3]*\ # <<<<<<<<<<<<<< @@ -7199,7 +7511,7 @@ } __pyx_L9:; - /* "yt/utilities/lib/misc_utilities.pyx":266 + /* "yt/utilities/lib/misc_utilities.pyx":271 * colors[j/points_per_color,i] * * if x0 < x1: # <<<<<<<<<<<<<< @@ -7209,7 +7521,7 @@ __pyx_t_10 = ((__pyx_v_x0 < __pyx_v_x1) != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":267 + /* "yt/utilities/lib/misc_utilities.pyx":272 * * if x0 < x1: * sx = 1 # <<<<<<<<<<<<<< @@ -7218,7 +7530,7 @@ */ __pyx_v_sx = 1; - /* "yt/utilities/lib/misc_utilities.pyx":266 + /* "yt/utilities/lib/misc_utilities.pyx":271 * colors[j/points_per_color,i] * * if x0 < x1: # <<<<<<<<<<<<<< @@ -7228,7 +7540,7 @@ goto __pyx_L16; } - /* "yt/utilities/lib/misc_utilities.pyx":269 + /* "yt/utilities/lib/misc_utilities.pyx":274 * sx = 1 * else: * sx = -1 # <<<<<<<<<<<<<< @@ -7240,7 +7552,7 @@ } __pyx_L16:; - /* "yt/utilities/lib/misc_utilities.pyx":270 + /* "yt/utilities/lib/misc_utilities.pyx":275 * else: * sx = -1 * if y0 < y1: # <<<<<<<<<<<<<< @@ -7250,7 +7562,7 @@ __pyx_t_10 = ((__pyx_v_y0 < __pyx_v_y1) != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":271 + /* "yt/utilities/lib/misc_utilities.pyx":276 * sx = -1 * if y0 < y1: * sy = 1 # <<<<<<<<<<<<<< @@ -7259,7 +7571,7 @@ */ __pyx_v_sy = 1; - /* "yt/utilities/lib/misc_utilities.pyx":270 + /* "yt/utilities/lib/misc_utilities.pyx":275 * else: * sx = -1 * if y0 < y1: # <<<<<<<<<<<<<< @@ -7269,7 +7581,7 @@ goto __pyx_L17; } - /* "yt/utilities/lib/misc_utilities.pyx":273 + /* "yt/utilities/lib/misc_utilities.pyx":278 * sy = 1 * else: * sy = -1 # <<<<<<<<<<<<<< @@ -7281,7 +7593,7 @@ } __pyx_L17:; - /* "yt/utilities/lib/misc_utilities.pyx":274 + /* "yt/utilities/lib/misc_utilities.pyx":279 * else: * sy = -1 * while(1): # <<<<<<<<<<<<<< @@ -7290,7 +7602,7 @@ */ while (1) { - /* "yt/utilities/lib/misc_utilities.pyx":275 + /* "yt/utilities/lib/misc_utilities.pyx":280 * sy = -1 * while(1): * if (x0 < thick and sx == -1): break # <<<<<<<<<<<<<< @@ -7310,7 +7622,7 @@ goto __pyx_L19_break; } - /* "yt/utilities/lib/misc_utilities.pyx":276 + /* "yt/utilities/lib/misc_utilities.pyx":281 * while(1): * if (x0 < thick and sx == -1): break * elif (x0 >= nx-thick+1 and sx == 1): break # <<<<<<<<<<<<<< @@ -7330,7 +7642,7 @@ goto __pyx_L19_break; } - /* "yt/utilities/lib/misc_utilities.pyx":277 + /* "yt/utilities/lib/misc_utilities.pyx":282 * if (x0 < thick and sx == -1): break * elif (x0 >= nx-thick+1 and sx == 1): break * elif (y0 < thick and sy == -1): break # <<<<<<<<<<<<<< @@ -7350,7 +7662,7 @@ goto __pyx_L19_break; } - /* "yt/utilities/lib/misc_utilities.pyx":278 + /* "yt/utilities/lib/misc_utilities.pyx":283 * elif (x0 >= nx-thick+1 and sx == 1): break * elif (y0 < thick and sy == -1): break * elif (y0 >= ny-thick+1 and sy == 1): break # <<<<<<<<<<<<<< @@ -7370,7 +7682,7 @@ goto __pyx_L19_break; } - /* "yt/utilities/lib/misc_utilities.pyx":279 + /* "yt/utilities/lib/misc_utilities.pyx":284 * elif (y0 < thick and sy == -1): break * elif (y0 >= ny-thick+1 and sy == 1): break * if x0 >= thick and x0 < nx-thick and y0 >= thick and y0 < ny-thick: # <<<<<<<<<<<<<< @@ -7400,7 +7712,7 @@ __pyx_L30_bool_binop_done:; if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":280 + /* "yt/utilities/lib/misc_utilities.pyx":285 * elif (y0 >= ny-thick+1 and sy == 1): break * if x0 >= thick and x0 < nx-thick and y0 >= thick and y0 < ny-thick: * for xi in range(x0-thick/2, x0+(1+thick)/2): # <<<<<<<<<<<<<< @@ -7411,7 +7723,7 @@ for (__pyx_t_9 = (__pyx_v_x0 - (__pyx_v_thick / 2)); __pyx_t_9 < __pyx_t_20; __pyx_t_9+=1) { __pyx_v_xi = __pyx_t_9; - /* "yt/utilities/lib/misc_utilities.pyx":281 + /* "yt/utilities/lib/misc_utilities.pyx":286 * if x0 >= thick and x0 < nx-thick and y0 >= thick and y0 < ny-thick: * for xi in range(x0-thick/2, x0+(1+thick)/2): * for yi in range(y0-thick/2, y0+(1+thick)/2): # <<<<<<<<<<<<<< @@ -7422,7 +7734,7 @@ for (__pyx_t_22 = (__pyx_v_y0 - (__pyx_v_thick / 2)); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { __pyx_v_yi = __pyx_t_22; - /* "yt/utilities/lib/misc_utilities.pyx":282 + /* "yt/utilities/lib/misc_utilities.pyx":287 * for xi in range(x0-thick/2, x0+(1+thick)/2): * for yi in range(y0-thick/2, y0+(1+thick)/2): * if flip: # <<<<<<<<<<<<<< @@ -7432,7 +7744,7 @@ __pyx_t_10 = (__pyx_v_flip != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":283 + /* "yt/utilities/lib/misc_utilities.pyx":288 * for yi in range(y0-thick/2, y0+(1+thick)/2): * if flip: * yi0 = ny - yi # <<<<<<<<<<<<<< @@ -7441,7 +7753,7 @@ */ __pyx_v_yi0 = (__pyx_v_ny - __pyx_v_yi); - /* "yt/utilities/lib/misc_utilities.pyx":282 + /* "yt/utilities/lib/misc_utilities.pyx":287 * for xi in range(x0-thick/2, x0+(1+thick)/2): * for yi in range(y0-thick/2, y0+(1+thick)/2): * if flip: # <<<<<<<<<<<<<< @@ -7451,7 +7763,7 @@ goto __pyx_L38; } - /* "yt/utilities/lib/misc_utilities.pyx":285 + /* "yt/utilities/lib/misc_utilities.pyx":290 * yi0 = ny - yi * else: * yi0 = yi # <<<<<<<<<<<<<< @@ -7463,7 +7775,7 @@ } __pyx_L38:; - /* "yt/utilities/lib/misc_utilities.pyx":287 + /* "yt/utilities/lib/misc_utilities.pyx":292 * yi0 = yi * * if no_color: # <<<<<<<<<<<<<< @@ -7473,7 +7785,7 @@ __pyx_t_10 = (__pyx_v_no_color != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":288 + /* "yt/utilities/lib/misc_utilities.pyx":293 * * if no_color: * image[xi, yi0, 0] = fmin(alpha[0], image[xi, yi0, 0]) # <<<<<<<<<<<<<< @@ -7488,7 +7800,7 @@ __pyx_t_28 = 0; *((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_image.data + __pyx_t_26 * __pyx_v_image.strides[0]) ) + __pyx_t_27 * __pyx_v_image.strides[1]) ) + __pyx_t_28 * __pyx_v_image.strides[2]) )) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin((__pyx_v_alpha[0]), (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_image.data + __pyx_t_23 * __pyx_v_image.strides[0]) ) + __pyx_t_24 * __pyx_v_image.strides[1]) ) + __pyx_t_25 * __pyx_v_image.strides[2]) )))); - /* "yt/utilities/lib/misc_utilities.pyx":287 + /* "yt/utilities/lib/misc_utilities.pyx":292 * yi0 = yi * * if no_color: # <<<<<<<<<<<<<< @@ -7498,7 +7810,7 @@ goto __pyx_L39; } - /* "yt/utilities/lib/misc_utilities.pyx":289 + /* "yt/utilities/lib/misc_utilities.pyx":294 * if no_color: * image[xi, yi0, 0] = fmin(alpha[0], image[xi, yi0, 0]) * elif has_alpha: # <<<<<<<<<<<<<< @@ -7508,7 +7820,7 @@ __pyx_t_10 = (__pyx_v_has_alpha != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":290 + /* "yt/utilities/lib/misc_utilities.pyx":295 * image[xi, yi0, 0] = fmin(alpha[0], image[xi, yi0, 0]) * elif has_alpha: * image[xi, yi0, 3] = outa = alpha[3] + image[xi, yi0, 3]*(1-alpha[3]) # <<<<<<<<<<<<<< @@ -7525,7 +7837,7 @@ *((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_image.data + __pyx_t_33 * __pyx_v_image.strides[0]) ) + __pyx_t_34 * __pyx_v_image.strides[1]) ) + __pyx_t_35 * __pyx_v_image.strides[2]) )) = __pyx_t_32; __pyx_v_outa = __pyx_t_32; - /* "yt/utilities/lib/misc_utilities.pyx":291 + /* "yt/utilities/lib/misc_utilities.pyx":296 * elif has_alpha: * image[xi, yi0, 3] = outa = alpha[3] + image[xi, yi0, 3]*(1-alpha[3]) * if outa != 0.0: # <<<<<<<<<<<<<< @@ -7535,7 +7847,7 @@ __pyx_t_10 = ((__pyx_v_outa != 0.0) != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":292 + /* "yt/utilities/lib/misc_utilities.pyx":297 * image[xi, yi0, 3] = outa = alpha[3] + image[xi, yi0, 3]*(1-alpha[3]) * if outa != 0.0: * outa = 1.0/outa # <<<<<<<<<<<<<< @@ -7544,7 +7856,7 @@ */ __pyx_v_outa = (1.0 / __pyx_v_outa); - /* "yt/utilities/lib/misc_utilities.pyx":291 + /* "yt/utilities/lib/misc_utilities.pyx":296 * elif has_alpha: * image[xi, yi0, 3] = outa = alpha[3] + image[xi, yi0, 3]*(1-alpha[3]) * if outa != 0.0: # <<<<<<<<<<<<<< @@ -7553,7 +7865,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":293 + /* "yt/utilities/lib/misc_utilities.pyx":298 * if outa != 0.0: * outa = 1.0/outa * for i in range(3): # <<<<<<<<<<<<<< @@ -7563,7 +7875,7 @@ for (__pyx_t_36 = 0; __pyx_t_36 < 3; __pyx_t_36+=1) { __pyx_v_i = __pyx_t_36; - /* "yt/utilities/lib/misc_utilities.pyx":295 + /* "yt/utilities/lib/misc_utilities.pyx":300 * for i in range(3): * image[xi, yi0, i] = \ * ((1.-alpha[3])*image[xi, yi0, i]*image[xi, yi0, 3] # <<<<<<<<<<<<<< @@ -7577,7 +7889,7 @@ __pyx_t_41 = __pyx_v_yi0; __pyx_t_42 = 3; - /* "yt/utilities/lib/misc_utilities.pyx":294 + /* "yt/utilities/lib/misc_utilities.pyx":299 * outa = 1.0/outa * for i in range(3): * image[xi, yi0, i] = \ # <<<<<<<<<<<<<< @@ -7590,7 +7902,7 @@ *((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_image.data + __pyx_t_43 * __pyx_v_image.strides[0]) ) + __pyx_t_44 * __pyx_v_image.strides[1]) ) + __pyx_t_45 * __pyx_v_image.strides[2]) )) = (((((1. - (__pyx_v_alpha[3])) * (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_image.data + __pyx_t_37 * __pyx_v_image.strides[0]) ) + __pyx_t_38 * __pyx_v_image.strides[1]) ) + __pyx_t_39 * __pyx_v_image.strides[2]) )))) * (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_image.data + __pyx_t_40 * __pyx_v_image.strides[0]) ) + __pyx_t_41 * __pyx_v_image.strides[1]) ) + __pyx_t_42 * __pyx_v_image.strides[2]) )))) + ((__pyx_v_alpha[3]) * (__pyx_v_alpha[__pyx_v_i]))) * __pyx_v_outa); } - /* "yt/utilities/lib/misc_utilities.pyx":289 + /* "yt/utilities/lib/misc_utilities.pyx":294 * if no_color: * image[xi, yi0, 0] = fmin(alpha[0], image[xi, yi0, 0]) * elif has_alpha: # <<<<<<<<<<<<<< @@ -7600,7 +7912,7 @@ goto __pyx_L39; } - /* "yt/utilities/lib/misc_utilities.pyx":298 + /* "yt/utilities/lib/misc_utilities.pyx":303 * + alpha[3]*alpha[i])*outa * else: * for i in range(3): # <<<<<<<<<<<<<< @@ -7611,7 +7923,7 @@ for (__pyx_t_36 = 0; __pyx_t_36 < 3; __pyx_t_36+=1) { __pyx_v_i = __pyx_t_36; - /* "yt/utilities/lib/misc_utilities.pyx":300 + /* "yt/utilities/lib/misc_utilities.pyx":305 * for i in range(3): * image[xi, yi0, i] = \ * (1.-alpha[i])*image[xi,yi0,i] + alpha[i] # <<<<<<<<<<<<<< @@ -7622,7 +7934,7 @@ __pyx_t_47 = __pyx_v_yi0; __pyx_t_48 = __pyx_v_i; - /* "yt/utilities/lib/misc_utilities.pyx":299 + /* "yt/utilities/lib/misc_utilities.pyx":304 * else: * for i in range(3): * image[xi, yi0, i] = \ # <<<<<<<<<<<<<< @@ -7639,7 +7951,7 @@ } } - /* "yt/utilities/lib/misc_utilities.pyx":279 + /* "yt/utilities/lib/misc_utilities.pyx":284 * elif (y0 < thick and sy == -1): break * elif (y0 >= ny-thick+1 and sy == 1): break * if x0 >= thick and x0 < nx-thick and y0 >= thick and y0 < ny-thick: # <<<<<<<<<<<<<< @@ -7648,7 +7960,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":303 + /* "yt/utilities/lib/misc_utilities.pyx":308 * * * if (x0 == x1 and y0 == y1): # <<<<<<<<<<<<<< @@ -7666,7 +7978,7 @@ __pyx_L46_bool_binop_done:; if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":304 + /* "yt/utilities/lib/misc_utilities.pyx":309 * * if (x0 == x1 and y0 == y1): * break # <<<<<<<<<<<<<< @@ -7675,7 +7987,7 @@ */ goto __pyx_L19_break; - /* "yt/utilities/lib/misc_utilities.pyx":303 + /* "yt/utilities/lib/misc_utilities.pyx":308 * * * if (x0 == x1 and y0 == y1): # <<<<<<<<<<<<<< @@ -7684,7 +7996,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":305 + /* "yt/utilities/lib/misc_utilities.pyx":310 * if (x0 == x1 and y0 == y1): * break * e2 = 2*err # <<<<<<<<<<<<<< @@ -7693,7 +8005,7 @@ */ __pyx_v_e2 = (2 * __pyx_v_err); - /* "yt/utilities/lib/misc_utilities.pyx":306 + /* "yt/utilities/lib/misc_utilities.pyx":311 * break * e2 = 2*err * if e2 > -dy: # <<<<<<<<<<<<<< @@ -7703,7 +8015,7 @@ __pyx_t_10 = ((__pyx_v_e2 > (-__pyx_v_dy)) != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":307 + /* "yt/utilities/lib/misc_utilities.pyx":312 * e2 = 2*err * if e2 > -dy: * err = err - dy # <<<<<<<<<<<<<< @@ -7712,7 +8024,7 @@ */ __pyx_v_err = (__pyx_v_err - __pyx_v_dy); - /* "yt/utilities/lib/misc_utilities.pyx":308 + /* "yt/utilities/lib/misc_utilities.pyx":313 * if e2 > -dy: * err = err - dy * x0 += sx # <<<<<<<<<<<<<< @@ -7721,7 +8033,7 @@ */ __pyx_v_x0 = (__pyx_v_x0 + __pyx_v_sx); - /* "yt/utilities/lib/misc_utilities.pyx":306 + /* "yt/utilities/lib/misc_utilities.pyx":311 * break * e2 = 2*err * if e2 > -dy: # <<<<<<<<<<<<<< @@ -7730,7 +8042,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":309 + /* "yt/utilities/lib/misc_utilities.pyx":314 * err = err - dy * x0 += sx * if e2 < dx : # <<<<<<<<<<<<<< @@ -7740,7 +8052,7 @@ __pyx_t_10 = ((__pyx_v_e2 < __pyx_v_dx) != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":310 + /* "yt/utilities/lib/misc_utilities.pyx":315 * x0 += sx * if e2 < dx : * err = err + dx # <<<<<<<<<<<<<< @@ -7749,7 +8061,7 @@ */ __pyx_v_err = (__pyx_v_err + __pyx_v_dx); - /* "yt/utilities/lib/misc_utilities.pyx":311 + /* "yt/utilities/lib/misc_utilities.pyx":316 * if e2 < dx : * err = err + dx * y0 += sy # <<<<<<<<<<<<<< @@ -7758,7 +8070,7 @@ */ __pyx_v_y0 = (__pyx_v_y0 + __pyx_v_sy); - /* "yt/utilities/lib/misc_utilities.pyx":309 + /* "yt/utilities/lib/misc_utilities.pyx":314 * err = err - dy * x0 += sx * if e2 < dx : # <<<<<<<<<<<<<< @@ -7771,7 +8083,7 @@ __pyx_L3_continue:; } - /* "yt/utilities/lib/misc_utilities.pyx":312 + /* "yt/utilities/lib/misc_utilities.pyx":317 * err = err + dx * y0 += sy * return # <<<<<<<<<<<<<< @@ -7782,7 +8094,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":224 + /* "yt/utilities/lib/misc_utilities.pyx":229 * @cython.wraparound(False) * @cython.cdivision(True) * def lines(np.float64_t[:,:,:] image, # <<<<<<<<<<<<<< @@ -7806,7 +8118,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":317 +/* "yt/utilities/lib/misc_utilities.pyx":322 * @cython.wraparound(False) * @cython.cdivision(True) * def zlines(np.ndarray[np.float64_t, ndim=3] image, # <<<<<<<<<<<<<< @@ -7839,15 +8151,25 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -7856,46 +8178,55 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zbuffer)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("zlines", 0, 6, 10, 1); __PYX_ERR(0, 317, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("zlines", 0, 6, 10, 1); __PYX_ERR(0, 322, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("zlines", 0, 6, 10, 2); __PYX_ERR(0, 317, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("zlines", 0, 6, 10, 2); __PYX_ERR(0, 322, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("zlines", 0, 6, 10, 3); __PYX_ERR(0, 317, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("zlines", 0, 6, 10, 3); __PYX_ERR(0, 322, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("zlines", 0, 6, 10, 4); __PYX_ERR(0, 317, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("zlines", 0, 6, 10, 4); __PYX_ERR(0, 322, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_colors)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("zlines", 0, 6, 10, 5); __PYX_ERR(0, 317, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("zlines", 0, 6, 10, 5); __PYX_ERR(0, 322, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points_per_color); if (value) { values[6] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thick); if (value) { values[7] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flip); if (value) { values[8] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_crop); @@ -7903,14 +8234,18 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zlines") < 0)) __PYX_ERR(0, 317, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zlines") < 0)) __PYX_ERR(0, 322, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -7928,40 +8263,40 @@ __pyx_v_zs = ((PyArrayObject *)values[4]); __pyx_v_colors = ((PyArrayObject *)values[5]); if (values[6]) { - __pyx_v_points_per_color = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_points_per_color == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) + __pyx_v_points_per_color = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_points_per_color == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L3_error) } else { __pyx_v_points_per_color = ((int)1); } if (values[7]) { - __pyx_v_thick = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_thick == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + __pyx_v_thick = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_thick == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 329, __pyx_L3_error) } else { __pyx_v_thick = ((int)1); } if (values[8]) { - __pyx_v_flip = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_flip == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L3_error) + __pyx_v_flip = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_flip == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error) } else { __pyx_v_flip = ((int)0); } if (values[9]) { - __pyx_v_crop = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_crop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 326, __pyx_L3_error) + __pyx_v_crop = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_crop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L3_error) } else { __pyx_v_crop = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("zlines", 0, 6, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 317, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("zlines", 0, 6, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 322, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.zlines", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 317, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zbuffer), __pyx_ptype_5numpy_ndarray, 1, "zbuffer", 0))) __PYX_ERR(0, 318, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xs), __pyx_ptype_5numpy_ndarray, 1, "xs", 0))) __PYX_ERR(0, 319, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ys), __pyx_ptype_5numpy_ndarray, 1, "ys", 0))) __PYX_ERR(0, 320, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zs), __pyx_ptype_5numpy_ndarray, 1, "zs", 0))) __PYX_ERR(0, 321, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colors), __pyx_ptype_5numpy_ndarray, 1, "colors", 0))) __PYX_ERR(0, 322, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 322, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zbuffer), __pyx_ptype_5numpy_ndarray, 1, "zbuffer", 0))) __PYX_ERR(0, 323, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xs), __pyx_ptype_5numpy_ndarray, 1, "xs", 0))) __PYX_ERR(0, 324, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ys), __pyx_ptype_5numpy_ndarray, 1, "ys", 0))) __PYX_ERR(0, 325, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zs), __pyx_ptype_5numpy_ndarray, 1, "zs", 0))) __PYX_ERR(0, 326, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colors), __pyx_ptype_5numpy_ndarray, 1, "colors", 0))) __PYX_ERR(0, 327, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_14zlines(__pyx_self, __pyx_v_image, __pyx_v_zbuffer, __pyx_v_xs, __pyx_v_ys, __pyx_v_zs, __pyx_v_colors, __pyx_v_points_per_color, __pyx_v_thick, __pyx_v_flip, __pyx_v_crop); /* function exit code */ @@ -8111,36 +8446,36 @@ __pyx_pybuffernd_colors.rcbuffer = &__pyx_pybuffer_colors; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 322, __pyx_L1_error) } __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_image.diminfo[1].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_image.diminfo[1].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_image.diminfo[2].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_image.diminfo[2].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_zbuffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_zbuffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_zbuffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_zbuffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 322, __pyx_L1_error) } __pyx_pybuffernd_zbuffer.diminfo[0].strides = __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_zbuffer.diminfo[0].shape = __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_zbuffer.diminfo[1].strides = __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_zbuffer.diminfo[1].shape = __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_v_xs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_v_xs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 322, __pyx_L1_error) } __pyx_pybuffernd_xs.diminfo[0].strides = __pyx_pybuffernd_xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xs.diminfo[0].shape = __pyx_pybuffernd_xs.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ys.rcbuffer->pybuffer, (PyObject*)__pyx_v_ys, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ys.rcbuffer->pybuffer, (PyObject*)__pyx_v_ys, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 322, __pyx_L1_error) } __pyx_pybuffernd_ys.diminfo[0].strides = __pyx_pybuffernd_ys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ys.diminfo[0].shape = __pyx_pybuffernd_ys.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_zs.rcbuffer->pybuffer, (PyObject*)__pyx_v_zs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_zs.rcbuffer->pybuffer, (PyObject*)__pyx_v_zs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 322, __pyx_L1_error) } __pyx_pybuffernd_zs.diminfo[0].strides = __pyx_pybuffernd_zs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_zs.diminfo[0].shape = __pyx_pybuffernd_zs.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colors.rcbuffer->pybuffer, (PyObject*)__pyx_v_colors, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colors.rcbuffer->pybuffer, (PyObject*)__pyx_v_colors, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 322, __pyx_L1_error) } __pyx_pybuffernd_colors.diminfo[0].strides = __pyx_pybuffernd_colors.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colors.diminfo[0].shape = __pyx_pybuffernd_colors.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_colors.diminfo[1].strides = __pyx_pybuffernd_colors.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_colors.diminfo[1].shape = __pyx_pybuffernd_colors.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/misc_utilities.pyx":328 + /* "yt/utilities/lib/misc_utilities.pyx":333 * int crop = 0): * * cdef int nx = image.shape[0] # <<<<<<<<<<<<<< @@ -8149,7 +8484,7 @@ */ __pyx_v_nx = (__pyx_v_image->dimensions[0]); - /* "yt/utilities/lib/misc_utilities.pyx":329 + /* "yt/utilities/lib/misc_utilities.pyx":334 * * cdef int nx = image.shape[0] * cdef int ny = image.shape[1] # <<<<<<<<<<<<<< @@ -8158,7 +8493,7 @@ */ __pyx_v_ny = (__pyx_v_image->dimensions[1]); - /* "yt/utilities/lib/misc_utilities.pyx":330 + /* "yt/utilities/lib/misc_utilities.pyx":335 * cdef int nx = image.shape[0] * cdef int ny = image.shape[1] * cdef int nl = xs.shape[0] # <<<<<<<<<<<<<< @@ -8167,29 +8502,29 @@ */ __pyx_v_nl = (__pyx_v_xs->dimensions[0]); - /* "yt/utilities/lib/misc_utilities.pyx":336 + /* "yt/utilities/lib/misc_utilities.pyx":341 * cdef np.int64_t x0, x1, y0, y1, yi0 * cdef np.float64_t z0, z1, dzx, dzy * alpha = np.zeros(4) # <<<<<<<<<<<<<< * for j in range(0, nl, 2): * # From wikipedia http://en.wikipedia.org/wiki/Bresenham's_line_algorithm */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __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, 336, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 336, __pyx_L1_error) + if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_alpha = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "yt/utilities/lib/misc_utilities.pyx":337 + /* "yt/utilities/lib/misc_utilities.pyx":342 * cdef np.float64_t z0, z1, dzx, dzy * alpha = np.zeros(4) * for j in range(0, nl, 2): # <<<<<<<<<<<<<< @@ -8200,7 +8535,7 @@ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=2) { __pyx_v_j = __pyx_t_5; - /* "yt/utilities/lib/misc_utilities.pyx":339 + /* "yt/utilities/lib/misc_utilities.pyx":344 * for j in range(0, nl, 2): * # From wikipedia http://en.wikipedia.org/wiki/Bresenham's_line_algorithm * x0 = xs[j] # <<<<<<<<<<<<<< @@ -8210,7 +8545,7 @@ __pyx_t_6 = __pyx_v_j; __pyx_v_x0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_xs.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_xs.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":340 + /* "yt/utilities/lib/misc_utilities.pyx":345 * # From wikipedia http://en.wikipedia.org/wiki/Bresenham's_line_algorithm * x0 = xs[j] * y0 = ys[j] # <<<<<<<<<<<<<< @@ -8220,7 +8555,7 @@ __pyx_t_7 = __pyx_v_j; __pyx_v_y0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ys.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_ys.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":341 + /* "yt/utilities/lib/misc_utilities.pyx":346 * x0 = xs[j] * y0 = ys[j] * x1 = xs[j+1] # <<<<<<<<<<<<<< @@ -8230,7 +8565,7 @@ __pyx_t_8 = (__pyx_v_j + 1); __pyx_v_x1 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_xs.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_xs.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":342 + /* "yt/utilities/lib/misc_utilities.pyx":347 * y0 = ys[j] * x1 = xs[j+1] * y1 = ys[j+1] # <<<<<<<<<<<<<< @@ -8240,7 +8575,7 @@ __pyx_t_9 = (__pyx_v_j + 1); __pyx_v_y1 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ys.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_ys.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":343 + /* "yt/utilities/lib/misc_utilities.pyx":348 * x1 = xs[j+1] * y1 = ys[j+1] * z0 = zs[j] # <<<<<<<<<<<<<< @@ -8250,7 +8585,7 @@ __pyx_t_10 = __pyx_v_j; __pyx_v_z0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zs.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_zs.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":344 + /* "yt/utilities/lib/misc_utilities.pyx":349 * y1 = ys[j+1] * z0 = zs[j] * z1 = zs[j+1] # <<<<<<<<<<<<<< @@ -8260,67 +8595,67 @@ __pyx_t_11 = (__pyx_v_j + 1); __pyx_v_z1 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zs.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_zs.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":345 + /* "yt/utilities/lib/misc_utilities.pyx":350 * z0 = zs[j] * z1 = zs[j+1] * dx = abs(x1-x0) # <<<<<<<<<<<<<< * dy = abs(y1-y0) - * dzx = (z1-z0) / (dx**2 + dy**2) * dx + * dzx = (z1-z0) / (dx * dx + dy * dy) * dx */ - __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_x1 - __pyx_v_x0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_x1 - __pyx_v_x0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_2 = PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dx = __pyx_t_12; - /* "yt/utilities/lib/misc_utilities.pyx":346 + /* "yt/utilities/lib/misc_utilities.pyx":351 * z1 = zs[j+1] * dx = abs(x1-x0) * dy = abs(y1-y0) # <<<<<<<<<<<<<< - * dzx = (z1-z0) / (dx**2 + dy**2) * dx - * dzy = (z1-z0) / (dx**2 + dy**2) * dy + * dzx = (z1-z0) / (dx * dx + dy * dy) * dx + * dzy = (z1-z0) / (dx * dx + dy * dy) * dy */ - __pyx_t_2 = __Pyx_PyInt_From_npy_int64((__pyx_v_y1 - __pyx_v_y0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((__pyx_v_y1 - __pyx_v_y0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_1 = PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dy = __pyx_t_12; - /* "yt/utilities/lib/misc_utilities.pyx":347 + /* "yt/utilities/lib/misc_utilities.pyx":352 * dx = abs(x1-x0) * dy = abs(y1-y0) - * dzx = (z1-z0) / (dx**2 + dy**2) * dx # <<<<<<<<<<<<<< - * dzy = (z1-z0) / (dx**2 + dy**2) * dy + * dzx = (z1-z0) / (dx * dx + dy * dy) * dx # <<<<<<<<<<<<<< + * dzy = (z1-z0) / (dx * dx + dy * dy) * dy * err = dx - dy */ - __pyx_v_dzx = (((__pyx_v_z1 - __pyx_v_z0) / (__Pyx_pow_long(((long)__pyx_v_dx), 2) + __Pyx_pow_long(((long)__pyx_v_dy), 2))) * __pyx_v_dx); + __pyx_v_dzx = (((__pyx_v_z1 - __pyx_v_z0) / ((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy))) * __pyx_v_dx); - /* "yt/utilities/lib/misc_utilities.pyx":348 + /* "yt/utilities/lib/misc_utilities.pyx":353 * dy = abs(y1-y0) - * dzx = (z1-z0) / (dx**2 + dy**2) * dx - * dzy = (z1-z0) / (dx**2 + dy**2) * dy # <<<<<<<<<<<<<< + * dzx = (z1-z0) / (dx * dx + dy * dy) * dx + * dzy = (z1-z0) / (dx * dx + dy * dy) * dy # <<<<<<<<<<<<<< * err = dx - dy * if crop == 1 and (dx > nx/2.0 or dy > ny/2.0): */ - __pyx_v_dzy = (((__pyx_v_z1 - __pyx_v_z0) / (__Pyx_pow_long(((long)__pyx_v_dx), 2) + __Pyx_pow_long(((long)__pyx_v_dy), 2))) * __pyx_v_dy); + __pyx_v_dzy = (((__pyx_v_z1 - __pyx_v_z0) / ((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy))) * __pyx_v_dy); - /* "yt/utilities/lib/misc_utilities.pyx":349 - * dzx = (z1-z0) / (dx**2 + dy**2) * dx - * dzy = (z1-z0) / (dx**2 + dy**2) * dy + /* "yt/utilities/lib/misc_utilities.pyx":354 + * dzx = (z1-z0) / (dx * dx + dy * dy) * dx + * dzy = (z1-z0) / (dx * dx + dy * dy) * dy * err = dx - dy # <<<<<<<<<<<<<< * if crop == 1 and (dx > nx/2.0 or dy > ny/2.0): * continue */ __pyx_v_err = (__pyx_v_dx - __pyx_v_dy); - /* "yt/utilities/lib/misc_utilities.pyx":350 - * dzy = (z1-z0) / (dx**2 + dy**2) * dy + /* "yt/utilities/lib/misc_utilities.pyx":355 + * dzy = (z1-z0) / (dx * dx + dy * dy) * dy * err = dx - dy * if crop == 1 and (dx > nx/2.0 or dy > ny/2.0): # <<<<<<<<<<<<<< * continue @@ -8343,7 +8678,7 @@ __pyx_L6_bool_binop_done:; if (__pyx_t_13) { - /* "yt/utilities/lib/misc_utilities.pyx":351 + /* "yt/utilities/lib/misc_utilities.pyx":356 * err = dx - dy * if crop == 1 and (dx > nx/2.0 or dy > ny/2.0): * continue # <<<<<<<<<<<<<< @@ -8352,8 +8687,8 @@ */ goto __pyx_L3_continue; - /* "yt/utilities/lib/misc_utilities.pyx":350 - * dzy = (z1-z0) / (dx**2 + dy**2) * dy + /* "yt/utilities/lib/misc_utilities.pyx":355 + * dzy = (z1-z0) / (dx * dx + dy * dy) * dy * err = dx - dy * if crop == 1 and (dx > nx/2.0 or dy > ny/2.0): # <<<<<<<<<<<<<< * continue @@ -8361,7 +8696,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":353 + /* "yt/utilities/lib/misc_utilities.pyx":358 * continue * * c = j/points_per_color/2 # <<<<<<<<<<<<<< @@ -8370,7 +8705,7 @@ */ __pyx_v_c = ((__pyx_v_j / __pyx_v_points_per_color) / 2); - /* "yt/utilities/lib/misc_utilities.pyx":355 + /* "yt/utilities/lib/misc_utilities.pyx":360 * c = j/points_per_color/2 * * for i in range(3): # <<<<<<<<<<<<<< @@ -8380,7 +8715,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < 3; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "yt/utilities/lib/misc_utilities.pyx":356 + /* "yt/utilities/lib/misc_utilities.pyx":361 * * for i in range(3): * alpha[i] = colors[c, i] * colors[c, 3] # <<<<<<<<<<<<<< @@ -8395,7 +8730,7 @@ *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_19 * __pyx_v_alpha.strides[0]) )) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_colors.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_colors.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_colors.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_colors.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_colors.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_colors.diminfo[1].strides))); } - /* "yt/utilities/lib/misc_utilities.pyx":357 + /* "yt/utilities/lib/misc_utilities.pyx":362 * for i in range(3): * alpha[i] = colors[c, i] * colors[c, 3] * alpha[3] = colors[c, 3] # <<<<<<<<<<<<<< @@ -8407,7 +8742,7 @@ __pyx_t_22 = 3; *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_22 * __pyx_v_alpha.strides[0]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_colors.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_colors.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_colors.diminfo[1].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":359 + /* "yt/utilities/lib/misc_utilities.pyx":364 * alpha[3] = colors[c, 3] * * if x0 < x1: # <<<<<<<<<<<<<< @@ -8417,7 +8752,7 @@ __pyx_t_13 = ((__pyx_v_x0 < __pyx_v_x1) != 0); if (__pyx_t_13) { - /* "yt/utilities/lib/misc_utilities.pyx":360 + /* "yt/utilities/lib/misc_utilities.pyx":365 * * if x0 < x1: * sx = 1 # <<<<<<<<<<<<<< @@ -8426,7 +8761,7 @@ */ __pyx_v_sx = 1; - /* "yt/utilities/lib/misc_utilities.pyx":359 + /* "yt/utilities/lib/misc_utilities.pyx":364 * alpha[3] = colors[c, 3] * * if x0 < x1: # <<<<<<<<<<<<<< @@ -8436,7 +8771,7 @@ goto __pyx_L11; } - /* "yt/utilities/lib/misc_utilities.pyx":362 + /* "yt/utilities/lib/misc_utilities.pyx":367 * sx = 1 * else: * sx = -1 # <<<<<<<<<<<<<< @@ -8448,7 +8783,7 @@ } __pyx_L11:; - /* "yt/utilities/lib/misc_utilities.pyx":363 + /* "yt/utilities/lib/misc_utilities.pyx":368 * else: * sx = -1 * if y0 < y1: # <<<<<<<<<<<<<< @@ -8458,7 +8793,7 @@ __pyx_t_13 = ((__pyx_v_y0 < __pyx_v_y1) != 0); if (__pyx_t_13) { - /* "yt/utilities/lib/misc_utilities.pyx":364 + /* "yt/utilities/lib/misc_utilities.pyx":369 * sx = -1 * if y0 < y1: * sy = 1 # <<<<<<<<<<<<<< @@ -8467,7 +8802,7 @@ */ __pyx_v_sy = 1; - /* "yt/utilities/lib/misc_utilities.pyx":363 + /* "yt/utilities/lib/misc_utilities.pyx":368 * else: * sx = -1 * if y0 < y1: # <<<<<<<<<<<<<< @@ -8477,7 +8812,7 @@ goto __pyx_L12; } - /* "yt/utilities/lib/misc_utilities.pyx":366 + /* "yt/utilities/lib/misc_utilities.pyx":371 * sy = 1 * else: * sy = -1 # <<<<<<<<<<<<<< @@ -8489,7 +8824,7 @@ } __pyx_L12:; - /* "yt/utilities/lib/misc_utilities.pyx":367 + /* "yt/utilities/lib/misc_utilities.pyx":372 * else: * sy = -1 * while(1): # <<<<<<<<<<<<<< @@ -8498,7 +8833,7 @@ */ while (1) { - /* "yt/utilities/lib/misc_utilities.pyx":368 + /* "yt/utilities/lib/misc_utilities.pyx":373 * sy = -1 * while(1): * if (x0 < thick and sx == -1): break # <<<<<<<<<<<<<< @@ -8518,7 +8853,7 @@ goto __pyx_L14_break; } - /* "yt/utilities/lib/misc_utilities.pyx":369 + /* "yt/utilities/lib/misc_utilities.pyx":374 * while(1): * if (x0 < thick and sx == -1): break * elif (x0 >= nx-thick+1 and sx == 1): break # <<<<<<<<<<<<<< @@ -8538,7 +8873,7 @@ goto __pyx_L14_break; } - /* "yt/utilities/lib/misc_utilities.pyx":370 + /* "yt/utilities/lib/misc_utilities.pyx":375 * if (x0 < thick and sx == -1): break * elif (x0 >= nx-thick+1 and sx == 1): break * elif (y0 < thick and sy == -1): break # <<<<<<<<<<<<<< @@ -8558,7 +8893,7 @@ goto __pyx_L14_break; } - /* "yt/utilities/lib/misc_utilities.pyx":371 + /* "yt/utilities/lib/misc_utilities.pyx":376 * elif (x0 >= nx-thick+1 and sx == 1): break * elif (y0 < thick and sy == -1): break * elif (y0 >= ny-thick+1 and sy == 1): break # <<<<<<<<<<<<<< @@ -8578,7 +8913,7 @@ goto __pyx_L14_break; } - /* "yt/utilities/lib/misc_utilities.pyx":372 + /* "yt/utilities/lib/misc_utilities.pyx":377 * elif (y0 < thick and sy == -1): break * elif (y0 >= ny-thick+1 and sy == 1): break * if x0 >= thick and x0 < nx-thick and y0 >= thick and y0 < ny-thick: # <<<<<<<<<<<<<< @@ -8608,7 +8943,7 @@ __pyx_L25_bool_binop_done:; if (__pyx_t_13) { - /* "yt/utilities/lib/misc_utilities.pyx":373 + /* "yt/utilities/lib/misc_utilities.pyx":378 * elif (y0 >= ny-thick+1 and sy == 1): break * if x0 >= thick and x0 < nx-thick and y0 >= thick and y0 < ny-thick: * for _ in range(x0-thick/2, x0+(1+thick)/2): # <<<<<<<<<<<<<< @@ -8619,18 +8954,18 @@ for (__pyx_t_24 = (__pyx_v_x0 - (__pyx_v_thick / 2)); __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { __pyx_v__ = __pyx_t_24; - /* "yt/utilities/lib/misc_utilities.pyx":374 + /* "yt/utilities/lib/misc_utilities.pyx":379 * if x0 >= thick and x0 < nx-thick and y0 >= thick and y0 < ny-thick: * for _ in range(x0-thick/2, x0+(1+thick)/2): * for yi in range(y0-thick/2, y0+(1+thick)/2): # <<<<<<<<<<<<<< * if flip: * yi0 = ny - yi */ - __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_y0 - (__pyx_v_thick / 2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_y0 - (__pyx_v_thick / 2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_npy_int64((__pyx_v_y0 + ((1 + __pyx_v_thick) / 2))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((__pyx_v_y0 + ((1 + __pyx_v_thick) / 2))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_25 = PyTuple_New(2); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_25 = PyTuple_New(2); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_1); @@ -8638,16 +8973,16 @@ PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_25 = __pyx_t_2; __Pyx_INCREF(__pyx_t_25); __pyx_t_26 = 0; __pyx_t_27 = NULL; } else { - __pyx_t_26 = -1; __pyx_t_25 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_26 = -1; __pyx_t_25 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); - __pyx_t_27 = Py_TYPE(__pyx_t_25)->tp_iternext; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_27 = Py_TYPE(__pyx_t_25)->tp_iternext; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 379, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -8655,17 +8990,17 @@ if (likely(PyList_CheckExact(__pyx_t_25))) { if (__pyx_t_26 >= PyList_GET_SIZE(__pyx_t_25)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_25, __pyx_t_26); __Pyx_INCREF(__pyx_t_2); __pyx_t_26++; if (unlikely(0 < 0)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_25, __pyx_t_26); __Pyx_INCREF(__pyx_t_2); __pyx_t_26++; if (unlikely(0 < 0)) __PYX_ERR(0, 379, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_25, __pyx_t_26); __pyx_t_26++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_25, __pyx_t_26); __pyx_t_26++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_26 >= PyTuple_GET_SIZE(__pyx_t_25)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_25, __pyx_t_26); __Pyx_INCREF(__pyx_t_2); __pyx_t_26++; if (unlikely(0 < 0)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_25, __pyx_t_26); __Pyx_INCREF(__pyx_t_2); __pyx_t_26++; if (unlikely(0 < 0)) __PYX_ERR(0, 379, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_25, __pyx_t_26); __pyx_t_26++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_25, __pyx_t_26); __pyx_t_26++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -8675,7 +9010,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 374, __pyx_L1_error) + else __PYX_ERR(0, 379, __pyx_L1_error) } break; } @@ -8684,7 +9019,7 @@ __Pyx_XDECREF_SET(__pyx_v_yi, __pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":375 + /* "yt/utilities/lib/misc_utilities.pyx":380 * for _ in range(x0-thick/2, x0+(1+thick)/2): * for yi in range(y0-thick/2, y0+(1+thick)/2): * if flip: # <<<<<<<<<<<<<< @@ -8694,23 +9029,23 @@ __pyx_t_13 = (__pyx_v_flip != 0); if (__pyx_t_13) { - /* "yt/utilities/lib/misc_utilities.pyx":376 + /* "yt/utilities/lib/misc_utilities.pyx":381 * for yi in range(y0-thick/2, y0+(1+thick)/2): * if flip: * yi0 = ny - yi # <<<<<<<<<<<<<< * else: * yi0 = yi */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_yi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_yi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_28 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_28 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_yi0 = __pyx_t_28; - /* "yt/utilities/lib/misc_utilities.pyx":375 + /* "yt/utilities/lib/misc_utilities.pyx":380 * for _ in range(x0-thick/2, x0+(1+thick)/2): * for yi in range(y0-thick/2, y0+(1+thick)/2): * if flip: # <<<<<<<<<<<<<< @@ -8720,7 +9055,7 @@ goto __pyx_L33; } - /* "yt/utilities/lib/misc_utilities.pyx":378 + /* "yt/utilities/lib/misc_utilities.pyx":383 * yi0 = ny - yi * else: * yi0 = yi # <<<<<<<<<<<<<< @@ -8728,12 +9063,12 @@ * if alpha[3] != 1.0: */ /*else*/ { - __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_v_yi); if (unlikely((__pyx_t_28 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_v_yi); if (unlikely((__pyx_t_28 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __pyx_v_yi0 = __pyx_t_28; } __pyx_L33:; - /* "yt/utilities/lib/misc_utilities.pyx":379 + /* "yt/utilities/lib/misc_utilities.pyx":384 * else: * yi0 = yi * if z0 < zbuffer[x0, yi0]: # <<<<<<<<<<<<<< @@ -8745,7 +9080,7 @@ __pyx_t_13 = ((__pyx_v_z0 < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_zbuffer.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_zbuffer.diminfo[1].strides))) != 0); if (__pyx_t_13) { - /* "yt/utilities/lib/misc_utilities.pyx":380 + /* "yt/utilities/lib/misc_utilities.pyx":385 * yi0 = yi * if z0 < zbuffer[x0, yi0]: * if alpha[3] != 1.0: # <<<<<<<<<<<<<< @@ -8756,7 +9091,7 @@ __pyx_t_13 = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_30 * __pyx_v_alpha.strides[0]) ))) != 1.0) != 0); if (__pyx_t_13) { - /* "yt/utilities/lib/misc_utilities.pyx":381 + /* "yt/utilities/lib/misc_utilities.pyx":386 * if z0 < zbuffer[x0, yi0]: * if alpha[3] != 1.0: * talpha = image[x0, yi0, 3] # <<<<<<<<<<<<<< @@ -8766,12 +9101,12 @@ __pyx_t_31 = __pyx_v_x0; __pyx_t_32 = __pyx_v_yi0; __pyx_t_33 = 3; - __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_image.diminfo[2].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_image.diminfo[2].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_talpha, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":382 + /* "yt/utilities/lib/misc_utilities.pyx":387 * if alpha[3] != 1.0: * talpha = image[x0, yi0, 3] * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) # <<<<<<<<<<<<<< @@ -8779,26 +9114,26 @@ * if image[x0, yi0, 3] == 0.0: */ __pyx_t_34 = 3; - __pyx_t_1 = PyFloat_FromDouble((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_34 * __pyx_v_alpha.strides[0]) )))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_34 * __pyx_v_alpha.strides[0]) )))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_35 = 3; - __pyx_t_2 = PyFloat_FromDouble((1.0 - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_35 * __pyx_v_alpha.strides[0]) ))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((1.0 - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_35 * __pyx_v_alpha.strides[0]) ))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_36 = PyNumber_Multiply(__pyx_v_talpha, __pyx_t_2); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_36 = PyNumber_Multiply(__pyx_v_talpha, __pyx_t_2); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_36); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_36); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_36); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __pyx_t_37 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_37 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_37 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_37 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_38 = __pyx_v_x0; __pyx_t_39 = __pyx_v_yi0; __pyx_t_40 = 3; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_40, __pyx_pybuffernd_image.diminfo[2].strides) = __pyx_t_37; - /* "yt/utilities/lib/misc_utilities.pyx":383 + /* "yt/utilities/lib/misc_utilities.pyx":388 * talpha = image[x0, yi0, 3] * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) * for i in range(3): # <<<<<<<<<<<<<< @@ -8808,7 +9143,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < 3; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "yt/utilities/lib/misc_utilities.pyx":384 + /* "yt/utilities/lib/misc_utilities.pyx":389 * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) * for i in range(3): * if image[x0, yi0, 3] == 0.0: # <<<<<<<<<<<<<< @@ -8821,7 +9156,7 @@ __pyx_t_13 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_image.diminfo[2].strides)) == 0.0) != 0); if (__pyx_t_13) { - /* "yt/utilities/lib/misc_utilities.pyx":385 + /* "yt/utilities/lib/misc_utilities.pyx":390 * for i in range(3): * if image[x0, yi0, 3] == 0.0: * image[x0, yi0, i] = 0.0 # <<<<<<<<<<<<<< @@ -8833,7 +9168,7 @@ __pyx_t_46 = __pyx_v_i; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_46, __pyx_pybuffernd_image.diminfo[2].strides) = 0.0; - /* "yt/utilities/lib/misc_utilities.pyx":384 + /* "yt/utilities/lib/misc_utilities.pyx":389 * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) * for i in range(3): * if image[x0, yi0, 3] == 0.0: # <<<<<<<<<<<<<< @@ -8843,7 +9178,7 @@ goto __pyx_L38; } - /* "yt/utilities/lib/misc_utilities.pyx":387 + /* "yt/utilities/lib/misc_utilities.pyx":392 * image[x0, yi0, i] = 0.0 * else: * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] # <<<<<<<<<<<<<< @@ -8853,37 +9188,37 @@ /*else*/ { __pyx_t_47 = 3; __pyx_t_48 = __pyx_v_i; - __pyx_t_2 = PyFloat_FromDouble(((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_47 * __pyx_v_alpha.strides[0]) ))) * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_48 * __pyx_v_alpha.strides[0]) ))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_47 * __pyx_v_alpha.strides[0]) ))) * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_48 * __pyx_v_alpha.strides[0]) ))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_49 = __pyx_v_x0; __pyx_t_50 = __pyx_v_yi0; __pyx_t_51 = __pyx_v_i; - __pyx_t_36 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_51, __pyx_pybuffernd_image.diminfo[2].strides))); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_36 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_51, __pyx_pybuffernd_image.diminfo[2].strides))); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_36); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_36, __pyx_v_talpha); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_36, __pyx_v_talpha); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; __pyx_t_52 = 3; - __pyx_t_36 = PyFloat_FromDouble((1.0 - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_52 * __pyx_v_alpha.strides[0]) ))))); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_36 = PyFloat_FromDouble((1.0 - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_52 * __pyx_v_alpha.strides[0]) ))))); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_36); - __pyx_t_53 = PyNumber_Multiply(__pyx_t_1, __pyx_t_36); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_53 = PyNumber_Multiply(__pyx_t_1, __pyx_t_36); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_53); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __pyx_t_36 = PyNumber_Add(__pyx_t_2, __pyx_t_53); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_36 = PyNumber_Add(__pyx_t_2, __pyx_t_53); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_36); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0; __pyx_t_54 = __pyx_v_x0; __pyx_t_55 = __pyx_v_yi0; __pyx_t_56 = 3; - __pyx_t_53 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_image.diminfo[2].strides))); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_53 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_image.diminfo[2].strides))); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_53); - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_36, __pyx_t_53); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_36, __pyx_t_53); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0; - __pyx_t_37 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_37 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_37 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_37 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_57 = __pyx_v_x0; __pyx_t_58 = __pyx_v_yi0; @@ -8893,7 +9228,7 @@ __pyx_L38:; } - /* "yt/utilities/lib/misc_utilities.pyx":380 + /* "yt/utilities/lib/misc_utilities.pyx":385 * yi0 = yi * if z0 < zbuffer[x0, yi0]: * if alpha[3] != 1.0: # <<<<<<<<<<<<<< @@ -8903,7 +9238,7 @@ goto __pyx_L35; } - /* "yt/utilities/lib/misc_utilities.pyx":389 + /* "yt/utilities/lib/misc_utilities.pyx":394 * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] * else: * for i in range(4): # <<<<<<<<<<<<<< @@ -8914,7 +9249,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < 4; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "yt/utilities/lib/misc_utilities.pyx":390 + /* "yt/utilities/lib/misc_utilities.pyx":395 * else: * for i in range(4): * image[x0, yi0, i] = alpha[i] # <<<<<<<<<<<<<< @@ -8930,7 +9265,7 @@ } __pyx_L35:; - /* "yt/utilities/lib/misc_utilities.pyx":391 + /* "yt/utilities/lib/misc_utilities.pyx":396 * for i in range(4): * image[x0, yi0, i] = alpha[i] * if (1.0 - image[x0, yi0, 3] < 1.0e-4): # <<<<<<<<<<<<<< @@ -8943,7 +9278,7 @@ __pyx_t_13 = (((1.0 - (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_65, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_66, __pyx_pybuffernd_image.diminfo[2].strides))) < 1.0e-4) != 0); if (__pyx_t_13) { - /* "yt/utilities/lib/misc_utilities.pyx":392 + /* "yt/utilities/lib/misc_utilities.pyx":397 * image[x0, yi0, i] = alpha[i] * if (1.0 - image[x0, yi0, 3] < 1.0e-4): * image[x0, yi0, 3] = 1.0 # <<<<<<<<<<<<<< @@ -8955,7 +9290,7 @@ __pyx_t_69 = 3; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_68, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_69, __pyx_pybuffernd_image.diminfo[2].strides) = 1.0; - /* "yt/utilities/lib/misc_utilities.pyx":393 + /* "yt/utilities/lib/misc_utilities.pyx":398 * if (1.0 - image[x0, yi0, 3] < 1.0e-4): * image[x0, yi0, 3] = 1.0 * zbuffer[x0, yi0] = z0 # <<<<<<<<<<<<<< @@ -8966,7 +9301,7 @@ __pyx_t_71 = __pyx_v_yi0; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.buf, __pyx_t_70, __pyx_pybuffernd_zbuffer.diminfo[0].strides, __pyx_t_71, __pyx_pybuffernd_zbuffer.diminfo[1].strides) = __pyx_v_z0; - /* "yt/utilities/lib/misc_utilities.pyx":391 + /* "yt/utilities/lib/misc_utilities.pyx":396 * for i in range(4): * image[x0, yi0, i] = alpha[i] * if (1.0 - image[x0, yi0, 3] < 1.0e-4): # <<<<<<<<<<<<<< @@ -8975,7 +9310,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":379 + /* "yt/utilities/lib/misc_utilities.pyx":384 * else: * yi0 = yi * if z0 < zbuffer[x0, yi0]: # <<<<<<<<<<<<<< @@ -8984,7 +9319,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":374 + /* "yt/utilities/lib/misc_utilities.pyx":379 * if x0 >= thick and x0 < nx-thick and y0 >= thick and y0 < ny-thick: * for _ in range(x0-thick/2, x0+(1+thick)/2): * for yi in range(y0-thick/2, y0+(1+thick)/2): # <<<<<<<<<<<<<< @@ -8995,7 +9330,7 @@ __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; } - /* "yt/utilities/lib/misc_utilities.pyx":372 + /* "yt/utilities/lib/misc_utilities.pyx":377 * elif (y0 < thick and sy == -1): break * elif (y0 >= ny-thick+1 and sy == 1): break * if x0 >= thick and x0 < nx-thick and y0 >= thick and y0 < ny-thick: # <<<<<<<<<<<<<< @@ -9004,7 +9339,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":395 + /* "yt/utilities/lib/misc_utilities.pyx":400 * zbuffer[x0, yi0] = z0 * * if (x0 == x1 and y0 == y1): # <<<<<<<<<<<<<< @@ -9022,7 +9357,7 @@ __pyx_L43_bool_binop_done:; if (__pyx_t_13) { - /* "yt/utilities/lib/misc_utilities.pyx":396 + /* "yt/utilities/lib/misc_utilities.pyx":401 * * if (x0 == x1 and y0 == y1): * break # <<<<<<<<<<<<<< @@ -9031,7 +9366,7 @@ */ goto __pyx_L14_break; - /* "yt/utilities/lib/misc_utilities.pyx":395 + /* "yt/utilities/lib/misc_utilities.pyx":400 * zbuffer[x0, yi0] = z0 * * if (x0 == x1 and y0 == y1): # <<<<<<<<<<<<<< @@ -9040,7 +9375,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":397 + /* "yt/utilities/lib/misc_utilities.pyx":402 * if (x0 == x1 and y0 == y1): * break * e2 = 2*err # <<<<<<<<<<<<<< @@ -9049,7 +9384,7 @@ */ __pyx_v_e2 = (2 * __pyx_v_err); - /* "yt/utilities/lib/misc_utilities.pyx":398 + /* "yt/utilities/lib/misc_utilities.pyx":403 * break * e2 = 2*err * if e2 > -dy: # <<<<<<<<<<<<<< @@ -9059,7 +9394,7 @@ __pyx_t_13 = ((__pyx_v_e2 > (-__pyx_v_dy)) != 0); if (__pyx_t_13) { - /* "yt/utilities/lib/misc_utilities.pyx":399 + /* "yt/utilities/lib/misc_utilities.pyx":404 * e2 = 2*err * if e2 > -dy: * err = err - dy # <<<<<<<<<<<<<< @@ -9068,7 +9403,7 @@ */ __pyx_v_err = (__pyx_v_err - __pyx_v_dy); - /* "yt/utilities/lib/misc_utilities.pyx":400 + /* "yt/utilities/lib/misc_utilities.pyx":405 * if e2 > -dy: * err = err - dy * x0 += sx # <<<<<<<<<<<<<< @@ -9077,7 +9412,7 @@ */ __pyx_v_x0 = (__pyx_v_x0 + __pyx_v_sx); - /* "yt/utilities/lib/misc_utilities.pyx":401 + /* "yt/utilities/lib/misc_utilities.pyx":406 * err = err - dy * x0 += sx * z0 += dzx # <<<<<<<<<<<<<< @@ -9086,7 +9421,7 @@ */ __pyx_v_z0 = (__pyx_v_z0 + __pyx_v_dzx); - /* "yt/utilities/lib/misc_utilities.pyx":398 + /* "yt/utilities/lib/misc_utilities.pyx":403 * break * e2 = 2*err * if e2 > -dy: # <<<<<<<<<<<<<< @@ -9095,7 +9430,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":402 + /* "yt/utilities/lib/misc_utilities.pyx":407 * x0 += sx * z0 += dzx * if e2 < dx : # <<<<<<<<<<<<<< @@ -9105,7 +9440,7 @@ __pyx_t_13 = ((__pyx_v_e2 < __pyx_v_dx) != 0); if (__pyx_t_13) { - /* "yt/utilities/lib/misc_utilities.pyx":403 + /* "yt/utilities/lib/misc_utilities.pyx":408 * z0 += dzx * if e2 < dx : * err = err + dx # <<<<<<<<<<<<<< @@ -9114,7 +9449,7 @@ */ __pyx_v_err = (__pyx_v_err + __pyx_v_dx); - /* "yt/utilities/lib/misc_utilities.pyx":404 + /* "yt/utilities/lib/misc_utilities.pyx":409 * if e2 < dx : * err = err + dx * y0 += sy # <<<<<<<<<<<<<< @@ -9123,7 +9458,7 @@ */ __pyx_v_y0 = (__pyx_v_y0 + __pyx_v_sy); - /* "yt/utilities/lib/misc_utilities.pyx":405 + /* "yt/utilities/lib/misc_utilities.pyx":410 * err = err + dx * y0 += sy * z0 += dzy # <<<<<<<<<<<<<< @@ -9132,7 +9467,7 @@ */ __pyx_v_z0 = (__pyx_v_z0 + __pyx_v_dzy); - /* "yt/utilities/lib/misc_utilities.pyx":402 + /* "yt/utilities/lib/misc_utilities.pyx":407 * x0 += sx * z0 += dzx * if e2 < dx : # <<<<<<<<<<<<<< @@ -9145,7 +9480,7 @@ __pyx_L3_continue:; } - /* "yt/utilities/lib/misc_utilities.pyx":407 + /* "yt/utilities/lib/misc_utilities.pyx":412 * z0 += dzy * # assert(np.abs(z0 - z1) < 1.0e-3 * (np.abs(z0) + np.abs(z1))) * return # <<<<<<<<<<<<<< @@ -9156,7 +9491,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":317 + /* "yt/utilities/lib/misc_utilities.pyx":322 * @cython.wraparound(False) * @cython.cdivision(True) * def zlines(np.ndarray[np.float64_t, ndim=3] image, # <<<<<<<<<<<<<< @@ -9202,7 +9537,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":412 +/* "yt/utilities/lib/misc_utilities.pyx":417 * @cython.wraparound(False) * @cython.cdivision(True) * def zpoints(np.ndarray[np.float64_t, ndim=3] image, # <<<<<<<<<<<<<< @@ -9220,6 +9555,7 @@ PyArrayObject *__pyx_v_ys = 0; PyArrayObject *__pyx_v_zs = 0; PyArrayObject *__pyx_v_colors = 0; + PyArrayObject *__pyx_v_radii = 0; int __pyx_v_points_per_color; CYTHON_UNUSED int __pyx_v_thick; int __pyx_v_flip; @@ -9227,21 +9563,32 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zpoints (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_image,&__pyx_n_s_zbuffer,&__pyx_n_s_xs,&__pyx_n_s_ys,&__pyx_n_s_zs,&__pyx_n_s_colors,&__pyx_n_s_points_per_color,&__pyx_n_s_thick,&__pyx_n_s_flip,0}; - PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_image,&__pyx_n_s_zbuffer,&__pyx_n_s_xs,&__pyx_n_s_ys,&__pyx_n_s_zs,&__pyx_n_s_colors,&__pyx_n_s_radii,&__pyx_n_s_points_per_color,&__pyx_n_s_thick,&__pyx_n_s_flip,0}; + PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -9250,56 +9597,74 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zbuffer)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("zpoints", 0, 6, 9, 1); __PYX_ERR(0, 412, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("zpoints", 0, 7, 10, 1); __PYX_ERR(0, 417, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("zpoints", 0, 6, 9, 2); __PYX_ERR(0, 412, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("zpoints", 0, 7, 10, 2); __PYX_ERR(0, 417, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("zpoints", 0, 6, 9, 3); __PYX_ERR(0, 412, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("zpoints", 0, 7, 10, 3); __PYX_ERR(0, 417, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("zpoints", 0, 6, 9, 4); __PYX_ERR(0, 412, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("zpoints", 0, 7, 10, 4); __PYX_ERR(0, 417, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_colors)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("zpoints", 0, 6, 9, 5); __PYX_ERR(0, 412, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("zpoints", 0, 7, 10, 5); __PYX_ERR(0, 417, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points_per_color); - if (value) { values[6] = value; kw_args--; } + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_radii)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("zpoints", 0, 7, 10, 6); __PYX_ERR(0, 417, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thick); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points_per_color); if (value) { values[7] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flip); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thick); if (value) { values[8] = value; kw_args--; } } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flip); + if (value) { values[9] = value; kw_args--; } + } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zpoints") < 0)) __PYX_ERR(0, 412, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zpoints") < 0)) __PYX_ERR(0, 417, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -9315,37 +9680,39 @@ __pyx_v_ys = ((PyArrayObject *)values[3]); __pyx_v_zs = ((PyArrayObject *)values[4]); __pyx_v_colors = ((PyArrayObject *)values[5]); - if (values[6]) { - __pyx_v_points_per_color = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_points_per_color == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L3_error) + __pyx_v_radii = ((PyArrayObject *)values[6]); + if (values[7]) { + __pyx_v_points_per_color = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_points_per_color == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L3_error) } else { __pyx_v_points_per_color = ((int)1); } - if (values[7]) { - __pyx_v_thick = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_thick == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 419, __pyx_L3_error) + if (values[8]) { + __pyx_v_thick = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_thick == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) } else { __pyx_v_thick = ((int)1); } - if (values[8]) { - __pyx_v_flip = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_flip == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L3_error) + if (values[9]) { + __pyx_v_flip = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_flip == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L3_error) } else { __pyx_v_flip = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("zpoints", 0, 6, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 412, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("zpoints", 0, 7, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 417, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.zpoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 412, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zbuffer), __pyx_ptype_5numpy_ndarray, 1, "zbuffer", 0))) __PYX_ERR(0, 413, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xs), __pyx_ptype_5numpy_ndarray, 1, "xs", 0))) __PYX_ERR(0, 414, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ys), __pyx_ptype_5numpy_ndarray, 1, "ys", 0))) __PYX_ERR(0, 415, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zs), __pyx_ptype_5numpy_ndarray, 1, "zs", 0))) __PYX_ERR(0, 416, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colors), __pyx_ptype_5numpy_ndarray, 1, "colors", 0))) __PYX_ERR(0, 417, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_16zpoints(__pyx_self, __pyx_v_image, __pyx_v_zbuffer, __pyx_v_xs, __pyx_v_ys, __pyx_v_zs, __pyx_v_colors, __pyx_v_points_per_color, __pyx_v_thick, __pyx_v_flip); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 417, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zbuffer), __pyx_ptype_5numpy_ndarray, 1, "zbuffer", 0))) __PYX_ERR(0, 418, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xs), __pyx_ptype_5numpy_ndarray, 1, "xs", 0))) __PYX_ERR(0, 419, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ys), __pyx_ptype_5numpy_ndarray, 1, "ys", 0))) __PYX_ERR(0, 420, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zs), __pyx_ptype_5numpy_ndarray, 1, "zs", 0))) __PYX_ERR(0, 421, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colors), __pyx_ptype_5numpy_ndarray, 1, "colors", 0))) __PYX_ERR(0, 422, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_radii), __pyx_ptype_5numpy_ndarray, 1, "radii", 0))) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_16zpoints(__pyx_self, __pyx_v_image, __pyx_v_zbuffer, __pyx_v_xs, __pyx_v_ys, __pyx_v_zs, __pyx_v_colors, __pyx_v_radii, __pyx_v_points_per_color, __pyx_v_thick, __pyx_v_flip); /* function exit code */ goto __pyx_L0; @@ -9356,15 +9723,21 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_16zpoints(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_zbuffer, PyArrayObject *__pyx_v_xs, PyArrayObject *__pyx_v_ys, PyArrayObject *__pyx_v_zs, PyArrayObject *__pyx_v_colors, int __pyx_v_points_per_color, CYTHON_UNUSED int __pyx_v_thick, int __pyx_v_flip) { +static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_16zpoints(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_zbuffer, PyArrayObject *__pyx_v_xs, PyArrayObject *__pyx_v_ys, PyArrayObject *__pyx_v_zs, PyArrayObject *__pyx_v_colors, PyArrayObject *__pyx_v_radii, int __pyx_v_points_per_color, CYTHON_UNUSED int __pyx_v_thick, int __pyx_v_flip) { int __pyx_v_nx; int __pyx_v_ny; - int __pyx_v_nl; + CYTHON_UNUSED int __pyx_v_nl; __Pyx_memviewslice __pyx_v_alpha = { 0, 0, { 0 }, { 0 }, { 0 } }; __pyx_t_5numpy_float64_t __pyx_v_talpha; int __pyx_v_i; int __pyx_v_j; int __pyx_v_c; + __pyx_t_5numpy_int64_t __pyx_v_kx; + __pyx_t_5numpy_int64_t __pyx_v_ky; + __pyx_t_5numpy_int64_t __pyx_v_r; + __pyx_t_5numpy_int64_t __pyx_v_r2; + __Pyx_memviewslice __pyx_v_idx = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_ks = { 0, 0, { 0 }, { 0 }, { 0 } }; __pyx_t_5numpy_int64_t __pyx_v_x0; __pyx_t_5numpy_int64_t __pyx_v_y0; __pyx_t_5numpy_int64_t __pyx_v_yi0; @@ -9373,6 +9746,8 @@ __Pyx_Buffer __pyx_pybuffer_colors; __Pyx_LocalBuf_ND __pyx_pybuffernd_image; __Pyx_Buffer __pyx_pybuffer_image; + __Pyx_LocalBuf_ND __pyx_pybuffernd_radii; + __Pyx_Buffer __pyx_pybuffer_radii; __Pyx_LocalBuf_ND __pyx_pybuffernd_xs; __Pyx_Buffer __pyx_pybuffer_xs; __Pyx_LocalBuf_ND __pyx_pybuffernd_ys; @@ -9386,51 +9761,51 @@ 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; - Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; Py_ssize_t __pyx_t_7; - Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; - int __pyx_t_10; - int __pyx_t_11; - Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; Py_ssize_t __pyx_t_13; Py_ssize_t __pyx_t_14; - Py_ssize_t __pyx_t_15; - Py_ssize_t __pyx_t_16; + PyObject *(*__pyx_t_15)(PyObject *); + __pyx_t_5numpy_int64_t __pyx_t_16; Py_ssize_t __pyx_t_17; - Py_ssize_t __pyx_t_18; - Py_ssize_t __pyx_t_19; - __pyx_t_5numpy_int64_t __pyx_t_20; - __pyx_t_5numpy_int64_t __pyx_t_21; + int __pyx_t_18; + int __pyx_t_19; + Py_ssize_t __pyx_t_20; + PyObject *(*__pyx_t_21)(PyObject *); Py_ssize_t __pyx_t_22; - __pyx_t_5numpy_int64_t __pyx_t_23; - __pyx_t_5numpy_int64_t __pyx_t_24; + 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; - __pyx_t_5numpy_int64_t __pyx_t_28; - __pyx_t_5numpy_int64_t __pyx_t_29; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; Py_ssize_t __pyx_t_30; - Py_ssize_t __pyx_t_31; + __pyx_t_5numpy_int64_t __pyx_t_31; Py_ssize_t __pyx_t_32; __pyx_t_5numpy_int64_t __pyx_t_33; __pyx_t_5numpy_int64_t __pyx_t_34; Py_ssize_t __pyx_t_35; Py_ssize_t __pyx_t_36; - __pyx_t_5numpy_int64_t __pyx_t_37; + Py_ssize_t __pyx_t_37; __pyx_t_5numpy_int64_t __pyx_t_38; - Py_ssize_t __pyx_t_39; - __pyx_t_5numpy_int64_t __pyx_t_40; - __pyx_t_5numpy_int64_t __pyx_t_41; + __pyx_t_5numpy_int64_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; Py_ssize_t __pyx_t_42; __pyx_t_5numpy_int64_t __pyx_t_43; __pyx_t_5numpy_int64_t __pyx_t_44; Py_ssize_t __pyx_t_45; - __pyx_t_5numpy_int64_t __pyx_t_46; + Py_ssize_t __pyx_t_46; __pyx_t_5numpy_int64_t __pyx_t_47; - Py_ssize_t __pyx_t_48; + __pyx_t_5numpy_int64_t __pyx_t_48; Py_ssize_t __pyx_t_49; __pyx_t_5numpy_int64_t __pyx_t_50; __pyx_t_5numpy_int64_t __pyx_t_51; @@ -9440,6 +9815,16 @@ Py_ssize_t __pyx_t_55; __pyx_t_5numpy_int64_t __pyx_t_56; __pyx_t_5numpy_int64_t __pyx_t_57; + Py_ssize_t __pyx_t_58; + Py_ssize_t __pyx_t_59; + __pyx_t_5numpy_int64_t __pyx_t_60; + __pyx_t_5numpy_int64_t __pyx_t_61; + Py_ssize_t __pyx_t_62; + __pyx_t_5numpy_int64_t __pyx_t_63; + __pyx_t_5numpy_int64_t __pyx_t_64; + Py_ssize_t __pyx_t_65; + __pyx_t_5numpy_int64_t __pyx_t_66; + __pyx_t_5numpy_int64_t __pyx_t_67; __Pyx_RefNannySetupContext("zpoints", 0); __pyx_pybuffer_image.pybuffer.buf = NULL; __pyx_pybuffer_image.refcount = 0; @@ -9465,38 +9850,47 @@ __pyx_pybuffer_colors.refcount = 0; __pyx_pybuffernd_colors.data = NULL; __pyx_pybuffernd_colors.rcbuffer = &__pyx_pybuffer_colors; + __pyx_pybuffer_radii.pybuffer.buf = NULL; + __pyx_pybuffer_radii.refcount = 0; + __pyx_pybuffernd_radii.data = NULL; + __pyx_pybuffernd_radii.rcbuffer = &__pyx_pybuffer_radii; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 417, __pyx_L1_error) } __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_image.diminfo[1].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_image.diminfo[1].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_image.diminfo[2].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_image.diminfo[2].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_zbuffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_zbuffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_zbuffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_zbuffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 417, __pyx_L1_error) } __pyx_pybuffernd_zbuffer.diminfo[0].strides = __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_zbuffer.diminfo[0].shape = __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_zbuffer.diminfo[1].strides = __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_zbuffer.diminfo[1].shape = __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_v_xs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_v_xs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 417, __pyx_L1_error) } __pyx_pybuffernd_xs.diminfo[0].strides = __pyx_pybuffernd_xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xs.diminfo[0].shape = __pyx_pybuffernd_xs.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ys.rcbuffer->pybuffer, (PyObject*)__pyx_v_ys, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ys.rcbuffer->pybuffer, (PyObject*)__pyx_v_ys, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 417, __pyx_L1_error) } __pyx_pybuffernd_ys.diminfo[0].strides = __pyx_pybuffernd_ys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ys.diminfo[0].shape = __pyx_pybuffernd_ys.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_zs.rcbuffer->pybuffer, (PyObject*)__pyx_v_zs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_zs.rcbuffer->pybuffer, (PyObject*)__pyx_v_zs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 417, __pyx_L1_error) } __pyx_pybuffernd_zs.diminfo[0].strides = __pyx_pybuffernd_zs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_zs.diminfo[0].shape = __pyx_pybuffernd_zs.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colors.rcbuffer->pybuffer, (PyObject*)__pyx_v_colors, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colors.rcbuffer->pybuffer, (PyObject*)__pyx_v_colors, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 417, __pyx_L1_error) } __pyx_pybuffernd_colors.diminfo[0].strides = __pyx_pybuffernd_colors.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colors.diminfo[0].shape = __pyx_pybuffernd_colors.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_colors.diminfo[1].strides = __pyx_pybuffernd_colors.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_colors.diminfo[1].shape = __pyx_pybuffernd_colors.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_radii.rcbuffer->pybuffer, (PyObject*)__pyx_v_radii, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 417, __pyx_L1_error) + } + __pyx_pybuffernd_radii.diminfo[0].strides = __pyx_pybuffernd_radii.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_radii.diminfo[0].shape = __pyx_pybuffernd_radii.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/misc_utilities.pyx":422 + /* "yt/utilities/lib/misc_utilities.pyx":428 * int flip=0): * * cdef int nx = image.shape[0] # <<<<<<<<<<<<<< @@ -9505,7 +9899,7 @@ */ __pyx_v_nx = (__pyx_v_image->dimensions[0]); - /* "yt/utilities/lib/misc_utilities.pyx":423 + /* "yt/utilities/lib/misc_utilities.pyx":429 * * cdef int nx = image.shape[0] * cdef int ny = image.shape[1] # <<<<<<<<<<<<<< @@ -9514,7 +9908,7 @@ */ __pyx_v_ny = (__pyx_v_image->dimensions[1]); - /* "yt/utilities/lib/misc_utilities.pyx":424 + /* "yt/utilities/lib/misc_utilities.pyx":430 * cdef int nx = image.shape[0] * cdef int ny = image.shape[1] * cdef int nl = xs.shape[0] # <<<<<<<<<<<<<< @@ -9523,395 +9917,712 @@ */ __pyx_v_nl = (__pyx_v_xs->dimensions[0]); - /* "yt/utilities/lib/misc_utilities.pyx":430 + /* "yt/utilities/lib/misc_utilities.pyx":438 * cdef np.int64_t x0, y0, yi0 * cdef np.float64_t z0 * alpha = np.zeros(4) # <<<<<<<<<<<<<< - * for j in range(0, nl): - * x0 = xs[j] + * #the sources must be ordered along z to avoid edges when two overlap + * idx = np.argsort(zs) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __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, 430, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __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, 430, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1); - if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 430, __pyx_L1_error) + if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_alpha = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "yt/utilities/lib/misc_utilities.pyx":431 - * cdef np.float64_t z0 - * alpha = np.zeros(4) - * for j in range(0, nl): # <<<<<<<<<<<<<< - * x0 = xs[j] - * y0 = ys[j] - */ - __pyx_t_4 = __pyx_v_nl; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_j = __pyx_t_5; - - /* "yt/utilities/lib/misc_utilities.pyx":432 + /* "yt/utilities/lib/misc_utilities.pyx":440 * alpha = np.zeros(4) - * for j in range(0, nl): - * x0 = xs[j] # <<<<<<<<<<<<<< - * y0 = ys[j] - * z0 = zs[j] + * #the sources must be ordered along z to avoid edges when two overlap + * idx = np.argsort(zs) # <<<<<<<<<<<<<< + * for j in idx: + * r = radii[j] */ - __pyx_t_6 = __pyx_v_j; - __pyx_v_x0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_xs.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_xs.diminfo[0].strides)); - - /* "yt/utilities/lib/misc_utilities.pyx":433 - * for j in range(0, nl): - * x0 = xs[j] - * y0 = ys[j] # <<<<<<<<<<<<<< - * z0 = zs[j] - * if (x0 < 0 or x0 >= nx): continue + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_argsort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + if (!__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_zs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_zs)}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_zs)}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __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_INCREF(((PyObject *)__pyx_v_zs)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_zs)); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_zs)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_1); + if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_idx = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "yt/utilities/lib/misc_utilities.pyx":441 + * #the sources must be ordered along z to avoid edges when two overlap + * idx = np.argsort(zs) + * for j in idx: # <<<<<<<<<<<<<< + * r = radii[j] + * r2 = int((r+0.3)*(r+0.3)) #0.3 to get nicer shape */ - __pyx_t_7 = __pyx_v_j; - __pyx_v_y0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ys.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_ys.diminfo[0].strides)); + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_idx, 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, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 441, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 441, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 441, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 441, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_j = __pyx_t_9; - /* "yt/utilities/lib/misc_utilities.pyx":434 - * x0 = xs[j] - * y0 = ys[j] - * z0 = zs[j] # <<<<<<<<<<<<<< - * if (x0 < 0 or x0 >= nx): continue - * if (y0 < 0 or y0 >= ny): continue + /* "yt/utilities/lib/misc_utilities.pyx":442 + * idx = np.argsort(zs) + * for j in idx: + * r = radii[j] # <<<<<<<<<<<<<< + * r2 = int((r+0.3)*(r+0.3)) #0.3 to get nicer shape + * ks = np.arange(-r, r+1, dtype=np.int64) */ - __pyx_t_8 = __pyx_v_j; - __pyx_v_z0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zs.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_zs.diminfo[0].strides)); + __pyx_t_10 = __pyx_v_j; + __pyx_v_r = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_radii.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_radii.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":435 - * y0 = ys[j] + /* "yt/utilities/lib/misc_utilities.pyx":443 + * for j in idx: + * r = radii[j] + * r2 = int((r+0.3)*(r+0.3)) #0.3 to get nicer shape # <<<<<<<<<<<<<< + * ks = np.arange(-r, r+1, dtype=np.int64) * z0 = zs[j] - * if (x0 < 0 or x0 >= nx): continue # <<<<<<<<<<<<<< - * if (y0 < 0 or y0 >= ny): continue - * c = j/points_per_color */ - __pyx_t_10 = ((__pyx_v_x0 < 0) != 0); - if (!__pyx_t_10) { - } else { - __pyx_t_9 = __pyx_t_10; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_10 = ((__pyx_v_x0 >= __pyx_v_nx) != 0); - __pyx_t_9 = __pyx_t_10; - __pyx_L6_bool_binop_done:; - if (__pyx_t_9) { - goto __pyx_L3_continue; - } + __pyx_v_r2 = ((__pyx_t_5numpy_int64_t)((__pyx_v_r + 0.3) * (__pyx_v_r + 0.3))); - /* "yt/utilities/lib/misc_utilities.pyx":436 + /* "yt/utilities/lib/misc_utilities.pyx":444 + * r = radii[j] + * r2 = int((r+0.3)*(r+0.3)) #0.3 to get nicer shape + * ks = np.arange(-r, r+1, dtype=np.int64) # <<<<<<<<<<<<<< * z0 = zs[j] - * if (x0 < 0 or x0 >= nx): continue - * if (y0 < 0 or y0 >= ny): continue # <<<<<<<<<<<<<< - * c = j/points_per_color - * for i in range(3): + * for kx in ks: */ - __pyx_t_10 = ((__pyx_v_y0 < 0) != 0); - if (!__pyx_t_10) { - } else { - __pyx_t_9 = __pyx_t_10; - goto __pyx_L9_bool_binop_done; - } - __pyx_t_10 = ((__pyx_v_y0 >= __pyx_v_ny) != 0); - __pyx_t_9 = __pyx_t_10; - __pyx_L9_bool_binop_done:; - if (__pyx_t_9) { - goto __pyx_L3_continue; - } - - /* "yt/utilities/lib/misc_utilities.pyx":437 - * if (x0 < 0 or x0 >= nx): continue - * if (y0 < 0 or y0 >= ny): continue - * c = j/points_per_color # <<<<<<<<<<<<<< - * for i in range(3): - * alpha[i] = colors[c, i] * colors[c, 3] - */ - __pyx_v_c = (__pyx_v_j / __pyx_v_points_per_color); - - /* "yt/utilities/lib/misc_utilities.pyx":438 - * if (y0 < 0 or y0 >= ny): continue - * c = j/points_per_color - * for i in range(3): # <<<<<<<<<<<<<< - * alpha[i] = colors[c, i] * colors[c, 3] - * alpha[3] = colors[c, 3] + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((-__pyx_v_r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((__pyx_v_r + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_12); + if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_ks, 1); + __pyx_v_ks = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "yt/utilities/lib/misc_utilities.pyx":445 + * r2 = int((r+0.3)*(r+0.3)) #0.3 to get nicer shape + * ks = np.arange(-r, r+1, dtype=np.int64) + * z0 = zs[j] # <<<<<<<<<<<<<< + * for kx in ks: + * x0 = xs[j]+kx */ - for (__pyx_t_11 = 0; __pyx_t_11 < 3; __pyx_t_11+=1) { - __pyx_v_i = __pyx_t_11; + __pyx_t_13 = __pyx_v_j; + __pyx_v_z0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_zs.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":439 - * c = j/points_per_color - * for i in range(3): - * alpha[i] = colors[c, i] * colors[c, 3] # <<<<<<<<<<<<<< - * alpha[3] = colors[c, 3] - * if flip: - */ - __pyx_t_12 = __pyx_v_c; - __pyx_t_13 = __pyx_v_i; - __pyx_t_14 = __pyx_v_c; - __pyx_t_15 = 3; - __pyx_t_16 = __pyx_v_i; - *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_16 * __pyx_v_alpha.strides[0]) )) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_colors.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_colors.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_colors.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_colors.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_colors.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_colors.diminfo[1].strides))); + /* "yt/utilities/lib/misc_utilities.pyx":446 + * ks = np.arange(-r, r+1, dtype=np.int64) + * z0 = zs[j] + * for kx in ks: # <<<<<<<<<<<<<< + * x0 = xs[j]+kx + * if (x0 < 0 or x0 >= nx): continue + */ + __pyx_t_12 = __pyx_memoryview_fromslice(__pyx_v_ks, 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_12)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) { + __pyx_t_2 = __pyx_t_12; __Pyx_INCREF(__pyx_t_2); __pyx_t_14 = 0; + __pyx_t_15 = NULL; + } else { + __pyx_t_14 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 446, __pyx_L1_error) } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + for (;;) { + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_14); __Pyx_INCREF(__pyx_t_12); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 446, __pyx_L1_error) + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_2, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + #endif + } else { + if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_14); __Pyx_INCREF(__pyx_t_12); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 446, __pyx_L1_error) + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_2, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + #endif + } + } else { + __pyx_t_12 = __pyx_t_15(__pyx_t_2); + if (unlikely(!__pyx_t_12)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 446, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_12); + } + __pyx_t_16 = __Pyx_PyInt_As_npy_int64(__pyx_t_12); if (unlikely((__pyx_t_16 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_kx = __pyx_t_16; - /* "yt/utilities/lib/misc_utilities.pyx":440 - * for i in range(3): - * alpha[i] = colors[c, i] * colors[c, 3] - * alpha[3] = colors[c, 3] # <<<<<<<<<<<<<< - * if flip: - * yi0 = ny - y0 - */ - __pyx_t_17 = __pyx_v_c; - __pyx_t_18 = 3; - __pyx_t_19 = 3; - *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_19 * __pyx_v_alpha.strides[0]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_colors.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_colors.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_colors.diminfo[1].strides)); - - /* "yt/utilities/lib/misc_utilities.pyx":441 - * alpha[i] = colors[c, i] * colors[c, 3] - * alpha[3] = colors[c, 3] - * if flip: # <<<<<<<<<<<<<< - * yi0 = ny - y0 - * else: - */ - __pyx_t_9 = (__pyx_v_flip != 0); - if (__pyx_t_9) { - - /* "yt/utilities/lib/misc_utilities.pyx":442 - * alpha[3] = colors[c, 3] - * if flip: - * yi0 = ny - y0 # <<<<<<<<<<<<<< - * else: - * yi0 = y0 + /* "yt/utilities/lib/misc_utilities.pyx":447 + * z0 = zs[j] + * for kx in ks: + * x0 = xs[j]+kx # <<<<<<<<<<<<<< + * if (x0 < 0 or x0 >= nx): continue + * for ky in ks: + */ + __pyx_t_17 = __pyx_v_j; + __pyx_v_x0 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_xs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_xs.diminfo[0].strides)) + __pyx_v_kx); + + /* "yt/utilities/lib/misc_utilities.pyx":448 + * for kx in ks: + * x0 = xs[j]+kx + * if (x0 < 0 or x0 >= nx): continue # <<<<<<<<<<<<<< + * for ky in ks: + * y0 = ys[j]+ky */ - __pyx_v_yi0 = (__pyx_v_ny - __pyx_v_y0); + __pyx_t_19 = ((__pyx_v_x0 < 0) != 0); + if (!__pyx_t_19) { + } else { + __pyx_t_18 = __pyx_t_19; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_19 = ((__pyx_v_x0 >= __pyx_v_nx) != 0); + __pyx_t_18 = __pyx_t_19; + __pyx_L8_bool_binop_done:; + if (__pyx_t_18) { + goto __pyx_L5_continue; + } + + /* "yt/utilities/lib/misc_utilities.pyx":449 + * x0 = xs[j]+kx + * if (x0 < 0 or x0 >= nx): continue + * for ky in ks: # <<<<<<<<<<<<<< + * y0 = ys[j]+ky + * if (y0 < 0 or y0 >= ny): continue + */ + __pyx_t_12 = __pyx_memoryview_fromslice(__pyx_v_ks, 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_12)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) { + __pyx_t_11 = __pyx_t_12; __Pyx_INCREF(__pyx_t_11); __pyx_t_20 = 0; + __pyx_t_21 = NULL; + } else { + __pyx_t_20 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_21 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 449, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + for (;;) { + if (likely(!__pyx_t_21)) { + if (likely(PyList_CheckExact(__pyx_t_11))) { + if (__pyx_t_20 >= PyList_GET_SIZE(__pyx_t_11)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_20); __Pyx_INCREF(__pyx_t_12); __pyx_t_20++; if (unlikely(0 < 0)) __PYX_ERR(0, 449, __pyx_L1_error) + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_11, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + #endif + } else { + if (__pyx_t_20 >= PyTuple_GET_SIZE(__pyx_t_11)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_20); __Pyx_INCREF(__pyx_t_12); __pyx_t_20++; if (unlikely(0 < 0)) __PYX_ERR(0, 449, __pyx_L1_error) + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_11, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + #endif + } + } else { + __pyx_t_12 = __pyx_t_21(__pyx_t_11); + if (unlikely(!__pyx_t_12)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 449, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_12); + } + __pyx_t_16 = __Pyx_PyInt_As_npy_int64(__pyx_t_12); if (unlikely((__pyx_t_16 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_ky = __pyx_t_16; - /* "yt/utilities/lib/misc_utilities.pyx":441 - * alpha[i] = colors[c, i] * colors[c, 3] - * alpha[3] = colors[c, 3] - * if flip: # <<<<<<<<<<<<<< - * yi0 = ny - y0 - * else: + /* "yt/utilities/lib/misc_utilities.pyx":450 + * if (x0 < 0 or x0 >= nx): continue + * for ky in ks: + * y0 = ys[j]+ky # <<<<<<<<<<<<<< + * if (y0 < 0 or y0 >= ny): continue + * if (kx*kx + ky*ky > r2): continue + */ + __pyx_t_22 = __pyx_v_j; + __pyx_v_y0 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ys.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ys.diminfo[0].strides)) + __pyx_v_ky); + + /* "yt/utilities/lib/misc_utilities.pyx":451 + * for ky in ks: + * y0 = ys[j]+ky + * if (y0 < 0 or y0 >= ny): continue # <<<<<<<<<<<<<< + * if (kx*kx + ky*ky > r2): continue + * */ - goto __pyx_L13; - } + __pyx_t_19 = ((__pyx_v_y0 < 0) != 0); + if (!__pyx_t_19) { + } else { + __pyx_t_18 = __pyx_t_19; + goto __pyx_L13_bool_binop_done; + } + __pyx_t_19 = ((__pyx_v_y0 >= __pyx_v_ny) != 0); + __pyx_t_18 = __pyx_t_19; + __pyx_L13_bool_binop_done:; + if (__pyx_t_18) { + goto __pyx_L10_continue; + } - /* "yt/utilities/lib/misc_utilities.pyx":444 - * yi0 = ny - y0 - * else: - * yi0 = y0 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/misc_utilities.pyx":452 + * y0 = ys[j]+ky + * if (y0 < 0 or y0 >= ny): continue + * if (kx*kx + ky*ky > r2): continue # <<<<<<<<<<<<<< * - * if z0 < zbuffer[x0, yi0]: + * c = j/points_per_color */ - /*else*/ { - __pyx_v_yi0 = __pyx_v_y0; - } - __pyx_L13:; + __pyx_t_18 = ((((__pyx_v_kx * __pyx_v_kx) + (__pyx_v_ky * __pyx_v_ky)) > __pyx_v_r2) != 0); + if (__pyx_t_18) { + goto __pyx_L10_continue; + } - /* "yt/utilities/lib/misc_utilities.pyx":446 - * yi0 = y0 + /* "yt/utilities/lib/misc_utilities.pyx":454 + * if (kx*kx + ky*ky > r2): continue * - * if z0 < zbuffer[x0, yi0]: # <<<<<<<<<<<<<< - * if alpha[3] != 1.0: - * talpha = image[x0, yi0, 3] - */ - __pyx_t_20 = __pyx_v_x0; - __pyx_t_21 = __pyx_v_yi0; - __pyx_t_9 = ((__pyx_v_z0 < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_zbuffer.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_zbuffer.diminfo[1].strides))) != 0); - if (__pyx_t_9) { + * c = j/points_per_color # <<<<<<<<<<<<<< + * for i in range(3): + * alpha[i] = colors[c, i] * colors[c, 3] + */ + __pyx_v_c = (__pyx_v_j / __pyx_v_points_per_color); - /* "yt/utilities/lib/misc_utilities.pyx":447 + /* "yt/utilities/lib/misc_utilities.pyx":455 * - * if z0 < zbuffer[x0, yi0]: - * if alpha[3] != 1.0: # <<<<<<<<<<<<<< - * talpha = image[x0, yi0, 3] - * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) + * c = j/points_per_color + * for i in range(3): # <<<<<<<<<<<<<< + * alpha[i] = colors[c, i] * colors[c, 3] + * alpha[3] = colors[c, 3] */ - __pyx_t_22 = 3; - __pyx_t_9 = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_22 * __pyx_v_alpha.strides[0]) ))) != 1.0) != 0); - if (__pyx_t_9) { + for (__pyx_t_9 = 0; __pyx_t_9 < 3; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; - /* "yt/utilities/lib/misc_utilities.pyx":448 - * if z0 < zbuffer[x0, yi0]: - * if alpha[3] != 1.0: - * talpha = image[x0, yi0, 3] # <<<<<<<<<<<<<< - * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) + /* "yt/utilities/lib/misc_utilities.pyx":456 + * c = j/points_per_color * for i in range(3): - */ - __pyx_t_23 = __pyx_v_x0; - __pyx_t_24 = __pyx_v_yi0; - __pyx_t_25 = 3; - __pyx_v_talpha = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_image.diminfo[2].strides)); + * alpha[i] = colors[c, i] * colors[c, 3] # <<<<<<<<<<<<<< + * alpha[3] = colors[c, 3] + * if flip: + */ + __pyx_t_23 = __pyx_v_c; + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = __pyx_v_c; + __pyx_t_26 = 3; + __pyx_t_27 = __pyx_v_i; + *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_27 * __pyx_v_alpha.strides[0]) )) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_colors.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_colors.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_colors.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_colors.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_colors.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_colors.diminfo[1].strides))); + } - /* "yt/utilities/lib/misc_utilities.pyx":449 - * if alpha[3] != 1.0: - * talpha = image[x0, yi0, 3] - * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/misc_utilities.pyx":457 * for i in range(3): - * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] + * alpha[i] = colors[c, i] * colors[c, 3] + * alpha[3] = colors[c, 3] # <<<<<<<<<<<<<< + * if flip: + * yi0 = ny - y0 */ - __pyx_t_26 = 3; - __pyx_t_27 = 3; - __pyx_t_28 = __pyx_v_x0; - __pyx_t_29 = __pyx_v_yi0; + __pyx_t_28 = __pyx_v_c; + __pyx_t_29 = 3; __pyx_t_30 = 3; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_image.diminfo[2].strides) = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_26 * __pyx_v_alpha.strides[0]) ))) + (__pyx_v_talpha * (1.0 - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_27 * __pyx_v_alpha.strides[0]) )))))); + *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_30 * __pyx_v_alpha.strides[0]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_colors.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_colors.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_colors.diminfo[1].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":450 - * talpha = image[x0, yi0, 3] - * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) - * for i in range(3): # <<<<<<<<<<<<<< - * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] - * if image[x0, yi0, 3] == 0.0: + /* "yt/utilities/lib/misc_utilities.pyx":458 + * alpha[i] = colors[c, i] * colors[c, 3] + * alpha[3] = colors[c, 3] + * if flip: # <<<<<<<<<<<<<< + * yi0 = ny - y0 + * else: */ - for (__pyx_t_11 = 0; __pyx_t_11 < 3; __pyx_t_11+=1) { - __pyx_v_i = __pyx_t_11; - - /* "yt/utilities/lib/misc_utilities.pyx":451 - * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) - * for i in range(3): - * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] # <<<<<<<<<<<<<< - * if image[x0, yi0, 3] == 0.0: - * image[x0, yi0, i] = 0.0 - */ - __pyx_t_31 = 3; - __pyx_t_32 = __pyx_v_i; - __pyx_t_33 = __pyx_v_x0; - __pyx_t_34 = __pyx_v_yi0; - __pyx_t_35 = __pyx_v_i; - __pyx_t_36 = 3; - __pyx_t_37 = __pyx_v_x0; - __pyx_t_38 = __pyx_v_yi0; - __pyx_t_39 = 3; - __pyx_t_40 = __pyx_v_x0; - __pyx_t_41 = __pyx_v_yi0; - __pyx_t_42 = __pyx_v_i; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_42, __pyx_pybuffernd_image.diminfo[2].strides) = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_31 * __pyx_v_alpha.strides[0]) ))) * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_32 * __pyx_v_alpha.strides[0]) )))) + (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_image.diminfo[2].strides)) * __pyx_v_talpha) * (1.0 - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_36 * __pyx_v_alpha.strides[0]) )))))) / (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_image.diminfo[2].strides))); + __pyx_t_18 = (__pyx_v_flip != 0); + if (__pyx_t_18) { - /* "yt/utilities/lib/misc_utilities.pyx":452 - * for i in range(3): - * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] - * if image[x0, yi0, 3] == 0.0: # <<<<<<<<<<<<<< - * image[x0, yi0, i] = 0.0 - * else: + /* "yt/utilities/lib/misc_utilities.pyx":459 + * alpha[3] = colors[c, 3] + * if flip: + * yi0 = ny - y0 # <<<<<<<<<<<<<< + * else: + * yi0 = y0 */ - __pyx_t_43 = __pyx_v_x0; - __pyx_t_44 = __pyx_v_yi0; - __pyx_t_45 = 3; - __pyx_t_9 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_image.diminfo[2].strides)) == 0.0) != 0); - if (__pyx_t_9) { - - /* "yt/utilities/lib/misc_utilities.pyx":453 - * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] - * if image[x0, yi0, 3] == 0.0: - * image[x0, yi0, i] = 0.0 # <<<<<<<<<<<<<< - * else: - * for i in range(4): + __pyx_v_yi0 = (__pyx_v_ny - __pyx_v_y0); + + /* "yt/utilities/lib/misc_utilities.pyx":458 + * alpha[i] = colors[c, i] * colors[c, 3] + * alpha[3] = colors[c, 3] + * if flip: # <<<<<<<<<<<<<< + * yi0 = ny - y0 + * else: */ - __pyx_t_46 = __pyx_v_x0; - __pyx_t_47 = __pyx_v_yi0; - __pyx_t_48 = __pyx_v_i; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_image.diminfo[2].strides) = 0.0; + goto __pyx_L18; + } - /* "yt/utilities/lib/misc_utilities.pyx":452 - * for i in range(3): - * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] - * if image[x0, yi0, 3] == 0.0: # <<<<<<<<<<<<<< - * image[x0, yi0, i] = 0.0 - * else: + /* "yt/utilities/lib/misc_utilities.pyx":461 + * yi0 = ny - y0 + * else: + * yi0 = y0 # <<<<<<<<<<<<<< + * + * if z0 < zbuffer[x0, yi0]: */ - } + /*else*/ { + __pyx_v_yi0 = __pyx_v_y0; } + __pyx_L18:; - /* "yt/utilities/lib/misc_utilities.pyx":447 + /* "yt/utilities/lib/misc_utilities.pyx":463 + * yi0 = y0 * - * if z0 < zbuffer[x0, yi0]: - * if alpha[3] != 1.0: # <<<<<<<<<<<<<< - * talpha = image[x0, yi0, 3] - * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) + * if z0 < zbuffer[x0, yi0]: # <<<<<<<<<<<<<< + * if alpha[3] != 1.0: + * talpha = image[x0, yi0, 3] + */ + __pyx_t_16 = __pyx_v_x0; + __pyx_t_31 = __pyx_v_yi0; + __pyx_t_18 = ((__pyx_v_z0 < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_zbuffer.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_zbuffer.diminfo[1].strides))) != 0); + if (__pyx_t_18) { + + /* "yt/utilities/lib/misc_utilities.pyx":464 + * + * if z0 < zbuffer[x0, yi0]: + * if alpha[3] != 1.0: # <<<<<<<<<<<<<< + * talpha = image[x0, yi0, 3] + * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) + */ + __pyx_t_32 = 3; + __pyx_t_18 = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_32 * __pyx_v_alpha.strides[0]) ))) != 1.0) != 0); + if (__pyx_t_18) { + + /* "yt/utilities/lib/misc_utilities.pyx":465 + * if z0 < zbuffer[x0, yi0]: + * if alpha[3] != 1.0: + * talpha = image[x0, yi0, 3] # <<<<<<<<<<<<<< + * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) + * for i in range(3): */ - goto __pyx_L15; - } + __pyx_t_33 = __pyx_v_x0; + __pyx_t_34 = __pyx_v_yi0; + __pyx_t_35 = 3; + __pyx_v_talpha = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_image.diminfo[2].strides)); + + /* "yt/utilities/lib/misc_utilities.pyx":466 + * if alpha[3] != 1.0: + * talpha = image[x0, yi0, 3] + * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) # <<<<<<<<<<<<<< + * for i in range(3): + * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] + */ + __pyx_t_36 = 3; + __pyx_t_37 = 3; + __pyx_t_38 = __pyx_v_x0; + __pyx_t_39 = __pyx_v_yi0; + __pyx_t_40 = 3; + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_40, __pyx_pybuffernd_image.diminfo[2].strides) = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_36 * __pyx_v_alpha.strides[0]) ))) + (__pyx_v_talpha * (1.0 - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_37 * __pyx_v_alpha.strides[0]) )))))); + + /* "yt/utilities/lib/misc_utilities.pyx":467 + * talpha = image[x0, yi0, 3] + * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) + * for i in range(3): # <<<<<<<<<<<<<< + * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] + * if image[x0, yi0, 3] == 0.0: + */ + for (__pyx_t_9 = 0; __pyx_t_9 < 3; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; - /* "yt/utilities/lib/misc_utilities.pyx":455 - * image[x0, yi0, i] = 0.0 - * else: - * for i in range(4): # <<<<<<<<<<<<<< - * image[x0, yi0, i] = alpha[i] - * if (1.0 - image[x0, yi0, 3] < 1.0e-4): + /* "yt/utilities/lib/misc_utilities.pyx":468 + * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) + * for i in range(3): + * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] # <<<<<<<<<<<<<< + * if image[x0, yi0, 3] == 0.0: + * image[x0, yi0, i] = 0.0 + */ + __pyx_t_41 = 3; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_x0; + __pyx_t_44 = __pyx_v_yi0; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = 3; + __pyx_t_47 = __pyx_v_x0; + __pyx_t_48 = __pyx_v_yi0; + __pyx_t_49 = 3; + __pyx_t_50 = __pyx_v_x0; + __pyx_t_51 = __pyx_v_yi0; + __pyx_t_52 = __pyx_v_i; + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_52, __pyx_pybuffernd_image.diminfo[2].strides) = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_41 * __pyx_v_alpha.strides[0]) ))) * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_42 * __pyx_v_alpha.strides[0]) )))) + (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_image.diminfo[2].strides)) * __pyx_v_talpha) * (1.0 - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_46 * __pyx_v_alpha.strides[0]) )))))) / (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_49, __pyx_pybuffernd_image.diminfo[2].strides))); + + /* "yt/utilities/lib/misc_utilities.pyx":469 + * for i in range(3): + * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] + * if image[x0, yi0, 3] == 0.0: # <<<<<<<<<<<<<< + * image[x0, yi0, i] = 0.0 + * else: + */ + __pyx_t_53 = __pyx_v_x0; + __pyx_t_54 = __pyx_v_yi0; + __pyx_t_55 = 3; + __pyx_t_18 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_54, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_55, __pyx_pybuffernd_image.diminfo[2].strides)) == 0.0) != 0); + if (__pyx_t_18) { + + /* "yt/utilities/lib/misc_utilities.pyx":470 + * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] + * if image[x0, yi0, 3] == 0.0: + * image[x0, yi0, i] = 0.0 # <<<<<<<<<<<<<< + * else: + * for i in range(4): + */ + __pyx_t_56 = __pyx_v_x0; + __pyx_t_57 = __pyx_v_yi0; + __pyx_t_58 = __pyx_v_i; + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_57, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_58, __pyx_pybuffernd_image.diminfo[2].strides) = 0.0; + + /* "yt/utilities/lib/misc_utilities.pyx":469 + * for i in range(3): + * image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] + * if image[x0, yi0, 3] == 0.0: # <<<<<<<<<<<<<< + * image[x0, yi0, i] = 0.0 + * else: */ - /*else*/ { - for (__pyx_t_11 = 0; __pyx_t_11 < 4; __pyx_t_11+=1) { - __pyx_v_i = __pyx_t_11; + } + } - /* "yt/utilities/lib/misc_utilities.pyx":456 - * else: - * for i in range(4): - * image[x0, yi0, i] = alpha[i] # <<<<<<<<<<<<<< - * if (1.0 - image[x0, yi0, 3] < 1.0e-4): - * zbuffer[x0, yi0] = z0 + /* "yt/utilities/lib/misc_utilities.pyx":464 + * + * if z0 < zbuffer[x0, yi0]: + * if alpha[3] != 1.0: # <<<<<<<<<<<<<< + * talpha = image[x0, yi0, 3] + * image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) */ - __pyx_t_49 = __pyx_v_i; - __pyx_t_50 = __pyx_v_x0; - __pyx_t_51 = __pyx_v_yi0; - __pyx_t_52 = __pyx_v_i; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_52, __pyx_pybuffernd_image.diminfo[2].strides) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_49 * __pyx_v_alpha.strides[0]) ))); - } - } - __pyx_L15:; + goto __pyx_L20; + } + + /* "yt/utilities/lib/misc_utilities.pyx":472 + * image[x0, yi0, i] = 0.0 + * else: + * for i in range(4): # <<<<<<<<<<<<<< + * image[x0, yi0, i] = alpha[i] + * if (1.0 - image[x0, yi0, 3] < 1.0e-4): + */ + /*else*/ { + for (__pyx_t_9 = 0; __pyx_t_9 < 4; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "yt/utilities/lib/misc_utilities.pyx":473 + * else: + * for i in range(4): + * image[x0, yi0, i] = alpha[i] # <<<<<<<<<<<<<< + * if (1.0 - image[x0, yi0, 3] < 1.0e-4): + * zbuffer[x0, yi0] = z0 + */ + __pyx_t_59 = __pyx_v_i; + __pyx_t_60 = __pyx_v_x0; + __pyx_t_61 = __pyx_v_yi0; + __pyx_t_62 = __pyx_v_i; + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_61, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_62, __pyx_pybuffernd_image.diminfo[2].strides) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_alpha.data + __pyx_t_59 * __pyx_v_alpha.strides[0]) ))); + } + } + __pyx_L20:; - /* "yt/utilities/lib/misc_utilities.pyx":457 - * for i in range(4): - * image[x0, yi0, i] = alpha[i] - * if (1.0 - image[x0, yi0, 3] < 1.0e-4): # <<<<<<<<<<<<<< - * zbuffer[x0, yi0] = z0 + /* "yt/utilities/lib/misc_utilities.pyx":474 + * for i in range(4): + * image[x0, yi0, i] = alpha[i] + * if (1.0 - image[x0, yi0, 3] < 1.0e-4): # <<<<<<<<<<<<<< + * zbuffer[x0, yi0] = z0 * return */ - __pyx_t_53 = __pyx_v_x0; - __pyx_t_54 = __pyx_v_yi0; - __pyx_t_55 = 3; - __pyx_t_9 = (((1.0 - (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_54, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_55, __pyx_pybuffernd_image.diminfo[2].strides))) < 1.0e-4) != 0); - if (__pyx_t_9) { - - /* "yt/utilities/lib/misc_utilities.pyx":458 - * image[x0, yi0, i] = alpha[i] - * if (1.0 - image[x0, yi0, 3] < 1.0e-4): - * zbuffer[x0, yi0] = z0 # <<<<<<<<<<<<<< + __pyx_t_63 = __pyx_v_x0; + __pyx_t_64 = __pyx_v_yi0; + __pyx_t_65 = 3; + __pyx_t_18 = (((1.0 - (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_image.diminfo[1].strides, __pyx_t_65, __pyx_pybuffernd_image.diminfo[2].strides))) < 1.0e-4) != 0); + if (__pyx_t_18) { + + /* "yt/utilities/lib/misc_utilities.pyx":475 + * image[x0, yi0, i] = alpha[i] + * if (1.0 - image[x0, yi0, 3] < 1.0e-4): + * zbuffer[x0, yi0] = z0 # <<<<<<<<<<<<<< * return * */ - __pyx_t_56 = __pyx_v_x0; - __pyx_t_57 = __pyx_v_yi0; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_zbuffer.diminfo[0].strides, __pyx_t_57, __pyx_pybuffernd_zbuffer.diminfo[1].strides) = __pyx_v_z0; - - /* "yt/utilities/lib/misc_utilities.pyx":457 - * for i in range(4): - * image[x0, yi0, i] = alpha[i] - * if (1.0 - image[x0, yi0, 3] < 1.0e-4): # <<<<<<<<<<<<<< - * zbuffer[x0, yi0] = z0 + __pyx_t_66 = __pyx_v_x0; + __pyx_t_67 = __pyx_v_yi0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zbuffer.rcbuffer->pybuffer.buf, __pyx_t_66, __pyx_pybuffernd_zbuffer.diminfo[0].strides, __pyx_t_67, __pyx_pybuffernd_zbuffer.diminfo[1].strides) = __pyx_v_z0; + + /* "yt/utilities/lib/misc_utilities.pyx":474 + * for i in range(4): + * image[x0, yi0, i] = alpha[i] + * if (1.0 - image[x0, yi0, 3] < 1.0e-4): # <<<<<<<<<<<<<< + * zbuffer[x0, yi0] = z0 * return */ + } + + /* "yt/utilities/lib/misc_utilities.pyx":463 + * yi0 = y0 + * + * if z0 < zbuffer[x0, yi0]: # <<<<<<<<<<<<<< + * if alpha[3] != 1.0: + * talpha = image[x0, yi0, 3] + */ + } + + /* "yt/utilities/lib/misc_utilities.pyx":449 + * x0 = xs[j]+kx + * if (x0 < 0 or x0 >= nx): continue + * for ky in ks: # <<<<<<<<<<<<<< + * y0 = ys[j]+ky + * if (y0 < 0 or y0 >= ny): continue + */ + __pyx_L10_continue:; } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "yt/utilities/lib/misc_utilities.pyx":446 - * yi0 = y0 - * - * if z0 < zbuffer[x0, yi0]: # <<<<<<<<<<<<<< - * if alpha[3] != 1.0: - * talpha = image[x0, yi0, 3] + * ks = np.arange(-r, r+1, dtype=np.int64) + * z0 = zs[j] + * for kx in ks: # <<<<<<<<<<<<<< + * x0 = xs[j]+kx + * if (x0 < 0 or x0 >= nx): continue */ + __pyx_L5_continue:; } - __pyx_L3_continue:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/misc_utilities.pyx":441 + * #the sources must be ordered along z to avoid edges when two overlap + * idx = np.argsort(zs) + * for j in idx: # <<<<<<<<<<<<<< + * r = radii[j] + * r2 = int((r+0.3)*(r+0.3)) #0.3 to get nicer shape + */ } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":459 - * if (1.0 - image[x0, yi0, 3] < 1.0e-4): - * zbuffer[x0, yi0] = z0 + /* "yt/utilities/lib/misc_utilities.pyx":476 + * if (1.0 - image[x0, yi0, 3] < 1.0e-4): + * zbuffer[x0, yi0] = z0 * return # <<<<<<<<<<<<<< * * @@ -9920,7 +10631,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":412 + /* "yt/utilities/lib/misc_utilities.pyx":417 * @cython.wraparound(False) * @cython.cdivision(True) * def zpoints(np.ndarray[np.float64_t, ndim=3] image, # <<<<<<<<<<<<<< @@ -9933,12 +10644,18 @@ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colors.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_image.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_radii.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ys.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_zbuffer.rcbuffer->pybuffer); @@ -9950,18 +10667,21 @@ __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colors.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_image.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_radii.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ys.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_zbuffer.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_zs.rcbuffer->pybuffer); __pyx_L2:; __PYX_XDEC_MEMVIEW(&__pyx_v_alpha, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_idx, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_ks, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":462 +/* "yt/utilities/lib/misc_utilities.pyx":479 * * * def rotate_vectors(np.ndarray[np.float64_t, ndim=3] vecs, # <<<<<<<<<<<<<< @@ -9986,7 +10706,9 @@ 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; } @@ -9995,14 +10717,15 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rotate_vectors", 1, 2, 2, 1); __PYX_ERR(0, 462, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rotate_vectors", 1, 2, 2, 1); __PYX_ERR(0, 479, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rotate_vectors") < 0)) __PYX_ERR(0, 462, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rotate_vectors") < 0)) __PYX_ERR(0, 479, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -10015,14 +10738,14 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rotate_vectors", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 462, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rotate_vectors", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 479, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.rotate_vectors", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vecs), __pyx_ptype_5numpy_ndarray, 1, "vecs", 0))) __PYX_ERR(0, 462, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_R), __pyx_ptype_5numpy_ndarray, 1, "R", 0))) __PYX_ERR(0, 463, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vecs), __pyx_ptype_5numpy_ndarray, 1, "vecs", 0))) __PYX_ERR(0, 479, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_R), __pyx_ptype_5numpy_ndarray, 1, "R", 0))) __PYX_ERR(0, 480, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_18rotate_vectors(__pyx_self, __pyx_v_vecs, __pyx_v_R); /* function exit code */ @@ -10084,16 +10807,16 @@ __pyx_pybuffernd_R.rcbuffer = &__pyx_pybuffer_R; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vecs.rcbuffer->pybuffer, (PyObject*)__pyx_v_vecs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 462, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vecs.rcbuffer->pybuffer, (PyObject*)__pyx_v_vecs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 479, __pyx_L1_error) } __pyx_pybuffernd_vecs.diminfo[0].strides = __pyx_pybuffernd_vecs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vecs.diminfo[0].shape = __pyx_pybuffernd_vecs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vecs.diminfo[1].strides = __pyx_pybuffernd_vecs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vecs.diminfo[1].shape = __pyx_pybuffernd_vecs.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_vecs.diminfo[2].strides = __pyx_pybuffernd_vecs.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_vecs.diminfo[2].shape = __pyx_pybuffernd_vecs.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_R.rcbuffer->pybuffer, (PyObject*)__pyx_v_R, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 462, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_R.rcbuffer->pybuffer, (PyObject*)__pyx_v_R, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 479, __pyx_L1_error) } __pyx_pybuffernd_R.diminfo[0].strides = __pyx_pybuffernd_R.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_R.diminfo[0].shape = __pyx_pybuffernd_R.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_R.diminfo[1].strides = __pyx_pybuffernd_R.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_R.diminfo[1].shape = __pyx_pybuffernd_R.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/misc_utilities.pyx":464 + /* "yt/utilities/lib/misc_utilities.pyx":481 * def rotate_vectors(np.ndarray[np.float64_t, ndim=3] vecs, * np.ndarray[np.float64_t, ndim=2] R): * cdef int nx = vecs.shape[0] # <<<<<<<<<<<<<< @@ -10102,7 +10825,7 @@ */ __pyx_v_nx = (__pyx_v_vecs->dimensions[0]); - /* "yt/utilities/lib/misc_utilities.pyx":465 + /* "yt/utilities/lib/misc_utilities.pyx":482 * np.ndarray[np.float64_t, ndim=2] R): * cdef int nx = vecs.shape[0] * cdef int ny = vecs.shape[1] # <<<<<<<<<<<<<< @@ -10111,23 +10834,23 @@ */ __pyx_v_ny = (__pyx_v_vecs->dimensions[1]); - /* "yt/utilities/lib/misc_utilities.pyx":466 + /* "yt/utilities/lib/misc_utilities.pyx":483 * cdef int nx = vecs.shape[0] * cdef int ny = vecs.shape[1] * rotated = np.empty((nx,ny,3),dtype='float64') # <<<<<<<<<<<<<< * for i in range(nx): * for j in range(ny): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __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, 466, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __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_nx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -10138,15 +10861,15 @@ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 466, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -10154,7 +10877,7 @@ __pyx_v_rotated = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":467 + /* "yt/utilities/lib/misc_utilities.pyx":484 * cdef int ny = vecs.shape[1] * rotated = np.empty((nx,ny,3),dtype='float64') * for i in range(nx): # <<<<<<<<<<<<<< @@ -10165,7 +10888,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/utilities/lib/misc_utilities.pyx":468 + /* "yt/utilities/lib/misc_utilities.pyx":485 * rotated = np.empty((nx,ny,3),dtype='float64') * for i in range(nx): * for j in range(ny): # <<<<<<<<<<<<<< @@ -10176,7 +10899,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_j = __pyx_t_8; - /* "yt/utilities/lib/misc_utilities.pyx":469 + /* "yt/utilities/lib/misc_utilities.pyx":486 * for i in range(nx): * for j in range(ny): * for k in range(3): # <<<<<<<<<<<<<< @@ -10186,7 +10909,7 @@ for (__pyx_t_9 = 0; __pyx_t_9 < 3; __pyx_t_9+=1) { __pyx_v_k = __pyx_t_9; - /* "yt/utilities/lib/misc_utilities.pyx":471 + /* "yt/utilities/lib/misc_utilities.pyx":488 * for k in range(3): * rotated[i,j,k] =\ * R[k,0]*vecs[i,j,0]+R[k,1]*vecs[i,j,1]+R[k,2]*vecs[i,j,2] # <<<<<<<<<<<<<< @@ -10206,7 +10929,7 @@ } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_R.diminfo[1].shape)) __pyx_t_12 = 1; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 471, __pyx_L1_error) + __PYX_ERR(0, 488, __pyx_L1_error) } __pyx_t_13 = __pyx_v_i; __pyx_t_14 = __pyx_v_j; @@ -10226,7 +10949,7 @@ } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_vecs.diminfo[2].shape)) __pyx_t_12 = 2; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 471, __pyx_L1_error) + __PYX_ERR(0, 488, __pyx_L1_error) } __pyx_t_16 = __pyx_v_k; __pyx_t_17 = 1; @@ -10241,7 +10964,7 @@ } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_R.diminfo[1].shape)) __pyx_t_12 = 1; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 471, __pyx_L1_error) + __PYX_ERR(0, 488, __pyx_L1_error) } __pyx_t_18 = __pyx_v_i; __pyx_t_19 = __pyx_v_j; @@ -10261,7 +10984,7 @@ } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_vecs.diminfo[2].shape)) __pyx_t_12 = 2; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 471, __pyx_L1_error) + __PYX_ERR(0, 488, __pyx_L1_error) } __pyx_t_21 = __pyx_v_k; __pyx_t_22 = 2; @@ -10276,7 +10999,7 @@ } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_R.diminfo[1].shape)) __pyx_t_12 = 1; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 471, __pyx_L1_error) + __PYX_ERR(0, 488, __pyx_L1_error) } __pyx_t_23 = __pyx_v_i; __pyx_t_24 = __pyx_v_j; @@ -10296,25 +11019,25 @@ } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_vecs.diminfo[2].shape)) __pyx_t_12 = 2; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 471, __pyx_L1_error) + __PYX_ERR(0, 488, __pyx_L1_error) } - __pyx_t_1 = PyFloat_FromDouble(((((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_R.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_R.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_R.diminfo[1].strides)) * (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vecs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_vecs.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_vecs.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_vecs.diminfo[2].strides))) + ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_R.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_R.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_R.diminfo[1].strides)) * (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vecs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_vecs.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_vecs.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_vecs.diminfo[2].strides)))) + ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_R.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_R.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_R.diminfo[1].strides)) * (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vecs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_vecs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_vecs.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_vecs.diminfo[2].strides))))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(((((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_R.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_R.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_R.diminfo[1].strides)) * (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vecs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_vecs.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_vecs.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_vecs.diminfo[2].strides))) + ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_R.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_R.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_R.diminfo[1].strides)) * (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vecs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_vecs.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_vecs.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_vecs.diminfo[2].strides)))) + ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_R.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_R.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_R.diminfo[1].strides)) * (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vecs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_vecs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_vecs.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_vecs.diminfo[2].strides))))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "yt/utilities/lib/misc_utilities.pyx":470 + /* "yt/utilities/lib/misc_utilities.pyx":487 * for j in range(ny): * for k in range(3): * rotated[i,j,k] =\ # <<<<<<<<<<<<<< * R[k,0]*vecs[i,j,0]+R[k,1]*vecs[i,j,1]+R[k,2]*vecs[i,j,2] * return rotated */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_26 = PyTuple_New(3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_26 = PyTuple_New(3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_4); @@ -10325,14 +11048,14 @@ __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_rotated, __pyx_t_26, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_rotated, __pyx_t_26, __pyx_t_1) < 0)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } } - /* "yt/utilities/lib/misc_utilities.pyx":472 + /* "yt/utilities/lib/misc_utilities.pyx":489 * rotated[i,j,k] =\ * R[k,0]*vecs[i,j,0]+R[k,1]*vecs[i,j,1]+R[k,2]*vecs[i,j,2] * return rotated # <<<<<<<<<<<<<< @@ -10344,7 +11067,7 @@ __pyx_r = __pyx_v_rotated; goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":462 + /* "yt/utilities/lib/misc_utilities.pyx":479 * * * def rotate_vectors(np.ndarray[np.float64_t, ndim=3] vecs, # <<<<<<<<<<<<<< @@ -10379,7 +11102,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":477 +/* "yt/utilities/lib/misc_utilities.pyx":494 * @cython.wraparound(False) * @cython.cdivision(True) * def get_color_bounds(np.ndarray[np.float64_t, ndim=1] px, # <<<<<<<<<<<<<< @@ -10413,16 +11136,27 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -10431,51 +11165,61 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 1); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 1); __PYX_ERR(0, 494, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdx)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 2); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 2); __PYX_ERR(0, 494, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 3); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 3); __PYX_ERR(0, 494, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 4); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 4); __PYX_ERR(0, 494, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_leftx)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 5); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 5); __PYX_ERR(0, 494, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rightx)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 6); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 6); __PYX_ERR(0, 494, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lefty)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 7); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 7); __PYX_ERR(0, 494, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_righty)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 8); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, 8); __PYX_ERR(0, 494, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mindx); if (value) { values[9] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxdx); @@ -10483,12 +11227,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_color_bounds") < 0)) __PYX_ERR(0, 477, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_color_bounds") < 0)) __PYX_ERR(0, 494, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); @@ -10507,34 +11253,34 @@ __pyx_v_pdx = ((PyArrayObject *)values[2]); __pyx_v_pdy = ((PyArrayObject *)values[3]); __pyx_v_value = ((PyArrayObject *)values[4]); - __pyx_v_leftx = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_leftx == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 482, __pyx_L3_error) - __pyx_v_rightx = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_rightx == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 482, __pyx_L3_error) - __pyx_v_lefty = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_lefty == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L3_error) - __pyx_v_righty = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_righty == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L3_error) + __pyx_v_leftx = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_leftx == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 499, __pyx_L3_error) + __pyx_v_rightx = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_rightx == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 499, __pyx_L3_error) + __pyx_v_lefty = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_lefty == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L3_error) + __pyx_v_righty = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_righty == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L3_error) if (values[9]) { - __pyx_v_mindx = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_mindx == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error) + __pyx_v_mindx = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_mindx == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 501, __pyx_L3_error) } else { __pyx_v_mindx = ((__pyx_t_5numpy_float64_t)-1.0); } if (values[10]) { - __pyx_v_maxdx = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_maxdx == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error) + __pyx_v_maxdx = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_maxdx == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 501, __pyx_L3_error) } else { __pyx_v_maxdx = ((__pyx_t_5numpy_float64_t)-1.0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_color_bounds", 0, 9, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 494, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.get_color_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_px), __pyx_ptype_5numpy_ndarray, 1, "px", 0))) __PYX_ERR(0, 477, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_py), __pyx_ptype_5numpy_ndarray, 1, "py", 0))) __PYX_ERR(0, 478, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdx), __pyx_ptype_5numpy_ndarray, 1, "pdx", 0))) __PYX_ERR(0, 479, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdy), __pyx_ptype_5numpy_ndarray, 1, "pdy", 0))) __PYX_ERR(0, 480, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), __pyx_ptype_5numpy_ndarray, 1, "value", 0))) __PYX_ERR(0, 481, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_px), __pyx_ptype_5numpy_ndarray, 1, "px", 0))) __PYX_ERR(0, 494, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_py), __pyx_ptype_5numpy_ndarray, 1, "py", 0))) __PYX_ERR(0, 495, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdx), __pyx_ptype_5numpy_ndarray, 1, "pdx", 0))) __PYX_ERR(0, 496, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdy), __pyx_ptype_5numpy_ndarray, 1, "pdy", 0))) __PYX_ERR(0, 497, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), __pyx_ptype_5numpy_ndarray, 1, "value", 0))) __PYX_ERR(0, 498, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_20get_color_bounds(__pyx_self, __pyx_v_px, __pyx_v_py, __pyx_v_pdx, __pyx_v_pdy, __pyx_v_value, __pyx_v_leftx, __pyx_v_rightx, __pyx_v_lefty, __pyx_v_righty, __pyx_v_mindx, __pyx_v_maxdx); /* function exit code */ @@ -10607,31 +11353,31 @@ __pyx_pybuffernd_value.rcbuffer = &__pyx_pybuffer_value; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_px.rcbuffer->pybuffer, (PyObject*)__pyx_v_px, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 477, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_px.rcbuffer->pybuffer, (PyObject*)__pyx_v_px, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 494, __pyx_L1_error) } __pyx_pybuffernd_px.diminfo[0].strides = __pyx_pybuffernd_px.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_px.diminfo[0].shape = __pyx_pybuffernd_px.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_py.rcbuffer->pybuffer, (PyObject*)__pyx_v_py, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 477, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_py.rcbuffer->pybuffer, (PyObject*)__pyx_v_py, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 494, __pyx_L1_error) } __pyx_pybuffernd_py.diminfo[0].strides = __pyx_pybuffernd_py.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_py.diminfo[0].shape = __pyx_pybuffernd_py.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pdx.rcbuffer->pybuffer, (PyObject*)__pyx_v_pdx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 477, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pdx.rcbuffer->pybuffer, (PyObject*)__pyx_v_pdx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 494, __pyx_L1_error) } __pyx_pybuffernd_pdx.diminfo[0].strides = __pyx_pybuffernd_pdx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pdx.diminfo[0].shape = __pyx_pybuffernd_pdx.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pdy.rcbuffer->pybuffer, (PyObject*)__pyx_v_pdy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 477, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pdy.rcbuffer->pybuffer, (PyObject*)__pyx_v_pdy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 494, __pyx_L1_error) } __pyx_pybuffernd_pdy.diminfo[0].strides = __pyx_pybuffernd_pdy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pdy.diminfo[0].shape = __pyx_pybuffernd_pdy.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value.rcbuffer->pybuffer, (PyObject*)__pyx_v_value, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 477, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value.rcbuffer->pybuffer, (PyObject*)__pyx_v_value, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 494, __pyx_L1_error) } __pyx_pybuffernd_value.diminfo[0].strides = __pyx_pybuffernd_value.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value.diminfo[0].shape = __pyx_pybuffernd_value.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/misc_utilities.pyx":486 + /* "yt/utilities/lib/misc_utilities.pyx":503 * np.float64_t mindx = -1, np.float64_t maxdx = -1): * cdef int i * cdef np.float64_t mi = 1e100, ma = -1e100, v # <<<<<<<<<<<<<< @@ -10641,7 +11387,7 @@ __pyx_v_mi = 1e100; __pyx_v_ma = -1e100; - /* "yt/utilities/lib/misc_utilities.pyx":487 + /* "yt/utilities/lib/misc_utilities.pyx":504 * cdef int i * cdef np.float64_t mi = 1e100, ma = -1e100, v * cdef int np = px.shape[0] # <<<<<<<<<<<<<< @@ -10650,7 +11396,7 @@ */ __pyx_v_np = (__pyx_v_px->dimensions[0]); - /* "yt/utilities/lib/misc_utilities.pyx":488 + /* "yt/utilities/lib/misc_utilities.pyx":505 * cdef np.float64_t mi = 1e100, ma = -1e100, v * cdef int np = px.shape[0] * with nogil: # <<<<<<<<<<<<<< @@ -10661,10 +11407,11 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/utilities/lib/misc_utilities.pyx":489 + /* "yt/utilities/lib/misc_utilities.pyx":506 * cdef int np = px.shape[0] * with nogil: * for i in range(np): # <<<<<<<<<<<<<< @@ -10675,7 +11422,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/misc_utilities.pyx":490 + /* "yt/utilities/lib/misc_utilities.pyx":507 * with nogil: * for i in range(np): * v = value[i] # <<<<<<<<<<<<<< @@ -10685,7 +11432,7 @@ __pyx_t_3 = __pyx_v_i; __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_value.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":491 + /* "yt/utilities/lib/misc_utilities.pyx":508 * for i in range(np): * v = value[i] * if v < mi or v > ma: # <<<<<<<<<<<<<< @@ -10703,7 +11450,7 @@ __pyx_L9_bool_binop_done:; if (__pyx_t_4) { - /* "yt/utilities/lib/misc_utilities.pyx":492 + /* "yt/utilities/lib/misc_utilities.pyx":509 * v = value[i] * if v < mi or v > ma: * if px[i] + pdx[i] < leftx: continue # <<<<<<<<<<<<<< @@ -10717,7 +11464,7 @@ goto __pyx_L6_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":493 + /* "yt/utilities/lib/misc_utilities.pyx":510 * if v < mi or v > ma: * if px[i] + pdx[i] < leftx: continue * if px[i] - pdx[i] > rightx: continue # <<<<<<<<<<<<<< @@ -10731,7 +11478,7 @@ goto __pyx_L6_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":494 + /* "yt/utilities/lib/misc_utilities.pyx":511 * if px[i] + pdx[i] < leftx: continue * if px[i] - pdx[i] > rightx: continue * if py[i] + pdy[i] < lefty: continue # <<<<<<<<<<<<<< @@ -10745,7 +11492,7 @@ goto __pyx_L6_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":495 + /* "yt/utilities/lib/misc_utilities.pyx":512 * if px[i] - pdx[i] > rightx: continue * if py[i] + pdy[i] < lefty: continue * if py[i] - pdy[i] > righty: continue # <<<<<<<<<<<<<< @@ -10759,7 +11506,7 @@ goto __pyx_L6_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":496 + /* "yt/utilities/lib/misc_utilities.pyx":513 * if py[i] + pdy[i] < lefty: continue * if py[i] - pdy[i] > righty: continue * if pdx[i] < mindx or pdy[i] < mindx: continue # <<<<<<<<<<<<<< @@ -10781,7 +11528,7 @@ goto __pyx_L6_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":497 + /* "yt/utilities/lib/misc_utilities.pyx":514 * if py[i] - pdy[i] > righty: continue * if pdx[i] < mindx or pdy[i] < mindx: continue * if maxdx > 0 and (pdx[i] > maxdx or pdy[i] > maxdx): continue # <<<<<<<<<<<<<< @@ -10809,7 +11556,7 @@ goto __pyx_L6_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":498 + /* "yt/utilities/lib/misc_utilities.pyx":515 * if pdx[i] < mindx or pdy[i] < mindx: continue * if maxdx > 0 and (pdx[i] > maxdx or pdy[i] > maxdx): continue * if v < mi: mi = v # <<<<<<<<<<<<<< @@ -10821,7 +11568,7 @@ __pyx_v_mi = __pyx_v_v; } - /* "yt/utilities/lib/misc_utilities.pyx":499 + /* "yt/utilities/lib/misc_utilities.pyx":516 * if maxdx > 0 and (pdx[i] > maxdx or pdy[i] > maxdx): continue * if v < mi: mi = v * if v > ma: ma = v # <<<<<<<<<<<<<< @@ -10833,7 +11580,7 @@ __pyx_v_ma = __pyx_v_v; } - /* "yt/utilities/lib/misc_utilities.pyx":491 + /* "yt/utilities/lib/misc_utilities.pyx":508 * for i in range(np): * v = value[i] * if v < mi or v > ma: # <<<<<<<<<<<<<< @@ -10845,7 +11592,7 @@ } } - /* "yt/utilities/lib/misc_utilities.pyx":488 + /* "yt/utilities/lib/misc_utilities.pyx":505 * cdef np.float64_t mi = 1e100, ma = -1e100, v * cdef int np = px.shape[0] * with nogil: # <<<<<<<<<<<<<< @@ -10855,6 +11602,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; @@ -10863,7 +11611,7 @@ } } - /* "yt/utilities/lib/misc_utilities.pyx":500 + /* "yt/utilities/lib/misc_utilities.pyx":517 * if v < mi: mi = v * if v > ma: ma = v * return (mi, ma) # <<<<<<<<<<<<<< @@ -10871,11 +11619,11 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_18 = PyFloat_FromDouble(__pyx_v_mi); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_18 = PyFloat_FromDouble(__pyx_v_mi); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = PyFloat_FromDouble(__pyx_v_ma); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_19 = PyFloat_FromDouble(__pyx_v_ma); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); @@ -10887,7 +11635,7 @@ __pyx_t_20 = 0; goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":477 + /* "yt/utilities/lib/misc_utilities.pyx":494 * @cython.wraparound(False) * @cython.cdivision(True) * def get_color_bounds(np.ndarray[np.float64_t, ndim=1] px, # <<<<<<<<<<<<<< @@ -10925,7 +11673,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":505 +/* "yt/utilities/lib/misc_utilities.pyx":522 * @cython.wraparound(False) * @cython.cdivision(True) * def kdtree_get_choices(np.ndarray[np.float64_t, ndim=3] data, # <<<<<<<<<<<<<< @@ -10951,8 +11699,11 @@ 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; } @@ -10961,19 +11712,21 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_l_corner)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("kdtree_get_choices", 1, 3, 3, 1); __PYX_ERR(0, 505, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("kdtree_get_choices", 1, 3, 3, 1); __PYX_ERR(0, 522, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r_corner)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("kdtree_get_choices", 1, 3, 3, 2); __PYX_ERR(0, 505, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("kdtree_get_choices", 1, 3, 3, 2); __PYX_ERR(0, 522, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kdtree_get_choices") < 0)) __PYX_ERR(0, 505, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kdtree_get_choices") < 0)) __PYX_ERR(0, 522, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -10988,15 +11741,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("kdtree_get_choices", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 505, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("kdtree_get_choices", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 522, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.kdtree_get_choices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 505, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l_corner), __pyx_ptype_5numpy_ndarray, 1, "l_corner", 0))) __PYX_ERR(0, 506, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r_corner), __pyx_ptype_5numpy_ndarray, 1, "r_corner", 0))) __PYX_ERR(0, 507, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 522, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l_corner), __pyx_ptype_5numpy_ndarray, 1, "l_corner", 0))) __PYX_ERR(0, 523, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r_corner), __pyx_ptype_5numpy_ndarray, 1, "r_corner", 0))) __PYX_ERR(0, 524, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_22kdtree_get_choices(__pyx_self, __pyx_v_data, __pyx_v_l_corner, __pyx_v_r_corner); /* function exit code */ @@ -11109,21 +11862,21 @@ __pyx_pybuffernd_r_corner.rcbuffer = &__pyx_pybuffer_r_corner; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 505, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 522, __pyx_L1_error) } __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_data.diminfo[2].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_data.diminfo[2].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_l_corner.rcbuffer->pybuffer, (PyObject*)__pyx_v_l_corner, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 505, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_l_corner.rcbuffer->pybuffer, (PyObject*)__pyx_v_l_corner, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 522, __pyx_L1_error) } __pyx_pybuffernd_l_corner.diminfo[0].strides = __pyx_pybuffernd_l_corner.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l_corner.diminfo[0].shape = __pyx_pybuffernd_l_corner.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_r_corner.rcbuffer->pybuffer, (PyObject*)__pyx_v_r_corner, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 505, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_r_corner.rcbuffer->pybuffer, (PyObject*)__pyx_v_r_corner, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 522, __pyx_L1_error) } __pyx_pybuffernd_r_corner.diminfo[0].strides = __pyx_pybuffernd_r_corner.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_r_corner.diminfo[0].shape = __pyx_pybuffernd_r_corner.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/misc_utilities.pyx":509 + /* "yt/utilities/lib/misc_utilities.pyx":526 * np.ndarray[np.float64_t, ndim=1] r_corner): * cdef int i, j, k, dim, n_unique, best_dim, n_grids, my_split * n_grids = data.shape[0] # <<<<<<<<<<<<<< @@ -11132,7 +11885,7 @@ */ __pyx_v_n_grids = (__pyx_v_data->dimensions[0]); - /* "yt/utilities/lib/misc_utilities.pyx":513 + /* "yt/utilities/lib/misc_utilities.pyx":530 * cdef np.float64_t *uniques * cdef np.float64_t split * uniquedims = alloca(3 * sizeof(np.float64_t*)) # <<<<<<<<<<<<<< @@ -11141,7 +11894,7 @@ */ __pyx_v_uniquedims = ((__pyx_t_5numpy_float64_t **)alloca((3 * (sizeof(__pyx_t_5numpy_float64_t *))))); - /* "yt/utilities/lib/misc_utilities.pyx":514 + /* "yt/utilities/lib/misc_utilities.pyx":531 * cdef np.float64_t split * uniquedims = alloca(3 * sizeof(np.float64_t*)) * for i in range(3): # <<<<<<<<<<<<<< @@ -11151,7 +11904,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/misc_utilities.pyx":515 + /* "yt/utilities/lib/misc_utilities.pyx":532 * uniquedims = alloca(3 * sizeof(np.float64_t*)) * for i in range(3): * uniquedims[i] = \ # <<<<<<<<<<<<<< @@ -11161,7 +11914,7 @@ (__pyx_v_uniquedims[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)alloca(((2 * __pyx_v_n_grids) * (sizeof(__pyx_t_5numpy_float64_t))))); } - /* "yt/utilities/lib/misc_utilities.pyx":517 + /* "yt/utilities/lib/misc_utilities.pyx":534 * uniquedims[i] = \ * alloca(2*n_grids * sizeof(np.float64_t)) * my_max = 0 # <<<<<<<<<<<<<< @@ -11170,7 +11923,7 @@ */ __pyx_v_my_max = 0; - /* "yt/utilities/lib/misc_utilities.pyx":518 + /* "yt/utilities/lib/misc_utilities.pyx":535 * alloca(2*n_grids * sizeof(np.float64_t)) * my_max = 0 * best_dim = -1 # <<<<<<<<<<<<<< @@ -11179,7 +11932,7 @@ */ __pyx_v_best_dim = -1; - /* "yt/utilities/lib/misc_utilities.pyx":519 + /* "yt/utilities/lib/misc_utilities.pyx":536 * my_max = 0 * best_dim = -1 * my_split = -1 # <<<<<<<<<<<<<< @@ -11188,7 +11941,7 @@ */ __pyx_v_my_split = -1; - /* "yt/utilities/lib/misc_utilities.pyx":520 + /* "yt/utilities/lib/misc_utilities.pyx":537 * best_dim = -1 * my_split = -1 * for dim in range(3): # <<<<<<<<<<<<<< @@ -11198,7 +11951,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_dim = __pyx_t_1; - /* "yt/utilities/lib/misc_utilities.pyx":521 + /* "yt/utilities/lib/misc_utilities.pyx":538 * my_split = -1 * for dim in range(3): * n_unique = 0 # <<<<<<<<<<<<<< @@ -11207,7 +11960,7 @@ */ __pyx_v_n_unique = 0; - /* "yt/utilities/lib/misc_utilities.pyx":522 + /* "yt/utilities/lib/misc_utilities.pyx":539 * for dim in range(3): * n_unique = 0 * uniques = uniquedims[dim] # <<<<<<<<<<<<<< @@ -11216,7 +11969,7 @@ */ __pyx_v_uniques = (__pyx_v_uniquedims[__pyx_v_dim]); - /* "yt/utilities/lib/misc_utilities.pyx":523 + /* "yt/utilities/lib/misc_utilities.pyx":540 * n_unique = 0 * uniques = uniquedims[dim] * for i in range(n_grids): # <<<<<<<<<<<<<< @@ -11227,7 +11980,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/utilities/lib/misc_utilities.pyx":525 + /* "yt/utilities/lib/misc_utilities.pyx":542 * for i in range(n_grids): * # Check for disqualification * for j in range(2): # <<<<<<<<<<<<<< @@ -11237,7 +11990,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < 2; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "yt/utilities/lib/misc_utilities.pyx":527 + /* "yt/utilities/lib/misc_utilities.pyx":544 * for j in range(2): * #print "Checking against", i,j,dim,data[i,j,dim] * if not (l_corner[dim] < data[i, j, dim] and # <<<<<<<<<<<<<< @@ -11255,7 +12008,7 @@ goto __pyx_L12_bool_binop_done; } - /* "yt/utilities/lib/misc_utilities.pyx":528 + /* "yt/utilities/lib/misc_utilities.pyx":545 * #print "Checking against", i,j,dim,data[i,j,dim] * if not (l_corner[dim] < data[i, j, dim] and * data[i, j, dim] < r_corner[dim]): # <<<<<<<<<<<<<< @@ -11270,7 +12023,7 @@ __pyx_t_5 = __pyx_t_10; __pyx_L12_bool_binop_done:; - /* "yt/utilities/lib/misc_utilities.pyx":527 + /* "yt/utilities/lib/misc_utilities.pyx":544 * for j in range(2): * #print "Checking against", i,j,dim,data[i,j,dim] * if not (l_corner[dim] < data[i, j, dim] and # <<<<<<<<<<<<<< @@ -11280,7 +12033,7 @@ __pyx_t_10 = ((!__pyx_t_5) != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":530 + /* "yt/utilities/lib/misc_utilities.pyx":547 * data[i, j, dim] < r_corner[dim]): * #print "Skipping ", data[i,j,dim] * continue # <<<<<<<<<<<<<< @@ -11289,7 +12042,7 @@ */ goto __pyx_L9_continue; - /* "yt/utilities/lib/misc_utilities.pyx":527 + /* "yt/utilities/lib/misc_utilities.pyx":544 * for j in range(2): * #print "Checking against", i,j,dim,data[i,j,dim] * if not (l_corner[dim] < data[i, j, dim] and # <<<<<<<<<<<<<< @@ -11298,7 +12051,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":531 + /* "yt/utilities/lib/misc_utilities.pyx":548 * #print "Skipping ", data[i,j,dim] * continue * skipit = 0 # <<<<<<<<<<<<<< @@ -11307,7 +12060,7 @@ */ __pyx_v_skipit = 0; - /* "yt/utilities/lib/misc_utilities.pyx":533 + /* "yt/utilities/lib/misc_utilities.pyx":550 * skipit = 0 * # Add our left ... * for k in range(n_unique): # <<<<<<<<<<<<<< @@ -11318,7 +12071,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_k = __pyx_t_16; - /* "yt/utilities/lib/misc_utilities.pyx":534 + /* "yt/utilities/lib/misc_utilities.pyx":551 * # Add our left ... * for k in range(n_unique): * if uniques[k] == data[i, j, dim]: # <<<<<<<<<<<<<< @@ -11331,7 +12084,7 @@ __pyx_t_10 = (((__pyx_v_uniques[__pyx_v_k]) == (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_data.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_data.diminfo[2].strides))) != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":535 + /* "yt/utilities/lib/misc_utilities.pyx":552 * for k in range(n_unique): * if uniques[k] == data[i, j, dim]: * skipit = 1 # <<<<<<<<<<<<<< @@ -11340,7 +12093,7 @@ */ __pyx_v_skipit = 1; - /* "yt/utilities/lib/misc_utilities.pyx":537 + /* "yt/utilities/lib/misc_utilities.pyx":554 * skipit = 1 * #print "Identified", uniques[k], data[i,j,dim], n_unique * break # <<<<<<<<<<<<<< @@ -11349,7 +12102,7 @@ */ goto __pyx_L15_break; - /* "yt/utilities/lib/misc_utilities.pyx":534 + /* "yt/utilities/lib/misc_utilities.pyx":551 * # Add our left ... * for k in range(n_unique): * if uniques[k] == data[i, j, dim]: # <<<<<<<<<<<<<< @@ -11360,7 +12113,7 @@ } __pyx_L15_break:; - /* "yt/utilities/lib/misc_utilities.pyx":538 + /* "yt/utilities/lib/misc_utilities.pyx":555 * #print "Identified", uniques[k], data[i,j,dim], n_unique * break * if skipit == 0: # <<<<<<<<<<<<<< @@ -11370,7 +12123,7 @@ __pyx_t_10 = ((__pyx_v_skipit == 0) != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":539 + /* "yt/utilities/lib/misc_utilities.pyx":556 * break * if skipit == 0: * uniques[n_unique] = data[i, j, dim] # <<<<<<<<<<<<<< @@ -11382,7 +12135,7 @@ __pyx_t_22 = __pyx_v_dim; (__pyx_v_uniques[__pyx_v_n_unique]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_data.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_data.diminfo[2].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":540 + /* "yt/utilities/lib/misc_utilities.pyx":557 * if skipit == 0: * uniques[n_unique] = data[i, j, dim] * n_unique += 1 # <<<<<<<<<<<<<< @@ -11391,7 +12144,7 @@ */ __pyx_v_n_unique = (__pyx_v_n_unique + 1); - /* "yt/utilities/lib/misc_utilities.pyx":538 + /* "yt/utilities/lib/misc_utilities.pyx":555 * #print "Identified", uniques[k], data[i,j,dim], n_unique * break * if skipit == 0: # <<<<<<<<<<<<<< @@ -11403,7 +12156,7 @@ } } - /* "yt/utilities/lib/misc_utilities.pyx":541 + /* "yt/utilities/lib/misc_utilities.pyx":558 * uniques[n_unique] = data[i, j, dim] * n_unique += 1 * if n_unique > my_max: # <<<<<<<<<<<<<< @@ -11413,7 +12166,7 @@ __pyx_t_10 = ((__pyx_v_n_unique > __pyx_v_my_max) != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":542 + /* "yt/utilities/lib/misc_utilities.pyx":559 * n_unique += 1 * if n_unique > my_max: * best_dim = dim # <<<<<<<<<<<<<< @@ -11422,7 +12175,7 @@ */ __pyx_v_best_dim = __pyx_v_dim; - /* "yt/utilities/lib/misc_utilities.pyx":543 + /* "yt/utilities/lib/misc_utilities.pyx":560 * if n_unique > my_max: * best_dim = dim * my_max = n_unique # <<<<<<<<<<<<<< @@ -11431,7 +12184,7 @@ */ __pyx_v_my_max = __pyx_v_n_unique; - /* "yt/utilities/lib/misc_utilities.pyx":544 + /* "yt/utilities/lib/misc_utilities.pyx":561 * best_dim = dim * my_max = n_unique * my_split = (n_unique-1)/2 # <<<<<<<<<<<<<< @@ -11440,7 +12193,7 @@ */ __pyx_v_my_split = ((__pyx_v_n_unique - 1) / 2); - /* "yt/utilities/lib/misc_utilities.pyx":541 + /* "yt/utilities/lib/misc_utilities.pyx":558 * uniques[n_unique] = data[i, j, dim] * n_unique += 1 * if n_unique > my_max: # <<<<<<<<<<<<<< @@ -11450,40 +12203,40 @@ } } - /* "yt/utilities/lib/misc_utilities.pyx":546 + /* "yt/utilities/lib/misc_utilities.pyx":563 * my_split = (n_unique-1)/2 * # I recognize how lame this is. * cdef np.ndarray[np.float64_t, ndim=1] tarr = np.empty(my_max, dtype='float64') # <<<<<<<<<<<<<< * for i in range(my_max): * #print "Setting tarr: ", i, uniquedims[best_dim][i] */ - __pyx_t_23 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_23 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); - __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_empty); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_empty); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; - __pyx_t_23 = __Pyx_PyInt_From_long(__pyx_v_my_max); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyInt_From_long(__pyx_v_my_max); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); - __pyx_t_25 = PyTuple_New(1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_25 = PyTuple_New(1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_GIVEREF(__pyx_t_23); PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_23); __pyx_t_23 = 0; - __pyx_t_23 = PyDict_New(); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_23 = PyDict_New(); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); - if (PyDict_SetItem(__pyx_t_23, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 546, __pyx_L1_error) - __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_25, __pyx_t_23); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 546, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_23, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_25, __pyx_t_23); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; - if (!(likely(((__pyx_t_26) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_26, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 546, __pyx_L1_error) + if (!(likely(((__pyx_t_26) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_26, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 563, __pyx_L1_error) __pyx_t_27 = ((PyArrayObject *)__pyx_t_26); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_tarr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_tarr.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 546, __pyx_L1_error) + __PYX_ERR(0, 563, __pyx_L1_error) } else {__pyx_pybuffernd_tarr.diminfo[0].strides = __pyx_pybuffernd_tarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tarr.diminfo[0].shape = __pyx_pybuffernd_tarr.rcbuffer->pybuffer.shape[0]; } } @@ -11491,7 +12244,7 @@ __pyx_v_tarr = ((PyArrayObject *)__pyx_t_26); __pyx_t_26 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":547 + /* "yt/utilities/lib/misc_utilities.pyx":564 * # I recognize how lame this is. * cdef np.ndarray[np.float64_t, ndim=1] tarr = np.empty(my_max, dtype='float64') * for i in range(my_max): # <<<<<<<<<<<<<< @@ -11502,7 +12255,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_28; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/misc_utilities.pyx":549 + /* "yt/utilities/lib/misc_utilities.pyx":566 * for i in range(my_max): * #print "Setting tarr: ", i, uniquedims[best_dim][i] * tarr[i] = uniquedims[best_dim][i] # <<<<<<<<<<<<<< @@ -11513,14 +12266,14 @@ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tarr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_tarr.diminfo[0].strides) = ((__pyx_v_uniquedims[__pyx_v_best_dim])[__pyx_v_i]); } - /* "yt/utilities/lib/misc_utilities.pyx":550 + /* "yt/utilities/lib/misc_utilities.pyx":567 * #print "Setting tarr: ", i, uniquedims[best_dim][i] * tarr[i] = uniquedims[best_dim][i] * tarr.sort() # <<<<<<<<<<<<<< * if my_split < 0: * raise RuntimeError */ - __pyx_t_23 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_tarr), __pyx_n_s_sort); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_tarr), __pyx_n_s_sort); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_25 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_23))) { @@ -11533,16 +12286,16 @@ } } if (__pyx_t_25) { - __pyx_t_26 = __Pyx_PyObject_CallOneArg(__pyx_t_23, __pyx_t_25); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyObject_CallOneArg(__pyx_t_23, __pyx_t_25); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; } else { - __pyx_t_26 = __Pyx_PyObject_CallNoArg(__pyx_t_23); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyObject_CallNoArg(__pyx_t_23); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 567, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":551 + /* "yt/utilities/lib/misc_utilities.pyx":568 * tarr[i] = uniquedims[best_dim][i] * tarr.sort() * if my_split < 0: # <<<<<<<<<<<<<< @@ -11552,7 +12305,7 @@ __pyx_t_10 = ((__pyx_v_my_split < 0) != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":552 + /* "yt/utilities/lib/misc_utilities.pyx":569 * tarr.sort() * if my_split < 0: * raise RuntimeError # <<<<<<<<<<<<<< @@ -11560,9 +12313,9 @@ * cdef np.ndarray[np.uint8_t, ndim=1] less_ids = np.empty(n_grids, dtype='uint8') */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - __PYX_ERR(0, 552, __pyx_L1_error) + __PYX_ERR(0, 569, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":551 + /* "yt/utilities/lib/misc_utilities.pyx":568 * tarr[i] = uniquedims[best_dim][i] * tarr.sort() * if my_split < 0: # <<<<<<<<<<<<<< @@ -11571,7 +12324,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":553 + /* "yt/utilities/lib/misc_utilities.pyx":570 * if my_split < 0: * raise RuntimeError * split = tarr[my_split] # <<<<<<<<<<<<<< @@ -11581,40 +12334,40 @@ __pyx_t_30 = __pyx_v_my_split; __pyx_v_split = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tarr.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_tarr.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":554 + /* "yt/utilities/lib/misc_utilities.pyx":571 * raise RuntimeError * split = tarr[my_split] * cdef np.ndarray[np.uint8_t, ndim=1] less_ids = np.empty(n_grids, dtype='uint8') # <<<<<<<<<<<<<< * cdef np.ndarray[np.uint8_t, ndim=1] greater_ids = np.empty(n_grids, dtype='uint8') * for i in range(n_grids): */ - __pyx_t_26 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_26 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_26, __pyx_n_s_empty); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_26, __pyx_n_s_empty); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_n_grids); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_n_grids); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_25 = PyTuple_New(1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_25 = PyTuple_New(1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_GIVEREF(__pyx_t_26); PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = PyDict_New(); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_26 = PyDict_New(); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - if (PyDict_SetItem(__pyx_t_26, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 554, __pyx_L1_error) - __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_25, __pyx_t_26); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 554, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_26, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_25, __pyx_t_26); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - if (!(likely(((__pyx_t_24) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_24, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 554, __pyx_L1_error) + if (!(likely(((__pyx_t_24) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_24, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 571, __pyx_L1_error) __pyx_t_31 = ((PyArrayObject *)__pyx_t_24); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_less_ids.rcbuffer->pybuffer, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_less_ids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_less_ids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 554, __pyx_L1_error) + __PYX_ERR(0, 571, __pyx_L1_error) } else {__pyx_pybuffernd_less_ids.diminfo[0].strides = __pyx_pybuffernd_less_ids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_less_ids.diminfo[0].shape = __pyx_pybuffernd_less_ids.rcbuffer->pybuffer.shape[0]; } } @@ -11622,40 +12375,40 @@ __pyx_v_less_ids = ((PyArrayObject *)__pyx_t_24); __pyx_t_24 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":555 + /* "yt/utilities/lib/misc_utilities.pyx":572 * split = tarr[my_split] * cdef np.ndarray[np.uint8_t, ndim=1] less_ids = np.empty(n_grids, dtype='uint8') * cdef np.ndarray[np.uint8_t, ndim=1] greater_ids = np.empty(n_grids, dtype='uint8') # <<<<<<<<<<<<<< * for i in range(n_grids): * if data[i, 0, best_dim] < split: */ - __pyx_t_24 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_24 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); - __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_empty); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_empty); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_n_grids); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_n_grids); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); - __pyx_t_25 = PyTuple_New(1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_25 = PyTuple_New(1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_GIVEREF(__pyx_t_24); PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_24); __pyx_t_24 = 0; - __pyx_t_24 = PyDict_New(); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_24 = PyDict_New(); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); - if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 555, __pyx_L1_error) - __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_26, __pyx_t_25, __pyx_t_24); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 555, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_26, __pyx_t_25, __pyx_t_24); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - if (!(likely(((__pyx_t_23) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_23, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 555, __pyx_L1_error) + if (!(likely(((__pyx_t_23) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_23, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 572, __pyx_L1_error) __pyx_t_32 = ((PyArrayObject *)__pyx_t_23); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_greater_ids.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_greater_ids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_greater_ids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 555, __pyx_L1_error) + __PYX_ERR(0, 572, __pyx_L1_error) } else {__pyx_pybuffernd_greater_ids.diminfo[0].strides = __pyx_pybuffernd_greater_ids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_greater_ids.diminfo[0].shape = __pyx_pybuffernd_greater_ids.rcbuffer->pybuffer.shape[0]; } } @@ -11663,7 +12416,7 @@ __pyx_v_greater_ids = ((PyArrayObject *)__pyx_t_23); __pyx_t_23 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":556 + /* "yt/utilities/lib/misc_utilities.pyx":573 * cdef np.ndarray[np.uint8_t, ndim=1] less_ids = np.empty(n_grids, dtype='uint8') * cdef np.ndarray[np.uint8_t, ndim=1] greater_ids = np.empty(n_grids, dtype='uint8') * for i in range(n_grids): # <<<<<<<<<<<<<< @@ -11674,7 +12427,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/misc_utilities.pyx":557 + /* "yt/utilities/lib/misc_utilities.pyx":574 * cdef np.ndarray[np.uint8_t, ndim=1] greater_ids = np.empty(n_grids, dtype='uint8') * for i in range(n_grids): * if data[i, 0, best_dim] < split: # <<<<<<<<<<<<<< @@ -11687,7 +12440,7 @@ __pyx_t_10 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_data.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_data.diminfo[2].strides)) < __pyx_v_split) != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":558 + /* "yt/utilities/lib/misc_utilities.pyx":575 * for i in range(n_grids): * if data[i, 0, best_dim] < split: * less_ids[i] = 1 # <<<<<<<<<<<<<< @@ -11697,7 +12450,7 @@ __pyx_t_36 = __pyx_v_i; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_less_ids.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_less_ids.diminfo[0].strides) = 1; - /* "yt/utilities/lib/misc_utilities.pyx":557 + /* "yt/utilities/lib/misc_utilities.pyx":574 * cdef np.ndarray[np.uint8_t, ndim=1] greater_ids = np.empty(n_grids, dtype='uint8') * for i in range(n_grids): * if data[i, 0, best_dim] < split: # <<<<<<<<<<<<<< @@ -11707,7 +12460,7 @@ goto __pyx_L24; } - /* "yt/utilities/lib/misc_utilities.pyx":560 + /* "yt/utilities/lib/misc_utilities.pyx":577 * less_ids[i] = 1 * else: * less_ids[i] = 0 # <<<<<<<<<<<<<< @@ -11720,7 +12473,7 @@ } __pyx_L24:; - /* "yt/utilities/lib/misc_utilities.pyx":561 + /* "yt/utilities/lib/misc_utilities.pyx":578 * else: * less_ids[i] = 0 * if data[i, 1, best_dim] > split: # <<<<<<<<<<<<<< @@ -11733,7 +12486,7 @@ __pyx_t_10 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_data.diminfo[1].strides, __pyx_t_40, __pyx_pybuffernd_data.diminfo[2].strides)) > __pyx_v_split) != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":562 + /* "yt/utilities/lib/misc_utilities.pyx":579 * less_ids[i] = 0 * if data[i, 1, best_dim] > split: * greater_ids[i] = 1 # <<<<<<<<<<<<<< @@ -11743,7 +12496,7 @@ __pyx_t_41 = __pyx_v_i; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_greater_ids.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_greater_ids.diminfo[0].strides) = 1; - /* "yt/utilities/lib/misc_utilities.pyx":561 + /* "yt/utilities/lib/misc_utilities.pyx":578 * else: * less_ids[i] = 0 * if data[i, 1, best_dim] > split: # <<<<<<<<<<<<<< @@ -11753,7 +12506,7 @@ goto __pyx_L25; } - /* "yt/utilities/lib/misc_utilities.pyx":564 + /* "yt/utilities/lib/misc_utilities.pyx":581 * greater_ids[i] = 1 * else: * greater_ids[i] = 0 # <<<<<<<<<<<<<< @@ -11767,7 +12520,7 @@ __pyx_L25:; } - /* "yt/utilities/lib/misc_utilities.pyx":566 + /* "yt/utilities/lib/misc_utilities.pyx":583 * greater_ids[i] = 0 * # Return out unique values * return best_dim, split, less_ids.view("bool"), greater_ids.view("bool") # <<<<<<<<<<<<<< @@ -11775,21 +12528,21 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_best_dim); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_best_dim); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); - __pyx_t_24 = PyFloat_FromDouble(__pyx_v_split); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_24 = PyFloat_FromDouble(__pyx_v_split); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); - __pyx_t_25 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_less_ids), __pyx_n_s_view); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_25 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_less_ids), __pyx_n_s_view); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); - __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_25, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_25, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; - __pyx_t_25 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greater_ids), __pyx_n_s_view); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_25 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greater_ids), __pyx_n_s_view); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); - __pyx_t_43 = __Pyx_PyObject_Call(__pyx_t_25, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_43 = __Pyx_PyObject_Call(__pyx_t_25, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_43); __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; - __pyx_t_25 = PyTuple_New(4); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_25 = PyTuple_New(4); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_GIVEREF(__pyx_t_23); PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_23); @@ -11807,7 +12560,7 @@ __pyx_t_25 = 0; goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":505 + /* "yt/utilities/lib/misc_utilities.pyx":522 * @cython.wraparound(False) * @cython.cdivision(True) * def kdtree_get_choices(np.ndarray[np.float64_t, ndim=3] data, # <<<<<<<<<<<<<< @@ -11852,7 +12605,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":571 +/* "yt/utilities/lib/misc_utilities.pyx":588 * @cython.wraparound(False) * @cython.cdivision(True) * def get_box_grids_level(np.ndarray[np.float64_t, ndim=1] left_edge, # <<<<<<<<<<<<<< @@ -11883,13 +12636,21 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -11898,36 +12659,43 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, 1); __PYX_ERR(0, 571, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, 1); __PYX_ERR(0, 588, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, 2); __PYX_ERR(0, 571, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, 2); __PYX_ERR(0, 588, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, 3); __PYX_ERR(0, 571, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, 3); __PYX_ERR(0, 588, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, 4); __PYX_ERR(0, 571, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, 4); __PYX_ERR(0, 588, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, 5); __PYX_ERR(0, 571, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, 5); __PYX_ERR(0, 588, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, 6); __PYX_ERR(0, 571, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, 6); __PYX_ERR(0, 588, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_index); @@ -11935,11 +12703,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_box_grids_level") < 0)) __PYX_ERR(0, 571, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_box_grids_level") < 0)) __PYX_ERR(0, 588, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); @@ -11953,31 +12722,31 @@ } __pyx_v_left_edge = ((PyArrayObject *)values[0]); __pyx_v_right_edge = ((PyArrayObject *)values[1]); - __pyx_v_level = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L3_error) + __pyx_v_level = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L3_error) __pyx_v_left_edges = ((PyArrayObject *)values[3]); __pyx_v_right_edges = ((PyArrayObject *)values[4]); __pyx_v_levels = ((PyArrayObject *)values[5]); __pyx_v_mask = ((PyArrayObject *)values[6]); if (values[7]) { - __pyx_v_min_index = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_min_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L3_error) + __pyx_v_min_index = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_min_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error) } else { __pyx_v_min_index = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 571, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_level", 0, 7, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 588, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.get_box_grids_level", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 571, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 572, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 574, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 575, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 576, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 577, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 588, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 589, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 591, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 592, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 593, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 594, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_24get_box_grids_level(__pyx_self, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_level, __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_levels, __pyx_v_mask, __pyx_v_min_index); /* function exit code */ @@ -12058,36 +12827,36 @@ __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 571, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 588, __pyx_L1_error) } __pyx_pybuffernd_left_edge.diminfo[0].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edge.diminfo[0].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 571, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 588, __pyx_L1_error) } __pyx_pybuffernd_right_edge.diminfo[0].strides = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edge.diminfo[0].shape = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 571, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 588, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 571, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 588, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 571, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 588, __pyx_L1_error) } __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_levels.diminfo[1].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_levels.diminfo[1].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 571, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 588, __pyx_L1_error) } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/misc_utilities.pyx":580 + /* "yt/utilities/lib/misc_utilities.pyx":597 * int min_index = 0): * cdef int i, n * cdef int nx = left_edges.shape[0] # <<<<<<<<<<<<<< @@ -12096,21 +12865,21 @@ */ __pyx_v_nx = (__pyx_v_left_edges->dimensions[0]); - /* "yt/utilities/lib/misc_utilities.pyx":582 + /* "yt/utilities/lib/misc_utilities.pyx":599 * cdef int nx = left_edges.shape[0] * cdef int inside * cdef np.float64_t eps = np.finfo(np.float64).eps # <<<<<<<<<<<<<< * for i in range(nx): * if i < min_index or levels[i,0] != level: */ - __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, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_finfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_finfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_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, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -12124,14 +12893,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __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(0, 582, __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, 599, __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; @@ -12140,33 +12909,33 @@ #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(0, 582, __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, 599, __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(0, 582, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __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(0, 582, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_eps = __pyx_t_6; - /* "yt/utilities/lib/misc_utilities.pyx":583 + /* "yt/utilities/lib/misc_utilities.pyx":600 * cdef int inside * cdef np.float64_t eps = np.finfo(np.float64).eps * for i in range(nx): # <<<<<<<<<<<<<< @@ -12177,7 +12946,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "yt/utilities/lib/misc_utilities.pyx":584 + /* "yt/utilities/lib/misc_utilities.pyx":601 * cdef np.float64_t eps = np.finfo(np.float64).eps * for i in range(nx): * if i < min_index or levels[i,0] != level: # <<<<<<<<<<<<<< @@ -12197,7 +12966,7 @@ __pyx_L6_bool_binop_done:; if (__pyx_t_9) { - /* "yt/utilities/lib/misc_utilities.pyx":585 + /* "yt/utilities/lib/misc_utilities.pyx":602 * for i in range(nx): * if i < min_index or levels[i,0] != level: * mask[i] = 0 # <<<<<<<<<<<<<< @@ -12207,7 +12976,7 @@ __pyx_t_13 = __pyx_v_i; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_mask.diminfo[0].strides) = 0; - /* "yt/utilities/lib/misc_utilities.pyx":586 + /* "yt/utilities/lib/misc_utilities.pyx":603 * if i < min_index or levels[i,0] != level: * mask[i] = 0 * continue # <<<<<<<<<<<<<< @@ -12216,7 +12985,7 @@ */ goto __pyx_L3_continue; - /* "yt/utilities/lib/misc_utilities.pyx":584 + /* "yt/utilities/lib/misc_utilities.pyx":601 * cdef np.float64_t eps = np.finfo(np.float64).eps * for i in range(nx): * if i < min_index or levels[i,0] != level: # <<<<<<<<<<<<<< @@ -12225,7 +12994,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":587 + /* "yt/utilities/lib/misc_utilities.pyx":604 * mask[i] = 0 * continue * inside = 1 # <<<<<<<<<<<<<< @@ -12234,7 +13003,7 @@ */ __pyx_v_inside = 1; - /* "yt/utilities/lib/misc_utilities.pyx":588 + /* "yt/utilities/lib/misc_utilities.pyx":605 * continue * inside = 1 * for n in range(3): # <<<<<<<<<<<<<< @@ -12244,7 +13013,7 @@ for (__pyx_t_14 = 0; __pyx_t_14 < 3; __pyx_t_14+=1) { __pyx_v_n = __pyx_t_14; - /* "yt/utilities/lib/misc_utilities.pyx":589 + /* "yt/utilities/lib/misc_utilities.pyx":606 * inside = 1 * for n in range(3): * if (right_edges[i,n] - left_edge[n]) <= eps or \ # <<<<<<<<<<<<<< @@ -12261,7 +13030,7 @@ goto __pyx_L11_bool_binop_done; } - /* "yt/utilities/lib/misc_utilities.pyx":590 + /* "yt/utilities/lib/misc_utilities.pyx":607 * for n in range(3): * if (right_edges[i,n] - left_edge[n]) <= eps or \ * (right_edge[n] - left_edges[i,n]) <= eps: # <<<<<<<<<<<<<< @@ -12275,7 +13044,7 @@ __pyx_t_9 = __pyx_t_10; __pyx_L11_bool_binop_done:; - /* "yt/utilities/lib/misc_utilities.pyx":589 + /* "yt/utilities/lib/misc_utilities.pyx":606 * inside = 1 * for n in range(3): * if (right_edges[i,n] - left_edge[n]) <= eps or \ # <<<<<<<<<<<<<< @@ -12284,7 +13053,7 @@ */ if (__pyx_t_9) { - /* "yt/utilities/lib/misc_utilities.pyx":591 + /* "yt/utilities/lib/misc_utilities.pyx":608 * if (right_edges[i,n] - left_edge[n]) <= eps or \ * (right_edge[n] - left_edges[i,n]) <= eps: * inside = 0 # <<<<<<<<<<<<<< @@ -12293,7 +13062,7 @@ */ __pyx_v_inside = 0; - /* "yt/utilities/lib/misc_utilities.pyx":592 + /* "yt/utilities/lib/misc_utilities.pyx":609 * (right_edge[n] - left_edges[i,n]) <= eps: * inside = 0 * break # <<<<<<<<<<<<<< @@ -12302,7 +13071,7 @@ */ goto __pyx_L9_break; - /* "yt/utilities/lib/misc_utilities.pyx":589 + /* "yt/utilities/lib/misc_utilities.pyx":606 * inside = 1 * for n in range(3): * if (right_edges[i,n] - left_edge[n]) <= eps or \ # <<<<<<<<<<<<<< @@ -12313,7 +13082,7 @@ } __pyx_L9_break:; - /* "yt/utilities/lib/misc_utilities.pyx":593 + /* "yt/utilities/lib/misc_utilities.pyx":610 * inside = 0 * break * if inside == 1: mask[i] = 1 # <<<<<<<<<<<<<< @@ -12327,7 +13096,7 @@ goto __pyx_L13; } - /* "yt/utilities/lib/misc_utilities.pyx":594 + /* "yt/utilities/lib/misc_utilities.pyx":611 * break * if inside == 1: mask[i] = 1 * else: mask[i] = 0 # <<<<<<<<<<<<<< @@ -12342,7 +13111,7 @@ __pyx_L3_continue:; } - /* "yt/utilities/lib/misc_utilities.pyx":571 + /* "yt/utilities/lib/misc_utilities.pyx":588 * @cython.wraparound(False) * @cython.cdivision(True) * def get_box_grids_level(np.ndarray[np.float64_t, ndim=1] left_edge, # <<<<<<<<<<<<<< @@ -12386,7 +13155,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":599 +/* "yt/utilities/lib/misc_utilities.pyx":616 * @cython.wraparound(False) * @cython.cdivision(True) * def get_box_grids_below_level( # <<<<<<<<<<<<<< @@ -12417,13 +13186,21 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -12432,36 +13209,43 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, 1); __PYX_ERR(0, 599, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, 1); __PYX_ERR(0, 616, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, 2); __PYX_ERR(0, 599, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, 2); __PYX_ERR(0, 616, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, 3); __PYX_ERR(0, 599, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, 3); __PYX_ERR(0, 616, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, 4); __PYX_ERR(0, 599, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, 4); __PYX_ERR(0, 616, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, 5); __PYX_ERR(0, 599, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, 5); __PYX_ERR(0, 616, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, 6); __PYX_ERR(0, 599, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, 6); __PYX_ERR(0, 616, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_level); @@ -12469,11 +13253,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_box_grids_below_level") < 0)) __PYX_ERR(0, 599, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_box_grids_below_level") < 0)) __PYX_ERR(0, 616, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); @@ -12487,31 +13272,31 @@ } __pyx_v_left_edge = ((PyArrayObject *)values[0]); __pyx_v_right_edge = ((PyArrayObject *)values[1]); - __pyx_v_level = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 602, __pyx_L3_error) + __pyx_v_level = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) __pyx_v_left_edges = ((PyArrayObject *)values[3]); __pyx_v_right_edges = ((PyArrayObject *)values[4]); __pyx_v_levels = ((PyArrayObject *)values[5]); __pyx_v_mask = ((PyArrayObject *)values[6]); if (values[7]) { - __pyx_v_min_level = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_min_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 607, __pyx_L3_error) + __pyx_v_min_level = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_min_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L3_error) } else { __pyx_v_min_level = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 599, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_box_grids_below_level", 0, 7, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 616, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.get_box_grids_below_level", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 600, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 601, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 603, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 604, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 605, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 606, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 617, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 618, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 620, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 621, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 622, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 623, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_26get_box_grids_below_level(__pyx_self, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_level, __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_levels, __pyx_v_mask, __pyx_v_min_level); /* function exit code */ @@ -12593,36 +13378,36 @@ __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 599, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 616, __pyx_L1_error) } __pyx_pybuffernd_left_edge.diminfo[0].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edge.diminfo[0].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 599, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 616, __pyx_L1_error) } __pyx_pybuffernd_right_edge.diminfo[0].strides = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edge.diminfo[0].shape = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 599, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 616, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 599, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 616, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 599, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 616, __pyx_L1_error) } __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_levels.diminfo[1].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_levels.diminfo[1].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 599, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 616, __pyx_L1_error) } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/misc_utilities.pyx":609 + /* "yt/utilities/lib/misc_utilities.pyx":626 * int min_level = 0): * cdef int i, n * cdef int nx = left_edges.shape[0] # <<<<<<<<<<<<<< @@ -12631,21 +13416,21 @@ */ __pyx_v_nx = (__pyx_v_left_edges->dimensions[0]); - /* "yt/utilities/lib/misc_utilities.pyx":611 + /* "yt/utilities/lib/misc_utilities.pyx":628 * cdef int nx = left_edges.shape[0] * cdef int inside * cdef np.float64_t eps = np.finfo(np.float64).eps # <<<<<<<<<<<<<< * for i in range(nx): * mask[i] = 0 */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_finfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_finfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -12659,14 +13444,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __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(0, 611, __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, 628, __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; @@ -12675,33 +13460,33 @@ #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(0, 611, __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, 628, __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(0, 611, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __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(0, 611, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_eps = __pyx_t_6; - /* "yt/utilities/lib/misc_utilities.pyx":612 + /* "yt/utilities/lib/misc_utilities.pyx":629 * cdef int inside * cdef np.float64_t eps = np.finfo(np.float64).eps * for i in range(nx): # <<<<<<<<<<<<<< @@ -12712,7 +13497,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "yt/utilities/lib/misc_utilities.pyx":613 + /* "yt/utilities/lib/misc_utilities.pyx":630 * cdef np.float64_t eps = np.finfo(np.float64).eps * for i in range(nx): * mask[i] = 0 # <<<<<<<<<<<<<< @@ -12722,7 +13507,7 @@ __pyx_t_9 = __pyx_v_i; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_mask.diminfo[0].strides) = 0; - /* "yt/utilities/lib/misc_utilities.pyx":614 + /* "yt/utilities/lib/misc_utilities.pyx":631 * for i in range(nx): * mask[i] = 0 * if levels[i,0] <= level and levels[i,0] >= min_level: # <<<<<<<<<<<<<< @@ -12744,7 +13529,7 @@ __pyx_L6_bool_binop_done:; if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":615 + /* "yt/utilities/lib/misc_utilities.pyx":632 * mask[i] = 0 * if levels[i,0] <= level and levels[i,0] >= min_level: * inside = 1 # <<<<<<<<<<<<<< @@ -12753,7 +13538,7 @@ */ __pyx_v_inside = 1; - /* "yt/utilities/lib/misc_utilities.pyx":616 + /* "yt/utilities/lib/misc_utilities.pyx":633 * if levels[i,0] <= level and levels[i,0] >= min_level: * inside = 1 * for n in range(3): # <<<<<<<<<<<<<< @@ -12763,7 +13548,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_n = __pyx_t_16; - /* "yt/utilities/lib/misc_utilities.pyx":617 + /* "yt/utilities/lib/misc_utilities.pyx":634 * inside = 1 * for n in range(3): * if (right_edges[i,n] - left_edge[n]) <= eps or \ # <<<<<<<<<<<<<< @@ -12780,7 +13565,7 @@ goto __pyx_L11_bool_binop_done; } - /* "yt/utilities/lib/misc_utilities.pyx":618 + /* "yt/utilities/lib/misc_utilities.pyx":635 * for n in range(3): * if (right_edges[i,n] - left_edge[n]) <= eps or \ * (right_edge[n] - left_edges[i,n]) <= eps: # <<<<<<<<<<<<<< @@ -12794,7 +13579,7 @@ __pyx_t_10 = __pyx_t_13; __pyx_L11_bool_binop_done:; - /* "yt/utilities/lib/misc_utilities.pyx":617 + /* "yt/utilities/lib/misc_utilities.pyx":634 * inside = 1 * for n in range(3): * if (right_edges[i,n] - left_edge[n]) <= eps or \ # <<<<<<<<<<<<<< @@ -12803,7 +13588,7 @@ */ if (__pyx_t_10) { - /* "yt/utilities/lib/misc_utilities.pyx":619 + /* "yt/utilities/lib/misc_utilities.pyx":636 * if (right_edges[i,n] - left_edge[n]) <= eps or \ * (right_edge[n] - left_edges[i,n]) <= eps: * inside = 0 # <<<<<<<<<<<<<< @@ -12812,7 +13597,7 @@ */ __pyx_v_inside = 0; - /* "yt/utilities/lib/misc_utilities.pyx":620 + /* "yt/utilities/lib/misc_utilities.pyx":637 * (right_edge[n] - left_edges[i,n]) <= eps: * inside = 0 * break # <<<<<<<<<<<<<< @@ -12821,7 +13606,7 @@ */ goto __pyx_L9_break; - /* "yt/utilities/lib/misc_utilities.pyx":617 + /* "yt/utilities/lib/misc_utilities.pyx":634 * inside = 1 * for n in range(3): * if (right_edges[i,n] - left_edge[n]) <= eps or \ # <<<<<<<<<<<<<< @@ -12832,7 +13617,7 @@ } __pyx_L9_break:; - /* "yt/utilities/lib/misc_utilities.pyx":621 + /* "yt/utilities/lib/misc_utilities.pyx":638 * inside = 0 * break * if inside == 1: mask[i] = 1 # <<<<<<<<<<<<<< @@ -12845,7 +13630,7 @@ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_mask.diminfo[0].strides) = 1; } - /* "yt/utilities/lib/misc_utilities.pyx":614 + /* "yt/utilities/lib/misc_utilities.pyx":631 * for i in range(nx): * mask[i] = 0 * if levels[i,0] <= level and levels[i,0] >= min_level: # <<<<<<<<<<<<<< @@ -12855,7 +13640,7 @@ } } - /* "yt/utilities/lib/misc_utilities.pyx":599 + /* "yt/utilities/lib/misc_utilities.pyx":616 * @cython.wraparound(False) * @cython.cdivision(True) * def get_box_grids_below_level( # <<<<<<<<<<<<<< @@ -12899,7 +13684,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":626 +/* "yt/utilities/lib/misc_utilities.pyx":643 * @cython.wraparound(False) * @cython.cdivision(True) * def find_values_at_point(np.ndarray[np.float64_t, ndim=1] point, # <<<<<<<<<<<<<< @@ -12928,11 +13713,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -12941,34 +13732,39 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 1); __PYX_ERR(0, 626, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 1); __PYX_ERR(0, 643, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 2); __PYX_ERR(0, 626, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 2); __PYX_ERR(0, 643, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dimensions)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 3); __PYX_ERR(0, 626, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 3); __PYX_ERR(0, 643, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_names)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 4); __PYX_ERR(0, 626, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 4); __PYX_ERR(0, 643, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid_objects)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 5); __PYX_ERR(0, 626, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, 5); __PYX_ERR(0, 643, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_values_at_point") < 0)) __PYX_ERR(0, 626, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_values_at_point") < 0)) __PYX_ERR(0, 643, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -12989,16 +13785,16 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 626, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_values_at_point", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 643, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.find_values_at_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_point), __pyx_ptype_5numpy_ndarray, 1, "point", 0))) __PYX_ERR(0, 626, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 627, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 628, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dimensions), __pyx_ptype_5numpy_ndarray, 1, "dimensions", 0))) __PYX_ERR(0, 629, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_point), __pyx_ptype_5numpy_ndarray, 1, "point", 0))) __PYX_ERR(0, 643, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 644, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 645, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dimensions), __pyx_ptype_5numpy_ndarray, 1, "dimensions", 0))) __PYX_ERR(0, 646, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_28find_values_at_point(__pyx_self, __pyx_v_point, __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_dimensions, __pyx_v_field_names, __pyx_v_grid_objects); /* function exit code */ @@ -13107,69 +13903,69 @@ __pyx_pybuffernd_dimensions.rcbuffer = &__pyx_pybuffer_dimensions; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_point.rcbuffer->pybuffer, (PyObject*)__pyx_v_point, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_point.rcbuffer->pybuffer, (PyObject*)__pyx_v_point, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 643, __pyx_L1_error) } __pyx_pybuffernd_point.diminfo[0].strides = __pyx_pybuffernd_point.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_point.diminfo[0].shape = __pyx_pybuffernd_point.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 643, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 643, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer, (PyObject*)__pyx_v_dimensions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer, (PyObject*)__pyx_v_dimensions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 643, __pyx_L1_error) } __pyx_pybuffernd_dimensions.diminfo[0].strides = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dimensions.diminfo[0].shape = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dimensions.diminfo[1].strides = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dimensions.diminfo[1].shape = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/misc_utilities.pyx":637 + /* "yt/utilities/lib/misc_utilities.pyx":654 * # strings and whatnot, but they should not be terribly slow. * cdef int ind[3] * cdef int gi, fi, nf = len(field_names) # <<<<<<<<<<<<<< * cdef np.float64_t dds * cdef np.ndarray[np.float64_t, ndim=3] field */ - __pyx_t_1 = PyObject_Length(__pyx_v_field_names); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_1 = PyObject_Length(__pyx_v_field_names); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 654, __pyx_L1_error) __pyx_v_nf = __pyx_t_1; - /* "yt/utilities/lib/misc_utilities.pyx":640 + /* "yt/utilities/lib/misc_utilities.pyx":657 * cdef np.float64_t dds * cdef np.ndarray[np.float64_t, ndim=3] field * cdef np.ndarray[np.float64_t, ndim=1] rv = np.zeros(nf, dtype='float64') # <<<<<<<<<<<<<< * for gi in range(left_edges.shape[0]): * if not ((left_edges[gi,0] < point[0] < right_edges[gi,0]) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 640, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 640, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_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, 640, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 657, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rv.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_rv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_rv.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 640, __pyx_L1_error) + __PYX_ERR(0, 657, __pyx_L1_error) } else {__pyx_pybuffernd_rv.diminfo[0].strides = __pyx_pybuffernd_rv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rv.diminfo[0].shape = __pyx_pybuffernd_rv.rcbuffer->pybuffer.shape[0]; } } @@ -13177,7 +13973,7 @@ __pyx_v_rv = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":641 + /* "yt/utilities/lib/misc_utilities.pyx":658 * cdef np.ndarray[np.float64_t, ndim=3] field * cdef np.ndarray[np.float64_t, ndim=1] rv = np.zeros(nf, dtype='float64') * for gi in range(left_edges.shape[0]): # <<<<<<<<<<<<<< @@ -13188,7 +13984,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_gi = __pyx_t_8; - /* "yt/utilities/lib/misc_utilities.pyx":642 + /* "yt/utilities/lib/misc_utilities.pyx":659 * cdef np.ndarray[np.float64_t, ndim=1] rv = np.zeros(nf, dtype='float64') * for gi in range(left_edges.shape[0]): * if not ((left_edges[gi,0] < point[0] < right_edges[gi,0]) # <<<<<<<<<<<<<< @@ -13212,7 +14008,7 @@ goto __pyx_L6_bool_binop_done; } - /* "yt/utilities/lib/misc_utilities.pyx":643 + /* "yt/utilities/lib/misc_utilities.pyx":660 * for gi in range(left_edges.shape[0]): * if not ((left_edges[gi,0] < point[0] < right_edges[gi,0]) * and (left_edges[gi,1] < point[1] < right_edges[gi,1]) # <<<<<<<<<<<<<< @@ -13236,7 +14032,7 @@ goto __pyx_L6_bool_binop_done; } - /* "yt/utilities/lib/misc_utilities.pyx":644 + /* "yt/utilities/lib/misc_utilities.pyx":661 * if not ((left_edges[gi,0] < point[0] < right_edges[gi,0]) * and (left_edges[gi,1] < point[1] < right_edges[gi,1]) * and (left_edges[gi,2] < point[2] < right_edges[gi,2])): # <<<<<<<<<<<<<< @@ -13257,7 +14053,7 @@ __pyx_t_9 = __pyx_t_17; __pyx_L6_bool_binop_done:; - /* "yt/utilities/lib/misc_utilities.pyx":642 + /* "yt/utilities/lib/misc_utilities.pyx":659 * cdef np.ndarray[np.float64_t, ndim=1] rv = np.zeros(nf, dtype='float64') * for gi in range(left_edges.shape[0]): * if not ((left_edges[gi,0] < point[0] < right_edges[gi,0]) # <<<<<<<<<<<<<< @@ -13267,7 +14063,7 @@ __pyx_t_17 = ((!__pyx_t_9) != 0); if (__pyx_t_17) { - /* "yt/utilities/lib/misc_utilities.pyx":645 + /* "yt/utilities/lib/misc_utilities.pyx":662 * and (left_edges[gi,1] < point[1] < right_edges[gi,1]) * and (left_edges[gi,2] < point[2] < right_edges[gi,2])): * continue # <<<<<<<<<<<<<< @@ -13276,7 +14072,7 @@ */ goto __pyx_L3_continue; - /* "yt/utilities/lib/misc_utilities.pyx":642 + /* "yt/utilities/lib/misc_utilities.pyx":659 * cdef np.ndarray[np.float64_t, ndim=1] rv = np.zeros(nf, dtype='float64') * for gi in range(left_edges.shape[0]): * if not ((left_edges[gi,0] < point[0] < right_edges[gi,0]) # <<<<<<<<<<<<<< @@ -13285,7 +14081,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":647 + /* "yt/utilities/lib/misc_utilities.pyx":664 * continue * # We found our grid! * for fi in range(3): # <<<<<<<<<<<<<< @@ -13295,7 +14091,7 @@ for (__pyx_t_28 = 0; __pyx_t_28 < 3; __pyx_t_28+=1) { __pyx_v_fi = __pyx_t_28; - /* "yt/utilities/lib/misc_utilities.pyx":648 + /* "yt/utilities/lib/misc_utilities.pyx":665 * # We found our grid! * for fi in range(3): * dds = ((right_edges[gi,fi] - left_edges[gi,fi])/ # <<<<<<<<<<<<<< @@ -13307,7 +14103,7 @@ __pyx_t_31 = __pyx_v_gi; __pyx_t_32 = __pyx_v_fi; - /* "yt/utilities/lib/misc_utilities.pyx":649 + /* "yt/utilities/lib/misc_utilities.pyx":666 * for fi in range(3): * dds = ((right_edges[gi,fi] - left_edges[gi,fi])/ * ( dimensions[gi,fi])) # <<<<<<<<<<<<<< @@ -13317,7 +14113,7 @@ __pyx_t_33 = __pyx_v_gi; __pyx_t_34 = __pyx_v_fi; - /* "yt/utilities/lib/misc_utilities.pyx":648 + /* "yt/utilities/lib/misc_utilities.pyx":665 * # We found our grid! * for fi in range(3): * dds = ((right_edges[gi,fi] - left_edges[gi,fi])/ # <<<<<<<<<<<<<< @@ -13326,7 +14122,7 @@ */ __pyx_v_dds = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right_edges.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_right_edges.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_left_edges.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_left_edges.diminfo[1].strides))) / ((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_dimensions.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_dimensions.diminfo[1].strides)))); - /* "yt/utilities/lib/misc_utilities.pyx":650 + /* "yt/utilities/lib/misc_utilities.pyx":667 * dds = ((right_edges[gi,fi] - left_edges[gi,fi])/ * ( dimensions[gi,fi])) * ind[fi] = ((point[fi] - left_edges[gi,fi])/dds) # <<<<<<<<<<<<<< @@ -13339,19 +14135,19 @@ (__pyx_v_ind[__pyx_v_fi]) = ((int)(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_point.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_point.diminfo[0].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left_edges.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_left_edges.diminfo[1].strides))) / __pyx_v_dds)); } - /* "yt/utilities/lib/misc_utilities.pyx":651 + /* "yt/utilities/lib/misc_utilities.pyx":668 * ( dimensions[gi,fi])) * ind[fi] = ((point[fi] - left_edges[gi,fi])/dds) * grid = grid_objects[gi] # <<<<<<<<<<<<<< * for fi in range(nf): * field = grid[field_names[fi]] */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_grid_objects, __pyx_v_gi, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 651, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_grid_objects, __pyx_v_gi, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_grid = __pyx_t_5; __pyx_t_5 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":652 + /* "yt/utilities/lib/misc_utilities.pyx":669 * ind[fi] = ((point[fi] - left_edges[gi,fi])/dds) * grid = grid_objects[gi] * for fi in range(nf): # <<<<<<<<<<<<<< @@ -13362,19 +14158,19 @@ for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_28; __pyx_t_38+=1) { __pyx_v_fi = __pyx_t_38; - /* "yt/utilities/lib/misc_utilities.pyx":653 + /* "yt/utilities/lib/misc_utilities.pyx":670 * grid = grid_objects[gi] * for fi in range(nf): * field = grid[field_names[fi]] # <<<<<<<<<<<<<< * rv[fi] = field[ind[0], ind[1], ind[2]] * return rv */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_field_names, __pyx_v_fi, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 653, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_field_names, __pyx_v_fi, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_GetItem(__pyx_v_grid, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_grid, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 653, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_t_39 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -13390,13 +14186,13 @@ } } __pyx_pybuffernd_field.diminfo[0].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field.diminfo[0].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_field.diminfo[1].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_field.diminfo[1].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_field.diminfo[2].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_field.diminfo[2].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_40 < 0)) __PYX_ERR(0, 653, __pyx_L1_error) + if (unlikely(__pyx_t_40 < 0)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_t_39 = 0; __Pyx_XDECREF_SET(__pyx_v_field, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":654 + /* "yt/utilities/lib/misc_utilities.pyx":671 * for fi in range(nf): * field = grid[field_names[fi]] * rv[fi] = field[ind[0], ind[1], ind[2]] # <<<<<<<<<<<<<< @@ -13410,7 +14206,7 @@ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rv.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_rv.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_field.diminfo[1].strides, __pyx_t_46, __pyx_pybuffernd_field.diminfo[2].strides)); } - /* "yt/utilities/lib/misc_utilities.pyx":655 + /* "yt/utilities/lib/misc_utilities.pyx":672 * field = grid[field_names[fi]] * rv[fi] = field[ind[0], ind[1], ind[2]] * return rv # <<<<<<<<<<<<<< @@ -13424,7 +14220,7 @@ __pyx_L3_continue:; } - /* "yt/utilities/lib/misc_utilities.pyx":656 + /* "yt/utilities/lib/misc_utilities.pyx":673 * rv[fi] = field[ind[0], ind[1], ind[2]] * return rv * raise KeyError # <<<<<<<<<<<<<< @@ -13432,9 +14228,9 @@ * #@cython.cdivision(True) */ __Pyx_Raise(__pyx_builtin_KeyError, 0, 0, 0); - __PYX_ERR(0, 656, __pyx_L1_error) + __PYX_ERR(0, 673, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":626 + /* "yt/utilities/lib/misc_utilities.pyx":643 * @cython.wraparound(False) * @cython.cdivision(True) * def find_values_at_point(np.ndarray[np.float64_t, ndim=1] point, # <<<<<<<<<<<<<< @@ -13478,7 +14274,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":661 +/* "yt/utilities/lib/misc_utilities.pyx":678 * #@cython.boundscheck(False) * #@cython.wraparound(False) * def obtain_rvec(data): # <<<<<<<<<<<<<< @@ -13625,71 +14421,71 @@ __pyx_pybuffernd_rg.data = NULL; __pyx_pybuffernd_rg.rcbuffer = &__pyx_pybuffer_rg; - /* "yt/utilities/lib/misc_utilities.pyx":674 + /* "yt/utilities/lib/misc_utilities.pyx":691 * cdef np.float64_t c[3] * cdef int i, j, k * center = data.get_field_parameter("center") # <<<<<<<<<<<<<< * c[0] = center[0]; c[1] = center[1]; c[2] = center[2] * if len(data['x'].shape) == 1: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_get_field_parameter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_get_field_parameter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_center = __pyx_t_2; __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":675 + /* "yt/utilities/lib/misc_utilities.pyx":692 * cdef int i, j, k * center = data.get_field_parameter("center") * c[0] = center[0]; c[1] = center[1]; c[2] = center[2] # <<<<<<<<<<<<<< * if len(data['x'].shape) == 1: * # One dimensional data */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_c[0]) = __pyx_t_3; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_c[1]) = __pyx_t_3; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_center, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_c[2]) = __pyx_t_3; - /* "yt/utilities/lib/misc_utilities.pyx":676 + /* "yt/utilities/lib/misc_utilities.pyx":693 * center = data.get_field_parameter("center") * c[0] = center[0]; c[1] = center[1]; c[2] = center[2] * if len(data['x'].shape) == 1: # <<<<<<<<<<<<<< * # One dimensional data * xf = data['x'] */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __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, 676, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = ((__pyx_t_4 == 1) != 0); if (__pyx_t_5) { - /* "yt/utilities/lib/misc_utilities.pyx":678 + /* "yt/utilities/lib/misc_utilities.pyx":695 * if len(data['x'].shape) == 1: * # One dimensional data * xf = data['x'] # <<<<<<<<<<<<<< * yf = data['y'] * zf = data['z'] */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 678, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 695, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -13705,22 +14501,22 @@ } } __pyx_pybuffernd_xf.diminfo[0].strides = __pyx_pybuffernd_xf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xf.diminfo[0].shape = __pyx_pybuffernd_xf.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 678, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 695, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_xf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":679 + /* "yt/utilities/lib/misc_utilities.pyx":696 * # One dimensional data * xf = data['x'] * yf = data['y'] # <<<<<<<<<<<<<< * zf = data['z'] * rf = YTArray(np.empty((3, xf.shape[0]), 'float64'), xf.units) */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 679, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 696, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -13736,22 +14532,22 @@ } } __pyx_pybuffernd_yf.diminfo[0].strides = __pyx_pybuffernd_yf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yf.diminfo[0].shape = __pyx_pybuffernd_yf.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 696, __pyx_L1_error) } __pyx_t_11 = 0; __pyx_v_yf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":680 + /* "yt/utilities/lib/misc_utilities.pyx":697 * xf = data['x'] * yf = data['y'] * zf = data['z'] # <<<<<<<<<<<<<< * rf = YTArray(np.empty((3, xf.shape[0]), 'float64'), xf.units) * for i in range(xf.shape[0]): */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 680, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 697, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -13767,29 +14563,29 @@ } } __pyx_pybuffernd_zf.diminfo[0].strides = __pyx_pybuffernd_zf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_zf.diminfo[0].shape = __pyx_pybuffernd_zf.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 680, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 697, __pyx_L1_error) } __pyx_t_12 = 0; __pyx_v_zf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":681 + /* "yt/utilities/lib/misc_utilities.pyx":698 * yf = data['y'] * zf = data['z'] * rf = YTArray(np.empty((3, xf.shape[0]), 'float64'), xf.units) # <<<<<<<<<<<<<< * for i in range(xf.shape[0]): * rf[0, i] = xf[i] - c[0] */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xf->dimensions[0])); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xf->dimensions[0])); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); @@ -13812,7 +14608,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_16, __pyx_n_s_float64}; - __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; @@ -13821,14 +14617,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_16, __pyx_n_s_float64}; - __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { - __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_14); __pyx_t_14 = NULL; @@ -13839,12 +14635,12 @@ __Pyx_GIVEREF(__pyx_n_s_float64); PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_7, __pyx_n_s_float64); __pyx_t_16 = 0; - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xf), __pyx_n_s_units); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xf), __pyx_n_s_units); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_17 = NULL; __pyx_t_7 = 0; @@ -13861,7 +14657,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_13, __pyx_t_15}; - __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, 681, __pyx_L1_error) + __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, 698, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; @@ -13871,7 +14667,7 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_13, __pyx_t_15}; - __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, 681, __pyx_L1_error) + __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, 698, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; @@ -13879,7 +14675,7 @@ } else #endif { - __pyx_t_16 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_16 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_17) { __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_17); __pyx_t_17 = NULL; @@ -13890,12 +14686,12 @@ PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_7, __pyx_t_15); __pyx_t_13 = 0; __pyx_t_15 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __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, 681, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 698, __pyx_L1_error) __pyx_t_18 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -13911,13 +14707,13 @@ } } __pyx_pybuffernd_rf.diminfo[0].strides = __pyx_pybuffernd_rf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rf.diminfo[0].shape = __pyx_pybuffernd_rf.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rf.diminfo[1].strides = __pyx_pybuffernd_rf.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rf.diminfo[1].shape = __pyx_pybuffernd_rf.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 681, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 698, __pyx_L1_error) } __pyx_t_18 = 0; __pyx_v_rf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":682 + /* "yt/utilities/lib/misc_utilities.pyx":699 * zf = data['z'] * rf = YTArray(np.empty((3, xf.shape[0]), 'float64'), xf.units) * for i in range(xf.shape[0]): # <<<<<<<<<<<<<< @@ -13928,7 +14724,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_19; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/misc_utilities.pyx":683 + /* "yt/utilities/lib/misc_utilities.pyx":700 * rf = YTArray(np.empty((3, xf.shape[0]), 'float64'), xf.units) * for i in range(xf.shape[0]): * rf[0, i] = xf[i] - c[0] # <<<<<<<<<<<<<< @@ -13943,7 +14739,7 @@ } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_xf.diminfo[0].shape)) __pyx_t_21 = 0; if (unlikely(__pyx_t_21 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 683, __pyx_L1_error) + __PYX_ERR(0, 700, __pyx_L1_error) } __pyx_t_22 = 0; __pyx_t_23 = __pyx_v_i; @@ -13958,11 +14754,11 @@ } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_rf.diminfo[1].shape)) __pyx_t_21 = 1; if (unlikely(__pyx_t_21 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 683, __pyx_L1_error) + __PYX_ERR(0, 700, __pyx_L1_error) } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rf.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rf.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_rf.diminfo[1].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_xf.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_xf.diminfo[0].strides)) - (__pyx_v_c[0])); - /* "yt/utilities/lib/misc_utilities.pyx":684 + /* "yt/utilities/lib/misc_utilities.pyx":701 * for i in range(xf.shape[0]): * rf[0, i] = xf[i] - c[0] * rf[1, i] = yf[i] - c[1] # <<<<<<<<<<<<<< @@ -13977,7 +14773,7 @@ } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_yf.diminfo[0].shape)) __pyx_t_21 = 0; if (unlikely(__pyx_t_21 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 684, __pyx_L1_error) + __PYX_ERR(0, 701, __pyx_L1_error) } __pyx_t_25 = 1; __pyx_t_26 = __pyx_v_i; @@ -13992,11 +14788,11 @@ } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_rf.diminfo[1].shape)) __pyx_t_21 = 1; if (unlikely(__pyx_t_21 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 684, __pyx_L1_error) + __PYX_ERR(0, 701, __pyx_L1_error) } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rf.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_rf.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_rf.diminfo[1].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_yf.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_yf.diminfo[0].strides)) - (__pyx_v_c[1])); - /* "yt/utilities/lib/misc_utilities.pyx":685 + /* "yt/utilities/lib/misc_utilities.pyx":702 * rf[0, i] = xf[i] - c[0] * rf[1, i] = yf[i] - c[1] * rf[2, i] = zf[i] - c[2] # <<<<<<<<<<<<<< @@ -14011,7 +14807,7 @@ } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_zf.diminfo[0].shape)) __pyx_t_21 = 0; if (unlikely(__pyx_t_21 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 685, __pyx_L1_error) + __PYX_ERR(0, 702, __pyx_L1_error) } __pyx_t_28 = 2; __pyx_t_29 = __pyx_v_i; @@ -14026,12 +14822,12 @@ } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_rf.diminfo[1].shape)) __pyx_t_21 = 1; if (unlikely(__pyx_t_21 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 685, __pyx_L1_error) + __PYX_ERR(0, 702, __pyx_L1_error) } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rf.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rf.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_rf.diminfo[1].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zf.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_zf.diminfo[0].strides)) - (__pyx_v_c[2])); } - /* "yt/utilities/lib/misc_utilities.pyx":686 + /* "yt/utilities/lib/misc_utilities.pyx":703 * rf[1, i] = yf[i] - c[1] * rf[2, i] = zf[i] - c[2] * return rf # <<<<<<<<<<<<<< @@ -14043,7 +14839,7 @@ __pyx_r = ((PyObject *)__pyx_v_rf); goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":676 + /* "yt/utilities/lib/misc_utilities.pyx":693 * center = data.get_field_parameter("center") * c[0] = center[0]; c[1] = center[1]; c[2] = center[2] * if len(data['x'].shape) == 1: # <<<<<<<<<<<<<< @@ -14052,7 +14848,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":689 + /* "yt/utilities/lib/misc_utilities.pyx":706 * else: * # Three dimensional data * xg = data['x'] # <<<<<<<<<<<<<< @@ -14060,9 +14856,9 @@ * zg = data['z'] */ /*else*/ { - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 689, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 706, __pyx_L1_error) __pyx_t_30 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -14078,22 +14874,22 @@ } } __pyx_pybuffernd_xg.diminfo[0].strides = __pyx_pybuffernd_xg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xg.diminfo[0].shape = __pyx_pybuffernd_xg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_xg.diminfo[1].strides = __pyx_pybuffernd_xg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_xg.diminfo[1].shape = __pyx_pybuffernd_xg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_xg.diminfo[2].strides = __pyx_pybuffernd_xg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_xg.diminfo[2].shape = __pyx_pybuffernd_xg.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 689, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 706, __pyx_L1_error) } __pyx_t_30 = 0; __pyx_v_xg = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":690 + /* "yt/utilities/lib/misc_utilities.pyx":707 * # Three dimensional data * xg = data['x'] * yg = data['y'] # <<<<<<<<<<<<<< * zg = data['z'] * shape = (3, xg.shape[0], xg.shape[1], xg.shape[2]) */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 690, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 707, __pyx_L1_error) __pyx_t_31 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -14109,22 +14905,22 @@ } } __pyx_pybuffernd_yg.diminfo[0].strides = __pyx_pybuffernd_yg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yg.diminfo[0].shape = __pyx_pybuffernd_yg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_yg.diminfo[1].strides = __pyx_pybuffernd_yg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_yg.diminfo[1].shape = __pyx_pybuffernd_yg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_yg.diminfo[2].strides = __pyx_pybuffernd_yg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_yg.diminfo[2].shape = __pyx_pybuffernd_yg.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 690, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 707, __pyx_L1_error) } __pyx_t_31 = 0; __pyx_v_yg = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":691 + /* "yt/utilities/lib/misc_utilities.pyx":708 * xg = data['x'] * yg = data['y'] * zg = data['z'] # <<<<<<<<<<<<<< * shape = (3, xg.shape[0], xg.shape[1], xg.shape[2]) * rg = YTArray(np.empty(shape, 'float64'), xg.units) */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 691, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 708, __pyx_L1_error) __pyx_t_32 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -14140,26 +14936,26 @@ } } __pyx_pybuffernd_zg.diminfo[0].strides = __pyx_pybuffernd_zg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_zg.diminfo[0].shape = __pyx_pybuffernd_zg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_zg.diminfo[1].strides = __pyx_pybuffernd_zg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_zg.diminfo[1].shape = __pyx_pybuffernd_zg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_zg.diminfo[2].strides = __pyx_pybuffernd_zg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_zg.diminfo[2].shape = __pyx_pybuffernd_zg.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 691, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 708, __pyx_L1_error) } __pyx_t_32 = 0; __pyx_v_zg = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":692 + /* "yt/utilities/lib/misc_utilities.pyx":709 * yg = data['y'] * zg = data['z'] * shape = (3, xg.shape[0], xg.shape[1], xg.shape[2]) # <<<<<<<<<<<<<< * rg = YTArray(np.empty(shape, 'float64'), xg.units) * #rg = YTArray(rg, xg.units) */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xg->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xg->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xg->dimensions[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xg->dimensions[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_16 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xg->dimensions[2])); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_xg->dimensions[2])); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); @@ -14176,18 +14972,18 @@ __pyx_v_shape = __pyx_t_15; __pyx_t_15 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":693 + /* "yt/utilities/lib/misc_utilities.pyx":710 * zg = data['z'] * shape = (3, xg.shape[0], xg.shape[1], xg.shape[2]) * rg = YTArray(np.empty(shape, 'float64'), xg.units) # <<<<<<<<<<<<<< * #rg = YTArray(rg, xg.units) * for i in range(xg.shape[0]): */ - __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTArray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTArray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -14205,7 +15001,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_shape, __pyx_n_s_float64}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -14213,13 +15009,13 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_shape, __pyx_n_s_float64}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -14230,12 +15026,12 @@ __Pyx_INCREF(__pyx_n_s_float64); __Pyx_GIVEREF(__pyx_n_s_float64); PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_7, __pyx_n_s_float64); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xg), __pyx_n_s_units); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xg), __pyx_n_s_units); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_17 = NULL; __pyx_t_7 = 0; @@ -14252,7 +15048,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_16)) { PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_2, __pyx_t_13}; - __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -14262,7 +15058,7 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_16)) { PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_2, __pyx_t_13}; - __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -14270,7 +15066,7 @@ } else #endif { - __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_17) { __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_17); __pyx_t_17 = NULL; @@ -14281,12 +15077,12 @@ PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_t_13); __pyx_t_2 = 0; __pyx_t_13 = 0; - __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_1, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_1, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 693, __pyx_L1_error) + if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 710, __pyx_L1_error) __pyx_t_33 = ((PyArrayObject *)__pyx_t_15); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -14302,13 +15098,13 @@ } } __pyx_pybuffernd_rg.diminfo[0].strides = __pyx_pybuffernd_rg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rg.diminfo[0].shape = __pyx_pybuffernd_rg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rg.diminfo[1].strides = __pyx_pybuffernd_rg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rg.diminfo[1].shape = __pyx_pybuffernd_rg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_rg.diminfo[2].strides = __pyx_pybuffernd_rg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_rg.diminfo[2].shape = __pyx_pybuffernd_rg.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_rg.diminfo[3].strides = __pyx_pybuffernd_rg.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_rg.diminfo[3].shape = __pyx_pybuffernd_rg.rcbuffer->pybuffer.shape[3]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 693, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 710, __pyx_L1_error) } __pyx_t_33 = 0; __pyx_v_rg = ((PyArrayObject *)__pyx_t_15); __pyx_t_15 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":695 + /* "yt/utilities/lib/misc_utilities.pyx":712 * rg = YTArray(np.empty(shape, 'float64'), xg.units) * #rg = YTArray(rg, xg.units) * for i in range(xg.shape[0]): # <<<<<<<<<<<<<< @@ -14319,7 +15115,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_19; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/misc_utilities.pyx":696 + /* "yt/utilities/lib/misc_utilities.pyx":713 * #rg = YTArray(rg, xg.units) * for i in range(xg.shape[0]): * for j in range(xg.shape[1]): # <<<<<<<<<<<<<< @@ -14330,7 +15126,7 @@ for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_34; __pyx_t_21+=1) { __pyx_v_j = __pyx_t_21; - /* "yt/utilities/lib/misc_utilities.pyx":697 + /* "yt/utilities/lib/misc_utilities.pyx":714 * for i in range(xg.shape[0]): * for j in range(xg.shape[1]): * for k in range(xg.shape[2]): # <<<<<<<<<<<<<< @@ -14341,7 +15137,7 @@ for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "yt/utilities/lib/misc_utilities.pyx":698 + /* "yt/utilities/lib/misc_utilities.pyx":715 * for j in range(xg.shape[1]): * for k in range(xg.shape[2]): * rg[0,i,j,k] = xg[i,j,k] - c[0] # <<<<<<<<<<<<<< @@ -14366,7 +15162,7 @@ } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_xg.diminfo[2].shape)) __pyx_t_40 = 2; if (unlikely(__pyx_t_40 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_40); - __PYX_ERR(0, 698, __pyx_L1_error) + __PYX_ERR(0, 715, __pyx_L1_error) } __pyx_t_41 = 0; __pyx_t_42 = __pyx_v_i; @@ -14391,11 +15187,11 @@ } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_rg.diminfo[3].shape)) __pyx_t_40 = 3; if (unlikely(__pyx_t_40 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_40); - __PYX_ERR(0, 698, __pyx_L1_error) + __PYX_ERR(0, 715, __pyx_L1_error) } *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rg.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_rg.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_rg.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_rg.diminfo[2].strides, __pyx_t_44, __pyx_pybuffernd_rg.diminfo[3].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_xg.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_xg.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_xg.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_xg.diminfo[2].strides)) - (__pyx_v_c[0])); - /* "yt/utilities/lib/misc_utilities.pyx":699 + /* "yt/utilities/lib/misc_utilities.pyx":716 * for k in range(xg.shape[2]): * rg[0,i,j,k] = xg[i,j,k] - c[0] * rg[1,i,j,k] = yg[i,j,k] - c[1] # <<<<<<<<<<<<<< @@ -14420,7 +15216,7 @@ } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_yg.diminfo[2].shape)) __pyx_t_40 = 2; if (unlikely(__pyx_t_40 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_40); - __PYX_ERR(0, 699, __pyx_L1_error) + __PYX_ERR(0, 716, __pyx_L1_error) } __pyx_t_48 = 1; __pyx_t_49 = __pyx_v_i; @@ -14445,11 +15241,11 @@ } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_rg.diminfo[3].shape)) __pyx_t_40 = 3; if (unlikely(__pyx_t_40 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_40); - __PYX_ERR(0, 699, __pyx_L1_error) + __PYX_ERR(0, 716, __pyx_L1_error) } *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rg.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rg.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_rg.diminfo[1].strides, __pyx_t_50, __pyx_pybuffernd_rg.diminfo[2].strides, __pyx_t_51, __pyx_pybuffernd_rg.diminfo[3].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_yg.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_yg.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_yg.diminfo[1].strides, __pyx_t_47, __pyx_pybuffernd_yg.diminfo[2].strides)) - (__pyx_v_c[1])); - /* "yt/utilities/lib/misc_utilities.pyx":700 + /* "yt/utilities/lib/misc_utilities.pyx":717 * rg[0,i,j,k] = xg[i,j,k] - c[0] * rg[1,i,j,k] = yg[i,j,k] - c[1] * rg[2,i,j,k] = zg[i,j,k] - c[2] # <<<<<<<<<<<<<< @@ -14474,7 +15270,7 @@ } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_zg.diminfo[2].shape)) __pyx_t_40 = 2; if (unlikely(__pyx_t_40 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_40); - __PYX_ERR(0, 700, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) } __pyx_t_55 = 2; __pyx_t_56 = __pyx_v_i; @@ -14499,14 +15295,14 @@ } else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_rg.diminfo[3].shape)) __pyx_t_40 = 3; if (unlikely(__pyx_t_40 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_40); - __PYX_ERR(0, 700, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) } *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rg.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_rg.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_rg.diminfo[1].strides, __pyx_t_57, __pyx_pybuffernd_rg.diminfo[2].strides, __pyx_t_58, __pyx_pybuffernd_rg.diminfo[3].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_zg.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_zg.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_zg.diminfo[1].strides, __pyx_t_54, __pyx_pybuffernd_zg.diminfo[2].strides)) - (__pyx_v_c[2])); } } } - /* "yt/utilities/lib/misc_utilities.pyx":701 + /* "yt/utilities/lib/misc_utilities.pyx":718 * rg[1,i,j,k] = yg[i,j,k] - c[1] * rg[2,i,j,k] = zg[i,j,k] - c[2] * return rg # <<<<<<<<<<<<<< @@ -14519,7 +15315,7 @@ goto __pyx_L0; } - /* "yt/utilities/lib/misc_utilities.pyx":661 + /* "yt/utilities/lib/misc_utilities.pyx":678 * #@cython.boundscheck(False) * #@cython.wraparound(False) * def obtain_rvec(data): # <<<<<<<<<<<<<< @@ -14577,7 +15373,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":706 +/* "yt/utilities/lib/misc_utilities.pyx":723 * @cython.wraparound(False) * @cython.cdivision(True) * def obtain_rv_vec(data, field_names = ("velocity_x", # <<<<<<<<<<<<<< @@ -14605,8 +15401,11 @@ 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; } @@ -14615,11 +15414,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_names); if (value) { values[1] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bulk_vector); @@ -14627,12 +15428,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "obtain_rv_vec") < 0)) __PYX_ERR(0, 706, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "obtain_rv_vec") < 0)) __PYX_ERR(0, 723, __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); + CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -14644,7 +15447,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("obtain_rv_vec", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 706, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("obtain_rv_vec", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 723, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.obtain_rv_vec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -14782,14 +15585,14 @@ __pyx_pybuffernd_rvg.data = NULL; __pyx_pybuffernd_rvg.rcbuffer = &__pyx_pybuffer_rvg; - /* "yt/utilities/lib/misc_utilities.pyx":722 + /* "yt/utilities/lib/misc_utilities.pyx":739 * cdef np.float64_t bv[3] * cdef int i, j, k * bulk_vector = data.get_field_parameter(bulk_vector) # <<<<<<<<<<<<<< * if len(data[field_names[0]].shape) == 1: * # One dimensional data */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_get_field_parameter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_get_field_parameter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -14802,13 +15605,13 @@ } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_bulk_vector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_bulk_vector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_bulk_vector}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -14816,19 +15619,19 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_bulk_vector}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_bulk_vector); __Pyx_GIVEREF(__pyx_v_bulk_vector); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_bulk_vector); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -14837,45 +15640,45 @@ __Pyx_DECREF_SET(__pyx_v_bulk_vector, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":723 + /* "yt/utilities/lib/misc_utilities.pyx":740 * cdef int i, j, k * bulk_vector = data.get_field_parameter(bulk_vector) * if len(data[field_names[0]].shape) == 1: # <<<<<<<<<<<<<< * # One dimensional data * vxf = data[field_names[0]].astype("float64") */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_field_names, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_field_names, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __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_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = ((__pyx_t_5 == 1) != 0); if (__pyx_t_6) { - /* "yt/utilities/lib/misc_utilities.pyx":725 + /* "yt/utilities/lib/misc_utilities.pyx":742 * if len(data[field_names[0]].shape) == 1: * # One dimensional data * vxf = data[field_names[0]].astype("float64") # <<<<<<<<<<<<<< * vyf = data[field_names[1]].astype("float64") * vzf = data[field_names[2]].astype("float64") */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_field_names, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_field_names, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __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_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 725, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 742, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -14891,31 +15694,31 @@ } } __pyx_pybuffernd_vxf.diminfo[0].strides = __pyx_pybuffernd_vxf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vxf.diminfo[0].shape = __pyx_pybuffernd_vxf.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 725, __pyx_L1_error) + if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 742, __pyx_L1_error) } __pyx_t_7 = 0; __pyx_v_vxf = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":726 + /* "yt/utilities/lib/misc_utilities.pyx":743 * # One dimensional data * vxf = data[field_names[0]].astype("float64") * vyf = data[field_names[1]].astype("float64") # <<<<<<<<<<<<<< * vzf = data[field_names[2]].astype("float64") * vyf.convert_to_units(vxf.units) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_field_names, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_field_names, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __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__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __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, 726, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 743, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -14931,31 +15734,31 @@ } } __pyx_pybuffernd_vyf.diminfo[0].strides = __pyx_pybuffernd_vyf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vyf.diminfo[0].shape = __pyx_pybuffernd_vyf.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 726, __pyx_L1_error) + if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 743, __pyx_L1_error) } __pyx_t_12 = 0; __pyx_v_vyf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":727 + /* "yt/utilities/lib/misc_utilities.pyx":744 * vxf = data[field_names[0]].astype("float64") * vyf = data[field_names[1]].astype("float64") * vzf = data[field_names[2]].astype("float64") # <<<<<<<<<<<<<< * vyf.convert_to_units(vxf.units) * vzf.convert_to_units(vxf.units) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_field_names, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_field_names, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __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_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 727, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 744, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -14971,22 +15774,22 @@ } } __pyx_pybuffernd_vzf.diminfo[0].strides = __pyx_pybuffernd_vzf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vzf.diminfo[0].shape = __pyx_pybuffernd_vzf.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 744, __pyx_L1_error) } __pyx_t_13 = 0; __pyx_v_vzf = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":728 + /* "yt/utilities/lib/misc_utilities.pyx":745 * vyf = data[field_names[1]].astype("float64") * vzf = data[field_names[2]].astype("float64") * vyf.convert_to_units(vxf.units) # <<<<<<<<<<<<<< * vzf.convert_to_units(vxf.units) * rvf = YTArray(np.empty((3, vxf.shape[0]), 'float64'), vxf.units) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vyf), __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vyf), __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxf), __pyx_n_s_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxf), __pyx_n_s_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -14999,14 +15802,14 @@ } } if (!__pyx_t_3) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -15015,20 +15818,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } @@ -15036,16 +15839,16 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":729 + /* "yt/utilities/lib/misc_utilities.pyx":746 * vzf = data[field_names[2]].astype("float64") * vyf.convert_to_units(vxf.units) * vzf.convert_to_units(vxf.units) # <<<<<<<<<<<<<< * rvf = YTArray(np.empty((3, vxf.shape[0]), 'float64'), vxf.units) * if bulk_vector is None: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vzf), __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vzf), __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxf), __pyx_n_s_units); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxf), __pyx_n_s_units); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -15058,14 +15861,14 @@ } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_14}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; @@ -15074,20 +15877,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_14}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_14); __pyx_t_14 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -15095,23 +15898,23 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":730 + /* "yt/utilities/lib/misc_utilities.pyx":747 * vyf.convert_to_units(vxf.units) * vzf.convert_to_units(vxf.units) * rvf = YTArray(np.empty((3, vxf.shape[0]), 'float64'), vxf.units) # <<<<<<<<<<<<<< * if bulk_vector is None: * bv[0] = bv[1] = bv[2] = 0.0 */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxf->dimensions[0])); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxf->dimensions[0])); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); @@ -15134,7 +15937,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_15, __pyx_n_s_float64}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; @@ -15143,14 +15946,14 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_15, __pyx_n_s_float64}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { - __pyx_t_16 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_16 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL; @@ -15161,12 +15964,12 @@ __Pyx_GIVEREF(__pyx_n_s_float64); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_8, __pyx_n_s_float64); __pyx_t_15 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxf), __pyx_n_s_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxf), __pyx_n_s_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_16 = NULL; __pyx_t_8 = 0; @@ -15183,7 +15986,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_3, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -15193,7 +15996,7 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_3, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -15201,7 +16004,7 @@ } else #endif { - __pyx_t_15 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_16) { __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); __pyx_t_16 = NULL; @@ -15212,12 +16015,12 @@ PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_8, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 730, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 747, __pyx_L1_error) __pyx_t_17 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -15233,13 +16036,13 @@ } } __pyx_pybuffernd_rvf.diminfo[0].strides = __pyx_pybuffernd_rvf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rvf.diminfo[0].shape = __pyx_pybuffernd_rvf.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rvf.diminfo[1].strides = __pyx_pybuffernd_rvf.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rvf.diminfo[1].shape = __pyx_pybuffernd_rvf.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 730, __pyx_L1_error) + if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 747, __pyx_L1_error) } __pyx_t_17 = 0; __pyx_v_rvf = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":731 + /* "yt/utilities/lib/misc_utilities.pyx":748 * vzf.convert_to_units(vxf.units) * rvf = YTArray(np.empty((3, vxf.shape[0]), 'float64'), vxf.units) * if bulk_vector is None: # <<<<<<<<<<<<<< @@ -15250,7 +16053,7 @@ __pyx_t_18 = (__pyx_t_6 != 0); if (__pyx_t_18) { - /* "yt/utilities/lib/misc_utilities.pyx":732 + /* "yt/utilities/lib/misc_utilities.pyx":749 * rvf = YTArray(np.empty((3, vxf.shape[0]), 'float64'), vxf.units) * if bulk_vector is None: * bv[0] = bv[1] = bv[2] = 0.0 # <<<<<<<<<<<<<< @@ -15261,7 +16064,7 @@ (__pyx_v_bv[1]) = 0.0; (__pyx_v_bv[2]) = 0.0; - /* "yt/utilities/lib/misc_utilities.pyx":731 + /* "yt/utilities/lib/misc_utilities.pyx":748 * vzf.convert_to_units(vxf.units) * rvf = YTArray(np.empty((3, vxf.shape[0]), 'float64'), vxf.units) * if bulk_vector is None: # <<<<<<<<<<<<<< @@ -15271,7 +16074,7 @@ goto __pyx_L4; } - /* "yt/utilities/lib/misc_utilities.pyx":734 + /* "yt/utilities/lib/misc_utilities.pyx":751 * bv[0] = bv[1] = bv[2] = 0.0 * else: * bulk_vector = bulk_vector.in_units(vxf.units) # <<<<<<<<<<<<<< @@ -15279,9 +16082,9 @@ * bv[1] = bulk_vector[1] */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_bulk_vector, __pyx_n_s_in_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_bulk_vector, __pyx_n_s_in_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxf), __pyx_n_s_units); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxf), __pyx_n_s_units); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -15294,14 +16097,14 @@ } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_15}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; @@ -15310,20 +16113,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_15}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_15); __pyx_t_15 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -15332,48 +16135,48 @@ __Pyx_DECREF_SET(__pyx_v_bulk_vector, __pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":735 + /* "yt/utilities/lib/misc_utilities.pyx":752 * else: * bulk_vector = bulk_vector.in_units(vxf.units) * bv[0] = bulk_vector[0] # <<<<<<<<<<<<<< * bv[1] = bulk_vector[1] * bv[2] = bulk_vector[2] */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bulk_vector, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bulk_vector, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_bv[0]) = __pyx_t_19; - /* "yt/utilities/lib/misc_utilities.pyx":736 + /* "yt/utilities/lib/misc_utilities.pyx":753 * bulk_vector = bulk_vector.in_units(vxf.units) * bv[0] = bulk_vector[0] * bv[1] = bulk_vector[1] # <<<<<<<<<<<<<< * bv[2] = bulk_vector[2] * for i in range(vxf.shape[0]): */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bulk_vector, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bulk_vector, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_bv[1]) = __pyx_t_19; - /* "yt/utilities/lib/misc_utilities.pyx":737 + /* "yt/utilities/lib/misc_utilities.pyx":754 * bv[0] = bulk_vector[0] * bv[1] = bulk_vector[1] * bv[2] = bulk_vector[2] # <<<<<<<<<<<<<< * for i in range(vxf.shape[0]): * rvf[0, i] = vxf[i] - bv[0] */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bulk_vector, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bulk_vector, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_bv[2]) = __pyx_t_19; } __pyx_L4:; - /* "yt/utilities/lib/misc_utilities.pyx":738 + /* "yt/utilities/lib/misc_utilities.pyx":755 * bv[1] = bulk_vector[1] * bv[2] = bulk_vector[2] * for i in range(vxf.shape[0]): # <<<<<<<<<<<<<< @@ -15384,7 +16187,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_20; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "yt/utilities/lib/misc_utilities.pyx":739 + /* "yt/utilities/lib/misc_utilities.pyx":756 * bv[2] = bulk_vector[2] * for i in range(vxf.shape[0]): * rvf[0, i] = vxf[i] - bv[0] # <<<<<<<<<<<<<< @@ -15396,7 +16199,7 @@ __pyx_t_23 = __pyx_v_i; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rvf.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rvf.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_rvf.diminfo[1].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vxf.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_vxf.diminfo[0].strides)) - (__pyx_v_bv[0])); - /* "yt/utilities/lib/misc_utilities.pyx":740 + /* "yt/utilities/lib/misc_utilities.pyx":757 * for i in range(vxf.shape[0]): * rvf[0, i] = vxf[i] - bv[0] * rvf[1, i] = vyf[i] - bv[1] # <<<<<<<<<<<<<< @@ -15408,7 +16211,7 @@ __pyx_t_26 = __pyx_v_i; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rvf.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_rvf.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_rvf.diminfo[1].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vyf.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_vyf.diminfo[0].strides)) - (__pyx_v_bv[1])); - /* "yt/utilities/lib/misc_utilities.pyx":741 + /* "yt/utilities/lib/misc_utilities.pyx":758 * rvf[0, i] = vxf[i] - bv[0] * rvf[1, i] = vyf[i] - bv[1] * rvf[2, i] = vzf[i] - bv[2] # <<<<<<<<<<<<<< @@ -15421,7 +16224,7 @@ *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rvf.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rvf.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_rvf.diminfo[1].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vzf.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_vzf.diminfo[0].strides)) - (__pyx_v_bv[2])); } - /* "yt/utilities/lib/misc_utilities.pyx":742 + /* "yt/utilities/lib/misc_utilities.pyx":759 * rvf[1, i] = vyf[i] - bv[1] * rvf[2, i] = vzf[i] - bv[2] * return rvf # <<<<<<<<<<<<<< @@ -15433,7 +16236,7 @@ __pyx_r = ((PyObject *)__pyx_v_rvf); goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":723 + /* "yt/utilities/lib/misc_utilities.pyx":740 * cdef int i, j, k * bulk_vector = data.get_field_parameter(bulk_vector) * if len(data[field_names[0]].shape) == 1: # <<<<<<<<<<<<<< @@ -15442,7 +16245,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":745 + /* "yt/utilities/lib/misc_utilities.pyx":762 * else: * # Three dimensional data * vxg = data[field_names[0]].astype("float64") # <<<<<<<<<<<<<< @@ -15450,18 +16253,18 @@ * vzg = data[field_names[2]].astype("float64") */ /*else*/ { - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_field_names, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_field_names, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __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__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __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, 745, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 762, __pyx_L1_error) __pyx_t_30 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -15477,31 +16280,31 @@ } } __pyx_pybuffernd_vxg.diminfo[0].strides = __pyx_pybuffernd_vxg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vxg.diminfo[0].shape = __pyx_pybuffernd_vxg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vxg.diminfo[1].strides = __pyx_pybuffernd_vxg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vxg.diminfo[1].shape = __pyx_pybuffernd_vxg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_vxg.diminfo[2].strides = __pyx_pybuffernd_vxg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_vxg.diminfo[2].shape = __pyx_pybuffernd_vxg.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 745, __pyx_L1_error) + if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 762, __pyx_L1_error) } __pyx_t_30 = 0; __pyx_v_vxg = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":746 + /* "yt/utilities/lib/misc_utilities.pyx":763 * # Three dimensional data * vxg = data[field_names[0]].astype("float64") * vyg = data[field_names[1]].astype("float64") # <<<<<<<<<<<<<< * vzg = data[field_names[2]].astype("float64") * vyg.convert_to_units(vxg.units) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_field_names, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_field_names, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __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_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 746, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 763, __pyx_L1_error) __pyx_t_31 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -15517,31 +16320,31 @@ } } __pyx_pybuffernd_vyg.diminfo[0].strides = __pyx_pybuffernd_vyg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vyg.diminfo[0].shape = __pyx_pybuffernd_vyg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vyg.diminfo[1].strides = __pyx_pybuffernd_vyg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vyg.diminfo[1].shape = __pyx_pybuffernd_vyg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_vyg.diminfo[2].strides = __pyx_pybuffernd_vyg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_vyg.diminfo[2].shape = __pyx_pybuffernd_vyg.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 746, __pyx_L1_error) + if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 763, __pyx_L1_error) } __pyx_t_31 = 0; __pyx_v_vyg = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":747 + /* "yt/utilities/lib/misc_utilities.pyx":764 * vxg = data[field_names[0]].astype("float64") * vyg = data[field_names[1]].astype("float64") * vzg = data[field_names[2]].astype("float64") # <<<<<<<<<<<<<< * vyg.convert_to_units(vxg.units) * vzg.convert_to_units(vxg.units) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_field_names, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_field_names, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __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__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __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, 747, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 764, __pyx_L1_error) __pyx_t_32 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -15557,22 +16360,22 @@ } } __pyx_pybuffernd_vzg.diminfo[0].strides = __pyx_pybuffernd_vzg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vzg.diminfo[0].shape = __pyx_pybuffernd_vzg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vzg.diminfo[1].strides = __pyx_pybuffernd_vzg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vzg.diminfo[1].shape = __pyx_pybuffernd_vzg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_vzg.diminfo[2].strides = __pyx_pybuffernd_vzg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_vzg.diminfo[2].shape = __pyx_pybuffernd_vzg.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 747, __pyx_L1_error) + if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 764, __pyx_L1_error) } __pyx_t_32 = 0; __pyx_v_vzg = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":748 + /* "yt/utilities/lib/misc_utilities.pyx":765 * vyg = data[field_names[1]].astype("float64") * vzg = data[field_names[2]].astype("float64") * vyg.convert_to_units(vxg.units) # <<<<<<<<<<<<<< * vzg.convert_to_units(vxg.units) * shape = (3, vxg.shape[0], vxg.shape[1], vxg.shape[2]) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vyg), __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vyg), __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxg), __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxg), __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_15 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -15585,14 +16388,14 @@ } } if (!__pyx_t_15) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __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_15, __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, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -15601,20 +16404,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_15, __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, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 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, 748, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_15); __pyx_t_15 = 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_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -15622,16 +16425,16 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":749 + /* "yt/utilities/lib/misc_utilities.pyx":766 * vzg = data[field_names[2]].astype("float64") * vyg.convert_to_units(vxg.units) * vzg.convert_to_units(vxg.units) # <<<<<<<<<<<<<< * shape = (3, vxg.shape[0], vxg.shape[1], vxg.shape[2]) * rvg = YTArray(np.empty(shape, 'float64'), vxg.units) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vzg), __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vzg), __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxg), __pyx_n_s_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxg), __pyx_n_s_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -15644,14 +16447,14 @@ } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __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_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -15660,20 +16463,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } @@ -15681,20 +16484,20 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":750 + /* "yt/utilities/lib/misc_utilities.pyx":767 * vyg.convert_to_units(vxg.units) * vzg.convert_to_units(vxg.units) * shape = (3, vxg.shape[0], vxg.shape[1], vxg.shape[2]) # <<<<<<<<<<<<<< * rvg = YTArray(np.empty(shape, 'float64'), vxg.units) * if bulk_vector is None: */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxg->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxg->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxg->dimensions[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxg->dimensions[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxg->dimensions[2])); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_vxg->dimensions[2])); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); @@ -15711,18 +16514,18 @@ __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":751 + /* "yt/utilities/lib/misc_utilities.pyx":768 * vzg.convert_to_units(vxg.units) * shape = (3, vxg.shape[0], vxg.shape[1], vxg.shape[2]) * rvg = YTArray(np.empty(shape, 'float64'), vxg.units) # <<<<<<<<<<<<<< * if bulk_vector is None: * bv[0] = bv[1] = bv[2] = 0.0 */ - __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTArray); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTArray); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -15740,7 +16543,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_shape, __pyx_n_s_float64}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -15748,13 +16551,13 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_shape, __pyx_n_s_float64}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_16 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_16 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -15765,12 +16568,12 @@ __Pyx_INCREF(__pyx_n_s_float64); __Pyx_GIVEREF(__pyx_n_s_float64); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_8, __pyx_n_s_float64); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxg), __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxg), __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = NULL; __pyx_t_8 = 0; @@ -15787,7 +16590,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_2, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15797,7 +16600,7 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_2, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15805,7 +16608,7 @@ } else #endif { - __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_16) { __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_16); __pyx_t_16 = NULL; @@ -15816,12 +16619,12 @@ PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 751, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 768, __pyx_L1_error) __pyx_t_33 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -15837,13 +16640,13 @@ } } __pyx_pybuffernd_rvg.diminfo[0].strides = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rvg.diminfo[0].shape = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rvg.diminfo[1].strides = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rvg.diminfo[1].shape = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_rvg.diminfo[2].strides = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_rvg.diminfo[2].shape = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_rvg.diminfo[3].strides = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_rvg.diminfo[3].shape = __pyx_pybuffernd_rvg.rcbuffer->pybuffer.shape[3]; - if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 751, __pyx_L1_error) + if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 768, __pyx_L1_error) } __pyx_t_33 = 0; __pyx_v_rvg = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":752 + /* "yt/utilities/lib/misc_utilities.pyx":769 * shape = (3, vxg.shape[0], vxg.shape[1], vxg.shape[2]) * rvg = YTArray(np.empty(shape, 'float64'), vxg.units) * if bulk_vector is None: # <<<<<<<<<<<<<< @@ -15854,18 +16657,18 @@ __pyx_t_6 = (__pyx_t_18 != 0); if (__pyx_t_6) { - /* "yt/utilities/lib/misc_utilities.pyx":753 + /* "yt/utilities/lib/misc_utilities.pyx":770 * rvg = YTArray(np.empty(shape, 'float64'), vxg.units) * if bulk_vector is None: * bv[0] = bv[1] = bv[2] = 0.0 # <<<<<<<<<<<<<< * else: - * bulk_vector = bulk_vector.in_units(vxg.units) + * if hasattr(bulk_vector, 'in_units'): */ (__pyx_v_bv[0]) = 0.0; (__pyx_v_bv[1]) = 0.0; (__pyx_v_bv[2]) = 0.0; - /* "yt/utilities/lib/misc_utilities.pyx":752 + /* "yt/utilities/lib/misc_utilities.pyx":769 * shape = (3, vxg.shape[0], vxg.shape[1], vxg.shape[2]) * rvg = YTArray(np.empty(shape, 'float64'), vxg.units) * if bulk_vector is None: # <<<<<<<<<<<<<< @@ -15875,109 +16678,129 @@ goto __pyx_L7; } - /* "yt/utilities/lib/misc_utilities.pyx":755 + /* "yt/utilities/lib/misc_utilities.pyx":772 * bv[0] = bv[1] = bv[2] = 0.0 * else: - * bulk_vector = bulk_vector.in_units(vxg.units) # <<<<<<<<<<<<<< + * if hasattr(bulk_vector, 'in_units'): # <<<<<<<<<<<<<< + * bulk_vector = bulk_vector.in_units(vxg.units) * bv[0] = bulk_vector[0] - * bv[1] = bulk_vector[1] */ /*else*/ { - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_bulk_vector, __pyx_n_s_in_units); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxg), __pyx_n_s_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_15); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_15, function); + __pyx_t_6 = __Pyx_HasAttr(__pyx_v_bulk_vector, __pyx_n_s_in_units); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 772, __pyx_L1_error) + __pyx_t_18 = (__pyx_t_6 != 0); + if (__pyx_t_18) { + + /* "yt/utilities/lib/misc_utilities.pyx":773 + * else: + * if hasattr(bulk_vector, 'in_units'): + * bulk_vector = bulk_vector.in_units(vxg.units) # <<<<<<<<<<<<<< + * bv[0] = bulk_vector[0] + * bv[1] = bulk_vector[1] + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_bulk_vector, __pyx_n_s_in_units); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vxg), __pyx_n_s_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_15); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_15, function); + } } - } - if (!__pyx_t_3) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __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_15)) { - PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __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_15)) { - PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_4); + if (!__pyx_t_3) { + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error) __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, 755, __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_15, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_15)) { + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __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_15)) { + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __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, 773, __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_15, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } } - } - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF_SET(__pyx_v_bulk_vector, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF_SET(__pyx_v_bulk_vector, __pyx_t_4); + __pyx_t_4 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":756 + /* "yt/utilities/lib/misc_utilities.pyx":772 + * bv[0] = bv[1] = bv[2] = 0.0 * else: - * bulk_vector = bulk_vector.in_units(vxg.units) + * if hasattr(bulk_vector, 'in_units'): # <<<<<<<<<<<<<< + * bulk_vector = bulk_vector.in_units(vxg.units) + * bv[0] = bulk_vector[0] + */ + } + + /* "yt/utilities/lib/misc_utilities.pyx":774 + * if hasattr(bulk_vector, 'in_units'): + * bulk_vector = bulk_vector.in_units(vxg.units) * bv[0] = bulk_vector[0] # <<<<<<<<<<<<<< * bv[1] = bulk_vector[1] * bv[2] = bulk_vector[2] */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_bulk_vector, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_bulk_vector, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_bv[0]) = __pyx_t_19; - /* "yt/utilities/lib/misc_utilities.pyx":757 - * bulk_vector = bulk_vector.in_units(vxg.units) + /* "yt/utilities/lib/misc_utilities.pyx":775 + * bulk_vector = bulk_vector.in_units(vxg.units) * bv[0] = bulk_vector[0] * bv[1] = bulk_vector[1] # <<<<<<<<<<<<<< * bv[2] = bulk_vector[2] * for i in range(vxg.shape[0]): */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_bulk_vector, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_bulk_vector, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_bv[1]) = __pyx_t_19; - /* "yt/utilities/lib/misc_utilities.pyx":758 + /* "yt/utilities/lib/misc_utilities.pyx":776 * bv[0] = bulk_vector[0] * bv[1] = bulk_vector[1] * bv[2] = bulk_vector[2] # <<<<<<<<<<<<<< * for i in range(vxg.shape[0]): * for j in range(vxg.shape[1]): */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_bulk_vector, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_bulk_vector, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_bv[2]) = __pyx_t_19; } __pyx_L7:; - /* "yt/utilities/lib/misc_utilities.pyx":759 + /* "yt/utilities/lib/misc_utilities.pyx":777 * bv[1] = bulk_vector[1] * bv[2] = bulk_vector[2] * for i in range(vxg.shape[0]): # <<<<<<<<<<<<<< @@ -15988,7 +16811,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_20; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "yt/utilities/lib/misc_utilities.pyx":760 + /* "yt/utilities/lib/misc_utilities.pyx":778 * bv[2] = bulk_vector[2] * for i in range(vxg.shape[0]): * for j in range(vxg.shape[1]): # <<<<<<<<<<<<<< @@ -15999,7 +16822,7 @@ for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { __pyx_v_j = __pyx_t_35; - /* "yt/utilities/lib/misc_utilities.pyx":761 + /* "yt/utilities/lib/misc_utilities.pyx":779 * for i in range(vxg.shape[0]): * for j in range(vxg.shape[1]): * for k in range(vxg.shape[2]): # <<<<<<<<<<<<<< @@ -16010,7 +16833,7 @@ for (__pyx_t_37 = 0; __pyx_t_37 < __pyx_t_36; __pyx_t_37+=1) { __pyx_v_k = __pyx_t_37; - /* "yt/utilities/lib/misc_utilities.pyx":762 + /* "yt/utilities/lib/misc_utilities.pyx":780 * for j in range(vxg.shape[1]): * for k in range(vxg.shape[2]): * rvg[0,i,j,k] = vxg[i,j,k] - bv[0] # <<<<<<<<<<<<<< @@ -16026,7 +16849,7 @@ __pyx_t_44 = __pyx_v_k; *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rvg.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_rvg.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_rvg.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_rvg.diminfo[2].strides, __pyx_t_44, __pyx_pybuffernd_rvg.diminfo[3].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vxg.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_vxg.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_vxg.diminfo[1].strides, __pyx_t_40, __pyx_pybuffernd_vxg.diminfo[2].strides)) - (__pyx_v_bv[0])); - /* "yt/utilities/lib/misc_utilities.pyx":763 + /* "yt/utilities/lib/misc_utilities.pyx":781 * for k in range(vxg.shape[2]): * rvg[0,i,j,k] = vxg[i,j,k] - bv[0] * rvg[1,i,j,k] = vyg[i,j,k] - bv[1] # <<<<<<<<<<<<<< @@ -16042,7 +16865,7 @@ __pyx_t_51 = __pyx_v_k; *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rvg.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rvg.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_rvg.diminfo[1].strides, __pyx_t_50, __pyx_pybuffernd_rvg.diminfo[2].strides, __pyx_t_51, __pyx_pybuffernd_rvg.diminfo[3].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_vyg.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_vyg.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_vyg.diminfo[1].strides, __pyx_t_47, __pyx_pybuffernd_vyg.diminfo[2].strides)) - (__pyx_v_bv[1])); - /* "yt/utilities/lib/misc_utilities.pyx":764 + /* "yt/utilities/lib/misc_utilities.pyx":782 * rvg[0,i,j,k] = vxg[i,j,k] - bv[0] * rvg[1,i,j,k] = vyg[i,j,k] - bv[1] * rvg[2,i,j,k] = vzg[i,j,k] - bv[2] # <<<<<<<<<<<<<< @@ -16061,7 +16884,7 @@ } } - /* "yt/utilities/lib/misc_utilities.pyx":765 + /* "yt/utilities/lib/misc_utilities.pyx":783 * rvg[1,i,j,k] = vyg[i,j,k] - bv[1] * rvg[2,i,j,k] = vzg[i,j,k] - bv[2] * return rvg # <<<<<<<<<<<<<< @@ -16074,7 +16897,7 @@ goto __pyx_L0; } - /* "yt/utilities/lib/misc_utilities.pyx":706 + /* "yt/utilities/lib/misc_utilities.pyx":723 * @cython.wraparound(False) * @cython.cdivision(True) * def obtain_rv_vec(data, field_names = ("velocity_x", # <<<<<<<<<<<<<< @@ -16132,7 +16955,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":767 +/* "yt/utilities/lib/misc_utilities.pyx":785 * return rvg * * def grow_flagging_field(oofield): # <<<<<<<<<<<<<< @@ -16209,25 +17032,25 @@ __pyx_pybuffernd_nfield.data = NULL; __pyx_pybuffernd_nfield.rcbuffer = &__pyx_pybuffer_nfield; - /* "yt/utilities/lib/misc_utilities.pyx":768 + /* "yt/utilities/lib/misc_utilities.pyx":786 * * def grow_flagging_field(oofield): * cdef np.ndarray[np.uint8_t, ndim=3] ofield = oofield.astype("uint8") # <<<<<<<<<<<<<< * cdef np.ndarray[np.uint8_t, ndim=3] nfield * nfield = np.zeros_like(ofield) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_oofield, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_oofield, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 786, __pyx_L1_error) __pyx_t_3 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ofield.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) { __pyx_v_ofield = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ofield.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 768, __pyx_L1_error) + __PYX_ERR(0, 786, __pyx_L1_error) } else {__pyx_pybuffernd_ofield.diminfo[0].strides = __pyx_pybuffernd_ofield.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ofield.diminfo[0].shape = __pyx_pybuffernd_ofield.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ofield.diminfo[1].strides = __pyx_pybuffernd_ofield.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ofield.diminfo[1].shape = __pyx_pybuffernd_ofield.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ofield.diminfo[2].strides = __pyx_pybuffernd_ofield.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ofield.diminfo[2].shape = __pyx_pybuffernd_ofield.rcbuffer->pybuffer.shape[2]; } } @@ -16235,16 +17058,16 @@ __pyx_v_ofield = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":770 + /* "yt/utilities/lib/misc_utilities.pyx":788 * cdef np.ndarray[np.uint8_t, ndim=3] ofield = oofield.astype("uint8") * cdef np.ndarray[np.uint8_t, ndim=3] nfield * nfield = np.zeros_like(ofield) # <<<<<<<<<<<<<< * cdef int i, j, k, ni, nj, nk * cdef int oi, oj, ok */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -16258,13 +17081,13 @@ } } if (!__pyx_t_1) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_ofield)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_ofield)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __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_1, ((PyObject *)__pyx_v_ofield)}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -16272,25 +17095,25 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_ofield)}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_ofield)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ofield)); PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_ofield)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __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; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 770, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 788, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -16306,13 +17129,13 @@ } } __pyx_pybuffernd_nfield.diminfo[0].strides = __pyx_pybuffernd_nfield.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nfield.diminfo[0].shape = __pyx_pybuffernd_nfield.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nfield.diminfo[1].strides = __pyx_pybuffernd_nfield.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nfield.diminfo[1].shape = __pyx_pybuffernd_nfield.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_nfield.diminfo[2].strides = __pyx_pybuffernd_nfield.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_nfield.diminfo[2].shape = __pyx_pybuffernd_nfield.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 770, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 788, __pyx_L1_error) } __pyx_t_6 = 0; __pyx_v_nfield = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":773 + /* "yt/utilities/lib/misc_utilities.pyx":791 * cdef int i, j, k, ni, nj, nk * cdef int oi, oj, ok * for ni in range(ofield.shape[0]): # <<<<<<<<<<<<<< @@ -16323,7 +17146,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_11; __pyx_t_7+=1) { __pyx_v_ni = __pyx_t_7; - /* "yt/utilities/lib/misc_utilities.pyx":774 + /* "yt/utilities/lib/misc_utilities.pyx":792 * cdef int oi, oj, ok * for ni in range(ofield.shape[0]): * for nj in range(ofield.shape[1]): # <<<<<<<<<<<<<< @@ -16334,7 +17157,7 @@ for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_nj = __pyx_t_13; - /* "yt/utilities/lib/misc_utilities.pyx":775 + /* "yt/utilities/lib/misc_utilities.pyx":793 * for ni in range(ofield.shape[0]): * for nj in range(ofield.shape[1]): * for nk in range(ofield.shape[2]): # <<<<<<<<<<<<<< @@ -16345,7 +17168,7 @@ for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { __pyx_v_nk = __pyx_t_15; - /* "yt/utilities/lib/misc_utilities.pyx":776 + /* "yt/utilities/lib/misc_utilities.pyx":794 * for nj in range(ofield.shape[1]): * for nk in range(ofield.shape[2]): * for oi in range(3): # <<<<<<<<<<<<<< @@ -16355,7 +17178,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < 3; __pyx_t_16+=1) { __pyx_v_oi = __pyx_t_16; - /* "yt/utilities/lib/misc_utilities.pyx":777 + /* "yt/utilities/lib/misc_utilities.pyx":795 * for nk in range(ofield.shape[2]): * for oi in range(3): * i = ni + (oi - 1) # <<<<<<<<<<<<<< @@ -16364,7 +17187,7 @@ */ __pyx_v_i = (__pyx_v_ni + (__pyx_v_oi - 1)); - /* "yt/utilities/lib/misc_utilities.pyx":778 + /* "yt/utilities/lib/misc_utilities.pyx":796 * for oi in range(3): * i = ni + (oi - 1) * if i < 0 or i >= ofield.shape[0]: continue # <<<<<<<<<<<<<< @@ -16384,7 +17207,7 @@ goto __pyx_L9_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":779 + /* "yt/utilities/lib/misc_utilities.pyx":797 * i = ni + (oi - 1) * if i < 0 or i >= ofield.shape[0]: continue * for oj in range(3): # <<<<<<<<<<<<<< @@ -16394,7 +17217,7 @@ for (__pyx_t_19 = 0; __pyx_t_19 < 3; __pyx_t_19+=1) { __pyx_v_oj = __pyx_t_19; - /* "yt/utilities/lib/misc_utilities.pyx":780 + /* "yt/utilities/lib/misc_utilities.pyx":798 * if i < 0 or i >= ofield.shape[0]: continue * for oj in range(3): * j = nj + (oj - 1) # <<<<<<<<<<<<<< @@ -16403,7 +17226,7 @@ */ __pyx_v_j = (__pyx_v_nj + (__pyx_v_oj - 1)); - /* "yt/utilities/lib/misc_utilities.pyx":781 + /* "yt/utilities/lib/misc_utilities.pyx":799 * for oj in range(3): * j = nj + (oj - 1) * if j < 0 or j >= ofield.shape[1]: continue # <<<<<<<<<<<<<< @@ -16423,7 +17246,7 @@ goto __pyx_L14_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":782 + /* "yt/utilities/lib/misc_utilities.pyx":800 * j = nj + (oj - 1) * if j < 0 or j >= ofield.shape[1]: continue * for ok in range(3): # <<<<<<<<<<<<<< @@ -16433,7 +17256,7 @@ for (__pyx_t_20 = 0; __pyx_t_20 < 3; __pyx_t_20+=1) { __pyx_v_ok = __pyx_t_20; - /* "yt/utilities/lib/misc_utilities.pyx":783 + /* "yt/utilities/lib/misc_utilities.pyx":801 * if j < 0 or j >= ofield.shape[1]: continue * for ok in range(3): * k = nk + (ok - 1) # <<<<<<<<<<<<<< @@ -16442,7 +17265,7 @@ */ __pyx_v_k = (__pyx_v_nk + (__pyx_v_ok - 1)); - /* "yt/utilities/lib/misc_utilities.pyx":784 + /* "yt/utilities/lib/misc_utilities.pyx":802 * for ok in range(3): * k = nk + (ok - 1) * if k < 0 or k >= ofield.shape[2]: continue # <<<<<<<<<<<<<< @@ -16462,7 +17285,7 @@ goto __pyx_L19_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":785 + /* "yt/utilities/lib/misc_utilities.pyx":803 * k = nk + (ok - 1) * if k < 0 or k >= ofield.shape[2]: continue * if ofield[i, j, k] == 1: # <<<<<<<<<<<<<< @@ -16487,12 +17310,12 @@ } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ofield.diminfo[2].shape)) __pyx_t_24 = 2; if (unlikely(__pyx_t_24 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_24); - __PYX_ERR(0, 785, __pyx_L1_error) + __PYX_ERR(0, 803, __pyx_L1_error) } __pyx_t_17 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_ofield.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_ofield.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ofield.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_ofield.diminfo[2].strides)) == 1) != 0); if (__pyx_t_17) { - /* "yt/utilities/lib/misc_utilities.pyx":786 + /* "yt/utilities/lib/misc_utilities.pyx":804 * if k < 0 or k >= ofield.shape[2]: continue * if ofield[i, j, k] == 1: * nfield[ni, nj, nk] = 1 # <<<<<<<<<<<<<< @@ -16517,11 +17340,11 @@ } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nfield.diminfo[2].shape)) __pyx_t_24 = 2; if (unlikely(__pyx_t_24 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_24); - __PYX_ERR(0, 786, __pyx_L1_error) + __PYX_ERR(0, 804, __pyx_L1_error) } *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_nfield.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nfield.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nfield.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_nfield.diminfo[2].strides) = 1; - /* "yt/utilities/lib/misc_utilities.pyx":785 + /* "yt/utilities/lib/misc_utilities.pyx":803 * k = nk + (ok - 1) * if k < 0 or k >= ofield.shape[2]: continue * if ofield[i, j, k] == 1: # <<<<<<<<<<<<<< @@ -16539,7 +17362,7 @@ } } - /* "yt/utilities/lib/misc_utilities.pyx":787 + /* "yt/utilities/lib/misc_utilities.pyx":805 * if ofield[i, j, k] == 1: * nfield[ni, nj, nk] = 1 * return nfield.astype("bool") # <<<<<<<<<<<<<< @@ -16547,16 +17370,16 @@ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_nfield), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_nfield), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __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, 787, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":767 + /* "yt/utilities/lib/misc_utilities.pyx":785 * return rvg * * def grow_flagging_field(oofield): # <<<<<<<<<<<<<< @@ -16591,7 +17414,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":792 +/* "yt/utilities/lib/misc_utilities.pyx":810 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_region(input_fields, output_fields, # <<<<<<<<<<<<<< @@ -16610,7 +17433,7 @@ PyArrayObject *__pyx_v_ipos = 0; PyArrayObject *__pyx_v_ires = 0; PyArrayObject *__pyx_v_level_dims = 0; - __pyx_t_5numpy_int64_t __pyx_v_refine_by; + PyArrayObject *__pyx_v_refine_by = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fill_region (wrapper)", 0); @@ -16622,13 +17445,21 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -16637,84 +17468,86 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_fields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_fields)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_region", 0, 7, 8, 1); __PYX_ERR(0, 792, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region", 1, 8, 8, 1); __PYX_ERR(0, 810, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_level)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_region", 0, 7, 8, 2); __PYX_ERR(0, 792, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region", 1, 8, 8, 2); __PYX_ERR(0, 810, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_index)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_region", 0, 7, 8, 3); __PYX_ERR(0, 792, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region", 1, 8, 8, 3); __PYX_ERR(0, 810, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ipos)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_region", 0, 7, 8, 4); __PYX_ERR(0, 792, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region", 1, 8, 8, 4); __PYX_ERR(0, 810, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ires)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_region", 0, 7, 8, 5); __PYX_ERR(0, 792, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region", 1, 8, 8, 5); __PYX_ERR(0, 810, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level_dims)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_region", 0, 7, 8, 6); __PYX_ERR(0, 792, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region", 1, 8, 8, 6); __PYX_ERR(0, 810, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_refine_by); - if (value) { values[7] = value; kw_args--; } + if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_refine_by)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("fill_region", 1, 8, 8, 7); __PYX_ERR(0, 810, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_region") < 0)) __PYX_ERR(0, 792, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_region") < 0)) __PYX_ERR(0, 810, __pyx_L3_error) } + } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { + goto __pyx_L5_argtuple_error; } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[4] = PyTuple_GET_ITEM(__pyx_args, 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; - } + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); } __pyx_v_input_fields = values[0]; __pyx_v_output_fields = values[1]; - __pyx_v_output_level = __Pyx_PyInt_As_npy_int32(values[2]); if (unlikely((__pyx_v_output_level == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 793, __pyx_L3_error) + __pyx_v_output_level = __Pyx_PyInt_As_npy_int32(values[2]); if (unlikely((__pyx_v_output_level == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 811, __pyx_L3_error) __pyx_v_left_index = ((PyArrayObject *)values[3]); __pyx_v_ipos = ((PyArrayObject *)values[4]); __pyx_v_ires = ((PyArrayObject *)values[5]); __pyx_v_level_dims = ((PyArrayObject *)values[6]); - if (values[7]) { - __pyx_v_refine_by = __Pyx_PyInt_As_npy_int64(values[7]); if (unlikely((__pyx_v_refine_by == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 798, __pyx_L3_error) - } else { - __pyx_v_refine_by = ((__pyx_t_5numpy_int64_t)2); - } + __pyx_v_refine_by = ((PyArrayObject *)values[7]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fill_region", 0, 7, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 792, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 810, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.fill_region", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_index), __pyx_ptype_5numpy_ndarray, 1, "left_index", 0))) __PYX_ERR(0, 794, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ipos), __pyx_ptype_5numpy_ndarray, 1, "ipos", 0))) __PYX_ERR(0, 795, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ires), __pyx_ptype_5numpy_ndarray, 1, "ires", 0))) __PYX_ERR(0, 796, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_level_dims), __pyx_ptype_5numpy_ndarray, 1, "level_dims", 0))) __PYX_ERR(0, 797, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_index), __pyx_ptype_5numpy_ndarray, 1, "left_index", 0))) __PYX_ERR(0, 812, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ipos), __pyx_ptype_5numpy_ndarray, 1, "ipos", 0))) __PYX_ERR(0, 813, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ires), __pyx_ptype_5numpy_ndarray, 1, "ires", 0))) __PYX_ERR(0, 814, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_level_dims), __pyx_ptype_5numpy_ndarray, 1, "level_dims", 0))) __PYX_ERR(0, 815, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_refine_by), __pyx_ptype_5numpy_ndarray, 1, "refine_by", 0))) __PYX_ERR(0, 816, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_36fill_region(__pyx_self, __pyx_v_input_fields, __pyx_v_output_fields, __pyx_v_output_level, __pyx_v_left_index, __pyx_v_ipos, __pyx_v_ires, __pyx_v_level_dims, __pyx_v_refine_by); /* function exit code */ @@ -16726,14 +17559,14 @@ return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_36fill_region(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input_fields, PyObject *__pyx_v_output_fields, __pyx_t_5numpy_int32_t __pyx_v_output_level, PyArrayObject *__pyx_v_left_index, PyArrayObject *__pyx_v_ipos, PyArrayObject *__pyx_v_ires, PyArrayObject *__pyx_v_level_dims, __pyx_t_5numpy_int64_t __pyx_v_refine_by) { +static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_36fill_region(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input_fields, PyObject *__pyx_v_output_fields, __pyx_t_5numpy_int32_t __pyx_v_output_level, PyArrayObject *__pyx_v_left_index, PyArrayObject *__pyx_v_ipos, PyArrayObject *__pyx_v_ires, PyArrayObject *__pyx_v_level_dims, PyArrayObject *__pyx_v_refine_by) { int __pyx_v_i; int __pyx_v_n; __pyx_t_5numpy_int64_t __pyx_v_tot; __pyx_t_5numpy_int64_t __pyx_v_oi; __pyx_t_5numpy_int64_t __pyx_v_oj; __pyx_t_5numpy_int64_t __pyx_v_ok; - __pyx_t_5numpy_int64_t __pyx_v_rf; + __pyx_t_5numpy_int64_t __pyx_v_rf[3]; __pyx_t_5numpy_int64_t __pyx_v_iind[3]; __pyx_t_5numpy_int64_t __pyx_v_oind[3]; __pyx_t_5numpy_int64_t __pyx_v_dim[3]; @@ -16745,6 +17578,7 @@ int __pyx_v_wk; int __pyx_v_offsets[3][3]; __pyx_t_5numpy_int64_t __pyx_v_off; + long __pyx_v_k; __Pyx_LocalBuf_ND __pyx_pybuffernd_ifield; __Pyx_Buffer __pyx_pybuffer_ifield; __Pyx_LocalBuf_ND __pyx_pybuffernd_ipos; @@ -16757,6 +17591,8 @@ __Pyx_Buffer __pyx_pybuffer_level_dims; __Pyx_LocalBuf_ND __pyx_pybuffernd_ofield; __Pyx_Buffer __pyx_pybuffer_ofield; + __Pyx_LocalBuf_ND __pyx_pybuffernd_refine_by; + __Pyx_Buffer __pyx_pybuffer_refine_by; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; @@ -16775,31 +17611,33 @@ PyObject *__pyx_t_14 = NULL; PyArrayObject *__pyx_t_15 = NULL; npy_intp __pyx_t_16; - Py_ssize_t __pyx_t_17; - int __pyx_t_18; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; Py_ssize_t __pyx_t_19; - Py_ssize_t __pyx_t_20; + int __pyx_t_20; Py_ssize_t __pyx_t_21; Py_ssize_t __pyx_t_22; - __pyx_t_5numpy_int64_t __pyx_t_23; - int __pyx_t_24; - Py_ssize_t __pyx_t_25; - Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_int64_t __pyx_t_25; + int __pyx_t_26; Py_ssize_t __pyx_t_27; Py_ssize_t __pyx_t_28; - __pyx_t_5numpy_int64_t __pyx_t_29; - __pyx_t_5numpy_int64_t __pyx_t_30; - int __pyx_t_31; - Py_ssize_t __pyx_t_32; - Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + __pyx_t_5numpy_int64_t __pyx_t_31; + __pyx_t_5numpy_int64_t __pyx_t_32; + int __pyx_t_33; Py_ssize_t __pyx_t_34; Py_ssize_t __pyx_t_35; - __pyx_t_5numpy_int64_t __pyx_t_36; - __pyx_t_5numpy_int64_t __pyx_t_37; - Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + __pyx_t_5numpy_int64_t __pyx_t_38; __pyx_t_5numpy_int64_t __pyx_t_39; - __pyx_t_5numpy_int64_t __pyx_t_40; + Py_ssize_t __pyx_t_40; __pyx_t_5numpy_int64_t __pyx_t_41; + __pyx_t_5numpy_int64_t __pyx_t_42; + __pyx_t_5numpy_int64_t __pyx_t_43; __Pyx_RefNannySetupContext("fill_region", 0); __pyx_pybuffer_ofield.pybuffer.buf = NULL; __pyx_pybuffer_ofield.refcount = 0; @@ -16825,47 +17663,56 @@ __pyx_pybuffer_level_dims.refcount = 0; __pyx_pybuffernd_level_dims.data = NULL; __pyx_pybuffernd_level_dims.rcbuffer = &__pyx_pybuffer_level_dims; + __pyx_pybuffer_refine_by.pybuffer.buf = NULL; + __pyx_pybuffer_refine_by.refcount = 0; + __pyx_pybuffernd_refine_by.data = NULL; + __pyx_pybuffernd_refine_by.rcbuffer = &__pyx_pybuffer_refine_by; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 792, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 810, __pyx_L1_error) } __pyx_pybuffernd_left_index.diminfo[0].strides = __pyx_pybuffernd_left_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_index.diminfo[0].shape = __pyx_pybuffernd_left_index.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ipos.rcbuffer->pybuffer, (PyObject*)__pyx_v_ipos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 792, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ipos.rcbuffer->pybuffer, (PyObject*)__pyx_v_ipos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 810, __pyx_L1_error) } __pyx_pybuffernd_ipos.diminfo[0].strides = __pyx_pybuffernd_ipos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ipos.diminfo[0].shape = __pyx_pybuffernd_ipos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ipos.diminfo[1].strides = __pyx_pybuffernd_ipos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ipos.diminfo[1].shape = __pyx_pybuffernd_ipos.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ires.rcbuffer->pybuffer, (PyObject*)__pyx_v_ires, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 792, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ires.rcbuffer->pybuffer, (PyObject*)__pyx_v_ires, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 810, __pyx_L1_error) } __pyx_pybuffernd_ires.diminfo[0].strides = __pyx_pybuffernd_ires.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ires.diminfo[0].shape = __pyx_pybuffernd_ires.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_level_dims.rcbuffer->pybuffer, (PyObject*)__pyx_v_level_dims, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 792, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_level_dims.rcbuffer->pybuffer, (PyObject*)__pyx_v_level_dims, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 810, __pyx_L1_error) } __pyx_pybuffernd_level_dims.diminfo[0].strides = __pyx_pybuffernd_level_dims.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_level_dims.diminfo[0].shape = __pyx_pybuffernd_level_dims.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_refine_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_refine_by, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 810, __pyx_L1_error) + } + __pyx_pybuffernd_refine_by.diminfo[0].strides = __pyx_pybuffernd_refine_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_refine_by.diminfo[0].shape = __pyx_pybuffernd_refine_by.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/misc_utilities.pyx":801 + /* "yt/utilities/lib/misc_utilities.pyx":819 * ): * cdef int i, n - * cdef np.int64_t tot = 0, oi, oj, ok, rf # <<<<<<<<<<<<<< + * cdef np.int64_t tot = 0, oi, oj, ok # <<<<<<<<<<<<<< + * cdef np.int64_t rf[3] * cdef np.int64_t iind[3] - * cdef np.int64_t oind[3] */ __pyx_v_tot = 0; - /* "yt/utilities/lib/misc_utilities.pyx":807 + /* "yt/utilities/lib/misc_utilities.pyx":826 * cdef np.ndarray[np.float64_t, ndim=3] ofield * cdef np.ndarray[np.float64_t, ndim=1] ifield * nf = len(input_fields) # <<<<<<<<<<<<<< * # The variable offsets governs for each dimension and each possible * # wrapping if we do it. Then the wi, wj, wk indices check into each */ - __pyx_t_1 = PyObject_Length(__pyx_v_input_fields); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 807, __pyx_L1_error) + __pyx_t_1 = PyObject_Length(__pyx_v_input_fields); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 826, __pyx_L1_error) __pyx_v_nf = __pyx_t_1; - /* "yt/utilities/lib/misc_utilities.pyx":814 + /* "yt/utilities/lib/misc_utilities.pyx":833 * cdef int offsets[3][3] * cdef np.int64_t off * for i in range(3): # <<<<<<<<<<<<<< @@ -16875,26 +17722,26 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "yt/utilities/lib/misc_utilities.pyx":817 + /* "yt/utilities/lib/misc_utilities.pyx":836 * # Offsets here is a way of accounting for periodicity. It keeps track * # of how to offset our grid as we loop over the icoords. * dim[i] = output_fields[0].shape[i] # <<<<<<<<<<<<<< * offsets[i][0] = offsets[i][2] = 0 * offsets[i][1] = 1 */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_output_fields, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_output_fields, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_dim[__pyx_v_i]) = __pyx_t_5; - /* "yt/utilities/lib/misc_utilities.pyx":818 + /* "yt/utilities/lib/misc_utilities.pyx":837 * # of how to offset our grid as we loop over the icoords. * dim[i] = output_fields[0].shape[i] * offsets[i][0] = offsets[i][2] = 0 # <<<<<<<<<<<<<< @@ -16904,7 +17751,7 @@ ((__pyx_v_offsets[__pyx_v_i])[0]) = 0; ((__pyx_v_offsets[__pyx_v_i])[2]) = 0; - /* "yt/utilities/lib/misc_utilities.pyx":819 + /* "yt/utilities/lib/misc_utilities.pyx":838 * dim[i] = output_fields[0].shape[i] * offsets[i][0] = offsets[i][2] = 0 * offsets[i][1] = 1 # <<<<<<<<<<<<<< @@ -16913,7 +17760,7 @@ */ ((__pyx_v_offsets[__pyx_v_i])[1]) = 1; - /* "yt/utilities/lib/misc_utilities.pyx":820 + /* "yt/utilities/lib/misc_utilities.pyx":839 * offsets[i][0] = offsets[i][2] = 0 * offsets[i][1] = 1 * if left_index[i] < 0: # <<<<<<<<<<<<<< @@ -16924,7 +17771,7 @@ __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_left_index.diminfo[0].strides)) < 0) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/misc_utilities.pyx":821 + /* "yt/utilities/lib/misc_utilities.pyx":840 * offsets[i][1] = 1 * if left_index[i] < 0: * offsets[i][2] = 1 # <<<<<<<<<<<<<< @@ -16933,7 +17780,7 @@ */ ((__pyx_v_offsets[__pyx_v_i])[2]) = 1; - /* "yt/utilities/lib/misc_utilities.pyx":820 + /* "yt/utilities/lib/misc_utilities.pyx":839 * offsets[i][0] = offsets[i][2] = 0 * offsets[i][1] = 1 * if left_index[i] < 0: # <<<<<<<<<<<<<< @@ -16942,7 +17789,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":822 + /* "yt/utilities/lib/misc_utilities.pyx":841 * if left_index[i] < 0: * offsets[i][2] = 1 * if left_index[i] + dim[i] >= level_dims[i]: # <<<<<<<<<<<<<< @@ -16954,7 +17801,7 @@ __pyx_t_7 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left_index.diminfo[0].strides)) + (__pyx_v_dim[__pyx_v_i])) >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_level_dims.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_level_dims.diminfo[0].strides))) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/misc_utilities.pyx":823 + /* "yt/utilities/lib/misc_utilities.pyx":842 * offsets[i][2] = 1 * if left_index[i] + dim[i] >= level_dims[i]: * offsets[i][0] = 1 # <<<<<<<<<<<<<< @@ -16963,7 +17810,7 @@ */ ((__pyx_v_offsets[__pyx_v_i])[0]) = 1; - /* "yt/utilities/lib/misc_utilities.pyx":822 + /* "yt/utilities/lib/misc_utilities.pyx":841 * if left_index[i] < 0: * offsets[i][2] = 1 * if left_index[i] + dim[i] >= level_dims[i]: # <<<<<<<<<<<<<< @@ -16973,7 +17820,7 @@ } } - /* "yt/utilities/lib/misc_utilities.pyx":824 + /* "yt/utilities/lib/misc_utilities.pyx":843 * if left_index[i] + dim[i] >= level_dims[i]: * offsets[i][0] = 1 * for n in range(nf): # <<<<<<<<<<<<<< @@ -16984,7 +17831,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_n = __pyx_t_2; - /* "yt/utilities/lib/misc_utilities.pyx":825 + /* "yt/utilities/lib/misc_utilities.pyx":844 * offsets[i][0] = 1 * for n in range(nf): * tot = 0 # <<<<<<<<<<<<<< @@ -16993,16 +17840,16 @@ */ __pyx_v_tot = 0; - /* "yt/utilities/lib/misc_utilities.pyx":826 + /* "yt/utilities/lib/misc_utilities.pyx":845 * for n in range(nf): * tot = 0 * ofield = output_fields[n] # <<<<<<<<<<<<<< * ifield = input_fields[n] * for i in range(ipos.shape[0]): */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_output_fields, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_output_fields, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 826, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 845, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -17018,22 +17865,22 @@ } } __pyx_pybuffernd_ofield.diminfo[0].strides = __pyx_pybuffernd_ofield.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ofield.diminfo[0].shape = __pyx_pybuffernd_ofield.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ofield.diminfo[1].strides = __pyx_pybuffernd_ofield.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ofield.diminfo[1].shape = __pyx_pybuffernd_ofield.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ofield.diminfo[2].strides = __pyx_pybuffernd_ofield.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ofield.diminfo[2].shape = __pyx_pybuffernd_ofield.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 826, __pyx_L1_error) + if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 845, __pyx_L1_error) } __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_v_ofield, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":827 + /* "yt/utilities/lib/misc_utilities.pyx":846 * tot = 0 * ofield = output_fields[n] * ifield = input_fields[n] # <<<<<<<<<<<<<< * for i in range(ipos.shape[0]): - * rf = refine_by**(output_level - ires[i]) + * for k in range(3): */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_input_fields, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_input_fields, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 827, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 846, __pyx_L1_error) __pyx_t_15 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -17049,90 +17896,102 @@ } } __pyx_pybuffernd_ifield.diminfo[0].strides = __pyx_pybuffernd_ifield.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ifield.diminfo[0].shape = __pyx_pybuffernd_ifield.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 827, __pyx_L1_error) + if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 846, __pyx_L1_error) } __pyx_t_15 = 0; __Pyx_XDECREF_SET(__pyx_v_ifield, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":828 + /* "yt/utilities/lib/misc_utilities.pyx":847 * ofield = output_fields[n] * ifield = input_fields[n] * for i in range(ipos.shape[0]): # <<<<<<<<<<<<<< - * rf = refine_by**(output_level - ires[i]) - * for wi in range(3): + * for k in range(3): + * rf[k] = refine_by[k]**(output_level - ires[i]) */ __pyx_t_16 = (__pyx_v_ipos->dimensions[0]); for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_16; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "yt/utilities/lib/misc_utilities.pyx":829 + /* "yt/utilities/lib/misc_utilities.pyx":848 * ifield = input_fields[n] * for i in range(ipos.shape[0]): - * rf = refine_by**(output_level - ires[i]) # <<<<<<<<<<<<<< + * for k in range(3): # <<<<<<<<<<<<<< + * rf[k] = refine_by[k]**(output_level - ires[i]) * for wi in range(3): - * if offsets[0][wi] == 0: continue */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_rf = __Pyx_pow___pyx_t_5numpy_int64_t(__pyx_v_refine_by, (__pyx_v_output_level - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ires.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_ires.diminfo[0].strides)))); + for (__pyx_t_17 = 0; __pyx_t_17 < 3; __pyx_t_17+=1) { + __pyx_v_k = __pyx_t_17; - /* "yt/utilities/lib/misc_utilities.pyx":830 + /* "yt/utilities/lib/misc_utilities.pyx":849 * for i in range(ipos.shape[0]): - * rf = refine_by**(output_level - ires[i]) + * for k in range(3): + * rf[k] = refine_by[k]**(output_level - ires[i]) # <<<<<<<<<<<<<< + * for wi in range(3): + * if offsets[0][wi] == 0: continue + */ + __pyx_t_18 = __pyx_v_k; + __pyx_t_19 = __pyx_v_i; + (__pyx_v_rf[__pyx_v_k]) = __Pyx_pow___pyx_t_5numpy_int64_t((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_refine_by.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_refine_by.diminfo[0].strides)), (__pyx_v_output_level - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ires.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_ires.diminfo[0].strides)))); + } + + /* "yt/utilities/lib/misc_utilities.pyx":850 + * for k in range(3): + * rf[k] = refine_by[k]**(output_level - ires[i]) * for wi in range(3): # <<<<<<<<<<<<<< * if offsets[0][wi] == 0: continue * off = (left_index[0] + level_dims[0]*(wi-1)) */ - for (__pyx_t_18 = 0; __pyx_t_18 < 3; __pyx_t_18+=1) { - __pyx_v_wi = __pyx_t_18; + for (__pyx_t_20 = 0; __pyx_t_20 < 3; __pyx_t_20+=1) { + __pyx_v_wi = __pyx_t_20; - /* "yt/utilities/lib/misc_utilities.pyx":831 - * rf = refine_by**(output_level - ires[i]) + /* "yt/utilities/lib/misc_utilities.pyx":851 + * rf[k] = refine_by[k]**(output_level - ires[i]) * for wi in range(3): * if offsets[0][wi] == 0: continue # <<<<<<<<<<<<<< * off = (left_index[0] + level_dims[0]*(wi-1)) - * iind[0] = ipos[i, 0] * rf - off + * iind[0] = ipos[i, 0] * rf[0] - off */ __pyx_t_7 = ((((__pyx_v_offsets[0])[__pyx_v_wi]) == 0) != 0); if (__pyx_t_7) { - goto __pyx_L11_continue; + goto __pyx_L13_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":832 + /* "yt/utilities/lib/misc_utilities.pyx":852 * for wi in range(3): * if offsets[0][wi] == 0: continue * off = (left_index[0] + level_dims[0]*(wi-1)) # <<<<<<<<<<<<<< - * iind[0] = ipos[i, 0] * rf - off + * iind[0] = ipos[i, 0] * rf[0] - off * # rf here is the "refinement factor", or, the number of zones */ - __pyx_t_19 = 0; - __pyx_t_20 = 0; - __pyx_v_off = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_left_index.diminfo[0].strides)) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_level_dims.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_level_dims.diminfo[0].strides)) * (__pyx_v_wi - 1))); + __pyx_t_21 = 0; + __pyx_t_22 = 0; + __pyx_v_off = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left_index.diminfo[0].strides)) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_level_dims.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_level_dims.diminfo[0].strides)) * (__pyx_v_wi - 1))); - /* "yt/utilities/lib/misc_utilities.pyx":833 + /* "yt/utilities/lib/misc_utilities.pyx":853 * if offsets[0][wi] == 0: continue * off = (left_index[0] + level_dims[0]*(wi-1)) - * iind[0] = ipos[i, 0] * rf - off # <<<<<<<<<<<<<< + * iind[0] = ipos[i, 0] * rf[0] - off # <<<<<<<<<<<<<< * # rf here is the "refinement factor", or, the number of zones * # that this zone could potentially contribute to our filled */ - __pyx_t_21 = __pyx_v_i; - __pyx_t_22 = 0; - (__pyx_v_iind[0]) = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ipos.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_ipos.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ipos.diminfo[1].strides)) * __pyx_v_rf) - __pyx_v_off); + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = 0; + (__pyx_v_iind[0]) = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ipos.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_ipos.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_ipos.diminfo[1].strides)) * (__pyx_v_rf[0])) - __pyx_v_off); - /* "yt/utilities/lib/misc_utilities.pyx":837 + /* "yt/utilities/lib/misc_utilities.pyx":857 * # that this zone could potentially contribute to our filled * # grid. - * for oi in range(rf): # <<<<<<<<<<<<<< + * for oi in range(rf[0]): # <<<<<<<<<<<<<< * # Now we need to apply our offset * oind[0] = oi + iind[0] */ - __pyx_t_5 = __pyx_v_rf; - for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_5; __pyx_t_23+=1) { - __pyx_v_oi = __pyx_t_23; + __pyx_t_5 = (__pyx_v_rf[0]); + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_5; __pyx_t_25+=1) { + __pyx_v_oi = __pyx_t_25; - /* "yt/utilities/lib/misc_utilities.pyx":839 - * for oi in range(rf): + /* "yt/utilities/lib/misc_utilities.pyx":859 + * for oi in range(rf[0]): * # Now we need to apply our offset * oind[0] = oi + iind[0] # <<<<<<<<<<<<<< * if oind[0] < 0: @@ -17140,7 +17999,7 @@ */ (__pyx_v_oind[0]) = (__pyx_v_oi + (__pyx_v_iind[0])); - /* "yt/utilities/lib/misc_utilities.pyx":840 + /* "yt/utilities/lib/misc_utilities.pyx":860 * # Now we need to apply our offset * oind[0] = oi + iind[0] * if oind[0] < 0: # <<<<<<<<<<<<<< @@ -17150,16 +18009,16 @@ __pyx_t_7 = (((__pyx_v_oind[0]) < 0) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/misc_utilities.pyx":841 + /* "yt/utilities/lib/misc_utilities.pyx":861 * oind[0] = oi + iind[0] * if oind[0] < 0: * continue # <<<<<<<<<<<<<< * elif oind[0] >= dim[0]: * break */ - goto __pyx_L14_continue; + goto __pyx_L16_continue; - /* "yt/utilities/lib/misc_utilities.pyx":840 + /* "yt/utilities/lib/misc_utilities.pyx":860 * # Now we need to apply our offset * oind[0] = oi + iind[0] * if oind[0] < 0: # <<<<<<<<<<<<<< @@ -17168,7 +18027,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":842 + /* "yt/utilities/lib/misc_utilities.pyx":862 * if oind[0] < 0: * continue * elif oind[0] >= dim[0]: # <<<<<<<<<<<<<< @@ -17178,16 +18037,16 @@ __pyx_t_7 = (((__pyx_v_oind[0]) >= (__pyx_v_dim[0])) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/misc_utilities.pyx":843 + /* "yt/utilities/lib/misc_utilities.pyx":863 * continue * elif oind[0] >= dim[0]: * break # <<<<<<<<<<<<<< * for wj in range(3): * if offsets[1][wj] == 0: continue */ - goto __pyx_L15_break; + goto __pyx_L17_break; - /* "yt/utilities/lib/misc_utilities.pyx":842 + /* "yt/utilities/lib/misc_utilities.pyx":862 * if oind[0] < 0: * continue * elif oind[0] >= dim[0]: # <<<<<<<<<<<<<< @@ -17196,72 +18055,72 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":844 + /* "yt/utilities/lib/misc_utilities.pyx":864 * elif oind[0] >= dim[0]: * break * for wj in range(3): # <<<<<<<<<<<<<< * if offsets[1][wj] == 0: continue * off = (left_index[1] + level_dims[1]*(wj-1)) */ - for (__pyx_t_24 = 0; __pyx_t_24 < 3; __pyx_t_24+=1) { - __pyx_v_wj = __pyx_t_24; + for (__pyx_t_26 = 0; __pyx_t_26 < 3; __pyx_t_26+=1) { + __pyx_v_wj = __pyx_t_26; - /* "yt/utilities/lib/misc_utilities.pyx":845 + /* "yt/utilities/lib/misc_utilities.pyx":865 * break * for wj in range(3): * if offsets[1][wj] == 0: continue # <<<<<<<<<<<<<< * off = (left_index[1] + level_dims[1]*(wj-1)) - * iind[1] = ipos[i, 1] * rf - off + * iind[1] = ipos[i, 1] * rf[1] - off */ __pyx_t_7 = ((((__pyx_v_offsets[1])[__pyx_v_wj]) == 0) != 0); if (__pyx_t_7) { - goto __pyx_L17_continue; + goto __pyx_L19_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":846 + /* "yt/utilities/lib/misc_utilities.pyx":866 * for wj in range(3): * if offsets[1][wj] == 0: continue * off = (left_index[1] + level_dims[1]*(wj-1)) # <<<<<<<<<<<<<< - * iind[1] = ipos[i, 1] * rf - off - * for oj in range(rf): + * iind[1] = ipos[i, 1] * rf[1] - off + * for oj in range(rf[1]): */ - __pyx_t_25 = 1; - __pyx_t_26 = 1; - __pyx_v_off = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_left_index.diminfo[0].strides)) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_level_dims.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_level_dims.diminfo[0].strides)) * (__pyx_v_wj - 1))); + __pyx_t_27 = 1; + __pyx_t_28 = 1; + __pyx_v_off = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_left_index.diminfo[0].strides)) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_level_dims.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_level_dims.diminfo[0].strides)) * (__pyx_v_wj - 1))); - /* "yt/utilities/lib/misc_utilities.pyx":847 + /* "yt/utilities/lib/misc_utilities.pyx":867 * if offsets[1][wj] == 0: continue * off = (left_index[1] + level_dims[1]*(wj-1)) - * iind[1] = ipos[i, 1] * rf - off # <<<<<<<<<<<<<< - * for oj in range(rf): + * iind[1] = ipos[i, 1] * rf[1] - off # <<<<<<<<<<<<<< + * for oj in range(rf[1]): * oind[1] = oj + iind[1] */ - __pyx_t_27 = __pyx_v_i; - __pyx_t_28 = 1; - (__pyx_v_iind[1]) = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ipos.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_ipos.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_ipos.diminfo[1].strides)) * __pyx_v_rf) - __pyx_v_off); + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 1; + (__pyx_v_iind[1]) = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ipos.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_ipos.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_ipos.diminfo[1].strides)) * (__pyx_v_rf[1])) - __pyx_v_off); - /* "yt/utilities/lib/misc_utilities.pyx":848 + /* "yt/utilities/lib/misc_utilities.pyx":868 * off = (left_index[1] + level_dims[1]*(wj-1)) - * iind[1] = ipos[i, 1] * rf - off - * for oj in range(rf): # <<<<<<<<<<<<<< + * iind[1] = ipos[i, 1] * rf[1] - off + * for oj in range(rf[1]): # <<<<<<<<<<<<<< * oind[1] = oj + iind[1] * if oind[1] < 0: */ - __pyx_t_29 = __pyx_v_rf; - for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) { - __pyx_v_oj = __pyx_t_30; - - /* "yt/utilities/lib/misc_utilities.pyx":849 - * iind[1] = ipos[i, 1] * rf - off - * for oj in range(rf): + __pyx_t_31 = (__pyx_v_rf[1]); + for (__pyx_t_32 = 0; __pyx_t_32 < __pyx_t_31; __pyx_t_32+=1) { + __pyx_v_oj = __pyx_t_32; + + /* "yt/utilities/lib/misc_utilities.pyx":869 + * iind[1] = ipos[i, 1] * rf[1] - off + * for oj in range(rf[1]): * oind[1] = oj + iind[1] # <<<<<<<<<<<<<< * if oind[1] < 0: * continue */ (__pyx_v_oind[1]) = (__pyx_v_oj + (__pyx_v_iind[1])); - /* "yt/utilities/lib/misc_utilities.pyx":850 - * for oj in range(rf): + /* "yt/utilities/lib/misc_utilities.pyx":870 + * for oj in range(rf[1]): * oind[1] = oj + iind[1] * if oind[1] < 0: # <<<<<<<<<<<<<< * continue @@ -17270,17 +18129,17 @@ __pyx_t_7 = (((__pyx_v_oind[1]) < 0) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/misc_utilities.pyx":851 + /* "yt/utilities/lib/misc_utilities.pyx":871 * oind[1] = oj + iind[1] * if oind[1] < 0: * continue # <<<<<<<<<<<<<< * elif oind[1] >= dim[1]: * break */ - goto __pyx_L20_continue; + goto __pyx_L22_continue; - /* "yt/utilities/lib/misc_utilities.pyx":850 - * for oj in range(rf): + /* "yt/utilities/lib/misc_utilities.pyx":870 + * for oj in range(rf[1]): * oind[1] = oj + iind[1] * if oind[1] < 0: # <<<<<<<<<<<<<< * continue @@ -17288,7 +18147,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":852 + /* "yt/utilities/lib/misc_utilities.pyx":872 * if oind[1] < 0: * continue * elif oind[1] >= dim[1]: # <<<<<<<<<<<<<< @@ -17298,16 +18157,16 @@ __pyx_t_7 = (((__pyx_v_oind[1]) >= (__pyx_v_dim[1])) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/misc_utilities.pyx":853 + /* "yt/utilities/lib/misc_utilities.pyx":873 * continue * elif oind[1] >= dim[1]: * break # <<<<<<<<<<<<<< * for wk in range(3): * if offsets[2][wk] == 0: continue */ - goto __pyx_L21_break; + goto __pyx_L23_break; - /* "yt/utilities/lib/misc_utilities.pyx":852 + /* "yt/utilities/lib/misc_utilities.pyx":872 * if oind[1] < 0: * continue * elif oind[1] >= dim[1]: # <<<<<<<<<<<<<< @@ -17316,72 +18175,72 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":854 + /* "yt/utilities/lib/misc_utilities.pyx":874 * elif oind[1] >= dim[1]: * break * for wk in range(3): # <<<<<<<<<<<<<< * if offsets[2][wk] == 0: continue * off = (left_index[2] + level_dims[2]*(wk-1)) */ - for (__pyx_t_31 = 0; __pyx_t_31 < 3; __pyx_t_31+=1) { - __pyx_v_wk = __pyx_t_31; + for (__pyx_t_33 = 0; __pyx_t_33 < 3; __pyx_t_33+=1) { + __pyx_v_wk = __pyx_t_33; - /* "yt/utilities/lib/misc_utilities.pyx":855 + /* "yt/utilities/lib/misc_utilities.pyx":875 * break * for wk in range(3): * if offsets[2][wk] == 0: continue # <<<<<<<<<<<<<< * off = (left_index[2] + level_dims[2]*(wk-1)) - * iind[2] = ipos[i, 2] * rf - off + * iind[2] = ipos[i, 2] * rf[2] - off */ __pyx_t_7 = ((((__pyx_v_offsets[2])[__pyx_v_wk]) == 0) != 0); if (__pyx_t_7) { - goto __pyx_L23_continue; + goto __pyx_L25_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":856 + /* "yt/utilities/lib/misc_utilities.pyx":876 * for wk in range(3): * if offsets[2][wk] == 0: continue * off = (left_index[2] + level_dims[2]*(wk-1)) # <<<<<<<<<<<<<< - * iind[2] = ipos[i, 2] * rf - off - * for ok in range(rf): + * iind[2] = ipos[i, 2] * rf[2] - off + * for ok in range(rf[2]): */ - __pyx_t_32 = 2; - __pyx_t_33 = 2; - __pyx_v_off = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_left_index.diminfo[0].strides)) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_level_dims.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_level_dims.diminfo[0].strides)) * (__pyx_v_wk - 1))); + __pyx_t_34 = 2; + __pyx_t_35 = 2; + __pyx_v_off = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_index.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left_index.diminfo[0].strides)) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_level_dims.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_level_dims.diminfo[0].strides)) * (__pyx_v_wk - 1))); - /* "yt/utilities/lib/misc_utilities.pyx":857 + /* "yt/utilities/lib/misc_utilities.pyx":877 * if offsets[2][wk] == 0: continue * off = (left_index[2] + level_dims[2]*(wk-1)) - * iind[2] = ipos[i, 2] * rf - off # <<<<<<<<<<<<<< - * for ok in range(rf): + * iind[2] = ipos[i, 2] * rf[2] - off # <<<<<<<<<<<<<< + * for ok in range(rf[2]): * oind[2] = ok + iind[2] */ - __pyx_t_34 = __pyx_v_i; - __pyx_t_35 = 2; - (__pyx_v_iind[2]) = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ipos.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_ipos.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_ipos.diminfo[1].strides)) * __pyx_v_rf) - __pyx_v_off); + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = 2; + (__pyx_v_iind[2]) = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ipos.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_ipos.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_ipos.diminfo[1].strides)) * (__pyx_v_rf[2])) - __pyx_v_off); - /* "yt/utilities/lib/misc_utilities.pyx":858 + /* "yt/utilities/lib/misc_utilities.pyx":878 * off = (left_index[2] + level_dims[2]*(wk-1)) - * iind[2] = ipos[i, 2] * rf - off - * for ok in range(rf): # <<<<<<<<<<<<<< + * iind[2] = ipos[i, 2] * rf[2] - off + * for ok in range(rf[2]): # <<<<<<<<<<<<<< * oind[2] = ok + iind[2] * if oind[2] < 0: */ - __pyx_t_36 = __pyx_v_rf; - for (__pyx_t_37 = 0; __pyx_t_37 < __pyx_t_36; __pyx_t_37+=1) { - __pyx_v_ok = __pyx_t_37; - - /* "yt/utilities/lib/misc_utilities.pyx":859 - * iind[2] = ipos[i, 2] * rf - off - * for ok in range(rf): + __pyx_t_38 = (__pyx_v_rf[2]); + for (__pyx_t_39 = 0; __pyx_t_39 < __pyx_t_38; __pyx_t_39+=1) { + __pyx_v_ok = __pyx_t_39; + + /* "yt/utilities/lib/misc_utilities.pyx":879 + * iind[2] = ipos[i, 2] * rf[2] - off + * for ok in range(rf[2]): * oind[2] = ok + iind[2] # <<<<<<<<<<<<<< * if oind[2] < 0: * continue */ (__pyx_v_oind[2]) = (__pyx_v_ok + (__pyx_v_iind[2])); - /* "yt/utilities/lib/misc_utilities.pyx":860 - * for ok in range(rf): + /* "yt/utilities/lib/misc_utilities.pyx":880 + * for ok in range(rf[2]): * oind[2] = ok + iind[2] * if oind[2] < 0: # <<<<<<<<<<<<<< * continue @@ -17390,17 +18249,17 @@ __pyx_t_7 = (((__pyx_v_oind[2]) < 0) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/misc_utilities.pyx":861 + /* "yt/utilities/lib/misc_utilities.pyx":881 * oind[2] = ok + iind[2] * if oind[2] < 0: * continue # <<<<<<<<<<<<<< * elif oind[2] >= dim[2]: * break */ - goto __pyx_L26_continue; + goto __pyx_L28_continue; - /* "yt/utilities/lib/misc_utilities.pyx":860 - * for ok in range(rf): + /* "yt/utilities/lib/misc_utilities.pyx":880 + * for ok in range(rf[2]): * oind[2] = ok + iind[2] * if oind[2] < 0: # <<<<<<<<<<<<<< * continue @@ -17408,7 +18267,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":862 + /* "yt/utilities/lib/misc_utilities.pyx":882 * if oind[2] < 0: * continue * elif oind[2] >= dim[2]: # <<<<<<<<<<<<<< @@ -17418,16 +18277,16 @@ __pyx_t_7 = (((__pyx_v_oind[2]) >= (__pyx_v_dim[2])) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/misc_utilities.pyx":863 + /* "yt/utilities/lib/misc_utilities.pyx":883 * continue * elif oind[2] >= dim[2]: * break # <<<<<<<<<<<<<< * ofield[oind[0], oind[1], oind[2]] = \ * ifield[i] */ - goto __pyx_L27_break; + goto __pyx_L29_break; - /* "yt/utilities/lib/misc_utilities.pyx":862 + /* "yt/utilities/lib/misc_utilities.pyx":882 * if oind[2] < 0: * continue * elif oind[2] >= dim[2]: # <<<<<<<<<<<<<< @@ -17436,28 +18295,28 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":865 + /* "yt/utilities/lib/misc_utilities.pyx":885 * break * ofield[oind[0], oind[1], oind[2]] = \ * ifield[i] # <<<<<<<<<<<<<< * tot += 1 * return tot */ - __pyx_t_38 = __pyx_v_i; + __pyx_t_40 = __pyx_v_i; - /* "yt/utilities/lib/misc_utilities.pyx":864 + /* "yt/utilities/lib/misc_utilities.pyx":884 * elif oind[2] >= dim[2]: * break * ofield[oind[0], oind[1], oind[2]] = \ # <<<<<<<<<<<<<< * ifield[i] * tot += 1 */ - __pyx_t_39 = (__pyx_v_oind[0]); - __pyx_t_40 = (__pyx_v_oind[1]); - __pyx_t_41 = (__pyx_v_oind[2]); - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ofield.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_ofield.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_ofield.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_ofield.diminfo[2].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ifield.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_ifield.diminfo[0].strides)); + __pyx_t_41 = (__pyx_v_oind[0]); + __pyx_t_42 = (__pyx_v_oind[1]); + __pyx_t_43 = (__pyx_v_oind[2]); + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ofield.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_ofield.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_ofield.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_ofield.diminfo[2].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ifield.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_ifield.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":866 + /* "yt/utilities/lib/misc_utilities.pyx":886 * ofield[oind[0], oind[1], oind[2]] = \ * ifield[i] * tot += 1 # <<<<<<<<<<<<<< @@ -17465,25 +18324,25 @@ * */ __pyx_v_tot = (__pyx_v_tot + 1); - __pyx_L26_continue:; + __pyx_L28_continue:; } - __pyx_L27_break:; - __pyx_L23_continue:; + __pyx_L29_break:; + __pyx_L25_continue:; } - __pyx_L20_continue:; + __pyx_L22_continue:; } - __pyx_L21_break:; - __pyx_L17_continue:; + __pyx_L23_break:; + __pyx_L19_continue:; } - __pyx_L14_continue:; + __pyx_L16_continue:; } - __pyx_L15_break:; - __pyx_L11_continue:; + __pyx_L17_break:; + __pyx_L13_continue:; } } } - /* "yt/utilities/lib/misc_utilities.pyx":867 + /* "yt/utilities/lib/misc_utilities.pyx":887 * ifield[i] * tot += 1 * return tot # <<<<<<<<<<<<<< @@ -17491,13 +18350,13 @@ * @cython.cdivision(True) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_tot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_tot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":792 + /* "yt/utilities/lib/misc_utilities.pyx":810 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_region(input_fields, output_fields, # <<<<<<<<<<<<<< @@ -17519,6 +18378,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_index.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_level_dims.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ofield.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_refine_by.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.fill_region", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; @@ -17530,6 +18390,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_index.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_level_dims.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ofield.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_refine_by.rcbuffer->pybuffer); __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_ofield); __Pyx_XDECREF((PyObject *)__pyx_v_ifield); @@ -17538,7 +18399,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":872 +/* "yt/utilities/lib/misc_utilities.pyx":892 * @cython.boundscheck(False) * @cython.wraparound(False) * def fill_region_float(np.ndarray[np.float64_t, ndim=2] fcoords, # <<<<<<<<<<<<<< @@ -17566,7 +18427,7 @@ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fcoords,&__pyx_n_s_fwidth,&__pyx_n_s_data,&__pyx_n_s_box_left_edge,&__pyx_n_s_box_right_edge,&__pyx_n_s_dest,&__pyx_n_s_antialias,&__pyx_n_s_period,&__pyx_n_s_check_period,0}; PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; - /* "yt/utilities/lib/misc_utilities.pyx":879 + /* "yt/utilities/lib/misc_utilities.pyx":899 * np.ndarray[np.float64_t, ndim=3] dest, * int antialias = 1, * period = None, # <<<<<<<<<<<<<< @@ -17579,14 +18440,23 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -17595,41 +18465,49 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fcoords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fwidth)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_region_float", 0, 6, 9, 1); __PYX_ERR(0, 872, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region_float", 0, 6, 9, 1); __PYX_ERR(0, 892, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_region_float", 0, 6, 9, 2); __PYX_ERR(0, 872, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region_float", 0, 6, 9, 2); __PYX_ERR(0, 892, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_box_left_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_region_float", 0, 6, 9, 3); __PYX_ERR(0, 872, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region_float", 0, 6, 9, 3); __PYX_ERR(0, 892, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_box_right_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_region_float", 0, 6, 9, 4); __PYX_ERR(0, 872, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region_float", 0, 6, 9, 4); __PYX_ERR(0, 892, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fill_region_float", 0, 6, 9, 5); __PYX_ERR(0, 872, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region_float", 0, 6, 9, 5); __PYX_ERR(0, 892, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_antialias); if (value) { values[6] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_period); if (value) { values[7] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_check_period); @@ -17637,13 +18515,16 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_region_float") < 0)) __PYX_ERR(0, 872, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_region_float") < 0)) __PYX_ERR(0, 892, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -17661,34 +18542,34 @@ __pyx_v_box_right_edge = ((PyArrayObject *)values[4]); __pyx_v_dest = ((PyArrayObject *)values[5]); if (values[6]) { - __pyx_v_antialias = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_antialias == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 878, __pyx_L3_error) + __pyx_v_antialias = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_antialias == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L3_error) } else { __pyx_v_antialias = ((int)1); } __pyx_v_period = values[7]; if (values[8]) { - __pyx_v_check_period = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_check_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 880, __pyx_L3_error) + __pyx_v_check_period = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_check_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L3_error) } else { __pyx_v_check_period = ((int)1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fill_region_float", 0, 6, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 872, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_region_float", 0, 6, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 892, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.fill_region_float", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fcoords), __pyx_ptype_5numpy_ndarray, 1, "fcoords", 0))) __PYX_ERR(0, 872, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fwidth), __pyx_ptype_5numpy_ndarray, 1, "fwidth", 0))) __PYX_ERR(0, 873, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 874, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_left_edge), __pyx_ptype_5numpy_ndarray, 1, "box_left_edge", 0))) __PYX_ERR(0, 875, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_right_edge), __pyx_ptype_5numpy_ndarray, 1, "box_right_edge", 0))) __PYX_ERR(0, 876, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest), __pyx_ptype_5numpy_ndarray, 1, "dest", 0))) __PYX_ERR(0, 877, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fcoords), __pyx_ptype_5numpy_ndarray, 1, "fcoords", 0))) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fwidth), __pyx_ptype_5numpy_ndarray, 1, "fwidth", 0))) __PYX_ERR(0, 893, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 894, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_left_edge), __pyx_ptype_5numpy_ndarray, 1, "box_left_edge", 0))) __PYX_ERR(0, 895, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_right_edge), __pyx_ptype_5numpy_ndarray, 1, "box_right_edge", 0))) __PYX_ERR(0, 896, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest), __pyx_ptype_5numpy_ndarray, 1, "dest", 0))) __PYX_ERR(0, 897, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_14misc_utilities_38fill_region_float(__pyx_self, __pyx_v_fcoords, __pyx_v_fwidth, __pyx_v_data, __pyx_v_box_left_edge, __pyx_v_box_right_edge, __pyx_v_dest, __pyx_v_antialias, __pyx_v_period, __pyx_v_check_period); - /* "yt/utilities/lib/misc_utilities.pyx":872 + /* "yt/utilities/lib/misc_utilities.pyx":892 * @cython.boundscheck(False) * @cython.wraparound(False) * def fill_region_float(np.ndarray[np.float64_t, ndim=2] fcoords, # <<<<<<<<<<<<<< @@ -17808,36 +18689,36 @@ __pyx_pybuffernd_dest.rcbuffer = &__pyx_pybuffer_dest; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fcoords.rcbuffer->pybuffer, (PyObject*)__pyx_v_fcoords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 872, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fcoords.rcbuffer->pybuffer, (PyObject*)__pyx_v_fcoords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 892, __pyx_L1_error) } __pyx_pybuffernd_fcoords.diminfo[0].strides = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fcoords.diminfo[0].shape = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fcoords.diminfo[1].strides = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fcoords.diminfo[1].shape = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fwidth.rcbuffer->pybuffer, (PyObject*)__pyx_v_fwidth, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 872, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fwidth.rcbuffer->pybuffer, (PyObject*)__pyx_v_fwidth, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 892, __pyx_L1_error) } __pyx_pybuffernd_fwidth.diminfo[0].strides = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fwidth.diminfo[0].shape = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fwidth.diminfo[1].strides = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fwidth.diminfo[1].shape = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 872, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 892, __pyx_L1_error) } __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_box_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 872, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_box_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 892, __pyx_L1_error) } __pyx_pybuffernd_box_left_edge.diminfo[0].strides = __pyx_pybuffernd_box_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_box_left_edge.diminfo[0].shape = __pyx_pybuffernd_box_left_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_box_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 872, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_box_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 892, __pyx_L1_error) } __pyx_pybuffernd_box_right_edge.diminfo[0].strides = __pyx_pybuffernd_box_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_box_right_edge.diminfo[0].shape = __pyx_pybuffernd_box_right_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dest.rcbuffer->pybuffer, (PyObject*)__pyx_v_dest, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 872, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dest.rcbuffer->pybuffer, (PyObject*)__pyx_v_dest, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 892, __pyx_L1_error) } __pyx_pybuffernd_dest.diminfo[0].strides = __pyx_pybuffernd_dest.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dest.diminfo[0].shape = __pyx_pybuffernd_dest.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dest.diminfo[1].strides = __pyx_pybuffernd_dest.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dest.diminfo[1].shape = __pyx_pybuffernd_dest.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dest.diminfo[2].strides = __pyx_pybuffernd_dest.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dest.diminfo[2].shape = __pyx_pybuffernd_dest.rcbuffer->pybuffer.shape[2]; - /* "yt/utilities/lib/misc_utilities.pyx":902 + /* "yt/utilities/lib/misc_utilities.pyx":922 * cdef int diter[3][2] * cdef np.float64_t diterv[3][2] * if period is not None: # <<<<<<<<<<<<<< @@ -17848,7 +18729,7 @@ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/misc_utilities.pyx":903 + /* "yt/utilities/lib/misc_utilities.pyx":923 * cdef np.float64_t diterv[3][2] * if period is not None: * for i in range(3): # <<<<<<<<<<<<<< @@ -17858,21 +18739,21 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/utilities/lib/misc_utilities.pyx":904 + /* "yt/utilities/lib/misc_utilities.pyx":924 * if period is not None: * for i in range(3): * ds_period[i] = period[i] # <<<<<<<<<<<<<< * else: * ds_period[0] = ds_period[1] = ds_period[2] = 0.0 */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_period, __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 904, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_period, __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_ds_period[__pyx_v_i]) = __pyx_t_5; } - /* "yt/utilities/lib/misc_utilities.pyx":902 + /* "yt/utilities/lib/misc_utilities.pyx":922 * cdef int diter[3][2] * cdef np.float64_t diterv[3][2] * if period is not None: # <<<<<<<<<<<<<< @@ -17882,7 +18763,7 @@ goto __pyx_L3; } - /* "yt/utilities/lib/misc_utilities.pyx":906 + /* "yt/utilities/lib/misc_utilities.pyx":926 * ds_period[i] = period[i] * else: * ds_period[0] = ds_period[1] = ds_period[2] = 0.0 # <<<<<<<<<<<<<< @@ -17896,16 +18777,16 @@ } __pyx_L3:; - /* "yt/utilities/lib/misc_utilities.pyx":907 + /* "yt/utilities/lib/misc_utilities.pyx":927 * else: * ds_period[0] = ds_period[1] = ds_period[2] = 0.0 * box_left_edge = _ensure_code(box_left_edge) # <<<<<<<<<<<<<< * box_right_edge = _ensure_code(box_right_edge) * _ensure_code(fcoords) */ - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_box_left_edge)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_box_left_edge)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 907, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 927, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -17921,22 +18802,22 @@ } } __pyx_pybuffernd_box_left_edge.diminfo[0].strides = __pyx_pybuffernd_box_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_box_left_edge.diminfo[0].shape = __pyx_pybuffernd_box_left_edge.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 907, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 927, __pyx_L1_error) } __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_box_left_edge, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":908 + /* "yt/utilities/lib/misc_utilities.pyx":928 * ds_period[0] = ds_period[1] = ds_period[2] = 0.0 * box_left_edge = _ensure_code(box_left_edge) * box_right_edge = _ensure_code(box_right_edge) # <<<<<<<<<<<<<< * _ensure_code(fcoords) * _ensure_code(fwidth) */ - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_box_right_edge)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_box_right_edge)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 908, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 928, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -17952,35 +18833,35 @@ } } __pyx_pybuffernd_box_right_edge.diminfo[0].strides = __pyx_pybuffernd_box_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_box_right_edge.diminfo[0].shape = __pyx_pybuffernd_box_right_edge.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 908, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 928, __pyx_L1_error) } __pyx_t_11 = 0; __Pyx_DECREF_SET(__pyx_v_box_right_edge, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":909 + /* "yt/utilities/lib/misc_utilities.pyx":929 * box_left_edge = _ensure_code(box_left_edge) * box_right_edge = _ensure_code(box_right_edge) * _ensure_code(fcoords) # <<<<<<<<<<<<<< * _ensure_code(fwidth) * for i in range(3): */ - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_fcoords)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 909, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_fcoords)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":910 + /* "yt/utilities/lib/misc_utilities.pyx":930 * box_right_edge = _ensure_code(box_right_edge) * _ensure_code(fcoords) * _ensure_code(fwidth) # <<<<<<<<<<<<<< * for i in range(3): * LE[i] = box_left_edge[i] */ - __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_fwidth)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 910, __pyx_L1_error) + __pyx_t_4 = __pyx_f_2yt_8geometry_18selection_routines__ensure_code(((PyObject *)__pyx_v_fwidth)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":911 + /* "yt/utilities/lib/misc_utilities.pyx":931 * _ensure_code(fcoords) * _ensure_code(fwidth) * for i in range(3): # <<<<<<<<<<<<<< @@ -17990,7 +18871,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/utilities/lib/misc_utilities.pyx":912 + /* "yt/utilities/lib/misc_utilities.pyx":932 * _ensure_code(fwidth) * for i in range(3): * LE[i] = box_left_edge[i] # <<<<<<<<<<<<<< @@ -18000,7 +18881,7 @@ __pyx_t_12 = __pyx_v_i; (__pyx_v_LE[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_box_left_edge.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_box_left_edge.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":913 + /* "yt/utilities/lib/misc_utilities.pyx":933 * for i in range(3): * LE[i] = box_left_edge[i] * RE[i] = box_right_edge[i] # <<<<<<<<<<<<<< @@ -18010,7 +18891,7 @@ __pyx_t_13 = __pyx_v_i; (__pyx_v_RE[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_box_right_edge.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_box_right_edge.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":914 + /* "yt/utilities/lib/misc_utilities.pyx":934 * LE[i] = box_left_edge[i] * RE[i] = box_right_edge[i] * width[i] = RE[i] - LE[i] # <<<<<<<<<<<<<< @@ -18019,7 +18900,7 @@ */ (__pyx_v_width[__pyx_v_i]) = ((__pyx_v_RE[__pyx_v_i]) - (__pyx_v_LE[__pyx_v_i])); - /* "yt/utilities/lib/misc_utilities.pyx":915 + /* "yt/utilities/lib/misc_utilities.pyx":935 * RE[i] = box_right_edge[i] * width[i] = RE[i] - LE[i] * dims[i] = dest.shape[i] # <<<<<<<<<<<<<< @@ -18028,7 +18909,7 @@ */ (__pyx_v_dims[__pyx_v_i]) = (__pyx_v_dest->dimensions[__pyx_v_i]); - /* "yt/utilities/lib/misc_utilities.pyx":916 + /* "yt/utilities/lib/misc_utilities.pyx":936 * width[i] = RE[i] - LE[i] * dims[i] = dest.shape[i] * box_dds[i] = width[i] / dims[i] # <<<<<<<<<<<<<< @@ -18037,7 +18918,7 @@ */ (__pyx_v_box_dds[__pyx_v_i]) = ((__pyx_v_width[__pyx_v_i]) / (__pyx_v_dims[__pyx_v_i])); - /* "yt/utilities/lib/misc_utilities.pyx":917 + /* "yt/utilities/lib/misc_utilities.pyx":937 * dims[i] = dest.shape[i] * box_dds[i] = width[i] / dims[i] * box_idds[i] = 1.0/box_dds[i] # <<<<<<<<<<<<<< @@ -18046,7 +18927,7 @@ */ (__pyx_v_box_idds[__pyx_v_i]) = (1.0 / (__pyx_v_box_dds[__pyx_v_i])); - /* "yt/utilities/lib/misc_utilities.pyx":918 + /* "yt/utilities/lib/misc_utilities.pyx":938 * box_dds[i] = width[i] / dims[i] * box_idds[i] = 1.0/box_dds[i] * diter[i][0] = diter[i][1] = 0 # <<<<<<<<<<<<<< @@ -18056,7 +18937,7 @@ ((__pyx_v_diter[__pyx_v_i])[0]) = 0; ((__pyx_v_diter[__pyx_v_i])[1]) = 0; - /* "yt/utilities/lib/misc_utilities.pyx":919 + /* "yt/utilities/lib/misc_utilities.pyx":939 * box_idds[i] = 1.0/box_dds[i] * diter[i][0] = diter[i][1] = 0 * diterv[i][0] = diterv[i][1] = 0.0 # <<<<<<<<<<<<<< @@ -18066,7 +18947,7 @@ ((__pyx_v_diterv[__pyx_v_i])[0]) = 0.0; ((__pyx_v_diterv[__pyx_v_i])[1]) = 0.0; - /* "yt/utilities/lib/misc_utilities.pyx":920 + /* "yt/utilities/lib/misc_utilities.pyx":940 * diter[i][0] = diter[i][1] = 0 * diterv[i][0] = diterv[i][1] = 0.0 * overlap[i] = 1.0 # <<<<<<<<<<<<<< @@ -18076,7 +18957,7 @@ (__pyx_v_overlap[__pyx_v_i]) = 1.0; } - /* "yt/utilities/lib/misc_utilities.pyx":921 + /* "yt/utilities/lib/misc_utilities.pyx":941 * diterv[i][0] = diterv[i][1] = 0.0 * overlap[i] = 1.0 * with nogil: # <<<<<<<<<<<<<< @@ -18087,10 +18968,11 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/utilities/lib/misc_utilities.pyx":922 + /* "yt/utilities/lib/misc_utilities.pyx":942 * overlap[i] = 1.0 * with nogil: * for p in range(fcoords.shape[0]): # <<<<<<<<<<<<<< @@ -18101,7 +18983,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_14; __pyx_t_3+=1) { __pyx_v_p = __pyx_t_3; - /* "yt/utilities/lib/misc_utilities.pyx":923 + /* "yt/utilities/lib/misc_utilities.pyx":943 * with nogil: * for p in range(fcoords.shape[0]): * for i in range(3): # <<<<<<<<<<<<<< @@ -18111,7 +18993,7 @@ for (__pyx_t_15 = 0; __pyx_t_15 < 3; __pyx_t_15+=1) { __pyx_v_i = __pyx_t_15; - /* "yt/utilities/lib/misc_utilities.pyx":924 + /* "yt/utilities/lib/misc_utilities.pyx":944 * for p in range(fcoords.shape[0]): * for i in range(3): * diter[i][1] = 999 # <<<<<<<<<<<<<< @@ -18120,7 +19002,7 @@ */ ((__pyx_v_diter[__pyx_v_i])[1]) = 0x3E7; - /* "yt/utilities/lib/misc_utilities.pyx":925 + /* "yt/utilities/lib/misc_utilities.pyx":945 * for i in range(3): * diter[i][1] = 999 * odsp[i] = fwidth[p,i]*0.5 # <<<<<<<<<<<<<< @@ -18131,7 +19013,7 @@ __pyx_t_17 = __pyx_v_i; (__pyx_v_odsp[__pyx_v_i]) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_fwidth.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_fwidth.diminfo[1].strides)) * 0.5); - /* "yt/utilities/lib/misc_utilities.pyx":926 + /* "yt/utilities/lib/misc_utilities.pyx":946 * diter[i][1] = 999 * odsp[i] = fwidth[p,i]*0.5 * osp[i] = fcoords[p,i] # already centered # <<<<<<<<<<<<<< @@ -18142,7 +19024,7 @@ __pyx_t_19 = __pyx_v_i; (__pyx_v_osp[__pyx_v_i]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_fcoords.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_fcoords.diminfo[1].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":927 + /* "yt/utilities/lib/misc_utilities.pyx":947 * odsp[i] = fwidth[p,i]*0.5 * osp[i] = fcoords[p,i] # already centered * overlap[i] = 1.0 # <<<<<<<<<<<<<< @@ -18152,7 +19034,7 @@ (__pyx_v_overlap[__pyx_v_i]) = 1.0; } - /* "yt/utilities/lib/misc_utilities.pyx":928 + /* "yt/utilities/lib/misc_utilities.pyx":948 * osp[i] = fcoords[p,i] # already centered * overlap[i] = 1.0 * dsp = data[p] # <<<<<<<<<<<<<< @@ -18162,7 +19044,7 @@ __pyx_t_15 = __pyx_v_p; __pyx_v_dsp = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_data.diminfo[0].strides)); - /* "yt/utilities/lib/misc_utilities.pyx":929 + /* "yt/utilities/lib/misc_utilities.pyx":949 * overlap[i] = 1.0 * dsp = data[p] * if check_period == 1: # <<<<<<<<<<<<<< @@ -18172,7 +19054,7 @@ __pyx_t_2 = ((__pyx_v_check_period == 1) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/misc_utilities.pyx":930 + /* "yt/utilities/lib/misc_utilities.pyx":950 * dsp = data[p] * if check_period == 1: * for i in range(3): # <<<<<<<<<<<<<< @@ -18182,7 +19064,7 @@ for (__pyx_t_20 = 0; __pyx_t_20 < 3; __pyx_t_20+=1) { __pyx_v_i = __pyx_t_20; - /* "yt/utilities/lib/misc_utilities.pyx":931 + /* "yt/utilities/lib/misc_utilities.pyx":951 * if check_period == 1: * for i in range(3): * if (osp[i] - odsp[i] < LE[i]): # <<<<<<<<<<<<<< @@ -18192,7 +19074,7 @@ __pyx_t_2 = ((((__pyx_v_osp[__pyx_v_i]) - (__pyx_v_odsp[__pyx_v_i])) < (__pyx_v_LE[__pyx_v_i])) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/misc_utilities.pyx":932 + /* "yt/utilities/lib/misc_utilities.pyx":952 * for i in range(3): * if (osp[i] - odsp[i] < LE[i]): * diter[i][1] = +1 # <<<<<<<<<<<<<< @@ -18201,7 +19083,7 @@ */ ((__pyx_v_diter[__pyx_v_i])[1]) = 1; - /* "yt/utilities/lib/misc_utilities.pyx":933 + /* "yt/utilities/lib/misc_utilities.pyx":953 * if (osp[i] - odsp[i] < LE[i]): * diter[i][1] = +1 * diterv[i][1] = ds_period[i] # <<<<<<<<<<<<<< @@ -18210,7 +19092,7 @@ */ ((__pyx_v_diterv[__pyx_v_i])[1]) = (__pyx_v_ds_period[__pyx_v_i]); - /* "yt/utilities/lib/misc_utilities.pyx":931 + /* "yt/utilities/lib/misc_utilities.pyx":951 * if check_period == 1: * for i in range(3): * if (osp[i] - odsp[i] < LE[i]): # <<<<<<<<<<<<<< @@ -18220,7 +19102,7 @@ goto __pyx_L18; } - /* "yt/utilities/lib/misc_utilities.pyx":934 + /* "yt/utilities/lib/misc_utilities.pyx":954 * diter[i][1] = +1 * diterv[i][1] = ds_period[i] * elif (osp[i] + odsp[i] > RE[i]): # <<<<<<<<<<<<<< @@ -18230,7 +19112,7 @@ __pyx_t_2 = ((((__pyx_v_osp[__pyx_v_i]) + (__pyx_v_odsp[__pyx_v_i])) > (__pyx_v_RE[__pyx_v_i])) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/misc_utilities.pyx":935 + /* "yt/utilities/lib/misc_utilities.pyx":955 * diterv[i][1] = ds_period[i] * elif (osp[i] + odsp[i] > RE[i]): * diter[i][1] = -1 # <<<<<<<<<<<<<< @@ -18239,7 +19121,7 @@ */ ((__pyx_v_diter[__pyx_v_i])[1]) = -1; - /* "yt/utilities/lib/misc_utilities.pyx":936 + /* "yt/utilities/lib/misc_utilities.pyx":956 * elif (osp[i] + odsp[i] > RE[i]): * diter[i][1] = -1 * diterv[i][1] = -ds_period[i] # <<<<<<<<<<<<<< @@ -18248,7 +19130,7 @@ */ ((__pyx_v_diterv[__pyx_v_i])[1]) = (-(__pyx_v_ds_period[__pyx_v_i])); - /* "yt/utilities/lib/misc_utilities.pyx":934 + /* "yt/utilities/lib/misc_utilities.pyx":954 * diter[i][1] = +1 * diterv[i][1] = ds_period[i] * elif (osp[i] + odsp[i] > RE[i]): # <<<<<<<<<<<<<< @@ -18259,7 +19141,7 @@ __pyx_L18:; } - /* "yt/utilities/lib/misc_utilities.pyx":929 + /* "yt/utilities/lib/misc_utilities.pyx":949 * overlap[i] = 1.0 * dsp = data[p] * if check_period == 1: # <<<<<<<<<<<<<< @@ -18268,7 +19150,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":937 + /* "yt/utilities/lib/misc_utilities.pyx":957 * diter[i][1] = -1 * diterv[i][1] = -ds_period[i] * for xi in range(2): # <<<<<<<<<<<<<< @@ -18278,7 +19160,7 @@ for (__pyx_t_20 = 0; __pyx_t_20 < 2; __pyx_t_20+=1) { __pyx_v_xi = __pyx_t_20; - /* "yt/utilities/lib/misc_utilities.pyx":938 + /* "yt/utilities/lib/misc_utilities.pyx":958 * diterv[i][1] = -ds_period[i] * for xi in range(2): * if diter[0][xi] == 999: continue # <<<<<<<<<<<<<< @@ -18290,7 +19172,7 @@ goto __pyx_L19_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":939 + /* "yt/utilities/lib/misc_utilities.pyx":959 * for xi in range(2): * if diter[0][xi] == 999: continue * sp[0] = osp[0] + diterv[0][xi] # <<<<<<<<<<<<<< @@ -18299,7 +19181,7 @@ */ (__pyx_v_sp[0]) = ((__pyx_v_osp[0]) + ((__pyx_v_diterv[0])[__pyx_v_xi])); - /* "yt/utilities/lib/misc_utilities.pyx":940 + /* "yt/utilities/lib/misc_utilities.pyx":960 * if diter[0][xi] == 999: continue * sp[0] = osp[0] + diterv[0][xi] * if (sp[0] + odsp[0] < LE[0]) or (sp[0] - odsp[0] > RE[0]): continue # <<<<<<<<<<<<<< @@ -18319,7 +19201,7 @@ goto __pyx_L19_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":941 + /* "yt/utilities/lib/misc_utilities.pyx":961 * sp[0] = osp[0] + diterv[0][xi] * if (sp[0] + odsp[0] < LE[0]) or (sp[0] - odsp[0] > RE[0]): continue * for yi in range(2): # <<<<<<<<<<<<<< @@ -18329,7 +19211,7 @@ for (__pyx_t_21 = 0; __pyx_t_21 < 2; __pyx_t_21+=1) { __pyx_v_yi = __pyx_t_21; - /* "yt/utilities/lib/misc_utilities.pyx":942 + /* "yt/utilities/lib/misc_utilities.pyx":962 * if (sp[0] + odsp[0] < LE[0]) or (sp[0] - odsp[0] > RE[0]): continue * for yi in range(2): * if diter[1][yi] == 999: continue # <<<<<<<<<<<<<< @@ -18341,7 +19223,7 @@ goto __pyx_L25_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":943 + /* "yt/utilities/lib/misc_utilities.pyx":963 * for yi in range(2): * if diter[1][yi] == 999: continue * sp[1] = osp[1] + diterv[1][yi] # <<<<<<<<<<<<<< @@ -18350,7 +19232,7 @@ */ (__pyx_v_sp[1]) = ((__pyx_v_osp[1]) + ((__pyx_v_diterv[1])[__pyx_v_yi])); - /* "yt/utilities/lib/misc_utilities.pyx":944 + /* "yt/utilities/lib/misc_utilities.pyx":964 * if diter[1][yi] == 999: continue * sp[1] = osp[1] + diterv[1][yi] * if (sp[1] + odsp[1] < LE[1]) or (sp[1] - odsp[1] > RE[1]): continue # <<<<<<<<<<<<<< @@ -18370,7 +19252,7 @@ goto __pyx_L25_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":945 + /* "yt/utilities/lib/misc_utilities.pyx":965 * sp[1] = osp[1] + diterv[1][yi] * if (sp[1] + odsp[1] < LE[1]) or (sp[1] - odsp[1] > RE[1]): continue * for zi in range(2): # <<<<<<<<<<<<<< @@ -18380,7 +19262,7 @@ for (__pyx_t_22 = 0; __pyx_t_22 < 2; __pyx_t_22+=1) { __pyx_v_zi = __pyx_t_22; - /* "yt/utilities/lib/misc_utilities.pyx":946 + /* "yt/utilities/lib/misc_utilities.pyx":966 * if (sp[1] + odsp[1] < LE[1]) or (sp[1] - odsp[1] > RE[1]): continue * for zi in range(2): * if diter[2][zi] == 999: continue # <<<<<<<<<<<<<< @@ -18392,7 +19274,7 @@ goto __pyx_L31_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":947 + /* "yt/utilities/lib/misc_utilities.pyx":967 * for zi in range(2): * if diter[2][zi] == 999: continue * sp[2] = osp[2] + diterv[2][yi] # <<<<<<<<<<<<<< @@ -18401,7 +19283,7 @@ */ (__pyx_v_sp[2]) = ((__pyx_v_osp[2]) + ((__pyx_v_diterv[2])[__pyx_v_yi])); - /* "yt/utilities/lib/misc_utilities.pyx":948 + /* "yt/utilities/lib/misc_utilities.pyx":968 * if diter[2][zi] == 999: continue * sp[2] = osp[2] + diterv[2][yi] * if (sp[2] + odsp[2] < LE[2]) or (sp[2] - odsp[2] > RE[2]): continue # <<<<<<<<<<<<<< @@ -18421,7 +19303,7 @@ goto __pyx_L31_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":949 + /* "yt/utilities/lib/misc_utilities.pyx":969 * sp[2] = osp[2] + diterv[2][yi] * if (sp[2] + odsp[2] < LE[2]) or (sp[2] - odsp[2] > RE[2]): continue * for i in range(3): # <<<<<<<<<<<<<< @@ -18431,7 +19313,7 @@ for (__pyx_t_23 = 0; __pyx_t_23 < 3; __pyx_t_23+=1) { __pyx_v_i = __pyx_t_23; - /* "yt/utilities/lib/misc_utilities.pyx":950 + /* "yt/utilities/lib/misc_utilities.pyx":970 * if (sp[2] + odsp[2] < LE[2]) or (sp[2] - odsp[2] > RE[2]): continue * for i in range(3): * ld[i] = fmax(((sp[i]-odsp[i]-LE[i])*box_idds[i]),0) # <<<<<<<<<<<<<< @@ -18440,7 +19322,7 @@ */ (__pyx_v_ld[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(((((__pyx_v_sp[__pyx_v_i]) - (__pyx_v_odsp[__pyx_v_i])) - (__pyx_v_LE[__pyx_v_i])) * (__pyx_v_box_idds[__pyx_v_i])), 0.0)); - /* "yt/utilities/lib/misc_utilities.pyx":960 + /* "yt/utilities/lib/misc_utilities.pyx":980 * # comparison of j to rc (double). So give ourselves a * # bonus row and bonus column here. * ud[i] = fmin(((sp[i]+odsp[i]-LE[i])*box_idds[i] + 1), dims[i]) # <<<<<<<<<<<<<< @@ -18450,7 +19332,7 @@ (__pyx_v_ud[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin((((((__pyx_v_sp[__pyx_v_i]) + (__pyx_v_odsp[__pyx_v_i])) - (__pyx_v_LE[__pyx_v_i])) * (__pyx_v_box_idds[__pyx_v_i])) + 1.0), (__pyx_v_dims[__pyx_v_i]))); } - /* "yt/utilities/lib/misc_utilities.pyx":961 + /* "yt/utilities/lib/misc_utilities.pyx":981 * # bonus row and bonus column here. * ud[i] = fmin(((sp[i]+odsp[i]-LE[i])*box_idds[i] + 1), dims[i]) * for i in range(ld[0], ud[0]): # <<<<<<<<<<<<<< @@ -18461,7 +19343,7 @@ for (__pyx_t_24 = (__pyx_v_ld[0]); __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { __pyx_v_i = __pyx_t_24; - /* "yt/utilities/lib/misc_utilities.pyx":962 + /* "yt/utilities/lib/misc_utilities.pyx":982 * ud[i] = fmin(((sp[i]+odsp[i]-LE[i])*box_idds[i] + 1), dims[i]) * for i in range(ld[0], ud[0]): * if antialias == 1: # <<<<<<<<<<<<<< @@ -18471,7 +19353,7 @@ __pyx_t_2 = ((__pyx_v_antialias == 1) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/misc_utilities.pyx":963 + /* "yt/utilities/lib/misc_utilities.pyx":983 * for i in range(ld[0], ud[0]): * if antialias == 1: * lfd[0] = box_dds[0] * i + LE[0] # <<<<<<<<<<<<<< @@ -18480,7 +19362,7 @@ */ (__pyx_v_lfd[0]) = (((__pyx_v_box_dds[0]) * __pyx_v_i) + (__pyx_v_LE[0])); - /* "yt/utilities/lib/misc_utilities.pyx":964 + /* "yt/utilities/lib/misc_utilities.pyx":984 * if antialias == 1: * lfd[0] = box_dds[0] * i + LE[0] * ufd[0] = box_dds[0] * (i + 1) + LE[0] # <<<<<<<<<<<<<< @@ -18489,7 +19371,7 @@ */ (__pyx_v_ufd[0]) = (((__pyx_v_box_dds[0]) * (__pyx_v_i + 1)) + (__pyx_v_LE[0])); - /* "yt/utilities/lib/misc_utilities.pyx":965 + /* "yt/utilities/lib/misc_utilities.pyx":985 * lfd[0] = box_dds[0] * i + LE[0] * ufd[0] = box_dds[0] * (i + 1) + LE[0] * overlap[0] = ((fmin(ufd[0], sp[0]+odsp[0]) # <<<<<<<<<<<<<< @@ -18498,7 +19380,7 @@ */ (__pyx_v_overlap[0]) = ((__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin((__pyx_v_ufd[0]), ((__pyx_v_sp[0]) + (__pyx_v_odsp[0]))) - __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((__pyx_v_lfd[0]), ((__pyx_v_sp[0]) - (__pyx_v_odsp[0])))) * (__pyx_v_box_idds[0])); - /* "yt/utilities/lib/misc_utilities.pyx":962 + /* "yt/utilities/lib/misc_utilities.pyx":982 * ud[i] = fmin(((sp[i]+odsp[i]-LE[i])*box_idds[i] + 1), dims[i]) * for i in range(ld[0], ud[0]): * if antialias == 1: # <<<<<<<<<<<<<< @@ -18507,7 +19389,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":967 + /* "yt/utilities/lib/misc_utilities.pyx":987 * overlap[0] = ((fmin(ufd[0], sp[0]+odsp[0]) * - fmax(lfd[0], (sp[0]-odsp[0])))*box_idds[0]) * if overlap[0] < 0.0: continue # <<<<<<<<<<<<<< @@ -18519,7 +19401,7 @@ goto __pyx_L39_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":968 + /* "yt/utilities/lib/misc_utilities.pyx":988 * - fmax(lfd[0], (sp[0]-odsp[0])))*box_idds[0]) * if overlap[0] < 0.0: continue * for j in range(ld[1], ud[1]): # <<<<<<<<<<<<<< @@ -18530,7 +19412,7 @@ for (__pyx_t_26 = (__pyx_v_ld[1]); __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) { __pyx_v_j = __pyx_t_26; - /* "yt/utilities/lib/misc_utilities.pyx":969 + /* "yt/utilities/lib/misc_utilities.pyx":989 * if overlap[0] < 0.0: continue * for j in range(ld[1], ud[1]): * if antialias == 1: # <<<<<<<<<<<<<< @@ -18540,7 +19422,7 @@ __pyx_t_2 = ((__pyx_v_antialias == 1) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/misc_utilities.pyx":970 + /* "yt/utilities/lib/misc_utilities.pyx":990 * for j in range(ld[1], ud[1]): * if antialias == 1: * lfd[1] = box_dds[1] * j + LE[1] # <<<<<<<<<<<<<< @@ -18549,7 +19431,7 @@ */ (__pyx_v_lfd[1]) = (((__pyx_v_box_dds[1]) * __pyx_v_j) + (__pyx_v_LE[1])); - /* "yt/utilities/lib/misc_utilities.pyx":971 + /* "yt/utilities/lib/misc_utilities.pyx":991 * if antialias == 1: * lfd[1] = box_dds[1] * j + LE[1] * ufd[1] = box_dds[1] * (j + 1) + LE[1] # <<<<<<<<<<<<<< @@ -18558,7 +19440,7 @@ */ (__pyx_v_ufd[1]) = (((__pyx_v_box_dds[1]) * (__pyx_v_j + 1)) + (__pyx_v_LE[1])); - /* "yt/utilities/lib/misc_utilities.pyx":972 + /* "yt/utilities/lib/misc_utilities.pyx":992 * lfd[1] = box_dds[1] * j + LE[1] * ufd[1] = box_dds[1] * (j + 1) + LE[1] * overlap[1] = ((fmin(ufd[1], sp[1]+odsp[1]) # <<<<<<<<<<<<<< @@ -18567,7 +19449,7 @@ */ (__pyx_v_overlap[1]) = ((__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin((__pyx_v_ufd[1]), ((__pyx_v_sp[1]) + (__pyx_v_odsp[1]))) - __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((__pyx_v_lfd[1]), ((__pyx_v_sp[1]) - (__pyx_v_odsp[1])))) * (__pyx_v_box_idds[1])); - /* "yt/utilities/lib/misc_utilities.pyx":969 + /* "yt/utilities/lib/misc_utilities.pyx":989 * if overlap[0] < 0.0: continue * for j in range(ld[1], ud[1]): * if antialias == 1: # <<<<<<<<<<<<<< @@ -18576,7 +19458,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":974 + /* "yt/utilities/lib/misc_utilities.pyx":994 * overlap[1] = ((fmin(ufd[1], sp[1]+odsp[1]) * - fmax(lfd[1], (sp[1]-odsp[1])))*box_idds[1]) * if overlap[1] < 0.0: continue # <<<<<<<<<<<<<< @@ -18588,7 +19470,7 @@ goto __pyx_L43_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":975 + /* "yt/utilities/lib/misc_utilities.pyx":995 * - fmax(lfd[1], (sp[1]-odsp[1])))*box_idds[1]) * if overlap[1] < 0.0: continue * for k in range(ld[2], ud[2]): # <<<<<<<<<<<<<< @@ -18599,7 +19481,7 @@ for (__pyx_t_28 = (__pyx_v_ld[2]); __pyx_t_28 < __pyx_t_27; __pyx_t_28+=1) { __pyx_v_k = __pyx_t_28; - /* "yt/utilities/lib/misc_utilities.pyx":976 + /* "yt/utilities/lib/misc_utilities.pyx":996 * if overlap[1] < 0.0: continue * for k in range(ld[2], ud[2]): * if antialias == 1: # <<<<<<<<<<<<<< @@ -18609,7 +19491,7 @@ __pyx_t_2 = ((__pyx_v_antialias == 1) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/misc_utilities.pyx":977 + /* "yt/utilities/lib/misc_utilities.pyx":997 * for k in range(ld[2], ud[2]): * if antialias == 1: * lfd[2] = box_dds[2] * k + LE[2] # <<<<<<<<<<<<<< @@ -18618,7 +19500,7 @@ */ (__pyx_v_lfd[2]) = (((__pyx_v_box_dds[2]) * __pyx_v_k) + (__pyx_v_LE[2])); - /* "yt/utilities/lib/misc_utilities.pyx":978 + /* "yt/utilities/lib/misc_utilities.pyx":998 * if antialias == 1: * lfd[2] = box_dds[2] * k + LE[2] * ufd[2] = box_dds[2] * (k + 1) + LE[2] # <<<<<<<<<<<<<< @@ -18627,7 +19509,7 @@ */ (__pyx_v_ufd[2]) = (((__pyx_v_box_dds[2]) * (__pyx_v_k + 1)) + (__pyx_v_LE[2])); - /* "yt/utilities/lib/misc_utilities.pyx":979 + /* "yt/utilities/lib/misc_utilities.pyx":999 * lfd[2] = box_dds[2] * k + LE[2] * ufd[2] = box_dds[2] * (k + 1) + LE[2] * overlap[2] = ((fmin(ufd[2], sp[2]+odsp[2]) # <<<<<<<<<<<<<< @@ -18636,7 +19518,7 @@ */ (__pyx_v_overlap[2]) = ((__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin((__pyx_v_ufd[2]), ((__pyx_v_sp[2]) + (__pyx_v_odsp[2]))) - __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((__pyx_v_lfd[2]), ((__pyx_v_sp[2]) - (__pyx_v_odsp[2])))) * (__pyx_v_box_idds[2])); - /* "yt/utilities/lib/misc_utilities.pyx":981 + /* "yt/utilities/lib/misc_utilities.pyx":1001 * overlap[2] = ((fmin(ufd[2], sp[2]+odsp[2]) * - fmax(lfd[2], (sp[2]-odsp[2])))*box_idds[2]) * if overlap[2] < 0.0: continue # <<<<<<<<<<<<<< @@ -18648,7 +19530,7 @@ goto __pyx_L47_continue; } - /* "yt/utilities/lib/misc_utilities.pyx":982 + /* "yt/utilities/lib/misc_utilities.pyx":1002 * - fmax(lfd[2], (sp[2]-odsp[2])))*box_idds[2]) * if overlap[2] < 0.0: continue * dest[i,j,k] += dsp * (overlap[0]*overlap[1]*overlap[2]) # <<<<<<<<<<<<<< @@ -18660,7 +19542,7 @@ __pyx_t_31 = __pyx_v_k; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dest.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_dest.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_dest.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_dest.diminfo[2].strides) += (__pyx_v_dsp * (((__pyx_v_overlap[0]) * (__pyx_v_overlap[1])) * (__pyx_v_overlap[2]))); - /* "yt/utilities/lib/misc_utilities.pyx":976 + /* "yt/utilities/lib/misc_utilities.pyx":996 * if overlap[1] < 0.0: continue * for k in range(ld[2], ud[2]): * if antialias == 1: # <<<<<<<<<<<<<< @@ -18670,7 +19552,7 @@ goto __pyx_L49; } - /* "yt/utilities/lib/misc_utilities.pyx":984 + /* "yt/utilities/lib/misc_utilities.pyx":1004 * dest[i,j,k] += dsp * (overlap[0]*overlap[1]*overlap[2]) * else: * dest[i,j,k] = dsp # <<<<<<<<<<<<<< @@ -18699,7 +19581,7 @@ } } - /* "yt/utilities/lib/misc_utilities.pyx":921 + /* "yt/utilities/lib/misc_utilities.pyx":941 * diterv[i][0] = diterv[i][1] = 0.0 * overlap[i] = 1.0 * with nogil: # <<<<<<<<<<<<<< @@ -18709,6 +19591,7 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; @@ -18717,7 +19600,7 @@ } } - /* "yt/utilities/lib/misc_utilities.pyx":872 + /* "yt/utilities/lib/misc_utilities.pyx":892 * @cython.boundscheck(False) * @cython.wraparound(False) * def fill_region_float(np.ndarray[np.float64_t, ndim=2] fcoords, # <<<<<<<<<<<<<< @@ -18759,7 +19642,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":989 +/* "yt/utilities/lib/misc_utilities.pyx":1009 * @cython.boundscheck(False) * @cython.wraparound(False) * def gravitational_binding_energy( # <<<<<<<<<<<<<< @@ -18788,11 +19671,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -18801,34 +19690,39 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mass)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("gravitational_binding_energy", 1, 6, 6, 1); __PYX_ERR(0, 989, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gravitational_binding_energy", 1, 6, 6, 1); __PYX_ERR(0, 1009, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("gravitational_binding_energy", 1, 6, 6, 2); __PYX_ERR(0, 989, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gravitational_binding_energy", 1, 6, 6, 2); __PYX_ERR(0, 1009, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("gravitational_binding_energy", 1, 6, 6, 3); __PYX_ERR(0, 989, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gravitational_binding_energy", 1, 6, 6, 3); __PYX_ERR(0, 1009, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_truncate)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("gravitational_binding_energy", 1, 6, 6, 4); __PYX_ERR(0, 989, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gravitational_binding_energy", 1, 6, 6, 4); __PYX_ERR(0, 1009, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kinetic)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("gravitational_binding_energy", 1, 6, 6, 5); __PYX_ERR(0, 989, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gravitational_binding_energy", 1, 6, 6, 5); __PYX_ERR(0, 1009, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gravitational_binding_energy") < 0)) __PYX_ERR(0, 989, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gravitational_binding_energy") < 0)) __PYX_ERR(0, 1009, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -18840,16 +19734,16 @@ values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } - __pyx_v_mass = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_mass.memview)) __PYX_ERR(0, 990, __pyx_L3_error) - __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 991, __pyx_L3_error) - __pyx_v_y = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_y.memview)) __PYX_ERR(0, 992, __pyx_L3_error) - __pyx_v_z = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_z.memview)) __PYX_ERR(0, 993, __pyx_L3_error) - __pyx_v_truncate = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_truncate == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 994, __pyx_L3_error) - __pyx_v_kinetic = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_kinetic == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 995, __pyx_L3_error) + __pyx_v_mass = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_mass.memview)) __PYX_ERR(0, 1010, __pyx_L3_error) + __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1011, __pyx_L3_error) + __pyx_v_y = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_y.memview)) __PYX_ERR(0, 1012, __pyx_L3_error) + __pyx_v_z = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_z.memview)) __PYX_ERR(0, 1013, __pyx_L3_error) + __pyx_v_truncate = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_truncate == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L3_error) + __pyx_v_kinetic = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_kinetic == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1015, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("gravitational_binding_energy", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 989, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gravitational_binding_energy", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1009, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.gravitational_binding_energy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18902,7 +19796,7 @@ int __pyx_t_20; __Pyx_RefNannySetupContext("gravitational_binding_energy", 0); - /* "yt/utilities/lib/misc_utilities.pyx":1001 + /* "yt/utilities/lib/misc_utilities.pyx":1021 * cdef np.float64_t mass_i, x_i, y_i, z_i * cdef np.float64_t this_potential, total_potential * total_potential = 0. # <<<<<<<<<<<<<< @@ -18911,7 +19805,7 @@ */ __pyx_v_total_potential = 0.; - /* "yt/utilities/lib/misc_utilities.pyx":1003 + /* "yt/utilities/lib/misc_utilities.pyx":1023 * total_potential = 0. * * i = 0 # <<<<<<<<<<<<<< @@ -18920,45 +19814,45 @@ */ __pyx_v_i = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1004 + /* "yt/utilities/lib/misc_utilities.pyx":1024 * * i = 0 * n_q = mass.size # <<<<<<<<<<<<<< * pbar = get_pbar("Calculating potential for %d cells" % n_q, - * 0.5 * (n_q**2 - n_q)) + * 0.5 * (n_q * n_q - n_q)) */ - __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_mass, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_mass, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1024, __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, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __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, 1004, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_n_q = __pyx_t_3; - /* "yt/utilities/lib/misc_utilities.pyx":1005 + /* "yt/utilities/lib/misc_utilities.pyx":1025 * i = 0 * n_q = mass.size * pbar = get_pbar("Calculating potential for %d cells" % n_q, # <<<<<<<<<<<<<< - * 0.5 * (n_q**2 - n_q)) + * 0.5 * (n_q * n_q - n_q)) * for q_outer in range(n_q - 1): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_pbar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_pbar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_q); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_q); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Calculating_potential_for_d_cell, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Calculating_potential_for_d_cell, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1006 + /* "yt/utilities/lib/misc_utilities.pyx":1026 * n_q = mass.size * pbar = get_pbar("Calculating potential for %d cells" % n_q, - * 0.5 * (n_q**2 - n_q)) # <<<<<<<<<<<<<< + * 0.5 * (n_q * n_q - n_q)) # <<<<<<<<<<<<<< * for q_outer in range(n_q - 1): * this_potential = 0. */ - __pyx_t_4 = PyFloat_FromDouble((0.5 * (__Pyx_pow_long(((long)__pyx_v_n_q), 2) - __pyx_v_n_q))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble((0.5 * ((__pyx_v_n_q * __pyx_v_n_q) - __pyx_v_n_q))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_3 = 0; @@ -18975,7 +19869,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -18985,7 +19879,7 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -18993,7 +19887,7 @@ } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -19004,7 +19898,7 @@ PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_3, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -19012,9 +19906,9 @@ __pyx_v_pbar = __pyx_t_2; __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1007 + /* "yt/utilities/lib/misc_utilities.pyx":1027 * pbar = get_pbar("Calculating potential for %d cells" % n_q, - * 0.5 * (n_q**2 - n_q)) + * 0.5 * (n_q * n_q - n_q)) * for q_outer in range(n_q - 1): # <<<<<<<<<<<<<< * this_potential = 0. * mass_o = mass[q_outer] @@ -19023,8 +19917,8 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_8; __pyx_t_3+=1) { __pyx_v_q_outer = __pyx_t_3; - /* "yt/utilities/lib/misc_utilities.pyx":1008 - * 0.5 * (n_q**2 - n_q)) + /* "yt/utilities/lib/misc_utilities.pyx":1028 + * 0.5 * (n_q * n_q - n_q)) * for q_outer in range(n_q - 1): * this_potential = 0. # <<<<<<<<<<<<<< * mass_o = mass[q_outer] @@ -19032,7 +19926,7 @@ */ __pyx_v_this_potential = 0.; - /* "yt/utilities/lib/misc_utilities.pyx":1009 + /* "yt/utilities/lib/misc_utilities.pyx":1029 * for q_outer in range(n_q - 1): * this_potential = 0. * mass_o = mass[q_outer] # <<<<<<<<<<<<<< @@ -19042,7 +19936,7 @@ __pyx_t_9 = __pyx_v_q_outer; __pyx_v_mass_o = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_mass.data + __pyx_t_9 * __pyx_v_mass.strides[0]) ))); - /* "yt/utilities/lib/misc_utilities.pyx":1010 + /* "yt/utilities/lib/misc_utilities.pyx":1030 * this_potential = 0. * mass_o = mass[q_outer] * x_o = x[q_outer] # <<<<<<<<<<<<<< @@ -19052,7 +19946,7 @@ __pyx_t_10 = __pyx_v_q_outer; __pyx_v_x_o = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_10 * __pyx_v_x.strides[0]) ))); - /* "yt/utilities/lib/misc_utilities.pyx":1011 + /* "yt/utilities/lib/misc_utilities.pyx":1031 * mass_o = mass[q_outer] * x_o = x[q_outer] * y_o = y[q_outer] # <<<<<<<<<<<<<< @@ -19062,7 +19956,7 @@ __pyx_t_11 = __pyx_v_q_outer; __pyx_v_y_o = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_11 * __pyx_v_y.strides[0]) ))); - /* "yt/utilities/lib/misc_utilities.pyx":1012 + /* "yt/utilities/lib/misc_utilities.pyx":1032 * x_o = x[q_outer] * y_o = y[q_outer] * z_o = z[q_outer] # <<<<<<<<<<<<<< @@ -19072,7 +19966,7 @@ __pyx_t_12 = __pyx_v_q_outer; __pyx_v_z_o = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_z.data + __pyx_t_12 * __pyx_v_z.strides[0]) ))); - /* "yt/utilities/lib/misc_utilities.pyx":1013 + /* "yt/utilities/lib/misc_utilities.pyx":1033 * y_o = y[q_outer] * z_o = z[q_outer] * for q_inner in range(q_outer + 1, n_q): # <<<<<<<<<<<<<< @@ -19083,7 +19977,7 @@ for (__pyx_t_14 = (__pyx_v_q_outer + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_q_inner = __pyx_t_14; - /* "yt/utilities/lib/misc_utilities.pyx":1014 + /* "yt/utilities/lib/misc_utilities.pyx":1034 * z_o = z[q_outer] * for q_inner in range(q_outer + 1, n_q): * mass_i = mass[q_inner] # <<<<<<<<<<<<<< @@ -19093,7 +19987,7 @@ __pyx_t_15 = __pyx_v_q_inner; __pyx_v_mass_i = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_mass.data + __pyx_t_15 * __pyx_v_mass.strides[0]) ))); - /* "yt/utilities/lib/misc_utilities.pyx":1015 + /* "yt/utilities/lib/misc_utilities.pyx":1035 * for q_inner in range(q_outer + 1, n_q): * mass_i = mass[q_inner] * x_i = x[q_inner] # <<<<<<<<<<<<<< @@ -19103,7 +19997,7 @@ __pyx_t_16 = __pyx_v_q_inner; __pyx_v_x_i = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_16 * __pyx_v_x.strides[0]) ))); - /* "yt/utilities/lib/misc_utilities.pyx":1016 + /* "yt/utilities/lib/misc_utilities.pyx":1036 * mass_i = mass[q_inner] * x_i = x[q_inner] * y_i = y[q_inner] # <<<<<<<<<<<<<< @@ -19113,7 +20007,7 @@ __pyx_t_17 = __pyx_v_q_inner; __pyx_v_y_i = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_17 * __pyx_v_y.strides[0]) ))); - /* "yt/utilities/lib/misc_utilities.pyx":1017 + /* "yt/utilities/lib/misc_utilities.pyx":1037 * x_i = x[q_inner] * y_i = y[q_inner] * z_i = z[q_inner] # <<<<<<<<<<<<<< @@ -19123,7 +20017,7 @@ __pyx_t_18 = __pyx_v_q_inner; __pyx_v_z_i = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_z.data + __pyx_t_18 * __pyx_v_z.strides[0]) ))); - /* "yt/utilities/lib/misc_utilities.pyx":1018 + /* "yt/utilities/lib/misc_utilities.pyx":1038 * y_i = y[q_inner] * z_i = z[q_inner] * this_potential += mass_o * mass_i / \ # <<<<<<<<<<<<<< @@ -19133,7 +20027,7 @@ __pyx_v_this_potential = (__pyx_v_this_potential + ((__pyx_v_mass_o * __pyx_v_mass_i) / sqrt(((((__pyx_v_x_i - __pyx_v_x_o) * (__pyx_v_x_i - __pyx_v_x_o)) + ((__pyx_v_y_i - __pyx_v_y_o) * (__pyx_v_y_i - __pyx_v_y_o))) + ((__pyx_v_z_i - __pyx_v_z_o) * (__pyx_v_z_i - __pyx_v_z_o)))))); } - /* "yt/utilities/lib/misc_utilities.pyx":1022 + /* "yt/utilities/lib/misc_utilities.pyx":1042 * (y_i - y_o) * (y_i - y_o) + * (z_i - z_o) * (z_i - z_o)) * i += n_q - q_outer # <<<<<<<<<<<<<< @@ -19142,16 +20036,16 @@ */ __pyx_v_i = (__pyx_v_i + (__pyx_v_n_q - __pyx_v_q_outer)); - /* "yt/utilities/lib/misc_utilities.pyx":1023 + /* "yt/utilities/lib/misc_utilities.pyx":1043 * (z_i - z_o) * (z_i - z_o)) * i += n_q - q_outer * pbar.update(i) # <<<<<<<<<<<<<< * total_potential += this_potential * if truncate and total_potential / kinetic > 1.: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pbar, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pbar, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -19164,14 +20058,14 @@ } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -19180,20 +20074,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1043, __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_7); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -19201,7 +20095,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1024 + /* "yt/utilities/lib/misc_utilities.pyx":1044 * i += n_q - q_outer * pbar.update(i) * total_potential += this_potential # <<<<<<<<<<<<<< @@ -19210,7 +20104,7 @@ */ __pyx_v_total_potential = (__pyx_v_total_potential + __pyx_v_this_potential); - /* "yt/utilities/lib/misc_utilities.pyx":1025 + /* "yt/utilities/lib/misc_utilities.pyx":1045 * pbar.update(i) * total_potential += this_potential * if truncate and total_potential / kinetic > 1.: # <<<<<<<<<<<<<< @@ -19228,7 +20122,7 @@ __pyx_L8_bool_binop_done:; if (__pyx_t_19) { - /* "yt/utilities/lib/misc_utilities.pyx":1026 + /* "yt/utilities/lib/misc_utilities.pyx":1046 * total_potential += this_potential * if truncate and total_potential / kinetic > 1.: * break # <<<<<<<<<<<<<< @@ -19237,7 +20131,7 @@ */ goto __pyx_L4_break; - /* "yt/utilities/lib/misc_utilities.pyx":1025 + /* "yt/utilities/lib/misc_utilities.pyx":1045 * pbar.update(i) * total_potential += this_potential * if truncate and total_potential / kinetic > 1.: # <<<<<<<<<<<<<< @@ -19248,14 +20142,14 @@ } __pyx_L4_break:; - /* "yt/utilities/lib/misc_utilities.pyx":1027 + /* "yt/utilities/lib/misc_utilities.pyx":1047 * if truncate and total_potential / kinetic > 1.: * break * pbar.finish() # <<<<<<<<<<<<<< * * return total_potential */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pbar, __pyx_n_s_finish); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pbar, __pyx_n_s_finish); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -19268,16 +20162,16 @@ } } if (__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1027, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1027, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1029 + /* "yt/utilities/lib/misc_utilities.pyx":1049 * pbar.finish() * * return total_potential # <<<<<<<<<<<<<< @@ -19285,13 +20179,13 @@ * # The OnceIndirect code is from: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_total_potential); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_total_potential); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":989 + /* "yt/utilities/lib/misc_utilities.pyx":1009 * @cython.boundscheck(False) * @cython.wraparound(False) * def gravitational_binding_energy( # <<<<<<<<<<<<<< @@ -19320,7 +20214,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":1048 +/* "yt/utilities/lib/misc_utilities.pyx":1068 * cdef int is_readonly * * def __cinit__(self, object rows, want_writable=True, want_format=True, allow_indirect=False): # <<<<<<<<<<<<<< @@ -19349,9 +20243,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -19360,16 +20258,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_want_writable); if (value) { values[1] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_want_format); if (value) { values[2] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allow_indirect); @@ -19377,13 +20278,16 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1048, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1068, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); break; default: goto __pyx_L5_argtuple_error; @@ -19396,7 +20300,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1048, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1068, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.misc_utilities.OnceIndirect.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -19431,21 +20335,21 @@ void *__pyx_t_11; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "yt/utilities/lib/misc_utilities.pyx":1061 + /* "yt/utilities/lib/misc_utilities.pyx":1081 * OnceIndirect([object.vector for object in objects]) * """ * demand = buffer.PyBUF_INDIRECT if allow_indirect else buffer.PyBUF_STRIDES # <<<<<<<<<<<<<< * if want_writable: * demand |= buffer.PyBUF_WRITABLE */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_allow_indirect); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_allow_indirect); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1081, __pyx_L1_error) if (__pyx_t_2) { - __pyx_t_3 = __Pyx_PyInt_From_int(PyBUF_INDIRECT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(PyBUF_INDIRECT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { - __pyx_t_3 = __Pyx_PyInt_From_int(PyBUF_STRIDES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(PyBUF_STRIDES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; @@ -19453,32 +20357,32 @@ __pyx_v_demand = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1062 + /* "yt/utilities/lib/misc_utilities.pyx":1082 * """ * demand = buffer.PyBUF_INDIRECT if allow_indirect else buffer.PyBUF_STRIDES * if want_writable: # <<<<<<<<<<<<<< * demand |= buffer.PyBUF_WRITABLE * if want_format: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_want_writable); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1062, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_want_writable); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1082, __pyx_L1_error) if (__pyx_t_2) { - /* "yt/utilities/lib/misc_utilities.pyx":1063 + /* "yt/utilities/lib/misc_utilities.pyx":1083 * demand = buffer.PyBUF_INDIRECT if allow_indirect else buffer.PyBUF_STRIDES * if want_writable: * demand |= buffer.PyBUF_WRITABLE # <<<<<<<<<<<<<< * if want_format: * demand |= buffer.PyBUF_FORMAT */ - __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_WRITABLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_WRITABLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_demand, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_demand, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_demand, __pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1062 + /* "yt/utilities/lib/misc_utilities.pyx":1082 * """ * demand = buffer.PyBUF_INDIRECT if allow_indirect else buffer.PyBUF_STRIDES * if want_writable: # <<<<<<<<<<<<<< @@ -19487,32 +20391,32 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":1064 + /* "yt/utilities/lib/misc_utilities.pyx":1084 * if want_writable: * demand |= buffer.PyBUF_WRITABLE * if want_format: # <<<<<<<<<<<<<< * demand |= buffer.PyBUF_FORMAT * self._objects = [memoryview(row, demand) for row in rows] */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_want_format); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1064, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_want_format); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1084, __pyx_L1_error) if (__pyx_t_2) { - /* "yt/utilities/lib/misc_utilities.pyx":1065 + /* "yt/utilities/lib/misc_utilities.pyx":1085 * demand |= buffer.PyBUF_WRITABLE * if want_format: * demand |= buffer.PyBUF_FORMAT # <<<<<<<<<<<<<< * self._objects = [memoryview(row, demand) for row in rows] * self.n_rows = len(self._objects) */ - __pyx_t_3 = __Pyx_PyInt_From_int(PyBUF_FORMAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(PyBUF_FORMAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_InPlaceOr(__pyx_v_demand, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceOr(__pyx_v_demand, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_demand, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1064 + /* "yt/utilities/lib/misc_utilities.pyx":1084 * if want_writable: * demand |= buffer.PyBUF_WRITABLE * if want_format: # <<<<<<<<<<<<<< @@ -19521,39 +20425,39 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":1066 + /* "yt/utilities/lib/misc_utilities.pyx":1086 * if want_format: * demand |= buffer.PyBUF_FORMAT * self._objects = [memoryview(row, demand) for row in rows] # <<<<<<<<<<<<<< * self.n_rows = len(self._objects) * self.buf_len = sizeof(void*) * self.n_rows */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_rows)) || PyTuple_CheckExact(__pyx_v_rows)) { __pyx_t_3 = __pyx_v_rows; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1086, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1086, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1086, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } @@ -19563,7 +20467,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1066, __pyx_L1_error) + else __PYX_ERR(0, 1086, __pyx_L1_error) } break; } @@ -19571,7 +20475,7 @@ } __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_row); __Pyx_GIVEREF(__pyx_v_row); @@ -19579,10 +20483,10 @@ __Pyx_INCREF(__pyx_v_demand); __Pyx_GIVEREF(__pyx_v_demand); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_demand); - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1066, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -19592,7 +20496,7 @@ __pyx_v_self->_objects = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1067 + /* "yt/utilities/lib/misc_utilities.pyx":1087 * demand |= buffer.PyBUF_FORMAT * self._objects = [memoryview(row, demand) for row in rows] * self.n_rows = len(self._objects) # <<<<<<<<<<<<<< @@ -19601,11 +20505,11 @@ */ __pyx_t_1 = __pyx_v_self->_objects; __Pyx_INCREF(__pyx_t_1); - __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1087, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->n_rows = __pyx_t_4; - /* "yt/utilities/lib/misc_utilities.pyx":1068 + /* "yt/utilities/lib/misc_utilities.pyx":1088 * self._objects = [memoryview(row, demand) for row in rows] * self.n_rows = len(self._objects) * self.buf_len = sizeof(void*) * self.n_rows # <<<<<<<<<<<<<< @@ -19614,7 +20518,7 @@ */ __pyx_v_self->buf_len = ((sizeof(void *)) * __pyx_v_self->n_rows); - /* "yt/utilities/lib/misc_utilities.pyx":1069 + /* "yt/utilities/lib/misc_utilities.pyx":1089 * self.n_rows = len(self._objects) * self.buf_len = sizeof(void*) * self.n_rows * self.buf = malloc(self.buf_len) # <<<<<<<<<<<<<< @@ -19623,26 +20527,26 @@ */ __pyx_v_self->buf = ((void **)malloc(__pyx_v_self->buf_len)); - /* "yt/utilities/lib/misc_utilities.pyx":1070 + /* "yt/utilities/lib/misc_utilities.pyx":1090 * self.buf_len = sizeof(void*) * self.n_rows * self.buf = malloc(self.buf_len) * self.ndim = 1 + self._objects[0].ndim # <<<<<<<<<<<<<< * self.shape = malloc(sizeof(Py_ssize_t) * self.ndim) * self.strides = malloc(sizeof(Py_ssize_t) * self.ndim) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->_objects, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->_objects, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1070, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_3, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_3, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1070, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->ndim = __pyx_t_8; - /* "yt/utilities/lib/misc_utilities.pyx":1071 + /* "yt/utilities/lib/misc_utilities.pyx":1091 * self.buf = malloc(self.buf_len) * self.ndim = 1 + self._objects[0].ndim * self.shape = malloc(sizeof(Py_ssize_t) * self.ndim) # <<<<<<<<<<<<<< @@ -19651,7 +20555,7 @@ */ __pyx_v_self->shape = ((Py_ssize_t *)malloc(((sizeof(Py_ssize_t)) * __pyx_v_self->ndim))); - /* "yt/utilities/lib/misc_utilities.pyx":1072 + /* "yt/utilities/lib/misc_utilities.pyx":1092 * self.ndim = 1 + self._objects[0].ndim * self.shape = malloc(sizeof(Py_ssize_t) * self.ndim) * self.strides = malloc(sizeof(Py_ssize_t) * self.ndim) # <<<<<<<<<<<<<< @@ -19660,7 +20564,7 @@ */ __pyx_v_self->strides = ((Py_ssize_t *)malloc(((sizeof(Py_ssize_t)) * __pyx_v_self->ndim))); - /* "yt/utilities/lib/misc_utilities.pyx":1073 + /* "yt/utilities/lib/misc_utilities.pyx":1093 * self.shape = malloc(sizeof(Py_ssize_t) * self.ndim) * self.strides = malloc(sizeof(Py_ssize_t) * self.ndim) * self.suboffsets = malloc(sizeof(Py_ssize_t) * self.ndim) # <<<<<<<<<<<<<< @@ -19669,50 +20573,50 @@ */ __pyx_v_self->suboffsets = ((Py_ssize_t *)malloc(((sizeof(Py_ssize_t)) * __pyx_v_self->ndim))); - /* "yt/utilities/lib/misc_utilities.pyx":1075 + /* "yt/utilities/lib/misc_utilities.pyx":1095 * self.suboffsets = malloc(sizeof(Py_ssize_t) * self.ndim) * * cdef memoryview example_obj = self._objects[0] # <<<<<<<<<<<<<< * self.itemsize = example_obj.itemsize * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->_objects, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1075, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->_objects, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryview_type))))) __PYX_ERR(0, 1075, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryview_type))))) __PYX_ERR(0, 1095, __pyx_L1_error) __pyx_v_example_obj = ((struct __pyx_memoryview_obj *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1076 + /* "yt/utilities/lib/misc_utilities.pyx":1096 * * cdef memoryview example_obj = self._objects[0] * self.itemsize = example_obj.itemsize # <<<<<<<<<<<<<< * * if want_format: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_example_obj), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_example_obj), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1076, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->itemsize = __pyx_t_4; - /* "yt/utilities/lib/misc_utilities.pyx":1078 + /* "yt/utilities/lib/misc_utilities.pyx":1098 * self.itemsize = example_obj.itemsize * * if want_format: # <<<<<<<<<<<<<< * self.format = example_obj.view.format * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_want_format); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1078, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_want_format); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1098, __pyx_L1_error) if (__pyx_t_2) { - /* "yt/utilities/lib/misc_utilities.pyx":1079 + /* "yt/utilities/lib/misc_utilities.pyx":1099 * * if want_format: * self.format = example_obj.view.format # <<<<<<<<<<<<<< * else: * self.format = None */ - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_example_obj->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1079, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_example_obj->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->format); @@ -19720,7 +20624,7 @@ __pyx_v_self->format = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1078 + /* "yt/utilities/lib/misc_utilities.pyx":1098 * self.itemsize = example_obj.itemsize * * if want_format: # <<<<<<<<<<<<<< @@ -19730,7 +20634,7 @@ goto __pyx_L7; } - /* "yt/utilities/lib/misc_utilities.pyx":1081 + /* "yt/utilities/lib/misc_utilities.pyx":1101 * self.format = example_obj.view.format * else: * self.format = None # <<<<<<<<<<<<<< @@ -19746,7 +20650,7 @@ } __pyx_L7:; - /* "yt/utilities/lib/misc_utilities.pyx":1082 + /* "yt/utilities/lib/misc_utilities.pyx":1102 * else: * self.format = None * self.is_readonly |= example_obj.view.readonly # <<<<<<<<<<<<<< @@ -19755,30 +20659,30 @@ */ __pyx_v_self->is_readonly = (__pyx_v_self->is_readonly | __pyx_v_example_obj->view.readonly); - /* "yt/utilities/lib/misc_utilities.pyx":1084 + /* "yt/utilities/lib/misc_utilities.pyx":1104 * self.is_readonly |= example_obj.view.readonly * * for dim in range(self.ndim): # <<<<<<<<<<<<<< * if dim == 0: * self.shape[dim] = self.n_rows */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __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_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1104, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -19786,17 +20690,17 @@ if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1104, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1104, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -19806,7 +20710,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1084, __pyx_L1_error) + else __PYX_ERR(0, 1104, __pyx_L1_error) } break; } @@ -19815,20 +20719,20 @@ __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1085 + /* "yt/utilities/lib/misc_utilities.pyx":1105 * * for dim in range(self.ndim): * if dim == 0: # <<<<<<<<<<<<<< * self.shape[dim] = self.n_rows * self.strides[dim] = sizeof(void*) */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dim, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1085, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dim, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1085, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "yt/utilities/lib/misc_utilities.pyx":1086 + /* "yt/utilities/lib/misc_utilities.pyx":1106 * for dim in range(self.ndim): * if dim == 0: * self.shape[dim] = self.n_rows # <<<<<<<<<<<<<< @@ -19836,30 +20740,30 @@ * self.suboffsets[dim] = 0 */ __pyx_t_8 = __pyx_v_self->n_rows; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1086, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1106, __pyx_L1_error) (__pyx_v_self->shape[__pyx_t_9]) = __pyx_t_8; - /* "yt/utilities/lib/misc_utilities.pyx":1087 + /* "yt/utilities/lib/misc_utilities.pyx":1107 * if dim == 0: * self.shape[dim] = self.n_rows * self.strides[dim] = sizeof(void*) # <<<<<<<<<<<<<< * self.suboffsets[dim] = 0 * else: */ - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1107, __pyx_L1_error) (__pyx_v_self->strides[__pyx_t_9]) = (sizeof(void *)); - /* "yt/utilities/lib/misc_utilities.pyx":1088 + /* "yt/utilities/lib/misc_utilities.pyx":1108 * self.shape[dim] = self.n_rows * self.strides[dim] = sizeof(void*) * self.suboffsets[dim] = 0 # <<<<<<<<<<<<<< * else: * self.shape[dim] = example_obj.view.shape[dim - 1] */ - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L1_error) (__pyx_v_self->suboffsets[__pyx_t_9]) = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1085 + /* "yt/utilities/lib/misc_utilities.pyx":1105 * * for dim in range(self.ndim): * if dim == 0: # <<<<<<<<<<<<<< @@ -19869,7 +20773,7 @@ goto __pyx_L10; } - /* "yt/utilities/lib/misc_utilities.pyx":1090 + /* "yt/utilities/lib/misc_utilities.pyx":1110 * self.suboffsets[dim] = 0 * else: * self.shape[dim] = example_obj.view.shape[dim - 1] # <<<<<<<<<<<<<< @@ -19877,28 +20781,28 @@ * if example_obj.view.suboffsets == NULL: */ /*else*/ { - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_dim, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_dim, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L1_error) (__pyx_v_self->shape[__pyx_t_10]) = (__pyx_v_example_obj->view.shape[__pyx_t_9]); - /* "yt/utilities/lib/misc_utilities.pyx":1091 + /* "yt/utilities/lib/misc_utilities.pyx":1111 * else: * self.shape[dim] = example_obj.view.shape[dim - 1] * self.strides[dim] = example_obj.view.strides[dim - 1] # <<<<<<<<<<<<<< * if example_obj.view.suboffsets == NULL: * self.suboffsets[dim] = -1 */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_dim, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_dim, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1091, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1091, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1111, __pyx_L1_error) (__pyx_v_self->strides[__pyx_t_10]) = (__pyx_v_example_obj->view.strides[__pyx_t_9]); - /* "yt/utilities/lib/misc_utilities.pyx":1092 + /* "yt/utilities/lib/misc_utilities.pyx":1112 * self.shape[dim] = example_obj.view.shape[dim - 1] * self.strides[dim] = example_obj.view.strides[dim - 1] * if example_obj.view.suboffsets == NULL: # <<<<<<<<<<<<<< @@ -19908,17 +20812,17 @@ __pyx_t_2 = ((__pyx_v_example_obj->view.suboffsets == NULL) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/misc_utilities.pyx":1093 + /* "yt/utilities/lib/misc_utilities.pyx":1113 * self.strides[dim] = example_obj.view.strides[dim - 1] * if example_obj.view.suboffsets == NULL: * self.suboffsets[dim] = -1 # <<<<<<<<<<<<<< * else: * self.suboffsets[dim] = example_obj.suboffsets[dim - 1] */ - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1093, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1113, __pyx_L1_error) (__pyx_v_self->suboffsets[__pyx_t_9]) = -1L; - /* "yt/utilities/lib/misc_utilities.pyx":1092 + /* "yt/utilities/lib/misc_utilities.pyx":1112 * self.shape[dim] = example_obj.view.shape[dim - 1] * self.strides[dim] = example_obj.view.strides[dim - 1] * if example_obj.view.suboffsets == NULL: # <<<<<<<<<<<<<< @@ -19928,7 +20832,7 @@ goto __pyx_L11; } - /* "yt/utilities/lib/misc_utilities.pyx":1095 + /* "yt/utilities/lib/misc_utilities.pyx":1115 * self.suboffsets[dim] = -1 * else: * self.suboffsets[dim] = example_obj.suboffsets[dim - 1] # <<<<<<<<<<<<<< @@ -19936,24 +20840,24 @@ * cdef memoryview obj */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_example_obj), __pyx_n_s_suboffsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_example_obj), __pyx_n_s_suboffsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_v_dim, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_v_dim, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_GetItem(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_6 = PyObject_GetItem(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1115, __pyx_L1_error) (__pyx_v_self->suboffsets[__pyx_t_10]) = __pyx_t_9; } __pyx_L11:; } __pyx_L10:; - /* "yt/utilities/lib/misc_utilities.pyx":1084 + /* "yt/utilities/lib/misc_utilities.pyx":1104 * self.is_readonly |= example_obj.view.readonly * * for dim in range(self.ndim): # <<<<<<<<<<<<<< @@ -19963,7 +20867,7 @@ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1098 + /* "yt/utilities/lib/misc_utilities.pyx":1118 * * cdef memoryview obj * cdef int i = 0 # <<<<<<<<<<<<<< @@ -19972,7 +20876,7 @@ */ __pyx_v_i = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1099 + /* "yt/utilities/lib/misc_utilities.pyx":1119 * cdef memoryview obj * cdef int i = 0 * for obj in self._objects: # <<<<<<<<<<<<<< @@ -19983,26 +20887,26 @@ __pyx_t_3 = __pyx_v_self->_objects; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_self->_objects); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_self->_objects); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1119, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1119, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1119, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } @@ -20012,26 +20916,26 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1099, __pyx_L1_error) + else __PYX_ERR(0, 1119, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_memoryview_type))))) __PYX_ERR(0, 1099, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_memoryview_type))))) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_obj, ((struct __pyx_memoryview_obj *)__pyx_t_6)); __pyx_t_6 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1100 + /* "yt/utilities/lib/misc_utilities.pyx":1120 * cdef int i = 0 * for obj in self._objects: * assert_similar(example_obj, obj) # <<<<<<<<<<<<<< * self.buf[i] = obj.view.buf * i += 1 */ - __pyx_t_8 = __pyx_f_2yt_9utilities_3lib_14misc_utilities_assert_similar(__pyx_v_example_obj, __pyx_v_obj); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 1100, __pyx_L1_error) + __pyx_t_8 = __pyx_f_2yt_9utilities_3lib_14misc_utilities_assert_similar(__pyx_v_example_obj, __pyx_v_obj); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 1120, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":1101 + /* "yt/utilities/lib/misc_utilities.pyx":1121 * for obj in self._objects: * assert_similar(example_obj, obj) * self.buf[i] = obj.view.buf # <<<<<<<<<<<<<< @@ -20041,7 +20945,7 @@ __pyx_t_11 = __pyx_v_obj->view.buf; (__pyx_v_self->buf[__pyx_v_i]) = __pyx_t_11; - /* "yt/utilities/lib/misc_utilities.pyx":1102 + /* "yt/utilities/lib/misc_utilities.pyx":1122 * assert_similar(example_obj, obj) * self.buf[i] = obj.view.buf * i += 1 # <<<<<<<<<<<<<< @@ -20050,7 +20954,7 @@ */ __pyx_v_i = (__pyx_v_i + 1); - /* "yt/utilities/lib/misc_utilities.pyx":1099 + /* "yt/utilities/lib/misc_utilities.pyx":1119 * cdef memoryview obj * cdef int i = 0 * for obj in self._objects: # <<<<<<<<<<<<<< @@ -20060,7 +20964,7 @@ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":1048 + /* "yt/utilities/lib/misc_utilities.pyx":1068 * cdef int is_readonly * * def __cinit__(self, object rows, want_writable=True, want_format=True, allow_indirect=False): # <<<<<<<<<<<<<< @@ -20088,7 +20992,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":1104 +/* "yt/utilities/lib/misc_utilities.pyx":1124 * i += 1 * * def __getbuffer__(self, Py_buffer* buff, int flags): # <<<<<<<<<<<<<< @@ -20125,7 +21029,7 @@ __Pyx_GIVEREF(__pyx_v_buff->obj); } - /* "yt/utilities/lib/misc_utilities.pyx":1105 + /* "yt/utilities/lib/misc_utilities.pyx":1125 * * def __getbuffer__(self, Py_buffer* buff, int flags): * if (flags & buffer.PyBUF_INDIRECT) != buffer.PyBUF_INDIRECT: # <<<<<<<<<<<<<< @@ -20135,20 +21039,20 @@ __pyx_t_1 = (((__pyx_v_flags & PyBUF_INDIRECT) != PyBUF_INDIRECT) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/misc_utilities.pyx":1106 + /* "yt/utilities/lib/misc_utilities.pyx":1126 * def __getbuffer__(self, Py_buffer* buff, int flags): * if (flags & buffer.PyBUF_INDIRECT) != buffer.PyBUF_INDIRECT: * raise Exception("don't want to copy data") # <<<<<<<<<<<<<< * if flags & buffer.PyBUF_WRITABLE and self.is_readonly: * raise Exception("couldn't provide writable, you should have demanded it earlier") */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1126, __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, 1106, __pyx_L1_error) + __PYX_ERR(0, 1126, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":1105 + /* "yt/utilities/lib/misc_utilities.pyx":1125 * * def __getbuffer__(self, Py_buffer* buff, int flags): * if (flags & buffer.PyBUF_INDIRECT) != buffer.PyBUF_INDIRECT: # <<<<<<<<<<<<<< @@ -20157,7 +21061,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":1107 + /* "yt/utilities/lib/misc_utilities.pyx":1127 * if (flags & buffer.PyBUF_INDIRECT) != buffer.PyBUF_INDIRECT: * raise Exception("don't want to copy data") * if flags & buffer.PyBUF_WRITABLE and self.is_readonly: # <<<<<<<<<<<<<< @@ -20175,20 +21079,20 @@ __pyx_L5_bool_binop_done:; if (__pyx_t_1) { - /* "yt/utilities/lib/misc_utilities.pyx":1108 + /* "yt/utilities/lib/misc_utilities.pyx":1128 * raise Exception("don't want to copy data") * if flags & buffer.PyBUF_WRITABLE and self.is_readonly: * raise Exception("couldn't provide writable, you should have demanded it earlier") # <<<<<<<<<<<<<< * if flags & buffer.PyBUF_FORMAT: * if self.format is None: */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1128, __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, 1108, __pyx_L1_error) + __PYX_ERR(0, 1128, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":1107 + /* "yt/utilities/lib/misc_utilities.pyx":1127 * if (flags & buffer.PyBUF_INDIRECT) != buffer.PyBUF_INDIRECT: * raise Exception("don't want to copy data") * if flags & buffer.PyBUF_WRITABLE and self.is_readonly: # <<<<<<<<<<<<<< @@ -20197,7 +21101,7 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":1109 + /* "yt/utilities/lib/misc_utilities.pyx":1129 * if flags & buffer.PyBUF_WRITABLE and self.is_readonly: * raise Exception("couldn't provide writable, you should have demanded it earlier") * if flags & buffer.PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -20207,7 +21111,7 @@ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { - /* "yt/utilities/lib/misc_utilities.pyx":1110 + /* "yt/utilities/lib/misc_utilities.pyx":1130 * raise Exception("couldn't provide writable, you should have demanded it earlier") * if flags & buffer.PyBUF_FORMAT: * if self.format is None: # <<<<<<<<<<<<<< @@ -20218,20 +21122,20 @@ __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { - /* "yt/utilities/lib/misc_utilities.pyx":1111 + /* "yt/utilities/lib/misc_utilities.pyx":1131 * if flags & buffer.PyBUF_FORMAT: * if self.format is None: * raise Exception("couldn't provide format, you should have demanded it earlier") # <<<<<<<<<<<<<< * buff.format = self.format * else: */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __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, 1111, __pyx_L1_error) + __PYX_ERR(0, 1131, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":1110 + /* "yt/utilities/lib/misc_utilities.pyx":1130 * raise Exception("couldn't provide writable, you should have demanded it earlier") * if flags & buffer.PyBUF_FORMAT: * if self.format is None: # <<<<<<<<<<<<<< @@ -20240,17 +21144,17 @@ */ } - /* "yt/utilities/lib/misc_utilities.pyx":1112 + /* "yt/utilities/lib/misc_utilities.pyx":1132 * if self.format is None: * raise Exception("couldn't provide format, you should have demanded it earlier") * buff.format = self.format # <<<<<<<<<<<<<< * else: * buff.format = NULL */ - __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_self->format); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_self->format); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 1132, __pyx_L1_error) __pyx_v_buff->format = __pyx_t_4; - /* "yt/utilities/lib/misc_utilities.pyx":1109 + /* "yt/utilities/lib/misc_utilities.pyx":1129 * if flags & buffer.PyBUF_WRITABLE and self.is_readonly: * raise Exception("couldn't provide writable, you should have demanded it earlier") * if flags & buffer.PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -20260,7 +21164,7 @@ goto __pyx_L7; } - /* "yt/utilities/lib/misc_utilities.pyx":1114 + /* "yt/utilities/lib/misc_utilities.pyx":1134 * buff.format = self.format * else: * buff.format = NULL # <<<<<<<<<<<<<< @@ -20272,7 +21176,7 @@ } __pyx_L7:; - /* "yt/utilities/lib/misc_utilities.pyx":1116 + /* "yt/utilities/lib/misc_utilities.pyx":1136 * buff.format = NULL * * buff.buf = self.buf # <<<<<<<<<<<<<< @@ -20281,7 +21185,7 @@ */ __pyx_v_buff->buf = ((void *)__pyx_v_self->buf); - /* "yt/utilities/lib/misc_utilities.pyx":1117 + /* "yt/utilities/lib/misc_utilities.pyx":1137 * * buff.buf = self.buf * buff.obj = self # <<<<<<<<<<<<<< @@ -20294,7 +21198,7 @@ __Pyx_DECREF(__pyx_v_buff->obj); __pyx_v_buff->obj = ((PyObject *)__pyx_v_self); - /* "yt/utilities/lib/misc_utilities.pyx":1118 + /* "yt/utilities/lib/misc_utilities.pyx":1138 * buff.buf = self.buf * buff.obj = self * buff.len = self.buf_len # <<<<<<<<<<<<<< @@ -20304,7 +21208,7 @@ __pyx_t_5 = __pyx_v_self->buf_len; __pyx_v_buff->len = __pyx_t_5; - /* "yt/utilities/lib/misc_utilities.pyx":1119 + /* "yt/utilities/lib/misc_utilities.pyx":1139 * buff.obj = self * buff.len = self.buf_len * buff.readonly = self.is_readonly # <<<<<<<<<<<<<< @@ -20314,7 +21218,7 @@ __pyx_t_5 = __pyx_v_self->is_readonly; __pyx_v_buff->readonly = __pyx_t_5; - /* "yt/utilities/lib/misc_utilities.pyx":1120 + /* "yt/utilities/lib/misc_utilities.pyx":1140 * buff.len = self.buf_len * buff.readonly = self.is_readonly * buff.ndim = self.ndim # <<<<<<<<<<<<<< @@ -20324,7 +21228,7 @@ __pyx_t_5 = __pyx_v_self->ndim; __pyx_v_buff->ndim = __pyx_t_5; - /* "yt/utilities/lib/misc_utilities.pyx":1121 + /* "yt/utilities/lib/misc_utilities.pyx":1141 * buff.readonly = self.is_readonly * buff.ndim = self.ndim * buff.shape = self.shape # <<<<<<<<<<<<<< @@ -20334,7 +21238,7 @@ __pyx_t_6 = __pyx_v_self->shape; __pyx_v_buff->shape = __pyx_t_6; - /* "yt/utilities/lib/misc_utilities.pyx":1122 + /* "yt/utilities/lib/misc_utilities.pyx":1142 * buff.ndim = self.ndim * buff.shape = self.shape * buff.strides = self.strides # <<<<<<<<<<<<<< @@ -20344,7 +21248,7 @@ __pyx_t_6 = __pyx_v_self->strides; __pyx_v_buff->strides = __pyx_t_6; - /* "yt/utilities/lib/misc_utilities.pyx":1123 + /* "yt/utilities/lib/misc_utilities.pyx":1143 * buff.shape = self.shape * buff.strides = self.strides * buff.suboffsets = self.suboffsets # <<<<<<<<<<<<<< @@ -20354,7 +21258,7 @@ __pyx_t_6 = __pyx_v_self->suboffsets; __pyx_v_buff->suboffsets = __pyx_t_6; - /* "yt/utilities/lib/misc_utilities.pyx":1124 + /* "yt/utilities/lib/misc_utilities.pyx":1144 * buff.strides = self.strides * buff.suboffsets = self.suboffsets * buff.itemsize = self.itemsize # <<<<<<<<<<<<<< @@ -20364,7 +21268,7 @@ __pyx_t_7 = __pyx_v_self->itemsize; __pyx_v_buff->itemsize = __pyx_t_7; - /* "yt/utilities/lib/misc_utilities.pyx":1125 + /* "yt/utilities/lib/misc_utilities.pyx":1145 * buff.suboffsets = self.suboffsets * buff.itemsize = self.itemsize * buff.internal = NULL # <<<<<<<<<<<<<< @@ -20373,7 +21277,7 @@ */ __pyx_v_buff->internal = NULL; - /* "yt/utilities/lib/misc_utilities.pyx":1104 + /* "yt/utilities/lib/misc_utilities.pyx":1124 * i += 1 * * def __getbuffer__(self, Py_buffer* buff, int flags): # <<<<<<<<<<<<<< @@ -20403,7 +21307,7 @@ return __pyx_r; } -/* "yt/utilities/lib/misc_utilities.pyx":1127 +/* "yt/utilities/lib/misc_utilities.pyx":1147 * buff.internal = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -20426,7 +21330,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "yt/utilities/lib/misc_utilities.pyx":1128 + /* "yt/utilities/lib/misc_utilities.pyx":1148 * * def __dealloc__(self): * free(self.buf) # <<<<<<<<<<<<<< @@ -20435,7 +21339,7 @@ */ free(__pyx_v_self->buf); - /* "yt/utilities/lib/misc_utilities.pyx":1129 + /* "yt/utilities/lib/misc_utilities.pyx":1149 * def __dealloc__(self): * free(self.buf) * free(self.shape) # <<<<<<<<<<<<<< @@ -20444,7 +21348,7 @@ */ free(__pyx_v_self->shape); - /* "yt/utilities/lib/misc_utilities.pyx":1130 + /* "yt/utilities/lib/misc_utilities.pyx":1150 * free(self.buf) * free(self.shape) * free(self.strides) # <<<<<<<<<<<<<< @@ -20453,7 +21357,7 @@ */ free(__pyx_v_self->strides); - /* "yt/utilities/lib/misc_utilities.pyx":1131 + /* "yt/utilities/lib/misc_utilities.pyx":1151 * free(self.shape) * free(self.strides) * free(self.suboffsets) # <<<<<<<<<<<<<< @@ -20462,7 +21366,7 @@ */ free(__pyx_v_self->suboffsets); - /* "yt/utilities/lib/misc_utilities.pyx":1127 + /* "yt/utilities/lib/misc_utilities.pyx":1147 * buff.internal = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -20474,7 +21378,114 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/misc_utilities.pyx":1133 +/* "(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_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_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_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_6__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect *__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__18, 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("yt.utilities.lib.misc_utilities.OnceIndirect.__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_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_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_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_8__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect *__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__19, 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("yt.utilities.lib.misc_utilities.OnceIndirect.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "yt/utilities/lib/misc_utilities.pyx":1153 * free(self.suboffsets) * * cdef int assert_similar(memoryview left_, memoryview right_) except -1: # <<<<<<<<<<<<<< @@ -20497,7 +21508,7 @@ int __pyx_t_7; __Pyx_RefNannySetupContext("assert_similar", 0); - /* "yt/utilities/lib/misc_utilities.pyx":1134 + /* "yt/utilities/lib/misc_utilities.pyx":1154 * * cdef int assert_similar(memoryview left_, memoryview right_) except -1: * cdef Py_buffer left = left_.view # <<<<<<<<<<<<<< @@ -20507,7 +21518,7 @@ __pyx_t_1 = __pyx_v_left_->view; __pyx_v_left = __pyx_t_1; - /* "yt/utilities/lib/misc_utilities.pyx":1135 + /* "yt/utilities/lib/misc_utilities.pyx":1155 * cdef int assert_similar(memoryview left_, memoryview right_) except -1: * cdef Py_buffer left = left_.view * cdef Py_buffer right = right_.view # <<<<<<<<<<<<<< @@ -20517,7 +21528,7 @@ __pyx_t_1 = __pyx_v_right_->view; __pyx_v_right = __pyx_t_1; - /* "yt/utilities/lib/misc_utilities.pyx":1136 + /* "yt/utilities/lib/misc_utilities.pyx":1156 * cdef Py_buffer left = left_.view * cdef Py_buffer right = right_.view * assert left.ndim == right.ndim # <<<<<<<<<<<<<< @@ -20528,12 +21539,12 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_left.ndim == __pyx_v_right.ndim) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 1136, __pyx_L1_error) + __PYX_ERR(0, 1156, __pyx_L1_error) } } #endif - /* "yt/utilities/lib/misc_utilities.pyx":1138 + /* "yt/utilities/lib/misc_utilities.pyx":1158 * assert left.ndim == right.ndim * cdef int i * for i in range(left.ndim): # <<<<<<<<<<<<<< @@ -20544,7 +21555,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/utilities/lib/misc_utilities.pyx":1139 + /* "yt/utilities/lib/misc_utilities.pyx":1159 * cdef int i * for i in range(left.ndim): * assert left.shape[i] == right.shape[i], (left_.shape, right_.shape) # <<<<<<<<<<<<<< @@ -20554,11 +21565,11 @@ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!(((__pyx_v_left.shape[__pyx_v_i]) == (__pyx_v_right.shape[__pyx_v_i])) != 0))) { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_right_), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1139, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_right_), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1139, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); @@ -20566,17 +21577,17 @@ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_Pack(1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1139, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 1139, __pyx_L1_error) + __PYX_ERR(0, 1159, __pyx_L1_error) } } #endif - /* "yt/utilities/lib/misc_utilities.pyx":1140 + /* "yt/utilities/lib/misc_utilities.pyx":1160 * for i in range(left.ndim): * assert left.shape[i] == right.shape[i], (left_.shape, right_.shape) * assert left.strides[i] == right.strides[i], (left_.strides, right_.strides) # <<<<<<<<<<<<<< @@ -20586,11 +21597,11 @@ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!(((__pyx_v_left.strides[__pyx_v_i]) == (__pyx_v_right.strides[__pyx_v_i])) != 0))) { - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_), __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1140, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_), __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_right_), __pyx_n_s_strides); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_right_), __pyx_n_s_strides); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1140, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); @@ -20598,18 +21609,18 @@ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1140, __pyx_L1_error) + __PYX_ERR(0, 1160, __pyx_L1_error) } } #endif } - /* "yt/utilities/lib/misc_utilities.pyx":1142 + /* "yt/utilities/lib/misc_utilities.pyx":1162 * assert left.strides[i] == right.strides[i], (left_.strides, right_.strides) * * if left.suboffsets == NULL: # <<<<<<<<<<<<<< @@ -20619,7 +21630,7 @@ __pyx_t_7 = ((__pyx_v_left.suboffsets == NULL) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/misc_utilities.pyx":1143 + /* "yt/utilities/lib/misc_utilities.pyx":1163 * * if left.suboffsets == NULL: * assert right.suboffsets == NULL, (left_.suboffsets, right_.suboffsets) # <<<<<<<<<<<<<< @@ -20629,11 +21640,11 @@ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_right.suboffsets == NULL) != 0))) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_), __pyx_n_s_suboffsets); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_), __pyx_n_s_suboffsets); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_right_), __pyx_n_s_suboffsets); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_right_), __pyx_n_s_suboffsets); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); @@ -20641,17 +21652,17 @@ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_6 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 1143, __pyx_L1_error) + __PYX_ERR(0, 1163, __pyx_L1_error) } } #endif - /* "yt/utilities/lib/misc_utilities.pyx":1142 + /* "yt/utilities/lib/misc_utilities.pyx":1162 * assert left.strides[i] == right.strides[i], (left_.strides, right_.strides) * * if left.suboffsets == NULL: # <<<<<<<<<<<<<< @@ -20661,7 +21672,7 @@ goto __pyx_L5; } - /* "yt/utilities/lib/misc_utilities.pyx":1145 + /* "yt/utilities/lib/misc_utilities.pyx":1165 * assert right.suboffsets == NULL, (left_.suboffsets, right_.suboffsets) * else: * for i in range(left.ndim): # <<<<<<<<<<<<<< @@ -20673,7 +21684,7 @@ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "yt/utilities/lib/misc_utilities.pyx":1146 + /* "yt/utilities/lib/misc_utilities.pyx":1166 * else: * for i in range(left.ndim): * assert left.suboffsets[i] == right.suboffsets[i], (left_.suboffsets, right_.suboffsets) # <<<<<<<<<<<<<< @@ -20683,11 +21694,11 @@ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!(((__pyx_v_left.suboffsets[__pyx_v_i]) == (__pyx_v_right.suboffsets[__pyx_v_i])) != 0))) { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_), __pyx_n_s_suboffsets); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1146, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_), __pyx_n_s_suboffsets); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_right_), __pyx_n_s_suboffsets); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_right_), __pyx_n_s_suboffsets); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1146, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); @@ -20695,12 +21706,12 @@ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_Pack(1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1146, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 1146, __pyx_L1_error) + __PYX_ERR(0, 1166, __pyx_L1_error) } } #endif @@ -20708,7 +21719,7 @@ } __pyx_L5:; - /* "yt/utilities/lib/misc_utilities.pyx":1148 + /* "yt/utilities/lib/misc_utilities.pyx":1168 * assert left.suboffsets[i] == right.suboffsets[i], (left_.suboffsets, right_.suboffsets) * * if left.format == NULL: # <<<<<<<<<<<<<< @@ -20718,7 +21729,7 @@ __pyx_t_7 = ((__pyx_v_left.format == NULL) != 0); if (__pyx_t_7) { - /* "yt/utilities/lib/misc_utilities.pyx":1149 + /* "yt/utilities/lib/misc_utilities.pyx":1169 * * if left.format == NULL: * assert right.format == NULL, (bytes(left.format), bytes(right.format)) # <<<<<<<<<<<<<< @@ -20728,27 +21739,27 @@ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_right.format == NULL) != 0))) { - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_left.format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1149, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_left.format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1149, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1149, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_right.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1149, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_right.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1149, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); @@ -20756,17 +21767,17 @@ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1149, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1149, __pyx_L1_error) + __PYX_ERR(0, 1169, __pyx_L1_error) } } #endif - /* "yt/utilities/lib/misc_utilities.pyx":1148 + /* "yt/utilities/lib/misc_utilities.pyx":1168 * assert left.suboffsets[i] == right.suboffsets[i], (left_.suboffsets, right_.suboffsets) * * if left.format == NULL: # <<<<<<<<<<<<<< @@ -20776,7 +21787,7 @@ goto __pyx_L8; } - /* "yt/utilities/lib/misc_utilities.pyx":1153 + /* "yt/utilities/lib/misc_utilities.pyx":1173 * #alternatively, compare as Python strings: * #assert bytes(left.format) == bytes(right.format) * assert strcmp(left.format, right.format) == 0, (bytes(left.format), bytes(right.format)) # <<<<<<<<<<<<<< @@ -20786,27 +21797,27 @@ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((strcmp(__pyx_v_left.format, __pyx_v_right.format) == 0) != 0))) { - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_left.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_left.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_right.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_right.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1173, __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_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); @@ -20814,19 +21825,19 @@ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_6 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 1153, __pyx_L1_error) + __PYX_ERR(0, 1173, __pyx_L1_error) } } #endif } __pyx_L8:; - /* "yt/utilities/lib/misc_utilities.pyx":1154 + /* "yt/utilities/lib/misc_utilities.pyx":1174 * #assert bytes(left.format) == bytes(right.format) * assert strcmp(left.format, right.format) == 0, (bytes(left.format), bytes(right.format)) * return 0 # <<<<<<<<<<<<<< @@ -20834,7 +21845,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/misc_utilities.pyx":1133 + /* "yt/utilities/lib/misc_utilities.pyx":1153 * free(self.suboffsets) * * cdef int assert_similar(memoryview left_, memoryview right_) except -1: # <<<<<<<<<<<<<< @@ -21023,11 +22034,11 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + __PYX_ERR(2, 218, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 @@ -21079,11 +22090,11 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + __PYX_ERR(2, 222, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") @@ -21388,11 +22399,11 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + __PYX_ERR(2, 259, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: @@ -21599,22 +22610,22 @@ * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) + __PYX_ERR(2, 278, __pyx_L1_error) break; } @@ -21681,7 +22692,7 @@ * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 @@ -21840,7 +22851,7 @@ * 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, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21887,7 +22898,7 @@ * 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, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21934,7 +22945,7 @@ * 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, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21981,7 +22992,7 @@ * 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, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22028,7 +23039,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22109,15 +23120,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) + __PYX_ERR(2, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + __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, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -22132,11 +23143,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 795, __pyx_L1_error) + __PYX_ERR(2, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -22157,7 +23168,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __pyx_L1_error) + __PYX_ERR(2, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -22165,15 +23176,15 @@ __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, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -22186,12 +23197,12 @@ * 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, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -22203,11 +23214,11 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) + __PYX_ERR(2, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -22271,11 +23282,11 @@ * # 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__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __PYX_ERR(2, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -22294,11 +23305,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -22358,7 +23369,7 @@ * 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, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -22380,11 +23391,11 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __PYX_ERR(2, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -22402,11 +23413,11 @@ * 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, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -22420,11 +23431,11 @@ * 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, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -22438,11 +23449,11 @@ * 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, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -22456,11 +23467,11 @@ * 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, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -22474,11 +23485,11 @@ * 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, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -22492,11 +23503,11 @@ * 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, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -22510,11 +23521,11 @@ * 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, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -22528,11 +23539,11 @@ * 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, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -22546,11 +23557,11 @@ * 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, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -22564,11 +23575,11 @@ * 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, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -22582,11 +23593,11 @@ * 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, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -22600,11 +23611,11 @@ * 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, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -22618,11 +23629,11 @@ * 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, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -22636,11 +23647,11 @@ * 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, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -22656,11 +23667,11 @@ * 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, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -22676,11 +23687,11 @@ * 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, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -22696,11 +23707,11 @@ * 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, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -22715,19 +23726,19 @@ * 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, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) + __PYX_ERR(2, 844, __pyx_L1_error) } __pyx_L15:; @@ -22758,7 +23769,7 @@ * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; @@ -23022,7 +24033,7 @@ * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 * # Cython code. @@ -23035,7 +24046,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -23049,7 +24060,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -23061,11 +24072,11 @@ * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) + __PYX_ERR(2, 989, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -23083,7 +24094,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -23153,7 +24164,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * @@ -23166,7 +24177,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -23180,7 +24191,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -23192,11 +24203,11 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) + __PYX_ERR(2, 995, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -23214,7 +24225,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -23284,7 +24295,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * @@ -23297,7 +24308,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -23310,7 +24321,7 @@ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -23320,11 +24331,11 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) + __PYX_ERR(2, 1001, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -23342,7 +24353,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -23368,8 +24379,8 @@ return __pyx_r; } -/* "yt/geometry/selection_routines.pxd":26 - * np.float64_t +/* "yt/geometry/selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< * if hasattr(arr, "units"): @@ -23385,39 +24396,39 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_ensure_code", 0); - /* "yt/geometry/selection_routines.pxd":27 + /* "yt/geometry/selection_routines.pxd":23 * * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): # <<<<<<<<<<<<<< * if "code_length" == str(arr.units): * return arr */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 23, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pxd":28 + /* "yt/geometry/selection_routines.pxd":24 * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< * return arr * arr.convert_to_units("code_length") */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 24, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 28, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "yt/geometry/selection_routines.pxd":29 + /* "yt/geometry/selection_routines.pxd":25 * if hasattr(arr, "units"): * if "code_length" == str(arr.units): * return arr # <<<<<<<<<<<<<< @@ -23429,7 +24440,7 @@ __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "yt/geometry/selection_routines.pxd":28 + /* "yt/geometry/selection_routines.pxd":24 * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): * if "code_length" == str(arr.units): # <<<<<<<<<<<<<< @@ -23438,21 +24449,21 @@ */ } - /* "yt/geometry/selection_routines.pxd":30 + /* "yt/geometry/selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 30, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 30, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/geometry/selection_routines.pxd":27 + /* "yt/geometry/selection_routines.pxd":23 * * cdef inline _ensure_code(arr): * if hasattr(arr, "units"): # <<<<<<<<<<<<<< @@ -23461,7 +24472,7 @@ */ } - /* "yt/geometry/selection_routines.pxd":31 + /* "yt/geometry/selection_routines.pxd":27 * return arr * arr.convert_to_units("code_length") * return arr # <<<<<<<<<<<<<< @@ -23473,8 +24484,8 @@ __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "yt/geometry/selection_routines.pxd":26 - * np.float64_t + /* "yt/geometry/selection_routines.pxd":22 + * grid_visitor_function, check_child_masked * * cdef inline _ensure_code(arr): # <<<<<<<<<<<<<< * if hasattr(arr, "units"): @@ -23494,7 +24505,7 @@ } /* "yt/geometry/selection_routines.pxd":78 - * cdef public np.int64_t domain_id + * cdef public SelectorObject sel2 * * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< * np.float64_t dw, bint periodic) nogil: @@ -23594,7 +24605,7 @@ goto __pyx_L0; /* "yt/geometry/selection_routines.pxd":78 - * cdef public np.int64_t domain_id + * cdef public SelectorObject sel2 * * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2, # <<<<<<<<<<<<<< * np.float64_t dw, bint periodic) nogil: @@ -23701,7 +24712,7 @@ } /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -23723,7 +24734,7 @@ goto __pyx_L0; /* "oct_visitors.pxd":123 - * cdef np.int64_t *nfinest + * cdef np.uint64_t *nfinest * * cdef inline int cind(int i, int j, int k): # <<<<<<<<<<<<<< * # THIS ONLY WORKS FOR CHILDREN. It is not general for zones. @@ -23739,18 +24750,18 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":20 * - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -23762,7 +24773,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: * if i0 > i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -23774,7 +24785,7 @@ /* "yt/utilities/lib/fp_utils.pxd":19 * cimport cython * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 > i1: return i0 * return i1 */ @@ -23814,7 +24825,7 @@ * if f0 > f1: return f0 * return f1 # <<<<<<<<<<<<<< * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ __pyx_r = __pyx_v_f1; goto __pyx_L0; @@ -23835,18 +24846,18 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":28 * - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 # <<<<<<<<<<<<<< * return i1 * @@ -23858,7 +24869,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: * if i0 < i1: return i0 * return i1 # <<<<<<<<<<<<<< * @@ -23870,7 +24881,7 @@ /* "yt/utilities/lib/fp_utils.pxd":27 * return f1 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< * if i0 < i1: return i0 * return i1 */ @@ -23958,7 +24969,7 @@ * if f0 < 0.0: return -f0 * return f0 # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_f0; goto __pyx_L0; @@ -23979,18 +24990,18 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":40 * - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -24002,7 +25013,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -24019,7 +25030,7 @@ * if i > b: return b * return i # <<<<<<<<<<<<<< * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ __pyx_r = __pyx_v_i; goto __pyx_L0; @@ -24027,7 +25038,7 @@ /* "yt/utilities/lib/fp_utils.pxd":39 * return f0 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -24040,18 +25051,18 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a # <<<<<<<<<<<<<< * if i > b: return b * return i @@ -24063,7 +25074,7 @@ } /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: * if i < a: return a * if i > b: return b # <<<<<<<<<<<<<< * return i @@ -24088,7 +25099,7 @@ /* "yt/utilities/lib/fp_utils.pxd":44 * return i * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< * if i < a: return a * if i > b: return b */ @@ -24255,10 +25266,15 @@ 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; } @@ -24267,21 +25283,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -24289,12 +25309,14 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -24303,11 +25325,11 @@ } } __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(3, 120, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 121, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) } else { /* "View.MemoryView":121 @@ -24322,15 +25344,15 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(3, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(3, 120, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __pyx_L1_error) } __pyx_r = __pyx_array___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); @@ -24381,9 +25403,9 @@ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(3, 127, __pyx_L1_error) + __PYX_ERR(1, 127, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 127, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 127, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 @@ -24412,11 +25434,11 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 131, __pyx_L1_error) + __PYX_ERR(1, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize @@ -24444,11 +25466,11 @@ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 134, __pyx_L1_error) + __PYX_ERR(1, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") @@ -24477,9 +25499,9 @@ * 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(3, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -24501,7 +25523,7 @@ * 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(3, 138, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 138, __pyx_L1_error) __pyx_t_5 = __pyx_v_format; __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -24517,7 +25539,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -24555,11 +25577,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 146, __pyx_L1_error) + __PYX_ERR(1, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim @@ -24582,12 +25604,12 @@ 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(3, 149, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 149, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dim = __pyx_t_8; __pyx_v_idx = __pyx_t_7; @@ -24610,11 +25632,11 @@ * self._shape[idx] = dim * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); @@ -24622,20 +25644,20 @@ 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(3, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(3, 151, __pyx_L1_error) + __PYX_ERR(1, 151, __pyx_L1_error) /* "View.MemoryView":150 * @@ -24672,7 +25694,7 @@ * 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(3, 155, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":156 @@ -24714,7 +25736,7 @@ * 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(3, 158, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":159 @@ -24757,19 +25779,19 @@ * 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(3, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 162, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 162, __pyx_L1_error) + __PYX_ERR(1, 162, __pyx_L1_error) } __pyx_L10:; @@ -24798,8 +25820,8 @@ * if allocate_buffer: * */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 168, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; @@ -24839,11 +25861,11 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 174, __pyx_L1_error) + __PYX_ERR(1, 174, __pyx_L1_error) /* "View.MemoryView":173 * @@ -24882,11 +25904,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(3, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __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(3, 178, __pyx_L1_error) + __PYX_ERR(1, 178, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { @@ -25007,7 +26029,7 @@ * 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(3, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -25037,7 +26059,7 @@ * 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(3, 187, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { @@ -25077,11 +26099,11 @@ * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 190, __pyx_L1_error) + __PYX_ERR(1, 190, __pyx_L1_error) /* "View.MemoryView":189 * elif self.mode == u"fortran": @@ -25421,7 +26443,7 @@ * @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(3, 221, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -25480,11 +26502,11 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 226, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -25495,7 +26517,7 @@ 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(3, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -25559,9 +26581,9 @@ * 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(3, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 230, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -25624,9 +26646,9 @@ * 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(3, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 233, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -25687,9 +26709,9 @@ * * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(3, 236, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":235 @@ -25712,17 +26734,124 @@ return __pyx_r; } -/* "View.MemoryView":240 - * - * @cname("__pyx_array_new") - * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< - * char *mode, char *buf): - * cdef array result +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -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; +/* 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__36, 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__37, 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":240 + * + * @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; @@ -25748,13 +26877,13 @@ * 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(3, 245, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 245, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -25768,7 +26897,7 @@ __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(3, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -25792,13 +26921,13 @@ * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 247, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -25820,9 +26949,9 @@ * result.data = buf * */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 248, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(3, 248, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error) /* "View.MemoryView":247 * result = array(shape, itemsize, format, mode.decode('ASCII')) @@ -25831,7 +26960,7 @@ * 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(3, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -25907,6 +27036,7 @@ 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; } @@ -25917,7 +27047,7 @@ 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(3, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -25928,7 +27058,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -26026,6 +27156,293 @@ 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":294 * * @cname('__pyx_align_pointer') @@ -26134,8 +27551,11 @@ 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; } @@ -26144,11 +27564,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(3, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -26156,11 +27578,12 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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; @@ -26168,16 +27591,16 @@ } } __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(3, 341, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 341, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -26248,7 +27671,7 @@ * 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 == -1)) __PYX_ERR(3, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error) /* "View.MemoryView":346 * if type(self) is memoryview or obj is not None: @@ -26369,7 +27792,7 @@ * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(3, 357, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error) /* "View.MemoryView":356 * if self.lock is NULL: @@ -26710,26 +28133,26 @@ __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(3, 389, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 389, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(3, 389, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_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(3, 389, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 389, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 389, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -26739,7 +28162,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 389, __pyx_L1_error) + else __PYX_ERR(1, 389, __pyx_L1_error) } break; } @@ -26757,8 +28180,8 @@ * * 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(3, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 390, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":389 @@ -26875,7 +28298,7 @@ * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 399, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -26887,7 +28310,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 399, __pyx_L1_error) + __PYX_ERR(1, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -26895,14 +28318,14 @@ __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(3, 399, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 399, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 399, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; @@ -26916,7 +28339,7 @@ * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":403 @@ -26927,7 +28350,7 @@ * 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(3, 403, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -26950,7 +28373,7 @@ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(3, 405, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 405, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":406 @@ -26961,7 +28384,7 @@ * 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(3, 406, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -27031,7 +28454,7 @@ * * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 409, __pyx_L1_error) + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; @@ -27043,7 +28466,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(3, 409, __pyx_L1_error) + __PYX_ERR(1, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); @@ -27051,14 +28474,14 @@ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 409, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 409, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 409, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; @@ -27072,7 +28495,7 @@ * obj = self.is_slice(value) * if obj: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":412 @@ -27082,7 +28505,7 @@ * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 412, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; @@ -27094,7 +28517,7 @@ * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":414 @@ -27104,9 +28527,9 @@ * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 414, __pyx_L1_error) + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -27129,10 +28552,10 @@ * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 416, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -27157,7 +28580,7 @@ * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 418, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -27245,7 +28668,7 @@ * 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(3, 423, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":424 @@ -27255,7 +28678,7 @@ * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 424, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":423 @@ -27265,7 +28688,7 @@ * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 423, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -27276,7 +28699,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(3, 423, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -27293,7 +28716,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -27310,7 +28733,7 @@ __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(3, 425, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); @@ -27353,7 +28776,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -27425,7 +28848,7 @@ * 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(3, 434, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":435 * @@ -27434,7 +28857,7 @@ * 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(3, 435, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error) /* "View.MemoryView":436 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], @@ -27443,13 +28866,13 @@ * * 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(3, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":434 @@ -27459,7 +28882,7 @@ * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 434, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 434, __pyx_L1_error) /* "View.MemoryView":430 * return obj @@ -27565,7 +28988,7 @@ * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(3, 450, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error) /* "View.MemoryView":449 * if self.view.itemsize > sizeof(array): @@ -27653,7 +29076,7 @@ * */ /*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(3, 459, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 459, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -27676,7 +29099,7 @@ * 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(3, 464, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27791,7 +29214,7 @@ * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(3, 471, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(1, 471, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":472 @@ -27801,7 +29224,7 @@ * * 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(3, 472, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27860,7 +29283,7 @@ * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -27872,7 +29295,7 @@ * 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(3, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -27900,9 +29323,9 @@ * 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(3, 482, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 482, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -27919,7 +29342,7 @@ #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(3, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -27928,14 +29351,14 @@ #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(3, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 482, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -27946,7 +29369,7 @@ __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(3, 482, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -27983,7 +29406,7 @@ * */ __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(3, 487, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -28025,13 +29448,13 @@ * raise ValueError("Unable to convert item to object") * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 483, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(3, 483, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_9); @@ -28043,11 +29466,11 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(3, 484, __pyx_L5_except_error) + __PYX_ERR(1, 484, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -28138,7 +29561,7 @@ * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; @@ -28161,26 +29584,26 @@ * 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(3, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(3, 499, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 499, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -28202,9 +29625,9 @@ * 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(3, 501, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -28221,7 +29644,7 @@ #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(3, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -28230,14 +29653,14 @@ #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(3, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 501, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -28248,12 +29671,12 @@ __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(3, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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(3, 501, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 501, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } @@ -28269,7 +29692,7 @@ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(3, 503, __pyx_L1_error) + __PYX_ERR(1, 503, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -28656,9 +30079,9 @@ * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 540, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(3, 540, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; @@ -28669,7 +30092,7 @@ * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(3, 541, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error) /* "View.MemoryView":542 * cdef _memoryviewslice result = memoryview_copy(self) @@ -28796,18 +30219,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 550, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_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(3, 550, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 550, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 550, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; @@ -28884,11 +30307,11 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(3, 556, __pyx_L1_error) + __PYX_ERR(1, 556, __pyx_L1_error) /* "View.MemoryView":554 * @property @@ -28907,18 +30330,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 558, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_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(3, 558, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 558, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 558, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; @@ -28996,9 +30419,9 @@ * 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(3, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__36, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__40, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -29022,18 +30445,18 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 565, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 565, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(3, 565, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 565, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -29095,7 +30518,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -29155,7 +30578,7 @@ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 573, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -29217,11 +30640,11 @@ * @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(3, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 577, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -29315,7 +30738,7 @@ __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(3, 584, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; @@ -29327,7 +30750,7 @@ * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 585, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; @@ -29505,12 +30928,12 @@ * */ __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(3, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -29521,12 +30944,12 @@ * * def __str__(self): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 599, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -29537,7 +30960,7 @@ * id(self)) * */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -29545,7 +30968,7 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -29609,20 +31032,20 @@ * */ __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(3, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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(3, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -29695,7 +31118,7 @@ * 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(3, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -29766,7 +31189,7 @@ * 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(3, 615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -29846,7 +31269,7 @@ * 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(3, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":627 @@ -29857,7 +31280,7 @@ * 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(3, 627, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -29938,7 +31361,7 @@ * 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(3, 634, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":639 @@ -29949,7 +31372,7 @@ * */ __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(3, 639, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -29974,6 +31397,113 @@ 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__41, 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__42, 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":643 * * @cname('__pyx_memoryview_new') @@ -29998,11 +31528,11 @@ * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 644, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -30013,7 +31543,7 @@ 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(3, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); @@ -30150,7 +31680,7 @@ * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -30188,7 +31718,7 @@ * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 662, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -30224,26 +31754,26 @@ __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(3, 665, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(3, 665, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_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(3, 665, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 665, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 665, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -30253,7 +31783,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 665, __pyx_L1_error) + else __PYX_ERR(1, 665, __pyx_L1_error) } break; } @@ -30263,7 +31793,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(3, 665, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -30297,17 +31827,17 @@ * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 668, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__37); - __Pyx_GIVEREF(__pyx_slice__37); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__37); + __Pyx_INCREF(__pyx_slice__43); + __Pyx_GIVEREF(__pyx_slice__43); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__43); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 668, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":669 @@ -30337,7 +31867,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__38); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__44); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error) } __pyx_L7:; @@ -30387,19 +31917,19 @@ * * 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(3, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 675, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(3, 675, __pyx_L1_error) + __PYX_ERR(1, 675, __pyx_L1_error) /* "View.MemoryView":674 * have_slices = True @@ -30436,7 +31966,7 @@ * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 678, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error) } __pyx_L6:; @@ -30458,7 +31988,7 @@ * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 680, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":681 @@ -30478,16 +32008,16 @@ * * 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(3, 682, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__39); - __Pyx_GIVEREF(__pyx_slice__39); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__39); + __Pyx_INCREF(__pyx_slice__45); + __Pyx_GIVEREF(__pyx_slice__45); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__45); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":681 @@ -30509,20 +32039,20 @@ __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(3, 684, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 684, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 684, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 684, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -30608,11 +32138,11 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(3, 689, __pyx_L1_error) + __PYX_ERR(1, 689, __pyx_L1_error) /* "View.MemoryView":688 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): @@ -30716,7 +32246,7 @@ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(3, 708, __pyx_L1_error) + __PYX_ERR(1, 708, __pyx_L1_error) } } #endif @@ -30739,7 +32269,7 @@ * 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(3, 711, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -30835,26 +32365,26 @@ __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(3, 732, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 732, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(3, 732, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_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(3, 732, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 732, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 732, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -30864,7 +32394,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(3, 732, __pyx_L1_error) + else __PYX_ERR(1, 732, __pyx_L1_error) } break; } @@ -30892,7 +32422,7 @@ * 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(3, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error) /* "View.MemoryView":734 * for dim, index in enumerate(indices): @@ -30901,7 +32431,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 734, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 734, __pyx_L1_error) /* "View.MemoryView":733 * @@ -30978,13 +32508,13 @@ * 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(3, 746, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 746, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 746, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -31000,13 +32530,13 @@ * 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(3, 747, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 747, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 747, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -31022,13 +32552,13 @@ * * 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(3, 748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 748, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 748, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -31044,7 +32574,7 @@ * 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(3, 750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -31057,7 +32587,7 @@ * 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(3, 751, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -31070,7 +32600,7 @@ * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 752, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -31083,7 +32613,7 @@ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 754, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 754, __pyx_L1_error) /* "View.MemoryView":760 * have_start, have_stop, have_step, @@ -31133,7 +32663,7 @@ * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 764, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) } /* "View.MemoryView":765 * return memoryview_fromslice(dst, new_ndim, @@ -31142,7 +32672,7 @@ * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 765, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) } /* "View.MemoryView":763 * @@ -31151,9 +32681,9 @@ * 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(3, 763, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 763, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -31184,7 +32714,7 @@ * * */ - __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(3, 768, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":768 @@ -31194,7 +32724,7 @@ * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 768, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -31297,7 +32827,7 @@ * 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 == -1)) __PYX_ERR(3, 818, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: @@ -31362,7 +32892,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 824, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error) /* "View.MemoryView":823 * negative_step = have_step != 0 and step < 0 @@ -31934,7 +33464,7 @@ * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 885, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error) } __pyx_L26:; @@ -31991,11 +33521,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -32063,11 +33593,11 @@ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(3, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __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(3, 903, __pyx_L1_error) + __PYX_ERR(1, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); @@ -32175,22 +33705,22 @@ * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(3, 914, __pyx_L1_error) + __PYX_ERR(1, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: @@ -32227,22 +33757,22 @@ * * resultp = bufp + index * stride */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 917, __pyx_L1_error) + __PYX_ERR(1, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) @@ -32442,7 +33972,7 @@ * * return 1 */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 943, __pyx_L1_error) + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] @@ -32476,11 +34006,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -32565,7 +34095,7 @@ * 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(3, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -32589,7 +34119,7 @@ */ /*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(3, 969, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -32648,7 +34178,7 @@ * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(3, 973, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error) /* "View.MemoryView":972 * @@ -32668,7 +34198,7 @@ * @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(3, 975, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -32748,6 +34278,113 @@ 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__47, 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__48, 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":985 * * @cname('__pyx_memoryview_fromslice') @@ -32811,9 +34448,9 @@ * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 999, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -32824,7 +34461,7 @@ __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(3, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -32855,7 +34492,7 @@ * 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(3, 1004, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -33026,7 +34663,7 @@ __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(3, 1026, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; @@ -33038,12 +34675,12 @@ * * 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(3, 1027, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1027, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1027, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } @@ -33135,7 +34772,7 @@ * 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(3, 1039, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); @@ -33192,7 +34829,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -33356,7 +34993,7 @@ * @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(3, 1067, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -33479,7 +35116,7 @@ * * */ - __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(3, 1084, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; @@ -34277,7 +35914,7 @@ * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(3, 1208, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error) /* "View.MemoryView":1207 * @@ -34449,11 +36086,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -34477,7 +36114,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -34488,13 +36125,13 @@ * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1238, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -34513,20 +36150,20 @@ * (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(3, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1237, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(3, 1237, __pyx_L1_error) + __PYX_ERR(1, 1237, __pyx_L1_error) /* "View.MemoryView":1235 * @@ -34546,7 +36183,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -34568,7 +36205,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -34580,11 +36217,11 @@ * * @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(3, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -34600,14 +36237,14 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #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(3, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -34616,20 +36253,20 @@ #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(3, 1242, __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(1, 1242, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -34637,7 +36274,7 @@ __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(3, 1242, __pyx_L1_error) + __PYX_ERR(1, 1242, __pyx_L1_error) /* "View.MemoryView":1241 * @@ -34659,7 +36296,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -34682,7 +36319,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -34704,7 +36341,7 @@ * 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(3, 1247, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -34718,14 +36355,14 @@ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #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(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -34734,20 +36371,20 @@ #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(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -34755,7 +36392,7 @@ __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(3, 1247, __pyx_L1_error) + __PYX_ERR(1, 1247, __pyx_L1_error) /* "View.MemoryView":1246 * @cname('__pyx_memoryview_err') @@ -34775,7 +36412,7 @@ */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(3, 1249, __pyx_L1_error) + __PYX_ERR(1, 1249, __pyx_L1_error) } /* "View.MemoryView":1245 @@ -34798,7 +36435,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -35016,7 +36653,7 @@ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 1281, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1281, __pyx_L1_error) } __pyx_L7:; @@ -35046,7 +36683,7 @@ * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 1284, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error) /* "View.MemoryView":1283 * _err_extents(i, dst.shape[i], src.shape[i]) @@ -35103,7 +36740,7 @@ * src = tmp * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(3, 1291, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(1, 1291, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1292 @@ -35287,7 +36924,7 @@ * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(3, 1313, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error) /* "View.MemoryView":1314 * @@ -35296,7 +36933,7 @@ * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(3, 1314, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error) /* "View.MemoryView":1310 * return 0 @@ -35365,11 +37002,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -35549,7 +37186,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -35573,7 +37210,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -35883,6 +37520,469 @@ /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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, 1); 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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 PyObject *__pyx_tp_new_2yt_9utilities_3lib_14misc_utilities_OnceIndirect(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect *p; PyObject *o; @@ -35905,7 +38005,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_14misc_utilities_OnceIndirect(PyObject *o) { struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect *p = (struct __pyx_obj_2yt_9utilities_3lib_14misc_utilities_OnceIndirect *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -35942,6 +38042,8 @@ } static PyMethodDef __pyx_methods_2yt_9utilities_3lib_14misc_utilities_OnceIndirect[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_14misc_utilities_12OnceIndirect_9__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -36044,7 +38146,7 @@ static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (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 @@ -36094,6 +38196,8 @@ 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} }; @@ -36213,7 +38317,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -36241,6 +38345,8 @@ } 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} }; @@ -36328,7 +38434,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -36440,6 +38546,8 @@ {"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} }; @@ -36565,7 +38673,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -36609,6 +38717,8 @@ } 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} }; @@ -36716,6 +38826,7 @@ {&__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}, @@ -36728,19 +38839,22 @@ {&__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_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1}, {&__pyx_n_s_RE, __pyx_k_RE, sizeof(__pyx_k_RE), 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_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 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_YTArray, __pyx_k_YTArray, sizeof(__pyx_k_YTArray), 0, 0, 1, 1}, - {&__pyx_n_s__55, __pyx_k__55, sizeof(__pyx_k__55), 0, 0, 1, 1}, + {&__pyx_n_s__63, __pyx_k__63, sizeof(__pyx_k__63), 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_allow_indirect, __pyx_k_allow_indirect, sizeof(__pyx_k_allow_indirect), 0, 0, 1, 1}, {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1}, {&__pyx_n_s_antialias, __pyx_k_antialias, sizeof(__pyx_k_antialias), 0, 0, 1, 1}, + {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1}, + {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 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_best_dim, __pyx_k_best_dim, sizeof(__pyx_k_best_dim), 0, 0, 1, 1}, @@ -36768,11 +38882,13 @@ {&__pyx_n_s_bulk_velocity, __pyx_k_bulk_velocity, sizeof(__pyx_k_bulk_velocity), 0, 0, 1, 1}, {&__pyx_n_s_bv, __pyx_k_bv, sizeof(__pyx_k_bv), 0, 0, 1, 1}, {&__pyx_n_s_bval, __pyx_k_bval, sizeof(__pyx_k_bval), 0, 0, 1, 1}, + {&__pyx_n_s_bval_mresult, __pyx_k_bval_mresult, sizeof(__pyx_k_bval_mresult), 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_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 1}, {&__pyx_n_s_check_period, __pyx_k_check_period, sizeof(__pyx_k_check_period), 0, 0, 1, 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_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 0, 0, 1, 1}, {&__pyx_n_s_colors, __pyx_k_colors, sizeof(__pyx_k_colors), 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}, @@ -36784,6 +38900,7 @@ {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_dds, __pyx_k_dds, sizeof(__pyx_k_dds), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1}, {&__pyx_n_s_dimensions, __pyx_k_dimensions, sizeof(__pyx_k_dimensions), 0, 0, 1, 1}, {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1}, @@ -36836,6 +38953,7 @@ {&__pyx_n_s_has_alpha, __pyx_k_has_alpha, sizeof(__pyx_k_has_alpha), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, {&__pyx_n_s_ifield, __pyx_k_ifield, sizeof(__pyx_k_ifield), 0, 0, 1, 1}, {&__pyx_n_s_iind, __pyx_k_iind, sizeof(__pyx_k_iind), 0, 0, 1, 1}, {&__pyx_n_s_image, __pyx_k_image, sizeof(__pyx_k_image), 0, 0, 1, 1}, @@ -36844,6 +38962,7 @@ {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1}, {&__pyx_n_s_input_fields, __pyx_k_input_fields, sizeof(__pyx_k_input_fields), 0, 0, 1, 1}, {&__pyx_n_s_inside, __pyx_k_inside, sizeof(__pyx_k_inside), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, {&__pyx_n_s_ipos, __pyx_k_ipos, sizeof(__pyx_k_ipos), 0, 0, 1, 1}, {&__pyx_n_s_ires, __pyx_k_ires, sizeof(__pyx_k_ires), 0, 0, 1, 1}, {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, @@ -36852,6 +38971,9 @@ {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, {&__pyx_n_s_kdtree_get_choices, __pyx_k_kdtree_get_choices, sizeof(__pyx_k_kdtree_get_choices), 0, 0, 1, 1}, {&__pyx_n_s_kinetic, __pyx_k_kinetic, sizeof(__pyx_k_kinetic), 0, 0, 1, 1}, + {&__pyx_n_s_ks, __pyx_k_ks, sizeof(__pyx_k_ks), 0, 0, 1, 1}, + {&__pyx_n_s_kx, __pyx_k_kx, sizeof(__pyx_k_kx), 0, 0, 1, 1}, + {&__pyx_n_s_ky, __pyx_k_ky, sizeof(__pyx_k_ky), 0, 0, 1, 1}, {&__pyx_n_s_l_corner, __pyx_k_l_corner, sizeof(__pyx_k_l_corner), 0, 0, 1, 1}, {&__pyx_n_s_ld, __pyx_k_ld, sizeof(__pyx_k_ld), 0, 0, 1, 1}, {&__pyx_n_s_left_edge, __pyx_k_left_edge, sizeof(__pyx_k_left_edge), 0, 0, 1, 1}, @@ -36891,6 +39013,7 @@ {&__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_new_bin_profile1d, __pyx_k_new_bin_profile1d, sizeof(__pyx_k_new_bin_profile1d), 0, 0, 1, 1}, {&__pyx_n_s_new_bin_profile2d, __pyx_k_new_bin_profile2d, sizeof(__pyx_k_new_bin_profile2d), 0, 0, 1, 1}, {&__pyx_n_s_new_bin_profile3d, __pyx_k_new_bin_profile3d, sizeof(__pyx_k_new_bin_profile3d), 0, 0, 1, 1}, @@ -36901,6 +39024,7 @@ {&__pyx_n_s_nk, __pyx_k_nk, sizeof(__pyx_k_nk), 0, 0, 1, 1}, {&__pyx_n_s_nl, __pyx_k_nl, sizeof(__pyx_k_nl), 0, 0, 1, 1}, {&__pyx_n_s_no_color, __pyx_k_no_color, sizeof(__pyx_k_no_color), 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}, @@ -36931,18 +39055,28 @@ {&__pyx_n_s_pdx, __pyx_k_pdx, sizeof(__pyx_k_pdx), 0, 0, 1, 1}, {&__pyx_n_s_pdy, __pyx_k_pdy, sizeof(__pyx_k_pdy), 0, 0, 1, 1}, {&__pyx_n_s_period, __pyx_k_period, sizeof(__pyx_k_period), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_point, __pyx_k_point, sizeof(__pyx_k_point), 0, 0, 1, 1}, {&__pyx_n_s_points_per_color, __pyx_k_points_per_color, sizeof(__pyx_k_points_per_color), 0, 0, 1, 1}, {&__pyx_n_s_px, __pyx_k_px, sizeof(__pyx_k_px), 0, 0, 1, 1}, {&__pyx_n_s_py, __pyx_k_py, sizeof(__pyx_k_py), 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_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_q_inner, __pyx_k_q_inner, sizeof(__pyx_k_q_inner), 0, 0, 1, 1}, {&__pyx_n_s_q_outer, __pyx_k_q_outer, sizeof(__pyx_k_q_outer), 0, 0, 1, 1}, {&__pyx_n_s_qresult, __pyx_k_qresult, sizeof(__pyx_k_qresult), 0, 0, 1, 1}, + {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, + {&__pyx_n_s_r2, __pyx_k_r2, sizeof(__pyx_k_r2), 0, 0, 1, 1}, {&__pyx_n_s_r_corner, __pyx_k_r_corner, sizeof(__pyx_k_r_corner), 0, 0, 1, 1}, + {&__pyx_n_s_radii, __pyx_k_radii, sizeof(__pyx_k_radii), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 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_refine_by, __pyx_k_refine_by, sizeof(__pyx_k_refine_by), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_rf, __pyx_k_rf, sizeof(__pyx_k_rf), 0, 0, 1, 1}, {&__pyx_n_s_rg, __pyx_k_rg, sizeof(__pyx_k_rg), 0, 0, 1, 1}, {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 0, 0, 1, 1}, @@ -36955,6 +39089,7 @@ {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_rvf, __pyx_k_rvf, sizeof(__pyx_k_rvf), 0, 0, 1, 1}, {&__pyx_n_s_rvg, __pyx_k_rvg, sizeof(__pyx_k_rvg), 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_skipit, __pyx_k_skipit, sizeof(__pyx_k_skipit), 0, 0, 1, 1}, @@ -36968,6 +39103,7 @@ {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, {&__pyx_n_s_strides, __pyx_k_strides, sizeof(__pyx_k_strides), 0, 0, 1, 1}, + {&__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_suboffsets, __pyx_k_suboffsets, sizeof(__pyx_k_suboffsets), 0, 0, 1, 1}, {&__pyx_n_s_sx, __pyx_k_sx, sizeof(__pyx_k_sx), 0, 0, 1, 1}, @@ -37035,7 +39171,8 @@ {&__pyx_n_s_ys, __pyx_k_ys, sizeof(__pyx_k_ys), 0, 0, 1, 1}, {&__pyx_n_s_yt_funcs, __pyx_k_yt_funcs, sizeof(__pyx_k_yt_funcs), 0, 0, 1, 1}, {&__pyx_n_s_yt_units_yt_array, __pyx_k_yt_units_yt_array, sizeof(__pyx_k_yt_units_yt_array), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_misc_utilities, __pyx_k_yt_utilities_lib_misc_utilities, sizeof(__pyx_k_yt_utilities_lib_misc_utilities), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_k_yt_utilities_lib_misc_utilities, sizeof(__pyx_k_yt_utilities_lib_misc_utilities), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_misc_utilities_2, __pyx_k_yt_utilities_lib_misc_utilities_2, sizeof(__pyx_k_yt_utilities_lib_misc_utilities_2), 0, 0, 1, 1}, {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, {&__pyx_n_s_z0, __pyx_k_z0, sizeof(__pyx_k_z0), 0, 0, 1, 1}, {&__pyx_n_s_z1, __pyx_k_z1, sizeof(__pyx_k_z1), 0, 0, 1, 1}, @@ -37054,16 +39191,16 @@ }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 53, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 552, __pyx_L1_error) - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 656, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 146, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(3, 149, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(3, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(3, 425, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(3, 599, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(3, 818, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 673, __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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -37073,185 +39210,204 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "yt/utilities/lib/misc_utilities.pyx":336 + /* "yt/utilities/lib/misc_utilities.pyx":341 * cdef np.int64_t x0, x1, y0, y1, yi0 * cdef np.float64_t z0, z1, dzx, dzy * alpha = np.zeros(4) # <<<<<<<<<<<<<< * for j in range(0, nl, 2): * # From wikipedia http://en.wikipedia.org/wiki/Bresenham's_line_algorithm */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_4); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_4); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "yt/utilities/lib/misc_utilities.pyx":430 + /* "yt/utilities/lib/misc_utilities.pyx":438 * cdef np.int64_t x0, y0, yi0 * cdef np.float64_t z0 * alpha = np.zeros(4) # <<<<<<<<<<<<<< - * for j in range(0, nl): - * x0 = xs[j] + * #the sources must be ordered along z to avoid edges when two overlap + * idx = np.argsort(zs) */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_4); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_4); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "yt/utilities/lib/misc_utilities.pyx":566 + /* "yt/utilities/lib/misc_utilities.pyx":583 * greater_ids[i] = 0 * # Return out unique values * return best_dim, split, less_ids.view("bool"), greater_ids.view("bool") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "yt/utilities/lib/misc_utilities.pyx":674 + /* "yt/utilities/lib/misc_utilities.pyx":691 * cdef np.float64_t c[3] * cdef int i, j, k * center = data.get_field_parameter("center") # <<<<<<<<<<<<<< * c[0] = center[0]; c[1] = center[1]; c[2] = center[2] * if len(data['x'].shape) == 1: */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_center); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_center); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "yt/utilities/lib/misc_utilities.pyx":706 + /* "yt/utilities/lib/misc_utilities.pyx":723 * @cython.wraparound(False) * @cython.cdivision(True) * def obtain_rv_vec(data, field_names = ("velocity_x", # <<<<<<<<<<<<<< * "velocity_y", * "velocity_z"), */ - __pyx_tuple__6 = PyTuple_Pack(3, __pyx_n_s_velocity_x, __pyx_n_s_velocity_y, __pyx_n_s_velocity_z); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(3, __pyx_n_s_velocity_x, __pyx_n_s_velocity_y, __pyx_n_s_velocity_z); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "yt/utilities/lib/misc_utilities.pyx":725 + /* "yt/utilities/lib/misc_utilities.pyx":742 * if len(data[field_names[0]].shape) == 1: * # One dimensional data * vxf = data[field_names[0]].astype("float64") # <<<<<<<<<<<<<< * vyf = data[field_names[1]].astype("float64") * vzf = data[field_names[2]].astype("float64") */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "yt/utilities/lib/misc_utilities.pyx":726 + /* "yt/utilities/lib/misc_utilities.pyx":743 * # One dimensional data * vxf = data[field_names[0]].astype("float64") * vyf = data[field_names[1]].astype("float64") # <<<<<<<<<<<<<< * vzf = data[field_names[2]].astype("float64") * vyf.convert_to_units(vxf.units) */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "yt/utilities/lib/misc_utilities.pyx":727 + /* "yt/utilities/lib/misc_utilities.pyx":744 * vxf = data[field_names[0]].astype("float64") * vyf = data[field_names[1]].astype("float64") * vzf = data[field_names[2]].astype("float64") # <<<<<<<<<<<<<< * vyf.convert_to_units(vxf.units) * vzf.convert_to_units(vxf.units) */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "yt/utilities/lib/misc_utilities.pyx":745 + /* "yt/utilities/lib/misc_utilities.pyx":762 * else: * # Three dimensional data * vxg = data[field_names[0]].astype("float64") # <<<<<<<<<<<<<< * vyg = data[field_names[1]].astype("float64") * vzg = data[field_names[2]].astype("float64") */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "yt/utilities/lib/misc_utilities.pyx":746 + /* "yt/utilities/lib/misc_utilities.pyx":763 * # Three dimensional data * vxg = data[field_names[0]].astype("float64") * vyg = data[field_names[1]].astype("float64") # <<<<<<<<<<<<<< * vzg = data[field_names[2]].astype("float64") * vyg.convert_to_units(vxg.units) */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "yt/utilities/lib/misc_utilities.pyx":747 + /* "yt/utilities/lib/misc_utilities.pyx":764 * vxg = data[field_names[0]].astype("float64") * vyg = data[field_names[1]].astype("float64") * vzg = data[field_names[2]].astype("float64") # <<<<<<<<<<<<<< * vyg.convert_to_units(vxg.units) * vzg.convert_to_units(vxg.units) */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - /* "yt/utilities/lib/misc_utilities.pyx":768 + /* "yt/utilities/lib/misc_utilities.pyx":786 * * def grow_flagging_field(oofield): * cdef np.ndarray[np.uint8_t, ndim=3] ofield = oofield.astype("uint8") # <<<<<<<<<<<<<< * cdef np.ndarray[np.uint8_t, ndim=3] nfield * nfield = np.zeros_like(ofield) */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_uint8); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 768, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_uint8); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - /* "yt/utilities/lib/misc_utilities.pyx":787 + /* "yt/utilities/lib/misc_utilities.pyx":805 * if ofield[i, j, k] == 1: * nfield[ni, nj, nk] = 1 * return nfield.astype("bool") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 787, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - /* "yt/utilities/lib/misc_utilities.pyx":1106 + /* "yt/utilities/lib/misc_utilities.pyx":1126 * def __getbuffer__(self, Py_buffer* buff, int flags): * if (flags & buffer.PyBUF_INDIRECT) != buffer.PyBUF_INDIRECT: * raise Exception("don't want to copy data") # <<<<<<<<<<<<<< * if flags & buffer.PyBUF_WRITABLE and self.is_readonly: * raise Exception("couldn't provide writable, you should have demanded it earlier") */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_don_t_want_to_copy_data); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_don_t_want_to_copy_data); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - /* "yt/utilities/lib/misc_utilities.pyx":1108 + /* "yt/utilities/lib/misc_utilities.pyx":1128 * raise Exception("don't want to copy data") * if flags & buffer.PyBUF_WRITABLE and self.is_readonly: * raise Exception("couldn't provide writable, you should have demanded it earlier") # <<<<<<<<<<<<<< * if flags & buffer.PyBUF_FORMAT: * if self.format is None: */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_couldn_t_provide_writable_you_sh); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_couldn_t_provide_writable_you_sh); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - /* "yt/utilities/lib/misc_utilities.pyx":1111 + /* "yt/utilities/lib/misc_utilities.pyx":1131 * if flags & buffer.PyBUF_FORMAT: * if self.format is None: * raise Exception("couldn't provide format, you should have demanded it earlier") # <<<<<<<<<<<<<< * buff.format = self.format * else: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_couldn_t_provide_format_you_shou); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_couldn_t_provide_format_you_shou); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); + /* "(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__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "(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__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): @@ -37259,9 +39415,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -37270,9 +39426,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -37281,9 +39437,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -37292,9 +39448,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -37303,9 +39459,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -37314,9 +39470,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -37325,9 +39481,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -37336,29 +39492,29 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); - /* "yt/geometry/selection_routines.pxd":30 + /* "yt/geometry/selection_routines.pxd":26 * if "code_length" == str(arr.units): * return arr * arr.convert_to_units("code_length") # <<<<<<<<<<<<<< * return arr * */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(3, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "View.MemoryView":131 * @@ -37367,9 +39523,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); /* "View.MemoryView":134 * @@ -37378,9 +39534,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(3, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); /* "View.MemoryView":137 * @@ -37389,9 +39545,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(3, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); /* "View.MemoryView":146 * @@ -37400,9 +39556,9 @@ * * */ - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(3, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -37411,9 +39567,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(3, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -37422,9 +39578,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(3, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "(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__36 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "(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__37 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -37433,9 +39608,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(3, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -37444,9 +39619,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(3, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); /* "View.MemoryView":563 * def suboffsets(self): @@ -37455,12 +39630,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__36 = PyTuple_New(1); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(3, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); + __pyx_tuple__40 = PyTuple_New(1); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__36, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__36); + PyTuple_SET_ITEM(__pyx_tuple__40, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "(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__41 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "(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__42 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); /* "View.MemoryView":668 * if item is Ellipsis: @@ -37469,9 +39663,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__37 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__37)) __PYX_ERR(3, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__37); - __Pyx_GIVEREF(__pyx_slice__37); + __pyx_slice__43 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__43)) __PYX_ERR(1, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__43); + __Pyx_GIVEREF(__pyx_slice__43); /* "View.MemoryView":671 * seen_ellipsis = True @@ -37480,9 +39674,9 @@ * have_slices = True * else: */ - __pyx_slice__38 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__38)) __PYX_ERR(3, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__38); - __Pyx_GIVEREF(__pyx_slice__38); + __pyx_slice__44 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__44)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__44); + __Pyx_GIVEREF(__pyx_slice__44); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -37491,9 +39685,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__39 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__39)) __PYX_ERR(3, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__39); - __Pyx_GIVEREF(__pyx_slice__39); + __pyx_slice__45 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__45)) __PYX_ERR(1, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__45); + __Pyx_GIVEREF(__pyx_slice__45); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -37502,9 +39696,28 @@ * * */ - __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(3, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + + /* "(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__47 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + + /* "(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__48 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); /* "yt/utilities/lib/misc_utilities.pyx":41 * @cython.wraparound(False) @@ -37513,250 +39726,250 @@ * np.ndarray[np.float64_t, ndim=1] wsource, * np.ndarray[np.float64_t, ndim=2] bsource, */ - __pyx_tuple__41 = PyTuple_Pack(16, __pyx_n_s_bins_x, __pyx_n_s_wsource, __pyx_n_s_bsource, __pyx_n_s_wresult, __pyx_n_s_bresult, __pyx_n_s_mresult, __pyx_n_s_qresult, __pyx_n_s_used, __pyx_n_s_n, __pyx_n_s_fi, __pyx_n_s_bin, __pyx_n_s_wval, __pyx_n_s_bval, __pyx_n_s_oldwr, __pyx_n_s_nb, __pyx_n_s_nf); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(8, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_new_bin_profile1d, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_tuple__49 = PyTuple_Pack(17, __pyx_n_s_bins_x, __pyx_n_s_wsource, __pyx_n_s_bsource, __pyx_n_s_wresult, __pyx_n_s_bresult, __pyx_n_s_mresult, __pyx_n_s_qresult, __pyx_n_s_used, __pyx_n_s_n, __pyx_n_s_fi, __pyx_n_s_bin, __pyx_n_s_wval, __pyx_n_s_bval, __pyx_n_s_oldwr, __pyx_n_s_bval_mresult, __pyx_n_s_nb, __pyx_n_s_nf); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(8, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_new_bin_profile1d, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 41, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":72 + /* "yt/utilities/lib/misc_utilities.pyx":73 * @cython.wraparound(False) * @cython.cdivision(True) * def new_bin_profile2d(np.ndarray[np.intp_t, ndim=1] bins_x, # <<<<<<<<<<<<<< * np.ndarray[np.intp_t, ndim=1] bins_y, * np.ndarray[np.float64_t, ndim=1] wsource, */ - __pyx_tuple__43 = PyTuple_Pack(18, __pyx_n_s_bins_x, __pyx_n_s_bins_y, __pyx_n_s_wsource, __pyx_n_s_bsource, __pyx_n_s_wresult, __pyx_n_s_bresult, __pyx_n_s_mresult, __pyx_n_s_qresult, __pyx_n_s_used, __pyx_n_s_n, __pyx_n_s_fi, __pyx_n_s_bin_x, __pyx_n_s_bin_y, __pyx_n_s_wval, __pyx_n_s_bval, __pyx_n_s_oldwr, __pyx_n_s_nb, __pyx_n_s_nf); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); - __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(9, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_new_bin_profile2d, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_tuple__51 = PyTuple_Pack(19, __pyx_n_s_bins_x, __pyx_n_s_bins_y, __pyx_n_s_wsource, __pyx_n_s_bsource, __pyx_n_s_wresult, __pyx_n_s_bresult, __pyx_n_s_mresult, __pyx_n_s_qresult, __pyx_n_s_used, __pyx_n_s_n, __pyx_n_s_fi, __pyx_n_s_bin_x, __pyx_n_s_bin_y, __pyx_n_s_wval, __pyx_n_s_bval, __pyx_n_s_oldwr, __pyx_n_s_bval_mresult, __pyx_n_s_nb, __pyx_n_s_nf); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_new_bin_profile2d, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 73, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":105 + /* "yt/utilities/lib/misc_utilities.pyx":107 * @cython.wraparound(False) * @cython.cdivision(True) * def new_bin_profile3d(np.ndarray[np.intp_t, ndim=1] bins_x, # <<<<<<<<<<<<<< * np.ndarray[np.intp_t, ndim=1] bins_y, * np.ndarray[np.intp_t, ndim=1] bins_z, */ - __pyx_tuple__45 = PyTuple_Pack(20, __pyx_n_s_bins_x, __pyx_n_s_bins_y, __pyx_n_s_bins_z, __pyx_n_s_wsource, __pyx_n_s_bsource, __pyx_n_s_wresult, __pyx_n_s_bresult, __pyx_n_s_mresult, __pyx_n_s_qresult, __pyx_n_s_used, __pyx_n_s_n, __pyx_n_s_fi, __pyx_n_s_bin_x, __pyx_n_s_bin_y, __pyx_n_s_bin_z, __pyx_n_s_wval, __pyx_n_s_bval, __pyx_n_s_oldwr, __pyx_n_s_nb, __pyx_n_s_nf); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); - __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(10, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_new_bin_profile3d, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_tuple__53 = PyTuple_Pack(21, __pyx_n_s_bins_x, __pyx_n_s_bins_y, __pyx_n_s_bins_z, __pyx_n_s_wsource, __pyx_n_s_bsource, __pyx_n_s_wresult, __pyx_n_s_bresult, __pyx_n_s_mresult, __pyx_n_s_qresult, __pyx_n_s_used, __pyx_n_s_n, __pyx_n_s_fi, __pyx_n_s_bin_x, __pyx_n_s_bin_y, __pyx_n_s_bin_z, __pyx_n_s_wval, __pyx_n_s_bval, __pyx_n_s_oldwr, __pyx_n_s_bval_mresult, __pyx_n_s_nb, __pyx_n_s_nf); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(10, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_new_bin_profile3d, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 107, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":143 + /* "yt/utilities/lib/misc_utilities.pyx":145 * @cython.wraparound(False) * @cython.cdivision(True) * def bin_profile1d(np.ndarray[np.int64_t, ndim=1] bins_x, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] wsource, * np.ndarray[np.float64_t, ndim=1] bsource, */ - __pyx_tuple__47 = PyTuple_Pack(12, __pyx_n_s_bins_x, __pyx_n_s_wsource, __pyx_n_s_bsource, __pyx_n_s_wresult, __pyx_n_s_bresult, __pyx_n_s_mresult, __pyx_n_s_qresult, __pyx_n_s_used, __pyx_n_s_n, __pyx_n_s_bin, __pyx_n_s_wval, __pyx_n_s_bval); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); - __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(8, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_bin_profile1d, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_tuple__55 = PyTuple_Pack(13, __pyx_n_s_bins_x, __pyx_n_s_wsource, __pyx_n_s_bsource, __pyx_n_s_wresult, __pyx_n_s_bresult, __pyx_n_s_mresult, __pyx_n_s_qresult, __pyx_n_s_used, __pyx_n_s_n, __pyx_n_s_bin, __pyx_n_s_wval, __pyx_n_s_bval, __pyx_n_s_bval_mresult); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(8, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_bin_profile1d, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 145, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":168 + /* "yt/utilities/lib/misc_utilities.pyx":171 * @cython.wraparound(False) * @cython.cdivision(True) * def bin_profile2d(np.ndarray[np.int64_t, ndim=1] bins_x, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] bins_y, * np.ndarray[np.float64_t, ndim=1] wsource, */ - __pyx_tuple__49 = PyTuple_Pack(14, __pyx_n_s_bins_x, __pyx_n_s_bins_y, __pyx_n_s_wsource, __pyx_n_s_bsource, __pyx_n_s_wresult, __pyx_n_s_bresult, __pyx_n_s_mresult, __pyx_n_s_qresult, __pyx_n_s_used, __pyx_n_s_n, __pyx_n_s_bini, __pyx_n_s_binj, __pyx_n_s_wval, __pyx_n_s_bval); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); - __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(9, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_bin_profile2d, 168, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_tuple__57 = PyTuple_Pack(15, __pyx_n_s_bins_x, __pyx_n_s_bins_y, __pyx_n_s_wsource, __pyx_n_s_bsource, __pyx_n_s_wresult, __pyx_n_s_bresult, __pyx_n_s_mresult, __pyx_n_s_qresult, __pyx_n_s_used, __pyx_n_s_n, __pyx_n_s_bini, __pyx_n_s_binj, __pyx_n_s_wval, __pyx_n_s_bval, __pyx_n_s_bval_mresult); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(9, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_bin_profile2d, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 171, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":195 + /* "yt/utilities/lib/misc_utilities.pyx":199 * @cython.wraparound(False) * @cython.cdivision(True) * def bin_profile3d(np.ndarray[np.int64_t, ndim=1] bins_x, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] bins_y, * np.ndarray[np.int64_t, ndim=1] bins_z, */ - __pyx_tuple__51 = PyTuple_Pack(16, __pyx_n_s_bins_x, __pyx_n_s_bins_y, __pyx_n_s_bins_z, __pyx_n_s_wsource, __pyx_n_s_bsource, __pyx_n_s_wresult, __pyx_n_s_bresult, __pyx_n_s_mresult, __pyx_n_s_qresult, __pyx_n_s_used, __pyx_n_s_n, __pyx_n_s_bini, __pyx_n_s_binj, __pyx_n_s_bink, __pyx_n_s_wval, __pyx_n_s_bval); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); - __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(10, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_bin_profile3d, 195, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_tuple__59 = PyTuple_Pack(17, __pyx_n_s_bins_x, __pyx_n_s_bins_y, __pyx_n_s_bins_z, __pyx_n_s_wsource, __pyx_n_s_bsource, __pyx_n_s_wresult, __pyx_n_s_bresult, __pyx_n_s_mresult, __pyx_n_s_qresult, __pyx_n_s_used, __pyx_n_s_n, __pyx_n_s_bini, __pyx_n_s_binj, __pyx_n_s_bink, __pyx_n_s_wval, __pyx_n_s_bval, __pyx_n_s_bval_mresult); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(10, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_bin_profile3d, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 199, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":224 + /* "yt/utilities/lib/misc_utilities.pyx":229 * @cython.wraparound(False) * @cython.cdivision(True) * def lines(np.float64_t[:,:,:] image, # <<<<<<<<<<<<<< * np.int64_t[:] xs, * np.int64_t[:] ys, */ - __pyx_tuple__53 = PyTuple_Pack(30, __pyx_n_s_image, __pyx_n_s_xs, __pyx_n_s_ys, __pyx_n_s_colors, __pyx_n_s_points_per_color, __pyx_n_s_thick, __pyx_n_s_flip, __pyx_n_s_crop, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nl, __pyx_n_s_alpha, __pyx_n_s_outa, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_e2, __pyx_n_s_err, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_y0, __pyx_n_s_y1, __pyx_n_s_has_alpha, __pyx_n_s_no_color, __pyx_n_s_yi0); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); - __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(8, 0, 30, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_lines, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_tuple__61 = PyTuple_Pack(30, __pyx_n_s_image, __pyx_n_s_xs, __pyx_n_s_ys, __pyx_n_s_colors, __pyx_n_s_points_per_color, __pyx_n_s_thick, __pyx_n_s_flip, __pyx_n_s_crop, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nl, __pyx_n_s_alpha, __pyx_n_s_outa, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_e2, __pyx_n_s_err, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_y0, __pyx_n_s_y1, __pyx_n_s_has_alpha, __pyx_n_s_no_color, __pyx_n_s_yi0); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(8, 0, 30, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_lines, 229, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 229, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":317 + /* "yt/utilities/lib/misc_utilities.pyx":322 * @cython.wraparound(False) * @cython.cdivision(True) * def zlines(np.ndarray[np.float64_t, ndim=3] image, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] zbuffer, * np.ndarray[np.int64_t, ndim=1] xs, */ - __pyx_tuple__56 = PyTuple_Pack(35, __pyx_n_s_image, __pyx_n_s_zbuffer, __pyx_n_s_xs, __pyx_n_s_ys, __pyx_n_s_zs, __pyx_n_s_colors, __pyx_n_s_points_per_color, __pyx_n_s_thick, __pyx_n_s_flip, __pyx_n_s_crop, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nl, __pyx_n_s_alpha, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_c, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_e2, __pyx_n_s_err, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_y0, __pyx_n_s_y1, __pyx_n_s_yi0, __pyx_n_s_z0, __pyx_n_s_z1, __pyx_n_s_dzx, __pyx_n_s_dzy, __pyx_n_s__55, __pyx_n_s_yi, __pyx_n_s_talpha); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); - __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(10, 0, 35, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_zlines, 317, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_tuple__64 = PyTuple_Pack(35, __pyx_n_s_image, __pyx_n_s_zbuffer, __pyx_n_s_xs, __pyx_n_s_ys, __pyx_n_s_zs, __pyx_n_s_colors, __pyx_n_s_points_per_color, __pyx_n_s_thick, __pyx_n_s_flip, __pyx_n_s_crop, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nl, __pyx_n_s_alpha, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_c, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_e2, __pyx_n_s_err, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_y0, __pyx_n_s_y1, __pyx_n_s_yi0, __pyx_n_s_z0, __pyx_n_s_z1, __pyx_n_s_dzx, __pyx_n_s_dzy, __pyx_n_s__63, __pyx_n_s_yi, __pyx_n_s_talpha); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(10, 0, 35, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_zlines, 322, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 322, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":412 + /* "yt/utilities/lib/misc_utilities.pyx":417 * @cython.wraparound(False) * @cython.cdivision(True) * def zpoints(np.ndarray[np.float64_t, ndim=3] image, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] zbuffer, * np.ndarray[np.int64_t, ndim=1] xs, */ - __pyx_tuple__58 = PyTuple_Pack(21, __pyx_n_s_image, __pyx_n_s_zbuffer, __pyx_n_s_xs, __pyx_n_s_ys, __pyx_n_s_zs, __pyx_n_s_colors, __pyx_n_s_points_per_color, __pyx_n_s_thick, __pyx_n_s_flip, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nl, __pyx_n_s_alpha, __pyx_n_s_talpha, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_c, __pyx_n_s_x0, __pyx_n_s_y0, __pyx_n_s_yi0, __pyx_n_s_z0); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(9, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_zpoints, 412, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_tuple__66 = PyTuple_Pack(28, __pyx_n_s_image, __pyx_n_s_zbuffer, __pyx_n_s_xs, __pyx_n_s_ys, __pyx_n_s_zs, __pyx_n_s_colors, __pyx_n_s_radii, __pyx_n_s_points_per_color, __pyx_n_s_thick, __pyx_n_s_flip, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nl, __pyx_n_s_alpha, __pyx_n_s_talpha, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_c, __pyx_n_s_kx, __pyx_n_s_ky, __pyx_n_s_r, __pyx_n_s_r2, __pyx_n_s_idx, __pyx_n_s_ks, __pyx_n_s_x0, __pyx_n_s_y0, __pyx_n_s_yi0, __pyx_n_s_z0); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(10, 0, 28, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_zpoints, 417, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 417, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":462 + /* "yt/utilities/lib/misc_utilities.pyx":479 * * * def rotate_vectors(np.ndarray[np.float64_t, ndim=3] vecs, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] R): * cdef int nx = vecs.shape[0] */ - __pyx_tuple__60 = PyTuple_Pack(8, __pyx_n_s_vecs, __pyx_n_s_R, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_rotated, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__60); - __Pyx_GIVEREF(__pyx_tuple__60); - __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_rotate_vectors, 462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_tuple__68 = PyTuple_Pack(8, __pyx_n_s_vecs, __pyx_n_s_R, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_rotated, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_rotate_vectors, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 479, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":477 + /* "yt/utilities/lib/misc_utilities.pyx":494 * @cython.wraparound(False) * @cython.cdivision(True) * def get_color_bounds(np.ndarray[np.float64_t, ndim=1] px, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] py, * np.ndarray[np.float64_t, ndim=1] pdx, */ - __pyx_tuple__62 = PyTuple_Pack(16, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pdx, __pyx_n_s_pdy, __pyx_n_s_value, __pyx_n_s_leftx, __pyx_n_s_rightx, __pyx_n_s_lefty, __pyx_n_s_righty, __pyx_n_s_mindx, __pyx_n_s_maxdx, __pyx_n_s_i, __pyx_n_s_mi, __pyx_n_s_ma, __pyx_n_s_v, __pyx_n_s_np); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__62); - __Pyx_GIVEREF(__pyx_tuple__62); - __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(11, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_get_color_bounds, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_tuple__70 = PyTuple_Pack(16, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pdx, __pyx_n_s_pdy, __pyx_n_s_value, __pyx_n_s_leftx, __pyx_n_s_rightx, __pyx_n_s_lefty, __pyx_n_s_righty, __pyx_n_s_mindx, __pyx_n_s_maxdx, __pyx_n_s_i, __pyx_n_s_mi, __pyx_n_s_ma, __pyx_n_s_v, __pyx_n_s_np); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(11, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_get_color_bounds, 494, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 494, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":505 + /* "yt/utilities/lib/misc_utilities.pyx":522 * @cython.wraparound(False) * @cython.cdivision(True) * def kdtree_get_choices(np.ndarray[np.float64_t, ndim=3] data, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] l_corner, * np.ndarray[np.float64_t, ndim=1] r_corner): */ - __pyx_tuple__64 = PyTuple_Pack(19, __pyx_n_s_data, __pyx_n_s_l_corner, __pyx_n_s_r_corner, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_dim, __pyx_n_s_n_unique, __pyx_n_s_best_dim, __pyx_n_s_n_grids, __pyx_n_s_my_split, __pyx_n_s_uniquedims, __pyx_n_s_uniques, __pyx_n_s_split, __pyx_n_s_my_max, __pyx_n_s_skipit, __pyx_n_s_tarr, __pyx_n_s_less_ids, __pyx_n_s_greater_ids); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__64); - __Pyx_GIVEREF(__pyx_tuple__64); - __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_kdtree_get_choices, 505, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_tuple__72 = PyTuple_Pack(19, __pyx_n_s_data, __pyx_n_s_l_corner, __pyx_n_s_r_corner, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_dim, __pyx_n_s_n_unique, __pyx_n_s_best_dim, __pyx_n_s_n_grids, __pyx_n_s_my_split, __pyx_n_s_uniquedims, __pyx_n_s_uniques, __pyx_n_s_split, __pyx_n_s_my_max, __pyx_n_s_skipit, __pyx_n_s_tarr, __pyx_n_s_less_ids, __pyx_n_s_greater_ids); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_kdtree_get_choices, 522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 522, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":571 + /* "yt/utilities/lib/misc_utilities.pyx":588 * @cython.wraparound(False) * @cython.cdivision(True) * def get_box_grids_level(np.ndarray[np.float64_t, ndim=1] left_edge, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] right_edge, * int level, */ - __pyx_tuple__66 = PyTuple_Pack(13, __pyx_n_s_left_edge, __pyx_n_s_right_edge, __pyx_n_s_level, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_levels, __pyx_n_s_mask, __pyx_n_s_min_index, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_nx, __pyx_n_s_inside, __pyx_n_s_eps); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__66); - __Pyx_GIVEREF(__pyx_tuple__66); - __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(8, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_get_box_grids_level, 571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_tuple__74 = PyTuple_Pack(13, __pyx_n_s_left_edge, __pyx_n_s_right_edge, __pyx_n_s_level, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_levels, __pyx_n_s_mask, __pyx_n_s_min_index, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_nx, __pyx_n_s_inside, __pyx_n_s_eps); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(8, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_get_box_grids_level, 588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 588, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":599 + /* "yt/utilities/lib/misc_utilities.pyx":616 * @cython.wraparound(False) * @cython.cdivision(True) * def get_box_grids_below_level( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] left_edge, * np.ndarray[np.float64_t, ndim=1] right_edge, */ - __pyx_tuple__68 = PyTuple_Pack(13, __pyx_n_s_left_edge, __pyx_n_s_right_edge, __pyx_n_s_level, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_levels, __pyx_n_s_mask, __pyx_n_s_min_level, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_nx, __pyx_n_s_inside, __pyx_n_s_eps); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); - __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(8, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_get_box_grids_below_level, 599, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_tuple__76 = PyTuple_Pack(13, __pyx_n_s_left_edge, __pyx_n_s_right_edge, __pyx_n_s_level, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_levels, __pyx_n_s_mask, __pyx_n_s_min_level, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_nx, __pyx_n_s_inside, __pyx_n_s_eps); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(8, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_get_box_grids_below_level, 616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 616, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":626 + /* "yt/utilities/lib/misc_utilities.pyx":643 * @cython.wraparound(False) * @cython.cdivision(True) * def find_values_at_point(np.ndarray[np.float64_t, ndim=1] point, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] left_edges, * np.ndarray[np.float64_t, ndim=2] right_edges, */ - __pyx_tuple__70 = PyTuple_Pack(14, __pyx_n_s_point, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_dimensions, __pyx_n_s_field_names, __pyx_n_s_grid_objects, __pyx_n_s_ind, __pyx_n_s_gi, __pyx_n_s_fi, __pyx_n_s_nf, __pyx_n_s_dds, __pyx_n_s_field, __pyx_n_s_rv, __pyx_n_s_grid); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__70); - __Pyx_GIVEREF(__pyx_tuple__70); - __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(6, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_find_values_at_point, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_tuple__78 = PyTuple_Pack(14, __pyx_n_s_point, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_dimensions, __pyx_n_s_field_names, __pyx_n_s_grid_objects, __pyx_n_s_ind, __pyx_n_s_gi, __pyx_n_s_fi, __pyx_n_s_nf, __pyx_n_s_dds, __pyx_n_s_field, __pyx_n_s_rv, __pyx_n_s_grid); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(6, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_find_values_at_point, 643, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 643, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":661 + /* "yt/utilities/lib/misc_utilities.pyx":678 * #@cython.boundscheck(False) * #@cython.wraparound(False) * def obtain_rvec(data): # <<<<<<<<<<<<<< * # This is just to let the pointers exist and whatnot. We can't cdef them * # inside conditionals. */ - __pyx_tuple__72 = PyTuple_Pack(15, __pyx_n_s_data, __pyx_n_s_xf, __pyx_n_s_yf, __pyx_n_s_zf, __pyx_n_s_rf, __pyx_n_s_xg, __pyx_n_s_yg, __pyx_n_s_zg, __pyx_n_s_rg, __pyx_n_s_c, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_center, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__72); - __Pyx_GIVEREF(__pyx_tuple__72); - __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_obtain_rvec, 661, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_tuple__80 = PyTuple_Pack(15, __pyx_n_s_data, __pyx_n_s_xf, __pyx_n_s_yf, __pyx_n_s_zf, __pyx_n_s_rf, __pyx_n_s_xg, __pyx_n_s_yg, __pyx_n_s_zg, __pyx_n_s_rg, __pyx_n_s_c, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_center, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_obtain_rvec, 678, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 678, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":706 + /* "yt/utilities/lib/misc_utilities.pyx":723 * @cython.wraparound(False) * @cython.cdivision(True) * def obtain_rv_vec(data, field_names = ("velocity_x", # <<<<<<<<<<<<<< * "velocity_y", * "velocity_z"), */ - __pyx_tuple__74 = PyTuple_Pack(16, __pyx_n_s_data, __pyx_n_s_field_names, __pyx_n_s_bulk_vector, __pyx_n_s_vxf, __pyx_n_s_vyf, __pyx_n_s_vzf, __pyx_n_s_rvf, __pyx_n_s_vxg, __pyx_n_s_vyg, __pyx_n_s_vzg, __pyx_n_s_rvg, __pyx_n_s_bv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__74); - __Pyx_GIVEREF(__pyx_tuple__74); - __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_obtain_rv_vec, 706, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_tuple__82 = PyTuple_Pack(16, __pyx_n_s_data, __pyx_n_s_field_names, __pyx_n_s_bulk_vector, __pyx_n_s_vxf, __pyx_n_s_vyf, __pyx_n_s_vzf, __pyx_n_s_rvf, __pyx_n_s_vxg, __pyx_n_s_vyg, __pyx_n_s_vzg, __pyx_n_s_rvg, __pyx_n_s_bv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 723, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_obtain_rv_vec, 723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 723, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":767 + /* "yt/utilities/lib/misc_utilities.pyx":785 * return rvg * * def grow_flagging_field(oofield): # <<<<<<<<<<<<<< * cdef np.ndarray[np.uint8_t, ndim=3] ofield = oofield.astype("uint8") * cdef np.ndarray[np.uint8_t, ndim=3] nfield */ - __pyx_tuple__76 = PyTuple_Pack(12, __pyx_n_s_oofield, __pyx_n_s_ofield, __pyx_n_s_nfield, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_ni, __pyx_n_s_nj, __pyx_n_s_nk, __pyx_n_s_oi, __pyx_n_s_oj, __pyx_n_s_ok); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__76); - __Pyx_GIVEREF(__pyx_tuple__76); - __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_grow_flagging_field, 767, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_tuple__84 = PyTuple_Pack(12, __pyx_n_s_oofield, __pyx_n_s_ofield, __pyx_n_s_nfield, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_ni, __pyx_n_s_nj, __pyx_n_s_nk, __pyx_n_s_oi, __pyx_n_s_oj, __pyx_n_s_ok); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_grow_flagging_field, 785, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 785, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":792 + /* "yt/utilities/lib/misc_utilities.pyx":810 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_region(input_fields, output_fields, # <<<<<<<<<<<<<< * np.int32_t output_level, * np.ndarray[np.int64_t, ndim=1] left_index, */ - __pyx_tuple__78 = PyTuple_Pack(26, __pyx_n_s_input_fields, __pyx_n_s_output_fields, __pyx_n_s_output_level, __pyx_n_s_left_index, __pyx_n_s_ipos, __pyx_n_s_ires, __pyx_n_s_level_dims, __pyx_n_s_refine_by, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_tot, __pyx_n_s_oi, __pyx_n_s_oj, __pyx_n_s_ok, __pyx_n_s_rf, __pyx_n_s_iind, __pyx_n_s_oind, __pyx_n_s_dim, __pyx_n_s_ofield, __pyx_n_s_ifield, __pyx_n_s_nf, __pyx_n_s_wi, __pyx_n_s_wj, __pyx_n_s_wk, __pyx_n_s_offsets, __pyx_n_s_off); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 792, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__78); - __Pyx_GIVEREF(__pyx_tuple__78); - __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(8, 0, 26, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_fill_region, 792, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 792, __pyx_L1_error) + __pyx_tuple__86 = PyTuple_Pack(27, __pyx_n_s_input_fields, __pyx_n_s_output_fields, __pyx_n_s_output_level, __pyx_n_s_left_index, __pyx_n_s_ipos, __pyx_n_s_ires, __pyx_n_s_level_dims, __pyx_n_s_refine_by, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_tot, __pyx_n_s_oi, __pyx_n_s_oj, __pyx_n_s_ok, __pyx_n_s_rf, __pyx_n_s_iind, __pyx_n_s_oind, __pyx_n_s_dim, __pyx_n_s_ofield, __pyx_n_s_ifield, __pyx_n_s_nf, __pyx_n_s_wi, __pyx_n_s_wj, __pyx_n_s_wk, __pyx_n_s_offsets, __pyx_n_s_off, __pyx_n_s_k); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(8, 0, 27, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_fill_region, 810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 810, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":872 + /* "yt/utilities/lib/misc_utilities.pyx":892 * @cython.boundscheck(False) * @cython.wraparound(False) * def fill_region_float(np.ndarray[np.float64_t, ndim=2] fcoords, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] fwidth, * np.ndarray[np.float64_t, ndim=1] data, */ - __pyx_tuple__80 = PyTuple_Pack(34, __pyx_n_s_fcoords, __pyx_n_s_fwidth, __pyx_n_s_data, __pyx_n_s_box_left_edge, __pyx_n_s_box_right_edge, __pyx_n_s_dest, __pyx_n_s_antialias, __pyx_n_s_period, __pyx_n_s_check_period, __pyx_n_s_ds_period, __pyx_n_s_box_dds, __pyx_n_s_box_idds, __pyx_n_s_width, __pyx_n_s_LE, __pyx_n_s_RE, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_p, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_dims, __pyx_n_s_ld, __pyx_n_s_ud, __pyx_n_s_overlap, __pyx_n_s_dsp, __pyx_n_s_osp, __pyx_n_s_odsp, __pyx_n_s_sp, __pyx_n_s_lfd, __pyx_n_s_ufd, __pyx_n_s_diter, __pyx_n_s_diterv, __pyx_n_s_zi); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__80); - __Pyx_GIVEREF(__pyx_tuple__80); - __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(9, 0, 34, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_fill_region_float, 872, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 872, __pyx_L1_error) + __pyx_tuple__88 = PyTuple_Pack(34, __pyx_n_s_fcoords, __pyx_n_s_fwidth, __pyx_n_s_data, __pyx_n_s_box_left_edge, __pyx_n_s_box_right_edge, __pyx_n_s_dest, __pyx_n_s_antialias, __pyx_n_s_period, __pyx_n_s_check_period, __pyx_n_s_ds_period, __pyx_n_s_box_dds, __pyx_n_s_box_idds, __pyx_n_s_width, __pyx_n_s_LE, __pyx_n_s_RE, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_p, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_dims, __pyx_n_s_ld, __pyx_n_s_ud, __pyx_n_s_overlap, __pyx_n_s_dsp, __pyx_n_s_osp, __pyx_n_s_odsp, __pyx_n_s_sp, __pyx_n_s_lfd, __pyx_n_s_ufd, __pyx_n_s_diter, __pyx_n_s_diterv, __pyx_n_s_zi); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(9, 0, 34, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_fill_region_float, 892, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 892, __pyx_L1_error) - /* "yt/utilities/lib/misc_utilities.pyx":989 + /* "yt/utilities/lib/misc_utilities.pyx":1009 * @cython.boundscheck(False) * @cython.wraparound(False) * def gravitational_binding_energy( # <<<<<<<<<<<<<< * np.float64_t[:] mass, * np.float64_t[:] x, */ - __pyx_tuple__82 = PyTuple_Pack(21, __pyx_n_s_mass, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_truncate, __pyx_n_s_kinetic, __pyx_n_s_q_outer, __pyx_n_s_q_inner, __pyx_n_s_n_q, __pyx_n_s_i, __pyx_n_s_mass_o, __pyx_n_s_x_o, __pyx_n_s_y_o, __pyx_n_s_z_o, __pyx_n_s_mass_i, __pyx_n_s_x_i, __pyx_n_s_y_i, __pyx_n_s_z_i, __pyx_n_s_this_potential, __pyx_n_s_total_potential, __pyx_n_s_pbar); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__82); - __Pyx_GIVEREF(__pyx_tuple__82); - __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(6, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_gravitational_binding_energy, 989, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 989, __pyx_L1_error) + __pyx_tuple__90 = PyTuple_Pack(21, __pyx_n_s_mass, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_truncate, __pyx_n_s_kinetic, __pyx_n_s_q_outer, __pyx_n_s_q_inner, __pyx_n_s_n_q, __pyx_n_s_i, __pyx_n_s_mass_o, __pyx_n_s_x_o, __pyx_n_s_y_o, __pyx_n_s_z_o, __pyx_n_s_mass_i, __pyx_n_s_x_i, __pyx_n_s_y_i, __pyx_n_s_z_i, __pyx_n_s_this_potential, __pyx_n_s_total_potential, __pyx_n_s_pbar); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(6, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_misc_utilities, __pyx_n_s_gravitational_binding_energy, 1009, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 1009, __pyx_L1_error) /* "View.MemoryView":282 * return self.name @@ -37765,9 +39978,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(3, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__84); - __Pyx_GIVEREF(__pyx_tuple__84); + __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); /* "View.MemoryView":283 * @@ -37776,9 +39989,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(3, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__85); - __Pyx_GIVEREF(__pyx_tuple__85); + __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(1, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -37787,9 +40000,9 @@ * * */ - __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(3, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__86); - __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(1, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); /* "View.MemoryView":287 * @@ -37798,9 +40011,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(3, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__87); - __Pyx_GIVEREF(__pyx_tuple__87); + __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); /* "View.MemoryView":288 * @@ -37809,9 +40022,19 @@ * * */ - __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(3, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__88); - __Pyx_GIVEREF(__pyx_tuple__88); + __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__97 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -37825,6 +40048,7 @@ __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_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __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:; @@ -37890,6 +40114,7 @@ __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 @@ -37923,18 +40148,21 @@ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14misc_utilities_OnceIndirect) < 0) __PYX_ERR(0, 1035, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_14misc_utilities_OnceIndirect) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_type_2yt_9utilities_3lib_14misc_utilities_OnceIndirect.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "OnceIndirect", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14misc_utilities_OnceIndirect) < 0) __PYX_ERR(0, 1035, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "OnceIndirect", (PyObject *)&__pyx_type_2yt_9utilities_3lib_14misc_utilities_OnceIndirect) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_14misc_utilities_OnceIndirect) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_14misc_utilities_OnceIndirect = &__pyx_type_2yt_9utilities_3lib_14misc_utilities_OnceIndirect; __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(3, 103, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(3, 103, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(3, 275, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __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; @@ -37944,18 +40172,20 @@ __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(3, 326, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(3, 326, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(3, 951, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -37967,11 +40197,11 @@ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(4, 9, __pyx_L1_error) __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) __PYX_ERR(5, 8, __pyx_L1_error) __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) __PYX_ERR(6, 15, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(2, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = __Pyx_ImportType("yt.geometry.oct_visitors", "OctVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(7, 33, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(7, 33, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = __Pyx_ImportType("yt.geometry.oct_visitors", "CountTotalOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts)) __PYX_ERR(7, 59, __pyx_L1_error) @@ -38010,12 +40240,14 @@ __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(7, 114, __pyx_L1_error) __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType("yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(7, 117, __pyx_L1_error) __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(7, 117, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 33, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(2, 33, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 71, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(2, 71, __pyx_L1_error) - __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 74, __pyx_L1_error) - __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(2, 74, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(3, 29, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(3, 29, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(3, 67, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(3, 67, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(3, 70, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(3, 70, __pyx_L1_error) + __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType("yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(3, 74, __pyx_L1_error) + __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(3, 74, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("yt.geometry.grid_visitors"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) @@ -38087,249 +40319,249 @@ * np.ndarray[np.float64_t, ndim=1] wsource, * np.ndarray[np.float64_t, ndim=2] bsource, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_1new_bin_profile1d, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_1new_bin_profile1d, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_new_bin_profile1d, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":72 + /* "yt/utilities/lib/misc_utilities.pyx":73 * @cython.wraparound(False) * @cython.cdivision(True) * def new_bin_profile2d(np.ndarray[np.intp_t, ndim=1] bins_x, # <<<<<<<<<<<<<< * np.ndarray[np.intp_t, ndim=1] bins_y, * np.ndarray[np.float64_t, ndim=1] wsource, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_3new_bin_profile2d, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_3new_bin_profile2d, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_new_bin_profile2d, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_new_bin_profile2d, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":105 + /* "yt/utilities/lib/misc_utilities.pyx":107 * @cython.wraparound(False) * @cython.cdivision(True) * def new_bin_profile3d(np.ndarray[np.intp_t, ndim=1] bins_x, # <<<<<<<<<<<<<< * np.ndarray[np.intp_t, ndim=1] bins_y, * np.ndarray[np.intp_t, ndim=1] bins_z, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_5new_bin_profile3d, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_5new_bin_profile3d, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_new_bin_profile3d, __pyx_t_2) < 0) __PYX_ERR(0, 105, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_new_bin_profile3d, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":143 + /* "yt/utilities/lib/misc_utilities.pyx":145 * @cython.wraparound(False) * @cython.cdivision(True) * def bin_profile1d(np.ndarray[np.int64_t, ndim=1] bins_x, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] wsource, * np.ndarray[np.float64_t, ndim=1] bsource, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_7bin_profile1d, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_7bin_profile1d, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_bin_profile1d, __pyx_t_2) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_bin_profile1d, __pyx_t_2) < 0) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":168 + /* "yt/utilities/lib/misc_utilities.pyx":171 * @cython.wraparound(False) * @cython.cdivision(True) * def bin_profile2d(np.ndarray[np.int64_t, ndim=1] bins_x, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] bins_y, * np.ndarray[np.float64_t, ndim=1] wsource, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_9bin_profile2d, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_9bin_profile2d, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_bin_profile2d, __pyx_t_2) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_bin_profile2d, __pyx_t_2) < 0) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":195 + /* "yt/utilities/lib/misc_utilities.pyx":199 * @cython.wraparound(False) * @cython.cdivision(True) * def bin_profile3d(np.ndarray[np.int64_t, ndim=1] bins_x, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] bins_y, * np.ndarray[np.int64_t, ndim=1] bins_z, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_11bin_profile3d, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_11bin_profile3d, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_bin_profile3d, __pyx_t_2) < 0) __PYX_ERR(0, 195, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_bin_profile3d, __pyx_t_2) < 0) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":224 + /* "yt/utilities/lib/misc_utilities.pyx":229 * @cython.wraparound(False) * @cython.cdivision(True) * def lines(np.float64_t[:,:,:] image, # <<<<<<<<<<<<<< * np.int64_t[:] xs, * np.int64_t[:] ys, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_13lines, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_13lines, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_lines, __pyx_t_2) < 0) __PYX_ERR(0, 224, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lines, __pyx_t_2) < 0) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":317 + /* "yt/utilities/lib/misc_utilities.pyx":322 * @cython.wraparound(False) * @cython.cdivision(True) * def zlines(np.ndarray[np.float64_t, ndim=3] image, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] zbuffer, * np.ndarray[np.int64_t, ndim=1] xs, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_15zlines, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_15zlines, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); 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_zlines, __pyx_t_2) < 0) __PYX_ERR(0, 317, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_zlines, __pyx_t_2) < 0) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":412 + /* "yt/utilities/lib/misc_utilities.pyx":417 * @cython.wraparound(False) * @cython.cdivision(True) * def zpoints(np.ndarray[np.float64_t, ndim=3] image, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] zbuffer, * np.ndarray[np.int64_t, ndim=1] xs, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_17zpoints, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_17zpoints, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_zpoints, __pyx_t_2) < 0) __PYX_ERR(0, 412, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_zpoints, __pyx_t_2) < 0) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":462 + /* "yt/utilities/lib/misc_utilities.pyx":479 * * * def rotate_vectors(np.ndarray[np.float64_t, ndim=3] vecs, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] R): * cdef int nx = vecs.shape[0] */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_19rotate_vectors, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_19rotate_vectors, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotate_vectors, __pyx_t_2) < 0) __PYX_ERR(0, 462, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotate_vectors, __pyx_t_2) < 0) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":477 + /* "yt/utilities/lib/misc_utilities.pyx":494 * @cython.wraparound(False) * @cython.cdivision(True) * def get_color_bounds(np.ndarray[np.float64_t, ndim=1] px, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] py, * np.ndarray[np.float64_t, ndim=1] pdx, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_21get_color_bounds, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_21get_color_bounds, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_color_bounds, __pyx_t_2) < 0) __PYX_ERR(0, 477, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_color_bounds, __pyx_t_2) < 0) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":505 + /* "yt/utilities/lib/misc_utilities.pyx":522 * @cython.wraparound(False) * @cython.cdivision(True) * def kdtree_get_choices(np.ndarray[np.float64_t, ndim=3] data, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] l_corner, * np.ndarray[np.float64_t, ndim=1] r_corner): */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_23kdtree_get_choices, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_23kdtree_get_choices, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_kdtree_get_choices, __pyx_t_2) < 0) __PYX_ERR(0, 505, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_kdtree_get_choices, __pyx_t_2) < 0) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":571 + /* "yt/utilities/lib/misc_utilities.pyx":588 * @cython.wraparound(False) * @cython.cdivision(True) * def get_box_grids_level(np.ndarray[np.float64_t, ndim=1] left_edge, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] right_edge, * int level, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_25get_box_grids_level, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_25get_box_grids_level, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_box_grids_level, __pyx_t_2) < 0) __PYX_ERR(0, 571, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_box_grids_level, __pyx_t_2) < 0) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":599 + /* "yt/utilities/lib/misc_utilities.pyx":616 * @cython.wraparound(False) * @cython.cdivision(True) * def get_box_grids_below_level( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] left_edge, * np.ndarray[np.float64_t, ndim=1] right_edge, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_27get_box_grids_below_level, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_27get_box_grids_below_level, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_box_grids_below_level, __pyx_t_2) < 0) __PYX_ERR(0, 599, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_box_grids_below_level, __pyx_t_2) < 0) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":626 + /* "yt/utilities/lib/misc_utilities.pyx":643 * @cython.wraparound(False) * @cython.cdivision(True) * def find_values_at_point(np.ndarray[np.float64_t, ndim=1] point, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] left_edges, * np.ndarray[np.float64_t, ndim=2] right_edges, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_29find_values_at_point, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_29find_values_at_point, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_values_at_point, __pyx_t_2) < 0) __PYX_ERR(0, 626, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_values_at_point, __pyx_t_2) < 0) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":661 + /* "yt/utilities/lib/misc_utilities.pyx":678 * #@cython.boundscheck(False) * #@cython.wraparound(False) * def obtain_rvec(data): # <<<<<<<<<<<<<< * # This is just to let the pointers exist and whatnot. We can't cdef them * # inside conditionals. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_31obtain_rvec, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_31obtain_rvec, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_obtain_rvec, __pyx_t_2) < 0) __PYX_ERR(0, 661, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_obtain_rvec, __pyx_t_2) < 0) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":706 + /* "yt/utilities/lib/misc_utilities.pyx":723 * @cython.wraparound(False) * @cython.cdivision(True) * def obtain_rv_vec(data, field_names = ("velocity_x", # <<<<<<<<<<<<<< * "velocity_y", * "velocity_z"), */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_33obtain_rv_vec, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_33obtain_rv_vec, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_obtain_rv_vec, __pyx_t_2) < 0) __PYX_ERR(0, 706, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_obtain_rv_vec, __pyx_t_2) < 0) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":767 + /* "yt/utilities/lib/misc_utilities.pyx":785 * return rvg * * def grow_flagging_field(oofield): # <<<<<<<<<<<<<< * cdef np.ndarray[np.uint8_t, ndim=3] ofield = oofield.astype("uint8") * cdef np.ndarray[np.uint8_t, ndim=3] nfield */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_35grow_flagging_field, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_35grow_flagging_field, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_grow_flagging_field, __pyx_t_2) < 0) __PYX_ERR(0, 767, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_grow_flagging_field, __pyx_t_2) < 0) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":792 + /* "yt/utilities/lib/misc_utilities.pyx":810 * @cython.wraparound(False) * @cython.cdivision(True) * def fill_region(input_fields, output_fields, # <<<<<<<<<<<<<< * np.int32_t output_level, * np.ndarray[np.int64_t, ndim=1] left_index, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_37fill_region, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 792, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_37fill_region, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_fill_region, __pyx_t_2) < 0) __PYX_ERR(0, 792, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fill_region, __pyx_t_2) < 0) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":872 + /* "yt/utilities/lib/misc_utilities.pyx":892 * @cython.boundscheck(False) * @cython.wraparound(False) * def fill_region_float(np.ndarray[np.float64_t, ndim=2] fcoords, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] fwidth, * np.ndarray[np.float64_t, ndim=1] data, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_39fill_region_float, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_39fill_region_float, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_fill_region_float, __pyx_t_2) < 0) __PYX_ERR(0, 872, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fill_region_float, __pyx_t_2) < 0) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/misc_utilities.pyx":989 + /* "yt/utilities/lib/misc_utilities.pyx":1009 * @cython.boundscheck(False) * @cython.wraparound(False) * def gravitational_binding_energy( # <<<<<<<<<<<<<< * np.float64_t[:] mass, * np.float64_t[:] x, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_41gravitational_binding_energy, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_14misc_utilities_41gravitational_binding_energy, NULL, __pyx_n_s_yt_utilities_lib_misc_utilities_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_gravitational_binding_energy, __pyx_t_2) < 0) __PYX_ERR(0, 989, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_gravitational_binding_energy, __pyx_t_2) < 0) __PYX_ERR(0, 1009, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "yt/utilities/lib/misc_utilities.pyx":1 @@ -38349,9 +40581,9 @@ * * 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(3, 207, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(3, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_array_type); @@ -38362,7 +40594,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 282, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_2); @@ -38376,7 +40608,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 283, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_2); @@ -38390,7 +40622,7 @@ * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 284, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_2); @@ -38404,7 +40636,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 287, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_2); @@ -38418,7 +40650,7 @@ * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); @@ -38458,9 +40690,9 @@ * * */ - __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 535, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(3, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_memoryview_type); @@ -38471,18 +40703,28 @@ * * */ - __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 981, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(3, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import 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(1, 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(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -38494,7 +40736,7 @@ __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.misc_utilities", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.misc_utilities", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -39457,42 +41699,28 @@ } #endif -/* BufferIndexError */ - static void __Pyx_RaiseBufferIndexError(int axis) { - PyErr_Format(PyExc_IndexError, - "Out of bounds on buffer access (axis %d)", axis); -} - -/* 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(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - /* 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -39611,8 +41839,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON @@ -39652,11 +41880,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -39678,8 +41902,27 @@ } #endif +/* BufferIndexError */ + static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +/* 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(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -39700,7 +41943,7 @@ #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -39863,7 +42106,7 @@ #endif /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -39874,9 +42117,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -39889,9 +42135,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -39944,13 +42193,44 @@ } /* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { + static void __Pyx_RaiseBufferFallbackError(void) { PyErr_SetString(PyExc_ValueError, "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); } +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* 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; + } +} + /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { @@ -40066,7 +42346,7 @@ #endif /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { if (op1 == op2) { Py_RETURN_TRUE; @@ -40151,7 +42431,7 @@ #endif /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { @@ -40267,25 +42547,25 @@ #endif /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -40309,7 +42589,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -40319,7 +42599,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -40380,7 +42660,7 @@ } /* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -40398,7 +42678,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -40418,7 +42707,7 @@ } /* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -40458,6 +42747,21 @@ 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; @@ -40502,28 +42806,15 @@ } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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_COMPILING_IN_CPYTHON -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); -} - /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -40555,8 +42846,23 @@ } } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -40581,7 +42887,7 @@ #endif /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -40655,7 +42961,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -40771,12 +43077,12 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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)); @@ -40784,7 +43090,7 @@ } /* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + 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; @@ -40825,8 +43131,87 @@ #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; +} + +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -40844,7 +43229,7 @@ } /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -40863,22 +43248,42 @@ return NULL; } -/* 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 +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); } - return value; + 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; + } + return c_line; +#endif } /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -40958,7 +43363,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -41017,12 +43422,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -41062,8 +43470,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -41086,7 +43494,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -41122,7 +43530,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -41135,7 +43543,7 @@ } /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -41176,7 +43584,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -41358,7 +43766,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -41381,7 +43789,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -41404,7 +43812,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -41427,7 +43835,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -41449,7 +43857,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -41472,7 +43880,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -41503,7 +43911,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -41534,7 +43942,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + 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) { @@ -41564,33 +43972,20 @@ } } -/* None */ - static CYTHON_INLINE long __Pyx_pow_long(long b, long e) { - long t = b; - switch (e) { - case 3: - t *= b; - case 2: - t *= b; - case 1: - return t; - case 0: - return 1; - } - #if 1 - if (unlikely(e<0)) return 0; - #endif - t = 1; - while (likely(e)) { - t *= (b * (e&1)) | ((~e)&1); - b *= b; - e >>= 1; - } - return t; +/* 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) { + 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) { @@ -41621,7 +44016,7 @@ } /* None */ - static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_pow___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t b, __pyx_t_5numpy_int64_t e) { + static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_pow___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t b, __pyx_t_5numpy_int64_t e) { __pyx_t_5numpy_int64_t t = b; switch (e) { case 3: @@ -41646,7 +44041,7 @@ } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); } static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { @@ -41658,7 +44053,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -41678,7 +44073,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -41813,7 +44208,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -41833,7 +44228,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -41968,7 +44363,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -41999,7 +44394,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -42066,7 +44461,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -42255,7 +44650,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -42444,7 +44839,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -42633,7 +45028,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -42822,7 +45217,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + 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 @@ -43011,7 +45406,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -43027,7 +45422,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -43045,7 +45440,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -43110,7 +45505,7 @@ #endif /* FunctionImport */ - #ifndef __PYX_HAVE_RT_ImportFunction + #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; @@ -43164,7 +45559,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -43189,6 +45584,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -43197,11 +45594,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/misc_utilities.pyx yt-3.4.0/yt/utilities/lib/misc_utilities.pyx --- yt-3.3.3/yt/utilities/lib/misc_utilities.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/misc_utilities.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -47,7 +47,7 @@ np.ndarray[np.float64_t, ndim=2] qresult, np.ndarray[np.uint8_t, ndim=1, cast=True] used): cdef int n, fi, bin - cdef np.float64_t wval, bval, oldwr + cdef np.float64_t wval, bval, oldwr, bval_mresult cdef int nb = bins_x.shape[0] cdef int nf = bsource.shape[1] for n in range(nb): @@ -57,12 +57,13 @@ wresult[bin] += wval for fi in range(nf): bval = bsource[n,fi] + bval_mresult = bval - mresult[bin,fi] # qresult has to have the previous wresult - qresult[bin,fi] += (oldwr * wval * (bval - mresult[bin,fi])**2) / \ + qresult[bin,fi] += oldwr * wval * bval_mresult * bval_mresult / \ (oldwr + wval) bresult[bin,fi] += wval*bval # mresult needs the new wresult - mresult[bin,fi] += wval * (bval - mresult[bin,fi]) / wresult[bin] + mresult[bin,fi] += wval * bval_mresult / wresult[bin] used[bin] = 1 return @@ -79,7 +80,7 @@ np.ndarray[np.float64_t, ndim=3] qresult, np.ndarray[np.uint8_t, ndim=2, cast=True] used): cdef int n, fi, bin_x, bin_y - cdef np.float64_t wval, bval, oldwr + cdef np.float64_t wval, bval, oldwr, bval_mresult cdef int nb = bins_x.shape[0] cdef int nf = bsource.shape[1] for n in range(nb): @@ -90,12 +91,13 @@ wresult[bin_x,bin_y] += wval for fi in range(nf): bval = bsource[n,fi] + bval_mresult = bval - mresult[bin_x,bin_y,fi] # qresult has to have the previous wresult - qresult[bin_x,bin_y,fi] += (oldwr * wval * (bval - mresult[bin_x,bin_y,fi])**2) / \ + qresult[bin_x,bin_y,fi] += oldwr * wval * bval_mresult * bval_mresult / \ (oldwr + wval) bresult[bin_x,bin_y,fi] += wval*bval # mresult needs the new wresult - mresult[bin_x,bin_y,fi] += wval * (bval - mresult[bin_x,bin_y,fi]) / wresult[bin_x,bin_y] + mresult[bin_x,bin_y,fi] += wval * bval_mresult / wresult[bin_x,bin_y] used[bin_x,bin_y] = 1 return @@ -113,7 +115,7 @@ np.ndarray[np.float64_t, ndim=4] qresult, np.ndarray[np.uint8_t, ndim=3, cast=True] used): cdef int n, fi, bin_x, bin_y, bin_z - cdef np.float64_t wval, bval, oldwr + cdef np.float64_t wval, bval, oldwr, bval_mresult cdef int nb = bins_x.shape[0] cdef int nf = bsource.shape[1] for n in range(nb): @@ -125,14 +127,14 @@ wresult[bin_x,bin_y,bin_z] += wval for fi in range(nf): bval = bsource[n,fi] + bval_mresult = bval - mresult[bin_x,bin_y,bin_z,fi] # qresult has to have the previous wresult qresult[bin_x,bin_y,bin_z,fi] += \ - (oldwr * wval * (bval - mresult[bin_x,bin_y,bin_z,fi])**2) / \ + oldwr * wval * bval_mresult * bval_mresult / \ (oldwr + wval) bresult[bin_x,bin_y,bin_z,fi] += wval*bval # mresult needs the new wresult - mresult[bin_x,bin_y,bin_z,fi] += wval * \ - (bval - mresult[bin_x,bin_y,bin_z,fi]) / \ + mresult[bin_x,bin_y,bin_z,fi] += wval * bval_mresult / \ wresult[bin_x,bin_y,bin_z] used[bin_x,bin_y,bin_z] = 1 return @@ -149,16 +151,17 @@ np.ndarray[np.float64_t, ndim=1] qresult, np.ndarray[np.float64_t, ndim=1] used): cdef int n, bin - cdef np.float64_t wval, bval + cdef np.float64_t wval, bval, bval_mresult for n in range(bins_x.shape[0]): bin = bins_x[n] bval = bsource[n] wval = wsource[n] - qresult[bin] += (wresult[bin] * wval * (bval - mresult[bin])**2) / \ + bval_mresult = bval - mresult[bin] + qresult[bin] += wresult[bin] * wval * bval_mresult * bval_mresult / \ (wresult[bin] + wval) wresult[bin] += wval bresult[bin] += wval*bval - mresult[bin] += wval * (bval - mresult[bin]) / wresult[bin] + mresult[bin] += wval * bval_mresult / wresult[bin] used[bin] = 1 return @@ -175,17 +178,18 @@ np.ndarray[np.float64_t, ndim=2] qresult, np.ndarray[np.float64_t, ndim=2] used): cdef int n, bini, binj - cdef np.float64_t wval, bval + cdef np.float64_t wval, bval, bval_mresult for n in range(bins_x.shape[0]): bini = bins_x[n] binj = bins_y[n] bval = bsource[n] wval = wsource[n] - qresult[bini, binj] += (wresult[bini, binj] * wval * (bval - mresult[bini, binj])**2) / \ + bval_mresult = bval - mresult[bini, binj] + qresult[bini, binj] += wresult[bini, binj] * wval * bval_mresult * bval_mresult / \ (wresult[bini, binj] + wval) wresult[bini, binj] += wval bresult[bini, binj] += wval*bval - mresult[bini, binj] += wval * (bval - mresult[bini, binj]) / wresult[bini, binj] + mresult[bini, binj] += wval * bval_mresult / wresult[bini, binj] used[bini, binj] = 1 return @@ -203,18 +207,19 @@ np.ndarray[np.float64_t, ndim=3] qresult, np.ndarray[np.float64_t, ndim=3] used): cdef int n, bini, binj, bink - cdef np.float64_t wval, bval + cdef np.float64_t wval, bval, bval_mresult for n in range(bins_x.shape[0]): bini = bins_x[n] binj = bins_y[n] bink = bins_z[n] bval = bsource[n] wval = wsource[n] - qresult[bini, binj, bink] += (wresult[bini, binj, bink] * wval * (bval - mresult[bini, binj, bink])**2) / \ + bval_mresult = bval - mresult[bini, binj, bink] + qresult[bini, binj, bink] += wresult[bini, binj, bink] * wval * bval_mresult * bval_mresult / \ (wresult[bini, binj, bink] + wval) wresult[bini, binj, bink] += wval bresult[bini, binj, bink] += wval*bval - mresult[bini, binj, bink] += wval * (bval - mresult[bini, binj, bink]) / wresult[bini, binj, bink] + mresult[bini, binj, bink] += wval * bval_mresult / wresult[bini, binj, bink] used[bini, binj, bink] = 1 return @@ -344,8 +349,8 @@ z1 = zs[j+1] dx = abs(x1-x0) dy = abs(y1-y0) - dzx = (z1-z0) / (dx**2 + dy**2) * dx - dzy = (z1-z0) / (dx**2 + dy**2) * dy + dzx = (z1-z0) / (dx * dx + dy * dy) * dx + dzy = (z1-z0) / (dx * dx + dy * dy) * dy err = dx - dy if crop == 1 and (dx > nx/2.0 or dy > ny/2.0): continue @@ -415,6 +420,7 @@ np.ndarray[np.int64_t, ndim=1] ys, np.ndarray[np.float64_t, ndim=1] zs, np.ndarray[np.float64_t, ndim=2] colors, + np.ndarray[np.int64_t, ndim=1] radii, #pixels int points_per_color=1, int thick=1, int flip=0): @@ -425,37 +431,48 @@ cdef np.float64_t[:] alpha cdef np.float64_t talpha cdef int i, j, c + cdef np.int64_t kx, ky, r, r2 + cdef np.int64_t[:] idx, ks cdef np.int64_t x0, y0, yi0 cdef np.float64_t z0 alpha = np.zeros(4) - for j in range(0, nl): - x0 = xs[j] - y0 = ys[j] + #the sources must be ordered along z to avoid edges when two overlap + idx = np.argsort(zs) + for j in idx: + r = radii[j] + r2 = int((r+0.3)*(r+0.3)) #0.3 to get nicer shape + ks = np.arange(-r, r+1, dtype=np.int64) z0 = zs[j] - if (x0 < 0 or x0 >= nx): continue - if (y0 < 0 or y0 >= ny): continue - c = j/points_per_color - for i in range(3): - alpha[i] = colors[c, i] * colors[c, 3] - alpha[3] = colors[c, 3] - if flip: - yi0 = ny - y0 - else: - yi0 = y0 + for kx in ks: + x0 = xs[j]+kx + if (x0 < 0 or x0 >= nx): continue + for ky in ks: + y0 = ys[j]+ky + if (y0 < 0 or y0 >= ny): continue + if (kx*kx + ky*ky > r2): continue - if z0 < zbuffer[x0, yi0]: - if alpha[3] != 1.0: - talpha = image[x0, yi0, 3] - image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) + c = j/points_per_color for i in range(3): - image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] - if image[x0, yi0, 3] == 0.0: - image[x0, yi0, i] = 0.0 - else: - for i in range(4): - image[x0, yi0, i] = alpha[i] - if (1.0 - image[x0, yi0, 3] < 1.0e-4): - zbuffer[x0, yi0] = z0 + alpha[i] = colors[c, i] * colors[c, 3] + alpha[3] = colors[c, 3] + if flip: + yi0 = ny - y0 + else: + yi0 = y0 + + if z0 < zbuffer[x0, yi0]: + if alpha[3] != 1.0: + talpha = image[x0, yi0, 3] + image[x0, yi0, 3] = alpha[3] + talpha * (1 - alpha[3]) + for i in range(3): + image[x0, yi0, i] = (alpha[3]*alpha[i] + image[x0, yi0, i]*talpha*(1.0-alpha[3]))/image[x0,yi0,3] + if image[x0, yi0, 3] == 0.0: + image[x0, yi0, i] = 0.0 + else: + for i in range(4): + image[x0, yi0, i] = alpha[i] + if (1.0 - image[x0, yi0, 3] < 1.0e-4): + zbuffer[x0, yi0] = z0 return @@ -752,7 +769,8 @@ if bulk_vector is None: bv[0] = bv[1] = bv[2] = 0.0 else: - bulk_vector = bulk_vector.in_units(vxg.units) + if hasattr(bulk_vector, 'in_units'): + bulk_vector = bulk_vector.in_units(vxg.units) bv[0] = bulk_vector[0] bv[1] = bulk_vector[1] bv[2] = bulk_vector[2] @@ -795,10 +813,11 @@ np.ndarray[np.int64_t, ndim=2] ipos, np.ndarray[np.int64_t, ndim=1] ires, np.ndarray[np.int64_t, ndim=1] level_dims, - np.int64_t refine_by = 2 + np.ndarray[np.int64_t, ndim=1] refine_by ): cdef int i, n - cdef np.int64_t tot = 0, oi, oj, ok, rf + cdef np.int64_t tot = 0, oi, oj, ok + cdef np.int64_t rf[3] cdef np.int64_t iind[3] cdef np.int64_t oind[3] cdef np.int64_t dim[3] @@ -826,15 +845,16 @@ ofield = output_fields[n] ifield = input_fields[n] for i in range(ipos.shape[0]): - rf = refine_by**(output_level - ires[i]) + for k in range(3): + rf[k] = refine_by[k]**(output_level - ires[i]) for wi in range(3): if offsets[0][wi] == 0: continue off = (left_index[0] + level_dims[0]*(wi-1)) - iind[0] = ipos[i, 0] * rf - off + iind[0] = ipos[i, 0] * rf[0] - off # rf here is the "refinement factor", or, the number of zones # that this zone could potentially contribute to our filled # grid. - for oi in range(rf): + for oi in range(rf[0]): # Now we need to apply our offset oind[0] = oi + iind[0] if oind[0] < 0: @@ -844,8 +864,8 @@ for wj in range(3): if offsets[1][wj] == 0: continue off = (left_index[1] + level_dims[1]*(wj-1)) - iind[1] = ipos[i, 1] * rf - off - for oj in range(rf): + iind[1] = ipos[i, 1] * rf[1] - off + for oj in range(rf[1]): oind[1] = oj + iind[1] if oind[1] < 0: continue @@ -854,8 +874,8 @@ for wk in range(3): if offsets[2][wk] == 0: continue off = (left_index[2] + level_dims[2]*(wk-1)) - iind[2] = ipos[i, 2] * rf - off - for ok in range(rf): + iind[2] = ipos[i, 2] * rf[2] - off + for ok in range(rf[2]): oind[2] = ok + iind[2] if oind[2] < 0: continue @@ -1003,7 +1023,7 @@ i = 0 n_q = mass.size pbar = get_pbar("Calculating potential for %d cells" % n_q, - 0.5 * (n_q**2 - n_q)) + 0.5 * (n_q * n_q - n_q)) for q_outer in range(n_q - 1): this_potential = 0. mass_o = mass[q_outer] diff -Nru yt-3.3.3/yt/utilities/lib/origami.c yt-3.4.0/yt/utilities/lib/origami.c --- yt-3.3.3/yt/utilities/lib/origami.c 2016-12-12 01:41:57.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/origami.c 2017-08-10 18:20:51.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -7,7 +7,13 @@ "yt/utilities/lib/origami_tags.h" ], "include_dirs": [ + "yt/utilities/lib", "yt/utilities/lib/" + ], + "name": "yt.utilities.lib.origami", + "sources": [ + "yt/utilities/lib/origami.pyx", + "yt/utilities/lib/origami_tags.c" ] }, "module_name": "yt.utilities.lib.origami" @@ -21,7 +27,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -43,6 +49,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -195,16 +202,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -331,6 +342,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -385,6 +402,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -493,8 +539,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -507,8 +553,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -630,10 +679,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1045,7 +1096,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS @@ -1192,6 +1243,9 @@ /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1454,9 +1508,10 @@ static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_run_origami[] = "run_origami"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_yt_utilities_lib_origami[] = "yt.utilities.lib.origami"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/origami.pyx"; +static const char __pyx_k_yt_utilities_lib_origami_pyx[] = "yt/utilities/lib/origami.pyx"; static const char __pyx_k_This_calls_the_ORIGAMI_routines[] = "\nThis calls the ORIGAMI routines\n\n\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)"; @@ -1474,9 +1529,9 @@ static PyObject *__pyx_kp_s_ORIGAMI_was_developed_by_Bridget; static PyObject *__pyx_kp_s_Please_cite_Falck_Neyrinck_Szala; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_boxsize; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_end; static PyObject *__pyx_n_s_file; @@ -1505,6 +1560,7 @@ static PyObject *__pyx_n_s_uint8; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; static PyObject *__pyx_n_s_yt_utilities_lib_origami; +static PyObject *__pyx_kp_s_yt_utilities_lib_origami_pyx; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_2yt_9utilities_3lib_7origami_run_origami(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_pos_x, PyArrayObject *__pyx_v_pos_y, PyArrayObject *__pyx_v_pos_z, double __pyx_v_boxsize); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ @@ -1550,9 +1606,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -1561,16 +1621,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("run_origami", 1, 4, 4, 1); __PYX_ERR(0, 26, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_z)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("run_origami", 1, 4, 4, 2); __PYX_ERR(0, 26, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_boxsize)) != 0)) kw_args--; else { @@ -4219,7 +4282,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -4267,7 +4330,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -4350,7 +4413,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -4398,7 +4461,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -4481,7 +4544,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -4526,7 +4589,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -4582,9 +4645,9 @@ {&__pyx_kp_s_ORIGAMI_was_developed_by_Bridget, __pyx_k_ORIGAMI_was_developed_by_Bridget, sizeof(__pyx_k_ORIGAMI_was_developed_by_Bridget), 0, 0, 1, 0}, {&__pyx_kp_s_Please_cite_Falck_Neyrinck_Szala, __pyx_k_Please_cite_Falck_Neyrinck_Szala, sizeof(__pyx_k_Please_cite_Falck_Neyrinck_Szala), 0, 0, 1, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_boxsize, __pyx_k_boxsize, sizeof(__pyx_k_boxsize), 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_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, @@ -4613,6 +4676,7 @@ {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 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_yt_utilities_lib_origami, __pyx_k_yt_utilities_lib_origami, sizeof(__pyx_k_yt_utilities_lib_origami), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_origami_pyx, __pyx_k_yt_utilities_lib_origami_pyx, sizeof(__pyx_k_yt_utilities_lib_origami_pyx), 0, 0, 1, 0}, {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; @@ -4748,7 +4812,7 @@ __pyx_tuple__11 = PyTuple_Pack(9, __pyx_n_s_pos_x, __pyx_n_s_pos_y, __pyx_n_s_pos_z, __pyx_n_s_boxsize, __pyx_n_s_npart, __pyx_n_s_ng, __pyx_n_s_r, __pyx_n_s_tags, __pyx_n_s_m); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_run_origami, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_origami_pyx, __pyx_n_s_run_origami, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -4820,6 +4884,7 @@ __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 @@ -4926,7 +4991,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.origami", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.origami", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -5736,17 +5801,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -5865,8 +5935,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON @@ -5906,11 +5976,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -5933,7 +5999,7 @@ #endif /* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -5946,7 +6012,7 @@ } /* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE + #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; @@ -5970,7 +6036,7 @@ #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -6133,25 +6199,25 @@ #endif /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -6175,7 +6241,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -6185,7 +6251,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -6246,7 +6312,7 @@ } /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -6319,8 +6385,42 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -6400,7 +6500,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -6459,12 +6559,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -6501,8 +6604,8 @@ #endif - /* Print */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + /* Print */ + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); if (!f) { @@ -6608,7 +6711,7 @@ #endif /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -6630,7 +6733,7 @@ } /* None */ - static CYTHON_INLINE long __Pyx_pow_long(long b, long e) { + static CYTHON_INLINE long __Pyx_pow_long(long b, long e) { long t = b; switch (e) { case 3: @@ -6655,7 +6758,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -6686,7 +6789,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -6706,7 +6809,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -6841,7 +6944,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -6861,7 +6964,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -6996,7 +7099,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -7027,7 +7130,7 @@ } /* PrintOne */ - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static int __Pyx_PrintOne(PyObject* f, PyObject *o) { if (!f) { if (!(f = __Pyx_GetStdout())) @@ -7064,7 +7167,7 @@ #endif /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -7253,7 +7356,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -7284,7 +7387,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -7473,7 +7576,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -7489,7 +7592,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -7507,7 +7610,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -7572,7 +7675,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -7597,6 +7700,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -7605,11 +7710,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/particle_mesh_operations.c yt-3.4.0/yt/utilities/lib/particle_mesh_operations.c --- yt-3.3.3/yt/utilities/lib/particle_mesh_operations.c 2016-12-12 01:41:57.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/particle_mesh_operations.c 2017-08-10 18:20:53.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,6 +6,10 @@ "depends": [], "libraries": [ "m" + ], + "name": "yt.utilities.lib.particle_mesh_operations", + "sources": [ + "yt/utilities/lib/particle_mesh_operations.pyx" ] }, "module_name": "yt.utilities.lib.particle_mesh_operations" @@ -19,7 +23,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -41,6 +45,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -193,16 +198,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -329,6 +338,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -383,6 +398,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -446,6 +490,8 @@ #include #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" +#include "pythread.h" +#include "pystate.h" #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -490,8 +536,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -504,8 +550,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -627,10 +676,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -665,6 +716,7 @@ static const char *__pyx_f[] = { "yt/utilities/lib/particle_mesh_operations.pyx", "__init__.pxd", + "stringsource", "type.pxd", }; /* BufferFormatStructs.proto */ @@ -703,6 +755,65 @@ char is_valid_array; } __Pyx_BufFmt_Context; +/* 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; + +/* 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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 * # in Cython to enable them only on the right systems. @@ -918,6 +1029,10 @@ /*--- Type declarations ---*/ +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_longdouble longdouble_t @@ -955,6 +1070,131 @@ */ typedef npy_cdouble __pyx_t_5numpy_complex_t; +/* "View.MemoryView":103 + * + * @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":275 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":326 + * + * @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":951 + * + * @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":103 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_array { + PyObject *(*get_memview)(struct __pyx_array_obj *); +}; +static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; + + +/* "View.MemoryView":326 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * 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":951 + * + * @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 @@ -1061,7 +1301,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2) @@ -1089,7 +1329,32 @@ #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif -#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) +/* 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); + /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); @@ -1140,6 +1405,7 @@ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif +#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); @@ -1200,6 +1466,184 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #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 + +/* 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 *); + +/* 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); + +/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +/* 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 + +/* 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); + +/* 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() + +/* 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 *); + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1219,6 +1663,15 @@ 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; @@ -1233,19 +1686,42 @@ __Pyx_Buf_DimInfo diminfo[8]; } __Pyx_LocalBuf_ND; -#if PY_MAJOR_VERSION < 3 - static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); - static void __Pyx_ReleaseBuffer(Py_buffer *view); -#else - #define __Pyx_GetBuffer PyObject_GetBuffer - #define __Pyx_ReleaseBuffer PyBuffer_Release -#endif - - /* None.proto */ static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, + char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* TypeInfoCompare.proto */ +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +/* MemviewSliceValidateAndInit.proto */ +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + 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_float64_t(PyObject *); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *); + /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); @@ -1356,6 +1832,13 @@ /* 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 *); @@ -1365,6 +1848,9 @@ /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); @@ -1386,6 +1872,16 @@ /* 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 'cpython.buffer' */ @@ -1416,17 +1912,63 @@ static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ +/* Module declarations from 'cython.view' */ + /* Module declarations from 'cython' */ /* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int, int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ /* Module declarations from 'yt.utilities.lib.particle_mesh_operations' */ +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 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_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 }; @@ -1438,6 +1980,14 @@ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_IndexError; +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"; @@ -1445,10 +1995,13 @@ static const char __pyx_k_dy[] = "dy"; static const char __pyx_k_dz[] = "dz"; static const char __pyx_k_i1[] = "i1"; +static const char __pyx_k_id[] = "id"; static const char __pyx_k_j1[] = "j1"; static const char __pyx_k_k1[] = "k1"; static const char __pyx_k_np[] = "np"; static const char __pyx_k_arr[] = "arr"; +static const char __pyx_k_ddx[] = "ddx"; +static const char __pyx_k_ddy[] = "ddy"; static const char __pyx_k_dx2[] = "dx2"; static const char __pyx_k_dy2[] = "dy2"; static const char __pyx_k_dz2[] = "dz2"; @@ -1457,97 +2010,209 @@ static const char __pyx_k_le1[] = "le1"; static const char __pyx_k_le2[] = "le2"; static const char __pyx_k_max[] = "max"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_sum[] = "sum"; +static const char __pyx_k_base[] = "base"; +static const char __pyx_k_ddx2[] = "ddx2"; +static const char __pyx_k_ddy2[] = "ddy2"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_dims[] = "dims"; static const char __pyx_k_fact[] = "fact"; static const char __pyx_k_grid[] = "grid"; static const char __pyx_k_idds[] = "idds"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mass[] = "mass"; +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_ones[] = "ones"; +static const char __pyx_k_pack[] = "pack"; static const char __pyx_k_posx[] = "posx"; static const char __pyx_k_posy[] = "posy"; static const char __pyx_k_posz[] = "posz"; +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_xpos[] = "xpos"; static const char __pyx_k_ypos[] = "ypos"; static const char __pyx_k_zpos[] = "zpos"; +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_edge0[] = "edge0"; static const char __pyx_k_edge1[] = "edge1"; static const char __pyx_k_edge2[] = "edge2"; +static const char __pyx_k_edgex[] = "edgex"; +static const char __pyx_k_edgey[] = "edgey"; +static const char __pyx_k_error[] = "error"; static const char __pyx_k_field[] = "field"; +static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_grids[] = "grids"; static const char __pyx_k_int32[] = "int32"; static const char __pyx_k_level[] = "level"; static const char __pyx_k_npart[] = "npart"; +static const char __pyx_k_numpy[] = "numpy"; static const char __pyx_k_pos_x[] = "pos_x"; static const char __pyx_k_pos_y[] = "pos_y"; static const char __pyx_k_pos_z[] = "pos_z"; 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_assign[] = "assign"; +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_levels[] = "levels"; +static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_ncells[] = "ncells"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_result[] = "result"; static const char __pyx_k_sample[] = "sample"; +static const char __pyx_k_struct[] = "struct"; static const char __pyx_k_unique[] = "unique"; +static const char __pyx_k_unpack[] = "unpack"; +static const char __pyx_k_update[] = "update"; static const char __pyx_k_float64[] = "float64"; +static const char __pyx_k_fortran[] = "fortran"; +static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_assigned[] = "assigned"; static const char __pyx_k_cellSize[] = "cellSize"; +static const char __pyx_k_itemsize[] = "itemsize"; static const char __pyx_k_leftEdge[] = "leftEdge"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_left_edge[] = "left_edge"; static const char __pyx_k_level_max[] = "level_max"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_index_list[] = "index_list"; static const char __pyx_k_left_edges[] = "left_edges"; static const char __pyx_k_npositions[] = "npositions"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_right_edge[] = "right_edge"; static const char __pyx_k_CICSample_3[] = "CICSample_3"; 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_index_lists[] = "index_lists"; static const char __pyx_k_right_edges[] = "right_edges"; +static const char __pyx_k_x_bin_edges[] = "x_bin_edges"; +static const char __pyx_k_x_endpoints[] = "x_endpoints"; +static const char __pyx_k_y_bin_edges[] = "y_bin_edges"; +static const char __pyx_k_y_endpoints[] = "y_endpoints"; static const char __pyx_k_CICDeposit_2[] = "CICDeposit_2"; static const char __pyx_k_CICDeposit_3[] = "CICDeposit_3"; static const char __pyx_k_NGPDeposit_2[] = "NGPDeposit_2"; 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_gridDimension[] = "gridDimension"; +static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_never_assigned[] = "never_assigned"; +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_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_child_index_mask[] = "child_index_mask"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +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_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_assign_particles_to_cells[] = "assign_particles_to_cells"; static const char __pyx_k_sample_field_at_positions[] = "sample_field_at_positions"; +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_recursive_particle_assignment[] = "recursive_particle_assignment"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/particle_mesh_operations.pyx"; +static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static const char __pyx_k_assign_particles_to_cell_lists[] = "assign_particles_to_cell_lists"; +static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_Simple_integrators_for_the_radi[] = "\nSimple integrators for the radiative transfer equation\n\n\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_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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_yt_utilities_lib_particle_mesh_o[] = "yt.utilities.lib.particle_mesh_operations"; +static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static const char __pyx_k_yt_utilities_lib_particle_mesh_o[] = "yt/utilities/lib/particle_mesh_operations.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_utilities_lib_particle_mesh_o_2[] = "yt.utilities.lib.particle_mesh_operations"; +static PyObject *__pyx_n_s_ASCII; +static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; static PyObject *__pyx_n_s_CICDeposit_2; static PyObject *__pyx_n_s_CICDeposit_3; static PyObject *__pyx_n_s_CICSample_3; +static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; +static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_n_s_Ellipsis; +static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; static PyObject *__pyx_n_s_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_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_NGPDeposit_2; 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_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; +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_allocate_buffer; static PyObject *__pyx_n_s_arr; static PyObject *__pyx_n_s_assign; static PyObject *__pyx_n_s_assign_particles_to_cell_lists; static PyObject *__pyx_n_s_assign_particles_to_cells; static PyObject *__pyx_n_s_assigned; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; static PyObject *__pyx_n_s_cellSize; static PyObject *__pyx_n_s_child_index_mask; +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_ddx; +static PyObject *__pyx_n_s_ddx2; +static PyObject *__pyx_n_s_ddy; +static PyObject *__pyx_n_s_ddy2; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dims; static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; static PyObject *__pyx_n_s_dx; static PyObject *__pyx_n_s_dx2; static PyObject *__pyx_n_s_dy; @@ -1557,19 +2222,33 @@ static PyObject *__pyx_n_s_edge0; static PyObject *__pyx_n_s_edge1; static PyObject *__pyx_n_s_edge2; +static PyObject *__pyx_n_s_edgex; +static PyObject *__pyx_n_s_edgey; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_fact; static PyObject *__pyx_n_s_field; +static PyObject *__pyx_n_s_flags; static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; static PyObject *__pyx_n_s_grid; static PyObject *__pyx_n_s_gridDimension; static PyObject *__pyx_n_s_grids; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_i1; +static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_idds; +static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_ind; static PyObject *__pyx_n_s_index_list; static PyObject *__pyx_n_s_index_lists; static PyObject *__pyx_n_s_int32; +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_j1; static PyObject *__pyx_n_s_k1; @@ -1585,41 +2264,80 @@ static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_mass; static PyObject *__pyx_n_s_max; +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_n_s_ncells; 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_never_assigned; +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_npart; static PyObject *__pyx_n_s_npositions; +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_ones; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_pos_x; static PyObject *__pyx_n_s_pos_y; static PyObject *__pyx_n_s_pos_z; static PyObject *__pyx_n_s_posx; static PyObject *__pyx_n_s_posy; static PyObject *__pyx_n_s_posz; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_getbuffer; +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_recursive_particle_assignment; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_right_edge; static PyObject *__pyx_n_s_right_edges; static PyObject *__pyx_n_s_sample; static PyObject *__pyx_n_s_sample_field_at_positions; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_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_sum; static PyObject *__pyx_n_s_test; +static PyObject *__pyx_kp_s_unable_to_allocate_array_data; +static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; static PyObject *__pyx_n_s_unique; 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_x_bin_edges; +static PyObject *__pyx_n_s_x_endpoints; static PyObject *__pyx_n_s_xpos; +static PyObject *__pyx_n_s_y_bin_edges; +static PyObject *__pyx_n_s_y_endpoints; static PyObject *__pyx_n_s_ypos; -static PyObject *__pyx_n_s_yt_utilities_lib_particle_mesh_o; +static PyObject *__pyx_kp_s_yt_utilities_lib_particle_mesh_o; +static PyObject *__pyx_n_s_yt_utilities_lib_particle_mesh_o_2; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_n_s_zpos; static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_CICDeposit_3(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_posx, PyArrayObject *__pyx_v_posy, PyArrayObject *__pyx_v_posz, PyArrayObject *__pyx_v_mass, __pyx_t_5numpy_int64_t __pyx_v_npositions, PyArrayObject *__pyx_v_field, PyArrayObject *__pyx_v_leftEdge, PyArrayObject *__pyx_v_gridDimension, __pyx_t_5numpy_float64_t __pyx_v_cellSize); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_2CICDeposit_2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_posx, PyArrayObject *__pyx_v_posy, PyArrayObject *__pyx_v_mass, __pyx_t_5numpy_int64_t __pyx_v_npositions, PyArrayObject *__pyx_v_field, PyArrayObject *__pyx_v_leftEdge, PyArrayObject *__pyx_v_gridDimension, PyArrayObject *__pyx_v_cellSize); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_4NGPDeposit_2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_posx, PyArrayObject *__pyx_v_posy, PyArrayObject *__pyx_v_mass, __pyx_t_5numpy_int64_t __pyx_v_npositions, PyArrayObject *__pyx_v_field, PyArrayObject *__pyx_v_leftEdge, PyArrayObject *__pyx_v_gridDimension, PyArrayObject *__pyx_v_cellSize); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_2CICDeposit_2(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_posx, __Pyx_memviewslice __pyx_v_posy, __Pyx_memviewslice __pyx_v_mass, __pyx_t_5numpy_int64_t __pyx_v_npositions, __Pyx_memviewslice __pyx_v_field, __Pyx_memviewslice __pyx_v_x_bin_edges, __Pyx_memviewslice __pyx_v_y_bin_edges); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_4NGPDeposit_2(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_posx, __Pyx_memviewslice __pyx_v_posy, __Pyx_memviewslice __pyx_v_mass, __pyx_t_5numpy_int64_t __pyx_v_npositions, __Pyx_memviewslice __pyx_v_field, __Pyx_memviewslice __pyx_v_x_bin_edges, __Pyx_memviewslice __pyx_v_y_bin_edges); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_6sample_field_at_positions(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_right_edge, PyArrayObject *__pyx_v_pos_x, PyArrayObject *__pyx_v_pos_y, PyArrayObject *__pyx_v_pos_z); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_8CICSample_3(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_posx, PyArrayObject *__pyx_v_posy, PyArrayObject *__pyx_v_posz, PyArrayObject *__pyx_v_sample, __pyx_t_5numpy_int64_t __pyx_v_npositions, PyArrayObject *__pyx_v_field, PyArrayObject *__pyx_v_leftEdge, PyArrayObject *__pyx_v_gridDimension, __pyx_t_5numpy_float64_t __pyx_v_cellSize); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_10assign_particles_to_cells(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_levels, PyArrayObject *__pyx_v_left_edges, PyArrayObject *__pyx_v_right_edges, PyArrayObject *__pyx_v_pos_x, PyArrayObject *__pyx_v_pos_y, PyArrayObject *__pyx_v_pos_z); /* proto */ @@ -1627,8 +2345,55 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_14recursive_particle_assignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_grids, PyObject *__pyx_v_grid, PyArrayObject *__pyx_v_left_edges, PyArrayObject *__pyx_v_right_edges, PyArrayObject *__pyx_v_pos_x, PyArrayObject *__pyx_v_pos_y, PyArrayObject *__pyx_v_pos_z); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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_184977713; +static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; @@ -1638,24 +2403,50 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__23; +static PyObject *__pyx_slice__24; +static PyObject *__pyx_slice__25; static PyObject *__pyx_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__24; -static PyObject *__pyx_codeobj__11; -static PyObject *__pyx_codeobj__13; -static PyObject *__pyx_codeobj__15; -static PyObject *__pyx_codeobj__17; -static PyObject *__pyx_codeobj__19; -static PyObject *__pyx_codeobj__21; -static PyObject *__pyx_codeobj__23; -static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__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__30; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__38; +static PyObject *__pyx_codeobj__40; +static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__44; +static PyObject *__pyx_codeobj__51; -/* "yt/utilities/lib/particle_mesh_operations.pyx":22 +/* "yt/utilities/lib/particle_mesh_operations.pyx":23 * @cython.boundscheck(False) * @cython.wraparound(False) * def CICDeposit_3(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< @@ -1687,14 +2478,23 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -1703,49 +2503,57 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_posx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_posy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 1); __PYX_ERR(0, 22, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 1); __PYX_ERR(0, 23, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_posz)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 2); __PYX_ERR(0, 22, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 2); __PYX_ERR(0, 23, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mass)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 3); __PYX_ERR(0, 22, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 3); __PYX_ERR(0, 23, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_npositions)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 4); __PYX_ERR(0, 22, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 4); __PYX_ERR(0, 23, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 5); __PYX_ERR(0, 22, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 5); __PYX_ERR(0, 23, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_leftEdge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 6); __PYX_ERR(0, 22, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 6); __PYX_ERR(0, 23, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gridDimension)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 7); __PYX_ERR(0, 22, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 7); __PYX_ERR(0, 23, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cellSize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 8); __PYX_ERR(0, 22, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, 8); __PYX_ERR(0, 23, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CICDeposit_3") < 0)) __PYX_ERR(0, 22, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CICDeposit_3") < 0)) __PYX_ERR(0, 23, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; @@ -1764,27 +2572,27 @@ __pyx_v_posy = ((PyArrayObject *)values[1]); __pyx_v_posz = ((PyArrayObject *)values[2]); __pyx_v_mass = ((PyArrayObject *)values[3]); - __pyx_v_npositions = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_npositions == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) + __pyx_v_npositions = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_npositions == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error) __pyx_v_field = ((PyArrayObject *)values[5]); __pyx_v_leftEdge = ((PyArrayObject *)values[6]); __pyx_v_gridDimension = ((PyArrayObject *)values[7]); - __pyx_v_cellSize = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_cellSize == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error) + __pyx_v_cellSize = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_cellSize == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 22, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_3", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 23, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.particle_mesh_operations.CICDeposit_3", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posx), __pyx_ptype_5numpy_ndarray, 1, "posx", 0))) __PYX_ERR(0, 22, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posy), __pyx_ptype_5numpy_ndarray, 1, "posy", 0))) __PYX_ERR(0, 23, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posz), __pyx_ptype_5numpy_ndarray, 1, "posz", 0))) __PYX_ERR(0, 24, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mass), __pyx_ptype_5numpy_ndarray, 1, "mass", 0))) __PYX_ERR(0, 25, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_5numpy_ndarray, 1, "field", 0))) __PYX_ERR(0, 27, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leftEdge), __pyx_ptype_5numpy_ndarray, 1, "leftEdge", 0))) __PYX_ERR(0, 28, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gridDimension), __pyx_ptype_5numpy_ndarray, 1, "gridDimension", 0))) __PYX_ERR(0, 29, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posx), __pyx_ptype_5numpy_ndarray, 1, "posx", 0))) __PYX_ERR(0, 23, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posy), __pyx_ptype_5numpy_ndarray, 1, "posy", 0))) __PYX_ERR(0, 24, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posz), __pyx_ptype_5numpy_ndarray, 1, "posz", 0))) __PYX_ERR(0, 25, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mass), __pyx_ptype_5numpy_ndarray, 1, "mass", 0))) __PYX_ERR(0, 26, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_5numpy_ndarray, 1, "field", 0))) __PYX_ERR(0, 28, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leftEdge), __pyx_ptype_5numpy_ndarray, 1, "leftEdge", 0))) __PYX_ERR(0, 29, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gridDimension), __pyx_ptype_5numpy_ndarray, 1, "gridDimension", 0))) __PYX_ERR(0, 30, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_CICDeposit_3(__pyx_self, __pyx_v_posx, __pyx_v_posy, __pyx_v_posz, __pyx_v_mass, __pyx_v_npositions, __pyx_v_field, __pyx_v_leftEdge, __pyx_v_gridDimension, __pyx_v_cellSize); /* function exit code */ @@ -1909,41 +2717,41 @@ __pyx_pybuffernd_gridDimension.rcbuffer = &__pyx_pybuffer_gridDimension; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posx.rcbuffer->pybuffer, (PyObject*)__pyx_v_posx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posx.rcbuffer->pybuffer, (PyObject*)__pyx_v_posx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 23, __pyx_L1_error) } __pyx_pybuffernd_posx.diminfo[0].strides = __pyx_pybuffernd_posx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_posx.diminfo[0].shape = __pyx_pybuffernd_posx.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posy.rcbuffer->pybuffer, (PyObject*)__pyx_v_posy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posy.rcbuffer->pybuffer, (PyObject*)__pyx_v_posy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 23, __pyx_L1_error) } __pyx_pybuffernd_posy.diminfo[0].strides = __pyx_pybuffernd_posy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_posy.diminfo[0].shape = __pyx_pybuffernd_posy.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posz.rcbuffer->pybuffer, (PyObject*)__pyx_v_posz, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posz.rcbuffer->pybuffer, (PyObject*)__pyx_v_posz, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 23, __pyx_L1_error) } __pyx_pybuffernd_posz.diminfo[0].strides = __pyx_pybuffernd_posz.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_posz.diminfo[0].shape = __pyx_pybuffernd_posz.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mass.rcbuffer->pybuffer, (PyObject*)__pyx_v_mass, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mass.rcbuffer->pybuffer, (PyObject*)__pyx_v_mass, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 23, __pyx_L1_error) } __pyx_pybuffernd_mass.diminfo[0].strides = __pyx_pybuffernd_mass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mass.diminfo[0].shape = __pyx_pybuffernd_mass.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 23, __pyx_L1_error) } __pyx_pybuffernd_field.diminfo[0].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field.diminfo[0].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_field.diminfo[1].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_field.diminfo[1].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_field.diminfo[2].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_field.diminfo[2].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_leftEdge.rcbuffer->pybuffer, (PyObject*)__pyx_v_leftEdge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_leftEdge.rcbuffer->pybuffer, (PyObject*)__pyx_v_leftEdge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 23, __pyx_L1_error) } __pyx_pybuffernd_leftEdge.diminfo[0].strides = __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_leftEdge.diminfo[0].shape = __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gridDimension.rcbuffer->pybuffer, (PyObject*)__pyx_v_gridDimension, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gridDimension.rcbuffer->pybuffer, (PyObject*)__pyx_v_gridDimension, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 23, __pyx_L1_error) } __pyx_pybuffernd_gridDimension.diminfo[0].strides = __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gridDimension.diminfo[0].shape = __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/particle_mesh_operations.pyx":38 + /* "yt/utilities/lib/particle_mesh_operations.pyx":39 * cdef np.float64_t dx, dy, dz, dx2, dy2, dz2 * * edge0 = ( gridDimension[0]) - 0.5001 # <<<<<<<<<<<<<< @@ -1953,7 +2761,7 @@ __pyx_t_1 = 0; __pyx_v_edge0 = (((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_gridDimension.diminfo[0].strides))) - 0.5001); - /* "yt/utilities/lib/particle_mesh_operations.pyx":39 + /* "yt/utilities/lib/particle_mesh_operations.pyx":40 * * edge0 = ( gridDimension[0]) - 0.5001 * edge1 = ( gridDimension[1]) - 0.5001 # <<<<<<<<<<<<<< @@ -1963,7 +2771,7 @@ __pyx_t_2 = 1; __pyx_v_edge1 = (((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_gridDimension.diminfo[0].strides))) - 0.5001); - /* "yt/utilities/lib/particle_mesh_operations.pyx":40 + /* "yt/utilities/lib/particle_mesh_operations.pyx":41 * edge0 = ( gridDimension[0]) - 0.5001 * edge1 = ( gridDimension[1]) - 0.5001 * edge2 = ( gridDimension[2]) - 0.5001 # <<<<<<<<<<<<<< @@ -1973,7 +2781,7 @@ __pyx_t_3 = 2; __pyx_v_edge2 = (((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_gridDimension.diminfo[0].strides))) - 0.5001); - /* "yt/utilities/lib/particle_mesh_operations.pyx":41 + /* "yt/utilities/lib/particle_mesh_operations.pyx":42 * edge1 = ( gridDimension[1]) - 0.5001 * edge2 = ( gridDimension[2]) - 0.5001 * fact = 1.0 / cellSize # <<<<<<<<<<<<<< @@ -1982,11 +2790,11 @@ */ if (unlikely(__pyx_v_cellSize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 41, __pyx_L1_error) + __PYX_ERR(0, 42, __pyx_L1_error) } __pyx_v_fact = (1.0 / __pyx_v_cellSize); - /* "yt/utilities/lib/particle_mesh_operations.pyx":43 + /* "yt/utilities/lib/particle_mesh_operations.pyx":44 * fact = 1.0 / cellSize * * le0 = leftEdge[0] # <<<<<<<<<<<<<< @@ -1996,7 +2804,7 @@ __pyx_t_4 = 0; __pyx_v_le0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_leftEdge.diminfo[0].strides)); - /* "yt/utilities/lib/particle_mesh_operations.pyx":44 + /* "yt/utilities/lib/particle_mesh_operations.pyx":45 * * le0 = leftEdge[0] * le1 = leftEdge[1] # <<<<<<<<<<<<<< @@ -2006,7 +2814,7 @@ __pyx_t_5 = 1; __pyx_v_le1 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_leftEdge.diminfo[0].strides)); - /* "yt/utilities/lib/particle_mesh_operations.pyx":45 + /* "yt/utilities/lib/particle_mesh_operations.pyx":46 * le0 = leftEdge[0] * le1 = leftEdge[1] * le2 = leftEdge[2] # <<<<<<<<<<<<<< @@ -2016,7 +2824,7 @@ __pyx_t_6 = 2; __pyx_v_le2 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_leftEdge.diminfo[0].strides)); - /* "yt/utilities/lib/particle_mesh_operations.pyx":47 + /* "yt/utilities/lib/particle_mesh_operations.pyx":48 * le2 = leftEdge[2] * * for n in range(npositions): # <<<<<<<<<<<<<< @@ -2027,7 +2835,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_n = __pyx_t_8; - /* "yt/utilities/lib/particle_mesh_operations.pyx":50 + /* "yt/utilities/lib/particle_mesh_operations.pyx":51 * * # Compute the position of the central cell * xpos = (posx[n] - le0)*fact # <<<<<<<<<<<<<< @@ -2037,7 +2845,7 @@ __pyx_t_9 = __pyx_v_n; __pyx_v_xpos = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_posx.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_posx.diminfo[0].strides)) - __pyx_v_le0) * __pyx_v_fact); - /* "yt/utilities/lib/particle_mesh_operations.pyx":51 + /* "yt/utilities/lib/particle_mesh_operations.pyx":52 * # Compute the position of the central cell * xpos = (posx[n] - le0)*fact * ypos = (posy[n] - le1)*fact # <<<<<<<<<<<<<< @@ -2047,7 +2855,7 @@ __pyx_t_10 = __pyx_v_n; __pyx_v_ypos = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_posy.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_posy.diminfo[0].strides)) - __pyx_v_le1) * __pyx_v_fact); - /* "yt/utilities/lib/particle_mesh_operations.pyx":52 + /* "yt/utilities/lib/particle_mesh_operations.pyx":53 * xpos = (posx[n] - le0)*fact * ypos = (posy[n] - le1)*fact * zpos = (posz[n] - le2)*fact # <<<<<<<<<<<<<< @@ -2057,7 +2865,7 @@ __pyx_t_11 = __pyx_v_n; __pyx_v_zpos = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_posz.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_posz.diminfo[0].strides)) - __pyx_v_le2) * __pyx_v_fact); - /* "yt/utilities/lib/particle_mesh_operations.pyx":54 + /* "yt/utilities/lib/particle_mesh_operations.pyx":55 * zpos = (posz[n] - le2)*fact * * if (xpos < 0.5001) or (xpos > edge0): # <<<<<<<<<<<<<< @@ -2075,7 +2883,7 @@ __pyx_L6_bool_binop_done:; if (__pyx_t_12) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":55 + /* "yt/utilities/lib/particle_mesh_operations.pyx":56 * * if (xpos < 0.5001) or (xpos > edge0): * continue # <<<<<<<<<<<<<< @@ -2084,7 +2892,7 @@ */ goto __pyx_L3_continue; - /* "yt/utilities/lib/particle_mesh_operations.pyx":54 + /* "yt/utilities/lib/particle_mesh_operations.pyx":55 * zpos = (posz[n] - le2)*fact * * if (xpos < 0.5001) or (xpos > edge0): # <<<<<<<<<<<<<< @@ -2093,7 +2901,7 @@ */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":56 + /* "yt/utilities/lib/particle_mesh_operations.pyx":57 * if (xpos < 0.5001) or (xpos > edge0): * continue * if (ypos < 0.5001) or (ypos > edge1): # <<<<<<<<<<<<<< @@ -2111,7 +2919,7 @@ __pyx_L9_bool_binop_done:; if (__pyx_t_12) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":57 + /* "yt/utilities/lib/particle_mesh_operations.pyx":58 * continue * if (ypos < 0.5001) or (ypos > edge1): * continue # <<<<<<<<<<<<<< @@ -2120,7 +2928,7 @@ */ goto __pyx_L3_continue; - /* "yt/utilities/lib/particle_mesh_operations.pyx":56 + /* "yt/utilities/lib/particle_mesh_operations.pyx":57 * if (xpos < 0.5001) or (xpos > edge0): * continue * if (ypos < 0.5001) or (ypos > edge1): # <<<<<<<<<<<<<< @@ -2129,7 +2937,7 @@ */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":58 + /* "yt/utilities/lib/particle_mesh_operations.pyx":59 * if (ypos < 0.5001) or (ypos > edge1): * continue * if (zpos < 0.5001) or (zpos > edge2): # <<<<<<<<<<<<<< @@ -2147,7 +2955,7 @@ __pyx_L12_bool_binop_done:; if (__pyx_t_12) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":59 + /* "yt/utilities/lib/particle_mesh_operations.pyx":60 * continue * if (zpos < 0.5001) or (zpos > edge2): * continue # <<<<<<<<<<<<<< @@ -2156,7 +2964,7 @@ */ goto __pyx_L3_continue; - /* "yt/utilities/lib/particle_mesh_operations.pyx":58 + /* "yt/utilities/lib/particle_mesh_operations.pyx":59 * if (ypos < 0.5001) or (ypos > edge1): * continue * if (zpos < 0.5001) or (zpos > edge2): # <<<<<<<<<<<<<< @@ -2165,7 +2973,7 @@ */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":61 + /* "yt/utilities/lib/particle_mesh_operations.pyx":62 * continue * * i1 = (xpos + 0.5) # <<<<<<<<<<<<<< @@ -2174,7 +2982,7 @@ */ __pyx_v_i1 = ((int)(__pyx_v_xpos + 0.5)); - /* "yt/utilities/lib/particle_mesh_operations.pyx":62 + /* "yt/utilities/lib/particle_mesh_operations.pyx":63 * * i1 = (xpos + 0.5) * j1 = (ypos + 0.5) # <<<<<<<<<<<<<< @@ -2183,7 +2991,7 @@ */ __pyx_v_j1 = ((int)(__pyx_v_ypos + 0.5)); - /* "yt/utilities/lib/particle_mesh_operations.pyx":63 + /* "yt/utilities/lib/particle_mesh_operations.pyx":64 * i1 = (xpos + 0.5) * j1 = (ypos + 0.5) * k1 = (zpos + 0.5) # <<<<<<<<<<<<<< @@ -2192,7 +3000,7 @@ */ __pyx_v_k1 = ((int)(__pyx_v_zpos + 0.5)); - /* "yt/utilities/lib/particle_mesh_operations.pyx":66 + /* "yt/utilities/lib/particle_mesh_operations.pyx":67 * * # Compute the weights * dx = ( i1) + 0.5 - xpos # <<<<<<<<<<<<<< @@ -2201,7 +3009,7 @@ */ __pyx_v_dx = ((((__pyx_t_5numpy_float64_t)__pyx_v_i1) + 0.5) - __pyx_v_xpos); - /* "yt/utilities/lib/particle_mesh_operations.pyx":67 + /* "yt/utilities/lib/particle_mesh_operations.pyx":68 * # Compute the weights * dx = ( i1) + 0.5 - xpos * dy = ( j1) + 0.5 - ypos # <<<<<<<<<<<<<< @@ -2210,7 +3018,7 @@ */ __pyx_v_dy = ((((__pyx_t_5numpy_float64_t)__pyx_v_j1) + 0.5) - __pyx_v_ypos); - /* "yt/utilities/lib/particle_mesh_operations.pyx":68 + /* "yt/utilities/lib/particle_mesh_operations.pyx":69 * dx = ( i1) + 0.5 - xpos * dy = ( j1) + 0.5 - ypos * dz = ( k1) + 0.5 - zpos # <<<<<<<<<<<<<< @@ -2219,7 +3027,7 @@ */ __pyx_v_dz = ((((__pyx_t_5numpy_float64_t)__pyx_v_k1) + 0.5) - __pyx_v_zpos); - /* "yt/utilities/lib/particle_mesh_operations.pyx":69 + /* "yt/utilities/lib/particle_mesh_operations.pyx":70 * dy = ( j1) + 0.5 - ypos * dz = ( k1) + 0.5 - zpos * dx2 = 1.0 - dx # <<<<<<<<<<<<<< @@ -2228,7 +3036,7 @@ */ __pyx_v_dx2 = (1.0 - __pyx_v_dx); - /* "yt/utilities/lib/particle_mesh_operations.pyx":70 + /* "yt/utilities/lib/particle_mesh_operations.pyx":71 * dz = ( k1) + 0.5 - zpos * dx2 = 1.0 - dx * dy2 = 1.0 - dy # <<<<<<<<<<<<<< @@ -2237,7 +3045,7 @@ */ __pyx_v_dy2 = (1.0 - __pyx_v_dy); - /* "yt/utilities/lib/particle_mesh_operations.pyx":71 + /* "yt/utilities/lib/particle_mesh_operations.pyx":72 * dx2 = 1.0 - dx * dy2 = 1.0 - dy * dz2 = 1.0 - dz # <<<<<<<<<<<<<< @@ -2246,7 +3054,7 @@ */ __pyx_v_dz2 = (1.0 - __pyx_v_dz); - /* "yt/utilities/lib/particle_mesh_operations.pyx":74 + /* "yt/utilities/lib/particle_mesh_operations.pyx":75 * * # Interpolate from field into sumfield * field[i1-1,j1-1,k1-1] += mass[n] * dx * dy * dz # <<<<<<<<<<<<<< @@ -2259,7 +3067,7 @@ __pyx_t_17 = (__pyx_v_k1 - 1); *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_field.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_field.diminfo[2].strides) += ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mass.diminfo[0].strides)) * __pyx_v_dx) * __pyx_v_dy) * __pyx_v_dz); - /* "yt/utilities/lib/particle_mesh_operations.pyx":75 + /* "yt/utilities/lib/particle_mesh_operations.pyx":76 * # Interpolate from field into sumfield * field[i1-1,j1-1,k1-1] += mass[n] * dx * dy * dz * field[i1 ,j1-1,k1-1] += mass[n] * dx2 * dy * dz # <<<<<<<<<<<<<< @@ -2272,7 +3080,7 @@ __pyx_t_21 = (__pyx_v_k1 - 1); *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_field.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_field.diminfo[2].strides) += ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_mass.diminfo[0].strides)) * __pyx_v_dx2) * __pyx_v_dy) * __pyx_v_dz); - /* "yt/utilities/lib/particle_mesh_operations.pyx":76 + /* "yt/utilities/lib/particle_mesh_operations.pyx":77 * field[i1-1,j1-1,k1-1] += mass[n] * dx * dy * dz * field[i1 ,j1-1,k1-1] += mass[n] * dx2 * dy * dz * field[i1-1,j1 ,k1-1] += mass[n] * dx * dy2 * dz # <<<<<<<<<<<<<< @@ -2285,7 +3093,7 @@ __pyx_t_25 = (__pyx_v_k1 - 1); *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_field.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_field.diminfo[2].strides) += ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_mass.diminfo[0].strides)) * __pyx_v_dx) * __pyx_v_dy2) * __pyx_v_dz); - /* "yt/utilities/lib/particle_mesh_operations.pyx":77 + /* "yt/utilities/lib/particle_mesh_operations.pyx":78 * field[i1 ,j1-1,k1-1] += mass[n] * dx2 * dy * dz * field[i1-1,j1 ,k1-1] += mass[n] * dx * dy2 * dz * field[i1 ,j1 ,k1-1] += mass[n] * dx2 * dy2 * dz # <<<<<<<<<<<<<< @@ -2298,7 +3106,7 @@ __pyx_t_29 = (__pyx_v_k1 - 1); *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_field.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_field.diminfo[2].strides) += ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_mass.diminfo[0].strides)) * __pyx_v_dx2) * __pyx_v_dy2) * __pyx_v_dz); - /* "yt/utilities/lib/particle_mesh_operations.pyx":78 + /* "yt/utilities/lib/particle_mesh_operations.pyx":79 * field[i1-1,j1 ,k1-1] += mass[n] * dx * dy2 * dz * field[i1 ,j1 ,k1-1] += mass[n] * dx2 * dy2 * dz * field[i1-1,j1-1,k1 ] += mass[n] * dx * dy * dz2 # <<<<<<<<<<<<<< @@ -2311,7 +3119,7 @@ __pyx_t_33 = __pyx_v_k1; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_field.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_field.diminfo[2].strides) += ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_mass.diminfo[0].strides)) * __pyx_v_dx) * __pyx_v_dy) * __pyx_v_dz2); - /* "yt/utilities/lib/particle_mesh_operations.pyx":79 + /* "yt/utilities/lib/particle_mesh_operations.pyx":80 * field[i1 ,j1 ,k1-1] += mass[n] * dx2 * dy2 * dz * field[i1-1,j1-1,k1 ] += mass[n] * dx * dy * dz2 * field[i1 ,j1-1,k1 ] += mass[n] * dx2 * dy * dz2 # <<<<<<<<<<<<<< @@ -2324,7 +3132,7 @@ __pyx_t_37 = __pyx_v_k1; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_field.diminfo[1].strides, __pyx_t_37, __pyx_pybuffernd_field.diminfo[2].strides) += ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_mass.diminfo[0].strides)) * __pyx_v_dx2) * __pyx_v_dy) * __pyx_v_dz2); - /* "yt/utilities/lib/particle_mesh_operations.pyx":80 + /* "yt/utilities/lib/particle_mesh_operations.pyx":81 * field[i1-1,j1-1,k1 ] += mass[n] * dx * dy * dz2 * field[i1 ,j1-1,k1 ] += mass[n] * dx2 * dy * dz2 * field[i1-1,j1 ,k1 ] += mass[n] * dx * dy2 * dz2 # <<<<<<<<<<<<<< @@ -2337,7 +3145,7 @@ __pyx_t_41 = __pyx_v_k1; *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_field.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_field.diminfo[2].strides) += ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_mass.diminfo[0].strides)) * __pyx_v_dx) * __pyx_v_dy2) * __pyx_v_dz2); - /* "yt/utilities/lib/particle_mesh_operations.pyx":81 + /* "yt/utilities/lib/particle_mesh_operations.pyx":82 * field[i1 ,j1-1,k1 ] += mass[n] * dx2 * dy * dz2 * field[i1-1,j1 ,k1 ] += mass[n] * dx * dy2 * dz2 * field[i1 ,j1 ,k1 ] += mass[n] * dx2 * dy2 * dz2 # <<<<<<<<<<<<<< @@ -2352,7 +3160,7 @@ __pyx_L3_continue:; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":22 + /* "yt/utilities/lib/particle_mesh_operations.pyx":23 * @cython.boundscheck(False) * @cython.wraparound(False) * def CICDeposit_3(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< @@ -2393,44 +3201,49 @@ return __pyx_r; } -/* "yt/utilities/lib/particle_mesh_operations.pyx":85 - * @cython.boundscheck(False) +/* "yt/utilities/lib/particle_mesh_operations.pyx":87 * @cython.wraparound(False) - * def CICDeposit_2(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] posy, - * np.ndarray[np.float64_t, ndim=1] mass, + * @cython.cdivision(True) + * def CICDeposit_2(np.float64_t[:] posx, # <<<<<<<<<<<<<< + * np.float64_t[:] posy, + * np.float64_t[:] mass, */ /* Python wrapper */ static PyObject *__pyx_pw_2yt_9utilities_3lib_24particle_mesh_operations_3CICDeposit_2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_3CICDeposit_2 = {"CICDeposit_2", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_24particle_mesh_operations_3CICDeposit_2, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_2yt_9utilities_3lib_24particle_mesh_operations_3CICDeposit_2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_posx = 0; - PyArrayObject *__pyx_v_posy = 0; - PyArrayObject *__pyx_v_mass = 0; + __Pyx_memviewslice __pyx_v_posx = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_posy = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_mass = { 0, 0, { 0 }, { 0 }, { 0 } }; __pyx_t_5numpy_int64_t __pyx_v_npositions; - PyArrayObject *__pyx_v_field = 0; - PyArrayObject *__pyx_v_leftEdge = 0; - PyArrayObject *__pyx_v_gridDimension = 0; - PyArrayObject *__pyx_v_cellSize = 0; + __Pyx_memviewslice __pyx_v_field = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_x_bin_edges = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_bin_edges = { 0, 0, { 0 }, { 0 }, { 0 } }; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CICDeposit_2 (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_posx,&__pyx_n_s_posy,&__pyx_n_s_mass,&__pyx_n_s_npositions,&__pyx_n_s_field,&__pyx_n_s_leftEdge,&__pyx_n_s_gridDimension,&__pyx_n_s_cellSize,0}; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_posx,&__pyx_n_s_posy,&__pyx_n_s_mass,&__pyx_n_s_npositions,&__pyx_n_s_field,&__pyx_n_s_x_bin_edges,&__pyx_n_s_y_bin_edges,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -2439,46 +3252,47 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_posx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_posy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 8, 8, 1); __PYX_ERR(0, 85, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 7, 7, 1); __PYX_ERR(0, 87, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mass)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 8, 8, 2); __PYX_ERR(0, 85, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 7, 7, 2); __PYX_ERR(0, 87, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_npositions)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 8, 8, 3); __PYX_ERR(0, 85, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 7, 7, 3); __PYX_ERR(0, 87, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 8, 8, 4); __PYX_ERR(0, 85, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 7, 7, 4); __PYX_ERR(0, 87, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_leftEdge)) != 0)) kw_args--; + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_bin_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 8, 8, 5); __PYX_ERR(0, 85, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 7, 7, 5); __PYX_ERR(0, 87, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gridDimension)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 8, 8, 6); __PYX_ERR(0, 85, __pyx_L3_error) - } - case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cellSize)) != 0)) kw_args--; + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_bin_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 8, 8, 7); __PYX_ERR(0, 85, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 7, 7, 6); __PYX_ERR(0, 87, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CICDeposit_2") < 0)) __PYX_ERR(0, 85, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CICDeposit_2") < 0)) __PYX_ERR(0, 87, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { + } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -2488,71 +3302,44 @@ values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[7] = PyTuple_GET_ITEM(__pyx_args, 7); } - __pyx_v_posx = ((PyArrayObject *)values[0]); - __pyx_v_posy = ((PyArrayObject *)values[1]); - __pyx_v_mass = ((PyArrayObject *)values[2]); - __pyx_v_npositions = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_npositions == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error) - __pyx_v_field = ((PyArrayObject *)values[4]); - __pyx_v_leftEdge = ((PyArrayObject *)values[5]); - __pyx_v_gridDimension = ((PyArrayObject *)values[6]); - __pyx_v_cellSize = ((PyArrayObject *)values[7]); + __pyx_v_posx = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_posx.memview)) __PYX_ERR(0, 87, __pyx_L3_error) + __pyx_v_posy = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_posy.memview)) __PYX_ERR(0, 88, __pyx_L3_error) + __pyx_v_mass = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_mass.memview)) __PYX_ERR(0, 89, __pyx_L3_error) + __pyx_v_npositions = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_npositions == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) + __pyx_v_field = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[4]); if (unlikely(!__pyx_v_field.memview)) __PYX_ERR(0, 91, __pyx_L3_error) + __pyx_v_x_bin_edges = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[5]); if (unlikely(!__pyx_v_x_bin_edges.memview)) __PYX_ERR(0, 92, __pyx_L3_error) + __pyx_v_y_bin_edges = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[6]); if (unlikely(!__pyx_v_y_bin_edges.memview)) __PYX_ERR(0, 93, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICDeposit_2", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 87, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.particle_mesh_operations.CICDeposit_2", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posx), __pyx_ptype_5numpy_ndarray, 1, "posx", 0))) __PYX_ERR(0, 85, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posy), __pyx_ptype_5numpy_ndarray, 1, "posy", 0))) __PYX_ERR(0, 86, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mass), __pyx_ptype_5numpy_ndarray, 1, "mass", 0))) __PYX_ERR(0, 87, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_5numpy_ndarray, 1, "field", 0))) __PYX_ERR(0, 89, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leftEdge), __pyx_ptype_5numpy_ndarray, 1, "leftEdge", 0))) __PYX_ERR(0, 90, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gridDimension), __pyx_ptype_5numpy_ndarray, 1, "gridDimension", 0))) __PYX_ERR(0, 91, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cellSize), __pyx_ptype_5numpy_ndarray, 1, "cellSize", 0))) __PYX_ERR(0, 92, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_2CICDeposit_2(__pyx_self, __pyx_v_posx, __pyx_v_posy, __pyx_v_mass, __pyx_v_npositions, __pyx_v_field, __pyx_v_leftEdge, __pyx_v_gridDimension, __pyx_v_cellSize); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_2CICDeposit_2(__pyx_self, __pyx_v_posx, __pyx_v_posy, __pyx_v_mass, __pyx_v_npositions, __pyx_v_field, __pyx_v_x_bin_edges, __pyx_v_y_bin_edges); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_2CICDeposit_2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_posx, PyArrayObject *__pyx_v_posy, PyArrayObject *__pyx_v_mass, __pyx_t_5numpy_int64_t __pyx_v_npositions, PyArrayObject *__pyx_v_field, PyArrayObject *__pyx_v_leftEdge, PyArrayObject *__pyx_v_gridDimension, PyArrayObject *__pyx_v_cellSize) { +static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_2CICDeposit_2(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_posx, __Pyx_memviewslice __pyx_v_posy, __Pyx_memviewslice __pyx_v_mass, __pyx_t_5numpy_int64_t __pyx_v_npositions, __Pyx_memviewslice __pyx_v_field, __Pyx_memviewslice __pyx_v_x_bin_edges, __Pyx_memviewslice __pyx_v_y_bin_edges) { int __pyx_v_i1; int __pyx_v_j1; int __pyx_v_n; __pyx_t_5numpy_float64_t __pyx_v_xpos; __pyx_t_5numpy_float64_t __pyx_v_ypos; - __pyx_t_5numpy_float64_t __pyx_v_edge0; - __pyx_t_5numpy_float64_t __pyx_v_edge1; - __pyx_t_5numpy_float64_t __pyx_v_le0; - __pyx_t_5numpy_float64_t __pyx_v_le1; + __pyx_t_5numpy_float64_t __pyx_v_edgex; + __pyx_t_5numpy_float64_t __pyx_v_edgey; __pyx_t_5numpy_float64_t __pyx_v_dx; __pyx_t_5numpy_float64_t __pyx_v_dy; - __pyx_t_5numpy_float64_t __pyx_v_dx2; - __pyx_t_5numpy_float64_t __pyx_v_dy2; - __Pyx_LocalBuf_ND __pyx_pybuffernd_cellSize; - __Pyx_Buffer __pyx_pybuffer_cellSize; - __Pyx_LocalBuf_ND __pyx_pybuffernd_field; - __Pyx_Buffer __pyx_pybuffer_field; - __Pyx_LocalBuf_ND __pyx_pybuffernd_gridDimension; - __Pyx_Buffer __pyx_pybuffer_gridDimension; - __Pyx_LocalBuf_ND __pyx_pybuffernd_leftEdge; - __Pyx_Buffer __pyx_pybuffer_leftEdge; - __Pyx_LocalBuf_ND __pyx_pybuffernd_mass; - __Pyx_Buffer __pyx_pybuffer_mass; - __Pyx_LocalBuf_ND __pyx_pybuffernd_posx; - __Pyx_Buffer __pyx_pybuffer_posx; - __Pyx_LocalBuf_ND __pyx_pybuffernd_posy; - __Pyx_Buffer __pyx_pybuffer_posy; + __pyx_t_5numpy_float64_t __pyx_v_ddx; + __pyx_t_5numpy_float64_t __pyx_v_ddy; + __pyx_t_5numpy_float64_t __pyx_v_ddx2; + __pyx_t_5numpy_float64_t __pyx_v_ddy2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; @@ -2562,13 +3349,13 @@ __pyx_t_5numpy_int64_t __pyx_t_5; int __pyx_t_6; Py_ssize_t __pyx_t_7; - __pyx_t_5numpy_float64_t __pyx_t_8; + Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; - __pyx_t_5numpy_float64_t __pyx_t_10; - Py_ssize_t __pyx_t_11; - Py_ssize_t __pyx_t_12; - int __pyx_t_13; - int __pyx_t_14; + Py_ssize_t __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; @@ -2579,115 +3366,50 @@ 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; __Pyx_RefNannySetupContext("CICDeposit_2", 0); - __pyx_pybuffer_posx.pybuffer.buf = NULL; - __pyx_pybuffer_posx.refcount = 0; - __pyx_pybuffernd_posx.data = NULL; - __pyx_pybuffernd_posx.rcbuffer = &__pyx_pybuffer_posx; - __pyx_pybuffer_posy.pybuffer.buf = NULL; - __pyx_pybuffer_posy.refcount = 0; - __pyx_pybuffernd_posy.data = NULL; - __pyx_pybuffernd_posy.rcbuffer = &__pyx_pybuffer_posy; - __pyx_pybuffer_mass.pybuffer.buf = NULL; - __pyx_pybuffer_mass.refcount = 0; - __pyx_pybuffernd_mass.data = NULL; - __pyx_pybuffernd_mass.rcbuffer = &__pyx_pybuffer_mass; - __pyx_pybuffer_field.pybuffer.buf = NULL; - __pyx_pybuffer_field.refcount = 0; - __pyx_pybuffernd_field.data = NULL; - __pyx_pybuffernd_field.rcbuffer = &__pyx_pybuffer_field; - __pyx_pybuffer_leftEdge.pybuffer.buf = NULL; - __pyx_pybuffer_leftEdge.refcount = 0; - __pyx_pybuffernd_leftEdge.data = NULL; - __pyx_pybuffernd_leftEdge.rcbuffer = &__pyx_pybuffer_leftEdge; - __pyx_pybuffer_gridDimension.pybuffer.buf = NULL; - __pyx_pybuffer_gridDimension.refcount = 0; - __pyx_pybuffernd_gridDimension.data = NULL; - __pyx_pybuffernd_gridDimension.rcbuffer = &__pyx_pybuffer_gridDimension; - __pyx_pybuffer_cellSize.pybuffer.buf = NULL; - __pyx_pybuffer_cellSize.refcount = 0; - __pyx_pybuffernd_cellSize.data = NULL; - __pyx_pybuffernd_cellSize.rcbuffer = &__pyx_pybuffer_cellSize; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posx.rcbuffer->pybuffer, (PyObject*)__pyx_v_posx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 85, __pyx_L1_error) - } - __pyx_pybuffernd_posx.diminfo[0].strides = __pyx_pybuffernd_posx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_posx.diminfo[0].shape = __pyx_pybuffernd_posx.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posy.rcbuffer->pybuffer, (PyObject*)__pyx_v_posy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 85, __pyx_L1_error) - } - __pyx_pybuffernd_posy.diminfo[0].strides = __pyx_pybuffernd_posy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_posy.diminfo[0].shape = __pyx_pybuffernd_posy.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mass.rcbuffer->pybuffer, (PyObject*)__pyx_v_mass, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 85, __pyx_L1_error) - } - __pyx_pybuffernd_mass.diminfo[0].strides = __pyx_pybuffernd_mass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mass.diminfo[0].shape = __pyx_pybuffernd_mass.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 85, __pyx_L1_error) - } - __pyx_pybuffernd_field.diminfo[0].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field.diminfo[0].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_field.diminfo[1].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_field.diminfo[1].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_leftEdge.rcbuffer->pybuffer, (PyObject*)__pyx_v_leftEdge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 85, __pyx_L1_error) - } - __pyx_pybuffernd_leftEdge.diminfo[0].strides = __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_leftEdge.diminfo[0].shape = __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gridDimension.rcbuffer->pybuffer, (PyObject*)__pyx_v_gridDimension, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 85, __pyx_L1_error) - } - __pyx_pybuffernd_gridDimension.diminfo[0].strides = __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gridDimension.diminfo[0].shape = __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cellSize.rcbuffer->pybuffer, (PyObject*)__pyx_v_cellSize, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 85, __pyx_L1_error) - } - __pyx_pybuffernd_cellSize.diminfo[0].strides = __pyx_pybuffernd_cellSize.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cellSize.diminfo[0].shape = __pyx_pybuffernd_cellSize.rcbuffer->pybuffer.shape[0]; /* "yt/utilities/lib/particle_mesh_operations.pyx":100 - * cdef np.float64_t dx, dy, dx2, dy2 + * cdef np.float64_t dx, dy, ddx, ddy, ddx2, ddy2 * - * edge0 = ( gridDimension[0]) - 0.5001 # <<<<<<<<<<<<<< - * edge1 = ( gridDimension[1]) - 0.5001 + * edgex = ( x_bin_edges.shape[0] - 1) + 0.5001 # <<<<<<<<<<<<<< + * edgey = ( y_bin_edges.shape[0] - 1) + 0.5001 * */ - __pyx_t_1 = 0; - __pyx_v_edge0 = (((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_gridDimension.diminfo[0].strides))) - 0.5001); + __pyx_v_edgex = ((((__pyx_t_5numpy_float64_t)(__pyx_v_x_bin_edges.shape[0])) - 1.0) + 0.5001); /* "yt/utilities/lib/particle_mesh_operations.pyx":101 * - * edge0 = ( gridDimension[0]) - 0.5001 - * edge1 = ( gridDimension[1]) - 0.5001 # <<<<<<<<<<<<<< + * edgex = ( x_bin_edges.shape[0] - 1) + 0.5001 + * edgey = ( y_bin_edges.shape[0] - 1) + 0.5001 # <<<<<<<<<<<<<< * - * le0 = leftEdge[0] + * # We are always dealing with uniformly spaced bins for CiC */ - __pyx_t_2 = 1; - __pyx_v_edge1 = (((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_gridDimension.diminfo[0].strides))) - 0.5001); + __pyx_v_edgey = ((((__pyx_t_5numpy_float64_t)(__pyx_v_y_bin_edges.shape[0])) - 1.0) + 0.5001); - /* "yt/utilities/lib/particle_mesh_operations.pyx":103 - * edge1 = ( gridDimension[1]) - 0.5001 + /* "yt/utilities/lib/particle_mesh_operations.pyx":104 * - * le0 = leftEdge[0] # <<<<<<<<<<<<<< - * le1 = leftEdge[1] + * # We are always dealing with uniformly spaced bins for CiC + * dx = x_bin_edges[1] - x_bin_edges[0] # <<<<<<<<<<<<<< + * dy = y_bin_edges[1] - y_bin_edges[0] * */ - __pyx_t_3 = 0; - __pyx_v_le0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_leftEdge.diminfo[0].strides)); + __pyx_t_1 = 1; + __pyx_t_2 = 0; + __pyx_v_dx = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x_bin_edges.data + __pyx_t_1 * __pyx_v_x_bin_edges.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x_bin_edges.data + __pyx_t_2 * __pyx_v_x_bin_edges.strides[0]) )))); - /* "yt/utilities/lib/particle_mesh_operations.pyx":104 - * - * le0 = leftEdge[0] - * le1 = leftEdge[1] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/particle_mesh_operations.pyx":105 + * # We are always dealing with uniformly spaced bins for CiC + * dx = x_bin_edges[1] - x_bin_edges[0] + * dy = y_bin_edges[1] - y_bin_edges[0] # <<<<<<<<<<<<<< * * for n in range(npositions): */ - __pyx_t_4 = 1; - __pyx_v_le1 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_leftEdge.diminfo[0].strides)); + __pyx_t_3 = 1; + __pyx_t_4 = 0; + __pyx_v_dy = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_y_bin_edges.data + __pyx_t_3 * __pyx_v_y_bin_edges.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_y_bin_edges.data + __pyx_t_4 * __pyx_v_y_bin_edges.strides[0]) )))); - /* "yt/utilities/lib/particle_mesh_operations.pyx":106 - * le1 = leftEdge[1] + /* "yt/utilities/lib/particle_mesh_operations.pyx":107 + * dy = y_bin_edges[1] - y_bin_edges[0] * * for n in range(npositions): # <<<<<<<<<<<<<< * @@ -2697,295 +3419,376 @@ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_n = __pyx_t_6; - /* "yt/utilities/lib/particle_mesh_operations.pyx":109 + /* "yt/utilities/lib/particle_mesh_operations.pyx":110 * * # Compute the position of the central cell - * xpos = (posx[n] - le0)/cellSize[0] # <<<<<<<<<<<<<< - * ypos = (posy[n] - le1)/cellSize[1] + * xpos = (posx[n] - x_bin_edges[0])/dx # <<<<<<<<<<<<<< + * ypos = (posy[n] - y_bin_edges[0])/dy * */ __pyx_t_7 = __pyx_v_n; - __pyx_t_8 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_posx.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_posx.diminfo[0].strides)) - __pyx_v_le0); - __pyx_t_9 = 0; - __pyx_t_10 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cellSize.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_cellSize.diminfo[0].strides)); - if (unlikely(__pyx_t_10 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 109, __pyx_L1_error) - } - __pyx_v_xpos = (__pyx_t_8 / __pyx_t_10); + __pyx_t_8 = 0; + __pyx_v_xpos = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_posx.data + __pyx_t_7 * __pyx_v_posx.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x_bin_edges.data + __pyx_t_8 * __pyx_v_x_bin_edges.strides[0]) )))) / __pyx_v_dx); - /* "yt/utilities/lib/particle_mesh_operations.pyx":110 + /* "yt/utilities/lib/particle_mesh_operations.pyx":111 * # Compute the position of the central cell - * xpos = (posx[n] - le0)/cellSize[0] - * ypos = (posy[n] - le1)/cellSize[1] # <<<<<<<<<<<<<< + * xpos = (posx[n] - x_bin_edges[0])/dx + * ypos = (posy[n] - y_bin_edges[0])/dy # <<<<<<<<<<<<<< * - * if (xpos < 0.5001) or (xpos > edge0): + * if (xpos < -0.5001) or (xpos > edgex): */ - __pyx_t_11 = __pyx_v_n; - __pyx_t_10 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_posy.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_posy.diminfo[0].strides)) - __pyx_v_le1); - __pyx_t_12 = 1; - __pyx_t_8 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cellSize.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_cellSize.diminfo[0].strides)); - if (unlikely(__pyx_t_8 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 110, __pyx_L1_error) - } - __pyx_v_ypos = (__pyx_t_10 / __pyx_t_8); + __pyx_t_9 = __pyx_v_n; + __pyx_t_10 = 0; + __pyx_v_ypos = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_posy.data + __pyx_t_9 * __pyx_v_posy.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_y_bin_edges.data + __pyx_t_10 * __pyx_v_y_bin_edges.strides[0]) )))) / __pyx_v_dy); - /* "yt/utilities/lib/particle_mesh_operations.pyx":112 - * ypos = (posy[n] - le1)/cellSize[1] + /* "yt/utilities/lib/particle_mesh_operations.pyx":113 + * ypos = (posy[n] - y_bin_edges[0])/dy * - * if (xpos < 0.5001) or (xpos > edge0): # <<<<<<<<<<<<<< + * if (xpos < -0.5001) or (xpos > edgex): # <<<<<<<<<<<<<< * continue - * if (ypos < 0.5001) or (ypos > edge1): + * if (ypos < -0.5001) or (ypos > edgey): */ - __pyx_t_14 = ((__pyx_v_xpos < 0.5001) != 0); - if (!__pyx_t_14) { + __pyx_t_12 = ((__pyx_v_xpos < -0.5001) != 0); + if (!__pyx_t_12) { } else { - __pyx_t_13 = __pyx_t_14; + __pyx_t_11 = __pyx_t_12; goto __pyx_L6_bool_binop_done; } - __pyx_t_14 = ((__pyx_v_xpos > __pyx_v_edge0) != 0); - __pyx_t_13 = __pyx_t_14; + __pyx_t_12 = ((__pyx_v_xpos > __pyx_v_edgex) != 0); + __pyx_t_11 = __pyx_t_12; __pyx_L6_bool_binop_done:; - if (__pyx_t_13) { + if (__pyx_t_11) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":113 + /* "yt/utilities/lib/particle_mesh_operations.pyx":114 * - * if (xpos < 0.5001) or (xpos > edge0): + * if (xpos < -0.5001) or (xpos > edgex): * continue # <<<<<<<<<<<<<< - * if (ypos < 0.5001) or (ypos > edge1): + * if (ypos < -0.5001) or (ypos > edgey): * continue */ goto __pyx_L3_continue; - /* "yt/utilities/lib/particle_mesh_operations.pyx":112 - * ypos = (posy[n] - le1)/cellSize[1] + /* "yt/utilities/lib/particle_mesh_operations.pyx":113 + * ypos = (posy[n] - y_bin_edges[0])/dy * - * if (xpos < 0.5001) or (xpos > edge0): # <<<<<<<<<<<<<< + * if (xpos < -0.5001) or (xpos > edgex): # <<<<<<<<<<<<<< * continue - * if (ypos < 0.5001) or (ypos > edge1): + * if (ypos < -0.5001) or (ypos > edgey): */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":114 - * if (xpos < 0.5001) or (xpos > edge0): + /* "yt/utilities/lib/particle_mesh_operations.pyx":115 + * if (xpos < -0.5001) or (xpos > edgex): * continue - * if (ypos < 0.5001) or (ypos > edge1): # <<<<<<<<<<<<<< + * if (ypos < -0.5001) or (ypos > edgey): # <<<<<<<<<<<<<< * continue * */ - __pyx_t_14 = ((__pyx_v_ypos < 0.5001) != 0); - if (!__pyx_t_14) { + __pyx_t_12 = ((__pyx_v_ypos < -0.5001) != 0); + if (!__pyx_t_12) { } else { - __pyx_t_13 = __pyx_t_14; + __pyx_t_11 = __pyx_t_12; goto __pyx_L9_bool_binop_done; } - __pyx_t_14 = ((__pyx_v_ypos > __pyx_v_edge1) != 0); - __pyx_t_13 = __pyx_t_14; + __pyx_t_12 = ((__pyx_v_ypos > __pyx_v_edgey) != 0); + __pyx_t_11 = __pyx_t_12; __pyx_L9_bool_binop_done:; - if (__pyx_t_13) { + if (__pyx_t_11) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":115 + /* "yt/utilities/lib/particle_mesh_operations.pyx":116 * continue - * if (ypos < 0.5001) or (ypos > edge1): + * if (ypos < -0.5001) or (ypos > edgey): * continue # <<<<<<<<<<<<<< * - * i1 = (xpos + 0.5) + * i1 = (xpos) */ goto __pyx_L3_continue; - /* "yt/utilities/lib/particle_mesh_operations.pyx":114 - * if (xpos < 0.5001) or (xpos > edge0): + /* "yt/utilities/lib/particle_mesh_operations.pyx":115 + * if (xpos < -0.5001) or (xpos > edgex): * continue - * if (ypos < 0.5001) or (ypos > edge1): # <<<<<<<<<<<<<< + * if (ypos < -0.5001) or (ypos > edgey): # <<<<<<<<<<<<<< * continue * */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":117 + /* "yt/utilities/lib/particle_mesh_operations.pyx":118 * continue * - * i1 = (xpos + 0.5) # <<<<<<<<<<<<<< - * j1 = (ypos + 0.5) + * i1 = (xpos) # <<<<<<<<<<<<<< + * j1 = (ypos) * */ - __pyx_v_i1 = ((int)(__pyx_v_xpos + 0.5)); + __pyx_v_i1 = ((int)__pyx_v_xpos); - /* "yt/utilities/lib/particle_mesh_operations.pyx":118 + /* "yt/utilities/lib/particle_mesh_operations.pyx":119 * - * i1 = (xpos + 0.5) - * j1 = (ypos + 0.5) # <<<<<<<<<<<<<< + * i1 = (xpos) + * j1 = (ypos) # <<<<<<<<<<<<<< * * # Compute the weights */ - __pyx_v_j1 = ((int)(__pyx_v_ypos + 0.5)); + __pyx_v_j1 = ((int)__pyx_v_ypos); - /* "yt/utilities/lib/particle_mesh_operations.pyx":121 + /* "yt/utilities/lib/particle_mesh_operations.pyx":122 * * # Compute the weights - * dx = ( i1) + 0.5 - xpos # <<<<<<<<<<<<<< - * dy = ( j1) + 0.5 - ypos - * dx2 = 1.0 - dx + * ddx = ( i1) + 0.5 - xpos # <<<<<<<<<<<<<< + * ddy = ( j1) + 0.5 - ypos + * ddx2 = 1.0 - ddx */ - __pyx_v_dx = ((((__pyx_t_5numpy_float64_t)__pyx_v_i1) + 0.5) - __pyx_v_xpos); + __pyx_v_ddx = ((((__pyx_t_5numpy_float64_t)__pyx_v_i1) + 0.5) - __pyx_v_xpos); - /* "yt/utilities/lib/particle_mesh_operations.pyx":122 + /* "yt/utilities/lib/particle_mesh_operations.pyx":123 * # Compute the weights - * dx = ( i1) + 0.5 - xpos - * dy = ( j1) + 0.5 - ypos # <<<<<<<<<<<<<< - * dx2 = 1.0 - dx - * dy2 = 1.0 - dy + * ddx = ( i1) + 0.5 - xpos + * ddy = ( j1) + 0.5 - ypos # <<<<<<<<<<<<<< + * ddx2 = 1.0 - ddx + * ddy2 = 1.0 - ddy */ - __pyx_v_dy = ((((__pyx_t_5numpy_float64_t)__pyx_v_j1) + 0.5) - __pyx_v_ypos); + __pyx_v_ddy = ((((__pyx_t_5numpy_float64_t)__pyx_v_j1) + 0.5) - __pyx_v_ypos); - /* "yt/utilities/lib/particle_mesh_operations.pyx":123 - * dx = ( i1) + 0.5 - xpos - * dy = ( j1) + 0.5 - ypos - * dx2 = 1.0 - dx # <<<<<<<<<<<<<< - * dy2 = 1.0 - dy + /* "yt/utilities/lib/particle_mesh_operations.pyx":124 + * ddx = ( i1) + 0.5 - xpos + * ddy = ( j1) + 0.5 - ypos + * ddx2 = 1.0 - ddx # <<<<<<<<<<<<<< + * ddy2 = 1.0 - ddy * */ - __pyx_v_dx2 = (1.0 - __pyx_v_dx); - - /* "yt/utilities/lib/particle_mesh_operations.pyx":124 - * dy = ( j1) + 0.5 - ypos - * dx2 = 1.0 - dx - * dy2 = 1.0 - dy # <<<<<<<<<<<<<< + __pyx_v_ddx2 = (1.0 - __pyx_v_ddx); + + /* "yt/utilities/lib/particle_mesh_operations.pyx":125 + * ddy = ( j1) + 0.5 - ypos + * ddx2 = 1.0 - ddx + * ddy2 = 1.0 - ddy # <<<<<<<<<<<<<< * * # Deposit onto field */ - __pyx_v_dy2 = (1.0 - __pyx_v_dy); + __pyx_v_ddy2 = (1.0 - __pyx_v_ddy); - /* "yt/utilities/lib/particle_mesh_operations.pyx":127 + /* "yt/utilities/lib/particle_mesh_operations.pyx":128 * * # Deposit onto field - * field[i1-1,j1-1] += mass[n] * dx * dy # <<<<<<<<<<<<<< - * field[i1 ,j1-1] += mass[n] * dx2 * dy - * field[i1-1,j1 ] += mass[n] * dx * dy2 - */ - __pyx_t_15 = __pyx_v_n; - __pyx_t_16 = (__pyx_v_i1 - 1); - __pyx_t_17 = (__pyx_v_j1 - 1); - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_field.diminfo[1].strides) += (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mass.diminfo[0].strides)) * __pyx_v_dx) * __pyx_v_dy); + * if i1 > 0 and j1 > 0: # <<<<<<<<<<<<<< + * field[i1-1,j1-1] += mass[n] * ddx * ddy + * if j1 > 0 and i1 < field.shape[0]: + */ + __pyx_t_12 = ((__pyx_v_i1 > 0) != 0); + if (__pyx_t_12) { + } else { + __pyx_t_11 = __pyx_t_12; + goto __pyx_L12_bool_binop_done; + } + __pyx_t_12 = ((__pyx_v_j1 > 0) != 0); + __pyx_t_11 = __pyx_t_12; + __pyx_L12_bool_binop_done:; + if (__pyx_t_11) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":128 + /* "yt/utilities/lib/particle_mesh_operations.pyx":129 * # Deposit onto field - * field[i1-1,j1-1] += mass[n] * dx * dy - * field[i1 ,j1-1] += mass[n] * dx2 * dy # <<<<<<<<<<<<<< - * field[i1-1,j1 ] += mass[n] * dx * dy2 - * field[i1 ,j1 ] += mass[n] * dx2 * dy2 - */ - __pyx_t_18 = __pyx_v_n; - __pyx_t_19 = __pyx_v_i1; - __pyx_t_20 = (__pyx_v_j1 - 1); - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_field.diminfo[1].strides) += (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_mass.diminfo[0].strides)) * __pyx_v_dx2) * __pyx_v_dy); + * if i1 > 0 and j1 > 0: + * field[i1-1,j1-1] += mass[n] * ddx * ddy # <<<<<<<<<<<<<< + * if j1 > 0 and i1 < field.shape[0]: + * field[i1 ,j1-1] += mass[n] * ddx2 * ddy + */ + __pyx_t_13 = __pyx_v_n; + __pyx_t_14 = (__pyx_v_i1 - 1); + __pyx_t_15 = (__pyx_v_j1 - 1); + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_field.data + __pyx_t_14 * __pyx_v_field.strides[0]) ) + __pyx_t_15 * __pyx_v_field.strides[1]) )) += (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_mass.data + __pyx_t_13 * __pyx_v_mass.strides[0]) ))) * __pyx_v_ddx) * __pyx_v_ddy); - /* "yt/utilities/lib/particle_mesh_operations.pyx":129 - * field[i1-1,j1-1] += mass[n] * dx * dy - * field[i1 ,j1-1] += mass[n] * dx2 * dy - * field[i1-1,j1 ] += mass[n] * dx * dy2 # <<<<<<<<<<<<<< - * field[i1 ,j1 ] += mass[n] * dx2 * dy2 + /* "yt/utilities/lib/particle_mesh_operations.pyx":128 * + * # Deposit onto field + * if i1 > 0 and j1 > 0: # <<<<<<<<<<<<<< + * field[i1-1,j1-1] += mass[n] * ddx * ddy + * if j1 > 0 and i1 < field.shape[0]: */ - __pyx_t_21 = __pyx_v_n; - __pyx_t_22 = (__pyx_v_i1 - 1); - __pyx_t_23 = __pyx_v_j1; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_field.diminfo[1].strides) += (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_mass.diminfo[0].strides)) * __pyx_v_dx) * __pyx_v_dy2); + } /* "yt/utilities/lib/particle_mesh_operations.pyx":130 - * field[i1 ,j1-1] += mass[n] * dx2 * dy - * field[i1-1,j1 ] += mass[n] * dx * dy2 - * field[i1 ,j1 ] += mass[n] * dx2 * dy2 # <<<<<<<<<<<<<< + * if i1 > 0 and j1 > 0: + * field[i1-1,j1-1] += mass[n] * ddx * ddy + * if j1 > 0 and i1 < field.shape[0]: # <<<<<<<<<<<<<< + * field[i1 ,j1-1] += mass[n] * ddx2 * ddy + * if i1 > 0 and j1 < field.shape[1]: + */ + __pyx_t_12 = ((__pyx_v_j1 > 0) != 0); + if (__pyx_t_12) { + } else { + __pyx_t_11 = __pyx_t_12; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_12 = ((__pyx_v_i1 < (__pyx_v_field.shape[0])) != 0); + __pyx_t_11 = __pyx_t_12; + __pyx_L15_bool_binop_done:; + if (__pyx_t_11) { + + /* "yt/utilities/lib/particle_mesh_operations.pyx":131 + * field[i1-1,j1-1] += mass[n] * ddx * ddy + * if j1 > 0 and i1 < field.shape[0]: + * field[i1 ,j1-1] += mass[n] * ddx2 * ddy # <<<<<<<<<<<<<< + * if i1 > 0 and j1 < field.shape[1]: + * field[i1-1,j1 ] += mass[n] * ddx * ddy2 + */ + __pyx_t_16 = __pyx_v_n; + __pyx_t_17 = __pyx_v_i1; + __pyx_t_18 = (__pyx_v_j1 - 1); + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_field.data + __pyx_t_17 * __pyx_v_field.strides[0]) ) + __pyx_t_18 * __pyx_v_field.strides[1]) )) += (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_mass.data + __pyx_t_16 * __pyx_v_mass.strides[0]) ))) * __pyx_v_ddx2) * __pyx_v_ddy); + + /* "yt/utilities/lib/particle_mesh_operations.pyx":130 + * if i1 > 0 and j1 > 0: + * field[i1-1,j1-1] += mass[n] * ddx * ddy + * if j1 > 0 and i1 < field.shape[0]: # <<<<<<<<<<<<<< + * field[i1 ,j1-1] += mass[n] * ddx2 * ddy + * if i1 > 0 and j1 < field.shape[1]: + */ + } + + /* "yt/utilities/lib/particle_mesh_operations.pyx":132 + * if j1 > 0 and i1 < field.shape[0]: + * field[i1 ,j1-1] += mass[n] * ddx2 * ddy + * if i1 > 0 and j1 < field.shape[1]: # <<<<<<<<<<<<<< + * field[i1-1,j1 ] += mass[n] * ddx * ddy2 + * if i1 < field.shape[0] and j1 < field.shape[1]: + */ + __pyx_t_12 = ((__pyx_v_i1 > 0) != 0); + if (__pyx_t_12) { + } else { + __pyx_t_11 = __pyx_t_12; + goto __pyx_L18_bool_binop_done; + } + __pyx_t_12 = ((__pyx_v_j1 < (__pyx_v_field.shape[1])) != 0); + __pyx_t_11 = __pyx_t_12; + __pyx_L18_bool_binop_done:; + if (__pyx_t_11) { + + /* "yt/utilities/lib/particle_mesh_operations.pyx":133 + * field[i1 ,j1-1] += mass[n] * ddx2 * ddy + * if i1 > 0 and j1 < field.shape[1]: + * field[i1-1,j1 ] += mass[n] * ddx * ddy2 # <<<<<<<<<<<<<< + * if i1 < field.shape[0] and j1 < field.shape[1]: + * field[i1 ,j1 ] += mass[n] * ddx2 * ddy2 + */ + __pyx_t_19 = __pyx_v_n; + __pyx_t_20 = (__pyx_v_i1 - 1); + __pyx_t_21 = __pyx_v_j1; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_field.data + __pyx_t_20 * __pyx_v_field.strides[0]) ) + __pyx_t_21 * __pyx_v_field.strides[1]) )) += (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_mass.data + __pyx_t_19 * __pyx_v_mass.strides[0]) ))) * __pyx_v_ddx) * __pyx_v_ddy2); + + /* "yt/utilities/lib/particle_mesh_operations.pyx":132 + * if j1 > 0 and i1 < field.shape[0]: + * field[i1 ,j1-1] += mass[n] * ddx2 * ddy + * if i1 > 0 and j1 < field.shape[1]: # <<<<<<<<<<<<<< + * field[i1-1,j1 ] += mass[n] * ddx * ddy2 + * if i1 < field.shape[0] and j1 < field.shape[1]: + */ + } + + /* "yt/utilities/lib/particle_mesh_operations.pyx":134 + * if i1 > 0 and j1 < field.shape[1]: + * field[i1-1,j1 ] += mass[n] * ddx * ddy2 + * if i1 < field.shape[0] and j1 < field.shape[1]: # <<<<<<<<<<<<<< + * field[i1 ,j1 ] += mass[n] * ddx2 * ddy2 + * + */ + __pyx_t_12 = ((__pyx_v_i1 < (__pyx_v_field.shape[0])) != 0); + if (__pyx_t_12) { + } else { + __pyx_t_11 = __pyx_t_12; + goto __pyx_L21_bool_binop_done; + } + __pyx_t_12 = ((__pyx_v_j1 < (__pyx_v_field.shape[1])) != 0); + __pyx_t_11 = __pyx_t_12; + __pyx_L21_bool_binop_done:; + if (__pyx_t_11) { + + /* "yt/utilities/lib/particle_mesh_operations.pyx":135 + * field[i1-1,j1 ] += mass[n] * ddx * ddy2 + * if i1 < field.shape[0] and j1 < field.shape[1]: + * field[i1 ,j1 ] += mass[n] * ddx2 * ddy2 # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_t_24 = __pyx_v_n; - __pyx_t_25 = __pyx_v_i1; - __pyx_t_26 = __pyx_v_j1; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_field.diminfo[1].strides) += (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_mass.diminfo[0].strides)) * __pyx_v_dx2) * __pyx_v_dy2); + __pyx_t_22 = __pyx_v_n; + __pyx_t_23 = __pyx_v_i1; + __pyx_t_24 = __pyx_v_j1; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_field.data + __pyx_t_23 * __pyx_v_field.strides[0]) ) + __pyx_t_24 * __pyx_v_field.strides[1]) )) += (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_mass.data + __pyx_t_22 * __pyx_v_mass.strides[0]) ))) * __pyx_v_ddx2) * __pyx_v_ddy2); + + /* "yt/utilities/lib/particle_mesh_operations.pyx":134 + * if i1 > 0 and j1 < field.shape[1]: + * field[i1-1,j1 ] += mass[n] * ddx * ddy2 + * if i1 < field.shape[0] and j1 < field.shape[1]: # <<<<<<<<<<<<<< + * field[i1 ,j1 ] += mass[n] * ddx2 * ddy2 + * + */ + } __pyx_L3_continue:; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":85 - * @cython.boundscheck(False) + /* "yt/utilities/lib/particle_mesh_operations.pyx":87 * @cython.wraparound(False) - * def CICDeposit_2(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] posy, - * np.ndarray[np.float64_t, ndim=1] mass, + * @cython.cdivision(True) + * def CICDeposit_2(np.float64_t[:] posx, # <<<<<<<<<<<<<< + * np.float64_t[:] posy, + * np.float64_t[:] mass, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cellSize.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gridDimension.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_leftEdge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mass.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_posx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_posy.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.particle_mesh_operations.CICDeposit_2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cellSize.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gridDimension.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_leftEdge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mass.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_posx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_posy.rcbuffer->pybuffer); - __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_posx, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_posy, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_mass, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_field, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_x_bin_edges, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_bin_edges, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/particle_mesh_operations.pyx":134 - * @cython.boundscheck(False) +/* "yt/utilities/lib/particle_mesh_operations.pyx":140 * @cython.wraparound(False) - * def NGPDeposit_2(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] posy, - * np.ndarray[np.float64_t, ndim=1] mass, + * @cython.cdivision(True) + * def NGPDeposit_2(np.float64_t[:] posx, # <<<<<<<<<<<<<< + * np.float64_t[:] posy, + * np.float64_t[:] mass, */ /* Python wrapper */ static PyObject *__pyx_pw_2yt_9utilities_3lib_24particle_mesh_operations_5NGPDeposit_2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_5NGPDeposit_2 = {"NGPDeposit_2", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_24particle_mesh_operations_5NGPDeposit_2, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_2yt_9utilities_3lib_24particle_mesh_operations_5NGPDeposit_2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_posx = 0; - PyArrayObject *__pyx_v_posy = 0; - PyArrayObject *__pyx_v_mass = 0; + __Pyx_memviewslice __pyx_v_posx = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_posy = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_mass = { 0, 0, { 0 }, { 0 }, { 0 } }; __pyx_t_5numpy_int64_t __pyx_v_npositions; - PyArrayObject *__pyx_v_field = 0; - PyArrayObject *__pyx_v_leftEdge = 0; - PyArrayObject *__pyx_v_gridDimension = 0; - PyArrayObject *__pyx_v_cellSize = 0; + __Pyx_memviewslice __pyx_v_field = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_x_bin_edges = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_bin_edges = { 0, 0, { 0 }, { 0 }, { 0 } }; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("NGPDeposit_2 (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_posx,&__pyx_n_s_posy,&__pyx_n_s_mass,&__pyx_n_s_npositions,&__pyx_n_s_field,&__pyx_n_s_leftEdge,&__pyx_n_s_gridDimension,&__pyx_n_s_cellSize,0}; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_posx,&__pyx_n_s_posy,&__pyx_n_s_mass,&__pyx_n_s_npositions,&__pyx_n_s_field,&__pyx_n_s_x_bin_edges,&__pyx_n_s_y_bin_edges,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -2994,46 +3797,47 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_posx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_posy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 8, 8, 1); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 7, 7, 1); __PYX_ERR(0, 140, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mass)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 8, 8, 2); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 7, 7, 2); __PYX_ERR(0, 140, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_npositions)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 8, 8, 3); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 7, 7, 3); __PYX_ERR(0, 140, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 8, 8, 4); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 7, 7, 4); __PYX_ERR(0, 140, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_leftEdge)) != 0)) kw_args--; + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x_bin_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 8, 8, 5); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 7, 7, 5); __PYX_ERR(0, 140, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gridDimension)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 8, 8, 6); __PYX_ERR(0, 134, __pyx_L3_error) - } - case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cellSize)) != 0)) kw_args--; + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y_bin_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 8, 8, 7); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 7, 7, 6); __PYX_ERR(0, 140, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "NGPDeposit_2") < 0)) __PYX_ERR(0, 134, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "NGPDeposit_2") < 0)) __PYX_ERR(0, 140, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { + } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -3043,382 +3847,355 @@ values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[7] = PyTuple_GET_ITEM(__pyx_args, 7); } - __pyx_v_posx = ((PyArrayObject *)values[0]); - __pyx_v_posy = ((PyArrayObject *)values[1]); - __pyx_v_mass = ((PyArrayObject *)values[2]); - __pyx_v_npositions = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_npositions == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) - __pyx_v_field = ((PyArrayObject *)values[4]); - __pyx_v_leftEdge = ((PyArrayObject *)values[5]); - __pyx_v_gridDimension = ((PyArrayObject *)values[6]); - __pyx_v_cellSize = ((PyArrayObject *)values[7]); + __pyx_v_posx = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_posx.memview)) __PYX_ERR(0, 140, __pyx_L3_error) + __pyx_v_posy = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_posy.memview)) __PYX_ERR(0, 141, __pyx_L3_error) + __pyx_v_mass = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_mass.memview)) __PYX_ERR(0, 142, __pyx_L3_error) + __pyx_v_npositions = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_npositions == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) + __pyx_v_field = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[4]); if (unlikely(!__pyx_v_field.memview)) __PYX_ERR(0, 144, __pyx_L3_error) + __pyx_v_x_bin_edges = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[5]); if (unlikely(!__pyx_v_x_bin_edges.memview)) __PYX_ERR(0, 145, __pyx_L3_error) + __pyx_v_y_bin_edges = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[6]); if (unlikely(!__pyx_v_y_bin_edges.memview)) __PYX_ERR(0, 146, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("NGPDeposit_2", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 140, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.particle_mesh_operations.NGPDeposit_2", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posx), __pyx_ptype_5numpy_ndarray, 1, "posx", 0))) __PYX_ERR(0, 134, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posy), __pyx_ptype_5numpy_ndarray, 1, "posy", 0))) __PYX_ERR(0, 135, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mass), __pyx_ptype_5numpy_ndarray, 1, "mass", 0))) __PYX_ERR(0, 136, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_5numpy_ndarray, 1, "field", 0))) __PYX_ERR(0, 138, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leftEdge), __pyx_ptype_5numpy_ndarray, 1, "leftEdge", 0))) __PYX_ERR(0, 139, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gridDimension), __pyx_ptype_5numpy_ndarray, 1, "gridDimension", 0))) __PYX_ERR(0, 140, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cellSize), __pyx_ptype_5numpy_ndarray, 1, "cellSize", 0))) __PYX_ERR(0, 141, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_4NGPDeposit_2(__pyx_self, __pyx_v_posx, __pyx_v_posy, __pyx_v_mass, __pyx_v_npositions, __pyx_v_field, __pyx_v_leftEdge, __pyx_v_gridDimension, __pyx_v_cellSize); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_4NGPDeposit_2(__pyx_self, __pyx_v_posx, __pyx_v_posy, __pyx_v_mass, __pyx_v_npositions, __pyx_v_field, __pyx_v_x_bin_edges, __pyx_v_y_bin_edges); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_4NGPDeposit_2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_posx, PyArrayObject *__pyx_v_posy, PyArrayObject *__pyx_v_mass, __pyx_t_5numpy_int64_t __pyx_v_npositions, PyArrayObject *__pyx_v_field, PyArrayObject *__pyx_v_leftEdge, PyArrayObject *__pyx_v_gridDimension, PyArrayObject *__pyx_v_cellSize) { +static PyObject *__pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_4NGPDeposit_2(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_posx, __Pyx_memviewslice __pyx_v_posy, __Pyx_memviewslice __pyx_v_mass, __pyx_t_5numpy_int64_t __pyx_v_npositions, __Pyx_memviewslice __pyx_v_field, __Pyx_memviewslice __pyx_v_x_bin_edges, __Pyx_memviewslice __pyx_v_y_bin_edges) { + int __pyx_v_i; + int __pyx_v_j; int __pyx_v_i1; int __pyx_v_j1; int __pyx_v_n; __pyx_t_5numpy_float64_t __pyx_v_xpos; __pyx_t_5numpy_float64_t __pyx_v_ypos; - __pyx_t_5numpy_float64_t __pyx_v_edge0; - __pyx_t_5numpy_float64_t __pyx_v_edge1; - __pyx_t_5numpy_float64_t __pyx_v_le0; - __pyx_t_5numpy_float64_t __pyx_v_le1; - __Pyx_LocalBuf_ND __pyx_pybuffernd_cellSize; - __Pyx_Buffer __pyx_pybuffer_cellSize; - __Pyx_LocalBuf_ND __pyx_pybuffernd_field; - __Pyx_Buffer __pyx_pybuffer_field; - __Pyx_LocalBuf_ND __pyx_pybuffernd_gridDimension; - __Pyx_Buffer __pyx_pybuffer_gridDimension; - __Pyx_LocalBuf_ND __pyx_pybuffernd_leftEdge; - __Pyx_Buffer __pyx_pybuffer_leftEdge; - __Pyx_LocalBuf_ND __pyx_pybuffernd_mass; - __Pyx_Buffer __pyx_pybuffer_mass; - __Pyx_LocalBuf_ND __pyx_pybuffernd_posx; - __Pyx_Buffer __pyx_pybuffer_posx; - __Pyx_LocalBuf_ND __pyx_pybuffernd_posy; - __Pyx_Buffer __pyx_pybuffer_posy; + __pyx_t_5numpy_float64_t __pyx_v_x_endpoints[2]; + __pyx_t_5numpy_float64_t __pyx_v_y_endpoints[2]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t *__pyx_t_1; Py_ssize_t __pyx_t_2; - Py_ssize_t __pyx_t_3; + __pyx_t_5numpy_float64_t __pyx_t_3; Py_ssize_t __pyx_t_4; - __pyx_t_5numpy_int64_t __pyx_t_5; - int __pyx_t_6; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; - __pyx_t_5numpy_float64_t __pyx_t_8; - Py_ssize_t __pyx_t_9; - __pyx_t_5numpy_float64_t __pyx_t_10; + __pyx_t_5numpy_int64_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; Py_ssize_t __pyx_t_11; - Py_ssize_t __pyx_t_12; + int __pyx_t_12; int __pyx_t_13; - int __pyx_t_14; - Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_14; + int __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; __Pyx_RefNannySetupContext("NGPDeposit_2", 0); - __pyx_pybuffer_posx.pybuffer.buf = NULL; - __pyx_pybuffer_posx.refcount = 0; - __pyx_pybuffernd_posx.data = NULL; - __pyx_pybuffernd_posx.rcbuffer = &__pyx_pybuffer_posx; - __pyx_pybuffer_posy.pybuffer.buf = NULL; - __pyx_pybuffer_posy.refcount = 0; - __pyx_pybuffernd_posy.data = NULL; - __pyx_pybuffernd_posy.rcbuffer = &__pyx_pybuffer_posy; - __pyx_pybuffer_mass.pybuffer.buf = NULL; - __pyx_pybuffer_mass.refcount = 0; - __pyx_pybuffernd_mass.data = NULL; - __pyx_pybuffernd_mass.rcbuffer = &__pyx_pybuffer_mass; - __pyx_pybuffer_field.pybuffer.buf = NULL; - __pyx_pybuffer_field.refcount = 0; - __pyx_pybuffernd_field.data = NULL; - __pyx_pybuffernd_field.rcbuffer = &__pyx_pybuffer_field; - __pyx_pybuffer_leftEdge.pybuffer.buf = NULL; - __pyx_pybuffer_leftEdge.refcount = 0; - __pyx_pybuffernd_leftEdge.data = NULL; - __pyx_pybuffernd_leftEdge.rcbuffer = &__pyx_pybuffer_leftEdge; - __pyx_pybuffer_gridDimension.pybuffer.buf = NULL; - __pyx_pybuffer_gridDimension.refcount = 0; - __pyx_pybuffernd_gridDimension.data = NULL; - __pyx_pybuffernd_gridDimension.rcbuffer = &__pyx_pybuffer_gridDimension; - __pyx_pybuffer_cellSize.pybuffer.buf = NULL; - __pyx_pybuffer_cellSize.refcount = 0; - __pyx_pybuffernd_cellSize.data = NULL; - __pyx_pybuffernd_cellSize.rcbuffer = &__pyx_pybuffer_cellSize; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posx.rcbuffer->pybuffer, (PyObject*)__pyx_v_posx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 134, __pyx_L1_error) - } - __pyx_pybuffernd_posx.diminfo[0].strides = __pyx_pybuffernd_posx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_posx.diminfo[0].shape = __pyx_pybuffernd_posx.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posy.rcbuffer->pybuffer, (PyObject*)__pyx_v_posy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 134, __pyx_L1_error) - } - __pyx_pybuffernd_posy.diminfo[0].strides = __pyx_pybuffernd_posy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_posy.diminfo[0].shape = __pyx_pybuffernd_posy.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mass.rcbuffer->pybuffer, (PyObject*)__pyx_v_mass, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 134, __pyx_L1_error) - } - __pyx_pybuffernd_mass.diminfo[0].strides = __pyx_pybuffernd_mass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mass.diminfo[0].shape = __pyx_pybuffernd_mass.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 134, __pyx_L1_error) - } - __pyx_pybuffernd_field.diminfo[0].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field.diminfo[0].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_field.diminfo[1].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_field.diminfo[1].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_leftEdge.rcbuffer->pybuffer, (PyObject*)__pyx_v_leftEdge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 134, __pyx_L1_error) - } - __pyx_pybuffernd_leftEdge.diminfo[0].strides = __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_leftEdge.diminfo[0].shape = __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gridDimension.rcbuffer->pybuffer, (PyObject*)__pyx_v_gridDimension, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 134, __pyx_L1_error) - } - __pyx_pybuffernd_gridDimension.diminfo[0].strides = __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gridDimension.diminfo[0].shape = __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cellSize.rcbuffer->pybuffer, (PyObject*)__pyx_v_cellSize, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 134, __pyx_L1_error) - } - __pyx_pybuffernd_cellSize.diminfo[0].strides = __pyx_pybuffernd_cellSize.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cellSize.diminfo[0].shape = __pyx_pybuffernd_cellSize.rcbuffer->pybuffer.shape[0]; - - /* "yt/utilities/lib/particle_mesh_operations.pyx":148 - * cdef np.float64_t le0, le1 - * - * edge0 = ( gridDimension[0]) - 0.5001 # <<<<<<<<<<<<<< - * edge1 = ( gridDimension[1]) - 0.5001 - * - */ - __pyx_t_1 = 0; - __pyx_v_edge0 = (((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_gridDimension.diminfo[0].strides))) - 0.5001); - - /* "yt/utilities/lib/particle_mesh_operations.pyx":149 - * - * edge0 = ( gridDimension[0]) - 0.5001 - * edge1 = ( gridDimension[1]) - 0.5001 # <<<<<<<<<<<<<< - * - * le0 = leftEdge[0] - */ - __pyx_t_2 = 1; - __pyx_v_edge1 = (((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_gridDimension.diminfo[0].strides))) - 0.5001); - /* "yt/utilities/lib/particle_mesh_operations.pyx":151 - * edge1 = ( gridDimension[1]) - 0.5001 + /* "yt/utilities/lib/particle_mesh_operations.pyx":155 + * cdef np.float64_t[2] y_endpoints * - * le0 = leftEdge[0] # <<<<<<<<<<<<<< - * le1 = leftEdge[1] + * x_endpoints = (x_bin_edges[0], x_bin_edges[x_bin_edges.shape[0] - 1]) # <<<<<<<<<<<<<< + * y_endpoints = (y_bin_edges[0], y_bin_edges[y_bin_edges.shape[0] - 1]) * */ - __pyx_t_3 = 0; - __pyx_v_le0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_leftEdge.diminfo[0].strides)); + __pyx_t_1 = __pyx_v_x_endpoints; + __pyx_t_2 = 0; + __pyx_t_3 = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x_bin_edges.data + __pyx_t_2 * __pyx_v_x_bin_edges.strides[0]) ))); + __pyx_t_4 = ((__pyx_v_x_bin_edges.shape[0]) - 1); + __pyx_t_5 = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x_bin_edges.data + __pyx_t_4 * __pyx_v_x_bin_edges.strides[0]) ))); + (__pyx_t_1[0]) = __pyx_t_3; + (__pyx_t_1[1]) = __pyx_t_5; - /* "yt/utilities/lib/particle_mesh_operations.pyx":152 + /* "yt/utilities/lib/particle_mesh_operations.pyx":156 * - * le0 = leftEdge[0] - * le1 = leftEdge[1] # <<<<<<<<<<<<<< + * x_endpoints = (x_bin_edges[0], x_bin_edges[x_bin_edges.shape[0] - 1]) + * y_endpoints = (y_bin_edges[0], y_bin_edges[y_bin_edges.shape[0] - 1]) # <<<<<<<<<<<<<< * * for n in range(npositions): */ - __pyx_t_4 = 1; - __pyx_v_le1 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_leftEdge.diminfo[0].strides)); + __pyx_t_1 = __pyx_v_y_endpoints; + __pyx_t_6 = 0; + __pyx_t_5 = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_y_bin_edges.data + __pyx_t_6 * __pyx_v_y_bin_edges.strides[0]) ))); + __pyx_t_7 = ((__pyx_v_y_bin_edges.shape[0]) - 1); + __pyx_t_3 = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_y_bin_edges.data + __pyx_t_7 * __pyx_v_y_bin_edges.strides[0]) ))); + (__pyx_t_1[0]) = __pyx_t_5; + (__pyx_t_1[1]) = __pyx_t_3; - /* "yt/utilities/lib/particle_mesh_operations.pyx":154 - * le1 = leftEdge[1] + /* "yt/utilities/lib/particle_mesh_operations.pyx":158 + * y_endpoints = (y_bin_edges[0], y_bin_edges[y_bin_edges.shape[0] - 1]) * * for n in range(npositions): # <<<<<<<<<<<<<< * - * # Compute the position of the central cell + * xpos = posx[n] */ - __pyx_t_5 = __pyx_v_npositions; - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { - __pyx_v_n = __pyx_t_6; + __pyx_t_8 = __pyx_v_npositions; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_n = __pyx_t_9; - /* "yt/utilities/lib/particle_mesh_operations.pyx":157 + /* "yt/utilities/lib/particle_mesh_operations.pyx":160 + * for n in range(npositions): * - * # Compute the position of the central cell - * xpos = (posx[n] - le0)/cellSize[0] # <<<<<<<<<<<<<< - * ypos = (posy[n] - le1)/cellSize[1] + * xpos = posx[n] # <<<<<<<<<<<<<< + * ypos = posy[n] * */ - __pyx_t_7 = __pyx_v_n; - __pyx_t_8 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_posx.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_posx.diminfo[0].strides)) - __pyx_v_le0); - __pyx_t_9 = 0; - __pyx_t_10 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cellSize.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_cellSize.diminfo[0].strides)); - if (unlikely(__pyx_t_10 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 157, __pyx_L1_error) - } - __pyx_v_xpos = (__pyx_t_8 / __pyx_t_10); + __pyx_t_10 = __pyx_v_n; + __pyx_v_xpos = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_posx.data + __pyx_t_10 * __pyx_v_posx.strides[0]) ))); - /* "yt/utilities/lib/particle_mesh_operations.pyx":158 - * # Compute the position of the central cell - * xpos = (posx[n] - le0)/cellSize[0] - * ypos = (posy[n] - le1)/cellSize[1] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/particle_mesh_operations.pyx":161 * - * if (xpos < 0.5001) or (xpos > edge0): + * xpos = posx[n] + * ypos = posy[n] # <<<<<<<<<<<<<< + * + * if (xpos < x_endpoints[0]) or (xpos > x_endpoints[1]): */ __pyx_t_11 = __pyx_v_n; - __pyx_t_10 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_posy.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_posy.diminfo[0].strides)) - __pyx_v_le1); - __pyx_t_12 = 1; - __pyx_t_8 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cellSize.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_cellSize.diminfo[0].strides)); - if (unlikely(__pyx_t_8 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 158, __pyx_L1_error) - } - __pyx_v_ypos = (__pyx_t_10 / __pyx_t_8); + __pyx_v_ypos = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_posy.data + __pyx_t_11 * __pyx_v_posy.strides[0]) ))); - /* "yt/utilities/lib/particle_mesh_operations.pyx":160 - * ypos = (posy[n] - le1)/cellSize[1] + /* "yt/utilities/lib/particle_mesh_operations.pyx":163 + * ypos = posy[n] * - * if (xpos < 0.5001) or (xpos > edge0): # <<<<<<<<<<<<<< + * if (xpos < x_endpoints[0]) or (xpos > x_endpoints[1]): # <<<<<<<<<<<<<< * continue - * if (ypos < 0.5001) or (ypos > edge1): + * if (ypos < y_endpoints[0]) or (ypos > y_endpoints[1]): */ - __pyx_t_14 = ((__pyx_v_xpos < 0.5001) != 0); - if (!__pyx_t_14) { + __pyx_t_13 = ((__pyx_v_xpos < (__pyx_v_x_endpoints[0])) != 0); + if (!__pyx_t_13) { } else { - __pyx_t_13 = __pyx_t_14; + __pyx_t_12 = __pyx_t_13; goto __pyx_L6_bool_binop_done; } - __pyx_t_14 = ((__pyx_v_xpos > __pyx_v_edge0) != 0); - __pyx_t_13 = __pyx_t_14; + __pyx_t_13 = ((__pyx_v_xpos > (__pyx_v_x_endpoints[1])) != 0); + __pyx_t_12 = __pyx_t_13; __pyx_L6_bool_binop_done:; - if (__pyx_t_13) { + if (__pyx_t_12) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":161 + /* "yt/utilities/lib/particle_mesh_operations.pyx":164 * - * if (xpos < 0.5001) or (xpos > edge0): + * if (xpos < x_endpoints[0]) or (xpos > x_endpoints[1]): * continue # <<<<<<<<<<<<<< - * if (ypos < 0.5001) or (ypos > edge1): + * if (ypos < y_endpoints[0]) or (ypos > y_endpoints[1]): * continue */ goto __pyx_L3_continue; - /* "yt/utilities/lib/particle_mesh_operations.pyx":160 - * ypos = (posy[n] - le1)/cellSize[1] + /* "yt/utilities/lib/particle_mesh_operations.pyx":163 + * ypos = posy[n] * - * if (xpos < 0.5001) or (xpos > edge0): # <<<<<<<<<<<<<< + * if (xpos < x_endpoints[0]) or (xpos > x_endpoints[1]): # <<<<<<<<<<<<<< * continue - * if (ypos < 0.5001) or (ypos > edge1): + * if (ypos < y_endpoints[0]) or (ypos > y_endpoints[1]): */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":162 - * if (xpos < 0.5001) or (xpos > edge0): + /* "yt/utilities/lib/particle_mesh_operations.pyx":165 + * if (xpos < x_endpoints[0]) or (xpos > x_endpoints[1]): * continue - * if (ypos < 0.5001) or (ypos > edge1): # <<<<<<<<<<<<<< + * if (ypos < y_endpoints[0]) or (ypos > y_endpoints[1]): # <<<<<<<<<<<<<< * continue * */ - __pyx_t_14 = ((__pyx_v_ypos < 0.5001) != 0); - if (!__pyx_t_14) { + __pyx_t_13 = ((__pyx_v_ypos < (__pyx_v_y_endpoints[0])) != 0); + if (!__pyx_t_13) { } else { - __pyx_t_13 = __pyx_t_14; + __pyx_t_12 = __pyx_t_13; goto __pyx_L9_bool_binop_done; } - __pyx_t_14 = ((__pyx_v_ypos > __pyx_v_edge1) != 0); - __pyx_t_13 = __pyx_t_14; + __pyx_t_13 = ((__pyx_v_ypos > (__pyx_v_y_endpoints[1])) != 0); + __pyx_t_12 = __pyx_t_13; __pyx_L9_bool_binop_done:; - if (__pyx_t_13) { + if (__pyx_t_12) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":163 + /* "yt/utilities/lib/particle_mesh_operations.pyx":166 * continue - * if (ypos < 0.5001) or (ypos > edge1): + * if (ypos < y_endpoints[0]) or (ypos > y_endpoints[1]): * continue # <<<<<<<<<<<<<< * - * i1 = (xpos + 0.5) + * for i in range(x_bin_edges.shape[0]): */ goto __pyx_L3_continue; - /* "yt/utilities/lib/particle_mesh_operations.pyx":162 - * if (xpos < 0.5001) or (xpos > edge0): + /* "yt/utilities/lib/particle_mesh_operations.pyx":165 + * if (xpos < x_endpoints[0]) or (xpos > x_endpoints[1]): * continue - * if (ypos < 0.5001) or (ypos > edge1): # <<<<<<<<<<<<<< + * if (ypos < y_endpoints[0]) or (ypos > y_endpoints[1]): # <<<<<<<<<<<<<< * continue * */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":165 + /* "yt/utilities/lib/particle_mesh_operations.pyx":168 * continue * - * i1 = (xpos + 0.5) # <<<<<<<<<<<<<< - * j1 = (ypos + 0.5) + * for i in range(x_bin_edges.shape[0]): # <<<<<<<<<<<<<< + * if (xpos >= x_bin_edges[i]) and (xpos < x_bin_edges[i+1]): + * i1 = i + */ + __pyx_t_14 = (__pyx_v_x_bin_edges.shape[0]); + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":169 + * + * for i in range(x_bin_edges.shape[0]): + * if (xpos >= x_bin_edges[i]) and (xpos < x_bin_edges[i+1]): # <<<<<<<<<<<<<< + * i1 = i + * break + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_13 = ((__pyx_v_xpos >= (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x_bin_edges.data + __pyx_t_16 * __pyx_v_x_bin_edges.strides[0]) )))) != 0); + if (__pyx_t_13) { + } else { + __pyx_t_12 = __pyx_t_13; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_17 = (__pyx_v_i + 1); + __pyx_t_13 = ((__pyx_v_xpos < (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x_bin_edges.data + __pyx_t_17 * __pyx_v_x_bin_edges.strides[0]) )))) != 0); + __pyx_t_12 = __pyx_t_13; + __pyx_L14_bool_binop_done:; + if (__pyx_t_12) { + + /* "yt/utilities/lib/particle_mesh_operations.pyx":170 + * for i in range(x_bin_edges.shape[0]): + * if (xpos >= x_bin_edges[i]) and (xpos < x_bin_edges[i+1]): + * i1 = i # <<<<<<<<<<<<<< + * break * */ - __pyx_v_i1 = ((int)(__pyx_v_xpos + 0.5)); + __pyx_v_i1 = __pyx_v_i; - /* "yt/utilities/lib/particle_mesh_operations.pyx":166 + /* "yt/utilities/lib/particle_mesh_operations.pyx":171 + * if (xpos >= x_bin_edges[i]) and (xpos < x_bin_edges[i+1]): + * i1 = i + * break # <<<<<<<<<<<<<< * - * i1 = (xpos + 0.5) - * j1 = (ypos + 0.5) # <<<<<<<<<<<<<< + * for j in range(y_bin_edges.shape[0]): + */ + goto __pyx_L12_break; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":169 + * + * for i in range(x_bin_edges.shape[0]): + * if (xpos >= x_bin_edges[i]) and (xpos < x_bin_edges[i+1]): # <<<<<<<<<<<<<< + * i1 = i + * break + */ + } + } + __pyx_L12_break:; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":173 + * break + * + * for j in range(y_bin_edges.shape[0]): # <<<<<<<<<<<<<< + * if (ypos >= y_bin_edges[j]) and (ypos < y_bin_edges[j+1]): + * j1 = j + */ + __pyx_t_14 = (__pyx_v_y_bin_edges.shape[0]); + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_j = __pyx_t_15; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":174 + * + * for j in range(y_bin_edges.shape[0]): + * if (ypos >= y_bin_edges[j]) and (ypos < y_bin_edges[j+1]): # <<<<<<<<<<<<<< + * j1 = j + * break + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = ((__pyx_v_ypos >= (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_y_bin_edges.data + __pyx_t_18 * __pyx_v_y_bin_edges.strides[0]) )))) != 0); + if (__pyx_t_13) { + } else { + __pyx_t_12 = __pyx_t_13; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_19 = (__pyx_v_j + 1); + __pyx_t_13 = ((__pyx_v_ypos < (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_y_bin_edges.data + __pyx_t_19 * __pyx_v_y_bin_edges.strides[0]) )))) != 0); + __pyx_t_12 = __pyx_t_13; + __pyx_L19_bool_binop_done:; + if (__pyx_t_12) { + + /* "yt/utilities/lib/particle_mesh_operations.pyx":175 + * for j in range(y_bin_edges.shape[0]): + * if (ypos >= y_bin_edges[j]) and (ypos < y_bin_edges[j+1]): + * j1 = j # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j1 = __pyx_v_j; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":176 + * if (ypos >= y_bin_edges[j]) and (ypos < y_bin_edges[j+1]): + * j1 = j + * break # <<<<<<<<<<<<<< * * # Deposit onto field */ - __pyx_v_j1 = ((int)(__pyx_v_ypos + 0.5)); + goto __pyx_L17_break; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":174 + * + * for j in range(y_bin_edges.shape[0]): + * if (ypos >= y_bin_edges[j]) and (ypos < y_bin_edges[j+1]): # <<<<<<<<<<<<<< + * j1 = j + * break + */ + } + } + __pyx_L17_break:; - /* "yt/utilities/lib/particle_mesh_operations.pyx":169 + /* "yt/utilities/lib/particle_mesh_operations.pyx":179 * * # Deposit onto field * field[i1,j1] += mass[n] # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_t_15 = __pyx_v_n; - __pyx_t_16 = __pyx_v_i1; - __pyx_t_17 = __pyx_v_j1; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_field.diminfo[1].strides) += (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mass.diminfo[0].strides)); + __pyx_t_20 = __pyx_v_n; + __pyx_t_21 = __pyx_v_i1; + __pyx_t_22 = __pyx_v_j1; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_field.data + __pyx_t_21 * __pyx_v_field.strides[0]) ) + __pyx_t_22 * __pyx_v_field.strides[1]) )) += (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_mass.data + __pyx_t_20 * __pyx_v_mass.strides[0]) ))); __pyx_L3_continue:; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":134 - * @cython.boundscheck(False) + /* "yt/utilities/lib/particle_mesh_operations.pyx":140 * @cython.wraparound(False) - * def NGPDeposit_2(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] posy, - * np.ndarray[np.float64_t, ndim=1] mass, + * @cython.cdivision(True) + * def NGPDeposit_2(np.float64_t[:] posx, # <<<<<<<<<<<<<< + * np.float64_t[:] posy, + * np.float64_t[:] mass, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cellSize.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gridDimension.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_leftEdge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mass.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_posx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_posy.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.particle_mesh_operations.NGPDeposit_2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cellSize.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gridDimension.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_leftEdge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mass.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_posx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_posy.rcbuffer->pybuffer); - __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_posx, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_posy, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_mass, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_field, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_x_bin_edges, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_bin_edges, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/particle_mesh_operations.pyx":174 +/* "yt/utilities/lib/particle_mesh_operations.pyx":184 * @cython.wraparound(False) * @cython.cdivision(True) * def sample_field_at_positions(np.ndarray[np.float64_t, ndim=3] arr, # <<<<<<<<<<<<<< @@ -3447,11 +4224,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -3460,34 +4243,39 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sample_field_at_positions", 1, 6, 6, 1); __PYX_ERR(0, 174, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("sample_field_at_positions", 1, 6, 6, 1); __PYX_ERR(0, 184, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sample_field_at_positions", 1, 6, 6, 2); __PYX_ERR(0, 174, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("sample_field_at_positions", 1, 6, 6, 2); __PYX_ERR(0, 184, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_x)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sample_field_at_positions", 1, 6, 6, 3); __PYX_ERR(0, 174, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("sample_field_at_positions", 1, 6, 6, 3); __PYX_ERR(0, 184, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sample_field_at_positions", 1, 6, 6, 4); __PYX_ERR(0, 174, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("sample_field_at_positions", 1, 6, 6, 4); __PYX_ERR(0, 184, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sample_field_at_positions", 1, 6, 6, 5); __PYX_ERR(0, 174, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("sample_field_at_positions", 1, 6, 6, 5); __PYX_ERR(0, 184, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sample_field_at_positions") < 0)) __PYX_ERR(0, 174, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sample_field_at_positions") < 0)) __PYX_ERR(0, 184, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -3508,18 +4296,18 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("sample_field_at_positions", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 174, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("sample_field_at_positions", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 184, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.particle_mesh_operations.sample_field_at_positions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 174, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 175, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 176, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_x), __pyx_ptype_5numpy_ndarray, 1, "pos_x", 0))) __PYX_ERR(0, 177, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_y), __pyx_ptype_5numpy_ndarray, 1, "pos_y", 0))) __PYX_ERR(0, 178, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_z), __pyx_ptype_5numpy_ndarray, 1, "pos_z", 0))) __PYX_ERR(0, 179, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 184, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 185, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 186, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_x), __pyx_ptype_5numpy_ndarray, 1, "pos_x", 0))) __PYX_ERR(0, 187, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_y), __pyx_ptype_5numpy_ndarray, 1, "pos_y", 0))) __PYX_ERR(0, 188, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_z), __pyx_ptype_5numpy_ndarray, 1, "pos_z", 0))) __PYX_ERR(0, 189, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_6sample_field_at_positions(__pyx_self, __pyx_v_arr, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_pos_x, __pyx_v_pos_y, __pyx_v_pos_z); /* function exit code */ @@ -3620,36 +4408,36 @@ __pyx_pybuffernd_pos_z.rcbuffer = &__pyx_pybuffer_pos_z; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 174, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 184, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 174, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 184, __pyx_L1_error) } __pyx_pybuffernd_left_edge.diminfo[0].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edge.diminfo[0].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 174, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 184, __pyx_L1_error) } __pyx_pybuffernd_right_edge.diminfo[0].strides = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edge.diminfo[0].shape = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 174, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 184, __pyx_L1_error) } __pyx_pybuffernd_pos_x.diminfo[0].strides = __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_x.diminfo[0].shape = __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 174, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 184, __pyx_L1_error) } __pyx_pybuffernd_pos_y.diminfo[0].strides = __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_y.diminfo[0].shape = __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 174, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 184, __pyx_L1_error) } __pyx_pybuffernd_pos_z.diminfo[0].strides = __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_z.diminfo[0].shape = __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/particle_mesh_operations.pyx":184 + /* "yt/utilities/lib/particle_mesh_operations.pyx":194 * cdef int ind[3] * cdef int i, npart * npart = pos_x.shape[0] # <<<<<<<<<<<<<< @@ -3658,34 +4446,34 @@ */ __pyx_v_npart = (__pyx_v_pos_x->dimensions[0]); - /* "yt/utilities/lib/particle_mesh_operations.pyx":186 + /* "yt/utilities/lib/particle_mesh_operations.pyx":196 * npart = pos_x.shape[0] * cdef np.ndarray[np.float64_t, ndim=1] sample * sample = np.zeros(npart, dtype='float64') # <<<<<<<<<<<<<< * for i in range(3): * dims[i] = arr.shape[i] */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __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, 186, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __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_npart); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_npart); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 186, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __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_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, 186, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 196, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3701,13 +4489,13 @@ } } __pyx_pybuffernd_sample.diminfo[0].strides = __pyx_pybuffernd_sample.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sample.diminfo[0].shape = __pyx_pybuffernd_sample.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 186, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 196, __pyx_L1_error) } __pyx_t_5 = 0; __pyx_v_sample = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":187 + /* "yt/utilities/lib/particle_mesh_operations.pyx":197 * cdef np.ndarray[np.float64_t, ndim=1] sample * sample = np.zeros(npart, dtype='float64') * for i in range(3): # <<<<<<<<<<<<<< @@ -3717,7 +4505,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "yt/utilities/lib/particle_mesh_operations.pyx":188 + /* "yt/utilities/lib/particle_mesh_operations.pyx":198 * sample = np.zeros(npart, dtype='float64') * for i in range(3): * dims[i] = arr.shape[i] # <<<<<<<<<<<<<< @@ -3726,7 +4514,7 @@ */ (__pyx_v_dims[__pyx_v_i]) = (__pyx_v_arr->dimensions[__pyx_v_i]); - /* "yt/utilities/lib/particle_mesh_operations.pyx":189 + /* "yt/utilities/lib/particle_mesh_operations.pyx":199 * for i in range(3): * dims[i] = arr.shape[i] * idds[i] = ( dims[i]) / (right_edge[i] - left_edge[i]) # <<<<<<<<<<<<<< @@ -3738,7 +4526,7 @@ (__pyx_v_idds[__pyx_v_i]) = (((__pyx_t_5numpy_float64_t)(__pyx_v_dims[__pyx_v_i])) / ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_right_edge.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_left_edge.diminfo[0].strides)))); } - /* "yt/utilities/lib/particle_mesh_operations.pyx":190 + /* "yt/utilities/lib/particle_mesh_operations.pyx":200 * dims[i] = arr.shape[i] * idds[i] = ( dims[i]) / (right_edge[i] - left_edge[i]) * for i in range(npart): # <<<<<<<<<<<<<< @@ -3749,7 +4537,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_6; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "yt/utilities/lib/particle_mesh_operations.pyx":191 + /* "yt/utilities/lib/particle_mesh_operations.pyx":201 * idds[i] = ( dims[i]) / (right_edge[i] - left_edge[i]) * for i in range(npart): * if not ((left_edge[0] <= pos_x[i] <= right_edge[0]) and # <<<<<<<<<<<<<< @@ -3771,7 +4559,7 @@ goto __pyx_L8_bool_binop_done; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":192 + /* "yt/utilities/lib/particle_mesh_operations.pyx":202 * for i in range(npart): * if not ((left_edge[0] <= pos_x[i] <= right_edge[0]) and * (left_edge[1] <= pos_y[i] <= right_edge[1]) and # <<<<<<<<<<<<<< @@ -3793,7 +4581,7 @@ goto __pyx_L8_bool_binop_done; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":193 + /* "yt/utilities/lib/particle_mesh_operations.pyx":203 * if not ((left_edge[0] <= pos_x[i] <= right_edge[0]) and * (left_edge[1] <= pos_y[i] <= right_edge[1]) and * (left_edge[2] <= pos_z[i] <= right_edge[2])): # <<<<<<<<<<<<<< @@ -3812,7 +4600,7 @@ __pyx_t_13 = __pyx_t_19; __pyx_L8_bool_binop_done:; - /* "yt/utilities/lib/particle_mesh_operations.pyx":191 + /* "yt/utilities/lib/particle_mesh_operations.pyx":201 * idds[i] = ( dims[i]) / (right_edge[i] - left_edge[i]) * for i in range(npart): * if not ((left_edge[0] <= pos_x[i] <= right_edge[0]) and # <<<<<<<<<<<<<< @@ -3822,7 +4610,7 @@ __pyx_t_19 = ((!__pyx_t_13) != 0); if (__pyx_t_19) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":194 + /* "yt/utilities/lib/particle_mesh_operations.pyx":204 * (left_edge[1] <= pos_y[i] <= right_edge[1]) and * (left_edge[2] <= pos_z[i] <= right_edge[2])): * continue # <<<<<<<<<<<<<< @@ -3831,7 +4619,7 @@ */ goto __pyx_L5_continue; - /* "yt/utilities/lib/particle_mesh_operations.pyx":191 + /* "yt/utilities/lib/particle_mesh_operations.pyx":201 * idds[i] = ( dims[i]) / (right_edge[i] - left_edge[i]) * for i in range(npart): * if not ((left_edge[0] <= pos_x[i] <= right_edge[0]) and # <<<<<<<<<<<<<< @@ -3840,7 +4628,7 @@ */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":195 + /* "yt/utilities/lib/particle_mesh_operations.pyx":205 * (left_edge[2] <= pos_z[i] <= right_edge[2])): * continue * ind[0] = ((pos_x[i] - left_edge[0]) * idds[0]) # <<<<<<<<<<<<<< @@ -3851,7 +4639,7 @@ __pyx_t_27 = 0; (__pyx_v_ind[0]) = ((int)(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_pos_x.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_left_edge.diminfo[0].strides))) * (__pyx_v_idds[0]))); - /* "yt/utilities/lib/particle_mesh_operations.pyx":196 + /* "yt/utilities/lib/particle_mesh_operations.pyx":206 * continue * ind[0] = ((pos_x[i] - left_edge[0]) * idds[0]) * ind[1] = ((pos_y[i] - left_edge[1]) * idds[1]) # <<<<<<<<<<<<<< @@ -3862,7 +4650,7 @@ __pyx_t_29 = 1; (__pyx_v_ind[1]) = ((int)(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_pos_y.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_left_edge.diminfo[0].strides))) * (__pyx_v_idds[1]))); - /* "yt/utilities/lib/particle_mesh_operations.pyx":197 + /* "yt/utilities/lib/particle_mesh_operations.pyx":207 * ind[0] = ((pos_x[i] - left_edge[0]) * idds[0]) * ind[1] = ((pos_y[i] - left_edge[1]) * idds[1]) * ind[2] = ((pos_z[i] - left_edge[2]) * idds[2]) # <<<<<<<<<<<<<< @@ -3873,7 +4661,7 @@ __pyx_t_31 = 2; (__pyx_v_ind[2]) = ((int)(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_pos_z.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_left_edge.diminfo[0].strides))) * (__pyx_v_idds[2]))); - /* "yt/utilities/lib/particle_mesh_operations.pyx":198 + /* "yt/utilities/lib/particle_mesh_operations.pyx":208 * ind[1] = ((pos_y[i] - left_edge[1]) * idds[1]) * ind[2] = ((pos_z[i] - left_edge[2]) * idds[2]) * sample[i] = arr[ind[0], ind[1], ind[2]] # <<<<<<<<<<<<<< @@ -3888,7 +4676,7 @@ __pyx_L5_continue:; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":199 + /* "yt/utilities/lib/particle_mesh_operations.pyx":209 * ind[2] = ((pos_z[i] - left_edge[2]) * idds[2]) * sample[i] = arr[ind[0], ind[1], ind[2]] * return sample # <<<<<<<<<<<<<< @@ -3900,7 +4688,7 @@ __pyx_r = ((PyObject *)__pyx_v_sample); goto __pyx_L0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":174 + /* "yt/utilities/lib/particle_mesh_operations.pyx":184 * @cython.wraparound(False) * @cython.cdivision(True) * def sample_field_at_positions(np.ndarray[np.float64_t, ndim=3] arr, # <<<<<<<<<<<<<< @@ -3944,7 +4732,7 @@ return __pyx_r; } -/* "yt/utilities/lib/particle_mesh_operations.pyx":204 +/* "yt/utilities/lib/particle_mesh_operations.pyx":214 * @cython.wraparound(False) * @cython.cdivision(True) * def CICSample_3(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< @@ -3976,14 +4764,23 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -3992,49 +4789,57 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_posx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_posy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 1); __PYX_ERR(0, 204, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 1); __PYX_ERR(0, 214, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_posz)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 2); __PYX_ERR(0, 204, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 2); __PYX_ERR(0, 214, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sample)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 3); __PYX_ERR(0, 204, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 3); __PYX_ERR(0, 214, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_npositions)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 4); __PYX_ERR(0, 204, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 4); __PYX_ERR(0, 214, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 5); __PYX_ERR(0, 204, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 5); __PYX_ERR(0, 214, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_leftEdge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 6); __PYX_ERR(0, 204, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 6); __PYX_ERR(0, 214, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gridDimension)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 7); __PYX_ERR(0, 204, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 7); __PYX_ERR(0, 214, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cellSize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 8); __PYX_ERR(0, 204, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, 8); __PYX_ERR(0, 214, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CICSample_3") < 0)) __PYX_ERR(0, 204, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CICSample_3") < 0)) __PYX_ERR(0, 214, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; @@ -4053,27 +4858,27 @@ __pyx_v_posy = ((PyArrayObject *)values[1]); __pyx_v_posz = ((PyArrayObject *)values[2]); __pyx_v_sample = ((PyArrayObject *)values[3]); - __pyx_v_npositions = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_npositions == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L3_error) + __pyx_v_npositions = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_npositions == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L3_error) __pyx_v_field = ((PyArrayObject *)values[5]); __pyx_v_leftEdge = ((PyArrayObject *)values[6]); __pyx_v_gridDimension = ((PyArrayObject *)values[7]); - __pyx_v_cellSize = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_cellSize == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) + __pyx_v_cellSize = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_cellSize == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 204, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CICSample_3", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 214, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.particle_mesh_operations.CICSample_3", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posx), __pyx_ptype_5numpy_ndarray, 1, "posx", 0))) __PYX_ERR(0, 204, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posy), __pyx_ptype_5numpy_ndarray, 1, "posy", 0))) __PYX_ERR(0, 205, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posz), __pyx_ptype_5numpy_ndarray, 1, "posz", 0))) __PYX_ERR(0, 206, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample), __pyx_ptype_5numpy_ndarray, 1, "sample", 0))) __PYX_ERR(0, 207, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_5numpy_ndarray, 1, "field", 0))) __PYX_ERR(0, 209, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leftEdge), __pyx_ptype_5numpy_ndarray, 1, "leftEdge", 0))) __PYX_ERR(0, 210, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gridDimension), __pyx_ptype_5numpy_ndarray, 1, "gridDimension", 0))) __PYX_ERR(0, 211, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posx), __pyx_ptype_5numpy_ndarray, 1, "posx", 0))) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posy), __pyx_ptype_5numpy_ndarray, 1, "posy", 0))) __PYX_ERR(0, 215, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_posz), __pyx_ptype_5numpy_ndarray, 1, "posz", 0))) __PYX_ERR(0, 216, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample), __pyx_ptype_5numpy_ndarray, 1, "sample", 0))) __PYX_ERR(0, 217, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_5numpy_ndarray, 1, "field", 0))) __PYX_ERR(0, 219, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leftEdge), __pyx_ptype_5numpy_ndarray, 1, "leftEdge", 0))) __PYX_ERR(0, 220, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gridDimension), __pyx_ptype_5numpy_ndarray, 1, "gridDimension", 0))) __PYX_ERR(0, 221, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_8CICSample_3(__pyx_self, __pyx_v_posx, __pyx_v_posy, __pyx_v_posz, __pyx_v_sample, __pyx_v_npositions, __pyx_v_field, __pyx_v_leftEdge, __pyx_v_gridDimension, __pyx_v_cellSize); /* function exit code */ @@ -4191,41 +4996,41 @@ __pyx_pybuffernd_gridDimension.rcbuffer = &__pyx_pybuffer_gridDimension; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posx.rcbuffer->pybuffer, (PyObject*)__pyx_v_posx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posx.rcbuffer->pybuffer, (PyObject*)__pyx_v_posx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) } __pyx_pybuffernd_posx.diminfo[0].strides = __pyx_pybuffernd_posx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_posx.diminfo[0].shape = __pyx_pybuffernd_posx.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posy.rcbuffer->pybuffer, (PyObject*)__pyx_v_posy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posy.rcbuffer->pybuffer, (PyObject*)__pyx_v_posy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) } __pyx_pybuffernd_posy.diminfo[0].strides = __pyx_pybuffernd_posy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_posy.diminfo[0].shape = __pyx_pybuffernd_posy.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posz.rcbuffer->pybuffer, (PyObject*)__pyx_v_posz, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_posz.rcbuffer->pybuffer, (PyObject*)__pyx_v_posz, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) } __pyx_pybuffernd_posz.diminfo[0].strides = __pyx_pybuffernd_posz.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_posz.diminfo[0].shape = __pyx_pybuffernd_posz.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sample.rcbuffer->pybuffer, (PyObject*)__pyx_v_sample, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sample.rcbuffer->pybuffer, (PyObject*)__pyx_v_sample, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) } __pyx_pybuffernd_sample.diminfo[0].strides = __pyx_pybuffernd_sample.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sample.diminfo[0].shape = __pyx_pybuffernd_sample.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) } __pyx_pybuffernd_field.diminfo[0].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field.diminfo[0].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_field.diminfo[1].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_field.diminfo[1].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_field.diminfo[2].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_field.diminfo[2].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[2]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_leftEdge.rcbuffer->pybuffer, (PyObject*)__pyx_v_leftEdge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_leftEdge.rcbuffer->pybuffer, (PyObject*)__pyx_v_leftEdge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) } __pyx_pybuffernd_leftEdge.diminfo[0].strides = __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_leftEdge.diminfo[0].shape = __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gridDimension.rcbuffer->pybuffer, (PyObject*)__pyx_v_gridDimension, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gridDimension.rcbuffer->pybuffer, (PyObject*)__pyx_v_gridDimension, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) } __pyx_pybuffernd_gridDimension.diminfo[0].strides = __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gridDimension.diminfo[0].shape = __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/particle_mesh_operations.pyx":220 + /* "yt/utilities/lib/particle_mesh_operations.pyx":230 * cdef np.float64_t dx, dy, dz, dx2, dy2, dz2 * * edge0 = ( gridDimension[0]) - 0.5001 # <<<<<<<<<<<<<< @@ -4235,7 +5040,7 @@ __pyx_t_1 = 0; __pyx_v_edge0 = (((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_gridDimension.diminfo[0].strides))) - 0.5001); - /* "yt/utilities/lib/particle_mesh_operations.pyx":221 + /* "yt/utilities/lib/particle_mesh_operations.pyx":231 * * edge0 = ( gridDimension[0]) - 0.5001 * edge1 = ( gridDimension[1]) - 0.5001 # <<<<<<<<<<<<<< @@ -4245,7 +5050,7 @@ __pyx_t_2 = 1; __pyx_v_edge1 = (((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_gridDimension.diminfo[0].strides))) - 0.5001); - /* "yt/utilities/lib/particle_mesh_operations.pyx":222 + /* "yt/utilities/lib/particle_mesh_operations.pyx":232 * edge0 = ( gridDimension[0]) - 0.5001 * edge1 = ( gridDimension[1]) - 0.5001 * edge2 = ( gridDimension[2]) - 0.5001 # <<<<<<<<<<<<<< @@ -4255,7 +5060,7 @@ __pyx_t_3 = 2; __pyx_v_edge2 = (((__pyx_t_5numpy_float64_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_gridDimension.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_gridDimension.diminfo[0].strides))) - 0.5001); - /* "yt/utilities/lib/particle_mesh_operations.pyx":223 + /* "yt/utilities/lib/particle_mesh_operations.pyx":233 * edge1 = ( gridDimension[1]) - 0.5001 * edge2 = ( gridDimension[2]) - 0.5001 * fact = 1.0 / cellSize # <<<<<<<<<<<<<< @@ -4264,7 +5069,7 @@ */ __pyx_v_fact = (1.0 / __pyx_v_cellSize); - /* "yt/utilities/lib/particle_mesh_operations.pyx":225 + /* "yt/utilities/lib/particle_mesh_operations.pyx":235 * fact = 1.0 / cellSize * * le0 = leftEdge[0] # <<<<<<<<<<<<<< @@ -4274,7 +5079,7 @@ __pyx_t_4 = 0; __pyx_v_le0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_leftEdge.diminfo[0].strides)); - /* "yt/utilities/lib/particle_mesh_operations.pyx":226 + /* "yt/utilities/lib/particle_mesh_operations.pyx":236 * * le0 = leftEdge[0] * le1 = leftEdge[1] # <<<<<<<<<<<<<< @@ -4284,7 +5089,7 @@ __pyx_t_5 = 1; __pyx_v_le1 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_leftEdge.diminfo[0].strides)); - /* "yt/utilities/lib/particle_mesh_operations.pyx":227 + /* "yt/utilities/lib/particle_mesh_operations.pyx":237 * le0 = leftEdge[0] * le1 = leftEdge[1] * le2 = leftEdge[2] # <<<<<<<<<<<<<< @@ -4294,7 +5099,7 @@ __pyx_t_6 = 2; __pyx_v_le2 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftEdge.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_leftEdge.diminfo[0].strides)); - /* "yt/utilities/lib/particle_mesh_operations.pyx":229 + /* "yt/utilities/lib/particle_mesh_operations.pyx":239 * le2 = leftEdge[2] * * for n in range(npositions): # <<<<<<<<<<<<<< @@ -4305,7 +5110,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_n = __pyx_t_8; - /* "yt/utilities/lib/particle_mesh_operations.pyx":233 + /* "yt/utilities/lib/particle_mesh_operations.pyx":243 * # Compute the position of the central cell * * xpos = (posx[n]-le0)*fact # <<<<<<<<<<<<<< @@ -4315,7 +5120,7 @@ __pyx_t_9 = __pyx_v_n; __pyx_v_xpos = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_posx.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_posx.diminfo[0].strides)) - __pyx_v_le0) * __pyx_v_fact); - /* "yt/utilities/lib/particle_mesh_operations.pyx":234 + /* "yt/utilities/lib/particle_mesh_operations.pyx":244 * * xpos = (posx[n]-le0)*fact * ypos = (posy[n]-le1)*fact # <<<<<<<<<<<<<< @@ -4325,7 +5130,7 @@ __pyx_t_10 = __pyx_v_n; __pyx_v_ypos = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_posy.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_posy.diminfo[0].strides)) - __pyx_v_le1) * __pyx_v_fact); - /* "yt/utilities/lib/particle_mesh_operations.pyx":235 + /* "yt/utilities/lib/particle_mesh_operations.pyx":245 * xpos = (posx[n]-le0)*fact * ypos = (posy[n]-le1)*fact * zpos = (posz[n]-le2)*fact # <<<<<<<<<<<<<< @@ -4335,7 +5140,7 @@ __pyx_t_11 = __pyx_v_n; __pyx_v_zpos = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_posz.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_posz.diminfo[0].strides)) - __pyx_v_le2) * __pyx_v_fact); - /* "yt/utilities/lib/particle_mesh_operations.pyx":237 + /* "yt/utilities/lib/particle_mesh_operations.pyx":247 * zpos = (posz[n]-le2)*fact * * if (xpos < -1 or ypos < -1 or zpos < -1 or # <<<<<<<<<<<<<< @@ -4361,7 +5166,7 @@ goto __pyx_L6_bool_binop_done; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":238 + /* "yt/utilities/lib/particle_mesh_operations.pyx":248 * * if (xpos < -1 or ypos < -1 or zpos < -1 or * xpos >= edge0+1.5001 or ypos >= edge1+1.5001 or zpos >= edge2+1.5001): # <<<<<<<<<<<<<< @@ -4384,7 +5189,7 @@ __pyx_t_12 = __pyx_t_13; __pyx_L6_bool_binop_done:; - /* "yt/utilities/lib/particle_mesh_operations.pyx":237 + /* "yt/utilities/lib/particle_mesh_operations.pyx":247 * zpos = (posz[n]-le2)*fact * * if (xpos < -1 or ypos < -1 or zpos < -1 or # <<<<<<<<<<<<<< @@ -4393,7 +5198,7 @@ */ if (__pyx_t_12) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":239 + /* "yt/utilities/lib/particle_mesh_operations.pyx":249 * if (xpos < -1 or ypos < -1 or zpos < -1 or * xpos >= edge0+1.5001 or ypos >= edge1+1.5001 or zpos >= edge2+1.5001): * continue # <<<<<<<<<<<<<< @@ -4402,7 +5207,7 @@ */ goto __pyx_L3_continue; - /* "yt/utilities/lib/particle_mesh_operations.pyx":237 + /* "yt/utilities/lib/particle_mesh_operations.pyx":247 * zpos = (posz[n]-le2)*fact * * if (xpos < -1 or ypos < -1 or zpos < -1 or # <<<<<<<<<<<<<< @@ -4411,7 +5216,7 @@ */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":241 + /* "yt/utilities/lib/particle_mesh_operations.pyx":251 * continue * * xpos = fclip(xpos, 0.5001, edge0) # <<<<<<<<<<<<<< @@ -4420,7 +5225,7 @@ */ __pyx_v_xpos = __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_v_xpos, 0.5001, __pyx_v_edge0); - /* "yt/utilities/lib/particle_mesh_operations.pyx":242 + /* "yt/utilities/lib/particle_mesh_operations.pyx":252 * * xpos = fclip(xpos, 0.5001, edge0) * ypos = fclip(ypos, 0.5001, edge1) # <<<<<<<<<<<<<< @@ -4429,7 +5234,7 @@ */ __pyx_v_ypos = __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_v_ypos, 0.5001, __pyx_v_edge1); - /* "yt/utilities/lib/particle_mesh_operations.pyx":243 + /* "yt/utilities/lib/particle_mesh_operations.pyx":253 * xpos = fclip(xpos, 0.5001, edge0) * ypos = fclip(ypos, 0.5001, edge1) * zpos = fclip(zpos, 0.5001, edge2) # <<<<<<<<<<<<<< @@ -4438,7 +5243,7 @@ */ __pyx_v_zpos = __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_v_zpos, 0.5001, __pyx_v_edge2); - /* "yt/utilities/lib/particle_mesh_operations.pyx":245 + /* "yt/utilities/lib/particle_mesh_operations.pyx":255 * zpos = fclip(zpos, 0.5001, edge2) * * i1 = (xpos + 0.5) # <<<<<<<<<<<<<< @@ -4447,7 +5252,7 @@ */ __pyx_v_i1 = ((int)(__pyx_v_xpos + 0.5)); - /* "yt/utilities/lib/particle_mesh_operations.pyx":246 + /* "yt/utilities/lib/particle_mesh_operations.pyx":256 * * i1 = (xpos + 0.5) * j1 = (ypos + 0.5) # <<<<<<<<<<<<<< @@ -4456,7 +5261,7 @@ */ __pyx_v_j1 = ((int)(__pyx_v_ypos + 0.5)); - /* "yt/utilities/lib/particle_mesh_operations.pyx":247 + /* "yt/utilities/lib/particle_mesh_operations.pyx":257 * i1 = (xpos + 0.5) * j1 = (ypos + 0.5) * k1 = (zpos + 0.5) # <<<<<<<<<<<<<< @@ -4465,7 +5270,7 @@ */ __pyx_v_k1 = ((int)(__pyx_v_zpos + 0.5)); - /* "yt/utilities/lib/particle_mesh_operations.pyx":250 + /* "yt/utilities/lib/particle_mesh_operations.pyx":260 * * # Compute the weights * dx = ( i1) + 0.5 - xpos # <<<<<<<<<<<<<< @@ -4474,7 +5279,7 @@ */ __pyx_v_dx = ((((float)__pyx_v_i1) + 0.5) - __pyx_v_xpos); - /* "yt/utilities/lib/particle_mesh_operations.pyx":251 + /* "yt/utilities/lib/particle_mesh_operations.pyx":261 * # Compute the weights * dx = ( i1) + 0.5 - xpos * dy = ( j1) + 0.5 - ypos # <<<<<<<<<<<<<< @@ -4483,7 +5288,7 @@ */ __pyx_v_dy = ((((float)__pyx_v_j1) + 0.5) - __pyx_v_ypos); - /* "yt/utilities/lib/particle_mesh_operations.pyx":252 + /* "yt/utilities/lib/particle_mesh_operations.pyx":262 * dx = ( i1) + 0.5 - xpos * dy = ( j1) + 0.5 - ypos * dz = ( k1) + 0.5 - zpos # <<<<<<<<<<<<<< @@ -4492,7 +5297,7 @@ */ __pyx_v_dz = ((((float)__pyx_v_k1) + 0.5) - __pyx_v_zpos); - /* "yt/utilities/lib/particle_mesh_operations.pyx":253 + /* "yt/utilities/lib/particle_mesh_operations.pyx":263 * dy = ( j1) + 0.5 - ypos * dz = ( k1) + 0.5 - zpos * dx2 = 1.0 - dx # <<<<<<<<<<<<<< @@ -4501,7 +5306,7 @@ */ __pyx_v_dx2 = (1.0 - __pyx_v_dx); - /* "yt/utilities/lib/particle_mesh_operations.pyx":254 + /* "yt/utilities/lib/particle_mesh_operations.pyx":264 * dz = ( k1) + 0.5 - zpos * dx2 = 1.0 - dx * dy2 = 1.0 - dy # <<<<<<<<<<<<<< @@ -4510,7 +5315,7 @@ */ __pyx_v_dy2 = (1.0 - __pyx_v_dy); - /* "yt/utilities/lib/particle_mesh_operations.pyx":255 + /* "yt/utilities/lib/particle_mesh_operations.pyx":265 * dx2 = 1.0 - dx * dy2 = 1.0 - dy * dz2 = 1.0 - dz # <<<<<<<<<<<<<< @@ -4519,7 +5324,7 @@ */ __pyx_v_dz2 = (1.0 - __pyx_v_dz); - /* "yt/utilities/lib/particle_mesh_operations.pyx":258 + /* "yt/utilities/lib/particle_mesh_operations.pyx":268 * * # Interpolate from field onto the particle * sample[n] = (field[i1-1,j1-1,k1-1] * dx * dy * dz + # <<<<<<<<<<<<<< @@ -4530,7 +5335,7 @@ __pyx_t_15 = (__pyx_v_j1 - 1); __pyx_t_16 = (__pyx_v_k1 - 1); - /* "yt/utilities/lib/particle_mesh_operations.pyx":259 + /* "yt/utilities/lib/particle_mesh_operations.pyx":269 * # Interpolate from field onto the particle * sample[n] = (field[i1-1,j1-1,k1-1] * dx * dy * dz + * field[i1 ,j1-1,k1-1] * dx2 * dy * dz + # <<<<<<<<<<<<<< @@ -4541,7 +5346,7 @@ __pyx_t_18 = (__pyx_v_j1 - 1); __pyx_t_19 = (__pyx_v_k1 - 1); - /* "yt/utilities/lib/particle_mesh_operations.pyx":260 + /* "yt/utilities/lib/particle_mesh_operations.pyx":270 * sample[n] = (field[i1-1,j1-1,k1-1] * dx * dy * dz + * field[i1 ,j1-1,k1-1] * dx2 * dy * dz + * field[i1-1,j1 ,k1-1] * dx * dy2 * dz + # <<<<<<<<<<<<<< @@ -4552,7 +5357,7 @@ __pyx_t_21 = __pyx_v_j1; __pyx_t_22 = (__pyx_v_k1 - 1); - /* "yt/utilities/lib/particle_mesh_operations.pyx":261 + /* "yt/utilities/lib/particle_mesh_operations.pyx":271 * field[i1 ,j1-1,k1-1] * dx2 * dy * dz + * field[i1-1,j1 ,k1-1] * dx * dy2 * dz + * field[i1 ,j1 ,k1-1] * dx2 * dy2 * dz + # <<<<<<<<<<<<<< @@ -4563,7 +5368,7 @@ __pyx_t_24 = __pyx_v_j1; __pyx_t_25 = (__pyx_v_k1 - 1); - /* "yt/utilities/lib/particle_mesh_operations.pyx":262 + /* "yt/utilities/lib/particle_mesh_operations.pyx":272 * field[i1-1,j1 ,k1-1] * dx * dy2 * dz + * field[i1 ,j1 ,k1-1] * dx2 * dy2 * dz + * field[i1-1,j1-1,k1 ] * dx * dy * dz2 + # <<<<<<<<<<<<<< @@ -4574,7 +5379,7 @@ __pyx_t_27 = (__pyx_v_j1 - 1); __pyx_t_28 = __pyx_v_k1; - /* "yt/utilities/lib/particle_mesh_operations.pyx":263 + /* "yt/utilities/lib/particle_mesh_operations.pyx":273 * field[i1 ,j1 ,k1-1] * dx2 * dy2 * dz + * field[i1-1,j1-1,k1 ] * dx * dy * dz2 + * field[i1 ,j1-1,k1 ] * dx2 * dy * dz2 + # <<<<<<<<<<<<<< @@ -4585,7 +5390,7 @@ __pyx_t_30 = (__pyx_v_j1 - 1); __pyx_t_31 = __pyx_v_k1; - /* "yt/utilities/lib/particle_mesh_operations.pyx":264 + /* "yt/utilities/lib/particle_mesh_operations.pyx":274 * field[i1-1,j1-1,k1 ] * dx * dy * dz2 + * field[i1 ,j1-1,k1 ] * dx2 * dy * dz2 + * field[i1-1,j1 ,k1 ] * dx * dy2 * dz2 + # <<<<<<<<<<<<<< @@ -4596,7 +5401,7 @@ __pyx_t_33 = __pyx_v_j1; __pyx_t_34 = __pyx_v_k1; - /* "yt/utilities/lib/particle_mesh_operations.pyx":265 + /* "yt/utilities/lib/particle_mesh_operations.pyx":275 * field[i1 ,j1-1,k1 ] * dx2 * dy * dz2 + * field[i1-1,j1 ,k1 ] * dx * dy2 * dz2 + * field[i1 ,j1 ,k1 ] * dx2 * dy2 * dz2) # <<<<<<<<<<<<<< @@ -4607,7 +5412,7 @@ __pyx_t_36 = __pyx_v_j1; __pyx_t_37 = __pyx_v_k1; - /* "yt/utilities/lib/particle_mesh_operations.pyx":258 + /* "yt/utilities/lib/particle_mesh_operations.pyx":268 * * # Interpolate from field onto the particle * sample[n] = (field[i1-1,j1-1,k1-1] * dx * dy * dz + # <<<<<<<<<<<<<< @@ -4619,7 +5424,7 @@ __pyx_L3_continue:; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":204 + /* "yt/utilities/lib/particle_mesh_operations.pyx":214 * @cython.wraparound(False) * @cython.cdivision(True) * def CICSample_3(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< @@ -4660,7 +5465,7 @@ return __pyx_r; } -/* "yt/utilities/lib/particle_mesh_operations.pyx":270 +/* "yt/utilities/lib/particle_mesh_operations.pyx":280 * @cython.wraparound(False) * @cython.cdivision(True) * def assign_particles_to_cells(np.ndarray[np.int32_t, ndim=1] levels, #for cells # <<<<<<<<<<<<<< @@ -4689,11 +5494,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -4702,34 +5513,39 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cells", 1, 6, 6, 1); __PYX_ERR(0, 270, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cells", 1, 6, 6, 1); __PYX_ERR(0, 280, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cells", 1, 6, 6, 2); __PYX_ERR(0, 270, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cells", 1, 6, 6, 2); __PYX_ERR(0, 280, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_x)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cells", 1, 6, 6, 3); __PYX_ERR(0, 270, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cells", 1, 6, 6, 3); __PYX_ERR(0, 280, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cells", 1, 6, 6, 4); __PYX_ERR(0, 270, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cells", 1, 6, 6, 4); __PYX_ERR(0, 280, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cells", 1, 6, 6, 5); __PYX_ERR(0, 270, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cells", 1, 6, 6, 5); __PYX_ERR(0, 280, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assign_particles_to_cells") < 0)) __PYX_ERR(0, 270, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assign_particles_to_cells") < 0)) __PYX_ERR(0, 280, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -4750,18 +5566,18 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cells", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 270, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cells", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 280, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.particle_mesh_operations.assign_particles_to_cells", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 270, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 271, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 272, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_x), __pyx_ptype_5numpy_ndarray, 1, "pos_x", 0))) __PYX_ERR(0, 273, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_y), __pyx_ptype_5numpy_ndarray, 1, "pos_y", 0))) __PYX_ERR(0, 274, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_z), __pyx_ptype_5numpy_ndarray, 1, "pos_z", 0))) __PYX_ERR(0, 275, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 280, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 281, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 282, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_x), __pyx_ptype_5numpy_ndarray, 1, "pos_x", 0))) __PYX_ERR(0, 283, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_y), __pyx_ptype_5numpy_ndarray, 1, "pos_y", 0))) __PYX_ERR(0, 284, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_z), __pyx_ptype_5numpy_ndarray, 1, "pos_z", 0))) __PYX_ERR(0, 285, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_10assign_particles_to_cells(__pyx_self, __pyx_v_levels, __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_pos_x, __pyx_v_pos_y, __pyx_v_pos_z); /* function exit code */ @@ -4859,45 +5675,45 @@ __pyx_pybuffernd_pos_z.rcbuffer = &__pyx_pybuffer_pos_z; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 270, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 280, __pyx_L1_error) } __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 270, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 280, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 270, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 280, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 270, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 280, __pyx_L1_error) } __pyx_pybuffernd_pos_x.diminfo[0].strides = __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_x.diminfo[0].shape = __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 270, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 280, __pyx_L1_error) } __pyx_pybuffernd_pos_y.diminfo[0].strides = __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_y.diminfo[0].shape = __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 270, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 280, __pyx_L1_error) } __pyx_pybuffernd_pos_z.diminfo[0].strides = __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_z.diminfo[0].shape = __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/particle_mesh_operations.pyx":278 + /* "yt/utilities/lib/particle_mesh_operations.pyx":288 * #for every cell, assign the particles belonging to it, * #skipping previously assigned particles * cdef long level_max = np.max(levels) # <<<<<<<<<<<<<< * cdef long i,j,level * cdef long npart = pos_x.shape[0] */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -4911,13 +5727,13 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_levels)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_levels)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __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_2, ((PyObject *)__pyx_v_levels)}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __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, 288, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -4925,29 +5741,29 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_levels)}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __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, 288, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_levels)); __Pyx_GIVEREF(((PyObject *)__pyx_v_levels)); PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_levels)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_level_max = __pyx_t_5; - /* "yt/utilities/lib/particle_mesh_operations.pyx":280 + /* "yt/utilities/lib/particle_mesh_operations.pyx":290 * cdef long level_max = np.max(levels) * cdef long i,j,level * cdef long npart = pos_x.shape[0] # <<<<<<<<<<<<<< @@ -4956,7 +5772,7 @@ */ __pyx_v_npart = (__pyx_v_pos_x->dimensions[0]); - /* "yt/utilities/lib/particle_mesh_operations.pyx":281 + /* "yt/utilities/lib/particle_mesh_operations.pyx":291 * cdef long i,j,level * cdef long npart = pos_x.shape[0] * cdef long ncells = left_edges.shape[0] # <<<<<<<<<<<<<< @@ -4965,43 +5781,43 @@ */ __pyx_v_ncells = (__pyx_v_left_edges->dimensions[0]); - /* "yt/utilities/lib/particle_mesh_operations.pyx":282 + /* "yt/utilities/lib/particle_mesh_operations.pyx":292 * cdef long npart = pos_x.shape[0] * cdef long ncells = left_edges.shape[0] * cdef np.ndarray[np.int32_t, ndim=1] assign = np.zeros(npart,dtype='int32')-1 # <<<<<<<<<<<<<< * for level in range(level_max,0,-1): * #start with the finest level */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_npart); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_npart); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 282, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __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, 282, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 292, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_assign.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_assign = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_assign.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 282, __pyx_L1_error) + __PYX_ERR(0, 292, __pyx_L1_error) } else {__pyx_pybuffernd_assign.diminfo[0].strides = __pyx_pybuffernd_assign.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_assign.diminfo[0].shape = __pyx_pybuffernd_assign.rcbuffer->pybuffer.shape[0]; } } @@ -5009,7 +5825,7 @@ __pyx_v_assign = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":283 + /* "yt/utilities/lib/particle_mesh_operations.pyx":293 * cdef long ncells = left_edges.shape[0] * cdef np.ndarray[np.int32_t, ndim=1] assign = np.zeros(npart,dtype='int32')-1 * for level in range(level_max,0,-1): # <<<<<<<<<<<<<< @@ -5019,7 +5835,7 @@ for (__pyx_t_5 = __pyx_v_level_max; __pyx_t_5 > 0; __pyx_t_5-=1) { __pyx_v_level = __pyx_t_5; - /* "yt/utilities/lib/particle_mesh_operations.pyx":285 + /* "yt/utilities/lib/particle_mesh_operations.pyx":295 * for level in range(level_max,0,-1): * #start with the finest level * for i in range(ncells): # <<<<<<<<<<<<<< @@ -5030,7 +5846,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "yt/utilities/lib/particle_mesh_operations.pyx":287 + /* "yt/utilities/lib/particle_mesh_operations.pyx":297 * for i in range(ncells): * #go through every cell on the finest level first * if not levels[i] == level: continue # <<<<<<<<<<<<<< @@ -5043,7 +5859,7 @@ goto __pyx_L5_continue; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":288 + /* "yt/utilities/lib/particle_mesh_operations.pyx":298 * #go through every cell on the finest level first * if not levels[i] == level: continue * for j in range(npart): # <<<<<<<<<<<<<< @@ -5054,7 +5870,7 @@ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_j = __pyx_t_12; - /* "yt/utilities/lib/particle_mesh_operations.pyx":290 + /* "yt/utilities/lib/particle_mesh_operations.pyx":300 * for j in range(npart): * #iterate over all particles, skip if assigned * if assign[j]>-1: continue # <<<<<<<<<<<<<< @@ -5067,7 +5883,7 @@ goto __pyx_L8_continue; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":291 + /* "yt/utilities/lib/particle_mesh_operations.pyx":301 * #iterate over all particles, skip if assigned * if assign[j]>-1: continue * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): # <<<<<<<<<<<<<< @@ -5087,7 +5903,7 @@ __pyx_t_20 = (__pyx_t_10 != 0); if (__pyx_t_20) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":292 + /* "yt/utilities/lib/particle_mesh_operations.pyx":302 * if assign[j]>-1: continue * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): # <<<<<<<<<<<<<< @@ -5107,7 +5923,7 @@ __pyx_t_10 = (__pyx_t_20 != 0); if (__pyx_t_10) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":293 + /* "yt/utilities/lib/particle_mesh_operations.pyx":303 * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): * if (left_edges[i,2] <= pos_z[j] <= right_edges[i,2]): # <<<<<<<<<<<<<< @@ -5127,7 +5943,7 @@ __pyx_t_20 = (__pyx_t_10 != 0); if (__pyx_t_20) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":294 + /* "yt/utilities/lib/particle_mesh_operations.pyx":304 * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): * if (left_edges[i,2] <= pos_z[j] <= right_edges[i,2]): * assign[j]=i # <<<<<<<<<<<<<< @@ -5137,7 +5953,7 @@ __pyx_t_31 = __pyx_v_j; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_assign.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_assign.diminfo[0].strides) = __pyx_v_i; - /* "yt/utilities/lib/particle_mesh_operations.pyx":293 + /* "yt/utilities/lib/particle_mesh_operations.pyx":303 * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): * if (left_edges[i,2] <= pos_z[j] <= right_edges[i,2]): # <<<<<<<<<<<<<< @@ -5146,7 +5962,7 @@ */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":292 + /* "yt/utilities/lib/particle_mesh_operations.pyx":302 * if assign[j]>-1: continue * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): # <<<<<<<<<<<<<< @@ -5155,7 +5971,7 @@ */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":291 + /* "yt/utilities/lib/particle_mesh_operations.pyx":301 * #iterate over all particles, skip if assigned * if assign[j]>-1: continue * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): # <<<<<<<<<<<<<< @@ -5169,7 +5985,7 @@ } } - /* "yt/utilities/lib/particle_mesh_operations.pyx":295 + /* "yt/utilities/lib/particle_mesh_operations.pyx":305 * if (left_edges[i,2] <= pos_z[j] <= right_edges[i,2]): * assign[j]=i * return assign # <<<<<<<<<<<<<< @@ -5181,7 +5997,7 @@ __pyx_r = ((PyObject *)__pyx_v_assign); goto __pyx_L0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":270 + /* "yt/utilities/lib/particle_mesh_operations.pyx":280 * @cython.wraparound(False) * @cython.cdivision(True) * def assign_particles_to_cells(np.ndarray[np.int32_t, ndim=1] levels, #for cells # <<<<<<<<<<<<<< @@ -5225,7 +6041,7 @@ return __pyx_r; } -/* "yt/utilities/lib/particle_mesh_operations.pyx":302 +/* "yt/utilities/lib/particle_mesh_operations.pyx":312 * @cython.wraparound(False) * @cython.cdivision(True) * def assign_particles_to_cell_lists(np.ndarray[np.int32_t, ndim=1] levels, #for cells # <<<<<<<<<<<<<< @@ -5256,13 +6072,21 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -5271,44 +6095,51 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_assign)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 1); __PYX_ERR(0, 302, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 1); __PYX_ERR(0, 312, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level_max)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 2); __PYX_ERR(0, 302, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 2); __PYX_ERR(0, 312, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 3); __PYX_ERR(0, 302, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 3); __PYX_ERR(0, 312, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 4); __PYX_ERR(0, 302, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 4); __PYX_ERR(0, 312, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_x)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 5); __PYX_ERR(0, 302, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 5); __PYX_ERR(0, 312, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 6); __PYX_ERR(0, 302, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 6); __PYX_ERR(0, 312, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 7); __PYX_ERR(0, 302, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, 7); __PYX_ERR(0, 312, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assign_particles_to_cell_lists") < 0)) __PYX_ERR(0, 302, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assign_particles_to_cell_lists") < 0)) __PYX_ERR(0, 312, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; @@ -5324,7 +6155,7 @@ } __pyx_v_levels = ((PyArrayObject *)values[0]); __pyx_v_assign = ((PyArrayObject *)values[1]); - __pyx_v_level_max = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_level_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L3_error) + __pyx_v_level_max = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_level_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 314, __pyx_L3_error) __pyx_v_left_edges = ((PyArrayObject *)values[3]); __pyx_v_right_edges = ((PyArrayObject *)values[4]); __pyx_v_pos_x = ((PyArrayObject *)values[5]); @@ -5333,19 +6164,19 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 302, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("assign_particles_to_cell_lists", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 312, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.particle_mesh_operations.assign_particles_to_cell_lists", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 302, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assign), __pyx_ptype_5numpy_ndarray, 1, "assign", 0))) __PYX_ERR(0, 303, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 305, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 306, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_x), __pyx_ptype_5numpy_ndarray, 1, "pos_x", 0))) __PYX_ERR(0, 307, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_y), __pyx_ptype_5numpy_ndarray, 1, "pos_y", 0))) __PYX_ERR(0, 308, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_z), __pyx_ptype_5numpy_ndarray, 1, "pos_z", 0))) __PYX_ERR(0, 309, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assign), __pyx_ptype_5numpy_ndarray, 1, "assign", 0))) __PYX_ERR(0, 313, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 315, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 316, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_x), __pyx_ptype_5numpy_ndarray, 1, "pos_x", 0))) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_y), __pyx_ptype_5numpy_ndarray, 1, "pos_y", 0))) __PYX_ERR(0, 318, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_z), __pyx_ptype_5numpy_ndarray, 1, "pos_z", 0))) __PYX_ERR(0, 319, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_12assign_particles_to_cell_lists(__pyx_self, __pyx_v_levels, __pyx_v_assign, __pyx_v_level_max, __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_pos_x, __pyx_v_pos_y, __pyx_v_pos_z); /* function exit code */ @@ -5440,41 +6271,41 @@ __pyx_pybuffernd_pos_z.rcbuffer = &__pyx_pybuffer_pos_z; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 312, __pyx_L1_error) } __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_assign.rcbuffer->pybuffer, (PyObject*)__pyx_v_assign, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_assign.rcbuffer->pybuffer, (PyObject*)__pyx_v_assign, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 312, __pyx_L1_error) } __pyx_pybuffernd_assign.diminfo[0].strides = __pyx_pybuffernd_assign.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_assign.diminfo[0].shape = __pyx_pybuffernd_assign.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 312, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 312, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 312, __pyx_L1_error) } __pyx_pybuffernd_pos_x.diminfo[0].strides = __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_x.diminfo[0].shape = __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 312, __pyx_L1_error) } __pyx_pybuffernd_pos_y.diminfo[0].strides = __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_y.diminfo[0].shape = __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 312, __pyx_L1_error) } __pyx_pybuffernd_pos_z.diminfo[0].strides = __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_z.diminfo[0].shape = __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/particle_mesh_operations.pyx":314 + /* "yt/utilities/lib/particle_mesh_operations.pyx":324 * #Todo: instead of iterating every particles, could use kdtree * cdef long i,j,level * cdef long npart = pos_x.shape[0] # <<<<<<<<<<<<<< @@ -5483,7 +6314,7 @@ */ __pyx_v_npart = (__pyx_v_pos_x->dimensions[0]); - /* "yt/utilities/lib/particle_mesh_operations.pyx":315 + /* "yt/utilities/lib/particle_mesh_operations.pyx":325 * cdef long i,j,level * cdef long npart = pos_x.shape[0] * cdef long ncells = left_edges.shape[0] # <<<<<<<<<<<<<< @@ -5492,19 +6323,19 @@ */ __pyx_v_ncells = (__pyx_v_left_edges->dimensions[0]); - /* "yt/utilities/lib/particle_mesh_operations.pyx":318 + /* "yt/utilities/lib/particle_mesh_operations.pyx":328 * #cdef np.ndarray[np.int32_t, ndim=1] assign * #assign = np.zeros(npart,dtype='int32')-1 * index_lists = [] # <<<<<<<<<<<<<< * for level in range(level_max,-1,-1): * #start with the finest level */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_index_lists = __pyx_t_1; __pyx_t_1 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":319 + /* "yt/utilities/lib/particle_mesh_operations.pyx":329 * #assign = np.zeros(npart,dtype='int32')-1 * index_lists = [] * for level in range(level_max,-1,-1): # <<<<<<<<<<<<<< @@ -5514,7 +6345,7 @@ for (__pyx_t_2 = __pyx_v_level_max; __pyx_t_2 > -1L; __pyx_t_2-=1) { __pyx_v_level = __pyx_t_2; - /* "yt/utilities/lib/particle_mesh_operations.pyx":321 + /* "yt/utilities/lib/particle_mesh_operations.pyx":331 * for level in range(level_max,-1,-1): * #start with the finest level * for i in range(ncells): # <<<<<<<<<<<<<< @@ -5525,7 +6356,7 @@ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "yt/utilities/lib/particle_mesh_operations.pyx":323 + /* "yt/utilities/lib/particle_mesh_operations.pyx":333 * for i in range(ncells): * #go through every cell on the finest level first * if not levels[i] == level: continue # <<<<<<<<<<<<<< @@ -5538,19 +6369,19 @@ goto __pyx_L5_continue; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":324 + /* "yt/utilities/lib/particle_mesh_operations.pyx":334 * #go through every cell on the finest level first * if not levels[i] == level: continue * index_list = [] # <<<<<<<<<<<<<< * for j in range(npart): * #iterate over all particles, skip if assigned */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_index_list, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":325 + /* "yt/utilities/lib/particle_mesh_operations.pyx":335 * if not levels[i] == level: continue * index_list = [] * for j in range(npart): # <<<<<<<<<<<<<< @@ -5561,7 +6392,7 @@ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_j = __pyx_t_8; - /* "yt/utilities/lib/particle_mesh_operations.pyx":327 + /* "yt/utilities/lib/particle_mesh_operations.pyx":337 * for j in range(npart): * #iterate over all particles, skip if assigned * if assign[j]>-1: continue # <<<<<<<<<<<<<< @@ -5574,7 +6405,7 @@ goto __pyx_L8_continue; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":328 + /* "yt/utilities/lib/particle_mesh_operations.pyx":338 * #iterate over all particles, skip if assigned * if assign[j]>-1: continue * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): # <<<<<<<<<<<<<< @@ -5594,7 +6425,7 @@ __pyx_t_16 = (__pyx_t_6 != 0); if (__pyx_t_16) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":329 + /* "yt/utilities/lib/particle_mesh_operations.pyx":339 * if assign[j]>-1: continue * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): # <<<<<<<<<<<<<< @@ -5614,7 +6445,7 @@ __pyx_t_6 = (__pyx_t_16 != 0); if (__pyx_t_6) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":330 + /* "yt/utilities/lib/particle_mesh_operations.pyx":340 * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): * if (left_edges[i,2] <= pos_z[j] <= right_edges[i,2]): # <<<<<<<<<<<<<< @@ -5634,7 +6465,7 @@ __pyx_t_16 = (__pyx_t_6 != 0); if (__pyx_t_16) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":331 + /* "yt/utilities/lib/particle_mesh_operations.pyx":341 * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): * if (left_edges[i,2] <= pos_z[j] <= right_edges[i,2]): * assign[j]=i # <<<<<<<<<<<<<< @@ -5644,27 +6475,27 @@ __pyx_t_27 = __pyx_v_j; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_assign.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_assign.diminfo[0].strides) = __pyx_v_i; - /* "yt/utilities/lib/particle_mesh_operations.pyx":332 + /* "yt/utilities/lib/particle_mesh_operations.pyx":342 * if (left_edges[i,2] <= pos_z[j] <= right_edges[i,2]): * assign[j]=i * index_list += j, # <<<<<<<<<<<<<< * index_lists += index_list, * return assign,index_lists */ - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_28 = PyTuple_New(1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_28 = PyTuple_New(1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_index_list, __pyx_t_28); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_index_list, __pyx_t_28); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_DECREF_SET(__pyx_v_index_list, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":330 + /* "yt/utilities/lib/particle_mesh_operations.pyx":340 * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): * if (left_edges[i,2] <= pos_z[j] <= right_edges[i,2]): # <<<<<<<<<<<<<< @@ -5673,7 +6504,7 @@ */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":329 + /* "yt/utilities/lib/particle_mesh_operations.pyx":339 * if assign[j]>-1: continue * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): # <<<<<<<<<<<<<< @@ -5682,7 +6513,7 @@ */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":328 + /* "yt/utilities/lib/particle_mesh_operations.pyx":338 * #iterate over all particles, skip if assigned * if assign[j]>-1: continue * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): # <<<<<<<<<<<<<< @@ -5693,19 +6524,19 @@ __pyx_L8_continue:; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":333 + /* "yt/utilities/lib/particle_mesh_operations.pyx":343 * assign[j]=i * index_list += j, * index_lists += index_list, # <<<<<<<<<<<<<< * return assign,index_lists * */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_index_list); __Pyx_GIVEREF(__pyx_v_index_list); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_index_list); - __pyx_t_28 = PyNumber_InPlaceAdd(__pyx_v_index_lists, __pyx_t_1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_28 = PyNumber_InPlaceAdd(__pyx_v_index_lists, __pyx_t_1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_index_lists, __pyx_t_28); @@ -5714,7 +6545,7 @@ } } - /* "yt/utilities/lib/particle_mesh_operations.pyx":334 + /* "yt/utilities/lib/particle_mesh_operations.pyx":344 * index_list += j, * index_lists += index_list, * return assign,index_lists # <<<<<<<<<<<<<< @@ -5722,7 +6553,7 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_28 = PyTuple_New(2); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_28 = PyTuple_New(2); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_INCREF(((PyObject *)__pyx_v_assign)); __Pyx_GIVEREF(((PyObject *)__pyx_v_assign)); @@ -5734,7 +6565,7 @@ __pyx_t_28 = 0; goto __pyx_L0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":302 + /* "yt/utilities/lib/particle_mesh_operations.pyx":312 * @cython.wraparound(False) * @cython.cdivision(True) * def assign_particles_to_cell_lists(np.ndarray[np.int32_t, ndim=1] levels, #for cells # <<<<<<<<<<<<<< @@ -5777,7 +6608,7 @@ return __pyx_r; } -/* "yt/utilities/lib/particle_mesh_operations.pyx":340 +/* "yt/utilities/lib/particle_mesh_operations.pyx":350 * @cython.wraparound(False) * @cython.cdivision(True) * def recursive_particle_assignment(grids, grid, # <<<<<<<<<<<<<< @@ -5807,12 +6638,19 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -5821,39 +6659,45 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grids)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, 1); __PYX_ERR(0, 340, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, 1); __PYX_ERR(0, 350, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, 2); __PYX_ERR(0, 340, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, 2); __PYX_ERR(0, 350, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, 3); __PYX_ERR(0, 340, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, 3); __PYX_ERR(0, 350, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_x)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, 4); __PYX_ERR(0, 340, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, 4); __PYX_ERR(0, 350, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, 5); __PYX_ERR(0, 340, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, 5); __PYX_ERR(0, 350, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, 6); __PYX_ERR(0, 340, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, 6); __PYX_ERR(0, 350, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "recursive_particle_assignment") < 0)) __PYX_ERR(0, 340, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "recursive_particle_assignment") < 0)) __PYX_ERR(0, 350, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; @@ -5876,17 +6720,17 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 340, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("recursive_particle_assignment", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.particle_mesh_operations.recursive_particle_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 341, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 342, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_x), __pyx_ptype_5numpy_ndarray, 1, "pos_x", 0))) __PYX_ERR(0, 343, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_y), __pyx_ptype_5numpy_ndarray, 1, "pos_y", 0))) __PYX_ERR(0, 344, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_z), __pyx_ptype_5numpy_ndarray, 1, "pos_z", 0))) __PYX_ERR(0, 345, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(0, 351, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) __PYX_ERR(0, 352, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_x), __pyx_ptype_5numpy_ndarray, 1, "pos_x", 0))) __PYX_ERR(0, 353, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_y), __pyx_ptype_5numpy_ndarray, 1, "pos_y", 0))) __PYX_ERR(0, 354, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos_z), __pyx_ptype_5numpy_ndarray, 1, "pos_z", 0))) __PYX_ERR(0, 355, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_24particle_mesh_operations_14recursive_particle_assignment(__pyx_self, __pyx_v_grids, __pyx_v_grid, __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_pos_x, __pyx_v_pos_y, __pyx_v_pos_z); /* function exit code */ @@ -5989,31 +6833,31 @@ __pyx_pybuffernd_pos_z.rcbuffer = &__pyx_pybuffer_pos_z; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 350, __pyx_L1_error) } __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 350, __pyx_L1_error) } __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 350, __pyx_L1_error) } __pyx_pybuffernd_pos_x.diminfo[0].strides = __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_x.diminfo[0].shape = __pyx_pybuffernd_pos_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 350, __pyx_L1_error) } __pyx_pybuffernd_pos_y.diminfo[0].strides = __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_y.diminfo[0].shape = __pyx_pybuffernd_pos_y.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 350, __pyx_L1_error) } __pyx_pybuffernd_pos_z.diminfo[0].strides = __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos_z.diminfo[0].shape = __pyx_pybuffernd_pos_z.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/particle_mesh_operations.pyx":351 + /* "yt/utilities/lib/particle_mesh_operations.pyx":361 * #and particle_indices for every grid * cdef long i, j * cdef long npart = pos_x.shape[0] # <<<<<<<<<<<<<< @@ -6022,40 +6866,40 @@ */ __pyx_v_npart = (__pyx_v_pos_x->dimensions[0]); - /* "yt/utilities/lib/particle_mesh_operations.pyx":352 + /* "yt/utilities/lib/particle_mesh_operations.pyx":362 * cdef long i, j * cdef long npart = pos_x.shape[0] * cdef np.ndarray[np.int32_t, ndim=1] assigned = np.zeros(npart,dtype='int32') # <<<<<<<<<<<<<< * cdef np.ndarray[np.int32_t, ndim=1] never_assigned = np.ones(npart,dtype='int32') * for i in np.unique(grid.child_index_mask): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __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, 352, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_npart); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_npart); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 352, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __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_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, 352, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 362, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_assigned.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_assigned = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_assigned.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 352, __pyx_L1_error) + __PYX_ERR(0, 362, __pyx_L1_error) } else {__pyx_pybuffernd_assigned.diminfo[0].strides = __pyx_pybuffernd_assigned.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_assigned.diminfo[0].shape = __pyx_pybuffernd_assigned.rcbuffer->pybuffer.shape[0]; } } @@ -6063,40 +6907,40 @@ __pyx_v_assigned = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":353 + /* "yt/utilities/lib/particle_mesh_operations.pyx":363 * cdef long npart = pos_x.shape[0] * cdef np.ndarray[np.int32_t, ndim=1] assigned = np.zeros(npart,dtype='int32') * cdef np.ndarray[np.int32_t, ndim=1] never_assigned = np.ones(npart,dtype='int32') # <<<<<<<<<<<<<< * for i in np.unique(grid.child_index_mask): * if i== -1: continue */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ones); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ones); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_npart); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_npart); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 353, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 353, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 363, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_never_assigned.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_never_assigned = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_never_assigned.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 353, __pyx_L1_error) + __PYX_ERR(0, 363, __pyx_L1_error) } else {__pyx_pybuffernd_never_assigned.diminfo[0].strides = __pyx_pybuffernd_never_assigned.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_never_assigned.diminfo[0].shape = __pyx_pybuffernd_never_assigned.rcbuffer->pybuffer.shape[0]; } } @@ -6104,19 +6948,19 @@ __pyx_v_never_assigned = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":354 + /* "yt/utilities/lib/particle_mesh_operations.pyx":364 * cdef np.ndarray[np.int32_t, ndim=1] assigned = np.zeros(npart,dtype='int32') * cdef np.ndarray[np.int32_t, ndim=1] never_assigned = np.ones(npart,dtype='int32') * for i in np.unique(grid.child_index_mask): # <<<<<<<<<<<<<< * if i== -1: continue * #assigned to this subgrid */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_grid, __pyx_n_s_child_index_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_grid, __pyx_n_s_child_index_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -6129,14 +6973,14 @@ } } if (!__pyx_t_1) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __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, 364, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6145,20 +6989,20 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __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, 364, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -6168,9 +7012,9 @@ __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 364, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -6178,17 +7022,17 @@ if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 364, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 364, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -6198,17 +7042,17 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 354, __pyx_L1_error) + else __PYX_ERR(0, 364, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_i = __pyx_t_10; - /* "yt/utilities/lib/particle_mesh_operations.pyx":355 + /* "yt/utilities/lib/particle_mesh_operations.pyx":365 * cdef np.ndarray[np.int32_t, ndim=1] never_assigned = np.ones(npart,dtype='int32') * for i in np.unique(grid.child_index_mask): * if i== -1: continue # <<<<<<<<<<<<<< @@ -6220,34 +7064,34 @@ goto __pyx_L3_continue; } - /* "yt/utilities/lib/particle_mesh_operations.pyx":357 + /* "yt/utilities/lib/particle_mesh_operations.pyx":367 * if i== -1: continue * #assigned to this subgrid * assigned = np.zeros(npart,dtype='int32') # <<<<<<<<<<<<<< * for j in range(npart): * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_npart); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_npart); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 367, __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 357, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_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, 357, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 367, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6263,13 +7107,13 @@ } } __pyx_pybuffernd_assigned.diminfo[0].strides = __pyx_pybuffernd_assigned.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_assigned.diminfo[0].shape = __pyx_pybuffernd_assigned.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) + if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 367, __pyx_L1_error) } __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_assigned, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":358 + /* "yt/utilities/lib/particle_mesh_operations.pyx":368 * #assigned to this subgrid * assigned = np.zeros(npart,dtype='int32') * for j in range(npart): # <<<<<<<<<<<<<< @@ -6280,7 +7124,7 @@ for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_10; __pyx_t_16+=1) { __pyx_v_j = __pyx_t_16; - /* "yt/utilities/lib/particle_mesh_operations.pyx":359 + /* "yt/utilities/lib/particle_mesh_operations.pyx":369 * assigned = np.zeros(npart,dtype='int32') * for j in range(npart): * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): # <<<<<<<<<<<<<< @@ -6300,7 +7144,7 @@ __pyx_t_23 = (__pyx_t_11 != 0); if (__pyx_t_23) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":360 + /* "yt/utilities/lib/particle_mesh_operations.pyx":370 * for j in range(npart): * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): # <<<<<<<<<<<<<< @@ -6320,7 +7164,7 @@ __pyx_t_11 = (__pyx_t_23 != 0); if (__pyx_t_11) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":361 + /* "yt/utilities/lib/particle_mesh_operations.pyx":371 * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): * if (left_edges[i,2] <= pos_z[j] <= right_edges[i,2]): # <<<<<<<<<<<<<< @@ -6340,7 +7184,7 @@ __pyx_t_23 = (__pyx_t_11 != 0); if (__pyx_t_23) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":362 + /* "yt/utilities/lib/particle_mesh_operations.pyx":372 * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): * if (left_edges[i,2] <= pos_z[j] <= right_edges[i,2]): * assigned[j]=1 # <<<<<<<<<<<<<< @@ -6350,7 +7194,7 @@ __pyx_t_34 = __pyx_v_j; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_assigned.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_assigned.diminfo[0].strides) = 1; - /* "yt/utilities/lib/particle_mesh_operations.pyx":363 + /* "yt/utilities/lib/particle_mesh_operations.pyx":373 * if (left_edges[i,2] <= pos_z[j] <= right_edges[i,2]): * assigned[j]=1 * never_assigned[j]=0 # <<<<<<<<<<<<<< @@ -6360,7 +7204,7 @@ __pyx_t_35 = __pyx_v_j; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_never_assigned.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_never_assigned.diminfo[0].strides) = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":361 + /* "yt/utilities/lib/particle_mesh_operations.pyx":371 * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): * if (left_edges[i,2] <= pos_z[j] <= right_edges[i,2]): # <<<<<<<<<<<<<< @@ -6369,7 +7213,7 @@ */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":360 + /* "yt/utilities/lib/particle_mesh_operations.pyx":370 * for j in range(npart): * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): * if (left_edges[i,1] <= pos_y[j] <= right_edges[i,1]): # <<<<<<<<<<<<<< @@ -6378,7 +7222,7 @@ */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":359 + /* "yt/utilities/lib/particle_mesh_operations.pyx":369 * assigned = np.zeros(npart,dtype='int32') * for j in range(npart): * if (left_edges[i,0] <= pos_x[j] <= right_edges[i,0]): # <<<<<<<<<<<<<< @@ -6388,16 +7232,16 @@ } } - /* "yt/utilities/lib/particle_mesh_operations.pyx":364 + /* "yt/utilities/lib/particle_mesh_operations.pyx":374 * assigned[j]=1 * never_assigned[j]=0 * if np.sum(assigned)>0: # <<<<<<<<<<<<<< * recursive_particle_assignment(grids,grid,left_edges,right_edges, * pos_x[assigned],pos_y[assigned],pos_z[assigned]) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -6411,13 +7255,13 @@ } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_assigned)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_assigned)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_assigned)}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -6425,52 +7269,52 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_assigned)}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_assigned)); __Pyx_GIVEREF(((PyObject *)__pyx_v_assigned)); PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_assigned)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_23) { - /* "yt/utilities/lib/particle_mesh_operations.pyx":365 + /* "yt/utilities/lib/particle_mesh_operations.pyx":375 * never_assigned[j]=0 * if np.sum(assigned)>0: * recursive_particle_assignment(grids,grid,left_edges,right_edges, # <<<<<<<<<<<<<< * pos_x[assigned],pos_y[assigned],pos_z[assigned]) * #now we have assigned particles to other subgrids, we are left with particles on our grid */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_recursive_particle_assignment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_recursive_particle_assignment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "yt/utilities/lib/particle_mesh_operations.pyx":366 + /* "yt/utilities/lib/particle_mesh_operations.pyx":376 * if np.sum(assigned)>0: * recursive_particle_assignment(grids,grid,left_edges,right_edges, * pos_x[assigned],pos_y[assigned],pos_z[assigned]) # <<<<<<<<<<<<<< * #now we have assigned particles to other subgrids, we are left with particles on our grid * */ - __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_pos_x), ((PyObject *)__pyx_v_assigned)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_pos_x), ((PyObject *)__pyx_v_assigned)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_pos_y), ((PyObject *)__pyx_v_assigned)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_pos_y), ((PyObject *)__pyx_v_assigned)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_36 = PyObject_GetItem(((PyObject *)__pyx_v_pos_z), ((PyObject *)__pyx_v_assigned)); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_36 = PyObject_GetItem(((PyObject *)__pyx_v_pos_z), ((PyObject *)__pyx_v_assigned)); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_36); __pyx_t_37 = NULL; __pyx_t_12 = 0; @@ -6487,7 +7331,7 @@ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[8] = {__pyx_t_37, __pyx_v_grids, __pyx_v_grid, ((PyObject *)__pyx_v_left_edges), ((PyObject *)__pyx_v_right_edges), __pyx_t_7, __pyx_t_2, __pyx_t_36}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 7+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 7+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -6498,7 +7342,7 @@ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[8] = {__pyx_t_37, __pyx_v_grids, __pyx_v_grid, ((PyObject *)__pyx_v_left_edges), ((PyObject *)__pyx_v_right_edges), __pyx_t_7, __pyx_t_2, __pyx_t_36}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 7+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 7+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -6507,7 +7351,7 @@ } else #endif { - __pyx_t_38 = PyTuple_New(7+__pyx_t_12); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_38 = PyTuple_New(7+__pyx_t_12); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_38); if (__pyx_t_37) { __Pyx_GIVEREF(__pyx_t_37); PyTuple_SET_ITEM(__pyx_t_38, 0, __pyx_t_37); __pyx_t_37 = NULL; @@ -6533,14 +7377,14 @@ __pyx_t_7 = 0; __pyx_t_2 = 0; __pyx_t_36 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_38, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_38, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":364 + /* "yt/utilities/lib/particle_mesh_operations.pyx":374 * assigned[j]=1 * never_assigned[j]=0 * if np.sum(assigned)>0: # <<<<<<<<<<<<<< @@ -6549,7 +7393,7 @@ */ } - /* "yt/utilities/lib/particle_mesh_operations.pyx":354 + /* "yt/utilities/lib/particle_mesh_operations.pyx":364 * cdef np.ndarray[np.int32_t, ndim=1] assigned = np.zeros(npart,dtype='int32') * cdef np.ndarray[np.int32_t, ndim=1] never_assigned = np.ones(npart,dtype='int32') * for i in np.unique(grid.child_index_mask): # <<<<<<<<<<<<<< @@ -6560,7 +7404,7 @@ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":340 + /* "yt/utilities/lib/particle_mesh_operations.pyx":350 * @cython.wraparound(False) * @cython.cdivision(True) * def recursive_particle_assignment(grids, grid, # <<<<<<<<<<<<<< @@ -6611,2145 +7455,1654 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { +/* 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; - int __pyx_t_1; + __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)); - /* "yt/utilities/lib/fp_utils.pxd":20 - * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * - */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "yt/utilities/lib/fp_utils.pxd":24 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 + * if info == NULL: return # <<<<<<<<<<<<<< * + * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; + __pyx_r = 0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline int imin(int i0, int i1) nogil: */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_v_endian_detector = 1; - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * ndim = PyArray_NDIM(self) */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_v_copy_shape = 1; - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; } - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * 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, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 218, __pyx_L1_error) -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); - if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< - * - * cdef inline int iclip(int i, int a, int b) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + if (__pyx_t_1) { -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":40 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + * info.buf = PyArray_DATA(self) */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 222, __pyx_L1_error) - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ + __pyx_v_info->ndim = __pyx_v_ndim; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fclip(np.float64_t f, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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_r = __pyx_v_i; - goto __pyx_L0; + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + goto __pyx_L11; + } -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * 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)); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + __pyx_v_info->suboffsets = NULL; - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + * cdef int t */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":54 - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + __pyx_v_f = NULL; - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __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; - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if not hasfields and not copy_shape: */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); + goto __pyx_L14; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * - * cdef int copy_shape, i, ndim + * if not hasfields: */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); } + __pyx_L14:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_v_endian_detector = 1; + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * - * ndim = PyArray_NDIM(self) + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_copy_shape = 1; + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - goto __pyx_L4; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 259, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - if (__pyx_t_1) { + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ - } + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - if (__pyx_t_1) { + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ - } + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ - __pyx_v_info->ndim = __pyx_v_ndim; + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 278, __pyx_L1_error) + break; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return * else: */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + __pyx_v_info->format = __pyx_v_f; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< * else: - * info.strides = PyArray_STRIDES(self) + * info.format = stdlib.malloc(_buffer_format_string_len) */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - goto __pyx_L11; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; + (__pyx_v_info->format[0]) = '^'; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ - __pyx_v_info->suboffsets = NULL; + __pyx_v_offset = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< * - * cdef int t + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + (__pyx_v_f[0]) = '\x00'; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - __pyx_v_f = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * 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; + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * if not hasfields and not copy_shape: + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) */ - goto __pyx_L14; - } + free(__pyx_v_info->format); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * if not hasfields: + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); } - __pyx_L14:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + free(__pyx_v_info->strides); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; + __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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; + __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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * 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): */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; + __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, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, */ - __pyx_v_offset = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 * - * def __releasebuffer__(ndarray self, Py_buffer* info): + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - (__pyx_v_f[0]) = '\x00'; - } + __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, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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_r = 0; - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + * 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. */ -/* 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) { +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 - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); + 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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * */ - free(__pyx_v_info->format); + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - free(__pyx_v_info->strides); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(1, 794, __pyx_L1_error) } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) */ + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< * + * if (end - f) - (new_offset - offset[0]) < 15: */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * 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, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + * 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, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 799, __pyx_L1_error) - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ + } -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * cdef inline object PyArray_MultiIterNew3(a, b, c): + * 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_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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 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:; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + if (__pyx_t_6) { -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply */ - __Pyx_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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 803, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 * - * 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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< * + * offset[0] += child.itemsize */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) + * 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); -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __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, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * 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. */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields + * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_v_endian_detector = 1; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 823, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + * # 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" */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * 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, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: - */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); - if (!__pyx_t_7) { - goto __pyx_L8_next_or; - } else { - } - __pyx_t_7 = (__pyx_v_little_endian != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_L8_next_or:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 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:; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" */ - if (__pyx_t_6) { + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" */ - } + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 0x78; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 * elif t == NPY_INT: f[0] = 105 #"i" @@ -9283,7 +9636,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -9331,7 +9684,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -9414,7 +9767,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -9462,7 +9815,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -9545,7 +9898,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -9590,7 +9943,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -9616,677 +9969,15144 @@ return __pyx_r; } -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 + */ -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "particle_mesh_operations", - __pyx_k_Simple_integrators_for_the_radi, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_CICDeposit_2, __pyx_k_CICDeposit_2, sizeof(__pyx_k_CICDeposit_2), 0, 0, 1, 1}, - {&__pyx_n_s_CICDeposit_3, __pyx_k_CICDeposit_3, sizeof(__pyx_k_CICDeposit_3), 0, 0, 1, 1}, - {&__pyx_n_s_CICSample_3, __pyx_k_CICSample_3, sizeof(__pyx_k_CICSample_3), 0, 0, 1, 1}, - {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, - {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, - {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, - {&__pyx_n_s_NGPDeposit_2, __pyx_k_NGPDeposit_2, sizeof(__pyx_k_NGPDeposit_2), 0, 0, 1, 1}, - {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, - {&__pyx_n_s_assign, __pyx_k_assign, sizeof(__pyx_k_assign), 0, 0, 1, 1}, - {&__pyx_n_s_assign_particles_to_cell_lists, __pyx_k_assign_particles_to_cell_lists, sizeof(__pyx_k_assign_particles_to_cell_lists), 0, 0, 1, 1}, - {&__pyx_n_s_assign_particles_to_cells, __pyx_k_assign_particles_to_cells, sizeof(__pyx_k_assign_particles_to_cells), 0, 0, 1, 1}, - {&__pyx_n_s_assigned, __pyx_k_assigned, sizeof(__pyx_k_assigned), 0, 0, 1, 1}, - {&__pyx_n_s_cellSize, __pyx_k_cellSize, sizeof(__pyx_k_cellSize), 0, 0, 1, 1}, - {&__pyx_n_s_child_index_mask, __pyx_k_child_index_mask, sizeof(__pyx_k_child_index_mask), 0, 0, 1, 1}, - {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1}, - {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, - {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, - {&__pyx_n_s_dx2, __pyx_k_dx2, sizeof(__pyx_k_dx2), 0, 0, 1, 1}, - {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1}, - {&__pyx_n_s_dy2, __pyx_k_dy2, sizeof(__pyx_k_dy2), 0, 0, 1, 1}, - {&__pyx_n_s_dz, __pyx_k_dz, sizeof(__pyx_k_dz), 0, 0, 1, 1}, - {&__pyx_n_s_dz2, __pyx_k_dz2, sizeof(__pyx_k_dz2), 0, 0, 1, 1}, - {&__pyx_n_s_edge0, __pyx_k_edge0, sizeof(__pyx_k_edge0), 0, 0, 1, 1}, - {&__pyx_n_s_edge1, __pyx_k_edge1, sizeof(__pyx_k_edge1), 0, 0, 1, 1}, - {&__pyx_n_s_edge2, __pyx_k_edge2, sizeof(__pyx_k_edge2), 0, 0, 1, 1}, - {&__pyx_n_s_fact, __pyx_k_fact, sizeof(__pyx_k_fact), 0, 0, 1, 1}, - {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1}, - {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, - {&__pyx_n_s_grid, __pyx_k_grid, sizeof(__pyx_k_grid), 0, 0, 1, 1}, - {&__pyx_n_s_gridDimension, __pyx_k_gridDimension, sizeof(__pyx_k_gridDimension), 0, 0, 1, 1}, - {&__pyx_n_s_grids, __pyx_k_grids, sizeof(__pyx_k_grids), 0, 0, 1, 1}, - {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, - {&__pyx_n_s_i1, __pyx_k_i1, sizeof(__pyx_k_i1), 0, 0, 1, 1}, - {&__pyx_n_s_idds, __pyx_k_idds, sizeof(__pyx_k_idds), 0, 0, 1, 1}, - {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1}, - {&__pyx_n_s_index_list, __pyx_k_index_list, sizeof(__pyx_k_index_list), 0, 0, 1, 1}, - {&__pyx_n_s_index_lists, __pyx_k_index_lists, sizeof(__pyx_k_index_lists), 0, 0, 1, 1}, - {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, - {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, - {&__pyx_n_s_j1, __pyx_k_j1, sizeof(__pyx_k_j1), 0, 0, 1, 1}, - {&__pyx_n_s_k1, __pyx_k_k1, sizeof(__pyx_k_k1), 0, 0, 1, 1}, - {&__pyx_n_s_le0, __pyx_k_le0, sizeof(__pyx_k_le0), 0, 0, 1, 1}, - {&__pyx_n_s_le1, __pyx_k_le1, sizeof(__pyx_k_le1), 0, 0, 1, 1}, - {&__pyx_n_s_le2, __pyx_k_le2, sizeof(__pyx_k_le2), 0, 0, 1, 1}, - {&__pyx_n_s_leftEdge, __pyx_k_leftEdge, sizeof(__pyx_k_leftEdge), 0, 0, 1, 1}, - {&__pyx_n_s_left_edge, __pyx_k_left_edge, sizeof(__pyx_k_left_edge), 0, 0, 1, 1}, - {&__pyx_n_s_left_edges, __pyx_k_left_edges, sizeof(__pyx_k_left_edges), 0, 0, 1, 1}, - {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1}, - {&__pyx_n_s_level_max, __pyx_k_level_max, sizeof(__pyx_k_level_max), 0, 0, 1, 1}, - {&__pyx_n_s_levels, __pyx_k_levels, sizeof(__pyx_k_levels), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_mass, __pyx_k_mass, sizeof(__pyx_k_mass), 0, 0, 1, 1}, - {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, - {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, - {&__pyx_n_s_ncells, __pyx_k_ncells, sizeof(__pyx_k_ncells), 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_never_assigned, __pyx_k_never_assigned, sizeof(__pyx_k_never_assigned), 0, 0, 1, 1}, - {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_n_s_npart, __pyx_k_npart, sizeof(__pyx_k_npart), 0, 0, 1, 1}, - {&__pyx_n_s_npositions, __pyx_k_npositions, sizeof(__pyx_k_npositions), 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_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1}, - {&__pyx_n_s_pos_x, __pyx_k_pos_x, sizeof(__pyx_k_pos_x), 0, 0, 1, 1}, - {&__pyx_n_s_pos_y, __pyx_k_pos_y, sizeof(__pyx_k_pos_y), 0, 0, 1, 1}, - {&__pyx_n_s_pos_z, __pyx_k_pos_z, sizeof(__pyx_k_pos_z), 0, 0, 1, 1}, - {&__pyx_n_s_posx, __pyx_k_posx, sizeof(__pyx_k_posx), 0, 0, 1, 1}, - {&__pyx_n_s_posy, __pyx_k_posy, sizeof(__pyx_k_posy), 0, 0, 1, 1}, - {&__pyx_n_s_posz, __pyx_k_posz, sizeof(__pyx_k_posz), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_recursive_particle_assignment, __pyx_k_recursive_particle_assignment, sizeof(__pyx_k_recursive_particle_assignment), 0, 0, 1, 1}, - {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 0, 0, 1, 1}, - {&__pyx_n_s_right_edges, __pyx_k_right_edges, sizeof(__pyx_k_right_edges), 0, 0, 1, 1}, - {&__pyx_n_s_sample, __pyx_k_sample, sizeof(__pyx_k_sample), 0, 0, 1, 1}, - {&__pyx_n_s_sample_field_at_positions, __pyx_k_sample_field_at_positions, sizeof(__pyx_k_sample_field_at_positions), 0, 0, 1, 1}, - {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 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_xpos, __pyx_k_xpos, sizeof(__pyx_k_xpos), 0, 0, 1, 1}, - {&__pyx_n_s_ypos, __pyx_k_ypos, sizeof(__pyx_k_ypos), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_particle_mesh_o, __pyx_k_yt_utilities_lib_particle_mesh_o, sizeof(__pyx_k_yt_utilities_lib_particle_mesh_o), 0, 0, 1, 1}, - {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, - {&__pyx_n_s_zpos, __pyx_k_zpos, sizeof(__pyx_k_zpos), 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, 47, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * + */ + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * info.buf = PyArray_DATA(self) + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":24 * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 * - * 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, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * - * # Until ticket #99 is fixed, use integers to avoid warnings + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * cdef inline int import_umath() except -1: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * 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, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":22 - * @cython.boundscheck(False) - * @cython.wraparound(False) - * def CICDeposit_3(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] posy, - * np.ndarray[np.float64_t, ndim=1] posz, + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_tuple__10 = PyTuple_Pack(29, __pyx_n_s_posx, __pyx_n_s_posy, __pyx_n_s_posz, __pyx_n_s_mass, __pyx_n_s_npositions, __pyx_n_s_field, __pyx_n_s_leftEdge, __pyx_n_s_gridDimension, __pyx_n_s_cellSize, __pyx_n_s_i1, __pyx_n_s_j1, __pyx_n_s_k1, __pyx_n_s_n, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_zpos, __pyx_n_s_fact, __pyx_n_s_edge0, __pyx_n_s_edge1, __pyx_n_s_edge2, __pyx_n_s_le0, __pyx_n_s_le1, __pyx_n_s_le2, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dz, __pyx_n_s_dx2, __pyx_n_s_dy2, __pyx_n_s_dz2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(9, 0, 29, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_CICDeposit_3, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 22, __pyx_L1_error) - /* "yt/utilities/lib/particle_mesh_operations.pyx":85 - * @cython.boundscheck(False) - * @cython.wraparound(False) - * def CICDeposit_2(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] posy, - * np.ndarray[np.float64_t, ndim=1] mass, + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - __pyx_tuple__12 = PyTuple_Pack(21, __pyx_n_s_posx, __pyx_n_s_posy, __pyx_n_s_mass, __pyx_n_s_npositions, __pyx_n_s_field, __pyx_n_s_leftEdge, __pyx_n_s_gridDimension, __pyx_n_s_cellSize, __pyx_n_s_i1, __pyx_n_s_j1, __pyx_n_s_n, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_edge0, __pyx_n_s_edge1, __pyx_n_s_le0, __pyx_n_s_le1, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dx2, __pyx_n_s_dy2); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 85, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(8, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_CICDeposit_2, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 85, __pyx_L1_error) - /* "yt/utilities/lib/particle_mesh_operations.pyx":134 - * @cython.boundscheck(False) - * @cython.wraparound(False) - * def NGPDeposit_2(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] posy, - * np.ndarray[np.float64_t, ndim=1] mass, - */ - __pyx_tuple__14 = PyTuple_Pack(17, __pyx_n_s_posx, __pyx_n_s_posy, __pyx_n_s_mass, __pyx_n_s_npositions, __pyx_n_s_field, __pyx_n_s_leftEdge, __pyx_n_s_gridDimension, __pyx_n_s_cellSize, __pyx_n_s_i1, __pyx_n_s_j1, __pyx_n_s_n, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_edge0, __pyx_n_s_edge1, __pyx_n_s_le0, __pyx_n_s_le1); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(8, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_NGPDeposit_2, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 134, __pyx_L1_error) +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; - /* "yt/utilities/lib/particle_mesh_operations.pyx":174 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def sample_field_at_positions(np.ndarray[np.float64_t, ndim=3] arr, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] left_edge, - * np.ndarray[np.float64_t, ndim=1] right_edge, + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 + * */ - __pyx_tuple__16 = PyTuple_Pack(12, __pyx_n_s_arr, __pyx_n_s_left_edge, __pyx_n_s_right_edge, __pyx_n_s_pos_x, __pyx_n_s_pos_y, __pyx_n_s_pos_z, __pyx_n_s_idds, __pyx_n_s_dims, __pyx_n_s_ind, __pyx_n_s_i, __pyx_n_s_npart, __pyx_n_s_sample); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(6, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_sample_field_at_positions, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "yt/utilities/lib/particle_mesh_operations.pyx":204 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def CICSample_3(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] posy, - * np.ndarray[np.float64_t, ndim=1] posz, + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_tuple__18 = PyTuple_Pack(29, __pyx_n_s_posx, __pyx_n_s_posy, __pyx_n_s_posz, __pyx_n_s_sample, __pyx_n_s_npositions, __pyx_n_s_field, __pyx_n_s_leftEdge, __pyx_n_s_gridDimension, __pyx_n_s_cellSize, __pyx_n_s_i1, __pyx_n_s_j1, __pyx_n_s_k1, __pyx_n_s_n, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_zpos, __pyx_n_s_fact, __pyx_n_s_edge0, __pyx_n_s_edge1, __pyx_n_s_edge2, __pyx_n_s_le0, __pyx_n_s_le1, __pyx_n_s_le2, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dz, __pyx_n_s_dx2, __pyx_n_s_dy2, __pyx_n_s_dz2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(9, 0, 29, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_CICSample_3, 204, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":270 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def assign_particles_to_cells(np.ndarray[np.int32_t, ndim=1] levels, #for cells # <<<<<<<<<<<<<< - * np.ndarray[np.float32_t, ndim=2] left_edges, #many cells - * np.ndarray[np.float32_t, ndim=2] right_edges, + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - __pyx_tuple__20 = PyTuple_Pack(13, __pyx_n_s_levels, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_pos_x, __pyx_n_s_pos_y, __pyx_n_s_pos_z, __pyx_n_s_level_max, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_level, __pyx_n_s_npart, __pyx_n_s_ncells, __pyx_n_s_assign); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_assign_particles_to_cells, 270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 270, __pyx_L1_error) - /* "yt/utilities/lib/particle_mesh_operations.pyx":302 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def assign_particles_to_cell_lists(np.ndarray[np.int32_t, ndim=1] levels, #for cells # <<<<<<<<<<<<<< - * np.ndarray[np.int32_t,ndim=1] assign, - * np.int64_t level_max, - */ - __pyx_tuple__22 = PyTuple_Pack(15, __pyx_n_s_levels, __pyx_n_s_assign, __pyx_n_s_level_max, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_pos_x, __pyx_n_s_pos_y, __pyx_n_s_pos_z, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_level, __pyx_n_s_npart, __pyx_n_s_ncells, __pyx_n_s_index_lists, __pyx_n_s_index_list); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(8, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_assign_particles_to_cell_lists, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 302, __pyx_L1_error) + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "yt/utilities/lib/particle_mesh_operations.pyx":340 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def recursive_particle_assignment(grids, grid, # <<<<<<<<<<<<<< - * np.ndarray[np.float32_t, ndim=2] left_edges, #many cells - * np.ndarray[np.float32_t, ndim=2] right_edges, +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ - __pyx_tuple__24 = PyTuple_Pack(12, __pyx_n_s_grids, __pyx_n_s_grid, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_pos_x, __pyx_n_s_pos_y, __pyx_n_s_pos_z, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_npart, __pyx_n_s_assigned, __pyx_n_s_never_assigned); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(7, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_recursive_particle_assignment, 340, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 340, __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) - return 0; - __pyx_L1_error:; - return -1; -} +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initparticle_mesh_operations(void); /*proto*/ -PyMODINIT_FUNC initparticle_mesh_operations(void) -#else -PyMODINIT_FUNC PyInit_particle_mesh_operations(void); /*proto*/ -PyMODINIT_FUNC PyInit_particle_mesh_operations(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_particle_mesh_operations(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_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 PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("particle_mesh_operations", __pyx_methods, __pyx_k_Simple_integrators_for_the_radi, 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) - __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) - #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_yt__utilities__lib__particle_mesh_operations) { - 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, "yt.utilities.lib.particle_mesh_operations")) { - if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.particle_mesh_operations", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - } + /* "yt/utilities/lib/fp_utils.pxd":36 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 + * + */ + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + if (__pyx_t_1) { + __pyx_r = (-__pyx_v_f0); + goto __pyx_L0; } - #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 init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", - #if CYTHON_COMPILING_IN_PYPY - sizeof(PyTypeObject), - #else - sizeof(PyHeapTypeObject), - #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /* "yt/utilities/lib/particle_mesh_operations.pyx":22 - * @cython.boundscheck(False) - * @cython.wraparound(False) - * def CICDeposit_3(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] posy, - * np.ndarray[np.float64_t, ndim=1] posz, + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_1CICDeposit_3, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CICDeposit_3, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_v_f0; + goto __pyx_L0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":85 - * @cython.boundscheck(False) - * @cython.wraparound(False) - * def CICDeposit_2(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] posy, - * np.ndarray[np.float64_t, ndim=1] mass, + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_3CICDeposit_2, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CICDeposit_2, __pyx_t_1) < 0) __PYX_ERR(0, 85, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":134 - * @cython.boundscheck(False) - * @cython.wraparound(False) - * def NGPDeposit_2(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] posy, - * np.ndarray[np.float64_t, ndim=1] mass, - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_5NGPDeposit_2, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NGPDeposit_2, __pyx_t_1) < 0) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "yt/utilities/lib/particle_mesh_operations.pyx":174 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def sample_field_at_positions(np.ndarray[np.float64_t, ndim=3] arr, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] left_edge, - * np.ndarray[np.float64_t, ndim=1] right_edge, +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_7sample_field_at_positions, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sample_field_at_positions, __pyx_t_1) < 0) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":204 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def CICSample_3(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] posy, - * np.ndarray[np.float64_t, ndim=1] posz, +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":40 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_9CICSample_3, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CICSample_3, __pyx_t_1) < 0) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "yt/utilities/lib/particle_mesh_operations.pyx":270 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def assign_particles_to_cells(np.ndarray[np.int32_t, ndim=1] levels, #for cells # <<<<<<<<<<<<<< - * np.ndarray[np.float32_t, ndim=2] left_edges, #many cells - * np.ndarray[np.float32_t, ndim=2] right_edges, + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_11assign_particles_to_cells, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assign_particles_to_cells, __pyx_t_1) < 0) __PYX_ERR(0, 270, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "yt/utilities/lib/particle_mesh_operations.pyx":302 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def assign_particles_to_cell_lists(np.ndarray[np.int32_t, ndim=1] levels, #for cells # <<<<<<<<<<<<<< - * np.ndarray[np.int32_t,ndim=1] assign, - * np.int64_t level_max, + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_13assign_particles_to_cell_lists, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assign_particles_to_cell_lists, __pyx_t_1) < 0) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":340 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def recursive_particle_assignment(grids, grid, # <<<<<<<<<<<<<< - * np.ndarray[np.float32_t, ndim=2] left_edges, #many cells - * np.ndarray[np.float32_t, ndim=2] right_edges, + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_15recursive_particle_assignment, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_recursive_particle_assignment, __pyx_t_1) < 0) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/particle_mesh_operations.pyx":1 - * """ # <<<<<<<<<<<<<< - * Simple integrators for the radiative transfer equation + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /*--- Wrapped vars code ---*/ + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * + */ + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fclip(np.float64_t f, + */ + __pyx_r = __pyx_v_i; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.particle_mesh_operations", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib.particle_mesh_operations"); - } + + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b + */ + + /* function exit code */ __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif + return __pyx_r; } -/* --- 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 +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i + * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) + */ -/* 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; -} +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; -/* 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); -} + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + */ + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); + goto __pyx_L0; -/* 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 + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i + * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; } -/* 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))) { +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * + */ + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":58 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * + */ + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } + + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":120 + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __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, 120, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error) + } else { + + /* "View.MemoryView":121 + * + * 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, 120, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __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":120 + * 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; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":127 + * 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, 127, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":128 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":131 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 131, __pyx_L1_error) + + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + } + + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":134 + * + * 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, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 134, __pyx_L1_error) + + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + } + + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":137 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + } + + /* "View.MemoryView":138 + * if not isinstance(format, bytes): + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 138, __pyx_L1_error) + __pyx_t_5 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":139 + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_6; + + /* "View.MemoryView":142 + * + * + * 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":143 + * + * 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":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":146 + * + * 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, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 146, __pyx_L1_error) + + /* "View.MemoryView":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + } + + /* "View.MemoryView":149 + * + * + * 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, 149, __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, 149, __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, 149, __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":150 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":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_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __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, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __PYX_ERR(2, 151, __pyx_L1_error) + + /* "View.MemoryView":150 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + } + + /* "View.MemoryView":152 + * 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":149 + * + * + * 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":155 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 155, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":156 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":157 + * 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":155 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":159 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":160 + * 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":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":162 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + /*else*/ { + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 162, __pyx_L1_error) + } + __pyx_L10:; + + /* "View.MemoryView":164 + * 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":167 + * 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":168 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":169 + * 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":172 + * + * + * 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":173 + * + * 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 (__pyx_t_4) { + + /* "View.MemoryView":174 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 174, __pyx_L1_error) + + /* "View.MemoryView":173 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + } + + /* "View.MemoryView":176 + * 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":177 + * + * 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":178 + * 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, 178, __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, 178, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":179 + * 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":180 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + + /* "View.MemoryView":176 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + } + + /* "View.MemoryView":169 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":120 + * 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":183 + * + * @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; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":184 + * @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":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 185, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":186 + * 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":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + goto __pyx_L3; + } + + /* "View.MemoryView":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 187, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":188 + * 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":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; + + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 190, __pyx_L1_error) + + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + } + + /* "View.MemoryView":191 + * 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":192 + * 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":193 + * 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":194 + * 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":195 + * 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":196 + * 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":197 + * 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":198 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":200 + * 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":201 + * + * 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":200 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":203 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":205 + * 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":183 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":209 + * __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":210 + * + * 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":211 + * 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":210 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":214 + * 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":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } + + /* "View.MemoryView":216 + * 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":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + } + __pyx_L3:; + + /* "View.MemoryView":217 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":209 + * __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":220 + * + * @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":221 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":220 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":224 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_memview", 0); + + /* "View.MemoryView":225 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":226 + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __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, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":224 + * + * @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 + * + * + * 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_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":230 + * + * 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, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":229 + * + * + * 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":232 + * 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_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":233 + * + * 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, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __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 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":235 + * 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_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":236 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":235 + * 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":240 + * + * @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":244 + * 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":245 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __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, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":244 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __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":248 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error) + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":249 + * 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":251 + * 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":240 + * + * @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":277 + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 277, __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, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___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":278 + * 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":277 + * 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":279 + * 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":280 + * 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":279 + * 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":294 + * + * @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":296 + * 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":300 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":302 + * 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":303 + * + * 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":302 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":305 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":294 + * + * @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":341 + * 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __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, 341, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___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":342 + * + * 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":343 + * 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":344 + * 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":345 + * 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 == -1)) __PYX_ERR(2, 345, __pyx_L1_error) + + /* "View.MemoryView":346 + * 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":347 + * __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":348 + * 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":346 + * 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":344 + * 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":351 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":352 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":353 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":351 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + } + + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":355 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":357 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error) + + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } + + /* "View.MemoryView":359 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":360 + * + * 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":359 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + goto __pyx_L10; + } + + /* "View.MemoryView":362 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; + + /* "View.MemoryView":364 + * 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":366 + * 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":341 + * 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":368 + * 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; + PyThread_type_lock __pyx_t_5; + PyThread_type_lock __pyx_t_6; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":369 + * + * 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":370 + * 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":369 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + } + + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * 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":375 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":377 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":380 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":379 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; + + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":381 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":383 + * break + * else: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + } + __pyx_L6_break:; + + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":368 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":385 + * 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":387 + * 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":389 + * 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, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 389, __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":390 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":389 + * 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":392 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":385 + * 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":395 + * + * + * 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":396 + * + * 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":397 + * 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":396 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + } + + /* "View.MemoryView":399 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 399, __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, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":402 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 402, __pyx_L1_error) + if (__pyx_t_2) { + + /* "View.MemoryView":403 + * 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, 403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":402 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + } + + /* "View.MemoryView":405 + * 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 == NULL)) __PYX_ERR(2, 405, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":406 + * 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, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":395 + * + * + * 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":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___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 + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":409 + * + * def __setitem__(memoryview self, object index, object value): + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 409, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":412 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_obj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":414 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":416 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":418 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":420 + * 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":421 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_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":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":424 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __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, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":425 + * 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, 425, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":426 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":421 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + } + + /* "View.MemoryView":428 + * 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":420 + * 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":430 + * 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":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 434, __pyx_L1_error) + + /* "View.MemoryView":435 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 435, __pyx_L1_error) + + /* "View.MemoryView":436 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 434, __pyx_L1_error) + + /* "View.MemoryView":430 + * 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":438 + * 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":440 + * 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":445 + * 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":447 + * 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":448 + * + * 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":449 + * 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 (__pyx_t_1) { + + /* "View.MemoryView":450 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error) + + /* "View.MemoryView":449 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":451 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":447 + * 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":453 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":455 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":456 + * + * 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":457 + * 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":456 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":459 + * ( 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, 459, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":463 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":464 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 464, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":463 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + } + + /* "View.MemoryView":465 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * 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":468 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __pyx_L6_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __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); + } + __Pyx_PyThreadState_assign + 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":438 + * 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":470 + * 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":471 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 471, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":472 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":470 + * 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":474 + * 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":477 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":480 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __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":482 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __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, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } + + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":487 + * 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, 487, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; + + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } + + /* "View.MemoryView":488 + * 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_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":483 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); + + /* "View.MemoryView":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(2, 484, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "View.MemoryView":481 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } + + /* "View.MemoryView":474 + * 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":490 + * 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":493 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":498 + * 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":499 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __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 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":498 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":501 + * 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, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __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, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __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, 501, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":503 + * 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, 503, __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":504 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":503 + * 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":504 + * + * 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":490 + * 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":507 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___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; + Py_ssize_t *__pyx_t_2; + char *__pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":509 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_2 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_2; + + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":511 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":513 + * 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":514 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_2 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_2; + + /* "View.MemoryView":513 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":516 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L4:; + + /* "View.MemoryView":518 + * 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":519 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_2 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_2; + + /* "View.MemoryView":518 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":521 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":523 + * 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":524 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_3 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_3; + + /* "View.MemoryView":523 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":526 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":528 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_4 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":529 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_5 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_5; + + /* "View.MemoryView":530 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = 0 + */ + __pyx_t_6 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_6; + + /* "View.MemoryView":531 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.obj = self + */ + __pyx_t_6 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_6; + + /* "View.MemoryView":532 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":533 + * info.len = self.view.len + * info.readonly = 0 + * 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":507 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + + /* function exit code */ + __pyx_r = 0; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":539 + * + * @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":540 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":541 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error) + + /* "View.MemoryView":542 + * 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":539 + * + * @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":545 + * + * @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":546 + * @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":545 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":549 + * + * @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":550 + * @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, 550, __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, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":549 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_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":553 + * + * @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":554 + * @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 (__pyx_t_1) { + + /* "View.MemoryView":556 + * 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__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 556, __pyx_L1_error) + + /* "View.MemoryView":554 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + } + + /* "View.MemoryView":558 + * 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, 558, __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, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "View.MemoryView":553 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_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":561 + * + * @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":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + } + + /* "View.MemoryView":565 + * 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, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":561 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_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":568 + * + * @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":569 + * @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, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":568 + * + * @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":572 + * + * @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":573 + * @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, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":572 + * + * @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":576 + * + * @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":577 + * @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, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":576 + * + * @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":580 + * + * @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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":582 + * 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":584 + * 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, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":585 + * + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":587 + * 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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":589 + * 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":580 + * + * @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":591 + * 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":592 + * + * 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":593 + * 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":592 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":595 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":591 + * 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":597 + * 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":598 + * + * 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, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":599 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":598 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":597 + * 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":601 + * 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":602 + * + * 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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":601 + * 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":605 + * + * + * 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":608 + * 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":609 + * 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, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":605 + * + * + * 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":611 + * 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":614 + * 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":615 + * 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, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":611 + * 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":617 + * 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":619 + * 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":621 + * 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":622 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 622, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":627 + * 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, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":617 + * 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":629 + * 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":631 + * 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":633 + * 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":634 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 634, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":639 + * 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, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":629 + * 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__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.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__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.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":643 + * + * @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":644 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __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, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":645 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":646 + * 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":643 + * + * @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":649 + * + * @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":650 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":649 + * + * @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":652 + * 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":657 + * 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":658 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":657 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":660 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":662 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":663 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":664 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":665 + * 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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 665, __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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__23); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":669 + * 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":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__24); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":672 + * 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":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":675 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(2, 675, __pyx_L1_error) + + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":677 + * 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":678 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":665 + * 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":680 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__25); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":681 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":684 + * 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, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "View.MemoryView":652 + * 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":686 + * 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":687 + * + * 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":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":689 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 689, __pyx_L1_error) + + /* "View.MemoryView":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":686 + * 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":696 + * + * @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":697 + * @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":704 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + + /* "View.MemoryView":708 + * 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, 708, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":711 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 711, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":712 + * 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":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":714 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":715 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":721 + * + * + * 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":722 + * + * 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":727 + * + * + * 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":728 + * + * 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":732 + * 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, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 732, __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":733 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":737 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 737, __pyx_L1_error) + + /* "View.MemoryView":734 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 734, __pyx_L1_error) + + /* "View.MemoryView":733 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":741 + * 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":742 + * 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":743 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":744 + * 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":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":746 + * 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, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":747 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":748 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":750 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":751 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":752 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":754 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 754, __pyx_L1_error) + + /* "View.MemoryView":760 + * 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":732 + * 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":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":763 + * + * 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":764 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) } + + /* "View.MemoryView":765 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) } + + /* "View.MemoryView":763 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":762 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":769 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":696 + * + * @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":793 + * + * @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":813 + * 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":815 + * 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":816 + * + * 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":815 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_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":818 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 818, __pyx_L1_error) + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":813 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":821 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __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":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_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":824 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error) + + /* "View.MemoryView":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + } + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":828 + * + * 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":829 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":830 + * 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":831 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":830 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":828 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":832 + * 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":833 + * 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":834 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":833 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":836 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":832 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":839 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":841 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":844 + * + * 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":845 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":846 + * 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":847 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":846 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":844 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":848 + * 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":849 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":848 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":852 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":854 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":857 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":856 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":861 + * + * 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":863 + * 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":864 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":863 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":866 + * 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":867 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":866 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":870 + * + * + * 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":871 + * + * 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":872 + * 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":875 + * + * + * 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":876 + * + * 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":875 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":878 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":880 + * 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":881 + * + * 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":882 + * 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":883 + * 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":882 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":885 + * 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":886 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":881 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":888 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":880 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":890 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":793 + * + * @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":896 + * + * @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":898 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":899 + * 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":902 + * 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":903 + * + * 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, 903, __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, 903, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":904 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":902 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":906 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":907 + * 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":908 + * 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":909 + * 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":908 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":911 + * 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":912 + * + * 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":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":914 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(2, 914, __pyx_L1_error) + + /* "View.MemoryView":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":911 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":917 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 917, __pyx_L1_error) + + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":919 + * 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":920 + * + * 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":921 + * 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":920 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":923 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":896 + * + * @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":929 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + + /* "View.MemoryView":930 + * @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":932 + * 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":933 + * + * 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":937 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":938 + * 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":939 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":940 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L6_bool_binop_done:; + if (__pyx_t_6) { + + /* "View.MemoryView":943 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error) + + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + } + } + + /* "View.MemoryView":945 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":929 + * + * @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":962 + * 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":963 + * + * 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":962 + * 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":965 + * __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":966 + * + * 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":967 + * 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, 967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":966 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":969 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 969, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":965 + * __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":971 + * 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":972 + * + * 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":973 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error) + + /* "View.MemoryView":972 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":975 + * 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, 975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":971 + * 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":978 + * + * @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":979 + * @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":978 + * + * @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__27, 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__28, 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":985 + * + * @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":993 + * 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":994 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "View.MemoryView":993 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":999 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __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, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1001 + * 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":1002 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1004 + * __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, 1004, __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":1005 + * + * 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":1007 + * 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":1008 + * + * 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":1009 + * 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":1010 + * 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":1011 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * result.flags = PyBUF_RECORDS + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":1013 + * Py_INCREF(Py_None) + * + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1015 + * result.flags = PyBUF_RECORDS + * + * 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":1016 + * + * 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":1019 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1020 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1022 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":1023 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L5_break; + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L5_break:; + + /* "View.MemoryView":1025 + * 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":1026 + * + * 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, 1026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1027 + * 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, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1029 + * 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":1030 + * + * 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":1032 + * 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":985 + * + * @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":1035 + * + * @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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1039 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1039, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1040 + * 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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1042 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1043 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1035 + * + * @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":1046 + * + * @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; + Py_ssize_t __pyx_t_4; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1050 + * 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":1051 + * + * 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":1052 + * 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":1054 + * 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":1055 + * + * 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":1057 + * 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; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_dim = __pyx_t_3; + + /* "View.MemoryView":1058 + * + * 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":1059 + * 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":1060 + * 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_4 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_4 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4; + } + + /* "View.MemoryView":1046 + * + * @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":1063 + * + * @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":1066 + * "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":1067 + * 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, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1063 + * + * @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":1070 + * + * @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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1078 + * + * 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":1079 + * 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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1081 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1082 + * 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":1084 + * 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":1086 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1070 + * + * @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":1092 + * + * + * 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":1093 + * + * 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":1094 + * 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":1093 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1096 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1092 + * + * + * 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":1099 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1104 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1105 + * 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":1107 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1108 + * + * 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":1109 + * 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":1110 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1108 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1112 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1113 + * + * 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":1114 + * 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":1115 + * 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":1113 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1117 + * 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":1118 + * + * 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":1117 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1120 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1099 + * + * @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":1123 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + + /* "View.MemoryView":1130 + * + * 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":1131 + * 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":1132 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1133 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1135 + * 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":1136 + * + * 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":1137 + * 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":1136 + * + * 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":1138 + * 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): + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + + /* "View.MemoryView":1136 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1140 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1141 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + + /* "View.MemoryView":1142 + * 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":1143 + * 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":1135 + * 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":1145 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1146 + * 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":1150 + * 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":1151 + * 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":1123 + * + * @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":1153 + * 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":1156 + * __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":1153 + * 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":1160 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1163 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1165 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1166 + * + * 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":1168 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1160 + * + * @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":1171 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1180 + * 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":1181 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "View.MemoryView":1182 + * 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":1183 + * 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":1180 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1185 + * 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 > -1L; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1186 + * 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":1187 + * 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":1189 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1171 + * + * @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":1192 + * + * @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; + + /* "View.MemoryView":1203 + * 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":1204 + * + * 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":1206 + * 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":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1208 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error) + + /* "View.MemoryView":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1211 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1212 + * + * 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":1213 + * 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; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1214 + * 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":1215 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1217 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + + /* "View.MemoryView":1221 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1222 + * + * 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":1223 + * 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":1222 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1225 + * 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":1226 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + + /* "View.MemoryView":1225 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1228 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1230 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1192 + * + * @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":1235 + * + * @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":1238 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __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":1237 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 1237, __pyx_L1_error) + + /* "View.MemoryView":1235 + * + * @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":1241 + * + * @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":1242 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_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, 1242, __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, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 1242, __pyx_L1_error) + + /* "View.MemoryView":1241 + * + * @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":1245 + * + * @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":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1247 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_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, 1247, __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, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1247, __pyx_L1_error) + + /* "View.MemoryView":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1249 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(2, 1249, __pyx_L1_error) + } + + /* "View.MemoryView":1245 + * + * @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":1252 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + + /* "View.MemoryView":1260 + * 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":1261 + * """ + * 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":1263 + * 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":1264 + * 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":1265 + * 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":1268 + * 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":1269 + * + * 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":1268 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1271 + * 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":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1273 + * 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":1275 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1276 + * + * 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":1277 + * 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":1278 + * 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":1279 + * 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":1277 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1281 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1281, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1276 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1284 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error) + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + } + } + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1289 + * + * 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":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1291 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1291, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_6; + + /* "View.MemoryView":1292 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1298 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1302 + * 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":1304 + * 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":1305 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + + /* "View.MemoryView":1306 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1307 + * 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":1308 + * 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":1302 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_7 = (__pyx_t_2 != 0); + if (__pyx_t_7) { + + /* "View.MemoryView":1313 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error) + + /* "View.MemoryView":1314 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error) + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1316 + * 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":1317 + * + * 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":1318 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1320 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1321 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1252 + * + * @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":1324 + * + * @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; + + /* "View.MemoryView":1328 + * 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":1330 + * 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 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1331 + * + * 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":1332 + * 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":1333 + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1335 + * 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; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1336 + * + * for i in range(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":1337 + * 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":1338 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1324 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1346 + * + * @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":1350 + * + * + * 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":1351 + * + * 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":1350 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1346 + * + * @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":1355 + * + * @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":1358 + * 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":1355 + * + * @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":1361 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1365 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_3 = (__pyx_v_inc != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1368 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1370 + * 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":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1372 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1373 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1375 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1361 + * + * @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":1381 + * + * @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":1384 + * 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":1385 + * 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":1387 + * _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":1381 + * + * @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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "View.MemoryView":1395 + * 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":1396 + * 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":1398 + * 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":1399 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1400 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1401 + * 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":1398 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1403 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1404 + * 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":1406 + * _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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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 PY_VERSION_HEX >= 0x030400a1 + 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 = 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 = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + 0, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.particle_mesh_operations.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.particle_mesh_operations.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.particle_mesh_operations.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.particle_mesh_operations._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 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + "particle_mesh_operations", + __pyx_k_Simple_integrators_for_the_radi, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_n_s_CICDeposit_2, __pyx_k_CICDeposit_2, sizeof(__pyx_k_CICDeposit_2), 0, 0, 1, 1}, + {&__pyx_n_s_CICDeposit_3, __pyx_k_CICDeposit_3, sizeof(__pyx_k_CICDeposit_3), 0, 0, 1, 1}, + {&__pyx_n_s_CICSample_3, __pyx_k_CICSample_3, sizeof(__pyx_k_CICSample_3), 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_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_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_NGPDeposit_2, __pyx_k_NGPDeposit_2, sizeof(__pyx_k_NGPDeposit_2), 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_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_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_assign, __pyx_k_assign, sizeof(__pyx_k_assign), 0, 0, 1, 1}, + {&__pyx_n_s_assign_particles_to_cell_lists, __pyx_k_assign_particles_to_cell_lists, sizeof(__pyx_k_assign_particles_to_cell_lists), 0, 0, 1, 1}, + {&__pyx_n_s_assign_particles_to_cells, __pyx_k_assign_particles_to_cells, sizeof(__pyx_k_assign_particles_to_cells), 0, 0, 1, 1}, + {&__pyx_n_s_assigned, __pyx_k_assigned, sizeof(__pyx_k_assigned), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_cellSize, __pyx_k_cellSize, sizeof(__pyx_k_cellSize), 0, 0, 1, 1}, + {&__pyx_n_s_child_index_mask, __pyx_k_child_index_mask, sizeof(__pyx_k_child_index_mask), 0, 0, 1, 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_ddx, __pyx_k_ddx, sizeof(__pyx_k_ddx), 0, 0, 1, 1}, + {&__pyx_n_s_ddx2, __pyx_k_ddx2, sizeof(__pyx_k_ddx2), 0, 0, 1, 1}, + {&__pyx_n_s_ddy, __pyx_k_ddy, sizeof(__pyx_k_ddy), 0, 0, 1, 1}, + {&__pyx_n_s_ddy2, __pyx_k_ddy2, sizeof(__pyx_k_ddy2), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, + {&__pyx_n_s_dx2, __pyx_k_dx2, sizeof(__pyx_k_dx2), 0, 0, 1, 1}, + {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1}, + {&__pyx_n_s_dy2, __pyx_k_dy2, sizeof(__pyx_k_dy2), 0, 0, 1, 1}, + {&__pyx_n_s_dz, __pyx_k_dz, sizeof(__pyx_k_dz), 0, 0, 1, 1}, + {&__pyx_n_s_dz2, __pyx_k_dz2, sizeof(__pyx_k_dz2), 0, 0, 1, 1}, + {&__pyx_n_s_edge0, __pyx_k_edge0, sizeof(__pyx_k_edge0), 0, 0, 1, 1}, + {&__pyx_n_s_edge1, __pyx_k_edge1, sizeof(__pyx_k_edge1), 0, 0, 1, 1}, + {&__pyx_n_s_edge2, __pyx_k_edge2, sizeof(__pyx_k_edge2), 0, 0, 1, 1}, + {&__pyx_n_s_edgex, __pyx_k_edgex, sizeof(__pyx_k_edgex), 0, 0, 1, 1}, + {&__pyx_n_s_edgey, __pyx_k_edgey, sizeof(__pyx_k_edgey), 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_fact, __pyx_k_fact, sizeof(__pyx_k_fact), 0, 0, 1, 1}, + {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_grid, __pyx_k_grid, sizeof(__pyx_k_grid), 0, 0, 1, 1}, + {&__pyx_n_s_gridDimension, __pyx_k_gridDimension, sizeof(__pyx_k_gridDimension), 0, 0, 1, 1}, + {&__pyx_n_s_grids, __pyx_k_grids, sizeof(__pyx_k_grids), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_i1, __pyx_k_i1, sizeof(__pyx_k_i1), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_idds, __pyx_k_idds, sizeof(__pyx_k_idds), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1}, + {&__pyx_n_s_index_list, __pyx_k_index_list, sizeof(__pyx_k_index_list), 0, 0, 1, 1}, + {&__pyx_n_s_index_lists, __pyx_k_index_lists, sizeof(__pyx_k_index_lists), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_j1, __pyx_k_j1, sizeof(__pyx_k_j1), 0, 0, 1, 1}, + {&__pyx_n_s_k1, __pyx_k_k1, sizeof(__pyx_k_k1), 0, 0, 1, 1}, + {&__pyx_n_s_le0, __pyx_k_le0, sizeof(__pyx_k_le0), 0, 0, 1, 1}, + {&__pyx_n_s_le1, __pyx_k_le1, sizeof(__pyx_k_le1), 0, 0, 1, 1}, + {&__pyx_n_s_le2, __pyx_k_le2, sizeof(__pyx_k_le2), 0, 0, 1, 1}, + {&__pyx_n_s_leftEdge, __pyx_k_leftEdge, sizeof(__pyx_k_leftEdge), 0, 0, 1, 1}, + {&__pyx_n_s_left_edge, __pyx_k_left_edge, sizeof(__pyx_k_left_edge), 0, 0, 1, 1}, + {&__pyx_n_s_left_edges, __pyx_k_left_edges, sizeof(__pyx_k_left_edges), 0, 0, 1, 1}, + {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1}, + {&__pyx_n_s_level_max, __pyx_k_level_max, sizeof(__pyx_k_level_max), 0, 0, 1, 1}, + {&__pyx_n_s_levels, __pyx_k_levels, sizeof(__pyx_k_levels), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_mass, __pyx_k_mass, sizeof(__pyx_k_mass), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_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_n_s_ncells, __pyx_k_ncells, sizeof(__pyx_k_ncells), 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_never_assigned, __pyx_k_never_assigned, sizeof(__pyx_k_never_assigned), 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_npart, __pyx_k_npart, sizeof(__pyx_k_npart), 0, 0, 1, 1}, + {&__pyx_n_s_npositions, __pyx_k_npositions, sizeof(__pyx_k_npositions), 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_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 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_pos_x, __pyx_k_pos_x, sizeof(__pyx_k_pos_x), 0, 0, 1, 1}, + {&__pyx_n_s_pos_y, __pyx_k_pos_y, sizeof(__pyx_k_pos_y), 0, 0, 1, 1}, + {&__pyx_n_s_pos_z, __pyx_k_pos_z, sizeof(__pyx_k_pos_z), 0, 0, 1, 1}, + {&__pyx_n_s_posx, __pyx_k_posx, sizeof(__pyx_k_posx), 0, 0, 1, 1}, + {&__pyx_n_s_posy, __pyx_k_posy, sizeof(__pyx_k_posy), 0, 0, 1, 1}, + {&__pyx_n_s_posz, __pyx_k_posz, sizeof(__pyx_k_posz), 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_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_recursive_particle_assignment, __pyx_k_recursive_particle_assignment, sizeof(__pyx_k_recursive_particle_assignment), 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_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 0, 0, 1, 1}, + {&__pyx_n_s_right_edges, __pyx_k_right_edges, sizeof(__pyx_k_right_edges), 0, 0, 1, 1}, + {&__pyx_n_s_sample, __pyx_k_sample, sizeof(__pyx_k_sample), 0, 0, 1, 1}, + {&__pyx_n_s_sample_field_at_positions, __pyx_k_sample_field_at_positions, sizeof(__pyx_k_sample_field_at_positions), 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_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_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, + {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_n_s_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 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_x_bin_edges, __pyx_k_x_bin_edges, sizeof(__pyx_k_x_bin_edges), 0, 0, 1, 1}, + {&__pyx_n_s_x_endpoints, __pyx_k_x_endpoints, sizeof(__pyx_k_x_endpoints), 0, 0, 1, 1}, + {&__pyx_n_s_xpos, __pyx_k_xpos, sizeof(__pyx_k_xpos), 0, 0, 1, 1}, + {&__pyx_n_s_y_bin_edges, __pyx_k_y_bin_edges, sizeof(__pyx_k_y_bin_edges), 0, 0, 1, 1}, + {&__pyx_n_s_y_endpoints, __pyx_k_y_endpoints, sizeof(__pyx_k_y_endpoints), 0, 0, 1, 1}, + {&__pyx_n_s_ypos, __pyx_k_ypos, sizeof(__pyx_k_ypos), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_particle_mesh_o, __pyx_k_yt_utilities_lib_particle_mesh_o, sizeof(__pyx_k_yt_utilities_lib_particle_mesh_o), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_particle_mesh_o_2, __pyx_k_yt_utilities_lib_particle_mesh_o_2, sizeof(__pyx_k_yt_utilities_lib_particle_mesh_o_2), 0, 0, 1, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {&__pyx_n_s_zpos, __pyx_k_zpos, sizeof(__pyx_k_zpos), 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, 48, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + * + * 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, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _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, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "View.MemoryView":131 + * + * 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, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "View.MemoryView":134 + * + * 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, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "View.MemoryView":137 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "View.MemoryView":146 + * + * 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, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "View.MemoryView":174 + * 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, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "View.MemoryView":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 190, __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":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "View.MemoryView":556 + * 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__19 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __pyx_tuple__20 = PyTuple_New(1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__20, 0, __pyx_int_neg_1); + __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":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); + + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(2, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); + + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + + /* "View.MemoryView":689 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "(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__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "(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__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "yt/utilities/lib/particle_mesh_operations.pyx":23 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def CICDeposit_3(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] posy, + * np.ndarray[np.float64_t, ndim=1] posz, + */ + __pyx_tuple__29 = PyTuple_Pack(29, __pyx_n_s_posx, __pyx_n_s_posy, __pyx_n_s_posz, __pyx_n_s_mass, __pyx_n_s_npositions, __pyx_n_s_field, __pyx_n_s_leftEdge, __pyx_n_s_gridDimension, __pyx_n_s_cellSize, __pyx_n_s_i1, __pyx_n_s_j1, __pyx_n_s_k1, __pyx_n_s_n, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_zpos, __pyx_n_s_fact, __pyx_n_s_edge0, __pyx_n_s_edge1, __pyx_n_s_edge2, __pyx_n_s_le0, __pyx_n_s_le1, __pyx_n_s_le2, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dz, __pyx_n_s_dx2, __pyx_n_s_dy2, __pyx_n_s_dz2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(9, 0, 29, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_particle_mesh_o, __pyx_n_s_CICDeposit_3, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 23, __pyx_L1_error) + + /* "yt/utilities/lib/particle_mesh_operations.pyx":87 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def CICDeposit_2(np.float64_t[:] posx, # <<<<<<<<<<<<<< + * np.float64_t[:] posy, + * np.float64_t[:] mass, + */ + __pyx_tuple__31 = PyTuple_Pack(20, __pyx_n_s_posx, __pyx_n_s_posy, __pyx_n_s_mass, __pyx_n_s_npositions, __pyx_n_s_field, __pyx_n_s_x_bin_edges, __pyx_n_s_y_bin_edges, __pyx_n_s_i1, __pyx_n_s_j1, __pyx_n_s_n, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_edgex, __pyx_n_s_edgey, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_ddx, __pyx_n_s_ddy, __pyx_n_s_ddx2, __pyx_n_s_ddy2); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(7, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_particle_mesh_o, __pyx_n_s_CICDeposit_2, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 87, __pyx_L1_error) + + /* "yt/utilities/lib/particle_mesh_operations.pyx":140 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def NGPDeposit_2(np.float64_t[:] posx, # <<<<<<<<<<<<<< + * np.float64_t[:] posy, + * np.float64_t[:] mass, + */ + __pyx_tuple__33 = PyTuple_Pack(20, __pyx_n_s_posx, __pyx_n_s_posy, __pyx_n_s_mass, __pyx_n_s_npositions, __pyx_n_s_field, __pyx_n_s_x_bin_edges, __pyx_n_s_y_bin_edges, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_i1, __pyx_n_s_j1, __pyx_n_s_n, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_edge0, __pyx_n_s_edge1, __pyx_n_s_le0, __pyx_n_s_le1, __pyx_n_s_x_endpoints, __pyx_n_s_y_endpoints); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(7, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_particle_mesh_o, __pyx_n_s_NGPDeposit_2, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 140, __pyx_L1_error) + + /* "yt/utilities/lib/particle_mesh_operations.pyx":184 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def sample_field_at_positions(np.ndarray[np.float64_t, ndim=3] arr, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] left_edge, + * np.ndarray[np.float64_t, ndim=1] right_edge, + */ + __pyx_tuple__35 = PyTuple_Pack(12, __pyx_n_s_arr, __pyx_n_s_left_edge, __pyx_n_s_right_edge, __pyx_n_s_pos_x, __pyx_n_s_pos_y, __pyx_n_s_pos_z, __pyx_n_s_idds, __pyx_n_s_dims, __pyx_n_s_ind, __pyx_n_s_i, __pyx_n_s_npart, __pyx_n_s_sample); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(6, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_particle_mesh_o, __pyx_n_s_sample_field_at_positions, 184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 184, __pyx_L1_error) + + /* "yt/utilities/lib/particle_mesh_operations.pyx":214 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def CICSample_3(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] posy, + * np.ndarray[np.float64_t, ndim=1] posz, + */ + __pyx_tuple__37 = PyTuple_Pack(29, __pyx_n_s_posx, __pyx_n_s_posy, __pyx_n_s_posz, __pyx_n_s_sample, __pyx_n_s_npositions, __pyx_n_s_field, __pyx_n_s_leftEdge, __pyx_n_s_gridDimension, __pyx_n_s_cellSize, __pyx_n_s_i1, __pyx_n_s_j1, __pyx_n_s_k1, __pyx_n_s_n, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_zpos, __pyx_n_s_fact, __pyx_n_s_edge0, __pyx_n_s_edge1, __pyx_n_s_edge2, __pyx_n_s_le0, __pyx_n_s_le1, __pyx_n_s_le2, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dz, __pyx_n_s_dx2, __pyx_n_s_dy2, __pyx_n_s_dz2); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(9, 0, 29, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_particle_mesh_o, __pyx_n_s_CICSample_3, 214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 214, __pyx_L1_error) + + /* "yt/utilities/lib/particle_mesh_operations.pyx":280 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def assign_particles_to_cells(np.ndarray[np.int32_t, ndim=1] levels, #for cells # <<<<<<<<<<<<<< + * np.ndarray[np.float32_t, ndim=2] left_edges, #many cells + * np.ndarray[np.float32_t, ndim=2] right_edges, + */ + __pyx_tuple__39 = PyTuple_Pack(13, __pyx_n_s_levels, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_pos_x, __pyx_n_s_pos_y, __pyx_n_s_pos_z, __pyx_n_s_level_max, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_level, __pyx_n_s_npart, __pyx_n_s_ncells, __pyx_n_s_assign); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_particle_mesh_o, __pyx_n_s_assign_particles_to_cells, 280, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 280, __pyx_L1_error) + + /* "yt/utilities/lib/particle_mesh_operations.pyx":312 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def assign_particles_to_cell_lists(np.ndarray[np.int32_t, ndim=1] levels, #for cells # <<<<<<<<<<<<<< + * np.ndarray[np.int32_t,ndim=1] assign, + * np.int64_t level_max, + */ + __pyx_tuple__41 = PyTuple_Pack(15, __pyx_n_s_levels, __pyx_n_s_assign, __pyx_n_s_level_max, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_pos_x, __pyx_n_s_pos_y, __pyx_n_s_pos_z, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_level, __pyx_n_s_npart, __pyx_n_s_ncells, __pyx_n_s_index_lists, __pyx_n_s_index_list); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(8, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_particle_mesh_o, __pyx_n_s_assign_particles_to_cell_lists, 312, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 312, __pyx_L1_error) + + /* "yt/utilities/lib/particle_mesh_operations.pyx":350 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def recursive_particle_assignment(grids, grid, # <<<<<<<<<<<<<< + * np.ndarray[np.float32_t, ndim=2] left_edges, #many cells + * np.ndarray[np.float32_t, ndim=2] right_edges, + */ + __pyx_tuple__43 = PyTuple_Pack(12, __pyx_n_s_grids, __pyx_n_s_grid, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_pos_x, __pyx_n_s_pos_y, __pyx_n_s_pos_z, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_npart, __pyx_n_s_assigned, __pyx_n_s_never_assigned); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(7, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_particle_mesh_o, __pyx_n_s_recursive_particle_assignment, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 350, __pyx_L1_error) + + /* "View.MemoryView":282 + * 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(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "View.MemoryView":283 + * + * 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(2, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + + /* "View.MemoryView":284 + * 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(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + + /* "View.MemoryView":287 + * + * + * 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(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + + /* "View.MemoryView":288 + * + * 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(2, 288, __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 + */ + __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 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, 0, __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(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_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; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initparticle_mesh_operations(void); /*proto*/ +PyMODINIT_FUNC initparticle_mesh_operations(void) +#else +PyMODINIT_FUNC PyInit_particle_mesh_operations(void); /*proto*/ +PyMODINIT_FUNC PyInit_particle_mesh_operations(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + static PyThread_type_lock __pyx_t_2[8]; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_particle_mesh_operations(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_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 PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("particle_mesh_operations", __pyx_methods, __pyx_k_Simple_integrators_for_the_radi, 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) + __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_yt__utilities__lib__particle_mesh_operations) { + 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, "yt.utilities.lib.particle_mesh_operations")) { + if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.particle_mesh_operations", __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 init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + __pyx_vtabptr_array = &__pyx_vtable_array; + __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + __pyx_type___pyx_array.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error) + __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __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, 326, __pyx_L1_error) + __pyx_type___pyx_memoryview.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + 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, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "yt/utilities/lib/particle_mesh_operations.pyx":18 + * cimport numpy as np + * cimport cython + * import numpy as np # <<<<<<<<<<<<<< + * from yt.utilities.lib.fp_utils cimport imax, fmax, imin, fmin, iclip, fclip + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":23 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def CICDeposit_3(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] posy, + * np.ndarray[np.float64_t, ndim=1] posz, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_1CICDeposit_3, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CICDeposit_3, __pyx_t_1) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":87 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def CICDeposit_2(np.float64_t[:] posx, # <<<<<<<<<<<<<< + * np.float64_t[:] posy, + * np.float64_t[:] mass, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_3CICDeposit_2, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CICDeposit_2, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":140 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def NGPDeposit_2(np.float64_t[:] posx, # <<<<<<<<<<<<<< + * np.float64_t[:] posy, + * np.float64_t[:] mass, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_5NGPDeposit_2, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NGPDeposit_2, __pyx_t_1) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":184 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def sample_field_at_positions(np.ndarray[np.float64_t, ndim=3] arr, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] left_edge, + * np.ndarray[np.float64_t, ndim=1] right_edge, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_7sample_field_at_positions, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o_2); 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_sample_field_at_positions, __pyx_t_1) < 0) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":214 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def CICSample_3(np.ndarray[np.float64_t, ndim=1] posx, # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1] posy, + * np.ndarray[np.float64_t, ndim=1] posz, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_9CICSample_3, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CICSample_3, __pyx_t_1) < 0) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":280 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def assign_particles_to_cells(np.ndarray[np.int32_t, ndim=1] levels, #for cells # <<<<<<<<<<<<<< + * np.ndarray[np.float32_t, ndim=2] left_edges, #many cells + * np.ndarray[np.float32_t, ndim=2] right_edges, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_11assign_particles_to_cells, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_assign_particles_to_cells, __pyx_t_1) < 0) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":312 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def assign_particles_to_cell_lists(np.ndarray[np.int32_t, ndim=1] levels, #for cells # <<<<<<<<<<<<<< + * np.ndarray[np.int32_t,ndim=1] assign, + * np.int64_t level_max, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_13assign_particles_to_cell_lists, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_assign_particles_to_cell_lists, __pyx_t_1) < 0) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":350 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def recursive_particle_assignment(grids, grid, # <<<<<<<<<<<<<< + * np.ndarray[np.float32_t, ndim=2] left_edges, #many cells + * np.ndarray[np.float32_t, ndim=2] right_edges, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_24particle_mesh_operations_15recursive_particle_assignment, NULL, __pyx_n_s_yt_utilities_lib_particle_mesh_o_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_recursive_particle_assignment, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "yt/utilities/lib/particle_mesh_operations.pyx":1 + * """ # <<<<<<<<<<<<<< + * Simple integrators for the radiative transfer equation + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":207 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __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(2, 207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":282 + * 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(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":283 + * + * 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(2, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":284 + * 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(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":287 + * + * + * 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(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":288 + * + * 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(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":312 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":313 + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_2[0] = PyThread_allocate_lock(); + __pyx_t_2[1] = PyThread_allocate_lock(); + __pyx_t_2[2] = PyThread_allocate_lock(); + __pyx_t_2[3] = PyThread_allocate_lock(); + __pyx_t_2[4] = PyThread_allocate_lock(); + __pyx_t_2[5] = PyThread_allocate_lock(); + __pyx_t_2[6] = PyThread_allocate_lock(); + __pyx_t_2[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":535 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 535, __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(2, 535, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":981 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 981, __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(2, 981, __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 + */ + __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(2, 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(2, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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 yt.utilities.lib.particle_mesh_operations", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib.particle_mesh_operations"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #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 + +/* 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)) { @@ -10345,899 +25165,1828 @@ 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; + 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; +} + +/* ArgTypeTest */ +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +/* BufferFormatCheck */ +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } } - -/* ArgTypeTest */ -static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; } -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (likely(Py_TYPE(obj) == type)) return 1; - #if PY_MAJOR_VERSION == 2 - else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(PyObject_TypeCheck(obj, type))) return 1; - } - __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); } -/* BufferFormatCheck */ -static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { - unsigned int n = 1; - return *(unsigned char*)(&n) != 0; +/* 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 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 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; } -static int __Pyx_BufFmt_ParseNumber(const char** ts) { - int count; - const char* t = *ts; - if (*t < '0' || *t > '9') { - return -1; +#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 { - count = *t++ - '0'; - while (*t >= '0' && *t < '9') { - count *= 10; - count += *t++ - '0'; + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; } } - *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; + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + Py_FatalError(msg); + va_end(vargs); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; } -static 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; +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); + } } - } } -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; +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; } } -/* 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); + +/* GetModuleGlobalName */ + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); #endif - 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; + result = __Pyx_GetBuiltinName(name); } + return result; } -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; + +/* 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; } -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 = ""; +#endif + +/* 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(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* BufferFallbackError */ + static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +/* 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 { - expected = ctx->head->field->type->name; - quote = "'"; + return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); } - 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; - } +#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 = PyThreadState_GET(); + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; } - if (!ctx->is_valid_array) { - PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", - ctx->head->field->type->ndim, ndim); - return -1; + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; } - for (i = 0; i < ctx->head->field->type->ndim; i++) { - arraysize *= ctx->head->field->type->arraysize[i]; + 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; } - 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 ( +#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 (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 (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; } - 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; - } + else { + kwtuple = NULL; + k = NULL; } - 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; + 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); } - 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; - } + else { + d = NULL; + nd = 0; } - } while (ctx->enc_count); - ctx->enc_type = 0; - ctx->is_complex = 0; - return 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; } -static CYTHON_INLINE PyObject * -__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) -{ - const char *ts = *tsp; - int i = 0, number; - int ndim = ctx->head->field->type->ndim; -; - ++ts; - if (ctx->new_count != 1) { - PyErr_SetString(PyExc_ValueError, - "Cannot handle repeated arrays in format string"); +#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"); } - 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; + 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 } - 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; + 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 + +/* PyIntBinop */ + #if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + x = (long)((unsigned long)a - b); + if (likely((x^a) >= 0 || (x^~b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + } + } + x = a - b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla - llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("subtract", return NULL) + result = ((double)a) - (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); } - ctx->is_valid_array = 1; - ctx->new_count = 1; - *tsp = ++ts; - return Py_None; + return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } -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; +#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 (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - if (ctx->head != NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; } - return ts; - case ' ': - case '\r': - case '\n': - ++ts; - break; - case '<': - if (!__Pyx_IsLittleEndian()) { - PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); - return NULL; +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; } - ctx->new_packmode = '='; - ++ts; - break; - case '>': - case '!': - if (__Pyx_IsLittleEndian()) { - PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); - return NULL; + 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; } - 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; + } + __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; } - 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); - } + 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; + } + } } - 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; + 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; + } } - 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 { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; } - 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; + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); } +#endif } - } -} -static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { - buf->buf = NULL; - buf->obj = NULL; - buf->strides = __Pyx_zeros; - buf->shape = __Pyx_zeros; - buf->suboffsets = __Pyx_minusones; +bad: + Py_XDECREF(owned_instance); + return; } -static CYTHON_INLINE int __Pyx_GetBufferAndValidate( - Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, - int nd, int cast, __Pyx_BufFmt_StackElem* stack) -{ - if (obj == Py_None || obj == NULL) { - __Pyx_ZeroBuffer(buf); - return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { +#endif + +/* RaiseTooManyValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - nd, buf->ndim); - goto fail; - } - if (!cast) { - __Pyx_BufFmt_Context ctx; - __Pyx_BufFmt_Init(&ctx, stack, dtype); - if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; - } - if ((unsigned)buf->itemsize != dtype->size) { + "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, - "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", - buf->itemsize, (buf->itemsize > 1) ? "s" : "", - dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); - goto fail; - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); } -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { - if (info->buf == NULL) return; - if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; - __Pyx_ReleaseBuffer(info); + +/* RaiseNoneIterError */ + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } -/* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } -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 + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); } #endif -/* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { #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; -} + 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 - -/* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; + 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; } - if (likely(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -/* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { - PyErr_SetString(PyExc_ValueError, - "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); -} - -/* PyCFunctionFastCall */ - #if CYTHON_FAST_PYCCALL -static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { - PyCFunctionObject *func = (PyCFunctionObject*)func_obj; - PyCFunction meth = PyCFunction_GET_FUNCTION(func); - PyObject *self = PyCFunction_GET_SELF(func); - assert(PyCFunction_Check(func)); - assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); - assert(nargs >= 0); - assert(nargs == 0 || args != NULL); - /* _PyCFunction_FastCallDict() must not be called with an exception set, - because it may clear it (directly or indirectly) and so the - caller loses its exception */ - assert(!PyErr_Occurred()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; } -#endif // CYTHON_FAST_PYCCALL -/* PyFunctionFastCall */ - #if CYTHON_FAST_PYCALL -#include "frameobject.h" -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = PyThreadState_GET(); - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = f->f_localsplus; - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; +/* 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; } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; +#endif } -#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; + +/* 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 - 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; + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; } - 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; - } + 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); } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; +#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; } - 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; +#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; + } } - 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; + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* 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_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); + if (likely(PyUnicode_Check(n))) #else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, - k, (int)nk, - d, (int)nd, closure); + if (likely(PyString_Check(n))) #endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL -/* PyObjectCallMethO */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - 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"); +/* 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); } - 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); +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); } -#endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { + return r; +bad: + return NULL; +} + +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} #else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); -#if CYTHON_FAST_PYCCALL - } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { - return __Pyx_PyCFunction_FastCall(func, &arg, 1); +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} #endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif } } - return __Pyx__PyObject_CallOneArg(func, arg); +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* GetItemInt */ + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + 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 -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; + 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)); +} /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { + #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)) + x = (long)((unsigned long)a + b); + if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS @@ -11315,14 +27064,14 @@ goto long_long; #endif } - default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } - x = a - b; + x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: - llx = lla - llb; + llx = lla + llb; return PyLong_FromLongLong(llx); #endif @@ -11333,293 +27082,221 @@ const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; - PyFPE_START_PROTECT("subtract", return NULL) - result = ((double)a) - (double)b; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } - return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif -/* RaiseException */ - #if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { +/* 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 - 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; - } +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif #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; + __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 (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; - } - } + #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_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); } -bad: - Py_XDECREF(owned_instance); - return; -} +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); #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) { - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); } -#endif -/* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { - PyObject *exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; - return PyErr_GivenExceptionMatches(exc_type, err); +/* 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; } -#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; +/* 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; } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); +} + +/* SetVTable */ + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); #else - PyErr_SetExcInfo(local_type, local_value, local_tb); + 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: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); + Py_XDECREF(ob); return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -11699,7 +27376,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -11758,12 +27435,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -11783,6 +27463,8 @@ static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); return -1; } @@ -11800,8 +27482,80 @@ #endif - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + /* 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; +} + +/* 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) @@ -11822,8 +27576,277 @@ return (target_type) value;\ } +/* 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_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__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, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_npy_int64(npy_int64 value) { + 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) { @@ -11854,7 +27877,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -11885,7 +27908,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -11916,7 +27939,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -11936,7 +27959,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -12071,7 +28094,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -12091,7 +28114,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -12226,7 +28249,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -12256,8 +28279,75 @@ } } +/* 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) { + 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 @@ -12446,7 +28536,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -12635,7 +28725,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -12823,8 +28913,197 @@ 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; +} + /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -12840,7 +29119,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -12858,7 +29137,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -12923,7 +29202,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -12948,6 +29227,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -12956,11 +29237,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/particle_mesh_operations.pyx yt-3.4.0/yt/utilities/lib/particle_mesh_operations.pyx --- yt-3.3.3/yt/utilities/lib/particle_mesh_operations.pyx 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/particle_mesh_operations.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -15,6 +15,7 @@ cimport numpy as np cimport cython +import numpy as np from yt.utilities.lib.fp_utils cimport imax, fmax, imin, fmin, iclip, fclip @cython.boundscheck(False) @@ -82,88 +83,97 @@ @cython.boundscheck(False) @cython.wraparound(False) -def CICDeposit_2(np.ndarray[np.float64_t, ndim=1] posx, - np.ndarray[np.float64_t, ndim=1] posy, - np.ndarray[np.float64_t, ndim=1] mass, +@cython.cdivision(True) +def CICDeposit_2(np.float64_t[:] posx, + np.float64_t[:] posy, + np.float64_t[:] mass, np.int64_t npositions, - np.ndarray[np.float64_t, ndim=2] field, - np.ndarray[np.float64_t, ndim=1] leftEdge, - np.ndarray[np.int32_t, ndim=1] gridDimension, - np.ndarray[np.float64_t, ndim=1] cellSize): + np.float64_t[:, :] field, + np.float64_t[:] x_bin_edges, + np.float64_t[:] y_bin_edges): cdef int i1, j1, n cdef np.float64_t xpos, ypos - cdef np.float64_t edge0, edge1 - cdef np.float64_t le0, le1 - cdef np.float64_t dx, dy, dx2, dy2 + cdef np.float64_t edgex, edgey + cdef np.float64_t dx, dy, ddx, ddy, ddx2, ddy2 - edge0 = ( gridDimension[0]) - 0.5001 - edge1 = ( gridDimension[1]) - 0.5001 + edgex = ( x_bin_edges.shape[0] - 1) + 0.5001 + edgey = ( y_bin_edges.shape[0] - 1) + 0.5001 - le0 = leftEdge[0] - le1 = leftEdge[1] + # We are always dealing with uniformly spaced bins for CiC + dx = x_bin_edges[1] - x_bin_edges[0] + dy = y_bin_edges[1] - y_bin_edges[0] for n in range(npositions): # Compute the position of the central cell - xpos = (posx[n] - le0)/cellSize[0] - ypos = (posy[n] - le1)/cellSize[1] + xpos = (posx[n] - x_bin_edges[0])/dx + ypos = (posy[n] - y_bin_edges[0])/dy - if (xpos < 0.5001) or (xpos > edge0): + if (xpos < -0.5001) or (xpos > edgex): continue - if (ypos < 0.5001) or (ypos > edge1): + if (ypos < -0.5001) or (ypos > edgey): continue - i1 = (xpos + 0.5) - j1 = (ypos + 0.5) + i1 = (xpos) + j1 = (ypos) # Compute the weights - dx = ( i1) + 0.5 - xpos - dy = ( j1) + 0.5 - ypos - dx2 = 1.0 - dx - dy2 = 1.0 - dy + ddx = ( i1) + 0.5 - xpos + ddy = ( j1) + 0.5 - ypos + ddx2 = 1.0 - ddx + ddy2 = 1.0 - ddy # Deposit onto field - field[i1-1,j1-1] += mass[n] * dx * dy - field[i1 ,j1-1] += mass[n] * dx2 * dy - field[i1-1,j1 ] += mass[n] * dx * dy2 - field[i1 ,j1 ] += mass[n] * dx2 * dy2 + if i1 > 0 and j1 > 0: + field[i1-1,j1-1] += mass[n] * ddx * ddy + if j1 > 0 and i1 < field.shape[0]: + field[i1 ,j1-1] += mass[n] * ddx2 * ddy + if i1 > 0 and j1 < field.shape[1]: + field[i1-1,j1 ] += mass[n] * ddx * ddy2 + if i1 < field.shape[0] and j1 < field.shape[1]: + field[i1 ,j1 ] += mass[n] * ddx2 * ddy2 @cython.boundscheck(False) @cython.wraparound(False) -def NGPDeposit_2(np.ndarray[np.float64_t, ndim=1] posx, - np.ndarray[np.float64_t, ndim=1] posy, - np.ndarray[np.float64_t, ndim=1] mass, +@cython.cdivision(True) +def NGPDeposit_2(np.float64_t[:] posx, + np.float64_t[:] posy, + np.float64_t[:] mass, np.int64_t npositions, - np.ndarray[np.float64_t, ndim=2] field, - np.ndarray[np.float64_t, ndim=1] leftEdge, - np.ndarray[np.int32_t, ndim=1] gridDimension, - np.ndarray[np.float64_t, ndim=1] cellSize): + np.float64_t[:, :] field, + np.float64_t[:] x_bin_edges, + np.float64_t[:] y_bin_edges): - cdef int i1, j1, n + cdef int i, j, i1, j1, n cdef np.float64_t xpos, ypos cdef np.float64_t edge0, edge1 cdef np.float64_t le0, le1 + cdef np.float64_t[2] x_endpoints + cdef np.float64_t[2] y_endpoints - edge0 = ( gridDimension[0]) - 0.5001 - edge1 = ( gridDimension[1]) - 0.5001 - - le0 = leftEdge[0] - le1 = leftEdge[1] + x_endpoints = (x_bin_edges[0], x_bin_edges[x_bin_edges.shape[0] - 1]) + y_endpoints = (y_bin_edges[0], y_bin_edges[y_bin_edges.shape[0] - 1]) for n in range(npositions): - # Compute the position of the central cell - xpos = (posx[n] - le0)/cellSize[0] - ypos = (posy[n] - le1)/cellSize[1] + xpos = posx[n] + ypos = posy[n] - if (xpos < 0.5001) or (xpos > edge0): + if (xpos < x_endpoints[0]) or (xpos > x_endpoints[1]): continue - if (ypos < 0.5001) or (ypos > edge1): + if (ypos < y_endpoints[0]) or (ypos > y_endpoints[1]): continue - i1 = (xpos + 0.5) - j1 = (ypos + 0.5) + for i in range(x_bin_edges.shape[0]): + if (xpos >= x_bin_edges[i]) and (xpos < x_bin_edges[i+1]): + i1 = i + break + + for j in range(y_bin_edges.shape[0]): + if (ypos >= y_bin_edges[j]) and (ypos < y_bin_edges[j+1]): + j1 = j + break # Deposit onto field field[i1,j1] += mass[n] diff -Nru yt-3.3.3/yt/utilities/lib/partitioned_grid.c yt-3.4.0/yt/utilities/lib/partitioned_grid.c --- yt-3.3.3/yt/utilities/lib/partitioned_grid.c 2016-12-12 01:41:58.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/partitioned_grid.c 2017-08-10 18:20:53.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -7,10 +7,16 @@ "yt/utilities/lib/fixed_interpolator.h" ], "include_dirs": [ + "./yt/utilities/lib", "yt/utilities/lib/" ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.partitioned_grid", + "sources": [ + "yt/utilities/lib/partitioned_grid.pyx", + "yt/utilities/lib/fixed_interpolator.c" ] }, "module_name": "yt.utilities.lib.partitioned_grid" @@ -24,7 +30,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -46,6 +52,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -198,16 +205,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -334,6 +345,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -388,6 +405,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -496,8 +542,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -510,8 +556,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -633,10 +682,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -670,6 +721,7 @@ static const char *__pyx_f[] = { "yt/utilities/lib/partitioned_grid.pyx", + "stringsource", "yt/utilities/lib/partitioned_grid.pxd", "__init__.pxd", "type.pxd", @@ -1124,7 +1176,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) /* ExtTypeTest.proto */ @@ -1293,9 +1345,15 @@ /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1524,6 +1582,7 @@ /* Implementation of 'yt.utilities.lib.partitioned_grid' */ static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ImportError; @@ -1540,13 +1599,17 @@ static const char __pyx_k_numpy[] = "numpy"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_left_edge[] = "left_edge"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_right_edge[] = "right_edge"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_parent_grid_id[] = "parent_grid_id"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Image_sampler_definitions[] = "\nImage sampler definitions\n\n\n\n"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; @@ -1554,6 +1617,7 @@ 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_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; @@ -1561,7 +1625,9 @@ static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_dims; static PyObject *__pyx_n_s_h; @@ -1572,6 +1638,7 @@ static PyObject *__pyx_n_s_mask; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +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; @@ -1580,7 +1647,9 @@ static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_right_edge; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_sqrt; static PyObject *__pyx_n_s_test; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; @@ -1601,6 +1670,8 @@ static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */ static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, CYTHON_UNUSED 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 PyObject *__pyx_tp_new_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -1613,6 +1684,8 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; /* "yt/utilities/lib/partitioned_grid.pyx":27 * @cython.wraparound(False) @@ -1642,11 +1715,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -1655,26 +1734,31 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parent_grid_id)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dims)) != 0)) kw_args--; else { @@ -2193,8 +2277,11 @@ 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; } @@ -2203,11 +2290,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("integrate_streamline", 1, 3, 3, 1); __PYX_ERR(0, 70, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mag)) != 0)) kw_args--; else { @@ -3334,7 +3423,7 @@ __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); - __Pyx_WriteUnraisable("yt.utilities.lib.partitioned_grid.PartitionedGrid.get_vector_field", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.partitioned_grid.PartitionedGrid.get_vector_field", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } @@ -3746,7 +3835,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->parent_grid_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->parent_grid_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3781,7 +3870,7 @@ __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 27, __pyx_L1_error) __pyx_v_self->parent_grid_id = __pyx_t_1; /* function exit code */ @@ -3795,98 +3884,109 @@ return __pyx_r; } -/* "volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { - int __pyx_r; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("vc_index", 0); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_6__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self)); - /* "volume_container.pxd":31 - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): - * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__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_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, 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) - /* "volume_container.pxd":30 - * int dims[3] - * - * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * + /* "(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_L0:; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.partitioned_grid.PartitionedGrid.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i +/* "(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__") */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { - int __pyx_v_index[3]; - int __pyx_v_i; - int __pyx_r; +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("vc_pos_index", 0); + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "volume_container.pxd":36 - * cdef int index[3] - * cdef int i - * for i in range(3): # <<<<<<<<<<<<<< - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "volume_container.pxd":37 - * cdef int i - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< - * return vc_index(vc, index[0], index[1], index[2]) - * - */ - (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); - } +static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__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); - /* "volume_container.pxd":38 - * for i in range(3): - * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) - * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< - * + /* "(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_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, 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) - /* "volume_container.pxd":33 - * return (i*vc.dims[1]+j)*vc.dims[2]+k - * - * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< - * cdef int index[3] - * cdef int i + /* "(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_L0:; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("yt.utilities.lib.partitioned_grid.PartitionedGrid.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4060,11 +4160,11 @@ * * 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(2, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 218, __pyx_L1_error) + __PYX_ERR(3, 218, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 @@ -4116,11 +4216,11 @@ * * 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(2, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 222, __pyx_L1_error) + __PYX_ERR(3, 222, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") @@ -4425,11 +4525,11 @@ * 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(2, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 259, __pyx_L1_error) + __PYX_ERR(3, 259, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: @@ -4636,22 +4736,22 @@ * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 278, __pyx_L1_error) + __PYX_ERR(3, 278, __pyx_L1_error) break; } @@ -4718,7 +4818,7 @@ * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(3, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 @@ -4877,7 +4977,7 @@ * 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, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4924,7 +5024,7 @@ * 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, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4971,7 +5071,7 @@ * 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, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5018,7 +5118,7 @@ * 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, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5065,7 +5165,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5146,15 +5246,15 @@ */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(2, 794, __pyx_L1_error) + __PYX_ERR(3, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_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, 794, __pyx_L1_error) + __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(3, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); @@ -5169,11 +5269,11 @@ */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 795, __pyx_L1_error) + __PYX_ERR(3, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -5194,7 +5294,7 @@ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 796, __pyx_L1_error) + __PYX_ERR(3, 796, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -5202,15 +5302,15 @@ __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, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); @@ -5223,12 +5323,12 @@ * 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, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { @@ -5240,11 +5340,11 @@ * * 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(2, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 799, __pyx_L1_error) + __PYX_ERR(3, 799, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields @@ -5308,11 +5408,11 @@ * # 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(2, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 803, __pyx_L1_error) + __PYX_ERR(3, 803, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") @@ -5331,11 +5431,11 @@ * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; @@ -5395,7 +5495,7 @@ * 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, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; @@ -5417,11 +5517,11 @@ * * # 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(2, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 823, __pyx_L1_error) + __PYX_ERR(3, 823, __pyx_L1_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): @@ -5439,11 +5539,11 @@ * 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, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -5457,11 +5557,11 @@ * 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, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -5475,11 +5575,11 @@ * 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, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; @@ -5493,11 +5593,11 @@ * 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, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -5511,11 +5611,11 @@ * 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, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; @@ -5529,11 +5629,11 @@ * 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, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -5547,11 +5647,11 @@ * 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, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; @@ -5565,11 +5665,11 @@ * 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, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -5583,11 +5683,11 @@ * 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, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; @@ -5601,11 +5701,11 @@ * 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, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -5619,11 +5719,11 @@ * 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, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; @@ -5637,11 +5737,11 @@ * 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, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; @@ -5655,11 +5755,11 @@ * 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, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; @@ -5673,11 +5773,11 @@ * 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, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5693,11 +5793,11 @@ * 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, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5713,11 +5813,11 @@ * 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, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5733,11 +5833,11 @@ * 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, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -5752,19 +5852,19 @@ * 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, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 844, __pyx_L1_error) + __PYX_ERR(3, 844, __pyx_L1_error) } __pyx_L15:; @@ -5795,7 +5895,7 @@ * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(3, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; @@ -6059,7 +6159,7 @@ * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 987, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 * # Cython code. @@ -6072,7 +6172,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -6086,7 +6186,7 @@ __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, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 988, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -6098,11 +6198,11 @@ * * 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(2, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 989, __pyx_L5_except_error) + __PYX_ERR(3, 989, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -6120,7 +6220,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -6190,7 +6290,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 993, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * @@ -6203,7 +6303,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -6217,7 +6317,7 @@ __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, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 994, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -6229,11 +6329,11 @@ * * 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(2, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 995, __pyx_L5_except_error) + __PYX_ERR(3, 995, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -6251,7 +6351,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -6321,7 +6421,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 999, __pyx_L3_error) /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * @@ -6334,7 +6434,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -6347,7 +6447,7 @@ __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, 1000, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); @@ -6357,11 +6457,11 @@ * 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(2, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 1001, __pyx_L5_except_error) + __PYX_ERR(3, 1001, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; @@ -6379,7 +6479,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -6404,6 +6504,102 @@ __Pyx_RefNannyFinishContext(); return __pyx_r; } + +/* "volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + */ + +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("vc_index", 0); + + /* "volume_container.pxd":31 + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): + * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<< + * + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): + */ + __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k); + goto __pyx_L0; + + /* "volume_container.pxd":30 + * int dims[3] + * + * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<< + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i + */ + +static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) { + int __pyx_v_index[3]; + int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("vc_pos_index", 0); + + /* "volume_container.pxd":36 + * cdef int index[3] + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "volume_container.pxd":37 + * cdef int i + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<< + * return vc_index(vc, index[0], index[1], index[2]) + * + */ + (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i]))); + } + + /* "volume_container.pxd":38 + * for i in range(3): + * index[i] = ((spos[i] - vc.left_edge[i]) * vc.idds[i]) + * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<< + * + */ + __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2])); + goto __pyx_L0; + + /* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k + * + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} static struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid __pyx_vtable_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid; static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid(PyTypeObject *t, PyObject *a, PyObject *k) { @@ -6431,7 +6627,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid(PyObject *o) { struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *p = (struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + 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 @@ -6555,6 +6751,8 @@ static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid[] = { {"integrate_streamline", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_5integrate_streamline, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -6653,7 +6851,9 @@ {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 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_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, @@ -6664,6 +6864,7 @@ {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 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_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}, @@ -6672,7 +6873,9 @@ {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 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_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, @@ -6680,9 +6883,10 @@ }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 45, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 799, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 218, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 989, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -6692,6 +6896,25 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 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_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(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__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): @@ -6699,9 +6922,9 @@ * * 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(2, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(3, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -6710,9 +6933,9 @@ * * 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(2, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(3, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -6721,9 +6944,9 @@ * 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(2, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(3, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -6732,9 +6955,9 @@ * * 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(2, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(3, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -6743,9 +6966,9 @@ * # 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(2, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -6754,9 +6977,9 @@ * * # 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(2, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -6765,9 +6988,9 @@ * * 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(2, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -6776,18 +6999,18 @@ * * 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(2, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _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(2, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -6858,6 +7081,7 @@ __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 @@ -6892,6 +7116,7 @@ __pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid) < 0) __PYX_ERR(0, 22, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "PartitionedGrid", (PyObject *)&__pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = &__pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -6900,12 +7125,12 @@ #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, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(4, 9, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 861, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -6935,12 +7160,12 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "volume_container.pxd":33 + * return (i*vc.dims[1]+j)*vc.dims[2]+k * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<< + * cdef int index[3] + * cdef int i */ /*--- Wrapped vars code ---*/ @@ -6950,7 +7175,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.partitioned_grid", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.partitioned_grid", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -7747,9 +7972,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -7762,9 +7990,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -7912,17 +8143,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -8041,8 +8277,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON @@ -8102,11 +8338,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -8129,7 +8361,7 @@ #endif /* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + 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; @@ -8171,7 +8403,7 @@ } /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -8334,25 +8566,25 @@ #endif /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -8376,7 +8608,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -8386,7 +8618,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -8447,7 +8679,7 @@ } /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -8464,8 +8696,73 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -8538,8 +8835,42 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -8619,7 +8950,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -8678,12 +9009,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -8720,8 +9054,8 @@ #endif - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + /* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -8743,7 +9077,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -8774,7 +9108,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -8805,7 +9139,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -8825,7 +9159,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -8960,7 +9294,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -8980,7 +9314,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -9115,7 +9449,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -9146,7 +9480,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -9335,7 +9669,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -9524,7 +9858,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -9540,7 +9874,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -9558,7 +9892,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -9623,7 +9957,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -9648,6 +9982,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -9656,11 +9992,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/pixelization_routines.c yt-3.4.0/yt/utilities/lib/pixelization_routines.c --- yt-3.3.3/yt/utilities/lib/pixelization_routines.c 2016-12-12 01:42:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/pixelization_routines.c 2017-08-10 18:20:55.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -7,10 +7,16 @@ "yt/utilities/lib/pixelization_constants.h" ], "include_dirs": [ + "yt/utilities/lib", "yt/utilities/lib/" ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.pixelization_routines", + "sources": [ + "yt/utilities/lib/pixelization_routines.pyx", + "yt/utilities/lib/pixelization_constants.c" ] }, "module_name": "yt.utilities.lib.pixelization_routines" @@ -24,7 +30,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -46,6 +52,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -198,16 +205,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -334,6 +345,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -388,6 +405,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -499,8 +545,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -513,8 +559,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -636,10 +685,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -678,6 +729,16 @@ "type.pxd", "yt/utilities/lib/element_mappings.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; + /* BufferFormatStructs.proto */ #define IS_UNSIGNED(type) (((type) -1) > 0) struct __Pyx_StructField_; @@ -714,16 +775,6 @@ char is_valid_array; } __Pyx_BufFmt_Context; -/* 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; - /* Atomics.proto */ #include #ifndef CYTHON_ATOMICS @@ -989,6 +1040,7 @@ /*--- Type declarations ---*/ struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler; +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; @@ -997,6 +1049,9 @@ struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D; +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D; +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D; +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D; struct __pyx_array_obj; struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; @@ -1038,7 +1093,7 @@ */ typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "yt/utilities/lib/element_mappings.pxd":81 +/* "yt/utilities/lib/element_mappings.pxd":96 * # once it is converged. * # * ctypedef void (*func_type)(double* fx, # <<<<<<<<<<<<<< @@ -1047,7 +1102,7 @@ */ typedef void (*__pyx_t_2yt_9utilities_3lib_16element_mappings_func_type)(double *, double *, double *, double *); -/* "yt/utilities/lib/element_mappings.pxd":101 +/* "yt/utilities/lib/element_mappings.pxd":116 * # tcol - the third column of the jaocobian * # * ctypedef void (*jac_type3D)(double* rcol, # <<<<<<<<<<<<<< @@ -1056,14 +1111,14 @@ */ typedef void (*__pyx_t_2yt_9utilities_3lib_16element_mappings_jac_type3D)(double *, double *, double *, double *, double *, double *); -/* "yt/utilities/lib/element_mappings.pxd":123 - * # The order of this array is [J11, J12, J21, J22] +/* "yt/utilities/lib/element_mappings.pxd":138 + * # scol - the second column of the jacobian * # - * ctypedef void (*jac_type2D)(double* A, # <<<<<<<<<<<<<< + * ctypedef void (*jac_type2D)(double* rcol, # <<<<<<<<<<<<<< + * double* scol, * double* x, - * double* vertices, */ -typedef void (*__pyx_t_2yt_9utilities_3lib_16element_mappings_jac_type2D)(double *, double *, double *, double *); +typedef void (*__pyx_t_2yt_9utilities_3lib_16element_mappings_jac_type2D)(double *, double *, double *, double *, double *); /* "yt/utilities/lib/element_mappings.pxd":7 * from libc.math cimport fabs, fmax @@ -1083,6 +1138,18 @@ /* "yt/utilities/lib/element_mappings.pxd":36 * * + * cdef class P1Sampler1D(ElementSampler): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler __pyx_base; +}; + + +/* "yt/utilities/lib/element_mappings.pxd":51 + * + * * cdef class P1Sampler2D(ElementSampler): # <<<<<<<<<<<<<< * * cdef void map_real_to_unit(self, @@ -1092,7 +1159,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":51 +/* "yt/utilities/lib/element_mappings.pxd":66 * * * cdef class P1Sampler3D(ElementSampler): # <<<<<<<<<<<<<< @@ -1104,7 +1171,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":129 +/* "yt/utilities/lib/element_mappings.pxd":145 * * * cdef class NonlinearSolveSampler3D(ElementSampler): # <<<<<<<<<<<<<< @@ -1121,7 +1188,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":143 +/* "yt/utilities/lib/element_mappings.pxd":159 * * * cdef class Q1Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1133,7 +1200,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":160 +/* "yt/utilities/lib/element_mappings.pxd":176 * * * cdef class W1Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1145,7 +1212,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":178 +/* "yt/utilities/lib/element_mappings.pxd":194 * * * cdef class S2Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1157,7 +1224,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":196 +/* "yt/utilities/lib/element_mappings.pxd":212 * * * cdef class NonlinearSolveSampler2D(ElementSampler): # <<<<<<<<<<<<<< @@ -1174,7 +1241,7 @@ }; -/* "yt/utilities/lib/element_mappings.pxd":210 +/* "yt/utilities/lib/element_mappings.pxd":226 * * * cdef class Q1Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< @@ -1186,6 +1253,42 @@ }; +/* "yt/utilities/lib/element_mappings.pxd":241 + * + * + * cdef class Q2Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_base; +}; + + +/* "yt/utilities/lib/element_mappings.pxd":256 + * + * + * cdef class T2Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_base; +}; + + +/* "yt/utilities/lib/element_mappings.pxd":270 + * cdef int check_inside(self, double* mapped_coord) nogil + * + * cdef class Tet2Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ +struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D { + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D __pyx_base; +}; + + /* "View.MemoryView":103 * * @cname("__pyx_array") @@ -1285,6 +1388,20 @@ /* "yt/utilities/lib/element_mappings.pxd":36 * * + * cdef class P1Sampler1D(ElementSampler): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler1D { + struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler1D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler1D; + + +/* "yt/utilities/lib/element_mappings.pxd":51 + * + * * cdef class P1Sampler2D(ElementSampler): # <<<<<<<<<<<<<< * * cdef void map_real_to_unit(self, @@ -1296,7 +1413,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D; -/* "yt/utilities/lib/element_mappings.pxd":51 +/* "yt/utilities/lib/element_mappings.pxd":66 * * * cdef class P1Sampler3D(ElementSampler): # <<<<<<<<<<<<<< @@ -1310,7 +1427,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D; -/* "yt/utilities/lib/element_mappings.pxd":129 +/* "yt/utilities/lib/element_mappings.pxd":145 * * * cdef class NonlinearSolveSampler3D(ElementSampler): # <<<<<<<<<<<<<< @@ -1324,7 +1441,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D; -/* "yt/utilities/lib/element_mappings.pxd":143 +/* "yt/utilities/lib/element_mappings.pxd":159 * * * cdef class Q1Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1338,7 +1455,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D; -/* "yt/utilities/lib/element_mappings.pxd":160 +/* "yt/utilities/lib/element_mappings.pxd":176 * * * cdef class W1Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1352,7 +1469,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_W1Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D; -/* "yt/utilities/lib/element_mappings.pxd":178 +/* "yt/utilities/lib/element_mappings.pxd":194 * * * cdef class S2Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< @@ -1366,7 +1483,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_S2Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D; -/* "yt/utilities/lib/element_mappings.pxd":196 +/* "yt/utilities/lib/element_mappings.pxd":212 * * * cdef class NonlinearSolveSampler2D(ElementSampler): # <<<<<<<<<<<<<< @@ -1380,7 +1497,7 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D; -/* "yt/utilities/lib/element_mappings.pxd":210 +/* "yt/utilities/lib/element_mappings.pxd":226 * * * cdef class Q1Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< @@ -1394,6 +1511,48 @@ static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D; +/* "yt/utilities/lib/element_mappings.pxd":241 + * + * + * cdef class Q2Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D { + struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D; + + +/* "yt/utilities/lib/element_mappings.pxd":256 + * + * + * cdef class T2Sampler2D(NonlinearSolveSampler2D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_T2Sampler2D { + struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_T2Sampler2D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_T2Sampler2D; + + +/* "yt/utilities/lib/element_mappings.pxd":270 + * cdef int check_inside(self, double* mapped_coord) nogil + * + * cdef class Tet2Sampler3D(NonlinearSolveSampler3D): # <<<<<<<<<<<<<< + * + * cdef void map_real_to_unit(self, + */ + +struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D { + struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D __pyx_base; +}; +static struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D *__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D; + + /* "View.MemoryView":103 * * @cname("__pyx_array") @@ -1536,19 +1695,6 @@ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); -/* ArgTypeTest.proto */ -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); - -/* BufferFormatCheck.proto */ -static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, - __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO - /* 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) ?\ @@ -1608,32 +1754,22 @@ /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -#if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); -#else -#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) -#endif -#endif - -/* PyCFunctionFastCall.proto */ -#if CYTHON_FAST_PYCCALL -static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); -#else -#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) -#endif - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); +/* 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() -/* BufferFallbackError.proto */ -static void __Pyx_RaiseBufferFallbackError(void); +/* BufferFormatCheck.proto */ +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); -#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) -#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) /* MemviewSliceInit.proto */ #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d #define __Pyx_MEMVIEW_DIRECT 1 @@ -1660,6 +1796,31 @@ static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* BufferFallbackError.proto */ +static void __Pyx_RaiseBufferFallbackError(void); + +#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); @@ -1675,14 +1836,6 @@ #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif -/* SliceObject.proto */ -#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\ - __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) -static CYTHON_INLINE int __Pyx_PyObject_SetSlice( - PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, - PyObject** py_start, PyObject** py_stop, PyObject** py_slice, - int has_cstart, int has_cstop, int wraparound); - /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); @@ -1703,7 +1856,23 @@ /* IncludeStringH.proto */ #include +/* ArgTypeTest.proto */ +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); + #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2) +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace); +#else +#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\ + (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) +#endif + +/* BufferIndexError.proto */ +static void __Pyx_RaiseBufferIndexError(int axis); + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { @@ -1780,12 +1949,29 @@ /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); +/* 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) @@ -1864,14 +2050,23 @@ /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); /* CodeObjectCache.proto */ typedef struct { @@ -1946,13 +2141,13 @@ PyObject *original_obj); /* ObjectToMemviewSlice.proto */ -static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *); +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *); /* ObjectToMemviewSlice.proto */ -static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *); +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *); /* ObjectToMemviewSlice.proto */ -static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *); +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); @@ -1960,8 +2155,9 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value); @@ -1969,6 +2165,9 @@ /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); + /* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -2084,11 +2283,14 @@ static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); +static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); @@ -2157,9 +2359,9 @@ /* Module declarations from 'libc.math' */ /* Module declarations from 'yt.utilities.lib.fp_utils' */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t); /*proto*/ static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/ @@ -2172,6 +2374,7 @@ /* Module declarations from 'yt.utilities.lib.element_mappings' */ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = 0; @@ -2180,6 +2383,9 @@ static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = 0; static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D = 0; +static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D = 0; /* Module declarations from 'yt.utilities.lib.pixelization_routines' */ static PyTypeObject *__pyx_array_type = 0; @@ -2226,8 +2432,10 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +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_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 }; #define __Pyx_MODULE_NAME "yt.utilities.lib.pixelization_routines" int __pyx_module_is_main_yt__utilities__lib__pixelization_routines = 0; @@ -2238,15 +2446,15 @@ static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; -static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_O[] = "O"; -static const char __pyx_k_T[] = "T"; 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_k[] = "k"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_p[] = "p"; static const char __pyx_k_x[] = "x"; @@ -2264,7 +2472,10 @@ static const char __pyx_k_dy[] = "dy"; static const char __pyx_k_fi[] = "fi"; static const char __pyx_k_id[] = "id"; +static const char __pyx_k_ii[] = "ii"; static const char __pyx_k_ip[] = "ip"; +static const char __pyx_k_jj[] = "jj"; +static const char __pyx_k_kk[] = "kk"; static const char __pyx_k_lc[] = "lc"; static const char __pyx_k_lr[] = "lr"; static const char __pyx_k_md[] = "md"; @@ -2275,6 +2486,7 @@ static const char __pyx_k_pk[] = "pk"; static const char __pyx_k_px[] = "px"; static const char __pyx_k_py[] = "py"; +static const char __pyx_k_pz[] = "pz"; static const char __pyx_k_r0[] = "r0"; static const char __pyx_k_rc[] = "rc"; static const char __pyx_k_rr[] = "rr"; @@ -2289,7 +2501,9 @@ static const char __pyx_k_dds[] = "dds"; static const char __pyx_k_dsp[] = "dsp"; static const char __pyx_k_img[] = "img"; +static const char __pyx_k_ind[] = "ind"; static const char __pyx_k_nan[] = "nan"; +static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_pLE[] = "pLE"; static const char __pyx_k_pRE[] = "pRE"; @@ -2303,11 +2517,12 @@ static const char __pyx_k_ysp[] = "ysp"; static const char __pyx_k_zsp[] = "zsp"; static const char __pyx_k_base[] = "base"; -static const char __pyx_k_cols[] = "cols"; +static const char __pyx_k_buff[] = "buff"; static const char __pyx_k_conn[] = "conn"; static const char __pyx_k_cxpx[] = "cxpx"; static const char __pyx_k_cypx[] = "cypx"; static const char __pyx_k_data[] = "data"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_dphi[] = "dphi"; static const char __pyx_k_dr_i[] = "dr_i"; static const char __pyx_k_dxsp[] = "dxsp"; @@ -2324,15 +2539,16 @@ 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_oxsp[] = "oxsp"; static const char __pyx_k_oysp[] = "oysp"; +static const char __pyx_k_ozsp[] = "ozsp"; static const char __pyx_k_pack[] = "pack"; static const char __pyx_k_pend[] = "pend"; static const char __pyx_k_phi0[] = "phi0"; static const char __pyx_k_pxsp[] = "pxsp"; static const char __pyx_k_pysp[] = "pysp"; static const char __pyx_k_rmax[] = "rmax"; -static const char __pyx_k_rows[] = "rows"; static const char __pyx_k_rxpx[] = "rxpx"; static const char __pyx_k_rypx[] = "rypx"; static const char __pyx_k_size[] = "size"; @@ -2345,6 +2561,7 @@ static const char __pyx_k_ymin[] = "ymin"; 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_field[] = "field"; @@ -2378,16 +2595,21 @@ static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_ipx_dx[] = "ipx_dx"; static const char __pyx_k_ipx_dy[] = "ipx_dy"; +static const char __pyx_k_linalg[] = "linalg"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_period[] = "period"; +static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_ppoint[] = "ppoint"; static const char __pyx_k_pstart[] = "pstart"; static const char __pyx_k_radius[] = "radius"; +static const char __pyx_k_result[] = "result"; static const char __pyx_k_struct[] = "struct"; static const char __pyx_k_theta0[] = "theta0"; static const char __pyx_k_unpack[] = "unpack"; +static const char __pyx_k_update[] = "update"; static const char __pyx_k_xiterv[] = "xiterv"; static const char __pyx_k_yiterv[] = "yiterv"; +static const char __pyx_k_asarray[] = "asarray"; static const char __pyx_k_corners[] = "corners"; static const char __pyx_k_dradius[] = "dradius"; static const char __pyx_k_extents[] = "extents"; @@ -2395,7 +2617,10 @@ static const char __pyx_k_fortran[] = "fortran"; static const char __pyx_k_indices[] = "indices"; static const char __pyx_k_inv_mat[] = "inv_mat"; +static const char __pyx_k_lin_inc[] = "lin_inc"; +static const char __pyx_k_lin_vec[] = "lin_vec"; static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_npoints[] = "npoints"; static const char __pyx_k_rbounds[] = "rbounds"; static const char __pyx_k_sampler[] = "sampler"; static const char __pyx_k_theta_i[] = "theta_i"; @@ -2405,40 +2630,59 @@ static const char __pyx_k_dtheta_i[] = "dtheta_i"; static const char __pyx_k_dtheta_p[] = "dtheta_p"; static const char __pyx_k_itemsize[] = "itemsize"; -static const char __pyx_k_my_array[] = "my_array"; static const char __pyx_k_overlap1[] = "overlap1"; static const char __pyx_k_overlap2[] = "overlap2"; static const char __pyx_k_period_x[] = "period_x"; static const char __pyx_k_period_y[] = "period_y"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_sintheta[] = "sintheta"; static const char __pyx_k_vertices[] = "vertices"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_antialias[] = "antialias"; static const char __pyx_k_buff_size[] = "buff_size"; static const char __pyx_k_dthetamin[] = "dthetamin"; +static const char __pyx_k_end_point[] = "end_point"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_input_img[] = "input_img"; static const char __pyx_k_nvertices[] = "nvertices"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_arc_length[] = "arc_length"; static const char __pyx_k_field_vals[] = "field_vals"; +static const char __pyx_k_inc_length[] = "inc_length"; +static const char __pyx_k_lin_length[] = "lin_length"; static const char __pyx_k_line_width[] = "line_width"; static const char __pyx_k_phi_offset[] = "phi_offset"; 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_plot_values[] = "plot_values"; +static const char __pyx_k_start_point[] = "start_point"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_check_period[] = "check_period"; static const char __pyx_k_index_offset[] = "index_offset"; static const char __pyx_k_mapped_coord[] = "mapped_coord"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_sample_point[] = "sample_point"; +static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_theta_offset[] = "theta_offset"; +static const char __pyx_k_num_intervals[] = "num_intervals"; static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_num_field_vals[] = "num_field_vals"; +static const char __pyx_k_num_plot_nodes[] = "num_plot_nodes"; +static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; static const char __pyx_k_YTPixelizeError[] = "YTPixelizeError"; 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_pixelize_aitoff[] = "pixelize_aitoff"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_lin_sample_points[] = "lin_sample_points"; static const char __pyx_k_pixelize_cylinder[] = "pixelize_cylinder"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pixelize_cartesian[] = "pixelize_cartesian"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_strided_and_indirect[] = ""; @@ -2450,22 +2694,24 @@ static const char __pyx_k_contiguous_and_indirect[] = ""; static const char __pyx_k_yt_utilities_exceptions[] = "yt.utilities.exceptions"; static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; -static const char __pyx_k_Cannot_scale_to_zero_size[] = "Cannot scale to zero size"; +static const char __pyx_k_pixelize_cartesian_nodal[] = "pixelize_cartesian_nodal"; static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; static const char __pyx_k_YTElementTypeNotRecognized[] = "YTElementTypeNotRecognized"; +static const char __pyx_k_pixelize_element_mesh_line[] = "pixelize_element_mesh_line"; 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_pixelize_off_axis_cartesian[] = "pixelize_off_axis_cartesian"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/pixelization_routines.pyx"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_Arrays_are_not_of_correct_shape[] = "Arrays are not of correct shape."; +static const char __pyx_k_Check_to_see_that_both_starting[] = "Check to see that both starting and ending line points are within the domain of the mesh."; static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_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"; @@ -2474,21 +2720,24 @@ 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_yt_utilities_lib_pixelization_ro[] = "yt.utilities.lib.pixelization_routines"; +static const char __pyx_k_yt_utilities_lib_pixelization_ro[] = "yt/utilities/lib/pixelization_routines.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_utilities_lib_pixelization_ro_2[] = "yt.utilities.lib.pixelization_routines"; static PyObject *__pyx_n_s_ASCII; static PyObject *__pyx_kp_s_Arrays_are_not_of_correct_shape; static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; static PyObject *__pyx_kp_s_Cannot_index_with_type_s; -static PyObject *__pyx_kp_s_Cannot_scale_to_zero_size; +static PyObject *__pyx_kp_s_Check_to_see_that_both_starting; 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; @@ -2501,21 +2750,24 @@ static PyObject *__pyx_n_b_O; static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; static PyObject *__pyx_n_s_PI; +static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_n_s_RE; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_kp_s_Slices_of_2D_datasets_must_be_pe; -static PyObject *__pyx_n_s_T; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_n_s_YTElementTypeNotRecognized; static PyObject *__pyx_n_s_YTPixelizeError; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_antialias; +static PyObject *__pyx_n_s_arc_length; static PyObject *__pyx_n_s_argmax; +static PyObject *__pyx_n_s_asarray; static PyObject *__pyx_n_s_base; static PyObject *__pyx_n_s_bounds; +static PyObject *__pyx_n_s_buff; static PyObject *__pyx_n_s_buff_size; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_u_c; @@ -2524,10 +2776,11 @@ static PyObject *__pyx_n_s_ci; static PyObject *__pyx_n_s_cj; static PyObject *__pyx_n_s_class; -static PyObject *__pyx_n_s_cols; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_conn; 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_coords; static PyObject *__pyx_n_s_corners; static PyObject *__pyx_n_s_costheta; @@ -2538,6 +2791,7 @@ static PyObject *__pyx_n_s_cz; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_dds; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dphi; static PyObject *__pyx_n_s_dphi_p; static PyObject *__pyx_n_s_dr_i; @@ -2555,6 +2809,7 @@ static PyObject *__pyx_n_s_dysp; static PyObject *__pyx_n_s_dzsp; static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_end_point; static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_extents; @@ -2571,9 +2826,12 @@ static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_idds; +static PyObject *__pyx_n_s_ii; static PyObject *__pyx_n_s_imax; static PyObject *__pyx_n_s_img; static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_inc_length; +static PyObject *__pyx_n_s_ind; static PyObject *__pyx_n_s_index_offset; static PyObject *__pyx_n_s_indices; static PyObject *__pyx_n_s_input_img; @@ -2585,9 +2843,17 @@ 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_jj; +static PyObject *__pyx_n_s_k; +static PyObject *__pyx_n_s_kk; static PyObject *__pyx_n_s_lc; static PyObject *__pyx_n_s_ld_x; static PyObject *__pyx_n_s_ld_y; +static PyObject *__pyx_n_s_lin_inc; +static PyObject *__pyx_n_s_lin_length; +static PyObject *__pyx_n_s_lin_sample_points; +static PyObject *__pyx_n_s_lin_vec; +static PyObject *__pyx_n_s_linalg; static PyObject *__pyx_n_s_line_width; static PyObject *__pyx_n_s_lr; static PyObject *__pyx_n_s_lxpx; @@ -2598,7 +2864,6 @@ static PyObject *__pyx_n_s_md; static PyObject *__pyx_n_s_memview; static PyObject *__pyx_n_s_mode; -static PyObject *__pyx_n_s_my_array; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_name_2; @@ -2606,9 +2871,15 @@ static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_new; static PyObject *__pyx_n_s_nf; +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_npoints; static PyObject *__pyx_n_s_num_field_vals; +static PyObject *__pyx_n_s_num_intervals; +static PyObject *__pyx_n_s_num_plot_nodes; 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; @@ -2618,6 +2889,7 @@ static PyObject *__pyx_n_s_overlap2; static PyObject *__pyx_n_s_oxsp; static PyObject *__pyx_n_s_oysp; +static PyObject *__pyx_n_s_ozsp; static PyObject *__pyx_n_s_p; static PyObject *__pyx_n_s_pLE; static PyObject *__pyx_n_s_pRE; @@ -2634,13 +2906,17 @@ static PyObject *__pyx_n_s_phi_offset; static PyObject *__pyx_n_s_phi_p; static PyObject *__pyx_n_s_pi; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_pixelize_aitoff; static PyObject *__pyx_n_s_pixelize_cartesian; +static PyObject *__pyx_n_s_pixelize_cartesian_nodal; static PyObject *__pyx_n_s_pixelize_cylinder; static PyObject *__pyx_n_s_pixelize_element_mesh; +static PyObject *__pyx_n_s_pixelize_element_mesh_line; static PyObject *__pyx_n_s_pixelize_off_axis_cartesian; static PyObject *__pyx_n_s_pj; static PyObject *__pyx_n_s_pk; +static PyObject *__pyx_n_s_plot_values; static PyObject *__pyx_n_s_ppoint; static PyObject *__pyx_n_s_pstart; static PyObject *__pyx_n_s_px; @@ -2649,30 +2925,40 @@ static PyObject *__pyx_n_s_pxsp; static PyObject *__pyx_n_s_py; static PyObject *__pyx_n_s_pysp; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_pz; static PyObject *__pyx_n_s_r0; static PyObject *__pyx_n_s_r_i; static PyObject *__pyx_n_s_radius; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_rbounds; static PyObject *__pyx_n_s_rc; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_rmax; -static PyObject *__pyx_n_s_rows; static PyObject *__pyx_n_s_rr; static PyObject *__pyx_n_s_rxpx; static PyObject *__pyx_n_s_rypx; static PyObject *__pyx_n_s_s2; +static PyObject *__pyx_n_s_sample_point; static PyObject *__pyx_n_s_sampler; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_sintheta; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_start_point; 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_theta; @@ -2684,6 +2970,7 @@ 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 PyObject *__pyx_n_s_use; static PyObject *__pyx_n_s_vertices; static PyObject *__pyx_n_s_width; @@ -2710,16 +2997,19 @@ static PyObject *__pyx_n_s_ymin; static PyObject *__pyx_n_s_ysp; static PyObject *__pyx_n_s_yt_utilities_exceptions; -static PyObject *__pyx_n_s_yt_utilities_lib_pixelization_ro; +static PyObject *__pyx_kp_s_yt_utilities_lib_pixelization_ro; +static PyObject *__pyx_n_s_yt_utilities_lib_pixelization_ro_2; static PyObject *__pyx_n_s_z; static PyObject *__pyx_n_s_zb; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_n_s_zsp; -static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_pixelize_cartesian(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_px, PyArrayObject *__pyx_v_py, PyArrayObject *__pyx_v_pdx, PyArrayObject *__pyx_v_pdy, PyArrayObject *__pyx_v_data, int __pyx_v_cols, int __pyx_v_rows, PyObject *__pyx_v_bounds, int __pyx_v_antialias, PyObject *__pyx_v_period, int __pyx_v_check_period, __pyx_t_5numpy_float64_t __pyx_v_line_width); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_2pixelize_off_axis_cartesian(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_y, __Pyx_memviewslice __pyx_v_z, __Pyx_memviewslice __pyx_v_px, __Pyx_memviewslice __pyx_v_py, __Pyx_memviewslice __pyx_v_pdx, __Pyx_memviewslice __pyx_v_pdy, __Pyx_memviewslice __pyx_v_pdz, __Pyx_memviewslice __pyx_v_center, __Pyx_memviewslice __pyx_v_inv_mat, __Pyx_memviewslice __pyx_v_indices, __Pyx_memviewslice __pyx_v_data, int __pyx_v_cols, int __pyx_v_rows, PyObject *__pyx_v_bounds); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_4pixelize_cylinder(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_radius, PyArrayObject *__pyx_v_dradius, PyArrayObject *__pyx_v_theta, PyArrayObject *__pyx_v_dtheta, PyObject *__pyx_v_buff_size, PyArrayObject *__pyx_v_field, PyObject *__pyx_v_extents, PyObject *__pyx_v_input_img); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_6pixelize_aitoff(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_theta, PyArrayObject *__pyx_v_dtheta, PyArrayObject *__pyx_v_phi, PyArrayObject *__pyx_v_dphi, PyObject *__pyx_v_buff_size, PyArrayObject *__pyx_v_field, CYTHON_UNUSED PyObject *__pyx_v_extents, PyObject *__pyx_v_input_img, __pyx_t_5numpy_float64_t __pyx_v_theta_offset, __pyx_t_5numpy_float64_t __pyx_v_phi_offset); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_8pixelize_element_mesh(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords, PyArrayObject *__pyx_v_conn, PyObject *__pyx_v_buff_size, PyArrayObject *__pyx_v_field, PyObject *__pyx_v_extents, int __pyx_v_index_offset); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_pixelize_cartesian(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_buff, __Pyx_memviewslice __pyx_v_px, __Pyx_memviewslice __pyx_v_py, __Pyx_memviewslice __pyx_v_pdx, __Pyx_memviewslice __pyx_v_pdy, __Pyx_memviewslice __pyx_v_data, PyObject *__pyx_v_bounds, int __pyx_v_antialias, PyObject *__pyx_v_period, int __pyx_v_check_period, __pyx_t_5numpy_float64_t __pyx_v_line_width); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_2pixelize_cartesian_nodal(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_buff, __Pyx_memviewslice __pyx_v_px, __Pyx_memviewslice __pyx_v_py, __Pyx_memviewslice __pyx_v_pz, __Pyx_memviewslice __pyx_v_pdx, __Pyx_memviewslice __pyx_v_pdy, __Pyx_memviewslice __pyx_v_pdz, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_float64_t __pyx_v_coord, PyObject *__pyx_v_bounds, CYTHON_UNUSED int __pyx_v_antialias, PyObject *__pyx_v_period, int __pyx_v_check_period); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_4pixelize_off_axis_cartesian(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_buff, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_y, __Pyx_memviewslice __pyx_v_z, __Pyx_memviewslice __pyx_v_px, __Pyx_memviewslice __pyx_v_py, __Pyx_memviewslice __pyx_v_pdx, __Pyx_memviewslice __pyx_v_pdy, __Pyx_memviewslice __pyx_v_pdz, __Pyx_memviewslice __pyx_v_center, __Pyx_memviewslice __pyx_v_inv_mat, __Pyx_memviewslice __pyx_v_indices, __Pyx_memviewslice __pyx_v_data, PyObject *__pyx_v_bounds); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_6pixelize_cylinder(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_buff, __Pyx_memviewslice __pyx_v_radius, __Pyx_memviewslice __pyx_v_dradius, __Pyx_memviewslice __pyx_v_theta, __Pyx_memviewslice __pyx_v_dtheta, __Pyx_memviewslice __pyx_v_field, PyObject *__pyx_v_extents); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_8pixelize_aitoff(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_theta, __Pyx_memviewslice __pyx_v_dtheta, __Pyx_memviewslice __pyx_v_phi, __Pyx_memviewslice __pyx_v_dphi, PyObject *__pyx_v_buff_size, __Pyx_memviewslice __pyx_v_field, CYTHON_UNUSED PyObject *__pyx_v_extents, PyObject *__pyx_v_input_img, __pyx_t_5numpy_float64_t __pyx_v_theta_offset, __pyx_t_5numpy_float64_t __pyx_v_phi_offset); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_10pixelize_element_mesh(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords, PyArrayObject *__pyx_v_conn, PyObject *__pyx_v_buff_size, PyArrayObject *__pyx_v_field, PyObject *__pyx_v_extents, int __pyx_v_index_offset); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_12pixelize_element_mesh_line(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords, PyArrayObject *__pyx_v_conn, PyArrayObject *__pyx_v_start_point, PyArrayObject *__pyx_v_end_point, PyObject *__pyx_v_npoints, PyArrayObject *__pyx_v_field, int __pyx_v_index_offset); /* 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 */ @@ -2729,8 +3019,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -2752,27 +3046,33 @@ 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_184977713; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; -static PyObject *__pyx_slice__5; -static PyObject *__pyx_slice__6; +static PyObject *__pyx_slice__4; 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__26; -static PyObject *__pyx_slice__27; -static PyObject *__pyx_slice__28; +static PyObject *__pyx_slice__29; +static PyObject *__pyx_slice__30; +static PyObject *__pyx_slice__31; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -2789,42 +3089,52 @@ static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; -static PyObject *__pyx_tuple__29; -static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; -static PyObject *__pyx_tuple__36; -static PyObject *__pyx_tuple__38; -static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__39; static PyObject *__pyx_tuple__41; -static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__43; -static PyObject *__pyx_tuple__44; -static PyObject *__pyx_codeobj__31; -static PyObject *__pyx_codeobj__33; -static PyObject *__pyx_codeobj__35; -static PyObject *__pyx_codeobj__37; -static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__38; +static PyObject *__pyx_codeobj__40; +static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__44; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__55; -/* "yt/utilities/lib/pixelization_routines.pyx":55 +/* "yt/utilities/lib/pixelization_routines.pyx":59 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_cartesian(np.ndarray[np.float64_t, ndim=1] px, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] py, - * np.ndarray[np.float64_t, ndim=1] pdx, + * def pixelize_cartesian(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] px, + * np.float64_t[:] py, */ /* Python wrapper */ static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_1pixelize_cartesian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_1pixelize_cartesian = {"pixelize_cartesian", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_1pixelize_cartesian, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_1pixelize_cartesian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_px = 0; - PyArrayObject *__pyx_v_py = 0; - PyArrayObject *__pyx_v_pdx = 0; - PyArrayObject *__pyx_v_pdy = 0; - PyArrayObject *__pyx_v_data = 0; - int __pyx_v_cols; - int __pyx_v_rows; + __Pyx_memviewslice __pyx_v_buff = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_px = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_py = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_pdx = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_pdy = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; PyObject *__pyx_v_bounds = 0; int __pyx_v_antialias; PyObject *__pyx_v_period = 0; @@ -2834,108 +3144,126 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pixelize_cartesian (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_px,&__pyx_n_s_py,&__pyx_n_s_pdx,&__pyx_n_s_pdy,&__pyx_n_s_data,&__pyx_n_s_cols,&__pyx_n_s_rows,&__pyx_n_s_bounds,&__pyx_n_s_antialias,&__pyx_n_s_period,&__pyx_n_s_check_period,&__pyx_n_s_line_width,0}; - PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buff,&__pyx_n_s_px,&__pyx_n_s_py,&__pyx_n_s_pdx,&__pyx_n_s_pdy,&__pyx_n_s_data,&__pyx_n_s_bounds,&__pyx_n_s_antialias,&__pyx_n_s_period,&__pyx_n_s_check_period,&__pyx_n_s_line_width,0}; + PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0}; - /* "yt/utilities/lib/pixelization_routines.pyx":62 - * int cols, int rows, bounds, + /* "yt/utilities/lib/pixelization_routines.pyx":67 + * bounds, * int antialias = 1, * period = None, # <<<<<<<<<<<<<< * int check_period = 1, * np.float64_t line_width = 0.0): */ - values[9] = ((PyObject *)Py_None); + values[8] = ((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 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buff)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 8, 12, 1); __PYX_ERR(0, 55, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 7, 11, 1); __PYX_ERR(0, 59, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdx)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 8, 12, 2); __PYX_ERR(0, 55, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 7, 11, 2); __PYX_ERR(0, 59, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdy)) != 0)) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdx)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 8, 12, 3); __PYX_ERR(0, 55, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 7, 11, 3); __PYX_ERR(0, 59, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 8, 12, 4); __PYX_ERR(0, 55, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 7, 11, 4); __PYX_ERR(0, 59, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--; + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 8, 12, 5); __PYX_ERR(0, 55, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 7, 11, 5); __PYX_ERR(0, 59, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 8, 12, 6); __PYX_ERR(0, 55, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 7, 11, 6); __PYX_ERR(0, 59, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 8, 12, 7); __PYX_ERR(0, 55, __pyx_L3_error) + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_antialias); + if (value) { values[7] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_antialias); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_period); if (value) { values[8] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_period); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_check_period); if (value) { values[9] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_check_period); - if (value) { values[10] = value; kw_args--; } - } - case 11: - if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_line_width); - if (value) { values[11] = value; kw_args--; } + if (value) { values[10] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_cartesian") < 0)) __PYX_ERR(0, 55, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_cartesian") < 0)) __PYX_ERR(0, 59, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { - case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -2946,64 +3274,54 @@ default: goto __pyx_L5_argtuple_error; } } - __pyx_v_px = ((PyArrayObject *)values[0]); - __pyx_v_py = ((PyArrayObject *)values[1]); - __pyx_v_pdx = ((PyArrayObject *)values[2]); - __pyx_v_pdy = ((PyArrayObject *)values[3]); - __pyx_v_data = ((PyArrayObject *)values[4]); - __pyx_v_cols = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_cols == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L3_error) - __pyx_v_rows = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L3_error) - __pyx_v_bounds = values[7]; - if (values[8]) { - __pyx_v_antialias = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_antialias == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) + __pyx_v_buff = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_buff.memview)) __PYX_ERR(0, 59, __pyx_L3_error) + __pyx_v_px = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_px.memview)) __PYX_ERR(0, 60, __pyx_L3_error) + __pyx_v_py = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_py.memview)) __PYX_ERR(0, 61, __pyx_L3_error) + __pyx_v_pdx = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_pdx.memview)) __PYX_ERR(0, 62, __pyx_L3_error) + __pyx_v_pdy = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[4]); if (unlikely(!__pyx_v_pdy.memview)) __PYX_ERR(0, 63, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[5]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 64, __pyx_L3_error) + __pyx_v_bounds = values[6]; + if (values[7]) { + __pyx_v_antialias = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_antialias == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error) } else { __pyx_v_antialias = ((int)1); } - __pyx_v_period = values[9]; - if (values[10]) { - __pyx_v_check_period = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_check_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) + __pyx_v_period = values[8]; + if (values[9]) { + __pyx_v_check_period = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_check_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error) } else { __pyx_v_check_period = ((int)1); } - if (values[11]) { - __pyx_v_line_width = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_line_width == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L3_error) + if (values[10]) { + __pyx_v_line_width = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_line_width == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) } else { __pyx_v_line_width = ((__pyx_t_5numpy_float64_t)0.0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 8, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 55, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian", 0, 7, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 59, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_cartesian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_px), __pyx_ptype_5numpy_ndarray, 1, "px", 0))) __PYX_ERR(0, 55, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_py), __pyx_ptype_5numpy_ndarray, 1, "py", 0))) __PYX_ERR(0, 56, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdx), __pyx_ptype_5numpy_ndarray, 1, "pdx", 0))) __PYX_ERR(0, 57, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdy), __pyx_ptype_5numpy_ndarray, 1, "pdy", 0))) __PYX_ERR(0, 58, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 59, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_21pixelization_routines_pixelize_cartesian(__pyx_self, __pyx_v_px, __pyx_v_py, __pyx_v_pdx, __pyx_v_pdy, __pyx_v_data, __pyx_v_cols, __pyx_v_rows, __pyx_v_bounds, __pyx_v_antialias, __pyx_v_period, __pyx_v_check_period, __pyx_v_line_width); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_21pixelization_routines_pixelize_cartesian(__pyx_self, __pyx_v_buff, __pyx_v_px, __pyx_v_py, __pyx_v_pdx, __pyx_v_pdy, __pyx_v_data, __pyx_v_bounds, __pyx_v_antialias, __pyx_v_period, __pyx_v_check_period, __pyx_v_line_width); - /* "yt/utilities/lib/pixelization_routines.pyx":55 + /* "yt/utilities/lib/pixelization_routines.pyx":59 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_cartesian(np.ndarray[np.float64_t, ndim=1] px, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] py, - * np.ndarray[np.float64_t, ndim=1] pdx, + * def pixelize_cartesian(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] px, + * np.float64_t[:] py, */ /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_pixelize_cartesian(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_px, PyArrayObject *__pyx_v_py, PyArrayObject *__pyx_v_pdx, PyArrayObject *__pyx_v_pdy, PyArrayObject *__pyx_v_data, int __pyx_v_cols, int __pyx_v_rows, PyObject *__pyx_v_bounds, int __pyx_v_antialias, PyObject *__pyx_v_period, int __pyx_v_check_period, __pyx_t_5numpy_float64_t __pyx_v_line_width) { +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_pixelize_cartesian(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_buff, __Pyx_memviewslice __pyx_v_px, __Pyx_memviewslice __pyx_v_py, __Pyx_memviewslice __pyx_v_pdx, __Pyx_memviewslice __pyx_v_pdy, __Pyx_memviewslice __pyx_v_data, PyObject *__pyx_v_bounds, int __pyx_v_antialias, PyObject *__pyx_v_period, int __pyx_v_check_period, __pyx_t_5numpy_float64_t __pyx_v_line_width) { __pyx_t_5numpy_float64_t __pyx_v_x_min; __pyx_t_5numpy_float64_t __pyx_v_x_max; __pyx_t_5numpy_float64_t __pyx_v_y_min; @@ -3046,19 +3364,6 @@ int __pyx_v_yiter[2]; __pyx_t_5numpy_float64_t __pyx_v_xiterv[2]; __pyx_t_5numpy_float64_t __pyx_v_yiterv[2]; - PyArrayObject *__pyx_v_my_array = 0; - __Pyx_LocalBuf_ND __pyx_pybuffernd_data; - __Pyx_Buffer __pyx_pybuffer_data; - __Pyx_LocalBuf_ND __pyx_pybuffernd_my_array; - __Pyx_Buffer __pyx_pybuffer_my_array; - __Pyx_LocalBuf_ND __pyx_pybuffernd_pdx; - __Pyx_Buffer __pyx_pybuffer_pdx; - __Pyx_LocalBuf_ND __pyx_pybuffernd_pdy; - __Pyx_Buffer __pyx_pybuffer_pdy; - __Pyx_LocalBuf_ND __pyx_pybuffernd_px; - __Pyx_Buffer __pyx_pybuffer_px; - __Pyx_LocalBuf_ND __pyx_pybuffernd_py; - __Pyx_Buffer __pyx_pybuffer_py; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -3066,84 +3371,28 @@ PyObject *__pyx_t_3 = NULL; __pyx_t_5numpy_float64_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - PyArrayObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - npy_intp __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_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + int __pyx_t_18; Py_ssize_t __pyx_t_19; - int __pyx_t_20; - int __pyx_t_21; - int __pyx_t_22; - int __pyx_t_23; - int __pyx_t_24; - int __pyx_t_25; - Py_ssize_t __pyx_t_26; - Py_ssize_t __pyx_t_27; - Py_ssize_t __pyx_t_28; - Py_ssize_t __pyx_t_29; - Py_ssize_t __pyx_t_30; - Py_ssize_t __pyx_t_31; + 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; __Pyx_RefNannySetupContext("pixelize_cartesian", 0); - __pyx_pybuffer_my_array.pybuffer.buf = NULL; - __pyx_pybuffer_my_array.refcount = 0; - __pyx_pybuffernd_my_array.data = NULL; - __pyx_pybuffernd_my_array.rcbuffer = &__pyx_pybuffer_my_array; - __pyx_pybuffer_px.pybuffer.buf = NULL; - __pyx_pybuffer_px.refcount = 0; - __pyx_pybuffernd_px.data = NULL; - __pyx_pybuffernd_px.rcbuffer = &__pyx_pybuffer_px; - __pyx_pybuffer_py.pybuffer.buf = NULL; - __pyx_pybuffer_py.refcount = 0; - __pyx_pybuffernd_py.data = NULL; - __pyx_pybuffernd_py.rcbuffer = &__pyx_pybuffer_py; - __pyx_pybuffer_pdx.pybuffer.buf = NULL; - __pyx_pybuffer_pdx.refcount = 0; - __pyx_pybuffernd_pdx.data = NULL; - __pyx_pybuffernd_pdx.rcbuffer = &__pyx_pybuffer_pdx; - __pyx_pybuffer_pdy.pybuffer.buf = NULL; - __pyx_pybuffer_pdy.refcount = 0; - __pyx_pybuffernd_pdy.data = NULL; - __pyx_pybuffernd_pdy.rcbuffer = &__pyx_pybuffer_pdy; - __pyx_pybuffer_data.pybuffer.buf = NULL; - __pyx_pybuffer_data.refcount = 0; - __pyx_pybuffernd_data.data = NULL; - __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_px.rcbuffer->pybuffer, (PyObject*)__pyx_v_px, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 55, __pyx_L1_error) - } - __pyx_pybuffernd_px.diminfo[0].strides = __pyx_pybuffernd_px.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_px.diminfo[0].shape = __pyx_pybuffernd_px.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_py.rcbuffer->pybuffer, (PyObject*)__pyx_v_py, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 55, __pyx_L1_error) - } - __pyx_pybuffernd_py.diminfo[0].strides = __pyx_pybuffernd_py.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_py.diminfo[0].shape = __pyx_pybuffernd_py.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pdx.rcbuffer->pybuffer, (PyObject*)__pyx_v_pdx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 55, __pyx_L1_error) - } - __pyx_pybuffernd_pdx.diminfo[0].strides = __pyx_pybuffernd_pdx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pdx.diminfo[0].shape = __pyx_pybuffernd_pdx.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pdy.rcbuffer->pybuffer, (PyObject*)__pyx_v_pdy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 55, __pyx_L1_error) - } - __pyx_pybuffernd_pdy.diminfo[0].strides = __pyx_pybuffernd_pdy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pdy.diminfo[0].shape = __pyx_pybuffernd_pdy.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 55, __pyx_L1_error) - } - __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; - /* "yt/utilities/lib/pixelization_routines.pyx":66 + /* "yt/utilities/lib/pixelization_routines.pyx":71 * np.float64_t line_width = 0.0): * cdef np.float64_t x_min, x_max, y_min, y_max * cdef np.float64_t period_x = 0.0, period_y = 0.0 # <<<<<<<<<<<<<< @@ -3153,9 +3402,9 @@ __pyx_v_period_x = 0.0; __pyx_v_period_y = 0.0; - /* "yt/utilities/lib/pixelization_routines.pyx":80 + /* "yt/utilities/lib/pixelization_routines.pyx":84 + * cdef np.float64_t xiterv[2] * cdef np.float64_t yiterv[2] - * cdef np.ndarray[np.float64_t, ndim=2] my_array * if period is not None: # <<<<<<<<<<<<<< * period_x = period[0] * period_y = period[1] @@ -3164,373 +3413,237 @@ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":81 - * cdef np.ndarray[np.float64_t, ndim=2] my_array + /* "yt/utilities/lib/pixelization_routines.pyx":85 + * cdef np.float64_t yiterv[2] * if period is not None: * period_x = period[0] # <<<<<<<<<<<<<< * period_y = period[1] * x_min = bounds[0] */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_period, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_period, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_period_x = __pyx_t_4; - /* "yt/utilities/lib/pixelization_routines.pyx":82 + /* "yt/utilities/lib/pixelization_routines.pyx":86 * if period is not None: * period_x = period[0] * period_y = period[1] # <<<<<<<<<<<<<< * x_min = bounds[0] * x_max = bounds[1] */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_period, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_period, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_period_y = __pyx_t_4; - /* "yt/utilities/lib/pixelization_routines.pyx":80 + /* "yt/utilities/lib/pixelization_routines.pyx":84 + * cdef np.float64_t xiterv[2] * cdef np.float64_t yiterv[2] - * cdef np.ndarray[np.float64_t, ndim=2] my_array * if period is not None: # <<<<<<<<<<<<<< * period_x = period[0] * period_y = period[1] */ } - /* "yt/utilities/lib/pixelization_routines.pyx":83 + /* "yt/utilities/lib/pixelization_routines.pyx":87 * period_x = period[0] * period_y = period[1] * x_min = bounds[0] # <<<<<<<<<<<<<< * x_max = bounds[1] * y_min = bounds[2] */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_x_min = __pyx_t_4; - /* "yt/utilities/lib/pixelization_routines.pyx":84 + /* "yt/utilities/lib/pixelization_routines.pyx":88 * period_y = period[1] * x_min = bounds[0] * x_max = bounds[1] # <<<<<<<<<<<<<< * y_min = bounds[2] * y_max = bounds[3] */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_x_max = __pyx_t_4; - /* "yt/utilities/lib/pixelization_routines.pyx":85 + /* "yt/utilities/lib/pixelization_routines.pyx":89 * x_min = bounds[0] * x_max = bounds[1] * y_min = bounds[2] # <<<<<<<<<<<<<< * y_max = bounds[3] * width = x_max - x_min */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_y_min = __pyx_t_4; - /* "yt/utilities/lib/pixelization_routines.pyx":86 + /* "yt/utilities/lib/pixelization_routines.pyx":90 * x_max = bounds[1] * y_min = bounds[2] * y_max = bounds[3] # <<<<<<<<<<<<<< * width = x_max - x_min * height = y_max - y_min */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_y_max = __pyx_t_4; - /* "yt/utilities/lib/pixelization_routines.pyx":87 + /* "yt/utilities/lib/pixelization_routines.pyx":91 * y_min = bounds[2] * y_max = bounds[3] * width = x_max - x_min # <<<<<<<<<<<<<< * height = y_max - y_min - * px_dx = width / ( rows) + * px_dx = width / ( buff.shape[1]) */ __pyx_v_width = (__pyx_v_x_max - __pyx_v_x_min); - /* "yt/utilities/lib/pixelization_routines.pyx":88 + /* "yt/utilities/lib/pixelization_routines.pyx":92 * y_max = bounds[3] * width = x_max - x_min * height = y_max - y_min # <<<<<<<<<<<<<< - * px_dx = width / ( rows) - * px_dy = height / ( cols) + * px_dx = width / ( buff.shape[1]) + * px_dy = height / ( buff.shape[0]) */ __pyx_v_height = (__pyx_v_y_max - __pyx_v_y_min); - /* "yt/utilities/lib/pixelization_routines.pyx":89 + /* "yt/utilities/lib/pixelization_routines.pyx":93 * width = x_max - x_min * height = y_max - y_min - * px_dx = width / ( rows) # <<<<<<<<<<<<<< - * px_dy = height / ( cols) + * px_dx = width / ( buff.shape[1]) # <<<<<<<<<<<<<< + * px_dy = height / ( buff.shape[0]) * ipx_dx = 1.0 / px_dx */ - __pyx_v_px_dx = (__pyx_v_width / ((__pyx_t_5numpy_float64_t)__pyx_v_rows)); + __pyx_v_px_dx = (__pyx_v_width / ((__pyx_t_5numpy_float64_t)(__pyx_v_buff.shape[1]))); - /* "yt/utilities/lib/pixelization_routines.pyx":90 + /* "yt/utilities/lib/pixelization_routines.pyx":94 * height = y_max - y_min - * px_dx = width / ( rows) - * px_dy = height / ( cols) # <<<<<<<<<<<<<< + * px_dx = width / ( buff.shape[1]) + * px_dy = height / ( buff.shape[0]) # <<<<<<<<<<<<<< * ipx_dx = 1.0 / px_dx * ipx_dy = 1.0 / px_dy */ - __pyx_v_px_dy = (__pyx_v_height / ((__pyx_t_5numpy_float64_t)__pyx_v_cols)); + __pyx_v_px_dy = (__pyx_v_height / ((__pyx_t_5numpy_float64_t)(__pyx_v_buff.shape[0]))); - /* "yt/utilities/lib/pixelization_routines.pyx":91 - * px_dx = width / ( rows) - * px_dy = height / ( cols) + /* "yt/utilities/lib/pixelization_routines.pyx":95 + * px_dx = width / ( buff.shape[1]) + * px_dy = height / ( buff.shape[0]) * ipx_dx = 1.0 / px_dx # <<<<<<<<<<<<<< * ipx_dy = 1.0 / px_dy - * if rows == 0 or cols == 0: + * if px.shape[0] != py.shape[0] or \ */ __pyx_v_ipx_dx = (1.0 / __pyx_v_px_dx); - /* "yt/utilities/lib/pixelization_routines.pyx":92 - * px_dy = height / ( cols) + /* "yt/utilities/lib/pixelization_routines.pyx":96 + * px_dy = height / ( buff.shape[0]) * ipx_dx = 1.0 / px_dx * ipx_dy = 1.0 / px_dy # <<<<<<<<<<<<<< - * if rows == 0 or cols == 0: - * raise YTPixelizeError("Cannot scale to zero size") - */ - __pyx_v_ipx_dy = (1.0 / __pyx_v_px_dy); - - /* "yt/utilities/lib/pixelization_routines.pyx":93 - * ipx_dx = 1.0 / px_dx - * ipx_dy = 1.0 / px_dy - * if rows == 0 or cols == 0: # <<<<<<<<<<<<<< - * raise YTPixelizeError("Cannot scale to zero size") - * if px.shape[0] != py.shape[0] or \ - */ - __pyx_t_1 = ((__pyx_v_rows == 0) != 0); - if (!__pyx_t_1) { - } else { - __pyx_t_2 = __pyx_t_1; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_1 = ((__pyx_v_cols == 0) != 0); - __pyx_t_2 = __pyx_t_1; - __pyx_L5_bool_binop_done:; - if (__pyx_t_2) { - - /* "yt/utilities/lib/pixelization_routines.pyx":94 - * ipx_dy = 1.0 / px_dy - * if rows == 0 or cols == 0: - * raise YTPixelizeError("Cannot scale to zero size") # <<<<<<<<<<<<<< * if px.shape[0] != py.shape[0] or \ * px.shape[0] != pdx.shape[0] or \ */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTPixelizeError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_v_ipx_dy = (1.0 / __pyx_v_px_dy); - /* "yt/utilities/lib/pixelization_routines.pyx":93 + /* "yt/utilities/lib/pixelization_routines.pyx":97 * ipx_dx = 1.0 / px_dx * ipx_dy = 1.0 / px_dy - * if rows == 0 or cols == 0: # <<<<<<<<<<<<<< - * raise YTPixelizeError("Cannot scale to zero size") - * if px.shape[0] != py.shape[0] or \ - */ - } - - /* "yt/utilities/lib/pixelization_routines.pyx":95 - * if rows == 0 or cols == 0: - * raise YTPixelizeError("Cannot scale to zero size") * if px.shape[0] != py.shape[0] or \ # <<<<<<<<<<<<<< * px.shape[0] != pdx.shape[0] or \ * px.shape[0] != pdy.shape[0] or \ */ - __pyx_t_1 = (((__pyx_v_px->dimensions[0]) != (__pyx_v_py->dimensions[0])) != 0); + __pyx_t_1 = (((__pyx_v_px.shape[0]) != (__pyx_v_py.shape[0])) != 0); if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; - goto __pyx_L8_bool_binop_done; + goto __pyx_L5_bool_binop_done; } - /* "yt/utilities/lib/pixelization_routines.pyx":96 - * raise YTPixelizeError("Cannot scale to zero size") + /* "yt/utilities/lib/pixelization_routines.pyx":98 + * ipx_dy = 1.0 / px_dy * if px.shape[0] != py.shape[0] or \ * px.shape[0] != pdx.shape[0] or \ # <<<<<<<<<<<<<< * px.shape[0] != pdy.shape[0] or \ * px.shape[0] != data.shape[0]: */ - __pyx_t_1 = (((__pyx_v_px->dimensions[0]) != (__pyx_v_pdx->dimensions[0])) != 0); + __pyx_t_1 = (((__pyx_v_px.shape[0]) != (__pyx_v_pdx.shape[0])) != 0); if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; - goto __pyx_L8_bool_binop_done; + goto __pyx_L5_bool_binop_done; } - /* "yt/utilities/lib/pixelization_routines.pyx":97 + /* "yt/utilities/lib/pixelization_routines.pyx":99 * if px.shape[0] != py.shape[0] or \ * px.shape[0] != pdx.shape[0] or \ * px.shape[0] != pdy.shape[0] or \ # <<<<<<<<<<<<<< * px.shape[0] != data.shape[0]: * raise YTPixelizeError("Arrays are not of correct shape.") */ - __pyx_t_1 = (((__pyx_v_px->dimensions[0]) != (__pyx_v_pdy->dimensions[0])) != 0); + __pyx_t_1 = (((__pyx_v_px.shape[0]) != (__pyx_v_pdy.shape[0])) != 0); if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; - goto __pyx_L8_bool_binop_done; + goto __pyx_L5_bool_binop_done; } - /* "yt/utilities/lib/pixelization_routines.pyx":98 + /* "yt/utilities/lib/pixelization_routines.pyx":100 * px.shape[0] != pdx.shape[0] or \ * px.shape[0] != pdy.shape[0] or \ * px.shape[0] != data.shape[0]: # <<<<<<<<<<<<<< * raise YTPixelizeError("Arrays are not of correct shape.") - * my_array = np.zeros((rows, cols), "float64") + * xiter[0] = yiter[0] = 0 */ - __pyx_t_1 = (((__pyx_v_px->dimensions[0]) != (__pyx_v_data->dimensions[0])) != 0); + __pyx_t_1 = (((__pyx_v_px.shape[0]) != (__pyx_v_data.shape[0])) != 0); __pyx_t_2 = __pyx_t_1; - __pyx_L8_bool_binop_done:; + __pyx_L5_bool_binop_done:; - /* "yt/utilities/lib/pixelization_routines.pyx":95 - * if rows == 0 or cols == 0: - * raise YTPixelizeError("Cannot scale to zero size") + /* "yt/utilities/lib/pixelization_routines.pyx":97 + * ipx_dx = 1.0 / px_dx + * ipx_dy = 1.0 / px_dy * if px.shape[0] != py.shape[0] or \ # <<<<<<<<<<<<<< * px.shape[0] != pdx.shape[0] or \ * px.shape[0] != pdy.shape[0] or \ */ if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":99 + /* "yt/utilities/lib/pixelization_routines.pyx":101 * px.shape[0] != pdy.shape[0] or \ * px.shape[0] != data.shape[0]: * raise YTPixelizeError("Arrays are not of correct shape.") # <<<<<<<<<<<<<< - * my_array = np.zeros((rows, cols), "float64") * xiter[0] = yiter[0] = 0 + * xiterv[0] = yiterv[0] = 0.0 */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTPixelizeError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTPixelizeError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 101, __pyx_L1_error) - /* "yt/utilities/lib/pixelization_routines.pyx":95 - * if rows == 0 or cols == 0: - * raise YTPixelizeError("Cannot scale to zero size") + /* "yt/utilities/lib/pixelization_routines.pyx":97 + * ipx_dx = 1.0 / px_dx + * ipx_dy = 1.0 / px_dy * if px.shape[0] != py.shape[0] or \ # <<<<<<<<<<<<<< * px.shape[0] != pdx.shape[0] or \ * px.shape[0] != pdy.shape[0] or \ */ } - /* "yt/utilities/lib/pixelization_routines.pyx":100 + /* "yt/utilities/lib/pixelization_routines.pyx":102 * px.shape[0] != data.shape[0]: * raise YTPixelizeError("Arrays are not of correct shape.") - * my_array = np.zeros((rows, cols), "float64") # <<<<<<<<<<<<<< - * xiter[0] = yiter[0] = 0 - * xiterv[0] = yiterv[0] = 0.0 - */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rows); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_cols); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); - __pyx_t_5 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = NULL; - __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_9 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_6)) { - PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_n_s_float64}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { - PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_n_s_float64}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - #endif - { - __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; - } - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_t_8); - __Pyx_INCREF(__pyx_n_s_float64); - __Pyx_GIVEREF(__pyx_n_s_float64); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_n_s_float64); - __pyx_t_8 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 100, __pyx_L1_error) - __pyx_t_10 = ((PyArrayObject *)__pyx_t_3); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_my_array, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); - } - } - __pyx_pybuffernd_my_array.diminfo[0].strides = __pyx_pybuffernd_my_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_my_array.diminfo[0].shape = __pyx_pybuffernd_my_array.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_my_array.diminfo[1].strides = __pyx_pybuffernd_my_array.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_my_array.diminfo[1].shape = __pyx_pybuffernd_my_array.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 100, __pyx_L1_error) - } - __pyx_t_10 = 0; - __pyx_v_my_array = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "yt/utilities/lib/pixelization_routines.pyx":101 - * raise YTPixelizeError("Arrays are not of correct shape.") - * my_array = np.zeros((rows, cols), "float64") * xiter[0] = yiter[0] = 0 # <<<<<<<<<<<<<< * xiterv[0] = yiterv[0] = 0.0 * # Here's a basic outline of what we're going to do here. The xiter and @@ -3538,8 +3651,8 @@ (__pyx_v_xiter[0]) = 0; (__pyx_v_yiter[0]) = 0; - /* "yt/utilities/lib/pixelization_routines.pyx":102 - * my_array = np.zeros((rows, cols), "float64") + /* "yt/utilities/lib/pixelization_routines.pyx":103 + * raise YTPixelizeError("Arrays are not of correct shape.") * xiter[0] = yiter[0] = 0 * xiterv[0] = yiterv[0] = 0.0 # <<<<<<<<<<<<<< * # Here's a basic outline of what we're going to do here. The xiter and @@ -3548,9 +3661,9 @@ (__pyx_v_xiterv[0]) = 0.0; (__pyx_v_yiterv[0]) = 0.0; - /* "yt/utilities/lib/pixelization_routines.pyx":121 - * # depositing into them the data value. Overlap computes the relative - * # overlap of a data value with a pixel. + /* "yt/utilities/lib/pixelization_routines.pyx":147 + * # first axis : y_min .. y_max + * # second axis: x_min .. x_max * with nogil: # <<<<<<<<<<<<<< * for p in range(px.shape[0]): * xiter[1] = yiter[1] = 999 @@ -3559,21 +3672,22 @@ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/utilities/lib/pixelization_routines.pyx":122 - * # overlap of a data value with a pixel. + /* "yt/utilities/lib/pixelization_routines.pyx":148 + * # second axis: x_min .. x_max * with nogil: * for p in range(px.shape[0]): # <<<<<<<<<<<<<< * xiter[1] = yiter[1] = 999 * oxsp = px[p] */ - __pyx_t_14 = (__pyx_v_px->dimensions[0]); - for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_14; __pyx_t_9+=1) { - __pyx_v_p = __pyx_t_9; + __pyx_t_6 = (__pyx_v_px.shape[0]); + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_p = __pyx_t_7; - /* "yt/utilities/lib/pixelization_routines.pyx":123 + /* "yt/utilities/lib/pixelization_routines.pyx":149 * with nogil: * for p in range(px.shape[0]): * xiter[1] = yiter[1] = 999 # <<<<<<<<<<<<<< @@ -3583,57 +3697,57 @@ (__pyx_v_xiter[1]) = 0x3E7; (__pyx_v_yiter[1]) = 0x3E7; - /* "yt/utilities/lib/pixelization_routines.pyx":124 + /* "yt/utilities/lib/pixelization_routines.pyx":150 * for p in range(px.shape[0]): * xiter[1] = yiter[1] = 999 * oxsp = px[p] # <<<<<<<<<<<<<< * oysp = py[p] * dxsp = pdx[p] */ - __pyx_t_15 = __pyx_v_p; - __pyx_v_oxsp = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_px.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_px.diminfo[0].strides)); + __pyx_t_8 = __pyx_v_p; + __pyx_v_oxsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_px.data + __pyx_t_8 * __pyx_v_px.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":125 + /* "yt/utilities/lib/pixelization_routines.pyx":151 * xiter[1] = yiter[1] = 999 * oxsp = px[p] * oysp = py[p] # <<<<<<<<<<<<<< * dxsp = pdx[p] * dysp = pdy[p] */ - __pyx_t_16 = __pyx_v_p; - __pyx_v_oysp = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_py.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_py.diminfo[0].strides)); + __pyx_t_9 = __pyx_v_p; + __pyx_v_oysp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_py.data + __pyx_t_9 * __pyx_v_py.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":126 + /* "yt/utilities/lib/pixelization_routines.pyx":152 * oxsp = px[p] * oysp = py[p] * dxsp = pdx[p] # <<<<<<<<<<<<<< * dysp = pdy[p] * dsp = data[p] */ - __pyx_t_17 = __pyx_v_p; - __pyx_v_dxsp = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pdx.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_pdx.diminfo[0].strides)); + __pyx_t_10 = __pyx_v_p; + __pyx_v_dxsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdx.data + __pyx_t_10 * __pyx_v_pdx.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":127 + /* "yt/utilities/lib/pixelization_routines.pyx":153 * oysp = py[p] * dxsp = pdx[p] * dysp = pdy[p] # <<<<<<<<<<<<<< * dsp = data[p] * if check_period == 1: */ - __pyx_t_18 = __pyx_v_p; - __pyx_v_dysp = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pdy.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_pdy.diminfo[0].strides)); + __pyx_t_11 = __pyx_v_p; + __pyx_v_dysp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdy.data + __pyx_t_11 * __pyx_v_pdy.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":128 + /* "yt/utilities/lib/pixelization_routines.pyx":154 * dxsp = pdx[p] * dysp = pdy[p] * dsp = data[p] # <<<<<<<<<<<<<< * if check_period == 1: * if (oxsp - dxsp < x_min): */ - __pyx_t_19 = __pyx_v_p; - __pyx_v_dsp = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_data.diminfo[0].strides)); + __pyx_t_12 = __pyx_v_p; + __pyx_v_dsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_data.data + __pyx_t_12 * __pyx_v_data.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":129 + /* "yt/utilities/lib/pixelization_routines.pyx":155 * dysp = pdy[p] * dsp = data[p] * if check_period == 1: # <<<<<<<<<<<<<< @@ -3643,7 +3757,7 @@ __pyx_t_2 = ((__pyx_v_check_period == 1) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":130 + /* "yt/utilities/lib/pixelization_routines.pyx":156 * dsp = data[p] * if check_period == 1: * if (oxsp - dxsp < x_min): # <<<<<<<<<<<<<< @@ -3653,7 +3767,7 @@ __pyx_t_2 = (((__pyx_v_oxsp - __pyx_v_dxsp) < __pyx_v_x_min) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":131 + /* "yt/utilities/lib/pixelization_routines.pyx":157 * if check_period == 1: * if (oxsp - dxsp < x_min): * xiter[1] = +1 # <<<<<<<<<<<<<< @@ -3662,7 +3776,7 @@ */ (__pyx_v_xiter[1]) = 1; - /* "yt/utilities/lib/pixelization_routines.pyx":132 + /* "yt/utilities/lib/pixelization_routines.pyx":158 * if (oxsp - dxsp < x_min): * xiter[1] = +1 * xiterv[1] = period_x # <<<<<<<<<<<<<< @@ -3671,17 +3785,17 @@ */ (__pyx_v_xiterv[1]) = __pyx_v_period_x; - /* "yt/utilities/lib/pixelization_routines.pyx":130 + /* "yt/utilities/lib/pixelization_routines.pyx":156 * dsp = data[p] * if check_period == 1: * if (oxsp - dxsp < x_min): # <<<<<<<<<<<<<< * xiter[1] = +1 * xiterv[1] = period_x */ - goto __pyx_L18; + goto __pyx_L15; } - /* "yt/utilities/lib/pixelization_routines.pyx":133 + /* "yt/utilities/lib/pixelization_routines.pyx":159 * xiter[1] = +1 * xiterv[1] = period_x * elif (oxsp + dxsp > x_max): # <<<<<<<<<<<<<< @@ -3691,7 +3805,7 @@ __pyx_t_2 = (((__pyx_v_oxsp + __pyx_v_dxsp) > __pyx_v_x_max) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":134 + /* "yt/utilities/lib/pixelization_routines.pyx":160 * xiterv[1] = period_x * elif (oxsp + dxsp > x_max): * xiter[1] = -1 # <<<<<<<<<<<<<< @@ -3700,7 +3814,7 @@ */ (__pyx_v_xiter[1]) = -1; - /* "yt/utilities/lib/pixelization_routines.pyx":135 + /* "yt/utilities/lib/pixelization_routines.pyx":161 * elif (oxsp + dxsp > x_max): * xiter[1] = -1 * xiterv[1] = -period_x # <<<<<<<<<<<<<< @@ -3709,7 +3823,7 @@ */ (__pyx_v_xiterv[1]) = (-__pyx_v_period_x); - /* "yt/utilities/lib/pixelization_routines.pyx":133 + /* "yt/utilities/lib/pixelization_routines.pyx":159 * xiter[1] = +1 * xiterv[1] = period_x * elif (oxsp + dxsp > x_max): # <<<<<<<<<<<<<< @@ -3717,9 +3831,9 @@ * xiterv[1] = -period_x */ } - __pyx_L18:; + __pyx_L15:; - /* "yt/utilities/lib/pixelization_routines.pyx":136 + /* "yt/utilities/lib/pixelization_routines.pyx":162 * xiter[1] = -1 * xiterv[1] = -period_x * if (oysp - dysp < y_min): # <<<<<<<<<<<<<< @@ -3729,7 +3843,7 @@ __pyx_t_2 = (((__pyx_v_oysp - __pyx_v_dysp) < __pyx_v_y_min) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":137 + /* "yt/utilities/lib/pixelization_routines.pyx":163 * xiterv[1] = -period_x * if (oysp - dysp < y_min): * yiter[1] = +1 # <<<<<<<<<<<<<< @@ -3738,7 +3852,7 @@ */ (__pyx_v_yiter[1]) = 1; - /* "yt/utilities/lib/pixelization_routines.pyx":138 + /* "yt/utilities/lib/pixelization_routines.pyx":164 * if (oysp - dysp < y_min): * yiter[1] = +1 * yiterv[1] = period_y # <<<<<<<<<<<<<< @@ -3747,17 +3861,17 @@ */ (__pyx_v_yiterv[1]) = __pyx_v_period_y; - /* "yt/utilities/lib/pixelization_routines.pyx":136 + /* "yt/utilities/lib/pixelization_routines.pyx":162 * xiter[1] = -1 * xiterv[1] = -period_x * if (oysp - dysp < y_min): # <<<<<<<<<<<<<< * yiter[1] = +1 * yiterv[1] = period_y */ - goto __pyx_L19; + goto __pyx_L16; } - /* "yt/utilities/lib/pixelization_routines.pyx":139 + /* "yt/utilities/lib/pixelization_routines.pyx":165 * yiter[1] = +1 * yiterv[1] = period_y * elif (oysp + dysp > y_max): # <<<<<<<<<<<<<< @@ -3767,7 +3881,7 @@ __pyx_t_2 = (((__pyx_v_oysp + __pyx_v_dysp) > __pyx_v_y_max) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":140 + /* "yt/utilities/lib/pixelization_routines.pyx":166 * yiterv[1] = period_y * elif (oysp + dysp > y_max): * yiter[1] = -1 # <<<<<<<<<<<<<< @@ -3776,7 +3890,7 @@ */ (__pyx_v_yiter[1]) = -1; - /* "yt/utilities/lib/pixelization_routines.pyx":141 + /* "yt/utilities/lib/pixelization_routines.pyx":167 * elif (oysp + dysp > y_max): * yiter[1] = -1 * yiterv[1] = -period_y # <<<<<<<<<<<<<< @@ -3785,7 +3899,7 @@ */ (__pyx_v_yiterv[1]) = (-__pyx_v_period_y); - /* "yt/utilities/lib/pixelization_routines.pyx":139 + /* "yt/utilities/lib/pixelization_routines.pyx":165 * yiter[1] = +1 * yiterv[1] = period_y * elif (oysp + dysp > y_max): # <<<<<<<<<<<<<< @@ -3793,9 +3907,9 @@ * yiterv[1] = -period_y */ } - __pyx_L19:; + __pyx_L16:; - /* "yt/utilities/lib/pixelization_routines.pyx":129 + /* "yt/utilities/lib/pixelization_routines.pyx":155 * dysp = pdy[p] * dsp = data[p] * if check_period == 1: # <<<<<<<<<<<<<< @@ -3804,7 +3918,7 @@ */ } - /* "yt/utilities/lib/pixelization_routines.pyx":142 + /* "yt/utilities/lib/pixelization_routines.pyx":168 * yiter[1] = -1 * yiterv[1] = -period_y * overlap1 = overlap2 = 1.0 # <<<<<<<<<<<<<< @@ -3814,17 +3928,17 @@ __pyx_v_overlap1 = 1.0; __pyx_v_overlap2 = 1.0; - /* "yt/utilities/lib/pixelization_routines.pyx":143 + /* "yt/utilities/lib/pixelization_routines.pyx":169 * yiterv[1] = -period_y * overlap1 = overlap2 = 1.0 * for xi in range(2): # <<<<<<<<<<<<<< * if xiter[xi] == 999: continue * xsp = oxsp + xiterv[xi] */ - for (__pyx_t_20 = 0; __pyx_t_20 < 2; __pyx_t_20+=1) { - __pyx_v_xi = __pyx_t_20; + for (__pyx_t_13 = 0; __pyx_t_13 < 2; __pyx_t_13+=1) { + __pyx_v_xi = __pyx_t_13; - /* "yt/utilities/lib/pixelization_routines.pyx":144 + /* "yt/utilities/lib/pixelization_routines.pyx":170 * overlap1 = overlap2 = 1.0 * for xi in range(2): * if xiter[xi] == 999: continue # <<<<<<<<<<<<<< @@ -3833,10 +3947,10 @@ */ __pyx_t_2 = (((__pyx_v_xiter[__pyx_v_xi]) == 0x3E7) != 0); if (__pyx_t_2) { - goto __pyx_L20_continue; + goto __pyx_L17_continue; } - /* "yt/utilities/lib/pixelization_routines.pyx":145 + /* "yt/utilities/lib/pixelization_routines.pyx":171 * for xi in range(2): * if xiter[xi] == 999: continue * xsp = oxsp + xiterv[xi] # <<<<<<<<<<<<<< @@ -3845,7 +3959,7 @@ */ __pyx_v_xsp = (__pyx_v_oxsp + (__pyx_v_xiterv[__pyx_v_xi])); - /* "yt/utilities/lib/pixelization_routines.pyx":146 + /* "yt/utilities/lib/pixelization_routines.pyx":172 * if xiter[xi] == 999: continue * xsp = oxsp + xiterv[xi] * if (xsp + dxsp < x_min) or (xsp - dxsp > x_max): continue # <<<<<<<<<<<<<< @@ -3856,26 +3970,26 @@ if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; - goto __pyx_L24_bool_binop_done; + goto __pyx_L21_bool_binop_done; } __pyx_t_1 = (((__pyx_v_xsp - __pyx_v_dxsp) > __pyx_v_x_max) != 0); __pyx_t_2 = __pyx_t_1; - __pyx_L24_bool_binop_done:; + __pyx_L21_bool_binop_done:; if (__pyx_t_2) { - goto __pyx_L20_continue; + goto __pyx_L17_continue; } - /* "yt/utilities/lib/pixelization_routines.pyx":147 + /* "yt/utilities/lib/pixelization_routines.pyx":173 * xsp = oxsp + xiterv[xi] * if (xsp + dxsp < x_min) or (xsp - dxsp > x_max): continue * for yi in range(2): # <<<<<<<<<<<<<< * if yiter[yi] == 999: continue * ysp = oysp + yiterv[yi] */ - for (__pyx_t_21 = 0; __pyx_t_21 < 2; __pyx_t_21+=1) { - __pyx_v_yi = __pyx_t_21; + for (__pyx_t_14 = 0; __pyx_t_14 < 2; __pyx_t_14+=1) { + __pyx_v_yi = __pyx_t_14; - /* "yt/utilities/lib/pixelization_routines.pyx":148 + /* "yt/utilities/lib/pixelization_routines.pyx":174 * if (xsp + dxsp < x_min) or (xsp - dxsp > x_max): continue * for yi in range(2): * if yiter[yi] == 999: continue # <<<<<<<<<<<<<< @@ -3884,10 +3998,10 @@ */ __pyx_t_2 = (((__pyx_v_yiter[__pyx_v_yi]) == 0x3E7) != 0); if (__pyx_t_2) { - goto __pyx_L26_continue; + goto __pyx_L23_continue; } - /* "yt/utilities/lib/pixelization_routines.pyx":149 + /* "yt/utilities/lib/pixelization_routines.pyx":175 * for yi in range(2): * if yiter[yi] == 999: continue * ysp = oysp + yiterv[yi] # <<<<<<<<<<<<<< @@ -3896,7 +4010,7 @@ */ __pyx_v_ysp = (__pyx_v_oysp + (__pyx_v_yiterv[__pyx_v_yi])); - /* "yt/utilities/lib/pixelization_routines.pyx":150 + /* "yt/utilities/lib/pixelization_routines.pyx":176 * if yiter[yi] == 999: continue * ysp = oysp + yiterv[yi] * if (ysp + dysp < y_min) or (ysp - dysp > y_max): continue # <<<<<<<<<<<<<< @@ -3907,16 +4021,16 @@ if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; - goto __pyx_L30_bool_binop_done; + goto __pyx_L27_bool_binop_done; } __pyx_t_1 = (((__pyx_v_ysp - __pyx_v_dysp) > __pyx_v_y_max) != 0); __pyx_t_2 = __pyx_t_1; - __pyx_L30_bool_binop_done:; + __pyx_L27_bool_binop_done:; if (__pyx_t_2) { - goto __pyx_L26_continue; + goto __pyx_L23_continue; } - /* "yt/utilities/lib/pixelization_routines.pyx":151 + /* "yt/utilities/lib/pixelization_routines.pyx":177 * ysp = oysp + yiterv[yi] * if (ysp + dysp < y_min) or (ysp - dysp > y_max): continue * lc = fmax(((xsp-dxsp-x_min)*ipx_dx),0) # <<<<<<<<<<<<<< @@ -3925,7 +4039,7 @@ */ __pyx_v_lc = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((((__pyx_v_xsp - __pyx_v_dxsp) - __pyx_v_x_min) * __pyx_v_ipx_dx), 0.0)); - /* "yt/utilities/lib/pixelization_routines.pyx":152 + /* "yt/utilities/lib/pixelization_routines.pyx":178 * if (ysp + dysp < y_min) or (ysp - dysp > y_max): continue * lc = fmax(((xsp-dxsp-x_min)*ipx_dx),0) * lr = fmax(((ysp-dysp-y_min)*ipx_dy),0) # <<<<<<<<<<<<<< @@ -3934,37 +4048,37 @@ */ __pyx_v_lr = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((((__pyx_v_ysp - __pyx_v_dysp) - __pyx_v_y_min) * __pyx_v_ipx_dy), 0.0)); - /* "yt/utilities/lib/pixelization_routines.pyx":162 + /* "yt/utilities/lib/pixelization_routines.pyx":188 * # comparison of j to rc (double). So give ourselves a * # bonus row and bonus column here. - * rc = fmin(((xsp+dxsp-x_min)*ipx_dx + 1), rows) # <<<<<<<<<<<<<< - * rr = fmin(((ysp+dysp-y_min)*ipx_dy + 1), cols) - * for i in range(lr, rr): + * rc = fmin(((xsp+dxsp-x_min)*ipx_dx + 1), buff.shape[1]) # <<<<<<<<<<<<<< + * rr = fmin(((ysp+dysp-y_min)*ipx_dy + 1), buff.shape[0]) + * # Note that we're iterating here over *y* in the i */ - __pyx_v_rc = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(((((__pyx_v_xsp + __pyx_v_dxsp) - __pyx_v_x_min) * __pyx_v_ipx_dx) + 1.0), __pyx_v_rows)); + __pyx_v_rc = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(((((__pyx_v_xsp + __pyx_v_dxsp) - __pyx_v_x_min) * __pyx_v_ipx_dx) + 1.0), (__pyx_v_buff.shape[1]))); - /* "yt/utilities/lib/pixelization_routines.pyx":163 + /* "yt/utilities/lib/pixelization_routines.pyx":189 * # bonus row and bonus column here. - * rc = fmin(((xsp+dxsp-x_min)*ipx_dx + 1), rows) - * rr = fmin(((ysp+dysp-y_min)*ipx_dy + 1), cols) # <<<<<<<<<<<<<< - * for i in range(lr, rr): - * lypx = px_dy * i + y_min - */ - __pyx_v_rr = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(((((__pyx_v_ysp + __pyx_v_dysp) - __pyx_v_y_min) * __pyx_v_ipx_dy) + 1.0), __pyx_v_cols)); - - /* "yt/utilities/lib/pixelization_routines.pyx":164 - * rc = fmin(((xsp+dxsp-x_min)*ipx_dx + 1), rows) - * rr = fmin(((ysp+dysp-y_min)*ipx_dy + 1), cols) + * rc = fmin(((xsp+dxsp-x_min)*ipx_dx + 1), buff.shape[1]) + * rr = fmin(((ysp+dysp-y_min)*ipx_dy + 1), buff.shape[0]) # <<<<<<<<<<<<<< + * # Note that we're iterating here over *y* in the i + * # direction. See the note above about this. + */ + __pyx_v_rr = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(((((__pyx_v_ysp + __pyx_v_dysp) - __pyx_v_y_min) * __pyx_v_ipx_dy) + 1.0), (__pyx_v_buff.shape[0]))); + + /* "yt/utilities/lib/pixelization_routines.pyx":192 + * # Note that we're iterating here over *y* in the i + * # direction. See the note above about this. * for i in range(lr, rr): # <<<<<<<<<<<<<< * lypx = px_dy * i + y_min * rypx = px_dy * (i+1) + y_min */ - __pyx_t_22 = __pyx_v_rr; - for (__pyx_t_23 = __pyx_v_lr; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { - __pyx_v_i = __pyx_t_23; + __pyx_t_15 = __pyx_v_rr; + for (__pyx_t_16 = __pyx_v_lr; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; - /* "yt/utilities/lib/pixelization_routines.pyx":165 - * rr = fmin(((ysp+dysp-y_min)*ipx_dy + 1), cols) + /* "yt/utilities/lib/pixelization_routines.pyx":193 + * # direction. See the note above about this. * for i in range(lr, rr): * lypx = px_dy * i + y_min # <<<<<<<<<<<<<< * rypx = px_dy * (i+1) + y_min @@ -3972,7 +4086,7 @@ */ __pyx_v_lypx = ((__pyx_v_px_dy * __pyx_v_i) + __pyx_v_y_min); - /* "yt/utilities/lib/pixelization_routines.pyx":166 + /* "yt/utilities/lib/pixelization_routines.pyx":194 * for i in range(lr, rr): * lypx = px_dy * i + y_min * rypx = px_dy * (i+1) + y_min # <<<<<<<<<<<<<< @@ -3981,7 +4095,7 @@ */ __pyx_v_rypx = ((__pyx_v_px_dy * (__pyx_v_i + 1)) + __pyx_v_y_min); - /* "yt/utilities/lib/pixelization_routines.pyx":167 + /* "yt/utilities/lib/pixelization_routines.pyx":195 * lypx = px_dy * i + y_min * rypx = px_dy * (i+1) + y_min * if antialias == 1: # <<<<<<<<<<<<<< @@ -3991,7 +4105,7 @@ __pyx_t_2 = ((__pyx_v_antialias == 1) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":169 + /* "yt/utilities/lib/pixelization_routines.pyx":197 * if antialias == 1: * overlap2 = ((fmin(rypx, ysp+dysp) * - fmax(lypx, (ysp-dysp)))*ipx_dy) # <<<<<<<<<<<<<< @@ -4000,7 +4114,7 @@ */ __pyx_v_overlap2 = ((__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_rypx, (__pyx_v_ysp + __pyx_v_dysp)) - __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_lypx, (__pyx_v_ysp - __pyx_v_dysp))) * __pyx_v_ipx_dy); - /* "yt/utilities/lib/pixelization_routines.pyx":167 + /* "yt/utilities/lib/pixelization_routines.pyx":195 * lypx = px_dy * i + y_min * rypx = px_dy * (i+1) + y_min * if antialias == 1: # <<<<<<<<<<<<<< @@ -4009,7 +4123,7 @@ */ } - /* "yt/utilities/lib/pixelization_routines.pyx":170 + /* "yt/utilities/lib/pixelization_routines.pyx":198 * overlap2 = ((fmin(rypx, ysp+dysp) * - fmax(lypx, (ysp-dysp)))*ipx_dy) * if overlap2 < 0.0: continue # <<<<<<<<<<<<<< @@ -4018,21 +4132,21 @@ */ __pyx_t_2 = ((__pyx_v_overlap2 < 0.0) != 0); if (__pyx_t_2) { - goto __pyx_L32_continue; + goto __pyx_L29_continue; } - /* "yt/utilities/lib/pixelization_routines.pyx":171 + /* "yt/utilities/lib/pixelization_routines.pyx":199 * - fmax(lypx, (ysp-dysp)))*ipx_dy) * if overlap2 < 0.0: continue * for j in range(lc, rc): # <<<<<<<<<<<<<< * lxpx = px_dx * j + x_min * rxpx = px_dx * (j+1) + x_min */ - __pyx_t_24 = __pyx_v_rc; - for (__pyx_t_25 = __pyx_v_lc; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { - __pyx_v_j = __pyx_t_25; + __pyx_t_17 = __pyx_v_rc; + for (__pyx_t_18 = __pyx_v_lc; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_j = __pyx_t_18; - /* "yt/utilities/lib/pixelization_routines.pyx":172 + /* "yt/utilities/lib/pixelization_routines.pyx":200 * if overlap2 < 0.0: continue * for j in range(lc, rc): * lxpx = px_dx * j + x_min # <<<<<<<<<<<<<< @@ -4041,7 +4155,7 @@ */ __pyx_v_lxpx = ((__pyx_v_px_dx * __pyx_v_j) + __pyx_v_x_min); - /* "yt/utilities/lib/pixelization_routines.pyx":173 + /* "yt/utilities/lib/pixelization_routines.pyx":201 * for j in range(lc, rc): * lxpx = px_dx * j + x_min * rxpx = px_dx * (j+1) + x_min # <<<<<<<<<<<<<< @@ -4050,7 +4164,7 @@ */ __pyx_v_rxpx = ((__pyx_v_px_dx * (__pyx_v_j + 1)) + __pyx_v_x_min); - /* "yt/utilities/lib/pixelization_routines.pyx":174 + /* "yt/utilities/lib/pixelization_routines.pyx":202 * lxpx = px_dx * j + x_min * rxpx = px_dx * (j+1) + x_min * if line_width > 0: # <<<<<<<<<<<<<< @@ -4060,7 +4174,7 @@ __pyx_t_2 = ((__pyx_v_line_width > 0.0) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":178 + /* "yt/utilities/lib/pixelization_routines.pyx":206 * # line_width*px_dx of the cell edge * # Midpoint of x: * cx = (rxpx+lxpx)*0.5 # <<<<<<<<<<<<<< @@ -4069,7 +4183,7 @@ */ __pyx_v_cx = ((__pyx_v_rxpx + __pyx_v_lxpx) * 0.5); - /* "yt/utilities/lib/pixelization_routines.pyx":179 + /* "yt/utilities/lib/pixelization_routines.pyx":207 * # Midpoint of x: * cx = (rxpx+lxpx)*0.5 * ld_x = fmin(fabs(cx - (xsp+dxsp)), # <<<<<<<<<<<<<< @@ -4078,7 +4192,7 @@ */ __pyx_v_ld_x = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs((__pyx_v_cx - (__pyx_v_xsp + __pyx_v_dxsp))), __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs((__pyx_v_cx - (__pyx_v_xsp - __pyx_v_dxsp)))); - /* "yt/utilities/lib/pixelization_routines.pyx":181 + /* "yt/utilities/lib/pixelization_routines.pyx":209 * ld_x = fmin(fabs(cx - (xsp+dxsp)), * fabs(cx - (xsp-dxsp))) * ld_x *= ipx_dx # <<<<<<<<<<<<<< @@ -4087,7 +4201,7 @@ */ __pyx_v_ld_x = (__pyx_v_ld_x * __pyx_v_ipx_dx); - /* "yt/utilities/lib/pixelization_routines.pyx":183 + /* "yt/utilities/lib/pixelization_routines.pyx":211 * ld_x *= ipx_dx * # Midpoint of y: * cy = (rypx+lypx)*0.5 # <<<<<<<<<<<<<< @@ -4096,7 +4210,7 @@ */ __pyx_v_cy = ((__pyx_v_rypx + __pyx_v_lypx) * 0.5); - /* "yt/utilities/lib/pixelization_routines.pyx":184 + /* "yt/utilities/lib/pixelization_routines.pyx":212 * # Midpoint of y: * cy = (rypx+lypx)*0.5 * ld_y = fmin(fabs(cy - (ysp+dysp)), # <<<<<<<<<<<<<< @@ -4105,66 +4219,66 @@ */ __pyx_v_ld_y = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs((__pyx_v_cy - (__pyx_v_ysp + __pyx_v_dysp))), __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs((__pyx_v_cy - (__pyx_v_ysp - __pyx_v_dysp)))); - /* "yt/utilities/lib/pixelization_routines.pyx":186 + /* "yt/utilities/lib/pixelization_routines.pyx":214 * ld_y = fmin(fabs(cy - (ysp+dysp)), * fabs(cy - (ysp-dysp))) * ld_y *= ipx_dy # <<<<<<<<<<<<<< * if ld_x <= line_width or ld_y <= line_width: - * my_array[j,i] = 1.0 + * buff[i,j] = 1.0 */ __pyx_v_ld_y = (__pyx_v_ld_y * __pyx_v_ipx_dy); - /* "yt/utilities/lib/pixelization_routines.pyx":187 + /* "yt/utilities/lib/pixelization_routines.pyx":215 * fabs(cy - (ysp-dysp))) * ld_y *= ipx_dy * if ld_x <= line_width or ld_y <= line_width: # <<<<<<<<<<<<<< - * my_array[j,i] = 1.0 + * buff[i,j] = 1.0 * elif antialias == 1: */ __pyx_t_1 = ((__pyx_v_ld_x <= __pyx_v_line_width) != 0); if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; - goto __pyx_L40_bool_binop_done; + goto __pyx_L37_bool_binop_done; } __pyx_t_1 = ((__pyx_v_ld_y <= __pyx_v_line_width) != 0); __pyx_t_2 = __pyx_t_1; - __pyx_L40_bool_binop_done:; + __pyx_L37_bool_binop_done:; if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":188 + /* "yt/utilities/lib/pixelization_routines.pyx":216 * ld_y *= ipx_dy * if ld_x <= line_width or ld_y <= line_width: - * my_array[j,i] = 1.0 # <<<<<<<<<<<<<< + * buff[i,j] = 1.0 # <<<<<<<<<<<<<< * elif antialias == 1: * overlap1 = ((fmin(rxpx, xsp+dxsp) */ - __pyx_t_26 = __pyx_v_j; - __pyx_t_27 = __pyx_v_i; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_my_array.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_my_array.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_my_array.diminfo[1].strides) = 1.0; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_buff.data + __pyx_t_19 * __pyx_v_buff.strides[0]) ) + __pyx_t_20 * __pyx_v_buff.strides[1]) )) = 1.0; - /* "yt/utilities/lib/pixelization_routines.pyx":187 + /* "yt/utilities/lib/pixelization_routines.pyx":215 * fabs(cy - (ysp-dysp))) * ld_y *= ipx_dy * if ld_x <= line_width or ld_y <= line_width: # <<<<<<<<<<<<<< - * my_array[j,i] = 1.0 + * buff[i,j] = 1.0 * elif antialias == 1: */ } - /* "yt/utilities/lib/pixelization_routines.pyx":174 + /* "yt/utilities/lib/pixelization_routines.pyx":202 * lxpx = px_dx * j + x_min * rxpx = px_dx * (j+1) + x_min * if line_width > 0: # <<<<<<<<<<<<<< * # Here, we figure out if we're within * # line_width*px_dx of the cell edge */ - goto __pyx_L38; + goto __pyx_L35; } - /* "yt/utilities/lib/pixelization_routines.pyx":189 + /* "yt/utilities/lib/pixelization_routines.pyx":217 * if ld_x <= line_width or ld_y <= line_width: - * my_array[j,i] = 1.0 + * buff[i,j] = 1.0 * elif antialias == 1: # <<<<<<<<<<<<<< * overlap1 = ((fmin(rxpx, xsp+dxsp) * - fmax(lxpx, (xsp-dxsp)))*ipx_dx) @@ -4172,7 +4286,7 @@ __pyx_t_2 = ((__pyx_v_antialias == 1) != 0); if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":191 + /* "yt/utilities/lib/pixelization_routines.pyx":219 * elif antialias == 1: * overlap1 = ((fmin(rxpx, xsp+dxsp) * - fmax(lxpx, (xsp-dxsp)))*ipx_dx) # <<<<<<<<<<<<<< @@ -4181,7 +4295,7 @@ */ __pyx_v_overlap1 = ((__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_rxpx, (__pyx_v_xsp + __pyx_v_dxsp)) - __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_lxpx, (__pyx_v_xsp - __pyx_v_dxsp))) * __pyx_v_ipx_dx); - /* "yt/utilities/lib/pixelization_routines.pyx":192 + /* "yt/utilities/lib/pixelization_routines.pyx":220 * overlap1 = ((fmin(rxpx, xsp+dxsp) * - fmax(lxpx, (xsp-dxsp)))*ipx_dx) * if overlap1 < 0.0: continue # <<<<<<<<<<<<<< @@ -4190,69 +4304,69 @@ */ __pyx_t_2 = ((__pyx_v_overlap1 < 0.0) != 0); if (__pyx_t_2) { - goto __pyx_L36_continue; + goto __pyx_L33_continue; } - /* "yt/utilities/lib/pixelization_routines.pyx":200 + /* "yt/utilities/lib/pixelization_routines.pyx":228 * # This will reduce artifacts if we ever move to * # compositing instead of replacing bitmaps. * if overlap1 * overlap2 == 0.0: continue # <<<<<<<<<<<<<< - * my_array[j,i] += (dsp * overlap1) * overlap2 + * buff[i,j] += (dsp * overlap1) * overlap2 * else: */ __pyx_t_2 = (((__pyx_v_overlap1 * __pyx_v_overlap2) == 0.0) != 0); if (__pyx_t_2) { - goto __pyx_L36_continue; + goto __pyx_L33_continue; } - /* "yt/utilities/lib/pixelization_routines.pyx":201 + /* "yt/utilities/lib/pixelization_routines.pyx":229 * # compositing instead of replacing bitmaps. * if overlap1 * overlap2 == 0.0: continue - * my_array[j,i] += (dsp * overlap1) * overlap2 # <<<<<<<<<<<<<< + * buff[i,j] += (dsp * overlap1) * overlap2 # <<<<<<<<<<<<<< * else: - * my_array[j,i] = dsp + * buff[i,j] = dsp */ - __pyx_t_28 = __pyx_v_j; - __pyx_t_29 = __pyx_v_i; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_my_array.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_my_array.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_my_array.diminfo[1].strides) += ((__pyx_v_dsp * __pyx_v_overlap1) * __pyx_v_overlap2); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_buff.data + __pyx_t_21 * __pyx_v_buff.strides[0]) ) + __pyx_t_22 * __pyx_v_buff.strides[1]) )) += ((__pyx_v_dsp * __pyx_v_overlap1) * __pyx_v_overlap2); - /* "yt/utilities/lib/pixelization_routines.pyx":189 + /* "yt/utilities/lib/pixelization_routines.pyx":217 * if ld_x <= line_width or ld_y <= line_width: - * my_array[j,i] = 1.0 + * buff[i,j] = 1.0 * elif antialias == 1: # <<<<<<<<<<<<<< * overlap1 = ((fmin(rxpx, xsp+dxsp) * - fmax(lxpx, (xsp-dxsp)))*ipx_dx) */ - goto __pyx_L38; + goto __pyx_L35; } - /* "yt/utilities/lib/pixelization_routines.pyx":203 - * my_array[j,i] += (dsp * overlap1) * overlap2 + /* "yt/utilities/lib/pixelization_routines.pyx":231 + * buff[i,j] += (dsp * overlap1) * overlap2 * else: - * my_array[j,i] = dsp # <<<<<<<<<<<<<< + * buff[i,j] = dsp # <<<<<<<<<<<<<< * - * return my_array + * @cython.cdivision(True) */ /*else*/ { - __pyx_t_30 = __pyx_v_j; - __pyx_t_31 = __pyx_v_i; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_my_array.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_my_array.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_my_array.diminfo[1].strides) = __pyx_v_dsp; + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_buff.data + __pyx_t_23 * __pyx_v_buff.strides[0]) ) + __pyx_t_24 * __pyx_v_buff.strides[1]) )) = __pyx_v_dsp; } - __pyx_L38:; - __pyx_L36_continue:; + __pyx_L35:; + __pyx_L33_continue:; } - __pyx_L32_continue:; + __pyx_L29_continue:; } - __pyx_L26_continue:; + __pyx_L23_continue:; } - __pyx_L20_continue:; + __pyx_L17_continue:; } } } - /* "yt/utilities/lib/pixelization_routines.pyx":121 - * # depositing into them the data value. Overlap computes the relative - * # overlap of a data value with a pixel. + /* "yt/utilities/lib/pixelization_routines.pyx":147 + * # first axis : y_min .. y_max + * # second axis: x_min .. x_max * with nogil: # <<<<<<<<<<<<<< * for p in range(px.shape[0]): * xiter[1] = yiter[1] = 999 @@ -4260,9528 +4374,9912 @@ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif - goto __pyx_L14; + goto __pyx_L11; } - __pyx_L14:; + __pyx_L11:; } } - /* "yt/utilities/lib/pixelization_routines.pyx":205 - * my_array[j,i] = dsp - * - * return my_array # <<<<<<<<<<<<<< - * - * @cython.cdivision(True) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_my_array)); - __pyx_r = ((PyObject *)__pyx_v_my_array); - goto __pyx_L0; - - /* "yt/utilities/lib/pixelization_routines.pyx":55 + /* "yt/utilities/lib/pixelization_routines.pyx":59 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_cartesian(np.ndarray[np.float64_t, ndim=1] px, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] py, - * np.ndarray[np.float64_t, ndim=1] pdx, + * def pixelize_cartesian(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] px, + * np.float64_t[:] py, */ /* 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_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pdx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pdy.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_px.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_py.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_cartesian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - goto __pyx_L2; __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pdx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pdy.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_px.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_py.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_my_array); + __PYX_XDEC_MEMVIEW(&__pyx_v_buff, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_px, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_py, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_pdx, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_pdy, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/pixelization_routines.pyx":210 +/* "yt/utilities/lib/pixelization_routines.pyx":236 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_off_axis_cartesian( # <<<<<<<<<<<<<< - * np.float64_t[:] x, - * np.float64_t[:] y, + * def pixelize_cartesian_nodal(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] px, + * np.float64_t[:] py, */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_3pixelize_off_axis_cartesian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_3pixelize_off_axis_cartesian = {"pixelize_off_axis_cartesian", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_3pixelize_off_axis_cartesian, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_3pixelize_off_axis_cartesian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_z = { 0, 0, { 0 }, { 0 }, { 0 } }; +static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_3pixelize_cartesian_nodal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_3pixelize_cartesian_nodal = {"pixelize_cartesian_nodal", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_3pixelize_cartesian_nodal, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_3pixelize_cartesian_nodal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_buff = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_px = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_py = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_pz = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_pdx = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_pdy = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_pdz = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_center = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_inv_mat = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_indices = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; - int __pyx_v_cols; - int __pyx_v_rows; + __pyx_t_5numpy_float64_t __pyx_v_coord; PyObject *__pyx_v_bounds = 0; + CYTHON_UNUSED int __pyx_v_antialias; + PyObject *__pyx_v_period = 0; + int __pyx_v_check_period; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("pixelize_off_axis_cartesian (wrapper)", 0); + __Pyx_RefNannySetupContext("pixelize_cartesian_nodal (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_z,&__pyx_n_s_px,&__pyx_n_s_py,&__pyx_n_s_pdx,&__pyx_n_s_pdy,&__pyx_n_s_pdz,&__pyx_n_s_center,&__pyx_n_s_inv_mat,&__pyx_n_s_indices,&__pyx_n_s_data,&__pyx_n_s_cols,&__pyx_n_s_rows,&__pyx_n_s_bounds,0}; - PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buff,&__pyx_n_s_px,&__pyx_n_s_py,&__pyx_n_s_pz,&__pyx_n_s_pdx,&__pyx_n_s_pdy,&__pyx_n_s_pdz,&__pyx_n_s_data,&__pyx_n_s_coord,&__pyx_n_s_bounds,&__pyx_n_s_antialias,&__pyx_n_s_period,&__pyx_n_s_check_period,0}; + PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; + + /* "yt/utilities/lib/pixelization_routines.pyx":247 + * bounds, + * int antialias = 1, + * period = None, # <<<<<<<<<<<<<< + * int check_period = 1): + * cdef np.float64_t x_min, x_max, y_min, y_max + */ + values[11] = ((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 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); - case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buff)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 1); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian_nodal", 0, 10, 13, 1); __PYX_ERR(0, 236, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 2); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian_nodal", 0, 10, 13, 2); __PYX_ERR(0, 236, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pz)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 3); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian_nodal", 0, 10, 13, 3); __PYX_ERR(0, 236, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--; + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdx)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 4); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian_nodal", 0, 10, 13, 4); __PYX_ERR(0, 236, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdx)) != 0)) kw_args--; + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 5); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian_nodal", 0, 10, 13, 5); __PYX_ERR(0, 236, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdy)) != 0)) kw_args--; + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdz)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 6); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian_nodal", 0, 10, 13, 6); __PYX_ERR(0, 236, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdz)) != 0)) kw_args--; + if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 7); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian_nodal", 0, 10, 13, 7); __PYX_ERR(0, 236, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_center)) != 0)) kw_args--; + if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coord)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 8); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian_nodal", 0, 10, 13, 8); __PYX_ERR(0, 236, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 9: - if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inv_mat)) != 0)) kw_args--; + if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 9); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian_nodal", 0, 10, 13, 9); __PYX_ERR(0, 236, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 10: - if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 10); __PYX_ERR(0, 210, __pyx_L3_error) - } + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_antialias); + if (value) { values[10] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; case 11: - if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 11); __PYX_ERR(0, 210, __pyx_L3_error) + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_period); + if (value) { values[11] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 12: - if (likely((values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 12); __PYX_ERR(0, 210, __pyx_L3_error) - } - case 13: - if (likely((values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 13); __PYX_ERR(0, 210, __pyx_L3_error) - } - case 14: - if (likely((values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, 14); __PYX_ERR(0, 210, __pyx_L3_error) + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_check_period); + if (value) { values[12] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_off_axis_cartesian") < 0)) __PYX_ERR(0, 210, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_cartesian_nodal") < 0)) __PYX_ERR(0, 236, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 15) { - goto __pyx_L5_argtuple_error; } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - values[10] = PyTuple_GET_ITEM(__pyx_args, 10); - values[11] = PyTuple_GET_ITEM(__pyx_args, 11); - values[12] = PyTuple_GET_ITEM(__pyx_args, 12); - values[13] = PyTuple_GET_ITEM(__pyx_args, 13); - values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[4] = PyTuple_GET_ITEM(__pyx_args, 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_buff = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_buff.memview)) __PYX_ERR(0, 236, __pyx_L3_error) + __pyx_v_px = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_px.memview)) __PYX_ERR(0, 237, __pyx_L3_error) + __pyx_v_py = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_py.memview)) __PYX_ERR(0, 238, __pyx_L3_error) + __pyx_v_pz = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_pz.memview)) __PYX_ERR(0, 239, __pyx_L3_error) + __pyx_v_pdx = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[4]); if (unlikely(!__pyx_v_pdx.memview)) __PYX_ERR(0, 240, __pyx_L3_error) + __pyx_v_pdy = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[5]); if (unlikely(!__pyx_v_pdy.memview)) __PYX_ERR(0, 241, __pyx_L3_error) + __pyx_v_pdz = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[6]); if (unlikely(!__pyx_v_pdz.memview)) __PYX_ERR(0, 242, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[7]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 243, __pyx_L3_error) + __pyx_v_coord = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_coord == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error) + __pyx_v_bounds = values[9]; + if (values[10]) { + __pyx_v_antialias = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_antialias == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L3_error) + } else { + __pyx_v_antialias = ((int)1); + } + __pyx_v_period = values[11]; + if (values[12]) { + __pyx_v_check_period = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_check_period == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error) + } else { + __pyx_v_check_period = ((int)1); } - __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_y = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_y.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_z = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_z.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_px = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_px.memview)) __PYX_ERR(0, 214, __pyx_L3_error) - __pyx_v_py = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[4]); if (unlikely(!__pyx_v_py.memview)) __PYX_ERR(0, 215, __pyx_L3_error) - __pyx_v_pdx = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[5]); if (unlikely(!__pyx_v_pdx.memview)) __PYX_ERR(0, 216, __pyx_L3_error) - __pyx_v_pdy = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[6]); if (unlikely(!__pyx_v_pdy.memview)) __PYX_ERR(0, 217, __pyx_L3_error) - __pyx_v_pdz = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[7]); if (unlikely(!__pyx_v_pdz.memview)) __PYX_ERR(0, 218, __pyx_L3_error) - __pyx_v_center = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[8]); if (unlikely(!__pyx_v_center.memview)) __PYX_ERR(0, 219, __pyx_L3_error) - __pyx_v_inv_mat = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[9]); if (unlikely(!__pyx_v_inv_mat.memview)) __PYX_ERR(0, 220, __pyx_L3_error) - __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[10]); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 221, __pyx_L3_error) - __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[11]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 222, __pyx_L3_error) - __pyx_v_cols = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_cols == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L3_error) - __pyx_v_rows = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L3_error) - __pyx_v_bounds = values[14]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 15, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cartesian_nodal", 0, 10, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 236, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_off_axis_cartesian", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_cartesian_nodal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_2yt_9utilities_3lib_21pixelization_routines_2pixelize_off_axis_cartesian(__pyx_self, __pyx_v_x, __pyx_v_y, __pyx_v_z, __pyx_v_px, __pyx_v_py, __pyx_v_pdx, __pyx_v_pdy, __pyx_v_pdz, __pyx_v_center, __pyx_v_inv_mat, __pyx_v_indices, __pyx_v_data, __pyx_v_cols, __pyx_v_rows, __pyx_v_bounds); + __pyx_r = __pyx_pf_2yt_9utilities_3lib_21pixelization_routines_2pixelize_cartesian_nodal(__pyx_self, __pyx_v_buff, __pyx_v_px, __pyx_v_py, __pyx_v_pz, __pyx_v_pdx, __pyx_v_pdy, __pyx_v_pdz, __pyx_v_data, __pyx_v_coord, __pyx_v_bounds, __pyx_v_antialias, __pyx_v_period, __pyx_v_check_period); + + /* "yt/utilities/lib/pixelization_routines.pyx":236 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pixelize_cartesian_nodal(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] px, + * np.float64_t[:] py, + */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_2pixelize_off_axis_cartesian(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_y, __Pyx_memviewslice __pyx_v_z, __Pyx_memviewslice __pyx_v_px, __Pyx_memviewslice __pyx_v_py, __Pyx_memviewslice __pyx_v_pdx, __Pyx_memviewslice __pyx_v_pdy, __Pyx_memviewslice __pyx_v_pdz, __Pyx_memviewslice __pyx_v_center, __Pyx_memviewslice __pyx_v_inv_mat, __Pyx_memviewslice __pyx_v_indices, __Pyx_memviewslice __pyx_v_data, int __pyx_v_cols, int __pyx_v_rows, PyObject *__pyx_v_bounds) { +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_2pixelize_cartesian_nodal(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_buff, __Pyx_memviewslice __pyx_v_px, __Pyx_memviewslice __pyx_v_py, __Pyx_memviewslice __pyx_v_pz, __Pyx_memviewslice __pyx_v_pdx, __Pyx_memviewslice __pyx_v_pdy, __Pyx_memviewslice __pyx_v_pdz, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_float64_t __pyx_v_coord, PyObject *__pyx_v_bounds, CYTHON_UNUSED int __pyx_v_antialias, PyObject *__pyx_v_period, int __pyx_v_check_period) { __pyx_t_5numpy_float64_t __pyx_v_x_min; __pyx_t_5numpy_float64_t __pyx_v_x_max; __pyx_t_5numpy_float64_t __pyx_v_y_min; __pyx_t_5numpy_float64_t __pyx_v_y_max; + __pyx_t_5numpy_float64_t __pyx_v_period_x; + __pyx_t_5numpy_float64_t __pyx_v_period_y; __pyx_t_5numpy_float64_t __pyx_v_width; __pyx_t_5numpy_float64_t __pyx_v_height; __pyx_t_5numpy_float64_t __pyx_v_px_dx; __pyx_t_5numpy_float64_t __pyx_v_px_dy; __pyx_t_5numpy_float64_t __pyx_v_ipx_dx; __pyx_t_5numpy_float64_t __pyx_v_ipx_dy; - __pyx_t_5numpy_float64_t __pyx_v_md; + __pyx_t_5numpy_float64_t __pyx_v_cx; + __pyx_t_5numpy_float64_t __pyx_v_cy; + __pyx_t_5numpy_float64_t __pyx_v_cz; int __pyx_v_i; int __pyx_v_j; int __pyx_v_p; - int __pyx_v_ip; + int __pyx_v_xi; + int __pyx_v_yi; int __pyx_v_lc; int __pyx_v_lr; int __pyx_v_rc; int __pyx_v_rr; + __pyx_t_5numpy_float64_t __pyx_v_lypx; + __pyx_t_5numpy_float64_t __pyx_v_rypx; + __pyx_t_5numpy_float64_t __pyx_v_lxpx; + __pyx_t_5numpy_float64_t __pyx_v_rxpx; + CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_overlap1; + CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_overlap2; + __pyx_t_5numpy_float64_t __pyx_v_oxsp; + __pyx_t_5numpy_float64_t __pyx_v_oysp; + __pyx_t_5numpy_float64_t __pyx_v_ozsp; __pyx_t_5numpy_float64_t __pyx_v_xsp; __pyx_t_5numpy_float64_t __pyx_v_ysp; __pyx_t_5numpy_float64_t __pyx_v_zsp; __pyx_t_5numpy_float64_t __pyx_v_dxsp; __pyx_t_5numpy_float64_t __pyx_v_dysp; __pyx_t_5numpy_float64_t __pyx_v_dzsp; - __pyx_t_5numpy_float64_t __pyx_v_dsp; - __pyx_t_5numpy_float64_t __pyx_v_pxsp; - __pyx_t_5numpy_float64_t __pyx_v_pysp; - __pyx_t_5numpy_float64_t __pyx_v_cxpx; - __pyx_t_5numpy_float64_t __pyx_v_cypx; - __pyx_t_5numpy_float64_t __pyx_v_cx; - __pyx_t_5numpy_float64_t __pyx_v_cy; - __pyx_t_5numpy_float64_t __pyx_v_cz; - PyArrayObject *__pyx_v_my_array = 0; - PyArrayObject *__pyx_v_mask = 0; - __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; - __Pyx_Buffer __pyx_pybuffer_mask; - __Pyx_LocalBuf_ND __pyx_pybuffernd_my_array; - __Pyx_Buffer __pyx_pybuffer_my_array; + int __pyx_v_xiter[2]; + int __pyx_v_yiter[2]; + int __pyx_v_ii; + int __pyx_v_jj; + int __pyx_v_kk; + int __pyx_v_ind; + __pyx_t_5numpy_float64_t __pyx_v_xiterv[2]; + __pyx_t_5numpy_float64_t __pyx_v_yiterv[2]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - PyArrayObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyArrayObject *__pyx_t_14 = NULL; - 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_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + int __pyx_t_18; + int __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; - int __pyx_t_26; - int __pyx_t_27; - int __pyx_t_28; - int __pyx_t_29; - Py_ssize_t __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; - Py_ssize_t __pyx_t_35; - Py_ssize_t __pyx_t_36; - Py_ssize_t __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; - Py_ssize_t __pyx_t_47; - Py_ssize_t __pyx_t_48; - __Pyx_RefNannySetupContext("pixelize_off_axis_cartesian", 0); - __pyx_pybuffer_my_array.pybuffer.buf = NULL; - __pyx_pybuffer_my_array.refcount = 0; - __pyx_pybuffernd_my_array.data = NULL; - __pyx_pybuffernd_my_array.rcbuffer = &__pyx_pybuffer_my_array; - __pyx_pybuffer_mask.pybuffer.buf = NULL; - __pyx_pybuffer_mask.refcount = 0; - __pyx_pybuffernd_mask.data = NULL; - __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + __Pyx_RefNannySetupContext("pixelize_cartesian_nodal", 0); - /* "yt/utilities/lib/pixelization_routines.pyx":234 - * cdef np.ndarray[np.float64_t, ndim=2] my_array - * cdef np.ndarray[np.int64_t, ndim=2] mask + /* "yt/utilities/lib/pixelization_routines.pyx":250 + * int check_period = 1): + * cdef np.float64_t x_min, x_max, y_min, y_max + * cdef np.float64_t period_x = 0.0, period_y = 0.0 # <<<<<<<<<<<<<< + * cdef np.float64_t width, height, px_dx, px_dy, ipx_dx, ipx_dy + * cdef np.float64_t ld_x, ld_y, cx, cy, cz + */ + __pyx_v_period_x = 0.0; + __pyx_v_period_y = 0.0; + + /* "yt/utilities/lib/pixelization_routines.pyx":266 + * cdef np.float64_t xiterv[2] + * cdef np.float64_t yiterv[2] + * if period is not None: # <<<<<<<<<<<<<< + * period_x = period[0] + * period_y = period[1] + */ + __pyx_t_1 = (__pyx_v_period != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "yt/utilities/lib/pixelization_routines.pyx":267 + * cdef np.float64_t yiterv[2] + * if period is not None: + * period_x = period[0] # <<<<<<<<<<<<<< + * period_y = period[1] + * x_min = bounds[0] + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_period, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_period_x = __pyx_t_4; + + /* "yt/utilities/lib/pixelization_routines.pyx":268 + * if period is not None: + * period_x = period[0] + * period_y = period[1] # <<<<<<<<<<<<<< + * x_min = bounds[0] + * x_max = bounds[1] + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_period, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_period_y = __pyx_t_4; + + /* "yt/utilities/lib/pixelization_routines.pyx":266 + * cdef np.float64_t xiterv[2] + * cdef np.float64_t yiterv[2] + * if period is not None: # <<<<<<<<<<<<<< + * period_x = period[0] + * period_y = period[1] + */ + } + + /* "yt/utilities/lib/pixelization_routines.pyx":269 + * period_x = period[0] + * period_y = period[1] * x_min = bounds[0] # <<<<<<<<<<<<<< * x_max = bounds[1] * y_min = bounds[2] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_x_min = __pyx_t_2; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_x_min = __pyx_t_4; - /* "yt/utilities/lib/pixelization_routines.pyx":235 - * cdef np.ndarray[np.int64_t, ndim=2] mask + /* "yt/utilities/lib/pixelization_routines.pyx":270 + * period_y = period[1] * x_min = bounds[0] * x_max = bounds[1] # <<<<<<<<<<<<<< * y_min = bounds[2] * y_max = bounds[3] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_x_max = __pyx_t_2; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_x_max = __pyx_t_4; - /* "yt/utilities/lib/pixelization_routines.pyx":236 + /* "yt/utilities/lib/pixelization_routines.pyx":271 * x_min = bounds[0] * x_max = bounds[1] * y_min = bounds[2] # <<<<<<<<<<<<<< * y_max = bounds[3] * width = x_max - x_min */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bounds, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_y_min = __pyx_t_2; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_y_min = __pyx_t_4; - /* "yt/utilities/lib/pixelization_routines.pyx":237 + /* "yt/utilities/lib/pixelization_routines.pyx":272 * x_max = bounds[1] * y_min = bounds[2] * y_max = bounds[3] # <<<<<<<<<<<<<< * width = x_max - x_min * height = y_max - y_min */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bounds, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_y_max = __pyx_t_2; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_y_max = __pyx_t_4; - /* "yt/utilities/lib/pixelization_routines.pyx":238 + /* "yt/utilities/lib/pixelization_routines.pyx":273 * y_min = bounds[2] * y_max = bounds[3] * width = x_max - x_min # <<<<<<<<<<<<<< * height = y_max - y_min - * px_dx = width / ( rows) + * px_dx = width / ( buff.shape[1]) */ __pyx_v_width = (__pyx_v_x_max - __pyx_v_x_min); - /* "yt/utilities/lib/pixelization_routines.pyx":239 + /* "yt/utilities/lib/pixelization_routines.pyx":274 * y_max = bounds[3] * width = x_max - x_min * height = y_max - y_min # <<<<<<<<<<<<<< - * px_dx = width / ( rows) - * px_dy = height / ( cols) + * px_dx = width / ( buff.shape[1]) + * px_dy = height / ( buff.shape[0]) */ __pyx_v_height = (__pyx_v_y_max - __pyx_v_y_min); - /* "yt/utilities/lib/pixelization_routines.pyx":240 + /* "yt/utilities/lib/pixelization_routines.pyx":275 * width = x_max - x_min * height = y_max - y_min - * px_dx = width / ( rows) # <<<<<<<<<<<<<< - * px_dy = height / ( cols) + * px_dx = width / ( buff.shape[1]) # <<<<<<<<<<<<<< + * px_dy = height / ( buff.shape[0]) * ipx_dx = 1.0 / px_dx */ - __pyx_v_px_dx = (__pyx_v_width / ((__pyx_t_5numpy_float64_t)__pyx_v_rows)); + __pyx_v_px_dx = (__pyx_v_width / ((__pyx_t_5numpy_float64_t)(__pyx_v_buff.shape[1]))); - /* "yt/utilities/lib/pixelization_routines.pyx":241 + /* "yt/utilities/lib/pixelization_routines.pyx":276 * height = y_max - y_min - * px_dx = width / ( rows) - * px_dy = height / ( cols) # <<<<<<<<<<<<<< + * px_dx = width / ( buff.shape[1]) + * px_dy = height / ( buff.shape[0]) # <<<<<<<<<<<<<< * ipx_dx = 1.0 / px_dx * ipx_dy = 1.0 / px_dy */ - __pyx_v_px_dy = (__pyx_v_height / ((__pyx_t_5numpy_float64_t)__pyx_v_cols)); + __pyx_v_px_dy = (__pyx_v_height / ((__pyx_t_5numpy_float64_t)(__pyx_v_buff.shape[0]))); - /* "yt/utilities/lib/pixelization_routines.pyx":242 - * px_dx = width / ( rows) - * px_dy = height / ( cols) + /* "yt/utilities/lib/pixelization_routines.pyx":277 + * px_dx = width / ( buff.shape[1]) + * px_dy = height / ( buff.shape[0]) * ipx_dx = 1.0 / px_dx # <<<<<<<<<<<<<< * ipx_dy = 1.0 / px_dy - * if rows == 0 or cols == 0: + * if px.shape[0] != py.shape[0] or \ */ __pyx_v_ipx_dx = (1.0 / __pyx_v_px_dx); - /* "yt/utilities/lib/pixelization_routines.pyx":243 - * px_dy = height / ( cols) + /* "yt/utilities/lib/pixelization_routines.pyx":278 + * px_dy = height / ( buff.shape[0]) * ipx_dx = 1.0 / px_dx * ipx_dy = 1.0 / px_dy # <<<<<<<<<<<<<< - * if rows == 0 or cols == 0: - * raise YTPixelizeError("Cannot scale to zero size") + * if px.shape[0] != py.shape[0] or \ + * px.shape[0] != pz.shape[0] or \ */ __pyx_v_ipx_dy = (1.0 / __pyx_v_px_dy); - /* "yt/utilities/lib/pixelization_routines.pyx":244 + /* "yt/utilities/lib/pixelization_routines.pyx":279 * ipx_dx = 1.0 / px_dx * ipx_dy = 1.0 / px_dy - * if rows == 0 or cols == 0: # <<<<<<<<<<<<<< - * raise YTPixelizeError("Cannot scale to zero size") - * if px.shape[0] != py.shape[0] or \ + * if px.shape[0] != py.shape[0] or \ # <<<<<<<<<<<<<< + * px.shape[0] != pz.shape[0] or \ + * px.shape[0] != pdx.shape[0] or \ */ - __pyx_t_4 = ((__pyx_v_rows == 0) != 0); - if (!__pyx_t_4) { + __pyx_t_1 = (((__pyx_v_px.shape[0]) != (__pyx_v_py.shape[0])) != 0); + if (!__pyx_t_1) { } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L4_bool_binop_done; + __pyx_t_2 = __pyx_t_1; + goto __pyx_L5_bool_binop_done; } - __pyx_t_4 = ((__pyx_v_cols == 0) != 0); - __pyx_t_3 = __pyx_t_4; - __pyx_L4_bool_binop_done:; - if (__pyx_t_3) { - - /* "yt/utilities/lib/pixelization_routines.pyx":245 - * ipx_dy = 1.0 / px_dy - * if rows == 0 or cols == 0: - * raise YTPixelizeError("Cannot scale to zero size") # <<<<<<<<<<<<<< - * if px.shape[0] != py.shape[0] or \ - * px.shape[0] != pdx.shape[0] or \ - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTPixelizeError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 245, __pyx_L1_error) - /* "yt/utilities/lib/pixelization_routines.pyx":244 - * ipx_dx = 1.0 / px_dx + /* "yt/utilities/lib/pixelization_routines.pyx":280 * ipx_dy = 1.0 / px_dy - * if rows == 0 or cols == 0: # <<<<<<<<<<<<<< - * raise YTPixelizeError("Cannot scale to zero size") * if px.shape[0] != py.shape[0] or \ - */ - } - - /* "yt/utilities/lib/pixelization_routines.pyx":246 - * if rows == 0 or cols == 0: - * raise YTPixelizeError("Cannot scale to zero size") - * if px.shape[0] != py.shape[0] or \ # <<<<<<<<<<<<<< + * px.shape[0] != pz.shape[0] or \ # <<<<<<<<<<<<<< * px.shape[0] != pdx.shape[0] or \ * px.shape[0] != pdy.shape[0] or \ */ - __pyx_t_4 = (((__pyx_v_px.shape[0]) != (__pyx_v_py.shape[0])) != 0); - if (!__pyx_t_4) { + __pyx_t_1 = (((__pyx_v_px.shape[0]) != (__pyx_v_pz.shape[0])) != 0); + if (!__pyx_t_1) { } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L7_bool_binop_done; + __pyx_t_2 = __pyx_t_1; + goto __pyx_L5_bool_binop_done; } - /* "yt/utilities/lib/pixelization_routines.pyx":247 - * raise YTPixelizeError("Cannot scale to zero size") + /* "yt/utilities/lib/pixelization_routines.pyx":281 * if px.shape[0] != py.shape[0] or \ + * px.shape[0] != pz.shape[0] or \ * px.shape[0] != pdx.shape[0] or \ # <<<<<<<<<<<<<< * px.shape[0] != pdy.shape[0] or \ * px.shape[0] != pdz.shape[0] or \ */ - __pyx_t_4 = (((__pyx_v_px.shape[0]) != (__pyx_v_pdx.shape[0])) != 0); - if (!__pyx_t_4) { + __pyx_t_1 = (((__pyx_v_px.shape[0]) != (__pyx_v_pdx.shape[0])) != 0); + if (!__pyx_t_1) { } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L7_bool_binop_done; + __pyx_t_2 = __pyx_t_1; + goto __pyx_L5_bool_binop_done; } - /* "yt/utilities/lib/pixelization_routines.pyx":248 - * if px.shape[0] != py.shape[0] or \ + /* "yt/utilities/lib/pixelization_routines.pyx":282 + * px.shape[0] != pz.shape[0] or \ * px.shape[0] != pdx.shape[0] or \ * px.shape[0] != pdy.shape[0] or \ # <<<<<<<<<<<<<< * px.shape[0] != pdz.shape[0] or \ - * px.shape[0] != indices.shape[0] or \ + * px.shape[0] != data.shape[0]: */ - __pyx_t_4 = (((__pyx_v_px.shape[0]) != (__pyx_v_pdy.shape[0])) != 0); - if (!__pyx_t_4) { + __pyx_t_1 = (((__pyx_v_px.shape[0]) != (__pyx_v_pdy.shape[0])) != 0); + if (!__pyx_t_1) { } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L7_bool_binop_done; + __pyx_t_2 = __pyx_t_1; + goto __pyx_L5_bool_binop_done; } - /* "yt/utilities/lib/pixelization_routines.pyx":249 + /* "yt/utilities/lib/pixelization_routines.pyx":283 * px.shape[0] != pdx.shape[0] or \ * px.shape[0] != pdy.shape[0] or \ * px.shape[0] != pdz.shape[0] or \ # <<<<<<<<<<<<<< - * px.shape[0] != indices.shape[0] or \ - * px.shape[0] != data.shape[0]: - */ - __pyx_t_4 = (((__pyx_v_px.shape[0]) != (__pyx_v_pdz.shape[0])) != 0); - if (!__pyx_t_4) { - } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L7_bool_binop_done; - } - - /* "yt/utilities/lib/pixelization_routines.pyx":250 - * px.shape[0] != pdy.shape[0] or \ - * px.shape[0] != pdz.shape[0] or \ - * px.shape[0] != indices.shape[0] or \ # <<<<<<<<<<<<<< * px.shape[0] != data.shape[0]: * raise YTPixelizeError("Arrays are not of correct shape.") */ - __pyx_t_4 = (((__pyx_v_px.shape[0]) != (__pyx_v_indices.shape[0])) != 0); - if (!__pyx_t_4) { + __pyx_t_1 = (((__pyx_v_px.shape[0]) != (__pyx_v_pdz.shape[0])) != 0); + if (!__pyx_t_1) { } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L7_bool_binop_done; + __pyx_t_2 = __pyx_t_1; + goto __pyx_L5_bool_binop_done; } - /* "yt/utilities/lib/pixelization_routines.pyx":251 + /* "yt/utilities/lib/pixelization_routines.pyx":284 + * px.shape[0] != pdy.shape[0] or \ * px.shape[0] != pdz.shape[0] or \ - * px.shape[0] != indices.shape[0] or \ * px.shape[0] != data.shape[0]: # <<<<<<<<<<<<<< * raise YTPixelizeError("Arrays are not of correct shape.") - * my_array = np.zeros((rows, cols), "float64") + * xiter[0] = yiter[0] = 0 */ - __pyx_t_4 = (((__pyx_v_px.shape[0]) != (__pyx_v_data.shape[0])) != 0); - __pyx_t_3 = __pyx_t_4; - __pyx_L7_bool_binop_done:; + __pyx_t_1 = (((__pyx_v_px.shape[0]) != (__pyx_v_data.shape[0])) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L5_bool_binop_done:; - /* "yt/utilities/lib/pixelization_routines.pyx":246 - * if rows == 0 or cols == 0: - * raise YTPixelizeError("Cannot scale to zero size") + /* "yt/utilities/lib/pixelization_routines.pyx":279 + * ipx_dx = 1.0 / px_dx + * ipx_dy = 1.0 / px_dy * if px.shape[0] != py.shape[0] or \ # <<<<<<<<<<<<<< + * px.shape[0] != pz.shape[0] or \ * px.shape[0] != pdx.shape[0] or \ - * px.shape[0] != pdy.shape[0] or \ */ - if (__pyx_t_3) { + if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":252 - * px.shape[0] != indices.shape[0] or \ + /* "yt/utilities/lib/pixelization_routines.pyx":285 + * px.shape[0] != pdz.shape[0] or \ * px.shape[0] != data.shape[0]: * raise YTPixelizeError("Arrays are not of correct shape.") # <<<<<<<<<<<<<< - * my_array = np.zeros((rows, cols), "float64") - * mask = np.zeros((rows, cols), "int64") + * xiter[0] = yiter[0] = 0 + * xiterv[0] = yiterv[0] = 0.0 */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTPixelizeError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTPixelizeError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 252, __pyx_L1_error) + __PYX_ERR(0, 285, __pyx_L1_error) - /* "yt/utilities/lib/pixelization_routines.pyx":246 - * if rows == 0 or cols == 0: - * raise YTPixelizeError("Cannot scale to zero size") + /* "yt/utilities/lib/pixelization_routines.pyx":279 + * ipx_dx = 1.0 / px_dx + * ipx_dy = 1.0 / px_dy * if px.shape[0] != py.shape[0] or \ # <<<<<<<<<<<<<< + * px.shape[0] != pz.shape[0] or \ * px.shape[0] != pdx.shape[0] or \ - * px.shape[0] != pdy.shape[0] or \ */ } - /* "yt/utilities/lib/pixelization_routines.pyx":253 + /* "yt/utilities/lib/pixelization_routines.pyx":286 * px.shape[0] != data.shape[0]: * raise YTPixelizeError("Arrays are not of correct shape.") - * my_array = np.zeros((rows, cols), "float64") # <<<<<<<<<<<<<< - * mask = np.zeros((rows, cols), "int64") - * with nogil: + * xiter[0] = yiter[0] = 0 # <<<<<<<<<<<<<< + * xiterv[0] = yiterv[0] = 0.0 + * # Here's a basic outline of what we're going to do here. The xiter and */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rows); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_cols); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); - __pyx_t_5 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = NULL; - __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_9 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_6)) { - PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_n_s_float64}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { - PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_n_s_float64}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - #endif - { - __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; - } - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_t_8); - __Pyx_INCREF(__pyx_n_s_float64); - __Pyx_GIVEREF(__pyx_n_s_float64); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_n_s_float64); - __pyx_t_8 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 253, __pyx_L1_error) - __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_my_array, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); - } - } - __pyx_pybuffernd_my_array.diminfo[0].strides = __pyx_pybuffernd_my_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_my_array.diminfo[0].shape = __pyx_pybuffernd_my_array.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_my_array.diminfo[1].strides = __pyx_pybuffernd_my_array.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_my_array.diminfo[1].shape = __pyx_pybuffernd_my_array.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 253, __pyx_L1_error) - } - __pyx_t_10 = 0; - __pyx_v_my_array = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; + (__pyx_v_xiter[0]) = 0; + (__pyx_v_yiter[0]) = 0; - /* "yt/utilities/lib/pixelization_routines.pyx":254 + /* "yt/utilities/lib/pixelization_routines.pyx":287 * raise YTPixelizeError("Arrays are not of correct shape.") - * my_array = np.zeros((rows, cols), "float64") - * mask = np.zeros((rows, cols), "int64") # <<<<<<<<<<<<<< - * with nogil: - * for ip in range(indices.shape[0]): + * xiter[0] = yiter[0] = 0 + * xiterv[0] = yiterv[0] = 0.0 # <<<<<<<<<<<<<< + * # Here's a basic outline of what we're going to do here. The xiter and + * # yiter variables govern whether or not we should check periodicity -- are */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rows); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_cols); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8); - __pyx_t_6 = 0; - __pyx_t_8 = 0; - __pyx_t_8 = NULL; - __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_9 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_n_s_int64}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_n_s_int64}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } else - #endif - { - __pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_8) { - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL; - } - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_7); - __Pyx_INCREF(__pyx_n_s_int64); - __Pyx_GIVEREF(__pyx_n_s_int64); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_n_s_int64); - __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 254, __pyx_L1_error) - __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); - } - } - __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 254, __pyx_L1_error) - } - __pyx_t_14 = 0; - __pyx_v_mask = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; + (__pyx_v_xiterv[0]) = 0.0; + (__pyx_v_yiterv[0]) = 0.0; - /* "yt/utilities/lib/pixelization_routines.pyx":255 - * my_array = np.zeros((rows, cols), "float64") - * mask = np.zeros((rows, cols), "int64") + /* "yt/utilities/lib/pixelization_routines.pyx":331 + * # first axis : y_min .. y_max + * # second axis: x_min .. x_max * with nogil: # <<<<<<<<<<<<<< - * for ip in range(indices.shape[0]): - * p = indices[ip] + * for p in range(px.shape[0]): + * xiter[1] = yiter[1] = 999 */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); #endif /*try:*/ { - /* "yt/utilities/lib/pixelization_routines.pyx":256 - * mask = np.zeros((rows, cols), "int64") + /* "yt/utilities/lib/pixelization_routines.pyx":332 + * # second axis: x_min .. x_max * with nogil: - * for ip in range(indices.shape[0]): # <<<<<<<<<<<<<< - * p = indices[ip] - * xsp = x[p] + * for p in range(px.shape[0]): # <<<<<<<<<<<<<< + * xiter[1] = yiter[1] = 999 + * oxsp = px[p] */ - __pyx_t_15 = (__pyx_v_indices.shape[0]); - for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_15; __pyx_t_9+=1) { - __pyx_v_ip = __pyx_t_9; + __pyx_t_6 = (__pyx_v_px.shape[0]); + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_p = __pyx_t_7; - /* "yt/utilities/lib/pixelization_routines.pyx":257 + /* "yt/utilities/lib/pixelization_routines.pyx":333 * with nogil: - * for ip in range(indices.shape[0]): - * p = indices[ip] # <<<<<<<<<<<<<< - * xsp = x[p] - * ysp = y[p] - */ - __pyx_t_16 = __pyx_v_ip; - __pyx_v_p = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_16 * __pyx_v_indices.strides[0]) ))); - - /* "yt/utilities/lib/pixelization_routines.pyx":258 - * for ip in range(indices.shape[0]): - * p = indices[ip] - * xsp = x[p] # <<<<<<<<<<<<<< - * ysp = y[p] - * zsp = z[p] - */ - __pyx_t_17 = __pyx_v_p; - __pyx_v_xsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_17 * __pyx_v_x.strides[0]) ))); - - /* "yt/utilities/lib/pixelization_routines.pyx":259 - * p = indices[ip] - * xsp = x[p] - * ysp = y[p] # <<<<<<<<<<<<<< - * zsp = z[p] - * pxsp = px[p] + * for p in range(px.shape[0]): + * xiter[1] = yiter[1] = 999 # <<<<<<<<<<<<<< + * oxsp = px[p] + * oysp = py[p] */ - __pyx_t_18 = __pyx_v_p; - __pyx_v_ysp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_18 * __pyx_v_y.strides[0]) ))); + (__pyx_v_xiter[1]) = 0x3E7; + (__pyx_v_yiter[1]) = 0x3E7; - /* "yt/utilities/lib/pixelization_routines.pyx":260 - * xsp = x[p] - * ysp = y[p] - * zsp = z[p] # <<<<<<<<<<<<<< - * pxsp = px[p] - * pysp = py[p] + /* "yt/utilities/lib/pixelization_routines.pyx":334 + * for p in range(px.shape[0]): + * xiter[1] = yiter[1] = 999 + * oxsp = px[p] # <<<<<<<<<<<<<< + * oysp = py[p] + * ozsp = pz[p] */ - __pyx_t_19 = __pyx_v_p; - __pyx_v_zsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_z.data + __pyx_t_19 * __pyx_v_z.strides[0]) ))); + __pyx_t_8 = __pyx_v_p; + __pyx_v_oxsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_px.data + __pyx_t_8 * __pyx_v_px.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":261 - * ysp = y[p] - * zsp = z[p] - * pxsp = px[p] # <<<<<<<<<<<<<< - * pysp = py[p] + /* "yt/utilities/lib/pixelization_routines.pyx":335 + * xiter[1] = yiter[1] = 999 + * oxsp = px[p] + * oysp = py[p] # <<<<<<<<<<<<<< + * ozsp = pz[p] * dxsp = pdx[p] */ - __pyx_t_20 = __pyx_v_p; - __pyx_v_pxsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_px.data + __pyx_t_20 * __pyx_v_px.strides[0]) ))); + __pyx_t_9 = __pyx_v_p; + __pyx_v_oysp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_py.data + __pyx_t_9 * __pyx_v_py.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":262 - * zsp = z[p] - * pxsp = px[p] - * pysp = py[p] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":336 + * oxsp = px[p] + * oysp = py[p] + * ozsp = pz[p] # <<<<<<<<<<<<<< * dxsp = pdx[p] * dysp = pdy[p] */ - __pyx_t_21 = __pyx_v_p; - __pyx_v_pysp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_py.data + __pyx_t_21 * __pyx_v_py.strides[0]) ))); + __pyx_t_10 = __pyx_v_p; + __pyx_v_ozsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pz.data + __pyx_t_10 * __pyx_v_pz.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":263 - * pxsp = px[p] - * pysp = py[p] + /* "yt/utilities/lib/pixelization_routines.pyx":337 + * oysp = py[p] + * ozsp = pz[p] * dxsp = pdx[p] # <<<<<<<<<<<<<< * dysp = pdy[p] * dzsp = pdz[p] */ - __pyx_t_22 = __pyx_v_p; - __pyx_v_dxsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdx.data + __pyx_t_22 * __pyx_v_pdx.strides[0]) ))); + __pyx_t_11 = __pyx_v_p; + __pyx_v_dxsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdx.data + __pyx_t_11 * __pyx_v_pdx.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":264 - * pysp = py[p] + /* "yt/utilities/lib/pixelization_routines.pyx":338 + * ozsp = pz[p] * dxsp = pdx[p] * dysp = pdy[p] # <<<<<<<<<<<<<< * dzsp = pdz[p] - * dsp = data[p] + * if check_period == 1: */ - __pyx_t_23 = __pyx_v_p; - __pyx_v_dysp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdy.data + __pyx_t_23 * __pyx_v_pdy.strides[0]) ))); + __pyx_t_12 = __pyx_v_p; + __pyx_v_dysp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdy.data + __pyx_t_12 * __pyx_v_pdy.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":265 + /* "yt/utilities/lib/pixelization_routines.pyx":339 * dxsp = pdx[p] * dysp = pdy[p] * dzsp = pdz[p] # <<<<<<<<<<<<<< - * dsp = data[p] - * # Any point we want to plot is at most this far from the center + * if check_period == 1: + * if (oxsp - dxsp < x_min): */ - __pyx_t_24 = __pyx_v_p; - __pyx_v_dzsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdz.data + __pyx_t_24 * __pyx_v_pdz.strides[0]) ))); + __pyx_t_13 = __pyx_v_p; + __pyx_v_dzsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdz.data + __pyx_t_13 * __pyx_v_pdz.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":266 + /* "yt/utilities/lib/pixelization_routines.pyx":340 * dysp = pdy[p] * dzsp = pdz[p] - * dsp = data[p] # <<<<<<<<<<<<<< - * # Any point we want to plot is at most this far from the center - * md = 2.0 * math.sqrt(dxsp*dxsp + dysp*dysp + dzsp*dzsp) - */ - __pyx_t_25 = __pyx_v_p; - __pyx_v_dsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_data.data + __pyx_t_25 * __pyx_v_data.strides[0]) ))); - - /* "yt/utilities/lib/pixelization_routines.pyx":268 - * dsp = data[p] - * # Any point we want to plot is at most this far from the center - * md = 2.0 * math.sqrt(dxsp*dxsp + dysp*dysp + dzsp*dzsp) # <<<<<<<<<<<<<< - * if pxsp + md < x_min or \ - * pxsp - md > x_max or \ + * if check_period == 1: # <<<<<<<<<<<<<< + * if (oxsp - dxsp < x_min): + * xiter[1] = +1 */ - __pyx_v_md = (2.0 * sqrt((((__pyx_v_dxsp * __pyx_v_dxsp) + (__pyx_v_dysp * __pyx_v_dysp)) + (__pyx_v_dzsp * __pyx_v_dzsp)))); + __pyx_t_2 = ((__pyx_v_check_period == 1) != 0); + if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":269 - * # Any point we want to plot is at most this far from the center - * md = 2.0 * math.sqrt(dxsp*dxsp + dysp*dysp + dzsp*dzsp) - * if pxsp + md < x_min or \ # <<<<<<<<<<<<<< - * pxsp - md > x_max or \ - * pysp + md < y_min or \ + /* "yt/utilities/lib/pixelization_routines.pyx":341 + * dzsp = pdz[p] + * if check_period == 1: + * if (oxsp - dxsp < x_min): # <<<<<<<<<<<<<< + * xiter[1] = +1 + * xiterv[1] = period_x */ - __pyx_t_4 = (((__pyx_v_pxsp + __pyx_v_md) < __pyx_v_x_min) != 0); - if (!__pyx_t_4) { - } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L19_bool_binop_done; - } + __pyx_t_2 = (((__pyx_v_oxsp - __pyx_v_dxsp) < __pyx_v_x_min) != 0); + if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":270 - * md = 2.0 * math.sqrt(dxsp*dxsp + dysp*dysp + dzsp*dzsp) - * if pxsp + md < x_min or \ - * pxsp - md > x_max or \ # <<<<<<<<<<<<<< - * pysp + md < y_min or \ - * pysp - md > y_max: + /* "yt/utilities/lib/pixelization_routines.pyx":342 + * if check_period == 1: + * if (oxsp - dxsp < x_min): + * xiter[1] = +1 # <<<<<<<<<<<<<< + * xiterv[1] = period_x + * elif (oxsp + dxsp > x_max): */ - __pyx_t_4 = (((__pyx_v_pxsp - __pyx_v_md) > __pyx_v_x_max) != 0); - if (!__pyx_t_4) { - } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L19_bool_binop_done; - } + (__pyx_v_xiter[1]) = 1; - /* "yt/utilities/lib/pixelization_routines.pyx":271 - * if pxsp + md < x_min or \ - * pxsp - md > x_max or \ - * pysp + md < y_min or \ # <<<<<<<<<<<<<< - * pysp - md > y_max: - * continue + /* "yt/utilities/lib/pixelization_routines.pyx":343 + * if (oxsp - dxsp < x_min): + * xiter[1] = +1 + * xiterv[1] = period_x # <<<<<<<<<<<<<< + * elif (oxsp + dxsp > x_max): + * xiter[1] = -1 */ - __pyx_t_4 = (((__pyx_v_pysp + __pyx_v_md) < __pyx_v_y_min) != 0); - if (!__pyx_t_4) { - } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L19_bool_binop_done; - } + (__pyx_v_xiterv[1]) = __pyx_v_period_x; - /* "yt/utilities/lib/pixelization_routines.pyx":272 - * pxsp - md > x_max or \ - * pysp + md < y_min or \ - * pysp - md > y_max: # <<<<<<<<<<<<<< - * continue - * lc = fmax(((pxsp - md - x_min)*ipx_dx),0) + /* "yt/utilities/lib/pixelization_routines.pyx":341 + * dzsp = pdz[p] + * if check_period == 1: + * if (oxsp - dxsp < x_min): # <<<<<<<<<<<<<< + * xiter[1] = +1 + * xiterv[1] = period_x */ - __pyx_t_4 = (((__pyx_v_pysp - __pyx_v_md) > __pyx_v_y_max) != 0); - __pyx_t_3 = __pyx_t_4; - __pyx_L19_bool_binop_done:; + goto __pyx_L17; + } - /* "yt/utilities/lib/pixelization_routines.pyx":269 - * # Any point we want to plot is at most this far from the center - * md = 2.0 * math.sqrt(dxsp*dxsp + dysp*dysp + dzsp*dzsp) - * if pxsp + md < x_min or \ # <<<<<<<<<<<<<< - * pxsp - md > x_max or \ - * pysp + md < y_min or \ + /* "yt/utilities/lib/pixelization_routines.pyx":344 + * xiter[1] = +1 + * xiterv[1] = period_x + * elif (oxsp + dxsp > x_max): # <<<<<<<<<<<<<< + * xiter[1] = -1 + * xiterv[1] = -period_x */ - if (__pyx_t_3) { + __pyx_t_2 = (((__pyx_v_oxsp + __pyx_v_dxsp) > __pyx_v_x_max) != 0); + if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":273 - * pysp + md < y_min or \ - * pysp - md > y_max: - * continue # <<<<<<<<<<<<<< - * lc = fmax(((pxsp - md - x_min)*ipx_dx),0) - * lr = fmax(((pysp - md - y_min)*ipx_dy),0) + /* "yt/utilities/lib/pixelization_routines.pyx":345 + * xiterv[1] = period_x + * elif (oxsp + dxsp > x_max): + * xiter[1] = -1 # <<<<<<<<<<<<<< + * xiterv[1] = -period_x + * if (oysp - dysp < y_min): */ - goto __pyx_L16_continue; + (__pyx_v_xiter[1]) = -1; - /* "yt/utilities/lib/pixelization_routines.pyx":269 - * # Any point we want to plot is at most this far from the center - * md = 2.0 * math.sqrt(dxsp*dxsp + dysp*dysp + dzsp*dzsp) - * if pxsp + md < x_min or \ # <<<<<<<<<<<<<< - * pxsp - md > x_max or \ - * pysp + md < y_min or \ + /* "yt/utilities/lib/pixelization_routines.pyx":346 + * elif (oxsp + dxsp > x_max): + * xiter[1] = -1 + * xiterv[1] = -period_x # <<<<<<<<<<<<<< + * if (oysp - dysp < y_min): + * yiter[1] = +1 */ - } + (__pyx_v_xiterv[1]) = (-__pyx_v_period_x); - /* "yt/utilities/lib/pixelization_routines.pyx":274 - * pysp - md > y_max: - * continue - * lc = fmax(((pxsp - md - x_min)*ipx_dx),0) # <<<<<<<<<<<<<< - * lr = fmax(((pysp - md - y_min)*ipx_dy),0) - * rc = fmin(((pxsp + md - x_min)*ipx_dx + 1), rows) + /* "yt/utilities/lib/pixelization_routines.pyx":344 + * xiter[1] = +1 + * xiterv[1] = period_x + * elif (oxsp + dxsp > x_max): # <<<<<<<<<<<<<< + * xiter[1] = -1 + * xiterv[1] = -period_x */ - __pyx_v_lc = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((((__pyx_v_pxsp - __pyx_v_md) - __pyx_v_x_min) * __pyx_v_ipx_dx), 0.0)); + } + __pyx_L17:; - /* "yt/utilities/lib/pixelization_routines.pyx":275 - * continue - * lc = fmax(((pxsp - md - x_min)*ipx_dx),0) - * lr = fmax(((pysp - md - y_min)*ipx_dy),0) # <<<<<<<<<<<<<< - * rc = fmin(((pxsp + md - x_min)*ipx_dx + 1), rows) - * rr = fmin(((pysp + md - y_min)*ipx_dy + 1), cols) + /* "yt/utilities/lib/pixelization_routines.pyx":347 + * xiter[1] = -1 + * xiterv[1] = -period_x + * if (oysp - dysp < y_min): # <<<<<<<<<<<<<< + * yiter[1] = +1 + * yiterv[1] = period_y */ - __pyx_v_lr = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((((__pyx_v_pysp - __pyx_v_md) - __pyx_v_y_min) * __pyx_v_ipx_dy), 0.0)); + __pyx_t_2 = (((__pyx_v_oysp - __pyx_v_dysp) < __pyx_v_y_min) != 0); + if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":276 - * lc = fmax(((pxsp - md - x_min)*ipx_dx),0) - * lr = fmax(((pysp - md - y_min)*ipx_dy),0) - * rc = fmin(((pxsp + md - x_min)*ipx_dx + 1), rows) # <<<<<<<<<<<<<< - * rr = fmin(((pysp + md - y_min)*ipx_dy + 1), cols) - * for i in range(lr, rr): + /* "yt/utilities/lib/pixelization_routines.pyx":348 + * xiterv[1] = -period_x + * if (oysp - dysp < y_min): + * yiter[1] = +1 # <<<<<<<<<<<<<< + * yiterv[1] = period_y + * elif (oysp + dysp > y_max): */ - __pyx_v_rc = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(((((__pyx_v_pxsp + __pyx_v_md) - __pyx_v_x_min) * __pyx_v_ipx_dx) + 1.0), __pyx_v_rows)); + (__pyx_v_yiter[1]) = 1; - /* "yt/utilities/lib/pixelization_routines.pyx":277 - * lr = fmax(((pysp - md - y_min)*ipx_dy),0) - * rc = fmin(((pxsp + md - x_min)*ipx_dx + 1), rows) - * rr = fmin(((pysp + md - y_min)*ipx_dy + 1), cols) # <<<<<<<<<<<<<< - * for i in range(lr, rr): - * cypx = px_dy * (i + 0.5) + y_min + /* "yt/utilities/lib/pixelization_routines.pyx":349 + * if (oysp - dysp < y_min): + * yiter[1] = +1 + * yiterv[1] = period_y # <<<<<<<<<<<<<< + * elif (oysp + dysp > y_max): + * yiter[1] = -1 */ - __pyx_v_rr = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(((((__pyx_v_pysp + __pyx_v_md) - __pyx_v_y_min) * __pyx_v_ipx_dy) + 1.0), __pyx_v_cols)); + (__pyx_v_yiterv[1]) = __pyx_v_period_y; - /* "yt/utilities/lib/pixelization_routines.pyx":278 - * rc = fmin(((pxsp + md - x_min)*ipx_dx + 1), rows) - * rr = fmin(((pysp + md - y_min)*ipx_dy + 1), cols) - * for i in range(lr, rr): # <<<<<<<<<<<<<< - * cypx = px_dy * (i + 0.5) + y_min - * for j in range(lc, rc): + /* "yt/utilities/lib/pixelization_routines.pyx":347 + * xiter[1] = -1 + * xiterv[1] = -period_x + * if (oysp - dysp < y_min): # <<<<<<<<<<<<<< + * yiter[1] = +1 + * yiterv[1] = period_y */ - __pyx_t_26 = __pyx_v_rr; - for (__pyx_t_27 = __pyx_v_lr; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) { - __pyx_v_i = __pyx_t_27; + goto __pyx_L18; + } - /* "yt/utilities/lib/pixelization_routines.pyx":279 - * rr = fmin(((pysp + md - y_min)*ipx_dy + 1), cols) - * for i in range(lr, rr): - * cypx = px_dy * (i + 0.5) + y_min # <<<<<<<<<<<<<< - * for j in range(lc, rc): - * cxpx = px_dx * (j + 0.5) + x_min + /* "yt/utilities/lib/pixelization_routines.pyx":350 + * yiter[1] = +1 + * yiterv[1] = period_y + * elif (oysp + dysp > y_max): # <<<<<<<<<<<<<< + * yiter[1] = -1 + * yiterv[1] = -period_y */ - __pyx_v_cypx = ((__pyx_v_px_dy * (__pyx_v_i + 0.5)) + __pyx_v_y_min); + __pyx_t_2 = (((__pyx_v_oysp + __pyx_v_dysp) > __pyx_v_y_max) != 0); + if (__pyx_t_2) { - /* "yt/utilities/lib/pixelization_routines.pyx":280 - * for i in range(lr, rr): - * cypx = px_dy * (i + 0.5) + y_min - * for j in range(lc, rc): # <<<<<<<<<<<<<< - * cxpx = px_dx * (j + 0.5) + x_min - * cx = inv_mat[0,0]*cxpx + inv_mat[0,1]*cypx + center[0] + /* "yt/utilities/lib/pixelization_routines.pyx":351 + * yiterv[1] = period_y + * elif (oysp + dysp > y_max): + * yiter[1] = -1 # <<<<<<<<<<<<<< + * yiterv[1] = -period_y + * overlap1 = overlap2 = 1.0 */ - __pyx_t_28 = __pyx_v_rc; - for (__pyx_t_29 = __pyx_v_lc; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { - __pyx_v_j = __pyx_t_29; + (__pyx_v_yiter[1]) = -1; - /* "yt/utilities/lib/pixelization_routines.pyx":281 - * cypx = px_dy * (i + 0.5) + y_min - * for j in range(lc, rc): - * cxpx = px_dx * (j + 0.5) + x_min # <<<<<<<<<<<<<< - * cx = inv_mat[0,0]*cxpx + inv_mat[0,1]*cypx + center[0] - * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] + /* "yt/utilities/lib/pixelization_routines.pyx":352 + * elif (oysp + dysp > y_max): + * yiter[1] = -1 + * yiterv[1] = -period_y # <<<<<<<<<<<<<< + * overlap1 = overlap2 = 1.0 + * zsp = ozsp */ - __pyx_v_cxpx = ((__pyx_v_px_dx * (__pyx_v_j + 0.5)) + __pyx_v_x_min); + (__pyx_v_yiterv[1]) = (-__pyx_v_period_y); - /* "yt/utilities/lib/pixelization_routines.pyx":282 - * for j in range(lc, rc): - * cxpx = px_dx * (j + 0.5) + x_min - * cx = inv_mat[0,0]*cxpx + inv_mat[0,1]*cypx + center[0] # <<<<<<<<<<<<<< - * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] - * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] + /* "yt/utilities/lib/pixelization_routines.pyx":350 + * yiter[1] = +1 + * yiterv[1] = period_y + * elif (oysp + dysp > y_max): # <<<<<<<<<<<<<< + * yiter[1] = -1 + * yiterv[1] = -period_y */ - __pyx_t_30 = 0; - __pyx_t_31 = 0; - __pyx_t_32 = 0; - __pyx_t_33 = 1; - __pyx_t_34 = 0; - __pyx_v_cx = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_inv_mat.data + __pyx_t_30 * __pyx_v_inv_mat.strides[0]) ) + __pyx_t_31 * __pyx_v_inv_mat.strides[1]) ))) * __pyx_v_cxpx) + ((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_inv_mat.data + __pyx_t_32 * __pyx_v_inv_mat.strides[0]) ) + __pyx_t_33 * __pyx_v_inv_mat.strides[1]) ))) * __pyx_v_cypx)) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_center.data + __pyx_t_34 * __pyx_v_center.strides[0]) )))); + } + __pyx_L18:; - /* "yt/utilities/lib/pixelization_routines.pyx":283 - * cxpx = px_dx * (j + 0.5) + x_min - * cx = inv_mat[0,0]*cxpx + inv_mat[0,1]*cypx + center[0] - * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] # <<<<<<<<<<<<<< - * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] - * if fabs(xsp - cx) * 0.99 > dxsp or \ + /* "yt/utilities/lib/pixelization_routines.pyx":340 + * dysp = pdy[p] + * dzsp = pdz[p] + * if check_period == 1: # <<<<<<<<<<<<<< + * if (oxsp - dxsp < x_min): + * xiter[1] = +1 */ - __pyx_t_35 = 1; - __pyx_t_36 = 0; - __pyx_t_37 = 1; - __pyx_t_38 = 1; - __pyx_t_39 = 1; - __pyx_v_cy = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_inv_mat.data + __pyx_t_35 * __pyx_v_inv_mat.strides[0]) ) + __pyx_t_36 * __pyx_v_inv_mat.strides[1]) ))) * __pyx_v_cxpx) + ((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_inv_mat.data + __pyx_t_37 * __pyx_v_inv_mat.strides[0]) ) + __pyx_t_38 * __pyx_v_inv_mat.strides[1]) ))) * __pyx_v_cypx)) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_center.data + __pyx_t_39 * __pyx_v_center.strides[0]) )))); + } - /* "yt/utilities/lib/pixelization_routines.pyx":284 - * cx = inv_mat[0,0]*cxpx + inv_mat[0,1]*cypx + center[0] - * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] - * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] # <<<<<<<<<<<<<< - * if fabs(xsp - cx) * 0.99 > dxsp or \ - * fabs(ysp - cy) * 0.99 > dysp or \ + /* "yt/utilities/lib/pixelization_routines.pyx":353 + * yiter[1] = -1 + * yiterv[1] = -period_y + * overlap1 = overlap2 = 1.0 # <<<<<<<<<<<<<< + * zsp = ozsp + * for xi in range(2): */ - __pyx_t_40 = 2; - __pyx_t_41 = 0; - __pyx_t_42 = 2; - __pyx_t_43 = 1; - __pyx_t_44 = 2; - __pyx_v_cz = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_inv_mat.data + __pyx_t_40 * __pyx_v_inv_mat.strides[0]) ) + __pyx_t_41 * __pyx_v_inv_mat.strides[1]) ))) * __pyx_v_cxpx) + ((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_inv_mat.data + __pyx_t_42 * __pyx_v_inv_mat.strides[0]) ) + __pyx_t_43 * __pyx_v_inv_mat.strides[1]) ))) * __pyx_v_cypx)) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_center.data + __pyx_t_44 * __pyx_v_center.strides[0]) )))); + __pyx_v_overlap1 = 1.0; + __pyx_v_overlap2 = 1.0; - /* "yt/utilities/lib/pixelization_routines.pyx":285 - * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] - * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] - * if fabs(xsp - cx) * 0.99 > dxsp or \ # <<<<<<<<<<<<<< - * fabs(ysp - cy) * 0.99 > dysp or \ - * fabs(zsp - cz) * 0.99 > dzsp: + /* "yt/utilities/lib/pixelization_routines.pyx":354 + * yiterv[1] = -period_y + * overlap1 = overlap2 = 1.0 + * zsp = ozsp # <<<<<<<<<<<<<< + * for xi in range(2): + * if xiter[xi] == 999: continue */ - __pyx_t_4 = (((__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs((__pyx_v_xsp - __pyx_v_cx)) * 0.99) > __pyx_v_dxsp) != 0); - if (!__pyx_t_4) { - } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L28_bool_binop_done; - } + __pyx_v_zsp = __pyx_v_ozsp; - /* "yt/utilities/lib/pixelization_routines.pyx":286 - * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] - * if fabs(xsp - cx) * 0.99 > dxsp or \ - * fabs(ysp - cy) * 0.99 > dysp or \ # <<<<<<<<<<<<<< - * fabs(zsp - cz) * 0.99 > dzsp: - * continue + /* "yt/utilities/lib/pixelization_routines.pyx":355 + * overlap1 = overlap2 = 1.0 + * zsp = ozsp + * for xi in range(2): # <<<<<<<<<<<<<< + * if xiter[xi] == 999: continue + * xsp = oxsp + xiterv[xi] */ - __pyx_t_4 = (((__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs((__pyx_v_ysp - __pyx_v_cy)) * 0.99) > __pyx_v_dysp) != 0); - if (!__pyx_t_4) { - } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L28_bool_binop_done; - } + for (__pyx_t_14 = 0; __pyx_t_14 < 2; __pyx_t_14+=1) { + __pyx_v_xi = __pyx_t_14; - /* "yt/utilities/lib/pixelization_routines.pyx":287 - * if fabs(xsp - cx) * 0.99 > dxsp or \ - * fabs(ysp - cy) * 0.99 > dysp or \ - * fabs(zsp - cz) * 0.99 > dzsp: # <<<<<<<<<<<<<< - * continue - * mask[i, j] += 1 + /* "yt/utilities/lib/pixelization_routines.pyx":356 + * zsp = ozsp + * for xi in range(2): + * if xiter[xi] == 999: continue # <<<<<<<<<<<<<< + * xsp = oxsp + xiterv[xi] + * if (xsp + dxsp < x_min) or (xsp - dxsp > x_max): continue */ - __pyx_t_4 = (((__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs((__pyx_v_zsp - __pyx_v_cz)) * 0.99) > __pyx_v_dzsp) != 0); - __pyx_t_3 = __pyx_t_4; - __pyx_L28_bool_binop_done:; + __pyx_t_2 = (((__pyx_v_xiter[__pyx_v_xi]) == 0x3E7) != 0); + if (__pyx_t_2) { + goto __pyx_L19_continue; + } - /* "yt/utilities/lib/pixelization_routines.pyx":285 - * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] - * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] - * if fabs(xsp - cx) * 0.99 > dxsp or \ # <<<<<<<<<<<<<< - * fabs(ysp - cy) * 0.99 > dysp or \ - * fabs(zsp - cz) * 0.99 > dzsp: + /* "yt/utilities/lib/pixelization_routines.pyx":357 + * for xi in range(2): + * if xiter[xi] == 999: continue + * xsp = oxsp + xiterv[xi] # <<<<<<<<<<<<<< + * if (xsp + dxsp < x_min) or (xsp - dxsp > x_max): continue + * for yi in range(2): */ - if (__pyx_t_3) { + __pyx_v_xsp = (__pyx_v_oxsp + (__pyx_v_xiterv[__pyx_v_xi])); - /* "yt/utilities/lib/pixelization_routines.pyx":288 - * fabs(ysp - cy) * 0.99 > dysp or \ - * fabs(zsp - cz) * 0.99 > dzsp: - * continue # <<<<<<<<<<<<<< - * mask[i, j] += 1 - * my_array[i, j] += dsp + /* "yt/utilities/lib/pixelization_routines.pyx":358 + * if xiter[xi] == 999: continue + * xsp = oxsp + xiterv[xi] + * if (xsp + dxsp < x_min) or (xsp - dxsp > x_max): continue # <<<<<<<<<<<<<< + * for yi in range(2): + * if yiter[yi] == 999: continue + */ + __pyx_t_1 = (((__pyx_v_xsp + __pyx_v_dxsp) < __pyx_v_x_min) != 0); + if (!__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L23_bool_binop_done; + } + __pyx_t_1 = (((__pyx_v_xsp - __pyx_v_dxsp) > __pyx_v_x_max) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L23_bool_binop_done:; + if (__pyx_t_2) { + goto __pyx_L19_continue; + } + + /* "yt/utilities/lib/pixelization_routines.pyx":359 + * xsp = oxsp + xiterv[xi] + * if (xsp + dxsp < x_min) or (xsp - dxsp > x_max): continue + * for yi in range(2): # <<<<<<<<<<<<<< + * if yiter[yi] == 999: continue + * ysp = oysp + yiterv[yi] + */ + for (__pyx_t_15 = 0; __pyx_t_15 < 2; __pyx_t_15+=1) { + __pyx_v_yi = __pyx_t_15; + + /* "yt/utilities/lib/pixelization_routines.pyx":360 + * if (xsp + dxsp < x_min) or (xsp - dxsp > x_max): continue + * for yi in range(2): + * if yiter[yi] == 999: continue # <<<<<<<<<<<<<< + * ysp = oysp + yiterv[yi] + * if (ysp + dysp < y_min) or (ysp - dysp > y_max): continue */ + __pyx_t_2 = (((__pyx_v_yiter[__pyx_v_yi]) == 0x3E7) != 0); + if (__pyx_t_2) { goto __pyx_L25_continue; + } - /* "yt/utilities/lib/pixelization_routines.pyx":285 - * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] - * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] - * if fabs(xsp - cx) * 0.99 > dxsp or \ # <<<<<<<<<<<<<< - * fabs(ysp - cy) * 0.99 > dysp or \ - * fabs(zsp - cz) * 0.99 > dzsp: + /* "yt/utilities/lib/pixelization_routines.pyx":361 + * for yi in range(2): + * if yiter[yi] == 999: continue + * ysp = oysp + yiterv[yi] # <<<<<<<<<<<<<< + * if (ysp + dysp < y_min) or (ysp - dysp > y_max): continue + * lc = fmax(((xsp-dxsp-x_min)*ipx_dx),0) + */ + __pyx_v_ysp = (__pyx_v_oysp + (__pyx_v_yiterv[__pyx_v_yi])); + + /* "yt/utilities/lib/pixelization_routines.pyx":362 + * if yiter[yi] == 999: continue + * ysp = oysp + yiterv[yi] + * if (ysp + dysp < y_min) or (ysp - dysp > y_max): continue # <<<<<<<<<<<<<< + * lc = fmax(((xsp-dxsp-x_min)*ipx_dx),0) + * lr = fmax(((ysp-dysp-y_min)*ipx_dy),0) */ + __pyx_t_1 = (((__pyx_v_ysp + __pyx_v_dysp) < __pyx_v_y_min) != 0); + if (!__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L29_bool_binop_done; + } + __pyx_t_1 = (((__pyx_v_ysp - __pyx_v_dysp) > __pyx_v_y_max) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L29_bool_binop_done:; + if (__pyx_t_2) { + goto __pyx_L25_continue; } - /* "yt/utilities/lib/pixelization_routines.pyx":289 - * fabs(zsp - cz) * 0.99 > dzsp: - * continue - * mask[i, j] += 1 # <<<<<<<<<<<<<< - * my_array[i, j] += dsp - * my_array /= mask + /* "yt/utilities/lib/pixelization_routines.pyx":363 + * ysp = oysp + yiterv[yi] + * if (ysp + dysp < y_min) or (ysp - dysp > y_max): continue + * lc = fmax(((xsp-dxsp-x_min)*ipx_dx),0) # <<<<<<<<<<<<<< + * lr = fmax(((ysp-dysp-y_min)*ipx_dy),0) + * # NOTE: This is a different way of doing it than in the C */ - __pyx_t_45 = __pyx_v_i; - __pyx_t_46 = __pyx_v_j; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_mask.diminfo[1].strides) += 1; + __pyx_v_lc = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((((__pyx_v_xsp - __pyx_v_dxsp) - __pyx_v_x_min) * __pyx_v_ipx_dx), 0.0)); - /* "yt/utilities/lib/pixelization_routines.pyx":290 - * continue - * mask[i, j] += 1 - * my_array[i, j] += dsp # <<<<<<<<<<<<<< - * my_array /= mask - * return my_array.T - */ - __pyx_t_47 = __pyx_v_i; - __pyx_t_48 = __pyx_v_j; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_my_array.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_my_array.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_my_array.diminfo[1].strides) += __pyx_v_dsp; + /* "yt/utilities/lib/pixelization_routines.pyx":364 + * if (ysp + dysp < y_min) or (ysp - dysp > y_max): continue + * lc = fmax(((xsp-dxsp-x_min)*ipx_dx),0) + * lr = fmax(((ysp-dysp-y_min)*ipx_dy),0) # <<<<<<<<<<<<<< + * # NOTE: This is a different way of doing it than in the C + * # routines. In C, we were implicitly casting the + */ + __pyx_v_lr = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((((__pyx_v_ysp - __pyx_v_dysp) - __pyx_v_y_min) * __pyx_v_ipx_dy), 0.0)); + + /* "yt/utilities/lib/pixelization_routines.pyx":374 + * # comparison of j to rc (double). So give ourselves a + * # bonus row and bonus column here. + * rc = fmin(((xsp+dxsp-x_min)*ipx_dx + 1), buff.shape[1]) # <<<<<<<<<<<<<< + * rr = fmin(((ysp+dysp-y_min)*ipx_dy + 1), buff.shape[0]) + * # Note that we're iterating here over *y* in the i + */ + __pyx_v_rc = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(((((__pyx_v_xsp + __pyx_v_dxsp) - __pyx_v_x_min) * __pyx_v_ipx_dx) + 1.0), (__pyx_v_buff.shape[1]))); + + /* "yt/utilities/lib/pixelization_routines.pyx":375 + * # bonus row and bonus column here. + * rc = fmin(((xsp+dxsp-x_min)*ipx_dx + 1), buff.shape[1]) + * rr = fmin(((ysp+dysp-y_min)*ipx_dy + 1), buff.shape[0]) # <<<<<<<<<<<<<< + * # Note that we're iterating here over *y* in the i + * # direction. See the note above about this. + */ + __pyx_v_rr = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(((((__pyx_v_ysp + __pyx_v_dysp) - __pyx_v_y_min) * __pyx_v_ipx_dy) + 1.0), (__pyx_v_buff.shape[0]))); + + /* "yt/utilities/lib/pixelization_routines.pyx":378 + * # Note that we're iterating here over *y* in the i + * # direction. See the note above about this. + * for i in range(lr, rr): # <<<<<<<<<<<<<< + * lypx = px_dy * i + y_min + * rypx = px_dy * (i+1) + y_min + */ + __pyx_t_16 = __pyx_v_rr; + for (__pyx_t_17 = __pyx_v_lr; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_i = __pyx_t_17; + + /* "yt/utilities/lib/pixelization_routines.pyx":379 + * # direction. See the note above about this. + * for i in range(lr, rr): + * lypx = px_dy * i + y_min # <<<<<<<<<<<<<< + * rypx = px_dy * (i+1) + y_min + * for j in range(lc, rc): + */ + __pyx_v_lypx = ((__pyx_v_px_dy * __pyx_v_i) + __pyx_v_y_min); + + /* "yt/utilities/lib/pixelization_routines.pyx":380 + * for i in range(lr, rr): + * lypx = px_dy * i + y_min + * rypx = px_dy * (i+1) + y_min # <<<<<<<<<<<<<< + * for j in range(lc, rc): + * lxpx = px_dx * j + x_min + */ + __pyx_v_rypx = ((__pyx_v_px_dy * (__pyx_v_i + 1)) + __pyx_v_y_min); + + /* "yt/utilities/lib/pixelization_routines.pyx":381 + * lypx = px_dy * i + y_min + * rypx = px_dy * (i+1) + y_min + * for j in range(lc, rc): # <<<<<<<<<<<<<< + * lxpx = px_dx * j + x_min + * rxpx = px_dx * (j+1) + x_min + */ + __pyx_t_18 = __pyx_v_rc; + for (__pyx_t_19 = __pyx_v_lc; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "yt/utilities/lib/pixelization_routines.pyx":382 + * rypx = px_dy * (i+1) + y_min + * for j in range(lc, rc): + * lxpx = px_dx * j + x_min # <<<<<<<<<<<<<< + * rxpx = px_dx * (j+1) + x_min + * + */ + __pyx_v_lxpx = ((__pyx_v_px_dx * __pyx_v_j) + __pyx_v_x_min); + + /* "yt/utilities/lib/pixelization_routines.pyx":383 + * for j in range(lc, rc): + * lxpx = px_dx * j + x_min + * rxpx = px_dx * (j+1) + x_min # <<<<<<<<<<<<<< + * + * cx = (rxpx+lxpx)*0.5 + */ + __pyx_v_rxpx = ((__pyx_v_px_dx * (__pyx_v_j + 1)) + __pyx_v_x_min); + + /* "yt/utilities/lib/pixelization_routines.pyx":385 + * rxpx = px_dx * (j+1) + x_min + * + * cx = (rxpx+lxpx)*0.5 # <<<<<<<<<<<<<< + * cy = (rypx+lypx)*0.5 + * cz = coord + */ + __pyx_v_cx = ((__pyx_v_rxpx + __pyx_v_lxpx) * 0.5); + + /* "yt/utilities/lib/pixelization_routines.pyx":386 + * + * cx = (rxpx+lxpx)*0.5 + * cy = (rypx+lypx)*0.5 # <<<<<<<<<<<<<< + * cz = coord + * + */ + __pyx_v_cy = ((__pyx_v_rypx + __pyx_v_lypx) * 0.5); + + /* "yt/utilities/lib/pixelization_routines.pyx":387 + * cx = (rxpx+lxpx)*0.5 + * cy = (rypx+lypx)*0.5 + * cz = coord # <<<<<<<<<<<<<< + * + * ii = (cx - xsp + dxsp) + */ + __pyx_v_cz = __pyx_v_coord; + + /* "yt/utilities/lib/pixelization_routines.pyx":389 + * cz = coord + * + * ii = (cx - xsp + dxsp) # <<<<<<<<<<<<<< + * jj = (cy - ysp + dysp) + * kk = (cz - zsp + dzsp) + */ + __pyx_v_ii = ((int)((__pyx_v_cx - __pyx_v_xsp) + __pyx_v_dxsp)); + + /* "yt/utilities/lib/pixelization_routines.pyx":390 + * + * ii = (cx - xsp + dxsp) + * jj = (cy - ysp + dysp) # <<<<<<<<<<<<<< + * kk = (cz - zsp + dzsp) + * + */ + __pyx_v_jj = ((int)((__pyx_v_cy - __pyx_v_ysp) + __pyx_v_dysp)); + + /* "yt/utilities/lib/pixelization_routines.pyx":391 + * ii = (cx - xsp + dxsp) + * jj = (cy - ysp + dysp) + * kk = (cz - zsp + dzsp) # <<<<<<<<<<<<<< + * + * ind = 4*ii + 2*jj + kk + */ + __pyx_v_kk = ((int)((__pyx_v_cz - __pyx_v_zsp) + __pyx_v_dzsp)); + + /* "yt/utilities/lib/pixelization_routines.pyx":393 + * kk = (cz - zsp + dzsp) + * + * ind = 4*ii + 2*jj + kk # <<<<<<<<<<<<<< + * + * buff[i,j] = data[p, ind] + */ + __pyx_v_ind = (((4 * __pyx_v_ii) + (2 * __pyx_v_jj)) + __pyx_v_kk); + + /* "yt/utilities/lib/pixelization_routines.pyx":395 + * ind = 4*ii + 2*jj + kk + * + * buff[i,j] = data[p, ind] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_20 = __pyx_v_p; + __pyx_t_21 = __pyx_v_ind; + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_buff.data + __pyx_t_22 * __pyx_v_buff.strides[0]) ) + __pyx_t_23 * __pyx_v_buff.strides[1]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_20 * __pyx_v_data.strides[0]) ) + __pyx_t_21 * __pyx_v_data.strides[1]) ))); + } + } __pyx_L25_continue:; } + __pyx_L19_continue:; } - __pyx_L16_continue:; } } - /* "yt/utilities/lib/pixelization_routines.pyx":255 - * my_array = np.zeros((rows, cols), "float64") - * mask = np.zeros((rows, cols), "int64") + /* "yt/utilities/lib/pixelization_routines.pyx":331 + * # first axis : y_min .. y_max + * # second axis: x_min .. x_max * with nogil: # <<<<<<<<<<<<<< - * for ip in range(indices.shape[0]): - * p = indices[ip] + * for p in range(px.shape[0]): + * xiter[1] = yiter[1] = 999 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif - goto __pyx_L15; + goto __pyx_L13; } - __pyx_L15:; - } - } - - /* "yt/utilities/lib/pixelization_routines.pyx":291 - * mask[i, j] += 1 - * my_array[i, j] += dsp - * my_array /= mask # <<<<<<<<<<<<<< - * return my_array.T - * - */ - __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_my_array), ((PyObject *)__pyx_v_mask)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 291, __pyx_L1_error) - __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_my_array, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_L13:; } - } - __pyx_pybuffernd_my_array.diminfo[0].strides = __pyx_pybuffernd_my_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_my_array.diminfo[0].shape = __pyx_pybuffernd_my_array.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_my_array.diminfo[1].strides = __pyx_pybuffernd_my_array.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_my_array.diminfo[1].shape = __pyx_pybuffernd_my_array.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 291, __pyx_L1_error) } - __pyx_t_10 = 0; - __Pyx_DECREF_SET(__pyx_v_my_array, ((PyArrayObject *)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "yt/utilities/lib/pixelization_routines.pyx":292 - * my_array[i, j] += dsp - * my_array /= mask - * return my_array.T # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_my_array), __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - /* "yt/utilities/lib/pixelization_routines.pyx":210 + /* "yt/utilities/lib/pixelization_routines.pyx":236 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_off_axis_cartesian( # <<<<<<<<<<<<<< - * np.float64_t[:] x, - * np.float64_t[:] y, + * def pixelize_cartesian_nodal(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] px, + * np.float64_t[:] py, */ /* 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_3); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_off_axis_cartesian", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_cartesian_nodal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - goto __pyx_L2; __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_my_array.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_my_array); - __Pyx_XDECREF((PyObject *)__pyx_v_mask); - __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_z, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_buff, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_px, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_py, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_pz, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_pdx, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_pdy, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_pdz, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_center, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_inv_mat, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_indices, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/pixelization_routines.pyx":298 +/* "yt/utilities/lib/pixelization_routines.pyx":401 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_cylinder(np.ndarray[np.float64_t, ndim=1] radius, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] dradius, - * np.ndarray[np.float64_t, ndim=1] theta, + * def pixelize_off_axis_cartesian( # <<<<<<<<<<<<<< + * np.float64_t[:,:] buff, + * np.float64_t[:] x, */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_5pixelize_cylinder(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_5pixelize_cylinder = {"pixelize_cylinder", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_5pixelize_cylinder, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_5pixelize_cylinder(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_radius = 0; - PyArrayObject *__pyx_v_dradius = 0; - PyArrayObject *__pyx_v_theta = 0; - PyArrayObject *__pyx_v_dtheta = 0; - PyObject *__pyx_v_buff_size = 0; - PyArrayObject *__pyx_v_field = 0; - PyObject *__pyx_v_extents = 0; - PyObject *__pyx_v_input_img = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("pixelize_cylinder (wrapper)", 0); +static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_5pixelize_off_axis_cartesian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_5pixelize_off_axis_cartesian = {"pixelize_off_axis_cartesian", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_5pixelize_off_axis_cartesian, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_5pixelize_off_axis_cartesian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_buff = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_z = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_px = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_py = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_pdx = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_pdy = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_pdz = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_center = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_inv_mat = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_indices = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_bounds = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pixelize_off_axis_cartesian (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_radius,&__pyx_n_s_dradius,&__pyx_n_s_theta,&__pyx_n_s_dtheta,&__pyx_n_s_buff_size,&__pyx_n_s_field,&__pyx_n_s_extents,&__pyx_n_s_input_img,0}; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; - - /* "yt/utilities/lib/pixelization_routines.pyx":304 - * buff_size, - * np.ndarray[np.float64_t, ndim=1] field, - * extents, input_img = None): # <<<<<<<<<<<<<< - * - * cdef np.ndarray[np.float64_t, ndim=2] img - */ - values[7] = ((PyObject *)Py_None); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buff,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_z,&__pyx_n_s_px,&__pyx_n_s_py,&__pyx_n_s_pdx,&__pyx_n_s_pdy,&__pyx_n_s_pdz,&__pyx_n_s_center,&__pyx_n_s_inv_mat,&__pyx_n_s_indices,&__pyx_n_s_data,&__pyx_n_s_bounds,0}; + PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buff)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dradius)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 0, 7, 8, 1); __PYX_ERR(0, 298, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 1); __PYX_ERR(0, 401, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 0, 7, 8, 2); __PYX_ERR(0, 298, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 2); __PYX_ERR(0, 401, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtheta)) != 0)) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 0, 7, 8, 3); __PYX_ERR(0, 298, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 3); __PYX_ERR(0, 401, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buff_size)) != 0)) kw_args--; + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 0, 7, 8, 4); __PYX_ERR(0, 298, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 4); __PYX_ERR(0, 401, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 0, 7, 8, 5); __PYX_ERR(0, 298, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 5); __PYX_ERR(0, 401, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extents)) != 0)) kw_args--; + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdx)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 0, 7, 8, 6); __PYX_ERR(0, 298, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 6); __PYX_ERR(0, 401, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_img); - if (value) { values[7] = value; kw_args--; } + if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdy)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 7); __PYX_ERR(0, 401, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdz)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 8); __PYX_ERR(0, 401, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_center)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 9); __PYX_ERR(0, 401, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inv_mat)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 10); __PYX_ERR(0, 401, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 11); __PYX_ERR(0, 401, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 12); __PYX_ERR(0, 401, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, 13); __PYX_ERR(0, 401, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_cylinder") < 0)) __PYX_ERR(0, 298, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_off_axis_cartesian") < 0)) __PYX_ERR(0, 401, __pyx_L3_error) } + } else if (PyTuple_GET_SIZE(__pyx_args) != 14) { + goto __pyx_L5_argtuple_error; } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[4] = PyTuple_GET_ITEM(__pyx_args, 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; - } + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); } - __pyx_v_radius = ((PyArrayObject *)values[0]); - __pyx_v_dradius = ((PyArrayObject *)values[1]); - __pyx_v_theta = ((PyArrayObject *)values[2]); - __pyx_v_dtheta = ((PyArrayObject *)values[3]); - __pyx_v_buff_size = values[4]; - __pyx_v_field = ((PyArrayObject *)values[5]); - __pyx_v_extents = values[6]; - __pyx_v_input_img = values[7]; + __pyx_v_buff = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_buff.memview)) __PYX_ERR(0, 402, __pyx_L3_error) + __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 403, __pyx_L3_error) + __pyx_v_y = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_y.memview)) __PYX_ERR(0, 404, __pyx_L3_error) + __pyx_v_z = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_z.memview)) __PYX_ERR(0, 405, __pyx_L3_error) + __pyx_v_px = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[4]); if (unlikely(!__pyx_v_px.memview)) __PYX_ERR(0, 406, __pyx_L3_error) + __pyx_v_py = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[5]); if (unlikely(!__pyx_v_py.memview)) __PYX_ERR(0, 407, __pyx_L3_error) + __pyx_v_pdx = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[6]); if (unlikely(!__pyx_v_pdx.memview)) __PYX_ERR(0, 408, __pyx_L3_error) + __pyx_v_pdy = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[7]); if (unlikely(!__pyx_v_pdy.memview)) __PYX_ERR(0, 409, __pyx_L3_error) + __pyx_v_pdz = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[8]); if (unlikely(!__pyx_v_pdz.memview)) __PYX_ERR(0, 410, __pyx_L3_error) + __pyx_v_center = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[9]); if (unlikely(!__pyx_v_center.memview)) __PYX_ERR(0, 411, __pyx_L3_error) + __pyx_v_inv_mat = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[10]); if (unlikely(!__pyx_v_inv_mat.memview)) __PYX_ERR(0, 412, __pyx_L3_error) + __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(values[11]); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 413, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[12]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 414, __pyx_L3_error) + __pyx_v_bounds = values[13]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 0, 7, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 298, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_off_axis_cartesian", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 401, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_cylinder", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_off_axis_cartesian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_radius), __pyx_ptype_5numpy_ndarray, 1, "radius", 0))) __PYX_ERR(0, 298, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dradius), __pyx_ptype_5numpy_ndarray, 1, "dradius", 0))) __PYX_ERR(0, 299, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_theta), __pyx_ptype_5numpy_ndarray, 1, "theta", 0))) __PYX_ERR(0, 300, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtheta), __pyx_ptype_5numpy_ndarray, 1, "dtheta", 0))) __PYX_ERR(0, 301, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_5numpy_ndarray, 1, "field", 0))) __PYX_ERR(0, 303, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_21pixelization_routines_4pixelize_cylinder(__pyx_self, __pyx_v_radius, __pyx_v_dradius, __pyx_v_theta, __pyx_v_dtheta, __pyx_v_buff_size, __pyx_v_field, __pyx_v_extents, __pyx_v_input_img); - - /* "yt/utilities/lib/pixelization_routines.pyx":298 - * @cython.boundscheck(False) - * @cython.wraparound(False) - * def pixelize_cylinder(np.ndarray[np.float64_t, ndim=1] radius, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] dradius, - * np.ndarray[np.float64_t, ndim=1] theta, - */ + __pyx_r = __pyx_pf_2yt_9utilities_3lib_21pixelization_routines_4pixelize_off_axis_cartesian(__pyx_self, __pyx_v_buff, __pyx_v_x, __pyx_v_y, __pyx_v_z, __pyx_v_px, __pyx_v_py, __pyx_v_pdx, __pyx_v_pdy, __pyx_v_pdz, __pyx_v_center, __pyx_v_inv_mat, __pyx_v_indices, __pyx_v_data, __pyx_v_bounds); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_4pixelize_cylinder(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_radius, PyArrayObject *__pyx_v_dradius, PyArrayObject *__pyx_v_theta, PyArrayObject *__pyx_v_dtheta, PyObject *__pyx_v_buff_size, PyArrayObject *__pyx_v_field, PyObject *__pyx_v_extents, PyObject *__pyx_v_input_img) { - PyArrayObject *__pyx_v_img = 0; - __pyx_t_5numpy_float64_t __pyx_v_x; - __pyx_t_5numpy_float64_t __pyx_v_y; - __pyx_t_5numpy_float64_t __pyx_v_dx; - __pyx_t_5numpy_float64_t __pyx_v_dy; - __pyx_t_5numpy_float64_t __pyx_v_r0; - __pyx_t_5numpy_float64_t __pyx_v_theta0; - __pyx_t_5numpy_float64_t __pyx_v_rmax; - __pyx_t_5numpy_float64_t __pyx_v_x0; - __pyx_t_5numpy_float64_t __pyx_v_y0; - __pyx_t_5numpy_float64_t __pyx_v_x1; - __pyx_t_5numpy_float64_t __pyx_v_y1; - __pyx_t_5numpy_float64_t __pyx_v_r_i; - __pyx_t_5numpy_float64_t __pyx_v_theta_i; - __pyx_t_5numpy_float64_t __pyx_v_dr_i; - __pyx_t_5numpy_float64_t __pyx_v_dtheta_i; - __pyx_t_5numpy_float64_t __pyx_v_dthetamin; - __pyx_t_5numpy_float64_t __pyx_v_costheta; - __pyx_t_5numpy_float64_t __pyx_v_sintheta; +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_4pixelize_off_axis_cartesian(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_buff, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_y, __Pyx_memviewslice __pyx_v_z, __Pyx_memviewslice __pyx_v_px, __Pyx_memviewslice __pyx_v_py, __Pyx_memviewslice __pyx_v_pdx, __Pyx_memviewslice __pyx_v_pdy, __Pyx_memviewslice __pyx_v_pdz, __Pyx_memviewslice __pyx_v_center, __Pyx_memviewslice __pyx_v_inv_mat, __Pyx_memviewslice __pyx_v_indices, __Pyx_memviewslice __pyx_v_data, PyObject *__pyx_v_bounds) { + __pyx_t_5numpy_float64_t __pyx_v_x_min; + __pyx_t_5numpy_float64_t __pyx_v_x_max; + __pyx_t_5numpy_float64_t __pyx_v_y_min; + __pyx_t_5numpy_float64_t __pyx_v_y_max; + __pyx_t_5numpy_float64_t __pyx_v_width; + __pyx_t_5numpy_float64_t __pyx_v_height; + __pyx_t_5numpy_float64_t __pyx_v_px_dx; + __pyx_t_5numpy_float64_t __pyx_v_px_dy; + __pyx_t_5numpy_float64_t __pyx_v_ipx_dx; + __pyx_t_5numpy_float64_t __pyx_v_ipx_dy; + __pyx_t_5numpy_float64_t __pyx_v_md; int __pyx_v_i; - int __pyx_v_pi; - int __pyx_v_pj; - PyObject *__pyx_v_imax = NULL; - __pyx_t_5numpy_float64_t __pyx_v_rbounds[2]; - __pyx_t_5numpy_float64_t __pyx_v_corners[8]; - __Pyx_LocalBuf_ND __pyx_pybuffernd_dradius; - __Pyx_Buffer __pyx_pybuffer_dradius; - __Pyx_LocalBuf_ND __pyx_pybuffernd_dtheta; - __Pyx_Buffer __pyx_pybuffer_dtheta; - __Pyx_LocalBuf_ND __pyx_pybuffernd_field; - __Pyx_Buffer __pyx_pybuffer_field; - __Pyx_LocalBuf_ND __pyx_pybuffernd_img; - __Pyx_Buffer __pyx_pybuffer_img; - __Pyx_LocalBuf_ND __pyx_pybuffernd_radius; - __Pyx_Buffer __pyx_pybuffer_radius; - __Pyx_LocalBuf_ND __pyx_pybuffernd_theta; - __Pyx_Buffer __pyx_pybuffer_theta; + int __pyx_v_j; + int __pyx_v_p; + int __pyx_v_ip; + int __pyx_v_lc; + int __pyx_v_lr; + int __pyx_v_rc; + int __pyx_v_rr; + __pyx_t_5numpy_float64_t __pyx_v_xsp; + __pyx_t_5numpy_float64_t __pyx_v_ysp; + __pyx_t_5numpy_float64_t __pyx_v_zsp; + __pyx_t_5numpy_float64_t __pyx_v_dxsp; + __pyx_t_5numpy_float64_t __pyx_v_dysp; + __pyx_t_5numpy_float64_t __pyx_v_dzsp; + __pyx_t_5numpy_float64_t __pyx_v_dsp; + __pyx_t_5numpy_float64_t __pyx_v_pxsp; + __pyx_t_5numpy_float64_t __pyx_v_pysp; + __pyx_t_5numpy_float64_t __pyx_v_cxpx; + __pyx_t_5numpy_float64_t __pyx_v_cypx; + __pyx_t_5numpy_float64_t __pyx_v_cx; + __pyx_t_5numpy_float64_t __pyx_v_cy; + __pyx_t_5numpy_float64_t __pyx_v_cz; + PyArrayObject *__pyx_v_mask = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; + __pyx_t_5numpy_float64_t __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; - PyArrayObject *__pyx_t_9 = NULL; - int __pyx_t_10; + int __pyx_t_9; + PyArrayObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; - PyObject *(*__pyx_t_14)(PyObject *); - __pyx_t_5numpy_float64_t __pyx_t_15; - __pyx_t_5numpy_float64_t __pyx_t_16; - __pyx_t_5numpy_float64_t __pyx_t_17; - npy_intp __pyx_t_18; + 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; - Py_ssize_t __pyx_t_26; - Py_ssize_t __pyx_t_27; - Py_ssize_t __pyx_t_28; + int __pyx_t_25; + int __pyx_t_26; + int __pyx_t_27; + int __pyx_t_28; Py_ssize_t __pyx_t_29; Py_ssize_t __pyx_t_30; Py_ssize_t __pyx_t_31; - __Pyx_RefNannySetupContext("pixelize_cylinder", 0); - __pyx_pybuffer_img.pybuffer.buf = NULL; - __pyx_pybuffer_img.refcount = 0; - __pyx_pybuffernd_img.data = NULL; - __pyx_pybuffernd_img.rcbuffer = &__pyx_pybuffer_img; - __pyx_pybuffer_radius.pybuffer.buf = NULL; - __pyx_pybuffer_radius.refcount = 0; - __pyx_pybuffernd_radius.data = NULL; - __pyx_pybuffernd_radius.rcbuffer = &__pyx_pybuffer_radius; - __pyx_pybuffer_dradius.pybuffer.buf = NULL; - __pyx_pybuffer_dradius.refcount = 0; - __pyx_pybuffernd_dradius.data = NULL; - __pyx_pybuffernd_dradius.rcbuffer = &__pyx_pybuffer_dradius; - __pyx_pybuffer_theta.pybuffer.buf = NULL; - __pyx_pybuffer_theta.refcount = 0; - __pyx_pybuffernd_theta.data = NULL; - __pyx_pybuffernd_theta.rcbuffer = &__pyx_pybuffer_theta; - __pyx_pybuffer_dtheta.pybuffer.buf = NULL; - __pyx_pybuffer_dtheta.refcount = 0; - __pyx_pybuffernd_dtheta.data = NULL; - __pyx_pybuffernd_dtheta.rcbuffer = &__pyx_pybuffer_dtheta; - __pyx_pybuffer_field.pybuffer.buf = NULL; - __pyx_pybuffer_field.refcount = 0; - __pyx_pybuffernd_field.data = NULL; - __pyx_pybuffernd_field.rcbuffer = &__pyx_pybuffer_field; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_radius.rcbuffer->pybuffer, (PyObject*)__pyx_v_radius, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 298, __pyx_L1_error) - } - __pyx_pybuffernd_radius.diminfo[0].strides = __pyx_pybuffernd_radius.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_radius.diminfo[0].shape = __pyx_pybuffernd_radius.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dradius.rcbuffer->pybuffer, (PyObject*)__pyx_v_dradius, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 298, __pyx_L1_error) - } - __pyx_pybuffernd_dradius.diminfo[0].strides = __pyx_pybuffernd_dradius.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dradius.diminfo[0].shape = __pyx_pybuffernd_dradius.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_theta.rcbuffer->pybuffer, (PyObject*)__pyx_v_theta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 298, __pyx_L1_error) - } - __pyx_pybuffernd_theta.diminfo[0].strides = __pyx_pybuffernd_theta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_theta.diminfo[0].shape = __pyx_pybuffernd_theta.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dtheta.rcbuffer->pybuffer, (PyObject*)__pyx_v_dtheta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 298, __pyx_L1_error) - } - __pyx_pybuffernd_dtheta.diminfo[0].strides = __pyx_pybuffernd_dtheta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtheta.diminfo[0].shape = __pyx_pybuffernd_dtheta.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 298, __pyx_L1_error) - } - __pyx_pybuffernd_field.diminfo[0].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field.diminfo[0].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[0]; - - /* "yt/utilities/lib/pixelization_routines.pyx":313 - * cdef int i, pi, pj - * - * imax = radius.argmax() # <<<<<<<<<<<<<< - * rmax = radius[imax] + dradius[imax] - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_radius), __pyx_n_s_argmax); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - 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); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_imax = __pyx_t_1; - __pyx_t_1 = 0; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __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; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + Py_ssize_t __pyx_t_52; + Py_ssize_t __pyx_t_53; + Py_ssize_t __pyx_t_54; + __Pyx_RefNannySetupContext("pixelize_off_axis_cartesian", 0); + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; - /* "yt/utilities/lib/pixelization_routines.pyx":314 - * - * imax = radius.argmax() - * rmax = radius[imax] + dradius[imax] # <<<<<<<<<<<<<< - * - * if input_img is None: + /* "yt/utilities/lib/pixelization_routines.pyx":425 + * # Some periodicity helpers + * cdef np.ndarray[np.int64_t, ndim=2] mask + * x_min = bounds[0] # <<<<<<<<<<<<<< + * x_max = bounds[1] + * y_min = bounds[2] */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_radius), __pyx_v_imax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_dradius), __pyx_v_imax); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_rmax = __pyx_t_4; + __pyx_v_x_min = __pyx_t_2; - /* "yt/utilities/lib/pixelization_routines.pyx":316 - * rmax = radius[imax] + dradius[imax] - * - * if input_img is None: # <<<<<<<<<<<<<< - * img = np.zeros((buff_size[0], buff_size[1])) - * img[:] = np.nan + /* "yt/utilities/lib/pixelization_routines.pyx":426 + * cdef np.ndarray[np.int64_t, ndim=2] mask + * x_min = bounds[0] + * x_max = bounds[1] # <<<<<<<<<<<<<< + * y_min = bounds[2] + * y_max = bounds[3] */ - __pyx_t_5 = (__pyx_v_input_img == Py_None); - __pyx_t_6 = (__pyx_t_5 != 0); - if (__pyx_t_6) { + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_x_max = __pyx_t_2; - /* "yt/utilities/lib/pixelization_routines.pyx":317 - * - * if input_img is None: - * img = np.zeros((buff_size[0], buff_size[1])) # <<<<<<<<<<<<<< - * img[:] = np.nan - * else: + /* "yt/utilities/lib/pixelization_routines.pyx":427 + * x_min = bounds[0] + * x_max = bounds[1] + * y_min = bounds[2] # <<<<<<<<<<<<<< + * y_max = bounds[3] + * width = x_max - x_min */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_buff_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_buff_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); - __pyx_t_2 = 0; - __pyx_t_7 = 0; - __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_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GOTREF(__pyx_t_3); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - #endif - { - __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __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_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 317, __pyx_L1_error) - __pyx_t_9 = ((PyArrayObject *)__pyx_t_3); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); - __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_10 < 0)) { - PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_v_img, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); - } - } - __pyx_pybuffernd_img.diminfo[0].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_img.diminfo[0].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_img.diminfo[1].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_img.diminfo[1].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 317, __pyx_L1_error) - } - __pyx_t_9 = 0; - __pyx_v_img = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bounds, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_y_min = __pyx_t_2; - /* "yt/utilities/lib/pixelization_routines.pyx":318 - * if input_img is None: - * img = np.zeros((buff_size[0], buff_size[1])) - * img[:] = np.nan # <<<<<<<<<<<<<< - * else: - * img = input_img + /* "yt/utilities/lib/pixelization_routines.pyx":428 + * x_max = bounds[1] + * y_min = bounds[2] + * y_max = bounds[3] # <<<<<<<<<<<<<< + * width = x_max - x_min + * height = y_max - y_min */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_img), __pyx_t_1, 0, 0, NULL, NULL, &__pyx_slice__5, 0, 0, 0) < 0) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bounds, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_y_max = __pyx_t_2; - /* "yt/utilities/lib/pixelization_routines.pyx":316 - * rmax = radius[imax] + dradius[imax] - * - * if input_img is None: # <<<<<<<<<<<<<< - * img = np.zeros((buff_size[0], buff_size[1])) - * img[:] = np.nan + /* "yt/utilities/lib/pixelization_routines.pyx":429 + * y_min = bounds[2] + * y_max = bounds[3] + * width = x_max - x_min # <<<<<<<<<<<<<< + * height = y_max - y_min + * px_dx = width / ( buff.shape[1]) */ - goto __pyx_L3; - } + __pyx_v_width = (__pyx_v_x_max - __pyx_v_x_min); - /* "yt/utilities/lib/pixelization_routines.pyx":320 - * img[:] = np.nan - * else: - * img = input_img # <<<<<<<<<<<<<< - * x0, x1, y0, y1 = extents - * dx = (x1 - x0) / img.shape[0] + /* "yt/utilities/lib/pixelization_routines.pyx":430 + * y_max = bounds[3] + * width = x_max - x_min + * height = y_max - y_min # <<<<<<<<<<<<<< + * px_dx = width / ( buff.shape[1]) + * px_dy = height / ( buff.shape[0]) */ - /*else*/ { - if (!(likely(((__pyx_v_input_img) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_input_img, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 320, __pyx_L1_error) - __pyx_t_1 = __pyx_v_input_img; - __Pyx_INCREF(__pyx_t_1); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); - __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_10 < 0)) { - PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_v_img, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); - } - } - __pyx_pybuffernd_img.diminfo[0].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_img.diminfo[0].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_img.diminfo[1].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_img.diminfo[1].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 320, __pyx_L1_error) - } - __pyx_v_img = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; - } - __pyx_L3:; + __pyx_v_height = (__pyx_v_y_max - __pyx_v_y_min); - /* "yt/utilities/lib/pixelization_routines.pyx":321 - * else: - * img = input_img - * x0, x1, y0, y1 = extents # <<<<<<<<<<<<<< - * dx = (x1 - x0) / img.shape[0] - * dy = (y1 - y0) / img.shape[1] + /* "yt/utilities/lib/pixelization_routines.pyx":431 + * width = x_max - x_min + * height = y_max - y_min + * px_dx = width / ( buff.shape[1]) # <<<<<<<<<<<<<< + * px_dy = height / ( buff.shape[0]) + * ipx_dx = 1.0 / px_dx */ - if ((likely(PyTuple_CheckExact(__pyx_v_extents))) || (PyList_CheckExact(__pyx_v_extents))) { - PyObject* sequence = __pyx_v_extents; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 4)) { - if (size > 4) __Pyx_RaiseTooManyValuesError(4); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 321, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); - } else { - __pyx_t_1 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_2 = PyList_GET_ITEM(sequence, 2); - __pyx_t_8 = PyList_GET_ITEM(sequence, 3); - } - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_8); - #else - { - Py_ssize_t i; - PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_2,&__pyx_t_8}; - for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_GOTREF(item); - *(temps[i]) = item; - } - } - #endif - } else { - Py_ssize_t index = -1; - PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_2,&__pyx_t_8}; - __pyx_t_7 = PyObject_GetIter(__pyx_v_extents); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = Py_TYPE(__pyx_t_7)->tp_iternext; - for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_14(__pyx_t_7); if (unlikely(!item)) goto __pyx_L4_unpacking_failed; - __Pyx_GOTREF(item); - *(temps[index]) = item; - } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_7), 4) < 0) __PYX_ERR(0, 321, __pyx_L1_error) - __pyx_t_14 = NULL; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L5_unpacking_done; - __pyx_L4_unpacking_failed:; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_14 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 321, __pyx_L1_error) - __pyx_L5_unpacking_done:; - } - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_16 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_17 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_x0 = __pyx_t_4; - __pyx_v_x1 = __pyx_t_15; - __pyx_v_y0 = __pyx_t_16; - __pyx_v_y1 = __pyx_t_17; + __pyx_v_px_dx = (__pyx_v_width / ((__pyx_t_5numpy_float64_t)(__pyx_v_buff.shape[1]))); - /* "yt/utilities/lib/pixelization_routines.pyx":322 - * img = input_img - * x0, x1, y0, y1 = extents - * dx = (x1 - x0) / img.shape[0] # <<<<<<<<<<<<<< - * dy = (y1 - y0) / img.shape[1] - * cdef np.float64_t rbounds[2] + /* "yt/utilities/lib/pixelization_routines.pyx":432 + * height = y_max - y_min + * px_dx = width / ( buff.shape[1]) + * px_dy = height / ( buff.shape[0]) # <<<<<<<<<<<<<< + * ipx_dx = 1.0 / px_dx + * ipx_dy = 1.0 / px_dy */ - __pyx_v_dx = ((__pyx_v_x1 - __pyx_v_x0) / (__pyx_v_img->dimensions[0])); + __pyx_v_px_dy = (__pyx_v_height / ((__pyx_t_5numpy_float64_t)(__pyx_v_buff.shape[0]))); - /* "yt/utilities/lib/pixelization_routines.pyx":323 - * x0, x1, y0, y1 = extents - * dx = (x1 - x0) / img.shape[0] - * dy = (y1 - y0) / img.shape[1] # <<<<<<<<<<<<<< - * cdef np.float64_t rbounds[2] - * cdef np.float64_t corners[8] + /* "yt/utilities/lib/pixelization_routines.pyx":433 + * px_dx = width / ( buff.shape[1]) + * px_dy = height / ( buff.shape[0]) + * ipx_dx = 1.0 / px_dx # <<<<<<<<<<<<<< + * ipx_dy = 1.0 / px_dy + * if px.shape[0] != py.shape[0] or \ */ - __pyx_v_dy = ((__pyx_v_y1 - __pyx_v_y0) / (__pyx_v_img->dimensions[1])); + __pyx_v_ipx_dx = (1.0 / __pyx_v_px_dx); - /* "yt/utilities/lib/pixelization_routines.pyx":327 - * cdef np.float64_t corners[8] - * # Find our min and max r - * corners[0] = x0*x0+y0*y0 # <<<<<<<<<<<<<< - * corners[1] = x1*x1+y0*y0 - * corners[2] = x0*x0+y1*y1 + /* "yt/utilities/lib/pixelization_routines.pyx":434 + * px_dy = height / ( buff.shape[0]) + * ipx_dx = 1.0 / px_dx + * ipx_dy = 1.0 / px_dy # <<<<<<<<<<<<<< + * if px.shape[0] != py.shape[0] or \ + * px.shape[0] != pdx.shape[0] or \ */ - (__pyx_v_corners[0]) = ((__pyx_v_x0 * __pyx_v_x0) + (__pyx_v_y0 * __pyx_v_y0)); + __pyx_v_ipx_dy = (1.0 / __pyx_v_px_dy); - /* "yt/utilities/lib/pixelization_routines.pyx":328 - * # Find our min and max r - * corners[0] = x0*x0+y0*y0 - * corners[1] = x1*x1+y0*y0 # <<<<<<<<<<<<<< - * corners[2] = x0*x0+y1*y1 - * corners[3] = x1*x1+y1*y1 + /* "yt/utilities/lib/pixelization_routines.pyx":435 + * ipx_dx = 1.0 / px_dx + * ipx_dy = 1.0 / px_dy + * if px.shape[0] != py.shape[0] or \ # <<<<<<<<<<<<<< + * px.shape[0] != pdx.shape[0] or \ + * px.shape[0] != pdy.shape[0] or \ */ - (__pyx_v_corners[1]) = ((__pyx_v_x1 * __pyx_v_x1) + (__pyx_v_y0 * __pyx_v_y0)); + __pyx_t_4 = (((__pyx_v_px.shape[0]) != (__pyx_v_py.shape[0])) != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } - /* "yt/utilities/lib/pixelization_routines.pyx":329 - * corners[0] = x0*x0+y0*y0 - * corners[1] = x1*x1+y0*y0 - * corners[2] = x0*x0+y1*y1 # <<<<<<<<<<<<<< - * corners[3] = x1*x1+y1*y1 - * corners[4] = x0*x0 + /* "yt/utilities/lib/pixelization_routines.pyx":436 + * ipx_dy = 1.0 / px_dy + * if px.shape[0] != py.shape[0] or \ + * px.shape[0] != pdx.shape[0] or \ # <<<<<<<<<<<<<< + * px.shape[0] != pdy.shape[0] or \ + * px.shape[0] != pdz.shape[0] or \ */ - (__pyx_v_corners[2]) = ((__pyx_v_x0 * __pyx_v_x0) + (__pyx_v_y1 * __pyx_v_y1)); + __pyx_t_4 = (((__pyx_v_px.shape[0]) != (__pyx_v_pdx.shape[0])) != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } - /* "yt/utilities/lib/pixelization_routines.pyx":330 - * corners[1] = x1*x1+y0*y0 - * corners[2] = x0*x0+y1*y1 - * corners[3] = x1*x1+y1*y1 # <<<<<<<<<<<<<< - * corners[4] = x0*x0 - * corners[5] = x1*x1 - */ - (__pyx_v_corners[3]) = ((__pyx_v_x1 * __pyx_v_x1) + (__pyx_v_y1 * __pyx_v_y1)); - - /* "yt/utilities/lib/pixelization_routines.pyx":331 - * corners[2] = x0*x0+y1*y1 - * corners[3] = x1*x1+y1*y1 - * corners[4] = x0*x0 # <<<<<<<<<<<<<< - * corners[5] = x1*x1 - * corners[6] = y0*y0 + /* "yt/utilities/lib/pixelization_routines.pyx":437 + * if px.shape[0] != py.shape[0] or \ + * px.shape[0] != pdx.shape[0] or \ + * px.shape[0] != pdy.shape[0] or \ # <<<<<<<<<<<<<< + * px.shape[0] != pdz.shape[0] or \ + * px.shape[0] != indices.shape[0] or \ */ - (__pyx_v_corners[4]) = (__pyx_v_x0 * __pyx_v_x0); + __pyx_t_4 = (((__pyx_v_px.shape[0]) != (__pyx_v_pdy.shape[0])) != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } - /* "yt/utilities/lib/pixelization_routines.pyx":332 - * corners[3] = x1*x1+y1*y1 - * corners[4] = x0*x0 - * corners[5] = x1*x1 # <<<<<<<<<<<<<< - * corners[6] = y0*y0 - * corners[7] = y1*y1 + /* "yt/utilities/lib/pixelization_routines.pyx":438 + * px.shape[0] != pdx.shape[0] or \ + * px.shape[0] != pdy.shape[0] or \ + * px.shape[0] != pdz.shape[0] or \ # <<<<<<<<<<<<<< + * px.shape[0] != indices.shape[0] or \ + * px.shape[0] != data.shape[0]: */ - (__pyx_v_corners[5]) = (__pyx_v_x1 * __pyx_v_x1); + __pyx_t_4 = (((__pyx_v_px.shape[0]) != (__pyx_v_pdz.shape[0])) != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } - /* "yt/utilities/lib/pixelization_routines.pyx":333 - * corners[4] = x0*x0 - * corners[5] = x1*x1 - * corners[6] = y0*y0 # <<<<<<<<<<<<<< - * corners[7] = y1*y1 - * rbounds[0] = rbounds[1] = corners[0] + /* "yt/utilities/lib/pixelization_routines.pyx":439 + * px.shape[0] != pdy.shape[0] or \ + * px.shape[0] != pdz.shape[0] or \ + * px.shape[0] != indices.shape[0] or \ # <<<<<<<<<<<<<< + * px.shape[0] != data.shape[0]: + * raise YTPixelizeError("Arrays are not of correct shape.") */ - (__pyx_v_corners[6]) = (__pyx_v_y0 * __pyx_v_y0); + __pyx_t_4 = (((__pyx_v_px.shape[0]) != (__pyx_v_indices.shape[0])) != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } - /* "yt/utilities/lib/pixelization_routines.pyx":334 - * corners[5] = x1*x1 - * corners[6] = y0*y0 - * corners[7] = y1*y1 # <<<<<<<<<<<<<< - * rbounds[0] = rbounds[1] = corners[0] - * for i in range(8): + /* "yt/utilities/lib/pixelization_routines.pyx":440 + * px.shape[0] != pdz.shape[0] or \ + * px.shape[0] != indices.shape[0] or \ + * px.shape[0] != data.shape[0]: # <<<<<<<<<<<<<< + * raise YTPixelizeError("Arrays are not of correct shape.") + * mask = np.zeros((buff.shape[0], buff.shape[1]), "int64") */ - (__pyx_v_corners[7]) = (__pyx_v_y1 * __pyx_v_y1); + __pyx_t_4 = (((__pyx_v_px.shape[0]) != (__pyx_v_data.shape[0])) != 0); + __pyx_t_3 = __pyx_t_4; + __pyx_L4_bool_binop_done:; - /* "yt/utilities/lib/pixelization_routines.pyx":335 - * corners[6] = y0*y0 - * corners[7] = y1*y1 - * rbounds[0] = rbounds[1] = corners[0] # <<<<<<<<<<<<<< - * for i in range(8): - * rbounds[0] = fmin(rbounds[0], corners[i]) + /* "yt/utilities/lib/pixelization_routines.pyx":435 + * ipx_dx = 1.0 / px_dx + * ipx_dy = 1.0 / px_dy + * if px.shape[0] != py.shape[0] or \ # <<<<<<<<<<<<<< + * px.shape[0] != pdx.shape[0] or \ + * px.shape[0] != pdy.shape[0] or \ */ - (__pyx_v_rbounds[0]) = (__pyx_v_corners[0]); - (__pyx_v_rbounds[1]) = (__pyx_v_corners[0]); + if (__pyx_t_3) { - /* "yt/utilities/lib/pixelization_routines.pyx":336 - * corners[7] = y1*y1 - * rbounds[0] = rbounds[1] = corners[0] - * for i in range(8): # <<<<<<<<<<<<<< - * rbounds[0] = fmin(rbounds[0], corners[i]) - * rbounds[1] = fmax(rbounds[1], corners[i]) + /* "yt/utilities/lib/pixelization_routines.pyx":441 + * px.shape[0] != indices.shape[0] or \ + * px.shape[0] != data.shape[0]: + * raise YTPixelizeError("Arrays are not of correct shape.") # <<<<<<<<<<<<<< + * mask = np.zeros((buff.shape[0], buff.shape[1]), "int64") + * with nogil: */ - for (__pyx_t_10 = 0; __pyx_t_10 < 8; __pyx_t_10+=1) { - __pyx_v_i = __pyx_t_10; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTPixelizeError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 441, __pyx_L1_error) - /* "yt/utilities/lib/pixelization_routines.pyx":337 - * rbounds[0] = rbounds[1] = corners[0] - * for i in range(8): - * rbounds[0] = fmin(rbounds[0], corners[i]) # <<<<<<<<<<<<<< - * rbounds[1] = fmax(rbounds[1], corners[i]) - * rbounds[0] = rbounds[0]**0.5 + /* "yt/utilities/lib/pixelization_routines.pyx":435 + * ipx_dx = 1.0 / px_dx + * ipx_dy = 1.0 / px_dy + * if px.shape[0] != py.shape[0] or \ # <<<<<<<<<<<<<< + * px.shape[0] != pdx.shape[0] or \ + * px.shape[0] != pdy.shape[0] or \ */ - (__pyx_v_rbounds[0]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin((__pyx_v_rbounds[0]), (__pyx_v_corners[__pyx_v_i])); + } - /* "yt/utilities/lib/pixelization_routines.pyx":338 - * for i in range(8): - * rbounds[0] = fmin(rbounds[0], corners[i]) - * rbounds[1] = fmax(rbounds[1], corners[i]) # <<<<<<<<<<<<<< - * rbounds[0] = rbounds[0]**0.5 - * rbounds[1] = rbounds[1]**0.5 + /* "yt/utilities/lib/pixelization_routines.pyx":442 + * px.shape[0] != data.shape[0]: + * raise YTPixelizeError("Arrays are not of correct shape.") + * mask = np.zeros((buff.shape[0], buff.shape[1]), "int64") # <<<<<<<<<<<<<< + * with nogil: + * for ip in range(indices.shape[0]): */ - (__pyx_v_rbounds[1]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((__pyx_v_rbounds[1]), (__pyx_v_corners[__pyx_v_i])); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_buff.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyInt_FromSsize_t((__pyx_v_buff.shape[1])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); + __pyx_t_1 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_9 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_n_s_int64}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_n_s_int64}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + { + __pyx_t_1 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_9, __pyx_t_8); + __Pyx_INCREF(__pyx_n_s_int64); + __Pyx_GIVEREF(__pyx_n_s_int64); + PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_9, __pyx_n_s_int64); + __pyx_t_8 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_10 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 442, __pyx_L1_error) } + __pyx_t_10 = 0; + __pyx_v_mask = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "yt/utilities/lib/pixelization_routines.pyx":339 - * rbounds[0] = fmin(rbounds[0], corners[i]) - * rbounds[1] = fmax(rbounds[1], corners[i]) - * rbounds[0] = rbounds[0]**0.5 # <<<<<<<<<<<<<< - * rbounds[1] = rbounds[1]**0.5 - * # If we include the origin in either direction, we need to have radius of + /* "yt/utilities/lib/pixelization_routines.pyx":443 + * raise YTPixelizeError("Arrays are not of correct shape.") + * mask = np.zeros((buff.shape[0], buff.shape[1]), "int64") + * with nogil: # <<<<<<<<<<<<<< + * for ip in range(indices.shape[0]): + * p = indices[ip] */ - (__pyx_v_rbounds[0]) = pow((__pyx_v_rbounds[0]), ((__pyx_t_5numpy_float64_t)0.5)); + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { - /* "yt/utilities/lib/pixelization_routines.pyx":340 - * rbounds[1] = fmax(rbounds[1], corners[i]) - * rbounds[0] = rbounds[0]**0.5 - * rbounds[1] = rbounds[1]**0.5 # <<<<<<<<<<<<<< - * # If we include the origin in either direction, we need to have radius of - * # zero as our lower bound. + /* "yt/utilities/lib/pixelization_routines.pyx":444 + * mask = np.zeros((buff.shape[0], buff.shape[1]), "int64") + * with nogil: + * for ip in range(indices.shape[0]): # <<<<<<<<<<<<<< + * p = indices[ip] + * xsp = x[p] */ - (__pyx_v_rbounds[1]) = pow((__pyx_v_rbounds[1]), ((__pyx_t_5numpy_float64_t)0.5)); + __pyx_t_14 = (__pyx_v_indices.shape[0]); + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_14; __pyx_t_9+=1) { + __pyx_v_ip = __pyx_t_9; - /* "yt/utilities/lib/pixelization_routines.pyx":343 - * # If we include the origin in either direction, we need to have radius of - * # zero as our lower bound. - * if x0 < 0 and x1 > 0: # <<<<<<<<<<<<<< - * rbounds[0] = 0.0 - * if y0 < 0 and y1 > 0: + /* "yt/utilities/lib/pixelization_routines.pyx":445 + * with nogil: + * for ip in range(indices.shape[0]): + * p = indices[ip] # <<<<<<<<<<<<<< + * xsp = x[p] + * ysp = y[p] */ - __pyx_t_5 = ((__pyx_v_x0 < 0.0) != 0); - if (__pyx_t_5) { - } else { - __pyx_t_6 = __pyx_t_5; - goto __pyx_L9_bool_binop_done; - } - __pyx_t_5 = ((__pyx_v_x1 > 0.0) != 0); - __pyx_t_6 = __pyx_t_5; - __pyx_L9_bool_binop_done:; - if (__pyx_t_6) { + __pyx_t_15 = __pyx_v_ip; + __pyx_v_p = (*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_15 * __pyx_v_indices.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":344 - * # zero as our lower bound. - * if x0 < 0 and x1 > 0: - * rbounds[0] = 0.0 # <<<<<<<<<<<<<< - * if y0 < 0 and y1 > 0: - * rbounds[0] = 0.0 + /* "yt/utilities/lib/pixelization_routines.pyx":446 + * for ip in range(indices.shape[0]): + * p = indices[ip] + * xsp = x[p] # <<<<<<<<<<<<<< + * ysp = y[p] + * zsp = z[p] */ - (__pyx_v_rbounds[0]) = 0.0; + __pyx_t_16 = __pyx_v_p; + __pyx_v_xsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_16 * __pyx_v_x.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":343 - * # If we include the origin in either direction, we need to have radius of - * # zero as our lower bound. - * if x0 < 0 and x1 > 0: # <<<<<<<<<<<<<< - * rbounds[0] = 0.0 - * if y0 < 0 and y1 > 0: + /* "yt/utilities/lib/pixelization_routines.pyx":447 + * p = indices[ip] + * xsp = x[p] + * ysp = y[p] # <<<<<<<<<<<<<< + * zsp = z[p] + * pxsp = px[p] */ - } + __pyx_t_17 = __pyx_v_p; + __pyx_v_ysp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_17 * __pyx_v_y.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":345 - * if x0 < 0 and x1 > 0: - * rbounds[0] = 0.0 - * if y0 < 0 and y1 > 0: # <<<<<<<<<<<<<< - * rbounds[0] = 0.0 - * dthetamin = dx / rmax + /* "yt/utilities/lib/pixelization_routines.pyx":448 + * xsp = x[p] + * ysp = y[p] + * zsp = z[p] # <<<<<<<<<<<<<< + * pxsp = px[p] + * pysp = py[p] */ - __pyx_t_5 = ((__pyx_v_y0 < 0.0) != 0); - if (__pyx_t_5) { - } else { - __pyx_t_6 = __pyx_t_5; - goto __pyx_L12_bool_binop_done; - } - __pyx_t_5 = ((__pyx_v_y1 > 0.0) != 0); - __pyx_t_6 = __pyx_t_5; - __pyx_L12_bool_binop_done:; - if (__pyx_t_6) { + __pyx_t_18 = __pyx_v_p; + __pyx_v_zsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_z.data + __pyx_t_18 * __pyx_v_z.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":346 - * rbounds[0] = 0.0 - * if y0 < 0 and y1 > 0: - * rbounds[0] = 0.0 # <<<<<<<<<<<<<< - * dthetamin = dx / rmax - * for i in range(radius.shape[0]): + /* "yt/utilities/lib/pixelization_routines.pyx":449 + * ysp = y[p] + * zsp = z[p] + * pxsp = px[p] # <<<<<<<<<<<<<< + * pysp = py[p] + * dxsp = pdx[p] */ - (__pyx_v_rbounds[0]) = 0.0; + __pyx_t_19 = __pyx_v_p; + __pyx_v_pxsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_px.data + __pyx_t_19 * __pyx_v_px.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":345 - * if x0 < 0 and x1 > 0: - * rbounds[0] = 0.0 - * if y0 < 0 and y1 > 0: # <<<<<<<<<<<<<< - * rbounds[0] = 0.0 - * dthetamin = dx / rmax + /* "yt/utilities/lib/pixelization_routines.pyx":450 + * zsp = z[p] + * pxsp = px[p] + * pysp = py[p] # <<<<<<<<<<<<<< + * dxsp = pdx[p] + * dysp = pdy[p] */ - } + __pyx_t_20 = __pyx_v_p; + __pyx_v_pysp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_py.data + __pyx_t_20 * __pyx_v_py.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":347 - * if y0 < 0 and y1 > 0: - * rbounds[0] = 0.0 - * dthetamin = dx / rmax # <<<<<<<<<<<<<< - * for i in range(radius.shape[0]): - * + /* "yt/utilities/lib/pixelization_routines.pyx":451 + * pxsp = px[p] + * pysp = py[p] + * dxsp = pdx[p] # <<<<<<<<<<<<<< + * dysp = pdy[p] + * dzsp = pdz[p] */ - __pyx_v_dthetamin = (__pyx_v_dx / __pyx_v_rmax); + __pyx_t_21 = __pyx_v_p; + __pyx_v_dxsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdx.data + __pyx_t_21 * __pyx_v_pdx.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":348 - * rbounds[0] = 0.0 - * dthetamin = dx / rmax - * for i in range(radius.shape[0]): # <<<<<<<<<<<<<< - * - * r0 = radius[i] + /* "yt/utilities/lib/pixelization_routines.pyx":452 + * pysp = py[p] + * dxsp = pdx[p] + * dysp = pdy[p] # <<<<<<<<<<<<<< + * dzsp = pdz[p] + * dsp = data[p] */ - __pyx_t_18 = (__pyx_v_radius->dimensions[0]); - for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_18; __pyx_t_10+=1) { - __pyx_v_i = __pyx_t_10; + __pyx_t_22 = __pyx_v_p; + __pyx_v_dysp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdy.data + __pyx_t_22 * __pyx_v_pdy.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":350 - * for i in range(radius.shape[0]): - * - * r0 = radius[i] # <<<<<<<<<<<<<< - * theta0 = theta[i] - * dr_i = dradius[i] + /* "yt/utilities/lib/pixelization_routines.pyx":453 + * dxsp = pdx[p] + * dysp = pdy[p] + * dzsp = pdz[p] # <<<<<<<<<<<<<< + * dsp = data[p] + * # Any point we want to plot is at most this far from the center */ - __pyx_t_19 = __pyx_v_i; - __pyx_v_r0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_radius.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_radius.diminfo[0].strides)); + __pyx_t_23 = __pyx_v_p; + __pyx_v_dzsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_pdz.data + __pyx_t_23 * __pyx_v_pdz.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":351 - * - * r0 = radius[i] - * theta0 = theta[i] # <<<<<<<<<<<<<< - * dr_i = dradius[i] - * dtheta_i = dtheta[i] + /* "yt/utilities/lib/pixelization_routines.pyx":454 + * dysp = pdy[p] + * dzsp = pdz[p] + * dsp = data[p] # <<<<<<<<<<<<<< + * # Any point we want to plot is at most this far from the center + * md = 2.0 * math.sqrt(dxsp*dxsp + dysp*dysp + dzsp*dzsp) */ - __pyx_t_20 = __pyx_v_i; - __pyx_v_theta0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_theta.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_theta.diminfo[0].strides)); + __pyx_t_24 = __pyx_v_p; + __pyx_v_dsp = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_data.data + __pyx_t_24 * __pyx_v_data.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":352 - * r0 = radius[i] - * theta0 = theta[i] - * dr_i = dradius[i] # <<<<<<<<<<<<<< - * dtheta_i = dtheta[i] - * # Skip out early if we're offsides, for zoomed in plots + /* "yt/utilities/lib/pixelization_routines.pyx":456 + * dsp = data[p] + * # Any point we want to plot is at most this far from the center + * md = 2.0 * math.sqrt(dxsp*dxsp + dysp*dysp + dzsp*dzsp) # <<<<<<<<<<<<<< + * if pxsp + md < x_min or \ + * pxsp - md > x_max or \ */ - __pyx_t_21 = __pyx_v_i; - __pyx_v_dr_i = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dradius.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_dradius.diminfo[0].strides)); + __pyx_v_md = (2.0 * sqrt((((__pyx_v_dxsp * __pyx_v_dxsp) + (__pyx_v_dysp * __pyx_v_dysp)) + (__pyx_v_dzsp * __pyx_v_dzsp)))); - /* "yt/utilities/lib/pixelization_routines.pyx":353 - * theta0 = theta[i] - * dr_i = dradius[i] - * dtheta_i = dtheta[i] # <<<<<<<<<<<<<< - * # Skip out early if we're offsides, for zoomed in plots - * if r0 + dr_i < rbounds[0] or r0 - dr_i > rbounds[1]: + /* "yt/utilities/lib/pixelization_routines.pyx":457 + * # Any point we want to plot is at most this far from the center + * md = 2.0 * math.sqrt(dxsp*dxsp + dysp*dysp + dzsp*dzsp) + * if pxsp + md < x_min or \ # <<<<<<<<<<<<<< + * pxsp - md > x_max or \ + * pysp + md < y_min or \ */ - __pyx_t_22 = __pyx_v_i; - __pyx_v_dtheta_i = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dtheta.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dtheta.diminfo[0].strides)); + __pyx_t_4 = (((__pyx_v_pxsp + __pyx_v_md) < __pyx_v_x_min) != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L16_bool_binop_done; + } - /* "yt/utilities/lib/pixelization_routines.pyx":355 - * dtheta_i = dtheta[i] - * # Skip out early if we're offsides, for zoomed in plots - * if r0 + dr_i < rbounds[0] or r0 - dr_i > rbounds[1]: # <<<<<<<<<<<<<< - * continue - * theta_i = theta0 - dtheta_i + /* "yt/utilities/lib/pixelization_routines.pyx":458 + * md = 2.0 * math.sqrt(dxsp*dxsp + dysp*dysp + dzsp*dzsp) + * if pxsp + md < x_min or \ + * pxsp - md > x_max or \ # <<<<<<<<<<<<<< + * pysp + md < y_min or \ + * pysp - md > y_max: */ - __pyx_t_5 = (((__pyx_v_r0 + __pyx_v_dr_i) < (__pyx_v_rbounds[0])) != 0); - if (!__pyx_t_5) { - } else { - __pyx_t_6 = __pyx_t_5; - goto __pyx_L17_bool_binop_done; - } - __pyx_t_5 = (((__pyx_v_r0 - __pyx_v_dr_i) > (__pyx_v_rbounds[1])) != 0); - __pyx_t_6 = __pyx_t_5; - __pyx_L17_bool_binop_done:; - if (__pyx_t_6) { + __pyx_t_4 = (((__pyx_v_pxsp - __pyx_v_md) > __pyx_v_x_max) != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L16_bool_binop_done; + } - /* "yt/utilities/lib/pixelization_routines.pyx":356 - * # Skip out early if we're offsides, for zoomed in plots - * if r0 + dr_i < rbounds[0] or r0 - dr_i > rbounds[1]: - * continue # <<<<<<<<<<<<<< - * theta_i = theta0 - dtheta_i - * # Buffer of 0.5 here + /* "yt/utilities/lib/pixelization_routines.pyx":459 + * if pxsp + md < x_min or \ + * pxsp - md > x_max or \ + * pysp + md < y_min or \ # <<<<<<<<<<<<<< + * pysp - md > y_max: + * continue */ - goto __pyx_L14_continue; + __pyx_t_4 = (((__pyx_v_pysp + __pyx_v_md) < __pyx_v_y_min) != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L16_bool_binop_done; + } - /* "yt/utilities/lib/pixelization_routines.pyx":355 - * dtheta_i = dtheta[i] - * # Skip out early if we're offsides, for zoomed in plots - * if r0 + dr_i < rbounds[0] or r0 - dr_i > rbounds[1]: # <<<<<<<<<<<<<< - * continue - * theta_i = theta0 - dtheta_i + /* "yt/utilities/lib/pixelization_routines.pyx":460 + * pxsp - md > x_max or \ + * pysp + md < y_min or \ + * pysp - md > y_max: # <<<<<<<<<<<<<< + * continue + * lc = fmax(((pxsp - md - x_min)*ipx_dx),0) */ - } + __pyx_t_4 = (((__pyx_v_pysp - __pyx_v_md) > __pyx_v_y_max) != 0); + __pyx_t_3 = __pyx_t_4; + __pyx_L16_bool_binop_done:; - /* "yt/utilities/lib/pixelization_routines.pyx":357 - * if r0 + dr_i < rbounds[0] or r0 - dr_i > rbounds[1]: - * continue - * theta_i = theta0 - dtheta_i # <<<<<<<<<<<<<< - * # Buffer of 0.5 here - * dthetamin = 0.5*dx/(r0 + dr_i) + /* "yt/utilities/lib/pixelization_routines.pyx":457 + * # Any point we want to plot is at most this far from the center + * md = 2.0 * math.sqrt(dxsp*dxsp + dysp*dysp + dzsp*dzsp) + * if pxsp + md < x_min or \ # <<<<<<<<<<<<<< + * pxsp - md > x_max or \ + * pysp + md < y_min or \ */ - __pyx_v_theta_i = (__pyx_v_theta0 - __pyx_v_dtheta_i); + if (__pyx_t_3) { - /* "yt/utilities/lib/pixelization_routines.pyx":359 - * theta_i = theta0 - dtheta_i - * # Buffer of 0.5 here - * dthetamin = 0.5*dx/(r0 + dr_i) # <<<<<<<<<<<<<< - * while theta_i < theta0 + dtheta_i: - * r_i = r0 - dr_i + /* "yt/utilities/lib/pixelization_routines.pyx":461 + * pysp + md < y_min or \ + * pysp - md > y_max: + * continue # <<<<<<<<<<<<<< + * lc = fmax(((pxsp - md - x_min)*ipx_dx),0) + * lr = fmax(((pysp - md - y_min)*ipx_dy),0) */ - __pyx_v_dthetamin = ((0.5 * __pyx_v_dx) / (__pyx_v_r0 + __pyx_v_dr_i)); + goto __pyx_L13_continue; - /* "yt/utilities/lib/pixelization_routines.pyx":360 - * # Buffer of 0.5 here - * dthetamin = 0.5*dx/(r0 + dr_i) - * while theta_i < theta0 + dtheta_i: # <<<<<<<<<<<<<< - * r_i = r0 - dr_i - * costheta = math.cos(theta_i) + /* "yt/utilities/lib/pixelization_routines.pyx":457 + * # Any point we want to plot is at most this far from the center + * md = 2.0 * math.sqrt(dxsp*dxsp + dysp*dysp + dzsp*dzsp) + * if pxsp + md < x_min or \ # <<<<<<<<<<<<<< + * pxsp - md > x_max or \ + * pysp + md < y_min or \ */ - while (1) { - __pyx_t_6 = ((__pyx_v_theta_i < (__pyx_v_theta0 + __pyx_v_dtheta_i)) != 0); - if (!__pyx_t_6) break; + } - /* "yt/utilities/lib/pixelization_routines.pyx":361 - * dthetamin = 0.5*dx/(r0 + dr_i) - * while theta_i < theta0 + dtheta_i: - * r_i = r0 - dr_i # <<<<<<<<<<<<<< - * costheta = math.cos(theta_i) - * sintheta = math.sin(theta_i) + /* "yt/utilities/lib/pixelization_routines.pyx":462 + * pysp - md > y_max: + * continue + * lc = fmax(((pxsp - md - x_min)*ipx_dx),0) # <<<<<<<<<<<<<< + * lr = fmax(((pysp - md - y_min)*ipx_dy),0) + * rc = fmin(((pxsp + md - x_min)*ipx_dx + 1), buff.shape[1]) */ - __pyx_v_r_i = (__pyx_v_r0 - __pyx_v_dr_i); + __pyx_v_lc = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((((__pyx_v_pxsp - __pyx_v_md) - __pyx_v_x_min) * __pyx_v_ipx_dx), 0.0)); - /* "yt/utilities/lib/pixelization_routines.pyx":362 - * while theta_i < theta0 + dtheta_i: - * r_i = r0 - dr_i - * costheta = math.cos(theta_i) # <<<<<<<<<<<<<< - * sintheta = math.sin(theta_i) - * while r_i < r0 + dr_i: + /* "yt/utilities/lib/pixelization_routines.pyx":463 + * continue + * lc = fmax(((pxsp - md - x_min)*ipx_dx),0) + * lr = fmax(((pysp - md - y_min)*ipx_dy),0) # <<<<<<<<<<<<<< + * rc = fmin(((pxsp + md - x_min)*ipx_dx + 1), buff.shape[1]) + * rr = fmin(((pysp + md - y_min)*ipx_dy + 1), buff.shape[0]) */ - __pyx_v_costheta = cos(__pyx_v_theta_i); + __pyx_v_lr = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((((__pyx_v_pysp - __pyx_v_md) - __pyx_v_y_min) * __pyx_v_ipx_dy), 0.0)); - /* "yt/utilities/lib/pixelization_routines.pyx":363 - * r_i = r0 - dr_i - * costheta = math.cos(theta_i) - * sintheta = math.sin(theta_i) # <<<<<<<<<<<<<< - * while r_i < r0 + dr_i: - * if rmax <= r_i: + /* "yt/utilities/lib/pixelization_routines.pyx":464 + * lc = fmax(((pxsp - md - x_min)*ipx_dx),0) + * lr = fmax(((pysp - md - y_min)*ipx_dy),0) + * rc = fmin(((pxsp + md - x_min)*ipx_dx + 1), buff.shape[1]) # <<<<<<<<<<<<<< + * rr = fmin(((pysp + md - y_min)*ipx_dy + 1), buff.shape[0]) + * for i in range(lr, rr): */ - __pyx_v_sintheta = sin(__pyx_v_theta_i); + __pyx_v_rc = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(((((__pyx_v_pxsp + __pyx_v_md) - __pyx_v_x_min) * __pyx_v_ipx_dx) + 1.0), (__pyx_v_buff.shape[1]))); - /* "yt/utilities/lib/pixelization_routines.pyx":364 - * costheta = math.cos(theta_i) - * sintheta = math.sin(theta_i) - * while r_i < r0 + dr_i: # <<<<<<<<<<<<<< - * if rmax <= r_i: - * r_i += 0.5*dx + /* "yt/utilities/lib/pixelization_routines.pyx":465 + * lr = fmax(((pysp - md - y_min)*ipx_dy),0) + * rc = fmin(((pxsp + md - x_min)*ipx_dx + 1), buff.shape[1]) + * rr = fmin(((pysp + md - y_min)*ipx_dy + 1), buff.shape[0]) # <<<<<<<<<<<<<< + * for i in range(lr, rr): + * cypx = px_dy * (i + 0.5) + y_min */ - while (1) { - __pyx_t_6 = ((__pyx_v_r_i < (__pyx_v_r0 + __pyx_v_dr_i)) != 0); - if (!__pyx_t_6) break; + __pyx_v_rr = ((int)__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(((((__pyx_v_pysp + __pyx_v_md) - __pyx_v_y_min) * __pyx_v_ipx_dy) + 1.0), (__pyx_v_buff.shape[0]))); - /* "yt/utilities/lib/pixelization_routines.pyx":365 - * sintheta = math.sin(theta_i) - * while r_i < r0 + dr_i: - * if rmax <= r_i: # <<<<<<<<<<<<<< - * r_i += 0.5*dx - * continue + /* "yt/utilities/lib/pixelization_routines.pyx":466 + * rc = fmin(((pxsp + md - x_min)*ipx_dx + 1), buff.shape[1]) + * rr = fmin(((pysp + md - y_min)*ipx_dy + 1), buff.shape[0]) + * for i in range(lr, rr): # <<<<<<<<<<<<<< + * cypx = px_dy * (i + 0.5) + y_min + * for j in range(lc, rc): */ - __pyx_t_6 = ((__pyx_v_rmax <= __pyx_v_r_i) != 0); - if (__pyx_t_6) { + __pyx_t_25 = __pyx_v_rr; + for (__pyx_t_26 = __pyx_v_lr; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) { + __pyx_v_i = __pyx_t_26; - /* "yt/utilities/lib/pixelization_routines.pyx":366 - * while r_i < r0 + dr_i: - * if rmax <= r_i: - * r_i += 0.5*dx # <<<<<<<<<<<<<< - * continue - * y = r_i * costheta + /* "yt/utilities/lib/pixelization_routines.pyx":467 + * rr = fmin(((pysp + md - y_min)*ipx_dy + 1), buff.shape[0]) + * for i in range(lr, rr): + * cypx = px_dy * (i + 0.5) + y_min # <<<<<<<<<<<<<< + * for j in range(lc, rc): + * cxpx = px_dx * (j + 0.5) + x_min */ - __pyx_v_r_i = (__pyx_v_r_i + (0.5 * __pyx_v_dx)); + __pyx_v_cypx = ((__pyx_v_px_dy * (__pyx_v_i + 0.5)) + __pyx_v_y_min); - /* "yt/utilities/lib/pixelization_routines.pyx":367 - * if rmax <= r_i: - * r_i += 0.5*dx - * continue # <<<<<<<<<<<<<< - * y = r_i * costheta - * x = r_i * sintheta + /* "yt/utilities/lib/pixelization_routines.pyx":468 + * for i in range(lr, rr): + * cypx = px_dy * (i + 0.5) + y_min + * for j in range(lc, rc): # <<<<<<<<<<<<<< + * cxpx = px_dx * (j + 0.5) + x_min + * cx = inv_mat[0,0]*cxpx + inv_mat[0,1]*cypx + center[0] */ - goto __pyx_L21_continue; + __pyx_t_27 = __pyx_v_rc; + for (__pyx_t_28 = __pyx_v_lc; __pyx_t_28 < __pyx_t_27; __pyx_t_28+=1) { + __pyx_v_j = __pyx_t_28; - /* "yt/utilities/lib/pixelization_routines.pyx":365 - * sintheta = math.sin(theta_i) - * while r_i < r0 + dr_i: - * if rmax <= r_i: # <<<<<<<<<<<<<< - * r_i += 0.5*dx - * continue + /* "yt/utilities/lib/pixelization_routines.pyx":469 + * cypx = px_dy * (i + 0.5) + y_min + * for j in range(lc, rc): + * cxpx = px_dx * (j + 0.5) + x_min # <<<<<<<<<<<<<< + * cx = inv_mat[0,0]*cxpx + inv_mat[0,1]*cypx + center[0] + * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] */ - } + __pyx_v_cxpx = ((__pyx_v_px_dx * (__pyx_v_j + 0.5)) + __pyx_v_x_min); - /* "yt/utilities/lib/pixelization_routines.pyx":368 - * r_i += 0.5*dx - * continue - * y = r_i * costheta # <<<<<<<<<<<<<< - * x = r_i * sintheta - * pi = ((x - x0)/dx) + /* "yt/utilities/lib/pixelization_routines.pyx":470 + * for j in range(lc, rc): + * cxpx = px_dx * (j + 0.5) + x_min + * cx = inv_mat[0,0]*cxpx + inv_mat[0,1]*cypx + center[0] # <<<<<<<<<<<<<< + * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] + * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] */ - __pyx_v_y = (__pyx_v_r_i * __pyx_v_costheta); + __pyx_t_29 = 0; + __pyx_t_30 = 0; + __pyx_t_31 = 0; + __pyx_t_32 = 1; + __pyx_t_33 = 0; + __pyx_v_cx = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_inv_mat.data + __pyx_t_29 * __pyx_v_inv_mat.strides[0]) ) + __pyx_t_30 * __pyx_v_inv_mat.strides[1]) ))) * __pyx_v_cxpx) + ((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_inv_mat.data + __pyx_t_31 * __pyx_v_inv_mat.strides[0]) ) + __pyx_t_32 * __pyx_v_inv_mat.strides[1]) ))) * __pyx_v_cypx)) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_center.data + __pyx_t_33 * __pyx_v_center.strides[0]) )))); - /* "yt/utilities/lib/pixelization_routines.pyx":369 - * continue - * y = r_i * costheta - * x = r_i * sintheta # <<<<<<<<<<<<<< - * pi = ((x - x0)/dx) - * pj = ((y - y0)/dy) + /* "yt/utilities/lib/pixelization_routines.pyx":471 + * cxpx = px_dx * (j + 0.5) + x_min + * cx = inv_mat[0,0]*cxpx + inv_mat[0,1]*cypx + center[0] + * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] # <<<<<<<<<<<<<< + * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] + * if fabs(xsp - cx) * 0.99 > dxsp or \ */ - __pyx_v_x = (__pyx_v_r_i * __pyx_v_sintheta); + __pyx_t_34 = 1; + __pyx_t_35 = 0; + __pyx_t_36 = 1; + __pyx_t_37 = 1; + __pyx_t_38 = 1; + __pyx_v_cy = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_inv_mat.data + __pyx_t_34 * __pyx_v_inv_mat.strides[0]) ) + __pyx_t_35 * __pyx_v_inv_mat.strides[1]) ))) * __pyx_v_cxpx) + ((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_inv_mat.data + __pyx_t_36 * __pyx_v_inv_mat.strides[0]) ) + __pyx_t_37 * __pyx_v_inv_mat.strides[1]) ))) * __pyx_v_cypx)) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_center.data + __pyx_t_38 * __pyx_v_center.strides[0]) )))); - /* "yt/utilities/lib/pixelization_routines.pyx":370 - * y = r_i * costheta - * x = r_i * sintheta - * pi = ((x - x0)/dx) # <<<<<<<<<<<<<< - * pj = ((y - y0)/dy) - * if pi >= 0 and pi < img.shape[0] and \ + /* "yt/utilities/lib/pixelization_routines.pyx":472 + * cx = inv_mat[0,0]*cxpx + inv_mat[0,1]*cypx + center[0] + * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] + * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] # <<<<<<<<<<<<<< + * if fabs(xsp - cx) * 0.99 > dxsp or \ + * fabs(ysp - cy) * 0.99 > dysp or \ */ - __pyx_v_pi = ((int)((__pyx_v_x - __pyx_v_x0) / __pyx_v_dx)); + __pyx_t_39 = 2; + __pyx_t_40 = 0; + __pyx_t_41 = 2; + __pyx_t_42 = 1; + __pyx_t_43 = 2; + __pyx_v_cz = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_inv_mat.data + __pyx_t_39 * __pyx_v_inv_mat.strides[0]) ) + __pyx_t_40 * __pyx_v_inv_mat.strides[1]) ))) * __pyx_v_cxpx) + ((*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_inv_mat.data + __pyx_t_41 * __pyx_v_inv_mat.strides[0]) ) + __pyx_t_42 * __pyx_v_inv_mat.strides[1]) ))) * __pyx_v_cypx)) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_center.data + __pyx_t_43 * __pyx_v_center.strides[0]) )))); - /* "yt/utilities/lib/pixelization_routines.pyx":371 - * x = r_i * sintheta - * pi = ((x - x0)/dx) - * pj = ((y - y0)/dy) # <<<<<<<<<<<<<< - * if pi >= 0 and pi < img.shape[0] and \ - * pj >= 0 and pj < img.shape[1]: + /* "yt/utilities/lib/pixelization_routines.pyx":473 + * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] + * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] + * if fabs(xsp - cx) * 0.99 > dxsp or \ # <<<<<<<<<<<<<< + * fabs(ysp - cy) * 0.99 > dysp or \ + * fabs(zsp - cz) * 0.99 > dzsp: */ - __pyx_v_pj = ((int)((__pyx_v_y - __pyx_v_y0) / __pyx_v_dy)); + __pyx_t_4 = (((__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs((__pyx_v_xsp - __pyx_v_cx)) * 0.99) > __pyx_v_dxsp) != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L25_bool_binop_done; + } - /* "yt/utilities/lib/pixelization_routines.pyx":372 - * pi = ((x - x0)/dx) - * pj = ((y - y0)/dy) - * if pi >= 0 and pi < img.shape[0] and \ # <<<<<<<<<<<<<< - * pj >= 0 and pj < img.shape[1]: - * if img[pi, pj] != img[pi, pj]: + /* "yt/utilities/lib/pixelization_routines.pyx":474 + * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] + * if fabs(xsp - cx) * 0.99 > dxsp or \ + * fabs(ysp - cy) * 0.99 > dysp or \ # <<<<<<<<<<<<<< + * fabs(zsp - cz) * 0.99 > dzsp: + * continue */ - __pyx_t_5 = ((__pyx_v_pi >= 0) != 0); - if (__pyx_t_5) { - } else { - __pyx_t_6 = __pyx_t_5; - goto __pyx_L25_bool_binop_done; - } - __pyx_t_5 = ((__pyx_v_pi < (__pyx_v_img->dimensions[0])) != 0); - if (__pyx_t_5) { - } else { - __pyx_t_6 = __pyx_t_5; - goto __pyx_L25_bool_binop_done; - } + __pyx_t_4 = (((__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs((__pyx_v_ysp - __pyx_v_cy)) * 0.99) > __pyx_v_dysp) != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L25_bool_binop_done; + } - /* "yt/utilities/lib/pixelization_routines.pyx":373 - * pj = ((y - y0)/dy) - * if pi >= 0 and pi < img.shape[0] and \ - * pj >= 0 and pj < img.shape[1]: # <<<<<<<<<<<<<< - * if img[pi, pj] != img[pi, pj]: - * img[pi, pj] = 0.0 + /* "yt/utilities/lib/pixelization_routines.pyx":475 + * if fabs(xsp - cx) * 0.99 > dxsp or \ + * fabs(ysp - cy) * 0.99 > dysp or \ + * fabs(zsp - cz) * 0.99 > dzsp: # <<<<<<<<<<<<<< + * continue + * mask[i, j] += 1 */ - __pyx_t_5 = ((__pyx_v_pj >= 0) != 0); - if (__pyx_t_5) { - } else { - __pyx_t_6 = __pyx_t_5; - goto __pyx_L25_bool_binop_done; - } - __pyx_t_5 = ((__pyx_v_pj < (__pyx_v_img->dimensions[1])) != 0); - __pyx_t_6 = __pyx_t_5; - __pyx_L25_bool_binop_done:; + __pyx_t_4 = (((__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs((__pyx_v_zsp - __pyx_v_cz)) * 0.99) > __pyx_v_dzsp) != 0); + __pyx_t_3 = __pyx_t_4; + __pyx_L25_bool_binop_done:; - /* "yt/utilities/lib/pixelization_routines.pyx":372 - * pi = ((x - x0)/dx) - * pj = ((y - y0)/dy) - * if pi >= 0 and pi < img.shape[0] and \ # <<<<<<<<<<<<<< - * pj >= 0 and pj < img.shape[1]: - * if img[pi, pj] != img[pi, pj]: - */ - if (__pyx_t_6) { - - /* "yt/utilities/lib/pixelization_routines.pyx":374 - * if pi >= 0 and pi < img.shape[0] and \ - * pj >= 0 and pj < img.shape[1]: - * if img[pi, pj] != img[pi, pj]: # <<<<<<<<<<<<<< - * img[pi, pj] = 0.0 - * img[pi, pj] = field[i] + /* "yt/utilities/lib/pixelization_routines.pyx":473 + * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] + * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] + * if fabs(xsp - cx) * 0.99 > dxsp or \ # <<<<<<<<<<<<<< + * fabs(ysp - cy) * 0.99 > dysp or \ + * fabs(zsp - cz) * 0.99 > dzsp: */ - __pyx_t_23 = __pyx_v_pi; - __pyx_t_24 = __pyx_v_pj; - __pyx_t_25 = __pyx_v_pi; - __pyx_t_26 = __pyx_v_pj; - __pyx_t_6 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_img.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_img.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_img.diminfo[1].strides)) != (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_img.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_img.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_img.diminfo[1].strides))) != 0); - if (__pyx_t_6) { - - /* "yt/utilities/lib/pixelization_routines.pyx":375 - * pj >= 0 and pj < img.shape[1]: - * if img[pi, pj] != img[pi, pj]: - * img[pi, pj] = 0.0 # <<<<<<<<<<<<<< - * img[pi, pj] = field[i] - * r_i += 0.5*dx + if (__pyx_t_3) { + + /* "yt/utilities/lib/pixelization_routines.pyx":476 + * fabs(ysp - cy) * 0.99 > dysp or \ + * fabs(zsp - cz) * 0.99 > dzsp: + * continue # <<<<<<<<<<<<<< + * mask[i, j] += 1 + * buff[i, j] += dsp */ - __pyx_t_27 = __pyx_v_pi; - __pyx_t_28 = __pyx_v_pj; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_img.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_img.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_img.diminfo[1].strides) = 0.0; - - /* "yt/utilities/lib/pixelization_routines.pyx":374 - * if pi >= 0 and pi < img.shape[0] and \ - * pj >= 0 and pj < img.shape[1]: - * if img[pi, pj] != img[pi, pj]: # <<<<<<<<<<<<<< - * img[pi, pj] = 0.0 - * img[pi, pj] = field[i] + goto __pyx_L22_continue; + + /* "yt/utilities/lib/pixelization_routines.pyx":473 + * cy = inv_mat[1,0]*cxpx + inv_mat[1,1]*cypx + center[1] + * cz = inv_mat[2,0]*cxpx + inv_mat[2,1]*cypx + center[2] + * if fabs(xsp - cx) * 0.99 > dxsp or \ # <<<<<<<<<<<<<< + * fabs(ysp - cy) * 0.99 > dysp or \ + * fabs(zsp - cz) * 0.99 > dzsp: */ - } + } - /* "yt/utilities/lib/pixelization_routines.pyx":376 - * if img[pi, pj] != img[pi, pj]: - * img[pi, pj] = 0.0 - * img[pi, pj] = field[i] # <<<<<<<<<<<<<< - * r_i += 0.5*dx - * theta_i += dthetamin + /* "yt/utilities/lib/pixelization_routines.pyx":477 + * fabs(zsp - cz) * 0.99 > dzsp: + * continue + * mask[i, j] += 1 # <<<<<<<<<<<<<< + * buff[i, j] += dsp + * for i in range(buff.shape[0]): */ - __pyx_t_29 = __pyx_v_i; - __pyx_t_30 = __pyx_v_pi; - __pyx_t_31 = __pyx_v_pj; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_img.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_img.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_img.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_field.diminfo[0].strides)); + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_mask.diminfo[1].strides) += 1; - /* "yt/utilities/lib/pixelization_routines.pyx":372 - * pi = ((x - x0)/dx) - * pj = ((y - y0)/dy) - * if pi >= 0 and pi < img.shape[0] and \ # <<<<<<<<<<<<<< - * pj >= 0 and pj < img.shape[1]: - * if img[pi, pj] != img[pi, pj]: + /* "yt/utilities/lib/pixelization_routines.pyx":478 + * continue + * mask[i, j] += 1 + * buff[i, j] += dsp # <<<<<<<<<<<<<< + * for i in range(buff.shape[0]): + * for j in range(buff.shape[1]): + */ + __pyx_t_46 = __pyx_v_i; + __pyx_t_47 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_buff.data + __pyx_t_46 * __pyx_v_buff.strides[0]) ) + __pyx_t_47 * __pyx_v_buff.strides[1]) )) += __pyx_v_dsp; + __pyx_L22_continue:; + } + } + __pyx_L13_continue:; + } + } + + /* "yt/utilities/lib/pixelization_routines.pyx":443 + * raise YTPixelizeError("Arrays are not of correct shape.") + * mask = np.zeros((buff.shape[0], buff.shape[1]), "int64") + * with nogil: # <<<<<<<<<<<<<< + * for ip in range(indices.shape[0]): + * p = indices[ip] */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L12; } + __pyx_L12:; + } + } - /* "yt/utilities/lib/pixelization_routines.pyx":377 - * img[pi, pj] = 0.0 - * img[pi, pj] = field[i] - * r_i += 0.5*dx # <<<<<<<<<<<<<< - * theta_i += dthetamin - * + /* "yt/utilities/lib/pixelization_routines.pyx":479 + * mask[i, j] += 1 + * buff[i, j] += dsp + * for i in range(buff.shape[0]): # <<<<<<<<<<<<<< + * for j in range(buff.shape[1]): + * if mask[i,j] == 0: continue */ - __pyx_v_r_i = (__pyx_v_r_i + (0.5 * __pyx_v_dx)); - __pyx_L21_continue:; + __pyx_t_14 = (__pyx_v_buff.shape[0]); + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_14; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "yt/utilities/lib/pixelization_routines.pyx":480 + * buff[i, j] += dsp + * for i in range(buff.shape[0]): + * for j in range(buff.shape[1]): # <<<<<<<<<<<<<< + * if mask[i,j] == 0: continue + * buff[i,j] /= mask[i,j] + */ + __pyx_t_48 = (__pyx_v_buff.shape[1]); + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_48; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "yt/utilities/lib/pixelization_routines.pyx":481 + * for i in range(buff.shape[0]): + * for j in range(buff.shape[1]): + * if mask[i,j] == 0: continue # <<<<<<<<<<<<<< + * buff[i,j] /= mask[i,j] + * + */ + __pyx_t_49 = __pyx_v_i; + __pyx_t_50 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_mask.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_3) { + goto __pyx_L30_continue; } - /* "yt/utilities/lib/pixelization_routines.pyx":378 - * img[pi, pj] = field[i] - * r_i += 0.5*dx - * theta_i += dthetamin # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":482 + * for j in range(buff.shape[1]): + * if mask[i,j] == 0: continue + * buff[i,j] /= mask[i,j] # <<<<<<<<<<<<<< * - * return img + * @cython.cdivision(True) */ - __pyx_v_theta_i = (__pyx_v_theta_i + __pyx_v_dthetamin); + __pyx_t_51 = __pyx_v_i; + __pyx_t_52 = __pyx_v_j; + __pyx_t_53 = __pyx_v_i; + __pyx_t_54 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_buff.data + __pyx_t_53 * __pyx_v_buff.strides[0]) ) + __pyx_t_54 * __pyx_v_buff.strides[1]) )) /= (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_mask.diminfo[1].strides)); + __pyx_L30_continue:; } - __pyx_L14_continue:; } - /* "yt/utilities/lib/pixelization_routines.pyx":380 - * theta_i += dthetamin - * - * return img # <<<<<<<<<<<<<< - * - * cdef void aitoff_thetaphi_to_xy(np.float64_t theta, np.float64_t phi, - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_img)); - __pyx_r = ((PyObject *)__pyx_v_img); - goto __pyx_L0; - - /* "yt/utilities/lib/pixelization_routines.pyx":298 + /* "yt/utilities/lib/pixelization_routines.pyx":401 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_cylinder(np.ndarray[np.float64_t, ndim=1] radius, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] dradius, - * np.ndarray[np.float64_t, ndim=1] theta, + * def pixelize_off_axis_cartesian( # <<<<<<<<<<<<<< + * np.float64_t[:,:] buff, + * np.float64_t[:] x, */ /* 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_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dradius.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtheta.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_radius.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_theta.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_cylinder", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_off_axis_cartesian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dradius.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtheta.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_radius.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_theta.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_img); - __Pyx_XDECREF(__pyx_v_imax); + __Pyx_XDECREF((PyObject *)__pyx_v_mask); + __PYX_XDEC_MEMVIEW(&__pyx_v_buff, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_z, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_px, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_py, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_pdx, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_pdy, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_pdz, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_center, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_inv_mat, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_indices, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/pixelization_routines.pyx":382 - * return img - * - * cdef void aitoff_thetaphi_to_xy(np.float64_t theta, np.float64_t phi, # <<<<<<<<<<<<<< - * np.float64_t *x, np.float64_t *y): - * cdef np.float64_t z = math.sqrt(1 + math.cos(phi) * math.cos(theta / 2.0)) - */ - -static void __pyx_f_2yt_9utilities_3lib_21pixelization_routines_aitoff_thetaphi_to_xy(__pyx_t_5numpy_float64_t __pyx_v_theta, __pyx_t_5numpy_float64_t __pyx_v_phi, __pyx_t_5numpy_float64_t *__pyx_v_x, __pyx_t_5numpy_float64_t *__pyx_v_y) { - __pyx_t_5numpy_float64_t __pyx_v_z; - __Pyx_RefNannyDeclarations - double __pyx_t_1; - __Pyx_RefNannySetupContext("aitoff_thetaphi_to_xy", 0); - - /* "yt/utilities/lib/pixelization_routines.pyx":384 - * cdef void aitoff_thetaphi_to_xy(np.float64_t theta, np.float64_t phi, - * np.float64_t *x, np.float64_t *y): - * cdef np.float64_t z = math.sqrt(1 + math.cos(phi) * math.cos(theta / 2.0)) # <<<<<<<<<<<<<< - * x[0] = math.cos(phi) * math.sin(theta / 2.0) / z - * y[0] = math.sin(phi) / z - */ - __pyx_v_z = sqrt((1.0 + (cos(__pyx_v_phi) * cos((__pyx_v_theta / 2.0))))); - - /* "yt/utilities/lib/pixelization_routines.pyx":385 - * np.float64_t *x, np.float64_t *y): - * cdef np.float64_t z = math.sqrt(1 + math.cos(phi) * math.cos(theta / 2.0)) - * x[0] = math.cos(phi) * math.sin(theta / 2.0) / z # <<<<<<<<<<<<<< - * y[0] = math.sin(phi) / z - * - */ - __pyx_t_1 = (cos(__pyx_v_phi) * sin((__pyx_v_theta / 2.0))); - if (unlikely(__pyx_v_z == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 385, __pyx_L1_error) - } - (__pyx_v_x[0]) = (__pyx_t_1 / __pyx_v_z); - - /* "yt/utilities/lib/pixelization_routines.pyx":386 - * cdef np.float64_t z = math.sqrt(1 + math.cos(phi) * math.cos(theta / 2.0)) - * x[0] = math.cos(phi) * math.sin(theta / 2.0) / z - * y[0] = math.sin(phi) / z # <<<<<<<<<<<<<< - * - * @cython.cdivision(True) - */ - __pyx_t_1 = sin(__pyx_v_phi); - if (unlikely(__pyx_v_z == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 386, __pyx_L1_error) - } - (__pyx_v_y[0]) = (__pyx_t_1 / __pyx_v_z); - - /* "yt/utilities/lib/pixelization_routines.pyx":382 - * return img - * - * cdef void aitoff_thetaphi_to_xy(np.float64_t theta, np.float64_t phi, # <<<<<<<<<<<<<< - * np.float64_t *x, np.float64_t *y): - * cdef np.float64_t z = math.sqrt(1 + math.cos(phi) * math.cos(theta / 2.0)) - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.utilities.lib.pixelization_routines.aitoff_thetaphi_to_xy", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_L0:; - __Pyx_RefNannyFinishContext(); -} - -/* "yt/utilities/lib/pixelization_routines.pyx":391 +/* "yt/utilities/lib/pixelization_routines.pyx":487 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_aitoff(np.ndarray[np.float64_t, ndim=1] theta, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] dtheta, - * np.ndarray[np.float64_t, ndim=1] phi, + * def pixelize_cylinder(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] radius, + * np.float64_t[:] dradius, */ /* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_7pixelize_aitoff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_7pixelize_aitoff = {"pixelize_aitoff", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_7pixelize_aitoff, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_7pixelize_aitoff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_theta = 0; - PyArrayObject *__pyx_v_dtheta = 0; - PyArrayObject *__pyx_v_phi = 0; - PyArrayObject *__pyx_v_dphi = 0; - PyObject *__pyx_v_buff_size = 0; - PyArrayObject *__pyx_v_field = 0; - CYTHON_UNUSED PyObject *__pyx_v_extents = 0; - PyObject *__pyx_v_input_img = 0; - __pyx_t_5numpy_float64_t __pyx_v_theta_offset; - __pyx_t_5numpy_float64_t __pyx_v_phi_offset; +static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_7pixelize_cylinder(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_7pixelize_cylinder = {"pixelize_cylinder", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_7pixelize_cylinder, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_7pixelize_cylinder(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_buff = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_radius = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_dradius = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_theta = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_dtheta = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_field = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_extents = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("pixelize_aitoff (wrapper)", 0); + __Pyx_RefNannySetupContext("pixelize_cylinder (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_theta,&__pyx_n_s_dtheta,&__pyx_n_s_phi,&__pyx_n_s_dphi,&__pyx_n_s_buff_size,&__pyx_n_s_field,&__pyx_n_s_extents,&__pyx_n_s_input_img,&__pyx_n_s_theta_offset,&__pyx_n_s_phi_offset,0}; - PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; - - /* "yt/utilities/lib/pixelization_routines.pyx":397 - * buff_size, - * np.ndarray[np.float64_t, ndim=1] field, - * extents, input_img = None, # <<<<<<<<<<<<<< - * np.float64_t theta_offset = 0.0, - * np.float64_t phi_offset = 0.0): - */ - values[7] = ((PyObject *)Py_None); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buff,&__pyx_n_s_radius,&__pyx_n_s_dradius,&__pyx_n_s_theta,&__pyx_n_s_dtheta,&__pyx_n_s_field,&__pyx_n_s_extents,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { - case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buff)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtheta)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, 1); __PYX_ERR(0, 391, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 1, 7, 7, 1); __PYX_ERR(0, 487, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dradius)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, 2); __PYX_ERR(0, 391, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 1, 7, 7, 2); __PYX_ERR(0, 487, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dphi)) != 0)) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, 3); __PYX_ERR(0, 391, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 1, 7, 7, 3); __PYX_ERR(0, 487, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buff_size)) != 0)) kw_args--; + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtheta)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, 4); __PYX_ERR(0, 391, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 1, 7, 7, 4); __PYX_ERR(0, 487, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, 5); __PYX_ERR(0, 391, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 1, 7, 7, 5); __PYX_ERR(0, 487, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extents)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, 6); __PYX_ERR(0, 391, __pyx_L3_error) - } - case 7: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_img); - if (value) { values[7] = value; kw_args--; } - } - case 8: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta_offset); - if (value) { values[8] = value; kw_args--; } - } - case 9: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_phi_offset); - if (value) { values[9] = value; kw_args--; } + __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 1, 7, 7, 6); __PYX_ERR(0, 487, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_aitoff") < 0)) __PYX_ERR(0, 391, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_cylinder") < 0)) __PYX_ERR(0, 487, __pyx_L3_error) } + } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { + goto __pyx_L5_argtuple_error; } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[4] = PyTuple_GET_ITEM(__pyx_args, 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; - } + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } - __pyx_v_theta = ((PyArrayObject *)values[0]); - __pyx_v_dtheta = ((PyArrayObject *)values[1]); - __pyx_v_phi = ((PyArrayObject *)values[2]); - __pyx_v_dphi = ((PyArrayObject *)values[3]); - __pyx_v_buff_size = values[4]; - __pyx_v_field = ((PyArrayObject *)values[5]); + __pyx_v_buff = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_buff.memview)) __PYX_ERR(0, 487, __pyx_L3_error) + __pyx_v_radius = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_radius.memview)) __PYX_ERR(0, 488, __pyx_L3_error) + __pyx_v_dradius = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_dradius.memview)) __PYX_ERR(0, 489, __pyx_L3_error) + __pyx_v_theta = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_theta.memview)) __PYX_ERR(0, 490, __pyx_L3_error) + __pyx_v_dtheta = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[4]); if (unlikely(!__pyx_v_dtheta.memview)) __PYX_ERR(0, 491, __pyx_L3_error) + __pyx_v_field = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[5]); if (unlikely(!__pyx_v_field.memview)) __PYX_ERR(0, 492, __pyx_L3_error) __pyx_v_extents = values[6]; - __pyx_v_input_img = values[7]; - if (values[8]) { - __pyx_v_theta_offset = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_theta_offset == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L3_error) - } else { - __pyx_v_theta_offset = ((__pyx_t_5numpy_float64_t)0.0); - } - if (values[9]) { - __pyx_v_phi_offset = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_phi_offset == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error) - } else { - __pyx_v_phi_offset = ((__pyx_t_5numpy_float64_t)0.0); - } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 391, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pixelize_cylinder", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 487, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_aitoff", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_cylinder", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_theta), __pyx_ptype_5numpy_ndarray, 1, "theta", 0))) __PYX_ERR(0, 391, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtheta), __pyx_ptype_5numpy_ndarray, 1, "dtheta", 0))) __PYX_ERR(0, 392, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi), __pyx_ptype_5numpy_ndarray, 1, "phi", 0))) __PYX_ERR(0, 393, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi), __pyx_ptype_5numpy_ndarray, 1, "dphi", 0))) __PYX_ERR(0, 394, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_5numpy_ndarray, 1, "field", 0))) __PYX_ERR(0, 396, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_21pixelization_routines_6pixelize_aitoff(__pyx_self, __pyx_v_theta, __pyx_v_dtheta, __pyx_v_phi, __pyx_v_dphi, __pyx_v_buff_size, __pyx_v_field, __pyx_v_extents, __pyx_v_input_img, __pyx_v_theta_offset, __pyx_v_phi_offset); - - /* "yt/utilities/lib/pixelization_routines.pyx":391 - * @cython.boundscheck(False) - * @cython.wraparound(False) - * def pixelize_aitoff(np.ndarray[np.float64_t, ndim=1] theta, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] dtheta, - * np.ndarray[np.float64_t, ndim=1] phi, - */ + __pyx_r = __pyx_pf_2yt_9utilities_3lib_21pixelization_routines_6pixelize_cylinder(__pyx_self, __pyx_v_buff, __pyx_v_radius, __pyx_v_dradius, __pyx_v_theta, __pyx_v_dtheta, __pyx_v_field, __pyx_v_extents); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_6pixelize_aitoff(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_theta, PyArrayObject *__pyx_v_dtheta, PyArrayObject *__pyx_v_phi, PyArrayObject *__pyx_v_dphi, PyObject *__pyx_v_buff_size, PyArrayObject *__pyx_v_field, CYTHON_UNUSED PyObject *__pyx_v_extents, PyObject *__pyx_v_input_img, __pyx_t_5numpy_float64_t __pyx_v_theta_offset, __pyx_t_5numpy_float64_t __pyx_v_phi_offset) { - PyArrayObject *__pyx_v_img = 0; - int __pyx_v_i; - int __pyx_v_j; - int __pyx_v_nf; - int __pyx_v_fi; +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_6pixelize_cylinder(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_buff, __Pyx_memviewslice __pyx_v_radius, __Pyx_memviewslice __pyx_v_dradius, __Pyx_memviewslice __pyx_v_theta, __Pyx_memviewslice __pyx_v_dtheta, __Pyx_memviewslice __pyx_v_field, PyObject *__pyx_v_extents) { __pyx_t_5numpy_float64_t __pyx_v_x; __pyx_t_5numpy_float64_t __pyx_v_y; - __pyx_t_5numpy_float64_t __pyx_v_z; - __pyx_t_5numpy_float64_t __pyx_v_zb; __pyx_t_5numpy_float64_t __pyx_v_dx; __pyx_t_5numpy_float64_t __pyx_v_dy; + __pyx_t_5numpy_float64_t __pyx_v_r0; __pyx_t_5numpy_float64_t __pyx_v_theta0; - __pyx_t_5numpy_float64_t __pyx_v_phi0; - __pyx_t_5numpy_float64_t __pyx_v_theta_p; - __pyx_t_5numpy_float64_t __pyx_v_dtheta_p; - __pyx_t_5numpy_float64_t __pyx_v_phi_p; - __pyx_t_5numpy_float64_t __pyx_v_dphi_p; - __pyx_t_5numpy_float64_t __pyx_v_PI; - __pyx_t_5numpy_float64_t __pyx_v_s2; - __pyx_t_5numpy_float64_t __pyx_v_xmax; - __pyx_t_5numpy_float64_t __pyx_v_ymax; - __pyx_t_5numpy_float64_t __pyx_v_xmin; - __pyx_t_5numpy_float64_t __pyx_v_ymin; - int __pyx_v_x0; - long __pyx_v_x1; - int __pyx_v_y0; - long __pyx_v_y1; - __Pyx_LocalBuf_ND __pyx_pybuffernd_dphi; - __Pyx_Buffer __pyx_pybuffer_dphi; - __Pyx_LocalBuf_ND __pyx_pybuffernd_dtheta; - __Pyx_Buffer __pyx_pybuffer_dtheta; - __Pyx_LocalBuf_ND __pyx_pybuffernd_field; - __Pyx_Buffer __pyx_pybuffer_field; - __Pyx_LocalBuf_ND __pyx_pybuffernd_img; - __Pyx_Buffer __pyx_pybuffer_img; - __Pyx_LocalBuf_ND __pyx_pybuffernd_phi; - __Pyx_Buffer __pyx_pybuffer_phi; - __Pyx_LocalBuf_ND __pyx_pybuffernd_theta; - __Pyx_Buffer __pyx_pybuffer_theta; + __pyx_t_5numpy_float64_t __pyx_v_rmax; + __pyx_t_5numpy_float64_t __pyx_v_x0; + __pyx_t_5numpy_float64_t __pyx_v_y0; + __pyx_t_5numpy_float64_t __pyx_v_x1; + __pyx_t_5numpy_float64_t __pyx_v_y1; + __pyx_t_5numpy_float64_t __pyx_v_r_i; + __pyx_t_5numpy_float64_t __pyx_v_theta_i; + __pyx_t_5numpy_float64_t __pyx_v_dr_i; + __pyx_t_5numpy_float64_t __pyx_v_dtheta_i; + __pyx_t_5numpy_float64_t __pyx_v_dthetamin; + __pyx_t_5numpy_float64_t __pyx_v_costheta; + __pyx_t_5numpy_float64_t __pyx_v_sintheta; + int __pyx_v_i; + int __pyx_v_pi; + int __pyx_v_pj; + int __pyx_v_imax; + __pyx_t_5numpy_float64_t __pyx_v_rbounds[2]; + __pyx_t_5numpy_float64_t __pyx_v_corners[8]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyArrayObject *__pyx_t_9 = NULL; - int __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - int __pyx_t_14; - Py_ssize_t __pyx_t_15; - Py_ssize_t __pyx_t_16; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + __pyx_t_5numpy_float64_t __pyx_t_11; + __pyx_t_5numpy_float64_t __pyx_t_12; + __pyx_t_5numpy_float64_t __pyx_t_13; + __pyx_t_5numpy_float64_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; Py_ssize_t __pyx_t_17; Py_ssize_t __pyx_t_18; - long __pyx_t_19; - int __pyx_t_20; - long __pyx_t_21; - int __pyx_t_22; + 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; - __Pyx_RefNannySetupContext("pixelize_aitoff", 0); - __pyx_pybuffer_img.pybuffer.buf = NULL; - __pyx_pybuffer_img.refcount = 0; - __pyx_pybuffernd_img.data = NULL; - __pyx_pybuffernd_img.rcbuffer = &__pyx_pybuffer_img; - __pyx_pybuffer_theta.pybuffer.buf = NULL; - __pyx_pybuffer_theta.refcount = 0; - __pyx_pybuffernd_theta.data = NULL; - __pyx_pybuffernd_theta.rcbuffer = &__pyx_pybuffer_theta; - __pyx_pybuffer_dtheta.pybuffer.buf = NULL; - __pyx_pybuffer_dtheta.refcount = 0; - __pyx_pybuffernd_dtheta.data = NULL; - __pyx_pybuffernd_dtheta.rcbuffer = &__pyx_pybuffer_dtheta; - __pyx_pybuffer_phi.pybuffer.buf = NULL; - __pyx_pybuffer_phi.refcount = 0; - __pyx_pybuffernd_phi.data = NULL; - __pyx_pybuffernd_phi.rcbuffer = &__pyx_pybuffer_phi; - __pyx_pybuffer_dphi.pybuffer.buf = NULL; - __pyx_pybuffer_dphi.refcount = 0; - __pyx_pybuffernd_dphi.data = NULL; - __pyx_pybuffernd_dphi.rcbuffer = &__pyx_pybuffer_dphi; - __pyx_pybuffer_field.pybuffer.buf = NULL; - __pyx_pybuffer_field.refcount = 0; - __pyx_pybuffernd_field.data = NULL; - __pyx_pybuffernd_field.rcbuffer = &__pyx_pybuffer_field; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_theta.rcbuffer->pybuffer, (PyObject*)__pyx_v_theta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 391, __pyx_L1_error) - } - __pyx_pybuffernd_theta.diminfo[0].strides = __pyx_pybuffernd_theta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_theta.diminfo[0].shape = __pyx_pybuffernd_theta.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dtheta.rcbuffer->pybuffer, (PyObject*)__pyx_v_dtheta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_RefNannySetupContext("pixelize_cylinder", 0); + + /* "yt/utilities/lib/pixelization_routines.pyx":501 + * cdef int i, pi, pj + * + * cdef int imax = np.asarray(radius).argmax() # <<<<<<<<<<<<<< + * rmax = radius[imax] + dradius[imax] + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_radius, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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); + } } - __pyx_pybuffernd_dtheta.diminfo[0].strides = __pyx_pybuffernd_dtheta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtheta.diminfo[0].shape = __pyx_pybuffernd_dtheta.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_phi.rcbuffer->pybuffer, (PyObject*)__pyx_v_phi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 391, __pyx_L1_error) + if (!__pyx_t_5) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __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(0, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } } - __pyx_pybuffernd_phi.diminfo[0].strides = __pyx_pybuffernd_phi.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_phi.diminfo[0].shape = __pyx_pybuffernd_phi.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dphi.rcbuffer->pybuffer, (PyObject*)__pyx_v_dphi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_argmax); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + 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_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } } - __pyx_pybuffernd_dphi.diminfo[0].strides = __pyx_pybuffernd_dphi.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dphi.diminfo[0].shape = __pyx_pybuffernd_dphi.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 391, __pyx_L1_error) + if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) } - __pyx_pybuffernd_field.diminfo[0].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field.diminfo[0].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[0]; - - /* "yt/utilities/lib/pixelization_routines.pyx":411 - * cdef np.float64_t dx, dy - * cdef np.float64_t theta0, phi0, theta_p, dtheta_p, phi_p, dphi_p - * cdef np.float64_t PI = np.pi # <<<<<<<<<<<<<< - * cdef np.float64_t s2 = math.sqrt(2.0) - * cdef np.float64_t xmax, ymax, xmin, ymin - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_PI = __pyx_t_3; - - /* "yt/utilities/lib/pixelization_routines.pyx":412 - * cdef np.float64_t theta0, phi0, theta_p, dtheta_p, phi_p, dphi_p - * cdef np.float64_t PI = np.pi - * cdef np.float64_t s2 = math.sqrt(2.0) # <<<<<<<<<<<<<< - * cdef np.float64_t xmax, ymax, xmin, ymin - * nf = field.shape[0] - */ - __pyx_v_s2 = sqrt(2.0); + __pyx_v_imax = __pyx_t_7; - /* "yt/utilities/lib/pixelization_routines.pyx":414 - * cdef np.float64_t s2 = math.sqrt(2.0) - * cdef np.float64_t xmax, ymax, xmin, ymin - * nf = field.shape[0] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":502 * - * if input_img is None: - */ - __pyx_v_nf = (__pyx_v_field->dimensions[0]); - - /* "yt/utilities/lib/pixelization_routines.pyx":416 - * nf = field.shape[0] + * cdef int imax = np.asarray(radius).argmax() + * rmax = radius[imax] + dradius[imax] # <<<<<<<<<<<<<< * - * if input_img is None: # <<<<<<<<<<<<<< - * img = np.zeros((buff_size[0], buff_size[1])) - * img[:] = np.nan + * x0, x1, y0, y1 = extents */ - __pyx_t_4 = (__pyx_v_input_img == Py_None); - __pyx_t_5 = (__pyx_t_4 != 0); - if (__pyx_t_5) { + __pyx_t_8 = __pyx_v_imax; + __pyx_t_9 = __pyx_v_imax; + __pyx_v_rmax = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_radius.data + __pyx_t_8 * __pyx_v_radius.strides[0]) ))) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_dradius.data + __pyx_t_9 * __pyx_v_dradius.strides[0]) )))); - /* "yt/utilities/lib/pixelization_routines.pyx":417 + /* "yt/utilities/lib/pixelization_routines.pyx":504 + * rmax = radius[imax] + dradius[imax] * - * if input_img is None: - * img = np.zeros((buff_size[0], buff_size[1])) # <<<<<<<<<<<<<< - * img[:] = np.nan - * else: + * x0, x1, y0, y1 = extents # <<<<<<<<<<<<<< + * dx = (x1 - x0) / buff.shape[1] + * dy = (y1 - y0) / buff.shape[0] */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_buff_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_buff_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); - __pyx_t_1 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } + if ((likely(PyTuple_CheckExact(__pyx_v_extents))) || (PyList_CheckExact(__pyx_v_extents))) { + PyObject* sequence = __pyx_v_extents; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 504, __pyx_L1_error) } - if (!__pyx_t_7) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GOTREF(__pyx_t_2); + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_6)) { - PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { - PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - #endif - { - __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL; - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = PyList_GET_ITEM(sequence, 2); + __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } - __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, 417, __pyx_L1_error) - __pyx_t_9 = ((PyArrayObject *)__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + #else { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); - __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_10 < 0)) { - PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_v_img, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); - } + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_4,&__pyx_t_2,&__pyx_t_6}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(item); + *(temps[i]) = item; } - __pyx_pybuffernd_img.diminfo[0].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_img.diminfo[0].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_img.diminfo[1].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_img.diminfo[1].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 417, __pyx_L1_error) } - __pyx_t_9 = 0; - __pyx_v_img = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; + #endif + } else { + Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_4,&__pyx_t_2,&__pyx_t_6}; + __pyx_t_3 = PyObject_GetIter(__pyx_v_extents); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_10(__pyx_t_3); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_3), 4) < 0) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_L4_unpacking_done:; + } + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_13 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_14 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_x0 = __pyx_t_11; + __pyx_v_x1 = __pyx_t_12; + __pyx_v_y0 = __pyx_t_13; + __pyx_v_y1 = __pyx_t_14; - /* "yt/utilities/lib/pixelization_routines.pyx":418 - * if input_img is None: - * img = np.zeros((buff_size[0], buff_size[1])) - * img[:] = np.nan # <<<<<<<<<<<<<< - * else: - * img = input_img + /* "yt/utilities/lib/pixelization_routines.pyx":505 + * + * x0, x1, y0, y1 = extents + * dx = (x1 - x0) / buff.shape[1] # <<<<<<<<<<<<<< + * dy = (y1 - y0) / buff.shape[0] + * cdef np.float64_t rbounds[2] */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_img), __pyx_t_6, 0, 0, NULL, NULL, &__pyx_slice__6, 0, 0, 0) < 0) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_dx = ((__pyx_v_x1 - __pyx_v_x0) / (__pyx_v_buff.shape[1])); - /* "yt/utilities/lib/pixelization_routines.pyx":416 - * nf = field.shape[0] - * - * if input_img is None: # <<<<<<<<<<<<<< - * img = np.zeros((buff_size[0], buff_size[1])) - * img[:] = np.nan + /* "yt/utilities/lib/pixelization_routines.pyx":506 + * x0, x1, y0, y1 = extents + * dx = (x1 - x0) / buff.shape[1] + * dy = (y1 - y0) / buff.shape[0] # <<<<<<<<<<<<<< + * cdef np.float64_t rbounds[2] + * cdef np.float64_t corners[8] */ - goto __pyx_L3; - } + __pyx_v_dy = ((__pyx_v_y1 - __pyx_v_y0) / (__pyx_v_buff.shape[0])); - /* "yt/utilities/lib/pixelization_routines.pyx":420 - * img[:] = np.nan - * else: - * img = input_img # <<<<<<<<<<<<<< - * # Okay, here's our strategy. We compute the bounds in x and y, which will - * # be a rectangle, and then for each x, y position we check to see if it's + /* "yt/utilities/lib/pixelization_routines.pyx":510 + * cdef np.float64_t corners[8] + * # Find our min and max r + * corners[0] = x0*x0+y0*y0 # <<<<<<<<<<<<<< + * corners[1] = x1*x1+y0*y0 + * corners[2] = x0*x0+y1*y1 */ - /*else*/ { - if (!(likely(((__pyx_v_input_img) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_input_img, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 420, __pyx_L1_error) - __pyx_t_6 = __pyx_v_input_img; - __Pyx_INCREF(__pyx_t_6); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); - __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_6), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_10 < 0)) { - PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_v_img, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); - } - } - __pyx_pybuffernd_img.diminfo[0].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_img.diminfo[0].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_img.diminfo[1].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_img.diminfo[1].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 420, __pyx_L1_error) - } - __pyx_v_img = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; - } - __pyx_L3:; + (__pyx_v_corners[0]) = ((__pyx_v_x0 * __pyx_v_x0) + (__pyx_v_y0 * __pyx_v_y0)); - /* "yt/utilities/lib/pixelization_routines.pyx":426 - * # (x,y)->(theta,phi) calculation, but because we no longer have to search - * # through the theta, phi arrays, it should be faster. - * dx = 2.0 / (img.shape[0] - 1) # <<<<<<<<<<<<<< - * dy = 2.0 / (img.shape[1] - 1) - * x = y = 0 + /* "yt/utilities/lib/pixelization_routines.pyx":511 + * # Find our min and max r + * corners[0] = x0*x0+y0*y0 + * corners[1] = x1*x1+y0*y0 # <<<<<<<<<<<<<< + * corners[2] = x0*x0+y1*y1 + * corners[3] = x1*x1+y1*y1 */ - __pyx_v_dx = (2.0 / ((__pyx_v_img->dimensions[0]) - 1)); + (__pyx_v_corners[1]) = ((__pyx_v_x1 * __pyx_v_x1) + (__pyx_v_y0 * __pyx_v_y0)); - /* "yt/utilities/lib/pixelization_routines.pyx":427 - * # through the theta, phi arrays, it should be faster. - * dx = 2.0 / (img.shape[0] - 1) - * dy = 2.0 / (img.shape[1] - 1) # <<<<<<<<<<<<<< - * x = y = 0 - * for fi in range(nf): + /* "yt/utilities/lib/pixelization_routines.pyx":512 + * corners[0] = x0*x0+y0*y0 + * corners[1] = x1*x1+y0*y0 + * corners[2] = x0*x0+y1*y1 # <<<<<<<<<<<<<< + * corners[3] = x1*x1+y1*y1 + * corners[4] = x0*x0 */ - __pyx_v_dy = (2.0 / ((__pyx_v_img->dimensions[1]) - 1)); + (__pyx_v_corners[2]) = ((__pyx_v_x0 * __pyx_v_x0) + (__pyx_v_y1 * __pyx_v_y1)); - /* "yt/utilities/lib/pixelization_routines.pyx":428 - * dx = 2.0 / (img.shape[0] - 1) - * dy = 2.0 / (img.shape[1] - 1) - * x = y = 0 # <<<<<<<<<<<<<< - * for fi in range(nf): - * theta_p = (theta[fi] + theta_offset) - PI + /* "yt/utilities/lib/pixelization_routines.pyx":513 + * corners[1] = x1*x1+y0*y0 + * corners[2] = x0*x0+y1*y1 + * corners[3] = x1*x1+y1*y1 # <<<<<<<<<<<<<< + * corners[4] = x0*x0 + * corners[5] = x1*x1 */ - __pyx_v_x = 0.0; - __pyx_v_y = 0.0; + (__pyx_v_corners[3]) = ((__pyx_v_x1 * __pyx_v_x1) + (__pyx_v_y1 * __pyx_v_y1)); - /* "yt/utilities/lib/pixelization_routines.pyx":429 - * dy = 2.0 / (img.shape[1] - 1) - * x = y = 0 - * for fi in range(nf): # <<<<<<<<<<<<<< - * theta_p = (theta[fi] + theta_offset) - PI - * dtheta_p = dtheta[fi] + /* "yt/utilities/lib/pixelization_routines.pyx":514 + * corners[2] = x0*x0+y1*y1 + * corners[3] = x1*x1+y1*y1 + * corners[4] = x0*x0 # <<<<<<<<<<<<<< + * corners[5] = x1*x1 + * corners[6] = y0*y0 */ - __pyx_t_10 = __pyx_v_nf; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) { - __pyx_v_fi = __pyx_t_14; + (__pyx_v_corners[4]) = (__pyx_v_x0 * __pyx_v_x0); - /* "yt/utilities/lib/pixelization_routines.pyx":430 - * x = y = 0 - * for fi in range(nf): - * theta_p = (theta[fi] + theta_offset) - PI # <<<<<<<<<<<<<< - * dtheta_p = dtheta[fi] - * phi_p = (phi[fi] + phi_offset) - PI/2.0 + /* "yt/utilities/lib/pixelization_routines.pyx":515 + * corners[3] = x1*x1+y1*y1 + * corners[4] = x0*x0 + * corners[5] = x1*x1 # <<<<<<<<<<<<<< + * corners[6] = y0*y0 + * corners[7] = y1*y1 */ - __pyx_t_15 = __pyx_v_fi; - __pyx_v_theta_p = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_theta.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_theta.diminfo[0].strides)) + __pyx_v_theta_offset) - __pyx_v_PI); + (__pyx_v_corners[5]) = (__pyx_v_x1 * __pyx_v_x1); - /* "yt/utilities/lib/pixelization_routines.pyx":431 - * for fi in range(nf): - * theta_p = (theta[fi] + theta_offset) - PI - * dtheta_p = dtheta[fi] # <<<<<<<<<<<<<< - * phi_p = (phi[fi] + phi_offset) - PI/2.0 - * dphi_p = dphi[fi] + /* "yt/utilities/lib/pixelization_routines.pyx":516 + * corners[4] = x0*x0 + * corners[5] = x1*x1 + * corners[6] = y0*y0 # <<<<<<<<<<<<<< + * corners[7] = y1*y1 + * rbounds[0] = rbounds[1] = corners[0] */ - __pyx_t_16 = __pyx_v_fi; - __pyx_v_dtheta_p = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dtheta.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_dtheta.diminfo[0].strides)); + (__pyx_v_corners[6]) = (__pyx_v_y0 * __pyx_v_y0); - /* "yt/utilities/lib/pixelization_routines.pyx":432 - * theta_p = (theta[fi] + theta_offset) - PI - * dtheta_p = dtheta[fi] - * phi_p = (phi[fi] + phi_offset) - PI/2.0 # <<<<<<<<<<<<<< - * dphi_p = dphi[fi] - * # Four transformations + /* "yt/utilities/lib/pixelization_routines.pyx":517 + * corners[5] = x1*x1 + * corners[6] = y0*y0 + * corners[7] = y1*y1 # <<<<<<<<<<<<<< + * rbounds[0] = rbounds[1] = corners[0] + * for i in range(8): */ - __pyx_t_17 = __pyx_v_fi; - __pyx_v_phi_p = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_phi.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_phi.diminfo[0].strides)) + __pyx_v_phi_offset) - (__pyx_v_PI / 2.0)); + (__pyx_v_corners[7]) = (__pyx_v_y1 * __pyx_v_y1); - /* "yt/utilities/lib/pixelization_routines.pyx":433 - * dtheta_p = dtheta[fi] - * phi_p = (phi[fi] + phi_offset) - PI/2.0 - * dphi_p = dphi[fi] # <<<<<<<<<<<<<< - * # Four transformations - * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p - dphi_p, &x, &y) + /* "yt/utilities/lib/pixelization_routines.pyx":518 + * corners[6] = y0*y0 + * corners[7] = y1*y1 + * rbounds[0] = rbounds[1] = corners[0] # <<<<<<<<<<<<<< + * for i in range(8): + * rbounds[0] = fmin(rbounds[0], corners[i]) */ - __pyx_t_18 = __pyx_v_fi; - __pyx_v_dphi_p = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dphi.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dphi.diminfo[0].strides)); + (__pyx_v_rbounds[0]) = (__pyx_v_corners[0]); + (__pyx_v_rbounds[1]) = (__pyx_v_corners[0]); - /* "yt/utilities/lib/pixelization_routines.pyx":435 - * dphi_p = dphi[fi] - * # Four transformations - * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p - dphi_p, &x, &y) # <<<<<<<<<<<<<< - * xmin = x - * xmax = x + /* "yt/utilities/lib/pixelization_routines.pyx":519 + * corners[7] = y1*y1 + * rbounds[0] = rbounds[1] = corners[0] + * for i in range(8): # <<<<<<<<<<<<<< + * rbounds[0] = fmin(rbounds[0], corners[i]) + * rbounds[1] = fmax(rbounds[1], corners[i]) */ - __pyx_f_2yt_9utilities_3lib_21pixelization_routines_aitoff_thetaphi_to_xy((__pyx_v_theta_p - __pyx_v_dtheta_p), (__pyx_v_phi_p - __pyx_v_dphi_p), (&__pyx_v_x), (&__pyx_v_y)); + for (__pyx_t_7 = 0; __pyx_t_7 < 8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/pixelization_routines.pyx":436 - * # Four transformations - * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p - dphi_p, &x, &y) - * xmin = x # <<<<<<<<<<<<<< - * xmax = x - * ymin = y + /* "yt/utilities/lib/pixelization_routines.pyx":520 + * rbounds[0] = rbounds[1] = corners[0] + * for i in range(8): + * rbounds[0] = fmin(rbounds[0], corners[i]) # <<<<<<<<<<<<<< + * rbounds[1] = fmax(rbounds[1], corners[i]) + * rbounds[0] = math.sqrt(rbounds[0]) */ - __pyx_v_xmin = __pyx_v_x; + (__pyx_v_rbounds[0]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin((__pyx_v_rbounds[0]), (__pyx_v_corners[__pyx_v_i])); - /* "yt/utilities/lib/pixelization_routines.pyx":437 - * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p - dphi_p, &x, &y) - * xmin = x - * xmax = x # <<<<<<<<<<<<<< - * ymin = y - * ymax = y + /* "yt/utilities/lib/pixelization_routines.pyx":521 + * for i in range(8): + * rbounds[0] = fmin(rbounds[0], corners[i]) + * rbounds[1] = fmax(rbounds[1], corners[i]) # <<<<<<<<<<<<<< + * rbounds[0] = math.sqrt(rbounds[0]) + * rbounds[1] = math.sqrt(rbounds[1]) */ - __pyx_v_xmax = __pyx_v_x; + (__pyx_v_rbounds[1]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((__pyx_v_rbounds[1]), (__pyx_v_corners[__pyx_v_i])); + } - /* "yt/utilities/lib/pixelization_routines.pyx":438 - * xmin = x - * xmax = x - * ymin = y # <<<<<<<<<<<<<< - * ymax = y - * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p + dphi_p, &x, &y) + /* "yt/utilities/lib/pixelization_routines.pyx":522 + * rbounds[0] = fmin(rbounds[0], corners[i]) + * rbounds[1] = fmax(rbounds[1], corners[i]) + * rbounds[0] = math.sqrt(rbounds[0]) # <<<<<<<<<<<<<< + * rbounds[1] = math.sqrt(rbounds[1]) + * # If we include the origin in either direction, we need to have radius of */ - __pyx_v_ymin = __pyx_v_y; + (__pyx_v_rbounds[0]) = sqrt((__pyx_v_rbounds[0])); - /* "yt/utilities/lib/pixelization_routines.pyx":439 - * xmax = x - * ymin = y - * ymax = y # <<<<<<<<<<<<<< - * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p + dphi_p, &x, &y) - * xmin = fmin(xmin, x) + /* "yt/utilities/lib/pixelization_routines.pyx":523 + * rbounds[1] = fmax(rbounds[1], corners[i]) + * rbounds[0] = math.sqrt(rbounds[0]) + * rbounds[1] = math.sqrt(rbounds[1]) # <<<<<<<<<<<<<< + * # If we include the origin in either direction, we need to have radius of + * # zero as our lower bound. */ - __pyx_v_ymax = __pyx_v_y; + (__pyx_v_rbounds[1]) = sqrt((__pyx_v_rbounds[1])); - /* "yt/utilities/lib/pixelization_routines.pyx":440 - * ymin = y - * ymax = y - * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p + dphi_p, &x, &y) # <<<<<<<<<<<<<< - * xmin = fmin(xmin, x) - * xmax = fmax(xmax, x) + /* "yt/utilities/lib/pixelization_routines.pyx":526 + * # If we include the origin in either direction, we need to have radius of + * # zero as our lower bound. + * if x0 < 0 and x1 > 0: # <<<<<<<<<<<<<< + * rbounds[0] = 0.0 + * if y0 < 0 and y1 > 0: */ - __pyx_f_2yt_9utilities_3lib_21pixelization_routines_aitoff_thetaphi_to_xy((__pyx_v_theta_p - __pyx_v_dtheta_p), (__pyx_v_phi_p + __pyx_v_dphi_p), (&__pyx_v_x), (&__pyx_v_y)); + __pyx_t_16 = ((__pyx_v_x0 < 0.0) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_15 = __pyx_t_16; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_16 = ((__pyx_v_x1 > 0.0) != 0); + __pyx_t_15 = __pyx_t_16; + __pyx_L8_bool_binop_done:; + if (__pyx_t_15) { - /* "yt/utilities/lib/pixelization_routines.pyx":441 - * ymax = y - * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p + dphi_p, &x, &y) - * xmin = fmin(xmin, x) # <<<<<<<<<<<<<< - * xmax = fmax(xmax, x) - * ymin = fmin(ymin, y) + /* "yt/utilities/lib/pixelization_routines.pyx":527 + * # zero as our lower bound. + * if x0 < 0 and x1 > 0: + * rbounds[0] = 0.0 # <<<<<<<<<<<<<< + * if y0 < 0 and y1 > 0: + * rbounds[0] = 0.0 */ - __pyx_v_xmin = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_xmin, __pyx_v_x); + (__pyx_v_rbounds[0]) = 0.0; - /* "yt/utilities/lib/pixelization_routines.pyx":442 - * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p + dphi_p, &x, &y) - * xmin = fmin(xmin, x) - * xmax = fmax(xmax, x) # <<<<<<<<<<<<<< - * ymin = fmin(ymin, y) - * ymax = fmax(ymax, y) + /* "yt/utilities/lib/pixelization_routines.pyx":526 + * # If we include the origin in either direction, we need to have radius of + * # zero as our lower bound. + * if x0 < 0 and x1 > 0: # <<<<<<<<<<<<<< + * rbounds[0] = 0.0 + * if y0 < 0 and y1 > 0: */ - __pyx_v_xmax = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_xmax, __pyx_v_x); + } - /* "yt/utilities/lib/pixelization_routines.pyx":443 - * xmin = fmin(xmin, x) - * xmax = fmax(xmax, x) - * ymin = fmin(ymin, y) # <<<<<<<<<<<<<< - * ymax = fmax(ymax, y) - * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p - dphi_p, &x, &y) + /* "yt/utilities/lib/pixelization_routines.pyx":528 + * if x0 < 0 and x1 > 0: + * rbounds[0] = 0.0 + * if y0 < 0 and y1 > 0: # <<<<<<<<<<<<<< + * rbounds[0] = 0.0 + * dthetamin = dx / rmax */ - __pyx_v_ymin = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_ymin, __pyx_v_y); + __pyx_t_16 = ((__pyx_v_y0 < 0.0) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_15 = __pyx_t_16; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_16 = ((__pyx_v_y1 > 0.0) != 0); + __pyx_t_15 = __pyx_t_16; + __pyx_L11_bool_binop_done:; + if (__pyx_t_15) { - /* "yt/utilities/lib/pixelization_routines.pyx":444 - * xmax = fmax(xmax, x) - * ymin = fmin(ymin, y) - * ymax = fmax(ymax, y) # <<<<<<<<<<<<<< - * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p - dphi_p, &x, &y) - * xmin = fmin(xmin, x) + /* "yt/utilities/lib/pixelization_routines.pyx":529 + * rbounds[0] = 0.0 + * if y0 < 0 and y1 > 0: + * rbounds[0] = 0.0 # <<<<<<<<<<<<<< + * dthetamin = dx / rmax + * for i in range(radius.shape[0]): */ - __pyx_v_ymax = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_ymax, __pyx_v_y); + (__pyx_v_rbounds[0]) = 0.0; - /* "yt/utilities/lib/pixelization_routines.pyx":445 - * ymin = fmin(ymin, y) - * ymax = fmax(ymax, y) - * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p - dphi_p, &x, &y) # <<<<<<<<<<<<<< - * xmin = fmin(xmin, x) - * xmax = fmax(xmax, x) + /* "yt/utilities/lib/pixelization_routines.pyx":528 + * if x0 < 0 and x1 > 0: + * rbounds[0] = 0.0 + * if y0 < 0 and y1 > 0: # <<<<<<<<<<<<<< + * rbounds[0] = 0.0 + * dthetamin = dx / rmax */ - __pyx_f_2yt_9utilities_3lib_21pixelization_routines_aitoff_thetaphi_to_xy((__pyx_v_theta_p + __pyx_v_dtheta_p), (__pyx_v_phi_p - __pyx_v_dphi_p), (&__pyx_v_x), (&__pyx_v_y)); + } - /* "yt/utilities/lib/pixelization_routines.pyx":446 - * ymax = fmax(ymax, y) - * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p - dphi_p, &x, &y) - * xmin = fmin(xmin, x) # <<<<<<<<<<<<<< - * xmax = fmax(xmax, x) - * ymin = fmin(ymin, y) + /* "yt/utilities/lib/pixelization_routines.pyx":530 + * if y0 < 0 and y1 > 0: + * rbounds[0] = 0.0 + * dthetamin = dx / rmax # <<<<<<<<<<<<<< + * for i in range(radius.shape[0]): + * */ - __pyx_v_xmin = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_xmin, __pyx_v_x); + __pyx_v_dthetamin = (__pyx_v_dx / __pyx_v_rmax); - /* "yt/utilities/lib/pixelization_routines.pyx":447 - * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p - dphi_p, &x, &y) - * xmin = fmin(xmin, x) - * xmax = fmax(xmax, x) # <<<<<<<<<<<<<< - * ymin = fmin(ymin, y) - * ymax = fmax(ymax, y) + /* "yt/utilities/lib/pixelization_routines.pyx":531 + * rbounds[0] = 0.0 + * dthetamin = dx / rmax + * for i in range(radius.shape[0]): # <<<<<<<<<<<<<< + * + * r0 = radius[i] */ - __pyx_v_xmax = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_xmax, __pyx_v_x); + __pyx_t_17 = (__pyx_v_radius.shape[0]); + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_17; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/pixelization_routines.pyx":448 - * xmin = fmin(xmin, x) - * xmax = fmax(xmax, x) - * ymin = fmin(ymin, y) # <<<<<<<<<<<<<< - * ymax = fmax(ymax, y) - * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p + dphi_p, &x, &y) + /* "yt/utilities/lib/pixelization_routines.pyx":533 + * for i in range(radius.shape[0]): + * + * r0 = radius[i] # <<<<<<<<<<<<<< + * theta0 = theta[i] + * dr_i = dradius[i] */ - __pyx_v_ymin = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_ymin, __pyx_v_y); + __pyx_t_18 = __pyx_v_i; + __pyx_v_r0 = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_radius.data + __pyx_t_18 * __pyx_v_radius.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":449 - * xmax = fmax(xmax, x) - * ymin = fmin(ymin, y) - * ymax = fmax(ymax, y) # <<<<<<<<<<<<<< - * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p + dphi_p, &x, &y) - * xmin = fmin(xmin, x) + /* "yt/utilities/lib/pixelization_routines.pyx":534 + * + * r0 = radius[i] + * theta0 = theta[i] # <<<<<<<<<<<<<< + * dr_i = dradius[i] + * dtheta_i = dtheta[i] */ - __pyx_v_ymax = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_ymax, __pyx_v_y); + __pyx_t_19 = __pyx_v_i; + __pyx_v_theta0 = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_theta.data + __pyx_t_19 * __pyx_v_theta.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":450 - * ymin = fmin(ymin, y) - * ymax = fmax(ymax, y) - * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p + dphi_p, &x, &y) # <<<<<<<<<<<<<< - * xmin = fmin(xmin, x) - * xmax = fmax(xmax, x) + /* "yt/utilities/lib/pixelization_routines.pyx":535 + * r0 = radius[i] + * theta0 = theta[i] + * dr_i = dradius[i] # <<<<<<<<<<<<<< + * dtheta_i = dtheta[i] + * # Skip out early if we're offsides, for zoomed in plots */ - __pyx_f_2yt_9utilities_3lib_21pixelization_routines_aitoff_thetaphi_to_xy((__pyx_v_theta_p + __pyx_v_dtheta_p), (__pyx_v_phi_p + __pyx_v_dphi_p), (&__pyx_v_x), (&__pyx_v_y)); + __pyx_t_20 = __pyx_v_i; + __pyx_v_dr_i = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_dradius.data + __pyx_t_20 * __pyx_v_dradius.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":451 - * ymax = fmax(ymax, y) - * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p + dphi_p, &x, &y) - * xmin = fmin(xmin, x) # <<<<<<<<<<<<<< - * xmax = fmax(xmax, x) - * ymin = fmin(ymin, y) + /* "yt/utilities/lib/pixelization_routines.pyx":536 + * theta0 = theta[i] + * dr_i = dradius[i] + * dtheta_i = dtheta[i] # <<<<<<<<<<<<<< + * # Skip out early if we're offsides, for zoomed in plots + * if r0 + dr_i < rbounds[0] or r0 - dr_i > rbounds[1]: */ - __pyx_v_xmin = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_xmin, __pyx_v_x); + __pyx_t_21 = __pyx_v_i; + __pyx_v_dtheta_i = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_dtheta.data + __pyx_t_21 * __pyx_v_dtheta.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":452 - * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p + dphi_p, &x, &y) - * xmin = fmin(xmin, x) - * xmax = fmax(xmax, x) # <<<<<<<<<<<<<< - * ymin = fmin(ymin, y) - * ymax = fmax(ymax, y) + /* "yt/utilities/lib/pixelization_routines.pyx":538 + * dtheta_i = dtheta[i] + * # Skip out early if we're offsides, for zoomed in plots + * if r0 + dr_i < rbounds[0] or r0 - dr_i > rbounds[1]: # <<<<<<<<<<<<<< + * continue + * theta_i = theta0 - dtheta_i */ - __pyx_v_xmax = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_xmax, __pyx_v_x); + __pyx_t_16 = (((__pyx_v_r0 + __pyx_v_dr_i) < (__pyx_v_rbounds[0])) != 0); + if (!__pyx_t_16) { + } else { + __pyx_t_15 = __pyx_t_16; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_16 = (((__pyx_v_r0 - __pyx_v_dr_i) > (__pyx_v_rbounds[1])) != 0); + __pyx_t_15 = __pyx_t_16; + __pyx_L16_bool_binop_done:; + if (__pyx_t_15) { - /* "yt/utilities/lib/pixelization_routines.pyx":453 - * xmin = fmin(xmin, x) - * xmax = fmax(xmax, x) - * ymin = fmin(ymin, y) # <<<<<<<<<<<<<< - * ymax = fmax(ymax, y) - * # Now we have the (projected rectangular) bounds. + /* "yt/utilities/lib/pixelization_routines.pyx":539 + * # Skip out early if we're offsides, for zoomed in plots + * if r0 + dr_i < rbounds[0] or r0 - dr_i > rbounds[1]: + * continue # <<<<<<<<<<<<<< + * theta_i = theta0 - dtheta_i + * # Buffer of 0.5 here */ - __pyx_v_ymin = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_ymin, __pyx_v_y); + goto __pyx_L13_continue; - /* "yt/utilities/lib/pixelization_routines.pyx":454 - * xmax = fmax(xmax, x) - * ymin = fmin(ymin, y) - * ymax = fmax(ymax, y) # <<<<<<<<<<<<<< - * # Now we have the (projected rectangular) bounds. - * xmin = (xmin + 1) # Get this into normalized image coords + /* "yt/utilities/lib/pixelization_routines.pyx":538 + * dtheta_i = dtheta[i] + * # Skip out early if we're offsides, for zoomed in plots + * if r0 + dr_i < rbounds[0] or r0 - dr_i > rbounds[1]: # <<<<<<<<<<<<<< + * continue + * theta_i = theta0 - dtheta_i */ - __pyx_v_ymax = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_ymax, __pyx_v_y); + } - /* "yt/utilities/lib/pixelization_routines.pyx":456 - * ymax = fmax(ymax, y) - * # Now we have the (projected rectangular) bounds. - * xmin = (xmin + 1) # Get this into normalized image coords # <<<<<<<<<<<<<< - * xmax = (xmax + 1) # Get this into normalized image coords - * ymin = (ymin + 1) # Get this into normalized image coords + /* "yt/utilities/lib/pixelization_routines.pyx":540 + * if r0 + dr_i < rbounds[0] or r0 - dr_i > rbounds[1]: + * continue + * theta_i = theta0 - dtheta_i # <<<<<<<<<<<<<< + * # Buffer of 0.5 here + * dthetamin = 0.5*dx/(r0 + dr_i) */ - __pyx_v_xmin = (__pyx_v_xmin + 1.0); + __pyx_v_theta_i = (__pyx_v_theta0 - __pyx_v_dtheta_i); - /* "yt/utilities/lib/pixelization_routines.pyx":457 - * # Now we have the (projected rectangular) bounds. - * xmin = (xmin + 1) # Get this into normalized image coords - * xmax = (xmax + 1) # Get this into normalized image coords # <<<<<<<<<<<<<< - * ymin = (ymin + 1) # Get this into normalized image coords - * ymax = (ymax + 1) # Get this into normalized image coords + /* "yt/utilities/lib/pixelization_routines.pyx":542 + * theta_i = theta0 - dtheta_i + * # Buffer of 0.5 here + * dthetamin = 0.5*dx/(r0 + dr_i) # <<<<<<<<<<<<<< + * while theta_i < theta0 + dtheta_i: + * r_i = r0 - dr_i */ - __pyx_v_xmax = (__pyx_v_xmax + 1.0); + __pyx_v_dthetamin = ((0.5 * __pyx_v_dx) / (__pyx_v_r0 + __pyx_v_dr_i)); - /* "yt/utilities/lib/pixelization_routines.pyx":458 - * xmin = (xmin + 1) # Get this into normalized image coords - * xmax = (xmax + 1) # Get this into normalized image coords - * ymin = (ymin + 1) # Get this into normalized image coords # <<<<<<<<<<<<<< - * ymax = (ymax + 1) # Get this into normalized image coords - * x0 = (xmin / dx) + /* "yt/utilities/lib/pixelization_routines.pyx":543 + * # Buffer of 0.5 here + * dthetamin = 0.5*dx/(r0 + dr_i) + * while theta_i < theta0 + dtheta_i: # <<<<<<<<<<<<<< + * r_i = r0 - dr_i + * costheta = math.cos(theta_i) */ - __pyx_v_ymin = (__pyx_v_ymin + 1.0); + while (1) { + __pyx_t_15 = ((__pyx_v_theta_i < (__pyx_v_theta0 + __pyx_v_dtheta_i)) != 0); + if (!__pyx_t_15) break; - /* "yt/utilities/lib/pixelization_routines.pyx":459 - * xmax = (xmax + 1) # Get this into normalized image coords - * ymin = (ymin + 1) # Get this into normalized image coords - * ymax = (ymax + 1) # Get this into normalized image coords # <<<<<<<<<<<<<< - * x0 = (xmin / dx) - * x1 = (xmax / dx) + 1 + /* "yt/utilities/lib/pixelization_routines.pyx":544 + * dthetamin = 0.5*dx/(r0 + dr_i) + * while theta_i < theta0 + dtheta_i: + * r_i = r0 - dr_i # <<<<<<<<<<<<<< + * costheta = math.cos(theta_i) + * sintheta = math.sin(theta_i) */ - __pyx_v_ymax = (__pyx_v_ymax + 1.0); + __pyx_v_r_i = (__pyx_v_r0 - __pyx_v_dr_i); - /* "yt/utilities/lib/pixelization_routines.pyx":460 - * ymin = (ymin + 1) # Get this into normalized image coords - * ymax = (ymax + 1) # Get this into normalized image coords - * x0 = (xmin / dx) # <<<<<<<<<<<<<< - * x1 = (xmax / dx) + 1 - * y0 = (ymin / dy) + /* "yt/utilities/lib/pixelization_routines.pyx":545 + * while theta_i < theta0 + dtheta_i: + * r_i = r0 - dr_i + * costheta = math.cos(theta_i) # <<<<<<<<<<<<<< + * sintheta = math.sin(theta_i) + * while r_i < r0 + dr_i: */ - __pyx_v_x0 = ((int)(__pyx_v_xmin / __pyx_v_dx)); + __pyx_v_costheta = cos(__pyx_v_theta_i); - /* "yt/utilities/lib/pixelization_routines.pyx":461 - * ymax = (ymax + 1) # Get this into normalized image coords - * x0 = (xmin / dx) - * x1 = (xmax / dx) + 1 # <<<<<<<<<<<<<< - * y0 = (ymin / dy) - * y1 = (ymax / dy) + 1 + /* "yt/utilities/lib/pixelization_routines.pyx":546 + * r_i = r0 - dr_i + * costheta = math.cos(theta_i) + * sintheta = math.sin(theta_i) # <<<<<<<<<<<<<< + * while r_i < r0 + dr_i: + * if rmax <= r_i: */ - __pyx_v_x1 = (((int)(__pyx_v_xmax / __pyx_v_dx)) + 1); + __pyx_v_sintheta = sin(__pyx_v_theta_i); - /* "yt/utilities/lib/pixelization_routines.pyx":462 - * x0 = (xmin / dx) - * x1 = (xmax / dx) + 1 - * y0 = (ymin / dy) # <<<<<<<<<<<<<< - * y1 = (ymax / dy) + 1 - * for i in range(x0, x1): + /* "yt/utilities/lib/pixelization_routines.pyx":547 + * costheta = math.cos(theta_i) + * sintheta = math.sin(theta_i) + * while r_i < r0 + dr_i: # <<<<<<<<<<<<<< + * if rmax <= r_i: + * r_i += 0.5*dx */ - __pyx_v_y0 = ((int)(__pyx_v_ymin / __pyx_v_dy)); + while (1) { + __pyx_t_15 = ((__pyx_v_r_i < (__pyx_v_r0 + __pyx_v_dr_i)) != 0); + if (!__pyx_t_15) break; - /* "yt/utilities/lib/pixelization_routines.pyx":463 - * x1 = (xmax / dx) + 1 - * y0 = (ymin / dy) - * y1 = (ymax / dy) + 1 # <<<<<<<<<<<<<< - * for i in range(x0, x1): - * x = (-1.0 + i*dx)*s2*2.0 + /* "yt/utilities/lib/pixelization_routines.pyx":548 + * sintheta = math.sin(theta_i) + * while r_i < r0 + dr_i: + * if rmax <= r_i: # <<<<<<<<<<<<<< + * r_i += 0.5*dx + * continue */ - __pyx_v_y1 = (((int)(__pyx_v_ymax / __pyx_v_dy)) + 1); + __pyx_t_15 = ((__pyx_v_rmax <= __pyx_v_r_i) != 0); + if (__pyx_t_15) { - /* "yt/utilities/lib/pixelization_routines.pyx":464 - * y0 = (ymin / dy) - * y1 = (ymax / dy) + 1 - * for i in range(x0, x1): # <<<<<<<<<<<<<< - * x = (-1.0 + i*dx)*s2*2.0 - * for j in range(y0, y1): + /* "yt/utilities/lib/pixelization_routines.pyx":549 + * while r_i < r0 + dr_i: + * if rmax <= r_i: + * r_i += 0.5*dx # <<<<<<<<<<<<<< + * continue + * y = r_i * costheta */ - __pyx_t_19 = __pyx_v_x1; - for (__pyx_t_20 = __pyx_v_x0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { - __pyx_v_i = __pyx_t_20; + __pyx_v_r_i = (__pyx_v_r_i + (0.5 * __pyx_v_dx)); - /* "yt/utilities/lib/pixelization_routines.pyx":465 - * y1 = (ymax / dy) + 1 - * for i in range(x0, x1): - * x = (-1.0 + i*dx)*s2*2.0 # <<<<<<<<<<<<<< - * for j in range(y0, y1): - * y = (-1.0 + j * dy)*s2 + /* "yt/utilities/lib/pixelization_routines.pyx":550 + * if rmax <= r_i: + * r_i += 0.5*dx + * continue # <<<<<<<<<<<<<< + * y = r_i * costheta + * x = r_i * sintheta */ - __pyx_v_x = (((-1.0 + (__pyx_v_i * __pyx_v_dx)) * __pyx_v_s2) * 2.0); + goto __pyx_L20_continue; - /* "yt/utilities/lib/pixelization_routines.pyx":466 - * for i in range(x0, x1): - * x = (-1.0 + i*dx)*s2*2.0 - * for j in range(y0, y1): # <<<<<<<<<<<<<< - * y = (-1.0 + j * dy)*s2 - * zb = (x*x/8.0 + y*y/2.0 - 1.0) + /* "yt/utilities/lib/pixelization_routines.pyx":548 + * sintheta = math.sin(theta_i) + * while r_i < r0 + dr_i: + * if rmax <= r_i: # <<<<<<<<<<<<<< + * r_i += 0.5*dx + * continue */ - __pyx_t_21 = __pyx_v_y1; - for (__pyx_t_22 = __pyx_v_y0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { - __pyx_v_j = __pyx_t_22; + } - /* "yt/utilities/lib/pixelization_routines.pyx":467 - * x = (-1.0 + i*dx)*s2*2.0 - * for j in range(y0, y1): - * y = (-1.0 + j * dy)*s2 # <<<<<<<<<<<<<< - * zb = (x*x/8.0 + y*y/2.0 - 1.0) - * if zb > 0: continue + /* "yt/utilities/lib/pixelization_routines.pyx":551 + * r_i += 0.5*dx + * continue + * y = r_i * costheta # <<<<<<<<<<<<<< + * x = r_i * sintheta + * pi = ((x - x0)/dx) */ - __pyx_v_y = ((-1.0 + (__pyx_v_j * __pyx_v_dy)) * __pyx_v_s2); + __pyx_v_y = (__pyx_v_r_i * __pyx_v_costheta); - /* "yt/utilities/lib/pixelization_routines.pyx":468 - * for j in range(y0, y1): - * y = (-1.0 + j * dy)*s2 - * zb = (x*x/8.0 + y*y/2.0 - 1.0) # <<<<<<<<<<<<<< - * if zb > 0: continue - * z = (1.0 - (x/4.0)**2.0 - (y/2.0)**2.0) + /* "yt/utilities/lib/pixelization_routines.pyx":552 + * continue + * y = r_i * costheta + * x = r_i * sintheta # <<<<<<<<<<<<<< + * pi = ((x - x0)/dx) + * pj = ((y - y0)/dy) */ - __pyx_v_zb = ((((__pyx_v_x * __pyx_v_x) / 8.0) + ((__pyx_v_y * __pyx_v_y) / 2.0)) - 1.0); + __pyx_v_x = (__pyx_v_r_i * __pyx_v_sintheta); - /* "yt/utilities/lib/pixelization_routines.pyx":469 - * y = (-1.0 + j * dy)*s2 - * zb = (x*x/8.0 + y*y/2.0 - 1.0) - * if zb > 0: continue # <<<<<<<<<<<<<< - * z = (1.0 - (x/4.0)**2.0 - (y/2.0)**2.0) - * z = z**0.5 + /* "yt/utilities/lib/pixelization_routines.pyx":553 + * y = r_i * costheta + * x = r_i * sintheta + * pi = ((x - x0)/dx) # <<<<<<<<<<<<<< + * pj = ((y - y0)/dy) + * if pi >= 0 and pi < buff.shape[0] and \ */ - __pyx_t_5 = ((__pyx_v_zb > 0.0) != 0); - if (__pyx_t_5) { - goto __pyx_L8_continue; - } + __pyx_v_pi = ((int)((__pyx_v_x - __pyx_v_x0) / __pyx_v_dx)); - /* "yt/utilities/lib/pixelization_routines.pyx":470 - * zb = (x*x/8.0 + y*y/2.0 - 1.0) - * if zb > 0: continue - * z = (1.0 - (x/4.0)**2.0 - (y/2.0)**2.0) # <<<<<<<<<<<<<< - * z = z**0.5 - * # Longitude + /* "yt/utilities/lib/pixelization_routines.pyx":554 + * x = r_i * sintheta + * pi = ((x - x0)/dx) + * pj = ((y - y0)/dy) # <<<<<<<<<<<<<< + * if pi >= 0 and pi < buff.shape[0] and \ + * pj >= 0 and pj < buff.shape[1]: */ - __pyx_v_z = ((1.0 - pow((__pyx_v_x / 4.0), ((__pyx_t_5numpy_float64_t)2.0))) - pow((__pyx_v_y / 2.0), ((__pyx_t_5numpy_float64_t)2.0))); + __pyx_v_pj = ((int)((__pyx_v_y - __pyx_v_y0) / __pyx_v_dy)); - /* "yt/utilities/lib/pixelization_routines.pyx":471 - * if zb > 0: continue - * z = (1.0 - (x/4.0)**2.0 - (y/2.0)**2.0) - * z = z**0.5 # <<<<<<<<<<<<<< - * # Longitude - * theta0 = 2.0*math.atan(z*x/(2.0 * (2.0*z*z-1.0))) + /* "yt/utilities/lib/pixelization_routines.pyx":555 + * pi = ((x - x0)/dx) + * pj = ((y - y0)/dy) + * if pi >= 0 and pi < buff.shape[0] and \ # <<<<<<<<<<<<<< + * pj >= 0 and pj < buff.shape[1]: + * buff[pi, pj] = field[i] */ - __pyx_v_z = pow(__pyx_v_z, ((__pyx_t_5numpy_float64_t)0.5)); + __pyx_t_16 = ((__pyx_v_pi >= 0) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_15 = __pyx_t_16; + goto __pyx_L24_bool_binop_done; + } + __pyx_t_16 = ((__pyx_v_pi < (__pyx_v_buff.shape[0])) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_15 = __pyx_t_16; + goto __pyx_L24_bool_binop_done; + } - /* "yt/utilities/lib/pixelization_routines.pyx":473 - * z = z**0.5 - * # Longitude - * theta0 = 2.0*math.atan(z*x/(2.0 * (2.0*z*z-1.0))) # <<<<<<<<<<<<<< - * # Latitude - * # We shift it into co-latitude + /* "yt/utilities/lib/pixelization_routines.pyx":556 + * pj = ((y - y0)/dy) + * if pi >= 0 and pi < buff.shape[0] and \ + * pj >= 0 and pj < buff.shape[1]: # <<<<<<<<<<<<<< + * buff[pi, pj] = field[i] + * r_i += 0.5*dx */ - __pyx_v_theta0 = (2.0 * atan(((__pyx_v_z * __pyx_v_x) / (2.0 * (((2.0 * __pyx_v_z) * __pyx_v_z) - 1.0))))); + __pyx_t_16 = ((__pyx_v_pj >= 0) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_15 = __pyx_t_16; + goto __pyx_L24_bool_binop_done; + } + __pyx_t_16 = ((__pyx_v_pj < (__pyx_v_buff.shape[1])) != 0); + __pyx_t_15 = __pyx_t_16; + __pyx_L24_bool_binop_done:; - /* "yt/utilities/lib/pixelization_routines.pyx":476 - * # Latitude - * # We shift it into co-latitude - * phi0 = math.asin(z*y) # <<<<<<<<<<<<<< - * # Now we just need to figure out which pixel contributes. - * # We do not have a fast search. + /* "yt/utilities/lib/pixelization_routines.pyx":555 + * pi = ((x - x0)/dx) + * pj = ((y - y0)/dy) + * if pi >= 0 and pi < buff.shape[0] and \ # <<<<<<<<<<<<<< + * pj >= 0 and pj < buff.shape[1]: + * buff[pi, pj] = field[i] + */ + if (__pyx_t_15) { + + /* "yt/utilities/lib/pixelization_routines.pyx":557 + * if pi >= 0 and pi < buff.shape[0] and \ + * pj >= 0 and pj < buff.shape[1]: + * buff[pi, pj] = field[i] # <<<<<<<<<<<<<< + * r_i += 0.5*dx + * theta_i += dthetamin */ - __pyx_v_phi0 = asin((__pyx_v_z * __pyx_v_y)); + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_pi; + __pyx_t_24 = __pyx_v_pj; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_buff.data + __pyx_t_23 * __pyx_v_buff.strides[0]) ) + __pyx_t_24 * __pyx_v_buff.strides[1]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_field.data + __pyx_t_22 * __pyx_v_field.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":479 - * # Now we just need to figure out which pixel contributes. - * # We do not have a fast search. - * if not (theta_p - dtheta_p <= theta0 <= theta_p + dtheta_p): # <<<<<<<<<<<<<< - * continue - * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): + /* "yt/utilities/lib/pixelization_routines.pyx":555 + * pi = ((x - x0)/dx) + * pj = ((y - y0)/dy) + * if pi >= 0 and pi < buff.shape[0] and \ # <<<<<<<<<<<<<< + * pj >= 0 and pj < buff.shape[1]: + * buff[pi, pj] = field[i] */ - __pyx_t_5 = ((__pyx_v_theta_p - __pyx_v_dtheta_p) <= __pyx_v_theta0); - if (__pyx_t_5) { - __pyx_t_5 = (__pyx_v_theta0 <= (__pyx_v_theta_p + __pyx_v_dtheta_p)); } - __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0); - if (__pyx_t_4) { - /* "yt/utilities/lib/pixelization_routines.pyx":480 - * # We do not have a fast search. - * if not (theta_p - dtheta_p <= theta0 <= theta_p + dtheta_p): - * continue # <<<<<<<<<<<<<< - * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): - * continue + /* "yt/utilities/lib/pixelization_routines.pyx":558 + * pj >= 0 and pj < buff.shape[1]: + * buff[pi, pj] = field[i] + * r_i += 0.5*dx # <<<<<<<<<<<<<< + * theta_i += dthetamin + * */ - goto __pyx_L8_continue; + __pyx_v_r_i = (__pyx_v_r_i + (0.5 * __pyx_v_dx)); + __pyx_L20_continue:; + } - /* "yt/utilities/lib/pixelization_routines.pyx":479 - * # Now we just need to figure out which pixel contributes. - * # We do not have a fast search. - * if not (theta_p - dtheta_p <= theta0 <= theta_p + dtheta_p): # <<<<<<<<<<<<<< - * continue - * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): + /* "yt/utilities/lib/pixelization_routines.pyx":559 + * buff[pi, pj] = field[i] + * r_i += 0.5*dx + * theta_i += dthetamin # <<<<<<<<<<<<<< + * + * cdef void aitoff_thetaphi_to_xy(np.float64_t theta, np.float64_t phi, */ - } + __pyx_v_theta_i = (__pyx_v_theta_i + __pyx_v_dthetamin); + } + __pyx_L13_continue:; + } - /* "yt/utilities/lib/pixelization_routines.pyx":481 - * if not (theta_p - dtheta_p <= theta0 <= theta_p + dtheta_p): - * continue - * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): # <<<<<<<<<<<<<< - * continue - * img[i, j] = field[fi] - */ - __pyx_t_4 = ((__pyx_v_phi_p - __pyx_v_dphi_p) <= __pyx_v_phi0); - if (__pyx_t_4) { - __pyx_t_4 = (__pyx_v_phi0 <= (__pyx_v_phi_p + __pyx_v_dphi_p)); - } - __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0); - if (__pyx_t_5) { - - /* "yt/utilities/lib/pixelization_routines.pyx":482 - * continue - * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): - * continue # <<<<<<<<<<<<<< - * img[i, j] = field[fi] - * return img - */ - goto __pyx_L8_continue; - - /* "yt/utilities/lib/pixelization_routines.pyx":481 - * if not (theta_p - dtheta_p <= theta0 <= theta_p + dtheta_p): - * continue - * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): # <<<<<<<<<<<<<< - * continue - * img[i, j] = field[fi] - */ - } - - /* "yt/utilities/lib/pixelization_routines.pyx":483 - * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): - * continue - * img[i, j] = field[fi] # <<<<<<<<<<<<<< - * return img - * - */ - __pyx_t_23 = __pyx_v_fi; - __pyx_t_24 = __pyx_v_i; - __pyx_t_25 = __pyx_v_j; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_img.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_img.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_img.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_field.diminfo[0].strides)); - __pyx_L8_continue:; - } - } - } - - /* "yt/utilities/lib/pixelization_routines.pyx":484 - * continue - * img[i, j] = field[fi] - * return img # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_img)); - __pyx_r = ((PyObject *)__pyx_v_img); - goto __pyx_L0; - - /* "yt/utilities/lib/pixelization_routines.pyx":391 - * @cython.boundscheck(False) - * @cython.wraparound(False) - * def pixelize_aitoff(np.ndarray[np.float64_t, ndim=1] theta, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] dtheta, - * np.ndarray[np.float64_t, ndim=1] phi, + /* "yt/utilities/lib/pixelization_routines.pyx":487 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pixelize_cylinder(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] radius, + * np.float64_t[:] dradius, */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dphi.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtheta.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_phi.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_theta.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_aitoff", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_cylinder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - goto __pyx_L2; __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dphi.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtheta.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_phi.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_theta.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_img); + __PYX_XDEC_MEMVIEW(&__pyx_v_buff, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_radius, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_dradius, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_theta, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_dtheta, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_field, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/pixelization_routines.pyx":494 - * # results match. Otherwise, it will fill the signs with -1's and 1's to show - * # the sign of the dot product of the point with the cross product of the face. - * cdef int check_face_dot(int nvertices, # <<<<<<<<<<<<<< - * np.float64_t point[3], - * np.float64_t **vertices, +/* "yt/utilities/lib/pixelization_routines.pyx":561 + * theta_i += dthetamin + * + * cdef void aitoff_thetaphi_to_xy(np.float64_t theta, np.float64_t phi, # <<<<<<<<<<<<<< + * np.float64_t *x, np.float64_t *y): + * cdef np.float64_t z = math.sqrt(1 + math.cos(phi) * math.cos(theta / 2.0)) */ -static int __pyx_f_2yt_9utilities_3lib_21pixelization_routines_check_face_dot(int __pyx_v_nvertices, __pyx_t_5numpy_float64_t *__pyx_v_point, __pyx_t_5numpy_float64_t **__pyx_v_vertices, __pyx_t_5numpy_int8_t *__pyx_v_signs, int __pyx_v_match) { - __pyx_t_5numpy_float64_t __pyx_v_vec1[3]; - __pyx_t_5numpy_float64_t __pyx_v_vec2[3]; - __pyx_t_5numpy_float64_t __pyx_v_cp_vec[3]; - __pyx_t_5numpy_float64_t __pyx_v_npoint[3]; - __pyx_t_5numpy_float64_t __pyx_v_dp; - __pyx_t_5numpy_uint8_t __pyx_v_faces[MAX_NUM_FACES][2][2]; - __pyx_t_5numpy_uint8_t __pyx_v_nf; - int __pyx_v_n; - int __pyx_v_vi1a; - int __pyx_v_vi1b; - int __pyx_v_vi2a; - int __pyx_v_vi2b; - int __pyx_r; +static void __pyx_f_2yt_9utilities_3lib_21pixelization_routines_aitoff_thetaphi_to_xy(__pyx_t_5numpy_float64_t __pyx_v_theta, __pyx_t_5numpy_float64_t __pyx_v_phi, __pyx_t_5numpy_float64_t *__pyx_v_x, __pyx_t_5numpy_float64_t *__pyx_v_y) { + __pyx_t_5numpy_float64_t __pyx_v_z; __Pyx_RefNannyDeclarations - __pyx_t_5numpy_uint8_t __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("check_face_dot", 0); - - /* "yt/utilities/lib/pixelization_routines.pyx":511 - * cdef np.uint8_t faces[MAX_NUM_FACES][2][2] - * cdef np.uint8_t nf - * if nvertices == 4: # <<<<<<<<<<<<<< - * faces = tetra_face_defs - * nf = TETRA_NF - */ - switch (__pyx_v_nvertices) { - case 4: - - /* "yt/utilities/lib/pixelization_routines.pyx":512 - * cdef np.uint8_t nf - * if nvertices == 4: - * faces = tetra_face_defs # <<<<<<<<<<<<<< - * nf = TETRA_NF - * elif nvertices == 6: - */ - if (unlikely((MAX_NUM_FACES) != (MAX_NUM_FACES))) { - PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(MAX_NUM_FACES), (Py_ssize_t)(MAX_NUM_FACES)); - __PYX_ERR(0, 512, __pyx_L1_error) - } - memcpy(&(__pyx_v_faces[0]), tetra_face_defs, sizeof(__pyx_v_faces[0]) * (MAX_NUM_FACES)); - - /* "yt/utilities/lib/pixelization_routines.pyx":513 - * if nvertices == 4: - * faces = tetra_face_defs - * nf = TETRA_NF # <<<<<<<<<<<<<< - * elif nvertices == 6: - * faces = wedge_face_defs - */ - __pyx_v_nf = TETRA_NF; - - /* "yt/utilities/lib/pixelization_routines.pyx":511 - * cdef np.uint8_t faces[MAX_NUM_FACES][2][2] - * cdef np.uint8_t nf - * if nvertices == 4: # <<<<<<<<<<<<<< - * faces = tetra_face_defs - * nf = TETRA_NF - */ - break; - - /* "yt/utilities/lib/pixelization_routines.pyx":514 - * faces = tetra_face_defs - * nf = TETRA_NF - * elif nvertices == 6: # <<<<<<<<<<<<<< - * faces = wedge_face_defs - * nf = WEDGE_NF - */ - case 6: + double __pyx_t_1; + __Pyx_RefNannySetupContext("aitoff_thetaphi_to_xy", 0); - /* "yt/utilities/lib/pixelization_routines.pyx":515 - * nf = TETRA_NF - * elif nvertices == 6: - * faces = wedge_face_defs # <<<<<<<<<<<<<< - * nf = WEDGE_NF - * elif nvertices == 8: + /* "yt/utilities/lib/pixelization_routines.pyx":563 + * cdef void aitoff_thetaphi_to_xy(np.float64_t theta, np.float64_t phi, + * np.float64_t *x, np.float64_t *y): + * cdef np.float64_t z = math.sqrt(1 + math.cos(phi) * math.cos(theta / 2.0)) # <<<<<<<<<<<<<< + * x[0] = math.cos(phi) * math.sin(theta / 2.0) / z + * y[0] = math.sin(phi) / z */ - if (unlikely((MAX_NUM_FACES) != (MAX_NUM_FACES))) { - PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(MAX_NUM_FACES), (Py_ssize_t)(MAX_NUM_FACES)); - __PYX_ERR(0, 515, __pyx_L1_error) - } - memcpy(&(__pyx_v_faces[0]), wedge_face_defs, sizeof(__pyx_v_faces[0]) * (MAX_NUM_FACES)); + __pyx_v_z = sqrt((1.0 + (cos(__pyx_v_phi) * cos((__pyx_v_theta / 2.0))))); - /* "yt/utilities/lib/pixelization_routines.pyx":516 - * elif nvertices == 6: - * faces = wedge_face_defs - * nf = WEDGE_NF # <<<<<<<<<<<<<< - * elif nvertices == 8: - * faces = hex_face_defs + /* "yt/utilities/lib/pixelization_routines.pyx":564 + * np.float64_t *x, np.float64_t *y): + * cdef np.float64_t z = math.sqrt(1 + math.cos(phi) * math.cos(theta / 2.0)) + * x[0] = math.cos(phi) * math.sin(theta / 2.0) / z # <<<<<<<<<<<<<< + * y[0] = math.sin(phi) / z + * */ - __pyx_v_nf = WEDGE_NF; + __pyx_t_1 = (cos(__pyx_v_phi) * sin((__pyx_v_theta / 2.0))); + if (unlikely(__pyx_v_z == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + __PYX_ERR(0, 564, __pyx_L1_error) + } + (__pyx_v_x[0]) = (__pyx_t_1 / __pyx_v_z); - /* "yt/utilities/lib/pixelization_routines.pyx":514 - * faces = tetra_face_defs - * nf = TETRA_NF - * elif nvertices == 6: # <<<<<<<<<<<<<< - * faces = wedge_face_defs - * nf = WEDGE_NF + /* "yt/utilities/lib/pixelization_routines.pyx":565 + * cdef np.float64_t z = math.sqrt(1 + math.cos(phi) * math.cos(theta / 2.0)) + * x[0] = math.cos(phi) * math.sin(theta / 2.0) / z + * y[0] = math.sin(phi) / z # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) */ - break; + __pyx_t_1 = sin(__pyx_v_phi); + if (unlikely(__pyx_v_z == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + __PYX_ERR(0, 565, __pyx_L1_error) + } + (__pyx_v_y[0]) = (__pyx_t_1 / __pyx_v_z); - /* "yt/utilities/lib/pixelization_routines.pyx":517 - * faces = wedge_face_defs - * nf = WEDGE_NF - * elif nvertices == 8: # <<<<<<<<<<<<<< - * faces = hex_face_defs - * nf = HEX_NF + /* "yt/utilities/lib/pixelization_routines.pyx":561 + * theta_i += dthetamin + * + * cdef void aitoff_thetaphi_to_xy(np.float64_t theta, np.float64_t phi, # <<<<<<<<<<<<<< + * np.float64_t *x, np.float64_t *y): + * cdef np.float64_t z = math.sqrt(1 + math.cos(phi) * math.cos(theta / 2.0)) */ - case 8: - /* "yt/utilities/lib/pixelization_routines.pyx":518 - * nf = WEDGE_NF - * elif nvertices == 8: - * faces = hex_face_defs # <<<<<<<<<<<<<< - * nf = HEX_NF - * else: - */ - if (unlikely((MAX_NUM_FACES) != (MAX_NUM_FACES))) { - PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(MAX_NUM_FACES), (Py_ssize_t)(MAX_NUM_FACES)); - __PYX_ERR(0, 518, __pyx_L1_error) - } - memcpy(&(__pyx_v_faces[0]), hex_face_defs, sizeof(__pyx_v_faces[0]) * (MAX_NUM_FACES)); + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("yt.utilities.lib.pixelization_routines.aitoff_thetaphi_to_xy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} - /* "yt/utilities/lib/pixelization_routines.pyx":519 - * elif nvertices == 8: - * faces = hex_face_defs - * nf = HEX_NF # <<<<<<<<<<<<<< - * else: - * return -1 +/* "yt/utilities/lib/pixelization_routines.pyx":570 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pixelize_aitoff(np.float64_t[:] theta, # <<<<<<<<<<<<<< + * np.float64_t[:] dtheta, + * np.float64_t[:] phi, */ - __pyx_v_nf = HEX_NF; - /* "yt/utilities/lib/pixelization_routines.pyx":517 - * faces = wedge_face_defs - * nf = WEDGE_NF - * elif nvertices == 8: # <<<<<<<<<<<<<< - * faces = hex_face_defs - * nf = HEX_NF - */ - break; - default: +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_9pixelize_aitoff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_9pixelize_aitoff = {"pixelize_aitoff", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_9pixelize_aitoff, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_9pixelize_aitoff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_theta = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_dtheta = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_phi = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_dphi = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_buff_size = 0; + __Pyx_memviewslice __pyx_v_field = { 0, 0, { 0 }, { 0 }, { 0 } }; + CYTHON_UNUSED PyObject *__pyx_v_extents = 0; + PyObject *__pyx_v_input_img = 0; + __pyx_t_5numpy_float64_t __pyx_v_theta_offset; + __pyx_t_5numpy_float64_t __pyx_v_phi_offset; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pixelize_aitoff (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_theta,&__pyx_n_s_dtheta,&__pyx_n_s_phi,&__pyx_n_s_dphi,&__pyx_n_s_buff_size,&__pyx_n_s_field,&__pyx_n_s_extents,&__pyx_n_s_input_img,&__pyx_n_s_theta_offset,&__pyx_n_s_phi_offset,0}; + PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; - /* "yt/utilities/lib/pixelization_routines.pyx":521 - * nf = HEX_NF - * else: - * return -1 # <<<<<<<<<<<<<< - * cdef int i, j, n, vi1a, vi1b, vi2a, vi2b - * + /* "yt/utilities/lib/pixelization_routines.pyx":576 + * buff_size, + * np.float64_t[:] field, + * extents, input_img = None, # <<<<<<<<<<<<<< + * np.float64_t theta_offset = 0.0, + * np.float64_t phi_offset = 0.0): */ - __pyx_r = -1; - goto __pyx_L0; - break; + values[7] = ((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 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtheta)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, 1); __PYX_ERR(0, 570, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, 2); __PYX_ERR(0, 570, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dphi)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, 3); __PYX_ERR(0, 570, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buff_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, 4); __PYX_ERR(0, 570, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, 5); __PYX_ERR(0, 570, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extents)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, 6); __PYX_ERR(0, 570, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_img); + if (value) { values[7] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 8: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta_offset); + if (value) { values[8] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_phi_offset); + if (value) { values[9] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_aitoff") < 0)) __PYX_ERR(0, 570, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[4] = PyTuple_GET_ITEM(__pyx_args, 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_theta = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_theta.memview)) __PYX_ERR(0, 570, __pyx_L3_error) + __pyx_v_dtheta = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_dtheta.memview)) __PYX_ERR(0, 571, __pyx_L3_error) + __pyx_v_phi = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_phi.memview)) __PYX_ERR(0, 572, __pyx_L3_error) + __pyx_v_dphi = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_dphi.memview)) __PYX_ERR(0, 573, __pyx_L3_error) + __pyx_v_buff_size = values[4]; + __pyx_v_field = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[5]); if (unlikely(!__pyx_v_field.memview)) __PYX_ERR(0, 575, __pyx_L3_error) + __pyx_v_extents = values[6]; + __pyx_v_input_img = values[7]; + if (values[8]) { + __pyx_v_theta_offset = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_theta_offset == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L3_error) + } else { + __pyx_v_theta_offset = ((__pyx_t_5numpy_float64_t)0.0); + } + if (values[9]) { + __pyx_v_phi_offset = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_phi_offset == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L3_error) + } else { + __pyx_v_phi_offset = ((__pyx_t_5numpy_float64_t)0.0); + } } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pixelize_aitoff", 0, 7, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 570, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_aitoff", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_2yt_9utilities_3lib_21pixelization_routines_8pixelize_aitoff(__pyx_self, __pyx_v_theta, __pyx_v_dtheta, __pyx_v_phi, __pyx_v_dphi, __pyx_v_buff_size, __pyx_v_field, __pyx_v_extents, __pyx_v_input_img, __pyx_v_theta_offset, __pyx_v_phi_offset); - /* "yt/utilities/lib/pixelization_routines.pyx":524 - * cdef int i, j, n, vi1a, vi1b, vi2a, vi2b - * - * for n in range(nf): # <<<<<<<<<<<<<< - * vi1a = faces[n][0][0] - * vi1b = faces[n][0][1] + /* "yt/utilities/lib/pixelization_routines.pyx":570 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pixelize_aitoff(np.float64_t[:] theta, # <<<<<<<<<<<<<< + * np.float64_t[:] dtheta, + * np.float64_t[:] phi, */ - __pyx_t_1 = __pyx_v_nf; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_n = __pyx_t_2; - /* "yt/utilities/lib/pixelization_routines.pyx":525 - * - * for n in range(nf): - * vi1a = faces[n][0][0] # <<<<<<<<<<<<<< - * vi1b = faces[n][0][1] - * vi2a = faces[n][1][0] - */ - __pyx_v_vi1a = (((__pyx_v_faces[__pyx_v_n])[0])[0]); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/pixelization_routines.pyx":526 - * for n in range(nf): - * vi1a = faces[n][0][0] - * vi1b = faces[n][0][1] # <<<<<<<<<<<<<< - * vi2a = faces[n][1][0] - * vi2b = faces[n][1][1] - */ - __pyx_v_vi1b = (((__pyx_v_faces[__pyx_v_n])[0])[1]); +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_8pixelize_aitoff(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_theta, __Pyx_memviewslice __pyx_v_dtheta, __Pyx_memviewslice __pyx_v_phi, __Pyx_memviewslice __pyx_v_dphi, PyObject *__pyx_v_buff_size, __Pyx_memviewslice __pyx_v_field, CYTHON_UNUSED PyObject *__pyx_v_extents, PyObject *__pyx_v_input_img, __pyx_t_5numpy_float64_t __pyx_v_theta_offset, __pyx_t_5numpy_float64_t __pyx_v_phi_offset) { + PyArrayObject *__pyx_v_img = 0; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_v_nf; + int __pyx_v_fi; + __pyx_t_5numpy_float64_t __pyx_v_x; + __pyx_t_5numpy_float64_t __pyx_v_y; + __pyx_t_5numpy_float64_t __pyx_v_z; + __pyx_t_5numpy_float64_t __pyx_v_zb; + __pyx_t_5numpy_float64_t __pyx_v_dx; + __pyx_t_5numpy_float64_t __pyx_v_dy; + __pyx_t_5numpy_float64_t __pyx_v_theta0; + __pyx_t_5numpy_float64_t __pyx_v_phi0; + __pyx_t_5numpy_float64_t __pyx_v_theta_p; + __pyx_t_5numpy_float64_t __pyx_v_dtheta_p; + __pyx_t_5numpy_float64_t __pyx_v_phi_p; + __pyx_t_5numpy_float64_t __pyx_v_dphi_p; + __pyx_t_5numpy_float64_t __pyx_v_PI; + __pyx_t_5numpy_float64_t __pyx_v_s2; + __pyx_t_5numpy_float64_t __pyx_v_xmax; + __pyx_t_5numpy_float64_t __pyx_v_ymax; + __pyx_t_5numpy_float64_t __pyx_v_xmin; + __pyx_t_5numpy_float64_t __pyx_v_ymin; + int __pyx_v_x0; + long __pyx_v_x1; + int __pyx_v_y0; + long __pyx_v_y1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_img; + __Pyx_Buffer __pyx_pybuffer_img; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __pyx_t_5numpy_float64_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; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + 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; + long __pyx_t_19; + int __pyx_t_20; + long __pyx_t_21; + int __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + __Pyx_RefNannySetupContext("pixelize_aitoff", 0); + __pyx_pybuffer_img.pybuffer.buf = NULL; + __pyx_pybuffer_img.refcount = 0; + __pyx_pybuffernd_img.data = NULL; + __pyx_pybuffernd_img.rcbuffer = &__pyx_pybuffer_img; - /* "yt/utilities/lib/pixelization_routines.pyx":527 - * vi1a = faces[n][0][0] - * vi1b = faces[n][0][1] - * vi2a = faces[n][1][0] # <<<<<<<<<<<<<< - * vi2b = faces[n][1][1] - * # Shared vertex is vi1a and vi2a + /* "yt/utilities/lib/pixelization_routines.pyx":590 + * cdef np.float64_t dx, dy + * cdef np.float64_t theta0, phi0, theta_p, dtheta_p, phi_p, dphi_p + * cdef np.float64_t PI = np.pi # <<<<<<<<<<<<<< + * cdef np.float64_t s2 = math.sqrt(2.0) + * cdef np.float64_t xmax, ymax, xmin, ymin */ - __pyx_v_vi2a = (((__pyx_v_faces[__pyx_v_n])[1])[0]); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_PI = __pyx_t_3; - /* "yt/utilities/lib/pixelization_routines.pyx":528 - * vi1b = faces[n][0][1] - * vi2a = faces[n][1][0] - * vi2b = faces[n][1][1] # <<<<<<<<<<<<<< - * # Shared vertex is vi1a and vi2a - * subtract(vertices[vi1b], vertices[vi1a], vec1) + /* "yt/utilities/lib/pixelization_routines.pyx":591 + * cdef np.float64_t theta0, phi0, theta_p, dtheta_p, phi_p, dphi_p + * cdef np.float64_t PI = np.pi + * cdef np.float64_t s2 = math.sqrt(2.0) # <<<<<<<<<<<<<< + * cdef np.float64_t xmax, ymax, xmin, ymin + * nf = field.shape[0] */ - __pyx_v_vi2b = (((__pyx_v_faces[__pyx_v_n])[1])[1]); + __pyx_v_s2 = sqrt(2.0); - /* "yt/utilities/lib/pixelization_routines.pyx":530 - * vi2b = faces[n][1][1] - * # Shared vertex is vi1a and vi2a - * subtract(vertices[vi1b], vertices[vi1a], vec1) # <<<<<<<<<<<<<< - * subtract(vertices[vi2b], vertices[vi2a], vec2) - * subtract(point, vertices[vi1b], npoint) + /* "yt/utilities/lib/pixelization_routines.pyx":593 + * cdef np.float64_t s2 = math.sqrt(2.0) + * cdef np.float64_t xmax, ymax, xmin, ymin + * nf = field.shape[0] # <<<<<<<<<<<<<< + * + * if input_img is None: */ - __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract((__pyx_v_vertices[__pyx_v_vi1b]), (__pyx_v_vertices[__pyx_v_vi1a]), __pyx_v_vec1); + __pyx_v_nf = (__pyx_v_field.shape[0]); - /* "yt/utilities/lib/pixelization_routines.pyx":531 - * # Shared vertex is vi1a and vi2a - * subtract(vertices[vi1b], vertices[vi1a], vec1) - * subtract(vertices[vi2b], vertices[vi2a], vec2) # <<<<<<<<<<<<<< - * subtract(point, vertices[vi1b], npoint) - * cross(vec1, vec2, cp_vec) + /* "yt/utilities/lib/pixelization_routines.pyx":595 + * nf = field.shape[0] + * + * if input_img is None: # <<<<<<<<<<<<<< + * img = np.zeros((buff_size[0], buff_size[1])) + * img[:] = np.nan */ - __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract((__pyx_v_vertices[__pyx_v_vi2b]), (__pyx_v_vertices[__pyx_v_vi2a]), __pyx_v_vec2); + __pyx_t_4 = (__pyx_v_input_img == Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { - /* "yt/utilities/lib/pixelization_routines.pyx":532 - * subtract(vertices[vi1b], vertices[vi1a], vec1) - * subtract(vertices[vi2b], vertices[vi2a], vec2) - * subtract(point, vertices[vi1b], npoint) # <<<<<<<<<<<<<< - * cross(vec1, vec2, cp_vec) - * dp = dot(cp_vec, npoint) - */ - __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(__pyx_v_point, (__pyx_v_vertices[__pyx_v_vi1b]), __pyx_v_npoint); - - /* "yt/utilities/lib/pixelization_routines.pyx":533 - * subtract(vertices[vi2b], vertices[vi2a], vec2) - * subtract(point, vertices[vi1b], npoint) - * cross(vec1, vec2, cp_vec) # <<<<<<<<<<<<<< - * dp = dot(cp_vec, npoint) - * if match == 0: + /* "yt/utilities/lib/pixelization_routines.pyx":596 + * + * if input_img is None: + * img = np.zeros((buff_size[0], buff_size[1])) # <<<<<<<<<<<<<< + * img[:] = np.nan + * else: */ - __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(__pyx_v_vec1, __pyx_v_vec2, __pyx_v_cp_vec); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_buff_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_buff_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); + __pyx_t_1 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + if (!__pyx_t_7) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __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_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + { + __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL; + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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, 596, __pyx_L1_error) + __pyx_t_9 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_v_img, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_img.diminfo[0].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_img.diminfo[0].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_img.diminfo[1].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_img.diminfo[1].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 596, __pyx_L1_error) + } + __pyx_t_9 = 0; + __pyx_v_img = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; - /* "yt/utilities/lib/pixelization_routines.pyx":534 - * subtract(point, vertices[vi1b], npoint) - * cross(vec1, vec2, cp_vec) - * dp = dot(cp_vec, npoint) # <<<<<<<<<<<<<< - * if match == 0: - * if dp < 0: + /* "yt/utilities/lib/pixelization_routines.pyx":597 + * if input_img is None: + * img = np.zeros((buff_size[0], buff_size[1])) + * img[:] = np.nan # <<<<<<<<<<<<<< + * else: + * img = input_img */ - __pyx_v_dp = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_cp_vec, __pyx_v_npoint); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_img), __pyx_slice__4, __pyx_t_6) < 0)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "yt/utilities/lib/pixelization_routines.pyx":535 - * cross(vec1, vec2, cp_vec) - * dp = dot(cp_vec, npoint) - * if match == 0: # <<<<<<<<<<<<<< - * if dp < 0: - * signs[n] = -1 + /* "yt/utilities/lib/pixelization_routines.pyx":595 + * nf = field.shape[0] + * + * if input_img is None: # <<<<<<<<<<<<<< + * img = np.zeros((buff_size[0], buff_size[1])) + * img[:] = np.nan */ - __pyx_t_3 = ((__pyx_v_match == 0) != 0); - if (__pyx_t_3) { + goto __pyx_L3; + } - /* "yt/utilities/lib/pixelization_routines.pyx":536 - * dp = dot(cp_vec, npoint) - * if match == 0: - * if dp < 0: # <<<<<<<<<<<<<< - * signs[n] = -1 - * else: + /* "yt/utilities/lib/pixelization_routines.pyx":599 + * img[:] = np.nan + * else: + * img = input_img # <<<<<<<<<<<<<< + * # Okay, here's our strategy. We compute the bounds in x and y, which will + * # be a rectangle, and then for each x, y position we check to see if it's */ - __pyx_t_3 = ((__pyx_v_dp < 0.0) != 0); - if (__pyx_t_3) { + /*else*/ { + if (!(likely(((__pyx_v_input_img) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_input_img, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_6 = __pyx_v_input_img; + __Pyx_INCREF(__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_6), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_v_img, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_img.diminfo[0].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_img.diminfo[0].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_img.diminfo[1].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_img.diminfo[1].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 599, __pyx_L1_error) + } + __pyx_v_img = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + } + __pyx_L3:; - /* "yt/utilities/lib/pixelization_routines.pyx":537 - * if match == 0: - * if dp < 0: - * signs[n] = -1 # <<<<<<<<<<<<<< - * else: - * signs[n] = 1 + /* "yt/utilities/lib/pixelization_routines.pyx":605 + * # (x,y)->(theta,phi) calculation, but because we no longer have to search + * # through the theta, phi arrays, it should be faster. + * dx = 2.0 / (img.shape[0] - 1) # <<<<<<<<<<<<<< + * dy = 2.0 / (img.shape[1] - 1) + * x = y = 0 */ - (__pyx_v_signs[__pyx_v_n]) = -1; + __pyx_v_dx = (2.0 / ((__pyx_v_img->dimensions[0]) - 1)); - /* "yt/utilities/lib/pixelization_routines.pyx":536 - * dp = dot(cp_vec, npoint) - * if match == 0: - * if dp < 0: # <<<<<<<<<<<<<< - * signs[n] = -1 - * else: + /* "yt/utilities/lib/pixelization_routines.pyx":606 + * # through the theta, phi arrays, it should be faster. + * dx = 2.0 / (img.shape[0] - 1) + * dy = 2.0 / (img.shape[1] - 1) # <<<<<<<<<<<<<< + * x = y = 0 + * for fi in range(nf): */ - goto __pyx_L6; - } + __pyx_v_dy = (2.0 / ((__pyx_v_img->dimensions[1]) - 1)); - /* "yt/utilities/lib/pixelization_routines.pyx":539 - * signs[n] = -1 - * else: - * signs[n] = 1 # <<<<<<<<<<<<<< - * else: - * if dp <= 0 and signs[n] < 0: + /* "yt/utilities/lib/pixelization_routines.pyx":607 + * dx = 2.0 / (img.shape[0] - 1) + * dy = 2.0 / (img.shape[1] - 1) + * x = y = 0 # <<<<<<<<<<<<<< + * for fi in range(nf): + * theta_p = (theta[fi] + theta_offset) - PI */ - /*else*/ { - (__pyx_v_signs[__pyx_v_n]) = 1; - } - __pyx_L6:; + __pyx_v_x = 0.0; + __pyx_v_y = 0.0; - /* "yt/utilities/lib/pixelization_routines.pyx":535 - * cross(vec1, vec2, cp_vec) - * dp = dot(cp_vec, npoint) - * if match == 0: # <<<<<<<<<<<<<< - * if dp < 0: - * signs[n] = -1 + /* "yt/utilities/lib/pixelization_routines.pyx":608 + * dy = 2.0 / (img.shape[1] - 1) + * x = y = 0 + * for fi in range(nf): # <<<<<<<<<<<<<< + * theta_p = (theta[fi] + theta_offset) - PI + * dtheta_p = dtheta[fi] */ - goto __pyx_L5; - } + __pyx_t_10 = __pyx_v_nf; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) { + __pyx_v_fi = __pyx_t_14; - /* "yt/utilities/lib/pixelization_routines.pyx":541 - * signs[n] = 1 - * else: - * if dp <= 0 and signs[n] < 0: # <<<<<<<<<<<<<< - * continue - * elif dp >= 0 and signs[n] > 0: + /* "yt/utilities/lib/pixelization_routines.pyx":609 + * x = y = 0 + * for fi in range(nf): + * theta_p = (theta[fi] + theta_offset) - PI # <<<<<<<<<<<<<< + * dtheta_p = dtheta[fi] + * phi_p = (phi[fi] + phi_offset) - PI/2.0 */ - /*else*/ { - __pyx_t_4 = ((__pyx_v_dp <= 0.0) != 0); - if (__pyx_t_4) { - } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L8_bool_binop_done; - } - __pyx_t_4 = (((__pyx_v_signs[__pyx_v_n]) < 0) != 0); - __pyx_t_3 = __pyx_t_4; - __pyx_L8_bool_binop_done:; - if (__pyx_t_3) { + __pyx_t_15 = __pyx_v_fi; + __pyx_v_theta_p = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_theta.data + __pyx_t_15 * __pyx_v_theta.strides[0]) ))) + __pyx_v_theta_offset) - __pyx_v_PI); - /* "yt/utilities/lib/pixelization_routines.pyx":542 - * else: - * if dp <= 0 and signs[n] < 0: - * continue # <<<<<<<<<<<<<< - * elif dp >= 0 and signs[n] > 0: - * continue + /* "yt/utilities/lib/pixelization_routines.pyx":610 + * for fi in range(nf): + * theta_p = (theta[fi] + theta_offset) - PI + * dtheta_p = dtheta[fi] # <<<<<<<<<<<<<< + * phi_p = (phi[fi] + phi_offset) - PI/2.0 + * dphi_p = dphi[fi] */ - goto __pyx_L3_continue; + __pyx_t_16 = __pyx_v_fi; + __pyx_v_dtheta_p = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_dtheta.data + __pyx_t_16 * __pyx_v_dtheta.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":541 - * signs[n] = 1 - * else: - * if dp <= 0 and signs[n] < 0: # <<<<<<<<<<<<<< - * continue - * elif dp >= 0 and signs[n] > 0: + /* "yt/utilities/lib/pixelization_routines.pyx":611 + * theta_p = (theta[fi] + theta_offset) - PI + * dtheta_p = dtheta[fi] + * phi_p = (phi[fi] + phi_offset) - PI/2.0 # <<<<<<<<<<<<<< + * dphi_p = dphi[fi] + * # Four transformations */ - } + __pyx_t_17 = __pyx_v_fi; + __pyx_v_phi_p = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_phi.data + __pyx_t_17 * __pyx_v_phi.strides[0]) ))) + __pyx_v_phi_offset) - (__pyx_v_PI / 2.0)); - /* "yt/utilities/lib/pixelization_routines.pyx":543 - * if dp <= 0 and signs[n] < 0: - * continue - * elif dp >= 0 and signs[n] > 0: # <<<<<<<<<<<<<< - * continue - * else: # mismatch! + /* "yt/utilities/lib/pixelization_routines.pyx":612 + * dtheta_p = dtheta[fi] + * phi_p = (phi[fi] + phi_offset) - PI/2.0 + * dphi_p = dphi[fi] # <<<<<<<<<<<<<< + * # Four transformations + * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p - dphi_p, &x, &y) */ - __pyx_t_4 = ((__pyx_v_dp >= 0.0) != 0); - if (__pyx_t_4) { - } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L10_bool_binop_done; - } - __pyx_t_4 = (((__pyx_v_signs[__pyx_v_n]) > 0) != 0); - __pyx_t_3 = __pyx_t_4; - __pyx_L10_bool_binop_done:; - if (__pyx_t_3) { + __pyx_t_18 = __pyx_v_fi; + __pyx_v_dphi_p = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_dphi.data + __pyx_t_18 * __pyx_v_dphi.strides[0]) ))); - /* "yt/utilities/lib/pixelization_routines.pyx":544 - * continue - * elif dp >= 0 and signs[n] > 0: - * continue # <<<<<<<<<<<<<< - * else: # mismatch! - * return 0 + /* "yt/utilities/lib/pixelization_routines.pyx":614 + * dphi_p = dphi[fi] + * # Four transformations + * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p - dphi_p, &x, &y) # <<<<<<<<<<<<<< + * xmin = x + * xmax = x */ - goto __pyx_L3_continue; + __pyx_f_2yt_9utilities_3lib_21pixelization_routines_aitoff_thetaphi_to_xy((__pyx_v_theta_p - __pyx_v_dtheta_p), (__pyx_v_phi_p - __pyx_v_dphi_p), (&__pyx_v_x), (&__pyx_v_y)); - /* "yt/utilities/lib/pixelization_routines.pyx":543 - * if dp <= 0 and signs[n] < 0: - * continue - * elif dp >= 0 and signs[n] > 0: # <<<<<<<<<<<<<< - * continue - * else: # mismatch! + /* "yt/utilities/lib/pixelization_routines.pyx":615 + * # Four transformations + * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p - dphi_p, &x, &y) + * xmin = x # <<<<<<<<<<<<<< + * xmax = x + * ymin = y */ - } + __pyx_v_xmin = __pyx_v_x; - /* "yt/utilities/lib/pixelization_routines.pyx":546 - * continue - * else: # mismatch! - * return 0 # <<<<<<<<<<<<<< - * return 1 - * + /* "yt/utilities/lib/pixelization_routines.pyx":616 + * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p - dphi_p, &x, &y) + * xmin = x + * xmax = x # <<<<<<<<<<<<<< + * ymin = y + * ymax = y */ - /*else*/ { - __pyx_r = 0; - goto __pyx_L0; - } - } - __pyx_L5:; - __pyx_L3_continue:; - } + __pyx_v_xmax = __pyx_v_x; - /* "yt/utilities/lib/pixelization_routines.pyx":547 - * else: # mismatch! - * return 0 - * return 1 # <<<<<<<<<<<<<< - * - * + /* "yt/utilities/lib/pixelization_routines.pyx":617 + * xmin = x + * xmax = x + * ymin = y # <<<<<<<<<<<<<< + * ymax = y + * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p + dphi_p, &x, &y) */ - __pyx_r = 1; - goto __pyx_L0; + __pyx_v_ymin = __pyx_v_y; - /* "yt/utilities/lib/pixelization_routines.pyx":494 - * # results match. Otherwise, it will fill the signs with -1's and 1's to show - * # the sign of the dot product of the point with the cross product of the face. - * cdef int check_face_dot(int nvertices, # <<<<<<<<<<<<<< - * np.float64_t point[3], - * np.float64_t **vertices, + /* "yt/utilities/lib/pixelization_routines.pyx":618 + * xmax = x + * ymin = y + * ymax = y # <<<<<<<<<<<<<< + * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p + dphi_p, &x, &y) + * xmin = fmin(xmin, x) */ + __pyx_v_ymax = __pyx_v_y; - /* function exit code */ - __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.utilities.lib.pixelization_routines.check_face_dot", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "yt/utilities/lib/pixelization_routines.pyx":619 + * ymin = y + * ymax = y + * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p + dphi_p, &x, &y) # <<<<<<<<<<<<<< + * xmin = fmin(xmin, x) + * xmax = fmax(xmax, x) + */ + __pyx_f_2yt_9utilities_3lib_21pixelization_routines_aitoff_thetaphi_to_xy((__pyx_v_theta_p - __pyx_v_dtheta_p), (__pyx_v_phi_p + __pyx_v_dphi_p), (&__pyx_v_x), (&__pyx_v_y)); -/* "yt/utilities/lib/pixelization_routines.pyx":550 - * - * - * def pixelize_element_mesh(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< - * np.ndarray[np.int64_t, ndim=2] conn, - * buff_size, + /* "yt/utilities/lib/pixelization_routines.pyx":620 + * ymax = y + * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p + dphi_p, &x, &y) + * xmin = fmin(xmin, x) # <<<<<<<<<<<<<< + * xmax = fmax(xmax, x) + * ymin = fmin(ymin, y) */ + __pyx_v_xmin = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_xmin, __pyx_v_x); -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_9pixelize_element_mesh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_9pixelize_element_mesh = {"pixelize_element_mesh", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_9pixelize_element_mesh, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_9pixelize_element_mesh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_coords = 0; - PyArrayObject *__pyx_v_conn = 0; - PyObject *__pyx_v_buff_size = 0; - PyArrayObject *__pyx_v_field = 0; - PyObject *__pyx_v_extents = 0; - int __pyx_v_index_offset; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("pixelize_element_mesh (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coords,&__pyx_n_s_conn,&__pyx_n_s_buff_size,&__pyx_n_s_field,&__pyx_n_s_extents,&__pyx_n_s_index_offset,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conn)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh", 0, 5, 6, 1); __PYX_ERR(0, 550, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buff_size)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh", 0, 5, 6, 2); __PYX_ERR(0, 550, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh", 0, 5, 6, 3); __PYX_ERR(0, 550, __pyx_L3_error) - } - case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extents)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh", 0, 5, 6, 4); __PYX_ERR(0, 550, __pyx_L3_error) - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index_offset); - if (value) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_element_mesh") < 0)) __PYX_ERR(0, 550, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 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_coords = ((PyArrayObject *)values[0]); - __pyx_v_conn = ((PyArrayObject *)values[1]); - __pyx_v_buff_size = values[2]; - __pyx_v_field = ((PyArrayObject *)values[3]); - __pyx_v_extents = values[4]; - if (values[5]) { - __pyx_v_index_offset = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_index_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L3_error) - } else { - __pyx_v_index_offset = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 550, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_element_mesh", __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, 550, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_ptype_5numpy_ndarray, 1, "conn", 0))) __PYX_ERR(0, 551, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_5numpy_ndarray, 1, "field", 0))) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_21pixelization_routines_8pixelize_element_mesh(__pyx_self, __pyx_v_coords, __pyx_v_conn, __pyx_v_buff_size, __pyx_v_field, __pyx_v_extents, __pyx_v_index_offset); + /* "yt/utilities/lib/pixelization_routines.pyx":621 + * aitoff_thetaphi_to_xy(theta_p - dtheta_p, phi_p + dphi_p, &x, &y) + * xmin = fmin(xmin, x) + * xmax = fmax(xmax, x) # <<<<<<<<<<<<<< + * ymin = fmin(ymin, y) + * ymax = fmax(ymax, y) + */ + __pyx_v_xmax = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_xmax, __pyx_v_x); - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "yt/utilities/lib/pixelization_routines.pyx":622 + * xmin = fmin(xmin, x) + * xmax = fmax(xmax, x) + * ymin = fmin(ymin, y) # <<<<<<<<<<<<<< + * ymax = fmax(ymax, y) + * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p - dphi_p, &x, &y) + */ + __pyx_v_ymin = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_ymin, __pyx_v_y); -static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_8pixelize_element_mesh(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords, PyArrayObject *__pyx_v_conn, PyObject *__pyx_v_buff_size, PyArrayObject *__pyx_v_field, PyObject *__pyx_v_extents, int __pyx_v_index_offset) { - PyArrayObject *__pyx_v_img = 0; - __pyx_t_5numpy_float64_t __pyx_v_pLE[3]; - __pyx_t_5numpy_float64_t __pyx_v_pRE[3]; - __pyx_t_5numpy_float64_t __pyx_v_LE[3]; - __pyx_t_5numpy_float64_t __pyx_v_RE[3]; - int __pyx_v_use; - __pyx_t_5numpy_int64_t __pyx_v_n; - __pyx_t_5numpy_int64_t __pyx_v_i; - __pyx_t_5numpy_int64_t __pyx_v_pi; - __pyx_t_5numpy_int64_t __pyx_v_pj; - __pyx_t_5numpy_int64_t __pyx_v_pk; - __pyx_t_5numpy_int64_t __pyx_v_ci; - __pyx_t_5numpy_int64_t __pyx_v_cj; - __pyx_t_5numpy_int64_t __pyx_v_pstart[3]; - __pyx_t_5numpy_int64_t __pyx_v_pend[3]; - __pyx_t_5numpy_float64_t __pyx_v_ppoint[3]; - __pyx_t_5numpy_float64_t __pyx_v_idds[3]; - __pyx_t_5numpy_float64_t __pyx_v_dds[3]; - __pyx_t_5numpy_float64_t *__pyx_v_vertices; - __pyx_t_5numpy_float64_t *__pyx_v_field_vals; - int __pyx_v_nvertices; - int __pyx_v_ndim; - int __pyx_v_num_field_vals; - double __pyx_v_mapped_coord[4]; - struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_sampler = 0; - __Pyx_LocalBuf_ND __pyx_pybuffernd_conn; - __Pyx_Buffer __pyx_pybuffer_conn; - __Pyx_LocalBuf_ND __pyx_pybuffernd_coords; - __Pyx_Buffer __pyx_pybuffer_coords; - __Pyx_LocalBuf_ND __pyx_pybuffernd_field; - __Pyx_Buffer __pyx_pybuffer_field; - __Pyx_LocalBuf_ND __pyx_pybuffernd_img; - __Pyx_Buffer __pyx_pybuffer_img; - 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; - PyArrayObject *__pyx_t_5 = NULL; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - __pyx_t_5numpy_int64_t __pyx_t_14; - __pyx_t_5numpy_float64_t __pyx_t_15; - npy_intp __pyx_t_16; - __pyx_t_5numpy_int64_t __pyx_t_17; - __pyx_t_5numpy_int64_t __pyx_t_18; - __pyx_t_5numpy_int64_t __pyx_t_19; - __pyx_t_5numpy_int64_t __pyx_t_20; - __pyx_t_5numpy_int64_t __pyx_t_21; - int __pyx_t_22; - __pyx_t_5numpy_int64_t __pyx_t_23; - __pyx_t_5numpy_int64_t __pyx_t_24; - __pyx_t_5numpy_int64_t __pyx_t_25; - __pyx_t_5numpy_int64_t __pyx_t_26; - __pyx_t_5numpy_int64_t __pyx_t_27; - __pyx_t_5numpy_int64_t __pyx_t_28; - __pyx_t_5numpy_int64_t __pyx_t_29; - __pyx_t_5numpy_int64_t __pyx_t_30; - __pyx_t_5numpy_int64_t __pyx_t_31; - __pyx_t_5numpy_int64_t __pyx_t_32; - __pyx_t_5numpy_int64_t __pyx_t_33; - __pyx_t_5numpy_int64_t __pyx_t_34; - __pyx_t_5numpy_int64_t __pyx_t_35; - __Pyx_RefNannySetupContext("pixelize_element_mesh", 0); - __pyx_pybuffer_img.pybuffer.buf = NULL; - __pyx_pybuffer_img.refcount = 0; - __pyx_pybuffernd_img.data = NULL; - __pyx_pybuffernd_img.rcbuffer = &__pyx_pybuffer_img; - __pyx_pybuffer_coords.pybuffer.buf = NULL; - __pyx_pybuffer_coords.refcount = 0; - __pyx_pybuffernd_coords.data = NULL; - __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords; - __pyx_pybuffer_conn.pybuffer.buf = NULL; - __pyx_pybuffer_conn.refcount = 0; - __pyx_pybuffernd_conn.data = NULL; - __pyx_pybuffernd_conn.rcbuffer = &__pyx_pybuffer_conn; - __pyx_pybuffer_field.pybuffer.buf = NULL; - __pyx_pybuffer_field.refcount = 0; - __pyx_pybuffernd_field.data = NULL; - __pyx_pybuffernd_field.rcbuffer = &__pyx_pybuffer_field; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 550, __pyx_L1_error) - } - __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conn.rcbuffer->pybuffer, (PyObject*)__pyx_v_conn, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 550, __pyx_L1_error) - } - __pyx_pybuffernd_conn.diminfo[0].strides = __pyx_pybuffernd_conn.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conn.diminfo[0].shape = __pyx_pybuffernd_conn.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conn.diminfo[1].strides = __pyx_pybuffernd_conn.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conn.diminfo[1].shape = __pyx_pybuffernd_conn.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 550, __pyx_L1_error) - } - __pyx_pybuffernd_field.diminfo[0].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field.diminfo[0].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_field.diminfo[1].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_field.diminfo[1].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[1]; + /* "yt/utilities/lib/pixelization_routines.pyx":623 + * xmax = fmax(xmax, x) + * ymin = fmin(ymin, y) + * ymax = fmax(ymax, y) # <<<<<<<<<<<<<< + * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p - dphi_p, &x, &y) + * xmin = fmin(xmin, x) + */ + __pyx_v_ymax = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_ymax, __pyx_v_y); - /* "yt/utilities/lib/pixelization_routines.pyx":557 - * int index_offset = 0): - * cdef np.ndarray[np.float64_t, ndim=3] img - * img = np.zeros(buff_size, dtype="float64") # <<<<<<<<<<<<<< - * # Two steps: - * # 1. Is image point within the mesh bounding box? + /* "yt/utilities/lib/pixelization_routines.pyx":624 + * ymin = fmin(ymin, y) + * ymax = fmax(ymax, y) + * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p - dphi_p, &x, &y) # <<<<<<<<<<<<<< + * xmin = fmin(xmin, x) + * xmax = fmax(xmax, x) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __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, 557, __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, 557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_buff_size); - __Pyx_GIVEREF(__pyx_v_buff_size); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_buff_size); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 557, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 557, __pyx_L1_error) - __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); - __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack); - if (unlikely(__pyx_t_6 < 0)) { - PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_v_img, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); - } - } - __pyx_pybuffernd_img.diminfo[0].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_img.diminfo[0].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_img.diminfo[1].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_img.diminfo[1].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_img.diminfo[2].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_img.diminfo[2].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 557, __pyx_L1_error) - } - __pyx_t_5 = 0; - __pyx_v_img = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_f_2yt_9utilities_3lib_21pixelization_routines_aitoff_thetaphi_to_xy((__pyx_v_theta_p + __pyx_v_dtheta_p), (__pyx_v_phi_p - __pyx_v_dphi_p), (&__pyx_v_x), (&__pyx_v_y)); - /* "yt/utilities/lib/pixelization_routines.pyx":578 - * cdef np.float64_t *vertices - * cdef np.float64_t *field_vals - * cdef int nvertices = conn.shape[1] # <<<<<<<<<<<<<< - * cdef int ndim = coords.shape[1] - * cdef int num_field_vals = field.shape[1] + /* "yt/utilities/lib/pixelization_routines.pyx":625 + * ymax = fmax(ymax, y) + * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p - dphi_p, &x, &y) + * xmin = fmin(xmin, x) # <<<<<<<<<<<<<< + * xmax = fmax(xmax, x) + * ymin = fmin(ymin, y) */ - __pyx_v_nvertices = (__pyx_v_conn->dimensions[1]); + __pyx_v_xmin = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_xmin, __pyx_v_x); - /* "yt/utilities/lib/pixelization_routines.pyx":579 - * cdef np.float64_t *field_vals - * cdef int nvertices = conn.shape[1] - * cdef int ndim = coords.shape[1] # <<<<<<<<<<<<<< - * cdef int num_field_vals = field.shape[1] - * cdef double[4] mapped_coord + /* "yt/utilities/lib/pixelization_routines.pyx":626 + * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p - dphi_p, &x, &y) + * xmin = fmin(xmin, x) + * xmax = fmax(xmax, x) # <<<<<<<<<<<<<< + * ymin = fmin(ymin, y) + * ymax = fmax(ymax, y) */ - __pyx_v_ndim = (__pyx_v_coords->dimensions[1]); + __pyx_v_xmax = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_xmax, __pyx_v_x); - /* "yt/utilities/lib/pixelization_routines.pyx":580 - * cdef int nvertices = conn.shape[1] - * cdef int ndim = coords.shape[1] - * cdef int num_field_vals = field.shape[1] # <<<<<<<<<<<<<< - * cdef double[4] mapped_coord - * cdef ElementSampler sampler + /* "yt/utilities/lib/pixelization_routines.pyx":627 + * xmin = fmin(xmin, x) + * xmax = fmax(xmax, x) + * ymin = fmin(ymin, y) # <<<<<<<<<<<<<< + * ymax = fmax(ymax, y) + * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p + dphi_p, &x, &y) */ - __pyx_v_num_field_vals = (__pyx_v_field->dimensions[1]); + __pyx_v_ymin = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_ymin, __pyx_v_y); - /* "yt/utilities/lib/pixelization_routines.pyx":585 - * - * # Pick the right sampler and allocate storage for the mapped coordinate - * if ndim == 3 and nvertices == 4: # <<<<<<<<<<<<<< - * sampler = P1Sampler3D() - * elif ndim == 3 and nvertices == 6: + /* "yt/utilities/lib/pixelization_routines.pyx":628 + * xmax = fmax(xmax, x) + * ymin = fmin(ymin, y) + * ymax = fmax(ymax, y) # <<<<<<<<<<<<<< + * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p + dphi_p, &x, &y) + * xmin = fmin(xmin, x) */ - __pyx_t_11 = ((__pyx_v_ndim == 3) != 0); - if (__pyx_t_11) { - } else { - __pyx_t_10 = __pyx_t_11; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_11 = ((__pyx_v_nvertices == 4) != 0); - __pyx_t_10 = __pyx_t_11; - __pyx_L4_bool_binop_done:; - if (__pyx_t_10) { + __pyx_v_ymax = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_ymax, __pyx_v_y); - /* "yt/utilities/lib/pixelization_routines.pyx":586 - * # Pick the right sampler and allocate storage for the mapped coordinate - * if ndim == 3 and nvertices == 4: - * sampler = P1Sampler3D() # <<<<<<<<<<<<<< - * elif ndim == 3 and nvertices == 6: - * sampler = W1Sampler3D() + /* "yt/utilities/lib/pixelization_routines.pyx":629 + * ymin = fmin(ymin, y) + * ymax = fmax(ymax, y) + * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p + dphi_p, &x, &y) # <<<<<<<<<<<<<< + * xmin = fmin(xmin, x) + * xmax = fmax(xmax, x) */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_f_2yt_9utilities_3lib_21pixelization_routines_aitoff_thetaphi_to_xy((__pyx_v_theta_p + __pyx_v_dtheta_p), (__pyx_v_phi_p + __pyx_v_dphi_p), (&__pyx_v_x), (&__pyx_v_y)); - /* "yt/utilities/lib/pixelization_routines.pyx":585 - * - * # Pick the right sampler and allocate storage for the mapped coordinate - * if ndim == 3 and nvertices == 4: # <<<<<<<<<<<<<< - * sampler = P1Sampler3D() - * elif ndim == 3 and nvertices == 6: + /* "yt/utilities/lib/pixelization_routines.pyx":630 + * ymax = fmax(ymax, y) + * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p + dphi_p, &x, &y) + * xmin = fmin(xmin, x) # <<<<<<<<<<<<<< + * xmax = fmax(xmax, x) + * ymin = fmin(ymin, y) */ - goto __pyx_L3; - } + __pyx_v_xmin = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_xmin, __pyx_v_x); - /* "yt/utilities/lib/pixelization_routines.pyx":587 - * if ndim == 3 and nvertices == 4: - * sampler = P1Sampler3D() - * elif ndim == 3 and nvertices == 6: # <<<<<<<<<<<<<< - * sampler = W1Sampler3D() - * elif ndim == 3 and nvertices == 8: + /* "yt/utilities/lib/pixelization_routines.pyx":631 + * aitoff_thetaphi_to_xy(theta_p + dtheta_p, phi_p + dphi_p, &x, &y) + * xmin = fmin(xmin, x) + * xmax = fmax(xmax, x) # <<<<<<<<<<<<<< + * ymin = fmin(ymin, y) + * ymax = fmax(ymax, y) */ - __pyx_t_11 = ((__pyx_v_ndim == 3) != 0); - if (__pyx_t_11) { - } else { - __pyx_t_10 = __pyx_t_11; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_11 = ((__pyx_v_nvertices == 6) != 0); - __pyx_t_10 = __pyx_t_11; - __pyx_L6_bool_binop_done:; - if (__pyx_t_10) { + __pyx_v_xmax = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_xmax, __pyx_v_x); - /* "yt/utilities/lib/pixelization_routines.pyx":588 - * sampler = P1Sampler3D() - * elif ndim == 3 and nvertices == 6: - * sampler = W1Sampler3D() # <<<<<<<<<<<<<< - * elif ndim == 3 and nvertices == 8: - * sampler = Q1Sampler3D() + /* "yt/utilities/lib/pixelization_routines.pyx":632 + * xmin = fmin(xmin, x) + * xmax = fmax(xmax, x) + * ymin = fmin(ymin, y) # <<<<<<<<<<<<<< + * ymax = fmax(ymax, y) + * # Now we have the (projected rectangular) bounds. */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_ymin = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_v_ymin, __pyx_v_y); - /* "yt/utilities/lib/pixelization_routines.pyx":587 - * if ndim == 3 and nvertices == 4: - * sampler = P1Sampler3D() - * elif ndim == 3 and nvertices == 6: # <<<<<<<<<<<<<< - * sampler = W1Sampler3D() - * elif ndim == 3 and nvertices == 8: + /* "yt/utilities/lib/pixelization_routines.pyx":633 + * xmax = fmax(xmax, x) + * ymin = fmin(ymin, y) + * ymax = fmax(ymax, y) # <<<<<<<<<<<<<< + * # Now we have the (projected rectangular) bounds. + * xmin = (xmin + 1) # Get this into normalized image coords */ - goto __pyx_L3; - } + __pyx_v_ymax = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_ymax, __pyx_v_y); - /* "yt/utilities/lib/pixelization_routines.pyx":589 - * elif ndim == 3 and nvertices == 6: - * sampler = W1Sampler3D() - * elif ndim == 3 and nvertices == 8: # <<<<<<<<<<<<<< - * sampler = Q1Sampler3D() - * elif ndim == 3 and nvertices == 20: + /* "yt/utilities/lib/pixelization_routines.pyx":635 + * ymax = fmax(ymax, y) + * # Now we have the (projected rectangular) bounds. + * xmin = (xmin + 1) # Get this into normalized image coords # <<<<<<<<<<<<<< + * xmax = (xmax + 1) # Get this into normalized image coords + * ymin = (ymin + 1) # Get this into normalized image coords */ - __pyx_t_11 = ((__pyx_v_ndim == 3) != 0); - if (__pyx_t_11) { - } else { - __pyx_t_10 = __pyx_t_11; - goto __pyx_L8_bool_binop_done; - } - __pyx_t_11 = ((__pyx_v_nvertices == 8) != 0); - __pyx_t_10 = __pyx_t_11; - __pyx_L8_bool_binop_done:; - if (__pyx_t_10) { + __pyx_v_xmin = (__pyx_v_xmin + 1.0); - /* "yt/utilities/lib/pixelization_routines.pyx":590 - * sampler = W1Sampler3D() - * elif ndim == 3 and nvertices == 8: - * sampler = Q1Sampler3D() # <<<<<<<<<<<<<< - * elif ndim == 3 and nvertices == 20: - * sampler = S2Sampler3D() + /* "yt/utilities/lib/pixelization_routines.pyx":636 + * # Now we have the (projected rectangular) bounds. + * xmin = (xmin + 1) # Get this into normalized image coords + * xmax = (xmax + 1) # Get this into normalized image coords # <<<<<<<<<<<<<< + * ymin = (ymin + 1) # Get this into normalized image coords + * ymax = (ymax + 1) # Get this into normalized image coords */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_xmax = (__pyx_v_xmax + 1.0); - /* "yt/utilities/lib/pixelization_routines.pyx":589 - * elif ndim == 3 and nvertices == 6: - * sampler = W1Sampler3D() - * elif ndim == 3 and nvertices == 8: # <<<<<<<<<<<<<< - * sampler = Q1Sampler3D() - * elif ndim == 3 and nvertices == 20: + /* "yt/utilities/lib/pixelization_routines.pyx":637 + * xmin = (xmin + 1) # Get this into normalized image coords + * xmax = (xmax + 1) # Get this into normalized image coords + * ymin = (ymin + 1) # Get this into normalized image coords # <<<<<<<<<<<<<< + * ymax = (ymax + 1) # Get this into normalized image coords + * x0 = (xmin / dx) */ - goto __pyx_L3; - } + __pyx_v_ymin = (__pyx_v_ymin + 1.0); - /* "yt/utilities/lib/pixelization_routines.pyx":591 - * elif ndim == 3 and nvertices == 8: - * sampler = Q1Sampler3D() - * elif ndim == 3 and nvertices == 20: # <<<<<<<<<<<<<< - * sampler = S2Sampler3D() - * elif ndim == 2 and nvertices == 3: + /* "yt/utilities/lib/pixelization_routines.pyx":638 + * xmax = (xmax + 1) # Get this into normalized image coords + * ymin = (ymin + 1) # Get this into normalized image coords + * ymax = (ymax + 1) # Get this into normalized image coords # <<<<<<<<<<<<<< + * x0 = (xmin / dx) + * x1 = (xmax / dx) + 1 */ - __pyx_t_11 = ((__pyx_v_ndim == 3) != 0); - if (__pyx_t_11) { - } else { - __pyx_t_10 = __pyx_t_11; - goto __pyx_L10_bool_binop_done; - } - __pyx_t_11 = ((__pyx_v_nvertices == 20) != 0); - __pyx_t_10 = __pyx_t_11; - __pyx_L10_bool_binop_done:; - if (__pyx_t_10) { + __pyx_v_ymax = (__pyx_v_ymax + 1.0); - /* "yt/utilities/lib/pixelization_routines.pyx":592 - * sampler = Q1Sampler3D() - * elif ndim == 3 and nvertices == 20: - * sampler = S2Sampler3D() # <<<<<<<<<<<<<< - * elif ndim == 2 and nvertices == 3: - * sampler = P1Sampler2D() + /* "yt/utilities/lib/pixelization_routines.pyx":639 + * ymin = (ymin + 1) # Get this into normalized image coords + * ymax = (ymax + 1) # Get this into normalized image coords + * x0 = (xmin / dx) # <<<<<<<<<<<<<< + * x1 = (xmax / dx) + 1 + * y0 = (ymin / dy) */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_x0 = ((int)(__pyx_v_xmin / __pyx_v_dx)); - /* "yt/utilities/lib/pixelization_routines.pyx":591 - * elif ndim == 3 and nvertices == 8: - * sampler = Q1Sampler3D() - * elif ndim == 3 and nvertices == 20: # <<<<<<<<<<<<<< - * sampler = S2Sampler3D() - * elif ndim == 2 and nvertices == 3: + /* "yt/utilities/lib/pixelization_routines.pyx":640 + * ymax = (ymax + 1) # Get this into normalized image coords + * x0 = (xmin / dx) + * x1 = (xmax / dx) + 1 # <<<<<<<<<<<<<< + * y0 = (ymin / dy) + * y1 = (ymax / dy) + 1 */ - goto __pyx_L3; - } + __pyx_v_x1 = (((int)(__pyx_v_xmax / __pyx_v_dx)) + 1); - /* "yt/utilities/lib/pixelization_routines.pyx":593 - * elif ndim == 3 and nvertices == 20: - * sampler = S2Sampler3D() - * elif ndim == 2 and nvertices == 3: # <<<<<<<<<<<<<< - * sampler = P1Sampler2D() - * elif ndim == 2 and nvertices == 4: + /* "yt/utilities/lib/pixelization_routines.pyx":641 + * x0 = (xmin / dx) + * x1 = (xmax / dx) + 1 + * y0 = (ymin / dy) # <<<<<<<<<<<<<< + * y1 = (ymax / dy) + 1 + * for i in range(x0, x1): */ - __pyx_t_11 = ((__pyx_v_ndim == 2) != 0); - if (__pyx_t_11) { - } else { - __pyx_t_10 = __pyx_t_11; - goto __pyx_L12_bool_binop_done; - } - __pyx_t_11 = ((__pyx_v_nvertices == 3) != 0); - __pyx_t_10 = __pyx_t_11; - __pyx_L12_bool_binop_done:; - if (__pyx_t_10) { + __pyx_v_y0 = ((int)(__pyx_v_ymin / __pyx_v_dy)); - /* "yt/utilities/lib/pixelization_routines.pyx":594 - * sampler = S2Sampler3D() - * elif ndim == 2 and nvertices == 3: - * sampler = P1Sampler2D() # <<<<<<<<<<<<<< - * elif ndim == 2 and nvertices == 4: - * sampler = Q1Sampler2D() + /* "yt/utilities/lib/pixelization_routines.pyx":642 + * x1 = (xmax / dx) + 1 + * y0 = (ymin / dy) + * y1 = (ymax / dy) + 1 # <<<<<<<<<<<<<< + * for i in range(x0, x1): + * x = (-1.0 + i*dx)*s2*2.0 */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_y1 = (((int)(__pyx_v_ymax / __pyx_v_dy)) + 1); - /* "yt/utilities/lib/pixelization_routines.pyx":593 - * elif ndim == 3 and nvertices == 20: - * sampler = S2Sampler3D() - * elif ndim == 2 and nvertices == 3: # <<<<<<<<<<<<<< - * sampler = P1Sampler2D() - * elif ndim == 2 and nvertices == 4: + /* "yt/utilities/lib/pixelization_routines.pyx":643 + * y0 = (ymin / dy) + * y1 = (ymax / dy) + 1 + * for i in range(x0, x1): # <<<<<<<<<<<<<< + * x = (-1.0 + i*dx)*s2*2.0 + * for j in range(y0, y1): */ - goto __pyx_L3; - } + __pyx_t_19 = __pyx_v_x1; + for (__pyx_t_20 = __pyx_v_x0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_i = __pyx_t_20; - /* "yt/utilities/lib/pixelization_routines.pyx":595 - * elif ndim == 2 and nvertices == 3: - * sampler = P1Sampler2D() - * elif ndim == 2 and nvertices == 4: # <<<<<<<<<<<<<< - * sampler = Q1Sampler2D() - * else: + /* "yt/utilities/lib/pixelization_routines.pyx":644 + * y1 = (ymax / dy) + 1 + * for i in range(x0, x1): + * x = (-1.0 + i*dx)*s2*2.0 # <<<<<<<<<<<<<< + * for j in range(y0, y1): + * y = (-1.0 + j * dy)*s2 */ - __pyx_t_11 = ((__pyx_v_ndim == 2) != 0); - if (__pyx_t_11) { - } else { - __pyx_t_10 = __pyx_t_11; - goto __pyx_L14_bool_binop_done; - } - __pyx_t_11 = ((__pyx_v_nvertices == 4) != 0); - __pyx_t_10 = __pyx_t_11; - __pyx_L14_bool_binop_done:; - if (__pyx_t_10) { + __pyx_v_x = (((-1.0 + (__pyx_v_i * __pyx_v_dx)) * __pyx_v_s2) * 2.0); - /* "yt/utilities/lib/pixelization_routines.pyx":596 - * sampler = P1Sampler2D() - * elif ndim == 2 and nvertices == 4: - * sampler = Q1Sampler2D() # <<<<<<<<<<<<<< - * else: - * raise YTElementTypeNotRecognized(ndim, nvertices) + /* "yt/utilities/lib/pixelization_routines.pyx":645 + * for i in range(x0, x1): + * x = (-1.0 + i*dx)*s2*2.0 + * for j in range(y0, y1): # <<<<<<<<<<<<<< + * y = (-1.0 + j * dy)*s2 + * zb = (x*x/8.0 + y*y/2.0 - 1.0) */ - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_21 = __pyx_v_y1; + for (__pyx_t_22 = __pyx_v_y0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; - /* "yt/utilities/lib/pixelization_routines.pyx":595 - * elif ndim == 2 and nvertices == 3: - * sampler = P1Sampler2D() - * elif ndim == 2 and nvertices == 4: # <<<<<<<<<<<<<< - * sampler = Q1Sampler2D() - * else: + /* "yt/utilities/lib/pixelization_routines.pyx":646 + * x = (-1.0 + i*dx)*s2*2.0 + * for j in range(y0, y1): + * y = (-1.0 + j * dy)*s2 # <<<<<<<<<<<<<< + * zb = (x*x/8.0 + y*y/2.0 - 1.0) + * if zb > 0: continue */ - goto __pyx_L3; - } + __pyx_v_y = ((-1.0 + (__pyx_v_j * __pyx_v_dy)) * __pyx_v_s2); - /* "yt/utilities/lib/pixelization_routines.pyx":598 - * sampler = Q1Sampler2D() - * else: - * raise YTElementTypeNotRecognized(ndim, nvertices) # <<<<<<<<<<<<<< - * - * # if we are in 2D land, the 1 cell thick dimension had better be 'z' + /* "yt/utilities/lib/pixelization_routines.pyx":647 + * for j in range(y0, y1): + * y = (-1.0 + j * dy)*s2 + * zb = (x*x/8.0 + y*y/2.0 - 1.0) # <<<<<<<<<<<<<< + * if zb > 0: continue + * z = (1.0 - (x * 0.25) * (x * 0.25) - (y * 0.5) * (y * 0.5)) */ - /*else*/ { - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTElementTypeNotRecognized); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nvertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = NULL; - __pyx_t_6 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_6 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_1, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_1, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else - #endif - { - __pyx_t_13 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - if (__pyx_t_12) { - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; - } - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_6, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_6, __pyx_t_2); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - } - __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, 598, __pyx_L1_error) - } - __pyx_L3:; - - /* "yt/utilities/lib/pixelization_routines.pyx":601 - * - * # if we are in 2D land, the 1 cell thick dimension had better be 'z' - * if ndim == 2: # <<<<<<<<<<<<<< - * if buff_size[2] != 1: - * raise RuntimeError("Slices of 2D datasets must be " - */ - __pyx_t_10 = ((__pyx_v_ndim == 2) != 0); - if (__pyx_t_10) { - - /* "yt/utilities/lib/pixelization_routines.pyx":602 - * # if we are in 2D land, the 1 cell thick dimension had better be 'z' - * if ndim == 2: - * if buff_size[2] != 1: # <<<<<<<<<<<<<< - * raise RuntimeError("Slices of 2D datasets must be " - * "perpendicular to the 'z' direction.") - */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_buff_size, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_10) { - - /* "yt/utilities/lib/pixelization_routines.pyx":603 - * if ndim == 2: - * if buff_size[2] != 1: - * raise RuntimeError("Slices of 2D datasets must be " # <<<<<<<<<<<<<< - * "perpendicular to the 'z' direction.") - * - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_v_zb = ((((__pyx_v_x * __pyx_v_x) / 8.0) + ((__pyx_v_y * __pyx_v_y) / 2.0)) - 1.0); - /* "yt/utilities/lib/pixelization_routines.pyx":602 - * # if we are in 2D land, the 1 cell thick dimension had better be 'z' - * if ndim == 2: - * if buff_size[2] != 1: # <<<<<<<<<<<<<< - * raise RuntimeError("Slices of 2D datasets must be " - * "perpendicular to the 'z' direction.") + /* "yt/utilities/lib/pixelization_routines.pyx":648 + * y = (-1.0 + j * dy)*s2 + * zb = (x*x/8.0 + y*y/2.0 - 1.0) + * if zb > 0: continue # <<<<<<<<<<<<<< + * z = (1.0 - (x * 0.25) * (x * 0.25) - (y * 0.5) * (y * 0.5)) + * z = math.sqrt(z) */ - } + __pyx_t_5 = ((__pyx_v_zb > 0.0) != 0); + if (__pyx_t_5) { + goto __pyx_L8_continue; + } - /* "yt/utilities/lib/pixelization_routines.pyx":601 - * - * # if we are in 2D land, the 1 cell thick dimension had better be 'z' - * if ndim == 2: # <<<<<<<<<<<<<< - * if buff_size[2] != 1: - * raise RuntimeError("Slices of 2D datasets must be " + /* "yt/utilities/lib/pixelization_routines.pyx":649 + * zb = (x*x/8.0 + y*y/2.0 - 1.0) + * if zb > 0: continue + * z = (1.0 - (x * 0.25) * (x * 0.25) - (y * 0.5) * (y * 0.5)) # <<<<<<<<<<<<<< + * z = math.sqrt(z) + * # Longitude */ - } + __pyx_v_z = ((1.0 - ((__pyx_v_x * 0.25) * (__pyx_v_x * 0.25))) - ((__pyx_v_y * 0.5) * (__pyx_v_y * 0.5))); - /* "yt/utilities/lib/pixelization_routines.pyx":607 - * - * # allocate temporary storage - * vertices = malloc(ndim * sizeof(np.float64_t) * nvertices) # <<<<<<<<<<<<<< - * field_vals = malloc(sizeof(np.float64_t) * num_field_vals) - * + /* "yt/utilities/lib/pixelization_routines.pyx":650 + * if zb > 0: continue + * z = (1.0 - (x * 0.25) * (x * 0.25) - (y * 0.5) * (y * 0.5)) + * z = math.sqrt(z) # <<<<<<<<<<<<<< + * # Longitude + * theta0 = 2.0*math.atan(z*x/(2.0 * (2.0*z*z-1.0))) */ - __pyx_v_vertices = ((__pyx_t_5numpy_float64_t *)malloc(((__pyx_v_ndim * (sizeof(__pyx_t_5numpy_float64_t))) * __pyx_v_nvertices))); + __pyx_v_z = sqrt(__pyx_v_z); - /* "yt/utilities/lib/pixelization_routines.pyx":608 - * # allocate temporary storage - * vertices = malloc(ndim * sizeof(np.float64_t) * nvertices) - * field_vals = malloc(sizeof(np.float64_t) * num_field_vals) # <<<<<<<<<<<<<< - * - * # fill the image bounds and pixel size informaton here + /* "yt/utilities/lib/pixelization_routines.pyx":652 + * z = math.sqrt(z) + * # Longitude + * theta0 = 2.0*math.atan(z*x/(2.0 * (2.0*z*z-1.0))) # <<<<<<<<<<<<<< + * # Latitude + * # We shift it into co-latitude */ - __pyx_v_field_vals = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_num_field_vals))); + __pyx_v_theta0 = (2.0 * atan(((__pyx_v_z * __pyx_v_x) / (2.0 * (((2.0 * __pyx_v_z) * __pyx_v_z) - 1.0))))); - /* "yt/utilities/lib/pixelization_routines.pyx":611 - * - * # fill the image bounds and pixel size informaton here - * for i in range(ndim): # <<<<<<<<<<<<<< - * pLE[i] = extents[i][0] - * pRE[i] = extents[i][1] + /* "yt/utilities/lib/pixelization_routines.pyx":655 + * # Latitude + * # We shift it into co-latitude + * phi0 = math.asin(z*y) # <<<<<<<<<<<<<< + * # Now we just need to figure out which pixel contributes. + * # We do not have a fast search. */ - __pyx_t_6 = __pyx_v_ndim; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_6; __pyx_t_14+=1) { - __pyx_v_i = __pyx_t_14; + __pyx_v_phi0 = asin((__pyx_v_z * __pyx_v_y)); - /* "yt/utilities/lib/pixelization_routines.pyx":612 - * # fill the image bounds and pixel size informaton here - * for i in range(ndim): - * pLE[i] = extents[i][0] # <<<<<<<<<<<<<< - * pRE[i] = extents[i][1] - * dds[i] = (pRE[i] - pLE[i])/buff_size[i] + /* "yt/utilities/lib/pixelization_routines.pyx":658 + * # Now we just need to figure out which pixel contributes. + * # We do not have a fast search. + * if not (theta_p - dtheta_p <= theta0 <= theta_p + dtheta_p): # <<<<<<<<<<<<<< + * continue + * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_extents, __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 612, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - (__pyx_v_pLE[__pyx_v_i]) = __pyx_t_15; + __pyx_t_5 = ((__pyx_v_theta_p - __pyx_v_dtheta_p) <= __pyx_v_theta0); + if (__pyx_t_5) { + __pyx_t_5 = (__pyx_v_theta0 <= (__pyx_v_theta_p + __pyx_v_dtheta_p)); + } + __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_4) { - /* "yt/utilities/lib/pixelization_routines.pyx":613 - * for i in range(ndim): - * pLE[i] = extents[i][0] - * pRE[i] = extents[i][1] # <<<<<<<<<<<<<< - * dds[i] = (pRE[i] - pLE[i])/buff_size[i] - * if dds[i] == 0.0: + /* "yt/utilities/lib/pixelization_routines.pyx":659 + * # We do not have a fast search. + * if not (theta_p - dtheta_p <= theta0 <= theta_p + dtheta_p): + * continue # <<<<<<<<<<<<<< + * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): + * continue */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_extents, __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 613, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - (__pyx_v_pRE[__pyx_v_i]) = __pyx_t_15; + goto __pyx_L8_continue; - /* "yt/utilities/lib/pixelization_routines.pyx":614 - * pLE[i] = extents[i][0] - * pRE[i] = extents[i][1] - * dds[i] = (pRE[i] - pLE[i])/buff_size[i] # <<<<<<<<<<<<<< - * if dds[i] == 0.0: - * idds[i] = 0.0 + /* "yt/utilities/lib/pixelization_routines.pyx":658 + * # Now we just need to figure out which pixel contributes. + * # We do not have a fast search. + * if not (theta_p - dtheta_p <= theta0 <= theta_p + dtheta_p): # <<<<<<<<<<<<<< + * continue + * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): */ - __pyx_t_3 = PyFloat_FromDouble(((__pyx_v_pRE[__pyx_v_i]) - (__pyx_v_pLE[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_buff_size, __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - (__pyx_v_dds[__pyx_v_i]) = __pyx_t_15; + } - /* "yt/utilities/lib/pixelization_routines.pyx":615 - * pRE[i] = extents[i][1] - * dds[i] = (pRE[i] - pLE[i])/buff_size[i] - * if dds[i] == 0.0: # <<<<<<<<<<<<<< - * idds[i] = 0.0 - * else: + /* "yt/utilities/lib/pixelization_routines.pyx":660 + * if not (theta_p - dtheta_p <= theta0 <= theta_p + dtheta_p): + * continue + * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): # <<<<<<<<<<<<<< + * continue + * img[i, j] = field[fi] */ - __pyx_t_10 = (((__pyx_v_dds[__pyx_v_i]) == 0.0) != 0); - if (__pyx_t_10) { + __pyx_t_4 = ((__pyx_v_phi_p - __pyx_v_dphi_p) <= __pyx_v_phi0); + if (__pyx_t_4) { + __pyx_t_4 = (__pyx_v_phi0 <= (__pyx_v_phi_p + __pyx_v_dphi_p)); + } + __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0); + if (__pyx_t_5) { - /* "yt/utilities/lib/pixelization_routines.pyx":616 - * dds[i] = (pRE[i] - pLE[i])/buff_size[i] - * if dds[i] == 0.0: - * idds[i] = 0.0 # <<<<<<<<<<<<<< - * else: - * idds[i] = 1.0 / dds[i] + /* "yt/utilities/lib/pixelization_routines.pyx":661 + * continue + * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): + * continue # <<<<<<<<<<<<<< + * img[i, j] = field[fi] + * return img */ - (__pyx_v_idds[__pyx_v_i]) = 0.0; + goto __pyx_L8_continue; - /* "yt/utilities/lib/pixelization_routines.pyx":615 - * pRE[i] = extents[i][1] - * dds[i] = (pRE[i] - pLE[i])/buff_size[i] - * if dds[i] == 0.0: # <<<<<<<<<<<<<< - * idds[i] = 0.0 - * else: + /* "yt/utilities/lib/pixelization_routines.pyx":660 + * if not (theta_p - dtheta_p <= theta0 <= theta_p + dtheta_p): + * continue + * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): # <<<<<<<<<<<<<< + * continue + * img[i, j] = field[fi] */ - goto __pyx_L20; - } + } - /* "yt/utilities/lib/pixelization_routines.pyx":618 - * idds[i] = 0.0 - * else: - * idds[i] = 1.0 / dds[i] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":662 + * if not (phi_p - dphi_p <= phi0 <= phi_p + dphi_p): + * continue + * img[i, j] = field[fi] # <<<<<<<<<<<<<< + * return img * - * with cython.boundscheck(False): */ - /*else*/ { - if (unlikely((__pyx_v_dds[__pyx_v_i]) == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_23 = __pyx_v_fi; + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_img.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_img.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_img.diminfo[1].strides) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_field.data + __pyx_t_23 * __pyx_v_field.strides[0]) ))); + __pyx_L8_continue:; } - (__pyx_v_idds[__pyx_v_i]) = (1.0 / (__pyx_v_dds[__pyx_v_i])); } - __pyx_L20:; } - /* "yt/utilities/lib/pixelization_routines.pyx":621 - * - * with cython.boundscheck(False): - * for ci in range(conn.shape[0]): # <<<<<<<<<<<<<< - * - * # Fill the vertices - */ - __pyx_t_16 = (__pyx_v_conn->dimensions[0]); - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_16; __pyx_t_14+=1) { - __pyx_v_ci = __pyx_t_14; - - /* "yt/utilities/lib/pixelization_routines.pyx":624 + /* "yt/utilities/lib/pixelization_routines.pyx":663 + * continue + * img[i, j] = field[fi] + * return img # <<<<<<<<<<<<<< * - * # Fill the vertices - * LE[0] = LE[1] = LE[2] = 1e60 # <<<<<<<<<<<<<< - * RE[0] = RE[1] = RE[2] = -1e60 * */ - (__pyx_v_LE[0]) = 1e60; - (__pyx_v_LE[1]) = 1e60; - (__pyx_v_LE[2]) = 1e60; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_img)); + __pyx_r = ((PyObject *)__pyx_v_img); + goto __pyx_L0; - /* "yt/utilities/lib/pixelization_routines.pyx":625 - * # Fill the vertices - * LE[0] = LE[1] = LE[2] = 1e60 - * RE[0] = RE[1] = RE[2] = -1e60 # <<<<<<<<<<<<<< - * - * for n in range(num_field_vals): + /* "yt/utilities/lib/pixelization_routines.pyx":570 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pixelize_aitoff(np.float64_t[:] theta, # <<<<<<<<<<<<<< + * np.float64_t[:] dtheta, + * np.float64_t[:] phi, */ - (__pyx_v_RE[0]) = -1e60; - (__pyx_v_RE[1]) = -1e60; - (__pyx_v_RE[2]) = -1e60; - /* "yt/utilities/lib/pixelization_routines.pyx":627 - * RE[0] = RE[1] = RE[2] = -1e60 - * - * for n in range(num_field_vals): # <<<<<<<<<<<<<< - * field_vals[n] = field[ci, n] - * - */ - __pyx_t_6 = __pyx_v_num_field_vals; - for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_6; __pyx_t_17+=1) { - __pyx_v_n = __pyx_t_17; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_aitoff", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_img); + __PYX_XDEC_MEMVIEW(&__pyx_v_theta, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_dtheta, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_phi, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_dphi, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_field, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "yt/utilities/lib/pixelization_routines.pyx":628 - * - * for n in range(num_field_vals): - * field_vals[n] = field[ci, n] # <<<<<<<<<<<<<< - * - * for n in range(nvertices): +/* "yt/utilities/lib/pixelization_routines.pyx":673 + * # results match. Otherwise, it will fill the signs with -1's and 1's to show + * # the sign of the dot product of the point with the cross product of the face. + * cdef int check_face_dot(int nvertices, # <<<<<<<<<<<<<< + * np.float64_t point[3], + * np.float64_t **vertices, */ - __pyx_t_18 = __pyx_v_ci; - __pyx_t_19 = __pyx_v_n; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_field.diminfo[0].shape; - if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_field.diminfo[1].shape; - (__pyx_v_field_vals[__pyx_v_n]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_field.diminfo[1].strides)); - } - /* "yt/utilities/lib/pixelization_routines.pyx":630 - * field_vals[n] = field[ci, n] - * - * for n in range(nvertices): # <<<<<<<<<<<<<< - * cj = conn[ci, n] - index_offset - * for i in range(ndim): +static int __pyx_f_2yt_9utilities_3lib_21pixelization_routines_check_face_dot(int __pyx_v_nvertices, __pyx_t_5numpy_float64_t *__pyx_v_point, __pyx_t_5numpy_float64_t **__pyx_v_vertices, __pyx_t_5numpy_int8_t *__pyx_v_signs, int __pyx_v_match) { + __pyx_t_5numpy_float64_t __pyx_v_vec1[3]; + __pyx_t_5numpy_float64_t __pyx_v_vec2[3]; + __pyx_t_5numpy_float64_t __pyx_v_cp_vec[3]; + __pyx_t_5numpy_float64_t __pyx_v_npoint[3]; + __pyx_t_5numpy_float64_t __pyx_v_dp; + __pyx_t_5numpy_uint8_t __pyx_v_faces[MAX_NUM_FACES][2][2]; + __pyx_t_5numpy_uint8_t __pyx_v_nf; + int __pyx_v_n; + int __pyx_v_vi1a; + int __pyx_v_vi1b; + int __pyx_v_vi2a; + int __pyx_v_vi2b; + int __pyx_r; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_uint8_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("check_face_dot", 0); + + /* "yt/utilities/lib/pixelization_routines.pyx":690 + * cdef np.uint8_t faces[MAX_NUM_FACES][2][2] + * cdef np.uint8_t nf + * if nvertices == 4: # <<<<<<<<<<<<<< + * faces = tetra_face_defs + * nf = TETRA_NF */ - __pyx_t_6 = __pyx_v_nvertices; - for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_6; __pyx_t_17+=1) { - __pyx_v_n = __pyx_t_17; + switch (__pyx_v_nvertices) { + case 4: - /* "yt/utilities/lib/pixelization_routines.pyx":631 - * - * for n in range(nvertices): - * cj = conn[ci, n] - index_offset # <<<<<<<<<<<<<< - * for i in range(ndim): - * vertices[ndim*n + i] = coords[cj, i] + /* "yt/utilities/lib/pixelization_routines.pyx":691 + * cdef np.uint8_t nf + * if nvertices == 4: + * faces = tetra_face_defs # <<<<<<<<<<<<<< + * nf = TETRA_NF + * elif nvertices == 6: */ - __pyx_t_20 = __pyx_v_ci; - __pyx_t_21 = __pyx_v_n; - if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_pybuffernd_conn.diminfo[0].shape; - if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_conn.diminfo[1].shape; - __pyx_v_cj = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_conn.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_conn.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_conn.diminfo[1].strides)) - __pyx_v_index_offset); + if (unlikely((MAX_NUM_FACES) != (MAX_NUM_FACES))) { + PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(MAX_NUM_FACES), (Py_ssize_t)(MAX_NUM_FACES)); + __PYX_ERR(0, 691, __pyx_L1_error) + } + memcpy(&(__pyx_v_faces[0]), tetra_face_defs, sizeof(__pyx_v_faces[0]) * (MAX_NUM_FACES)); - /* "yt/utilities/lib/pixelization_routines.pyx":632 - * for n in range(nvertices): - * cj = conn[ci, n] - index_offset - * for i in range(ndim): # <<<<<<<<<<<<<< - * vertices[ndim*n + i] = coords[cj, i] - * LE[i] = fmin(LE[i], vertices[ndim*n+i]) + /* "yt/utilities/lib/pixelization_routines.pyx":692 + * if nvertices == 4: + * faces = tetra_face_defs + * nf = TETRA_NF # <<<<<<<<<<<<<< + * elif nvertices == 6: + * faces = wedge_face_defs */ - __pyx_t_22 = __pyx_v_ndim; - for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { - __pyx_v_i = __pyx_t_23; + __pyx_v_nf = TETRA_NF; - /* "yt/utilities/lib/pixelization_routines.pyx":633 - * cj = conn[ci, n] - index_offset - * for i in range(ndim): - * vertices[ndim*n + i] = coords[cj, i] # <<<<<<<<<<<<<< - * LE[i] = fmin(LE[i], vertices[ndim*n+i]) - * RE[i] = fmax(RE[i], vertices[ndim*n+i]) + /* "yt/utilities/lib/pixelization_routines.pyx":690 + * cdef np.uint8_t faces[MAX_NUM_FACES][2][2] + * cdef np.uint8_t nf + * if nvertices == 4: # <<<<<<<<<<<<<< + * faces = tetra_face_defs + * nf = TETRA_NF */ - __pyx_t_24 = __pyx_v_cj; - __pyx_t_25 = __pyx_v_i; - if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_pybuffernd_coords.diminfo[0].shape; - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_pybuffernd_coords.diminfo[1].shape; - (__pyx_v_vertices[((__pyx_v_ndim * __pyx_v_n) + __pyx_v_i)]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_coords.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_coords.diminfo[1].strides)); + break; - /* "yt/utilities/lib/pixelization_routines.pyx":634 - * for i in range(ndim): - * vertices[ndim*n + i] = coords[cj, i] - * LE[i] = fmin(LE[i], vertices[ndim*n+i]) # <<<<<<<<<<<<<< - * RE[i] = fmax(RE[i], vertices[ndim*n+i]) - * + /* "yt/utilities/lib/pixelization_routines.pyx":693 + * faces = tetra_face_defs + * nf = TETRA_NF + * elif nvertices == 6: # <<<<<<<<<<<<<< + * faces = wedge_face_defs + * nf = WEDGE_NF */ - (__pyx_v_LE[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin((__pyx_v_LE[__pyx_v_i]), (__pyx_v_vertices[((__pyx_v_ndim * __pyx_v_n) + __pyx_v_i)])); + case 6: - /* "yt/utilities/lib/pixelization_routines.pyx":635 - * vertices[ndim*n + i] = coords[cj, i] - * LE[i] = fmin(LE[i], vertices[ndim*n+i]) - * RE[i] = fmax(RE[i], vertices[ndim*n+i]) # <<<<<<<<<<<<<< - * - * use = 1 + /* "yt/utilities/lib/pixelization_routines.pyx":694 + * nf = TETRA_NF + * elif nvertices == 6: + * faces = wedge_face_defs # <<<<<<<<<<<<<< + * nf = WEDGE_NF + * elif nvertices == 8: */ - (__pyx_v_RE[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((__pyx_v_RE[__pyx_v_i]), (__pyx_v_vertices[((__pyx_v_ndim * __pyx_v_n) + __pyx_v_i)])); - } + if (unlikely((MAX_NUM_FACES) != (MAX_NUM_FACES))) { + PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(MAX_NUM_FACES), (Py_ssize_t)(MAX_NUM_FACES)); + __PYX_ERR(0, 694, __pyx_L1_error) } + memcpy(&(__pyx_v_faces[0]), wedge_face_defs, sizeof(__pyx_v_faces[0]) * (MAX_NUM_FACES)); - /* "yt/utilities/lib/pixelization_routines.pyx":637 - * RE[i] = fmax(RE[i], vertices[ndim*n+i]) - * - * use = 1 # <<<<<<<<<<<<<< - * for i in range(ndim): - * if RE[i] < pLE[i] or LE[i] >= pRE[i]: + /* "yt/utilities/lib/pixelization_routines.pyx":695 + * elif nvertices == 6: + * faces = wedge_face_defs + * nf = WEDGE_NF # <<<<<<<<<<<<<< + * elif nvertices == 8: + * faces = hex_face_defs */ - __pyx_v_use = 1; + __pyx_v_nf = WEDGE_NF; - /* "yt/utilities/lib/pixelization_routines.pyx":638 - * - * use = 1 - * for i in range(ndim): # <<<<<<<<<<<<<< - * if RE[i] < pLE[i] or LE[i] >= pRE[i]: - * use = 0 + /* "yt/utilities/lib/pixelization_routines.pyx":693 + * faces = tetra_face_defs + * nf = TETRA_NF + * elif nvertices == 6: # <<<<<<<<<<<<<< + * faces = wedge_face_defs + * nf = WEDGE_NF */ - __pyx_t_6 = __pyx_v_ndim; - for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_6; __pyx_t_17+=1) { - __pyx_v_i = __pyx_t_17; + break; - /* "yt/utilities/lib/pixelization_routines.pyx":639 - * use = 1 - * for i in range(ndim): - * if RE[i] < pLE[i] or LE[i] >= pRE[i]: # <<<<<<<<<<<<<< - * use = 0 - * break + /* "yt/utilities/lib/pixelization_routines.pyx":696 + * faces = wedge_face_defs + * nf = WEDGE_NF + * elif nvertices == 8: # <<<<<<<<<<<<<< + * faces = hex_face_defs + * nf = HEX_NF */ - __pyx_t_11 = (((__pyx_v_RE[__pyx_v_i]) < (__pyx_v_pLE[__pyx_v_i])) != 0); - if (!__pyx_t_11) { - } else { - __pyx_t_10 = __pyx_t_11; - goto __pyx_L32_bool_binop_done; - } - __pyx_t_11 = (((__pyx_v_LE[__pyx_v_i]) >= (__pyx_v_pRE[__pyx_v_i])) != 0); - __pyx_t_10 = __pyx_t_11; - __pyx_L32_bool_binop_done:; - if (__pyx_t_10) { + case 8: - /* "yt/utilities/lib/pixelization_routines.pyx":640 - * for i in range(ndim): - * if RE[i] < pLE[i] or LE[i] >= pRE[i]: - * use = 0 # <<<<<<<<<<<<<< - * break - * pstart[i] = i64max( ((LE[i] - pLE[i])*idds[i]) - 1, 0) + /* "yt/utilities/lib/pixelization_routines.pyx":697 + * nf = WEDGE_NF + * elif nvertices == 8: + * faces = hex_face_defs # <<<<<<<<<<<<<< + * nf = HEX_NF + * else: */ - __pyx_v_use = 0; + if (unlikely((MAX_NUM_FACES) != (MAX_NUM_FACES))) { + PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(MAX_NUM_FACES), (Py_ssize_t)(MAX_NUM_FACES)); + __PYX_ERR(0, 697, __pyx_L1_error) + } + memcpy(&(__pyx_v_faces[0]), hex_face_defs, sizeof(__pyx_v_faces[0]) * (MAX_NUM_FACES)); - /* "yt/utilities/lib/pixelization_routines.pyx":641 - * if RE[i] < pLE[i] or LE[i] >= pRE[i]: - * use = 0 - * break # <<<<<<<<<<<<<< - * pstart[i] = i64max( ((LE[i] - pLE[i])*idds[i]) - 1, 0) - * pend[i] = i64min( ((RE[i] - pLE[i])*idds[i]) + 1, img.shape[i]-1) + /* "yt/utilities/lib/pixelization_routines.pyx":698 + * elif nvertices == 8: + * faces = hex_face_defs + * nf = HEX_NF # <<<<<<<<<<<<<< + * else: + * return -1 */ - goto __pyx_L30_break; + __pyx_v_nf = HEX_NF; - /* "yt/utilities/lib/pixelization_routines.pyx":639 - * use = 1 - * for i in range(ndim): - * if RE[i] < pLE[i] or LE[i] >= pRE[i]: # <<<<<<<<<<<<<< - * use = 0 - * break + /* "yt/utilities/lib/pixelization_routines.pyx":696 + * faces = wedge_face_defs + * nf = WEDGE_NF + * elif nvertices == 8: # <<<<<<<<<<<<<< + * faces = hex_face_defs + * nf = HEX_NF */ - } + break; + default: - /* "yt/utilities/lib/pixelization_routines.pyx":642 - * use = 0 - * break - * pstart[i] = i64max( ((LE[i] - pLE[i])*idds[i]) - 1, 0) # <<<<<<<<<<<<<< - * pend[i] = i64min( ((RE[i] - pLE[i])*idds[i]) + 1, img.shape[i]-1) + /* "yt/utilities/lib/pixelization_routines.pyx":700 + * nf = HEX_NF + * else: + * return -1 # <<<<<<<<<<<<<< + * cdef int i, j, n, vi1a, vi1b, vi2a, vi2b * */ - (__pyx_v_pstart[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max((((__pyx_t_5numpy_int64_t)(((__pyx_v_LE[__pyx_v_i]) - (__pyx_v_pLE[__pyx_v_i])) * (__pyx_v_idds[__pyx_v_i]))) - 1), 0); + __pyx_r = -1; + goto __pyx_L0; + break; + } - /* "yt/utilities/lib/pixelization_routines.pyx":643 - * break - * pstart[i] = i64max( ((LE[i] - pLE[i])*idds[i]) - 1, 0) - * pend[i] = i64min( ((RE[i] - pLE[i])*idds[i]) + 1, img.shape[i]-1) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":703 + * cdef int i, j, n, vi1a, vi1b, vi2a, vi2b * - * # override for the 2D case + * for n in range(nf): # <<<<<<<<<<<<<< + * vi1a = faces[n][0][0] + * vi1b = faces[n][0][1] */ - (__pyx_v_pend[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min((((__pyx_t_5numpy_int64_t)(((__pyx_v_RE[__pyx_v_i]) - (__pyx_v_pLE[__pyx_v_i])) * (__pyx_v_idds[__pyx_v_i]))) + 1), ((__pyx_v_img->dimensions[__pyx_v_i]) - 1)); - } - __pyx_L30_break:; + __pyx_t_1 = __pyx_v_nf; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_n = __pyx_t_2; - /* "yt/utilities/lib/pixelization_routines.pyx":646 + /* "yt/utilities/lib/pixelization_routines.pyx":704 * - * # override for the 2D case - * if ndim == 2: # <<<<<<<<<<<<<< - * pstart[2] = 0 - * pend[2] = 0 + * for n in range(nf): + * vi1a = faces[n][0][0] # <<<<<<<<<<<<<< + * vi1b = faces[n][0][1] + * vi2a = faces[n][1][0] */ - __pyx_t_10 = ((__pyx_v_ndim == 2) != 0); - if (__pyx_t_10) { + __pyx_v_vi1a = (((__pyx_v_faces[__pyx_v_n])[0])[0]); - /* "yt/utilities/lib/pixelization_routines.pyx":647 - * # override for the 2D case - * if ndim == 2: - * pstart[2] = 0 # <<<<<<<<<<<<<< - * pend[2] = 0 - * + /* "yt/utilities/lib/pixelization_routines.pyx":705 + * for n in range(nf): + * vi1a = faces[n][0][0] + * vi1b = faces[n][0][1] # <<<<<<<<<<<<<< + * vi2a = faces[n][1][0] + * vi2b = faces[n][1][1] */ - (__pyx_v_pstart[2]) = 0; + __pyx_v_vi1b = (((__pyx_v_faces[__pyx_v_n])[0])[1]); - /* "yt/utilities/lib/pixelization_routines.pyx":648 - * if ndim == 2: - * pstart[2] = 0 - * pend[2] = 0 # <<<<<<<<<<<<<< - * - * if use == 0: + /* "yt/utilities/lib/pixelization_routines.pyx":706 + * vi1a = faces[n][0][0] + * vi1b = faces[n][0][1] + * vi2a = faces[n][1][0] # <<<<<<<<<<<<<< + * vi2b = faces[n][1][1] + * # Shared vertex is vi1a and vi2a */ - (__pyx_v_pend[2]) = 0; + __pyx_v_vi2a = (((__pyx_v_faces[__pyx_v_n])[1])[0]); - /* "yt/utilities/lib/pixelization_routines.pyx":646 - * - * # override for the 2D case - * if ndim == 2: # <<<<<<<<<<<<<< - * pstart[2] = 0 - * pend[2] = 0 + /* "yt/utilities/lib/pixelization_routines.pyx":707 + * vi1b = faces[n][0][1] + * vi2a = faces[n][1][0] + * vi2b = faces[n][1][1] # <<<<<<<<<<<<<< + * # Shared vertex is vi1a and vi2a + * subtract(vertices[vi1b], vertices[vi1a], vec1) */ - } + __pyx_v_vi2b = (((__pyx_v_faces[__pyx_v_n])[1])[1]); - /* "yt/utilities/lib/pixelization_routines.pyx":650 - * pend[2] = 0 - * - * if use == 0: # <<<<<<<<<<<<<< - * continue - * + /* "yt/utilities/lib/pixelization_routines.pyx":709 + * vi2b = faces[n][1][1] + * # Shared vertex is vi1a and vi2a + * subtract(vertices[vi1b], vertices[vi1a], vec1) # <<<<<<<<<<<<<< + * subtract(vertices[vi2b], vertices[vi2a], vec2) + * subtract(point, vertices[vi1b], npoint) */ - __pyx_t_10 = ((__pyx_v_use == 0) != 0); - if (__pyx_t_10) { + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract((__pyx_v_vertices[__pyx_v_vi1b]), (__pyx_v_vertices[__pyx_v_vi1a]), __pyx_v_vec1); - /* "yt/utilities/lib/pixelization_routines.pyx":651 - * - * if use == 0: - * continue # <<<<<<<<<<<<<< - * - * # Now our bounding box intersects, so we get the extents of our pixel + /* "yt/utilities/lib/pixelization_routines.pyx":710 + * # Shared vertex is vi1a and vi2a + * subtract(vertices[vi1b], vertices[vi1a], vec1) + * subtract(vertices[vi2b], vertices[vi2a], vec2) # <<<<<<<<<<<<<< + * subtract(point, vertices[vi1b], npoint) + * cross(vec1, vec2, cp_vec) */ - goto __pyx_L21_continue; + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract((__pyx_v_vertices[__pyx_v_vi2b]), (__pyx_v_vertices[__pyx_v_vi2a]), __pyx_v_vec2); - /* "yt/utilities/lib/pixelization_routines.pyx":650 - * pend[2] = 0 - * - * if use == 0: # <<<<<<<<<<<<<< - * continue - * + /* "yt/utilities/lib/pixelization_routines.pyx":711 + * subtract(vertices[vi1b], vertices[vi1a], vec1) + * subtract(vertices[vi2b], vertices[vi2a], vec2) + * subtract(point, vertices[vi1b], npoint) # <<<<<<<<<<<<<< + * cross(vec1, vec2, cp_vec) + * dp = dot(cp_vec, npoint) */ - } + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(__pyx_v_point, (__pyx_v_vertices[__pyx_v_vi1b]), __pyx_v_npoint); - /* "yt/utilities/lib/pixelization_routines.pyx":656 - * # region which overlaps with the bounding box, and we'll check each - * # pixel in there. - * for pi in range(pstart[0], pend[0] + 1): # <<<<<<<<<<<<<< - * ppoint[0] = (pi + 0.5) * dds[0] + pLE[0] - * for pj in range(pstart[1], pend[1] + 1): + /* "yt/utilities/lib/pixelization_routines.pyx":712 + * subtract(vertices[vi2b], vertices[vi2a], vec2) + * subtract(point, vertices[vi1b], npoint) + * cross(vec1, vec2, cp_vec) # <<<<<<<<<<<<<< + * dp = dot(cp_vec, npoint) + * if match == 0: */ - __pyx_t_17 = ((__pyx_v_pend[0]) + 1); - for (__pyx_t_23 = (__pyx_v_pstart[0]); __pyx_t_23 < __pyx_t_17; __pyx_t_23+=1) { - __pyx_v_pi = __pyx_t_23; + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(__pyx_v_vec1, __pyx_v_vec2, __pyx_v_cp_vec); - /* "yt/utilities/lib/pixelization_routines.pyx":657 - * # pixel in there. - * for pi in range(pstart[0], pend[0] + 1): - * ppoint[0] = (pi + 0.5) * dds[0] + pLE[0] # <<<<<<<<<<<<<< - * for pj in range(pstart[1], pend[1] + 1): - * ppoint[1] = (pj + 0.5) * dds[1] + pLE[1] + /* "yt/utilities/lib/pixelization_routines.pyx":713 + * subtract(point, vertices[vi1b], npoint) + * cross(vec1, vec2, cp_vec) + * dp = dot(cp_vec, npoint) # <<<<<<<<<<<<<< + * if match == 0: + * if dp < 0: */ - (__pyx_v_ppoint[0]) = (((__pyx_v_pi + 0.5) * (__pyx_v_dds[0])) + (__pyx_v_pLE[0])); + __pyx_v_dp = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_cp_vec, __pyx_v_npoint); - /* "yt/utilities/lib/pixelization_routines.pyx":658 - * for pi in range(pstart[0], pend[0] + 1): - * ppoint[0] = (pi + 0.5) * dds[0] + pLE[0] - * for pj in range(pstart[1], pend[1] + 1): # <<<<<<<<<<<<<< - * ppoint[1] = (pj + 0.5) * dds[1] + pLE[1] - * for pk in range(pstart[2], pend[2] + 1): + /* "yt/utilities/lib/pixelization_routines.pyx":714 + * cross(vec1, vec2, cp_vec) + * dp = dot(cp_vec, npoint) + * if match == 0: # <<<<<<<<<<<<<< + * if dp < 0: + * signs[n] = -1 */ - __pyx_t_26 = ((__pyx_v_pend[1]) + 1); - for (__pyx_t_27 = (__pyx_v_pstart[1]); __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) { - __pyx_v_pj = __pyx_t_27; + __pyx_t_3 = ((__pyx_v_match == 0) != 0); + if (__pyx_t_3) { - /* "yt/utilities/lib/pixelization_routines.pyx":659 - * ppoint[0] = (pi + 0.5) * dds[0] + pLE[0] - * for pj in range(pstart[1], pend[1] + 1): - * ppoint[1] = (pj + 0.5) * dds[1] + pLE[1] # <<<<<<<<<<<<<< - * for pk in range(pstart[2], pend[2] + 1): - * ppoint[2] = (pk + 0.5) * dds[2] + pLE[2] + /* "yt/utilities/lib/pixelization_routines.pyx":715 + * dp = dot(cp_vec, npoint) + * if match == 0: + * if dp < 0: # <<<<<<<<<<<<<< + * signs[n] = -1 + * else: */ - (__pyx_v_ppoint[1]) = (((__pyx_v_pj + 0.5) * (__pyx_v_dds[1])) + (__pyx_v_pLE[1])); + __pyx_t_3 = ((__pyx_v_dp < 0.0) != 0); + if (__pyx_t_3) { - /* "yt/utilities/lib/pixelization_routines.pyx":660 - * for pj in range(pstart[1], pend[1] + 1): - * ppoint[1] = (pj + 0.5) * dds[1] + pLE[1] - * for pk in range(pstart[2], pend[2] + 1): # <<<<<<<<<<<<<< - * ppoint[2] = (pk + 0.5) * dds[2] + pLE[2] - * # Now we just need to figure out if our ppoint is within + /* "yt/utilities/lib/pixelization_routines.pyx":716 + * if match == 0: + * if dp < 0: + * signs[n] = -1 # <<<<<<<<<<<<<< + * else: + * signs[n] = 1 */ - __pyx_t_28 = ((__pyx_v_pend[2]) + 1); - for (__pyx_t_29 = (__pyx_v_pstart[2]); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { - __pyx_v_pk = __pyx_t_29; + (__pyx_v_signs[__pyx_v_n]) = -1; - /* "yt/utilities/lib/pixelization_routines.pyx":661 - * ppoint[1] = (pj + 0.5) * dds[1] + pLE[1] - * for pk in range(pstart[2], pend[2] + 1): - * ppoint[2] = (pk + 0.5) * dds[2] + pLE[2] # <<<<<<<<<<<<<< - * # Now we just need to figure out if our ppoint is within - * # our set of vertices. + /* "yt/utilities/lib/pixelization_routines.pyx":715 + * dp = dot(cp_vec, npoint) + * if match == 0: + * if dp < 0: # <<<<<<<<<<<<<< + * signs[n] = -1 + * else: */ - (__pyx_v_ppoint[2]) = (((__pyx_v_pk + 0.5) * (__pyx_v_dds[2])) + (__pyx_v_pLE[2])); + goto __pyx_L6; + } - /* "yt/utilities/lib/pixelization_routines.pyx":664 - * # Now we just need to figure out if our ppoint is within - * # our set of vertices. - * sampler.map_real_to_unit(mapped_coord, vertices, ppoint) # <<<<<<<<<<<<<< - * if not sampler.check_inside(mapped_coord): - * continue + /* "yt/utilities/lib/pixelization_routines.pyx":718 + * signs[n] = -1 + * else: + * signs[n] = 1 # <<<<<<<<<<<<<< + * else: + * if dp <= 0 and signs[n] < 0: */ - ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler->__pyx_vtab)->map_real_to_unit(__pyx_v_sampler, __pyx_v_mapped_coord, __pyx_v_vertices, __pyx_v_ppoint); + /*else*/ { + (__pyx_v_signs[__pyx_v_n]) = 1; + } + __pyx_L6:; - /* "yt/utilities/lib/pixelization_routines.pyx":665 - * # our set of vertices. - * sampler.map_real_to_unit(mapped_coord, vertices, ppoint) - * if not sampler.check_inside(mapped_coord): # <<<<<<<<<<<<<< - * continue - * if (num_field_vals == 1): + /* "yt/utilities/lib/pixelization_routines.pyx":714 + * cross(vec1, vec2, cp_vec) + * dp = dot(cp_vec, npoint) + * if match == 0: # <<<<<<<<<<<<<< + * if dp < 0: + * signs[n] = -1 */ - __pyx_t_10 = ((!(((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler->__pyx_vtab)->check_inside(__pyx_v_sampler, __pyx_v_mapped_coord) != 0)) != 0); - if (__pyx_t_10) { + goto __pyx_L5; + } - /* "yt/utilities/lib/pixelization_routines.pyx":666 - * sampler.map_real_to_unit(mapped_coord, vertices, ppoint) - * if not sampler.check_inside(mapped_coord): - * continue # <<<<<<<<<<<<<< - * if (num_field_vals == 1): - * img[pi, pj, pk] = field_vals[0] + /* "yt/utilities/lib/pixelization_routines.pyx":720 + * signs[n] = 1 + * else: + * if dp <= 0 and signs[n] < 0: # <<<<<<<<<<<<<< + * continue + * elif dp >= 0 and signs[n] > 0: */ - goto __pyx_L40_continue; + /*else*/ { + __pyx_t_4 = ((__pyx_v_dp <= 0.0) != 0); + if (__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_4 = (((__pyx_v_signs[__pyx_v_n]) < 0) != 0); + __pyx_t_3 = __pyx_t_4; + __pyx_L8_bool_binop_done:; + if (__pyx_t_3) { - /* "yt/utilities/lib/pixelization_routines.pyx":665 - * # our set of vertices. - * sampler.map_real_to_unit(mapped_coord, vertices, ppoint) - * if not sampler.check_inside(mapped_coord): # <<<<<<<<<<<<<< - * continue - * if (num_field_vals == 1): + /* "yt/utilities/lib/pixelization_routines.pyx":721 + * else: + * if dp <= 0 and signs[n] < 0: + * continue # <<<<<<<<<<<<<< + * elif dp >= 0 and signs[n] > 0: + * continue */ - } + goto __pyx_L3_continue; - /* "yt/utilities/lib/pixelization_routines.pyx":667 - * if not sampler.check_inside(mapped_coord): - * continue - * if (num_field_vals == 1): # <<<<<<<<<<<<<< - * img[pi, pj, pk] = field_vals[0] - * else: + /* "yt/utilities/lib/pixelization_routines.pyx":720 + * signs[n] = 1 + * else: + * if dp <= 0 and signs[n] < 0: # <<<<<<<<<<<<<< + * continue + * elif dp >= 0 and signs[n] > 0: */ - __pyx_t_10 = ((__pyx_v_num_field_vals == 1) != 0); - if (__pyx_t_10) { + } - /* "yt/utilities/lib/pixelization_routines.pyx":668 - * continue - * if (num_field_vals == 1): - * img[pi, pj, pk] = field_vals[0] # <<<<<<<<<<<<<< - * else: - * img[pi, pj, pk] = sampler.sample_at_unit_point(mapped_coord, + /* "yt/utilities/lib/pixelization_routines.pyx":722 + * if dp <= 0 and signs[n] < 0: + * continue + * elif dp >= 0 and signs[n] > 0: # <<<<<<<<<<<<<< + * continue + * else: # mismatch! */ - __pyx_t_30 = __pyx_v_pi; - __pyx_t_31 = __pyx_v_pj; - __pyx_t_32 = __pyx_v_pk; - if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_pybuffernd_img.diminfo[0].shape; - if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_pybuffernd_img.diminfo[1].shape; - if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_pybuffernd_img.diminfo[2].shape; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_img.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_img.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_img.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_img.diminfo[2].strides) = (__pyx_v_field_vals[0]); + __pyx_t_4 = ((__pyx_v_dp >= 0.0) != 0); + if (__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L10_bool_binop_done; + } + __pyx_t_4 = (((__pyx_v_signs[__pyx_v_n]) > 0) != 0); + __pyx_t_3 = __pyx_t_4; + __pyx_L10_bool_binop_done:; + if (__pyx_t_3) { - /* "yt/utilities/lib/pixelization_routines.pyx":667 - * if not sampler.check_inside(mapped_coord): - * continue - * if (num_field_vals == 1): # <<<<<<<<<<<<<< - * img[pi, pj, pk] = field_vals[0] - * else: + /* "yt/utilities/lib/pixelization_routines.pyx":723 + * continue + * elif dp >= 0 and signs[n] > 0: + * continue # <<<<<<<<<<<<<< + * else: # mismatch! + * return 0 */ - goto __pyx_L43; - } + goto __pyx_L3_continue; - /* "yt/utilities/lib/pixelization_routines.pyx":670 - * img[pi, pj, pk] = field_vals[0] - * else: - * img[pi, pj, pk] = sampler.sample_at_unit_point(mapped_coord, # <<<<<<<<<<<<<< - * field_vals) - * free(vertices) + /* "yt/utilities/lib/pixelization_routines.pyx":722 + * if dp <= 0 and signs[n] < 0: + * continue + * elif dp >= 0 and signs[n] > 0: # <<<<<<<<<<<<<< + * continue + * else: # mismatch! */ - /*else*/ { + } - /* "yt/utilities/lib/pixelization_routines.pyx":671 - * else: - * img[pi, pj, pk] = sampler.sample_at_unit_point(mapped_coord, - * field_vals) # <<<<<<<<<<<<<< - * free(vertices) - * free(field_vals) + /* "yt/utilities/lib/pixelization_routines.pyx":725 + * continue + * else: # mismatch! + * return 0 # <<<<<<<<<<<<<< + * return 1 + * */ - __pyx_t_33 = __pyx_v_pi; - __pyx_t_34 = __pyx_v_pj; - __pyx_t_35 = __pyx_v_pk; - if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_pybuffernd_img.diminfo[0].shape; - if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_pybuffernd_img.diminfo[1].shape; - if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_pybuffernd_img.diminfo[2].shape; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_img.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_img.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_img.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_img.diminfo[2].strides) = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler->__pyx_vtab)->sample_at_unit_point(__pyx_v_sampler, __pyx_v_mapped_coord, __pyx_v_field_vals); - } - __pyx_L43:; - __pyx_L40_continue:; - } + /*else*/ { + __pyx_r = 0; + goto __pyx_L0; } } - __pyx_L21_continue:; + __pyx_L5:; + __pyx_L3_continue:; } - /* "yt/utilities/lib/pixelization_routines.pyx":672 - * img[pi, pj, pk] = sampler.sample_at_unit_point(mapped_coord, - * field_vals) - * free(vertices) # <<<<<<<<<<<<<< - * free(field_vals) - * return img - */ - free(__pyx_v_vertices); - - /* "yt/utilities/lib/pixelization_routines.pyx":673 - * field_vals) - * free(vertices) - * free(field_vals) # <<<<<<<<<<<<<< - * return img - */ - free(__pyx_v_field_vals); - - /* "yt/utilities/lib/pixelization_routines.pyx":674 - * free(vertices) - * free(field_vals) - * return img # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":726 + * else: # mismatch! + * return 0 + * return 1 # <<<<<<<<<<<<<< + * + * */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_img)); - __pyx_r = ((PyObject *)__pyx_v_img); + __pyx_r = 1; goto __pyx_L0; - /* "yt/utilities/lib/pixelization_routines.pyx":550 - * - * - * def pixelize_element_mesh(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< - * np.ndarray[np.int64_t, ndim=2] conn, - * buff_size, + /* "yt/utilities/lib/pixelization_routines.pyx":673 + * # results match. Otherwise, it will fill the signs with -1's and 1's to show + * # the sign of the dot product of the point with the cross product of the face. + * cdef int check_face_dot(int nvertices, # <<<<<<<<<<<<<< + * np.float64_t point[3], + * np.float64_t **vertices, */ /* 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_12); - __Pyx_XDECREF(__pyx_t_13); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conn.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_element_mesh", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; + __Pyx_WriteUnraisable("yt.utilities.lib.pixelization_routines.check_face_dot", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conn.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_img); - __Pyx_XDECREF((PyObject *)__pyx_v_sampler); - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 - */ - -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":20 - * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 +/* "yt/utilities/lib/pixelization_routines.pyx":729 * - */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * def pixelize_element_mesh(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< + * np.ndarray[np.int64_t, ndim=2] conn, + * buff_size, */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 - */ +/* Python wrapper */ +static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_11pixelize_element_mesh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_11pixelize_element_mesh = {"pixelize_element_mesh", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_11pixelize_element_mesh, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_11pixelize_element_mesh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_coords = 0; + PyArrayObject *__pyx_v_conn = 0; + PyObject *__pyx_v_buff_size = 0; + PyArrayObject *__pyx_v_field = 0; + PyObject *__pyx_v_extents = 0; + int __pyx_v_index_offset; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pixelize_element_mesh (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coords,&__pyx_n_s_conn,&__pyx_n_s_buff_size,&__pyx_n_s_field,&__pyx_n_s_extents,&__pyx_n_s_index_offset,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conn)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh", 0, 5, 6, 1); __PYX_ERR(0, 729, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buff_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh", 0, 5, 6, 2); __PYX_ERR(0, 729, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh", 0, 5, 6, 3); __PYX_ERR(0, 729, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extents)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh", 0, 5, 6, 4); __PYX_ERR(0, 729, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index_offset); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_element_mesh") < 0)) __PYX_ERR(0, 729, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 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_coords = ((PyArrayObject *)values[0]); + __pyx_v_conn = ((PyArrayObject *)values[1]); + __pyx_v_buff_size = values[2]; + __pyx_v_field = ((PyArrayObject *)values[3]); + __pyx_v_extents = values[4]; + if (values[5]) { + __pyx_v_index_offset = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_index_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L3_error) + } else { + __pyx_v_index_offset = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 729, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_element_mesh", __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, 729, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_ptype_5numpy_ndarray, 1, "conn", 0))) __PYX_ERR(0, 730, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_5numpy_ndarray, 1, "field", 0))) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_21pixelization_routines_10pixelize_element_mesh(__pyx_self, __pyx_v_coords, __pyx_v_conn, __pyx_v_buff_size, __pyx_v_field, __pyx_v_extents, __pyx_v_index_offset); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; __pyx_L0:; + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_10pixelize_element_mesh(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords, PyArrayObject *__pyx_v_conn, PyObject *__pyx_v_buff_size, PyArrayObject *__pyx_v_field, PyObject *__pyx_v_extents, int __pyx_v_index_offset) { + PyArrayObject *__pyx_v_img = 0; + __pyx_t_5numpy_float64_t __pyx_v_pLE[3]; + __pyx_t_5numpy_float64_t __pyx_v_pRE[3]; + __pyx_t_5numpy_float64_t __pyx_v_LE[3]; + __pyx_t_5numpy_float64_t __pyx_v_RE[3]; + int __pyx_v_use; + __pyx_t_5numpy_int64_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_i; + __pyx_t_5numpy_int64_t __pyx_v_pi; + __pyx_t_5numpy_int64_t __pyx_v_pj; + __pyx_t_5numpy_int64_t __pyx_v_pk; + __pyx_t_5numpy_int64_t __pyx_v_ci; + __pyx_t_5numpy_int64_t __pyx_v_cj; + __pyx_t_5numpy_int64_t __pyx_v_pstart[3]; + __pyx_t_5numpy_int64_t __pyx_v_pend[3]; + __pyx_t_5numpy_float64_t __pyx_v_ppoint[3]; + __pyx_t_5numpy_float64_t __pyx_v_idds[3]; + __pyx_t_5numpy_float64_t __pyx_v_dds[3]; + __pyx_t_5numpy_float64_t *__pyx_v_vertices; + __pyx_t_5numpy_float64_t *__pyx_v_field_vals; + int __pyx_v_nvertices; + int __pyx_v_ndim; + int __pyx_v_num_field_vals; + double __pyx_v_mapped_coord[4]; + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_sampler = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_conn; + __Pyx_Buffer __pyx_pybuffer_conn; + __Pyx_LocalBuf_ND __pyx_pybuffernd_coords; + __Pyx_Buffer __pyx_pybuffer_coords; + __Pyx_LocalBuf_ND __pyx_pybuffernd_field; + __Pyx_Buffer __pyx_pybuffer_field; + __Pyx_LocalBuf_ND __pyx_pybuffernd_img; + __Pyx_Buffer __pyx_pybuffer_img; + 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; + PyArrayObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_14; + __pyx_t_5numpy_float64_t __pyx_t_15; + npy_intp __pyx_t_16; + __pyx_t_5numpy_int64_t __pyx_t_17; + __pyx_t_5numpy_int64_t __pyx_t_18; + __pyx_t_5numpy_int64_t __pyx_t_19; + __pyx_t_5numpy_int64_t __pyx_t_20; + __pyx_t_5numpy_int64_t __pyx_t_21; + int __pyx_t_22; + __pyx_t_5numpy_int64_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + __pyx_t_5numpy_int64_t __pyx_t_25; + __pyx_t_5numpy_int64_t __pyx_t_26; + __pyx_t_5numpy_int64_t __pyx_t_27; + __pyx_t_5numpy_int64_t __pyx_t_28; + __pyx_t_5numpy_int64_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + __pyx_t_5numpy_int64_t __pyx_t_31; + __pyx_t_5numpy_int64_t __pyx_t_32; + __pyx_t_5numpy_int64_t __pyx_t_33; + __pyx_t_5numpy_int64_t __pyx_t_34; + __pyx_t_5numpy_int64_t __pyx_t_35; + __Pyx_RefNannySetupContext("pixelize_element_mesh", 0); + __pyx_pybuffer_img.pybuffer.buf = NULL; + __pyx_pybuffer_img.refcount = 0; + __pyx_pybuffernd_img.data = NULL; + __pyx_pybuffernd_img.rcbuffer = &__pyx_pybuffer_img; + __pyx_pybuffer_coords.pybuffer.buf = NULL; + __pyx_pybuffer_coords.refcount = 0; + __pyx_pybuffernd_coords.data = NULL; + __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords; + __pyx_pybuffer_conn.pybuffer.buf = NULL; + __pyx_pybuffer_conn.refcount = 0; + __pyx_pybuffernd_conn.data = NULL; + __pyx_pybuffernd_conn.rcbuffer = &__pyx_pybuffer_conn; + __pyx_pybuffer_field.pybuffer.buf = NULL; + __pyx_pybuffer_field.refcount = 0; + __pyx_pybuffernd_field.data = NULL; + __pyx_pybuffernd_field.rcbuffer = &__pyx_pybuffer_field; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 729, __pyx_L1_error) + } + __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conn.rcbuffer->pybuffer, (PyObject*)__pyx_v_conn, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 729, __pyx_L1_error) + } + __pyx_pybuffernd_conn.diminfo[0].strides = __pyx_pybuffernd_conn.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conn.diminfo[0].shape = __pyx_pybuffernd_conn.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conn.diminfo[1].strides = __pyx_pybuffernd_conn.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conn.diminfo[1].shape = __pyx_pybuffernd_conn.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 729, __pyx_L1_error) + } + __pyx_pybuffernd_field.diminfo[0].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field.diminfo[0].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_field.diminfo[1].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_field.diminfo[1].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/fp_utils.pxd":24 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 - * + /* "yt/utilities/lib/pixelization_routines.pyx":736 + * int index_offset = 0): + * cdef np.ndarray[np.float64_t, ndim=3] img + * img = np.zeros(buff_size, dtype="float64") # <<<<<<<<<<<<<< + * # Two steps: + * # 1. Is image point within the mesh bounding box? */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __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, 736, __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, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_buff_size); + __Pyx_GIVEREF(__pyx_v_buff_size); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_buff_size); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_img.rcbuffer->pybuffer, (PyObject*)__pyx_v_img, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_img.diminfo[0].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_img.diminfo[0].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_img.diminfo[1].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_img.diminfo[1].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_img.diminfo[2].strides = __pyx_pybuffernd_img.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_img.diminfo[2].shape = __pyx_pybuffernd_img.rcbuffer->pybuffer.shape[2]; + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 736, __pyx_L1_error) } + __pyx_t_5 = 0; + __pyx_v_img = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< - * - * cdef inline int imin(int i0, int i1) nogil: + /* "yt/utilities/lib/pixelization_routines.pyx":757 + * cdef np.float64_t *vertices + * cdef np.float64_t *field_vals + * cdef int nvertices = conn.shape[1] # <<<<<<<<<<<<<< + * cdef int ndim = coords.shape[1] + * cdef int num_field_vals = field.shape[1] */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_v_nvertices = (__pyx_v_conn->dimensions[1]); - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 - * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + /* "yt/utilities/lib/pixelization_routines.pyx":758 + * cdef np.float64_t *field_vals + * cdef int nvertices = conn.shape[1] + * cdef int ndim = coords.shape[1] # <<<<<<<<<<<<<< + * cdef int num_field_vals = field.shape[1] + * cdef double[4] mapped_coord */ + __pyx_v_ndim = (__pyx_v_coords->dimensions[1]); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 - * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "yt/utilities/lib/pixelization_routines.pyx":759 + * cdef int nvertices = conn.shape[1] + * cdef int ndim = coords.shape[1] + * cdef int num_field_vals = field.shape[1] # <<<<<<<<<<<<<< + * cdef double[4] mapped_coord + * cdef ElementSampler sampler */ + __pyx_v_num_field_vals = (__pyx_v_field->dimensions[1]); -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "yt/utilities/lib/pixelization_routines.pyx":764 * + * # Pick the right sampler and allocate storage for the mapped coordinate + * if ndim == 3 and nvertices == 4: # <<<<<<<<<<<<<< + * sampler = P1Sampler3D() + * elif ndim == 3 and nvertices == 6: */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + __pyx_t_11 = ((__pyx_v_ndim == 3) != 0); + if (__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L4_bool_binop_done; } + __pyx_t_11 = ((__pyx_v_nvertices == 4) != 0); + __pyx_t_10 = __pyx_t_11; + __pyx_L4_bool_binop_done:; + if (__pyx_t_10) { - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 - * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "yt/utilities/lib/pixelization_routines.pyx":765 + * # Pick the right sampler and allocate storage for the mapped coordinate + * if ndim == 3 and nvertices == 4: + * sampler = P1Sampler3D() # <<<<<<<<<<<<<< + * elif ndim == 3 and nvertices == 6: + * sampler = W1Sampler3D() */ + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); + __pyx_t_4 = 0; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "yt/utilities/lib/pixelization_routines.pyx":764 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * # Pick the right sampler and allocate storage for the mapped coordinate + * if ndim == 3 and nvertices == 4: # <<<<<<<<<<<<<< + * sampler = P1Sampler3D() + * elif ndim == 3 and nvertices == 6: */ + goto __pyx_L3; + } -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 - * + /* "yt/utilities/lib/pixelization_routines.pyx":766 + * if ndim == 3 and nvertices == 4: + * sampler = P1Sampler3D() + * elif ndim == 3 and nvertices == 6: # <<<<<<<<<<<<<< + * sampler = W1Sampler3D() + * elif ndim == 3 and nvertices == 8: */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + __pyx_t_11 = ((__pyx_v_ndim == 3) != 0); + if (__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L6_bool_binop_done; } + __pyx_t_11 = ((__pyx_v_nvertices == 6) != 0); + __pyx_t_10 = __pyx_t_11; + __pyx_L6_bool_binop_done:; + if (__pyx_t_10) { - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + /* "yt/utilities/lib/pixelization_routines.pyx":767 + * sampler = P1Sampler3D() + * elif ndim == 3 and nvertices == 6: + * sampler = W1Sampler3D() # <<<<<<<<<<<<<< + * elif ndim == 3 and nvertices == 8: + * sampler = Q1Sampler3D() */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 767, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); + __pyx_t_4 = 0; - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + /* "yt/utilities/lib/pixelization_routines.pyx":766 + * if ndim == 3 and nvertices == 4: + * sampler = P1Sampler3D() + * elif ndim == 3 and nvertices == 6: # <<<<<<<<<<<<<< + * sampler = W1Sampler3D() + * elif ndim == 3 and nvertices == 8: */ + goto __pyx_L3; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + /* "yt/utilities/lib/pixelization_routines.pyx":768 + * elif ndim == 3 and nvertices == 6: + * sampler = W1Sampler3D() + * elif ndim == 3 and nvertices == 8: # <<<<<<<<<<<<<< + * sampler = Q1Sampler3D() + * elif ndim == 3 and nvertices == 20: */ + __pyx_t_11 = ((__pyx_v_ndim == 3) != 0); + if (__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_11 = ((__pyx_v_nvertices == 8) != 0); + __pyx_t_10 = __pyx_t_11; + __pyx_L8_bool_binop_done:; + if (__pyx_t_10) { -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; + /* "yt/utilities/lib/pixelization_routines.pyx":769 + * sampler = W1Sampler3D() + * elif ndim == 3 and nvertices == 8: + * sampler = Q1Sampler3D() # <<<<<<<<<<<<<< + * elif ndim == 3 and nvertices == 20: + * sampler = S2Sampler3D() + */ + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); + __pyx_t_4 = 0; - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 - * + /* "yt/utilities/lib/pixelization_routines.pyx":768 + * elif ndim == 3 and nvertices == 6: + * sampler = W1Sampler3D() + * elif ndim == 3 and nvertices == 8: # <<<<<<<<<<<<<< + * sampler = Q1Sampler3D() + * elif ndim == 3 and nvertices == 20: */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); - if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; + goto __pyx_L3; } - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< - * - * cdef inline int iclip(int i, int a, int b) nogil: + /* "yt/utilities/lib/pixelization_routines.pyx":770 + * elif ndim == 3 and nvertices == 8: + * sampler = Q1Sampler3D() + * elif ndim == 3 and nvertices == 20: # <<<<<<<<<<<<<< + * sampler = S2Sampler3D() + * elif ndim == 2 and nvertices == 3: */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; + __pyx_t_11 = ((__pyx_v_ndim == 3) != 0); + if (__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L10_bool_binop_done; + } + __pyx_t_11 = ((__pyx_v_nvertices == 20) != 0); + __pyx_t_10 = __pyx_t_11; + __pyx_L10_bool_binop_done:; + if (__pyx_t_10) { - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + /* "yt/utilities/lib/pixelization_routines.pyx":771 + * sampler = Q1Sampler3D() + * elif ndim == 3 and nvertices == 20: + * sampler = S2Sampler3D() # <<<<<<<<<<<<<< + * elif ndim == 2 and nvertices == 3: + * sampler = P1Sampler2D() */ + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); + __pyx_t_4 = 0; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "yt/utilities/lib/pixelization_routines.pyx":770 + * elif ndim == 3 and nvertices == 8: + * sampler = Q1Sampler3D() + * elif ndim == 3 and nvertices == 20: # <<<<<<<<<<<<<< + * sampler = S2Sampler3D() + * elif ndim == 2 and nvertices == 3: + */ + goto __pyx_L3; + } -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "yt/utilities/lib/pixelization_routines.pyx":772 + * elif ndim == 3 and nvertices == 20: + * sampler = S2Sampler3D() + * elif ndim == 2 and nvertices == 3: # <<<<<<<<<<<<<< + * sampler = P1Sampler2D() + * elif ndim == 1 and nvertices == 2: */ + __pyx_t_11 = ((__pyx_v_ndim == 2) != 0); + if (__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L12_bool_binop_done; + } + __pyx_t_11 = ((__pyx_v_nvertices == 3) != 0); + __pyx_t_10 = __pyx_t_11; + __pyx_L12_bool_binop_done:; + if (__pyx_t_10) { -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; + /* "yt/utilities/lib/pixelization_routines.pyx":773 + * sampler = S2Sampler3D() + * elif ndim == 2 and nvertices == 3: + * sampler = P1Sampler2D() # <<<<<<<<<<<<<< + * elif ndim == 1 and nvertices == 2: + * sampler = P1Sampler1D() + */ + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); + __pyx_t_4 = 0; - /* "yt/utilities/lib/fp_utils.pxd":40 - * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "yt/utilities/lib/pixelization_routines.pyx":772 + * elif ndim == 3 and nvertices == 20: + * sampler = S2Sampler3D() + * elif ndim == 2 and nvertices == 3: # <<<<<<<<<<<<<< + * sampler = P1Sampler2D() + * elif ndim == 1 and nvertices == 2: */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; + goto __pyx_L3; } - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "yt/utilities/lib/pixelization_routines.pyx":774 + * elif ndim == 2 and nvertices == 3: + * sampler = P1Sampler2D() + * elif ndim == 1 and nvertices == 2: # <<<<<<<<<<<<<< + * sampler = P1Sampler1D() + * elif ndim == 2 and nvertices == 4: */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; + __pyx_t_11 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L14_bool_binop_done; } + __pyx_t_11 = ((__pyx_v_nvertices == 2) != 0); + __pyx_t_10 = __pyx_t_11; + __pyx_L14_bool_binop_done:; + if (__pyx_t_10) { - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + /* "yt/utilities/lib/pixelization_routines.pyx":775 + * sampler = P1Sampler2D() + * elif ndim == 1 and nvertices == 2: + * sampler = P1Sampler1D() # <<<<<<<<<<<<<< + * elif ndim == 2 and nvertices == 4: + * sampler = Q1Sampler2D() */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); + __pyx_t_4 = 0; - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 - * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "yt/utilities/lib/pixelization_routines.pyx":774 + * elif ndim == 2 and nvertices == 3: + * sampler = P1Sampler2D() + * elif ndim == 1 and nvertices == 2: # <<<<<<<<<<<<<< + * sampler = P1Sampler1D() + * elif ndim == 2 and nvertices == 4: */ + goto __pyx_L3; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "yt/utilities/lib/pixelization_routines.pyx":776 + * elif ndim == 1 and nvertices == 2: + * sampler = P1Sampler1D() + * elif ndim == 2 and nvertices == 4: # <<<<<<<<<<<<<< + * sampler = Q1Sampler2D() + * elif ndim == 2 and nvertices == 9: */ + __pyx_t_11 = ((__pyx_v_ndim == 2) != 0); + if (__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_11 = ((__pyx_v_nvertices == 4) != 0); + __pyx_t_10 = __pyx_t_11; + __pyx_L16_bool_binop_done:; + if (__pyx_t_10) { -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "yt/utilities/lib/pixelization_routines.pyx":777 + * sampler = P1Sampler1D() + * elif ndim == 2 and nvertices == 4: + * sampler = Q1Sampler2D() # <<<<<<<<<<<<<< + * elif ndim == 2 and nvertices == 9: + * sampler = Q2Sampler2D() */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "yt/utilities/lib/pixelization_routines.pyx":776 + * elif ndim == 1 and nvertices == 2: + * sampler = P1Sampler1D() + * elif ndim == 2 and nvertices == 4: # <<<<<<<<<<<<<< + * sampler = Q1Sampler2D() + * elif ndim == 2 and nvertices == 9: + */ + goto __pyx_L3; } - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "yt/utilities/lib/pixelization_routines.pyx":778 + * elif ndim == 2 and nvertices == 4: + * sampler = Q1Sampler2D() + * elif ndim == 2 and nvertices == 9: # <<<<<<<<<<<<<< + * sampler = Q2Sampler2D() + * elif ndim == 2 and nvertices == 6: */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; + __pyx_t_11 = ((__pyx_v_ndim == 2) != 0); + if (__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L18_bool_binop_done; } + __pyx_t_11 = ((__pyx_v_nvertices == 9) != 0); + __pyx_t_10 = __pyx_t_11; + __pyx_L18_bool_binop_done:; + if (__pyx_t_10) { - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fclip(np.float64_t f, + /* "yt/utilities/lib/pixelization_routines.pyx":779 + * sampler = Q1Sampler2D() + * elif ndim == 2 and nvertices == 9: + * sampler = Q2Sampler2D() # <<<<<<<<<<<<<< + * elif ndim == 2 and nvertices == 6: + * sampler = T2Sampler2D() */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); + __pyx_t_4 = 0; - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "yt/utilities/lib/pixelization_routines.pyx":778 + * elif ndim == 2 and nvertices == 4: + * sampler = Q1Sampler2D() + * elif ndim == 2 and nvertices == 9: # <<<<<<<<<<<<<< + * sampler = Q2Sampler2D() + * elif ndim == 2 and nvertices == 6: */ + goto __pyx_L3; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "yt/utilities/lib/pixelization_routines.pyx":780 + * elif ndim == 2 and nvertices == 9: + * sampler = Q2Sampler2D() + * elif ndim == 2 and nvertices == 6: # <<<<<<<<<<<<<< + * sampler = T2Sampler2D() + * elif ndim == 3 and nvertices == 10: + */ + __pyx_t_11 = ((__pyx_v_ndim == 2) != 0); + if (__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L20_bool_binop_done; + } + __pyx_t_11 = ((__pyx_v_nvertices == 6) != 0); + __pyx_t_10 = __pyx_t_11; + __pyx_L20_bool_binop_done:; + if (__pyx_t_10) { -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "yt/utilities/lib/pixelization_routines.pyx":781 + * sampler = Q2Sampler2D() + * elif ndim == 2 and nvertices == 6: + * sampler = T2Sampler2D() # <<<<<<<<<<<<<< + * elif ndim == 3 and nvertices == 10: + * sampler = Tet2Sampler3D() */ + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); + __pyx_t_4 = 0; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; + /* "yt/utilities/lib/pixelization_routines.pyx":780 + * elif ndim == 2 and nvertices == 9: + * sampler = Q2Sampler2D() + * elif ndim == 2 and nvertices == 6: # <<<<<<<<<<<<<< + * sampler = T2Sampler2D() + * elif ndim == 3 and nvertices == 10: + */ + goto __pyx_L3; + } - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":782 + * elif ndim == 2 and nvertices == 6: + * sampler = T2Sampler2D() + * elif ndim == 3 and nvertices == 10: # <<<<<<<<<<<<<< + * sampler = Tet2Sampler3D() + * else: + */ + __pyx_t_11 = ((__pyx_v_ndim == 3) != 0); + if (__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L22_bool_binop_done; + } + __pyx_t_11 = ((__pyx_v_nvertices == 10) != 0); + __pyx_t_10 = __pyx_t_11; + __pyx_L22_bool_binop_done:; + if (__pyx_t_10) { + + /* "yt/utilities/lib/pixelization_routines.pyx":783 + * sampler = T2Sampler2D() + * elif ndim == 3 and nvertices == 10: + * sampler = Tet2Sampler3D() # <<<<<<<<<<<<<< + * else: + * raise YTElementTypeNotRecognized(ndim, nvertices) + */ + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "yt/utilities/lib/pixelization_routines.pyx":782 + * elif ndim == 2 and nvertices == 6: + * sampler = T2Sampler2D() + * elif ndim == 3 and nvertices == 10: # <<<<<<<<<<<<<< + * sampler = Tet2Sampler3D() + * else: + */ + goto __pyx_L3; + } + + /* "yt/utilities/lib/pixelization_routines.pyx":785 + * sampler = Tet2Sampler3D() + * else: + * raise YTElementTypeNotRecognized(ndim, nvertices) # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * # if we are in 2D land, the 1 cell thick dimension had better be 'z' */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + /*else*/ { + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTElementTypeNotRecognized); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nvertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_1, __pyx_t_2}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_1, __pyx_t_2}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_13 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (__pyx_t_12) { + __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_6, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_6, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __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, 785, __pyx_L1_error) + } + __pyx_L3:; - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i + /* "yt/utilities/lib/pixelization_routines.pyx":788 * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + * # if we are in 2D land, the 1 cell thick dimension had better be 'z' + * if ndim == 2: # <<<<<<<<<<<<<< + * if buff_size[2] != 1: + * raise RuntimeError("Slices of 2D datasets must be " */ + __pyx_t_10 = ((__pyx_v_ndim == 2) != 0); + if (__pyx_t_10) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "yt/utilities/lib/pixelization_routines.pyx":789 + * # if we are in 2D land, the 1 cell thick dimension had better be 'z' + * if ndim == 2: + * if buff_size[2] != 1: # <<<<<<<<<<<<<< + * raise RuntimeError("Slices of 2D datasets must be " + * "perpendicular to the 'z' direction.") + */ + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_buff_size, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_10) { -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "yt/utilities/lib/pixelization_routines.pyx":790 + * if ndim == 2: + * if buff_size[2] != 1: + * raise RuntimeError("Slices of 2D datasets must be " # <<<<<<<<<<<<<< + * "perpendicular to the 'z' direction.") * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 790, __pyx_L1_error) -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; + /* "yt/utilities/lib/pixelization_routines.pyx":789 + * # if we are in 2D land, the 1 cell thick dimension had better be 'z' + * if ndim == 2: + * if buff_size[2] != 1: # <<<<<<<<<<<<<< + * raise RuntimeError("Slices of 2D datasets must be " + * "perpendicular to the 'z' direction.") + */ + } - /* "yt/utilities/lib/fp_utils.pxd":54 - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "yt/utilities/lib/pixelization_routines.pyx":788 * + * # if we are in 2D land, the 1 cell thick dimension had better be 'z' + * if ndim == 2: # <<<<<<<<<<<<<< + * if buff_size[2] != 1: + * raise RuntimeError("Slices of 2D datasets must be " */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":794 + * + * # allocate temporary storage + * vertices = malloc(ndim * sizeof(np.float64_t) * nvertices) # <<<<<<<<<<<<<< + * field_vals = malloc(sizeof(np.float64_t) * num_field_vals) * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_v_vertices = ((__pyx_t_5numpy_float64_t *)malloc(((__pyx_v_ndim * (sizeof(__pyx_t_5numpy_float64_t))) * __pyx_v_nvertices))); - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "yt/utilities/lib/pixelization_routines.pyx":795 + * # allocate temporary storage + * vertices = malloc(ndim * sizeof(np.float64_t) * nvertices) + * field_vals = malloc(sizeof(np.float64_t) * num_field_vals) # <<<<<<<<<<<<<< * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 + * # fill the image bounds and pixel size informaton here */ + __pyx_v_field_vals = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_num_field_vals))); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "yt/utilities/lib/pixelization_routines.pyx":798 * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * # fill the image bounds and pixel size informaton here + * for i in range(ndim): # <<<<<<<<<<<<<< + * pLE[i] = extents[i][0] + * pRE[i] = extents[i][1] */ + __pyx_t_6 = __pyx_v_ndim; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_6; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 - * + /* "yt/utilities/lib/pixelization_routines.pyx":799 + * # fill the image bounds and pixel size informaton here + * for i in range(ndim): + * pLE[i] = extents[i][0] # <<<<<<<<<<<<<< + * pRE[i] = extents[i][1] + * dds[i] = (pRE[i] - pLE[i])/buff_size[i] */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_extents, __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 799, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + (__pyx_v_pLE[__pyx_v_i]) = __pyx_t_15; - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/pixelization_routines.pyx":800 + * for i in range(ndim): + * pLE[i] = extents[i][0] + * pRE[i] = extents[i][1] # <<<<<<<<<<<<<< + * dds[i] = (pRE[i] - pLE[i])/buff_size[i] + * if dds[i] == 0.0: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_extents, __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 800, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 800, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + (__pyx_v_pRE[__pyx_v_i]) = __pyx_t_15; - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + /* "yt/utilities/lib/pixelization_routines.pyx":801 + * pLE[i] = extents[i][0] + * pRE[i] = extents[i][1] + * dds[i] = (pRE[i] - pLE[i])/buff_size[i] # <<<<<<<<<<<<<< + * if dds[i] == 0.0: + * idds[i] = 0.0 */ + __pyx_t_3 = PyFloat_FromDouble(((__pyx_v_pRE[__pyx_v_i]) - (__pyx_v_pLE[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_buff_size, __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 801, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + (__pyx_v_dds[__pyx_v_i]) = __pyx_t_15; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + /* "yt/utilities/lib/pixelization_routines.pyx":802 + * pRE[i] = extents[i][1] + * dds[i] = (pRE[i] - pLE[i])/buff_size[i] + * if dds[i] == 0.0: # <<<<<<<<<<<<<< + * idds[i] = 0.0 + * else: */ + __pyx_t_10 = (((__pyx_v_dds[__pyx_v_i]) == 0.0) != 0); + if (__pyx_t_10) { -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; - - /* "vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< - * - * + /* "yt/utilities/lib/pixelization_routines.pyx":803 + * dds[i] = (pRE[i] - pLE[i])/buff_size[i] + * if dds[i] == 0.0: + * idds[i] = 0.0 # <<<<<<<<<<<<<< + * else: + * idds[i] = 1.0 / dds[i] */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); - goto __pyx_L0; + (__pyx_v_idds[__pyx_v_i]) = 0.0; - /* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + /* "yt/utilities/lib/pixelization_routines.pyx":802 + * pRE[i] = extents[i][1] + * dds[i] = (pRE[i] - pLE[i])/buff_size[i] + * if dds[i] == 0.0: # <<<<<<<<<<<<<< + * idds[i] = 0.0 + * else: */ + goto __pyx_L28; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double *__pyx_v_a, double *__pyx_v_b) { - double __pyx_r; + /* "yt/utilities/lib/pixelization_routines.pyx":805 + * idds[i] = 0.0 + * else: + * idds[i] = 1.0 / dds[i] # <<<<<<<<<<<<<< + * + * with cython.boundscheck(False): + */ + /*else*/ { + if (unlikely((__pyx_v_dds[__pyx_v_i]) == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + __PYX_ERR(0, 805, __pyx_L1_error) + } + (__pyx_v_idds[__pyx_v_i]) = (1.0 / (__pyx_v_dds[__pyx_v_i])); + } + __pyx_L28:; + } - /* "vec3_ops.pxd":11 - * cdef inline cython.floating dot(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":808 * + * with cython.boundscheck(False): + * for ci in range(conn.shape[0]): # <<<<<<<<<<<<<< * + * # Fill the vertices */ - __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); - goto __pyx_L0; + __pyx_t_16 = (__pyx_v_conn->dimensions[0]); + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_16; __pyx_t_14+=1) { + __pyx_v_ci = __pyx_t_14; - /* "vec3_ops.pxd":9 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + /* "yt/utilities/lib/pixelization_routines.pyx":811 + * + * # Fill the vertices + * LE[0] = LE[1] = LE[2] = 1e60 # <<<<<<<<<<<<<< + * RE[0] = RE[1] = RE[2] = -1e60 + * */ + (__pyx_v_LE[0]) = 1e60; + (__pyx_v_LE[1]) = 1e60; + (__pyx_v_LE[2]) = 1e60; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "yt/utilities/lib/pixelization_routines.pyx":812 + * # Fill the vertices + * LE[0] = LE[1] = LE[2] = 1e60 + * RE[0] = RE[1] = RE[2] = -1e60 # <<<<<<<<<<<<<< + * + * for n in range(num_field_vals): */ + (__pyx_v_RE[0]) = -1e60; + (__pyx_v_RE[1]) = -1e60; + (__pyx_v_RE[2]) = -1e60; -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - - /* "vec3_ops.pxd":20 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "yt/utilities/lib/pixelization_routines.pyx":814 + * RE[0] = RE[1] = RE[2] = -1e60 + * + * for n in range(num_field_vals): # <<<<<<<<<<<<<< + * field_vals[n] = field[ci, n] + * */ - (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); + __pyx_t_6 = __pyx_v_num_field_vals; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_6; __pyx_t_17+=1) { + __pyx_v_n = __pyx_t_17; - /* "vec3_ops.pxd":21 - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "yt/utilities/lib/pixelization_routines.pyx":815 * + * for n in range(num_field_vals): + * field_vals[n] = field[ci, n] # <<<<<<<<<<<<<< + * + * for n in range(nvertices): */ - (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); + __pyx_t_18 = __pyx_v_ci; + __pyx_t_19 = __pyx_v_n; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_field.diminfo[0].shape; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_field.diminfo[1].shape; + (__pyx_v_field_vals[__pyx_v_n]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_field.diminfo[1].strides)); + } - /* "vec3_ops.pxd":22 - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/pixelization_routines.pyx":817 + * field_vals[n] = field[ci, n] * + * for n in range(nvertices): # <<<<<<<<<<<<<< + * cj = conn[ci, n] - index_offset + * for i in range(ndim): */ - (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + __pyx_t_6 = __pyx_v_nvertices; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_6; __pyx_t_17+=1) { + __pyx_v_n = __pyx_t_17; - /* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "yt/utilities/lib/pixelization_routines.pyx":818 + * + * for n in range(nvertices): + * cj = conn[ci, n] - index_offset # <<<<<<<<<<<<<< + * for i in range(ndim): + * vertices[ndim*n + i] = coords[cj, i] */ + __pyx_t_20 = __pyx_v_ci; + __pyx_t_21 = __pyx_v_n; + if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_pybuffernd_conn.diminfo[0].shape; + if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_conn.diminfo[1].shape; + __pyx_v_cj = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_conn.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_conn.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_conn.diminfo[1].strides)) - __pyx_v_index_offset); - /* function exit code */ -} - -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { + /* "yt/utilities/lib/pixelization_routines.pyx":819 + * for n in range(nvertices): + * cj = conn[ci, n] - index_offset + * for i in range(ndim): # <<<<<<<<<<<<<< + * vertices[ndim*n + i] = coords[cj, i] + * LE[i] = fmin(LE[i], vertices[ndim*n+i]) + */ + __pyx_t_22 = __pyx_v_ndim; + for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { + __pyx_v_i = __pyx_t_23; - /* "vec3_ops.pxd":20 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "yt/utilities/lib/pixelization_routines.pyx":820 + * cj = conn[ci, n] - index_offset + * for i in range(ndim): + * vertices[ndim*n + i] = coords[cj, i] # <<<<<<<<<<<<<< + * LE[i] = fmin(LE[i], vertices[ndim*n+i]) + * RE[i] = fmax(RE[i], vertices[ndim*n+i]) */ - (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); + __pyx_t_24 = __pyx_v_cj; + __pyx_t_25 = __pyx_v_i; + if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_pybuffernd_coords.diminfo[0].shape; + if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_pybuffernd_coords.diminfo[1].shape; + (__pyx_v_vertices[((__pyx_v_ndim * __pyx_v_n) + __pyx_v_i)]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_coords.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_coords.diminfo[1].strides)); - /* "vec3_ops.pxd":21 - * cython.floating c[3]) nogil: - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< - * c[2] = a[0]*b[1] - a[1]*b[0] + /* "yt/utilities/lib/pixelization_routines.pyx":821 + * for i in range(ndim): + * vertices[ndim*n + i] = coords[cj, i] + * LE[i] = fmin(LE[i], vertices[ndim*n+i]) # <<<<<<<<<<<<<< + * RE[i] = fmax(RE[i], vertices[ndim*n+i]) * */ - (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); + (__pyx_v_LE[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin((__pyx_v_LE[__pyx_v_i]), (__pyx_v_vertices[((__pyx_v_ndim * __pyx_v_n) + __pyx_v_i)])); - /* "vec3_ops.pxd":22 - * c[0] = a[1]*b[2] - a[2]*b[1] - * c[1] = a[2]*b[0] - a[0]*b[2] - * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":822 + * vertices[ndim*n + i] = coords[cj, i] + * LE[i] = fmin(LE[i], vertices[ndim*n+i]) + * RE[i] = fmax(RE[i], vertices[ndim*n+i]) # <<<<<<<<<<<<<< * + * use = 1 + */ + (__pyx_v_RE[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax((__pyx_v_RE[__pyx_v_i]), (__pyx_v_vertices[((__pyx_v_ndim * __pyx_v_n) + __pyx_v_i)])); + } + } + + /* "yt/utilities/lib/pixelization_routines.pyx":824 + * RE[i] = fmax(RE[i], vertices[ndim*n+i]) * + * use = 1 # <<<<<<<<<<<<<< + * for i in range(ndim): + * if RE[i] < pLE[i] or LE[i] >= pRE[i]: */ - (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + __pyx_v_use = 1; - /* "vec3_ops.pxd":17 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "yt/utilities/lib/pixelization_routines.pyx":825 + * + * use = 1 + * for i in range(ndim): # <<<<<<<<<<<<<< + * if RE[i] < pLE[i] or LE[i] >= pRE[i]: + * use = 0 */ + __pyx_t_6 = __pyx_v_ndim; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_6; __pyx_t_17+=1) { + __pyx_v_i = __pyx_t_17; - /* function exit code */ -} + /* "yt/utilities/lib/pixelization_routines.pyx":826 + * use = 1 + * for i in range(ndim): + * if RE[i] < pLE[i] or LE[i] >= pRE[i]: # <<<<<<<<<<<<<< + * use = 0 + * break + */ + __pyx_t_11 = (((__pyx_v_RE[__pyx_v_i]) < (__pyx_v_pLE[__pyx_v_i])) != 0); + if (!__pyx_t_11) { + } else { + __pyx_t_10 = __pyx_t_11; + goto __pyx_L40_bool_binop_done; + } + __pyx_t_11 = (((__pyx_v_LE[__pyx_v_i]) >= (__pyx_v_pRE[__pyx_v_i])) != 0); + __pyx_t_10 = __pyx_t_11; + __pyx_L40_bool_binop_done:; + if (__pyx_t_10) { -/* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "yt/utilities/lib/pixelization_routines.pyx":827 + * for i in range(ndim): + * if RE[i] < pLE[i] or LE[i] >= pRE[i]: + * use = 0 # <<<<<<<<<<<<<< + * break + * pstart[i] = i64max( ((LE[i] - pLE[i])*idds[i]) - 1, 0) */ + __pyx_v_use = 0; -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { + /* "yt/utilities/lib/pixelization_routines.pyx":828 + * if RE[i] < pLE[i] or LE[i] >= pRE[i]: + * use = 0 + * break # <<<<<<<<<<<<<< + * pstart[i] = i64max( ((LE[i] - pLE[i])*idds[i]) - 1, 0) + * pend[i] = i64min( ((RE[i] - pLE[i])*idds[i]) + 1, img.shape[i]-1) + */ + goto __pyx_L38_break; - /* "vec3_ops.pxd":31 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] + /* "yt/utilities/lib/pixelization_routines.pyx":826 + * use = 1 + * for i in range(ndim): + * if RE[i] < pLE[i] or LE[i] >= pRE[i]: # <<<<<<<<<<<<<< + * use = 0 + * break */ - (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); + } - /* "vec3_ops.pxd":32 - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< - * c[2] = a[2] - b[2] + /* "yt/utilities/lib/pixelization_routines.pyx":829 + * use = 0 + * break + * pstart[i] = i64max( ((LE[i] - pLE[i])*idds[i]) - 1, 0) # <<<<<<<<<<<<<< + * pend[i] = i64min( ((RE[i] - pLE[i])*idds[i]) + 1, img.shape[i]-1) * */ - (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); + (__pyx_v_pstart[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max((((__pyx_t_5numpy_int64_t)(((__pyx_v_LE[__pyx_v_i]) - (__pyx_v_pLE[__pyx_v_i])) * (__pyx_v_idds[__pyx_v_i]))) - 1), 0); - /* "vec3_ops.pxd":33 - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/pixelization_routines.pyx":830 + * break + * pstart[i] = i64max( ((LE[i] - pLE[i])*idds[i]) - 1, 0) + * pend[i] = i64min( ((RE[i] - pLE[i])*idds[i]) + 1, img.shape[i]-1) # <<<<<<<<<<<<<< * + * # override for the low-dimensional case */ - (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + (__pyx_v_pend[__pyx_v_i]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min((((__pyx_t_5numpy_int64_t)(((__pyx_v_RE[__pyx_v_i]) - (__pyx_v_pLE[__pyx_v_i])) * (__pyx_v_idds[__pyx_v_i]))) + 1), ((__pyx_v_img->dimensions[__pyx_v_i]) - 1)); + } + __pyx_L38_break:; - /* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "yt/utilities/lib/pixelization_routines.pyx":833 + * + * # override for the low-dimensional case + * if ndim < 3: # <<<<<<<<<<<<<< + * pstart[2] = 0 + * pend[2] = 0 */ + __pyx_t_10 = ((__pyx_v_ndim < 3) != 0); + if (__pyx_t_10) { - /* function exit code */ -} - -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "vec3_ops.pxd":31 - * const cython.floating[3] b, - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] + /* "yt/utilities/lib/pixelization_routines.pyx":834 + * # override for the low-dimensional case + * if ndim < 3: + * pstart[2] = 0 # <<<<<<<<<<<<<< + * pend[2] = 0 + * if ndim < 2: */ - (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); + (__pyx_v_pstart[2]) = 0; - /* "vec3_ops.pxd":32 - * cython.floating c[3]) nogil: - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< - * c[2] = a[2] - b[2] - * + /* "yt/utilities/lib/pixelization_routines.pyx":835 + * if ndim < 3: + * pstart[2] = 0 + * pend[2] = 0 # <<<<<<<<<<<<<< + * if ndim < 2: + * pstart[1] = 0 */ - (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); + (__pyx_v_pend[2]) = 0; - /* "vec3_ops.pxd":33 - * c[0] = a[0] - b[0] - * c[1] = a[1] - b[1] - * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/pixelization_routines.pyx":833 * + * # override for the low-dimensional case + * if ndim < 3: # <<<<<<<<<<<<<< + * pstart[2] = 0 + * pend[2] = 0 */ - (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + } - /* "vec3_ops.pxd":28 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b, - * cython.floating c[3]) nogil: + /* "yt/utilities/lib/pixelization_routines.pyx":836 + * pstart[2] = 0 + * pend[2] = 0 + * if ndim < 2: # <<<<<<<<<<<<<< + * pstart[1] = 0 + * pend[1] = 0 */ + __pyx_t_10 = ((__pyx_v_ndim < 2) != 0); + if (__pyx_t_10) { - /* function exit code */ -} + /* "yt/utilities/lib/pixelization_routines.pyx":837 + * pend[2] = 0 + * if ndim < 2: + * pstart[1] = 0 # <<<<<<<<<<<<<< + * pend[1] = 0 + * + */ + (__pyx_v_pstart[1]) = 0; -/* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "yt/utilities/lib/pixelization_routines.pyx":838 + * if ndim < 2: + * pstart[1] = 0 + * pend[1] = 0 # <<<<<<<<<<<<<< + * + * if use == 0: */ + (__pyx_v_pend[1]) = 0; -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(float *__pyx_v_a, float *__pyx_v_b) { - float __pyx_r; + /* "yt/utilities/lib/pixelization_routines.pyx":836 + * pstart[2] = 0 + * pend[2] = 0 + * if ndim < 2: # <<<<<<<<<<<<<< + * pstart[1] = 0 + * pend[1] = 0 + */ + } - /* "vec3_ops.pxd":41 - * cdef inline cython.floating distance(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":840 + * pend[1] = 0 * + * if use == 0: # <<<<<<<<<<<<<< + * continue * */ - __pyx_r = sqrt(((powf(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + powf(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + powf(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); - goto __pyx_L0; + __pyx_t_10 = ((__pyx_v_use == 0) != 0); + if (__pyx_t_10) { - /* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "yt/utilities/lib/pixelization_routines.pyx":841 + * + * if use == 0: + * continue # <<<<<<<<<<<<<< + * + * # Now our bounding box intersects, so we get the extents of our pixel */ + goto __pyx_L29_continue; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(double *__pyx_v_a, double *__pyx_v_b) { - double __pyx_r; - - /* "vec3_ops.pxd":41 - * cdef inline cython.floating distance(const cython.floating[3] a, - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":840 + * pend[1] = 0 * + * if use == 0: # <<<<<<<<<<<<<< + * continue * */ - __pyx_r = sqrt(((pow(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + pow(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + pow(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); - goto __pyx_L0; + } - /* "vec3_ops.pxd":39 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< - * const cython.floating[3] b) nogil: - * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) + /* "yt/utilities/lib/pixelization_routines.pyx":846 + * # region which overlaps with the bounding box, and we'll check each + * # pixel in there. + * for pi in range(pstart[0], pend[0] + 1): # <<<<<<<<<<<<<< + * ppoint[0] = (pi + 0.5) * dds[0] + pLE[0] + * for pj in range(pstart[1], pend[1] + 1): */ + __pyx_t_17 = ((__pyx_v_pend[0]) + 1); + for (__pyx_t_23 = (__pyx_v_pstart[0]); __pyx_t_23 < __pyx_t_17; __pyx_t_23+=1) { + __pyx_v_pi = __pyx_t_23; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "yt/utilities/lib/pixelization_routines.pyx":847 + * # pixel in there. + * for pi in range(pstart[0], pend[0] + 1): + * ppoint[0] = (pi + 0.5) * dds[0] + pLE[0] # <<<<<<<<<<<<<< + * for pj in range(pstart[1], pend[1] + 1): + * ppoint[1] = (pj + 0.5) * dds[1] + pLE[1] */ + (__pyx_v_ppoint[0]) = (((__pyx_v_pi + 0.5) * (__pyx_v_dds[0])) + (__pyx_v_pLE[0])); -static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(float const __pyx_v_f, float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - - /* "vec3_ops.pxd":51 - * const cython.floating[3] b, - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] + /* "yt/utilities/lib/pixelization_routines.pyx":848 + * for pi in range(pstart[0], pend[0] + 1): + * ppoint[0] = (pi + 0.5) * dds[0] + pLE[0] + * for pj in range(pstart[1], pend[1] + 1): # <<<<<<<<<<<<<< + * ppoint[1] = (pj + 0.5) * dds[1] + pLE[1] + * for pk in range(pstart[2], pend[2] + 1): */ - (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); + __pyx_t_26 = ((__pyx_v_pend[1]) + 1); + for (__pyx_t_27 = (__pyx_v_pstart[1]); __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) { + __pyx_v_pj = __pyx_t_27; - /* "vec3_ops.pxd":52 - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< - * c[2] = f * a[2] + b[2] - * + /* "yt/utilities/lib/pixelization_routines.pyx":849 + * ppoint[0] = (pi + 0.5) * dds[0] + pLE[0] + * for pj in range(pstart[1], pend[1] + 1): + * ppoint[1] = (pj + 0.5) * dds[1] + pLE[1] # <<<<<<<<<<<<<< + * for pk in range(pstart[2], pend[2] + 1): + * ppoint[2] = (pk + 0.5) * dds[2] + pLE[2] */ - (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); + (__pyx_v_ppoint[1]) = (((__pyx_v_pj + 0.5) * (__pyx_v_dds[1])) + (__pyx_v_pLE[1])); - /* "vec3_ops.pxd":53 - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< - * - * + /* "yt/utilities/lib/pixelization_routines.pyx":850 + * for pj in range(pstart[1], pend[1] + 1): + * ppoint[1] = (pj + 0.5) * dds[1] + pLE[1] + * for pk in range(pstart[2], pend[2] + 1): # <<<<<<<<<<<<<< + * ppoint[2] = (pk + 0.5) * dds[2] + pLE[2] + * # Now we just need to figure out if our ppoint is within */ - (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); + __pyx_t_28 = ((__pyx_v_pend[2]) + 1); + for (__pyx_t_29 = (__pyx_v_pstart[2]); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_pk = __pyx_t_29; - /* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "yt/utilities/lib/pixelization_routines.pyx":851 + * ppoint[1] = (pj + 0.5) * dds[1] + pLE[1] + * for pk in range(pstart[2], pend[2] + 1): + * ppoint[2] = (pk + 0.5) * dds[2] + pLE[2] # <<<<<<<<<<<<<< + * # Now we just need to figure out if our ppoint is within + * # our set of vertices. */ + (__pyx_v_ppoint[2]) = (((__pyx_v_pk + 0.5) * (__pyx_v_dds[2])) + (__pyx_v_pLE[2])); - /* function exit code */ -} - -static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const __pyx_v_f, double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { - - /* "vec3_ops.pxd":51 - * const cython.floating[3] b, - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] + /* "yt/utilities/lib/pixelization_routines.pyx":854 + * # Now we just need to figure out if our ppoint is within + * # our set of vertices. + * sampler.map_real_to_unit(mapped_coord, vertices, ppoint) # <<<<<<<<<<<<<< + * if not sampler.check_inside(mapped_coord): + * continue */ - (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler->__pyx_vtab)->map_real_to_unit(__pyx_v_sampler, __pyx_v_mapped_coord, __pyx_v_vertices, __pyx_v_ppoint); - /* "vec3_ops.pxd":52 - * cython.floating[3] c) nogil: - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< - * c[2] = f * a[2] + b[2] - * + /* "yt/utilities/lib/pixelization_routines.pyx":855 + * # our set of vertices. + * sampler.map_real_to_unit(mapped_coord, vertices, ppoint) + * if not sampler.check_inside(mapped_coord): # <<<<<<<<<<<<<< + * continue + * if (num_field_vals == 1): */ - (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); + __pyx_t_10 = ((!(((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler->__pyx_vtab)->check_inside(__pyx_v_sampler, __pyx_v_mapped_coord) != 0)) != 0); + if (__pyx_t_10) { - /* "vec3_ops.pxd":53 - * c[0] = f * a[0] + b[0] - * c[1] = f * a[1] + b[1] - * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< - * - * + /* "yt/utilities/lib/pixelization_routines.pyx":856 + * sampler.map_real_to_unit(mapped_coord, vertices, ppoint) + * if not sampler.check_inside(mapped_coord): + * continue # <<<<<<<<<<<<<< + * if (num_field_vals == 1): + * img[pi, pj, pk] = field_vals[0] */ - (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); + goto __pyx_L49_continue; - /* "vec3_ops.pxd":47 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< - * const cython.floating[3] a, - * const cython.floating[3] b, + /* "yt/utilities/lib/pixelization_routines.pyx":855 + * # our set of vertices. + * sampler.map_real_to_unit(mapped_coord, vertices, ppoint) + * if not sampler.check_inside(mapped_coord): # <<<<<<<<<<<<<< + * continue + * if (num_field_vals == 1): */ + } - /* function exit code */ -} + /* "yt/utilities/lib/pixelization_routines.pyx":857 + * if not sampler.check_inside(mapped_coord): + * continue + * if (num_field_vals == 1): # <<<<<<<<<<<<<< + * img[pi, pj, pk] = field_vals[0] + * else: + */ + __pyx_t_10 = ((__pyx_v_num_field_vals == 1) != 0); + if (__pyx_t_10) { -/* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "yt/utilities/lib/pixelization_routines.pyx":858 + * continue + * if (num_field_vals == 1): + * img[pi, pj, pk] = field_vals[0] # <<<<<<<<<<<<<< + * else: + * img[pi, pj, pk] = sampler.sample_at_unit_point(mapped_coord, */ + __pyx_t_30 = __pyx_v_pi; + __pyx_t_31 = __pyx_v_pj; + __pyx_t_32 = __pyx_v_pk; + if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_pybuffernd_img.diminfo[0].shape; + if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_pybuffernd_img.diminfo[1].shape; + if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_pybuffernd_img.diminfo[2].shape; + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_img.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_img.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_img.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_img.diminfo[2].strides) = (__pyx_v_field_vals[0]); -static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(float *__pyx_v_a) { - float __pyx_r; + /* "yt/utilities/lib/pixelization_routines.pyx":857 + * if not sampler.check_inside(mapped_coord): + * continue + * if (num_field_vals == 1): # <<<<<<<<<<<<<< + * img[pi, pj, pk] = field_vals[0] + * else: + */ + goto __pyx_L52; + } - /* "vec3_ops.pxd":60 - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":860 + * img[pi, pj, pk] = field_vals[0] + * else: + * img[pi, pj, pk] = sampler.sample_at_unit_point(mapped_coord, # <<<<<<<<<<<<<< + * field_vals) + * free(vertices) */ - __pyx_r = sqrt(((((__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; + /*else*/ { - /* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "yt/utilities/lib/pixelization_routines.pyx":861 + * else: + * img[pi, pj, pk] = sampler.sample_at_unit_point(mapped_coord, + * field_vals) # <<<<<<<<<<<<<< + * free(vertices) + * free(field_vals) */ + __pyx_t_33 = __pyx_v_pi; + __pyx_t_34 = __pyx_v_pj; + __pyx_t_35 = __pyx_v_pk; + if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_pybuffernd_img.diminfo[0].shape; + if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_pybuffernd_img.diminfo[1].shape; + if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_pybuffernd_img.diminfo[2].shape; + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_img.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_img.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_img.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_img.diminfo[2].strides) = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler->__pyx_vtab)->sample_at_unit_point(__pyx_v_sampler, __pyx_v_mapped_coord, __pyx_v_field_vals); + } + __pyx_L52:; + __pyx_L49_continue:; + } + } + } + __pyx_L29_continue:; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "yt/utilities/lib/pixelization_routines.pyx":862 + * img[pi, pj, pk] = sampler.sample_at_unit_point(mapped_coord, + * field_vals) + * free(vertices) # <<<<<<<<<<<<<< + * free(field_vals) + * return img + */ + free(__pyx_v_vertices); -static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *__pyx_v_a) { - double __pyx_r; + /* "yt/utilities/lib/pixelization_routines.pyx":863 + * field_vals) + * free(vertices) + * free(field_vals) # <<<<<<<<<<<<<< + * return img + * + */ + free(__pyx_v_field_vals); - /* "vec3_ops.pxd":60 - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":864 + * free(vertices) + * free(field_vals) + * return img # <<<<<<<<<<<<<< + * + * def pixelize_element_mesh_line(np.ndarray[np.float64_t, ndim=2] coords, */ - __pyx_r = sqrt(((((__pyx_v_a[0]) * (__pyx_v_a[0])) + ((__pyx_v_a[1]) * (__pyx_v_a[1]))) + ((__pyx_v_a[2]) * (__pyx_v_a[2])))); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_img)); + __pyx_r = ((PyObject *)__pyx_v_img); goto __pyx_L0; - /* "vec3_ops.pxd":59 - * @cython.wraparound(False) - * @cython.cdivision(True) - * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< - * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + /* "yt/utilities/lib/pixelization_routines.pyx":729 + * + * + * def pixelize_element_mesh(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< + * np.ndarray[np.int64_t, ndim=2] conn, + * buff_size, */ /* function exit code */ - __pyx_L0:; - return __pyx_r; + __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_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conn.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_element_mesh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conn.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_img.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_img); + __Pyx_XDECREF((PyObject *)__pyx_v_sampler); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. +/* "yt/utilities/lib/pixelization_routines.pyx":866 + * return img + * + * def pixelize_element_mesh_line(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< + * np.ndarray[np.int64_t, ndim=2] conn, + * np.ndarray[np.float64_t, ndim=1] start_point, */ /* 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; +static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_13pixelize_element_mesh_line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_13pixelize_element_mesh_line = {"pixelize_element_mesh_line", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_13pixelize_element_mesh_line, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_2yt_9utilities_3lib_21pixelization_routines_13pixelize_element_mesh_line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_coords = 0; + PyArrayObject *__pyx_v_conn = 0; + PyArrayObject *__pyx_v_start_point = 0; + PyArrayObject *__pyx_v_end_point = 0; + PyObject *__pyx_v_npoints = 0; + PyArrayObject *__pyx_v_field = 0; + int __pyx_v_index_offset; + PyObject *__pyx_r = 0; __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)); + __Pyx_RefNannySetupContext("pixelize_element_mesh_line (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coords,&__pyx_n_s_conn,&__pyx_n_s_start_point,&__pyx_n_s_end_point,&__pyx_n_s_npoints,&__pyx_n_s_field,&__pyx_n_s_index_offset,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conn)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh_line", 0, 6, 7, 1); __PYX_ERR(0, 866, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_point)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh_line", 0, 6, 7, 2); __PYX_ERR(0, 866, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end_point)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh_line", 0, 6, 7, 3); __PYX_ERR(0, 866, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_npoints)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh_line", 0, 6, 7, 4); __PYX_ERR(0, 866, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh_line", 0, 6, 7, 5); __PYX_ERR(0, 866, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index_offset); + if (value) { values[6] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixelize_element_mesh_line") < 0)) __PYX_ERR(0, 866, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[4] = PyTuple_GET_ITEM(__pyx_args, 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_coords = ((PyArrayObject *)values[0]); + __pyx_v_conn = ((PyArrayObject *)values[1]); + __pyx_v_start_point = ((PyArrayObject *)values[2]); + __pyx_v_end_point = ((PyArrayObject *)values[3]); + __pyx_v_npoints = values[4]; + __pyx_v_field = ((PyArrayObject *)values[5]); + if (values[6]) { + __pyx_v_index_offset = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_index_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 872, __pyx_L3_error) + } else { + __pyx_v_index_offset = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pixelize_element_mesh_line", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 866, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_element_mesh_line", __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, 866, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_ptype_5numpy_ndarray, 1, "conn", 0))) __PYX_ERR(0, 867, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_start_point), __pyx_ptype_5numpy_ndarray, 1, "start_point", 0))) __PYX_ERR(0, 868, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_end_point), __pyx_ptype_5numpy_ndarray, 1, "end_point", 0))) __PYX_ERR(0, 869, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_5numpy_ndarray, 1, "field", 0))) __PYX_ERR(0, 871, __pyx_L1_error) + __pyx_r = __pyx_pf_2yt_9utilities_3lib_21pixelization_routines_12pixelize_element_mesh_line(__pyx_self, __pyx_v_coords, __pyx_v_conn, __pyx_v_start_point, __pyx_v_end_point, __pyx_v_npoints, __pyx_v_field, __pyx_v_index_offset); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; +static PyObject *__pyx_pf_2yt_9utilities_3lib_21pixelization_routines_12pixelize_element_mesh_line(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords, PyArrayObject *__pyx_v_conn, PyArrayObject *__pyx_v_start_point, PyArrayObject *__pyx_v_end_point, PyObject *__pyx_v_npoints, PyArrayObject *__pyx_v_field, int __pyx_v_index_offset) { + __pyx_t_5numpy_float64_t *__pyx_v_vertices; + __pyx_t_5numpy_float64_t *__pyx_v_field_vals; + int __pyx_v_nvertices; int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; + int __pyx_v_num_field_vals; + int __pyx_v_num_plot_nodes; + int __pyx_v_num_intervals; + double __pyx_v_mapped_coord[4]; + struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *__pyx_v_sampler = 0; + PyArrayObject *__pyx_v_lin_vec = 0; + PyArrayObject *__pyx_v_lin_inc = 0; + PyArrayObject *__pyx_v_lin_sample_points = 0; + __pyx_t_5numpy_int64_t __pyx_v_i; + __pyx_t_5numpy_int64_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_j; + __pyx_t_5numpy_int64_t __pyx_v_k; + PyArrayObject *__pyx_v_arc_length = 0; + __pyx_t_5numpy_float64_t __pyx_v_lin_length; + __pyx_t_5numpy_float64_t __pyx_v_inc_length; + PyArrayObject *__pyx_v_plot_values = 0; + __pyx_t_5numpy_float64_t __pyx_v_sample_point[3]; + npy_intp __pyx_v_ci; + PyObject *__pyx_v_cj = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arc_length; + __Pyx_Buffer __pyx_pybuffer_arc_length; + __Pyx_LocalBuf_ND __pyx_pybuffernd_conn; + __Pyx_Buffer __pyx_pybuffer_conn; + __Pyx_LocalBuf_ND __pyx_pybuffernd_coords; + __Pyx_Buffer __pyx_pybuffer_coords; + __Pyx_LocalBuf_ND __pyx_pybuffernd_end_point; + __Pyx_Buffer __pyx_pybuffer_end_point; + __Pyx_LocalBuf_ND __pyx_pybuffernd_field; + __Pyx_Buffer __pyx_pybuffer_field; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lin_inc; + __Pyx_Buffer __pyx_pybuffer_lin_inc; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lin_sample_points; + __Pyx_Buffer __pyx_pybuffer_lin_sample_points; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lin_vec; + __Pyx_Buffer __pyx_pybuffer_lin_vec; + __Pyx_LocalBuf_ND __pyx_pybuffernd_plot_values; + __Pyx_Buffer __pyx_pybuffer_plot_values; + __Pyx_LocalBuf_ND __pyx_pybuffernd_start_point; + __Pyx_Buffer __pyx_pybuffer_start_point; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + PyArrayObject *__pyx_t_12 = NULL; + PyArrayObject *__pyx_t_13 = NULL; + int __pyx_t_14; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_18; + __pyx_t_5numpy_int64_t __pyx_t_19; + __pyx_t_5numpy_int64_t __pyx_t_20; + int __pyx_t_21; + Py_ssize_t __pyx_t_22; + __pyx_t_5numpy_int64_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + __pyx_t_5numpy_int64_t __pyx_t_26; + __pyx_t_5numpy_int64_t __pyx_t_27; + __pyx_t_5numpy_int64_t __pyx_t_28; + __pyx_t_5numpy_int64_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + __pyx_t_5numpy_int64_t __pyx_t_31; + __pyx_t_5numpy_int64_t __pyx_t_32; + __pyx_t_5numpy_int64_t __pyx_t_33; + npy_intp __pyx_t_34; + npy_intp __pyx_t_35; + Py_ssize_t __pyx_t_36; + __pyx_t_5numpy_int64_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + __pyx_t_5numpy_int64_t __pyx_t_39; + __pyx_t_5numpy_int64_t __pyx_t_40; + __Pyx_RefNannySetupContext("pixelize_element_mesh_line", 0); + __pyx_pybuffer_lin_vec.pybuffer.buf = NULL; + __pyx_pybuffer_lin_vec.refcount = 0; + __pyx_pybuffernd_lin_vec.data = NULL; + __pyx_pybuffernd_lin_vec.rcbuffer = &__pyx_pybuffer_lin_vec; + __pyx_pybuffer_lin_inc.pybuffer.buf = NULL; + __pyx_pybuffer_lin_inc.refcount = 0; + __pyx_pybuffernd_lin_inc.data = NULL; + __pyx_pybuffernd_lin_inc.rcbuffer = &__pyx_pybuffer_lin_inc; + __pyx_pybuffer_lin_sample_points.pybuffer.buf = NULL; + __pyx_pybuffer_lin_sample_points.refcount = 0; + __pyx_pybuffernd_lin_sample_points.data = NULL; + __pyx_pybuffernd_lin_sample_points.rcbuffer = &__pyx_pybuffer_lin_sample_points; + __pyx_pybuffer_arc_length.pybuffer.buf = NULL; + __pyx_pybuffer_arc_length.refcount = 0; + __pyx_pybuffernd_arc_length.data = NULL; + __pyx_pybuffernd_arc_length.rcbuffer = &__pyx_pybuffer_arc_length; + __pyx_pybuffer_plot_values.pybuffer.buf = NULL; + __pyx_pybuffer_plot_values.refcount = 0; + __pyx_pybuffernd_plot_values.data = NULL; + __pyx_pybuffernd_plot_values.rcbuffer = &__pyx_pybuffer_plot_values; + __pyx_pybuffer_coords.pybuffer.buf = NULL; + __pyx_pybuffer_coords.refcount = 0; + __pyx_pybuffernd_coords.data = NULL; + __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords; + __pyx_pybuffer_conn.pybuffer.buf = NULL; + __pyx_pybuffer_conn.refcount = 0; + __pyx_pybuffernd_conn.data = NULL; + __pyx_pybuffernd_conn.rcbuffer = &__pyx_pybuffer_conn; + __pyx_pybuffer_start_point.pybuffer.buf = NULL; + __pyx_pybuffer_start_point.refcount = 0; + __pyx_pybuffernd_start_point.data = NULL; + __pyx_pybuffernd_start_point.rcbuffer = &__pyx_pybuffer_start_point; + __pyx_pybuffer_end_point.pybuffer.buf = NULL; + __pyx_pybuffer_end_point.refcount = 0; + __pyx_pybuffernd_end_point.data = NULL; + __pyx_pybuffernd_end_point.rcbuffer = &__pyx_pybuffer_end_point; + __pyx_pybuffer_field.pybuffer.buf = NULL; + __pyx_pybuffer_field.refcount = 0; + __pyx_pybuffernd_field.data = NULL; + __pyx_pybuffernd_field.rcbuffer = &__pyx_pybuffer_field; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 866, __pyx_L1_error) } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim - */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; + __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conn.rcbuffer->pybuffer, (PyObject*)__pyx_v_conn, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 866, __pyx_L1_error) + } + __pyx_pybuffernd_conn.diminfo[0].strides = __pyx_pybuffernd_conn.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conn.diminfo[0].shape = __pyx_pybuffernd_conn.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conn.diminfo[1].strides = __pyx_pybuffernd_conn.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conn.diminfo[1].shape = __pyx_pybuffernd_conn.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start_point.rcbuffer->pybuffer, (PyObject*)__pyx_v_start_point, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 866, __pyx_L1_error) + } + __pyx_pybuffernd_start_point.diminfo[0].strides = __pyx_pybuffernd_start_point.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_start_point.diminfo[0].shape = __pyx_pybuffernd_start_point.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end_point.rcbuffer->pybuffer, (PyObject*)__pyx_v_end_point, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 866, __pyx_L1_error) + } + __pyx_pybuffernd_end_point.diminfo[0].strides = __pyx_pybuffernd_end_point.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_end_point.diminfo[0].shape = __pyx_pybuffernd_end_point.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_field.rcbuffer->pybuffer, (PyObject*)__pyx_v_field, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 866, __pyx_L1_error) } + __pyx_pybuffernd_field.diminfo[0].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_field.diminfo[0].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_field.diminfo[1].strides = __pyx_pybuffernd_field.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_field.diminfo[1].shape = __pyx_pybuffernd_field.rcbuffer->pybuffer.shape[1]; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * + /* "yt/utilities/lib/pixelization_routines.pyx":878 + * cdef np.float64_t *vertices + * cdef np.float64_t *field_vals + * cdef int nvertices = conn.shape[1] # <<<<<<<<<<<<<< + * cdef int ndim = coords.shape[1] + * cdef int num_field_vals = field.shape[1] */ - __pyx_v_endian_detector = 1; + __pyx_v_nvertices = (__pyx_v_conn->dimensions[1]); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) + /* "yt/utilities/lib/pixelization_routines.pyx":879 + * cdef np.float64_t *field_vals + * cdef int nvertices = conn.shape[1] + * cdef int ndim = coords.shape[1] # <<<<<<<<<<<<<< + * cdef int num_field_vals = field.shape[1] + * cdef int num_plot_nodes = npoints */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_v_ndim = (__pyx_v_coords->dimensions[1]); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "yt/utilities/lib/pixelization_routines.pyx":880 + * cdef int nvertices = conn.shape[1] + * cdef int ndim = coords.shape[1] + * cdef int num_field_vals = field.shape[1] # <<<<<<<<<<<<<< + * cdef int num_plot_nodes = npoints + * cdef int num_intervals = npoints - 1 */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + __pyx_v_num_field_vals = (__pyx_v_field->dimensions[1]); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "yt/utilities/lib/pixelization_routines.pyx":881 + * cdef int ndim = coords.shape[1] + * cdef int num_field_vals = field.shape[1] + * cdef int num_plot_nodes = npoints # <<<<<<<<<<<<<< + * cdef int num_intervals = npoints - 1 + * cdef double[4] mapped_coord */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_npoints); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_v_num_plot_nodes = __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + /* "yt/utilities/lib/pixelization_routines.pyx":882 + * cdef int num_field_vals = field.shape[1] + * cdef int num_plot_nodes = npoints + * cdef int num_intervals = npoints - 1 # <<<<<<<<<<<<<< + * cdef double[4] mapped_coord + * cdef ElementSampler sampler */ - __pyx_v_copy_shape = 1; + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_npoints, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_num_intervals = __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) + /* "yt/utilities/lib/pixelization_routines.pyx":894 + * cdef np.float64_t sample_point[3] + * + * lin_vec = np.zeros(ndim, dtype="float64") # <<<<<<<<<<<<<< + * lin_inc = np.zeros(ndim, dtype="float64") * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: */ - goto __pyx_L4; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 894, __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_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, 894, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lin_vec.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lin_vec.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lin_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_lin_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_lin_vec.diminfo[0].strides = __pyx_pybuffernd_lin_vec.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lin_vec.diminfo[0].shape = __pyx_pybuffernd_lin_vec.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 894, __pyx_L1_error) } + __pyx_t_6 = 0; + __pyx_v_lin_vec = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":895 * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * lin_vec = np.zeros(ndim, dtype="float64") + * lin_inc = np.zeros(ndim, dtype="float64") # <<<<<<<<<<<<<< + * + * lin_sample_points = np.zeros((num_plot_nodes, ndim), dtype="float64") */ - /*else*/ { - __pyx_v_copy_shape = 0; + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 895, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 895, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 895, __pyx_L1_error) + __pyx_t_10 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lin_inc.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lin_inc.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lin_inc.rcbuffer->pybuffer, (PyObject*)__pyx_v_lin_inc, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_lin_inc.diminfo[0].strides = __pyx_pybuffernd_lin_inc.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lin_inc.diminfo[0].shape = __pyx_pybuffernd_lin_inc.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 895, __pyx_L1_error) } - __pyx_L4:; + __pyx_t_10 = 0; + __pyx_v_lin_inc = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "yt/utilities/lib/pixelization_routines.pyx":897 + * lin_inc = np.zeros(ndim, dtype="float64") * - * 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") + * lin_sample_points = np.zeros((num_plot_nodes, ndim), dtype="float64") # <<<<<<<<<<<<<< + * arc_length = np.zeros(num_plot_nodes, dtype="float64") + * plot_values = np.zeros(num_plot_nodes, dtype="float64") */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_num_plot_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 897, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 897, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lin_sample_points.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lin_sample_points.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lin_sample_points.rcbuffer->pybuffer, (PyObject*)__pyx_v_lin_sample_points, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_lin_sample_points.diminfo[0].strides = __pyx_pybuffernd_lin_sample_points.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lin_sample_points.diminfo[0].shape = __pyx_pybuffernd_lin_sample_points.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_lin_sample_points.diminfo[1].strides = __pyx_pybuffernd_lin_sample_points.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_lin_sample_points.diminfo[1].shape = __pyx_pybuffernd_lin_sample_points.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 897, __pyx_L1_error) } + __pyx_t_11 = 0; + __pyx_v_lin_sample_points = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "yt/utilities/lib/pixelization_routines.pyx":898 * - * 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") + * lin_sample_points = np.zeros((num_plot_nodes, ndim), dtype="float64") + * arc_length = np.zeros(num_plot_nodes, dtype="float64") # <<<<<<<<<<<<<< + * plot_values = np.zeros(num_plot_nodes, dtype="float64") * */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_num_plot_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __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 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_t_12 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arc_length.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arc_length.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arc_length.rcbuffer->pybuffer, (PyObject*)__pyx_v_arc_length, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_arc_length.diminfo[0].strides = __pyx_pybuffernd_arc_length.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arc_length.diminfo[0].shape = __pyx_pybuffernd_arc_length.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 898, __pyx_L1_error) + } + __pyx_t_12 = 0; + __pyx_v_arc_length = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "yt/utilities/lib/pixelization_routines.pyx":899 + * lin_sample_points = np.zeros((num_plot_nodes, ndim), dtype="float64") + * arc_length = np.zeros(num_plot_nodes, dtype="float64") + * plot_values = np.zeros(num_plot_nodes, dtype="float64") # <<<<<<<<<<<<<< * - * 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") + * # Pick the right sampler and allocate storage for the mapped coordinate */ - if (__pyx_t_1) { + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_num_plot_nodes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __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_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_13 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_plot_values.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_plot_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_plot_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_plot_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_plot_values.diminfo[0].strides = __pyx_pybuffernd_plot_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_plot_values.diminfo[0].shape = __pyx_pybuffernd_plot_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) + } + __pyx_t_13 = 0; + __pyx_v_plot_values = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":902 * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * # Pick the right sampler and allocate storage for the mapped coordinate + * if ndim == 3 and nvertices == 4: # <<<<<<<<<<<<<< + * sampler = P1Sampler3D() + * elif ndim == 3 and nvertices == 6: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_t_15 = ((__pyx_v_ndim == 3) != 0); + if (__pyx_t_15) { + } else { + __pyx_t_14 = __pyx_t_15; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_15 = ((__pyx_v_nvertices == 4) != 0); + __pyx_t_14 = __pyx_t_15; + __pyx_L4_bool_binop_done:; + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 + /* "yt/utilities/lib/pixelization_routines.pyx":903 + * # Pick the right sampler and allocate storage for the mapped coordinate + * if ndim == 3 and nvertices == 4: + * sampler = P1Sampler3D() # <<<<<<<<<<<<<< + * elif ndim == 3 and nvertices == 6: + * sampler = W1Sampler3D() + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "yt/utilities/lib/pixelization_routines.pyx":902 * - * 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") + * # Pick the right sampler and allocate storage for the mapped coordinate + * if ndim == 3 and nvertices == 4: # <<<<<<<<<<<<<< + * sampler = P1Sampler3D() + * elif ndim == 3 and nvertices == 6: */ + goto __pyx_L3; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "yt/utilities/lib/pixelization_routines.pyx":904 + * if ndim == 3 and nvertices == 4: + * sampler = P1Sampler3D() + * elif ndim == 3 and nvertices == 6: # <<<<<<<<<<<<<< + * sampler = W1Sampler3D() + * elif ndim == 3 and nvertices == 8: */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { + __pyx_t_15 = ((__pyx_v_ndim == 3) != 0); + if (__pyx_t_15) { } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; + __pyx_t_14 = __pyx_t_15; + goto __pyx_L6_bool_binop_done; } + __pyx_t_15 = ((__pyx_v_nvertices == 6) != 0); + __pyx_t_14 = __pyx_t_15; + __pyx_L6_bool_binop_done:; + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * + /* "yt/utilities/lib/pixelization_routines.pyx":905 + * sampler = P1Sampler3D() + * elif ndim == 3 and nvertices == 6: + * sampler = W1Sampler3D() # <<<<<<<<<<<<<< + * elif ndim == 3 and nvertices == 8: + * sampler = Q1Sampler3D() */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2); + __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) + /* "yt/utilities/lib/pixelization_routines.pyx":904 + * if ndim == 3 and nvertices == 4: + * sampler = P1Sampler3D() + * elif ndim == 3 and nvertices == 6: # <<<<<<<<<<<<<< + * sampler = W1Sampler3D() + * elif ndim == 3 and nvertices == 8: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "yt/utilities/lib/pixelization_routines.pyx":906 + * elif ndim == 3 and nvertices == 6: + * sampler = W1Sampler3D() + * elif ndim == 3 and nvertices == 8: # <<<<<<<<<<<<<< + * sampler = Q1Sampler3D() + * elif ndim == 3 and nvertices == 20: */ + __pyx_t_15 = ((__pyx_v_ndim == 3) != 0); + if (__pyx_t_15) { + } else { + __pyx_t_14 = __pyx_t_15; + goto __pyx_L8_bool_binop_done; } + __pyx_t_15 = ((__pyx_v_nvertices == 8) != 0); + __pyx_t_14 = __pyx_t_15; + __pyx_L8_bool_binop_done:; + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: + /* "yt/utilities/lib/pixelization_routines.pyx":907 + * sampler = W1Sampler3D() + * elif ndim == 3 and nvertices == 8: + * sampler = Q1Sampler3D() # <<<<<<<<<<<<<< + * elif ndim == 3 and nvertices == 20: + * sampler = S2Sampler3D() */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2); + __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + /* "yt/utilities/lib/pixelization_routines.pyx":906 + * elif ndim == 3 and nvertices == 6: + * sampler = W1Sampler3D() + * elif ndim == 3 and nvertices == 8: # <<<<<<<<<<<<<< + * sampler = Q1Sampler3D() + * elif ndim == 3 and nvertices == 20: */ - __pyx_v_info->ndim = __pyx_v_ndim; + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "yt/utilities/lib/pixelization_routines.pyx":908 + * elif ndim == 3 and nvertices == 8: + * sampler = Q1Sampler3D() + * elif ndim == 3 and nvertices == 20: # <<<<<<<<<<<<<< + * sampler = S2Sampler3D() + * elif ndim == 2 and nvertices == 3: */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + __pyx_t_15 = ((__pyx_v_ndim == 3) != 0); + if (__pyx_t_15) { + } else { + __pyx_t_14 = __pyx_t_15; + goto __pyx_L10_bool_binop_done; + } + __pyx_t_15 = ((__pyx_v_nvertices == 20) != 0); + __pyx_t_14 = __pyx_t_15; + __pyx_L10_bool_binop_done:; + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "yt/utilities/lib/pixelization_routines.pyx":909 + * sampler = Q1Sampler3D() + * elif ndim == 3 and nvertices == 20: + * sampler = S2Sampler3D() # <<<<<<<<<<<<<< + * elif ndim == 2 and nvertices == 3: + * sampler = P1Sampler2D() */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2); + __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "yt/utilities/lib/pixelization_routines.pyx":908 + * elif ndim == 3 and nvertices == 8: + * sampler = Q1Sampler3D() + * elif ndim == 3 and nvertices == 20: # <<<<<<<<<<<<<< + * sampler = S2Sampler3D() + * elif ndim == 2 and nvertices == 3: */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "yt/utilities/lib/pixelization_routines.pyx":910 + * elif ndim == 3 and nvertices == 20: + * sampler = S2Sampler3D() + * elif ndim == 2 and nvertices == 3: # <<<<<<<<<<<<<< + * sampler = P1Sampler2D() + * elif ndim == 1 and nvertices == 2: */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_15 = ((__pyx_v_ndim == 2) != 0); + if (__pyx_t_15) { + } else { + __pyx_t_14 = __pyx_t_15; + goto __pyx_L12_bool_binop_done; + } + __pyx_t_15 = ((__pyx_v_nvertices == 3) != 0); + __pyx_t_14 = __pyx_t_15; + __pyx_L12_bool_binop_done:; + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * 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: + /* "yt/utilities/lib/pixelization_routines.pyx":911 + * sampler = S2Sampler3D() + * elif ndim == 2 and nvertices == 3: + * sampler = P1Sampler2D() # <<<<<<<<<<<<<< + * elif ndim == 1 and nvertices == 2: + * sampler = P1Sampler1D() */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2); + __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) + /* "yt/utilities/lib/pixelization_routines.pyx":910 + * elif ndim == 3 and nvertices == 20: + * sampler = S2Sampler3D() + * elif ndim == 2 and nvertices == 3: # <<<<<<<<<<<<<< + * sampler = P1Sampler2D() + * elif ndim == 1 and nvertices == 2: */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "yt/utilities/lib/pixelization_routines.pyx":912 + * elif ndim == 2 and nvertices == 3: + * sampler = P1Sampler2D() + * elif ndim == 1 and nvertices == 2: # <<<<<<<<<<<<<< + * sampler = P1Sampler1D() + * elif ndim == 2 and nvertices == 4: */ - goto __pyx_L11; + __pyx_t_15 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_15) { + } else { + __pyx_t_14 = __pyx_t_15; + goto __pyx_L14_bool_binop_done; } + __pyx_t_15 = ((__pyx_v_nvertices == 2) != 0); + __pyx_t_14 = __pyx_t_15; + __pyx_L14_bool_binop_done:; + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + /* "yt/utilities/lib/pixelization_routines.pyx":913 + * sampler = P1Sampler2D() + * elif ndim == 1 and nvertices == 2: + * sampler = P1Sampler1D() # <<<<<<<<<<<<<< + * elif ndim == 2 and nvertices == 4: + * sampler = Q1Sampler2D() */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2); + __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) + /* "yt/utilities/lib/pixelization_routines.pyx":912 + * elif ndim == 2 and nvertices == 3: + * sampler = P1Sampler2D() + * elif ndim == 1 and nvertices == 2: # <<<<<<<<<<<<<< + * sampler = P1Sampler1D() + * elif ndim == 2 and nvertices == 4: */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + goto __pyx_L3; } - __pyx_L11:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "yt/utilities/lib/pixelization_routines.pyx":914 + * elif ndim == 1 and nvertices == 2: + * sampler = P1Sampler1D() + * elif ndim == 2 and nvertices == 4: # <<<<<<<<<<<<<< + * sampler = Q1Sampler2D() + * elif ndim == 2 and nvertices == 9: */ - __pyx_v_info->suboffsets = NULL; + __pyx_t_15 = ((__pyx_v_ndim == 2) != 0); + if (__pyx_t_15) { + } else { + __pyx_t_14 = __pyx_t_15; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_15 = ((__pyx_v_nvertices == 4) != 0); + __pyx_t_14 = __pyx_t_15; + __pyx_L16_bool_binop_done:; + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * + /* "yt/utilities/lib/pixelization_routines.pyx":915 + * sampler = P1Sampler1D() + * elif ndim == 2 and nvertices == 4: + * sampler = Q1Sampler2D() # <<<<<<<<<<<<<< + * elif ndim == 2 and nvertices == 9: + * sampler = Q2Sampler2D() */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2); + __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t + /* "yt/utilities/lib/pixelization_routines.pyx":914 + * elif ndim == 1 and nvertices == 2: + * sampler = P1Sampler1D() + * elif ndim == 2 and nvertices == 4: # <<<<<<<<<<<<<< + * sampler = Q1Sampler2D() + * elif ndim == 2 and nvertices == 9: */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + /* "yt/utilities/lib/pixelization_routines.pyx":916 + * elif ndim == 2 and nvertices == 4: + * sampler = Q1Sampler2D() + * elif ndim == 2 and nvertices == 9: # <<<<<<<<<<<<<< + * sampler = Q2Sampler2D() + * elif ndim == 2 and nvertices == 6: */ - __pyx_v_f = NULL; + __pyx_t_15 = ((__pyx_v_ndim == 2) != 0); + if (__pyx_t_15) { + } else { + __pyx_t_14 = __pyx_t_15; + goto __pyx_L18_bool_binop_done; + } + __pyx_t_15 = ((__pyx_v_nvertices == 9) != 0); + __pyx_t_14 = __pyx_t_15; + __pyx_L18_bool_binop_done:; + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset - * + /* "yt/utilities/lib/pixelization_routines.pyx":917 + * sampler = Q1Sampler2D() + * elif ndim == 2 and nvertices == 9: + * sampler = Q2Sampler2D() # <<<<<<<<<<<<<< + * elif ndim == 2 and nvertices == 6: + * sampler = T2Sampler2D() */ - __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; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2); + __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: + /* "yt/utilities/lib/pixelization_routines.pyx":916 + * elif ndim == 2 and nvertices == 4: + * sampler = Q1Sampler2D() + * elif ndim == 2 and nvertices == 9: # <<<<<<<<<<<<<< + * sampler = Q2Sampler2D() + * elif ndim == 2 and nvertices == 6: */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + /* "yt/utilities/lib/pixelization_routines.pyx":918 + * elif ndim == 2 and nvertices == 9: + * sampler = Q2Sampler2D() + * elif ndim == 2 and nvertices == 6: # <<<<<<<<<<<<<< + * sampler = T2Sampler2D() + * elif ndim == 3 and nvertices == 10: */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { + __pyx_t_15 = ((__pyx_v_ndim == 2) != 0); + if (__pyx_t_15) { } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; + __pyx_t_14 = __pyx_t_15; + goto __pyx_L20_bool_binop_done; } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_15 = ((__pyx_v_nvertices == 6) != 0); + __pyx_t_14 = __pyx_t_15; + __pyx_L20_bool_binop_done:; + if (__pyx_t_14) { + + /* "yt/utilities/lib/pixelization_routines.pyx":919 + * sampler = Q2Sampler2D() + * elif ndim == 2 and nvertices == 6: + * sampler = T2Sampler2D() # <<<<<<<<<<<<<< + * elif ndim == 3 and nvertices == 10: + * sampler = Tet2Sampler3D() + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2); + __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer + /* "yt/utilities/lib/pixelization_routines.pyx":918 + * elif ndim == 2 and nvertices == 9: + * sampler = Q2Sampler2D() + * elif ndim == 2 and nvertices == 6: # <<<<<<<<<<<<<< + * sampler = T2Sampler2D() + * elif ndim == 3 and nvertices == 10: */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; + goto __pyx_L3; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + /* "yt/utilities/lib/pixelization_routines.pyx":920 + * elif ndim == 2 and nvertices == 6: + * sampler = T2Sampler2D() + * elif ndim == 3 and nvertices == 10: # <<<<<<<<<<<<<< + * sampler = Tet2Sampler3D() + * else: */ - goto __pyx_L14; + __pyx_t_15 = ((__pyx_v_ndim == 3) != 0); + if (__pyx_t_15) { + } else { + __pyx_t_14 = __pyx_t_15; + goto __pyx_L22_bool_binop_done; } + __pyx_t_15 = ((__pyx_v_nvertices == 10) != 0); + __pyx_t_14 = __pyx_t_15; + __pyx_L22_bool_binop_done:; + if (__pyx_t_14) { + + /* "yt/utilities/lib/pixelization_routines.pyx":921 + * sampler = T2Sampler2D() + * elif ndim == 3 and nvertices == 10: + * sampler = Tet2Sampler3D() # <<<<<<<<<<<<<< + * else: + * raise YTElementTypeNotRecognized(ndim, nvertices) + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 921, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_sampler = ((struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_t_2); + __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":920 + * elif ndim == 2 and nvertices == 6: + * sampler = T2Sampler2D() + * elif ndim == 3 and nvertices == 10: # <<<<<<<<<<<<<< + * sampler = Tet2Sampler3D() + * else: + */ + goto __pyx_L3; + } + + /* "yt/utilities/lib/pixelization_routines.pyx":923 + * sampler = Tet2Sampler3D() + * else: + * raise YTElementTypeNotRecognized(ndim, nvertices) # <<<<<<<<<<<<<< * - * if not hasfields: + * # allocate temporary storage */ /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_YTElementTypeNotRecognized); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nvertices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = NULL; + __pyx_t_1 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_16)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_16); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_1 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_4, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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[3] = {__pyx_t_16, __pyx_t_4, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_17 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + if (__pyx_t_16) { + __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); __pyx_t_16 = NULL; + } + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_1, __pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + } + __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, 923, __pyx_L1_error) } - __pyx_L14:; + __pyx_L3:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "yt/utilities/lib/pixelization_routines.pyx":926 + * + * # allocate temporary storage + * vertices = malloc(ndim * sizeof(np.float64_t) * nvertices) # <<<<<<<<<<<<<< + * field_vals = malloc(sizeof(np.float64_t) * num_field_vals) * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { + __pyx_v_vertices = ((__pyx_t_5numpy_float64_t *)malloc(((__pyx_v_ndim * (sizeof(__pyx_t_5numpy_float64_t))) * __pyx_v_nvertices))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "yt/utilities/lib/pixelization_routines.pyx":927 + * # allocate temporary storage + * vertices = malloc(ndim * sizeof(np.float64_t) * nvertices) + * field_vals = malloc(sizeof(np.float64_t) * num_field_vals) # <<<<<<<<<<<<<< * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): + * lin_vec = end_point - start_point */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; + __pyx_v_field_vals = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_num_field_vals))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "yt/utilities/lib/pixelization_routines.pyx":929 + * field_vals = malloc(sizeof(np.float64_t) * num_field_vals) + * + * lin_vec = end_point - start_point # <<<<<<<<<<<<<< + * lin_length = np.linalg.norm(lin_vec) + * lin_inc = lin_vec / num_intervals */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; + __pyx_t_2 = PyNumber_Subtract(((PyObject *)__pyx_v_end_point), ((PyObject *)__pyx_v_start_point)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lin_vec.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lin_vec.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lin_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_lin_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } } - __pyx_L20_next_or:; + __pyx_pybuffernd_lin_vec.diminfo[0].strides = __pyx_pybuffernd_lin_vec.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lin_vec.diminfo[0].shape = __pyx_pybuffernd_lin_vec.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 929, __pyx_L1_error) + } + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_lin_vec, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" + /* "yt/utilities/lib/pixelization_routines.pyx":930 + * + * lin_vec = end_point - start_point + * lin_length = np.linalg.norm(lin_vec) # <<<<<<<<<<<<<< + * lin_inc = lin_vec / num_intervals + * inc_length = lin_length / num_intervals */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_linalg); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_norm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_17)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_17); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + } + if (!__pyx_t_17) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_lin_vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_17, ((PyObject *)__pyx_v_lin_vec)}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_17, ((PyObject *)__pyx_v_lin_vec)}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_17); __pyx_t_17 = NULL; + __Pyx_INCREF(((PyObject *)__pyx_v_lin_vec)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lin_vec)); + PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_lin_vec)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_18 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_lin_length = __pyx_t_18; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "yt/utilities/lib/pixelization_routines.pyx":931 + * lin_vec = end_point - start_point + * lin_length = np.linalg.norm(lin_vec) + * lin_inc = lin_vec / num_intervals # <<<<<<<<<<<<<< + * inc_length = lin_length / num_intervals + * for j in range(ndim): */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num_intervals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_lin_vec), __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __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, 931, __pyx_L1_error) + __pyx_t_10 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lin_inc.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lin_inc.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lin_inc.rcbuffer->pybuffer, (PyObject*)__pyx_v_lin_inc, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } } + __pyx_pybuffernd_lin_inc.diminfo[0].strides = __pyx_pybuffernd_lin_inc.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lin_inc.diminfo[0].shape = __pyx_pybuffernd_lin_inc.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 931, __pyx_L1_error) + } + __pyx_t_10 = 0; + __Pyx_DECREF_SET(__pyx_v_lin_inc, ((PyArrayObject *)__pyx_t_5)); + __pyx_t_5 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" + /* "yt/utilities/lib/pixelization_routines.pyx":932 + * lin_length = np.linalg.norm(lin_vec) + * lin_inc = lin_vec / num_intervals + * inc_length = lin_length / num_intervals # <<<<<<<<<<<<<< + * for j in range(ndim): + * lin_sample_points[0, j] = start_point[j] */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; + if (unlikely(__pyx_v_num_intervals == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + __PYX_ERR(0, 932, __pyx_L1_error) + } + __pyx_v_inc_length = (__pyx_v_lin_length / __pyx_v_num_intervals); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" + /* "yt/utilities/lib/pixelization_routines.pyx":933 + * lin_inc = lin_vec / num_intervals + * inc_length = lin_length / num_intervals + * for j in range(ndim): # <<<<<<<<<<<<<< + * lin_sample_points[0, j] = start_point[j] + * arc_length[0] = 0 */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_1; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" + /* "yt/utilities/lib/pixelization_routines.pyx":934 + * inc_length = lin_length / num_intervals + * for j in range(ndim): + * lin_sample_points[0, j] = start_point[j] # <<<<<<<<<<<<<< + * arc_length[0] = 0 + * for i in range(1, num_intervals + 1): + */ + __pyx_t_20 = __pyx_v_j; + __pyx_t_21 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_start_point.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_21 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_start_point.diminfo[0].shape)) __pyx_t_21 = 0; + if (unlikely(__pyx_t_21 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_21); + __PYX_ERR(0, 934, __pyx_L1_error) + } + __pyx_t_22 = 0; + __pyx_t_23 = __pyx_v_j; + __pyx_t_21 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_lin_sample_points.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_21 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_lin_sample_points.diminfo[0].shape)) __pyx_t_21 = 0; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_lin_sample_points.diminfo[1].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_21 = 1; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_lin_sample_points.diminfo[1].shape)) __pyx_t_21 = 1; + if (unlikely(__pyx_t_21 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_21); + __PYX_ERR(0, 934, __pyx_L1_error) + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_lin_sample_points.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lin_sample_points.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_lin_sample_points.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_start_point.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_start_point.diminfo[0].strides)); + } + + /* "yt/utilities/lib/pixelization_routines.pyx":935 + * for j in range(ndim): + * lin_sample_points[0, j] = start_point[j] + * arc_length[0] = 0 # <<<<<<<<<<<<<< + * for i in range(1, num_intervals + 1): + * for j in range(ndim): + */ + __pyx_t_24 = 0; + __pyx_t_1 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_arc_length.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_arc_length.diminfo[0].shape)) __pyx_t_1 = 0; + if (unlikely(__pyx_t_1 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_1); + __PYX_ERR(0, 935, __pyx_L1_error) + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arc_length.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_arc_length.diminfo[0].strides) = 0.0; + + /* "yt/utilities/lib/pixelization_routines.pyx":936 + * lin_sample_points[0, j] = start_point[j] + * arc_length[0] = 0 + * for i in range(1, num_intervals + 1): # <<<<<<<<<<<<<< + * for j in range(ndim): + * lin_sample_points[i, j] = lin_sample_points[i-1, j] + lin_inc[j] + */ + __pyx_t_25 = (__pyx_v_num_intervals + 1); + for (__pyx_t_19 = 1; __pyx_t_19 < __pyx_t_25; __pyx_t_19+=1) { + __pyx_v_i = __pyx_t_19; + + /* "yt/utilities/lib/pixelization_routines.pyx":937 + * arc_length[0] = 0 + * for i in range(1, num_intervals + 1): + * for j in range(ndim): # <<<<<<<<<<<<<< + * lin_sample_points[i, j] = lin_sample_points[i-1, j] + lin_inc[j] + * arc_length[i] = arc_length[i-1] + inc_length + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_1; __pyx_t_26+=1) { + __pyx_v_j = __pyx_t_26; + + /* "yt/utilities/lib/pixelization_routines.pyx":938 + * for i in range(1, num_intervals + 1): + * for j in range(ndim): + * lin_sample_points[i, j] = lin_sample_points[i-1, j] + lin_inc[j] # <<<<<<<<<<<<<< + * arc_length[i] = arc_length[i-1] + inc_length + * + */ + __pyx_t_27 = (__pyx_v_i - 1); + __pyx_t_28 = __pyx_v_j; + __pyx_t_21 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_lin_sample_points.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_21 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_lin_sample_points.diminfo[0].shape)) __pyx_t_21 = 0; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_lin_sample_points.diminfo[1].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_21 = 1; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_lin_sample_points.diminfo[1].shape)) __pyx_t_21 = 1; + if (unlikely(__pyx_t_21 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_21); + __PYX_ERR(0, 938, __pyx_L1_error) + } + __pyx_t_29 = __pyx_v_j; + __pyx_t_21 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_lin_inc.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_21 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_lin_inc.diminfo[0].shape)) __pyx_t_21 = 0; + if (unlikely(__pyx_t_21 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_21); + __PYX_ERR(0, 938, __pyx_L1_error) + } + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_j; + __pyx_t_21 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_lin_sample_points.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_21 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_lin_sample_points.diminfo[0].shape)) __pyx_t_21 = 0; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_lin_sample_points.diminfo[1].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_21 = 1; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_lin_sample_points.diminfo[1].shape)) __pyx_t_21 = 1; + if (unlikely(__pyx_t_21 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_21); + __PYX_ERR(0, 938, __pyx_L1_error) + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_lin_sample_points.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_lin_sample_points.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_lin_sample_points.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_lin_sample_points.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_lin_sample_points.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_lin_sample_points.diminfo[1].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_lin_inc.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_lin_inc.diminfo[0].strides))); + + /* "yt/utilities/lib/pixelization_routines.pyx":939 + * for j in range(ndim): + * lin_sample_points[i, j] = lin_sample_points[i-1, j] + lin_inc[j] + * arc_length[i] = arc_length[i-1] + inc_length # <<<<<<<<<<<<<< + * + * for i in range(num_intervals + 1): + */ + __pyx_t_32 = (__pyx_v_i - 1); + __pyx_t_21 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_arc_length.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_21 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_arc_length.diminfo[0].shape)) __pyx_t_21 = 0; + if (unlikely(__pyx_t_21 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_21); + __PYX_ERR(0, 939, __pyx_L1_error) + } + __pyx_t_33 = __pyx_v_i; + __pyx_t_21 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_arc_length.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_21 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_arc_length.diminfo[0].shape)) __pyx_t_21 = 0; + if (unlikely(__pyx_t_21 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_21); + __PYX_ERR(0, 939, __pyx_L1_error) + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arc_length.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_arc_length.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arc_length.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_arc_length.diminfo[0].strides)) + __pyx_v_inc_length); + } + } + + /* "yt/utilities/lib/pixelization_routines.pyx":941 + * arc_length[i] = arc_length[i-1] + inc_length + * + * for i in range(num_intervals + 1): # <<<<<<<<<<<<<< + * for j in range(3): + * if j < ndim: + */ + __pyx_t_25 = (__pyx_v_num_intervals + 1); + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_25; __pyx_t_19+=1) { + __pyx_v_i = __pyx_t_19; + + /* "yt/utilities/lib/pixelization_routines.pyx":942 + * + * for i in range(num_intervals + 1): + * for j in range(3): # <<<<<<<<<<<<<< + * if j < ndim: + * sample_point[j] = lin_sample_points[i][j] + */ + for (__pyx_t_26 = 0; __pyx_t_26 < 3; __pyx_t_26+=1) { + __pyx_v_j = __pyx_t_26; + + /* "yt/utilities/lib/pixelization_routines.pyx":943 + * for i in range(num_intervals + 1): + * for j in range(3): + * if j < ndim: # <<<<<<<<<<<<<< + * sample_point[j] = lin_sample_points[i][j] + * else: */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; + __pyx_t_14 = ((__pyx_v_j < __pyx_v_ndim) != 0); + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" + /* "yt/utilities/lib/pixelization_routines.pyx":944 + * for j in range(3): + * if j < ndim: + * sample_point[j] = lin_sample_points[i][j] # <<<<<<<<<<<<<< + * else: + * sample_point[j] = 0 */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; + __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_lin_sample_points), __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_j, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_18 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 944, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + (__pyx_v_sample_point[__pyx_v_j]) = __pyx_t_18; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" + /* "yt/utilities/lib/pixelization_routines.pyx":943 + * for i in range(num_intervals + 1): + * for j in range(3): + * if j < ndim: # <<<<<<<<<<<<<< + * sample_point[j] = lin_sample_points[i][j] + * else: */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; + goto __pyx_L34; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" + /* "yt/utilities/lib/pixelization_routines.pyx":946 + * sample_point[j] = lin_sample_points[i][j] + * else: + * sample_point[j] = 0 # <<<<<<<<<<<<<< + * for ci in range(conn.shape[0]): + * for n in range(num_field_vals): */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; + /*else*/ { + (__pyx_v_sample_point[__pyx_v_j]) = 0.0; + } + __pyx_L34:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" + /* "yt/utilities/lib/pixelization_routines.pyx":947 + * else: + * sample_point[j] = 0 + * for ci in range(conn.shape[0]): # <<<<<<<<<<<<<< + * for n in range(num_field_vals): + * field_vals[n] = field[ci, n] */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" + __pyx_t_34 = (__pyx_v_conn->dimensions[0]); + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_ci = __pyx_t_35; + + /* "yt/utilities/lib/pixelization_routines.pyx":948 + * sample_point[j] = 0 + * for ci in range(conn.shape[0]): + * for n in range(num_field_vals): # <<<<<<<<<<<<<< + * field_vals[n] = field[ci, n] + * */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; + __pyx_t_1 = __pyx_v_num_field_vals; + for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_1; __pyx_t_26+=1) { + __pyx_v_n = __pyx_t_26; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" + /* "yt/utilities/lib/pixelization_routines.pyx":949 + * for ci in range(conn.shape[0]): + * for n in range(num_field_vals): + * field_vals[n] = field[ci, n] # <<<<<<<<<<<<<< + * + * # Fill the vertices */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; + __pyx_t_36 = __pyx_v_ci; + __pyx_t_37 = __pyx_v_n; + __pyx_t_21 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_field.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_21 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_field.diminfo[0].shape)) __pyx_t_21 = 0; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_field.diminfo[1].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_21 = 1; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_field.diminfo[1].shape)) __pyx_t_21 = 1; + if (unlikely(__pyx_t_21 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_21); + __PYX_ERR(0, 949, __pyx_L1_error) + } + (__pyx_v_field_vals[__pyx_v_n]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_field.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_field.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_field.diminfo[1].strides)); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" + /* "yt/utilities/lib/pixelization_routines.pyx":952 + * + * # Fill the vertices + * for n in range(nvertices): # <<<<<<<<<<<<<< + * cj = conn[ci, n] - index_offset + * for k in range(ndim): */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; + __pyx_t_1 = __pyx_v_nvertices; + for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_1; __pyx_t_26+=1) { + __pyx_v_n = __pyx_t_26; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" + /* "yt/utilities/lib/pixelization_routines.pyx":953 + * # Fill the vertices + * for n in range(nvertices): + * cj = conn[ci, n] - index_offset # <<<<<<<<<<<<<< + * for k in range(ndim): + * vertices[ndim*n + k] = coords[cj, k] */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; + __pyx_t_38 = __pyx_v_ci; + __pyx_t_39 = __pyx_v_n; + __pyx_t_21 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_conn.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_21 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_conn.diminfo[0].shape)) __pyx_t_21 = 0; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_conn.diminfo[1].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_21 = 1; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_conn.diminfo[1].shape)) __pyx_t_21 = 1; + if (unlikely(__pyx_t_21 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_21); + __PYX_ERR(0, 953, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_conn.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_conn.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_conn.diminfo[1].strides)) - __pyx_v_index_offset)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_cj, __pyx_t_2); + __pyx_t_2 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" + /* "yt/utilities/lib/pixelization_routines.pyx":954 + * for n in range(nvertices): + * cj = conn[ci, n] - index_offset + * for k in range(ndim): # <<<<<<<<<<<<<< + * vertices[ndim*n + k] = coords[cj, k] + * */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; + __pyx_t_21 = __pyx_v_ndim; + for (__pyx_t_40 = 0; __pyx_t_40 < __pyx_t_21; __pyx_t_40+=1) { + __pyx_v_k = __pyx_t_40; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" + /* "yt/utilities/lib/pixelization_routines.pyx":955 + * cj = conn[ci, n] - index_offset + * for k in range(ndim): + * vertices[ndim*n + k] = coords[cj, k] # <<<<<<<<<<<<<< + * + * sampler.map_real_to_unit(mapped_coord, vertices, sample_point) */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_cj); + __Pyx_GIVEREF(__pyx_v_cj); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_cj); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_18 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + (__pyx_v_vertices[((__pyx_v_ndim * __pyx_v_n) + __pyx_v_k)]) = __pyx_t_18; + } + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" + /* "yt/utilities/lib/pixelization_routines.pyx":957 + * vertices[ndim*n + k] = coords[cj, k] + * + * sampler.map_real_to_unit(mapped_coord, vertices, sample_point) # <<<<<<<<<<<<<< + * if not sampler.check_inside(mapped_coord) and ci != conn.shape[0] - 1: + * continue */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; + ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler->__pyx_vtab)->map_real_to_unit(__pyx_v_sampler, __pyx_v_mapped_coord, __pyx_v_vertices, __pyx_v_sample_point); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" + /* "yt/utilities/lib/pixelization_routines.pyx":958 + * + * sampler.map_real_to_unit(mapped_coord, vertices, sample_point) + * if not sampler.check_inside(mapped_coord) and ci != conn.shape[0] - 1: # <<<<<<<<<<<<<< + * continue + * elif not sampler.check_inside(mapped_coord): */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: + __pyx_t_15 = ((!(((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler->__pyx_vtab)->check_inside(__pyx_v_sampler, __pyx_v_mapped_coord) != 0)) != 0); + if (__pyx_t_15) { + } else { + __pyx_t_14 = __pyx_t_15; + goto __pyx_L44_bool_binop_done; + } + __pyx_t_15 = ((__pyx_v_ci != ((__pyx_v_conn->dimensions[0]) - 1)) != 0); + __pyx_t_14 = __pyx_t_15; + __pyx_L44_bool_binop_done:; + if (__pyx_t_14) { + + /* "yt/utilities/lib/pixelization_routines.pyx":959 + * sampler.map_real_to_unit(mapped_coord, vertices, sample_point) + * if not sampler.check_inside(mapped_coord) and ci != conn.shape[0] - 1: + * continue # <<<<<<<<<<<<<< + * elif not sampler.check_inside(mapped_coord): + * raise ValueError("Check to see that both starting and ending line points " */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; + goto __pyx_L35_continue; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + /* "yt/utilities/lib/pixelization_routines.pyx":958 + * + * sampler.map_real_to_unit(mapped_coord, vertices, sample_point) + * if not sampler.check_inside(mapped_coord) and ci != conn.shape[0] - 1: # <<<<<<<<<<<<<< + * continue + * elif not sampler.check_inside(mapped_coord): */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return + /* "yt/utilities/lib/pixelization_routines.pyx":960 + * if not sampler.check_inside(mapped_coord) and ci != conn.shape[0] - 1: + * continue + * elif not sampler.check_inside(mapped_coord): # <<<<<<<<<<<<<< + * raise ValueError("Check to see that both starting and ending line points " + * "are within the domain of the mesh.") */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } + __pyx_t_14 = ((!(((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler->__pyx_vtab)->check_inside(__pyx_v_sampler, __pyx_v_mapped_coord) != 0)) != 0); + if (__pyx_t_14) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: + /* "yt/utilities/lib/pixelization_routines.pyx":961 + * continue + * elif not sampler.check_inside(mapped_coord): + * raise ValueError("Check to see that both starting and ending line points " # <<<<<<<<<<<<<< + * "are within the domain of the mesh.") + * plot_values[i] = sampler.sample_at_unit_point(mapped_coord, field_vals) */ - __pyx_v_info->format = __pyx_v_f; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __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, 961, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) + /* "yt/utilities/lib/pixelization_routines.pyx":960 + * if not sampler.check_inside(mapped_coord) and ci != conn.shape[0] - 1: + * continue + * elif not sampler.check_inside(mapped_coord): # <<<<<<<<<<<<<< + * raise ValueError("Check to see that both starting and ending line points " + * "are within the domain of the mesh.") */ - __pyx_r = 0; - goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "yt/utilities/lib/pixelization_routines.pyx":963 + * raise ValueError("Check to see that both starting and ending line points " + * "are within the domain of the mesh.") + * plot_values[i] = sampler.sample_at_unit_point(mapped_coord, field_vals) # <<<<<<<<<<<<<< + * break * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_1 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_plot_values.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_plot_values.diminfo[0].shape)) __pyx_t_1 = 0; + if (unlikely(__pyx_t_1 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_1); + __PYX_ERR(0, 963, __pyx_L1_error) + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_plot_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_plot_values.diminfo[0].strides) = ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler *)__pyx_v_sampler->__pyx_vtab)->sample_at_unit_point(__pyx_v_sampler, __pyx_v_mapped_coord, __pyx_v_field_vals); + + /* "yt/utilities/lib/pixelization_routines.pyx":964 + * "are within the domain of the mesh.") + * plot_values[i] = sampler.sample_at_unit_point(mapped_coord, field_vals) + * break # <<<<<<<<<<<<<< + * + * free(vertices) + */ + goto __pyx_L36_break; + __pyx_L35_continue:; + } + __pyx_L36_break:; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 + /* "yt/utilities/lib/pixelization_routines.pyx":966 + * break + * + * free(vertices) # <<<<<<<<<<<<<< + * free(field_vals) + * return arc_length, plot_values */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); + free(__pyx_v_vertices); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, + /* "yt/utilities/lib/pixelization_routines.pyx":967 + * + * free(vertices) + * free(field_vals) # <<<<<<<<<<<<<< + * return arc_length, plot_values */ - (__pyx_v_info->format[0]) = '^'; + free(__pyx_v_field_vals); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) + /* "yt/utilities/lib/pixelization_routines.pyx":968 + * free(vertices) + * free(field_vals) + * return arc_length, plot_values # <<<<<<<<<<<<<< */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_arc_length)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_arc_length)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_arc_length)); + __Pyx_INCREF(((PyObject *)__pyx_v_plot_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_plot_values)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_plot_values)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + /* "yt/utilities/lib/pixelization_routines.pyx":866 + * return img * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + * def pixelize_element_mesh_line(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< + * np.ndarray[np.int64_t, ndim=2] conn, + * np.ndarray[np.float64_t, ndim=1] start_point, */ /* 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_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arc_length.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conn.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end_point.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lin_inc.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lin_sample_points.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lin_vec.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_plot_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start_point.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("yt.utilities.lib.pixelization_routines.pixelize_element_mesh_line", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arc_length.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conn.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end_point.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_field.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lin_inc.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lin_sample_points.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lin_vec.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_plot_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start_point.rcbuffer->pybuffer); __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_XDECREF((PyObject *)__pyx_v_sampler); + __Pyx_XDECREF((PyObject *)__pyx_v_lin_vec); + __Pyx_XDECREF((PyObject *)__pyx_v_lin_inc); + __Pyx_XDECREF((PyObject *)__pyx_v_lin_sample_points); + __Pyx_XDECREF((PyObject *)__pyx_v_arc_length); + __Pyx_XDECREF((PyObject *)__pyx_v_plot_values); + __Pyx_XDECREF(__pyx_v_cj); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string +/* "vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + */ + +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) { + float __pyx_r; + + /* "vec3_ops.pxd":11 + * cdef inline cython.floating dot(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< + * * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) */ + __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); + goto __pyx_L0; -/* 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)); + /* "vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + */ /* function exit code */ - __Pyx_RefNannyFinishContext(); + __pyx_L0:; + return __pyx_r; } -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); +static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double *__pyx_v_a, double *__pyx_v_b) { + double __pyx_r; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "vec3_ops.pxd":11 + * cdef inline cython.floating dot(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] # <<<<<<<<<<<<<< + * * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { + __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2]))); + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) + /* "vec3_ops.pxd":9 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating dot(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] */ - free(__pyx_v_info->format); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "vec3_ops.pxd":17 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block +static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { + + /* "vec3_ops.pxd":20 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "vec3_ops.pxd":21 + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< + * c[2] = a[0]*b[1] - a[1]*b[0] * */ - free(__pyx_v_info->strides); + (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + /* "vec3_ops.pxd":22 + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< + * + * */ - } + (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) + /* "vec3_ops.pxd":17 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ /* function exit code */ - __Pyx_RefNannyFinishContext(); } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * +static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { + + /* "vec3_ops.pxd":20 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] */ + (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); -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); + /* "vec3_ops.pxd":21 + * cython.floating c[3]) nogil: + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] # <<<<<<<<<<<<<< + * c[2] = a[0]*b[1] - a[1]*b[0] + * + */ + (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "vec3_ops.pxd":22 + * c[0] = a[1]*b[2] - a[2]*b[1] + * c[1] = a[2]*b[0] - a[0]*b[2] + * c[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< * - * 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, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * + /* "vec3_ops.pxd":17 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void cross(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * +/* "vec3_ops.pxd":28 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: */ -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); +static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + /* "vec3_ops.pxd":31 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] + */ + (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); + + /* "vec3_ops.pxd":32 + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< + * c[2] = a[2] - b[2] * - * 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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) + /* "vec3_ops.pxd":33 + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) * */ + (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + + /* "vec3_ops.pxd":28 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ +static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_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); + /* "vec3_ops.pxd":31 + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] # <<<<<<<<<<<<<< + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] + */ + (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + /* "vec3_ops.pxd":32 + * cython.floating c[3]) nogil: + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] # <<<<<<<<<<<<<< + * c[2] = a[2] - b[2] * - * 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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) + /* "vec3_ops.pxd":33 + * c[0] = a[0] - b[0] + * c[1] = a[1] - b[1] + * c[2] = a[2] - b[2] # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) * */ + (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2])); + + /* "vec3_ops.pxd":28 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void subtract(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b, + * cython.floating c[3]) nogil: + */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * +/* "vec3_ops.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) */ -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); +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(float *__pyx_v_a, float *__pyx_v_b) { + float __pyx_r; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "vec3_ops.pxd":41 + * cdef inline cython.floating distance(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< * - * 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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = sqrt(((powf(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + powf(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + powf(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * + /* "vec3_ops.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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); +static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(double *__pyx_v_a, double *__pyx_v_b) { + double __pyx_r; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "vec3_ops.pxd":41 + * cdef inline cython.floating distance(const cython.floating[3] a, + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = sqrt(((pow(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + pow(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + pow(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0))); goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) - * + /* "vec3_ops.pxd":39 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating distance(const cython.floating[3] a, # <<<<<<<<<<<<<< + * const cython.floating[3] b) nogil: + * return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2) */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. +/* "vec3_ops.pxd":47 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< + * const cython.floating[3] a, + * const cython.floating[3] b, */ -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; +static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(float const __pyx_v_f, float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * + /* "vec3_ops.pxd":51 + * const cython.floating[3] b, + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields + /* "vec3_ops.pxd":52 + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< + * c[2] = f * a[2] + b[2] * - * 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, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; + (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "vec3_ops.pxd":53 + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< * - * 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, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; + (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: + /* "vec3_ops.pxd":47 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< + * const cython.floating[3] a, + * const cython.floating[3] b, */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * + /* function exit code */ +} + +static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const __pyx_v_f, double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) { + + /* "vec3_ops.pxd":51 + * const cython.floating[3] b, + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] # <<<<<<<<<<<<<< + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { + (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + /* "vec3_ops.pxd":52 + * cython.floating[3] c) nogil: + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] # <<<<<<<<<<<<<< + * c[2] = f * a[2] + b[2] * - * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) + (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields + /* "vec3_ops.pxd":53 + * c[0] = f * a[0] + b[0] + * c[1] = f * a[1] + b[1] + * c[2] = f * a[2] + b[2] # <<<<<<<<<<<<<< * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - } + (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2])); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "vec3_ops.pxd":47 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline void fma(const cython.floating f, # <<<<<<<<<<<<<< + * const cython.floating[3] a, + * const cython.floating[3] b, */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); - if (!__pyx_t_7) { - goto __pyx_L8_next_or; - } else { - } - __pyx_t_7 = (__pyx_v_little_endian != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_L8_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython + /* function exit code */ +} + +/* "vec3_ops.pxd":59 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) */ - __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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") +static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(float *__pyx_v_a) { + float __pyx_r; + + /* "vec3_ops.pxd":60 + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< */ - if (__pyx_t_6) { + __pyx_r = sqrt(((((__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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply + /* "vec3_ops.pxd":59 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *__pyx_v_a) { + double __pyx_r; + + /* "vec3_ops.pxd":60 + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) # <<<<<<<<<<<<<< + */ + __pyx_r = sqrt(((((__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; + + /* "vec3_ops.pxd":59 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil: # <<<<<<<<<<<<<< + * return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]) + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * # 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, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - (__pyx_v_f[0]) = 0x78; + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * - * offset[0] += child.itemsize + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":24 * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 * - * 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); + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - } + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * # 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" + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 + * */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":36 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 + * */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); + if (__pyx_t_1) { + __pyx_r = (-__pyx_v_f0); + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } + __pyx_r = __pyx_v_f0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":40 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i + * */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), + /* "yt/utilities/lib/fp_utils.pxd":45 + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: */ - goto __pyx_L13; - } + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * + * cdef inline np.float64_t fclip(np.float64_t 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 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_r = __pyx_v_f; + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * 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. + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! - */ - __pyx_v_baseptr = NULL; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - goto __pyx_L3; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * 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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * */ - Py_XDECREF(__pyx_v_arr->base); + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ /* function exit code */ - __Pyx_RefNannyFinishContext(); + __pyx_L0:; + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/utilities/lib/fp_utils.pxd":58 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * 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); + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; + __pyx_r = __pyx_v_i0; goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { +/* 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 - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; + int __pyx_t_5; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_array", 0); + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") - */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * + * ndim = PyArray_NDIM(self) */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline int import_umath() except -1: + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ + __pyx_v_copy_shape = 1; - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; + } -static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_umath", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - { - __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:*/ { + /*else*/ { + __pyx_v_copy_shape = 0; + } + __pyx_L4:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * - * cdef inline int import_ufunc() except -1: + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 218, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * 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_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; + } - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + if (__pyx_t_1) { -static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_ufunc", 0); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 222, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * 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_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* 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; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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]); -/* "View.MemoryView":120 - * cdef bint dtype_is_object - * - * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< - * mode="c", bint allocate_buffer=True): - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } -/* 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); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_shape = ((PyObject*)values[0]); - __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 120, __pyx_L3_error) - __pyx_v_format = values[2]; - __pyx_v_mode = values[3]; - if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error) - } else { - - /* "View.MemoryView":121 - * - * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, - * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< - * - * cdef int idx + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ - __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, 120, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __pyx_L1_error) - if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __pyx_L1_error) + goto __pyx_L11; } - __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":120 - * cdef bint dtype_is_object - * - * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< - * mode="c", bint allocate_buffer=True): - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * 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)); - /* 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; - __Pyx_RefNannySetupContext("__cinit__", 0); - __Pyx_INCREF(__pyx_v_format); - - /* "View.MemoryView":127 - * cdef PyObject **p - * - * self.ndim = len(shape) # <<<<<<<<<<<<<< - * self.itemsize = itemsize - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) */ - if (unlikely(__pyx_v_shape == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(2, 127, __pyx_L1_error) + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error) - __pyx_v_self->ndim = ((int)__pyx_t_1); + __pyx_L11:; - /* "View.MemoryView":128 - * - * self.ndim = len(shape) - * self.itemsize = itemsize # <<<<<<<<<<<<<< - * - * if not self.ndim: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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_self->itemsize = __pyx_v_itemsize; + __pyx_v_info->suboffsets = NULL; - /* "View.MemoryView":130 - * self.itemsize = itemsize - * - * if not self.ndim: # <<<<<<<<<<<<<< - * raise ValueError("Empty shape tuple for cython.array") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * */ - __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); - if (__pyx_t_2) { + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "View.MemoryView":131 - * - * if not self.ndim: - * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * - * if itemsize <= 0: + * cdef int t */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 131, __pyx_L1_error) + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "View.MemoryView":130 - * self.itemsize = itemsize - * - * if not self.ndim: # <<<<<<<<<<<<<< - * raise ValueError("Empty shape tuple for cython.array") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ - } + __pyx_v_f = NULL; - /* "View.MemoryView":133 - * raise ValueError("Empty shape tuple for cython.array") - * - * if itemsize <= 0: # <<<<<<<<<<<<<< - * raise ValueError("itemsize <= 0 for cython.array") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * */ - __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); - if (__pyx_t_2) { + __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; - /* "View.MemoryView":134 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset * - * if itemsize <= 0: - * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< * - * if not isinstance(format, bytes): + * if not hasfields and not copy_shape: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 134, __pyx_L1_error) + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "View.MemoryView":133 - * raise ValueError("Empty shape tuple for cython.array") - * - * if itemsize <= 0: # <<<<<<<<<<<<<< - * raise ValueError("itemsize <= 0 for cython.array") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { - /* "View.MemoryView":136 - * raise ValueError("itemsize <= 0 for cython.array") - * - * if not isinstance(format, bytes): # <<<<<<<<<<<<<< - * format = format.encode('ASCII') - * self._format = format # keep a reference to the byte string - */ - __pyx_t_2 = PyBytes_Check(__pyx_v_format); - __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); - if (__pyx_t_4) { - - /* "View.MemoryView":137 - * - * if not isinstance(format, bytes): - * format = format.encode('ASCII') # <<<<<<<<<<<<<< - * self._format = format # keep a reference to the byte string - * self.format = self._format + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* "View.MemoryView":136 - * raise ValueError("itemsize <= 0 for cython.array") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * if not isinstance(format, bytes): # <<<<<<<<<<<<<< - * format = format.encode('ASCII') - * self._format = format # keep a reference to the byte string + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + goto __pyx_L14; } - /* "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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * + * if not hasfields: */ - if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 138, __pyx_L1_error) - __pyx_t_5 = __pyx_v_format; - __Pyx_INCREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_v_self->_format); - __Pyx_DECREF(__pyx_v_self->_format); - __pyx_v_self->_format = ((PyObject*)__pyx_t_5); - __pyx_t_5 = 0; + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L14:; - /* "View.MemoryView":139 - * format = format.encode('ASCII') - * self._format = format # keep a reference to the byte string - * self.format = self._format # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) - __pyx_v_self->format = __pyx_t_6; + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":142 - * - * - * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< - * self._strides = self._shape + self.ndim + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ - __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* "View.MemoryView":143 - * - * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) - * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< - * - * if not self._shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; - /* "View.MemoryView":145 - * self._strides = self._shape + self.ndim - * - * if not self._shape: # <<<<<<<<<<<<<< - * raise MemoryError("unable to allocate shape and strides.") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ - __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); - if (__pyx_t_4) { + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* "View.MemoryView":146 - * - * if not self._shape: - * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 146, __pyx_L1_error) + if (__pyx_t_1) { - /* "View.MemoryView":145 - * self._strides = self._shape + self.ndim - * - * if not self._shape: # <<<<<<<<<<<<<< - * raise MemoryError("unable to allocate shape and strides.") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 259, __pyx_L1_error) - /* "View.MemoryView":149 - * - * - * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< - * if dim <= 0: - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __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, 149, __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, 149, __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, 149, __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":150 - * - * for idx, dim in enumerate(shape): - * if dim <= 0: # <<<<<<<<<<<<<< - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) - * self._shape[idx] = dim + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); - if (__pyx_t_4) { + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "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 - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __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, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(2, 151, __pyx_L1_error) + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "View.MemoryView":150 - * - * for idx, dim in enumerate(shape): - * if dim <= 0: # <<<<<<<<<<<<<< - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) - * self._shape[idx] = dim + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - } + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "View.MemoryView":152 - * if dim <= 0: - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) - * self._shape[idx] = dim # <<<<<<<<<<<<<< - * - * cdef char order + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "View.MemoryView":149 - * - * - * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< - * if dim <= 0: - * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "View.MemoryView":155 - * - * cdef char order - * if mode == 'fortran': # <<<<<<<<<<<<<< - * order = b'F' - * self.mode = u'fortran' + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ - __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 155, __pyx_L1_error) - if (__pyx_t_4) { + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* "View.MemoryView":156 - * cdef char order - * if mode == 'fortran': - * order = b'F' # <<<<<<<<<<<<<< - * self.mode = u'fortran' - * elif mode == 'c': + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ - __pyx_v_order = 'F'; + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; - /* "View.MemoryView":157 - * if mode == 'fortran': - * order = b'F' - * self.mode = u'fortran' # <<<<<<<<<<<<<< - * elif mode == 'c': - * order = b'C' + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - __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; + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "View.MemoryView":155 - * - * cdef char order - * if mode == 'fortran': # <<<<<<<<<<<<<< - * order = b'F' - * self.mode = u'fortran' + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - goto __pyx_L10; - } + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "View.MemoryView":158 - * order = b'F' - * self.mode = u'fortran' - * elif mode == 'c': # <<<<<<<<<<<<<< - * order = b'C' - * self.mode = u'c' + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ - __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error) - if (__pyx_t_4) { + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* "View.MemoryView":159 - * self.mode = u'fortran' - * elif mode == 'c': - * order = b'C' # <<<<<<<<<<<<<< - * self.mode = u'c' - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ - __pyx_v_order = 'C'; + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* "View.MemoryView":160 - * elif mode == 'c': - * order = b'C' - * self.mode = u'c' # <<<<<<<<<<<<<< - * else: - * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ - __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; + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; - /* "View.MemoryView":158 - * order = b'F' - * self.mode = u'fortran' - * elif mode == 'c': # <<<<<<<<<<<<<< - * order = b'C' - * self.mode = u'c' + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - goto __pyx_L10; - } + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "View.MemoryView":162 - * self.mode = u'c' - * else: - * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< - * - * self.len = fill_contig_strides_array(self._shape, self._strides, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - /*else*/ { - __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 162, __pyx_L1_error) - } - __pyx_L10:; + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "View.MemoryView":164 - * 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) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ - __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); + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "View.MemoryView":167 - * itemsize, self.ndim, order) - * - * self.free_data = allocate_buffer # <<<<<<<<<<<<<< - * self.dtype_is_object = format == b'O' - * if allocate_buffer: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - __pyx_v_self->free_data = __pyx_v_allocate_buffer; + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "View.MemoryView":168 - * - * self.free_data = allocate_buffer - * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< - * if allocate_buffer: - * - */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_self->dtype_is_object = __pyx_t_4; - - /* "View.MemoryView":169 - * 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":172 - * - * - * 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":173 - * - * self.data = malloc(self.len) - * if not self.data: # <<<<<<<<<<<<<< - * raise MemoryError("unable to allocate array data.") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); - if (__pyx_t_4) { + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: - /* "View.MemoryView":174 - * self.data = malloc(self.len) - * if not self.data: - * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< - * - * if self.dtype_is_object: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 174, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 278, __pyx_L1_error) + break; + } - /* "View.MemoryView":173 - * - * self.data = malloc(self.len) - * if not self.data: # <<<<<<<<<<<<<< - * raise MemoryError("unable to allocate array data.") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: */ - } + __pyx_v_info->format = __pyx_v_f; - /* "View.MemoryView":176 - * raise MemoryError("unable to allocate array data.") - * - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * p = self.data - * for i in range(self.len / itemsize): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) */ - __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); - if (__pyx_t_4) { + __pyx_r = 0; + goto __pyx_L0; - /* "View.MemoryView":177 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * - * if self.dtype_is_object: - * p = self.data # <<<<<<<<<<<<<< - * for i in range(self.len / itemsize): - * p[i] = Py_None + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_v_p = ((PyObject **)__pyx_v_self->data); + } - /* "View.MemoryView":178 - * if self.dtype_is_object: - * p = self.data - * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< - * p[i] = Py_None - * Py_INCREF(Py_None) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ - if (unlikely(__pyx_v_itemsize == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 178, __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, 178, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; + /*else*/ { + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "View.MemoryView":179 - * p = self.data - * for i in range(self.len / itemsize): - * p[i] = Py_None # <<<<<<<<<<<<<< - * Py_INCREF(Py_None) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, */ - (__pyx_v_p[__pyx_v_i]) = Py_None; + (__pyx_v_info->format[0]) = '^'; - /* "View.MemoryView":180 - * for i in range(self.len / itemsize): - * p[i] = Py_None - * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * - * @cname('getbuffer') + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ - Py_INCREF(Py_None); - } + __pyx_v_offset = 0; - /* "View.MemoryView":176 - * raise MemoryError("unable to allocate array data.") - * - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * p = self.data - * for i in range(self.len / itemsize): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) */ - } + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "View.MemoryView":169 - * self.free_data = allocate_buffer - * self.dtype_is_object = format == b'O' - * if allocate_buffer: # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * 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'; } - /* "View.MemoryView":120 - * cdef bint dtype_is_object - * - * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< - * mode="c", bint allocate_buffer=True): - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ /* function exit code */ @@ -13789,10434 +14287,9955 @@ 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_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_format); + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":183 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< - * cdef int bufmode = -1 - * if self.mode == u"c": + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ /* 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; +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("__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)); + __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(); - 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; +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { __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; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "View.MemoryView":184 - * @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; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "View.MemoryView":185 - * def __getbuffer__(self, Py_buffer *info, int flags): - * cdef int bufmode = -1 - * if self.mode == u"c": # <<<<<<<<<<<<<< - * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * elif self.mode == u"fortran": + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 185, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":186 - * 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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) */ - __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + free(__pyx_v_info->format); - /* "View.MemoryView":185 - * def __getbuffer__(self, Py_buffer *info, int flags): - * cdef int bufmode = -1 - * if self.mode == u"c": # <<<<<<<<<<<<<< - * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * elif self.mode == u"fortran": + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - goto __pyx_L3; } - /* "View.MemoryView":187 - * if self.mode == u"c": - * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * elif self.mode == u"fortran": # <<<<<<<<<<<<<< - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 187, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_2 != 0); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "View.MemoryView":188 - * 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.") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * */ - __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + free(__pyx_v_info->strides); - /* "View.MemoryView":187 - * if self.mode == u"c": - * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * elif self.mode == u"fortran": # <<<<<<<<<<<<<< - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ } - __pyx_L3:; - /* "View.MemoryView":189 - * elif self.mode == u"fortran": - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): # <<<<<<<<<<<<<< - * raise ValueError("Can only create a buffer that is contiguous in memory.") - * info.buf = self.data + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); - if (__pyx_t_1) { - /* "View.MemoryView":190 - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): - * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< - * info.buf = self.data - * info.len = self.len - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 190, __pyx_L1_error) + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "View.MemoryView":189 - * elif self.mode == u"fortran": - * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS - * if not (flags & bufmode): # <<<<<<<<<<<<<< - * raise ValueError("Can only create a buffer that is contiguous in memory.") - * info.buf = self.data +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - } - /* "View.MemoryView":191 - * 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; +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); - /* "View.MemoryView":192 - * 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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - __pyx_t_5 = __pyx_v_self->len; - __pyx_v_info->len = __pyx_t_5; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":193 - * info.buf = self.data - * info.len = self.len - * info.ndim = self.ndim # <<<<<<<<<<<<<< - * info.shape = self._shape - * info.strides = self._strides + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - __pyx_t_6 = __pyx_v_self->ndim; - __pyx_v_info->ndim = __pyx_t_6; - /* "View.MemoryView":194 - * 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; + /* 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; +} - /* "View.MemoryView":195 - * info.ndim = self.ndim - * info.shape = self._shape - * info.strides = self._strides # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = self.itemsize +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - __pyx_t_7 = __pyx_v_self->_strides; - __pyx_v_info->strides = __pyx_t_7; - /* "View.MemoryView":196 - * info.shape = self._shape - * info.strides = self._strides - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = self.itemsize - * info.readonly = 0 - */ - __pyx_v_info->suboffsets = NULL; +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); - /* "View.MemoryView":197 - * info.strides = self._strides - * info.suboffsets = NULL - * info.itemsize = self.itemsize # <<<<<<<<<<<<<< - * info.readonly = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< * + * cdef inline object PyArray_MultiIterNew3(a, b, c): */ - __pyx_t_5 = __pyx_v_self->itemsize; - __pyx_v_info->itemsize = __pyx_t_5; - - /* "View.MemoryView":198 - * info.suboffsets = NULL - * info.itemsize = self.itemsize - * info.readonly = 0 # <<<<<<<<<<<<<< - * - * if flags & PyBUF_FORMAT: - */ - __pyx_v_info->readonly = 0; + __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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":200 - * info.readonly = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * info.format = self.format - * else: - */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":201 + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) * - * 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":200 - * info.readonly = 0 - * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * info.format = self.format - * else: - */ - goto __pyx_L5; - } + /* 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; +} - /* "View.MemoryView":203 - * info.format = self.format - * else: - * info.format = NULL # <<<<<<<<<<<<<< +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * - * info.obj = self */ - /*else*/ { - __pyx_v_info->format = NULL; - } - __pyx_L5:; - /* "View.MemoryView":205 - * info.format = NULL +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 * - * info.obj = self # <<<<<<<<<<<<<< + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< * - * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + __Pyx_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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":183 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) * - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< - * cdef int bufmode = -1 - * if self.mode == u"c": */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":209 - * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) * - * 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) { +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 - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * 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, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * 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; } -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":210 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) * - * 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":211 - * 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); +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); - /* "View.MemoryView":210 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 * - * def __dealloc__(array self): - * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< - * self.callback_free_data(self.data) - * elif self.free_data: + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - goto __pyx_L3; - } + __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, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":212 - * if self.callback_free_data != NULL: - * self.callback_free_data(self.data) - * elif self.free_data: # <<<<<<<<<<<<<< - * if self.dtype_is_object: - * refcount_objects_in_slice(self.data, self._shape, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) + * */ - __pyx_t_1 = (__pyx_v_self->free_data != 0); - if (__pyx_t_1) { - /* "View.MemoryView":213 - * self.callback_free_data(self.data) - * elif self.free_data: - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * refcount_objects_in_slice(self.data, self._shape, - * self._strides, self.ndim, False) + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. */ - __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); - if (__pyx_t_1) { - /* "View.MemoryView":214 - * 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":213 - * self.callback_free_data(self.data) - * elif self.free_data: - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * refcount_objects_in_slice(self.data, self._shape, - * self._strides, self.ndim, False) - */ - } +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); - /* "View.MemoryView":216 - * refcount_objects_in_slice(self.data, self._shape, - * self._strides, self.ndim, False) - * free(self.data) # <<<<<<<<<<<<<< - * PyObject_Free(self._shape) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ - free(__pyx_v_self->data); - - /* "View.MemoryView":212 - * if self.callback_free_data != NULL: - * self.callback_free_data(self.data) - * elif self.free_data: # <<<<<<<<<<<<<< - * if self.dtype_is_object: - * refcount_objects_in_slice(self.data, self._shape, - */ - } - __pyx_L3:; + __pyx_v_endian_detector = 1; - /* "View.MemoryView":217 - * self._strides, self.ndim, False) - * free(self.data) - * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields * - * @property */ - PyObject_Free(__pyx_v_self->_shape); + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "View.MemoryView":209 - * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * def __dealloc__(array self): # <<<<<<<<<<<<<< - * if self.callback_free_data != NULL: - * self.callback_free_data(self.data) + * 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, 794, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "View.MemoryView":220 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 * - * @property - * def memview(self): # <<<<<<<<<<<<<< - * return self.get_memview() + * 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, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; -/* 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":221 - * @property - * def memview(self): - * return self.get_memview() # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< * - * @cname('get_memview') + * if (end - f) - (new_offset - offset[0]) < 15: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; - /* "View.MemoryView":220 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - * @property - * def memview(self): # <<<<<<<<<<<<<< - * return self.get_memview() + * 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, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "View.MemoryView":224 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * - * @cname('get_memview') - * cdef get_memview(self): # <<<<<<<<<<<<<< - * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE - * return memoryview(self, flags, self.dtype_is_object) + * 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__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 799, __pyx_L1_error) -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":225 - * @cname('get_memview') - * cdef get_memview(self): - * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< - * return memoryview(self, flags, self.dtype_is_object) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * 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_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + } - /* "View.MemoryView":226 - * cdef get_memview(self): - * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE - * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __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, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __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:; - /* "View.MemoryView":224 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 * - * @cname('get_memview') - * cdef get_memview(self): # <<<<<<<<<<<<<< - * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE - * return memoryview(self, flags, self.dtype_is_object) + * 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:; - /* 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 - * - * - * def __getattr__(self, attr): # <<<<<<<<<<<<<< - * return getattr(self.memview, attr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + if (__pyx_t_6) { -/* 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_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__getattr__", 0); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 803, __pyx_L1_error) - /* "View.MemoryView":230 - * - * def __getattr__(self, attr): - * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * def __getitem__(self, item): + * 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_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, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + } - /* "View.MemoryView":229 - * - * - * def __getattr__(self, attr): # <<<<<<<<<<<<<< - * return getattr(self.memview, attr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; - /* 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; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 0x78; -/* "View.MemoryView":232 - * return getattr(self.memview, attr) - * - * def __getitem__(self, item): # <<<<<<<<<<<<<< - * return self.memview[item] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 * */ + __pyx_v_f = (__pyx_v_f + 1); -/* 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_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__getitem__", 0); - - /* "View.MemoryView":233 - * - * def __getitem__(self, item): - * return self.memview[item] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< * - * def __setitem__(self, item, value): + * offset[0] += child.itemsize */ - __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 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } - /* "View.MemoryView":232 - * return getattr(self.memview, attr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 * - * def __getitem__(self, item): # <<<<<<<<<<<<<< - * return self.memview[item] + * 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); - /* 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":235 - * return self.memview[item] - * - * def __setitem__(self, item, value): # <<<<<<<<<<<<<< - * self.memview[item] = value + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { -/* 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_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__setitem__", 0); - - /* "View.MemoryView":236 - * - * def __setitem__(self, item, value): - * self.memview[item] = value # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "View.MemoryView":235 - * return self.memview[item] - * - * def __setitem__(self, item, value): # <<<<<<<<<<<<<< - * self.memview[item] = value + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "View.MemoryView":240 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * @cname("__pyx_array_new") - * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< - * char *mode, char *buf): - * cdef array result */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { -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":244 - * cdef array result + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * - * if buf == NULL: # <<<<<<<<<<<<<< - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: + * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 823, __pyx_L1_error) - /* "View.MemoryView":245 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * - * 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, 245, __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, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_v_shape); - __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, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); - __pyx_t_4 = 0; + } - /* "View.MemoryView":244 - * cdef array result + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 * - * if buf == NULL: # <<<<<<<<<<<<<< - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: + * # 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" */ - goto __pyx_L3; - } + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } - /* "View.MemoryView":247 - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: - * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< - * allocate_buffer=False) - * result.data = buf + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" */ - /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_shape); - __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; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } - /* "View.MemoryView":248 - * else: - * result = array(shape, itemsize, format, mode.decode('ASCII'), - * allocate_buffer=False) # <<<<<<<<<<<<<< - * result.data = buf - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } - /* "View.MemoryView":247 - * result = array(shape, itemsize, format, mode.decode('ASCII')) - * else: - * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< - * allocate_buffer=False) - * result.data = buf + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } - /* "View.MemoryView":249 - * result = array(shape, itemsize, format, mode.decode('ASCII'), - * allocate_buffer=False) - * result.data = buf # <<<<<<<<<<<<<< - * - * return result + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_v_result->data = __pyx_v_buf; - } - __pyx_L3:; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } - /* "View.MemoryView":251 - * result.data = buf - * - * return result # <<<<<<<<<<<<<< - * - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = __pyx_v_result; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } - /* "View.MemoryView":240 - * - * @cname("__pyx_array_new") - * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< - * char *mode, char *buf): - * cdef array result + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } - /* 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":277 - * cdef class Enum(object): - * cdef object name - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * def __repr__(self): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - -/* 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); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 277, __pyx_L3_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; } - } 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, 277, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_MemviewEnum___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":278 - * cdef object name - * def __init__(self, name): - * self.name = name # <<<<<<<<<<<<<< - * def __repr__(self): - * return self.name + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __Pyx_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; + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } - /* "View.MemoryView":277 - * cdef class Enum(object): - * cdef object name - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * def __repr__(self): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } -/* 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":280 - * self.name = name - * def __repr__(self): - * return self.name # <<<<<<<<<<<<<< - * - * cdef generic = Enum("") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->name); - __pyx_r = __pyx_v_self->name; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } - /* "View.MemoryView":279 - * def __init__(self, name): - * self.name = name - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.name - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } -/* "View.MemoryView":294 - * - * @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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } -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; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } - /* "View.MemoryView":296 - * cdef void *align_pointer(void *memory, size_t alignment) nogil: - * "Align pointer memory on a given boundary" - * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< - * cdef size_t offset - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } - /* "View.MemoryView":300 - * - * with cython.cdivision(True): - * offset = aligned_p % alignment # <<<<<<<<<<<<<< - * - * if offset > 0: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: */ - __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + /*else*/ { + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 844, __pyx_L1_error) + } + __pyx_L15:; - /* "View.MemoryView":302 - * offset = aligned_p % alignment - * - * if offset > 0: # <<<<<<<<<<<<<< - * aligned_p += alignment - offset - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), */ - __pyx_t_1 = ((__pyx_v_offset > 0) != 0); - if (__pyx_t_1) { + __pyx_v_f = (__pyx_v_f + 1); - /* "View.MemoryView":303 - * - * if offset > 0: - * aligned_p += alignment - offset # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * - * return aligned_p + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); + goto __pyx_L13; + } - /* "View.MemoryView":302 - * offset = aligned_p % alignment + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f * - * if offset > 0: # <<<<<<<<<<<<<< - * aligned_p += alignment - offset + */ + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":305 - * aligned_p += alignment - offset - * - * return aligned_p # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< * * */ - __pyx_r = ((void *)__pyx_v_aligned_p); + __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "View.MemoryView":294 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * - * @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 + * 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; } -/* "View.MemoryView":341 - * cdef __Pyx_TypeInfo *typeinfo +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * - * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< - * self.obj = obj - * self.flags = flags + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ -/* 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); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_obj = values[0]; - __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error) - if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error) - } else { - __pyx_v_dtype_is_object = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_memoryview___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; +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; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_RefNannySetupContext("set_array_base", 0); - /* "View.MemoryView":342 - * - * 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: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - __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; + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "View.MemoryView":343 - * 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) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! */ - __pyx_v_self->flags = __pyx_v_flags; + __pyx_v_baseptr = NULL; - /* "View.MemoryView":344 - * self.obj = obj - * self.flags = flags - * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< - * __Pyx_GetBuffer(obj, &self.view, flags) - * if self.view.obj == NULL: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: */ - __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; + goto __pyx_L3; } - __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":345 - * 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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) */ - __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 345, __pyx_L1_error) + /*else*/ { + Py_INCREF(__pyx_v_base); - /* "View.MemoryView":346 - * 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) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr */ - __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); - if (__pyx_t_1) { + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; - /* "View.MemoryView":347 - * __Pyx_GetBuffer(obj, &self.view, flags) - * if self.view.obj == NULL: - * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< - * Py_INCREF(Py_None) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr * */ - ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; + Py_XDECREF(__pyx_v_arr->base); - /* "View.MemoryView":348 - * if self.view.obj == NULL: - * (<__pyx_buffer *> &self.view).obj = Py_None - * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< * - * global __pyx_memoryview_thread_locks_used + * cdef inline object get_array_base(ndarray arr): */ - Py_INCREF(Py_None); + __pyx_v_arr->base = __pyx_v_baseptr; - /* "View.MemoryView":346 - * 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) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: */ - } - /* "View.MemoryView":344 - * self.obj = obj - * self.flags = flags - * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< - * __Pyx_GetBuffer(obj, &self.view, flags) - * if self.view.obj == NULL: - */ - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "View.MemoryView":351 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr * - * 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 + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ - __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); - if (__pyx_t_1) { - /* "View.MemoryView":352 - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: - */ - __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); +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); - /* "View.MemoryView":353 - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: */ - __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":351 - * - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - */ - } - - /* "View.MemoryView":354 - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: # <<<<<<<<<<<<<< - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: - */ - __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":355 - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< - * if self.lock is NULL: - * raise MemoryError + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base */ - __pyx_v_self->lock = PyThread_allocate_lock(); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; - /* "View.MemoryView":356 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: # <<<<<<<<<<<<<< - * raise MemoryError + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: */ - __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - if (__pyx_t_1) { + } - /* "View.MemoryView":357 - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: - * raise MemoryError # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + * * - * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error) + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } - /* "View.MemoryView":356 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: # <<<<<<<<<<<<<< - * raise MemoryError + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ - } - /* "View.MemoryView":354 - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: # <<<<<<<<<<<<<< - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ - } - /* "View.MemoryView":359 - * raise MemoryError - * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') - * else: +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); - if (__pyx_t_1) { + { + __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:*/ { - /* "View.MemoryView":360 - * - * 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 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_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; + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) - /* "View.MemoryView":359 - * raise MemoryError - * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - goto __pyx_L10; - } + } + __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:; + __Pyx_PyThreadState_assign - /* "View.MemoryView":362 - * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') - * else: - * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") * - * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( */ - /*else*/ { - __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; - } - __pyx_L10:; + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "View.MemoryView":364 - * self.dtype_is_object = dtype_is_object + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * - * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< - * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) - * self.typeinfo = NULL + * cdef inline int import_umath() except -1: */ - __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "View.MemoryView":366 - * 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): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __pyx_v_self->typeinfo = NULL; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "View.MemoryView":341 - * cdef __Pyx_TypeInfo *typeinfo - * - * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< - * self.obj = obj - * self.flags = flags + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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; } -/* "View.MemoryView":368 - * self.typeinfo = NULL +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * - * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< - * if self.obj is not None: - * __Pyx_ReleaseBuffer(&self.view) + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -/* 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; +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; int __pyx_t_4; - PyThread_type_lock __pyx_t_5; - PyThread_type_lock __pyx_t_6; - __Pyx_RefNannySetupContext("__dealloc__", 0); + 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); - /* "View.MemoryView":369 - * - * def __dealloc__(memoryview self): - * if self.obj is not None: # <<<<<<<<<<<<<< - * __Pyx_ReleaseBuffer(&self.view) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_1 = (__pyx_v_self->obj != Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + { + __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:*/ { - /* "View.MemoryView":370 - * def __dealloc__(memoryview self): - * if self.obj is not None: - * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< - * - * cdef int i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) - /* "View.MemoryView":369 - * - * def __dealloc__(memoryview self): - * if self.obj is not None: # <<<<<<<<<<<<<< - * __Pyx_ReleaseBuffer(&self.view) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - } - - /* "View.MemoryView":374 - * cdef int i - * global __pyx_memoryview_thread_locks_used - * if self.lock != NULL: # <<<<<<<<<<<<<< - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: - */ - __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); - if (__pyx_t_2) { - - /* "View.MemoryView":375 - * global __pyx_memoryview_thread_locks_used - * if self.lock != NULL: - * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< - * if __pyx_memoryview_thread_locks[i] is self.lock: - * __pyx_memoryview_thread_locks_used -= 1 - */ - __pyx_t_3 = __pyx_memoryview_thread_locks_used; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "View.MemoryView":376 - * if self.lock != NULL: - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: - */ - __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); - if (__pyx_t_2) { - - /* "View.MemoryView":377 - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: - * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< - * if i != __pyx_memoryview_thread_locks_used: - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - */ - __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); - - /* "View.MemoryView":378 - * if __pyx_memoryview_thread_locks[i] is self.lock: - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) - */ - __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); - if (__pyx_t_2) { - - /* "View.MemoryView":380 - * if i != __pyx_memoryview_thread_locks_used: - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); - __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); - - /* "View.MemoryView":379 - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) - * break - */ - (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; - (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; - - /* "View.MemoryView":378 - * if __pyx_memoryview_thread_locks[i] is self.lock: - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) - */ - } - - /* "View.MemoryView":381 - * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( - * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) - * break # <<<<<<<<<<<<<< - * else: - * PyThread_free_lock(self.lock) - */ - goto __pyx_L6_break; + } + __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:; + __Pyx_PyThreadState_assign - /* "View.MemoryView":376 - * if self.lock != NULL: - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks_used -= 1 - * if i != __pyx_memoryview_thread_locks_used: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * */ - } - } - /*else*/ { + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "View.MemoryView":383 - * break - * else: - * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * - * cdef char *get_item_pointer(memoryview self, object index) except NULL: + * cdef inline int import_ufunc() except -1: */ - PyThread_free_lock(__pyx_v_self->lock); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) } - __pyx_L6_break:; + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "View.MemoryView":374 - * cdef int i - * global __pyx_memoryview_thread_locks_used - * if self.lock != NULL: # <<<<<<<<<<<<<< - * for i in range(__pyx_memoryview_thread_locks_used): - * if __pyx_memoryview_thread_locks[i] is self.lock: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; } - /* "View.MemoryView":368 - * self.typeinfo = NULL + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * - * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< - * if self.obj is not None: - * __Pyx_ReleaseBuffer(&self.view) + * 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; } -/* "View.MemoryView":385 - * PyThread_free_lock(self.lock) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * - * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< - * cdef Py_ssize_t dim - * cdef char *itemp = self.view.buf + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ -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; +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("get_item_pointer", 0); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "View.MemoryView":387 - * cdef char *get_item_pointer(memoryview self, object index) except NULL: - * cdef Py_ssize_t dim - * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * - * for dim, idx in enumerate(index): + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); + { + __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:*/ { - /* "View.MemoryView":389 - * cdef char *itemp = self.view.buf - * - * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< - * itemp = pybuffer_index(&self.view, itemp, idx, dim) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __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, 389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - #endif - } else { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 389, __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); + __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:; + __Pyx_PyThreadState_assign - /* "View.MemoryView":390 - * - * for dim, idx in enumerate(index): - * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< - * - * return itemp + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 390, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 390, __pyx_L1_error) - __pyx_v_itemp = __pyx_t_7; + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "View.MemoryView":389 - * cdef char *itemp = self.view.buf - * - * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< - * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "View.MemoryView":392 - * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * - * return itemp # <<<<<<<<<<<<<< - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_r = __pyx_v_itemp; - goto __pyx_L0; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "View.MemoryView":385 - * PyThread_free_lock(self.lock) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * - * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< - * cdef Py_ssize_t dim - * cdef char *itemp = self.view.buf + * 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_2); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __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_XDECREF(__pyx_v_idx); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":395 +/* "View.MemoryView":120 + * cdef bint dtype_is_object * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): * - * 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; +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 - 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":396 - * - * 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":397 - * 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; + __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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __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, 120, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error) + } else { - /* "View.MemoryView":396 + /* "View.MemoryView":121 * - * def __getitem__(memoryview self, object index): - * if index is Ellipsis: # <<<<<<<<<<<<<< - * return self + * 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, 120, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __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":399 - * return self + /* "View.MemoryView":120 + * cdef bint dtype_is_object * - * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): * - * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (likely(__pyx_t_3 != Py_None)) { - PyObject* sequence = __pyx_t_3; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 399, __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, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __pyx_L1_error) - } - __pyx_v_have_slices = __pyx_t_4; - __pyx_t_4 = 0; - __pyx_v_indices = __pyx_t_5; - __pyx_t_5 = 0; - /* "View.MemoryView":402 + /* 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; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":127 + * cdef PyObject **p + * + * self.ndim = len(shape) # <<<<<<<<<<<<<< + * self.itemsize = itemsize * - * 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, 402, __pyx_L1_error) - if (__pyx_t_2) { + if (unlikely(__pyx_v_shape == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(2, 127, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); - /* "View.MemoryView":403 - * cdef char *itemp - * if have_slices: - * return memview_slice(self, indices) # <<<<<<<<<<<<<< - * else: - * itemp = self.get_item_pointer(indices) + /* "View.MemoryView":128 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: */ - __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, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __pyx_v_self->itemsize = __pyx_v_itemsize; - /* "View.MemoryView":402 + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") * - * cdef char *itemp - * if have_slices: # <<<<<<<<<<<<<< - * return memview_slice(self, indices) - * else: */ - } + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":405 - * return memview_slice(self, indices) - * else: - * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< - * return self.convert_item_to_object(itemp) + /* "View.MemoryView":131 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< * + * if itemsize <= 0: */ - /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 405, __pyx_L1_error) - __pyx_v_itemp = __pyx_t_6; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 131, __pyx_L1_error) - /* "View.MemoryView":406 - * else: - * itemp = self.get_item_pointer(indices) - * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< + /* "View.MemoryView":130 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") * - * 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, 406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; } - /* "View.MemoryView":395 + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") * - * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< - * if index is Ellipsis: - * return self */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (__pyx_t_2) { - /* 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":408 - * return self.convert_item_to_object(itemp) + /* "View.MemoryView":134 * - * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< - * have_slices, index = _unellipsify(index, self.view.ndim) + * 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__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 134, __pyx_L1_error) -/* 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 - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("__setitem__", 0); - __Pyx_INCREF(__pyx_v_index); - - /* "View.MemoryView":409 + /* "View.MemoryView":133 + * raise ValueError("Empty shape tuple for cython.array") * - * def __setitem__(memoryview self, object index, object value): - * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") * - * if have_slices: */ - __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(__pyx_t_1 != Py_None)) { - PyObject* sequence = __pyx_t_1; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 409, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) } - __pyx_v_have_slices = __pyx_t_2; - __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); - __pyx_t_3 = 0; - /* "View.MemoryView":411 - * have_slices, index = _unellipsify(index, self.view.ndim) + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") * - * if have_slices: # <<<<<<<<<<<<<< - * obj = self.is_slice(value) - * if obj: + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error) + __pyx_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_4) { - /* "View.MemoryView":412 + /* "View.MemoryView":137 * - * if have_slices: - * obj = self.is_slice(value) # <<<<<<<<<<<<<< - * if obj: - * self.setitem_slice_assignment(self[index], obj) + * 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_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_obj = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); + __pyx_t_5 = 0; - /* "View.MemoryView":413 - * if have_slices: - * obj = self.is_slice(value) - * if obj: # <<<<<<<<<<<<<< - * self.setitem_slice_assignment(self[index], obj) - * else: + /* "View.MemoryView":136 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if not isinstance(format, bytes): # <<<<<<<<<<<<<< + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error) - if (__pyx_t_4) { + } - /* "View.MemoryView":414 - * obj = self.is_slice(value) - * if obj: - * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< - * else: - * self.setitem_slice_assign_scalar(self[index], value) + /* "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_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 138, __pyx_L1_error) + __pyx_t_5 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; - /* "View.MemoryView":413 - * if have_slices: - * obj = self.is_slice(value) - * if obj: # <<<<<<<<<<<<<< - * self.setitem_slice_assignment(self[index], obj) - * else: + /* "View.MemoryView":139 + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * */ - goto __pyx_L4; - } + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_6; - /* "View.MemoryView":416 - * self.setitem_slice_assignment(self[index], obj) - * else: - * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< - * else: - * self.setitem_indexed(index, value) + /* "View.MemoryView":142 + * + * + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< + * self._strides = self._shape + self.ndim + * */ - /*else*/ { - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L4:; + __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); - /* "View.MemoryView":411 - * have_slices, index = _unellipsify(index, self.view.ndim) + /* "View.MemoryView":143 * - * if have_slices: # <<<<<<<<<<<<<< - * obj = self.is_slice(value) - * if obj: + * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) + * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< + * + * if not self._shape: */ - goto __pyx_L3; - } + __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); - /* "View.MemoryView":418 - * self.setitem_slice_assign_scalar(self[index], value) - * else: - * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + /* "View.MemoryView":145 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") * - * cdef is_slice(self, obj): */ - /*else*/ { - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L3:; + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (__pyx_t_4) { - /* "View.MemoryView":408 - * return self.convert_item_to_object(itemp) + /* "View.MemoryView":146 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< * - * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< - * have_slices, index = _unellipsify(index, self.view.ndim) * */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 146, __pyx_L1_error) - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_have_slices); - __Pyx_XDECREF(__pyx_v_obj); - __Pyx_XDECREF(__pyx_v_index); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "View.MemoryView":420 - * self.setitem_indexed(index, value) + /* "View.MemoryView":145 + * self._strides = self._shape + self.ndim * - * 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":421 + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") * - * 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":422 - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): - * try: # <<<<<<<<<<<<<< - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) - */ - { - __Pyx_PyThreadState_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":423 - * if not isinstance(obj, memoryview): - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< - * self.dtype_is_object) - * except TypeError: - */ - __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 423, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_6); - - /* "View.MemoryView":424 - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) # <<<<<<<<<<<<<< - * except TypeError: - * return None - */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_7); - - /* "View.MemoryView":423 - * if not isinstance(obj, memoryview): - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< - * self.dtype_is_object) - * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __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, 423, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); - __pyx_t_7 = 0; + } - /* "View.MemoryView":422 - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): - * try: # <<<<<<<<<<<<<< - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) + /* "View.MemoryView":149 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) */ - } - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; - __pyx_L4_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __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, 149, __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, 149, __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, 149, __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":425 - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) - * except TypeError: # <<<<<<<<<<<<<< - * return None + /* "View.MemoryView":150 * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim */ - __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, 425, __pyx_L6_except_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (__pyx_t_4) { - /* "View.MemoryView":426 - * self.dtype_is_object) - * except TypeError: - * return None # <<<<<<<<<<<<<< + /* "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 * - * return obj */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L7_except_return; - } - goto __pyx_L6_except_error; - __pyx_L6_except_error:; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __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, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __PYX_ERR(2, 151, __pyx_L1_error) - /* "View.MemoryView":422 - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): - * try: # <<<<<<<<<<<<<< - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, - * self.dtype_is_object) + /* "View.MemoryView":150 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); - goto __pyx_L1_error; - __pyx_L7_except_return:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); - goto __pyx_L0; - __pyx_L11_try_end:; } - /* "View.MemoryView":421 + /* "View.MemoryView":152 + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim # <<<<<<<<<<<<<< * - * cdef is_slice(self, obj): - * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< - * try: - * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * cdef char order */ - } + (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; - /* "View.MemoryView":428 - * return None + /* "View.MemoryView":149 * - * return obj # <<<<<<<<<<<<<< * - * cdef setitem_slice_assignment(self, dst, src): + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_obj); - __pyx_r = __pyx_v_obj; - goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "View.MemoryView":420 - * self.setitem_indexed(index, value) + /* "View.MemoryView":155 * - * cdef is_slice(self, obj): # <<<<<<<<<<<<<< - * if not isinstance(obj, memoryview): - * try: + * 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, 155, __pyx_L1_error) + if (__pyx_t_4) { - /* 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":156 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; -/* "View.MemoryView":430 - * return obj + /* "View.MemoryView":157 + * 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":155 * - * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice dst_slice - * cdef __Pyx_memviewslice src_slice + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' */ + goto __pyx_L10; + } -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":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error) + if (__pyx_t_4) { - /* "View.MemoryView":434 - * cdef __Pyx_memviewslice src_slice - * - * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< - * get_slice_from_memview(dst, &dst_slice)[0], - * src.ndim, dst.ndim, self.dtype_is_object) + /* "View.MemoryView":159 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: */ - if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 434, __pyx_L1_error) + __pyx_v_order = 'C'; - /* "View.MemoryView":435 - * - * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], - * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< - * src.ndim, dst.ndim, self.dtype_is_object) - * + /* "View.MemoryView":160 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) */ - if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 435, __pyx_L1_error) + __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":436 - * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], - * get_slice_from_memview(dst, &dst_slice)[0], - * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< - * - * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + /* "View.MemoryView":158 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L10; + } - /* "View.MemoryView":434 - * cdef __Pyx_memviewslice src_slice + /* "View.MemoryView":162 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< * - * 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) + * self.len = fill_contig_strides_array(self._shape, self._strides, */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 434, __pyx_L1_error) + /*else*/ { + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 162, __pyx_L1_error) + } + __pyx_L10:; - /* "View.MemoryView":430 - * return obj + /* "View.MemoryView":164 + * 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) * - * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice dst_slice - * cdef __Pyx_memviewslice src_slice */ + __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); - /* 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":438 - * src.ndim, dst.ndim, self.dtype_is_object) + /* "View.MemoryView":167 + * itemsize, self.ndim, order) * - * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< - * cdef int array[128] - * cdef void *tmp = NULL + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; -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":440 - * cdef setitem_slice_assign_scalar(self, memoryview dst, value): - * cdef int array[128] - * cdef void *tmp = NULL # <<<<<<<<<<<<<< - * cdef void *item + /* "View.MemoryView":168 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: * */ - __pyx_v_tmp = NULL; + __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; - /* "View.MemoryView":445 - * cdef __Pyx_memviewslice *dst_slice - * cdef __Pyx_memviewslice tmp_slice - * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< + /* "View.MemoryView":169 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * * - * if self.view.itemsize > sizeof(array): */ - __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); + __pyx_t_4 = (__pyx_v_allocate_buffer != 0); + if (__pyx_t_4) { - /* "View.MemoryView":447 - * dst_slice = get_slice_from_memview(dst, &tmp_slice) + /* "View.MemoryView":172 * - * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< - * tmp = PyMem_Malloc(self.view.itemsize) - * if tmp == NULL: + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") */ - __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); - if (__pyx_t_1) { + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); - /* "View.MemoryView":448 + /* "View.MemoryView":173 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") * - * 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":449 - * 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 (__pyx_t_1) { + __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); + if (__pyx_t_4) { - /* "View.MemoryView":450 - * tmp = PyMem_Malloc(self.view.itemsize) - * if tmp == NULL: - * raise MemoryError # <<<<<<<<<<<<<< - * item = tmp - * else: + /* "View.MemoryView":174 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: */ - PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 174, __pyx_L1_error) - /* "View.MemoryView":449 - * if self.view.itemsize > sizeof(array): - * tmp = PyMem_Malloc(self.view.itemsize) - * if tmp == NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * item = tmp + /* "View.MemoryView":173 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * */ } - /* "View.MemoryView":451 - * if tmp == NULL: - * raise MemoryError - * item = tmp # <<<<<<<<<<<<<< - * else: - * item = array - */ - __pyx_v_item = __pyx_v_tmp; - - /* "View.MemoryView":447 - * dst_slice = get_slice_from_memview(dst, &tmp_slice) + /* "View.MemoryView":176 + * raise MemoryError("unable to allocate array data.") * - * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< - * tmp = PyMem_Malloc(self.view.itemsize) - * if tmp == NULL: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): */ - goto __pyx_L3; - } + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { - /* "View.MemoryView":453 - * item = tmp - * else: - * item = array # <<<<<<<<<<<<<< + /* "View.MemoryView":177 * - * try: + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None */ - /*else*/ { - __pyx_v_item = ((void *)__pyx_v_array); - } - __pyx_L3:; + __pyx_v_p = ((PyObject **)__pyx_v_self->data); - /* "View.MemoryView":455 - * item = array - * - * try: # <<<<<<<<<<<<<< + /* "View.MemoryView":178 * if self.dtype_is_object: - * ( item)[0] = value + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) */ - /*try:*/ { + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(2, 178, __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, 178, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; - /* "View.MemoryView":456 + /* "View.MemoryView":179 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) * - * try: - * if self.dtype_is_object: # <<<<<<<<<<<<<< - * ( item)[0] = value - * else: */ - __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); - if (__pyx_t_1) { + (__pyx_v_p[__pyx_v_i]) = Py_None; - /* "View.MemoryView":457 - * try: - * if self.dtype_is_object: - * ( item)[0] = value # <<<<<<<<<<<<<< - * else: - * self.assign_item_from_object( item, value) + /* "View.MemoryView":180 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') */ - (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); + Py_INCREF(Py_None); + } - /* "View.MemoryView":456 + /* "View.MemoryView":176 + * raise MemoryError("unable to allocate array data.") * - * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< - * ( item)[0] = value - * else: + * p = self.data + * for i in range(self.len / itemsize): */ - goto __pyx_L8; } - /* "View.MemoryView":459 - * ( item)[0] = value - * else: - * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + /* "View.MemoryView":169 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< * * */ - /*else*/ { - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 459, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_L8:; + } - /* "View.MemoryView":463 + /* "View.MemoryView":120 + * cdef bint dtype_is_object * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): * - * 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":464 - * - * if self.view.suboffsets != NULL: - * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< - * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, - * item, self.dtype_is_object) - */ - __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 464, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* 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":463 - * +/* "View.MemoryView":183 * - * 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, + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": */ - } - /* "View.MemoryView":465 - * if self.view.suboffsets != NULL: - * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) - * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< - * 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); +/* 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; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "View.MemoryView":468 - * item, self.dtype_is_object) - * finally: - * PyMem_Free(tmp) # <<<<<<<<<<<<<< - * - * cdef setitem_indexed(self, index, value): + /* "View.MemoryView":184 + * @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 */ - /*finally:*/ { - /*normal exit:*/{ - PyMem_Free(__pyx_v_tmp); - goto __pyx_L7; - } - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L6_error:; - __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); - __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); - } - __Pyx_PyThreadState_assign - 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:; - } + __pyx_v_bufmode = -1; - /* "View.MemoryView":438 - * 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 + /* "View.MemoryView":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 185, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* 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":470 - * PyMem_Free(tmp) - * - * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< - * cdef char *itemp = self.get_item_pointer(index) - * self.assign_item_from_object(itemp, value) + /* "View.MemoryView":186 + * 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); -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":471 - * - * cdef setitem_indexed(self, index, value): - * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< - * self.assign_item_from_object(itemp, value) - * + /* "View.MemoryView":185 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 471, __pyx_L1_error) - __pyx_v_itemp = __pyx_t_1; + goto __pyx_L3; + } - /* "View.MemoryView":472 - * cdef setitem_indexed(self, index, value): - * cdef char *itemp = self.get_item_pointer(index) - * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< - * - * cdef convert_item_to_object(self, char *itemp): + /* "View.MemoryView":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): */ - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 187, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { - /* "View.MemoryView":470 - * PyMem_Free(tmp) - * - * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< - * cdef char *itemp = self.get_item_pointer(index) - * self.assign_item_from_object(itemp, value) + /* "View.MemoryView":188 + * 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); - /* 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":187 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; -/* "View.MemoryView":474 - * 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""" + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (__pyx_t_1) { -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":190 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 190, __pyx_L1_error) - /* "View.MemoryView":477 - * """Only used if instantiated manually by the user, or if Cython doesn't - * know how to convert the type""" - * import struct # <<<<<<<<<<<<<< - * cdef bytes bytesitem - * + /* "View.MemoryView":189 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_struct = __pyx_t_1; - __pyx_t_1 = 0; + } - /* "View.MemoryView":480 - * cdef bytes bytesitem - * - * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< - * try: - * result = struct.unpack(self.view.format, bytesitem) + /* "View.MemoryView":191 + * 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_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; - /* "View.MemoryView":481 - * - * bytesitem = itemp[:self.view.itemsize] - * try: # <<<<<<<<<<<<<< - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: + /* "View.MemoryView":192 + * 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_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:*/ { + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; - /* "View.MemoryView":482 - * bytesitem = itemp[:self.view.itemsize] - * try: - * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< - * except struct.error: - * raise ValueError("Unable to convert item to object") + /* "View.MemoryView":193 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 482, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __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, 482, __pyx_L3_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else - #endif - { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_9); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); - __Pyx_INCREF(__pyx_v_bytesitem); - __Pyx_GIVEREF(__pyx_v_bytesitem); - PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_result = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; - /* "View.MemoryView":481 - * - * bytesitem = itemp[:self.view.itemsize] - * try: # <<<<<<<<<<<<<< - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: + /* "View.MemoryView":194 + * 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":486 - * raise ValueError("Unable to convert item to object") - * else: - * if len(self.view.format) == 1: # <<<<<<<<<<<<<< - * return result[0] - * return result + /* "View.MemoryView":195 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize */ - /*else:*/ { - __pyx_t_10 = strlen(__pyx_v_self->view.format); - __pyx_t_11 = ((__pyx_t_10 == 1) != 0); - if (__pyx_t_11) { + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; - /* "View.MemoryView":487 - * else: - * if len(self.view.format) == 1: - * return result[0] # <<<<<<<<<<<<<< - * return result + /* "View.MemoryView":196 + * 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":197 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 * */ - __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, 487, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L6_except_return; + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; - /* "View.MemoryView":486 - * raise ValueError("Unable to convert item to object") - * else: - * if len(self.view.format) == 1: # <<<<<<<<<<<<<< - * return result[0] - * return result + /* "View.MemoryView":198 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: */ - } + __pyx_v_info->readonly = 0; - /* "View.MemoryView":488 - * if len(self.view.format) == 1: - * return result[0] - * return result # <<<<<<<<<<<<<< + /* "View.MemoryView":200 + * info.readonly = 0 * - * cdef assign_item_from_object(self, char *itemp, object value): + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_result); - __pyx_r = __pyx_v_result; - goto __pyx_L6_except_return; - } - __pyx_L3_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":483 - * try: - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: # <<<<<<<<<<<<<< - * raise ValueError("Unable to convert item to object") + /* "View.MemoryView":201 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< * else: + * info.format = NULL */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; - /* "View.MemoryView":484 - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: - * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + /* "View.MemoryView":200 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format * else: - * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 484, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + goto __pyx_L5; + } - /* "View.MemoryView":481 + /* "View.MemoryView":203 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< * - * bytesitem = itemp[:self.view.itemsize] - * try: # <<<<<<<<<<<<<< - * result = struct.unpack(self.view.format, bytesitem) - * except struct.error: + * info.obj = self */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); - goto __pyx_L1_error; - __pyx_L6_except_return:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); - goto __pyx_L0; + /*else*/ { + __pyx_v_info->format = NULL; } + __pyx_L5:; - /* "View.MemoryView":474 - * self.assign_item_from_object(itemp, value) + /* "View.MemoryView":205 + * info.format = NULL * - * 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""" + * 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":183 + * + * @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_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_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_struct); - __Pyx_XDECREF(__pyx_v_bytesitem); - __Pyx_XDECREF(__pyx_v_result); - __Pyx_XGIVEREF(__pyx_r); + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":490 - * return result +/* "View.MemoryView":209 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") * - * 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""" + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) */ -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; +/* Python wrapper */ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { __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); + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); - /* "View.MemoryView":493 - * """Only used if instantiated manually by the user, or if Cython doesn't - * know how to convert the type""" - * import struct # <<<<<<<<<<<<<< - * cdef char c - * cdef bytes bytesvalue - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_struct = __pyx_t_1; - __pyx_t_1 = 0; + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "View.MemoryView":498 - * cdef Py_ssize_t i +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":210 * - * if isinstance(value, tuple): # <<<<<<<<<<<<<< - * bytesvalue = struct.pack(self.view.format, *value) - * else: + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: */ - __pyx_t_2 = PyTuple_Check(__pyx_v_value); - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":499 - * - * if isinstance(value, tuple): - * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< - * else: - * bytesvalue = struct.pack(self.view.format, value) + /* "View.MemoryView":211 + * 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __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 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 499, __pyx_L1_error) - __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_self->callback_free_data(__pyx_v_self->data); - /* "View.MemoryView":498 - * cdef Py_ssize_t i + /* "View.MemoryView":210 * - * if isinstance(value, tuple): # <<<<<<<<<<<<<< - * bytesvalue = struct.pack(self.view.format, *value) - * else: + * 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":501 - * bytesvalue = struct.pack(self.view.format, *value) - * else: - * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< - * - * for i, c in enumerate(bytesvalue): + /* "View.MemoryView":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, */ - /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __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, 501, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { - PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else - #endif - { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); - __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __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, 501, __pyx_L1_error) - __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L3:; + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { - /* "View.MemoryView":503 - * bytesvalue = struct.pack(self.view.format, value) - * - * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< - * itemp[i] = c - * + /* "View.MemoryView":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) */ - __pyx_t_9 = 0; - if (unlikely(__pyx_v_bytesvalue == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(2, 503, __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]); + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { - /* "View.MemoryView":504 - * - * for i, c in enumerate(bytesvalue): - * itemp[i] = c # <<<<<<<<<<<<<< - * - * @cname('getbuffer') + /* "View.MemoryView":214 + * 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_v_i = __pyx_t_9; + __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":503 - * 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":213 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } - /* "View.MemoryView":504 - * - * for i, c in enumerate(bytesvalue): - * itemp[i] = c # <<<<<<<<<<<<<< + /* "View.MemoryView":216 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyObject_Free(self._shape) * - * @cname('getbuffer') */ - (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + free(__pyx_v_self->data); + + /* "View.MemoryView":212 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_L3:; - /* "View.MemoryView":490 - * return result + /* "View.MemoryView":217 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< * - * 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""" + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":209 + * __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_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":507 +/* "View.MemoryView":220 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() * - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< - * if flags & PyBUF_STRIDES: - * info.shape = self.view.shape */ /* Python wrapper */ -static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; +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("__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)); + __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 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; +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - Py_ssize_t *__pyx_t_2; - char *__pyx_t_3; - void *__pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":508 - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): - * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< - * info.shape = self.view.shape - * else: + /* "View.MemoryView":221 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); - if (__pyx_t_1) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":509 - * def __getbuffer__(self, Py_buffer *info, int flags): - * if flags & PyBUF_STRIDES: - * info.shape = self.view.shape # <<<<<<<<<<<<<< - * else: - * info.shape = NULL + /* "View.MemoryView":220 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * */ - __pyx_t_2 = __pyx_v_self->view.shape; - __pyx_v_info->shape = __pyx_t_2; - /* "View.MemoryView":508 - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): - * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< - * info.shape = self.view.shape - * else: - */ - goto __pyx_L3; - } + /* 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":511 - * info.shape = self.view.shape - * else: - * info.shape = NULL # <<<<<<<<<<<<<< +/* "View.MemoryView":224 * - * if flags & PyBUF_STRIDES: + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) */ - /*else*/ { - __pyx_v_info->shape = NULL; - } - __pyx_L3:; - /* "View.MemoryView":513 - * 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) { +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":514 + /* "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) * - * if flags & PyBUF_STRIDES: - * info.strides = self.view.strides # <<<<<<<<<<<<<< - * else: - * info.strides = NULL */ - __pyx_t_2 = __pyx_v_self->view.strides; - __pyx_v_info->strides = __pyx_t_2; + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); - /* "View.MemoryView":513 - * info.shape = NULL + /* "View.MemoryView":226 + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< * - * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< - * info.strides = self.view.strides - * else: - */ - goto __pyx_L4; - } - - /* "View.MemoryView":516 - * info.strides = self.view.strides - * else: - * info.strides = NULL # <<<<<<<<<<<<<< * - * if flags & PyBUF_INDIRECT: */ - /*else*/ { - __pyx_v_info->strides = NULL; - } - __pyx_L4:; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __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, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "View.MemoryView":518 - * info.strides = NULL + /* "View.MemoryView":224 * - * 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":519 - * - * if flags & PyBUF_INDIRECT: - * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< - * else: - * info.suboffsets = NULL - */ - __pyx_t_2 = __pyx_v_self->view.suboffsets; - __pyx_v_info->suboffsets = __pyx_t_2; - - /* "View.MemoryView":518 - * info.strides = NULL - * - * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< - * info.suboffsets = self.view.suboffsets - * else: - */ - goto __pyx_L5; - } - - /* "View.MemoryView":521 - * info.suboffsets = self.view.suboffsets - * else: - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * - * if flags & PyBUF_FORMAT: - */ - /*else*/ { - __pyx_v_info->suboffsets = NULL; - } - __pyx_L5:; - - /* "View.MemoryView":523 - * 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":524 - * - * if flags & PyBUF_FORMAT: - * info.format = self.view.format # <<<<<<<<<<<<<< - * else: - * info.format = NULL - */ - __pyx_t_3 = __pyx_v_self->view.format; - __pyx_v_info->format = __pyx_t_3; - - /* "View.MemoryView":523 - * info.suboffsets = NULL - * - * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< - * info.format = self.view.format - * else: - */ - goto __pyx_L6; - } - - /* "View.MemoryView":526 - * info.format = self.view.format - * else: - * info.format = NULL # <<<<<<<<<<<<<< - * - * info.buf = self.view.buf - */ - /*else*/ { - __pyx_v_info->format = NULL; - } - __pyx_L6:; - - /* "View.MemoryView":528 - * info.format = NULL - * - * info.buf = self.view.buf # <<<<<<<<<<<<<< - * info.ndim = self.view.ndim - * info.itemsize = self.view.itemsize - */ - __pyx_t_4 = __pyx_v_self->view.buf; - __pyx_v_info->buf = __pyx_t_4; - - /* "View.MemoryView":529 - * - * info.buf = self.view.buf - * info.ndim = self.view.ndim # <<<<<<<<<<<<<< - * info.itemsize = self.view.itemsize - * info.len = self.view.len - */ - __pyx_t_5 = __pyx_v_self->view.ndim; - __pyx_v_info->ndim = __pyx_t_5; - - /* "View.MemoryView":530 - * info.buf = self.view.buf - * info.ndim = self.view.ndim - * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< - * info.len = self.view.len - * info.readonly = 0 - */ - __pyx_t_6 = __pyx_v_self->view.itemsize; - __pyx_v_info->itemsize = __pyx_t_6; - - /* "View.MemoryView":531 - * info.ndim = self.view.ndim - * info.itemsize = self.view.itemsize - * info.len = self.view.len # <<<<<<<<<<<<<< - * info.readonly = 0 - * info.obj = self - */ - __pyx_t_6 = __pyx_v_self->view.len; - __pyx_v_info->len = __pyx_t_6; - - /* "View.MemoryView":532 - * info.itemsize = self.view.itemsize - * info.len = self.view.len - * info.readonly = 0 # <<<<<<<<<<<<<< - * info.obj = self - * - */ - __pyx_v_info->readonly = 0; - - /* "View.MemoryView":533 - * info.len = self.view.len - * info.readonly = 0 - * 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":507 - * - * @cname('getbuffer') - * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< - * if flags & PyBUF_STRIDES: - * info.shape = self.view.shape + * @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; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":539 +/* "View.MemoryView":229 + * + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) * - * @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) { +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("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "View.MemoryView":540 - * @property - * def T(self): - * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< - * transpose_memslice(&result.from_slice) - * return result - */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __pyx_L1_error) - __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); - __pyx_t_1 = 0; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); - /* "View.MemoryView":541 - * def T(self): - * cdef _memoryviewslice result = memoryview_copy(self) - * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< - * return result + /* "View.MemoryView":230 * - */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error) - - /* "View.MemoryView":542 - * cdef _memoryviewslice result = memoryview_copy(self) - * transpose_memslice(&result.from_slice) - * return result # <<<<<<<<<<<<<< + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< * - * @property + * def __getitem__(self, item): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":539 + /* "View.MemoryView":229 + * + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) * - * @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_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __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":545 +/* "View.MemoryView":232 + * return getattr(self.memview, attr) * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.obj + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] * */ /* 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) { +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("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getitem__", 0); - /* "View.MemoryView":546 - * @property - * def base(self): - * return self.obj # <<<<<<<<<<<<<< + /* "View.MemoryView":233 * - * @property + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->obj); - __pyx_r = __pyx_v_self->obj; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __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":545 + /* "View.MemoryView":232 + * return getattr(self.memview, attr) * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.obj + * 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":549 +/* "View.MemoryView":235 + * return self.memview[item] * - * @property - * def shape(self): # <<<<<<<<<<<<<< - * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value * */ /* 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; +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("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static 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; +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - 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); + __Pyx_RefNannySetupContext("__setitem__", 0); - /* "View.MemoryView":550 - * @property - * def shape(self): - * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< + /* "View.MemoryView":236 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * * - * @property */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); - for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { - __pyx_t_2 = __pyx_t_4; - __pyx_v_length = (__pyx_t_2[0]); - __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - /* "View.MemoryView":549 + /* "View.MemoryView":235 + * return self.memview[item] * - * @property - * def shape(self): # <<<<<<<<<<<<<< - * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * 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_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":553 - * - * @property - * def strides(self): # <<<<<<<<<<<<<< - * if self.view.strides == NULL: - * +/* "(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_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) { +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("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __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_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - Py_ssize_t __pyx_v_stride; +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) { 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":554 - * @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 (__pyx_t_1) { - - /* "View.MemoryView":556 - * 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__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 556, __pyx_L1_error) - - /* "View.MemoryView":554 - * @property - * def strides(self): - * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * - * raise ValueError("Buffer view does not expose strides") - */ - } + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "View.MemoryView":558 - * raise ValueError("Buffer view does not expose strides") - * - * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< - * - * @property + /* "(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_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); - for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { - __pyx_t_3 = __pyx_t_5; - __pyx_v_stride = (__pyx_t_3[0]); - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, 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) - /* "View.MemoryView":553 - * - * @property - * def strides(self): # <<<<<<<<<<<<<< - * if self.view.strides == NULL: - * + /* "(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_2); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":561 - * - * @property - * def suboffsets(self): # <<<<<<<<<<<<<< - * if self.view.suboffsets == NULL: - * return (-1,) * self.view.ndim +/* "(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_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) { +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("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __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_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - Py_ssize_t __pyx_v_suboffset; +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__23, 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":240 + * + * @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; - Py_ssize_t *__pyx_t_4; - Py_ssize_t *__pyx_t_5; - Py_ssize_t *__pyx_t_6; - __Pyx_RefNannySetupContext("__get__", 0); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("array_cwrapper", 0); - /* "View.MemoryView":562 - * @property - * def suboffsets(self): - * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< - * return (-1,) * self.view.ndim + /* "View.MemoryView":244 + * cdef array result * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: */ - __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":563 - * def suboffsets(self): - * if self.view.suboffsets == NULL: - * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + /* "View.MemoryView":245 * - * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__25, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __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, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __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; - goto __pyx_L0; + __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, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; - /* "View.MemoryView":562 - * @property - * def suboffsets(self): - * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< - * return (-1,) * self.view.ndim + /* "View.MemoryView":244 + * cdef array result * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: */ + goto __pyx_L3; } - /* "View.MemoryView":565 - * return (-1,) * self.view.ndim - * - * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< - * - * @property + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); - for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { - __pyx_t_4 = __pyx_t_6; - __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_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":248 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error) + + /* "View.MemoryView":247 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":249 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_L3:; + + /* "View.MemoryView":251 + * 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":561 + /* "View.MemoryView":240 * - * @property - * def suboffsets(self): # <<<<<<<<<<<<<< - * if self.view.suboffsets == NULL: - * return (-1,) * self.view.ndim + * @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_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __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_XGIVEREF(__pyx_r); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":568 - * - * @property - * def ndim(self): # <<<<<<<<<<<<<< - * return self.view.ndim - * +/* "View.MemoryView":277 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): */ /* 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; +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("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 277, __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, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___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 PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - PyObject *__pyx_r = NULL; +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 - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_RefNannySetupContext("__init__", 0); - /* "View.MemoryView":569 - * @property - * def ndim(self): - * return self.view.ndim # <<<<<<<<<<<<<< - * - * @property + /* "View.MemoryView":278 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __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":568 - * - * @property - * def ndim(self): # <<<<<<<<<<<<<< - * return self.view.ndim - * + /* "View.MemoryView":277 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): */ /* 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_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":572 - * - * @property - * def itemsize(self): # <<<<<<<<<<<<<< - * return self.view.itemsize +/* "View.MemoryView":279 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name * */ /* 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) { +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("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __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_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_RefNannySetupContext("__repr__", 0); - /* "View.MemoryView":573 - * @property - * def itemsize(self): - * return self.view.itemsize # <<<<<<<<<<<<<< + /* "View.MemoryView":280 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< * - * @property + * cdef generic = Enum("") */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; goto __pyx_L0; - /* "View.MemoryView":572 - * - * @property - * def itemsize(self): # <<<<<<<<<<<<<< - * return self.view.itemsize + /* "View.MemoryView":279 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name * */ /* 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":576 - * - * @property - * def nbytes(self): # <<<<<<<<<<<<<< - * return self.size * self.view.itemsize - * +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.name,) */ /* 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) { +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("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __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_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { +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; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "View.MemoryView":577 - * @property - * def nbytes(self): - * return self.size * self.view.itemsize # <<<<<<<<<<<<<< - * - * @property + /* "(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_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, 577, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __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, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __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; - /* "View.MemoryView":576 - * - * @property - * def nbytes(self): # <<<<<<<<<<<<<< - * return self.size * self.view.itemsize - * + /* "(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_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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; } -/* "View.MemoryView":580 - * - * @property - * def size(self): # <<<<<<<<<<<<<< - * if self._size is None: - * result = 1 +/* "(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_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) { +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("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __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_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - PyObject *__pyx_v_result = NULL; - PyObject *__pyx_v_length = NULL; +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 - 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); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "View.MemoryView":581 - * @property - * def size(self): - * if self._size is None: # <<<<<<<<<<<<<< - * result = 1 + /* "(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":294 * + * @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 */ - __pyx_t_1 = (__pyx_v_self->_size == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - /* "View.MemoryView":582 - * def size(self): - * if self._size is None: - * result = 1 # <<<<<<<<<<<<<< +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":296 + * 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 * - * for length in self.view.shape[:self.view.ndim]: */ - __Pyx_INCREF(__pyx_int_1); - __pyx_v_result = __pyx_int_1; + __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); - /* "View.MemoryView":584 - * result = 1 + /* "View.MemoryView":300 * - * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< - * result *= length + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< * + * if offset > 0: */ - __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); - for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { - __pyx_t_3 = __pyx_t_5; - __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); - __pyx_t_6 = 0; + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); - /* "View.MemoryView":585 + /* "View.MemoryView":302 + * offset = aligned_p % alignment * - * for length in self.view.shape[:self.view.ndim]: - * result *= length # <<<<<<<<<<<<<< + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset * - * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); - __pyx_t_6 = 0; - } + __pyx_t_1 = ((__pyx_v_offset > 0) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":587 - * result *= length + /* "View.MemoryView":303 * - * self._size = result # <<<<<<<<<<<<<< + * if offset > 0: + * aligned_p += alignment - offset # <<<<<<<<<<<<<< * - * return self._size + * return aligned_p */ - __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; + __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); - /* "View.MemoryView":581 - * @property - * def size(self): - * if self._size is None: # <<<<<<<<<<<<<< - * result = 1 + /* "View.MemoryView":302 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset * */ } - /* "View.MemoryView":589 - * self._size = result + /* "View.MemoryView":305 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< * - * return self._size # <<<<<<<<<<<<<< * - * def __len__(self): */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->_size); - __pyx_r = __pyx_v_self->_size; + __pyx_r = ((void *)__pyx_v_aligned_p); goto __pyx_L0; - /* "View.MemoryView":580 + /* "View.MemoryView":294 * - * @property - * def size(self): # <<<<<<<<<<<<<< - * if self._size is None: - * result = 1 + * @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_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":591 - * return self._size +/* "View.MemoryView":341 + * cdef __Pyx_TypeInfo *typeinfo * - * def __len__(self): # <<<<<<<<<<<<<< - * if self.view.ndim >= 1: - * return self.view.shape[0] + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags */ /* 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; +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("__len__ (wrapper)", 0); - __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __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, 341, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___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 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; +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; - __Pyx_RefNannySetupContext("__len__", 0); + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__cinit__", 0); - /* "View.MemoryView":592 - * - * def __len__(self): - * if self.view.ndim >= 1: # <<<<<<<<<<<<<< - * return self.view.shape[0] + /* "View.MemoryView":342 * + * 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_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); - if (__pyx_t_1) { + __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":593 - * def __len__(self): - * if self.view.ndim >= 1: - * return self.view.shape[0] # <<<<<<<<<<<<<< - * - * return 0 + /* "View.MemoryView":343 + * 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_r = (__pyx_v_self->view.shape[0]); - goto __pyx_L0; + __pyx_v_self->flags = __pyx_v_flags; - /* "View.MemoryView":592 - * - * def __len__(self): - * if self.view.ndim >= 1: # <<<<<<<<<<<<<< - * return self.view.shape[0] - * + /* "View.MemoryView":344 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if 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":595 - * return self.view.shape[0] - * - * return 0 # <<<<<<<<<<<<<< - * - * def __repr__(self): + /* "View.MemoryView":345 + * 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_r = 0; - goto __pyx_L0; + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 345, __pyx_L1_error) - /* "View.MemoryView":591 - * return self._size + /* "View.MemoryView":346 + * 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":347 + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) * - * def __len__(self): # <<<<<<<<<<<<<< - * if self.view.ndim >= 1: - * return self.view.shape[0] */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "View.MemoryView":597 - * return 0 + /* "View.MemoryView":348 + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "" % (self.base.__class__.__name__, - * id(self)) + * global __pyx_memoryview_thread_locks_used */ + Py_INCREF(Py_None); -/* 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":598 - * - * def __repr__(self): - * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< - * id(self)) - * + /* "View.MemoryView":346 + * 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_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, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } - /* "View.MemoryView":599 - * def __repr__(self): - * return "" % (self.base.__class__.__name__, - * id(self)) # <<<<<<<<<<<<<< - * - * def __str__(self): + /* "View.MemoryView":344 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } - /* "View.MemoryView":598 - * - * def __repr__(self): - * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< - * id(self)) + /* "View.MemoryView":351 * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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_3); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":597 - * return 0 - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "" % (self.base.__class__.__name__, - * id(self)) + /* "View.MemoryView":352 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); - /* 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":353 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); -/* "View.MemoryView":601 - * id(self)) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "" % (self.base.__class__.__name__,) + /* "View.MemoryView":351 * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 */ + } -/* 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; -} + /* "View.MemoryView":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { -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":355 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); - /* "View.MemoryView":602 - * - * def __str__(self): - * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< - * + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError * */ - __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, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":601 - * id(self)) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "" % (self.base.__class__.__name__,) + /* "View.MemoryView":357 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< * + * if flags & PyBUF_FORMAT: */ + PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error) - /* 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":605 - * + /* "View.MemoryView":356 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError * - * 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":354 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } - /* "View.MemoryView":608 - * 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) + /* "View.MemoryView":359 + * raise MemoryError * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: */ - __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":609 - * cdef __Pyx_memviewslice tmp - * mslice = get_slice_from_memview(self, &tmp) - * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< + /* "View.MemoryView":360 * - * def is_f_contig(self): + * 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_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, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __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":605 - * + /* "View.MemoryView":359 + * raise MemoryError * - * def is_c_contig(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice *mslice - * cdef __Pyx_memviewslice tmp + * 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; + } - /* 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":611 - * return slice_is_contig(mslice[0], 'C', self.view.ndim) + /* "View.MemoryView":362 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< * - * def is_f_contig(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice *mslice - * cdef __Pyx_memviewslice tmp + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; -/* 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":614 - * 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) + /* "View.MemoryView":364 + * 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_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + __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":615 - * cdef __Pyx_memviewslice tmp - * mslice = get_slice_from_memview(self, &tmp) - * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< + /* "View.MemoryView":366 + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL # <<<<<<<<<<<<<< * - * def copy(self): + * def __dealloc__(memoryview 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, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_v_self->typeinfo = NULL; - /* "View.MemoryView":611 - * return slice_is_contig(mslice[0], 'C', self.view.ndim) + /* "View.MemoryView":341 + * cdef __Pyx_TypeInfo *typeinfo * - * def is_f_contig(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice *mslice - * cdef __Pyx_memviewslice tmp + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":617 - * return slice_is_contig(mslice[0], 'F', self.view.ndim) +/* "View.MemoryView":368 + * self.typeinfo = NULL * - * def copy(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice mslice - * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) */ /* 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; +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { __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)); + __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(); - 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; +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 - __Pyx_memviewslice __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("copy", 0); + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyThread_type_lock __pyx_t_5; + PyThread_type_lock __pyx_t_6; + __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":619 - * def copy(self): - * cdef __Pyx_memviewslice mslice - * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< + /* "View.MemoryView":369 * - * slice_copy(self, &mslice) - */ - __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); - - /* "View.MemoryView":621 - * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) * - * 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)); + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "View.MemoryView":622 + /* "View.MemoryView":370 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< * - * slice_copy(self, &mslice) - * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< - * self.view.itemsize, - * flags|PyBUF_C_CONTIGUOUS, + * cdef int i */ - __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 622, __pyx_L1_error) - __pyx_v_mslice = __pyx_t_1; + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); - /* "View.MemoryView":627 - * self.dtype_is_object) + /* "View.MemoryView":369 * - * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) * - * 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, 627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + } - /* "View.MemoryView":617 - * 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 + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { - /* 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":375 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; -/* "View.MemoryView":629 - * return memoryview_copy_from_slice(self, &mslice) - * - * def copy_fortran(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice src, dst - * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { -/* 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)); + /* "View.MemoryView":377 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { -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":380 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); - /* "View.MemoryView":631 - * def copy_fortran(self): - * cdef __Pyx_memviewslice src, dst - * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< - * - * slice_copy(self, &src) + /* "View.MemoryView":379 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break */ - __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; - /* "View.MemoryView":633 - * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS - * - * slice_copy(self, &src) # <<<<<<<<<<<<<< - * dst = slice_copy_contig(&src, "fortran", self.view.ndim, - * self.view.itemsize, + /* "View.MemoryView":378 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) */ - __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + } - /* "View.MemoryView":634 - * - * slice_copy(self, &src) - * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< - * self.view.itemsize, - * flags|PyBUF_F_CONTIGUOUS, + /* "View.MemoryView":381 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) */ - __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 634, __pyx_L1_error) - __pyx_v_dst = __pyx_t_1; + goto __pyx_L6_break; - /* "View.MemoryView":639 - * self.dtype_is_object) - * - * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< - * + /* "View.MemoryView":376 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":383 + * break + * else: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: */ - __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, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + PyThread_free_lock(__pyx_v_self->lock); + } + __pyx_L6_break:; - /* "View.MemoryView":629 - * return memoryview_copy_from_slice(self, &mslice) + /* "View.MemoryView":374 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":368 + * self.typeinfo = NULL * - * def copy_fortran(self): # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice src, dst - * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "View.MemoryView":643 +/* "View.MemoryView":385 + * PyThread_free_lock(self.lock) * - * @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 + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf */ -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; +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 - PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + 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":644 - * @cname('__pyx_memoryview_new') - * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): - * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< - * result.typeinfo = typeinfo - * return result + /* "View.MemoryView":387 + * 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_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_o); - __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, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); - /* "View.MemoryView":645 - * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): - * cdef memoryview result = memoryview(o, flags, dtype_is_object) - * result.typeinfo = typeinfo # <<<<<<<<<<<<<< - * return result + /* "View.MemoryView":389 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) * */ - __pyx_v_result->typeinfo = __pyx_v_typeinfo; + __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, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 389, __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":646 - * cdef memoryview result = memoryview(o, flags, dtype_is_object) - * result.typeinfo = typeinfo - * return result # <<<<<<<<<<<<<< + /* "View.MemoryView":390 * - * @cname('__pyx_memoryview_check') + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 390, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":389 + * 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":392 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; goto __pyx_L0; - /* "View.MemoryView":643 + /* "View.MemoryView":385 + * PyThread_free_lock(self.lock) * - * @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 + * 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_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_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((PyObject *)__pyx_v_result); - __Pyx_XGIVEREF(__pyx_r); + __Pyx_XDECREF(__pyx_v_idx); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":649 +/* "View.MemoryView":395 * - * @cname('__pyx_memoryview_check') - * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< - * return isinstance(o, memoryview) * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self */ -static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { - int __pyx_r; +/* 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 - int __pyx_t_1; - __Pyx_RefNannySetupContext("memoryview_check", 0); - - /* "View.MemoryView":650 - * @cname('__pyx_memoryview_check') - * cdef inline bint memoryview_check(object o): - * return isinstance(o, memoryview) # <<<<<<<<<<<<<< - * - * cdef tuple _unellipsify(object index, int ndim): - */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); - __pyx_r = __pyx_t_1; - goto __pyx_L0; - - /* "View.MemoryView":649 - * - * @cname('__pyx_memoryview_check') - * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< - * return isinstance(o, memoryview) - * - */ + __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_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":652 - * 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; +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; - 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); + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + __Pyx_RefNannySetupContext("__getitem__", 0); - /* "View.MemoryView":657 - * full slices. - * """ - * if not isinstance(index, tuple): # <<<<<<<<<<<<<< - * tup = (index,) - * else: + /* "View.MemoryView":396 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * */ - __pyx_t_1 = PyTuple_Check(__pyx_v_index); - __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":658 - * """ - * if not isinstance(index, tuple): - * tup = (index,) # <<<<<<<<<<<<<< - * else: - * tup = index - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __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":657 - * full slices. - * """ - * if not isinstance(index, tuple): # <<<<<<<<<<<<<< - * tup = (index,) - * else: + /* "View.MemoryView":397 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) */ - goto __pyx_L3; - } + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; - /* "View.MemoryView":660 - * tup = (index,) - * else: - * tup = index # <<<<<<<<<<<<<< + /* "View.MemoryView":396 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self * - * result = [] */ - /*else*/ { - __Pyx_INCREF(__pyx_v_index); - __pyx_v_tup = __pyx_v_index; } - __pyx_L3:; - /* "View.MemoryView":662 - * tup = index + /* "View.MemoryView":399 + * return self * - * result = [] # <<<<<<<<<<<<<< - * have_slices = False - * seen_ellipsis = False + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_v_result = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "View.MemoryView":663 - * - * result = [] - * have_slices = False # <<<<<<<<<<<<<< - * seen_ellipsis = False - * for idx, item in enumerate(tup): - */ - __pyx_v_have_slices = 0; - - /* "View.MemoryView":664 - * result = [] - * have_slices = False - * seen_ellipsis = False # <<<<<<<<<<<<<< - * for idx, item in enumerate(tup): - * if item is Ellipsis: - */ - __pyx_v_seen_ellipsis = 0; - - /* "View.MemoryView":665 - * 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, 665, __pyx_L1_error) + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 399, __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, 399, __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, 665, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __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, 665, __pyx_L1_error) - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - } else { - if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 665, __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, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); - __pyx_t_3 = __pyx_t_7; - __pyx_t_7 = 0; - - /* "View.MemoryView":666 - * seen_ellipsis = False - * for idx, item in enumerate(tup): - * if item is Ellipsis: # <<<<<<<<<<<<<< - * if not seen_ellipsis: - * result.extend([slice(None)] * (ndim - len(tup) + 1)) - */ - __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":667 - * for idx, item in enumerate(tup): - * if item is Ellipsis: - * if not seen_ellipsis: # <<<<<<<<<<<<<< - * result.extend([slice(None)] * (ndim - len(tup) + 1)) - * seen_ellipsis = True - */ - __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":668 - * if item is Ellipsis: - * if not seen_ellipsis: - * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< - * seen_ellipsis = True - * else: - */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - { Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__26); - __Pyx_GIVEREF(__pyx_slice__26); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__26); - } - } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "View.MemoryView":669 - * 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":667 - * for idx, item in enumerate(tup): - * if item is Ellipsis: - * if not seen_ellipsis: # <<<<<<<<<<<<<< - * result.extend([slice(None)] * (ndim - len(tup) + 1)) - * seen_ellipsis = True - */ - goto __pyx_L7; - } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; - /* "View.MemoryView":671 - * seen_ellipsis = True - * else: - * result.append(slice(None)) # <<<<<<<<<<<<<< - * have_slices = True + /* "View.MemoryView":402 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) * else: */ - /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__27); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) - } - __pyx_L7:; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 402, __pyx_L1_error) + if (__pyx_t_2) { - /* "View.MemoryView":672 - * else: - * result.append(slice(None)) - * have_slices = True # <<<<<<<<<<<<<< + /* "View.MemoryView":403 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< * else: - * if not isinstance(item, slice) and not PyIndex_Check(item): - */ - __pyx_v_have_slices = 1; - - /* "View.MemoryView":666 - * seen_ellipsis = False - * for idx, item in enumerate(tup): - * if item is Ellipsis: # <<<<<<<<<<<<<< - * if not seen_ellipsis: - * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * itemp = self.get_item_pointer(indices) */ - goto __pyx_L6; - } + __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, 403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "View.MemoryView":674 - * have_slices = True - * else: - * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< - * raise TypeError("Cannot index with type '%s'" % type(item)) + /* "View.MemoryView":402 * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: */ - /*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 (__pyx_t_1) { + } - /* "View.MemoryView":675 + /* "View.MemoryView":405 + * return memview_slice(self, indices) * else: - * if not isinstance(item, slice) and not PyIndex_Check(item): - * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< + * return self.convert_item_to_object(itemp) * - * 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, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(2, 675, __pyx_L1_error) + /*else*/ { + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 405, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; - /* "View.MemoryView":674 - * have_slices = True + /* "View.MemoryView":406 * else: - * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< - * raise TypeError("Cannot index with type '%s'" % type(item)) + * itemp = self.get_item_pointer(indices) + * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< * + * def __setitem__(memoryview self, object index, object value): */ - } - - /* "View.MemoryView":677 - * 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":678 - * - * have_slices = have_slices or isinstance(item, slice) - * result.append(item) # <<<<<<<<<<<<<< - * - * nslices = ndim - len(result) - */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error) - } - __pyx_L6:; - - /* "View.MemoryView":665 - * 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":680 - * result.append(item) - * - * nslices = ndim - len(result) # <<<<<<<<<<<<<< - * if nslices: - * result.extend([slice(None)] * nslices) - */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error) - __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); - - /* "View.MemoryView":681 - * - * nslices = ndim - len(result) - * if nslices: # <<<<<<<<<<<<<< - * result.extend([slice(None)] * nslices) - * - */ - __pyx_t_1 = (__pyx_v_nslices != 0); - if (__pyx_t_1) { - - /* "View.MemoryView":682 - * nslices = ndim - len(result) - * if nslices: - * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< - * - * return have_slices or nslices, tuple(result) - */ - __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 682, __pyx_L1_error) + __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, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - { Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__28); - __Pyx_GIVEREF(__pyx_slice__28); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__28); - } - } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "View.MemoryView":681 - * - * nslices = ndim - len(result) - * if nslices: # <<<<<<<<<<<<<< - * result.extend([slice(None)] * nslices) - * - */ + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; } - /* "View.MemoryView":684 - * result.extend([slice(None)] * nslices) - * - * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + /* "View.MemoryView":395 * - * 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, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L14_bool_binop_done; - } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; - __pyx_t_4 = 0; - __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_r = ((PyObject*)__pyx_t_7); - __pyx_t_7 = 0; - goto __pyx_L0; - - /* "View.MemoryView":652 - * return isinstance(o, memoryview) * - * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< - * """ - * Replace all ellipses with full slices and fill incomplete indices with + * 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_7); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __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_tup); - __Pyx_XDECREF(__pyx_v_result); - __Pyx_XDECREF(__pyx_v_idx); - __Pyx_XDECREF(__pyx_v_item); + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":686 - * return have_slices or nslices, tuple(result) +/* "View.MemoryView":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) * - * 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; +/* 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 - Py_ssize_t *__pyx_t_1; - Py_ssize_t *__pyx_t_2; - Py_ssize_t *__pyx_t_3; + __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 + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); - /* "View.MemoryView":687 + /* "View.MemoryView":409 * - * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): - * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< - * if suboffset >= 0: - * raise ValueError("Indirect dimensions not supported") + * def __setitem__(memoryview self, object index, object value): + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: */ - __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]); + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 409, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; - /* "View.MemoryView":688 - * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): - * for suboffset in suboffsets[:ndim]: - * if suboffset >= 0: # <<<<<<<<<<<<<< - * raise ValueError("Indirect dimensions not supported") + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: */ - __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); - if (__pyx_t_4) { + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error) + if (__pyx_t_4) { - /* "View.MemoryView":689 - * for suboffset in suboffsets[:ndim]: - * if suboffset >= 0: - * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< - * + /* "View.MemoryView":412 * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_obj = __pyx_t_1; + __pyx_t_1 = 0; - /* "View.MemoryView":688 - * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): - * for suboffset in suboffsets[:ndim]: - * if suboffset >= 0: # <<<<<<<<<<<<<< - * raise ValueError("Indirect dimensions not supported") - * + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":414 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":413 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":416 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) */ + /*else*/ { + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } + __pyx_L4:; + + /* "View.MemoryView":411 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L3; } - /* "View.MemoryView":686 - * return have_slices or nslices, tuple(result) + /* "View.MemoryView":418 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":408 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) * - * 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); + __pyx_r = 0; 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_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":696 +/* "View.MemoryView":420 + * self.setitem_indexed(index, value) * - * @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 is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: */ -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; +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; - 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":697 - * @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; + 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":704 - * - * - * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + /* "View.MemoryView":421 * - * cdef _memoryviewslice memviewsliceobj + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, */ - memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + __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":708 - * cdef _memoryviewslice memviewsliceobj - * - * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< - * - * if isinstance(memview, _memoryviewslice): + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!Py_OptimizeFlag)) { - if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { - PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(2, 708, __pyx_L1_error) - } - } - #endif + { + __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":710 - * assert memview.view.ndim > 0 - * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * memviewsliceobj = memview - * p_src = &memviewsliceobj.from_slice + /* "View.MemoryView":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: */ - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); - /* "View.MemoryView":711 - * - * if isinstance(memview, _memoryviewslice): - * memviewsliceobj = memview # <<<<<<<<<<<<<< - * p_src = &memviewsliceobj.from_slice - * else: + /* "View.MemoryView":424 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 711, __pyx_L1_error) - __pyx_t_3 = ((PyObject *)__pyx_v_memview); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); - /* "View.MemoryView":712 - * if isinstance(memview, _memoryviewslice): - * memviewsliceobj = memview - * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< - * else: - * slice_copy(memview, &src) + /* "View.MemoryView":423 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: */ - __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_obj); + __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, 423, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; - /* "View.MemoryView":710 - * assert memview.view.ndim > 0 - * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * memviewsliceobj = memview - * p_src = &memviewsliceobj.from_slice + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) */ - goto __pyx_L3; - } + } + __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_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":714 - * p_src = &memviewsliceobj.from_slice - * else: - * slice_copy(memview, &src) # <<<<<<<<<<<<<< - * p_src = &src + /* "View.MemoryView":425 + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None * */ - /*else*/ { - __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + __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, 425, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); - /* "View.MemoryView":715 - * else: - * slice_copy(memview, &src) - * p_src = &src # <<<<<<<<<<<<<< + /* "View.MemoryView":426 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":422 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":421 * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, */ - __pyx_v_p_src = (&__pyx_v_src); } - __pyx_L3:; - /* "View.MemoryView":721 + /* "View.MemoryView":428 + * return None * + * return obj # <<<<<<<<<<<<<< * - * dst.memview = p_src.memview # <<<<<<<<<<<<<< - * dst.data = p_src.data + * 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":420 + * self.setitem_indexed(index, value) * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: */ - __pyx_t_4 = __pyx_v_p_src->memview; - __pyx_v_dst.memview = __pyx_t_4; - /* "View.MemoryView":722 + /* 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":430 + * return obj * - * dst.memview = p_src.memview - * dst.data = p_src.data # <<<<<<<<<<<<<< + * 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":434 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 434, __pyx_L1_error) + + /* "View.MemoryView":435 * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) * */ - __pyx_t_5 = __pyx_v_p_src->data; - __pyx_v_dst.data = __pyx_t_5; + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 435, __pyx_L1_error) - /* "View.MemoryView":727 + /* "View.MemoryView":436 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":434 + * cdef __Pyx_memviewslice src_slice * - * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< - * cdef int *p_suboffset_dim = &suboffset_dim - * cdef Py_ssize_t start, stop, step + * 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_v_p_dst = (&__pyx_v_dst); + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 434, __pyx_L1_error) - /* "View.MemoryView":728 + /* "View.MemoryView":430 + * return obj * - * 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 + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice */ - __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); - /* "View.MemoryView":732 - * cdef bint have_start, have_stop, have_step + /* 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":438 + * src.ndim, dst.ndim, self.dtype_is_object) * - * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< - * if PyIndex_Check(index): - * slice_memviewslice( + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL */ - __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, 732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) - #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - #endif - } else { - if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) - #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 732, __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":733 +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":440 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item * - * 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) { + __pyx_v_tmp = NULL; - /* "View.MemoryView":737 - * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], - * dim, new_ndim, p_suboffset_dim, - * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< - * 0, 0, 0, # have_{start,stop,step} - * False) + /* "View.MemoryView":445 + * cdef __Pyx_memviewslice *dst_slice + * cdef __Pyx_memviewslice tmp_slice + * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< + * + * if self.view.itemsize > sizeof(array): */ - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 737, __pyx_L1_error) + __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); - /* "View.MemoryView":734 - * for dim, index in enumerate(indices): - * if PyIndex_Check(index): - * slice_memviewslice( # <<<<<<<<<<<<<< - * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], - * dim, new_ndim, p_suboffset_dim, + /* "View.MemoryView":447 + * 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_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 734, __pyx_L1_error) + __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":733 + /* "View.MemoryView":448 * - * 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], + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError */ - goto __pyx_L6; - } + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); - /* "View.MemoryView":740 - * 0, 0, 0, # have_{start,stop,step} - * False) - * elif index is None: # <<<<<<<<<<<<<< - * p_dst.shape[new_ndim] = 1 - * p_dst.strides[new_ndim] = 0 + /* "View.MemoryView":449 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp */ - __pyx_t_2 = (__pyx_v_index == Py_None); - __pyx_t_1 = (__pyx_t_2 != 0); + __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":741 - * 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":742 - * 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 + /* "View.MemoryView":450 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: */ - (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error) - /* "View.MemoryView":743 - * p_dst.shape[new_ndim] = 1 - * p_dst.strides[new_ndim] = 0 - * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< - * new_ndim += 1 - * else: + /* "View.MemoryView":449 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp */ - (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + } - /* "View.MemoryView":744 - * p_dst.strides[new_ndim] = 0 - * p_dst.suboffsets[new_ndim] = -1 - * new_ndim += 1 # <<<<<<<<<<<<<< + /* "View.MemoryView":451 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< * else: - * start = index.start or 0 + * item = array */ - __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + __pyx_v_item = __pyx_v_tmp; - /* "View.MemoryView":740 - * 0, 0, 0, # have_{start,stop,step} - * False) - * elif index is None: # <<<<<<<<<<<<<< - * p_dst.shape[new_ndim] = 1 - * p_dst.strides[new_ndim] = 0 + /* "View.MemoryView":447 + * 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_L6; - } + goto __pyx_L3; + } - /* "View.MemoryView":746 - * new_ndim += 1 + /* "View.MemoryView":453 + * item = tmp * else: - * start = index.start or 0 # <<<<<<<<<<<<<< - * stop = index.stop or 0 - * step = index.step or 0 + * item = array # <<<<<<<<<<<<<< + * + * try: */ - /*else*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) - if (!__pyx_t_1) { - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error) - __pyx_t_10 = __pyx_t_12; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_10 = 0; - __pyx_L7_bool_binop_done:; - __pyx_v_start = __pyx_t_10; + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; - /* "View.MemoryView":747 - * else: - * start = index.start or 0 - * stop = index.stop or 0 # <<<<<<<<<<<<<< - * step = index.step or 0 + /* "View.MemoryView":455 + * item = array * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __pyx_L1_error) - if (!__pyx_t_1) { - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error) - __pyx_t_10 = __pyx_t_12; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L9_bool_binop_done; - } - __pyx_t_10 = 0; - __pyx_L9_bool_binop_done:; - __pyx_v_stop = __pyx_t_10; + /*try:*/ { - /* "View.MemoryView":748 - * start = index.start or 0 - * stop = index.stop or 0 - * step = index.step or 0 # <<<<<<<<<<<<<< + /* "View.MemoryView":456 * - * have_start = index.start is not None + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) - if (!__pyx_t_1) { - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error) - __pyx_t_10 = __pyx_t_12; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L11_bool_binop_done; - } - __pyx_t_10 = 0; - __pyx_L11_bool_binop_done:; - __pyx_v_step = __pyx_t_10; + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { - /* "View.MemoryView":750 - * step = index.step or 0 + /* "View.MemoryView":457 + * 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":456 * - * have_start = index.start is not None # <<<<<<<<<<<<<< - * have_stop = index.stop is not None - * have_step = index.step is not None + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 750, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = (__pyx_t_9 != Py_None); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_have_start = __pyx_t_1; + goto __pyx_L8; + } - /* "View.MemoryView":751 + /* "View.MemoryView":459 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< * - * 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, 751, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = (__pyx_t_9 != Py_None); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_have_stop = __pyx_t_1; + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 459, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; - /* "View.MemoryView":752 - * have_start = index.start is not None - * have_stop = index.stop is not None - * have_step = index.step is not None # <<<<<<<<<<<<<< + /* "View.MemoryView":463 * - * slice_memviewslice( + * + * 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_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = (__pyx_t_9 != Py_None); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_have_step = __pyx_t_1; + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":754 - * have_step = index.step is not None + /* "View.MemoryView":464 * - * slice_memviewslice( # <<<<<<<<<<<<<< - * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], - * dim, new_ndim, p_suboffset_dim, + * 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_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 754, __pyx_L1_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 464, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":760 - * have_start, have_stop, have_step, - * True) - * new_ndim += 1 # <<<<<<<<<<<<<< + /* "View.MemoryView":463 * - * if isinstance(memview, _memoryviewslice): + * + * 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_v_new_ndim = (__pyx_v_new_ndim + 1); } - __pyx_L6:; - /* "View.MemoryView":732 - * cdef bint have_start, have_stop, have_step - * - * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< - * if PyIndex_Check(index): - * slice_memviewslice( + /* "View.MemoryView":465 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * 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); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":762 - * new_ndim += 1 + /* "View.MemoryView":468 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * return memoryview_fromslice(dst, new_ndim, - * memviewsliceobj.to_object_func, + * cdef setitem_indexed(self, index, value): */ - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __pyx_L6_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __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); + } + __Pyx_PyThreadState_assign + 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":763 + /* "View.MemoryView":438 + * src.ndim, dst.ndim, self.dtype_is_object) * - * 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":764 - * if isinstance(memview, _memoryviewslice): - * return memoryview_fromslice(dst, new_ndim, - * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< - * memviewsliceobj.to_dtype_func, - * memview.dtype_is_object) + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) } - /* "View.MemoryView":765 - * return memoryview_fromslice(dst, new_ndim, - * memviewsliceobj.to_object_func, - * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< - * memview.dtype_is_object) - * else: - */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) } + /* 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":763 +/* "View.MemoryView":470 + * PyMem_Free(tmp) * - * if isinstance(memview, _memoryviewslice): - * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< - * memviewsliceobj.to_object_func, - * memviewsliceobj.to_dtype_func, + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error) - __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; - /* "View.MemoryView":762 - * new_ndim += 1 +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":471 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * return memoryview_fromslice(dst, new_ndim, - * memviewsliceobj.to_object_func, */ - } + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 471, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; - /* "View.MemoryView":768 - * memview.dtype_is_object) - * else: - * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< - * memview.dtype_is_object) + /* "View.MemoryView":472 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< * + * cdef convert_item_to_object(self, char *itemp): */ - /*else*/ { - __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":769 - * else: - * return memoryview_fromslice(dst, new_ndim, NULL, NULL, - * memview.dtype_is_object) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 768, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "View.MemoryView":768 - * memview.dtype_is_object) - * else: - * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< - * memview.dtype_is_object) - * - */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error) - __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; - } - - /* "View.MemoryView":696 + /* "View.MemoryView":470 + * PyMem_Free(tmp) * - * @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 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_3); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":793 +/* "View.MemoryView":474 + * self.assign_item_from_object(itemp, value) * - * @cname('__pyx_memoryview_slice_memviewslice') - * cdef int slice_memviewslice( # <<<<<<<<<<<<<< - * __Pyx_memviewslice *dst, - * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + * 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 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; +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":813 - * cdef bint negative_step - * - * if not is_slice: # <<<<<<<<<<<<<< + /* "View.MemoryView":477 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem * - * if start < 0: */ - __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; - /* "View.MemoryView":815 - * if not is_slice: + /* "View.MemoryView":480 + * cdef bytes bytesitem * - * if start < 0: # <<<<<<<<<<<<<< - * start += shape - * if not 0 <= start < shape: + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) */ - __pyx_t_1 = ((__pyx_v_start < 0) != 0); - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "View.MemoryView":816 + /* "View.MemoryView":481 * - * if start < 0: - * start += shape # <<<<<<<<<<<<<< - * if not 0 <= start < shape: - * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: */ - __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + { + __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":815 - * if not is_slice: + /* "View.MemoryView":482 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __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, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":481 * - * if start < 0: # <<<<<<<<<<<<<< - * start += shape - * if not 0 <= start < shape: + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: */ } - /* "View.MemoryView":817 - * if start < 0: - * start += shape - * if not 0 <= start < shape: # <<<<<<<<<<<<<< - * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) - * else: + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result */ - __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) { + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { - /* "View.MemoryView":818 - * start += shape - * if not 0 <= start < shape: - * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< - * else: + /* "View.MemoryView":487 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 818, __pyx_L1_error) + __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, 487, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; - /* "View.MemoryView":817 - * if start < 0: - * start += shape - * if not 0 <= start < shape: # <<<<<<<<<<<<<< - * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) - * else: + /* "View.MemoryView":486 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result */ - } + } - /* "View.MemoryView":813 - * cdef bint negative_step - * - * if not is_slice: # <<<<<<<<<<<<<< - * - * if start < 0: - */ - goto __pyx_L3; - } - - /* "View.MemoryView":821 - * else: - * - * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< - * - * if have_step and step == 0: - */ - /*else*/ { - __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); - if (__pyx_t_1) { - } else { - __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":823 - * negative_step = have_step != 0 and step < 0 - * - * if have_step and step == 0: # <<<<<<<<<<<<<< - * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + /* "View.MemoryView":488 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< * + * cdef assign_item_from_object(self, char *itemp, object value): */ - __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_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L6_except_return; } - __pyx_t_1 = ((__pyx_v_step == 0) != 0); - __pyx_t_2 = __pyx_t_1; - __pyx_L9_bool_binop_done:; - if (__pyx_t_2) { + __pyx_L3_error:; + __Pyx_PyThreadState_assign + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":824 - * - * if have_step and step == 0: - * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":483 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); - /* "View.MemoryView":823 - * negative_step = have_step != 0 and step < 0 - * - * if have_step and step == 0: # <<<<<<<<<<<<<< - * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) - * + /* "View.MemoryView":484 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(2, 484, __pyx_L5_except_error) } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "View.MemoryView":827 - * + /* "View.MemoryView":481 * - * if have_start: # <<<<<<<<<<<<<< - * if start < 0: - * start += shape + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: */ - __pyx_t_2 = (__pyx_v_have_start != 0); - if (__pyx_t_2) { + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } - /* "View.MemoryView":828 + /* "View.MemoryView":474 + * self.assign_item_from_object(itemp, value) * - * if have_start: - * if start < 0: # <<<<<<<<<<<<<< - * start += shape - * if start < 0: + * 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""" */ - __pyx_t_2 = ((__pyx_v_start < 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":829 - * if have_start: - * if start < 0: - * start += shape # <<<<<<<<<<<<<< - * if start < 0: - * start = 0 - */ - __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + /* 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":830 - * if start < 0: - * start += shape - * if start < 0: # <<<<<<<<<<<<<< - * start = 0 - * elif start >= shape: +/* "View.MemoryView":490 + * 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""" */ - __pyx_t_2 = ((__pyx_v_start < 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":831 - * start += shape - * if start < 0: - * start = 0 # <<<<<<<<<<<<<< - * elif start >= shape: - * if negative_step: - */ - __pyx_v_start = 0; +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":830 - * if start < 0: - * start += shape - * if start < 0: # <<<<<<<<<<<<<< - * start = 0 - * elif start >= shape: + /* "View.MemoryView":493 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue */ - } + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; - /* "View.MemoryView":828 + /* "View.MemoryView":498 + * cdef Py_ssize_t i * - * if have_start: - * if start < 0: # <<<<<<<<<<<<<< - * start += shape - * if start < 0: + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: */ - goto __pyx_L12; - } + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { - /* "View.MemoryView":832 - * if start < 0: - * start = 0 - * elif start >= shape: # <<<<<<<<<<<<<< - * if negative_step: - * start = shape - 1 + /* "View.MemoryView":499 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) */ - __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); - if (__pyx_t_2) { - - /* "View.MemoryView":833 - * 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":834 - * elif start >= shape: - * if negative_step: - * start = shape - 1 # <<<<<<<<<<<<<< - * else: - * start = shape - */ - __pyx_v_start = (__pyx_v_shape - 1); - - /* "View.MemoryView":833 - * start = 0 - * elif start >= shape: - * if negative_step: # <<<<<<<<<<<<<< - * start = shape - 1 - * else: - */ - goto __pyx_L14; - } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __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 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 499, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* "View.MemoryView":836 - * start = shape - 1 - * else: - * start = shape # <<<<<<<<<<<<<< + /* "View.MemoryView":498 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) * else: - * if negative_step: */ - /*else*/ { - __pyx_v_start = __pyx_v_shape; - } - __pyx_L14:; + goto __pyx_L3; + } - /* "View.MemoryView":832 - * if start < 0: - * start = 0 - * elif start >= shape: # <<<<<<<<<<<<<< - * if negative_step: - * start = shape - 1 + /* "View.MemoryView":501 + * 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, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __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; } - __pyx_L12:; + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __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, 501, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; - /* "View.MemoryView":827 + /* "View.MemoryView":503 + * bytesvalue = struct.pack(self.view.format, value) * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c * - * if have_start: # <<<<<<<<<<<<<< - * if start < 0: - * start += shape - */ - goto __pyx_L11; - } - - /* "View.MemoryView":838 - * start = shape - * else: - * if negative_step: # <<<<<<<<<<<<<< - * start = shape - 1 - * else: */ - /*else*/ { - __pyx_t_2 = (__pyx_v_negative_step != 0); - if (__pyx_t_2) { + __pyx_t_9 = 0; + if (unlikely(__pyx_v_bytesvalue == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + __PYX_ERR(2, 503, __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":839 - * else: - * if negative_step: - * start = shape - 1 # <<<<<<<<<<<<<< - * else: - * start = 0 + /* "View.MemoryView":504 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') */ - __pyx_v_start = (__pyx_v_shape - 1); + __pyx_v_i = __pyx_t_9; - /* "View.MemoryView":838 - * start = shape - * else: - * if negative_step: # <<<<<<<<<<<<<< - * start = shape - 1 - * else: + /* "View.MemoryView":503 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * */ - goto __pyx_L15; - } + __pyx_t_9 = (__pyx_t_9 + 1); - /* "View.MemoryView":841 - * start = shape - 1 - * else: - * start = 0 # <<<<<<<<<<<<<< + /* "View.MemoryView":504 * - * if have_stop: + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') */ - /*else*/ { - __pyx_v_start = 0; - } - __pyx_L15:; - } - __pyx_L11:; + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "View.MemoryView":843 - * start = 0 + /* "View.MemoryView":490 + * return result * - * if have_stop: # <<<<<<<<<<<<<< - * if stop < 0: - * stop += shape + * 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""" */ - __pyx_t_2 = (__pyx_v_have_stop != 0); - if (__pyx_t_2) { - /* "View.MemoryView":844 + /* 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":507 * - * if have_stop: - * if stop < 0: # <<<<<<<<<<<<<< - * stop += shape - * if stop < 0: + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape */ - __pyx_t_2 = ((__pyx_v_stop < 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":845 - * if have_stop: - * if stop < 0: - * stop += shape # <<<<<<<<<<<<<< - * if stop < 0: - * stop = 0 - */ - __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - /* "View.MemoryView":846 - * 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) { + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":847 - * stop += shape - * if stop < 0: - * stop = 0 # <<<<<<<<<<<<<< - * elif stop > shape: - * stop = shape - */ - __pyx_v_stop = 0; +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; + Py_ssize_t *__pyx_t_2; + char *__pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "View.MemoryView":846 - * if stop < 0: - * stop += shape - * if stop < 0: # <<<<<<<<<<<<<< - * stop = 0 - * elif stop > shape: + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: */ - } + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":844 - * - * if have_stop: - * if stop < 0: # <<<<<<<<<<<<<< - * stop += shape - * if stop < 0: + /* "View.MemoryView":509 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL */ - goto __pyx_L17; - } + __pyx_t_2 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_2; - /* "View.MemoryView":848 - * if stop < 0: - * stop = 0 - * elif stop > shape: # <<<<<<<<<<<<<< - * stop = shape + /* "View.MemoryView":508 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape * else: */ - __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); - if (__pyx_t_2) { + goto __pyx_L3; + } - /* "View.MemoryView":849 - * stop = 0 - * elif stop > shape: - * stop = shape # <<<<<<<<<<<<<< + /* "View.MemoryView":511 + * info.shape = self.view.shape * else: - * if negative_step: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: */ - __pyx_v_stop = __pyx_v_shape; + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L3:; - /* "View.MemoryView":848 - * if stop < 0: - * stop = 0 - * elif stop > shape: # <<<<<<<<<<<<<< - * stop = shape + /* "View.MemoryView":513 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides * else: */ - } - __pyx_L17:; + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":843 - * start = 0 + /* "View.MemoryView":514 * - * if have_stop: # <<<<<<<<<<<<<< - * if stop < 0: - * stop += shape + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL */ - goto __pyx_L16; - } + __pyx_t_2 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_2; - /* "View.MemoryView":851 - * stop = shape + /* "View.MemoryView":513 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides * else: - * if negative_step: # <<<<<<<<<<<<<< - * stop = -1 - * else: */ - /*else*/ { - __pyx_t_2 = (__pyx_v_negative_step != 0); - if (__pyx_t_2) { + goto __pyx_L4; + } - /* "View.MemoryView":852 + /* "View.MemoryView":516 + * info.strides = self.view.strides * else: - * if negative_step: - * stop = -1 # <<<<<<<<<<<<<< - * else: - * stop = shape + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: */ - __pyx_v_stop = -1L; + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L4:; - /* "View.MemoryView":851 - * stop = shape + /* "View.MemoryView":518 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets * else: - * if negative_step: # <<<<<<<<<<<<<< - * stop = -1 - * else: */ - goto __pyx_L19; - } + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":854 - * stop = -1 - * else: - * stop = shape # <<<<<<<<<<<<<< + /* "View.MemoryView":519 * - * if not have_step: + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL */ - /*else*/ { - __pyx_v_stop = __pyx_v_shape; - } - __pyx_L19:; - } - __pyx_L16:; + __pyx_t_2 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_2; - /* "View.MemoryView":856 - * stop = shape - * - * if not have_step: # <<<<<<<<<<<<<< - * step = 1 + /* "View.MemoryView":518 + * info.strides = NULL * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: */ - __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); - if (__pyx_t_2) { + goto __pyx_L5; + } - /* "View.MemoryView":857 - * - * if not have_step: - * step = 1 # <<<<<<<<<<<<<< - * + /* "View.MemoryView":521 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< * + * if flags & PyBUF_FORMAT: */ - __pyx_v_step = 1; + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L5:; - /* "View.MemoryView":856 - * stop = shape - * - * if not have_step: # <<<<<<<<<<<<<< - * step = 1 + /* "View.MemoryView":523 + * 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":861 - * - * with cython.cdivision(True): - * new_shape = (stop - start) // step # <<<<<<<<<<<<<< + /* "View.MemoryView":524 * - * if (stop - start) - step * new_shape: + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL */ - __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); + __pyx_t_3 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_3; - /* "View.MemoryView":863 - * new_shape = (stop - start) // step - * - * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< - * new_shape += 1 + /* "View.MemoryView":523 + * info.suboffsets = NULL * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: */ - __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); - if (__pyx_t_2) { + goto __pyx_L6; + } - /* "View.MemoryView":864 - * - * if (stop - start) - step * new_shape: - * new_shape += 1 # <<<<<<<<<<<<<< + /* "View.MemoryView":526 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< * - * if new_shape < 0: + * info.buf = self.view.buf */ - __pyx_v_new_shape = (__pyx_v_new_shape + 1); + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L6:; - /* "View.MemoryView":863 - * new_shape = (stop - start) // step - * - * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< - * new_shape += 1 + /* "View.MemoryView":528 + * info.format = NULL * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize */ - } + __pyx_t_4 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_4; - /* "View.MemoryView":866 - * new_shape += 1 - * - * if new_shape < 0: # <<<<<<<<<<<<<< - * new_shape = 0 + /* "View.MemoryView":529 * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len */ - __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); - if (__pyx_t_2) { + __pyx_t_5 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_5; - /* "View.MemoryView":867 - * - * if new_shape < 0: - * new_shape = 0 # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":530 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = 0 */ - __pyx_v_new_shape = 0; + __pyx_t_6 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_6; - /* "View.MemoryView":866 - * new_shape += 1 - * - * if new_shape < 0: # <<<<<<<<<<<<<< - * new_shape = 0 - * + /* "View.MemoryView":531 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.obj = self */ - } + __pyx_t_6 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_6; - /* "View.MemoryView":870 - * + /* "View.MemoryView":532 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.obj = self * - * 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); + __pyx_v_info->readonly = 0; - /* "View.MemoryView":871 - * - * dst.strides[new_ndim] = stride * step - * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< - * dst.suboffsets[new_ndim] = suboffset + /* "View.MemoryView":533 + * info.len = self.view.len + * info.readonly = 0 + * info.obj = self # <<<<<<<<<<<<<< * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ - (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + __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":872 - * dst.strides[new_ndim] = stride * step - * dst.shape[new_ndim] = new_shape - * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< - * + /* "View.MemoryView":507 * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape */ - (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; + + /* function exit code */ + __pyx_r = 0; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; } - __pyx_L3:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":875 - * +/* "View.MemoryView":539 * - * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< - * dst.data += start * stride - * else: + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) */ - __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":876 - * - * if suboffset_dim[0] < 0: - * dst.data += start * stride # <<<<<<<<<<<<<< - * else: - * dst.suboffsets[suboffset_dim[0]] += start * stride +/* 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":540 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result */ - __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; - /* "View.MemoryView":875 - * + /* "View.MemoryView":541 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result * - * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< - * dst.data += start * stride - * else: */ - goto __pyx_L23; - } + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error) - /* "View.MemoryView":878 - * dst.data += start * stride - * else: - * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + /* "View.MemoryView":542 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< * - * if suboffset >= 0: + * @property */ - /*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:; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; - /* "View.MemoryView":880 - * dst.suboffsets[suboffset_dim[0]] += start * stride + /* "View.MemoryView":539 * - * if suboffset >= 0: # <<<<<<<<<<<<<< - * if not is_slice: - * if new_ndim == 0: + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) */ - __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":881 + /* 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":545 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj * - * 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":882 - * 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":883 - * 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":882 - * if suboffset >= 0: - * if not is_slice: - * if new_ndim == 0: # <<<<<<<<<<<<<< - * dst.data = ( dst.data)[0] + suboffset - * else: - */ - goto __pyx_L26; - } +/* 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)); - /* "View.MemoryView":885 - * dst.data = ( dst.data)[0] + suboffset - * else: - * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< - * "must be indexed and not sliced", dim) - * else: - */ - /*else*/ { + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":886 - * else: - * _err_dim(IndexError, "All dimensions preceding dimension %d " - * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< - * else: - * suboffset_dim[0] = new_ndim - */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error) - } - __pyx_L26:; +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":881 + /* "View.MemoryView":546 + * @property + * def base(self): + * return self.obj # <<<<<<<<<<<<<< * - * if suboffset >= 0: - * if not is_slice: # <<<<<<<<<<<<<< - * if new_ndim == 0: - * dst.data = ( dst.data)[0] + suboffset + * @property */ - goto __pyx_L25; - } + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; - /* "View.MemoryView":888 - * "must be indexed and not sliced", dim) - * else: - * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + /* "View.MemoryView":545 * - * return 0 - */ - /*else*/ { - (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; - } - __pyx_L25:; - - /* "View.MemoryView":880 - * dst.suboffsets[suboffset_dim[0]] += start * stride + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj * - * if suboffset >= 0: # <<<<<<<<<<<<<< - * if not is_slice: - * if new_ndim == 0: */ - } - /* "View.MemoryView":890 - * suboffset_dim[0] = new_ndim + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":549 * - * return 0 # <<<<<<<<<<<<<< + * @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":550 + * @property + * def shape(self): + * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< * + * @property */ - __pyx_r = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_length = (__pyx_t_2[0]); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "View.MemoryView":793 + /* "View.MemoryView":549 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) * - * @cname('__pyx_memoryview_slice_memviewslice') - * cdef int slice_memviewslice( # <<<<<<<<<<<<<< - * __Pyx_memviewslice *dst, - * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, */ /* function exit code */ __pyx_L1_error:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - } - __pyx_r = -1; + __Pyx_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":896 +/* "View.MemoryView":553 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: * - * @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; +/* 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; - Py_ssize_t __pyx_v_suboffset; - Py_ssize_t __pyx_v_itemsize; - char *__pyx_v_resultp; - char *__pyx_r; + PyObject *__pyx_r = NULL; __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); + 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":898 - * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, - * Py_ssize_t dim) except NULL: - * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< - * cdef Py_ssize_t itemsize = view.itemsize - * cdef char *resultp + /* "View.MemoryView":554 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") */ - __pyx_v_suboffset = -1L; + __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":899 - * Py_ssize_t dim) except NULL: - * cdef Py_ssize_t shape, stride, suboffset = -1 - * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< - * cdef char *resultp + /* "View.MemoryView":556 + * 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_1 = __pyx_v_view->itemsize; - __pyx_v_itemsize = __pyx_t_1; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 556, __pyx_L1_error) - /* "View.MemoryView":902 - * cdef char *resultp + /* "View.MemoryView":554 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< * - * if view.ndim == 0: # <<<<<<<<<<<<<< - * shape = view.len / itemsize - * stride = itemsize + * raise ValueError("Buffer view does not expose strides") */ - __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); - if (__pyx_t_2) { + } - /* "View.MemoryView":903 + /* "View.MemoryView":558 + * raise ValueError("Buffer view does not expose strides") * - * 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, 903, __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, 903, __pyx_L1_error) - } - __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); - - /* "View.MemoryView":904 - * if view.ndim == 0: - * shape = view.len / itemsize - * stride = itemsize # <<<<<<<<<<<<<< - * else: - * shape = view.shape[dim] - */ - __pyx_v_stride = __pyx_v_itemsize; - - /* "View.MemoryView":902 - * cdef char *resultp + * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< * - * if view.ndim == 0: # <<<<<<<<<<<<<< - * shape = view.len / itemsize - * stride = itemsize + * @property */ - goto __pyx_L3; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_v_stride = (__pyx_t_3[0]); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; - /* "View.MemoryView":906 - * stride = itemsize - * else: - * shape = view.shape[dim] # <<<<<<<<<<<<<< - * stride = view.strides[dim] - * if view.suboffsets != NULL: + /* "View.MemoryView":553 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * */ - /*else*/ { - __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); - /* "View.MemoryView":907 - * 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]); + /* 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":908 - * shape = view.shape[dim] - * stride = view.strides[dim] - * if view.suboffsets != NULL: # <<<<<<<<<<<<<< - * suboffset = view.suboffsets[dim] +/* "View.MemoryView":561 * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim */ - __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":909 - * 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]); +/* 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)); - /* "View.MemoryView":908 - * shape = view.shape[dim] - * stride = view.strides[dim] - * if view.suboffsets != NULL: # <<<<<<<<<<<<<< - * suboffset = view.suboffsets[dim] - * - */ - } - } - __pyx_L3:; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":911 - * 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) { +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":912 + /* "View.MemoryView":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim * - * 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])); + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":913 - * if index < 0: - * index += view.shape[dim] - * if index < 0: # <<<<<<<<<<<<<< - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + /* "View.MemoryView":563 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_t_2 = ((__pyx_v_index < 0) != 0); - if (__pyx_t_2) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__26, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "View.MemoryView":914 - * index += view.shape[dim] - * if index < 0: - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + /* "View.MemoryView":562 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim * - * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 914, __pyx_L1_error) + } - /* "View.MemoryView":913 - * if index < 0: - * index += view.shape[dim] - * if index < 0: # <<<<<<<<<<<<<< - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + /* "View.MemoryView":565 + * return (-1,) * self.view.ndim * - */ - } - - /* "View.MemoryView":911 - * suboffset = view.suboffsets[dim] + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< * - * if index < 0: # <<<<<<<<<<<<<< - * index += view.shape[dim] - * if index < 0: + * @property */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "View.MemoryView":916 - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * - * if index >= shape: # <<<<<<<<<<<<<< - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + /* "View.MemoryView":561 * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim */ - __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":917 - * - * if index >= shape: - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< - * - * resultp = bufp + index * stride - */ - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 917, __pyx_L1_error) + /* 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":916 - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) +/* "View.MemoryView":568 * - * if index >= shape: # <<<<<<<<<<<<<< - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim * */ - } - /* "View.MemoryView":919 - * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) +/* 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":569 + * @property + * def ndim(self): + * return self.view.ndim # <<<<<<<<<<<<<< * - * resultp = bufp + index * stride # <<<<<<<<<<<<<< - * if suboffset >= 0: - * resultp = ( resultp)[0] + suboffset + * @property */ - __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":920 + /* "View.MemoryView":568 * - * resultp = bufp + index * stride - * if suboffset >= 0: # <<<<<<<<<<<<<< - * resultp = ( resultp)[0] + suboffset + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim * */ - __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); - if (__pyx_t_2) { - /* "View.MemoryView":921 - * resultp = bufp + index * stride - * if suboffset >= 0: - * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< - * - * return resultp - */ - __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); + /* 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":920 +/* "View.MemoryView":572 * - * resultp = bufp + index * stride - * if suboffset >= 0: # <<<<<<<<<<<<<< - * resultp = ( resultp)[0] + suboffset + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize * */ - } - /* "View.MemoryView":923 - * resultp = ( resultp)[0] + suboffset - * - * return resultp # <<<<<<<<<<<<<< - * +/* 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":573 + * @property + * def itemsize(self): + * return self.view.itemsize # <<<<<<<<<<<<<< * + * @property */ - __pyx_r = __pyx_v_resultp; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":896 + /* "View.MemoryView":572 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize * - * @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_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":929 +/* "View.MemoryView":576 * - * @cname('__pyx_memslice_transpose') - * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< - * cdef int ndim = memslice.memview.view.ndim + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize * */ -static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { - int __pyx_v_ndim; - Py_ssize_t *__pyx_v_shape; - Py_ssize_t *__pyx_v_strides; - int __pyx_v_i; - int __pyx_v_j; - int __pyx_r; - int __pyx_t_1; - Py_ssize_t *__pyx_t_2; - long __pyx_t_3; - Py_ssize_t __pyx_t_4; - Py_ssize_t __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; +/* 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)); - /* "View.MemoryView":930 - * @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_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":577 + * @property + * def nbytes(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< * - * cdef Py_ssize_t *shape = memslice.shape + * @property */ - __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; - __pyx_v_ndim = __pyx_t_1; + __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, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "View.MemoryView":932 - * cdef int ndim = memslice.memview.view.ndim + /* "View.MemoryView":576 * - * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< - * cdef Py_ssize_t *strides = memslice.strides + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize * */ - __pyx_t_2 = __pyx_v_memslice->shape; - __pyx_v_shape = __pyx_t_2; - /* "View.MemoryView":933 - * - * 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; + /* 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":937 +/* "View.MemoryView":580 * - * cdef int i, j - * for i in range(ndim / 2): # <<<<<<<<<<<<<< - * j = ndim - 1 - i - * strides[i], strides[j] = strides[j], strides[i] + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 */ - __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); - for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":938 - * 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] +/* 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":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * */ - __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { - /* "View.MemoryView":939 - * 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] + /* "View.MemoryView":582 + * def size(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< * + * for length in self.view.shape[:self.view.ndim]: */ - __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); - __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); - (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; - (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; - /* "View.MemoryView":940 - * j = ndim - 1 - i - * strides[i], strides[j] = strides[j], strides[i] - * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + /* "View.MemoryView":584 + * result = 1 + * + * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< + * result *= length * - * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: */ - __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); - __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); - (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; - (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; - /* "View.MemoryView":942 - * shape[i], shape[j] = shape[j], shape[i] + /* "View.MemoryView":585 * - * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< - * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< * + * self._size = result */ - __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L6_bool_binop_done; + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; } - __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); - __pyx_t_6 = __pyx_t_7; - __pyx_L6_bool_binop_done:; - if (__pyx_t_6) { - /* "View.MemoryView":943 + /* "View.MemoryView":587 + * result *= length * - * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: - * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * self._size = result # <<<<<<<<<<<<<< * - * return 1 + * return self._size */ - __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error) + __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":942 - * shape[i], shape[j] = shape[j], shape[i] - * - * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< - * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + /* "View.MemoryView":581 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 * */ - } } - /* "View.MemoryView":945 - * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * - * return 1 # <<<<<<<<<<<<<< + /* "View.MemoryView":589 + * self._size = result * + * return self._size # <<<<<<<<<<<<<< * + * def __len__(self): */ - __pyx_r = 1; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; goto __pyx_L0; - /* "View.MemoryView":929 - * - * @cname('__pyx_memslice_transpose') - * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< - * cdef int ndim = memslice.memview.view.ndim + /* "View.MemoryView":580 * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 */ /* function exit code */ __pyx_L1_error:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - } - __pyx_r = 0; + __Pyx_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":962 - * cdef int (*to_dtype_func)(char *, object) except 0 - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) +/* "View.MemoryView":591 + * return self._size * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] */ /* Python wrapper */ -static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { +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("__dealloc__ (wrapper)", 0); - __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + __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 void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__", 0); + int __pyx_t_1; + __Pyx_RefNannySetupContext("__len__", 0); - /* "View.MemoryView":963 + /* "View.MemoryView":592 * - * def __dealloc__(self): - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] * - * cdef convert_item_to_object(self, char *itemp): */ - __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":962 - * cdef int (*to_dtype_func)(char *, object) except 0 - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + /* "View.MemoryView":593 + * 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; - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "View.MemoryView":965 - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + /* "View.MemoryView":592 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] * - * 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":966 - * - * 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":967 - * 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, 967, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "View.MemoryView":966 + /* "View.MemoryView":595 + * return self.view.shape[0] * - * cdef convert_item_to_object(self, char *itemp): - * if self.to_object_func != NULL: # <<<<<<<<<<<<<< - * return self.to_object_func(itemp) - * else: - */ - } - - /* "View.MemoryView":969 - * return self.to_object_func(itemp) - * else: - * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * return 0 # <<<<<<<<<<<<<< * - * cdef assign_item_from_object(self, char *itemp, object value): + * def __repr__(self): */ - /*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, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - } + __pyx_r = 0; + goto __pyx_L0; - /* "View.MemoryView":965 - * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + /* "View.MemoryView":591 + * return self._size * - * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< - * if self.to_object_func != NULL: - * return self.to_object_func(itemp) + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] */ /* 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":971 - * return memoryview.convert_item_to_object(self, itemp) +/* "View.MemoryView":597 + * return 0 * - * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< - * if self.to_dtype_func != NULL: - * self.to_dtype_func(itemp, value) + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) */ -static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { +/* 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 - int __pyx_t_1; - int __pyx_t_2; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("assign_item_from_object", 0); + __Pyx_RefNannySetupContext("__repr__", 0); - /* "View.MemoryView":972 + /* "View.MemoryView":598 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) * - * 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":973 - * cdef assign_item_from_object(self, char *itemp, object value): - * if self.to_dtype_func != NULL: - * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< - * else: - * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error) + __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, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":972 + /* "View.MemoryView":599 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< * - * cdef assign_item_from_object(self, char *itemp, object value): - * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< - * self.to_dtype_func(itemp, value) - * else: + * def __str__(self): */ - goto __pyx_L3; - } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":975 - * self.to_dtype_func(itemp, value) - * else: - * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + /* "View.MemoryView":598 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) * - * @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, 975, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_L3:; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "View.MemoryView":971 - * return memoryview.convert_item_to_object(self, itemp) + /* "View.MemoryView":597 + * return 0 * - * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< - * if self.to_dtype_func != NULL: - * self.to_dtype_func(itemp, value) + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) */ /* 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_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __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":978 +/* "View.MemoryView":601 + * id(self)) * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.from_object + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) * */ /* 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) { +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("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + __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_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); - /* "View.MemoryView":979 - * @property - * def base(self): - * return self.from_object # <<<<<<<<<<<<<< + /* "View.MemoryView":602 + * + * def __str__(self): + * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< + * * - * __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; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":978 - * - * @property - * def base(self): # <<<<<<<<<<<<<< - * return self.from_object + /* "View.MemoryView":601 + * 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":985 +/* "View.MemoryView":605 * - * @cname('__pyx_memoryview_fromslice') - * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< - * int ndim, - * object (*to_object_func)(char *), + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp */ -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; +/* 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 - 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); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("is_c_contig", 0); - /* "View.MemoryView":993 - * cdef _memoryviewslice result - * - * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< - * return None + /* "View.MemoryView":608 + * 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_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); - if (__pyx_t_1) { + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); - /* "View.MemoryView":994 - * - * if memviewslice.memview == Py_None: - * return None # <<<<<<<<<<<<<< - * + /* "View.MemoryView":609 + * 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_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + __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, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":993 - * cdef _memoryviewslice result + /* "View.MemoryView":605 * - * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< - * return None * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp */ - } - /* "View.MemoryView":999 - * - * - * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< - * - * result.from_slice = memviewslice - */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(Py_None); - __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, 999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); - __pyx_t_2 = 0; + /* 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":1001 - * result = _memoryviewslice(None, 0, dtype_is_object) - * - * result.from_slice = memviewslice # <<<<<<<<<<<<<< - * __PYX_INC_MEMVIEW(&memviewslice, 1) +/* "View.MemoryView":611 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp */ - __pyx_v_result->from_slice = __pyx_v_memviewslice; - /* "View.MemoryView":1002 - * - * result.from_slice = memviewslice - * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< - * - * result.from_object = ( memviewslice.memview).base - */ - __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); +/* 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)); - /* "View.MemoryView":1004 - * __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, 1004, __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; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1005 - * - * result.from_object = ( memviewslice.memview).base - * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< +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":614 + * 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) * - * result.view = memviewslice.memview.view */ - __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; - __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); - /* "View.MemoryView":1007 - * result.typeinfo = memviewslice.memview.typeinfo + /* "View.MemoryView":615 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< * - * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< - * result.view.buf = memviewslice.data - * result.view.ndim = ndim + * def copy(self): */ - __pyx_t_5 = __pyx_v_memviewslice.memview->view; - __pyx_v_result->__pyx_base.view = __pyx_t_5; + __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, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "View.MemoryView":1008 + /* "View.MemoryView":611 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) * - * result.view = memviewslice.memview.view - * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< - * result.view.ndim = ndim - * (<__pyx_buffer *> &result.view).obj = Py_None + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp */ - __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); - /* "View.MemoryView":1009 - * 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; + /* 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":1010 - * result.view.buf = memviewslice.data - * result.view.ndim = ndim - * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< - * Py_INCREF(Py_None) +/* "View.MemoryView":617 + * 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 */ - ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; - /* "View.MemoryView":1011 - * result.view.ndim = ndim - * (<__pyx_buffer *> &result.view).obj = Py_None - * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * - * result.flags = PyBUF_RECORDS - */ - Py_INCREF(Py_None); +/* 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)); - /* "View.MemoryView":1013 - * Py_INCREF(Py_None) - * - * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + /* 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":619 + * def copy(self): + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< * - * result.view.shape = result.from_slice.shape + * slice_copy(self, &mslice) */ - __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); - /* "View.MemoryView":1015 - * result.flags = PyBUF_RECORDS - * - * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< - * result.view.strides = result.from_slice.strides + /* "View.MemoryView":621 + * 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_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); - /* "View.MemoryView":1016 - * - * result.view.shape = result.from_slice.shape - * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< - * + /* "View.MemoryView":622 * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, */ - __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 622, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":1019 + /* "View.MemoryView":627 + * self.dtype_is_object) * + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< * - * result.view.suboffsets = NULL # <<<<<<<<<<<<<< - * for suboffset in result.from_slice.suboffsets[:ndim]: - * if suboffset >= 0: + * def copy_fortran(self): */ - __pyx_v_result->__pyx_base.view.suboffsets = NULL; + __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, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "View.MemoryView":1020 + /* "View.MemoryView":617 + * return slice_is_contig(mslice[0], 'F', self.view.ndim) * - * result.view.suboffsets = NULL - * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< - * if suboffset >= 0: - * result.view.suboffsets = result.from_slice.suboffsets + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS */ - __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); - for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { - __pyx_t_6 = __pyx_t_8; - __pyx_v_suboffset = (__pyx_t_6[0]); - /* "View.MemoryView":1021 - * result.view.suboffsets = NULL - * for suboffset in result.from_slice.suboffsets[:ndim]: - * if suboffset >= 0: # <<<<<<<<<<<<<< - * result.view.suboffsets = result.from_slice.suboffsets - * break - */ - __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); - if (__pyx_t_1) { + /* 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":1022 - * for suboffset in result.from_slice.suboffsets[:ndim]: - * if suboffset >= 0: - * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< - * break +/* "View.MemoryView":629 + * return memoryview_copy_from_slice(self, &mslice) * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS */ - __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); - /* "View.MemoryView":1023 - * if suboffset >= 0: - * result.view.suboffsets = result.from_slice.suboffsets - * break # <<<<<<<<<<<<<< - * - * result.view.len = result.view.itemsize - */ - goto __pyx_L5_break; +/* 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)); - /* "View.MemoryView":1021 - * result.view.suboffsets = NULL - * for suboffset in result.from_slice.suboffsets[:ndim]: - * if suboffset >= 0: # <<<<<<<<<<<<<< - * result.view.suboffsets = result.from_slice.suboffsets - * break - */ - } - } - __pyx_L5_break:; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1025 - * 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; +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":1026 - * - * result.view.len = result.view.itemsize - * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< - * result.view.len *= length + /* "View.MemoryView":631 + * def copy_fortran(self): + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< * + * slice_copy(self, &src) */ - __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); - for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { - __pyx_t_6 = __pyx_t_8; - __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); - /* "View.MemoryView":1027 - * result.view.len = result.view.itemsize - * for length in result.view.shape[:ndim]: - * result.view.len *= length # <<<<<<<<<<<<<< + /* "View.MemoryView":633 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS * - * result.to_object_func = to_object_func + * slice_copy(self, &src) # <<<<<<<<<<<<<< + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, + * self.view.itemsize, */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result->__pyx_base.view.len = __pyx_t_9; - } + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); - /* "View.MemoryView":1029 - * result.view.len *= length - * - * result.to_object_func = to_object_func # <<<<<<<<<<<<<< - * result.to_dtype_func = to_dtype_func + /* "View.MemoryView":634 * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, */ - __pyx_v_result->to_object_func = __pyx_v_to_object_func; + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 634, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; - /* "View.MemoryView":1030 - * - * result.to_object_func = to_object_func - * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< + /* "View.MemoryView":639 + * self.dtype_is_object) * - * return result - */ - __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; - - /* "View.MemoryView":1032 - * result.to_dtype_func = to_dtype_func + * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< * - * 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); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":985 + /* "View.MemoryView":629 + * return memoryview_copy_from_slice(self, &mslice) * - * @cname('__pyx_memoryview_fromslice') - * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< - * int ndim, - * object (*to_object_func)(char *), + * 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_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_result); - __Pyx_XDECREF(__pyx_v_length); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":1035 - * - * @cname('__pyx_memoryview_get_slice_from_memoryview') - * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *mslice): - * cdef _memoryviewslice obj +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -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; +/* 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 - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("get_slice_from_memview", 0); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self)); - /* "View.MemoryView":1038 - * __Pyx_memviewslice *mslice): - * cdef _memoryviewslice obj - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * obj = memview - * return &obj.from_slice + /* 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_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, 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) - /* "View.MemoryView":1039 - * cdef _memoryviewslice obj - * if isinstance(memview, _memoryviewslice): - * obj = memview # <<<<<<<<<<<<<< - * return &obj.from_slice - * else: + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1039, __pyx_L1_error) - __pyx_t_3 = ((PyObject *)__pyx_v_memview); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); - __pyx_t_3 = 0; - /* "View.MemoryView":1040 - * if isinstance(memview, _memoryviewslice): - * obj = memview - * return &obj.from_slice # <<<<<<<<<<<<<< - * else: - * slice_copy(memview, mslice) + /* 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__") */ - __pyx_r = (&__pyx_v_obj->from_slice); - goto __pyx_L0; - /* "View.MemoryView":1038 - * __Pyx_memviewslice *mslice): - * cdef _memoryviewslice obj - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * obj = memview - * return &obj.from_slice +/* 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__28, 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) - /* "View.MemoryView":1042 - * return &obj.from_slice - * else: - * slice_copy(memview, mslice) # <<<<<<<<<<<<<< - * return mslice + /* "(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":643 * + * @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 */ - /*else*/ { - __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); - /* "View.MemoryView":1043 - * else: - * slice_copy(memview, mslice) - * return mslice # <<<<<<<<<<<<<< +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":644 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __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, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":645 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result * - * @cname('__pyx_memoryview_slice_copy') */ - __pyx_r = __pyx_v_mslice; - goto __pyx_L0; - } + __pyx_v_result->typeinfo = __pyx_v_typeinfo; - /* "View.MemoryView":1035 + /* "View.MemoryView":646 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_get_slice_from_memoryview') - * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *mslice): - * cdef _memoryviewslice obj + * @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":643 + * + * @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_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "View.MemoryView":1046 +/* "View.MemoryView":649 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) * - * @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; +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { + int __pyx_r; __Pyx_RefNannyDeclarations - Py_ssize_t *__pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - __Pyx_RefNannySetupContext("slice_copy", 0); + int __pyx_t_1; + __Pyx_RefNannySetupContext("memoryview_check", 0); - /* "View.MemoryView":1050 - * cdef (Py_ssize_t*) shape, strides, suboffsets + /* "View.MemoryView":650 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< * - * shape = memview.view.shape # <<<<<<<<<<<<<< - * strides = memview.view.strides - * suboffsets = memview.view.suboffsets + * cdef tuple _unellipsify(object index, int ndim): */ - __pyx_t_1 = __pyx_v_memview->view.shape; - __pyx_v_shape = __pyx_t_1; + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); + __pyx_r = __pyx_t_1; + goto __pyx_L0; - /* "View.MemoryView":1051 + /* "View.MemoryView":649 * - * shape = memview.view.shape - * strides = memview.view.strides # <<<<<<<<<<<<<< - * suboffsets = memview.view.suboffsets + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) * */ - __pyx_t_1 = __pyx_v_memview->view.strides; - __pyx_v_strides = __pyx_t_1; - /* "View.MemoryView":1052 - * 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; + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":1054 - * 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":1055 - * - * 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":1057 - * 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; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_dim = __pyx_t_3; - - /* "View.MemoryView":1058 - * - * 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":1059 - * 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":1060 - * 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_4 = (__pyx_v_suboffsets[__pyx_v_dim]); - } else { - __pyx_t_4 = -1L; - } - (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4; - } - - /* "View.MemoryView":1046 - * - * @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":1063 - * - * @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":1066 - * "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":1067 - * 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, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "View.MemoryView":1063 - * - * @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":1070 +/* "View.MemoryView":652 + * return isinstance(o, memoryview) * - * @cname('__pyx_memoryview_copy_object_from_slice') - * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ - * Create a new memoryview object from a given memoryview object and slice. + * Replace all ellipses with full slices and fill incomplete indices with */ -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 *); +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)(char *); - int (*__pyx_t_4)(char *, PyObject *); - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + 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":1077 - * cdef int (*to_dtype_func)(char *, object) except 0 - * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * to_object_func = (<_memoryviewslice> memview).to_object_func - * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + /* "View.MemoryView":657 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: */ - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - __pyx_t_2 = (__pyx_t_1 != 0); + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1078 - * - * if isinstance(memview, _memoryviewslice): - * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< - * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + /* "View.MemoryView":658 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< * else: + * tup = index */ - __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; - __pyx_v_to_object_func = __pyx_t_3; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __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":1079 - * if isinstance(memview, _memoryviewslice): - * to_object_func = (<_memoryviewslice> memview).to_object_func - * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< + /* "View.MemoryView":657 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) * 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":1077 - * cdef int (*to_dtype_func)(char *, object) except 0 - * - * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< - * to_object_func = (<_memoryviewslice> memview).to_object_func - * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func */ goto __pyx_L3; } - /* "View.MemoryView":1081 - * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + /* "View.MemoryView":660 + * tup = (index,) * else: - * to_object_func = NULL # <<<<<<<<<<<<<< - * to_dtype_func = NULL + * tup = index # <<<<<<<<<<<<<< * + * result = [] */ /*else*/ { - __pyx_v_to_object_func = NULL; - - /* "View.MemoryView":1082 - * else: - * to_object_func = NULL - * to_dtype_func = NULL # <<<<<<<<<<<<<< - * - * return memoryview_fromslice(memviewslice[0], memview.view.ndim, - */ - __pyx_v_to_dtype_func = NULL; + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; } __pyx_L3:; - /* "View.MemoryView":1084 - * to_dtype_func = NULL + /* "View.MemoryView":662 + * tup = index * - * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< - * to_object_func, to_dtype_func, - * memview.dtype_is_object) + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False */ - __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; - /* "View.MemoryView":1086 - * return memoryview_fromslice(memviewslice[0], memview.view.ndim, - * to_object_func, to_dtype_func, - * memview.dtype_is_object) # <<<<<<<<<<<<<< - * + /* "View.MemoryView":663 * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): */ - __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; + __pyx_v_have_slices = 0; - /* "View.MemoryView":1070 - * - * @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. + /* "View.MemoryView":664 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: */ + __pyx_v_seen_ellipsis = 0; - /* 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":1092 - * - * - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< - * if arg < 0: - * return -arg + /* "View.MemoryView":665 + * 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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 665, __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, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; -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":1093 - * - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: - * if arg < 0: # <<<<<<<<<<<<<< - * return -arg - * else: + /* "View.MemoryView":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) */ - __pyx_t_1 = ((__pyx_v_arg < 0) != 0); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1094 - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: - * if arg < 0: - * return -arg # <<<<<<<<<<<<<< - * else: - * return arg + /* "View.MemoryView":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True */ - __pyx_r = (-__pyx_v_arg); - goto __pyx_L0; + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1093 - * - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: - * if arg < 0: # <<<<<<<<<<<<<< - * return -arg - * else: + /* "View.MemoryView":668 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: */ - } + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__29); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":1096 - * return -arg - * else: - * return arg # <<<<<<<<<<<<<< - * - * @cname('__pyx_get_best_slice_order') + /* "View.MemoryView":669 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) */ - /*else*/ { - __pyx_r = __pyx_v_arg; - goto __pyx_L0; - } + __pyx_v_seen_ellipsis = 1; - /* "View.MemoryView":1092 - * - * - * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< - * if arg < 0: - * return -arg + /* "View.MemoryView":667 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True */ + goto __pyx_L7; + } - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "View.MemoryView":1099 - * - * @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. + /* "View.MemoryView":671 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__30); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error) + } + __pyx_L7:; -static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { - int __pyx_v_i; - Py_ssize_t __pyx_v_c_stride; - Py_ssize_t __pyx_v_f_stride; - char __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - - /* "View.MemoryView":1104 - * """ - * cdef int i - * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< - * cdef Py_ssize_t f_stride = 0 - * + /* "View.MemoryView":672 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): */ - __pyx_v_c_stride = 0; + __pyx_v_have_slices = 1; - /* "View.MemoryView":1105 - * 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): + /* "View.MemoryView":666 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) */ - __pyx_v_f_stride = 0; + goto __pyx_L6; + } - /* "View.MemoryView":1107 - * cdef Py_ssize_t f_stride = 0 + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) * - * 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 > -1L; __pyx_t_1-=1) { - __pyx_v_i = __pyx_t_1; + /*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 (__pyx_t_1) { - /* "View.MemoryView":1108 + /* "View.MemoryView":675 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< * - * for i in range(ndim - 1, -1, -1): - * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< - * c_stride = mslice.strides[i] - * break + * have_slices = have_slices or isinstance(item, slice) */ - __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); - if (__pyx_t_2) { + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(2, 675, __pyx_L1_error) - /* "View.MemoryView":1109 - * for i in range(ndim - 1, -1, -1): - * if mslice.shape[i] > 1: - * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< - * break + /* "View.MemoryView":674 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) * */ - __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + } - /* "View.MemoryView":1110 - * if mslice.shape[i] > 1: - * c_stride = mslice.strides[i] - * break # <<<<<<<<<<<<<< + /* "View.MemoryView":677 + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) * - * for i in range(ndim): */ - goto __pyx_L4_break; + __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":1108 + /* "View.MemoryView":678 * - * for i in range(ndim - 1, -1, -1): - * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< - * c_stride = mslice.strides[i] - * break + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error) } - } - __pyx_L4_break:; + __pyx_L6:; - /* "View.MemoryView":1112 - * break - * - * for i in range(ndim): # <<<<<<<<<<<<<< - * if mslice.shape[i] > 1: - * f_stride = mslice.strides[i] + /* "View.MemoryView":665 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: */ - __pyx_t_1 = __pyx_v_ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":1113 + /* "View.MemoryView":680 + * result.append(item) * - * for i in range(ndim): - * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< - * f_stride = mslice.strides[i] - * break + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) */ - __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); - if (__pyx_t_2) { + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); - /* "View.MemoryView":1114 - * for i in range(ndim): - * if mslice.shape[i] > 1: - * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< - * break + /* "View.MemoryView":681 * - */ - __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); - - /* "View.MemoryView":1115 - * if mslice.shape[i] > 1: - * f_stride = mslice.strides[i] - * break # <<<<<<<<<<<<<< + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) * - * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): */ - goto __pyx_L7_break; + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1113 + /* "View.MemoryView":682 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< * - * for i in range(ndim): - * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< - * f_stride = mslice.strides[i] - * break + * 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, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__31); + __Pyx_GIVEREF(__pyx_slice__31); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__31); + } } - } - __pyx_L7_break:; - - /* "View.MemoryView":1117 - * 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) { + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":1118 + /* "View.MemoryView":681 * - * 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":1117 - * break + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) * - * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< - * return 'C' - * else: */ } - /* "View.MemoryView":1120 - * return 'C' - * else: - * return 'F' # <<<<<<<<<<<<<< + /* "View.MemoryView":684 + * result.extend([slice(None)] * nslices) * - * @cython.cdivision(True) + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): */ - /*else*/ { - __pyx_r = 'F'; - goto __pyx_L0; + __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, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L0; - /* "View.MemoryView":1099 + /* "View.MemoryView":652 + * return isinstance(o, memoryview) * - * @cname('__pyx_get_best_slice_order') - * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ - * Figure out the best memory access order for a given slice. + * 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":1123 +/* "View.MemoryView":686 + * return have_slices or nslices, tuple(result) * - * @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, - */ + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + */ -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; +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":1130 + /* "View.MemoryView":687 * - * 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 assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") */ - __pyx_v_src_extent = (__pyx_v_src_shape[0]); + __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":1131 - * 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] + /* "View.MemoryView":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * */ - __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_4) { - /* "View.MemoryView":1132 - * cdef Py_ssize_t src_extent = src_shape[0] - * cdef Py_ssize_t dst_extent = dst_shape[0] - * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t dst_stride = dst_strides[0] + /* "View.MemoryView":689 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * * */ - __pyx_v_src_stride = (__pyx_v_src_strides[0]); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 689, __pyx_L1_error) - /* "View.MemoryView":1133 - * cdef Py_ssize_t dst_extent = dst_shape[0] - * cdef Py_ssize_t src_stride = src_strides[0] - * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + /* "View.MemoryView":688 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") * - * if ndim == 1: */ - __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + } + } - /* "View.MemoryView":1135 - * cdef Py_ssize_t dst_stride = dst_strides[0] + /* "View.MemoryView":686 + * return have_slices or nslices, tuple(result) * - * if ndim == 1: # <<<<<<<<<<<<<< - * if (src_stride > 0 and dst_stride > 0 and - * src_stride == itemsize == dst_stride): + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: */ - __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); - if (__pyx_t_1) { - /* "View.MemoryView":1136 + /* 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":696 * - * 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) + * @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 */ - __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":1137 - * 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:; +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":1136 - * - * 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) + /* "View.MemoryView":697 + * @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 */ - if (__pyx_t_1) { + __pyx_v_new_ndim = 0; + __pyx_v_suboffset_dim = -1; - /* "View.MemoryView":1138 - * 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): + /* "View.MemoryView":704 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj */ - memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); - /* "View.MemoryView":1136 + /* "View.MemoryView":708 + * cdef _memoryviewslice memviewsliceobj * - * 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) + * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): */ - goto __pyx_L4; + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(2, 708, __pyx_L1_error) } + } + #endif - /* "View.MemoryView":1140 - * memcpy(dst_data, src_data, itemsize * dst_extent) - * else: - * for i in range(dst_extent): # <<<<<<<<<<<<<< - * memcpy(dst_data, src_data, itemsize) - * src_data += src_stride + /* "View.MemoryView":710 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice */ - /*else*/ { - __pyx_t_4 = __pyx_v_dst_extent; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __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":1141 - * else: - * for i in range(dst_extent): - * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< - * src_data += src_stride - * dst_data += dst_stride + /* "View.MemoryView":711 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: */ - memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); - - /* "View.MemoryView":1142 - * 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); + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 711, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; - /* "View.MemoryView":1143 - * memcpy(dst_data, src_data, itemsize) - * src_data += src_stride - * dst_data += dst_stride # <<<<<<<<<<<<<< + /* "View.MemoryView":712 + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< * else: - * for i in range(dst_extent): + * slice_copy(memview, &src) */ - __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); - } - } - __pyx_L4:; + __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); - /* "View.MemoryView":1135 - * cdef Py_ssize_t dst_stride = dst_strides[0] + /* "View.MemoryView":710 + * assert memview.view.ndim > 0 * - * if ndim == 1: # <<<<<<<<<<<<<< - * if (src_stride > 0 and dst_stride > 0 and - * src_stride == itemsize == dst_stride): + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice */ goto __pyx_L3; } - /* "View.MemoryView":1145 - * dst_data += dst_stride + /* "View.MemoryView":714 + * p_src = &memviewsliceobj.from_slice * else: - * for i in range(dst_extent): # <<<<<<<<<<<<<< - * _copy_strided_to_strided(src_data, src_strides + 1, - * dst_data, dst_strides + 1, + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * */ /*else*/ { - __pyx_t_4 = __pyx_v_dst_extent; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); - /* "View.MemoryView":1146 + /* "View.MemoryView":715 * 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":1150 - * src_shape + 1, dst_shape + 1, - * ndim - 1, itemsize) - * src_data += src_stride # <<<<<<<<<<<<<< - * dst_data += dst_stride + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< * - */ - __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); - - /* "View.MemoryView":1151 - * 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_v_p_src = (&__pyx_v_src); } __pyx_L3:; - /* "View.MemoryView":1123 + /* "View.MemoryView":721 + * + * + * dst.memview = p_src.memview # <<<<<<<<<<<<<< + * dst.data = p_src.data * - * @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, */ + __pyx_t_4 = __pyx_v_p_src->memview; + __pyx_v_dst.memview = __pyx_t_4; - /* function exit code */ -} - -/* "View.MemoryView":1153 - * dst_data += dst_stride + /* "View.MemoryView":722 + * + * dst.memview = p_src.memview + * dst.data = p_src.data # <<<<<<<<<<<<<< + * * - * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *dst, - * int ndim, size_t itemsize) nogil: */ + __pyx_t_5 = __pyx_v_p_src->data; + __pyx_v_dst.data = __pyx_t_5; -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":1156 - * __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) + /* "View.MemoryView":727 * + * + * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< + * cdef int *p_suboffset_dim = &suboffset_dim + * cdef Py_ssize_t start, stop, step */ - _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); + __pyx_v_p_dst = (&__pyx_v_dst); - /* "View.MemoryView":1153 - * dst_data += dst_stride + /* "View.MemoryView":728 * - * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *dst, - * int ndim, size_t itemsize) nogil: + * 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); - /* function exit code */ -} - -/* "View.MemoryView":1160 + /* "View.MemoryView":732 + * cdef bint have_start, have_stop, have_step * - * @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 + * 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, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 732, __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); -static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { - int __pyx_v_i; - Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_r; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - - /* "View.MemoryView":1163 - * "Return the size of the memory occupied by the slice in number of bytes" - * cdef int i - * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + /* "View.MemoryView":733 * - * for i in range(ndim): + * 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_1 = __pyx_v_src->memview->view.itemsize; - __pyx_v_size = __pyx_t_1; + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1165 - * cdef Py_ssize_t size = src.memview.view.itemsize - * - * for i in range(ndim): # <<<<<<<<<<<<<< - * size *= src.shape[i] - * + /* "View.MemoryView":737 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) */ - __pyx_t_2 = __pyx_v_ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 737, __pyx_L1_error) - /* "View.MemoryView":1166 - * - * for i in range(ndim): - * size *= src.shape[i] # <<<<<<<<<<<<<< - * - * return size + /* "View.MemoryView":734 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, */ - __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i])); - } + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 734, __pyx_L1_error) - /* "View.MemoryView":1168 - * size *= src.shape[i] - * - * return size # <<<<<<<<<<<<<< + /* "View.MemoryView":733 * - * @cname('__pyx_fill_contig_strides_array') + * 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_r = __pyx_v_size; - goto __pyx_L0; + goto __pyx_L6; + } - /* "View.MemoryView":1160 - * - * @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 + /* "View.MemoryView":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "View.MemoryView":1171 - * - * @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: + /* "View.MemoryView":741 + * 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; -static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { - int __pyx_v_idx; - Py_ssize_t __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - - /* "View.MemoryView":1180 - * cdef int idx - * - * if order == 'F': # <<<<<<<<<<<<<< - * for idx in range(ndim): - * strides[idx] = stride + /* "View.MemoryView":742 + * 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_t_1 = ((__pyx_v_order == 'F') != 0); - if (__pyx_t_1) { + (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; - /* "View.MemoryView":1181 - * - * if order == 'F': - * for idx in range(ndim): # <<<<<<<<<<<<<< - * strides[idx] = stride - * stride = stride * shape[idx] + /* "View.MemoryView":743 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: */ - __pyx_t_2 = __pyx_v_ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_idx = __pyx_t_3; + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; - /* "View.MemoryView":1182 - * if order == 'F': - * for idx in range(ndim): - * strides[idx] = stride # <<<<<<<<<<<<<< - * stride = stride * shape[idx] - * else: + /* "View.MemoryView":744 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 # <<<<<<<<<<<<<< + * else: + * start = index.start or 0 */ - (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); - /* "View.MemoryView":1183 - * for idx in range(ndim): - * strides[idx] = stride - * stride = stride * shape[idx] # <<<<<<<<<<<<<< - * else: - * for idx in range(ndim - 1, -1, -1): + /* "View.MemoryView":740 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 */ - __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + goto __pyx_L6; } - /* "View.MemoryView":1180 - * cdef int idx - * - * if order == 'F': # <<<<<<<<<<<<<< - * for idx in range(ndim): - * strides[idx] = stride + /* "View.MemoryView":746 + * new_ndim += 1 + * else: + * start = index.start or 0 # <<<<<<<<<<<<<< + * stop = index.stop or 0 + * step = index.step or 0 */ - goto __pyx_L3; - } + /*else*/ { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; - /* "View.MemoryView":1185 - * stride = stride * shape[idx] - * else: - * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< - * strides[idx] = stride - * stride = stride * shape[idx] + /* "View.MemoryView":747 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * */ - /*else*/ { - for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) { - __pyx_v_idx = __pyx_t_2; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; - /* "View.MemoryView":1186 - * else: - * for idx in range(ndim - 1, -1, -1): - * strides[idx] = stride # <<<<<<<<<<<<<< - * stride = stride * shape[idx] + /* "View.MemoryView":748 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< * + * have_start = index.start is not None */ - (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; - /* "View.MemoryView":1187 - * for idx in range(ndim - 1, -1, -1): - * strides[idx] = stride - * stride = stride * shape[idx] # <<<<<<<<<<<<<< + /* "View.MemoryView":750 + * step = index.step or 0 * - * return stride + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None */ - __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); - } - } - __pyx_L3:; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; - /* "View.MemoryView":1189 - * stride = stride * shape[idx] + /* "View.MemoryView":751 * - * return stride # <<<<<<<<<<<<<< + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None * - * @cname('__pyx_memoryview_copy_data_to_temp') */ - __pyx_r = __pyx_v_stride; - goto __pyx_L0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; - /* "View.MemoryView":1171 + /* "View.MemoryView":752 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< * - * @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: + * slice_memviewslice( */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "View.MemoryView":754 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 754, __pyx_L1_error) -/* "View.MemoryView":1192 + /* "View.MemoryView":760 + * have_start, have_stop, have_step, + * True) + * new_ndim += 1 # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_copy_data_to_temp') - * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *tmpslice, - * char order, + * if isinstance(memview, _memoryviewslice): */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } + __pyx_L6:; -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; - - /* "View.MemoryView":1203 - * cdef void *result - * - * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< - * cdef size_t size = slice_get_size(src, ndim) + /* "View.MemoryView":732 + * cdef bint have_start, have_stop, have_step * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( */ - __pyx_t_1 = __pyx_v_src->memview->view.itemsize; - __pyx_v_itemsize = __pyx_t_1; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":1204 - * - * cdef size_t itemsize = src.memview.view.itemsize - * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< + /* "View.MemoryView":762 + * new_ndim += 1 * - * result = malloc(size) + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, */ - __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); + __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":1206 - * cdef size_t size = slice_get_size(src, ndim) + /* "View.MemoryView":763 * - * result = malloc(size) # <<<<<<<<<<<<<< - * if not result: - * _err(MemoryError, NULL) + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, */ - __pyx_v_result = malloc(__pyx_v_size); + __Pyx_XDECREF(((PyObject *)__pyx_r)); - /* "View.MemoryView":1207 - * - * result = malloc(size) - * if not result: # <<<<<<<<<<<<<< - * _err(MemoryError, NULL) - * + /* "View.MemoryView":764 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) */ - __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); - if (__pyx_t_2) { + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) } - /* "View.MemoryView":1208 - * result = malloc(size) - * if not result: - * _err(MemoryError, NULL) # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":765 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error) + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) } - /* "View.MemoryView":1207 - * - * result = malloc(size) - * if not result: # <<<<<<<<<<<<<< - * _err(MemoryError, NULL) + /* "View.MemoryView":763 * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, */ - } + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; - /* "View.MemoryView":1211 - * + /* "View.MemoryView":762 + * new_ndim += 1 * - * tmpslice.data = result # <<<<<<<<<<<<<< - * tmpslice.memview = src.memview - * for i in range(ndim): + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, */ - __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + } - /* "View.MemoryView":1212 + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) * - * 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":1213 - * 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; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); - /* "View.MemoryView":1214 - * tmpslice.memview = src.memview - * for i in range(ndim): - * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< - * tmpslice.suboffsets[i] = -1 + /* "View.MemoryView":769 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * * */ - (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); - /* "View.MemoryView":1215 - * for i in range(ndim): - * tmpslice.shape[i] = src.shape[i] - * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + /* "View.MemoryView":768 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) * - * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, */ - (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; } - /* "View.MemoryView":1217 - * tmpslice.suboffsets[i] = -1 - * - * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< - * ndim, order) + /* "View.MemoryView":696 * + * @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 */ - __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":1221 - * + /* 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":793 * - * for i in range(ndim): # <<<<<<<<<<<<<< - * if tmpslice.shape[i] == 1: - * tmpslice.strides[i] = 0 + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, */ - __pyx_t_3 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - /* "View.MemoryView":1222 +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":813 + * cdef bint negative_step * - * for i in range(ndim): - * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< - * tmpslice.strides[i] = 0 + * if not is_slice: # <<<<<<<<<<<<<< * + * if start < 0: */ - __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1223 - * for i in range(ndim): - * if tmpslice.shape[i] == 1: - * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< + /* "View.MemoryView":815 + * if not is_slice: * - * if slice_is_contig(src[0], order, ndim): + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: */ - (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; + __pyx_t_1 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":1222 - * - * for i in range(ndim): - * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< - * tmpslice.strides[i] = 0 + /* "View.MemoryView":816 * + * 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":1225 - * tmpslice.strides[i] = 0 + /* "View.MemoryView":815 + * if not is_slice: * - * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< - * memcpy(result, src.data, size) - * else: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: */ - __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); - if (__pyx_t_2) { + } - /* "View.MemoryView":1226 - * - * if slice_is_contig(src[0], order, ndim): - * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) * else: - * copy_strided_to_strided(src, tmpslice, ndim, itemsize) */ - memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + __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":1225 - * tmpslice.strides[i] = 0 + /* "View.MemoryView":818 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: * - * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< - * memcpy(result, src.data, size) + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 818, __pyx_L1_error) + + /* "View.MemoryView":817 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) * else: */ - goto __pyx_L9; + } + + /* "View.MemoryView":813 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; } - /* "View.MemoryView":1228 - * memcpy(result, src.data, size) + /* "View.MemoryView":821 * else: - * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< * - * return result + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: */ /*else*/ { - copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); - } - __pyx_L9:; + __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":1230 - * copy_strided_to_strided(src, tmpslice, ndim, itemsize) - * - * return result # <<<<<<<<<<<<<< + /* "View.MemoryView":823 + * negative_step = have_step != 0 and step < 0 * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) * */ - __pyx_r = __pyx_v_result; - goto __pyx_L0; + __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":1192 + /* "View.MemoryView":824 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * * - * @cname('__pyx_memoryview_copy_data_to_temp') - * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice *tmpslice, - * char order, */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error) - /* function exit code */ - __pyx_L1_error:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - } - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "View.MemoryView":1235 + /* "View.MemoryView":823 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) * - * @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 = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("_err_extents", 0); - - /* "View.MemoryView":1238 - * Py_ssize_t extent2) except -1 with gil: - * raise ValueError("got differing extents in dimension %d (got %d and %d)" % - * (i, extent1, extent2)) # <<<<<<<<<<<<<< + /* "View.MemoryView":827 * - * @cname('__pyx_memoryview_err_dim') + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __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_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1237 - * cdef int _err_extents(int i, Py_ssize_t extent1, - * Py_ssize_t extent2) except -1 with gil: - * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< - * (i, extent1, extent2)) + /* "View.MemoryView":828 * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 1237, __pyx_L1_error) + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1235 - * - * @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)" % + /* "View.MemoryView":829 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - return __pyx_r; -} + /* "View.MemoryView":830 + * 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":1241 - * - * @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) + /* "View.MemoryView":831 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":830 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":828 * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: */ + goto __pyx_L12; + } -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 = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("_err_dim", 0); - __Pyx_INCREF(__pyx_v_error); - - /* "View.MemoryView":1242 - * @cname('__pyx_memoryview_err_dim') - * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: - * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< - * - * @cname('__pyx_memoryview_err') + /* "View.MemoryView":832 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 */ - __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_INCREF(__pyx_v_error); - __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; - if (CYTHON_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, 1242, __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, 1242, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - #endif - { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(2, 1242, __pyx_L1_error) + __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1241 - * - * @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) - * + /* "View.MemoryView":833 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __Pyx_XDECREF(__pyx_v_error); - __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - return __pyx_r; -} - -/* "View.MemoryView":1245 - * - * @cname('__pyx_memoryview_err') - * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< - * if msg != NULL: - * raise error(msg.decode('ascii')) + /* "View.MemoryView":834 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape */ + __pyx_v_start = (__pyx_v_shape - 1); -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 = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("_err", 0); - __Pyx_INCREF(__pyx_v_error); + /* "View.MemoryView":833 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } - /* "View.MemoryView":1246 - * @cname('__pyx_memoryview_err') - * cdef int _err(object error, char *msg) except -1 with gil: - * if msg != NULL: # <<<<<<<<<<<<<< - * raise error(msg.decode('ascii')) - * else: + /* "View.MemoryView":836 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: */ - __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); - if (__pyx_t_1) { + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; - /* "View.MemoryView":1247 - * cdef int _err(object error, char *msg) except -1 with gil: - * if msg != NULL: - * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< - * else: - * raise error + /* "View.MemoryView":832 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 */ - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_error); - __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; - if (CYTHON_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, 1247, __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, 1247, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } + __pyx_L12:; + + /* "View.MemoryView":827 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; } - __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, 1247, __pyx_L1_error) - /* "View.MemoryView":1246 - * @cname('__pyx_memoryview_err') - * cdef int _err(object error, char *msg) except -1 with gil: - * if msg != NULL: # <<<<<<<<<<<<<< - * raise error(msg.decode('ascii')) - * else: + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: */ - } + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1249 - * raise error(msg.decode('ascii')) - * else: - * raise error # <<<<<<<<<<<<<< - * - * @cname('__pyx_memoryview_copy_contents') + /* "View.MemoryView":839 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 */ - /*else*/ { - __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(2, 1249, __pyx_L1_error) - } + __pyx_v_start = (__pyx_v_shape - 1); - /* "View.MemoryView":1245 - * - * @cname('__pyx_memoryview_err') - * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< - * if msg != NULL: - * raise error(msg.decode('ascii')) + /* "View.MemoryView":838 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: */ + goto __pyx_L15; + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __Pyx_XDECREF(__pyx_v_error); - __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - return __pyx_r; -} - -/* "View.MemoryView":1252 + /* "View.MemoryView":841 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_copy_contents') - * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice dst, - * int src_ndim, int dst_ndim, + * if have_stop: */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; -static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { - void *__pyx_v_tmpdata; - size_t __pyx_v_itemsize; - int __pyx_v_i; - char __pyx_v_order; - int __pyx_v_broadcasting; - int __pyx_v_direct_copy; - __Pyx_memviewslice __pyx_v_tmp; - int __pyx_v_ndim; - int __pyx_r; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - void *__pyx_t_6; - int __pyx_t_7; - - /* "View.MemoryView":1260 - * Check for overlapping memory and verify the shapes. - * """ - * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< - * cdef size_t itemsize = src.memview.view.itemsize - * cdef int i + /* "View.MemoryView":843 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape */ - __pyx_v_tmpdata = NULL; + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1261 - * """ - * cdef void *tmpdata = NULL - * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< - * cdef int i - * cdef char order = get_best_order(&src, src_ndim) + /* "View.MemoryView":844 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: */ - __pyx_t_1 = __pyx_v_src.memview->view.itemsize; - __pyx_v_itemsize = __pyx_t_1; + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1263 - * 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 + /* "View.MemoryView":845 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 */ - __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); - /* "View.MemoryView":1264 - * 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 + /* "View.MemoryView":846 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: */ - __pyx_v_broadcasting = 0; + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1265 - * cdef char order = get_best_order(&src, src_ndim) - * cdef bint broadcasting = False - * cdef bint direct_copy = False # <<<<<<<<<<<<<< - * cdef __Pyx_memviewslice tmp - * + /* "View.MemoryView":847 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape */ - __pyx_v_direct_copy = 0; + __pyx_v_stop = 0; - /* "View.MemoryView":1268 - * cdef __Pyx_memviewslice tmp - * - * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: + /* "View.MemoryView":846 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: */ - __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); - if (__pyx_t_2) { + } - /* "View.MemoryView":1269 + /* "View.MemoryView":844 * - * if src_ndim < dst_ndim: - * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< - * elif dst_ndim < src_ndim: - * broadcast_leading(&dst, dst_ndim, src_ndim) + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: */ - __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + goto __pyx_L17; + } - /* "View.MemoryView":1268 - * cdef __Pyx_memviewslice tmp - * - * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: + /* "View.MemoryView":848 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: */ - goto __pyx_L3; - } + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1270 - * if src_ndim < dst_ndim: - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< - * broadcast_leading(&dst, dst_ndim, src_ndim) - * + /* "View.MemoryView":849 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: */ - __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); - if (__pyx_t_2) { + __pyx_v_stop = __pyx_v_shape; - /* "View.MemoryView":1271 - * 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) + /* "View.MemoryView":848 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: */ - __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); + } + __pyx_L17:; - /* "View.MemoryView":1270 - * if src_ndim < dst_ndim: - * broadcast_leading(&src, src_ndim, dst_ndim) - * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< - * broadcast_leading(&dst, dst_ndim, src_ndim) + /* "View.MemoryView":843 + * start = 0 * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape */ - } - __pyx_L3:; + goto __pyx_L16; + } - /* "View.MemoryView":1273 - * broadcast_leading(&dst, dst_ndim, src_ndim) - * - * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< - * - * for i in range(ndim): + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: */ - __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":1275 - * cdef int ndim = max(src_ndim, dst_ndim) - * - * for i in range(ndim): # <<<<<<<<<<<<<< - * if src.shape[i] != dst.shape[i]: - * if src.shape[i] == 1: - */ - __pyx_t_5 = __pyx_v_ndim; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - - /* "View.MemoryView":1276 - * - * 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":1277 - * 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); + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":1278 - * if src.shape[i] != dst.shape[i]: - * if src.shape[i] == 1: - * broadcasting = True # <<<<<<<<<<<<<< - * src.strides[i] = 0 + /* "View.MemoryView":852 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< * else: + * stop = shape */ - __pyx_v_broadcasting = 1; + __pyx_v_stop = -1L; - /* "View.MemoryView":1279 - * if src.shape[i] == 1: - * broadcasting = True - * src.strides[i] = 0 # <<<<<<<<<<<<<< + /* "View.MemoryView":851 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 * else: - * _err_extents(i, dst.shape[i], src.shape[i]) - */ - (__pyx_v_src.strides[__pyx_v_i]) = 0; - - /* "View.MemoryView":1277 - * for i in range(ndim): - * if src.shape[i] != dst.shape[i]: - * if src.shape[i] == 1: # <<<<<<<<<<<<<< - * broadcasting = True - * src.strides[i] = 0 */ - goto __pyx_L7; + goto __pyx_L19; } - /* "View.MemoryView":1281 - * src.strides[i] = 0 + /* "View.MemoryView":854 + * stop = -1 * else: - * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * stop = shape # <<<<<<<<<<<<<< * - * if src.suboffsets[i] >= 0: + * if not have_step: */ /*else*/ { - __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1281, __pyx_L1_error) + __pyx_v_stop = __pyx_v_shape; } - __pyx_L7:; - - /* "View.MemoryView":1276 - * - * for i in range(ndim): - * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< - * if src.shape[i] == 1: - * broadcasting = True - */ + __pyx_L19:; } + __pyx_L16:; - /* "View.MemoryView":1283 - * _err_extents(i, dst.shape[i], src.shape[i]) + /* "View.MemoryView":856 + * stop = shape * - * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< - * _err_dim(ValueError, "Dimension %d is not direct", i) + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 * */ - __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1284 + /* "View.MemoryView":857 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< * - * if src.suboffsets[i] >= 0: - * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< * - * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error) + __pyx_v_step = 1; - /* "View.MemoryView":1283 - * _err_extents(i, dst.shape[i], src.shape[i]) + /* "View.MemoryView":856 + * stop = shape * - * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< - * _err_dim(ValueError, "Dimension %d is not direct", i) + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 * */ } - } - /* "View.MemoryView":1286 - * _err_dim(ValueError, "Dimension %d is not direct", i) + /* "View.MemoryView":861 * - * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * with cython.cdivision(True): + * new_shape = (stop - start) // step # <<<<<<<<<<<<<< * - * if not slice_is_contig(src, order, ndim): + * if (stop - start) - step * new_shape: */ - __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); - if (__pyx_t_2) { + __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); - /* "View.MemoryView":1288 - * if slices_overlap(&src, &dst, ndim, itemsize): + /* "View.MemoryView":863 + * new_shape = (stop - start) // step * - * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< - * order = get_best_order(&dst, ndim) + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 * */ - __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1289 + /* "View.MemoryView":864 * - * if not slice_is_contig(src, order, ndim): - * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< * - * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * if new_shape < 0: */ - __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); + __pyx_v_new_shape = (__pyx_v_new_shape + 1); - /* "View.MemoryView":1288 - * if slices_overlap(&src, &dst, ndim, itemsize): + /* "View.MemoryView":863 + * new_shape = (stop - start) // step * - * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< - * order = get_best_order(&dst, ndim) + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 * */ } - /* "View.MemoryView":1291 - * order = get_best_order(&dst, ndim) + /* "View.MemoryView":866 + * new_shape += 1 * - * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< - * src = tmp + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 * */ - __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1291, __pyx_L1_error) - __pyx_v_tmpdata = __pyx_t_6; + __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1292 + /* "View.MemoryView":867 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< * - * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) - * src = tmp # <<<<<<<<<<<<<< * - * if not broadcasting: */ - __pyx_v_src = __pyx_v_tmp; + __pyx_v_new_shape = 0; - /* "View.MemoryView":1286 - * _err_dim(ValueError, "Dimension %d is not direct", i) + /* "View.MemoryView":866 + * new_shape += 1 * - * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 * - * if not slice_is_contig(src, order, ndim): */ - } + } - /* "View.MemoryView":1294 - * src = tmp - * - * if not broadcasting: # <<<<<<<<<<<<<< + /* "View.MemoryView":870 * * + * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset */ - __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); - if (__pyx_t_2) { + (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); - /* "View.MemoryView":1297 + /* "View.MemoryView":871 * + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< + * dst.suboffsets[new_ndim] = suboffset * - * 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) { + (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; - /* "View.MemoryView":1298 + /* "View.MemoryView":872 + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< + * * - * 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); + (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; + } + __pyx_L3:; - /* "View.MemoryView":1297 + /* "View.MemoryView":875 * * - * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: */ - goto __pyx_L12; - } + __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1299 - * if slice_is_contig(src, 'C', ndim): - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< - * direct_copy = slice_is_contig(dst, 'F', ndim) + /* "View.MemoryView":876 * + * if suboffset_dim[0] < 0: + * dst.data += start * stride # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride */ - __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); - if (__pyx_t_2) { + __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); - /* "View.MemoryView":1300 - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): - * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + /* "View.MemoryView":875 * - * if direct_copy: - */ - __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); - - /* "View.MemoryView":1299 - * if slice_is_contig(src, 'C', ndim): - * direct_copy = slice_is_contig(dst, 'C', ndim) - * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< - * direct_copy = slice_is_contig(dst, 'F', ndim) * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: */ - } - __pyx_L12:; + goto __pyx_L23; + } - /* "View.MemoryView":1302 - * direct_copy = slice_is_contig(dst, 'F', ndim) - * - * if direct_copy: # <<<<<<<<<<<<<< + /* "View.MemoryView":878 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< * - * refcount_copying(&dst, dtype_is_object, ndim, False) + * if suboffset >= 0: */ - __pyx_t_2 = (__pyx_v_direct_copy != 0); - if (__pyx_t_2) { + /*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":1304 - * if direct_copy: + /* "View.MemoryView":880 + * dst.suboffsets[suboffset_dim[0]] += start * stride * - * 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) + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: */ - __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1305 + /* "View.MemoryView":881 * - * refcount_copying(&dst, dtype_is_object, ndim, False) - * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< - * refcount_copying(&dst, dtype_is_object, ndim, True) - * free(tmpdata) - */ - memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); - - /* "View.MemoryView":1306 - * refcount_copying(&dst, dtype_is_object, ndim, False) - * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) - * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * free(tmpdata) - * return 0 + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset */ - __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1307 - * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) - * refcount_copying(&dst, dtype_is_object, ndim, True) - * free(tmpdata) # <<<<<<<<<<<<<< - * return 0 - * + /* "View.MemoryView":882 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: */ - free(__pyx_v_tmpdata); + __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1308 - * refcount_copying(&dst, dtype_is_object, ndim, True) - * free(tmpdata) - * return 0 # <<<<<<<<<<<<<< - * - * if order == 'F' == get_best_order(&dst, ndim): + /* "View.MemoryView":883 + * if not is_slice: + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " */ - __pyx_r = 0; - goto __pyx_L0; + __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); - /* "View.MemoryView":1302 - * direct_copy = slice_is_contig(dst, 'F', ndim) - * - * if direct_copy: # <<<<<<<<<<<<<< - * - * refcount_copying(&dst, dtype_is_object, ndim, False) + /* "View.MemoryView":882 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: */ - } + goto __pyx_L26; + } - /* "View.MemoryView":1294 - * src = tmp - * - * if not broadcasting: # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":885 + * 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":1310 - * return 0 - * - * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< - * - * + /* "View.MemoryView":886 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim */ - __pyx_t_2 = (__pyx_v_order == 'F'); - if (__pyx_t_2) { - __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); - } - __pyx_t_7 = (__pyx_t_2 != 0); - if (__pyx_t_7) { + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error) + } + __pyx_L26:; - /* "View.MemoryView":1313 - * - * - * transpose_memslice(&src) # <<<<<<<<<<<<<< - * transpose_memslice(&dst) + /* "View.MemoryView":881 * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error) + goto __pyx_L25; + } - /* "View.MemoryView":1314 - * - * transpose_memslice(&src) - * transpose_memslice(&dst) # <<<<<<<<<<<<<< + /* "View.MemoryView":888 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< * - * refcount_copying(&dst, dtype_is_object, ndim, False) + * return 0 */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error) + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; - /* "View.MemoryView":1310 - * return 0 - * - * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< - * + /* "View.MemoryView":880 + * dst.suboffsets[suboffset_dim[0]] += start * stride * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: */ } - /* "View.MemoryView":1316 - * 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":1317 - * - * 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":1318 - * refcount_copying(&dst, dtype_is_object, ndim, False) - * copy_strided_to_strided(&src, &dst, ndim, itemsize) - * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * - * free(tmpdata) - */ - __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - - /* "View.MemoryView":1320 - * refcount_copying(&dst, dtype_is_object, ndim, True) - * - * free(tmpdata) # <<<<<<<<<<<<<< - * return 0 - * - */ - free(__pyx_v_tmpdata); - - /* "View.MemoryView":1321 + /* "View.MemoryView":890 + * suboffset_dim[0] = new_ndim * - * free(tmpdata) * return 0 # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_broadcast_leading') + * */ __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":1252 + /* "View.MemoryView":793 * - * @cname('__pyx_memoryview_copy_contents') - * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< - * __Pyx_memviewslice dst, - * int src_ndim, int dst_ndim, + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, */ /* function exit code */ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif - __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -24224,971 +24243,4921 @@ return __pyx_r; } -/* "View.MemoryView":1324 +/* "View.MemoryView":896 * - * @cname('__pyx_memoryview_broadcast_leading') - * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< - * int ndim, - * int ndim_other) nogil: + * @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 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; +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":1328 - * int ndim_other) nogil: - * cdef int i - * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< - * - * for i in range(ndim - 1, -1, -1): + /* "View.MemoryView":898 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp */ - __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); + __pyx_v_suboffset = -1L; - /* "View.MemoryView":1330 - * cdef int offset = ndim_other - ndim + /* "View.MemoryView":899 + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< + * cdef char *resultp * - * 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 > -1L; __pyx_t_1-=1) { - __pyx_v_i = __pyx_t_1; + __pyx_t_1 = __pyx_v_view->itemsize; + __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":1331 + /* "View.MemoryView":902 + * cdef char *resultp * - * 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] + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize */ - (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); + __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1332 - * 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] + /* "View.MemoryView":903 * + * if view.ndim == 0: + * shape = view.len / itemsize # <<<<<<<<<<<<<< + * stride = itemsize + * else: */ - (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(2, 903, __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, 903, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); - /* "View.MemoryView":1333 - * mslice.shape[i + offset] = mslice.shape[i] - * mslice.strides[i + offset] = mslice.strides[i] - * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + /* "View.MemoryView":904 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":902 + * cdef char *resultp * - * for i in range(offset): + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize */ - (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + goto __pyx_L3; } - /* "View.MemoryView":1335 - * mslice.suboffsets[i + offset] = mslice.suboffsets[i] - * - * for i in range(offset): # <<<<<<<<<<<<<< - * mslice.shape[i] = 1 - * mslice.strides[i] = mslice.strides[0] + /* "View.MemoryView":906 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: */ - __pyx_t_1 = __pyx_v_offset; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); - /* "View.MemoryView":1336 - * - * for i in range(offset): - * mslice.shape[i] = 1 # <<<<<<<<<<<<<< - * mslice.strides[i] = mslice.strides[0] - * mslice.suboffsets[i] = -1 + /* "View.MemoryView":907 + * else: + * shape = view.shape[dim] + * stride = view.strides[dim] # <<<<<<<<<<<<<< + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] */ - (__pyx_v_mslice->shape[__pyx_v_i]) = 1; + __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); - /* "View.MemoryView":1337 - * for i in range(offset): - * mslice.shape[i] = 1 - * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< - * mslice.suboffsets[i] = -1 + /* "View.MemoryView":908 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] * */ - (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); + __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1338 - * mslice.shape[i] = 1 - * mslice.strides[i] = mslice.strides[0] - * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + /* "View.MemoryView":909 + * 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":908 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] * */ - (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } } + __pyx_L3:; - /* "View.MemoryView":1324 + /* "View.MemoryView":911 + * suboffset = view.suboffsets[dim] * - * @cname('__pyx_memoryview_broadcast_leading') - * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< - * int ndim, - * int ndim_other) nogil: + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { - /* function exit code */ -} - -/* "View.MemoryView":1346 - * - * @cname('__pyx_memoryview_refcount_copying') - * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< - * int ndim, bint inc) nogil: + /* "View.MemoryView":912 * + * 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])); -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":1350 - * + /* "View.MemoryView":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * - * 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) { + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1351 - * - * if dtype_is_object: - * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< - * dst.strides, ndim, inc) + /* "View.MemoryView":914 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< * + * if index >= shape: */ - __pyx_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); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(2, 914, __pyx_L1_error) - /* "View.MemoryView":1350 + /* "View.MemoryView":913 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * + */ + } + + /* "View.MemoryView":911 + * suboffset = view.suboffsets[dim] * - * if dtype_is_object: # <<<<<<<<<<<<<< - * refcount_objects_in_slice_with_gil(dst.data, dst.shape, - * dst.strides, ndim, inc) + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: */ } - /* "View.MemoryView":1346 + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * - * @cname('__pyx_memoryview_refcount_copying') - * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< - * int ndim, bint inc) nogil: + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (__pyx_t_2) { - /* function exit code */ -} - -/* "View.MemoryView":1355 + /* "View.MemoryView":917 * - * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') - * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * bint inc) with gil: - */ - -static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { - __Pyx_RefNannyDeclarations - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); - - /* "View.MemoryView":1358 - * Py_ssize_t *strides, int ndim, - * bint inc) with gil: - * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< * - * @cname('__pyx_memoryview_refcount_objects_in_slice') + * resultp = bufp + index * stride */ - __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 917, __pyx_L1_error) - /* "View.MemoryView":1355 + /* "View.MemoryView":916 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * - * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') - * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * bint inc) with gil: - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif -} - -/* "View.MemoryView":1361 + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * - * @cname('__pyx_memoryview_refcount_objects_in_slice') - * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, bint inc): - * cdef Py_ssize_t i */ + } -static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { - CYTHON_UNUSED Py_ssize_t __pyx_v_i; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); - - /* "View.MemoryView":1365 - * cdef Py_ssize_t i + /* "View.MemoryView":919 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * - * for i in range(shape[0]): # <<<<<<<<<<<<<< - * if ndim == 1: - * if inc: + * resultp = bufp + index * stride # <<<<<<<<<<<<<< + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset */ - __pyx_t_1 = (__pyx_v_shape[0]); - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; + __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); - /* "View.MemoryView":1366 + /* "View.MemoryView":920 * - * for i in range(shape[0]): - * if ndim == 1: # <<<<<<<<<<<<<< - * if inc: - * Py_INCREF(( data)[0]) - */ - __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); - if (__pyx_t_3) { - - /* "View.MemoryView":1367 - * for i in range(shape[0]): - * if ndim == 1: - * if inc: # <<<<<<<<<<<<<< - * Py_INCREF(( data)[0]) - * else: - */ - __pyx_t_3 = (__pyx_v_inc != 0); - if (__pyx_t_3) { - - /* "View.MemoryView":1368 - * if ndim == 1: - * if inc: - * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< - * else: - * Py_DECREF(( data)[0]) - */ - Py_INCREF((((PyObject **)__pyx_v_data)[0])); - - /* "View.MemoryView":1367 - * for i in range(shape[0]): - * if ndim == 1: - * if inc: # <<<<<<<<<<<<<< - * Py_INCREF(( data)[0]) - * else: - */ - goto __pyx_L6; - } - - /* "View.MemoryView":1370 - * 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":1366 + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset * - * for i in range(shape[0]): - * if ndim == 1: # <<<<<<<<<<<<<< - * if inc: - * Py_INCREF(( data)[0]) */ - goto __pyx_L5; - } + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { - /* "View.MemoryView":1372 - * Py_DECREF(( data)[0]) - * else: - * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< - * ndim - 1, inc) + /* "View.MemoryView":921 + * resultp = bufp + index * stride + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< * + * return resultp */ - /*else*/ { + __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); - /* "View.MemoryView":1373 - * else: - * refcount_objects_in_slice(data, shape + 1, strides + 1, - * ndim - 1, inc) # <<<<<<<<<<<<<< + /* "View.MemoryView":920 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset * - * 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":1375 - * ndim - 1, inc) + /* "View.MemoryView":923 + * resultp = ( resultp)[0] + suboffset * - * data += strides[0] # <<<<<<<<<<<<<< + * return resultp # <<<<<<<<<<<<<< * * */ - __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); - } + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; - /* "View.MemoryView":1361 + /* "View.MemoryView":896 * - * @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 + * @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":1381 +/* "View.MemoryView":929 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim * - * @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) { +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; - /* "View.MemoryView":1384 - * 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) + /* "View.MemoryView":930 + * @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_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; + __pyx_v_ndim = __pyx_t_1; - /* "View.MemoryView":1385 - * bint dtype_is_object) nogil: - * refcount_copying(dst, dtype_is_object, ndim, False) - * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< - * itemsize, item) - * refcount_copying(dst, dtype_is_object, ndim, True) + /* "View.MemoryView":932 + * cdef int ndim = memslice.memview.view.ndim + * + * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< + * cdef Py_ssize_t *strides = memslice.strides + * */ - __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); + __pyx_t_2 = __pyx_v_memslice->shape; + __pyx_v_shape = __pyx_t_2; - /* "View.MemoryView":1387 - * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, - * itemsize, item) - * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + /* "View.MemoryView":933 * + * cdef Py_ssize_t *shape = memslice.shape + * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< * - */ - __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - - /* "View.MemoryView":1381 * - * @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: */ + __pyx_t_2 = __pyx_v_memslice->strides; + __pyx_v_strides = __pyx_t_2; - /* function exit code */ -} - -/* "View.MemoryView":1391 + /* "View.MemoryView":937 * - * @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: + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; -static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { - CYTHON_UNUSED Py_ssize_t __pyx_v_i; - Py_ssize_t __pyx_v_stride; - Py_ssize_t __pyx_v_extent; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - Py_ssize_t __pyx_t_3; + /* "View.MemoryView":938 + * 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":1395 - * 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] + /* "View.MemoryView":939 + * 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_stride = (__pyx_v_strides[0]); + __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; - /* "View.MemoryView":1396 - * cdef Py_ssize_t i - * cdef Py_ssize_t stride = strides[0] - * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< + /* "View.MemoryView":940 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< * - * if ndim == 1: + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: */ - __pyx_v_extent = (__pyx_v_shape[0]); + __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; - /* "View.MemoryView":1398 - * cdef Py_ssize_t extent = shape[0] + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") * - * if ndim == 1: # <<<<<<<<<<<<<< - * for i in range(extent): - * memcpy(data, item, itemsize) */ - __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); - if (__pyx_t_1) { + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L6_bool_binop_done:; + if (__pyx_t_6) { - /* "View.MemoryView":1399 + /* "View.MemoryView":943 * - * if ndim == 1: - * for i in range(extent): # <<<<<<<<<<<<<< - * memcpy(data, item, itemsize) - * data += stride + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 */ - __pyx_t_2 = __pyx_v_extent; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; + __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error) - /* "View.MemoryView":1400 - * if ndim == 1: - * for i in range(extent): - * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< - * data += stride - * else: + /* "View.MemoryView":942 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * */ - memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + } + } - /* "View.MemoryView":1401 - * for i in range(extent): - * memcpy(data, item, itemsize) - * data += stride # <<<<<<<<<<<<<< - * else: - * for i in range(extent): + /* "View.MemoryView":945 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * */ - __pyx_v_data = (__pyx_v_data + __pyx_v_stride); - } + __pyx_r = 1; + goto __pyx_L0; - /* "View.MemoryView":1398 - * cdef Py_ssize_t extent = shape[0] + /* "View.MemoryView":929 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim * - * if ndim == 1: # <<<<<<<<<<<<<< - * for i in range(extent): - * memcpy(data, item, itemsize) */ - goto __pyx_L3; + + /* 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":1403 - * data += stride - * else: - * for i in range(extent): # <<<<<<<<<<<<<< - * _slice_assign_scalar(data, shape + 1, strides + 1, - * ndim - 1, itemsize, item) +/* "View.MemoryView":962 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * */ - /*else*/ { - __pyx_t_2 = __pyx_v_extent; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":1404 - * 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); +/* 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)); - /* "View.MemoryView":1406 - * _slice_assign_scalar(data, shape + 1, strides + 1, - * ndim - 1, itemsize, item) - * data += stride # <<<<<<<<<<<<<< + /* 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":963 * + * def __dealloc__(self): + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< * + * cdef convert_item_to_object(self, char *itemp): */ - __pyx_v_data = (__pyx_v_data + __pyx_v_stride); - } - } - __pyx_L3:; + __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); - /* "View.MemoryView":1391 + /* "View.MemoryView":962 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: */ /* function exit code */ -} -static struct __pyx_vtabstruct_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; + __Pyx_RefNannyFinishContext(); } -static void __pyx_tp_dealloc_array(PyObject *o) { - struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; +/* "View.MemoryView":965 + * __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":966 + * + * 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":967 + * 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, 967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":966 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ } - #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); + + /* "View.MemoryView":969 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 969, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; } - 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; + + /* "View.MemoryView":965 + * __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; } -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; +/* "View.MemoryView":971 + * 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":972 + * + * 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":973 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error) + + /* "View.MemoryView":972 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; } -} -static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { - PyObject *v = PyObject_GenericGetAttr(o, n); - if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - v = __pyx_array___getattr__(o, n); + /* "View.MemoryView":975 + * 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, 975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - return v; -} + __pyx_L3:; -static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o); -} + /* "View.MemoryView":971 + * 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 PyMethodDef __pyx_methods_array[] = { - {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, - {0, 0, 0, 0} -}; + /* 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; +} -static struct PyGetSetDef __pyx_getsets_array[] = { - {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; +/* "View.MemoryView":978 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ -static PySequenceMethods __pyx_tp_as_sequence_array = { - 0, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - __pyx_sq_item_array, /*sq_item*/ - 0, /*sq_slice*/ - 0, /*sq_ass_item*/ - 0, /*sq_ass_slice*/ - 0, /*sq_contains*/ - 0, /*sq_inplace_concat*/ - 0, /*sq_inplace_repeat*/ -}; +/* 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)); -static PyMappingMethods __pyx_tp_as_mapping_array = { - 0, /*mp_length*/ - __pyx_array___getitem__, /*mp_subscript*/ - __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ -}; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} -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 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); -static PyTypeObject __pyx_type___pyx_array = { - PyVarObject_HEAD_INIT(0, 0) - "yt.utilities.lib.pixelization_routines.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 -}; + /* "View.MemoryView":979 + * @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; -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; -} + /* "View.MemoryView":978 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ -static void __pyx_tp_dealloc_Enum(PyObject *o) { - struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->name); - (*Py_TYPE(o)->tp_free)(o); + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -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; -} +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ -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; +/* 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 PyMethodDef __pyx_methods_Enum[] = { - {0, 0, 0, 0} -}; +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); -static PyTypeObject __pyx_type___pyx_MemviewEnum = { - PyVarObject_HEAD_INIT(0, 0) - "yt.utilities.lib.pixelization_routines.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; + /* "(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(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) -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; + /* "(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; } -static void __pyx_tp_dealloc_memoryview(PyObject *o) { - struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_memoryview___dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_CLEAR(p->obj); - Py_CLEAR(p->_size); - Py_CLEAR(p->_array_interface); - (*Py_TYPE(o)->tp_free)(o); +/* "(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 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 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); -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; -} + /* "(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(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) -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; - } -} + /* "(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__") + */ -static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o); + /* 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; } -static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o); -} +/* "View.MemoryView":985 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ -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_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); -static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o); -} + /* "View.MemoryView":993 + * 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) { -static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o); -} + /* "View.MemoryView":994 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; -static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o); -} + /* "View.MemoryView":993 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } -static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o); -} + /* "View.MemoryView":999 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __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, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; -static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o); -} + /* "View.MemoryView":1001 + * result = _memoryviewslice(None, 0, dtype_is_object) + * + * result.from_slice = memviewslice # <<<<<<<<<<<<<< + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + */ + __pyx_v_result->from_slice = __pyx_v_memviewslice; -static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o); -} + /* "View.MemoryView":1002 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); -static PyMethodDef __pyx_methods_memoryview[] = { - {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0}, - {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0}, - {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0}, - {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0}, - {0, 0, 0, 0} -}; + /* "View.MemoryView":1004 + * __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, 1004, __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; -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} -}; + /* "View.MemoryView":1005 + * + * 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; -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*/ -}; + /* "View.MemoryView":1007 + * 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; -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*/ -}; + /* "View.MemoryView":1008 + * + * 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); -static PyBufferProcs __pyx_tp_as_buffer_memoryview = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif + /* "View.MemoryView":1009 + * 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":1010 + * 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":1011 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * result.flags = PyBUF_RECORDS + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":1013 + * Py_INCREF(Py_None) + * + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1015 + * result.flags = PyBUF_RECORDS + * + * 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":1016 + * + * 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":1019 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1020 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1022 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":1023 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L5_break; + + /* "View.MemoryView":1021 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L5_break:; + + /* "View.MemoryView":1025 + * 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":1026 + * + * 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, 1026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1027 + * 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, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1029 + * 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":1030 + * + * 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":1032 + * 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":985 + * + * @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":1035 + * + * @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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1039 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1039, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1040 + * 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":1038 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1042 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1043 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1035 + * + * @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":1046 + * + * @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; + Py_ssize_t __pyx_t_4; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1050 + * 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":1051 + * + * 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":1052 + * 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":1054 + * 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":1055 + * + * 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":1057 + * 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; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_dim = __pyx_t_3; + + /* "View.MemoryView":1058 + * + * 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":1059 + * 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":1060 + * 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_4 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_4 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4; + } + + /* "View.MemoryView":1046 + * + * @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":1063 + * + * @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":1066 + * "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":1067 + * 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, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1063 + * + * @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":1070 + * + * @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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1078 + * + * 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":1079 + * 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":1077 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1081 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1082 + * 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":1084 + * 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":1086 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1070 + * + * @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":1092 + * + * + * 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":1093 + * + * 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":1094 + * 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":1093 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1096 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1092 + * + * + * 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":1099 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1104 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1105 + * 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":1107 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1108 + * + * 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":1109 + * 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":1110 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1108 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1112 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1113 + * + * 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":1114 + * 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":1115 + * 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":1113 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1117 + * 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":1118 + * + * 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":1117 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1120 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1099 + * + * @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":1123 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + + /* "View.MemoryView":1130 + * + * 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":1131 + * 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":1132 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1133 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1135 + * 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":1136 + * + * 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":1137 + * 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":1136 + * + * 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":1138 + * 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): + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + + /* "View.MemoryView":1136 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1140 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1141 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + + /* "View.MemoryView":1142 + * 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":1143 + * 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":1135 + * 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":1145 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1146 + * 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":1150 + * 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":1151 + * 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":1123 + * + * @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":1153 + * 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":1156 + * __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":1153 + * 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":1160 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1163 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1165 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1166 + * + * 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":1168 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1160 + * + * @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":1171 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1180 + * 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":1181 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "View.MemoryView":1182 + * 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":1183 + * 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":1180 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1185 + * 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 > -1L; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1186 + * 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":1187 + * 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":1189 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1171 + * + * @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":1192 + * + * @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; + + /* "View.MemoryView":1203 + * 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":1204 + * + * 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":1206 + * 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":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1208 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error) + + /* "View.MemoryView":1207 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1211 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1212 + * + * 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":1213 + * 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; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1214 + * 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":1215 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1217 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + + /* "View.MemoryView":1221 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1222 + * + * 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":1223 + * 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":1222 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1225 + * 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":1226 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + + /* "View.MemoryView":1225 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1228 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1230 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1192 + * + * @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":1235 + * + * @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":1238 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __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":1237 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 1237, __pyx_L1_error) + + /* "View.MemoryView":1235 + * + * @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":1241 + * + * @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":1242 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_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, 1242, __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, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 1242, __pyx_L1_error) + + /* "View.MemoryView":1241 + * + * @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":1245 + * + * @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":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1247 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_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, 1247, __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, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1247, __pyx_L1_error) + + /* "View.MemoryView":1246 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1249 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(2, 1249, __pyx_L1_error) + } + + /* "View.MemoryView":1245 + * + * @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":1252 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + + /* "View.MemoryView":1260 + * 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":1261 + * """ + * 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":1263 + * 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":1264 + * 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":1265 + * 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":1268 + * 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":1269 + * + * 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":1268 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1271 + * 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":1270 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1273 + * 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":1275 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1276 + * + * 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":1277 + * 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":1278 + * 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":1279 + * 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":1277 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1281 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1281, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1276 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1284 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error) + + /* "View.MemoryView":1283 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + } + } + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1289 + * + * 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":1288 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1291 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1291, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_6; + + /* "View.MemoryView":1292 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1286 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1298 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1297 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); + + /* "View.MemoryView":1299 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1302 + * 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":1304 + * 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":1305 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + + /* "View.MemoryView":1306 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1307 + * 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":1308 + * 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":1302 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1294 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_7 = (__pyx_t_2 != 0); + if (__pyx_t_7) { + + /* "View.MemoryView":1313 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error) + + /* "View.MemoryView":1314 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error) + + /* "View.MemoryView":1310 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1316 + * 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":1317 + * + * 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":1318 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1320 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1321 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1252 + * + * @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":1324 + * + * @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; + + /* "View.MemoryView":1328 + * 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":1330 + * 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 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1331 + * + * 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":1332 + * 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":1333 + * mslice.shape[i + offset] = mslice.shape[i] + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1335 + * 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; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1336 + * + * for i in range(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":1337 + * 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":1338 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1324 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1346 + * + * @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":1350 + * + * + * 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":1351 + * + * 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":1350 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1346 + * + * @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":1355 + * + * @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":1358 + * 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":1355 + * + * @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":1361 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1365 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_3 = (__pyx_v_inc != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1368 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1367 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1370 + * 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":1366 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1372 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1373 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1375 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1361 + * + * @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":1381 + * + * @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":1384 + * 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":1385 + * 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":1387 + * _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":1381 + * + * @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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "View.MemoryView":1395 + * 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":1396 + * 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":1398 + * 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":1399 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1400 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1401 + * 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":1398 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1403 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1404 + * 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":1406 + * _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":1391 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* 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 + */ + +/* 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__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] = PyDict_GetItem(__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_PickleError = NULL; + PyObject *__pyx_v_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 + * raise 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 # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * 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_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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_PickleError); + __pyx_t_2 = __pyx_v_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 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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_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 PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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 PY_VERSION_HEX >= 0x030400a1 + 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 = 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 = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + 0, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "yt.utilities.lib.pixelization_routines.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 PY_VERSION_HEX >= 0x030400a1 + 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) + "yt.utilities.lib.pixelization_routines.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 PY_VERSION_HEX >= 0x030400a1 + 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 @@ -25275,7 +29244,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -25319,6 +29288,8 @@ } 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} }; @@ -25421,12 +29392,13 @@ {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, - {&__pyx_kp_s_Cannot_scale_to_zero_size, __pyx_k_Cannot_scale_to_zero_size, sizeof(__pyx_k_Cannot_scale_to_zero_size), 0, 0, 1, 0}, + {&__pyx_kp_s_Check_to_see_that_both_starting, __pyx_k_Check_to_see_that_both_starting, sizeof(__pyx_k_Check_to_see_that_both_starting), 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}, @@ -25439,21 +29411,24 @@ {&__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_PI, __pyx_k_PI, sizeof(__pyx_k_PI), 0, 0, 1, 1}, + {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_RE, __pyx_k_RE, sizeof(__pyx_k_RE), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_kp_s_Slices_of_2D_datasets_must_be_pe, __pyx_k_Slices_of_2D_datasets_must_be_pe, sizeof(__pyx_k_Slices_of_2D_datasets_must_be_pe), 0, 0, 1, 0}, - {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 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_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 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_YTElementTypeNotRecognized, __pyx_k_YTElementTypeNotRecognized, sizeof(__pyx_k_YTElementTypeNotRecognized), 0, 0, 1, 1}, {&__pyx_n_s_YTPixelizeError, __pyx_k_YTPixelizeError, sizeof(__pyx_k_YTPixelizeError), 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_antialias, __pyx_k_antialias, sizeof(__pyx_k_antialias), 0, 0, 1, 1}, + {&__pyx_n_s_arc_length, __pyx_k_arc_length, sizeof(__pyx_k_arc_length), 0, 0, 1, 1}, {&__pyx_n_s_argmax, __pyx_k_argmax, sizeof(__pyx_k_argmax), 0, 0, 1, 1}, + {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_bounds, __pyx_k_bounds, sizeof(__pyx_k_bounds), 0, 0, 1, 1}, + {&__pyx_n_s_buff, __pyx_k_buff, sizeof(__pyx_k_buff), 0, 0, 1, 1}, {&__pyx_n_s_buff_size, __pyx_k_buff_size, sizeof(__pyx_k_buff_size), 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}, @@ -25462,10 +29437,11 @@ {&__pyx_n_s_ci, __pyx_k_ci, sizeof(__pyx_k_ci), 0, 0, 1, 1}, {&__pyx_n_s_cj, __pyx_k_cj, sizeof(__pyx_k_cj), 0, 0, 1, 1}, {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, - {&__pyx_n_s_cols, __pyx_k_cols, sizeof(__pyx_k_cols), 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_conn, __pyx_k_conn, sizeof(__pyx_k_conn), 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_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1}, {&__pyx_n_s_corners, __pyx_k_corners, sizeof(__pyx_k_corners), 0, 0, 1, 1}, {&__pyx_n_s_costheta, __pyx_k_costheta, sizeof(__pyx_k_costheta), 0, 0, 1, 1}, @@ -25476,6 +29452,7 @@ {&__pyx_n_s_cz, __pyx_k_cz, sizeof(__pyx_k_cz), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_dds, __pyx_k_dds, sizeof(__pyx_k_dds), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dphi, __pyx_k_dphi, sizeof(__pyx_k_dphi), 0, 0, 1, 1}, {&__pyx_n_s_dphi_p, __pyx_k_dphi_p, sizeof(__pyx_k_dphi_p), 0, 0, 1, 1}, {&__pyx_n_s_dr_i, __pyx_k_dr_i, sizeof(__pyx_k_dr_i), 0, 0, 1, 1}, @@ -25493,6 +29470,7 @@ {&__pyx_n_s_dysp, __pyx_k_dysp, sizeof(__pyx_k_dysp), 0, 0, 1, 1}, {&__pyx_n_s_dzsp, __pyx_k_dzsp, sizeof(__pyx_k_dzsp), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_end_point, __pyx_k_end_point, sizeof(__pyx_k_end_point), 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_extents, __pyx_k_extents, sizeof(__pyx_k_extents), 0, 0, 1, 1}, @@ -25509,9 +29487,12 @@ {&__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_idds, __pyx_k_idds, sizeof(__pyx_k_idds), 0, 0, 1, 1}, + {&__pyx_n_s_ii, __pyx_k_ii, sizeof(__pyx_k_ii), 0, 0, 1, 1}, {&__pyx_n_s_imax, __pyx_k_imax, sizeof(__pyx_k_imax), 0, 0, 1, 1}, {&__pyx_n_s_img, __pyx_k_img, sizeof(__pyx_k_img), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_inc_length, __pyx_k_inc_length, sizeof(__pyx_k_inc_length), 0, 0, 1, 1}, + {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1}, {&__pyx_n_s_index_offset, __pyx_k_index_offset, sizeof(__pyx_k_index_offset), 0, 0, 1, 1}, {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1}, {&__pyx_n_s_input_img, __pyx_k_input_img, sizeof(__pyx_k_input_img), 0, 0, 1, 1}, @@ -25523,9 +29504,17 @@ {&__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_jj, __pyx_k_jj, sizeof(__pyx_k_jj), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_kk, __pyx_k_kk, sizeof(__pyx_k_kk), 0, 0, 1, 1}, {&__pyx_n_s_lc, __pyx_k_lc, sizeof(__pyx_k_lc), 0, 0, 1, 1}, {&__pyx_n_s_ld_x, __pyx_k_ld_x, sizeof(__pyx_k_ld_x), 0, 0, 1, 1}, {&__pyx_n_s_ld_y, __pyx_k_ld_y, sizeof(__pyx_k_ld_y), 0, 0, 1, 1}, + {&__pyx_n_s_lin_inc, __pyx_k_lin_inc, sizeof(__pyx_k_lin_inc), 0, 0, 1, 1}, + {&__pyx_n_s_lin_length, __pyx_k_lin_length, sizeof(__pyx_k_lin_length), 0, 0, 1, 1}, + {&__pyx_n_s_lin_sample_points, __pyx_k_lin_sample_points, sizeof(__pyx_k_lin_sample_points), 0, 0, 1, 1}, + {&__pyx_n_s_lin_vec, __pyx_k_lin_vec, sizeof(__pyx_k_lin_vec), 0, 0, 1, 1}, + {&__pyx_n_s_linalg, __pyx_k_linalg, sizeof(__pyx_k_linalg), 0, 0, 1, 1}, {&__pyx_n_s_line_width, __pyx_k_line_width, sizeof(__pyx_k_line_width), 0, 0, 1, 1}, {&__pyx_n_s_lr, __pyx_k_lr, sizeof(__pyx_k_lr), 0, 0, 1, 1}, {&__pyx_n_s_lxpx, __pyx_k_lxpx, sizeof(__pyx_k_lxpx), 0, 0, 1, 1}, @@ -25536,7 +29525,6 @@ {&__pyx_n_s_md, __pyx_k_md, sizeof(__pyx_k_md), 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_my_array, __pyx_k_my_array, sizeof(__pyx_k_my_array), 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}, @@ -25544,9 +29532,15 @@ {&__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_nf, __pyx_k_nf, sizeof(__pyx_k_nf), 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_npoints, __pyx_k_npoints, sizeof(__pyx_k_npoints), 0, 0, 1, 1}, {&__pyx_n_s_num_field_vals, __pyx_k_num_field_vals, sizeof(__pyx_k_num_field_vals), 0, 0, 1, 1}, + {&__pyx_n_s_num_intervals, __pyx_k_num_intervals, sizeof(__pyx_k_num_intervals), 0, 0, 1, 1}, + {&__pyx_n_s_num_plot_nodes, __pyx_k_num_plot_nodes, sizeof(__pyx_k_num_plot_nodes), 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}, @@ -25556,6 +29550,7 @@ {&__pyx_n_s_overlap2, __pyx_k_overlap2, sizeof(__pyx_k_overlap2), 0, 0, 1, 1}, {&__pyx_n_s_oxsp, __pyx_k_oxsp, sizeof(__pyx_k_oxsp), 0, 0, 1, 1}, {&__pyx_n_s_oysp, __pyx_k_oysp, sizeof(__pyx_k_oysp), 0, 0, 1, 1}, + {&__pyx_n_s_ozsp, __pyx_k_ozsp, sizeof(__pyx_k_ozsp), 0, 0, 1, 1}, {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, {&__pyx_n_s_pLE, __pyx_k_pLE, sizeof(__pyx_k_pLE), 0, 0, 1, 1}, {&__pyx_n_s_pRE, __pyx_k_pRE, sizeof(__pyx_k_pRE), 0, 0, 1, 1}, @@ -25572,13 +29567,17 @@ {&__pyx_n_s_phi_offset, __pyx_k_phi_offset, sizeof(__pyx_k_phi_offset), 0, 0, 1, 1}, {&__pyx_n_s_phi_p, __pyx_k_phi_p, sizeof(__pyx_k_phi_p), 0, 0, 1, 1}, {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_pixelize_aitoff, __pyx_k_pixelize_aitoff, sizeof(__pyx_k_pixelize_aitoff), 0, 0, 1, 1}, {&__pyx_n_s_pixelize_cartesian, __pyx_k_pixelize_cartesian, sizeof(__pyx_k_pixelize_cartesian), 0, 0, 1, 1}, + {&__pyx_n_s_pixelize_cartesian_nodal, __pyx_k_pixelize_cartesian_nodal, sizeof(__pyx_k_pixelize_cartesian_nodal), 0, 0, 1, 1}, {&__pyx_n_s_pixelize_cylinder, __pyx_k_pixelize_cylinder, sizeof(__pyx_k_pixelize_cylinder), 0, 0, 1, 1}, {&__pyx_n_s_pixelize_element_mesh, __pyx_k_pixelize_element_mesh, sizeof(__pyx_k_pixelize_element_mesh), 0, 0, 1, 1}, + {&__pyx_n_s_pixelize_element_mesh_line, __pyx_k_pixelize_element_mesh_line, sizeof(__pyx_k_pixelize_element_mesh_line), 0, 0, 1, 1}, {&__pyx_n_s_pixelize_off_axis_cartesian, __pyx_k_pixelize_off_axis_cartesian, sizeof(__pyx_k_pixelize_off_axis_cartesian), 0, 0, 1, 1}, {&__pyx_n_s_pj, __pyx_k_pj, sizeof(__pyx_k_pj), 0, 0, 1, 1}, {&__pyx_n_s_pk, __pyx_k_pk, sizeof(__pyx_k_pk), 0, 0, 1, 1}, + {&__pyx_n_s_plot_values, __pyx_k_plot_values, sizeof(__pyx_k_plot_values), 0, 0, 1, 1}, {&__pyx_n_s_ppoint, __pyx_k_ppoint, sizeof(__pyx_k_ppoint), 0, 0, 1, 1}, {&__pyx_n_s_pstart, __pyx_k_pstart, sizeof(__pyx_k_pstart), 0, 0, 1, 1}, {&__pyx_n_s_px, __pyx_k_px, sizeof(__pyx_k_px), 0, 0, 1, 1}, @@ -25587,30 +29586,40 @@ {&__pyx_n_s_pxsp, __pyx_k_pxsp, sizeof(__pyx_k_pxsp), 0, 0, 1, 1}, {&__pyx_n_s_py, __pyx_k_py, sizeof(__pyx_k_py), 0, 0, 1, 1}, {&__pyx_n_s_pysp, __pyx_k_pysp, sizeof(__pyx_k_pysp), 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_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_pz, __pyx_k_pz, sizeof(__pyx_k_pz), 0, 0, 1, 1}, {&__pyx_n_s_r0, __pyx_k_r0, sizeof(__pyx_k_r0), 0, 0, 1, 1}, {&__pyx_n_s_r_i, __pyx_k_r_i, sizeof(__pyx_k_r_i), 0, 0, 1, 1}, {&__pyx_n_s_radius, __pyx_k_radius, sizeof(__pyx_k_radius), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rbounds, __pyx_k_rbounds, sizeof(__pyx_k_rbounds), 0, 0, 1, 1}, {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 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_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_rmax, __pyx_k_rmax, sizeof(__pyx_k_rmax), 0, 0, 1, 1}, - {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1}, {&__pyx_n_s_rr, __pyx_k_rr, sizeof(__pyx_k_rr), 0, 0, 1, 1}, {&__pyx_n_s_rxpx, __pyx_k_rxpx, sizeof(__pyx_k_rxpx), 0, 0, 1, 1}, {&__pyx_n_s_rypx, __pyx_k_rypx, sizeof(__pyx_k_rypx), 0, 0, 1, 1}, {&__pyx_n_s_s2, __pyx_k_s2, sizeof(__pyx_k_s2), 0, 0, 1, 1}, + {&__pyx_n_s_sample_point, __pyx_k_sample_point, sizeof(__pyx_k_sample_point), 0, 0, 1, 1}, {&__pyx_n_s_sampler, __pyx_k_sampler, sizeof(__pyx_k_sampler), 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_sintheta, __pyx_k_sintheta, sizeof(__pyx_k_sintheta), 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_start_point, __pyx_k_start_point, sizeof(__pyx_k_start_point), 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_theta, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 0, 1, 1}, @@ -25622,6 +29631,7 @@ {&__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}, {&__pyx_n_s_use, __pyx_k_use, sizeof(__pyx_k_use), 0, 0, 1, 1}, {&__pyx_n_s_vertices, __pyx_k_vertices, sizeof(__pyx_k_vertices), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, @@ -25648,7 +29658,8 @@ {&__pyx_n_s_ymin, __pyx_k_ymin, sizeof(__pyx_k_ymin), 0, 0, 1, 1}, {&__pyx_n_s_ysp, __pyx_k_ysp, sizeof(__pyx_k_ysp), 0, 0, 1, 1}, {&__pyx_n_s_yt_utilities_exceptions, __pyx_k_yt_utilities_exceptions, sizeof(__pyx_k_yt_utilities_exceptions), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_pixelization_ro, __pyx_k_yt_utilities_lib_pixelization_ro, sizeof(__pyx_k_yt_utilities_lib_pixelization_ro), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_pixelization_ro, __pyx_k_yt_utilities_lib_pixelization_ro, sizeof(__pyx_k_yt_utilities_lib_pixelization_ro), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_pixelization_ro_2, __pyx_k_yt_utilities_lib_pixelization_ro_2, sizeof(__pyx_k_yt_utilities_lib_pixelization_ro_2), 0, 0, 1, 1}, {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, {&__pyx_n_s_zb, __pyx_k_zb, sizeof(__pyx_k_zb), 0, 0, 1, 1}, {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, @@ -25656,14 +29667,14 @@ {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, 122, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 603, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 961, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 425, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error) return 0; @@ -25675,82 +29686,71 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "yt/utilities/lib/pixelization_routines.pyx":94 - * ipx_dy = 1.0 / px_dy - * if rows == 0 or cols == 0: - * raise YTPixelizeError("Cannot scale to zero size") # <<<<<<<<<<<<<< - * if px.shape[0] != py.shape[0] or \ - * px.shape[0] != pdx.shape[0] or \ + /* "yt/utilities/lib/pixelization_routines.pyx":101 + * px.shape[0] != pdy.shape[0] or \ + * px.shape[0] != data.shape[0]: + * raise YTPixelizeError("Arrays are not of correct shape.") # <<<<<<<<<<<<<< + * xiter[0] = yiter[0] = 0 + * xiterv[0] = yiterv[0] = 0.0 */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Cannot_scale_to_zero_size); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Arrays_are_not_of_correct_shape); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "yt/utilities/lib/pixelization_routines.pyx":99 - * px.shape[0] != pdy.shape[0] or \ + /* "yt/utilities/lib/pixelization_routines.pyx":285 + * px.shape[0] != pdz.shape[0] or \ * px.shape[0] != data.shape[0]: * raise YTPixelizeError("Arrays are not of correct shape.") # <<<<<<<<<<<<<< - * my_array = np.zeros((rows, cols), "float64") * xiter[0] = yiter[0] = 0 + * xiterv[0] = yiterv[0] = 0.0 */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Arrays_are_not_of_correct_shape); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Arrays_are_not_of_correct_shape); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "yt/utilities/lib/pixelization_routines.pyx":245 - * ipx_dy = 1.0 / px_dy - * if rows == 0 or cols == 0: - * raise YTPixelizeError("Cannot scale to zero size") # <<<<<<<<<<<<<< - * if px.shape[0] != py.shape[0] or \ - * px.shape[0] != pdx.shape[0] or \ - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Cannot_scale_to_zero_size); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "yt/utilities/lib/pixelization_routines.pyx":252 + /* "yt/utilities/lib/pixelization_routines.pyx":441 * px.shape[0] != indices.shape[0] or \ * px.shape[0] != data.shape[0]: * raise YTPixelizeError("Arrays are not of correct shape.") # <<<<<<<<<<<<<< - * my_array = np.zeros((rows, cols), "float64") - * mask = np.zeros((rows, cols), "int64") - */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Arrays_are_not_of_correct_shape); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - - /* "yt/utilities/lib/pixelization_routines.pyx":318 - * if input_img is None: - * img = np.zeros((buff_size[0], buff_size[1])) - * img[:] = np.nan # <<<<<<<<<<<<<< - * else: - * img = input_img + * mask = np.zeros((buff.shape[0], buff.shape[1]), "int64") + * with nogil: */ - __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__5); - __Pyx_GIVEREF(__pyx_slice__5); + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Arrays_are_not_of_correct_shape); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); - /* "yt/utilities/lib/pixelization_routines.pyx":418 + /* "yt/utilities/lib/pixelization_routines.pyx":597 * if input_img is None: * img = np.zeros((buff_size[0], buff_size[1])) * img[:] = np.nan # <<<<<<<<<<<<<< * else: * img = input_img */ - __pyx_slice__6 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__6)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__6); - __Pyx_GIVEREF(__pyx_slice__6); + __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); - /* "yt/utilities/lib/pixelization_routines.pyx":603 + /* "yt/utilities/lib/pixelization_routines.pyx":790 * if ndim == 2: * if buff_size[2] != 1: * raise RuntimeError("Slices of 2D datasets must be " # <<<<<<<<<<<<<< * "perpendicular to the 'z' direction.") * */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Slices_of_2D_datasets_must_be_pe); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Slices_of_2D_datasets_must_be_pe); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "yt/utilities/lib/pixelization_routines.pyx":961 + * continue + * elif not sampler.check_inside(mapped_coord): + * raise ValueError("Check to see that both starting and ending line points " # <<<<<<<<<<<<<< + * "are within the domain of the mesh.") + * plot_values[i] = sampler.sample_at_unit_point(mapped_coord, field_vals) + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Check_to_see_that_both_starting); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 961, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -25759,9 +29759,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -25770,9 +29770,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -25781,9 +29781,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -25792,9 +29792,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -25803,9 +29803,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -25814,9 +29814,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -25825,9 +29825,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -25836,18 +29836,18 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); /* "View.MemoryView":131 * @@ -25856,9 +29856,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); /* "View.MemoryView":134 * @@ -25867,9 +29867,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "View.MemoryView":137 * @@ -25878,9 +29878,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "View.MemoryView":146 * @@ -25889,9 +29889,9 @@ * * */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -25900,9 +29900,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -25911,10 +29911,29 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 190, __pyx_L1_error) + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "(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__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); + /* "(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__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: @@ -25922,9 +29941,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -25933,9 +29952,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "View.MemoryView":563 * def suboffsets(self): @@ -25944,12 +29963,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__25 = PyTuple_New(1); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); + __pyx_tuple__26 = PyTuple_New(1); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__25, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__25); + PyTuple_SET_ITEM(__pyx_tuple__26, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "(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__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "(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__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "View.MemoryView":668 * if item is Ellipsis: @@ -25958,9 +29996,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(2, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__26); - __Pyx_GIVEREF(__pyx_slice__26); + __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(2, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); /* "View.MemoryView":671 * seen_ellipsis = True @@ -25969,9 +30007,9 @@ * have_slices = True * else: */ - __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(2, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__27); - __Pyx_GIVEREF(__pyx_slice__27); + __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(2, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__30); + __Pyx_GIVEREF(__pyx_slice__30); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -25980,9 +30018,9 @@ * * return have_slices or nslices, tuple(result) */ - __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(2, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__28); - __Pyx_GIVEREF(__pyx_slice__28); + __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(2, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__31); + __Pyx_GIVEREF(__pyx_slice__31); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -25991,69 +30029,112 @@ * * */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __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(2, 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(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "yt/utilities/lib/pixelization_routines.pyx":59 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pixelize_cartesian(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] px, + * np.float64_t[:] py, + */ + __pyx_tuple__35 = PyTuple_Pack(53, __pyx_n_s_buff, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pdx, __pyx_n_s_pdy, __pyx_n_s_data, __pyx_n_s_bounds, __pyx_n_s_antialias, __pyx_n_s_period, __pyx_n_s_check_period, __pyx_n_s_line_width, __pyx_n_s_x_min, __pyx_n_s_x_max, __pyx_n_s_y_min, __pyx_n_s_y_max, __pyx_n_s_period_x, __pyx_n_s_period_y, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_px_dx, __pyx_n_s_px_dy, __pyx_n_s_ipx_dx, __pyx_n_s_ipx_dy, __pyx_n_s_ld_x, __pyx_n_s_ld_y, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_p, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_lc, __pyx_n_s_lr, __pyx_n_s_rc, __pyx_n_s_rr, __pyx_n_s_lypx, __pyx_n_s_rypx, __pyx_n_s_lxpx, __pyx_n_s_rxpx, __pyx_n_s_overlap1, __pyx_n_s_overlap2, __pyx_n_s_oxsp, __pyx_n_s_oysp, __pyx_n_s_xsp, __pyx_n_s_ysp, __pyx_n_s_dxsp, __pyx_n_s_dysp, __pyx_n_s_dsp, __pyx_n_s_xiter, __pyx_n_s_yiter, __pyx_n_s_xiterv, __pyx_n_s_yiterv); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(11, 0, 53, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_pixelization_ro, __pyx_n_s_pixelize_cartesian, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 59, __pyx_L1_error) - /* "yt/utilities/lib/pixelization_routines.pyx":55 + /* "yt/utilities/lib/pixelization_routines.pyx":236 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_cartesian(np.ndarray[np.float64_t, ndim=1] px, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] py, - * np.ndarray[np.float64_t, ndim=1] pdx, - */ - __pyx_tuple__30 = PyTuple_Pack(55, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pdx, __pyx_n_s_pdy, __pyx_n_s_data, __pyx_n_s_cols, __pyx_n_s_rows, __pyx_n_s_bounds, __pyx_n_s_antialias, __pyx_n_s_period, __pyx_n_s_check_period, __pyx_n_s_line_width, __pyx_n_s_x_min, __pyx_n_s_x_max, __pyx_n_s_y_min, __pyx_n_s_y_max, __pyx_n_s_period_x, __pyx_n_s_period_y, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_px_dx, __pyx_n_s_px_dy, __pyx_n_s_ipx_dx, __pyx_n_s_ipx_dy, __pyx_n_s_ld_x, __pyx_n_s_ld_y, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_p, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_lc, __pyx_n_s_lr, __pyx_n_s_rc, __pyx_n_s_rr, __pyx_n_s_lypx, __pyx_n_s_rypx, __pyx_n_s_lxpx, __pyx_n_s_rxpx, __pyx_n_s_overlap1, __pyx_n_s_overlap2, __pyx_n_s_oxsp, __pyx_n_s_oysp, __pyx_n_s_xsp, __pyx_n_s_ysp, __pyx_n_s_dxsp, __pyx_n_s_dysp, __pyx_n_s_dsp, __pyx_n_s_xiter, __pyx_n_s_yiter, __pyx_n_s_xiterv, __pyx_n_s_yiterv, __pyx_n_s_my_array); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); - __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(12, 0, 55, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_pixelize_cartesian, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 55, __pyx_L1_error) + * def pixelize_cartesian_nodal(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] px, + * np.float64_t[:] py, + */ + __pyx_tuple__37 = PyTuple_Pack(62, __pyx_n_s_buff, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pz, __pyx_n_s_pdx, __pyx_n_s_pdy, __pyx_n_s_pdz, __pyx_n_s_data, __pyx_n_s_coord, __pyx_n_s_bounds, __pyx_n_s_antialias, __pyx_n_s_period, __pyx_n_s_check_period, __pyx_n_s_x_min, __pyx_n_s_x_max, __pyx_n_s_y_min, __pyx_n_s_y_max, __pyx_n_s_period_x, __pyx_n_s_period_y, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_px_dx, __pyx_n_s_px_dy, __pyx_n_s_ipx_dx, __pyx_n_s_ipx_dy, __pyx_n_s_ld_x, __pyx_n_s_ld_y, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_cz, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_p, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_lc, __pyx_n_s_lr, __pyx_n_s_rc, __pyx_n_s_rr, __pyx_n_s_lypx, __pyx_n_s_rypx, __pyx_n_s_lxpx, __pyx_n_s_rxpx, __pyx_n_s_overlap1, __pyx_n_s_overlap2, __pyx_n_s_oxsp, __pyx_n_s_oysp, __pyx_n_s_ozsp, __pyx_n_s_xsp, __pyx_n_s_ysp, __pyx_n_s_zsp, __pyx_n_s_dxsp, __pyx_n_s_dysp, __pyx_n_s_dzsp, __pyx_n_s_xiter, __pyx_n_s_yiter, __pyx_n_s_ii, __pyx_n_s_jj, __pyx_n_s_kk, __pyx_n_s_ind, __pyx_n_s_xiterv, __pyx_n_s_yiterv); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(13, 0, 62, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_pixelization_ro, __pyx_n_s_pixelize_cartesian_nodal, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 236, __pyx_L1_error) - /* "yt/utilities/lib/pixelization_routines.pyx":210 + /* "yt/utilities/lib/pixelization_routines.pyx":401 * @cython.boundscheck(False) * @cython.wraparound(False) * def pixelize_off_axis_cartesian( # <<<<<<<<<<<<<< + * np.float64_t[:,:] buff, * np.float64_t[:] x, - * np.float64_t[:] y, */ - __pyx_tuple__32 = PyTuple_Pack(50, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pdx, __pyx_n_s_pdy, __pyx_n_s_pdz, __pyx_n_s_center, __pyx_n_s_inv_mat, __pyx_n_s_indices, __pyx_n_s_data, __pyx_n_s_cols, __pyx_n_s_rows, __pyx_n_s_bounds, __pyx_n_s_x_min, __pyx_n_s_x_max, __pyx_n_s_y_min, __pyx_n_s_y_max, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_px_dx, __pyx_n_s_px_dy, __pyx_n_s_ipx_dx, __pyx_n_s_ipx_dy, __pyx_n_s_md, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_p, __pyx_n_s_ip, __pyx_n_s_lc, __pyx_n_s_lr, __pyx_n_s_rc, __pyx_n_s_rr, __pyx_n_s_xsp, __pyx_n_s_ysp, __pyx_n_s_zsp, __pyx_n_s_dxsp, __pyx_n_s_dysp, __pyx_n_s_dzsp, __pyx_n_s_dsp, __pyx_n_s_pxsp, __pyx_n_s_pysp, __pyx_n_s_cxpx, __pyx_n_s_cypx, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_cz, __pyx_n_s_my_array, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(15, 0, 50, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_pixelize_off_axis_cartesian, 210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_tuple__39 = PyTuple_Pack(48, __pyx_n_s_buff, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_pdx, __pyx_n_s_pdy, __pyx_n_s_pdz, __pyx_n_s_center, __pyx_n_s_inv_mat, __pyx_n_s_indices, __pyx_n_s_data, __pyx_n_s_bounds, __pyx_n_s_x_min, __pyx_n_s_x_max, __pyx_n_s_y_min, __pyx_n_s_y_max, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_px_dx, __pyx_n_s_px_dy, __pyx_n_s_ipx_dx, __pyx_n_s_ipx_dy, __pyx_n_s_md, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_p, __pyx_n_s_ip, __pyx_n_s_lc, __pyx_n_s_lr, __pyx_n_s_rc, __pyx_n_s_rr, __pyx_n_s_xsp, __pyx_n_s_ysp, __pyx_n_s_zsp, __pyx_n_s_dxsp, __pyx_n_s_dysp, __pyx_n_s_dzsp, __pyx_n_s_dsp, __pyx_n_s_pxsp, __pyx_n_s_pysp, __pyx_n_s_cxpx, __pyx_n_s_cypx, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_cz, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(14, 0, 48, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_pixelization_ro, __pyx_n_s_pixelize_off_axis_cartesian, 401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 401, __pyx_L1_error) - /* "yt/utilities/lib/pixelization_routines.pyx":298 + /* "yt/utilities/lib/pixelization_routines.pyx":487 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_cylinder(np.ndarray[np.float64_t, ndim=1] radius, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] dradius, - * np.ndarray[np.float64_t, ndim=1] theta, + * def pixelize_cylinder(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] radius, + * np.float64_t[:] dradius, */ - __pyx_tuple__34 = PyTuple_Pack(33, __pyx_n_s_radius, __pyx_n_s_dradius, __pyx_n_s_theta, __pyx_n_s_dtheta, __pyx_n_s_buff_size, __pyx_n_s_field, __pyx_n_s_extents, __pyx_n_s_input_img, __pyx_n_s_img, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_r0, __pyx_n_s_theta0, __pyx_n_s_rmax, __pyx_n_s_x0, __pyx_n_s_y0, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_r_i, __pyx_n_s_theta_i, __pyx_n_s_dr_i, __pyx_n_s_dtheta_i, __pyx_n_s_dthetamin, __pyx_n_s_costheta, __pyx_n_s_sintheta, __pyx_n_s_i, __pyx_n_s_pi, __pyx_n_s_pj, __pyx_n_s_imax, __pyx_n_s_rbounds, __pyx_n_s_corners); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 298, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(8, 0, 33, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_pixelize_cylinder, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_tuple__41 = PyTuple_Pack(31, __pyx_n_s_buff, __pyx_n_s_radius, __pyx_n_s_dradius, __pyx_n_s_theta, __pyx_n_s_dtheta, __pyx_n_s_field, __pyx_n_s_extents, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_r0, __pyx_n_s_theta0, __pyx_n_s_rmax, __pyx_n_s_x0, __pyx_n_s_y0, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_r_i, __pyx_n_s_theta_i, __pyx_n_s_dr_i, __pyx_n_s_dtheta_i, __pyx_n_s_dthetamin, __pyx_n_s_costheta, __pyx_n_s_sintheta, __pyx_n_s_i, __pyx_n_s_pi, __pyx_n_s_pj, __pyx_n_s_imax, __pyx_n_s_rbounds, __pyx_n_s_corners); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(7, 0, 31, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_pixelization_ro, __pyx_n_s_pixelize_cylinder, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 487, __pyx_L1_error) - /* "yt/utilities/lib/pixelization_routines.pyx":391 + /* "yt/utilities/lib/pixelization_routines.pyx":570 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_aitoff(np.ndarray[np.float64_t, ndim=1] theta, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] dtheta, - * np.ndarray[np.float64_t, ndim=1] phi, - */ - __pyx_tuple__36 = PyTuple_Pack(37, __pyx_n_s_theta, __pyx_n_s_dtheta, __pyx_n_s_phi, __pyx_n_s_dphi, __pyx_n_s_buff_size, __pyx_n_s_field, __pyx_n_s_extents, __pyx_n_s_input_img, __pyx_n_s_theta_offset, __pyx_n_s_phi_offset, __pyx_n_s_img, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nf, __pyx_n_s_fi, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_zb, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_theta0, __pyx_n_s_phi0, __pyx_n_s_theta_p, __pyx_n_s_dtheta_p, __pyx_n_s_phi_p, __pyx_n_s_dphi_p, __pyx_n_s_PI, __pyx_n_s_s2, __pyx_n_s_xmax, __pyx_n_s_ymax, __pyx_n_s_xmin, __pyx_n_s_ymin, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_y0, __pyx_n_s_y1); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); - __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(10, 0, 37, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_pixelize_aitoff, 391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 391, __pyx_L1_error) + * def pixelize_aitoff(np.float64_t[:] theta, # <<<<<<<<<<<<<< + * np.float64_t[:] dtheta, + * np.float64_t[:] phi, + */ + __pyx_tuple__43 = PyTuple_Pack(37, __pyx_n_s_theta, __pyx_n_s_dtheta, __pyx_n_s_phi, __pyx_n_s_dphi, __pyx_n_s_buff_size, __pyx_n_s_field, __pyx_n_s_extents, __pyx_n_s_input_img, __pyx_n_s_theta_offset, __pyx_n_s_phi_offset, __pyx_n_s_img, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nf, __pyx_n_s_fi, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_zb, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_theta0, __pyx_n_s_phi0, __pyx_n_s_theta_p, __pyx_n_s_dtheta_p, __pyx_n_s_phi_p, __pyx_n_s_dphi_p, __pyx_n_s_PI, __pyx_n_s_s2, __pyx_n_s_xmax, __pyx_n_s_ymax, __pyx_n_s_xmin, __pyx_n_s_ymin, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_y0, __pyx_n_s_y1); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(10, 0, 37, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_pixelization_ro, __pyx_n_s_pixelize_aitoff, 570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 570, __pyx_L1_error) - /* "yt/utilities/lib/pixelization_routines.pyx":550 + /* "yt/utilities/lib/pixelization_routines.pyx":729 * * * def pixelize_element_mesh(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=2] conn, * buff_size, */ - __pyx_tuple__38 = PyTuple_Pack(31, __pyx_n_s_coords, __pyx_n_s_conn, __pyx_n_s_buff_size, __pyx_n_s_field, __pyx_n_s_extents, __pyx_n_s_index_offset, __pyx_n_s_img, __pyx_n_s_pLE, __pyx_n_s_pRE, __pyx_n_s_LE, __pyx_n_s_RE, __pyx_n_s_use, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_pi, __pyx_n_s_pj, __pyx_n_s_pk, __pyx_n_s_ci, __pyx_n_s_cj, __pyx_n_s_pstart, __pyx_n_s_pend, __pyx_n_s_ppoint, __pyx_n_s_idds, __pyx_n_s_dds, __pyx_n_s_vertices, __pyx_n_s_field_vals, __pyx_n_s_nvertices, __pyx_n_s_ndim, __pyx_n_s_num_field_vals, __pyx_n_s_mapped_coord, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(6, 0, 31, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_pixelize_element_mesh, 550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_tuple__45 = PyTuple_Pack(31, __pyx_n_s_coords, __pyx_n_s_conn, __pyx_n_s_buff_size, __pyx_n_s_field, __pyx_n_s_extents, __pyx_n_s_index_offset, __pyx_n_s_img, __pyx_n_s_pLE, __pyx_n_s_pRE, __pyx_n_s_LE, __pyx_n_s_RE, __pyx_n_s_use, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_pi, __pyx_n_s_pj, __pyx_n_s_pk, __pyx_n_s_ci, __pyx_n_s_cj, __pyx_n_s_pstart, __pyx_n_s_pend, __pyx_n_s_ppoint, __pyx_n_s_idds, __pyx_n_s_dds, __pyx_n_s_vertices, __pyx_n_s_field_vals, __pyx_n_s_nvertices, __pyx_n_s_ndim, __pyx_n_s_num_field_vals, __pyx_n_s_mapped_coord, __pyx_n_s_sampler); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(6, 0, 31, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_pixelization_ro, __pyx_n_s_pixelize_element_mesh, 729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 729, __pyx_L1_error) + + /* "yt/utilities/lib/pixelization_routines.pyx":866 + * return img + * + * def pixelize_element_mesh_line(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< + * np.ndarray[np.int64_t, ndim=2] conn, + * np.ndarray[np.float64_t, ndim=1] start_point, + */ + __pyx_tuple__47 = PyTuple_Pack(30, __pyx_n_s_coords, __pyx_n_s_conn, __pyx_n_s_start_point, __pyx_n_s_end_point, __pyx_n_s_npoints, __pyx_n_s_field, __pyx_n_s_index_offset, __pyx_n_s_vertices, __pyx_n_s_field_vals, __pyx_n_s_nvertices, __pyx_n_s_ndim, __pyx_n_s_num_field_vals, __pyx_n_s_num_plot_nodes, __pyx_n_s_num_intervals, __pyx_n_s_mapped_coord, __pyx_n_s_sampler, __pyx_n_s_lin_vec, __pyx_n_s_lin_inc, __pyx_n_s_lin_sample_points, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_arc_length, __pyx_n_s_lin_length, __pyx_n_s_inc_length, __pyx_n_s_plot_values, __pyx_n_s_sample_point, __pyx_n_s_ci, __pyx_n_s_cj); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(7, 0, 30, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_pixelization_ro, __pyx_n_s_pixelize_element_mesh_line, 866, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 866, __pyx_L1_error) /* "View.MemoryView":282 * return self.name @@ -26062,9 +30143,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); /* "View.MemoryView":283 * @@ -26073,9 +30154,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -26084,9 +30165,9 @@ * * */ - __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(2, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); /* "View.MemoryView":287 * @@ -26095,9 +30176,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); /* "View.MemoryView":288 * @@ -26106,9 +30187,19 @@ * * */ - __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -26120,6 +30211,7 @@ 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_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:; @@ -26184,6 +30276,7 @@ __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 @@ -26222,9 +30315,11 @@ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __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; @@ -26237,6 +30332,7 @@ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; @@ -26246,6 +30342,7 @@ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -26262,22 +30359,30 @@ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler = __Pyx_ImportType("yt.utilities.lib.element_mappings", "ElementSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_ElementSampler), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler)) __PYX_ERR(4, 7, __pyx_L1_error) __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_ElementSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_ElementSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_ElementSampler)) __PYX_ERR(4, 7, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "P1Sampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)) __PYX_ERR(4, 36, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)) __PYX_ERR(4, 36, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "P1Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)) __PYX_ERR(4, 51, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)) __PYX_ERR(4, 51, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "NonlinearSolveSampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)) __PYX_ERR(4, 129, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)) __PYX_ERR(4, 129, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "Q1Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)) __PYX_ERR(4, 143, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)) __PYX_ERR(4, 143, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "W1Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)) __PYX_ERR(4, 160, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_W1Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)) __PYX_ERR(4, 160, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "S2Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)) __PYX_ERR(4, 178, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_S2Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)) __PYX_ERR(4, 178, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "NonlinearSolveSampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)) __PYX_ERR(4, 196, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)) __PYX_ERR(4, 196, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "Q1Sampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)) __PYX_ERR(4, 210, __pyx_L1_error) - __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)) __PYX_ERR(4, 210, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "P1Sampler1D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler1D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D)) __PYX_ERR(4, 36, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler1D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler1D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler1D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler1D)) __PYX_ERR(4, 36, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "P1Sampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)) __PYX_ERR(4, 51, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler2D)) __PYX_ERR(4, 51, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "P1Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_P1Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)) __PYX_ERR(4, 66, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_P1Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_P1Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_P1Sampler3D)) __PYX_ERR(4, 66, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "NonlinearSolveSampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)) __PYX_ERR(4, 145, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler3D)) __PYX_ERR(4, 145, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "Q1Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)) __PYX_ERR(4, 159, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler3D)) __PYX_ERR(4, 159, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "W1Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_W1Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)) __PYX_ERR(4, 176, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_W1Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_W1Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_W1Sampler3D)) __PYX_ERR(4, 176, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "S2Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_S2Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)) __PYX_ERR(4, 194, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_S2Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_S2Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_S2Sampler3D)) __PYX_ERR(4, 194, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "NonlinearSolveSampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)) __PYX_ERR(4, 212, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_NonlinearSolveSampler2D)) __PYX_ERR(4, 212, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "Q1Sampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q1Sampler2D)) __PYX_ERR(4, 226, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "Q2Sampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D)) __PYX_ERR(4, 241, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Q2Sampler2D)) __PYX_ERR(4, 241, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "T2Sampler2D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_T2Sampler2D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D)) __PYX_ERR(4, 256, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_T2Sampler2D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_T2Sampler2D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_T2Sampler2D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_T2Sampler2D)) __PYX_ERR(4, 256, __pyx_L1_error) + __pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D = __Pyx_ImportType("yt.utilities.lib.element_mappings", "Tet2Sampler3D", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D), 1); if (unlikely(!__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D)) __PYX_ERR(4, 270, __pyx_L1_error) + __pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16element_mappings_Tet2Sampler3D)) __PYX_ERR(4, 270, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -26333,64 +30438,88 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/pixelization_routines.pyx":55 + /* "yt/utilities/lib/pixelization_routines.pyx":59 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pixelize_cartesian(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] px, + * np.float64_t[:] py, + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_1pixelize_cartesian, NULL, __pyx_n_s_yt_utilities_lib_pixelization_ro_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_cartesian, __pyx_t_2) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/pixelization_routines.pyx":236 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_cartesian(np.ndarray[np.float64_t, ndim=1] px, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] py, - * np.ndarray[np.float64_t, ndim=1] pdx, + * def pixelize_cartesian_nodal(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] px, + * np.float64_t[:] py, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_1pixelize_cartesian, NULL, __pyx_n_s_yt_utilities_lib_pixelization_ro); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_3pixelize_cartesian_nodal, NULL, __pyx_n_s_yt_utilities_lib_pixelization_ro_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_cartesian, __pyx_t_2) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_cartesian_nodal, __pyx_t_2) < 0) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/pixelization_routines.pyx":210 + /* "yt/utilities/lib/pixelization_routines.pyx":401 * @cython.boundscheck(False) * @cython.wraparound(False) * def pixelize_off_axis_cartesian( # <<<<<<<<<<<<<< + * np.float64_t[:,:] buff, * np.float64_t[:] x, - * np.float64_t[:] y, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_3pixelize_off_axis_cartesian, NULL, __pyx_n_s_yt_utilities_lib_pixelization_ro); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_5pixelize_off_axis_cartesian, NULL, __pyx_n_s_yt_utilities_lib_pixelization_ro_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_off_axis_cartesian, __pyx_t_2) < 0) __PYX_ERR(0, 210, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_off_axis_cartesian, __pyx_t_2) < 0) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/pixelization_routines.pyx":298 + /* "yt/utilities/lib/pixelization_routines.pyx":487 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_cylinder(np.ndarray[np.float64_t, ndim=1] radius, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] dradius, - * np.ndarray[np.float64_t, ndim=1] theta, + * def pixelize_cylinder(np.float64_t[:,:] buff, # <<<<<<<<<<<<<< + * np.float64_t[:] radius, + * np.float64_t[:] dradius, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_5pixelize_cylinder, NULL, __pyx_n_s_yt_utilities_lib_pixelization_ro); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_7pixelize_cylinder, NULL, __pyx_n_s_yt_utilities_lib_pixelization_ro_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_cylinder, __pyx_t_2) < 0) __PYX_ERR(0, 298, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_cylinder, __pyx_t_2) < 0) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/pixelization_routines.pyx":391 + /* "yt/utilities/lib/pixelization_routines.pyx":570 * @cython.boundscheck(False) * @cython.wraparound(False) - * def pixelize_aitoff(np.ndarray[np.float64_t, ndim=1] theta, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] dtheta, - * np.ndarray[np.float64_t, ndim=1] phi, + * def pixelize_aitoff(np.float64_t[:] theta, # <<<<<<<<<<<<<< + * np.float64_t[:] dtheta, + * np.float64_t[:] phi, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_7pixelize_aitoff, NULL, __pyx_n_s_yt_utilities_lib_pixelization_ro); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_9pixelize_aitoff, NULL, __pyx_n_s_yt_utilities_lib_pixelization_ro_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_aitoff, __pyx_t_2) < 0) __PYX_ERR(0, 391, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_aitoff, __pyx_t_2) < 0) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/pixelization_routines.pyx":550 + /* "yt/utilities/lib/pixelization_routines.pyx":729 * * * def pixelize_element_mesh(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=2] conn, * buff_size, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_9pixelize_element_mesh, NULL, __pyx_n_s_yt_utilities_lib_pixelization_ro); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_11pixelize_element_mesh, NULL, __pyx_n_s_yt_utilities_lib_pixelization_ro_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_element_mesh, __pyx_t_2) < 0) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "yt/utilities/lib/pixelization_routines.pyx":866 + * return img + * + * def pixelize_element_mesh_line(np.ndarray[np.float64_t, ndim=2] coords, # <<<<<<<<<<<<<< + * np.ndarray[np.int64_t, ndim=2] conn, + * np.ndarray[np.float64_t, ndim=1] start_point, + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_21pixelization_routines_13pixelize_element_mesh_line, NULL, __pyx_n_s_yt_utilities_lib_pixelization_ro_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_element_mesh, __pyx_t_2) < 0) __PYX_ERR(0, 550, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixelize_element_mesh_line, __pyx_t_2) < 0) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "yt/utilities/lib/pixelization_routines.pyx":1 @@ -26412,7 +30541,7 @@ */ __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_array_type); @@ -26423,7 +30552,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 282, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_2); @@ -26437,7 +30566,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 283, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_2); @@ -26451,7 +30580,7 @@ * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 284, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_2); @@ -26465,7 +30594,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_2); @@ -26479,7 +30608,7 @@ * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); @@ -26521,7 +30650,7 @@ */ __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_memoryview_type); @@ -26532,18 +30661,28 @@ * * */ - __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __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, 981, __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 + */ + __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_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 981, __pyx_L1_error) + 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; - PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -26554,7 +30693,7 @@ __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.pixelization_routines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.pixelization_routines", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -26714,64 +30853,349 @@ argname++; } } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; + } 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; +} + +/* GetItemInt */ +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + 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)); +} + +/* GetModuleGlobalName */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +/* 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 + +/* 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; } - 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; -} - -/* ArgTypeTest */ -static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); -} -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (likely(Py_TYPE(obj) == type)) return 1; - #if PY_MAJOR_VERSION == 2 - else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); } - else { - if (likely(PyObject_TypeCheck(obj, type))) return 1; + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif } - __Pyx_RaiseArgumentTypeInvalid(name, obj, type); - return 0; +bad: + Py_XDECREF(owned_instance); + return; } +#endif /* BufferFormatCheck */ -static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; } @@ -27251,380 +31675,209 @@ ctx->enc_count = ctx->new_count; ctx->enc_packmode = ctx->new_packmode; ctx->enc_type = *ts; - ctx->is_complex = got_Z; - ++ts; - ctx->new_count = 1; - got_Z = 0; - break; - case ':': - ++ts; - while(*ts != ':') ++ts; - ++ts; - break; - case '(': - if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; - break; - default: - { - int number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return NULL; - ctx->new_count = (size_t)number; - } - } - } -} -static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { - buf->buf = NULL; - buf->obj = NULL; - buf->strides = __Pyx_zeros; - buf->shape = __Pyx_zeros; - buf->suboffsets = __Pyx_minusones; -} -static CYTHON_INLINE int __Pyx_GetBufferAndValidate( - Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, - int nd, int cast, __Pyx_BufFmt_StackElem* stack) -{ - if (obj == Py_None || obj == NULL) { - __Pyx_ZeroBuffer(buf); - return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { - PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - nd, buf->ndim); - goto fail; - } - if (!cast) { - __Pyx_BufFmt_Context ctx; - __Pyx_BufFmt_Init(&ctx, stack, dtype); - if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; - } - if ((unsigned)buf->itemsize != dtype->size) { - PyErr_Format(PyExc_ValueError, - "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", - buf->itemsize, (buf->itemsize > 1) ? "s" : "", - dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); - goto fail; - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; -} -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { - if (info->buf == NULL) return; - if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; - __Pyx_ReleaseBuffer(info); -} - -/* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return m->sq_item(o, i); + 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 - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -/* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; + } } - -/* 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; +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; } -#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 int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; } -static CYTHON_INLINE void __Pyx_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; +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); } -#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; - } +/* 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 (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; + if (buf->strides) { + for (i = 0; i < ndim; i++) { + memviewslice->strides[i] = buf->strides[i]; } -#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; + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; } } - __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; - } + 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; } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); #else - if (cause && cause != Py_None) { + va_start(vargs); #endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); + vsnprintf(msg, 200, fmt, vargs); + Py_FatalError(msg); + va_end(vargs); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview || (PyObject *) memview == Py_None) + return; + if (__pyx_get_slice_count(memview) < 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (first_time) { + if (have_gil) { + Py_INCREF((PyObject *) memview); } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); } - PyException_SetCause(value, fixed_cause); } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); +} +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); } -#endif + } else { + memslice->memview = NULL; } -bad: - Py_XDECREF(owned_instance); - return; } -#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -27740,182 +31993,52 @@ #endif Py_XDECREF(kwtuple); done: - Py_LeaveRecursiveCall(); - return result; -} -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL - -/* PyCFunctionFastCall */ - #if CYTHON_FAST_PYCCALL -static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { - PyCFunctionObject *func = (PyCFunctionObject*)func_obj; - PyCFunction meth = PyCFunction_GET_FUNCTION(func); - PyObject *self = PyCFunction_GET_SELF(func); - assert(PyCFunction_Check(func)); - assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); - assert(nargs >= 0); - assert(nargs == 0 || args != NULL); - /* _PyCFunction_FastCallDict() must not be called with an exception set, - because it may clear it (directly or indirectly) and so the - caller loses its exception */ - assert(!PyErr_Occurred()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); -} -#endif // CYTHON_FAST_PYCCALL - -/* 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(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -/* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { - PyErr_SetString(PyExc_ValueError, - "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); -} - -/* 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; -} -static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { - va_list vargs; - char msg[200]; -#ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, fmt); -#else - va_start(vargs); -#endif - vsnprintf(msg, 200, fmt, vargs); - Py_FatalError(msg); - va_end(vargs); -} -static CYTHON_INLINE int -__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, - PyThread_type_lock lock) -{ - int result; - PyThread_acquire_lock(lock, 1); - result = (*acquisition_count)++; - PyThread_release_lock(lock); - return result; -} -static CYTHON_INLINE int -__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, - PyThread_type_lock lock) -{ - int result; - PyThread_acquire_lock(lock, 1); - result = (*acquisition_count)--; - PyThread_release_lock(lock); + Py_LeaveRecursiveCall(); 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); - } +#endif +#endif + +/* PyCFunctionFastCall */ + #if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + 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); } } -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; +#endif + +/* 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(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* BufferFallbackError */ + static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); } /* PyObjectCallMethO */ @@ -27956,11 +32079,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -27983,7 +32102,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -28003,119 +32122,21 @@ } #endif -/* SliceObject */ - static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, - Py_ssize_t cstart, Py_ssize_t cstop, - PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, - int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { -#if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_ass_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_ass_slice(obj, cstart, cstop, value); - } -#endif - mp = Py_TYPE(obj)->tp_as_mapping; - if (likely(mp && mp->mp_ass_subscript)) -#endif - { - int result; - PyObject *py_slice, *py_start, *py_stop; - if (_py_slice) { - py_slice = *_py_slice; - } else { - PyObject* owned_start = NULL; - PyObject* owned_stop = NULL; - if (_py_start) { - py_start = *_py_start; - } else { - if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); - if (unlikely(!py_start)) goto bad; - } else - py_start = Py_None; - } - if (_py_stop) { - py_stop = *_py_stop; - } else { - if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); - if (unlikely(!py_stop)) { - Py_XDECREF(owned_start); - goto bad; - } - } else - py_stop = Py_None; - } - py_slice = PySlice_New(py_start, py_stop, Py_None); - Py_XDECREF(owned_start); - Py_XDECREF(owned_stop); - if (unlikely(!py_slice)) goto bad; - } -#if CYTHON_USE_TYPE_SLOTS - result = mp->mp_ass_subscript(obj, py_slice, value); -#else - result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice); -#endif - if (!_py_slice) { - Py_DECREF(py_slice); - } - return result; - } - PyErr_Format(PyExc_TypeError, - "'%.200s' object does not support slice %.10s", - Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion"); -bad: - return -1; -} - /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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"); } /* IterFinish */ - static CYTHON_INLINE int __Pyx_IterFinish(void) { + static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; @@ -28147,69 +32168,218 @@ } return 0; #endif -} - -/* UnpackItemEndCheck */ - static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else { - return __Pyx_IterFinish(); - } - return 0; -} - -/* 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; +} + +/* UnpackItemEndCheck */ + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* 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 +} + +/* ArgTypeTest */ + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +/* PyIntBinop */ + #if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + x = (long)((unsigned long)a - b); + if (likely((x^a) >= 0 || (x^~b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; #endif + } + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; #endif - __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); + } + default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + } + } + x = a - b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla - llb; + return PyLong_FromLongLong(llx); +#endif + + } - #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); + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("subtract", return NULL) + result = ((double)a) - (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); } -#ifdef WITH_THREAD - if (nogil) - PyGILState_Release(state); + return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); +} #endif + +/* BufferIndexError */ + static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); } /* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -28233,7 +32403,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -28243,7 +32413,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -28304,7 +32474,7 @@ } /* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -28322,7 +32492,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -28342,7 +32521,7 @@ } /* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { + 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 @@ -28382,6 +32561,21 @@ 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; @@ -28426,7 +32620,7 @@ } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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)); @@ -28434,7 +32628,7 @@ } /* GetAttr */ - static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) @@ -28447,7 +32641,7 @@ } /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -28479,8 +32673,23 @@ } } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -28505,7 +32714,7 @@ #endif /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -28579,7 +32788,7 @@ } /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -28695,20 +32904,52 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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; } +/* 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; + } +} + /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -28725,8 +32966,73 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* GetVTable */ - static void* __Pyx_GetVtable(PyObject *dict) { + static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) @@ -28745,22 +33051,42 @@ return NULL; } -/* 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 +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); } - return value; + 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; + } + return c_line; +#endif } /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -28840,7 +33166,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -28899,12 +33225,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -28943,8 +33272,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -28967,7 +33296,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -29003,7 +33332,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -29015,30 +33344,8 @@ return cobj; } -/* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -29079,7 +33386,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -29261,17 +33568,17 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; - int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + 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, 1, + PyBUF_RECORDS, 2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack, &result, obj); if (unlikely(retcode == -1)) @@ -29284,17 +33591,17 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; - int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + 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, 2, + PyBUF_RECORDS, 1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack, &result, obj); if (unlikely(retcode == -1)) @@ -29306,8 +33613,30 @@ 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;\ + } + /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -29318,7 +33647,7 @@ } retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, PyBUF_RECORDS, 1, - &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, stack, &result, obj); if (unlikely(retcode == -1)) goto __pyx_fail; @@ -29330,7 +33659,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -29361,7 +33690,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + 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) { @@ -29391,25 +33720,37 @@ } } +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_float64_t value = __pyx_PyFloat_AsDouble(obj); + if ((value == ((npy_float64)-1)) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_float64_t *) itemp = value; + return 1; +} + /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { - const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { - if (sizeof(Py_intptr_t) < sizeof(long)) { + if (sizeof(npy_uint8) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { + } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) { + } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { - if (sizeof(Py_intptr_t) <= sizeof(long)) { + if (sizeof(npy_uint8) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -29417,30 +33758,30 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t), + return _PyLong_FromByteArray(bytes, sizeof(npy_uint8), little, !is_unsigned); } } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) { - const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0; + 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_uint8) < sizeof(long)) { + if (sizeof(npy_int64) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_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_uint8) <= sizeof(long)) { + if (sizeof(npy_int64) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -29448,30 +33789,30 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(npy_uint8), + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), 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; + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { - if (sizeof(npy_int64) < sizeof(long)) { + if (sizeof(Py_intptr_t) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) { + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { - if (sizeof(npy_int64) <= sizeof(long)) { + if (sizeof(Py_intptr_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } @@ -29479,13 +33820,13 @@ { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t), little, !is_unsigned); } } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -29505,7 +33846,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -29640,7 +33981,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -29660,7 +34001,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -29795,7 +34136,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -29826,7 +34167,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -29893,7 +34234,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -30082,7 +34423,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -30271,19 +34612,19 @@ } /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { - const char neg_one = (char) -1, const_zero = (char) 0; + static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if (sizeof(char) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) + if (sizeof(Py_intptr_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (char) val; + return (Py_intptr_t) val; } } else #endif @@ -30292,32 +34633,32 @@ #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 0: return (Py_intptr_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0]) case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) > 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])); + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) { + return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])); } } break; case 3: - if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) > 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])); + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) { + return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])); } } break; case 4: - if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) > 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])); + __PYX_VERIFY_RETURN_INT(Py_intptr_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(Py_intptr_t) >= 4 * PyLong_SHIFT) { + return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])); } } break; @@ -30331,86 +34672,86 @@ { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (char) -1; + return (Py_intptr_t) -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)) + if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, 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)) + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_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 (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 0: return (Py_intptr_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0]) case -2: - if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) - 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]))); + __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { + return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]))); } } break; case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) > 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]))); + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { + return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]))); } } break; case -3: - if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) - 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]))); + __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { + return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]))); } } break; case 3: - if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) > 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]))); + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { + return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]))); } } break; case -4: - if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) - 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]))); + __PYX_VERIFY_RETURN_INT(Py_intptr_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(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) { + return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]))); } } break; case 4: - if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(Py_intptr_t) > 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]))); + __PYX_VERIFY_RETURN_INT(Py_intptr_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(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) { + return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]))); } } break; } #endif - if (sizeof(char) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) + if (sizeof(Py_intptr_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, 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)) + } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -30419,7 +34760,7 @@ PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - char val; + Py_intptr_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -30439,28 +34780,28 @@ return val; } #endif - return (char) -1; + return (Py_intptr_t) -1; } } else { - char val; + Py_intptr_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (char) -1; - val = __Pyx_PyInt_As_char(tmp); + if (!tmp) return (Py_intptr_t) -1; + val = __Pyx_PyInt_As_Py_intptr_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to char"); - return (char) -1; + "value too large to convert to Py_intptr_t"); + return (Py_intptr_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to char"); - return (char) -1; + "can't convert negative value to Py_intptr_t"); + return (Py_intptr_t) -1; } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -30648,8 +34989,197 @@ 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; +} + /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -30665,7 +35195,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -30683,7 +35213,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -30748,7 +35278,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -30773,6 +35303,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -30781,11 +35313,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/pixelization_routines.pyx yt-3.4.0/yt/utilities/lib/pixelization_routines.pyx --- yt-3.3.3/yt/utilities/lib/pixelization_routines.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/pixelization_routines.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -25,12 +25,16 @@ from vec3_ops cimport dot, cross, subtract from yt.utilities.lib.element_mappings cimport \ ElementSampler, \ + P1Sampler1D, \ + P1Sampler2D, \ P1Sampler3D, \ Q1Sampler3D, \ - S2Sampler3D, \ - P1Sampler2D, \ Q1Sampler2D, \ - W1Sampler3D + Q2Sampler2D, \ + S2Sampler3D, \ + W1Sampler3D, \ + T2Sampler2D, \ + Tet2Sampler3D cdef extern from "pixelization_constants.h": enum: @@ -52,12 +56,13 @@ @cython.cdivision(True) @cython.boundscheck(False) @cython.wraparound(False) -def pixelize_cartesian(np.ndarray[np.float64_t, ndim=1] px, - np.ndarray[np.float64_t, ndim=1] py, - np.ndarray[np.float64_t, ndim=1] pdx, - np.ndarray[np.float64_t, ndim=1] pdy, - np.ndarray[np.float64_t, ndim=1] data, - int cols, int rows, bounds, +def pixelize_cartesian(np.float64_t[:,:] buff, + np.float64_t[:] px, + np.float64_t[:] py, + np.float64_t[:] pdx, + np.float64_t[:] pdy, + np.float64_t[:] data, + bounds, int antialias = 1, period = None, int check_period = 1, @@ -76,7 +81,6 @@ cdef int yiter[2] cdef np.float64_t xiterv[2] cdef np.float64_t yiterv[2] - cdef np.ndarray[np.float64_t, ndim=2] my_array if period is not None: period_x = period[0] period_y = period[1] @@ -86,18 +90,15 @@ y_max = bounds[3] width = x_max - x_min height = y_max - y_min - px_dx = width / ( rows) - px_dy = height / ( cols) + px_dx = width / ( buff.shape[1]) + px_dy = height / ( buff.shape[0]) ipx_dx = 1.0 / px_dx ipx_dy = 1.0 / px_dy - if rows == 0 or cols == 0: - raise YTPixelizeError("Cannot scale to zero size") if px.shape[0] != py.shape[0] or \ px.shape[0] != pdx.shape[0] or \ px.shape[0] != pdy.shape[0] or \ px.shape[0] != data.shape[0]: raise YTPixelizeError("Arrays are not of correct shape.") - my_array = np.zeros((rows, cols), "float64") xiter[0] = yiter[0] = 0 xiterv[0] = yiterv[0] = 0.0 # Here's a basic outline of what we're going to do here. The xiter and @@ -118,6 +119,31 @@ # (lr) and then iterate up to "right column" (rc) and "uppeR row" (rr), # depositing into them the data value. Overlap computes the relative # overlap of a data value with a pixel. + # + # NOTE ON ROWS AND COLUMNS: + # + # The way that images are plotting in matplotlib is somewhat different + # from what most might expect. The first axis of the array plotted is + # what varies along the x axis. So for instance, if you supply + # origin='lower' and plot the results of an mgrid operation, at a fixed + # 'y' value you will see the results of that array held constant in the + # first dimension. Here is some example code: + # + # import matplotlib.pyplot as plt + # import numpy as np + # x, y = np.mgrid[0:1:100j,0:1:100j] + # plt.imshow(x, interpolation='nearest', origin='lower') + # plt.imshow(y, interpolation='nearest', origin='lower') + # + # The values in the image: + # lower left: arr[0,0] + # lower right: arr[0,-1] + # upper left: arr[-1,0] + # upper right: arr[-1,-1] + # + # So what we want here is to fill an array such that we fill: + # first axis : y_min .. y_max + # second axis: x_min .. x_max with nogil: for p in range(px.shape[0]): xiter[1] = yiter[1] = 999 @@ -159,8 +185,10 @@ # truncated, but no similar truncation was done in the # comparison of j to rc (double). So give ourselves a # bonus row and bonus column here. - rc = fmin(((xsp+dxsp-x_min)*ipx_dx + 1), rows) - rr = fmin(((ysp+dysp-y_min)*ipx_dy + 1), cols) + rc = fmin(((xsp+dxsp-x_min)*ipx_dx + 1), buff.shape[1]) + rr = fmin(((ysp+dysp-y_min)*ipx_dy + 1), buff.shape[0]) + # Note that we're iterating here over *y* in the i + # direction. See the note above about this. for i in range(lr, rr): lypx = px_dy * i + y_min rypx = px_dy * (i+1) + y_min @@ -185,7 +213,7 @@ fabs(cy - (ysp-dysp))) ld_y *= ipx_dy if ld_x <= line_width or ld_y <= line_width: - my_array[j,i] = 1.0 + buff[i,j] = 1.0 elif antialias == 1: overlap1 = ((fmin(rxpx, xsp+dxsp) - fmax(lxpx, (xsp-dxsp)))*ipx_dx) @@ -198,16 +226,180 @@ # This will reduce artifacts if we ever move to # compositing instead of replacing bitmaps. if overlap1 * overlap2 == 0.0: continue - my_array[j,i] += (dsp * overlap1) * overlap2 + buff[i,j] += (dsp * overlap1) * overlap2 else: - my_array[j,i] = dsp - - return my_array + buff[i,j] = dsp + +@cython.cdivision(True) +@cython.boundscheck(False) +@cython.wraparound(False) +def pixelize_cartesian_nodal(np.float64_t[:,:] buff, + np.float64_t[:] px, + np.float64_t[:] py, + np.float64_t[:] pz, + np.float64_t[:] pdx, + np.float64_t[:] pdy, + np.float64_t[:] pdz, + np.float64_t[:, :] data, + np.float64_t coord, + bounds, + int antialias = 1, + period = None, + int check_period = 1): + cdef np.float64_t x_min, x_max, y_min, y_max + cdef np.float64_t period_x = 0.0, period_y = 0.0 + cdef np.float64_t width, height, px_dx, px_dy, ipx_dx, ipx_dy + cdef np.float64_t ld_x, ld_y, cx, cy, cz + cdef int i, j, p, xi, yi + cdef int lc, lr, rc, rr + cdef np.float64_t lypx, rypx, lxpx, rxpx, overlap1, overlap2 + # These are the temp vars we get from the arrays + cdef np.float64_t oxsp, oysp, ozsp + cdef np.float64_t xsp, ysp, zsp + cdef np.float64_t dxsp, dysp, dzsp + # Some periodicity helpers + cdef int xiter[2] + cdef int yiter[2] + cdef int ii, jj, kk, ind + cdef np.float64_t xiterv[2] + cdef np.float64_t yiterv[2] + if period is not None: + period_x = period[0] + period_y = period[1] + x_min = bounds[0] + x_max = bounds[1] + y_min = bounds[2] + y_max = bounds[3] + width = x_max - x_min + height = y_max - y_min + px_dx = width / ( buff.shape[1]) + px_dy = height / ( buff.shape[0]) + ipx_dx = 1.0 / px_dx + ipx_dy = 1.0 / px_dy + if px.shape[0] != py.shape[0] or \ + px.shape[0] != pz.shape[0] or \ + px.shape[0] != pdx.shape[0] or \ + px.shape[0] != pdy.shape[0] or \ + px.shape[0] != pdz.shape[0] or \ + px.shape[0] != data.shape[0]: + raise YTPixelizeError("Arrays are not of correct shape.") + xiter[0] = yiter[0] = 0 + xiterv[0] = yiterv[0] = 0.0 + # Here's a basic outline of what we're going to do here. The xiter and + # yiter variables govern whether or not we should check periodicity -- are + # we both close enough to the edge that it would be important *and* are we + # periodic? + # + # The other variables are all either pixel positions or data positions. + # Pixel positions will vary regularly from the left edge of the window to + # the right edge of the window; px_dx and px_dy are the dx (cell width, not + # half-width). ipx_dx and ipx_dy are the inverse, for quick math. + # + # The values in xsp, dxsp, x_min and their y counterparts, are the + # data-space coordinates, and are related to the data fed in. We make some + # modifications for periodicity. + # + # Inside the finest loop, we compute the "left column" (lc) and "lower row" + # (lr) and then iterate up to "right column" (rc) and "uppeR row" (rr), + # depositing into them the data value. Overlap computes the relative + # overlap of a data value with a pixel. + # + # NOTE ON ROWS AND COLUMNS: + # + # The way that images are plotting in matplotlib is somewhat different + # from what most might expect. The first axis of the array plotted is + # what varies along the x axis. So for instance, if you supply + # origin='lower' and plot the results of an mgrid operation, at a fixed + # 'y' value you will see the results of that array held constant in the + # first dimension. Here is some example code: + # + # import matplotlib.pyplot as plt + # import numpy as np + # x, y = np.mgrid[0:1:100j,0:1:100j] + # plt.imshow(x, interpolation='nearest', origin='lower') + # plt.imshow(y, interpolation='nearest', origin='lower') + # + # The values in the image: + # lower left: arr[0,0] + # lower right: arr[0,-1] + # upper left: arr[-1,0] + # upper right: arr[-1,-1] + # + # So what we want here is to fill an array such that we fill: + # first axis : y_min .. y_max + # second axis: x_min .. x_max + with nogil: + for p in range(px.shape[0]): + xiter[1] = yiter[1] = 999 + oxsp = px[p] + oysp = py[p] + ozsp = pz[p] + dxsp = pdx[p] + dysp = pdy[p] + dzsp = pdz[p] + if check_period == 1: + if (oxsp - dxsp < x_min): + xiter[1] = +1 + xiterv[1] = period_x + elif (oxsp + dxsp > x_max): + xiter[1] = -1 + xiterv[1] = -period_x + if (oysp - dysp < y_min): + yiter[1] = +1 + yiterv[1] = period_y + elif (oysp + dysp > y_max): + yiter[1] = -1 + yiterv[1] = -period_y + overlap1 = overlap2 = 1.0 + zsp = ozsp + for xi in range(2): + if xiter[xi] == 999: continue + xsp = oxsp + xiterv[xi] + if (xsp + dxsp < x_min) or (xsp - dxsp > x_max): continue + for yi in range(2): + if yiter[yi] == 999: continue + ysp = oysp + yiterv[yi] + if (ysp + dysp < y_min) or (ysp - dysp > y_max): continue + lc = fmax(((xsp-dxsp-x_min)*ipx_dx),0) + lr = fmax(((ysp-dysp-y_min)*ipx_dy),0) + # NOTE: This is a different way of doing it than in the C + # routines. In C, we were implicitly casting the + # initialization to int, but *not* the conditional, which + # was allowed an extra value: + # for(j=lc;j fmin(((xsp+dxsp-x_min)*ipx_dx + 1), buff.shape[1]) + rr = fmin(((ysp+dysp-y_min)*ipx_dy + 1), buff.shape[0]) + # Note that we're iterating here over *y* in the i + # direction. See the note above about this. + for i in range(lr, rr): + lypx = px_dy * i + y_min + rypx = px_dy * (i+1) + y_min + for j in range(lc, rc): + lxpx = px_dx * j + x_min + rxpx = px_dx * (j+1) + x_min + + cx = (rxpx+lxpx)*0.5 + cy = (rypx+lypx)*0.5 + cz = coord + + ii = (cx - xsp + dxsp) + jj = (cy - ysp + dysp) + kk = (cz - zsp + dzsp) + + ind = 4*ii + 2*jj + kk + + buff[i,j] = data[p, ind] + @cython.cdivision(True) @cython.boundscheck(False) @cython.wraparound(False) def pixelize_off_axis_cartesian( + np.float64_t[:,:] buff, np.float64_t[:] x, np.float64_t[:] y, np.float64_t[:] z, @@ -218,9 +410,9 @@ np.float64_t[:] pdz, np.float64_t[:] center, np.float64_t[:,:] inv_mat, - np.int64_t[:] indices, + np.int_t[:] indices, np.float64_t[:] data, - int cols, int rows, bounds): + bounds): cdef np.float64_t x_min, x_max, y_min, y_max cdef np.float64_t width, height, px_dx, px_dy, ipx_dx, ipx_dy, md cdef int i, j, p, ip @@ -229,7 +421,6 @@ cdef np.float64_t xsp, ysp, zsp, dxsp, dysp, dzsp, dsp cdef np.float64_t pxsp, pysp, cxpx, cypx, cx, cy, cz # Some periodicity helpers - cdef np.ndarray[np.float64_t, ndim=2] my_array cdef np.ndarray[np.int64_t, ndim=2] mask x_min = bounds[0] x_max = bounds[1] @@ -237,12 +428,10 @@ y_max = bounds[3] width = x_max - x_min height = y_max - y_min - px_dx = width / ( rows) - px_dy = height / ( cols) + px_dx = width / ( buff.shape[1]) + px_dy = height / ( buff.shape[0]) ipx_dx = 1.0 / px_dx ipx_dy = 1.0 / px_dy - if rows == 0 or cols == 0: - raise YTPixelizeError("Cannot scale to zero size") if px.shape[0] != py.shape[0] or \ px.shape[0] != pdx.shape[0] or \ px.shape[0] != pdy.shape[0] or \ @@ -250,8 +439,7 @@ px.shape[0] != indices.shape[0] or \ px.shape[0] != data.shape[0]: raise YTPixelizeError("Arrays are not of correct shape.") - my_array = np.zeros((rows, cols), "float64") - mask = np.zeros((rows, cols), "int64") + mask = np.zeros((buff.shape[0], buff.shape[1]), "int64") with nogil: for ip in range(indices.shape[0]): p = indices[ip] @@ -273,8 +461,8 @@ continue lc = fmax(((pxsp - md - x_min)*ipx_dx),0) lr = fmax(((pysp - md - y_min)*ipx_dy),0) - rc = fmin(((pxsp + md - x_min)*ipx_dx + 1), rows) - rr = fmin(((pysp + md - y_min)*ipx_dy + 1), cols) + rc = fmin(((pxsp + md - x_min)*ipx_dx + 1), buff.shape[1]) + rr = fmin(((pysp + md - y_min)*ipx_dy + 1), buff.shape[0]) for i in range(lr, rr): cypx = px_dy * (i + 0.5) + y_min for j in range(lc, rc): @@ -287,40 +475,35 @@ fabs(zsp - cz) * 0.99 > dzsp: continue mask[i, j] += 1 - my_array[i, j] += dsp - my_array /= mask - return my_array.T - + buff[i, j] += dsp + for i in range(buff.shape[0]): + for j in range(buff.shape[1]): + if mask[i,j] == 0: continue + buff[i,j] /= mask[i,j] @cython.cdivision(True) @cython.boundscheck(False) @cython.wraparound(False) -def pixelize_cylinder(np.ndarray[np.float64_t, ndim=1] radius, - np.ndarray[np.float64_t, ndim=1] dradius, - np.ndarray[np.float64_t, ndim=1] theta, - np.ndarray[np.float64_t, ndim=1] dtheta, - buff_size, - np.ndarray[np.float64_t, ndim=1] field, - extents, input_img = None): +def pixelize_cylinder(np.float64_t[:,:] buff, + np.float64_t[:] radius, + np.float64_t[:] dradius, + np.float64_t[:] theta, + np.float64_t[:] dtheta, + np.float64_t[:] field, + extents): - cdef np.ndarray[np.float64_t, ndim=2] img cdef np.float64_t x, y, dx, dy, r0, theta0 cdef np.float64_t rmax, x0, y0, x1, y1 cdef np.float64_t r_i, theta_i, dr_i, dtheta_i, dthetamin cdef np.float64_t costheta, sintheta cdef int i, pi, pj - - imax = radius.argmax() + + cdef int imax = np.asarray(radius).argmax() rmax = radius[imax] + dradius[imax] - - if input_img is None: - img = np.zeros((buff_size[0], buff_size[1])) - img[:] = np.nan - else: - img = input_img + x0, x1, y0, y1 = extents - dx = (x1 - x0) / img.shape[0] - dy = (y1 - y0) / img.shape[1] + dx = (x1 - x0) / buff.shape[1] + dy = (y1 - y0) / buff.shape[0] cdef np.float64_t rbounds[2] cdef np.float64_t corners[8] # Find our min and max r @@ -336,8 +519,8 @@ for i in range(8): rbounds[0] = fmin(rbounds[0], corners[i]) rbounds[1] = fmax(rbounds[1], corners[i]) - rbounds[0] = rbounds[0]**0.5 - rbounds[1] = rbounds[1]**0.5 + rbounds[0] = math.sqrt(rbounds[0]) + rbounds[1] = math.sqrt(rbounds[1]) # If we include the origin in either direction, we need to have radius of # zero as our lower bound. if x0 < 0 and x1 > 0: @@ -363,22 +546,18 @@ sintheta = math.sin(theta_i) while r_i < r0 + dr_i: if rmax <= r_i: - r_i += 0.5*dx + r_i += 0.5*dx continue y = r_i * costheta x = r_i * sintheta pi = ((x - x0)/dx) pj = ((y - y0)/dy) - if pi >= 0 and pi < img.shape[0] and \ - pj >= 0 and pj < img.shape[1]: - if img[pi, pj] != img[pi, pj]: - img[pi, pj] = 0.0 - img[pi, pj] = field[i] - r_i += 0.5*dx + if pi >= 0 and pi < buff.shape[0] and \ + pj >= 0 and pj < buff.shape[1]: + buff[pi, pj] = field[i] + r_i += 0.5*dx theta_i += dthetamin - return img - cdef void aitoff_thetaphi_to_xy(np.float64_t theta, np.float64_t phi, np.float64_t *x, np.float64_t *y): cdef np.float64_t z = math.sqrt(1 + math.cos(phi) * math.cos(theta / 2.0)) @@ -388,12 +567,12 @@ @cython.cdivision(True) @cython.boundscheck(False) @cython.wraparound(False) -def pixelize_aitoff(np.ndarray[np.float64_t, ndim=1] theta, - np.ndarray[np.float64_t, ndim=1] dtheta, - np.ndarray[np.float64_t, ndim=1] phi, - np.ndarray[np.float64_t, ndim=1] dphi, +def pixelize_aitoff(np.float64_t[:] theta, + np.float64_t[:] dtheta, + np.float64_t[:] phi, + np.float64_t[:] dphi, buff_size, - np.ndarray[np.float64_t, ndim=1] field, + np.float64_t[:] field, extents, input_img = None, np.float64_t theta_offset = 0.0, np.float64_t phi_offset = 0.0): @@ -412,7 +591,7 @@ cdef np.float64_t s2 = math.sqrt(2.0) cdef np.float64_t xmax, ymax, xmin, ymin nf = field.shape[0] - + if input_img is None: img = np.zeros((buff_size[0], buff_size[1])) img[:] = np.nan @@ -467,8 +646,8 @@ y = (-1.0 + j * dy)*s2 zb = (x*x/8.0 + y*y/2.0 - 1.0) if zb > 0: continue - z = (1.0 - (x/4.0)**2.0 - (y/2.0)**2.0) - z = z**0.5 + z = (1.0 - (x * 0.25) * (x * 0.25) - (y * 0.5) * (y * 0.5)) + z = math.sqrt(z) # Longitude theta0 = 2.0*math.atan(z*x/(2.0 * (2.0*z*z-1.0))) # Latitude @@ -551,7 +730,7 @@ np.ndarray[np.int64_t, ndim=2] conn, buff_size, np.ndarray[np.float64_t, ndim=2] field, - extents, + extents, int index_offset = 0): cdef np.ndarray[np.float64_t, ndim=3] img img = np.zeros(buff_size, dtype="float64") @@ -592,8 +771,16 @@ sampler = S2Sampler3D() elif ndim == 2 and nvertices == 3: sampler = P1Sampler2D() + elif ndim == 1 and nvertices == 2: + sampler = P1Sampler1D() elif ndim == 2 and nvertices == 4: sampler = Q1Sampler2D() + elif ndim == 2 and nvertices == 9: + sampler = Q2Sampler2D() + elif ndim == 2 and nvertices == 6: + sampler = T2Sampler2D() + elif ndim == 3 and nvertices == 10: + sampler = Tet2Sampler3D() else: raise YTElementTypeNotRecognized(ndim, nvertices) @@ -602,7 +789,7 @@ if buff_size[2] != 1: raise RuntimeError("Slices of 2D datasets must be " "perpendicular to the 'z' direction.") - + # allocate temporary storage vertices = malloc(ndim * sizeof(np.float64_t) * nvertices) field_vals = malloc(sizeof(np.float64_t) * num_field_vals) @@ -642,10 +829,13 @@ pstart[i] = i64max( ((LE[i] - pLE[i])*idds[i]) - 1, 0) pend[i] = i64min( ((RE[i] - pLE[i])*idds[i]) + 1, img.shape[i]-1) - # override for the 2D case - if ndim == 2: + # override for the low-dimensional case + if ndim < 3: pstart[2] = 0 pend[2] = 0 + if ndim < 2: + pstart[1] = 0 + pend[1] = 0 if use == 0: continue @@ -672,3 +862,107 @@ free(vertices) free(field_vals) return img + +def pixelize_element_mesh_line(np.ndarray[np.float64_t, ndim=2] coords, + np.ndarray[np.int64_t, ndim=2] conn, + np.ndarray[np.float64_t, ndim=1] start_point, + np.ndarray[np.float64_t, ndim=1] end_point, + npoints, + np.ndarray[np.float64_t, ndim=2] field, + int index_offset = 0): + + # This routine chooses the correct element sampler to interpolate field + # values at evenly spaced points along a sampling line + cdef np.float64_t *vertices + cdef np.float64_t *field_vals + cdef int nvertices = conn.shape[1] + cdef int ndim = coords.shape[1] + cdef int num_field_vals = field.shape[1] + cdef int num_plot_nodes = npoints + cdef int num_intervals = npoints - 1 + cdef double[4] mapped_coord + cdef ElementSampler sampler + cdef np.ndarray[np.float64_t, ndim=1] lin_vec + cdef np.ndarray[np.float64_t, ndim=1] lin_inc + cdef np.ndarray[np.float64_t, ndim=2] lin_sample_points + cdef np.int64_t i, n, j, k + cdef np.ndarray[np.float64_t, ndim=1] arc_length + cdef np.float64_t lin_length, inc_length + cdef np.ndarray[np.float64_t, ndim=1] plot_values + cdef np.float64_t sample_point[3] + + lin_vec = np.zeros(ndim, dtype="float64") + lin_inc = np.zeros(ndim, dtype="float64") + + lin_sample_points = np.zeros((num_plot_nodes, ndim), dtype="float64") + arc_length = np.zeros(num_plot_nodes, dtype="float64") + plot_values = np.zeros(num_plot_nodes, dtype="float64") + + # Pick the right sampler and allocate storage for the mapped coordinate + if ndim == 3 and nvertices == 4: + sampler = P1Sampler3D() + elif ndim == 3 and nvertices == 6: + sampler = W1Sampler3D() + elif ndim == 3 and nvertices == 8: + sampler = Q1Sampler3D() + elif ndim == 3 and nvertices == 20: + sampler = S2Sampler3D() + elif ndim == 2 and nvertices == 3: + sampler = P1Sampler2D() + elif ndim == 1 and nvertices == 2: + sampler = P1Sampler1D() + elif ndim == 2 and nvertices == 4: + sampler = Q1Sampler2D() + elif ndim == 2 and nvertices == 9: + sampler = Q2Sampler2D() + elif ndim == 2 and nvertices == 6: + sampler = T2Sampler2D() + elif ndim == 3 and nvertices == 10: + sampler = Tet2Sampler3D() + else: + raise YTElementTypeNotRecognized(ndim, nvertices) + + # allocate temporary storage + vertices = malloc(ndim * sizeof(np.float64_t) * nvertices) + field_vals = malloc(sizeof(np.float64_t) * num_field_vals) + + lin_vec = end_point - start_point + lin_length = np.linalg.norm(lin_vec) + lin_inc = lin_vec / num_intervals + inc_length = lin_length / num_intervals + for j in range(ndim): + lin_sample_points[0, j] = start_point[j] + arc_length[0] = 0 + for i in range(1, num_intervals + 1): + for j in range(ndim): + lin_sample_points[i, j] = lin_sample_points[i-1, j] + lin_inc[j] + arc_length[i] = arc_length[i-1] + inc_length + + for i in range(num_intervals + 1): + for j in range(3): + if j < ndim: + sample_point[j] = lin_sample_points[i][j] + else: + sample_point[j] = 0 + for ci in range(conn.shape[0]): + for n in range(num_field_vals): + field_vals[n] = field[ci, n] + + # Fill the vertices + for n in range(nvertices): + cj = conn[ci, n] - index_offset + for k in range(ndim): + vertices[ndim*n + k] = coords[cj, k] + + sampler.map_real_to_unit(mapped_coord, vertices, sample_point) + if not sampler.check_inside(mapped_coord) and ci != conn.shape[0] - 1: + continue + elif not sampler.check_inside(mapped_coord): + raise ValueError("Check to see that both starting and ending line points " + "are within the domain of the mesh.") + plot_values[i] = sampler.sample_at_unit_point(mapped_coord, field_vals) + break + + free(vertices) + free(field_vals) + return arc_length, plot_values diff -Nru yt-3.3.3/yt/utilities/lib/points_in_volume.c yt-3.4.0/yt/utilities/lib/points_in_volume.c --- yt-3.3.3/yt/utilities/lib/points_in_volume.c 2016-12-12 01:42:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/points_in_volume.c 2017-08-10 18:20:56.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,6 +6,10 @@ "depends": [], "libraries": [ "m" + ], + "name": "yt.utilities.lib.points_in_volume", + "sources": [ + "yt/utilities/lib/points_in_volume.pyx" ] }, "module_name": "yt.utilities.lib.points_in_volume" @@ -19,7 +23,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -41,6 +45,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -193,16 +198,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -329,6 +338,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -383,6 +398,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -446,6 +490,7 @@ #include #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" +#include #include "math.h" #ifdef _OPENMP #include @@ -491,8 +536,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -505,8 +550,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -628,10 +676,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1062,7 +1112,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); @@ -1196,6 +1246,9 @@ /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1417,6 +1470,8 @@ /* Module declarations from 'cython' */ +/* Module declarations from 'libc.math' */ + /* Module declarations from 'yt.utilities.lib.points_in_volume' */ static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_16points_in_volume_set_rotated_pos(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t (*)[3], __pyx_t_5numpy_float64_t *, int, int, int); /*proto*/ static void __pyx_f_2yt_9utilities_3lib_16points_in_volume_normalize_vector(__pyx_t_5numpy_float64_t *); /*proto*/ @@ -1516,27 +1571,27 @@ static const char __pyx_k_grid_left_edges[] = "grid_left_edges"; static const char __pyx_k_grid_right_edge[] = "grid_right_edge"; static const char __pyx_k_grid_right_edges[] = "grid_right_edges"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_calculate_fill_grids[] = "calculate_fill_grids"; static const char __pyx_k_grid_points_in_volume[] = "grid_points_in_volume"; static const char __pyx_k_planar_points_in_volume[] = "planar_points_in_volume"; static const char __pyx_k_find_grids_in_inclined_box[] = "find_grids_in_inclined_box"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_Checks_for_points_contained_in[] = "\nChecks for points contained in a volume\n\n\n\n"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/points_in_volume.pyx"; 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"; static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_utilities_lib_points_in_volum[] = "yt.utilities.lib.points_in_volume"; +static const char __pyx_k_yt_utilities_lib_points_in_volum[] = "yt/utilities/lib/points_in_volume.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_yt_utilities_lib_points_in_volum_2[] = "yt.utilities.lib.points_in_volume"; 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_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_a_vec; static PyObject *__pyx_n_s_b_ax; @@ -1554,6 +1609,7 @@ static PyObject *__pyx_n_s_ci; static PyObject *__pyx_n_s_cj; static PyObject *__pyx_n_s_ck; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_count; static PyObject *__pyx_n_s_cur_pos; static PyObject *__pyx_n_s_cxi; @@ -1623,7 +1679,8 @@ static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; static PyObject *__pyx_n_s_valid; static PyObject *__pyx_n_s_xrange; -static PyObject *__pyx_n_s_yt_utilities_lib_points_in_volum; +static PyObject *__pyx_kp_s_yt_utilities_lib_points_in_volum; +static PyObject *__pyx_n_s_yt_utilities_lib_points_in_volum_2; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_2yt_9utilities_3lib_16points_in_volume_planar_points_in_volume(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_points, PyArrayObject *__pyx_v_pmask, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_right_edge, PyArrayObject *__pyx_v_mask, float __pyx_v_dx); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_16points_in_volume_2grid_points_in_volume(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_box_lengths, PyArrayObject *__pyx_v_box_origin, PyArrayObject *__pyx_v_rot_mat, PyArrayObject *__pyx_v_grid_left_edge, CYTHON_UNUSED PyArrayObject *__pyx_v_grid_right_edge, PyArrayObject *__pyx_v_dds, PyArrayObject *__pyx_v_mask, int __pyx_v_break_first); /* proto */ @@ -1656,7 +1713,7 @@ static PyObject *__pyx_codeobj__18; static PyObject *__pyx_codeobj__20; -/* "yt/utilities/lib/points_in_volume.pyx":26 +/* "yt/utilities/lib/points_in_volume.pyx":27 * @cython.wraparound(False) * @cython.boundscheck(False) * def planar_points_in_volume( # <<<<<<<<<<<<<< @@ -1685,11 +1742,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -1698,34 +1761,39 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pmask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("planar_points_in_volume", 1, 6, 6, 1); __PYX_ERR(0, 26, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("planar_points_in_volume", 1, 6, 6, 1); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("planar_points_in_volume", 1, 6, 6, 2); __PYX_ERR(0, 26, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("planar_points_in_volume", 1, 6, 6, 2); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("planar_points_in_volume", 1, 6, 6, 3); __PYX_ERR(0, 26, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("planar_points_in_volume", 1, 6, 6, 3); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("planar_points_in_volume", 1, 6, 6, 4); __PYX_ERR(0, 26, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("planar_points_in_volume", 1, 6, 6, 4); __PYX_ERR(0, 27, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("planar_points_in_volume", 1, 6, 6, 5); __PYX_ERR(0, 26, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("planar_points_in_volume", 1, 6, 6, 5); __PYX_ERR(0, 27, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "planar_points_in_volume") < 0)) __PYX_ERR(0, 26, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "planar_points_in_volume") < 0)) __PYX_ERR(0, 27, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -1742,21 +1810,21 @@ __pyx_v_left_edge = ((PyArrayObject *)values[2]); __pyx_v_right_edge = ((PyArrayObject *)values[3]); __pyx_v_mask = ((PyArrayObject *)values[4]); - __pyx_v_dx = __pyx_PyFloat_AsFloat(values[5]); if (unlikely((__pyx_v_dx == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + __pyx_v_dx = __pyx_PyFloat_AsFloat(values[5]); if (unlikely((__pyx_v_dx == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("planar_points_in_volume", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 26, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("planar_points_in_volume", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 27, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.points_in_volume.planar_points_in_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_points), __pyx_ptype_5numpy_ndarray, 1, "points", 0))) __PYX_ERR(0, 27, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pmask), __pyx_ptype_5numpy_ndarray, 1, "pmask", 0))) __PYX_ERR(0, 28, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 29, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 30, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 31, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_points), __pyx_ptype_5numpy_ndarray, 1, "points", 0))) __PYX_ERR(0, 28, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pmask), __pyx_ptype_5numpy_ndarray, 1, "pmask", 0))) __PYX_ERR(0, 29, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 30, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 31, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 32, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_16points_in_volume_planar_points_in_volume(__pyx_self, __pyx_v_points, __pyx_v_pmask, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_mask, __pyx_v_dx); /* function exit code */ @@ -1853,64 +1921,64 @@ __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_points.rcbuffer->pybuffer, (PyObject*)__pyx_v_points, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 26, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_points.rcbuffer->pybuffer, (PyObject*)__pyx_v_points, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 27, __pyx_L1_error) } __pyx_pybuffernd_points.diminfo[0].strides = __pyx_pybuffernd_points.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_points.diminfo[0].shape = __pyx_pybuffernd_points.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_points.diminfo[1].strides = __pyx_pybuffernd_points.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_points.diminfo[1].shape = __pyx_pybuffernd_points.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pmask.rcbuffer->pybuffer, (PyObject*)__pyx_v_pmask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 26, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pmask.rcbuffer->pybuffer, (PyObject*)__pyx_v_pmask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 27, __pyx_L1_error) } __pyx_pybuffernd_pmask.diminfo[0].strides = __pyx_pybuffernd_pmask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pmask.diminfo[0].shape = __pyx_pybuffernd_pmask.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 26, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 27, __pyx_L1_error) } __pyx_pybuffernd_left_edge.diminfo[0].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edge.diminfo[0].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 26, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 27, __pyx_L1_error) } __pyx_pybuffernd_right_edge.diminfo[0].strides = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edge.diminfo[0].shape = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 26, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 27, __pyx_L1_error) } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; - /* "yt/utilities/lib/points_in_volume.pyx":34 + /* "yt/utilities/lib/points_in_volume.pyx":35 * float dx): * cdef np.ndarray[np.int8_t, ndim=1] \ * valid = np.zeros(points.shape[0], dtype='int8') # <<<<<<<<<<<<<< * cdef int i, dim, count * cdef int ex */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __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, 34, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_points->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_points->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int8) < 0) __PYX_ERR(0, 34, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int8) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __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_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, 34, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_valid.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_valid = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_valid.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 33, __pyx_L1_error) + __PYX_ERR(0, 34, __pyx_L1_error) } else {__pyx_pybuffernd_valid.diminfo[0].strides = __pyx_pybuffernd_valid.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_valid.diminfo[0].shape = __pyx_pybuffernd_valid.rcbuffer->pybuffer.shape[0]; } } @@ -1918,7 +1986,7 @@ __pyx_v_valid = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":39 + /* "yt/utilities/lib/points_in_volume.pyx":40 * cdef double dx_inv * cdef unsigned int idx[3] * count = 0 # <<<<<<<<<<<<<< @@ -1927,7 +1995,7 @@ */ __pyx_v_count = 0; - /* "yt/utilities/lib/points_in_volume.pyx":40 + /* "yt/utilities/lib/points_in_volume.pyx":41 * cdef unsigned int idx[3] * count = 0 * dx_inv = 1.0 / dx # <<<<<<<<<<<<<< @@ -1936,11 +2004,11 @@ */ if (unlikely(__pyx_v_dx == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 40, __pyx_L1_error) + __PYX_ERR(0, 41, __pyx_L1_error) } __pyx_v_dx_inv = (1.0 / __pyx_v_dx); - /* "yt/utilities/lib/points_in_volume.pyx":41 + /* "yt/utilities/lib/points_in_volume.pyx":42 * count = 0 * dx_inv = 1.0 / dx * for i in xrange(points.shape[0]): # <<<<<<<<<<<<<< @@ -1951,7 +2019,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/points_in_volume.pyx":42 + /* "yt/utilities/lib/points_in_volume.pyx":43 * dx_inv = 1.0 / dx * for i in xrange(points.shape[0]): * if pmask[i] == 0: # <<<<<<<<<<<<<< @@ -1962,7 +2030,7 @@ __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_pmask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_pmask.diminfo[0].strides)) == 0) != 0); if (__pyx_t_9) { - /* "yt/utilities/lib/points_in_volume.pyx":43 + /* "yt/utilities/lib/points_in_volume.pyx":44 * for i in xrange(points.shape[0]): * if pmask[i] == 0: * continue # <<<<<<<<<<<<<< @@ -1971,7 +2039,7 @@ */ goto __pyx_L3_continue; - /* "yt/utilities/lib/points_in_volume.pyx":42 + /* "yt/utilities/lib/points_in_volume.pyx":43 * dx_inv = 1.0 / dx * for i in xrange(points.shape[0]): * if pmask[i] == 0: # <<<<<<<<<<<<<< @@ -1980,7 +2048,7 @@ */ } - /* "yt/utilities/lib/points_in_volume.pyx":44 + /* "yt/utilities/lib/points_in_volume.pyx":45 * if pmask[i] == 0: * continue * ex = 1 # <<<<<<<<<<<<<< @@ -1989,7 +2057,7 @@ */ __pyx_v_ex = 1; - /* "yt/utilities/lib/points_in_volume.pyx":45 + /* "yt/utilities/lib/points_in_volume.pyx":46 * continue * ex = 1 * for dim in xrange(3): # <<<<<<<<<<<<<< @@ -1999,7 +2067,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { __pyx_v_dim = __pyx_t_10; - /* "yt/utilities/lib/points_in_volume.pyx":46 + /* "yt/utilities/lib/points_in_volume.pyx":47 * ex = 1 * for dim in xrange(3): * if points[i,dim] < left_edge[dim] or points[i,dim] > right_edge[dim]: # <<<<<<<<<<<<<< @@ -2023,7 +2091,7 @@ __pyx_L9_bool_binop_done:; if (__pyx_t_9) { - /* "yt/utilities/lib/points_in_volume.pyx":47 + /* "yt/utilities/lib/points_in_volume.pyx":48 * for dim in xrange(3): * if points[i,dim] < left_edge[dim] or points[i,dim] > right_edge[dim]: * valid[i] = ex = 0 # <<<<<<<<<<<<<< @@ -2034,7 +2102,7 @@ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_valid.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_valid.diminfo[0].strides) = 0; __pyx_v_ex = 0; - /* "yt/utilities/lib/points_in_volume.pyx":48 + /* "yt/utilities/lib/points_in_volume.pyx":49 * if points[i,dim] < left_edge[dim] or points[i,dim] > right_edge[dim]: * valid[i] = ex = 0 * break # <<<<<<<<<<<<<< @@ -2043,7 +2111,7 @@ */ goto __pyx_L7_break; - /* "yt/utilities/lib/points_in_volume.pyx":46 + /* "yt/utilities/lib/points_in_volume.pyx":47 * ex = 1 * for dim in xrange(3): * if points[i,dim] < left_edge[dim] or points[i,dim] > right_edge[dim]: # <<<<<<<<<<<<<< @@ -2054,7 +2122,7 @@ } __pyx_L7_break:; - /* "yt/utilities/lib/points_in_volume.pyx":49 + /* "yt/utilities/lib/points_in_volume.pyx":50 * valid[i] = ex = 0 * break * if ex == 1: # <<<<<<<<<<<<<< @@ -2064,7 +2132,7 @@ __pyx_t_9 = ((__pyx_v_ex == 1) != 0); if (__pyx_t_9) { - /* "yt/utilities/lib/points_in_volume.pyx":50 + /* "yt/utilities/lib/points_in_volume.pyx":51 * break * if ex == 1: * for dim in xrange(3): # <<<<<<<<<<<<<< @@ -2074,7 +2142,7 @@ for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { __pyx_v_dim = __pyx_t_10; - /* "yt/utilities/lib/points_in_volume.pyx":52 + /* "yt/utilities/lib/points_in_volume.pyx":53 * for dim in xrange(3): * idx[dim] = \ * ((points[i,dim] - left_edge[dim]) * dx_inv) # <<<<<<<<<<<<<< @@ -2085,7 +2153,7 @@ __pyx_t_20 = __pyx_v_dim; __pyx_t_21 = __pyx_v_dim; - /* "yt/utilities/lib/points_in_volume.pyx":51 + /* "yt/utilities/lib/points_in_volume.pyx":52 * if ex == 1: * for dim in xrange(3): * idx[dim] = \ # <<<<<<<<<<<<<< @@ -2095,7 +2163,7 @@ (__pyx_v_idx[__pyx_v_dim]) = ((unsigned int)(((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_points.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_points.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_points.diminfo[1].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left_edge.diminfo[0].strides))) * __pyx_v_dx_inv)); } - /* "yt/utilities/lib/points_in_volume.pyx":53 + /* "yt/utilities/lib/points_in_volume.pyx":54 * idx[dim] = \ * ((points[i,dim] - left_edge[dim]) * dx_inv) * if mask[idx[0], idx[1], idx[2]] == 1: # <<<<<<<<<<<<<< @@ -2108,7 +2176,7 @@ __pyx_t_9 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_mask.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_mask.diminfo[2].strides)) == 1) != 0); if (__pyx_t_9) { - /* "yt/utilities/lib/points_in_volume.pyx":54 + /* "yt/utilities/lib/points_in_volume.pyx":55 * ((points[i,dim] - left_edge[dim]) * dx_inv) * if mask[idx[0], idx[1], idx[2]] == 1: * valid[i] = 1 # <<<<<<<<<<<<<< @@ -2118,7 +2186,7 @@ __pyx_t_25 = __pyx_v_i; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_valid.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_valid.diminfo[0].strides) = 1; - /* "yt/utilities/lib/points_in_volume.pyx":55 + /* "yt/utilities/lib/points_in_volume.pyx":56 * if mask[idx[0], idx[1], idx[2]] == 1: * valid[i] = 1 * count += 1 # <<<<<<<<<<<<<< @@ -2127,7 +2195,7 @@ */ __pyx_v_count = (__pyx_v_count + 1); - /* "yt/utilities/lib/points_in_volume.pyx":53 + /* "yt/utilities/lib/points_in_volume.pyx":54 * idx[dim] = \ * ((points[i,dim] - left_edge[dim]) * dx_inv) * if mask[idx[0], idx[1], idx[2]] == 1: # <<<<<<<<<<<<<< @@ -2136,7 +2204,7 @@ */ } - /* "yt/utilities/lib/points_in_volume.pyx":49 + /* "yt/utilities/lib/points_in_volume.pyx":50 * valid[i] = ex = 0 * break * if ex == 1: # <<<<<<<<<<<<<< @@ -2147,40 +2215,40 @@ __pyx_L3_continue:; } - /* "yt/utilities/lib/points_in_volume.pyx":57 + /* "yt/utilities/lib/points_in_volume.pyx":58 * count += 1 * * cdef np.ndarray[np.int32_t, ndim=1] result = np.empty(count, dtype='int32') # <<<<<<<<<<<<<< * count = 0 * for i in xrange(points.shape[0]): */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 57, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 57, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 58, __pyx_L1_error) __pyx_t_26 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 57, __pyx_L1_error) + __PYX_ERR(0, 58, __pyx_L1_error) } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; } } @@ -2188,7 +2256,7 @@ __pyx_v_result = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":58 + /* "yt/utilities/lib/points_in_volume.pyx":59 * * cdef np.ndarray[np.int32_t, ndim=1] result = np.empty(count, dtype='int32') * count = 0 # <<<<<<<<<<<<<< @@ -2197,7 +2265,7 @@ */ __pyx_v_count = 0; - /* "yt/utilities/lib/points_in_volume.pyx":59 + /* "yt/utilities/lib/points_in_volume.pyx":60 * cdef np.ndarray[np.int32_t, ndim=1] result = np.empty(count, dtype='int32') * count = 0 * for i in xrange(points.shape[0]): # <<<<<<<<<<<<<< @@ -2208,7 +2276,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "yt/utilities/lib/points_in_volume.pyx":60 + /* "yt/utilities/lib/points_in_volume.pyx":61 * count = 0 * for i in xrange(points.shape[0]): * if valid[i] == 1 and pmask[i] == 1: # <<<<<<<<<<<<<< @@ -2228,7 +2296,7 @@ __pyx_L18_bool_binop_done:; if (__pyx_t_9) { - /* "yt/utilities/lib/points_in_volume.pyx":61 + /* "yt/utilities/lib/points_in_volume.pyx":62 * for i in xrange(points.shape[0]): * if valid[i] == 1 and pmask[i] == 1: * result[count] = i # <<<<<<<<<<<<<< @@ -2238,7 +2306,7 @@ __pyx_t_29 = __pyx_v_count; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_i; - /* "yt/utilities/lib/points_in_volume.pyx":62 + /* "yt/utilities/lib/points_in_volume.pyx":63 * if valid[i] == 1 and pmask[i] == 1: * result[count] = i * count += 1 # <<<<<<<<<<<<<< @@ -2247,7 +2315,7 @@ */ __pyx_v_count = (__pyx_v_count + 1); - /* "yt/utilities/lib/points_in_volume.pyx":60 + /* "yt/utilities/lib/points_in_volume.pyx":61 * count = 0 * for i in xrange(points.shape[0]): * if valid[i] == 1 and pmask[i] == 1: # <<<<<<<<<<<<<< @@ -2257,7 +2325,7 @@ } } - /* "yt/utilities/lib/points_in_volume.pyx":64 + /* "yt/utilities/lib/points_in_volume.pyx":65 * count += 1 * * return result # <<<<<<<<<<<<<< @@ -2269,7 +2337,7 @@ __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "yt/utilities/lib/points_in_volume.pyx":26 + /* "yt/utilities/lib/points_in_volume.pyx":27 * @cython.wraparound(False) * @cython.boundscheck(False) * def planar_points_in_volume( # <<<<<<<<<<<<<< @@ -2314,7 +2382,7 @@ return __pyx_r; } -/* "yt/utilities/lib/points_in_volume.pyx":66 +/* "yt/utilities/lib/points_in_volume.pyx":67 * return result * * cdef inline void set_rotated_pos( # <<<<<<<<<<<<<< @@ -2328,7 +2396,7 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("set_rotated_pos", 0); - /* "yt/utilities/lib/points_in_volume.pyx":70 + /* "yt/utilities/lib/points_in_volume.pyx":71 * np.float64_t rorigin[3], int i, int j, int k): * cdef int oi * for oi in range(3): # <<<<<<<<<<<<<< @@ -2338,7 +2406,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_oi = __pyx_t_1; - /* "yt/utilities/lib/points_in_volume.pyx":71 + /* "yt/utilities/lib/points_in_volume.pyx":72 * cdef int oi * for oi in range(3): * cp[oi] = rdds[0][oi] * (0.5 + i) \ # <<<<<<<<<<<<<< @@ -2348,7 +2416,7 @@ (__pyx_v_cp[__pyx_v_oi]) = ((((((__pyx_v_rdds[0])[__pyx_v_oi]) * (0.5 + __pyx_v_i)) + (((__pyx_v_rdds[1])[__pyx_v_oi]) * (0.5 + __pyx_v_j))) + (((__pyx_v_rdds[2])[__pyx_v_oi]) * (0.5 + __pyx_v_k))) + (__pyx_v_rorigin[__pyx_v_oi])); } - /* "yt/utilities/lib/points_in_volume.pyx":66 + /* "yt/utilities/lib/points_in_volume.pyx":67 * return result * * cdef inline void set_rotated_pos( # <<<<<<<<<<<<<< @@ -2360,7 +2428,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/points_in_volume.pyx":78 +/* "yt/utilities/lib/points_in_volume.pyx":79 * #@cython.wraparound(False) * #@cython.boundscheck(False) * def grid_points_in_volume( # <<<<<<<<<<<<<< @@ -2391,13 +2459,21 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -2406,44 +2482,51 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_box_lengths)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_box_origin)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 1); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 1); __PYX_ERR(0, 79, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rot_mat)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 2); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 2); __PYX_ERR(0, 79, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid_left_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 3); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 3); __PYX_ERR(0, 79, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid_right_edge)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 4); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 4); __PYX_ERR(0, 79, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dds)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 5); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 5); __PYX_ERR(0, 79, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 6); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 6); __PYX_ERR(0, 79, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_break_first)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 7); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, 7); __PYX_ERR(0, 79, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "grid_points_in_volume") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "grid_points_in_volume") < 0)) __PYX_ERR(0, 79, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; @@ -2464,23 +2547,23 @@ __pyx_v_grid_right_edge = ((PyArrayObject *)values[4]); __pyx_v_dds = ((PyArrayObject *)values[5]); __pyx_v_mask = ((PyArrayObject *)values[6]); - __pyx_v_break_first = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_break_first == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) + __pyx_v_break_first = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_break_first == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("grid_points_in_volume", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 79, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.points_in_volume.grid_points_in_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_lengths), __pyx_ptype_5numpy_ndarray, 1, "box_lengths", 0))) __PYX_ERR(0, 79, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_origin), __pyx_ptype_5numpy_ndarray, 1, "box_origin", 0))) __PYX_ERR(0, 80, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rot_mat), __pyx_ptype_5numpy_ndarray, 1, "rot_mat", 0))) __PYX_ERR(0, 81, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grid_left_edge), __pyx_ptype_5numpy_ndarray, 1, "grid_left_edge", 0))) __PYX_ERR(0, 82, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grid_right_edge), __pyx_ptype_5numpy_ndarray, 1, "grid_right_edge", 0))) __PYX_ERR(0, 83, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dds), __pyx_ptype_5numpy_ndarray, 1, "dds", 0))) __PYX_ERR(0, 84, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 85, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_lengths), __pyx_ptype_5numpy_ndarray, 1, "box_lengths", 0))) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_origin), __pyx_ptype_5numpy_ndarray, 1, "box_origin", 0))) __PYX_ERR(0, 81, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rot_mat), __pyx_ptype_5numpy_ndarray, 1, "rot_mat", 0))) __PYX_ERR(0, 82, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grid_left_edge), __pyx_ptype_5numpy_ndarray, 1, "grid_left_edge", 0))) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grid_right_edge), __pyx_ptype_5numpy_ndarray, 1, "grid_right_edge", 0))) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dds), __pyx_ptype_5numpy_ndarray, 1, "dds", 0))) __PYX_ERR(0, 85, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_16points_in_volume_2grid_points_in_volume(__pyx_self, __pyx_v_box_lengths, __pyx_v_box_origin, __pyx_v_rot_mat, __pyx_v_grid_left_edge, __pyx_v_grid_right_edge, __pyx_v_dds, __pyx_v_mask, __pyx_v_break_first); /* function exit code */ @@ -2568,56 +2651,56 @@ __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box_lengths.rcbuffer->pybuffer, (PyObject*)__pyx_v_box_lengths, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box_lengths.rcbuffer->pybuffer, (PyObject*)__pyx_v_box_lengths, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 79, __pyx_L1_error) } __pyx_pybuffernd_box_lengths.diminfo[0].strides = __pyx_pybuffernd_box_lengths.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_box_lengths.diminfo[0].shape = __pyx_pybuffernd_box_lengths.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box_origin.rcbuffer->pybuffer, (PyObject*)__pyx_v_box_origin, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box_origin.rcbuffer->pybuffer, (PyObject*)__pyx_v_box_origin, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 79, __pyx_L1_error) } __pyx_pybuffernd_box_origin.diminfo[0].strides = __pyx_pybuffernd_box_origin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_box_origin.diminfo[0].shape = __pyx_pybuffernd_box_origin.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rot_mat.rcbuffer->pybuffer, (PyObject*)__pyx_v_rot_mat, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rot_mat.rcbuffer->pybuffer, (PyObject*)__pyx_v_rot_mat, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 79, __pyx_L1_error) } __pyx_pybuffernd_rot_mat.diminfo[0].strides = __pyx_pybuffernd_rot_mat.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rot_mat.diminfo[0].shape = __pyx_pybuffernd_rot_mat.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rot_mat.diminfo[1].strides = __pyx_pybuffernd_rot_mat.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rot_mat.diminfo[1].shape = __pyx_pybuffernd_rot_mat.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grid_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_grid_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grid_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_grid_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 79, __pyx_L1_error) } __pyx_pybuffernd_grid_left_edge.diminfo[0].strides = __pyx_pybuffernd_grid_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grid_left_edge.diminfo[0].shape = __pyx_pybuffernd_grid_left_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grid_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_grid_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grid_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_grid_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 79, __pyx_L1_error) } __pyx_pybuffernd_grid_right_edge.diminfo[0].strides = __pyx_pybuffernd_grid_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grid_right_edge.diminfo[0].shape = __pyx_pybuffernd_grid_right_edge.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dds.rcbuffer->pybuffer, (PyObject*)__pyx_v_dds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dds.rcbuffer->pybuffer, (PyObject*)__pyx_v_dds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 79, __pyx_L1_error) } __pyx_pybuffernd_dds.diminfo[0].strides = __pyx_pybuffernd_dds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dds.diminfo[0].shape = __pyx_pybuffernd_dds.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 79, __pyx_L1_error) } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; - /* "yt/utilities/lib/points_in_volume.pyx":92 + /* "yt/utilities/lib/points_in_volume.pyx":93 * cdef np.float64_t cur_pos[3] * cdef np.float64_t rorigin[3] * for i in range(3): # <<<<<<<<<<<<<< * rorigin[i] = 0.0 * for i in range(3): */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __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(0, 92, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -2625,17 +2708,17 @@ 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_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 93, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 93, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -2645,7 +2728,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 92, __pyx_L1_error) + else __PYX_ERR(0, 93, __pyx_L1_error) } break; } @@ -2654,17 +2737,17 @@ __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":93 + /* "yt/utilities/lib/points_in_volume.pyx":94 * cdef np.float64_t rorigin[3] * for i in range(3): * rorigin[i] = 0.0 # <<<<<<<<<<<<<< * for i in range(3): * n[i] = mask.shape[i] */ - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error) (__pyx_v_rorigin[__pyx_t_5]) = 0.0; - /* "yt/utilities/lib/points_in_volume.pyx":92 + /* "yt/utilities/lib/points_in_volume.pyx":93 * cdef np.float64_t cur_pos[3] * cdef np.float64_t rorigin[3] * for i in range(3): # <<<<<<<<<<<<<< @@ -2674,22 +2757,22 @@ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":94 + /* "yt/utilities/lib/points_in_volume.pyx":95 * for i in range(3): * rorigin[i] = 0.0 * for i in range(3): # <<<<<<<<<<<<<< * n[i] = mask.shape[i] * for j in range(3): */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -2697,17 +2780,17 @@ if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 95, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 95, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -2717,7 +2800,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 94, __pyx_L1_error) + else __PYX_ERR(0, 95, __pyx_L1_error) } break; } @@ -2726,33 +2809,33 @@ __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":95 + /* "yt/utilities/lib/points_in_volume.pyx":96 * rorigin[i] = 0.0 * for i in range(3): * n[i] = mask.shape[i] # <<<<<<<<<<<<<< * for j in range(3): * # Set up our transposed dx, which has a component in every */ - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) (__pyx_v_n[__pyx_t_6]) = (__pyx_v_mask->dimensions[__pyx_t_5]); - /* "yt/utilities/lib/points_in_volume.pyx":96 + /* "yt/utilities/lib/points_in_volume.pyx":97 * for i in range(3): * n[i] = mask.shape[i] * for j in range(3): # <<<<<<<<<<<<<< * # Set up our transposed dx, which has a component in every * # direction */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_7 = __pyx_t_2; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -2760,17 +2843,17 @@ if (likely(PyList_CheckExact(__pyx_t_7))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -2780,7 +2863,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 96, __pyx_L1_error) + else __PYX_ERR(0, 97, __pyx_L1_error) } break; } @@ -2789,16 +2872,16 @@ __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":99 + /* "yt/utilities/lib/points_in_volume.pyx":100 * # Set up our transposed dx, which has a component in every * # direction * rds[i][j] = dds[i] * rot_mat[j,i] # <<<<<<<<<<<<<< * # In our rotated coordinate system, the box origin is 0,0,0 * # so we subtract the box_origin from the grid_origin and rotate */ - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_dds), __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_dds), __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_j); __Pyx_GIVEREF(__pyx_v_j); @@ -2806,38 +2889,38 @@ __Pyx_INCREF(__pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_i); - __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_rot_mat), __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_rot_mat), __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Multiply(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) ((__pyx_v_rds[__pyx_t_6])[__pyx_t_12]) = __pyx_t_11; - /* "yt/utilities/lib/points_in_volume.pyx":103 + /* "yt/utilities/lib/points_in_volume.pyx":104 * # so we subtract the box_origin from the grid_origin and rotate * # that * rorigin[j] += (grid_left_edge[i] - box_origin[i]) * rot_mat[j,i] # <<<<<<<<<<<<<< * * for i in range(n[0]): */ - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) - __pyx_t_9 = PyFloat_FromDouble((__pyx_v_rorigin[__pyx_t_12])); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_9 = PyFloat_FromDouble((__pyx_v_rorigin[__pyx_t_12])); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_grid_left_edge), __pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_grid_left_edge), __pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_box_origin), __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_box_origin), __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 = PyNumber_Subtract(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_13 = PyNumber_Subtract(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_j); __Pyx_GIVEREF(__pyx_v_j); @@ -2845,22 +2928,22 @@ __Pyx_INCREF(__pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_i); - __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_rot_mat), __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_rot_mat), __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_t_13, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_t_13, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; (__pyx_v_rorigin[__pyx_t_12]) = __pyx_t_11; - /* "yt/utilities/lib/points_in_volume.pyx":96 + /* "yt/utilities/lib/points_in_volume.pyx":97 * for i in range(3): * n[i] = mask.shape[i] * for j in range(3): # <<<<<<<<<<<<<< @@ -2870,7 +2953,7 @@ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":94 + /* "yt/utilities/lib/points_in_volume.pyx":95 * for i in range(3): * rorigin[i] = 0.0 * for i in range(3): # <<<<<<<<<<<<<< @@ -2880,30 +2963,30 @@ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":105 + /* "yt/utilities/lib/points_in_volume.pyx":106 * rorigin[j] += (grid_left_edge[i] - box_origin[i]) * rot_mat[j,i] * * for i in range(n[0]): # <<<<<<<<<<<<<< * for j in range(n[1]): * for k in range(n[2]): */ - __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_n[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_n[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -2911,17 +2994,17 @@ if (likely(PyList_CheckExact(__pyx_t_7))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 106, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 106, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -2931,7 +3014,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 105, __pyx_L1_error) + else __PYX_ERR(0, 106, __pyx_L1_error) } break; } @@ -2940,30 +3023,30 @@ __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":106 + /* "yt/utilities/lib/points_in_volume.pyx":107 * * for i in range(n[0]): * for j in range(n[1]): # <<<<<<<<<<<<<< * for k in range(n[2]): * set_rotated_pos(cur_pos, rds, rorigin, i, j, k) */ - __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_n[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_n[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_10 = __pyx_t_1; __Pyx_INCREF(__pyx_t_10); __pyx_t_5 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -2971,17 +3054,17 @@ if (likely(PyList_CheckExact(__pyx_t_10))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_10)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 107, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_10, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_10, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_10)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 107, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_10, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_10, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -2991,7 +3074,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 106, __pyx_L1_error) + else __PYX_ERR(0, 107, __pyx_L1_error) } break; } @@ -3000,30 +3083,30 @@ __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":107 + /* "yt/utilities/lib/points_in_volume.pyx":108 * for i in range(n[0]): * for j in range(n[1]): * for k in range(n[2]): # <<<<<<<<<<<<<< * set_rotated_pos(cur_pos, rds, rorigin, i, j, k) * if (cur_pos[0] > box_lengths[0]): continue */ - __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_n[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_n[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __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_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_14 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 108, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -3031,17 +3114,17 @@ if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 108, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 108, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -3051,7 +3134,7 @@ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 107, __pyx_L1_error) + else __PYX_ERR(0, 108, __pyx_L1_error) } break; } @@ -3060,19 +3143,19 @@ __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":108 + /* "yt/utilities/lib/points_in_volume.pyx":109 * for j in range(n[1]): * for k in range(n[2]): * set_rotated_pos(cur_pos, rds, rorigin, i, j, k) # <<<<<<<<<<<<<< * if (cur_pos[0] > box_lengths[0]): continue * if (cur_pos[1] > box_lengths[1]): continue */ - __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error) - __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_j); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error) - __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_v_k); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_j); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_v_k); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L1_error) __pyx_f_2yt_9utilities_3lib_16points_in_volume_set_rotated_pos(__pyx_v_cur_pos, __pyx_v_rds, __pyx_v_rorigin, __pyx_t_15, __pyx_t_16, __pyx_t_17); - /* "yt/utilities/lib/points_in_volume.pyx":109 + /* "yt/utilities/lib/points_in_volume.pyx":110 * for k in range(n[2]): * set_rotated_pos(cur_pos, rds, rorigin, i, j, k) * if (cur_pos[0] > box_lengths[0]): continue # <<<<<<<<<<<<<< @@ -3087,14 +3170,14 @@ } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_box_lengths.diminfo[0].shape)) __pyx_t_17 = 0; if (unlikely(__pyx_t_17 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_17); - __PYX_ERR(0, 109, __pyx_L1_error) + __PYX_ERR(0, 110, __pyx_L1_error) } __pyx_t_19 = (((__pyx_v_cur_pos[0]) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_box_lengths.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_box_lengths.diminfo[0].strides))) != 0); if (__pyx_t_19) { goto __pyx_L13_continue; } - /* "yt/utilities/lib/points_in_volume.pyx":110 + /* "yt/utilities/lib/points_in_volume.pyx":111 * set_rotated_pos(cur_pos, rds, rorigin, i, j, k) * if (cur_pos[0] > box_lengths[0]): continue * if (cur_pos[1] > box_lengths[1]): continue # <<<<<<<<<<<<<< @@ -3109,14 +3192,14 @@ } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_box_lengths.diminfo[0].shape)) __pyx_t_17 = 0; if (unlikely(__pyx_t_17 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_17); - __PYX_ERR(0, 110, __pyx_L1_error) + __PYX_ERR(0, 111, __pyx_L1_error) } __pyx_t_19 = (((__pyx_v_cur_pos[1]) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_box_lengths.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_box_lengths.diminfo[0].strides))) != 0); if (__pyx_t_19) { goto __pyx_L13_continue; } - /* "yt/utilities/lib/points_in_volume.pyx":111 + /* "yt/utilities/lib/points_in_volume.pyx":112 * if (cur_pos[0] > box_lengths[0]): continue * if (cur_pos[1] > box_lengths[1]): continue * if (cur_pos[2] > box_lengths[2]): continue # <<<<<<<<<<<<<< @@ -3131,14 +3214,14 @@ } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_box_lengths.diminfo[0].shape)) __pyx_t_17 = 0; if (unlikely(__pyx_t_17 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_17); - __PYX_ERR(0, 111, __pyx_L1_error) + __PYX_ERR(0, 112, __pyx_L1_error) } __pyx_t_19 = (((__pyx_v_cur_pos[2]) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_box_lengths.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_box_lengths.diminfo[0].strides))) != 0); if (__pyx_t_19) { goto __pyx_L13_continue; } - /* "yt/utilities/lib/points_in_volume.pyx":112 + /* "yt/utilities/lib/points_in_volume.pyx":113 * if (cur_pos[1] > box_lengths[1]): continue * if (cur_pos[2] > box_lengths[2]): continue * if (cur_pos[0] < 0.0): continue # <<<<<<<<<<<<<< @@ -3150,7 +3233,7 @@ goto __pyx_L13_continue; } - /* "yt/utilities/lib/points_in_volume.pyx":113 + /* "yt/utilities/lib/points_in_volume.pyx":114 * if (cur_pos[2] > box_lengths[2]): continue * if (cur_pos[0] < 0.0): continue * if (cur_pos[1] < 0.0): continue # <<<<<<<<<<<<<< @@ -3162,7 +3245,7 @@ goto __pyx_L13_continue; } - /* "yt/utilities/lib/points_in_volume.pyx":114 + /* "yt/utilities/lib/points_in_volume.pyx":115 * if (cur_pos[0] < 0.0): continue * if (cur_pos[1] < 0.0): continue * if (cur_pos[2] < 0.0): continue # <<<<<<<<<<<<<< @@ -3174,7 +3257,7 @@ goto __pyx_L13_continue; } - /* "yt/utilities/lib/points_in_volume.pyx":115 + /* "yt/utilities/lib/points_in_volume.pyx":116 * if (cur_pos[1] < 0.0): continue * if (cur_pos[2] < 0.0): continue * if break_first: # <<<<<<<<<<<<<< @@ -3184,14 +3267,14 @@ __pyx_t_19 = (__pyx_v_break_first != 0); if (__pyx_t_19) { - /* "yt/utilities/lib/points_in_volume.pyx":116 + /* "yt/utilities/lib/points_in_volume.pyx":117 * if (cur_pos[2] < 0.0): continue * if break_first: * if mask[i,j,k]: return 1 # <<<<<<<<<<<<<< * else: * mask[i,j,k] = 1 */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); @@ -3202,10 +3285,10 @@ __Pyx_INCREF(__pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_k); - __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_mask), __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_mask), __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_19) { __Pyx_XDECREF(__pyx_r); @@ -3217,7 +3300,7 @@ goto __pyx_L0; } - /* "yt/utilities/lib/points_in_volume.pyx":115 + /* "yt/utilities/lib/points_in_volume.pyx":116 * if (cur_pos[1] < 0.0): continue * if (cur_pos[2] < 0.0): continue * if break_first: # <<<<<<<<<<<<<< @@ -3227,7 +3310,7 @@ goto __pyx_L21; } - /* "yt/utilities/lib/points_in_volume.pyx":118 + /* "yt/utilities/lib/points_in_volume.pyx":119 * if mask[i,j,k]: return 1 * else: * mask[i,j,k] = 1 # <<<<<<<<<<<<<< @@ -3235,7 +3318,7 @@ * */ /*else*/ { - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); @@ -3246,12 +3329,12 @@ __Pyx_INCREF(__pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_k); - if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_mask), __pyx_t_9, __pyx_int_1) < 0)) __PYX_ERR(0, 118, __pyx_L1_error) + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_mask), __pyx_t_9, __pyx_int_1) < 0)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_L21:; - /* "yt/utilities/lib/points_in_volume.pyx":107 + /* "yt/utilities/lib/points_in_volume.pyx":108 * for i in range(n[0]): * for j in range(n[1]): * for k in range(n[2]): # <<<<<<<<<<<<<< @@ -3262,7 +3345,7 @@ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":106 + /* "yt/utilities/lib/points_in_volume.pyx":107 * * for i in range(n[0]): * for j in range(n[1]): # <<<<<<<<<<<<<< @@ -3272,7 +3355,7 @@ } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":105 + /* "yt/utilities/lib/points_in_volume.pyx":106 * rorigin[j] += (grid_left_edge[i] - box_origin[i]) * rot_mat[j,i] * * for i in range(n[0]): # <<<<<<<<<<<<<< @@ -3282,7 +3365,7 @@ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":119 + /* "yt/utilities/lib/points_in_volume.pyx":120 * else: * mask[i,j,k] = 1 * return 0 # <<<<<<<<<<<<<< @@ -3294,7 +3377,7 @@ __pyx_r = __pyx_int_0; goto __pyx_L0; - /* "yt/utilities/lib/points_in_volume.pyx":78 + /* "yt/utilities/lib/points_in_volume.pyx":79 * #@cython.wraparound(False) * #@cython.boundscheck(False) * def grid_points_in_volume( # <<<<<<<<<<<<<< @@ -3342,7 +3425,7 @@ return __pyx_r; } -/* "yt/utilities/lib/points_in_volume.pyx":121 +/* "yt/utilities/lib/points_in_volume.pyx":122 * return 0 * * cdef void normalize_vector(np.float64_t vec[3]): # <<<<<<<<<<<<<< @@ -3358,7 +3441,7 @@ int __pyx_t_2; __Pyx_RefNannySetupContext("normalize_vector", 0); - /* "yt/utilities/lib/points_in_volume.pyx":123 + /* "yt/utilities/lib/points_in_volume.pyx":124 * cdef void normalize_vector(np.float64_t vec[3]): * cdef int i * cdef np.float64_t norm = 0.0 # <<<<<<<<<<<<<< @@ -3367,38 +3450,38 @@ */ __pyx_v_norm = 0.0; - /* "yt/utilities/lib/points_in_volume.pyx":124 + /* "yt/utilities/lib/points_in_volume.pyx":125 * cdef int i * cdef np.float64_t norm = 0.0 * for i in range(3): # <<<<<<<<<<<<<< * norm += vec[i]*vec[i] - * norm = norm**0.5 + * norm = sqrt(norm) */ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/points_in_volume.pyx":125 + /* "yt/utilities/lib/points_in_volume.pyx":126 * cdef np.float64_t norm = 0.0 * for i in range(3): * norm += vec[i]*vec[i] # <<<<<<<<<<<<<< - * norm = norm**0.5 + * norm = sqrt(norm) * for i in range(3): */ __pyx_v_norm = (__pyx_v_norm + ((__pyx_v_vec[__pyx_v_i]) * (__pyx_v_vec[__pyx_v_i]))); } - /* "yt/utilities/lib/points_in_volume.pyx":126 + /* "yt/utilities/lib/points_in_volume.pyx":127 * for i in range(3): * norm += vec[i]*vec[i] - * norm = norm**0.5 # <<<<<<<<<<<<<< + * norm = sqrt(norm) # <<<<<<<<<<<<<< * for i in range(3): * vec[i] /= norm */ - __pyx_v_norm = pow(__pyx_v_norm, ((__pyx_t_5numpy_float64_t)0.5)); + __pyx_v_norm = sqrt(__pyx_v_norm); - /* "yt/utilities/lib/points_in_volume.pyx":127 + /* "yt/utilities/lib/points_in_volume.pyx":128 * norm += vec[i]*vec[i] - * norm = norm**0.5 + * norm = sqrt(norm) * for i in range(3): # <<<<<<<<<<<<<< * vec[i] /= norm * @@ -3406,8 +3489,8 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/points_in_volume.pyx":128 - * norm = norm**0.5 + /* "yt/utilities/lib/points_in_volume.pyx":129 + * norm = sqrt(norm) * for i in range(3): * vec[i] /= norm # <<<<<<<<<<<<<< * @@ -3416,12 +3499,12 @@ __pyx_t_2 = __pyx_v_i; if (unlikely(__pyx_v_norm == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 128, __pyx_L1_error) + __PYX_ERR(0, 129, __pyx_L1_error) } (__pyx_v_vec[__pyx_t_2]) = ((__pyx_v_vec[__pyx_t_2]) / __pyx_v_norm); } - /* "yt/utilities/lib/points_in_volume.pyx":121 + /* "yt/utilities/lib/points_in_volume.pyx":122 * return 0 * * cdef void normalize_vector(np.float64_t vec[3]): # <<<<<<<<<<<<<< @@ -3432,12 +3515,12 @@ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.utilities.lib.points_in_volume.normalize_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.points_in_volume.normalize_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/points_in_volume.pyx":130 +/* "yt/utilities/lib/points_in_volume.pyx":131 * vec[i] /= norm * * cdef void get_cross_product(np.float64_t v1[3], # <<<<<<<<<<<<<< @@ -3449,7 +3532,7 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_cross_product", 0); - /* "yt/utilities/lib/points_in_volume.pyx":133 + /* "yt/utilities/lib/points_in_volume.pyx":134 * np.float64_t v2[3], * np.float64_t cp[3]): * cp[0] = v1[1]*v2[2] - v1[2]*v2[1] # <<<<<<<<<<<<<< @@ -3458,7 +3541,7 @@ */ (__pyx_v_cp[0]) = (((__pyx_v_v1[1]) * (__pyx_v_v2[2])) - ((__pyx_v_v1[2]) * (__pyx_v_v2[1]))); - /* "yt/utilities/lib/points_in_volume.pyx":134 + /* "yt/utilities/lib/points_in_volume.pyx":135 * np.float64_t cp[3]): * cp[0] = v1[1]*v2[2] - v1[2]*v2[1] * cp[1] = v1[3]*v2[0] - v1[0]*v2[3] # <<<<<<<<<<<<<< @@ -3467,7 +3550,7 @@ */ (__pyx_v_cp[1]) = (((__pyx_v_v1[3]) * (__pyx_v_v2[0])) - ((__pyx_v_v1[0]) * (__pyx_v_v2[3]))); - /* "yt/utilities/lib/points_in_volume.pyx":135 + /* "yt/utilities/lib/points_in_volume.pyx":136 * cp[0] = v1[1]*v2[2] - v1[2]*v2[1] * cp[1] = v1[3]*v2[0] - v1[0]*v2[3] * cp[2] = v1[0]*v2[1] - v1[1]*v2[0] # <<<<<<<<<<<<<< @@ -3476,7 +3559,7 @@ */ (__pyx_v_cp[2]) = (((__pyx_v_v1[0]) * (__pyx_v_v2[1])) - ((__pyx_v_v1[1]) * (__pyx_v_v2[0]))); - /* "yt/utilities/lib/points_in_volume.pyx":130 + /* "yt/utilities/lib/points_in_volume.pyx":131 * vec[i] /= norm * * cdef void get_cross_product(np.float64_t v1[3], # <<<<<<<<<<<<<< @@ -3488,7 +3571,7 @@ __Pyx_RefNannyFinishContext(); } -/* "yt/utilities/lib/points_in_volume.pyx":138 +/* "yt/utilities/lib/points_in_volume.pyx":139 * #print cp[0], cp[1], cp[2] * * cdef int check_projected_overlap( # <<<<<<<<<<<<<< @@ -3510,7 +3593,7 @@ int __pyx_t_2; __Pyx_RefNannySetupContext("check_projected_overlap", 0); - /* "yt/utilities/lib/points_in_volume.pyx":143 + /* "yt/utilities/lib/points_in_volume.pyx":144 * cdef int g_ax, b_ax * cdef np.float64_t tba, tga, ba, ga, sep_dot * ba = ga = sep_dot = 0.0 # <<<<<<<<<<<<<< @@ -3521,7 +3604,7 @@ __pyx_v_ga = 0.0; __pyx_v_sep_dot = 0.0; - /* "yt/utilities/lib/points_in_volume.pyx":144 + /* "yt/utilities/lib/points_in_volume.pyx":145 * cdef np.float64_t tba, tga, ba, ga, sep_dot * ba = ga = sep_dot = 0.0 * for g_ax in range(3): # <<<<<<<<<<<<<< @@ -3531,7 +3614,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_g_ax = __pyx_t_1; - /* "yt/utilities/lib/points_in_volume.pyx":146 + /* "yt/utilities/lib/points_in_volume.pyx":147 * for g_ax in range(3): * # We need the grid vectors, which we'll precompute here * tba = tga = 0.0 # <<<<<<<<<<<<<< @@ -3541,7 +3624,7 @@ __pyx_v_tba = 0.0; __pyx_v_tga = 0.0; - /* "yt/utilities/lib/points_in_volume.pyx":147 + /* "yt/utilities/lib/points_in_volume.pyx":148 * # We need the grid vectors, which we'll precompute here * tba = tga = 0.0 * for b_ax in range(3): # <<<<<<<<<<<<<< @@ -3551,7 +3634,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_b_ax = __pyx_t_2; - /* "yt/utilities/lib/points_in_volume.pyx":148 + /* "yt/utilities/lib/points_in_volume.pyx":149 * tba = tga = 0.0 * for b_ax in range(3): * tba += b_vec[g_ax][b_ax] * sep_vec[b_ax] # <<<<<<<<<<<<<< @@ -3560,7 +3643,7 @@ */ __pyx_v_tba = (__pyx_v_tba + (((__pyx_v_b_vec[__pyx_v_g_ax])[__pyx_v_b_ax]) * (__pyx_v_sep_vec[__pyx_v_b_ax]))); - /* "yt/utilities/lib/points_in_volume.pyx":149 + /* "yt/utilities/lib/points_in_volume.pyx":150 * for b_ax in range(3): * tba += b_vec[g_ax][b_ax] * sep_vec[b_ax] * tga += g_vec[g_ax][b_ax] * sep_vec[b_ax] # <<<<<<<<<<<<<< @@ -3570,7 +3653,7 @@ __pyx_v_tga = (__pyx_v_tga + (((__pyx_v_g_vec[__pyx_v_g_ax])[__pyx_v_b_ax]) * (__pyx_v_sep_vec[__pyx_v_b_ax]))); } - /* "yt/utilities/lib/points_in_volume.pyx":150 + /* "yt/utilities/lib/points_in_volume.pyx":151 * tba += b_vec[g_ax][b_ax] * sep_vec[b_ax] * tga += g_vec[g_ax][b_ax] * sep_vec[b_ax] * ba += fabs(tba) # <<<<<<<<<<<<<< @@ -3579,7 +3662,7 @@ */ __pyx_v_ba = (__pyx_v_ba + fabs(__pyx_v_tba)); - /* "yt/utilities/lib/points_in_volume.pyx":151 + /* "yt/utilities/lib/points_in_volume.pyx":152 * tga += g_vec[g_ax][b_ax] * sep_vec[b_ax] * ba += fabs(tba) * ga += fabs(tga) # <<<<<<<<<<<<<< @@ -3588,7 +3671,7 @@ */ __pyx_v_ga = (__pyx_v_ga + fabs(__pyx_v_tga)); - /* "yt/utilities/lib/points_in_volume.pyx":152 + /* "yt/utilities/lib/points_in_volume.pyx":153 * ba += fabs(tba) * ga += fabs(tga) * sep_dot += sep_vec[g_ax] * sep_ax[g_ax] # <<<<<<<<<<<<<< @@ -3598,7 +3681,7 @@ __pyx_v_sep_dot = (__pyx_v_sep_dot + ((__pyx_v_sep_vec[__pyx_v_g_ax]) * (__pyx_v_sep_ax[__pyx_v_g_ax]))); } - /* "yt/utilities/lib/points_in_volume.pyx":155 + /* "yt/utilities/lib/points_in_volume.pyx":156 * #print sep_vec[0], sep_vec[1], sep_vec[2], * #print sep_ax[0], sep_ax[1], sep_ax[2] * return (fabs(sep_dot) > ba+ga) # <<<<<<<<<<<<<< @@ -3608,7 +3691,7 @@ __pyx_r = (fabs(__pyx_v_sep_dot) > (__pyx_v_ba + __pyx_v_ga)); goto __pyx_L0; - /* "yt/utilities/lib/points_in_volume.pyx":138 + /* "yt/utilities/lib/points_in_volume.pyx":139 * #print cp[0], cp[1], cp[2] * * cdef int check_projected_overlap( # <<<<<<<<<<<<<< @@ -3622,7 +3705,7 @@ return __pyx_r; } -/* "yt/utilities/lib/points_in_volume.pyx":160 +/* "yt/utilities/lib/points_in_volume.pyx":161 * @cython.wraparound(False) * @cython.boundscheck(False) * def find_grids_in_inclined_box( # <<<<<<<<<<<<<< @@ -3649,9 +3732,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -3660,24 +3747,27 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_box_vectors)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_box_center)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_grids_in_inclined_box", 1, 4, 4, 1); __PYX_ERR(0, 160, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_grids_in_inclined_box", 1, 4, 4, 1); __PYX_ERR(0, 161, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid_left_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_grids_in_inclined_box", 1, 4, 4, 2); __PYX_ERR(0, 160, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_grids_in_inclined_box", 1, 4, 4, 2); __PYX_ERR(0, 161, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid_right_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_grids_in_inclined_box", 1, 4, 4, 3); __PYX_ERR(0, 160, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_grids_in_inclined_box", 1, 4, 4, 3); __PYX_ERR(0, 161, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_grids_in_inclined_box") < 0)) __PYX_ERR(0, 160, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_grids_in_inclined_box") < 0)) __PYX_ERR(0, 161, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -3694,16 +3784,16 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_grids_in_inclined_box", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 160, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_grids_in_inclined_box", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 161, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.points_in_volume.find_grids_in_inclined_box", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_vectors), __pyx_ptype_5numpy_ndarray, 1, "box_vectors", 0))) __PYX_ERR(0, 161, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_center), __pyx_ptype_5numpy_ndarray, 1, "box_center", 0))) __PYX_ERR(0, 162, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grid_left_edges), __pyx_ptype_5numpy_ndarray, 1, "grid_left_edges", 0))) __PYX_ERR(0, 163, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grid_right_edges), __pyx_ptype_5numpy_ndarray, 1, "grid_right_edges", 0))) __PYX_ERR(0, 164, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_vectors), __pyx_ptype_5numpy_ndarray, 1, "box_vectors", 0))) __PYX_ERR(0, 162, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_center), __pyx_ptype_5numpy_ndarray, 1, "box_center", 0))) __PYX_ERR(0, 163, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grid_left_edges), __pyx_ptype_5numpy_ndarray, 1, "grid_left_edges", 0))) __PYX_ERR(0, 164, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grid_right_edges), __pyx_ptype_5numpy_ndarray, 1, "grid_right_edges", 0))) __PYX_ERR(0, 165, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_16points_in_volume_4find_grids_in_inclined_box(__pyx_self, __pyx_v_box_vectors, __pyx_v_box_center, __pyx_v_grid_left_edges, __pyx_v_grid_right_edges); /* function exit code */ @@ -3791,26 +3881,26 @@ __pyx_pybuffernd_grid_right_edges.rcbuffer = &__pyx_pybuffer_grid_right_edges; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box_vectors.rcbuffer->pybuffer, (PyObject*)__pyx_v_box_vectors, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 160, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box_vectors.rcbuffer->pybuffer, (PyObject*)__pyx_v_box_vectors, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 161, __pyx_L1_error) } __pyx_pybuffernd_box_vectors.diminfo[0].strides = __pyx_pybuffernd_box_vectors.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_box_vectors.diminfo[0].shape = __pyx_pybuffernd_box_vectors.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_box_vectors.diminfo[1].strides = __pyx_pybuffernd_box_vectors.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_box_vectors.diminfo[1].shape = __pyx_pybuffernd_box_vectors.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box_center.rcbuffer->pybuffer, (PyObject*)__pyx_v_box_center, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 160, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box_center.rcbuffer->pybuffer, (PyObject*)__pyx_v_box_center, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 161, __pyx_L1_error) } __pyx_pybuffernd_box_center.diminfo[0].strides = __pyx_pybuffernd_box_center.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_box_center.diminfo[0].shape = __pyx_pybuffernd_box_center.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grid_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_grid_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 160, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grid_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_grid_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 161, __pyx_L1_error) } __pyx_pybuffernd_grid_left_edges.diminfo[0].strides = __pyx_pybuffernd_grid_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grid_left_edges.diminfo[0].shape = __pyx_pybuffernd_grid_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grid_left_edges.diminfo[1].strides = __pyx_pybuffernd_grid_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grid_left_edges.diminfo[1].shape = __pyx_pybuffernd_grid_left_edges.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grid_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_grid_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 160, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grid_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_grid_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 161, __pyx_L1_error) } __pyx_pybuffernd_grid_right_edges.diminfo[0].strides = __pyx_pybuffernd_grid_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grid_right_edges.diminfo[0].shape = __pyx_pybuffernd_grid_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grid_right_edges.diminfo[1].strides = __pyx_pybuffernd_grid_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grid_right_edges.diminfo[1].shape = __pyx_pybuffernd_grid_right_edges.rcbuffer->pybuffer.shape[1]; - /* "yt/utilities/lib/points_in_volume.pyx":167 + /* "yt/utilities/lib/points_in_volume.pyx":168 * * # http://www.gamasutra.com/view/feature/3383/simple_intersection_tests_for_games.php?page=5 * cdef int n = grid_right_edges.shape[0] # <<<<<<<<<<<<<< @@ -3819,40 +3909,40 @@ */ __pyx_v_n = (__pyx_v_grid_right_edges->dimensions[0]); - /* "yt/utilities/lib/points_in_volume.pyx":174 + /* "yt/utilities/lib/points_in_volume.pyx":175 * cdef np.float64_t sep_ax[15][3] * cdef np.float64_t sep_vec[3] * cdef np.ndarray[np.int32_t, ndim=1] good = np.zeros(n, dtype='int32') # <<<<<<<<<<<<<< * cdef np.ndarray[np.float64_t, ndim=2] grid_centers * # Fill in our axis unit vectors */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __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, 174, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __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); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 174, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __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_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, 174, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 175, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_good.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_good = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_good.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 174, __pyx_L1_error) + __PYX_ERR(0, 175, __pyx_L1_error) } else {__pyx_pybuffernd_good.diminfo[0].strides = __pyx_pybuffernd_good.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_good.diminfo[0].shape = __pyx_pybuffernd_good.rcbuffer->pybuffer.shape[0]; } } @@ -3860,7 +3950,7 @@ __pyx_v_good = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":177 + /* "yt/utilities/lib/points_in_volume.pyx":178 * cdef np.ndarray[np.float64_t, ndim=2] grid_centers * # Fill in our axis unit vectors * for b_ax in range(3): # <<<<<<<<<<<<<< @@ -3870,7 +3960,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_b_ax = __pyx_t_6; - /* "yt/utilities/lib/points_in_volume.pyx":178 + /* "yt/utilities/lib/points_in_volume.pyx":179 * # Fill in our axis unit vectors * for b_ax in range(3): * for g_ax in range(3): # <<<<<<<<<<<<<< @@ -3880,7 +3970,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) { __pyx_v_g_ax = __pyx_t_7; - /* "yt/utilities/lib/points_in_volume.pyx":179 + /* "yt/utilities/lib/points_in_volume.pyx":180 * for b_ax in range(3): * for g_ax in range(3): * a_vec[b_ax][g_ax] = (b_ax == g_ax) # <<<<<<<<<<<<<< @@ -3891,19 +3981,19 @@ } } - /* "yt/utilities/lib/points_in_volume.pyx":180 + /* "yt/utilities/lib/points_in_volume.pyx":181 * for g_ax in range(3): * a_vec[b_ax][g_ax] = (b_ax == g_ax) * grid_centers = (grid_right_edges + grid_left_edges)/2.0 # <<<<<<<<<<<<<< * * # Now we pre-compute our candidate separating axes, because the unit */ - __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_grid_right_edges), ((PyObject *)__pyx_v_grid_left_edges)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_grid_right_edges), ((PyObject *)__pyx_v_grid_left_edges)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_t_4, __pyx_float_2_0, 2.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_t_4, __pyx_float_2_0, 2.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 180, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 181, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3919,13 +4009,13 @@ } } __pyx_pybuffernd_grid_centers.diminfo[0].strides = __pyx_pybuffernd_grid_centers.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grid_centers.diminfo[0].shape = __pyx_pybuffernd_grid_centers.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grid_centers.diminfo[1].strides = __pyx_pybuffernd_grid_centers.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grid_centers.diminfo[1].shape = __pyx_pybuffernd_grid_centers.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 180, __pyx_L1_error) + if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 181, __pyx_L1_error) } __pyx_t_8 = 0; __pyx_v_grid_centers = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":184 + /* "yt/utilities/lib/points_in_volume.pyx":185 * # Now we pre-compute our candidate separating axes, because the unit * # vectors for all the grids are identical * for b_ax in range(3): # <<<<<<<<<<<<<< @@ -3935,7 +4025,7 @@ for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { __pyx_v_b_ax = __pyx_t_6; - /* "yt/utilities/lib/points_in_volume.pyx":187 + /* "yt/utilities/lib/points_in_volume.pyx":188 * # We have 6 principal axes we already know, which are the grid (domain) * # principal axes and the box axes * sep_ax[b_ax][0] = sep_ax[b_ax][1] = sep_ax[b_ax][2] = 0.0 # <<<<<<<<<<<<<< @@ -3946,7 +4036,7 @@ ((__pyx_v_sep_ax[__pyx_v_b_ax])[1]) = 0.0; ((__pyx_v_sep_ax[__pyx_v_b_ax])[2]) = 0.0; - /* "yt/utilities/lib/points_in_volume.pyx":188 + /* "yt/utilities/lib/points_in_volume.pyx":189 * # principal axes and the box axes * sep_ax[b_ax][0] = sep_ax[b_ax][1] = sep_ax[b_ax][2] = 0.0 * sep_ax[b_ax][b_ax] = 1.0 # delta_ijk, for grid axes # <<<<<<<<<<<<<< @@ -3955,7 +4045,7 @@ */ ((__pyx_v_sep_ax[__pyx_v_b_ax])[__pyx_v_b_ax]) = 1.0; - /* "yt/utilities/lib/points_in_volume.pyx":189 + /* "yt/utilities/lib/points_in_volume.pyx":190 * sep_ax[b_ax][0] = sep_ax[b_ax][1] = sep_ax[b_ax][2] = 0.0 * sep_ax[b_ax][b_ax] = 1.0 # delta_ijk, for grid axes * for g_ax in range(3): # <<<<<<<<<<<<<< @@ -3965,7 +4055,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) { __pyx_v_g_ax = __pyx_t_7; - /* "yt/utilities/lib/points_in_volume.pyx":190 + /* "yt/utilities/lib/points_in_volume.pyx":191 * sep_ax[b_ax][b_ax] = 1.0 # delta_ijk, for grid axes * for g_ax in range(3): * b_vec[b_ax][g_ax] = 0.5*box_vectors[b_ax,g_ax] # <<<<<<<<<<<<<< @@ -3976,7 +4066,7 @@ __pyx_t_13 = __pyx_v_g_ax; ((__pyx_v_b_vec[__pyx_v_b_ax])[__pyx_v_g_ax]) = (0.5 * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_box_vectors.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_box_vectors.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_box_vectors.diminfo[1].strides))); - /* "yt/utilities/lib/points_in_volume.pyx":191 + /* "yt/utilities/lib/points_in_volume.pyx":192 * for g_ax in range(3): * b_vec[b_ax][g_ax] = 0.5*box_vectors[b_ax,g_ax] * sep_ax[b_ax + 3][g_ax] = b_vec[b_ax][g_ax] # box axes # <<<<<<<<<<<<<< @@ -3986,7 +4076,7 @@ ((__pyx_v_sep_ax[(__pyx_v_b_ax + 3)])[__pyx_v_g_ax]) = ((__pyx_v_b_vec[__pyx_v_b_ax])[__pyx_v_g_ax]); } - /* "yt/utilities/lib/points_in_volume.pyx":192 + /* "yt/utilities/lib/points_in_volume.pyx":193 * b_vec[b_ax][g_ax] = 0.5*box_vectors[b_ax,g_ax] * sep_ax[b_ax + 3][g_ax] = b_vec[b_ax][g_ax] # box axes * normalize_vector(sep_ax[b_ax + 3]) # <<<<<<<<<<<<<< @@ -3995,7 +4085,7 @@ */ __pyx_f_2yt_9utilities_3lib_16points_in_volume_normalize_vector((__pyx_v_sep_ax[(__pyx_v_b_ax + 3)])); - /* "yt/utilities/lib/points_in_volume.pyx":193 + /* "yt/utilities/lib/points_in_volume.pyx":194 * sep_ax[b_ax + 3][g_ax] = b_vec[b_ax][g_ax] # box axes * normalize_vector(sep_ax[b_ax + 3]) * for g_ax in range(3): # <<<<<<<<<<<<<< @@ -4005,7 +4095,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) { __pyx_v_g_ax = __pyx_t_7; - /* "yt/utilities/lib/points_in_volume.pyx":194 + /* "yt/utilities/lib/points_in_volume.pyx":195 * normalize_vector(sep_ax[b_ax + 3]) * for g_ax in range(3): * get_cross_product(b_vec[b_ax], a_vec[g_ax], sep_ax[b_ax*3 + g_ax + 6]) # <<<<<<<<<<<<<< @@ -4014,7 +4104,7 @@ */ __pyx_f_2yt_9utilities_3lib_16points_in_volume_get_cross_product((__pyx_v_b_vec[__pyx_v_b_ax]), (__pyx_v_a_vec[__pyx_v_g_ax]), (__pyx_v_sep_ax[(((__pyx_v_b_ax * 3) + __pyx_v_g_ax) + 6)])); - /* "yt/utilities/lib/points_in_volume.pyx":195 + /* "yt/utilities/lib/points_in_volume.pyx":196 * for g_ax in range(3): * get_cross_product(b_vec[b_ax], a_vec[g_ax], sep_ax[b_ax*3 + g_ax + 6]) * normalize_vector(sep_ax[b_ax*3 + g_ax + 6]) # <<<<<<<<<<<<<< @@ -4025,7 +4115,7 @@ } } - /* "yt/utilities/lib/points_in_volume.pyx":197 + /* "yt/utilities/lib/points_in_volume.pyx":198 * normalize_vector(sep_ax[b_ax*3 + g_ax + 6]) * * for gi in range(n): # <<<<<<<<<<<<<< @@ -4036,7 +4126,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_gi = __pyx_t_7; - /* "yt/utilities/lib/points_in_volume.pyx":198 + /* "yt/utilities/lib/points_in_volume.pyx":199 * * for gi in range(n): * for g_ax in range(3): # <<<<<<<<<<<<<< @@ -4046,7 +4136,7 @@ for (__pyx_t_14 = 0; __pyx_t_14 < 3; __pyx_t_14+=1) { __pyx_v_g_ax = __pyx_t_14; - /* "yt/utilities/lib/points_in_volume.pyx":200 + /* "yt/utilities/lib/points_in_volume.pyx":201 * for g_ax in range(3): * # Calculate the separation vector * sep_vec[g_ax] = grid_centers[gi, g_ax] - box_center[g_ax] # <<<<<<<<<<<<<< @@ -4058,7 +4148,7 @@ __pyx_t_17 = __pyx_v_g_ax; (__pyx_v_sep_vec[__pyx_v_g_ax]) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_centers.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_grid_centers.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_grid_centers.diminfo[1].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_box_center.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_box_center.diminfo[0].strides))); - /* "yt/utilities/lib/points_in_volume.pyx":202 + /* "yt/utilities/lib/points_in_volume.pyx":203 * sep_vec[g_ax] = grid_centers[gi, g_ax] - box_center[g_ax] * # Calculate the grid axis lengths * g_vec[g_ax][0] = g_vec[g_ax][1] = g_vec[g_ax][2] = 0.0 # <<<<<<<<<<<<<< @@ -4069,7 +4159,7 @@ ((__pyx_v_g_vec[__pyx_v_g_ax])[1]) = 0.0; ((__pyx_v_g_vec[__pyx_v_g_ax])[2]) = 0.0; - /* "yt/utilities/lib/points_in_volume.pyx":203 + /* "yt/utilities/lib/points_in_volume.pyx":204 * # Calculate the grid axis lengths * g_vec[g_ax][0] = g_vec[g_ax][1] = g_vec[g_ax][2] = 0.0 * g_vec[g_ax][g_ax] = 0.5 * (grid_right_edges[gi, g_ax] # <<<<<<<<<<<<<< @@ -4079,7 +4169,7 @@ __pyx_t_18 = __pyx_v_gi; __pyx_t_19 = __pyx_v_g_ax; - /* "yt/utilities/lib/points_in_volume.pyx":204 + /* "yt/utilities/lib/points_in_volume.pyx":205 * g_vec[g_ax][0] = g_vec[g_ax][1] = g_vec[g_ax][2] = 0.0 * g_vec[g_ax][g_ax] = 0.5 * (grid_right_edges[gi, g_ax] * - grid_left_edges[gi, g_ax]) # <<<<<<<<<<<<<< @@ -4089,7 +4179,7 @@ __pyx_t_20 = __pyx_v_gi; __pyx_t_21 = __pyx_v_g_ax; - /* "yt/utilities/lib/points_in_volume.pyx":203 + /* "yt/utilities/lib/points_in_volume.pyx":204 * # Calculate the grid axis lengths * g_vec[g_ax][0] = g_vec[g_ax][1] = g_vec[g_ax][2] = 0.0 * g_vec[g_ax][g_ax] = 0.5 * (grid_right_edges[gi, g_ax] # <<<<<<<<<<<<<< @@ -4099,7 +4189,7 @@ ((__pyx_v_g_vec[__pyx_v_g_ax])[__pyx_v_g_ax]) = (0.5 * ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_right_edges.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_grid_right_edges.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_grid_right_edges.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_left_edges.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_grid_left_edges.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_grid_left_edges.diminfo[1].strides)))); } - /* "yt/utilities/lib/points_in_volume.pyx":205 + /* "yt/utilities/lib/points_in_volume.pyx":206 * g_vec[g_ax][g_ax] = 0.5 * (grid_right_edges[gi, g_ax] * - grid_left_edges[gi, g_ax]) * for b_ax in range(15): # <<<<<<<<<<<<<< @@ -4109,7 +4199,7 @@ for (__pyx_t_14 = 0; __pyx_t_14 < 15; __pyx_t_14+=1) { __pyx_v_b_ax = __pyx_t_14; - /* "yt/utilities/lib/points_in_volume.pyx":207 + /* "yt/utilities/lib/points_in_volume.pyx":208 * for b_ax in range(15): * #print b_ax, * if check_projected_overlap( # <<<<<<<<<<<<<< @@ -4119,7 +4209,7 @@ __pyx_t_22 = (__pyx_f_2yt_9utilities_3lib_16points_in_volume_check_projected_overlap((__pyx_v_sep_ax[__pyx_v_b_ax]), __pyx_v_sep_vec, __pyx_v_gi, __pyx_v_b_vec, __pyx_v_g_vec) != 0); if (__pyx_t_22) { - /* "yt/utilities/lib/points_in_volume.pyx":210 + /* "yt/utilities/lib/points_in_volume.pyx":211 * sep_ax[b_ax], sep_vec, gi, * b_vec, g_vec): * good[gi] = 1 # <<<<<<<<<<<<<< @@ -4129,7 +4219,7 @@ __pyx_t_23 = __pyx_v_gi; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_good.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_good.diminfo[0].strides) = 1; - /* "yt/utilities/lib/points_in_volume.pyx":211 + /* "yt/utilities/lib/points_in_volume.pyx":212 * b_vec, g_vec): * good[gi] = 1 * break # <<<<<<<<<<<<<< @@ -4138,7 +4228,7 @@ */ goto __pyx_L18_break; - /* "yt/utilities/lib/points_in_volume.pyx":207 + /* "yt/utilities/lib/points_in_volume.pyx":208 * for b_ax in range(15): * #print b_ax, * if check_projected_overlap( # <<<<<<<<<<<<<< @@ -4150,7 +4240,7 @@ __pyx_L18_break:; } - /* "yt/utilities/lib/points_in_volume.pyx":212 + /* "yt/utilities/lib/points_in_volume.pyx":213 * good[gi] = 1 * break * return good # <<<<<<<<<<<<<< @@ -4162,7 +4252,7 @@ __pyx_r = ((PyObject *)__pyx_v_good); goto __pyx_L0; - /* "yt/utilities/lib/points_in_volume.pyx":160 + /* "yt/utilities/lib/points_in_volume.pyx":161 * @cython.wraparound(False) * @cython.boundscheck(False) * def find_grids_in_inclined_box( # <<<<<<<<<<<<<< @@ -4205,7 +4295,7 @@ return __pyx_r; } -/* "yt/utilities/lib/points_in_volume.pyx":214 +/* "yt/utilities/lib/points_in_volume.pyx":215 * return good * * def calculate_fill_grids(int fill_level, int refratio, int last_level, # <<<<<<<<<<<<<< @@ -4237,14 +4327,23 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -4253,49 +4352,57 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_refratio)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 1); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 1); __PYX_ERR(0, 215, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_level)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 2); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 2); __PYX_ERR(0, 215, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_width)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 3); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 3); __PYX_ERR(0, 215, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cg_start_index)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 4); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 4); __PYX_ERR(0, 215, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cg_dims)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 5); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 5); __PYX_ERR(0, 215, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g_start_index)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 6); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 6); __PYX_ERR(0, 215, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g_dims)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 7); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 7); __PYX_ERR(0, 215, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g_child_mask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 8); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, 8); __PYX_ERR(0, 215, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculate_fill_grids") < 0)) __PYX_ERR(0, 214, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculate_fill_grids") < 0)) __PYX_ERR(0, 215, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; @@ -4310,9 +4417,9 @@ values[7] = PyTuple_GET_ITEM(__pyx_args, 7); values[8] = PyTuple_GET_ITEM(__pyx_args, 8); } - __pyx_v_fill_level = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_fill_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error) - __pyx_v_refratio = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_refratio == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error) - __pyx_v_last_level = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_last_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_fill_level = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_fill_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_refratio = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_refratio == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_last_level = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_last_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) __pyx_v_domain_width = ((PyArrayObject *)values[3]); __pyx_v_cg_start_index = ((PyArrayObject *)values[4]); __pyx_v_cg_dims = ((PyArrayObject *)values[5]); @@ -4322,18 +4429,18 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_fill_grids", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 215, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("yt.utilities.lib.points_in_volume.calculate_fill_grids", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain_width), __pyx_ptype_5numpy_ndarray, 1, "domain_width", 0))) __PYX_ERR(0, 215, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cg_start_index), __pyx_ptype_5numpy_ndarray, 1, "cg_start_index", 0))) __PYX_ERR(0, 216, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cg_dims), __pyx_ptype_5numpy_ndarray, 1, "cg_dims", 0))) __PYX_ERR(0, 217, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g_start_index), __pyx_ptype_5numpy_ndarray, 1, "g_start_index", 0))) __PYX_ERR(0, 218, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g_dims), __pyx_ptype_5numpy_ndarray, 1, "g_dims", 0))) __PYX_ERR(0, 219, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g_child_mask), __pyx_ptype_5numpy_ndarray, 1, "g_child_mask", 0))) __PYX_ERR(0, 220, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain_width), __pyx_ptype_5numpy_ndarray, 1, "domain_width", 0))) __PYX_ERR(0, 216, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cg_start_index), __pyx_ptype_5numpy_ndarray, 1, "cg_start_index", 0))) __PYX_ERR(0, 217, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cg_dims), __pyx_ptype_5numpy_ndarray, 1, "cg_dims", 0))) __PYX_ERR(0, 218, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g_start_index), __pyx_ptype_5numpy_ndarray, 1, "g_start_index", 0))) __PYX_ERR(0, 219, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g_dims), __pyx_ptype_5numpy_ndarray, 1, "g_dims", 0))) __PYX_ERR(0, 220, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g_child_mask), __pyx_ptype_5numpy_ndarray, 1, "g_child_mask", 0))) __PYX_ERR(0, 221, __pyx_L1_error) __pyx_r = __pyx_pf_2yt_9utilities_3lib_16points_in_volume_6calculate_fill_grids(__pyx_self, __pyx_v_fill_level, __pyx_v_refratio, __pyx_v_last_level, __pyx_v_domain_width, __pyx_v_cg_start_index, __pyx_v_cg_dims, __pyx_v_g_start_index, __pyx_v_g_dims, __pyx_v_g_child_mask); /* function exit code */ @@ -4422,36 +4529,36 @@ __pyx_pybuffernd_g_child_mask.rcbuffer = &__pyx_pybuffer_g_child_mask; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_width.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_width, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_width.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_width, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 215, __pyx_L1_error) } __pyx_pybuffernd_domain_width.diminfo[0].strides = __pyx_pybuffernd_domain_width.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_width.diminfo[0].shape = __pyx_pybuffernd_domain_width.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cg_start_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_cg_start_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cg_start_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_cg_start_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 215, __pyx_L1_error) } __pyx_pybuffernd_cg_start_index.diminfo[0].strides = __pyx_pybuffernd_cg_start_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cg_start_index.diminfo[0].shape = __pyx_pybuffernd_cg_start_index.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cg_dims.rcbuffer->pybuffer, (PyObject*)__pyx_v_cg_dims, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cg_dims.rcbuffer->pybuffer, (PyObject*)__pyx_v_cg_dims, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 215, __pyx_L1_error) } __pyx_pybuffernd_cg_dims.diminfo[0].strides = __pyx_pybuffernd_cg_dims.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cg_dims.diminfo[0].shape = __pyx_pybuffernd_cg_dims.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_g_start_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_g_start_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_g_start_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_g_start_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 215, __pyx_L1_error) } __pyx_pybuffernd_g_start_index.diminfo[0].strides = __pyx_pybuffernd_g_start_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_g_start_index.diminfo[0].shape = __pyx_pybuffernd_g_start_index.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_g_dims.rcbuffer->pybuffer, (PyObject*)__pyx_v_g_dims, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_g_dims.rcbuffer->pybuffer, (PyObject*)__pyx_v_g_dims, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 215, __pyx_L1_error) } __pyx_pybuffernd_g_dims.diminfo[0].strides = __pyx_pybuffernd_g_dims.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_g_dims.diminfo[0].shape = __pyx_pybuffernd_g_dims.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_g_child_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_g_child_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_g_child_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_g_child_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 215, __pyx_L1_error) } __pyx_pybuffernd_g_child_mask.diminfo[0].strides = __pyx_pybuffernd_g_child_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_g_child_mask.diminfo[0].shape = __pyx_pybuffernd_g_child_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_g_child_mask.diminfo[1].strides = __pyx_pybuffernd_g_child_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_g_child_mask.diminfo[1].shape = __pyx_pybuffernd_g_child_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_g_child_mask.diminfo[2].strides = __pyx_pybuffernd_g_child_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_g_child_mask.diminfo[2].shape = __pyx_pybuffernd_g_child_mask.rcbuffer->pybuffer.shape[2]; - /* "yt/utilities/lib/points_in_volume.pyx":227 + /* "yt/utilities/lib/points_in_volume.pyx":228 * cdef np.int64_t dw[3] * cdef np.int64_t cxi, cyi, czi, gxi, gyi, gzi, ci, cj, ck * cdef int i, total = 0 # <<<<<<<<<<<<<< @@ -4460,7 +4567,7 @@ */ __pyx_v_total = 0; - /* "yt/utilities/lib/points_in_volume.pyx":228 + /* "yt/utilities/lib/points_in_volume.pyx":229 * cdef np.int64_t cxi, cyi, czi, gxi, gyi, gzi, ci, cj, ck * cdef int i, total = 0 * for i in range(3): # <<<<<<<<<<<<<< @@ -4470,7 +4577,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/points_in_volume.pyx":229 + /* "yt/utilities/lib/points_in_volume.pyx":230 * cdef int i, total = 0 * for i in range(3): * dw[i] = domain_width[i] # <<<<<<<<<<<<<< @@ -4485,11 +4592,11 @@ } else if (unlikely(__pyx_t_2 >= __pyx_pybuffernd_domain_width.diminfo[0].shape)) __pyx_t_3 = 0; if (unlikely(__pyx_t_3 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_3); - __PYX_ERR(0, 229, __pyx_L1_error) + __PYX_ERR(0, 230, __pyx_L1_error) } (__pyx_v_dw[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_domain_width.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_domain_width.diminfo[0].strides)); - /* "yt/utilities/lib/points_in_volume.pyx":230 + /* "yt/utilities/lib/points_in_volume.pyx":231 * for i in range(3): * dw[i] = domain_width[i] * cgstart[i] = cg_start_index[i] # <<<<<<<<<<<<<< @@ -4504,11 +4611,11 @@ } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_cg_start_index.diminfo[0].shape)) __pyx_t_3 = 0; if (unlikely(__pyx_t_3 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_3); - __PYX_ERR(0, 230, __pyx_L1_error) + __PYX_ERR(0, 231, __pyx_L1_error) } (__pyx_v_cgstart[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_cg_start_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_cg_start_index.diminfo[0].strides)); - /* "yt/utilities/lib/points_in_volume.pyx":231 + /* "yt/utilities/lib/points_in_volume.pyx":232 * dw[i] = domain_width[i] * cgstart[i] = cg_start_index[i] * gstart[i] = g_start_index[i] # <<<<<<<<<<<<<< @@ -4523,11 +4630,11 @@ } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_g_start_index.diminfo[0].shape)) __pyx_t_3 = 0; if (unlikely(__pyx_t_3 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_3); - __PYX_ERR(0, 231, __pyx_L1_error) + __PYX_ERR(0, 232, __pyx_L1_error) } (__pyx_v_gstart[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_g_start_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_g_start_index.diminfo[0].strides)); - /* "yt/utilities/lib/points_in_volume.pyx":232 + /* "yt/utilities/lib/points_in_volume.pyx":233 * cgstart[i] = cg_start_index[i] * gstart[i] = g_start_index[i] * cgend[i] = cgstart[i] + cg_dims[i] # <<<<<<<<<<<<<< @@ -4542,11 +4649,11 @@ } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_cg_dims.diminfo[0].shape)) __pyx_t_3 = 0; if (unlikely(__pyx_t_3 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_3); - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 233, __pyx_L1_error) } (__pyx_v_cgend[__pyx_v_i]) = ((__pyx_v_cgstart[__pyx_v_i]) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_cg_dims.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_cg_dims.diminfo[0].strides))); - /* "yt/utilities/lib/points_in_volume.pyx":233 + /* "yt/utilities/lib/points_in_volume.pyx":234 * gstart[i] = g_start_index[i] * cgend[i] = cgstart[i] + cg_dims[i] * gend[i] = gstart[i] + g_dims[i] # <<<<<<<<<<<<<< @@ -4561,12 +4668,12 @@ } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_g_dims.diminfo[0].shape)) __pyx_t_3 = 0; if (unlikely(__pyx_t_3 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_3); - __PYX_ERR(0, 233, __pyx_L1_error) + __PYX_ERR(0, 234, __pyx_L1_error) } (__pyx_v_gend[__pyx_v_i]) = ((__pyx_v_gstart[__pyx_v_i]) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_g_dims.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_g_dims.diminfo[0].strides))); } - /* "yt/utilities/lib/points_in_volume.pyx":234 + /* "yt/utilities/lib/points_in_volume.pyx":235 * cgend[i] = cgstart[i] + cg_dims[i] * gend[i] = gstart[i] + g_dims[i] * for cxi in range(cgstart[0], cgend[0]+1): # <<<<<<<<<<<<<< @@ -4577,7 +4684,7 @@ for (__pyx_t_9 = (__pyx_v_cgstart[0]); __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_cxi = __pyx_t_9; - /* "yt/utilities/lib/points_in_volume.pyx":235 + /* "yt/utilities/lib/points_in_volume.pyx":236 * gend[i] = gstart[i] + g_dims[i] * for cxi in range(cgstart[0], cgend[0]+1): * ci = (cxi % dw[0]) # <<<<<<<<<<<<<< @@ -4586,11 +4693,11 @@ */ if (unlikely((__pyx_v_dw[0]) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 235, __pyx_L1_error) + __PYX_ERR(0, 236, __pyx_L1_error) } __pyx_v_ci = __Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_cxi, (__pyx_v_dw[0])); - /* "yt/utilities/lib/points_in_volume.pyx":236 + /* "yt/utilities/lib/points_in_volume.pyx":237 * for cxi in range(cgstart[0], cgend[0]+1): * ci = (cxi % dw[0]) * if ci < 0: ci += dw[0] # <<<<<<<<<<<<<< @@ -4602,7 +4709,7 @@ __pyx_v_ci = (__pyx_v_ci + (__pyx_v_dw[0])); } - /* "yt/utilities/lib/points_in_volume.pyx":237 + /* "yt/utilities/lib/points_in_volume.pyx":238 * ci = (cxi % dw[0]) * if ci < 0: ci += dw[0] * if ci < gstart[0]*refratio or ci >= gend[0]*refratio: continue # <<<<<<<<<<<<<< @@ -4622,7 +4729,7 @@ goto __pyx_L5_continue; } - /* "yt/utilities/lib/points_in_volume.pyx":238 + /* "yt/utilities/lib/points_in_volume.pyx":239 * if ci < 0: ci += dw[0] * if ci < gstart[0]*refratio or ci >= gend[0]*refratio: continue * gxi = ( (ci / refratio)) - gstart[0] # <<<<<<<<<<<<<< @@ -4631,15 +4738,15 @@ */ if (unlikely(__pyx_v_refratio == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 238, __pyx_L1_error) + __PYX_ERR(0, 239, __pyx_L1_error) } else if (sizeof(__pyx_t_5numpy_int64_t) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_refratio == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_ci))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(0, 238, __pyx_L1_error) + __PYX_ERR(0, 239, __pyx_L1_error) } __pyx_v_gxi = (((__pyx_t_5numpy_int64_t)__Pyx_div___pyx_t_5numpy_int64_t(__pyx_v_ci, __pyx_v_refratio)) - (__pyx_v_gstart[0])); - /* "yt/utilities/lib/points_in_volume.pyx":239 + /* "yt/utilities/lib/points_in_volume.pyx":240 * if ci < gstart[0]*refratio or ci >= gend[0]*refratio: continue * gxi = ( (ci / refratio)) - gstart[0] * for cyi in range(cgstart[1], cgend[1]): # <<<<<<<<<<<<<< @@ -4650,7 +4757,7 @@ for (__pyx_t_13 = (__pyx_v_cgstart[1]); __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_cyi = __pyx_t_13; - /* "yt/utilities/lib/points_in_volume.pyx":240 + /* "yt/utilities/lib/points_in_volume.pyx":241 * gxi = ( (ci / refratio)) - gstart[0] * for cyi in range(cgstart[1], cgend[1]): * cj = (cyi % dw[1]) # <<<<<<<<<<<<<< @@ -4659,11 +4766,11 @@ */ if (unlikely((__pyx_v_dw[1]) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 240, __pyx_L1_error) + __PYX_ERR(0, 241, __pyx_L1_error) } __pyx_v_cj = __Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_cyi, (__pyx_v_dw[1])); - /* "yt/utilities/lib/points_in_volume.pyx":241 + /* "yt/utilities/lib/points_in_volume.pyx":242 * for cyi in range(cgstart[1], cgend[1]): * cj = (cyi % dw[1]) * if cj < 0: cj += dw[1] # <<<<<<<<<<<<<< @@ -4675,7 +4782,7 @@ __pyx_v_cj = (__pyx_v_cj + (__pyx_v_dw[1])); } - /* "yt/utilities/lib/points_in_volume.pyx":242 + /* "yt/utilities/lib/points_in_volume.pyx":243 * cj = (cyi % dw[1]) * if cj < 0: cj += dw[1] * if cj < gstart[1]*refratio or cj >= gend[1]*refratio: continue # <<<<<<<<<<<<<< @@ -4695,7 +4802,7 @@ goto __pyx_L11_continue; } - /* "yt/utilities/lib/points_in_volume.pyx":243 + /* "yt/utilities/lib/points_in_volume.pyx":244 * if cj < 0: cj += dw[1] * if cj < gstart[1]*refratio or cj >= gend[1]*refratio: continue * gyi = ( (cj / refratio)) - gstart[1] # <<<<<<<<<<<<<< @@ -4704,15 +4811,15 @@ */ if (unlikely(__pyx_v_refratio == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 243, __pyx_L1_error) + __PYX_ERR(0, 244, __pyx_L1_error) } else if (sizeof(__pyx_t_5numpy_int64_t) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_refratio == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_cj))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(0, 243, __pyx_L1_error) + __PYX_ERR(0, 244, __pyx_L1_error) } __pyx_v_gyi = (((__pyx_t_5numpy_int64_t)__Pyx_div___pyx_t_5numpy_int64_t(__pyx_v_cj, __pyx_v_refratio)) - (__pyx_v_gstart[1])); - /* "yt/utilities/lib/points_in_volume.pyx":244 + /* "yt/utilities/lib/points_in_volume.pyx":245 * if cj < gstart[1]*refratio or cj >= gend[1]*refratio: continue * gyi = ( (cj / refratio)) - gstart[1] * for czi in range(cgstart[2], cgend[2]): # <<<<<<<<<<<<<< @@ -4723,7 +4830,7 @@ for (__pyx_t_15 = (__pyx_v_cgstart[2]); __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { __pyx_v_czi = __pyx_t_15; - /* "yt/utilities/lib/points_in_volume.pyx":245 + /* "yt/utilities/lib/points_in_volume.pyx":246 * gyi = ( (cj / refratio)) - gstart[1] * for czi in range(cgstart[2], cgend[2]): * ck = (czi % dw[2]) # <<<<<<<<<<<<<< @@ -4732,11 +4839,11 @@ */ if (unlikely((__pyx_v_dw[2]) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 245, __pyx_L1_error) + __PYX_ERR(0, 246, __pyx_L1_error) } __pyx_v_ck = __Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_czi, (__pyx_v_dw[2])); - /* "yt/utilities/lib/points_in_volume.pyx":246 + /* "yt/utilities/lib/points_in_volume.pyx":247 * for czi in range(cgstart[2], cgend[2]): * ck = (czi % dw[2]) * if ck < 0: ck += dw[2] # <<<<<<<<<<<<<< @@ -4748,7 +4855,7 @@ __pyx_v_ck = (__pyx_v_ck + (__pyx_v_dw[2])); } - /* "yt/utilities/lib/points_in_volume.pyx":247 + /* "yt/utilities/lib/points_in_volume.pyx":248 * ck = (czi % dw[2]) * if ck < 0: ck += dw[2] * if ck < gstart[2]*refratio or cj >= gend[2]*refratio: continue # <<<<<<<<<<<<<< @@ -4768,7 +4875,7 @@ goto __pyx_L17_continue; } - /* "yt/utilities/lib/points_in_volume.pyx":248 + /* "yt/utilities/lib/points_in_volume.pyx":249 * if ck < 0: ck += dw[2] * if ck < gstart[2]*refratio or cj >= gend[2]*refratio: continue * gzi = ( (ck / refratio)) - gstart[2] # <<<<<<<<<<<<<< @@ -4777,15 +4884,15 @@ */ if (unlikely(__pyx_v_refratio == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 248, __pyx_L1_error) + __PYX_ERR(0, 249, __pyx_L1_error) } else if (sizeof(__pyx_t_5numpy_int64_t) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_refratio == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_ck))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(0, 248, __pyx_L1_error) + __PYX_ERR(0, 249, __pyx_L1_error) } __pyx_v_gzi = (((__pyx_t_5numpy_int64_t)__Pyx_div___pyx_t_5numpy_int64_t(__pyx_v_ck, __pyx_v_refratio)) - (__pyx_v_gstart[2])); - /* "yt/utilities/lib/points_in_volume.pyx":249 + /* "yt/utilities/lib/points_in_volume.pyx":250 * if ck < gstart[2]*refratio or cj >= gend[2]*refratio: continue * gzi = ( (ck / refratio)) - gstart[2] * if last_level or g_child_mask[gxi, gyi, gzi] > 0: total += 1 # <<<<<<<<<<<<<< @@ -4815,7 +4922,7 @@ } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_g_child_mask.diminfo[2].shape)) __pyx_t_1 = 2; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(0, 249, __pyx_L1_error) + __PYX_ERR(0, 250, __pyx_L1_error) } __pyx_t_11 = (((*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_g_child_mask.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_g_child_mask.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_g_child_mask.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_g_child_mask.diminfo[2].strides)) > 0) != 0); __pyx_t_10 = __pyx_t_11; @@ -4830,19 +4937,19 @@ __pyx_L5_continue:; } - /* "yt/utilities/lib/points_in_volume.pyx":250 + /* "yt/utilities/lib/points_in_volume.pyx":251 * gzi = ( (ck / refratio)) - gstart[2] * if last_level or g_child_mask[gxi, gyi, gzi] > 0: total += 1 * return total # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_total); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_total); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_r = __pyx_t_19; __pyx_t_19 = 0; goto __pyx_L0; - /* "yt/utilities/lib/points_in_volume.pyx":214 + /* "yt/utilities/lib/points_in_volume.pyx":215 * return good * * def calculate_fill_grids(int fill_level, int refratio, int last_level, # <<<<<<<<<<<<<< @@ -7061,7 +7168,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7109,7 +7216,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -7192,7 +7299,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7240,7 +7347,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -7323,7 +7430,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -7368,7 +7475,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -7422,7 +7529,6 @@ {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_a_vec, __pyx_k_a_vec, sizeof(__pyx_k_a_vec), 0, 0, 1, 1}, {&__pyx_n_s_b_ax, __pyx_k_b_ax, sizeof(__pyx_k_b_ax), 0, 0, 1, 1}, @@ -7440,6 +7546,7 @@ {&__pyx_n_s_ci, __pyx_k_ci, sizeof(__pyx_k_ci), 0, 0, 1, 1}, {&__pyx_n_s_cj, __pyx_k_cj, sizeof(__pyx_k_cj), 0, 0, 1, 1}, {&__pyx_n_s_ck, __pyx_k_ck, sizeof(__pyx_k_ck), 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_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, {&__pyx_n_s_cur_pos, __pyx_k_cur_pos, sizeof(__pyx_k_cur_pos), 0, 0, 1, 1}, {&__pyx_n_s_cxi, __pyx_k_cxi, sizeof(__pyx_k_cxi), 0, 0, 1, 1}, @@ -7509,17 +7616,18 @@ {&__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_valid, __pyx_k_valid, sizeof(__pyx_k_valid), 0, 0, 1, 1}, {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_points_in_volum, __pyx_k_yt_utilities_lib_points_in_volum, sizeof(__pyx_k_yt_utilities_lib_points_in_volum), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_points_in_volum, __pyx_k_yt_utilities_lib_points_in_volum, sizeof(__pyx_k_yt_utilities_lib_points_in_volum), 0, 0, 1, 0}, + {&__pyx_n_s_yt_utilities_lib_points_in_volum_2, __pyx_k_yt_utilities_lib_points_in_volum_2, sizeof(__pyx_k_yt_utilities_lib_points_in_volum_2), 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) { #if PY_MAJOR_VERSION >= 3 - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 42, __pyx_L1_error) #else - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 42, __pyx_L1_error) #endif - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) @@ -7532,36 +7640,36 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "yt/utilities/lib/points_in_volume.pyx":92 + /* "yt/utilities/lib/points_in_volume.pyx":93 * cdef np.float64_t cur_pos[3] * cdef np.float64_t rorigin[3] * for i in range(3): # <<<<<<<<<<<<<< * rorigin[i] = 0.0 * for i in range(3): */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "yt/utilities/lib/points_in_volume.pyx":94 + /* "yt/utilities/lib/points_in_volume.pyx":95 * for i in range(3): * rorigin[i] = 0.0 * for i in range(3): # <<<<<<<<<<<<<< * n[i] = mask.shape[i] * for j in range(3): */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "yt/utilities/lib/points_in_volume.pyx":96 + /* "yt/utilities/lib/points_in_volume.pyx":97 * for i in range(3): * n[i] = mask.shape[i] * for j in range(3): # <<<<<<<<<<<<<< * # Set up our transposed dx, which has a component in every * # direction */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); @@ -7662,53 +7770,53 @@ __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - /* "yt/utilities/lib/points_in_volume.pyx":26 + /* "yt/utilities/lib/points_in_volume.pyx":27 * @cython.wraparound(False) * @cython.boundscheck(False) * def planar_points_in_volume( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] points, * np.ndarray[np.int8_t, ndim=1] pmask, # pixel mask */ - __pyx_tuple__13 = PyTuple_Pack(14, __pyx_n_s_points, __pyx_n_s_pmask, __pyx_n_s_left_edge, __pyx_n_s_right_edge, __pyx_n_s_mask, __pyx_n_s_dx, __pyx_n_s_valid, __pyx_n_s_i, __pyx_n_s_dim, __pyx_n_s_count, __pyx_n_s_ex, __pyx_n_s_dx_inv, __pyx_n_s_idx, __pyx_n_s_result); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(14, __pyx_n_s_points, __pyx_n_s_pmask, __pyx_n_s_left_edge, __pyx_n_s_right_edge, __pyx_n_s_mask, __pyx_n_s_dx, __pyx_n_s_valid, __pyx_n_s_i, __pyx_n_s_dim, __pyx_n_s_count, __pyx_n_s_ex, __pyx_n_s_dx_inv, __pyx_n_s_idx, __pyx_n_s_result); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(6, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_planar_points_in_volume, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(6, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_points_in_volum, __pyx_n_s_planar_points_in_volume, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 27, __pyx_L1_error) - /* "yt/utilities/lib/points_in_volume.pyx":78 + /* "yt/utilities/lib/points_in_volume.pyx":79 * #@cython.wraparound(False) * #@cython.boundscheck(False) * def grid_points_in_volume( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] box_lengths, * np.ndarray[np.float64_t, ndim=1] box_origin, */ - __pyx_tuple__15 = PyTuple_Pack(15, __pyx_n_s_box_lengths, __pyx_n_s_box_origin, __pyx_n_s_rot_mat, __pyx_n_s_grid_left_edge, __pyx_n_s_grid_right_edge, __pyx_n_s_dds, __pyx_n_s_mask, __pyx_n_s_break_first, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_rds, __pyx_n_s_cur_pos, __pyx_n_s_rorigin); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_Pack(15, __pyx_n_s_box_lengths, __pyx_n_s_box_origin, __pyx_n_s_rot_mat, __pyx_n_s_grid_left_edge, __pyx_n_s_grid_right_edge, __pyx_n_s_dds, __pyx_n_s_mask, __pyx_n_s_break_first, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_rds, __pyx_n_s_cur_pos, __pyx_n_s_rorigin); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(8, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_grid_points_in_volume, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(8, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_points_in_volum, __pyx_n_s_grid_points_in_volume, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 79, __pyx_L1_error) - /* "yt/utilities/lib/points_in_volume.pyx":160 + /* "yt/utilities/lib/points_in_volume.pyx":161 * @cython.wraparound(False) * @cython.boundscheck(False) * def find_grids_in_inclined_box( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] box_vectors, * np.ndarray[np.float64_t, ndim=1] box_center, */ - __pyx_tuple__17 = PyTuple_Pack(15, __pyx_n_s_box_vectors, __pyx_n_s_box_center, __pyx_n_s_grid_left_edges, __pyx_n_s_grid_right_edges, __pyx_n_s_n, __pyx_n_s_g_ax, __pyx_n_s_b_ax, __pyx_n_s_gi, __pyx_n_s_b_vec, __pyx_n_s_g_vec, __pyx_n_s_a_vec, __pyx_n_s_sep_ax, __pyx_n_s_sep_vec, __pyx_n_s_good, __pyx_n_s_grid_centers); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(15, __pyx_n_s_box_vectors, __pyx_n_s_box_center, __pyx_n_s_grid_left_edges, __pyx_n_s_grid_right_edges, __pyx_n_s_n, __pyx_n_s_g_ax, __pyx_n_s_b_ax, __pyx_n_s_gi, __pyx_n_s_b_vec, __pyx_n_s_g_vec, __pyx_n_s_a_vec, __pyx_n_s_sep_ax, __pyx_n_s_sep_vec, __pyx_n_s_good, __pyx_n_s_grid_centers); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_find_grids_in_inclined_box, 160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_points_in_volum, __pyx_n_s_find_grids_in_inclined_box, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 161, __pyx_L1_error) - /* "yt/utilities/lib/points_in_volume.pyx":214 + /* "yt/utilities/lib/points_in_volume.pyx":215 * return good * * def calculate_fill_grids(int fill_level, int refratio, int last_level, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] domain_width, * np.ndarray[np.int64_t, ndim=1] cg_start_index, */ - __pyx_tuple__19 = PyTuple_Pack(25, __pyx_n_s_fill_level, __pyx_n_s_refratio, __pyx_n_s_last_level, __pyx_n_s_domain_width, __pyx_n_s_cg_start_index, __pyx_n_s_cg_dims, __pyx_n_s_g_start_index, __pyx_n_s_g_dims, __pyx_n_s_g_child_mask, __pyx_n_s_cgstart, __pyx_n_s_gstart, __pyx_n_s_cgend, __pyx_n_s_gend, __pyx_n_s_dw, __pyx_n_s_cxi, __pyx_n_s_cyi, __pyx_n_s_czi, __pyx_n_s_gxi, __pyx_n_s_gyi, __pyx_n_s_gzi, __pyx_n_s_ci, __pyx_n_s_cj, __pyx_n_s_ck, __pyx_n_s_i, __pyx_n_s_total); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_tuple__19 = PyTuple_Pack(25, __pyx_n_s_fill_level, __pyx_n_s_refratio, __pyx_n_s_last_level, __pyx_n_s_domain_width, __pyx_n_s_cg_start_index, __pyx_n_s_cg_dims, __pyx_n_s_g_start_index, __pyx_n_s_g_dims, __pyx_n_s_g_child_mask, __pyx_n_s_cgstart, __pyx_n_s_gstart, __pyx_n_s_cgend, __pyx_n_s_gend, __pyx_n_s_dw, __pyx_n_s_cxi, __pyx_n_s_cyi, __pyx_n_s_czi, __pyx_n_s_gxi, __pyx_n_s_gyi, __pyx_n_s_gzi, __pyx_n_s_ci, __pyx_n_s_cj, __pyx_n_s_ck, __pyx_n_s_i, __pyx_n_s_total); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(9, 0, 25, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_calculate_fill_grids, 214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(9, 0, 25, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_points_in_volum, __pyx_n_s_calculate_fill_grids, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -7783,6 +7891,7 @@ __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 @@ -7843,52 +7952,52 @@ if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":26 + /* "yt/utilities/lib/points_in_volume.pyx":27 * @cython.wraparound(False) * @cython.boundscheck(False) * def planar_points_in_volume( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] points, * np.ndarray[np.int8_t, ndim=1] pmask, # pixel mask */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16points_in_volume_1planar_points_in_volume, NULL, __pyx_n_s_yt_utilities_lib_points_in_volum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16points_in_volume_1planar_points_in_volume, NULL, __pyx_n_s_yt_utilities_lib_points_in_volum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_planar_points_in_volume, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_planar_points_in_volume, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":78 + /* "yt/utilities/lib/points_in_volume.pyx":79 * #@cython.wraparound(False) * #@cython.boundscheck(False) * def grid_points_in_volume( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] box_lengths, * np.ndarray[np.float64_t, ndim=1] box_origin, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16points_in_volume_3grid_points_in_volume, NULL, __pyx_n_s_yt_utilities_lib_points_in_volum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16points_in_volume_3grid_points_in_volume, NULL, __pyx_n_s_yt_utilities_lib_points_in_volum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_grid_points_in_volume, __pyx_t_1) < 0) __PYX_ERR(0, 78, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_grid_points_in_volume, __pyx_t_1) < 0) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":160 + /* "yt/utilities/lib/points_in_volume.pyx":161 * @cython.wraparound(False) * @cython.boundscheck(False) * def find_grids_in_inclined_box( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] box_vectors, * np.ndarray[np.float64_t, ndim=1] box_center, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16points_in_volume_5find_grids_in_inclined_box, NULL, __pyx_n_s_yt_utilities_lib_points_in_volum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16points_in_volume_5find_grids_in_inclined_box, NULL, __pyx_n_s_yt_utilities_lib_points_in_volum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_grids_in_inclined_box, __pyx_t_1) < 0) __PYX_ERR(0, 160, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_grids_in_inclined_box, __pyx_t_1) < 0) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/points_in_volume.pyx":214 + /* "yt/utilities/lib/points_in_volume.pyx":215 * return good * * def calculate_fill_grids(int fill_level, int refratio, int last_level, # <<<<<<<<<<<<<< * np.ndarray[np.int64_t, ndim=1] domain_width, * np.ndarray[np.int64_t, ndim=1] cg_start_index, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16points_in_volume_7calculate_fill_grids, NULL, __pyx_n_s_yt_utilities_lib_points_in_volum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_16points_in_volume_7calculate_fill_grids, NULL, __pyx_n_s_yt_utilities_lib_points_in_volum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculate_fill_grids, __pyx_t_1) < 0) __PYX_ERR(0, 214, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculate_fill_grids, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "yt/utilities/lib/points_in_volume.pyx":1 @@ -7916,7 +8025,7 @@ __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.points_in_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.points_in_volume", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -8830,7 +8939,7 @@ case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -2) a = -a; break; @@ -8840,7 +8949,7 @@ case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -3) a = -a; break; @@ -8850,7 +8959,7 @@ case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { + if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -4) a = -a; break; @@ -9244,6 +9353,40 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; @@ -9384,12 +9527,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -10605,6 +10751,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -10613,11 +10761,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/points_in_volume.pyx yt-3.4.0/yt/utilities/lib/points_in_volume.pyx --- yt-3.3.3/yt/utilities/lib/points_in_volume.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/points_in_volume.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -17,6 +17,7 @@ import numpy as np cimport numpy as np cimport cython +from libc.math cimport sqrt cdef extern from "math.h": double fabs(double x) @@ -123,7 +124,7 @@ cdef np.float64_t norm = 0.0 for i in range(3): norm += vec[i]*vec[i] - norm = norm**0.5 + norm = sqrt(norm) for i in range(3): vec[i] /= norm diff -Nru yt-3.3.3/yt/utilities/lib/primitives.c yt-3.4.0/yt/utilities/lib/primitives.c --- yt-3.3.3/yt/utilities/lib/primitives.c 2016-12-12 01:42:01.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/primitives.c 2017-08-10 18:20:57.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,8 +6,15 @@ "depends": [ "yt/utilities/lib/platform_dep.h" ], + "include_dirs": [ + "yt/utilities/lib" + ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.primitives", + "sources": [ + "yt/utilities/lib/primitives.pyx" ] }, "module_name": "yt.utilities.lib.primitives" @@ -21,7 +28,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -43,6 +50,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -195,16 +203,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -331,6 +343,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -385,6 +403,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -494,8 +541,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -508,8 +555,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -631,10 +681,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -927,6 +979,7 @@ struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData; struct __pyx_t_2yt_9utilities_3lib_10primitives_Triangle; struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch; +struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch; /* "yt/utilities/lib/primitives.pxd":7 * from vec3_ops cimport dot, subtract, cross @@ -998,6 +1051,18 @@ __pyx_t_5numpy_int64_t elem_id; }; +/* "yt/utilities/lib/primitives.pxd":82 + * BBox* bbox) nogil + * + * cdef struct TetPatch: # <<<<<<<<<<<<<< + * np.float64_t[6][3] v # 6 vertices per patch + * np.int64_t elem_id + */ +struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch { + __pyx_t_5numpy_float64_t v[6][3]; + __pyx_t_5numpy_int64_t elem_id; +}; + /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY @@ -1181,6 +1246,9 @@ /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1399,6 +1467,14 @@ static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivV(double (*)[3], double const , double const , double *); /*proto*/ static struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_compute_patch_hit(float (*)[3], float *, float *); /*proto*/ static struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_compute_patch_hit(double (*)[3], double *, double *); /*proto*/ +static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceFunc(float (*)[3], float const , float const , float *); /*proto*/ +static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceFunc(double (*)[3], double const , double const , double *); /*proto*/ +static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivU(float (*)[3], float const , float const , float *); /*proto*/ +static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivU(double (*)[3], double const , double const , double *); /*proto*/ +static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivV(float (*)[3], float const , float const , float *); /*proto*/ +static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivV(double (*)[3], double const , double const , double *); /*proto*/ +static struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_compute_tet_patch_hit(float (*)[3], float *, float *); /*proto*/ +static struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_compute_tet_patch_hit(double (*)[3], double *, double *); /*proto*/ #define __Pyx_MODULE_NAME "yt.utilities.lib.primitives" int __pyx_module_is_main_yt__utilities__lib__primitives = 0; @@ -1417,7 +1493,9 @@ static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static const char __pyx_k_This_file_contains_definitions[] = "\n\nThis file contains definitions of the various primitives that can be used\nby the Cython ray-tracer for unstructured mesh rendering. To define a new\nprimitive type, you need to define a struct that represents it. You also\nneed to provide three functions: \n\n1. A function that computes the intersection between a given ray and a given primitive.\n2. A function that computes the centroid of the primitive type.\n3. A function that computes the axis-aligned bounding box of a given primitive.\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"; @@ -1431,6 +1509,7 @@ static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_inf; static PyObject *__pyx_n_s_main; @@ -1455,7 +1534,7 @@ static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -/* "yt/utilities/lib/primitives.pyx":19 +/* "yt/utilities/lib/primitives.pyx":32 * @cython.wraparound(False) * @cython.cdivision(True) * cdef np.int64_t ray_bbox_intersect(Ray* ray, const BBox bbox) nogil: # <<<<<<<<<<<<<< @@ -1472,7 +1551,7 @@ __pyx_t_5numpy_int64_t __pyx_r; __pyx_t_5numpy_int64_t __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":29 + /* "yt/utilities/lib/primitives.pyx":42 * # https://tavianator.com/fast-branchless-raybounding-box-intersections/ * * cdef np.float64_t tmin = -INF # <<<<<<<<<<<<<< @@ -1481,7 +1560,7 @@ */ __pyx_v_tmin = (-__pyx_v_2yt_9utilities_3lib_10primitives_INF); - /* "yt/utilities/lib/primitives.pyx":30 + /* "yt/utilities/lib/primitives.pyx":43 * * cdef np.float64_t tmin = -INF * cdef np.float64_t tmax = INF # <<<<<<<<<<<<<< @@ -1490,7 +1569,7 @@ */ __pyx_v_tmax = __pyx_v_2yt_9utilities_3lib_10primitives_INF; - /* "yt/utilities/lib/primitives.pyx":34 + /* "yt/utilities/lib/primitives.pyx":47 * cdef np.int64_t i * cdef np.float64_t t1, t2 * for i in range(3): # <<<<<<<<<<<<<< @@ -1500,7 +1579,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":35 + /* "yt/utilities/lib/primitives.pyx":48 * cdef np.float64_t t1, t2 * for i in range(3): * t1 = (bbox.left_edge[i] - ray.origin[i])*ray.inv_dir[i] # <<<<<<<<<<<<<< @@ -1509,7 +1588,7 @@ */ __pyx_v_t1 = (((__pyx_v_bbox.left_edge[__pyx_v_i]) - (__pyx_v_ray->origin[__pyx_v_i])) * (__pyx_v_ray->inv_dir[__pyx_v_i])); - /* "yt/utilities/lib/primitives.pyx":36 + /* "yt/utilities/lib/primitives.pyx":49 * for i in range(3): * t1 = (bbox.left_edge[i] - ray.origin[i])*ray.inv_dir[i] * t2 = (bbox.right_edge[i] - ray.origin[i])*ray.inv_dir[i] # <<<<<<<<<<<<<< @@ -1518,7 +1597,7 @@ */ __pyx_v_t2 = (((__pyx_v_bbox.right_edge[__pyx_v_i]) - (__pyx_v_ray->origin[__pyx_v_i])) * (__pyx_v_ray->inv_dir[__pyx_v_i])); - /* "yt/utilities/lib/primitives.pyx":37 + /* "yt/utilities/lib/primitives.pyx":50 * t1 = (bbox.left_edge[i] - ray.origin[i])*ray.inv_dir[i] * t2 = (bbox.right_edge[i] - ray.origin[i])*ray.inv_dir[i] * tmin = fmax(tmin, fmin(t1, t2)) # <<<<<<<<<<<<<< @@ -1527,7 +1606,7 @@ */ __pyx_v_tmin = fmax(__pyx_v_tmin, fmin(__pyx_v_t1, __pyx_v_t2)); - /* "yt/utilities/lib/primitives.pyx":38 + /* "yt/utilities/lib/primitives.pyx":51 * t2 = (bbox.right_edge[i] - ray.origin[i])*ray.inv_dir[i] * tmin = fmax(tmin, fmin(t1, t2)) * tmax = fmin(tmax, fmax(t1, t2)) # <<<<<<<<<<<<<< @@ -1537,7 +1616,7 @@ __pyx_v_tmax = fmin(__pyx_v_tmax, fmax(__pyx_v_t1, __pyx_v_t2)); } - /* "yt/utilities/lib/primitives.pyx":40 + /* "yt/utilities/lib/primitives.pyx":53 * tmax = fmin(tmax, fmax(t1, t2)) * * return tmax >= fmax(tmin, 0.0) # <<<<<<<<<<<<<< @@ -1547,7 +1626,7 @@ __pyx_r = (__pyx_v_tmax >= fmax(__pyx_v_tmin, 0.0)); goto __pyx_L0; - /* "yt/utilities/lib/primitives.pyx":19 + /* "yt/utilities/lib/primitives.pyx":32 * @cython.wraparound(False) * @cython.cdivision(True) * cdef np.int64_t ray_bbox_intersect(Ray* ray, const BBox bbox) nogil: # <<<<<<<<<<<<<< @@ -1560,7 +1639,7 @@ return __pyx_r; } -/* "yt/utilities/lib/primitives.pyx":45 +/* "yt/utilities/lib/primitives.pyx":58 * @cython.wraparound(False) * @cython.cdivision(True) * cdef np.int64_t ray_triangle_intersect(const void* primitives, # <<<<<<<<<<<<<< @@ -1585,7 +1664,7 @@ int __pyx_t_2; __pyx_t_5numpy_int64_t __pyx_t_3; - /* "yt/utilities/lib/primitives.pyx":60 + /* "yt/utilities/lib/primitives.pyx":73 * # https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm * * cdef Triangle tri = ( primitives)[item] # <<<<<<<<<<<<<< @@ -1594,7 +1673,7 @@ */ __pyx_v_tri = (((struct __pyx_t_2yt_9utilities_3lib_10primitives_Triangle *)__pyx_v_primitives)[__pyx_v_item]); - /* "yt/utilities/lib/primitives.pyx":65 + /* "yt/utilities/lib/primitives.pyx":78 * cdef np.float64_t e1[3] * cdef np.float64_t e2[3] * subtract(tri.p1, tri.p0, e1) # <<<<<<<<<<<<<< @@ -1603,7 +1682,7 @@ */ __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(__pyx_v_tri.p1, __pyx_v_tri.p0, __pyx_v_e1); - /* "yt/utilities/lib/primitives.pyx":66 + /* "yt/utilities/lib/primitives.pyx":79 * cdef np.float64_t e2[3] * subtract(tri.p1, tri.p0, e1) * subtract(tri.p2, tri.p0, e2) # <<<<<<<<<<<<<< @@ -1612,7 +1691,7 @@ */ __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(__pyx_v_tri.p2, __pyx_v_tri.p0, __pyx_v_e2); - /* "yt/utilities/lib/primitives.pyx":69 + /* "yt/utilities/lib/primitives.pyx":82 * * cdef np.float64_t P[3] * cross(ray.direction, e2, P) # <<<<<<<<<<<<<< @@ -1621,7 +1700,7 @@ */ __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(__pyx_v_ray->direction, __pyx_v_e2, __pyx_v_P); - /* "yt/utilities/lib/primitives.pyx":72 + /* "yt/utilities/lib/primitives.pyx":85 * * cdef np.float64_t det, inv_det * det = dot(e1, P) # <<<<<<<<<<<<<< @@ -1630,7 +1709,7 @@ */ __pyx_v_det = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_e1, __pyx_v_P); - /* "yt/utilities/lib/primitives.pyx":73 + /* "yt/utilities/lib/primitives.pyx":86 * cdef np.float64_t det, inv_det * det = dot(e1, P) * if(det > -DETERMINANT_EPS and det < DETERMINANT_EPS): # <<<<<<<<<<<<<< @@ -1648,7 +1727,7 @@ __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "yt/utilities/lib/primitives.pyx":74 + /* "yt/utilities/lib/primitives.pyx":87 * det = dot(e1, P) * if(det > -DETERMINANT_EPS and det < DETERMINANT_EPS): * return False # <<<<<<<<<<<<<< @@ -1658,7 +1737,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/primitives.pyx":73 + /* "yt/utilities/lib/primitives.pyx":86 * cdef np.float64_t det, inv_det * det = dot(e1, P) * if(det > -DETERMINANT_EPS and det < DETERMINANT_EPS): # <<<<<<<<<<<<<< @@ -1667,7 +1746,7 @@ */ } - /* "yt/utilities/lib/primitives.pyx":75 + /* "yt/utilities/lib/primitives.pyx":88 * if(det > -DETERMINANT_EPS and det < DETERMINANT_EPS): * return False * inv_det = 1.0 / det # <<<<<<<<<<<<<< @@ -1676,7 +1755,7 @@ */ __pyx_v_inv_det = (1.0 / __pyx_v_det); - /* "yt/utilities/lib/primitives.pyx":78 + /* "yt/utilities/lib/primitives.pyx":91 * * cdef np.float64_t T[3] * subtract(ray.origin, tri.p0, T) # <<<<<<<<<<<<<< @@ -1685,7 +1764,7 @@ */ __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(__pyx_v_ray->origin, __pyx_v_tri.p0, __pyx_v_T); - /* "yt/utilities/lib/primitives.pyx":80 + /* "yt/utilities/lib/primitives.pyx":93 * subtract(ray.origin, tri.p0, T) * * cdef np.float64_t u = dot(T, P) * inv_det # <<<<<<<<<<<<<< @@ -1694,7 +1773,7 @@ */ __pyx_v_u = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_T, __pyx_v_P) * __pyx_v_inv_det); - /* "yt/utilities/lib/primitives.pyx":81 + /* "yt/utilities/lib/primitives.pyx":94 * * cdef np.float64_t u = dot(T, P) * inv_det * if(u < 0.0 or u > 1.0): # <<<<<<<<<<<<<< @@ -1712,7 +1791,7 @@ __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "yt/utilities/lib/primitives.pyx":82 + /* "yt/utilities/lib/primitives.pyx":95 * cdef np.float64_t u = dot(T, P) * inv_det * if(u < 0.0 or u > 1.0): * return False # <<<<<<<<<<<<<< @@ -1722,7 +1801,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/primitives.pyx":81 + /* "yt/utilities/lib/primitives.pyx":94 * * cdef np.float64_t u = dot(T, P) * inv_det * if(u < 0.0 or u > 1.0): # <<<<<<<<<<<<<< @@ -1731,7 +1810,7 @@ */ } - /* "yt/utilities/lib/primitives.pyx":85 + /* "yt/utilities/lib/primitives.pyx":98 * * cdef np.float64_t Q[3] * cross(T, e1, Q) # <<<<<<<<<<<<<< @@ -1740,7 +1819,7 @@ */ __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(__pyx_v_T, __pyx_v_e1, __pyx_v_Q); - /* "yt/utilities/lib/primitives.pyx":87 + /* "yt/utilities/lib/primitives.pyx":100 * cross(T, e1, Q) * * cdef np.float64_t v = dot(ray.direction, Q) * inv_det # <<<<<<<<<<<<<< @@ -1749,7 +1828,7 @@ */ __pyx_v_v = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_ray->direction, __pyx_v_Q) * __pyx_v_inv_det); - /* "yt/utilities/lib/primitives.pyx":88 + /* "yt/utilities/lib/primitives.pyx":101 * * cdef np.float64_t v = dot(ray.direction, Q) * inv_det * if(v < 0.0 or u + v > 1.0): # <<<<<<<<<<<<<< @@ -1767,7 +1846,7 @@ __pyx_L10_bool_binop_done:; if (__pyx_t_1) { - /* "yt/utilities/lib/primitives.pyx":89 + /* "yt/utilities/lib/primitives.pyx":102 * cdef np.float64_t v = dot(ray.direction, Q) * inv_det * if(v < 0.0 or u + v > 1.0): * return False # <<<<<<<<<<<<<< @@ -1777,7 +1856,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/primitives.pyx":88 + /* "yt/utilities/lib/primitives.pyx":101 * * cdef np.float64_t v = dot(ray.direction, Q) * inv_det * if(v < 0.0 or u + v > 1.0): # <<<<<<<<<<<<<< @@ -1786,7 +1865,7 @@ */ } - /* "yt/utilities/lib/primitives.pyx":91 + /* "yt/utilities/lib/primitives.pyx":104 * return False * * cdef np.float64_t t = dot(e2, Q) * inv_det # <<<<<<<<<<<<<< @@ -1795,7 +1874,7 @@ */ __pyx_v_t = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_e2, __pyx_v_Q) * __pyx_v_inv_det); - /* "yt/utilities/lib/primitives.pyx":93 + /* "yt/utilities/lib/primitives.pyx":106 * cdef np.float64_t t = dot(e2, Q) * inv_det * * if(t > DETERMINANT_EPS and t < ray.t_far): # <<<<<<<<<<<<<< @@ -1813,7 +1892,7 @@ __pyx_L13_bool_binop_done:; if (__pyx_t_1) { - /* "yt/utilities/lib/primitives.pyx":94 + /* "yt/utilities/lib/primitives.pyx":107 * * if(t > DETERMINANT_EPS and t < ray.t_far): * ray.t_far = t # <<<<<<<<<<<<<< @@ -1822,7 +1901,7 @@ */ __pyx_v_ray->t_far = __pyx_v_t; - /* "yt/utilities/lib/primitives.pyx":95 + /* "yt/utilities/lib/primitives.pyx":108 * if(t > DETERMINANT_EPS and t < ray.t_far): * ray.t_far = t * ray.elem_id = tri.elem_id # <<<<<<<<<<<<<< @@ -1832,7 +1911,7 @@ __pyx_t_3 = __pyx_v_tri.elem_id; __pyx_v_ray->elem_id = __pyx_t_3; - /* "yt/utilities/lib/primitives.pyx":96 + /* "yt/utilities/lib/primitives.pyx":109 * ray.t_far = t * ray.elem_id = tri.elem_id * return True # <<<<<<<<<<<<<< @@ -1842,7 +1921,7 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/utilities/lib/primitives.pyx":93 + /* "yt/utilities/lib/primitives.pyx":106 * cdef np.float64_t t = dot(e2, Q) * inv_det * * if(t > DETERMINANT_EPS and t < ray.t_far): # <<<<<<<<<<<<<< @@ -1851,7 +1930,7 @@ */ } - /* "yt/utilities/lib/primitives.pyx":98 + /* "yt/utilities/lib/primitives.pyx":111 * return True * * return False # <<<<<<<<<<<<<< @@ -1861,7 +1940,7 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/primitives.pyx":45 + /* "yt/utilities/lib/primitives.pyx":58 * @cython.wraparound(False) * @cython.cdivision(True) * cdef np.int64_t ray_triangle_intersect(const void* primitives, # <<<<<<<<<<<<<< @@ -1874,7 +1953,7 @@ return __pyx_r; } -/* "yt/utilities/lib/primitives.pyx":104 +/* "yt/utilities/lib/primitives.pyx":117 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void triangle_centroid(const void *primitives, # <<<<<<<<<<<<<< @@ -1887,7 +1966,7 @@ __pyx_t_5numpy_int64_t __pyx_v_i; __pyx_t_5numpy_int64_t __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":115 + /* "yt/utilities/lib/primitives.pyx":128 * ''' * * cdef Triangle tri = ( primitives)[item] # <<<<<<<<<<<<<< @@ -1896,7 +1975,7 @@ */ __pyx_v_tri = (((struct __pyx_t_2yt_9utilities_3lib_10primitives_Triangle *)__pyx_v_primitives)[__pyx_v_item]); - /* "yt/utilities/lib/primitives.pyx":117 + /* "yt/utilities/lib/primitives.pyx":130 * cdef Triangle tri = ( primitives)[item] * cdef np.int64_t i * for i in range(3): # <<<<<<<<<<<<<< @@ -1906,7 +1985,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":118 + /* "yt/utilities/lib/primitives.pyx":131 * cdef np.int64_t i * for i in range(3): * centroid[i] = (tri.p0[i] + tri.p1[i] + tri.p2[i]) / 3.0 # <<<<<<<<<<<<<< @@ -1916,7 +1995,7 @@ (__pyx_v_centroid[__pyx_v_i]) = ((((__pyx_v_tri.p0[__pyx_v_i]) + (__pyx_v_tri.p1[__pyx_v_i])) + (__pyx_v_tri.p2[__pyx_v_i])) / 3.0); } - /* "yt/utilities/lib/primitives.pyx":104 + /* "yt/utilities/lib/primitives.pyx":117 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void triangle_centroid(const void *primitives, # <<<<<<<<<<<<<< @@ -1927,7 +2006,7 @@ /* function exit code */ } -/* "yt/utilities/lib/primitives.pyx":124 +/* "yt/utilities/lib/primitives.pyx":137 * @cython.wraparound(False) * @cython.cdivision(True) * cdef void triangle_bbox(const void *primitives, # <<<<<<<<<<<<<< @@ -1940,7 +2019,7 @@ __pyx_t_5numpy_int64_t __pyx_v_i; __pyx_t_5numpy_int64_t __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":135 + /* "yt/utilities/lib/primitives.pyx":148 * ''' * * cdef Triangle tri = ( primitives)[item] # <<<<<<<<<<<<<< @@ -1949,82 +2028,1629 @@ */ __pyx_v_tri = (((struct __pyx_t_2yt_9utilities_3lib_10primitives_Triangle *)__pyx_v_primitives)[__pyx_v_item]); - /* "yt/utilities/lib/primitives.pyx":137 + /* "yt/utilities/lib/primitives.pyx":150 * cdef Triangle tri = ( primitives)[item] * cdef np.int64_t i * for i in range(3): # <<<<<<<<<<<<<< * bbox.left_edge[i] = fmin(fmin(tri.p0[i], tri.p1[i]), tri.p2[i]) * bbox.right_edge[i] = fmax(fmax(tri.p0[i], tri.p1[i]), tri.p2[i]) */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":151 + * cdef np.int64_t i + * for i in range(3): + * bbox.left_edge[i] = fmin(fmin(tri.p0[i], tri.p1[i]), tri.p2[i]) # <<<<<<<<<<<<<< + * bbox.right_edge[i] = fmax(fmax(tri.p0[i], tri.p1[i]), tri.p2[i]) + * + */ + (__pyx_v_bbox->left_edge[__pyx_v_i]) = fmin(fmin((__pyx_v_tri.p0[__pyx_v_i]), (__pyx_v_tri.p1[__pyx_v_i])), (__pyx_v_tri.p2[__pyx_v_i])); + + /* "yt/utilities/lib/primitives.pyx":152 + * for i in range(3): + * bbox.left_edge[i] = fmin(fmin(tri.p0[i], tri.p1[i]), tri.p2[i]) + * bbox.right_edge[i] = fmax(fmax(tri.p0[i], tri.p1[i]), tri.p2[i]) # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_bbox->right_edge[__pyx_v_i]) = fmax(fmax((__pyx_v_tri.p0[__pyx_v_i]), (__pyx_v_tri.p1[__pyx_v_i])), (__pyx_v_tri.p2[__pyx_v_i])); + } + + /* "yt/utilities/lib/primitives.pyx":137 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void triangle_bbox(const void *primitives, # <<<<<<<<<<<<<< + * const np.int64_t item, + * BBox* bbox) nogil: + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/primitives.pyx":158 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void patchSurfaceFunc(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * const cython.floating u, + * const cython.floating v, + */ + +static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc(float (*__pyx_v_verts)[3], float const __pyx_v_u, float const __pyx_v_v, float *__pyx_v_S) { + int __pyx_v_i; + int __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":173 + * ''' + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * S[i] = 0.25*(1.0 - u)*(1.0 - v)*(-u - v - 1)*verts[0][i] + \ + * 0.25*(1.0 + u)*(1.0 - v)*( u - v - 1)*verts[1][i] + \ + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":174 + * cdef int i + * for i in range(3): + * S[i] = 0.25*(1.0 - u)*(1.0 - v)*(-u - v - 1)*verts[0][i] + \ # <<<<<<<<<<<<<< + * 0.25*(1.0 + u)*(1.0 - v)*( u - v - 1)*verts[1][i] + \ + * 0.25*(1.0 + u)*(1.0 + v)*( u + v - 1)*verts[2][i] + \ + */ + (__pyx_v_S[__pyx_v_i]) = (((((((((((0.25 * (1.0 - __pyx_v_u)) * (1.0 - __pyx_v_v)) * (((-__pyx_v_u) - __pyx_v_v) - 1.0)) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((((0.25 * (1.0 + __pyx_v_u)) * (1.0 - __pyx_v_v)) * ((__pyx_v_u - __pyx_v_v) - 1.0)) * ((__pyx_v_verts[1])[__pyx_v_i]))) + ((((0.25 * (1.0 + __pyx_v_u)) * (1.0 + __pyx_v_v)) * ((__pyx_v_u + __pyx_v_v) - 1.0)) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((0.25 * (1.0 - __pyx_v_u)) * (1.0 + __pyx_v_v)) * (((-__pyx_v_u) + __pyx_v_v) - 1.0)) * ((__pyx_v_verts[3])[__pyx_v_i]))) + (((0.5 * (1.0 - __pyx_v_u)) * (1.0 - (__pyx_v_v * __pyx_v_v))) * ((__pyx_v_verts[4])[__pyx_v_i]))) + (((0.5 * (1.0 - (__pyx_v_u * __pyx_v_u))) * (1.0 - __pyx_v_v)) * ((__pyx_v_verts[5])[__pyx_v_i]))) + (((0.5 * (1.0 + __pyx_v_u)) * (1.0 - (__pyx_v_v * __pyx_v_v))) * ((__pyx_v_verts[6])[__pyx_v_i]))) + (((0.5 * (1.0 - (__pyx_v_u * __pyx_v_u))) * (1.0 + __pyx_v_v)) * ((__pyx_v_verts[7])[__pyx_v_i]))); + } + + /* "yt/utilities/lib/primitives.pyx":158 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void patchSurfaceFunc(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * const cython.floating u, + * const cython.floating v, + */ + + /* function exit code */ +} + +static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc(double (*__pyx_v_verts)[3], double const __pyx_v_u, double const __pyx_v_v, double *__pyx_v_S) { + int __pyx_v_i; + int __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":173 + * ''' + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * S[i] = 0.25*(1.0 - u)*(1.0 - v)*(-u - v - 1)*verts[0][i] + \ + * 0.25*(1.0 + u)*(1.0 - v)*( u - v - 1)*verts[1][i] + \ + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":174 + * cdef int i + * for i in range(3): + * S[i] = 0.25*(1.0 - u)*(1.0 - v)*(-u - v - 1)*verts[0][i] + \ # <<<<<<<<<<<<<< + * 0.25*(1.0 + u)*(1.0 - v)*( u - v - 1)*verts[1][i] + \ + * 0.25*(1.0 + u)*(1.0 + v)*( u + v - 1)*verts[2][i] + \ + */ + (__pyx_v_S[__pyx_v_i]) = (((((((((((0.25 * (1.0 - __pyx_v_u)) * (1.0 - __pyx_v_v)) * (((-__pyx_v_u) - __pyx_v_v) - 1.0)) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((((0.25 * (1.0 + __pyx_v_u)) * (1.0 - __pyx_v_v)) * ((__pyx_v_u - __pyx_v_v) - 1.0)) * ((__pyx_v_verts[1])[__pyx_v_i]))) + ((((0.25 * (1.0 + __pyx_v_u)) * (1.0 + __pyx_v_v)) * ((__pyx_v_u + __pyx_v_v) - 1.0)) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((0.25 * (1.0 - __pyx_v_u)) * (1.0 + __pyx_v_v)) * (((-__pyx_v_u) + __pyx_v_v) - 1.0)) * ((__pyx_v_verts[3])[__pyx_v_i]))) + (((0.5 * (1.0 - __pyx_v_u)) * (1.0 - (__pyx_v_v * __pyx_v_v))) * ((__pyx_v_verts[4])[__pyx_v_i]))) + (((0.5 * (1.0 - (__pyx_v_u * __pyx_v_u))) * (1.0 - __pyx_v_v)) * ((__pyx_v_verts[5])[__pyx_v_i]))) + (((0.5 * (1.0 + __pyx_v_u)) * (1.0 - (__pyx_v_v * __pyx_v_v))) * ((__pyx_v_verts[6])[__pyx_v_i]))) + (((0.5 * (1.0 - (__pyx_v_u * __pyx_v_u))) * (1.0 + __pyx_v_v)) * ((__pyx_v_verts[7])[__pyx_v_i]))); + } + + /* "yt/utilities/lib/primitives.pyx":158 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void patchSurfaceFunc(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * const cython.floating u, + * const cython.floating v, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/primitives.pyx":187 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void patchSurfaceDerivU(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * const cython.floating u, + * const cython.floating v, + */ + +static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivU(float (*__pyx_v_verts)[3], float const __pyx_v_u, float const __pyx_v_v, float *__pyx_v_Su) { + int __pyx_v_i; + int __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":197 + * ''' + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * Su[i] = (-0.25*(v - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ + * (-0.25*(v - 1.0)*(u - v - 1) - 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":198 + * cdef int i + * for i in range(3): + * Su[i] = (-0.25*(v - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ # <<<<<<<<<<<<<< + * (-0.25*(v - 1.0)*(u - v - 1) - 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ + * ( 0.25*(v + 1.0)*(u + v - 1) + 0.25*(u + 1.0)*(v + 1.0))*verts[2][i] + \ + */ + (__pyx_v_Su[__pyx_v_i]) = (((((((((((-0.25 * (__pyx_v_v - 1.0)) * ((__pyx_v_u + __pyx_v_v) + 1.0)) - ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((((-0.25 * (__pyx_v_v - 1.0)) * ((__pyx_v_u - __pyx_v_v) - 1.0)) - ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[1])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_v + 1.0)) * ((__pyx_v_u + __pyx_v_v) - 1.0)) + ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_v + 1.0)) * ((__pyx_v_u - __pyx_v_v) + 1.0)) + ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[3])[__pyx_v_i]))) + ((0.5 * ((__pyx_v_v * __pyx_v_v) - 1.0)) * ((__pyx_v_verts[4])[__pyx_v_i]))) + ((__pyx_v_u * (__pyx_v_v - 1.0)) * ((__pyx_v_verts[5])[__pyx_v_i]))) - ((0.5 * ((__pyx_v_v * __pyx_v_v) - 1.0)) * ((__pyx_v_verts[6])[__pyx_v_i]))) - ((__pyx_v_u * (__pyx_v_v + 1.0)) * ((__pyx_v_verts[7])[__pyx_v_i]))); + } + + /* "yt/utilities/lib/primitives.pyx":187 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void patchSurfaceDerivU(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * const cython.floating u, + * const cython.floating v, + */ + + /* function exit code */ +} + +static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivU(double (*__pyx_v_verts)[3], double const __pyx_v_u, double const __pyx_v_v, double *__pyx_v_Su) { + int __pyx_v_i; + int __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":197 + * ''' + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * Su[i] = (-0.25*(v - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ + * (-0.25*(v - 1.0)*(u - v - 1) - 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":198 + * cdef int i + * for i in range(3): + * Su[i] = (-0.25*(v - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ # <<<<<<<<<<<<<< + * (-0.25*(v - 1.0)*(u - v - 1) - 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ + * ( 0.25*(v + 1.0)*(u + v - 1) + 0.25*(u + 1.0)*(v + 1.0))*verts[2][i] + \ + */ + (__pyx_v_Su[__pyx_v_i]) = (((((((((((-0.25 * (__pyx_v_v - 1.0)) * ((__pyx_v_u + __pyx_v_v) + 1.0)) - ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((((-0.25 * (__pyx_v_v - 1.0)) * ((__pyx_v_u - __pyx_v_v) - 1.0)) - ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[1])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_v + 1.0)) * ((__pyx_v_u + __pyx_v_v) - 1.0)) + ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_v + 1.0)) * ((__pyx_v_u - __pyx_v_v) + 1.0)) + ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[3])[__pyx_v_i]))) + ((0.5 * ((__pyx_v_v * __pyx_v_v) - 1.0)) * ((__pyx_v_verts[4])[__pyx_v_i]))) + ((__pyx_v_u * (__pyx_v_v - 1.0)) * ((__pyx_v_verts[5])[__pyx_v_i]))) - ((0.5 * ((__pyx_v_v * __pyx_v_v) - 1.0)) * ((__pyx_v_verts[6])[__pyx_v_i]))) - ((__pyx_v_u * (__pyx_v_v + 1.0)) * ((__pyx_v_verts[7])[__pyx_v_i]))); + } + + /* "yt/utilities/lib/primitives.pyx":187 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void patchSurfaceDerivU(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * const cython.floating u, + * const cython.floating v, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/primitives.pyx":209 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void patchSurfaceDerivV(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * const cython.floating u, + * const cython.floating v, + */ + +static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivV(float (*__pyx_v_verts)[3], float const __pyx_v_u, float const __pyx_v_v, float *__pyx_v_Sv) { + int __pyx_v_i; + int __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":220 + * + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * Sv[i] = (-0.25*(u - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ + * (-0.25*(u + 1.0)*(u - v - 1) + 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":221 + * cdef int i + * for i in range(3): + * Sv[i] = (-0.25*(u - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ # <<<<<<<<<<<<<< + * (-0.25*(u + 1.0)*(u - v - 1) + 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ + * ( 0.25*(u + 1.0)*(u + v - 1) + 0.25*(u + 1.0)*(v + 1.0))*verts[2][i] + \ + */ + (__pyx_v_Sv[__pyx_v_i]) = (((((((((((-0.25 * (__pyx_v_u - 1.0)) * ((__pyx_v_u + __pyx_v_v) + 1.0)) - ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((((-0.25 * (__pyx_v_u + 1.0)) * ((__pyx_v_u - __pyx_v_v) - 1.0)) + ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[1])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_u + 1.0)) * ((__pyx_v_u + __pyx_v_v) - 1.0)) + ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_u - 1.0)) * ((__pyx_v_u - __pyx_v_v) + 1.0)) - ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[3])[__pyx_v_i]))) + ((0.5 * ((__pyx_v_u * __pyx_v_u) - 1.0)) * ((__pyx_v_verts[5])[__pyx_v_i]))) + ((__pyx_v_v * (__pyx_v_u - 1.0)) * ((__pyx_v_verts[4])[__pyx_v_i]))) - ((0.5 * ((__pyx_v_u * __pyx_v_u) - 1.0)) * ((__pyx_v_verts[7])[__pyx_v_i]))) - ((__pyx_v_v * (__pyx_v_u + 1.0)) * ((__pyx_v_verts[6])[__pyx_v_i]))); + } + + /* "yt/utilities/lib/primitives.pyx":209 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void patchSurfaceDerivV(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * const cython.floating u, + * const cython.floating v, + */ + + /* function exit code */ +} + +static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivV(double (*__pyx_v_verts)[3], double const __pyx_v_u, double const __pyx_v_v, double *__pyx_v_Sv) { + int __pyx_v_i; + int __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":220 + * + * cdef int i + * for i in range(3): # <<<<<<<<<<<<<< + * Sv[i] = (-0.25*(u - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ + * (-0.25*(u + 1.0)*(u - v - 1) + 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":221 + * cdef int i + * for i in range(3): + * Sv[i] = (-0.25*(u - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ # <<<<<<<<<<<<<< + * (-0.25*(u + 1.0)*(u - v - 1) + 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ + * ( 0.25*(u + 1.0)*(u + v - 1) + 0.25*(u + 1.0)*(v + 1.0))*verts[2][i] + \ + */ + (__pyx_v_Sv[__pyx_v_i]) = (((((((((((-0.25 * (__pyx_v_u - 1.0)) * ((__pyx_v_u + __pyx_v_v) + 1.0)) - ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((((-0.25 * (__pyx_v_u + 1.0)) * ((__pyx_v_u - __pyx_v_v) - 1.0)) + ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[1])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_u + 1.0)) * ((__pyx_v_u + __pyx_v_v) - 1.0)) + ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_u - 1.0)) * ((__pyx_v_u - __pyx_v_v) + 1.0)) - ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[3])[__pyx_v_i]))) + ((0.5 * ((__pyx_v_u * __pyx_v_u) - 1.0)) * ((__pyx_v_verts[5])[__pyx_v_i]))) + ((__pyx_v_v * (__pyx_v_u - 1.0)) * ((__pyx_v_verts[4])[__pyx_v_i]))) - ((0.5 * ((__pyx_v_u * __pyx_v_u) - 1.0)) * ((__pyx_v_verts[7])[__pyx_v_i]))) - ((__pyx_v_v * (__pyx_v_u + 1.0)) * ((__pyx_v_verts[6])[__pyx_v_i]))); + } + + /* "yt/utilities/lib/primitives.pyx":209 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void patchSurfaceDerivV(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * const cython.floating u, + * const cython.floating v, + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/primitives.pyx":232 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef RayHitData compute_patch_hit(cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cython.floating[3] ray_origin, + * cython.floating[3] ray_direction) nogil: + */ + +static struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_compute_patch_hit(float (*__pyx_v_verts)[3], float *__pyx_v_ray_origin, float *__pyx_v_ray_direction) { + float __pyx_v_n[3]; + float __pyx_v_N1[3]; + float __pyx_v_N2[3]; + float __pyx_v_A; + long __pyx_v_i; + float __pyx_v_d1; + float __pyx_v_d2; + float __pyx_v_u; + float __pyx_v_v; + float __pyx_v_S[3]; + float __pyx_v_fu; + float __pyx_v_fv; + float __pyx_v_err; + float __pyx_v_tol; + int __pyx_v_iterations; + int __pyx_v_max_iter; + float __pyx_v_Su[3]; + float __pyx_v_Sv[3]; + float __pyx_v_J11; + float __pyx_v_J12; + float __pyx_v_J21; + float __pyx_v_J22; + float __pyx_v_det; + float __pyx_v_t; + struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_v_hd; + struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_r; + long __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "yt/utilities/lib/primitives.pyx":244 + * # first we compute the two planes that define the ray. + * cdef cython.floating[3] n, N1, N2 + * cdef cython.floating A = dot(ray_direction, ray_direction) # <<<<<<<<<<<<<< + * for i in range(3): + * n[i] = ray_direction[i] / A + */ + __pyx_v_A = __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_ray_direction, __pyx_v_ray_direction); + + /* "yt/utilities/lib/primitives.pyx":245 + * cdef cython.floating[3] n, N1, N2 + * cdef cython.floating A = dot(ray_direction, ray_direction) + * for i in range(3): # <<<<<<<<<<<<<< + * n[i] = ray_direction[i] / A + * + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":246 + * cdef cython.floating A = dot(ray_direction, ray_direction) + * for i in range(3): + * n[i] = ray_direction[i] / A # <<<<<<<<<<<<<< + * + * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): + */ + (__pyx_v_n[__pyx_v_i]) = ((__pyx_v_ray_direction[__pyx_v_i]) / __pyx_v_A); + } + + /* "yt/utilities/lib/primitives.pyx":248 + * n[i] = ray_direction[i] / A + * + * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): # <<<<<<<<<<<<<< + * N1[0] = n[1] + * N1[1] =-n[0] + */ + __pyx_t_3 = ((fabs((__pyx_v_n[0])) > fabs((__pyx_v_n[1]))) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_3 = ((fabs((__pyx_v_n[0])) > fabs((__pyx_v_n[2]))) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L6_bool_binop_done:; + if (__pyx_t_2) { + + /* "yt/utilities/lib/primitives.pyx":249 + * + * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): + * N1[0] = n[1] # <<<<<<<<<<<<<< + * N1[1] =-n[0] + * N1[2] = 0.0 + */ + (__pyx_v_N1[0]) = (__pyx_v_n[1]); + + /* "yt/utilities/lib/primitives.pyx":250 + * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): + * N1[0] = n[1] + * N1[1] =-n[0] # <<<<<<<<<<<<<< + * N1[2] = 0.0 + * else: + */ + (__pyx_v_N1[1]) = (-(__pyx_v_n[0])); + + /* "yt/utilities/lib/primitives.pyx":251 + * N1[0] = n[1] + * N1[1] =-n[0] + * N1[2] = 0.0 # <<<<<<<<<<<<<< + * else: + * N1[0] = 0.0 + */ + (__pyx_v_N1[2]) = 0.0; + + /* "yt/utilities/lib/primitives.pyx":248 + * n[i] = ray_direction[i] / A + * + * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): # <<<<<<<<<<<<<< + * N1[0] = n[1] + * N1[1] =-n[0] + */ + goto __pyx_L5; + } + + /* "yt/utilities/lib/primitives.pyx":253 + * N1[2] = 0.0 + * else: + * N1[0] = 0.0 # <<<<<<<<<<<<<< + * N1[1] = n[2] + * N1[2] =-n[1] + */ + /*else*/ { + (__pyx_v_N1[0]) = 0.0; + + /* "yt/utilities/lib/primitives.pyx":254 + * else: + * N1[0] = 0.0 + * N1[1] = n[2] # <<<<<<<<<<<<<< + * N1[2] =-n[1] + * cross(N1, n, N2) + */ + (__pyx_v_N1[1]) = (__pyx_v_n[2]); + + /* "yt/utilities/lib/primitives.pyx":255 + * N1[0] = 0.0 + * N1[1] = n[2] + * N1[2] =-n[1] # <<<<<<<<<<<<<< + * cross(N1, n, N2) + * + */ + (__pyx_v_N1[2]) = (-(__pyx_v_n[1])); + } + __pyx_L5:; + + /* "yt/utilities/lib/primitives.pyx":256 + * N1[1] = n[2] + * N1[2] =-n[1] + * cross(N1, n, N2) # <<<<<<<<<<<<<< + * + * cdef cython.floating d1 = -dot(N1, ray_origin) + */ + __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(__pyx_v_N1, __pyx_v_n, __pyx_v_N2); + + /* "yt/utilities/lib/primitives.pyx":258 + * cross(N1, n, N2) + * + * cdef cython.floating d1 = -dot(N1, ray_origin) # <<<<<<<<<<<<<< + * cdef cython.floating d2 = -dot(N2, ray_origin) + * + */ + __pyx_v_d1 = (-__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_ray_origin)); + + /* "yt/utilities/lib/primitives.pyx":259 + * + * cdef cython.floating d1 = -dot(N1, ray_origin) + * cdef cython.floating d2 = -dot(N2, ray_origin) # <<<<<<<<<<<<<< + * + * # the initial guess is set to zero + */ + __pyx_v_d2 = (-__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_ray_origin)); + + /* "yt/utilities/lib/primitives.pyx":262 + * + * # the initial guess is set to zero + * cdef cython.floating u = 0.0 # <<<<<<<<<<<<<< + * cdef cython.floating v = 0.0 + * cdef cython.floating[3] S + */ + __pyx_v_u = 0.0; + + /* "yt/utilities/lib/primitives.pyx":263 + * # the initial guess is set to zero + * cdef cython.floating u = 0.0 + * cdef cython.floating v = 0.0 # <<<<<<<<<<<<<< + * cdef cython.floating[3] S + * patchSurfaceFunc(verts, u, v, S) + */ + __pyx_v_v = 0.0; + + /* "yt/utilities/lib/primitives.pyx":265 + * cdef cython.floating v = 0.0 + * cdef cython.floating[3] S + * patchSurfaceFunc(verts, u, v, S) # <<<<<<<<<<<<<< + * cdef cython.floating fu = dot(N1, S) + d1 + * cdef cython.floating fv = dot(N2, S) + d2 + */ + __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_S); + + /* "yt/utilities/lib/primitives.pyx":266 + * cdef cython.floating[3] S + * patchSurfaceFunc(verts, u, v, S) + * cdef cython.floating fu = dot(N1, S) + d1 # <<<<<<<<<<<<<< + * cdef cython.floating fv = dot(N2, S) + d2 + * cdef cython.floating err = fmax(fabs(fu), fabs(fv)) + */ + __pyx_v_fu = (__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_S) + __pyx_v_d1); + + /* "yt/utilities/lib/primitives.pyx":267 + * patchSurfaceFunc(verts, u, v, S) + * cdef cython.floating fu = dot(N1, S) + d1 + * cdef cython.floating fv = dot(N2, S) + d2 # <<<<<<<<<<<<<< + * cdef cython.floating err = fmax(fabs(fu), fabs(fv)) + * + */ + __pyx_v_fv = (__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_S) + __pyx_v_d2); + + /* "yt/utilities/lib/primitives.pyx":268 + * cdef cython.floating fu = dot(N1, S) + d1 + * cdef cython.floating fv = dot(N2, S) + d2 + * cdef cython.floating err = fmax(fabs(fu), fabs(fv)) # <<<<<<<<<<<<<< + * + * # begin Newton interation + */ + __pyx_v_err = fmax(fabs(__pyx_v_fu), fabs(__pyx_v_fv)); + + /* "yt/utilities/lib/primitives.pyx":271 + * + * # begin Newton interation + * cdef cython.floating tol = 1.0e-5 # <<<<<<<<<<<<<< + * cdef int iterations = 0 + * cdef int max_iter = 10 + */ + __pyx_v_tol = 1.0e-5; + + /* "yt/utilities/lib/primitives.pyx":272 + * # begin Newton interation + * cdef cython.floating tol = 1.0e-5 + * cdef int iterations = 0 # <<<<<<<<<<<<<< + * cdef int max_iter = 10 + * cdef cython.floating[3] Su + */ + __pyx_v_iterations = 0; + + /* "yt/utilities/lib/primitives.pyx":273 + * cdef cython.floating tol = 1.0e-5 + * cdef int iterations = 0 + * cdef int max_iter = 10 # <<<<<<<<<<<<<< + * cdef cython.floating[3] Su + * cdef cython.floating[3] Sv + */ + __pyx_v_max_iter = 10; + + /* "yt/utilities/lib/primitives.pyx":277 + * cdef cython.floating[3] Sv + * cdef cython.floating J11, J12, J21, J22, det + * while ((err > tol) and (iterations < max_iter)): # <<<<<<<<<<<<<< + * # compute the Jacobian + * patchSurfaceDerivU(verts, u, v, Su) + */ + while (1) { + __pyx_t_3 = ((__pyx_v_err > __pyx_v_tol) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L10_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_iterations < __pyx_v_max_iter) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L10_bool_binop_done:; + if (!__pyx_t_2) break; + + /* "yt/utilities/lib/primitives.pyx":279 + * while ((err > tol) and (iterations < max_iter)): + * # compute the Jacobian + * patchSurfaceDerivU(verts, u, v, Su) # <<<<<<<<<<<<<< + * patchSurfaceDerivV(verts, u, v, Sv) + * J11 = dot(N1, Su) + */ + __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivU(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_Su); + + /* "yt/utilities/lib/primitives.pyx":280 + * # compute the Jacobian + * patchSurfaceDerivU(verts, u, v, Su) + * patchSurfaceDerivV(verts, u, v, Sv) # <<<<<<<<<<<<<< + * J11 = dot(N1, Su) + * J12 = dot(N1, Sv) + */ + __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivV(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_Sv); + + /* "yt/utilities/lib/primitives.pyx":281 + * patchSurfaceDerivU(verts, u, v, Su) + * patchSurfaceDerivV(verts, u, v, Sv) + * J11 = dot(N1, Su) # <<<<<<<<<<<<<< + * J12 = dot(N1, Sv) + * J21 = dot(N2, Su) + */ + __pyx_v_J11 = __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_Su); + + /* "yt/utilities/lib/primitives.pyx":282 + * patchSurfaceDerivV(verts, u, v, Sv) + * J11 = dot(N1, Su) + * J12 = dot(N1, Sv) # <<<<<<<<<<<<<< + * J21 = dot(N2, Su) + * J22 = dot(N2, Sv) + */ + __pyx_v_J12 = __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_Sv); + + /* "yt/utilities/lib/primitives.pyx":283 + * J11 = dot(N1, Su) + * J12 = dot(N1, Sv) + * J21 = dot(N2, Su) # <<<<<<<<<<<<<< + * J22 = dot(N2, Sv) + * det = (J11*J22 - J12*J21) + */ + __pyx_v_J21 = __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_Su); + + /* "yt/utilities/lib/primitives.pyx":284 + * J12 = dot(N1, Sv) + * J21 = dot(N2, Su) + * J22 = dot(N2, Sv) # <<<<<<<<<<<<<< + * det = (J11*J22 - J12*J21) + * + */ + __pyx_v_J22 = __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_Sv); + + /* "yt/utilities/lib/primitives.pyx":285 + * J21 = dot(N2, Su) + * J22 = dot(N2, Sv) + * det = (J11*J22 - J12*J21) # <<<<<<<<<<<<<< + * + * # update the u, v values + */ + __pyx_v_det = ((__pyx_v_J11 * __pyx_v_J22) - (__pyx_v_J12 * __pyx_v_J21)); + + /* "yt/utilities/lib/primitives.pyx":288 + * + * # update the u, v values + * u -= ( J22*fu - J12*fv) / det # <<<<<<<<<<<<<< + * v -= (-J21*fu + J11*fv) / det + * + */ + __pyx_v_u = (__pyx_v_u - (((__pyx_v_J22 * __pyx_v_fu) - (__pyx_v_J12 * __pyx_v_fv)) / __pyx_v_det)); + + /* "yt/utilities/lib/primitives.pyx":289 + * # update the u, v values + * u -= ( J22*fu - J12*fv) / det + * v -= (-J21*fu + J11*fv) / det # <<<<<<<<<<<<<< + * + * patchSurfaceFunc(verts, u, v, S) + */ + __pyx_v_v = (__pyx_v_v - ((((-__pyx_v_J21) * __pyx_v_fu) + (__pyx_v_J11 * __pyx_v_fv)) / __pyx_v_det)); + + /* "yt/utilities/lib/primitives.pyx":291 + * v -= (-J21*fu + J11*fv) / det + * + * patchSurfaceFunc(verts, u, v, S) # <<<<<<<<<<<<<< + * fu = dot(N1, S) + d1 + * fv = dot(N2, S) + d2 + */ + __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_S); + + /* "yt/utilities/lib/primitives.pyx":292 + * + * patchSurfaceFunc(verts, u, v, S) + * fu = dot(N1, S) + d1 # <<<<<<<<<<<<<< + * fv = dot(N2, S) + d2 + * + */ + __pyx_v_fu = (__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_S) + __pyx_v_d1); + + /* "yt/utilities/lib/primitives.pyx":293 + * patchSurfaceFunc(verts, u, v, S) + * fu = dot(N1, S) + d1 + * fv = dot(N2, S) + d2 # <<<<<<<<<<<<<< + * + * err = fmax(fabs(fu), fabs(fv)) + */ + __pyx_v_fv = (__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_S) + __pyx_v_d2); + + /* "yt/utilities/lib/primitives.pyx":295 + * fv = dot(N2, S) + d2 + * + * err = fmax(fabs(fu), fabs(fv)) # <<<<<<<<<<<<<< + * iterations += 1 + * + */ + __pyx_v_err = fmax(fabs(__pyx_v_fu), fabs(__pyx_v_fv)); + + /* "yt/utilities/lib/primitives.pyx":296 + * + * err = fmax(fabs(fu), fabs(fv)) + * iterations += 1 # <<<<<<<<<<<<<< + * + * # t is the distance along the ray to this hit + */ + __pyx_v_iterations = (__pyx_v_iterations + 1); + } + + /* "yt/utilities/lib/primitives.pyx":299 + * + * # t is the distance along the ray to this hit + * cdef cython.floating t = distance(S, ray_origin) / L2_norm(ray_direction) # <<<<<<<<<<<<<< + * + * # return hit data + */ + __pyx_v_t = (__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(__pyx_v_S, __pyx_v_ray_origin) / __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(__pyx_v_ray_direction)); + + /* "yt/utilities/lib/primitives.pyx":303 + * # return hit data + * cdef RayHitData hd + * hd.u = u # <<<<<<<<<<<<<< + * hd.v = v + * hd.t = t + */ + __pyx_v_hd.u = __pyx_v_u; + + /* "yt/utilities/lib/primitives.pyx":304 + * cdef RayHitData hd + * hd.u = u + * hd.v = v # <<<<<<<<<<<<<< + * hd.t = t + * hd.converged = (iterations < max_iter) + */ + __pyx_v_hd.v = __pyx_v_v; + + /* "yt/utilities/lib/primitives.pyx":305 + * hd.u = u + * hd.v = v + * hd.t = t # <<<<<<<<<<<<<< + * hd.converged = (iterations < max_iter) + * return hd + */ + __pyx_v_hd.t = __pyx_v_t; + + /* "yt/utilities/lib/primitives.pyx":306 + * hd.v = v + * hd.t = t + * hd.converged = (iterations < max_iter) # <<<<<<<<<<<<<< + * return hd + * + */ + __pyx_v_hd.converged = (__pyx_v_iterations < __pyx_v_max_iter); + + /* "yt/utilities/lib/primitives.pyx":307 + * hd.t = t + * hd.converged = (iterations < max_iter) + * return hd # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_hd; + goto __pyx_L0; + + /* "yt/utilities/lib/primitives.pyx":232 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef RayHitData compute_patch_hit(cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cython.floating[3] ray_origin, + * cython.floating[3] ray_direction) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +static struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_compute_patch_hit(double (*__pyx_v_verts)[3], double *__pyx_v_ray_origin, double *__pyx_v_ray_direction) { + double __pyx_v_n[3]; + double __pyx_v_N1[3]; + double __pyx_v_N2[3]; + double __pyx_v_A; + long __pyx_v_i; + double __pyx_v_d1; + double __pyx_v_d2; + double __pyx_v_u; + double __pyx_v_v; + double __pyx_v_S[3]; + double __pyx_v_fu; + double __pyx_v_fv; + double __pyx_v_err; + double __pyx_v_tol; + int __pyx_v_iterations; + int __pyx_v_max_iter; + double __pyx_v_Su[3]; + double __pyx_v_Sv[3]; + double __pyx_v_J11; + double __pyx_v_J12; + double __pyx_v_J21; + double __pyx_v_J22; + double __pyx_v_det; + double __pyx_v_t; + struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_v_hd; + struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_r; + long __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "yt/utilities/lib/primitives.pyx":244 + * # first we compute the two planes that define the ray. + * cdef cython.floating[3] n, N1, N2 + * cdef cython.floating A = dot(ray_direction, ray_direction) # <<<<<<<<<<<<<< + * for i in range(3): + * n[i] = ray_direction[i] / A + */ + __pyx_v_A = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_ray_direction, __pyx_v_ray_direction); + + /* "yt/utilities/lib/primitives.pyx":245 + * cdef cython.floating[3] n, N1, N2 + * cdef cython.floating A = dot(ray_direction, ray_direction) + * for i in range(3): # <<<<<<<<<<<<<< + * n[i] = ray_direction[i] / A + * + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":246 + * cdef cython.floating A = dot(ray_direction, ray_direction) + * for i in range(3): + * n[i] = ray_direction[i] / A # <<<<<<<<<<<<<< + * + * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): + */ + (__pyx_v_n[__pyx_v_i]) = ((__pyx_v_ray_direction[__pyx_v_i]) / __pyx_v_A); + } + + /* "yt/utilities/lib/primitives.pyx":248 + * n[i] = ray_direction[i] / A + * + * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): # <<<<<<<<<<<<<< + * N1[0] = n[1] + * N1[1] =-n[0] + */ + __pyx_t_3 = ((fabs((__pyx_v_n[0])) > fabs((__pyx_v_n[1]))) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_3 = ((fabs((__pyx_v_n[0])) > fabs((__pyx_v_n[2]))) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L6_bool_binop_done:; + if (__pyx_t_2) { + + /* "yt/utilities/lib/primitives.pyx":249 + * + * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): + * N1[0] = n[1] # <<<<<<<<<<<<<< + * N1[1] =-n[0] + * N1[2] = 0.0 + */ + (__pyx_v_N1[0]) = (__pyx_v_n[1]); + + /* "yt/utilities/lib/primitives.pyx":250 + * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): + * N1[0] = n[1] + * N1[1] =-n[0] # <<<<<<<<<<<<<< + * N1[2] = 0.0 + * else: + */ + (__pyx_v_N1[1]) = (-(__pyx_v_n[0])); + + /* "yt/utilities/lib/primitives.pyx":251 + * N1[0] = n[1] + * N1[1] =-n[0] + * N1[2] = 0.0 # <<<<<<<<<<<<<< + * else: + * N1[0] = 0.0 + */ + (__pyx_v_N1[2]) = 0.0; + + /* "yt/utilities/lib/primitives.pyx":248 + * n[i] = ray_direction[i] / A + * + * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): # <<<<<<<<<<<<<< + * N1[0] = n[1] + * N1[1] =-n[0] + */ + goto __pyx_L5; + } + + /* "yt/utilities/lib/primitives.pyx":253 + * N1[2] = 0.0 + * else: + * N1[0] = 0.0 # <<<<<<<<<<<<<< + * N1[1] = n[2] + * N1[2] =-n[1] + */ + /*else*/ { + (__pyx_v_N1[0]) = 0.0; + + /* "yt/utilities/lib/primitives.pyx":254 + * else: + * N1[0] = 0.0 + * N1[1] = n[2] # <<<<<<<<<<<<<< + * N1[2] =-n[1] + * cross(N1, n, N2) + */ + (__pyx_v_N1[1]) = (__pyx_v_n[2]); + + /* "yt/utilities/lib/primitives.pyx":255 + * N1[0] = 0.0 + * N1[1] = n[2] + * N1[2] =-n[1] # <<<<<<<<<<<<<< + * cross(N1, n, N2) + * + */ + (__pyx_v_N1[2]) = (-(__pyx_v_n[1])); + } + __pyx_L5:; + + /* "yt/utilities/lib/primitives.pyx":256 + * N1[1] = n[2] + * N1[2] =-n[1] + * cross(N1, n, N2) # <<<<<<<<<<<<<< + * + * cdef cython.floating d1 = -dot(N1, ray_origin) + */ + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(__pyx_v_N1, __pyx_v_n, __pyx_v_N2); + + /* "yt/utilities/lib/primitives.pyx":258 + * cross(N1, n, N2) + * + * cdef cython.floating d1 = -dot(N1, ray_origin) # <<<<<<<<<<<<<< + * cdef cython.floating d2 = -dot(N2, ray_origin) + * + */ + __pyx_v_d1 = (-__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_ray_origin)); + + /* "yt/utilities/lib/primitives.pyx":259 + * + * cdef cython.floating d1 = -dot(N1, ray_origin) + * cdef cython.floating d2 = -dot(N2, ray_origin) # <<<<<<<<<<<<<< + * + * # the initial guess is set to zero + */ + __pyx_v_d2 = (-__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_ray_origin)); + + /* "yt/utilities/lib/primitives.pyx":262 + * + * # the initial guess is set to zero + * cdef cython.floating u = 0.0 # <<<<<<<<<<<<<< + * cdef cython.floating v = 0.0 + * cdef cython.floating[3] S + */ + __pyx_v_u = 0.0; + + /* "yt/utilities/lib/primitives.pyx":263 + * # the initial guess is set to zero + * cdef cython.floating u = 0.0 + * cdef cython.floating v = 0.0 # <<<<<<<<<<<<<< + * cdef cython.floating[3] S + * patchSurfaceFunc(verts, u, v, S) + */ + __pyx_v_v = 0.0; + + /* "yt/utilities/lib/primitives.pyx":265 + * cdef cython.floating v = 0.0 + * cdef cython.floating[3] S + * patchSurfaceFunc(verts, u, v, S) # <<<<<<<<<<<<<< + * cdef cython.floating fu = dot(N1, S) + d1 + * cdef cython.floating fv = dot(N2, S) + d2 + */ + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_S); + + /* "yt/utilities/lib/primitives.pyx":266 + * cdef cython.floating[3] S + * patchSurfaceFunc(verts, u, v, S) + * cdef cython.floating fu = dot(N1, S) + d1 # <<<<<<<<<<<<<< + * cdef cython.floating fv = dot(N2, S) + d2 + * cdef cython.floating err = fmax(fabs(fu), fabs(fv)) + */ + __pyx_v_fu = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_S) + __pyx_v_d1); + + /* "yt/utilities/lib/primitives.pyx":267 + * patchSurfaceFunc(verts, u, v, S) + * cdef cython.floating fu = dot(N1, S) + d1 + * cdef cython.floating fv = dot(N2, S) + d2 # <<<<<<<<<<<<<< + * cdef cython.floating err = fmax(fabs(fu), fabs(fv)) + * + */ + __pyx_v_fv = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_S) + __pyx_v_d2); + + /* "yt/utilities/lib/primitives.pyx":268 + * cdef cython.floating fu = dot(N1, S) + d1 + * cdef cython.floating fv = dot(N2, S) + d2 + * cdef cython.floating err = fmax(fabs(fu), fabs(fv)) # <<<<<<<<<<<<<< + * + * # begin Newton interation + */ + __pyx_v_err = fmax(fabs(__pyx_v_fu), fabs(__pyx_v_fv)); + + /* "yt/utilities/lib/primitives.pyx":271 + * + * # begin Newton interation + * cdef cython.floating tol = 1.0e-5 # <<<<<<<<<<<<<< + * cdef int iterations = 0 + * cdef int max_iter = 10 + */ + __pyx_v_tol = 1.0e-5; + + /* "yt/utilities/lib/primitives.pyx":272 + * # begin Newton interation + * cdef cython.floating tol = 1.0e-5 + * cdef int iterations = 0 # <<<<<<<<<<<<<< + * cdef int max_iter = 10 + * cdef cython.floating[3] Su + */ + __pyx_v_iterations = 0; + + /* "yt/utilities/lib/primitives.pyx":273 + * cdef cython.floating tol = 1.0e-5 + * cdef int iterations = 0 + * cdef int max_iter = 10 # <<<<<<<<<<<<<< + * cdef cython.floating[3] Su + * cdef cython.floating[3] Sv + */ + __pyx_v_max_iter = 10; + + /* "yt/utilities/lib/primitives.pyx":277 + * cdef cython.floating[3] Sv + * cdef cython.floating J11, J12, J21, J22, det + * while ((err > tol) and (iterations < max_iter)): # <<<<<<<<<<<<<< + * # compute the Jacobian + * patchSurfaceDerivU(verts, u, v, Su) + */ + while (1) { + __pyx_t_3 = ((__pyx_v_err > __pyx_v_tol) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L10_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_iterations < __pyx_v_max_iter) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L10_bool_binop_done:; + if (!__pyx_t_2) break; + + /* "yt/utilities/lib/primitives.pyx":279 + * while ((err > tol) and (iterations < max_iter)): + * # compute the Jacobian + * patchSurfaceDerivU(verts, u, v, Su) # <<<<<<<<<<<<<< + * patchSurfaceDerivV(verts, u, v, Sv) + * J11 = dot(N1, Su) + */ + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivU(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_Su); + + /* "yt/utilities/lib/primitives.pyx":280 + * # compute the Jacobian + * patchSurfaceDerivU(verts, u, v, Su) + * patchSurfaceDerivV(verts, u, v, Sv) # <<<<<<<<<<<<<< + * J11 = dot(N1, Su) + * J12 = dot(N1, Sv) + */ + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivV(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_Sv); + + /* "yt/utilities/lib/primitives.pyx":281 + * patchSurfaceDerivU(verts, u, v, Su) + * patchSurfaceDerivV(verts, u, v, Sv) + * J11 = dot(N1, Su) # <<<<<<<<<<<<<< + * J12 = dot(N1, Sv) + * J21 = dot(N2, Su) + */ + __pyx_v_J11 = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_Su); + + /* "yt/utilities/lib/primitives.pyx":282 + * patchSurfaceDerivV(verts, u, v, Sv) + * J11 = dot(N1, Su) + * J12 = dot(N1, Sv) # <<<<<<<<<<<<<< + * J21 = dot(N2, Su) + * J22 = dot(N2, Sv) + */ + __pyx_v_J12 = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_Sv); + + /* "yt/utilities/lib/primitives.pyx":283 + * J11 = dot(N1, Su) + * J12 = dot(N1, Sv) + * J21 = dot(N2, Su) # <<<<<<<<<<<<<< + * J22 = dot(N2, Sv) + * det = (J11*J22 - J12*J21) + */ + __pyx_v_J21 = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_Su); + + /* "yt/utilities/lib/primitives.pyx":284 + * J12 = dot(N1, Sv) + * J21 = dot(N2, Su) + * J22 = dot(N2, Sv) # <<<<<<<<<<<<<< + * det = (J11*J22 - J12*J21) + * + */ + __pyx_v_J22 = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_Sv); + + /* "yt/utilities/lib/primitives.pyx":285 + * J21 = dot(N2, Su) + * J22 = dot(N2, Sv) + * det = (J11*J22 - J12*J21) # <<<<<<<<<<<<<< + * + * # update the u, v values + */ + __pyx_v_det = ((__pyx_v_J11 * __pyx_v_J22) - (__pyx_v_J12 * __pyx_v_J21)); + + /* "yt/utilities/lib/primitives.pyx":288 + * + * # update the u, v values + * u -= ( J22*fu - J12*fv) / det # <<<<<<<<<<<<<< + * v -= (-J21*fu + J11*fv) / det + * + */ + __pyx_v_u = (__pyx_v_u - (((__pyx_v_J22 * __pyx_v_fu) - (__pyx_v_J12 * __pyx_v_fv)) / __pyx_v_det)); + + /* "yt/utilities/lib/primitives.pyx":289 + * # update the u, v values + * u -= ( J22*fu - J12*fv) / det + * v -= (-J21*fu + J11*fv) / det # <<<<<<<<<<<<<< + * + * patchSurfaceFunc(verts, u, v, S) + */ + __pyx_v_v = (__pyx_v_v - ((((-__pyx_v_J21) * __pyx_v_fu) + (__pyx_v_J11 * __pyx_v_fv)) / __pyx_v_det)); + + /* "yt/utilities/lib/primitives.pyx":291 + * v -= (-J21*fu + J11*fv) / det + * + * patchSurfaceFunc(verts, u, v, S) # <<<<<<<<<<<<<< + * fu = dot(N1, S) + d1 + * fv = dot(N2, S) + d2 + */ + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_S); + + /* "yt/utilities/lib/primitives.pyx":292 + * + * patchSurfaceFunc(verts, u, v, S) + * fu = dot(N1, S) + d1 # <<<<<<<<<<<<<< + * fv = dot(N2, S) + d2 + * + */ + __pyx_v_fu = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_S) + __pyx_v_d1); + + /* "yt/utilities/lib/primitives.pyx":293 + * patchSurfaceFunc(verts, u, v, S) + * fu = dot(N1, S) + d1 + * fv = dot(N2, S) + d2 # <<<<<<<<<<<<<< + * + * err = fmax(fabs(fu), fabs(fv)) + */ + __pyx_v_fv = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_S) + __pyx_v_d2); + + /* "yt/utilities/lib/primitives.pyx":295 + * fv = dot(N2, S) + d2 + * + * err = fmax(fabs(fu), fabs(fv)) # <<<<<<<<<<<<<< + * iterations += 1 + * + */ + __pyx_v_err = fmax(fabs(__pyx_v_fu), fabs(__pyx_v_fv)); + + /* "yt/utilities/lib/primitives.pyx":296 + * + * err = fmax(fabs(fu), fabs(fv)) + * iterations += 1 # <<<<<<<<<<<<<< + * + * # t is the distance along the ray to this hit + */ + __pyx_v_iterations = (__pyx_v_iterations + 1); + } + + /* "yt/utilities/lib/primitives.pyx":299 + * + * # t is the distance along the ray to this hit + * cdef cython.floating t = distance(S, ray_origin) / L2_norm(ray_direction) # <<<<<<<<<<<<<< + * + * # return hit data + */ + __pyx_v_t = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(__pyx_v_S, __pyx_v_ray_origin) / __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(__pyx_v_ray_direction)); + + /* "yt/utilities/lib/primitives.pyx":303 + * # return hit data + * cdef RayHitData hd + * hd.u = u # <<<<<<<<<<<<<< + * hd.v = v + * hd.t = t + */ + __pyx_v_hd.u = __pyx_v_u; + + /* "yt/utilities/lib/primitives.pyx":304 + * cdef RayHitData hd + * hd.u = u + * hd.v = v # <<<<<<<<<<<<<< + * hd.t = t + * hd.converged = (iterations < max_iter) + */ + __pyx_v_hd.v = __pyx_v_v; + + /* "yt/utilities/lib/primitives.pyx":305 + * hd.u = u + * hd.v = v + * hd.t = t # <<<<<<<<<<<<<< + * hd.converged = (iterations < max_iter) + * return hd + */ + __pyx_v_hd.t = __pyx_v_t; + + /* "yt/utilities/lib/primitives.pyx":306 + * hd.v = v + * hd.t = t + * hd.converged = (iterations < max_iter) # <<<<<<<<<<<<<< + * return hd + * + */ + __pyx_v_hd.converged = (__pyx_v_iterations < __pyx_v_max_iter); + + /* "yt/utilities/lib/primitives.pyx":307 + * hd.t = t + * hd.converged = (iterations < max_iter) + * return hd # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_hd; + goto __pyx_L0; + + /* "yt/utilities/lib/primitives.pyx":232 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef RayHitData compute_patch_hit(cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cython.floating[3] ray_origin, + * cython.floating[3] ray_direction) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/primitives.pyx":313 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef np.int64_t ray_patch_intersect(const void* primitives, # <<<<<<<<<<<<<< + * const np.int64_t item, + * Ray* ray) nogil: + */ + +static __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_10primitives_ray_patch_intersect(void const *__pyx_v_primitives, __pyx_t_5numpy_int64_t const __pyx_v_item, struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *__pyx_v_ray) { + struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch __pyx_v_patch; + struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_v_hd; + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + __pyx_t_5numpy_float64_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; + + /* "yt/utilities/lib/primitives.pyx":325 + * + * ''' + * cdef Patch patch = ( primitives)[item] # <<<<<<<<<<<<<< + * + * cdef RayHitData hd = compute_patch_hit(patch.v, ray.origin, ray.direction) + */ + __pyx_v_patch = (((struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch *)__pyx_v_primitives)[__pyx_v_item]); + + /* "yt/utilities/lib/primitives.pyx":327 + * cdef Patch patch = ( primitives)[item] + * + * cdef RayHitData hd = compute_patch_hit(patch.v, ray.origin, ray.direction) # <<<<<<<<<<<<<< + * + * # only count this is it's the closest hit + */ + __pyx_v_hd = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_compute_patch_hit(__pyx_v_patch.v, __pyx_v_ray->origin, __pyx_v_ray->direction); + + /* "yt/utilities/lib/primitives.pyx":330 + * + * # only count this is it's the closest hit + * if (hd.t < ray.t_near or hd.t > ray.t_far): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_2 = ((__pyx_v_hd.t < __pyx_v_ray->t_near) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_hd.t > __pyx_v_ray->t_far) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "yt/utilities/lib/primitives.pyx":331 + * # only count this is it's the closest hit + * if (hd.t < ray.t_near or hd.t > ray.t_far): + * return False # <<<<<<<<<<<<<< + * + * if (fabs(hd.u) <= 1.0 and fabs(hd.v) <= 1.0 and hd.converged): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/primitives.pyx":330 + * + * # only count this is it's the closest hit + * if (hd.t < ray.t_near or hd.t > ray.t_far): # <<<<<<<<<<<<<< + * return False + * + */ + } + + /* "yt/utilities/lib/primitives.pyx":333 + * return False + * + * if (fabs(hd.u) <= 1.0 and fabs(hd.v) <= 1.0 and hd.converged): # <<<<<<<<<<<<<< + * # we have a hit, so update ray information + * ray.t_far = hd.t + */ + __pyx_t_2 = ((fabs(__pyx_v_hd.u) <= 1.0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_2 = ((fabs(__pyx_v_hd.v) <= 1.0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_hd.converged != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L7_bool_binop_done:; + if (__pyx_t_1) { + + /* "yt/utilities/lib/primitives.pyx":335 + * if (fabs(hd.u) <= 1.0 and fabs(hd.v) <= 1.0 and hd.converged): + * # we have a hit, so update ray information + * ray.t_far = hd.t # <<<<<<<<<<<<<< + * ray.elem_id = patch.elem_id + * return True + */ + __pyx_t_3 = __pyx_v_hd.t; + __pyx_v_ray->t_far = __pyx_t_3; + + /* "yt/utilities/lib/primitives.pyx":336 + * # we have a hit, so update ray information + * ray.t_far = hd.t + * ray.elem_id = patch.elem_id # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_t_4 = __pyx_v_patch.elem_id; + __pyx_v_ray->elem_id = __pyx_t_4; + + /* "yt/utilities/lib/primitives.pyx":337 + * ray.t_far = hd.t + * ray.elem_id = patch.elem_id + * return True # <<<<<<<<<<<<<< + * + * return False + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "yt/utilities/lib/primitives.pyx":333 + * return False + * + * if (fabs(hd.u) <= 1.0 and fabs(hd.v) <= 1.0 and hd.converged): # <<<<<<<<<<<<<< + * # we have a hit, so update ray information + * ray.t_far = hd.t + */ + } + + /* "yt/utilities/lib/primitives.pyx":339 + * return True + * + * return False # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "yt/utilities/lib/primitives.pyx":313 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef np.int64_t ray_patch_intersect(const void* primitives, # <<<<<<<<<<<<<< + * const np.int64_t item, + * Ray* ray) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/primitives.pyx":345 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void patch_centroid(const void *primitives, # <<<<<<<<<<<<<< + * const np.int64_t item, + * np.float64_t[3] centroid) nogil: + */ + +static void __pyx_f_2yt_9utilities_3lib_10primitives_patch_centroid(void const *__pyx_v_primitives, __pyx_t_5numpy_int64_t const __pyx_v_item, __pyx_t_5numpy_float64_t *__pyx_v_centroid) { + __pyx_t_5numpy_int64_t __pyx_v_i; + __pyx_t_5numpy_int64_t __pyx_v_j; + struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch __pyx_v_patch; + __pyx_t_5numpy_int64_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + __pyx_t_5numpy_int64_t __pyx_t_3; + + /* "yt/utilities/lib/primitives.pyx":357 + * + * cdef np.int64_t i, j + * cdef Patch patch = ( primitives)[item] # <<<<<<<<<<<<<< + * + * for j in range(3): + */ + __pyx_v_patch = (((struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch *)__pyx_v_primitives)[__pyx_v_item]); + + /* "yt/utilities/lib/primitives.pyx":359 + * cdef Patch patch = ( primitives)[item] + * + * for j in range(3): # <<<<<<<<<<<<<< + * centroid[j] = 0.0 + * + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_j = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":360 + * + * for j in range(3): + * centroid[j] = 0.0 # <<<<<<<<<<<<<< + * + * for i in range(8): + */ + (__pyx_v_centroid[__pyx_v_j]) = 0.0; + } + + /* "yt/utilities/lib/primitives.pyx":362 + * centroid[j] = 0.0 + * + * for i in range(8): # <<<<<<<<<<<<<< + * for j in range(3): + * centroid[j] += patch.v[i][j] + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 8; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":363 + * + * for i in range(8): + * for j in range(3): # <<<<<<<<<<<<<< + * centroid[j] += patch.v[i][j] + * + */ + for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { + __pyx_v_j = __pyx_t_2; + + /* "yt/utilities/lib/primitives.pyx":364 + * for i in range(8): + * for j in range(3): + * centroid[j] += patch.v[i][j] # <<<<<<<<<<<<<< + * + * for j in range(3): + */ + __pyx_t_3 = __pyx_v_j; + (__pyx_v_centroid[__pyx_t_3]) = ((__pyx_v_centroid[__pyx_t_3]) + ((__pyx_v_patch.v[__pyx_v_i])[__pyx_v_j])); + } + } + + /* "yt/utilities/lib/primitives.pyx":366 + * centroid[j] += patch.v[i][j] + * + * for j in range(3): # <<<<<<<<<<<<<< + * centroid[j] /= 8.0 + * + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_j = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":367 + * + * for j in range(3): + * centroid[j] /= 8.0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_v_j; + (__pyx_v_centroid[__pyx_t_2]) = ((__pyx_v_centroid[__pyx_t_2]) / 8.0); + } + + /* "yt/utilities/lib/primitives.pyx":345 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void patch_centroid(const void *primitives, # <<<<<<<<<<<<<< + * const np.int64_t item, + * np.float64_t[3] centroid) nogil: + */ + + /* function exit code */ +} + +/* "yt/utilities/lib/primitives.pyx":373 + * @cython.wraparound(False) + * @cython.cdivision(True) + * cdef void patch_bbox(const void *primitives, # <<<<<<<<<<<<<< + * const np.int64_t item, + * BBox* bbox) nogil: + */ + +static void __pyx_f_2yt_9utilities_3lib_10primitives_patch_bbox(void const *__pyx_v_primitives, __pyx_t_5numpy_int64_t const __pyx_v_item, struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox *__pyx_v_bbox) { + __pyx_t_5numpy_int64_t __pyx_v_i; + __pyx_t_5numpy_int64_t __pyx_v_j; + struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch __pyx_v_patch; + __pyx_t_5numpy_int64_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + + /* "yt/utilities/lib/primitives.pyx":386 + * + * cdef np.int64_t i, j + * cdef Patch patch = ( primitives)[item] # <<<<<<<<<<<<<< + * + * for j in range(3): + */ + __pyx_v_patch = (((struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch *)__pyx_v_primitives)[__pyx_v_item]); + + /* "yt/utilities/lib/primitives.pyx":388 + * cdef Patch patch = ( primitives)[item] + * + * for j in range(3): # <<<<<<<<<<<<<< + * bbox.left_edge[j] = patch.v[0][j] + * bbox.right_edge[j] = patch.v[0][j] + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_j = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":389 + * + * for j in range(3): + * bbox.left_edge[j] = patch.v[0][j] # <<<<<<<<<<<<<< + * bbox.right_edge[j] = patch.v[0][j] + * + */ + (__pyx_v_bbox->left_edge[__pyx_v_j]) = ((__pyx_v_patch.v[0])[__pyx_v_j]); + + /* "yt/utilities/lib/primitives.pyx":390 + * for j in range(3): + * bbox.left_edge[j] = patch.v[0][j] + * bbox.right_edge[j] = patch.v[0][j] # <<<<<<<<<<<<<< + * + * for i in range(1, 8): + */ + (__pyx_v_bbox->right_edge[__pyx_v_j]) = ((__pyx_v_patch.v[0])[__pyx_v_j]); + } + + /* "yt/utilities/lib/primitives.pyx":392 + * bbox.right_edge[j] = patch.v[0][j] + * + * for i in range(1, 8): # <<<<<<<<<<<<<< + * for j in range(3): + * bbox.left_edge[j] = fmin(bbox.left_edge[j], patch.v[i][j]) + */ + for (__pyx_t_1 = 1; __pyx_t_1 < 8; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "yt/utilities/lib/primitives.pyx":393 + * + * for i in range(1, 8): + * for j in range(3): # <<<<<<<<<<<<<< + * bbox.left_edge[j] = fmin(bbox.left_edge[j], patch.v[i][j]) + * bbox.right_edge[j] = fmax(bbox.right_edge[j], patch.v[i][j]) + */ + for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { + __pyx_v_j = __pyx_t_2; - /* "yt/utilities/lib/primitives.pyx":138 - * cdef np.int64_t i - * for i in range(3): - * bbox.left_edge[i] = fmin(fmin(tri.p0[i], tri.p1[i]), tri.p2[i]) # <<<<<<<<<<<<<< - * bbox.right_edge[i] = fmax(fmax(tri.p0[i], tri.p1[i]), tri.p2[i]) + /* "yt/utilities/lib/primitives.pyx":394 + * for i in range(1, 8): + * for j in range(3): + * bbox.left_edge[j] = fmin(bbox.left_edge[j], patch.v[i][j]) # <<<<<<<<<<<<<< + * bbox.right_edge[j] = fmax(bbox.right_edge[j], patch.v[i][j]) * */ - (__pyx_v_bbox->left_edge[__pyx_v_i]) = fmin(fmin((__pyx_v_tri.p0[__pyx_v_i]), (__pyx_v_tri.p1[__pyx_v_i])), (__pyx_v_tri.p2[__pyx_v_i])); + (__pyx_v_bbox->left_edge[__pyx_v_j]) = fmin((__pyx_v_bbox->left_edge[__pyx_v_j]), ((__pyx_v_patch.v[__pyx_v_i])[__pyx_v_j])); - /* "yt/utilities/lib/primitives.pyx":139 - * for i in range(3): - * bbox.left_edge[i] = fmin(fmin(tri.p0[i], tri.p1[i]), tri.p2[i]) - * bbox.right_edge[i] = fmax(fmax(tri.p0[i], tri.p1[i]), tri.p2[i]) # <<<<<<<<<<<<<< + /* "yt/utilities/lib/primitives.pyx":395 + * for j in range(3): + * bbox.left_edge[j] = fmin(bbox.left_edge[j], patch.v[i][j]) + * bbox.right_edge[j] = fmax(bbox.right_edge[j], patch.v[i][j]) # <<<<<<<<<<<<<< * * */ - (__pyx_v_bbox->right_edge[__pyx_v_i]) = fmax(fmax((__pyx_v_tri.p0[__pyx_v_i]), (__pyx_v_tri.p1[__pyx_v_i])), (__pyx_v_tri.p2[__pyx_v_i])); + (__pyx_v_bbox->right_edge[__pyx_v_j]) = fmax((__pyx_v_bbox->right_edge[__pyx_v_j]), ((__pyx_v_patch.v[__pyx_v_i])[__pyx_v_j])); + } } - /* "yt/utilities/lib/primitives.pyx":124 + /* "yt/utilities/lib/primitives.pyx":373 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void triangle_bbox(const void *primitives, # <<<<<<<<<<<<<< - * const np.int64_t item, - * BBox* bbox) nogil: + * cdef void patch_bbox(const void *primitives, # <<<<<<<<<<<<<< + * const np.int64_t item, + * BBox* bbox) nogil: */ /* function exit code */ } -/* "yt/utilities/lib/primitives.pyx":145 +/* "yt/utilities/lib/primitives.pyx":401 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patchSurfaceFunc(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cdef void tet_patchSurfaceFunc(const cython.floating[6][3] verts, # <<<<<<<<<<<<<< * const cython.floating u, * const cython.floating v, */ -static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc(float (*__pyx_v_verts)[3], float const __pyx_v_u, float const __pyx_v_v, float *__pyx_v_S) { +static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceFunc(float (*__pyx_v_verts)[3], float const __pyx_v_u, float const __pyx_v_v, float *__pyx_v_S) { int __pyx_v_i; int __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":160 - * ''' + /* "yt/utilities/lib/primitives.pyx":408 * cdef int i + * # Computes for canonical triangle coordinates * for i in range(3): # <<<<<<<<<<<<<< - * S[i] = 0.25*(1.0 - u)*(1.0 - v)*(-u - v - 1)*verts[0][i] + \ - * 0.25*(1.0 + u)*(1.0 - v)*( u - v - 1)*verts[1][i] + \ + * S[i] = (1.0 - 3.0*u + 2.0*u*u - 3.0*v + 2.0*v*v + 4.0*u*v)*verts[0][i] + \ + * (-u + 2.0*u*u)*verts[1][i] + \ */ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":161 - * cdef int i + /* "yt/utilities/lib/primitives.pyx":409 + * # Computes for canonical triangle coordinates * for i in range(3): - * S[i] = 0.25*(1.0 - u)*(1.0 - v)*(-u - v - 1)*verts[0][i] + \ # <<<<<<<<<<<<<< - * 0.25*(1.0 + u)*(1.0 - v)*( u - v - 1)*verts[1][i] + \ - * 0.25*(1.0 + u)*(1.0 + v)*( u + v - 1)*verts[2][i] + \ + * S[i] = (1.0 - 3.0*u + 2.0*u*u - 3.0*v + 2.0*v*v + 4.0*u*v)*verts[0][i] + \ # <<<<<<<<<<<<<< + * (-u + 2.0*u*u)*verts[1][i] + \ + * (-v + 2.0*v*v)*verts[2][i] + \ */ - (__pyx_v_S[__pyx_v_i]) = (((((((((((0.25 * (1.0 - __pyx_v_u)) * (1.0 - __pyx_v_v)) * (((-__pyx_v_u) - __pyx_v_v) - 1.0)) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((((0.25 * (1.0 + __pyx_v_u)) * (1.0 - __pyx_v_v)) * ((__pyx_v_u - __pyx_v_v) - 1.0)) * ((__pyx_v_verts[1])[__pyx_v_i]))) + ((((0.25 * (1.0 + __pyx_v_u)) * (1.0 + __pyx_v_v)) * ((__pyx_v_u + __pyx_v_v) - 1.0)) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((0.25 * (1.0 - __pyx_v_u)) * (1.0 + __pyx_v_v)) * (((-__pyx_v_u) + __pyx_v_v) - 1.0)) * ((__pyx_v_verts[3])[__pyx_v_i]))) + (((0.5 * (1.0 - __pyx_v_u)) * (1.0 - (__pyx_v_v * __pyx_v_v))) * ((__pyx_v_verts[4])[__pyx_v_i]))) + (((0.5 * (1.0 - (__pyx_v_u * __pyx_v_u))) * (1.0 - __pyx_v_v)) * ((__pyx_v_verts[5])[__pyx_v_i]))) + (((0.5 * (1.0 + __pyx_v_u)) * (1.0 - (__pyx_v_v * __pyx_v_v))) * ((__pyx_v_verts[6])[__pyx_v_i]))) + (((0.5 * (1.0 - (__pyx_v_u * __pyx_v_u))) * (1.0 + __pyx_v_v)) * ((__pyx_v_verts[7])[__pyx_v_i]))); + (__pyx_v_S[__pyx_v_i]) = (((((((((((1.0 - (3.0 * __pyx_v_u)) + ((2.0 * __pyx_v_u) * __pyx_v_u)) - (3.0 * __pyx_v_v)) + ((2.0 * __pyx_v_v) * __pyx_v_v)) + ((4.0 * __pyx_v_u) * __pyx_v_v)) * ((__pyx_v_verts[0])[__pyx_v_i])) + (((-__pyx_v_u) + ((2.0 * __pyx_v_u) * __pyx_v_u)) * ((__pyx_v_verts[1])[__pyx_v_i]))) + (((-__pyx_v_v) + ((2.0 * __pyx_v_v) * __pyx_v_v)) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((4.0 * __pyx_v_u) - ((4.0 * __pyx_v_u) * __pyx_v_u)) - ((4.0 * __pyx_v_u) * __pyx_v_v)) * ((__pyx_v_verts[3])[__pyx_v_i]))) + (((4.0 * __pyx_v_u) * __pyx_v_v) * ((__pyx_v_verts[4])[__pyx_v_i]))) + ((((4.0 * __pyx_v_v) - ((4.0 * __pyx_v_v) * __pyx_v_v)) - ((4.0 * __pyx_v_u) * __pyx_v_v)) * ((__pyx_v_verts[5])[__pyx_v_i]))); } - /* "yt/utilities/lib/primitives.pyx":145 + /* "yt/utilities/lib/primitives.pyx":401 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patchSurfaceFunc(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cdef void tet_patchSurfaceFunc(const cython.floating[6][3] verts, # <<<<<<<<<<<<<< * const cython.floating u, * const cython.floating v, */ @@ -2032,34 +3658,34 @@ /* function exit code */ } -static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc(double (*__pyx_v_verts)[3], double const __pyx_v_u, double const __pyx_v_v, double *__pyx_v_S) { +static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceFunc(double (*__pyx_v_verts)[3], double const __pyx_v_u, double const __pyx_v_v, double *__pyx_v_S) { int __pyx_v_i; int __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":160 - * ''' + /* "yt/utilities/lib/primitives.pyx":408 * cdef int i + * # Computes for canonical triangle coordinates * for i in range(3): # <<<<<<<<<<<<<< - * S[i] = 0.25*(1.0 - u)*(1.0 - v)*(-u - v - 1)*verts[0][i] + \ - * 0.25*(1.0 + u)*(1.0 - v)*( u - v - 1)*verts[1][i] + \ + * S[i] = (1.0 - 3.0*u + 2.0*u*u - 3.0*v + 2.0*v*v + 4.0*u*v)*verts[0][i] + \ + * (-u + 2.0*u*u)*verts[1][i] + \ */ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":161 - * cdef int i + /* "yt/utilities/lib/primitives.pyx":409 + * # Computes for canonical triangle coordinates * for i in range(3): - * S[i] = 0.25*(1.0 - u)*(1.0 - v)*(-u - v - 1)*verts[0][i] + \ # <<<<<<<<<<<<<< - * 0.25*(1.0 + u)*(1.0 - v)*( u - v - 1)*verts[1][i] + \ - * 0.25*(1.0 + u)*(1.0 + v)*( u + v - 1)*verts[2][i] + \ + * S[i] = (1.0 - 3.0*u + 2.0*u*u - 3.0*v + 2.0*v*v + 4.0*u*v)*verts[0][i] + \ # <<<<<<<<<<<<<< + * (-u + 2.0*u*u)*verts[1][i] + \ + * (-v + 2.0*v*v)*verts[2][i] + \ */ - (__pyx_v_S[__pyx_v_i]) = (((((((((((0.25 * (1.0 - __pyx_v_u)) * (1.0 - __pyx_v_v)) * (((-__pyx_v_u) - __pyx_v_v) - 1.0)) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((((0.25 * (1.0 + __pyx_v_u)) * (1.0 - __pyx_v_v)) * ((__pyx_v_u - __pyx_v_v) - 1.0)) * ((__pyx_v_verts[1])[__pyx_v_i]))) + ((((0.25 * (1.0 + __pyx_v_u)) * (1.0 + __pyx_v_v)) * ((__pyx_v_u + __pyx_v_v) - 1.0)) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((0.25 * (1.0 - __pyx_v_u)) * (1.0 + __pyx_v_v)) * (((-__pyx_v_u) + __pyx_v_v) - 1.0)) * ((__pyx_v_verts[3])[__pyx_v_i]))) + (((0.5 * (1.0 - __pyx_v_u)) * (1.0 - (__pyx_v_v * __pyx_v_v))) * ((__pyx_v_verts[4])[__pyx_v_i]))) + (((0.5 * (1.0 - (__pyx_v_u * __pyx_v_u))) * (1.0 - __pyx_v_v)) * ((__pyx_v_verts[5])[__pyx_v_i]))) + (((0.5 * (1.0 + __pyx_v_u)) * (1.0 - (__pyx_v_v * __pyx_v_v))) * ((__pyx_v_verts[6])[__pyx_v_i]))) + (((0.5 * (1.0 - (__pyx_v_u * __pyx_v_u))) * (1.0 + __pyx_v_v)) * ((__pyx_v_verts[7])[__pyx_v_i]))); + (__pyx_v_S[__pyx_v_i]) = (((((((((((1.0 - (3.0 * __pyx_v_u)) + ((2.0 * __pyx_v_u) * __pyx_v_u)) - (3.0 * __pyx_v_v)) + ((2.0 * __pyx_v_v) * __pyx_v_v)) + ((4.0 * __pyx_v_u) * __pyx_v_v)) * ((__pyx_v_verts[0])[__pyx_v_i])) + (((-__pyx_v_u) + ((2.0 * __pyx_v_u) * __pyx_v_u)) * ((__pyx_v_verts[1])[__pyx_v_i]))) + (((-__pyx_v_v) + ((2.0 * __pyx_v_v) * __pyx_v_v)) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((4.0 * __pyx_v_u) - ((4.0 * __pyx_v_u) * __pyx_v_u)) - ((4.0 * __pyx_v_u) * __pyx_v_v)) * ((__pyx_v_verts[3])[__pyx_v_i]))) + (((4.0 * __pyx_v_u) * __pyx_v_v) * ((__pyx_v_verts[4])[__pyx_v_i]))) + ((((4.0 * __pyx_v_v) - ((4.0 * __pyx_v_v) * __pyx_v_v)) - ((4.0 * __pyx_v_u) * __pyx_v_v)) * ((__pyx_v_verts[5])[__pyx_v_i]))); } - /* "yt/utilities/lib/primitives.pyx":145 + /* "yt/utilities/lib/primitives.pyx":401 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patchSurfaceFunc(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cdef void tet_patchSurfaceFunc(const cython.floating[6][3] verts, # <<<<<<<<<<<<<< * const cython.floating u, * const cython.floating v, */ @@ -2067,42 +3693,42 @@ /* function exit code */ } -/* "yt/utilities/lib/primitives.pyx":174 +/* "yt/utilities/lib/primitives.pyx":419 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patchSurfaceDerivU(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cdef void tet_patchSurfaceDerivU(const cython.floating[6][3] verts, # <<<<<<<<<<<<<< * const cython.floating u, * const cython.floating v, */ -static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivU(float (*__pyx_v_verts)[3], float const __pyx_v_u, float const __pyx_v_v, float *__pyx_v_Su) { +static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivU(float (*__pyx_v_verts)[3], float const __pyx_v_u, float const __pyx_v_v, float *__pyx_v_Su) { int __pyx_v_i; int __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":184 - * ''' + /* "yt/utilities/lib/primitives.pyx":425 * cdef int i + * # Computes for canonical triangle coordinates * for i in range(3): # <<<<<<<<<<<<<< - * Su[i] = (-0.25*(v - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ - * (-0.25*(v - 1.0)*(u - v - 1) - 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ + * Su[i] = (-3.0 + 4.0*u + 4.0*v)*verts[0][i] + \ + * (-1.0 + 4.0*u)*verts[1][i] + \ */ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":185 - * cdef int i + /* "yt/utilities/lib/primitives.pyx":426 + * # Computes for canonical triangle coordinates * for i in range(3): - * Su[i] = (-0.25*(v - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ # <<<<<<<<<<<<<< - * (-0.25*(v - 1.0)*(u - v - 1) - 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ - * ( 0.25*(v + 1.0)*(u + v - 1) + 0.25*(u + 1.0)*(v + 1.0))*verts[2][i] + \ + * Su[i] = (-3.0 + 4.0*u + 4.0*v)*verts[0][i] + \ # <<<<<<<<<<<<<< + * (-1.0 + 4.0*u)*verts[1][i] + \ + * (4.0 - 8.0*u - 4.0*v)*verts[3][i] + \ */ - (__pyx_v_Su[__pyx_v_i]) = (((((((((((-0.25 * (__pyx_v_v - 1.0)) * ((__pyx_v_u + __pyx_v_v) + 1.0)) - ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((((-0.25 * (__pyx_v_v - 1.0)) * ((__pyx_v_u - __pyx_v_v) - 1.0)) - ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[1])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_v + 1.0)) * ((__pyx_v_u + __pyx_v_v) - 1.0)) + ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_v + 1.0)) * ((__pyx_v_u - __pyx_v_v) + 1.0)) + ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[3])[__pyx_v_i]))) + ((0.5 * ((__pyx_v_v * __pyx_v_v) - 1.0)) * ((__pyx_v_verts[4])[__pyx_v_i]))) + ((__pyx_v_u * (__pyx_v_v - 1.0)) * ((__pyx_v_verts[5])[__pyx_v_i]))) - ((0.5 * ((__pyx_v_v * __pyx_v_v) - 1.0)) * ((__pyx_v_verts[6])[__pyx_v_i]))) - ((__pyx_v_u * (__pyx_v_v + 1.0)) * ((__pyx_v_verts[7])[__pyx_v_i]))); + (__pyx_v_Su[__pyx_v_i]) = (((((((-3.0 + (4.0 * __pyx_v_u)) + (4.0 * __pyx_v_v)) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((-1.0 + (4.0 * __pyx_v_u)) * ((__pyx_v_verts[1])[__pyx_v_i]))) + (((4.0 - (8.0 * __pyx_v_u)) - (4.0 * __pyx_v_v)) * ((__pyx_v_verts[3])[__pyx_v_i]))) + ((4.0 * __pyx_v_v) * ((__pyx_v_verts[4])[__pyx_v_i]))) + ((-4.0 * __pyx_v_v) * ((__pyx_v_verts[5])[__pyx_v_i]))); } - /* "yt/utilities/lib/primitives.pyx":174 + /* "yt/utilities/lib/primitives.pyx":419 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patchSurfaceDerivU(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cdef void tet_patchSurfaceDerivU(const cython.floating[6][3] verts, # <<<<<<<<<<<<<< * const cython.floating u, * const cython.floating v, */ @@ -2110,34 +3736,34 @@ /* function exit code */ } -static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivU(double (*__pyx_v_verts)[3], double const __pyx_v_u, double const __pyx_v_v, double *__pyx_v_Su) { +static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivU(double (*__pyx_v_verts)[3], double const __pyx_v_u, double const __pyx_v_v, double *__pyx_v_Su) { int __pyx_v_i; int __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":184 - * ''' + /* "yt/utilities/lib/primitives.pyx":425 * cdef int i + * # Computes for canonical triangle coordinates * for i in range(3): # <<<<<<<<<<<<<< - * Su[i] = (-0.25*(v - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ - * (-0.25*(v - 1.0)*(u - v - 1) - 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ + * Su[i] = (-3.0 + 4.0*u + 4.0*v)*verts[0][i] + \ + * (-1.0 + 4.0*u)*verts[1][i] + \ */ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":185 - * cdef int i + /* "yt/utilities/lib/primitives.pyx":426 + * # Computes for canonical triangle coordinates * for i in range(3): - * Su[i] = (-0.25*(v - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ # <<<<<<<<<<<<<< - * (-0.25*(v - 1.0)*(u - v - 1) - 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ - * ( 0.25*(v + 1.0)*(u + v - 1) + 0.25*(u + 1.0)*(v + 1.0))*verts[2][i] + \ + * Su[i] = (-3.0 + 4.0*u + 4.0*v)*verts[0][i] + \ # <<<<<<<<<<<<<< + * (-1.0 + 4.0*u)*verts[1][i] + \ + * (4.0 - 8.0*u - 4.0*v)*verts[3][i] + \ */ - (__pyx_v_Su[__pyx_v_i]) = (((((((((((-0.25 * (__pyx_v_v - 1.0)) * ((__pyx_v_u + __pyx_v_v) + 1.0)) - ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((((-0.25 * (__pyx_v_v - 1.0)) * ((__pyx_v_u - __pyx_v_v) - 1.0)) - ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[1])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_v + 1.0)) * ((__pyx_v_u + __pyx_v_v) - 1.0)) + ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_v + 1.0)) * ((__pyx_v_u - __pyx_v_v) + 1.0)) + ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[3])[__pyx_v_i]))) + ((0.5 * ((__pyx_v_v * __pyx_v_v) - 1.0)) * ((__pyx_v_verts[4])[__pyx_v_i]))) + ((__pyx_v_u * (__pyx_v_v - 1.0)) * ((__pyx_v_verts[5])[__pyx_v_i]))) - ((0.5 * ((__pyx_v_v * __pyx_v_v) - 1.0)) * ((__pyx_v_verts[6])[__pyx_v_i]))) - ((__pyx_v_u * (__pyx_v_v + 1.0)) * ((__pyx_v_verts[7])[__pyx_v_i]))); + (__pyx_v_Su[__pyx_v_i]) = (((((((-3.0 + (4.0 * __pyx_v_u)) + (4.0 * __pyx_v_v)) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((-1.0 + (4.0 * __pyx_v_u)) * ((__pyx_v_verts[1])[__pyx_v_i]))) + (((4.0 - (8.0 * __pyx_v_u)) - (4.0 * __pyx_v_v)) * ((__pyx_v_verts[3])[__pyx_v_i]))) + ((4.0 * __pyx_v_v) * ((__pyx_v_verts[4])[__pyx_v_i]))) + ((-4.0 * __pyx_v_v) * ((__pyx_v_verts[5])[__pyx_v_i]))); } - /* "yt/utilities/lib/primitives.pyx":174 + /* "yt/utilities/lib/primitives.pyx":419 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patchSurfaceDerivU(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cdef void tet_patchSurfaceDerivU(const cython.floating[6][3] verts, # <<<<<<<<<<<<<< * const cython.floating u, * const cython.floating v, */ @@ -2145,42 +3771,42 @@ /* function exit code */ } -/* "yt/utilities/lib/primitives.pyx":196 +/* "yt/utilities/lib/primitives.pyx":436 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patchSurfaceDerivV(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cdef void tet_patchSurfaceDerivV(const cython.floating[6][3] verts, # <<<<<<<<<<<<<< * const cython.floating u, * const cython.floating v, */ -static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivV(float (*__pyx_v_verts)[3], float const __pyx_v_u, float const __pyx_v_v, float *__pyx_v_Sv) { +static void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivV(float (*__pyx_v_verts)[3], float const __pyx_v_u, float const __pyx_v_v, float *__pyx_v_Sv) { int __pyx_v_i; int __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":206 - * ''' + /* "yt/utilities/lib/primitives.pyx":443 * cdef int i + * # Computes for canonical triangle coordinates * for i in range(3): # <<<<<<<<<<<<<< - * Sv[i] = (-0.25*(u - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ - * (-0.25*(u + 1.0)*(u - v - 1) + 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ + * Sv[i] = (-3.0 + 4.0*v + 4.0*u)*verts[0][i] + \ + * (-1.0 + 4.0*v)*verts[2][i] + \ */ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":207 - * cdef int i + /* "yt/utilities/lib/primitives.pyx":444 + * # Computes for canonical triangle coordinates * for i in range(3): - * Sv[i] = (-0.25*(u - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ # <<<<<<<<<<<<<< - * (-0.25*(u + 1.0)*(u - v - 1) + 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ - * ( 0.25*(u + 1.0)*(u + v - 1) + 0.25*(u + 1.0)*(v + 1.0))*verts[2][i] + \ + * Sv[i] = (-3.0 + 4.0*v + 4.0*u)*verts[0][i] + \ # <<<<<<<<<<<<<< + * (-1.0 + 4.0*v)*verts[2][i] + \ + * (-4.0*u)*verts[3][i] + \ */ - (__pyx_v_Sv[__pyx_v_i]) = (((((((((((-0.25 * (__pyx_v_u - 1.0)) * ((__pyx_v_u + __pyx_v_v) + 1.0)) - ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((((-0.25 * (__pyx_v_u + 1.0)) * ((__pyx_v_u - __pyx_v_v) - 1.0)) + ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[1])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_u + 1.0)) * ((__pyx_v_u + __pyx_v_v) - 1.0)) + ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_u - 1.0)) * ((__pyx_v_u - __pyx_v_v) + 1.0)) - ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[3])[__pyx_v_i]))) + ((0.5 * ((__pyx_v_u * __pyx_v_u) - 1.0)) * ((__pyx_v_verts[5])[__pyx_v_i]))) + ((__pyx_v_v * (__pyx_v_u - 1.0)) * ((__pyx_v_verts[4])[__pyx_v_i]))) - ((0.5 * ((__pyx_v_u * __pyx_v_u) - 1.0)) * ((__pyx_v_verts[7])[__pyx_v_i]))) - ((__pyx_v_v * (__pyx_v_u + 1.0)) * ((__pyx_v_verts[6])[__pyx_v_i]))); + (__pyx_v_Sv[__pyx_v_i]) = (((((((-3.0 + (4.0 * __pyx_v_v)) + (4.0 * __pyx_v_u)) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((-1.0 + (4.0 * __pyx_v_v)) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((-4.0 * __pyx_v_u) * ((__pyx_v_verts[3])[__pyx_v_i]))) + ((4.0 * __pyx_v_u) * ((__pyx_v_verts[4])[__pyx_v_i]))) + (((4.0 - (8.0 * __pyx_v_v)) - (4.0 * __pyx_v_u)) * ((__pyx_v_verts[5])[__pyx_v_i]))); } - /* "yt/utilities/lib/primitives.pyx":196 + /* "yt/utilities/lib/primitives.pyx":436 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patchSurfaceDerivV(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cdef void tet_patchSurfaceDerivV(const cython.floating[6][3] verts, # <<<<<<<<<<<<<< * const cython.floating u, * const cython.floating v, */ @@ -2188,34 +3814,34 @@ /* function exit code */ } -static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivV(double (*__pyx_v_verts)[3], double const __pyx_v_u, double const __pyx_v_v, double *__pyx_v_Sv) { +static void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivV(double (*__pyx_v_verts)[3], double const __pyx_v_u, double const __pyx_v_v, double *__pyx_v_Sv) { int __pyx_v_i; int __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":206 - * ''' + /* "yt/utilities/lib/primitives.pyx":443 * cdef int i + * # Computes for canonical triangle coordinates * for i in range(3): # <<<<<<<<<<<<<< - * Sv[i] = (-0.25*(u - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ - * (-0.25*(u + 1.0)*(u - v - 1) + 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ + * Sv[i] = (-3.0 + 4.0*v + 4.0*u)*verts[0][i] + \ + * (-1.0 + 4.0*v)*verts[2][i] + \ */ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":207 - * cdef int i + /* "yt/utilities/lib/primitives.pyx":444 + * # Computes for canonical triangle coordinates * for i in range(3): - * Sv[i] = (-0.25*(u - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ # <<<<<<<<<<<<<< - * (-0.25*(u + 1.0)*(u - v - 1) + 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ - * ( 0.25*(u + 1.0)*(u + v - 1) + 0.25*(u + 1.0)*(v + 1.0))*verts[2][i] + \ + * Sv[i] = (-3.0 + 4.0*v + 4.0*u)*verts[0][i] + \ # <<<<<<<<<<<<<< + * (-1.0 + 4.0*v)*verts[2][i] + \ + * (-4.0*u)*verts[3][i] + \ */ - (__pyx_v_Sv[__pyx_v_i]) = (((((((((((-0.25 * (__pyx_v_u - 1.0)) * ((__pyx_v_u + __pyx_v_v) + 1.0)) - ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((((-0.25 * (__pyx_v_u + 1.0)) * ((__pyx_v_u - __pyx_v_v) - 1.0)) + ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v - 1.0))) * ((__pyx_v_verts[1])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_u + 1.0)) * ((__pyx_v_u + __pyx_v_v) - 1.0)) + ((0.25 * (__pyx_v_u + 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((((0.25 * (__pyx_v_u - 1.0)) * ((__pyx_v_u - __pyx_v_v) + 1.0)) - ((0.25 * (__pyx_v_u - 1.0)) * (__pyx_v_v + 1.0))) * ((__pyx_v_verts[3])[__pyx_v_i]))) + ((0.5 * ((__pyx_v_u * __pyx_v_u) - 1.0)) * ((__pyx_v_verts[5])[__pyx_v_i]))) + ((__pyx_v_v * (__pyx_v_u - 1.0)) * ((__pyx_v_verts[4])[__pyx_v_i]))) - ((0.5 * ((__pyx_v_u * __pyx_v_u) - 1.0)) * ((__pyx_v_verts[7])[__pyx_v_i]))) - ((__pyx_v_v * (__pyx_v_u + 1.0)) * ((__pyx_v_verts[6])[__pyx_v_i]))); + (__pyx_v_Sv[__pyx_v_i]) = (((((((-3.0 + (4.0 * __pyx_v_v)) + (4.0 * __pyx_v_u)) * ((__pyx_v_verts[0])[__pyx_v_i])) + ((-1.0 + (4.0 * __pyx_v_v)) * ((__pyx_v_verts[2])[__pyx_v_i]))) + ((-4.0 * __pyx_v_u) * ((__pyx_v_verts[3])[__pyx_v_i]))) + ((4.0 * __pyx_v_u) * ((__pyx_v_verts[4])[__pyx_v_i]))) + (((4.0 - (8.0 * __pyx_v_v)) - (4.0 * __pyx_v_u)) * ((__pyx_v_verts[5])[__pyx_v_i]))); } - /* "yt/utilities/lib/primitives.pyx":196 + /* "yt/utilities/lib/primitives.pyx":436 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patchSurfaceDerivV(const cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cdef void tet_patchSurfaceDerivV(const cython.floating[6][3] verts, # <<<<<<<<<<<<<< * const cython.floating u, * const cython.floating v, */ @@ -2223,15 +3849,15 @@ /* function exit code */ } -/* "yt/utilities/lib/primitives.pyx":218 +/* "yt/utilities/lib/primitives.pyx":454 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef RayHitData compute_patch_hit(cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cdef RayHitData compute_tet_patch_hit(cython.floating[6][3] verts, # <<<<<<<<<<<<<< * cython.floating[3] ray_origin, * cython.floating[3] ray_direction) nogil: */ -static struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_compute_patch_hit(float (*__pyx_v_verts)[3], float *__pyx_v_ray_origin, float *__pyx_v_ray_direction) { +static struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_compute_tet_patch_hit(float (*__pyx_v_verts)[3], float *__pyx_v_ray_origin, float *__pyx_v_ray_direction) { float __pyx_v_n[3]; float __pyx_v_N1[3]; float __pyx_v_N2[3]; @@ -2262,7 +3888,7 @@ int __pyx_t_2; int __pyx_t_3; - /* "yt/utilities/lib/primitives.pyx":230 + /* "yt/utilities/lib/primitives.pyx":460 * # first we compute the two planes that define the ray. * cdef cython.floating[3] n, N1, N2 * cdef cython.floating A = dot(ray_direction, ray_direction) # <<<<<<<<<<<<<< @@ -2271,7 +3897,7 @@ */ __pyx_v_A = __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_ray_direction, __pyx_v_ray_direction); - /* "yt/utilities/lib/primitives.pyx":231 + /* "yt/utilities/lib/primitives.pyx":461 * cdef cython.floating[3] n, N1, N2 * cdef cython.floating A = dot(ray_direction, ray_direction) * for i in range(3): # <<<<<<<<<<<<<< @@ -2281,7 +3907,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":232 + /* "yt/utilities/lib/primitives.pyx":462 * cdef cython.floating A = dot(ray_direction, ray_direction) * for i in range(3): * n[i] = ray_direction[i] / A # <<<<<<<<<<<<<< @@ -2291,7 +3917,7 @@ (__pyx_v_n[__pyx_v_i]) = ((__pyx_v_ray_direction[__pyx_v_i]) / __pyx_v_A); } - /* "yt/utilities/lib/primitives.pyx":234 + /* "yt/utilities/lib/primitives.pyx":464 * n[i] = ray_direction[i] / A * * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): # <<<<<<<<<<<<<< @@ -2309,7 +3935,7 @@ __pyx_L6_bool_binop_done:; if (__pyx_t_2) { - /* "yt/utilities/lib/primitives.pyx":235 + /* "yt/utilities/lib/primitives.pyx":465 * * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): * N1[0] = n[1] # <<<<<<<<<<<<<< @@ -2318,7 +3944,7 @@ */ (__pyx_v_N1[0]) = (__pyx_v_n[1]); - /* "yt/utilities/lib/primitives.pyx":236 + /* "yt/utilities/lib/primitives.pyx":466 * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): * N1[0] = n[1] * N1[1] =-n[0] # <<<<<<<<<<<<<< @@ -2327,7 +3953,7 @@ */ (__pyx_v_N1[1]) = (-(__pyx_v_n[0])); - /* "yt/utilities/lib/primitives.pyx":237 + /* "yt/utilities/lib/primitives.pyx":467 * N1[0] = n[1] * N1[1] =-n[0] * N1[2] = 0.0 # <<<<<<<<<<<<<< @@ -2336,7 +3962,7 @@ */ (__pyx_v_N1[2]) = 0.0; - /* "yt/utilities/lib/primitives.pyx":234 + /* "yt/utilities/lib/primitives.pyx":464 * n[i] = ray_direction[i] / A * * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): # <<<<<<<<<<<<<< @@ -2346,7 +3972,7 @@ goto __pyx_L5; } - /* "yt/utilities/lib/primitives.pyx":239 + /* "yt/utilities/lib/primitives.pyx":469 * N1[2] = 0.0 * else: * N1[0] = 0.0 # <<<<<<<<<<<<<< @@ -2356,7 +3982,7 @@ /*else*/ { (__pyx_v_N1[0]) = 0.0; - /* "yt/utilities/lib/primitives.pyx":240 + /* "yt/utilities/lib/primitives.pyx":470 * else: * N1[0] = 0.0 * N1[1] = n[2] # <<<<<<<<<<<<<< @@ -2365,7 +3991,7 @@ */ (__pyx_v_N1[1]) = (__pyx_v_n[2]); - /* "yt/utilities/lib/primitives.pyx":241 + /* "yt/utilities/lib/primitives.pyx":471 * N1[0] = 0.0 * N1[1] = n[2] * N1[2] =-n[1] # <<<<<<<<<<<<<< @@ -2376,7 +4002,7 @@ } __pyx_L5:; - /* "yt/utilities/lib/primitives.pyx":242 + /* "yt/utilities/lib/primitives.pyx":472 * N1[1] = n[2] * N1[2] =-n[1] * cross(N1, n, N2) # <<<<<<<<<<<<<< @@ -2385,7 +4011,7 @@ */ __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(__pyx_v_N1, __pyx_v_n, __pyx_v_N2); - /* "yt/utilities/lib/primitives.pyx":244 + /* "yt/utilities/lib/primitives.pyx":474 * cross(N1, n, N2) * * cdef cython.floating d1 = -dot(N1, ray_origin) # <<<<<<<<<<<<<< @@ -2394,7 +4020,7 @@ */ __pyx_v_d1 = (-__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_ray_origin)); - /* "yt/utilities/lib/primitives.pyx":245 + /* "yt/utilities/lib/primitives.pyx":475 * * cdef cython.floating d1 = -dot(N1, ray_origin) * cdef cython.floating d2 = -dot(N2, ray_origin) # <<<<<<<<<<<<<< @@ -2403,7 +4029,7 @@ */ __pyx_v_d2 = (-__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_ray_origin)); - /* "yt/utilities/lib/primitives.pyx":248 + /* "yt/utilities/lib/primitives.pyx":478 * * # the initial guess is set to zero * cdef cython.floating u = 0.0 # <<<<<<<<<<<<<< @@ -2412,35 +4038,35 @@ */ __pyx_v_u = 0.0; - /* "yt/utilities/lib/primitives.pyx":249 + /* "yt/utilities/lib/primitives.pyx":479 * # the initial guess is set to zero * cdef cython.floating u = 0.0 * cdef cython.floating v = 0.0 # <<<<<<<<<<<<<< * cdef cython.floating[3] S - * patchSurfaceFunc(verts, u, v, S) + * tet_patchSurfaceFunc(verts, u, v, S) */ __pyx_v_v = 0.0; - /* "yt/utilities/lib/primitives.pyx":251 + /* "yt/utilities/lib/primitives.pyx":481 * cdef cython.floating v = 0.0 * cdef cython.floating[3] S - * patchSurfaceFunc(verts, u, v, S) # <<<<<<<<<<<<<< + * tet_patchSurfaceFunc(verts, u, v, S) # <<<<<<<<<<<<<< * cdef cython.floating fu = dot(N1, S) + d1 * cdef cython.floating fv = dot(N2, S) + d2 */ - __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_S); + __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceFunc(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_S); - /* "yt/utilities/lib/primitives.pyx":252 + /* "yt/utilities/lib/primitives.pyx":482 * cdef cython.floating[3] S - * patchSurfaceFunc(verts, u, v, S) + * tet_patchSurfaceFunc(verts, u, v, S) * cdef cython.floating fu = dot(N1, S) + d1 # <<<<<<<<<<<<<< * cdef cython.floating fv = dot(N2, S) + d2 * cdef cython.floating err = fmax(fabs(fu), fabs(fv)) */ __pyx_v_fu = (__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_S) + __pyx_v_d1); - /* "yt/utilities/lib/primitives.pyx":253 - * patchSurfaceFunc(verts, u, v, S) + /* "yt/utilities/lib/primitives.pyx":483 + * tet_patchSurfaceFunc(verts, u, v, S) * cdef cython.floating fu = dot(N1, S) + d1 * cdef cython.floating fv = dot(N2, S) + d2 # <<<<<<<<<<<<<< * cdef cython.floating err = fmax(fabs(fu), fabs(fv)) @@ -2448,7 +4074,7 @@ */ __pyx_v_fv = (__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_S) + __pyx_v_d2); - /* "yt/utilities/lib/primitives.pyx":254 + /* "yt/utilities/lib/primitives.pyx":484 * cdef cython.floating fu = dot(N1, S) + d1 * cdef cython.floating fv = dot(N2, S) + d2 * cdef cython.floating err = fmax(fabs(fu), fabs(fv)) # <<<<<<<<<<<<<< @@ -2457,7 +4083,7 @@ */ __pyx_v_err = fmax(fabs(__pyx_v_fu), fabs(__pyx_v_fv)); - /* "yt/utilities/lib/primitives.pyx":257 + /* "yt/utilities/lib/primitives.pyx":487 * * # begin Newton interation * cdef cython.floating tol = 1.0e-5 # <<<<<<<<<<<<<< @@ -2466,7 +4092,7 @@ */ __pyx_v_tol = 1.0e-5; - /* "yt/utilities/lib/primitives.pyx":258 + /* "yt/utilities/lib/primitives.pyx":488 * # begin Newton interation * cdef cython.floating tol = 1.0e-5 * cdef int iterations = 0 # <<<<<<<<<<<<<< @@ -2475,7 +4101,7 @@ */ __pyx_v_iterations = 0; - /* "yt/utilities/lib/primitives.pyx":259 + /* "yt/utilities/lib/primitives.pyx":489 * cdef cython.floating tol = 1.0e-5 * cdef int iterations = 0 * cdef int max_iter = 10 # <<<<<<<<<<<<<< @@ -2484,12 +4110,12 @@ */ __pyx_v_max_iter = 10; - /* "yt/utilities/lib/primitives.pyx":263 + /* "yt/utilities/lib/primitives.pyx":493 * cdef cython.floating[3] Sv * cdef cython.floating J11, J12, J21, J22, det * while ((err > tol) and (iterations < max_iter)): # <<<<<<<<<<<<<< * # compute the Jacobian - * patchSurfaceDerivU(verts, u, v, Su) + * tet_patchSurfaceDerivU(verts, u, v, Su) */ while (1) { __pyx_t_3 = ((__pyx_v_err > __pyx_v_tol) != 0); @@ -2503,35 +4129,35 @@ __pyx_L10_bool_binop_done:; if (!__pyx_t_2) break; - /* "yt/utilities/lib/primitives.pyx":265 + /* "yt/utilities/lib/primitives.pyx":495 * while ((err > tol) and (iterations < max_iter)): * # compute the Jacobian - * patchSurfaceDerivU(verts, u, v, Su) # <<<<<<<<<<<<<< - * patchSurfaceDerivV(verts, u, v, Sv) + * tet_patchSurfaceDerivU(verts, u, v, Su) # <<<<<<<<<<<<<< + * tet_patchSurfaceDerivV(verts, u, v, Sv) * J11 = dot(N1, Su) */ - __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivU(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_Su); + __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivU(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_Su); - /* "yt/utilities/lib/primitives.pyx":266 + /* "yt/utilities/lib/primitives.pyx":496 * # compute the Jacobian - * patchSurfaceDerivU(verts, u, v, Su) - * patchSurfaceDerivV(verts, u, v, Sv) # <<<<<<<<<<<<<< + * tet_patchSurfaceDerivU(verts, u, v, Su) + * tet_patchSurfaceDerivV(verts, u, v, Sv) # <<<<<<<<<<<<<< * J11 = dot(N1, Su) * J12 = dot(N1, Sv) */ - __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivV(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_Sv); + __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivV(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_Sv); - /* "yt/utilities/lib/primitives.pyx":267 - * patchSurfaceDerivU(verts, u, v, Su) - * patchSurfaceDerivV(verts, u, v, Sv) + /* "yt/utilities/lib/primitives.pyx":497 + * tet_patchSurfaceDerivU(verts, u, v, Su) + * tet_patchSurfaceDerivV(verts, u, v, Sv) * J11 = dot(N1, Su) # <<<<<<<<<<<<<< * J12 = dot(N1, Sv) * J21 = dot(N2, Su) */ __pyx_v_J11 = __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_Su); - /* "yt/utilities/lib/primitives.pyx":268 - * patchSurfaceDerivV(verts, u, v, Sv) + /* "yt/utilities/lib/primitives.pyx":498 + * tet_patchSurfaceDerivV(verts, u, v, Sv) * J11 = dot(N1, Su) * J12 = dot(N1, Sv) # <<<<<<<<<<<<<< * J21 = dot(N2, Su) @@ -2539,7 +4165,7 @@ */ __pyx_v_J12 = __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_Sv); - /* "yt/utilities/lib/primitives.pyx":269 + /* "yt/utilities/lib/primitives.pyx":499 * J11 = dot(N1, Su) * J12 = dot(N1, Sv) * J21 = dot(N2, Su) # <<<<<<<<<<<<<< @@ -2548,7 +4174,7 @@ */ __pyx_v_J21 = __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_Su); - /* "yt/utilities/lib/primitives.pyx":270 + /* "yt/utilities/lib/primitives.pyx":500 * J12 = dot(N1, Sv) * J21 = dot(N2, Su) * J22 = dot(N2, Sv) # <<<<<<<<<<<<<< @@ -2557,7 +4183,7 @@ */ __pyx_v_J22 = __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_Sv); - /* "yt/utilities/lib/primitives.pyx":271 + /* "yt/utilities/lib/primitives.pyx":501 * J21 = dot(N2, Su) * J22 = dot(N2, Sv) * det = (J11*J22 - J12*J21) # <<<<<<<<<<<<<< @@ -2566,7 +4192,7 @@ */ __pyx_v_det = ((__pyx_v_J11 * __pyx_v_J22) - (__pyx_v_J12 * __pyx_v_J21)); - /* "yt/utilities/lib/primitives.pyx":274 + /* "yt/utilities/lib/primitives.pyx":504 * * # update the u, v values * u -= ( J22*fu - J12*fv) / det # <<<<<<<<<<<<<< @@ -2575,35 +4201,35 @@ */ __pyx_v_u = (__pyx_v_u - (((__pyx_v_J22 * __pyx_v_fu) - (__pyx_v_J12 * __pyx_v_fv)) / __pyx_v_det)); - /* "yt/utilities/lib/primitives.pyx":275 + /* "yt/utilities/lib/primitives.pyx":505 * # update the u, v values * u -= ( J22*fu - J12*fv) / det * v -= (-J21*fu + J11*fv) / det # <<<<<<<<<<<<<< * - * patchSurfaceFunc(verts, u, v, S) + * tet_patchSurfaceFunc(verts, u, v, S) */ __pyx_v_v = (__pyx_v_v - ((((-__pyx_v_J21) * __pyx_v_fu) + (__pyx_v_J11 * __pyx_v_fv)) / __pyx_v_det)); - /* "yt/utilities/lib/primitives.pyx":277 + /* "yt/utilities/lib/primitives.pyx":507 * v -= (-J21*fu + J11*fv) / det * - * patchSurfaceFunc(verts, u, v, S) # <<<<<<<<<<<<<< + * tet_patchSurfaceFunc(verts, u, v, S) # <<<<<<<<<<<<<< * fu = dot(N1, S) + d1 * fv = dot(N2, S) + d2 */ - __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_S); + __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceFunc(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_S); - /* "yt/utilities/lib/primitives.pyx":278 + /* "yt/utilities/lib/primitives.pyx":508 * - * patchSurfaceFunc(verts, u, v, S) + * tet_patchSurfaceFunc(verts, u, v, S) * fu = dot(N1, S) + d1 # <<<<<<<<<<<<<< * fv = dot(N2, S) + d2 * */ __pyx_v_fu = (__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_S) + __pyx_v_d1); - /* "yt/utilities/lib/primitives.pyx":279 - * patchSurfaceFunc(verts, u, v, S) + /* "yt/utilities/lib/primitives.pyx":509 + * tet_patchSurfaceFunc(verts, u, v, S) * fu = dot(N1, S) + d1 * fv = dot(N2, S) + d2 # <<<<<<<<<<<<<< * @@ -2611,7 +4237,7 @@ */ __pyx_v_fv = (__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_S) + __pyx_v_d2); - /* "yt/utilities/lib/primitives.pyx":281 + /* "yt/utilities/lib/primitives.pyx":511 * fv = dot(N2, S) + d2 * * err = fmax(fabs(fu), fabs(fv)) # <<<<<<<<<<<<<< @@ -2620,7 +4246,7 @@ */ __pyx_v_err = fmax(fabs(__pyx_v_fu), fabs(__pyx_v_fv)); - /* "yt/utilities/lib/primitives.pyx":282 + /* "yt/utilities/lib/primitives.pyx":512 * * err = fmax(fabs(fu), fabs(fv)) * iterations += 1 # <<<<<<<<<<<<<< @@ -2630,7 +4256,7 @@ __pyx_v_iterations = (__pyx_v_iterations + 1); } - /* "yt/utilities/lib/primitives.pyx":285 + /* "yt/utilities/lib/primitives.pyx":515 * * # t is the distance along the ray to this hit * cdef cython.floating t = distance(S, ray_origin) / L2_norm(ray_direction) # <<<<<<<<<<<<<< @@ -2639,7 +4265,7 @@ */ __pyx_v_t = (__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(__pyx_v_S, __pyx_v_ray_origin) / __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(__pyx_v_ray_direction)); - /* "yt/utilities/lib/primitives.pyx":289 + /* "yt/utilities/lib/primitives.pyx":519 * # return hit data * cdef RayHitData hd * hd.u = u # <<<<<<<<<<<<<< @@ -2648,7 +4274,7 @@ */ __pyx_v_hd.u = __pyx_v_u; - /* "yt/utilities/lib/primitives.pyx":290 + /* "yt/utilities/lib/primitives.pyx":520 * cdef RayHitData hd * hd.u = u * hd.v = v # <<<<<<<<<<<<<< @@ -2657,7 +4283,7 @@ */ __pyx_v_hd.v = __pyx_v_v; - /* "yt/utilities/lib/primitives.pyx":291 + /* "yt/utilities/lib/primitives.pyx":521 * hd.u = u * hd.v = v * hd.t = t # <<<<<<<<<<<<<< @@ -2666,7 +4292,7 @@ */ __pyx_v_hd.t = __pyx_v_t; - /* "yt/utilities/lib/primitives.pyx":292 + /* "yt/utilities/lib/primitives.pyx":522 * hd.v = v * hd.t = t * hd.converged = (iterations < max_iter) # <<<<<<<<<<<<<< @@ -2675,7 +4301,7 @@ */ __pyx_v_hd.converged = (__pyx_v_iterations < __pyx_v_max_iter); - /* "yt/utilities/lib/primitives.pyx":293 + /* "yt/utilities/lib/primitives.pyx":523 * hd.t = t * hd.converged = (iterations < max_iter) * return hd # <<<<<<<<<<<<<< @@ -2685,10 +4311,10 @@ __pyx_r = __pyx_v_hd; goto __pyx_L0; - /* "yt/utilities/lib/primitives.pyx":218 + /* "yt/utilities/lib/primitives.pyx":454 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef RayHitData compute_patch_hit(cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cdef RayHitData compute_tet_patch_hit(cython.floating[6][3] verts, # <<<<<<<<<<<<<< * cython.floating[3] ray_origin, * cython.floating[3] ray_direction) nogil: */ @@ -2698,7 +4324,7 @@ return __pyx_r; } -static struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_compute_patch_hit(double (*__pyx_v_verts)[3], double *__pyx_v_ray_origin, double *__pyx_v_ray_direction) { +static struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_compute_tet_patch_hit(double (*__pyx_v_verts)[3], double *__pyx_v_ray_origin, double *__pyx_v_ray_direction) { double __pyx_v_n[3]; double __pyx_v_N1[3]; double __pyx_v_N2[3]; @@ -2729,7 +4355,7 @@ int __pyx_t_2; int __pyx_t_3; - /* "yt/utilities/lib/primitives.pyx":230 + /* "yt/utilities/lib/primitives.pyx":460 * # first we compute the two planes that define the ray. * cdef cython.floating[3] n, N1, N2 * cdef cython.floating A = dot(ray_direction, ray_direction) # <<<<<<<<<<<<<< @@ -2738,7 +4364,7 @@ */ __pyx_v_A = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_ray_direction, __pyx_v_ray_direction); - /* "yt/utilities/lib/primitives.pyx":231 + /* "yt/utilities/lib/primitives.pyx":461 * cdef cython.floating[3] n, N1, N2 * cdef cython.floating A = dot(ray_direction, ray_direction) * for i in range(3): # <<<<<<<<<<<<<< @@ -2748,7 +4374,7 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":232 + /* "yt/utilities/lib/primitives.pyx":462 * cdef cython.floating A = dot(ray_direction, ray_direction) * for i in range(3): * n[i] = ray_direction[i] / A # <<<<<<<<<<<<<< @@ -2758,7 +4384,7 @@ (__pyx_v_n[__pyx_v_i]) = ((__pyx_v_ray_direction[__pyx_v_i]) / __pyx_v_A); } - /* "yt/utilities/lib/primitives.pyx":234 + /* "yt/utilities/lib/primitives.pyx":464 * n[i] = ray_direction[i] / A * * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): # <<<<<<<<<<<<<< @@ -2776,7 +4402,7 @@ __pyx_L6_bool_binop_done:; if (__pyx_t_2) { - /* "yt/utilities/lib/primitives.pyx":235 + /* "yt/utilities/lib/primitives.pyx":465 * * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): * N1[0] = n[1] # <<<<<<<<<<<<<< @@ -2785,7 +4411,7 @@ */ (__pyx_v_N1[0]) = (__pyx_v_n[1]); - /* "yt/utilities/lib/primitives.pyx":236 + /* "yt/utilities/lib/primitives.pyx":466 * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): * N1[0] = n[1] * N1[1] =-n[0] # <<<<<<<<<<<<<< @@ -2794,7 +4420,7 @@ */ (__pyx_v_N1[1]) = (-(__pyx_v_n[0])); - /* "yt/utilities/lib/primitives.pyx":237 + /* "yt/utilities/lib/primitives.pyx":467 * N1[0] = n[1] * N1[1] =-n[0] * N1[2] = 0.0 # <<<<<<<<<<<<<< @@ -2803,7 +4429,7 @@ */ (__pyx_v_N1[2]) = 0.0; - /* "yt/utilities/lib/primitives.pyx":234 + /* "yt/utilities/lib/primitives.pyx":464 * n[i] = ray_direction[i] / A * * if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): # <<<<<<<<<<<<<< @@ -2813,7 +4439,7 @@ goto __pyx_L5; } - /* "yt/utilities/lib/primitives.pyx":239 + /* "yt/utilities/lib/primitives.pyx":469 * N1[2] = 0.0 * else: * N1[0] = 0.0 # <<<<<<<<<<<<<< @@ -2823,7 +4449,7 @@ /*else*/ { (__pyx_v_N1[0]) = 0.0; - /* "yt/utilities/lib/primitives.pyx":240 + /* "yt/utilities/lib/primitives.pyx":470 * else: * N1[0] = 0.0 * N1[1] = n[2] # <<<<<<<<<<<<<< @@ -2832,7 +4458,7 @@ */ (__pyx_v_N1[1]) = (__pyx_v_n[2]); - /* "yt/utilities/lib/primitives.pyx":241 + /* "yt/utilities/lib/primitives.pyx":471 * N1[0] = 0.0 * N1[1] = n[2] * N1[2] =-n[1] # <<<<<<<<<<<<<< @@ -2843,7 +4469,7 @@ } __pyx_L5:; - /* "yt/utilities/lib/primitives.pyx":242 + /* "yt/utilities/lib/primitives.pyx":472 * N1[1] = n[2] * N1[2] =-n[1] * cross(N1, n, N2) # <<<<<<<<<<<<<< @@ -2852,7 +4478,7 @@ */ __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(__pyx_v_N1, __pyx_v_n, __pyx_v_N2); - /* "yt/utilities/lib/primitives.pyx":244 + /* "yt/utilities/lib/primitives.pyx":474 * cross(N1, n, N2) * * cdef cython.floating d1 = -dot(N1, ray_origin) # <<<<<<<<<<<<<< @@ -2861,7 +4487,7 @@ */ __pyx_v_d1 = (-__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_ray_origin)); - /* "yt/utilities/lib/primitives.pyx":245 + /* "yt/utilities/lib/primitives.pyx":475 * * cdef cython.floating d1 = -dot(N1, ray_origin) * cdef cython.floating d2 = -dot(N2, ray_origin) # <<<<<<<<<<<<<< @@ -2870,7 +4496,7 @@ */ __pyx_v_d2 = (-__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_ray_origin)); - /* "yt/utilities/lib/primitives.pyx":248 + /* "yt/utilities/lib/primitives.pyx":478 * * # the initial guess is set to zero * cdef cython.floating u = 0.0 # <<<<<<<<<<<<<< @@ -2879,35 +4505,35 @@ */ __pyx_v_u = 0.0; - /* "yt/utilities/lib/primitives.pyx":249 + /* "yt/utilities/lib/primitives.pyx":479 * # the initial guess is set to zero * cdef cython.floating u = 0.0 * cdef cython.floating v = 0.0 # <<<<<<<<<<<<<< * cdef cython.floating[3] S - * patchSurfaceFunc(verts, u, v, S) + * tet_patchSurfaceFunc(verts, u, v, S) */ __pyx_v_v = 0.0; - /* "yt/utilities/lib/primitives.pyx":251 + /* "yt/utilities/lib/primitives.pyx":481 * cdef cython.floating v = 0.0 * cdef cython.floating[3] S - * patchSurfaceFunc(verts, u, v, S) # <<<<<<<<<<<<<< + * tet_patchSurfaceFunc(verts, u, v, S) # <<<<<<<<<<<<<< * cdef cython.floating fu = dot(N1, S) + d1 * cdef cython.floating fv = dot(N2, S) + d2 */ - __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_S); + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceFunc(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_S); - /* "yt/utilities/lib/primitives.pyx":252 + /* "yt/utilities/lib/primitives.pyx":482 * cdef cython.floating[3] S - * patchSurfaceFunc(verts, u, v, S) + * tet_patchSurfaceFunc(verts, u, v, S) * cdef cython.floating fu = dot(N1, S) + d1 # <<<<<<<<<<<<<< * cdef cython.floating fv = dot(N2, S) + d2 * cdef cython.floating err = fmax(fabs(fu), fabs(fv)) */ __pyx_v_fu = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_S) + __pyx_v_d1); - /* "yt/utilities/lib/primitives.pyx":253 - * patchSurfaceFunc(verts, u, v, S) + /* "yt/utilities/lib/primitives.pyx":483 + * tet_patchSurfaceFunc(verts, u, v, S) * cdef cython.floating fu = dot(N1, S) + d1 * cdef cython.floating fv = dot(N2, S) + d2 # <<<<<<<<<<<<<< * cdef cython.floating err = fmax(fabs(fu), fabs(fv)) @@ -2915,7 +4541,7 @@ */ __pyx_v_fv = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_S) + __pyx_v_d2); - /* "yt/utilities/lib/primitives.pyx":254 + /* "yt/utilities/lib/primitives.pyx":484 * cdef cython.floating fu = dot(N1, S) + d1 * cdef cython.floating fv = dot(N2, S) + d2 * cdef cython.floating err = fmax(fabs(fu), fabs(fv)) # <<<<<<<<<<<<<< @@ -2924,7 +4550,7 @@ */ __pyx_v_err = fmax(fabs(__pyx_v_fu), fabs(__pyx_v_fv)); - /* "yt/utilities/lib/primitives.pyx":257 + /* "yt/utilities/lib/primitives.pyx":487 * * # begin Newton interation * cdef cython.floating tol = 1.0e-5 # <<<<<<<<<<<<<< @@ -2933,7 +4559,7 @@ */ __pyx_v_tol = 1.0e-5; - /* "yt/utilities/lib/primitives.pyx":258 + /* "yt/utilities/lib/primitives.pyx":488 * # begin Newton interation * cdef cython.floating tol = 1.0e-5 * cdef int iterations = 0 # <<<<<<<<<<<<<< @@ -2942,7 +4568,7 @@ */ __pyx_v_iterations = 0; - /* "yt/utilities/lib/primitives.pyx":259 + /* "yt/utilities/lib/primitives.pyx":489 * cdef cython.floating tol = 1.0e-5 * cdef int iterations = 0 * cdef int max_iter = 10 # <<<<<<<<<<<<<< @@ -2951,12 +4577,12 @@ */ __pyx_v_max_iter = 10; - /* "yt/utilities/lib/primitives.pyx":263 + /* "yt/utilities/lib/primitives.pyx":493 * cdef cython.floating[3] Sv * cdef cython.floating J11, J12, J21, J22, det * while ((err > tol) and (iterations < max_iter)): # <<<<<<<<<<<<<< * # compute the Jacobian - * patchSurfaceDerivU(verts, u, v, Su) + * tet_patchSurfaceDerivU(verts, u, v, Su) */ while (1) { __pyx_t_3 = ((__pyx_v_err > __pyx_v_tol) != 0); @@ -2970,35 +4596,35 @@ __pyx_L10_bool_binop_done:; if (!__pyx_t_2) break; - /* "yt/utilities/lib/primitives.pyx":265 + /* "yt/utilities/lib/primitives.pyx":495 * while ((err > tol) and (iterations < max_iter)): * # compute the Jacobian - * patchSurfaceDerivU(verts, u, v, Su) # <<<<<<<<<<<<<< - * patchSurfaceDerivV(verts, u, v, Sv) + * tet_patchSurfaceDerivU(verts, u, v, Su) # <<<<<<<<<<<<<< + * tet_patchSurfaceDerivV(verts, u, v, Sv) * J11 = dot(N1, Su) */ - __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivU(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_Su); + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivU(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_Su); - /* "yt/utilities/lib/primitives.pyx":266 + /* "yt/utilities/lib/primitives.pyx":496 * # compute the Jacobian - * patchSurfaceDerivU(verts, u, v, Su) - * patchSurfaceDerivV(verts, u, v, Sv) # <<<<<<<<<<<<<< + * tet_patchSurfaceDerivU(verts, u, v, Su) + * tet_patchSurfaceDerivV(verts, u, v, Sv) # <<<<<<<<<<<<<< * J11 = dot(N1, Su) * J12 = dot(N1, Sv) */ - __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivV(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_Sv); + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivV(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_Sv); - /* "yt/utilities/lib/primitives.pyx":267 - * patchSurfaceDerivU(verts, u, v, Su) - * patchSurfaceDerivV(verts, u, v, Sv) + /* "yt/utilities/lib/primitives.pyx":497 + * tet_patchSurfaceDerivU(verts, u, v, Su) + * tet_patchSurfaceDerivV(verts, u, v, Sv) * J11 = dot(N1, Su) # <<<<<<<<<<<<<< * J12 = dot(N1, Sv) * J21 = dot(N2, Su) */ __pyx_v_J11 = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_Su); - /* "yt/utilities/lib/primitives.pyx":268 - * patchSurfaceDerivV(verts, u, v, Sv) + /* "yt/utilities/lib/primitives.pyx":498 + * tet_patchSurfaceDerivV(verts, u, v, Sv) * J11 = dot(N1, Su) * J12 = dot(N1, Sv) # <<<<<<<<<<<<<< * J21 = dot(N2, Su) @@ -3006,7 +4632,7 @@ */ __pyx_v_J12 = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_Sv); - /* "yt/utilities/lib/primitives.pyx":269 + /* "yt/utilities/lib/primitives.pyx":499 * J11 = dot(N1, Su) * J12 = dot(N1, Sv) * J21 = dot(N2, Su) # <<<<<<<<<<<<<< @@ -3015,7 +4641,7 @@ */ __pyx_v_J21 = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_Su); - /* "yt/utilities/lib/primitives.pyx":270 + /* "yt/utilities/lib/primitives.pyx":500 * J12 = dot(N1, Sv) * J21 = dot(N2, Su) * J22 = dot(N2, Sv) # <<<<<<<<<<<<<< @@ -3024,7 +4650,7 @@ */ __pyx_v_J22 = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_Sv); - /* "yt/utilities/lib/primitives.pyx":271 + /* "yt/utilities/lib/primitives.pyx":501 * J21 = dot(N2, Su) * J22 = dot(N2, Sv) * det = (J11*J22 - J12*J21) # <<<<<<<<<<<<<< @@ -3033,7 +4659,7 @@ */ __pyx_v_det = ((__pyx_v_J11 * __pyx_v_J22) - (__pyx_v_J12 * __pyx_v_J21)); - /* "yt/utilities/lib/primitives.pyx":274 + /* "yt/utilities/lib/primitives.pyx":504 * * # update the u, v values * u -= ( J22*fu - J12*fv) / det # <<<<<<<<<<<<<< @@ -3042,35 +4668,35 @@ */ __pyx_v_u = (__pyx_v_u - (((__pyx_v_J22 * __pyx_v_fu) - (__pyx_v_J12 * __pyx_v_fv)) / __pyx_v_det)); - /* "yt/utilities/lib/primitives.pyx":275 + /* "yt/utilities/lib/primitives.pyx":505 * # update the u, v values * u -= ( J22*fu - J12*fv) / det * v -= (-J21*fu + J11*fv) / det # <<<<<<<<<<<<<< * - * patchSurfaceFunc(verts, u, v, S) + * tet_patchSurfaceFunc(verts, u, v, S) */ __pyx_v_v = (__pyx_v_v - ((((-__pyx_v_J21) * __pyx_v_fu) + (__pyx_v_J11 * __pyx_v_fv)) / __pyx_v_det)); - /* "yt/utilities/lib/primitives.pyx":277 + /* "yt/utilities/lib/primitives.pyx":507 * v -= (-J21*fu + J11*fv) / det * - * patchSurfaceFunc(verts, u, v, S) # <<<<<<<<<<<<<< + * tet_patchSurfaceFunc(verts, u, v, S) # <<<<<<<<<<<<<< * fu = dot(N1, S) + d1 * fv = dot(N2, S) + d2 */ - __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_S); + __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceFunc(__pyx_v_verts, __pyx_v_u, __pyx_v_v, __pyx_v_S); - /* "yt/utilities/lib/primitives.pyx":278 + /* "yt/utilities/lib/primitives.pyx":508 * - * patchSurfaceFunc(verts, u, v, S) + * tet_patchSurfaceFunc(verts, u, v, S) * fu = dot(N1, S) + d1 # <<<<<<<<<<<<<< * fv = dot(N2, S) + d2 * */ __pyx_v_fu = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N1, __pyx_v_S) + __pyx_v_d1); - /* "yt/utilities/lib/primitives.pyx":279 - * patchSurfaceFunc(verts, u, v, S) + /* "yt/utilities/lib/primitives.pyx":509 + * tet_patchSurfaceFunc(verts, u, v, S) * fu = dot(N1, S) + d1 * fv = dot(N2, S) + d2 # <<<<<<<<<<<<<< * @@ -3078,7 +4704,7 @@ */ __pyx_v_fv = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_N2, __pyx_v_S) + __pyx_v_d2); - /* "yt/utilities/lib/primitives.pyx":281 + /* "yt/utilities/lib/primitives.pyx":511 * fv = dot(N2, S) + d2 * * err = fmax(fabs(fu), fabs(fv)) # <<<<<<<<<<<<<< @@ -3087,7 +4713,7 @@ */ __pyx_v_err = fmax(fabs(__pyx_v_fu), fabs(__pyx_v_fv)); - /* "yt/utilities/lib/primitives.pyx":282 + /* "yt/utilities/lib/primitives.pyx":512 * * err = fmax(fabs(fu), fabs(fv)) * iterations += 1 # <<<<<<<<<<<<<< @@ -3097,7 +4723,7 @@ __pyx_v_iterations = (__pyx_v_iterations + 1); } - /* "yt/utilities/lib/primitives.pyx":285 + /* "yt/utilities/lib/primitives.pyx":515 * * # t is the distance along the ray to this hit * cdef cython.floating t = distance(S, ray_origin) / L2_norm(ray_direction) # <<<<<<<<<<<<<< @@ -3106,7 +4732,7 @@ */ __pyx_v_t = (__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(__pyx_v_S, __pyx_v_ray_origin) / __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(__pyx_v_ray_direction)); - /* "yt/utilities/lib/primitives.pyx":289 + /* "yt/utilities/lib/primitives.pyx":519 * # return hit data * cdef RayHitData hd * hd.u = u # <<<<<<<<<<<<<< @@ -3115,7 +4741,7 @@ */ __pyx_v_hd.u = __pyx_v_u; - /* "yt/utilities/lib/primitives.pyx":290 + /* "yt/utilities/lib/primitives.pyx":520 * cdef RayHitData hd * hd.u = u * hd.v = v # <<<<<<<<<<<<<< @@ -3124,7 +4750,7 @@ */ __pyx_v_hd.v = __pyx_v_v; - /* "yt/utilities/lib/primitives.pyx":291 + /* "yt/utilities/lib/primitives.pyx":521 * hd.u = u * hd.v = v * hd.t = t # <<<<<<<<<<<<<< @@ -3133,7 +4759,7 @@ */ __pyx_v_hd.t = __pyx_v_t; - /* "yt/utilities/lib/primitives.pyx":292 + /* "yt/utilities/lib/primitives.pyx":522 * hd.v = v * hd.t = t * hd.converged = (iterations < max_iter) # <<<<<<<<<<<<<< @@ -3142,7 +4768,7 @@ */ __pyx_v_hd.converged = (__pyx_v_iterations < __pyx_v_max_iter); - /* "yt/utilities/lib/primitives.pyx":293 + /* "yt/utilities/lib/primitives.pyx":523 * hd.t = t * hd.converged = (iterations < max_iter) * return hd # <<<<<<<<<<<<<< @@ -3152,10 +4778,10 @@ __pyx_r = __pyx_v_hd; goto __pyx_L0; - /* "yt/utilities/lib/primitives.pyx":218 + /* "yt/utilities/lib/primitives.pyx":454 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef RayHitData compute_patch_hit(cython.floating[8][3] verts, # <<<<<<<<<<<<<< + * cdef RayHitData compute_tet_patch_hit(cython.floating[6][3] verts, # <<<<<<<<<<<<<< * cython.floating[3] ray_origin, * cython.floating[3] ray_direction) nogil: */ @@ -3165,16 +4791,16 @@ return __pyx_r; } -/* "yt/utilities/lib/primitives.pyx":299 +/* "yt/utilities/lib/primitives.pyx":529 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef np.int64_t ray_patch_intersect(const void* primitives, # <<<<<<<<<<<<<< + * cdef np.int64_t ray_tet_patch_intersect(const void* primitives, # <<<<<<<<<<<<<< * const np.int64_t item, * Ray* ray) nogil: */ -static __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_10primitives_ray_patch_intersect(void const *__pyx_v_primitives, __pyx_t_5numpy_int64_t const __pyx_v_item, struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *__pyx_v_ray) { - struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch __pyx_v_patch; +static __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_10primitives_ray_tet_patch_intersect(void const *__pyx_v_primitives, __pyx_t_5numpy_int64_t const __pyx_v_item, struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *__pyx_v_ray) { + struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch __pyx_v_tet_patch; struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData __pyx_v_hd; __pyx_t_5numpy_int64_t __pyx_r; int __pyx_t_1; @@ -3182,25 +4808,25 @@ __pyx_t_5numpy_float64_t __pyx_t_3; __pyx_t_5numpy_int64_t __pyx_t_4; - /* "yt/utilities/lib/primitives.pyx":311 + /* "yt/utilities/lib/primitives.pyx":533 + * Ray* ray) nogil: * - * ''' - * cdef Patch patch = ( primitives)[item] # <<<<<<<<<<<<<< + * cdef TetPatch tet_patch = ( primitives)[item] # <<<<<<<<<<<<<< * - * cdef RayHitData hd = compute_patch_hit(patch.v, ray.origin, ray.direction) + * cdef RayHitData hd = compute_tet_patch_hit(tet_patch.v, ray.origin, ray.direction) */ - __pyx_v_patch = (((struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch *)__pyx_v_primitives)[__pyx_v_item]); + __pyx_v_tet_patch = (((struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch *)__pyx_v_primitives)[__pyx_v_item]); - /* "yt/utilities/lib/primitives.pyx":313 - * cdef Patch patch = ( primitives)[item] + /* "yt/utilities/lib/primitives.pyx":535 + * cdef TetPatch tet_patch = ( primitives)[item] * - * cdef RayHitData hd = compute_patch_hit(patch.v, ray.origin, ray.direction) # <<<<<<<<<<<<<< + * cdef RayHitData hd = compute_tet_patch_hit(tet_patch.v, ray.origin, ray.direction) # <<<<<<<<<<<<<< * * # only count this is it's the closest hit */ - __pyx_v_hd = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_compute_patch_hit(__pyx_v_patch.v, __pyx_v_ray->origin, __pyx_v_ray->direction); + __pyx_v_hd = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_compute_tet_patch_hit(__pyx_v_tet_patch.v, __pyx_v_ray->origin, __pyx_v_ray->direction); - /* "yt/utilities/lib/primitives.pyx":316 + /* "yt/utilities/lib/primitives.pyx":538 * * # only count this is it's the closest hit * if (hd.t < ray.t_near or hd.t > ray.t_far): # <<<<<<<<<<<<<< @@ -3218,17 +4844,17 @@ __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "yt/utilities/lib/primitives.pyx":317 + /* "yt/utilities/lib/primitives.pyx":539 * # only count this is it's the closest hit * if (hd.t < ray.t_near or hd.t > ray.t_far): * return False # <<<<<<<<<<<<<< * - * if (fabs(hd.u) <= 1.0 and fabs(hd.v) <= 1.0 and hd.converged): + * if (0 <= hd.u and 0 <= hd.v and hd.u + hd.v <= 1.0 and hd.converged): */ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/primitives.pyx":316 + /* "yt/utilities/lib/primitives.pyx":538 * * # only count this is it's the closest hit * if (hd.t < ray.t_near or hd.t > ray.t_far): # <<<<<<<<<<<<<< @@ -3237,20 +4863,26 @@ */ } - /* "yt/utilities/lib/primitives.pyx":319 + /* "yt/utilities/lib/primitives.pyx":541 * return False * - * if (fabs(hd.u) <= 1.0 and fabs(hd.v) <= 1.0 and hd.converged): # <<<<<<<<<<<<<< + * if (0 <= hd.u and 0 <= hd.v and hd.u + hd.v <= 1.0 and hd.converged): # <<<<<<<<<<<<<< * # we have a hit, so update ray information * ray.t_far = hd.t */ - __pyx_t_2 = ((fabs(__pyx_v_hd.u) <= 1.0) != 0); + __pyx_t_2 = ((0.0 <= __pyx_v_hd.u) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L7_bool_binop_done; } - __pyx_t_2 = ((fabs(__pyx_v_hd.v) <= 1.0) != 0); + __pyx_t_2 = ((0.0 <= __pyx_v_hd.v) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_2 = (((__pyx_v_hd.u + __pyx_v_hd.v) <= 1.0) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; @@ -3261,29 +4893,29 @@ __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "yt/utilities/lib/primitives.pyx":321 - * if (fabs(hd.u) <= 1.0 and fabs(hd.v) <= 1.0 and hd.converged): + /* "yt/utilities/lib/primitives.pyx":543 + * if (0 <= hd.u and 0 <= hd.v and hd.u + hd.v <= 1.0 and hd.converged): * # we have a hit, so update ray information * ray.t_far = hd.t # <<<<<<<<<<<<<< - * ray.elem_id = patch.elem_id + * ray.elem_id = tet_patch.elem_id * return True */ __pyx_t_3 = __pyx_v_hd.t; __pyx_v_ray->t_far = __pyx_t_3; - /* "yt/utilities/lib/primitives.pyx":322 + /* "yt/utilities/lib/primitives.pyx":544 * # we have a hit, so update ray information * ray.t_far = hd.t - * ray.elem_id = patch.elem_id # <<<<<<<<<<<<<< + * ray.elem_id = tet_patch.elem_id # <<<<<<<<<<<<<< * return True * */ - __pyx_t_4 = __pyx_v_patch.elem_id; + __pyx_t_4 = __pyx_v_tet_patch.elem_id; __pyx_v_ray->elem_id = __pyx_t_4; - /* "yt/utilities/lib/primitives.pyx":323 + /* "yt/utilities/lib/primitives.pyx":545 * ray.t_far = hd.t - * ray.elem_id = patch.elem_id + * ray.elem_id = tet_patch.elem_id * return True # <<<<<<<<<<<<<< * * return False @@ -3291,16 +4923,16 @@ __pyx_r = 1; goto __pyx_L0; - /* "yt/utilities/lib/primitives.pyx":319 + /* "yt/utilities/lib/primitives.pyx":541 * return False * - * if (fabs(hd.u) <= 1.0 and fabs(hd.v) <= 1.0 and hd.converged): # <<<<<<<<<<<<<< + * if (0 <= hd.u and 0 <= hd.v and hd.u + hd.v <= 1.0 and hd.converged): # <<<<<<<<<<<<<< * # we have a hit, so update ray information * ray.t_far = hd.t */ } - /* "yt/utilities/lib/primitives.pyx":325 + /* "yt/utilities/lib/primitives.pyx":547 * return True * * return False # <<<<<<<<<<<<<< @@ -3310,10 +4942,10 @@ __pyx_r = 0; goto __pyx_L0; - /* "yt/utilities/lib/primitives.pyx":299 + /* "yt/utilities/lib/primitives.pyx":529 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef np.int64_t ray_patch_intersect(const void* primitives, # <<<<<<<<<<<<<< + * cdef np.int64_t ray_tet_patch_intersect(const void* primitives, # <<<<<<<<<<<<<< * const np.int64_t item, * Ray* ray) nogil: */ @@ -3323,33 +4955,33 @@ return __pyx_r; } -/* "yt/utilities/lib/primitives.pyx":331 +/* "yt/utilities/lib/primitives.pyx":553 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patch_centroid(const void *primitives, # <<<<<<<<<<<<<< + * cdef void tet_patch_centroid(const void *primitives, # <<<<<<<<<<<<<< * const np.int64_t item, * np.float64_t[3] centroid) nogil: */ -static void __pyx_f_2yt_9utilities_3lib_10primitives_patch_centroid(void const *__pyx_v_primitives, __pyx_t_5numpy_int64_t const __pyx_v_item, __pyx_t_5numpy_float64_t *__pyx_v_centroid) { +static void __pyx_f_2yt_9utilities_3lib_10primitives_tet_patch_centroid(void const *__pyx_v_primitives, __pyx_t_5numpy_int64_t const __pyx_v_item, __pyx_t_5numpy_float64_t *__pyx_v_centroid) { __pyx_t_5numpy_int64_t __pyx_v_i; __pyx_t_5numpy_int64_t __pyx_v_j; - struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch __pyx_v_patch; + struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch __pyx_v_tet_patch; __pyx_t_5numpy_int64_t __pyx_t_1; __pyx_t_5numpy_int64_t __pyx_t_2; __pyx_t_5numpy_int64_t __pyx_t_3; - /* "yt/utilities/lib/primitives.pyx":343 + /* "yt/utilities/lib/primitives.pyx":558 * * cdef np.int64_t i, j - * cdef Patch patch = ( primitives)[item] # <<<<<<<<<<<<<< + * cdef TetPatch tet_patch = ( primitives)[item] # <<<<<<<<<<<<<< * * for j in range(3): */ - __pyx_v_patch = (((struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch *)__pyx_v_primitives)[__pyx_v_item]); + __pyx_v_tet_patch = (((struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch *)__pyx_v_primitives)[__pyx_v_item]); - /* "yt/utilities/lib/primitives.pyx":345 - * cdef Patch patch = ( primitives)[item] + /* "yt/utilities/lib/primitives.pyx":560 + * cdef TetPatch tet_patch = ( primitives)[item] * * for j in range(3): # <<<<<<<<<<<<<< * centroid[j] = 0.0 @@ -3358,73 +4990,73 @@ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_j = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":346 + /* "yt/utilities/lib/primitives.pyx":561 * * for j in range(3): * centroid[j] = 0.0 # <<<<<<<<<<<<<< * - * for i in range(8): + * for i in range(6): */ (__pyx_v_centroid[__pyx_v_j]) = 0.0; } - /* "yt/utilities/lib/primitives.pyx":348 + /* "yt/utilities/lib/primitives.pyx":563 * centroid[j] = 0.0 * - * for i in range(8): # <<<<<<<<<<<<<< + * for i in range(6): # <<<<<<<<<<<<<< * for j in range(3): - * centroid[j] += patch.v[i][j] + * centroid[j] += tet_patch.v[i][j] */ - for (__pyx_t_1 = 0; __pyx_t_1 < 8; __pyx_t_1+=1) { + for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":349 + /* "yt/utilities/lib/primitives.pyx":564 * - * for i in range(8): + * for i in range(6): * for j in range(3): # <<<<<<<<<<<<<< - * centroid[j] += patch.v[i][j] + * centroid[j] += tet_patch.v[i][j] * */ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_j = __pyx_t_2; - /* "yt/utilities/lib/primitives.pyx":350 - * for i in range(8): + /* "yt/utilities/lib/primitives.pyx":565 + * for i in range(6): * for j in range(3): - * centroid[j] += patch.v[i][j] # <<<<<<<<<<<<<< + * centroid[j] += tet_patch.v[i][j] # <<<<<<<<<<<<<< * * for j in range(3): */ __pyx_t_3 = __pyx_v_j; - (__pyx_v_centroid[__pyx_t_3]) = ((__pyx_v_centroid[__pyx_t_3]) + ((__pyx_v_patch.v[__pyx_v_i])[__pyx_v_j])); + (__pyx_v_centroid[__pyx_t_3]) = ((__pyx_v_centroid[__pyx_t_3]) + ((__pyx_v_tet_patch.v[__pyx_v_i])[__pyx_v_j])); } } - /* "yt/utilities/lib/primitives.pyx":352 - * centroid[j] += patch.v[i][j] + /* "yt/utilities/lib/primitives.pyx":567 + * centroid[j] += tet_patch.v[i][j] * * for j in range(3): # <<<<<<<<<<<<<< - * centroid[j] /= 8.0 + * centroid[j] /= 6.0 * */ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_j = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":353 + /* "yt/utilities/lib/primitives.pyx":568 * * for j in range(3): - * centroid[j] /= 8.0 # <<<<<<<<<<<<<< + * centroid[j] /= 6.0 # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_v_j; - (__pyx_v_centroid[__pyx_t_2]) = ((__pyx_v_centroid[__pyx_t_2]) / 8.0); + (__pyx_v_centroid[__pyx_t_2]) = ((__pyx_v_centroid[__pyx_t_2]) / 6.0); } - /* "yt/utilities/lib/primitives.pyx":331 + /* "yt/utilities/lib/primitives.pyx":553 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patch_centroid(const void *primitives, # <<<<<<<<<<<<<< + * cdef void tet_patch_centroid(const void *primitives, # <<<<<<<<<<<<<< * const np.int64_t item, * np.float64_t[3] centroid) nogil: */ @@ -3432,100 +5064,100 @@ /* function exit code */ } -/* "yt/utilities/lib/primitives.pyx":359 +/* "yt/utilities/lib/primitives.pyx":574 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patch_bbox(const void *primitives, # <<<<<<<<<<<<<< + * cdef void tet_patch_bbox(const void *primitives, # <<<<<<<<<<<<<< * const np.int64_t item, * BBox* bbox) nogil: */ -static void __pyx_f_2yt_9utilities_3lib_10primitives_patch_bbox(void const *__pyx_v_primitives, __pyx_t_5numpy_int64_t const __pyx_v_item, struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox *__pyx_v_bbox) { +static void __pyx_f_2yt_9utilities_3lib_10primitives_tet_patch_bbox(void const *__pyx_v_primitives, __pyx_t_5numpy_int64_t const __pyx_v_item, struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox *__pyx_v_bbox) { __pyx_t_5numpy_int64_t __pyx_v_i; __pyx_t_5numpy_int64_t __pyx_v_j; - struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch __pyx_v_patch; + struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch __pyx_v_tet_patch; __pyx_t_5numpy_int64_t __pyx_t_1; __pyx_t_5numpy_int64_t __pyx_t_2; - /* "yt/utilities/lib/primitives.pyx":372 + /* "yt/utilities/lib/primitives.pyx":579 * * cdef np.int64_t i, j - * cdef Patch patch = ( primitives)[item] # <<<<<<<<<<<<<< + * cdef TetPatch tet_patch = ( primitives)[item] # <<<<<<<<<<<<<< * * for j in range(3): */ - __pyx_v_patch = (((struct __pyx_t_2yt_9utilities_3lib_10primitives_Patch *)__pyx_v_primitives)[__pyx_v_item]); + __pyx_v_tet_patch = (((struct __pyx_t_2yt_9utilities_3lib_10primitives_TetPatch *)__pyx_v_primitives)[__pyx_v_item]); - /* "yt/utilities/lib/primitives.pyx":374 - * cdef Patch patch = ( primitives)[item] + /* "yt/utilities/lib/primitives.pyx":581 + * cdef TetPatch tet_patch = ( primitives)[item] * * for j in range(3): # <<<<<<<<<<<<<< - * bbox.left_edge[j] = patch.v[0][j] - * bbox.right_edge[j] = patch.v[0][j] + * bbox.left_edge[j] = tet_patch.v[0][j] + * bbox.right_edge[j] = tet_patch.v[0][j] */ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { __pyx_v_j = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":375 + /* "yt/utilities/lib/primitives.pyx":582 * * for j in range(3): - * bbox.left_edge[j] = patch.v[0][j] # <<<<<<<<<<<<<< - * bbox.right_edge[j] = patch.v[0][j] + * bbox.left_edge[j] = tet_patch.v[0][j] # <<<<<<<<<<<<<< + * bbox.right_edge[j] = tet_patch.v[0][j] * */ - (__pyx_v_bbox->left_edge[__pyx_v_j]) = ((__pyx_v_patch.v[0])[__pyx_v_j]); + (__pyx_v_bbox->left_edge[__pyx_v_j]) = ((__pyx_v_tet_patch.v[0])[__pyx_v_j]); - /* "yt/utilities/lib/primitives.pyx":376 + /* "yt/utilities/lib/primitives.pyx":583 * for j in range(3): - * bbox.left_edge[j] = patch.v[0][j] - * bbox.right_edge[j] = patch.v[0][j] # <<<<<<<<<<<<<< + * bbox.left_edge[j] = tet_patch.v[0][j] + * bbox.right_edge[j] = tet_patch.v[0][j] # <<<<<<<<<<<<<< * - * for i in range(1, 8): + * for i in range(1, 6): */ - (__pyx_v_bbox->right_edge[__pyx_v_j]) = ((__pyx_v_patch.v[0])[__pyx_v_j]); + (__pyx_v_bbox->right_edge[__pyx_v_j]) = ((__pyx_v_tet_patch.v[0])[__pyx_v_j]); } - /* "yt/utilities/lib/primitives.pyx":378 - * bbox.right_edge[j] = patch.v[0][j] + /* "yt/utilities/lib/primitives.pyx":585 + * bbox.right_edge[j] = tet_patch.v[0][j] * - * for i in range(1, 8): # <<<<<<<<<<<<<< + * for i in range(1, 6): # <<<<<<<<<<<<<< * for j in range(3): - * bbox.left_edge[j] = fmin(bbox.left_edge[j], patch.v[i][j]) + * bbox.left_edge[j] = fmin(bbox.left_edge[j], tet_patch.v[i][j]) */ - for (__pyx_t_1 = 1; __pyx_t_1 < 8; __pyx_t_1+=1) { + for (__pyx_t_1 = 1; __pyx_t_1 < 6; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "yt/utilities/lib/primitives.pyx":379 + /* "yt/utilities/lib/primitives.pyx":586 * - * for i in range(1, 8): + * for i in range(1, 6): * for j in range(3): # <<<<<<<<<<<<<< - * bbox.left_edge[j] = fmin(bbox.left_edge[j], patch.v[i][j]) - * bbox.right_edge[j] = fmax(bbox.right_edge[j], patch.v[i][j]) + * bbox.left_edge[j] = fmin(bbox.left_edge[j], tet_patch.v[i][j]) + * bbox.right_edge[j] = fmax(bbox.right_edge[j], tet_patch.v[i][j]) */ for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { __pyx_v_j = __pyx_t_2; - /* "yt/utilities/lib/primitives.pyx":380 - * for i in range(1, 8): + /* "yt/utilities/lib/primitives.pyx":587 + * for i in range(1, 6): * for j in range(3): - * bbox.left_edge[j] = fmin(bbox.left_edge[j], patch.v[i][j]) # <<<<<<<<<<<<<< - * bbox.right_edge[j] = fmax(bbox.right_edge[j], patch.v[i][j]) + * bbox.left_edge[j] = fmin(bbox.left_edge[j], tet_patch.v[i][j]) # <<<<<<<<<<<<<< + * bbox.right_edge[j] = fmax(bbox.right_edge[j], tet_patch.v[i][j]) */ - (__pyx_v_bbox->left_edge[__pyx_v_j]) = fmin((__pyx_v_bbox->left_edge[__pyx_v_j]), ((__pyx_v_patch.v[__pyx_v_i])[__pyx_v_j])); + (__pyx_v_bbox->left_edge[__pyx_v_j]) = fmin((__pyx_v_bbox->left_edge[__pyx_v_j]), ((__pyx_v_tet_patch.v[__pyx_v_i])[__pyx_v_j])); - /* "yt/utilities/lib/primitives.pyx":381 + /* "yt/utilities/lib/primitives.pyx":588 * for j in range(3): - * bbox.left_edge[j] = fmin(bbox.left_edge[j], patch.v[i][j]) - * bbox.right_edge[j] = fmax(bbox.right_edge[j], patch.v[i][j]) # <<<<<<<<<<<<<< + * bbox.left_edge[j] = fmin(bbox.left_edge[j], tet_patch.v[i][j]) + * bbox.right_edge[j] = fmax(bbox.right_edge[j], tet_patch.v[i][j]) # <<<<<<<<<<<<<< */ - (__pyx_v_bbox->right_edge[__pyx_v_j]) = fmax((__pyx_v_bbox->right_edge[__pyx_v_j]), ((__pyx_v_patch.v[__pyx_v_i])[__pyx_v_j])); + (__pyx_v_bbox->right_edge[__pyx_v_j]) = fmax((__pyx_v_bbox->right_edge[__pyx_v_j]), ((__pyx_v_tet_patch.v[__pyx_v_i])[__pyx_v_j])); } } - /* "yt/utilities/lib/primitives.pyx":359 + /* "yt/utilities/lib/primitives.pyx":574 * @cython.wraparound(False) * @cython.cdivision(True) - * cdef void patch_bbox(const void *primitives, # <<<<<<<<<<<<<< + * cdef void tet_patch_bbox(const void *primitives, # <<<<<<<<<<<<<< * const np.int64_t item, * BBox* bbox) nogil: */ @@ -5714,7 +7346,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5762,7 +7394,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -5845,7 +7477,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5893,7 +7525,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -5976,7 +7608,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -6021,7 +7653,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -6496,7 +8128,7 @@ PyModuleDef_HEAD_INIT, #endif "primitives", - 0, /* m_doc */ + __pyx_k_This_file_contains_definitions, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ @@ -6513,6 +8145,7 @@ {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, @@ -6528,7 +8161,7 @@ {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, 34, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) @@ -6701,7 +8334,7 @@ #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("primitives", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + __pyx_m = Py_InitModule4("primitives", __pyx_methods, __pyx_k_This_file_contains_definitions, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -6709,6 +8342,7 @@ __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 @@ -6743,6 +8377,9 @@ if (__Pyx_ExportFunction("ray_patch_intersect", (void (*)(void))__pyx_f_2yt_9utilities_3lib_10primitives_ray_patch_intersect, "__pyx_t_5numpy_int64_t (void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("patch_centroid", (void (*)(void))__pyx_f_2yt_9utilities_3lib_10primitives_patch_centroid, "void (void const *, __pyx_t_5numpy_int64_t const , __pyx_t_5numpy_float64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("patch_bbox", (void (*)(void))__pyx_f_2yt_9utilities_3lib_10primitives_patch_bbox, "void (void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("ray_tet_patch_intersect", (void (*)(void))__pyx_f_2yt_9utilities_3lib_10primitives_ray_tet_patch_intersect, "__pyx_t_5numpy_int64_t (void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_Ray *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("tet_patch_centroid", (void (*)(void))__pyx_f_2yt_9utilities_3lib_10primitives_tet_patch_centroid, "void (void const *, __pyx_t_5numpy_int64_t const , __pyx_t_5numpy_float64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("tet_patch_bbox", (void (*)(void))__pyx_f_2yt_9utilities_3lib_10primitives_tet_patch_bbox, "void (void const *, __pyx_t_5numpy_int64_t const , struct __pyx_t_2yt_9utilities_3lib_10primitives_BBox *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("__pyx_fuse_0patchSurfaceFunc", (void (*)(void))__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc, "void (float (*)[3], float const , float const , float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("__pyx_fuse_1patchSurfaceFunc", (void (*)(void))__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceFunc, "void (double (*)[3], double const , double const , double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("__pyx_fuse_0patchSurfaceDerivU", (void (*)(void))__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivU, "void (float (*)[3], float const , float const , float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -6751,6 +8388,14 @@ if (__Pyx_ExportFunction("__pyx_fuse_1patchSurfaceDerivV", (void (*)(void))__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_patchSurfaceDerivV, "void (double (*)[3], double const , double const , double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("__pyx_fuse_0compute_patch_hit", (void (*)(void))__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_compute_patch_hit, "struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData (float (*)[3], float *, float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("__pyx_fuse_1compute_patch_hit", (void (*)(void))__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_compute_patch_hit, "struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData (double (*)[3], double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("__pyx_fuse_0tet_patchSurfaceFunc", (void (*)(void))__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceFunc, "void (float (*)[3], float const , float const , float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("__pyx_fuse_1tet_patchSurfaceFunc", (void (*)(void))__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceFunc, "void (double (*)[3], double const , double const , double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("__pyx_fuse_0tet_patchSurfaceDerivU", (void (*)(void))__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivU, "void (float (*)[3], float const , float const , float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("__pyx_fuse_1tet_patchSurfaceDerivU", (void (*)(void))__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivU, "void (double (*)[3], double const , double const , double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("__pyx_fuse_0tet_patchSurfaceDerivV", (void (*)(void))__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivV, "void (float (*)[3], float const , float const , float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("__pyx_fuse_1tet_patchSurfaceDerivV", (void (*)(void))__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_tet_patchSurfaceDerivV, "void (double (*)[3], double const , double const , double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("__pyx_fuse_0compute_tet_patch_hit", (void (*)(void))__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_10primitives_compute_tet_patch_hit, "struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData (float (*)[3], float *, float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("__pyx_fuse_1compute_tet_patch_hit", (void (*)(void))__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_10primitives_compute_tet_patch_hit, "struct __pyx_t_2yt_9utilities_3lib_10primitives_RayHitData (double (*)[3], double *, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -6772,18 +8417,19 @@ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - /* "yt/utilities/lib/primitives.pyx":2 + /* "yt/utilities/lib/primitives.pyx":15 + * * cimport cython * import numpy as np # <<<<<<<<<<<<<< * cimport numpy as np * cimport cython.floating */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "yt/utilities/lib/primitives.pyx":9 + /* "yt/utilities/lib/primitives.pyx":22 * from yt.utilities.lib.vec3_ops cimport dot, subtract, cross, distance, L2_norm * * cdef np.float64_t DETERMINANT_EPS = 1.0e-10 # <<<<<<<<<<<<<< @@ -6792,26 +8438,26 @@ */ __pyx_v_2yt_9utilities_3lib_10primitives_DETERMINANT_EPS = 1.0e-10; - /* "yt/utilities/lib/primitives.pyx":10 + /* "yt/utilities/lib/primitives.pyx":23 * * cdef np.float64_t DETERMINANT_EPS = 1.0e-10 * cdef np.float64_t INF = np.inf # <<<<<<<<<<<<<< * * cdef extern from "platform_dep.h" nogil: */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_2yt_9utilities_3lib_10primitives_INF = __pyx_t_3; /* "yt/utilities/lib/primitives.pyx":1 - * cimport cython # <<<<<<<<<<<<<< - * import numpy as np - * cimport numpy as np + * """ # <<<<<<<<<<<<<< + * + * This file contains definitions of the various primitives that can be used */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -6833,7 +8479,7 @@ __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.primitives", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.primitives", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -7305,6 +8951,40 @@ return result; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; @@ -7445,12 +9125,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -8651,6 +10334,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -8659,11 +10344,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/primitives.pxd yt-3.4.0/yt/utilities/lib/primitives.pxd --- yt-3.3.3/yt/utilities/lib/primitives.pxd 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/primitives.pxd 2017-08-10 18:02:57.000000000 +0000 @@ -1,4 +1,4 @@ -cimport cython +cimport cython cimport cython.floating import numpy as np cimport numpy as np @@ -66,7 +66,7 @@ cdef RayHitData compute_patch_hit(cython.floating[8][3] verts, cython.floating[3] ray_origin, cython.floating[3] ray_direction) nogil - + cdef np.int64_t ray_patch_intersect(const void* primitives, const np.int64_t item, Ray* ray) nogil @@ -78,3 +78,38 @@ cdef void patch_bbox(const void *primitives, const np.int64_t item, BBox* bbox) nogil + +cdef struct TetPatch: + np.float64_t[6][3] v # 6 vertices per patch + np.int64_t elem_id + +cdef RayHitData compute_tet_patch_hit(cython.floating[6][3] verts, + cython.floating[3] ray_origin, + cython.floating[3] ray_direction) nogil + +cdef void tet_patchSurfaceFunc(const cython.floating[6][3] verts, + const cython.floating u, + const cython.floating v, + cython.floating[3] S) nogil + +cdef void tet_patchSurfaceDerivU(const cython.floating[6][3] verts, + const cython.floating u, + const cython.floating v, + cython.floating[3] Su) nogil + +cdef void tet_patchSurfaceDerivV(const cython.floating[6][3] verts, + const cython.floating u, + const cython.floating v, + cython.floating[3] Sv) nogil + +cdef np.int64_t ray_tet_patch_intersect(const void* primitives, + const np.int64_t item, + Ray* ray) nogil + +cdef void tet_patch_centroid(const void *primitives, + const np.int64_t item, + np.float64_t[3] centroid) nogil + +cdef void tet_patch_bbox(const void *primitives, + const np.int64_t item, + BBox* bbox) nogil diff -Nru yt-3.3.3/yt/utilities/lib/primitives.pyx yt-3.4.0/yt/utilities/lib/primitives.pyx --- yt-3.3.3/yt/utilities/lib/primitives.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/primitives.pyx 2017-08-10 18:02:57.000000000 +0000 @@ -1,3 +1,16 @@ +""" + +This file contains definitions of the various primitives that can be used +by the Cython ray-tracer for unstructured mesh rendering. To define a new +primitive type, you need to define a struct that represents it. You also +need to provide three functions: + +1. A function that computes the intersection between a given ray and a given primitive. +2. A function that computes the centroid of the primitive type. +3. A function that computes the axis-aligned bounding box of a given primitive. + +""" + cimport cython import numpy as np cimport numpy as np @@ -28,15 +41,15 @@ cdef np.float64_t tmin = -INF cdef np.float64_t tmax = INF - + cdef np.int64_t i cdef np.float64_t t1, t2 for i in range(3): t1 = (bbox.left_edge[i] - ray.origin[i])*ray.inv_dir[i] - t2 = (bbox.right_edge[i] - ray.origin[i])*ray.inv_dir[i] + t2 = (bbox.right_edge[i] - ray.origin[i])*ray.inv_dir[i] tmin = fmax(tmin, fmin(t1, t2)) tmax = fmin(tmax, fmax(t1, t2)) - + return tmax >= fmax(tmin, 0.0) @cython.boundscheck(False) @@ -70,7 +83,7 @@ cdef np.float64_t det, inv_det det = dot(e1, P) - if(det > -DETERMINANT_EPS and det < DETERMINANT_EPS): + if(det > -DETERMINANT_EPS and det < DETERMINANT_EPS): return False inv_det = 1.0 / det @@ -111,7 +124,7 @@ will be stored in the numpy array passed in as "centroid". ''' - + cdef Triangle tri = ( primitives)[item] cdef np.int64_t i for i in range(3): @@ -143,7 +156,7 @@ @cython.wraparound(False) @cython.cdivision(True) cdef void patchSurfaceFunc(const cython.floating[8][3] verts, - const cython.floating u, + const cython.floating u, const cython.floating v, cython.floating[3] S) nogil: ''' @@ -172,7 +185,7 @@ @cython.wraparound(False) @cython.cdivision(True) cdef void patchSurfaceDerivU(const cython.floating[8][3] verts, - const cython.floating u, + const cython.floating u, const cython.floating v, cython.floating[3] Su) nogil: ''' @@ -194,7 +207,7 @@ @cython.wraparound(False) @cython.cdivision(True) cdef void patchSurfaceDerivV(const cython.floating[8][3] verts, - const cython.floating u, + const cython.floating u, const cython.floating v, cython.floating[3] Sv) nogil: ''' @@ -202,7 +215,8 @@ This function computes the derivative of the S(u, v) function w.r.t v. ''' - cdef int i + + cdef int i for i in range(3): Sv[i] = (-0.25*(u - 1.0)*(u + v + 1) - 0.25*(u - 1.0)*(v - 1.0))*verts[0][i] + \ (-0.25*(u + 1.0)*(u - v - 1) + 0.25*(u + 1.0)*(v - 1.0))*verts[1][i] + \ @@ -252,7 +266,7 @@ cdef cython.floating fu = dot(N1, S) + d1 cdef cython.floating fv = dot(N2, S) + d2 cdef cython.floating err = fmax(fabs(fu), fabs(fv)) - + # begin Newton interation cdef cython.floating tol = 1.0e-5 cdef int iterations = 0 @@ -269,11 +283,11 @@ J21 = dot(N2, Su) J22 = dot(N2, Sv) det = (J11*J22 - J12*J21) - + # update the u, v values u -= ( J22*fu - J12*fv) / det v -= (-J21*fu + J11*fv) / det - + patchSurfaceFunc(verts, u, v, S) fu = dot(N1, S) + d1 fv = dot(N2, S) + d2 @@ -283,7 +297,7 @@ # t is the distance along the ray to this hit cdef cython.floating t = distance(S, ray_origin) / L2_norm(ray_direction) - + # return hit data cdef RayHitData hd hd.u = u @@ -300,18 +314,18 @@ const np.int64_t item, Ray* ray) nogil: ''' - + This returns an integer flag that indicates whether the given patch is the closest hit for the ray so far. If it is, the ray is updated to store the current primitive index and the distance to the first hit. The patch used is the one indexed by "item" in the array of primitives. - - + + ''' cdef Patch patch = ( primitives)[item] cdef RayHitData hd = compute_patch_hit(patch.v, ray.origin, ray.direction) - + # only count this is it's the closest hit if (hd.t < ray.t_near or hd.t > ray.t_far): return False @@ -323,7 +337,7 @@ return True return False - + @cython.boundscheck(False) @cython.wraparound(False) @@ -332,13 +346,13 @@ const np.int64_t item, np.float64_t[3] centroid) nogil: ''' - + This computes the centroid of the input patch. The patch used is the one indexed by "item" in the array of primitives. The result will be stored in the numpy array passed in as "centroid". - + ''' - + cdef np.int64_t i, j cdef Patch patch = ( primitives)[item] @@ -361,16 +375,16 @@ BBox* bbox) nogil: ''' - + This computes the bounding box of the input patch. The patch used is the one indexed by "item" in the array of primitives. The result will be stored in the input BBox. - + ''' cdef np.int64_t i, j cdef Patch patch = ( primitives)[item] - + for j in range(3): bbox.left_edge[j] = patch.v[0][j] bbox.right_edge[j] = patch.v[0][j] @@ -379,3 +393,196 @@ for j in range(3): bbox.left_edge[j] = fmin(bbox.left_edge[j], patch.v[i][j]) bbox.right_edge[j] = fmax(bbox.right_edge[j], patch.v[i][j]) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void tet_patchSurfaceFunc(const cython.floating[6][3] verts, + const cython.floating u, + const cython.floating v, + cython.floating[3] S) nogil: + + cdef int i + # Computes for canonical triangle coordinates + for i in range(3): + S[i] = (1.0 - 3.0*u + 2.0*u*u - 3.0*v + 2.0*v*v + 4.0*u*v)*verts[0][i] + \ + (-u + 2.0*u*u)*verts[1][i] + \ + (-v + 2.0*v*v)*verts[2][i] + \ + (4.0*u - 4.0*u*u - 4.0*u*v)*verts[3][i] + \ + (4.0*u*v)*verts[4][i] + \ + (4.0*v - 4.0*v*v - 4.0*u*v)*verts[5][i] + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void tet_patchSurfaceDerivU(const cython.floating[6][3] verts, + const cython.floating u, + const cython.floating v, + cython.floating[3] Su) nogil: + cdef int i + # Computes for canonical triangle coordinates + for i in range(3): + Su[i] = (-3.0 + 4.0*u + 4.0*v)*verts[0][i] + \ + (-1.0 + 4.0*u)*verts[1][i] + \ + (4.0 - 8.0*u - 4.0*v)*verts[3][i] + \ + (4.0*v)*verts[4][i] + \ + (-4.0*v)*verts[5][i] + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void tet_patchSurfaceDerivV(const cython.floating[6][3] verts, + const cython.floating u, + const cython.floating v, + cython.floating[3] Sv) nogil: + + cdef int i + # Computes for canonical triangle coordinates + for i in range(3): + Sv[i] = (-3.0 + 4.0*v + 4.0*u)*verts[0][i] + \ + (-1.0 + 4.0*v)*verts[2][i] + \ + (-4.0*u)*verts[3][i] + \ + (4.0*u)*verts[4][i] + \ + (4.0 - 8.0*v - 4.0*u)*verts[5][i] + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef RayHitData compute_tet_patch_hit(cython.floating[6][3] verts, + cython.floating[3] ray_origin, + cython.floating[3] ray_direction) nogil: + + # first we compute the two planes that define the ray. + cdef cython.floating[3] n, N1, N2 + cdef cython.floating A = dot(ray_direction, ray_direction) + for i in range(3): + n[i] = ray_direction[i] / A + + if ((fabs(n[0]) > fabs(n[1])) and (fabs(n[0]) > fabs(n[2]))): + N1[0] = n[1] + N1[1] =-n[0] + N1[2] = 0.0 + else: + N1[0] = 0.0 + N1[1] = n[2] + N1[2] =-n[1] + cross(N1, n, N2) + + cdef cython.floating d1 = -dot(N1, ray_origin) + cdef cython.floating d2 = -dot(N2, ray_origin) + + # the initial guess is set to zero + cdef cython.floating u = 0.0 + cdef cython.floating v = 0.0 + cdef cython.floating[3] S + tet_patchSurfaceFunc(verts, u, v, S) + cdef cython.floating fu = dot(N1, S) + d1 + cdef cython.floating fv = dot(N2, S) + d2 + cdef cython.floating err = fmax(fabs(fu), fabs(fv)) + + # begin Newton interation + cdef cython.floating tol = 1.0e-5 + cdef int iterations = 0 + cdef int max_iter = 10 + cdef cython.floating[3] Su + cdef cython.floating[3] Sv + cdef cython.floating J11, J12, J21, J22, det + while ((err > tol) and (iterations < max_iter)): + # compute the Jacobian + tet_patchSurfaceDerivU(verts, u, v, Su) + tet_patchSurfaceDerivV(verts, u, v, Sv) + J11 = dot(N1, Su) + J12 = dot(N1, Sv) + J21 = dot(N2, Su) + J22 = dot(N2, Sv) + det = (J11*J22 - J12*J21) + + # update the u, v values + u -= ( J22*fu - J12*fv) / det + v -= (-J21*fu + J11*fv) / det + + tet_patchSurfaceFunc(verts, u, v, S) + fu = dot(N1, S) + d1 + fv = dot(N2, S) + d2 + + err = fmax(fabs(fu), fabs(fv)) + iterations += 1 + + # t is the distance along the ray to this hit + cdef cython.floating t = distance(S, ray_origin) / L2_norm(ray_direction) + + # return hit data + cdef RayHitData hd + hd.u = u + hd.v = v + hd.t = t + hd.converged = (iterations < max_iter) + return hd + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef np.int64_t ray_tet_patch_intersect(const void* primitives, + const np.int64_t item, + Ray* ray) nogil: + + cdef TetPatch tet_patch = ( primitives)[item] + + cdef RayHitData hd = compute_tet_patch_hit(tet_patch.v, ray.origin, ray.direction) + + # only count this is it's the closest hit + if (hd.t < ray.t_near or hd.t > ray.t_far): + return False + + if (0 <= hd.u and 0 <= hd.v and hd.u + hd.v <= 1.0 and hd.converged): + # we have a hit, so update ray information + ray.t_far = hd.t + ray.elem_id = tet_patch.elem_id + return True + + return False + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void tet_patch_centroid(const void *primitives, + const np.int64_t item, + np.float64_t[3] centroid) nogil: + + cdef np.int64_t i, j + cdef TetPatch tet_patch = ( primitives)[item] + + for j in range(3): + centroid[j] = 0.0 + + for i in range(6): + for j in range(3): + centroid[j] += tet_patch.v[i][j] + + for j in range(3): + centroid[j] /= 6.0 + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) +cdef void tet_patch_bbox(const void *primitives, + const np.int64_t item, + BBox* bbox) nogil: + + cdef np.int64_t i, j + cdef TetPatch tet_patch = ( primitives)[item] + + for j in range(3): + bbox.left_edge[j] = tet_patch.v[0][j] + bbox.right_edge[j] = tet_patch.v[0][j] + + for i in range(1, 6): + for j in range(3): + bbox.left_edge[j] = fmin(bbox.left_edge[j], tet_patch.v[i][j]) + bbox.right_edge[j] = fmax(bbox.right_edge[j], tet_patch.v[i][j]) diff -Nru yt-3.3.3/yt/utilities/lib/quad_tree.c yt-3.4.0/yt/utilities/lib/quad_tree.c --- yt-3.3.3/yt/utilities/lib/quad_tree.c 2016-12-12 01:42:02.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/quad_tree.c 2017-08-10 18:20:57.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { @@ -6,8 +6,15 @@ "depends": [ "yt/utilities/lib/platform_dep.h" ], + "include_dirs": [ + "yt/utilities/lib" + ], "libraries": [ "m" + ], + "name": "yt.utilities.lib.quad_tree", + "sources": [ + "yt/utilities/lib/quad_tree.pyx" ] }, "module_name": "yt.utilities.lib.quad_tree" @@ -21,7 +28,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -43,6 +50,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -195,16 +203,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -331,6 +343,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -385,6 +403,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -493,8 +540,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -507,8 +554,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -630,10 +680,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -667,6 +719,7 @@ static const char *__pyx_f[] = { "yt/utilities/lib/quad_tree.pyx", + "stringsource", "__init__.pxd", "type.pxd", }; @@ -1151,7 +1204,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* IncludeStringH.proto */ #include @@ -1330,12 +1383,18 @@ /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* 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 */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1589,6 +1648,7 @@ /* Implementation of 'yt.utilities.lib.quad_tree' */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_ImportError; @@ -1622,6 +1682,7 @@ static const char __pyx_k_refined[] = "refined"; static const char __pyx_k_bounds_2[] = "_bounds"; static const char __pyx_k_weighted[] = "weighted"; +static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_integrate[] = "integrate"; static const char __pyx_k_val_index[] = "val_index"; static const char __pyx_k_ValueError[] = "ValueError"; @@ -1630,20 +1691,24 @@ static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_pweight_vals[] = "pweight_vals"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_top_grid_dims[] = "top_grid_dims"; static const char __pyx_k_merge_quadtrees[] = "merge_quadtrees"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_YTIntDomainOverflow[] = "YTIntDomainOverflow"; static const char __pyx_k_yt_utilities_exceptions[] = "yt.utilities.exceptions"; static const char __pyx_k_yt_utilities_lib_quad_tree[] = "yt.utilities.lib.quad_tree"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/quad_tree.pyx"; +static const char __pyx_k_yt_utilities_lib_quad_tree_pyx[] = "yt/utilities/lib/quad_tree.pyx"; static const char __pyx_k_A_refine_by_two_AMR_specific_qu[] = "\nA refine-by-two AMR-specific quadtree\n\n\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"; static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; @@ -1652,12 +1717,13 @@ static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_NotImplementedError; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; +static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_YTIntDomainOverflow; static PyObject *__pyx_n_s_bounds; static PyObject *__pyx_n_s_bounds_2; static PyObject *__pyx_n_s_buffer; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_count_only; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_float64; @@ -1674,6 +1740,7 @@ static PyObject *__pyx_n_s_mip; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +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; @@ -1687,7 +1754,9 @@ static PyObject *__pyx_n_s_qt1; static PyObject *__pyx_n_s_qt2; static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_refined; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_skip; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_top_grid_dims; @@ -1698,6 +1767,7 @@ static PyObject *__pyx_n_s_wval; static PyObject *__pyx_n_s_yt_utilities_exceptions; static PyObject *__pyx_n_s_yt_utilities_lib_quad_tree; +static PyObject *__pyx_kp_s_yt_utilities_lib_quad_tree_pyx; static PyObject *__pyx_n_s_zeros; static int __pyx_pf_2yt_9utilities_3lib_9quad_tree_8QuadTree___cinit__(struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *__pyx_v_self, PyArrayObject *__pyx_v_top_grid_dims, int __pyx_v_nvals, PyObject *__pyx_v_bounds, PyObject *__pyx_v_method); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_9quad_tree_8QuadTree_2frombuffer(struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *__pyx_v_self, PyArrayObject *__pyx_v_refined, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_wval, PyObject *__pyx_v_method); /* proto */ @@ -1709,6 +1779,8 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_9quad_tree_8QuadTree_14get_all(struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *__pyx_v_self, int __pyx_v_count_only, int __pyx_v_method); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_9quad_tree_8QuadTree_16fill_image(struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *__pyx_v_self, PyArrayObject *__pyx_v_buffer, PyObject *__pyx_v__bounds, int __pyx_v_val_index, int __pyx_v_weighted); /* proto */ static void __pyx_pf_2yt_9utilities_3lib_9quad_tree_8QuadTree_18__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_9quad_tree_8QuadTree_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2yt_9utilities_3lib_9quad_tree_8QuadTree_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_9quad_tree_merge_quadtrees(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *__pyx_v_qt1, struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *__pyx_v_qt2, PyObject *__pyx_v_method); /* 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 */ @@ -1725,7 +1797,9 @@ static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; -static PyObject *__pyx_codeobj__11; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_codeobj__13; /* "yt/utilities/lib/quad_tree.pyx":41 * int nvals) @@ -2221,9 +2295,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -2232,16 +2310,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_top_grid_dims)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nvals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 4, 1); __PYX_ERR(0, 110, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 4, 2); __PYX_ERR(0, 110, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_method); @@ -2254,6 +2335,7 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); @@ -2992,7 +3074,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_wval.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.utilities.lib.quad_tree.QuadTree.fill_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.quad_tree.QuadTree.fill_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; goto __pyx_L2; __pyx_L0:; @@ -3212,7 +3294,7 @@ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_wval.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_WriteUnraisable("yt.utilities.lib.quad_tree.QuadTree.unfill_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.quad_tree.QuadTree.unfill_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; goto __pyx_L2; __pyx_L0:; @@ -3250,9 +3332,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -3261,16 +3347,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_refined)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("frombuffer", 1, 4, 4, 1); __PYX_ERR(0, 204, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wval)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("frombuffer", 1, 4, 4, 2); __PYX_ERR(0, 204, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--; else { @@ -4329,11 +4418,17 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; 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; } @@ -4342,26 +4437,31 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pxs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_array_to_tree", 0, 5, 6, 1); __PYX_ERR(0, 282, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pys)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_array_to_tree", 0, 5, 6, 2); __PYX_ERR(0, 282, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pvals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_array_to_tree", 0, 5, 6, 3); __PYX_ERR(0, 282, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pweight_vals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_array_to_tree", 0, 5, 6, 4); __PYX_ERR(0, 282, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip); @@ -4374,6 +4474,7 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -4609,10 +4710,15 @@ 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; } @@ -4621,21 +4727,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pxs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pys)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_chunk_to_tree", 1, 5, 5, 1); __PYX_ERR(0, 300, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_chunk_to_tree", 1, 5, 5, 2); __PYX_ERR(0, 300, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pvals)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_chunk_to_tree", 1, 5, 5, 3); __PYX_ERR(0, 300, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pweight_vals)) != 0)) kw_args--; else { @@ -5032,8 +5142,11 @@ 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; } @@ -5042,11 +5155,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pxs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pys)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("initialize_chunk", 1, 3, 3, 1); __PYX_ERR(0, 324, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else { @@ -5392,7 +5507,9 @@ 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; } @@ -5403,6 +5520,7 @@ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_count_only); if (value) { values[0] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_method); @@ -5415,7 +5533,9 @@ } 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); + CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } @@ -6698,9 +6818,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -6709,16 +6833,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bounds_2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fill_image", 0, 2, 4, 1); __PYX_ERR(0, 451, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val_index); if (value) { values[2] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weighted); @@ -6731,7 +6858,9 @@ } else { switch (PyTuple_GET_SIZE(__pyx_args)) { 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); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; @@ -7551,6 +7680,113 @@ __Pyx_RefNannyFinishContext(); } +/* "(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_2yt_9utilities_3lib_9quad_tree_8QuadTree_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_9quad_tree_8QuadTree_21__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_2yt_9utilities_3lib_9quad_tree_8QuadTree_20__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_9quad_tree_8QuadTree_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *__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_, 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("yt.utilities.lib.quad_tree.QuadTree.__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_2yt_9utilities_3lib_9quad_tree_8QuadTree_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_2yt_9utilities_3lib_9quad_tree_8QuadTree_23__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_2yt_9utilities_3lib_9quad_tree_8QuadTree_22__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_2yt_9utilities_3lib_9quad_tree_8QuadTree_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_9quad_tree_QuadTree *__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__2, 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("yt.utilities.lib.quad_tree.QuadTree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "yt/utilities/lib/quad_tree.pyx":536 * free(self.root_nodes) * @@ -7765,7 +8001,7 @@ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("yt.utilities.lib.quad_tree.QTN_merge_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __Pyx_WriteUnraisable("yt.utilities.lib.quad_tree.QTN_merge_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } @@ -7797,8 +8033,11 @@ 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; } @@ -7807,11 +8046,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qt1)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qt2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("merge_quadtrees", 0, 2, 3, 1); __PYX_ERR(0, 563, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_method); @@ -7824,6 +8065,7 @@ } 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; @@ -8079,3008 +8321,3008 @@ return __pyx_r; } -/* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython - * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) { +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; int __pyx_r; + __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } - /* "yt/utilities/lib/fp_utils.pxd":20 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + * # of flags * - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + * if info == NULL: return # <<<<<<<<<<<<<< * + * cdef int copy_shape, i, ndim */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; + __pyx_r = 0; goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":21 - * cdef inline int imax(int i0, int i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":19 - * cimport cython + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline int imax(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ + __pyx_v_endian_detector = 1; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * ndim = PyArray_NDIM(self) */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":24 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + * cdef bint little_endian = ((&endian_detector)[0] != 0) * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 # <<<<<<<<<<<<<< - * return f1 + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "yt/utilities/lib/fp_utils.pxd":25 - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: - * if f0 > f1: return f0 - * return f1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline int imin(int i0, int i1) nogil: + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "yt/utilities/lib/fp_utils.pxd":23 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * - * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 > f1: return f0 - * return f1 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 */ + __pyx_v_copy_shape = 1; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + * ndim = PyArray_NDIM(self) * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: */ + goto __pyx_L4; + } -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":28 - * - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + /*else*/ { + __pyx_v_copy_shape = 0; } + __pyx_L4:; - /* "yt/utilities/lib/fp_utils.pxd":29 - * cdef inline int imin(int i0, int i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * 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_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } - /* "yt/utilities/lib/fp_utils.pxd":27 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 * - * cdef inline int imin(int i0, int i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + * 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") * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":32 - * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 # <<<<<<<<<<<<<< - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); if (__pyx_t_1) { - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - } - - /* "yt/utilities/lib/fp_utils.pxd":33 - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: - * if f0 < f1: return f0 - * return f1 # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - */ - __pyx_r = __pyx_v_f1; - goto __pyx_L0; - /* "yt/utilities/lib/fp_utils.pxd":31 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * - * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< - * if f0 < f1: return f0 - * return f1 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 218, __pyx_L1_error) - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + * copy_shape = 0 * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 + * 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") */ + } -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { - __pyx_t_5numpy_float64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":36 - * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); - if (__pyx_t_1) { - __pyx_r = (-__pyx_v_f0); - goto __pyx_L0; + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L9_bool_binop_done; } - /* "yt/utilities/lib/fp_utils.pxd":37 - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: - * if f0 < 0.0: return -f0 - * return f0 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 * - * cdef inline int iclip(int i, int a, int b) nogil: - */ - __pyx_r = __pyx_v_f0; - goto __pyx_L0; - - /* "yt/utilities/lib/fp_utils.pxd":35 - * return f1 + * 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") * - * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< - * if f0 < 0.0: return -f0 - * return f0 */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L9_bool_binop_done:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ + if (__pyx_t_1) { -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":40 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + * info.buf = PyArray_DATA(self) */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 222, __pyx_L1_error) - /* "yt/utilities/lib/fp_utils.pxd":41 - * cdef inline int iclip(int i, int a, int b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + * raise ValueError(u"ndarray is not C contiguous") * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; } - /* "yt/utilities/lib/fp_utils.pxd":42 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + * raise ValueError(u"ndarray is not Fortran contiguous") * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "yt/utilities/lib/fp_utils.pxd":39 - * return f0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * - * cdef inline int iclip(int i, int a, int b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. */ + __pyx_v_info->ndim = __pyx_v_ndim; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. */ + __pyx_t_1 = (__pyx_v_copy_shape != 0); + if (__pyx_t_1) { -static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { - int __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":45 - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a # <<<<<<<<<<<<<< - * if i > b: return b - * return i + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): */ - __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_a; - goto __pyx_L0; - } + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "yt/utilities/lib/fp_utils.pxd":46 - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: - * if i < a: return a - * if i > b: return b # <<<<<<<<<<<<<< - * return i - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] */ - __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_b; - goto __pyx_L0; - } + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "yt/utilities/lib/fp_utils.pxd":47 - * if i < a: return a - * if i > b: return b - * return i # <<<<<<<<<<<<<< - * - * cdef inline np.float64_t fclip(np.float64_t f, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] */ - __pyx_r = __pyx_v_i; - goto __pyx_L0; + __pyx_t_4 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "yt/utilities/lib/fp_utils.pxd":44 - * return i - * - * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< - * if i < a: return a - * if i > b: return b + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * 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]); - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { - __pyx_t_5numpy_float64_t __pyx_r; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + goto __pyx_L11; + } - /* "yt/utilities/lib/fp_utils.pxd":51 - * cdef inline np.float64_t fclip(np.float64_t f, - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL */ - __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); - goto __pyx_L0; + /*else*/ { + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "yt/utilities/lib/fp_utils.pxd":49 - * return i - * - * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< - * np.float64_t a, np.float64_t b) nogil: - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * 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_L11:; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * 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; -/* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; - - /* "yt/utilities/lib/fp_utils.pxd":54 - * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * + * cdef int t */ - __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; - } + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "yt/utilities/lib/fp_utils.pxd":55 - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: - * if i0 > i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + __pyx_v_f = NULL; - /* "yt/utilities/lib/fp_utils.pxd":53 - * return fmin(fmax(f, a), b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset * - * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 > i1: return i0 - * return i1 */ + __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; - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); -/* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L15_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L15_bool_binop_done:; + if (__pyx_t_1) { -static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { - __pyx_t_5numpy_int64_t __pyx_r; - int __pyx_t_1; + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; - /* "yt/utilities/lib/fp_utils.pxd":58 - * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 # <<<<<<<<<<<<<< - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None */ - __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); - if (__pyx_t_1) { - __pyx_r = __pyx_v_i0; - goto __pyx_L0; + goto __pyx_L14; } - /* "yt/utilities/lib/fp_utils.pxd":59 - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: - * if i0 < i1: return i0 - * return i1 # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< * + * if not hasfields: */ - __pyx_r = __pyx_v_i1; - goto __pyx_L0; + /*else*/ { + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L14:; - /* "yt/utilities/lib/fp_utils.pxd":57 - * return i1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self * - * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< - * if i0 < i1: return i0 - * return i1 + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * - * cdef int copy_shape, i, ndim + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_endian_detector = 1; + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L20_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_L20_next_or:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L19_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 259, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ - __pyx_v_copy_shape = 1; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" */ - goto __pyx_L4; - } + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" */ - if (__pyx_t_1) { + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" */ - } + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" */ - if (__pyx_t_1) { + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" */ - } + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - __pyx_v_info->ndim = __pyx_v_ndim; + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(2, 278, __pyx_L1_error) + break; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return * else: */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + __pyx_v_info->format = __pyx_v_f; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< * else: - * info.strides = PyArray_STRIDES(self) + * info.format = stdlib.malloc(_buffer_format_string_len) */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } + __pyx_r = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or */ - goto __pyx_L11; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * return * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 */ /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; + (__pyx_v_info->format[0]) = '^'; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, */ - __pyx_v_info->suboffsets = NULL; + __pyx_v_offset = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) + __pyx_v_f = __pyx_t_7; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< * - * cdef int t + * def __releasebuffer__(ndarray self, Py_buffer* info): */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + (__pyx_v_f[0]) = '\x00'; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ - __pyx_v_f = NULL; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * 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; + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * if not hasfields and not copy_shape: + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; + free(__pyx_v_info->format); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - goto __pyx_L14; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { + free(__pyx_v_info->strides); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + * f[0] = c'\0' # Terminate format string * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_1) { +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; + __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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; + __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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + * + * 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): */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; + __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, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) + * */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: +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); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } + __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, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * 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) + * */ - __pyx_v_info->format = __pyx_v_f; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or + * 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. */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 +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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); + __pyx_v_endian_detector = 1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * */ - (__pyx_v_info->format[0]) = '^'; + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(2, 794, __pyx_L1_error) } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __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, 794, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) */ - free(__pyx_v_info->format); + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 795, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block + * if (end - f) - (new_offset - offset[0]) < 15: */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 796, __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - */ - free(__pyx_v_info->strides); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) */ + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (__pyx_t_6) { - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + * 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__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 799, __pyx_L1_error) -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + * child, new_offset = fields * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * 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, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 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:; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 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:; -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * cdef inline object PyArray_MultiIterNew3(a, b, c): + * 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_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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 803, __pyx_L1_error) - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; -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); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 * - * 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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< * + * offset[0] += child.itemsize */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + * offset[0] += 1 * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + * 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); -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: */ - __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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { -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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + * # Until ticket #99 is fixed, use integers to avoid warnings */ - __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, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(2, 823, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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) + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") * */ + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + /*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, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __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 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 844, __pyx_L1_error) + } + __pyx_L15:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + goto __pyx_L13; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * 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:; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * 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); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); - return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr * - * 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. + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ -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; +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; __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); + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: */ - __pyx_v_endian_detector = 1; + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< * - * 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, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr * - * if (end - f) - (new_offset - offset[0]) < 15: + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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 +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - } + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_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:; + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 987, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - __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:; + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) + __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, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + * cdef inline int import_umath() except -1: */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 989, __pyx_L5_except_error) } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ - (__pyx_v_f[0]) = 0x78; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * offset[0] += child.itemsize + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 993, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { + } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") * - * 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, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; + __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, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * + * cdef inline int import_ufunc() except -1: */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 * - * # Until ticket #99 is fixed, use integers to avoid warnings + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * - * # 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" + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 999, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } + } + __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:; + __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } + __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, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" + /* 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; +} + +/* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + /* "yt/utilities/lib/fp_utils.pxd":20 + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 + * */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + /* "yt/utilities/lib/fp_utils.pxd":21 + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + /* "yt/utilities/lib/fp_utils.pxd":19 + * cimport cython + * + * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: +/* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: + /* "yt/utilities/lib/fp_utils.pxd":24 + * + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 # <<<<<<<<<<<<<< + * return f1 + * */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; + __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), + /* "yt/utilities/lib/fp_utils.pxd":25 + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: + * if f0 > f1: return f0 + * return f1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize + /* "yt/utilities/lib/fp_utils.pxd":23 + * return i1 * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: + * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 > f1: return f0 + * return f1 */ - goto __pyx_L13; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":28 + * + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields */ + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":29 + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: */ - __pyx_r = __pyx_v_f; + __pyx_r = __pyx_v_i1; goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) + /* "yt/utilities/lib/fp_utils.pxd":27 + * return f1 * - * 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. + * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * +/* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) { + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! - */ - __pyx_v_baseptr = NULL; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - goto __pyx_L3; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * 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:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr + /* "yt/utilities/lib/fp_utils.pxd":32 + * + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 # <<<<<<<<<<<<<< + * return f1 * */ - Py_XDECREF(__pyx_v_arr->base); + __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_f0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":33 + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: + * if f0 < f1: return f0 + * return f1 # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_r = __pyx_v_f1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * + /* "yt/utilities/lib/fp_utils.pxd":31 + * return i1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil: # <<<<<<<<<<<<<< + * if f0 < f1: return f0 + * return f1 */ /* function exit code */ - __Pyx_RefNannyFinishContext(); + __pyx_L0:; + return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr +/* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) { + __pyx_t_5numpy_float64_t __pyx_r; int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "yt/utilities/lib/fp_utils.pxd":36 + * + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 # <<<<<<<<<<<<<< + * return f0 * - * 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); + __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0); if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; + __pyx_r = (-__pyx_v_f0); goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - * + /* "yt/utilities/lib/fp_utils.pxd":37 + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: + * if f0 < 0.0: return -f0 + * return f0 # <<<<<<<<<<<<<< * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } + __pyx_r = __pyx_v_f0; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "yt/utilities/lib/fp_utils.pxd":35 + * return f1 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline np.float64_t fabs(np.float64_t f0) nogil: # <<<<<<<<<<<<<< + * if f0 < 0.0: return -f0 + * return f0 */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_array", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") + /* "yt/utilities/lib/fp_utils.pxd":40 * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":41 + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * - * 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, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: + /* "yt/utilities/lib/fp_utils.pxd":42 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() + /* "yt/utilities/lib/fp_utils.pxd":39 + * return f0 + * + * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") +/* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":45 * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a # <<<<<<<<<<<<<< + * if i > b: return b + * return i */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_a; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "yt/utilities/lib/fp_utils.pxd":46 + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: + * if i < a: return a + * if i > b: return b # <<<<<<<<<<<<<< + * return i * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign + __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_b; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":47 + * if i < a: return a + * if i > b: return b + * return i # <<<<<<<<<<<<<< * + * cdef inline np.float64_t fclip(np.float64_t f, */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_v_i; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + /* "yt/utilities/lib/fp_utils.pxd":44 + * return i * - * cdef inline int import_ufunc() except -1: + * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil: # <<<<<<<<<<<<<< + * if i < a: return a + * if i > b: return b */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "yt/utilities/lib/fp_utils.pxd":49 + * return i * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + + /* "yt/utilities/lib/fp_utils.pxd":51 + * cdef inline np.float64_t fclip(np.float64_t f, + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) # <<<<<<<<<<<<<< * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: */ - - /* function exit code */ - __pyx_r = 0; + __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b); 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; + + /* "yt/utilities/lib/fp_utils.pxd":49 + * return i + * + * cdef inline np.float64_t fclip(np.float64_t f, # <<<<<<<<<<<<<< + * np.float64_t a, np.float64_t b) nogil: + * return fmin(fmax(f, a), b) + */ + + /* function exit code */ __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") +/* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ -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); +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":54 + * + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * 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:*/ { + __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; + } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":55 + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: + * if i0 > i1: return i0 + * return i1 # <<<<<<<<<<<<<< + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + __pyx_r = __pyx_v_i1; + goto __pyx_L0; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "yt/utilities/lib/fp_utils.pxd":53 + * return fmin(fmax(f, a), b) * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: + * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 > i1: return i0 + * return i1 */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< +/* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) { + __pyx_t_5numpy_int64_t __pyx_r; + int __pyx_t_1; + + /* "yt/utilities/lib/fp_utils.pxd":58 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 # <<<<<<<<<<<<<< + * return i1 * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0); + if (__pyx_t_1) { + __pyx_r = __pyx_v_i0; + goto __pyx_L0; } - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":59 + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: + * if i0 < i1: return i0 + * return i1 # <<<<<<<<<<<<<< * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + */ + __pyx_r = __pyx_v_i1; + goto __pyx_L0; + + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 + * + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_2yt_9utilities_3lib_9quad_tree_QuadTree __pyx_vtable_2yt_9utilities_3lib_9quad_tree_QuadTree; @@ -11105,7 +11347,7 @@ static void __pyx_tp_dealloc_2yt_9utilities_3lib_9quad_tree_QuadTree(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + 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 @@ -11129,6 +11371,8 @@ {"initialize_chunk", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_9quad_tree_8QuadTree_13initialize_chunk, METH_VARARGS|METH_KEYWORDS, 0}, {"get_all", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_9quad_tree_8QuadTree_15get_all, METH_VARARGS|METH_KEYWORDS, 0}, {"fill_image", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_9quad_tree_8QuadTree_17fill_image, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_9quad_tree_8QuadTree_21__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_9quad_tree_8QuadTree_23__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -11219,12 +11463,13 @@ {&__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_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_YTIntDomainOverflow, __pyx_k_YTIntDomainOverflow, sizeof(__pyx_k_YTIntDomainOverflow), 0, 0, 1, 1}, {&__pyx_n_s_bounds, __pyx_k_bounds, sizeof(__pyx_k_bounds), 0, 0, 1, 1}, {&__pyx_n_s_bounds_2, __pyx_k_bounds_2, sizeof(__pyx_k_bounds_2), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 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_count_only, __pyx_k_count_only, sizeof(__pyx_k_count_only), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, @@ -11241,6 +11486,7 @@ {&__pyx_n_s_mip, __pyx_k_mip, sizeof(__pyx_k_mip), 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_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}, @@ -11254,7 +11500,9 @@ {&__pyx_n_s_qt1, __pyx_k_qt1, sizeof(__pyx_k_qt1), 0, 0, 1, 1}, {&__pyx_n_s_qt2, __pyx_k_qt2, sizeof(__pyx_k_qt2), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 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_refined, __pyx_k_refined, sizeof(__pyx_k_refined), 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_skip, __pyx_k_skip, sizeof(__pyx_k_skip), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_top_grid_dims, __pyx_k_top_grid_dims, sizeof(__pyx_k_top_grid_dims), 0, 0, 1, 1}, @@ -11265,15 +11513,17 @@ {&__pyx_n_s_wval, __pyx_k_wval, sizeof(__pyx_k_wval), 0, 0, 1, 1}, {&__pyx_n_s_yt_utilities_exceptions, __pyx_k_yt_utilities_exceptions, sizeof(__pyx_k_yt_utilities_exceptions), 0, 0, 1, 1}, {&__pyx_n_s_yt_utilities_lib_quad_tree, __pyx_k_yt_utilities_lib_quad_tree, sizeof(__pyx_k_yt_utilities_lib_quad_tree), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_quad_tree_pyx, __pyx_k_yt_utilities_lib_quad_tree_pyx, sizeof(__pyx_k_yt_utilities_lib_quad_tree_pyx), 0, 0, 1, 0}, {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 45, __pyx_L1_error) __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 117, __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_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 561, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -11283,6 +11533,25 @@ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 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_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(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__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): @@ -11290,9 +11559,9 @@ * * 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, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -11301,9 +11570,9 @@ * * 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, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -11312,9 +11581,9 @@ * 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, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -11323,9 +11592,9 @@ * * 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, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -11334,9 +11603,9 @@ * # 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, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -11345,9 +11614,9 @@ * * # 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, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -11356,9 +11625,9 @@ * * 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, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -11367,18 +11636,18 @@ * * 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, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _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, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); /* "yt/utilities/lib/quad_tree.pyx":563 * raise RuntimeError @@ -11387,10 +11656,10 @@ * cdef int i, j * qt1.num_cells = 0 */ - __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_qt1, __pyx_n_s_qt2, __pyx_n_s_method, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_func); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_merge_quadtrees, 563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(6, __pyx_n_s_qt1, __pyx_n_s_qt2, __pyx_n_s_method, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_func); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_quad_tree_pyx, __pyx_n_s_merge_quadtrees, 563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -11464,6 +11733,7 @@ __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 @@ -11505,6 +11775,7 @@ __pyx_type_2yt_9utilities_3lib_9quad_tree_QuadTree.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_9quad_tree_QuadTree.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_9quad_tree_QuadTree) < 0) __PYX_ERR(0, 98, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "QuadTree", (PyObject *)&__pyx_type_2yt_9utilities_3lib_9quad_tree_QuadTree) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_9quad_tree_QuadTree) < 0) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_ptype_2yt_9utilities_3lib_9quad_tree_QuadTree = &__pyx_type_2yt_9utilities_3lib_9quad_tree_QuadTree; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -11513,12 +11784,12 @@ #else sizeof(PyHeapTypeObject), #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) + 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, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -11581,12 +11852,12 @@ 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; - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") + /* "yt/utilities/lib/fp_utils.pxd":57 + * return i1 * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() + * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil: # <<<<<<<<<<<<<< + * if i0 < i1: return i0 + * return i1 */ /*--- Wrapped vars code ---*/ @@ -11597,7 +11868,7 @@ __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.quad_tree", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.quad_tree", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -12382,7 +12653,16 @@ } else if (length == 1) { return (equals == Py_EQ); } else { - int result = memcmp(ps1, ps2, (size_t)length); + 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)) { @@ -12442,6 +12722,21 @@ 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; @@ -12684,9 +12979,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -12699,9 +12997,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -13060,8 +13361,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL @@ -13069,17 +13370,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { @@ -13212,6 +13518,71 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; @@ -13300,6 +13671,40 @@ return value; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + 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; @@ -13440,12 +13845,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -14686,6 +15094,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -14694,11 +15104,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/ragged_arrays.c yt-3.4.0/yt/utilities/lib/ragged_arrays.c --- yt-3.3.3/yt/utilities/lib/ragged_arrays.c 2016-12-12 01:42:03.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/ragged_arrays.c 2017-08-10 18:20:59.000000000 +0000 @@ -1,9 +1,13 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { "distutils": { - "depends": [] + "depends": [], + "name": "yt.utilities.lib.ragged_arrays", + "sources": [ + "yt/utilities/lib/ragged_arrays.pyx" + ] }, "module_name": "yt.utilities.lib.ragged_arrays" } @@ -16,7 +20,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -38,6 +42,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -190,16 +195,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -326,6 +335,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -380,6 +395,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -489,8 +533,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -503,8 +547,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -626,10 +673,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1238,45 +1287,6 @@ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* 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 - /* 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) ?\ @@ -1333,6 +1343,15 @@ #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#endif + /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) @@ -1363,6 +1382,34 @@ #endif static long __Pyx__PyObject_Ord(PyObject* c); +/* 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 + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + /* SetItemInt.proto */ #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ @@ -1373,9 +1420,6 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); -/* IterFinish.proto */ -static CYTHON_INLINE int __Pyx_IterFinish(void); - /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ @@ -1412,15 +1456,6 @@ /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* RaiseTooManyValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -/* UnpackItemEndCheck.proto */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); - /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); @@ -1465,7 +1500,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); @@ -1473,26 +1508,37 @@ /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); -/* IncludeStringH.proto */ -#include - -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); +/* BufferIndexError.proto */ +static void __Pyx_RaiseBufferIndexError(int axis); -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +/* 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 -/* StrEquals.proto */ -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +/* 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_PyString_Equals __Pyx_PyBytes_Equals +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif -/* BufferIndexError.proto */ -static void __Pyx_RaiseBufferIndexError(int axis); +/* 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 -#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) /* None.proto */ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); @@ -1505,12 +1551,29 @@ /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); +/* 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) @@ -1519,6 +1582,9 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS @@ -1566,6 +1632,13 @@ #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() + /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); @@ -1574,9 +1647,18 @@ 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 *); + /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); @@ -1653,6 +1735,9 @@ static int __pyx_FusedFunction_init(void); #define __Pyx_FusedFunction_USED +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1672,6 +1757,9 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); +/* IsLittleEndian.proto */ +static int __Pyx_Is_Little_Endian(void); + #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); static void __Pyx_ReleaseBuffer(Py_buffer *view); @@ -1741,6 +1829,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* 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); /* RealImag.proto */ @@ -1842,9 +1933,6 @@ #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 */ @@ -1895,6 +1983,10 @@ /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +/* ImportNumPyArray.proto */ +static PyObject *__pyx_numpy_ndarray = NULL; +static PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void); + /* CIntFromPy.proto */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); @@ -2021,6 +2113,7 @@ 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_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 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 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; @@ -2032,38 +2125,43 @@ static PyObject *__pyx_builtin_sum; static PyObject *__pyx_builtin_max; static PyObject *__pyx_builtin_min; -static PyObject *__pyx_builtin_ImportError; -static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_zip; -static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_reversed; static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; -static const char __pyx_k_[] = "()"; +static const char __pyx_k_[] = "<"; 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__3[] = "|"; +static const char __pyx_k_s[] = "s"; +static const char __pyx_k__2[] = ">"; +static const char __pyx_k__3[] = "()"; +static const char __pyx_k__5[] = "|"; static const char __pyx_k_dt[] = "dt"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_ma[] = "ma"; static const char __pyx_k_mi[] = "mi"; static const char __pyx_k_np[] = "np"; -static const char __pyx_k__29[] = "_"; +static const char __pyx_k__37[] = "_"; static const char __pyx_k_max[] = "max"; static const char __pyx_k_min[] = "min"; +static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_sum[] = "sum"; static const char __pyx_k_val[] = "val"; static const char __pyx_k_zip[] = "zip"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; +static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_func[] = "func"; static const char __pyx_k_ival[] = "ival"; static const char __pyx_k_kind[] = "kind"; @@ -2099,8 +2197,11 @@ static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_name_2[] = "__name__"; +static const char __pyx_k_pickle[] = "pickle"; +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_float32[] = "float32"; static const char __pyx_k_float64[] = "float64"; @@ -2111,15 +2212,19 @@ static const char __pyx_k_int32_t[] = "int32_t"; static const char __pyx_k_int64_t[] = "int64_t"; static const char __pyx_k_memview[] = "memview"; -static const char __pyx_k_ndarray[] = "ndarray"; +static const char __pyx_k_strides[] = "strides"; static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_defaults[] = "defaults"; static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_reversed[] = "reversed"; static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_byteorder[] = "byteorder"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_float32_t[] = "float32_t"; static const char __pyx_k_float64_t[] = "float64_t"; static const char __pyx_k_operation[] = "operation"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_index_unop[] = "index_unop"; @@ -2128,11 +2233,19 @@ static const char __pyx_k_signatures[] = "signatures"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_f_contiguous[] = "f_contiguous"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; -static const char __pyx_k_AttributeError[] = "AttributeError"; +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_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_strided_and_indirect[] = ""; @@ -2145,9 +2258,7 @@ static const char __pyx_k_No_matching_signature_found[] = "No matching signature found"; static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Expected_at_least_d_arguments[] = "Expected at least %d arguments"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/ragged_arrays.pyx"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_yt_utilities_lib_ragged_arrays[] = "yt.utilities.lib.ragged_arrays"; static const char __pyx_k_Some_simple_operations_for_oper[] = "\nSome simple operations for operating on ragged arrays\n\n\n\n"; @@ -2156,8 +2267,10 @@ static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static const char __pyx_k_Expected_at_least_d_argument_s_g[] = "Expected at least %d argument%s, got %d"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; static const char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types"; +static const char __pyx_k_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"; @@ -2165,22 +2278,24 @@ 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_yt_utilities_lib_ragged_arrays_p[] = "yt/utilities/lib/ragged_arrays.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_kp_s_; static PyObject *__pyx_n_s_ASCII; -static PyObject *__pyx_n_s_AttributeError; static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; 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_s_Expected_at_least_d_arguments; +static PyObject *__pyx_kp_s_Expected_at_least_d_argument_s_g; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; static PyObject *__pyx_kp_s_Function_call_with_ambiguous_arg; static PyObject *__pyx_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; @@ -2193,28 +2308,35 @@ static PyObject *__pyx_n_s_NotImplementedError; 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_n_s_RuntimeError; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_n_s__29; +static PyObject *__pyx_n_s_View_MemoryView; +static PyObject *__pyx_kp_s__2; static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_n_s__37; +static PyObject *__pyx_kp_s__5; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_byteorder; 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_defaults; +static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dt; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_dtype_is_object; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_f_contiguous; static PyObject *__pyx_n_s_finfo; static PyObject *__pyx_n_s_flags; static PyObject *__pyx_n_s_float32; @@ -2252,10 +2374,11 @@ static PyObject *__pyx_n_s_mode; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_name_2; -static PyObject *__pyx_n_s_ndarray; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_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; @@ -2264,10 +2387,20 @@ static PyObject *__pyx_n_s_operation; static PyObject *__pyx_n_s_out_values; static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_prod; +static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; +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_cython; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_reversed; +static PyObject *__pyx_n_s_s; +static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_signatures; static PyObject *__pyx_n_s_size; @@ -2279,6 +2412,8 @@ static PyObject *__pyx_kp_s_strided_and_direct; static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_n_s_strides; +static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_strip; static PyObject *__pyx_n_s_struct; static PyObject *__pyx_n_s_sum; @@ -2287,9 +2422,11 @@ 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 PyObject *__pyx_n_s_val; static PyObject *__pyx_n_s_values; static PyObject *__pyx_n_s_yt_utilities_lib_ragged_arrays; +static PyObject *__pyx_kp_s_yt_utilities_lib_ragged_arrays_p; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_n_s_zip; static PyObject *__pyx_pf_2yt_9utilities_3lib_13ragged_arrays_index_unop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */ @@ -2306,8 +2443,12 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static 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 */ @@ -2329,25 +2470,30 @@ 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_4; +static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; -static PyObject *__pyx_tuple__2; 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_slice__31; +static PyObject *__pyx_slice__32; +static PyObject *__pyx_slice__33; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -2363,14 +2509,24 @@ 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__32; -static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; -static PyObject *__pyx_codeobj__31; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__46; /* "yt/utilities/lib/ragged_arrays.pyx":26 * np.int64_t @@ -3007,9 +3163,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -3018,16 +3178,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(1, 47, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(1, 47, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { @@ -3067,45 +3230,48 @@ static PyObject *__pyx_pf_2yt_9utilities_3lib_13ragged_arrays_index_unop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) { PyObject *__pyx_v_dest_sig = NULL; + Py_ssize_t __pyx_v_i; PyTypeObject *__pyx_v_ndarray = 0; - PyObject *__pyx_v_numpy = NULL; __Pyx_memviewslice __pyx_v_memslice; Py_ssize_t __pyx_v_itemsize; int __pyx_v_dtype_signed; char __pyx_v_kind; - int __pyx_v____pyx_int64_t_is_signed; + int __pyx_v_arg_is_pythran_compatible; int __pyx_v____pyx_int32_t_is_signed; + int __pyx_v____pyx_int64_t_is_signed; PyObject *__pyx_v_arg = NULL; PyObject *__pyx_v_dtype = NULL; PyObject *__pyx_v_arg_base = NULL; + PyObject *__pyx_v_byteorder = NULL; + PyObject *__pyx_v_cur_stride = NULL; + PyObject *__pyx_v_dim = NULL; + PyObject *__pyx_v_stride = NULL; PyObject *__pyx_v_candidates = NULL; PyObject *__pyx_v_sig = NULL; int __pyx_v_match_found; - PyObject *__pyx_v_src_type = NULL; + PyObject *__pyx_v_src_sig = NULL; PyObject *__pyx_v_dst_type = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; + long __pyx_t_7; + int __pyx_t_8; PyObject *__pyx_t_9 = NULL; - Py_ssize_t __pyx_t_10; - long __pyx_t_11; - __Pyx_memviewslice __pyx_t_12; - Py_ssize_t __pyx_t_13; - int __pyx_t_14; + PyObject *(*__pyx_t_10)(PyObject *); + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + __Pyx_memviewslice __pyx_t_14; Py_ssize_t __pyx_t_15; - PyObject *(*__pyx_t_16)(PyObject *); - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - PyObject *(*__pyx_t_20)(PyObject *); - int __pyx_t_21; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; __Pyx_RefNannySetupContext("index_unop", 0); __Pyx_INCREF(__pyx_v_kwargs); __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) @@ -3115,130 +3281,107 @@ PyList_SET_ITEM(__pyx_t_1, 0, Py_None); __pyx_v_dest_sig = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = (__pyx_v_kwargs == Py_None); - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_v_kwargs != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; } - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - /*try:*/ { - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_numpy = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 47, __pyx_L4_error) - __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); - __pyx_t_1 = 0; - } - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L11_try_end; - __pyx_L4_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); - if (__pyx_t_7) { - __Pyx_AddTraceback("yt.utilities.lib.ragged_arrays.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(1, 47, __pyx_L6_except_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(Py_None); - __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L5_exception_handled; - } - goto __pyx_L6_except_error; - __pyx_L6_except_error:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); - goto __pyx_L1_error; - __pyx_L5_exception_handled:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); - __pyx_L11_try_end:; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_3 = ((!__pyx_t_4) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + __Pyx_INCREF(Py_None); + __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); + __pyx_t_1 = 0; __pyx_v_itemsize = -1L; - __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0); + __pyx_v_arg_is_pythran_compatible = 0; __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0); + __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 47, __pyx_L1_error) } - __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 47, __pyx_L1_error) - __pyx_t_3 = ((0 < __pyx_t_10) != 0); - if (__pyx_t_3) { + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_2 = ((0 < __pyx_t_5) != 0); + if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 47, __pyx_L1_error) } - __pyx_t_9 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_v_arg = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L14; + __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_arg = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6; + } + __pyx_t_3 = (__pyx_v_kwargs != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L7_bool_binop_done; } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(1, 47, __pyx_L1_error) } - __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_values, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_values, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 47, __pyx_L1_error) } - __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_values); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_v_arg = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L14; + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_arg = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6; } /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 47, __pyx_L1_error) } - __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 47, __pyx_L1_error) - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_int_4); + __Pyx_GIVEREF(__pyx_int_4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_4); + __Pyx_INCREF(__pyx_n_s_s); + __Pyx_GIVEREF(__pyx_n_s_s); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_s); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 47, __pyx_L1_error) } - __pyx_L14:; + __pyx_L6:; while (1) { __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None)); __pyx_t_3 = (__pyx_t_2 != 0); @@ -3246,55 +3389,255 @@ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_dtype = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L18; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_dtype = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_arg_is_pythran_compatible = 1; + goto __pyx_L12; } __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_arg_base = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_arg_base = __pyx_t_1; + __pyx_t_1 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_dtype = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L19; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_dtype = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L13; } /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_dtype = Py_None; } - __pyx_L19:; - goto __pyx_L18; + __pyx_L13:; + goto __pyx_L12; } /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_dtype = Py_None; } - __pyx_L18:; + __pyx_L12:; __pyx_v_itemsize = -1L; __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_itemsize = __pyx_t_10; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_kind = __pyx_t_11; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_itemsize = __pyx_t_5; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_1); if (unlikely(__pyx_t_7 == (long)(Py_UCS4)-1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_kind = __pyx_t_7; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_byteorder); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_byteorder = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_byteorder, __pyx_kp_s_, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_8 = __Pyx_Is_Little_Endian(); + __pyx_t_2 = ((!(__pyx_t_8 != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L16_bool_binop_done:; + if (__pyx_t_3) { + __pyx_v_arg_is_pythran_compatible = 0; + } + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_byteorder, __pyx_kp_s__2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L19_bool_binop_done; + } + __pyx_t_8 = __Pyx_Is_Little_Endian(); + __pyx_t_2 = (__pyx_t_8 != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L19_bool_binop_done:; + if (__pyx_t_3) { + __pyx_v_arg_is_pythran_compatible = 0; + } __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); + __pyx_t_3 = (__pyx_v_arg_is_pythran_compatible != 0); + if (__pyx_t_3) { + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cur_stride = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_reversed, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_strides); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_reversed, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_9 = __pyx_t_6; __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 47, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_9))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_10(__pyx_t_9); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 47, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if !CYTHON_COMPILING_IN_PYPY + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 47, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_11 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_11); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L24_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L24_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_unpacking_done; + __pyx_L24_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_L25_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_6 = PyObject_RichCompare(__pyx_v_stride, __pyx_v_cur_stride, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { + __pyx_v_arg_is_pythran_compatible = 0; + goto __pyx_L23_break; + } + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_cur_stride, __pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_cur_stride, __pyx_t_6); + __pyx_t_6 = 0; + } + /*else*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L28_bool_binop_done; + } + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_11, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = __pyx_t_2; + __pyx_L28_bool_binop_done:; + __pyx_v_arg_is_pythran_compatible = (!__pyx_t_3); + } + __pyx_L23_break:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } switch (__pyx_v_kind) { case 'i': case 'u': @@ -3302,47 +3645,47 @@ if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L22_bool_binop_done; + goto __pyx_L31_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L22_bool_binop_done; + goto __pyx_L31_bool_binop_done; } __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L22_bool_binop_done:; + __pyx_L31_bool_binop_done:; if (__pyx_t_3) { if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - goto __pyx_L16_break; + goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L26_bool_binop_done; + goto __pyx_L35_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L26_bool_binop_done; + goto __pyx_L35_bool_binop_done; } __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L26_bool_binop_done:; + __pyx_L35_bool_binop_done:; if (__pyx_t_3) { if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - goto __pyx_L16_break; + goto __pyx_L10_break; } break; case 'f': @@ -3350,35 +3693,35 @@ if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L30_bool_binop_done; + goto __pyx_L39_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L30_bool_binop_done:; + __pyx_L39_bool_binop_done:; if (__pyx_t_3) { if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - goto __pyx_L16_break; + goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L33_bool_binop_done; + goto __pyx_L42_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L33_bool_binop_done:; + __pyx_L42_bool_binop_done:; if (__pyx_t_3) { if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - goto __pyx_L16_break; + goto __pyx_L10_break; } break; case 'c': @@ -3393,19 +3736,19 @@ if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L36_bool_binop_done; + goto __pyx_L45_bool_binop_done; } __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L36_bool_binop_done:; + __pyx_L45_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg); - __pyx_v_memslice = __pyx_t_12; + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg); + __pyx_v_memslice = __pyx_t_14; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - goto __pyx_L16_break; + goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); @@ -3415,19 +3758,19 @@ if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L40_bool_binop_done; + goto __pyx_L49_bool_binop_done; } __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L40_bool_binop_done:; + __pyx_L49_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg); - __pyx_v_memslice = __pyx_t_12; + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg); + __pyx_v_memslice = __pyx_t_14; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - goto __pyx_L16_break; + goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); @@ -3437,19 +3780,19 @@ if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L44_bool_binop_done; + goto __pyx_L53_bool_binop_done; } __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L44_bool_binop_done:; + __pyx_L53_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg); - __pyx_v_memslice = __pyx_t_12; + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg); + __pyx_v_memslice = __pyx_t_14; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - goto __pyx_L16_break; + goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); @@ -3459,207 +3802,113 @@ if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; - goto __pyx_L48_bool_binop_done; + goto __pyx_L57_bool_binop_done; } __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0); __pyx_t_3 = __pyx_t_2; - __pyx_L48_bool_binop_done:; + __pyx_L57_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg); - __pyx_v_memslice = __pyx_t_12; + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg); + __pyx_v_memslice = __pyx_t_14; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - goto __pyx_L16_break; + goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - goto __pyx_L16_break; + goto __pyx_L10_break; } - __pyx_L16_break:; - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_candidates = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_10 = 0; + __pyx_L10_break:; + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_candidates = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(1, 47, __pyx_L1_error) } - __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); - __pyx_t_8 = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_15), (&__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __pyx_t_9 = __pyx_t_6; + __pyx_t_6 = 0; while (1) { - __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7); - if (unlikely(__pyx_t_14 == 0)) break; - if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_15, &__pyx_t_5, &__pyx_t_6, NULL, NULL, __pyx_t_8); + if (unlikely(__pyx_t_16 == 0)) break; + if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_6); + __pyx_t_6 = 0; __pyx_v_match_found = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); - __Pyx_INCREF(__pyx_v_dest_sig); - __Pyx_GIVEREF(__pyx_v_dest_sig); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0; - __pyx_t_16 = NULL; - } else { - __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 47, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_16)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { - if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_16(__pyx_t_9); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(1, 47, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 47, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_17 = PyList_GET_ITEM(sequence, 0); - __pyx_t_18 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_17); - __Pyx_INCREF(__pyx_t_18); - #else - __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_18); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_19); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; - index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L55_unpacking_failed; - __Pyx_GOTREF(__pyx_t_17); - index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L55_unpacking_failed; - __Pyx_GOTREF(__pyx_t_18); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(1, 47, __pyx_L1_error) - __pyx_t_20 = NULL; - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - goto __pyx_L56_unpacking_done; - __pyx_L55_unpacking_failed:; - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_20 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(1, 47, __pyx_L1_error) - __pyx_L56_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17); - __pyx_t_17 = 0; - __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18); - __pyx_t_18 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_17 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(1, 47, __pyx_L1_error) + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_i = __pyx_t_18; + __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_11); + __pyx_t_11 = 0; __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_11, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; - goto __pyx_L58; + goto __pyx_L65; } /*else*/ { __pyx_v_match_found = 0; - goto __pyx_L54_break; + goto __pyx_L63_break; } - __pyx_L58:; + __pyx_L65:; } } - __pyx_L54_break:; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_L63_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(1, 47, __pyx_L1_error) } } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(1, 47, __pyx_L1_error) } - __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(1, 47, __pyx_L1_error) - __pyx_t_3 = ((__pyx_t_13 > 1) != 0); + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_15 > 1) != 0); if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(1, 47, __pyx_L1_error) } /*else*/ { @@ -3668,36 +3917,38 @@ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 47, __pyx_L1_error) } - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; goto __pyx_L0; } /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_17); - __Pyx_XDECREF(__pyx_t_18); - __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("yt.utilities.lib.ragged_arrays.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dest_sig); __Pyx_XDECREF(__pyx_v_ndarray); - __Pyx_XDECREF(__pyx_v_numpy); __Pyx_XDECREF(__pyx_v_arg); __Pyx_XDECREF(__pyx_v_dtype); __Pyx_XDECREF(__pyx_v_arg_base); + __Pyx_XDECREF(__pyx_v_byteorder); + __Pyx_XDECREF(__pyx_v_cur_stride); + __Pyx_XDECREF(__pyx_v_dim); + __Pyx_XDECREF(__pyx_v_stride); __Pyx_XDECREF(__pyx_v_candidates); __Pyx_XDECREF(__pyx_v_sig); - __Pyx_XDECREF(__pyx_v_src_type); + __Pyx_XDECREF(__pyx_v_src_sig); __Pyx_XDECREF(__pyx_v_dst_type); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_XGIVEREF(__pyx_r); @@ -3724,9 +3975,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -3735,16 +3990,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("index_unop", 1, 4, 4, 1); __PYX_ERR(1, 47, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sizes)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("index_unop", 1, 4, 4, 2); __PYX_ERR(1, 47, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_operation)) != 0)) kw_args--; else { @@ -4447,9 +4705,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -4458,16 +4720,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("index_unop", 1, 4, 4, 1); __PYX_ERR(1, 47, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sizes)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("index_unop", 1, 4, 4, 2); __PYX_ERR(1, 47, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_operation)) != 0)) kw_args--; else { @@ -5170,9 +5435,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -5181,16 +5450,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("index_unop", 1, 4, 4, 1); __PYX_ERR(1, 47, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sizes)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("index_unop", 1, 4, 4, 2); __PYX_ERR(1, 47, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_operation)) != 0)) kw_args--; else { @@ -5893,9 +6165,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -5904,16 +6180,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("index_unop", 1, 4, 4, 1); __PYX_ERR(1, 47, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sizes)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("index_unop", 1, 4, 4, 2); __PYX_ERR(1, 47, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_operation)) != 0)) kw_args--; else { @@ -6765,7 +7044,7 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6821,7 +7100,7 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -7130,7 +7409,7 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -7945,7 +8224,7 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8013,7 +8292,7 @@ * # 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__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8122,7 +8401,7 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -8777,7 +9056,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -8803,7 +9082,7 @@ * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -8825,7 +9104,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -8908,7 +9187,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -8934,7 +9213,7 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -8956,7 +9235,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -9039,7 +9318,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -9062,7 +9341,7 @@ * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -9084,7 +9363,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -9138,10 +9417,15 @@ 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; } @@ -9150,21 +9434,25 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 120, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } + CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); @@ -9177,7 +9465,9 @@ } 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); @@ -9295,7 +9585,7 @@ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9327,7 +9617,7 @@ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9362,7 +9652,7 @@ */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -9400,7 +9690,7 @@ * * */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error) __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 @@ -9438,7 +9728,7 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -9722,7 +10012,7 @@ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -9960,7 +10250,7 @@ * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -10595,6 +10885,113 @@ 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__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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":240 * * @cname("__pyx_array_new") @@ -10790,6 +11187,7 @@ 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; } @@ -10909,54 +11307,341 @@ return __pyx_r; } -/* "View.MemoryView":294 - * - * @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 +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.name,) */ -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; +/* 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)); - /* "View.MemoryView":296 - * cdef void *align_pointer(void *memory, size_t alignment) nogil: - * "Align pointer memory on a given boundary" - * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< - * cdef size_t offset - * - */ - __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "View.MemoryView":300 - * - * with cython.cdivision(True): - * offset = aligned_p % alignment # <<<<<<<<<<<<<< - * - * if offset > 0: +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_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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; - /* "View.MemoryView":302 - * offset = aligned_p % alignment - * - * if offset > 0: # <<<<<<<<<<<<<< - * aligned_p += alignment - offset - * + /* "(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_v_offset > 0) != 0); - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; - /* "View.MemoryView":303 - * - * if offset > 0: - * aligned_p += alignment - offset # <<<<<<<<<<<<<< - * - * return aligned_p + /* "(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(0, 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(0, 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(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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(0, 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(0, 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":294 + * + * @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":296 + * 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":300 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":302 + * 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":303 + * + * if offset > 0: + * aligned_p += alignment - offset # <<<<<<<<<<<<<< + * + * return aligned_p */ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); @@ -11017,8 +11702,11 @@ 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; } @@ -11027,11 +11715,13 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 341, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); @@ -11044,6 +11734,7 @@ } 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; @@ -12176,7 +12867,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L11_try_end; + goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -12236,7 +12927,7 @@ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; - __pyx_L11_try_end:; + __pyx_L9_try_end:; } /* "View.MemoryView":421 @@ -12926,7 +13617,7 @@ * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 484, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 484, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -13767,7 +14458,7 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -13881,7 +14572,7 @@ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__24, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__28, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -14857,6 +15548,113 @@ 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__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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":643 * * @cname('__pyx_memoryview_new') @@ -15185,9 +15983,9 @@ __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_INCREF(__pyx_slice__31); + __Pyx_GIVEREF(__pyx_slice__31); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__31); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 668, __pyx_L1_error) @@ -15220,7 +16018,7 @@ * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__26); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__32); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 671, __pyx_L1_error) } __pyx_L7:; @@ -15365,9 +16163,9 @@ __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_INCREF(__pyx_slice__33); + __Pyx_GIVEREF(__pyx_slice__33); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__33); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 682, __pyx_L1_error) @@ -15491,7 +16289,7 @@ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -16874,11 +17672,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -17359,11 +18157,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; @@ -17631,36 +18429,143 @@ return __pyx_r; } -/* "View.MemoryView":985 - * - * @cname('__pyx_memoryview_fromslice') - * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< - * int ndim, - * object (*to_object_func)(char *), +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -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; +/* 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 - 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); + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "View.MemoryView":993 - * cdef _memoryviewslice result - * - * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< - * return None + /* "(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__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 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":985 + * + * @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":993 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None * */ __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); @@ -18075,7 +18980,7 @@ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); + __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); @@ -19332,11 +20237,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; @@ -19360,7 +20265,7 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); @@ -19429,7 +20334,7 @@ __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -19451,7 +20356,7 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); @@ -19542,7 +20447,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -19565,7 +20470,7 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); @@ -19681,7 +20586,7 @@ __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } @@ -20248,11 +21153,11 @@ __pyx_L1_error:; { #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + 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 - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; @@ -20432,7 +21337,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); @@ -20456,7 +21361,7 @@ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); + __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } @@ -20765,99 +21670,564 @@ /* function exit code */ } -static struct __pyx_vtabstruct_array __pyx_vtable_array; -static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_array_obj *p; - 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; -} +/* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ -static void __pyx_tp_dealloc_array(PyObject *o) { - struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif +/* 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); { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_array___dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); + 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(0, 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(0, 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(0, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; } - 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; -} + 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(0, 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); -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; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { - PyObject *v = PyObject_GenericGetAttr(o, n); - if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - v = __pyx_array___getattr__(o, n); - } - return v; -} +static PyObject *__pyx_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_PickleError = NULL; + PyObject *__pyx_v_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); -static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o); -} + /* "(tree fragment)":2 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); + if (__pyx_t_1) { -static PyMethodDef __pyx_methods_array[] = { - {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, - {0, 0, 0, 0} -}; + /* "(tree fragment)":3 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError # <<<<<<<<<<<<<< + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 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(0, 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(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -static struct PyGetSetDef __pyx_getsets_array[] = { - {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; + /* "(tree fragment)":4 + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * 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(0, 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(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_PickleError); + __pyx_t_2 = __pyx_v_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(0, 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(0, 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(0, 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(0, 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(0, 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(0, 4, __pyx_L1_error) -static PySequenceMethods __pyx_tp_as_sequence_array = { - 0, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - __pyx_sq_item_array, /*sq_item*/ - 0, /*sq_slice*/ - 0, /*sq_ass_item*/ - 0, /*sq_ass_slice*/ - 0, /*sq_contains*/ - 0, /*sq_inplace_concat*/ + /* "(tree fragment)":2 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 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(0, 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(0, 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(0, 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(0, 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(0, 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_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) # <<<<<<<<<<<<<< + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum 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(0, 7, __pyx_L1_error) + __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_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 + */ + + /* 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_PickleError); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v_result, PyObject *__pyx_v___pyx_state) { + 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; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if hasattr(result, '__dict__'): + * 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(0, 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(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_result->name); + __Pyx_DECREF(__pyx_v_result->name); + __pyx_v_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":12 + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): + * result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 12, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __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_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): # <<<<<<<<<<<<<< + * result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __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 PY_VERSION_HEX >= 0x030400a1 + 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 = 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 = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; @@ -20959,7 +22329,7 @@ static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -20987,6 +22357,8 @@ } 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} }; @@ -21074,7 +22446,7 @@ static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -21186,6 +22558,8 @@ {"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} }; @@ -21311,7 +22685,7 @@ static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -21355,6 +22729,8 @@ } 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} }; @@ -21454,17 +22830,17 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, - {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, {&__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_s_Expected_at_least_d_arguments, __pyx_k_Expected_at_least_d_arguments, sizeof(__pyx_k_Expected_at_least_d_arguments), 0, 0, 1, 0}, + {&__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_k_Expected_at_least_d_argument_s_g, sizeof(__pyx_k_Expected_at_least_d_argument_s_g), 0, 0, 1, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, {&__pyx_kp_s_Function_call_with_ambiguous_arg, __pyx_k_Function_call_with_ambiguous_arg, sizeof(__pyx_k_Function_call_with_ambiguous_arg), 0, 0, 1, 0}, {&__pyx_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}, @@ -21477,28 +22853,35 @@ {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__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_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_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s__29, __pyx_k__29, sizeof(__pyx_k__29), 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__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_n_s__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 0, 1, 1}, + {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_byteorder, __pyx_k_byteorder, sizeof(__pyx_k_byteorder), 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_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_f_contiguous, __pyx_k_f_contiguous, sizeof(__pyx_k_f_contiguous), 0, 0, 1, 1}, {&__pyx_n_s_finfo, __pyx_k_finfo, sizeof(__pyx_k_finfo), 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}, @@ -21536,10 +22919,11 @@ {&__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_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1}, {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_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}, @@ -21548,10 +22932,20 @@ {&__pyx_n_s_operation, __pyx_k_operation, sizeof(__pyx_k_operation), 0, 0, 1, 1}, {&__pyx_n_s_out_values, __pyx_k_out_values, sizeof(__pyx_k_out_values), 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_prod, __pyx_k_prod, sizeof(__pyx_k_prod), 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_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_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 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_signatures, __pyx_k_signatures, sizeof(__pyx_k_signatures), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, @@ -21563,6 +22957,8 @@ {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_strides, __pyx_k_strides, sizeof(__pyx_k_strides), 0, 0, 1, 1}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, @@ -21571,9 +22967,11 @@ {&__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}, {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_n_s_yt_utilities_lib_ragged_arrays, __pyx_k_yt_utilities_lib_ragged_arrays, sizeof(__pyx_k_yt_utilities_lib_ragged_arrays), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_ragged_arrays_p, __pyx_k_yt_utilities_lib_ragged_arrays_p, sizeof(__pyx_k_yt_utilities_lib_ragged_arrays_p), 0, 0, 1, 0}, {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} @@ -21582,14 +22980,14 @@ __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 79, __pyx_L1_error) __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(0, 82, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 47, __pyx_L1_error) - __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(1, 47, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 47, __pyx_L1_error) __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 47, __pyx_L1_error) __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(1, 86, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 89, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 218, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 146, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 149, __pyx_L1_error) __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(0, 396, __pyx_L1_error) @@ -21611,18 +23009,18 @@ * np.ndarray[np.int64_t, ndim=1] indices, * np.ndarray[np.int64_t, ndim=1] sizes, */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s__3); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -21631,9 +23029,9 @@ * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -21642,9 +23040,9 @@ * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -21653,9 +23051,9 @@ * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -21664,9 +23062,9 @@ * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -21675,9 +23073,9 @@ * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -21686,9 +23084,9 @@ * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 * _import_array() @@ -21697,9 +23095,9 @@ * * cdef inline int import_umath() except -1: */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 * _import_umath() @@ -21708,18 +23106,18 @@ * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "View.MemoryView":131 * @@ -21728,9 +23126,9 @@ * * if itemsize <= 0: */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "View.MemoryView":134 * @@ -21739,9 +23137,9 @@ * * if not isinstance(format, bytes): */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "View.MemoryView":137 * @@ -21750,9 +23148,9 @@ * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "View.MemoryView":146 * @@ -21761,9 +23159,9 @@ * * */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "View.MemoryView":174 * self.data = malloc(self.len) @@ -21772,9 +23170,9 @@ * * if self.dtype_is_object: */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "View.MemoryView":190 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -21783,9 +23181,28 @@ * info.buf = self.data * info.len = self.len */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "(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__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "(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__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "View.MemoryView":484 * result = struct.unpack(self.view.format, bytesitem) @@ -21794,9 +23211,9 @@ * else: * if len(self.view.format) == 1: */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "View.MemoryView":556 * if self.view.strides == NULL: @@ -21805,9 +23222,9 @@ * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); /* "View.MemoryView":563 * def suboffsets(self): @@ -21816,12 +23233,31 @@ * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__24 = PyTuple_New(1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); + __pyx_tuple__28 = PyTuple_New(1); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__24, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__24); + PyTuple_SET_ITEM(__pyx_tuple__28, 0, __pyx_int_neg_1); + __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(0, 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(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); /* "View.MemoryView":668 * if item is Ellipsis: @@ -21830,9 +23266,9 @@ * seen_ellipsis = True * else: */ - __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(0, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__25); - __Pyx_GIVEREF(__pyx_slice__25); + __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__31); + __Pyx_GIVEREF(__pyx_slice__31); /* "View.MemoryView":671 * seen_ellipsis = True @@ -21841,9 +23277,9 @@ * have_slices = True * else: */ - __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(0, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__26); - __Pyx_GIVEREF(__pyx_slice__26); + __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(0, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__32); + __Pyx_GIVEREF(__pyx_slice__32); /* "View.MemoryView":682 * nslices = ndim - len(result) @@ -21852,9 +23288,9 @@ * * 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(0, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__27); - __Pyx_GIVEREF(__pyx_slice__27); + __pyx_slice__33 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__33); + __Pyx_GIVEREF(__pyx_slice__33); /* "View.MemoryView":689 * for suboffset in suboffsets[:ndim]: @@ -21863,9 +23299,28 @@ * * */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "(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__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "(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__36 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); /* "yt/utilities/lib/ragged_arrays.pyx":47 * return a / b @@ -21874,10 +23329,10 @@ * np.ndarray[np.int64_t, ndim=1] indices, * np.ndarray[np.int64_t, ndim=1] sizes, */ - __pyx_tuple__30 = PyTuple_Pack(15, __pyx_n_s_values, __pyx_n_s_indices, __pyx_n_s_sizes, __pyx_n_s_operation, __pyx_n_s_mi, __pyx_n_s_ma, __pyx_n_s_dt, __pyx_n_s_out_values, __pyx_n_s_func, __pyx_n_s_ival, __pyx_n_s_val, __pyx_n_s_i, __pyx_n_s_ind_ind, __pyx_n_s_ind_arr, __pyx_n_s__29); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); - __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_index_unop, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(15, __pyx_n_s_values, __pyx_n_s_indices, __pyx_n_s_sizes, __pyx_n_s_operation, __pyx_n_s_mi, __pyx_n_s_ma, __pyx_n_s_dt, __pyx_n_s_out_values, __pyx_n_s_func, __pyx_n_s_ival, __pyx_n_s_val, __pyx_n_s_i, __pyx_n_s_ind_ind, __pyx_n_s_ind_arr, __pyx_n_s__37); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_ragged_arrays_p, __pyx_n_s_index_unop, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 47, __pyx_L1_error) /* "View.MemoryView":282 * return self.name @@ -21886,9 +23341,9 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); /* "View.MemoryView":283 * @@ -21897,9 +23352,9 @@ * cdef indirect = Enum("") * */ - __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); /* "View.MemoryView":284 * cdef generic = Enum("") @@ -21908,9 +23363,9 @@ * * */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); /* "View.MemoryView":287 * @@ -21919,9 +23374,9 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); /* "View.MemoryView":288 * @@ -21930,9 +23385,19 @@ * * */ - __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_tuple__45 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_PickleError, __pyx_n_s_result); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -21944,6 +23409,8 @@ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -22009,6 +23476,7 @@ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif @@ -22047,9 +23515,11 @@ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 103, __pyx_L1_error) __pyx_type___pyx_array.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(0, 103, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 103, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 275, __pyx_L1_error) __pyx_type___pyx_MemviewEnum.tp_print = 0; + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 275, __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; @@ -22062,6 +23532,7 @@ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 326, __pyx_L1_error) __pyx_type___pyx_memoryview.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(0, 326, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 326, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; @@ -22071,6 +23542,7 @@ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 951, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(0, 951, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 951, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -22113,27 +23585,27 @@ */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_2yt_9utilities_3lib_13ragged_arrays_3index_unop, 0, __pyx_n_s_index_unop, NULL, __pyx_n_s_yt_utilities_lib_ragged_arrays, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_2yt_9utilities_3lib_13ragged_arrays_3index_unop, 0, __pyx_n_s_index_unop, NULL, __pyx_n_s_yt_utilities_lib_ragged_arrays, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float32_t, __pyx_t_2) < 0) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_2yt_9utilities_3lib_13ragged_arrays_5index_unop, 0, __pyx_n_s_index_unop, NULL, __pyx_n_s_yt_utilities_lib_ragged_arrays, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_2yt_9utilities_3lib_13ragged_arrays_5index_unop, 0, __pyx_n_s_index_unop, NULL, __pyx_n_s_yt_utilities_lib_ragged_arrays, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float64_t, __pyx_t_2) < 0) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_2yt_9utilities_3lib_13ragged_arrays_7index_unop, 0, __pyx_n_s_index_unop, NULL, __pyx_n_s_yt_utilities_lib_ragged_arrays, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_2yt_9utilities_3lib_13ragged_arrays_7index_unop, 0, __pyx_n_s_index_unop, NULL, __pyx_n_s_yt_utilities_lib_ragged_arrays, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int32_t, __pyx_t_2) < 0) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_2yt_9utilities_3lib_13ragged_arrays_9index_unop, 0, __pyx_n_s_index_unop, NULL, __pyx_n_s_yt_utilities_lib_ragged_arrays, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_2yt_9utilities_3lib_13ragged_arrays_9index_unop, 0, __pyx_n_s_index_unop, NULL, __pyx_n_s_yt_utilities_lib_ragged_arrays, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int64_t, __pyx_t_2) < 0) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_13ragged_arrays_1index_unop, 0, __pyx_n_s_index_unop, NULL, __pyx_n_s_yt_utilities_lib_ragged_arrays, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_13ragged_arrays_1index_unop, 0, __pyx_n_s_index_unop, NULL, __pyx_n_s_yt_utilities_lib_ragged_arrays, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_1; @@ -22160,7 +23632,7 @@ */ __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(0, 207, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_array_type); @@ -22171,7 +23643,7 @@ * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_3); @@ -22185,7 +23657,7 @@ * cdef indirect = Enum("") * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_3); @@ -22199,7 +23671,7 @@ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_3); @@ -22213,7 +23685,7 @@ * cdef indirect_contiguous = Enum("") * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_3); @@ -22227,7 +23699,7 @@ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_3); @@ -22269,7 +23741,7 @@ */ __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(0, 535, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_memoryview_type); @@ -22282,16 +23754,26 @@ */ __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(0, 981, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_memoryviewslice_type); - /* "View.MemoryView":1391 - * - * @cname('__pyx_memoryview__slice_assign_scalar') - * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< - * Py_ssize_t *strides, int ndim, - * size_t itemsize, void *item) nogil: + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( result, __pyx_state) + * return result + * cdef __pyx_unpickle_Enum__set_state(Enum result, tuple __pyx_state): # <<<<<<<<<<<<<< + * result.name = __pyx_state[0] + * if hasattr(result, '__dict__'): */ /*--- Wrapped vars code ---*/ @@ -22303,7 +23785,7 @@ __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.ragged_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.ragged_arrays", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -22492,177 +23974,8 @@ return -1; } -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* SaveResetException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -#endif - -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { - PyObject *exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; - return PyErr_GivenExceptionMatches(exc_type, err); -} -#endif - -/* GetException */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { -#endif - PyObject *local_type, *local_value, *local_tb; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - /* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -22673,9 +23986,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); + Py_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; } @@ -22688,9 +24004,12 @@ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); + Py_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; } @@ -22743,7 +24062,7 @@ } /* PyObjectCall */ - #if CYTHON_COMPILING_IN_CPYTHON +#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; @@ -22763,7 +24082,7 @@ #endif /* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE +#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; @@ -22787,7 +24106,7 @@ #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 +#if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -22950,7 +24269,7 @@ #endif /* UnicodeAsUCS4 */ - static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { + static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { Py_ssize_t length; #if CYTHON_PEP393_ENABLED length = PyUnicode_GET_LENGTH(x); @@ -22981,36 +24300,242 @@ } /* object_ord */ - static long __Pyx__PyObject_Ord(PyObject* c) { + static long __Pyx__PyObject_Ord(PyObject* c) { Py_ssize_t size; if (PyBytes_Check(c)) { size = PyBytes_GET_SIZE(c); if (likely(size == 1)) { return (unsigned char) PyBytes_AS_STRING(c)[0]; } -#if PY_MAJOR_VERSION < 3 - } else if (PyUnicode_Check(c)) { - return (long)__Pyx_PyUnicode_AsPy_UCS4(c); -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - } else if (PyByteArray_Check(c)) { - size = PyByteArray_GET_SIZE(c); - if (likely(size == 1)) { - return (unsigned char) PyByteArray_AS_STRING(c)[0]; +#if PY_MAJOR_VERSION < 3 + } else if (PyUnicode_Check(c)) { + return (long)__Pyx_PyUnicode_AsPy_UCS4(c); +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + } else if (PyByteArray_Check(c)) { + size = PyByteArray_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyByteArray_AS_STRING(c)[0]; + } +#endif + } else { + PyErr_Format(PyExc_TypeError, + "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name); + return (long)(Py_UCS4)-1; + } + PyErr_Format(PyExc_TypeError, + "ord() expected a character, but string of length %zd found", size); + return (long)(Py_UCS4)-1; +} + +/* 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_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 +} + +/* 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"); +} + +/* IterFinish */ + static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; } + } + return 0; #endif +} + +/* UnpackItemEndCheck */ + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; } else { - PyErr_Format(PyExc_TypeError, - "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name); - return (long)(Py_UCS4)-1; + return __Pyx_IterFinish(); } - PyErr_Format(PyExc_TypeError, - "ord() expected a character, but string of length %zd found", size); - return (long)(Py_UCS4)-1; + return 0; } /* SetItemInt */ - static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); @@ -23057,43 +24582,8 @@ return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } -/* IterFinish */ - static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = PyThreadState_GET(); - PyObject* exc_type = tstate->curexc_type; - if (unlikely(exc_type)) { - if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { - PyObject *exc_value, *exc_tb; - exc_value = tstate->curexc_value; - exc_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - Py_DECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - return 0; - } else { - return -1; - } - } - return 0; -#else - if (unlikely(PyErr_Occurred())) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { - PyErr_Clear(); - return 0; - } else { - return -1; - } - } - return 0; -#endif -} - /* PyFunctionFastCall */ - #if CYTHON_FAST_PYCALL + #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { @@ -23209,11 +24699,11 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCallMethO */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; @@ -23233,7 +24723,7 @@ #endif /* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { @@ -23254,25 +24744,30 @@ #endif /* PyCFunctionFastCall */ - #if CYTHON_FAST_PYCCALL + #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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyObjectCallOneArg */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); @@ -23289,11 +24784,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -23316,7 +24807,7 @@ #endif /* PyObjectCallMethod0 */ - static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; @@ -23337,38 +24828,13 @@ return result; } -/* 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"); -} - -/* 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); -} - -/* UnpackItemEndCheck */ - static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else { - return __Pyx_IterFinish(); - } - return 0; -} - /* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ - static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { @@ -23379,7 +24845,7 @@ } /* UnpackTuple2 */ - static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int is_tuple, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; @@ -23426,17 +24892,32 @@ } /* dict_iter */ - static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; -#if !CYTHON_COMPILING_IN_PYPY if (is_dict) { +#if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; - } +#elif PY_MAJOR_VERSION >= 3 + static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; + const char *name = PyUnicode_AsUTF8(method_name); + PyObject **pp = NULL; + if (strcmp(name, "iteritems") == 0) pp = &py_items; + else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; + else if (strcmp(name, "itervalues") == 0) pp = &py_values; + if (pp) { + if (!*pp) { + *pp = PyUnicode_FromString(name + 4); + if (!*pp) + return NULL; + } + method_name = *pp; + } #endif + } *p_orig_length = 0; if (method_name) { PyObject* iter; @@ -23522,7 +25003,7 @@ } /* ArgTypeTest */ - static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); @@ -23549,7 +25030,7 @@ } /* BufferFormatCheck */ - static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; } @@ -24099,7 +25580,7 @@ } /* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); @@ -24117,7 +25598,7 @@ } /* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -24129,136 +25610,109 @@ 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 = 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; - } +/* BufferIndexError */ + static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} #endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); } +#endif -/* 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); +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #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); - } +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { #endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; + 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; } -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); + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); #endif -} - -/* BufferIndexError */ - static void __Pyx_RaiseBufferIndexError(int axis) { - PyErr_Format(PyExc_IndexError, - "Out of bounds on buffer access (axis %d)", axis); + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; } /* None */ - static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + 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)); @@ -24266,7 +25720,7 @@ } /* GetAttr */ - static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) @@ -24279,7 +25733,7 @@ } /* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_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)) { @@ -24311,8 +25765,23 @@ } } +/* GetAttr3 */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + /* SwapException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; @@ -24336,8 +25805,82 @@ } #endif +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + /* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY + #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))) { @@ -24453,12 +25996,12 @@ #endif /* None */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + 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) { + 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)); @@ -24466,7 +26009,7 @@ } /* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + 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; @@ -24507,8 +26050,40 @@ #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; + } +} + /* SetVTable */ - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else @@ -24525,8 +26100,73 @@ return -1; } +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (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: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + /* FetchCommonType */ - static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); @@ -24565,7 +26205,7 @@ } /* CythonFunction */ - static PyObject * + static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { @@ -25148,7 +26788,7 @@ } /* FusedFunction */ - static PyObject * + static PyObject * __pyx_FusedFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject *qualname, PyObject *self, PyObject *module, PyObject *globals, @@ -25472,8 +27112,42 @@ return 0; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -25553,7 +27227,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -25612,12 +27286,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -25633,6 +27310,17 @@ Py_XDECREF(py_frame); } +/* IsLittleEndian */ + static int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + #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); @@ -25656,8 +27344,8 @@ #endif - /* MemviewSliceIsContig */ - static int + /* MemviewSliceIsContig */ + static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { @@ -25680,7 +27368,7 @@ } /* OverlappingSlices */ - static void + static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) @@ -25716,7 +27404,7 @@ } /* Capsule */ - static CYTHON_INLINE PyObject * + static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; @@ -25729,7 +27417,7 @@ } /* TypeInfoCompare */ - static int + static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; @@ -25770,7 +27458,7 @@ } /* MemviewSliceValidateAndInit */ - static int + static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) @@ -25952,7 +27640,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -25975,7 +27663,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -25998,7 +27686,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -26021,7 +27709,7 @@ } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -26044,7 +27732,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -26074,8 +27762,39 @@ } } +/* 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); + } +} + /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -26097,7 +27816,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + 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) { @@ -26128,7 +27847,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -26148,7 +27867,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -26283,7 +28002,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -26303,7 +28022,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -26438,38 +28157,7 @@ #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) { + 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) { @@ -26500,7 +28188,7 @@ } /* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice + 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, @@ -26567,7 +28255,7 @@ } /* MemviewSliceInit */ - static int + static int __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, @@ -26702,14 +28390,14 @@ } /* BytesContains */ - static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character) { + static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character) { const Py_ssize_t length = PyBytes_GET_SIZE(bytes); char* char_start = PyBytes_AS_STRING(bytes); return memchr(char_start, (unsigned char)character, (size_t)length) != NULL; } /* CIntFromPy */ - static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + 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 @@ -26898,7 +28586,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -27087,7 +28775,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -27276,7 +28964,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -27464,8 +29152,34 @@ return (int) -1; } +/* ImportNumPyArray */ + static PyObject* __Pyx__ImportNumPyArray(void) { + PyObject *numpy_module, *ndarray_object = NULL; + numpy_module = __Pyx_Import(__pyx_n_s_numpy, NULL, 0); + if (likely(numpy_module)) { + ndarray_object = PyObject_GetAttrString(numpy_module, "ndarray"); + Py_DECREF(numpy_module); + } + if (unlikely(!ndarray_object)) { + PyErr_Clear(); + } + if (unlikely(!ndarray_object || !PyObject_TypeCheck(ndarray_object, &PyType_Type))) { + Py_XDECREF(ndarray_object); + Py_INCREF(Py_None); + ndarray_object = Py_None; + } + return ndarray_object; +} +static CYTHON_INLINE PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void) { + if (unlikely(!__pyx_numpy_ndarray)) { + __pyx_numpy_ndarray = __Pyx__ImportNumPyArray(); + } + Py_INCREF(__pyx_numpy_ndarray); + return __pyx_numpy_ndarray; +} + /* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + 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 @@ -27654,7 +29368,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -27670,7 +29384,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -27688,7 +29402,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -27753,7 +29467,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -27778,6 +29492,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -27786,11 +29502,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lib/ray_integrators.c yt-3.4.0/yt/utilities/lib/ray_integrators.c --- yt-3.3.3/yt/utilities/lib/ray_integrators.c 2016-12-12 01:42:03.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/ray_integrators.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,12540 +0,0 @@ -/* Generated by Cython 0.25.2 */ - -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "libraries": [ - "m" - ] - }, - "module_name": "yt.utilities.lib.ray_integrators" -} -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 < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_25_2" -#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 -#ifndef HAVE_LONG_LONG - #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) - #define HAVE_LONG_LONG - #endif -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#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_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 -#elif defined(PYSTON_VERSION) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_PYSTON 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_PYSTON 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #if PY_VERSION_HEX < 0x02070000 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) - #define CYTHON_USE_PYLONG_INTERNALS 1 - #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 1 - #endif - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #if PY_VERSION_HEX < 0x030300F0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #elif !defined(CYTHON_USE_UNICODE_WRITER) - #define CYTHON_USE_UNICODE_WRITER 1 - #endif - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #ifndef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 1 - #endif - #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 1 - #endif -#endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" - #undef SHIFT - #undef BASE - #undef MASK -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !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 -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); -#else - #define __Pyx_PyCFunctionFast _PyCFunctionFast -#endif -#if CYTHON_FAST_PYCCALL -#define __Pyx_PyFastCFunction_Check(func)\ - ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))))) -#else -#define __Pyx_PyFastCFunction_Check(func) 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 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 -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#if CYTHON_COMPILING_IN_PYSTON - #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) -#else - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#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 -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#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 - typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; - } __Pyx_PyAsyncMethodsStruct; - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif -#else - #define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #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) - -#ifndef CYTHON_INLINE - #if defined(__clang__) - #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) - #elif defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#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; \ -} - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__yt__utilities__lib__ray_integrators -#define __PYX_HAVE_API__yt__utilities__lib__ray_integrators -#include -#include -#include -#include "numpy/arrayobject.h" -#include "numpy/ufuncobject.h" -#include "math.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_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) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_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 PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static PyObject *__pyx_empty_unicode; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - -/* Header.proto */ -#if !defined(CYTHON_CCOMPLEX) - #if defined(__cplusplus) - #define CYTHON_CCOMPLEX 1 - #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[] = { - "yt/utilities/lib/ray_integrators.pyx", - "__init__.pxd", - "type.pxd", -}; -/* 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; - - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 - * # in Cython to enable them only on the right systems. - * - * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - */ -typedef npy_int8 __pyx_t_5numpy_int8_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":726 - * - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t - */ -typedef npy_int16 __pyx_t_5numpy_int16_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":727 - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< - * ctypedef npy_int64 int64_t - * #ctypedef npy_int96 int96_t - */ -typedef npy_int32 __pyx_t_5numpy_int32_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":728 - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< - * #ctypedef npy_int96 int96_t - * #ctypedef npy_int128 int128_t - */ -typedef npy_int64 __pyx_t_5numpy_int64_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":732 - * #ctypedef npy_int128 int128_t - * - * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - */ -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":733 - * - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t - */ -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":734 - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< - * ctypedef npy_uint64 uint64_t - * #ctypedef npy_uint96 uint96_t - */ -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":735 - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< - * #ctypedef npy_uint96 uint96_t - * #ctypedef npy_uint128 uint128_t - */ -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":739 - * #ctypedef npy_uint128 uint128_t - * - * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< - * ctypedef npy_float64 float64_t - * #ctypedef npy_float80 float80_t - */ -typedef npy_float32 __pyx_t_5numpy_float32_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":740 - * - * ctypedef npy_float32 float32_t - * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< - * #ctypedef npy_float80 float80_t - * #ctypedef npy_float128 float128_t - */ -typedef npy_float64 __pyx_t_5numpy_float64_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":749 - * # The int types are mapped a bit surprising -- - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t - */ -typedef npy_long __pyx_t_5numpy_int_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":750 - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong longlong_t - * - */ -typedef npy_longlong __pyx_t_5numpy_long_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":751 - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_ulong uint_t - */ -typedef npy_longlong __pyx_t_5numpy_longlong_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":753 - * ctypedef npy_longlong longlong_t - * - * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t - */ -typedef npy_ulong __pyx_t_5numpy_uint_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":754 - * - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulonglong_t - * - */ -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":755 - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_intp intp_t - */ -typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":757 - * ctypedef npy_ulonglong ulonglong_t - * - * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< - * ctypedef npy_uintp uintp_t - * - */ -typedef npy_intp __pyx_t_5numpy_intp_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":758 - * - * ctypedef npy_intp intp_t - * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * - * ctypedef npy_double float_t - */ -typedef npy_uintp __pyx_t_5numpy_uintp_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":760 - * ctypedef npy_uintp uintp_t - * - * ctypedef npy_double float_t # <<<<<<<<<<<<<< - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t - */ -typedef npy_double __pyx_t_5numpy_float_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":761 - * - * ctypedef npy_double float_t - * ctypedef npy_double double_t # <<<<<<<<<<<<<< - * ctypedef npy_longdouble longdouble_t - * - */ -typedef npy_double __pyx_t_5numpy_double_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":762 - * 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 ---*/ - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 - * ctypedef npy_longdouble longdouble_t - * - * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t - */ -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":765 - * - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< - * ctypedef npy_clongdouble clongdouble_t - * - */ -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":766 - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cdouble complex_t - */ -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":768 - * ctypedef npy_clongdouble clongdouble_t - * - * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew1(a): - */ -typedef npy_cdouble __pyx_t_5numpy_complex_t; - -/* --- 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) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* 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); - -/* ArgTypeTest.proto */ -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); - -/* BufferFormatCheck.proto */ -static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, - __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO - -#define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2) -#define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3) -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) -#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) -/* None.proto */ -static CYTHON_INLINE long __Pyx_mod_long(long, long); - -/* 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); - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -/* 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) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) - PyErr_SetObject(PyExc_KeyError, args); - Py_XDECREF(args); - } - return NULL; - } - Py_INCREF(value); - return value; -} -#else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#endif - -/* RaiseTooManyValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* RaiseNoneIterError.proto */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - -/* 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 - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* 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); - -/* 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; - -#if PY_MAJOR_VERSION < 3 - static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); - static void __Pyx_ReleaseBuffer(Py_buffer *view); -#else - #define __Pyx_GetBuffer PyObject_GetBuffer - #define __Pyx_ReleaseBuffer PyBuffer_Release -#endif - - -/* None.proto */ -static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; -static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -/* RealImag.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #define __Pyx_CREAL(z) ((z).real()) - #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); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* PyIdentifierFromString.proto */ -#if !defined(__Pyx_PyIdentifier_FromString) -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) -#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); - - -/* 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 'libc.stdlib' */ - -/* Module declarations from 'numpy' */ - -/* Module declarations from 'numpy' */ -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; -static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ - -/* Module declarations from 'cython' */ - -/* Module declarations from 'yt.utilities.lib.ray_integrators' */ -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float_t = { "float_t", NULL, sizeof(__pyx_t_5numpy_float_t), { 0 }, 0, 'R', 0, 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 }; -#define __Pyx_MODULE_NAME "yt.utilities.lib.ray_integrators" -int __pyx_module_is_main_yt__utilities__lib__ray_integrators = 0; - -/* Implementation of 'yt.utilities.lib.ray_integrators' */ -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_ImportError; -static const char __pyx_k_a[] = "a"; -static const char __pyx_k_e[] = "e"; -static const char __pyx_k_i[] = "i"; -static const char __pyx_k_j[] = "j"; -static const char __pyx_k_k[] = "k"; -static const char __pyx_k_n[] = "n"; -static const char __pyx_k_u[] = "u"; -static const char __pyx_k_v[] = "v"; -static const char __pyx_k_x[] = "x"; -static const char __pyx_k_y[] = "y"; -static const char __pyx_k_dt[] = "dt"; -static const char __pyx_k_dv[] = "dv"; -static const char __pyx_k_dx[] = "dx"; -static const char __pyx_k_ii[] = "ii"; -static const char __pyx_k_jj[] = "jj"; -static const char __pyx_k_kk[] = "kk"; -static const char __pyx_k_nn[] = "nn"; -static const char __pyx_k_np[] = "np"; -static const char __pyx_k_nv[] = "nv"; -static const char __pyx_k_tl[] = "tl"; -static const char __pyx_k_tr[] = "tr"; -static const char __pyx_k_ug[] = "ug"; -static const char __pyx_k_vi[] = "vi"; -static const char __pyx_k_i_s[] = "i_s"; -static const char __pyx_k_ind[] = "ind"; -static const char __pyx_k_o_s[] = "o_s"; -static const char __pyx_k_data[] = "data"; -static const char __pyx_k_dims[] = "dims"; -static const char __pyx_k_dist[] = "dist"; -static const char __pyx_k_imax[] = "imax"; -static const char __pyx_k_imin[] = "imin"; -static const char __pyx_k_jmax[] = "jmax"; -static const char __pyx_k_jmin[] = "jmin"; -static const char __pyx_k_kmax[] = "kmax"; -static const char __pyx_k_kmin[] = "kmin"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_rgba[] = "rgba"; -static const char __pyx_k_step[] = "step"; -static const char __pyx_k_temp[] = "temp"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_tmax[] = "tmax"; -static const char __pyx_k_alpha[] = "alpha"; -static const char __pyx_k_dtype[] = "dtype"; -static const char __pyx_k_empty[] = "empty"; -static const char __pyx_k_floor[] = "floor"; -static const char __pyx_k_image[] = "image"; -static const char __pyx_k_numpy[] = "numpy"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_grid_t[] = "grid_t"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_iv_dir[] = "iv_dir"; -static const char __pyx_k_shells[] = "shells"; -static const char __pyx_k_tdelta[] = "tdelta"; -static const char __pyx_k_temp_x[] = "temp_x"; -static const char __pyx_k_temp_y[] = "temp_y"; -static const char __pyx_k_cur_ind[] = "cur_ind"; -static const char __pyx_k_enter_t[] = "enter_t"; -static const char __pyx_k_float64[] = "float64"; -static const char __pyx_k_grid_dt[] = "grid_dt"; -static const char __pyx_k_istride[] = "istride"; -static const char __pyx_k_jstride[] = "jstride"; -static const char __pyx_k_nshells[] = "nshells"; -static const char __pyx_k_grid_mask[] = "grid_mask"; -static const char __pyx_k_intersect[] = "intersect"; -static const char __pyx_k_left_edge[] = "left_edge"; -static const char __pyx_k_Transfer1D[] = "Transfer1D"; -static const char __pyx_k_Transfer3D[] = "Transfer3D"; -static const char __pyx_k_ValueError[] = "ValueError"; -static const char __pyx_k_right_edge[] = "right_edge"; -static const char __pyx_k_ImportError[] = "ImportError"; -static const char __pyx_k_intersect_t[] = "intersect_t"; -static const char __pyx_k_RuntimeError[] = "RuntimeError"; -static const char __pyx_k_integrate_ray[] = "integrate_ray"; -static const char __pyx_k_TransferShells[] = "TransferShells"; -static const char __pyx_k_VoxelTraversal[] = "VoxelTraversal"; -static const char __pyx_k_PlaneVoxelIntegration[] = "PlaneVoxelIntegration"; -static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/ray_integrators.pyx"; -static const char __pyx_k_Simle_integrators_for_the_radia[] = "\nSimle integrators for the radiative transfer equation\n\n\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"; -static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; -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_yt_utilities_lib_ray_integrators[] = "yt.utilities.lib.ray_integrators"; -static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; -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_u_Non_native_byte_order_not_suppor; -static PyObject *__pyx_n_s_PlaneVoxelIntegration; -static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_n_s_Transfer1D; -static PyObject *__pyx_n_s_Transfer3D; -static PyObject *__pyx_n_s_TransferShells; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; -static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_n_s_VoxelTraversal; -static PyObject *__pyx_n_s_a; -static PyObject *__pyx_n_s_alpha; -static PyObject *__pyx_n_s_cur_ind; -static PyObject *__pyx_n_s_data; -static PyObject *__pyx_n_s_dims; -static PyObject *__pyx_n_s_dist; -static PyObject *__pyx_n_s_dt; -static PyObject *__pyx_n_s_dtype; -static PyObject *__pyx_n_s_dv; -static PyObject *__pyx_n_s_dx; -static PyObject *__pyx_n_s_e; -static PyObject *__pyx_n_s_empty; -static PyObject *__pyx_n_s_enter_t; -static PyObject *__pyx_n_s_float64; -static PyObject *__pyx_n_s_floor; -static PyObject *__pyx_n_s_grid_dt; -static PyObject *__pyx_n_s_grid_mask; -static PyObject *__pyx_n_s_grid_t; -static PyObject *__pyx_n_s_i; -static PyObject *__pyx_n_s_i_s; -static PyObject *__pyx_n_s_ii; -static PyObject *__pyx_n_s_image; -static PyObject *__pyx_n_s_imax; -static PyObject *__pyx_n_s_imin; -static PyObject *__pyx_n_s_import; -static PyObject *__pyx_n_s_ind; -static PyObject *__pyx_n_s_integrate_ray; -static PyObject *__pyx_n_s_intersect; -static PyObject *__pyx_n_s_intersect_t; -static PyObject *__pyx_n_s_istride; -static PyObject *__pyx_n_s_iv_dir; -static PyObject *__pyx_n_s_j; -static PyObject *__pyx_n_s_jj; -static PyObject *__pyx_n_s_jmax; -static PyObject *__pyx_n_s_jmin; -static PyObject *__pyx_n_s_jstride; -static PyObject *__pyx_n_s_k; -static PyObject *__pyx_n_s_kk; -static PyObject *__pyx_n_s_kmax; -static PyObject *__pyx_n_s_kmin; -static PyObject *__pyx_n_s_left_edge; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_n_s_n; -static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; -static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; -static PyObject *__pyx_n_s_nn; -static PyObject *__pyx_n_s_np; -static PyObject *__pyx_n_s_nshells; -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_nv; -static PyObject *__pyx_n_s_o_s; -static PyObject *__pyx_n_s_range; -static PyObject *__pyx_n_s_rgba; -static PyObject *__pyx_n_s_right_edge; -static PyObject *__pyx_n_s_shells; -static PyObject *__pyx_n_s_step; -static PyObject *__pyx_n_s_tdelta; -static PyObject *__pyx_n_s_temp; -static PyObject *__pyx_n_s_temp_x; -static PyObject *__pyx_n_s_temp_y; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_n_s_tl; -static PyObject *__pyx_n_s_tmax; -static PyObject *__pyx_n_s_tr; -static PyObject *__pyx_n_s_u; -static PyObject *__pyx_n_s_ug; -static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; -static PyObject *__pyx_n_s_v; -static PyObject *__pyx_n_s_vi; -static PyObject *__pyx_n_s_x; -static PyObject *__pyx_n_s_y; -static PyObject *__pyx_n_s_yt_utilities_lib_ray_integrators; -static PyObject *__pyx_pf_2yt_9utilities_3lib_15ray_integrators_Transfer3D(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_i_s, PyArrayObject *__pyx_v_o_s, PyArrayObject *__pyx_v_e, PyArrayObject *__pyx_v_a, int __pyx_v_imin, int __pyx_v_imax, int __pyx_v_jmin, int __pyx_v_jmax, int __pyx_v_kmin, int __pyx_v_kmax, int __pyx_v_istride, int __pyx_v_jstride, __pyx_t_5numpy_float64_t __pyx_v_dx); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_15ray_integrators_2TransferShells(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_i_s, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_shells); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_15ray_integrators_4Transfer1D(CYTHON_UNUSED PyObject *__pyx_self, float __pyx_v_i_s, PyArrayObject *__pyx_v_o_s, PyArrayObject *__pyx_v_e, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_dx, int __pyx_v_imin, int __pyx_v_imax); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_15ray_integrators_6VoxelTraversal(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_grid_mask, PyArrayObject *__pyx_v_grid_t, PyArrayObject *__pyx_v_grid_dt, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_right_edge, PyArrayObject *__pyx_v_dx, PyArrayObject *__pyx_v_u, PyArrayObject *__pyx_v_v); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_15ray_integrators_8PlaneVoxelIntegration(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_right_edge, PyArrayObject *__pyx_v_dx, PyArrayObject *__pyx_v_ug, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_shells); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_3lib_15ray_integrators_10integrate_ray(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_u, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_right_edge, PyArrayObject *__pyx_v_dx, int __pyx_v_nshells, int __pyx_v_ind, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_shells, PyArrayObject *__pyx_v_image); /* proto */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static PyObject *__pyx_int_3; -static PyObject *__pyx_tuple_; -static PyObject *__pyx_tuple__2; -static PyObject *__pyx_tuple__3; -static PyObject *__pyx_tuple__4; -static PyObject *__pyx_tuple__5; -static PyObject *__pyx_tuple__6; -static PyObject *__pyx_tuple__7; -static PyObject *__pyx_tuple__8; -static PyObject *__pyx_tuple__9; -static PyObject *__pyx_tuple__10; -static PyObject *__pyx_tuple__11; -static PyObject *__pyx_tuple__12; -static PyObject *__pyx_tuple__14; -static PyObject *__pyx_tuple__16; -static PyObject *__pyx_tuple__18; -static PyObject *__pyx_tuple__20; -static PyObject *__pyx_tuple__22; -static PyObject *__pyx_codeobj__13; -static PyObject *__pyx_codeobj__15; -static PyObject *__pyx_codeobj__17; -static PyObject *__pyx_codeobj__19; -static PyObject *__pyx_codeobj__21; -static PyObject *__pyx_codeobj__23; - -/* "yt/utilities/lib/ray_integrators.pyx":26 - * - * @cython.boundscheck(False) - * def Transfer3D(np.ndarray[np.float64_t, ndim=3] i_s, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=4] o_s, - * np.ndarray[np.float64_t, ndim=4] e, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_15ray_integrators_1Transfer3D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_2yt_9utilities_3lib_15ray_integrators_Transfer3D[] = "\n This function accepts an incoming slab (*i_s*), a buffer\n for an outgoing set of values at every point in the grid (*o_s*),\n an emission array (*e*), an absorption array (*a*), and dimensions of\n the grid (*imin*, *imax*, *jmin*, *jmax*, *kmin*, *kmax*) as well\n as strides in the *i* and *j* directions, and a *dx* of the grid being\n integrated.\n "; -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_15ray_integrators_1Transfer3D = {"Transfer3D", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15ray_integrators_1Transfer3D, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_9utilities_3lib_15ray_integrators_Transfer3D}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_15ray_integrators_1Transfer3D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_i_s = 0; - PyArrayObject *__pyx_v_o_s = 0; - PyArrayObject *__pyx_v_e = 0; - PyArrayObject *__pyx_v_a = 0; - int __pyx_v_imin; - int __pyx_v_imax; - int __pyx_v_jmin; - int __pyx_v_jmax; - int __pyx_v_kmin; - int __pyx_v_kmax; - int __pyx_v_istride; - int __pyx_v_jstride; - __pyx_t_5numpy_float64_t __pyx_v_dx; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("Transfer3D (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i_s,&__pyx_n_s_o_s,&__pyx_n_s_e,&__pyx_n_s_a,&__pyx_n_s_imin,&__pyx_n_s_imax,&__pyx_n_s_jmin,&__pyx_n_s_jmax,&__pyx_n_s_kmin,&__pyx_n_s_kmax,&__pyx_n_s_istride,&__pyx_n_s_jstride,&__pyx_n_s_dx,0}; - PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); - case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); - case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); - case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_s)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_s)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, 1); __PYX_ERR(0, 26, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, 2); __PYX_ERR(0, 26, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, 3); __PYX_ERR(0, 26, __pyx_L3_error) - } - case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_imin)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, 4); __PYX_ERR(0, 26, __pyx_L3_error) - } - case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_imax)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, 5); __PYX_ERR(0, 26, __pyx_L3_error) - } - case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_jmin)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, 6); __PYX_ERR(0, 26, __pyx_L3_error) - } - case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_jmax)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, 7); __PYX_ERR(0, 26, __pyx_L3_error) - } - case 8: - if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kmin)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, 8); __PYX_ERR(0, 26, __pyx_L3_error) - } - case 9: - if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kmax)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, 9); __PYX_ERR(0, 26, __pyx_L3_error) - } - case 10: - if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_istride)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, 10); __PYX_ERR(0, 26, __pyx_L3_error) - } - case 11: - if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_jstride)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, 11); __PYX_ERR(0, 26, __pyx_L3_error) - } - case 12: - if (likely((values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, 12); __PYX_ERR(0, 26, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Transfer3D") < 0)) __PYX_ERR(0, 26, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 13) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - values[10] = PyTuple_GET_ITEM(__pyx_args, 10); - values[11] = PyTuple_GET_ITEM(__pyx_args, 11); - values[12] = PyTuple_GET_ITEM(__pyx_args, 12); - } - __pyx_v_i_s = ((PyArrayObject *)values[0]); - __pyx_v_o_s = ((PyArrayObject *)values[1]); - __pyx_v_e = ((PyArrayObject *)values[2]); - __pyx_v_a = ((PyArrayObject *)values[3]); - __pyx_v_imin = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_imin == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error) - __pyx_v_imax = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_imax == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error) - __pyx_v_jmin = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_jmin == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error) - __pyx_v_jmax = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_jmax == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error) - __pyx_v_kmin = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_kmin == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error) - __pyx_v_kmax = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_kmax == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error) - __pyx_v_istride = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_istride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error) - __pyx_v_jstride = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_jstride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error) - __pyx_v_dx = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_dx == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("Transfer3D", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 26, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.ray_integrators.Transfer3D", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_i_s), __pyx_ptype_5numpy_ndarray, 1, "i_s", 0))) __PYX_ERR(0, 26, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_o_s), __pyx_ptype_5numpy_ndarray, 1, "o_s", 0))) __PYX_ERR(0, 27, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_e), __pyx_ptype_5numpy_ndarray, 1, "e", 0))) __PYX_ERR(0, 28, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 29, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_15ray_integrators_Transfer3D(__pyx_self, __pyx_v_i_s, __pyx_v_o_s, __pyx_v_e, __pyx_v_a, __pyx_v_imin, __pyx_v_imax, __pyx_v_jmin, __pyx_v_jmax, __pyx_v_kmin, __pyx_v_kmax, __pyx_v_istride, __pyx_v_jstride, __pyx_v_dx); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_3lib_15ray_integrators_Transfer3D(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_i_s, PyArrayObject *__pyx_v_o_s, PyArrayObject *__pyx_v_e, PyArrayObject *__pyx_v_a, int __pyx_v_imin, int __pyx_v_imax, int __pyx_v_jmin, int __pyx_v_jmax, int __pyx_v_kmin, int __pyx_v_kmax, int __pyx_v_istride, int __pyx_v_jstride, __pyx_t_5numpy_float64_t __pyx_v_dx) { - int __pyx_v_i; - int __pyx_v_ii; - int __pyx_v_j; - int __pyx_v_jj; - int __pyx_v_k; - int __pyx_v_n; - int __pyx_v_nn; - __pyx_t_5numpy_float64_t *__pyx_v_temp; - __Pyx_LocalBuf_ND __pyx_pybuffernd_a; - __Pyx_Buffer __pyx_pybuffer_a; - __Pyx_LocalBuf_ND __pyx_pybuffernd_e; - __Pyx_Buffer __pyx_pybuffer_e; - __Pyx_LocalBuf_ND __pyx_pybuffernd_i_s; - __Pyx_Buffer __pyx_pybuffer_i_s; - __Pyx_LocalBuf_ND __pyx_pybuffernd_o_s; - __Pyx_Buffer __pyx_pybuffer_o_s; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; - Py_ssize_t __pyx_t_8; - Py_ssize_t __pyx_t_9; - int __pyx_t_10; - 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; - Py_ssize_t __pyx_t_26; - Py_ssize_t __pyx_t_27; - Py_ssize_t __pyx_t_28; - Py_ssize_t __pyx_t_29; - Py_ssize_t __pyx_t_30; - __Pyx_RefNannySetupContext("Transfer3D", 0); - __pyx_pybuffer_i_s.pybuffer.buf = NULL; - __pyx_pybuffer_i_s.refcount = 0; - __pyx_pybuffernd_i_s.data = NULL; - __pyx_pybuffernd_i_s.rcbuffer = &__pyx_pybuffer_i_s; - __pyx_pybuffer_o_s.pybuffer.buf = NULL; - __pyx_pybuffer_o_s.refcount = 0; - __pyx_pybuffernd_o_s.data = NULL; - __pyx_pybuffernd_o_s.rcbuffer = &__pyx_pybuffer_o_s; - __pyx_pybuffer_e.pybuffer.buf = NULL; - __pyx_pybuffer_e.refcount = 0; - __pyx_pybuffernd_e.data = NULL; - __pyx_pybuffernd_e.rcbuffer = &__pyx_pybuffer_e; - __pyx_pybuffer_a.pybuffer.buf = NULL; - __pyx_pybuffer_a.refcount = 0; - __pyx_pybuffernd_a.data = NULL; - __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_i_s.rcbuffer->pybuffer, (PyObject*)__pyx_v_i_s, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 26, __pyx_L1_error) - } - __pyx_pybuffernd_i_s.diminfo[0].strides = __pyx_pybuffernd_i_s.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_i_s.diminfo[0].shape = __pyx_pybuffernd_i_s.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_i_s.diminfo[1].strides = __pyx_pybuffernd_i_s.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_i_s.diminfo[1].shape = __pyx_pybuffernd_i_s.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_i_s.diminfo[2].strides = __pyx_pybuffernd_i_s.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_i_s.diminfo[2].shape = __pyx_pybuffernd_i_s.rcbuffer->pybuffer.shape[2]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_o_s.rcbuffer->pybuffer, (PyObject*)__pyx_v_o_s, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 26, __pyx_L1_error) - } - __pyx_pybuffernd_o_s.diminfo[0].strides = __pyx_pybuffernd_o_s.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_o_s.diminfo[0].shape = __pyx_pybuffernd_o_s.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_o_s.diminfo[1].strides = __pyx_pybuffernd_o_s.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_o_s.diminfo[1].shape = __pyx_pybuffernd_o_s.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_o_s.diminfo[2].strides = __pyx_pybuffernd_o_s.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_o_s.diminfo[2].shape = __pyx_pybuffernd_o_s.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_o_s.diminfo[3].strides = __pyx_pybuffernd_o_s.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_o_s.diminfo[3].shape = __pyx_pybuffernd_o_s.rcbuffer->pybuffer.shape[3]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_e.rcbuffer->pybuffer, (PyObject*)__pyx_v_e, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 26, __pyx_L1_error) - } - __pyx_pybuffernd_e.diminfo[0].strides = __pyx_pybuffernd_e.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_e.diminfo[0].shape = __pyx_pybuffernd_e.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_e.diminfo[1].strides = __pyx_pybuffernd_e.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_e.diminfo[1].shape = __pyx_pybuffernd_e.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_e.diminfo[2].strides = __pyx_pybuffernd_e.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_e.diminfo[2].shape = __pyx_pybuffernd_e.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_e.diminfo[3].strides = __pyx_pybuffernd_e.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_e.diminfo[3].shape = __pyx_pybuffernd_e.rcbuffer->pybuffer.shape[3]; - { - __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, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 26, __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_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_a.diminfo[2].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_a.diminfo[2].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_a.diminfo[3].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_a.diminfo[3].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[3]; - - /* "yt/utilities/lib/ray_integrators.pyx":45 - * cdef int k - * cdef int n, nn - * nn = o_s.shape[3] # This might be slow # <<<<<<<<<<<<<< - * cdef np.float64_t *temp = malloc(sizeof(np.float64_t) * nn) - * for i in range((imax-imin)*istride): - */ - __pyx_v_nn = (__pyx_v_o_s->dimensions[3]); - - /* "yt/utilities/lib/ray_integrators.pyx":46 - * cdef int n, nn - * nn = o_s.shape[3] # This might be slow - * cdef np.float64_t *temp = malloc(sizeof(np.float64_t) * nn) # <<<<<<<<<<<<<< - * for i in range((imax-imin)*istride): - * ii = i + imin*istride - */ - __pyx_v_temp = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_nn))); - - /* "yt/utilities/lib/ray_integrators.pyx":47 - * nn = o_s.shape[3] # This might be slow - * cdef np.float64_t *temp = malloc(sizeof(np.float64_t) * nn) - * for i in range((imax-imin)*istride): # <<<<<<<<<<<<<< - * ii = i + imin*istride - * for j in range((jmax-jmin)*jstride): - */ - __pyx_t_1 = ((__pyx_v_imax - __pyx_v_imin) * __pyx_v_istride); - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; - - /* "yt/utilities/lib/ray_integrators.pyx":48 - * cdef np.float64_t *temp = malloc(sizeof(np.float64_t) * nn) - * for i in range((imax-imin)*istride): - * ii = i + imin*istride # <<<<<<<<<<<<<< - * for j in range((jmax-jmin)*jstride): - * jj = j + jmin*jstride - */ - __pyx_v_ii = (__pyx_v_i + (__pyx_v_imin * __pyx_v_istride)); - - /* "yt/utilities/lib/ray_integrators.pyx":49 - * for i in range((imax-imin)*istride): - * ii = i + imin*istride - * for j in range((jmax-jmin)*jstride): # <<<<<<<<<<<<<< - * jj = j + jmin*jstride - * # Not sure about the ordering of the loops here - */ - __pyx_t_3 = ((__pyx_v_jmax - __pyx_v_jmin) * __pyx_v_jstride); - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_j = __pyx_t_4; - - /* "yt/utilities/lib/ray_integrators.pyx":50 - * ii = i + imin*istride - * for j in range((jmax-jmin)*jstride): - * jj = j + jmin*jstride # <<<<<<<<<<<<<< - * # Not sure about the ordering of the loops here - * for n in range(nn): - */ - __pyx_v_jj = (__pyx_v_j + (__pyx_v_jmin * __pyx_v_jstride)); - - /* "yt/utilities/lib/ray_integrators.pyx":52 - * jj = j + jmin*jstride - * # Not sure about the ordering of the loops here - * for n in range(nn): # <<<<<<<<<<<<<< - * temp[n] = i_s[ii,jj,n] - * for k in range(kmax-kmin): - */ - __pyx_t_5 = __pyx_v_nn; - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { - __pyx_v_n = __pyx_t_6; - - /* "yt/utilities/lib/ray_integrators.pyx":53 - * # Not sure about the ordering of the loops here - * for n in range(nn): - * temp[n] = i_s[ii,jj,n] # <<<<<<<<<<<<<< - * for k in range(kmax-kmin): - * for n in range(nn): - */ - __pyx_t_7 = __pyx_v_ii; - __pyx_t_8 = __pyx_v_jj; - __pyx_t_9 = __pyx_v_n; - if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_pybuffernd_i_s.diminfo[0].shape; - if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_pybuffernd_i_s.diminfo[1].shape; - if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_pybuffernd_i_s.diminfo[2].shape; - (__pyx_v_temp[__pyx_v_n]) = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_i_s.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_i_s.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_i_s.diminfo[1].strides, __pyx_t_9, __pyx_pybuffernd_i_s.diminfo[2].strides)); - } - - /* "yt/utilities/lib/ray_integrators.pyx":54 - * for n in range(nn): - * temp[n] = i_s[ii,jj,n] - * for k in range(kmax-kmin): # <<<<<<<<<<<<<< - * for n in range(nn): - * o_s[i,j,k,n] = temp[n] + dx*(e[i,j,k,n] - temp[n]*a[i,j,k,n]) - */ - __pyx_t_5 = (__pyx_v_kmax - __pyx_v_kmin); - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { - __pyx_v_k = __pyx_t_6; - - /* "yt/utilities/lib/ray_integrators.pyx":55 - * temp[n] = i_s[ii,jj,n] - * for k in range(kmax-kmin): - * for n in range(nn): # <<<<<<<<<<<<<< - * o_s[i,j,k,n] = temp[n] + dx*(e[i,j,k,n] - temp[n]*a[i,j,k,n]) - * temp[n] = o_s[i,j,k,n] - */ - __pyx_t_10 = __pyx_v_nn; - for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { - __pyx_v_n = __pyx_t_11; - - /* "yt/utilities/lib/ray_integrators.pyx":56 - * for k in range(kmax-kmin): - * for n in range(nn): - * o_s[i,j,k,n] = temp[n] + dx*(e[i,j,k,n] - temp[n]*a[i,j,k,n]) # <<<<<<<<<<<<<< - * temp[n] = o_s[i,j,k,n] - * for n in range(nn): - */ - __pyx_t_12 = __pyx_v_i; - __pyx_t_13 = __pyx_v_j; - __pyx_t_14 = __pyx_v_k; - __pyx_t_15 = __pyx_v_n; - if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_pybuffernd_e.diminfo[0].shape; - if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_e.diminfo[1].shape; - if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_e.diminfo[2].shape; - if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_e.diminfo[3].shape; - __pyx_t_16 = __pyx_v_i; - __pyx_t_17 = __pyx_v_j; - __pyx_t_18 = __pyx_v_k; - __pyx_t_19 = __pyx_v_n; - if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_a.diminfo[0].shape; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_a.diminfo[1].shape; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_a.diminfo[2].shape; - if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_a.diminfo[3].shape; - __pyx_t_20 = __pyx_v_i; - __pyx_t_21 = __pyx_v_j; - __pyx_t_22 = __pyx_v_k; - __pyx_t_23 = __pyx_v_n; - if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_pybuffernd_o_s.diminfo[0].shape; - if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_o_s.diminfo[1].shape; - if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_o_s.diminfo[2].shape; - if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_o_s.diminfo[3].shape; - *__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_o_s.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_o_s.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_o_s.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_o_s.diminfo[2].strides, __pyx_t_23, __pyx_pybuffernd_o_s.diminfo[3].strides) = ((__pyx_v_temp[__pyx_v_n]) + (__pyx_v_dx * ((*__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_e.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_e.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_e.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_e.diminfo[2].strides, __pyx_t_15, __pyx_pybuffernd_e.diminfo[3].strides)) - ((__pyx_v_temp[__pyx_v_n]) * (*__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_a.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_a.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_a.diminfo[3].strides)))))); - - /* "yt/utilities/lib/ray_integrators.pyx":57 - * for n in range(nn): - * o_s[i,j,k,n] = temp[n] + dx*(e[i,j,k,n] - temp[n]*a[i,j,k,n]) - * temp[n] = o_s[i,j,k,n] # <<<<<<<<<<<<<< - * for n in range(nn): - * i_s[ii,jj,n] = temp[n] - */ - __pyx_t_24 = __pyx_v_i; - __pyx_t_25 = __pyx_v_j; - __pyx_t_26 = __pyx_v_k; - __pyx_t_27 = __pyx_v_n; - if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_pybuffernd_o_s.diminfo[0].shape; - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_pybuffernd_o_s.diminfo[1].shape; - if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_pybuffernd_o_s.diminfo[2].shape; - if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_pybuffernd_o_s.diminfo[3].shape; - (__pyx_v_temp[__pyx_v_n]) = (*__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_o_s.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_o_s.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_o_s.diminfo[1].strides, __pyx_t_26, __pyx_pybuffernd_o_s.diminfo[2].strides, __pyx_t_27, __pyx_pybuffernd_o_s.diminfo[3].strides)); - } - } - - /* "yt/utilities/lib/ray_integrators.pyx":58 - * o_s[i,j,k,n] = temp[n] + dx*(e[i,j,k,n] - temp[n]*a[i,j,k,n]) - * temp[n] = o_s[i,j,k,n] - * for n in range(nn): # <<<<<<<<<<<<<< - * i_s[ii,jj,n] = temp[n] - * free(temp) - */ - __pyx_t_5 = __pyx_v_nn; - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { - __pyx_v_n = __pyx_t_6; - - /* "yt/utilities/lib/ray_integrators.pyx":59 - * temp[n] = o_s[i,j,k,n] - * for n in range(nn): - * i_s[ii,jj,n] = temp[n] # <<<<<<<<<<<<<< - * free(temp) - * - */ - __pyx_t_28 = __pyx_v_ii; - __pyx_t_29 = __pyx_v_jj; - __pyx_t_30 = __pyx_v_n; - if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_pybuffernd_i_s.diminfo[0].shape; - if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_pybuffernd_i_s.diminfo[1].shape; - if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_pybuffernd_i_s.diminfo[2].shape; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_i_s.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_i_s.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_i_s.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_i_s.diminfo[2].strides) = (__pyx_v_temp[__pyx_v_n]); - } - } - } - - /* "yt/utilities/lib/ray_integrators.pyx":60 - * for n in range(nn): - * i_s[ii,jj,n] = temp[n] - * free(temp) # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) - */ - free(__pyx_v_temp); - - /* "yt/utilities/lib/ray_integrators.pyx":26 - * - * @cython.boundscheck(False) - * def Transfer3D(np.ndarray[np.float64_t, ndim=3] i_s, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=4] o_s, - * np.ndarray[np.float64_t, ndim=4] e, - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_e.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_s.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_o_s.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.ray_integrators.Transfer3D", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_e.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_s.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_o_s.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/lib/ray_integrators.pyx":63 - * - * @cython.boundscheck(False) - * def TransferShells(np.ndarray[np.float64_t, ndim=3] i_s, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=3] data, - * np.ndarray[np.float64_t, ndim=2] shells): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_15ray_integrators_3TransferShells(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_2yt_9utilities_3lib_15ray_integrators_2TransferShells[] = "\n This function accepts an incoming slab (*i_s*), a buffer of *data*,\n and a list of shells specified as [ (value, tolerance, r, g, b), ... ].\n "; -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_15ray_integrators_3TransferShells = {"TransferShells", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15ray_integrators_3TransferShells, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_9utilities_3lib_15ray_integrators_2TransferShells}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_15ray_integrators_3TransferShells(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_i_s = 0; - PyArrayObject *__pyx_v_data = 0; - PyArrayObject *__pyx_v_shells = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("TransferShells (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i_s,&__pyx_n_s_data,&__pyx_n_s_shells,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_s)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("TransferShells", 1, 3, 3, 1); __PYX_ERR(0, 63, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shells)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("TransferShells", 1, 3, 3, 2); __PYX_ERR(0, 63, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TransferShells") < 0)) __PYX_ERR(0, 63, __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_i_s = ((PyArrayObject *)values[0]); - __pyx_v_data = ((PyArrayObject *)values[1]); - __pyx_v_shells = ((PyArrayObject *)values[2]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("TransferShells", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.ray_integrators.TransferShells", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_i_s), __pyx_ptype_5numpy_ndarray, 1, "i_s", 0))) __PYX_ERR(0, 63, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 64, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shells), __pyx_ptype_5numpy_ndarray, 1, "shells", 0))) __PYX_ERR(0, 65, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_15ray_integrators_2TransferShells(__pyx_self, __pyx_v_i_s, __pyx_v_data, __pyx_v_shells); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_3lib_15ray_integrators_2TransferShells(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_i_s, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_shells) { - int __pyx_v_i; - int __pyx_v_ii; - int __pyx_v_j; - int __pyx_v_jj; - int __pyx_v_k; - int __pyx_v_kk; - int __pyx_v_n; - int __pyx_v_nn; - __pyx_t_5numpy_float64_t __pyx_v_dist; - float __pyx_v_rgba[4]; - float __pyx_v_alpha; - __Pyx_LocalBuf_ND __pyx_pybuffernd_data; - __Pyx_Buffer __pyx_pybuffer_data; - __Pyx_LocalBuf_ND __pyx_pybuffernd_i_s; - __Pyx_Buffer __pyx_pybuffer_i_s; - __Pyx_LocalBuf_ND __pyx_pybuffernd_shells; - __Pyx_Buffer __pyx_pybuffer_shells; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - Py_ssize_t __pyx_t_9; - Py_ssize_t __pyx_t_10; - Py_ssize_t __pyx_t_11; - Py_ssize_t __pyx_t_12; - Py_ssize_t __pyx_t_13; - 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; - 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; - Py_ssize_t __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; - Py_ssize_t __pyx_t_35; - Py_ssize_t __pyx_t_36; - Py_ssize_t __pyx_t_37; - Py_ssize_t __pyx_t_38; - Py_ssize_t __pyx_t_39; - __Pyx_RefNannySetupContext("TransferShells", 0); - __pyx_pybuffer_i_s.pybuffer.buf = NULL; - __pyx_pybuffer_i_s.refcount = 0; - __pyx_pybuffernd_i_s.data = NULL; - __pyx_pybuffernd_i_s.rcbuffer = &__pyx_pybuffer_i_s; - __pyx_pybuffer_data.pybuffer.buf = NULL; - __pyx_pybuffer_data.refcount = 0; - __pyx_pybuffernd_data.data = NULL; - __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; - __pyx_pybuffer_shells.pybuffer.buf = NULL; - __pyx_pybuffer_shells.refcount = 0; - __pyx_pybuffernd_shells.data = NULL; - __pyx_pybuffernd_shells.rcbuffer = &__pyx_pybuffer_shells; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_i_s.rcbuffer->pybuffer, (PyObject*)__pyx_v_i_s, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 63, __pyx_L1_error) - } - __pyx_pybuffernd_i_s.diminfo[0].strides = __pyx_pybuffernd_i_s.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_i_s.diminfo[0].shape = __pyx_pybuffernd_i_s.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_i_s.diminfo[1].strides = __pyx_pybuffernd_i_s.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_i_s.diminfo[1].shape = __pyx_pybuffernd_i_s.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_i_s.diminfo[2].strides = __pyx_pybuffernd_i_s.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_i_s.diminfo[2].shape = __pyx_pybuffernd_i_s.rcbuffer->pybuffer.shape[2]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 63, __pyx_L1_error) - } - __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_data.diminfo[2].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_data.diminfo[2].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[2]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_shells.rcbuffer->pybuffer, (PyObject*)__pyx_v_shells, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 63, __pyx_L1_error) - } - __pyx_pybuffernd_shells.diminfo[0].strides = __pyx_pybuffernd_shells.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_shells.diminfo[0].shape = __pyx_pybuffernd_shells.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_shells.diminfo[1].strides = __pyx_pybuffernd_shells.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_shells.diminfo[1].shape = __pyx_pybuffernd_shells.rcbuffer->pybuffer.shape[1]; - - /* "yt/utilities/lib/ray_integrators.pyx":75 - * cdef int n, nn - * cdef np.float64_t dist - * ii = data.shape[0] # <<<<<<<<<<<<<< - * jj = data.shape[1] - * kk = data.shape[2] - */ - __pyx_v_ii = (__pyx_v_data->dimensions[0]); - - /* "yt/utilities/lib/ray_integrators.pyx":76 - * cdef np.float64_t dist - * ii = data.shape[0] - * jj = data.shape[1] # <<<<<<<<<<<<<< - * kk = data.shape[2] - * nn = shells.shape[0] - */ - __pyx_v_jj = (__pyx_v_data->dimensions[1]); - - /* "yt/utilities/lib/ray_integrators.pyx":77 - * ii = data.shape[0] - * jj = data.shape[1] - * kk = data.shape[2] # <<<<<<<<<<<<<< - * nn = shells.shape[0] - * cdef float rgba[4] - */ - __pyx_v_kk = (__pyx_v_data->dimensions[2]); - - /* "yt/utilities/lib/ray_integrators.pyx":78 - * jj = data.shape[1] - * kk = data.shape[2] - * nn = shells.shape[0] # <<<<<<<<<<<<<< - * cdef float rgba[4] - * cdef float alpha - */ - __pyx_v_nn = (__pyx_v_shells->dimensions[0]); - - /* "yt/utilities/lib/ray_integrators.pyx":81 - * cdef float rgba[4] - * cdef float alpha - * for i in range(ii): # <<<<<<<<<<<<<< - * for j in range(jj): - * # Not sure about the ordering of the loops here - */ - __pyx_t_1 = __pyx_v_ii; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; - - /* "yt/utilities/lib/ray_integrators.pyx":82 - * cdef float alpha - * for i in range(ii): - * for j in range(jj): # <<<<<<<<<<<<<< - * # Not sure about the ordering of the loops here - * for k in range(kk): - */ - __pyx_t_3 = __pyx_v_jj; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_j = __pyx_t_4; - - /* "yt/utilities/lib/ray_integrators.pyx":84 - * for j in range(jj): - * # Not sure about the ordering of the loops here - * for k in range(kk): # <<<<<<<<<<<<<< - * for n in range(nn): - * dist = shells[n, 0] - data[i,j,k] - */ - __pyx_t_5 = __pyx_v_kk; - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { - __pyx_v_k = __pyx_t_6; - - /* "yt/utilities/lib/ray_integrators.pyx":85 - * # Not sure about the ordering of the loops here - * for k in range(kk): - * for n in range(nn): # <<<<<<<<<<<<<< - * dist = shells[n, 0] - data[i,j,k] - * if dist < 0: dist *= -1.0 - */ - __pyx_t_7 = __pyx_v_nn; - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { - __pyx_v_n = __pyx_t_8; - - /* "yt/utilities/lib/ray_integrators.pyx":86 - * for k in range(kk): - * for n in range(nn): - * dist = shells[n, 0] - data[i,j,k] # <<<<<<<<<<<<<< - * if dist < 0: dist *= -1.0 - * if dist < shells[n,1]: - */ - __pyx_t_9 = __pyx_v_n; - __pyx_t_10 = 0; - if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_pybuffernd_shells.diminfo[0].shape; - if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_pybuffernd_shells.diminfo[1].shape; - __pyx_t_11 = __pyx_v_i; - __pyx_t_12 = __pyx_v_j; - __pyx_t_13 = __pyx_v_k; - if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_pybuffernd_data.diminfo[0].shape; - if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_pybuffernd_data.diminfo[1].shape; - if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_data.diminfo[2].shape; - __pyx_v_dist = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_shells.diminfo[1].strides)) - (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_data.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_data.diminfo[2].strides))); - - /* "yt/utilities/lib/ray_integrators.pyx":87 - * for n in range(nn): - * dist = shells[n, 0] - data[i,j,k] - * if dist < 0: dist *= -1.0 # <<<<<<<<<<<<<< - * if dist < shells[n,1]: - * dist = exp(-dist/8.0) - */ - __pyx_t_14 = ((__pyx_v_dist < 0.0) != 0); - if (__pyx_t_14) { - __pyx_v_dist = (__pyx_v_dist * -1.0); - } - - /* "yt/utilities/lib/ray_integrators.pyx":88 - * dist = shells[n, 0] - data[i,j,k] - * if dist < 0: dist *= -1.0 - * if dist < shells[n,1]: # <<<<<<<<<<<<<< - * dist = exp(-dist/8.0) - * rgba[0] = shells[n,2] - */ - __pyx_t_15 = __pyx_v_n; - __pyx_t_16 = 1; - if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_shells.diminfo[0].shape; - if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_shells.diminfo[1].shape; - __pyx_t_14 = ((__pyx_v_dist < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_shells.diminfo[1].strides))) != 0); - if (__pyx_t_14) { - - /* "yt/utilities/lib/ray_integrators.pyx":89 - * if dist < 0: dist *= -1.0 - * if dist < shells[n,1]: - * dist = exp(-dist/8.0) # <<<<<<<<<<<<<< - * rgba[0] = shells[n,2] - * rgba[1] = shells[n,3] - */ - __pyx_v_dist = exp(((-__pyx_v_dist) / 8.0)); - - /* "yt/utilities/lib/ray_integrators.pyx":90 - * if dist < shells[n,1]: - * dist = exp(-dist/8.0) - * rgba[0] = shells[n,2] # <<<<<<<<<<<<<< - * rgba[1] = shells[n,3] - * rgba[2] = shells[n,4] - */ - __pyx_t_17 = __pyx_v_n; - __pyx_t_18 = 2; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_shells.diminfo[0].shape; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_shells.diminfo[1].shape; - (__pyx_v_rgba[0]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_shells.diminfo[1].strides)); - - /* "yt/utilities/lib/ray_integrators.pyx":91 - * dist = exp(-dist/8.0) - * rgba[0] = shells[n,2] - * rgba[1] = shells[n,3] # <<<<<<<<<<<<<< - * rgba[2] = shells[n,4] - * rgba[3] = shells[n,5] - */ - __pyx_t_19 = __pyx_v_n; - __pyx_t_20 = 3; - if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_shells.diminfo[0].shape; - if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_pybuffernd_shells.diminfo[1].shape; - (__pyx_v_rgba[1]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_shells.diminfo[1].strides)); - - /* "yt/utilities/lib/ray_integrators.pyx":92 - * rgba[0] = shells[n,2] - * rgba[1] = shells[n,3] - * rgba[2] = shells[n,4] # <<<<<<<<<<<<<< - * rgba[3] = shells[n,5] - * alpha = i_s[i,j,3] - */ - __pyx_t_21 = __pyx_v_n; - __pyx_t_22 = 4; - if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_shells.diminfo[0].shape; - if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_shells.diminfo[1].shape; - (__pyx_v_rgba[2]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_shells.diminfo[1].strides)); - - /* "yt/utilities/lib/ray_integrators.pyx":93 - * rgba[1] = shells[n,3] - * rgba[2] = shells[n,4] - * rgba[3] = shells[n,5] # <<<<<<<<<<<<<< - * alpha = i_s[i,j,3] - * dist *= dist # This might improve appearance - */ - __pyx_t_23 = __pyx_v_n; - __pyx_t_24 = 5; - if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_shells.diminfo[0].shape; - if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_pybuffernd_shells.diminfo[1].shape; - (__pyx_v_rgba[3]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_shells.diminfo[1].strides)); - - /* "yt/utilities/lib/ray_integrators.pyx":94 - * rgba[2] = shells[n,4] - * rgba[3] = shells[n,5] - * alpha = i_s[i,j,3] # <<<<<<<<<<<<<< - * dist *= dist # This might improve appearance - * i_s[i,j,0] += (1.0 - alpha)*rgba[0]*dist*rgba[3] - */ - __pyx_t_25 = __pyx_v_i; - __pyx_t_26 = __pyx_v_j; - __pyx_t_27 = 3; - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_pybuffernd_i_s.diminfo[0].shape; - if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_pybuffernd_i_s.diminfo[1].shape; - if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_pybuffernd_i_s.diminfo[2].shape; - __pyx_v_alpha = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_i_s.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_i_s.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_i_s.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_i_s.diminfo[2].strides)); - - /* "yt/utilities/lib/ray_integrators.pyx":95 - * rgba[3] = shells[n,5] - * alpha = i_s[i,j,3] - * dist *= dist # This might improve appearance # <<<<<<<<<<<<<< - * i_s[i,j,0] += (1.0 - alpha)*rgba[0]*dist*rgba[3] - * i_s[i,j,1] += (1.0 - alpha)*rgba[1]*dist*rgba[3] - */ - __pyx_v_dist = (__pyx_v_dist * __pyx_v_dist); - - /* "yt/utilities/lib/ray_integrators.pyx":96 - * alpha = i_s[i,j,3] - * dist *= dist # This might improve appearance - * i_s[i,j,0] += (1.0 - alpha)*rgba[0]*dist*rgba[3] # <<<<<<<<<<<<<< - * i_s[i,j,1] += (1.0 - alpha)*rgba[1]*dist*rgba[3] - * i_s[i,j,2] += (1.0 - alpha)*rgba[2]*dist*rgba[3] - */ - __pyx_t_28 = __pyx_v_i; - __pyx_t_29 = __pyx_v_j; - __pyx_t_30 = 0; - if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_pybuffernd_i_s.diminfo[0].shape; - if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_pybuffernd_i_s.diminfo[1].shape; - if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_pybuffernd_i_s.diminfo[2].shape; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_i_s.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_i_s.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_i_s.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_i_s.diminfo[2].strides) += ((((1.0 - __pyx_v_alpha) * (__pyx_v_rgba[0])) * __pyx_v_dist) * (__pyx_v_rgba[3])); - - /* "yt/utilities/lib/ray_integrators.pyx":97 - * dist *= dist # This might improve appearance - * i_s[i,j,0] += (1.0 - alpha)*rgba[0]*dist*rgba[3] - * i_s[i,j,1] += (1.0 - alpha)*rgba[1]*dist*rgba[3] # <<<<<<<<<<<<<< - * i_s[i,j,2] += (1.0 - alpha)*rgba[2]*dist*rgba[3] - * i_s[i,j,3] += (1.0 - alpha)*rgba[3]*dist*rgba[3] - */ - __pyx_t_31 = __pyx_v_i; - __pyx_t_32 = __pyx_v_j; - __pyx_t_33 = 1; - if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_pybuffernd_i_s.diminfo[0].shape; - if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_pybuffernd_i_s.diminfo[1].shape; - if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_pybuffernd_i_s.diminfo[2].shape; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_i_s.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_i_s.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_i_s.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_i_s.diminfo[2].strides) += ((((1.0 - __pyx_v_alpha) * (__pyx_v_rgba[1])) * __pyx_v_dist) * (__pyx_v_rgba[3])); - - /* "yt/utilities/lib/ray_integrators.pyx":98 - * i_s[i,j,0] += (1.0 - alpha)*rgba[0]*dist*rgba[3] - * i_s[i,j,1] += (1.0 - alpha)*rgba[1]*dist*rgba[3] - * i_s[i,j,2] += (1.0 - alpha)*rgba[2]*dist*rgba[3] # <<<<<<<<<<<<<< - * i_s[i,j,3] += (1.0 - alpha)*rgba[3]*dist*rgba[3] - * break - */ - __pyx_t_34 = __pyx_v_i; - __pyx_t_35 = __pyx_v_j; - __pyx_t_36 = 2; - if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_pybuffernd_i_s.diminfo[0].shape; - if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_pybuffernd_i_s.diminfo[1].shape; - if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_pybuffernd_i_s.diminfo[2].shape; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_i_s.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_i_s.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_i_s.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_i_s.diminfo[2].strides) += ((((1.0 - __pyx_v_alpha) * (__pyx_v_rgba[2])) * __pyx_v_dist) * (__pyx_v_rgba[3])); - - /* "yt/utilities/lib/ray_integrators.pyx":99 - * i_s[i,j,1] += (1.0 - alpha)*rgba[1]*dist*rgba[3] - * i_s[i,j,2] += (1.0 - alpha)*rgba[2]*dist*rgba[3] - * i_s[i,j,3] += (1.0 - alpha)*rgba[3]*dist*rgba[3] # <<<<<<<<<<<<<< - * break - * - */ - __pyx_t_37 = __pyx_v_i; - __pyx_t_38 = __pyx_v_j; - __pyx_t_39 = 3; - if (__pyx_t_37 < 0) __pyx_t_37 += __pyx_pybuffernd_i_s.diminfo[0].shape; - if (__pyx_t_38 < 0) __pyx_t_38 += __pyx_pybuffernd_i_s.diminfo[1].shape; - if (__pyx_t_39 < 0) __pyx_t_39 += __pyx_pybuffernd_i_s.diminfo[2].shape; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_i_s.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_i_s.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_i_s.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_i_s.diminfo[2].strides) += ((((1.0 - __pyx_v_alpha) * (__pyx_v_rgba[3])) * __pyx_v_dist) * (__pyx_v_rgba[3])); - - /* "yt/utilities/lib/ray_integrators.pyx":100 - * i_s[i,j,2] += (1.0 - alpha)*rgba[2]*dist*rgba[3] - * i_s[i,j,3] += (1.0 - alpha)*rgba[3]*dist*rgba[3] - * break # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) - */ - goto __pyx_L10_break; - - /* "yt/utilities/lib/ray_integrators.pyx":88 - * dist = shells[n, 0] - data[i,j,k] - * if dist < 0: dist *= -1.0 - * if dist < shells[n,1]: # <<<<<<<<<<<<<< - * dist = exp(-dist/8.0) - * rgba[0] = shells[n,2] - */ - } - } - __pyx_L10_break:; - } - } - } - - /* "yt/utilities/lib/ray_integrators.pyx":63 - * - * @cython.boundscheck(False) - * def TransferShells(np.ndarray[np.float64_t, ndim=3] i_s, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=3] data, - * np.ndarray[np.float64_t, ndim=2] shells): - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_s.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_shells.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.ray_integrators.TransferShells", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_s.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_shells.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/lib/ray_integrators.pyx":103 - * - * @cython.boundscheck(False) - * def Transfer1D(float i_s, # <<<<<<<<<<<<<< - * np.ndarray[np.float_t, ndim=1] o_s, - * np.ndarray[np.float_t, ndim=1] e, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_15ray_integrators_5Transfer1D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_15ray_integrators_5Transfer1D = {"Transfer1D", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15ray_integrators_5Transfer1D, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_15ray_integrators_5Transfer1D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - float __pyx_v_i_s; - PyArrayObject *__pyx_v_o_s = 0; - PyArrayObject *__pyx_v_e = 0; - PyArrayObject *__pyx_v_a = 0; - PyArrayObject *__pyx_v_dx = 0; - int __pyx_v_imin; - int __pyx_v_imax; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("Transfer1D (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i_s,&__pyx_n_s_o_s,&__pyx_n_s_e,&__pyx_n_s_a,&__pyx_n_s_dx,&__pyx_n_s_imin,&__pyx_n_s_imax,0}; - PyObject* values[7] = {0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_s)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_s)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer1D", 1, 7, 7, 1); __PYX_ERR(0, 103, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer1D", 1, 7, 7, 2); __PYX_ERR(0, 103, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer1D", 1, 7, 7, 3); __PYX_ERR(0, 103, __pyx_L3_error) - } - case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer1D", 1, 7, 7, 4); __PYX_ERR(0, 103, __pyx_L3_error) - } - case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_imin)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer1D", 1, 7, 7, 5); __PYX_ERR(0, 103, __pyx_L3_error) - } - case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_imax)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Transfer1D", 1, 7, 7, 6); __PYX_ERR(0, 103, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Transfer1D") < 0)) __PYX_ERR(0, 103, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - } - __pyx_v_i_s = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_i_s == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error) - __pyx_v_o_s = ((PyArrayObject *)values[1]); - __pyx_v_e = ((PyArrayObject *)values[2]); - __pyx_v_a = ((PyArrayObject *)values[3]); - __pyx_v_dx = ((PyArrayObject *)values[4]); - __pyx_v_imin = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_imin == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) - __pyx_v_imax = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_imax == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("Transfer1D", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 103, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.ray_integrators.Transfer1D", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_o_s), __pyx_ptype_5numpy_ndarray, 1, "o_s", 0))) __PYX_ERR(0, 104, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_e), __pyx_ptype_5numpy_ndarray, 1, "e", 0))) __PYX_ERR(0, 105, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 106, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dx), __pyx_ptype_5numpy_ndarray, 1, "dx", 0))) __PYX_ERR(0, 107, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_15ray_integrators_4Transfer1D(__pyx_self, __pyx_v_i_s, __pyx_v_o_s, __pyx_v_e, __pyx_v_a, __pyx_v_dx, __pyx_v_imin, __pyx_v_imax); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_3lib_15ray_integrators_4Transfer1D(CYTHON_UNUSED PyObject *__pyx_self, float __pyx_v_i_s, PyArrayObject *__pyx_v_o_s, PyArrayObject *__pyx_v_e, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_dx, int __pyx_v_imin, int __pyx_v_imax) { - int __pyx_v_i; - __Pyx_LocalBuf_ND __pyx_pybuffernd_a; - __Pyx_Buffer __pyx_pybuffer_a; - __Pyx_LocalBuf_ND __pyx_pybuffernd_dx; - __Pyx_Buffer __pyx_pybuffer_dx; - __Pyx_LocalBuf_ND __pyx_pybuffernd_e; - __Pyx_Buffer __pyx_pybuffer_e; - __Pyx_LocalBuf_ND __pyx_pybuffernd_o_s; - __Pyx_Buffer __pyx_pybuffer_o_s; - 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; - Py_ssize_t __pyx_t_6; - Py_ssize_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("Transfer1D", 0); - __pyx_pybuffer_o_s.pybuffer.buf = NULL; - __pyx_pybuffer_o_s.refcount = 0; - __pyx_pybuffernd_o_s.data = NULL; - __pyx_pybuffernd_o_s.rcbuffer = &__pyx_pybuffer_o_s; - __pyx_pybuffer_e.pybuffer.buf = NULL; - __pyx_pybuffer_e.refcount = 0; - __pyx_pybuffernd_e.data = NULL; - __pyx_pybuffernd_e.rcbuffer = &__pyx_pybuffer_e; - __pyx_pybuffer_a.pybuffer.buf = NULL; - __pyx_pybuffer_a.refcount = 0; - __pyx_pybuffernd_a.data = NULL; - __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a; - __pyx_pybuffer_dx.pybuffer.buf = NULL; - __pyx_pybuffer_dx.refcount = 0; - __pyx_pybuffernd_dx.data = NULL; - __pyx_pybuffernd_dx.rcbuffer = &__pyx_pybuffer_dx; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_o_s.rcbuffer->pybuffer, (PyObject*)__pyx_v_o_s, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 103, __pyx_L1_error) - } - __pyx_pybuffernd_o_s.diminfo[0].strides = __pyx_pybuffernd_o_s.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_o_s.diminfo[0].shape = __pyx_pybuffernd_o_s.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_e.rcbuffer->pybuffer, (PyObject*)__pyx_v_e, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 103, __pyx_L1_error) - } - __pyx_pybuffernd_e.diminfo[0].strides = __pyx_pybuffernd_e.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_e.diminfo[0].shape = __pyx_pybuffernd_e.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_float_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 103, __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_dx.rcbuffer->pybuffer, (PyObject*)__pyx_v_dx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 103, __pyx_L1_error) - } - __pyx_pybuffernd_dx.diminfo[0].strides = __pyx_pybuffernd_dx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dx.diminfo[0].shape = __pyx_pybuffernd_dx.rcbuffer->pybuffer.shape[0]; - - /* "yt/utilities/lib/ray_integrators.pyx":110 - * int imin, int imax): - * cdef int i - * for i in range(imin, imax): # <<<<<<<<<<<<<< - * o_s[i] = i_s + dx[i]*(e[i] - i_s*a[i]) - * i_s = o_s[i] - */ - __pyx_t_1 = __pyx_v_imax; - for (__pyx_t_2 = __pyx_v_imin; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; - - /* "yt/utilities/lib/ray_integrators.pyx":111 - * cdef int i - * for i in range(imin, imax): - * o_s[i] = i_s + dx[i]*(e[i] - i_s*a[i]) # <<<<<<<<<<<<<< - * i_s = o_s[i] - * return i_s - */ - __pyx_t_3 = __pyx_v_i; - if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_pybuffernd_dx.diminfo[0].shape; - __pyx_t_4 = __pyx_v_i; - if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_pybuffernd_e.diminfo[0].shape; - __pyx_t_5 = __pyx_v_i; - if (__pyx_t_5 < 0) __pyx_t_5 += __pyx_pybuffernd_a.diminfo[0].shape; - __pyx_t_6 = __pyx_v_i; - if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_pybuffernd_o_s.diminfo[0].shape; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float_t *, __pyx_pybuffernd_o_s.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_o_s.diminfo[0].strides) = (__pyx_v_i_s + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_dx.diminfo[0].strides)) * ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float_t *, __pyx_pybuffernd_e.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_e.diminfo[0].strides)) - (__pyx_v_i_s * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_a.diminfo[0].strides)))))); - - /* "yt/utilities/lib/ray_integrators.pyx":112 - * for i in range(imin, imax): - * o_s[i] = i_s + dx[i]*(e[i] - i_s*a[i]) - * i_s = o_s[i] # <<<<<<<<<<<<<< - * return i_s - * - */ - __pyx_t_7 = __pyx_v_i; - if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_pybuffernd_o_s.diminfo[0].shape; - __pyx_v_i_s = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float_t *, __pyx_pybuffernd_o_s.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_o_s.diminfo[0].strides)); - } - - /* "yt/utilities/lib/ray_integrators.pyx":113 - * o_s[i] = i_s + dx[i]*(e[i] - i_s*a[i]) - * i_s = o_s[i] - * return i_s # <<<<<<<<<<<<<< - * - * @cython.wraparound(False) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_i_s); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L0; - - /* "yt/utilities/lib/ray_integrators.pyx":103 - * - * @cython.boundscheck(False) - * def Transfer1D(float i_s, # <<<<<<<<<<<<<< - * np.ndarray[np.float_t, ndim=1] o_s, - * np.ndarray[np.float_t, ndim=1] e, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_8); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_e.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_o_s.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.ray_integrators.Transfer1D", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_e.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_o_s.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/lib/ray_integrators.pyx":117 - * @cython.wraparound(False) - * @cython.boundscheck(False) - * def VoxelTraversal(np.ndarray[np.int_t, ndim=3] grid_mask, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=3] grid_t, - * np.ndarray[np.float64_t, ndim=3] grid_dt, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_15ray_integrators_7VoxelTraversal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_15ray_integrators_7VoxelTraversal = {"VoxelTraversal", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15ray_integrators_7VoxelTraversal, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_15ray_integrators_7VoxelTraversal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_grid_mask = 0; - PyArrayObject *__pyx_v_grid_t = 0; - PyArrayObject *__pyx_v_grid_dt = 0; - PyArrayObject *__pyx_v_left_edge = 0; - PyArrayObject *__pyx_v_right_edge = 0; - PyArrayObject *__pyx_v_dx = 0; - PyArrayObject *__pyx_v_u = 0; - PyArrayObject *__pyx_v_v = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("VoxelTraversal (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grid_mask,&__pyx_n_s_grid_t,&__pyx_n_s_grid_dt,&__pyx_n_s_left_edge,&__pyx_n_s_right_edge,&__pyx_n_s_dx,&__pyx_n_s_u,&__pyx_n_s_v,0}; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid_mask)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid_t)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("VoxelTraversal", 1, 8, 8, 1); __PYX_ERR(0, 117, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grid_dt)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("VoxelTraversal", 1, 8, 8, 2); __PYX_ERR(0, 117, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("VoxelTraversal", 1, 8, 8, 3); __PYX_ERR(0, 117, __pyx_L3_error) - } - case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("VoxelTraversal", 1, 8, 8, 4); __PYX_ERR(0, 117, __pyx_L3_error) - } - case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("VoxelTraversal", 1, 8, 8, 5); __PYX_ERR(0, 117, __pyx_L3_error) - } - case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("VoxelTraversal", 1, 8, 8, 6); __PYX_ERR(0, 117, __pyx_L3_error) - } - case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("VoxelTraversal", 1, 8, 8, 7); __PYX_ERR(0, 117, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "VoxelTraversal") < 0)) __PYX_ERR(0, 117, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - } - __pyx_v_grid_mask = ((PyArrayObject *)values[0]); - __pyx_v_grid_t = ((PyArrayObject *)values[1]); - __pyx_v_grid_dt = ((PyArrayObject *)values[2]); - __pyx_v_left_edge = ((PyArrayObject *)values[3]); - __pyx_v_right_edge = ((PyArrayObject *)values[4]); - __pyx_v_dx = ((PyArrayObject *)values[5]); - __pyx_v_u = ((PyArrayObject *)values[6]); - __pyx_v_v = ((PyArrayObject *)values[7]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("VoxelTraversal", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 117, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.ray_integrators.VoxelTraversal", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grid_mask), __pyx_ptype_5numpy_ndarray, 1, "grid_mask", 0))) __PYX_ERR(0, 117, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grid_t), __pyx_ptype_5numpy_ndarray, 1, "grid_t", 0))) __PYX_ERR(0, 118, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grid_dt), __pyx_ptype_5numpy_ndarray, 1, "grid_dt", 0))) __PYX_ERR(0, 119, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 120, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 121, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dx), __pyx_ptype_5numpy_ndarray, 1, "dx", 0))) __PYX_ERR(0, 122, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_5numpy_ndarray, 1, "u", 0))) __PYX_ERR(0, 123, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 124, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_15ray_integrators_6VoxelTraversal(__pyx_self, __pyx_v_grid_mask, __pyx_v_grid_t, __pyx_v_grid_dt, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_dx, __pyx_v_u, __pyx_v_v); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_3lib_15ray_integrators_6VoxelTraversal(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_grid_mask, PyArrayObject *__pyx_v_grid_t, PyArrayObject *__pyx_v_grid_dt, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_right_edge, PyArrayObject *__pyx_v_dx, PyArrayObject *__pyx_v_u, PyArrayObject *__pyx_v_v) { - int __pyx_v_i; - int __pyx_v_x; - int __pyx_v_y; - __pyx_t_5numpy_float64_t __pyx_v_tl; - __pyx_t_5numpy_float64_t __pyx_v_tr; - __pyx_t_5numpy_float64_t __pyx_v_intersect_t; - __pyx_t_5numpy_float64_t __pyx_v_enter_t; - __pyx_t_5numpy_float64_t __pyx_v_iv_dir[3]; - __pyx_t_5numpy_float64_t __pyx_v_tdelta[3]; - __pyx_t_5numpy_float64_t __pyx_v_tmax[3]; - __pyx_t_5numpy_float64_t __pyx_v_intersect[3]; - __pyx_t_5numpy_int64_t __pyx_v_cur_ind[3]; - __pyx_t_5numpy_int64_t __pyx_v_step[3]; - __Pyx_LocalBuf_ND __pyx_pybuffernd_dx; - __Pyx_Buffer __pyx_pybuffer_dx; - __Pyx_LocalBuf_ND __pyx_pybuffernd_grid_dt; - __Pyx_Buffer __pyx_pybuffer_grid_dt; - __Pyx_LocalBuf_ND __pyx_pybuffernd_grid_mask; - __Pyx_Buffer __pyx_pybuffer_grid_mask; - __Pyx_LocalBuf_ND __pyx_pybuffernd_grid_t; - __Pyx_Buffer __pyx_pybuffer_grid_t; - __Pyx_LocalBuf_ND __pyx_pybuffernd_left_edge; - __Pyx_Buffer __pyx_pybuffer_left_edge; - __Pyx_LocalBuf_ND __pyx_pybuffernd_right_edge; - __Pyx_Buffer __pyx_pybuffer_right_edge; - __Pyx_LocalBuf_ND __pyx_pybuffernd_u; - __Pyx_Buffer __pyx_pybuffer_u; - __Pyx_LocalBuf_ND __pyx_pybuffernd_v; - __Pyx_Buffer __pyx_pybuffer_v; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - Py_ssize_t __pyx_t_5; - __pyx_t_5numpy_float64_t __pyx_t_6; - Py_ssize_t __pyx_t_7; - Py_ssize_t __pyx_t_8; - Py_ssize_t __pyx_t_9; - Py_ssize_t __pyx_t_10; - Py_ssize_t __pyx_t_11; - Py_ssize_t __pyx_t_12; - Py_ssize_t __pyx_t_13; - int __pyx_t_14; - Py_ssize_t __pyx_t_15; - int __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; - Py_ssize_t __pyx_t_26; - Py_ssize_t __pyx_t_27; - Py_ssize_t __pyx_t_28; - Py_ssize_t __pyx_t_29; - Py_ssize_t __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; - Py_ssize_t __pyx_t_35; - Py_ssize_t __pyx_t_36; - Py_ssize_t __pyx_t_37; - Py_ssize_t __pyx_t_38; - Py_ssize_t __pyx_t_39; - PyObject *__pyx_t_40 = NULL; - PyObject *__pyx_t_41 = NULL; - PyObject *__pyx_t_42 = NULL; - Py_ssize_t __pyx_t_43; - Py_ssize_t __pyx_t_44; - Py_ssize_t __pyx_t_45; - __pyx_t_5numpy_float64_t __pyx_t_46; - PyObject *__pyx_t_47 = NULL; - PyObject *__pyx_t_48 = NULL; - __pyx_t_5numpy_int64_t __pyx_t_49; - Py_ssize_t __pyx_t_50; - Py_ssize_t __pyx_t_51; - Py_ssize_t __pyx_t_52; - Py_ssize_t __pyx_t_53; - Py_ssize_t __pyx_t_54; - Py_ssize_t __pyx_t_55; - Py_ssize_t __pyx_t_56; - Py_ssize_t __pyx_t_57; - Py_ssize_t __pyx_t_58; - Py_ssize_t __pyx_t_59; - int __pyx_t_60; - __pyx_t_5numpy_int64_t __pyx_t_61; - __pyx_t_5numpy_int64_t __pyx_t_62; - __pyx_t_5numpy_int64_t __pyx_t_63; - __pyx_t_5numpy_int64_t __pyx_t_64; - __pyx_t_5numpy_int64_t __pyx_t_65; - __pyx_t_5numpy_int64_t __pyx_t_66; - __pyx_t_5numpy_int64_t __pyx_t_67; - __pyx_t_5numpy_int64_t __pyx_t_68; - __pyx_t_5numpy_int64_t __pyx_t_69; - __pyx_t_5numpy_int64_t __pyx_t_70; - __pyx_t_5numpy_int64_t __pyx_t_71; - __pyx_t_5numpy_int64_t __pyx_t_72; - __pyx_t_5numpy_int64_t __pyx_t_73; - __pyx_t_5numpy_int64_t __pyx_t_74; - long __pyx_t_75; - __pyx_t_5numpy_int64_t __pyx_t_76; - __pyx_t_5numpy_int64_t __pyx_t_77; - __pyx_t_5numpy_int64_t __pyx_t_78; - __pyx_t_5numpy_int64_t __pyx_t_79; - __pyx_t_5numpy_int64_t __pyx_t_80; - __pyx_t_5numpy_int64_t __pyx_t_81; - __pyx_t_5numpy_int64_t __pyx_t_82; - __pyx_t_5numpy_int64_t __pyx_t_83; - __pyx_t_5numpy_int64_t __pyx_t_84; - __pyx_t_5numpy_int64_t __pyx_t_85; - __pyx_t_5numpy_int64_t __pyx_t_86; - __pyx_t_5numpy_int64_t __pyx_t_87; - __pyx_t_5numpy_int64_t __pyx_t_88; - __pyx_t_5numpy_int64_t __pyx_t_89; - __pyx_t_5numpy_int64_t __pyx_t_90; - __pyx_t_5numpy_int64_t __pyx_t_91; - __pyx_t_5numpy_int64_t __pyx_t_92; - __pyx_t_5numpy_int64_t __pyx_t_93; - __Pyx_RefNannySetupContext("VoxelTraversal", 0); - __pyx_pybuffer_grid_mask.pybuffer.buf = NULL; - __pyx_pybuffer_grid_mask.refcount = 0; - __pyx_pybuffernd_grid_mask.data = NULL; - __pyx_pybuffernd_grid_mask.rcbuffer = &__pyx_pybuffer_grid_mask; - __pyx_pybuffer_grid_t.pybuffer.buf = NULL; - __pyx_pybuffer_grid_t.refcount = 0; - __pyx_pybuffernd_grid_t.data = NULL; - __pyx_pybuffernd_grid_t.rcbuffer = &__pyx_pybuffer_grid_t; - __pyx_pybuffer_grid_dt.pybuffer.buf = NULL; - __pyx_pybuffer_grid_dt.refcount = 0; - __pyx_pybuffernd_grid_dt.data = NULL; - __pyx_pybuffernd_grid_dt.rcbuffer = &__pyx_pybuffer_grid_dt; - __pyx_pybuffer_left_edge.pybuffer.buf = NULL; - __pyx_pybuffer_left_edge.refcount = 0; - __pyx_pybuffernd_left_edge.data = NULL; - __pyx_pybuffernd_left_edge.rcbuffer = &__pyx_pybuffer_left_edge; - __pyx_pybuffer_right_edge.pybuffer.buf = NULL; - __pyx_pybuffer_right_edge.refcount = 0; - __pyx_pybuffernd_right_edge.data = NULL; - __pyx_pybuffernd_right_edge.rcbuffer = &__pyx_pybuffer_right_edge; - __pyx_pybuffer_dx.pybuffer.buf = NULL; - __pyx_pybuffer_dx.refcount = 0; - __pyx_pybuffernd_dx.data = NULL; - __pyx_pybuffernd_dx.rcbuffer = &__pyx_pybuffer_dx; - __pyx_pybuffer_u.pybuffer.buf = NULL; - __pyx_pybuffer_u.refcount = 0; - __pyx_pybuffernd_u.data = NULL; - __pyx_pybuffernd_u.rcbuffer = &__pyx_pybuffer_u; - __pyx_pybuffer_v.pybuffer.buf = NULL; - __pyx_pybuffer_v.refcount = 0; - __pyx_pybuffernd_v.data = NULL; - __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grid_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_grid_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 117, __pyx_L1_error) - } - __pyx_pybuffernd_grid_mask.diminfo[0].strides = __pyx_pybuffernd_grid_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grid_mask.diminfo[0].shape = __pyx_pybuffernd_grid_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grid_mask.diminfo[1].strides = __pyx_pybuffernd_grid_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grid_mask.diminfo[1].shape = __pyx_pybuffernd_grid_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_grid_mask.diminfo[2].strides = __pyx_pybuffernd_grid_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_grid_mask.diminfo[2].shape = __pyx_pybuffernd_grid_mask.rcbuffer->pybuffer.shape[2]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grid_t.rcbuffer->pybuffer, (PyObject*)__pyx_v_grid_t, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 117, __pyx_L1_error) - } - __pyx_pybuffernd_grid_t.diminfo[0].strides = __pyx_pybuffernd_grid_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grid_t.diminfo[0].shape = __pyx_pybuffernd_grid_t.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grid_t.diminfo[1].strides = __pyx_pybuffernd_grid_t.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grid_t.diminfo[1].shape = __pyx_pybuffernd_grid_t.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_grid_t.diminfo[2].strides = __pyx_pybuffernd_grid_t.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_grid_t.diminfo[2].shape = __pyx_pybuffernd_grid_t.rcbuffer->pybuffer.shape[2]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grid_dt.rcbuffer->pybuffer, (PyObject*)__pyx_v_grid_dt, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 117, __pyx_L1_error) - } - __pyx_pybuffernd_grid_dt.diminfo[0].strides = __pyx_pybuffernd_grid_dt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grid_dt.diminfo[0].shape = __pyx_pybuffernd_grid_dt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grid_dt.diminfo[1].strides = __pyx_pybuffernd_grid_dt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grid_dt.diminfo[1].shape = __pyx_pybuffernd_grid_dt.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_grid_dt.diminfo[2].strides = __pyx_pybuffernd_grid_dt.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_grid_dt.diminfo[2].shape = __pyx_pybuffernd_grid_dt.rcbuffer->pybuffer.shape[2]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 117, __pyx_L1_error) - } - __pyx_pybuffernd_left_edge.diminfo[0].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edge.diminfo[0].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 117, __pyx_L1_error) - } - __pyx_pybuffernd_right_edge.diminfo[0].strides = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edge.diminfo[0].shape = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dx.rcbuffer->pybuffer, (PyObject*)__pyx_v_dx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 117, __pyx_L1_error) - } - __pyx_pybuffernd_dx.diminfo[0].strides = __pyx_pybuffernd_dx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dx.diminfo[0].shape = __pyx_pybuffernd_dx.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_u, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 117, __pyx_L1_error) - } - __pyx_pybuffernd_u.diminfo[0].strides = __pyx_pybuffernd_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u.diminfo[0].shape = __pyx_pybuffernd_u.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 117, __pyx_L1_error) - } - __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; - - /* "yt/utilities/lib/ray_integrators.pyx":136 - * cdef np.int64_t cur_ind[3] - * cdef np.int64_t step[3] - * intersect_t = 1 # <<<<<<<<<<<<<< - * # recall p = v * t + u - * # where p is position, v is our vector, u is the start point - */ - __pyx_v_intersect_t = 1.0; - - /* "yt/utilities/lib/ray_integrators.pyx":139 - * # recall p = v * t + u - * # where p is position, v is our vector, u is the start point - * for i in range(3): # <<<<<<<<<<<<<< - * # As long as we're iterating, set some other stuff, too - * if(v[i] < 0): - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "yt/utilities/lib/ray_integrators.pyx":141 - * for i in range(3): - * # As long as we're iterating, set some other stuff, too - * if(v[i] < 0): # <<<<<<<<<<<<<< - * step[i] = -1 - * elif (v[i] == 0): - */ - __pyx_t_2 = __pyx_v_i; - __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_v.diminfo[0].strides)) < 0.0) != 0); - if (__pyx_t_3) { - - /* "yt/utilities/lib/ray_integrators.pyx":142 - * # As long as we're iterating, set some other stuff, too - * if(v[i] < 0): - * step[i] = -1 # <<<<<<<<<<<<<< - * elif (v[i] == 0): - * step[i] = 1 - */ - (__pyx_v_step[__pyx_v_i]) = -1LL; - - /* "yt/utilities/lib/ray_integrators.pyx":141 - * for i in range(3): - * # As long as we're iterating, set some other stuff, too - * if(v[i] < 0): # <<<<<<<<<<<<<< - * step[i] = -1 - * elif (v[i] == 0): - */ - goto __pyx_L5; - } - - /* "yt/utilities/lib/ray_integrators.pyx":143 - * if(v[i] < 0): - * step[i] = -1 - * elif (v[i] == 0): # <<<<<<<<<<<<<< - * step[i] = 1 - * tmax[i] = 1e60 - */ - __pyx_t_4 = __pyx_v_i; - __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v.diminfo[0].strides)) == 0.0) != 0); - if (__pyx_t_3) { - - /* "yt/utilities/lib/ray_integrators.pyx":144 - * step[i] = -1 - * elif (v[i] == 0): - * step[i] = 1 # <<<<<<<<<<<<<< - * tmax[i] = 1e60 - * iv_dir[i] = 1e60 - */ - (__pyx_v_step[__pyx_v_i]) = 1; - - /* "yt/utilities/lib/ray_integrators.pyx":145 - * elif (v[i] == 0): - * step[i] = 1 - * tmax[i] = 1e60 # <<<<<<<<<<<<<< - * iv_dir[i] = 1e60 - * tdelta[i] = 1e-60 - */ - (__pyx_v_tmax[__pyx_v_i]) = 1e60; - - /* "yt/utilities/lib/ray_integrators.pyx":146 - * step[i] = 1 - * tmax[i] = 1e60 - * iv_dir[i] = 1e60 # <<<<<<<<<<<<<< - * tdelta[i] = 1e-60 - * continue - */ - (__pyx_v_iv_dir[__pyx_v_i]) = 1e60; - - /* "yt/utilities/lib/ray_integrators.pyx":147 - * tmax[i] = 1e60 - * iv_dir[i] = 1e60 - * tdelta[i] = 1e-60 # <<<<<<<<<<<<<< - * continue - * else: - */ - (__pyx_v_tdelta[__pyx_v_i]) = 1e-60; - - /* "yt/utilities/lib/ray_integrators.pyx":148 - * iv_dir[i] = 1e60 - * tdelta[i] = 1e-60 - * continue # <<<<<<<<<<<<<< - * else: - * step[i] = 1 - */ - goto __pyx_L3_continue; - - /* "yt/utilities/lib/ray_integrators.pyx":143 - * if(v[i] < 0): - * step[i] = -1 - * elif (v[i] == 0): # <<<<<<<<<<<<<< - * step[i] = 1 - * tmax[i] = 1e60 - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":150 - * continue - * else: - * step[i] = 1 # <<<<<<<<<<<<<< - * x = (i+1)%3 - * y = (i+2)%3 - */ - /*else*/ { - (__pyx_v_step[__pyx_v_i]) = 1; - } - __pyx_L5:; - - /* "yt/utilities/lib/ray_integrators.pyx":151 - * else: - * step[i] = 1 - * x = (i+1)%3 # <<<<<<<<<<<<<< - * y = (i+2)%3 - * iv_dir[i] = 1.0/v[i] - */ - __pyx_v_x = __Pyx_mod_long((__pyx_v_i + 1), 3); - - /* "yt/utilities/lib/ray_integrators.pyx":152 - * step[i] = 1 - * x = (i+1)%3 - * y = (i+2)%3 # <<<<<<<<<<<<<< - * iv_dir[i] = 1.0/v[i] - * tl = (left_edge[i] - u[i])*iv_dir[i] - */ - __pyx_v_y = __Pyx_mod_long((__pyx_v_i + 2), 3); - - /* "yt/utilities/lib/ray_integrators.pyx":153 - * x = (i+1)%3 - * y = (i+2)%3 - * iv_dir[i] = 1.0/v[i] # <<<<<<<<<<<<<< - * tl = (left_edge[i] - u[i])*iv_dir[i] - * tr = (right_edge[i] - u[i])*iv_dir[i] - */ - __pyx_t_5 = __pyx_v_i; - __pyx_t_6 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_v.diminfo[0].strides)); - if (unlikely(__pyx_t_6 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 153, __pyx_L1_error) - } - (__pyx_v_iv_dir[__pyx_v_i]) = (1.0 / __pyx_t_6); - - /* "yt/utilities/lib/ray_integrators.pyx":154 - * y = (i+2)%3 - * iv_dir[i] = 1.0/v[i] - * tl = (left_edge[i] - u[i])*iv_dir[i] # <<<<<<<<<<<<<< - * tr = (right_edge[i] - u[i])*iv_dir[i] - * if (left_edge[x] <= (u[x] + tl*v[x]) <= right_edge[x]) and \ - */ - __pyx_t_7 = __pyx_v_i; - __pyx_t_8 = __pyx_v_i; - __pyx_v_tl = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left_edge.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_u.diminfo[0].strides))) * (__pyx_v_iv_dir[__pyx_v_i])); - - /* "yt/utilities/lib/ray_integrators.pyx":155 - * iv_dir[i] = 1.0/v[i] - * tl = (left_edge[i] - u[i])*iv_dir[i] - * tr = (right_edge[i] - u[i])*iv_dir[i] # <<<<<<<<<<<<<< - * if (left_edge[x] <= (u[x] + tl*v[x]) <= right_edge[x]) and \ - * (left_edge[y] <= (u[y] + tl*v[y]) <= right_edge[y]) and \ - */ - __pyx_t_9 = __pyx_v_i; - __pyx_t_10 = __pyx_v_i; - __pyx_v_tr = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right_edge.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_u.diminfo[0].strides))) * (__pyx_v_iv_dir[__pyx_v_i])); - - /* "yt/utilities/lib/ray_integrators.pyx":156 - * tl = (left_edge[i] - u[i])*iv_dir[i] - * tr = (right_edge[i] - u[i])*iv_dir[i] - * if (left_edge[x] <= (u[x] + tl*v[x]) <= right_edge[x]) and \ # <<<<<<<<<<<<<< - * (left_edge[y] <= (u[y] + tl*v[y]) <= right_edge[y]) and \ - * (0.0 <= tl < intersect_t): - */ - __pyx_t_11 = __pyx_v_x; - __pyx_t_12 = __pyx_v_x; - __pyx_t_13 = __pyx_v_x; - __pyx_t_6 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_u.diminfo[0].strides)) + (__pyx_v_tl * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides)))); - __pyx_t_14 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_t_6); - if (__pyx_t_14) { - __pyx_t_15 = __pyx_v_x; - __pyx_t_14 = (__pyx_t_6 <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_right_edge.diminfo[0].strides))); - } - __pyx_t_16 = (__pyx_t_14 != 0); - if (__pyx_t_16) { - } else { - __pyx_t_3 = __pyx_t_16; - goto __pyx_L7_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":157 - * tr = (right_edge[i] - u[i])*iv_dir[i] - * if (left_edge[x] <= (u[x] + tl*v[x]) <= right_edge[x]) and \ - * (left_edge[y] <= (u[y] + tl*v[y]) <= right_edge[y]) and \ # <<<<<<<<<<<<<< - * (0.0 <= tl < intersect_t): - * intersect_t = tl - */ - __pyx_t_17 = __pyx_v_y; - __pyx_t_18 = __pyx_v_y; - __pyx_t_19 = __pyx_v_y; - __pyx_t_6 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_u.diminfo[0].strides)) + (__pyx_v_tl * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides)))); - __pyx_t_16 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_t_6); - if (__pyx_t_16) { - __pyx_t_20 = __pyx_v_y; - __pyx_t_16 = (__pyx_t_6 <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_right_edge.diminfo[0].strides))); - } - __pyx_t_14 = (__pyx_t_16 != 0); - if (__pyx_t_14) { - } else { - __pyx_t_3 = __pyx_t_14; - goto __pyx_L7_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":158 - * if (left_edge[x] <= (u[x] + tl*v[x]) <= right_edge[x]) and \ - * (left_edge[y] <= (u[y] + tl*v[y]) <= right_edge[y]) and \ - * (0.0 <= tl < intersect_t): # <<<<<<<<<<<<<< - * intersect_t = tl - * if (left_edge[x] <= (u[x] + tr*v[x]) <= right_edge[x]) and \ - */ - __pyx_t_14 = (0.0 <= __pyx_v_tl); - if (__pyx_t_14) { - __pyx_t_14 = (__pyx_v_tl < __pyx_v_intersect_t); - } - __pyx_t_16 = (__pyx_t_14 != 0); - __pyx_t_3 = __pyx_t_16; - __pyx_L7_bool_binop_done:; - - /* "yt/utilities/lib/ray_integrators.pyx":156 - * tl = (left_edge[i] - u[i])*iv_dir[i] - * tr = (right_edge[i] - u[i])*iv_dir[i] - * if (left_edge[x] <= (u[x] + tl*v[x]) <= right_edge[x]) and \ # <<<<<<<<<<<<<< - * (left_edge[y] <= (u[y] + tl*v[y]) <= right_edge[y]) and \ - * (0.0 <= tl < intersect_t): - */ - if (__pyx_t_3) { - - /* "yt/utilities/lib/ray_integrators.pyx":159 - * (left_edge[y] <= (u[y] + tl*v[y]) <= right_edge[y]) and \ - * (0.0 <= tl < intersect_t): - * intersect_t = tl # <<<<<<<<<<<<<< - * if (left_edge[x] <= (u[x] + tr*v[x]) <= right_edge[x]) and \ - * (left_edge[y] <= (u[y] + tr*v[y]) <= right_edge[y]) and \ - */ - __pyx_v_intersect_t = __pyx_v_tl; - - /* "yt/utilities/lib/ray_integrators.pyx":156 - * tl = (left_edge[i] - u[i])*iv_dir[i] - * tr = (right_edge[i] - u[i])*iv_dir[i] - * if (left_edge[x] <= (u[x] + tl*v[x]) <= right_edge[x]) and \ # <<<<<<<<<<<<<< - * (left_edge[y] <= (u[y] + tl*v[y]) <= right_edge[y]) and \ - * (0.0 <= tl < intersect_t): - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":160 - * (0.0 <= tl < intersect_t): - * intersect_t = tl - * if (left_edge[x] <= (u[x] + tr*v[x]) <= right_edge[x]) and \ # <<<<<<<<<<<<<< - * (left_edge[y] <= (u[y] + tr*v[y]) <= right_edge[y]) and \ - * (0.0 <= tr < intersect_t): - */ - __pyx_t_21 = __pyx_v_x; - __pyx_t_22 = __pyx_v_x; - __pyx_t_23 = __pyx_v_x; - __pyx_t_6 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_u.diminfo[0].strides)) + (__pyx_v_tr * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_v.diminfo[0].strides)))); - __pyx_t_16 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_t_6); - if (__pyx_t_16) { - __pyx_t_24 = __pyx_v_x; - __pyx_t_16 = (__pyx_t_6 <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right_edge.diminfo[0].strides))); - } - __pyx_t_14 = (__pyx_t_16 != 0); - if (__pyx_t_14) { - } else { - __pyx_t_3 = __pyx_t_14; - goto __pyx_L11_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":161 - * intersect_t = tl - * if (left_edge[x] <= (u[x] + tr*v[x]) <= right_edge[x]) and \ - * (left_edge[y] <= (u[y] + tr*v[y]) <= right_edge[y]) and \ # <<<<<<<<<<<<<< - * (0.0 <= tr < intersect_t): - * intersect_t = tr - */ - __pyx_t_25 = __pyx_v_y; - __pyx_t_26 = __pyx_v_y; - __pyx_t_27 = __pyx_v_y; - __pyx_t_6 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_u.diminfo[0].strides)) + (__pyx_v_tr * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_v.diminfo[0].strides)))); - __pyx_t_14 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_t_6); - if (__pyx_t_14) { - __pyx_t_28 = __pyx_v_y; - __pyx_t_14 = (__pyx_t_6 <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_right_edge.diminfo[0].strides))); - } - __pyx_t_16 = (__pyx_t_14 != 0); - if (__pyx_t_16) { - } else { - __pyx_t_3 = __pyx_t_16; - goto __pyx_L11_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":162 - * if (left_edge[x] <= (u[x] + tr*v[x]) <= right_edge[x]) and \ - * (left_edge[y] <= (u[y] + tr*v[y]) <= right_edge[y]) and \ - * (0.0 <= tr < intersect_t): # <<<<<<<<<<<<<< - * intersect_t = tr - * # if fully enclosed - */ - __pyx_t_16 = (0.0 <= __pyx_v_tr); - if (__pyx_t_16) { - __pyx_t_16 = (__pyx_v_tr < __pyx_v_intersect_t); - } - __pyx_t_14 = (__pyx_t_16 != 0); - __pyx_t_3 = __pyx_t_14; - __pyx_L11_bool_binop_done:; - - /* "yt/utilities/lib/ray_integrators.pyx":160 - * (0.0 <= tl < intersect_t): - * intersect_t = tl - * if (left_edge[x] <= (u[x] + tr*v[x]) <= right_edge[x]) and \ # <<<<<<<<<<<<<< - * (left_edge[y] <= (u[y] + tr*v[y]) <= right_edge[y]) and \ - * (0.0 <= tr < intersect_t): - */ - if (__pyx_t_3) { - - /* "yt/utilities/lib/ray_integrators.pyx":163 - * (left_edge[y] <= (u[y] + tr*v[y]) <= right_edge[y]) and \ - * (0.0 <= tr < intersect_t): - * intersect_t = tr # <<<<<<<<<<<<<< - * # if fully enclosed - * if (left_edge[0] <= u[0] <= right_edge[0]) and \ - */ - __pyx_v_intersect_t = __pyx_v_tr; - - /* "yt/utilities/lib/ray_integrators.pyx":160 - * (0.0 <= tl < intersect_t): - * intersect_t = tl - * if (left_edge[x] <= (u[x] + tr*v[x]) <= right_edge[x]) and \ # <<<<<<<<<<<<<< - * (left_edge[y] <= (u[y] + tr*v[y]) <= right_edge[y]) and \ - * (0.0 <= tr < intersect_t): - */ - } - __pyx_L3_continue:; - } - - /* "yt/utilities/lib/ray_integrators.pyx":165 - * intersect_t = tr - * # if fully enclosed - * if (left_edge[0] <= u[0] <= right_edge[0]) and \ # <<<<<<<<<<<<<< - * (left_edge[1] <= u[1] <= right_edge[1]) and \ - * (left_edge[2] <= u[2] <= right_edge[2]): - */ - __pyx_t_29 = 0; - __pyx_t_30 = 0; - __pyx_t_6 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_u.diminfo[0].strides)); - __pyx_t_14 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_t_6); - if (__pyx_t_14) { - __pyx_t_31 = 0; - __pyx_t_14 = (__pyx_t_6 <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right_edge.diminfo[0].strides))); - } - __pyx_t_16 = (__pyx_t_14 != 0); - if (__pyx_t_16) { - } else { - __pyx_t_3 = __pyx_t_16; - goto __pyx_L15_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":166 - * # if fully enclosed - * if (left_edge[0] <= u[0] <= right_edge[0]) and \ - * (left_edge[1] <= u[1] <= right_edge[1]) and \ # <<<<<<<<<<<<<< - * (left_edge[2] <= u[2] <= right_edge[2]): - * intersect_t = 0.0 - */ - __pyx_t_32 = 1; - __pyx_t_33 = 1; - __pyx_t_6 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_u.diminfo[0].strides)); - __pyx_t_16 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_t_6); - if (__pyx_t_16) { - __pyx_t_34 = 1; - __pyx_t_16 = (__pyx_t_6 <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_right_edge.diminfo[0].strides))); - } - __pyx_t_14 = (__pyx_t_16 != 0); - if (__pyx_t_14) { - } else { - __pyx_t_3 = __pyx_t_14; - goto __pyx_L15_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":167 - * if (left_edge[0] <= u[0] <= right_edge[0]) and \ - * (left_edge[1] <= u[1] <= right_edge[1]) and \ - * (left_edge[2] <= u[2] <= right_edge[2]): # <<<<<<<<<<<<<< - * intersect_t = 0.0 - * if not (0 <= intersect_t <= 1): return - */ - __pyx_t_35 = 2; - __pyx_t_36 = 2; - __pyx_t_6 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_u.diminfo[0].strides)); - __pyx_t_14 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_t_6); - if (__pyx_t_14) { - __pyx_t_37 = 2; - __pyx_t_14 = (__pyx_t_6 <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right_edge.diminfo[0].strides))); - } - __pyx_t_16 = (__pyx_t_14 != 0); - __pyx_t_3 = __pyx_t_16; - __pyx_L15_bool_binop_done:; - - /* "yt/utilities/lib/ray_integrators.pyx":165 - * intersect_t = tr - * # if fully enclosed - * if (left_edge[0] <= u[0] <= right_edge[0]) and \ # <<<<<<<<<<<<<< - * (left_edge[1] <= u[1] <= right_edge[1]) and \ - * (left_edge[2] <= u[2] <= right_edge[2]): - */ - if (__pyx_t_3) { - - /* "yt/utilities/lib/ray_integrators.pyx":168 - * (left_edge[1] <= u[1] <= right_edge[1]) and \ - * (left_edge[2] <= u[2] <= right_edge[2]): - * intersect_t = 0.0 # <<<<<<<<<<<<<< - * if not (0 <= intersect_t <= 1): return - * # Now get the indices of the intersection - */ - __pyx_v_intersect_t = 0.0; - - /* "yt/utilities/lib/ray_integrators.pyx":165 - * intersect_t = tr - * # if fully enclosed - * if (left_edge[0] <= u[0] <= right_edge[0]) and \ # <<<<<<<<<<<<<< - * (left_edge[1] <= u[1] <= right_edge[1]) and \ - * (left_edge[2] <= u[2] <= right_edge[2]): - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":169 - * (left_edge[2] <= u[2] <= right_edge[2]): - * intersect_t = 0.0 - * if not (0 <= intersect_t <= 1): return # <<<<<<<<<<<<<< - * # Now get the indices of the intersection - * for i in range(3): - */ - __pyx_t_3 = (0.0 <= __pyx_v_intersect_t); - if (__pyx_t_3) { - __pyx_t_3 = (__pyx_v_intersect_t <= 1.0); - } - __pyx_t_16 = ((!(__pyx_t_3 != 0)) != 0); - if (__pyx_t_16) { - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - } - - /* "yt/utilities/lib/ray_integrators.pyx":171 - * if not (0 <= intersect_t <= 1): return - * # Now get the indices of the intersection - * for i in range(3): # <<<<<<<<<<<<<< - * intersect[i] = u[i] + intersect_t * v[i] - * cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "yt/utilities/lib/ray_integrators.pyx":172 - * # Now get the indices of the intersection - * for i in range(3): - * intersect[i] = u[i] + intersect_t * v[i] # <<<<<<<<<<<<<< - * cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) - * tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])*iv_dir[i] - */ - __pyx_t_38 = __pyx_v_i; - __pyx_t_39 = __pyx_v_i; - (__pyx_v_intersect[__pyx_v_i]) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_u.diminfo[0].strides)) + (__pyx_v_intersect_t * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_v.diminfo[0].strides)))); - - /* "yt/utilities/lib/ray_integrators.pyx":173 - * for i in range(3): - * intersect[i] = u[i] + intersect_t * v[i] - * cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) # <<<<<<<<<<<<<< - * tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])*iv_dir[i] - * if cur_ind[i] == grid_mask.shape[i] and step[i] < 0: - */ - __pyx_t_41 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_41); - __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_floor); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_42); - __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; - __pyx_t_43 = __pyx_v_i; - __pyx_t_44 = __pyx_v_i; - __pyx_t_6 = (((__pyx_v_intersect[__pyx_v_i]) + (1e-8 * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_dx.diminfo[0].strides)))) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_left_edge.diminfo[0].strides))); - __pyx_t_45 = __pyx_v_i; - __pyx_t_46 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_dx.diminfo[0].strides)); - if (unlikely(__pyx_t_46 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 173, __pyx_L1_error) - } - __pyx_t_41 = PyFloat_FromDouble((__pyx_t_6 / __pyx_t_46)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_41); - __pyx_t_47 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_42))) { - __pyx_t_47 = PyMethod_GET_SELF(__pyx_t_42); - if (likely(__pyx_t_47)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_42); - __Pyx_INCREF(__pyx_t_47); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_42, function); - } - } - if (!__pyx_t_47) { - __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_42, __pyx_t_41); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; - __Pyx_GOTREF(__pyx_t_40); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_42)) { - PyObject *__pyx_temp[2] = {__pyx_t_47, __pyx_t_41}; - __pyx_t_40 = __Pyx_PyFunction_FastCall(__pyx_t_42, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0; - __Pyx_GOTREF(__pyx_t_40); - __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_42)) { - PyObject *__pyx_temp[2] = {__pyx_t_47, __pyx_t_41}; - __pyx_t_40 = __Pyx_PyCFunction_FastCall(__pyx_t_42, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0; - __Pyx_GOTREF(__pyx_t_40); - __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; - } else - #endif - { - __pyx_t_48 = PyTuple_New(1+1); if (unlikely(!__pyx_t_48)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_48); - __Pyx_GIVEREF(__pyx_t_47); PyTuple_SET_ITEM(__pyx_t_48, 0, __pyx_t_47); __pyx_t_47 = NULL; - __Pyx_GIVEREF(__pyx_t_41); - PyTuple_SET_ITEM(__pyx_t_48, 0+1, __pyx_t_41); - __pyx_t_41 = 0; - __pyx_t_40 = __Pyx_PyObject_Call(__pyx_t_42, __pyx_t_48, NULL); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_40); - __Pyx_DECREF(__pyx_t_48); __pyx_t_48 = 0; - } - } - __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; - __pyx_t_49 = __Pyx_PyInt_As_npy_int64(__pyx_t_40); if (unlikely((__pyx_t_49 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0; - (__pyx_v_cur_ind[__pyx_v_i]) = __pyx_t_49; - - /* "yt/utilities/lib/ray_integrators.pyx":174 - * intersect[i] = u[i] + intersect_t * v[i] - * cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) - * tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])*iv_dir[i] # <<<<<<<<<<<<<< - * if cur_ind[i] == grid_mask.shape[i] and step[i] < 0: - * cur_ind[i] = grid_mask.shape[i] - 1 - */ - __pyx_t_50 = __pyx_v_i; - __pyx_t_51 = __pyx_v_i; - __pyx_t_52 = __pyx_v_i; - (__pyx_v_tmax[__pyx_v_i]) = ((((((__pyx_v_cur_ind[__pyx_v_i]) + (__pyx_v_step[__pyx_v_i])) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_dx.diminfo[0].strides))) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_left_edge.diminfo[0].strides))) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_u.diminfo[0].strides))) * (__pyx_v_iv_dir[__pyx_v_i])); - - /* "yt/utilities/lib/ray_integrators.pyx":175 - * cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) - * tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])*iv_dir[i] - * if cur_ind[i] == grid_mask.shape[i] and step[i] < 0: # <<<<<<<<<<<<<< - * cur_ind[i] = grid_mask.shape[i] - 1 - * if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])*iv_dir[i] - */ - __pyx_t_3 = (((__pyx_v_cur_ind[__pyx_v_i]) == (__pyx_v_grid_mask->dimensions[__pyx_v_i])) != 0); - if (__pyx_t_3) { - } else { - __pyx_t_16 = __pyx_t_3; - goto __pyx_L22_bool_binop_done; - } - __pyx_t_3 = (((__pyx_v_step[__pyx_v_i]) < 0) != 0); - __pyx_t_16 = __pyx_t_3; - __pyx_L22_bool_binop_done:; - if (__pyx_t_16) { - - /* "yt/utilities/lib/ray_integrators.pyx":176 - * tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])*iv_dir[i] - * if cur_ind[i] == grid_mask.shape[i] and step[i] < 0: - * cur_ind[i] = grid_mask.shape[i] - 1 # <<<<<<<<<<<<<< - * if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])*iv_dir[i] - * if step[i] < 0: tmax[i] = (((cur_ind[i]+0)*dx[i])+left_edge[i]-u[i])*iv_dir[i] - */ - (__pyx_v_cur_ind[__pyx_v_i]) = ((__pyx_v_grid_mask->dimensions[__pyx_v_i]) - 1); - - /* "yt/utilities/lib/ray_integrators.pyx":175 - * cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) - * tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])*iv_dir[i] - * if cur_ind[i] == grid_mask.shape[i] and step[i] < 0: # <<<<<<<<<<<<<< - * cur_ind[i] = grid_mask.shape[i] - 1 - * if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])*iv_dir[i] - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":177 - * if cur_ind[i] == grid_mask.shape[i] and step[i] < 0: - * cur_ind[i] = grid_mask.shape[i] - 1 - * if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])*iv_dir[i] # <<<<<<<<<<<<<< - * if step[i] < 0: tmax[i] = (((cur_ind[i]+0)*dx[i])+left_edge[i]-u[i])*iv_dir[i] - * tdelta[i] = (dx[i]*iv_dir[i]) - */ - __pyx_t_16 = (((__pyx_v_step[__pyx_v_i]) > 0) != 0); - if (__pyx_t_16) { - __pyx_t_53 = __pyx_v_i; - __pyx_t_54 = __pyx_v_i; - __pyx_t_55 = __pyx_v_i; - (__pyx_v_tmax[__pyx_v_i]) = ((((((__pyx_v_cur_ind[__pyx_v_i]) + 1) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_dx.diminfo[0].strides))) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_left_edge.diminfo[0].strides))) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_u.diminfo[0].strides))) * (__pyx_v_iv_dir[__pyx_v_i])); - } - - /* "yt/utilities/lib/ray_integrators.pyx":178 - * cur_ind[i] = grid_mask.shape[i] - 1 - * if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])*iv_dir[i] - * if step[i] < 0: tmax[i] = (((cur_ind[i]+0)*dx[i])+left_edge[i]-u[i])*iv_dir[i] # <<<<<<<<<<<<<< - * tdelta[i] = (dx[i]*iv_dir[i]) - * if tdelta[i] < 0: tdelta[i] *= -1 - */ - __pyx_t_16 = (((__pyx_v_step[__pyx_v_i]) < 0) != 0); - if (__pyx_t_16) { - __pyx_t_56 = __pyx_v_i; - __pyx_t_57 = __pyx_v_i; - __pyx_t_58 = __pyx_v_i; - (__pyx_v_tmax[__pyx_v_i]) = ((((((__pyx_v_cur_ind[__pyx_v_i]) + 0) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_dx.diminfo[0].strides))) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_left_edge.diminfo[0].strides))) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_u.diminfo[0].strides))) * (__pyx_v_iv_dir[__pyx_v_i])); - } - - /* "yt/utilities/lib/ray_integrators.pyx":179 - * if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])*iv_dir[i] - * if step[i] < 0: tmax[i] = (((cur_ind[i]+0)*dx[i])+left_edge[i]-u[i])*iv_dir[i] - * tdelta[i] = (dx[i]*iv_dir[i]) # <<<<<<<<<<<<<< - * if tdelta[i] < 0: tdelta[i] *= -1 - * # The variable intersect contains the point we first pierce the grid - */ - __pyx_t_59 = __pyx_v_i; - (__pyx_v_tdelta[__pyx_v_i]) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_dx.diminfo[0].strides)) * (__pyx_v_iv_dir[__pyx_v_i])); - - /* "yt/utilities/lib/ray_integrators.pyx":180 - * if step[i] < 0: tmax[i] = (((cur_ind[i]+0)*dx[i])+left_edge[i]-u[i])*iv_dir[i] - * tdelta[i] = (dx[i]*iv_dir[i]) - * if tdelta[i] < 0: tdelta[i] *= -1 # <<<<<<<<<<<<<< - * # The variable intersect contains the point we first pierce the grid - * enter_t = intersect_t - */ - __pyx_t_16 = (((__pyx_v_tdelta[__pyx_v_i]) < 0.0) != 0); - if (__pyx_t_16) { - __pyx_t_60 = __pyx_v_i; - (__pyx_v_tdelta[__pyx_t_60]) = ((__pyx_v_tdelta[__pyx_t_60]) * -1.0); - } - } - - /* "yt/utilities/lib/ray_integrators.pyx":182 - * if tdelta[i] < 0: tdelta[i] *= -1 - * # The variable intersect contains the point we first pierce the grid - * enter_t = intersect_t # <<<<<<<<<<<<<< - * while 1: - * if (not (0 <= cur_ind[0] < grid_mask.shape[0])) or \ - */ - __pyx_v_enter_t = __pyx_v_intersect_t; - - /* "yt/utilities/lib/ray_integrators.pyx":183 - * # The variable intersect contains the point we first pierce the grid - * enter_t = intersect_t - * while 1: # <<<<<<<<<<<<<< - * if (not (0 <= cur_ind[0] < grid_mask.shape[0])) or \ - * (not (0 <= cur_ind[1] < grid_mask.shape[1])) or \ - */ - while (1) { - - /* "yt/utilities/lib/ray_integrators.pyx":184 - * enter_t = intersect_t - * while 1: - * if (not (0 <= cur_ind[0] < grid_mask.shape[0])) or \ # <<<<<<<<<<<<<< - * (not (0 <= cur_ind[1] < grid_mask.shape[1])) or \ - * (not (0 <= cur_ind[2] < grid_mask.shape[2])): - */ - __pyx_t_3 = (0 <= (__pyx_v_cur_ind[0])); - if (__pyx_t_3) { - __pyx_t_3 = ((__pyx_v_cur_ind[0]) < (__pyx_v_grid_mask->dimensions[0])); - } - __pyx_t_14 = ((!(__pyx_t_3 != 0)) != 0); - if (!__pyx_t_14) { - } else { - __pyx_t_16 = __pyx_t_14; - goto __pyx_L30_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":185 - * while 1: - * if (not (0 <= cur_ind[0] < grid_mask.shape[0])) or \ - * (not (0 <= cur_ind[1] < grid_mask.shape[1])) or \ # <<<<<<<<<<<<<< - * (not (0 <= cur_ind[2] < grid_mask.shape[2])): - * break - */ - __pyx_t_14 = (0 <= (__pyx_v_cur_ind[1])); - if (__pyx_t_14) { - __pyx_t_14 = ((__pyx_v_cur_ind[1]) < (__pyx_v_grid_mask->dimensions[1])); - } - __pyx_t_3 = ((!(__pyx_t_14 != 0)) != 0); - if (!__pyx_t_3) { - } else { - __pyx_t_16 = __pyx_t_3; - goto __pyx_L30_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":186 - * if (not (0 <= cur_ind[0] < grid_mask.shape[0])) or \ - * (not (0 <= cur_ind[1] < grid_mask.shape[1])) or \ - * (not (0 <= cur_ind[2] < grid_mask.shape[2])): # <<<<<<<<<<<<<< - * break - * # Note that we are calculating t on the fly, but we get *negative* t - */ - __pyx_t_3 = (0 <= (__pyx_v_cur_ind[2])); - if (__pyx_t_3) { - __pyx_t_3 = ((__pyx_v_cur_ind[2]) < (__pyx_v_grid_mask->dimensions[2])); - } - __pyx_t_14 = ((!(__pyx_t_3 != 0)) != 0); - __pyx_t_16 = __pyx_t_14; - __pyx_L30_bool_binop_done:; - - /* "yt/utilities/lib/ray_integrators.pyx":184 - * enter_t = intersect_t - * while 1: - * if (not (0 <= cur_ind[0] < grid_mask.shape[0])) or \ # <<<<<<<<<<<<<< - * (not (0 <= cur_ind[1] < grid_mask.shape[1])) or \ - * (not (0 <= cur_ind[2] < grid_mask.shape[2])): - */ - if (__pyx_t_16) { - - /* "yt/utilities/lib/ray_integrators.pyx":187 - * (not (0 <= cur_ind[1] < grid_mask.shape[1])) or \ - * (not (0 <= cur_ind[2] < grid_mask.shape[2])): - * break # <<<<<<<<<<<<<< - * # Note that we are calculating t on the fly, but we get *negative* t - * # values from what they should be. - */ - goto __pyx_L28_break; - - /* "yt/utilities/lib/ray_integrators.pyx":184 - * enter_t = intersect_t - * while 1: - * if (not (0 <= cur_ind[0] < grid_mask.shape[0])) or \ # <<<<<<<<<<<<<< - * (not (0 <= cur_ind[1] < grid_mask.shape[1])) or \ - * (not (0 <= cur_ind[2] < grid_mask.shape[2])): - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":191 - * # values from what they should be. - * # If we've reached t = 1, we are done. - * grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1 # <<<<<<<<<<<<<< - * if (tmax[0] > 1.0) and (tmax[1] > 1.0) and (tmax[2] > 1.0): - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - */ - __pyx_t_49 = (__pyx_v_cur_ind[0]); - __pyx_t_61 = (__pyx_v_cur_ind[1]); - __pyx_t_62 = (__pyx_v_cur_ind[2]); - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_grid_mask.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_grid_mask.diminfo[0].strides, __pyx_t_61, __pyx_pybuffernd_grid_mask.diminfo[1].strides, __pyx_t_62, __pyx_pybuffernd_grid_mask.diminfo[2].strides) = 1; - - /* "yt/utilities/lib/ray_integrators.pyx":192 - * # If we've reached t = 1, we are done. - * grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1 - * if (tmax[0] > 1.0) and (tmax[1] > 1.0) and (tmax[2] > 1.0): # <<<<<<<<<<<<<< - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - enter_t - */ - __pyx_t_14 = (((__pyx_v_tmax[0]) > 1.0) != 0); - if (__pyx_t_14) { - } else { - __pyx_t_16 = __pyx_t_14; - goto __pyx_L34_bool_binop_done; - } - __pyx_t_14 = (((__pyx_v_tmax[1]) > 1.0) != 0); - if (__pyx_t_14) { - } else { - __pyx_t_16 = __pyx_t_14; - goto __pyx_L34_bool_binop_done; - } - __pyx_t_14 = (((__pyx_v_tmax[2]) > 1.0) != 0); - __pyx_t_16 = __pyx_t_14; - __pyx_L34_bool_binop_done:; - if (__pyx_t_16) { - - /* "yt/utilities/lib/ray_integrators.pyx":193 - * grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1 - * if (tmax[0] > 1.0) and (tmax[1] > 1.0) and (tmax[2] > 1.0): - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 # <<<<<<<<<<<<<< - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - enter_t - * break - */ - __pyx_t_63 = (__pyx_v_cur_ind[0]); - __pyx_t_64 = (__pyx_v_cur_ind[1]); - __pyx_t_65 = (__pyx_v_cur_ind[2]); - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_t.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_grid_t.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_grid_t.diminfo[1].strides, __pyx_t_65, __pyx_pybuffernd_grid_t.diminfo[2].strides) = 1.0; - - /* "yt/utilities/lib/ray_integrators.pyx":194 - * if (tmax[0] > 1.0) and (tmax[1] > 1.0) and (tmax[2] > 1.0): - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - enter_t # <<<<<<<<<<<<<< - * break - * if tmax[0] < tmax[1]: - */ - __pyx_t_66 = (__pyx_v_cur_ind[0]); - __pyx_t_67 = (__pyx_v_cur_ind[1]); - __pyx_t_68 = (__pyx_v_cur_ind[2]); - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_dt.rcbuffer->pybuffer.buf, __pyx_t_66, __pyx_pybuffernd_grid_dt.diminfo[0].strides, __pyx_t_67, __pyx_pybuffernd_grid_dt.diminfo[1].strides, __pyx_t_68, __pyx_pybuffernd_grid_dt.diminfo[2].strides) = (1.0 - __pyx_v_enter_t); - - /* "yt/utilities/lib/ray_integrators.pyx":195 - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - enter_t - * break # <<<<<<<<<<<<<< - * if tmax[0] < tmax[1]: - * if tmax[0] < tmax[2]: - */ - goto __pyx_L28_break; - - /* "yt/utilities/lib/ray_integrators.pyx":192 - * # If we've reached t = 1, we are done. - * grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1 - * if (tmax[0] > 1.0) and (tmax[1] > 1.0) and (tmax[2] > 1.0): # <<<<<<<<<<<<<< - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - enter_t - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":196 - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - enter_t - * break - * if tmax[0] < tmax[1]: # <<<<<<<<<<<<<< - * if tmax[0] < tmax[2]: - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - */ - __pyx_t_16 = (((__pyx_v_tmax[0]) < (__pyx_v_tmax[1])) != 0); - if (__pyx_t_16) { - - /* "yt/utilities/lib/ray_integrators.pyx":197 - * break - * if tmax[0] < tmax[1]: - * if tmax[0] < tmax[2]: # <<<<<<<<<<<<<< - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[0] - enter_t - */ - __pyx_t_16 = (((__pyx_v_tmax[0]) < (__pyx_v_tmax[2])) != 0); - if (__pyx_t_16) { - - /* "yt/utilities/lib/ray_integrators.pyx":198 - * if tmax[0] < tmax[1]: - * if tmax[0] < tmax[2]: - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t # <<<<<<<<<<<<<< - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[0] - enter_t - * enter_t = tmax[0] - */ - __pyx_t_69 = (__pyx_v_cur_ind[0]); - __pyx_t_70 = (__pyx_v_cur_ind[1]); - __pyx_t_71 = (__pyx_v_cur_ind[2]); - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_t.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_grid_t.diminfo[0].strides, __pyx_t_70, __pyx_pybuffernd_grid_t.diminfo[1].strides, __pyx_t_71, __pyx_pybuffernd_grid_t.diminfo[2].strides) = __pyx_v_enter_t; - - /* "yt/utilities/lib/ray_integrators.pyx":199 - * if tmax[0] < tmax[2]: - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[0] - enter_t # <<<<<<<<<<<<<< - * enter_t = tmax[0] - * tmax[0] += tdelta[0] - */ - __pyx_t_72 = (__pyx_v_cur_ind[0]); - __pyx_t_73 = (__pyx_v_cur_ind[1]); - __pyx_t_74 = (__pyx_v_cur_ind[2]); - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_dt.rcbuffer->pybuffer.buf, __pyx_t_72, __pyx_pybuffernd_grid_dt.diminfo[0].strides, __pyx_t_73, __pyx_pybuffernd_grid_dt.diminfo[1].strides, __pyx_t_74, __pyx_pybuffernd_grid_dt.diminfo[2].strides) = ((__pyx_v_tmax[0]) - __pyx_v_enter_t); - - /* "yt/utilities/lib/ray_integrators.pyx":200 - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[0] - enter_t - * enter_t = tmax[0] # <<<<<<<<<<<<<< - * tmax[0] += tdelta[0] - * cur_ind[0] += step[0] - */ - __pyx_v_enter_t = (__pyx_v_tmax[0]); - - /* "yt/utilities/lib/ray_integrators.pyx":201 - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[0] - enter_t - * enter_t = tmax[0] - * tmax[0] += tdelta[0] # <<<<<<<<<<<<<< - * cur_ind[0] += step[0] - * else: - */ - __pyx_t_75 = 0; - (__pyx_v_tmax[__pyx_t_75]) = ((__pyx_v_tmax[__pyx_t_75]) + (__pyx_v_tdelta[0])); - - /* "yt/utilities/lib/ray_integrators.pyx":202 - * enter_t = tmax[0] - * tmax[0] += tdelta[0] - * cur_ind[0] += step[0] # <<<<<<<<<<<<<< - * else: - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - */ - __pyx_t_75 = 0; - (__pyx_v_cur_ind[__pyx_t_75]) = ((__pyx_v_cur_ind[__pyx_t_75]) + (__pyx_v_step[0])); - - /* "yt/utilities/lib/ray_integrators.pyx":197 - * break - * if tmax[0] < tmax[1]: - * if tmax[0] < tmax[2]: # <<<<<<<<<<<<<< - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[0] - enter_t - */ - goto __pyx_L38; - } - - /* "yt/utilities/lib/ray_integrators.pyx":204 - * cur_ind[0] += step[0] - * else: - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t # <<<<<<<<<<<<<< - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[2] - enter_t - * enter_t = tmax[2] - */ - /*else*/ { - __pyx_t_76 = (__pyx_v_cur_ind[0]); - __pyx_t_77 = (__pyx_v_cur_ind[1]); - __pyx_t_78 = (__pyx_v_cur_ind[2]); - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_t.rcbuffer->pybuffer.buf, __pyx_t_76, __pyx_pybuffernd_grid_t.diminfo[0].strides, __pyx_t_77, __pyx_pybuffernd_grid_t.diminfo[1].strides, __pyx_t_78, __pyx_pybuffernd_grid_t.diminfo[2].strides) = __pyx_v_enter_t; - - /* "yt/utilities/lib/ray_integrators.pyx":205 - * else: - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[2] - enter_t # <<<<<<<<<<<<<< - * enter_t = tmax[2] - * tmax[2] += tdelta[2] - */ - __pyx_t_79 = (__pyx_v_cur_ind[0]); - __pyx_t_80 = (__pyx_v_cur_ind[1]); - __pyx_t_81 = (__pyx_v_cur_ind[2]); - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_dt.rcbuffer->pybuffer.buf, __pyx_t_79, __pyx_pybuffernd_grid_dt.diminfo[0].strides, __pyx_t_80, __pyx_pybuffernd_grid_dt.diminfo[1].strides, __pyx_t_81, __pyx_pybuffernd_grid_dt.diminfo[2].strides) = ((__pyx_v_tmax[2]) - __pyx_v_enter_t); - - /* "yt/utilities/lib/ray_integrators.pyx":206 - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[2] - enter_t - * enter_t = tmax[2] # <<<<<<<<<<<<<< - * tmax[2] += tdelta[2] - * cur_ind[2] += step[2] - */ - __pyx_v_enter_t = (__pyx_v_tmax[2]); - - /* "yt/utilities/lib/ray_integrators.pyx":207 - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[2] - enter_t - * enter_t = tmax[2] - * tmax[2] += tdelta[2] # <<<<<<<<<<<<<< - * cur_ind[2] += step[2] - * else: - */ - __pyx_t_75 = 2; - (__pyx_v_tmax[__pyx_t_75]) = ((__pyx_v_tmax[__pyx_t_75]) + (__pyx_v_tdelta[2])); - - /* "yt/utilities/lib/ray_integrators.pyx":208 - * enter_t = tmax[2] - * tmax[2] += tdelta[2] - * cur_ind[2] += step[2] # <<<<<<<<<<<<<< - * else: - * if tmax[1] < tmax[2]: - */ - __pyx_t_75 = 2; - (__pyx_v_cur_ind[__pyx_t_75]) = ((__pyx_v_cur_ind[__pyx_t_75]) + (__pyx_v_step[2])); - } - __pyx_L38:; - - /* "yt/utilities/lib/ray_integrators.pyx":196 - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - enter_t - * break - * if tmax[0] < tmax[1]: # <<<<<<<<<<<<<< - * if tmax[0] < tmax[2]: - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - */ - goto __pyx_L37; - } - - /* "yt/utilities/lib/ray_integrators.pyx":210 - * cur_ind[2] += step[2] - * else: - * if tmax[1] < tmax[2]: # <<<<<<<<<<<<<< - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[1] - enter_t - */ - /*else*/ { - __pyx_t_16 = (((__pyx_v_tmax[1]) < (__pyx_v_tmax[2])) != 0); - if (__pyx_t_16) { - - /* "yt/utilities/lib/ray_integrators.pyx":211 - * else: - * if tmax[1] < tmax[2]: - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t # <<<<<<<<<<<<<< - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[1] - enter_t - * enter_t = tmax[1] - */ - __pyx_t_82 = (__pyx_v_cur_ind[0]); - __pyx_t_83 = (__pyx_v_cur_ind[1]); - __pyx_t_84 = (__pyx_v_cur_ind[2]); - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_t.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_grid_t.diminfo[0].strides, __pyx_t_83, __pyx_pybuffernd_grid_t.diminfo[1].strides, __pyx_t_84, __pyx_pybuffernd_grid_t.diminfo[2].strides) = __pyx_v_enter_t; - - /* "yt/utilities/lib/ray_integrators.pyx":212 - * if tmax[1] < tmax[2]: - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[1] - enter_t # <<<<<<<<<<<<<< - * enter_t = tmax[1] - * tmax[1] += tdelta[1] - */ - __pyx_t_85 = (__pyx_v_cur_ind[0]); - __pyx_t_86 = (__pyx_v_cur_ind[1]); - __pyx_t_87 = (__pyx_v_cur_ind[2]); - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_dt.rcbuffer->pybuffer.buf, __pyx_t_85, __pyx_pybuffernd_grid_dt.diminfo[0].strides, __pyx_t_86, __pyx_pybuffernd_grid_dt.diminfo[1].strides, __pyx_t_87, __pyx_pybuffernd_grid_dt.diminfo[2].strides) = ((__pyx_v_tmax[1]) - __pyx_v_enter_t); - - /* "yt/utilities/lib/ray_integrators.pyx":213 - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[1] - enter_t - * enter_t = tmax[1] # <<<<<<<<<<<<<< - * tmax[1] += tdelta[1] - * cur_ind[1] += step[1] - */ - __pyx_v_enter_t = (__pyx_v_tmax[1]); - - /* "yt/utilities/lib/ray_integrators.pyx":214 - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[1] - enter_t - * enter_t = tmax[1] - * tmax[1] += tdelta[1] # <<<<<<<<<<<<<< - * cur_ind[1] += step[1] - * else: - */ - __pyx_t_75 = 1; - (__pyx_v_tmax[__pyx_t_75]) = ((__pyx_v_tmax[__pyx_t_75]) + (__pyx_v_tdelta[1])); - - /* "yt/utilities/lib/ray_integrators.pyx":215 - * enter_t = tmax[1] - * tmax[1] += tdelta[1] - * cur_ind[1] += step[1] # <<<<<<<<<<<<<< - * else: - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - */ - __pyx_t_75 = 1; - (__pyx_v_cur_ind[__pyx_t_75]) = ((__pyx_v_cur_ind[__pyx_t_75]) + (__pyx_v_step[1])); - - /* "yt/utilities/lib/ray_integrators.pyx":210 - * cur_ind[2] += step[2] - * else: - * if tmax[1] < tmax[2]: # <<<<<<<<<<<<<< - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[1] - enter_t - */ - goto __pyx_L39; - } - - /* "yt/utilities/lib/ray_integrators.pyx":217 - * cur_ind[1] += step[1] - * else: - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t # <<<<<<<<<<<<<< - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[2] - enter_t - * enter_t = tmax[2] - */ - /*else*/ { - __pyx_t_88 = (__pyx_v_cur_ind[0]); - __pyx_t_89 = (__pyx_v_cur_ind[1]); - __pyx_t_90 = (__pyx_v_cur_ind[2]); - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_t.rcbuffer->pybuffer.buf, __pyx_t_88, __pyx_pybuffernd_grid_t.diminfo[0].strides, __pyx_t_89, __pyx_pybuffernd_grid_t.diminfo[1].strides, __pyx_t_90, __pyx_pybuffernd_grid_t.diminfo[2].strides) = __pyx_v_enter_t; - - /* "yt/utilities/lib/ray_integrators.pyx":218 - * else: - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[2] - enter_t # <<<<<<<<<<<<<< - * enter_t = tmax[2] - * tmax[2] += tdelta[2] - */ - __pyx_t_91 = (__pyx_v_cur_ind[0]); - __pyx_t_92 = (__pyx_v_cur_ind[1]); - __pyx_t_93 = (__pyx_v_cur_ind[2]); - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_grid_dt.rcbuffer->pybuffer.buf, __pyx_t_91, __pyx_pybuffernd_grid_dt.diminfo[0].strides, __pyx_t_92, __pyx_pybuffernd_grid_dt.diminfo[1].strides, __pyx_t_93, __pyx_pybuffernd_grid_dt.diminfo[2].strides) = ((__pyx_v_tmax[2]) - __pyx_v_enter_t); - - /* "yt/utilities/lib/ray_integrators.pyx":219 - * grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[2] - enter_t - * enter_t = tmax[2] # <<<<<<<<<<<<<< - * tmax[2] += tdelta[2] - * cur_ind[2] += step[2] - */ - __pyx_v_enter_t = (__pyx_v_tmax[2]); - - /* "yt/utilities/lib/ray_integrators.pyx":220 - * grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[2] - enter_t - * enter_t = tmax[2] - * tmax[2] += tdelta[2] # <<<<<<<<<<<<<< - * cur_ind[2] += step[2] - * return - */ - __pyx_t_75 = 2; - (__pyx_v_tmax[__pyx_t_75]) = ((__pyx_v_tmax[__pyx_t_75]) + (__pyx_v_tdelta[2])); - - /* "yt/utilities/lib/ray_integrators.pyx":221 - * enter_t = tmax[2] - * tmax[2] += tdelta[2] - * cur_ind[2] += step[2] # <<<<<<<<<<<<<< - * return - * - */ - __pyx_t_75 = 2; - (__pyx_v_cur_ind[__pyx_t_75]) = ((__pyx_v_cur_ind[__pyx_t_75]) + (__pyx_v_step[2])); - } - __pyx_L39:; - } - __pyx_L37:; - } - __pyx_L28_break:; - - /* "yt/utilities/lib/ray_integrators.pyx":222 - * tmax[2] += tdelta[2] - * cur_ind[2] += step[2] - * return # <<<<<<<<<<<<<< - * - * @cython.wraparound(False) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "yt/utilities/lib/ray_integrators.pyx":117 - * @cython.wraparound(False) - * @cython.boundscheck(False) - * def VoxelTraversal(np.ndarray[np.int_t, ndim=3] grid_mask, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=3] grid_t, - * np.ndarray[np.float64_t, ndim=3] grid_dt, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_40); - __Pyx_XDECREF(__pyx_t_41); - __Pyx_XDECREF(__pyx_t_42); - __Pyx_XDECREF(__pyx_t_47); - __Pyx_XDECREF(__pyx_t_48); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grid_dt.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grid_mask.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grid_t.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.ray_integrators.VoxelTraversal", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grid_dt.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grid_mask.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grid_t.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/lib/ray_integrators.pyx":226 - * @cython.wraparound(False) - * @cython.boundscheck(False) - * def PlaneVoxelIntegration(np.ndarray[np.float64_t, ndim=1] left_edge, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] right_edge, - * np.ndarray[np.float64_t, ndim=1] dx, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_15ray_integrators_9PlaneVoxelIntegration(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_15ray_integrators_9PlaneVoxelIntegration = {"PlaneVoxelIntegration", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15ray_integrators_9PlaneVoxelIntegration, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_15ray_integrators_9PlaneVoxelIntegration(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_left_edge = 0; - PyArrayObject *__pyx_v_right_edge = 0; - PyArrayObject *__pyx_v_dx = 0; - PyArrayObject *__pyx_v_ug = 0; - PyArrayObject *__pyx_v_v = 0; - PyArrayObject *__pyx_v_image = 0; - PyArrayObject *__pyx_v_data = 0; - PyArrayObject *__pyx_v_shells = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("PlaneVoxelIntegration (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left_edge,&__pyx_n_s_right_edge,&__pyx_n_s_dx,&__pyx_n_s_ug,&__pyx_n_s_v,&__pyx_n_s_image,&__pyx_n_s_data,&__pyx_n_s_shells,0}; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PlaneVoxelIntegration", 1, 8, 8, 1); __PYX_ERR(0, 226, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PlaneVoxelIntegration", 1, 8, 8, 2); __PYX_ERR(0, 226, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ug)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PlaneVoxelIntegration", 1, 8, 8, 3); __PYX_ERR(0, 226, __pyx_L3_error) - } - case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PlaneVoxelIntegration", 1, 8, 8, 4); __PYX_ERR(0, 226, __pyx_L3_error) - } - case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PlaneVoxelIntegration", 1, 8, 8, 5); __PYX_ERR(0, 226, __pyx_L3_error) - } - case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PlaneVoxelIntegration", 1, 8, 8, 6); __PYX_ERR(0, 226, __pyx_L3_error) - } - case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shells)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("PlaneVoxelIntegration", 1, 8, 8, 7); __PYX_ERR(0, 226, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PlaneVoxelIntegration") < 0)) __PYX_ERR(0, 226, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - } - __pyx_v_left_edge = ((PyArrayObject *)values[0]); - __pyx_v_right_edge = ((PyArrayObject *)values[1]); - __pyx_v_dx = ((PyArrayObject *)values[2]); - __pyx_v_ug = ((PyArrayObject *)values[3]); - __pyx_v_v = ((PyArrayObject *)values[4]); - __pyx_v_image = ((PyArrayObject *)values[5]); - __pyx_v_data = ((PyArrayObject *)values[6]); - __pyx_v_shells = ((PyArrayObject *)values[7]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("PlaneVoxelIntegration", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 226, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.ray_integrators.PlaneVoxelIntegration", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 226, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 227, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dx), __pyx_ptype_5numpy_ndarray, 1, "dx", 0))) __PYX_ERR(0, 228, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ug), __pyx_ptype_5numpy_ndarray, 1, "ug", 0))) __PYX_ERR(0, 229, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 230, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 231, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 232, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shells), __pyx_ptype_5numpy_ndarray, 1, "shells", 0))) __PYX_ERR(0, 233, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_15ray_integrators_8PlaneVoxelIntegration(__pyx_self, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_dx, __pyx_v_ug, __pyx_v_v, __pyx_v_image, __pyx_v_data, __pyx_v_shells); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_3lib_15ray_integrators_8PlaneVoxelIntegration(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_right_edge, PyArrayObject *__pyx_v_dx, PyArrayObject *__pyx_v_ug, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_image, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_shells) { - int __pyx_v_i; - int __pyx_v_vi; - int __pyx_v_nv; - int __pyx_v_nshells; - PyArrayObject *__pyx_v_u = 0; - __Pyx_LocalBuf_ND __pyx_pybuffernd_data; - __Pyx_Buffer __pyx_pybuffer_data; - __Pyx_LocalBuf_ND __pyx_pybuffernd_dx; - __Pyx_Buffer __pyx_pybuffer_dx; - __Pyx_LocalBuf_ND __pyx_pybuffernd_image; - __Pyx_Buffer __pyx_pybuffer_image; - __Pyx_LocalBuf_ND __pyx_pybuffernd_left_edge; - __Pyx_Buffer __pyx_pybuffer_left_edge; - __Pyx_LocalBuf_ND __pyx_pybuffernd_right_edge; - __Pyx_Buffer __pyx_pybuffer_right_edge; - __Pyx_LocalBuf_ND __pyx_pybuffernd_shells; - __Pyx_Buffer __pyx_pybuffer_shells; - __Pyx_LocalBuf_ND __pyx_pybuffernd_u; - __Pyx_Buffer __pyx_pybuffer_u; - __Pyx_LocalBuf_ND __pyx_pybuffernd_ug; - __Pyx_Buffer __pyx_pybuffer_ug; - __Pyx_LocalBuf_ND __pyx_pybuffernd_v; - __Pyx_Buffer __pyx_pybuffer_v; - 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; - PyArrayObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - Py_ssize_t __pyx_t_9; - Py_ssize_t __pyx_t_10; - Py_ssize_t __pyx_t_11; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - __Pyx_RefNannySetupContext("PlaneVoxelIntegration", 0); - __pyx_pybuffer_u.pybuffer.buf = NULL; - __pyx_pybuffer_u.refcount = 0; - __pyx_pybuffernd_u.data = NULL; - __pyx_pybuffernd_u.rcbuffer = &__pyx_pybuffer_u; - __pyx_pybuffer_left_edge.pybuffer.buf = NULL; - __pyx_pybuffer_left_edge.refcount = 0; - __pyx_pybuffernd_left_edge.data = NULL; - __pyx_pybuffernd_left_edge.rcbuffer = &__pyx_pybuffer_left_edge; - __pyx_pybuffer_right_edge.pybuffer.buf = NULL; - __pyx_pybuffer_right_edge.refcount = 0; - __pyx_pybuffernd_right_edge.data = NULL; - __pyx_pybuffernd_right_edge.rcbuffer = &__pyx_pybuffer_right_edge; - __pyx_pybuffer_dx.pybuffer.buf = NULL; - __pyx_pybuffer_dx.refcount = 0; - __pyx_pybuffernd_dx.data = NULL; - __pyx_pybuffernd_dx.rcbuffer = &__pyx_pybuffer_dx; - __pyx_pybuffer_ug.pybuffer.buf = NULL; - __pyx_pybuffer_ug.refcount = 0; - __pyx_pybuffernd_ug.data = NULL; - __pyx_pybuffernd_ug.rcbuffer = &__pyx_pybuffer_ug; - __pyx_pybuffer_v.pybuffer.buf = NULL; - __pyx_pybuffer_v.refcount = 0; - __pyx_pybuffernd_v.data = NULL; - __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v; - __pyx_pybuffer_image.pybuffer.buf = NULL; - __pyx_pybuffer_image.refcount = 0; - __pyx_pybuffernd_image.data = NULL; - __pyx_pybuffernd_image.rcbuffer = &__pyx_pybuffer_image; - __pyx_pybuffer_data.pybuffer.buf = NULL; - __pyx_pybuffer_data.refcount = 0; - __pyx_pybuffernd_data.data = NULL; - __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; - __pyx_pybuffer_shells.pybuffer.buf = NULL; - __pyx_pybuffer_shells.refcount = 0; - __pyx_pybuffernd_shells.data = NULL; - __pyx_pybuffernd_shells.rcbuffer = &__pyx_pybuffer_shells; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 226, __pyx_L1_error) - } - __pyx_pybuffernd_left_edge.diminfo[0].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edge.diminfo[0].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 226, __pyx_L1_error) - } - __pyx_pybuffernd_right_edge.diminfo[0].strides = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edge.diminfo[0].shape = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dx.rcbuffer->pybuffer, (PyObject*)__pyx_v_dx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 226, __pyx_L1_error) - } - __pyx_pybuffernd_dx.diminfo[0].strides = __pyx_pybuffernd_dx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dx.diminfo[0].shape = __pyx_pybuffernd_dx.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ug.rcbuffer->pybuffer, (PyObject*)__pyx_v_ug, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 226, __pyx_L1_error) - } - __pyx_pybuffernd_ug.diminfo[0].strides = __pyx_pybuffernd_ug.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ug.diminfo[0].shape = __pyx_pybuffernd_ug.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ug.diminfo[1].strides = __pyx_pybuffernd_ug.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ug.diminfo[1].shape = __pyx_pybuffernd_ug.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 226, __pyx_L1_error) - } - __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 226, __pyx_L1_error) - } - __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_image.diminfo[1].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_image.diminfo[1].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 226, __pyx_L1_error) - } - __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_data.diminfo[2].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_data.diminfo[2].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[2]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_shells.rcbuffer->pybuffer, (PyObject*)__pyx_v_shells, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 226, __pyx_L1_error) - } - __pyx_pybuffernd_shells.diminfo[0].strides = __pyx_pybuffernd_shells.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_shells.diminfo[0].shape = __pyx_pybuffernd_shells.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_shells.diminfo[1].strides = __pyx_pybuffernd_shells.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_shells.diminfo[1].shape = __pyx_pybuffernd_shells.rcbuffer->pybuffer.shape[1]; - - /* "yt/utilities/lib/ray_integrators.pyx":238 - * # generalized to transfer functions - * cdef int i, vi - * cdef int nv = ug.shape[0] # <<<<<<<<<<<<<< - * cdef int nshells = shells.shape[0] - * cdef np.ndarray[np.float64_t, ndim=1] u = np.empty((3,), dtype=np.float64) - */ - __pyx_v_nv = (__pyx_v_ug->dimensions[0]); - - /* "yt/utilities/lib/ray_integrators.pyx":239 - * cdef int i, vi - * cdef int nv = ug.shape[0] - * cdef int nshells = shells.shape[0] # <<<<<<<<<<<<<< - * cdef np.ndarray[np.float64_t, ndim=1] u = np.empty((3,), dtype=np.float64) - * # Copy things into temporary location for passing between functions - */ - __pyx_v_nshells = (__pyx_v_shells->dimensions[0]); - - /* "yt/utilities/lib/ray_integrators.pyx":240 - * cdef int nv = ug.shape[0] - * cdef int nshells = shells.shape[0] - * cdef np.ndarray[np.float64_t, ndim=1] u = np.empty((3,), dtype=np.float64) # <<<<<<<<<<<<<< - * # Copy things into temporary location for passing between functions - * for vi in range(nv): - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __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, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __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, 240, __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, 240, __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, 240, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __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, 240, __pyx_L1_error) - __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - __pyx_v_u = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_u.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 240, __pyx_L1_error) - } else {__pyx_pybuffernd_u.diminfo[0].strides = __pyx_pybuffernd_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u.diminfo[0].shape = __pyx_pybuffernd_u.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_5 = 0; - __pyx_v_u = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":242 - * cdef np.ndarray[np.float64_t, ndim=1] u = np.empty((3,), dtype=np.float64) - * # Copy things into temporary location for passing between functions - * for vi in range(nv): # <<<<<<<<<<<<<< - * for i in range(3): u[i] = ug[vi, i] - * integrate_ray(u, v, left_edge, right_edge, dx, - */ - __pyx_t_6 = __pyx_v_nv; - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_vi = __pyx_t_7; - - /* "yt/utilities/lib/ray_integrators.pyx":243 - * # Copy things into temporary location for passing between functions - * for vi in range(nv): - * for i in range(3): u[i] = ug[vi, i] # <<<<<<<<<<<<<< - * integrate_ray(u, v, left_edge, right_edge, dx, - * nshells, vi, data, shells, image) - */ - for (__pyx_t_8 = 0; __pyx_t_8 < 3; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; - __pyx_t_9 = __pyx_v_vi; - __pyx_t_10 = __pyx_v_i; - __pyx_t_11 = __pyx_v_i; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_u.diminfo[0].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ug.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_ug.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_ug.diminfo[1].strides)); - } - - /* "yt/utilities/lib/ray_integrators.pyx":244 - * for vi in range(nv): - * for i in range(3): u[i] = ug[vi, i] - * integrate_ray(u, v, left_edge, right_edge, dx, # <<<<<<<<<<<<<< - * nshells, vi, data, shells, image) - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_integrate_ray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - - /* "yt/utilities/lib/ray_integrators.pyx":245 - * for i in range(3): u[i] = ug[vi, i] - * integrate_ray(u, v, left_edge, right_edge, dx, - * nshells, vi, data, shells, image) # <<<<<<<<<<<<<< - * - * @cython.wraparound(False) - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nshells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_vi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_8 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[11] = {__pyx_t_12, ((PyObject *)__pyx_v_u), ((PyObject *)__pyx_v_v), ((PyObject *)__pyx_v_left_edge), ((PyObject *)__pyx_v_right_edge), ((PyObject *)__pyx_v_dx), __pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_data), ((PyObject *)__pyx_v_shells), ((PyObject *)__pyx_v_image)}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 10+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __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[11] = {__pyx_t_12, ((PyObject *)__pyx_v_u), ((PyObject *)__pyx_v_v), ((PyObject *)__pyx_v_left_edge), ((PyObject *)__pyx_v_right_edge), ((PyObject *)__pyx_v_dx), __pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_data), ((PyObject *)__pyx_v_shells), ((PyObject *)__pyx_v_image)}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 10+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - { - __pyx_t_13 = PyTuple_New(10+__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - if (__pyx_t_12) { - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; - } - __Pyx_INCREF(((PyObject *)__pyx_v_u)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_u)); - PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_8, ((PyObject *)__pyx_v_u)); - __Pyx_INCREF(((PyObject *)__pyx_v_v)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_v)); - PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_8, ((PyObject *)__pyx_v_v)); - __Pyx_INCREF(((PyObject *)__pyx_v_left_edge)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_left_edge)); - PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_8, ((PyObject *)__pyx_v_left_edge)); - __Pyx_INCREF(((PyObject *)__pyx_v_right_edge)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_right_edge)); - PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_8, ((PyObject *)__pyx_v_right_edge)); - __Pyx_INCREF(((PyObject *)__pyx_v_dx)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_dx)); - PyTuple_SET_ITEM(__pyx_t_13, 4+__pyx_t_8, ((PyObject *)__pyx_v_dx)); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_13, 5+__pyx_t_8, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_13, 6+__pyx_t_8, __pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_v_data)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_data)); - PyTuple_SET_ITEM(__pyx_t_13, 7+__pyx_t_8, ((PyObject *)__pyx_v_data)); - __Pyx_INCREF(((PyObject *)__pyx_v_shells)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_shells)); - PyTuple_SET_ITEM(__pyx_t_13, 8+__pyx_t_8, ((PyObject *)__pyx_v_shells)); - __Pyx_INCREF(((PyObject *)__pyx_v_image)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_image)); - PyTuple_SET_ITEM(__pyx_t_13, 9+__pyx_t_8, ((PyObject *)__pyx_v_image)); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - - /* "yt/utilities/lib/ray_integrators.pyx":226 - * @cython.wraparound(False) - * @cython.boundscheck(False) - * def PlaneVoxelIntegration(np.ndarray[np.float64_t, ndim=1] left_edge, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] right_edge, - * np.ndarray[np.float64_t, ndim=1] dx, - */ - - /* 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_12); - __Pyx_XDECREF(__pyx_t_13); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_image.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_shells.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ug.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.ray_integrators.PlaneVoxelIntegration", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_image.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_shells.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ug.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_u); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/lib/ray_integrators.pyx":249 - * @cython.wraparound(False) - * @cython.boundscheck(False) - * def integrate_ray(np.ndarray[np.float64_t, ndim=1] u, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] v, - * np.ndarray[np.float64_t, ndim=1] left_edge, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_3lib_15ray_integrators_11integrate_ray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_15ray_integrators_11integrate_ray = {"integrate_ray", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_15ray_integrators_11integrate_ray, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_2yt_9utilities_3lib_15ray_integrators_11integrate_ray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_u = 0; - PyArrayObject *__pyx_v_v = 0; - PyArrayObject *__pyx_v_left_edge = 0; - PyArrayObject *__pyx_v_right_edge = 0; - PyArrayObject *__pyx_v_dx = 0; - int __pyx_v_nshells; - int __pyx_v_ind; - PyArrayObject *__pyx_v_data = 0; - PyArrayObject *__pyx_v_shells = 0; - PyArrayObject *__pyx_v_image = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("integrate_ray (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_v,&__pyx_n_s_left_edge,&__pyx_n_s_right_edge,&__pyx_n_s_dx,&__pyx_n_s_nshells,&__pyx_n_s_ind,&__pyx_n_s_data,&__pyx_n_s_shells,&__pyx_n_s_image,0}; - PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("integrate_ray", 1, 10, 10, 1); __PYX_ERR(0, 249, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("integrate_ray", 1, 10, 10, 2); __PYX_ERR(0, 249, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("integrate_ray", 1, 10, 10, 3); __PYX_ERR(0, 249, __pyx_L3_error) - } - case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("integrate_ray", 1, 10, 10, 4); __PYX_ERR(0, 249, __pyx_L3_error) - } - case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nshells)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("integrate_ray", 1, 10, 10, 5); __PYX_ERR(0, 249, __pyx_L3_error) - } - case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ind)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("integrate_ray", 1, 10, 10, 6); __PYX_ERR(0, 249, __pyx_L3_error) - } - case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("integrate_ray", 1, 10, 10, 7); __PYX_ERR(0, 249, __pyx_L3_error) - } - case 8: - if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shells)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("integrate_ray", 1, 10, 10, 8); __PYX_ERR(0, 249, __pyx_L3_error) - } - case 9: - if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("integrate_ray", 1, 10, 10, 9); __PYX_ERR(0, 249, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_ray") < 0)) __PYX_ERR(0, 249, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 10) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - } - __pyx_v_u = ((PyArrayObject *)values[0]); - __pyx_v_v = ((PyArrayObject *)values[1]); - __pyx_v_left_edge = ((PyArrayObject *)values[2]); - __pyx_v_right_edge = ((PyArrayObject *)values[3]); - __pyx_v_dx = ((PyArrayObject *)values[4]); - __pyx_v_nshells = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nshells == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L3_error) - __pyx_v_ind = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_ind == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L3_error) - __pyx_v_data = ((PyArrayObject *)values[7]); - __pyx_v_shells = ((PyArrayObject *)values[8]); - __pyx_v_image = ((PyArrayObject *)values[9]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("integrate_ray", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 249, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.lib.ray_integrators.integrate_ray", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_5numpy_ndarray, 1, "u", 0))) __PYX_ERR(0, 249, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 250, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 251, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 252, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dx), __pyx_ptype_5numpy_ndarray, 1, "dx", 0))) __PYX_ERR(0, 253, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 255, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shells), __pyx_ptype_5numpy_ndarray, 1, "shells", 0))) __PYX_ERR(0, 256, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 257, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_3lib_15ray_integrators_10integrate_ray(__pyx_self, __pyx_v_u, __pyx_v_v, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_dx, __pyx_v_nshells, __pyx_v_ind, __pyx_v_data, __pyx_v_shells, __pyx_v_image); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_3lib_15ray_integrators_10integrate_ray(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_u, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_right_edge, PyArrayObject *__pyx_v_dx, int __pyx_v_nshells, int __pyx_v_ind, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_shells, PyArrayObject *__pyx_v_image) { - int __pyx_v_x; - int __pyx_v_y; - int __pyx_v_i; - int __pyx_v_n; - int __pyx_v_step[3]; - __pyx_t_5numpy_float64_t __pyx_v_intersect_t; - __pyx_t_5numpy_float64_t __pyx_v_tl; - __pyx_t_5numpy_float64_t __pyx_v_tr; - __pyx_t_5numpy_float64_t __pyx_v_enter_t; - __pyx_t_5numpy_int64_t __pyx_v_cur_ind[3]; - __pyx_t_5numpy_float64_t __pyx_v_tdelta[3]; - __pyx_t_5numpy_float64_t __pyx_v_tmax[3]; - __pyx_t_5numpy_float64_t __pyx_v_intersect[3]; - __pyx_t_5numpy_float64_t __pyx_v_dv; - __pyx_t_5numpy_float64_t __pyx_v_dist; - __pyx_t_5numpy_float64_t __pyx_v_alpha; - int __pyx_v_dims[3]; - __pyx_t_5numpy_float64_t __pyx_v_temp_x; - __pyx_t_5numpy_float64_t __pyx_v_temp_y; - CYTHON_UNUSED PyObject *__pyx_v_dt = NULL; - __Pyx_LocalBuf_ND __pyx_pybuffernd_data; - __Pyx_Buffer __pyx_pybuffer_data; - __Pyx_LocalBuf_ND __pyx_pybuffernd_dx; - __Pyx_Buffer __pyx_pybuffer_dx; - __Pyx_LocalBuf_ND __pyx_pybuffernd_image; - __Pyx_Buffer __pyx_pybuffer_image; - __Pyx_LocalBuf_ND __pyx_pybuffernd_left_edge; - __Pyx_Buffer __pyx_pybuffer_left_edge; - __Pyx_LocalBuf_ND __pyx_pybuffernd_right_edge; - __Pyx_Buffer __pyx_pybuffer_right_edge; - __Pyx_LocalBuf_ND __pyx_pybuffernd_shells; - __Pyx_Buffer __pyx_pybuffer_shells; - __Pyx_LocalBuf_ND __pyx_pybuffernd_u; - __Pyx_Buffer __pyx_pybuffer_u; - __Pyx_LocalBuf_ND __pyx_pybuffernd_v; - __Pyx_Buffer __pyx_pybuffer_v; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - Py_ssize_t __pyx_t_5; - __pyx_t_5numpy_float64_t __pyx_t_6; - Py_ssize_t __pyx_t_7; - __pyx_t_5numpy_float64_t __pyx_t_8; - Py_ssize_t __pyx_t_9; - Py_ssize_t __pyx_t_10; - Py_ssize_t __pyx_t_11; - Py_ssize_t __pyx_t_12; - Py_ssize_t __pyx_t_13; - Py_ssize_t __pyx_t_14; - Py_ssize_t __pyx_t_15; - Py_ssize_t __pyx_t_16; - int __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; - Py_ssize_t __pyx_t_26; - Py_ssize_t __pyx_t_27; - Py_ssize_t __pyx_t_28; - Py_ssize_t __pyx_t_29; - Py_ssize_t __pyx_t_30; - Py_ssize_t __pyx_t_31; - int __pyx_t_32; - Py_ssize_t __pyx_t_33; - Py_ssize_t __pyx_t_34; - Py_ssize_t __pyx_t_35; - Py_ssize_t __pyx_t_36; - Py_ssize_t __pyx_t_37; - Py_ssize_t __pyx_t_38; - Py_ssize_t __pyx_t_39; - Py_ssize_t __pyx_t_40; - PyObject *__pyx_t_41 = NULL; - PyObject *__pyx_t_42 = NULL; - PyObject *__pyx_t_43 = NULL; - Py_ssize_t __pyx_t_44; - Py_ssize_t __pyx_t_45; - Py_ssize_t __pyx_t_46; - PyObject *__pyx_t_47 = NULL; - PyObject *__pyx_t_48 = NULL; - __pyx_t_5numpy_int64_t __pyx_t_49; - Py_ssize_t __pyx_t_50; - Py_ssize_t __pyx_t_51; - Py_ssize_t __pyx_t_52; - Py_ssize_t __pyx_t_53; - Py_ssize_t __pyx_t_54; - Py_ssize_t __pyx_t_55; - Py_ssize_t __pyx_t_56; - Py_ssize_t __pyx_t_57; - Py_ssize_t __pyx_t_58; - Py_ssize_t __pyx_t_59; - Py_ssize_t __pyx_t_60; - Py_ssize_t __pyx_t_61; - Py_ssize_t __pyx_t_62; - Py_ssize_t __pyx_t_63; - int __pyx_t_64; - __pyx_t_5numpy_int64_t __pyx_t_65; - __pyx_t_5numpy_int64_t __pyx_t_66; - Py_ssize_t __pyx_t_67; - Py_ssize_t __pyx_t_68; - Py_ssize_t __pyx_t_69; - Py_ssize_t __pyx_t_70; - Py_ssize_t __pyx_t_71; - Py_ssize_t __pyx_t_72; - Py_ssize_t __pyx_t_73; - Py_ssize_t __pyx_t_74; - Py_ssize_t __pyx_t_75; - Py_ssize_t __pyx_t_76; - Py_ssize_t __pyx_t_77; - Py_ssize_t __pyx_t_78; - Py_ssize_t __pyx_t_79; - Py_ssize_t __pyx_t_80; - Py_ssize_t __pyx_t_81; - Py_ssize_t __pyx_t_82; - Py_ssize_t __pyx_t_83; - Py_ssize_t __pyx_t_84; - Py_ssize_t __pyx_t_85; - Py_ssize_t __pyx_t_86; - Py_ssize_t __pyx_t_87; - Py_ssize_t __pyx_t_88; - Py_ssize_t __pyx_t_89; - Py_ssize_t __pyx_t_90; - Py_ssize_t __pyx_t_91; - Py_ssize_t __pyx_t_92; - long __pyx_t_93; - __pyx_t_5numpy_int64_t __pyx_t_94; - __pyx_t_5numpy_int64_t __pyx_t_95; - __pyx_t_5numpy_int64_t __pyx_t_96; - __Pyx_RefNannySetupContext("integrate_ray", 0); - __pyx_pybuffer_u.pybuffer.buf = NULL; - __pyx_pybuffer_u.refcount = 0; - __pyx_pybuffernd_u.data = NULL; - __pyx_pybuffernd_u.rcbuffer = &__pyx_pybuffer_u; - __pyx_pybuffer_v.pybuffer.buf = NULL; - __pyx_pybuffer_v.refcount = 0; - __pyx_pybuffernd_v.data = NULL; - __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v; - __pyx_pybuffer_left_edge.pybuffer.buf = NULL; - __pyx_pybuffer_left_edge.refcount = 0; - __pyx_pybuffernd_left_edge.data = NULL; - __pyx_pybuffernd_left_edge.rcbuffer = &__pyx_pybuffer_left_edge; - __pyx_pybuffer_right_edge.pybuffer.buf = NULL; - __pyx_pybuffer_right_edge.refcount = 0; - __pyx_pybuffernd_right_edge.data = NULL; - __pyx_pybuffernd_right_edge.rcbuffer = &__pyx_pybuffer_right_edge; - __pyx_pybuffer_dx.pybuffer.buf = NULL; - __pyx_pybuffer_dx.refcount = 0; - __pyx_pybuffernd_dx.data = NULL; - __pyx_pybuffernd_dx.rcbuffer = &__pyx_pybuffer_dx; - __pyx_pybuffer_data.pybuffer.buf = NULL; - __pyx_pybuffer_data.refcount = 0; - __pyx_pybuffernd_data.data = NULL; - __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; - __pyx_pybuffer_shells.pybuffer.buf = NULL; - __pyx_pybuffer_shells.refcount = 0; - __pyx_pybuffernd_shells.data = NULL; - __pyx_pybuffernd_shells.rcbuffer = &__pyx_pybuffer_shells; - __pyx_pybuffer_image.pybuffer.buf = NULL; - __pyx_pybuffer_image.refcount = 0; - __pyx_pybuffernd_image.data = NULL; - __pyx_pybuffernd_image.rcbuffer = &__pyx_pybuffer_image; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_u, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 249, __pyx_L1_error) - } - __pyx_pybuffernd_u.diminfo[0].strides = __pyx_pybuffernd_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u.diminfo[0].shape = __pyx_pybuffernd_u.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 249, __pyx_L1_error) - } - __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 249, __pyx_L1_error) - } - __pyx_pybuffernd_left_edge.diminfo[0].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edge.diminfo[0].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 249, __pyx_L1_error) - } - __pyx_pybuffernd_right_edge.diminfo[0].strides = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edge.diminfo[0].shape = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dx.rcbuffer->pybuffer, (PyObject*)__pyx_v_dx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 249, __pyx_L1_error) - } - __pyx_pybuffernd_dx.diminfo[0].strides = __pyx_pybuffernd_dx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dx.diminfo[0].shape = __pyx_pybuffernd_dx.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 249, __pyx_L1_error) - } - __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_data.diminfo[2].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_data.diminfo[2].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[2]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_shells.rcbuffer->pybuffer, (PyObject*)__pyx_v_shells, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 249, __pyx_L1_error) - } - __pyx_pybuffernd_shells.diminfo[0].strides = __pyx_pybuffernd_shells.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_shells.diminfo[0].shape = __pyx_pybuffernd_shells.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_shells.diminfo[1].strides = __pyx_pybuffernd_shells.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_shells.diminfo[1].shape = __pyx_pybuffernd_shells.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 249, __pyx_L1_error) - } - __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_image.diminfo[1].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_image.diminfo[1].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[1]; - - /* "yt/utilities/lib/ray_integrators.pyx":260 - * cdef int x, y, i, n - * cdef int step[3] - * cdef np.float64_t intersect_t = 1 # <<<<<<<<<<<<<< - * cdef np.float64_t tl, tr, enter_t - * cdef np.int64_t cur_ind[3] - */ - __pyx_v_intersect_t = 1.0; - - /* "yt/utilities/lib/ray_integrators.pyx":270 - * cdef int dims[3] - * cdef np.float64_t temp_x, temp_y - * for i in range(3): # <<<<<<<<<<<<<< - * # As long as we're iterating, set some other stuff, too - * dims[i] = data.shape[i] - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "yt/utilities/lib/ray_integrators.pyx":272 - * for i in range(3): - * # As long as we're iterating, set some other stuff, too - * dims[i] = data.shape[i] # <<<<<<<<<<<<<< - * if(v[i] < 0): step[i] = -1 - * else: step[i] = 1 - */ - (__pyx_v_dims[__pyx_v_i]) = (__pyx_v_data->dimensions[__pyx_v_i]); - - /* "yt/utilities/lib/ray_integrators.pyx":273 - * # As long as we're iterating, set some other stuff, too - * dims[i] = data.shape[i] - * if(v[i] < 0): step[i] = -1 # <<<<<<<<<<<<<< - * else: step[i] = 1 - * x = (i+1)%3 - */ - __pyx_t_2 = __pyx_v_i; - __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_v.diminfo[0].strides)) < 0.0) != 0); - if (__pyx_t_3) { - (__pyx_v_step[__pyx_v_i]) = -1; - goto __pyx_L5; - } - - /* "yt/utilities/lib/ray_integrators.pyx":274 - * dims[i] = data.shape[i] - * if(v[i] < 0): step[i] = -1 - * else: step[i] = 1 # <<<<<<<<<<<<<< - * x = (i+1)%3 - * y = (i+2)%3 - */ - /*else*/ { - (__pyx_v_step[__pyx_v_i]) = 1; - } - __pyx_L5:; - - /* "yt/utilities/lib/ray_integrators.pyx":275 - * if(v[i] < 0): step[i] = -1 - * else: step[i] = 1 - * x = (i+1)%3 # <<<<<<<<<<<<<< - * y = (i+2)%3 - * tl = (left_edge[i] - u[i])/v[i] - */ - __pyx_v_x = __Pyx_mod_long((__pyx_v_i + 1), 3); - - /* "yt/utilities/lib/ray_integrators.pyx":276 - * else: step[i] = 1 - * x = (i+1)%3 - * y = (i+2)%3 # <<<<<<<<<<<<<< - * tl = (left_edge[i] - u[i])/v[i] - * tr = (right_edge[i] - u[i])/v[i] - */ - __pyx_v_y = __Pyx_mod_long((__pyx_v_i + 2), 3); - - /* "yt/utilities/lib/ray_integrators.pyx":277 - * x = (i+1)%3 - * y = (i+2)%3 - * tl = (left_edge[i] - u[i])/v[i] # <<<<<<<<<<<<<< - * tr = (right_edge[i] - u[i])/v[i] - * temp_x = (u[x] + tl*v[x]) - */ - __pyx_t_4 = __pyx_v_i; - __pyx_t_5 = __pyx_v_i; - __pyx_t_6 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_left_edge.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_u.diminfo[0].strides))); - __pyx_t_7 = __pyx_v_i; - __pyx_t_8 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_v.diminfo[0].strides)); - if (unlikely(__pyx_t_8 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 277, __pyx_L1_error) - } - __pyx_v_tl = (__pyx_t_6 / __pyx_t_8); - - /* "yt/utilities/lib/ray_integrators.pyx":278 - * y = (i+2)%3 - * tl = (left_edge[i] - u[i])/v[i] - * tr = (right_edge[i] - u[i])/v[i] # <<<<<<<<<<<<<< - * temp_x = (u[x] + tl*v[x]) - * temp_y = (u[y] + tl*v[y]) - */ - __pyx_t_9 = __pyx_v_i; - __pyx_t_10 = __pyx_v_i; - __pyx_t_8 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right_edge.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_u.diminfo[0].strides))); - __pyx_t_11 = __pyx_v_i; - __pyx_t_6 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_v.diminfo[0].strides)); - if (unlikely(__pyx_t_6 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 278, __pyx_L1_error) - } - __pyx_v_tr = (__pyx_t_8 / __pyx_t_6); - - /* "yt/utilities/lib/ray_integrators.pyx":279 - * tl = (left_edge[i] - u[i])/v[i] - * tr = (right_edge[i] - u[i])/v[i] - * temp_x = (u[x] + tl*v[x]) # <<<<<<<<<<<<<< - * temp_y = (u[y] + tl*v[y]) - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ - */ - __pyx_t_12 = __pyx_v_x; - __pyx_t_13 = __pyx_v_x; - __pyx_v_temp_x = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_u.diminfo[0].strides)) + (__pyx_v_tl * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides)))); - - /* "yt/utilities/lib/ray_integrators.pyx":280 - * tr = (right_edge[i] - u[i])/v[i] - * temp_x = (u[x] + tl*v[x]) - * temp_y = (u[y] + tl*v[y]) # <<<<<<<<<<<<<< - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - */ - __pyx_t_14 = __pyx_v_y; - __pyx_t_15 = __pyx_v_y; - __pyx_v_temp_y = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_u.diminfo[0].strides)) + (__pyx_v_tl * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_v.diminfo[0].strides)))); - - /* "yt/utilities/lib/ray_integrators.pyx":281 - * temp_x = (u[x] + tl*v[x]) - * temp_y = (u[y] + tl*v[y]) - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ # <<<<<<<<<<<<<< - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - * (0.0 <= tl) and (tl < intersect_t): - */ - __pyx_t_16 = __pyx_v_x; - __pyx_t_17 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_v_temp_x) != 0); - if (__pyx_t_17) { - } else { - __pyx_t_3 = __pyx_t_17; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_18 = __pyx_v_x; - __pyx_t_17 = ((__pyx_v_temp_x <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_right_edge.diminfo[0].strides))) != 0); - if (__pyx_t_17) { - } else { - __pyx_t_3 = __pyx_t_17; - goto __pyx_L7_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":282 - * temp_y = (u[y] + tl*v[y]) - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ # <<<<<<<<<<<<<< - * (0.0 <= tl) and (tl < intersect_t): - * intersect_t = tl - */ - __pyx_t_19 = __pyx_v_y; - __pyx_t_17 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_v_temp_y) != 0); - if (__pyx_t_17) { - } else { - __pyx_t_3 = __pyx_t_17; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_20 = __pyx_v_y; - __pyx_t_17 = ((__pyx_v_temp_y <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_right_edge.diminfo[0].strides))) != 0); - if (__pyx_t_17) { - } else { - __pyx_t_3 = __pyx_t_17; - goto __pyx_L7_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":283 - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - * (0.0 <= tl) and (tl < intersect_t): # <<<<<<<<<<<<<< - * intersect_t = tl - * temp_x = (u[x] + tr*v[x]) - */ - __pyx_t_17 = ((0.0 <= __pyx_v_tl) != 0); - if (__pyx_t_17) { - } else { - __pyx_t_3 = __pyx_t_17; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_17 = ((__pyx_v_tl < __pyx_v_intersect_t) != 0); - __pyx_t_3 = __pyx_t_17; - __pyx_L7_bool_binop_done:; - - /* "yt/utilities/lib/ray_integrators.pyx":281 - * temp_x = (u[x] + tl*v[x]) - * temp_y = (u[y] + tl*v[y]) - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ # <<<<<<<<<<<<<< - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - * (0.0 <= tl) and (tl < intersect_t): - */ - if (__pyx_t_3) { - - /* "yt/utilities/lib/ray_integrators.pyx":284 - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - * (0.0 <= tl) and (tl < intersect_t): - * intersect_t = tl # <<<<<<<<<<<<<< - * temp_x = (u[x] + tr*v[x]) - * temp_y = (u[y] + tr*v[y]) - */ - __pyx_v_intersect_t = __pyx_v_tl; - - /* "yt/utilities/lib/ray_integrators.pyx":281 - * temp_x = (u[x] + tl*v[x]) - * temp_y = (u[y] + tl*v[y]) - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ # <<<<<<<<<<<<<< - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - * (0.0 <= tl) and (tl < intersect_t): - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":285 - * (0.0 <= tl) and (tl < intersect_t): - * intersect_t = tl - * temp_x = (u[x] + tr*v[x]) # <<<<<<<<<<<<<< - * temp_y = (u[y] + tr*v[y]) - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ - */ - __pyx_t_21 = __pyx_v_x; - __pyx_t_22 = __pyx_v_x; - __pyx_v_temp_x = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_u.diminfo[0].strides)) + (__pyx_v_tr * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_v.diminfo[0].strides)))); - - /* "yt/utilities/lib/ray_integrators.pyx":286 - * intersect_t = tl - * temp_x = (u[x] + tr*v[x]) - * temp_y = (u[y] + tr*v[y]) # <<<<<<<<<<<<<< - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - */ - __pyx_t_23 = __pyx_v_y; - __pyx_t_24 = __pyx_v_y; - __pyx_v_temp_y = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_u.diminfo[0].strides)) + (__pyx_v_tr * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_v.diminfo[0].strides)))); - - /* "yt/utilities/lib/ray_integrators.pyx":287 - * temp_x = (u[x] + tr*v[x]) - * temp_y = (u[y] + tr*v[y]) - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ # <<<<<<<<<<<<<< - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - * (0.0 <= tr) and (tr < intersect_t): - */ - __pyx_t_25 = __pyx_v_x; - __pyx_t_17 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_v_temp_x) != 0); - if (__pyx_t_17) { - } else { - __pyx_t_3 = __pyx_t_17; - goto __pyx_L14_bool_binop_done; - } - __pyx_t_26 = __pyx_v_x; - __pyx_t_17 = ((__pyx_v_temp_x <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_right_edge.diminfo[0].strides))) != 0); - if (__pyx_t_17) { - } else { - __pyx_t_3 = __pyx_t_17; - goto __pyx_L14_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":288 - * temp_y = (u[y] + tr*v[y]) - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ # <<<<<<<<<<<<<< - * (0.0 <= tr) and (tr < intersect_t): - * intersect_t = tr - */ - __pyx_t_27 = __pyx_v_y; - __pyx_t_17 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_v_temp_y) != 0); - if (__pyx_t_17) { - } else { - __pyx_t_3 = __pyx_t_17; - goto __pyx_L14_bool_binop_done; - } - __pyx_t_28 = __pyx_v_y; - __pyx_t_17 = ((__pyx_v_temp_y <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_right_edge.diminfo[0].strides))) != 0); - if (__pyx_t_17) { - } else { - __pyx_t_3 = __pyx_t_17; - goto __pyx_L14_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":289 - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - * (0.0 <= tr) and (tr < intersect_t): # <<<<<<<<<<<<<< - * intersect_t = tr - * # if fully enclosed - */ - __pyx_t_17 = ((0.0 <= __pyx_v_tr) != 0); - if (__pyx_t_17) { - } else { - __pyx_t_3 = __pyx_t_17; - goto __pyx_L14_bool_binop_done; - } - __pyx_t_17 = ((__pyx_v_tr < __pyx_v_intersect_t) != 0); - __pyx_t_3 = __pyx_t_17; - __pyx_L14_bool_binop_done:; - - /* "yt/utilities/lib/ray_integrators.pyx":287 - * temp_x = (u[x] + tr*v[x]) - * temp_y = (u[y] + tr*v[y]) - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ # <<<<<<<<<<<<<< - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - * (0.0 <= tr) and (tr < intersect_t): - */ - if (__pyx_t_3) { - - /* "yt/utilities/lib/ray_integrators.pyx":290 - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - * (0.0 <= tr) and (tr < intersect_t): - * intersect_t = tr # <<<<<<<<<<<<<< - * # if fully enclosed - * if (left_edge[0] <= u[0] <= right_edge[0]) and \ - */ - __pyx_v_intersect_t = __pyx_v_tr; - - /* "yt/utilities/lib/ray_integrators.pyx":287 - * temp_x = (u[x] + tr*v[x]) - * temp_y = (u[y] + tr*v[y]) - * if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ # <<<<<<<<<<<<<< - * (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - * (0.0 <= tr) and (tr < intersect_t): - */ - } - } - - /* "yt/utilities/lib/ray_integrators.pyx":292 - * intersect_t = tr - * # if fully enclosed - * if (left_edge[0] <= u[0] <= right_edge[0]) and \ # <<<<<<<<<<<<<< - * (left_edge[1] <= u[1] <= right_edge[1]) and \ - * (left_edge[2] <= u[2] <= right_edge[2]): - */ - __pyx_t_29 = 0; - __pyx_t_30 = 0; - __pyx_t_6 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_u.diminfo[0].strides)); - __pyx_t_17 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_t_6); - if (__pyx_t_17) { - __pyx_t_31 = 0; - __pyx_t_17 = (__pyx_t_6 <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right_edge.diminfo[0].strides))); - } - __pyx_t_32 = (__pyx_t_17 != 0); - if (__pyx_t_32) { - } else { - __pyx_t_3 = __pyx_t_32; - goto __pyx_L21_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":293 - * # if fully enclosed - * if (left_edge[0] <= u[0] <= right_edge[0]) and \ - * (left_edge[1] <= u[1] <= right_edge[1]) and \ # <<<<<<<<<<<<<< - * (left_edge[2] <= u[2] <= right_edge[2]): - * intersect_t = 0.0 - */ - __pyx_t_33 = 1; - __pyx_t_34 = 1; - __pyx_t_6 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_u.diminfo[0].strides)); - __pyx_t_32 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_t_6); - if (__pyx_t_32) { - __pyx_t_35 = 1; - __pyx_t_32 = (__pyx_t_6 <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_right_edge.diminfo[0].strides))); - } - __pyx_t_17 = (__pyx_t_32 != 0); - if (__pyx_t_17) { - } else { - __pyx_t_3 = __pyx_t_17; - goto __pyx_L21_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":294 - * if (left_edge[0] <= u[0] <= right_edge[0]) and \ - * (left_edge[1] <= u[1] <= right_edge[1]) and \ - * (left_edge[2] <= u[2] <= right_edge[2]): # <<<<<<<<<<<<<< - * intersect_t = 0.0 - * if not (0 <= intersect_t <= 1): - */ - __pyx_t_36 = 2; - __pyx_t_37 = 2; - __pyx_t_6 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_u.diminfo[0].strides)); - __pyx_t_17 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left_edge.diminfo[0].strides)) <= __pyx_t_6); - if (__pyx_t_17) { - __pyx_t_38 = 2; - __pyx_t_17 = (__pyx_t_6 <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_right_edge.diminfo[0].strides))); - } - __pyx_t_32 = (__pyx_t_17 != 0); - __pyx_t_3 = __pyx_t_32; - __pyx_L21_bool_binop_done:; - - /* "yt/utilities/lib/ray_integrators.pyx":292 - * intersect_t = tr - * # if fully enclosed - * if (left_edge[0] <= u[0] <= right_edge[0]) and \ # <<<<<<<<<<<<<< - * (left_edge[1] <= u[1] <= right_edge[1]) and \ - * (left_edge[2] <= u[2] <= right_edge[2]): - */ - if (__pyx_t_3) { - - /* "yt/utilities/lib/ray_integrators.pyx":295 - * (left_edge[1] <= u[1] <= right_edge[1]) and \ - * (left_edge[2] <= u[2] <= right_edge[2]): - * intersect_t = 0.0 # <<<<<<<<<<<<<< - * if not (0 <= intersect_t <= 1): - * #print "Returning: intersect_t ==", intersect_t - */ - __pyx_v_intersect_t = 0.0; - - /* "yt/utilities/lib/ray_integrators.pyx":292 - * intersect_t = tr - * # if fully enclosed - * if (left_edge[0] <= u[0] <= right_edge[0]) and \ # <<<<<<<<<<<<<< - * (left_edge[1] <= u[1] <= right_edge[1]) and \ - * (left_edge[2] <= u[2] <= right_edge[2]): - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":296 - * (left_edge[2] <= u[2] <= right_edge[2]): - * intersect_t = 0.0 - * if not (0 <= intersect_t <= 1): # <<<<<<<<<<<<<< - * #print "Returning: intersect_t ==", intersect_t - * return - */ - __pyx_t_3 = (0.0 <= __pyx_v_intersect_t); - if (__pyx_t_3) { - __pyx_t_3 = (__pyx_v_intersect_t <= 1.0); - } - __pyx_t_32 = ((!(__pyx_t_3 != 0)) != 0); - if (__pyx_t_32) { - - /* "yt/utilities/lib/ray_integrators.pyx":298 - * if not (0 <= intersect_t <= 1): - * #print "Returning: intersect_t ==", intersect_t - * return # <<<<<<<<<<<<<< - * # Now get the indices of the intersection - * for i in range(3): intersect[i] = u[i] + intersect_t * v[i] - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "yt/utilities/lib/ray_integrators.pyx":296 - * (left_edge[2] <= u[2] <= right_edge[2]): - * intersect_t = 0.0 - * if not (0 <= intersect_t <= 1): # <<<<<<<<<<<<<< - * #print "Returning: intersect_t ==", intersect_t - * return - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":300 - * return - * # Now get the indices of the intersection - * for i in range(3): intersect[i] = u[i] + intersect_t * v[i] # <<<<<<<<<<<<<< - * for i in range(3): - * cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - __pyx_t_39 = __pyx_v_i; - __pyx_t_40 = __pyx_v_i; - (__pyx_v_intersect[__pyx_v_i]) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_u.diminfo[0].strides)) + (__pyx_v_intersect_t * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_v.diminfo[0].strides)))); - } - - /* "yt/utilities/lib/ray_integrators.pyx":301 - * # Now get the indices of the intersection - * for i in range(3): intersect[i] = u[i] + intersect_t * v[i] - * for i in range(3): # <<<<<<<<<<<<<< - * cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) - * tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])/v[i] - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "yt/utilities/lib/ray_integrators.pyx":302 - * for i in range(3): intersect[i] = u[i] + intersect_t * v[i] - * for i in range(3): - * cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) # <<<<<<<<<<<<<< - * tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])/v[i] - * if cur_ind[i] == dims[i] and step[i] < 0: - */ - __pyx_t_42 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_42); - __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_floor); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_43); - __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; - __pyx_t_44 = __pyx_v_i; - __pyx_t_45 = __pyx_v_i; - __pyx_t_6 = (((__pyx_v_intersect[__pyx_v_i]) + (1e-8 * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_dx.diminfo[0].strides)))) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_left_edge.diminfo[0].strides))); - __pyx_t_46 = __pyx_v_i; - __pyx_t_8 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_dx.diminfo[0].strides)); - if (unlikely(__pyx_t_8 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 302, __pyx_L1_error) - } - __pyx_t_42 = PyFloat_FromDouble((__pyx_t_6 / __pyx_t_8)); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_42); - __pyx_t_47 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_43))) { - __pyx_t_47 = PyMethod_GET_SELF(__pyx_t_43); - if (likely(__pyx_t_47)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_43); - __Pyx_INCREF(__pyx_t_47); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_43, function); - } - } - if (!__pyx_t_47) { - __pyx_t_41 = __Pyx_PyObject_CallOneArg(__pyx_t_43, __pyx_t_42); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; - __Pyx_GOTREF(__pyx_t_41); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_43)) { - PyObject *__pyx_temp[2] = {__pyx_t_47, __pyx_t_42}; - __pyx_t_41 = __Pyx_PyFunction_FastCall(__pyx_t_43, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0; - __Pyx_GOTREF(__pyx_t_41); - __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_43)) { - PyObject *__pyx_temp[2] = {__pyx_t_47, __pyx_t_42}; - __pyx_t_41 = __Pyx_PyCFunction_FastCall(__pyx_t_43, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0; - __Pyx_GOTREF(__pyx_t_41); - __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; - } else - #endif - { - __pyx_t_48 = PyTuple_New(1+1); if (unlikely(!__pyx_t_48)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_48); - __Pyx_GIVEREF(__pyx_t_47); PyTuple_SET_ITEM(__pyx_t_48, 0, __pyx_t_47); __pyx_t_47 = NULL; - __Pyx_GIVEREF(__pyx_t_42); - PyTuple_SET_ITEM(__pyx_t_48, 0+1, __pyx_t_42); - __pyx_t_42 = 0; - __pyx_t_41 = __Pyx_PyObject_Call(__pyx_t_43, __pyx_t_48, NULL); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_41); - __Pyx_DECREF(__pyx_t_48); __pyx_t_48 = 0; - } - } - __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; - __pyx_t_49 = __Pyx_PyInt_As_npy_int64(__pyx_t_41); if (unlikely((__pyx_t_49 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; - (__pyx_v_cur_ind[__pyx_v_i]) = __pyx_t_49; - - /* "yt/utilities/lib/ray_integrators.pyx":303 - * for i in range(3): - * cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) - * tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])/v[i] # <<<<<<<<<<<<<< - * if cur_ind[i] == dims[i] and step[i] < 0: - * cur_ind[i] = dims[i] - 1 - */ - __pyx_t_50 = __pyx_v_i; - __pyx_t_51 = __pyx_v_i; - __pyx_t_52 = __pyx_v_i; - __pyx_t_8 = (((((__pyx_v_cur_ind[__pyx_v_i]) + (__pyx_v_step[__pyx_v_i])) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_dx.diminfo[0].strides))) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_left_edge.diminfo[0].strides))) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_u.diminfo[0].strides))); - __pyx_t_53 = __pyx_v_i; - __pyx_t_6 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_v.diminfo[0].strides)); - if (unlikely(__pyx_t_6 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 303, __pyx_L1_error) - } - (__pyx_v_tmax[__pyx_v_i]) = (__pyx_t_8 / __pyx_t_6); - - /* "yt/utilities/lib/ray_integrators.pyx":304 - * cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) - * tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])/v[i] - * if cur_ind[i] == dims[i] and step[i] < 0: # <<<<<<<<<<<<<< - * cur_ind[i] = dims[i] - 1 - * if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])/v[i] - */ - __pyx_t_3 = (((__pyx_v_cur_ind[__pyx_v_i]) == (__pyx_v_dims[__pyx_v_i])) != 0); - if (__pyx_t_3) { - } else { - __pyx_t_32 = __pyx_t_3; - goto __pyx_L30_bool_binop_done; - } - __pyx_t_3 = (((__pyx_v_step[__pyx_v_i]) < 0) != 0); - __pyx_t_32 = __pyx_t_3; - __pyx_L30_bool_binop_done:; - if (__pyx_t_32) { - - /* "yt/utilities/lib/ray_integrators.pyx":305 - * tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])/v[i] - * if cur_ind[i] == dims[i] and step[i] < 0: - * cur_ind[i] = dims[i] - 1 # <<<<<<<<<<<<<< - * if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])/v[i] - * if step[i] < 0: tmax[i] = (((cur_ind[i]+0)*dx[i])+left_edge[i]-u[i])/v[i] - */ - (__pyx_v_cur_ind[__pyx_v_i]) = ((__pyx_v_dims[__pyx_v_i]) - 1); - - /* "yt/utilities/lib/ray_integrators.pyx":304 - * cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) - * tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])/v[i] - * if cur_ind[i] == dims[i] and step[i] < 0: # <<<<<<<<<<<<<< - * cur_ind[i] = dims[i] - 1 - * if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])/v[i] - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":306 - * if cur_ind[i] == dims[i] and step[i] < 0: - * cur_ind[i] = dims[i] - 1 - * if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])/v[i] # <<<<<<<<<<<<<< - * if step[i] < 0: tmax[i] = (((cur_ind[i]+0)*dx[i])+left_edge[i]-u[i])/v[i] - * tdelta[i] = (dx[i]/v[i]) - */ - __pyx_t_32 = (((__pyx_v_step[__pyx_v_i]) > 0) != 0); - if (__pyx_t_32) { - __pyx_t_54 = __pyx_v_i; - __pyx_t_55 = __pyx_v_i; - __pyx_t_56 = __pyx_v_i; - __pyx_t_6 = (((((__pyx_v_cur_ind[__pyx_v_i]) + 1) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_dx.diminfo[0].strides))) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_left_edge.diminfo[0].strides))) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_u.diminfo[0].strides))); - __pyx_t_57 = __pyx_v_i; - __pyx_t_8 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_v.diminfo[0].strides)); - if (unlikely(__pyx_t_8 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 306, __pyx_L1_error) - } - (__pyx_v_tmax[__pyx_v_i]) = (__pyx_t_6 / __pyx_t_8); - } - - /* "yt/utilities/lib/ray_integrators.pyx":307 - * cur_ind[i] = dims[i] - 1 - * if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])/v[i] - * if step[i] < 0: tmax[i] = (((cur_ind[i]+0)*dx[i])+left_edge[i]-u[i])/v[i] # <<<<<<<<<<<<<< - * tdelta[i] = (dx[i]/v[i]) - * if tdelta[i] < 0: tdelta[i] *= -1 - */ - __pyx_t_32 = (((__pyx_v_step[__pyx_v_i]) < 0) != 0); - if (__pyx_t_32) { - __pyx_t_58 = __pyx_v_i; - __pyx_t_59 = __pyx_v_i; - __pyx_t_60 = __pyx_v_i; - __pyx_t_8 = (((((__pyx_v_cur_ind[__pyx_v_i]) + 0) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_dx.diminfo[0].strides))) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_left_edge.diminfo[0].strides))) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_u.diminfo[0].strides))); - __pyx_t_61 = __pyx_v_i; - __pyx_t_6 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_v.diminfo[0].strides)); - if (unlikely(__pyx_t_6 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 307, __pyx_L1_error) - } - (__pyx_v_tmax[__pyx_v_i]) = (__pyx_t_8 / __pyx_t_6); - } - - /* "yt/utilities/lib/ray_integrators.pyx":308 - * if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])/v[i] - * if step[i] < 0: tmax[i] = (((cur_ind[i]+0)*dx[i])+left_edge[i]-u[i])/v[i] - * tdelta[i] = (dx[i]/v[i]) # <<<<<<<<<<<<<< - * if tdelta[i] < 0: tdelta[i] *= -1 - * # The variable intersect contains the point we first pierce the grid - */ - __pyx_t_62 = __pyx_v_i; - __pyx_t_6 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dx.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_dx.diminfo[0].strides)); - __pyx_t_63 = __pyx_v_i; - __pyx_t_8 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_v.diminfo[0].strides)); - if (unlikely(__pyx_t_8 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 308, __pyx_L1_error) - } - (__pyx_v_tdelta[__pyx_v_i]) = (__pyx_t_6 / __pyx_t_8); - - /* "yt/utilities/lib/ray_integrators.pyx":309 - * if step[i] < 0: tmax[i] = (((cur_ind[i]+0)*dx[i])+left_edge[i]-u[i])/v[i] - * tdelta[i] = (dx[i]/v[i]) - * if tdelta[i] < 0: tdelta[i] *= -1 # <<<<<<<<<<<<<< - * # The variable intersect contains the point we first pierce the grid - * enter_t = intersect_t - */ - __pyx_t_32 = (((__pyx_v_tdelta[__pyx_v_i]) < 0.0) != 0); - if (__pyx_t_32) { - __pyx_t_64 = __pyx_v_i; - (__pyx_v_tdelta[__pyx_t_64]) = ((__pyx_v_tdelta[__pyx_t_64]) * -1.0); - } - } - - /* "yt/utilities/lib/ray_integrators.pyx":311 - * if tdelta[i] < 0: tdelta[i] *= -1 - * # The variable intersect contains the point we first pierce the grid - * enter_t = intersect_t # <<<<<<<<<<<<<< - * if (not (0 <= cur_ind[0] < dims[0])) or \ - * (not (0 <= cur_ind[1] < dims[1])) or \ - */ - __pyx_v_enter_t = __pyx_v_intersect_t; - - /* "yt/utilities/lib/ray_integrators.pyx":312 - * # The variable intersect contains the point we first pierce the grid - * enter_t = intersect_t - * if (not (0 <= cur_ind[0] < dims[0])) or \ # <<<<<<<<<<<<<< - * (not (0 <= cur_ind[1] < dims[1])) or \ - * (not (0 <= cur_ind[2] < dims[2])): - */ - __pyx_t_3 = (0 <= (__pyx_v_cur_ind[0])); - if (__pyx_t_3) { - __pyx_t_3 = ((__pyx_v_cur_ind[0]) < (__pyx_v_dims[0])); - } - __pyx_t_17 = ((!(__pyx_t_3 != 0)) != 0); - if (!__pyx_t_17) { - } else { - __pyx_t_32 = __pyx_t_17; - goto __pyx_L36_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":313 - * enter_t = intersect_t - * if (not (0 <= cur_ind[0] < dims[0])) or \ - * (not (0 <= cur_ind[1] < dims[1])) or \ # <<<<<<<<<<<<<< - * (not (0 <= cur_ind[2] < dims[2])): - * #print "Returning: cur_ind", cur_ind[0], cur_ind[1], cur_ind[2] - */ - __pyx_t_17 = (0 <= (__pyx_v_cur_ind[1])); - if (__pyx_t_17) { - __pyx_t_17 = ((__pyx_v_cur_ind[1]) < (__pyx_v_dims[1])); - } - __pyx_t_3 = ((!(__pyx_t_17 != 0)) != 0); - if (!__pyx_t_3) { - } else { - __pyx_t_32 = __pyx_t_3; - goto __pyx_L36_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":314 - * if (not (0 <= cur_ind[0] < dims[0])) or \ - * (not (0 <= cur_ind[1] < dims[1])) or \ - * (not (0 <= cur_ind[2] < dims[2])): # <<<<<<<<<<<<<< - * #print "Returning: cur_ind", cur_ind[0], cur_ind[1], cur_ind[2] - * #print " dims: ", dims[0], dims[1], dims[2] - */ - __pyx_t_3 = (0 <= (__pyx_v_cur_ind[2])); - if (__pyx_t_3) { - __pyx_t_3 = ((__pyx_v_cur_ind[2]) < (__pyx_v_dims[2])); - } - __pyx_t_17 = ((!(__pyx_t_3 != 0)) != 0); - __pyx_t_32 = __pyx_t_17; - __pyx_L36_bool_binop_done:; - - /* "yt/utilities/lib/ray_integrators.pyx":312 - * # The variable intersect contains the point we first pierce the grid - * enter_t = intersect_t - * if (not (0 <= cur_ind[0] < dims[0])) or \ # <<<<<<<<<<<<<< - * (not (0 <= cur_ind[1] < dims[1])) or \ - * (not (0 <= cur_ind[2] < dims[2])): - */ - if (__pyx_t_32) { - - /* "yt/utilities/lib/ray_integrators.pyx":321 - * #print " u :", u[0], u[1], u[2] - * # - * return # <<<<<<<<<<<<<< - * #print cur_ind[0], dims[0], cur_ind[1], dims[1], cur_ind[2], dims[2] - * dv = data[cur_ind[0], cur_ind[1], cur_ind[2]] - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "yt/utilities/lib/ray_integrators.pyx":312 - * # The variable intersect contains the point we first pierce the grid - * enter_t = intersect_t - * if (not (0 <= cur_ind[0] < dims[0])) or \ # <<<<<<<<<<<<<< - * (not (0 <= cur_ind[1] < dims[1])) or \ - * (not (0 <= cur_ind[2] < dims[2])): - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":323 - * return - * #print cur_ind[0], dims[0], cur_ind[1], dims[1], cur_ind[2], dims[2] - * dv = data[cur_ind[0], cur_ind[1], cur_ind[2]] # <<<<<<<<<<<<<< - * #dt = 1e300 - * while 1: - */ - __pyx_t_49 = (__pyx_v_cur_ind[0]); - __pyx_t_65 = (__pyx_v_cur_ind[1]); - __pyx_t_66 = (__pyx_v_cur_ind[2]); - __pyx_v_dv = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_65, __pyx_pybuffernd_data.diminfo[1].strides, __pyx_t_66, __pyx_pybuffernd_data.diminfo[2].strides)); - - /* "yt/utilities/lib/ray_integrators.pyx":325 - * dv = data[cur_ind[0], cur_ind[1], cur_ind[2]] - * #dt = 1e300 - * while 1: # <<<<<<<<<<<<<< - * if image[ind,3] >= 1.0: break - * if (not (0 <= cur_ind[0] < dims[0])) or \ - */ - while (1) { - - /* "yt/utilities/lib/ray_integrators.pyx":326 - * #dt = 1e300 - * while 1: - * if image[ind,3] >= 1.0: break # <<<<<<<<<<<<<< - * if (not (0 <= cur_ind[0] < dims[0])) or \ - * (not (0 <= cur_ind[1] < dims[1])) or \ - */ - __pyx_t_67 = __pyx_v_ind; - __pyx_t_68 = 3; - __pyx_t_32 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_68, __pyx_pybuffernd_image.diminfo[1].strides)) >= 1.0) != 0); - if (__pyx_t_32) { - goto __pyx_L40_break; - } - - /* "yt/utilities/lib/ray_integrators.pyx":327 - * while 1: - * if image[ind,3] >= 1.0: break - * if (not (0 <= cur_ind[0] < dims[0])) or \ # <<<<<<<<<<<<<< - * (not (0 <= cur_ind[1] < dims[1])) or \ - * (not (0 <= cur_ind[2] < dims[2])): - */ - __pyx_t_17 = (0 <= (__pyx_v_cur_ind[0])); - if (__pyx_t_17) { - __pyx_t_17 = ((__pyx_v_cur_ind[0]) < (__pyx_v_dims[0])); - } - __pyx_t_3 = ((!(__pyx_t_17 != 0)) != 0); - if (!__pyx_t_3) { - } else { - __pyx_t_32 = __pyx_t_3; - goto __pyx_L43_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":328 - * if image[ind,3] >= 1.0: break - * if (not (0 <= cur_ind[0] < dims[0])) or \ - * (not (0 <= cur_ind[1] < dims[1])) or \ # <<<<<<<<<<<<<< - * (not (0 <= cur_ind[2] < dims[2])): - * break - */ - __pyx_t_3 = (0 <= (__pyx_v_cur_ind[1])); - if (__pyx_t_3) { - __pyx_t_3 = ((__pyx_v_cur_ind[1]) < (__pyx_v_dims[1])); - } - __pyx_t_17 = ((!(__pyx_t_3 != 0)) != 0); - if (!__pyx_t_17) { - } else { - __pyx_t_32 = __pyx_t_17; - goto __pyx_L43_bool_binop_done; - } - - /* "yt/utilities/lib/ray_integrators.pyx":329 - * if (not (0 <= cur_ind[0] < dims[0])) or \ - * (not (0 <= cur_ind[1] < dims[1])) or \ - * (not (0 <= cur_ind[2] < dims[2])): # <<<<<<<<<<<<<< - * break - * # Do our transfer here - */ - __pyx_t_17 = (0 <= (__pyx_v_cur_ind[2])); - if (__pyx_t_17) { - __pyx_t_17 = ((__pyx_v_cur_ind[2]) < (__pyx_v_dims[2])); - } - __pyx_t_3 = ((!(__pyx_t_17 != 0)) != 0); - __pyx_t_32 = __pyx_t_3; - __pyx_L43_bool_binop_done:; - - /* "yt/utilities/lib/ray_integrators.pyx":327 - * while 1: - * if image[ind,3] >= 1.0: break - * if (not (0 <= cur_ind[0] < dims[0])) or \ # <<<<<<<<<<<<<< - * (not (0 <= cur_ind[1] < dims[1])) or \ - * (not (0 <= cur_ind[2] < dims[2])): - */ - if (__pyx_t_32) { - - /* "yt/utilities/lib/ray_integrators.pyx":330 - * (not (0 <= cur_ind[1] < dims[1])) or \ - * (not (0 <= cur_ind[2] < dims[2])): - * break # <<<<<<<<<<<<<< - * # Do our transfer here - * for n in range(nshells): - */ - goto __pyx_L40_break; - - /* "yt/utilities/lib/ray_integrators.pyx":327 - * while 1: - * if image[ind,3] >= 1.0: break - * if (not (0 <= cur_ind[0] < dims[0])) or \ # <<<<<<<<<<<<<< - * (not (0 <= cur_ind[1] < dims[1])) or \ - * (not (0 <= cur_ind[2] < dims[2])): - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":332 - * break - * # Do our transfer here - * for n in range(nshells): # <<<<<<<<<<<<<< - * dist = shells[n, 0] - dv - * if dist < shells[n,1]: - */ - __pyx_t_1 = __pyx_v_nshells; - for (__pyx_t_64 = 0; __pyx_t_64 < __pyx_t_1; __pyx_t_64+=1) { - __pyx_v_n = __pyx_t_64; - - /* "yt/utilities/lib/ray_integrators.pyx":333 - * # Do our transfer here - * for n in range(nshells): - * dist = shells[n, 0] - dv # <<<<<<<<<<<<<< - * if dist < shells[n,1]: - * dist = exp(-dist/8.0) - */ - __pyx_t_69 = __pyx_v_n; - __pyx_t_70 = 0; - __pyx_v_dist = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_70, __pyx_pybuffernd_shells.diminfo[1].strides)) - __pyx_v_dv); - - /* "yt/utilities/lib/ray_integrators.pyx":334 - * for n in range(nshells): - * dist = shells[n, 0] - dv - * if dist < shells[n,1]: # <<<<<<<<<<<<<< - * dist = exp(-dist/8.0) - * alpha = (1.0 - shells[n,5])*shells[n,5]#*dt - */ - __pyx_t_71 = __pyx_v_n; - __pyx_t_72 = 1; - __pyx_t_32 = ((__pyx_v_dist < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_71, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_72, __pyx_pybuffernd_shells.diminfo[1].strides))) != 0); - if (__pyx_t_32) { - - /* "yt/utilities/lib/ray_integrators.pyx":335 - * dist = shells[n, 0] - dv - * if dist < shells[n,1]: - * dist = exp(-dist/8.0) # <<<<<<<<<<<<<< - * alpha = (1.0 - shells[n,5])*shells[n,5]#*dt - * image[ind,0] += alpha*shells[n,2]*dist - */ - __pyx_v_dist = exp(((-__pyx_v_dist) / 8.0)); - - /* "yt/utilities/lib/ray_integrators.pyx":336 - * if dist < shells[n,1]: - * dist = exp(-dist/8.0) - * alpha = (1.0 - shells[n,5])*shells[n,5]#*dt # <<<<<<<<<<<<<< - * image[ind,0] += alpha*shells[n,2]*dist - * image[ind,1] += alpha*shells[n,3]*dist - */ - __pyx_t_73 = __pyx_v_n; - __pyx_t_74 = 5; - __pyx_t_75 = __pyx_v_n; - __pyx_t_76 = 5; - __pyx_v_alpha = ((1.0 - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_73, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_74, __pyx_pybuffernd_shells.diminfo[1].strides))) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_75, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_76, __pyx_pybuffernd_shells.diminfo[1].strides))); - - /* "yt/utilities/lib/ray_integrators.pyx":337 - * dist = exp(-dist/8.0) - * alpha = (1.0 - shells[n,5])*shells[n,5]#*dt - * image[ind,0] += alpha*shells[n,2]*dist # <<<<<<<<<<<<<< - * image[ind,1] += alpha*shells[n,3]*dist - * image[ind,2] += alpha*shells[n,4]*dist - */ - __pyx_t_77 = __pyx_v_n; - __pyx_t_78 = 2; - __pyx_t_79 = __pyx_v_ind; - __pyx_t_80 = 0; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_79, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_80, __pyx_pybuffernd_image.diminfo[1].strides) += ((__pyx_v_alpha * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_77, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_78, __pyx_pybuffernd_shells.diminfo[1].strides))) * __pyx_v_dist); - - /* "yt/utilities/lib/ray_integrators.pyx":338 - * alpha = (1.0 - shells[n,5])*shells[n,5]#*dt - * image[ind,0] += alpha*shells[n,2]*dist - * image[ind,1] += alpha*shells[n,3]*dist # <<<<<<<<<<<<<< - * image[ind,2] += alpha*shells[n,4]*dist - * image[ind,3] += alpha*shells[n,5]*dist - */ - __pyx_t_81 = __pyx_v_n; - __pyx_t_82 = 3; - __pyx_t_83 = __pyx_v_ind; - __pyx_t_84 = 1; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_83, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_84, __pyx_pybuffernd_image.diminfo[1].strides) += ((__pyx_v_alpha * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_81, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_82, __pyx_pybuffernd_shells.diminfo[1].strides))) * __pyx_v_dist); - - /* "yt/utilities/lib/ray_integrators.pyx":339 - * image[ind,0] += alpha*shells[n,2]*dist - * image[ind,1] += alpha*shells[n,3]*dist - * image[ind,2] += alpha*shells[n,4]*dist # <<<<<<<<<<<<<< - * image[ind,3] += alpha*shells[n,5]*dist - * #image[ind,i] += rgba[i]*dist*rgba[3]/dt - */ - __pyx_t_85 = __pyx_v_n; - __pyx_t_86 = 4; - __pyx_t_87 = __pyx_v_ind; - __pyx_t_88 = 2; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_87, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_88, __pyx_pybuffernd_image.diminfo[1].strides) += ((__pyx_v_alpha * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_85, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_86, __pyx_pybuffernd_shells.diminfo[1].strides))) * __pyx_v_dist); - - /* "yt/utilities/lib/ray_integrators.pyx":340 - * image[ind,1] += alpha*shells[n,3]*dist - * image[ind,2] += alpha*shells[n,4]*dist - * image[ind,3] += alpha*shells[n,5]*dist # <<<<<<<<<<<<<< - * #image[ind,i] += rgba[i]*dist*rgba[3]/dt - * #print rgba[i], image[ind,i], dist, dt - */ - __pyx_t_89 = __pyx_v_n; - __pyx_t_90 = 5; - __pyx_t_91 = __pyx_v_ind; - __pyx_t_92 = 3; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_91, __pyx_pybuffernd_image.diminfo[0].strides, __pyx_t_92, __pyx_pybuffernd_image.diminfo[1].strides) += ((__pyx_v_alpha * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_shells.rcbuffer->pybuffer.buf, __pyx_t_89, __pyx_pybuffernd_shells.diminfo[0].strides, __pyx_t_90, __pyx_pybuffernd_shells.diminfo[1].strides))) * __pyx_v_dist); - - /* "yt/utilities/lib/ray_integrators.pyx":343 - * #image[ind,i] += rgba[i]*dist*rgba[3]/dt - * #print rgba[i], image[ind,i], dist, dt - * break # <<<<<<<<<<<<<< - * if (tmax[0] > 1.0) and (tmax[1] > 1.0) and (tmax[2] > 1.0): - * dt = 1.0 - enter_t - */ - goto __pyx_L47_break; - - /* "yt/utilities/lib/ray_integrators.pyx":334 - * for n in range(nshells): - * dist = shells[n, 0] - dv - * if dist < shells[n,1]: # <<<<<<<<<<<<<< - * dist = exp(-dist/8.0) - * alpha = (1.0 - shells[n,5])*shells[n,5]#*dt - */ - } - } - __pyx_L47_break:; - - /* "yt/utilities/lib/ray_integrators.pyx":344 - * #print rgba[i], image[ind,i], dist, dt - * break - * if (tmax[0] > 1.0) and (tmax[1] > 1.0) and (tmax[2] > 1.0): # <<<<<<<<<<<<<< - * dt = 1.0 - enter_t - * break - */ - __pyx_t_3 = (((__pyx_v_tmax[0]) > 1.0) != 0); - if (__pyx_t_3) { - } else { - __pyx_t_32 = __pyx_t_3; - goto __pyx_L50_bool_binop_done; - } - __pyx_t_3 = (((__pyx_v_tmax[1]) > 1.0) != 0); - if (__pyx_t_3) { - } else { - __pyx_t_32 = __pyx_t_3; - goto __pyx_L50_bool_binop_done; - } - __pyx_t_3 = (((__pyx_v_tmax[2]) > 1.0) != 0); - __pyx_t_32 = __pyx_t_3; - __pyx_L50_bool_binop_done:; - if (__pyx_t_32) { - - /* "yt/utilities/lib/ray_integrators.pyx":345 - * break - * if (tmax[0] > 1.0) and (tmax[1] > 1.0) and (tmax[2] > 1.0): - * dt = 1.0 - enter_t # <<<<<<<<<<<<<< - * break - * if tmax[0] < tmax[1]: - */ - __pyx_t_41 = PyFloat_FromDouble((1.0 - __pyx_v_enter_t)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 345, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_41); - __Pyx_XDECREF_SET(__pyx_v_dt, __pyx_t_41); - __pyx_t_41 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":346 - * if (tmax[0] > 1.0) and (tmax[1] > 1.0) and (tmax[2] > 1.0): - * dt = 1.0 - enter_t - * break # <<<<<<<<<<<<<< - * if tmax[0] < tmax[1]: - * if tmax[0] < tmax[2]: - */ - goto __pyx_L40_break; - - /* "yt/utilities/lib/ray_integrators.pyx":344 - * #print rgba[i], image[ind,i], dist, dt - * break - * if (tmax[0] > 1.0) and (tmax[1] > 1.0) and (tmax[2] > 1.0): # <<<<<<<<<<<<<< - * dt = 1.0 - enter_t - * break - */ - } - - /* "yt/utilities/lib/ray_integrators.pyx":347 - * dt = 1.0 - enter_t - * break - * if tmax[0] < tmax[1]: # <<<<<<<<<<<<<< - * if tmax[0] < tmax[2]: - * dt = tmax[0] - enter_t - */ - __pyx_t_32 = (((__pyx_v_tmax[0]) < (__pyx_v_tmax[1])) != 0); - if (__pyx_t_32) { - - /* "yt/utilities/lib/ray_integrators.pyx":348 - * break - * if tmax[0] < tmax[1]: - * if tmax[0] < tmax[2]: # <<<<<<<<<<<<<< - * dt = tmax[0] - enter_t - * enter_t = tmax[0] - */ - __pyx_t_32 = (((__pyx_v_tmax[0]) < (__pyx_v_tmax[2])) != 0); - if (__pyx_t_32) { - - /* "yt/utilities/lib/ray_integrators.pyx":349 - * if tmax[0] < tmax[1]: - * if tmax[0] < tmax[2]: - * dt = tmax[0] - enter_t # <<<<<<<<<<<<<< - * enter_t = tmax[0] - * tmax[0] += tdelta[0] - */ - __pyx_t_41 = PyFloat_FromDouble(((__pyx_v_tmax[0]) - __pyx_v_enter_t)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_41); - __Pyx_XDECREF_SET(__pyx_v_dt, __pyx_t_41); - __pyx_t_41 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":350 - * if tmax[0] < tmax[2]: - * dt = tmax[0] - enter_t - * enter_t = tmax[0] # <<<<<<<<<<<<<< - * tmax[0] += tdelta[0] - * cur_ind[0] += step[0] - */ - __pyx_v_enter_t = (__pyx_v_tmax[0]); - - /* "yt/utilities/lib/ray_integrators.pyx":351 - * dt = tmax[0] - enter_t - * enter_t = tmax[0] - * tmax[0] += tdelta[0] # <<<<<<<<<<<<<< - * cur_ind[0] += step[0] - * else: - */ - __pyx_t_93 = 0; - (__pyx_v_tmax[__pyx_t_93]) = ((__pyx_v_tmax[__pyx_t_93]) + (__pyx_v_tdelta[0])); - - /* "yt/utilities/lib/ray_integrators.pyx":352 - * enter_t = tmax[0] - * tmax[0] += tdelta[0] - * cur_ind[0] += step[0] # <<<<<<<<<<<<<< - * else: - * dt = tmax[2] - enter_t - */ - __pyx_t_93 = 0; - (__pyx_v_cur_ind[__pyx_t_93]) = ((__pyx_v_cur_ind[__pyx_t_93]) + (__pyx_v_step[0])); - - /* "yt/utilities/lib/ray_integrators.pyx":348 - * break - * if tmax[0] < tmax[1]: - * if tmax[0] < tmax[2]: # <<<<<<<<<<<<<< - * dt = tmax[0] - enter_t - * enter_t = tmax[0] - */ - goto __pyx_L54; - } - - /* "yt/utilities/lib/ray_integrators.pyx":354 - * cur_ind[0] += step[0] - * else: - * dt = tmax[2] - enter_t # <<<<<<<<<<<<<< - * enter_t = tmax[2] - * tmax[2] += tdelta[2] - */ - /*else*/ { - __pyx_t_41 = PyFloat_FromDouble(((__pyx_v_tmax[2]) - __pyx_v_enter_t)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_41); - __Pyx_XDECREF_SET(__pyx_v_dt, __pyx_t_41); - __pyx_t_41 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":355 - * else: - * dt = tmax[2] - enter_t - * enter_t = tmax[2] # <<<<<<<<<<<<<< - * tmax[2] += tdelta[2] - * cur_ind[2] += step[2] - */ - __pyx_v_enter_t = (__pyx_v_tmax[2]); - - /* "yt/utilities/lib/ray_integrators.pyx":356 - * dt = tmax[2] - enter_t - * enter_t = tmax[2] - * tmax[2] += tdelta[2] # <<<<<<<<<<<<<< - * cur_ind[2] += step[2] - * else: - */ - __pyx_t_93 = 2; - (__pyx_v_tmax[__pyx_t_93]) = ((__pyx_v_tmax[__pyx_t_93]) + (__pyx_v_tdelta[2])); - - /* "yt/utilities/lib/ray_integrators.pyx":357 - * enter_t = tmax[2] - * tmax[2] += tdelta[2] - * cur_ind[2] += step[2] # <<<<<<<<<<<<<< - * else: - * if tmax[1] < tmax[2]: - */ - __pyx_t_93 = 2; - (__pyx_v_cur_ind[__pyx_t_93]) = ((__pyx_v_cur_ind[__pyx_t_93]) + (__pyx_v_step[2])); - } - __pyx_L54:; - - /* "yt/utilities/lib/ray_integrators.pyx":347 - * dt = 1.0 - enter_t - * break - * if tmax[0] < tmax[1]: # <<<<<<<<<<<<<< - * if tmax[0] < tmax[2]: - * dt = tmax[0] - enter_t - */ - goto __pyx_L53; - } - - /* "yt/utilities/lib/ray_integrators.pyx":359 - * cur_ind[2] += step[2] - * else: - * if tmax[1] < tmax[2]: # <<<<<<<<<<<<<< - * dt = tmax[1] - enter_t - * enter_t = tmax[1] - */ - /*else*/ { - __pyx_t_32 = (((__pyx_v_tmax[1]) < (__pyx_v_tmax[2])) != 0); - if (__pyx_t_32) { - - /* "yt/utilities/lib/ray_integrators.pyx":360 - * else: - * if tmax[1] < tmax[2]: - * dt = tmax[1] - enter_t # <<<<<<<<<<<<<< - * enter_t = tmax[1] - * tmax[1] += tdelta[1] - */ - __pyx_t_41 = PyFloat_FromDouble(((__pyx_v_tmax[1]) - __pyx_v_enter_t)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_41); - __Pyx_XDECREF_SET(__pyx_v_dt, __pyx_t_41); - __pyx_t_41 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":361 - * if tmax[1] < tmax[2]: - * dt = tmax[1] - enter_t - * enter_t = tmax[1] # <<<<<<<<<<<<<< - * tmax[1] += tdelta[1] - * cur_ind[1] += step[1] - */ - __pyx_v_enter_t = (__pyx_v_tmax[1]); - - /* "yt/utilities/lib/ray_integrators.pyx":362 - * dt = tmax[1] - enter_t - * enter_t = tmax[1] - * tmax[1] += tdelta[1] # <<<<<<<<<<<<<< - * cur_ind[1] += step[1] - * else: - */ - __pyx_t_93 = 1; - (__pyx_v_tmax[__pyx_t_93]) = ((__pyx_v_tmax[__pyx_t_93]) + (__pyx_v_tdelta[1])); - - /* "yt/utilities/lib/ray_integrators.pyx":363 - * enter_t = tmax[1] - * tmax[1] += tdelta[1] - * cur_ind[1] += step[1] # <<<<<<<<<<<<<< - * else: - * dt = tmax[2] - enter_t - */ - __pyx_t_93 = 1; - (__pyx_v_cur_ind[__pyx_t_93]) = ((__pyx_v_cur_ind[__pyx_t_93]) + (__pyx_v_step[1])); - - /* "yt/utilities/lib/ray_integrators.pyx":359 - * cur_ind[2] += step[2] - * else: - * if tmax[1] < tmax[2]: # <<<<<<<<<<<<<< - * dt = tmax[1] - enter_t - * enter_t = tmax[1] - */ - goto __pyx_L55; - } - - /* "yt/utilities/lib/ray_integrators.pyx":365 - * cur_ind[1] += step[1] - * else: - * dt = tmax[2] - enter_t # <<<<<<<<<<<<<< - * enter_t = tmax[2] - * tmax[2] += tdelta[2] - */ - /*else*/ { - __pyx_t_41 = PyFloat_FromDouble(((__pyx_v_tmax[2]) - __pyx_v_enter_t)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_41); - __Pyx_XDECREF_SET(__pyx_v_dt, __pyx_t_41); - __pyx_t_41 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":366 - * else: - * dt = tmax[2] - enter_t - * enter_t = tmax[2] # <<<<<<<<<<<<<< - * tmax[2] += tdelta[2] - * cur_ind[2] += step[2] - */ - __pyx_v_enter_t = (__pyx_v_tmax[2]); - - /* "yt/utilities/lib/ray_integrators.pyx":367 - * dt = tmax[2] - enter_t - * enter_t = tmax[2] - * tmax[2] += tdelta[2] # <<<<<<<<<<<<<< - * cur_ind[2] += step[2] - * dv = data[cur_ind[0], cur_ind[1], cur_ind[2]] - */ - __pyx_t_93 = 2; - (__pyx_v_tmax[__pyx_t_93]) = ((__pyx_v_tmax[__pyx_t_93]) + (__pyx_v_tdelta[2])); - - /* "yt/utilities/lib/ray_integrators.pyx":368 - * enter_t = tmax[2] - * tmax[2] += tdelta[2] - * cur_ind[2] += step[2] # <<<<<<<<<<<<<< - * dv = data[cur_ind[0], cur_ind[1], cur_ind[2]] - */ - __pyx_t_93 = 2; - (__pyx_v_cur_ind[__pyx_t_93]) = ((__pyx_v_cur_ind[__pyx_t_93]) + (__pyx_v_step[2])); - } - __pyx_L55:; - } - __pyx_L53:; - - /* "yt/utilities/lib/ray_integrators.pyx":369 - * tmax[2] += tdelta[2] - * cur_ind[2] += step[2] - * dv = data[cur_ind[0], cur_ind[1], cur_ind[2]] # <<<<<<<<<<<<<< - */ - __pyx_t_94 = (__pyx_v_cur_ind[0]); - __pyx_t_95 = (__pyx_v_cur_ind[1]); - __pyx_t_96 = (__pyx_v_cur_ind[2]); - __pyx_v_dv = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_94, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_95, __pyx_pybuffernd_data.diminfo[1].strides, __pyx_t_96, __pyx_pybuffernd_data.diminfo[2].strides)); - } - __pyx_L40_break:; - - /* "yt/utilities/lib/ray_integrators.pyx":249 - * @cython.wraparound(False) - * @cython.boundscheck(False) - * def integrate_ray(np.ndarray[np.float64_t, ndim=1] u, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] v, - * np.ndarray[np.float64_t, ndim=1] left_edge, - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_41); - __Pyx_XDECREF(__pyx_t_42); - __Pyx_XDECREF(__pyx_t_43); - __Pyx_XDECREF(__pyx_t_47); - __Pyx_XDECREF(__pyx_t_48); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_image.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_shells.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.lib.ray_integrators.integrate_ray", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dx.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_image.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_shells.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF(__pyx_v_dt); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim - */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - */ - __pyx_v_endian_detector = 1; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - goto __pyx_L4; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - goto __pyx_L11; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * 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)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * 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_L11:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * 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; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset - */ - __pyx_v_f = NULL; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * 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; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - goto __pyx_L14; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * 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, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * 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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * 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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * 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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { - PyArray_Descr *__pyx_v_child = 0; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - PyObject *__pyx_v_fields = 0; - PyObject *__pyx_v_childname = NULL; - PyObject *__pyx_v_new_offset = NULL; - PyObject *__pyx_v_t = NULL; - char *__pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - long __pyx_t_8; - char *__pyx_t_9; - __Pyx_RefNannySetupContext("_util_dtypestring", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * 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, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: - */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); - if (!__pyx_t_7) { - goto __pyx_L8_next_or; - } else { - } - __pyx_t_7 = (__pyx_v_little_endian != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_L8_next_or:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 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:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 - */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 0x78; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - goto __pyx_L13; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * - */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! - */ - __pyx_v_baseptr = NULL; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - goto __pyx_L3; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * 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:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): - */ - __pyx_v_arr->base = __pyx_v_baseptr; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * 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; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_array", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") - */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") - * - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_umath", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_ufunc() except -1: - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_ufunc", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "ray_integrators", - __pyx_k_Simle_integrators_for_the_radia, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_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_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_PlaneVoxelIntegration, __pyx_k_PlaneVoxelIntegration, sizeof(__pyx_k_PlaneVoxelIntegration), 0, 0, 1, 1}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s_Transfer1D, __pyx_k_Transfer1D, sizeof(__pyx_k_Transfer1D), 0, 0, 1, 1}, - {&__pyx_n_s_Transfer3D, __pyx_k_Transfer3D, sizeof(__pyx_k_Transfer3D), 0, 0, 1, 1}, - {&__pyx_n_s_TransferShells, __pyx_k_TransferShells, sizeof(__pyx_k_TransferShells), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s_VoxelTraversal, __pyx_k_VoxelTraversal, sizeof(__pyx_k_VoxelTraversal), 0, 0, 1, 1}, - {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, - {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1}, - {&__pyx_n_s_cur_ind, __pyx_k_cur_ind, sizeof(__pyx_k_cur_ind), 0, 0, 1, 1}, - {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, - {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1}, - {&__pyx_n_s_dist, __pyx_k_dist, sizeof(__pyx_k_dist), 0, 0, 1, 1}, - {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, - {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, - {&__pyx_n_s_dv, __pyx_k_dv, sizeof(__pyx_k_dv), 0, 0, 1, 1}, - {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, - {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, - {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, - {&__pyx_n_s_enter_t, __pyx_k_enter_t, sizeof(__pyx_k_enter_t), 0, 0, 1, 1}, - {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, - {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1}, - {&__pyx_n_s_grid_dt, __pyx_k_grid_dt, sizeof(__pyx_k_grid_dt), 0, 0, 1, 1}, - {&__pyx_n_s_grid_mask, __pyx_k_grid_mask, sizeof(__pyx_k_grid_mask), 0, 0, 1, 1}, - {&__pyx_n_s_grid_t, __pyx_k_grid_t, sizeof(__pyx_k_grid_t), 0, 0, 1, 1}, - {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, - {&__pyx_n_s_i_s, __pyx_k_i_s, sizeof(__pyx_k_i_s), 0, 0, 1, 1}, - {&__pyx_n_s_ii, __pyx_k_ii, sizeof(__pyx_k_ii), 0, 0, 1, 1}, - {&__pyx_n_s_image, __pyx_k_image, sizeof(__pyx_k_image), 0, 0, 1, 1}, - {&__pyx_n_s_imax, __pyx_k_imax, sizeof(__pyx_k_imax), 0, 0, 1, 1}, - {&__pyx_n_s_imin, __pyx_k_imin, sizeof(__pyx_k_imin), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1}, - {&__pyx_n_s_integrate_ray, __pyx_k_integrate_ray, sizeof(__pyx_k_integrate_ray), 0, 0, 1, 1}, - {&__pyx_n_s_intersect, __pyx_k_intersect, sizeof(__pyx_k_intersect), 0, 0, 1, 1}, - {&__pyx_n_s_intersect_t, __pyx_k_intersect_t, sizeof(__pyx_k_intersect_t), 0, 0, 1, 1}, - {&__pyx_n_s_istride, __pyx_k_istride, sizeof(__pyx_k_istride), 0, 0, 1, 1}, - {&__pyx_n_s_iv_dir, __pyx_k_iv_dir, sizeof(__pyx_k_iv_dir), 0, 0, 1, 1}, - {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, - {&__pyx_n_s_jj, __pyx_k_jj, sizeof(__pyx_k_jj), 0, 0, 1, 1}, - {&__pyx_n_s_jmax, __pyx_k_jmax, sizeof(__pyx_k_jmax), 0, 0, 1, 1}, - {&__pyx_n_s_jmin, __pyx_k_jmin, sizeof(__pyx_k_jmin), 0, 0, 1, 1}, - {&__pyx_n_s_jstride, __pyx_k_jstride, sizeof(__pyx_k_jstride), 0, 0, 1, 1}, - {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, - {&__pyx_n_s_kk, __pyx_k_kk, sizeof(__pyx_k_kk), 0, 0, 1, 1}, - {&__pyx_n_s_kmax, __pyx_k_kmax, sizeof(__pyx_k_kmax), 0, 0, 1, 1}, - {&__pyx_n_s_kmin, __pyx_k_kmin, sizeof(__pyx_k_kmin), 0, 0, 1, 1}, - {&__pyx_n_s_left_edge, __pyx_k_left_edge, sizeof(__pyx_k_left_edge), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, - {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, - {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, - {&__pyx_n_s_nn, __pyx_k_nn, sizeof(__pyx_k_nn), 0, 0, 1, 1}, - {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_n_s_nshells, __pyx_k_nshells, sizeof(__pyx_k_nshells), 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_nv, __pyx_k_nv, sizeof(__pyx_k_nv), 0, 0, 1, 1}, - {&__pyx_n_s_o_s, __pyx_k_o_s, sizeof(__pyx_k_o_s), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_rgba, __pyx_k_rgba, sizeof(__pyx_k_rgba), 0, 0, 1, 1}, - {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 0, 0, 1, 1}, - {&__pyx_n_s_shells, __pyx_k_shells, sizeof(__pyx_k_shells), 0, 0, 1, 1}, - {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, - {&__pyx_n_s_tdelta, __pyx_k_tdelta, sizeof(__pyx_k_tdelta), 0, 0, 1, 1}, - {&__pyx_n_s_temp, __pyx_k_temp, sizeof(__pyx_k_temp), 0, 0, 1, 1}, - {&__pyx_n_s_temp_x, __pyx_k_temp_x, sizeof(__pyx_k_temp_x), 0, 0, 1, 1}, - {&__pyx_n_s_temp_y, __pyx_k_temp_y, sizeof(__pyx_k_temp_y), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_tl, __pyx_k_tl, sizeof(__pyx_k_tl), 0, 0, 1, 1}, - {&__pyx_n_s_tmax, __pyx_k_tmax, sizeof(__pyx_k_tmax), 0, 0, 1, 1}, - {&__pyx_n_s_tr, __pyx_k_tr, sizeof(__pyx_k_tr), 0, 0, 1, 1}, - {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, - {&__pyx_n_s_ug, __pyx_k_ug, sizeof(__pyx_k_ug), 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_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, - {&__pyx_n_s_vi, __pyx_k_vi, sizeof(__pyx_k_vi), 0, 0, 1, 1}, - {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, - {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, - {&__pyx_n_s_yt_utilities_lib_ray_integrators, __pyx_k_yt_utilities_lib_ray_integrators, sizeof(__pyx_k_yt_utilities_lib_ray_integrators), 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, 47, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "yt/utilities/lib/ray_integrators.pyx":240 - * cdef int nv = ug.shape[0] - * cdef int nshells = shells.shape[0] - * cdef np.ndarray[np.float64_t, ndim=1] u = np.empty((3,), dtype=np.float64) # <<<<<<<<<<<<<< - * # Copy things into temporary location for passing between functions - * for vi in range(nv): - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_tuple_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: - */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_ufunc() except -1: - */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - - /* "yt/utilities/lib/ray_integrators.pyx":26 - * - * @cython.boundscheck(False) - * def Transfer3D(np.ndarray[np.float64_t, ndim=3] i_s, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=4] o_s, - * np.ndarray[np.float64_t, ndim=4] e, - */ - __pyx_tuple__12 = PyTuple_Pack(21, __pyx_n_s_i_s, __pyx_n_s_o_s, __pyx_n_s_e, __pyx_n_s_a, __pyx_n_s_imin, __pyx_n_s_imax, __pyx_n_s_jmin, __pyx_n_s_jmax, __pyx_n_s_kmin, __pyx_n_s_kmax, __pyx_n_s_istride, __pyx_n_s_jstride, __pyx_n_s_dx, __pyx_n_s_i, __pyx_n_s_ii, __pyx_n_s_j, __pyx_n_s_jj, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_nn, __pyx_n_s_temp); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 26, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(13, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_Transfer3D, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 26, __pyx_L1_error) - - /* "yt/utilities/lib/ray_integrators.pyx":63 - * - * @cython.boundscheck(False) - * def TransferShells(np.ndarray[np.float64_t, ndim=3] i_s, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=3] data, - * np.ndarray[np.float64_t, ndim=2] shells): - */ - __pyx_tuple__14 = PyTuple_Pack(14, __pyx_n_s_i_s, __pyx_n_s_data, __pyx_n_s_shells, __pyx_n_s_i, __pyx_n_s_ii, __pyx_n_s_j, __pyx_n_s_jj, __pyx_n_s_k, __pyx_n_s_kk, __pyx_n_s_n, __pyx_n_s_nn, __pyx_n_s_dist, __pyx_n_s_rgba, __pyx_n_s_alpha); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_TransferShells, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 63, __pyx_L1_error) - - /* "yt/utilities/lib/ray_integrators.pyx":103 - * - * @cython.boundscheck(False) - * def Transfer1D(float i_s, # <<<<<<<<<<<<<< - * np.ndarray[np.float_t, ndim=1] o_s, - * np.ndarray[np.float_t, ndim=1] e, - */ - __pyx_tuple__16 = PyTuple_Pack(8, __pyx_n_s_i_s, __pyx_n_s_o_s, __pyx_n_s_e, __pyx_n_s_a, __pyx_n_s_dx, __pyx_n_s_imin, __pyx_n_s_imax, __pyx_n_s_i); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_Transfer1D, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 103, __pyx_L1_error) - - /* "yt/utilities/lib/ray_integrators.pyx":117 - * @cython.wraparound(False) - * @cython.boundscheck(False) - * def VoxelTraversal(np.ndarray[np.int_t, ndim=3] grid_mask, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=3] grid_t, - * np.ndarray[np.float64_t, ndim=3] grid_dt, - */ - __pyx_tuple__18 = PyTuple_Pack(21, __pyx_n_s_grid_mask, __pyx_n_s_grid_t, __pyx_n_s_grid_dt, __pyx_n_s_left_edge, __pyx_n_s_right_edge, __pyx_n_s_dx, __pyx_n_s_u, __pyx_n_s_v, __pyx_n_s_i, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_tl, __pyx_n_s_tr, __pyx_n_s_intersect_t, __pyx_n_s_enter_t, __pyx_n_s_iv_dir, __pyx_n_s_tdelta, __pyx_n_s_tmax, __pyx_n_s_intersect, __pyx_n_s_cur_ind, __pyx_n_s_step); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(8, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_VoxelTraversal, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 117, __pyx_L1_error) - - /* "yt/utilities/lib/ray_integrators.pyx":226 - * @cython.wraparound(False) - * @cython.boundscheck(False) - * def PlaneVoxelIntegration(np.ndarray[np.float64_t, ndim=1] left_edge, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] right_edge, - * np.ndarray[np.float64_t, ndim=1] dx, - */ - __pyx_tuple__20 = PyTuple_Pack(13, __pyx_n_s_left_edge, __pyx_n_s_right_edge, __pyx_n_s_dx, __pyx_n_s_ug, __pyx_n_s_v, __pyx_n_s_image, __pyx_n_s_data, __pyx_n_s_shells, __pyx_n_s_i, __pyx_n_s_vi, __pyx_n_s_nv, __pyx_n_s_nshells, __pyx_n_s_u); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(8, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_PlaneVoxelIntegration, 226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 226, __pyx_L1_error) - - /* "yt/utilities/lib/ray_integrators.pyx":249 - * @cython.wraparound(False) - * @cython.boundscheck(False) - * def integrate_ray(np.ndarray[np.float64_t, ndim=1] u, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] v, - * np.ndarray[np.float64_t, ndim=1] left_edge, - */ - __pyx_tuple__22 = PyTuple_Pack(30, __pyx_n_s_u, __pyx_n_s_v, __pyx_n_s_left_edge, __pyx_n_s_right_edge, __pyx_n_s_dx, __pyx_n_s_nshells, __pyx_n_s_ind, __pyx_n_s_data, __pyx_n_s_shells, __pyx_n_s_image, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_step, __pyx_n_s_intersect_t, __pyx_n_s_tl, __pyx_n_s_tr, __pyx_n_s_enter_t, __pyx_n_s_cur_ind, __pyx_n_s_tdelta, __pyx_n_s_tmax, __pyx_n_s_intersect, __pyx_n_s_dv, __pyx_n_s_dist, __pyx_n_s_alpha, __pyx_n_s_dims, __pyx_n_s_temp_x, __pyx_n_s_temp_y, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(10, 0, 30, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_integrate_ray, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 249, __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_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initray_integrators(void); /*proto*/ -PyMODINIT_FUNC initray_integrators(void) -#else -PyMODINIT_FUNC PyInit_ray_integrators(void); /*proto*/ -PyMODINIT_FUNC PyInit_ray_integrators(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_ray_integrators(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_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 PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("ray_integrators", __pyx_methods, __pyx_k_Simle_integrators_for_the_radia, 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) - __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) - #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_yt__utilities__lib__ray_integrators) { - 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, "yt.utilities.lib.ray_integrators")) { - if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.ray_integrators", __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 init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", - #if CYTHON_COMPILING_IN_PYPY - sizeof(PyTypeObject), - #else - sizeof(PyHeapTypeObject), - #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "yt/utilities/lib/ray_integrators.pyx":16 - * #----------------------------------------------------------------------------- - * - * import numpy as np # <<<<<<<<<<<<<< - * cimport numpy as np - * cimport cython - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":26 - * - * @cython.boundscheck(False) - * def Transfer3D(np.ndarray[np.float64_t, ndim=3] i_s, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=4] o_s, - * np.ndarray[np.float64_t, ndim=4] e, - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15ray_integrators_1Transfer3D, NULL, __pyx_n_s_yt_utilities_lib_ray_integrators); 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_Transfer3D, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":63 - * - * @cython.boundscheck(False) - * def TransferShells(np.ndarray[np.float64_t, ndim=3] i_s, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=3] data, - * np.ndarray[np.float64_t, ndim=2] shells): - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15ray_integrators_3TransferShells, NULL, __pyx_n_s_yt_utilities_lib_ray_integrators); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TransferShells, __pyx_t_1) < 0) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":103 - * - * @cython.boundscheck(False) - * def Transfer1D(float i_s, # <<<<<<<<<<<<<< - * np.ndarray[np.float_t, ndim=1] o_s, - * np.ndarray[np.float_t, ndim=1] e, - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15ray_integrators_5Transfer1D, NULL, __pyx_n_s_yt_utilities_lib_ray_integrators); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Transfer1D, __pyx_t_1) < 0) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":117 - * @cython.wraparound(False) - * @cython.boundscheck(False) - * def VoxelTraversal(np.ndarray[np.int_t, ndim=3] grid_mask, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=3] grid_t, - * np.ndarray[np.float64_t, ndim=3] grid_dt, - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15ray_integrators_7VoxelTraversal, NULL, __pyx_n_s_yt_utilities_lib_ray_integrators); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_VoxelTraversal, __pyx_t_1) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":226 - * @cython.wraparound(False) - * @cython.boundscheck(False) - * def PlaneVoxelIntegration(np.ndarray[np.float64_t, ndim=1] left_edge, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] right_edge, - * np.ndarray[np.float64_t, ndim=1] dx, - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15ray_integrators_9PlaneVoxelIntegration, NULL, __pyx_n_s_yt_utilities_lib_ray_integrators); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PlaneVoxelIntegration, __pyx_t_1) < 0) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":249 - * @cython.wraparound(False) - * @cython.boundscheck(False) - * def integrate_ray(np.ndarray[np.float64_t, ndim=1] u, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] v, - * np.ndarray[np.float64_t, ndim=1] left_edge, - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_15ray_integrators_11integrate_ray, NULL, __pyx_n_s_yt_utilities_lib_ray_integrators); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_integrate_ray, __pyx_t_1) < 0) __PYX_ERR(0, 249, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/lib/ray_integrators.pyx":1 - * """ # <<<<<<<<<<<<<< - * Simle integrators for the radiative transfer equation - * - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.ray_integrators", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib.ray_integrators"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #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 - -/* 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; -} - -/* ArgTypeTest */ -static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); -} -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (likely(Py_TYPE(obj) == type)) return 1; - #if PY_MAJOR_VERSION == 2 - else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(PyObject_TypeCheck(obj, type))) return 1; - } - __Pyx_RaiseArgumentTypeInvalid(name, obj, type); - return 0; -} - -/* BufferFormatCheck */ -static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { - unsigned int n = 1; - return *(unsigned char*)(&n) != 0; -} -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type) { - stack[0].field = &ctx->root; - stack[0].parent_offset = 0; - ctx->root.type = type; - ctx->root.name = "buffer dtype"; - ctx->root.offset = 0; - ctx->head = stack; - ctx->head->field = &ctx->root; - ctx->fmt_offset = 0; - ctx->head->parent_offset = 0; - ctx->new_packmode = '@'; - ctx->enc_packmode = '@'; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->is_complex = 0; - ctx->is_valid_array = 0; - ctx->struct_alignment = 0; - while (type->typegroup == 'S') { - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = 0; - type = type->fields->type; - } -} -static int __Pyx_BufFmt_ParseNumber(const char** ts) { - int count; - const char* t = *ts; - if (*t < '0' || *t > '9') { - return -1; - } else { - count = *t++ - '0'; - while (*t >= '0' && *t < '9') { - count *= 10; - count += *t++ - '0'; - } - } - *ts = t; - return count; -} -static int __Pyx_BufFmt_ExpectNumber(const char **ts) { - int number = __Pyx_BufFmt_ParseNumber(ts); - if (number == -1) - PyErr_Format(PyExc_ValueError,\ - "Does not understand character buffer dtype format string ('%c')", **ts); - return number; -} -static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { - PyErr_Format(PyExc_ValueError, - "Unexpected format string character: '%c'", ch); -} -static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { - switch (ch) { - case 'c': return "'char'"; - case 'b': return "'signed char'"; - case 'B': return "'unsigned char'"; - case 'h': return "'short'"; - case 'H': return "'unsigned short'"; - case 'i': return "'int'"; - case 'I': return "'unsigned int'"; - case 'l': return "'long'"; - case 'L': return "'unsigned long'"; - case 'q': return "'long long'"; - case 'Q': return "'unsigned long long'"; - case 'f': return (is_complex ? "'complex float'" : "'float'"); - case 'd': return (is_complex ? "'complex double'" : "'double'"); - case 'g': return (is_complex ? "'complex long double'" : "'long double'"); - case 'T': return "a struct"; - case 'O': return "Python object"; - case 'P': return "a pointer"; - case 's': case 'p': return "a string"; - case 0: return "end"; - default: return "unparseable format string"; - } -} -static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return 2; - case 'i': case 'I': case 'l': case 'L': return 4; - case 'q': case 'Q': return 8; - case 'f': return (is_complex ? 8 : 4); - case 'd': return (is_complex ? 16 : 8); - case 'g': { - PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); - return 0; - } - case 'O': case 'P': return sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} -static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { - switch (ch) { - case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(short); - case 'i': case 'I': return sizeof(int); - case 'l': case 'L': return sizeof(long); - #ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(PY_LONG_LONG); - #endif - case 'f': return sizeof(float) * (is_complex ? 2 : 1); - case 'd': return sizeof(double) * (is_complex ? 2 : 1); - case 'g': return sizeof(long double) * (is_complex ? 2 : 1); - case 'O': case 'P': return sizeof(void*); - default: { - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } - } -} -typedef struct { char c; short x; } __Pyx_st_short; -typedef struct { char c; int x; } __Pyx_st_int; -typedef struct { char c; long x; } __Pyx_st_long; -typedef struct { char c; float x; } __Pyx_st_float; -typedef struct { char c; double x; } __Pyx_st_double; -typedef struct { char c; long double x; } __Pyx_st_longdouble; -typedef struct { char c; void *x; } __Pyx_st_void_p; -#ifdef HAVE_LONG_LONG -typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; -#endif -static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); - case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); - case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); -#ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); -#endif - case 'f': return sizeof(__Pyx_st_float) - sizeof(float); - case 'd': return sizeof(__Pyx_st_double) - sizeof(double); - case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); - case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} -/* These are for computing the padding at the end of the struct to align - on the first member of the struct. This will probably the same as above, - but we don't have any guarantees. - */ -typedef struct { short x; char c; } __Pyx_pad_short; -typedef struct { int x; char c; } __Pyx_pad_int; -typedef struct { long x; char c; } __Pyx_pad_long; -typedef struct { float x; char c; } __Pyx_pad_float; -typedef struct { double x; char c; } __Pyx_pad_double; -typedef struct { long double x; char c; } __Pyx_pad_longdouble; -typedef struct { void *x; char c; } __Pyx_pad_void_p; -#ifdef HAVE_LONG_LONG -typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; -#endif -static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); - case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); - case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); -#ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); -#endif - case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); - case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); - case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); - case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} -static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { - switch (ch) { - case 'c': - return 'H'; - case 'b': case 'h': case 'i': - case 'l': case 'q': case 's': case 'p': - return 'I'; - case 'B': case 'H': case 'I': case 'L': case 'Q': - return 'U'; - case 'f': case 'd': case 'g': - return (is_complex ? 'C' : 'R'); - case 'O': - return 'O'; - case 'P': - return 'P'; - default: { - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } - } -} -static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { - if (ctx->head == NULL || ctx->head->field == &ctx->root) { - const char* expected; - const char* quote; - if (ctx->head == NULL) { - expected = "end"; - quote = ""; - } else { - expected = ctx->head->field->type->name; - quote = "'"; - } - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch, expected %s%s%s but got %s", - quote, expected, quote, - __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); - } else { - __Pyx_StructField* field = ctx->head->field; - __Pyx_StructField* parent = (ctx->head - 1)->field; - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", - field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), - parent->type->name, field->name); - } -} -static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { - char group; - size_t size, offset, arraysize = 1; - if (ctx->enc_type == 0) return 0; - if (ctx->head->field->type->arraysize[0]) { - int i, ndim = 0; - if (ctx->enc_type == 's' || ctx->enc_type == 'p') { - ctx->is_valid_array = ctx->head->field->type->ndim == 1; - ndim = 1; - if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { - PyErr_Format(PyExc_ValueError, - "Expected a dimension of size %zu, got %zu", - ctx->head->field->type->arraysize[0], ctx->enc_count); - return -1; - } - } - if (!ctx->is_valid_array) { - PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", - ctx->head->field->type->ndim, ndim); - return -1; - } - for (i = 0; i < ctx->head->field->type->ndim; i++) { - arraysize *= ctx->head->field->type->arraysize[i]; - } - ctx->is_valid_array = 0; - ctx->enc_count = 1; - } - group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); - do { - __Pyx_StructField* field = ctx->head->field; - __Pyx_TypeInfo* type = field->type; - if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { - size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); - } else { - size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); - } - if (ctx->enc_packmode == '@') { - size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); - size_t align_mod_offset; - if (align_at == 0) return -1; - align_mod_offset = ctx->fmt_offset % align_at; - if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; - if (ctx->struct_alignment == 0) - ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, - ctx->is_complex); - } - if (type->size != size || type->typegroup != group) { - if (type->typegroup == 'C' && type->fields != NULL) { - size_t parent_offset = ctx->head->parent_offset + field->offset; - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = parent_offset; - continue; - } - if ((type->typegroup == 'H' || group == 'H') && type->size == size) { - } else { - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; - } - } - offset = ctx->head->parent_offset + field->offset; - if (ctx->fmt_offset != offset) { - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", - (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); - return -1; - } - ctx->fmt_offset += size; - if (arraysize) - ctx->fmt_offset += (arraysize - 1) * size; - --ctx->enc_count; - while (1) { - if (field == &ctx->root) { - ctx->head = NULL; - if (ctx->enc_count != 0) { - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; - } - break; - } - ctx->head->field = ++field; - if (field->type == NULL) { - --ctx->head; - field = ctx->head->field; - continue; - } else if (field->type->typegroup == 'S') { - size_t parent_offset = ctx->head->parent_offset + field->offset; - if (field->type->fields->type == NULL) continue; - field = field->type->fields; - ++ctx->head; - ctx->head->field = field; - ctx->head->parent_offset = parent_offset; - break; - } else { - break; - } - } - } while (ctx->enc_count); - ctx->enc_type = 0; - ctx->is_complex = 0; - return 0; -} -static CYTHON_INLINE PyObject * -__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) -{ - const char *ts = *tsp; - int i = 0, number; - int ndim = ctx->head->field->type->ndim; -; - ++ts; - if (ctx->new_count != 1) { - PyErr_SetString(PyExc_ValueError, - "Cannot handle repeated arrays in format string"); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - while (*ts && *ts != ')') { - switch (*ts) { - case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; - default: break; - } - number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return NULL; - if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) - return PyErr_Format(PyExc_ValueError, - "Expected a dimension of size %zu, got %d", - ctx->head->field->type->arraysize[i], number); - if (*ts != ',' && *ts != ')') - return PyErr_Format(PyExc_ValueError, - "Expected a comma in format string, got '%c'", *ts); - if (*ts == ',') ts++; - i++; - } - if (i != ndim) - return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", - ctx->head->field->type->ndim, i); - if (!*ts) { - PyErr_SetString(PyExc_ValueError, - "Unexpected end of format string, expected ')'"); - return NULL; - } - ctx->is_valid_array = 1; - ctx->new_count = 1; - *tsp = ++ts; - return Py_None; -} -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { - int got_Z = 0; - while (1) { - switch(*ts) { - case 0: - if (ctx->enc_type != 0 && ctx->head == NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - if (ctx->head != NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - return ts; - case ' ': - case '\r': - case '\n': - ++ts; - break; - case '<': - if (!__Pyx_IsLittleEndian()) { - PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); - return NULL; - } - ctx->new_packmode = '='; - ++ts; - break; - case '>': - case '!': - if (__Pyx_IsLittleEndian()) { - PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); - return NULL; - } - ctx->new_packmode = '='; - ++ts; - break; - case '=': - case '@': - case '^': - ctx->new_packmode = *ts++; - break; - case 'T': - { - const char* ts_after_sub; - size_t i, struct_count = ctx->new_count; - size_t struct_alignment = ctx->struct_alignment; - ctx->new_count = 1; - ++ts; - if (*ts != '{') { - PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_type = 0; - ctx->enc_count = 0; - ctx->struct_alignment = 0; - ++ts; - ts_after_sub = ts; - for (i = 0; i != struct_count; ++i) { - ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); - if (!ts_after_sub) return NULL; - } - ts = ts_after_sub; - if (struct_alignment) ctx->struct_alignment = struct_alignment; - } - break; - case '}': - { - size_t alignment = ctx->struct_alignment; - ++ts; - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_type = 0; - if (alignment && ctx->fmt_offset % alignment) { - ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); - } - } - return ts; - case 'x': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->fmt_offset += ctx->new_count; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->enc_packmode = ctx->new_packmode; - ++ts; - break; - case 'Z': - got_Z = 1; - ++ts; - if (*ts != 'f' && *ts != 'd' && *ts != 'g') { - __Pyx_BufFmt_RaiseUnexpectedChar('Z'); - return NULL; - } - case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': - case 'l': case 'L': case 'q': case 'Q': - case 'f': case 'd': case 'g': - case 'O': case 'p': - if (ctx->enc_type == *ts && got_Z == ctx->is_complex && - ctx->enc_packmode == ctx->new_packmode) { - ctx->enc_count += ctx->new_count; - ctx->new_count = 1; - got_Z = 0; - ++ts; - break; - } - case 's': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_count = ctx->new_count; - ctx->enc_packmode = ctx->new_packmode; - ctx->enc_type = *ts; - ctx->is_complex = got_Z; - ++ts; - ctx->new_count = 1; - got_Z = 0; - break; - case ':': - ++ts; - while(*ts != ':') ++ts; - ++ts; - break; - case '(': - if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; - break; - default: - { - int number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return NULL; - ctx->new_count = (size_t)number; - } - } - } -} -static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { - buf->buf = NULL; - buf->obj = NULL; - buf->strides = __Pyx_zeros; - buf->shape = __Pyx_zeros; - buf->suboffsets = __Pyx_minusones; -} -static CYTHON_INLINE int __Pyx_GetBufferAndValidate( - Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, - int nd, int cast, __Pyx_BufFmt_StackElem* stack) -{ - if (obj == Py_None || obj == NULL) { - __Pyx_ZeroBuffer(buf); - return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { - PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - nd, buf->ndim); - goto fail; - } - if (!cast) { - __Pyx_BufFmt_Context ctx; - __Pyx_BufFmt_Init(&ctx, stack, dtype); - if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; - } - if ((unsigned)buf->itemsize != dtype->size) { - PyErr_Format(PyExc_ValueError, - "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", - buf->itemsize, (buf->itemsize > 1) ? "s" : "", - dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); - goto fail; - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; -} -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { - if (info->buf == NULL) return; - if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; - __Pyx_ReleaseBuffer(info); -} - -/* 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 - -/* None */ - static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { - long r = a % b; - r += ((r != 0) & ((r ^ b) < 0)) * b; - return r; -} - -/* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -/* PyCFunctionFastCall */ - #if CYTHON_FAST_PYCCALL -static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { - PyCFunctionObject *func = (PyCFunctionObject*)func_obj; - PyCFunction meth = PyCFunction_GET_FUNCTION(func); - PyObject *self = PyCFunction_GET_SELF(func); - assert(PyCFunction_Check(func)); - assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); - assert(nargs >= 0); - assert(nargs == 0 || args != NULL); - /* _PyCFunction_FastCallDict() must not be called with an exception set, - because it may clear it (directly or indirectly) and so the - caller loses its exception */ - assert(!PyErr_Occurred()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); -} -#endif // CYTHON_FAST_PYCCALL - -/* PyFunctionFastCall */ - #if CYTHON_FAST_PYCALL -#include "frameobject.h" -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = PyThreadState_GET(); - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = f->f_localsplus; - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -#if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; -#if PY_MAJOR_VERSION >= 3 - PyObject *kwdefs; -#endif - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { - return NULL; - } - if ( -#if PY_MAJOR_VERSION >= 3 - co->co_kwonlyargcount == 0 && -#endif - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 - kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } -#if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, - k, (int)nk, - d, (int)nd, closure); -#endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL - -/* PyObjectCall */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - 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 -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); -#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 - -/* 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(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -/* 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 PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* 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) { - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -#endif - -/* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { - PyObject *exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; - return PyErr_GivenExceptionMatches(exc_type, err); -} -#endif - -/* GetException */ - #if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { -#endif - PyObject *local_type, *local_value, *local_tb; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* 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; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - __Pyx_PyFrame_SetLineNumber(py_frame, py_line); - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { - if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); - PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); - return -1; -} -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject *obj = view->obj; - if (!obj) return; - if (PyObject_CheckBuffer(obj)) { - PyBuffer_Release(view); - return; - } - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } - Py_DECREF(obj); - view->obj = NULL; -} -#endif - - - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); - } -} - -/* Declarations */ - #if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return ::std::complex< float >(x, y); - } - #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); - } -} - -/* 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; -} - -/* 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 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; -} - -/* 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; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (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 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 (PyInt_Check(x) || PyLong_Check(x)) -#else - if (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 = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } - #else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } - #endif -#else - res = PyNumber_Int(x); -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - 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_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ diff -Nru yt-3.3.3/yt/utilities/lib/ray_integrators.pyx yt-3.4.0/yt/utilities/lib/ray_integrators.pyx --- yt-3.3.3/yt/utilities/lib/ray_integrators.pyx 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/ray_integrators.pyx 1970-01-01 00:00:00.000000000 +0000 @@ -1,369 +0,0 @@ -""" -Simle integrators for the radiative transfer equation - - - -""" - -#----------------------------------------------------------------------------- -# Copyright (c) 2013, yt Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- - -import numpy as np -cimport numpy as np -cimport cython -from libc.stdlib cimport malloc, free, abs - -cdef extern from "math.h": - double exp(double x) - float expf(float x) - -@cython.boundscheck(False) -def Transfer3D(np.ndarray[np.float64_t, ndim=3] i_s, - np.ndarray[np.float64_t, ndim=4] o_s, - np.ndarray[np.float64_t, ndim=4] e, - np.ndarray[np.float64_t, ndim=4] a, - int imin, int imax, int jmin, int jmax, - int kmin, int kmax, int istride, int jstride, - np.float64_t dx): - """ - This function accepts an incoming slab (*i_s*), a buffer - for an outgoing set of values at every point in the grid (*o_s*), - an emission array (*e*), an absorption array (*a*), and dimensions of - the grid (*imin*, *imax*, *jmin*, *jmax*, *kmin*, *kmax*) as well - as strides in the *i* and *j* directions, and a *dx* of the grid being - integrated. - """ - cdef int i, ii - cdef int j, jj - cdef int k - cdef int n, nn - nn = o_s.shape[3] # This might be slow - cdef np.float64_t *temp = malloc(sizeof(np.float64_t) * nn) - for i in range((imax-imin)*istride): - ii = i + imin*istride - for j in range((jmax-jmin)*jstride): - jj = j + jmin*jstride - # Not sure about the ordering of the loops here - for n in range(nn): - temp[n] = i_s[ii,jj,n] - for k in range(kmax-kmin): - for n in range(nn): - o_s[i,j,k,n] = temp[n] + dx*(e[i,j,k,n] - temp[n]*a[i,j,k,n]) - temp[n] = o_s[i,j,k,n] - for n in range(nn): - i_s[ii,jj,n] = temp[n] - free(temp) - -@cython.boundscheck(False) -def TransferShells(np.ndarray[np.float64_t, ndim=3] i_s, - np.ndarray[np.float64_t, ndim=3] data, - np.ndarray[np.float64_t, ndim=2] shells): - """ - This function accepts an incoming slab (*i_s*), a buffer of *data*, - and a list of shells specified as [ (value, tolerance, r, g, b), ... ]. - """ - cdef int i, ii - cdef int j, jj - cdef int k, kk - cdef int n, nn - cdef np.float64_t dist - ii = data.shape[0] - jj = data.shape[1] - kk = data.shape[2] - nn = shells.shape[0] - cdef float rgba[4] - cdef float alpha - for i in range(ii): - for j in range(jj): - # Not sure about the ordering of the loops here - for k in range(kk): - for n in range(nn): - dist = shells[n, 0] - data[i,j,k] - if dist < 0: dist *= -1.0 - if dist < shells[n,1]: - dist = exp(-dist/8.0) - rgba[0] = shells[n,2] - rgba[1] = shells[n,3] - rgba[2] = shells[n,4] - rgba[3] = shells[n,5] - alpha = i_s[i,j,3] - dist *= dist # This might improve appearance - i_s[i,j,0] += (1.0 - alpha)*rgba[0]*dist*rgba[3] - i_s[i,j,1] += (1.0 - alpha)*rgba[1]*dist*rgba[3] - i_s[i,j,2] += (1.0 - alpha)*rgba[2]*dist*rgba[3] - i_s[i,j,3] += (1.0 - alpha)*rgba[3]*dist*rgba[3] - break - -@cython.boundscheck(False) -def Transfer1D(float i_s, - np.ndarray[np.float_t, ndim=1] o_s, - np.ndarray[np.float_t, ndim=1] e, - np.ndarray[np.float_t, ndim=1] a, - np.ndarray[np.float_t, ndim=1] dx, - int imin, int imax): - cdef int i - for i in range(imin, imax): - o_s[i] = i_s + dx[i]*(e[i] - i_s*a[i]) - i_s = o_s[i] - return i_s - -@cython.wraparound(False) -@cython.boundscheck(False) -def VoxelTraversal(np.ndarray[np.int_t, ndim=3] grid_mask, - np.ndarray[np.float64_t, ndim=3] grid_t, - np.ndarray[np.float64_t, ndim=3] grid_dt, - np.ndarray[np.float64_t, ndim=1] left_edge, - np.ndarray[np.float64_t, ndim=1] right_edge, - np.ndarray[np.float64_t, ndim=1] dx, - np.ndarray[np.float64_t, ndim=1] u, - np.ndarray[np.float64_t, ndim=1] v): - # We're roughly following Amanatides & Woo - # Find the first place the ray hits the grid on its path - # Do left edge then right edge in each dim - cdef int i, x, y - cdef np.float64_t tl, tr, intersect_t, enter_t - cdef np.float64_t iv_dir[3] - cdef np.float64_t tdelta[3] - cdef np.float64_t tmax[3] - cdef np.float64_t intersect[3] - cdef np.int64_t cur_ind[3] - cdef np.int64_t step[3] - intersect_t = 1 - # recall p = v * t + u - # where p is position, v is our vector, u is the start point - for i in range(3): - # As long as we're iterating, set some other stuff, too - if(v[i] < 0): - step[i] = -1 - elif (v[i] == 0): - step[i] = 1 - tmax[i] = 1e60 - iv_dir[i] = 1e60 - tdelta[i] = 1e-60 - continue - else: - step[i] = 1 - x = (i+1)%3 - y = (i+2)%3 - iv_dir[i] = 1.0/v[i] - tl = (left_edge[i] - u[i])*iv_dir[i] - tr = (right_edge[i] - u[i])*iv_dir[i] - if (left_edge[x] <= (u[x] + tl*v[x]) <= right_edge[x]) and \ - (left_edge[y] <= (u[y] + tl*v[y]) <= right_edge[y]) and \ - (0.0 <= tl < intersect_t): - intersect_t = tl - if (left_edge[x] <= (u[x] + tr*v[x]) <= right_edge[x]) and \ - (left_edge[y] <= (u[y] + tr*v[y]) <= right_edge[y]) and \ - (0.0 <= tr < intersect_t): - intersect_t = tr - # if fully enclosed - if (left_edge[0] <= u[0] <= right_edge[0]) and \ - (left_edge[1] <= u[1] <= right_edge[1]) and \ - (left_edge[2] <= u[2] <= right_edge[2]): - intersect_t = 0.0 - if not (0 <= intersect_t <= 1): return - # Now get the indices of the intersection - for i in range(3): - intersect[i] = u[i] + intersect_t * v[i] - cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) - tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])*iv_dir[i] - if cur_ind[i] == grid_mask.shape[i] and step[i] < 0: - cur_ind[i] = grid_mask.shape[i] - 1 - if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])*iv_dir[i] - if step[i] < 0: tmax[i] = (((cur_ind[i]+0)*dx[i])+left_edge[i]-u[i])*iv_dir[i] - tdelta[i] = (dx[i]*iv_dir[i]) - if tdelta[i] < 0: tdelta[i] *= -1 - # The variable intersect contains the point we first pierce the grid - enter_t = intersect_t - while 1: - if (not (0 <= cur_ind[0] < grid_mask.shape[0])) or \ - (not (0 <= cur_ind[1] < grid_mask.shape[1])) or \ - (not (0 <= cur_ind[2] < grid_mask.shape[2])): - break - # Note that we are calculating t on the fly, but we get *negative* t - # values from what they should be. - # If we've reached t = 1, we are done. - grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1 - if (tmax[0] > 1.0) and (tmax[1] > 1.0) and (tmax[2] > 1.0): - grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - enter_t - break - if tmax[0] < tmax[1]: - if tmax[0] < tmax[2]: - grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[0] - enter_t - enter_t = tmax[0] - tmax[0] += tdelta[0] - cur_ind[0] += step[0] - else: - grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[2] - enter_t - enter_t = tmax[2] - tmax[2] += tdelta[2] - cur_ind[2] += step[2] - else: - if tmax[1] < tmax[2]: - grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[1] - enter_t - enter_t = tmax[1] - tmax[1] += tdelta[1] - cur_ind[1] += step[1] - else: - grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = enter_t - grid_dt[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[2] - enter_t - enter_t = tmax[2] - tmax[2] += tdelta[2] - cur_ind[2] += step[2] - return - -@cython.wraparound(False) -@cython.boundscheck(False) -def PlaneVoxelIntegration(np.ndarray[np.float64_t, ndim=1] left_edge, - np.ndarray[np.float64_t, ndim=1] right_edge, - np.ndarray[np.float64_t, ndim=1] dx, - np.ndarray[np.float64_t, ndim=2] ug, - np.ndarray[np.float64_t, ndim=1] v, - np.ndarray[np.float64_t, ndim=2] image, - np.ndarray[np.float64_t, ndim=3] data, - np.ndarray[np.float64_t, ndim=2] shells): - # We're roughly following Amanatides & Woo on a ray-by-ray basis - # Note that for now it's just shells, but this can and should be - # generalized to transfer functions - cdef int i, vi - cdef int nv = ug.shape[0] - cdef int nshells = shells.shape[0] - cdef np.ndarray[np.float64_t, ndim=1] u = np.empty((3,), dtype=np.float64) - # Copy things into temporary location for passing between functions - for vi in range(nv): - for i in range(3): u[i] = ug[vi, i] - integrate_ray(u, v, left_edge, right_edge, dx, - nshells, vi, data, shells, image) - -@cython.wraparound(False) -@cython.boundscheck(False) -def integrate_ray(np.ndarray[np.float64_t, ndim=1] u, - np.ndarray[np.float64_t, ndim=1] v, - np.ndarray[np.float64_t, ndim=1] left_edge, - np.ndarray[np.float64_t, ndim=1] right_edge, - np.ndarray[np.float64_t, ndim=1] dx, - int nshells, int ind, - np.ndarray[np.float64_t, ndim=3] data, - np.ndarray[np.float64_t, ndim=2] shells, - np.ndarray[np.float64_t, ndim=2] image): - cdef int x, y, i, n - cdef int step[3] - cdef np.float64_t intersect_t = 1 - cdef np.float64_t tl, tr, enter_t - cdef np.int64_t cur_ind[3] - cdef np.float64_t tdelta[3] - cdef np.float64_t tmax[3] - cdef np.float64_t intersect[3] - cdef np.float64_t dv - cdef np.float64_t dist, alpha - cdef int dims[3] - cdef np.float64_t temp_x, temp_y - for i in range(3): - # As long as we're iterating, set some other stuff, too - dims[i] = data.shape[i] - if(v[i] < 0): step[i] = -1 - else: step[i] = 1 - x = (i+1)%3 - y = (i+2)%3 - tl = (left_edge[i] - u[i])/v[i] - tr = (right_edge[i] - u[i])/v[i] - temp_x = (u[x] + tl*v[x]) - temp_y = (u[y] + tl*v[y]) - if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ - (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - (0.0 <= tl) and (tl < intersect_t): - intersect_t = tl - temp_x = (u[x] + tr*v[x]) - temp_y = (u[y] + tr*v[y]) - if (left_edge[x] <= temp_x) and (temp_x <= right_edge[x]) and \ - (left_edge[y] <= temp_y) and (temp_y <= right_edge[y]) and \ - (0.0 <= tr) and (tr < intersect_t): - intersect_t = tr - # if fully enclosed - if (left_edge[0] <= u[0] <= right_edge[0]) and \ - (left_edge[1] <= u[1] <= right_edge[1]) and \ - (left_edge[2] <= u[2] <= right_edge[2]): - intersect_t = 0.0 - if not (0 <= intersect_t <= 1): - #print "Returning: intersect_t ==", intersect_t - return - # Now get the indices of the intersection - for i in range(3): intersect[i] = u[i] + intersect_t * v[i] - for i in range(3): - cur_ind[i] = np.floor((intersect[i] + 1e-8*dx[i] - left_edge[i])/dx[i]) - tmax[i] = (((cur_ind[i]+step[i])*dx[i])+left_edge[i]-u[i])/v[i] - if cur_ind[i] == dims[i] and step[i] < 0: - cur_ind[i] = dims[i] - 1 - if step[i] > 0: tmax[i] = (((cur_ind[i]+1)*dx[i])+left_edge[i]-u[i])/v[i] - if step[i] < 0: tmax[i] = (((cur_ind[i]+0)*dx[i])+left_edge[i]-u[i])/v[i] - tdelta[i] = (dx[i]/v[i]) - if tdelta[i] < 0: tdelta[i] *= -1 - # The variable intersect contains the point we first pierce the grid - enter_t = intersect_t - if (not (0 <= cur_ind[0] < dims[0])) or \ - (not (0 <= cur_ind[1] < dims[1])) or \ - (not (0 <= cur_ind[2] < dims[2])): - #print "Returning: cur_ind", cur_ind[0], cur_ind[1], cur_ind[2] - #print " dims: ", dims[0], dims[1], dims[2] - #print " intersect:", intersect[0], intersect[1], intersect[2] - #print " intersect:", intersect_t - #print " u :", u[0], u[1], u[2] - # - return - #print cur_ind[0], dims[0], cur_ind[1], dims[1], cur_ind[2], dims[2] - dv = data[cur_ind[0], cur_ind[1], cur_ind[2]] - #dt = 1e300 - while 1: - if image[ind,3] >= 1.0: break - if (not (0 <= cur_ind[0] < dims[0])) or \ - (not (0 <= cur_ind[1] < dims[1])) or \ - (not (0 <= cur_ind[2] < dims[2])): - break - # Do our transfer here - for n in range(nshells): - dist = shells[n, 0] - dv - if dist < shells[n,1]: - dist = exp(-dist/8.0) - alpha = (1.0 - shells[n,5])*shells[n,5]#*dt - image[ind,0] += alpha*shells[n,2]*dist - image[ind,1] += alpha*shells[n,3]*dist - image[ind,2] += alpha*shells[n,4]*dist - image[ind,3] += alpha*shells[n,5]*dist - #image[ind,i] += rgba[i]*dist*rgba[3]/dt - #print rgba[i], image[ind,i], dist, dt - break - if (tmax[0] > 1.0) and (tmax[1] > 1.0) and (tmax[2] > 1.0): - dt = 1.0 - enter_t - break - if tmax[0] < tmax[1]: - if tmax[0] < tmax[2]: - dt = tmax[0] - enter_t - enter_t = tmax[0] - tmax[0] += tdelta[0] - cur_ind[0] += step[0] - else: - dt = tmax[2] - enter_t - enter_t = tmax[2] - tmax[2] += tdelta[2] - cur_ind[2] += step[2] - else: - if tmax[1] < tmax[2]: - dt = tmax[1] - enter_t - enter_t = tmax[1] - tmax[1] += tdelta[1] - cur_ind[1] += step[1] - else: - dt = tmax[2] - enter_t - enter_t = tmax[2] - tmax[2] += tdelta[2] - cur_ind[2] += step[2] - dv = data[cur_ind[0], cur_ind[1], cur_ind[2]] diff -Nru yt-3.3.3/yt/utilities/lib/tests/test_allocation_container.py yt-3.4.0/yt/utilities/lib/tests/test_allocation_container.py --- yt-3.3.3/yt/utilities/lib/tests/test_allocation_container.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/tests/test_allocation_container.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,22 @@ +from yt.testing import \ + assert_array_equal, assert_equal +from yt.utilities.lib.allocation_container import \ + BitmaskPool + +def test_bitmask_pool(): + bmp = BitmaskPool() + assert_equal(len(bmp), 0) + bmp.append(100) + assert_equal(len(bmp), 1) + assert_equal(bmp[0].size, 100) + bmp.append(200) + assert_equal(len(bmp), 2) + assert_equal(bmp[0].size, 100) + assert_equal(bmp[1].size, 200) + assert_equal(sum(_.size for _ in bmp.to_arrays()), 300) + arrs = bmp.to_arrays() + assert_equal(arrs[0].size, 100) + assert_equal(arrs[1].size, 200) + arrs[0][:] = 1 + arrs = bmp.to_arrays() + assert_array_equal(arrs[0], 1) diff -Nru yt-3.3.3/yt/utilities/lib/tests/test_alt_ray_tracers.py yt-3.4.0/yt/utilities/lib/tests/test_alt_ray_tracers.py --- yt-3.3.3/yt/utilities/lib/tests/test_alt_ray_tracers.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/tests/test_alt_ray_tracers.py 2017-08-10 18:02:57.000000000 +0000 @@ -65,20 +65,20 @@ t, s, rztheta, inds = cylindrical_ray_trace(p1, p2, left_grid, right_grid) npoints = len(t) - yield check_monotonic_inc, t - yield assert_less_equal, 0.0, t[0] - yield assert_less_equal, t[-1], 1.0 + check_monotonic_inc(t) + assert_less_equal(0.0, t[0]) + assert_less_equal(t[-1], 1.0) - yield check_monotonic_inc, s - yield assert_less_equal, 0.0, s[0] - yield assert_less_equal, s[-1], pathlen - yield assert_equal, npoints, len(s) + check_monotonic_inc(s) + assert_less_equal(0.0, s[0]) + assert_less_equal(s[-1], pathlen) + assert_equal(npoints, len(s)) - yield assert_equal, (npoints, 3), rztheta.shape - yield check_bounds, rztheta[:,0], 0.0, 1.0 - yield check_bounds, rztheta[:,1], -1.0, 1.0 - yield check_bounds, rztheta[:,2], 0.0, 2*np.pi - yield check_monotonic_inc, rztheta[:,2] + assert_equal((npoints, 3), rztheta.shape) + check_bounds(rztheta[:,0], 0.0, 1.0) + check_bounds(rztheta[:,1], -1.0, 1.0) + check_bounds(rztheta[:,2], 0.0, 2*np.pi) + check_monotonic_inc(rztheta[:,2]) - yield assert_equal, npoints, len(inds) - yield check_bounds, inds, 0, len(left_grid)-1 + assert_equal(npoints, len(inds)) + check_bounds(inds, 0, len(left_grid)-1) diff -Nru yt-3.3.3/yt/utilities/lib/tests/test_bitarray.py yt-3.4.0/yt/utilities/lib/tests/test_bitarray.py --- yt-3.3.3/yt/utilities/lib/tests/test_bitarray.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/tests/test_bitarray.py 2017-08-10 18:02:57.000000000 +0000 @@ -10,21 +10,21 @@ arr_in = (np.random.random(32**3 + i) > 0.5) b = ba.bitarray(arr = arr_in) if i > 0: - yield assert_equal, b.ibuf.size, (32**3)/8.0 + 1 + assert_equal(b.ibuf.size, (32**3)/8.0 + 1) arr_out = b.as_bool_array() - yield assert_equal, arr_in, arr_out + assert_equal(arr_in, arr_out) # Let's check we can do it without feeding it at first b = ba.bitarray(size = arr_in.size) b.set_from_array(arr_in) arr_out = b.as_bool_array() - yield assert_equal, arr_in, arr_out + assert_equal(arr_in, arr_out) # Try a big array arr_in = (np.random.random(32**3 + i) > 0.5) b = ba.bitarray(arr = arr_in) arr_out = b.as_bool_array() - yield assert_equal, arr_in, arr_out + assert_equal(arr_in, arr_out) # Let's check we can do something interesting. arr_in1 = (np.random.random(32**3) > 0.5) @@ -32,11 +32,11 @@ b1 = ba.bitarray(arr = arr_in1) b2 = ba.bitarray(arr = arr_in2) b3 = ba.bitarray(arr = (arr_in1 & arr_in2)) - yield assert_equal, (b1.ibuf & b2.ibuf), b3.ibuf + assert_equal((b1.ibuf & b2.ibuf), b3.ibuf) b = ba.bitarray(10) for i in range(10): b.set_value(i, 2) # 2 should evaluate to True arr = b.as_bool_array() - yield assert_equal, arr[:i+1].all(), True - yield assert_equal, arr[i+1:].any(), False + assert_equal(arr[:i+1].all(), True) + assert_equal(arr[i+1:].any(), False) diff -Nru yt-3.3.3/yt/utilities/lib/tests/test_element_mappings.py yt-3.4.0/yt/utilities/lib/tests/test_element_mappings.py --- yt-3.3.3/yt/utilities/lib/tests/test_element_mappings.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/tests/test_element_mappings.py 2017-08-10 18:02:57.000000000 +0000 @@ -21,8 +21,12 @@ test_hex_sampler, \ test_tri_sampler, \ test_quad_sampler, \ + test_quad2_sampler, \ test_hex20_sampler, \ - test_wedge_sampler + test_wedge_sampler, \ + test_tri2_sampler, \ + test_tet2_sampler, \ + test_linear1D_sampler def check_all_vertices(sampler, vertices, field_values): @@ -35,6 +39,14 @@ assert_almost_equal(val, field_values[i]) +def test_P1Sampler1D(): + + vertices = np.array([[0.1], [0.3]]) + field_values = np.array([ 1., 2.]) + + check_all_vertices(test_linear1D_sampler, vertices, field_values) + + def test_P1Sampler2D(): vertices = np.array([[0.1, 0.2], [0.6, 0.3], [0.2, 0.7]]) @@ -66,6 +78,23 @@ check_all_vertices(test_quad_sampler, vertices, field_values) +def test_Q2Sampler2D(): + + vertices = np.array([[2., 3.], + [7., 4.], + [10., 15.], + [4., 12.], + [4.5, 3.5], + [8.5, 9.5], + [7., 13.5], + [3., 7.5], + [5.75, 8.5]]) + + field_values = np.array([7., 27., 40., 12., 13., 30., 22., 9., 16.]) + + check_all_vertices(test_quad2_sampler, vertices, field_values) + + def test_Q1Sampler3D(): vertices = np.array([[2.00657905, 0.6888599, 1.4375], [1.8658198, 1.00973171, 1.4375], @@ -127,3 +156,34 @@ field_values = np.array([1., 2., 3., 4., 5., 6.]) check_all_vertices(test_wedge_sampler, vertices, field_values) + +def test_T2Sampler2D(): + + vertices = np.array([[0.1 , 0.2 ], + [0.3 , 0.5 ], + [0.2 , 0.9 ], + [0.2 , 0.35], + [0.25, 0.7 ], + [0.15, 0.55]]) + + field_values = np.array([15., 37., 49., 32., 46., 24.]) + + check_all_vertices(test_tri2_sampler, vertices, field_values) + + +def test_Tet2Sampler3D(): + + vertices = np.array([[0.3 , -0.4 , 0.6] , + [1.7 , -0.7 , 0.8] , + [0.4 , 1.2 , 0.4] , + [0.4 , -0.2 , 2.0] , + [1.0 , -0.55 , 0.7] , + [1.05 , 0.25 , 0.6] , + [0.35 , 0.4 , 0.5] , + [0.35 , -0.3 , 1.3] , + [1.05 , -0.45 , 1.4] , + [0.4 , 0.5 , 1.2]]) + + field_values = np.array([15., 37., 49., 24., 30., 44., 20., 17., 32., 36.]) + + check_all_vertices(test_tet2_sampler, vertices, field_values) diff -Nru yt-3.3.3/yt/utilities/lib/tests/test_fill_region.py yt-3.4.0/yt/utilities/lib/tests/test_fill_region.py --- yt-3.3.3/yt/utilities/lib/tests/test_fill_region.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/tests/test_fill_region.py 2017-08-10 18:02:57.000000000 +0000 @@ -25,7 +25,8 @@ ires = np.zeros(NDIM*NDIM*NDIM, "int64") ddims = np.array([NDIM, NDIM, NDIM], dtype="int64") * rf fill_region(input_fields, output_fields, level, - left_index, ipos, ires, ddims, 2) + left_index, ipos, ires, ddims, + np.array([2, 2, 2], dtype="i8")) for r in range(level + 1): for o, i in zip(output_fields, v): assert_equal( o[r::rf,r::rf,r::rf], i) diff -Nru yt-3.3.3/yt/utilities/lib/tests/test_ragged_arrays.py yt-3.4.0/yt/utilities/lib/tests/test_ragged_arrays.py --- yt-3.3.3/yt/utilities/lib/tests/test_ragged_arrays.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/tests/test_ragged_arrays.py 2017-08-10 18:02:57.000000000 +0000 @@ -38,10 +38,10 @@ arr = values[indices[i:i+v]] if dtype == "float32": # Numpy 1.9.1 changes the accumulator type to promote - yield assert_rel_equal, op(arr), out_values[j], 6 + assert_rel_equal(op(arr), out_values[j], 6) elif dtype == "float64": # Numpy 1.9.1 changes the accumulator type to promote - yield assert_rel_equal, op(arr), out_values[j], 12 + assert_rel_equal(op(arr), out_values[j], 12) else: - yield assert_equal, op(arr), out_values[j] + assert_equal(op(arr), out_values[j]) i += v diff -Nru yt-3.3.3/yt/utilities/lib/write_array.c yt-3.4.0/yt/utilities/lib/write_array.c --- yt-3.3.3/yt/utilities/lib/write_array.c 2016-12-12 01:42:04.000000000 +0000 +++ yt-3.4.0/yt/utilities/lib/write_array.c 2017-08-10 18:20:59.000000000 +0000 @@ -1,9 +1,13 @@ -/* Generated by Cython 0.25.2 */ +/* Generated by Cython 0.26rc2 */ /* BEGIN: Cython Metadata { "distutils": { - "depends": [] + "depends": [], + "name": "yt.utilities.lib.write_array", + "sources": [ + "yt/utilities/lib/write_array.pyx" + ] }, "module_name": "yt.utilities.lib.write_array" } @@ -16,7 +20,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_25_2" +#define CYTHON_ABI "0_26rc2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -38,6 +42,7 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG @@ -190,16 +195,20 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **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))))) + ((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 @@ -326,6 +335,12 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -380,6 +395,35 @@ # 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 + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif #ifndef CYTHON_INLINE #if defined(__clang__) @@ -487,8 +531,8 @@ #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +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 @@ -501,8 +545,11 @@ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_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) @@ -624,10 +671,12 @@ #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; static PyObject *__pyx_d; static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -1048,7 +1097,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO + __Pyx_TypeInfo* type); /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS @@ -1196,6 +1245,9 @@ /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; @@ -1453,17 +1505,18 @@ static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_write_3D_array[] = "write_3D_array"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_write_3D_vector_array[] = "write_3D_vector_array"; static const char __pyx_k_Faster_cythonized_file_IO[] = "\nFaster, cythonized file IO\n\n\n\n"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_yt_utilities_lib_write_array[] = "yt.utilities.lib.write_array"; -static const char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/utilities/lib/write_array.pyx"; 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"; static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; 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_yt_utilities_lib_write_array_pyx[] = "yt/utilities/lib/write_array.pyx"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_kp_s_; static PyObject *__pyx_n_s_DTYPE; @@ -1475,10 +1528,10 @@ static PyObject *__pyx_n_s_Ny; static PyObject *__pyx_n_s_Nz; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_kp_s__2; static PyObject *__pyx_n_s_arange; +static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_data_x; static PyObject *__pyx_n_s_data_y; @@ -1508,6 +1561,7 @@ static PyObject *__pyx_n_s_write_3D_array; static PyObject *__pyx_n_s_write_3D_vector_array; static PyObject *__pyx_n_s_yt_utilities_lib_write_array; +static PyObject *__pyx_kp_s_yt_utilities_lib_write_array_pyx; static PyObject *__pyx_pf_2yt_9utilities_3lib_11write_array_write_3D_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, PyObject *__pyx_v_fhandle); /* proto */ static PyObject *__pyx_pf_2yt_9utilities_3lib_11write_array_2write_3D_vector_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data_x, PyArrayObject *__pyx_v_data_y, PyArrayObject *__pyx_v_data_z, PyObject *__pyx_v_fhandle); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ @@ -1551,7 +1605,9 @@ 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; } @@ -1560,6 +1616,7 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fhandle)) != 0)) kw_args--; else { @@ -2170,9 +2227,13 @@ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { 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; } @@ -2181,16 +2242,19 @@ case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("write_3D_vector_array", 1, 4, 4, 1); __PYX_ERR(0, 38, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data_z)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("write_3D_vector_array", 1, 4, 4, 2); __PYX_ERR(0, 38, __pyx_L3_error) } + CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fhandle)) != 0)) kw_args--; else { @@ -5078,7 +5142,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5126,7 +5190,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 @@ -5209,7 +5273,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5257,7 +5321,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 @@ -5340,7 +5404,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; + goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign @@ -5385,7 +5449,7 @@ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; - __pyx_L10_try_end:; + __pyx_L8_try_end:; } /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 @@ -5444,10 +5508,10 @@ {&__pyx_n_s_Ny, __pyx_k_Ny, sizeof(__pyx_k_Ny), 0, 0, 1, 1}, {&__pyx_n_s_Nz, __pyx_k_Nz, sizeof(__pyx_k_Nz), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 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_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_data_x, __pyx_k_data_x, sizeof(__pyx_k_data_x), 0, 0, 1, 1}, {&__pyx_n_s_data_y, __pyx_k_data_y, sizeof(__pyx_k_data_y), 0, 0, 1, 1}, @@ -5477,6 +5541,7 @@ {&__pyx_n_s_write_3D_array, __pyx_k_write_3D_array, sizeof(__pyx_k_write_3D_array), 0, 0, 1, 1}, {&__pyx_n_s_write_3D_vector_array, __pyx_k_write_3D_vector_array, sizeof(__pyx_k_write_3D_vector_array), 0, 0, 1, 1}, {&__pyx_n_s_yt_utilities_lib_write_array, __pyx_k_yt_utilities_lib_write_array, sizeof(__pyx_k_yt_utilities_lib_write_array), 0, 0, 1, 1}, + {&__pyx_kp_s_yt_utilities_lib_write_array_pyx, __pyx_k_yt_utilities_lib_write_array_pyx, sizeof(__pyx_k_yt_utilities_lib_write_array_pyx), 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { @@ -5600,7 +5665,7 @@ __pyx_tuple__12 = PyTuple_Pack(8, __pyx_n_s_data, __pyx_n_s_fhandle, __pyx_n_s_Nx, __pyx_n_s_Ny, __pyx_n_s_Nz, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_write_3D_array, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_write_array_pyx, __pyx_n_s_write_3D_array, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 24, __pyx_L1_error) /* "yt/utilities/lib/write_array.pyx":38 * @@ -5612,7 +5677,7 @@ __pyx_tuple__14 = PyTuple_Pack(13, __pyx_n_s_data_x, __pyx_n_s_data_y, __pyx_n_s_data_z, __pyx_n_s_fhandle, __pyx_n_s_Nx, __pyx_n_s_Ny, __pyx_n_s_Nz, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_fx, __pyx_n_s_fy, __pyx_n_s_fz); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_write_3D_vector_array, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_write_array_pyx, __pyx_n_s_write_3D_vector_array, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -5684,6 +5749,7 @@ __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 @@ -5809,7 +5875,7 @@ __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { - __Pyx_AddTraceback("init yt.utilities.lib.write_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init yt.utilities.lib.write_array", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { @@ -6599,17 +6665,22 @@ 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 == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + 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()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); + 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 // CYTHON_FAST_PYCCALL +#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL @@ -6728,8 +6799,8 @@ Py_LeaveRecursiveCall(); return result; } -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL +#endif +#endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON @@ -6789,11 +6860,7 @@ return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else if (likely(PyCFunction_Check(func))) { -#endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL @@ -6816,7 +6883,7 @@ #endif /* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE + #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; @@ -6840,7 +6907,7 @@ #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare @@ -7003,25 +7070,25 @@ #endif /* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + 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) { + 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) { + 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) { + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; @@ -7034,7 +7101,7 @@ } /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; @@ -7058,7 +7125,7 @@ #endif /* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; @@ -7068,7 +7135,7 @@ #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE + #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) { @@ -7129,7 +7196,7 @@ } /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -7202,8 +7269,42 @@ return module; } +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + 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 { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + 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; + } + return c_line; +#endif +} + /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + 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; @@ -7283,7 +7384,7 @@ } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -7342,12 +7443,15 @@ int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (c_line) { + c_line = __Pyx_CLineForTraceback(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); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ @@ -7384,8 +7488,8 @@ #endif - /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + /* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -7416,7 +7520,7 @@ } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #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) @@ -7438,7 +7542,7 @@ } /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -7458,7 +7562,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -7593,7 +7697,7 @@ #endif /* Declarations */ - #if CYTHON_CCOMPLEX + #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); @@ -7613,7 +7717,7 @@ #endif /* Arithmetic */ - #if CYTHON_CCOMPLEX + #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); @@ -7748,7 +7852,7 @@ #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + 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) { @@ -7779,7 +7883,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { + static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -7968,7 +8072,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + 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 @@ -8157,7 +8261,7 @@ } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + 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) { @@ -8188,7 +8292,7 @@ } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + 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 @@ -8377,7 +8481,7 @@ } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + 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()); @@ -8393,7 +8497,7 @@ } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -8411,7 +8515,7 @@ #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #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) @@ -8476,7 +8580,7 @@ #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -8501,6 +8605,8 @@ #endif if (!*t->p) return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); ++t; } return 0; @@ -8509,11 +8615,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII diff -Nru yt-3.3.3/yt/utilities/lru_cache.py yt-3.4.0/yt/utilities/lru_cache.py --- yt-3.3.3/yt/utilities/lru_cache.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/lru_cache.py 2017-08-10 18:02:57.000000000 +0000 @@ -53,7 +53,7 @@ return key[0] return _HashedSeq(key) -def lru_cache(maxsize=100, typed=False): +def lru_cache(maxsize=100, typed=False, make_key = _make_key): """Least-recently-used cache decorator. If *maxsize* is set to None, the LRU features are disabled and the cache can grow without bound. @@ -77,7 +77,6 @@ cache = dict() stats = [0, 0] # make statistics updateable non-locally HITS, MISSES = 0, 1 # names for the stats fields - make_key = _make_key cache_get = cache.get # bound method to lookup key or return None _len = len # localize the global len() function lock = RLock() # because linkedlist updates aren't threadsafe @@ -182,6 +181,8 @@ return decorating_function ### End of backported lru_cache +local_lru_cache = lru_cache + if sys.version_info[:2] >= (3, 3): # 3.2 has an lru_cache with an incompatible API from functools import lru_cache diff -Nru yt-3.3.3/yt/utilities/math_utils.py yt-3.4.0/yt/utilities/math_utils.py --- yt-3.3.3/yt/utilities/math_utils.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/math_utils.py 2017-08-10 18:02:57.000000000 +0000 @@ -61,7 +61,7 @@ pos : array An array of floats. - ds : Dataset + ds : ~yt.data_objects.static_output.Dataset A simulation static output. Examples @@ -852,7 +852,7 @@ Parameters ---------- maxr : scalar - should be max(|x|, |y|) + should be ``max(|x|, |y|)`` aspect : scalar The aspect ratio of width / height for the projection. @@ -1234,7 +1234,12 @@ JdotCoords = np.sum(J*coords,axis=0) - return np.arccos( JdotCoords / np.sqrt(np.sum(coords**2,axis=0)) ) + with np.errstate(invalid='ignore'): + ret = np.arccos( JdotCoords / np.sqrt(np.sum(coords**2,axis=0))) + + ret[np.isnan(ret)] = 0 + + return ret def get_sph_phi(coords, normal): # We have freedom with respect to what axis (xprime) to define diff -Nru yt-3.3.3/yt/utilities/mesh_code_generation.py yt-3.4.0/yt/utilities/mesh_code_generation.py --- yt-3.3.3/yt/utilities/mesh_code_generation.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/mesh_code_generation.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,193 @@ +""" +This file contains code for automatically generating the functions and jacobians +used when sampling inside the supported finite element mesh types. The supported +mesh types are defined in yt/utilities/mesh_types.yaml. + +Usage (from the yt/utilities directory): + +python mesh_code_generation.py + +This will generate the necessary functions and write them to +yt/utilities/lib/autogenerated_element_samplers.pyx. + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2016, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from sympy import \ + symarray, \ + diff, \ + ccode, \ + Matrix, \ + MatrixSymbol +import yaml + + +# define some templates used below +fun_signature = '''cdef void %s(double* fx, + double* x, + double* vertices, + double* phys_x) nogil''' + +fun_dec_template = fun_signature + ' \n' +fun_def_template = '''@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) \n''' + fun_signature + ': \n' + +jac_signature_3D = '''cdef void %s(double* rcol, + double* scol, + double* tcol, + double* x, + double* vertices, + double* phys_x) nogil''' + +jac_dec_template_3D = jac_signature_3D + ' \n' +jac_def_template_3D = '''@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) \n''' + jac_signature_3D + ': \n' + +jac_signature_2D = '''cdef void %s(double* rcol, + double* scol, + double* x, + double* vertices, + double* phys_x) nogil''' +jac_dec_template_2D = jac_signature_2D + ' \n' +jac_def_template_2D = '''@cython.boundscheck(False) +@cython.wraparound(False) +@cython.cdivision(True) \n''' + jac_signature_2D + ': \n' + +file_header = "# This file contains auto-generated functions for sampling \n" + \ + "# inside finite element solutions for various mesh types. \n" + \ + "# To see how the code generation works in detail, see \n" + \ + "# yt/utilities/mesh_code_generation.py. \n" + + +class MeshCodeGenerator: + ''' + + A class for automatically generating the functions and jacobians used for + sampling inside finite element calculations. + + ''' + def __init__(self, mesh_data): + ''' + + Mesh data should be a dictionary containing information about the type + of elements used. See yt/utilities/mesh_types.yaml for more information. + + ''' + self.mesh_type = mesh_data['mesh_type'] + self.num_dim = mesh_data['num_dim'] + self.num_vertices = mesh_data['num_vertices'] + self.num_mapped_coords = mesh_data['num_mapped_coords'] + + x = MatrixSymbol('x', self.num_mapped_coords, 1) + self.x = x + self.N = Matrix(eval(mesh_data['shape_functions'])) + self._compute_jacobian() + + def _compute_jacobian(self): + + assert(self.num_vertices == len(self.N)) + assert(self.num_dim == self.num_mapped_coords) + + X = MatrixSymbol("vertices", self.num_vertices, self.num_dim) + self.fx = MatrixSymbol("fx", self.num_dim, 1) + physical_position = MatrixSymbol('phys_x', self.num_dim, 1) + + self.f = (self.N.T * Matrix(X)).T - physical_position + + self.J = symarray('J', (self.num_dim, self.num_dim)) + for i in range(self.num_dim): + for j, var in enumerate(self.x): + self.J[i][j] = diff(self.f[i, 0], var) + + self.rcol = MatrixSymbol("rcol", self.num_dim, 1) + self.scol = MatrixSymbol("scol", self.num_dim, 1) + self.tcol = MatrixSymbol("tcol", self.num_dim, 1) + + self.function_name = '%sFunction%dD' % (self.mesh_type, self.num_dim) + self.function_header = fun_def_template % self.function_name + self.function_declaration = fun_dec_template % self.function_name + + self.jacobian_name = '%sJacobian%dD' % (self.mesh_type, self.num_dim) + + if (self.num_dim == 3): + self.jacobian_header = jac_def_template_3D % self.jacobian_name + self.jacobian_declaration = jac_dec_template_3D % self.jacobian_name + + elif (self.num_dim == 2): + self.jacobian_header = jac_def_template_2D % self.jacobian_name + self.jacobian_declaration = jac_dec_template_2D % self.jacobian_name + + def get_interpolator_definition(self): + ''' + + This returns the function definitions for the given mesh type. + + ''' + + function_code = self.function_header + for i in range(self.num_dim): + function_code += '\t' + ccode(self.f[i, 0], self.fx[i, 0]) + '\n' + + jacobian_code = self.jacobian_header + for i in range(self.num_dim): + jacobian_code += '\t' + ccode(self.J[i,0], self.rcol[i, 0]) + '\n' + jacobian_code += '\t' + ccode(self.J[i,1], self.scol[i, 0]) + '\n' + if self.num_dim == 2: + continue + jacobian_code += '\t' + ccode(self.J[i,2], self.tcol[i, 0]) + '\n' + + return function_code, jacobian_code + + def get_interpolator_declaration(self): + ''' + + This returns the function declarations for the given mesh type. + + ''' + return self.function_declaration, self.jacobian_declaration + + +if __name__ == "__main__": + + with open('mesh_types.yaml', 'r') as f: + lines = f.read() + + mesh_types = yaml.load(lines) + + pxd_file = open("lib/autogenerated_element_samplers.pxd", "w") + pyx_file = open("lib/autogenerated_element_samplers.pyx", "w") + + pyx_file.write(file_header) + pyx_file.write("\n \n") + pyx_file.write("cimport cython \n") + pyx_file.write("from libc.math cimport pow \n") + pyx_file.write("\n \n") + + for _, mesh_data in sorted(mesh_types.items()): + codegen = MeshCodeGenerator(mesh_data) + + function_code, jacobian_code = codegen.get_interpolator_definition() + function_decl, jacobian_decl = codegen.get_interpolator_declaration() + + pxd_file.write(function_decl) + pxd_file.write("\n \n") + pxd_file.write(jacobian_decl) + pxd_file.write("\n \n") + + pyx_file.write(function_code) + pyx_file.write("\n \n") + pyx_file.write(jacobian_code) + pyx_file.write("\n \n") + + pxd_file.close() + pyx_file.close() diff -Nru yt-3.3.3/yt/utilities/mesh_types.yaml yt-3.4.0/yt/utilities/mesh_types.yaml --- yt-3.3.3/yt/utilities/mesh_types.yaml 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/mesh_types.yaml 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,84 @@ +Hex8: + mesh_type: Q1 + num_dim: 3 + num_vertices: 8 + num_mapped_coords: 3 + shape_functions: | + [(1 - x[0])*(1 - x[1])*(1 - x[2])/8., + (1 + x[0])*(1 - x[1])*(1 - x[2])/8., + (1 + x[0])*(1 + x[1])*(1 - x[2])/8., + (1 - x[0])*(1 + x[1])*(1 - x[2])/8., + (1 - x[0])*(1 - x[1])*(1 + x[2])/8., + (1 + x[0])*(1 - x[1])*(1 + x[2])/8., + (1 + x[0])*(1 + x[1])*(1 + x[2])/8., + (1 - x[0])*(1 + x[1])*(1 + x[2])/8.] + +Quad4: + mesh_type: Q1 + num_dim: 2 + num_vertices: 4 + num_mapped_coords: 2 + shape_functions: | + [(1 - x[0])*(1 - x[1])/4., + (1 + x[0])*(1 - x[1])/4., + (1 + x[0])*(1 + x[1])/4., + (1 - x[0])*(1 + x[1])/4.] + +Quad9: + mesh_type: Q2 + num_dim: 2 + num_vertices: 9 + num_mapped_coords: 2 + shape_functions: | + [x[0] * (x[0] - 1) * x[1] * (x[1] - 1) / 4., + x[0] * (x[0] + 1) * x[1] * (x[1] - 1) / 4., + x[0] * (x[0] + 1) * x[1] * (x[1] + 1) / 4., + x[0] * (x[0] - 1) * x[1] * (x[1] + 1) / 4., + (x[0] + 1) * (x[0] - 1) * x[1] * (x[1] - 1) / -2., + x[0] * (x[0] + 1) * (x[1] + 1) * (x[1] - 1) / -2., + (x[0] + 1) * (x[0] - 1) * x[1] * (x[1] + 1) / -2., + x[0] * (x[0] - 1) * (x[1] + 1) * (x[1] - 1) / -2., + (x[0] + 1) * (x[0] - 1) * (x[1] + 1) * (x[1] - 1)] + +Wedge6: + mesh_type: W1 + num_dim: 3 + num_vertices: 6 + num_mapped_coords: 3 + shape_functions: | + [(1 - x[0] - x[1]) * (1 - x[2]) / 2., + x[0] * (1 - x[2]) / 2., + x[1] * (1 - x[2]) / 2., + (1 - x[0] - x[1]) * (1 + x[2]) / 2., + x[0] * (1 + x[2]) / 2., + x[1] * (1 + x[2]) / 2.] + +Tri6: + mesh_type: T2 + num_dim: 2 + num_vertices: 6 + num_mapped_coords: 2 + shape_functions: | + [1 - 3 * x[0] + 2 * x[0]**2 - 3 * x[1] + 2 * x[1]**2 + 4 * x[0] * x[1], + -x[0] + 2 * x[0]**2, + -x[1] + 2 * x[1]**2, + 4 * x[0] - 4 * x[0]**2 - 4 * x[0] * x[1], + 4 * x[0] * x[1], + 4 * x[1] - 4 * x[1]**2 - 4 * x[0] * x[1]] + +Tet10: + mesh_type: Tet2 + num_dim: 3 + num_vertices: 10 + num_mapped_coords: 3 + shape_functions: | + [1 - 3 * x[0] + 2 * x[0]**2 - 3 * x[1] + 2 * x[1]**2 - 3 * x[2] + 2 * x[2]**2 + 4 * x[0] * x[1] + 4 * x[0] * x[2] + 4 * x[1] * x[2], + -x[0] + 2 * x[0]**2, + -x[1] + 2 * x[1]**2, + -x[2] + 2 * x[2]**2, + 4 * x[0] - 4 * x[0]**2 - 4 * x[0] * x[1] - 4 * x[0] * x[2], + 4 * x[0] * x[1], + 4 * x[1] - 4 * x[1]**2 - 4 * x[1] * x[0] - 4 * x[1] * x[2], + 4 * x[2] - 4 * x[2]**2 - 4 * x[2] * x[0] - 4 * x[2] * x[1], + 4 * x[0] * x[2], + 4 * x[1] * x[2]] diff -Nru yt-3.3.3/yt/utilities/nodal_data_utils.py yt-3.4.0/yt/utilities/nodal_data_utils.py --- yt-3.3.3/yt/utilities/nodal_data_utils.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/nodal_data_utils.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,41 @@ +import numpy as np + +_index_map = np.array([[0, 0, 0, 0, 0, 0, 0, 0], + [0, 1, 0, 1, 0, 1, 0, 1], + [0, 0, 1, 1, 0, 0, 1, 1], + [0, 1, 2, 3, 0, 1, 2, 3], + [0, 0, 0, 0, 1, 1, 1, 1], + [0, 1, 0, 1, 2, 3, 2, 3], + [0, 0, 1, 1, 2, 2, 3, 3], + [0, 1, 2, 3, 4, 5, 6, 7]]) + +def _get_linear_index(nodal_flag): + return 1*nodal_flag[2] + 2*nodal_flag[1] + 4*nodal_flag[0] + +def _get_indices(nodal_flag): + li = _get_linear_index(nodal_flag) + return _index_map[li] + +def get_nodal_data(data_source, field): + finfo = data_source.ds._get_field_info(field) + nodal_flag = finfo.nodal_flag + field_data = data_source[field] + inds = _get_indices(nodal_flag) + return field_data[:, inds] + +def get_nodal_slices(shape, nodal_flag): + slices = [] + dir_slices = [[] for _ in range(3)] + + for i in range(3): + if nodal_flag[i]: + dir_slices[i] = [slice(0, shape[i]-1), slice(1, shape[i])] + else: + dir_slices[i] = [slice(0, shape[i])] + + for i, sl_i in enumerate(dir_slices[0]): + for j, sl_j in enumerate(dir_slices[1]): + for k, sl_k in enumerate(dir_slices[2]): + slices.append([sl_i, sl_j, sl_k]) + + return slices diff -Nru yt-3.3.3/yt/utilities/on_demand_imports.py yt-3.4.0/yt/utilities/on_demand_imports.py --- yt-3.3.3/yt/utilities/on_demand_imports.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/on_demand_imports.py 2017-08-10 18:02:57.000000000 +0000 @@ -30,6 +30,23 @@ def __call__(self, *args, **kwargs): raise self.error +class netCDF4_imports(object): + _name = "netCDF4" + _Dataset = None + @property + def Dataset(self): + if self._Dataset is None: + try: + from netCDF4 import Dataset + except ImportError: + Dataset = NotAModule(self._name) + self._Dataset = Dataset + return self._Dataset + + +_netCDF4 = netCDF4_imports() + + class astropy_imports(object): _name = "astropy" _pyfits = None @@ -230,6 +247,19 @@ self._Group = Group return self._Group + _Dataset = None + @property + def Dataset(self): + if self._err: + raise self._err + if self._Dataset is None: + try: + from h5py import Dataset + except ImportError: + Dataset = NotAModule(self._name) + self._Dataset = Dataset + return self._Dataset + ___version__ = None @property def __version__(self): diff -Nru yt-3.3.3/yt/utilities/orientation.py yt-3.4.0/yt/utilities/orientation.py --- yt-3.3.3/yt/utilities/orientation.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/orientation.py 2017-08-10 18:02:57.000000000 +0000 @@ -23,7 +23,7 @@ def _aligned(a, b): aligned_component = np.abs(np.dot(a, b) / np.linalg.norm(a) / np.linalg.norm(b)) return np.isclose(aligned_component, 1.0, 1.0e-13) - + def _validate_unit_vectors(normal_vector, north_vector): @@ -35,7 +35,6 @@ if not np.dot(normal_vector, normal_vector) > 0: raise YTException("normal_vector cannot be the zero vector.") - if north_vector is not None and _aligned(north_vector, normal_vector): raise YTException("normal_vector and north_vector cannot be aligned.") @@ -85,7 +84,7 @@ t = np.cross(normal_vector, vecs).sum(axis=1) ax = t.argmax() east_vector = np.cross(vecs[ax, :], normal_vector).ravel() - # self.north_vector must remain None otherwise rotations about a fixed axis will break. + # self.north_vector must remain None otherwise rotations about a fixed axis will break. # The north_vector calculated here will still be included in self.unit_vectors. north_vector = np.cross(normal_vector, east_vector).ravel() else: diff -Nru yt-3.3.3/yt/utilities/parallel_tools/io_runner.py yt-3.4.0/yt/utilities/parallel_tools/io_runner.py --- yt-3.3.3/yt/utilities/parallel_tools/io_runner.py 2016-12-08 23:43:49.000000000 +0000 +++ yt-3.4.0/yt/utilities/parallel_tools/io_runner.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,7 +13,7 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -import np +import numpy as np from yt.utilities.logger import ytLogger as mylog from .parallel_analysis_interface import \ ProcessorPool, parallel_objects diff -Nru yt-3.3.3/yt/utilities/parallel_tools/parallel_analysis_interface.py yt-3.4.0/yt/utilities/parallel_tools/parallel_analysis_interface.py --- yt-3.3.3/yt/utilities/parallel_tools/parallel_analysis_interface.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/parallel_tools/parallel_analysis_interface.py 2017-08-10 18:02:57.000000000 +0000 @@ -434,7 +434,7 @@ Parameters ---------- - objects : iterable + objects : Iterable The list of objects to dispatch to different processors. njobs : int How many jobs to spawn. By default, one job will be dispatched for @@ -540,7 +540,7 @@ Parameters ---------- - objects : iterable + objects : Iterable The list of objects to operate on. generator_func : callable This function will be called on each object, and the results yielded. @@ -676,7 +676,8 @@ self._distributed = comm is not None and self.comm.size > 1 def __del__(self): - self.comm.Free() + if self.comm is not None: + self.comm.Free() """ This is an interface specification providing several useful utility functions for analyzing something in parallel. diff -Nru yt-3.3.3/yt/utilities/parameter_file_storage.py yt-3.4.0/yt/utilities/parameter_file_storage.py --- yt-3.3.3/yt/utilities/parameter_file_storage.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/parameter_file_storage.py 2017-08-10 18:02:57.000000000 +0000 @@ -18,7 +18,8 @@ from itertools import islice from yt.config import ytcfg -from yt.funcs import mylog +from yt.funcs import \ + mylog from yt.utilities.parallel_tools.parallel_analysis_interface import \ parallel_simple_proxy diff -Nru yt-3.3.3/yt/utilities/particle_generator.py yt-3.4.0/yt/utilities/particle_generator.py --- yt-3.3.3/yt/utilities/particle_generator.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/particle_generator.py 2017-08-10 18:02:57.000000000 +0000 @@ -7,28 +7,28 @@ class ParticleGenerator(object): - default_fields = [("io", "particle_position_x"), - ("io", "particle_position_y"), - ("io", "particle_position_z")] - - def __init__(self, ds, num_particles, field_list): + def __init__(self, ds, num_particles, field_list, ptype="io"): """ Base class for generating particle fields which may be applied to streams. Normally this would not be called directly, since it doesn't really do anything except allocate memory. Takes a *ds* to serve as the basis for determining grids, the number of particles *num_particles*, - and a list of fields, *field_list*. + a list of fields, *field_list*, and the particle type *ptype*, which + has a default value of "io". """ self.ds = ds self.num_particles = num_particles - self.field_list = [("io",fd) if isinstance(fd,string_types) else fd + self.field_list = [(ptype, fd) if isinstance(fd, string_types) else fd for fd in field_list] - self.field_list.append(("io", "particle_index")) + self.field_list.append((ptype, "particle_index")) self.field_units = dict( - (('io', 'particle_position_%s' % ax), 'code_length') + ((ptype, 'particle_position_%s' % ax), 'code_length') for ax in 'xyz') - self.field_units['io', 'particle_index'] = '' - + self.field_units[ptype, 'particle_index'] = '' + self.ptype = ptype + + self._set_default_fields() + try: self.posx_index = self.field_list.index(self.default_fields[0]) self.posy_index = self.field_list.index(self.default_fields[1]) @@ -36,35 +36,40 @@ except: raise KeyError("You must specify position fields: " + " ".join(["particle_position_%s" % ax for ax in "xyz"])) - self.index_index = self.field_list.index(("io", "particle_index")) - + self.index_index = self.field_list.index((ptype, "particle_index")) + self.num_grids = self.ds.index.num_grids - self.NumberOfParticles = np.zeros((self.num_grids), dtype='int64') + self.NumberOfParticles = np.zeros(self.num_grids, dtype='int64') self.ParticleGridIndices = np.zeros(self.num_grids + 1, dtype='int64') - + self.num_fields = len(self.field_list) - + self.particles = np.zeros((self.num_particles, self.num_fields), dtype='float64') + def _set_default_fields(self): + self.default_fields = [(self.ptype, "particle_position_x"), + (self.ptype, "particle_position_y"), + (self.ptype, "particle_position_z")] + def has_key(self, key): """ Check to see if *key* is in the particle field list. """ return key in self.field_list - + def keys(self): """ Return the list of particle fields. """ return self.field_list - + def __getitem__(self, key): """ Get the field associated with key. """ return self.particles[:,self.field_list.index(key)] - + def __setitem__(self, key, val): """ Sets a field to be some other value. Note that we assume @@ -72,7 +77,7 @@ make sure the setting of the field is consistent with this. """ self.particles[:,self.field_list.index(key)] = val[:] - + def __len__(self): """ The number of particles @@ -95,17 +100,17 @@ else: tr[field] = self.particles[start:end, fi] return tr - - def _setup_particles(self,x,y,z,setup_fields=None): + + def _setup_particles(self, x, y, z, setup_fields=None): """ Assigns grids to particles and sets up particle positions. *setup_fields* is a dict of fields other than the particle positions to set up. """ - particle_grids, particle_grid_inds = self.ds.index._find_points(x,y,z) + particle_grids, particle_grid_inds = self.ds.index._find_points(x, y, z) idxs = np.argsort(particle_grid_inds) - self.particles[:,self.posx_index] = x[idxs] - self.particles[:,self.posy_index] = y[idxs] - self.particles[:,self.posz_index] = z[idxs] + self.particles[:, self.posx_index] = x[idxs] + self.particles[:, self.posy_index] = y[idxs] + self.particles[:, self.posz_index] = z[idxs] self.NumberOfParticles = np.bincount(particle_grid_inds.astype("intp"), minlength=self.num_grids) if self.num_grids > 1: @@ -115,20 +120,20 @@ self.ParticleGridIndices[1] = self.NumberOfParticles.squeeze() if setup_fields is not None: for key, value in setup_fields.items(): - field = ("io",key) if isinstance(key, string_types) else key + field = (self.ptype, key) if isinstance(key, string_types) else key if field not in self.default_fields: self.particles[:,self.field_list.index(field)] = value[idxs] - + def assign_indices(self, function=None, **kwargs): """ Assign unique indices to the particles. The default is to just use numpy.arange, but any function may be supplied with keyword arguments. """ - if function is None : - self.particles[:,self.index_index] = np.arange((self.num_particles)) - else : - self.particles[:,self.index_index] = function(**kwargs) - + if function is None: + self.particles[:, self.index_index] = np.arange(self.num_particles) + else: + self.particles[:, self.index_index] = function(**kwargs) + def map_grid_fields_to_particles(self, mapping_dict): r""" For the fields in *mapping_dict*, map grid fields to the particles @@ -164,36 +169,28 @@ def apply_to_stream(self, clobber=False): """ - Apply the particles to a stream dataset. If particles already exist, - and clobber=False, do not overwrite them, but add the new ones to them. + Apply the particles to a grid-based stream dataset. If particles + already exist, and clobber=False, do not overwrite them, but add + the new ones to them. """ grid_data = [] - for i,g in enumerate(self.ds.index.grids): + for i, g in enumerate(self.ds.index.grids): data = {} - if clobber : - data["number_of_particles"] = self.NumberOfParticles[i] - else : - data["number_of_particles"] = self.NumberOfParticles[i] + \ - g.NumberOfParticles + number_of_particles = self.NumberOfParticles[i] + if not clobber: + number_of_particles += g.NumberOfParticles grid_particles = self.get_for_grid(g) - for field in self.field_list : - if data["number_of_particles"] > 0: - # We have particles in this grid - if g.NumberOfParticles > 0 and not clobber: - # Particles already exist - if field in self.ds.field_list: - # This field already exists - prev_particles = g[field] - else: - # This one doesn't, set the previous particles' field - # values to zero - prev_particles = np.zeros((g.NumberOfParticles)) - prev_particles = self.ds.arr(prev_particles, - input_units = self.field_units[field]) - data[field] = uconcatenate((prev_particles, - grid_particles[field])) + for field in self.field_list: + if number_of_particles > 0: + if g.NumberOfParticles > 0 and not clobber and \ + field in self.ds.field_list: + # We have particles in this grid, we're not + # overwriting them, and the field is in the field + # list already + data[field] = uconcatenate([g[field], + grid_particles[field]]) else: - # Particles do not already exist or we're clobbering + # Otherwise, simply add the field in data[field] = grid_particles[field] else: # We don't have particles in this grid @@ -203,7 +200,7 @@ class FromListParticleGenerator(ParticleGenerator): - def __init__(self, ds, num_particles, data): + def __init__(self, ds, num_particles, data, ptype="io"): r""" Generate particle fields from array-like lists contained in a dict. @@ -215,6 +212,8 @@ The number of particles in the dict. data : dict of NumPy arrays The particle fields themselves. + ptype : string, optional + The particle type for these particle fields. Default: "io" Examples -------- @@ -233,10 +232,10 @@ x = data.pop("particle_position_x") y = data.pop("particle_position_y") z = data.pop("particle_position_z") - elif ("io","particle_position_x") in data: - x = data.pop(("io", "particle_position_x")) - y = data.pop(("io", "particle_position_y")) - z = data.pop(("io", "particle_position_z")) + elif (ptype,"particle_position_x") in data: + x = data.pop((ptype, "particle_position_x")) + y = data.pop((ptype, "particle_position_y")) + z = data.pop((ptype, "particle_position_z")) xcond = np.logical_or(x < ds.domain_left_edge[0], x >= ds.domain_right_edge[0]) @@ -250,13 +249,14 @@ if np.any(cond): raise ValueError("Some particles are outside of the domain!!!") - ParticleGenerator.__init__(self, ds, num_particles, field_list) - self._setup_particles(x,y,z,setup_fields=data) - + super(FromListParticleGenerator, self).__init__(ds, num_particles, + field_list, ptype=ptype) + self._setup_particles(x, y, z, setup_fields=data) + class LatticeParticleGenerator(ParticleGenerator): def __init__(self, ds, particles_dims, particles_left_edge, - particles_right_edge, field_list): + particles_right_edge, field_list, ptype="io"): r""" Generate particles in a lattice arrangement. @@ -272,7 +272,9 @@ The 'right-most' ending positions of the lattice. field_list : list of strings A list of particle fields - + ptype : string, optional + The particle type for these particle fields. Default: "io" + Examples -------- >>> dims = (128,128,128) @@ -293,33 +295,34 @@ xmax = particles_right_edge[0] ymax = particles_right_edge[1] zmax = particles_right_edge[2] - DLE = ds.domain_left_edge.in_units("code_length").ndarray_view() - DRE = ds.domain_right_edge.in_units("code_length").ndarray_view() + DLE = ds.domain_left_edge.in_units("code_length").d + DRE = ds.domain_right_edge.in_units("code_length").d xcond = (xmin < DLE[0]) or (xmax >= DRE[0]) ycond = (ymin < DLE[1]) or (ymax >= DRE[1]) zcond = (zmin < DLE[2]) or (zmax >= DRE[2]) cond = xcond or ycond or zcond - if cond : + if cond: raise ValueError("Proposed bounds for particles are outside domain!!!") - ParticleGenerator.__init__(self, ds, num_x*num_y*num_z, field_list) + super(LatticeParticleGenerator, self).__init__(ds, num_x*num_y*num_z, + field_list, ptype=ptype) dx = (xmax-xmin)/(num_x-1) dy = (ymax-ymin)/(num_y-1) dz = (zmax-zmin)/(num_z-1) - inds = np.indices((num_x,num_y,num_z)) + inds = np.indices((num_x, num_y, num_z)) xpos = inds[0]*dx + xmin ypos = inds[1]*dy + ymin zpos = inds[2]*dz + zmin - + self._setup_particles(xpos.flat[:], ypos.flat[:], zpos.flat[:]) - + class WithDensityParticleGenerator(ParticleGenerator): def __init__(self, ds, data_source, num_particles, field_list, - density_field="density"): + density_field="density", ptype="io"): r""" Generate particles based on a density field. @@ -336,7 +339,9 @@ density_field : string, optional A density field which will serve as the distribution function for the particle positions. Theoretically, this could be any 'per-volume' field. - + ptype : string, optional + The particle type for these particle fields. Default: "io" + Examples -------- >>> sphere = ds.sphere(ds.domain_center, 0.5) @@ -348,7 +353,8 @@ >>> fields, density_field='Dark_Matter_Density') """ - ParticleGenerator.__init__(self, ds, num_particles, field_list) + super(WithDensityParticleGenerator, self).__init__(ds, num_particles, + field_list, ptype=ptype) num_cells = len(data_source["x"].flat) max_mass = (data_source[density_field]* @@ -357,22 +363,22 @@ all_x = [] all_y = [] all_z = [] - + pbar = get_pbar("Generating Particles", num_particles) tot_num_accepted = int(0) - + while num_particles_left > 0: m = np.random.uniform(high=1.01*max_mass, size=num_particles_left) idxs = np.random.random_integers(low=0, high=num_cells-1, size=num_particles_left) - m_true = (data_source[density_field]* + m_true = (data_source[density_field] * data_source["cell_volume"]).flat[idxs] accept = m <= m_true num_accepted = accept.sum() accepted_idxs = idxs[accept] - + xpos = data_source["x"].flat[accepted_idxs] + \ np.random.uniform(low=-0.5, high=0.5, size=num_accepted) * \ data_source["dx"].flat[accepted_idxs] @@ -397,5 +403,5 @@ y = uconcatenate(all_y) z = uconcatenate(all_z) - self._setup_particles(x,y,z) - + self._setup_particles(x, y, z) + diff -Nru yt-3.3.3/yt/utilities/png_writer.py yt-3.4.0/yt/utilities/png_writer.py --- yt-3.3.3/yt/utilities/png_writer.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/png_writer.py 2017-08-10 18:02:57.000000000 +0000 @@ -10,7 +10,6 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -import matplotlib import matplotlib._png as _png from yt.extern.six import PY2 @@ -18,17 +17,9 @@ from cStringIO import StringIO else: from io import BytesIO as StringIO -from distutils.version import LooseVersion -MPL_VERSION = LooseVersion(matplotlib.__version__) -MPL_API_2_VERSION = LooseVersion("1.5.0") - -if MPL_VERSION < MPL_API_2_VERSION: - def call_png_write_png(buffer, width, height, filename, dpi): - _png.write_png(buffer, width, height, filename, dpi) -else: - def call_png_write_png(buffer, width, height, filename, dpi): - _png.write_png(buffer, filename, dpi) +def call_png_write_png(buffer, width, height, filename, dpi): + _png.write_png(buffer, filename, dpi) def write_png(buffer, filename, dpi=100): width = buffer.shape[1] diff -Nru yt-3.3.3/yt/utilities/sdf.py yt-3.4.0/yt/utilities/sdf.py --- yt-3.3.3/yt/utilities/sdf.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/sdf.py 2017-08-10 18:02:57.000000000 +0000 @@ -431,17 +431,16 @@ Parameters ---------- - filename: string - The filename associated with the data to be loaded. - header: string, optional - If separate from the data file, a file containing the - header can be specified. Default: None. + filename : string + The filename associated with the data to be loaded. + header : string, optional + If separate from the data file, a file containing the + header can be specified. Default: None. Returns ------- self : SDFRead object - Dict-like container of parameters and data. - + Dict-like container of parameters and data. References ---------- @@ -1165,7 +1164,7 @@ """Get floating point bounding box for a given midx cell Returns: - bbox: array-like, shape (3,2) + bbox: array-like of shape (3,2) """ cell_iarr = np.array(cell_iarr, dtype="int64") @@ -1270,11 +1269,15 @@ Return list of data chunks for a cell on the given level plus a padding around the cell, for a list of fields. - Returns: - data: A list of dictionaries of data. - - chunks = midx.get_padded_bbox_data(6, np.array([128]*3), - 8.0, ['x','y','z','ident']) + Returns + ------- + data: list + A list of dictionaries of data. + + Examples + -------- + >>> chunks = midx.get_padded_bbox_data(6, np.array([128]*3), + ... 8.0, ['x','y','z','ident']) """ _ensure_xyz_fields(fields) @@ -1291,7 +1294,7 @@ """ Returns: - bbox: array-like, shape (3,2) + bbox: array-like of shape (3,2) """ bbox = self.get_cell_bbox(level, cell_iarr) diff -Nru yt-3.3.3/yt/utilities/spatial/ckdtree.c yt-3.4.0/yt/utilities/spatial/ckdtree.c --- yt-3.3.3/yt/utilities/spatial/ckdtree.c 2016-12-12 01:42:05.000000000 +0000 +++ yt-3.4.0/yt/utilities/spatial/ckdtree.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,16156 +0,0 @@ -/* Generated by Cython 0.25.2 */ - -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [ - "yt/utilities/lib/platform_dep.h" - ], - "include_dirs": [ - "yt/utilities/lib/" - ], - "libraries": [ - "m" - ] - }, - "module_name": "yt.utilities.spatial.ckdtree" -} -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 < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_25_2" -#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 -#ifndef HAVE_LONG_LONG - #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) - #define HAVE_LONG_LONG - #endif -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#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_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 -#elif defined(PYSTON_VERSION) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_PYSTON 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_PYSTON 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #if PY_VERSION_HEX < 0x02070000 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) - #define CYTHON_USE_PYLONG_INTERNALS 1 - #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 1 - #endif - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #if PY_VERSION_HEX < 0x030300F0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #elif !defined(CYTHON_USE_UNICODE_WRITER) - #define CYTHON_USE_UNICODE_WRITER 1 - #endif - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #ifndef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 1 - #endif - #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 1 - #endif -#endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" - #undef SHIFT - #undef BASE - #undef MASK -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !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 -#ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, - Py_ssize_t nargs, PyObject *kwnames); -#else - #define __Pyx_PyCFunctionFast _PyCFunctionFast -#endif -#if CYTHON_FAST_PYCCALL -#define __Pyx_PyFastCFunction_Check(func)\ - ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))))) -#else -#define __Pyx_PyFastCFunction_Check(func) 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 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 -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#if CYTHON_COMPILING_IN_PYSTON - #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) -#else - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#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 -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#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 - typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; - } __Pyx_PyAsyncMethodsStruct; - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif -#else - #define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #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) - -#ifndef CYTHON_INLINE - #if defined(__clang__) - #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) - #elif defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#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; \ -} - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__yt__utilities__spatial__ckdtree -#define __PYX_HAVE_API__yt__utilities__spatial__ckdtree -#include -#include -#include -#include "numpy/arrayobject.h" -#include "numpy/ufuncobject.h" -#include "platform_dep.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_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) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_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 PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static PyObject *__pyx_empty_unicode; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - -/* Header.proto */ -#if !defined(CYTHON_CCOMPLEX) - #if defined(__cplusplus) - #define CYTHON_CCOMPLEX 1 - #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[] = { - "yt/utilities/spatial/ckdtree.pyx", - "__init__.pxd", - "type.pxd", -}; -/* 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; - - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 - * # in Cython to enable them only on the right systems. - * - * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - */ -typedef npy_int8 __pyx_t_5numpy_int8_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":726 - * - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t - */ -typedef npy_int16 __pyx_t_5numpy_int16_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":727 - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< - * ctypedef npy_int64 int64_t - * #ctypedef npy_int96 int96_t - */ -typedef npy_int32 __pyx_t_5numpy_int32_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":728 - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< - * #ctypedef npy_int96 int96_t - * #ctypedef npy_int128 int128_t - */ -typedef npy_int64 __pyx_t_5numpy_int64_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":732 - * #ctypedef npy_int128 int128_t - * - * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - */ -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":733 - * - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t - */ -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":734 - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< - * ctypedef npy_uint64 uint64_t - * #ctypedef npy_uint96 uint96_t - */ -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":735 - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< - * #ctypedef npy_uint96 uint96_t - * #ctypedef npy_uint128 uint128_t - */ -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":739 - * #ctypedef npy_uint128 uint128_t - * - * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< - * ctypedef npy_float64 float64_t - * #ctypedef npy_float80 float80_t - */ -typedef npy_float32 __pyx_t_5numpy_float32_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":740 - * - * ctypedef npy_float32 float32_t - * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< - * #ctypedef npy_float80 float80_t - * #ctypedef npy_float128 float128_t - */ -typedef npy_float64 __pyx_t_5numpy_float64_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":749 - * # The int types are mapped a bit surprising -- - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t - */ -typedef npy_long __pyx_t_5numpy_int_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":750 - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong longlong_t - * - */ -typedef npy_longlong __pyx_t_5numpy_long_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":751 - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_ulong uint_t - */ -typedef npy_longlong __pyx_t_5numpy_longlong_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":753 - * ctypedef npy_longlong longlong_t - * - * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t - */ -typedef npy_ulong __pyx_t_5numpy_uint_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":754 - * - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulonglong_t - * - */ -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":755 - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_intp intp_t - */ -typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":757 - * ctypedef npy_ulonglong ulonglong_t - * - * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< - * ctypedef npy_uintp uintp_t - * - */ -typedef npy_intp __pyx_t_5numpy_intp_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":758 - * - * ctypedef npy_intp intp_t - * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * - * ctypedef npy_double float_t - */ -typedef npy_uintp __pyx_t_5numpy_uintp_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":760 - * ctypedef npy_uintp uintp_t - * - * ctypedef npy_double float_t # <<<<<<<<<<<<<< - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t - */ -typedef npy_double __pyx_t_5numpy_float_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":761 - * - * ctypedef npy_double float_t - * ctypedef npy_double double_t # <<<<<<<<<<<<<< - * ctypedef npy_longdouble longdouble_t - * - */ -typedef npy_double __pyx_t_5numpy_double_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":762 - * 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_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 - * ctypedef npy_longdouble longdouble_t - * - * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t - */ -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":765 - * - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< - * ctypedef npy_clongdouble clongdouble_t - * - */ -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":766 - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cdouble complex_t - */ -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":768 - * ctypedef npy_clongdouble clongdouble_t - * - * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew1(a): - */ -typedef npy_cdouble __pyx_t_5numpy_complex_t; -union __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapcontents; -struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem; -struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap; -struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode; -struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_leafnode; -struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_nodeinfo; - -/* "yt/utilities/spatial/ckdtree.pyx":19 - * - * # priority queue - * cdef union heapcontents: # <<<<<<<<<<<<<< - * int intdata - * char* ptrdata - */ -union __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapcontents { - int intdata; - char *ptrdata; -}; - -/* "yt/utilities/spatial/ckdtree.pyx":23 - * char* ptrdata - * - * cdef struct heapitem: # <<<<<<<<<<<<<< - * np.float64_t priority - * heapcontents contents - */ -struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem { - __pyx_t_5numpy_float64_t priority; - union __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapcontents contents; -}; - -/* "yt/utilities/spatial/ckdtree.pyx":27 - * heapcontents contents - * - * cdef struct heap: # <<<<<<<<<<<<<< - * int n - * heapitem* heap - */ -struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap { - int n; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem *heap; - int space; -}; - -/* "yt/utilities/spatial/ckdtree.pyx":160 - * - * # Tree structure - * cdef struct innernode: # <<<<<<<<<<<<<< - * int split_dim - * int n_points - */ -struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode { - int split_dim; - int n_points; - __pyx_t_5numpy_float64_t split; - __pyx_t_5numpy_float64_t *maxes; - __pyx_t_5numpy_float64_t *mins; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *less; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *greater; -}; - -/* "yt/utilities/spatial/ckdtree.pyx":168 - * innernode* less - * innernode* greater - * cdef struct leafnode: # <<<<<<<<<<<<<< - * int split_dim - * int n_points - */ -struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_leafnode { - int split_dim; - int n_points; - int start_idx; - int end_idx; - __pyx_t_5numpy_float64_t *maxes; - __pyx_t_5numpy_float64_t *mins; -}; - -/* "yt/utilities/spatial/ckdtree.pyx":178 - * # this is the standard trick for variable-size arrays: - * # malloc sizeof(nodeinfo)+self.m*sizeof(np.float64_t) bytes. - * cdef struct nodeinfo: # <<<<<<<<<<<<<< - * innernode* node - * np.float64_t side_distances[0] - */ -struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_nodeinfo { - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *node; - __pyx_t_5numpy_float64_t side_distances[0]; -}; - -/* "yt/utilities/spatial/ckdtree.pyx":182 - * np.float64_t side_distances[0] - * - * cdef class cKDTree: # <<<<<<<<<<<<<< - * """kd-tree for quick nearest-neighbor lookup - * - */ -struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree { - PyObject_HEAD - struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_vtab; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *tree; - PyObject *data; - __pyx_t_5numpy_float64_t *raw_data; - int n; - int m; - int leafsize; - PyObject *maxes; - __pyx_t_5numpy_float64_t *raw_maxes; - PyObject *mins; - __pyx_t_5numpy_float64_t *raw_mins; - PyObject *indices; - __pyx_t_5numpy_int64_t *raw_indices; -}; - - - -struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree { - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *(*__pyx___build)(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *, int, int, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); - PyObject *(*__pyx___free_tree)(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *, struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *); - void (*__pyx___query)(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_float64_t *, int, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t *); -}; -static struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_vtabptr_2yt_9utilities_7spatial_7ckdtree_cKDTree; - -/* --- 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) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(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 - -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* 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); - -/* 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); - -/* 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 - -/* 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); - -/* RaiseTooManyValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* IterFinish.proto */ -static CYTHON_INLINE int __Pyx_IterFinish(void); - -/* UnpackItemEndCheck.proto */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -/* BufferFormatCheck.proto */ -static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, - __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); // PROTO - -/* BufferFallbackError.proto */ -static void __Pyx_RaiseBufferFallbackError(void); - -/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -/* 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); - -/* BufferIndexError.proto */ -static void __Pyx_RaiseBufferIndexError(int axis); - -#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) -/* PyFloatBinop.proto */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyFloat_DivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace); -#else -#define __Pyx_PyFloat_DivideCObj(op1, op2, floatval, inplace)\ - ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) - #endif - -#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) -/* ArgTypeTest.proto */ -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); - -/* 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)); -} - -/* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) - PyErr_SetObject(PyExc_KeyError, args); - Py_XDECREF(args); - } - return NULL; - } - Py_INCREF(value); - return value; -} -#else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#endif - -/* 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 - -/* 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 - -/* SetVTable.proto */ -static int __Pyx_SetVtable(PyObject *dict, void *vtable); - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* 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); - -/* 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; - -#if PY_MAJOR_VERSION < 3 - static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); - static void __Pyx_ReleaseBuffer(Py_buffer *view); -#else - #define __Pyx_GetBuffer PyObject_GetBuffer - #define __Pyx_ReleaseBuffer PyBuffer_Release -#endif - - -/* None.proto */ -static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; -static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 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_enum__NPY_TYPES(enum NPY_TYPES value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* 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 struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *__pyx_f_2yt_9utilities_7spatial_7ckdtree_7cKDTree___build(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, int __pyx_v_start_idx, int __pyx_v_end_idx, __pyx_t_5numpy_float64_t *__pyx_v_maxes, __pyx_t_5numpy_float64_t *__pyx_v_mins); /* proto*/ -static PyObject *__pyx_f_2yt_9utilities_7spatial_7ckdtree_7cKDTree___free_tree(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *__pyx_v_node); /* proto*/ -static void __pyx_f_2yt_9utilities_7spatial_7ckdtree_7cKDTree___query(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_result_distances, __pyx_t_5numpy_int64_t *__pyx_v_result_indices, __pyx_t_5numpy_float64_t *__pyx_v_x, int __pyx_v_k, __pyx_t_5numpy_float64_t __pyx_v_eps, __pyx_t_5numpy_float64_t __pyx_v_p, __pyx_t_5numpy_float64_t __pyx_v_distance_upper_bound, __pyx_t_5numpy_float64_t *__pyx_v_period); /* proto*/ - -/* 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 'libc.stdlib' */ - -/* Module declarations from 'numpy' */ - -/* Module declarations from 'numpy' */ -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; -static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ - -/* Module declarations from 'cython' */ - -/* Module declarations from 'yt.utilities.spatial.ckdtree' */ -static PyTypeObject *__pyx_ptype_2yt_9utilities_7spatial_7ckdtree_cKDTree = 0; -static __pyx_t_5numpy_float64_t __pyx_v_2yt_9utilities_7spatial_7ckdtree_infinity; -static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_7spatial_7ckdtree_heapcreate(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *, int); /*proto*/ -static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_7spatial_7ckdtree_heapdestroy(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *); /*proto*/ -static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_7spatial_7ckdtree_heapresize(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *, int); /*proto*/ -static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_7spatial_7ckdtree_heappush(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *, struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem); /*proto*/ -static struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_f_2yt_9utilities_7spatial_7ckdtree_heappeek(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *); /*proto*/ -static PyObject *__pyx_f_2yt_9utilities_7spatial_7ckdtree_heapremove(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *); /*proto*/ -static struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_f_2yt_9utilities_7spatial_7ckdtree_heappop(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *); /*proto*/ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_7spatial_7ckdtree_dmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(__pyx_t_5numpy_float64_t); /*proto*/ -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_7spatial_7ckdtree_dmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; -#define __Pyx_MODULE_NAME "yt.utilities.spatial.ckdtree" -int __pyx_module_is_main_yt__utilities__spatial__ckdtree = 0; - -/* Implementation of 'yt.utilities.spatial.ckdtree' */ -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_xrange; -static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_ImportError; -static const char __pyx_k_k[] = "k"; -static const char __pyx_k_p[] = "p"; -static const char __pyx_k_x[] = "x"; -static const char __pyx_k_nn[] = "nn"; -static const char __pyx_k_np[] = "np"; -static const char __pyx_k_pi[] = "pi"; -static const char __pyx_k_add[] = "add"; -static const char __pyx_k_all[] = "__all__"; -static const char __pyx_k_eps[] = "eps"; -static const char __pyx_k_inf[] = "inf"; -static const char __pyx_k_amax[] = "amax"; -static const char __pyx_k_amin[] = "amin"; -static const char __pyx_k_axis[] = "axis"; -static const char __pyx_k_data[] = "data"; -static const char __pyx_k_fill[] = "fill"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_prod[] = "prod"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_array[] = "array"; -static const char __pyx_k_dtype[] = "dtype"; -static const char __pyx_k_empty[] = "empty"; -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_omass[] = "omass"; -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_arange[] = "arange"; -static const char __pyx_k_astype[] = "astype"; -static const char __pyx_k_finish[] = "finish"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_kdtree[] = "kdtree"; -static const char __pyx_k_nMerge[] = "nMerge"; -static const char __pyx_k_period[] = "period"; -static const char __pyx_k_xrange[] = "xrange"; -static const char __pyx_k_asarray[] = "asarray"; -static const char __pyx_k_cKDTree[] = "cKDTree"; -static const char __pyx_k_chainID[] = "chainID"; -static const char __pyx_k_density[] = "density"; -static const char __pyx_k_float64[] = "float64"; -static const char __pyx_k_newaxis[] = "newaxis"; -static const char __pyx_k_reshape[] = "reshape"; -static const char __pyx_k_leafsize[] = "leafsize"; -static const char __pyx_k_chain_map[] = "chain_map"; -static const char __pyx_k_ValueError[] = "ValueError"; -static const char __pyx_k_bis_inside[] = "bis_inside"; -static const char __pyx_k_peakthresh[] = "peakthresh"; -static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; -static const char __pyx_k_ImportError[] = "ImportError"; -static const char __pyx_k_RuntimeError[] = "RuntimeError"; -static const char __pyx_k_saddlethresh[] = "saddlethresh"; -static const char __pyx_k_bsearch_again[] = "bsearch_again"; -static const char __pyx_k_num_neighbors[] = "num_neighbors"; -static const char __pyx_k_densest_in_chain[] = "densest_in_chain"; -static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray"; -static const char __pyx_k_distance_upper_bound[] = "distance_upper_bound"; -static const char __pyx_k_leafsize_must_be_at_least_1[] = "leafsize must be at least 1"; -static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -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"; -static const char __pyx_k_Heap_containing_d_items_cannot_b[] = "Heap containing %d items cannot be resized to %d"; -static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; -static const char __pyx_k_Only_p_norms_with_1_p_infinity_p[] = "Only p-norms with 1<=p<=infinity permitted"; -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_x_must_consist_of_vectors_of_len[] = "x must consist of vectors of length %d but has shape %s"; -static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; -static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; -static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; -static PyObject *__pyx_kp_s_Heap_containing_d_items_cannot_b; -static PyObject *__pyx_n_s_ImportError; -static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; -static PyObject *__pyx_kp_s_Only_p_norms_with_1_p_infinity_p; -static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_n_s_add; -static PyObject *__pyx_n_s_all; -static PyObject *__pyx_n_s_amax; -static PyObject *__pyx_n_s_amin; -static PyObject *__pyx_n_s_arange; -static PyObject *__pyx_n_s_array; -static PyObject *__pyx_n_s_asarray; -static PyObject *__pyx_n_s_ascontiguousarray; -static PyObject *__pyx_n_s_astype; -static PyObject *__pyx_n_s_axis; -static PyObject *__pyx_n_s_bis_inside; -static PyObject *__pyx_n_s_bsearch_again; -static PyObject *__pyx_n_s_cKDTree; -static PyObject *__pyx_n_s_chainID; -static PyObject *__pyx_n_s_chain_map; -static PyObject *__pyx_n_s_data; -static PyObject *__pyx_n_s_densest_in_chain; -static PyObject *__pyx_n_s_density; -static PyObject *__pyx_n_s_distance_upper_bound; -static PyObject *__pyx_n_s_dtype; -static PyObject *__pyx_n_s_empty; -static PyObject *__pyx_n_s_eps; -static PyObject *__pyx_n_s_fill; -static PyObject *__pyx_n_s_finish; -static PyObject *__pyx_n_s_float64; -static PyObject *__pyx_n_s_import; -static PyObject *__pyx_n_s_inf; -static PyObject *__pyx_n_s_int32; -static PyObject *__pyx_n_s_int64; -static PyObject *__pyx_n_s_k; -static PyObject *__pyx_n_s_kdtree; -static PyObject *__pyx_n_s_leafsize; -static PyObject *__pyx_kp_s_leafsize_must_be_at_least_1; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_n_s_nMerge; -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_newaxis; -static PyObject *__pyx_n_s_nn; -static PyObject *__pyx_n_s_np; -static PyObject *__pyx_n_s_num_neighbors; -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_omass; -static PyObject *__pyx_n_s_p; -static PyObject *__pyx_n_s_peakthresh; -static PyObject *__pyx_n_s_period; -static PyObject *__pyx_n_s_pi; -static PyObject *__pyx_n_s_prod; -static PyObject *__pyx_n_s_pyx_vtable; -static PyObject *__pyx_n_s_range; -static PyObject *__pyx_n_s_reshape; -static PyObject *__pyx_n_s_saddlethresh; -static PyObject *__pyx_n_s_shape; -static PyObject *__pyx_n_s_start; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; -static PyObject *__pyx_n_s_x; -static PyObject *__pyx_kp_s_x_must_consist_of_vectors_of_len; -static PyObject *__pyx_n_s_xrange; -static PyObject *__pyx_n_s_zeros; -static int __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree___init__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_v_leafsize); /* proto */ -static void __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_2__dealloc__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4query(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_x, int __pyx_v_k, __pyx_t_5numpy_float64_t __pyx_v_eps, __pyx_t_5numpy_float64_t __pyx_v_p, __pyx_t_5numpy_float64_t __pyx_v_distance_upper_bound, PyObject *__pyx_v_period); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_6chainHOP_get_dens(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_omass, int __pyx_v_num_neighbors, CYTHON_UNUSED int __pyx_v_nMerge); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_8find_chunk_nearest_neighbors(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, int __pyx_v_start, int __pyx_v_finish, int __pyx_v_num_neighbors); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_10chainHOP_preconnect(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, PyArrayObject *__pyx_v_chainID, PyArrayObject *__pyx_v_density, PyArrayObject *__pyx_v_densest_in_chain, PyArrayObject *__pyx_v_bis_inside, PyArrayObject *__pyx_v_bsearch_again, __pyx_t_5numpy_float64_t __pyx_v_peakthresh, __pyx_t_5numpy_float64_t __pyx_v_saddlethresh, int __pyx_v_nn, int __pyx_v_nMerge, PyObject *__pyx_v_chain_map); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4data___get__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1n___get__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1m___get__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_8leafsize___get__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_5maxes___get__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4mins___get__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self); /* proto */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static PyObject *__pyx_tp_new_2yt_9utilities_7spatial_7ckdtree_cKDTree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_float_1_0; -static PyObject *__pyx_int_0; -static PyObject *__pyx_int_neg_1; -static __pyx_t_5numpy_float64_t __pyx_k__2; -static PyObject *__pyx_tuple_; -static PyObject *__pyx_slice__6; -static PyObject *__pyx_slice__7; -static PyObject *__pyx_tuple__3; -static PyObject *__pyx_tuple__4; -static PyObject *__pyx_tuple__5; -static PyObject *__pyx_tuple__8; -static PyObject *__pyx_tuple__9; -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; - -/* "yt/utilities/spatial/ckdtree.pyx":32 - * int space - * - * cdef inline heapcreate(heap* self,int initial_size): # <<<<<<<<<<<<<< - * self.space = initial_size - * self.heap = stdlib.malloc(sizeof(heapitem)*self.space) - */ - -static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_7spatial_7ckdtree_heapcreate(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *__pyx_v_self, int __pyx_v_initial_size) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("heapcreate", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":33 - * - * cdef inline heapcreate(heap* self,int initial_size): - * self.space = initial_size # <<<<<<<<<<<<<< - * self.heap = stdlib.malloc(sizeof(heapitem)*self.space) - * self.n=0 - */ - __pyx_v_self->space = __pyx_v_initial_size; - - /* "yt/utilities/spatial/ckdtree.pyx":34 - * cdef inline heapcreate(heap* self,int initial_size): - * self.space = initial_size - * self.heap = stdlib.malloc(sizeof(heapitem)*self.space) # <<<<<<<<<<<<<< - * self.n=0 - * - */ - __pyx_v_self->heap = ((struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem *)malloc(((sizeof(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem)) * __pyx_v_self->space))); - - /* "yt/utilities/spatial/ckdtree.pyx":35 - * self.space = initial_size - * self.heap = stdlib.malloc(sizeof(heapitem)*self.space) - * self.n=0 # <<<<<<<<<<<<<< - * - * cdef inline heapdestroy(heap* self): - */ - __pyx_v_self->n = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":32 - * int space - * - * cdef inline heapcreate(heap* self,int initial_size): # <<<<<<<<<<<<<< - * self.space = initial_size - * self.heap = stdlib.malloc(sizeof(heapitem)*self.space) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":37 - * self.n=0 - * - * cdef inline heapdestroy(heap* self): # <<<<<<<<<<<<<< - * stdlib.free(self.heap) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_7spatial_7ckdtree_heapdestroy(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("heapdestroy", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":38 - * - * cdef inline heapdestroy(heap* self): - * stdlib.free(self.heap) # <<<<<<<<<<<<<< - * - * cdef inline heapresize(heap* self, int new_space): - */ - free(__pyx_v_self->heap); - - /* "yt/utilities/spatial/ckdtree.pyx":37 - * self.n=0 - * - * cdef inline heapdestroy(heap* self): # <<<<<<<<<<<<<< - * stdlib.free(self.heap) - * - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":40 - * stdlib.free(self.heap) - * - * cdef inline heapresize(heap* self, int new_space): # <<<<<<<<<<<<<< - * if new_spacen) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":42 - * cdef inline heapresize(heap* self, int new_space): - * if new_spacestdlib.realloc(self.heap,new_space*sizeof(heapitem)) - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_new_space); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Heap_containing_d_items_cannot_b, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __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(0, 42, __pyx_L1_error) - - /* "yt/utilities/spatial/ckdtree.pyx":41 - * - * cdef inline heapresize(heap* self, int new_space): - * if new_spacestdlib.realloc(self.heap,new_space*sizeof(heapitem)) - * - */ - __pyx_v_self->space = __pyx_v_new_space; - - /* "yt/utilities/spatial/ckdtree.pyx":44 - * raise ValueError("Heap containing %d items cannot be resized to %d" % (self.n, new_space)) - * self.space = new_space - * self.heap = stdlib.realloc(self.heap,new_space*sizeof(heapitem)) # <<<<<<<<<<<<<< - * - * cdef inline heappush(heap* self, heapitem item): - */ - __pyx_v_self->heap = ((struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem *)realloc(((void *)__pyx_v_self->heap), (__pyx_v_new_space * (sizeof(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem))))); - - /* "yt/utilities/spatial/ckdtree.pyx":40 - * stdlib.free(self.heap) - * - * cdef inline heapresize(heap* self, int new_space): # <<<<<<<<<<<<<< - * if new_spacestdlib.realloc(self.heap,new_space*sizeof(heapitem)) - * - * cdef inline heappush(heap* self, heapitem item): # <<<<<<<<<<<<<< - * cdef int i - * cdef heapitem t - */ - -static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_7spatial_7ckdtree_heappush(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *__pyx_v_self, struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_v_item) { - int __pyx_v_i; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_v_t; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __Pyx_RefNannySetupContext("heappush", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":50 - * cdef heapitem t - * - * self.n += 1 # <<<<<<<<<<<<<< - * if self.n>self.space: - * heapresize(self,2*self.space+1) - */ - __pyx_v_self->n = (__pyx_v_self->n + 1); - - /* "yt/utilities/spatial/ckdtree.pyx":51 - * - * self.n += 1 - * if self.n>self.space: # <<<<<<<<<<<<<< - * heapresize(self,2*self.space+1) - * - */ - __pyx_t_1 = ((__pyx_v_self->n > __pyx_v_self->space) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":52 - * self.n += 1 - * if self.n>self.space: - * heapresize(self,2*self.space+1) # <<<<<<<<<<<<<< - * - * i = self.n-1 - */ - __pyx_t_2 = __pyx_f_2yt_9utilities_7spatial_7ckdtree_heapresize(__pyx_v_self, ((2 * __pyx_v_self->space) + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":51 - * - * self.n += 1 - * if self.n>self.space: # <<<<<<<<<<<<<< - * heapresize(self,2*self.space+1) - * - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":54 - * heapresize(self,2*self.space+1) - * - * i = self.n-1 # <<<<<<<<<<<<<< - * self.heap[i] = item - * while i>0 and self.heap[i].priorityn - 1); - - /* "yt/utilities/spatial/ckdtree.pyx":55 - * - * i = self.n-1 - * self.heap[i] = item # <<<<<<<<<<<<<< - * while i>0 and self.heap[i].priorityheap[__pyx_v_i]) = __pyx_v_item; - - /* "yt/utilities/spatial/ckdtree.pyx":56 - * i = self.n-1 - * self.heap[i] = item - * while i>0 and self.heap[i].priority 0) != 0); - if (__pyx_t_3) { - } else { - __pyx_t_1 = __pyx_t_3; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_3 = (((__pyx_v_self->heap[__pyx_v_i]).priority < (__pyx_v_self->heap[__Pyx_div_long((__pyx_v_i - 1), 2)]).priority) != 0); - __pyx_t_1 = __pyx_t_3; - __pyx_L6_bool_binop_done:; - if (!__pyx_t_1) break; - - /* "yt/utilities/spatial/ckdtree.pyx":57 - * self.heap[i] = item - * while i>0 and self.heap[i].priorityheap[__Pyx_div_long((__pyx_v_i - 1), 2)]); - - /* "yt/utilities/spatial/ckdtree.pyx":58 - * while i>0 and self.heap[i].priorityheap[__Pyx_div_long((__pyx_v_i - 1), 2)]) = (__pyx_v_self->heap[__pyx_v_i]); - - /* "yt/utilities/spatial/ckdtree.pyx":59 - * t = self.heap[(i-1)//2] - * self.heap[(i-1)//2] = self.heap[i] - * self.heap[i] = t # <<<<<<<<<<<<<< - * i = (i-1)//2 - * - */ - (__pyx_v_self->heap[__pyx_v_i]) = __pyx_v_t; - - /* "yt/utilities/spatial/ckdtree.pyx":60 - * self.heap[(i-1)//2] = self.heap[i] - * self.heap[i] = t - * i = (i-1)//2 # <<<<<<<<<<<<<< - * - * cdef heapitem heappeek(heap* self): - */ - __pyx_v_i = __Pyx_div_long((__pyx_v_i - 1), 2); - } - - /* "yt/utilities/spatial/ckdtree.pyx":46 - * self.heap = stdlib.realloc(self.heap,new_space*sizeof(heapitem)) - * - * cdef inline heappush(heap* self, heapitem item): # <<<<<<<<<<<<<< - * cdef int i - * cdef heapitem t - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.heappush", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":62 - * i = (i-1)//2 - * - * cdef heapitem heappeek(heap* self): # <<<<<<<<<<<<<< - * return self.heap[0] - * - */ - -static struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_f_2yt_9utilities_7spatial_7ckdtree_heappeek(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *__pyx_v_self) { - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("heappeek", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":63 - * - * cdef heapitem heappeek(heap* self): - * return self.heap[0] # <<<<<<<<<<<<<< - * - * cdef heapremove(heap* self): - */ - __pyx_r = (__pyx_v_self->heap[0]); - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":62 - * i = (i-1)//2 - * - * cdef heapitem heappeek(heap* self): # <<<<<<<<<<<<<< - * return self.heap[0] - * - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":65 - * return self.heap[0] - * - * cdef heapremove(heap* self): # <<<<<<<<<<<<<< - * cdef heapitem t - * cdef int i, j, k, l - */ - -static PyObject *__pyx_f_2yt_9utilities_7spatial_7ckdtree_heapremove(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *__pyx_v_self) { - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_v_t; - int __pyx_v_i; - int __pyx_v_j; - int __pyx_v_k; - int __pyx_v_l; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("heapremove", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":69 - * cdef int i, j, k, l - * - * self.heap[0] = self.heap[self.n-1] # <<<<<<<<<<<<<< - * self.n -= 1 - * if self.n < self.space//4 and self.space>40: #FIXME: magic number - */ - (__pyx_v_self->heap[0]) = (__pyx_v_self->heap[(__pyx_v_self->n - 1)]); - - /* "yt/utilities/spatial/ckdtree.pyx":70 - * - * self.heap[0] = self.heap[self.n-1] - * self.n -= 1 # <<<<<<<<<<<<<< - * if self.n < self.space//4 and self.space>40: #FIXME: magic number - * heapresize(self,self.space//2+1) - */ - __pyx_v_self->n = (__pyx_v_self->n - 1); - - /* "yt/utilities/spatial/ckdtree.pyx":71 - * self.heap[0] = self.heap[self.n-1] - * self.n -= 1 - * if self.n < self.space//4 and self.space>40: #FIXME: magic number # <<<<<<<<<<<<<< - * heapresize(self,self.space//2+1) - * - */ - __pyx_t_2 = ((__pyx_v_self->n < __Pyx_div_long(__pyx_v_self->space, 4)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = ((__pyx_v_self->space > 40) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":72 - * self.n -= 1 - * if self.n < self.space//4 and self.space>40: #FIXME: magic number - * heapresize(self,self.space//2+1) # <<<<<<<<<<<<<< - * - * i=0 - */ - __pyx_t_3 = __pyx_f_2yt_9utilities_7spatial_7ckdtree_heapresize(__pyx_v_self, (__Pyx_div_long(__pyx_v_self->space, 2) + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":71 - * self.heap[0] = self.heap[self.n-1] - * self.n -= 1 - * if self.n < self.space//4 and self.space>40: #FIXME: magic number # <<<<<<<<<<<<<< - * heapresize(self,self.space//2+1) - * - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":74 - * heapresize(self,self.space//2+1) - * - * i=0 # <<<<<<<<<<<<<< - * j=1 - * k=2 - */ - __pyx_v_i = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":75 - * - * i=0 - * j=1 # <<<<<<<<<<<<<< - * k=2 - * while ((j self.heap[j].priority or - */ - __pyx_v_k = 2; - - /* "yt/utilities/spatial/ckdtree.pyx":77 - * j=1 - * k=2 - * while ((j self.heap[j].priority or - * k self.heap[j].priority or # <<<<<<<<<<<<<< - * k self.heap[k].priority)): - */ - __pyx_t_2 = ((__pyx_v_j < __pyx_v_self->n) != 0); - if (!__pyx_t_2) { - goto __pyx_L9_next_or; - } else { - } - __pyx_t_2 = (((__pyx_v_self->heap[__pyx_v_i]).priority > (__pyx_v_self->heap[__pyx_v_j]).priority) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L8_bool_binop_done; - } - __pyx_L9_next_or:; - - /* "yt/utilities/spatial/ckdtree.pyx":79 - * while ((j self.heap[j].priority or - * k self.heap[k].priority)): - * if kself.heap[k].priority: - */ - __pyx_t_2 = ((__pyx_v_k < __pyx_v_self->n) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L8_bool_binop_done; - } - - /* "yt/utilities/spatial/ckdtree.pyx":80 - * self.heap[i].priority > self.heap[j].priority or - * k self.heap[k].priority)): # <<<<<<<<<<<<<< - * if kself.heap[k].priority: - * l = k - */ - __pyx_t_2 = (((__pyx_v_self->heap[__pyx_v_i]).priority > (__pyx_v_self->heap[__pyx_v_k]).priority) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L8_bool_binop_done:; - if (!__pyx_t_1) break; - - /* "yt/utilities/spatial/ckdtree.pyx":81 - * k self.heap[k].priority)): - * if kself.heap[k].priority: # <<<<<<<<<<<<<< - * l = k - * else: - */ - __pyx_t_2 = ((__pyx_v_k < __pyx_v_self->n) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L13_bool_binop_done; - } - __pyx_t_2 = (((__pyx_v_self->heap[__pyx_v_j]).priority > (__pyx_v_self->heap[__pyx_v_k]).priority) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L13_bool_binop_done:; - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":82 - * self.heap[i].priority > self.heap[k].priority)): - * if kself.heap[k].priority: - * l = k # <<<<<<<<<<<<<< - * else: - * l = j - */ - __pyx_v_l = __pyx_v_k; - - /* "yt/utilities/spatial/ckdtree.pyx":81 - * k self.heap[k].priority)): - * if kself.heap[k].priority: # <<<<<<<<<<<<<< - * l = k - * else: - */ - goto __pyx_L12; - } - - /* "yt/utilities/spatial/ckdtree.pyx":84 - * l = k - * else: - * l = j # <<<<<<<<<<<<<< - * t = self.heap[l] - * self.heap[l] = self.heap[i] - */ - /*else*/ { - __pyx_v_l = __pyx_v_j; - } - __pyx_L12:; - - /* "yt/utilities/spatial/ckdtree.pyx":85 - * else: - * l = j - * t = self.heap[l] # <<<<<<<<<<<<<< - * self.heap[l] = self.heap[i] - * self.heap[i] = t - */ - __pyx_v_t = (__pyx_v_self->heap[__pyx_v_l]); - - /* "yt/utilities/spatial/ckdtree.pyx":86 - * l = j - * t = self.heap[l] - * self.heap[l] = self.heap[i] # <<<<<<<<<<<<<< - * self.heap[i] = t - * i = l - */ - (__pyx_v_self->heap[__pyx_v_l]) = (__pyx_v_self->heap[__pyx_v_i]); - - /* "yt/utilities/spatial/ckdtree.pyx":87 - * t = self.heap[l] - * self.heap[l] = self.heap[i] - * self.heap[i] = t # <<<<<<<<<<<<<< - * i = l - * j = 2*i+1 - */ - (__pyx_v_self->heap[__pyx_v_i]) = __pyx_v_t; - - /* "yt/utilities/spatial/ckdtree.pyx":88 - * self.heap[l] = self.heap[i] - * self.heap[i] = t - * i = l # <<<<<<<<<<<<<< - * j = 2*i+1 - * k = 2*i+2 - */ - __pyx_v_i = __pyx_v_l; - - /* "yt/utilities/spatial/ckdtree.pyx":89 - * self.heap[i] = t - * i = l - * j = 2*i+1 # <<<<<<<<<<<<<< - * k = 2*i+2 - * - */ - __pyx_v_j = ((2 * __pyx_v_i) + 1); - - /* "yt/utilities/spatial/ckdtree.pyx":90 - * i = l - * j = 2*i+1 - * k = 2*i+2 # <<<<<<<<<<<<<< - * - * cdef heapitem heappop(heap* self): - */ - __pyx_v_k = ((2 * __pyx_v_i) + 2); - } - - /* "yt/utilities/spatial/ckdtree.pyx":65 - * return self.heap[0] - * - * cdef heapremove(heap* self): # <<<<<<<<<<<<<< - * cdef heapitem t - * cdef int i, j, k, l - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.heapremove", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":92 - * k = 2*i+2 - * - * cdef heapitem heappop(heap* self): # <<<<<<<<<<<<<< - * cdef heapitem it - * it = heappeek(self) - */ - -static struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_f_2yt_9utilities_7spatial_7ckdtree_heappop(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap *__pyx_v_self) { - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_v_it; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("heappop", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":94 - * cdef heapitem heappop(heap* self): - * cdef heapitem it - * it = heappeek(self) # <<<<<<<<<<<<<< - * heapremove(self) - * return it - */ - __pyx_v_it = __pyx_f_2yt_9utilities_7spatial_7ckdtree_heappeek(__pyx_v_self); - - /* "yt/utilities/spatial/ckdtree.pyx":95 - * cdef heapitem it - * it = heappeek(self) - * heapremove(self) # <<<<<<<<<<<<<< - * return it - * - */ - __pyx_t_1 = __pyx_f_2yt_9utilities_7spatial_7ckdtree_heapremove(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":96 - * it = heappeek(self) - * heapremove(self) - * return it # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_it; - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":92 - * k = 2*i+2 - * - * cdef heapitem heappop(heap* self): # <<<<<<<<<<<<<< - * cdef heapitem it - * it = heappeek(self) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_WriteUnraisable("yt.utilities.spatial.ckdtree.heappop", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":103 - * - * # utility functions - * cdef inline np.float64_t dmax(np.float64_t x, np.float64_t y): # <<<<<<<<<<<<<< - * if x>y: - * return x - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_7spatial_7ckdtree_dmax(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y) { - __pyx_t_5numpy_float64_t __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("dmax", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":104 - * # utility functions - * cdef inline np.float64_t dmax(np.float64_t x, np.float64_t y): - * if x>y: # <<<<<<<<<<<<<< - * return x - * else: - */ - __pyx_t_1 = ((__pyx_v_x > __pyx_v_y) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":105 - * cdef inline np.float64_t dmax(np.float64_t x, np.float64_t y): - * if x>y: - * return x # <<<<<<<<<<<<<< - * else: - * return y - */ - __pyx_r = __pyx_v_x; - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":104 - * # utility functions - * cdef inline np.float64_t dmax(np.float64_t x, np.float64_t y): - * if x>y: # <<<<<<<<<<<<<< - * return x - * else: - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":107 - * return x - * else: - * return y # <<<<<<<<<<<<<< - * cdef inline np.float64_t dabs(np.float64_t x): - * if x>0: - */ - /*else*/ { - __pyx_r = __pyx_v_y; - goto __pyx_L0; - } - - /* "yt/utilities/spatial/ckdtree.pyx":103 - * - * # utility functions - * cdef inline np.float64_t dmax(np.float64_t x, np.float64_t y): # <<<<<<<<<<<<<< - * if x>y: - * return x - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":108 - * else: - * return y - * cdef inline np.float64_t dabs(np.float64_t x): # <<<<<<<<<<<<<< - * if x>0: - * return x - */ - -static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(__pyx_t_5numpy_float64_t __pyx_v_x) { - __pyx_t_5numpy_float64_t __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("dabs", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":109 - * return y - * cdef inline np.float64_t dabs(np.float64_t x): - * if x>0: # <<<<<<<<<<<<<< - * return x - * else: - */ - __pyx_t_1 = ((__pyx_v_x > 0.0) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":110 - * cdef inline np.float64_t dabs(np.float64_t x): - * if x>0: - * return x # <<<<<<<<<<<<<< - * else: - * return -x - */ - __pyx_r = __pyx_v_x; - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":109 - * return y - * cdef inline np.float64_t dabs(np.float64_t x): - * if x>0: # <<<<<<<<<<<<<< - * return x - * else: - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":112 - * return x - * else: - * return -x # <<<<<<<<<<<<<< - * cdef inline np.float64_t dmin(np.float64_t x, np.float64_t y): - * if x0: - * return x - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":113 - * else: - * return -x - * cdef inline np.float64_t dmin(np.float64_t x, np.float64_t y): # <<<<<<<<<<<<<< - * if xupperbound: - */ - __pyx_v_m = __pyx_f_2yt_9utilities_7spatial_7ckdtree_dmin(__pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(((__pyx_v_x[__pyx_v_i]) - (__pyx_v_y[__pyx_v_i]))), ((__pyx_v_period[__pyx_v_i]) - __pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(((__pyx_v_x[__pyx_v_i]) - (__pyx_v_y[__pyx_v_i]))))); - - /* "yt/utilities/spatial/ckdtree.pyx":134 - * for i in range(k): - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r = dmax(r,m) # <<<<<<<<<<<<<< - * if r>upperbound: - * return r - */ - __pyx_v_r = __pyx_f_2yt_9utilities_7spatial_7ckdtree_dmax(__pyx_v_r, __pyx_v_m); - - /* "yt/utilities/spatial/ckdtree.pyx":135 - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r = dmax(r,m) - * if r>upperbound: # <<<<<<<<<<<<<< - * return r - * elif p==1: - */ - __pyx_t_1 = ((__pyx_v_r > __pyx_v_upperbound) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":136 - * r = dmax(r,m) - * if r>upperbound: - * return r # <<<<<<<<<<<<<< - * elif p==1: - * for i in range(k): - */ - __pyx_r = __pyx_v_r; - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":135 - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r = dmax(r,m) - * if r>upperbound: # <<<<<<<<<<<<<< - * return r - * elif p==1: - */ - } - } - - /* "yt/utilities/spatial/ckdtree.pyx":131 - * cdef np.float64_t r, m - * r = 0 - * if p==infinity: # <<<<<<<<<<<<<< - * for i in range(k): - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - */ - goto __pyx_L3; - } - - /* "yt/utilities/spatial/ckdtree.pyx":137 - * if r>upperbound: - * return r - * elif p==1: # <<<<<<<<<<<<<< - * for i in range(k): - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - */ - __pyx_t_1 = ((__pyx_v_p == 1.0) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":138 - * return r - * elif p==1: - * for i in range(k): # <<<<<<<<<<<<<< - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r += m - */ - __pyx_t_2 = __pyx_v_k; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - - /* "yt/utilities/spatial/ckdtree.pyx":139 - * elif p==1: - * for i in range(k): - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) # <<<<<<<<<<<<<< - * r += m - * if r>upperbound: - */ - __pyx_v_m = __pyx_f_2yt_9utilities_7spatial_7ckdtree_dmin(__pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(((__pyx_v_x[__pyx_v_i]) - (__pyx_v_y[__pyx_v_i]))), ((__pyx_v_period[__pyx_v_i]) - __pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(((__pyx_v_x[__pyx_v_i]) - (__pyx_v_y[__pyx_v_i]))))); - - /* "yt/utilities/spatial/ckdtree.pyx":140 - * for i in range(k): - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r += m # <<<<<<<<<<<<<< - * if r>upperbound: - * return r - */ - __pyx_v_r = (__pyx_v_r + __pyx_v_m); - - /* "yt/utilities/spatial/ckdtree.pyx":141 - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r += m - * if r>upperbound: # <<<<<<<<<<<<<< - * return r - * elif p==2: - */ - __pyx_t_1 = ((__pyx_v_r > __pyx_v_upperbound) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":142 - * r += m - * if r>upperbound: - * return r # <<<<<<<<<<<<<< - * elif p==2: - * for i in range(k): - */ - __pyx_r = __pyx_v_r; - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":141 - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r += m - * if r>upperbound: # <<<<<<<<<<<<<< - * return r - * elif p==2: - */ - } - } - - /* "yt/utilities/spatial/ckdtree.pyx":137 - * if r>upperbound: - * return r - * elif p==1: # <<<<<<<<<<<<<< - * for i in range(k): - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - */ - goto __pyx_L3; - } - - /* "yt/utilities/spatial/ckdtree.pyx":143 - * if r>upperbound: - * return r - * elif p==2: # <<<<<<<<<<<<<< - * for i in range(k): - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - */ - __pyx_t_1 = ((__pyx_v_p == 2.0) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":144 - * return r - * elif p==2: - * for i in range(k): # <<<<<<<<<<<<<< - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r += m*m - */ - __pyx_t_2 = __pyx_v_k; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - - /* "yt/utilities/spatial/ckdtree.pyx":145 - * elif p==2: - * for i in range(k): - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) # <<<<<<<<<<<<<< - * r += m*m - * if r>upperbound: - */ - __pyx_v_m = __pyx_f_2yt_9utilities_7spatial_7ckdtree_dmin(__pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(((__pyx_v_x[__pyx_v_i]) - (__pyx_v_y[__pyx_v_i]))), ((__pyx_v_period[__pyx_v_i]) - __pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(((__pyx_v_x[__pyx_v_i]) - (__pyx_v_y[__pyx_v_i]))))); - - /* "yt/utilities/spatial/ckdtree.pyx":146 - * for i in range(k): - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r += m*m # <<<<<<<<<<<<<< - * if r>upperbound: - * return r - */ - __pyx_v_r = (__pyx_v_r + (__pyx_v_m * __pyx_v_m)); - - /* "yt/utilities/spatial/ckdtree.pyx":147 - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r += m*m - * if r>upperbound: # <<<<<<<<<<<<<< - * return r - * else: - */ - __pyx_t_1 = ((__pyx_v_r > __pyx_v_upperbound) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":148 - * r += m*m - * if r>upperbound: - * return r # <<<<<<<<<<<<<< - * else: - * for i in range(k): - */ - __pyx_r = __pyx_v_r; - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":147 - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r += m*m - * if r>upperbound: # <<<<<<<<<<<<<< - * return r - * else: - */ - } - } - - /* "yt/utilities/spatial/ckdtree.pyx":143 - * if r>upperbound: - * return r - * elif p==2: # <<<<<<<<<<<<<< - * for i in range(k): - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - */ - goto __pyx_L3; - } - - /* "yt/utilities/spatial/ckdtree.pyx":150 - * return r - * else: - * for i in range(k): # <<<<<<<<<<<<<< - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r += m**p - */ - /*else*/ { - __pyx_t_2 = __pyx_v_k; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - - /* "yt/utilities/spatial/ckdtree.pyx":151 - * else: - * for i in range(k): - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) # <<<<<<<<<<<<<< - * r += m**p - * if r>upperbound: - */ - __pyx_v_m = __pyx_f_2yt_9utilities_7spatial_7ckdtree_dmin(__pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(((__pyx_v_x[__pyx_v_i]) - (__pyx_v_y[__pyx_v_i]))), ((__pyx_v_period[__pyx_v_i]) - __pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(((__pyx_v_x[__pyx_v_i]) - (__pyx_v_y[__pyx_v_i]))))); - - /* "yt/utilities/spatial/ckdtree.pyx":152 - * for i in range(k): - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r += m**p # <<<<<<<<<<<<<< - * if r>upperbound: - * return r - */ - __pyx_v_r = (__pyx_v_r + pow(__pyx_v_m, __pyx_v_p)); - - /* "yt/utilities/spatial/ckdtree.pyx":153 - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r += m**p - * if r>upperbound: # <<<<<<<<<<<<<< - * return r - * return r - */ - __pyx_t_1 = ((__pyx_v_r > __pyx_v_upperbound) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":154 - * r += m**p - * if r>upperbound: - * return r # <<<<<<<<<<<<<< - * return r - * - */ - __pyx_r = __pyx_v_r; - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":153 - * m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - * r += m**p - * if r>upperbound: # <<<<<<<<<<<<<< - * return r - * return r - */ - } - } - } - __pyx_L3:; - - /* "yt/utilities/spatial/ckdtree.pyx":155 - * if r>upperbound: - * return r - * return r # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_r; - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":118 - * else: - * return y - * cdef inline np.float64_t _distance_p(np.float64_t*x,np.float64_t*y,np.float64_t p,int k,np.float64_t upperbound, # <<<<<<<<<<<<<< - * np.float64_t*period): - * """Compute the distance between x and y - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":232 - * cdef object indices - * cdef np.int64_t* raw_indices - * def __init__(cKDTree self, data, int leafsize=10): # <<<<<<<<<<<<<< - * cdef np.ndarray[np.float64_t, ndim=2] inner_data - * cdef np.ndarray[np.float64_t, ndim=1] inner_maxes - */ - -/* Python wrapper */ -static int __pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_data = 0; - int __pyx_v_leafsize; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_leafsize,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_leafsize); - if (value) { values[1] = 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, 232, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_data = values[0]; - if (values[1]) { - __pyx_v_leafsize = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_leafsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L3_error) - } else { - __pyx_v_leafsize = ((int)10); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 232, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.cKDTree.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree___init__(((struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self), __pyx_v_data, __pyx_v_leafsize); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree___init__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_v_leafsize) { - PyArrayObject *__pyx_v_inner_data = 0; - PyArrayObject *__pyx_v_inner_maxes = 0; - PyArrayObject *__pyx_v_inner_mins = 0; - PyArrayObject *__pyx_v_inner_indices = 0; - __Pyx_LocalBuf_ND __pyx_pybuffernd_inner_data; - __Pyx_Buffer __pyx_pybuffer_inner_data; - __Pyx_LocalBuf_ND __pyx_pybuffernd_inner_indices; - __Pyx_Buffer __pyx_pybuffer_inner_indices; - __Pyx_LocalBuf_ND __pyx_pybuffernd_inner_maxes; - __Pyx_Buffer __pyx_pybuffer_inner_maxes; - __Pyx_LocalBuf_ND __pyx_pybuffernd_inner_mins; - __Pyx_Buffer __pyx_pybuffer_inner_mins; - 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)(PyObject *); - int __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; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - __Pyx_RefNannySetupContext("__init__", 0); - __pyx_pybuffer_inner_data.pybuffer.buf = NULL; - __pyx_pybuffer_inner_data.refcount = 0; - __pyx_pybuffernd_inner_data.data = NULL; - __pyx_pybuffernd_inner_data.rcbuffer = &__pyx_pybuffer_inner_data; - __pyx_pybuffer_inner_maxes.pybuffer.buf = NULL; - __pyx_pybuffer_inner_maxes.refcount = 0; - __pyx_pybuffernd_inner_maxes.data = NULL; - __pyx_pybuffernd_inner_maxes.rcbuffer = &__pyx_pybuffer_inner_maxes; - __pyx_pybuffer_inner_mins.pybuffer.buf = NULL; - __pyx_pybuffer_inner_mins.refcount = 0; - __pyx_pybuffernd_inner_mins.data = NULL; - __pyx_pybuffernd_inner_mins.rcbuffer = &__pyx_pybuffer_inner_mins; - __pyx_pybuffer_inner_indices.pybuffer.buf = NULL; - __pyx_pybuffer_inner_indices.refcount = 0; - __pyx_pybuffernd_inner_indices.data = NULL; - __pyx_pybuffernd_inner_indices.rcbuffer = &__pyx_pybuffer_inner_indices; - - /* "yt/utilities/spatial/ckdtree.pyx":237 - * cdef np.ndarray[np.float64_t, ndim=1] inner_mins - * cdef np.ndarray[np.int64_t, ndim=1] inner_indices - * self.data = np.ascontiguousarray(data,dtype="float64") # <<<<<<<<<<<<<< - * self.n, self.m = np.shape(self.data) - * self.leafsize = leafsize - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __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, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_data); - __Pyx_GIVEREF(__pyx_v_data); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 237, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_v_self->data); - __Pyx_DECREF(__pyx_v_self->data); - __pyx_v_self->data = __pyx_t_4; - __pyx_t_4 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":238 - * cdef np.ndarray[np.int64_t, ndim=1] inner_indices - * self.data = np.ascontiguousarray(data,dtype="float64") - * self.n, self.m = np.shape(self.data) # <<<<<<<<<<<<<< - * self.leafsize = leafsize - * if self.leafsize<1: - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_3) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_self->data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->data}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->data}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else - #endif - { - __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_v_self->data); - __Pyx_GIVEREF(__pyx_v_self->data); - PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_self->data); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __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(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 238, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_1 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; - index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_3), 2) < 0) __PYX_ERR(0, 238, __pyx_L1_error) - __pyx_t_5 = NULL; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L4_unpacking_done; - __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 238, __pyx_L1_error) - __pyx_L4_unpacking_done:; - } - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_self->n = __pyx_t_6; - __pyx_v_self->m = __pyx_t_7; - - /* "yt/utilities/spatial/ckdtree.pyx":239 - * self.data = np.ascontiguousarray(data,dtype="float64") - * self.n, self.m = np.shape(self.data) - * self.leafsize = leafsize # <<<<<<<<<<<<<< - * if self.leafsize<1: - * raise ValueError("leafsize must be at least 1") - */ - __pyx_v_self->leafsize = __pyx_v_leafsize; - - /* "yt/utilities/spatial/ckdtree.pyx":240 - * self.n, self.m = np.shape(self.data) - * self.leafsize = leafsize - * if self.leafsize<1: # <<<<<<<<<<<<<< - * raise ValueError("leafsize must be at least 1") - * self.maxes = np.ascontiguousarray(np.amax(self.data,axis=0)) - */ - __pyx_t_8 = ((__pyx_v_self->leafsize < 1) != 0); - if (__pyx_t_8) { - - /* "yt/utilities/spatial/ckdtree.pyx":241 - * self.leafsize = leafsize - * if self.leafsize<1: - * raise ValueError("leafsize must be at least 1") # <<<<<<<<<<<<<< - * self.maxes = np.ascontiguousarray(np.amax(self.data,axis=0)) - * self.mins = np.ascontiguousarray(np.amin(self.data,axis=0)) - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __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, 241, __pyx_L1_error) - - /* "yt/utilities/spatial/ckdtree.pyx":240 - * self.n, self.m = np.shape(self.data) - * self.leafsize = leafsize - * if self.leafsize<1: # <<<<<<<<<<<<<< - * raise ValueError("leafsize must be at least 1") - * self.maxes = np.ascontiguousarray(np.amax(self.data,axis=0)) - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":242 - * if self.leafsize<1: - * raise ValueError("leafsize must be at least 1") - * self.maxes = np.ascontiguousarray(np.amax(self.data,axis=0)) # <<<<<<<<<<<<<< - * self.mins = np.ascontiguousarray(np.amin(self.data,axis=0)) - * self.indices = np.ascontiguousarray(np.arange(self.n,dtype=np.int64)) - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __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_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_amax); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __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, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_self->data); - __Pyx_GIVEREF(__pyx_v_self->data); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->data); - __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 242, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_9) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_10}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_10}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } else - #endif - { - __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_v_self->maxes); - __Pyx_DECREF(__pyx_v_self->maxes); - __pyx_v_self->maxes = __pyx_t_4; - __pyx_t_4 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":243 - * raise ValueError("leafsize must be at least 1") - * self.maxes = np.ascontiguousarray(np.amax(self.data,axis=0)) - * self.mins = np.ascontiguousarray(np.amin(self.data,axis=0)) # <<<<<<<<<<<<<< - * self.indices = np.ascontiguousarray(np.arange(self.n,dtype=np.int64)) - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_amin); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_self->data); - __Pyx_GIVEREF(__pyx_v_self->data); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->data); - __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_9) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - { - __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __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_GIVEREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_v_self->mins); - __Pyx_DECREF(__pyx_v_self->mins); - __pyx_v_self->mins = __pyx_t_4; - __pyx_t_4 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":244 - * self.maxes = np.ascontiguousarray(np.amax(self.data,axis=0)) - * self.mins = np.ascontiguousarray(np.amin(self.data,axis=0)) - * self.indices = np.ascontiguousarray(np.arange(self.n,dtype=np.int64)) # <<<<<<<<<<<<<< - * - * inner_data = self.data - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __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_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_2) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_11}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_11}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } else - #endif - { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL; - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_v_self->indices); - __Pyx_DECREF(__pyx_v_self->indices); - __pyx_v_self->indices = __pyx_t_4; - __pyx_t_4 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":246 - * self.indices = np.ascontiguousarray(np.arange(self.n,dtype=np.int64)) - * - * inner_data = self.data # <<<<<<<<<<<<<< - * self.raw_data = inner_data.data - * inner_maxes = self.maxes - */ - if (!(likely(((__pyx_v_self->data) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->data, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 246, __pyx_L1_error) - __pyx_t_4 = __pyx_v_self->data; - __Pyx_INCREF(__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inner_data.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inner_data.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inner_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_inner_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); - } - } - __pyx_pybuffernd_inner_data.diminfo[0].strides = __pyx_pybuffernd_inner_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inner_data.diminfo[0].shape = __pyx_pybuffernd_inner_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_inner_data.diminfo[1].strides = __pyx_pybuffernd_inner_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_inner_data.diminfo[1].shape = __pyx_pybuffernd_inner_data.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) - } - __pyx_v_inner_data = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":247 - * - * inner_data = self.data - * self.raw_data = inner_data.data # <<<<<<<<<<<<<< - * inner_maxes = self.maxes - * self.raw_maxes = inner_maxes.data - */ - __pyx_v_self->raw_data = ((__pyx_t_5numpy_float64_t *)__pyx_v_inner_data->data); - - /* "yt/utilities/spatial/ckdtree.pyx":248 - * inner_data = self.data - * self.raw_data = inner_data.data - * inner_maxes = self.maxes # <<<<<<<<<<<<<< - * self.raw_maxes = inner_maxes.data - * inner_mins = self.mins - */ - if (!(likely(((__pyx_v_self->maxes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->maxes, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 248, __pyx_L1_error) - __pyx_t_4 = __pyx_v_self->maxes; - __Pyx_INCREF(__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inner_maxes.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inner_maxes.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inner_maxes.rcbuffer->pybuffer, (PyObject*)__pyx_v_inner_maxes, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12); - } - } - __pyx_pybuffernd_inner_maxes.diminfo[0].strides = __pyx_pybuffernd_inner_maxes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inner_maxes.diminfo[0].shape = __pyx_pybuffernd_inner_maxes.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 248, __pyx_L1_error) - } - __pyx_v_inner_maxes = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":249 - * self.raw_data = inner_data.data - * inner_maxes = self.maxes - * self.raw_maxes = inner_maxes.data # <<<<<<<<<<<<<< - * inner_mins = self.mins - * self.raw_mins = inner_mins.data - */ - __pyx_v_self->raw_maxes = ((__pyx_t_5numpy_float64_t *)__pyx_v_inner_maxes->data); - - /* "yt/utilities/spatial/ckdtree.pyx":250 - * inner_maxes = self.maxes - * self.raw_maxes = inner_maxes.data - * inner_mins = self.mins # <<<<<<<<<<<<<< - * self.raw_mins = inner_mins.data - * inner_indices = self.indices - */ - if (!(likely(((__pyx_v_self->mins) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->mins, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 250, __pyx_L1_error) - __pyx_t_4 = __pyx_v_self->mins; - __Pyx_INCREF(__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inner_mins.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inner_mins.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inner_mins.rcbuffer->pybuffer, (PyObject*)__pyx_v_inner_mins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); - } - } - __pyx_pybuffernd_inner_mins.diminfo[0].strides = __pyx_pybuffernd_inner_mins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inner_mins.diminfo[0].shape = __pyx_pybuffernd_inner_mins.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 250, __pyx_L1_error) - } - __pyx_v_inner_mins = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":251 - * self.raw_maxes = inner_maxes.data - * inner_mins = self.mins - * self.raw_mins = inner_mins.data # <<<<<<<<<<<<<< - * inner_indices = self.indices - * self.raw_indices = inner_indices.data - */ - __pyx_v_self->raw_mins = ((__pyx_t_5numpy_float64_t *)__pyx_v_inner_mins->data); - - /* "yt/utilities/spatial/ckdtree.pyx":252 - * inner_mins = self.mins - * self.raw_mins = inner_mins.data - * inner_indices = self.indices # <<<<<<<<<<<<<< - * self.raw_indices = inner_indices.data - * - */ - if (!(likely(((__pyx_v_self->indices) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->indices, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 252, __pyx_L1_error) - __pyx_t_4 = __pyx_v_self->indices; - __Pyx_INCREF(__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inner_indices.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inner_indices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inner_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_inner_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12); - } - } - __pyx_pybuffernd_inner_indices.diminfo[0].strides = __pyx_pybuffernd_inner_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inner_indices.diminfo[0].shape = __pyx_pybuffernd_inner_indices.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 252, __pyx_L1_error) - } - __pyx_v_inner_indices = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":253 - * self.raw_mins = inner_mins.data - * inner_indices = self.indices - * self.raw_indices = inner_indices.data # <<<<<<<<<<<<<< - * - * self.tree = self.__build(0, self.n, self.raw_maxes, self.raw_mins) - */ - __pyx_v_self->raw_indices = ((__pyx_t_5numpy_int64_t *)__pyx_v_inner_indices->data); - - /* "yt/utilities/spatial/ckdtree.pyx":255 - * self.raw_indices = inner_indices.data - * - * self.tree = self.__build(0, self.n, self.raw_maxes, self.raw_mins) # <<<<<<<<<<<<<< - * - * cdef innernode* __build(cKDTree self, int start_idx, int end_idx, np.float64_t* maxes, np.float64_t* mins): - */ - __pyx_v_self->tree = ((struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->__pyx___build(__pyx_v_self, 0, __pyx_v_self->n, __pyx_v_self->raw_maxes, __pyx_v_self->raw_mins); - - /* "yt/utilities/spatial/ckdtree.pyx":232 - * cdef object indices - * cdef np.int64_t* raw_indices - * def __init__(cKDTree self, data, int leafsize=10): # <<<<<<<<<<<<<< - * cdef np.ndarray[np.float64_t, ndim=2] inner_data - * cdef np.ndarray[np.float64_t, ndim=1] inner_maxes - */ - - /* 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_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inner_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inner_indices.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inner_maxes.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inner_mins.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.cKDTree.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inner_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inner_indices.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inner_maxes.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inner_mins.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_inner_data); - __Pyx_XDECREF((PyObject *)__pyx_v_inner_maxes); - __Pyx_XDECREF((PyObject *)__pyx_v_inner_mins); - __Pyx_XDECREF((PyObject *)__pyx_v_inner_indices); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":257 - * self.tree = self.__build(0, self.n, self.raw_maxes, self.raw_mins) - * - * cdef innernode* __build(cKDTree self, int start_idx, int end_idx, np.float64_t* maxes, np.float64_t* mins): # <<<<<<<<<<<<<< - * cdef leafnode* n - * cdef innernode* ni - */ - -static struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *__pyx_f_2yt_9utilities_7spatial_7ckdtree_7cKDTree___build(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, int __pyx_v_start_idx, int __pyx_v_end_idx, __pyx_t_5numpy_float64_t *__pyx_v_maxes, __pyx_t_5numpy_float64_t *__pyx_v_mins) { - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_leafnode *__pyx_v_n; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *__pyx_v_ni; - int __pyx_v_i; - int __pyx_v_j; - int __pyx_v_t; - int __pyx_v_p; - int __pyx_v_q; - int __pyx_v_d; - __pyx_t_5numpy_float64_t __pyx_v_size; - __pyx_t_5numpy_float64_t __pyx_v_split; - __pyx_t_5numpy_float64_t __pyx_v_minval; - __pyx_t_5numpy_float64_t __pyx_v_maxval; - __pyx_t_5numpy_float64_t *__pyx_v_mids; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *__pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - long __pyx_t_4; - __Pyx_RefNannySetupContext("__build", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":263 - * cdef np.float64_t size, split, minval, maxval - * cdef np.float64_t*mids - * if end_idx-start_idx<=self.leafsize: # <<<<<<<<<<<<<< - * n = stdlib.malloc(sizeof(leafnode)) - * # Skory - */ - __pyx_t_1 = (((__pyx_v_end_idx - __pyx_v_start_idx) <= __pyx_v_self->leafsize) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":264 - * cdef np.float64_t*mids - * if end_idx-start_idx<=self.leafsize: - * n = stdlib.malloc(sizeof(leafnode)) # <<<<<<<<<<<<<< - * # Skory - * n.maxes = stdlib.malloc(sizeof(np.float64_t)*self.m) - */ - __pyx_v_n = ((struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_leafnode *)malloc((sizeof(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_leafnode)))); - - /* "yt/utilities/spatial/ckdtree.pyx":266 - * n = stdlib.malloc(sizeof(leafnode)) - * # Skory - * n.maxes = stdlib.malloc(sizeof(np.float64_t)*self.m) # <<<<<<<<<<<<<< - * n.mins = stdlib.malloc(sizeof(np.float64_t)*self.m) - * for i in range(self.m): - */ - __pyx_v_n->maxes = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_self->m))); - - /* "yt/utilities/spatial/ckdtree.pyx":267 - * # Skory - * n.maxes = stdlib.malloc(sizeof(np.float64_t)*self.m) - * n.mins = stdlib.malloc(sizeof(np.float64_t)*self.m) # <<<<<<<<<<<<<< - * for i in range(self.m): - * n.maxes[i] = maxes[i] - */ - __pyx_v_n->mins = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_self->m))); - - /* "yt/utilities/spatial/ckdtree.pyx":268 - * n.maxes = stdlib.malloc(sizeof(np.float64_t)*self.m) - * n.mins = stdlib.malloc(sizeof(np.float64_t)*self.m) - * for i in range(self.m): # <<<<<<<<<<<<<< - * n.maxes[i] = maxes[i] - * n.mins[i] = mins[i] - */ - __pyx_t_2 = __pyx_v_self->m; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - - /* "yt/utilities/spatial/ckdtree.pyx":269 - * n.mins = stdlib.malloc(sizeof(np.float64_t)*self.m) - * for i in range(self.m): - * n.maxes[i] = maxes[i] # <<<<<<<<<<<<<< - * n.mins[i] = mins[i] - * n.split_dim = -1 - */ - (__pyx_v_n->maxes[__pyx_v_i]) = (__pyx_v_maxes[__pyx_v_i]); - - /* "yt/utilities/spatial/ckdtree.pyx":270 - * for i in range(self.m): - * n.maxes[i] = maxes[i] - * n.mins[i] = mins[i] # <<<<<<<<<<<<<< - * n.split_dim = -1 - * n.start_idx = start_idx - */ - (__pyx_v_n->mins[__pyx_v_i]) = (__pyx_v_mins[__pyx_v_i]); - } - - /* "yt/utilities/spatial/ckdtree.pyx":271 - * n.maxes[i] = maxes[i] - * n.mins[i] = mins[i] - * n.split_dim = -1 # <<<<<<<<<<<<<< - * n.start_idx = start_idx - * n.end_idx = end_idx - */ - __pyx_v_n->split_dim = -1; - - /* "yt/utilities/spatial/ckdtree.pyx":272 - * n.mins[i] = mins[i] - * n.split_dim = -1 - * n.start_idx = start_idx # <<<<<<<<<<<<<< - * n.end_idx = end_idx - * return n - */ - __pyx_v_n->start_idx = __pyx_v_start_idx; - - /* "yt/utilities/spatial/ckdtree.pyx":273 - * n.split_dim = -1 - * n.start_idx = start_idx - * n.end_idx = end_idx # <<<<<<<<<<<<<< - * return n - * else: - */ - __pyx_v_n->end_idx = __pyx_v_end_idx; - - /* "yt/utilities/spatial/ckdtree.pyx":274 - * n.start_idx = start_idx - * n.end_idx = end_idx - * return n # <<<<<<<<<<<<<< - * else: - * d = 0 - */ - __pyx_r = ((struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *)__pyx_v_n); - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":263 - * cdef np.float64_t size, split, minval, maxval - * cdef np.float64_t*mids - * if end_idx-start_idx<=self.leafsize: # <<<<<<<<<<<<<< - * n = stdlib.malloc(sizeof(leafnode)) - * # Skory - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":276 - * return n - * else: - * d = 0 # <<<<<<<<<<<<<< - * size = 0 - * for i in range(self.m): - */ - /*else*/ { - __pyx_v_d = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":277 - * else: - * d = 0 - * size = 0 # <<<<<<<<<<<<<< - * for i in range(self.m): - * if maxes[i]-mins[i] > size: - */ - __pyx_v_size = 0.0; - - /* "yt/utilities/spatial/ckdtree.pyx":278 - * d = 0 - * size = 0 - * for i in range(self.m): # <<<<<<<<<<<<<< - * if maxes[i]-mins[i] > size: - * d = i - */ - __pyx_t_2 = __pyx_v_self->m; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - - /* "yt/utilities/spatial/ckdtree.pyx":279 - * size = 0 - * for i in range(self.m): - * if maxes[i]-mins[i] > size: # <<<<<<<<<<<<<< - * d = i - * size = maxes[i]-mins[i] - */ - __pyx_t_1 = ((((__pyx_v_maxes[__pyx_v_i]) - (__pyx_v_mins[__pyx_v_i])) > __pyx_v_size) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":280 - * for i in range(self.m): - * if maxes[i]-mins[i] > size: - * d = i # <<<<<<<<<<<<<< - * size = maxes[i]-mins[i] - * maxval = maxes[d] - */ - __pyx_v_d = __pyx_v_i; - - /* "yt/utilities/spatial/ckdtree.pyx":281 - * if maxes[i]-mins[i] > size: - * d = i - * size = maxes[i]-mins[i] # <<<<<<<<<<<<<< - * maxval = maxes[d] - * minval = mins[d] - */ - __pyx_v_size = ((__pyx_v_maxes[__pyx_v_i]) - (__pyx_v_mins[__pyx_v_i])); - - /* "yt/utilities/spatial/ckdtree.pyx":279 - * size = 0 - * for i in range(self.m): - * if maxes[i]-mins[i] > size: # <<<<<<<<<<<<<< - * d = i - * size = maxes[i]-mins[i] - */ - } - } - - /* "yt/utilities/spatial/ckdtree.pyx":282 - * d = i - * size = maxes[i]-mins[i] - * maxval = maxes[d] # <<<<<<<<<<<<<< - * minval = mins[d] - * if maxval==minval: - */ - __pyx_v_maxval = (__pyx_v_maxes[__pyx_v_d]); - - /* "yt/utilities/spatial/ckdtree.pyx":283 - * size = maxes[i]-mins[i] - * maxval = maxes[d] - * minval = mins[d] # <<<<<<<<<<<<<< - * if maxval==minval: - * # all points are identical; warn user? - */ - __pyx_v_minval = (__pyx_v_mins[__pyx_v_d]); - - /* "yt/utilities/spatial/ckdtree.pyx":284 - * maxval = maxes[d] - * minval = mins[d] - * if maxval==minval: # <<<<<<<<<<<<<< - * # all points are identical; warn user? - * n = stdlib.malloc(sizeof(leafnode)) - */ - __pyx_t_1 = ((__pyx_v_maxval == __pyx_v_minval) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":286 - * if maxval==minval: - * # all points are identical; warn user? - * n = stdlib.malloc(sizeof(leafnode)) # <<<<<<<<<<<<<< - * n.split_dim = -1 - * n.start_idx = start_idx - */ - __pyx_v_n = ((struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_leafnode *)malloc((sizeof(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_leafnode)))); - - /* "yt/utilities/spatial/ckdtree.pyx":287 - * # all points are identical; warn user? - * n = stdlib.malloc(sizeof(leafnode)) - * n.split_dim = -1 # <<<<<<<<<<<<<< - * n.start_idx = start_idx - * n.end_idx = end_idx - */ - __pyx_v_n->split_dim = -1; - - /* "yt/utilities/spatial/ckdtree.pyx":288 - * n = stdlib.malloc(sizeof(leafnode)) - * n.split_dim = -1 - * n.start_idx = start_idx # <<<<<<<<<<<<<< - * n.end_idx = end_idx - * return n - */ - __pyx_v_n->start_idx = __pyx_v_start_idx; - - /* "yt/utilities/spatial/ckdtree.pyx":289 - * n.split_dim = -1 - * n.start_idx = start_idx - * n.end_idx = end_idx # <<<<<<<<<<<<<< - * return n - * - */ - __pyx_v_n->end_idx = __pyx_v_end_idx; - - /* "yt/utilities/spatial/ckdtree.pyx":290 - * n.start_idx = start_idx - * n.end_idx = end_idx - * return n # <<<<<<<<<<<<<< - * - * split = (maxval+minval)/2 - */ - __pyx_r = ((struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *)__pyx_v_n); - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":284 - * maxval = maxes[d] - * minval = mins[d] - * if maxval==minval: # <<<<<<<<<<<<<< - * # all points are identical; warn user? - * n = stdlib.malloc(sizeof(leafnode)) - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":292 - * return n - * - * split = (maxval+minval)/2 # <<<<<<<<<<<<<< - * - * p = start_idx - */ - __pyx_v_split = ((__pyx_v_maxval + __pyx_v_minval) / 2.0); - - /* "yt/utilities/spatial/ckdtree.pyx":294 - * split = (maxval+minval)/2 - * - * p = start_idx # <<<<<<<<<<<<<< - * q = end_idx-1 - * while p<=q: - */ - __pyx_v_p = __pyx_v_start_idx; - - /* "yt/utilities/spatial/ckdtree.pyx":295 - * - * p = start_idx - * q = end_idx-1 # <<<<<<<<<<<<<< - * while p<=q: - * if self.raw_data[self.raw_indices[p]*self.m+d]=split: - */ - __pyx_t_1 = (((__pyx_v_self->raw_data[(((__pyx_v_self->raw_indices[__pyx_v_p]) * __pyx_v_self->m) + __pyx_v_d)]) < __pyx_v_split) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":298 - * while p<=q: - * if self.raw_data[self.raw_indices[p]*self.m+d]=split: - * q-=1 - */ - __pyx_v_p = (__pyx_v_p + 1); - - /* "yt/utilities/spatial/ckdtree.pyx":297 - * q = end_idx-1 - * while p<=q: - * if self.raw_data[self.raw_indices[p]*self.m+d]=split: - */ - goto __pyx_L12; - } - - /* "yt/utilities/spatial/ckdtree.pyx":299 - * if self.raw_data[self.raw_indices[p]*self.m+d]=split: # <<<<<<<<<<<<<< - * q-=1 - * else: - */ - __pyx_t_1 = (((__pyx_v_self->raw_data[(((__pyx_v_self->raw_indices[__pyx_v_q]) * __pyx_v_self->m) + __pyx_v_d)]) >= __pyx_v_split) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":300 - * p+=1 - * elif self.raw_data[self.raw_indices[q]*self.m+d]>=split: - * q-=1 # <<<<<<<<<<<<<< - * else: - * t = self.raw_indices[p] - */ - __pyx_v_q = (__pyx_v_q - 1); - - /* "yt/utilities/spatial/ckdtree.pyx":299 - * if self.raw_data[self.raw_indices[p]*self.m+d]=split: # <<<<<<<<<<<<<< - * q-=1 - * else: - */ - goto __pyx_L12; - } - - /* "yt/utilities/spatial/ckdtree.pyx":302 - * q-=1 - * else: - * t = self.raw_indices[p] # <<<<<<<<<<<<<< - * self.raw_indices[p] = self.raw_indices[q] - * self.raw_indices[q] = t - */ - /*else*/ { - __pyx_v_t = (__pyx_v_self->raw_indices[__pyx_v_p]); - - /* "yt/utilities/spatial/ckdtree.pyx":303 - * else: - * t = self.raw_indices[p] - * self.raw_indices[p] = self.raw_indices[q] # <<<<<<<<<<<<<< - * self.raw_indices[q] = t - * p+=1 - */ - (__pyx_v_self->raw_indices[__pyx_v_p]) = (__pyx_v_self->raw_indices[__pyx_v_q]); - - /* "yt/utilities/spatial/ckdtree.pyx":304 - * t = self.raw_indices[p] - * self.raw_indices[p] = self.raw_indices[q] - * self.raw_indices[q] = t # <<<<<<<<<<<<<< - * p+=1 - * q-=1 - */ - (__pyx_v_self->raw_indices[__pyx_v_q]) = __pyx_v_t; - - /* "yt/utilities/spatial/ckdtree.pyx":305 - * self.raw_indices[p] = self.raw_indices[q] - * self.raw_indices[q] = t - * p+=1 # <<<<<<<<<<<<<< - * q-=1 - * - */ - __pyx_v_p = (__pyx_v_p + 1); - - /* "yt/utilities/spatial/ckdtree.pyx":306 - * self.raw_indices[q] = t - * p+=1 - * q-=1 # <<<<<<<<<<<<<< - * - * # slide midpoint if necessary - */ - __pyx_v_q = (__pyx_v_q - 1); - } - __pyx_L12:; - } - - /* "yt/utilities/spatial/ckdtree.pyx":309 - * - * # slide midpoint if necessary - * if p==start_idx: # <<<<<<<<<<<<<< - * # no points less than split - * j = start_idx - */ - __pyx_t_1 = ((__pyx_v_p == __pyx_v_start_idx) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":311 - * if p==start_idx: - * # no points less than split - * j = start_idx # <<<<<<<<<<<<<< - * split = self.raw_data[self.raw_indices[j]*self.m+d] - * for i in range(start_idx+1, end_idx): - */ - __pyx_v_j = __pyx_v_start_idx; - - /* "yt/utilities/spatial/ckdtree.pyx":312 - * # no points less than split - * j = start_idx - * split = self.raw_data[self.raw_indices[j]*self.m+d] # <<<<<<<<<<<<<< - * for i in range(start_idx+1, end_idx): - * if self.raw_data[self.raw_indices[i]*self.m+d]raw_data[(((__pyx_v_self->raw_indices[__pyx_v_j]) * __pyx_v_self->m) + __pyx_v_d)]); - - /* "yt/utilities/spatial/ckdtree.pyx":313 - * j = start_idx - * split = self.raw_data[self.raw_indices[j]*self.m+d] - * for i in range(start_idx+1, end_idx): # <<<<<<<<<<<<<< - * if self.raw_data[self.raw_indices[i]*self.m+d]raw_data[(((__pyx_v_self->raw_indices[__pyx_v_i]) * __pyx_v_self->m) + __pyx_v_d)]) < __pyx_v_split) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":315 - * for i in range(start_idx+1, end_idx): - * if self.raw_data[self.raw_indices[i]*self.m+d]raw_data[(((__pyx_v_self->raw_indices[__pyx_v_j]) * __pyx_v_self->m) + __pyx_v_d)]); - - /* "yt/utilities/spatial/ckdtree.pyx":314 - * split = self.raw_data[self.raw_indices[j]*self.m+d] - * for i in range(start_idx+1, end_idx): - * if self.raw_data[self.raw_indices[i]*self.m+d]raw_indices[__pyx_v_start_idx]); - - /* "yt/utilities/spatial/ckdtree.pyx":318 - * split = self.raw_data[self.raw_indices[j]*self.m+d] - * t = self.raw_indices[start_idx] - * self.raw_indices[start_idx] = self.raw_indices[j] # <<<<<<<<<<<<<< - * self.raw_indices[j] = t - * p = start_idx+1 - */ - (__pyx_v_self->raw_indices[__pyx_v_start_idx]) = (__pyx_v_self->raw_indices[__pyx_v_j]); - - /* "yt/utilities/spatial/ckdtree.pyx":319 - * t = self.raw_indices[start_idx] - * self.raw_indices[start_idx] = self.raw_indices[j] - * self.raw_indices[j] = t # <<<<<<<<<<<<<< - * p = start_idx+1 - * q = start_idx - */ - (__pyx_v_self->raw_indices[__pyx_v_j]) = __pyx_v_t; - - /* "yt/utilities/spatial/ckdtree.pyx":320 - * self.raw_indices[start_idx] = self.raw_indices[j] - * self.raw_indices[j] = t - * p = start_idx+1 # <<<<<<<<<<<<<< - * q = start_idx - * elif p==end_idx: - */ - __pyx_v_p = (__pyx_v_start_idx + 1); - - /* "yt/utilities/spatial/ckdtree.pyx":321 - * self.raw_indices[j] = t - * p = start_idx+1 - * q = start_idx # <<<<<<<<<<<<<< - * elif p==end_idx: - * # no points greater than split - */ - __pyx_v_q = __pyx_v_start_idx; - - /* "yt/utilities/spatial/ckdtree.pyx":309 - * - * # slide midpoint if necessary - * if p==start_idx: # <<<<<<<<<<<<<< - * # no points less than split - * j = start_idx - */ - goto __pyx_L13; - } - - /* "yt/utilities/spatial/ckdtree.pyx":322 - * p = start_idx+1 - * q = start_idx - * elif p==end_idx: # <<<<<<<<<<<<<< - * # no points greater than split - * j = end_idx-1 - */ - __pyx_t_1 = ((__pyx_v_p == __pyx_v_end_idx) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":324 - * elif p==end_idx: - * # no points greater than split - * j = end_idx-1 # <<<<<<<<<<<<<< - * split = self.raw_data[self.raw_indices[j]*self.m+d] - * for i in range(start_idx, end_idx-1): - */ - __pyx_v_j = (__pyx_v_end_idx - 1); - - /* "yt/utilities/spatial/ckdtree.pyx":325 - * # no points greater than split - * j = end_idx-1 - * split = self.raw_data[self.raw_indices[j]*self.m+d] # <<<<<<<<<<<<<< - * for i in range(start_idx, end_idx-1): - * if self.raw_data[self.raw_indices[i]*self.m+d]>split: - */ - __pyx_v_split = (__pyx_v_self->raw_data[(((__pyx_v_self->raw_indices[__pyx_v_j]) * __pyx_v_self->m) + __pyx_v_d)]); - - /* "yt/utilities/spatial/ckdtree.pyx":326 - * j = end_idx-1 - * split = self.raw_data[self.raw_indices[j]*self.m+d] - * for i in range(start_idx, end_idx-1): # <<<<<<<<<<<<<< - * if self.raw_data[self.raw_indices[i]*self.m+d]>split: - * j = i - */ - __pyx_t_4 = (__pyx_v_end_idx - 1); - for (__pyx_t_2 = __pyx_v_start_idx; __pyx_t_2 < __pyx_t_4; __pyx_t_2+=1) { - __pyx_v_i = __pyx_t_2; - - /* "yt/utilities/spatial/ckdtree.pyx":327 - * split = self.raw_data[self.raw_indices[j]*self.m+d] - * for i in range(start_idx, end_idx-1): - * if self.raw_data[self.raw_indices[i]*self.m+d]>split: # <<<<<<<<<<<<<< - * j = i - * split = self.raw_data[self.raw_indices[j]*self.m+d] - */ - __pyx_t_1 = (((__pyx_v_self->raw_data[(((__pyx_v_self->raw_indices[__pyx_v_i]) * __pyx_v_self->m) + __pyx_v_d)]) > __pyx_v_split) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":328 - * for i in range(start_idx, end_idx-1): - * if self.raw_data[self.raw_indices[i]*self.m+d]>split: - * j = i # <<<<<<<<<<<<<< - * split = self.raw_data[self.raw_indices[j]*self.m+d] - * t = self.raw_indices[end_idx-1] - */ - __pyx_v_j = __pyx_v_i; - - /* "yt/utilities/spatial/ckdtree.pyx":329 - * if self.raw_data[self.raw_indices[i]*self.m+d]>split: - * j = i - * split = self.raw_data[self.raw_indices[j]*self.m+d] # <<<<<<<<<<<<<< - * t = self.raw_indices[end_idx-1] - * self.raw_indices[end_idx-1] = self.raw_indices[j] - */ - __pyx_v_split = (__pyx_v_self->raw_data[(((__pyx_v_self->raw_indices[__pyx_v_j]) * __pyx_v_self->m) + __pyx_v_d)]); - - /* "yt/utilities/spatial/ckdtree.pyx":327 - * split = self.raw_data[self.raw_indices[j]*self.m+d] - * for i in range(start_idx, end_idx-1): - * if self.raw_data[self.raw_indices[i]*self.m+d]>split: # <<<<<<<<<<<<<< - * j = i - * split = self.raw_data[self.raw_indices[j]*self.m+d] - */ - } - } - - /* "yt/utilities/spatial/ckdtree.pyx":330 - * j = i - * split = self.raw_data[self.raw_indices[j]*self.m+d] - * t = self.raw_indices[end_idx-1] # <<<<<<<<<<<<<< - * self.raw_indices[end_idx-1] = self.raw_indices[j] - * self.raw_indices[j] = t - */ - __pyx_v_t = (__pyx_v_self->raw_indices[(__pyx_v_end_idx - 1)]); - - /* "yt/utilities/spatial/ckdtree.pyx":331 - * split = self.raw_data[self.raw_indices[j]*self.m+d] - * t = self.raw_indices[end_idx-1] - * self.raw_indices[end_idx-1] = self.raw_indices[j] # <<<<<<<<<<<<<< - * self.raw_indices[j] = t - * p = end_idx-1 - */ - (__pyx_v_self->raw_indices[(__pyx_v_end_idx - 1)]) = (__pyx_v_self->raw_indices[__pyx_v_j]); - - /* "yt/utilities/spatial/ckdtree.pyx":332 - * t = self.raw_indices[end_idx-1] - * self.raw_indices[end_idx-1] = self.raw_indices[j] - * self.raw_indices[j] = t # <<<<<<<<<<<<<< - * p = end_idx-1 - * q = end_idx-2 - */ - (__pyx_v_self->raw_indices[__pyx_v_j]) = __pyx_v_t; - - /* "yt/utilities/spatial/ckdtree.pyx":333 - * self.raw_indices[end_idx-1] = self.raw_indices[j] - * self.raw_indices[j] = t - * p = end_idx-1 # <<<<<<<<<<<<<< - * q = end_idx-2 - * - */ - __pyx_v_p = (__pyx_v_end_idx - 1); - - /* "yt/utilities/spatial/ckdtree.pyx":334 - * self.raw_indices[j] = t - * p = end_idx-1 - * q = end_idx-2 # <<<<<<<<<<<<<< - * - * # construct new node representation - */ - __pyx_v_q = (__pyx_v_end_idx - 2); - - /* "yt/utilities/spatial/ckdtree.pyx":322 - * p = start_idx+1 - * q = start_idx - * elif p==end_idx: # <<<<<<<<<<<<<< - * # no points greater than split - * j = end_idx-1 - */ - } - __pyx_L13:; - - /* "yt/utilities/spatial/ckdtree.pyx":337 - * - * # construct new node representation - * ni = stdlib.malloc(sizeof(innernode)) # <<<<<<<<<<<<<< - * - * mids = stdlib.malloc(sizeof(np.float64_t)*self.m) - */ - __pyx_v_ni = ((struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *)malloc((sizeof(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode)))); - - /* "yt/utilities/spatial/ckdtree.pyx":339 - * ni = stdlib.malloc(sizeof(innernode)) - * - * mids = stdlib.malloc(sizeof(np.float64_t)*self.m) # <<<<<<<<<<<<<< - * for i in range(self.m): - * mids[i] = maxes[i] - */ - __pyx_v_mids = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_self->m))); - - /* "yt/utilities/spatial/ckdtree.pyx":340 - * - * mids = stdlib.malloc(sizeof(np.float64_t)*self.m) - * for i in range(self.m): # <<<<<<<<<<<<<< - * mids[i] = maxes[i] - * mids[d] = split - */ - __pyx_t_2 = __pyx_v_self->m; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - - /* "yt/utilities/spatial/ckdtree.pyx":341 - * mids = stdlib.malloc(sizeof(np.float64_t)*self.m) - * for i in range(self.m): - * mids[i] = maxes[i] # <<<<<<<<<<<<<< - * mids[d] = split - * ni.less = self.__build(start_idx,p,mids,mins) - */ - (__pyx_v_mids[__pyx_v_i]) = (__pyx_v_maxes[__pyx_v_i]); - } - - /* "yt/utilities/spatial/ckdtree.pyx":342 - * for i in range(self.m): - * mids[i] = maxes[i] - * mids[d] = split # <<<<<<<<<<<<<< - * ni.less = self.__build(start_idx,p,mids,mins) - * - */ - (__pyx_v_mids[__pyx_v_d]) = __pyx_v_split; - - /* "yt/utilities/spatial/ckdtree.pyx":343 - * mids[i] = maxes[i] - * mids[d] = split - * ni.less = self.__build(start_idx,p,mids,mins) # <<<<<<<<<<<<<< - * - * for i in range(self.m): - */ - __pyx_v_ni->less = ((struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->__pyx___build(__pyx_v_self, __pyx_v_start_idx, __pyx_v_p, __pyx_v_mids, __pyx_v_mins); - - /* "yt/utilities/spatial/ckdtree.pyx":345 - * ni.less = self.__build(start_idx,p,mids,mins) - * - * for i in range(self.m): # <<<<<<<<<<<<<< - * mids[i] = mins[i] - * mids[d] = split - */ - __pyx_t_2 = __pyx_v_self->m; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - - /* "yt/utilities/spatial/ckdtree.pyx":346 - * - * for i in range(self.m): - * mids[i] = mins[i] # <<<<<<<<<<<<<< - * mids[d] = split - * ni.greater = self.__build(p,end_idx,maxes,mids) - */ - (__pyx_v_mids[__pyx_v_i]) = (__pyx_v_mins[__pyx_v_i]); - } - - /* "yt/utilities/spatial/ckdtree.pyx":347 - * for i in range(self.m): - * mids[i] = mins[i] - * mids[d] = split # <<<<<<<<<<<<<< - * ni.greater = self.__build(p,end_idx,maxes,mids) - * - */ - (__pyx_v_mids[__pyx_v_d]) = __pyx_v_split; - - /* "yt/utilities/spatial/ckdtree.pyx":348 - * mids[i] = mins[i] - * mids[d] = split - * ni.greater = self.__build(p,end_idx,maxes,mids) # <<<<<<<<<<<<<< - * - * stdlib.free(mids) - */ - __pyx_v_ni->greater = ((struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->__pyx___build(__pyx_v_self, __pyx_v_p, __pyx_v_end_idx, __pyx_v_maxes, __pyx_v_mids); - - /* "yt/utilities/spatial/ckdtree.pyx":350 - * ni.greater = self.__build(p,end_idx,maxes,mids) - * - * stdlib.free(mids) # <<<<<<<<<<<<<< - * - * ni.split_dim = d - */ - free(__pyx_v_mids); - - /* "yt/utilities/spatial/ckdtree.pyx":352 - * stdlib.free(mids) - * - * ni.split_dim = d # <<<<<<<<<<<<<< - * ni.split = split - * # Skory - */ - __pyx_v_ni->split_dim = __pyx_v_d; - - /* "yt/utilities/spatial/ckdtree.pyx":353 - * - * ni.split_dim = d - * ni.split = split # <<<<<<<<<<<<<< - * # Skory - * ni.maxes = stdlib.malloc(sizeof(np.float64_t)*self.m) - */ - __pyx_v_ni->split = __pyx_v_split; - - /* "yt/utilities/spatial/ckdtree.pyx":355 - * ni.split = split - * # Skory - * ni.maxes = stdlib.malloc(sizeof(np.float64_t)*self.m) # <<<<<<<<<<<<<< - * ni.mins = stdlib.malloc(sizeof(np.float64_t)*self.m) - * for i in range(self.m): - */ - __pyx_v_ni->maxes = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_self->m))); - - /* "yt/utilities/spatial/ckdtree.pyx":356 - * # Skory - * ni.maxes = stdlib.malloc(sizeof(np.float64_t)*self.m) - * ni.mins = stdlib.malloc(sizeof(np.float64_t)*self.m) # <<<<<<<<<<<<<< - * for i in range(self.m): - * ni.maxes[i] = maxes[i] - */ - __pyx_v_ni->mins = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_self->m))); - - /* "yt/utilities/spatial/ckdtree.pyx":357 - * ni.maxes = stdlib.malloc(sizeof(np.float64_t)*self.m) - * ni.mins = stdlib.malloc(sizeof(np.float64_t)*self.m) - * for i in range(self.m): # <<<<<<<<<<<<<< - * ni.maxes[i] = maxes[i] - * ni.mins[i] = mins[i] - */ - __pyx_t_2 = __pyx_v_self->m; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_i = __pyx_t_3; - - /* "yt/utilities/spatial/ckdtree.pyx":358 - * ni.mins = stdlib.malloc(sizeof(np.float64_t)*self.m) - * for i in range(self.m): - * ni.maxes[i] = maxes[i] # <<<<<<<<<<<<<< - * ni.mins[i] = mins[i] - * - */ - (__pyx_v_ni->maxes[__pyx_v_i]) = (__pyx_v_maxes[__pyx_v_i]); - - /* "yt/utilities/spatial/ckdtree.pyx":359 - * for i in range(self.m): - * ni.maxes[i] = maxes[i] - * ni.mins[i] = mins[i] # <<<<<<<<<<<<<< - * - * return ni - */ - (__pyx_v_ni->mins[__pyx_v_i]) = (__pyx_v_mins[__pyx_v_i]); - } - - /* "yt/utilities/spatial/ckdtree.pyx":361 - * ni.mins[i] = mins[i] - * - * return ni # <<<<<<<<<<<<<< - * - * cdef __free_tree(cKDTree self, innernode* node): - */ - __pyx_r = __pyx_v_ni; - goto __pyx_L0; - } - - /* "yt/utilities/spatial/ckdtree.pyx":257 - * self.tree = self.__build(0, self.n, self.raw_maxes, self.raw_mins) - * - * cdef innernode* __build(cKDTree self, int start_idx, int end_idx, np.float64_t* maxes, np.float64_t* mins): # <<<<<<<<<<<<<< - * cdef leafnode* n - * cdef innernode* ni - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":363 - * return ni - * - * cdef __free_tree(cKDTree self, innernode* node): # <<<<<<<<<<<<<< - * if node.split_dim!=-1: - * self.__free_tree(node.less) - */ - -static PyObject *__pyx_f_2yt_9utilities_7spatial_7ckdtree_7cKDTree___free_tree(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *__pyx_v_node) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__free_tree", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":364 - * - * cdef __free_tree(cKDTree self, innernode* node): - * if node.split_dim!=-1: # <<<<<<<<<<<<<< - * self.__free_tree(node.less) - * self.__free_tree(node.greater) - */ - __pyx_t_1 = ((__pyx_v_node->split_dim != -1L) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":365 - * cdef __free_tree(cKDTree self, innernode* node): - * if node.split_dim!=-1: - * self.__free_tree(node.less) # <<<<<<<<<<<<<< - * self.__free_tree(node.greater) - * stdlib.free(node.maxes) # Skory - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->__pyx___free_tree(__pyx_v_self, __pyx_v_node->less); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":366 - * if node.split_dim!=-1: - * self.__free_tree(node.less) - * self.__free_tree(node.greater) # <<<<<<<<<<<<<< - * stdlib.free(node.maxes) # Skory - * stdlib.free(node.mins) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->__pyx___free_tree(__pyx_v_self, __pyx_v_node->greater); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":364 - * - * cdef __free_tree(cKDTree self, innernode* node): - * if node.split_dim!=-1: # <<<<<<<<<<<<<< - * self.__free_tree(node.less) - * self.__free_tree(node.greater) - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":367 - * self.__free_tree(node.less) - * self.__free_tree(node.greater) - * stdlib.free(node.maxes) # Skory # <<<<<<<<<<<<<< - * stdlib.free(node.mins) - * stdlib.free(node) - */ - free(__pyx_v_node->maxes); - - /* "yt/utilities/spatial/ckdtree.pyx":368 - * self.__free_tree(node.greater) - * stdlib.free(node.maxes) # Skory - * stdlib.free(node.mins) # <<<<<<<<<<<<<< - * stdlib.free(node) - * - */ - free(__pyx_v_node->mins); - - /* "yt/utilities/spatial/ckdtree.pyx":369 - * stdlib.free(node.maxes) # Skory - * stdlib.free(node.mins) - * stdlib.free(node) # <<<<<<<<<<<<<< - * - * def __dealloc__(cKDTree self): - */ - free(__pyx_v_node); - - /* "yt/utilities/spatial/ckdtree.pyx":363 - * return ni - * - * cdef __free_tree(cKDTree self, innernode* node): # <<<<<<<<<<<<<< - * if node.split_dim!=-1: - * self.__free_tree(node.less) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.cKDTree.__free_tree", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":371 - * stdlib.free(node) - * - * def __dealloc__(cKDTree self): # <<<<<<<<<<<<<< - * if (self.tree) == 0: - * # should happen only if __init__ was never called - */ - -/* Python wrapper */ -static void __pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_3__dealloc__(PyObject *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_2__dealloc__(((struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_2__dealloc__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__dealloc__", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":372 - * - * def __dealloc__(cKDTree self): - * if (self.tree) == 0: # <<<<<<<<<<<<<< - * # should happen only if __init__ was never called - * return - */ - __pyx_t_1 = ((((int)__pyx_v_self->tree) == 0) != 0); - if (__pyx_t_1) { - - /* "yt/utilities/spatial/ckdtree.pyx":374 - * if (self.tree) == 0: - * # should happen only if __init__ was never called - * return # <<<<<<<<<<<<<< - * self.__free_tree(self.tree) - * - */ - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":372 - * - * def __dealloc__(cKDTree self): - * if (self.tree) == 0: # <<<<<<<<<<<<<< - * # should happen only if __init__ was never called - * return - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":375 - * # should happen only if __init__ was never called - * return - * self.__free_tree(self.tree) # <<<<<<<<<<<<<< - * - * cdef void __query(cKDTree self, - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->__pyx___free_tree(__pyx_v_self, __pyx_v_self->tree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":371 - * stdlib.free(node) - * - * def __dealloc__(cKDTree self): # <<<<<<<<<<<<<< - * if (self.tree) == 0: - * # should happen only if __init__ was never called - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_WriteUnraisable("yt.utilities.spatial.ckdtree.cKDTree.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_L0:; - __Pyx_RefNannyFinishContext(); -} - -/* "yt/utilities/spatial/ckdtree.pyx":377 - * self.__free_tree(self.tree) - * - * cdef void __query(cKDTree self, # <<<<<<<<<<<<<< - * np.float64_t*result_distances, - * np.int64_t*result_indices, - */ - -static void __pyx_f_2yt_9utilities_7spatial_7ckdtree_7cKDTree___query(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_result_distances, __pyx_t_5numpy_int64_t *__pyx_v_result_indices, __pyx_t_5numpy_float64_t *__pyx_v_x, int __pyx_v_k, __pyx_t_5numpy_float64_t __pyx_v_eps, __pyx_t_5numpy_float64_t __pyx_v_p, __pyx_t_5numpy_float64_t __pyx_v_distance_upper_bound, __pyx_t_5numpy_float64_t *__pyx_v_period) { - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap __pyx_v_q; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heap __pyx_v_neighbors; - int __pyx_v_i; - int __pyx_v_i2; - __pyx_t_5numpy_float64_t __pyx_v_t; - __pyx_t_5numpy_float64_t __pyx_v_y; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_nodeinfo *__pyx_v_inf; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_nodeinfo *__pyx_v_inf2; - __pyx_t_5numpy_float64_t __pyx_v_d; - __pyx_t_5numpy_float64_t __pyx_v_di; - __pyx_t_5numpy_float64_t __pyx_v_m_left; - __pyx_t_5numpy_float64_t __pyx_v_m_right; - __pyx_t_5numpy_float64_t __pyx_v_m; - __pyx_t_5numpy_float64_t __pyx_v_epsfac; - __pyx_t_5numpy_float64_t __pyx_v_min_distance; - __pyx_t_5numpy_float64_t __pyx_v_far_min_distance; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_v_it; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_v_it2; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_heapitem __pyx_v_neighbor; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_leafnode *__pyx_v_node; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *__pyx_v_inode; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *__pyx_v_near; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *__pyx_v_far; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *__pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - __pyx_t_5numpy_float64_t __pyx_t_8; - __Pyx_RefNannySetupContext("__query", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":386 - * np.float64_t distance_upper_bound, - * np.float64_t*period): - * assert(p == 2) # <<<<<<<<<<<<<< - * assert(eps == 0.0) - * assert(distance_upper_bound == infinity) - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!Py_OptimizeFlag)) { - if (unlikely(!((__pyx_v_p == 2.0) != 0))) { - PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 386, __pyx_L1_error) - } - } - #endif - - /* "yt/utilities/spatial/ckdtree.pyx":387 - * np.float64_t*period): - * assert(p == 2) - * assert(eps == 0.0) # <<<<<<<<<<<<<< - * assert(distance_upper_bound == infinity) - * cdef heap q - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!Py_OptimizeFlag)) { - if (unlikely(!((__pyx_v_eps == 0.0) != 0))) { - PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 387, __pyx_L1_error) - } - } - #endif - - /* "yt/utilities/spatial/ckdtree.pyx":388 - * assert(p == 2) - * assert(eps == 0.0) - * assert(distance_upper_bound == infinity) # <<<<<<<<<<<<<< - * cdef heap q - * cdef heap neighbors - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!Py_OptimizeFlag)) { - if (unlikely(!((__pyx_v_distance_upper_bound == __pyx_v_2yt_9utilities_7spatial_7ckdtree_infinity) != 0))) { - PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 388, __pyx_L1_error) - } - } - #endif - - /* "yt/utilities/spatial/ckdtree.pyx":413 - * # distances between the nearest side of the cell and the target - * # the head node of the cell - * heapcreate(&q,12) # <<<<<<<<<<<<<< - * - * # priority queue for the nearest neighbors - */ - __pyx_t_1 = __pyx_f_2yt_9utilities_7spatial_7ckdtree_heapcreate((&__pyx_v_q), 12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":418 - * # furthest known neighbor first - * # entries are (-distance**p, i) - * heapcreate(&neighbors,k) # <<<<<<<<<<<<<< - * - * # set up first nodeinfo - */ - __pyx_t_1 = __pyx_f_2yt_9utilities_7spatial_7ckdtree_heapcreate((&__pyx_v_neighbors), __pyx_v_k); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":421 - * - * # set up first nodeinfo - * inf = stdlib.malloc(sizeof(nodeinfo)+self.m*sizeof(np.float64_t)) # <<<<<<<<<<<<<< - * inf.node = self.tree - * for i in range(self.m): - */ - __pyx_v_inf = ((struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_nodeinfo *)malloc(((sizeof(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_nodeinfo)) + (__pyx_v_self->m * (sizeof(__pyx_t_5numpy_float64_t)))))); - - /* "yt/utilities/spatial/ckdtree.pyx":422 - * # set up first nodeinfo - * inf = stdlib.malloc(sizeof(nodeinfo)+self.m*sizeof(np.float64_t)) - * inf.node = self.tree # <<<<<<<<<<<<<< - * for i in range(self.m): - * inf.side_distances[i] = 0 - */ - __pyx_t_2 = __pyx_v_self->tree; - __pyx_v_inf->node = __pyx_t_2; - - /* "yt/utilities/spatial/ckdtree.pyx":423 - * inf = stdlib.malloc(sizeof(nodeinfo)+self.m*sizeof(np.float64_t)) - * inf.node = self.tree - * for i in range(self.m): # <<<<<<<<<<<<<< - * inf.side_distances[i] = 0 - * t = x[i]-self.raw_maxes[i] - */ - __pyx_t_3 = __pyx_v_self->m; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "yt/utilities/spatial/ckdtree.pyx":424 - * inf.node = self.tree - * for i in range(self.m): - * inf.side_distances[i] = 0 # <<<<<<<<<<<<<< - * t = x[i]-self.raw_maxes[i] - * if t>inf.side_distances[i]: - */ - (__pyx_v_inf->side_distances[__pyx_v_i]) = 0.0; - - /* "yt/utilities/spatial/ckdtree.pyx":425 - * for i in range(self.m): - * inf.side_distances[i] = 0 - * t = x[i]-self.raw_maxes[i] # <<<<<<<<<<<<<< - * if t>inf.side_distances[i]: - * inf.side_distances[i] = t - */ - __pyx_v_t = ((__pyx_v_x[__pyx_v_i]) - (__pyx_v_self->raw_maxes[__pyx_v_i])); - - /* "yt/utilities/spatial/ckdtree.pyx":426 - * inf.side_distances[i] = 0 - * t = x[i]-self.raw_maxes[i] - * if t>inf.side_distances[i]: # <<<<<<<<<<<<<< - * inf.side_distances[i] = t - * else: - */ - __pyx_t_5 = ((__pyx_v_t > (__pyx_v_inf->side_distances[__pyx_v_i])) != 0); - if (__pyx_t_5) { - - /* "yt/utilities/spatial/ckdtree.pyx":427 - * t = x[i]-self.raw_maxes[i] - * if t>inf.side_distances[i]: - * inf.side_distances[i] = t # <<<<<<<<<<<<<< - * else: - * t = self.raw_mins[i]-x[i] - */ - (__pyx_v_inf->side_distances[__pyx_v_i]) = __pyx_v_t; - - /* "yt/utilities/spatial/ckdtree.pyx":426 - * inf.side_distances[i] = 0 - * t = x[i]-self.raw_maxes[i] - * if t>inf.side_distances[i]: # <<<<<<<<<<<<<< - * inf.side_distances[i] = t - * else: - */ - goto __pyx_L5; - } - - /* "yt/utilities/spatial/ckdtree.pyx":429 - * inf.side_distances[i] = t - * else: - * t = self.raw_mins[i]-x[i] # <<<<<<<<<<<<<< - * if t>inf.side_distances[i]: - * inf.side_distances[i] = t - */ - /*else*/ { - __pyx_v_t = ((__pyx_v_self->raw_mins[__pyx_v_i]) - (__pyx_v_x[__pyx_v_i])); - - /* "yt/utilities/spatial/ckdtree.pyx":430 - * else: - * t = self.raw_mins[i]-x[i] - * if t>inf.side_distances[i]: # <<<<<<<<<<<<<< - * inf.side_distances[i] = t - * inf.side_distances[i]=inf.side_distances[i]*inf.side_distances[i] - */ - __pyx_t_5 = ((__pyx_v_t > (__pyx_v_inf->side_distances[__pyx_v_i])) != 0); - if (__pyx_t_5) { - - /* "yt/utilities/spatial/ckdtree.pyx":431 - * t = self.raw_mins[i]-x[i] - * if t>inf.side_distances[i]: - * inf.side_distances[i] = t # <<<<<<<<<<<<<< - * inf.side_distances[i]=inf.side_distances[i]*inf.side_distances[i] - * - */ - (__pyx_v_inf->side_distances[__pyx_v_i]) = __pyx_v_t; - - /* "yt/utilities/spatial/ckdtree.pyx":430 - * else: - * t = self.raw_mins[i]-x[i] - * if t>inf.side_distances[i]: # <<<<<<<<<<<<<< - * inf.side_distances[i] = t - * inf.side_distances[i]=inf.side_distances[i]*inf.side_distances[i] - */ - } - } - __pyx_L5:; - - /* "yt/utilities/spatial/ckdtree.pyx":432 - * if t>inf.side_distances[i]: - * inf.side_distances[i] = t - * inf.side_distances[i]=inf.side_distances[i]*inf.side_distances[i] # <<<<<<<<<<<<<< - * - * # compute first distance - */ - (__pyx_v_inf->side_distances[__pyx_v_i]) = ((__pyx_v_inf->side_distances[__pyx_v_i]) * (__pyx_v_inf->side_distances[__pyx_v_i])); - } - - /* "yt/utilities/spatial/ckdtree.pyx":435 - * - * # compute first distance - * min_distance = 0. # <<<<<<<<<<<<<< - * for i in range(self.m): - * min_distance += inf.side_distances[i] - */ - __pyx_v_min_distance = 0.; - - /* "yt/utilities/spatial/ckdtree.pyx":436 - * # compute first distance - * min_distance = 0. - * for i in range(self.m): # <<<<<<<<<<<<<< - * min_distance += inf.side_distances[i] - * - */ - __pyx_t_3 = __pyx_v_self->m; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "yt/utilities/spatial/ckdtree.pyx":437 - * min_distance = 0. - * for i in range(self.m): - * min_distance += inf.side_distances[i] # <<<<<<<<<<<<<< - * - * # fiddle approximation factor - */ - __pyx_v_min_distance = (__pyx_v_min_distance + (__pyx_v_inf->side_distances[__pyx_v_i])); - } - - /* "yt/utilities/spatial/ckdtree.pyx":440 - * - * # fiddle approximation factor - * epsfac=1 # <<<<<<<<<<<<<< - * - * while True: - */ - __pyx_v_epsfac = 1.0; - - /* "yt/utilities/spatial/ckdtree.pyx":442 - * epsfac=1 - * - * while True: # <<<<<<<<<<<<<< - * if inf.node.split_dim==-1: - * node = inf.node - */ - while (1) { - - /* "yt/utilities/spatial/ckdtree.pyx":443 - * - * while True: - * if inf.node.split_dim==-1: # <<<<<<<<<<<<<< - * node = inf.node - * - */ - __pyx_t_5 = ((__pyx_v_inf->node->split_dim == -1L) != 0); - if (__pyx_t_5) { - - /* "yt/utilities/spatial/ckdtree.pyx":444 - * while True: - * if inf.node.split_dim==-1: - * node = inf.node # <<<<<<<<<<<<<< - * - * # brute-force - */ - __pyx_v_node = ((struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_leafnode *)__pyx_v_inf->node); - - /* "yt/utilities/spatial/ckdtree.pyx":447 - * - * # brute-force - * for i in range(node.start_idx,node.end_idx): # <<<<<<<<<<<<<< - * d = 0.0 - * for i2 in range(self.m): - */ - __pyx_t_3 = __pyx_v_node->end_idx; - for (__pyx_t_4 = __pyx_v_node->start_idx; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "yt/utilities/spatial/ckdtree.pyx":448 - * # brute-force - * for i in range(node.start_idx,node.end_idx): - * d = 0.0 # <<<<<<<<<<<<<< - * for i2 in range(self.m): - * y = self.raw_data[self.raw_indices[i]*self.m + i2] - */ - __pyx_v_d = 0.0; - - /* "yt/utilities/spatial/ckdtree.pyx":449 - * for i in range(node.start_idx,node.end_idx): - * d = 0.0 - * for i2 in range(self.m): # <<<<<<<<<<<<<< - * y = self.raw_data[self.raw_indices[i]*self.m + i2] - * di = dmin(dabs(x[i2] - y), period[i2] - dabs(x[i2] - y)) - */ - __pyx_t_6 = __pyx_v_self->m; - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_i2 = __pyx_t_7; - - /* "yt/utilities/spatial/ckdtree.pyx":450 - * d = 0.0 - * for i2 in range(self.m): - * y = self.raw_data[self.raw_indices[i]*self.m + i2] # <<<<<<<<<<<<<< - * di = dmin(dabs(x[i2] - y), period[i2] - dabs(x[i2] - y)) - * d += di*di - */ - __pyx_v_y = (__pyx_v_self->raw_data[(((__pyx_v_self->raw_indices[__pyx_v_i]) * __pyx_v_self->m) + __pyx_v_i2)]); - - /* "yt/utilities/spatial/ckdtree.pyx":451 - * for i2 in range(self.m): - * y = self.raw_data[self.raw_indices[i]*self.m + i2] - * di = dmin(dabs(x[i2] - y), period[i2] - dabs(x[i2] - y)) # <<<<<<<<<<<<<< - * d += di*di - * if draw_indices[__pyx_v_i]); - - /* "yt/utilities/spatial/ckdtree.pyx":459 - * neighbor.priority = -d - * neighbor.contents.intdata = self.raw_indices[i] - * heappush(&neighbors,neighbor) # <<<<<<<<<<<<<< - * - * # adjust upper bound for efficiency - */ - __pyx_t_1 = __pyx_f_2yt_9utilities_7spatial_7ckdtree_heappush((&__pyx_v_neighbors), __pyx_v_neighbor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":462 - * - * # adjust upper bound for efficiency - * if neighbors.n==k: # <<<<<<<<<<<<<< - * distance_upper_bound = -heappeek(&neighbors).priority - * # done with this node, get another - */ - __pyx_t_5 = ((__pyx_v_neighbors.n == __pyx_v_k) != 0); - if (__pyx_t_5) { - - /* "yt/utilities/spatial/ckdtree.pyx":463 - * # adjust upper bound for efficiency - * if neighbors.n==k: - * distance_upper_bound = -heappeek(&neighbors).priority # <<<<<<<<<<<<<< - * # done with this node, get another - * stdlib.free(inf) - */ - __pyx_v_distance_upper_bound = (-__pyx_f_2yt_9utilities_7spatial_7ckdtree_heappeek((&__pyx_v_neighbors)).priority); - - /* "yt/utilities/spatial/ckdtree.pyx":462 - * - * # adjust upper bound for efficiency - * if neighbors.n==k: # <<<<<<<<<<<<<< - * distance_upper_bound = -heappeek(&neighbors).priority - * # done with this node, get another - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":453 - * di = dmin(dabs(x[i2] - y), period[i2] - dabs(x[i2] - y)) - * d += di*di - * if dit.contents.ptrdata - * min_distance = it.priority - */ - /*else*/ { - __pyx_v_it = __pyx_f_2yt_9utilities_7spatial_7ckdtree_heappop((&__pyx_v_q)); - - /* "yt/utilities/spatial/ckdtree.pyx":471 - * else: - * it = heappop(&q) - * inf = it.contents.ptrdata # <<<<<<<<<<<<<< - * min_distance = it.priority - * else: - */ - __pyx_v_inf = ((struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_nodeinfo *)__pyx_v_it.contents.ptrdata); - - /* "yt/utilities/spatial/ckdtree.pyx":472 - * it = heappop(&q) - * inf = it.contents.ptrdata - * min_distance = it.priority # <<<<<<<<<<<<<< - * else: - * inode = inf.node - */ - __pyx_t_8 = __pyx_v_it.priority; - __pyx_v_min_distance = __pyx_t_8; - } - - /* "yt/utilities/spatial/ckdtree.pyx":443 - * - * while True: - * if inf.node.split_dim==-1: # <<<<<<<<<<<<<< - * node = inf.node - * - */ - goto __pyx_L11; - } - - /* "yt/utilities/spatial/ckdtree.pyx":474 - * min_distance = it.priority - * else: - * inode = inf.node # <<<<<<<<<<<<<< - * - * # we don't push cells that are too far onto the queue at all, - */ - /*else*/ { - __pyx_v_inode = ((struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *)__pyx_v_inf->node); - - /* "yt/utilities/spatial/ckdtree.pyx":479 - * # but since the distance_upper_bound decreases, we might get - * # here even if the cell's too far - * if min_distance>distance_upper_bound*epsfac: # <<<<<<<<<<<<<< - * # since this is the nearest cell, we're done, bail out - * stdlib.free(inf) - */ - __pyx_t_5 = ((__pyx_v_min_distance > (__pyx_v_distance_upper_bound * __pyx_v_epsfac)) != 0); - if (__pyx_t_5) { - - /* "yt/utilities/spatial/ckdtree.pyx":481 - * if min_distance>distance_upper_bound*epsfac: - * # since this is the nearest cell, we're done, bail out - * stdlib.free(inf) # <<<<<<<<<<<<<< - * # free all the nodes still on the heap - * for i in range(q.n): - */ - free(__pyx_v_inf); - - /* "yt/utilities/spatial/ckdtree.pyx":483 - * stdlib.free(inf) - * # free all the nodes still on the heap - * for i in range(q.n): # <<<<<<<<<<<<<< - * stdlib.free(q.heap[i].contents.ptrdata) - * break - */ - __pyx_t_3 = __pyx_v_q.n; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "yt/utilities/spatial/ckdtree.pyx":484 - * # free all the nodes still on the heap - * for i in range(q.n): - * stdlib.free(q.heap[i].contents.ptrdata) # <<<<<<<<<<<<<< - * break - * - */ - free((__pyx_v_q.heap[__pyx_v_i]).contents.ptrdata); - } - - /* "yt/utilities/spatial/ckdtree.pyx":485 - * for i in range(q.n): - * stdlib.free(q.heap[i].contents.ptrdata) - * break # <<<<<<<<<<<<<< - * - * # set up children for searching - */ - goto __pyx_L10_break; - - /* "yt/utilities/spatial/ckdtree.pyx":479 - * # but since the distance_upper_bound decreases, we might get - * # here even if the cell's too far - * if min_distance>distance_upper_bound*epsfac: # <<<<<<<<<<<<<< - * # since this is the nearest cell, we're done, bail out - * stdlib.free(inf) - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":488 - * - * # set up children for searching - * if x[inode.split_dim]split_dim]) < __pyx_v_inode->split) != 0); - if (__pyx_t_5) { - - /* "yt/utilities/spatial/ckdtree.pyx":489 - * # set up children for searching - * if x[inode.split_dim]less; - __pyx_v_near = __pyx_t_2; - - /* "yt/utilities/spatial/ckdtree.pyx":490 - * if x[inode.split_dim]greater; - __pyx_v_far = __pyx_t_2; - - /* "yt/utilities/spatial/ckdtree.pyx":488 - * - * # set up children for searching - * if x[inode.split_dim]greater; - __pyx_v_near = __pyx_t_2; - - /* "yt/utilities/spatial/ckdtree.pyx":493 - * else: - * near = inode.greater - * far = inode.less # <<<<<<<<<<<<<< - * - * # near child is at the same distance as the current node - */ - __pyx_t_2 = __pyx_v_inode->less; - __pyx_v_far = __pyx_t_2; - } - __pyx_L23:; - - /* "yt/utilities/spatial/ckdtree.pyx":498 - * # we're going here next, so no point pushing it on the queue - * # no need to recompute the distance or the side_distances - * inf.node = near # <<<<<<<<<<<<<< - * - * # far child is further by an amount depending only - */ - __pyx_v_inf->node = __pyx_v_near; - - /* "yt/utilities/spatial/ckdtree.pyx":503 - * # on the split value; compute its distance and side_distances - * # and push it on the queue if it's near enough - * inf2 = stdlib.malloc(sizeof(nodeinfo)+self.m*sizeof(np.float64_t)) # <<<<<<<<<<<<<< - * it2.contents.ptrdata = inf2 - * inf2.node = far - */ - __pyx_v_inf2 = ((struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_nodeinfo *)malloc(((sizeof(struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_nodeinfo)) + (__pyx_v_self->m * (sizeof(__pyx_t_5numpy_float64_t)))))); - - /* "yt/utilities/spatial/ckdtree.pyx":504 - * # and push it on the queue if it's near enough - * inf2 = stdlib.malloc(sizeof(nodeinfo)+self.m*sizeof(np.float64_t)) - * it2.contents.ptrdata = inf2 # <<<<<<<<<<<<<< - * inf2.node = far - * - */ - __pyx_v_it2.contents.ptrdata = ((char *)__pyx_v_inf2); - - /* "yt/utilities/spatial/ckdtree.pyx":505 - * inf2 = stdlib.malloc(sizeof(nodeinfo)+self.m*sizeof(np.float64_t)) - * it2.contents.ptrdata = inf2 - * inf2.node = far # <<<<<<<<<<<<<< - * - * # Periodicity added by S Skory - */ - __pyx_v_inf2->node = __pyx_v_far; - - /* "yt/utilities/spatial/ckdtree.pyx":508 - * - * # Periodicity added by S Skory - * m_left = dmin( dabs(far.mins[inode.split_dim] - x[inode.split_dim]), \ # <<<<<<<<<<<<<< - * period[inode.split_dim] - dabs(far.mins[inode.split_dim] - x[inode.split_dim])) - * m_right = dmin( dabs(far.maxes[inode.split_dim] - x[inode.split_dim]), \ - */ - __pyx_v_m_left = __pyx_f_2yt_9utilities_7spatial_7ckdtree_dmin(__pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(((__pyx_v_far->mins[__pyx_v_inode->split_dim]) - (__pyx_v_x[__pyx_v_inode->split_dim]))), ((__pyx_v_period[__pyx_v_inode->split_dim]) - __pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(((__pyx_v_far->mins[__pyx_v_inode->split_dim]) - (__pyx_v_x[__pyx_v_inode->split_dim]))))); - - /* "yt/utilities/spatial/ckdtree.pyx":510 - * m_left = dmin( dabs(far.mins[inode.split_dim] - x[inode.split_dim]), \ - * period[inode.split_dim] - dabs(far.mins[inode.split_dim] - x[inode.split_dim])) - * m_right = dmin( dabs(far.maxes[inode.split_dim] - x[inode.split_dim]), \ # <<<<<<<<<<<<<< - * period[inode.split_dim] - dabs(far.maxes[inode.split_dim] - x[inode.split_dim])) - * m = dmin(m_left,m_right) - */ - __pyx_v_m_right = __pyx_f_2yt_9utilities_7spatial_7ckdtree_dmin(__pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(((__pyx_v_far->maxes[__pyx_v_inode->split_dim]) - (__pyx_v_x[__pyx_v_inode->split_dim]))), ((__pyx_v_period[__pyx_v_inode->split_dim]) - __pyx_f_2yt_9utilities_7spatial_7ckdtree_dabs(((__pyx_v_far->maxes[__pyx_v_inode->split_dim]) - (__pyx_v_x[__pyx_v_inode->split_dim]))))); - - /* "yt/utilities/spatial/ckdtree.pyx":512 - * m_right = dmin( dabs(far.maxes[inode.split_dim] - x[inode.split_dim]), \ - * period[inode.split_dim] - dabs(far.maxes[inode.split_dim] - x[inode.split_dim])) - * m = dmin(m_left,m_right) # <<<<<<<<<<<<<< - * - * # most side distances unchanged - */ - __pyx_v_m = __pyx_f_2yt_9utilities_7spatial_7ckdtree_dmin(__pyx_v_m_left, __pyx_v_m_right); - - /* "yt/utilities/spatial/ckdtree.pyx":515 - * - * # most side distances unchanged - * for i in range(self.m): # <<<<<<<<<<<<<< - * inf2.side_distances[i] = inf.side_distances[i] - * - */ - __pyx_t_3 = __pyx_v_self->m; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "yt/utilities/spatial/ckdtree.pyx":516 - * # most side distances unchanged - * for i in range(self.m): - * inf2.side_distances[i] = inf.side_distances[i] # <<<<<<<<<<<<<< - * - * # one side distance changes - */ - (__pyx_v_inf2->side_distances[__pyx_v_i]) = (__pyx_v_inf->side_distances[__pyx_v_i]); - } - - /* "yt/utilities/spatial/ckdtree.pyx":520 - * # one side distance changes - * # we can adjust the minimum distance without recomputing - * inf2.side_distances[inode.split_dim] = m*m # <<<<<<<<<<<<<< - * #far_min_distance = min_distance - inf.side_distances[inode.split_dim] + inf2.side_distances[inode.split_dim] - * far_min_distance = m*m - */ - (__pyx_v_inf2->side_distances[__pyx_v_inode->split_dim]) = (__pyx_v_m * __pyx_v_m); - - /* "yt/utilities/spatial/ckdtree.pyx":522 - * inf2.side_distances[inode.split_dim] = m*m - * #far_min_distance = min_distance - inf.side_distances[inode.split_dim] + inf2.side_distances[inode.split_dim] - * far_min_distance = m*m # <<<<<<<<<<<<<< - * - * it2.priority = far_min_distance - */ - __pyx_v_far_min_distance = (__pyx_v_m * __pyx_v_m); - - /* "yt/utilities/spatial/ckdtree.pyx":524 - * far_min_distance = m*m - * - * it2.priority = far_min_distance # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_it2.priority = __pyx_v_far_min_distance; - - /* "yt/utilities/spatial/ckdtree.pyx":528 - * - * # far child might be too far, if so, don't bother pushing it - * if far_min_distance<=distance_upper_bound*epsfac: # <<<<<<<<<<<<<< - * heappush(&q,it2) - * else: - */ - __pyx_t_5 = ((__pyx_v_far_min_distance <= (__pyx_v_distance_upper_bound * __pyx_v_epsfac)) != 0); - if (__pyx_t_5) { - - /* "yt/utilities/spatial/ckdtree.pyx":529 - * # far child might be too far, if so, don't bother pushing it - * if far_min_distance<=distance_upper_bound*epsfac: - * heappush(&q,it2) # <<<<<<<<<<<<<< - * else: - * stdlib.free(inf2) - */ - __pyx_t_1 = __pyx_f_2yt_9utilities_7spatial_7ckdtree_heappush((&__pyx_v_q), __pyx_v_it2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":528 - * - * # far child might be too far, if so, don't bother pushing it - * if far_min_distance<=distance_upper_bound*epsfac: # <<<<<<<<<<<<<< - * heappush(&q,it2) - * else: - */ - goto __pyx_L26; - } - - /* "yt/utilities/spatial/ckdtree.pyx":531 - * heappush(&q,it2) - * else: - * stdlib.free(inf2) # <<<<<<<<<<<<<< - * # just in case - * it2.contents.ptrdata = 0 - */ - /*else*/ { - free(__pyx_v_inf2); - - /* "yt/utilities/spatial/ckdtree.pyx":533 - * stdlib.free(inf2) - * # just in case - * it2.contents.ptrdata = 0 # <<<<<<<<<<<<<< - * - * # fill output arrays with sorted neighbors - */ - __pyx_v_it2.contents.ptrdata = ((char *)0); - } - __pyx_L26:; - } - __pyx_L11:; - } - __pyx_L10_break:; - - /* "yt/utilities/spatial/ckdtree.pyx":536 - * - * # fill output arrays with sorted neighbors - * for i in range(neighbors.n-1,-1,-1): # <<<<<<<<<<<<<< - * neighbor = heappop(&neighbors) # FIXME: neighbors may be realloced - * result_indices[i] = neighbor.contents.intdata - */ - for (__pyx_t_3 = (__pyx_v_neighbors.n - 1); __pyx_t_3 > -1L; __pyx_t_3-=1) { - __pyx_v_i = __pyx_t_3; - - /* "yt/utilities/spatial/ckdtree.pyx":537 - * # fill output arrays with sorted neighbors - * for i in range(neighbors.n-1,-1,-1): - * neighbor = heappop(&neighbors) # FIXME: neighbors may be realloced # <<<<<<<<<<<<<< - * result_indices[i] = neighbor.contents.intdata - * result_distances[i] = (-neighbor.priority) #**(1./p) S. Skory - */ - __pyx_v_neighbor = __pyx_f_2yt_9utilities_7spatial_7ckdtree_heappop((&__pyx_v_neighbors)); - - /* "yt/utilities/spatial/ckdtree.pyx":538 - * for i in range(neighbors.n-1,-1,-1): - * neighbor = heappop(&neighbors) # FIXME: neighbors may be realloced - * result_indices[i] = neighbor.contents.intdata # <<<<<<<<<<<<<< - * result_distances[i] = (-neighbor.priority) #**(1./p) S. Skory - * - */ - __pyx_t_4 = __pyx_v_neighbor.contents.intdata; - (__pyx_v_result_indices[__pyx_v_i]) = __pyx_t_4; - - /* "yt/utilities/spatial/ckdtree.pyx":539 - * neighbor = heappop(&neighbors) # FIXME: neighbors may be realloced - * result_indices[i] = neighbor.contents.intdata - * result_distances[i] = (-neighbor.priority) #**(1./p) S. Skory # <<<<<<<<<<<<<< - * - * heapdestroy(&q) - */ - (__pyx_v_result_distances[__pyx_v_i]) = (-__pyx_v_neighbor.priority); - } - - /* "yt/utilities/spatial/ckdtree.pyx":541 - * result_distances[i] = (-neighbor.priority) #**(1./p) S. Skory - * - * heapdestroy(&q) # <<<<<<<<<<<<<< - * heapdestroy(&neighbors) - * - */ - __pyx_t_1 = __pyx_f_2yt_9utilities_7spatial_7ckdtree_heapdestroy((&__pyx_v_q)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":542 - * - * heapdestroy(&q) - * heapdestroy(&neighbors) # <<<<<<<<<<<<<< - * - * def query(cKDTree self, object x, int k=1, np.float64_t eps=0, np.float64_t p=2, - */ - __pyx_t_1 = __pyx_f_2yt_9utilities_7spatial_7ckdtree_heapdestroy((&__pyx_v_neighbors)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":377 - * self.__free_tree(self.tree) - * - * cdef void __query(cKDTree self, # <<<<<<<<<<<<<< - * np.float64_t*result_distances, - * np.int64_t*result_indices, - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_WriteUnraisable("yt.utilities.spatial.ckdtree.cKDTree.__query", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_L0:; - __Pyx_RefNannyFinishContext(); -} - -/* "yt/utilities/spatial/ckdtree.pyx":544 - * heapdestroy(&neighbors) - * - * def query(cKDTree self, object x, int k=1, np.float64_t eps=0, np.float64_t p=2, # <<<<<<<<<<<<<< - * np.float64_t distance_upper_bound=infinity, object period=None): - * """query(self, x, k=1, eps=0, p=2, distance_upper_bound=np.inf, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_5query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4query[] = "query(self, x, k=1, eps=0, p=2, distance_upper_bound=np.inf,\n period=None)\n\n Query the kd-tree for nearest neighbors.\n\n Parameters\n ----------\n x : array_like, last dimension self.m\n An array of points to query.\n k : int\n The number of nearest neighbors to return.\n eps : non-negative float\n Return approximate nearest neighbors; the k-th returned value\n is guaranteed to be no further than (1 + `eps`) times the\n distance to the real k-th nearest neighbor.\n p : float, 1 <= p <= infinity\n Which Minkowski p-norm to use.\n 1 is the sum-of-absolute-values \"Manhattan\" distance.\n 2 is the usual Euclidean distance.\n infinity is the maximum-coordinate-difference distance.\n distance_upper_bound : non-negative float\n Return only neighbors within this distance. This is used to prune\n tree searches, so if you are doing a series of nearest-neighbor\n queries, it may help to supply the distance to the nearest neighbor\n of the most recent point.\n\n Returns\n -------\n d : ndarray of floats\n The distances to the nearest neighbors.\n If `x` has shape tuple+(self.m,), then `d` has shape tuple+(k,).\n Missing neighbors are indicated with infinite distances.\n i : ndarray of ints\n The locations of the neighbors in self.data.\n If `x` has shape tuple+(self.m,), then `i` has shape tuple+(k,).\n Missing neighbors are indicated with self.n.\n\n "; -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_5query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_x = 0; - int __pyx_v_k; - __pyx_t_5numpy_float64_t __pyx_v_eps; - __pyx_t_5numpy_float64_t __pyx_v_p; - __pyx_t_5numpy_float64_t __pyx_v_distance_upper_bound; - PyObject *__pyx_v_period = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("query (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_k,&__pyx_n_s_eps,&__pyx_n_s_p,&__pyx_n_s_distance_upper_bound,&__pyx_n_s_period,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - - /* "yt/utilities/spatial/ckdtree.pyx":545 - * - * def query(cKDTree self, object x, int k=1, np.float64_t eps=0, np.float64_t p=2, - * np.float64_t distance_upper_bound=infinity, object period=None): # <<<<<<<<<<<<<< - * """query(self, x, k=1, eps=0, p=2, distance_upper_bound=np.inf, - * period=None) - */ - values[5] = ((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 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_eps); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_distance_upper_bound); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_period); - if (value) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "query") < 0)) __PYX_ERR(0, 544, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_x = values[0]; - if (values[1]) { - __pyx_v_k = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 544, __pyx_L3_error) - } else { - __pyx_v_k = ((int)1); - } - if (values[2]) { - __pyx_v_eps = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 544, __pyx_L3_error) - } else { - __pyx_v_eps = ((__pyx_t_5numpy_float64_t)0.0); - } - if (values[3]) { - __pyx_v_p = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_p == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 544, __pyx_L3_error) - } else { - __pyx_v_p = ((__pyx_t_5numpy_float64_t)2.0); - } - if (values[4]) { - __pyx_v_distance_upper_bound = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_distance_upper_bound == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L3_error) - } else { - __pyx_v_distance_upper_bound = __pyx_k__2; - } - __pyx_v_period = values[5]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("query", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 544, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.cKDTree.query", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4query(((struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self), __pyx_v_x, __pyx_v_k, __pyx_v_eps, __pyx_v_p, __pyx_v_distance_upper_bound, __pyx_v_period); - - /* "yt/utilities/spatial/ckdtree.pyx":544 - * heapdestroy(&neighbors) - * - * def query(cKDTree self, object x, int k=1, np.float64_t eps=0, np.float64_t p=2, # <<<<<<<<<<<<<< - * np.float64_t distance_upper_bound=infinity, object period=None): - * """query(self, x, k=1, eps=0, p=2, distance_upper_bound=np.inf, - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4query(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_x, int __pyx_v_k, __pyx_t_5numpy_float64_t __pyx_v_eps, __pyx_t_5numpy_float64_t __pyx_v_p, __pyx_t_5numpy_float64_t __pyx_v_distance_upper_bound, PyObject *__pyx_v_period) { - PyArrayObject *__pyx_v_ii = 0; - PyArrayObject *__pyx_v_dd = 0; - PyArrayObject *__pyx_v_xx = 0; - PyArrayObject *__pyx_v_cperiod = 0; - int __pyx_v_c; - int __pyx_v_single; - PyObject *__pyx_v_retshape = NULL; - PyObject *__pyx_v_n = NULL; - __Pyx_LocalBuf_ND __pyx_pybuffernd_cperiod; - __Pyx_Buffer __pyx_pybuffer_cperiod; - __Pyx_LocalBuf_ND __pyx_pybuffernd_dd; - __Pyx_Buffer __pyx_pybuffer_dd; - __Pyx_LocalBuf_ND __pyx_pybuffernd_ii; - __Pyx_Buffer __pyx_pybuffer_ii; - __Pyx_LocalBuf_ND __pyx_pybuffernd_xx; - __Pyx_Buffer __pyx_pybuffer_xx; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyArrayObject *__pyx_t_8 = NULL; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - Py_ssize_t __pyx_t_13; - PyArrayObject *__pyx_t_14 = NULL; - PyArrayObject *__pyx_t_15 = NULL; - PyArrayObject *__pyx_t_16 = NULL; - long __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; - PyObject *__pyx_t_22 = NULL; - __Pyx_RefNannySetupContext("query", 0); - __Pyx_INCREF(__pyx_v_x); - __Pyx_INCREF(__pyx_v_period); - __pyx_pybuffer_ii.pybuffer.buf = NULL; - __pyx_pybuffer_ii.refcount = 0; - __pyx_pybuffernd_ii.data = NULL; - __pyx_pybuffernd_ii.rcbuffer = &__pyx_pybuffer_ii; - __pyx_pybuffer_dd.pybuffer.buf = NULL; - __pyx_pybuffer_dd.refcount = 0; - __pyx_pybuffernd_dd.data = NULL; - __pyx_pybuffernd_dd.rcbuffer = &__pyx_pybuffer_dd; - __pyx_pybuffer_xx.pybuffer.buf = NULL; - __pyx_pybuffer_xx.refcount = 0; - __pyx_pybuffernd_xx.data = NULL; - __pyx_pybuffernd_xx.rcbuffer = &__pyx_pybuffer_xx; - __pyx_pybuffer_cperiod.pybuffer.buf = NULL; - __pyx_pybuffer_cperiod.refcount = 0; - __pyx_pybuffernd_cperiod.data = NULL; - __pyx_pybuffernd_cperiod.rcbuffer = &__pyx_pybuffer_cperiod; - - /* "yt/utilities/spatial/ckdtree.pyx":589 - * cdef np.ndarray[np.float64_t, ndim=1] cperiod - * cdef int c - * x = np.asarray(x).astype("float64") # <<<<<<<<<<<<<< - * if period is None: - * period = np.array([np.inf]*self.m) - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __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, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __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_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __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_2, __pyx_v_x}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_x}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else - #endif - { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_v_x); - __Pyx_GIVEREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_x); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1); - __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":590 - * cdef int c - * x = np.asarray(x).astype("float64") - * if period is None: # <<<<<<<<<<<<<< - * period = np.array([np.inf]*self.m) - * else: - */ - __pyx_t_5 = (__pyx_v_period == Py_None); - __pyx_t_6 = (__pyx_t_5 != 0); - if (__pyx_t_6) { - - /* "yt/utilities/spatial/ckdtree.pyx":591 - * x = np.asarray(x).astype("float64") - * if period is None: - * period = np.array([np.inf]*self.m) # <<<<<<<<<<<<<< - * else: - * period = np.asarray(period).astype("float64") - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(1 * ((__pyx_v_self->m<0) ? 0:__pyx_v_self->m)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - { Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < __pyx_v_self->m; __pyx_temp++) { - __Pyx_INCREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_t_2); - } - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __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_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __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_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __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_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_period, __pyx_t_1); - __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":590 - * cdef int c - * x = np.asarray(x).astype("float64") - * if period is None: # <<<<<<<<<<<<<< - * period = np.array([np.inf]*self.m) - * else: - */ - goto __pyx_L3; - } - - /* "yt/utilities/spatial/ckdtree.pyx":593 - * period = np.array([np.inf]*self.m) - * else: - * period = np.asarray(period).astype("float64") # <<<<<<<<<<<<<< - * cperiod = np.ascontiguousarray(period) - * if np.shape(x)[-1] != self.m: - */ - /*else*/ { - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - } - } - if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_period); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_7)) { - PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_period}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { - PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_period}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else - #endif - { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_v_period); - __Pyx_GIVEREF(__pyx_v_period); - PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_period); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_period, __pyx_t_1); - __pyx_t_1 = 0; - } - __pyx_L3:; - - /* "yt/utilities/spatial/ckdtree.pyx":594 - * else: - * period = np.asarray(period).astype("float64") - * cperiod = np.ascontiguousarray(period) # <<<<<<<<<<<<<< - * if np.shape(x)[-1] != self.m: - * raise ValueError("x must consist of vectors of length %d but has shape %s" % (self.m, np.shape(x))) - */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_7) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_period); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __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_7, __pyx_v_period}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_period}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else - #endif - { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_v_period); - __Pyx_GIVEREF(__pyx_v_period); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_period); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_8 = ((PyArrayObject *)__pyx_t_1); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cperiod.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cperiod.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cperiod.rcbuffer->pybuffer, (PyObject*)__pyx_v_cperiod, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); - } - } - __pyx_pybuffernd_cperiod.diminfo[0].strides = __pyx_pybuffernd_cperiod.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cperiod.diminfo[0].shape = __pyx_pybuffernd_cperiod.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 594, __pyx_L1_error) - } - __pyx_t_8 = 0; - __pyx_v_cperiod = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":595 - * period = np.asarray(period).astype("float64") - * cperiod = np.ascontiguousarray(period) - * if np.shape(x)[-1] != self.m: # <<<<<<<<<<<<<< - * raise ValueError("x must consist of vectors of length %d but has shape %s" % (self.m, np.shape(x))) - * if p<1: - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_x}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_x}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else - #endif - { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_v_x); - __Pyx_GIVEREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_x); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_6) { - - /* "yt/utilities/spatial/ckdtree.pyx":596 - * cperiod = np.ascontiguousarray(period) - * if np.shape(x)[-1] != self.m: - * raise ValueError("x must consist of vectors of length %d but has shape %s" % (self.m, np.shape(x))) # <<<<<<<<<<<<<< - * if p<1: - * raise ValueError("Only p-norms with 1<=p<=infinity permitted") - */ - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->m); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __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_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __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_x}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_x}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __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, 596, __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_x); - __Pyx_GIVEREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_x); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); - __pyx_t_7 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_x_must_consist_of_vectors_of_len, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __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_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __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(0, 596, __pyx_L1_error) - - /* "yt/utilities/spatial/ckdtree.pyx":595 - * period = np.asarray(period).astype("float64") - * cperiod = np.ascontiguousarray(period) - * if np.shape(x)[-1] != self.m: # <<<<<<<<<<<<<< - * raise ValueError("x must consist of vectors of length %d but has shape %s" % (self.m, np.shape(x))) - * if p<1: - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":597 - * if np.shape(x)[-1] != self.m: - * raise ValueError("x must consist of vectors of length %d but has shape %s" % (self.m, np.shape(x))) - * if p<1: # <<<<<<<<<<<<<< - * raise ValueError("Only p-norms with 1<=p<=infinity permitted") - * if len(x.shape)==1: - */ - __pyx_t_6 = ((__pyx_v_p < 1.0) != 0); - if (__pyx_t_6) { - - /* "yt/utilities/spatial/ckdtree.pyx":598 - * raise ValueError("x must consist of vectors of length %d but has shape %s" % (self.m, np.shape(x))) - * if p<1: - * raise ValueError("Only p-norms with 1<=p<=infinity permitted") # <<<<<<<<<<<<<< - * if len(x.shape)==1: - * single = True - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 598, __pyx_L1_error) - - /* "yt/utilities/spatial/ckdtree.pyx":597 - * if np.shape(x)[-1] != self.m: - * raise ValueError("x must consist of vectors of length %d but has shape %s" % (self.m, np.shape(x))) - * if p<1: # <<<<<<<<<<<<<< - * raise ValueError("Only p-norms with 1<=p<=infinity permitted") - * if len(x.shape)==1: - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":599 - * if p<1: - * raise ValueError("Only p-norms with 1<=p<=infinity permitted") - * if len(x.shape)==1: # <<<<<<<<<<<<<< - * single = True - * x = x[np.newaxis,:] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 599, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = ((__pyx_t_13 == 1) != 0); - if (__pyx_t_6) { - - /* "yt/utilities/spatial/ckdtree.pyx":600 - * raise ValueError("Only p-norms with 1<=p<=infinity permitted") - * if len(x.shape)==1: - * single = True # <<<<<<<<<<<<<< - * x = x[np.newaxis,:] - * else: - */ - __pyx_v_single = 1; - - /* "yt/utilities/spatial/ckdtree.pyx":601 - * if len(x.shape)==1: - * single = True - * x = x[np.newaxis,:] # <<<<<<<<<<<<<< - * else: - * single = False - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_INCREF(__pyx_slice__6); - __Pyx_GIVEREF(__pyx_slice__6); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__6); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(__pyx_v_x, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3); - __pyx_t_3 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":599 - * if p<1: - * raise ValueError("Only p-norms with 1<=p<=infinity permitted") - * if len(x.shape)==1: # <<<<<<<<<<<<<< - * single = True - * x = x[np.newaxis,:] - */ - goto __pyx_L6; - } - - /* "yt/utilities/spatial/ckdtree.pyx":603 - * x = x[np.newaxis,:] - * else: - * single = False # <<<<<<<<<<<<<< - * retshape = np.shape(x)[:-1] - * n = np.prod(retshape) - */ - /*else*/ { - __pyx_v_single = 0; - } - __pyx_L6:; - - /* "yt/utilities/spatial/ckdtree.pyx":604 - * else: - * single = False - * retshape = np.shape(x)[:-1] # <<<<<<<<<<<<<< - * n = np.prod(retshape) - * xx = np.reshape(x,(n,self.m)) - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - } - } - if (!__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_7)) { - PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_x}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_3); - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { - PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_x}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_3); - } else - #endif - { - __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __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 = NULL; - __Pyx_INCREF(__pyx_v_x); - __Pyx_GIVEREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_x); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, -1L, NULL, NULL, &__pyx_slice__7, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_retshape = __pyx_t_7; - __pyx_t_7 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":605 - * single = False - * retshape = np.shape(x)[:-1] - * n = np.prod(retshape) # <<<<<<<<<<<<<< - * xx = np.reshape(x,(n,self.m)) - * xx = np.ascontiguousarray(xx) - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_prod); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_3) { - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_retshape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_retshape}; - __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 605, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_7); - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_retshape}; - __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 605, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_7); - } else - #endif - { - __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_v_retshape); - __Pyx_GIVEREF(__pyx_v_retshape); - PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_retshape); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_n = __pyx_t_7; - __pyx_t_7 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":606 - * retshape = np.shape(x)[:-1] - * n = np.prod(retshape) - * xx = np.reshape(x,(n,self.m)) # <<<<<<<<<<<<<< - * xx = np.ascontiguousarray(xx) - * dd = np.empty((n,k),dtype="float64") - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_n); - __Pyx_GIVEREF(__pyx_v_n); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_n); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_9 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_x, __pyx_t_3}; - __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_x, __pyx_t_3}; - __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - { - __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_2) { - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; - } - __Pyx_INCREF(__pyx_v_x); - __Pyx_GIVEREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_v_x); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 606, __pyx_L1_error) - __pyx_t_14 = ((PyArrayObject *)__pyx_t_7); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xx.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xx.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xx.rcbuffer->pybuffer, (PyObject*)__pyx_v_xx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); - } - } - __pyx_pybuffernd_xx.diminfo[0].strides = __pyx_pybuffernd_xx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xx.diminfo[0].shape = __pyx_pybuffernd_xx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_xx.diminfo[1].strides = __pyx_pybuffernd_xx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_xx.diminfo[1].shape = __pyx_pybuffernd_xx.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 606, __pyx_L1_error) - } - __pyx_t_14 = 0; - __pyx_v_xx = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":607 - * n = np.prod(retshape) - * xx = np.reshape(x,(n,self.m)) - * xx = np.ascontiguousarray(xx) # <<<<<<<<<<<<<< - * dd = np.empty((n,k),dtype="float64") - * dd.fill(infinity) - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (!__pyx_t_1) { - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_xx)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_xx)}; - __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_7); - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_xx)}; - __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_7); - } else - #endif - { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 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_t_1 = NULL; - __Pyx_INCREF(((PyObject *)__pyx_v_xx)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_xx)); - PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_xx)); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 607, __pyx_L1_error) - __pyx_t_14 = ((PyArrayObject *)__pyx_t_7); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xx.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xx.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xx.rcbuffer->pybuffer, (PyObject*)__pyx_v_xx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); - } - } - __pyx_pybuffernd_xx.diminfo[0].strides = __pyx_pybuffernd_xx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xx.diminfo[0].shape = __pyx_pybuffernd_xx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_xx.diminfo[1].strides = __pyx_pybuffernd_xx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_xx.diminfo[1].shape = __pyx_pybuffernd_xx.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 607, __pyx_L1_error) - } - __pyx_t_14 = 0; - __Pyx_DECREF_SET(__pyx_v_xx, ((PyArrayObject *)__pyx_t_7)); - __pyx_t_7 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":608 - * xx = np.reshape(x,(n,self.m)) - * xx = np.ascontiguousarray(xx) - * dd = np.empty((n,k),dtype="float64") # <<<<<<<<<<<<<< - * dd.fill(infinity) - * ii = np.empty((n,k),dtype="int64") - */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_n); - __Pyx_GIVEREF(__pyx_v_n); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_n); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 608, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 608, __pyx_L1_error) - __pyx_t_15 = ((PyArrayObject *)__pyx_t_1); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dd.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dd.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dd.rcbuffer->pybuffer, (PyObject*)__pyx_v_dd, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); - } - } - __pyx_pybuffernd_dd.diminfo[0].strides = __pyx_pybuffernd_dd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dd.diminfo[0].shape = __pyx_pybuffernd_dd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dd.diminfo[1].strides = __pyx_pybuffernd_dd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dd.diminfo[1].shape = __pyx_pybuffernd_dd.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 608, __pyx_L1_error) - } - __pyx_t_15 = 0; - __pyx_v_dd = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":609 - * xx = np.ascontiguousarray(xx) - * dd = np.empty((n,k),dtype="float64") - * dd.fill(infinity) # <<<<<<<<<<<<<< - * ii = np.empty((n,k),dtype="int64") - * ii.fill(self.n) - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dd), __pyx_n_s_fill); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_2yt_9utilities_7spatial_7ckdtree_infinity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __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_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_7}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } else - #endif - { - __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __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_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":610 - * dd = np.empty((n,k),dtype="float64") - * dd.fill(infinity) - * ii = np.empty((n,k),dtype="int64") # <<<<<<<<<<<<<< - * ii.fill(self.n) - * for c in range(n): - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __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_k); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_n); - __Pyx_GIVEREF(__pyx_v_n); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_n); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 610, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 610, __pyx_L1_error) - __pyx_t_16 = ((PyArrayObject *)__pyx_t_7); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ii.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ii.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ii.rcbuffer->pybuffer, (PyObject*)__pyx_v_ii, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); - } - } - __pyx_pybuffernd_ii.diminfo[0].strides = __pyx_pybuffernd_ii.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ii.diminfo[0].shape = __pyx_pybuffernd_ii.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ii.diminfo[1].strides = __pyx_pybuffernd_ii.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ii.diminfo[1].shape = __pyx_pybuffernd_ii.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 610, __pyx_L1_error) - } - __pyx_t_16 = 0; - __pyx_v_ii = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":611 - * dd.fill(infinity) - * ii = np.empty((n,k),dtype="int64") - * ii.fill(self.n) # <<<<<<<<<<<<<< - * for c in range(n): - * self.__query( - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ii), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - 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); - } - } - if (!__pyx_t_3) { - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_7); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; - __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; - __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_7); - __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, 611, __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_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":612 - * ii = np.empty((n,k),dtype="int64") - * ii.fill(self.n) - * for c in range(n): # <<<<<<<<<<<<<< - * self.__query( - * (dd.data)+c*k, - */ - __pyx_t_17 = __Pyx_PyInt_As_long(__pyx_v_n); if (unlikely((__pyx_t_17 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 612, __pyx_L1_error) - for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_17; __pyx_t_9+=1) { - __pyx_v_c = __pyx_t_9; - - /* "yt/utilities/spatial/ckdtree.pyx":613 - * ii.fill(self.n) - * for c in range(n): - * self.__query( # <<<<<<<<<<<<<< - * (dd.data)+c*k, - * (ii.data)+c*k, - */ - ((struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->__pyx___query(__pyx_v_self, (((__pyx_t_5numpy_float64_t *)__pyx_v_dd->data) + (__pyx_v_c * __pyx_v_k)), (((__pyx_t_5numpy_int64_t *)__pyx_v_ii->data) + (__pyx_v_c * __pyx_v_k)), (((__pyx_t_5numpy_float64_t *)__pyx_v_xx->data) + (__pyx_v_c * __pyx_v_self->m)), __pyx_v_k, __pyx_v_eps, __pyx_v_p, __pyx_v_distance_upper_bound, ((__pyx_t_5numpy_float64_t *)__pyx_v_cperiod->data)); - } - - /* "yt/utilities/spatial/ckdtree.pyx":622 - * distance_upper_bound, - * cperiod.data) - * if single: # <<<<<<<<<<<<<< - * if k==1: - * return dd[0,0], ii[0,0] - */ - __pyx_t_6 = (__pyx_v_single != 0); - if (__pyx_t_6) { - - /* "yt/utilities/spatial/ckdtree.pyx":623 - * cperiod.data) - * if single: - * if k==1: # <<<<<<<<<<<<<< - * return dd[0,0], ii[0,0] - * else: - */ - __pyx_t_6 = ((__pyx_v_k == 1) != 0); - if (__pyx_t_6) { - - /* "yt/utilities/spatial/ckdtree.pyx":624 - * if single: - * if k==1: - * return dd[0,0], ii[0,0] # <<<<<<<<<<<<<< - * else: - * return dd[0], ii[0] - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_18 = 0; - __pyx_t_19 = 0; - __pyx_t_9 = -1; - if (__pyx_t_18 < 0) { - __pyx_t_18 += __pyx_pybuffernd_dd.diminfo[0].shape; - if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0; - } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_dd.diminfo[0].shape)) __pyx_t_9 = 0; - if (__pyx_t_19 < 0) { - __pyx_t_19 += __pyx_pybuffernd_dd.diminfo[1].shape; - if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 1; - } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_dd.diminfo[1].shape)) __pyx_t_9 = 1; - if (unlikely(__pyx_t_9 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 624, __pyx_L1_error) - } - __pyx_t_7 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dd.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dd.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_dd.diminfo[1].strides))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_20 = 0; - __pyx_t_21 = 0; - __pyx_t_9 = -1; - if (__pyx_t_20 < 0) { - __pyx_t_20 += __pyx_pybuffernd_ii.diminfo[0].shape; - if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 0; - } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ii.diminfo[0].shape)) __pyx_t_9 = 0; - if (__pyx_t_21 < 0) { - __pyx_t_21 += __pyx_pybuffernd_ii.diminfo[1].shape; - if (unlikely(__pyx_t_21 < 0)) __pyx_t_9 = 1; - } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ii.diminfo[1].shape)) __pyx_t_9 = 1; - if (unlikely(__pyx_t_9 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 624, __pyx_L1_error) - } - __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ii.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ii.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_ii.diminfo[1].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - __pyx_t_7 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":623 - * cperiod.data) - * if single: - * if k==1: # <<<<<<<<<<<<<< - * return dd[0,0], ii[0,0] - * else: - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":626 - * return dd[0,0], ii[0,0] - * else: - * return dd[0], ii[0] # <<<<<<<<<<<<<< - * else: - * if k==1: - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_dd), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_ii), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2); - __pyx_t_4 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_7; - __pyx_t_7 = 0; - goto __pyx_L0; - } - - /* "yt/utilities/spatial/ckdtree.pyx":622 - * distance_upper_bound, - * cperiod.data) - * if single: # <<<<<<<<<<<<<< - * if k==1: - * return dd[0,0], ii[0,0] - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":628 - * return dd[0], ii[0] - * else: - * if k==1: # <<<<<<<<<<<<<< - * return np.reshape(dd[...,0],retshape), np.reshape(ii[...,0],retshape) - * else: - */ - /*else*/ { - __pyx_t_6 = ((__pyx_v_k == 1) != 0); - if (__pyx_t_6) { - - /* "yt/utilities/spatial/ckdtree.pyx":629 - * else: - * if k==1: - * return np.reshape(dd[...,0],retshape), np.reshape(ii[...,0],retshape) # <<<<<<<<<<<<<< - * else: - * return np.reshape(dd,retshape+(k,)), np.reshape(ii,retshape+(k,)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_dd), __pyx_tuple__8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = NULL; - __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_9 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_2, __pyx_v_retshape}; - __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_7); - __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[3] = {__pyx_t_1, __pyx_t_2, __pyx_v_retshape}; - __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else - #endif - { - __pyx_t_3 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_1) { - __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL; - } - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_9, __pyx_t_2); - __Pyx_INCREF(__pyx_v_retshape); - __Pyx_GIVEREF(__pyx_v_retshape); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_9, __pyx_v_retshape); - __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_ii), __pyx_tuple__9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = NULL; - __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_9 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_3, __pyx_v_retshape}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_3, __pyx_v_retshape}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - { - __pyx_t_22 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_22); - if (__pyx_t_1) { - __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_1); __pyx_t_1 = NULL; - } - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_9, __pyx_t_3); - __Pyx_INCREF(__pyx_v_retshape); - __Pyx_GIVEREF(__pyx_v_retshape); - PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_9, __pyx_v_retshape); - __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_22, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); - __pyx_t_7 = 0; - __pyx_t_4 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":628 - * return dd[0], ii[0] - * else: - * if k==1: # <<<<<<<<<<<<<< - * return np.reshape(dd[...,0],retshape), np.reshape(ii[...,0],retshape) - * else: - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":631 - * return np.reshape(dd[...,0],retshape), np.reshape(ii[...,0],retshape) - * else: - * return np.reshape(dd,retshape+(k,)), np.reshape(ii,retshape+(k,)) # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_reshape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_22 = PyTuple_New(1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_22); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_v_retshape, __pyx_t_22); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __pyx_t_22 = NULL; - __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_22)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_22); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_9 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_7)) { - PyObject *__pyx_temp[3] = {__pyx_t_22, ((PyObject *)__pyx_v_dd), __pyx_t_4}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { - PyObject *__pyx_temp[3] = {__pyx_t_22, ((PyObject *)__pyx_v_dd), __pyx_t_4}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - #endif - { - __pyx_t_3 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_22) { - __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_22); __pyx_t_22 = NULL; - } - __Pyx_INCREF(((PyObject *)__pyx_v_dd)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_dd)); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_9, ((PyObject *)__pyx_v_dd)); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_9, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_22 = PyTuple_New(1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_22); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_v_retshape, __pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __pyx_t_22 = NULL; - __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_22)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_22); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_9 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[3] = {__pyx_t_22, ((PyObject *)__pyx_v_ii), __pyx_t_3}; - __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[3] = {__pyx_t_22, ((PyObject *)__pyx_v_ii), __pyx_t_3}; - __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - { - __pyx_t_1 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__pyx_t_22) { - __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_22); __pyx_t_22 = NULL; - } - __Pyx_INCREF(((PyObject *)__pyx_v_ii)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_ii)); - PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_9, ((PyObject *)__pyx_v_ii)); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_9, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7); - __pyx_t_2 = 0; - __pyx_t_7 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - } - } - - /* "yt/utilities/spatial/ckdtree.pyx":544 - * heapdestroy(&neighbors) - * - * def query(cKDTree self, object x, int k=1, np.float64_t eps=0, np.float64_t p=2, # <<<<<<<<<<<<<< - * np.float64_t distance_upper_bound=infinity, object period=None): - * """query(self, x, k=1, eps=0, p=2, distance_upper_bound=np.inf, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_22); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cperiod.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dd.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ii.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xx.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.cKDTree.query", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cperiod.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dd.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ii.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xx.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_ii); - __Pyx_XDECREF((PyObject *)__pyx_v_dd); - __Pyx_XDECREF((PyObject *)__pyx_v_xx); - __Pyx_XDECREF((PyObject *)__pyx_v_cperiod); - __Pyx_XDECREF(__pyx_v_retshape); - __Pyx_XDECREF(__pyx_v_n); - __Pyx_XDECREF(__pyx_v_x); - __Pyx_XDECREF(__pyx_v_period); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":636 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def chainHOP_get_dens(cKDTree self, object omass, int num_neighbors=65, \ # <<<<<<<<<<<<<< - * int nMerge=6): - * """ query the tree for the nearest neighbors, to get the density - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_7chainHOP_get_dens(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_2yt_9utilities_7spatial_7ckdtree_7cKDTree_6chainHOP_get_dens[] = " query the tree for the nearest neighbors, to get the density\n of particles for chainHOP.\n\n Parameters:\n ===========\n\n mass: A array-like list of the masses of the particles, in the same\n order as the data that went into building the kd tree.\n\n num_neighbors: Optional, the number of neighbors to search for and to\n use in the density calculation. Default is 65, and is probably what\n one should stick with.\n\n nMerge: The number of nearest neighbor tags to return for each particle.\n\n Returns:\n ========\n\n dens: An array of the densities for each particle, in the same order\n as the input data.\n\n tags: A two-dimensional array of the indexes, nMerge nearest neighbors\n for each particle.\n\n "; -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_7chainHOP_get_dens(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_omass = 0; - int __pyx_v_num_neighbors; - CYTHON_UNUSED int __pyx_v_nMerge; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("chainHOP_get_dens (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_omass,&__pyx_n_s_num_neighbors,&__pyx_n_s_nMerge,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_omass)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_neighbors); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nMerge); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chainHOP_get_dens") < 0)) __PYX_ERR(0, 636, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_omass = values[0]; - if (values[1]) { - __pyx_v_num_neighbors = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_neighbors == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L3_error) - } else { - __pyx_v_num_neighbors = ((int)65); - } - if (values[2]) { - __pyx_v_nMerge = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nMerge == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 637, __pyx_L3_error) - } else { - __pyx_v_nMerge = ((int)6); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("chainHOP_get_dens", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 636, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.cKDTree.chainHOP_get_dens", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_6chainHOP_get_dens(((struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self), __pyx_v_omass, __pyx_v_num_neighbors, __pyx_v_nMerge); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_6chainHOP_get_dens(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_omass, int __pyx_v_num_neighbors, CYTHON_UNUSED int __pyx_v_nMerge) { - PyArrayObject *__pyx_v_dens = 0; - int __pyx_v_i; - int __pyx_v_pj; - int __pyx_v_j; - __pyx_t_5numpy_float64_t __pyx_v_ih2; - __pyx_t_5numpy_float64_t __pyx_v_fNorm; - __pyx_t_5numpy_float64_t __pyx_v_r2; - __pyx_t_5numpy_float64_t __pyx_v_rs; - PyArrayObject *__pyx_v_local_data = 0; - PyArrayObject *__pyx_v_mass = 0; - __pyx_t_5numpy_float64_t __pyx_v_ipi; - __pyx_t_5numpy_float64_t *__pyx_v_query; - __pyx_t_5numpy_float64_t *__pyx_v_dist_temp; - __pyx_t_5numpy_int64_t *__pyx_v_tags_temp; - __pyx_t_5numpy_float64_t __pyx_v_period[3]; - __Pyx_LocalBuf_ND __pyx_pybuffernd_dens; - __Pyx_Buffer __pyx_pybuffer_dens; - __Pyx_LocalBuf_ND __pyx_pybuffernd_local_data; - __Pyx_Buffer __pyx_pybuffer_local_data; - __Pyx_LocalBuf_ND __pyx_pybuffernd_mass; - __Pyx_Buffer __pyx_pybuffer_mass; - 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; - PyArrayObject *__pyx_t_5 = NULL; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyArrayObject *__pyx_t_10 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_11; - int __pyx_t_12; - int __pyx_t_13; - int __pyx_t_14; - Py_ssize_t __pyx_t_15; - Py_ssize_t __pyx_t_16; - int __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; - __Pyx_RefNannySetupContext("chainHOP_get_dens", 0); - __pyx_pybuffer_dens.pybuffer.buf = NULL; - __pyx_pybuffer_dens.refcount = 0; - __pyx_pybuffernd_dens.data = NULL; - __pyx_pybuffernd_dens.rcbuffer = &__pyx_pybuffer_dens; - __pyx_pybuffer_local_data.pybuffer.buf = NULL; - __pyx_pybuffer_local_data.refcount = 0; - __pyx_pybuffernd_local_data.data = NULL; - __pyx_pybuffernd_local_data.rcbuffer = &__pyx_pybuffer_local_data; - __pyx_pybuffer_mass.pybuffer.buf = NULL; - __pyx_pybuffer_mass.refcount = 0; - __pyx_pybuffernd_mass.data = NULL; - __pyx_pybuffernd_mass.rcbuffer = &__pyx_pybuffer_mass; - - /* "yt/utilities/spatial/ckdtree.pyx":672 - * - * #tags = np.empty((self.n, nMerge), dtype="int64") - * dens = np.zeros(self.n, dtype="float64") # <<<<<<<<<<<<<< - * cdef np.ndarray[np.float64_t, ndim=2] local_data = self.data - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __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, 672, __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_self->n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 672, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 672, __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_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, 672, __pyx_L1_error) - __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dens.rcbuffer->pybuffer); - __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dens.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_6 < 0)) { - PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dens.rcbuffer->pybuffer, (PyObject*)__pyx_v_dens, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); - } - } - __pyx_pybuffernd_dens.diminfo[0].strides = __pyx_pybuffernd_dens.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dens.diminfo[0].shape = __pyx_pybuffernd_dens.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 672, __pyx_L1_error) - } - __pyx_t_5 = 0; - __pyx_v_dens = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":673 - * #tags = np.empty((self.n, nMerge), dtype="int64") - * dens = np.zeros(self.n, dtype="float64") - * cdef np.ndarray[np.float64_t, ndim=2] local_data = self.data # <<<<<<<<<<<<<< - * - * cdef np.ndarray[np.float64_t, ndim=1] mass = np.array(omass).astype("float64") - */ - if (!(likely(((__pyx_v_self->data) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->data, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 673, __pyx_L1_error) - __pyx_t_4 = __pyx_v_self->data; - __Pyx_INCREF(__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_local_data.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { - __pyx_v_local_data = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_local_data.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 673, __pyx_L1_error) - } else {__pyx_pybuffernd_local_data.diminfo[0].strides = __pyx_pybuffernd_local_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_local_data.diminfo[0].shape = __pyx_pybuffernd_local_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_local_data.diminfo[1].strides = __pyx_pybuffernd_local_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_local_data.diminfo[1].shape = __pyx_pybuffernd_local_data.rcbuffer->pybuffer.shape[1]; - } - } - __pyx_v_local_data = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":675 - * cdef np.ndarray[np.float64_t, ndim=2] local_data = self.data - * - * cdef np.ndarray[np.float64_t, ndim=1] mass = np.array(omass).astype("float64") # <<<<<<<<<<<<<< - * cdef np.float64_t ipi = 1.0/np.pi - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_1) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_omass); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_omass}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_omass}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else - #endif - { - __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __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 = NULL; - __Pyx_INCREF(__pyx_v_omass); - __Pyx_GIVEREF(__pyx_v_omass); - PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_omass); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 675, __pyx_L1_error) - __pyx_t_10 = ((PyArrayObject *)__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mass.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_mass = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 675, __pyx_L1_error) - } else {__pyx_pybuffernd_mass.diminfo[0].strides = __pyx_pybuffernd_mass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mass.diminfo[0].shape = __pyx_pybuffernd_mass.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_10 = 0; - __pyx_v_mass = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":676 - * - * cdef np.ndarray[np.float64_t, ndim=1] mass = np.array(omass).astype("float64") - * cdef np.float64_t ipi = 1.0/np.pi # <<<<<<<<<<<<<< - * - * cdef np.float64_t *query = alloca( - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyFloat_DivideCObj(__pyx_float_1_0, __pyx_t_3, 1.0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_11 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_ipi = __pyx_t_11; - - /* "yt/utilities/spatial/ckdtree.pyx":678 - * cdef np.float64_t ipi = 1.0/np.pi - * - * cdef np.float64_t *query = alloca( # <<<<<<<<<<<<<< - * sizeof(np.float64_t) * self.m) - * cdef np.float64_t *dist_temp = alloca( - */ - __pyx_v_query = ((__pyx_t_5numpy_float64_t *)alloca(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_self->m))); - - /* "yt/utilities/spatial/ckdtree.pyx":680 - * cdef np.float64_t *query = alloca( - * sizeof(np.float64_t) * self.m) - * cdef np.float64_t *dist_temp = alloca( # <<<<<<<<<<<<<< - * sizeof(np.float64_t) * num_neighbors) - * cdef np.int64_t *tags_temp = alloca( - */ - __pyx_v_dist_temp = ((__pyx_t_5numpy_float64_t *)alloca(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_num_neighbors))); - - /* "yt/utilities/spatial/ckdtree.pyx":682 - * cdef np.float64_t *dist_temp = alloca( - * sizeof(np.float64_t) * num_neighbors) - * cdef np.int64_t *tags_temp = alloca( # <<<<<<<<<<<<<< - * sizeof(np.int64_t) * num_neighbors) - * cdef np.float64_t period[3] - */ - __pyx_v_tags_temp = ((__pyx_t_5numpy_int64_t *)alloca(((sizeof(__pyx_t_5numpy_int64_t)) * __pyx_v_num_neighbors))); - - /* "yt/utilities/spatial/ckdtree.pyx":685 - * sizeof(np.int64_t) * num_neighbors) - * cdef np.float64_t period[3] - * for i in range(3): period[i] = 1.0 # <<<<<<<<<<<<<< - * - * for i in range(self.n): - */ - for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { - __pyx_v_i = __pyx_t_6; - (__pyx_v_period[__pyx_v_i]) = 1.0; - } - - /* "yt/utilities/spatial/ckdtree.pyx":687 - * for i in range(3): period[i] = 1.0 - * - * for i in range(self.n): # <<<<<<<<<<<<<< - * for j in range(self.m): - * query[j] = local_data[i,j] - */ - __pyx_t_6 = __pyx_v_self->n; - for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_6; __pyx_t_12+=1) { - __pyx_v_i = __pyx_t_12; - - /* "yt/utilities/spatial/ckdtree.pyx":688 - * - * for i in range(self.n): - * for j in range(self.m): # <<<<<<<<<<<<<< - * query[j] = local_data[i,j] - * self.__query(dist_temp, tags_temp, - */ - __pyx_t_13 = __pyx_v_self->m; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_j = __pyx_t_14; - - /* "yt/utilities/spatial/ckdtree.pyx":689 - * for i in range(self.n): - * for j in range(self.m): - * query[j] = local_data[i,j] # <<<<<<<<<<<<<< - * self.__query(dist_temp, tags_temp, - * query, num_neighbors, 0.0, - */ - __pyx_t_15 = __pyx_v_i; - __pyx_t_16 = __pyx_v_j; - (__pyx_v_query[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_local_data.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_local_data.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_local_data.diminfo[1].strides)); - } - - /* "yt/utilities/spatial/ckdtree.pyx":690 - * for j in range(self.m): - * query[j] = local_data[i,j] - * self.__query(dist_temp, tags_temp, # <<<<<<<<<<<<<< - * query, num_neighbors, 0.0, - * 2, infinity, period) - */ - ((struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->__pyx___query(__pyx_v_self, __pyx_v_dist_temp, __pyx_v_tags_temp, __pyx_v_query, __pyx_v_num_neighbors, 0.0, 2.0, __pyx_v_2yt_9utilities_7spatial_7ckdtree_infinity, __pyx_v_period); - - /* "yt/utilities/spatial/ckdtree.pyx":695 - * - * #calculate the density for this particle - * ih2 = -1 # <<<<<<<<<<<<<< - * for j in range(num_neighbors): - * ih2 = dmax(ih2, dist_temp[j]) - */ - __pyx_v_ih2 = -1.0; - - /* "yt/utilities/spatial/ckdtree.pyx":696 - * #calculate the density for this particle - * ih2 = -1 - * for j in range(num_neighbors): # <<<<<<<<<<<<<< - * ih2 = dmax(ih2, dist_temp[j]) - * ih2 = 4.0/ih2 - */ - __pyx_t_13 = __pyx_v_num_neighbors; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_j = __pyx_t_14; - - /* "yt/utilities/spatial/ckdtree.pyx":697 - * ih2 = -1 - * for j in range(num_neighbors): - * ih2 = dmax(ih2, dist_temp[j]) # <<<<<<<<<<<<<< - * ih2 = 4.0/ih2 - * fNorm = 0.5*(ih2**1.5)*ipi - */ - __pyx_v_ih2 = __pyx_f_2yt_9utilities_7spatial_7ckdtree_dmax(__pyx_v_ih2, (__pyx_v_dist_temp[__pyx_v_j])); - } - - /* "yt/utilities/spatial/ckdtree.pyx":698 - * for j in range(num_neighbors): - * ih2 = dmax(ih2, dist_temp[j]) - * ih2 = 4.0/ih2 # <<<<<<<<<<<<<< - * fNorm = 0.5*(ih2**1.5)*ipi - * for j in range(num_neighbors): - */ - __pyx_v_ih2 = (4.0 / __pyx_v_ih2); - - /* "yt/utilities/spatial/ckdtree.pyx":699 - * ih2 = dmax(ih2, dist_temp[j]) - * ih2 = 4.0/ih2 - * fNorm = 0.5*(ih2**1.5)*ipi # <<<<<<<<<<<<<< - * for j in range(num_neighbors): - * pj = tags_temp[j] - */ - __pyx_v_fNorm = ((0.5 * pow(__pyx_v_ih2, ((__pyx_t_5numpy_float64_t)1.5))) * __pyx_v_ipi); - - /* "yt/utilities/spatial/ckdtree.pyx":700 - * ih2 = 4.0/ih2 - * fNorm = 0.5*(ih2**1.5)*ipi - * for j in range(num_neighbors): # <<<<<<<<<<<<<< - * pj = tags_temp[j] - * r2 = dist_temp[j] * ih2 - */ - __pyx_t_13 = __pyx_v_num_neighbors; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_j = __pyx_t_14; - - /* "yt/utilities/spatial/ckdtree.pyx":701 - * fNorm = 0.5*(ih2**1.5)*ipi - * for j in range(num_neighbors): - * pj = tags_temp[j] # <<<<<<<<<<<<<< - * r2 = dist_temp[j] * ih2 - * rs = 2.0 - (r2**0.5) - */ - __pyx_v_pj = (__pyx_v_tags_temp[__pyx_v_j]); - - /* "yt/utilities/spatial/ckdtree.pyx":702 - * for j in range(num_neighbors): - * pj = tags_temp[j] - * r2 = dist_temp[j] * ih2 # <<<<<<<<<<<<<< - * rs = 2.0 - (r2**0.5) - * if (r2 < 1.0): - */ - __pyx_v_r2 = ((__pyx_v_dist_temp[__pyx_v_j]) * __pyx_v_ih2); - - /* "yt/utilities/spatial/ckdtree.pyx":703 - * pj = tags_temp[j] - * r2 = dist_temp[j] * ih2 - * rs = 2.0 - (r2**0.5) # <<<<<<<<<<<<<< - * if (r2 < 1.0): - * rs = (1.0 - 0.75*rs*r2) - */ - __pyx_v_rs = (2.0 - pow(__pyx_v_r2, ((__pyx_t_5numpy_float64_t)0.5))); - - /* "yt/utilities/spatial/ckdtree.pyx":704 - * r2 = dist_temp[j] * ih2 - * rs = 2.0 - (r2**0.5) - * if (r2 < 1.0): # <<<<<<<<<<<<<< - * rs = (1.0 - 0.75*rs*r2) - * else: - */ - __pyx_t_17 = ((__pyx_v_r2 < 1.0) != 0); - if (__pyx_t_17) { - - /* "yt/utilities/spatial/ckdtree.pyx":705 - * rs = 2.0 - (r2**0.5) - * if (r2 < 1.0): - * rs = (1.0 - 0.75*rs*r2) # <<<<<<<<<<<<<< - * else: - * rs = 0.25*rs*rs*rs - */ - __pyx_v_rs = (1.0 - ((0.75 * __pyx_v_rs) * __pyx_v_r2)); - - /* "yt/utilities/spatial/ckdtree.pyx":704 - * r2 = dist_temp[j] * ih2 - * rs = 2.0 - (r2**0.5) - * if (r2 < 1.0): # <<<<<<<<<<<<<< - * rs = (1.0 - 0.75*rs*r2) - * else: - */ - goto __pyx_L13; - } - - /* "yt/utilities/spatial/ckdtree.pyx":707 - * rs = (1.0 - 0.75*rs*r2) - * else: - * rs = 0.25*rs*rs*rs # <<<<<<<<<<<<<< - * rs = rs * fNorm - * dens[i] = dens[i] + rs * mass[pj] - */ - /*else*/ { - __pyx_v_rs = (((0.25 * __pyx_v_rs) * __pyx_v_rs) * __pyx_v_rs); - } - __pyx_L13:; - - /* "yt/utilities/spatial/ckdtree.pyx":708 - * else: - * rs = 0.25*rs*rs*rs - * rs = rs * fNorm # <<<<<<<<<<<<<< - * dens[i] = dens[i] + rs * mass[pj] - * dens[pj] = dens[pj] + rs * mass[i] - */ - __pyx_v_rs = (__pyx_v_rs * __pyx_v_fNorm); - - /* "yt/utilities/spatial/ckdtree.pyx":709 - * rs = 0.25*rs*rs*rs - * rs = rs * fNorm - * dens[i] = dens[i] + rs * mass[pj] # <<<<<<<<<<<<<< - * dens[pj] = dens[pj] + rs * mass[i] - * - */ - __pyx_t_18 = __pyx_v_i; - __pyx_t_19 = __pyx_v_pj; - __pyx_t_20 = __pyx_v_i; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dens.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_dens.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dens.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dens.diminfo[0].strides)) + (__pyx_v_rs * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_mass.diminfo[0].strides)))); - - /* "yt/utilities/spatial/ckdtree.pyx":710 - * rs = rs * fNorm - * dens[i] = dens[i] + rs * mass[pj] - * dens[pj] = dens[pj] + rs * mass[i] # <<<<<<<<<<<<<< - * - * # store nMerge nearest neighbors - */ - __pyx_t_21 = __pyx_v_pj; - __pyx_t_22 = __pyx_v_i; - __pyx_t_23 = __pyx_v_pj; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dens.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_dens.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dens.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_dens.diminfo[0].strides)) + (__pyx_v_rs * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mass.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_mass.diminfo[0].strides)))); - } - } - - /* "yt/utilities/spatial/ckdtree.pyx":716 - * - * #return (dens, tags) - * return dens # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_dens)); - __pyx_r = ((PyObject *)__pyx_v_dens); - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":636 - * @cython.wraparound(False) - * @cython.cdivision(True) - * def chainHOP_get_dens(cKDTree self, object omass, int num_neighbors=65, \ # <<<<<<<<<<<<<< - * int nMerge=6): - * """ query the tree for the nearest neighbors, to get the density - */ - - /* 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); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dens.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_local_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mass.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.cKDTree.chainHOP_get_dens", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dens.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_local_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mass.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_dens); - __Pyx_XDECREF((PyObject *)__pyx_v_local_data); - __Pyx_XDECREF((PyObject *)__pyx_v_mass); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":720 - * @cython.boundscheck(False) - * @cython.wraparound(False) - * def find_chunk_nearest_neighbors(cKDTree self, int start, int finish, \ # <<<<<<<<<<<<<< - * int num_neighbors=65): - * """ query the tree in chunks, between start and finish, recording the - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_9find_chunk_nearest_neighbors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_2yt_9utilities_7spatial_7ckdtree_7cKDTree_8find_chunk_nearest_neighbors[] = " query the tree in chunks, between start and finish, recording the\n nearest neighbors.\n\n Parameters:\n ===========\n\n start: The starting point in the dataset for this search.\n\n finish: The ending point in the dataset for this search.\n\n num_neighbors: Optional, the number of neighbors to search for.\n The default is 65.\n\n Returns:\n ========\n\n chunk_tags: A two-dimensional array of the nearest neighbor tags for the\n points in this search.\n\n "; -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_9find_chunk_nearest_neighbors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_v_start; - int __pyx_v_finish; - int __pyx_v_num_neighbors; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("find_chunk_nearest_neighbors (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_finish,&__pyx_n_s_num_neighbors,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_finish)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("find_chunk_nearest_neighbors", 0, 2, 3, 1); __PYX_ERR(0, 720, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_neighbors); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_chunk_nearest_neighbors") < 0)) __PYX_ERR(0, 720, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_start = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 720, __pyx_L3_error) - __pyx_v_finish = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_finish == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 720, __pyx_L3_error) - if (values[2]) { - __pyx_v_num_neighbors = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_num_neighbors == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 721, __pyx_L3_error) - } else { - __pyx_v_num_neighbors = ((int)65); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_chunk_nearest_neighbors", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 720, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.cKDTree.find_chunk_nearest_neighbors", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_8find_chunk_nearest_neighbors(((struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self), __pyx_v_start, __pyx_v_finish, __pyx_v_num_neighbors); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_8find_chunk_nearest_neighbors(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, int __pyx_v_start, int __pyx_v_finish, int __pyx_v_num_neighbors) { - PyArrayObject *__pyx_v_chunk_tags = 0; - PyArrayObject *__pyx_v_local_data = 0; - int __pyx_v_i; - int __pyx_v_j; - __pyx_t_5numpy_float64_t *__pyx_v_query; - __pyx_t_5numpy_float64_t *__pyx_v_dist_temp; - __pyx_t_5numpy_int64_t *__pyx_v_tags_temp; - __pyx_t_5numpy_float64_t __pyx_v_period[3]; - __Pyx_LocalBuf_ND __pyx_pybuffernd_chunk_tags; - __Pyx_Buffer __pyx_pybuffer_chunk_tags; - __Pyx_LocalBuf_ND __pyx_pybuffernd_local_data; - __Pyx_Buffer __pyx_pybuffer_local_data; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyArrayObject *__pyx_t_5 = NULL; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - 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; - __Pyx_RefNannySetupContext("find_chunk_nearest_neighbors", 0); - __pyx_pybuffer_chunk_tags.pybuffer.buf = NULL; - __pyx_pybuffer_chunk_tags.refcount = 0; - __pyx_pybuffernd_chunk_tags.data = NULL; - __pyx_pybuffernd_chunk_tags.rcbuffer = &__pyx_pybuffer_chunk_tags; - __pyx_pybuffer_local_data.pybuffer.buf = NULL; - __pyx_pybuffer_local_data.refcount = 0; - __pyx_pybuffernd_local_data.data = NULL; - __pyx_pybuffernd_local_data.rcbuffer = &__pyx_pybuffer_local_data; - - /* "yt/utilities/spatial/ckdtree.pyx":744 - * - * cdef np.ndarray[np.int64_t, ndim=2] chunk_tags - * cdef np.ndarray[np.float64_t, ndim=2] local_data = self.data # <<<<<<<<<<<<<< - * cdef int i, j - * - */ - if (!(likely(((__pyx_v_self->data) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->data, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 744, __pyx_L1_error) - __pyx_t_1 = __pyx_v_self->data; - __Pyx_INCREF(__pyx_t_1); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_local_data.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { - __pyx_v_local_data = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_local_data.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 744, __pyx_L1_error) - } else {__pyx_pybuffernd_local_data.diminfo[0].strides = __pyx_pybuffernd_local_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_local_data.diminfo[0].shape = __pyx_pybuffernd_local_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_local_data.diminfo[1].strides = __pyx_pybuffernd_local_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_local_data.diminfo[1].shape = __pyx_pybuffernd_local_data.rcbuffer->pybuffer.shape[1]; - } - } - __pyx_v_local_data = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":747 - * cdef int i, j - * - * chunk_tags = np.empty((finish-start, num_neighbors), dtype="int64") # <<<<<<<<<<<<<< - * cdef np.float64_t *query = alloca( - * sizeof(np.float64_t) * self.m) - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __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, 747, __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_finish - __pyx_v_start)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_num_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 747, __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_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 747, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 747, __pyx_L1_error) - __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_chunk_tags.rcbuffer->pybuffer); - __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_chunk_tags.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_6 < 0)) { - PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_chunk_tags.rcbuffer->pybuffer, (PyObject*)__pyx_v_chunk_tags, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); - } - } - __pyx_pybuffernd_chunk_tags.diminfo[0].strides = __pyx_pybuffernd_chunk_tags.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_chunk_tags.diminfo[0].shape = __pyx_pybuffernd_chunk_tags.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_chunk_tags.diminfo[1].strides = __pyx_pybuffernd_chunk_tags.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_chunk_tags.diminfo[1].shape = __pyx_pybuffernd_chunk_tags.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 747, __pyx_L1_error) - } - __pyx_t_5 = 0; - __pyx_v_chunk_tags = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":748 - * - * chunk_tags = np.empty((finish-start, num_neighbors), dtype="int64") - * cdef np.float64_t *query = alloca( # <<<<<<<<<<<<<< - * sizeof(np.float64_t) * self.m) - * cdef np.float64_t *dist_temp = alloca( - */ - __pyx_v_query = ((__pyx_t_5numpy_float64_t *)alloca(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_self->m))); - - /* "yt/utilities/spatial/ckdtree.pyx":750 - * cdef np.float64_t *query = alloca( - * sizeof(np.float64_t) * self.m) - * cdef np.float64_t *dist_temp = alloca( # <<<<<<<<<<<<<< - * sizeof(np.float64_t) * num_neighbors) - * cdef np.int64_t *tags_temp = alloca( - */ - __pyx_v_dist_temp = ((__pyx_t_5numpy_float64_t *)alloca(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_num_neighbors))); - - /* "yt/utilities/spatial/ckdtree.pyx":752 - * cdef np.float64_t *dist_temp = alloca( - * sizeof(np.float64_t) * num_neighbors) - * cdef np.int64_t *tags_temp = alloca( # <<<<<<<<<<<<<< - * sizeof(np.int64_t) * num_neighbors) - * cdef np.float64_t period[3] - */ - __pyx_v_tags_temp = ((__pyx_t_5numpy_int64_t *)alloca(((sizeof(__pyx_t_5numpy_int64_t)) * __pyx_v_num_neighbors))); - - /* "yt/utilities/spatial/ckdtree.pyx":755 - * sizeof(np.int64_t) * num_neighbors) - * cdef np.float64_t period[3] - * for i in range(3): period[i] = 1.0 # <<<<<<<<<<<<<< - * - * for i in range(finish-start): - */ - for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { - __pyx_v_i = __pyx_t_6; - (__pyx_v_period[__pyx_v_i]) = 1.0; - } - - /* "yt/utilities/spatial/ckdtree.pyx":757 - * for i in range(3): period[i] = 1.0 - * - * for i in range(finish-start): # <<<<<<<<<<<<<< - * for j in range(self.m): - * query[j] = local_data[i+start,j] - */ - __pyx_t_6 = (__pyx_v_finish - __pyx_v_start); - for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_6; __pyx_t_10+=1) { - __pyx_v_i = __pyx_t_10; - - /* "yt/utilities/spatial/ckdtree.pyx":758 - * - * for i in range(finish-start): - * for j in range(self.m): # <<<<<<<<<<<<<< - * query[j] = local_data[i+start,j] - * self.__query(dist_temp, tags_temp, - */ - __pyx_t_11 = __pyx_v_self->m; - for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { - __pyx_v_j = __pyx_t_12; - - /* "yt/utilities/spatial/ckdtree.pyx":759 - * for i in range(finish-start): - * for j in range(self.m): - * query[j] = local_data[i+start,j] # <<<<<<<<<<<<<< - * self.__query(dist_temp, tags_temp, - * query, num_neighbors, 0.0, - */ - __pyx_t_13 = (__pyx_v_i + __pyx_v_start); - __pyx_t_14 = __pyx_v_j; - (__pyx_v_query[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_local_data.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_local_data.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_local_data.diminfo[1].strides)); - } - - /* "yt/utilities/spatial/ckdtree.pyx":760 - * for j in range(self.m): - * query[j] = local_data[i+start,j] - * self.__query(dist_temp, tags_temp, # <<<<<<<<<<<<<< - * query, num_neighbors, 0.0, - * 2, infinity, period) - */ - ((struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->__pyx___query(__pyx_v_self, __pyx_v_dist_temp, __pyx_v_tags_temp, __pyx_v_query, __pyx_v_num_neighbors, 0.0, 2.0, __pyx_v_2yt_9utilities_7spatial_7ckdtree_infinity, __pyx_v_period); - - /* "yt/utilities/spatial/ckdtree.pyx":763 - * query, num_neighbors, 0.0, - * 2, infinity, period) - * for j in range(num_neighbors): # <<<<<<<<<<<<<< - * chunk_tags[i,j] = tags_temp[j] - * - */ - __pyx_t_11 = __pyx_v_num_neighbors; - for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { - __pyx_v_j = __pyx_t_12; - - /* "yt/utilities/spatial/ckdtree.pyx":764 - * 2, infinity, period) - * for j in range(num_neighbors): - * chunk_tags[i,j] = tags_temp[j] # <<<<<<<<<<<<<< - * - * return chunk_tags - */ - __pyx_t_15 = __pyx_v_i; - __pyx_t_16 = __pyx_v_j; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_chunk_tags.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_chunk_tags.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_chunk_tags.diminfo[1].strides) = (__pyx_v_tags_temp[__pyx_v_j]); - } - } - - /* "yt/utilities/spatial/ckdtree.pyx":766 - * chunk_tags[i,j] = tags_temp[j] - * - * return chunk_tags # <<<<<<<<<<<<<< - * - * def chainHOP_preconnect(self, np.ndarray[np.int64_t, ndim=1] chainID, - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_chunk_tags)); - __pyx_r = ((PyObject *)__pyx_v_chunk_tags); - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":720 - * @cython.boundscheck(False) - * @cython.wraparound(False) - * def find_chunk_nearest_neighbors(cKDTree self, int start, int finish, \ # <<<<<<<<<<<<<< - * int num_neighbors=65): - * """ query the tree in chunks, between start and finish, recording the - */ - - /* 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); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_chunk_tags.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_local_data.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.cKDTree.find_chunk_nearest_neighbors", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_chunk_tags.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_local_data.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_chunk_tags); - __Pyx_XDECREF((PyObject *)__pyx_v_local_data); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":768 - * return chunk_tags - * - * def chainHOP_preconnect(self, np.ndarray[np.int64_t, ndim=1] chainID, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] density, - * np.ndarray[np.float64_t, ndim=1] densest_in_chain, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_11chainHOP_preconnect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_11chainHOP_preconnect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_chainID = 0; - PyArrayObject *__pyx_v_density = 0; - PyArrayObject *__pyx_v_densest_in_chain = 0; - PyArrayObject *__pyx_v_bis_inside = 0; - PyArrayObject *__pyx_v_bsearch_again = 0; - __pyx_t_5numpy_float64_t __pyx_v_peakthresh; - __pyx_t_5numpy_float64_t __pyx_v_saddlethresh; - int __pyx_v_nn; - int __pyx_v_nMerge; - PyObject *__pyx_v_chain_map = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("chainHOP_preconnect (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chainID,&__pyx_n_s_density,&__pyx_n_s_densest_in_chain,&__pyx_n_s_bis_inside,&__pyx_n_s_bsearch_again,&__pyx_n_s_peakthresh,&__pyx_n_s_saddlethresh,&__pyx_n_s_nn,&__pyx_n_s_nMerge,&__pyx_n_s_chain_map,0}; - PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chainID)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_density)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("chainHOP_preconnect", 1, 10, 10, 1); __PYX_ERR(0, 768, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_densest_in_chain)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("chainHOP_preconnect", 1, 10, 10, 2); __PYX_ERR(0, 768, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bis_inside)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("chainHOP_preconnect", 1, 10, 10, 3); __PYX_ERR(0, 768, __pyx_L3_error) - } - case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bsearch_again)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("chainHOP_preconnect", 1, 10, 10, 4); __PYX_ERR(0, 768, __pyx_L3_error) - } - case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_peakthresh)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("chainHOP_preconnect", 1, 10, 10, 5); __PYX_ERR(0, 768, __pyx_L3_error) - } - case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_saddlethresh)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("chainHOP_preconnect", 1, 10, 10, 6); __PYX_ERR(0, 768, __pyx_L3_error) - } - case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nn)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("chainHOP_preconnect", 1, 10, 10, 7); __PYX_ERR(0, 768, __pyx_L3_error) - } - case 8: - if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nMerge)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("chainHOP_preconnect", 1, 10, 10, 8); __PYX_ERR(0, 768, __pyx_L3_error) - } - case 9: - if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chain_map)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("chainHOP_preconnect", 1, 10, 10, 9); __PYX_ERR(0, 768, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chainHOP_preconnect") < 0)) __PYX_ERR(0, 768, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 10) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - } - __pyx_v_chainID = ((PyArrayObject *)values[0]); - __pyx_v_density = ((PyArrayObject *)values[1]); - __pyx_v_densest_in_chain = ((PyArrayObject *)values[2]); - __pyx_v_bis_inside = ((PyArrayObject *)values[3]); - __pyx_v_bsearch_again = ((PyArrayObject *)values[4]); - __pyx_v_peakthresh = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_peakthresh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 773, __pyx_L3_error) - __pyx_v_saddlethresh = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_saddlethresh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 774, __pyx_L3_error) - __pyx_v_nn = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_nn == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 775, __pyx_L3_error) - __pyx_v_nMerge = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_nMerge == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 775, __pyx_L3_error) - __pyx_v_chain_map = values[9]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("chainHOP_preconnect", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 768, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.cKDTree.chainHOP_preconnect", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chainID), __pyx_ptype_5numpy_ndarray, 1, "chainID", 0))) __PYX_ERR(0, 768, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_density), __pyx_ptype_5numpy_ndarray, 1, "density", 0))) __PYX_ERR(0, 769, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_densest_in_chain), __pyx_ptype_5numpy_ndarray, 1, "densest_in_chain", 0))) __PYX_ERR(0, 770, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bis_inside), __pyx_ptype_5numpy_ndarray, 1, "bis_inside", 0))) __PYX_ERR(0, 771, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bsearch_again), __pyx_ptype_5numpy_ndarray, 1, "bsearch_again", 0))) __PYX_ERR(0, 772, __pyx_L1_error) - __pyx_r = __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_10chainHOP_preconnect(((struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self), __pyx_v_chainID, __pyx_v_density, __pyx_v_densest_in_chain, __pyx_v_bis_inside, __pyx_v_bsearch_again, __pyx_v_peakthresh, __pyx_v_saddlethresh, __pyx_v_nn, __pyx_v_nMerge, __pyx_v_chain_map); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_10chainHOP_preconnect(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self, PyArrayObject *__pyx_v_chainID, PyArrayObject *__pyx_v_density, PyArrayObject *__pyx_v_densest_in_chain, PyArrayObject *__pyx_v_bis_inside, PyArrayObject *__pyx_v_bsearch_again, __pyx_t_5numpy_float64_t __pyx_v_peakthresh, __pyx_t_5numpy_float64_t __pyx_v_saddlethresh, int __pyx_v_nn, int __pyx_v_nMerge, PyObject *__pyx_v_chain_map) { - PyArrayObject *__pyx_v_is_inside = 0; - PyArrayObject *__pyx_v_search_again = 0; - PyArrayObject *__pyx_v_pos = 0; - __pyx_t_5numpy_int64_t __pyx_v_thisNN; - __pyx_t_5numpy_int64_t __pyx_v_thisNN_chainID; - __pyx_t_5numpy_int64_t __pyx_v_same_count; - __pyx_t_5numpy_float64_t *__pyx_v_query; - __pyx_t_5numpy_float64_t *__pyx_v_dist_temp; - __pyx_t_5numpy_int64_t *__pyx_v_tags_temp; - __pyx_t_5numpy_float64_t __pyx_v_period[3]; - __pyx_t_5numpy_float64_t __pyx_v_thisNN_max_dens; - __pyx_t_5numpy_float64_t __pyx_v_boundary_density; - int __pyx_v_i; - int __pyx_v_j; - int __pyx_v_npart; - int __pyx_v_chainID_i; - PyObject *__pyx_v_part_max_dens = NULL; - __Pyx_LocalBuf_ND __pyx_pybuffernd_chainID; - __Pyx_Buffer __pyx_pybuffer_chainID; - __Pyx_LocalBuf_ND __pyx_pybuffernd_densest_in_chain; - __Pyx_Buffer __pyx_pybuffer_densest_in_chain; - __Pyx_LocalBuf_ND __pyx_pybuffernd_density; - __Pyx_Buffer __pyx_pybuffer_density; - __Pyx_LocalBuf_ND __pyx_pybuffernd_is_inside; - __Pyx_Buffer __pyx_pybuffer_is_inside; - __Pyx_LocalBuf_ND __pyx_pybuffernd_pos; - __Pyx_Buffer __pyx_pybuffer_pos; - __Pyx_LocalBuf_ND __pyx_pybuffernd_search_again; - __Pyx_Buffer __pyx_pybuffer_search_again; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyArrayObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyArrayObject *__pyx_t_8 = NULL; - int __pyx_t_9; - Py_ssize_t __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; - int __pyx_t_16; - Py_ssize_t __pyx_t_17; - Py_ssize_t __pyx_t_18; - int __pyx_t_19; - long __pyx_t_20; - __pyx_t_5numpy_int64_t __pyx_t_21; - int __pyx_t_22; - int __pyx_t_23; - __pyx_t_5numpy_int64_t __pyx_t_24; - __pyx_t_5numpy_int64_t __pyx_t_25; - Py_ssize_t __pyx_t_26; - PyObject *__pyx_t_27 = NULL; - PyObject *__pyx_t_28 = NULL; - PyObject *__pyx_t_29 = NULL; - Py_ssize_t __pyx_t_30; - __Pyx_RefNannySetupContext("chainHOP_preconnect", 0); - __pyx_pybuffer_is_inside.pybuffer.buf = NULL; - __pyx_pybuffer_is_inside.refcount = 0; - __pyx_pybuffernd_is_inside.data = NULL; - __pyx_pybuffernd_is_inside.rcbuffer = &__pyx_pybuffer_is_inside; - __pyx_pybuffer_search_again.pybuffer.buf = NULL; - __pyx_pybuffer_search_again.refcount = 0; - __pyx_pybuffernd_search_again.data = NULL; - __pyx_pybuffernd_search_again.rcbuffer = &__pyx_pybuffer_search_again; - __pyx_pybuffer_pos.pybuffer.buf = NULL; - __pyx_pybuffer_pos.refcount = 0; - __pyx_pybuffernd_pos.data = NULL; - __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos; - __pyx_pybuffer_chainID.pybuffer.buf = NULL; - __pyx_pybuffer_chainID.refcount = 0; - __pyx_pybuffernd_chainID.data = NULL; - __pyx_pybuffernd_chainID.rcbuffer = &__pyx_pybuffer_chainID; - __pyx_pybuffer_density.pybuffer.buf = NULL; - __pyx_pybuffer_density.refcount = 0; - __pyx_pybuffernd_density.data = NULL; - __pyx_pybuffernd_density.rcbuffer = &__pyx_pybuffer_density; - __pyx_pybuffer_densest_in_chain.pybuffer.buf = NULL; - __pyx_pybuffer_densest_in_chain.refcount = 0; - __pyx_pybuffernd_densest_in_chain.data = NULL; - __pyx_pybuffernd_densest_in_chain.rcbuffer = &__pyx_pybuffer_densest_in_chain; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_chainID.rcbuffer->pybuffer, (PyObject*)__pyx_v_chainID, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 768, __pyx_L1_error) - } - __pyx_pybuffernd_chainID.diminfo[0].strides = __pyx_pybuffernd_chainID.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_chainID.diminfo[0].shape = __pyx_pybuffernd_chainID.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_density.rcbuffer->pybuffer, (PyObject*)__pyx_v_density, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 768, __pyx_L1_error) - } - __pyx_pybuffernd_density.diminfo[0].strides = __pyx_pybuffernd_density.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_density.diminfo[0].shape = __pyx_pybuffernd_density.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_densest_in_chain.rcbuffer->pybuffer, (PyObject*)__pyx_v_densest_in_chain, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 768, __pyx_L1_error) - } - __pyx_pybuffernd_densest_in_chain.diminfo[0].strides = __pyx_pybuffernd_densest_in_chain.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_densest_in_chain.diminfo[0].shape = __pyx_pybuffernd_densest_in_chain.rcbuffer->pybuffer.shape[0]; - - /* "yt/utilities/spatial/ckdtree.pyx":781 - * cdef np.ndarray[np.float64_t, ndim=2] pos - * cdef np.int64_t thisNN, thisNN_chainID, same_count - * cdef np.float64_t *query = alloca( # <<<<<<<<<<<<<< - * sizeof(np.float64_t) * self.m) - * cdef np.float64_t *dist_temp = alloca( - */ - __pyx_v_query = ((__pyx_t_5numpy_float64_t *)alloca(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_self->m))); - - /* "yt/utilities/spatial/ckdtree.pyx":783 - * cdef np.float64_t *query = alloca( - * sizeof(np.float64_t) * self.m) - * cdef np.float64_t *dist_temp = alloca( # <<<<<<<<<<<<<< - * sizeof(np.float64_t) * nn) - * cdef np.int64_t *tags_temp = alloca( - */ - __pyx_v_dist_temp = ((__pyx_t_5numpy_float64_t *)alloca(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_nn))); - - /* "yt/utilities/spatial/ckdtree.pyx":785 - * cdef np.float64_t *dist_temp = alloca( - * sizeof(np.float64_t) * nn) - * cdef np.int64_t *tags_temp = alloca( # <<<<<<<<<<<<<< - * sizeof(np.int64_t) * nn) - * cdef np.float64_t period[3] - */ - __pyx_v_tags_temp = ((__pyx_t_5numpy_int64_t *)alloca(((sizeof(__pyx_t_5numpy_int64_t)) * __pyx_v_nn))); - - /* "yt/utilities/spatial/ckdtree.pyx":790 - * cdef np.float64_t thisNN_max_dens, boundary_density - * cdef int i, j, npart, chainID_i, part_mas_dens - * is_inside = bis_inside.astype("int32") # <<<<<<<<<<<<<< - * search_again = bsearch_again.astype("int32") - * pos = self.data - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bis_inside), __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 790, __pyx_L1_error) - __pyx_t_3 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_is_inside.rcbuffer->pybuffer); - __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_is_inside.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_4 < 0)) { - PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_is_inside.rcbuffer->pybuffer, (PyObject*)__pyx_v_is_inside, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); - } - } - __pyx_pybuffernd_is_inside.diminfo[0].strides = __pyx_pybuffernd_is_inside.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_is_inside.diminfo[0].shape = __pyx_pybuffernd_is_inside.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 790, __pyx_L1_error) - } - __pyx_t_3 = 0; - __pyx_v_is_inside = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":791 - * cdef int i, j, npart, chainID_i, part_mas_dens - * is_inside = bis_inside.astype("int32") - * search_again = bsearch_again.astype("int32") # <<<<<<<<<<<<<< - * pos = self.data - * npart = pos.shape[0] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bsearch_again), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __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, 791, __pyx_L1_error) - __pyx_t_8 = ((PyArrayObject *)__pyx_t_1); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_search_again.rcbuffer->pybuffer); - __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_search_again.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_4 < 0)) { - PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_search_again.rcbuffer->pybuffer, (PyObject*)__pyx_v_search_again, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5); - } - } - __pyx_pybuffernd_search_again.diminfo[0].strides = __pyx_pybuffernd_search_again.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_search_again.diminfo[0].shape = __pyx_pybuffernd_search_again.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 791, __pyx_L1_error) - } - __pyx_t_8 = 0; - __pyx_v_search_again = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":792 - * is_inside = bis_inside.astype("int32") - * search_again = bsearch_again.astype("int32") - * pos = self.data # <<<<<<<<<<<<<< - * npart = pos.shape[0] - * for i in range(3): period[i] = 1.0 - */ - if (!(likely(((__pyx_v_self->data) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->data, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 792, __pyx_L1_error) - __pyx_t_1 = __pyx_v_self->data; - __Pyx_INCREF(__pyx_t_1); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); - __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_4 < 0)) { - PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); - } - } - __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_pos.diminfo[1].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_pos.diminfo[1].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 792, __pyx_L1_error) - } - __pyx_v_pos = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":793 - * search_again = bsearch_again.astype("int32") - * pos = self.data - * npart = pos.shape[0] # <<<<<<<<<<<<<< - * for i in range(3): period[i] = 1.0 - * for i in xrange(npart): - */ - __pyx_v_npart = (__pyx_v_pos->dimensions[0]); - - /* "yt/utilities/spatial/ckdtree.pyx":794 - * pos = self.data - * npart = pos.shape[0] - * for i in range(3): period[i] = 1.0 # <<<<<<<<<<<<<< - * for i in xrange(npart): - * # Don't consider this particle if it's not part of a chain. - */ - for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - (__pyx_v_period[__pyx_v_i]) = 1.0; - } - - /* "yt/utilities/spatial/ckdtree.pyx":795 - * npart = pos.shape[0] - * for i in range(3): period[i] = 1.0 - * for i in xrange(npart): # <<<<<<<<<<<<<< - * # Don't consider this particle if it's not part of a chain. - * if chainID[i] < 0: continue - */ - __pyx_t_4 = __pyx_v_npart; - for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_4; __pyx_t_9+=1) { - __pyx_v_i = __pyx_t_9; - - /* "yt/utilities/spatial/ckdtree.pyx":797 - * for i in xrange(npart): - * # Don't consider this particle if it's not part of a chain. - * if chainID[i] < 0: continue # <<<<<<<<<<<<<< - * chainID_i = chainID[i] - * # If this particle is in the padding, don't make a connection. - */ - __pyx_t_10 = __pyx_v_i; - __pyx_t_11 = -1; - if (__pyx_t_10 < 0) { - __pyx_t_10 += __pyx_pybuffernd_chainID.diminfo[0].shape; - if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0; - } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_chainID.diminfo[0].shape)) __pyx_t_11 = 0; - if (unlikely(__pyx_t_11 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_11); - __PYX_ERR(0, 797, __pyx_L1_error) - } - __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_chainID.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_chainID.diminfo[0].strides)) < 0) != 0); - if (__pyx_t_12) { - goto __pyx_L5_continue; - } - - /* "yt/utilities/spatial/ckdtree.pyx":798 - * # Don't consider this particle if it's not part of a chain. - * if chainID[i] < 0: continue - * chainID_i = chainID[i] # <<<<<<<<<<<<<< - * # If this particle is in the padding, don't make a connection. - * if not is_inside[i]: continue - */ - __pyx_t_13 = __pyx_v_i; - __pyx_t_11 = -1; - if (__pyx_t_13 < 0) { - __pyx_t_13 += __pyx_pybuffernd_chainID.diminfo[0].shape; - if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 0; - } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_chainID.diminfo[0].shape)) __pyx_t_11 = 0; - if (unlikely(__pyx_t_11 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_11); - __PYX_ERR(0, 798, __pyx_L1_error) - } - __pyx_v_chainID_i = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_chainID.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_chainID.diminfo[0].strides)); - - /* "yt/utilities/spatial/ckdtree.pyx":800 - * chainID_i = chainID[i] - * # If this particle is in the padding, don't make a connection. - * if not is_inside[i]: continue # <<<<<<<<<<<<<< - * # Find this particle's chain max_dens. - * part_max_dens = densest_in_chain[chainID_i] - */ - __pyx_t_14 = __pyx_v_i; - __pyx_t_11 = -1; - if (__pyx_t_14 < 0) { - __pyx_t_14 += __pyx_pybuffernd_is_inside.diminfo[0].shape; - if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0; - } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_is_inside.diminfo[0].shape)) __pyx_t_11 = 0; - if (unlikely(__pyx_t_11 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_11); - __PYX_ERR(0, 800, __pyx_L1_error) - } - __pyx_t_12 = ((!((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_is_inside.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_is_inside.diminfo[0].strides)) != 0)) != 0); - if (__pyx_t_12) { - goto __pyx_L5_continue; - } - - /* "yt/utilities/spatial/ckdtree.pyx":802 - * if not is_inside[i]: continue - * # Find this particle's chain max_dens. - * part_max_dens = densest_in_chain[chainID_i] # <<<<<<<<<<<<<< - * # We're only connecting >= peakthresh chains now. - * if part_max_dens < peakthresh: continue - */ - __pyx_t_15 = __pyx_v_chainID_i; - __pyx_t_11 = -1; - if (__pyx_t_15 < 0) { - __pyx_t_15 += __pyx_pybuffernd_densest_in_chain.diminfo[0].shape; - if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 0; - } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_densest_in_chain.diminfo[0].shape)) __pyx_t_11 = 0; - if (unlikely(__pyx_t_11 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_11); - __PYX_ERR(0, 802, __pyx_L1_error) - } - __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_densest_in_chain.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_densest_in_chain.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_part_max_dens, __pyx_t_1); - __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":804 - * part_max_dens = densest_in_chain[chainID_i] - * # We're only connecting >= peakthresh chains now. - * if part_max_dens < peakthresh: continue # <<<<<<<<<<<<<< - * # Loop over nMerge closest nearest neighbors. - * for j in range(self.m): - */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_peakthresh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_part_max_dens, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 804, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_12) { - goto __pyx_L5_continue; - } - - /* "yt/utilities/spatial/ckdtree.pyx":806 - * if part_max_dens < peakthresh: continue - * # Loop over nMerge closest nearest neighbors. - * for j in range(self.m): # <<<<<<<<<<<<<< - * query[j] = pos[i,j] - * self.__query(dist_temp, tags_temp, - */ - __pyx_t_11 = __pyx_v_self->m; - for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_11; __pyx_t_16+=1) { - __pyx_v_j = __pyx_t_16; - - /* "yt/utilities/spatial/ckdtree.pyx":807 - * # Loop over nMerge closest nearest neighbors. - * for j in range(self.m): - * query[j] = pos[i,j] # <<<<<<<<<<<<<< - * self.__query(dist_temp, tags_temp, - * query, nn, 0.0, - */ - __pyx_t_17 = __pyx_v_i; - __pyx_t_18 = __pyx_v_j; - __pyx_t_19 = -1; - if (__pyx_t_17 < 0) { - __pyx_t_17 += __pyx_pybuffernd_pos.diminfo[0].shape; - if (unlikely(__pyx_t_17 < 0)) __pyx_t_19 = 0; - } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_19 = 0; - if (__pyx_t_18 < 0) { - __pyx_t_18 += __pyx_pybuffernd_pos.diminfo[1].shape; - if (unlikely(__pyx_t_18 < 0)) __pyx_t_19 = 1; - } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_pos.diminfo[1].shape)) __pyx_t_19 = 1; - if (unlikely(__pyx_t_19 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_19); - __PYX_ERR(0, 807, __pyx_L1_error) - } - (__pyx_v_query[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_pos.diminfo[1].strides)); - } - - /* "yt/utilities/spatial/ckdtree.pyx":808 - * for j in range(self.m): - * query[j] = pos[i,j] - * self.__query(dist_temp, tags_temp, # <<<<<<<<<<<<<< - * query, nn, 0.0, - * 2, infinity, period) - */ - ((struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->__pyx___query(__pyx_v_self, __pyx_v_dist_temp, __pyx_v_tags_temp, __pyx_v_query, __pyx_v_nn, 0.0, 2.0, __pyx_v_2yt_9utilities_7spatial_7ckdtree_infinity, __pyx_v_period); - - /* "yt/utilities/spatial/ckdtree.pyx":811 - * query, nn, 0.0, - * 2, infinity, period) - * same_count = 0 # <<<<<<<<<<<<<< - * for j in xrange(int(nMerge+1)): - * thisNN = tags_temp[j+1] # Don't consider ourselves at tags_temp[0] - */ - __pyx_v_same_count = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":812 - * 2, infinity, period) - * same_count = 0 - * for j in xrange(int(nMerge+1)): # <<<<<<<<<<<<<< - * thisNN = tags_temp[j+1] # Don't consider ourselves at tags_temp[0] - * thisNN_chainID = chainID[thisNN] - */ - __pyx_t_20 = (__pyx_v_nMerge + 1); - for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_20; __pyx_t_11+=1) { - __pyx_v_j = __pyx_t_11; - - /* "yt/utilities/spatial/ckdtree.pyx":813 - * same_count = 0 - * for j in xrange(int(nMerge+1)): - * thisNN = tags_temp[j+1] # Don't consider ourselves at tags_temp[0] # <<<<<<<<<<<<<< - * thisNN_chainID = chainID[thisNN] - * # If our neighbor is in the same chain, move on. - */ - __pyx_v_thisNN = (__pyx_v_tags_temp[(__pyx_v_j + 1)]); - - /* "yt/utilities/spatial/ckdtree.pyx":814 - * for j in xrange(int(nMerge+1)): - * thisNN = tags_temp[j+1] # Don't consider ourselves at tags_temp[0] - * thisNN_chainID = chainID[thisNN] # <<<<<<<<<<<<<< - * # If our neighbor is in the same chain, move on. - * # Move on if these chains are already connected: - */ - __pyx_t_21 = __pyx_v_thisNN; - __pyx_t_16 = -1; - if (__pyx_t_21 < 0) { - __pyx_t_21 += __pyx_pybuffernd_chainID.diminfo[0].shape; - if (unlikely(__pyx_t_21 < 0)) __pyx_t_16 = 0; - } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_chainID.diminfo[0].shape)) __pyx_t_16 = 0; - if (unlikely(__pyx_t_16 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_16); - __PYX_ERR(0, 814, __pyx_L1_error) - } - __pyx_v_thisNN_chainID = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_chainID.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_chainID.diminfo[0].strides)); - - /* "yt/utilities/spatial/ckdtree.pyx":817 - * # If our neighbor is in the same chain, move on. - * # Move on if these chains are already connected: - * if chainID_i == thisNN_chainID or \ # <<<<<<<<<<<<<< - * thisNN_chainID in chain_map[chainID_i]: - * same_count += 1 - */ - __pyx_t_22 = ((__pyx_v_chainID_i == __pyx_v_thisNN_chainID) != 0); - if (!__pyx_t_22) { - } else { - __pyx_t_12 = __pyx_t_22; - goto __pyx_L15_bool_binop_done; - } - - /* "yt/utilities/spatial/ckdtree.pyx":818 - * # Move on if these chains are already connected: - * if chainID_i == thisNN_chainID or \ - * thisNN_chainID in chain_map[chainID_i]: # <<<<<<<<<<<<<< - * same_count += 1 - * continue - */ - __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_thisNN_chainID); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_chain_map, __pyx_v_chainID_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_22 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_22 < 0)) __PYX_ERR(0, 818, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_23 = (__pyx_t_22 != 0); - __pyx_t_12 = __pyx_t_23; - __pyx_L15_bool_binop_done:; - - /* "yt/utilities/spatial/ckdtree.pyx":817 - * # If our neighbor is in the same chain, move on. - * # Move on if these chains are already connected: - * if chainID_i == thisNN_chainID or \ # <<<<<<<<<<<<<< - * thisNN_chainID in chain_map[chainID_i]: - * same_count += 1 - */ - if (__pyx_t_12) { - - /* "yt/utilities/spatial/ckdtree.pyx":819 - * if chainID_i == thisNN_chainID or \ - * thisNN_chainID in chain_map[chainID_i]: - * same_count += 1 # <<<<<<<<<<<<<< - * continue - * # Everything immediately below is for - */ - __pyx_v_same_count = (__pyx_v_same_count + 1); - - /* "yt/utilities/spatial/ckdtree.pyx":820 - * thisNN_chainID in chain_map[chainID_i]: - * same_count += 1 - * continue # <<<<<<<<<<<<<< - * # Everything immediately below is for - * # neighboring particles with a chainID. - */ - goto __pyx_L12_continue; - - /* "yt/utilities/spatial/ckdtree.pyx":817 - * # If our neighbor is in the same chain, move on. - * # Move on if these chains are already connected: - * if chainID_i == thisNN_chainID or \ # <<<<<<<<<<<<<< - * thisNN_chainID in chain_map[chainID_i]: - * same_count += 1 - */ - } - - /* "yt/utilities/spatial/ckdtree.pyx":823 - * # Everything immediately below is for - * # neighboring particles with a chainID. - * if thisNN_chainID >= 0: # <<<<<<<<<<<<<< - * # Find thisNN's chain's max_dens. - * thisNN_max_dens = densest_in_chain[thisNN_chainID] - */ - __pyx_t_12 = ((__pyx_v_thisNN_chainID >= 0) != 0); - if (__pyx_t_12) { - - /* "yt/utilities/spatial/ckdtree.pyx":825 - * if thisNN_chainID >= 0: - * # Find thisNN's chain's max_dens. - * thisNN_max_dens = densest_in_chain[thisNN_chainID] # <<<<<<<<<<<<<< - * # We're only linking peakthresh chains - * if thisNN_max_dens < peakthresh: continue - */ - __pyx_t_24 = __pyx_v_thisNN_chainID; - __pyx_t_16 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_pybuffernd_densest_in_chain.diminfo[0].shape; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_16 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_densest_in_chain.diminfo[0].shape)) __pyx_t_16 = 0; - if (unlikely(__pyx_t_16 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_16); - __PYX_ERR(0, 825, __pyx_L1_error) - } - __pyx_v_thisNN_max_dens = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_densest_in_chain.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_densest_in_chain.diminfo[0].strides)); - - /* "yt/utilities/spatial/ckdtree.pyx":827 - * thisNN_max_dens = densest_in_chain[thisNN_chainID] - * # We're only linking peakthresh chains - * if thisNN_max_dens < peakthresh: continue # <<<<<<<<<<<<<< - * # Calculate the two groups boundary density. - * boundary_density = (density[thisNN] + density[i]) / 2. - */ - __pyx_t_12 = ((__pyx_v_thisNN_max_dens < __pyx_v_peakthresh) != 0); - if (__pyx_t_12) { - goto __pyx_L12_continue; - } - - /* "yt/utilities/spatial/ckdtree.pyx":829 - * if thisNN_max_dens < peakthresh: continue - * # Calculate the two groups boundary density. - * boundary_density = (density[thisNN] + density[i]) / 2. # <<<<<<<<<<<<<< - * # Don't connect if the boundary is too low. - * if boundary_density < saddlethresh: continue - */ - __pyx_t_25 = __pyx_v_thisNN; - __pyx_t_16 = -1; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_pybuffernd_density.diminfo[0].shape; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_16 = 0; - } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_density.diminfo[0].shape)) __pyx_t_16 = 0; - if (unlikely(__pyx_t_16 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_16); - __PYX_ERR(0, 829, __pyx_L1_error) - } - __pyx_t_26 = __pyx_v_i; - __pyx_t_16 = -1; - if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_pybuffernd_density.diminfo[0].shape; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_16 = 0; - } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_density.diminfo[0].shape)) __pyx_t_16 = 0; - if (unlikely(__pyx_t_16 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_16); - __PYX_ERR(0, 829, __pyx_L1_error) - } - __pyx_v_boundary_density = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_density.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_density.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_density.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_density.diminfo[0].strides))) / 2.); - - /* "yt/utilities/spatial/ckdtree.pyx":831 - * boundary_density = (density[thisNN] + density[i]) / 2. - * # Don't connect if the boundary is too low. - * if boundary_density < saddlethresh: continue # <<<<<<<<<<<<<< - * # Mark these chains as related. - * chain_map[thisNN_chainID].add(chainID_i) - */ - __pyx_t_12 = ((__pyx_v_boundary_density < __pyx_v_saddlethresh) != 0); - if (__pyx_t_12) { - goto __pyx_L12_continue; - } - - /* "yt/utilities/spatial/ckdtree.pyx":833 - * if boundary_density < saddlethresh: continue - * # Mark these chains as related. - * chain_map[thisNN_chainID].add(chainID_i) # <<<<<<<<<<<<<< - * chain_map[chainID_i].add(thisNN_chainID) - * if same_count == nMerge + 1: - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_chain_map, __pyx_v_thisNN_chainID, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_27 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_add); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_27); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_chainID_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_28 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_27))) { - __pyx_t_28 = PyMethod_GET_SELF(__pyx_t_27); - if (likely(__pyx_t_28)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_27); - __Pyx_INCREF(__pyx_t_28); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_27, function); - } - } - if (!__pyx_t_28) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_27, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __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_27)) { - PyObject *__pyx_temp[2] = {__pyx_t_28, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_27, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 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_27)) { - PyObject *__pyx_temp[2] = {__pyx_t_28, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_27, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else - #endif - { - __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_29); - __Pyx_GIVEREF(__pyx_t_28); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_28); __pyx_t_28 = NULL; - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_27, __pyx_t_29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; - } - } - __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":834 - * # Mark these chains as related. - * chain_map[thisNN_chainID].add(chainID_i) - * chain_map[chainID_i].add(thisNN_chainID) # <<<<<<<<<<<<<< - * if same_count == nMerge + 1: - * # All our neighbors are in the same chain already, so - */ - __pyx_t_27 = __Pyx_GetItemInt(__pyx_v_chain_map, __pyx_v_chainID_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_27); - __pyx_t_29 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_add); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_29); - __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; - __pyx_t_27 = __Pyx_PyInt_From_npy_int64(__pyx_v_thisNN_chainID); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_27); - __pyx_t_2 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_29))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_29); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_29); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_29, function); - } - } - if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_29, __pyx_t_27); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_29)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_27}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_29, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_29)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_27}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_29, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; - } else - #endif - { - __pyx_t_28 = PyTuple_New(1+1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_28); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_2); __pyx_t_2 = NULL; - __Pyx_GIVEREF(__pyx_t_27); - PyTuple_SET_ITEM(__pyx_t_28, 0+1, __pyx_t_27); - __pyx_t_27 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_29, __pyx_t_28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; - } - } - __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":823 - * # Everything immediately below is for - * # neighboring particles with a chainID. - * if thisNN_chainID >= 0: # <<<<<<<<<<<<<< - * # Find thisNN's chain's max_dens. - * thisNN_max_dens = densest_in_chain[thisNN_chainID] - */ - } - __pyx_L12_continue:; - } - - /* "yt/utilities/spatial/ckdtree.pyx":835 - * chain_map[thisNN_chainID].add(chainID_i) - * chain_map[chainID_i].add(thisNN_chainID) - * if same_count == nMerge + 1: # <<<<<<<<<<<<<< - * # All our neighbors are in the same chain already, so - * # we don't need to search again. - */ - __pyx_t_12 = ((__pyx_v_same_count == (__pyx_v_nMerge + 1)) != 0); - if (__pyx_t_12) { - - /* "yt/utilities/spatial/ckdtree.pyx":838 - * # All our neighbors are in the same chain already, so - * # we don't need to search again. - * search_again[i] = 0 # <<<<<<<<<<<<<< - * return search_again - */ - __pyx_t_30 = __pyx_v_i; - __pyx_t_11 = -1; - if (__pyx_t_30 < 0) { - __pyx_t_30 += __pyx_pybuffernd_search_again.diminfo[0].shape; - if (unlikely(__pyx_t_30 < 0)) __pyx_t_11 = 0; - } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_search_again.diminfo[0].shape)) __pyx_t_11 = 0; - if (unlikely(__pyx_t_11 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_11); - __PYX_ERR(0, 838, __pyx_L1_error) - } - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_search_again.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_search_again.diminfo[0].strides) = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":835 - * chain_map[thisNN_chainID].add(chainID_i) - * chain_map[chainID_i].add(thisNN_chainID) - * if same_count == nMerge + 1: # <<<<<<<<<<<<<< - * # All our neighbors are in the same chain already, so - * # we don't need to search again. - */ - } - __pyx_L5_continue:; - } - - /* "yt/utilities/spatial/ckdtree.pyx":839 - * # we don't need to search again. - * search_again[i] = 0 - * return search_again # <<<<<<<<<<<<<< - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_search_again)); - __pyx_r = ((PyObject *)__pyx_v_search_again); - goto __pyx_L0; - - /* "yt/utilities/spatial/ckdtree.pyx":768 - * return chunk_tags - * - * def chainHOP_preconnect(self, np.ndarray[np.int64_t, ndim=1] chainID, # <<<<<<<<<<<<<< - * np.ndarray[np.float64_t, ndim=1] density, - * np.ndarray[np.float64_t, ndim=1] densest_in_chain, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_27); - __Pyx_XDECREF(__pyx_t_28); - __Pyx_XDECREF(__pyx_t_29); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_chainID.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_densest_in_chain.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_density.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_is_inside.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_search_again.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("yt.utilities.spatial.ckdtree.cKDTree.chainHOP_preconnect", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_chainID.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_densest_in_chain.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_density.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_is_inside.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_search_again.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_is_inside); - __Pyx_XDECREF((PyObject *)__pyx_v_search_again); - __Pyx_XDECREF((PyObject *)__pyx_v_pos); - __Pyx_XDECREF(__pyx_v_part_max_dens); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":222 - * - * cdef innernode* tree - * cdef readonly object data # <<<<<<<<<<<<<< - * cdef np.float64_t* raw_data - * cdef readonly int n, m - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4data_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4data_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4data___get__(((struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4data___get__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->data); - __pyx_r = __pyx_v_self->data; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":224 - * cdef readonly object data - * cdef np.float64_t* raw_data - * cdef readonly int n, m # <<<<<<<<<<<<<< - * cdef readonly int leafsize - * cdef readonly object maxes - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1n_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1n_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1n___get__(((struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1n___get__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__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 = __Pyx_PyInt_From_int(__pyx_v_self->n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __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("yt.utilities.spatial.ckdtree.cKDTree.n.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1m_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1m_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1m___get__(((struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1m___get__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__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 = __Pyx_PyInt_From_int(__pyx_v_self->m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __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("yt.utilities.spatial.ckdtree.cKDTree.m.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":225 - * cdef np.float64_t* raw_data - * cdef readonly int n, m - * cdef readonly int leafsize # <<<<<<<<<<<<<< - * cdef readonly object maxes - * cdef np.float64_t* raw_maxes - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_8leafsize_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_8leafsize_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_8leafsize___get__(((struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_8leafsize___get__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__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 = __Pyx_PyInt_From_int(__pyx_v_self->leafsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __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("yt.utilities.spatial.ckdtree.cKDTree.leafsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":226 - * cdef readonly int n, m - * cdef readonly int leafsize - * cdef readonly object maxes # <<<<<<<<<<<<<< - * cdef np.float64_t* raw_maxes - * cdef readonly object mins - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_5maxes_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_5maxes_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_5maxes___get__(((struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_5maxes___get__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->maxes); - __pyx_r = __pyx_v_self->maxes; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "yt/utilities/spatial/ckdtree.pyx":228 - * cdef readonly object maxes - * cdef np.float64_t* raw_maxes - * cdef readonly object mins # <<<<<<<<<<<<<< - * cdef np.float64_t* raw_mins - * cdef object indices - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4mins_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4mins_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4mins___get__(((struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4mins___get__(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->mins); - __pyx_r = __pyx_v_self->mins; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim - */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - */ - __pyx_v_endian_detector = 1; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - goto __pyx_L4; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 218, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 222, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - goto __pyx_L11; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * 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)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * 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_L11:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * 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; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset - */ - __pyx_v_f = NULL; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * 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; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - goto __pyx_L14; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 259, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 278, __pyx_L1_error) - break; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * 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, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * 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, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * 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, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * 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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * 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; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { - PyArray_Descr *__pyx_v_child = 0; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - PyObject *__pyx_v_fields = 0; - PyObject *__pyx_v_childname = NULL; - PyObject *__pyx_v_new_offset = NULL; - PyObject *__pyx_v_t = NULL; - char *__pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - long __pyx_t_8; - char *__pyx_t_9; - __Pyx_RefNannySetupContext("_util_dtypestring", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * 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, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: - */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 796, __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, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 799, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * 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") - * - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); - if (!__pyx_t_7) { - goto __pyx_L8_next_or; - } else { - } - __pyx_t_7 = (__pyx_v_little_endian != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_L8_next_or:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 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:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 803, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 - */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 0x78; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __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 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 844, __pyx_L1_error) - } - __pyx_L15:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - goto __pyx_L13; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * - */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! - */ - __pyx_v_baseptr = NULL; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - goto __pyx_L3; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * 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:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * 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); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): - */ - __pyx_v_arr->base = __pyx_v_baseptr; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * 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; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_array", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 - * cdef inline int import_array() except -1: - * try: - * _import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") - */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 - * try: - * _import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") - * - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * _import_array() - * except Exception: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * _import_array() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_umath", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_ufunc() except -1: - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("import_ufunc", 0); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_PyThreadState_assign - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1001, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - __pyx_L5_except_error:; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L10_try_end:; - } - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static struct __pyx_vtabstruct_2yt_9utilities_7spatial_7ckdtree_cKDTree __pyx_vtable_2yt_9utilities_7spatial_7ckdtree_cKDTree; - -static PyObject *__pyx_tp_new_2yt_9utilities_7spatial_7ckdtree_cKDTree(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *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_2yt_9utilities_7spatial_7ckdtree_cKDTree *)o); - p->__pyx_vtab = __pyx_vtabptr_2yt_9utilities_7spatial_7ckdtree_cKDTree; - p->data = Py_None; Py_INCREF(Py_None); - p->maxes = Py_None; Py_INCREF(Py_None); - p->mins = Py_None; Py_INCREF(Py_None); - p->indices = Py_None; Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_2yt_9utilities_7spatial_7ckdtree_cKDTree(PyObject *o) { - struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *p = (struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_3__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_CLEAR(p->data); - Py_CLEAR(p->maxes); - Py_CLEAR(p->mins); - Py_CLEAR(p->indices); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_2yt_9utilities_7spatial_7ckdtree_cKDTree(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *p = (struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)o; - if (p->data) { - e = (*v)(p->data, a); if (e) return e; - } - if (p->maxes) { - e = (*v)(p->maxes, a); if (e) return e; - } - if (p->mins) { - e = (*v)(p->mins, a); if (e) return e; - } - if (p->indices) { - e = (*v)(p->indices, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_2yt_9utilities_7spatial_7ckdtree_cKDTree(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *p = (struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *)o; - tmp = ((PyObject*)p->data); - p->data = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->maxes); - p->maxes = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->mins); - p->mins = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->indices); - p->indices = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_2yt_9utilities_7spatial_7ckdtree_7cKDTree_data(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4data_1__get__(o); -} - -static PyObject *__pyx_getprop_2yt_9utilities_7spatial_7ckdtree_7cKDTree_n(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1n_1__get__(o); -} - -static PyObject *__pyx_getprop_2yt_9utilities_7spatial_7ckdtree_7cKDTree_m(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1m_1__get__(o); -} - -static PyObject *__pyx_getprop_2yt_9utilities_7spatial_7ckdtree_7cKDTree_leafsize(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_8leafsize_1__get__(o); -} - -static PyObject *__pyx_getprop_2yt_9utilities_7spatial_7ckdtree_7cKDTree_maxes(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_5maxes_1__get__(o); -} - -static PyObject *__pyx_getprop_2yt_9utilities_7spatial_7ckdtree_7cKDTree_mins(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4mins_1__get__(o); -} - -static PyMethodDef __pyx_methods_2yt_9utilities_7spatial_7ckdtree_cKDTree[] = { - {"query", (PyCFunction)__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_5query, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_9utilities_7spatial_7ckdtree_7cKDTree_4query}, - {"chainHOP_get_dens", (PyCFunction)__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_7chainHOP_get_dens, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_9utilities_7spatial_7ckdtree_7cKDTree_6chainHOP_get_dens}, - {"find_chunk_nearest_neighbors", (PyCFunction)__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_9find_chunk_nearest_neighbors, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_9utilities_7spatial_7ckdtree_7cKDTree_8find_chunk_nearest_neighbors}, - {"chainHOP_preconnect", (PyCFunction)__pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_11chainHOP_preconnect, METH_VARARGS|METH_KEYWORDS, 0}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_2yt_9utilities_7spatial_7ckdtree_cKDTree[] = { - {(char *)"data", __pyx_getprop_2yt_9utilities_7spatial_7ckdtree_7cKDTree_data, 0, (char *)0, 0}, - {(char *)"n", __pyx_getprop_2yt_9utilities_7spatial_7ckdtree_7cKDTree_n, 0, (char *)0, 0}, - {(char *)"m", __pyx_getprop_2yt_9utilities_7spatial_7ckdtree_7cKDTree_m, 0, (char *)0, 0}, - {(char *)"leafsize", __pyx_getprop_2yt_9utilities_7spatial_7ckdtree_7cKDTree_leafsize, 0, (char *)0, 0}, - {(char *)"maxes", __pyx_getprop_2yt_9utilities_7spatial_7ckdtree_7cKDTree_maxes, 0, (char *)0, 0}, - {(char *)"mins", __pyx_getprop_2yt_9utilities_7spatial_7ckdtree_7cKDTree_mins, 0, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_2yt_9utilities_7spatial_7ckdtree_cKDTree = { - PyVarObject_HEAD_INIT(0, 0) - "yt.utilities.spatial.ckdtree.cKDTree", /*tp_name*/ - sizeof(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_2yt_9utilities_7spatial_7ckdtree_cKDTree, /*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*/ - "kd-tree for quick nearest-neighbor lookup\n\n This class provides an index into a set of k-dimensional points\n which can be used to rapidly look up the nearest neighbors of any\n point.\n\n The algorithm used is described in Maneewongvatana and Mount 1999.\n The general idea is that the kd-tree is a binary trie, each of whose\n nodes represents an axis-aligned hyperrectangle. Each node specifies\n an axis and splits the set of points based on whether their coordinate\n along that axis is greater than or less than a particular value.\n\n During construction, the axis and splitting point are chosen by the\n \"sliding midpoint\" rule, which ensures that the cells do not all\n become long and thin.\n\n The tree can be queried for the r closest neighbors of any given point\n (optionally returning only those within some maximum distance of the\n point). It can also be queried, with a substantial gain in efficiency,\n for the r approximate closest neighbors.\n\n For large dimensions (20 is already large) do not expect this to run\n significantly faster than brute force. High-dimensional nearest-neighbor\n queries are a substantial open problem in computer science.\n\n Parameters\n ----------\n data : array-like, shape (n,m)\n The n data points of dimension m to be indexed. This array is\n not copied unless this is necessary to produce a contiguous\n array of np.float64_ts, and so modifying this data will result in\n bogus results.\n leafsize : positive integer\n The number of points at which the algorithm switches over to\n brute-force.\n\n ", /*tp_doc*/ - __pyx_tp_traverse_2yt_9utilities_7spatial_7ckdtree_cKDTree, /*tp_traverse*/ - __pyx_tp_clear_2yt_9utilities_7spatial_7ckdtree_cKDTree, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_2yt_9utilities_7spatial_7ckdtree_cKDTree, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_2yt_9utilities_7spatial_7ckdtree_cKDTree, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_2yt_9utilities_7spatial_7ckdtree_7cKDTree_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_2yt_9utilities_7spatial_7ckdtree_cKDTree, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "ckdtree", - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, - {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, - {&__pyx_kp_s_Heap_containing_d_items_cannot_b, __pyx_k_Heap_containing_d_items_cannot_b, sizeof(__pyx_k_Heap_containing_d_items_cannot_b), 0, 0, 1, 0}, - {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 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_kp_s_Only_p_norms_with_1_p_infinity_p, __pyx_k_Only_p_norms_with_1_p_infinity_p, sizeof(__pyx_k_Only_p_norms_with_1_p_infinity_p), 0, 0, 1, 0}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, - {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, - {&__pyx_n_s_amax, __pyx_k_amax, sizeof(__pyx_k_amax), 0, 0, 1, 1}, - {&__pyx_n_s_amin, __pyx_k_amin, sizeof(__pyx_k_amin), 0, 0, 1, 1}, - {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 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_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1}, - {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, - {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, - {&__pyx_n_s_bis_inside, __pyx_k_bis_inside, sizeof(__pyx_k_bis_inside), 0, 0, 1, 1}, - {&__pyx_n_s_bsearch_again, __pyx_k_bsearch_again, sizeof(__pyx_k_bsearch_again), 0, 0, 1, 1}, - {&__pyx_n_s_cKDTree, __pyx_k_cKDTree, sizeof(__pyx_k_cKDTree), 0, 0, 1, 1}, - {&__pyx_n_s_chainID, __pyx_k_chainID, sizeof(__pyx_k_chainID), 0, 0, 1, 1}, - {&__pyx_n_s_chain_map, __pyx_k_chain_map, sizeof(__pyx_k_chain_map), 0, 0, 1, 1}, - {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, - {&__pyx_n_s_densest_in_chain, __pyx_k_densest_in_chain, sizeof(__pyx_k_densest_in_chain), 0, 0, 1, 1}, - {&__pyx_n_s_density, __pyx_k_density, sizeof(__pyx_k_density), 0, 0, 1, 1}, - {&__pyx_n_s_distance_upper_bound, __pyx_k_distance_upper_bound, sizeof(__pyx_k_distance_upper_bound), 0, 0, 1, 1}, - {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, - {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, - {&__pyx_n_s_eps, __pyx_k_eps, sizeof(__pyx_k_eps), 0, 0, 1, 1}, - {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, - {&__pyx_n_s_finish, __pyx_k_finish, sizeof(__pyx_k_finish), 0, 0, 1, 1}, - {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, - {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, - {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, - {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, - {&__pyx_n_s_kdtree, __pyx_k_kdtree, sizeof(__pyx_k_kdtree), 0, 0, 1, 1}, - {&__pyx_n_s_leafsize, __pyx_k_leafsize, sizeof(__pyx_k_leafsize), 0, 0, 1, 1}, - {&__pyx_kp_s_leafsize_must_be_at_least_1, __pyx_k_leafsize_must_be_at_least_1, sizeof(__pyx_k_leafsize_must_be_at_least_1), 0, 0, 1, 0}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_nMerge, __pyx_k_nMerge, sizeof(__pyx_k_nMerge), 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_newaxis, __pyx_k_newaxis, sizeof(__pyx_k_newaxis), 0, 0, 1, 1}, - {&__pyx_n_s_nn, __pyx_k_nn, sizeof(__pyx_k_nn), 0, 0, 1, 1}, - {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_n_s_num_neighbors, __pyx_k_num_neighbors, sizeof(__pyx_k_num_neighbors), 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_omass, __pyx_k_omass, sizeof(__pyx_k_omass), 0, 0, 1, 1}, - {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, - {&__pyx_n_s_peakthresh, __pyx_k_peakthresh, sizeof(__pyx_k_peakthresh), 0, 0, 1, 1}, - {&__pyx_n_s_period, __pyx_k_period, sizeof(__pyx_k_period), 0, 0, 1, 1}, - {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1}, - {&__pyx_n_s_prod, __pyx_k_prod, sizeof(__pyx_k_prod), 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_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1}, - {&__pyx_n_s_saddlethresh, __pyx_k_saddlethresh, sizeof(__pyx_k_saddlethresh), 0, 0, 1, 1}, - {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, - {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, - {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, - {&__pyx_kp_s_x_must_consist_of_vectors_of_len, __pyx_k_x_must_consist_of_vectors_of_len, sizeof(__pyx_k_x_must_consist_of_vectors_of_len), 0, 0, 1, 0}, - {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1}, - {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 42, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 132, __pyx_L1_error) - #if PY_MAJOR_VERSION >= 3 - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 795, __pyx_L1_error) - #else - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 795, __pyx_L1_error) - #endif - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "yt/utilities/spatial/ckdtree.pyx":241 - * self.leafsize = leafsize - * if self.leafsize<1: - * raise ValueError("leafsize must be at least 1") # <<<<<<<<<<<<<< - * self.maxes = np.ascontiguousarray(np.amax(self.data,axis=0)) - * self.mins = np.ascontiguousarray(np.amin(self.data,axis=0)) - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_leafsize_must_be_at_least_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - - /* "yt/utilities/spatial/ckdtree.pyx":589 - * cdef np.ndarray[np.float64_t, ndim=1] cperiod - * cdef int c - * x = np.asarray(x).astype("float64") # <<<<<<<<<<<<<< - * if period is None: - * period = np.array([np.inf]*self.m) - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "yt/utilities/spatial/ckdtree.pyx":593 - * period = np.array([np.inf]*self.m) - * else: - * period = np.asarray(period).astype("float64") # <<<<<<<<<<<<<< - * cperiod = np.ascontiguousarray(period) - * if np.shape(x)[-1] != self.m: - */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - - /* "yt/utilities/spatial/ckdtree.pyx":598 - * raise ValueError("x must consist of vectors of length %d but has shape %s" % (self.m, np.shape(x))) - * if p<1: - * raise ValueError("Only p-norms with 1<=p<=infinity permitted") # <<<<<<<<<<<<<< - * if len(x.shape)==1: - * single = True - */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Only_p_norms_with_1_p_infinity_p); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "yt/utilities/spatial/ckdtree.pyx":601 - * if len(x.shape)==1: - * single = True - * x = x[np.newaxis,:] # <<<<<<<<<<<<<< - * else: - * single = False - */ - __pyx_slice__6 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__6)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__6); - __Pyx_GIVEREF(__pyx_slice__6); - - /* "yt/utilities/spatial/ckdtree.pyx":604 - * else: - * single = False - * retshape = np.shape(x)[:-1] # <<<<<<<<<<<<<< - * n = np.prod(retshape) - * xx = np.reshape(x,(n,self.m)) - */ - __pyx_slice__7 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__7); - __Pyx_GIVEREF(__pyx_slice__7); - - /* "yt/utilities/spatial/ckdtree.pyx":629 - * else: - * if k==1: - * return np.reshape(dd[...,0],retshape), np.reshape(ii[...,0],retshape) # <<<<<<<<<<<<<< - * else: - * return np.reshape(dd,retshape+(k,)), np.reshape(ii,retshape+(k,)) - */ - __pyx_tuple__8 = PyTuple_Pack(2, Py_Ellipsis, __pyx_int_0); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_tuple__9 = PyTuple_Pack(2, Py_Ellipsis, __pyx_int_0); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - - /* "yt/utilities/spatial/ckdtree.pyx":675 - * cdef np.ndarray[np.float64_t, ndim=2] local_data = self.data - * - * cdef np.ndarray[np.float64_t, ndim=1] mass = np.array(omass).astype("float64") # <<<<<<<<<<<<<< - * cdef np.float64_t ipi = 1.0/np.pi - * - */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - - /* "yt/utilities/spatial/ckdtree.pyx":790 - * cdef np.float64_t thisNN_max_dens, boundary_density - * cdef int i, j, npart, chainID_i, part_mas_dens - * is_inside = bis_inside.astype("int32") # <<<<<<<<<<<<<< - * search_again = bsearch_again.astype("int32") - * pos = self.data - */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 790, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - - /* "yt/utilities/spatial/ckdtree.pyx":791 - * cdef int i, j, npart, chainID_i, part_mas_dens - * is_inside = bis_inside.astype("int32") - * search_again = bsearch_again.astype("int32") # <<<<<<<<<<<<<< - * pos = self.data - * npart = pos.shape[0] - */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * 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__16 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 - * _import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: - */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_ufunc() except -1: - */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - __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_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_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; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initckdtree(void); /*proto*/ -PyMODINIT_FUNC initckdtree(void) -#else -PyMODINIT_FUNC PyInit_ckdtree(void); /*proto*/ -PyMODINIT_FUNC PyInit_ckdtree(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __pyx_t_5numpy_float64_t __pyx_t_3; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_ckdtree(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_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 PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("ckdtree", __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) - __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) - #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_yt__utilities__spatial__ckdtree) { - 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, "yt.utilities.spatial.ckdtree")) { - if (unlikely(PyDict_SetItemString(modules, "yt.utilities.spatial.ckdtree", __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 init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - __pyx_vtabptr_2yt_9utilities_7spatial_7ckdtree_cKDTree = &__pyx_vtable_2yt_9utilities_7spatial_7ckdtree_cKDTree; - __pyx_vtable_2yt_9utilities_7spatial_7ckdtree_cKDTree.__pyx___build = (struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *(*)(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *, int, int, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_9utilities_7spatial_7ckdtree_7cKDTree___build; - __pyx_vtable_2yt_9utilities_7spatial_7ckdtree_cKDTree.__pyx___free_tree = (PyObject *(*)(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *, struct __pyx_t_2yt_9utilities_7spatial_7ckdtree_innernode *))__pyx_f_2yt_9utilities_7spatial_7ckdtree_7cKDTree___free_tree; - __pyx_vtable_2yt_9utilities_7spatial_7ckdtree_cKDTree.__pyx___query = (void (*)(struct __pyx_obj_2yt_9utilities_7spatial_7ckdtree_cKDTree *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_float64_t *, int, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_9utilities_7spatial_7ckdtree_7cKDTree___query; - if (PyType_Ready(&__pyx_type_2yt_9utilities_7spatial_7ckdtree_cKDTree) < 0) __PYX_ERR(0, 182, __pyx_L1_error) - __pyx_type_2yt_9utilities_7spatial_7ckdtree_cKDTree.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_7spatial_7ckdtree_cKDTree.tp_dict, __pyx_vtabptr_2yt_9utilities_7spatial_7ckdtree_cKDTree) < 0) __PYX_ERR(0, 182, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "cKDTree", (PyObject *)&__pyx_type_2yt_9utilities_7spatial_7ckdtree_cKDTree) < 0) __PYX_ERR(0, 182, __pyx_L1_error) - __pyx_ptype_2yt_9utilities_7spatial_7ckdtree_cKDTree = &__pyx_type_2yt_9utilities_7spatial_7ckdtree_cKDTree; - /*--- Type import code ---*/ - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", - #if CYTHON_COMPILING_IN_PYPY - sizeof(PyTypeObject), - #else - sizeof(PyHeapTypeObject), - #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "yt/utilities/spatial/ckdtree.pyx":3 - * # Copyright Anne M. Archibald 2008 - * # Released under the scipy license - * import numpy as np # <<<<<<<<<<<<<< - * cimport numpy as np - * cimport libc.stdlib as stdlib - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":8 - * cimport cython - * - * import kdtree # <<<<<<<<<<<<<< - * - * cdef extern from "platform_dep.h": - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_kdtree, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_kdtree, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":14 - * void *alloca(int) - * - * cdef np.float64_t infinity = np.inf # <<<<<<<<<<<<<< - * - * __all__ = ['cKDTree'] - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_2yt_9utilities_7spatial_7ckdtree_infinity = __pyx_t_3; - - /* "yt/utilities/spatial/ckdtree.pyx":16 - * cdef np.float64_t infinity = np.inf - * - * __all__ = ['cKDTree'] # <<<<<<<<<<<<<< - * - * # priority queue - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_cKDTree); - __Pyx_GIVEREF(__pyx_n_s_cKDTree); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_cKDTree); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "yt/utilities/spatial/ckdtree.pyx":545 - * - * def query(cKDTree self, object x, int k=1, np.float64_t eps=0, np.float64_t p=2, - * np.float64_t distance_upper_bound=infinity, object period=None): # <<<<<<<<<<<<<< - * """query(self, x, k=1, eps=0, p=2, distance_upper_bound=np.inf, - * period=None) - */ - __pyx_k__2 = __pyx_v_2yt_9utilities_7spatial_7ckdtree_infinity; - - /* "yt/utilities/spatial/ckdtree.pyx":1 - * # Copyright Anne M. Archibald 2008 # <<<<<<<<<<<<<< - * # Released under the scipy license - * import numpy as np - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /*--- 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 yt.utilities.spatial.ckdtree", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init yt.utilities.spatial.ckdtree"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #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 - -/* 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; -} - -/* 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 - -/* 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 PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* 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 -} - -/* 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); -} - -/* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -/* PyCFunctionFastCall */ - #if CYTHON_FAST_PYCCALL -static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { - PyCFunctionObject *func = (PyCFunctionObject*)func_obj; - PyCFunction meth = PyCFunction_GET_FUNCTION(func); - PyObject *self = PyCFunction_GET_SELF(func); - assert(PyCFunction_Check(func)); - assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); - assert(nargs >= 0); - assert(nargs == 0 || args != NULL); - /* _PyCFunction_FastCallDict() must not be called with an exception set, - because it may clear it (directly or indirectly) and so the - caller loses its exception */ - assert(!PyErr_Occurred()); - return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); -} -#endif // CYTHON_FAST_PYCCALL - -/* PyFunctionFastCall */ - #if CYTHON_FAST_PYCALL -#include "frameobject.h" -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = PyThreadState_GET(); - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = f->f_localsplus; - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -#if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; -#if PY_MAJOR_VERSION >= 3 - PyObject *kwdefs; -#endif - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { - return NULL; - } - if ( -#if PY_MAJOR_VERSION >= 3 - co->co_kwonlyargcount == 0 && -#endif - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 - kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } -#if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, - k, (int)nk, - d, (int)nd, closure); -#endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif // CPython < 3.6 -#endif // CYTHON_FAST_PYCALL - -/* PyObjectCallMethO */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - 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 -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); -#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 - -/* 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"); -} - -/* IterFinish */ - static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = PyThreadState_GET(); - PyObject* exc_type = tstate->curexc_type; - if (unlikely(exc_type)) { - if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { - PyObject *exc_value, *exc_tb; - exc_value = tstate->curexc_value; - exc_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - Py_DECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - return 0; - } else { - return -1; - } - } - return 0; -#else - if (unlikely(PyErr_Occurred())) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { - PyErr_Clear(); - return 0; - } else { - return -1; - } - } - return 0; -#endif -} - -/* UnpackItemEndCheck */ - static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else { - return __Pyx_IterFinish(); - } - return 0; -} - -/* 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(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -/* BufferFormatCheck */ - static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { - unsigned int n = 1; - return *(unsigned char*)(&n) != 0; -} -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type) { - stack[0].field = &ctx->root; - stack[0].parent_offset = 0; - ctx->root.type = type; - ctx->root.name = "buffer dtype"; - ctx->root.offset = 0; - ctx->head = stack; - ctx->head->field = &ctx->root; - ctx->fmt_offset = 0; - ctx->head->parent_offset = 0; - ctx->new_packmode = '@'; - ctx->enc_packmode = '@'; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->is_complex = 0; - ctx->is_valid_array = 0; - ctx->struct_alignment = 0; - while (type->typegroup == 'S') { - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = 0; - type = type->fields->type; - } -} -static int __Pyx_BufFmt_ParseNumber(const char** ts) { - int count; - const char* t = *ts; - if (*t < '0' || *t > '9') { - return -1; - } else { - count = *t++ - '0'; - while (*t >= '0' && *t < '9') { - count *= 10; - count += *t++ - '0'; - } - } - *ts = t; - return count; -} -static int __Pyx_BufFmt_ExpectNumber(const char **ts) { - int number = __Pyx_BufFmt_ParseNumber(ts); - if (number == -1) - PyErr_Format(PyExc_ValueError,\ - "Does not understand character buffer dtype format string ('%c')", **ts); - return number; -} -static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { - PyErr_Format(PyExc_ValueError, - "Unexpected format string character: '%c'", ch); -} -static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { - switch (ch) { - case 'c': return "'char'"; - case 'b': return "'signed char'"; - case 'B': return "'unsigned char'"; - case 'h': return "'short'"; - case 'H': return "'unsigned short'"; - case 'i': return "'int'"; - case 'I': return "'unsigned int'"; - case 'l': return "'long'"; - case 'L': return "'unsigned long'"; - case 'q': return "'long long'"; - case 'Q': return "'unsigned long long'"; - case 'f': return (is_complex ? "'complex float'" : "'float'"); - case 'd': return (is_complex ? "'complex double'" : "'double'"); - case 'g': return (is_complex ? "'complex long double'" : "'long double'"); - case 'T': return "a struct"; - case 'O': return "Python object"; - case 'P': return "a pointer"; - case 's': case 'p': return "a string"; - case 0: return "end"; - default: return "unparseable format string"; - } -} -static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return 2; - case 'i': case 'I': case 'l': case 'L': return 4; - case 'q': case 'Q': return 8; - case 'f': return (is_complex ? 8 : 4); - case 'd': return (is_complex ? 16 : 8); - case 'g': { - PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); - return 0; - } - case 'O': case 'P': return sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} -static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { - switch (ch) { - case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(short); - case 'i': case 'I': return sizeof(int); - case 'l': case 'L': return sizeof(long); - #ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(PY_LONG_LONG); - #endif - case 'f': return sizeof(float) * (is_complex ? 2 : 1); - case 'd': return sizeof(double) * (is_complex ? 2 : 1); - case 'g': return sizeof(long double) * (is_complex ? 2 : 1); - case 'O': case 'P': return sizeof(void*); - default: { - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } - } -} -typedef struct { char c; short x; } __Pyx_st_short; -typedef struct { char c; int x; } __Pyx_st_int; -typedef struct { char c; long x; } __Pyx_st_long; -typedef struct { char c; float x; } __Pyx_st_float; -typedef struct { char c; double x; } __Pyx_st_double; -typedef struct { char c; long double x; } __Pyx_st_longdouble; -typedef struct { char c; void *x; } __Pyx_st_void_p; -#ifdef HAVE_LONG_LONG -typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; -#endif -static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); - case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); - case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); -#ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); -#endif - case 'f': return sizeof(__Pyx_st_float) - sizeof(float); - case 'd': return sizeof(__Pyx_st_double) - sizeof(double); - case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); - case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} -/* These are for computing the padding at the end of the struct to align - on the first member of the struct. This will probably the same as above, - but we don't have any guarantees. - */ -typedef struct { short x; char c; } __Pyx_pad_short; -typedef struct { int x; char c; } __Pyx_pad_int; -typedef struct { long x; char c; } __Pyx_pad_long; -typedef struct { float x; char c; } __Pyx_pad_float; -typedef struct { double x; char c; } __Pyx_pad_double; -typedef struct { long double x; char c; } __Pyx_pad_longdouble; -typedef struct { void *x; char c; } __Pyx_pad_void_p; -#ifdef HAVE_LONG_LONG -typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; -#endif -static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); - case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); - case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); -#ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); -#endif - case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); - case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); - case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); - case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} -static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { - switch (ch) { - case 'c': - return 'H'; - case 'b': case 'h': case 'i': - case 'l': case 'q': case 's': case 'p': - return 'I'; - case 'B': case 'H': case 'I': case 'L': case 'Q': - return 'U'; - case 'f': case 'd': case 'g': - return (is_complex ? 'C' : 'R'); - case 'O': - return 'O'; - case 'P': - return 'P'; - default: { - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } - } -} -static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { - if (ctx->head == NULL || ctx->head->field == &ctx->root) { - const char* expected; - const char* quote; - if (ctx->head == NULL) { - expected = "end"; - quote = ""; - } else { - expected = ctx->head->field->type->name; - quote = "'"; - } - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch, expected %s%s%s but got %s", - quote, expected, quote, - __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); - } else { - __Pyx_StructField* field = ctx->head->field; - __Pyx_StructField* parent = (ctx->head - 1)->field; - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", - field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), - parent->type->name, field->name); - } -} -static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { - char group; - size_t size, offset, arraysize = 1; - if (ctx->enc_type == 0) return 0; - if (ctx->head->field->type->arraysize[0]) { - int i, ndim = 0; - if (ctx->enc_type == 's' || ctx->enc_type == 'p') { - ctx->is_valid_array = ctx->head->field->type->ndim == 1; - ndim = 1; - if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { - PyErr_Format(PyExc_ValueError, - "Expected a dimension of size %zu, got %zu", - ctx->head->field->type->arraysize[0], ctx->enc_count); - return -1; - } - } - if (!ctx->is_valid_array) { - PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", - ctx->head->field->type->ndim, ndim); - return -1; - } - for (i = 0; i < ctx->head->field->type->ndim; i++) { - arraysize *= ctx->head->field->type->arraysize[i]; - } - ctx->is_valid_array = 0; - ctx->enc_count = 1; - } - group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); - do { - __Pyx_StructField* field = ctx->head->field; - __Pyx_TypeInfo* type = field->type; - if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { - size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); - } else { - size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); - } - if (ctx->enc_packmode == '@') { - size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); - size_t align_mod_offset; - if (align_at == 0) return -1; - align_mod_offset = ctx->fmt_offset % align_at; - if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; - if (ctx->struct_alignment == 0) - ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, - ctx->is_complex); - } - if (type->size != size || type->typegroup != group) { - if (type->typegroup == 'C' && type->fields != NULL) { - size_t parent_offset = ctx->head->parent_offset + field->offset; - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = parent_offset; - continue; - } - if ((type->typegroup == 'H' || group == 'H') && type->size == size) { - } else { - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; - } - } - offset = ctx->head->parent_offset + field->offset; - if (ctx->fmt_offset != offset) { - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", - (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); - return -1; - } - ctx->fmt_offset += size; - if (arraysize) - ctx->fmt_offset += (arraysize - 1) * size; - --ctx->enc_count; - while (1) { - if (field == &ctx->root) { - ctx->head = NULL; - if (ctx->enc_count != 0) { - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; - } - break; - } - ctx->head->field = ++field; - if (field->type == NULL) { - --ctx->head; - field = ctx->head->field; - continue; - } else if (field->type->typegroup == 'S') { - size_t parent_offset = ctx->head->parent_offset + field->offset; - if (field->type->fields->type == NULL) continue; - field = field->type->fields; - ++ctx->head; - ctx->head->field = field; - ctx->head->parent_offset = parent_offset; - break; - } else { - break; - } - } - } while (ctx->enc_count); - ctx->enc_type = 0; - ctx->is_complex = 0; - return 0; -} -static CYTHON_INLINE PyObject * -__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) -{ - const char *ts = *tsp; - int i = 0, number; - int ndim = ctx->head->field->type->ndim; -; - ++ts; - if (ctx->new_count != 1) { - PyErr_SetString(PyExc_ValueError, - "Cannot handle repeated arrays in format string"); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - while (*ts && *ts != ')') { - switch (*ts) { - case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; - default: break; - } - number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return NULL; - if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) - return PyErr_Format(PyExc_ValueError, - "Expected a dimension of size %zu, got %d", - ctx->head->field->type->arraysize[i], number); - if (*ts != ',' && *ts != ')') - return PyErr_Format(PyExc_ValueError, - "Expected a comma in format string, got '%c'", *ts); - if (*ts == ',') ts++; - i++; - } - if (i != ndim) - return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", - ctx->head->field->type->ndim, i); - if (!*ts) { - PyErr_SetString(PyExc_ValueError, - "Unexpected end of format string, expected ')'"); - return NULL; - } - ctx->is_valid_array = 1; - ctx->new_count = 1; - *tsp = ++ts; - return Py_None; -} -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { - int got_Z = 0; - while (1) { - switch(*ts) { - case 0: - if (ctx->enc_type != 0 && ctx->head == NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - if (ctx->head != NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - return ts; - case ' ': - case '\r': - case '\n': - ++ts; - break; - case '<': - if (!__Pyx_IsLittleEndian()) { - PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); - return NULL; - } - ctx->new_packmode = '='; - ++ts; - break; - case '>': - case '!': - if (__Pyx_IsLittleEndian()) { - PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); - return NULL; - } - ctx->new_packmode = '='; - ++ts; - break; - case '=': - case '@': - case '^': - ctx->new_packmode = *ts++; - break; - case 'T': - { - const char* ts_after_sub; - size_t i, struct_count = ctx->new_count; - size_t struct_alignment = ctx->struct_alignment; - ctx->new_count = 1; - ++ts; - if (*ts != '{') { - PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_type = 0; - ctx->enc_count = 0; - ctx->struct_alignment = 0; - ++ts; - ts_after_sub = ts; - for (i = 0; i != struct_count; ++i) { - ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); - if (!ts_after_sub) return NULL; - } - ts = ts_after_sub; - if (struct_alignment) ctx->struct_alignment = struct_alignment; - } - break; - case '}': - { - size_t alignment = ctx->struct_alignment; - ++ts; - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_type = 0; - if (alignment && ctx->fmt_offset % alignment) { - ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); - } - } - return ts; - case 'x': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->fmt_offset += ctx->new_count; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->enc_packmode = ctx->new_packmode; - ++ts; - break; - case 'Z': - got_Z = 1; - ++ts; - if (*ts != 'f' && *ts != 'd' && *ts != 'g') { - __Pyx_BufFmt_RaiseUnexpectedChar('Z'); - return NULL; - } - case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': - case 'l': case 'L': case 'q': case 'Q': - case 'f': case 'd': case 'g': - case 'O': case 'p': - if (ctx->enc_type == *ts && got_Z == ctx->is_complex && - ctx->enc_packmode == ctx->new_packmode) { - ctx->enc_count += ctx->new_count; - ctx->new_count = 1; - got_Z = 0; - ++ts; - break; - } - case 's': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_count = ctx->new_count; - ctx->enc_packmode = ctx->new_packmode; - ctx->enc_type = *ts; - ctx->is_complex = got_Z; - ++ts; - ctx->new_count = 1; - got_Z = 0; - break; - case ':': - ++ts; - while(*ts != ':') ++ts; - ++ts; - break; - case '(': - if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; - break; - default: - { - int number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return NULL; - ctx->new_count = (size_t)number; - } - } - } -} -static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { - buf->buf = NULL; - buf->obj = NULL; - buf->strides = __Pyx_zeros; - buf->shape = __Pyx_zeros; - buf->suboffsets = __Pyx_minusones; -} -static CYTHON_INLINE int __Pyx_GetBufferAndValidate( - Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, - int nd, int cast, __Pyx_BufFmt_StackElem* stack) -{ - if (obj == Py_None || obj == NULL) { - __Pyx_ZeroBuffer(buf); - return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { - PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - nd, buf->ndim); - goto fail; - } - if (!cast) { - __Pyx_BufFmt_Context ctx; - __Pyx_BufFmt_Init(&ctx, stack, dtype); - if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; - } - if ((unsigned)buf->itemsize != dtype->size) { - PyErr_Format(PyExc_ValueError, - "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", - buf->itemsize, (buf->itemsize > 1) ? "s" : "", - dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); - goto fail; - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; -} -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { - if (info->buf == NULL) return; - if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; - __Pyx_ReleaseBuffer(info); -} - -/* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { - PyErr_SetString(PyExc_ValueError, - "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); -} - -/* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return m->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -/* 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; -} - -/* BufferIndexError */ - static void __Pyx_RaiseBufferIndexError(int axis) { - PyErr_Format(PyExc_IndexError, - "Out of bounds on buffer access (axis %d)", axis); -} - -/* PyFloatBinop */ - #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyFloat_DivideCObj(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) { - const double a = floatval; - double b, result; - if (likely(PyFloat_CheckExact(op2))) { - b = PyFloat_AS_DOUBLE(op2); - } else - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op2))) { - b = (double) PyInt_AS_LONG(op2); - } else - #endif - if (likely(PyLong_CheckExact(op2))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)op2)->ob_digit; - const Py_ssize_t size = Py_SIZE(op2); - switch (size) { - case 0: b = 0.0; break; - case -1: b = -(double) digits[0]; break; - case 1: b = (double) digits[0]; break; - case -2: - case 2: - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { - b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) { - if (size == -2) - b = -b; - break; - } - } - case -3: - case 3: - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { - b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) { - if (size == -3) - b = -b; - break; - } - } - case -4: - case 4: - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { - b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) { - if (size == -4) - b = -b; - break; - } - } - default: - #else - { - #endif - b = PyLong_AsDouble(op2); - if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL; - } - } else { - return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)); - } - PyFPE_START_PROTECT("divide", return NULL) - result = a / b; - PyFPE_END_PROTECT(result) - return PyFloat_FromDouble(result); -} -#endif - -/* ArgTypeTest */ - static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); -} -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (likely(Py_TYPE(obj) == type)) return 1; - #if PY_MAJOR_VERSION == 2 - else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(PyObject_TypeCheck(obj, type))) return 1; - } - __Pyx_RaiseArgumentTypeInvalid(name, obj, type); - return 0; -} - -/* 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) { - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -#endif - -/* PyErrExceptionMatches */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { - PyObject *exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; - return PyErr_GivenExceptionMatches(exc_type, err); -} -#endif - -/* GetException */ - #if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { -#endif - PyObject *local_type, *local_value, *local_tb; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - -/* 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; -} - -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* 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; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - __Pyx_PyFrame_SetLineNumber(py_frame, py_line); - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { - if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); - PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); - return -1; -} -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject *obj = view->obj; - if (!obj) return; - if (PyObject_CheckBuffer(obj)) { - PyBuffer_Release(view); - return; - } - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } - Py_DECREF(obj); - view->obj = NULL; -} -#endif - - - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#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_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_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); - } -} - -/* 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); - } -} - -/* 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 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; -} - -/* 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; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (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 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 (PyInt_Check(x) || PyLong_Check(x)) -#else - if (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 = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } - #else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } - #endif -#else - res = PyNumber_Int(x); -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - 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_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ diff -Nru yt-3.3.3/yt/utilities/spatial/ckdtree.pyx yt-3.4.0/yt/utilities/spatial/ckdtree.pyx --- yt-3.3.3/yt/utilities/spatial/ckdtree.pyx 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/spatial/ckdtree.pyx 1970-01-01 00:00:00.000000000 +0000 @@ -1,839 +0,0 @@ -# Copyright Anne M. Archibald 2008 -# Released under the scipy license -import numpy as np -cimport numpy as np -cimport libc.stdlib as stdlib -cimport cython - -import kdtree - -cdef extern from "platform_dep.h": - # NOTE that size_t might not be int - void *alloca(int) - -cdef np.float64_t infinity = np.inf - -__all__ = ['cKDTree'] - -# priority queue -cdef union heapcontents: - int intdata - char* ptrdata - -cdef struct heapitem: - np.float64_t priority - heapcontents contents - -cdef struct heap: - int n - heapitem* heap - int space - -cdef inline heapcreate(heap* self,int initial_size): - self.space = initial_size - self.heap = stdlib.malloc(sizeof(heapitem)*self.space) - self.n=0 - -cdef inline heapdestroy(heap* self): - stdlib.free(self.heap) - -cdef inline heapresize(heap* self, int new_space): - if new_spacestdlib.realloc(self.heap,new_space*sizeof(heapitem)) - -cdef inline heappush(heap* self, heapitem item): - cdef int i - cdef heapitem t - - self.n += 1 - if self.n>self.space: - heapresize(self,2*self.space+1) - - i = self.n-1 - self.heap[i] = item - while i>0 and self.heap[i].priority40: #FIXME: magic number - heapresize(self,self.space//2+1) - - i=0 - j=1 - k=2 - while ((j self.heap[j].priority or - k self.heap[k].priority)): - if kself.heap[k].priority: - l = k - else: - l = j - t = self.heap[l] - self.heap[l] = self.heap[i] - self.heap[i] = t - i = l - j = 2*i+1 - k = 2*i+2 - -cdef heapitem heappop(heap* self): - cdef heapitem it - it = heappeek(self) - heapremove(self) - return it - - - - - -# utility functions -cdef inline np.float64_t dmax(np.float64_t x, np.float64_t y): - if x>y: - return x - else: - return y -cdef inline np.float64_t dabs(np.float64_t x): - if x>0: - return x - else: - return -x -cdef inline np.float64_t dmin(np.float64_t x, np.float64_t y): - if xupperbound: - return r - elif p==1: - for i in range(k): - m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - r += m - if r>upperbound: - return r - elif p==2: - for i in range(k): - m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - r += m*m - if r>upperbound: - return r - else: - for i in range(k): - m = dmin(dabs(x[i] - y[i]), period[i] - dabs(x[i] - y[i])) - r += m**p - if r>upperbound: - return r - return r - - - -# Tree structure -cdef struct innernode: - int split_dim - int n_points - np.float64_t split - np.float64_t* maxes - np.float64_t* mins - innernode* less - innernode* greater -cdef struct leafnode: - int split_dim - int n_points - int start_idx - int end_idx - np.float64_t* maxes - np.float64_t* mins - -# this is the standard trick for variable-size arrays: -# malloc sizeof(nodeinfo)+self.m*sizeof(np.float64_t) bytes. -cdef struct nodeinfo: - innernode* node - np.float64_t side_distances[0] - -cdef class cKDTree: - """kd-tree for quick nearest-neighbor lookup - - This class provides an index into a set of k-dimensional points - which can be used to rapidly look up the nearest neighbors of any - point. - - The algorithm used is described in Maneewongvatana and Mount 1999. - The general idea is that the kd-tree is a binary trie, each of whose - nodes represents an axis-aligned hyperrectangle. Each node specifies - an axis and splits the set of points based on whether their coordinate - along that axis is greater than or less than a particular value. - - During construction, the axis and splitting point are chosen by the - "sliding midpoint" rule, which ensures that the cells do not all - become long and thin. - - The tree can be queried for the r closest neighbors of any given point - (optionally returning only those within some maximum distance of the - point). It can also be queried, with a substantial gain in efficiency, - for the r approximate closest neighbors. - - For large dimensions (20 is already large) do not expect this to run - significantly faster than brute force. High-dimensional nearest-neighbor - queries are a substantial open problem in computer science. - - Parameters - ---------- - data : array-like, shape (n,m) - The n data points of dimension m to be indexed. This array is - not copied unless this is necessary to produce a contiguous - array of np.float64_ts, and so modifying this data will result in - bogus results. - leafsize : positive integer - The number of points at which the algorithm switches over to - brute-force. - - """ - - cdef innernode* tree - cdef readonly object data - cdef np.float64_t* raw_data - cdef readonly int n, m - cdef readonly int leafsize - cdef readonly object maxes - cdef np.float64_t* raw_maxes - cdef readonly object mins - cdef np.float64_t* raw_mins - cdef object indices - cdef np.int64_t* raw_indices - def __init__(cKDTree self, data, int leafsize=10): - cdef np.ndarray[np.float64_t, ndim=2] inner_data - cdef np.ndarray[np.float64_t, ndim=1] inner_maxes - cdef np.ndarray[np.float64_t, ndim=1] inner_mins - cdef np.ndarray[np.int64_t, ndim=1] inner_indices - self.data = np.ascontiguousarray(data,dtype="float64") - self.n, self.m = np.shape(self.data) - self.leafsize = leafsize - if self.leafsize<1: - raise ValueError("leafsize must be at least 1") - self.maxes = np.ascontiguousarray(np.amax(self.data,axis=0)) - self.mins = np.ascontiguousarray(np.amin(self.data,axis=0)) - self.indices = np.ascontiguousarray(np.arange(self.n,dtype=np.int64)) - - inner_data = self.data - self.raw_data = inner_data.data - inner_maxes = self.maxes - self.raw_maxes = inner_maxes.data - inner_mins = self.mins - self.raw_mins = inner_mins.data - inner_indices = self.indices - self.raw_indices = inner_indices.data - - self.tree = self.__build(0, self.n, self.raw_maxes, self.raw_mins) - - cdef innernode* __build(cKDTree self, int start_idx, int end_idx, np.float64_t* maxes, np.float64_t* mins): - cdef leafnode* n - cdef innernode* ni - cdef int i, j, t, p, q, d - cdef np.float64_t size, split, minval, maxval - cdef np.float64_t*mids - if end_idx-start_idx<=self.leafsize: - n = stdlib.malloc(sizeof(leafnode)) - # Skory - n.maxes = stdlib.malloc(sizeof(np.float64_t)*self.m) - n.mins = stdlib.malloc(sizeof(np.float64_t)*self.m) - for i in range(self.m): - n.maxes[i] = maxes[i] - n.mins[i] = mins[i] - n.split_dim = -1 - n.start_idx = start_idx - n.end_idx = end_idx - return n - else: - d = 0 - size = 0 - for i in range(self.m): - if maxes[i]-mins[i] > size: - d = i - size = maxes[i]-mins[i] - maxval = maxes[d] - minval = mins[d] - if maxval==minval: - # all points are identical; warn user? - n = stdlib.malloc(sizeof(leafnode)) - n.split_dim = -1 - n.start_idx = start_idx - n.end_idx = end_idx - return n - - split = (maxval+minval)/2 - - p = start_idx - q = end_idx-1 - while p<=q: - if self.raw_data[self.raw_indices[p]*self.m+d]=split: - q-=1 - else: - t = self.raw_indices[p] - self.raw_indices[p] = self.raw_indices[q] - self.raw_indices[q] = t - p+=1 - q-=1 - - # slide midpoint if necessary - if p==start_idx: - # no points less than split - j = start_idx - split = self.raw_data[self.raw_indices[j]*self.m+d] - for i in range(start_idx+1, end_idx): - if self.raw_data[self.raw_indices[i]*self.m+d]split: - j = i - split = self.raw_data[self.raw_indices[j]*self.m+d] - t = self.raw_indices[end_idx-1] - self.raw_indices[end_idx-1] = self.raw_indices[j] - self.raw_indices[j] = t - p = end_idx-1 - q = end_idx-2 - - # construct new node representation - ni = stdlib.malloc(sizeof(innernode)) - - mids = stdlib.malloc(sizeof(np.float64_t)*self.m) - for i in range(self.m): - mids[i] = maxes[i] - mids[d] = split - ni.less = self.__build(start_idx,p,mids,mins) - - for i in range(self.m): - mids[i] = mins[i] - mids[d] = split - ni.greater = self.__build(p,end_idx,maxes,mids) - - stdlib.free(mids) - - ni.split_dim = d - ni.split = split - # Skory - ni.maxes = stdlib.malloc(sizeof(np.float64_t)*self.m) - ni.mins = stdlib.malloc(sizeof(np.float64_t)*self.m) - for i in range(self.m): - ni.maxes[i] = maxes[i] - ni.mins[i] = mins[i] - - return ni - - cdef __free_tree(cKDTree self, innernode* node): - if node.split_dim!=-1: - self.__free_tree(node.less) - self.__free_tree(node.greater) - stdlib.free(node.maxes) # Skory - stdlib.free(node.mins) - stdlib.free(node) - - def __dealloc__(cKDTree self): - if (self.tree) == 0: - # should happen only if __init__ was never called - return - self.__free_tree(self.tree) - - cdef void __query(cKDTree self, - np.float64_t*result_distances, - np.int64_t*result_indices, - np.float64_t*x, - int k, - np.float64_t eps, - np.float64_t p, - np.float64_t distance_upper_bound, - np.float64_t*period): - assert(p == 2) - assert(eps == 0.0) - assert(distance_upper_bound == infinity) - cdef heap q - cdef heap neighbors - - cdef int i, j, i2, j2 - cdef np.float64_t t, y - cdef nodeinfo* inf - cdef nodeinfo* inf2 - cdef np.float64_t d, di - cdef np.float64_t m_left, m_right, m - cdef np.float64_t epsfac - cdef np.float64_t min_distance - cdef np.float64_t far_min_distance - cdef heapitem it, it2, neighbor - cdef leafnode* node - cdef innernode* inode - cdef innernode* near - cdef innernode* far - cdef np.float64_t* side_distances - - # priority queue for chasing nodes - # entries are: - # minimum distance between the cell and the target - # distances between the nearest side of the cell and the target - # the head node of the cell - heapcreate(&q,12) - - # priority queue for the nearest neighbors - # furthest known neighbor first - # entries are (-distance**p, i) - heapcreate(&neighbors,k) - - # set up first nodeinfo - inf = stdlib.malloc(sizeof(nodeinfo)+self.m*sizeof(np.float64_t)) - inf.node = self.tree - for i in range(self.m): - inf.side_distances[i] = 0 - t = x[i]-self.raw_maxes[i] - if t>inf.side_distances[i]: - inf.side_distances[i] = t - else: - t = self.raw_mins[i]-x[i] - if t>inf.side_distances[i]: - inf.side_distances[i] = t - inf.side_distances[i]=inf.side_distances[i]*inf.side_distances[i] - - # compute first distance - min_distance = 0. - for i in range(self.m): - min_distance += inf.side_distances[i] - - # fiddle approximation factor - epsfac=1 - - while True: - if inf.node.split_dim==-1: - node = inf.node - - # brute-force - for i in range(node.start_idx,node.end_idx): - d = 0.0 - for i2 in range(self.m): - y = self.raw_data[self.raw_indices[i]*self.m + i2] - di = dmin(dabs(x[i2] - y), period[i2] - dabs(x[i2] - y)) - d += di*di - if dit.contents.ptrdata - min_distance = it.priority - else: - inode = inf.node - - # we don't push cells that are too far onto the queue at all, - # but since the distance_upper_bound decreases, we might get - # here even if the cell's too far - if min_distance>distance_upper_bound*epsfac: - # since this is the nearest cell, we're done, bail out - stdlib.free(inf) - # free all the nodes still on the heap - for i in range(q.n): - stdlib.free(q.heap[i].contents.ptrdata) - break - - # set up children for searching - if x[inode.split_dim]stdlib.malloc(sizeof(nodeinfo)+self.m*sizeof(np.float64_t)) - it2.contents.ptrdata = inf2 - inf2.node = far - - # Periodicity added by S Skory - m_left = dmin( dabs(far.mins[inode.split_dim] - x[inode.split_dim]), \ - period[inode.split_dim] - dabs(far.mins[inode.split_dim] - x[inode.split_dim])) - m_right = dmin( dabs(far.maxes[inode.split_dim] - x[inode.split_dim]), \ - period[inode.split_dim] - dabs(far.maxes[inode.split_dim] - x[inode.split_dim])) - m = dmin(m_left,m_right) - - # most side distances unchanged - for i in range(self.m): - inf2.side_distances[i] = inf.side_distances[i] - - # one side distance changes - # we can adjust the minimum distance without recomputing - inf2.side_distances[inode.split_dim] = m*m - #far_min_distance = min_distance - inf.side_distances[inode.split_dim] + inf2.side_distances[inode.split_dim] - far_min_distance = m*m - - it2.priority = far_min_distance - - - # far child might be too far, if so, don't bother pushing it - if far_min_distance<=distance_upper_bound*epsfac: - heappush(&q,it2) - else: - stdlib.free(inf2) - # just in case - it2.contents.ptrdata = 0 - - # fill output arrays with sorted neighbors - for i in range(neighbors.n-1,-1,-1): - neighbor = heappop(&neighbors) # FIXME: neighbors may be realloced - result_indices[i] = neighbor.contents.intdata - result_distances[i] = (-neighbor.priority) #**(1./p) S. Skory - - heapdestroy(&q) - heapdestroy(&neighbors) - - def query(cKDTree self, object x, int k=1, np.float64_t eps=0, np.float64_t p=2, - np.float64_t distance_upper_bound=infinity, object period=None): - """query(self, x, k=1, eps=0, p=2, distance_upper_bound=np.inf, - period=None) - - Query the kd-tree for nearest neighbors. - - Parameters - ---------- - x : array_like, last dimension self.m - An array of points to query. - k : int - The number of nearest neighbors to return. - eps : non-negative float - Return approximate nearest neighbors; the k-th returned value - is guaranteed to be no further than (1 + `eps`) times the - distance to the real k-th nearest neighbor. - p : float, 1 <= p <= infinity - Which Minkowski p-norm to use. - 1 is the sum-of-absolute-values "Manhattan" distance. - 2 is the usual Euclidean distance. - infinity is the maximum-coordinate-difference distance. - distance_upper_bound : non-negative float - Return only neighbors within this distance. This is used to prune - tree searches, so if you are doing a series of nearest-neighbor - queries, it may help to supply the distance to the nearest neighbor - of the most recent point. - - Returns - ------- - d : ndarray of floats - The distances to the nearest neighbors. - If `x` has shape tuple+(self.m,), then `d` has shape tuple+(k,). - Missing neighbors are indicated with infinite distances. - i : ndarray of ints - The locations of the neighbors in self.data. - If `x` has shape tuple+(self.m,), then `i` has shape tuple+(k,). - Missing neighbors are indicated with self.n. - - """ - cdef np.ndarray[np.int64_t, ndim=2] ii - cdef np.ndarray[np.float64_t, ndim=2] dd - cdef np.ndarray[np.float64_t, ndim=2] xx - cdef np.ndarray[np.float64_t, ndim=1] cperiod - cdef int c - x = np.asarray(x).astype("float64") - if period is None: - period = np.array([np.inf]*self.m) - else: - period = np.asarray(period).astype("float64") - cperiod = np.ascontiguousarray(period) - if np.shape(x)[-1] != self.m: - raise ValueError("x must consist of vectors of length %d but has shape %s" % (self.m, np.shape(x))) - if p<1: - raise ValueError("Only p-norms with 1<=p<=infinity permitted") - if len(x.shape)==1: - single = True - x = x[np.newaxis,:] - else: - single = False - retshape = np.shape(x)[:-1] - n = np.prod(retshape) - xx = np.reshape(x,(n,self.m)) - xx = np.ascontiguousarray(xx) - dd = np.empty((n,k),dtype="float64") - dd.fill(infinity) - ii = np.empty((n,k),dtype="int64") - ii.fill(self.n) - for c in range(n): - self.__query( - (dd.data)+c*k, - (ii.data)+c*k, - (xx.data)+c*self.m, - k, - eps, - p, - distance_upper_bound, - cperiod.data) - if single: - if k==1: - return dd[0,0], ii[0,0] - else: - return dd[0], ii[0] - else: - if k==1: - return np.reshape(dd[...,0],retshape), np.reshape(ii[...,0],retshape) - else: - return np.reshape(dd,retshape+(k,)), np.reshape(ii,retshape+(k,)) - - @cython.boundscheck(False) - @cython.wraparound(False) - @cython.cdivision(True) - def chainHOP_get_dens(cKDTree self, object omass, int num_neighbors=65, \ - int nMerge=6): - """ query the tree for the nearest neighbors, to get the density - of particles for chainHOP. - - Parameters: - =========== - - mass: A array-like list of the masses of the particles, in the same - order as the data that went into building the kd tree. - - num_neighbors: Optional, the number of neighbors to search for and to - use in the density calculation. Default is 65, and is probably what - one should stick with. - - nMerge: The number of nearest neighbor tags to return for each particle. - - Returns: - ======== - - dens: An array of the densities for each particle, in the same order - as the input data. - - tags: A two-dimensional array of the indexes, nMerge nearest neighbors - for each particle. - - """ - - # We're no np.int64_ter returning all the tags in this step. - # We do it chunked, in find_chunk_nearest_neighbors. - #cdef np.ndarray[np.int64_t, ndim=2] tags - cdef np.ndarray[np.float64_t, ndim=1] dens - cdef int i, pj, j - cdef np.float64_t ih2, fNorm, r2, rs - - #tags = np.empty((self.n, nMerge), dtype="int64") - dens = np.zeros(self.n, dtype="float64") - cdef np.ndarray[np.float64_t, ndim=2] local_data = self.data - - cdef np.ndarray[np.float64_t, ndim=1] mass = np.array(omass).astype("float64") - cdef np.float64_t ipi = 1.0/np.pi - - cdef np.float64_t *query = alloca( - sizeof(np.float64_t) * self.m) - cdef np.float64_t *dist_temp = alloca( - sizeof(np.float64_t) * num_neighbors) - cdef np.int64_t *tags_temp = alloca( - sizeof(np.int64_t) * num_neighbors) - cdef np.float64_t period[3] - for i in range(3): period[i] = 1.0 - - for i in range(self.n): - for j in range(self.m): - query[j] = local_data[i,j] - self.__query(dist_temp, tags_temp, - query, num_neighbors, 0.0, - 2, infinity, period) - - #calculate the density for this particle - ih2 = -1 - for j in range(num_neighbors): - ih2 = dmax(ih2, dist_temp[j]) - ih2 = 4.0/ih2 - fNorm = 0.5*(ih2**1.5)*ipi - for j in range(num_neighbors): - pj = tags_temp[j] - r2 = dist_temp[j] * ih2 - rs = 2.0 - (r2**0.5) - if (r2 < 1.0): - rs = (1.0 - 0.75*rs*r2) - else: - rs = 0.25*rs*rs*rs - rs = rs * fNorm - dens[i] = dens[i] + rs * mass[pj] - dens[pj] = dens[pj] + rs * mass[i] - - # store nMerge nearest neighbors - #tags[i,:] = tags_temp[:nMerge] - - #return (dens, tags) - return dens - - @cython.boundscheck(False) - @cython.wraparound(False) - def find_chunk_nearest_neighbors(cKDTree self, int start, int finish, \ - int num_neighbors=65): - """ query the tree in chunks, between start and finish, recording the - nearest neighbors. - - Parameters: - =========== - - start: The starting point in the dataset for this search. - - finish: The ending point in the dataset for this search. - - num_neighbors: Optional, the number of neighbors to search for. - The default is 65. - - Returns: - ======== - - chunk_tags: A two-dimensional array of the nearest neighbor tags for the - points in this search. - - """ - - cdef np.ndarray[np.int64_t, ndim=2] chunk_tags - cdef np.ndarray[np.float64_t, ndim=2] local_data = self.data - cdef int i, j - - chunk_tags = np.empty((finish-start, num_neighbors), dtype="int64") - cdef np.float64_t *query = alloca( - sizeof(np.float64_t) * self.m) - cdef np.float64_t *dist_temp = alloca( - sizeof(np.float64_t) * num_neighbors) - cdef np.int64_t *tags_temp = alloca( - sizeof(np.int64_t) * num_neighbors) - cdef np.float64_t period[3] - for i in range(3): period[i] = 1.0 - - for i in range(finish-start): - for j in range(self.m): - query[j] = local_data[i+start,j] - self.__query(dist_temp, tags_temp, - query, num_neighbors, 0.0, - 2, infinity, period) - for j in range(num_neighbors): - chunk_tags[i,j] = tags_temp[j] - - return chunk_tags - - def chainHOP_preconnect(self, np.ndarray[np.int64_t, ndim=1] chainID, - np.ndarray[np.float64_t, ndim=1] density, - np.ndarray[np.float64_t, ndim=1] densest_in_chain, - np.ndarray bis_inside, - np.ndarray bsearch_again, - np.float64_t peakthresh, - np.float64_t saddlethresh, - int nn, int nMerge, - object chain_map): - cdef np.ndarray[np.int32_t, ndim=1] is_inside - cdef np.ndarray[np.int32_t, ndim=1] search_again - cdef np.ndarray[np.float64_t, ndim=2] pos - cdef np.int64_t thisNN, thisNN_chainID, same_count - cdef np.float64_t *query = alloca( - sizeof(np.float64_t) * self.m) - cdef np.float64_t *dist_temp = alloca( - sizeof(np.float64_t) * nn) - cdef np.int64_t *tags_temp = alloca( - sizeof(np.int64_t) * nn) - cdef np.float64_t period[3] - cdef np.float64_t thisNN_max_dens, boundary_density - cdef int i, j, npart, chainID_i, part_mas_dens - is_inside = bis_inside.astype("int32") - search_again = bsearch_again.astype("int32") - pos = self.data - npart = pos.shape[0] - for i in range(3): period[i] = 1.0 - for i in xrange(npart): - # Don't consider this particle if it's not part of a chain. - if chainID[i] < 0: continue - chainID_i = chainID[i] - # If this particle is in the padding, don't make a connection. - if not is_inside[i]: continue - # Find this particle's chain max_dens. - part_max_dens = densest_in_chain[chainID_i] - # We're only connecting >= peakthresh chains now. - if part_max_dens < peakthresh: continue - # Loop over nMerge closest nearest neighbors. - for j in range(self.m): - query[j] = pos[i,j] - self.__query(dist_temp, tags_temp, - query, nn, 0.0, - 2, infinity, period) - same_count = 0 - for j in xrange(int(nMerge+1)): - thisNN = tags_temp[j+1] # Don't consider ourselves at tags_temp[0] - thisNN_chainID = chainID[thisNN] - # If our neighbor is in the same chain, move on. - # Move on if these chains are already connected: - if chainID_i == thisNN_chainID or \ - thisNN_chainID in chain_map[chainID_i]: - same_count += 1 - continue - # Everything immediately below is for - # neighboring particles with a chainID. - if thisNN_chainID >= 0: - # Find thisNN's chain's max_dens. - thisNN_max_dens = densest_in_chain[thisNN_chainID] - # We're only linking peakthresh chains - if thisNN_max_dens < peakthresh: continue - # Calculate the two groups boundary density. - boundary_density = (density[thisNN] + density[i]) / 2. - # Don't connect if the boundary is too low. - if boundary_density < saddlethresh: continue - # Mark these chains as related. - chain_map[thisNN_chainID].add(chainID_i) - chain_map[chainID_i].add(thisNN_chainID) - if same_count == nMerge + 1: - # All our neighbors are in the same chain already, so - # we don't need to search again. - search_again[i] = 0 - return search_again diff -Nru yt-3.3.3/yt/utilities/spatial/common.h yt-3.4.0/yt/utilities/spatial/common.h --- yt-3.3.3/yt/utilities/spatial/common.h 2016-09-22 03:28:40.000000000 +0000 +++ yt-3.4.0/yt/utilities/spatial/common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/** - * common.h - * - * Author: Damian Eads - * Date: September 22, 2007 (moved into new file on June 8, 2008) - * - * Copyright (c) 2007, 2008, Damian Eads. All rights reserved. - * Adapted for incorporation into Scipy, April 9, 2008. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - Neither the name of the author nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _CLUSTER_COMMON_H -#define _CLUSTER_COMMON_H - -#define CPY_MAX(_x, _y) ((_x > _y) ? (_x) : (_y)) -#define CPY_MIN(_x, _y) ((_x < _y) ? (_x) : (_y)) - -#define NCHOOSE2(_n) ((_n)*(_n-1)/2) - -#define CPY_BITS_PER_CHAR (sizeof(unsigned char) * 8) -#define CPY_FLAG_ARRAY_SIZE_BYTES(num_bits) (CPY_CEIL_DIV((num_bits), \ - CPY_BITS_PER_CHAR)) -#define CPY_GET_BIT(_xx, i) (((_xx)[(i) / CPY_BITS_PER_CHAR] >> \ - ((CPY_BITS_PER_CHAR-1) - \ - ((i) % CPY_BITS_PER_CHAR))) & 0x1) -#define CPY_SET_BIT(_xx, i) ((_xx)[(i) / CPY_BITS_PER_CHAR] |= \ - ((0x1) << ((CPY_BITS_PER_CHAR-1) \ - -((i) % CPY_BITS_PER_CHAR)))) -#define CPY_CLEAR_BIT(_xx, i) ((_xx)[(i) / CPY_BITS_PER_CHAR] &= \ - ~((0x1) << ((CPY_BITS_PER_CHAR-1) \ - -((i) % CPY_BITS_PER_CHAR)))) - -#ifndef CPY_CEIL_DIV -#define CPY_CEIL_DIV(x, y) ((((double)x)/(double)y) == \ - ((double)((x)/(y))) ? ((x)/(y)) : ((x)/(y) + 1)) -#endif - - -#ifdef CPY_DEBUG -#define CPY_DEBUG_MSG(...) fprintf(stderr, __VA_ARGS__) -#else -#define CPY_DEBUG_MSG(...) -#endif - -#endif diff -Nru yt-3.3.3/yt/utilities/spatial/distance.py yt-3.4.0/yt/utilities/spatial/distance.py --- yt-3.3.3/yt/utilities/spatial/distance.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/spatial/distance.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,2179 +0,0 @@ -""" -===================================================== -Distance computations (:mod:`scipy.spatial.distance`) -===================================================== - -.. sectionauthor:: Damian Eads - -Function Reference ------------------- - -Distance matrix computation from a collection of raw observation vectors -stored in a rectangular array. - -.. autosummary:: - :toctree: generated/ - - pdist -- pairwise distances between observation vectors. - cdist -- distances between between two collections of observation vectors - squareform -- convert distance matrix to a condensed one and vice versa - -Predicates for checking the validity of distance matrices, both -condensed and redundant. Also contained in this module are functions -for computing the number of observations in a distance matrix. - -.. autosummary:: - :toctree: generated/ - - is_valid_dm -- checks for a valid distance matrix - is_valid_y -- checks for a valid condensed distance matrix - num_obs_dm -- # of observations in a distance matrix - num_obs_y -- # of observations in a condensed distance matrix - -Distance functions between two vectors ``u`` and ``v``. Computing -distances over a large collection of vectors is inefficient for these -functions. Use ``pdist`` for this purpose. - -.. autosummary:: - :toctree: generated/ - - braycurtis -- the Bray-Curtis distance. - canberra -- the Canberra distance. - chebyshev -- the Chebyshev distance. - cityblock -- the Manhattan distance. - correlation -- the Correlation distance. - cosine -- the Cosine distance. - dice -- the Dice dissimilarity (boolean). - euclidean -- the Euclidean distance. - hamming -- the Hamming distance (boolean). - jaccard -- the Jaccard distance (boolean). - kulsinski -- the Kulsinski distance (boolean). - mahalanobis -- the Mahalanobis distance. - matching -- the matching dissimilarity (boolean). - minkowski -- the Minkowski distance. - rogerstanimoto -- the Rogers-Tanimoto dissimilarity (boolean). - russellrao -- the Russell-Rao dissimilarity (boolean). - seuclidean -- the normalized Euclidean distance. - sokalmichener -- the Sokal-Michener dissimilarity (boolean). - sokalsneath -- the Sokal-Sneath dissimilarity (boolean). - sqeuclidean -- the squared Euclidean distance. - yule -- the Yule dissimilarity (boolean). - - -References ----------- - -.. [Sta07] "Statistics toolbox." API Reference Documentation. The MathWorks. - http://www.mathworks.com/access/helpdesk/help/toolbox/stats/. - Accessed October 1, 2007. - -.. [Mti07] "Hierarchical clustering." API Reference Documentation. - The Wolfram Research, Inc. - http://reference.wolfram.com/mathematica/HierarchicalClustering/tutorial/HierarchicalClustering.html. - Accessed October 1, 2007. - -.. [Gow69] Gower, JC and Ross, GJS. "Minimum Spanning Trees and Single Linkage - Cluster Analysis." Applied Statistics. 18(1): pp. 54--64. 1969. - -.. [War63] Ward Jr, JH. "Hierarchical grouping to optimize an objective - function." Journal of the American Statistical Association. 58(301): - pp. 236--44. 1963. - -.. [Joh66] Johnson, SC. "Hierarchical clustering schemes." Psychometrika. - 32(2): pp. 241--54. 1966. - -.. [Sne62] Sneath, PH and Sokal, RR. "Numerical taxonomy." Nature. 193: pp. - 855--60. 1962. - -.. [Bat95] Batagelj, V. "Comparing resemblance measures." Journal of - Classification. 12: pp. 73--90. 1995. - -.. [Sok58] Sokal, RR and Michener, CD. "A statistical method for evaluating - systematic relationships." Scientific Bulletins. 38(22): - pp. 1409--38. 1958. - -.. [Ede79] Edelbrock, C. "Mixture model tests of hierarchical clustering - algorithms: the problem of classifying everybody." Multivariate - Behavioral Research. 14: pp. 367--84. 1979. - -.. [Jai88] Jain, A., and Dubes, R., "Algorithms for Clustering Data." - Prentice-Hall. Englewood Cliffs, NJ. 1988. - -.. [Fis36] Fisher, RA "The use of multiple measurements in taxonomic - problems." Annals of Eugenics, 7(2): 179-188. 1936 - - -Copyright Notice ----------------- - -Copyright (C) Damian Eads, 2007-2008. New BSD License. - -""" - -import warnings -import numpy as np -from numpy.linalg import norm -from yt.extern.six import string_types - -from . import _distance_wrap - - -def _copy_array_if_base_present(a): - """ - Copies the array if its base points to a parent array. - """ - if a.base is not None: - return a.copy() - elif np.issubsctype(a, np.float32): - return np.array(a, dtype=np.double) - else: - return a - - -def _copy_arrays_if_base_present(T): - """ - Accepts a tuple of arrays T. Copies the array T[i] if its base array - points to an actual array. Otherwise, the reference is just copied. - This is useful if the arrays are being passed to a C function that - does not do proper striding. - """ - l = [_copy_array_if_base_present(a) for a in T] - return l - - -def _convert_to_bool(X): - if X.dtype != np.bool: - X = np.bool_(X) - if not X.flags.contiguous: - X = X.copy() - return X - - -def _convert_to_double(X): - if X.dtype != np.double: - X = np.double(X) - if not X.flags.contiguous: - X = X.copy() - return X - - -def _validate_vector(u, dtype=None): - # XXX Is order='c' really necessary? - u = np.asarray(u, dtype=dtype, order='c').squeeze() - # Ensure values such as u=1 and u=[1] still return 1-D arrays. - u = np.atleast_1d(u) - if u.ndim > 1: - raise ValueError("Input vector should be 1-D.") - return u - - -def minkowski(u, v, p): - r""" - Computes the Minkowski distance between two vectors ``u`` and ``v``, - defined as - - .. math:: - - {||u-v||}_p = (\sum{|u_i - v_i|^p})^{1/p}. - - Parameters - ---------- - u : ndarray - An n-dimensional vector. - v : ndarray - An n-dimensional vector. - p : int - The order of the norm of the difference :math:`{||u-v||}_p`. - - Returns - ------- - d : double - The Minkowski distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - if p < 1: - raise ValueError("p must be at least 1") - dist = norm(u - v, ord=p) - return dist - - -def wminkowski(u, v, p, w): - r""" - Computes the weighted Minkowski distance between two vectors ``u`` - and ``v``, defined as - - .. math:: - - \left(\sum{(w_i |u_i - v_i|^p)}\right)^{1/p}. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - p : int - The order of the norm of the difference :math:`{||u-v||}_p`. - w : ndarray - The weight vector. - - Returns - ------- - d : double - The Minkowski distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - w = _validate_vector(w) - if p < 1: - raise ValueError("p must be at least 1") - dist = norm(w * (u - v), ord=p) - return dist - - -def euclidean(u, v): - """ - Computes the Euclidean distance between two n-vectors ``u`` and ``v``, - which is defined as - - .. math:: - - {||u-v||}_2 - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Euclidean distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - dist = norm(u - v) - return dist - - -def sqeuclidean(u, v): - """ - Computes the squared Euclidean distance between two n-vectors u and v, - which is defined as - - .. math:: - - {||u-v||}_2^2. - - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The squared Euclidean distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - dist = ((u - v) ** 2).sum() - return dist - - -def cosine(u, v): - r""" - Computes the Cosine distance between two n-vectors u and v, which - is defined as - - .. math:: - - 1 - \frac{uv^T} - {||u||_2 ||v||_2}. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Cosine distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - dist = 1.0 - np.dot(u, v) / (norm(u) * norm(v)) - return dist - - -def correlation(u, v): - r""" - Computes the correlation distance between two n-vectors ``u`` and - ``v``, which is defined as - - .. math:: - - 1 - frac{(u - \bar{u}){(v - \bar{v})}^T} - {{||(u - \bar{u})||}_2 {||(v - \bar{v})||}_2^T} - - where :math:`\bar{u}` is the mean of a vectors elements and ``n`` - is the common dimensionality of ``u`` and ``v``. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The correlation distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - umu = u.mean() - vmu = v.mean() - um = u - umu - vm = v - vmu - dist = 1.0 - np.dot(um, vm) / (norm(um) * norm(vm)) - return dist - - -def hamming(u, v): - r""" - Computes the Hamming distance between two n-vectors ``u`` and - ``v``, which is simply the proportion of disagreeing components in - ``u`` and ``v``. If ``u`` and ``v`` are boolean vectors, the Hamming - distance is - - .. math:: - - \frac{c_{01} + c_{10}}{n} - - where :math:`c_{ij}` is the number of occurrences of - :math:`\mathtt{u[k]} = i` and :math:`\mathtt{v[k]} = j` for - :math:`k < n`. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Hamming distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - return (u != v).mean() - - -def jaccard(u, v): - """ - Computes the Jaccard-Needham dissimilarity between two boolean - n-vectors u and v, which is - - .. math:: - - \frac{c_{TF} + c_{FT}} - {c_{TT} + c_{FT} + c_{TF}} - - where :math:`c_{ij}` is the number of occurrences of - :math:`\mathtt{u[k]} = i` and :math:`\mathtt{v[k]} = j` for - :math:`k < n`. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Jaccard distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - dist = (np.double(np.bitwise_and((u != v), - np.bitwise_or(u != 0, v != 0)).sum()) - / np.double(np.bitwise_or(u != 0, v != 0).sum())) - return dist - - -def kulsinski(u, v): - """ - Computes the Kulsinski dissimilarity between two boolean n-vectors - u and v, which is defined as - - .. math:: - - \frac{c_{TF} + c_{FT} - c_{TT} + n} - {c_{FT} + c_{TF} + n} - - where :math:`c_{ij}` is the number of occurrences of - :math:`\mathtt{u[k]} = i` and :math:`\mathtt{v[k]} = j` for - :math:`k < n`. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Kulsinski distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - n = float(len(u)) - (nff, nft, ntf, ntt) = _nbool_correspond_all(u, v) - - return (ntf + nft - ntt + n) / (ntf + nft + n) - - -def seuclidean(u, v, V): - """ - Returns the standardized Euclidean distance between two n-vectors - ``u`` and ``v``. ``V`` is an n-dimensional vector of component - variances. It is usually computed among a larger collection - vectors. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - V : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The standardized Euclidean distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - V = _validate_vector(V, dtype=np.float64) - if V.shape[0] != u.shape[0] or u.shape[0] != v.shape[0]: - raise TypeError('V must be a 1-D array of the same dimension ' - 'as u and v.') - return np.sqrt(((u - v) ** 2 / V).sum()) - - -def cityblock(u, v): - """ - Computes the Manhattan distance between two n-vectors u and v, - which is defined as - - .. math:: - - \\sum_i {\\left| u_i - v_i \\right|}. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The City Block distance between vectors ``u`` and ``v``. - - """ - u = _validate_vector(u) - v = _validate_vector(v) - return abs(u - v).sum() - - -def mahalanobis(u, v, VI): - r""" - Computes the Mahalanobis distance between two n-vectors ``u`` and ``v``, - which is defiend as - - .. math:: - - (u-v)V^{-1}(u-v)^T - - where ``VI`` is the inverse covariance matrix :math:`V^{-1}`. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Mahalanobis distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - VI = np.atleast_2d(VI) - delta = u - v - m = np.dot(np.dot(delta, VI), delta) - return np.sqrt(m) - - -def chebyshev(u, v): - r""" - Computes the Chebyshev distance between two n-vectors u and v, - which is defined as - - .. math:: - - \max_i {|u_i-v_i|}. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Chebyshev distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - return max(abs(u - v)) - - -def braycurtis(u, v): - r""" - Computes the Bray-Curtis distance between two n-vectors ``u`` and - ``v``, which is defined as - - .. math:: - - \sum{|u_i-v_i|} / \sum{|u_i+v_i|}. - - The Bray-Curtis distance is in the range [0, 1] if all coordinates are - positive, and is undefined if the inputs are of length zero. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Bray-Curtis distance between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v, dtype=np.float64) - return abs(u - v).sum() / abs(u + v).sum() - - -def canberra(u, v): - r""" - Computes the Canberra distance between two n-vectors u and v, - which is defined as - - .. math:: - - \sum_u \frac{|u_i-v_i|} - {(|u_i|+|v_i|)}. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Canberra distance between vectors ``u`` and ``v``. - - Notes - ----- - Whe u[i] and v[i] are 0 for given i, then the fraction 0/0 = 0 is used in - the calculation. - - """ - u = _validate_vector(u) - v = _validate_vector(v, dtype=np.float64) - olderr = np.seterr(invalid='ignore') - try: - d = np.nansum(abs(u - v) / (abs(u) + abs(v))) - finally: - np.seterr(**olderr) - return d - - -def _nbool_correspond_all(u, v): - if u.dtype != v.dtype: - raise TypeError("Arrays being compared must be of the same data type.") - - if u.dtype == np.int or u.dtype == np.float_ or u.dtype == np.double: - not_u = 1.0 - u - not_v = 1.0 - v - nff = (not_u * not_v).sum() - nft = (not_u * v).sum() - ntf = (u * not_v).sum() - ntt = (u * v).sum() - elif u.dtype == np.bool: - not_u = ~u - not_v = ~v - nff = (not_u & not_v).sum() - nft = (not_u & v).sum() - ntf = (u & not_v).sum() - ntt = (u & v).sum() - else: - raise TypeError("Arrays being compared have unknown type.") - - return (nff, nft, ntf, ntt) - - -def _nbool_correspond_ft_tf(u, v): - if u.dtype == np.int or u.dtype == np.float_ or u.dtype == np.double: - not_u = 1.0 - u - not_v = 1.0 - v - nft = (not_u * v).sum() - ntf = (u * not_v).sum() - else: - not_u = ~u - not_v = ~v - nft = (not_u & v).sum() - ntf = (u & not_v).sum() - return (nft, ntf) - - -def yule(u, v): - r""" - Computes the Yule dissimilarity between two boolean n-vectors u and v, - which is defined as - - - .. math:: - - \frac{R}{c_{TT} + c_{FF} + \frac{R}{2}} - - where :math:`c_{ij}` is the number of occurrences of - :math:`\mathtt{u[k]} = i` and :math:`\mathtt{v[k]} = j` for - :math:`k < n` and :math:`R = 2.0 * (c_{TF} + c_{FT})`. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Yule dissimilarity between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - (nff, nft, ntf, ntt) = _nbool_correspond_all(u, v) - return float(2.0 * ntf * nft) / float(ntt * nff + ntf * nft) - - -def matching(u, v): - r""" - Computes the Matching dissimilarity between two boolean n-vectors - u and v, which is defined as - - .. math:: - - \frac{c_{TF} + c_{FT}}{n} - - where :math:`c_{ij}` is the number of occurrences of - :math:`\mathtt{u[k]} = i` and :math:`\mathtt{v[k]} = j` for - :math:`k < n`. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Matching dissimilarity between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - (nft, ntf) = _nbool_correspond_ft_tf(u, v) - return float(nft + ntf) / float(len(u)) - - -def dice(u, v): - r""" - Computes the Dice dissimilarity between two boolean n-vectors - ``u`` and ``v``, which is - - .. math:: - - \frac{c_{TF} + c_{FT}} - {2c_{TT} + c_{FT} + c_{TF}} - - where :math:`c_{ij}` is the number of occurrences of - :math:`\mathtt{u[k]} = i` and :math:`\mathtt{v[k]} = j` for - :math:`k < n`. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Dice dissimilarity between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - if u.dtype == np.bool: - ntt = (u & v).sum() - else: - ntt = (u * v).sum() - (nft, ntf) = _nbool_correspond_ft_tf(u, v) - return float(ntf + nft) / float(2.0 * ntt + ntf + nft) - - -def rogerstanimoto(u, v): - r""" - Computes the Rogers-Tanimoto dissimilarity between two boolean - n-vectors ``u`` and ``v``, which is defined as - - .. math:: - \frac{R} - {c_{TT} + c_{FF} + R} - - where :math:`c_{ij}` is the number of occurrences of - :math:`\mathtt{u[k]} = i` and :math:`\mathtt{v[k]} = j` for - :math:`k < n` and :math:`R = 2(c_{TF} + c_{FT})`. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Rogers-Tanimoto dissimilarity between vectors - `u` and `v`. - """ - u = _validate_vector(u) - v = _validate_vector(v) - (nff, nft, ntf, ntt) = _nbool_correspond_all(u, v) - return float(2.0 * (ntf + nft)) / float(ntt + nff + (2.0 * (ntf + nft))) - - -def russellrao(u, v): - r""" - Computes the Russell-Rao dissimilarity between two boolean n-vectors - ``u`` and ``v``, which is defined as - - .. math:: - - \frac{n - c_{TT}} - {n} - - where :math:`c_{ij}` is the number of occurrences of - :math:`\mathtt{u[k]} = i` and :math:`\mathtt{v[k]} = j` for - :math:`k < n`. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Russell-Rao dissimilarity between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - if u.dtype == np.bool: - ntt = (u & v).sum() - else: - ntt = (u * v).sum() - return float(len(u) - ntt) / float(len(u)) - - -def sokalmichener(u, v): - r""" - Computes the Sokal-Michener dissimilarity between two boolean vectors - ``u`` and ``v``, which is defined as - - .. math:: - - \frac{R} - {S + R} - - where :math:`c_{ij}` is the number of occurrences of - :math:`\mathtt{u[k]} = i` and :math:`\mathtt{v[k]} = j` for - :math:`k < n`, :math:`R = 2 * (c_{TF} + c_{FT})` and - :math:`S = c_{FF} + c_{TT}`. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Sokal-Michener dissimilarity between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - if u.dtype == np.bool: - ntt = (u & v).sum() - nff = (~u & ~v).sum() - else: - ntt = (u * v).sum() - nff = ((1.0 - u) * (1.0 - v)).sum() - (nft, ntf) = _nbool_correspond_ft_tf(u, v) - return float(2.0 * (ntf + nft)) / float(ntt + nff + 2.0 * (ntf + nft)) - - -def sokalsneath(u, v): - r""" - Computes the Sokal-Sneath dissimilarity between two boolean vectors - ``u`` and ``v``, - - .. math:: - - \frac{R} - {c_{TT} + R} - - where :math:`c_{ij}` is the number of occurrences of - :math:`\mathtt{u[k]} = i` and :math:`\mathtt{v[k]} = j` for - :math:`k < n` and :math:`R = 2(c_{TF} + c_{FT})`. - - Parameters - ---------- - u : ndarray - An :math:`n`-dimensional vector. - v : ndarray - An :math:`n`-dimensional vector. - - Returns - ------- - d : double - The Sokal-Sneath dissimilarity between vectors ``u`` and ``v``. - """ - u = _validate_vector(u) - v = _validate_vector(v) - if u.dtype == np.bool: - ntt = (u & v).sum() - else: - ntt = (u * v).sum() - (nft, ntf) = _nbool_correspond_ft_tf(u, v) - denom = ntt + 2.0 * (ntf + nft) - if denom == 0: - raise ValueError('Sokal-Sneath dissimilarity is not defined for ' - 'vectors that are entirely false.') - return float(2.0 * (ntf + nft)) / denom - - -def pdist(X, metric='euclidean', p=2, w=None, V=None, VI=None): - r""" - Computes the pairwise distances between m original observations in - n-dimensional space. Returns a condensed distance matrix Y. For - each :math:`i` and :math:`j` (where :math:`i=2 encoding distances - as described, X=squareform(v) returns a d by d distance matrix X. The - X[i, j] and X[j, i] values are set to - v[{n \choose 2}-{n-i \choose 2} + (j-u-1)] and all - diagonal elements are zero. - - """ - - X = _convert_to_double(np.asarray(X, order='c')) - - if not np.issubsctype(X, np.double): - raise TypeError('A double array must be passed.') - - s = X.shape - - if force.lower() == 'tomatrix': - if len(s) != 1: - raise ValueError("Forcing 'tomatrix' but input X is not a " - "distance vector.") - elif force.lower() == 'tovector': - if len(s) != 2: - raise ValueError("Forcing 'tovector' but input X is not a " - "distance matrix.") - - # X = squareform(v) - if len(s) == 1: - if X.shape[0] == 0: - return np.zeros((1, 1), dtype=np.double) - - # Grab the closest value to the square root of the number - # of elements times 2 to see if the number of elements - # is indeed a binomial coefficient. - d = int(np.ceil(np.sqrt(X.shape[0] * 2))) - - # Check that v is of valid dimensions. - if d * (d - 1) / 2 != int(s[0]): - raise ValueError('Incompatible vector size. It must be a binomial ' - 'coefficient n choose 2 for some integer n >= 2.') - - # Allocate memory for the distance matrix. - M = np.zeros((d, d), dtype=np.double) - - # Since the C code does not support striding using strides. - # The dimensions are used instead. - [X] = _copy_arrays_if_base_present([X]) - - # Fill in the values of the distance matrix. - _distance_wrap.to_squareform_from_vector_wrap(M, X) - - # Return the distance matrix. - M = M + M.transpose() - return M - elif len(s) == 2: - if s[0] != s[1]: - raise ValueError('The matrix argument must be square.') - if checks: - is_valid_dm(X, throw=True, name='X') - - # One-side of the dimensions is set here. - d = s[0] - - if d <= 1: - return np.array([], dtype=np.double) - - # Create a vector. - v = np.zeros(((d * (d - 1) / 2),), dtype=np.double) - - # Since the C code does not support striding using strides. - # The dimensions are used instead. - [X] = _copy_arrays_if_base_present([X]) - - # Convert the vector to squareform. - _distance_wrap.to_vector_from_squareform_wrap(X, v) - return v - else: - raise ValueError(('The first argument must be one or two dimensional ' - 'array. A %d-dimensional array is not ' - 'permitted') % len(s)) - - -def is_valid_dm(D, tol=0.0, throw=False, name="D", warning=False): - """ - Returns True if the variable D passed is a valid distance matrix. - Distance matrices must be 2-dimensional numpy arrays containing - doubles. They must have a zero-diagonal, and they must be symmetric. - - Parameters - ---------- - D : ndarray - The candidate object to test for validity. - tol : double - The distance matrix should be symmetric. tol is the maximum - difference between the :math:`ij`th entry and the - :math:`ji`th entry for the distance metric to be - considered symmetric. - throw : bool - An exception is thrown if the distance matrix passed is not - valid. - name : string - the name of the variable to checked. This is useful if - throw is set to ``True`` so the offending variable can be - identified in the exception message when an exception is - thrown. - warning : bool - Instead of throwing an exception, a warning message is - raised. - - Returns - ------- - Returns ``True`` if the variable ``D`` passed is a valid - distance matrix. Small numerical differences in ``D`` and - ``D.T`` and non-zeroness of the diagonal are ignored if they are - within the tolerance specified by ``tol``. - """ - D = np.asarray(D, order='c') - valid = True - try: - s = D.shape - if D.dtype != np.double: - if name: - raise TypeError(('Distance matrix \'%s\' must contain doubles ' - '(double).') % name) - else: - raise TypeError('Distance matrix must contain doubles ' - '(double).') - if len(D.shape) != 2: - if name: - raise ValueError(('Distance matrix \'%s\' must have shape=2 ' - '(i.e. be two-dimensional).') % name) - else: - raise ValueError('Distance matrix must have shape=2 (i.e. ' - 'be two-dimensional).') - if tol == 0.0: - if not (D == D.T).all(): - if name: - raise ValueError(('Distance matrix \'%s\' must be ' - 'symmetric.') % name) - else: - raise ValueError('Distance matrix must be symmetric.') - if not (D[range(0, s[0]), range(0, s[0])] == 0).all(): - if name: - raise ValueError(('Distance matrix \'%s\' diagonal must ' - 'be zero.') % name) - else: - raise ValueError('Distance matrix diagonal must be zero.') - else: - if not (D - D.T <= tol).all(): - if name: - raise ValueError(('Distance matrix \'%s\' must be ' - 'symmetric within tolerance %d.') - % (name, tol)) - else: - raise ValueError('Distance matrix must be symmetric within' - ' tolerance %5.5f.' % tol) - if not (D[range(0, s[0]), range(0, s[0])] <= tol).all(): - if name: - raise ValueError(('Distance matrix \'%s\' diagonal must be' - ' close to zero within tolerance %5.5f.') - % (name, tol)) - else: - raise ValueError(('Distance matrix \'%s\' diagonal must be' - ' close to zero within tolerance %5.5f.') - % tol) - except Exception as e: - if throw: - raise - if warning: - warnings.warn(str(e)) - valid = False - return valid - - -def is_valid_y(y, warning=False, throw=False, name=None): - r""" - Returns ``True`` if the variable ``y`` passed is a valid condensed - distance matrix. Condensed distance matrices must be 1-dimensional - numpy arrays containing doubles. Their length must be a binomial - coefficient :math:`{n \choose 2}` for some positive integer n. - - - Parameters - ---------- - y : ndarray - The condensed distance matrix. - warning : bool, optional - Invokes a warning if the variable passed is not a valid - condensed distance matrix. The warning message explains why - the distance matrix is not valid. 'name' is used when - referencing the offending variable. - throws : throw, optional - Throws an exception if the variable passed is not a valid - condensed distance matrix. - name : bool, optional - Used when referencing the offending variable in the - warning or exception message. - - """ - y = np.asarray(y, order='c') - valid = True - try: - if type(y) != np.ndarray: - if name: - raise TypeError(('\'%s\' passed as a condensed distance ' - 'matrix is not a numpy array.') % name) - else: - raise TypeError('Variable is not a numpy array.') - if y.dtype != np.double: - if name: - raise TypeError(('Condensed distance matrix \'%s\' must ' - 'contain doubles (double).') % name) - else: - raise TypeError('Condensed distance matrix must contain ' - 'doubles (double).') - if len(y.shape) != 1: - if name: - raise ValueError(('Condensed distance matrix \'%s\' must ' - 'have shape=1 (i.e. be one-dimensional).') - % name) - else: - raise ValueError('Condensed distance matrix must have shape=1 ' - '(i.e. be one-dimensional).') - n = y.shape[0] - d = int(np.ceil(np.sqrt(n * 2))) - if (d * (d - 1) / 2) != n: - if name: - raise ValueError(('Length n of condensed distance matrix ' - '\'%s\' must be a binomial coefficient, i.e.' - 'there must be a k such that ' - '(k \choose 2)=n)!') % name) - else: - raise ValueError('Length n of condensed distance matrix must ' - 'be a binomial coefficient, i.e. there must ' - 'be a k such that (k \choose 2)=n)!') - except Exception as e: - if throw: - raise - if warning: - warnings.warn(str(e)) - valid = False - return valid - - -def num_obs_dm(d): - """ - Returns the number of original observations that correspond to a - square, redundant distance matrix ``D``. - - Parameters - ---------- - d : ndarray - The target distance matrix. - - Returns - ------- - numobs : int - The number of observations in the redundant distance matrix. - """ - d = np.asarray(d, order='c') - is_valid_dm(d, tol=np.inf, throw=True, name='d') - return d.shape[0] - - -def num_obs_y(Y): - """ - Returns the number of original observations that correspond to a - condensed distance matrix ``Y``. - - Parameters - ---------- - Y : ndarray - The number of original observations in the condensed - observation ``Y``. - - Returns - ------- - n : int - The number of observations in the condensed distance matrix - passed. - """ - Y = np.asarray(Y, order='c') - is_valid_y(Y, throw=True, name='Y') - k = Y.shape[0] - if k == 0: - raise ValueError("The number of observations cannot be determined on " - "an empty distance matrix.") - d = int(np.ceil(np.sqrt(k * 2))) - if (d * (d - 1) / 2) != k: - raise ValueError("Invalid condensed distance matrix passed. Must be " - "some k where k=(n choose 2) for some n >= 2.") - return d - - -def cdist(XA, XB, metric='euclidean', p=2, V=None, VI=None, w=None): - r""" - Computes distance between each pair of observation vectors in the - Cartesian product of two collections of vectors. ``XA`` is a - :math:`m_A` by :math:`n` array while ``XB`` is a :math:`m_B` by - :math:`n` array. A :math:`m_A` by :math:`m_B` array is - returned. An exception is thrown if ``XA`` and ``XB`` do not have - the same number of columns. - - A rectangular distance matrix ``Y`` is returned. For each :math:`i` - and :math:`j`, the metric ``dist(u=XA[i], v=XB[j])`` is computed - and stored in the :math:`ij` th entry. - - The following are common calling conventions: - - 1. ``Y = cdist(XA, XB, 'euclidean')`` - - Computes the distance between :math:`m` points using - Euclidean distance (2-norm) as the distance metric between the - points. The points are arranged as :math:`m` - :math:`n`-dimensional row vectors in the matrix X. - - 2. ``Y = cdist(XA, XB, 'minkowski', p)`` - - Computes the distances using the Minkowski distance - :math:`||u-v||_p` (:math:`p`-norm) where :math:`p \geq 1`. - - 3. ``Y = cdist(XA, XB, 'cityblock')`` - - Computes the city block or Manhattan distance between the - points. - - 4. ``Y = cdist(XA, XB, 'seuclidean', V=None)`` - - Computes the standardized Euclidean distance. The standardized - Euclidean distance between two n-vectors ``u`` and ``v`` is - - .. math:: - - \sqrt{\sum {(u_i-v_i)^2 / V[x_i]}}. - - V is the variance vector; V[i] is the variance computed over all - the i'th components of the points. If not passed, it is - automatically computed. - - 5. ``Y = cdist(XA, XB, 'sqeuclidean')`` - - Computes the squared Euclidean distance :math:`||u-v||_2^2` between - the vectors. - - 6. ``Y = cdist(XA, XB, 'cosine')`` - - Computes the cosine distance between vectors u and v, - - .. math:: - - \frac{1 - uv^T} - {{|u|}_2 {|v|}_2} - - where :math:`|*|_2` is the 2-norm of its argument *. - - 7. ``Y = cdist(XA, XB, 'correlation')`` - - Computes the correlation distance between vectors u and v. This is - - .. math:: - - \frac{1 - (u - n{|u|}_1){(v - n{|v|}_1)}^T} - {{|(u - n{|u|}_1)|}_2 {|(v - n{|v|}_1)|}^T} - - where :math:`|*|_1` is the Manhattan (or 1-norm) of its - argument, and :math:`n` is the common dimensionality of the - vectors. - - 8. ``Y = cdist(XA, XB, 'hamming')`` - - Computes the normalized Hamming distance, or the proportion of - those vector elements between two n-vectors ``u`` and ``v`` - which disagree. To save memory, the matrix ``X`` can be of type - boolean. - - 9. ``Y = cdist(XA, XB, 'jaccard')`` - - Computes the Jaccard distance between the points. Given two - vectors, ``u`` and ``v``, the Jaccard distance is the - proportion of those elements ``u[i]`` and ``v[i]`` that - disagree where at least one of them is non-zero. - - 10. ``Y = cdist(XA, XB, 'chebyshev')`` - - Computes the Chebyshev distance between the points. The - Chebyshev distance between two n-vectors ``u`` and ``v`` is the - maximum norm-1 distance between their respective elements. More - precisely, the distance is given by - - .. math:: - - d(u,v) = \max_i {|u_i-v_i|}. - - 11. ``Y = cdist(XA, XB, 'canberra')`` - - Computes the Canberra distance between the points. The - Canberra distance between two points ``u`` and ``v`` is - - .. math:: - - d(u,v) = \sum_u \frac{|u_i-v_i|} - {(|u_i|+|v_i|)} - - - 12. ``Y = cdist(XA, XB, 'braycurtis')`` - - Computes the Bray-Curtis distance between the points. The - Bray-Curtis distance between two points ``u`` and ``v`` is - - - .. math:: - - d(u,v) = \frac{\sum_i (u_i-v_i)} - {\sum_i (u_i+v_i)} - - 13. ``Y = cdist(XA, XB, 'mahalanobis', VI=None)`` - - Computes the Mahalanobis distance between the points. The - Mahalanobis distance between two points ``u`` and ``v`` is - :math:`(u-v)(1/V)(u-v)^T` where :math:`(1/V)` (the ``VI`` - variable) is the inverse covariance. If ``VI`` is not None, - ``VI`` will be used as the inverse covariance matrix. - - 14. ``Y = cdist(XA, XB, 'yule')`` - - Computes the Yule distance between the boolean - vectors. (see yule function documentation) - - 15. ``Y = cdist(XA, XB, 'matching')`` - - Computes the matching distance between the boolean - vectors. (see matching function documentation) - - 16. ``Y = cdist(XA, XB, 'dice')`` - - Computes the Dice distance between the boolean vectors. (see - dice function documentation) - - 17. ``Y = cdist(XA, XB, 'kulsinski')`` - - Computes the Kulsinski distance between the boolean - vectors. (see kulsinski function documentation) - - 18. ``Y = cdist(XA, XB, 'rogerstanimoto')`` - - Computes the Rogers-Tanimoto distance between the boolean - vectors. (see rogerstanimoto function documentation) - - 19. ``Y = cdist(XA, XB, 'russellrao')`` - - Computes the Russell-Rao distance between the boolean - vectors. (see russellrao function documentation) - - 20. ``Y = cdist(XA, XB, 'sokalmichener')`` - - Computes the Sokal-Michener distance between the boolean - vectors. (see sokalmichener function documentation) - - 21. ``Y = cdist(XA, XB, 'sokalsneath')`` - - Computes the Sokal-Sneath distance between the vectors. (see - sokalsneath function documentation) - - - 22. ``Y = cdist(XA, XB, 'wminkowski')`` - - Computes the weighted Minkowski distance between the - vectors. (see sokalsneath function documentation) - - 23. ``Y = cdist(XA, XB, f)`` - - Computes the distance between all pairs of vectors in X - using the user supplied 2-arity function f. For example, - Euclidean distance between the vectors could be computed - as follows:: - - dm = cdist(XA, XB, (lambda u, v: np.sqrt(((u-v)*(u-v).T).sum()))) - - Note that you should avoid passing a reference to one of - the distance functions defined in this library. For example,:: - - dm = cdist(XA, XB, sokalsneath) - - would calculate the pair-wise distances between the vectors in - X using the Python function sokalsneath. This would result in - sokalsneath being called :math:`{n \choose 2}` times, which - is inefficient. Instead, the optimized C version is more - efficient, and we call it using the following syntax.:: - - dm = cdist(XA, XB, 'sokalsneath') - - Parameters - ---------- - XA : ndarray - An :math:`m_A` by :math:`n` array of :math:`m_A` - original observations in an :math:`n`-dimensional space. - XB : ndarray - An :math:`m_B` by :math:`n` array of :math:`m_B` - original observations in an :math:`n`-dimensional space. - metric : string or function - The distance metric to use. The distance function can - be 'braycurtis', 'canberra', 'chebyshev', 'cityblock', - 'correlation', 'cosine', 'dice', 'euclidean', 'hamming', - 'jaccard', 'kulsinski', 'mahalanobis', 'matching', - 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', - 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'wminkowski', - 'yule'. - w : ndarray - The weight vector (for weighted Minkowski). - p : double - The p-norm to apply (for Minkowski, weighted and unweighted) - V : ndarray - The variance vector (for standardized Euclidean). - VI : ndarray - The inverse of the covariance matrix (for Mahalanobis). - - - Returns - ------- - Y : ndarray - A :math:`m_A` by :math:`m_B` distance matrix. - """ - -# 21. Y = cdist(XA, XB, 'test_Y') -# -# Computes the distance between all pairs of vectors in X -# using the distance metric Y but with a more succint, -# verifiable, but less efficient implementation. - - XA = np.asarray(XA, order='c') - XB = np.asarray(XB, order='c') - - #if np.issubsctype(X, np.floating) and not np.issubsctype(X, np.double): - # raise TypeError('Floating point arrays must be 64-bit (got %r).' % - # (X.dtype.type,)) - - # The C code doesn't do striding. - [XA] = _copy_arrays_if_base_present([_convert_to_double(XA)]) - [XB] = _copy_arrays_if_base_present([_convert_to_double(XB)]) - - s = XA.shape - sB = XB.shape - - if len(s) != 2: - raise ValueError('XA must be a 2-dimensional array.') - if len(sB) != 2: - raise ValueError('XB must be a 2-dimensional array.') - if s[1] != sB[1]: - raise ValueError('XA and XB must have the same number of columns ' - '(i.e. feature dimension.)') - - mA = s[0] - mB = sB[0] - n = s[1] - dm = np.zeros((mA, mB), dtype=np.double) - - if callable(metric): - if metric == minkowski: - for i in range(0, mA): - for j in range(0, mB): - dm[i, j] = minkowski(XA[i, :], XB[j, :], p) - elif metric == wminkowski: - for i in range(0, mA): - for j in range(0, mB): - dm[i, j] = wminkowski(XA[i, :], XB[j, :], p, w) - elif metric == seuclidean: - for i in range(0, mA): - for j in range(0, mB): - dm[i, j] = seuclidean(XA[i, :], XB[j, :], V) - elif metric == mahalanobis: - for i in range(0, mA): - for j in range(0, mB): - dm[i, j] = mahalanobis(XA[i, :], XB[j, :], V) - else: - for i in range(0, mA): - for j in range(0, mB): - dm[i, j] = metric(XA[i, :], XB[j, :]) - elif isinstance(metric, string_types): - mstr = metric.lower() - - #if XA.dtype != np.double and \ - # (mstr != 'hamming' and mstr != 'jaccard'): - # TypeError('A double array must be passed.') - if mstr in set(['euclidean', 'euclid', 'eu', 'e']): - _distance_wrap.cdist_euclidean_wrap(_convert_to_double(XA), - _convert_to_double(XB), dm) - elif mstr in set(['sqeuclidean', 'sqe', 'sqeuclid']): - _distance_wrap.cdist_euclidean_wrap(_convert_to_double(XA), - _convert_to_double(XB), dm) - dm **= 2.0 - elif mstr in set(['cityblock', 'cblock', 'cb', 'c']): - _distance_wrap.cdist_city_block_wrap(_convert_to_double(XA), - _convert_to_double(XB), dm) - elif mstr in set(['hamming', 'hamm', 'ha', 'h']): - if XA.dtype == np.bool: - _distance_wrap.cdist_hamming_bool_wrap(_convert_to_bool(XA), - _convert_to_bool(XB), - dm) - else: - _distance_wrap.cdist_hamming_wrap(_convert_to_double(XA), - _convert_to_double(XB), dm) - elif mstr in set(['jaccard', 'jacc', 'ja', 'j']): - if XA.dtype == np.bool: - _distance_wrap.cdist_jaccard_bool_wrap(_convert_to_bool(XA), - _convert_to_bool(XB), - dm) - else: - _distance_wrap.cdist_jaccard_wrap(_convert_to_double(XA), - _convert_to_double(XB), dm) - elif mstr in set(['chebychev', 'chebyshev', 'cheby', 'cheb', 'ch']): - _distance_wrap.cdist_chebyshev_wrap(_convert_to_double(XA), - _convert_to_double(XB), dm) - elif mstr in set(['minkowski', 'mi', 'm', 'pnorm']): - _distance_wrap.cdist_minkowski_wrap(_convert_to_double(XA), - _convert_to_double(XB), dm, p) - elif mstr in set(['wminkowski', 'wmi', 'wm', 'wpnorm']): - _distance_wrap.cdist_weighted_minkowski_wrap(_convert_to_double(XA), - _convert_to_double(XB), - dm, p, - _convert_to_double(w)) - elif mstr in set(['seuclidean', 'se', 's']): - if V is not None: - V = np.asarray(V, order='c') - if type(V) != np.ndarray: - raise TypeError('Variance vector V must be a numpy array') - if V.dtype != np.double: - raise TypeError('Variance vector V must contain doubles.') - if len(V.shape) != 1: - raise ValueError('Variance vector V must be ' - 'one-dimensional.') - if V.shape[0] != n: - raise ValueError('Variance vector V must be of the same ' - 'dimension as the vectors on which the ' - 'distances are computed.') - # The C code doesn't do striding. - [VV] = _copy_arrays_if_base_present([_convert_to_double(V)]) - else: - X = np.vstack([XA, XB]) - VV = np.var(X, axis=0, ddof=1) - X = None - del X - _distance_wrap.cdist_seuclidean_wrap(_convert_to_double(XA), - _convert_to_double(XB), VV, dm) - # Need to test whether vectorized cosine works better. - # Find out: Is there a dot subtraction operator so I can - # subtract matrices in a similar way to multiplying them? - # Need to get rid of as much unnecessary C code as possible. - elif mstr in set(['cosine', 'cos']): - normsA = np.sqrt(np.sum(XA * XA, axis=1)) - normsB = np.sqrt(np.sum(XB * XB, axis=1)) - _distance_wrap.cdist_cosine_wrap(_convert_to_double(XA), - _convert_to_double(XB), dm, - normsA, - normsB) - elif mstr in set(['correlation', 'co']): - XA2 = XA - XA.mean(1)[:, np.newaxis] - XB2 = XB - XB.mean(1)[:, np.newaxis] - #X2 = X - np.matlib.repmat(np.mean(X, axis=1).reshape(m, 1), 1, n) - normsA = np.sqrt(np.sum(XA2 * XA2, axis=1)) - normsB = np.sqrt(np.sum(XB2 * XB2, axis=1)) - _distance_wrap.cdist_cosine_wrap(_convert_to_double(XA2), - _convert_to_double(XB2), - _convert_to_double(dm), - _convert_to_double(normsA), - _convert_to_double(normsB)) - elif mstr in set(['mahalanobis', 'mahal', 'mah']): - if VI is not None: - VI = _convert_to_double(np.asarray(VI, order='c')) - if type(VI) != np.ndarray: - raise TypeError('VI must be a numpy array.') - if VI.dtype != np.double: - raise TypeError('The array must contain 64-bit floats.') - [VI] = _copy_arrays_if_base_present([VI]) - else: - X = np.vstack([XA, XB]) - V = np.cov(X.T) - X = None - del X - VI = _convert_to_double(np.linalg.inv(V).T.copy()) - # (u-v)V^(-1)(u-v)^T - _distance_wrap.cdist_mahalanobis_wrap(_convert_to_double(XA), - _convert_to_double(XB), - VI, dm) - elif mstr == 'canberra': - _distance_wrap.cdist_canberra_wrap(_convert_to_double(XA), - _convert_to_double(XB), dm) - elif mstr == 'braycurtis': - _distance_wrap.cdist_bray_curtis_wrap(_convert_to_double(XA), - _convert_to_double(XB), dm) - elif mstr == 'yule': - _distance_wrap.cdist_yule_bool_wrap(_convert_to_bool(XA), - _convert_to_bool(XB), dm) - elif mstr == 'matching': - _distance_wrap.cdist_matching_bool_wrap(_convert_to_bool(XA), - _convert_to_bool(XB), dm) - elif mstr == 'kulsinski': - _distance_wrap.cdist_kulsinski_bool_wrap(_convert_to_bool(XA), - _convert_to_bool(XB), dm) - elif mstr == 'dice': - _distance_wrap.cdist_dice_bool_wrap(_convert_to_bool(XA), - _convert_to_bool(XB), dm) - elif mstr == 'rogerstanimoto': - _distance_wrap.cdist_rogerstanimoto_bool_wrap(_convert_to_bool(XA), - _convert_to_bool(XB), - dm) - elif mstr == 'russellrao': - _distance_wrap.cdist_russellrao_bool_wrap(_convert_to_bool(XA), - _convert_to_bool(XB), dm) - elif mstr == 'sokalmichener': - _distance_wrap.cdist_sokalmichener_bool_wrap(_convert_to_bool(XA), - _convert_to_bool(XB), - dm) - elif mstr == 'sokalsneath': - _distance_wrap.cdist_sokalsneath_bool_wrap(_convert_to_bool(XA), - _convert_to_bool(XB), - dm) - elif metric == 'test_euclidean': - dm = cdist(XA, XB, euclidean) - elif metric == 'test_seuclidean': - if V is None: - V = np.var(np.vstack([XA, XB]), axis=0, ddof=1) - else: - V = np.asarray(V, order='c') - dm = cdist(XA, XB, lambda u, v: seuclidean(u, v, V)) - elif metric == 'test_sqeuclidean': - dm = cdist(XA, XB, lambda u, v: sqeuclidean(u, v)) - elif metric == 'test_braycurtis': - dm = cdist(XA, XB, braycurtis) - elif metric == 'test_mahalanobis': - if VI is None: - X = np.vstack([XA, XB]) - V = np.cov(X.T) - VI = np.linalg.inv(V) - X = None - del X - else: - VI = np.asarray(VI, order='c') - [VI] = _copy_arrays_if_base_present([VI]) - # (u-v)V^(-1)(u-v)^T - dm = cdist(XA, XB, (lambda u, v: mahalanobis(u, v, VI))) - elif metric == 'test_canberra': - dm = cdist(XA, XB, canberra) - elif metric == 'test_cityblock': - dm = cdist(XA, XB, cityblock) - elif metric == 'test_minkowski': - dm = cdist(XA, XB, minkowski, p=p) - elif metric == 'test_wminkowski': - dm = cdist(XA, XB, wminkowski, p=p, w=w) - elif metric == 'test_cosine': - dm = cdist(XA, XB, cosine) - elif metric == 'test_correlation': - dm = cdist(XA, XB, correlation) - elif metric == 'test_hamming': - dm = cdist(XA, XB, hamming) - elif metric == 'test_jaccard': - dm = cdist(XA, XB, jaccard) - elif metric == 'test_chebyshev' or metric == 'test_chebychev': - dm = cdist(XA, XB, chebyshev) - elif metric == 'test_yule': - dm = cdist(XA, XB, yule) - elif metric == 'test_matching': - dm = cdist(XA, XB, matching) - elif metric == 'test_dice': - dm = cdist(XA, XB, dice) - elif metric == 'test_kulsinski': - dm = cdist(XA, XB, kulsinski) - elif metric == 'test_rogerstanimoto': - dm = cdist(XA, XB, rogerstanimoto) - elif metric == 'test_russellrao': - dm = cdist(XA, XB, russellrao) - elif metric == 'test_sokalsneath': - dm = cdist(XA, XB, sokalsneath) - elif metric == 'test_sokalmichener': - dm = cdist(XA, XB, sokalmichener) - else: - raise ValueError('Unknown Distance Metric: %s' % mstr) - else: - raise TypeError('2nd argument metric must be a string identifier ' - 'or a function.') - return dm diff -Nru yt-3.3.3/yt/utilities/spatial/__init__.py yt-3.4.0/yt/utilities/spatial/__init__.py --- yt-3.3.3/yt/utilities/spatial/__init__.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/spatial/__init__.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -""" -============================================================= -Spatial algorithms and data structures (:mod:`scipy.spatial`) -============================================================= - -Nearest-neighbor queries: - -.. autosummary:: - :toctree: generated/ - - KDTree -- class for efficient nearest-neighbor queries - cKDTree -- class for efficient nearest-neighbor queries (faster impl.) - distance -- module containing many different distance measures - -Delaunay triangulation: - -.. autosummary:: - :toctree: generated/ - - Delaunay - tsearch - -""" -from __future__ import absolute_import - -from .kdtree import * -from .ckdtree import * -#from qhull import * - -__all__ = list(filter(lambda s: not s.startswith('_'), dir())) -__all__ += ['distance'] - -from . import distance -from numpy.testing import Tester -test = Tester().test diff -Nru yt-3.3.3/yt/utilities/spatial/kdtree.py yt-3.4.0/yt/utilities/spatial/kdtree.py --- yt-3.3.3/yt/utilities/spatial/kdtree.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/spatial/kdtree.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,887 +0,0 @@ -# Copyright Anne M. Archibald 2008 -# Released under the scipy license -import sys -import numpy as np -from heapq import heappush, heappop -#import scipy.sparse - -__all__ = ['minkowski_distance_p', 'minkowski_distance', - 'distance_matrix', - 'Rectangle', 'KDTree'] - - -def minkowski_distance_p(x, y, p=2): - """ - Compute the p-th power of the L**p distance between x and y. - - For efficiency, this function computes the L**p distance but does - not extract the pth root. If p is 1 or infinity, this is equal to - the actual L**p distance. - - Parameters - ---------- - x : array_like, M by K - - y : array_like, N by K - - p : float, 1 <= p <= infinity - Which Minkowski p-norm to use. - - Examples - -------- - >>> minkowski_distance_p([[0,0],[0,0]], [[1,1],[0,1]]) - array([2, 1]) - - """ - x = np.asarray(x) - y = np.asarray(y) - if p == np.inf: - return np.amax(np.abs(y-x), axis=-1) - elif p == 1: - return np.sum(np.abs(y-x), axis=-1) - else: - return np.sum(np.abs(y-x)**p, axis=-1) - -def minkowski_distance(x, y, p=2): - """ - Compute the L**p distance between x and y. - - Parameters - ---------- - x : array_like, M by K - - y : array_like, N by K - - p : float, 1 <= p <= infinity - Which Minkowski p-norm to use. - - Examples - -------- - >>> minkowski_distance([[0,0],[0,0]], [[1,1],[0,1]]) - array([ 1.41421356, 1. ]) - - """ - x = np.asarray(x) - y = np.asarray(y) - if p == np.inf or p == 1: - return minkowski_distance_p(x, y, p) - else: - return minkowski_distance_p(x, y, p)**(1./p) - -class Rectangle(object): - """Hyperrectangle class. - - Represents a Cartesian product of intervals. - """ - def __init__(self, maxes, mins): - """Construct a hyperrectangle.""" - self.maxes = np.maximum(maxes,mins).astype(np.float) - self.mins = np.minimum(maxes,mins).astype(np.float) - self.m, = self.maxes.shape - - def __repr__(self): - return "" % zip(self.mins, self.maxes) - - def volume(self): - """Total volume.""" - return np.prod(self.maxes-self.mins) - - def split(self, d, split): - """Produce two hyperrectangles by splitting along axis d. - - In general, if you need to compute maximum and minimum - distances to the children, it can be done more efficiently - by updating the maximum and minimum distances to the parent. - """ # FIXME: do this - mid = np.copy(self.maxes) - mid[d] = split - less = Rectangle(self.mins, mid) - mid = np.copy(self.mins) - mid[d] = split - greater = Rectangle(mid, self.maxes) - return less, greater - - def min_distance_point(self, x, p=2.): - """Compute the minimum distance between x and a point in the hyperrectangle.""" - return minkowski_distance(0, np.maximum(0,np.maximum(self.mins-x,x-self.maxes)),p) - - def max_distance_point(self, x, p=2.): - """Compute the maximum distance between x and a point in the hyperrectangle.""" - return minkowski_distance(0, np.maximum(self.maxes-x,x-self.mins),p) - - def min_distance_rectangle(self, other, p=2.): - """Compute the minimum distance between points in the two hyperrectangles.""" - return minkowski_distance(0, np.maximum(0,np.maximum(self.mins-other.maxes,other.mins-self.maxes)),p) - - def max_distance_rectangle(self, other, p=2.): - """Compute the maximum distance between points in the two hyperrectangles.""" - return minkowski_distance(0, np.maximum(self.maxes-other.mins,other.maxes-self.mins),p) - - -class KDTree(object): - """ - kd-tree for quick nearest-neighbor lookup - - This class provides an index into a set of k-dimensional points - which can be used to rapidly look up the nearest neighbors of any - point. - - The algorithm used is described in Maneewongvatana and Mount 1999. - The general idea is that the kd-tree is a binary tree, each of whose - nodes represents an axis-aligned hyperrectangle. Each node specifies - an axis and splits the set of points based on whether their coordinate - along that axis is greater than or less than a particular value. - - During construction, the axis and splitting point are chosen by the - "sliding midpoint" rule, which ensures that the cells do not all - become long and thin. - - The tree can be queried for the r closest neighbors of any given point - (optionally returning only those within some maximum distance of the - point). It can also be queried, with a substantial gain in efficiency, - for the r approximate closest neighbors. - - For large dimensions (20 is already large) do not expect this to run - significantly faster than brute force. High-dimensional nearest-neighbor - queries are a substantial open problem in computer science. - - The tree also supports all-neighbors queries, both with arrays of points - and with other kd-trees. These do use a reasonably efficient algorithm, - but the kd-tree is not necessarily the best data structure for this - sort of calculation. - - """ - def __init__(self, data, leafsize=10): - """Construct a kd-tree. - - Parameters - ---------- - data : array_like, shape (n,k) - The data points to be indexed. This array is not copied, and - so modifying this data will result in bogus results. - leafsize : positive int - The number of points at which the algorithm switches over to - brute-force. - """ - self.data = np.asarray(data) - self.n, self.m = np.shape(self.data) - self.leafsize = int(leafsize) - if self.leafsize<1: - raise ValueError("leafsize must be at least 1") - self.maxes = np.amax(self.data,axis=0) - self.mins = np.amin(self.data,axis=0) - - self.tree = self.__build(np.arange(self.n), self.maxes, self.mins) - - class node(object): - if sys.version_info[0] >= 3: - def __lt__(self, other): - id(self) < id(other) - def __gt__(self, other): - id(self) > id(other) - def __le__(self, other): - id(self) <= id(other) - def __ge__(self, other): - id(self) >= id(other) - def __eq__(self, other): - id(self) == id(other) - - class leafnode(node): - def __init__(self, idx): - self.idx = idx - self.children = len(idx) - - class innernode(node): - def __init__(self, split_dim, split, less, greater): - self.split_dim = split_dim - self.split = split - self.less = less - self.greater = greater - self.children = less.children+greater.children - - def __build(self, idx, maxes, mins): - if len(idx)<=self.leafsize: - return KDTree.leafnode(idx) - else: - data = self.data[idx] - #maxes = np.amax(data,axis=0) - #mins = np.amin(data,axis=0) - d = np.argmax(maxes-mins) - maxval = maxes[d] - minval = mins[d] - if maxval==minval: - # all points are identical; warn user? - return KDTree.leafnode(idx) - data = data[:,d] - - # sliding midpoint rule; see Maneewongvatana and Mount 1999 - # for arguments that this is a good idea. - split = (maxval+minval)/2 - less_idx = np.nonzero(data<=split)[0] - greater_idx = np.nonzero(data>split)[0] - if len(less_idx)==0: - split = np.amin(data) - less_idx = np.nonzero(data<=split)[0] - greater_idx = np.nonzero(data>split)[0] - if len(greater_idx)==0: - split = np.amax(data) - less_idx = np.nonzero(data=split)[0] - if len(less_idx)==0: - # _still_ zero? all must have the same value - if not np.all(data==data[0]): - raise ValueError("Troublesome data array: %s" % data) - split = data[0] - less_idx = np.arange(len(data)-1) - greater_idx = np.array([len(data)-1]) - - lessmaxes = np.copy(maxes) - lessmaxes[d] = split - greatermins = np.copy(mins) - greatermins[d] = split - return KDTree.innernode(d, split, - self.__build(idx[less_idx],lessmaxes,mins), - self.__build(idx[greater_idx],maxes,greatermins)) - - def __query(self, x, k=1, eps=0, p=2, distance_upper_bound=np.inf): - - side_distances = np.maximum(0,np.maximum(x-self.maxes,self.mins-x)) - if p!=np.inf: - side_distances**=p - min_distance = np.sum(side_distances) - else: - min_distance = np.amax(side_distances) - - # priority queue for chasing nodes - # entries are: - # minimum distance between the cell and the target - # distances between the nearest side of the cell and the target - # the head node of the cell - q = [(min_distance, - tuple(side_distances), - self.tree)] - # priority queue for the nearest neighbors - # furthest known neighbor first - # entries are (-distance**p, i) - neighbors = [] - - if eps==0: - epsfac=1 - elif p==np.inf: - epsfac = 1/(1+eps) - else: - epsfac = 1/(1+eps)**p - - if p!=np.inf and distance_upper_bound!=np.inf: - distance_upper_bound = distance_upper_bound**p - - while q: - min_distance, side_distances, node = heappop(q) - if isinstance(node, KDTree.leafnode): - # brute-force - data = self.data[node.idx] - ds = minkowski_distance_p(data,x[np.newaxis,:],p) - for i in range(len(ds)): - if ds[i]distance_upper_bound*epsfac: - # since this is the nearest cell, we're done, bail out - break - # compute minimum distances to the children and push them on - if x[node.split_dim]>> from scipy.spatial import KDTree - >>> x, y = np.mgrid[0:5, 2:8] - >>> tree = KDTree(zip(x.ravel(), y.ravel())) - >>> tree.data - array([[0, 2], - [0, 3], - [0, 4], - [0, 5], - [0, 6], - [0, 7], - [1, 2], - [1, 3], - [1, 4], - [1, 5], - [1, 6], - [1, 7], - [2, 2], - [2, 3], - [2, 4], - [2, 5], - [2, 6], - [2, 7], - [3, 2], - [3, 3], - [3, 4], - [3, 5], - [3, 6], - [3, 7], - [4, 2], - [4, 3], - [4, 4], - [4, 5], - [4, 6], - [4, 7]]) - >>> pts = np.array([[0, 0], [2.1, 2.9]]) - >>> tree.query(pts) - (array([ 2. , 0.14142136]), array([ 0, 13])) - - """ - x = np.asarray(x) - if np.shape(x)[-1] != self.m: - raise ValueError("x must consist of vectors of length %d but has shape %s" % (self.m, np.shape(x))) - if p<1: - raise ValueError("Only p-norms with 1<=p<=infinity permitted") - retshape = np.shape(x)[:-1] - if retshape!=(): - if k is None: - dd = np.empty(retshape,dtype=np.object) - ii = np.empty(retshape,dtype=np.object) - elif k>1: - dd = np.empty(retshape+(k,),dtype=np.float) - dd.fill(np.inf) - ii = np.empty(retshape+(k,),dtype=np.int) - ii.fill(self.n) - elif k==1: - dd = np.empty(retshape,dtype=np.float) - dd.fill(np.inf) - ii = np.empty(retshape,dtype=np.int) - ii.fill(self.n) - else: - raise ValueError("Requested %s nearest neighbors; acceptable numbers are integers greater than or equal to one, or None") - for c in np.ndindex(retshape): - hits = self.__query(x[c], k=k, p=p, distance_upper_bound=distance_upper_bound) - if k is None: - dd[c] = [d for (d,i) in hits] - ii[c] = [i for (d,i) in hits] - elif k>1: - for j in range(len(hits)): - dd[c+(j,)], ii[c+(j,)] = hits[j] - elif k==1: - if len(hits)>0: - dd[c], ii[c] = hits[0] - else: - dd[c] = np.inf - ii[c] = self.n - return dd, ii - else: - hits = self.__query(x, k=k, p=p, distance_upper_bound=distance_upper_bound) - if k is None: - return [d for (d,i) in hits], [i for (d,i) in hits] - elif k==1: - if len(hits)>0: - return hits[0] - else: - return np.inf, self.n - elif k>1: - dd = np.empty(k,dtype=np.float) - dd.fill(np.inf) - ii = np.empty(k,dtype=np.int) - ii.fill(self.n) - for j in range(len(hits)): - dd[j], ii[j] = hits[j] - return dd, ii - else: - raise ValueError("Requested %s nearest neighbors; acceptable numbers are integers greater than or equal to one, or None") - - - def __query_ball_point(self, x, r, p=2., eps=0): - R = Rectangle(self.maxes, self.mins) - - def traverse_checking(node, rect): - if rect.min_distance_point(x, p) > r / (1. + eps): - return [] - elif rect.max_distance_point(x, p) < r * (1. + eps): - return traverse_no_checking(node) - elif isinstance(node, KDTree.leafnode): - d = self.data[node.idx] - return node.idx[minkowski_distance(d, x, p) <= r].tolist() - else: - less, greater = rect.split(node.split_dim, node.split) - return traverse_checking(node.less, less) + \ - traverse_checking(node.greater, greater) - - def traverse_no_checking(node): - if isinstance(node, KDTree.leafnode): - return node.idx.tolist() - else: - return traverse_no_checking(node.less) + \ - traverse_no_checking(node.greater) - - return traverse_checking(self.tree, R) - - def query_ball_point(self, x, r, p=2., eps=0): - """Find all points within distance r of point(s) x. - - Parameters - ---------- - x : array_like, shape tuple + (self.m,) - The point or points to search for neighbors of. - r : positive float - The radius of points to return. - p : float, optional - Which Minkowski p-norm to use. Should be in the range [1, inf]. - eps : nonnegative float, optional - Approximate search. Branches of the tree are not explored if their - nearest points are further than ``r / (1 + eps)``, and branches are - added in bulk if their furthest points are nearer than - ``r * (1 + eps)``. - - Returns - ------- - results : list or array of lists - If `x` is a single point, returns a list of the indices of the - neighbors of `x`. If `x` is an array of points, returns an object - array of shape tuple containing lists of neighbors. - - Notes - ----- - If you have many points whose neighbors you want to find, you may save - substantial amounts of time by putting them in a KDTree and using - query_ball_tree. - - Examples - -------- - >>> from scipy import spatial - >>> x, y = np.mgrid[0:4, 0:4] - >>> points = zip(x.ravel(), y.ravel()) - >>> tree = spatial.KDTree(points) - >>> tree.query_ball_point([2, 0], 1) - [4, 8, 9, 12] - - """ - x = np.asarray(x) - if x.shape[-1] != self.m: - raise ValueError("Searching for a %d-dimensional point in a " \ - "%d-dimensional KDTree" % (x.shape[-1], self.m)) - if len(x.shape) == 1: - return self.__query_ball_point(x, r, p, eps) - else: - retshape = x.shape[:-1] - result = np.empty(retshape, dtype=np.object) - for c in np.ndindex(retshape): - result[c] = self.__query_ball_point(x[c], r, p=p, eps=eps) - return result - - def query_ball_tree(self, other, r, p=2., eps=0): - """Find all pairs of points whose distance is at most r - - Parameters - ========== - - other : KDTree - The tree containing points to search against - r : positive float - The maximum distance - p : float 1<=p<=infinity - Which Minkowski norm to use - eps : nonnegative float - Approximate search. Branches of the tree are not explored - if their nearest points are further than r/(1+eps), and branches - are added in bulk if their furthest points are nearer than r*(1+eps). - - Returns - ======= - - results : list of lists - For each element self.data[i] of this tree, results[i] is a list of the - indices of its neighbors in other.data. - """ - results = [[] for i in range(self.n)] - def traverse_checking(node1, rect1, node2, rect2): - if rect1.min_distance_rectangle(rect2, p)>r/(1.+eps): - return - elif rect1.max_distance_rectangle(rect2, p)r/(1.+eps): - return - elif rect1.max_distance_rectangle(rect2, p)max_r - result[idx[c_greater]] += node1.children*node2.children - idx = idx[(min_r<=r[idx]) & (r[idx]<=max_r)] - if len(idx)==0: - return - - if isinstance(node1,KDTree.leafnode): - if isinstance(node2,KDTree.leafnode): - ds = minkowski_distance(self.data[node1.idx][:,np.newaxis,:], - other.data[node2.idx][np.newaxis,:,:], - p).ravel() - ds.sort() - result[idx] += np.searchsorted(ds,r[idx],side='right') - else: - less, greater = rect2.split(node2.split_dim, node2.split) - traverse(node1, rect1, node2.less, less, idx) - traverse(node1, rect1, node2.greater, greater, idx) - else: - if isinstance(node2,KDTree.leafnode): - less, greater = rect1.split(node1.split_dim, node1.split) - traverse(node1.less, less, node2, rect2, idx) - traverse(node1.greater, greater, node2, rect2, idx) - else: - less1, greater1 = rect1.split(node1.split_dim, node1.split) - less2, greater2 = rect2.split(node2.split_dim, node2.split) - traverse(node1.less,less1,node2.less,less2,idx) - traverse(node1.less,less1,node2.greater,greater2,idx) - traverse(node1.greater,greater1,node2.less,less2,idx) - traverse(node1.greater,greater1,node2.greater,greater2,idx) - R1 = Rectangle(self.maxes, self.mins) - R2 = Rectangle(other.maxes, other.mins) - if np.shape(r) == (): - r = np.array([r]) - result = np.zeros(1,dtype=int) - traverse(self.tree, R1, other.tree, R2, np.arange(1)) - return result[0] - elif len(np.shape(r))==1: - r = np.asarray(r) - n, = r.shape - result = np.zeros(n,dtype=int) - traverse(self.tree, R1, other.tree, R2, np.arange(n)) - return result - else: - raise ValueError("r must be either a single value or a one-dimensional array of values") - - def sparse_distance_matrix(self, other, max_distance, p=2.): - """Compute a sparse distance matrix - - Computes a distance matrix between two KDTrees, leaving as zero - any distance greater than max_distance. - - Parameters - ========== - - other : KDTree - - max_distance : positive float - - Returns - ======= - - result : dok_matrix - Sparse matrix representing the results in "dictionary of keys" format. - """ - from yt.utilities.on_demand_imports import _scipy as scipy - result = scipy.sparse.dok_matrix((self.n,other.n)) - - def traverse(node1, rect1, node2, rect2): - if rect1.min_distance_rectangle(rect2, p)>max_distance: - return - elif isinstance(node1, KDTree.leafnode): - if isinstance(node2, KDTree.leafnode): - for i in node1.idx: - for j in node2.idx: - d = minkowski_distance(self.data[i],other.data[j],p) - if d<=max_distance: - result[i,j] = d - else: - less, greater = rect2.split(node2.split_dim, node2.split) - traverse(node1,rect1,node2.less,less) - traverse(node1,rect1,node2.greater,greater) - elif isinstance(node2, KDTree.leafnode): - less, greater = rect1.split(node1.split_dim, node1.split) - traverse(node1.less,less,node2,rect2) - traverse(node1.greater,greater,node2,rect2) - else: - less1, greater1 = rect1.split(node1.split_dim, node1.split) - less2, greater2 = rect2.split(node2.split_dim, node2.split) - traverse(node1.less,less1,node2.less,less2) - traverse(node1.less,less1,node2.greater,greater2) - traverse(node1.greater,greater1,node2.less,less2) - traverse(node1.greater,greater1,node2.greater,greater2) - traverse(self.tree, Rectangle(self.maxes, self.mins), - other.tree, Rectangle(other.maxes, other.mins)) - - return result - - -def distance_matrix(x,y,p=2,threshold=1000000): - """ - Compute the distance matrix. - - Returns the matrix of all pair-wise distances. - - Parameters - ---------- - x : array_like, `M` by `K` - TODO: description needed - y : array_like, `N` by `K` - TODO: description needed - p : float, 1 <= p <= infinity - Which Minkowski p-norm to use. - threshold : positive integer - If `M * N * K` > threshold, use a Python loop instead of creating - a very large temporary [what? array?]. - - Returns - ------- - result : array_like, `M` by `N` - - Examples - -------- - >>> distance_matrix([[0,0],[0,1]], [[1,0],[1,1]]) - array([[ 1. , 1.41421356], - [ 1.41421356, 1. ]]) - - """ - - x = np.asarray(x) - m, k = x.shape - y = np.asarray(y) - n, kk = y.shape - - if k != kk: - raise ValueError("x contains %d-dimensional vectors but y contains %d-dimensional vectors" % (k, kk)) - - if m*n*k <= threshold: - return minkowski_distance(x[:,np.newaxis,:],y[np.newaxis,:,:],p) - else: - result = np.empty((m,n),dtype=np.float) #FIXME: figure out the best dtype - if m _y) ? (_x) : (_y)) -#define CPY_MIN(_x, _y) ((_x < _y) ? (_x) : (_y)) - -#define NCHOOSE2(_n) ((_n)*(_n-1)/2) - -#define CPY_BITS_PER_CHAR (sizeof(unsigned char) * 8) -#define CPY_FLAG_ARRAY_SIZE_BYTES(num_bits) (CPY_CEIL_DIV((num_bits), \ - CPY_BITS_PER_CHAR)) -#define CPY_GET_BIT(_xx, i) (((_xx)[(i) / CPY_BITS_PER_CHAR] >> \ - ((CPY_BITS_PER_CHAR-1) - \ - ((i) % CPY_BITS_PER_CHAR))) & 0x1) -#define CPY_SET_BIT(_xx, i) ((_xx)[(i) / CPY_BITS_PER_CHAR] |= \ - ((0x1) << ((CPY_BITS_PER_CHAR-1) \ - -((i) % CPY_BITS_PER_CHAR)))) -#define CPY_CLEAR_BIT(_xx, i) ((_xx)[(i) / CPY_BITS_PER_CHAR] &= \ - ~((0x1) << ((CPY_BITS_PER_CHAR-1) \ - -((i) % CPY_BITS_PER_CHAR)))) - -#ifndef CPY_CEIL_DIV -#define CPY_CEIL_DIV(x, y) ((((double)x)/(double)y) == \ - ((double)((x)/(y))) ? ((x)/(y)) : ((x)/(y) + 1)) -#endif - - -#ifdef CPY_DEBUG -#define CPY_DEBUG_MSG(...) fprintf(stderr, __VA_ARGS__) -#else -#define CPY_DEBUG_MSG(...) -#endif - -#endif diff -Nru yt-3.3.3/yt/utilities/spatial/src/distance.c yt-3.4.0/yt/utilities/spatial/src/distance.c --- yt-3.3.3/yt/utilities/spatial/src/distance.c 2016-09-22 03:28:40.000000000 +0000 +++ yt-3.4.0/yt/utilities/spatial/src/distance.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,958 +0,0 @@ -/** - * distance.c - * - * Author: Damian Eads - * Date: September 22, 2007 (moved to new file on June 8, 2008) - * - * Copyright (c) 2007, 2008, Damian Eads. All rights reserved. - * Adapted for incorporation into Scipy, April 9, 2008. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - Neither the name of the author nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include -#include - -#include -#include -#include "common.h" -#include "distance.h" - -static NPY_INLINE double euclidean_distance(const double *u, const double *v, int n) { - int i = 0; - double s = 0.0, d; - for (i = 0; i < n; i++) { - d = u[i] - v[i]; - s = s + d * d; - } - return sqrt(s); -} - -static NPY_INLINE double ess_distance(const double *u, const double *v, int n) { - int i = 0; - double s = 0.0, d; - for (i = 0; i < n; i++) { - d = fabs(u[i] - v[i]); - s = s + d * d; - } - return s; -} - -static NPY_INLINE double chebyshev_distance(const double *u, const double *v, int n) { - int i = 0; - double d, maxv = 0.0; - for (i = 0; i < n; i++) { - d = fabs(u[i] - v[i]); - if (d > maxv) { - maxv = d; - } - } - return maxv; -} - -static NPY_INLINE double canberra_distance(const double *u, const double *v, int n) { - int i; - double snum = 0.0, sdenom = 0.0, tot = 0.0; - for (i = 0; i < n; i++) { - snum = fabs(u[i] - v[i]); - sdenom = fabs(u[i]) + fabs(v[i]); - if (sdenom > 0.0) { - tot += snum / sdenom; - } - } - return tot; -} - -static NPY_INLINE double bray_curtis_distance(const double *u, const double *v, int n) { - int i; - double s1 = 0.0, s2 = 0.0; - for (i = 0; i < n; i++) { - s1 += fabs(u[i] - v[i]); - s2 += fabs(u[i] + v[i]); - } - return s1 / s2; -} - -static NPY_INLINE double mahalanobis_distance(const double *u, const double *v, - const double *covinv, double *dimbuf1, - double *dimbuf2, int n) { - int i, j; - double s; - const double *covrow = covinv; - for (i = 0; i < n; i++) { - dimbuf1[i] = u[i] - v[i]; - } - for (i = 0; i < n; i++) { - covrow = covinv + (i * n); - s = 0.0; - for (j = 0; j < n; j++) { - s += dimbuf1[j] * covrow[j]; - } - dimbuf2[i] = s; - } - s = 0.0; - for (i = 0; i < n; i++) { - s += dimbuf1[i] * dimbuf2[i]; - } - return sqrt(s); -} - -double hamming_distance(const double *u, const double *v, int n) { - int i = 0; - double s = 0.0; - for (i = 0; i < n; i++) { - s = s + (u[i] != v[i]); - } - return s / (double)n; -} - -static NPY_INLINE double hamming_distance_bool(const char *u, const char *v, int n) { - int i = 0; - double s = 0.0; - for (i = 0; i < n; i++) { - s = s + (u[i] != v[i]); - } - return s / (double)n; -} - -static NPY_INLINE double yule_distance_bool(const char *u, const char *v, int n) { - int i = 0; - int ntt = 0, nff = 0, nft = 0, ntf = 0; - for (i = 0; i < n; i++) { - ntt += (u[i] && v[i]); - ntf += (u[i] && !v[i]); - nft += (!u[i] && v[i]); - nff += (!u[i] && !v[i]); - } - return (2.0 * ntf * nft) / (double)(ntt * nff + ntf * nft); -} - -static NPY_INLINE double matching_distance_bool(const char *u, const char *v, int n) { - int i = 0; - int nft = 0, ntf = 0; - for (i = 0; i < n; i++) { - ntf += (u[i] && !v[i]); - nft += (!u[i] && v[i]); - } - return (double)(ntf + nft) / (double)(n); -} - -static NPY_INLINE double dice_distance_bool(const char *u, const char *v, int n) { - int i = 0; - int ntt = 0, nft = 0, ntf = 0; - for (i = 0; i < n; i++) { - ntt += (u[i] && v[i]); - ntf += (u[i] && !v[i]); - nft += (!u[i] && v[i]); - } - return (double)(nft + ntf) / (double)(2.0 * ntt + ntf + nft); -} - - -static NPY_INLINE double rogerstanimoto_distance_bool(const char *u, const char *v, int n) { - int i = 0; - int ntt = 0, nff = 0, nft = 0, ntf = 0; - for (i = 0; i < n; i++) { - ntt += (u[i] && v[i]); - ntf += (u[i] && !v[i]); - nft += (!u[i] && v[i]); - nff += (!u[i] && !v[i]); - } - return (2.0 * (ntf + nft)) / ((double)ntt + nff + (2.0 * (ntf + nft))); -} - -static NPY_INLINE double russellrao_distance_bool(const char *u, const char *v, int n) { - int i = 0; - /** int nff = 0, nft = 0, ntf = 0;**/ - int ntt = 0; - for (i = 0; i < n; i++) { - /** nff += (!u[i] && !v[i]); - ntf += (u[i] && !v[i]); - nft += (!u[i] && v[i]);**/ - ntt += (u[i] && v[i]); - } - /** return (double)(ntf + nft + nff) / (double)n;**/ - return (double) (n - ntt) / (double) n; -} - -static NPY_INLINE double kulsinski_distance_bool(const char *u, const char *v, int n) { - int _i = 0; - int ntt = 0, nft = 0, ntf = 0, nff = 0; - for (_i = 0; _i < n; _i++) { - ntt += (u[_i] && v[_i]); - ntf += (u[_i] && !v[_i]); - nft += (!u[_i] && v[_i]); - nff += (!u[_i] && !v[_i]); - } - return ((double)(ntf + nft - ntt + n)) / ((double)(ntf + nft + n)); -} - -static NPY_INLINE double sokalsneath_distance_bool(const char *u, const char *v, int n) { - int _i = 0; - int ntt = 0, nft = 0, ntf = 0; - for (_i = 0; _i < n; _i++) { - ntt += (u[_i] && v[_i]); - ntf += (u[_i] && !v[_i]); - nft += (!u[_i] && v[_i]); - } - return (2.0 * (ntf + nft))/(2.0 * (ntf + nft) + ntt); -} - -static NPY_INLINE double sokalmichener_distance_bool(const char *u, const char *v, int n) { - int _i = 0; - int ntt = 0, nft = 0, ntf = 0, nff = 0; - for (_i = 0; _i < n; _i++) { - ntt += (u[_i] && v[_i]); - nff += (!u[_i] && !v[_i]); - ntf += (u[_i] && !v[_i]); - nft += (!u[_i] && v[_i]); - } - return (2.0 * (ntf + nft))/(2.0 * (ntf + nft) + ntt + nff); -} - -static NPY_INLINE double jaccard_distance(const double *u, const double *v, int n) { - int i = 0; - double denom = 0.0, num = 0.0; - for (i = 0; i < n; i++) { - num += (u[i] != v[i]) && ((u[i] != 0.0) || (v[i] != 0.0)); - denom += (u[i] != 0.0) || (v[i] != 0.0); - } - return num / denom; -} - -static NPY_INLINE double jaccard_distance_bool(const char *u, const char *v, int n) { - int i = 0; - double num = 0.0, denom = 0.0; - for (i = 0; i < n; i++) { - num += (u[i] != v[i]) && ((u[i] != 0) || (v[i] != 0)); - denom += (u[i] != 0) || (v[i] != 0); - } - return num / denom; -} - -static NPY_INLINE double dot_product(const double *u, const double *v, int n) { - int i; - double s = 0.0; - for (i = 0; i < n; i++) { - s += u[i] * v[i]; - } - return s; -} - -static NPY_INLINE double cosine_distance(const double *u, const double *v, int n, - const double nu, const double nv) { - return 1.0 - (dot_product(u, v, n) / (nu * nv)); -} - -static NPY_INLINE double seuclidean_distance(const double *var, - const double *u, const double *v, int n) { - int i = 0; - double s = 0.0, d; - for (i = 0; i < n; i++) { - d = u[i] - v[i]; - s = s + (d * d) / var[i]; - } - return sqrt(s); -} - -static NPY_INLINE double city_block_distance(const double *u, const double *v, int n) { - int i = 0; - double s = 0.0, d; - for (i = 0; i < n; i++) { - d = fabs(u[i] - v[i]); - s = s + d; - } - return s; -} - -double minkowski_distance(const double *u, const double *v, int n, double p) { - int i = 0; - double s = 0.0, d; - for (i = 0; i < n; i++) { - d = fabs(u[i] - v[i]); - s = s + pow(d, p); - } - return pow(s, 1.0 / p); -} - -double weighted_minkowski_distance(const double *u, const double *v, int n, double p, const double *w) { - int i = 0; - double s = 0.0, d; - for (i = 0; i < n; i++) { - d = fabs(u[i] - v[i]) * w[i]; - s = s + pow(d, p); - } - return pow(s, 1.0 / p); -} - -void compute_mean_vector(double *res, const double *X, int m, int n) { - int i, j; - const double *v; - for (i = 0; i < n; i++) { - res[i] = 0.0; - } - for (j = 0; j < m; j++) { - - v = X + (j * n); - for (i = 0; i < n; i++) { - res[i] += v[i]; - } - } - for (i = 0; i < n; i++) { - res[i] /= (double)m; - } -} - -void pdist_euclidean(const double *X, double *dm, int m, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = euclidean_distance(u, v, n); - } - } -} - -void pdist_mahalanobis(const double *X, const double *covinv, - double *dm, int m, int n) { - int i, j; - const double *u, *v; - double *it = dm; - double *dimbuf1, *dimbuf2; - dimbuf1 = (double*)malloc(sizeof(double) * 2 * n); - dimbuf2 = dimbuf1 + n; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = mahalanobis_distance(u, v, covinv, dimbuf1, dimbuf2, n); - } - } - dimbuf2 = 0; - free(dimbuf1); -} - -void pdist_bray_curtis(const double *X, double *dm, int m, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = bray_curtis_distance(u, v, n); - } - } -} - -void pdist_canberra(const double *X, double *dm, int m, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = canberra_distance(u, v, n); - } - } -} - -void pdist_hamming(const double *X, double *dm, int m, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = hamming_distance(u, v, n); - } - } -} - -void pdist_hamming_bool(const char *X, double *dm, int m, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = hamming_distance_bool(u, v, n); - } - } -} - -void pdist_jaccard(const double *X, double *dm, int m, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = jaccard_distance(u, v, n); - } - } -} - -void pdist_jaccard_bool(const char *X, double *dm, int m, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = jaccard_distance_bool(u, v, n); - } - } -} - - -void pdist_chebyshev(const double *X, double *dm, int m, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = chebyshev_distance(u, v, n); - } - } -} - -void pdist_cosine(const double *X, double *dm, int m, int n, const double *norms) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = cosine_distance(u, v, n, norms[i], norms[j]); - } - } -} - -void pdist_seuclidean(const double *X, const double *var, - double *dm, int m, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = seuclidean_distance(var, u, v, n); - } - } -} - -void pdist_city_block(const double *X, double *dm, int m, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = city_block_distance(u, v, n); - } - } -} - -void pdist_minkowski(const double *X, double *dm, int m, int n, double p) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = minkowski_distance(u, v, n, p); - } - } -} - -void pdist_weighted_minkowski(const double *X, double *dm, int m, int n, double p, const double *w) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = weighted_minkowski_distance(u, v, n, p, w); - } - } -} - -void pdist_yule_bool(const char *X, double *dm, int m, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = yule_distance_bool(u, v, n); - } - } -} - -void pdist_matching_bool(const char *X, double *dm, int m, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = matching_distance_bool(u, v, n); - } - } -} - -void pdist_dice_bool(const char *X, double *dm, int m, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = dice_distance_bool(u, v, n); - } - } -} - -void pdist_rogerstanimoto_bool(const char *X, double *dm, int m, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = rogerstanimoto_distance_bool(u, v, n); - } - } -} - -void pdist_russellrao_bool(const char *X, double *dm, int m, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = russellrao_distance_bool(u, v, n); - } - } -} - -void pdist_kulsinski_bool(const char *X, double *dm, int m, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = kulsinski_distance_bool(u, v, n); - } - } -} - -void pdist_sokalsneath_bool(const char *X, double *dm, int m, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = sokalsneath_distance_bool(u, v, n); - } - } -} - -void pdist_sokalmichener_bool(const char *X, double *dm, int m, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < m; i++) { - for (j = i + 1; j < m; j++, it++) { - u = X + (n * i); - v = X + (n * j); - *it = sokalmichener_distance_bool(u, v, n); - } - } -} - -void dist_to_squareform_from_vector(double *M, const double *v, int n) { - double *it; - const double *cit; - int i, j; - cit = v; - for (i = 0; i < n - 1; i++) { - it = M + (i * n) + i + 1; - for (j = i + 1; j < n; j++, it++, cit++) { - *it = *cit; - } - } -} - -void dist_to_vector_from_squareform(const double *M, double *v, int n) { - double *it; - const double *cit; - int i, j; - it = v; - for (i = 0; i < n - 1; i++) { - cit = M + (i * n) + i + 1; - for (j = i + 1; j < n; j++, it++, cit++) { - *it = *cit; - } - } -} - - -/** cdist */ - -void cdist_euclidean(const double *XA, - const double *XB, double *dm, int mA, int mB, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = euclidean_distance(u, v, n); - } - } -} - -void cdist_mahalanobis(const double *XA, - const double *XB, - const double *covinv, - double *dm, int mA, int mB, int n) { - int i, j; - const double *u, *v; - double *it = dm; - double *dimbuf1, *dimbuf2; - dimbuf1 = (double*)malloc(sizeof(double) * 2 * n); - dimbuf2 = dimbuf1 + n; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = mahalanobis_distance(u, v, covinv, dimbuf1, dimbuf2, n); - } - } - dimbuf2 = 0; - free(dimbuf1); -} - -void cdist_bray_curtis(const double *XA, const double *XB, - double *dm, int mA, int mB, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = bray_curtis_distance(u, v, n); - } - } -} - -void cdist_canberra(const double *XA, - const double *XB, double *dm, int mA, int mB, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = canberra_distance(u, v, n); - } - } -} - -void cdist_hamming(const double *XA, - const double *XB, double *dm, int mA, int mB, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = hamming_distance(u, v, n); - } - } -} - -void cdist_hamming_bool(const char *XA, - const char *XB, double *dm, int mA, int mB, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = hamming_distance_bool(u, v, n); - } - } -} - -void cdist_jaccard(const double *XA, - const double *XB, double *dm, int mA, int mB, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = jaccard_distance(u, v, n); - } - } -} - -void cdist_jaccard_bool(const char *XA, - const char *XB, double *dm, int mA, int mB, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = jaccard_distance_bool(u, v, n); - } - } -} - - -void cdist_chebyshev(const double *XA, - const double *XB, double *dm, int mA, int mB, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = chebyshev_distance(u, v, n); - } - } -} - -void cdist_cosine(const double *XA, - const double *XB, double *dm, int mA, int mB, int n, - const double *normsA, const double *normsB) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = cosine_distance(u, v, n, normsA[i], normsB[j]); - } - } -} - -void cdist_seuclidean(const double *XA, - const double *XB, - const double *var, - double *dm, int mA, int mB, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = seuclidean_distance(var, u, v, n); - } - } -} - -void cdist_city_block(const double *XA, const double *XB, double *dm, int mA, int mB, int n) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = city_block_distance(u, v, n); - } - } -} - -void cdist_minkowski(const double *XA, const double *XB, double *dm, int mA, int mB, int n, double p) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = minkowski_distance(u, v, n, p); - } - } -} - -void cdist_weighted_minkowski(const double *XA, const double *XB, double *dm, int mA, int mB, int n, double p, const double *w) { - int i, j; - const double *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = weighted_minkowski_distance(u, v, n, p, w); - } - } -} - -void cdist_yule_bool(const char *XA, const char *XB, double *dm, int mA, int mB, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = yule_distance_bool(u, v, n); - } - } -} - -void cdist_matching_bool(const char *XA, const char *XB, double *dm, int mA, int mB, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = matching_distance_bool(u, v, n); - } - } -} - -void cdist_dice_bool(const char *XA, const char *XB, double *dm, int mA, int mB, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = dice_distance_bool(u, v, n); - } - } -} - -void cdist_rogerstanimoto_bool(const char *XA, const char *XB, double *dm, int mA, int mB, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = rogerstanimoto_distance_bool(u, v, n); - } - } -} - -void cdist_russellrao_bool(const char *XA, const char *XB, double *dm, int mA, int mB, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = russellrao_distance_bool(u, v, n); - } - } -} - -void cdist_kulsinski_bool(const char *XA, const char *XB, double *dm, int mA, int mB, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = kulsinski_distance_bool(u, v, n); - } - } -} - -void cdist_sokalsneath_bool(const char *XA, const char *XB, double *dm, int mA, int mB, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = sokalsneath_distance_bool(u, v, n); - } - } -} - -void cdist_sokalmichener_bool(const char *XA, const char *XB, double *dm, int mA, int mB, int n) { - int i, j; - const char *u, *v; - double *it = dm; - for (i = 0; i < mA; i++) { - for (j = 0; j < mB; j++, it++) { - u = XA + (n * i); - v = XB + (n * j); - *it = sokalmichener_distance_bool(u, v, n); - } - } -} diff -Nru yt-3.3.3/yt/utilities/spatial/src/distance.h yt-3.4.0/yt/utilities/spatial/src/distance.h --- yt-3.3.3/yt/utilities/spatial/src/distance.h 2016-09-22 03:28:41.000000000 +0000 +++ yt-3.4.0/yt/utilities/spatial/src/distance.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -/** - * distance.h - * - * Author: Damian Eads - * Date: September 22, 2007 (moved to new file on June 8, 2008) - * Adapted for incorporation into Scipy, April 9, 2008. - * - * Copyright (c) 2007, 2008, Damian Eads. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - Neither the name of the author nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _CPY_DISTANCE_H -#define _CPY_DISTANCE_H - -void dist_to_squareform_from_vector(double *M, const double *v, int n); -void dist_to_vector_from_squareform(const double *M, double *v, int n); -void pdist_euclidean(const double *X, double *dm, int m, int n); -void pdist_seuclidean(const double *X, - const double *var, double *dm, int m, int n); -void pdist_mahalanobis(const double *X, const double *covinv, - double *dm, int m, int n); -void pdist_bray_curtis(const double *X, double *dm, int m, int n); -void pdist_canberra(const double *X, double *dm, int m, int n); -void pdist_hamming(const double *X, double *dm, int m, int n); -void pdist_hamming_bool(const char *X, double *dm, int m, int n); -void pdist_city_block(const double *X, double *dm, int m, int n); -void pdist_cosine(const double *X, double *dm, int m, int n, const double *norms); -void pdist_chebyshev(const double *X, double *dm, int m, int n); -void pdist_jaccard(const double *X, double *dm, int m, int n); -void pdist_jaccard_bool(const char *X, double *dm, int m, int n); -void pdist_kulsinski_bool(const char *X, double *dm, int m, int n); -void pdist_minkowski(const double *X, double *dm, int m, int n, double p); -void pdist_weighted_minkowski(const double *X, double *dm, int m, int n, double p, const double *w); -void pdist_yule_bool(const char *X, double *dm, int m, int n); -void pdist_matching_bool(const char *X, double *dm, int m, int n); -void pdist_dice_bool(const char *X, double *dm, int m, int n); -void pdist_rogerstanimoto_bool(const char *X, double *dm, int m, int n); -void pdist_russellrao_bool(const char *X, double *dm, int m, int n); -void pdist_sokalmichener_bool(const char *X, double *dm, int m, int n); -void pdist_sokalsneath_bool(const char *X, double *dm, int m, int n); - -void cdist_euclidean(const double *XA, const double *XB, double *dm, int mA, int mB, int n); -void cdist_mahalanobis(const double *XA, const double *XB, - const double *covinv, - double *dm, int mA, int mB, int n); -void cdist_bray_curtis(const double *XA, const double *XB, - double *dm, int mA, int mB, int n); -void cdist_canberra(const double *XA, - const double *XB, double *dm, int mA, int mB, int n); -void cdist_hamming(const double *XA, - const double *XB, double *dm, int mA, int mB, int n); -void cdist_hamming_bool(const char *XA, - const char *XB, double *dm, - int mA, int mB, int n); -void cdist_jaccard(const double *XA, - const double *XB, double *dm, int mA, int mB, int n); -void cdist_jaccard_bool(const char *XA, - const char *XB, double *dm, int mA, int mB, int n); -void cdist_chebyshev(const double *XA, - const double *XB, double *dm, int mA, int mB, int n); -void cdist_cosine(const double *XA, - const double *XB, double *dm, int mA, int mB, int n, - const double *normsA, const double *normsB); -void cdist_seuclidean(const double *XA, - const double *XB, - const double *var, - double *dm, int mA, int mB, int n); -void cdist_city_block(const double *XA, const double *XB, double *dm, - int mA, int mB, int n); -void cdist_minkowski(const double *XA, const double *XB, double *dm, - int mA, int mB, int n, double p); -void cdist_weighted_minkowski(const double *XA, const double *XB, double *dm, - int mA, int mB, int n, double p, const double *w); -void cdist_yule_bool(const char *XA, const char *XB, double *dm, - int mA, int mB, int n); -void cdist_matching_bool(const char *XA, const char *XB, double *dm, - int mA, int mB, int n); -void cdist_dice_bool(const char *XA, const char *XB, double *dm, - int mA, int mB, int n); -void cdist_rogerstanimoto_bool(const char *XA, const char *XB, double *dm, - int mA, int mB, int n); -void cdist_russellrao_bool(const char *XA, const char *XB, double *dm, - int mA, int mB, int n); -void cdist_kulsinski_bool(const char *XA, const char *XB, double *dm, - int mA, int mB, int n); -void cdist_sokalsneath_bool(const char *XA, const char *XB, double *dm, - int mA, int mB, int n); -void cdist_sokalmichener_bool(const char *XA, const char *XB, double *dm, - int mA, int mB, int n); - -#endif diff -Nru yt-3.3.3/yt/utilities/spatial/src/distance_wrap.c yt-3.4.0/yt/utilities/spatial/src/distance_wrap.c --- yt-3.3.3/yt/utilities/spatial/src/distance_wrap.c 2016-09-22 03:28:41.000000000 +0000 +++ yt-3.4.0/yt/utilities/spatial/src/distance_wrap.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1163 +0,0 @@ -/** - * distance_wrap.c - * - * Author: Damian Eads - * Date: September 22, 2007 (moved to new file on June 8, 2008) - * Adapted for incorporation into Scipy, April 9, 2008. - * - * Copyright (c) 2007, Damian Eads. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - Neither the name of the author nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "distance.h" -#include "Python.h" -#include -#include - -extern PyObject *cdist_euclidean_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const double *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const double*)XA_->data; - XB = (const double*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_euclidean(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *cdist_canberra_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const double *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const double*)XA_->data; - XB = (const double*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_canberra(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *cdist_bray_curtis_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const double *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const double*)XA_->data; - XB = (const double*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_bray_curtis(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue("d", 0.0); -} - - -extern PyObject *cdist_mahalanobis_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *covinv_, *dm_; - int mA, mB, n; - double *dm; - const double *XA, *XB; - const double *covinv; - if (!PyArg_ParseTuple(args, "O!O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &covinv_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const double*)XA_->data; - XB = (const double*)XB_->data; - covinv = (const double*)covinv_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_mahalanobis(XA, XB, covinv, dm, mA, mB, n); - } - return Py_BuildValue("d", 0.0); -} - - -extern PyObject *cdist_chebyshev_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const double *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const double*)XA_->data; - XB = (const double*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_chebyshev(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue("d", 0.0); -} - - -extern PyObject *cdist_cosine_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_, *normsA_, *normsB_; - int mA, mB, n; - double *dm; - const double *XA, *XB, *normsA, *normsB; - if (!PyArg_ParseTuple(args, "O!O!O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_, - &PyArray_Type, &normsA_, - &PyArray_Type, &normsB_)) { - return 0; - } - else { - XA = (const double*)XA_->data; - XB = (const double*)XB_->data; - dm = (double*)dm_->data; - normsA = (const double*)normsA_->data; - normsB = (const double*)normsB_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_cosine(XA, XB, dm, mA, mB, n, normsA, normsB); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *cdist_seuclidean_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_, *var_; - int mA, mB, n; - double *dm; - const double *XA, *XB, *var; - if (!PyArg_ParseTuple(args, "O!O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &var_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const double*)XA_->data; - XB = (const double*)XB_->data; - dm = (double*)dm_->data; - var = (double*)var_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_seuclidean(XA, XB, var, dm, mA, mB, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *cdist_city_block_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const double *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const double*)XA_->data; - XB = (const double*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_city_block(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *cdist_hamming_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const double *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const double*)XA_->data; - XB = (const double*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_hamming(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *cdist_hamming_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const char *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const char*)XA_->data; - XB = (const char*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_hamming_bool(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *cdist_jaccard_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const double *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const double*)XA_->data; - XB = (const double*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_jaccard(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *cdist_jaccard_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const char *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const char*)XA_->data; - XB = (const char*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_jaccard_bool(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *cdist_minkowski_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const double *XA, *XB; - double p; - if (!PyArg_ParseTuple(args, "O!O!O!d", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_, - &p)) { - return 0; - } - else { - XA = (const double*)XA_->data; - XB = (const double*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - cdist_minkowski(XA, XB, dm, mA, mB, n, p); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *cdist_weighted_minkowski_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_, *w_; - int mA, mB, n; - double *dm; - const double *XA, *XB, *w; - double p; - if (!PyArg_ParseTuple(args, "O!O!O!dO!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_, - &p, - &PyArray_Type, &w_)) { - return 0; - } - else { - XA = (const double*)XA_->data; - XB = (const double*)XB_->data; - w = (const double*)w_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - cdist_weighted_minkowski(XA, XB, dm, mA, mB, n, p, w); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *cdist_yule_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const char *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const char*)XA_->data; - XB = (const char*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_yule_bool(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue(""); -} - -extern PyObject *cdist_matching_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const char *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const char*)XA_->data; - XB = (const char*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_matching_bool(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue(""); -} - -extern PyObject *cdist_dice_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const char *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const char*)XA_->data; - XB = (const char*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_dice_bool(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue(""); -} - -extern PyObject *cdist_rogerstanimoto_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const char *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const char*)XA_->data; - XB = (const char*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_rogerstanimoto_bool(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue(""); -} - -extern PyObject *cdist_russellrao_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const char *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const char*)XA_->data; - XB = (const char*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_russellrao_bool(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue(""); -} - -extern PyObject *cdist_kulsinski_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const char *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const char*)XA_->data; - XB = (const char*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_kulsinski_bool(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue(""); -} - -extern PyObject *cdist_sokalmichener_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const char *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const char*)XA_->data; - XB = (const char*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_sokalmichener_bool(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue(""); -} - -extern PyObject *cdist_sokalsneath_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *XA_, *XB_, *dm_; - int mA, mB, n; - double *dm; - const char *XA, *XB; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &XA_, &PyArray_Type, &XB_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - XA = (const char*)XA_->data; - XB = (const char*)XB_->data; - dm = (double*)dm_->data; - mA = XA_->dimensions[0]; - mB = XB_->dimensions[0]; - n = XA_->dimensions[1]; - - cdist_sokalsneath_bool(XA, XB, dm, mA, mB, n); - } - return Py_BuildValue(""); -} - -/***************************** pdist ***/ - -extern PyObject *pdist_euclidean_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const double *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const double*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_euclidean(X, dm, m, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *pdist_canberra_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const double *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const double*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_canberra(X, dm, m, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *pdist_bray_curtis_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const double *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const double*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_bray_curtis(X, dm, m, n); - } - return Py_BuildValue("d", 0.0); -} - - -extern PyObject *pdist_mahalanobis_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *covinv_, *dm_; - int m, n; - double *dm; - const double *X; - const double *covinv; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &covinv_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const double*)X_->data; - covinv = (const double*)covinv_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_mahalanobis(X, covinv, dm, m, n); - } - return Py_BuildValue("d", 0.0); -} - - -extern PyObject *pdist_chebyshev_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const double *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const double*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_chebyshev(X, dm, m, n); - } - return Py_BuildValue("d", 0.0); -} - - -extern PyObject *pdist_cosine_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_, *norms_; - int m, n; - double *dm; - const double *X, *norms; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_, - &PyArray_Type, &norms_)) { - return 0; - } - else { - X = (const double*)X_->data; - dm = (double*)dm_->data; - norms = (const double*)norms_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_cosine(X, dm, m, n, norms); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *pdist_seuclidean_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_, *var_; - int m, n; - double *dm; - const double *X, *var; - if (!PyArg_ParseTuple(args, "O!O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &var_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (double*)X_->data; - dm = (double*)dm_->data; - var = (double*)var_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_seuclidean(X, var, dm, m, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *pdist_city_block_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const double *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const double*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_city_block(X, dm, m, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *pdist_hamming_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const double *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const double*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_hamming(X, dm, m, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *pdist_hamming_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const char *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const char*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_hamming_bool(X, dm, m, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *pdist_jaccard_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const double *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const double*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_jaccard(X, dm, m, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *pdist_jaccard_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const char *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const char*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_jaccard_bool(X, dm, m, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *pdist_minkowski_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm, *X; - double p; - if (!PyArg_ParseTuple(args, "O!O!d", - &PyArray_Type, &X_, - &PyArray_Type, &dm_, - &p)) { - return 0; - } - else { - X = (double*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_minkowski(X, dm, m, n, p); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *pdist_weighted_minkowski_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_, *w_; - int m, n; - double *dm, *X, *w; - double p; - if (!PyArg_ParseTuple(args, "O!O!dO!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_, - &p, - &PyArray_Type, &w_)) { - return 0; - } - else { - X = (double*)X_->data; - dm = (double*)dm_->data; - w = (const double*)w_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_weighted_minkowski(X, dm, m, n, p, w); - } - return Py_BuildValue("d", 0.0); -} - - -extern PyObject *pdist_yule_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const char *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const char*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_yule_bool(X, dm, m, n); - } - return Py_BuildValue(""); -} - -extern PyObject *pdist_matching_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const char *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const char*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_matching_bool(X, dm, m, n); - } - return Py_BuildValue(""); -} - -extern PyObject *pdist_dice_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const char *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const char*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_dice_bool(X, dm, m, n); - } - return Py_BuildValue(""); -} - -extern PyObject *pdist_rogerstanimoto_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const char *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const char*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_rogerstanimoto_bool(X, dm, m, n); - } - return Py_BuildValue(""); -} - -extern PyObject *pdist_russellrao_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const char *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const char*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_russellrao_bool(X, dm, m, n); - } - return Py_BuildValue(""); -} - -extern PyObject *pdist_kulsinski_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const char *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const char*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_kulsinski_bool(X, dm, m, n); - } - return Py_BuildValue(""); -} - -extern PyObject *pdist_sokalmichener_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const char *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const char*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_sokalmichener_bool(X, dm, m, n); - } - return Py_BuildValue(""); -} - -extern PyObject *pdist_sokalsneath_bool_wrap(PyObject *self, PyObject *args) { - PyArrayObject *X_, *dm_; - int m, n; - double *dm; - const char *X; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &X_, - &PyArray_Type, &dm_)) { - return 0; - } - else { - X = (const char*)X_->data; - dm = (double*)dm_->data; - m = X_->dimensions[0]; - n = X_->dimensions[1]; - - pdist_sokalsneath_bool(X, dm, m, n); - } - return Py_BuildValue(""); -} - -extern PyObject *to_squareform_from_vector_wrap(PyObject *self, PyObject *args) { - PyArrayObject *M_, *v_; - int n; - const double *v; - double *M; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &M_, - &PyArray_Type, &v_)) { - return 0; - } - else { - M = (double*)M_->data; - v = (const double*)v_->data; - n = M_->dimensions[0]; - dist_to_squareform_from_vector(M, v, n); - } - return Py_BuildValue("d", 0.0); -} - -extern PyObject *to_vector_from_squareform_wrap(PyObject *self, PyObject *args) { - PyArrayObject *M_, *v_; - int n; - double *v; - const double *M; - if (!PyArg_ParseTuple(args, "O!O!", - &PyArray_Type, &M_, - &PyArray_Type, &v_)) { - return 0; - } - else { - M = (const double*)M_->data; - v = (double*)v_->data; - n = M_->dimensions[0]; - dist_to_vector_from_squareform(M, v, n); - } - return Py_BuildValue("d", 0.0); -} - - -static PyMethodDef _distanceWrapMethods[] = { - {"cdist_bray_curtis_wrap", cdist_bray_curtis_wrap, METH_VARARGS}, - {"cdist_canberra_wrap", cdist_canberra_wrap, METH_VARARGS}, - {"cdist_chebyshev_wrap", cdist_chebyshev_wrap, METH_VARARGS}, - {"cdist_city_block_wrap", cdist_city_block_wrap, METH_VARARGS}, - {"cdist_cosine_wrap", cdist_cosine_wrap, METH_VARARGS}, - {"cdist_dice_bool_wrap", cdist_dice_bool_wrap, METH_VARARGS}, - {"cdist_euclidean_wrap", cdist_euclidean_wrap, METH_VARARGS}, - {"cdist_hamming_wrap", cdist_hamming_wrap, METH_VARARGS}, - {"cdist_hamming_bool_wrap", cdist_hamming_bool_wrap, METH_VARARGS}, - {"cdist_jaccard_wrap", cdist_jaccard_wrap, METH_VARARGS}, - {"cdist_jaccard_bool_wrap", cdist_jaccard_bool_wrap, METH_VARARGS}, - {"cdist_kulsinski_bool_wrap", cdist_kulsinski_bool_wrap, METH_VARARGS}, - {"cdist_mahalanobis_wrap", cdist_mahalanobis_wrap, METH_VARARGS}, - {"cdist_matching_bool_wrap", cdist_matching_bool_wrap, METH_VARARGS}, - {"cdist_minkowski_wrap", cdist_minkowski_wrap, METH_VARARGS}, - {"cdist_weighted_minkowski_wrap", cdist_weighted_minkowski_wrap, METH_VARARGS}, - {"cdist_rogerstanimoto_bool_wrap", cdist_rogerstanimoto_bool_wrap, METH_VARARGS}, - {"cdist_russellrao_bool_wrap", cdist_russellrao_bool_wrap, METH_VARARGS}, - {"cdist_seuclidean_wrap", cdist_seuclidean_wrap, METH_VARARGS}, - {"cdist_sokalmichener_bool_wrap", cdist_sokalmichener_bool_wrap, METH_VARARGS}, - {"cdist_sokalsneath_bool_wrap", cdist_sokalsneath_bool_wrap, METH_VARARGS}, - {"cdist_yule_bool_wrap", cdist_yule_bool_wrap, METH_VARARGS}, - {"pdist_bray_curtis_wrap", pdist_bray_curtis_wrap, METH_VARARGS}, - {"pdist_canberra_wrap", pdist_canberra_wrap, METH_VARARGS}, - {"pdist_chebyshev_wrap", pdist_chebyshev_wrap, METH_VARARGS}, - {"pdist_city_block_wrap", pdist_city_block_wrap, METH_VARARGS}, - {"pdist_cosine_wrap", pdist_cosine_wrap, METH_VARARGS}, - {"pdist_dice_bool_wrap", pdist_dice_bool_wrap, METH_VARARGS}, - {"pdist_euclidean_wrap", pdist_euclidean_wrap, METH_VARARGS}, - {"pdist_hamming_wrap", pdist_hamming_wrap, METH_VARARGS}, - {"pdist_hamming_bool_wrap", pdist_hamming_bool_wrap, METH_VARARGS}, - {"pdist_jaccard_wrap", pdist_jaccard_wrap, METH_VARARGS}, - {"pdist_jaccard_bool_wrap", pdist_jaccard_bool_wrap, METH_VARARGS}, - {"pdist_kulsinski_bool_wrap", pdist_kulsinski_bool_wrap, METH_VARARGS}, - {"pdist_mahalanobis_wrap", pdist_mahalanobis_wrap, METH_VARARGS}, - {"pdist_matching_bool_wrap", pdist_matching_bool_wrap, METH_VARARGS}, - {"pdist_minkowski_wrap", pdist_minkowski_wrap, METH_VARARGS}, - {"pdist_weighted_minkowski_wrap", pdist_weighted_minkowski_wrap, METH_VARARGS}, - {"pdist_rogerstanimoto_bool_wrap", pdist_rogerstanimoto_bool_wrap, METH_VARARGS}, - {"pdist_russellrao_bool_wrap", pdist_russellrao_bool_wrap, METH_VARARGS}, - {"pdist_seuclidean_wrap", pdist_seuclidean_wrap, METH_VARARGS}, - {"pdist_sokalmichener_bool_wrap", pdist_sokalmichener_bool_wrap, METH_VARARGS}, - {"pdist_sokalsneath_bool_wrap", pdist_sokalsneath_bool_wrap, METH_VARARGS}, - {"pdist_yule_bool_wrap", pdist_yule_bool_wrap, METH_VARARGS}, - {"to_squareform_from_vector_wrap", - to_squareform_from_vector_wrap, METH_VARARGS}, - {"to_vector_from_squareform_wrap", - to_vector_from_squareform_wrap, METH_VARARGS}, - {NULL, NULL} /* Sentinel - marks the end of this structure */ -}; - -#if PY_VERSION_HEX >= 0x03000000 -static struct PyModuleDef moduledef = { - PyModuleDef_HEAD_INIT, - "_distance_wrap", - NULL, - -1, - _distanceWrapMethods, - NULL, - NULL, - NULL, - NULL -}; - -PyObject *PyInit__distance_wrap(void) -{ - PyObject *m; - - m = PyModule_Create(&moduledef); - import_array(); - - return m; -} -#else -PyMODINIT_FUNC init_distance_wrap(void) -{ - (void) Py_InitModule("_distance_wrap", _distanceWrapMethods); - import_array(); // Must be present for NumPy. Called first after above line. -} -#endif diff -Nru yt-3.3.3/yt/utilities/tests/test_amr_kdtree.py yt-3.4.0/yt/utilities/tests/test_amr_kdtree.py --- yt-3.3.3/yt/utilities/tests/test_amr_kdtree.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/tests/test_amr_kdtree.py 2017-08-10 18:02:57.000000000 +0000 @@ -35,12 +35,11 @@ kd = AMRKDTree(ds) volume = kd.count_volume() - yield assert_equal, volume, \ - np.prod(ds.domain_right_edge - ds.domain_left_edge) + assert_equal(volume, np.prod(ds.domain_right_edge - ds.domain_left_edge)) cells = kd.count_cells() true_cells = ds.all_data().quantities['TotalQuantity']('Ones')[0] - yield assert_equal, cells, true_cells + assert_equal(cells, true_cells) # This largely reproduces the AMRKDTree.tree.check_tree() functionality tree_ok = True @@ -59,7 +58,7 @@ tree_ok *= np.all(grid.RightEdge >= nre) tree_ok *= np.all(dims > 0) - yield assert_equal, True, tree_ok + assert_equal(True, tree_ok) def test_amr_kdtree_set_fields(): ds = fake_amr_ds(fields=["density", "pressure"]) diff -Nru yt-3.3.3/yt/utilities/tests/test_chemical_formulas.py yt-3.4.0/yt/utilities/tests/test_chemical_formulas.py --- yt-3.3.3/yt/utilities/tests/test_chemical_formulas.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/tests/test_chemical_formulas.py 2017-08-10 18:02:57.000000000 +0000 @@ -16,8 +16,8 @@ for formula, components, charge in _molecules: f = ChemicalFormula(formula) w = sum( n * periodic_table[e].weight for e, n in components) - yield assert_equal, f.charge, charge - yield assert_equal, f.weight, w + assert_equal(f.charge, charge) + assert_equal(f.weight, w) for (n, c1), (e, c2) in zip(components, f.elements): - yield assert_equal, n, e.symbol - yield assert_equal, c1, c2 + assert_equal(n, e.symbol) + assert_equal(c1, c2) diff -Nru yt-3.3.3/yt/utilities/tests/test_config.py yt-3.4.0/yt/utilities/tests/test_config.py --- yt-3.3.3/yt/utilities/tests/test_config.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/tests/test_config.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,194 @@ +# -*- coding: UTF-8 -*- +#----------------------------------------------------------------------------- +# Copyright (c) 2016, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import contextlib +import os +import sys +if sys.version_info.major < 3: + try: + import mock + except ImportError: + mock = None +else: + import unittest.mock as mock +import unittest +import yt.utilities.command_line +import yt.config +from yt.config import \ + CURRENT_CONFIG_FILE, _OLD_CONFIG_FILE, CONFIG_DIR, YTConfigParser +from yt.extern.six import StringIO +from yt.extern.six.moves.configparser import NoOptionError +from yt.fields.tests.test_fields_plugins import TEST_PLUGIN_FILE + +_TEST_PLUGIN = '_test_plugin.py' +_DUMMY_CFG = ['[yt]', 'loglevel = 49', 'pluginfilename = ' + _TEST_PLUGIN] + + +@contextlib.contextmanager +def captureOutput(): + oldout, olderr = sys.stdout, sys.stderr + try: + out = [StringIO(), StringIO()] + sys.stdout, sys.stderr = out + yield out + finally: + sys.stdout, sys.stderr = oldout, olderr + out[0] = out[0].getvalue() + out[1] = out[1].getvalue() + + +class SysExitException(Exception): + pass + + +def setUpModule(): + for cfgfile in (CURRENT_CONFIG_FILE, _OLD_CONFIG_FILE): + if os.path.exists(cfgfile): + os.rename(cfgfile, cfgfile + '.bak_test') + + if cfgfile == CURRENT_CONFIG_FILE: + yt.utilities.configure.CONFIG = YTConfigParser() + if not yt.utilities.configure.CONFIG.has_section('yt'): + yt.utilities.configure.CONFIG.add_section('yt') + + +def tearDownModule(): + for cfgfile in (CURRENT_CONFIG_FILE, _OLD_CONFIG_FILE): + if os.path.exists(cfgfile + '.bak_test'): + os.rename(cfgfile + '.bak_test', cfgfile) + + +class TestYTConfig(unittest.TestCase): + def _runYTConfig(self, args): + args = ['yt', 'config'] + args + retcode = 0 + + with mock.patch.object(sys, 'argv', args),\ + mock.patch('sys.exit', side_effect=SysExitException) as exit,\ + captureOutput() as output: + try: + yt.utilities.command_line.run_main() + except SysExitException: + args = exit.mock_calls[0][1] + retcode = args[0] if len(args) else 0 + return { + 'rc': retcode, + 'stdout': output[0], + 'stderr': output[1] + } + + def _testKeyValue(self, key, val_set, val_get): + info = self._runYTConfig(['set', 'yt', key, val_set]) + self.assertEqual(info['rc'], 0) + + info = self._runYTConfig(['get', 'yt', key]) + self.assertEqual(info['rc'], 0) + self.assertEqual(info['stdout'].strip(), val_get) + + info = self._runYTConfig(['rm', 'yt', key]) + self.assertEqual(info['rc'], 0) + +class TestYTConfigCommands(TestYTConfig): + def testConfigCommands(self): + # stub out test if mock isn't installed in Python2 + if mock is None: + return + + self.assertFalse(os.path.exists(CURRENT_CONFIG_FILE)) + + info = self._runYTConfig(['--help']) + self.assertEqual(info['rc'], 0) + self.assertEqual(info['stderr'], '') + self.assertIn('Get and set configuration values for yt', + info['stdout']) + + info = self._runYTConfig(['list']) + self.assertEqual(info['rc'], 0) + self.assertIn('[yt]', info['stdout']) + + self._testKeyValue('__parallel', 'True', 'True') + self._testKeyValue('test_data_dir', '~/yt-data', + os.path.expanduser('~/yt-data')) + self._testKeyValue('test_data_dir', '$HOME/yt-data', + os.path.expandvars('$HOME/yt-data')) + + with self.assertRaises(NoOptionError): + self._runYTConfig(['get', 'yt', 'foo']) + + def tearDown(self): + if os.path.exists(CURRENT_CONFIG_FILE): + os.remove(CURRENT_CONFIG_FILE) + +class TestYTConfigMigration(TestYTConfig): + + def setUp(self): + if not os.path.exists(os.path.dirname(_OLD_CONFIG_FILE)): + os.makedirs(os.path.dirname(_OLD_CONFIG_FILE)) + + with open(_OLD_CONFIG_FILE, 'w') as fh: + for line in _DUMMY_CFG: + fh.write('{}\n'.format(line)) + + if os.path.exists(CURRENT_CONFIG_FILE): + os.remove(CURRENT_CONFIG_FILE) + + my_plugin_name = _TEST_PLUGIN + old_config_dir = os.path.join(os.path.expanduser('~'), '.yt') + for base_prefix in ('', CONFIG_DIR, old_config_dir): + potential_plugin_file = os.path.join(base_prefix, my_plugin_name) + if os.path.isfile(potential_plugin_file): + os.rename(potential_plugin_file, + potential_plugin_file + '.bak_test') + + plugin_file = os.path.join(old_config_dir, my_plugin_name) + with open(plugin_file, 'w') as fh: + fh.write(TEST_PLUGIN_FILE) + + def tearDown(self): + if os.path.exists(CURRENT_CONFIG_FILE): + os.remove(CURRENT_CONFIG_FILE) + if os.path.exists(_OLD_CONFIG_FILE + '.bak'): + os.remove(_OLD_CONFIG_FILE + '.bak') + + my_plugin_name = _TEST_PLUGIN + plugin_file = os.path.join(CONFIG_DIR, my_plugin_name) + if os.path.exists(plugin_file): + os.remove(plugin_file) + + old_config_dir = os.path.join(os.path.expanduser('~'), '.yt') + for base_prefix in ('', CONFIG_DIR, old_config_dir): + potential_plugin_file = os.path.join(base_prefix, my_plugin_name) + if os.path.isfile(potential_plugin_file + '.bak_test'): + os.rename(potential_plugin_file + '.bak_test', + potential_plugin_file) + + def testConfigMigration(self): + old_config_dir = os.path.dirname(_OLD_CONFIG_FILE) + new_config_dir = os.path.dirname(CURRENT_CONFIG_FILE) + + self.assertFalse(os.path.exists(CURRENT_CONFIG_FILE)) + self.assertTrue(os.path.exists(_OLD_CONFIG_FILE)) + self.assertTrue( + os.path.exists(os.path.join(old_config_dir, _TEST_PLUGIN))) + + info = self._runYTConfig(['migrate']) + self.assertEqual(info['rc'], 0) + + self.assertTrue(os.path.exists(CURRENT_CONFIG_FILE)) + self.assertFalse(os.path.exists(_OLD_CONFIG_FILE)) + self.assertTrue(os.path.exists(_OLD_CONFIG_FILE + '.bak')) + self.assertTrue( + os.path.exists(os.path.join(new_config_dir, _TEST_PLUGIN))) + self.assertTrue( + os.path.exists(os.path.join(old_config_dir, _TEST_PLUGIN + '.bak')) + ) + + with open(CURRENT_CONFIG_FILE, 'r') as fh: + new_cfg = ''.join(fh.readlines()) + self.assertEqual(new_cfg.strip().split('\n'), _DUMMY_CFG) diff -Nru yt-3.3.3/yt/utilities/tests/test_cosmology.py yt-3.4.0/yt/utilities/tests/test_cosmology.py --- yt-3.3.3/yt/utilities/tests/test_cosmology.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/tests/test_cosmology.py 2017-08-10 18:02:57.000000000 +0000 @@ -30,7 +30,7 @@ co = Cosmology() # random sample over interval (-1,100] z = -101 * np.random.random() + 100 - yield assert_rel_equal, co.hubble_time(z), co.t_from_z(z), 5 + assert_rel_equal(co.hubble_time(z), co.t_from_z(z), 5) def test_z_t_conversion(): """ @@ -44,4 +44,4 @@ z1 = -101 * np.random.random() + 100 t = co.t_from_z(z1) z2 = co.z_from_t(t) - yield assert_rel_equal, z1, z2, 10 + assert_rel_equal(z1, z2, 10) diff -Nru yt-3.3.3/yt/utilities/tests/test_fits_image.py yt-3.4.0/yt/utilities/tests/test_fits_image.py --- yt-3.3.3/yt/utilities/tests/test_fits_image.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/tests/test_fits_image.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -""" -Unit test FITS image creation in yt. - - - -""" - -#----------------------------------------------------------------------------- -# Copyright (c) 2013, yt Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- - -import tempfile -import os -import shutil -from yt.testing import fake_random_ds, requires_module -from yt.convenience import load -from numpy.testing import \ - assert_equal -from yt.utilities.fits_image import \ - FITSImageData, FITSProjection, \ - FITSSlice, FITSOffAxisSlice, \ - FITSOffAxisProjection, \ - assert_same_wcs -from yt.visualization.volume_rendering.off_axis_projection import \ - off_axis_projection - - -@requires_module("astropy") -def test_fits_image(): - tmpdir = tempfile.mkdtemp() - curdir = os.getcwd() - os.chdir(tmpdir) - - fields = ("density", "temperature") - units = ('g/cm**3', 'K',) - ds = fake_random_ds(64, fields=fields, units=units, nprocs=16, - length_unit=100.0) - - prj = ds.proj("density", 2) - prj_frb = prj.to_frb((0.5, "unitary"), 128) - - fid1 = FITSImageData(prj_frb, fields=["density","temperature"], units="cm") - fits_prj = FITSProjection(ds, "z", ["density","temperature"], image_res=128, - width=(0.5,"unitary")) - - yield assert_equal, fid1.get_data("density"), fits_prj.get_data("density") - yield assert_equal, fid1.get_data("temperature"), fits_prj.get_data("temperature") - - fid1.writeto("fid1.fits", clobber=True) - new_fid1 = FITSImageData.from_file("fid1.fits") - - yield assert_equal, fid1.get_data("density"), new_fid1.get_data("density") - yield assert_equal, fid1.get_data("temperature"), new_fid1.get_data("temperature") - - ds2 = load("fid1.fits") - ds2.index - - assert ("fits","density") in ds2.field_list - assert ("fits","temperature") in ds2.field_list - - dw_cm = ds2.domain_width.in_units("cm") - - assert dw_cm[0].v == 50. - assert dw_cm[1].v == 50. - - slc = ds.slice(2, 0.5) - slc_frb = slc.to_frb((0.5, "unitary"), 128) - - fid2 = FITSImageData(slc_frb, fields=["density","temperature"], units="cm") - fits_slc = FITSSlice(ds, "z", ["density","temperature"], image_res=128, - width=(0.5,"unitary")) - - yield assert_equal, fid2.get_data("density"), fits_slc.get_data("density") - yield assert_equal, fid2.get_data("temperature"), fits_slc.get_data("temperature") - - dens_img = fid2.pop("density") - temp_img = fid2.pop("temperature") - - # This already has some assertions in it, so we don't need to do anything - # with it other than just make one - FITSImageData.from_images([dens_img, temp_img]) - - cut = ds.cutting([0.1, 0.2, -0.9], [0.5, 0.42, 0.6]) - cut_frb = cut.to_frb((0.5, "unitary"), 128) - - fid3 = FITSImageData(cut_frb, fields=["density","temperature"], units="cm") - fits_cut = FITSOffAxisSlice(ds, [0.1, 0.2, -0.9], ["density","temperature"], - image_res=128, center=[0.5, 0.42, 0.6], - width=(0.5,"unitary")) - - yield assert_equal, fid3.get_data("density"), fits_cut.get_data("density") - yield assert_equal, fid3.get_data("temperature"), fits_cut.get_data("temperature") - - fid3.create_sky_wcs([30.,45.], (1.0,"arcsec/kpc")) - fid3.writeto("fid3.fits", clobber=True) - new_fid3 = FITSImageData.from_file("fid3.fits") - assert_same_wcs(fid3.wcs, new_fid3.wcs) - assert new_fid3.wcs.wcs.cunit[0] == "deg" - assert new_fid3.wcs.wcs.cunit[1] == "deg" - assert new_fid3.wcs.wcs.ctype[0] == "RA---TAN" - assert new_fid3.wcs.wcs.ctype[1] == "DEC--TAN" - - buf = off_axis_projection(ds, ds.domain_center, [0.1, 0.2, -0.9], - 0.5, 128, "density").swapaxes(0, 1) - fid4 = FITSImageData(buf, fields="density", width=100.0) - fits_oap = FITSOffAxisProjection(ds, [0.1, 0.2, -0.9], "density", - width=(0.5,"unitary"), image_res=128, - depth_res=128, depth=(0.5,"unitary")) - - yield assert_equal, fid4.get_data("density"), fits_oap.get_data("density") - - cvg = ds.covering_grid(ds.index.max_level, [0.25,0.25,0.25], - [32, 32, 32], fields=["density","temperature"]) - fid5 = FITSImageData(cvg, fields=["density","temperature"]) - assert fid5.dimensionality == 3 - - fid5.update_header("density", "time", 0.1) - fid5.update_header("all", "units", "cgs") - - assert fid5["density"].header["time"] == 0.1 - assert fid5["temperature"].header["units"] == "cgs" - assert fid5["density"].header["units"] == "cgs" - - os.chdir(curdir) - shutil.rmtree(tmpdir) diff -Nru yt-3.3.3/yt/utilities/tests/test_interpolators.py yt-3.4.0/yt/utilities/tests/test_interpolators.py --- yt-3.3.3/yt/utilities/tests/test_interpolators.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/utilities/tests/test_interpolators.py 2017-08-10 18:02:57.000000000 +0000 @@ -17,7 +17,7 @@ fv = {'x': np.mgrid[0.0:1.0:64j]} # evenly spaced bins ufi = lin.UnilinearFieldInterpolator(random_data, (0.0, 1.0), "x", True) - yield assert_array_equal, ufi(fv), random_data + assert_array_equal(ufi(fv), random_data) # randomly spaced bins size = 64 @@ -26,7 +26,7 @@ ufi = lin.UnilinearFieldInterpolator(random_data, np.linspace(0.0, 1.0, size) + shift, "x", True) - yield assert_array_almost_equal, ufi(fv), random_data, 15 + assert_array_almost_equal(ufi(fv), random_data, 15) def test_linear_interpolator_2d(): random_data = np.random.random((64, 64)) @@ -35,7 +35,7 @@ np.mgrid[0.0:1.0:64j, 0.0:1.0:64j])) bfi = lin.BilinearFieldInterpolator(random_data, (0.0, 1.0, 0.0, 1.0), "xy", True) - yield assert_array_equal, bfi(fv), random_data + assert_array_equal(bfi(fv), random_data) # randomly spaced bins size = 64 @@ -46,7 +46,7 @@ fv["y"] += shifts["y"] bfi = lin.BilinearFieldInterpolator(random_data, (bins + shifts["x"], bins + shifts["y"]), "xy", True) - yield assert_array_almost_equal, bfi(fv), random_data, 15 + assert_array_almost_equal(bfi(fv), random_data, 15) def test_linear_interpolator_3d(): random_data = np.random.random((64, 64, 64)) @@ -55,7 +55,7 @@ np.mgrid[0.0:1.0:64j, 0.0:1.0:64j, 0.0:1.0:64j])) tfi = lin.TrilinearFieldInterpolator(random_data, (0.0, 1.0, 0.0, 1.0, 0.0, 1.0), "xyz", True) - yield assert_array_almost_equal, tfi(fv), random_data + assert_array_almost_equal(tfi(fv), random_data) # randomly spaced bins size = 64 @@ -68,7 +68,7 @@ tfi = lin.TrilinearFieldInterpolator(random_data, (bins + shifts["x"], bins + shifts["y"], bins + shifts["z"]), "xyz", True) - yield assert_array_almost_equal, tfi(fv), random_data, 15 + assert_array_almost_equal(tfi(fv), random_data, 15) def test_ghost_zone_extrapolation(): @@ -98,9 +98,9 @@ xz, np.array([0.0, 0.0, 0.0], dtype="f8")) ii = (lx, ly, lz)[i] - yield assert_array_equal, ii, vec[ax] - yield assert_array_equal, ii, xi - yield assert_array_equal, ii, xz + assert_array_equal(ii, vec[ax]) + assert_array_equal(ii, xi) + assert_array_equal(ii, xz) def test_get_vertex_centered_data(): diff -Nru yt-3.3.3/yt/utilities/tests/test_kdtrees.py yt-3.4.0/yt/utilities/tests/test_kdtrees.py --- yt-3.3.3/yt/utilities/tests/test_kdtrees.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/tests/test_kdtrees.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -""" -Unit test the kD trees in yt. - - - -""" - -#----------------------------------------------------------------------------- -# Copyright (c) 2013, yt Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- - -import numpy as np - -from yt.testing import \ - assert_array_almost_equal, \ - assert_array_equal -from yt.utilities.spatial import cKDTree - - -def test_cython_tree(): - r"""This test makes sure that the cython kdtree is finding the correct - nearest neighbors. - """ - # Four points. - pos = np.empty((4, 3), dtype='float64') - # Make four points by hand that, in particular, will allow us to test - # the periodicity of the kdtree. - points = np.array([0.01, 0.5, 0.98, 0.99]) - pos[:, 0] = points - pos[:, 1] = points - pos[:, 2] = points - kdtree = cKDTree(pos, leafsize = 2) - qv = np.array([0.999]*3) - res = kdtree.query(qv, 4, period=[1.,1.,1]) - # What the answers should be. - dist = np.array([2.43e-04, 3.63e-04, 1.083e-03, 7.47003e-01]) - tags = np.array([3, 0, 2, 1], dtype='int64') - assert_array_almost_equal(res[0], dist) - assert_array_equal(res[1], tags) - diff -Nru yt-3.3.3/yt/utilities/tests/test_minimal_representation.py yt-3.4.0/yt/utilities/tests/test_minimal_representation.py --- yt-3.3.3/yt/utilities/tests/test_minimal_representation.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/tests/test_minimal_representation.py 2017-08-10 18:02:57.000000000 +0000 @@ -1,3 +1,4 @@ +import numpy as np import os.path import yt from yt.config import ytcfg @@ -29,18 +30,18 @@ proj2 = ds.proj(field, "z", data_source=sp) proj1_c = ds.proj(field, "z") - yield assert_equal, proj1[field], proj1_c[field] + assert_equal(proj1[field], proj1_c[field]) proj2_c = ds.proj(field, "z", data_source=sp) - yield assert_equal, proj2[field], proj2_c[field] + assert_equal(proj2[field], proj2_c[field]) def fail_for_different_method(): proj2_c = ds.proj(field, "z", data_source=sp, method="mip") - return (proj2[field] == proj2_c[field]).all() - yield assert_raises, YTUnitOperationError, fail_for_different_method + return np.equal(proj2[field], proj2_c[field]).all() + assert_raises(YTUnitOperationError, fail_for_different_method) def fail_for_different_source(): sp = ds.sphere(ds.domain_center, (2, 'kpc')) proj2_c = ds.proj(field, "z", data_source=sp, method="integrate") return assert_equal(proj2_c[field], proj2[field]) - yield assert_raises, AssertionError, fail_for_different_source + assert_raises(AssertionError, fail_for_different_source) diff -Nru yt-3.3.3/yt/utilities/tests/test_particle_generator.py yt-3.4.0/yt/utilities/tests/test_particle_generator.py --- yt-3.3.3/yt/utilities/tests/test_particle_generator.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/tests/test_particle_generator.py 2017-08-10 18:02:57.000000000 +0000 @@ -11,12 +11,9 @@ import yt.utilities.flagging_methods as fm from yt.units.yt_array import uconcatenate -def setup() : - pass - def test_particle_generator(): # First generate our dataset - domain_dims = (128, 128, 128) + domain_dims = (32, 32, 32) dens = np.zeros(domain_dims) + 0.1 temp = 4.*np.ones(domain_dims) fields = {"density": (dens, 'code_mass/code_length**3'), @@ -33,39 +30,39 @@ ("io", "particle_position_z"), ("io", "particle_index"), ("io", "particle_gas_density")] - num_particles = 1000000 + num_particles = 10000 field_dict = {("gas", "density"): ("io", "particle_gas_density")} sphere = ds.sphere(ds.domain_center, 0.45) particles1 = WithDensityParticleGenerator(ds, sphere, num_particles, field_list) particles1.assign_indices() particles1.map_grid_fields_to_particles(field_dict) - + # Test to make sure we ended up with the right number of particles per grid particles1.apply_to_stream() particles_per_grid1 = [grid.NumberOfParticles for grid in ds.index.grids] - yield assert_equal, particles_per_grid1, particles1.NumberOfParticles + assert_equal(particles_per_grid1, particles1.NumberOfParticles) particles_per_grid1 = [len(grid["particle_position_x"]) for grid in ds.index.grids] - yield assert_equal, particles_per_grid1, particles1.NumberOfParticles + assert_equal(particles_per_grid1, particles1.NumberOfParticles) tags = uconcatenate([grid["particle_index"] for grid in ds.index.grids]) assert(np.unique(tags).size == num_particles) + + del tags + # Set up a lattice of particles - pdims = np.array([64,64,64]) - def new_indices() : + pdims = np.array([32,32,32]) + def new_indices(): # We just add new indices onto the existing ones return np.arange((np.product(pdims)))+num_particles le = np.array([0.25,0.25,0.25]) re = np.array([0.75,0.75,0.75]) - new_field_list = field_list + [("io", "particle_gas_temperature")] - new_field_dict = {("gas", "density"): ("io", "particle_gas_density"), - ("gas", "temperature"): ("io", "particle_gas_temperature")} - particles2 = LatticeParticleGenerator(ds, pdims, le, re, new_field_list) + particles2 = LatticeParticleGenerator(ds, pdims, le, re, field_list) particles2.assign_indices(function=new_indices) - particles2.map_grid_fields_to_particles(new_field_dict) + particles2.map_grid_fields_to_particles(field_dict) - #Test lattice positions + # Test lattice positions xpos = np.unique(particles2["io", "particle_position_x"]) ypos = np.unique(particles2["io", "particle_position_y"]) zpos = np.unique(particles2["io", "particle_position_z"]) @@ -74,47 +71,70 @@ ypred = np.linspace(le[1],re[1],num=pdims[1],endpoint=True) zpred = np.linspace(le[2],re[2],num=pdims[2],endpoint=True) - assert_almost_equal( xpos, xpred) - assert_almost_equal( ypos, ypred) - assert_almost_equal( zpos, zpred) + assert_almost_equal(xpos, xpred) + assert_almost_equal(ypos, ypred) + assert_almost_equal(zpos, zpred) - #Test the number of particles again + del xpos, ypos, zpos + del xpred, ypred, zpred + + # Test the number of particles again particles2.apply_to_stream() particles_per_grid2 = [grid.NumberOfParticles for grid in ds.index.grids] - yield assert_equal, particles_per_grid2, particles1.NumberOfParticles+particles2.NumberOfParticles + assert_equal(particles_per_grid2, particles1.NumberOfParticles+particles2.NumberOfParticles) [grid.field_data.clear() for grid in ds.index.grids] particles_per_grid2 = [len(grid["particle_position_x"]) for grid in ds.index.grids] - yield assert_equal, particles_per_grid2, particles1.NumberOfParticles+particles2.NumberOfParticles + assert_equal(particles_per_grid2, particles1.NumberOfParticles+particles2.NumberOfParticles) - #Test the uniqueness of tags + # Test the uniqueness of tags tags = np.concatenate([grid["particle_index"] for grid in ds.index.grids]) tags.sort() - yield assert_equal, tags, np.arange((np.product(pdims)+num_particles)) + assert_equal(tags, np.arange((np.product(pdims)+num_particles))) - # Test that the old particles have zero for the new field - old_particle_temps = [grid["particle_gas_temperature"][:particles_per_grid1[i]] - for i, grid in enumerate(ds.index.grids)] - test_zeros = [np.zeros((particles_per_grid1[i])) - for i, grid in enumerate(ds.index.grids)] - yield assert_equal, old_particle_temps, test_zeros + del tags - #Now dump all of these particle fields out into a dict + # Now dump all of these particle fields out into a dict pdata = {} dd = ds.all_data() - for field in new_field_list : + for field in field_list: pdata[field] = dd[field] - #Test the "from-list" generator and particle field clobber - particles3 = FromListParticleGenerator(ds, num_particles+np.product(pdims), pdata) + # Test the "from-list" generator and particle field clobber + num_particles3 = num_particles+np.product(pdims) + particles3 = FromListParticleGenerator(ds, num_particles3, pdata) particles3.apply_to_stream(clobber=True) - - #Test the number of particles again + + # Test the number of particles again particles_per_grid3 = [grid.NumberOfParticles for grid in ds.index.grids] - yield assert_equal, particles_per_grid3, particles1.NumberOfParticles+particles2.NumberOfParticles + assert_equal(particles_per_grid3, particles1.NumberOfParticles+particles2.NumberOfParticles) particles_per_grid2 = [len(grid["particle_position_z"]) for grid in ds.index.grids] - yield assert_equal, particles_per_grid3, particles1.NumberOfParticles+particles2.NumberOfParticles + assert_equal(particles_per_grid3, particles1.NumberOfParticles+particles2.NumberOfParticles) + assert_equal(particles_per_grid2, particles_per_grid3) + + # Test adding in particles with a different particle type + + num_star_particles = 20000 + pdata2 = {("star", "particle_position_x"): np.random.uniform(size=num_star_particles), + ("star", "particle_position_y"): np.random.uniform(size=num_star_particles), + ("star", "particle_position_z"): np.random.uniform(size=num_star_particles)} + + particles4 = FromListParticleGenerator(ds, num_star_particles, pdata2, ptype="star") + particles4.apply_to_stream() + + dd = ds.all_data() + assert dd["star", "particle_position_x"].size == num_star_particles + assert dd["io", "particle_position_x"].size == num_particles3 + assert dd["all", "particle_position_x"].size == num_star_particles+num_particles3 + + + del pdata + del pdata2 + del ds + del particles1 + del particles2 + del particles4 + del fields + del dens + del temp -if __name__=="__main__": - for n, i in enumerate(test_particle_generator()): - i[0](*i[1:]) diff -Nru yt-3.3.3/yt/utilities/tests/test_periodicity.py yt-3.4.0/yt/utilities/tests/test_periodicity.py --- yt-3.3.3/yt/utilities/tests/test_periodicity.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/tests/test_periodicity.py 2017-08-10 18:02:57.000000000 +0000 @@ -15,21 +15,21 @@ b = [0.9,0.9,0.9] period = 1. dist = periodic_dist(a,b,period) - yield assert_almost_equal, dist, 0.34641016151377535 + assert_almost_equal(dist, 0.34641016151377535) dist = periodic_dist(a, b, period, (True, False, False)) - yield assert_almost_equal, dist, 1.1489125293076059 + assert_almost_equal(dist, 1.1489125293076059) dist = periodic_dist(a, b, period, (False, True, False)) - yield assert_almost_equal, dist, 1.1489125293076059 + assert_almost_equal(dist, 1.1489125293076059) dist = periodic_dist(a, b, period, (False, False, True)) - yield assert_almost_equal, dist, 1.1489125293076059 + assert_almost_equal(dist, 1.1489125293076059) dist = periodic_dist(a, b, period, (True, True, False)) - yield assert_almost_equal, dist, 0.84852813742385713 + assert_almost_equal(dist, 0.84852813742385713) dist = periodic_dist(a, b, period, (True, False, True)) - yield assert_almost_equal, dist, 0.84852813742385713 + assert_almost_equal(dist, 0.84852813742385713) dist = periodic_dist(a, b, period, (False, True, True)) - yield assert_almost_equal, dist, 0.84852813742385713 + assert_almost_equal(dist, 0.84852813742385713) dist = euclidean_dist(a,b) - yield assert_almost_equal, dist, 1.3856406460551021 + assert_almost_equal(dist, 1.3856406460551021) # Now test the more complicated cases where we're calculaing radii based # on data objects @@ -43,12 +43,12 @@ center = np.tile(np.reshape(np.array(c), (positions.shape[0],)+n_tup),(1,)+positions.shape[1:]) dist = periodic_dist(positions, center, period, ds.periodicity) - yield assert_almost_equal, dist.min(), 0.00270632938683 - yield assert_almost_equal, dist.max(), 0.863319074398 + assert_almost_equal(dist.min(), 0.00270632938683) + assert_almost_equal(dist.max(), 0.863319074398) dist = euclidean_dist(positions, center) - yield assert_almost_equal, dist.min(), 0.00270632938683 - yield assert_almost_equal, dist.max(), 1.54531407988 + assert_almost_equal(dist.min(), 0.00270632938683) + assert_almost_equal(dist.max(), 1.54531407988) # Then grid-like data data = ds.index.grids[0] @@ -58,11 +58,9 @@ center = np.tile(np.reshape(np.array(c), (positions.shape[0],)+n_tup),(1,)+positions.shape[1:]) dist = periodic_dist(positions, center, period, ds.periodicity) - yield assert_almost_equal, dist.min(), 0.00270632938683 - yield assert_almost_equal, dist.max(), 0.863319074398 + assert_almost_equal(dist.min(), 0.00270632938683) + assert_almost_equal(dist.max(), 0.863319074398) dist = euclidean_dist(positions, center) - yield assert_almost_equal, dist.min(), 0.00270632938683 - yield assert_almost_equal, dist.max(), 1.54531407988 - - + assert_almost_equal(dist.min(), 0.00270632938683) + assert_almost_equal(dist.max(), 1.54531407988) diff -Nru yt-3.3.3/yt/utilities/tests/test_periodic_table.py yt-3.4.0/yt/utilities/tests/test_periodic_table.py --- yt-3.3.3/yt/utilities/tests/test_periodic_table.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/utilities/tests/test_periodic_table.py 2017-08-10 18:02:57.000000000 +0000 @@ -9,9 +9,9 @@ # If num == -1, then we are in one of the things like Deuterium or El # that are not elements by themselves. if num == -1: e0 = e1 - yield assert_equal, id(e0), id(e1) - yield assert_equal, id(e0), id(e2) - yield assert_equal, e0.num, num - yield assert_equal, e0.weight, w - yield assert_equal, e0.name, name - yield assert_equal, e0.symbol, sym + assert_equal(id(e0), id(e1)) + assert_equal(id(e0), id(e2)) + assert_equal(e0.num, num) + assert_equal(e0.weight, w) + assert_equal(e0.name, name) + assert_equal(e0.symbol, sym) diff -Nru yt-3.3.3/yt/utilities/tests/test_selectors.py yt-3.4.0/yt/utilities/tests/test_selectors.py --- yt-3.3.3/yt/utilities/tests/test_selectors.py 2016-10-25 16:08:30.000000000 +0000 +++ yt-3.4.0/yt/utilities/tests/test_selectors.py 2017-08-10 18:02:57.000000000 +0000 @@ -54,7 +54,7 @@ ds.domain_right_edge-ds.domain_left_edge, ds.periodicity) # WARNING: this value has not been externally verified - yield assert_array_less, dist, 0.25 + assert_array_less(dist, 0.25) def test_ellipsoid_selector(): # generate fake data with a number of non-cubical grids @@ -85,7 +85,7 @@ ds.domain_right_edge-ds.domain_left_edge, ds.periodicity) # WARNING: this value has not been externally verified - yield assert_array_less, dist, ratios[0] + assert_array_less(dist, ratios[0]) # aligned ellipsoid tests ratios = [0.25, 0.1, 0.1] @@ -104,7 +104,7 @@ ds.domain_right_edge-ds.domain_left_edge, ds.periodicity)/ratios[i])**2 # WARNING: this value has not been externally verified - yield assert_array_less, dist2, 1.0 + assert_array_less(dist2, 1.0) def test_slice_selector(): # generate fake data with a number of non-cubical grids @@ -116,9 +116,9 @@ data = ds.slice(i, coord) data.get_data() v = data[d].to_ndarray() - yield assert_equal, data.shape[0], 64**2 - yield assert_equal, data["ones"].shape[0], 64**2 - yield assert_array_less, np.abs(v - coord), 1./128.+1e-6 + assert_equal(data.shape[0], 64**2) + assert_equal(data["ones"].shape[0], 64**2) + assert_array_less(np.abs(v - coord), 1./128.+1e-6) def test_cutting_plane_selector(): # generate fake data with a number of non-cubical grids @@ -144,7 +144,7 @@ cells1 = np.lexsort((data['x'],data['y'],data['z'])) cells2 = np.lexsort((data2['x'],data2['y'],data2['z'])) for d2 in 'xyz': - yield assert_equal, data[d2][cells1], data2[d2][cells2] + assert_equal(data[d2][cells1], data2[d2][cells2]) #def test_region_selector(): # diff -Nru yt-3.3.3/yt/utilities/tree_container.py yt-3.4.0/yt/utilities/tree_container.py --- yt-3.3.3/yt/utilities/tree_container.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/utilities/tree_container.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,33 @@ +""" +TreeContainer class and member functions + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2016, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +class TreeContainer(object): + r"""A recursive data container for things like merger trees and + clump-finder trees. + + """ + _child_attr = "children" + + def __init__(self): + setattr(self, self._child_attr, None) + + def __iter__(self): + yield self + children = getattr(self, self._child_attr) + if children is None: + return + for child in children: + for a_node in child: + yield a_node diff -Nru yt-3.3.3/yt/visualization/api.py yt-3.4.0/yt/visualization/api.py --- yt-3.3.3/yt/visualization/api.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/api.py 2017-08-10 18:02:57.000000000 +0000 @@ -51,7 +51,12 @@ AxisAlignedSlicePlot, \ OffAxisSlicePlot, \ ProjectionPlot, \ - OffAxisProjectionPlot + OffAxisProjectionPlot, \ + plot_2d + +from .line_plot import \ + LinePlot, \ + LineBuffer from .profile_plotter import \ ProfilePlot, \ @@ -59,3 +64,10 @@ from .base_plot_types import \ get_multi_plot + +from .fits_image import \ + FITSImageData, \ + FITSSlice, \ + FITSOffAxisSlice, \ + FITSProjection, \ + FITSOffAxisProjection diff -Nru yt-3.3.3/yt/visualization/base_plot_types.py yt-3.4.0/yt/visualization/base_plot_types.py --- yt-3.3.3/yt/visualization/base_plot_types.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/base_plot_types.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,19 +13,44 @@ # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -from io import BytesIO import matplotlib +import numpy as np + +from distutils.version import LooseVersion +from io import BytesIO + from yt.funcs import \ get_image_suffix, \ mylog, \ iterable, \ get_brewer_cmap, \ - matplotlib_style_context -import numpy as np + matplotlib_style_context, \ + get_interactivity + + +backend_dict = {'GTK': ['backend_gtk', 'FigureCanvasGTK', + 'FigureManagerGTK'], + 'GTKAgg': ['backend_gtkagg', 'FigureCanvasGTKAgg'], + 'GTKCairo': ['backend_gtkcairo', 'FigureCanvasGTKCairo'], + 'MacOSX': ['backend_macosx', 'FigureCanvasMac', 'FigureManagerMac'], + 'Qt4Agg': ['backend_qt4agg', 'FigureCanvasQTAgg'], + 'Qt5Agg': ['backend_gt5agg', 'FigureCanvasQTAgg'], + 'TkAgg': ['backend_tkagg', 'FigureCanvasTkAgg'], + 'WX': ['backend_wx', 'FigureCanvasWx'], + 'WXAgg': ['backend_wxagg', 'FigureCanvasWxAgg'], + 'GTK3Cairo': ['backend_gtk3cairo', + 'FigureCanvasGTK3Cairo', + 'FigureManagerGTK3Cairo'], + 'GTK3Agg': ['backend_gtk3agg', 'FigureCanvasGTK3Agg', + 'FigureManagerGTK3Agg'], + 'WebAgg': ['backend_webagg', 'FigureCanvasWebAgg'], + 'nbAgg': ['backend_nbagg', 'FigureCanvasNbAgg', + 'FigureManagerNbAgg'], + 'agg': ['backend_agg', 'FigureCanvasAgg']} class CallbackWrapper(object): - def __init__(self, viewer, window_plot, frb, field, font_properties, + def __init__(self, viewer, window_plot, frb, field, font_properties, font_color): self.frb = frb self.data = frb.data_source @@ -50,16 +75,19 @@ self.font_color = font_color self.field = field + class PlotMPL(object): - """A base class for all yt plots made using matplotlib. + """A base class for all yt plots made using matplotlib, that is backend independent. """ + def __init__(self, fsize, axrect, figure, axes): """Initialize PlotMPL class""" import matplotlib.figure - from ._mpl_imports import FigureCanvasAgg self._plot_valid = True if figure is None: + if not iterable(fsize): + fsize = (fsize, fsize) self.figure = matplotlib.figure.Figure(figsize=fsize, frameon=True) else: figure.set_size_inches(fsize) @@ -70,10 +98,34 @@ axes.cla() axes.set_position(axrect) self.axes = axes - self.canvas = FigureCanvasAgg(self.figure) + canvas_classes = self._set_canvas() + self.canvas = canvas_classes[0](self.figure) + if len(canvas_classes) > 1: + self.manager = canvas_classes[1](self.canvas, 1) for which in ['major', 'minor']: for axis in 'xy': - self.axes.tick_params(which=which, axis=axis, direction='in') + self.axes.tick_params( + which=which, axis=axis, direction='in', top=True, right=True + ) + + def _set_canvas(self): + self.interactivity = get_interactivity() + if self.interactivity: + backend = str(matplotlib.get_backend()) + else: + backend = 'agg' + + for key in backend_dict.keys(): + if key == backend: + mod = __import__('matplotlib.backends', globals(), locals(), + [backend_dict[key][0]], 0) + submod = getattr(mod, backend_dict[key][0]) + FigureCanvas = getattr(submod, backend_dict[key][1]) + if len(backend_dict[key]) > 2: + FigureManager = getattr(submod, backend_dict[key][2]) + return [FigureCanvas, FigureManager] + else: + return [FigureCanvas] def save(self, name, mpl_kwargs=None, canvas=None): """Choose backend and save image to disk""" @@ -105,9 +157,17 @@ canvas.print_figure(name, **mpl_kwargs) return name + def show(self): + try: + self.manager.show() + except AttributeError: + self.canvas.show() + def _get_labels(self): ax = self.axes labels = ax.xaxis.get_ticklabels() + ax.yaxis.get_ticklabels() + labels += ax.xaxis.get_minorticklabels() + labels += ax.yaxis.get_minorticklabels() labels += [ax.title, ax.xaxis.label, ax.yaxis.label, ax.xaxis.get_offset_text(), ax.yaxis.get_offset_text()] return labels @@ -161,12 +221,31 @@ aspect=aspect, vmax=self.zmax, cmap=cmap, interpolation='nearest') if (cbnorm == 'symlog'): - formatter = matplotlib.ticker.LogFormatterMathtext() - self.cb = self.figure.colorbar(self.image, self.cax, format=formatter) - yticks = list(-10**np.arange(np.floor(np.log10(-data.min())),\ - np.rint(np.log10(cblinthresh))-1, -1)) + [0] + \ - list(10**np.arange(np.rint(np.log10(cblinthresh)),\ - np.ceil(np.log10(data.max()))+1)) + if LooseVersion(matplotlib.__version__) < LooseVersion("2.0.0"): + formatter_kwargs = {} + else: + formatter_kwargs = dict(linthresh=cblinthresh) + formatter = matplotlib.ticker.LogFormatterMathtext( + **formatter_kwargs) + self.cb = self.figure.colorbar( + self.image, self.cax, format=formatter) + if data.min() >= 0.0: + yticks = [data.min().v] + list( + 10**np.arange(np.rint(np.log10(cblinthresh)), + np.ceil(np.log10(data.max())) + 1)) + elif data.max() <= 0.0: + yticks = list( + -10**np.arange( + np.floor(np.log10(-data.min())), + np.rint(np.log10(cblinthresh)) - 1, -1)) + \ + [data.max().v] + else: + yticks = list( + -10**np.arange(np.floor(np.log10(-data.min())), + np.rint(np.log10(cblinthresh))-1, -1)) + \ + [0] + \ + list(10**np.arange(np.rint(np.log10(cblinthresh)), + np.ceil(np.log10(data.max()))+1)) self.cb.set_ticks(yticks) else: self.cb = self.figure.colorbar(self.image, self.cax) @@ -217,10 +296,10 @@ x_frac_widths = xbins/size[0] y_frac_widths = ybins/size[1] - # axrect is the rectangle defining the area of the - # axis object of the plot. Its range goes from 0 to 1 in - # x and y directions. The first two values are the x,y - # start values of the axis object (lower left corner), and the + # axrect is the rectangle defining the area of the + # axis object of the plot. Its range goes from 0 to 1 in + # x and y directions. The first two values are the x,y + # start values of the axis object (lower left corner), and the # second two values are the size of the axis object. To get # the upper right corner, add the first x,y to the second x,y. axrect = ( @@ -306,6 +385,7 @@ self._toggle_colorbar(True) return self + def get_multi_plot(nx, ny, colorbar = 'vertical', bw = 4, dpi=300, cbar_padding = 0.4): r"""Construct a multiple axes plot object, with or without a colorbar, into diff -Nru yt-3.3.3/yt/visualization/color_maps.py yt-3.4.0/yt/visualization/color_maps.py --- yt-3.3.3/yt/visualization/color_maps.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/color_maps.py 2017-08-10 18:02:57.000000000 +0000 @@ -17,6 +17,11 @@ from . import _colormap_data as _cm from yt.extern.six import string_types +try: + import cmocean +except ImportError: + cmocean = None + def is_colormap(cmap): return isinstance(cmap,cc.Colormap) @@ -152,6 +157,22 @@ add_cmap("cubehelix", _cubehelix_data) +# Add colormaps from cmocean, if it's installed +if cmocean is not None: + for cmname in cmocean.cm.cmapnames: + cm = getattr(cmocean.cm, cmname) + # cmocean has a colormap named 'algae', so let's avoid overwriting + # yt's algae or any other colormap we've already added + if cmname in yt_colormaps: + cmname = cmname + '_cmocean' + yt_colormaps[cmname] = cm + try: + mcm.register_cmap(cmname, yt_colormaps[cmname]) + except AttributeError: + # for old versions of matplotlib this won't work, so we avoid + # erroring out but don't worry about registering with matplotlib + pass + # Add colormaps in _colormap_data.py that weren't defined here _vs = np.linspace(0,1,256) for k,v in list(_cm.color_map_luts.items()): diff -Nru yt-3.3.3/yt/visualization/eps_writer.py yt-3.4.0/yt/visualization/eps_writer.py --- yt-3.3.3/yt/visualization/eps_writer.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/eps_writer.py 2017-08-10 18:02:57.000000000 +0000 @@ -86,7 +86,7 @@ def return_field(self, plot): if isinstance(plot, (PlotWindow, PhasePlot)): - return plot.plots.keys()[0] + return list(plot.plots.keys())[0] else: return None @@ -382,7 +382,7 @@ _ylog = False _tickcolor = None elif isinstance(plot, PhasePlot): - k = plot.plots.keys()[0] + k = list(plot.plots.keys())[0] _xrange = plot[k].axes.get_xlim() _yrange = plot[k].axes.get_ylim() _xlog = plot.profile.x_log @@ -517,7 +517,7 @@ self.canvas = pyx.canvas.canvas() if isinstance(plot, (PlotWindow, PhasePlot)): if field is None: - self.field = plot.plots.keys()[0] + self.field = list(plot.plots.keys())[0] mylog.warning("No field specified. Choosing first field (%s)" % \ str(self.field)) else: diff -Nru yt-3.3.3/yt/visualization/fits_image.py yt-3.4.0/yt/visualization/fits_image.py --- yt-3.3.3/yt/visualization/fits_image.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/visualization/fits_image.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,885 @@ +""" +FITSImageData Class +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- +from yt.extern.six import string_types +import numpy as np +from yt.fields.derived_field import DerivedField +from yt.funcs import mylog, iterable, fix_axis, ensure_list +from yt.visualization.fixed_resolution import FixedResolutionBuffer +from yt.data_objects.construction_data_containers import YTCoveringGrid +from yt.utilities.on_demand_imports import _astropy +from yt.units.yt_array import YTQuantity, YTArray +from yt.units import dimensions +from yt.utilities.parallel_tools.parallel_analysis_interface import \ + parallel_root_only +from yt.visualization.volume_rendering.off_axis_projection import off_axis_projection +import re +import sys + +class UnitfulHDU(object): + def __init__(self, hdu): + self.hdu = hdu + self.header = self.hdu.header + self.name = self.header["BTYPE"] + self.units = self.header["BUNIT"] + self.shape = self.hdu.shape + + @property + def data(self): + return YTArray(self.hdu.data, self.units) + + def __repr__(self): + im_shape = " x ".join([str(s) for s in self.shape]) + return "FITSImage: %s (%s, %s)" % (self.name, im_shape, self.units) + +class FITSImageData(object): + + def __init__(self, data, fields=None, units=None, width=None, wcs=None): + r""" Initialize a FITSImageData object. + + FITSImageData contains a collection of FITS ImageHDU instances and + WCS information, along with units for each of the images. FITSImageData + instances can be constructed from ImageArrays, NumPy arrays, dicts + of such arrays, FixedResolutionBuffers, and YTCoveringGrids. The latter + two are the most powerful because WCS information can be constructed + automatically from their coordinates. + + Parameters + ---------- + data : FixedResolutionBuffer or a YTCoveringGrid. Or, an + ImageArray, an numpy.ndarray, or dict of such arrays + The data to be made into a FITS image or images. + fields : single string or list of strings, optional + The field names for the data. If *fields* is none and *data* has + keys, it will use these for the fields. If *data* is just a + single array one field name must be specified. + units : string + The units of the WCS coordinates. Defaults to "cm". + width : float or YTQuantity + The width of the image. Either a single value or iterable of values. + If a float, assumed to be in *units*. Only used if this information + is not already provided by *data*. + wcs : `astropy.wcs.WCS` instance, optional + Supply an AstroPy WCS instance. Will override automatic WCS + creation from FixedResolutionBuffers and YTCoveringGrids. + + Examples + -------- + + >>> # This example uses a FRB. + >>> ds = load("sloshing_nomag2_hdf5_plt_cnt_0150") + >>> prj = ds.proj(2, "kT", weight_field="density") + >>> frb = prj.to_frb((0.5, "Mpc"), 800) + >>> # This example just uses the FRB and puts the coords in kpc. + >>> f_kpc = FITSImageData(frb, fields="kT", units="kpc") + >>> # This example specifies a specific WCS. + >>> from astropy.wcs import WCS + >>> w = WCS(naxis=self.dimensionality) + >>> w.wcs.crval = [30., 45.] # RA, Dec in degrees + >>> w.wcs.cunit = ["deg"]*2 + >>> nx, ny = 800, 800 + >>> w.wcs.crpix = [0.5*(nx+1), 0.5*(ny+1)] + >>> w.wcs.ctype = ["RA---TAN","DEC--TAN"] + >>> scale = 1./3600. # One arcsec per pixel + >>> w.wcs.cdelt = [-scale, scale] + >>> f_deg = FITSImageData(frb, fields="kT", wcs=w) + >>> f_deg.writeto("temp.fits") + """ + + self.fields = [] + self.field_units = {} + + if units is None: + units = "cm" + if width is None: + width = 1.0 + + exclude_fields = ['x','y','z','px','py','pz', + 'pdx','pdy','pdz','weight_field'] + + if isinstance(data, _astropy.pyfits.HDUList): + self.hdulist = data + for hdu in data: + self.fields.append(hdu.header["btype"]) + self.field_units[hdu.header["btype"]] = hdu.header['bunit'] + + self.shape = self.hdulist[0].shape + self.dimensionality = len(self.shape) + wcs_names = [key for key in self.hdulist[0].header + if "WCSNAME" in key] + for name in wcs_names: + if name == "WCSNAME": + key = ' ' + else: + key = name[-1] + w = _astropy.pywcs.WCS(header=self.hdulist[0].header, + key=key, naxis=self.dimensionality) + setattr(self, "wcs"+key.strip().lower(), w) + + return + + self.hdulist = _astropy.pyfits.HDUList() + + if isinstance(fields, string_types): + fields = [fields] + + if hasattr(data, 'keys'): + img_data = data + if fields is None: + fields = list(img_data.keys()) + elif isinstance(data, np.ndarray): + if fields is None: + mylog.warning("No field name given for this array. " + "Calling it 'image_data'.") + fn = 'image_data' + fields = [fn] + else: + fn = fields[0] + img_data = {fn: data} + + for fd in fields: + if isinstance(fd, tuple): + self.fields.append(fd[1]) + elif isinstance(fd, DerivedField): + self.fields.append(fd.name[1]) + else: + self.fields.append(fd) + + first = True + for name, field in zip(self.fields, fields): + if name not in exclude_fields: + if hasattr(img_data[field], "units"): + self.field_units[name] = str(img_data[field].units) + else: + self.field_units[name] = "dimensionless" + mylog.info("Making a FITS image of field %s" % name) + if first: + hdu = _astropy.pyfits.PrimaryHDU(np.array(img_data[field])) + first = False + else: + hdu = _astropy.pyfits.ImageHDU(np.array(img_data[field])) + hdu.name = name + hdu.header["btype"] = name + hdu.header["bunit"] = re.sub('()', '', self.field_units[name]) + self.hdulist.append(hdu) + + self.shape = self.hdulist[0].shape + self.dimensionality = len(self.shape) + + if wcs is None: + w = _astropy.pywcs.WCS(header=self.hdulist[0].header, + naxis=self.dimensionality) + if isinstance(img_data, FixedResolutionBuffer): + # FRBs are a special case where we have coordinate + # information, so we take advantage of this and + # construct the WCS object + dx = (img_data.bounds[1]-img_data.bounds[0]).to(units).v + dy = (img_data.bounds[3]-img_data.bounds[2]).to(units).v + dx /= self.shape[0] + dy /= self.shape[1] + xctr = 0.5*(img_data.bounds[1]+img_data.bounds[0]).to(units).v + yctr = 0.5*(img_data.bounds[3]+img_data.bounds[2]).to(units).v + center = [xctr, yctr] + cdelt = [dx, dy] + elif isinstance(img_data, YTCoveringGrid): + cdelt = img_data.dds.to(units).v + center = 0.5*(img_data.left_edge+img_data.right_edge).to(units).v + else: + # If img_data is just an array, we assume the center is the + # origin and use the image width to determine the cell widths + if not iterable(width): + width = [width]*self.dimensionality + if isinstance(width[0], YTQuantity): + cdelt = [wh.to(units).v/n for wh, n in zip(width, self.shape)] + else: + cdelt = [float(wh)/n for wh, n in zip(width, self.shape)] + center = [0.0]*self.dimensionality + w.wcs.crpix = 0.5*(np.array(self.shape)+1) + w.wcs.crval = center + w.wcs.cdelt = cdelt + w.wcs.ctype = ["linear"]*self.dimensionality + w.wcs.cunit = [units]*self.dimensionality + self.set_wcs(w) + else: + self.set_wcs(wcs) + + def set_wcs(self, wcs, wcsname=None, suffix=None): + """ + Set the WCS coordinate information for all images + with a WCS object *wcs*. + """ + if wcsname is None: + wcs.wcs.name = 'yt' + else: + wcs.wcs.name = wcsname + h = wcs.to_header() + if suffix is None: + self.wcs = wcs + else: + setattr(self, "wcs"+suffix, wcs) + for img in self.hdulist: + for k, v in h.items(): + kk = k + if suffix is not None: + kk += suffix + img.header[kk] = v + + def update_header(self, field, key, value): + """ + Update the FITS header for *field* with a + *key*, *value* pair. If *field* == "all", all + headers will be updated. + """ + if field == "all": + for img in self.hdulist: + img.header[key] = value + else: + if field not in self.keys(): + raise KeyError("%s not an image!" % field) + idx = self.fields.index(field) + self.hdulist[idx].header[key] = value + + def update_all_headers(self, key, value): + mylog.warning("update_all_headers is deprecated. " + "Use update_header('all', key, value) instead.") + self.update_header("all", key, value) + + def keys(self): + return self.fields + + def has_key(self, key): + return key in self.fields + + def values(self): + return [self[k] for k in self.fields] + + def items(self): + return [(k, self[k]) for k in self.fields] + + def __getitem__(self, item): + return UnitfulHDU(self.hdulist[item]) + + def __repr__(self): + return str([self[k] for k in self.keys()]) + + def info(self, output=None): + """ + Summarize the info of the HDUs in this `FITSImageData` + instance. + + Note that this function prints its results to the console---it + does not return a value. + + Parameters + ---------- + output : file, boolean, optional + A file-like object to write the output to. If `False`, does not + output to a file and instead returns a list of tuples representing + the FITSImageData info. Writes to ``sys.stdout`` by default. + """ + hinfo = self.hdulist.info(output=False) + num_cols = len(hinfo[0]) + if output is None: + output = sys.stdout + if num_cols == 8: + header = 'No. Name Ver Type Cards Dimensions Format Units' + format = '{:3d} {:10} {:3} {:11} {:5d} {} {} {}' + else: + header = 'No. Name Type Cards Dimensions Format Units' + format = '{:3d} {:10} {:11} {:5d} {} {} {}' + if self.hdulist._file is None: + name = '(No file associated with this FITSImageData)' + else: + name = self.hdulist._file.name + results = ['Filename: {}'.format(name), header] + for line in hinfo: + units = self.field_units[self.hdulist[line[0]].header['btype']] + summary = tuple(list(line[:-1]) + [units]) + if output: + results.append(format.format(*summary)) + else: + results.append(summary) + + if output: + output.write('\n'.join(results)) + output.write('\n') + output.flush() + else: + return results[2:] + + @parallel_root_only + def writeto(self, fileobj, fields=None, clobber=False, **kwargs): + r""" + Write all of the fields or a subset of them to a FITS file. + + Parameters + ---------- + fileobj : string + The name of the file to write to. + fields : list of strings, optional + The fields to write to the file. If not specified + all of the fields in the buffer will be written. + clobber : boolean, optional + Whether or not to overwrite a previously existing file. + Default: False + All other keyword arguments are passed to the `writeto` + method of `astropy.io.fits.HDUList`. + """ + if fields is None: + hdus = self.hdulist + else: + hdus = _astropy.pyfits.HDUList() + for field in fields: + hdus.append(self.hdulist[field]) + hdus.writeto(fileobj, clobber=clobber, **kwargs) + + def to_glue(self, label="yt", data_collection=None): + """ + Takes the data in the FITSImageData instance and exports it to + Glue (http://www.glueviz.org) for interactive analysis. Optionally + add a *label*. If you are already within the Glue environment, you + can pass a *data_collection* object, otherwise Glue will be started. + """ + from glue.core import DataCollection, Data + from glue.core.coordinates import coordinates_from_header + from glue.qt.glue_application import GlueApplication + + image = Data(label=label) + image.coords = coordinates_from_header(self.wcs.to_header()) + for k,f in self.hdulist.items(): + image.add_component(f.data, k) + if data_collection is None: + dc = DataCollection([image]) + app = GlueApplication(dc) + app.start() + else: + data_collection.append(image) + + def to_aplpy(self, **kwargs): + """ + Use APLpy (http://aplpy.github.io) for plotting. Returns an + `aplpy.FITSFigure` instance. All keyword arguments are passed + to the `aplpy.FITSFigure` constructor. + """ + import aplpy + return aplpy.FITSFigure(self.hdulist, **kwargs) + + def get_data(self, field): + """ + Return the data array of the image corresponding to *field* + with units attached. Deprecated. + """ + return self[field].data + + def set_unit(self, field, units): + """ + Set the units of *field* to *units*. + """ + if field not in self.keys(): + raise KeyError("%s not an image!" % field) + idx = self.fields.index(field) + new_data = YTArray(self.hdulist[idx].data, + self.field_units[field]).to(units) + self.hdulist[idx].data = new_data.v + self.hdulist[idx].header["bunit"] = units + self.field_units[field] = units + + def pop(self, key): + """ + Remove a field with name *key* + and return it as a new FITSImageData + instance. + """ + if key not in self.keys(): + raise KeyError("%s not an image!" % key) + idx = self.fields.index(key) + im = self.hdulist.pop(idx) + self.field_units.pop(key) + self.fields.remove(key) + data = _astropy.pyfits.HDUList([im]) + return FITSImageData(data) + + def close(self): + self.hdulist.close() + + @classmethod + def from_file(cls, filename): + """ + Generate a FITSImageData instance from one previously written to + disk. + + Parameters + ---------- + filename : string + The name of the file to open. + """ + f = _astropy.pyfits.open(filename, lazy_load_hdus=False) + return cls(f) + + @classmethod + def from_images(cls, image_list): + """ + Generate a new FITSImageData instance from a list of FITSImageData + instances. + + Parameters + ---------- + image_list : list of FITSImageData instances + The images to be combined. + """ + w = image_list[0].wcs + img_shape = image_list[0].shape + data = [] + first = True + for fid in image_list: + assert_same_wcs(w, fid.wcs) + if img_shape != fid.shape: + raise RuntimeError("Images do not have the same shape!") + for hdu in fid.hdulist: + if first: + data.append(hdu) + first = False + else: + data.append(_astropy.pyfits.ImageHDU(hdu.data, header=hdu.header)) + data = _astropy.pyfits.HDUList(data) + return cls(data) + + def create_sky_wcs(self, sky_center, sky_scale, + ctype=["RA---TAN","DEC--TAN"], + crota=None, cd=None, pc=None, + wcsname="celestial", + replace_old_wcs=True): + """ + Takes a Cartesian WCS and converts it to one in a + celestial coordinate system. + + Parameters + ---------- + sky_center : iterable of floats + Reference coordinates of the WCS in degrees. + sky_scale : tuple or YTQuantity + Conversion between an angle unit and a length unit, + e.g. (3.0, "arcsec/kpc") + ctype : list of strings, optional + The type of the coordinate system to create. + crota : 2-element ndarray, optional + Rotation angles between cartesian coordinates and + the celestial coordinates. + cd : 2x2-element ndarray, optional + Dimensioned coordinate transformation matrix. + pc : 2x2-element ndarray, optional + Coordinate transformation matrix. + replace_old_wcs : boolean, optional + Whether or not to overwrite the default WCS of the + FITSImageData instance. If false, a second WCS will + be added to the header. Default: True. + """ + old_wcs = self.wcs + naxis = old_wcs.naxis + crval = [sky_center[0], sky_center[1]] + if isinstance(sky_scale, YTQuantity): + scaleq = sky_scale + else: + scaleq = YTQuantity(sky_scale[0],sky_scale[1]) + if scaleq.units.dimensions != dimensions.angle/dimensions.length: + raise RuntimeError("sky_scale %s not in correct " % sky_scale + + "dimensions of angle/length!") + deltas = old_wcs.wcs.cdelt + units = [str(unit) for unit in old_wcs.wcs.cunit] + new_dx = (YTQuantity(-deltas[0], units[0])*scaleq).in_units("deg") + new_dy = (YTQuantity(deltas[1], units[1])*scaleq).in_units("deg") + new_wcs = _astropy.pywcs.WCS(naxis=naxis) + cdelt = [new_dx.v, new_dy.v] + cunit = ["deg"]*2 + if naxis == 3: + crval.append(old_wcs.wcs.crval[2]) + cdelt.append(old_wcs.wcs.cdelt[2]) + ctype.append(old_wcs.wcs.ctype[2]) + cunit.append(old_wcs.wcs.cunit[2]) + new_wcs.wcs.crpix = old_wcs.wcs.crpix + new_wcs.wcs.cdelt = cdelt + new_wcs.wcs.crval = crval + new_wcs.wcs.cunit = cunit + new_wcs.wcs.ctype = ctype + if crota is not None: + new_wcs.wcs.crota = crota + if cd is not None: + new_wcs.wcs.cd = cd + if pc is not None: + new_wcs.wcs.cd = pc + if replace_old_wcs: + self.set_wcs(new_wcs, wcsname=wcsname) + else: + self.set_wcs(new_wcs, wcsname=wcsname, suffix="a") + +class FITSImageBuffer(FITSImageData): + pass + +def sanitize_fits_unit(unit): + if unit == "Mpc": + mylog.info("Changing FITS file unit to kpc.") + unit = "kpc" + elif unit == "au": + unit = "AU" + return unit + +axis_wcs = [[1,2],[0,2],[0,1]] + +def construct_image(ds, axis, data_source, center, width=None, image_res=None): + if width is None: + width = ds.domain_width[axis_wcs[axis]] + unit = ds.get_smallest_appropriate_unit(width[0]) + mylog.info("Making an image of the entire domain, "+ + "so setting the center to the domain center.") + else: + width = ds.coordinates.sanitize_width(axis, width, None) + unit = str(width[0].units) + if image_res is None: + ddims = ds.domain_dimensions*ds.refine_by**ds.index.max_level + if iterable(axis): + nx = ddims.max() + ny = ddims.max() + else: + nx, ny = [ddims[idx] for idx in axis_wcs[axis]] + else: + if iterable(image_res): + nx, ny = image_res + else: + nx, ny = image_res, image_res + dx = width[0]/nx + dy = width[1]/ny + crpix = [0.5*(nx+1), 0.5*(ny+1)] + if unit == "unitary": + unit = ds.get_smallest_appropriate_unit(ds.domain_width.max()) + elif unit == "code_length": + unit = ds.get_smallest_appropriate_unit(ds.quan(1.0, "code_length")) + unit = sanitize_fits_unit(unit) + cunit = [unit]*2 + ctype = ["LINEAR"]*2 + cdelt = [dx.in_units(unit), dy.in_units(unit)] + if iterable(axis): + crval = center.in_units(unit) + else: + crval = [center[idx].in_units(unit) for idx in axis_wcs[axis]] + if hasattr(data_source, 'to_frb'): + if iterable(axis): + frb = data_source.to_frb(width[0], (nx, ny), height=width[1]) + else: + frb = data_source.to_frb(width[0], (nx, ny), center=center, + height=width[1]) + else: + frb = None + w = _astropy.pywcs.WCS(naxis=2) + w.wcs.crpix = crpix + w.wcs.cdelt = cdelt + w.wcs.crval = crval + w.wcs.cunit = cunit + w.wcs.ctype = ctype + return w, frb + +def assert_same_wcs(wcs1, wcs2): + from numpy.testing import assert_allclose + assert wcs1.naxis == wcs2.naxis + for i in range(wcs1.naxis): + assert wcs1.wcs.cunit[i] == wcs2.wcs.cunit[i] + assert wcs1.wcs.ctype[i] == wcs2.wcs.ctype[i] + assert_allclose(wcs1.wcs.crpix, wcs2.wcs.crpix) + assert_allclose(wcs1.wcs.cdelt, wcs2.wcs.cdelt) + assert_allclose(wcs1.wcs.crval, wcs2.wcs.crval) + crota1 = getattr(wcs1.wcs, "crota", None) + crota2 = getattr(wcs2.wcs, "crota", None) + if crota1 is None or crota2 is None: + assert crota1 == crota2 + else: + assert_allclose(wcs1.wcs.crota, wcs2.wcs.crota) + cd1 = getattr(wcs1.wcs, "cd", None) + cd2 = getattr(wcs2.wcs, "cd", None) + if cd1 is None or cd2 is None: + assert cd1 == cd2 + else: + assert_allclose(wcs1.wcs.cd, wcs2.wcs.cd) + pc1 = getattr(wcs1.wcs, "pc", None) + pc2 = getattr(wcs2.wcs, "pc", None) + if pc1 is None or pc2 is None: + assert pc1 == pc2 + else: + assert_allclose(wcs1.wcs.pc, wcs2.wcs.pc) + +class FITSSlice(FITSImageData): + r""" + Generate a FITSImageData of an on-axis slice. + + Parameters + ---------- + ds : :class:`~yt.data_objects.static_output.Dataset` + The dataset object. + axis : character or integer + The axis of the slice. One of "x","y","z", or 0,1,2. + fields : string or list of strings + The fields to slice + center : A sequence of floats, a string, or a tuple. + The coordinate of the center of the image. If set to 'c', 'center' or + left blank, the plot is centered on the middle of the domain. If set + to 'max' or 'm', the center will be located at the maximum of the + ('gas', 'density') field. Centering on the max or min of a specific + field is supported by providing a tuple such as ("min","temperature") + or ("max","dark_matter_density"). Units can be specified by passing in + *center* as a tuple containing a coordinate and string unit name or by + passing in a YTArray. If a list or unitless array is supplied, code + units are assumed. + width : tuple or a float. + Width can have four different formats to support windows with variable + x and y widths. They are: + + ================================== ======================= + format example + ================================== ======================= + (float, string) (10,'kpc') + ((float, string), (float, string)) ((10,'kpc'),(15,'kpc')) + float 0.2 + (float, float) (0.2, 0.3) + ================================== ======================= + + For example, (10, 'kpc') requests a plot window that is 10 kiloparsecs + wide in the x and y directions, ((10,'kpc'),(15,'kpc')) requests a + window that is 10 kiloparsecs wide along the x axis and 15 + kiloparsecs wide along the y axis. In the other two examples, code + units are assumed, for example (0.2, 0.3) requests a plot that has an + x width of 0.2 and a y width of 0.3 in code units. If units are + provided the resulting plot axis labels will use the supplied units. + image_res : an int or 2-tuple of ints + Specify the resolution of the resulting image. If not provided, it will + be determined based on the minimum cell size of the dataset. + """ + def __init__(self, ds, axis, fields, center="c", width=None, + image_res=None, **kwargs): + fields = ensure_list(fields) + axis = fix_axis(axis, ds) + center, dcenter = ds.coordinates.sanitize_center(center, axis) + slc = ds.slice(axis, center[axis], **kwargs) + w, frb = construct_image(ds, axis, slc, dcenter, width=width, + image_res=image_res) + super(FITSSlice, self).__init__(frb, fields=fields, wcs=w) + + +class FITSProjection(FITSImageData): + r""" + Generate a FITSImageData of an on-axis projection. + + Parameters + ---------- + ds : :class:`~yt.data_objects.static_output.Dataset` + The dataset object. + axis : character or integer + The axis along which to project. One of "x","y","z", or 0,1,2. + fields : string or list of strings + The fields to project + weight_field : string + The field used to weight the projection. + center : A sequence of floats, a string, or a tuple. + The coordinate of the center of the image. If set to 'c', 'center' or + left blank, the plot is centered on the middle of the domain. If set + to 'max' or 'm', the center will be located at the maximum of the + ('gas', 'density') field. Centering on the max or min of a specific + field is supported by providing a tuple such as ("min","temperature") + or ("max","dark_matter_density"). Units can be specified by passing in + *center* as a tuple containing a coordinate and string unit name or by + passing in a YTArray. If a list or unitless array is supplied, code + units are assumed. + width : tuple or a float. + Width can have four different formats to support windows with variable + x and y widths. They are: + + ================================== ======================= + format example + ================================== ======================= + (float, string) (10,'kpc') + ((float, string), (float, string)) ((10,'kpc'),(15,'kpc')) + float 0.2 + (float, float) (0.2, 0.3) + ================================== ======================= + + For example, (10, 'kpc') requests a plot window that is 10 kiloparsecs + wide in the x and y directions, ((10,'kpc'),(15,'kpc')) requests a + window that is 10 kiloparsecs wide along the x axis and 15 + kiloparsecs wide along the y axis. In the other two examples, code + units are assumed, for example (0.2, 0.3) requests a plot that has an + x width of 0.2 and a y width of 0.3 in code units. If units are + provided the resulting plot axis labels will use the supplied units. + image_res : an int or 2-tuple of ints + Specify the resolution of the resulting image. If not provided, it will + be determined based on the minimum cell size of the dataset. + """ + def __init__(self, ds, axis, fields, center="c", width=None, + weight_field=None, image_res=None, **kwargs): + fields = ensure_list(fields) + axis = fix_axis(axis, ds) + center, dcenter = ds.coordinates.sanitize_center(center, axis) + prj = ds.proj(fields[0], axis, weight_field=weight_field, **kwargs) + w, frb = construct_image(ds, axis, prj, dcenter, width=width, + image_res=image_res) + super(FITSProjection, self).__init__(frb, fields=fields, wcs=w) + +class FITSOffAxisSlice(FITSImageData): + r""" + Generate a FITSImageData of an off-axis slice. + + Parameters + ---------- + ds : :class:`~yt.data_objects.static_output.Dataset` + The dataset object. + normal : a sequence of floats + The vector normal to the projection plane. + fields : string or list of strings + The fields to slice + center : A sequence of floats, a string, or a tuple. + The coordinate of the center of the image. If set to 'c', 'center' or + left blank, the plot is centered on the middle of the domain. If set to + 'max' or 'm', the center will be located at the maximum of the + ('gas', 'density') field. Centering on the max or min of a specific + field is supported by providing a tuple such as ("min","temperature") + or ("max","dark_matter_density"). Units can be specified by passing in + *center* as a tuple containing a coordinate and string unit name or by + passing in a YTArray. If a list or unitless array is supplied, code + units are assumed. + width : tuple or a float. + Width can have four different formats to support windows with variable + x and y widths. They are: + + ================================== ======================= + format example + ================================== ======================= + (float, string) (10,'kpc') + ((float, string), (float, string)) ((10,'kpc'),(15,'kpc')) + float 0.2 + (float, float) (0.2, 0.3) + ================================== ======================= + + For example, (10, 'kpc') requests a plot window that is 10 kiloparsecs + wide in the x and y directions, ((10,'kpc'),(15,'kpc')) requests a + window that is 10 kiloparsecs wide along the x axis and 15 + kiloparsecs wide along the y axis. In the other two examples, code + units are assumed, for example (0.2, 0.3) requests a plot that has an + x width of 0.2 and a y width of 0.3 in code units. If units are + provided the resulting plot axis labels will use the supplied units. + image_res : an int or 2-tuple of ints + Specify the resolution of the resulting image. + north_vector : a sequence of floats + A vector defining the 'up' direction in the plot. This + option sets the orientation of the slicing plane. If not + set, an arbitrary grid-aligned north-vector is chosen. + """ + def __init__(self, ds, normal, fields, center='c', width=None, + image_res=512, north_vector=None): + fields = ensure_list(fields) + center, dcenter = ds.coordinates.sanitize_center(center, 4) + cut = ds.cutting(normal, center, north_vector=north_vector) + center = ds.arr([0.0] * 2, 'code_length') + w, frb = construct_image(ds, normal, cut, center, width=width, + image_res=image_res) + super(FITSOffAxisSlice, self).__init__(frb, fields=fields, wcs=w) + + +class FITSOffAxisProjection(FITSImageData): + r""" + Generate a FITSImageData of an off-axis projection. + + Parameters + ---------- + ds : :class:`~yt.data_objects.static_output.Dataset` + This is the dataset object corresponding to the + simulation output to be plotted. + normal : a sequence of floats + The vector normal to the projection plane. + fields : string, list of strings + The name of the field(s) to be plotted. + center : A sequence of floats, a string, or a tuple. + The coordinate of the center of the image. If set to 'c', 'center' or + left blank, the plot is centered on the middle of the domain. If set + to 'max' or 'm', the center will be located at the maximum of the + ('gas', 'density') field. Centering on the max or min of a specific + field is supported by providing a tuple such as ("min","temperature") + or ("max","dark_matter_density"). Units can be specified by passing in + *center* as a tuple containing a coordinate and string unit name or by + passing in a YTArray. If a list or unitless array is supplied, code + units are assumed. + width : tuple or a float. + Width can have four different formats to support windows with variable + x and y widths. They are: + + ================================== ======================= + format example + ================================== ======================= + (float, string) (10,'kpc') + ((float, string), (float, string)) ((10,'kpc'),(15,'kpc')) + float 0.2 + (float, float) (0.2, 0.3) + ================================== ======================= + + For example, (10, 'kpc') requests a plot window that is 10 kiloparsecs + wide in the x and y directions, ((10,'kpc'),(15,'kpc')) requests a + window that is 10 kiloparsecs wide along the x axis and 15 + kiloparsecs wide along the y axis. In the other two examples, code + units are assumed, for example (0.2, 0.3) requests a plot that has an + x width of 0.2 and a y width of 0.3 in code units. If units are + provided the resulting plot axis labels will use the supplied units. + depth : A tuple or a float + A tuple containing the depth to project through and the string + key of the unit: (width, 'unit'). If set to a float, code units + are assumed + weight_field : string + The name of the weighting field. Set to None for no weight. + image_res : an int or 2-tuple of ints + Specify the resolution of the resulting image. + north_vector : a sequence of floats + A vector defining the 'up' direction in the plot. This + option sets the orientation of the slicing plane. If not + set, an arbitrary grid-aligned north-vector is chosen. + method : string + The method of projection. Valid methods are: + + "integrate" with no weight_field specified : integrate the requested + field along the line of sight. + + "integrate" with a weight_field specified : weight the requested + field by the weighting field and integrate along the line of sight. + + "sum" : This method is the same as integrate, except that it does not + multiply by a path length when performing the integration, and is + just a straight summation of the field along the given axis. WARNING: + This should only be used for uniform resolution grid datasets, as other + datasets may result in unphysical images. + data_source : yt.data_objects.data_containers.YTSelectionContainer, optional + If specified, this will be the data source used for selecting regions + to project. + """ + def __init__(self, ds, normal, fields, center='c', width=(1.0, 'unitary'), + weight_field=None, image_res=512, data_source=None, + north_vector=None, depth=(1.0, "unitary"), method='integrate'): + fields = ensure_list(fields) + center, dcenter = ds.coordinates.sanitize_center(center, 4) + buf = {} + width = ds.coordinates.sanitize_width(normal, width, depth) + wd = tuple(el.in_units('code_length').v for el in width) + if not iterable(image_res): + image_res = (image_res, image_res) + res = (image_res[0], image_res[1]) + if data_source is None: + source = ds + else: + source = data_source + for field in fields: + buf[field] = off_axis_projection(source, center, normal, wd, + res, field, north_vector=north_vector, + method=method, weight=weight_field).swapaxes(0,1) + center = ds.arr([0.0] * 2, 'code_length') + w, not_an_frb = construct_image(ds, normal, buf, center, width=width, image_res=image_res) + super(FITSOffAxisProjection, self).__init__(buf, fields=fields, wcs=w) diff -Nru yt-3.3.3/yt/visualization/fixed_resolution_filters.py yt-3.4.0/yt/visualization/fixed_resolution_filters.py --- yt-3.3.3/yt/visualization/fixed_resolution_filters.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/fixed_resolution_filters.py 2017-08-10 17:56:56.000000000 +0000 @@ -64,7 +64,7 @@ def apply(self, buff): from yt.utilities.on_demand_imports import _scipy - hnbeam = self.nbeam / 2 + hnbeam = self.nbeam // 2 sigma = self.sigma l = np.linspace(-hnbeam, hnbeam, num=self.nbeam + 1) diff -Nru yt-3.3.3/yt/visualization/fixed_resolution.py yt-3.4.0/yt/visualization/fixed_resolution.py --- yt-3.3.3/yt/visualization/fixed_resolution.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/fixed_resolution.py 2017-08-10 18:02:57.000000000 +0000 @@ -18,18 +18,18 @@ from yt.funcs import \ get_output_filename, \ mylog, \ - ensure_list + ensure_list, \ + deprecate from .volume_rendering.api import off_axis_projection from .fixed_resolution_filters import apply_filter, filter_registry from yt.data_objects.image_array import ImageArray from yt.utilities.lib.pixelization_routines import \ - pixelize_cylinder, pixelize_off_axis_cartesian + pixelize_cylinder from yt.utilities.lib.api import add_points_to_greyscale_image from yt.frontends.stream.api import load_uniform_grid import numpy as np import weakref -import re import types class FixedResolutionBuffer(object): @@ -51,9 +51,8 @@ Parameters ---------- data_source : :class:`yt.data_objects.construction_data_containers.YTQuadTreeProj` or :class:`yt.data_objects.selection_data_containers.YTSlice` - This is the source to be pixelized, which can be a projection or a - slice. (For cutting planes, see - `yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer`.) + This is the source to be pixelized, which can be a projection, slice or + cutting plane. bounds : sequence of floats Bounds are the min and max in the image plane that we want our image to cover. It's in the order of (xmin, xmax, ymin, ymax), @@ -67,12 +66,6 @@ This can be true or false, and governs whether the pixelization will span the domain boundaries. - See Also - -------- - :class:`yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer` : A similar object, - used for cutting - planes. - Examples -------- To make a projection and then several images, you can generate a @@ -161,38 +154,6 @@ if f not in exclude and f[0] not in self.data_source.ds.particle_types: self[f] - def _is_ion( self, fname ): - p = re.compile("_p[0-9]+_") - result = False - if p.search( fname ) is not None: - result = True - return result - - def _ion_to_label( self, fname ): - pnum2rom = { - "0":"I", "1":"II", "2":"III", "3":"IV", "4":"V", - "5":"VI", "6":"VII", "7":"VIII", "8":"IX", "9":"X", - "10":"XI", "11":"XII", "12":"XIII", "13":"XIV", "14":"XV", - "15":"XVI", "16":"XVII", "17":"XVIII", "18":"XIX", "19":"XX"} - - p = re.compile("_p[0-9]+_") - m = p.search( fname ) - if m is not None: - pstr = m.string[m.start()+1:m.end()-1] - segments = fname.split("_") - for i,s in enumerate(segments): - segments[i] = s.capitalize() - if s == pstr: - ipstr = i - element = segments[ipstr-1] - roman = pnum2rom[pstr[1:]] - label = element + '\ ' + roman + '\ ' + \ - '\ '.join(segments[ipstr+1:]) - else: - label = fname - return label - - def _get_info(self, item): info = {} ftype, fname = field = self.data_source._determine_fields(item)[0] @@ -216,18 +177,7 @@ except AttributeError: pass - info['label'] = finfo.display_name - if info['label'] is None: - if self._is_ion( fname ): - fname = self._ion_to_label( fname ) - info['label'] = r'$\rm{'+fname+r'}$' - info['label'] = r'$\rm{'+fname.replace('_','\ ')+r'}$' - else: - info['label'] = r'$\rm{'+fname+r'}$' - info['label'] = r'$\rm{'+fname.replace('_','\ ').title()+r'}$' - elif info['label'].find('$') == -1: - info['label'] = info['label'].replace(' ','\ ') - info['label'] = r'$\rm{'+info['label']+r'}$' + info['label'] = finfo.get_latex_display_name() return info @@ -288,6 +238,44 @@ dpy = (self.bounds[3]-self.bounds[2])/self.buff_size[1] return distance/dpy + def set_unit(self, field, unit, equivalency=None, equivalency_kwargs=None): + """Sets a new unit for the requested field + + parameters + ---------- + field : string or field tuple + The name of the field that is to be changed. + + unit : string or Unit object + The name of the new unit. + + equivalency : string, optional + If set, the equivalency to use to convert the current units to + the new requested unit. If None, the unit conversion will be done + without an equivelancy + + equivalency_kwargs : string, optional + Keyword arguments to be passed to the equivalency. Only used if + ``equivalency`` is set. + """ + if equivalency_kwargs is None: + equivalency_kwargs = {} + field = self.data_source._determine_fields(field)[0] + if equivalency is None: + self[field].convert_to_units(unit) + else: + equiv_array = self[field].to_equivalent( + unit, equivalency, **equivalency_kwargs) + # equiv_array isn't necessarily an ImageArray. This is an issue + # inherent to the way the unit system handles YTArray + # sublcasses and I don't see how to modify the unit system to + # fix this. Instead, we paper over this issue and hard code + # that equiv_array is an ImageArray + self[field] = ImageArray( + equiv_array, equiv_array.units, equiv_array.units.registry, + self[field].info) + + def export_hdf5(self, filename, fields = None): r"""Export a set of fields to a set of HDF5 datasets. @@ -330,7 +318,7 @@ the length units that the coordinates are written in, default 'cm'. """ - from yt.utilities.fits_image import FITSImageData + from yt.visualization.fits_image import FITSImageData if fields is None: fields = list(self.data.keys()) @@ -494,6 +482,11 @@ self.__dict__['apply_' + filtername] = \ types.MethodType(filt, self) +class ObliqueFixedResolutionBuffer(FixedResolutionBuffer): + @deprecate("FixedResolutionBuffer") + def __init__(self, *args, **kwargs): + super(ObliqueFixedResolutionBuffer, self).__init__(*args, **kwargs) + class CylindricalFixedResolutionBuffer(FixedResolutionBuffer): """ This object is a subclass of @@ -515,41 +508,13 @@ def __getitem__(self, item) : if item in self.data: return self.data[item] - buff = pixelize_cylinder(self.data_source["r"], self.data_source["dr"], - self.data_source["theta"], self.data_source["dtheta"], - self.buff_size, self.data_source[item].astype("float64"), - self.radius) + buff = np.zeros(self.buff_size, dtype="f8") + pixelize_cylinder(buff, self.data_source["r"], self.data_source["dr"], + self.data_source["theta"], self.data_source["dtheta"], + self.data_source[item].astype("float64"), self.radius) self[item] = buff return buff -class ObliqueFixedResolutionBuffer(FixedResolutionBuffer): - """ - This object is a subclass of - :class:`yt.visualization.fixed_resolution.FixedResolutionBuffer` - that supports non-aligned input data objects, primarily cutting planes. - """ - def __getitem__(self, item): - if item in self.data: return self.data[item] - indices = np.argsort(self.data_source['dx'])[::-1] - bounds = [] - for b in self.bounds: - if hasattr(b, "in_units"): - b = float(b.in_units("code_length")) - bounds.append(b) - buff = pixelize_off_axis_cartesian( - self.data_source['x'], self.data_source['y'], self.data_source['z'], - self.data_source['px'], self.data_source['py'], - self.data_source['pdx'], self.data_source['pdy'], self.data_source['pdz'], - self.data_source.center, self.data_source._inv_mat, indices, - self.data_source[item], - self.buff_size[0], self.buff_size[1], - bounds).transpose() - ia = ImageArray(buff, input_units=self.data_source[item].units, - info=self._get_info(item)) - self[item] = ia - return ia - - class OffAxisProjectionFixedResolutionBuffer(FixedResolutionBuffer): """ This object is a subclass of @@ -639,24 +604,31 @@ # splat particles buff = np.zeros(self.buff_size) + buff_mask = np.zeros(self.buff_size).astype('int') add_points_to_greyscale_image(buff, + buff_mask, px[mask], py[mask], splat_vals) + # remove values in no-particle region + buff[buff_mask==0] = np.nan ia = ImageArray(buff, input_units=data.units, info=self._get_info(item)) # divide by the weight_field, if needed if weight_field is not None: weight_buff = np.zeros(self.buff_size) + weight_buff_mask = np.zeros(self.buff_size).astype('int') add_points_to_greyscale_image(weight_buff, + weight_buff_mask, px[mask], py[mask], weight_data[mask]) weight_array = ImageArray(weight_buff, input_units=weight_data.units, info=self._get_info(item)) - + # remove values in no-particle region + weight_buff[weight_buff_mask==0] = np.nan locs = np.where(weight_array > 0) ia[locs] /= weight_array[locs] diff -Nru yt-3.3.3/yt/visualization/image_writer.py yt-3.4.0/yt/visualization/image_writer.py --- yt-3.3.3/yt/visualization/image_writer.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/image_writer.py 2017-08-10 18:02:57.000000000 +0000 @@ -407,8 +407,6 @@ if colorbar_label: cbar.ax.set_ylabel(colorbar_label) - fig.tight_layout() - suffix = get_image_suffix(filename) if suffix == '': @@ -425,6 +423,8 @@ mylog.warning("Unknown suffix %s, defaulting to Agg", suffix) canvas = FigureCanvasAgg(fig) + fig.tight_layout() + canvas.print_figure(filename, dpi=dpi) return filename diff -Nru yt-3.3.3/yt/visualization/line_plot.py yt-3.4.0/yt/visualization/line_plot.py --- yt-3.3.3/yt/visualization/line_plot.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/visualization/line_plot.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,449 @@ +""" +A mechanism for plotting field values along a line through a dataset + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import numpy as np + +from collections import defaultdict +from yt.funcs import \ + iterable, \ + mylog +from yt.units.unit_object import \ + Unit +from yt.units.yt_array import \ + YTArray +from yt.visualization.base_plot_types import \ + PlotMPL +from yt.visualization.plot_container import \ + PlotContainer, \ + PlotDictionary, \ + log_transform, \ + linear_transform, \ + invalidate_plot + +class LineBuffer(object): + r""" + LineBuffer(ds, start_point, end_point, npoints, label = None) + + This takes a data source and implements a protocol for generating a + 'pixelized', fixed-resolution line buffer. In other words, LineBuffer + takes a starting point, ending point, and number of sampling points and + can subsequently generate YTArrays of field values along the sample points. + + Parameters + ---------- + ds : :class:`yt.data_objects.static_output.Dataset` + This is the dataset object holding the data that can be sampled by the + LineBuffer + start_point : n-element list, tuple, ndarray, or YTArray + Contains the coordinates of the first point for constructing the LineBuffer. + Must contain n elements where n is the dimensionality of the dataset. + end_point : n-element list, tuple, ndarray, or YTArray + Contains the coordinates of the first point for constructing the LineBuffer. + Must contain n elements where n is the dimensionality of the dataset. + npoints : int + How many points to sample between start_point and end_point + + Examples + -------- + >>> lb = yt.LineBuffer(ds, (.25, 0, 0), (.25, 1, 0), 100) + >>> lb[('all', 'u')].max() + 0.11562424257143075 dimensionless + + """ + def __init__(self, ds, start_point, end_point, npoints, label=None): + self.ds = ds + self.start_point = _validate_point(start_point, ds, start=True) + self.end_point = _validate_point(end_point, ds) + self.npoints = npoints + self.label = label + self.data = {} + + def keys(self): + return self.data.keys() + + def __setitem__(self, item, val): + self.data[item] = val + + def __getitem__(self, item): + if item in self.data: return self.data[item] + mylog.info("Making a line buffer with %d points of %s" % \ + (self.npoints, item)) + self.points, self.data[item] = self.ds.coordinates.pixelize_line(item, + self.start_point, + self.end_point, + self.npoints) + + return self.data[item] + + def __delitem__(self, item): + del self.data[item] + + +class LinePlotDictionary(PlotDictionary): + def __init__(self, data_source): + super(LinePlotDictionary, self).__init__(data_source) + self.known_dimensions = {} + + def _sanitize_dimensions(self, item): + field = self.data_source._determine_fields(item)[0] + finfo = self.data_source.ds.field_info[field] + dimensions = Unit( + finfo.units, registry=self.data_source.ds.unit_registry).dimensions + if dimensions not in self.known_dimensions: + self.known_dimensions[dimensions] = item + ret_item = item + else: + ret_item = self.known_dimensions[dimensions] + return ret_item + + def __getitem__(self, item): + ret_item = self._sanitize_dimensions(item) + return super(LinePlotDictionary, self).__getitem__(ret_item) + + def __setitem__(self, item, value): + ret_item = self._sanitize_dimensions(item) + super(LinePlotDictionary, self).__setitem__(ret_item, value) + + def __contains__(self, item): + ret_item = self._sanitize_dimensions(item) + return super(LinePlotDictionary, self).__contains__(ret_item) + +class LinePlot(PlotContainer): + r""" + A class for constructing line plots + + Parameters + ---------- + + ds : :class:`yt.data_objects.static_output.Dataset` + This is the dataset object corresponding to the + simulation output to be plotted. + fields : string / tuple, or list of strings / tuples + The name(s) of the field(s) to be plotted. + start_point : n-element list, tuple, ndarray, or YTArray + Contains the coordinates of the first point for constructing the line. + Must contain n elements where n is the dimensionality of the dataset. + end_point : n-element list, tuple, ndarray, or YTArray + Contains the coordinates of the first point for constructing the line. + Must contain n elements where n is the dimensionality of the dataset. + npoints : int + How many points to sample between start_point and end_point for + constructing the line plot + figure_size : int or two-element iterable of ints + Size in inches of the image. + Default: 5 (5x5) + fontsize : int + Font size for all text in the plot. + Default: 14 + field_labels : dictionary + Keys should be the field names. Values should be latex-formattable + strings used in the LinePlot legend + Default: None + + + Example + ------- + + >>> import yt + >>> + >>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030') + >>> + >>> plot = yt.LinePlot(ds, 'density', [0, 0, 0], [1, 1, 1], 512) + >>> plot.add_legend('density') + >>> plot.set_x_unit('cm') + >>> plot.set_unit('density', 'kg/cm**3') + >>> plot.save() + + """ + _plot_type = 'line_plot' + + def __init__(self, ds, fields, start_point, end_point, npoints, + figure_size=5., fontsize=14., field_labels=None): + """ + Sets up figure and axes + """ + line = LineBuffer(ds, start_point, end_point, npoints, label=None) + self.lines = [line] + self._initialize_instance(self, ds, fields, figure_size, + fontsize, field_labels) + self._setup_plots() + + @classmethod + def _initialize_instance(cls, obj, ds, fields, figure_size=5., fontsize=14., + field_labels=None): + obj._x_unit = None + obj._y_units = {} + obj._titles = {} + + data_source = ds.all_data() + + obj.fields = data_source._determine_fields(fields) + obj.plots = LinePlotDictionary(data_source) + obj.include_legend = defaultdict(bool) + super(LinePlot, obj).__init__(data_source, figure_size, fontsize) + for f in obj.fields: + finfo = obj.data_source.ds._get_field_info(*f) + if finfo.take_log: + obj._field_transform[f] = log_transform + else: + obj._field_transform[f] = linear_transform + + if field_labels is None: + obj.field_labels = {} + else: + obj.field_labels = field_labels + for f in obj.fields: + if f not in obj.field_labels: + obj.field_labels[f] = f[1] + + @classmethod + def from_lines(cls, ds, fields, lines, figure_size=5., font_size=14., field_labels=None): + """ + A class method for constructing a line plot from multiple sampling lines + + Parameters + ---------- + + ds : :class:`yt.data_objects.static_output.Dataset` + This is the dataset object corresponding to the + simulation output to be plotted. + fields : field name or list of field names + The name(s) of the field(s) to be plotted. + lines : list of :class:`yt.visualization.line_plot.LineBuffer` instances + The lines from which to sample data + figure_size : int or two-element iterable of ints + Size in inches of the image. + Default: 5 (5x5) + fontsize : int + Font size for all text in the plot. + Default: 14 + field_labels : dictionary + Keys should be the field names. Values should be latex-formattable + strings used in the LinePlot legend + Default: None + + Example + -------- + >>> ds = yt.load('SecondOrderTris/RZ_p_no_parts_do_nothing_bcs_cone_out.e', step=-1) + >>> fields = [field for field in ds.field_list if field[0] == 'all'] + >>> lines = [] + >>> lines.append(yt.LineBuffer(ds, [0.25, 0, 0], [0.25, 1, 0], 100, label='x = 0.25')) + >>> lines.append(yt.LineBuffer(ds, [0.5, 0, 0], [0.5, 1, 0], 100, label='x = 0.5')) + >>> plot = yt.LinePlot.from_lines(ds, fields, lines) + >>> plot.save() + + """ + obj = cls.__new__(cls) + obj.lines = lines + cls._initialize_instance(obj, ds, fields, figure_size, font_size, field_labels) + obj._setup_plots() + return obj + + def _get_plot_instance(self, field): + fontscale = self._font_properties._size / 14. + top_buff_size = 0.35*fontscale + + x_axis_size = 1.35*fontscale + y_axis_size = 0.7*fontscale + right_buff_size = 0.2*fontscale + + if iterable(self.figure_size): + figure_size = self.figure_size + else: + figure_size = (self.figure_size, self.figure_size) + + xbins = np.array([x_axis_size, figure_size[0], + right_buff_size]) + ybins = np.array([y_axis_size, figure_size[1], top_buff_size]) + + size = [xbins.sum(), ybins.sum()] + + x_frac_widths = xbins/size[0] + y_frac_widths = ybins/size[1] + + axrect = ( + x_frac_widths[0], + y_frac_widths[0], + x_frac_widths[1], + y_frac_widths[1], + ) + + try: + plot = self.plots[field] + except KeyError: + plot = PlotMPL(self.figure_size, axrect, None, None) + self.plots[field] = plot + return plot + + def _setup_plots(self): + if self._plot_valid is True: + return + for plot in self.plots.values(): + plot.axes.cla() + for line in self.lines: + dimensions_counter = defaultdict(int) + for field in self.fields: + finfo = self.ds.field_info[field] + dimensions = Unit(finfo.units, + registry=self.ds.unit_registry).dimensions + dimensions_counter[dimensions] += 1 + for field in self.fields: + # get plot instance + plot = self._get_plot_instance(field) + + # calculate x and y + x, y = self.ds.coordinates.pixelize_line( + field, line.start_point, line.end_point, line.npoints) + + # scale x and y to proper units + if self._x_unit is None: + unit_x = x.units + else: + unit_x = self._x_unit + + if field in self._y_units: + unit_y = self._y_units[field] + else: + unit_y = y.units + + x = x.to(unit_x) + y = y.to(unit_y) + + # determine legend label + str_seq = [] + str_seq.append(line.label) + str_seq.append(self.field_labels[field]) + delim = "; " + legend_label = delim.join(filter(None, str_seq)) + + # apply plot to matplotlib axes + plot.axes.plot(x, y, label=legend_label) + + # apply log transforms if requested + if self._field_transform[field] != linear_transform: + if (y < 0).any(): + plot.axes.set_yscale('symlog') + else: + plot.axes.set_yscale('log') + + # set font properties + plot._set_font_properties(self._font_properties, None) + + # set x and y axis labels + axes_unit_labels = self._get_axes_unit_labels(unit_x, unit_y) + + if self._xlabel is not None: + x_label = self._xlabel + else: + x_label = r'$\rm{Path\ Length' + axes_unit_labels[0]+'}$' + + if self._ylabel is not None: + y_label = self._ylabel + else: + finfo = self.ds.field_info[field] + dimensions = Unit(finfo.units, + registry=self.ds.unit_registry).dimensions + if dimensions_counter[dimensions] > 1: + y_label = (r'$\rm{Multiple\ Fields}$' + r'$\rm{' + + axes_unit_labels[1]+'}$') + else: + y_label = (finfo.get_latex_display_name() + r'$\rm{' + + axes_unit_labels[1]+'}$') + + plot.axes.set_xlabel(x_label) + plot.axes.set_ylabel(y_label) + + # apply title + if field in self._titles: + plot.axes.set_title(self._titles[field]) + + # apply legend + dim_field = self.plots._sanitize_dimensions(field) + if self.include_legend[dim_field]: + plot.axes.legend() + + self._plot_valid = True + + + @invalidate_plot + def annotate_legend(self, field): + """ + Adds a legend to the `LinePlot` instance. The `_sanitize_dimensions` + call ensures that a legend label will be added for every field of + a multi-field plot + """ + dim_field = self.plots._sanitize_dimensions(field) + self.include_legend[dim_field] = True + + @invalidate_plot + def set_x_unit(self, unit_name): + """Set the unit to use along the x-axis + + Parameters + ---------- + unit_name: str + The name of the unit to use for the x-axis unit + """ + self._x_unit = unit_name + + @invalidate_plot + def set_unit(self, field, unit_name): + """Set the unit used to plot the field + + Parameters + ---------- + field: str or field tuple + The name of the field to set the units for + unit_name: str + The name of the unit to use for this field + """ + self._y_units[self.data_source._determine_fields(field)[0]] = unit_name + + @invalidate_plot + def annotate_title(self, field, title): + """Set the unit used to plot the field + + Parameters + ---------- + field: str or field tuple + The name of the field to set the units for + title: str + The title to use for the plot + """ + self._titles[self.data_source._determine_fields(field)[0]] = title + +def _validate_point(point, ds, start=False): + if not iterable(point): + raise RuntimeError( + "Input point must be array-like" + ) + if not isinstance(point, YTArray): + point = ds.arr(point, 'code_length') + if len(point.shape) != 1: + raise RuntimeError( + "Input point must be a 1D array" + ) + if point.shape[0] < ds.dimensionality: + raise RuntimeError( + "Input point must have an element for each dimension" + ) + # need to pad to 3D elements to avoid issues later + if point.shape[0] < 3: + if start: + val = 0 + else: + val = 1 + point = np.append(point.d, [val]*(3-ds.dimensionality))*point.uq + return point diff -Nru yt-3.3.3/yt/visualization/particle_plots.py yt-3.4.0/yt/visualization/particle_plots.py --- yt-3.3.3/yt/visualization/particle_plots.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/particle_plots.py 2017-08-10 18:02:57.000000000 +0000 @@ -175,6 +175,11 @@ field_parameters : dictionary A dictionary of field parameters than can be accessed by derived fields. + window_size : float + The size of the window on the longest axis (in units of inches), + including the margins but not the colorbar. + aspect : float + The aspect ratio of the plot. Set to None for 1. data_source : YTSelectionContainer Object Object to be used for data selection. Defaults to a region covering the entire simulation. @@ -342,8 +347,8 @@ figure_size) -def ParticlePlot(ds, x_field, y_field, z_fields=None, color='b', *args, ** - kwargs): +def ParticlePlot(ds, x_field, y_field, z_fields=None, color='b', *args, + **kwargs): r""" A factory function for :class:`yt.visualization.particle_plots.ParticleProjectionPlot` @@ -352,18 +357,20 @@ plots, the distinction being determined by the fields passed in. If the x_field and y_field combination corresponds to a valid, right-handed - spatial plot, an 'ParticleProjectionPlot` will be returned. This plot + spatial plot, an ``ParticleProjectionPlot`` will be returned. This plot object can be updated using one of the many helper functions defined in - PlotWindow. + ``PlotWindow``. If the x_field and y_field combo do not correspond to a valid - 'ParticleProjectionPlot`, then a `ParticlePhasePlot`. This object can be - modified by its own set of helper functions defined in PhasePlot. + ``ParticleProjectionPlot``, then a ``ParticlePhasePlot``. This object can be + modified by its own set of helper functions defined in PhasePlot. We note + below which arguments are only accepted by ``ParticleProjectionPlot`` and + which arguments are only accepted by ``ParticlePhasePlot``. Parameters ---------- - ds : :class:`yt.data_objects.api.Dataset` + ds : :class:`yt.data_objects.static_output.Dataset` This is the dataset object corresponding to the simulation output to be plotted. x_field : string @@ -381,6 +388,103 @@ The color that will indicate the particle locations on the plot. This argument is ignored if z_fields is not None. Default is 'b'. + weight_field : string + The name of the weighting field. Set to None for no weight. + fontsize : integer + The size of the fonts for the axis, colorbar, and tick labels. + data_source : YTSelectionContainer Object + Object to be used for data selection. Defaults to a region covering + the entire simulation. + center : A sequence of floats, a string, or a tuple. + The coordinate of the center of the image. If set to 'c', 'center' or + left blank, the plot is centered on the middle of the domain. If set to + 'max' or 'm', the center will be located at the maximum of the + ('gas', 'density') field. Centering on the max or min of a specific + field is supported by providing a tuple such as ("min","temperature") or + ("max","dark_matter_density"). Units can be specified by passing in *center* + as a tuple containing a coordinate and string unit name or by passing + in a YTArray. If a list or unitless array is supplied, code units are + assumed. This argument is only accepted by ``ParticleProjectionPlot``. + width : tuple or a float. + Width can have four different formats to support windows with variable + x and y widths. They are: + + ================================== ======================= + format example + ================================== ======================= + (float, string) (10,'kpc') + ((float, string), (float, string)) ((10,'kpc'),(15,'kpc')) + float 0.2 + (float, float) (0.2, 0.3) + ================================== ======================= + + For example, (10, 'kpc') requests a plot window that is 10 kiloparsecs + wide in the x and y directions, ((10,'kpc'),(15,'kpc')) requests a + window that is 10 kiloparsecs wide along the x axis and 15 + kiloparsecs wide along the y axis. In the other two examples, code + units are assumed, for example (0.2, 0.3) requests a plot that has an + x width of 0.2 and a y width of 0.3 in code units. If units are + provided the resulting plot axis labels will use the supplied units. + This argument is only accepted by ``ParticleProjectionPlot``. + depth : A tuple or a float + A tuple containing the depth to project through and the string + key of the unit: (width, 'unit'). If set to a float, code units + are assumed. Defaults to the entire domain. This argument is only + accepted by ``ParticleProjectionPlot``. + axes_unit : A string + The name of the unit for the tick labels on the x and y axes. + Defaults to None, which automatically picks an appropriate unit. + If axes_unit is '1', 'u', or 'unitary', it will not display the + units, and only show the axes name. + origin : string or length 1, 2, or 3 sequence of strings + The location of the origin of the plot coordinate system. This is + represented by '-' separated string or a tuple of strings. In the + first index the y-location is given by 'lower', 'upper', or 'center'. + The second index is the x-location, given as 'left', 'right', or + 'center'. Finally, the whether the origin is applied in 'domain' + space, plot 'window' space or 'native' simulation coordinate system + is given. For example, both 'upper-right-domain' and ['upper', + 'right', 'domain'] both place the origin in the upper right hand + corner of domain space. If x or y are not given, a value is inffered. + For instance, 'left-domain' corresponds to the lower-left hand corner + of the simulation domain, 'center-domain' corresponds to the center + of the simulation domain, or 'center-window' for the center of the + plot window. Further examples: + + ================================== ============================ + format example + ================================== ============================ + '{space}' 'domain' + '{xloc}-{space}' 'left-window' + '{yloc}-{space}' 'upper-domain' + '{yloc}-{xloc}-{space}' 'lower-right-window' + ('{space}',) ('window',) + ('{xloc}', '{space}') ('right', 'domain') + ('{yloc}', '{space}') ('lower', 'window') + ('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window') + ================================== ============================ + + This argument is only accepted by ``ParticleProjectionPlot``. + window_size : float + The size of the window on the longest axis (in units of inches), + including the margins but not the colorbar. This argument is only + accepted by ``ParticleProjectionPlot``. + aspect : float + The aspect ratio of the plot. Set to None for 1. This argument is + only accepted by ``ParticleProjectionPlot``. + x_bins : int + The number of bins in x field for the mesh. Defaults to 800. This + argument is only accepted by ``ParticlePhasePlot``. + y_bins : int + The number of bins in y field for the mesh. Defaults to 800. This + argument is only accepted by ``ParticlePhasePlot``. + deposition : str + Either 'ngp' or 'cic'. Controls what type of interpolation will be + used to deposit the particle z_fields onto the mesh. Defaults to 'ngp'. + This argument is only accepted by ``ParticlePhasePlot``. + figure_size : int + Size in inches of the image. Defaults to 8 (product an 8x8 inch figure). + This argument is only accepted by ``ParticlePhasePlot``. Examples -------- @@ -394,10 +498,11 @@ ... color='g') """ - - ad = ds.all_data() - x_field = ad._determine_fields(x_field)[0] - y_field = ad._determine_fields(y_field)[0] + dd = kwargs.get('data_source', None) + if dd is None: + dd = ds.all_data() + x_field = dd._determine_fields(x_field)[0] + y_field = dd._determine_fields(y_field)[0] direction = 3 # try potential axes for a ParticleProjectionPlot: @@ -419,5 +524,5 @@ # Does not correspond to any valid PlotWindow-style plot, # use ParticlePhasePlot instead else: - return ParticlePhasePlot(ad, x_field, y_field, + return ParticlePhasePlot(dd, x_field, y_field, z_fields, color, *args, **kwargs) diff -Nru yt-3.3.3/yt/visualization/plot_container.py yt-3.4.0/yt/visualization/plot_container.py --- yt-3.3.3/yt/visualization/plot_container.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/plot_container.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,14 +13,16 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- from yt.extern.six.moves import builtins -from yt.extern.six import iteritems +from yt.extern.six import \ + iteritems, \ + string_types import base64 -import errno import numpy as np import matplotlib import os +from distutils.version import LooseVersion from collections import defaultdict from functools import wraps @@ -28,12 +30,23 @@ from yt.config import \ ytcfg +from yt.data_objects.time_series import \ + DatasetSeries from yt.funcs import \ get_image_suffix, \ - get_ipython_api_version, iterable, \ + iterable, \ + ensure_dir, \ ensure_list +from yt.units.unit_lookup_table import \ + prefixable_units, latex_prefixes +from yt.units.unit_object import \ + Unit +from yt.utilities.definitions import \ + formatted_length_unit_names from yt.utilities.exceptions import \ YTNotInsideNotebook +from yt.visualization.color_maps import \ + yt_colormaps def invalidate_data(f): @wraps(f) @@ -72,6 +85,9 @@ if hasattr(args[0], '_data_valid'): if not args[0]._data_valid: args[0]._recreate_frb() + if hasattr(args[0], '_profile_valid'): + if not args[0]._profile_valid: + args[0]._recreate_profile() if not args[0]._plot_valid: # it is the responsibility of _setup_plots to # call args[0].run_callbacks() @@ -126,11 +142,15 @@ the maximum value in the colorbar """ - if vmin >= 0 or vmax <= 0: + if vmin > 0 or vmax < 0: return get_log_minorticks(vmin, vmax) + elif vmin == 0: + return np.hstack((0, get_log_minorticks(linthresh, vmax))) + elif vmax == 0: + return np.hstack((-get_log_minorticks(linthresh,-vmin)[::-1], 0) ) else: - return np.hstack( (-get_log_minorticks(linthresh,-vmin)[::-1], 0, - get_log_minorticks(linthresh, vmax)) ) + return np.hstack((-get_log_minorticks(linthresh,-vmin)[::-1], 0, + get_log_minorticks(linthresh, vmax))) field_transforms = {} @@ -173,36 +193,27 @@ self.data_source = data_source return defaultdict.__init__(self, default_factory) -class ImagePlotContainer(object): - """A container for plots with colorbars. - - """ +class PlotContainer(object): + """A container for generic plots""" _plot_type = None _plot_valid = False - _colorbar_valid = False def __init__(self, data_source, figure_size, fontsize): from matplotlib.font_manager import FontProperties - self.data_source = data_source + self.ds = data_source.ds + self.ts = self._initialize_dataset(self.ds) if iterable(figure_size): self.figure_size = float(figure_size[0]), float(figure_size[1]) else: self.figure_size = float(figure_size) - self.plots = PlotDictionary(data_source) - self._callbacks = [] - self._field_transform = {} - self._colormaps = defaultdict( - lambda: ytcfg.get("yt", "default_colormap")) font_path = matplotlib.get_data_path() + '/fonts/ttf/STIXGeneral.ttf' self._font_properties = FontProperties(size=fontsize, fname=font_path) self._font_color = None self._xlabel = None self._ylabel = None self._minorticks = {} - self._cbar_minorticks = {} - self._colorbar_label = PlotDictionary( - self.data_source, lambda: None) + self._field_transform = {} @invalidate_plot def set_log(self, field, log, linthresh=None): @@ -225,10 +236,10 @@ for field in self.data_source._determine_fields(fields): if log: if linthresh is not None: - if not linthresh > 0.: + if not linthresh > 0.: raise ValueError('\"linthresh\" must be positive') self._field_transform[field] = symlog_transform - self._field_transform[field].func = linthresh + self._field_transform[field].func = linthresh else: self._field_transform[field] = log_transform else: @@ -265,79 +276,6 @@ return self @invalidate_plot - def set_cmap(self, field, cmap): - """set the colormap for one of the fields - - Parameters - ---------- - field : string - the field to set the colormap - if field == 'all', applies to all plots. - cmap : string or tuple - If a string, will be interpreted as name of the colormap. - If a tuple, it is assumed to be of the form (name, type, number) - to be used for palettable functionality. (name, type, number, bool) - can be used to specify if a reverse colormap is to be used. - - """ - - if field == 'all': - fields = list(self.plots.keys()) - else: - fields = [field] - for field in self.data_source._determine_fields(fields): - self._colorbar_valid = False - self._colormaps[field] = cmap - return self - - @invalidate_plot - def set_zlim(self, field, zmin, zmax, dynamic_range=None): - """set the scale of the colormap - - Parameters - ---------- - field : string - the field to set a colormap scale - if field == 'all', applies to all plots. - zmin : float - the new minimum of the colormap scale. If 'min', will - set to the minimum value in the current view. - zmax : float - the new maximum of the colormap scale. If 'max', will - set to the maximum value in the current view. - - Other Parameters - ---------------- - dynamic_range : float (default: None) - The dynamic range of the image. - If zmin == None, will set zmin = zmax / dynamic_range - If zmax == None, will set zmax = zmin * dynamic_range - When dynamic_range is specified, defaults to setting - zmin = zmax / dynamic_range. - - """ - if field is 'all': - fields = list(self.plots.keys()) - else: - fields = ensure_list(field) - for field in self.data_source._determine_fields(fields): - myzmin = zmin - myzmax = zmax - if zmin == 'min': - myzmin = self.plots[field].image._A.min() - if zmax == 'max': - myzmax = self.plots[field].image._A.max() - if dynamic_range is not None: - if zmax is None: - myzmax = myzmin * dynamic_range - else: - myzmin = myzmax / dynamic_range - - self.plots[field].zmin = myzmin - self.plots[field].zmax = myzmax - return self - - @invalidate_plot def set_minorticks(self, field, state): """turn minor ticks on or off in the current plot @@ -363,36 +301,16 @@ self._minorticks[field] = False return self - @invalidate_plot - def set_cbar_minorticks(self, field, state): - """turn colorbar minor ticks on or off in the current plot - - Displaying minor ticks reduces performance; turn them off - using set_cbar_minorticks('all', 'off') if drawing speed is a problem. - - Parameters - ---------- - field : string - the field to remove colorbar minorticks - state : string - the state indicating 'on' or 'off' - - """ - if field == 'all': - fields = list(self.plots.keys()) - else: - fields = [field] - for field in self.data_source._determine_fields(fields): - if state == 'on': - self._cbar_minorticks[field] = True - else: - self._cbar_minorticks[field] = False - return self - def _setup_plots(self): # Left blank to be overriden in subclasses pass + def _initialize_dataset(self, ts): + if not isinstance(ts, DatasetSeries): + if not iterable(ts): ts = [ts] + ts = DatasetSeries(ts) + return ts + def _switch_ds(self, new_ds, data_source=None): old_object = self.data_source name = old_object._type_name @@ -414,6 +332,8 @@ lim = getattr(self, lim_name) lim = tuple(new_ds.quan(l.value, str(l.units)) for l in lim) setattr(self, lim_name, lim) + self.plots.data_source = new_object + self._colorbar_label.data_source = new_object self._setup_plots() @validate_plot @@ -436,7 +356,7 @@ ---------- font_dict : dict - A dict of keyword parameters to be passed to + A dict of keyword parameters to be passed to :class:`matplotlib.font_manager.FontProperties`. Possible keys include: @@ -541,13 +461,7 @@ name = str(self.ds) name = os.path.expanduser(name) if name[-1] == os.sep and not os.path.isdir(name): - try: - os.mkdir(name) - except OSError as e: - if e.errno == errno.EEXIST: - pass - else: - raise + ensure_dir(name) if os.path.isdir(name) and name != str(self.ds): name = name + (os.sep if name[-1] != os.sep else '') + str(self.ds) if suffix is None: @@ -556,8 +470,11 @@ for k, v in iteritems(self.plots): names.append(v.save(name, mpl_kwargs)) return names - axis = self.ds.coordinates.axis_name.get( - self.data_source.axis, '') + if hasattr(self.data_source, 'axis'): + axis = self.ds.coordinates.axis_name.get( + self.data_source.axis, '') + else: + axis = None weight = None type = self._plot_type if type in ['Projection', 'OffAxisProjection']: @@ -587,21 +504,6 @@ return self @validate_plot - def _send_zmq(self): - from ._mpl_imports import FigureCanvasAgg - try: - # pre-IPython v1.0 - from IPython.zmq.pylab.backend_inline import send_figure as display - except ImportError: - # IPython v1.0+ - from IPython.core.display import display - for k, v in sorted(iteritems(self.plots)): - # Due to a quirk in the matplotlib API, we need to create - # a dummy canvas variable here that is never used. - canvas = FigureCanvasAgg(v.figure) # NOQA - display(v.figure) - - @validate_plot def show(self): r"""This will send any existing plots to the IPython notebook. @@ -620,15 +522,16 @@ >>> slc.show() """ - if "__IPYTHON__" in dir(builtins): - api_version = get_ipython_api_version() - if api_version in ('0.10', '0.11'): - self._send_zmq() - else: + interactivity = self.plots[list(self.plots.keys())[0]].interactivity + if interactivity: + for k,v in sorted(iteritems(self.plots)): + v.show() + else: + if "__IPYTHON__" in dir(builtins): from IPython.display import display display(self) - else: - raise YTNotInsideNotebook + else: + raise YTNotInsideNotebook @validate_plot def display(self, name=None, mpl_kwargs=None): @@ -685,6 +588,211 @@ self._ylabel = label return self + def _get_axes_unit_labels(self, unit_x, unit_y): + axes_unit_labels = ['', ''] + comoving = False + hinv = False + for i, un in enumerate((unit_x, unit_y)): + unn = None + if hasattr(self.data_source, 'axis'): + if hasattr(self.ds.coordinates, "image_units"): + # This *forces* an override + unn = self.ds.coordinates.image_units[ + self.data_source.axis][i] + elif hasattr(self.ds.coordinates, "default_unit_label"): + axax = getattr(self.ds.coordinates, + "%s_axis" % ("xy"[i]))[self.data_source.axis] + unn = self.ds.coordinates.default_unit_label.get( + axax, None) + if unn is not None: + axes_unit_labels[i] = r'\ \ \left('+unn+r'\right)' + continue + # Use sympy to factor h out of the unit. In this context 'un' + # is a string, so we call the Unit constructor. + expr = Unit(un, registry=self.ds.unit_registry).expr + h_expr = Unit('h', registry=self.ds.unit_registry).expr + # See http://docs.sympy.org/latest/modules/core.html#sympy.core.expr.Expr + h_power = expr.as_coeff_exponent(h_expr)[1] + # un is now the original unit, but with h factored out. + un = str(expr*h_expr**(-1*h_power)) + un_unit = Unit(un, registry=self.ds.unit_registry) + cm = Unit('cm').expr + if str(un).endswith('cm') and cm not in un_unit.expr.atoms(): + comoving = True + un = un[:-2] + # no length units besides code_length end in h so this is safe + if h_power == -1: + hinv = True + elif h_power != 0: + # It doesn't make sense to scale a position by anything + # other than h**-1 + raise RuntimeError + if un not in ['1', 'u', 'unitary']: + if un in formatted_length_unit_names: + un = formatted_length_unit_names[un] + else: + un = Unit(un, registry=self.ds.unit_registry) + un = un.latex_representation() + if hinv: + un = un + '\,h^{-1}' + if comoving: + un = un + '\,(1+z)^{-1}' + pp = un[0] + if pp in latex_prefixes: + symbol_wo_prefix = un[1:] + if symbol_wo_prefix in prefixable_units: + un = un.replace( + pp, "{"+latex_prefixes[pp]+"}", 1) + axes_unit_labels[i] = '\ \ ('+un+')' + return axes_unit_labels + + +class ImagePlotContainer(PlotContainer): + """A container for plots with colorbars. + + """ + _colorbar_valid = False + + def __init__(self, data_source, figure_size, fontsize): + super(ImagePlotContainer, self).__init__( + data_source, figure_size, fontsize) + self.plots = PlotDictionary(data_source) + self._callbacks = [] + self._colormaps = defaultdict( + lambda: ytcfg.get("yt", "default_colormap")) + self._cbar_minorticks = {} + self._colorbar_label = PlotDictionary( + self.data_source, lambda: None) + + @invalidate_plot + def set_cmap(self, field, cmap): + """set the colormap for one of the fields + + Parameters + ---------- + field : string + the field to set the colormap + if field == 'all', applies to all plots. + cmap : string or tuple + If a string, will be interpreted as name of the colormap. + If a tuple, it is assumed to be of the form (name, type, number) + to be used for palettable functionality. (name, type, number, bool) + can be used to specify if a reverse colormap is to be used. + + """ + + if field == 'all': + fields = list(self.plots.keys()) + else: + fields = [field] + for field in self.data_source._determine_fields(fields): + self._colorbar_valid = False + self._colormaps[field] = cmap + return self + + @invalidate_plot + def set_background_color(self, field, color=None): + """set the background color to match provided color + + Parameters + ---------- + field : string + the field to set the colormap + if field == 'all', applies to all plots. + color : string or RGBA tuple (optional) + if set, set the background color to this color + if unset, background color is set to the bottom value of + the color map + + """ + actual_field = self.data_source._determine_fields(field)[0] + if color is None: + cmap = self._colormaps[actual_field] + if isinstance(cmap, string_types): + try: + cmap = yt_colormaps[cmap] + except KeyError: + cmap = getattr(matplotlib.cm, cmap) + color = cmap(0) + if LooseVersion(matplotlib.__version__) < LooseVersion("2.0.0"): + self.plots[actual_field].axes.set_axis_bgcolor(color) + else: + self.plots[actual_field].axes.set_facecolor(color) + return self + + @invalidate_plot + def set_zlim(self, field, zmin, zmax, dynamic_range=None): + """set the scale of the colormap + + Parameters + ---------- + field : string + the field to set a colormap scale + if field == 'all', applies to all plots. + zmin : float + the new minimum of the colormap scale. If 'min', will + set to the minimum value in the current view. + zmax : float + the new maximum of the colormap scale. If 'max', will + set to the maximum value in the current view. + + Other Parameters + ---------------- + dynamic_range : float (default: None) + The dynamic range of the image. + If zmin == None, will set zmin = zmax / dynamic_range + If zmax == None, will set zmax = zmin * dynamic_range + When dynamic_range is specified, defaults to setting + zmin = zmax / dynamic_range. + + """ + if field is 'all': + fields = list(self.plots.keys()) + else: + fields = ensure_list(field) + for field in self.data_source._determine_fields(fields): + myzmin = zmin + myzmax = zmax + if zmin == 'min': + myzmin = self.plots[field].image._A.min() + if zmax == 'max': + myzmax = self.plots[field].image._A.max() + if dynamic_range is not None: + if zmax is None: + myzmax = myzmin * dynamic_range + else: + myzmin = myzmax / dynamic_range + + self.plots[field].zmin = myzmin + self.plots[field].zmax = myzmax + return self + + @invalidate_plot + def set_cbar_minorticks(self, field, state): + """turn colorbar minor ticks on or off in the current plot + + Displaying minor ticks reduces performance; turn them off + using set_cbar_minorticks('all', 'off') if drawing speed is a problem. + + Parameters + ---------- + field : string + the field to remove colorbar minorticks + state : string + the state indicating 'on' or 'off' + + """ + if field == 'all': + fields = list(self.plots.keys()) + else: + fields = [field] + for field in self.data_source._determine_fields(fields): + if state == 'on': + self._cbar_minorticks[field] = True + else: + self._cbar_minorticks[field] = False + return self + @invalidate_plot def set_colorbar_label(self, field, label): r""" diff -Nru yt-3.3.3/yt/visualization/plot_modifications.py yt-3.4.0/yt/visualization/plot_modifications.py --- yt-3.3.3/yt/visualization/plot_modifications.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/plot_modifications.py 2017-08-10 18:11:18.000000000 +0000 @@ -21,7 +21,6 @@ import numpy as np import re -from distutils.version import LooseVersion from functools import wraps from yt.funcs import \ @@ -277,8 +276,6 @@ class VelocityCallback(PlotCallback): """ - annotate_velocity(factor=16, scale=None, scale_units=None, normalize=False): - Adds a 'quiver' plot of velocity to the plot, skipping all but every *factor* datapoint. *scale* is the data units per arrow length unit using *scale_units* (see @@ -326,8 +323,6 @@ class MagFieldCallback(PlotCallback): """ - annotate_magnetic_field(factor=16, scale=None, scale_units=None, normalize=False): - Adds a 'quiver' plot of magnetic field to the plot, skipping all but every *factor* datapoint. *scale* is the data units per arrow length unit using *scale_units* (see @@ -364,9 +359,6 @@ class QuiverCallback(PlotCallback): """ - annotate_quiver(field_x, field_y, factor=16, scale=None, scale_units=None, - normalize=False, bv_x=0, bv_y=0): - Adds a 'quiver' plot to any plot, using the *field_x* and *field_y* from the associated data, skipping every *factor* datapoints *scale* is the data units per arrow length unit using *scale_units* @@ -391,9 +383,10 @@ y0, y1 = plot.ylim xx0, xx1 = plot._axes.get_xlim() yy0, yy1 = plot._axes.get_ylim() - plot._axes.hold(True) - nx = plot.image._A.shape[0] / self.factor - ny = plot.image._A.shape[1] / self.factor + # See the note about rows/columns in the pixelizer for more information + # on why we choose the bounds we do + nx = plot.image._A.shape[1] // self.factor + ny = plot.image._A.shape[0] // self.factor # periodicity ax = plot.data.axis ds = plot.data.ds @@ -410,18 +403,18 @@ if self.bv_y != 0.0: # Workaround for 0.0 without units fv_y -= self.bv_y - pixX = pixelize_cartesian(plot.data['px'], plot.data['py'], + pixX = np.zeros((ny, nx), dtype="f8") + pixY = np.zeros((ny, nx), dtype="f8") + pixelize_cartesian(pixX, plot.data['px'], plot.data['py'], plot.data['pdx'], plot.data['pdy'], - fv_x, int(nx), int(ny), + fv_x, (x0, x1, y0, y1), 0, # bounds, antialias - (period_x, period_y), periodic, - ).transpose() - pixY = pixelize_cartesian(plot.data['px'], plot.data['py'], + (period_x, period_y), periodic) + pixelize_cartesian(pixY, plot.data['px'], plot.data['py'], plot.data['pdx'], plot.data['pdy'], - fv_y, int(nx), int(ny), + fv_y, (x0, x1, y0, y1), 0, # bounds, antialias - (period_x, period_y), periodic, - ).transpose() + (period_x, period_y), periodic) X,Y = np.meshgrid(np.linspace(xx0,xx1,nx,endpoint=True), np.linspace(yy0,yy1,ny,endpoint=True)) if self.normalize: @@ -431,14 +424,9 @@ plot._axes.quiver(X,Y, pixX, pixY, scale=self.scale, scale_units=self.scale_units) plot._axes.set_xlim(xx0,xx1) plot._axes.set_ylim(yy0,yy1) - plot._axes.hold(False) class ContourCallback(PlotCallback): """ - annotate_contour(field, ncont=5, factor=4, take_log=None, clim=None, - plot_args=None, label=False, text_args=None, - data_source=None): - Add contours in *field* to the plot. *ncont* governs the number of contours generated, *factor* governs the number of points used in the interpolation, *take_log* governs how it is contoured and *clim* gives @@ -471,6 +459,8 @@ self.data_source = data_source def __call__(self, plot): + from matplotlib.tri import Triangulation, LinearTriInterpolator + # These need to be in code_length x0, x1 = (v.in_units("code_length") for v in plot.xlim) y0, y1 = (v.in_units("code_length") for v in plot.ylim) @@ -479,10 +469,10 @@ xx0, xx1 = plot._axes.get_xlim() yy0, yy1 = plot._axes.get_ylim() - plot._axes.hold(True) - - numPoints_x = plot.image._A.shape[0] - numPoints_y = plot.image._A.shape[1] + # See the note about rows/columns in the pixelizer for more information + # on why we choose the bounds we do + numPoints_x = plot.image._A.shape[1] + numPoints_y = plot.image._A.shape[0] # Multiply by dx and dy to go from data->plot dx = (xx1 - xx0) / (x1-x0) @@ -528,14 +518,8 @@ # Both the input and output from the triangulator are in plot # coordinates - if LooseVersion(matplotlib.__version__) < LooseVersion("1.4.0"): - from matplotlib.delaunay.triangulate import Triangulation as \ - triang - zi = triang(x,y).nn_interpolator(z)(xi,yi) - else: - from matplotlib.tri import Triangulation, LinearTriInterpolator - triangulation = Triangulation(x, y) - zi = LinearTriInterpolator(triangulation, z)(xi,yi) + triangulation = Triangulation(x, y) + zi = LinearTriInterpolator(triangulation, z)(xi,yi) elif plot._type_name == 'OffAxisProjection': zi = plot.frb[self.field][::self.factor,::self.factor].transpose() @@ -554,7 +538,6 @@ cset = plot._axes.contour(xi,yi,zi,self.ncont, **self.plot_args) plot._axes.set_xlim(xx0,xx1) plot._axes.set_ylim(yy0,yy1) - plot._axes.hold(False) if self.label: plot._axes.clabel(cset, **self.text_args) @@ -562,10 +545,6 @@ class GridBoundaryCallback(PlotCallback): """ - annotate_grids(alpha=0.7, min_pix=1, min_pix_ids=20, draw_ids=False, - periodic=True, min_level=None, max_level=None, - cmap='B-W LINEAR_r', edgecolors=None, linewidth=1.0): - Draws grids on an existing PlotWindow object. Adds grid boundaries to a plot, optionally with alpha-blending. By default, colors different levels of grids with different colors going from white to black, but you can change to @@ -606,7 +585,7 @@ xx0, xx1 = plot._axes.get_xlim() yy0, yy1 = plot._axes.get_ylim() (dx, dy) = self.pixel_scale(plot) - (xpix, ypix) = plot.image._A.shape + (ypix, xpix) = plot.image._A.shape ax = plot.data.axis px_index = plot.data.ds.coordinates.x_axis[ax] py_index = plot.data.ds.coordinates.y_axis[ax] @@ -671,7 +650,6 @@ grid_collection = matplotlib.collections.PolyCollection( verts, facecolors="none", edgecolors=edgecolors, linewidth=self.linewidth) - plot._axes.hold(True) plot._axes.add_collection(grid_collection) if self.draw_ids: @@ -684,13 +662,9 @@ left_edge_x[i] + (2 * (xx1 - xx0) / xpix), left_edge_y[i] + (2 * (yy1 - yy0) / ypix), "%d" % block_ids[i], clip_on=True) - plot._axes.hold(False) class StreamlineCallback(PlotCallback): """ - annotate_streamlines(field_x, field_y, factor=16, - density=1, plot_args=None): - Add streamlines to any plot, using the *field_x* and *field_y* from the associated data, skipping every *factor* datapoints like 'quiver'. *density* is the index of the amount of the streamlines. @@ -715,40 +689,40 @@ y0, y1 = plot.ylim xx0, xx1 = plot._axes.get_xlim() yy0, yy1 = plot._axes.get_ylim() - plot._axes.hold(True) - nx = plot.image._A.shape[0] / self.factor - ny = plot.image._A.shape[1] / self.factor - pixX = pixelize_cartesian(plot.data['px'], plot.data['py'], + # See the note about rows/columns in the pixelizer for more information + # on why we choose the bounds we do + nx = plot.image._A.shape[1] // self.factor + ny = plot.image._A.shape[0] // self.factor + pixX = np.zeros((ny, nx), dtype="f8") + pixY = np.zeros((ny, nx), dtype="f8") + pixelize_cartesian(pixX, plot.data['px'], plot.data['py'], plot.data['pdx'], plot.data['pdy'], plot.data[self.field_x], - int(nx), int(ny), - (x0, x1, y0, y1),).transpose() - pixY = pixelize_cartesian(plot.data['px'], plot.data['py'], + (x0, x1, y0, y1)) + pixelize_cartesian(pixY, plot.data['px'], plot.data['py'], plot.data['pdx'], plot.data['pdy'], plot.data[self.field_y], - int(nx), int(ny), - (x0, x1, y0, y1),).transpose() + (x0, x1, y0, y1)) if self.field_color: - self.field_color = pixelize_cartesian( + field_colors = np.zeros((ny, nx), dtype="f8") + pixelize_cartesian(field_colors, plot.data['px'], plot.data['py'], plot.data['pdx'], plot.data['pdy'], - plot.data[self.field_color], int(nx), int(ny), - (x0, x1, y0, y1),).transpose() - + plot.data[self.field_color], + (x0, x1, y0, y1)) + else: + field_colors = None X,Y = (np.linspace(xx0,xx1,nx,endpoint=True), np.linspace(yy0,yy1,ny,endpoint=True)) streamplot_args = {'x': X, 'y': Y, 'u':pixX, 'v': pixY, - 'density': self.dens, 'color':self.field_color} + 'density': self.dens, 'color':field_colors} streamplot_args.update(self.plot_args) plot._axes.streamplot(**streamplot_args) plot._axes.set_xlim(xx0,xx1) plot._axes.set_ylim(yy0,yy1) - plot._axes.hold(False) class LinePlotCallback(PlotCallback): """ - annotate_line(p1, p2, coord_system="data", plot_args=None): - Overplot a line with endpoints at p1 and p2. p1 and p2 should be 2D or 3D coordinates consistent with the coordinate system denoted in the "coord_system" keyword. @@ -821,17 +795,13 @@ coord_system=self.coord_system) xx0, xx1 = plot._axes.get_xlim() yy0, yy1 = plot._axes.get_ylim() - plot._axes.hold(True) plot._axes.plot([p1[0], p2[0]], [p1[1], p2[1]], transform=self.transform, **self.plot_args) plot._axes.set_xlim(xx0,xx1) plot._axes.set_ylim(yy0,yy1) - plot._axes.hold(False) class ImageLineCallback(LinePlotCallback): """ - annotate_image_line(p1, p2, coord_system="axis", plot_args=None): - This callback is deprecated, as it is simply a wrapper around the LinePlotCallback (ie annotate_image()). The only difference is that it uses coord_system="axis" by default. Please see LinePlotCallback @@ -853,8 +823,6 @@ class CuttingQuiverCallback(PlotCallback): """ - annotate_cquiver(field_x, field_y, factor) - Get a quiver plot on top of a cutting plane, using *field_x* and *field_y*, skipping every *factor* datapoint in the discretization. """ @@ -876,27 +844,26 @@ y0, y1 = plot.ylim xx0, xx1 = plot._axes.get_xlim() yy0, yy1 = plot._axes.get_ylim() - plot._axes.hold(True) - nx = plot.image._A.shape[0] / self.factor - ny = plot.image._A.shape[1] / self.factor - indices = np.argsort(plot.data['dx'])[::-1] - - pixX = pixelize_off_axis_cartesian( + nx = plot.image._A.shape[1] // self.factor + ny = plot.image._A.shape[0] // self.factor + indices = np.argsort(plot.data['dx'])[::-1].astype(np.int_) + + pixX = np.zeros((ny, nx), dtype="f8") + pixY = np.zeros((ny, nx), dtype="f8") + pixelize_off_axis_cartesian(pixX, plot.data['x'], plot.data['y'], plot.data['z'], plot.data['px'], plot.data['py'], plot.data['pdx'], plot.data['pdy'], plot.data['pdz'], plot.data.center, plot.data._inv_mat, indices, plot.data[self.field_x], - int(nx), int(ny), - (x0, x1, y0, y1)).transpose() - pixY = pixelize_off_axis_cartesian( + (x0, x1, y0, y1)) + pixelize_off_axis_cartesian(pixY, plot.data['x'], plot.data['y'], plot.data['z'], plot.data['px'], plot.data['py'], plot.data['pdx'], plot.data['pdy'], plot.data['pdz'], plot.data.center, plot.data._inv_mat, indices, plot.data[self.field_y], - int(nx), int(ny), - (x0, x1, y0, y1)).transpose() + (x0, x1, y0, y1)) X,Y = np.meshgrid(np.linspace(xx0,xx1,nx,endpoint=True), np.linspace(yy0,yy1,ny,endpoint=True)) @@ -908,12 +875,9 @@ plot._axes.quiver(X,Y, pixX, pixY, scale=self.scale, scale_units=self.scale_units) plot._axes.set_xlim(xx0,xx1) plot._axes.set_ylim(yy0,yy1) - plot._axes.hold(False) class ClumpContourCallback(PlotCallback): """ - annotate_clumps(clumps, plot_args=None) - Take a list of *clumps* and plot them as a set of contours. """ _type_name = "clumps" @@ -931,8 +895,6 @@ extent = [xx0,xx1,yy0,yy1] - plot._axes.hold(True) - ax = plot.data.axis px_index = plot.data.ds.coordinates.x_axis[ax] py_index = plot.data.ds.coordinates.y_axis[ax] @@ -942,7 +904,7 @@ dxf = "d%s" % xf dyf = "d%s" % yf - nx, ny = plot.image._A.shape + ny, nx = plot.image._A.shape buff = np.zeros((nx,ny),dtype='float64') for i,clump in enumerate(reversed(self.clumps)): mylog.info("Pixelizing contour %s", i) @@ -950,23 +912,18 @@ xf_copy = clump[xf].copy().in_units("code_length") yf_copy = clump[yf].copy().in_units("code_length") - temp = pixelize_cartesian(xf_copy, yf_copy, + temp = np.zeros((ny, nx), dtype="f8") + pixelize_cartesian(temp, xf_copy, yf_copy, clump[dxf].in_units("code_length")/2.0, clump[dyf].in_units("code_length")/2.0, clump[dxf].d*0.0+i+1, # inits inside Pixelize - int(nx), int(ny), - (x0, x1, y0, y1), 0).transpose() + (x0, x1, y0, y1), 0) buff = np.maximum(temp, buff) self.rv = plot._axes.contour(buff, np.unique(buff), extent=extent, **self.plot_args) - plot._axes.hold(False) class ArrowCallback(PlotCallback): """ - annotate_arrow(pos, length=0.03, width=0.003, head_length=None, - head_width=0.02, starting_pos=None, - coord_system='data', plot_args=None): - Overplot an arrow pointing at a position for highlighting a specific feature. By default, arrow points from lower left to the designated position "pos" with arrow length "length". Alternatively, if @@ -1098,7 +1055,6 @@ if dx == dy == 0: warnings.warn("The arrow has zero length. Not annotating.") return - plot._axes.hold(True) plot._axes.arrow(x-dx, y-dy, dx, dy, width=self.width, head_width=self.head_width, head_length=self.head_length, @@ -1106,12 +1062,9 @@ length_includes_head=True, **self.plot_args) plot._axes.set_xlim(xx0,xx1) plot._axes.set_ylim(yy0,yy1) - plot._axes.hold(False) class MarkerAnnotateCallback(PlotCallback): """ - annotate_marker(pos, marker='x', coord_system="data", plot_args=None): - Overplot a marker on a position for highlighting specific features. Parameters @@ -1177,18 +1130,13 @@ coord_system=self.coord_system) xx0, xx1 = plot._axes.get_xlim() yy0, yy1 = plot._axes.get_ylim() - plot._axes.hold(True) plot._axes.scatter(x, y, marker = self.marker, transform=self.transform, **self.plot_args) plot._axes.set_xlim(xx0,xx1) plot._axes.set_ylim(yy0,yy1) - plot._axes.hold(False) class SphereCallback(PlotCallback): """ - annotate_sphere(center, radius, circle_args=None, - coord_system='data', text=None, text_args=None): - Overplot a circle with designated center and radius with optional text. Parameters @@ -1275,7 +1223,6 @@ **self.circle_args) xx0, xx1 = plot._axes.get_xlim() yy0, yy1 = plot._axes.get_ylim() - plot._axes.hold(True) plot._axes.add_patch(cir) if self.text is not None: @@ -1285,14 +1232,10 @@ plot._axes.set_xlim(xx0,xx1) plot._axes.set_ylim(yy0,yy1) - plot._axes.hold(False) class TextLabelCallback(PlotCallback): """ - annotate_text(pos, text, coord_system='data', text_args=None, - inset_box_args=None): - Overplot text on the plot at a specified position. If you desire an inset box around your text, set one with the inset_box_args dictionary keyword. @@ -1378,19 +1321,14 @@ # consistent with other text labels in this figure xx0, xx1 = plot._axes.get_xlim() yy0, yy1 = plot._axes.get_ylim() - plot._axes.hold(True) label = plot._axes.text(x, y, self.text, transform=self.transform, bbox=self.inset_box_args, **kwargs) self._set_font_properties(plot, [label], **kwargs) plot._axes.set_xlim(xx0,xx1) plot._axes.set_ylim(yy0,yy1) - plot._axes.hold(False) class PointAnnotateCallback(TextLabelCallback): """ - annotate_point(pos, text, coord_system='data', text_args=None, - inset_box_args=None) - This callback is deprecated, as it is simply a wrapper around the TextLabelCallback (ie annotate_text()). Please see TextLabelCallback for more information. @@ -1412,10 +1350,6 @@ class HaloCatalogCallback(PlotCallback): """ - annotate_halos(halo_catalog, circle_args=None, - width=None, annotate_field=None, - text_args=None, factor=1.0) - Plots circles at the locations of all the halos in a halo catalog with radii corresponding to the virial radius of each halo. @@ -1430,6 +1364,15 @@ halo catalog to add text to the plot near the halo. Example: annotate_field = 'particle_mass' will write the halo mass next to each halo. + radius_field: Accepts a field contained in the halo + catalog to set the radius of the circle which will + surround each halo. + center_field_prefix: Accepts a field prefix which will + be used to find the fields containing the coordinates + of the center of each halo. Ex: 'particle_position' + will result in the fields 'particle_position_x' for x + 'particle_position_y' for y, and 'particle_position_z' + for z. text_args: Contains the arguments controlling the text appearance of the annotated field. factor: A number the virial radius is multiplied by for @@ -1443,14 +1386,17 @@ _supported_geometries = ("cartesian", "spectral_cube") def __init__(self, halo_catalog, circle_args=None, circle_kwargs=None, - width=None, annotate_field=None, text_args=None, - font_kwargs=None, factor=1.0): + width=None, annotate_field=None, radius_field='virial_radius', + center_field_prefix="particle_position", + text_args=None, font_kwargs=None, factor=1.0): PlotCallback.__init__(self) def_circle_args = {'edgecolor':'white', 'facecolor':'None'} def_text_args = {'color':'white'} self.halo_catalog = halo_catalog self.width = width + self.radius_field = radius_field + self.center_field_prefix = center_field_prefix self.annotate_field = annotate_field if circle_kwargs is not None: circle_args = circle_kwargs @@ -1478,29 +1424,45 @@ axis_names = plot.data.ds.coordinates.axis_name xax = plot.data.ds.coordinates.x_axis[data.axis] yax = plot.data.ds.coordinates.y_axis[data.axis] - field_x = "particle_position_%s" % axis_names[xax] - field_y = "particle_position_%s" % axis_names[yax] - field_z = "particle_position_%s" % axis_names[data.axis] - plot._axes.hold(True) + field_x = "%s_%s" % (self.center_field_prefix, axis_names[xax]) + field_y = "%s_%s" % (self.center_field_prefix, axis_names[yax]) + field_z = "%s_%s" % (self.center_field_prefix, axis_names[data.axis]) # Set up scales for pixel size and original data pixel_scale = self.pixel_scale(plot)[0] - data_scale = data.ds.length_unit - units = data_scale.units + units = plot.xlim[0].units # Convert halo positions to code units of the plotted data # and then to units of the plotted window - px = halo_data[field_x][:].in_units(units) / data_scale - py = halo_data[field_y][:].in_units(units) / data_scale - px, py = self.convert_to_plot(plot,[px,py]) + px = halo_data[field_x][:].in_units(units) + py = halo_data[field_y][:].in_units(units) + + xplotcenter = (plot.xlim[0] + plot.xlim[1])/2 + yplotcenter = (plot.ylim[0] + plot.ylim[1])/2 + + xdomaincenter = plot.ds.domain_center[xax] + ydomaincenter = plot.ds.domain_center[yax] + + xoffset = xplotcenter - xdomaincenter + yoffset = yplotcenter - ydomaincenter + + xdw = plot.ds.domain_width[xax].to(units) + ydw = plot.ds.domain_width[yax].to(units) + + modpx = np.mod(px - xoffset, xdw) + xoffset + modpy = np.mod(py - yoffset, ydw) + yoffset + + px[modpx != px] = modpx[modpx != px] + py[modpy != py] = modpy[modpy != py] + + px, py = self.convert_to_plot(plot, [px, py]) # Convert halo radii to a radius in pixels - radius = halo_data['virial_radius'][:].in_units(units) - radius = np.array(radius*pixel_scale*self.factor/data_scale) + radius = halo_data[self.radius_field][:].in_units(units) + radius = np.array(radius*pixel_scale*self.factor) if self.width: - pz = halo_data[field_z][:].in_units(units)/data_scale - pz = data.ds.arr(pz, 'code_length') + pz = halo_data[field_z][:].in_units('code_length') c = data.center[data.axis] # I should catch an error here if width isn't in this form @@ -1519,7 +1481,6 @@ plot._axes.set_xlim(xx0,xx1) plot._axes.set_ylim(yy0,yy1) - plot._axes.hold(False) if self.annotate_field: annotate_dat = halo_data[self.annotate_field] @@ -1534,9 +1495,6 @@ class ParticleCallback(PlotCallback): """ - annotate_particles(width, p_size=1.0, col='k', marker='o', stride=1.0, - ptype=None, minimum_mass=None, alpha=1.0) - Adds particle positions, based on a thick slab along *axis* with a *width* along the line of sight. *p_size* controls the number of pixels per particle, and *col* governs the color. *ptype* will @@ -1549,7 +1507,7 @@ region = None _descriptor = None _supported_geometries = ("cartesian", "spectral_cube") - def __init__(self, width, p_size=1.0, col='k', marker='o', stride=1.0, + def __init__(self, width, p_size=1.0, col='k', marker='o', stride=1, ptype='all', minimum_mass=None, alpha=1.0): PlotCallback.__init__(self) self.width = width @@ -1598,7 +1556,6 @@ if self.minimum_mass is not None: gg &= (reg[pt, "particle_mass"] >= self.minimum_mass) if gg.sum() == 0: return - plot._axes.hold(True) px, py = self.convert_to_plot(plot, [np.array(particle_x[gg][::self.stride]), np.array(particle_y[gg][::self.stride])]) @@ -1606,7 +1563,6 @@ s=self.p_size, c=self.color,alpha=self.alpha) plot._axes.set_xlim(xx0,xx1) plot._axes.set_ylim(yy0,yy1) - plot._axes.hold(False) def _enforce_periodic(self, particle_x, @@ -1648,8 +1604,6 @@ class TitleCallback(PlotCallback): """ - annotate_title(title) - Accepts a *title* and adds it to the plot """ _type_name = "title" @@ -1667,8 +1621,6 @@ class MeshLinesCallback(PlotCallback): """ - annotate_mesh_lines() - Adds mesh lines to the plot. Only works for unstructured or semi-structured mesh data. For structured grid data, see GridBoundaryCallback or CellEdgesCallback. @@ -1734,7 +1686,7 @@ elif num_dims == 2 and num_verts == 4: coords, indices = self.promote_2d_to_3d(coords, indices, plot) - tri_indices = triangulate_indices(indices) + tri_indices = triangulate_indices(indices.astype(np.int_)) points = coords[tri_indices] tfc = TriangleFacetsCallback(points, plot_args=self.plot_args) @@ -1743,8 +1695,6 @@ class TriangleFacetsCallback(PlotCallback): """ - annotate_triangle_facets(triangle_vertices, plot_args=None ) - Intended for representing a slice of a triangular faceted geometry in a slice plot. @@ -1762,7 +1712,6 @@ self.vertices = triangle_vertices def __call__(self, plot): - plot._axes.hold(True) ax = plot.data.axis xax = plot.data.ds.coordinates.x_axis[ax] yax = plot.data.ds.coordinates.y_axis[ax] @@ -1784,16 +1733,9 @@ # create line collection and add it to the plot lc = matplotlib.collections.LineCollection(l_cy, **self.plot_args) plot._axes.add_collection(lc) - plot._axes.hold(False) class TimestampCallback(PlotCallback): """ - annotate_timestamp(x_pos=None, y_pos=None, corner='lower_left', time=True, - redshift=False, time_format="t = {time:.0f} {units}", - time_unit=None, redshift_format="z = {redshift:.2f}", - draw_inset_box=False, coord_system='axis', - text_args=None, inset_box_args=None) - Annotates the timestamp and/or redshift of the data output at a specified location in the image (either in a present corner, or by specifying (x,y) image coordinates with the x_pos, y_pos arguments. If no time_units are @@ -1972,11 +1914,6 @@ class ScaleCallback(PlotCallback): """ - annotate_scale(corner='lower_right', coeff=None, unit=None, pos=None, - max_frac=0.16, min_frac=0.015, coord_system='axis', - text_args=None, size_bar_args=None, draw_inset_box=False, - inset_box_args=None) - Annotates the scale of the plot at a specified location in the image (either in a preset corner, or by specifying (x,y) image coordinates with the pos argument. Coeff and units (e.g. 1 Mpc or 100 kpc) refer to the @@ -2109,10 +2046,6 @@ # Callback only works for plots with axis ratios of 1 xsize = plot.xlim[1] - plot.xlim[0] - if plot.aspect != 1.0: - raise NotImplementedError( - "Scale callback has only been implemented for plots with no " - "aspect ratio scaling. (aspect = {%s})".format(plot._aspect)) # Setting pos overrides corner argument if self.pos is None: @@ -2152,8 +2085,8 @@ text = "{scale} {units}".format(scale=int(self.coeff), units=self.unit) image_scale = (plot.frb.convert_distance_x(self.scale) / plot.frb.convert_distance_x(xsize)).v - - size_vertical = self.size_bar_args.pop('size_vertical', .005) + size_vertical = self.size_bar_args.pop( + 'size_vertical', .005 * plot.aspect) fontproperties = self.size_bar_args.pop( 'fontproperties', plot.font_properties.copy()) frameon = self.size_bar_args.pop('frameon', self.draw_inset_box) @@ -2186,8 +2119,6 @@ class RayCallback(PlotCallback): """ - annotate_ray(ray, plot_args=None) - Adds a line representing the projected path of a ray across the plot. The ray can be either a YTOrthoRay, YTRay, or a LightRay object. annotate_ray() will properly account for periodic rays across the volume. @@ -2338,11 +2269,6 @@ class LineIntegralConvolutionCallback(PlotCallback): """ - annotate_line_integral_convolution(field_x, field_y, texture=None, - kernellen=50., lim=(0.5,0.6), - cmap='binary', alpha=0.8, - const_alpha=False): - Add the line integral convolution to the plot for vector fields visualization. Two component of vector fields needed to be provided (i.e., velocity_x and velocity_y, magentic_field_x and magnetic_field_y). @@ -2411,19 +2337,20 @@ bounds = [x0,x1,y0,y1] extent = [xx0,xx1,yy0,yy1] - plot._axes.hold(True) - nx = plot.image._A.shape[0] - ny = plot.image._A.shape[1] + # We are feeding this size into the pixelizer, where it will properly + # set it in reverse order + nx = plot.image._A.shape[1] + ny = plot.image._A.shape[0] pixX = plot.data.ds.coordinates.pixelize(plot.data.axis, plot.data, self.field_x, bounds, - (nx,ny)) + (ny,nx)) pixY = plot.data.ds.coordinates.pixelize(plot.data.axis, plot.data, self.field_y, bounds, - (nx,ny)) + (ny,nx)) vectors = np.concatenate((pixX[...,np.newaxis], pixY[...,np.newaxis]),axis=2) @@ -2438,27 +2365,25 @@ kernel = kernel.astype(np.double) lic_data = line_integral_convolution_2d(vectors,self.texture,kernel) - lic_data = np.flipud(lic_data / lic_data.max()) + lic_data = lic_data / lic_data.max() lic_data_clip = np.clip(lic_data,self.lim[0],self.lim[1]) if self.const_alpha: plot._axes.imshow(lic_data_clip, extent=extent, cmap=self.cmap, - alpha=self.alpha) + alpha=self.alpha, origin='lower', aspect="auto") else: lic_data_rgba = cm.ScalarMappable(norm=None, cmap=self.cmap).\ to_rgba(lic_data_clip) lic_data_clip_rescale = (lic_data_clip - self.lim[0]) \ / (self.lim[1] - self.lim[0]) lic_data_rgba[...,3] = lic_data_clip_rescale * self.alpha - plot._axes.imshow(lic_data_rgba, extent=extent, cmap=self.cmap) - plot._axes.hold(False) + plot._axes.imshow(lic_data_rgba, extent=extent, cmap=self.cmap, + origin='lower', aspect="auto") return plot class CellEdgesCallback(PlotCallback): """ - annotate_cell_edges(line_width=0.002, alpha = 1.0, color = 'black') - Annotate cell edges. This is done through a second call to pixelize, where the distance from a pixel to a cell boundary in pixels is compared against the `line_width` argument. The secondary image is colored as `color` and @@ -2500,9 +2425,8 @@ y0, y1 = plot.ylim xx0, xx1 = plot._axes.get_xlim() yy0, yy1 = plot._axes.get_ylim() - plot._axes.hold(True) - nx = plot.image._A.shape[0] - ny = plot.image._A.shape[1] + nx = plot.image._A.shape[1] + ny = plot.image._A.shape[0] aspect = float((y1 - y0) / (x1 - x0)) pixel_aspect = float(ny)/nx relative_aspect = pixel_aspect / aspect @@ -2521,16 +2445,17 @@ ny = 1600 long_axis = nx line_width = max(self.line_width*long_axis, 1.0) - im = pixelize_cartesian(plot.data['px'], + im = np.zeros((ny, nx), dtype="f8") + pixelize_cartesian(im, + plot.data['px'], plot.data['py'], plot.data['pdx'], plot.data['pdy'], plot.data['px'], # dummy field - int(nx), int(ny), (x0, x1, y0, y1), - line_width=line_width).transpose() + line_width=line_width) # New image: - im_buffer = np.zeros((nx, ny, 4), dtype="uint8") + im_buffer = np.zeros((ny, nx, 4), dtype="uint8") im_buffer[im > 0, 3] = 255 im_buffer[im > 0, :3] = self.color plot._axes.imshow(im_buffer, origin='lower', @@ -2539,4 +2464,3 @@ alpha=self.alpha) plot._axes.set_xlim(xx0, xx1) plot._axes.set_ylim(yy0, yy1) - plot._axes.hold(False) diff -Nru yt-3.3.3/yt/visualization/plot_window.py yt-3.4.0/yt/visualization/plot_window.py --- yt-3.3.3/yt/visualization/plot_window.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/plot_window.py 2017-08-10 18:02:57.000000000 +0000 @@ -13,20 +13,20 @@ # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- - import numpy as np import matplotlib import types import six import sys +from collections import defaultdict from distutils.version import LooseVersion from numbers import Number -from .base_plot_types import ImagePlotMPL +from .base_plot_types import \ + ImagePlotMPL from .fixed_resolution import \ FixedResolutionBuffer, \ - ObliqueFixedResolutionBuffer, \ OffAxisProjectionFixedResolutionBuffer from .plot_modifications import callback_registry from .plot_container import \ @@ -36,8 +36,6 @@ invalidate_data, invalidate_plot, apply_callback from .base_plot_types import CallbackWrapper -from yt.data_objects.time_series import \ - DatasetSeries from yt.data_objects.image_array import \ ImageArray from yt.extern.six import string_types @@ -45,40 +43,34 @@ YTSpatialPlotDataset from yt.funcs import \ mylog, iterable, ensure_list, \ - fix_axis, fix_unitary + fix_axis, fix_unitary, obj_length from yt.units.unit_object import \ Unit from yt.units.unit_registry import \ UnitParseError -from yt.units.unit_lookup_table import \ - prefixable_units, latex_prefixes from yt.units.yt_array import \ YTArray, YTQuantity -from yt.utilities.definitions import \ - formatted_length_unit_names from yt.utilities.math_utils import \ ortho_find from yt.utilities.orientation import \ Orientation from yt.utilities.exceptions import \ - YTUnitNotRecognized, \ YTCannotParseUnitDisplayName, \ - YTUnitConversionError, \ YTPlotCallbackError, \ YTDataTypeUnsupported, \ - YTInvalidFieldType + YTInvalidFieldType, \ + YTUnitNotRecognized, \ + YTUnitConversionError + +MPL_VERSION = LooseVersion(matplotlib.__version__) # Some magic for dealing with pyparsing being included or not # included in matplotlib (not in gentoo, yes in everything else) -# Also accounting for the fact that in 1.2.0, pyparsing got renamed. try: - if LooseVersion(matplotlib.__version__) < LooseVersion("1.2.0"): - from matplotlib.pyparsing import ParseFatalException + if sys.version_info[0] == 3: + from matplotlib.pyparsing_py3 import ParseFatalException else: - if sys.version_info[0] == 3: - from matplotlib.pyparsing_py3 import ParseFatalException - else: - from matplotlib.pyparsing_py2 import ParseFatalException + from matplotlib.pyparsing_py2 import ParseFatalException except ImportError: from pyparsing import ParseFatalException @@ -132,6 +124,11 @@ return axes_unit def validate_mesh_fields(data_source, fields): + # this check doesn't make sense for ytdata plot datasets, which + # load mesh data as a particle field but nonetheless can still + # make plots with it + if isinstance(data_source.ds, YTSpatialPlotDataset): + return canonical_fields = data_source._determine_fields(fields) invalid_fields = [] for field in canonical_fields: @@ -156,10 +153,9 @@ Parameters ---------- - data_source : :class:`yt.data_objects.construction_data_containers.YTQuadTreeProj` or :class:`yt.data_objects.selection_data_containers.YTSlice` - This is the source to be pixelized, which can be a projection or a - slice. (For cutting planes, see - `yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer`.) + data_source : subclass of :class:`yt.data_objects.selection_data_containers.YTSelectionContainer2D` + This is the source to be pixelized, which can be a projection, + slice, or a cutting plane. bounds : sequence of floats Bounds are the min and max in the image plane that we want our image to cover. It's in the order of (xmin, xmax, ymin, ymax), @@ -172,22 +168,28 @@ window_size : float The size of the window on the longest axis (in units of inches), including the margins but not the colorbar. + window_size : float + The size of the window on the longest axis (in units of inches), + including the margins but not the colorbar. + right_handed : boolean + Whether the implicit east vector for the image generated is set to make a right + handed coordinate system with a north vector and the normal vector, the + direction of the 'window' into the data. """ def __init__(self, data_source, bounds, buff_size=(800,800), antialias=True, - periodic=True, origin='center-window', oblique=False, - window_size=8.0, fields=None, fontsize=18, aspect=None, + periodic=True, origin='center-window', oblique=False, right_handed=True, + window_size=8.0, fields=None, fontsize=18, aspect=None, setup=False): - if not hasattr(self, "ds"): - self.ds = data_source.ds - ts = self._initialize_dataset(self.ds) - self.ts = ts - self._axes_unit_names = None self.center = None self._periodic = periodic self.oblique = oblique + self._right_handed = right_handed + self._equivalencies = defaultdict(lambda: (None, {})) self.buff_size = buff_size self.antialias = antialias + self._axes_unit_names = None + self.aspect = aspect skip = list(FixedResolutionBuffer._exclude_fields) + data_source._key_fields if fields is None: @@ -216,12 +218,6 @@ self.setup_callbacks() self._setup_plots() - def _initialize_dataset(self, ts): - if not isinstance(ts, DatasetSeries): - if not iterable(ts): ts = [ts] - ts = DatasetSeries(ts) - return ts - def __iter__(self): for ds in self.ts: mylog.warning("Switching to %s", ds) @@ -265,8 +261,6 @@ bounds = self.xlim+self.ylim+self.zlim else: bounds = self.xlim+self.ylim - if self._frb_generator is ObliqueFixedResolutionBuffer: - bounds = np.array([b.in_units('code_length') for b in bounds]) # Generate the FRB self.frb = self._frb_generator(self.data_source, bounds, @@ -280,7 +274,11 @@ # Restore the old fields for key, unit in zip(old_fields, old_units): self._frb[key] - self._frb[key].convert_to_units(unit) + equiv = self._equivalencies[key] + if equiv[0] is None: + self._frb[key].convert_to_units(unit) + else: + self.frb.set_unit(key, unit, equiv[0], equiv[1]) # Restore the override fields for key in self.override_fields: @@ -363,7 +361,8 @@ return self @invalidate_plot - def set_unit(self, field, new_unit): + def set_unit(self, field, new_unit, equivalency=None, + equivalency_kwargs=None): """Sets a new unit for the requested field parameters @@ -373,7 +372,18 @@ new_unit : string or Unit object The name of the new unit. + + equivalency : string, optional + If set, the equivalency to use to convert the current units to + the new requested unit. If None, the unit conversion will be done + without an equivelancy + + equivalency_kwargs : string, optional + Keyword arguments to be passed to the equivalency. Only used if + ``equivalency`` is set. """ + if equivalency_kwargs is None: + equivalency_kwargs = {} field = self.data_source._determine_fields(field)[0] field = ensure_list(field) new_unit = ensure_list(new_unit) @@ -382,7 +392,8 @@ "Field list {} and unit " "list {} are incompatible".format(field, new_unit)) for f, u in zip(field, new_unit): - self.frb[f].convert_to_units(u) + self.frb.set_unit(f, u, equivalency, equivalency_kwargs) + self._equivalencies[f] = (equivalency, equivalency_kwargs) return self @invalidate_plot @@ -391,33 +402,39 @@ Parameters ---------- - origin : string or length 1, 2, or 3 sequence of strings - The location of the origin of the plot coordinate system. This is - represented by '-' separated string or a tuple of strings. In the - first index the y-location is given by 'lower', 'upper', or 'center'. - The second index is the x-location, given as 'left', 'right', or - 'center'. Finally, the whether the origin is applied in 'domain' - space, plot 'window' space or 'native' simulation coordinate system - is given. For example, both 'upper-right-domain' and ['upper', - 'right', 'domain'] place the origin in the upper right hand - corner of domain space. If x or y are not given, a value is inferred. - For instance, 'left-domain' corresponds to the lower-left hand corner - of the simulation domain, 'center-domain' corresponds to the center - of the simulation domain, or 'center-window' for the center of the - plot window. Further examples: - - ================================== ============================ - format example - ================================== ============================ - '{space}' 'domain' - '{xloc}-{space}' 'left-window' - '{yloc}-{space}' 'upper-domain' - '{yloc}-{xloc}-{space}' 'lower-right-window' - ('{space}',) ('window',) - ('{xloc}', '{space}') ('right', 'domain') - ('{yloc}', '{space}') ('lower', 'window') - ('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window') - ================================== ============================ + origin : string or length 1, 2, or 3 sequence. + The location of the origin of the plot coordinate system. This + is typically represented by a '-' separated string or a tuple of + strings. In the first index the y-location is given by 'lower', + 'upper', or 'center'. The second index is the x-location, given as + 'left', 'right', or 'center'. Finally, whether the origin is + applied in 'domain' space, plot 'window' space or 'native' + simulation coordinate system is given. For example, both + 'upper-right-domain' and ['upper', 'right', 'domain'] place the + origin in the upper right hand corner of domain space. If x or y + are not given, a value is inferred. For instance, 'left-domain' + corresponds to the lower-left hand corner of the simulation domain, + 'center-domain' corresponds to the center of the simulation domain, + or 'center-window' for the center of the plot window. In the event + that none of these options place the origin in a desired location, + a sequence of tuples and a string specifying the + coordinate space can be given. If plain numeric types are input, + units of `code_length` are assumed. Further examples: + + =============================================== ================================== + format example + =============================================== ================================== + '{space}' 'domain' + '{xloc}-{space}' 'left-window' + '{yloc}-{space}' 'upper-domain' + '{yloc}-{xloc}-{space}' 'lower-right-window' + ('{space}',) ('window',) + ('{xloc}', '{space}') ('right', 'domain') + ('{yloc}', '{space}') ('lower', 'window') + ('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window') + ((yloc, '{unit}'), (xloc, '{unit}'), '{space}') ((0.5, 'm'), (0.4, 'm'), 'window') + (xloc, yloc, '{space}') (0.23, 0.5, 'domain') + =============================================== ================================== """ self.origin = origin @@ -620,6 +637,11 @@ self._axes_unit_names = unit_name return self + @invalidate_plot + def toggle_right_handed(self): + self._right_handed = not self._right_handed + + class PWViewerMPL(PlotWindow): """Viewer using matplotlib as a backend via the WindowPlotMPL. @@ -640,6 +662,9 @@ def _setup_origin(self): origin = self.origin axis_index = self.data_source.axis + xc = None + yc = None + if isinstance(origin, string_types): origin = tuple(origin.split('-'))[:3] if 1 == len(origin): @@ -649,6 +674,13 @@ origin = (o0map[origin[0]],) + origin elif 2 == len(origin) and origin[0] in set(['lower','upper','center']): origin = (origin[0], 'center', origin[-1]) + elif 3 == len(origin) and isinstance(origin[0], (int, float)): + xc = self.ds.quan(origin[0], 'code_length') + yc = self.ds.quan(origin[1], 'code_length') + elif 3 == len(origin) and isinstance(origin[0], tuple): + xc = YTQuantity(origin[0][0], origin[0][1]) + yc = YTQuantity(origin[1][0], origin[0][1]) + assert origin[-1] in ['window', 'domain', 'native'] if origin[2] == 'window': @@ -667,33 +699,42 @@ else: mylog.warn("origin = {0}".format(origin)) msg = \ - ('origin keyword "{0}" not recognized, must declare "domain" ' - 'or "center" as the last term in origin.').format(self.origin) - raise RuntimeError(msg) - - if origin[0] == 'lower': - yc = yllim - elif origin[0] == 'upper': - yc = yrlim - elif origin[0] == 'center': - yc = (yllim + yrlim)/2.0 - else: - mylog.warn("origin = {0}".format(origin)) - msg = ('origin keyword "{0}" not recognized, must declare "lower" ' - '"upper" or "center" as the first term in origin.') - msg = msg.format(self.origin) + ('origin keyword "{0}" not recognized, must declare "domain" ' + 'or "center" as the last term in origin.').format(self.origin) raise RuntimeError(msg) - - if origin[1] == 'left': - xc = xllim - elif origin[1] == 'right': - xc = xrlim - elif origin[1] == 'center': - xc = (xllim + xrlim)/2.0 - else: - mylog.warn("origin = {0}".format(origin)) - msg = ('origin keyword "{0}" not recognized, must declare "left" ' - '"right" or "center" as the second term in origin.') + if xc is None and yc is None: + if origin[0] == 'lower': + yc = yllim + elif origin[0] == 'upper': + yc = yrlim + elif origin[0] == 'center': + yc = (yllim + yrlim)/2.0 + else: + mylog.warn("origin = {0}".format(origin)) + msg = ('origin keyword "{0}" not recognized, must declare "lower" ' + '"upper" or "center" as the first term in origin.') + msg = msg.format(self.origin) + raise RuntimeError(msg) + + if origin[1] == 'left': + xc = xllim + elif origin[1] == 'right': + xc = xrlim + elif origin[1] == 'center': + xc = (xllim + xrlim)/2.0 + else: + mylog.warn("origin = {0}".format(origin)) + msg = ('origin keyword "{0}" not recognized, must declare "left" ' + '"right" or "center" as the second term in origin.') + msg = msg.format(self.origin) + raise RuntimeError(msg) + + x_in_bounds = xc >= xllim and xc <= xrlim + y_in_bounds = yc >= yllim and yc <= yrlim + + if not x_in_bounds and not y_in_bounds: + msg = ('orgin inputs not in bounds of specified coordinate sytem' + + 'domain.') msg = msg.format(self.origin) raise RuntimeError(msg) @@ -725,7 +766,6 @@ if self.aspect is None: self.aspect = float((self.ds.quan(1.0, unit_y) / self.ds.quan(1.0, unit_x)).in_cgs()) - extentx = [(self.xlim[i] - xc).in_units(unit_x) for i in (0, 1)] extenty = [(self.ylim[i] - yc).in_units(unit_y) for i in (0, 1)] @@ -797,7 +837,6 @@ ia = ImageArray(ia) else: ia = image - self.plots[f] = WindowPlotMPL( ia, self._field_transform[f].name, self._field_transform[f].func, @@ -805,59 +844,11 @@ self.figure_size, font_size, self.aspect, fig, axes, cax) - axes_unit_labels = ['', ''] - comoving = False - hinv = False - for i, un in enumerate((unit_x, unit_y)): - unn = None - if hasattr(self.ds.coordinates, "image_units"): - # This *forces* an override - unn = self.ds.coordinates.image_units[axis_index][i] - elif hasattr(self.ds.coordinates, "default_unit_label"): - axax = getattr(self.ds.coordinates, - "%s_axis" % ("xy"[i]))[axis_index] - unn = self.ds.coordinates.default_unit_label.get(axax, - None) - if unn is not None: - axes_unit_labels[i] = r'\ \ \left('+unn+r'\right)' - continue - # Use sympy to factor h out of the unit. In this context 'un' - # is a string, so we call the Unit constructor. - expr = Unit(un, registry=self.ds.unit_registry).expr - h_expr = Unit('h', registry=self.ds.unit_registry).expr - # See http://docs.sympy.org/latest/modules/core.html#sympy.core.expr.Expr - h_power = expr.as_coeff_exponent(h_expr)[1] - # un is now the original unit, but with h factored out. - un = str(expr*h_expr**(-1*h_power)) - un_unit = Unit(un, registry=self.ds.unit_registry) - cm = Unit('cm').expr - if str(un).endswith('cm') and cm not in un_unit.expr.atoms(): - comoving = True - un = un[:-2] - # no length units besides code_length end in h so this is safe - if h_power == -1: - hinv = True - elif h_power != 0: - # It doesn't make sense to scale a position by anything - # other than h**-1 - raise RuntimeError - if un not in ['1', 'u', 'unitary']: - if un in formatted_length_unit_names: - un = formatted_length_unit_names[un] - else: - un = Unit(un, registry=self.ds.unit_registry) - un = un.latex_representation() - if hinv: - un = un + '\,h^{-1}' - if comoving: - un = un + '\,(1+z)^{-1}' - pp = un[0] - if pp in latex_prefixes: - symbol_wo_prefix = un[1:] - if symbol_wo_prefix in prefixable_units: - un = un.replace( - pp, "{"+latex_prefixes[pp]+"}", 1) - axes_unit_labels[i] = '\ \ ('+un+')' + if not self._right_handed: + ax = self.plots[f].axes + ax.invert_xaxis() + + axes_unit_labels = self._get_axes_unit_labels(unit_x, unit_y) if self.oblique: labels = [r'$\rm{Image\ x'+axes_unit_labels[0]+'}$', @@ -931,7 +922,8 @@ # colorbar minorticks if f not in self._cbar_minorticks: self._cbar_minorticks[f] = True - if self._cbar_minorticks[f] is True: + if (self._cbar_minorticks[f] is True and MPL_VERSION < LooseVersion('2.0.0') + or self._field_transform[f] == symlog_transform): if self._field_transform[f] == linear_transform: self.plots[f].cax.minorticks_on() else: @@ -984,7 +976,7 @@ @invalidate_plot def annotate_clear(self, index=None): """ - Clear callbacks from the plot. If index is not set, clear all + Clear callbacks from the plot. If index is not set, clear all callbacks. If index is set, clear that index (ie 0 is the first one created, 1 is the 2nd one created, -1 is the last one created, etc.) """ @@ -999,7 +991,7 @@ for f in self.fields: keys = self.frb.keys() for name, (args, kwargs) in self._callbacks: - cbw = CallbackWrapper(self, self.plots[f], self.frb, f, + cbw = CallbackWrapper(self, self.plots[f], self.frb, f, self._font_properties, self._font_color) CallbackMaker = callback_registry[name] callback = CallbackMaker(*args[1:], **kwargs) @@ -1017,8 +1009,8 @@ def hide_colorbar(self, field=None): """ - Hides the colorbar for a plot and updates the size of the - plot accordingly. Defaults to operating on all fields for a + Hides the colorbar for a plot and updates the size of the + plot accordingly. Defaults to operating on all fields for a PlotWindow object. Parameters @@ -1058,8 +1050,8 @@ def show_colorbar(self, field=None): """ - Shows the colorbar for a plot and updates the size of the - plot accordingly. Defaults to operating on all fields for a + Shows the colorbar for a plot and updates the size of the + plot accordingly. Defaults to operating on all fields for a PlotWindow object. See hide_colorbar(). Parameters @@ -1077,8 +1069,8 @@ def hide_axes(self, field=None): """ - Hides the axes for a plot and updates the size of the - plot accordingly. Defaults to operating on all fields for a + Hides the axes for a plot and updates the size of the + plot accordingly. Defaults to operating on all fields for a PlotWindow object. Parameters @@ -1116,8 +1108,8 @@ def show_axes(self, field=None): """ - Shows the axes for a plot and updates the size of the - plot accordingly. Defaults to operating on all fields for a + Shows the axes for a plot and updates the size of the + plot accordingly. Defaults to operating on all fields for a PlotWindow object. See hide_axes(). Parameters @@ -1183,46 +1175,56 @@ units are assumed, for example (0.2, 0.3) requests a plot that has an x width of 0.2 and a y width of 0.3 in code units. If units are provided the resulting plot axis labels will use the supplied units. - axes_unit : A string + origin : string or length 1, 2, or 3 sequence. + The location of the origin of the plot coordinate system. This + is typically represented by a '-' separated string or a tuple of + strings. In the first index the y-location is given by 'lower', + 'upper', or 'center'. The second index is the x-location, given as + 'left', 'right', or 'center'. Finally, whether the origin is + applied in 'domain' space, plot 'window' space or 'native' + simulation coordinate system is given. For example, both + 'upper-right-domain' and ['upper', 'right', 'domain'] place the + origin in the upper right hand corner of domain space. If x or y + are not given, a value is inferred. For instance, 'left-domain' + corresponds to the lower-left hand corner of the simulation domain, + 'center-domain' corresponds to the center of the simulation domain, + or 'center-window' for the center of the plot window. In the event + that none of these options place the origin in a desired location, + a sequence of tuples and a string specifying the + coordinate space can be given. If plain numeric types are input, + units of `code_length` are assumed. Further examples: + + =============================================== ================================== + format example + =============================================== ================================== + '{space}' 'domain' + '{xloc}-{space}' 'left-window' + '{yloc}-{space}' 'upper-domain' + '{yloc}-{xloc}-{space}' 'lower-right-window' + ('{space}',) ('window',) + ('{xloc}', '{space}') ('right', 'domain') + ('{yloc}', '{space}') ('lower', 'window') + ('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window') + ((yloc, '{unit}'), (xloc, '{unit}'), '{space}') ((0.5, 'm'), (0.4, 'm'), 'window') + (xloc, yloc, '{space}') (0.23, 0.5, 'domain') + =============================================== ================================== + axes_unit : string The name of the unit for the tick labels on the x and y axes. Defaults to None, which automatically picks an appropriate unit. If axes_unit is '1', 'u', or 'unitary', it will not display the units, and only show the axes name. - origin : string or length 1, 2, or 3 sequence of strings - The location of the origin of the plot coordinate system. This is - represented by '-' separated string or a tuple of strings. In the - first index the y-location is given by 'lower', 'upper', or 'center'. - The second index is the x-location, given as 'left', 'right', or - 'center'. Finally, whether the origin is applied in 'domain' - space, plot 'window' space or 'native' simulation coordinate system - is given. For example, both 'upper-right-domain' and ['upper', - 'right', 'domain'] place the origin in the upper right hand - corner of domain space. If x or y are not given, a value is inferred. - For instance, the default location 'center-window' corresponds to - the center of the plot window, 'left-domain' corresponds to the - lower-left hand corner of the simulation domain, or 'center-domain' - for the center of the simulation domain. Further examples: - - ================================== ============================ - format example - ================================== ============================ - '{space}' 'domain' - '{xloc}-{space}' 'left-window' - '{yloc}-{space}' 'upper-domain' - '{yloc}-{xloc}-{space}' 'lower-right-window' - ('{space}',) ('window',) - ('{xloc}', '{space}') ('right', 'domain') - ('{yloc}', '{space}') ('lower', 'window') - ('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window') - ================================== ============================ + right_handed : boolean + Whether the implicit east vector for the image generated is set to make a right + handed coordinate system with a normal vector, the direction of the + 'window' into the data. fontsize : integer The size of the fonts for the axis, colorbar, and tick labels. field_parameters : dictionary A dictionary of field parameters than can be accessed by derived fields. - data_source : YTSelectionContainer Object - Object to be used for data selection. Defaults to a region covering - the entire simulation. + data_source: YTSelectionContainer object + Object to be used for data selection. Defaults to ds.all_data(), a + region covering the full domain Examples -------- @@ -1239,18 +1241,19 @@ _frb_generator = FixedResolutionBuffer def __init__(self, ds, axis, fields, center='c', width=None, axes_unit=None, - origin='center-window', fontsize=18, field_parameters=None, + origin='center-window', right_handed=True, fontsize=18, field_parameters=None, window_size=8.0, aspect=None, data_source=None): # this will handle time series data and controllers - ts = self._initialize_dataset(ds) - self.ts = ts - ds = self.ds = ts[0] axis = fix_axis(axis, ds) (bounds, center, display_center) = \ get_window_parameters(axis, center, width, ds) if field_parameters is None: field_parameters = {} + if ds.geometry == "spherical" or ds.geometry == "cylindrical": + mylog.info("Setting origin='native' for %s geometry." % ds.geometry) + origin = 'native' + if isinstance(ds, YTSpatialPlotDataset): slc = ds.all_data() slc.axis = axis @@ -1264,7 +1267,7 @@ validate_mesh_fields(slc, fields) PWViewerMPL.__init__(self, slc, bounds, origin=origin, fontsize=fontsize, fields=fields, - window_size=window_size, aspect=aspect) + window_size=window_size, aspect=aspect, right_handed=right_handed) if axes_unit is None: axes_unit = get_axes_unit(width, ds) self.set_axes_unit(axes_unit) @@ -1319,39 +1322,49 @@ units are assumed, for example (0.2, 0.3) requests a plot that has an x width of 0.2 and a y width of 0.3 in code units. If units are provided the resulting plot axis labels will use the supplied units. - axes_unit : A string + axes_unit : string The name of the unit for the tick labels on the x and y axes. Defaults to None, which automatically picks an appropriate unit. If axes_unit is '1', 'u', or 'unitary', it will not display the units, and only show the axes name. - origin : string or length 1, 2, or 3 sequence of strings - The location of the origin of the plot coordinate system. This is - represented by '-' separated string or a tuple of strings. In the - first index the y-location is given by 'lower', 'upper', or 'center'. - The second index is the x-location, given as 'left', 'right', or - 'center'. Finally, whether the origin is applied in 'domain' - space, plot 'window' space or 'native' simulation coordinate system - is given. For example, both 'upper-right-domain' and ['upper', - 'right', 'domain'] place the origin in the upper right hand - corner of domain space. If x or y are not given, a value is inferred. - For instance, 'left-domain' corresponds to the lower-left hand corner - of the simulation domain, 'center-domain' corresponds to the center - of the simulation domain, or 'center-window' for the center of the - plot window. Further examples: - - ================================== ============================ - format example - ================================== ============================ - '{space}' 'domain' - '{xloc}-{space}' 'left-window' - '{yloc}-{space}' 'upper-domain' - '{yloc}-{xloc}-{space}' 'lower-right-window' - ('{space}',) ('window',) - ('{xloc}', '{space}') ('right', 'domain') - ('{yloc}', '{space}') ('lower', 'window') - ('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window') - ================================== ============================ - + origin : string or length 1, 2, or 3 sequence. + The location of the origin of the plot coordinate system. This + is typically represented by a '-' separated string or a tuple of + strings. In the first index the y-location is given by 'lower', + 'upper', or 'center'. The second index is the x-location, given as + 'left', 'right', or 'center'. Finally, whether the origin is + applied in 'domain' space, plot 'window' space or 'native' + simulation coordinate system is given. For example, both + 'upper-right-domain' and ['upper', 'right', 'domain'] place the + origin in the upper right hand corner of domain space. If x or y + are not given, a value is inferred. For instance, 'left-domain' + corresponds to the lower-left hand corner of the simulation domain, + 'center-domain' corresponds to the center of the simulation domain, + or 'center-window' for the center of the plot window. In the event + that none of these options place the origin in a desired location, + a sequence of tuples and a string specifying the + coordinate space can be given. If plain numeric types are input, + units of `code_length` are assumed. Further examples: + + =============================================== ================================== + format example + =============================================== ================================== + '{space}' 'domain' + '{xloc}-{space}' 'left-window' + '{yloc}-{space}' 'upper-domain' + '{yloc}-{xloc}-{space}' 'lower-right-window' + ('{space}',) ('window',) + ('{xloc}', '{space}') ('right', 'domain') + ('{yloc}', '{space}') ('lower', 'window') + ('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window') + ((yloc, '{unit}'), (xloc, '{unit}'), '{space}') ((0.5, 'm'), (0.4, 'm'), 'window') + (xloc, yloc, '{space}') (0.23, 0.5, 'domain') + =============================================== ================================== + + right_handed : boolean + Whether the implicit east vector for the image generated is set to make a right + handed coordinate system with the direction of the + 'window' into the data. data_source : YTSelectionContainer Object Object to be used for data selection. Defaults to a region covering the entire simulation. @@ -1362,7 +1375,7 @@ fontsize : integer The size of the fonts for the axis, colorbar, and tick labels. method : string - The method of projection. Valid methods are: + The method of projection. Valid methods are: "integrate" with no weight_field specified : integrate the requested field along the line of sight. @@ -1372,13 +1385,13 @@ "mip" : pick out the maximum value of the field in the line of sight. - "sum" : This method is the same as integrate, except that it does not - multiply by a path length when performing the integration, and is + "sum" : This method is the same as integrate, except that it does not + multiply by a path length when performing the integration, and is just a straight summation of the field along the given axis. WARNING: This should only be used for uniform resolution grid datasets, as other datasets may result in unphysical images. proj_style : string - The method of projection--same as method keyword. Deprecated as of + The method of projection--same as method keyword. Deprecated as of version 3.0.2. Please use method instead. window_size : float The size of the window in inches. Set to 8 by default. @@ -1387,6 +1400,9 @@ field_parameters : dictionary A dictionary of field parameters than can be accessed by derived fields. + data_source: YTSelectionContainer object + Object to be used for data selection. Defaults to ds.all_data(), a + region covering the full domain Examples -------- @@ -1404,14 +1420,11 @@ def __init__(self, ds, axis, fields, center='c', width=None, axes_unit=None, weight_field=None, max_level=None, origin='center-window', - fontsize=18, field_parameters=None, data_source=None, - method = "integrate", proj_style = None, window_size=8.0, + right_handed=True, fontsize=18, field_parameters=None, data_source=None, + method = "integrate", proj_style = None, window_size=8.0, aspect=None): - ts = self._initialize_dataset(ds) - self.ts = ts - ds = self.ds = ts[0] axis = fix_axis(axis, ds) - # proj_style is deprecated, but if someone specifies then it trumps + # proj_style is deprecated, but if someone specifies then it trumps # method. if proj_style is not None: method = proj_style @@ -1433,14 +1446,17 @@ if proj.axis != ds.parameters["axis"]: raise RuntimeError("Original projection axis is %s." % ds.parameters["axis"]) - proj.weight_field = proj._determine_fields(weight_field)[0] + if weight_field is not None: + proj.weight_field = proj._determine_fields(weight_field)[0] + else: + proj.weight_field = weight_field else: proj = ds.proj(fields, axis, weight_field=weight_field, center=center, data_source=data_source, field_parameters=field_parameters, method=method, max_level=max_level) PWViewerMPL.__init__(self, proj, bounds, fields=fields, origin=origin, - fontsize=fontsize, window_size=window_size, + right_handed=right_handed, fontsize=fontsize, window_size=window_size, aspect=aspect) if axes_unit is None: axes_unit = get_axes_unit(width, ds) @@ -1458,7 +1474,7 @@ Parameters ---------- - ds : :class:`yt.data_objects.api.Dataset` + ds : :class:`yt.data_objects.static_output.Dataset` This is the dataset object corresponding to the simulation output to be plotted. normal : a sequence of floats @@ -1495,7 +1511,7 @@ units are assumed, for example (0.2, 0.3) requests a plot that has an x width of 0.2 and a y width of 0.3 in code units. If units are provided the resulting plot axis labels will use the supplied units. - axes_unit : A string + axes_unit : string The name of the unit for the tick labels on the x and y axes. Defaults to None, which automatically picks an appropriate unit. If axes_unit is '1', 'u', or 'unitary', it will not display the @@ -1504,21 +1520,25 @@ A vector defining the 'up' direction in the plot. This option sets the orientation of the slicing plane. If not set, an arbitrary grid-aligned north-vector is chosen. + right_handed : boolean + Whether the implicit east vector for the image generated is set to make a right + handed coordinate system with the north vector and the normal, the direction of the + 'window' into the data. fontsize : integer The size of the fonts for the axis, colorbar, and tick labels. field_parameters : dictionary A dictionary of field parameters than can be accessed by derived fields. data_source : YTSelectionContainer Object - Object to be used for data selection. Defaults to a region covering - the entire simulation. + Object to be used for data selection. Defaults ds.all_data(), a + region covering the full domain. """ _plot_type = 'OffAxisSlice' - _frb_generator = ObliqueFixedResolutionBuffer + _frb_generator = FixedResolutionBuffer def __init__(self, ds, normal, fields, center='c', width=None, - axes_unit=None, north_vector=None, fontsize=18, + axes_unit=None, north_vector=None, right_handed=True, fontsize=18, field_parameters=None, data_source=None): (bounds, center_rot) = get_oblique_window_parameters(normal,center,width,ds) if field_parameters is None: @@ -1538,7 +1558,7 @@ # aren't well-defined for off-axis data objects PWViewerMPL.__init__(self, cutting, bounds, fields=fields, origin='center-window',periodic=False, - oblique=True, fontsize=fontsize) + right_handed=right_handed, oblique=True, fontsize=fontsize) if axes_unit is None: axes_unit = get_axes_unit(width, ds) self.set_axes_unit(axes_unit) @@ -1549,13 +1569,17 @@ def __init__(self, center, ds, normal_vector, width, fields, interpolated, resolution = (800,800), weight=None, volume=None, no_ghost=False, le=None, re=None, - north_vector=None, method="integrate"): + north_vector=None, method="integrate", + data_source=None): self.center = center self.ds = ds self.axis = 4 # always true for oblique data objects self.normal_vector = normal_vector self.width = width - self.dd = ds.all_data() + if data_source is None: + self.dd = ds.all_data() + else: + self.dd = data_source fields = self.dd._determine_fields(fields) self.fields = fields self.interpolated = interpolated @@ -1586,7 +1610,7 @@ Parameters ---------- - ds : :class:`yt.data_objects.api.Dataset` + ds : :class:`yt.data_objects.static_output.Dataset` This is the dataset object corresponding to the simulation output to be plotted. normal : a sequence of floats @@ -1631,7 +1655,7 @@ The name of the weighting field. Set to None for no weight. max_level: int The maximum level to project to. - axes_unit : A string + axes_unit : string The name of the unit for the tick labels on the x and y axes. Defaults to None, which automatically picks an appropriate unit. If axes_unit is '1', 'u', or 'unitary', it will not display the @@ -1640,6 +1664,10 @@ A vector defining the 'up' direction in the plot. This option sets the orientation of the slicing plane. If not set, an arbitrary grid-aligned north-vector is chosen. + right_handed : boolean + Whether the implicit east vector for the image generated is set to make a right + handed coordinate system with the north vector and the normal, the direction of the + 'window' into the data. fontsize : integer The size of the fonts for the axis, colorbar, and tick labels. method : string @@ -1656,14 +1684,19 @@ just a straight summation of the field along the given axis. WARNING: This should only be used for uniform resolution grid datasets, as other datasets may result in unphysical images. + data_source: YTSelectionContainer object + Object to be used for data selection. Defaults to ds.all_data(), a + region covering the full domain """ _plot_type = 'OffAxisProjection' _frb_generator = OffAxisProjectionFixedResolutionBuffer def __init__(self, ds, normal, fields, center='c', width=None, depth=(1, '1'), axes_unit=None, weight_field=None, - max_level=None, north_vector=None, volume=None, no_ghost=False, - le=None, re=None, interpolated=False, fontsize=18, method="integrate"): + max_level=None, north_vector=None, right_handed=True, + volume=None, no_ghost=False, le=None, re=None, + interpolated=False, fontsize=18, method="integrate", + data_source=None): (bounds, center_rot) = \ get_oblique_window_parameters(normal,center,width,ds,depth=depth) fields = ensure_list(fields)[:] @@ -1673,7 +1706,8 @@ OffAxisProj = OffAxisProjectionDummyDataSource( center_rot, ds, normal, oap_width, fields, interpolated, weight=weight_field, volume=volume, no_ghost=no_ghost, - le=le, re=re, north_vector=north_vector, method=method) + le=le, re=re, north_vector=north_vector, method=method, + data_source=data_source) validate_mesh_fields(OffAxisProj, fields) @@ -1689,7 +1723,8 @@ # aren't well-defined for off-axis data objects PWViewerMPL.__init__( self, OffAxisProj, bounds, fields=fields, origin='center-window', - periodic=False, oblique=True, fontsize=fontsize) + periodic=False, oblique=True, right_handed=right_handed, + fontsize=fontsize) if axes_unit is None: axes_unit = get_axes_unit(width, ds) self.set_axes_unit(axes_unit) @@ -1758,7 +1793,7 @@ Parameters ---------- - ds : :class:`yt.data_objects.api.Dataset` + ds : :class:`yt.data_objects.static_output.Dataset` This is the dataset object corresponding to the simulation output to be plotted. normal : int or one of 'x', 'y', 'z', or sequence of floats @@ -1806,40 +1841,45 @@ units are assumed, for example (0.2, 0.3) requests a plot that has an x width of 0.2 and a y width of 0.3 in code units. If units are provided the resulting plot axis labels will use the supplied units. - axes_unit : A string + axes_unit : string The name of the unit for the tick labels on the x and y axes. Defaults to None, which automatically picks an appropriate unit. If axes_unit is '1', 'u', or 'unitary', it will not display the units, and only show the axes name. - origin : string or length 1, 2, or 3 sequence of strings + origin : string or length 1, 2, or 3 sequence. The location of the origin of the plot coordinate system for - `AxisAlignedSlicePlot` objects; for `OffAxisSlicePlot` objects, - this parameter is discarded. This is represented by '-' separated - string or a tuple of strings. In the first index the y-location is - given by 'lower', 'upper', or 'center'. The second index is the - x-location, given as 'left', 'right', or 'center'. Finally, - whether the origin is applied in 'domain' space, plot 'window' space - or 'native' simulation coordinate system is given. For example, both + `AxisAlignedSlicePlot` object; for `OffAxisSlicePlot` objects this + parameter is discarded. This is typically represented by a '-' + separated string or a tuple of strings. In the first index the + y-location is given by 'lower', 'upper', or 'center'. The second index + is the x-location, given as 'left', 'right', or 'center'. Finally, the + whether the origin is applied in 'domain' space, plot 'window' space or + 'native' simulation coordinate system is given. For example, both 'upper-right-domain' and ['upper', 'right', 'domain'] place the - origin in the upper right hand corner of domain space. If x or y are - not given, a value is inferred. For instance, 'left-domain' + origin in the upper right hand corner of domain space. If x or y + are not given, a value is inferred. For instance, 'left-domain' corresponds to the lower-left hand corner of the simulation domain, 'center-domain' corresponds to the center of the simulation domain, - or 'center-window' for the center of the plot window. Further - examples: - - ================================== ============================ - format example - ================================== ============================ - '{space}' 'domain' - '{xloc}-{space}' 'left-window' - '{yloc}-{space}' 'upper-domain' - '{yloc}-{xloc}-{space}' 'lower-right-window' - ('{space}',) ('window',) - ('{xloc}', '{space}') ('right', 'domain') - ('{yloc}', '{space}') ('lower', 'window') - ('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window') - ================================== ============================ + or 'center-window' for the center of the plot window. In the event + that none of these options place the origin in a desired location, + a sequence of tuples and a string specifying the + coordinate space can be given. If plain numeric types are input, + units of `code_length` are assumed. Further examples: + + =============================================== ================================== + format example + =============================================== ================================== + '{space}' 'domain' + '{xloc}-{space}' 'left-window' + '{yloc}-{space}' 'upper-domain' + '{yloc}-{xloc}-{space}' 'lower-right-window' + ('{space}',) ('window',) + ('{xloc}', '{space}') ('right', 'domain') + ('{yloc}', '{space}') ('lower', 'window') + ('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window') + ((yloc, '{unit}'), (xloc, '{unit}'), '{space}') ((0.5, 'm'), (0.4, 'm'), 'window') + (xloc, yloc, '{space}') (0.23, 0.5, 'domain') + =============================================== ================================== north_vector : a sequence of floats A vector defining the 'up' direction in the `OffAxisSlicePlot`; not used in `AxisAlignedSlicePlot`. This option sets the orientation of the @@ -1911,3 +1951,124 @@ del kwargs['north_vector'] return AxisAlignedSlicePlot(ds, normal, fields, *args, **kwargs) + +def plot_2d(ds, fields, center='c', width=None, axes_unit=None, + origin='center-window', fontsize=18, field_parameters=None, + window_size=8.0, aspect=None, data_source=None): + r"""Creates a plot of a 2D dataset + + Given a ds object and a field name string, this will return a + PWViewerMPL object containing the plot. + + The plot can be updated using one of the many helper functions + defined in PlotWindow. + + Parameters + ---------- + ds : `Dataset` + This is the dataset object corresponding to the + simulation output to be plotted. + fields : string + The name of the field(s) to be plotted. + center : A sequence of floats, a string, or a tuple. + The coordinate of the center of the image. If set to 'c', 'center' or + left blank, the plot is centered on the middle of the domain. If set to + 'max' or 'm', the center will be located at the maximum of the + ('gas', 'density') field. Centering on the max or min of a specific + field is supported by providing a tuple such as ("min","temperature") or + ("max","dark_matter_density"). Units can be specified by passing in *center* + as a tuple containing a coordinate and string unit name or by passing + in a YTArray. If a list or unitless array is supplied, code units are + assumed. For plot_2d, this keyword accepts a coordinate in two dimensions. + width : tuple or a float. + Width can have four different formats to support windows with variable + x and y widths. They are: + + ================================== ======================= + format example + ================================== ======================= + (float, string) (10,'kpc') + ((float, string), (float, string)) ((10,'kpc'),(15,'kpc')) + float 0.2 + (float, float) (0.2, 0.3) + ================================== ======================= + + For example, (10, 'kpc') requests a plot window that is 10 kiloparsecs + wide in the x and y directions, ((10,'kpc'),(15,'kpc')) requests a + window that is 10 kiloparsecs wide along the x axis and 15 + kiloparsecs wide along the y axis. In the other two examples, code + units are assumed, for example (0.2, 0.3) requests a plot that has an + x width of 0.2 and a y width of 0.3 in code units. If units are + provided the resulting plot axis labels will use the supplied units. + origin : string or length 1, 2, or 3 sequence. + The location of the origin of the plot coordinate system. This + is typically represented by a '-' separated string or a tuple of + strings. In the first index the y-location is given by 'lower', + 'upper', or 'center'. The second index is the x-location, given as + 'left', 'right', or 'center'. Finally, whether the origin is + applied in 'domain' space, plot 'window' space or 'native' + simulation coordinate system is given. For example, both + 'upper-right-domain' and ['upper', 'right', 'domain'] place the + origin in the upper right hand corner of domain space. If x or y + are not given, a value is inferred. For instance, 'left-domain' + corresponds to the lower-left hand corner of the simulation domain, + 'center-domain' corresponds to the center of the simulation domain, + or 'center-window' for the center of the plot window. In the event + that none of these options place the origin in a desired location, + a sequence of tuples and a string specifying the + coordinate space can be given. If plain numeric types are input, + units of `code_length` are assumed. Further examples: + + =============================================== ================================== + format example + =============================================== ================================== + '{space}' 'domain' + '{xloc}-{space}' 'left-window' + '{yloc}-{space}' 'upper-domain' + '{yloc}-{xloc}-{space}' 'lower-right-window' + ('{space}',) ('window',) + ('{xloc}', '{space}') ('right', 'domain') + ('{yloc}', '{space}') ('lower', 'window') + ('{yloc}', '{xloc}', '{space}') ('lower', 'right', 'window') + ((yloc, '{unit}'), (xloc, '{unit}'), '{space}') ((0.5, 'm'), (0.4, 'm'), 'window') + (xloc, yloc, '{space}') (0.23, 0.5, 'domain') + =============================================== ================================== + axes_unit : string + The name of the unit for the tick labels on the x and y axes. + Defaults to None, which automatically picks an appropriate unit. + If axes_unit is '1', 'u', or 'unitary', it will not display the + units, and only show the axes name. + fontsize : integer + The size of the fonts for the axis, colorbar, and tick labels. + field_parameters : dictionary + A dictionary of field parameters than can be accessed by derived + fields. + data_source: YTSelectionContainer object + Object to be used for data selection. Defaults to ds.all_data(), a + region covering the full domain + """ + if ds.dimensionality != 2: + raise RuntimeError("plot_2d only plots 2D datasets!") + if ds.geometry == "cartesian" or ds.geometry == "polar": + axis = "z" + elif ds.geometry == "cylindrical": + axis = "theta" + # Part of the convenience of plot_2d is to eliminate the use of the + # superfluous coordinate, so we do that also with the center argument + if not isinstance(center, string_types) and obj_length(center) == 2: + c0_string = isinstance(center[0], string_types) + c1_string = isinstance(center[1], string_types) + if not c0_string and not c1_string: + if obj_length(center[0]) == 2 and c1_string: + center = ds.arr(center[0], center[1]) + elif not isinstance(center, YTArray): + center = ds.arr(center, 'code_length') + center.convert_to_units("code_length") + center = ds.arr([center[0], center[1], + ds.domain_center[2]]) + return AxisAlignedSlicePlot(ds, axis, fields, center=center, width=width, + axes_unit=axes_unit, origin=origin, + fontsize=fontsize, + field_parameters=field_parameters, + window_size=window_size, aspect=aspect, + data_source=data_source) diff -Nru yt-3.3.3/yt/visualization/profile_plotter.py yt-3.4.0/yt/visualization/profile_plotter.py --- yt-3.3.3/yt/visualization/profile_plotter.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/profile_plotter.py 2017-08-10 18:02:57.000000000 +0000 @@ -20,11 +20,11 @@ from collections import OrderedDict import base64 import os +from functools import wraps import matplotlib import numpy as np - from .base_plot_types import \ PlotMPL, ImagePlotMPL from .plot_container import \ @@ -41,8 +41,8 @@ from yt.funcs import \ ensure_list, \ get_image_suffix, \ - get_ipython_api_version, \ - matplotlib_style_context + matplotlib_style_context, \ + iterable def get_canvas(name): from . import _mpl_imports as mpl @@ -61,7 +61,15 @@ canvas_cls = mpl.FigureCanvasAgg return canvas_cls -class PlotContainer(OrderedDict): +def invalidate_profile(f): + @wraps(f) + def newfunc(*args, **kwargs): + rv = f(*args, **kwargs) + args[0]._profile_valid = False + return rv + return newfunc + +class PlotContainerDict(OrderedDict): def __missing__(self, key): plot = PlotMPL((10, 8), [0.1, 0.1, 0.8, 0.8], None, None) self[key] = plot @@ -84,6 +92,7 @@ def __init__(self, plots): self.plots = plots self.ylim = {} + self.xlim = (None, None) super(AxesContainer, self).__init__() def __missing__(self, key): @@ -234,7 +243,7 @@ plot_spec = [plot_spec.copy() for p in profiles] ProfilePlot._initialize_instance(self, profiles, label, plot_spec, y_log) - + @validate_plot def save(self, name=None, suffix=None, mpl_kwargs=None): r""" @@ -312,12 +321,8 @@ """ if "__IPYTHON__" in dir(builtins): - api_version = get_ipython_api_version() - if api_version in ('0.10', '0.11'): - self._send_zmq() - else: - from IPython.display import display - display(self) + from IPython.display import display + display(self) else: raise YTNotInsideNotebook @@ -349,16 +354,19 @@ self.axes[field].plot(np.array(profile.x), np.array(field_data), label=self.label[i], **self.plot_spec[i]) - for (fname, axes), profile in zip(self.axes.items(), self.profiles): - xscale, yscale = self._get_field_log(fname, profile) - xtitle, ytitle = self._get_field_title(fname, profile) - axes.set_xscale(xscale) - axes.set_yscale(yscale) - axes.set_xlabel(xtitle) - axes.set_ylabel(ytitle) - axes.set_ylim(*self.axes.ylim[fname]) - if any(self.label): - axes.legend(loc="best") + for profile in self.profiles: + for fname in profile.keys(): + axes = self.axes[fname] + xscale, yscale = self._get_field_log(fname, profile) + xtitle, ytitle = self._get_field_title(fname, profile) + axes.set_xscale(xscale) + axes.set_yscale(yscale) + axes.set_xlabel(xtitle) + axes.set_ylabel(ytitle) + axes.set_ylim(*self.axes.ylim[fname]) + axes.set_xlim(*self.axes.xlim) + if any(self.label): + axes.legend(loc="best") self._set_font_properties() self._plot_valid = True @@ -379,7 +387,7 @@ if plot_specs is None: plot_specs = [dict() for p in obj.profiles] obj.plot_spec = plot_specs - obj.plots = PlotContainer() + obj.plots = PlotContainerDict() obj.figures = FigureContainer(obj.plots) obj.axes = AxesContainer(obj.plots) obj._setup_plots() @@ -539,6 +547,7 @@ >>> pp.save() """ + self.axes.xlim = (xmin, xmax) for i, p in enumerate(self.profiles): if xmin is None: xmi = p.x_bins.min() @@ -728,6 +737,7 @@ y_log = None plot_title = None _plot_valid = False + _profile_valid = False _plot_type = 'Phase' _xlim = (None, None) _ylim = (None, None) @@ -765,7 +775,10 @@ obj._text_xpos = {} obj._text_ypos = {} obj._text_kwargs = {} - obj.profile = profile + obj._profile = profile + obj._profile_valid = True + obj._xlim = (None, None) + obj._ylim = (None, None) super(PhasePlot, obj).__init__(data_source, figure_size, fontsize) obj._setup_plots() obj._initfinished = True @@ -827,6 +840,12 @@ # needed for API compatibility with PlotWindow pass + @property + def profile(self): + if not self._profile_valid: + self._recreate_profile() + return self._profile + def _setup_plots(self): if self._plot_valid: return @@ -1162,7 +1181,7 @@ >>> plot.annotate_title("This is a phase plot") """ - for f in self.profile.field_data: + for f in self._profile.field_data: if isinstance(f, tuple): f = f[1] self.plot_title[self.data_source._determine_fields(f)[0]] = title @@ -1184,18 +1203,22 @@ log : boolean Log on/off. """ + p = self._profile if field == "all": self.x_log = log self.y_log = log - for field in self.profile.field_data: + for field in p.field_data: self.z_log[field] = log + self._profile_valid = False else: - if field == self.profile.x_field[1]: + if field == p.x_field[1]: self.x_log = log - elif field == self.profile.y_field[1]: + self._profile_valid = False + elif field == p.y_field[1]: self.y_log = log - elif field in self.profile.field_map: - self.z_log[self.profile.field_map[field]] = log + self._profile_valid = False + elif field in p.field_map: + self.z_log[p.field_map[field]] = log else: raise KeyError("Field %s not in phase plot!" % (field)) return self @@ -1225,6 +1248,7 @@ return self @invalidate_plot + @invalidate_profile def set_xlim(self, xmin=None, xmax=None): """Sets the limits of the x bin field @@ -1232,12 +1256,12 @@ ---------- xmin : float or None - The new x minimum. Defaults to None, which leaves the xmin - unchanged. + The new x minimum in the current x-axis units. Defaults to None, + which leaves the xmin unchanged. xmax : float or None - The new x maximum. Defaults to None, which leaves the xmax - unchanged. + The new x maximum in the current x-axis units. Defaults to None, + which leaves the xmax unchanged. Examples -------- @@ -1249,47 +1273,20 @@ >>> pp.save() """ - p = self.profile + p = self._profile if xmin is None: xmin = p.x_bins.min() + elif not hasattr(xmin, 'units'): + xmin = self.ds.quan(xmin, p.x_bins.units) if xmax is None: xmax = p.x_bins.max() - units = {p.x_field: str(p.x.units), - p.y_field: str(p.y.units)} - zunits = dict((field, str(p.field_units[field])) for field in p.field_units) - extrema = {p.x_field: ((xmin, str(p.x.units)), (xmax, str(p.x.units))), - p.y_field: ((p.y_bins.min(), str(p.y.units)), - (p.y_bins.max(), str(p.y.units)))} - if self.x_log is not None or self.y_log is not None: - logs = {} - else: - logs = None - if self.x_log is not None: - logs[p.x_field] = self.x_log - if self.y_log is not None: - logs[p.y_field] = self.y_log - deposition = getattr(self.profile, "deposition", None) - if deposition is None: - additional_kwargs = {'accumulation': p.accumulation, - 'fractional': p.fractional} - else: - additional_kwargs = {'deposition': p.deposition} - self.profile = create_profile( - p.data_source, - [p.x_field, p.y_field], - list(p.field_map.values()), - n_bins=[len(p.x_bins)-1, len(p.y_bins)-1], - weight_field=p.weight_field, - units=units, - extrema=extrema, - logs=logs, - **additional_kwargs) - for field in zunits: - self.profile.set_field_unit(field, zunits[field]) + elif not hasattr(xmax, 'units'): + xmax = self.ds.quan(xmax, p.x_bins.units) self._xlim = (xmin, xmax) return self @invalidate_plot + @invalidate_profile def set_ylim(self, ymin=None, ymax=None): """Sets the plot limits for the y bin field. @@ -1297,12 +1294,12 @@ ---------- ymin : float or None - The new y minimum. Defaults to None, which leaves the ymin - unchanged. + The new y minimum in the current y-axis units. Defaults to None, + which leaves the ymin unchanged. ymax : float or None - The new y maximum. Defaults to None, which leaves the ymax - unchanged. + The new y maximum in the current y-axis units. Defaults to None, + which leaves the ymax unchanged. Examples -------- @@ -1314,17 +1311,24 @@ >>> pp.save() """ - p = self.profile + p = self._profile if ymin is None: ymin = p.y_bins.min() + elif not hasattr(ymin, 'units'): + ymin = self.ds.quan(ymin, p.y_bins.units) if ymax is None: ymax = p.y_bins.max() + elif not hasattr(ymax, 'units'): + ymax = self.ds.quan(ymax, p.y_bins.units) + self._ylim = (ymin, ymax) + return self + + def _recreate_profile(self): + p = self._profile units = {p.x_field: str(p.x.units), p.y_field: str(p.y.units)} zunits = dict((field, str(p.field_units[field])) for field in p.field_units) - extrema = {p.x_field: ((p.x_bins.min(), str(p.x.units)), - (p.x_bins.max(), str(p.x.units))), - p.y_field: ((ymin, str(p.y.units)), (ymax, str(p.y.units)))} + extrema = {p.x_field: self._xlim, p.y_field: self._ylim} if self.x_log is not None or self.y_log is not None: logs = {} else: @@ -1333,13 +1337,11 @@ logs[p.x_field] = self.x_log if self.y_log is not None: logs[p.y_field] = self.y_log - deposition = getattr(self.profile, "deposition", None) - if deposition is None: - additional_kwargs = {'accumulation': p.accumulation, - 'fractional': p.fractional} - else: - additional_kwargs = {'deposition': p.deposition} - self.profile = create_profile( + deposition = getattr(p, "deposition", None) + additional_kwargs = {'accumulation': p.accumulation, + 'fractional': p.fractional, + 'deposition': deposition} + self._profile = create_profile( p.data_source, [p.x_field, p.y_field], list(p.field_map.values()), @@ -1350,9 +1352,8 @@ logs=logs, **additional_kwargs) for field in zunits: - self.profile.set_field_unit(field, zunits[field]) - self._ylim = (ymin, ymax) - return self + self._profile.set_field_unit(field, zunits[field]) + self._profile_valid = True class PhasePlotMPL(ImagePlotMPL): @@ -1370,7 +1371,10 @@ if fontscale < 1.0: fontscale = np.sqrt(fontscale) - self._cb_size = 0.0375*figure_size + if iterable(figure_size): + self._cb_size = 0.0375*figure_size[0] + else: + self._cb_size = 0.0375*figure_size self._ax_text_size = [1.1*fontscale, 0.9*fontscale] self._top_buff_size = 0.30*fontscale self._aspect = 1.0 diff -Nru yt-3.3.3/yt/visualization/streamlines.py yt-3.4.0/yt/visualization/streamlines.py --- yt-3.3.3/yt/visualization/streamlines.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/streamlines.py 2017-08-10 18:02:57.000000000 +0000 @@ -37,17 +37,17 @@ Parameters ---------- - ds : `~yt.data_objects.Dataset` + ds : ~yt.data_objects.static_output.Dataset This is the dataset to streamline pos : array_like An array of initial starting positions of the streamlines. - xfield: field, optional + xfield : str or tuple of str, optional The x component of the vector field to be streamlined. Default:'velocity_x' - yfield: field, optional + yfield : str or tuple of str, optional The y component of the vector field to be streamlined. Default:'velocity_y' - zfield: field, optional + zfield : str or tuple of str, optional The z component of the vector field to be streamlined. Default:'velocity_z' volume : `yt.extensions.volume_rendering.AMRKDTree`, optional diff -Nru yt-3.3.3/yt/visualization/tests/test_callbacks.py yt-3.4.0/yt/visualization/tests/test_callbacks.py --- yt-3.3.3/yt/visualization/tests/test_callbacks.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/tests/test_callbacks.py 2017-08-10 18:02:57.000000000 +0000 @@ -23,9 +23,9 @@ from yt.testing import \ fake_amr_ds, \ fake_tetrahedral_ds, \ - fake_hexahedral_ds + fake_hexahedral_ds, \ + assert_fname import yt.units as u -from .test_plotwindow import assert_fname from yt.utilities.exceptions import \ YTPlotCallbackError, \ YTDataTypeUnsupported @@ -56,7 +56,7 @@ # hop_particles # coord_axes # X text -# particles +# X particles # title # flash_ray_data # X timestamp @@ -78,13 +78,13 @@ ds = fake_amr_ds(fields = ("density",)) p = ProjectionPlot(ds, ax, "density") p.annotate_timestamp() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_timestamp() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = OffAxisSlicePlot(ds, vector, "density") p.annotate_timestamp() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_timestamp(corner='lower_right', redshift=True, @@ -95,10 +95,10 @@ ds = fake_amr_ds(fields = ("density",), geometry="spherical") p = ProjectionPlot(ds, "r", "density") p.annotate_timestamp(coord_system="data") - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) p = ProjectionPlot(ds, "r", "density") p.annotate_timestamp(coord_system="axis") - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) def test_scale_callback(): with _cleanup_fname() as prefix: @@ -107,32 +107,38 @@ ds = fake_amr_ds(fields = ("density",)) p = ProjectionPlot(ds, ax, "density") p.annotate_scale() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) + p = ProjectionPlot(ds, ax, "density", width=(0.5, 1.0)) + p.annotate_scale() + assert_fname(p.save(prefix)[0]) + p = ProjectionPlot(ds, ax, "density", width=(1.0, 1.5)) + p.annotate_scale() + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_scale() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = OffAxisSlicePlot(ds, vector, "density") p.annotate_scale() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_scale(corner='upper_right', coeff=10., unit='kpc') - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, "x", "density") p.annotate_scale(text_args={"size": 24}) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, "x", "density") p.annotate_scale(text_args={"font": 24}) - yield assert_raises, YTPlotCallbackError + assert_raises(YTPlotCallbackError) with _cleanup_fname() as prefix: ds = fake_amr_ds(fields = ("density",), geometry="spherical") p = ProjectionPlot(ds, "r", "density") p.annotate_scale() - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) p = ProjectionPlot(ds, "r", "density") p.annotate_scale(coord_system="axis") - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) def test_line_callback(): with _cleanup_fname() as prefix: @@ -141,13 +147,13 @@ ds = fake_amr_ds(fields = ("density",)) p = ProjectionPlot(ds, ax, "density") p.annotate_line([0.1,0.1,0.1],[0.5,0.5,0.5]) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_line([0.1,0.1,0.1],[0.5,0.5,0.5]) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = OffAxisSlicePlot(ds, vector, "density") p.annotate_line([0.1,0.1,0.1],[0.5,0.5,0.5]) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_line([0.1,0.1],[0.5,0.5], coord_system='axis', @@ -158,10 +164,10 @@ ds = fake_amr_ds(fields = ("density",), geometry="spherical") p = ProjectionPlot(ds, "r", "density") p.annotate_line([0.1,0.1,0.1],[0.5,0.5,0.5]) - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) p = ProjectionPlot(ds, "r", "density") p.annotate_line([0.1,0.1],[0.5,0.5], coord_system="axis") - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) def test_ray_callback(): with _cleanup_fname() as prefix: @@ -173,15 +179,15 @@ p = ProjectionPlot(ds, ax, "density") p.annotate_ray(oray) p.annotate_ray(ray) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_ray(oray) p.annotate_ray(ray) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = OffAxisSlicePlot(ds, vector, "density") p.annotate_ray(oray) p.annotate_ray(ray) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_ray(oray) @@ -194,10 +200,10 @@ oray = ds.ortho_ray(0, (0.3, 0.4)) p = ProjectionPlot(ds, "r", "density") p.annotate_ray(oray) - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) p = ProjectionPlot(ds, "r", "density") p.annotate_ray(ray) - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) def test_arrow_callback(): with _cleanup_fname() as prefix: @@ -206,13 +212,13 @@ ds = fake_amr_ds(fields = ("density",)) p = ProjectionPlot(ds, ax, "density") p.annotate_arrow([0.5,0.5,0.5]) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_arrow([0.5,0.5,0.5]) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = OffAxisSlicePlot(ds, vector, "density") p.annotate_arrow([0.5,0.5,0.5]) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_arrow([0.5,0.5], coord_system='axis', length=0.05) @@ -222,10 +228,10 @@ ds = fake_amr_ds(fields = ("density",), geometry="spherical") p = ProjectionPlot(ds, "r", "density") p.annotate_arrow([0.5,0.5,0.5]) - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) p = ProjectionPlot(ds, "r", "density") p.annotate_arrow([0.5,0.5], coord_system="axis") - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) def test_marker_callback(): with _cleanup_fname() as prefix: @@ -234,13 +240,13 @@ ds = fake_amr_ds(fields = ("density",)) p = ProjectionPlot(ds, ax, "density") p.annotate_marker([0.5,0.5,0.5]) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_marker([0.5,0.5,0.5]) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = OffAxisSlicePlot(ds, vector, "density") p.annotate_marker([0.5,0.5,0.5]) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_marker([0.5,0.5], coord_system='axis', marker='*') @@ -250,10 +256,33 @@ ds = fake_amr_ds(fields = ("density",), geometry="spherical") p = ProjectionPlot(ds, "r", "density") p.annotate_marker([0.5,0.5,0.5]) - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) p = ProjectionPlot(ds, "r", "density") p.annotate_marker([0.5,0.5], coord_system="axis") - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) + +def test_particles_callback(): + with _cleanup_fname() as prefix: + ax = 'z' + ds = fake_amr_ds(fields=("density",), particles=1) + p = ProjectionPlot(ds, ax, "density") + p.annotate_particles((10, "Mpc")) + assert_fname(p.save(prefix)[0]) + p = SlicePlot(ds, ax, "density") + p.annotate_particles((10, "Mpc")) + assert_fname(p.save(prefix)[0]) + # Now we'll check a few additional minor things + p = SlicePlot(ds, "x", "density") + p.annotate_particles((10, "Mpc"), p_size=1.0, col="k", marker="o", + stride=1, ptype="all", minimum_mass=None, + alpha=1.0) + p.save(prefix) + + with _cleanup_fname() as prefix: + ds = fake_amr_ds(fields=("density",), geometry="spherical") + p = ProjectionPlot(ds, "r", "density") + p.annotate_particles((10, "Mpc")) + assert_raises(YTDataTypeUnsupported, p.save, prefix) def test_sphere_callback(): with _cleanup_fname() as prefix: @@ -262,13 +291,13 @@ ds = fake_amr_ds(fields = ("density",)) p = ProjectionPlot(ds, ax, "density") p.annotate_sphere([0.5,0.5,0.5], 0.1) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_sphere([0.5,0.5,0.5], 0.1) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = OffAxisSlicePlot(ds, vector, "density") p.annotate_sphere([0.5,0.5,0.5], 0.1) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_sphere([0.5,0.5], 0.1, coord_system='axis', text='blah') @@ -278,10 +307,10 @@ ds = fake_amr_ds(fields = ("density",), geometry="spherical") p = ProjectionPlot(ds, "r", "density") p.annotate_sphere([0.5,0.5,0.5], 0.1) - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) p = ProjectionPlot(ds, "r", "density") p.annotate_sphere([0.5,0.5], 0.1, coord_system='axis', text='blah') - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) def test_text_callback(): with _cleanup_fname() as prefix: @@ -290,13 +319,13 @@ ds = fake_amr_ds(fields = ("density",)) p = ProjectionPlot(ds, ax, "density") p.annotate_text([0.5,0.5,0.5], 'dinosaurs!') - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_text([0.5,0.5,0.5], 'dinosaurs!') - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = OffAxisSlicePlot(ds, vector, "density") p.annotate_text([0.5,0.5,0.5], 'dinosaurs!') - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_text([0.5,0.5], 'dinosaurs!', coord_system='axis', @@ -307,11 +336,11 @@ ds = fake_amr_ds(fields = ("density",), geometry="spherical") p = ProjectionPlot(ds, "r", "density") p.annotate_text([0.5,0.5,0.5], 'dinosaurs!') - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) p = ProjectionPlot(ds, "r", "density") p.annotate_text([0.5,0.5], 'dinosaurs!', coord_system='axis', text_args={'color':'red'}) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) def test_velocity_callback(): with _cleanup_fname() as prefix: @@ -320,19 +349,19 @@ for ax in 'xyz': p = ProjectionPlot(ds, ax, "density", weight_field="density") p.annotate_velocity() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_velocity() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Test for OffAxis Slice p = SlicePlot(ds, [1, 1, 0], 'density', north_vector=[0, 0, 1]) p.annotate_velocity(factor=40, normalize=True) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_velocity(factor=8, scale=0.5, scale_units="inches", normalize = True) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) with _cleanup_fname() as prefix: ds = fake_amr_ds(fields = @@ -340,7 +369,7 @@ geometry="spherical") p = ProjectionPlot(ds, "r", "density") p.annotate_velocity(factor=40, normalize=True) - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) def test_magnetic_callback(): with _cleanup_fname() as prefix: @@ -349,19 +378,19 @@ for ax in 'xyz': p = ProjectionPlot(ds, ax, "density", weight_field="density") p.annotate_magnetic_field() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_magnetic_field() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Test for OffAxis Slice p = SlicePlot(ds, [1, 1, 0], 'density', north_vector=[0, 0, 1]) p.annotate_magnetic_field(factor=40, normalize=True) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_magnetic_field(factor=8, scale=0.5, scale_units="inches", normalize = True) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) with _cleanup_fname() as prefix: ds = fake_amr_ds(fields = ("density", "magnetic_field_r", @@ -370,7 +399,7 @@ p = ProjectionPlot(ds, "r", "density") p.annotate_magnetic_field(factor=8, scale=0.5, scale_units="inches", normalize = True) - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) def test_quiver_callback(): with _cleanup_fname() as prefix: @@ -379,20 +408,20 @@ for ax in 'xyz': p = ProjectionPlot(ds, ax, "density") p.annotate_quiver("velocity_x", "velocity_y") - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = ProjectionPlot(ds, ax, "density", weight_field="density") p.annotate_quiver("velocity_x", "velocity_y") - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_quiver("velocity_x", "velocity_y") - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_quiver("velocity_x", "velocity_y", factor=8, scale=0.5, scale_units="inches", normalize = True, bv_x = 0.5 * u.cm / u.s, bv_y = 0.5 * u.cm / u.s) - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) with _cleanup_fname() as prefix: ds = fake_amr_ds(fields = @@ -403,7 +432,7 @@ scale_units="inches", normalize = True, bv_x = 0.5 * u.cm / u.s, bv_y = 0.5 * u.cm / u.s) - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) def test_contour_callback(): with _cleanup_fname() as prefix: @@ -411,13 +440,13 @@ for ax in 'xyz': p = ProjectionPlot(ds, ax, "density") p.annotate_contour("temperature") - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = ProjectionPlot(ds, ax, "density", weight_field="density") p.annotate_contour("temperature") - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_contour("temperature") # BREAKS WITH ndarray - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_contour("temperature", ncont=10, factor=8, @@ -443,7 +472,7 @@ take_log=False, clim=(0.4, 0.6), plot_args={'lw':2.0}, label=True, text_args={'text-size':'x-large'}) - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) def test_grids_callback(): @@ -452,13 +481,13 @@ for ax in 'xyz': p = ProjectionPlot(ds, ax, "density") p.annotate_grids() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = ProjectionPlot(ds, ax, "density", weight_field="density") p.annotate_grids() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_grids() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_grids(alpha=0.7, min_pix=10, min_pix_ids=30, @@ -472,7 +501,7 @@ p.annotate_grids(alpha=0.7, min_pix=10, min_pix_ids=30, draw_ids=True, periodic=False, min_level=2, max_level=3, cmap="gist_stern") - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) def test_cell_edges_callback(): @@ -481,13 +510,13 @@ for ax in 'xyz': p = ProjectionPlot(ds, ax, "density") p.annotate_cell_edges() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = ProjectionPlot(ds, ax, "density", weight_field="density") p.annotate_cell_edges() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_cell_edges() - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_cell_edges(alpha=0.7, line_width=0.9, @@ -498,7 +527,7 @@ ds = fake_amr_ds(fields = ("density",), geometry="spherical") p = SlicePlot(ds, "r", "density") p.annotate_cell_edges() - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) def test_mesh_lines_callback(): with _cleanup_fname() as prefix: @@ -507,13 +536,13 @@ for field in ds.field_list: sl = SlicePlot(ds, 1, field) sl.annotate_mesh_lines(plot_args={'color':'black'}) - yield assert_fname, sl.save(prefix)[0] + assert_fname(sl.save(prefix)[0]) ds = fake_tetrahedral_ds() for field in ds.field_list: sl = SlicePlot(ds, 1, field) sl.annotate_mesh_lines(plot_args={'color':'black'}) - yield assert_fname, sl.save(prefix)[0] + assert_fname(sl.save(prefix)[0]) def test_line_integral_convolution_callback(): @@ -523,13 +552,13 @@ for ax in 'xyz': p = ProjectionPlot(ds, ax, "density") p.annotate_line_integral_convolution("velocity_x", "velocity_y") - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = ProjectionPlot(ds, ax, "density", weight_field="density") p.annotate_line_integral_convolution("velocity_x", "velocity_y") - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) p = SlicePlot(ds, ax, "density") p.annotate_line_integral_convolution("velocity_x", "velocity_y") - yield assert_fname, p.save(prefix)[0] + assert_fname(p.save(prefix)[0]) # Now we'll check a few additional minor things p = SlicePlot(ds, "x", "density") p.annotate_line_integral_convolution("velocity_x", "velocity_y", @@ -544,4 +573,4 @@ geometry="spherical") p = SlicePlot(ds, "r", "density") p.annotate_line_integral_convolution("velocity_theta", "velocity_phi") - yield assert_raises, YTDataTypeUnsupported, p.save, prefix + assert_raises(YTDataTypeUnsupported, p.save, prefix) diff -Nru yt-3.3.3/yt/visualization/tests/test_export_frb.py yt-3.4.0/yt/visualization/tests/test_export_frb.py --- yt-3.3.3/yt/visualization/tests/test_export_frb.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/tests/test_export_frb.py 2017-08-10 18:02:57.000000000 +0000 @@ -31,10 +31,10 @@ frb_ds = frb.export_dataset(fields=["density"], nprocs=8) dd_frb = frb_ds.all_data() - yield assert_equal, frb_ds.domain_left_edge.v, np.array([0.25,0.25,0.0]) - yield assert_equal, frb_ds.domain_right_edge.v, np.array([0.75,0.75,1.0]) - yield assert_equal, frb_ds.domain_width.v, np.array([0.5,0.5,1.0]) - yield assert_equal, frb_ds.domain_dimensions, np.array([64,64,1], dtype="int64") - yield assert_allclose_units, frb["density"].sum(), \ - dd_frb.quantities.total_quantity("density") - yield assert_equal, frb_ds.index.num_grids, 8 + assert_equal(frb_ds.domain_left_edge.v, np.array([0.25,0.25,0.0])) + assert_equal(frb_ds.domain_right_edge.v, np.array([0.75,0.75,1.0])) + assert_equal(frb_ds.domain_width.v, np.array([0.5,0.5,1.0])) + assert_equal(frb_ds.domain_dimensions, np.array([64,64,1], dtype="int64")) + assert_allclose_units(frb["density"].sum(), + dd_frb.quantities.total_quantity("density")) + assert_equal(frb_ds.index.num_grids, 8) diff -Nru yt-3.3.3/yt/visualization/tests/test_fits_image.py yt-3.4.0/yt/visualization/tests/test_fits_image.py --- yt-3.3.3/yt/visualization/tests/test_fits_image.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/visualization/tests/test_fits_image.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,139 @@ +""" +Unit test FITS image creation in yt. + + + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2013, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import tempfile +import os +import shutil +from yt.testing import fake_random_ds, requires_module +from yt.convenience import load +from numpy.testing import \ + assert_equal +from yt.visualization.fits_image import \ + FITSImageData, FITSProjection, \ + FITSSlice, FITSOffAxisSlice, \ + FITSOffAxisProjection, \ + assert_same_wcs +from yt.visualization.volume_rendering.off_axis_projection import \ + off_axis_projection + + +@requires_module("astropy") +def test_fits_image(): + tmpdir = tempfile.mkdtemp() + curdir = os.getcwd() + os.chdir(tmpdir) + + fields = ("density", "temperature") + units = ('g/cm**3', 'K',) + ds = fake_random_ds(64, fields=fields, units=units, nprocs=16, + length_unit=100.0) + + prj = ds.proj("density", 2) + prj_frb = prj.to_frb((0.5, "unitary"), 128) + + fid1 = FITSImageData(prj_frb, fields=["density","temperature"], units="cm") + fits_prj = FITSProjection(ds, "z", [ds.fields.gas.density,"temperature"], image_res=128, + width=(0.5,"unitary")) + + assert_equal(fid1["density"].data, fits_prj["density"].data) + assert_equal(fid1["temperature"].data, fits_prj["temperature"].data) + + fid1.writeto("fid1.fits", clobber=True) + new_fid1 = FITSImageData.from_file("fid1.fits") + + assert_equal(fid1["density"].data, new_fid1["density"].data) + assert_equal(fid1["temperature"].data, new_fid1["temperature"].data) + + ds2 = load("fid1.fits") + ds2.index + + assert ("fits","density") in ds2.field_list + assert ("fits","temperature") in ds2.field_list + + dw_cm = ds2.domain_width.in_units("cm") + + assert dw_cm[0].v == 50. + assert dw_cm[1].v == 50. + + slc = ds.slice(2, 0.5) + slc_frb = slc.to_frb((0.5, "unitary"), 128) + + fid2 = FITSImageData(slc_frb, fields=["density","temperature"], units="cm") + fits_slc = FITSSlice(ds, "z", ["density",("gas","temperature")], image_res=128, + width=(0.5,"unitary")) + + assert_equal(fid2["density"].data, fits_slc["density"].data) + assert_equal(fid2["temperature"].data, fits_slc["temperature"].data) + + dens_img = fid2.pop("density") + temp_img = fid2.pop("temperature") + + # This already has some assertions in it, so we don't need to do anything + # with it other than just make one + FITSImageData.from_images([dens_img, temp_img]) + + cut = ds.cutting([0.1, 0.2, -0.9], [0.5, 0.42, 0.6]) + cut_frb = cut.to_frb((0.5, "unitary"), 128) + + fid3 = FITSImageData(cut_frb, fields=[("gas","density"), ds.fields.gas.temperature], units="cm") + fits_cut = FITSOffAxisSlice(ds, [0.1, 0.2, -0.9], ["density","temperature"], + image_res=128, center=[0.5, 0.42, 0.6], + width=(0.5,"unitary")) + + assert_equal(fid3["density"].data, fits_cut["density"].data) + assert_equal(fid3["temperature"].data, fits_cut["temperature"].data) + + fid3.create_sky_wcs([30.,45.], (1.0,"arcsec/kpc")) + fid3.writeto("fid3.fits", clobber=True) + new_fid3 = FITSImageData.from_file("fid3.fits") + assert_same_wcs(fid3.wcs, new_fid3.wcs) + assert new_fid3.wcs.wcs.cunit[0] == "deg" + assert new_fid3.wcs.wcs.cunit[1] == "deg" + assert new_fid3.wcs.wcs.ctype[0] == "RA---TAN" + assert new_fid3.wcs.wcs.ctype[1] == "DEC--TAN" + + buf = off_axis_projection(ds, ds.domain_center, [0.1, 0.2, -0.9], + 0.5, 128, "density").swapaxes(0, 1) + fid4 = FITSImageData(buf, fields="density", width=100.0) + fits_oap = FITSOffAxisProjection(ds, [0.1, 0.2, -0.9], "density", + width=(0.5, "unitary"), image_res=128, + depth=(0.5, "unitary")) + + assert_equal(fid4["density"].data, fits_oap["density"].data) + + fid4.create_sky_wcs([30., 45.], (1.0, "arcsec/kpc"), replace_old_wcs=False) + assert fid4.wcs.wcs.cunit[0] == "cm" + assert fid4.wcs.wcs.cunit[1] == "cm" + assert fid4.wcs.wcs.ctype[0] == "linear" + assert fid4.wcs.wcs.ctype[1] == "linear" + assert fid4.wcsa.wcs.cunit[0] == "deg" + assert fid4.wcsa.wcs.cunit[1] == "deg" + assert fid4.wcsa.wcs.ctype[0] == "RA---TAN" + assert fid4.wcsa.wcs.ctype[1] == "DEC--TAN" + + cvg = ds.covering_grid(ds.index.max_level, [0.25, 0.25, 0.25], + [32, 32, 32], fields=["density", "temperature"]) + fid5 = FITSImageData(cvg, fields=["density", "temperature"]) + assert fid5.dimensionality == 3 + + fid5.update_header("density", "time", 0.1) + fid5.update_header("all", "units", "cgs") + + assert fid5["density"].header["time"] == 0.1 + assert fid5["temperature"].header["units"] == "cgs" + assert fid5["density"].header["units"] == "cgs" + + os.chdir(curdir) + shutil.rmtree(tmpdir) diff -Nru yt-3.3.3/yt/visualization/tests/test_line_plots.py yt-3.4.0/yt/visualization/tests/test_line_plots.py --- yt-3.3.3/yt/visualization/tests/test_line_plots.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/visualization/tests/test_line_plots.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,81 @@ +""" +Tests for making line plots + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- +import yt +from yt.utilities.answer_testing.framework import \ + requires_ds, \ + data_dir_load, \ + GenericImageTest +from yt.testing import fake_random_ds +import os +import tempfile +import shutil + +def setup(): + """Test specific setup.""" + from yt.config import ytcfg + ytcfg["yt", "__withintesting"] = "True" + +def compare(ds, plot, test_prefix, decimals=12): + def image_from_plot(filename_prefix): + return plot.save(filename_prefix) + + image_from_plot.__name__ = "line_{}".format(test_prefix) + test = GenericImageTest(ds, image_from_plot, decimals) + test.prefix = test_prefix + return test + +tri2 = "SecondOrderTris/RZ_p_no_parts_do_nothing_bcs_cone_out.e" + +@requires_ds(tri2) +def test_line_plot(): + ds = data_dir_load(tri2, kwargs={'step':-1}) + fields = [field for field in ds.field_list if field[0] == 'all'] + plot = yt.LinePlot(ds, fields, (0, 0, 0), (1, 1, 0), 1000) + yield compare(ds, plot, "answers_line_plot") + +@requires_ds(tri2) +def test_multi_line_plot(): + ds = data_dir_load(tri2, kwargs={'step':-1}) + fields = [field for field in ds.field_list if field[0] == 'all'] + lines = [] + lines.append(yt.LineBuffer(ds, [0.25, 0, 0], [0.25, 1, 0], 100, label='x = 0.25')) + lines.append(yt.LineBuffer(ds, [0.5, 0, 0], [0.5, 1, 0], 100, label='x = 0.5')) + plot = yt.LinePlot.from_lines(ds, fields, lines) + yield compare(ds, plot, "answers_multi_line_plot") + +def test_line_plot_methods(): + # Perform I/O in safe place instead of yt main dir + tmpdir = tempfile.mkdtemp() + curdir = os.getcwd() + os.chdir(tmpdir) + + ds = fake_random_ds(32) + + plot = yt.LinePlot(ds, 'density', [0, 0, 0], [1, 1, 1], 512) + plot.annotate_legend('density') + plot.set_x_unit('cm') + plot.set_unit('density', 'kg/cm**3') + plot.save() + + os.chdir(curdir) + # clean up + shutil.rmtree(tmpdir) + +def test_line_buffer(): + ds = fake_random_ds(32) + lb = yt.LineBuffer(ds, (0, 0, 0), (1, 1, 1), 512, label='diag') + lb['density'] + lb['density'] = 0 + lb['velocity_x'] + lb.keys() + del lb['velocity_x'] diff -Nru yt-3.3.3/yt/visualization/tests/test_mesh_slices.py yt-3.4.0/yt/visualization/tests/test_mesh_slices.py --- yt-3.3.3/yt/visualization/tests/test_mesh_slices.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/tests/test_mesh_slices.py 2017-08-10 18:02:57.000000000 +0000 @@ -17,7 +17,13 @@ import numpy as np import yt from yt.testing import fake_tetrahedral_ds -from yt.testing import fake_hexahedral_ds +from yt.testing import fake_hexahedral_ds, small_fake_hexahedral_ds +from yt.utilities.answer_testing.framework import \ + requires_ds, \ + data_dir_load, \ + GenericImageTest +from yt.utilities.lib.geometry_utils import triangle_plane_intersect +from yt.utilities.lib.mesh_triangulation import triangulate_indices def setup(): @@ -25,6 +31,42 @@ from yt.config import ytcfg ytcfg["yt", "__withintesting"] = "True" +def compare(ds, field, test_prefix, decimals=12): + def slice_image(filename_prefix): + sl = yt.SlicePlot(ds, 'z', field) + sl.set_log('all', False) + image_file = sl.save(filename_prefix) + return image_file + + slice_image.__name__ = "slice_{}".format(test_prefix) + test = GenericImageTest(ds, slice_image, decimals) + test.prefix = test_prefix + return test + +tri2 = "SecondOrderTris/RZ_p_no_parts_do_nothing_bcs_cone_out.e" + +@requires_ds(tri2) +def test_tri2(): + ds = data_dir_load(tri2, kwargs={'step':-1}) + for field in ds.field_list: + yield compare(ds, field, "answers_tri2_%s_%s" % (field[0], field[1])) + +quad2 = "SecondOrderQuads/lid_driven_out.e" + +@requires_ds(quad2) +def test_quad2(): + ds = data_dir_load(quad2, kwargs={'step':-1}) + field_list = [('all', 'T'), ('all', 'vel_x'), ('all', 'vel_y')] + for field in field_list: + yield compare(ds, field, "answers_quad2_%s_%s" % (field[0], field[1])) + +multi_region = "MultiRegion/two_region_example_out.e" + +@requires_ds(multi_region) +def test_multi_region(): + ds = data_dir_load(multi_region, kwargs={'step':-1}) + for field in ds.field_list: + yield compare(ds, field, "answers_multi_region_%s_%s" % (field[0], field[1])) def test_mesh_slices(): # Perform I/O in safe place instead of yt main dir @@ -55,3 +97,24 @@ os.chdir(curdir) # clean up shutil.rmtree(tmpdir) + +def test_perfect_element_intersection(): + # This test tests mesh line annotation where a z=0 slice + # perfectly intersects the top of a hexahedral element with node + # z-coordinates containing both -0 and +0. Before + # https://github.com/yt-project/yt/pull/1437 this test falsely + # yielded three annotation lines, whereas the correct result is four + # corresponding to the four edges of the top hex face. + + ds = small_fake_hexahedral_ds() + indices = ds.index.meshes[0].connectivity_indices + coords = ds.index.meshes[0].connectivity_coords + tri_indices = triangulate_indices(indices) + tri_coords = coords[tri_indices] + lines = triangle_plane_intersect(2, 0, tri_coords) + non_zero_lines = 0 + for i in range(lines.shape[0]): + norm = np.linalg.norm(lines[i][0] - lines[i][1]) + if norm > 1e-8: + non_zero_lines += 1 + np.testing.assert_equal(non_zero_lines, 4) diff -Nru yt-3.3.3/yt/visualization/tests/test_offaxisprojection.py yt-3.4.0/yt/visualization/tests/test_offaxisprojection.py --- yt-3.3.3/yt/visualization/tests/test_offaxisprojection.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/tests/test_offaxisprojection.py 2017-08-10 18:02:57.000000000 +0000 @@ -75,7 +75,7 @@ image = off_axis_projection(*oap_args, **oap_kwargs) for wp_kwargs in wp_kwargs_list: write_projection(image, fn % i, **wp_kwargs) - yield assert_equal, os.path.exists(fn % i), True + assert_equal(os.path.exists(fn % i), True) if tmpdir: os.chdir(curdir) diff -Nru yt-3.3.3/yt/visualization/tests/test_particle_plot.py yt-3.4.0/yt/visualization/tests/test_particle_plot.py --- yt-3.3.3/yt/visualization/tests/test_particle_plot.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/tests/test_particle_plot.py 2017-08-10 18:02:57.000000000 +0000 @@ -12,25 +12,33 @@ # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -import itertools import os import tempfile import shutil import unittest + +import numpy as np + from yt.data_objects.profiles import create_profile -from yt.extern.parameterized import parameterized, param from yt.visualization.tests.test_plotwindow import \ - assert_fname, WIDTH_SPECS, ATTR_ARGS + WIDTH_SPECS, ATTR_ARGS +from yt.convenience import load from yt.data_objects.particle_filters import add_particle_filter from yt.testing import \ - fake_particle_ds, assert_array_almost_equal + fake_particle_ds, \ + assert_array_almost_equal, \ + requires_file, \ + assert_allclose, \ + assert_fname from yt.utilities.answer_testing.framework import \ requires_ds, \ data_dir_load, \ PlotWindowAttributeTest, \ PhasePlotAttributeTest from yt.visualization.api import \ - ParticleProjectionPlot, ParticlePhasePlot + ParticlePlot, \ + ParticleProjectionPlot, \ + ParticlePhasePlot from yt.units.yt_array import YTArray @@ -167,8 +175,16 @@ class TestParticlePhasePlotSave(unittest.TestCase): - @classmethod - def setUpClass(cls): + def setUp(self): + self.tmpdir = tempfile.mkdtemp() + self.curdir = os.getcwd() + os.chdir(self.tmpdir) + + def tearDown(self): + os.chdir(self.curdir) + shutil.rmtree(self.tmpdir) + + def test_particle_phase_plot(self): test_ds = fake_particle_ds() data_sources = [test_ds.region([0.5] * 3, [0.4] * 3, [0.6] * 3), test_ds.all_data()] @@ -196,9 +212,59 @@ n_bins=[16, 16]) particle_phases.append(ParticlePhasePlot.from_profile(pp)) + particle_phases[0]._repr_html_() + for p in particle_phases: + for fname in TEST_FLNMS: + assert assert_fname(p.save(fname)[0]) + +tgal = 'TipsyGalaxy/galaxy.00300' +@requires_file(tgal) +def test_particle_phase_plot_semantics(): + ds = load(tgal) + ad = ds.all_data() + dens_ex = ad.quantities.extrema(('Gas', 'density')) + temp_ex = ad.quantities.extrema(('Gas', 'temperature')) + plot = ParticlePlot(ds, + ('Gas', 'density'), + ('Gas', 'temperature'), + ('Gas', 'particle_mass')) + plot.set_log('density', True) + plot.set_log('temperature', True) + p = plot.profile + + # bin extrema are field extrema + assert dens_ex[0] - np.spacing(dens_ex[0]) == p.x_bins[0] + assert dens_ex[-1] + np.spacing(dens_ex[-1]) == p.x_bins[-1] + assert temp_ex[0] - np.spacing(temp_ex[0]) == p.y_bins[0] + assert temp_ex[-1] + np.spacing(temp_ex[-1]) == p.y_bins[-1] + + # bins are evenly spaced in log space + logxbins = np.log10(p.x_bins) + dxlogxbins = logxbins[1:] - logxbins[:-1] + assert_allclose(dxlogxbins, dxlogxbins[0]) + + logybins = np.log10(p.y_bins) + dylogybins = logybins[1:] - logybins[:-1] + assert_allclose(dylogybins, dylogybins[0]) + + plot.set_log('density', False) + plot.set_log('temperature', False) + p = plot.profile + + # bin extrema are field extrema + assert dens_ex[0] - np.spacing(dens_ex[0]) == p.x_bins[0] + assert dens_ex[-1] + np.spacing(dens_ex[-1]) == p.x_bins[-1] + assert temp_ex[0] - np.spacing(temp_ex[0]) == p.y_bins[0] + assert temp_ex[-1] + np.spacing(temp_ex[-1]) == p.y_bins[-1] + + # bins are evenly spaced in log space + dxbins = p.x_bins[1:] - p.x_bins[:-1] + assert_allclose(dxbins, dxbins[0]) + + dybins = p.y_bins[1:] - p.y_bins[:-1] + assert_allclose(dybins, dybins[0]) - cls.particle_phases = particle_phases - cls.ds = test_ds +class TestParticleProjectionPlotSave(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() @@ -209,93 +275,47 @@ os.chdir(self.curdir) shutil.rmtree(self.tmpdir) - @parameterized.expand(param.explicit((fname, )) for fname in TEST_FLNMS) - def test_particle_phase_plot(self, fname): - for p in self.particle_phases: - assert assert_fname(p.save(fname)[0]) - - def test_ipython_repr(self): - self.particle_phases[0]._repr_html_() - - -class TestParticleProjectionPlotSave(unittest.TestCase): + def test_particle_plot(self): + test_ds = fake_particle_ds() + for dim in range(3): + pplot = ParticleProjectionPlot(test_ds, dim, "particle_mass") + for fname in TEST_FLNMS: + assert assert_fname(pplot.save(fname)[0]) - @classmethod - def setUpClass(cls): + def test_particle_plot_ds(self): test_ds = fake_particle_ds() ds_region = test_ds.region([0.5] * 3, [0.4] * 3, [0.6] * 3) - pplots = [] - pplots_ds = [] - pplots_c = [] - pplots_wf = [] - pplots_w = {} - pplots_m = [] for dim in range(3): - pplots.append(ParticleProjectionPlot(test_ds, dim, - "particle_mass")) - - pplots_ds.append(ParticleProjectionPlot(test_ds, dim, - "particle_mass", - data_source=ds_region)) + pplot_ds = ParticleProjectionPlot( + test_ds, dim, "particle_mass", data_source=ds_region) + pplot_ds.save() + def test_particle_plot_c(self): + test_ds = fake_particle_ds() for center in CENTER_SPECS: - pplots_c.append(ParticleProjectionPlot(test_ds, dim, - "particle_mass", - center=center)) - - for width in WIDTH_SPECS: - pplots_w[width] = ParticleProjectionPlot(test_ds, dim, - 'particle_mass', - width=width) - for wf in WEIGHT_FIELDS: - pplots_wf.append(ParticleProjectionPlot(test_ds, dim, - "particle_mass", - weight_field=wf)) - cls.pplots = pplots - cls.pplots_ds = pplots_ds - cls.pplots_c = pplots_c - cls.pplots_wf = pplots_wf - cls.pplots_w = pplots_w - cls.pplots_m = pplots_m - - def setUp(self): - self.tmpdir = tempfile.mkdtemp() - self.curdir = os.getcwd() - os.chdir(self.tmpdir) + for dim in range(3): + pplot_c = ParticleProjectionPlot( + test_ds, dim, "particle_mass", center=center) + pplot_c.save() - def tearDown(self): - os.chdir(self.curdir) - shutil.rmtree(self.tmpdir) + def test_particle_plot_wf(self): + test_ds = fake_particle_ds() + for dim in range(3): + for weight_field in WEIGHT_FIELDS: + pplot_wf = ParticleProjectionPlot( + test_ds, dim, "particle_mass", weight_field=weight_field) + pplot_wf.save() - @parameterized.expand( - param.explicit(item) - for item in itertools.product(range(3), TEST_FLNMS)) - def test_particle_plot(self, dim, fname): - assert assert_fname(self.pplots[dim].save(fname)[0]) - - @parameterized.expand([(0, ), (1, ), (2, )]) - def test_particle_plot_ds(self, dim): - self.pplots_ds[dim].save() - - @parameterized.expand([(i, ) for i in range(len(CENTER_SPECS))]) - def test_particle_plot_c(self, dim): - self.pplots_c[dim].save() - - @parameterized.expand([(i, ) for i in range(len(WEIGHT_FIELDS))]) - def test_particle_plot_wf(self, dim): - self.pplots_wf[dim].save() - - @parameterized.expand( - param.explicit((width, )) - for width in WIDTH_SPECS) - def test_creation_with_width(self, width): - xlim, ylim, pwidth, aun = WIDTH_SPECS[width] - plot = self.pplots_w[width] - - xlim = [plot.ds.quan(el[0], el[1]) for el in xlim] - ylim = [plot.ds.quan(el[0], el[1]) for el in ylim] - pwidth = [plot.ds.quan(el[0], el[1]) for el in pwidth] - - [assert_array_almost_equal(px, x, 14) for px, x in zip(plot.xlim, xlim)] - [assert_array_almost_equal(py, y, 14) for py, y in zip(plot.ylim, ylim)] - [assert_array_almost_equal(pw, w, 14) for pw, w in zip(plot.width, pwidth)] + def test_creation_with_width(self): + test_ds = fake_particle_ds() + for width, (xlim, ylim, pwidth, aun) in WIDTH_SPECS.items(): + plot = ParticleProjectionPlot( + test_ds, 0, 'particle_mass', width=width) + + xlim = [plot.ds.quan(el[0], el[1]) for el in xlim] + ylim = [plot.ds.quan(el[0], el[1]) for el in ylim] + pwidth = [plot.ds.quan(el[0], el[1]) for el in pwidth] + + [assert_array_almost_equal(px, x, 14) for px, x in zip(plot.xlim, xlim)] + [assert_array_almost_equal(py, y, 14) for py, y in zip(plot.ylim, ylim)] + [assert_array_almost_equal(pw, w, 14) for pw, w in zip(plot.width, pwidth)] diff -Nru yt-3.3.3/yt/visualization/tests/test_plotwindow.py yt-3.4.0/yt/visualization/tests/test_plotwindow.py --- yt-3.3.3/yt/visualization/tests/test_plotwindow.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/tests/test_plotwindow.py 2017-08-10 18:02:57.000000000 +0000 @@ -12,24 +12,28 @@ # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -import itertools +import matplotlib import numpy as np import os -import tempfile import shutil +import tempfile import unittest + +from distutils.version import LooseVersion from nose.tools import assert_true -from yt.extern.parameterized import parameterized, param + from yt.testing import \ fake_random_ds, assert_equal, assert_rel_equal, assert_array_equal, \ - assert_array_almost_equal, assert_raises + assert_array_almost_equal, assert_raises, assert_fname from yt.utilities.answer_testing.framework import \ requires_ds, data_dir_load, PlotWindowAttributeTest from yt.utilities.exceptions import \ YTInvalidFieldType from yt.visualization.api import \ - SlicePlot, ProjectionPlot, OffAxisSlicePlot, OffAxisProjectionPlot + SlicePlot, ProjectionPlot, OffAxisSlicePlot, OffAxisProjectionPlot, \ + plot_2d from yt.units.yt_array import YTArray, YTQuantity +from yt.units import kboltz from yt.frontends.stream.api import load_uniform_grid from collections import OrderedDict @@ -39,33 +43,6 @@ ytcfg["yt", "__withintesting"] = "True" -def assert_fname(fname): - """Function that checks file type using libmagic""" - if fname is None: - return - - with open(fname, 'rb') as fimg: - data = fimg.read() - image_type = '' - - # see http://www.w3.org/TR/PNG/#5PNG-file-signature - if data.startswith(b'\211PNG\r\n\032\n'): - image_type = '.png' - # see http://www.mathguide.de/info/tools/media-types/image/jpeg - elif data.startswith(b'\377\330'): - image_type = '.jpeg' - elif data.startswith(b'%!PS-Adobe'): - data_str = data.decode("utf-8", "ignore") - if 'EPSF' in data_str[:data_str.index('\n')]: - image_type = '.eps' - else: - image_type = '.ps' - elif data.startswith(b'%PDF'): - image_type = '.pdf' - - return image_type == os.path.splitext(fname)[1] - - TEST_FLNMS = [None, 'test', 'test.png', 'test.eps', 'test.ps', 'test.pdf'] M7 = "DD0010/moving7_0010" @@ -91,7 +68,8 @@ "set_window_size": [((7.0, ), {})], "set_zlim": [(('density', 1e-25, 1e-23), {}), (('density', 1e-25, None), {'dynamic_range': 4})], - "zoom": [((10, ), {})]} + "zoom": [((10, ), {})], + "toggle_right_handed": [((),{})]} CENTER_SPECS = ( @@ -231,6 +209,8 @@ def tearDown(self): os.chdir(self.curdir) shutil.rmtree(self.tmpdir) + del self.ds + del self.slc def test_hide_show_axes(self): self.slc.hide_axes() @@ -258,6 +238,10 @@ self.ds = fake_random_ds(64) self.slc = SlicePlot(self.ds, 0, "density") + def tearDown(self): + del self.ds + del self.slc + def _assert_05cm(self): assert_array_equal([self.slc.xlim, self.slc.ylim, self.slc.width], [(YTQuantity(0.25, 'cm'), YTQuantity(0.75, 'cm')), @@ -298,45 +282,7 @@ class TestPlotWindowSave(unittest.TestCase): - - @classmethod - def setUpClass(cls): - test_ds = fake_random_ds(64) - normal = [1, 1, 1] - ds_region = test_ds.region([0.5] * 3, [0.4] * 3, [0.6] * 3) - projections = [] - projections_ds = [] - projections_c = [] - projections_wf = [] - projections_w = {} - projections_m = [] - for dim in range(3): - projections.append(ProjectionPlot(test_ds, dim, "density")) - projections_ds.append(ProjectionPlot(test_ds, dim, "density", - data_source=ds_region)) - for center in CENTER_SPECS: - projections_c.append(ProjectionPlot(test_ds, dim, "density", - center=center)) - for width in WIDTH_SPECS: - projections_w[width] = ProjectionPlot(test_ds, dim, 'density', - width=width) - for wf in WEIGHT_FIELDS: - projections_wf.append(ProjectionPlot(test_ds, dim, "density", - weight_field=wf)) - for m in PROJECTION_METHODS: - projections_m.append(ProjectionPlot(test_ds, dim, "density", - method=m)) - - cls.slices = [SlicePlot(test_ds, dim, "density") for dim in range(3)] - cls.projections = projections - cls.projections_ds = projections_ds - cls.projections_c = projections_c - cls.projections_wf = projections_wf - cls.projections_w = projections_w - cls.projections_m = projections_m - cls.offaxis_slice = OffAxisSlicePlot(test_ds, normal, "density") - cls.offaxis_proj = OffAxisProjectionPlot(test_ds, normal, "density") - + def setUp(self): self.tmpdir = tempfile.mkdtemp() self.curdir = os.getcwd() @@ -346,64 +292,76 @@ os.chdir(self.curdir) shutil.rmtree(self.tmpdir) - @parameterized.expand( - param.explicit(item) - for item in itertools.product(range(3), TEST_FLNMS)) - def test_slice_plot(self, dim, fname): - assert assert_fname(self.slices[dim].save(fname)[0]) - - @parameterized.expand( - param.explicit(item) - for item in itertools.product(range(3), TEST_FLNMS)) - def test_projection_plot(self, dim, fname): - assert assert_fname(self.projections[dim].save(fname)[0]) - - @parameterized.expand([(0, ), (1, ), (2, )]) - def test_projection_plot_ds(self, dim): - self.projections_ds[dim].save() - - @parameterized.expand([(i, ) for i in range(len(CENTER_SPECS))]) - def test_projection_plot_c(self, dim): - self.projections_c[dim].save() - - @parameterized.expand([(i, ) for i in range(len(WEIGHT_FIELDS))]) - def test_projection_plot_wf(self, dim): - self.projections_wf[dim].save() - - @parameterized.expand([(i, ) for i in range(len(PROJECTION_METHODS))]) - def test_projection_plot_m(self, dim): - self.projections_m[dim].save() - - @parameterized.expand( - param.explicit((fname, )) - for fname in TEST_FLNMS) - def test_offaxis_slice_plot(self, fname): - assert assert_fname(self.offaxis_slice.save(fname)[0]) - - @parameterized.expand( - param.explicit((fname, )) - for fname in TEST_FLNMS) - def test_offaxis_projection_plot(self, fname): - assert assert_fname(self.offaxis_proj.save(fname)[0]) - - def test_ipython_repr(self): - self.slices[0]._repr_html_() - - @parameterized.expand( - param.explicit((width, )) - for width in WIDTH_SPECS) - def test_creation_with_width(self, width): - xlim, ylim, pwidth, aun = WIDTH_SPECS[width] - plot = self.projections_w[width] - - xlim = [plot.ds.quan(el[0], el[1]) for el in xlim] - ylim = [plot.ds.quan(el[0], el[1]) for el in ylim] - pwidth = [plot.ds.quan(el[0], el[1]) for el in pwidth] - - [assert_array_almost_equal(px, x, 14) for px, x in zip(plot.xlim, xlim)] - [assert_array_almost_equal(py, y, 14) for py, y in zip(plot.ylim, ylim)] - [assert_array_almost_equal(pw, w, 14) for pw, w in zip(plot.width, pwidth)] - assert_true(aun == plot._axes_unit_names) + def test_slice_plot(self): + test_ds = fake_random_ds(16) + for dim in range(3): + slc = SlicePlot(test_ds, dim, 'density') + for fname in TEST_FLNMS: + assert assert_fname(slc.save(fname)[0]) + + def test_repr_html(self): + test_ds = fake_random_ds(16) + slc = SlicePlot(test_ds, 0, 'density') + slc._repr_html_() + + def test_projection_plot(self): + test_ds = fake_random_ds(16) + for dim in range(3): + proj = ProjectionPlot(test_ds, dim, 'density') + for fname in TEST_FLNMS: + assert assert_fname(proj.save(fname)[0]) + + def test_projection_plot_ds(self): + test_ds = fake_random_ds(16) + reg = test_ds.region([0.5] * 3, [0.4] * 3, [0.6] * 3) + for dim in range(3): + proj = ProjectionPlot(test_ds, dim, 'density', data_source=reg) + proj.save() + + def test_projection_plot_c(self): + test_ds = fake_random_ds(16) + for center in CENTER_SPECS: + proj = ProjectionPlot(test_ds, 0, 'density', center=center) + proj.save() + + def test_projection_plot_wf(self): + test_ds = fake_random_ds(16) + for wf in WEIGHT_FIELDS: + proj = ProjectionPlot(test_ds, 0, 'density', weight_field=wf) + proj.save() + + def test_projection_plot_m(self): + test_ds = fake_random_ds(16) + for method in PROJECTION_METHODS: + proj = ProjectionPlot(test_ds, 0, 'density', method=method) + proj.save() + + def test_offaxis_slice_plot(self): + test_ds = fake_random_ds(16) + slc = OffAxisSlicePlot(test_ds, [1, 1, 1], "density") + for fname in TEST_FLNMS: + assert assert_fname(slc.save(fname)[0]) + + def test_offaxis_projection_plot(self): + test_ds = fake_random_ds(16) + prj = OffAxisProjectionPlot(test_ds, [1, 1, 1], "density") + for fname in TEST_FLNMS: + assert assert_fname(prj.save(fname)[0]) + + def test_creation_with_width(self): + test_ds = fake_random_ds(16) + for width in WIDTH_SPECS: + xlim, ylim, pwidth, aun = WIDTH_SPECS[width] + plot = ProjectionPlot(test_ds, 0, 'density', width=width) + + xlim = [plot.ds.quan(el[0], el[1]) for el in xlim] + ylim = [plot.ds.quan(el[0], el[1]) for el in ylim] + pwidth = [plot.ds.quan(el[0], el[1]) for el in pwidth] + + [assert_array_almost_equal(px, x, 14) for px, x in zip(plot.xlim, xlim)] + [assert_array_almost_equal(py, y, 14) for py, y in zip(plot.ylim, ylim)] + [assert_array_almost_equal(pw, w, 14) for pw, w in zip(plot.width, pwidth)] + assert_true(aun == plot._axes_unit_names) def test_on_off_compare(): # fake density field that varies in the x-direction only @@ -422,6 +380,13 @@ assert_array_almost_equal(sl_on.frb['density'], sl_off.frb['density']) + sl_on.set_buff_size((800, 400)) + sl_on._recreate_frb() + sl_off.set_buff_size((800, 400)) + sl_off._recreate_frb() + + assert_array_almost_equal(sl_on.frb['density'], sl_off.frb['density']) + def test_plot_particle_field_error(): ds = fake_random_ds(32, particles=100) @@ -443,9 +408,143 @@ assert_raises( YTInvalidFieldType, object, ds, normal, field_name_list) +def test_setup_origin(): + origin_inputs = ('domain', + 'left-window', + 'center-domain', + 'lower-right-window', + ('window',), + ('right', 'domain'), + ('lower', 'window'), + ('lower', 'right', 'window'), + (0.5, 0.5, 'domain'), + ((50, 'cm'), (50, 'cm'), 'domain')) + w=(10, 'cm') + + ds = fake_random_ds(32, length_unit=100.0) + generated_limits = [] + #lower limit -> llim + #upper limit -> ulim + # xllim xulim yllim yulim + correct_limits = [45.0, 55.0, 45.0, 55.0, + 0.0, 10.0, 0.0, 10.0, + -5.0, 5.0, -5.0, 5.0, + -10.0, 0, 0, 10.0, + 0.0, 10.0, 0.0, 10.0, + -55.0, -45.0, -55.0, -45.0, + -5.0, 5.0, 0.0, 10.0, + -10.0, 0, 0, 10.0, + -5.0, 5.0, -5.0, 5.0, + -5.0, 5.0, -5.0, 5.0 + ] + for o in origin_inputs: + slc = SlicePlot(ds, 2, 'density', width=w, origin=o) + ax = slc.plots['density'].axes + xlims = ax.get_xlim() + ylims = ax.get_ylim() + lims = [xlims[0], xlims[1], ylims[0], ylims[1]] + for l in lims: + generated_limits.append(l) + assert_array_almost_equal(correct_limits, generated_limits) def test_frb_regen(): ds = fake_random_ds(32) slc = SlicePlot(ds, 2, 'density') slc.set_buff_size(1200) assert_equal(slc.frb['density'].shape, (1200, 1200)) + +def test_set_background_color(): + ds = fake_random_ds(32) + plot = SlicePlot(ds, 2, 'density') + for field in ['density', ('gas', 'density')]: + plot.set_background_color(field, 'red') + ax = plot.plots[field].axes + if LooseVersion(matplotlib.__version__) < LooseVersion('2.0.0'): + assert_equal(ax.get_axis_bgcolor(), 'red') + else: + assert_equal(ax.get_facecolor(), (1.0, 0.0, 0.0, 1.0)) + +def test_set_unit(): + ds = fake_random_ds(32, fields=('temperature',), units=('K',)) + slc = SlicePlot(ds, 2, 'temperature') + + orig_array = slc.frb['gas', 'temperature'].copy() + + slc.set_unit('temperature', 'degF') + + assert str(slc.frb['gas', 'temperature'].units) == 'degF' + assert_array_almost_equal(np.array(slc.frb['gas', 'temperature']), + np.array(orig_array)*1.8 - 459.67) + + # test that a plot modifying function that destroys the frb preserves the + # new unit + slc.set_buff_size(1000) + + assert str(slc.frb['gas', 'temperature'].units) == 'degF' + + slc.set_buff_size(800) + + slc.set_unit('temperature', 'K') + assert str(slc.frb['gas', 'temperature'].units) == 'K' + assert_array_almost_equal(slc.frb['gas', 'temperature'], orig_array) + + slc.set_unit('temperature', 'keV', equivalency='thermal') + assert str(slc.frb['gas', 'temperature'].units) == 'keV' + assert_array_almost_equal(slc.frb['gas', 'temperature'], + (orig_array*kboltz).to('keV')) + + # test that a plot modifying function that destroys the frb preserves the + # new unit with an equivalency + slc.set_buff_size(1000) + + assert str(slc.frb['gas', 'temperature'].units) == 'keV' + + # test that destroying the FRB then changing the unit using an equivalency + # doesn't error out, see issue #1316 + slc = SlicePlot(ds, 2, 'temperature') + slc.set_buff_size(1000) + slc.set_unit('temperature', 'keV', equivalency='thermal') + assert str(slc.frb['gas', 'temperature'].units) == 'keV' + +WD = "WDMerger_hdf5_chk_1000/WDMerger_hdf5_chk_1000.hdf5" + +@requires_ds(WD) +def test_plot_2d(): + # Cartesian + ds = fake_random_ds((32,32,1), fields=('temperature',), units=('K',)) + slc = SlicePlot(ds, "z", ["temperature"], width=(0.2,"unitary"), + center=[0.4, 0.3, 0.5]) + slc2 = plot_2d(ds, "temperature", width=(0.2,"unitary"), + center=[0.4, 0.3]) + slc3 = plot_2d(ds, "temperature", width=(0.2,"unitary"), + center=ds.arr([0.4, 0.3], "cm")) + assert_array_equal(slc.frb['temperature'], slc2.frb['temperature']) + assert_array_equal(slc.frb['temperature'], slc3.frb['temperature']) + # Cylindrical + ds = data_dir_load(WD) + slc = SlicePlot(ds, "theta", ["density"], width=(30000.0, "km")) + slc2 = plot_2d(ds, "density", width=(30000.0, "km")) + assert_array_equal(slc.frb['density'], slc2.frb['density']) + +def test_symlog_colorbar(): + ds = fake_random_ds(16) + + def _thresh_density(field, data): + wh = data['density'] < 0.5 + ret = data['density'] + ret[wh] = 0 + return ret + + def _neg_density(field, data): + return -data['threshold_density'] + + ds.add_field('threshold_density', function=_thresh_density, + units='g/cm**3', sampling_type='cell') + ds.add_field('negative_density', function=_neg_density, units='g/cm**3', + sampling_type='cell') + + for field in ['density', 'threshold_density', 'negative_density']: + plot = SlicePlot(ds, 2, field) + plot.set_log(field, True, linthresh=0.1) + with tempfile.NamedTemporaryFile(suffix='png') as f: + plot.save(f.name) diff -Nru yt-3.3.3/yt/visualization/tests/test_profile_plots.py yt-3.4.0/yt/visualization/tests/test_profile_plots.py --- yt-3.3.3/yt/visualization/tests/test_profile_plots.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/tests/test_profile_plots.py 2017-08-10 18:02:57.000000000 +0000 @@ -16,16 +16,17 @@ import tempfile import shutil import unittest +import yt from yt.data_objects.profiles import create_profile -from yt.extern.parameterized import\ - parameterized, param from yt.testing import \ fake_random_ds, \ - assert_array_almost_equal + assert_array_almost_equal, \ + requires_file, \ + assert_fname from yt.visualization.profile_plotter import \ ProfilePlot, PhasePlot from yt.visualization.tests.test_plotwindow import \ - assert_fname, TEST_FLNMS + TEST_FLNMS from yt.utilities.answer_testing.framework import \ PhasePlotAttributeTest, \ requires_ds, \ @@ -59,31 +60,34 @@ z_field = 'cell_mass' decimals = 12 ds = data_dir_load(g30) - for ax in 'xyz': - for attr_name in ATTR_ARGS.keys(): - for args in ATTR_ARGS[attr_name]: - test = PhasePlotAttributeTest(ds, x_field, y_field, z_field, - attr_name, args, decimals) - test_phase_plot_attributes.__name__ = test.description - yield test + for attr_name in ATTR_ARGS.keys(): + for args in ATTR_ARGS[attr_name]: + test = PhasePlotAttributeTest(ds, x_field, y_field, z_field, + attr_name, args, decimals) + test_phase_plot_attributes.__name__ = test.description + yield test class TestProfilePlotSave(unittest.TestCase): - @classmethod - def setUpClass(cls): + def setUp(self): + self.tmpdir = tempfile.mkdtemp() + self.curdir = os.getcwd() + os.chdir(self.tmpdir) + + def tearDown(self): + os.chdir(self.curdir) + shutil.rmtree(self.tmpdir) + + def test_profile_plot(self): fields = ('density', 'temperature', 'velocity_x', 'velocity_y', 'velocity_z') units = ('g/cm**3', 'K', 'cm/s', 'cm/s', 'cm/s') - test_ds = fake_random_ds(64, fields=fields, units=units) + test_ds = fake_random_ds(16, fields=fields, units=units) regions = [test_ds.region([0.5]*3, [0.4]*3, [0.6]*3), test_ds.all_data()] - profiles = [] - phases = [] pr_fields = [('density', 'temperature'), ('density', 'velocity_x'), ('temperature', 'cell_mass'), ('density', 'radius'), ('velocity_magnitude', 'cell_mass')] - ph_fields = [('density', 'temperature', 'cell_mass'), - ('density', 'velocity_x', 'cell_mass'), - ('radius', 'temperature', 'velocity_magnitude')] + profiles = [] for reg in regions: for x_field, y_field in pr_fields: profiles.append(ProfilePlot(reg, x_field, y_field)) @@ -91,6 +95,26 @@ fractional=True, accumulation=True)) p1d = create_profile(reg, x_field, y_field) profiles.append(ProfilePlot.from_profiles(p1d)) + p1 = create_profile(test_ds.all_data(), 'density', 'temperature') + p2 = create_profile(test_ds.all_data(), 'density', 'velocity_x') + profiles.append(ProfilePlot.from_profiles( + [p1, p2], labels=['temperature', 'velocity'])) + profiles[0]._repr_html_() + for p in profiles: + for fname in TEST_FLNMS: + assert_fname(p.save(fname)[0]) + + def test_phase_plot(self): + fields = ('density', 'temperature', 'velocity_x', 'velocity_y', + 'velocity_z') + units = ('g/cm**3', 'K', 'cm/s', 'cm/s', 'cm/s') + test_ds = fake_random_ds(16, fields=fields, units=units) + regions = [test_ds.region([0.5]*3, [0.4]*3, [0.6]*3), test_ds.all_data()] + phases = [] + ph_fields = [('density', 'temperature', 'cell_mass'), + ('density', 'velocity_x', 'cell_mass'), + ('radius', 'temperature', 'velocity_magnitude')] + for reg in regions: for x_field, y_field, z_field in ph_fields: # set n_bins to [16, 16] since matplotlib's postscript # renderer is slow when it has to write a lot of polygons @@ -111,35 +135,28 @@ assert_array_almost_equal(xlim, (0.3, 0.8)) assert_array_almost_equal(ylim, (0.4, 0.6)) phases.append(pp) - - p1 = create_profile(test_ds.all_data(), 'density', 'temperature') - p2 = create_profile(test_ds.all_data(), 'density', 'velocity_x') - profiles.append(ProfilePlot.from_profiles( - [p1, p2], labels=['temperature', 'velocity'])) - - cls.profiles = profiles - cls.phases = phases - cls.ds = test_ds - - def setUp(self): - self.tmpdir = tempfile.mkdtemp() - self.curdir = os.getcwd() - os.chdir(self.tmpdir) - - def tearDown(self): - os.chdir(self.curdir) - shutil.rmtree(self.tmpdir) - - @parameterized.expand(param.explicit((fname, )) for fname in TEST_FLNMS) - def test_profile_plot(self, fname): - for p in self.profiles: - yield assert_fname(p.save(fname)[0]) - - @parameterized.expand(param.explicit((fname, )) for fname in TEST_FLNMS) - def test_phase_plot(self, fname): - for p in self.phases: - assert assert_fname(p.save(fname)[0]) - - def test_ipython_repr(self): - self.profiles[0]._repr_html_() - self.phases[0]._repr_html_() + phases[0]._repr_html_() + for p in phases: + for fname in TEST_FLNMS: + assert_fname(p.save(fname)[0]) + +ETC46 = "enzo_tiny_cosmology/DD0046/DD0046" + +@requires_file(ETC46) +def test_profile_plot_multiple_field_multiple_plot(): + ds = yt.load("enzo_tiny_cosmology/DD0046/DD0046") + sphere = ds.sphere("max", (1.0, "Mpc")) + profiles = [] + profiles.append(yt.create_profile( + sphere, ["radius"], + fields=["density"],n_bins=32)) + profiles.append(yt.create_profile( + sphere, ["radius"], + fields=["density"],n_bins=64)) + profiles.append(yt.create_profile( + sphere, ["radius"], + fields=["dark_matter_density"],n_bins=64)) + + plot = yt.ProfilePlot.from_profiles(profiles) + with tempfile.NamedTemporaryFile(suffix='png') as f: + plot.save(name=f.name) diff -Nru yt-3.3.3/yt/visualization/tests/test_raw_field_slices.py yt-3.4.0/yt/visualization/tests/test_raw_field_slices.py --- yt-3.3.3/yt/visualization/tests/test_raw_field_slices.py 1970-01-01 00:00:00.000000000 +0000 +++ yt-3.4.0/yt/visualization/tests/test_raw_field_slices.py 2017-08-10 18:02:57.000000000 +0000 @@ -0,0 +1,54 @@ +""" +Tests for making slices through raw fields + +""" + +#----------------------------------------------------------------------------- +# Copyright (c) 2017, yt Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import yt +from yt.utilities.answer_testing.framework import \ + requires_ds, \ + data_dir_load, \ + GenericImageTest + + +def setup(): + """Test specific setup.""" + from yt.config import ytcfg + ytcfg["yt", "__withintesting"] = "True" + +def compare(ds, field, test_prefix, decimals=12): + def slice_image(filename_prefix): + sl = yt.SlicePlot(ds, 'z', field) + sl.set_log('all', False) + image_file = sl.save(filename_prefix) + return image_file + + slice_image.__name__ = "slice_{}".format(test_prefix) + test = GenericImageTest(ds, slice_image, decimals) + test.prefix = test_prefix + return test + + +raw_fields = "Laser/plt00015" +_raw_field_names = [('raw', 'Bx'), + ('raw', 'By'), + ('raw', 'Bz'), + ('raw', 'Ex'), + ('raw', 'Ey'), + ('raw', 'Ez'), + ('raw', 'jx'), + ('raw', 'jy'), + ('raw', 'jz')] +@requires_ds(raw_fields) +def test_raw_field_slices(): + ds = data_dir_load(raw_fields) + for field in _raw_field_names: + yield compare(ds, field, "answers_raw_%s" % field[1]) + diff -Nru yt-3.3.3/yt/visualization/tests/test_splat.py yt-3.4.0/yt/visualization/tests/test_splat.py --- yt-3.3.3/yt/visualization/tests/test_splat.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/tests/test_splat.py 2017-08-10 18:02:57.000000000 +0000 @@ -36,22 +36,23 @@ curdir = os.getcwd() os.chdir(tmpdir) + prng = np.random.RandomState(0x4d3d3d3) N = 16 Np = int(1e2) image = np.zeros([N,N,4]) - xs = np.random.random(Np) - ys = np.random.random(Np) + xs = prng.random_sample(Np) + ys = prng.random_sample(Np) cbx = yt.visualization.color_maps.mcm.RdBu - cs = cbx(np.random.random(Np)) + cs = cbx(prng.random_sample(Np)) add_rgba_points_to_image(image, xs, ys, cs) before_hash = image.copy() fn = 'tmp.png' yt.write_bitmap(image, fn) - yield assert_equal, os.path.exists(fn), True + assert_equal(os.path.exists(fn), True) os.remove(fn) - yield assert_equal, before_hash, image + assert_equal(before_hash, image) os.chdir(curdir) # clean up diff -Nru yt-3.3.3/yt/visualization/volume_rendering/camera.py yt-3.4.0/yt/visualization/volume_rendering/camera.py --- yt-3.3.3/yt/visualization/volume_rendering/camera.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/camera.py 2017-08-10 18:02:57.000000000 +0000 @@ -158,12 +158,12 @@ def position(): doc = ''' - The location of the camera. + The location of the camera. Parameters ---------- - position : number, YTQuantity, iterable, or 3 element YTArray + position : number, YTQuantity, :obj:`!iterable`, or 3 element YTArray If a scalar, assumes that the position is the same in all three coordinates. If an iterable, must contain only scalars or (length, unit) tuples. @@ -179,7 +179,7 @@ 'Cannot set the camera focus and position to the same value') self._position = position self.switch_orientation(normal_vector=self.focus - self._position, - north_vector=None) + north_vector=self.north_vector) def fdel(self): del self._position @@ -192,7 +192,7 @@ Parameters ---------- - width : number, YTQuantity, iterable, or 3 element YTArray + width : number, YTQuantity, :obj:`!iterable`, or 3 element YTArray The width of the volume rendering in the horizontal, vertical, and depth directions. If a scalar, assumes that the width is the same in all three directions. If an iterable, must contain only scalars or @@ -220,7 +220,7 @@ Parameters ---------- - focus : number, YTQuantity, iterable, or 3 element YTArray + focus : number, YTQuantity, :obj:`!iterable`, or 3 element YTArray The width of the volume rendering in the horizontal, vertical, and depth directions. If a scalar, assumes that the width is the same in all three directions. If an iterable, must contain only scalars or @@ -357,7 +357,7 @@ Parameters ---------- - width : number, YTQuantity, iterable, or 3 element YTArray + width : number, YTQuantity, :obj:`!iterable`, or 3 element YTArray The width of the volume rendering in the horizontal, vertical, and depth directions. If a scalar, assumes that the width is the same in all three directions. If an iterable, must contain only scalars or @@ -376,7 +376,7 @@ Parameters ---------- - width : number, YTQuantity, iterable, or 3 element YTArray + width : number, YTQuantity, :obj:`!iterable`, or 3 element YTArray If a scalar, assumes that the position is the same in all three coordinates. If an iterable, must contain only scalars or (length, unit) tuples. @@ -386,9 +386,9 @@ calculated automatically. """ + if north_vector is not None: + self.north_vector = north_vector self.position = position - self.switch_orientation(normal_vector=self.focus - self.position, - north_vector=north_vector) def get_position(self): """Return the current camera position""" @@ -400,7 +400,7 @@ Parameters ---------- - focus : number, YTQuantity, iterable, or 3 element YTArray + focus : number, YTQuantity, :obj:`!iterable`, or 3 element YTArray If a scalar, assumes that the focus is the same is all three coordinates. If an iterable, must contain only scalars or (length, unit) tuples. @@ -483,11 +483,11 @@ >>> sc = Scene() >>> cam = sc.add_camera() >>> # rotate the camera by pi / 4 radians: - >>> cam.rotate(np.pi/4.0) + >>> cam.rotate(np.pi/4.0) >>> # rotate the camera about the y-axis instead of cam.north_vector: - >>> cam.rotate(np.pi/4.0, np.array([0.0, 1.0, 0.0])) + >>> cam.rotate(np.pi/4.0, np.array([0.0, 1.0, 0.0])) >>> # rotate the camera about the origin instead of its own position: - >>> cam.rotate(np.pi/4.0, rot_center=np.array([0.0, 0.0, 0.0])) + >>> cam.rotate(np.pi/4.0, rot_center=np.array([0.0, 0.0, 0.0])) """ rotate_all = rot_vector is not None @@ -593,7 +593,7 @@ >>> sc = Scene() >>> cam = sc.add_camera(ds) >>> # roll the camera by pi / 4 radians: - >>> cam.roll(np.pi/4.0) + >>> cam.roll(np.pi/4.0) >>> # roll the camera about the origin instead of its own position: >>> cam.roll(np.pi/4.0, rot_center=np.array([0.0, 0.0, 0.0])) @@ -627,7 +627,7 @@ >>> import yt >>> import numpy as np >>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030') - >>> + >>> >>> im, sc = yt.volume_render(ds) >>> cam = sc.camera >>> for i in cam.iter_rotate(np.pi, 10): @@ -688,7 +688,7 @@ def zoom(self, factor): r"""Change the width of the FOV of the camera. - This will appear to zoom the camera in by some `factor` toward the + This will appear to zoom the camera in by some `factor` toward the focal point along the current view direction, but really it's just changing the width of the field of view. diff -Nru yt-3.3.3/yt/visualization/volume_rendering/image_handling.py yt-3.4.0/yt/visualization/volume_rendering/image_handling.py --- yt-3.3.3/yt/visualization/volume_rendering/image_handling.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/image_handling.py 2017-08-10 18:02:57.000000000 +0000 @@ -33,13 +33,12 @@ f.create_dataset("A", data=image[:,:,3]) f.close() if fits: - from yt.utilities.fits_image import FITSImageData + from yt.visualization.fits_image import FITSImageData data = {} data["r"] = image[:,:,0] data["g"] = image[:,:,1] data["b"] = image[:,:,2] data["a"] = image[:,:,3] - nx, ny = data["r"].shape fib = FITSImageData(data) fib.writeto('%s.fits'%fn,clobber=True) diff -Nru yt-3.3.3/yt/visualization/volume_rendering/input_events.py yt-3.4.0/yt/visualization/volume_rendering/input_events.py --- yt-3.3.3/yt/visualization/volume_rendering/input_events.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/input_events.py 2017-08-10 18:02:57.000000000 +0000 @@ -333,8 +333,8 @@ key_map[glfw.__dict__.get(key)] = key[4:] for cb in (f for f in sorted(event_coll.key_callbacks) if isinstance(f, tuple)): - print("%s - %s" % (key_map[cb[0]], - event_coll.key_callbacks[cb][0].__doc__)) + for e in event_coll.key_callbacks[cb]: + print("%s - %s" % (key_map[cb[0]], e.__doc__)) return False @register_event("nplane_closer") diff -Nru yt-3.3.3/yt/visualization/volume_rendering/interactive_vr.py yt-3.4.0/yt/visualization/volume_rendering/interactive_vr.py --- yt-3.3.3/yt/visualization/volume_rendering/interactive_vr.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/interactive_vr.py 2017-08-10 18:02:57.000000000 +0000 @@ -86,11 +86,11 @@ Parameters ---------- - position : iterable, or 3 element array in code_length + position : :obj:`!iterable`, or 3 element array in code_length The initial position of the camera. - focus : iterable, or 3 element array in code_length + focus : :obj:`!iterable`, or 3 element array in code_length A point in space that the camera is looking at. - up : iterable, or 3 element array in code_length + up : :obj:`!iterable`, or 3 element array in code_length The 'up' direction for the camera. fov : float, optional An angle defining field of view in degrees. @@ -455,7 +455,7 @@ Parameters ---------- - camera : :class:`yt.visualization.volume_rendering.interactive_vr.IDVCamera` + camera : :class:`~yt.visualization.volume_rendering.interactive_vr.IDVCamera` A simple camera object. """ @@ -620,7 +620,7 @@ Parameters ---------- - camera : Camera + camera : :class:`~yt.visualization.volume_rendering.interactive_vr.IDVCamera` """ self.camera = camera @@ -836,7 +836,7 @@ Parameters ---------- - camera : Camera + camera : :class:`~yt.visualization.volume_rendering.interactive_vr.IDVCamera` """ self.camera = camera diff -Nru yt-3.3.3/yt/visualization/volume_rendering/off_axis_projection.py yt-3.4.0/yt/visualization/volume_rendering/off_axis_projection.py --- yt-3.3.3/yt/visualization/volume_rendering/off_axis_projection.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/off_axis_projection.py 2017-08-10 18:02:57.000000000 +0000 @@ -38,7 +38,7 @@ Parameters ---------- - data_source : `~yt.data_objects.static_output.Dataset` or `~yt.data_objects.data_containers.YTSelectionDataContainer` + data_source : ~yt.data_objects.static_output.Dataset or ~yt.data_objects.data_containers.YTSelectionDataContainer This is the dataset or data object to volume render. center : array_like The current 'center' of the view port -- the focal point for the @@ -136,15 +136,13 @@ def temp_weightfield(a, b): tr = b[f].astype("float64") * b[w] return b.apply_units(tr, a.units) - return tr return temp_weightfield - data_source.ds.field_info.add_field(weightfield, + data_source.ds.field_info.add_field(weightfield, sampling_type="cell", function=_make_wf(item, weight)) # Now we have to tell the dataset to add it and to calculate # its dependencies.. deps, _ = data_source.ds.field_info.check_derived_fields([weightfield]) data_source.ds.field_dependencies.update(deps) - fields = [weightfield, weight] vol.set_field(weightfield) vol.set_weight_field(weight) ptf = ProjectionTransferFunction() @@ -200,6 +198,9 @@ image = vol.finalize_image(camera, vol.sampler.aimage) image = ImageArray(image, funits, registry=data_source.ds.unit_registry, info=image.info) + if weight is not None: + data_source.ds.field_info.pop(("index", "temp_weightfield")) + if method == "integrate": if weight is None: dl = width[2].in_units(data_source.ds.unit_system["length"]) diff -Nru yt-3.3.3/yt/visualization/volume_rendering/old_camera.py yt-3.4.0/yt/visualization/volume_rendering/old_camera.py --- yt-3.3.3/yt/visualization/volume_rendering/old_camera.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/old_camera.py 2017-08-10 18:02:57.000000000 +0000 @@ -100,7 +100,7 @@ the volume rendering mechanism. sub_samples : int, optional The number of samples to take inside every cell per ray. - ds : `~yt.data_objects.api.Dataset` + ds : ~yt.data_objects.static_output.Dataset For now, this is a require parameter! But in the future it will become optional. This is the dataset to volume render. use_kd: bool, optional @@ -258,9 +258,12 @@ Default : 0.3 cmap : string, optional Colormap to be used mapping grid levels to colors. - min_level, max_level : int, optional - Optional parameters to specify the min and max level grid boxes - to overplot on the image. + min_level : int, optional + Optional parameter to specify the min level grid boxes + to overplot on the image. + max_level : int, optional + Optional parameters to specify the max level grid boxes + to overplot on the image. Returns ------- @@ -614,10 +617,7 @@ np.array(self.width, dtype='float64'), self.transfer_function, self.sub_samples) return args, {'lens_type': 'plane-parallel'} - star_trees = None def get_sampler(self, args, kwargs): - if self.star_trees is not None: - kwargs = {'star_list': self.star_trees} if self.use_light: if self.light_dir is None: self.set_default_light_dir() @@ -1190,7 +1190,7 @@ the volume rendering mechanism. sub_samples : int, optional The number of samples to take inside every cell per ray. - ds : `~yt.data_objects.api.Dataset` + ds : ~yt.data_objects.static_output.Dataset For now, this is a require parameter! But in the future it will become optional. This is the dataset to volume render. use_kd: bool, optional @@ -2155,7 +2155,7 @@ Parameters ---------- - ds : `~yt.data_objects.api.Dataset` + ds : ~yt.data_objects.static_output.Dataset This is the dataset to volume render. center : array_like The current 'center' of the view port -- the focal point for the diff -Nru yt-3.3.3/yt/visualization/volume_rendering/render_source.py yt-3.4.0/yt/visualization/volume_rendering/render_source.py --- yt-3.3.3/yt/visualization/volume_rendering/render_source.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/render_source.py 2017-08-10 18:02:57.000000000 +0000 @@ -15,7 +15,7 @@ from functools import wraps from yt.config import \ ytcfg -from yt.funcs import mylog, ensure_numpy_array +from yt.funcs import mylog, ensure_numpy_array, iterable from yt.utilities.parallel_tools.parallel_analysis_interface import \ ParallelAnalysisInterface from yt.utilities.amr_kdtree.api import AMRKDTree @@ -124,14 +124,14 @@ data_source: :class:`AMR3DData` or :class:`Dataset`, optional This is the source to be rendered, which can be any arbitrary yt data object or dataset. - fields : string - The name of the field(s) to be rendered. + field : string + The name of the field to be rendered. Examples -------- The easiest way to make a VolumeSource is to use the volume_render - function, so that the VolumeSource gets created automatically. This + function, so that the VolumeSource gets created automatically. This example shows how to do this and then access the resulting source: >>> import yt @@ -444,16 +444,17 @@ self.sampler(brick, num_threads=self.num_threads) total_cells += np.prod(brick.my_data[0].shape) mylog.debug("Done casting rays") + self.current_image = self.finalize_image( + camera, self.sampler.aimage) - self.current_image = self.finalize_image(camera, - self.sampler.aimage, - call_from_VR=True) if zbuffer is None: - self.zbuffer = ZBuffer(self.current_image, - np.full(self.current_image.shape[:2], np.inf)) + self.zbuffer = ZBuffer( + self.current_image, + np.full(self.current_image.shape[:2], np.inf)) + return self.current_image - def finalize_image(self, camera, image, call_from_VR=False): + def finalize_image(self, camera, image): """Parallel reduce the image. Parameters @@ -462,17 +463,12 @@ The camera used to produce the volume rendering image. image: :class:`yt.data_objects.image_array.ImageArray` instance A reference to an image to fill - call_from_vr: boolean, optional - Whether or not this is being called from a higher level in the VR - interface. Used to set the correct orientation. """ if self._volume is not None: image = self.volume.reduce_tree_images(image, camera.lens.viewpoint) image.shape = camera.resolution[0], camera.resolution[1], 4 # If the call is from VR, the image is rotated by 180 to get correct # up direction - if call_from_VR is True: - image = np.rot90(image, k=2) if self.transfer_function.grey_opacity is False: image[:, :, 3] = 1 return image @@ -531,6 +527,9 @@ # Error checking assert(self.field is not None) assert(self.data_source is not None) + if self.field[0] == 'all': + raise NotImplementedError("Mesh unions are not implemented " + "for 3D rendering") if self.engine == 'embree': self.volume = mesh_traversal.YTEmbreeScene() @@ -545,7 +544,7 @@ ''' This is the name of the colormap that will be used when rendering this MeshSource object. Should be a string, like 'arbre', or 'dusk'. - + ''' def fget(self): @@ -562,7 +561,7 @@ ''' These are the bounds that will be used with the colormap to the display the rendered image. Should be a (vmin, vmax) tuple, like (0.0, 2.0). If - None, the bounds will be automatically inferred from the max and min of + None, the bounds will be automatically inferred from the max and min of the rendered data. ''' @@ -603,10 +602,10 @@ if len(field_data.shape) == 1: field_data = np.expand_dims(field_data, 1) - # Here, we decide whether to render based on high-order or + # Here, we decide whether to render based on high-order or # low-order geometry. Right now, high-order geometry is only # implemented for 20-point hexes. - if indices.shape[1] == 20: + if indices.shape[1] == 20 or indices.shape[1] == 10: self.mesh = mesh_construction.QuadraticElementMesh(self.volume, vertices, indices, @@ -620,12 +619,6 @@ "dropping to 1st order.") field_data = field_data[:, 0:8] indices = indices[:, 0:8] - elif indices.shape[1] == 10: - # tetrahedral - mylog.warning("10-node tetrahedral elements not yet supported, " + - "dropping to 1st order.") - field_data = field_data[:, 0:4] - indices = indices[:, 0:4] self.mesh = mesh_construction.LinearElementMesh(self.volume, vertices, @@ -651,7 +644,7 @@ if len(field_data.shape) == 1: field_data = np.expand_dims(field_data, 1) - # Here, we decide whether to render based on high-order or + # Here, we decide whether to render based on high-order or # low-order geometry. if indices.shape[1] == 27: # hexahedral @@ -659,12 +652,6 @@ "dropping to 1st order.") field_data = field_data[:, 0:8] indices = indices[:, 0:8] - elif indices.shape[1] == 10: - # tetrahedral - mylog.warning("10-node tetrahedral elements not yet supported, " + - "dropping to 1st order.") - field_data = field_data[:, 0:4] - indices = indices[:, 0:4] self.volume = BVH(vertices, indices, field_data) @@ -721,6 +708,7 @@ return self.current_image + def finalize_image(self, camera): sam = self.sampler @@ -729,11 +717,6 @@ Ny = camera.resolution[1] self.data = sam.aimage[:,:,0].reshape(Nx, Ny) - # rotate - self.data = np.rot90(self.data, k=2) - sam.aimage_used = np.rot90(sam.aimage_used, k=2) - sam.amesh_lines = np.rot90(sam.amesh_lines, k=2) - sam.azbuffer = np.rot90(sam.azbuffer, k=2) def annotate_mesh_lines(self, color=None, alpha=1.0): r""" @@ -744,7 +727,7 @@ Parameters ---------- - color: array of ints, shape (4), optional + color: array_like of shape (4,), optional The RGBA value to use to draw the mesh lines. Default is black. alpha : float, optional @@ -794,7 +777,7 @@ cmap_name=self._cmap)/255. alpha = image[:, :, 3] alpha[self.sampler.aimage_used == -1] = 0.0 - image[:, :, 3] = alpha + image[:, :, 3] = alpha return image def __repr__(self): @@ -810,15 +793,17 @@ Parameters ---------- - positions: array, shape (N, 3) + positions: array_like of shape (N, 3) The positions of points to be added to the scene. If specified with no units, the positions will be assumed to be in code units. - colors : array, shape (N, 4), optional + colors : array_like of shape (N, 4), optional The colors of the points, including an alpha channel, in floating point running from 0..1. color_stride : int, optional The stride with which to access the colors when putting them on the scene. + radii : array_like of shape (N), optional + The radii of the points in the final image, in pixels (int) Examples -------- @@ -850,17 +835,26 @@ _image = None data_source = None - def __init__(self, positions, colors=None, color_stride=1): + def __init__(self, positions, colors=None, color_stride=1, radii=None): assert(positions.ndim == 2 and positions.shape[1] == 3) if colors is not None: assert(colors.ndim == 2 and colors.shape[1] == 4) - assert(colors.shape[0] == positions.shape[0]) + assert(colors.shape[0] == positions.shape[0]) + if not iterable(radii): + if radii is not None: #broadcast the value + radii = radii*np.ones(positions.shape[0], dtype='int64') + else: #default radii to 0 pixels (i.e. point is 1 pixel wide) + radii = np.zeros(positions.shape[0], dtype='int64') + else: + assert(radii.ndim == 1) + assert(radii.shape[0] == positions.shape[0]) self.positions = positions # If colors aren't individually set, make black with full opacity if colors is None: colors = np.ones((len(positions), 4)) self.colors = colors self.color_stride = color_stride + self.radii = radii def render(self, camera, zbuffer=None): """Renders an image using the provided camera @@ -895,8 +889,8 @@ # DRAW SOME POINTS camera.lens.setup_box_properties(camera) px, py, dz = camera.lens.project_to_plane(camera, vertices) - - zpoints(empty, z, px, py, dz, self.colors, self.color_stride) + + zpoints(empty, z, px, py, dz, self.colors, self.radii, self.color_stride) self.zbuffer = zbuffer return zbuffer @@ -920,12 +914,12 @@ Parameters ---------- - positions: array, shape (N, 2, 3) + positions: array_like of shape (N, 2, 3) The positions of the starting and stopping points for each line. For example,positions[0][0] and positions[0][1] would give the (x, y, z) coordinates of the beginning and end points of the first line, respectively. If specified with no units, assumed to be in code units. - colors : array, shape (N, 4), optional + colors : array_like of shape (N, 4), optional The colors of the points, including an alpha channel, in floating point running from 0..1. The four channels correspond to r, g, b, and alpha values. Note that they correspond to the line segment succeeding @@ -1047,17 +1041,18 @@ Parameters ---------- - left_edge: array-like, shape (3,), float + left_edge: array-like of shape (3,), float The left edge coordinates of the box. - right_edge : array-like, shape (3,), float + right_edge : array-like of shape (3,), float The right edge coordinates of the box. - color : array-like, shape (4,), float, optional + color : array-like of shape (4,), float, optional The colors (including alpha) to use for the lines. + Default is black with an alpha of 1.0. Examples -------- - This example shows how to use BoxSource to add an outline of the + This example shows how to use BoxSource to add an outline of the domain boundaries to a volume rendering. >>> import yt @@ -1065,12 +1060,12 @@ >>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030') >>> >>> im, sc = yt.volume_render(ds) - >>> + >>> >>> box_source = BoxSource(ds.domain_left_edge, ... ds.domain_right_edge, ... [1.0, 1.0, 1.0, 1.0]) >>> sc.add_source(box_source) - >>> + >>> >>> im = sc.render() """ @@ -1078,7 +1073,7 @@ assert(left_edge.shape == (3,)) assert(right_edge.shape == (3,)) - + if color is None: color = np.array([1.0, 1.0, 1.0, 1.0]) @@ -1118,7 +1113,7 @@ Examples -------- - This example makes a volume rendering and adds outlines of all the + This example makes a volume rendering and adds outlines of all the AMR grids in the simulation: >>> import yt @@ -1140,12 +1135,12 @@ >>> import yt >>> from yt.visualization.volume_rendering.api import GridSource >>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030') - >>> + >>> >>> im, sc = yt.volume_render(ds) - >>> + >>> >>> dd = ds.sphere("c", (0.1, "unitary")) >>> grid_source = GridSource(dd, alpha=1.0) - >>> + >>> >>> sc.add_source(grid_source) >>> >>> im = sc.render() @@ -1210,8 +1205,11 @@ Parameters ---------- - colors: array-like, shape (3,4), optional - The x, y, z RGBA values to use to draw the vectors. + colors: array-like of shape (3,4), optional + The RGBA values to use to draw the x, y, and z vectors. The default is + [[1, 0, 0, alpha], [0, 1, 0, alpha], [0, 0, 1, alpha]] where ``alpha`` + is set by the parameter below. If ``colors`` is set then ``alpha`` is + ignored. alpha : float, optional The opacity of the vectors. @@ -1223,11 +1221,11 @@ >>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030') >>> >>> im, sc = yt.volume_render(ds) - >>> + >>> >>> coord_source = CoordinateVectorSource() - >>> + >>> >>> sc.add_source(coord_source) - >>> + >>> >>> im = sc.render() """ diff -Nru yt-3.3.3/yt/visualization/volume_rendering/scene.py yt-3.4.0/yt/visualization/volume_rendering/scene.py --- yt-3.3.3/yt/visualization/volume_rendering/scene.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/scene.py 2017-08-10 18:02:57.000000000 +0000 @@ -98,7 +98,7 @@ # pass kwargs into _repr_png_() self._sigma_clip = None - def get_source(self, source_num): + def get_source(self, source_num=0): """Returns the volume rendering source indexed by ``source_num``""" return list(itervalues(self.sources))[source_num] @@ -241,8 +241,10 @@ Parameters ---------- fname: string, optional - If specified, save the rendering as a bitmap to the file "fname". + If specified, save the rendering as to the file "fname". If unspecified, it creates a default based on the dataset filename. + The file format is inferred from the filename's suffix. Supported + fomats are png, pdf, eps, and ps. Default: None sigma_clip: float, optional Image values greater than this number times the standard deviation @@ -302,8 +304,38 @@ self.render() mylog.info("Saving render %s", fname) - self._last_render.write_png(fname, sigma_clip=sigma_clip) - + # We can render pngs natively but for other formats we defer to + # matplotlib. + if suffix == '.png': + self._last_render.write_png(fname, sigma_clip=sigma_clip) + else: + from matplotlib.figure import Figure + from matplotlib.backends.backend_pdf import \ + FigureCanvasPdf + from matplotlib.backends.backend_ps import \ + FigureCanvasPS + shape = self._last_render.shape + fig = Figure((shape[0]/100., shape[1]/100.)) + if suffix == '.pdf': + canvas = FigureCanvasPdf(fig) + elif suffix in ('.eps', '.ps'): + canvas = FigureCanvasPS(fig) + else: + raise NotImplementedError( + "Unknown file suffix '{}'".format(suffix)) + ax = fig.add_axes([0, 0, 1, 1]) + ax.set_axis_off() + out = self._last_render + nz = out[:, :, :3][out[:, :, :3].nonzero()] + max_val = nz.mean() + sigma_clip * nz.std() + alpha = 255 * out[:, :, 3].astype('uint8') + out = np.clip(out[:, :, :3] / max_val, 0.0, 1.0) * 255 + out = np.concatenate( + [out.astype('uint8'), alpha[..., None]], axis=-1) + # not sure why we need rot90, but this makes the orentation + # match the png writer + ax.imshow(np.rot90(out), origin='lower') + canvas.print_figure(fname, dpi=100) def save_annotated(self, fname=None, label_fmt=None, text_annotate=None, dpi=100, sigma_clip=None): @@ -393,8 +425,6 @@ rs = rensources[0] tf = rs.transfer_function label = rs.data_source.ds._get_field_info(rs.field).get_label() - if rs.log_field: - label = r'$\rm{log}\ $' + label ax = self._show_mpl(self._last_render.swapaxes(0, 1), sigma_clip=sigma_clip, dpi=dpi) @@ -501,8 +531,11 @@ for k, source in self.transparent_sources: im = source.render(camera, zbuffer=opaque) + opaque.rgba = im - return im + # rotate image 180 degrees so orientation agrees with e.g. + # a PlotWindow plot + return np.rot90(im, k=2) def add_camera(self, data_source=None, lens_type='plane-parallel', auto=False): @@ -641,10 +674,12 @@ Parameters ---------- - ds : :class:`yt.data_objects.api.Dataset` + ds : :class:`yt.data_objects.static_output.Dataset` This is the dataset object corresponding to the simulation being rendered. Used to get the domain bounds. - + color : array_like of shape (4,), optional + The RGBA value to use to draw the domain boundaries. + Default is black with an alpha of 1.0. Examples -------- @@ -712,9 +747,9 @@ Parameters ---------- - colors: array of ints, shape (4), optional + color : array_like of shape (4,), optional The RGBA value to use to draw the mesh lines. - Default is black. + Default is black with an alpha of 1.0. alpha : float, optional The opacity of the mesh lines. Default is 255 (solid). @@ -733,8 +768,11 @@ Parameters ---------- - colors: array-like, shape (3,4), optional - The x, y, z RGBA values to use to draw the axes. + colors: array-like of shape (3,4), optional + The RGBA values to use to draw the x, y, and z vectors. The default + is [[1, 0, 0, alpha], [0, 1, 0, alpha], [0, 0, 1, alpha]] where + ``alpha`` is set by the parameter below. If ``colors`` is set then + ``alpha`` is ignored. alpha : float, optional The opacity of the vectors. @@ -795,7 +833,7 @@ Parameters ---------- - input_array : iterable + input_array : Iterable A tuple, list, or array to attach units to input_units : String unit specification, unit symbol object, or astropy units object diff -Nru yt-3.3.3/yt/visualization/volume_rendering/shader_objects.py yt-3.4.0/yt/visualization/volume_rendering/shader_objects.py --- yt-3.3.3/yt/visualization/volume_rendering/shader_objects.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/shader_objects.py 2017-08-10 18:02:57.000000000 +0000 @@ -23,6 +23,7 @@ YTInvalidShaderType, \ YTUnknownUniformKind, \ YTUnknownUniformSize +from yt.units.yt_array import YTQuantity known_shaders = {} @@ -83,7 +84,7 @@ # but we will not be using that here. if isinstance(value, int): return GL.glUniform1i - elif isinstance(value, float): + elif isinstance(value, (YTQuantity, float)): return GL.glUniform1f else: kind = value.dtype.kind diff -Nru yt-3.3.3/yt/visualization/volume_rendering/tests/test_camera_attributes.py yt-3.4.0/yt/visualization/volume_rendering/tests/test_camera_attributes.py --- yt-3.3.3/yt/visualization/volume_rendering/tests/test_camera_attributes.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/tests/test_camera_attributes.py 2017-08-10 18:02:57.000000000 +0000 @@ -110,3 +110,12 @@ for lens_type in valid_lens_types: cam.set_lens(lens_type) + + # See issue #1287 + cam.focus = [0, 0, 0] + cam_pos = [1, 0, 0] + north_vector = [0, 1, 0] + cam.set_position(cam_pos, north_vector) + cam_pos = [0, 1, 0] + north_vector = [0, 0, 1] + cam.set_position(cam_pos, north_vector) diff -Nru yt-3.3.3/yt/visualization/volume_rendering/tests/test_mesh_render.py yt-3.4.0/yt/visualization/volume_rendering/tests/test_mesh_render.py --- yt-3.3.3/yt/visualization/volume_rendering/tests/test_mesh_render.py 2016-12-12 01:41:07.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/tests/test_mesh_render.py 2017-08-10 18:02:57.000000000 +0000 @@ -40,6 +40,8 @@ ds = fake_tetrahedral_ds() for field in ds.field_list: + if field[0] == 'all': + continue sc = Scene() sc.add_source(MeshSource(ds, field)) sc.add_camera() @@ -48,6 +50,8 @@ ds = fake_hexahedral_ds() for field in ds.field_list: + if field[0] == 'all': + continue sc = Scene() sc.add_source(MeshSource(ds, field)) sc.add_camera() @@ -55,7 +59,7 @@ images.append(im) return images - + @requires_module("pyembree") def test_surface_mesh_render_pyembree(): ytcfg["yt", "ray_tracing_engine"] = "embree" @@ -145,7 +149,7 @@ im = sc.render() return compare(ds, im, "%s_render_answers_wedge6_%s_%s" % (engine, field[0], field[1])) - + @requires_ds(wedge6) @requires_module("pyembree") def test_wedge6_render_pyembree(): @@ -157,6 +161,30 @@ for field in wedge6_fields: yield wedge6_render("yt", field) +tet10 = "SecondOrderTets/tet10_unstructured_out.e" +tet10_fields = [('connect1', 'uz')] + +def tet10_render(engine, field): + ytcfg["yt", "ray_tracing_engine"] = engine + ds = data_dir_load(tet10, kwargs={'step':-1}) + sc = create_scene(ds, field) + ms = sc.get_source(0) + ms.color_bounds = (-.01, .2) + im = sc.render() + return compare(ds, im, "%s_render_answers_tet10_%s_%s" % + (engine, field[0], field[1])) + +@requires_ds(tet10) +@requires_module("pyembree") +def test_tet10_render_pyembree(): + for field in tet10_fields: + yield tet10_render("embree", field) + +@requires_ds(tet10) +def test_tet10_render(): + for field in tet10_fields: + yield tet10_render("yt", field) + def perspective_mesh_render(engine): ytcfg["yt", "ray_tracing_engine"] = engine ds = data_dir_load(hex8) @@ -169,7 +197,7 @@ cam.resolution = (800, 800) im = sc.render() return compare(ds, im, "%s_perspective_mesh_render" % engine) - + @requires_ds(hex8) @requires_module("pyembree") def test_perspective_mesh_render_pyembree(): @@ -195,7 +223,7 @@ sc.add_source(ms2) im = sc.render() return compare(ds, im, "%s_composite_mesh_render" % engine) - + @requires_ds(hex8) @requires_module("pyembree") def test_composite_mesh_render_pyembree(): diff -Nru yt-3.3.3/yt/visualization/volume_rendering/tests/test_scene.py yt-3.4.0/yt/visualization/volume_rendering/tests/test_scene.py --- yt-3.3.3/yt/visualization/volume_rendering/tests/test_scene.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/tests/test_scene.py 2017-08-10 18:02:57.000000000 +0000 @@ -16,7 +16,9 @@ import os import tempfile import shutil -from yt.testing import fake_random_ds +from yt.testing import \ + fake_random_ds, \ + assert_fname from yt.visualization.volume_rendering.api import volume_render, VolumeSource import numpy as np from unittest import TestCase @@ -48,8 +50,8 @@ shutil.rmtree(self.tmpdir) def test_rotation(self): - ds = fake_random_ds(64) - ds2 = fake_random_ds(64) + ds = fake_random_ds(32) + ds2 = fake_random_ds(32) dd = ds.sphere(ds.domain_center, ds.domain_width[0] / 2) dd2 = ds2.sphere(ds2.domain_center, ds2.domain_width[0] / 2) @@ -78,7 +80,10 @@ ma_bound = ((ma-mi)*(0.90))+mi tf.map_to_colormap(mi_bound, ma_bound, scale=0.01, colormap='Reds_r') sc.render() - sc.save('test_scene.png', sigma_clip=6.0) + for suffix in ['png', 'eps', 'ps', 'pdf']: + fname = 'test_scene.{}'.format(suffix) + sc.save(fname, sigma_clip=6.0) + assert_fname(fname) nrot = 2 for i in range(nrot): diff -Nru yt-3.3.3/yt/visualization/volume_rendering/tests/test_varia.py yt-3.4.0/yt/visualization/volume_rendering/tests/test_varia.py --- yt-3.3.3/yt/visualization/volume_rendering/tests/test_varia.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/tests/test_varia.py 2017-08-10 18:02:57.000000000 +0000 @@ -46,6 +46,7 @@ if self.use_tmpdir: os.chdir(self.curdir) shutil.rmtree(self.tmpdir) + del self.ds def test_simple_scene_creation(self): yt.create_scene(self.ds) @@ -72,7 +73,7 @@ im, sc = yt.volume_render(self.ds) angle = 2 * np.pi - frames = 10 + frames = 4 for i in range(frames): sc.camera.yaw(angle / frames) sc.render() diff -Nru yt-3.3.3/yt/visualization/volume_rendering/tests/test_vr_cameras.py yt-3.4.0/yt/visualization/volume_rendering/tests/test_vr_cameras.py --- yt-3.3.3/yt/visualization/volume_rendering/tests/test_vr_cameras.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/tests/test_vr_cameras.py 2017-08-10 18:02:57.000000000 +0000 @@ -18,14 +18,14 @@ import tempfile import shutil from yt.testing import \ - fake_random_ds + fake_random_ds, \ + assert_fname import numpy as np from yt.visualization.volume_rendering.old_camera import \ PerspectiveCamera, StereoPairCamera, InteractiveCamera, ProjectionCamera, \ FisheyeCamera from yt.visualization.volume_rendering.api import ColorTransferFunction, \ ProjectionTransferFunction -from yt.visualization.tests.test_plotwindow import assert_fname from unittest import TestCase diff -Nru yt-3.3.3/yt/visualization/volume_rendering/tests/test_vr_orientation.py yt-3.4.0/yt/visualization/volume_rendering/tests/test_vr_orientation.py --- yt-3.3.3/yt/visualization/volume_rendering/tests/test_vr_orientation.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/tests/test_vr_orientation.py 2017-08-10 17:56:56.000000000 +0000 @@ -31,6 +31,7 @@ sc = Scene() vol = VolumeSource(ds, field=('gas', 'density')) + sc.add_source(vol) tf = vol.transfer_function tf = ColorTransferFunction((0.1, 1.0)) @@ -53,7 +54,6 @@ north_vector=[0., 0., 1.]) cam.set_width(ds.domain_width*2.) - sc.add_source(vol) yield VRImageComparisonTest( sc, ds, '%s_%04d' % (lens_type, frame), decimals) diff -Nru yt-3.3.3/yt/visualization/volume_rendering/tests/test_zbuff.py yt-3.4.0/yt/visualization/volume_rendering/tests/test_zbuff.py --- yt-3.3.3/yt/visualization/volume_rendering/tests/test_zbuff.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/tests/test_zbuff.py 2017-08-10 18:02:57.000000000 +0000 @@ -81,7 +81,6 @@ im = sc.render() im.write_png("composite.png") - return im def test_nonrectangular_add(self): rgba1 = np.ones((64, 1, 4)) diff -Nru yt-3.3.3/yt/visualization/volume_rendering/transfer_function_helper.py yt-3.4.0/yt/visualization/volume_rendering/transfer_function_helper.py --- yt-3.3.3/yt/visualization/volume_rendering/transfer_function_helper.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/transfer_function_helper.py 2017-08-10 17:56:56.000000000 +0000 @@ -14,12 +14,16 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +import matplotlib +import numpy as np + +from distutils.version import LooseVersion + from yt.funcs import mylog from yt.data_objects.profiles import create_profile from yt.visualization.volume_rendering.transfer_functions import \ ColorTransferFunction from yt.extern.six import BytesIO -import numpy as np class TransferFunctionHelper(object): @@ -138,7 +142,11 @@ transfer function to produce a natural contrast ratio. """ - self.tf.add_layers(10, colormap='spectral') + if LooseVersion(matplotlib.__version__) < LooseVersion('2.0.0'): + colormap_name = 'spectral' + else: + colormap_name = 'nipy_spectral' + self.tf.add_layers(10, colormap=colormap_name) factor = self.tf.funcs[-1].y.size / self.tf.funcs[-1].y.sum() self.tf.funcs[-1].y *= 2*factor diff -Nru yt-3.3.3/yt/visualization/volume_rendering/transfer_functions.py yt-3.4.0/yt/visualization/volume_rendering/transfer_functions.py --- yt-3.3.3/yt/visualization/volume_rendering/transfer_functions.py 2016-11-30 17:07:56.000000000 +0000 +++ yt-3.4.0/yt/visualization/volume_rendering/transfer_functions.py 2017-08-10 18:02:57.000000000 +0000 @@ -654,10 +654,10 @@ colormap : string, optional An acceptable colormap. See either yt.visualization.color_maps or http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps . - col_bounds: array_like [min, max], optional - Limits the values over which the colormap spans to these - values. Useful for sampling an entire colormap over a - range smaller than the transfer function bounds. + col_bounds: array_like, optional + Limits ([min, max]) the values over which the colormap spans to + these values. Useful for sampling an entire colormap over a range + smaller than the transfer function bounds. See Also -------- @@ -702,7 +702,7 @@ colormap : string, optional An acceptable colormap. See either yt.visualization.color_maps or http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps . - scale_func: function(value, minval, maxval), optional + scale_func: function(:obj:`!value`, :obj:`!minval`, :obj:`!maxval`), optional A user-defined function that can be used to scale the alpha channel as a function of the TransferFunction field values. Function maps value to somewhere between minval and maxval. @@ -769,10 +769,10 @@ colormap : string, optional An acceptable colormap. See either yt.visualization.color_maps or http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps . - col_bounds: array_like [min, max], optional - Limits the values over which the colormap spans to these - values. Useful for sampling an entire colormap over a - range smaller than the transfer function bounds. + col_bounds: array_like, optional + Limits ([min, max]) the values over which the colormap spans to + these values. Useful for sampling an entire colormap over a range + smaller than the transfer function bounds. See Also -------- diff -Nru yt-3.3.3/yt.egg-info/PKG-INFO yt-3.4.0/yt.egg-info/PKG-INFO --- yt-3.3.3/yt.egg-info/PKG-INFO 2016-12-12 01:42:05.000000000 +0000 +++ yt-3.4.0/yt.egg-info/PKG-INFO 2017-08-10 18:20:59.000000000 +0000 @@ -1,12 +1,174 @@ Metadata-Version: 1.1 Name: yt -Version: 3.3.3 -Summary: An analysis and visualization toolkit for Astrophysical simulations, focusing on Adaptive Mesh Refinement data from Enzo, Orion, FLASH, and others. +Version: 3.4.0 +Summary: An analysis and visualization toolkit for volumetric data Home-page: http://yt-project.org/ Author: The yt project Author-email: yt-dev@lists.spacepope.org -License: BSD -Description: UNKNOWN +License: BSD 3-Clause +Description: The yt Project + ============== + + |Users' Mailing List| |Devel Mailing List| |Build Status| |Latest + Documentation| |Data Hub| |Powered by NumFOCUS| + + yt is an open-source, permissively-licensed python package for analyzing + and visualizing volumetric data. + + yt supports structured, variable-resolution meshes, unstructured meshes, + and discrete or sampled data such as particles. Focused on driving + physically-meaningful inquiry, yt has been applied in domains such as + astrophysics, seismology, nuclear engineering, molecular dynamics, and + oceanography. Composed of a friendly community of users and developers, + we want to make it easy to use and develop - we'd love it if you got + involved! + + We've written a `method + paper `__ you may be + interested in; if you use yt in the preparation of a publication, please + consider citing it. + + Installation + ------------ + + If you're using conda with + `conda-forge `__, you can install the + most recent stable version by running: + + :: + + conda install -c conda-forge yt + + or by doing: + + :: + + pip install yt + + If you want the latest nightly build, you can manually install from our + repository: + + :: + + conda install -c http://use.yt/with_conda yt + + To get set up with a development version, you can clone this repository + and install like this: + + :: + + git clone https://github.com/yt-project/yt yt-git + cd yt-git + pip install -e . + + To set up yt in a virtualenv (and there are `many good + reasons `__ + to do so!) you can follow this prescription: + + :: + + # Assuming you have cd'd into yt-git + # It is conventional to create virtualenvs at ~/.virtualenv/ + $ mkdir -p ~/.virtualenv + # Assuming your version of Python 3 is 3.4 or higher, + # create a virtualenv named yt + $ python3 -m venv ~/.virtualenv/yt + # Activate it + $ source ~/.virtualenv/yt/bin/activate + # Make sure you run the latest version of pip + $ pip install --upgrade pip + $ pip install -e . + # Output installed packages + $ pip freeze + + Getting Started + --------------- + + yt is designed to provide meaningful analysis of data. We have some + Quickstart example notebooks in the repository: + + - `Introduction `__ + - `Data Inspection `__ + - `Simple + Visualization `__ + - `Data Objects and Time + Series `__ + - `Derived Fields and + Profiles `__ + - `Volume + Rendering `__ + + If you'd like to try these online, you can visit our `yt + Hub `__ and run a notebook next to some of our example + data. + + Contributing + ------------ + + We love contributions! yt is open source, built on open source, and we'd + love to have you hang out in our community. + + We have developed some `guidelines `__ for + contributing to yt. + + **Imposter syndrome disclaimer**: We want your help. No, really. + + There may be a little voice inside your head that is telling you that + you're not ready to be an open source contributor; that your skills + aren't nearly good enough to contribute. What could you possibly offer a + project like this one? + + We assure you - the little voice in your head is wrong. If you can write + code at all, you can contribute code to open source. Contributing to + open source projects is a fantastic way to advance one's coding skills. + Writing perfect code isn't the measure of a good developer (that would + disqualify all of us!); it's trying to create something, making + mistakes, and learning from those mistakes. That's how we all improve, + and we are happy to help others learn. + + Being an open source contributor doesn't just mean writing code, either. + You can help out by writing documentation, tests, or even giving + feedback about the project (and yes - that includes giving feedback + about the contribution process). Some of these contributions may be the + most valuable to the project as a whole, because you're coming to the + project with fresh eyes, so you can see the errors and assumptions that + seasoned contributors have glossed over. + + (This disclaimer was originally written by `Adrienne + Lowe `__ for a `PyCon + talk `__, and was adapted + by yt based on its use in the README file for the `MetPy + project `__) + + Resources + --------- + + We have some community and documentation resources available. + + - Our latest documentation is always at http://yt-project.org/docs/dev/ + and it includes recipes, tutorials, and API documentation + - The `discussion mailing + list `__ + should be your first stop for general questions + - The `development mailing + list `__ + is better suited for more development issues + - You can also join us on Slack at yt-project.slack.com (`request an + invite `__) + + .. |Users' Mailing List| image:: https://img.shields.io/badge/Users-List-lightgrey.svg + :target: http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org/ + .. |Devel Mailing List| image:: https://img.shields.io/badge/Devel-List-lightgrey.svg + :target: http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org/ + .. |Build Status| image:: https://img.shields.io/travis/yt-project/yt.svg?branch=master + :target: https://travis-ci.org/yt-project/yt + .. |Latest Documentation| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg + :target: http://yt-project.org/docs/dev/ + .. |Data Hub| image:: https://img.shields.io/badge/data-hub-orange.svg + :target: https://hub.yt/ + .. |Powered by NumFOCUS| image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A + :target: http://numfocus.org + Keywords: astronomy astrophysics visualization amr adaptivemeshrefinement Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable diff -Nru yt-3.3.3/yt.egg-info/requires.txt yt-3.4.0/yt.egg-info/requires.txt --- yt-3.3.3/yt.egg-info/requires.txt 2016-12-12 01:42:05.000000000 +0000 +++ yt-3.4.0/yt.egg-info/requires.txt 2017-08-10 18:20:59.000000000 +0000 @@ -1,6 +1,8 @@ -matplotlib +matplotlib>=1.5.3 setuptools>=19.6 -sympy -numpy -IPython -cython +sympy>=1.0 +numpy>=1.10.4 +IPython>=1.0 + +[hub] +girder_client diff -Nru yt-3.3.3/yt.egg-info/SOURCES.txt yt-3.4.0/yt.egg-info/SOURCES.txt --- yt-3.3.3/yt.egg-info/SOURCES.txt 2016-12-12 01:42:08.000000000 +0000 +++ yt-3.4.0/yt.egg-info/SOURCES.txt 2017-08-10 18:21:02.000000000 +0000 @@ -3,7 +3,7 @@ COPYING.txt CREDITS MANIFEST.in -README +README.md setup.cfg setup.py setupext.py @@ -16,9 +16,11 @@ doc/get_yt.sh doc/install_script.sh doc/extensions/README +doc/extensions/config_help.py doc/extensions/pythonscript_sphinxext.py doc/extensions/yt_colormaps.py doc/extensions/yt_cookbook.py +doc/extensions/yt_showfields.py doc/helper_scripts/code_support.py doc/helper_scripts/generate_doap.py doc/helper_scripts/parse_cb_list.py @@ -32,12 +34,20 @@ doc/source/conf.py doc/source/index.rst doc/source/installing.rst +doc/source/sharing_data.rst doc/source/yt3differences.rst +doc/source/_static/apiKey01.jpg +doc/source/_static/apiKey02.jpg +doc/source/_static/apiKey03.jpg +doc/source/_static/apiKey04.jpg doc/source/_static/custom.css doc/source/_static/yt_icon.png +doc/source/_static/yt_logo.png +doc/source/_static/yt_logo.svg doc/source/_templates/layout.html doc/source/_templates/autosummary/class.rst doc/source/about/index.rst +doc/source/analyzing/Particle_Trajectories.ipynb doc/source/analyzing/fields.rst doc/source/analyzing/filtering.rst doc/source/analyzing/generating_processed_data.rst @@ -47,6 +57,7 @@ doc/source/analyzing/objects.rst doc/source/analyzing/parallel_computation.rst doc/source/analyzing/particle_filter.ipynb +doc/source/analyzing/particle_trajectories.rst doc/source/analyzing/saving_data.rst doc/source/analyzing/time_series_analysis.rst doc/source/analyzing/_static/axes.c @@ -55,8 +66,8 @@ doc/source/analyzing/_static/axes_calculator_setup.txt doc/source/analyzing/analysis_modules/PPVCube.ipynb doc/source/analyzing/analysis_modules/ParallelHaloFinder.pdf -doc/source/analyzing/analysis_modules/Particle_Trajectories.ipynb doc/source/analyzing/analysis_modules/SZ_projections.ipynb +doc/source/analyzing/analysis_modules/XrayEmissionFields.ipynb doc/source/analyzing/analysis_modules/absorption_spectrum.rst doc/source/analyzing/analysis_modules/clump_finding.rst doc/source/analyzing/analysis_modules/cosmology_calculator.rst @@ -70,7 +81,6 @@ doc/source/analyzing/analysis_modules/index.rst doc/source/analyzing/analysis_modules/light_cone_generator.rst doc/source/analyzing/analysis_modules/light_ray_generator.rst -doc/source/analyzing/analysis_modules/particle_trajectories.rst doc/source/analyzing/analysis_modules/photon_simulator.rst doc/source/analyzing/analysis_modules/planning_cosmology_simulations.rst doc/source/analyzing/analysis_modules/ppv_cubes.rst @@ -168,6 +178,7 @@ doc/source/cookbook/index.rst doc/source/cookbook/light_cone_projection.py doc/source/cookbook/light_ray.py +doc/source/cookbook/matplotlib-animation.py doc/source/cookbook/multi_plot_3x2_FRB.py doc/source/cookbook/multi_plot_slice_and_proj.py doc/source/cookbook/multi_width_image.py @@ -189,13 +200,15 @@ doc/source/cookbook/particle_xvz_plot.py doc/source/cookbook/particle_xy_plot.py doc/source/cookbook/power_spectrum_example.py -doc/source/cookbook/profile_with_variance.py +doc/source/cookbook/profile_with_standard_deviation.py doc/source/cookbook/rad_velocity.py doc/source/cookbook/radial_profile_styles.py +doc/source/cookbook/render_two_fields.py doc/source/cookbook/rendering_with_box_and_grids.py doc/source/cookbook/rockstar_nest.py doc/source/cookbook/show_hide_axes_colorbar.py doc/source/cookbook/sigma_clip.py +doc/source/cookbook/simple_1d_line_plot.py doc/source/cookbook/simple_contour_in_slice.py doc/source/cookbook/simple_off_axis_projection.py doc/source/cookbook/simple_off_axis_slice.py @@ -403,7 +416,6 @@ yt/analysis_modules/level_sets/tests/test_clump_finding.py yt/analysis_modules/particle_trajectories/__init__.py yt/analysis_modules/particle_trajectories/api.py -yt/analysis_modules/particle_trajectories/particle_trajectories.py yt/analysis_modules/photon_simulator/__init__.py yt/analysis_modules/photon_simulator/api.py yt/analysis_modules/photon_simulator/photon_models.py @@ -430,7 +442,6 @@ yt/analysis_modules/radmc3d_export/tests/test_radmc3d_exporter.py yt/analysis_modules/spectral_integrator/__init__.py yt/analysis_modules/spectral_integrator/api.py -yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py yt/analysis_modules/star_analysis/__init__.py yt/analysis_modules/star_analysis/api.py yt/analysis_modules/star_analysis/sfr_spectrum.py @@ -451,20 +462,25 @@ yt/data_objects/construction_data_containers.py yt/data_objects/data_containers.py yt/data_objects/derived_quantities.py +yt/data_objects/field_data.py yt/data_objects/grid_patch.py yt/data_objects/image_array.py yt/data_objects/octree_subset.py yt/data_objects/particle_filters.py yt/data_objects/particle_io.py +yt/data_objects/particle_trajectories.py yt/data_objects/particle_unions.py yt/data_objects/profiles.py yt/data_objects/region_expression.py yt/data_objects/selection_data_containers.py yt/data_objects/static_output.py yt/data_objects/time_series.py +yt/data_objects/unions.py yt/data_objects/unstructured_mesh.py yt/data_objects/tests/__init__.py +yt/data_objects/tests/test_boolean_regions.py yt/data_objects/tests/test_chunking.py +yt/data_objects/tests/test_clone.py yt/data_objects/tests/test_compose.py yt/data_objects/tests/test_connected_sets.py yt/data_objects/tests/test_covering_grid.py @@ -479,11 +495,14 @@ yt/data_objects/tests/test_numpy_ops.py yt/data_objects/tests/test_ortho_rays.py yt/data_objects/tests/test_particle_filter.py +yt/data_objects/tests/test_particle_trajectories.py yt/data_objects/tests/test_pickle.py yt/data_objects/tests/test_points.py yt/data_objects/tests/test_profiles.py yt/data_objects/tests/test_projection.py yt/data_objects/tests/test_rays.py +yt/data_objects/tests/test_refinement.py +yt/data_objects/tests/test_regions.py yt/data_objects/tests/test_slice.py yt/data_objects/tests/test_spheres.py yt/data_objects/tests/test_streamlines.py @@ -529,13 +548,23 @@ yt/fields/particle_fields.py yt/fields/species_fields.py yt/fields/vector_operations.py +yt/fields/xray_emission_fields.py yt/fields/tests/__init__.py yt/fields/tests/test_field_access.py yt/fields/tests/test_field_name_container.py yt/fields/tests/test_fields.py +yt/fields/tests/test_fields_plugins.py yt/fields/tests/test_magnetic_fields.py +yt/fields/tests/test_xray_fields.py yt/frontends/__init__.py yt/frontends/api.py +yt/frontends/ahf/__init__.py +yt/frontends/ahf/api.py +yt/frontends/ahf/data_structures.py +yt/frontends/ahf/fields.py +yt/frontends/ahf/io.py +yt/frontends/ahf/tests/__init__.py +yt/frontends/ahf/tests/test_outputs.py yt/frontends/art/__init__.py yt/frontends/art/api.py yt/frontends/art/data_structures.py @@ -580,6 +609,15 @@ yt/frontends/athena/misc.py yt/frontends/athena/tests/__init__.py yt/frontends/athena/tests/test_outputs.py +yt/frontends/athena_pp/__init__.py +yt/frontends/athena_pp/api.py +yt/frontends/athena_pp/data_structures.py +yt/frontends/athena_pp/definitions.py +yt/frontends/athena_pp/fields.py +yt/frontends/athena_pp/io.py +yt/frontends/athena_pp/misc.py +yt/frontends/athena_pp/tests/__init__.py +yt/frontends/athena_pp/tests/test_outputs.py yt/frontends/boxlib/__init__.py yt/frontends/boxlib/api.py yt/frontends/boxlib/data_structures.py @@ -588,7 +626,7 @@ yt/frontends/boxlib/io.py yt/frontends/boxlib/misc.py yt/frontends/boxlib/tests/__init__.py -yt/frontends/boxlib/tests/test_orion.py +yt/frontends/boxlib/tests/test_outputs.py yt/frontends/chombo/__init__.py yt/frontends/chombo/api.py yt/frontends/chombo/data_structures.py @@ -617,6 +655,15 @@ yt/frontends/enzo/simulation_handling.py yt/frontends/enzo/tests/__init__.py yt/frontends/enzo/tests/test_outputs.py +yt/frontends/enzo_p/__init__.py +yt/frontends/enzo_p/api.py +yt/frontends/enzo_p/data_structures.py +yt/frontends/enzo_p/definitions.py +yt/frontends/enzo_p/fields.py +yt/frontends/enzo_p/io.py +yt/frontends/enzo_p/misc.py +yt/frontends/enzo_p/tests/__init__.py +yt/frontends/enzo_p/tests/test_outputs.py yt/frontends/exodus_ii/__init__.py yt/frontends/exodus_ii/api.py yt/frontends/exodus_ii/data_structures.py @@ -704,6 +751,15 @@ yt/frontends/moab/misc.py yt/frontends/moab/tests/__init__.py yt/frontends/moab/tests/test_c5.py +yt/frontends/open_pmd/__init__.py +yt/frontends/open_pmd/api.py +yt/frontends/open_pmd/data_structures.py +yt/frontends/open_pmd/definitions.py +yt/frontends/open_pmd/fields.py +yt/frontends/open_pmd/io.py +yt/frontends/open_pmd/misc.py +yt/frontends/open_pmd/tests/__init__.py +yt/frontends/open_pmd/tests/test_outputs.py yt/frontends/owls/__init__.py yt/frontends/owls/api.py yt/frontends/owls/data_structures.py @@ -765,6 +821,7 @@ yt/frontends/stream/tests/test_stream_hexahedral.py yt/frontends/stream/tests/test_stream_octree.py yt/frontends/stream/tests/test_stream_particles.py +yt/frontends/stream/tests/test_stream_unstructured.py yt/frontends/stream/tests/test_update_data.py yt/frontends/tipsy/__init__.py yt/frontends/tipsy/api.py @@ -823,6 +880,7 @@ yt/geometry/coordinates/polar_coordinates.py yt/geometry/coordinates/spec_cube_coordinates.py yt/geometry/coordinates/spherical_coordinates.py +yt/geometry/coordinates/tests/test_axial_pixelization.py yt/geometry/coordinates/tests/test_cartesian_coordinates.py yt/geometry/coordinates/tests/test_cylindrical_coordinates.py yt/geometry/coordinates/tests/test_geographic_coordinates.py @@ -847,6 +905,7 @@ yt/units/unit_systems.py yt/units/yt_array.py yt/units/tests/__init__.py +yt/units/tests/test_define_unit.py yt/units/tests/test_unit_systems.py yt/units/tests/test_units.py yt/units/tests/test_ytarray.py @@ -854,11 +913,11 @@ yt/utilities/api.py yt/utilities/chemical_formulas.py yt/utilities/command_line.py +yt/utilities/configure.py yt/utilities/cosmology.py yt/utilities/decompose.py yt/utilities/definitions.py yt/utilities/exceptions.py -yt/utilities/exodusII_reader.py yt/utilities/file_handler.py yt/utilities/fits_image.py yt/utilities/flagging_methods.py @@ -871,8 +930,11 @@ yt/utilities/logger.py yt/utilities/lru_cache.py yt/utilities/math_utils.py +yt/utilities/mesh_code_generation.py +yt/utilities/mesh_types.yaml yt/utilities/metadata.py yt/utilities/minimal_representation.py +yt/utilities/nodal_data_utils.py yt/utilities/on_demand_imports.py yt/utilities/operator_registry.py yt/utilities/orientation.py @@ -885,6 +947,7 @@ yt/utilities/png_writer.py yt/utilities/rpdb.py yt/utilities/sdf.py +yt/utilities/tree_container.py yt/utilities/voropp.pyx yt/utilities/amr_kdtree/__init__.py yt/utilities/amr_kdtree/amr_kdtools.py @@ -906,12 +969,18 @@ yt/utilities/grid_data_format/tests/__init__.py yt/utilities/grid_data_format/tests/test_writer.py yt/utilities/lib/__init__.py +yt/utilities/lib/allocation_container.c +yt/utilities/lib/allocation_container.pxd +yt/utilities/lib/allocation_container.pyx yt/utilities/lib/alt_ray_tracers.c yt/utilities/lib/alt_ray_tracers.pyx yt/utilities/lib/amr_kdtools.c yt/utilities/lib/amr_kdtools.pxd yt/utilities/lib/amr_kdtools.pyx yt/utilities/lib/api.py +yt/utilities/lib/autogenerated_element_samplers.c +yt/utilities/lib/autogenerated_element_samplers.pxd +yt/utilities/lib/autogenerated_element_samplers.pyx yt/utilities/lib/basic_octree.c yt/utilities/lib/basic_octree.pyx yt/utilities/lib/bitarray.c @@ -927,6 +996,9 @@ yt/utilities/lib/cosmology_time.pyx yt/utilities/lib/depth_first_octree.c yt/utilities/lib/depth_first_octree.pyx +yt/utilities/lib/distance_queue.c +yt/utilities/lib/distance_queue.pxd +yt/utilities/lib/distance_queue.pyx yt/utilities/lib/element_mappings.c yt/utilities/lib/element_mappings.pxd yt/utilities/lib/element_mappings.pyx @@ -935,6 +1007,9 @@ yt/utilities/lib/fixed_interpolator.c yt/utilities/lib/fixed_interpolator.h yt/utilities/lib/fixed_interpolator.pxd +yt/utilities/lib/fnv_hash.c +yt/utilities/lib/fnv_hash.pxd +yt/utilities/lib/fnv_hash.pyx yt/utilities/lib/fortran_reader.c yt/utilities/lib/fortran_reader.pyx yt/utilities/lib/fp_utils.pxd @@ -951,9 +1026,6 @@ yt/utilities/lib/image_utilities.pyx yt/utilities/lib/interpolators.c yt/utilities/lib/interpolators.pyx -yt/utilities/lib/kdtree.c -yt/utilities/lib/kdtree.h -yt/utilities/lib/kdtree_utils.pxd yt/utilities/lib/lenses.c yt/utilities/lib/lenses.pxd yt/utilities/lib/lenses.pyx @@ -1001,8 +1073,6 @@ yt/utilities/lib/quad_tree.pyx yt/utilities/lib/ragged_arrays.c yt/utilities/lib/ragged_arrays.pyx -yt/utilities/lib/ray_integrators.c -yt/utilities/lib/ray_integrators.pyx yt/utilities/lib/tsearch.c yt/utilities/lib/tsearch.h yt/utilities/lib/vec3_ops.pxd @@ -1010,6 +1080,7 @@ yt/utilities/lib/write_array.c yt/utilities/lib/write_array.pyx yt/utilities/lib/tests/__init__.py +yt/utilities/lib/tests/test_allocation_container.py yt/utilities/lib/tests/test_alt_ray_tracers.py yt/utilities/lib/tests/test_bitarray.py yt/utilities/lib/tests/test_bounding_volume_hierarchy.py @@ -1030,29 +1101,16 @@ yt/utilities/pyparselibconfig/__init__.py yt/utilities/pyparselibconfig/api.py yt/utilities/pyparselibconfig/libconfig.py -yt/utilities/spatial/README -yt/utilities/spatial/__init__.py -yt/utilities/spatial/ckdtree.c -yt/utilities/spatial/ckdtree.pyx -yt/utilities/spatial/common.h -yt/utilities/spatial/distance.py -yt/utilities/spatial/kdtree.py -yt/utilities/spatial/setupscons.py -yt/utilities/spatial/src/common.h -yt/utilities/spatial/src/distance.c -yt/utilities/spatial/src/distance.h -yt/utilities/spatial/src/distance_wrap.c yt/utilities/tests/__init__.py yt/utilities/tests/test_amr_kdtree.py yt/utilities/tests/test_chemical_formulas.py +yt/utilities/tests/test_config.py yt/utilities/tests/test_coordinate_conversions.py yt/utilities/tests/test_cosmology.py yt/utilities/tests/test_decompose.py -yt/utilities/tests/test_fits_image.py yt/utilities/tests/test_flagging_methods.py yt/utilities/tests/test_hierarchy_inspection.py yt/utilities/tests/test_interpolators.py -yt/utilities/tests/test_kdtrees.py yt/utilities/tests/test_minimal_representation.py yt/utilities/tests/test_particle_generator.py yt/utilities/tests/test_periodic_table.py @@ -1065,9 +1123,11 @@ yt/visualization/base_plot_types.py yt/visualization/color_maps.py yt/visualization/eps_writer.py +yt/visualization/fits_image.py yt/visualization/fixed_resolution.py yt/visualization/fixed_resolution_filters.py yt/visualization/image_writer.py +yt/visualization/line_plot.py yt/visualization/particle_plots.py yt/visualization/plot_container.py yt/visualization/plot_modifications.py @@ -1093,11 +1153,14 @@ yt/visualization/tests/test_callbacks.py yt/visualization/tests/test_export_frb.py yt/visualization/tests/test_filters.py +yt/visualization/tests/test_fits_image.py +yt/visualization/tests/test_line_plots.py yt/visualization/tests/test_mesh_slices.py yt/visualization/tests/test_offaxisprojection.py yt/visualization/tests/test_particle_plot.py yt/visualization/tests/test_plotwindow.py yt/visualization/tests/test_profile_plots.py +yt/visualization/tests/test_raw_field_slices.py yt/visualization/tests/test_splat.py yt/visualization/volume_rendering/UBVRI.py yt/visualization/volume_rendering/__init__.py